@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.
Files changed (119) hide show
  1. package/dist/esm/_core/build-plan/build-plan-task-graph.schemas.d.ts +2 -2
  2. package/dist/esm/_core/build-plan/build-plan-task-graph.schemas.d.ts.map +1 -1
  3. package/dist/esm/_core/build-plan/build-plan-task-graph.schemas.js +13 -8
  4. package/dist/esm/_core/build-plan/build-plan-task-graph.schemas.js.map +1 -1
  5. package/dist/esm/_core/build-plan/build-plan.family-aspects.d.ts.map +1 -1
  6. package/dist/esm/_core/build-plan/build-plan.family-aspects.js +13 -7
  7. package/dist/esm/_core/build-plan/build-plan.family-aspects.js.map +1 -1
  8. package/dist/esm/_core/integration-plan/integration-execution-surface-refs.schemas.d.ts +32 -0
  9. package/dist/esm/_core/integration-plan/integration-execution-surface-refs.schemas.d.ts.map +1 -0
  10. package/dist/esm/_core/integration-plan/integration-execution-surface-refs.schemas.js +47 -0
  11. package/dist/esm/_core/integration-plan/integration-execution-surface-refs.schemas.js.map +1 -0
  12. package/dist/esm/_core/integration-plan/integration-plan-generation.schemas.d.ts +7 -0
  13. package/dist/esm/_core/integration-plan/integration-plan-generation.schemas.d.ts.map +1 -1
  14. package/dist/esm/_core/integration-plan/integration-plan-generation.schemas.js +4 -1
  15. package/dist/esm/_core/integration-plan/integration-plan-generation.schemas.js.map +1 -1
  16. package/dist/esm/_core/integration-plan/integration-plan-validation.d.ts +114 -1
  17. package/dist/esm/_core/integration-plan/integration-plan-validation.d.ts.map +1 -1
  18. package/dist/esm/_core/integration-plan/integration-plan-validation.js +176 -0
  19. package/dist/esm/_core/integration-plan/integration-plan-validation.js.map +1 -1
  20. package/dist/esm/_core/integration-plan/integration-plan.family-aspects.d.ts.map +1 -1
  21. package/dist/esm/_core/integration-plan/integration-plan.family-aspects.js +17 -1
  22. package/dist/esm/_core/integration-plan/integration-plan.family-aspects.js.map +1 -1
  23. package/dist/esm/_core/integration-plan/integration-plan.schemas.d.ts +43 -5
  24. package/dist/esm/_core/integration-plan/integration-plan.schemas.d.ts.map +1 -1
  25. package/dist/esm/_core/integration-plan/integration-plan.schemas.js +75 -7
  26. package/dist/esm/_core/integration-plan/integration-plan.schemas.js.map +1 -1
  27. package/dist/esm/_core/provider-specification.schemas.d.ts +16 -1
  28. package/dist/esm/_core/provider-specification.schemas.d.ts.map +1 -1
  29. package/dist/esm/_core/provider-specification.schemas.js +21 -0
  30. package/dist/esm/_core/provider-specification.schemas.js.map +1 -1
  31. package/dist/esm/application-creation/playbooks.application-creation.schemas.d.ts +5 -4
  32. package/dist/esm/application-creation/playbooks.application-creation.schemas.d.ts.map +1 -1
  33. package/dist/esm/application-creation/playbooks.application-creation.schemas.js +5 -4
  34. package/dist/esm/application-creation/playbooks.application-creation.schemas.js.map +1 -1
  35. package/dist/esm/application-creation.exports.d.ts +1 -0
  36. package/dist/esm/application-creation.exports.d.ts.map +1 -1
  37. package/dist/esm/application-creation.exports.js +1 -0
  38. package/dist/esm/application-creation.exports.js.map +1 -1
  39. package/dist/esm/assurance/assurance-authority-basis.definitions.d.ts +1 -1
  40. package/dist/esm/assurance/assurance-authority-basis.definitions.js +1 -1
  41. package/dist/esm/assurance/assurance-authority-basis.definitions.js.map +1 -1
  42. package/dist/esm/assurance/assurance-evidence-requirement-bodies.definitions.d.ts.map +1 -1
  43. package/dist/esm/assurance/assurance-evidence-requirement-bodies.definitions.js +18 -8
  44. package/dist/esm/assurance/assurance-evidence-requirement-bodies.definitions.js.map +1 -1
  45. package/dist/esm/assurance/assurance-objective-catalog.definitions.d.ts.map +1 -1
  46. package/dist/esm/assurance/assurance-objective-catalog.definitions.js +9 -2
  47. package/dist/esm/assurance/assurance-objective-catalog.definitions.js.map +1 -1
  48. package/dist/esm/assurance/assurance-verification-requirement-bodies.definitions.d.ts.map +1 -1
  49. package/dist/esm/assurance/assurance-verification-requirement-bodies.definitions.js +8 -4
  50. package/dist/esm/assurance/assurance-verification-requirement-bodies.definitions.js.map +1 -1
  51. package/dist/esm/engine/compliance/resources/signature-requests.resource.specification.d.ts +2 -2
  52. package/dist/esm/engine/compliance/resources/signature-requests.resource.specification.d.ts.map +1 -1
  53. package/dist/esm/engine/compliance/resources/signature-requests.resource.specification.js +29 -6
  54. package/dist/esm/engine/compliance/resources/signature-requests.resource.specification.js.map +1 -1
  55. package/dist/esm/engine/engine-resource-specifications.registry.d.ts.map +1 -1
  56. package/dist/esm/engine/engine-resource-specifications.registry.js +4 -0
  57. package/dist/esm/engine/engine-resource-specifications.registry.js.map +1 -1
  58. package/dist/esm/engine/flows-actors/resources/actor-system-executions.resource.specification.d.ts.map +1 -1
  59. package/dist/esm/engine/flows-actors/resources/actor-system-executions.resource.specification.js +4 -1
  60. package/dist/esm/engine/flows-actors/resources/actor-system-executions.resource.specification.js.map +1 -1
  61. package/dist/esm/engine/flows-actors/resources/actor-tasks.resource.specification.d.ts.map +1 -1
  62. package/dist/esm/engine/flows-actors/resources/actor-tasks.resource.specification.js +3 -0
  63. package/dist/esm/engine/flows-actors/resources/actor-tasks.resource.specification.js.map +1 -1
  64. package/dist/esm/engine/flows-actors/resources/flow-actor-tasks.resource.specification.js +3 -3
  65. package/dist/esm/engine/flows-actors/resources/flow-actor-tasks.resource.specification.js.map +1 -1
  66. package/dist/esm/engine/flows-actors/resources/organization-chat-settings.resource.specification.js +1 -1
  67. package/dist/esm/engine/flows-actors/resources/organization-chat-settings.resource.specification.js.map +1 -1
  68. package/dist/esm/engine/flows-actors/resources/remote-agent-task-updates.resource.specification.d.ts +3 -0
  69. package/dist/esm/engine/flows-actors/resources/remote-agent-task-updates.resource.specification.d.ts.map +1 -0
  70. package/dist/esm/engine/flows-actors/resources/remote-agent-task-updates.resource.specification.js +98 -0
  71. package/dist/esm/engine/flows-actors/resources/remote-agent-task-updates.resource.specification.js.map +1 -0
  72. package/dist/esm/engine/flows-actors/resources/remote-agent-tasks.resource.specification.d.ts +3 -0
  73. package/dist/esm/engine/flows-actors/resources/remote-agent-tasks.resource.specification.d.ts.map +1 -0
  74. package/dist/esm/engine/flows-actors/resources/remote-agent-tasks.resource.specification.js +132 -0
  75. package/dist/esm/engine/flows-actors/resources/remote-agent-tasks.resource.specification.js.map +1 -0
  76. package/dist/esm/engine/frontend-components/app/app-layout-agent-activity-settings.frontend-component.specification.d.ts +5 -0
  77. package/dist/esm/engine/frontend-components/app/app-layout-agent-activity-settings.frontend-component.specification.d.ts.map +1 -0
  78. package/dist/esm/engine/frontend-components/app/app-layout-agent-activity-settings.frontend-component.specification.js +79 -0
  79. package/dist/esm/engine/frontend-components/app/app-layout-agent-activity-settings.frontend-component.specification.js.map +1 -0
  80. package/dist/esm/engine/frontend-components/index.d.ts +1 -0
  81. package/dist/esm/engine/frontend-components/index.d.ts.map +1 -1
  82. package/dist/esm/engine/frontend-components/index.js +3 -0
  83. package/dist/esm/engine/frontend-components/index.js.map +1 -1
  84. package/dist/esm/engine/infrastructure/resources/external-data-pipeline-states.resource.specification.js +2 -2
  85. package/dist/esm/engine/infrastructure/resources/external-data-pipeline-states.resource.specification.js.map +1 -1
  86. package/dist/esm/engine/notifications/system-emails/delegated-work.system-emails.specification.d.ts +8 -0
  87. package/dist/esm/engine/notifications/system-emails/delegated-work.system-emails.specification.d.ts.map +1 -0
  88. package/dist/esm/engine/notifications/system-emails/delegated-work.system-emails.specification.js +65 -0
  89. package/dist/esm/engine/notifications/system-emails/delegated-work.system-emails.specification.js.map +1 -0
  90. package/dist/esm/engine/notifications/system-emails/index.d.ts +1 -0
  91. package/dist/esm/engine/notifications/system-emails/index.d.ts.map +1 -1
  92. package/dist/esm/engine/notifications/system-emails/index.js +3 -1
  93. package/dist/esm/engine/notifications/system-emails/index.js.map +1 -1
  94. package/dist/esm/engine/organizations/resources/organization-units.resource.specification.js +1 -1
  95. package/dist/esm/engine/organizations/resources/organization-units.resource.specification.js.map +1 -1
  96. package/dist/esm/engine/providers/_engine-provider-shared.d.ts +5 -0
  97. package/dist/esm/engine/providers/_engine-provider-shared.d.ts.map +1 -1
  98. package/dist/esm/engine/providers/_engine-provider-shared.js +5 -0
  99. package/dist/esm/engine/providers/_engine-provider-shared.js.map +1 -1
  100. package/dist/esm/engine/providers/dropbox.provider.specification.d.ts +14 -0
  101. package/dist/esm/engine/providers/dropbox.provider.specification.d.ts.map +1 -0
  102. package/dist/esm/engine/providers/dropbox.provider.specification.js +76 -0
  103. package/dist/esm/engine/providers/dropbox.provider.specification.js.map +1 -0
  104. package/dist/esm/engine/providers/index.d.ts +3 -1
  105. package/dist/esm/engine/providers/index.d.ts.map +1 -1
  106. package/dist/esm/engine/providers/index.js +5 -2
  107. package/dist/esm/engine/providers/index.js.map +1 -1
  108. package/dist/esm/engine/users/resources/user-preferences-api-reference.examples.d.ts +1 -0
  109. package/dist/esm/engine/users/resources/user-preferences-api-reference.examples.d.ts.map +1 -1
  110. package/dist/esm/engine/users/resources/user-preferences-api-reference.examples.js +2 -0
  111. package/dist/esm/engine/users/resources/user-preferences-api-reference.examples.js.map +1 -1
  112. package/dist/esm/engine/users/resources/user-preferences.resource.specification.d.ts +1 -0
  113. package/dist/esm/engine/users/resources/user-preferences.resource.specification.d.ts.map +1 -1
  114. package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.d.ts +1 -0
  115. package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.d.ts.map +1 -1
  116. package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.js +1 -1
  117. package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.js.map +1 -1
  118. package/dist/tsconfig.build.tsbuildinfo +1 -1
  119. package/package.json +8 -8
@@ -81,7 +81,7 @@ export const externalDataPipelineStatesResourceSpecification = resourceSpecifica
81
81
  meaning: 'When the in-flight extraction pass began. Empty when no pass is underway.',
82
82
  }),
83
83
  incrementalTrack: schemaShape.incrementalTrack.objectSpec({
84
- meaning: 'The incremental track of a pipeline that reads only what changed: which change-tracking mode it uses, the fingerprint of what it extracts, the largest remote position it has loaded (its watermark), and where an in-flight incremental pass continues. Empty for a pipeline that runs full passes only.',
84
+ meaning: 'The incremental track of a pipeline that reads only what changed: which change-tracking mode it uses, the fingerprint of what it extracts with one digest per named part of it (so a reset can say which part moved), the largest remote position it has loaded (its watermark), and where an in-flight incremental pass continues. Empty for a pipeline that runs full passes only.',
85
85
  whyItMatters: 'It is independent of the full pass\'s cursor, so a long full pass and frequent incremental passes never block each other; a changed fingerprint drops the watermark, so a declaration change reaches rows that did not change remotely.',
86
86
  }),
87
87
  sourceUnreachable: schemaShape.sourceUnreachable.objectSpec({
@@ -101,7 +101,7 @@ export const externalDataPipelineStatesResourceSpecification = resourceSpecifica
101
101
  meaning: 'When the most recent run started, whatever its outcome. Empty until the pipeline first runs.',
102
102
  }),
103
103
  lastRunSummary: schemaShape.lastRunSummary.objectSpec({
104
- meaning: 'What the most recent run did on the extraction side: which track it advanced (a full pass or an incremental one), whether it started the incremental track over, whether it abandoned an in-flight full pass because the declaration changed under it, whether it completed its pass and reconciled absence, how many remote records it read, how many records the transform rejected, the load verdict, how long it took, which seeding-pass ledger record carries the per-entry load outcome, the remote partitions it did not load because no operator has assigned them to an organization unit (per partition key, with a row count), how many archived source records it left out of the load, and what pacing against the source\'s rate budget cost it: the time spent waiting for budget or for a throttling source, how many waits, and whether it stopped at its run deadline.',
104
+ meaning: 'What the most recent run did on the extraction side: which track it advanced (a full pass or an incremental one), whether it started the incremental track over and, when the declaration\'s basis changed, which parts of it moved (a partition assignment, the mapping, the owner and so on), whether it abandoned an in-flight full pass because the declaration changed under it, whether it completed its pass and reconciled absence, how many remote records it read, how many records the transform rejected, the load verdict, how long it took, which seeding-pass ledger record carries the per-entry load outcome, the remote partitions it did not load because no operator has assigned them to an organization unit (per partition key, with a row count), how many archived source records it left out of the load, and what pacing against the source\'s rate budget cost it: the time spent waiting for budget or for a throttling source, how many waits, and whether it stopped at its run deadline.',
105
105
  whyItMatters: 'The per-entry load detail deliberately lives on the seeding ledger; this summary carries the numbers only the extraction and transform stages can know. The unassigned partitions are persisted because the operator who must assign them is rarely the one who triggered the run, and a pipeline silently not loading a subsidiary\'s rows must not list as healthy. The pacing numbers tell an operator whether a pass is progressing slower than its cadence because its rate-budget ceiling is low or its source is throttling it, rather than because it failed.',
106
106
  importance: FieldSemanticImportance.PRIMARY,
107
107
  }),
@@ -1 +1 @@
1
- {"version":3,"file":"external-data-pipeline-states.resource.specification.js","sourceRoot":"","sources":["../../../../../src/engine/infrastructure/resources/external-data-pipeline-states.resource.specification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,+BAA+B,EAC/B,mCAAmC,EACnC,oEAAoE,IAAI,uBAAuB,GAChG,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAAE,qBAAqB,IAAI,EAAE,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC1F,OAAO,EAAuC,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACjI,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAE3E;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,+CAA+C,GAAmC,qBAAqB,CAClH,uBAAuB,EACvB,+BAA+B,EAC/B,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC;IACpB,OAAO,EAAE,oMAAoM;IAC7M,YAAY,EAAE,oMAAoM;IAClN,aAAa,EAAE,oKAAoK;IACnL,QAAQ,EAAE,aAAa,CAAC,SAAS;IACjC,SAAS,EAAE,uBAAuB,CAAC,cAAc;IACjD,YAAY,EAAE;QACZ,UAAU,EAAE;YACV,WAAW,EAAE,4BAA4B;YACzC,UAAU,EAAE,iCAAiC;YAC7C,UAAU,EAAE,cAAc,CAAC,MAAM;YACjC,eAAe,EAAE,mBAAmB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AE,IAAI,EAAE,sBAAsB,CAAC,aAAa,EAAE,IAAI,EAAE,uGAAuG,EAAE;aAC9J;YACD,UAAU,EAAE,IAAI;YAChB,QAAQ,EAAE;gBACR,CAAC,mCAAmC,CAAC,QAAQ,CAAC,EAAE;oBAC9C,OAAO,EAAE,+EAA+E;iBACzF;aACF;SACF;KACF;IAED,mBAAmB,EAAE;QACnB,8IAA8I;QAC9I,sKAAsK;QACtK,gUAAgU;QAChU,+IAA+I;QAC/I,8NAA8N;KAC/N;CACF,CAAC;AACF,+FAA+F;AAC/F,0FAA0F;AAC1F,gEAAgE;AAChE,EAAE,oBAAoB,EAAE,oBAAoB,CAAC,WAAW,EAAE,CAC3D,CAAC","sourcesContent":["import { LabelAudience } from '@wildo-ai/presets-components-models';\nimport {\n CodeDeclarationKind,\n CodeSymbolKind,\n FieldSemanticImportance,\n} from '@wildo-ai/zod-decorators';\nimport {\n ExternalDataPipelineStateSchema,\n ExternalDataPipelineStateVariantKey,\n externalDataPipelineStateResourceConfiguration_InitializationFactory as etlPipelineStateFactory,\n} from '@wildo-ai/saas-backend-lib/external-data-models';\nimport { CoreResourceOperation as Op, ResourcePrimaryScope } from '@wildo-ai/saas-models';\nimport { type AnyResourceSpecificationConfig, HttpResponseStatusCode, resourceSpecification } from '~wildo-specifications/_core';\nimport { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\n\n/**\n * Framework-owned specification for the internal `etlPipelineStates` resource — one bookkeeping\n * row per declared ETL pipeline (a local resource's `externalDataPipeline`), holding the persisted\n * extraction cursor and the last run's summary.\n *\n * Like `dataSeedRuns`, this is infrastructure truth rather than an end-user surface: its\n * semantic layer is operational (where is the in-flight pass, what did the last run do), and its\n * only writer is the ETL run service. There is no human-facing surface yet — the operator read\n * surface is the recorded PR-28 follow-up.\n *\n * Registry-key and type-annotation notes: identical situation to `dataSeedRuns` (a\n * `BackendResourceType` sourced from `@wildo-ai/saas-backend-lib`, outside the CORE-registry\n * alignment guard's population; the explicit `AnyResourceSpecificationConfig` annotation avoids\n * the non-portable-path TS2742) — see that spec's header for the full reasoning rather than a\n * re-derivation here.\n */\nexport const externalDataPipelineStatesResourceSpecification: AnyResourceSpecificationConfig = resourceSpecification(\n etlPipelineStateFactory,\n ExternalDataPipelineStateSchema,\n ({ schemaShape }) => ({\n purpose: 'Track one declared ETL pipeline between runs: where the current full extraction pass stands, where its incremental track stands when it reads only what changed, and what the most recent run did.',\n businessRole: 'Operational control-plane row that lets a pipeline whose remote population exceeds one run\\'s budget continue across runs and process restarts instead of re-reading the same first pages forever.',\n lifecycleRole: 'Created on the pipeline\\'s first run and updated at the end of every run; the cursor fills while a pass is in flight across runs and clears when a pass completes.',\n audience: LabelAudience.DEVELOPER,\n subDomain: EngineResourceSubDomain.INFRASTRUCTURE,\n codeHandling: {\n mainSchema: {\n packageName: '@wildo-ai/saas-backend-lib',\n exportName: 'ExternalDataPipelineStateSchema',\n symbolKind: CodeSymbolKind.SCHEMA,\n declarationKind: CodeDeclarationKind.ZOD_SCHEMA,\n },\n resourceFactory: {\n packageName: '@wildo-ai/saas-backend-lib',\n exportName: 'externalDataPipelineStateResourceConfiguration_InitializationFactory',\n symbolKind: CodeSymbolKind.FACTORY,\n declarationKind: CodeDeclarationKind.FUNCTION,\n },\n resourceType: {\n enumDeclaration: {\n packageName: '@wildo-ai/saas-backend-lib',\n exportName: 'BackendResourceType',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n memberName: 'EXTERNAL_DATA_PIPELINE_STATE',\n },\n operationVocabulary: {\n coreEnum: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'CoreResourceOperation',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n },\n },\n\n fields: {\n _id: schemaShape._id.stringSpec({\n meaning: 'Stable identifier of this pipeline\\'s bookkeeping record.',\n semanticRole: 'identifier',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n\n pipelineResourceType: schemaShape.pipelineResourceType.stringSpec({\n meaning: 'The destination resource whose declared pipeline this record tracks. One pipeline, one record.',\n whyItMatters: 'It is the row\\'s identity: every run of the same pipeline reads and updates this same row.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n\n cursor: schemaShape.cursor.stringSpec({\n meaning: 'Last accepted source continuation. Empty at the beginning, including a retry of a failed first batch.',\n whyItMatters: 'It advances with the accepted source-membership head only after a successful load, allowing restart without losing earlier source identities.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n\n passCheckpoint: schemaShape.passCheckpoint.objectSpec({\n meaning: 'Unique active pass and accepted immutable source-membership head, checkpointed together with the extraction cursor, and the fingerprint of the declaration the pass started under.',\n whyItMatters: 'A run under a different declaration fingerprint abandons the pass and starts a new one, so one pass never mixes two declarations: a changed key would otherwise orphan every row read before it, and a narrower filter would leave the rows it now excludes in place.',\n }),\n\n passStartedAt: schemaShape.passStartedAt.dateSpec({\n meaning: 'When the in-flight extraction pass began. Empty when no pass is underway.',\n }),\n\n incrementalTrack: schemaShape.incrementalTrack.objectSpec({\n meaning: 'The incremental track of a pipeline that reads only what changed: which change-tracking mode it uses, the fingerprint of what it extracts, the largest remote position it has loaded (its watermark), and where an in-flight incremental pass continues. Empty for a pipeline that runs full passes only.',\n whyItMatters: 'It is independent of the full pass\\'s cursor, so a long full pass and frequent incremental passes never block each other; a changed fingerprint drops the watermark, so a declaration change reaches rows that did not change remotely.',\n }),\n\n sourceUnreachable: schemaShape.sourceUnreachable.objectSpec({\n meaning: 'The current streak of failures to reach the pipeline\\'s system of record: when the first failure happened, how many consecutive attempts failed, how many scheduled runs were skipped while backing off, why the last attempt failed (a timeout, a network failure, an unavailable status, an unreachable token endpoint) and when the next scheduled attempt is due. Empty while the system of record is reachable.',\n whyItMatters: 'It lets scheduled runs back off from a source that is down instead of failing identically on every tick, across restarts, and it is what an operator reads to tell an address pointed at nothing from an outage in progress. The first run that reaches the source clears it; a run started by an operator never waits for it.',\n }),\n\n suppressionIdentity: schemaShape.suppressionIdentity.stringSpec({\n meaning: 'The source identity — system of record, remote entity and key shape — the pipeline last matched erasure suppressions under. Written by the first run that passes the suppression check under a new identity, or by the reconcile door. Empty until the pipeline first runs.',\n whyItMatters: 'Erasure suppressions belong to the remote entity, and any pipeline reading it may have recorded them. When the declaration moves the pipeline to another identity, this is what finds the suppressions it still owes, including ones another pipeline recorded, so the run refuses instead of copying erased people back in.',\n }),\n\n suppressionIdentityDecisions: schemaShape.suppressionIdentityDecisions.arraySpec({\n meaning: 'This pipeline\\'s decisions about the source identities it no longer has: for each one, whether it keeps matching the suppressions filed under it (carry-over) or stopped matching them (release), and when. Made through the audited reconcile door.',\n elementMeaning: 'One decision: the stale identity it is about, carry-over or release, and when the operator made it.',\n whyItMatters: 'The decision belongs to this pipeline alone; nothing is moved or re-keyed, so another pipeline on the same entity keeps its own suppressions and must decide for itself. A carried-over identity is loaded beside the current one on every run. Matching an identity again voids the decision about it, so a later move asks again. A decision is final otherwise: a release cannot be undone, only the erasure run again.',\n }),\n\n lastRunAt: schemaShape.lastRunAt.dateSpec({\n meaning: 'When the most recent run started, whatever its outcome. Empty until the pipeline first runs.',\n }),\n\n lastRunSummary: schemaShape.lastRunSummary.objectSpec({\n meaning: 'What the most recent run did on the extraction side: which track it advanced (a full pass or an incremental one), whether it started the incremental track over, whether it abandoned an in-flight full pass because the declaration changed under it, whether it completed its pass and reconciled absence, how many remote records it read, how many records the transform rejected, the load verdict, how long it took, which seeding-pass ledger record carries the per-entry load outcome, the remote partitions it did not load because no operator has assigned them to an organization unit (per partition key, with a row count), how many archived source records it left out of the load, and what pacing against the source\\'s rate budget cost it: the time spent waiting for budget or for a throttling source, how many waits, and whether it stopped at its run deadline.',\n whyItMatters: 'The per-entry load detail deliberately lives on the seeding ledger; this summary carries the numbers only the extraction and transform stages can know. The unassigned partitions are persisted because the operator who must assign them is rarely the one who triggered the run, and a pipeline silently not loading a subsidiary\\'s rows must not list as healthy. The pacing numbers tell an operator whether a pass is progressing slower than its cadence because its rate-budget ceiling is low or its source is throttling it, rather than because it failed.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n },\n\n operations: {\n [Op.CREATE]: {\n purpose: 'Open the bookkeeping row the first time a pipeline runs.',\n outcome: 'The pipeline has a durable place to persist its cursor and run summaries.',\n responseStatuses: [\n { code: HttpResponseStatusCode.CREATED_201, meaning: 'The record was created and is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The row fails schema validation.' },\n ],\n idempotent: false,\n variants: {\n [ExternalDataPipelineStateVariantKey.INTERNAL]: {\n purpose: 'Let the ETL run service open its own bookkeeping row. There is no externally reachable way to create one.',\n },\n },\n },\n\n [Op.READ]: {\n purpose: 'Read one pipeline\\'s bookkeeping row.',\n outcome: 'The run service learns whether a pass is in flight and where to resume it.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The record was found and is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No row exists for the pipeline — it has never run.' },\n ],\n idempotent: true,\n variants: {\n [ExternalDataPipelineStateVariantKey.INTERNAL]: {\n purpose: 'Let the run service recover the cursor at the start of every run.',\n },\n },\n },\n\n [Op.UPDATE]: {\n purpose: 'Persist the run\\'s outcome: the advanced or cleared cursor and the fresh summary.',\n outcome: 'The next run continues exactly where this one stopped, or starts a fresh pass.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The record was updated and is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No row exists for the supplied identifier.' },\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The patch fails schema validation.' },\n ],\n idempotent: true,\n variants: {\n [ExternalDataPipelineStateVariantKey.INTERNAL]: {\n purpose: 'Let the run service settle each run\\'s cursor and summary.',\n },\n },\n },\n\n [Op.LIST]: {\n purpose: 'Enumerate every pipeline\\'s bookkeeping row.',\n outcome: 'The scheduled batch and future operator surfaces see all pipelines\\' standing at once.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A page of bookkeeping records, possibly empty.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not a platform administrator. This row set is never exposed to ordinary tenant callers.' },\n ],\n idempotent: true,\n variants: {\n [ExternalDataPipelineStateVariantKey.INTERNAL]: {\n purpose: 'Let engine machinery enumerate pipeline standing without an external surface.',\n },\n },\n },\n },\n\n businessConstraints: [\n 'This row is bookkeeping about a pipeline, never the pipeline\\'s data: deleting it costs a restarted extraction pass, not any synced content.',\n 'A non-empty cursor means an extraction pass is still in flight, and a run resuming from it must not treat rows absent from a partial extraction as deleted remotely.',\n 'Only a full pass may conclude a remote row was deleted. An incremental pass reads what changed, and a deletion is not a change, so it never reconciles absence; while a full pass is in flight, the keys an incremental pass reads join that full pass\\'s membership so they are not mistaken for deletions when it completes.',\n 'The per-entry load outcome lives on the seeding-pass ledger this summary points at; the two records deliberately do not duplicate each other.',\n 'Only a failure to reach the system of record starts or extends an unreachable streak; a refusal, a malformed answer or a run stopped at its deadline never does, and a failed attempt leaves the last-run summary untouched.',\n ],\n }),\n // Same posture as DATA_SEED_RUN: a STANDALONE infrastructure row reached only through internal\n // repository services; the APPLICATION relationship is routing-side only, so the scope is\n // declared here rather than derived from a scope-owning parent.\n { resourcePrimaryScope: ResourcePrimaryScope.APPLICATION },\n);\n"]}
1
+ {"version":3,"file":"external-data-pipeline-states.resource.specification.js","sourceRoot":"","sources":["../../../../../src/engine/infrastructure/resources/external-data-pipeline-states.resource.specification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,+BAA+B,EAC/B,mCAAmC,EACnC,oEAAoE,IAAI,uBAAuB,GAChG,MAAM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AO,EAAE,mFAAmF;YAC5F,OAAO,EAAE,gFAAgF;YACzF,gBAAgB,EAAE;gBAChB,EAAE,IAAI,EAAE,sBAAsB,CAAC,MAAM,EAAE,OAAO,EAAE,yCAAyC,EAAE;aAC5F;YACD,cAAc,EAAE;gBACd,EAAE,IAAI,EAAE,sBAAsB,CAAC,aAAa,EAAE,IAAI,EAAE,4CAA4C,EAAE;gBAClG,EAAE,IAAI,EAAE,sBAAsB,CAAC,eAAe,EAAE,IAAI,EAAE,oCAAoC,EAAE;aAC7F;YACD,UAAU,EAAE,IAAI;YAChB,QAAQ,EAAE;gBACR,CAAC,mCAAmC,CAAC,QAAQ,CAAC,EAAE;oBAC9C,OAAO,EAAE,4DAA4D;iBACtE;aACF;SACF;QAED,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE;YACT,OAAO,EAAE,8CAA8C;YACvD,OAAO,EAAE,wFAAwF;YACjG,gBAAgB,EAAE;gBAChB,EAAE,IAAI,EAAE,sBAAsB,CAAC,MAAM,EAAE,OAAO,EAAE,gDAAgD,EAAE;aACnG;YACD,cAAc,EAAE;gBACd,EAAE,IAAI,EAAE,sBAAsB,CAAC,aAAa,EAAE,IAAI,EAAE,uGAAuG,EAAE;aAC9J;YACD,UAAU,EAAE,IAAI;YAChB,QAAQ,EAAE;gBACR,CAAC,mCAAmC,CAAC,QAAQ,CAAC,EAAE;oBAC9C,OAAO,EAAE,+EAA+E;iBACzF;aACF;SACF;KACF;IAED,mBAAmB,EAAE;QACnB,8IAA8I;QAC9I,sKAAsK;QACtK,gUAAgU;QAChU,+IAA+I;QAC/I,8NAA8N;KAC/N;CACF,CAAC;AACF,+FAA+F;AAC/F,0FAA0F;AAC1F,gEAAgE;AAChE,EAAE,oBAAoB,EAAE,oBAAoB,CAAC,WAAW,EAAE,CAC3D,CAAC","sourcesContent":["import { LabelAudience } from '@wildo-ai/presets-components-models';\nimport {\n CodeDeclarationKind,\n CodeSymbolKind,\n FieldSemanticImportance,\n} from '@wildo-ai/zod-decorators';\nimport {\n ExternalDataPipelineStateSchema,\n ExternalDataPipelineStateVariantKey,\n externalDataPipelineStateResourceConfiguration_InitializationFactory as etlPipelineStateFactory,\n} from '@wildo-ai/saas-backend-lib/external-data-models';\nimport { CoreResourceOperation as Op, ResourcePrimaryScope } from '@wildo-ai/saas-models';\nimport { type AnyResourceSpecificationConfig, HttpResponseStatusCode, resourceSpecification } from '~wildo-specifications/_core';\nimport { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\n\n/**\n * Framework-owned specification for the internal `etlPipelineStates` resource — one bookkeeping\n * row per declared ETL pipeline (a local resource's `externalDataPipeline`), holding the persisted\n * extraction cursor and the last run's summary.\n *\n * Like `dataSeedRuns`, this is infrastructure truth rather than an end-user surface: its\n * semantic layer is operational (where is the in-flight pass, what did the last run do), and its\n * only writer is the ETL run service. There is no human-facing surface yet — the operator read\n * surface is the recorded PR-28 follow-up.\n *\n * Registry-key and type-annotation notes: identical situation to `dataSeedRuns` (a\n * `BackendResourceType` sourced from `@wildo-ai/saas-backend-lib`, outside the CORE-registry\n * alignment guard's population; the explicit `AnyResourceSpecificationConfig` annotation avoids\n * the non-portable-path TS2742) — see that spec's header for the full reasoning rather than a\n * re-derivation here.\n */\nexport const externalDataPipelineStatesResourceSpecification: AnyResourceSpecificationConfig = resourceSpecification(\n etlPipelineStateFactory,\n ExternalDataPipelineStateSchema,\n ({ schemaShape }) => ({\n purpose: 'Track one declared ETL pipeline between runs: where the current full extraction pass stands, where its incremental track stands when it reads only what changed, and what the most recent run did.',\n businessRole: 'Operational control-plane row that lets a pipeline whose remote population exceeds one run\\'s budget continue across runs and process restarts instead of re-reading the same first pages forever.',\n lifecycleRole: 'Created on the pipeline\\'s first run and updated at the end of every run; the cursor fills while a pass is in flight across runs and clears when a pass completes.',\n audience: LabelAudience.DEVELOPER,\n subDomain: EngineResourceSubDomain.INFRASTRUCTURE,\n codeHandling: {\n mainSchema: {\n packageName: '@wildo-ai/saas-backend-lib',\n exportName: 'ExternalDataPipelineStateSchema',\n symbolKind: CodeSymbolKind.SCHEMA,\n declarationKind: CodeDeclarationKind.ZOD_SCHEMA,\n },\n resourceFactory: {\n packageName: '@wildo-ai/saas-backend-lib',\n exportName: 'externalDataPipelineStateResourceConfiguration_InitializationFactory',\n symbolKind: CodeSymbolKind.FACTORY,\n declarationKind: CodeDeclarationKind.FUNCTION,\n },\n resourceType: {\n enumDeclaration: {\n packageName: '@wildo-ai/saas-backend-lib',\n exportName: 'BackendResourceType',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n memberName: 'EXTERNAL_DATA_PIPELINE_STATE',\n },\n operationVocabulary: {\n coreEnum: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'CoreResourceOperation',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n },\n },\n\n fields: {\n _id: schemaShape._id.stringSpec({\n meaning: 'Stable identifier of this pipeline\\'s bookkeeping record.',\n semanticRole: 'identifier',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n\n pipelineResourceType: schemaShape.pipelineResourceType.stringSpec({\n meaning: 'The destination resource whose declared pipeline this record tracks. One pipeline, one record.',\n whyItMatters: 'It is the row\\'s identity: every run of the same pipeline reads and updates this same row.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n\n cursor: schemaShape.cursor.stringSpec({\n meaning: 'Last accepted source continuation. Empty at the beginning, including a retry of a failed first batch.',\n whyItMatters: 'It advances with the accepted source-membership head only after a successful load, allowing restart without losing earlier source identities.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n\n passCheckpoint: schemaShape.passCheckpoint.objectSpec({\n meaning: 'Unique active pass and accepted immutable source-membership head, checkpointed together with the extraction cursor, and the fingerprint of the declaration the pass started under.',\n whyItMatters: 'A run under a different declaration fingerprint abandons the pass and starts a new one, so one pass never mixes two declarations: a changed key would otherwise orphan every row read before it, and a narrower filter would leave the rows it now excludes in place.',\n }),\n\n passStartedAt: schemaShape.passStartedAt.dateSpec({\n meaning: 'When the in-flight extraction pass began. Empty when no pass is underway.',\n }),\n\n incrementalTrack: schemaShape.incrementalTrack.objectSpec({\n meaning: 'The incremental track of a pipeline that reads only what changed: which change-tracking mode it uses, the fingerprint of what it extracts with one digest per named part of it (so a reset can say which part moved), the largest remote position it has loaded (its watermark), and where an in-flight incremental pass continues. Empty for a pipeline that runs full passes only.',\n whyItMatters: 'It is independent of the full pass\\'s cursor, so a long full pass and frequent incremental passes never block each other; a changed fingerprint drops the watermark, so a declaration change reaches rows that did not change remotely.',\n }),\n\n sourceUnreachable: schemaShape.sourceUnreachable.objectSpec({\n meaning: 'The current streak of failures to reach the pipeline\\'s system of record: when the first failure happened, how many consecutive attempts failed, how many scheduled runs were skipped while backing off, why the last attempt failed (a timeout, a network failure, an unavailable status, an unreachable token endpoint) and when the next scheduled attempt is due. Empty while the system of record is reachable.',\n whyItMatters: 'It lets scheduled runs back off from a source that is down instead of failing identically on every tick, across restarts, and it is what an operator reads to tell an address pointed at nothing from an outage in progress. The first run that reaches the source clears it; a run started by an operator never waits for it.',\n }),\n\n suppressionIdentity: schemaShape.suppressionIdentity.stringSpec({\n meaning: 'The source identity — system of record, remote entity and key shape — the pipeline last matched erasure suppressions under. Written by the first run that passes the suppression check under a new identity, or by the reconcile door. Empty until the pipeline first runs.',\n whyItMatters: 'Erasure suppressions belong to the remote entity, and any pipeline reading it may have recorded them. When the declaration moves the pipeline to another identity, this is what finds the suppressions it still owes, including ones another pipeline recorded, so the run refuses instead of copying erased people back in.',\n }),\n\n suppressionIdentityDecisions: schemaShape.suppressionIdentityDecisions.arraySpec({\n meaning: 'This pipeline\\'s decisions about the source identities it no longer has: for each one, whether it keeps matching the suppressions filed under it (carry-over) or stopped matching them (release), and when. Made through the audited reconcile door.',\n elementMeaning: 'One decision: the stale identity it is about, carry-over or release, and when the operator made it.',\n whyItMatters: 'The decision belongs to this pipeline alone; nothing is moved or re-keyed, so another pipeline on the same entity keeps its own suppressions and must decide for itself. A carried-over identity is loaded beside the current one on every run. Matching an identity again voids the decision about it, so a later move asks again. A decision is final otherwise: a release cannot be undone, only the erasure run again.',\n }),\n\n lastRunAt: schemaShape.lastRunAt.dateSpec({\n meaning: 'When the most recent run started, whatever its outcome. Empty until the pipeline first runs.',\n }),\n\n lastRunSummary: schemaShape.lastRunSummary.objectSpec({\n meaning: 'What the most recent run did on the extraction side: which track it advanced (a full pass or an incremental one), whether it started the incremental track over and, when the declaration\\'s basis changed, which parts of it moved (a partition assignment, the mapping, the owner and so on), whether it abandoned an in-flight full pass because the declaration changed under it, whether it completed its pass and reconciled absence, how many remote records it read, how many records the transform rejected, the load verdict, how long it took, which seeding-pass ledger record carries the per-entry load outcome, the remote partitions it did not load because no operator has assigned them to an organization unit (per partition key, with a row count), how many archived source records it left out of the load, and what pacing against the source\\'s rate budget cost it: the time spent waiting for budget or for a throttling source, how many waits, and whether it stopped at its run deadline.',\n whyItMatters: 'The per-entry load detail deliberately lives on the seeding ledger; this summary carries the numbers only the extraction and transform stages can know. The unassigned partitions are persisted because the operator who must assign them is rarely the one who triggered the run, and a pipeline silently not loading a subsidiary\\'s rows must not list as healthy. The pacing numbers tell an operator whether a pass is progressing slower than its cadence because its rate-budget ceiling is low or its source is throttling it, rather than because it failed.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n },\n\n operations: {\n [Op.CREATE]: {\n purpose: 'Open the bookkeeping row the first time a pipeline runs.',\n outcome: 'The pipeline has a durable place to persist its cursor and run summaries.',\n responseStatuses: [\n { code: HttpResponseStatusCode.CREATED_201, meaning: 'The record was created and is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The row fails schema validation.' },\n ],\n idempotent: false,\n variants: {\n [ExternalDataPipelineStateVariantKey.INTERNAL]: {\n purpose: 'Let the ETL run service open its own bookkeeping row. There is no externally reachable way to create one.',\n },\n },\n },\n\n [Op.READ]: {\n purpose: 'Read one pipeline\\'s bookkeeping row.',\n outcome: 'The run service learns whether a pass is in flight and where to resume it.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The record was found and is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No row exists for the pipeline — it has never run.' },\n ],\n idempotent: true,\n variants: {\n [ExternalDataPipelineStateVariantKey.INTERNAL]: {\n purpose: 'Let the run service recover the cursor at the start of every run.',\n },\n },\n },\n\n [Op.UPDATE]: {\n purpose: 'Persist the run\\'s outcome: the advanced or cleared cursor and the fresh summary.',\n outcome: 'The next run continues exactly where this one stopped, or starts a fresh pass.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The record was updated and is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No row exists for the supplied identifier.' },\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The patch fails schema validation.' },\n ],\n idempotent: true,\n variants: {\n [ExternalDataPipelineStateVariantKey.INTERNAL]: {\n purpose: 'Let the run service settle each run\\'s cursor and summary.',\n },\n },\n },\n\n [Op.LIST]: {\n purpose: 'Enumerate every pipeline\\'s bookkeeping row.',\n outcome: 'The scheduled batch and future operator surfaces see all pipelines\\' standing at once.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A page of bookkeeping records, possibly empty.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not a platform administrator. This row set is never exposed to ordinary tenant callers.' },\n ],\n idempotent: true,\n variants: {\n [ExternalDataPipelineStateVariantKey.INTERNAL]: {\n purpose: 'Let engine machinery enumerate pipeline standing without an external surface.',\n },\n },\n },\n },\n\n businessConstraints: [\n 'This row is bookkeeping about a pipeline, never the pipeline\\'s data: deleting it costs a restarted extraction pass, not any synced content.',\n 'A non-empty cursor means an extraction pass is still in flight, and a run resuming from it must not treat rows absent from a partial extraction as deleted remotely.',\n 'Only a full pass may conclude a remote row was deleted. An incremental pass reads what changed, and a deletion is not a change, so it never reconciles absence; while a full pass is in flight, the keys an incremental pass reads join that full pass\\'s membership so they are not mistaken for deletions when it completes.',\n 'The per-entry load outcome lives on the seeding-pass ledger this summary points at; the two records deliberately do not duplicate each other.',\n 'Only a failure to reach the system of record starts or extends an unreachable streak; a refusal, a malformed answer or a run stopped at its deadline never does, and a failed attempt leaves the last-run summary untouched.',\n ],\n }),\n // Same posture as DATA_SEED_RUN: a STANDALONE infrastructure row reached only through internal\n // repository services; the APPLICATION relationship is routing-side only, so the scope is\n // declared here rather than derived from a scope-owning parent.\n { resourcePrimaryScope: ResourcePrimaryScope.APPLICATION },\n);\n"]}
@@ -0,0 +1,8 @@
1
+ import { type SystemEmailTemplateSpecificationConfig } from '../../../_core';
2
+ /**
3
+ * The system emails about work an application's agents handed to ANOTHER company's agent (#4013): today, the news one of
4
+ * its A2A agents reports about a delegated task.
5
+ */
6
+ export declare const remoteAgentTaskUpdatedSystemTemplateSpecification: SystemEmailTemplateSpecificationConfig;
7
+ export declare const delegatedWorkSystemEmailTemplateSpecifications: SystemEmailTemplateSpecificationConfig[];
8
+ //# sourceMappingURL=delegated-work.system-emails.specification.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delegated-work.system-emails.specification.d.ts","sourceRoot":"","sources":["../../../../../src/engine/notifications/system-emails/delegated-work.system-emails.specification.ts"],"names":[],"mappings":"AASA,OAAO,EAIL,KAAK,sCAAsC,EAC5C,MAAM,6BAA6B,CAAC;AAuBrC;;;GAGG;AACH,eAAO,MAAM,iDAAiD,wCAsC7D,CAAC;AAEF,eAAO,MAAM,8CAA8C,EAAE,sCAAsC,EAElG,CAAC"}
@@ -0,0 +1,65 @@
1
+ import { CodeDeclarationKind, CodeSymbolKind, } from '@wildo-ai/zod-decorators';
2
+ import { SystemEmailTemplateRef, SystemEmailTemplateRegistry, } from '@wildo-ai/saas-models';
3
+ import { systemEmailTemplateSpecificationFromRegistryEntry, SpecificationOwnerKind, } from '../../../_core/index.js';
4
+ /** Owner ref for engine-shipped system-email template specifications (see `security.system-emails.specification.ts`). */
5
+ const ENGINE_OWNER_REF = {
6
+ ownerId: 'engine',
7
+ ownerKind: SpecificationOwnerKind.ENGINE,
8
+ };
9
+ const TEMPLATE_REF_DECLARATION = {
10
+ packageName: '@wildo-ai/saas-models',
11
+ exportName: 'SystemEmailTemplateRef',
12
+ symbolKind: CodeSymbolKind.ENUM,
13
+ declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,
14
+ };
15
+ const EVENT_DATA_SCHEMA_SYMBOL = {
16
+ packageName: '@wildo-ai/saas-models',
17
+ exportName: 'SystemEmailTemplateRegistry',
18
+ symbolKind: CodeSymbolKind.CONFIG,
19
+ declarationKind: CodeDeclarationKind.CONST_OBJECT,
20
+ notes: ['Look up the entry by `SystemEmailTemplateRef.*` to reach the `eventDataSchema` for this template.'],
21
+ };
22
+ /**
23
+ * The system emails about work an application's agents handed to ANOTHER company's agent (#4013): today, the news one of
24
+ * its A2A agents reports about a delegated task.
25
+ */
26
+ export const remoteAgentTaskUpdatedSystemTemplateSpecification = systemEmailTemplateSpecificationFromRegistryEntry(SystemEmailTemplateRegistry[SystemEmailTemplateRef.REMOTE_AGENT_TASK_UPDATED], () => ({
27
+ purpose: 'Tell a person that another company\'s agent, to which one of their conversations with an assistant handed a task, has news about it (it finished, failed, or needs more information), so a person who is not in the application hears of it too.',
28
+ tone: 'Brief and neutral: a heads-up that something is waiting in a conversation, never an alarm.',
29
+ useWhen: 'Sent with the in-app notice `remote_agent_task_updated` when the application records a pushed update about such a task (#3930, #4013): once when the task ends, and when it asks for input or authorization — the first time, and again only after the person has taken a turn in that conversation since the last ask.',
30
+ avoidWhen: 'Never to anyone but the conversation\'s own person, never for a conversation an organization or the application owns (it has no person), and never to repeat a second delivery of the same update.',
31
+ textSlots: {
32
+ subject: {
33
+ purpose: 'Say that the agent (`{agent}`, the name the application declared for it) has news about a task, without saying what the news is.',
34
+ },
35
+ previewText: {
36
+ purpose: 'Short preview repeating the heading.',
37
+ },
38
+ body: {
39
+ purpose: 'Say that the agent, run by another company, has news about a task one of the reader\'s conversations handed to it, that it may have finished or may need something from the reader, and that opening the conversation lets their assistant go through it with them.',
40
+ notes: [
41
+ 'Never say which news it is (finished, failed, waiting): the email is sent before anyone has read the update, and the conversation is where it is read.',
42
+ 'Never quote or paraphrase anything the other company\'s agent wrote.',
43
+ ],
44
+ },
45
+ ctaLabel: {
46
+ purpose: 'Primary action label: opens the conversation at `eventData.conversationUrl` (the application\'s conversation-link page), else the application at `eventData.appUrl`.',
47
+ },
48
+ },
49
+ eventData: {
50
+ purpose: 'The agent\'s name as the application declared it, and optional conversation and application URLs. Never the remote agent\'s text, its task state, or anything from the conversation.',
51
+ },
52
+ businessConstraints: [
53
+ 'Never include the other company\'s words, the task\'s state, or anything from the conversation: the email reaches a mailbox and is sent before the update is read.',
54
+ 'Sent only to the person whose conversation handed the task on, never to an organization-wide list.',
55
+ ],
56
+ codeHandling: {
57
+ definitionOwner: ENGINE_OWNER_REF,
58
+ templateRefDeclaration: TEMPLATE_REF_DECLARATION,
59
+ eventDataSchemaSymbol: EVENT_DATA_SCHEMA_SYMBOL,
60
+ },
61
+ }));
62
+ export const delegatedWorkSystemEmailTemplateSpecifications = [
63
+ remoteAgentTaskUpdatedSystemTemplateSpecification,
64
+ ];
65
+ //# sourceMappingURL=delegated-work.system-emails.specification.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delegated-work.system-emails.specification.js","sourceRoot":"","sources":["../../../../../src/engine/notifications/system-emails/delegated-work.system-emails.specification.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,cAAc,GAEf,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,sBAAsB,EACtB,2BAA2B,GAC5B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,iDAAiD,EACjD,sBAAsB,GAGvB,MAAM,6BAA6B,CAAC;AAErC,yHAA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CACH,CAAC;AAEF,MAAM,CAAC,MAAM,8CAA8C,GAA6C;IACtG,iDAAiD;CAClD,CAAC","sourcesContent":["import {\n CodeDeclarationKind,\n CodeSymbolKind,\n type CodeSymbolRef,\n} from '@wildo-ai/zod-decorators';\nimport {\n SystemEmailTemplateRef,\n SystemEmailTemplateRegistry,\n} from '@wildo-ai/saas-models';\nimport {\n systemEmailTemplateSpecificationFromRegistryEntry,\n SpecificationOwnerKind,\n type SpecificationOwnerRef,\n type SystemEmailTemplateSpecificationConfig,\n} from '~wildo-specifications/_core';\n\n/** Owner ref for engine-shipped system-email template specifications (see `security.system-emails.specification.ts`). */\nconst ENGINE_OWNER_REF: SpecificationOwnerRef = {\n ownerId: 'engine',\n ownerKind: SpecificationOwnerKind.ENGINE,\n};\n\nconst TEMPLATE_REF_DECLARATION: CodeSymbolRef = {\n packageName: '@wildo-ai/saas-models',\n exportName: 'SystemEmailTemplateRef',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n};\n\nconst EVENT_DATA_SCHEMA_SYMBOL: CodeSymbolRef = {\n packageName: '@wildo-ai/saas-models',\n exportName: 'SystemEmailTemplateRegistry',\n symbolKind: CodeSymbolKind.CONFIG,\n declarationKind: CodeDeclarationKind.CONST_OBJECT,\n notes: ['Look up the entry by `SystemEmailTemplateRef.*` to reach the `eventDataSchema` for this template.'],\n};\n\n/**\n * The system emails about work an application's agents handed to ANOTHER company's agent (#4013): today, the news one of\n * its A2A agents reports about a delegated task.\n */\nexport const remoteAgentTaskUpdatedSystemTemplateSpecification = systemEmailTemplateSpecificationFromRegistryEntry(\n SystemEmailTemplateRegistry[SystemEmailTemplateRef.REMOTE_AGENT_TASK_UPDATED],\n () => ({\n purpose: 'Tell a person that another company\\'s agent, to which one of their conversations with an assistant handed a task, has news about it (it finished, failed, or needs more information), so a person who is not in the application hears of it too.',\n tone: 'Brief and neutral: a heads-up that something is waiting in a conversation, never an alarm.',\n useWhen: 'Sent with the in-app notice `remote_agent_task_updated` when the application records a pushed update about such a task (#3930, #4013): once when the task ends, and when it asks for input or authorization — the first time, and again only after the person has taken a turn in that conversation since the last ask.',\n avoidWhen: 'Never to anyone but the conversation\\'s own person, never for a conversation an organization or the application owns (it has no person), and never to repeat a second delivery of the same update.',\n textSlots: {\n subject: {\n purpose: 'Say that the agent (`{agent}`, the name the application declared for it) has news about a task, without saying what the news is.',\n },\n previewText: {\n purpose: 'Short preview repeating the heading.',\n },\n body: {\n purpose: 'Say that the agent, run by another company, has news about a task one of the reader\\'s conversations handed to it, that it may have finished or may need something from the reader, and that opening the conversation lets their assistant go through it with them.',\n notes: [\n 'Never say which news it is (finished, failed, waiting): the email is sent before anyone has read the update, and the conversation is where it is read.',\n 'Never quote or paraphrase anything the other company\\'s agent wrote.',\n ],\n },\n ctaLabel: {\n purpose: 'Primary action label: opens the conversation at `eventData.conversationUrl` (the application\\'s conversation-link page), else the application at `eventData.appUrl`.',\n },\n },\n eventData: {\n purpose: 'The agent\\'s name as the application declared it, and optional conversation and application URLs. Never the remote agent\\'s text, its task state, or anything from the conversation.',\n },\n businessConstraints: [\n 'Never include the other company\\'s words, the task\\'s state, or anything from the conversation: the email reaches a mailbox and is sent before the update is read.',\n 'Sent only to the person whose conversation handed the task on, never to an organization-wide list.',\n ],\n codeHandling: {\n definitionOwner: ENGINE_OWNER_REF,\n templateRefDeclaration: TEMPLATE_REF_DECLARATION,\n eventDataSchemaSymbol: EVENT_DATA_SCHEMA_SYMBOL,\n },\n }),\n);\n\nexport const delegatedWorkSystemEmailTemplateSpecifications: SystemEmailTemplateSpecificationConfig[] = [\n remoteAgentTaskUpdatedSystemTemplateSpecification,\n];\n"]}
@@ -2,6 +2,7 @@ export * from './authentication.system-emails.specification';
2
2
  export * from './organization.system-emails.specification';
3
3
  export * from './security.system-emails.specification';
4
4
  export * from './human-decision.system-emails.specification';
5
+ export * from './delegated-work.system-emails.specification';
5
6
  /**
6
7
  * Framework-owned keyed map of every system email template specification, one per `SystemEmailTemplateRef`.
7
8
  *
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/engine/notifications/system-emails/index.ts"],"names":[],"mappings":"AAMA,cAAc,8CAA8C,CAAC;AAC7D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,wCAAwC,CAAC;AACvD,cAAc,8CAA8C,CAAC;AAE7D;;;;;;GAMG;AACH,eAAO,MAAM,uCAAuC,wEAKnD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/engine/notifications/system-emails/index.ts"],"names":[],"mappings":"AAOA,cAAc,8CAA8C,CAAC;AAC7D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,wCAAwC,CAAC;AACvD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,8CAA8C,CAAC;AAE7D;;;;;;GAMG;AACH,eAAO,MAAM,uCAAuC,wEAMnD,CAAC"}
@@ -3,10 +3,12 @@ import { authenticationSystemEmailTemplateSpecifications } from './authenticatio
3
3
  import { organizationSystemEmailTemplateSpecifications } from './organization.system-emails.specification.js';
4
4
  import { securitySystemEmailTemplateSpecifications } from './security.system-emails.specification.js';
5
5
  import { humanDecisionSystemEmailTemplateSpecifications } from './human-decision.system-emails.specification.js';
6
+ import { delegatedWorkSystemEmailTemplateSpecifications } from './delegated-work.system-emails.specification.js';
6
7
  export * from './authentication.system-emails.specification.js';
7
8
  export * from './organization.system-emails.specification.js';
8
9
  export * from './security.system-emails.specification.js';
9
10
  export * from './human-decision.system-emails.specification.js';
11
+ export * from './delegated-work.system-emails.specification.js';
10
12
  /**
11
13
  * Framework-owned keyed map of every system email template specification, one per `SystemEmailTemplateRef`.
12
14
  *
@@ -14,5 +16,5 @@ export * from './human-decision.system-emails.specification.js';
14
16
  * system email-template surface, but the engine already provides a complete
15
17
  * baseline keyed by `SystemEmailTemplateRef.*`.
16
18
  */
17
- export const engineSystemEmailTemplateSpecifications = buildSystemEmailTemplateSpecificationMap(...authenticationSystemEmailTemplateSpecifications, ...organizationSystemEmailTemplateSpecifications, ...securitySystemEmailTemplateSpecifications, ...humanDecisionSystemEmailTemplateSpecifications);
19
+ export const engineSystemEmailTemplateSpecifications = buildSystemEmailTemplateSpecificationMap(...authenticationSystemEmailTemplateSpecifications, ...organizationSystemEmailTemplateSpecifications, ...securitySystemEmailTemplateSpecifications, ...humanDecisionSystemEmailTemplateSpecifications, ...delegatedWorkSystemEmailTemplateSpecifications);
18
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/engine/notifications/system-emails/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wCAAwC,EAAE,MAAM,6BAA6B,CAAC;AACvF,OAAO,EAAE,+CAA+C,EAAE,MAAM,8CAA8C,CAAC;AAC/G,OAAO,EAAE,6CAA6C,EAAE,MAAM,4CAA4C,CAAC;AAC3G,OAAO,EAAE,yCAAyC,EAAE,MAAM,wCAAwC,CAAC;AACnG,OAAO,EAAE,8CAA8C,EAAE,MAAM,8CAA8C,CAAC;AAE9G,cAAc,8CAA8C,CAAC;AAC7D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,wCAAwC,CAAC;AACvD,cAAc,8CAA8C,CAAC;AAE7D;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,uCAAuC,GAAG,wCAAwC,CAC7F,GAAG,+CAA+C,EAClD,GAAG,6CAA6C,EAChD,GAAG,yCAAyC,EAC5C,GAAG,8CAA8C,CAClD,CAAC","sourcesContent":["import { buildSystemEmailTemplateSpecificationMap } from '~wildo-specifications/_core';\nimport { authenticationSystemEmailTemplateSpecifications } from './authentication.system-emails.specification';\nimport { organizationSystemEmailTemplateSpecifications } from './organization.system-emails.specification';\nimport { securitySystemEmailTemplateSpecifications } from './security.system-emails.specification';\nimport { humanDecisionSystemEmailTemplateSpecifications } from './human-decision.system-emails.specification';\n\nexport * from './authentication.system-emails.specification';\nexport * from './organization.system-emails.specification';\nexport * from './security.system-emails.specification';\nexport * from './human-decision.system-emails.specification';\n\n/**\n * Framework-owned keyed map of every system email template specification, one per `SystemEmailTemplateRef`.\n *\n * Applications can merge their own additions into this map when extending the\n * system email-template surface, but the engine already provides a complete\n * baseline keyed by `SystemEmailTemplateRef.*`.\n */\nexport const engineSystemEmailTemplateSpecifications = buildSystemEmailTemplateSpecificationMap(\n ...authenticationSystemEmailTemplateSpecifications,\n ...organizationSystemEmailTemplateSpecifications,\n ...securitySystemEmailTemplateSpecifications,\n ...humanDecisionSystemEmailTemplateSpecifications,\n);\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/engine/notifications/system-emails/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wCAAwC,EAAE,MAAM,6BAA6B,CAAC;AACvF,OAAO,EAAE,+CAA+C,EAAE,MAAM,8CAA8C,CAAC;AAC/G,OAAO,EAAE,6CAA6C,EAAE,MAAM,4CAA4C,CAAC;AAC3G,OAAO,EAAE,yCAAyC,EAAE,MAAM,wCAAwC,CAAC;AACnG,OAAO,EAAE,8CAA8C,EAAE,MAAM,8CAA8C,CAAC;AAC9G,OAAO,EAAE,8CAA8C,EAAE,MAAM,8CAA8C,CAAC;AAE9G,cAAc,8CAA8C,CAAC;AAC7D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,wCAAwC,CAAC;AACvD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,8CAA8C,CAAC;AAE7D;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,uCAAuC,GAAG,wCAAwC,CAC7F,GAAG,+CAA+C,EAClD,GAAG,6CAA6C,EAChD,GAAG,yCAAyC,EAC5C,GAAG,8CAA8C,EACjD,GAAG,8CAA8C,CAClD,CAAC","sourcesContent":["import { buildSystemEmailTemplateSpecificationMap } from '~wildo-specifications/_core';\nimport { authenticationSystemEmailTemplateSpecifications } from './authentication.system-emails.specification';\nimport { organizationSystemEmailTemplateSpecifications } from './organization.system-emails.specification';\nimport { securitySystemEmailTemplateSpecifications } from './security.system-emails.specification';\nimport { humanDecisionSystemEmailTemplateSpecifications } from './human-decision.system-emails.specification';\nimport { delegatedWorkSystemEmailTemplateSpecifications } from './delegated-work.system-emails.specification';\n\nexport * from './authentication.system-emails.specification';\nexport * from './organization.system-emails.specification';\nexport * from './security.system-emails.specification';\nexport * from './human-decision.system-emails.specification';\nexport * from './delegated-work.system-emails.specification';\n\n/**\n * Framework-owned keyed map of every system email template specification, one per `SystemEmailTemplateRef`.\n *\n * Applications can merge their own additions into this map when extending the\n * system email-template surface, but the engine already provides a complete\n * baseline keyed by `SystemEmailTemplateRef.*`.\n */\nexport const engineSystemEmailTemplateSpecifications = buildSystemEmailTemplateSpecificationMap(\n ...authenticationSystemEmailTemplateSpecifications,\n ...organizationSystemEmailTemplateSpecifications,\n ...securitySystemEmailTemplateSpecifications,\n ...humanDecisionSystemEmailTemplateSpecifications,\n ...delegatedWorkSystemEmailTemplateSpecifications,\n);\n"]}
@@ -363,7 +363,7 @@ export const organizationUnitsResourceSpecification = resourceSpecificationFromF
363
363
  errorScenarios: [
364
364
  { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The optional destination-parent identifier or reason has an invalid type or length.' },
365
365
  { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin / HR-structure role required to restructure the org tree.' },
366
- { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'The unit being moved, or the destination parent unit, does not exist in the caller’s scope.' },
366
+ { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'The unit being moved does not exist in the caller’s scope (beneath the route’s parent unit, when the request is addressed through it), or the destination parent unit does not exist in the caller’s organization. The destination, like every other node the move reads, is resolved across the whole organization, never only among the route parent’s children.' },
367
367
  { code: HttpResponseStatusCode.CONFLICT_409, when: 'The destination would create a cycle — the target parent sits inside the moved unit’s own subtree, or is the unit itself.', customMessageReference: ErrorCustomMessageReference.ORGANIZATION_UNIT_MOVE_CONFLICT },
368
368
  { code: HttpResponseStatusCode.CONFLICT_409, when: 'A sibling under the new parent already uses the moved unit’s `code`. The destination itself is valid; rename the unit or choose another parent.', customMessageReference: ErrorCustomMessageReference.ORGANIZATION_UNIT_CODE_EXISTS },
369
369
  ],
@@ -1 +1 @@
1
- {"version":3,"file":"organization-units.resource.specification.js","sourceRoot":"","sources":["../../../../../src/engine/organizations/resources/organization-units.resource.specification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uCAAuC,IAAI,iCAAiC,EAAE,MAAM,8BAA8B,CAAC;AAC5H,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAEpE,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,qBAAqB,IAAI,EAAE,EAC3B,2BAA2B,EAC3B,aAAa,EACb,SAAS,EACT,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,oBAAoB,EACpB,2BAA2B,EAC3B,0CAA0C,EAC1C,oBAAoB,EACpB,2DAA2D,IAAI,wBAAwB,GACxF,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,sBAAsB,EACtB,6BAA6B,EAC7B,qBAAqB,EACrB,8CAA8C,GAC/C,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAO3E,MAAM,mCAAmC,GAAG,iCAAiF,CAAC;AAE9H,MAAM,yBAAyB,GAAG;IAChC,GAAG,EAAE,8BAA8B;IACnC,cAAc,EAAE,2BAA2B;IAC3C,YAAY,EAAE,yBAAyB;IACvC,MAAM,EAAE,sBAAsB,CAAC,MAAM;IACrC,eAAe,EAAE,0CAA0C,CAAC,YAAY;IACxE,IAAI,EAAE,2BAA2B;IACjC,IAAI,EAAE,YAAY;IAClB,IAAI,EAAE,YAAY;IAClB,IAAI,EAAE,oBAAoB,CAAC,UAAU;IACrC,SAAS,EAAE,0BAA0B;IACrC,SAAS,EAAE,0BAA0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9I,CAAC,2BAA2B,CAAC,OAAO,CAAC,EAAE,EAAE,OAAO,EAAE,mDAAmD,EAAE,SAAS,EAAE,kCAAkC,EAAE;QACtJ,CAAC,2BAA2B,CAAC,OAAO,CAAC,EAAE,EAAE,OAAO,EAAE,qDAAqD,EAAE,SAAS,EAAE,kCAAkC,EAAE;KACzJ;CACF,CAAC,CACH,CAAC","sourcesContent":["import { organizationUnitsMainResourceUIBehavior as organizationUnitsUIBehaviorSource } from '@wildo-ai/presets-components';\nimport { LabelAudience } from '@wildo-ai/presets-components-models';\nimport type { ResourceUIBehaviorConfig } from '@wildo-ai/saas-frontend-lib/companion';\nimport {\n CodeDeclarationKind,\n CodeSymbolKind,\n FieldSemanticImportance,\n} from '@wildo-ai/zod-decorators';\nimport {\n CoreResourceOperation as Op,\n ErrorCustomMessageReference,\n ErrorSeverity,\n ErrorType,\n ExternalIdentitySource,\n OrganizationUnitSchema,\n OrganizationUnitStatus,\n OrganizationUnitType,\n OrganizationUnit_Operations,\n OrganizationUnit_PermissionInheritanceType,\n ResourcePrimaryScope,\n organizationUnitResourceConfiguration_InitializationFactory as organizationUnitsFactory,\n} from '@wildo-ai/saas-models';\nimport {\n HttpResponseStatusCode,\n resourceFrontendConfiguration,\n resourceSpecification,\n resourceSpecificationFromFrontendConfiguration,\n} from '~wildo-specifications/_core';\nimport { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\n\ntype Cfg = ReturnType<typeof organizationUnitsFactory>;\ntype Custom = NonNullable<Cfg['customOperation']>;\ntype Core = Cfg['coreOperations'][number];\ntype Main = Cfg['mainSchema'];\n\nconst organizationUnitsResourceUIBehavior = organizationUnitsUIBehaviorSource as ResourceUIBehaviorConfig<Custom, Core, Main>;\n\nconst ORGANIZATION_UNIT_EXAMPLE = {\n _id: 'organization_unit_emea_sales',\n organizationId: 'organization_01HX2EXAMPLE',\n parentUnitId: 'organization_unit_sales',\n status: OrganizationUnitStatus.ACTIVE,\n inheritanceType: OrganizationUnit_PermissionInheritanceType.INHERIT_DOWN,\n path: '/organization_unit_sales/',\n name: 'EMEA Sales',\n code: 'emea-sales',\n type: OrganizationUnitType.DEPARTMENT,\n createdAt: '2026-07-03T09:15:00.000Z',\n updatedAt: '2026-08-18T08:00:00.000Z',\n _version: 3,\n} as const;\n\nconst ORGANIZATION_UNIT_SUMMARY_EXAMPLE = {\n _id: ORGANIZATION_UNIT_EXAMPLE._id,\n organizationId: ORGANIZATION_UNIT_EXAMPLE.organizationId,\n status: ORGANIZATION_UNIT_EXAMPLE.status,\n name: ORGANIZATION_UNIT_EXAMPLE.name,\n type: ORGANIZATION_UNIT_EXAMPLE.type,\n _version: ORGANIZATION_UNIT_EXAMPLE._version,\n} as const;\n\nfunction organizationUnitsPage<T>(data: readonly T[]) {\n return {\n data,\n pagination: { page: 1, limit: 20, total: data.length, totalPages: data.length === 0 ? 0 : 1 },\n };\n}\n\nconst ORGANIZATION_UNITS_PAGE_REQUEST = { page: 1, limit: 20, sort: 'createdAt:desc' } as const;\n\nexport const organizationUnitsResourceSpecification = resourceSpecificationFromFrontendConfiguration(\n resourceFrontendConfiguration(organizationUnitsResourceUIBehavior),\n resourceSpecification(\n organizationUnitsFactory,\n OrganizationUnitSchema,\n ({ schemaShape }) => ({\n purpose: 'Represents a department, team, region, project group, or other node in an organization’s hierarchy.',\n businessRole: 'Organization units support org charts, unit-scoped membership, and downward permission inheritance in larger organizations.',\n lifecycleRole: 'Units can be created, renamed, moved, archived, restored, and deleted when they no longer have child units or member assignments.',\n audience: LabelAudience.ADMIN,\n subDomain: EngineResourceSubDomain.ORGANIZATIONS,\n codeHandling: {\n mainSchema: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'OrganizationUnitSchema',\n symbolKind: CodeSymbolKind.SCHEMA,\n declarationKind: CodeDeclarationKind.ZOD_SCHEMA,\n },\n resourceFactory: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'organizationUnitResourceConfiguration_InitializationFactory',\n symbolKind: CodeSymbolKind.FACTORY,\n declarationKind: CodeDeclarationKind.FUNCTION,\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: 'ORGANIZATION_UNITS',\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 customEnum: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'OrganizationUnit_Operations',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n },\n frontendConfigurationSources: [\n {\n packageName: '@wildo-ai/presets-components',\n exportName: 'organizationUnitsMainResourceUIBehavior',\n symbolKind: CodeSymbolKind.UI_BEHAVIOR,\n },\n ],\n },\n fields: {\n parentUnitId: schemaShape.parentUnitId.foreignKeySpec({\n meaning: 'The parent org-unit this node hangs under (absent/root when the unit is a top-level node directly beneath the organization).',\n whyItMatters: 'Defines the tree edge that drives org-chart rendering, path materialization, and downward-only permission inheritance through the hierarchy.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n name: schemaShape.name.stringSpec({ meaning: 'Unit display name.', importance: FieldSemanticImportance.PRIMARY }),\n code: schemaShape.code.stringSpec({ meaning: 'Short stable code for APIs and HR imports. Optional, and unique among the siblings that carry one — the resource business key is (`organizationId`, `parentUnitId`, `code`).' }),\n type: schemaShape.type.enumSpec({\n meaning: 'Structural classification of the node in the org hierarchy (department, region, team, …).',\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'OrganizationUnitType',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n values: {\n [OrganizationUnitType.COMPANY]: { meaning: 'Top-level company entity within the tenant.' },\n [OrganizationUnitType.DIVISION]: { meaning: 'A division grouping multiple departments.' },\n [OrganizationUnitType.DEPARTMENT]: { meaning: 'A department within a division or company.' },\n [OrganizationUnitType.TEAM]: { meaning: 'A team within a department.' },\n [OrganizationUnitType.SUBTEAM]: { meaning: 'A sub-team nested under a team.' },\n [OrganizationUnitType.PROJECT_GROUP]: { meaning: 'A cross-cutting project or working group.' },\n [OrganizationUnitType.GEOGRAPHIC]: { meaning: 'A geography/region-based grouping.' },\n [OrganizationUnitType.FUNCTIONAL]: { meaning: 'A function-based grouping (e.g. a shared discipline).' },\n [OrganizationUnitType.CUSTOM]: { meaning: 'A tenant-defined unit kind that does not fit the named categories.' },\n },\n }),\n inheritanceType: schemaShape.inheritanceType.enumSpec({\n meaning: 'Controls whether a unit-scoped role also applies to descendant units. Permission inheritance is downward-only; a role on a child never grants authority over its parent or ancestors.',\n whyItMatters: 'With `inherit_down`, one assignment can cover an entire branch. With `no_inheritance`, the assignment applies only to this exact unit.',\n importance: FieldSemanticImportance.PRIMARY,\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'OrganizationUnit_PermissionInheritanceType',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n values: {\n [OrganizationUnit_PermissionInheritanceType.INHERIT_DOWN]: { meaning: 'A role held at this unit also applies to its descendant units.' },\n [OrganizationUnit_PermissionInheritanceType.NO_INHERITANCE]: { meaning: 'No propagation; the node is isolated for permission purposes.' },\n },\n }),\n path: schemaShape.path.stringSpec({\n meaning: 'Server-maintained ancestor path for this node, excluding the node itself (for example `/division-id/department-id/`).',\n whyItMatters: 'Lets clients identify the node’s hierarchy and lets authorization apply inherited unit access across a branch. Change parents through MOVE; clients do not write this field directly.',\n }),\n externalSource: schemaShape.externalSource.enumSpec({\n meaning: 'The external system that asserts this unit. Present only on a unit an identity directory created; absent on every unit authored in the application.',\n whyItMatters: 'This is the OWNERSHIP marker for directory-managed units. `POST /scim/v2/Groups` sets it and nothing else writes it, and the SCIM Groups endpoints read, update and delete ONLY units that carry it — a unit an administrator created answers 404 there. That is what stops a directory adopting a hand-authored unit by matching its display name, which would hand an administrator’s unit membership to the directory. It also tells the SCIM `/Users` department reconciliation, which is authoritative over a member’s whole set of units, which assignments belong to the Groups path and must be left alone.',\n importance: FieldSemanticImportance.PRIMARY,\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'ExternalIdentitySource',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n values: {\n [ExternalIdentitySource.SCIM]: { meaning: 'A SCIM directory group: the unit was created by `POST /scim/v2/Groups` and its membership is reconciled by that directory.' },\n [ExternalIdentitySource.OIDC]: { meaning: 'Not written for organization units today; reserved by the shared identity-source vocabulary.' },\n [ExternalIdentitySource.OAUTH2]: { meaning: 'Not written for organization units today; reserved by the shared identity-source vocabulary.' },\n [ExternalIdentitySource.SAML]: { meaning: 'Not written for organization units today; reserved by the shared identity-source vocabulary.' },\n },\n }),\n externalId: schemaShape.externalId.stringSpec({\n meaning: 'The directory’s OWN identifier for the group this unit represents — the SCIM `externalId`, which the provisioning client issues and this application stores. The SCIM `id` of the same group is the unit’s `_id`.',\n whyItMatters: 'Unique per organization and sparse: two organizations may hold the same directory group id, and the many units with no directory group are outside the constraint entirely. Set once when the directory creates the group and immutable afterwards, because re-keying it would move an authorization grant onto a different group. Microsoft Entra sends it on group creation; Okta does not send one at all, which is why unit ownership is carried by `externalSource` rather than by the presence of this field.',\n }),\n status: schemaShape.status.enumSpec({\n meaning: 'Lifecycle state of the node (archived, suspended, etc.).',\n importance: FieldSemanticImportance.PRIMARY,\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'OrganizationUnitStatus',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n values: {\n [OrganizationUnitStatus.ACTIVE]: { meaning: 'Normal visibility in pickers and policy.' },\n [OrganizationUnitStatus.INACTIVE]: { meaning: 'Retained for history, hidden from most UIs.' },\n [OrganizationUnitStatus.ARCHIVED]: { meaning: 'Soft-closed; restore via RESTORE when applicable.' },\n [OrganizationUnitStatus.SUSPENDED]: { meaning: 'Policy-hold; treat as non-assignable for new work.' },\n },\n }),\n },\n operations: {\n [Op.READ]: {\n purpose: 'Retrieve one organization unit by its route identity.',\n outcome: 'The unit’s hierarchy, classification, lifecycle state, and inheritance policy are returned.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The organization unit was found and its node record (name, code, status, hierarchy links) is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the organization-member role required to read organization units.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No organization unit exists for the supplied id within the caller’s tenant scope.' },\n ],\n idempotent: true,\n examples: [{\n title: 'Inspect an active department',\n response: ORGANIZATION_UNIT_EXAMPLE,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n variants: {\n context: {\n examples: [{\n title: 'Inspect a unit with its organization relationship',\n response: {\n ...ORGANIZATION_UNIT_EXAMPLE,\n organization: { _id: ORGANIZATION_UNIT_EXAMPLE.organizationId },\n },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n summary: {\n examples: [{\n title: 'Inspect the compact organization-unit summary',\n response: ORGANIZATION_UNIT_SUMMARY_EXAMPLE,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n },\n [Op.LIST]: {\n purpose: 'Browse organization units under an organization or a specific parent unit.',\n outcome: 'A page of organization-unit nodes and pagination metadata is returned.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of units under the addressed org or parent node.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the organization-member role required to list organization units.' },\n ],\n idempotent: true,\n examples: [{\n title: 'Browse recent organization units',\n request: ORGANIZATION_UNITS_PAGE_REQUEST,\n response: organizationUnitsPage([ORGANIZATION_UNIT_EXAMPLE]),\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n variants: {\n context: {\n examples: [{\n title: 'Browse units with organization relationship context',\n request: ORGANIZATION_UNITS_PAGE_REQUEST,\n response: organizationUnitsPage([{\n ...ORGANIZATION_UNIT_EXAMPLE,\n organization: { _id: ORGANIZATION_UNIT_EXAMPLE.organizationId },\n }]),\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n summary: {\n examples: [{\n title: 'Browse compact organization-unit summaries',\n request: ORGANIZATION_UNITS_PAGE_REQUEST,\n response: organizationUnitsPage([ORGANIZATION_UNIT_SUMMARY_EXAMPLE]),\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n },\n [Op.SEARCH]: {\n purpose: 'Search organization units by name or description and narrow the result with supported filters.',\n outcome: 'A page of matching units in the addressed organization or parent branch is returned.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of units matching the name or description query within the tenant.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the organization-member role required to search organization units.' },\n ],\n idempotent: true,\n examples: [{\n title: 'Find sales units by name and parent',\n request: {\n q: 'sales',\n name: 'EMEA Sales',\n parentUnitId: ORGANIZATION_UNIT_EXAMPLE.parentUnitId,\n page: 1,\n limit: 20,\n sort: 'name:asc',\n },\n response: organizationUnitsPage([ORGANIZATION_UNIT_EXAMPLE]),\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n [Op.CREATE]: {\n purpose: 'Create a root organization unit or add a child under an existing parent unit.',\n outcome: 'The new unit is returned with its server-assigned identifier and hierarchy path, ready for unit-scoped membership and access policies.',\n responseStatuses: [\n { code: HttpResponseStatusCode.CREATED_201, meaning: 'A new unit node was created under the supplied parent and is returned with its server-assigned id.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The unit payload fails schema validation (e.g. missing `name`).' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin / HR-structure role required to add nodes to the org tree.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'The referenced parent unit does not exist within the caller’s organization.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'A sibling unit under the same parent already uses the requested `code`; unit codes must be unique within a parent.', customMessageReference: ErrorCustomMessageReference.ORGANIZATION_UNIT_CODE_EXISTS },\n ],\n idempotent: false,\n examples: [\n {\n title: 'Create a unit under a parent node',\n request: {\n name: 'EMEA Sales',\n code: 'emea-sales',\n parentUnitId: ORGANIZATION_UNIT_EXAMPLE.parentUnitId,\n type: OrganizationUnitType.DEPARTMENT,\n inheritanceType: OrganizationUnit_PermissionInheritanceType.INHERIT_DOWN,\n status: OrganizationUnitStatus.ACTIVE,\n },\n response: ORGANIZATION_UNIT_EXAMPLE,\n forStatus: HttpResponseStatusCode.CREATED_201,\n },\n ],\n },\n [Op.UPDATE]: {\n purpose: 'Update a unit’s name, code, type, lifecycle state, or permission-inheritance policy. Use MOVE to change its parent.',\n outcome: 'The updated unit is returned. Changes to inheritance affect subsequent unit-scoped authorization decisions.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The unit was updated and the new node state is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The edited fields fail schema validation.' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin / HR-structure role required to edit org tree nodes.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No unit exists for the supplied id in the caller’s scope.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The requested `code` is already used by a sibling under the same parent. Reparenting is not accepted by UPDATE; use MOVE.', customMessageReference: ErrorCustomMessageReference.ORGANIZATION_UNIT_CODE_EXISTS },\n ],\n idempotent: true,\n examples: [{\n title: 'Rename a unit and isolate its permissions',\n request: {\n name: 'EMEA Revenue',\n code: 'emea-revenue',\n inheritanceType: OrganizationUnit_PermissionInheritanceType.NO_INHERITANCE,\n },\n response: {\n ...ORGANIZATION_UNIT_EXAMPLE,\n name: 'EMEA Revenue',\n code: 'emea-revenue',\n inheritanceType: OrganizationUnit_PermissionInheritanceType.NO_INHERITANCE,\n },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n [Op.DELETE]: {\n purpose: 'Remove an empty leaf node from the org tree; refused while the node still has child units or assigned members.',\n outcome: 'The unit row is deleted. A node with dependents is refused, so no subtree is stranded behind a dangling parent link and no member assignment outlives the unit it names.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The unit was deleted; the body carries its `id`.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin role required to remove org tree nodes.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No unit exists for the supplied id (or it was already removed).' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The unit still has dependents, and neither is cascade-deleted with it. Either child units remain — re-parent each onto another node with MOVE, or delete the subtree bottom-up — or organization members are still assigned to this unit, in which case the assignments must be removed first. Only a node with no children and no assignments can be deleted. The error context names each blocking dependent (`blockingDependents`).', customMessageReference: ErrorCustomMessageReference.RESOURCE_HAS_DEPENDENTS },\n ],\n idempotent: true,\n examples: [{\n title: 'Refuse deletion while a child unit remains',\n response: {\n error: {\n type: ErrorType.CONFLICT,\n severity: ErrorSeverity.MEDIUM,\n message: 'Resource conflict detected',\n customMessage: 'Move or delete child units and remove member assignments before deleting this unit.',\n customMessageReference: ErrorCustomMessageReference.RESOURCE_HAS_DEPENDENTS,\n timestamp: '2026-08-18T08:00:00.000Z',\n },\n },\n forStatus: HttpResponseStatusCode.CONFLICT_409,\n }],\n },\n [OrganizationUnit_Operations.MOVE]: {\n operationId: OrganizationUnit_Operations.MOVE,\n purpose: 'Move a unit beneath a different parent, or to the organization root when `newParentUnitId` is omitted.',\n outcome: 'The unit keeps its identity and member assignments. Its ancestor path and every descendant path are updated to reflect the new location. The supplied reason is retained on the committed operation audit event.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The unit was re-parented and the updated node (with its new path) is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The optional destination-parent identifier or reason has an invalid type or length.' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin / HR-structure role required to restructure the org tree.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'The unit being moved, or the destination parent unit, does not exist in the caller’s scope.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The destination would create a cycle — the target parent sits inside the moved unit’s own subtree, or is the unit itself.', customMessageReference: ErrorCustomMessageReference.ORGANIZATION_UNIT_MOVE_CONFLICT },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'A sibling under the new parent already uses the moved unit’s `code`. The destination itself is valid; rename the unit or choose another parent.', customMessageReference: ErrorCustomMessageReference.ORGANIZATION_UNIT_CODE_EXISTS },\n ],\n idempotent: false,\n examples: [{\n title: 'Move a department below a new division',\n request: {\n newParentUnitId: 'organization_unit_revenue',\n reason: 'Sales now reports through the global revenue division.',\n },\n response: {\n ...ORGANIZATION_UNIT_EXAMPLE,\n parentUnitId: 'organization_unit_revenue',\n path: '/organization_unit_revenue/',\n },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n [OrganizationUnit_Operations.ARCHIVE]: {\n operationId: OrganizationUnit_Operations.ARCHIVE,\n purpose: 'Archive one organization unit without deleting its history or changing descendant states.',\n outcome: 'The unit becomes ARCHIVED and is hidden from default active-unit pickers. Descendants retain their own states.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The unit transitioned to `archived` and the updated node is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin role required to archive org tree nodes.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No unit exists for the supplied id in the caller’s scope.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The unit is already `archived`, so archiving is not a legal transition from its current state.' },\n ],\n idempotent: true,\n examples: [{\n title: 'Archive a department after a reorganization',\n request: { reason: 'The EMEA Sales department was consolidated into Global Revenue.' },\n response: { ...ORGANIZATION_UNIT_EXAMPLE, status: OrganizationUnitStatus.ARCHIVED },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n [OrganizationUnit_Operations.RESTORE]: {\n operationId: OrganizationUnit_Operations.RESTORE,\n purpose: 'Restore an archived unit after its parent branch is active.',\n outcome: 'The unit becomes ACTIVE and is available again to active-unit pickers and policies. The committed operation is audited, including the optional reason, despite its MEDIUM risk level.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The unit transitioned back to `ACTIVE` and the restored node is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin role required to restore archived org tree nodes.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No unit exists for the supplied id in the caller’s scope.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The unit is not `archived` (so there is nothing to restore), or its parent branch is still archived and must be restored first.' },\n ],\n idempotent: true,\n examples: [{\n title: 'Restore an archived department',\n request: { reason: 'The department is active again for the new fiscal year.' },\n response: ORGANIZATION_UNIT_EXAMPLE,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n businessConstraints: [\n 'Admin org presets do not add alternate variants for `ORGANIZATION_UNITS` — only main `organizations` presets apply.',\n 'Per-unit DELETE is refused while child units remain, but deleting the whole ORGANIZATION is not: that cascade is enabled and removes every unit of the tenant at once (each unit carries the tenant id, so tree depth is irrelevant). Tearing a tenant down does not require dismantling its org chart leaf-by-leaf.',\n // Scope note, recorded so the narrower guard is not later read as an oversight. An earlier\n // revision of this spec also named \"assigned members\" as a DELETE blocker; it was dropped\n // (2026-07-29) because it cannot be enforced honestly today, not because it stopped mattering.\n 'Unit assignments ARE checked on unit DELETE (since 2026-07-31). They live in the `ORGANIZATION_UNIT_MEMBERS` junction resource, promoted out of the members row precisely so this dependent could be guarded: as an embedded array it was not a registered relationship and not adapter-neutrally queryable (a nested-path filter resolves to null on the SQL adapter, and the list projection dropped the field), so either available check would have passed silently instead of blocking.',\n 'MOVE, ARCHIVE and RESTORE are implemented (2026-07-31). Their request payloads name no schema field, so each custom implementation translates the payload into the real field mutation: MOVE writes `parentUnitId` + `path` and rewrites the materialized `path` of every descendant in one transaction; ARCHIVE/RESTORE write `status`.',\n 'Re-parenting is owned exclusively by MOVE — `parentUnitId` is `.excludeFromUpdate()`. A reparent has a subtree-wide side effect (every descendant path must be rewritten) and must be refused when the destination sits inside the moved node’s own subtree; generic UPDATE performs neither check, so allowing it there would silently produce stale paths or a detached cycle.',\n '`path` is a materialized ANCESTOR chain (`/`, `/R/`, `/R/C/`) — the route TO the node, excluding the node itself. It is written by the CREATE prefix on the same write that inserts the row, because a CREATE custom implementation never receives the new row’s id and a second write would leave a window with no path at all. Descendants of a node are addressed by `path + _id + \"/\"`, which is also the O(1) cycle test MOVE relies on.',\n 'ARCHIVE is node-only: descendants keep their own status, which keeps ARCHIVE O(1) and makes restore order explicit. RESTORE pays for that by validating the ancestor chain, so a node cannot be restored underneath a still-archived parent.',\n 'MOVE, ARCHIVE and RESTORE retain the submitted reason in the committed RESOURCE_OPERATION_PERFORMED event; ARCHIVE requires one, while MOVE and RESTORE accept it optionally. The request reason is audit history, not a mutable organization-unit field.',\n 'Sibling `code` uniqueness is the schema business key (`organizationId`, `parentUnitId`, `code`) — sibling-scoped, so two teams called `sales` under different divisions are legitimate. Rows carrying NO `code` are outside the constraint entirely (any number of code-less siblings is fine), while roots ARE covered: an absent `parentUnitId` is a real position, so two roots may not share a code.',\n 'That business key is enforced at BOTH layers, and both raise `ORGANIZATION_UNIT_CODE_EXISTS`. On MongoDB a partial compound unique index closes the concurrency window. On a SQL adapter there is no index yet — the planner records uniqueness as intent and leaves enforcement migration-owned — so the application guard at CREATE, UPDATE (rename) and MOVE is retained as the cross-adapter backstop. That guard is a read-then-write and therefore still racy on its own; the index, not the guard, is what makes the constraint hold under concurrency. Treat schema-declared uniqueness as a MongoDB guarantee until the SQL migration lane closes the gap.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.ORGANIZATIONS },\n ),\n () => ({\n layout: {\n purpose: 'The organization\\'s unit hierarchy (Settings → Organization units): departments, teams, regions and project groups.',\n headerPurpose: 'The READ header: the unit name on the title line, then on the facts line its `status` badge, and — for a unit a SCIM directory created — the `externalSource` badge, which is what tells an administrator that a rename made here will be reverted by the directory.',\n displayPurpose: 'READ is one flat list of rows and documents no section: `code`, `type`, `parentUnitId`, `inheritanceType` and `externalId`, each optional row hidden when empty. The materialized `path` is not shown — it is `parentUnitId` spelled as a chain of ids. Sub-units are composed below as this resource\\'s own tab.',\n summaryPurpose: 'A unit card: the name as the title, then `status`, `type` and the directory badge as bare values.',\n editPurpose: 'One flat, stacked form: `name` focused first, `code` and `type` sharing a row, then `status`, `parentUnitId` (CREATE only — re-parenting is MOVE) and `inheritanceType`.',\n },\n views: {\n [Op.READ]: { purpose: 'Detail drawer for a single unit in org settings.', whenToUse: 'Org structure admin and HR flows.' },\n [Op.LIST]: { purpose: 'Flat or nested listing under an org.', whenToUse: 'Unit pickers in assignment UI.' },\n [Op.SEARCH]: { purpose: 'Searchable listing when the factory marks search enabled.', whenToUse: 'Large orgs with many nodes.' },\n [Op.CREATE]: { purpose: 'Create under an org from structure settings.', whenToUse: 'HR or IT modeling new groups.' },\n [Op.UPDATE]: { purpose: 'Edit name, code, type, status, and inheritance policy inline.', whenToUse: 'Organization-directory corrections that do not change the parent.' },\n [Op.DELETE]: { purpose: 'Remove an empty leaf unit.', whenToUse: 'After its child units and member assignments have been removed or moved.' },\n [OrganizationUnit_Operations.MOVE]: { purpose: 'Drag/drop or form-driven reparenting.', whenToUse: 'Rebalancing regions or reporting lines.' },\n [OrganizationUnit_Operations.ARCHIVE]: { purpose: 'Soft-close one unit without changing descendants.', whenToUse: 'Mergers and seasonal structures.' },\n [OrganizationUnit_Operations.RESTORE]: { purpose: 'Bring an archived unit back under an active parent.', whenToUse: 'Mistakes or revived departments.' },\n },\n }),\n);\n"]}
1
+ {"version":3,"file":"organization-units.resource.specification.js","sourceRoot":"","sources":["../../../../../src/engine/organizations/resources/organization-units.resource.specification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uCAAuC,IAAI,iCAAiC,EAAE,MAAM,8BAA8B,CAAC;AAC5H,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAEpE,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,qBAAqB,IAAI,EAAE,EAC3B,2BAA2B,EAC3B,aAAa,EACb,SAAS,EACT,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,oBAAoB,EACpB,2BAA2B,EAC3B,0CAA0C,EAC1C,oBAAoB,EACpB,2DAA2D,IAAI,wBAAwB,GACxF,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,sBAAsB,EACtB,6BAA6B,EAC7B,qBAAqB,EACrB,8CAA8C,GAC/C,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAO3E,MAAM,mCAAmC,GAAG,iCAAiF,CAAC;AAE9H,MAAM,yBAAyB,GAAG;IAChC,GAAG,EAAE,8BAA8B;IACnC,cAAc,EAAE,2BAA2B;IAC3C,YAAY,EAAE,yBAAyB;IACvC,MAAM,EAAE,sBAAsB,CAAC,MAAM;IACrC,eAAe,EAAE,0CAA0C,CAAC,YAAY;IACxE,IAAI,EAAE,2BAA2B;IACjC,IAAI,EAAE,YAAY;IAClB,IAAI,EAAE,YAAY;IAClB,IAAI,EAAE,oBAAoB,CAAC,UAAU;IACrC,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,uCAAuC,EAAE,SAAS,EAAE,yCAAyC,EAAE;QAC9I,CAAC,2BAA2B,CAAC,OAAO,CAAC,EAAE,EAAE,OAAO,EAAE,mDAAmD,EAAE,SAAS,EAAE,kCAAkC,EAAE;QACtJ,CAAC,2BAA2B,CAAC,OAAO,CAAC,EAAE,EAAE,OAAO,EAAE,qDAAqD,EAAE,SAAS,EAAE,kCAAkC,EAAE;KACzJ;CACF,CAAC,CACH,CAAC","sourcesContent":["import { organizationUnitsMainResourceUIBehavior as organizationUnitsUIBehaviorSource } from '@wildo-ai/presets-components';\nimport { LabelAudience } from '@wildo-ai/presets-components-models';\nimport type { ResourceUIBehaviorConfig } from '@wildo-ai/saas-frontend-lib/companion';\nimport {\n CodeDeclarationKind,\n CodeSymbolKind,\n FieldSemanticImportance,\n} from '@wildo-ai/zod-decorators';\nimport {\n CoreResourceOperation as Op,\n ErrorCustomMessageReference,\n ErrorSeverity,\n ErrorType,\n ExternalIdentitySource,\n OrganizationUnitSchema,\n OrganizationUnitStatus,\n OrganizationUnitType,\n OrganizationUnit_Operations,\n OrganizationUnit_PermissionInheritanceType,\n ResourcePrimaryScope,\n organizationUnitResourceConfiguration_InitializationFactory as organizationUnitsFactory,\n} from '@wildo-ai/saas-models';\nimport {\n HttpResponseStatusCode,\n resourceFrontendConfiguration,\n resourceSpecification,\n resourceSpecificationFromFrontendConfiguration,\n} from '~wildo-specifications/_core';\nimport { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\n\ntype Cfg = ReturnType<typeof organizationUnitsFactory>;\ntype Custom = NonNullable<Cfg['customOperation']>;\ntype Core = Cfg['coreOperations'][number];\ntype Main = Cfg['mainSchema'];\n\nconst organizationUnitsResourceUIBehavior = organizationUnitsUIBehaviorSource as ResourceUIBehaviorConfig<Custom, Core, Main>;\n\nconst ORGANIZATION_UNIT_EXAMPLE = {\n _id: 'organization_unit_emea_sales',\n organizationId: 'organization_01HX2EXAMPLE',\n parentUnitId: 'organization_unit_sales',\n status: OrganizationUnitStatus.ACTIVE,\n inheritanceType: OrganizationUnit_PermissionInheritanceType.INHERIT_DOWN,\n path: '/organization_unit_sales/',\n name: 'EMEA Sales',\n code: 'emea-sales',\n type: OrganizationUnitType.DEPARTMENT,\n createdAt: '2026-07-03T09:15:00.000Z',\n updatedAt: '2026-08-18T08:00:00.000Z',\n _version: 3,\n} as const;\n\nconst ORGANIZATION_UNIT_SUMMARY_EXAMPLE = {\n _id: ORGANIZATION_UNIT_EXAMPLE._id,\n organizationId: ORGANIZATION_UNIT_EXAMPLE.organizationId,\n status: ORGANIZATION_UNIT_EXAMPLE.status,\n name: ORGANIZATION_UNIT_EXAMPLE.name,\n type: ORGANIZATION_UNIT_EXAMPLE.type,\n _version: ORGANIZATION_UNIT_EXAMPLE._version,\n} as const;\n\nfunction organizationUnitsPage<T>(data: readonly T[]) {\n return {\n data,\n pagination: { page: 1, limit: 20, total: data.length, totalPages: data.length === 0 ? 0 : 1 },\n };\n}\n\nconst ORGANIZATION_UNITS_PAGE_REQUEST = { page: 1, limit: 20, sort: 'createdAt:desc' } as const;\n\nexport const organizationUnitsResourceSpecification = resourceSpecificationFromFrontendConfiguration(\n resourceFrontendConfiguration(organizationUnitsResourceUIBehavior),\n resourceSpecification(\n organizationUnitsFactory,\n OrganizationUnitSchema,\n ({ schemaShape }) => ({\n purpose: 'Represents a department, team, region, project group, or other node in an organization’s hierarchy.',\n businessRole: 'Organization units support org charts, unit-scoped membership, and downward permission inheritance in larger organizations.',\n lifecycleRole: 'Units can be created, renamed, moved, archived, restored, and deleted when they no longer have child units or member assignments.',\n audience: LabelAudience.ADMIN,\n subDomain: EngineResourceSubDomain.ORGANIZATIONS,\n codeHandling: {\n mainSchema: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'OrganizationUnitSchema',\n symbolKind: CodeSymbolKind.SCHEMA,\n declarationKind: CodeDeclarationKind.ZOD_SCHEMA,\n },\n resourceFactory: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'organizationUnitResourceConfiguration_InitializationFactory',\n symbolKind: CodeSymbolKind.FACTORY,\n declarationKind: CodeDeclarationKind.FUNCTION,\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: 'ORGANIZATION_UNITS',\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 customEnum: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'OrganizationUnit_Operations',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n },\n frontendConfigurationSources: [\n {\n packageName: '@wildo-ai/presets-components',\n exportName: 'organizationUnitsMainResourceUIBehavior',\n symbolKind: CodeSymbolKind.UI_BEHAVIOR,\n },\n ],\n },\n fields: {\n parentUnitId: schemaShape.parentUnitId.foreignKeySpec({\n meaning: 'The parent org-unit this node hangs under (absent/root when the unit is a top-level node directly beneath the organization).',\n whyItMatters: 'Defines the tree edge that drives org-chart rendering, path materialization, and downward-only permission inheritance through the hierarchy.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n name: schemaShape.name.stringSpec({ meaning: 'Unit display name.', importance: FieldSemanticImportance.PRIMARY }),\n code: schemaShape.code.stringSpec({ meaning: 'Short stable code for APIs and HR imports. Optional, and unique among the siblings that carry one — the resource business key is (`organizationId`, `parentUnitId`, `code`).' }),\n type: schemaShape.type.enumSpec({\n meaning: 'Structural classification of the node in the org hierarchy (department, region, team, …).',\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'OrganizationUnitType',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n values: {\n [OrganizationUnitType.COMPANY]: { meaning: 'Top-level company entity within the tenant.' },\n [OrganizationUnitType.DIVISION]: { meaning: 'A division grouping multiple departments.' },\n [OrganizationUnitType.DEPARTMENT]: { meaning: 'A department within a division or company.' },\n [OrganizationUnitType.TEAM]: { meaning: 'A team within a department.' },\n [OrganizationUnitType.SUBTEAM]: { meaning: 'A sub-team nested under a team.' },\n [OrganizationUnitType.PROJECT_GROUP]: { meaning: 'A cross-cutting project or working group.' },\n [OrganizationUnitType.GEOGRAPHIC]: { meaning: 'A geography/region-based grouping.' },\n [OrganizationUnitType.FUNCTIONAL]: { meaning: 'A function-based grouping (e.g. a shared discipline).' },\n [OrganizationUnitType.CUSTOM]: { meaning: 'A tenant-defined unit kind that does not fit the named categories.' },\n },\n }),\n inheritanceType: schemaShape.inheritanceType.enumSpec({\n meaning: 'Controls whether a unit-scoped role also applies to descendant units. Permission inheritance is downward-only; a role on a child never grants authority over its parent or ancestors.',\n whyItMatters: 'With `inherit_down`, one assignment can cover an entire branch. With `no_inheritance`, the assignment applies only to this exact unit.',\n importance: FieldSemanticImportance.PRIMARY,\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'OrganizationUnit_PermissionInheritanceType',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n values: {\n [OrganizationUnit_PermissionInheritanceType.INHERIT_DOWN]: { meaning: 'A role held at this unit also applies to its descendant units.' },\n [OrganizationUnit_PermissionInheritanceType.NO_INHERITANCE]: { meaning: 'No propagation; the node is isolated for permission purposes.' },\n },\n }),\n path: schemaShape.path.stringSpec({\n meaning: 'Server-maintained ancestor path for this node, excluding the node itself (for example `/division-id/department-id/`).',\n whyItMatters: 'Lets clients identify the node’s hierarchy and lets authorization apply inherited unit access across a branch. Change parents through MOVE; clients do not write this field directly.',\n }),\n externalSource: schemaShape.externalSource.enumSpec({\n meaning: 'The external system that asserts this unit. Present only on a unit an identity directory created; absent on every unit authored in the application.',\n whyItMatters: 'This is the OWNERSHIP marker for directory-managed units. `POST /scim/v2/Groups` sets it and nothing else writes it, and the SCIM Groups endpoints read, update and delete ONLY units that carry it — a unit an administrator created answers 404 there. That is what stops a directory adopting a hand-authored unit by matching its display name, which would hand an administrator’s unit membership to the directory. It also tells the SCIM `/Users` department reconciliation, which is authoritative over a member’s whole set of units, which assignments belong to the Groups path and must be left alone.',\n importance: FieldSemanticImportance.PRIMARY,\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'ExternalIdentitySource',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n values: {\n [ExternalIdentitySource.SCIM]: { meaning: 'A SCIM directory group: the unit was created by `POST /scim/v2/Groups` and its membership is reconciled by that directory.' },\n [ExternalIdentitySource.OIDC]: { meaning: 'Not written for organization units today; reserved by the shared identity-source vocabulary.' },\n [ExternalIdentitySource.OAUTH2]: { meaning: 'Not written for organization units today; reserved by the shared identity-source vocabulary.' },\n [ExternalIdentitySource.SAML]: { meaning: 'Not written for organization units today; reserved by the shared identity-source vocabulary.' },\n },\n }),\n externalId: schemaShape.externalId.stringSpec({\n meaning: 'The directory’s OWN identifier for the group this unit represents — the SCIM `externalId`, which the provisioning client issues and this application stores. The SCIM `id` of the same group is the unit’s `_id`.',\n whyItMatters: 'Unique per organization and sparse: two organizations may hold the same directory group id, and the many units with no directory group are outside the constraint entirely. Set once when the directory creates the group and immutable afterwards, because re-keying it would move an authorization grant onto a different group. Microsoft Entra sends it on group creation; Okta does not send one at all, which is why unit ownership is carried by `externalSource` rather than by the presence of this field.',\n }),\n status: schemaShape.status.enumSpec({\n meaning: 'Lifecycle state of the node (archived, suspended, etc.).',\n importance: FieldSemanticImportance.PRIMARY,\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'OrganizationUnitStatus',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n values: {\n [OrganizationUnitStatus.ACTIVE]: { meaning: 'Normal visibility in pickers and policy.' },\n [OrganizationUnitStatus.INACTIVE]: { meaning: 'Retained for history, hidden from most UIs.' },\n [OrganizationUnitStatus.ARCHIVED]: { meaning: 'Soft-closed; restore via RESTORE when applicable.' },\n [OrganizationUnitStatus.SUSPENDED]: { meaning: 'Policy-hold; treat as non-assignable for new work.' },\n },\n }),\n },\n operations: {\n [Op.READ]: {\n purpose: 'Retrieve one organization unit by its route identity.',\n outcome: 'The unit’s hierarchy, classification, lifecycle state, and inheritance policy are returned.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The organization unit was found and its node record (name, code, status, hierarchy links) is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the organization-member role required to read organization units.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No organization unit exists for the supplied id within the caller’s tenant scope.' },\n ],\n idempotent: true,\n examples: [{\n title: 'Inspect an active department',\n response: ORGANIZATION_UNIT_EXAMPLE,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n variants: {\n context: {\n examples: [{\n title: 'Inspect a unit with its organization relationship',\n response: {\n ...ORGANIZATION_UNIT_EXAMPLE,\n organization: { _id: ORGANIZATION_UNIT_EXAMPLE.organizationId },\n },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n summary: {\n examples: [{\n title: 'Inspect the compact organization-unit summary',\n response: ORGANIZATION_UNIT_SUMMARY_EXAMPLE,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n },\n [Op.LIST]: {\n purpose: 'Browse organization units under an organization or a specific parent unit.',\n outcome: 'A page of organization-unit nodes and pagination metadata is returned.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of units under the addressed org or parent node.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the organization-member role required to list organization units.' },\n ],\n idempotent: true,\n examples: [{\n title: 'Browse recent organization units',\n request: ORGANIZATION_UNITS_PAGE_REQUEST,\n response: organizationUnitsPage([ORGANIZATION_UNIT_EXAMPLE]),\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n variants: {\n context: {\n examples: [{\n title: 'Browse units with organization relationship context',\n request: ORGANIZATION_UNITS_PAGE_REQUEST,\n response: organizationUnitsPage([{\n ...ORGANIZATION_UNIT_EXAMPLE,\n organization: { _id: ORGANIZATION_UNIT_EXAMPLE.organizationId },\n }]),\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n summary: {\n examples: [{\n title: 'Browse compact organization-unit summaries',\n request: ORGANIZATION_UNITS_PAGE_REQUEST,\n response: organizationUnitsPage([ORGANIZATION_UNIT_SUMMARY_EXAMPLE]),\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n },\n [Op.SEARCH]: {\n purpose: 'Search organization units by name or description and narrow the result with supported filters.',\n outcome: 'A page of matching units in the addressed organization or parent branch is returned.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of units matching the name or description query within the tenant.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the organization-member role required to search organization units.' },\n ],\n idempotent: true,\n examples: [{\n title: 'Find sales units by name and parent',\n request: {\n q: 'sales',\n name: 'EMEA Sales',\n parentUnitId: ORGANIZATION_UNIT_EXAMPLE.parentUnitId,\n page: 1,\n limit: 20,\n sort: 'name:asc',\n },\n response: organizationUnitsPage([ORGANIZATION_UNIT_EXAMPLE]),\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n [Op.CREATE]: {\n purpose: 'Create a root organization unit or add a child under an existing parent unit.',\n outcome: 'The new unit is returned with its server-assigned identifier and hierarchy path, ready for unit-scoped membership and access policies.',\n responseStatuses: [\n { code: HttpResponseStatusCode.CREATED_201, meaning: 'A new unit node was created under the supplied parent and is returned with its server-assigned id.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The unit payload fails schema validation (e.g. missing `name`).' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin / HR-structure role required to add nodes to the org tree.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'The referenced parent unit does not exist within the caller’s organization.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'A sibling unit under the same parent already uses the requested `code`; unit codes must be unique within a parent.', customMessageReference: ErrorCustomMessageReference.ORGANIZATION_UNIT_CODE_EXISTS },\n ],\n idempotent: false,\n examples: [\n {\n title: 'Create a unit under a parent node',\n request: {\n name: 'EMEA Sales',\n code: 'emea-sales',\n parentUnitId: ORGANIZATION_UNIT_EXAMPLE.parentUnitId,\n type: OrganizationUnitType.DEPARTMENT,\n inheritanceType: OrganizationUnit_PermissionInheritanceType.INHERIT_DOWN,\n status: OrganizationUnitStatus.ACTIVE,\n },\n response: ORGANIZATION_UNIT_EXAMPLE,\n forStatus: HttpResponseStatusCode.CREATED_201,\n },\n ],\n },\n [Op.UPDATE]: {\n purpose: 'Update a unit’s name, code, type, lifecycle state, or permission-inheritance policy. Use MOVE to change its parent.',\n outcome: 'The updated unit is returned. Changes to inheritance affect subsequent unit-scoped authorization decisions.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The unit was updated and the new node state is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The edited fields fail schema validation.' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin / HR-structure role required to edit org tree nodes.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No unit exists for the supplied id in the caller’s scope.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The requested `code` is already used by a sibling under the same parent. Reparenting is not accepted by UPDATE; use MOVE.', customMessageReference: ErrorCustomMessageReference.ORGANIZATION_UNIT_CODE_EXISTS },\n ],\n idempotent: true,\n examples: [{\n title: 'Rename a unit and isolate its permissions',\n request: {\n name: 'EMEA Revenue',\n code: 'emea-revenue',\n inheritanceType: OrganizationUnit_PermissionInheritanceType.NO_INHERITANCE,\n },\n response: {\n ...ORGANIZATION_UNIT_EXAMPLE,\n name: 'EMEA Revenue',\n code: 'emea-revenue',\n inheritanceType: OrganizationUnit_PermissionInheritanceType.NO_INHERITANCE,\n },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n [Op.DELETE]: {\n purpose: 'Remove an empty leaf node from the org tree; refused while the node still has child units or assigned members.',\n outcome: 'The unit row is deleted. A node with dependents is refused, so no subtree is stranded behind a dangling parent link and no member assignment outlives the unit it names.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The unit was deleted; the body carries its `id`.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin role required to remove org tree nodes.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No unit exists for the supplied id (or it was already removed).' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The unit still has dependents, and neither is cascade-deleted with it. Either child units remain — re-parent each onto another node with MOVE, or delete the subtree bottom-up — or organization members are still assigned to this unit, in which case the assignments must be removed first. Only a node with no children and no assignments can be deleted. The error context names each blocking dependent (`blockingDependents`).', customMessageReference: ErrorCustomMessageReference.RESOURCE_HAS_DEPENDENTS },\n ],\n idempotent: true,\n examples: [{\n title: 'Refuse deletion while a child unit remains',\n response: {\n error: {\n type: ErrorType.CONFLICT,\n severity: ErrorSeverity.MEDIUM,\n message: 'Resource conflict detected',\n customMessage: 'Move or delete child units and remove member assignments before deleting this unit.',\n customMessageReference: ErrorCustomMessageReference.RESOURCE_HAS_DEPENDENTS,\n timestamp: '2026-08-18T08:00:00.000Z',\n },\n },\n forStatus: HttpResponseStatusCode.CONFLICT_409,\n }],\n },\n [OrganizationUnit_Operations.MOVE]: {\n operationId: OrganizationUnit_Operations.MOVE,\n purpose: 'Move a unit beneath a different parent, or to the organization root when `newParentUnitId` is omitted.',\n outcome: 'The unit keeps its identity and member assignments. Its ancestor path and every descendant path are updated to reflect the new location. The supplied reason is retained on the committed operation audit event.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The unit was re-parented and the updated node (with its new path) is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The optional destination-parent identifier or reason has an invalid type or length.' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin / HR-structure role required to restructure the org tree.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'The unit being moved does not exist in the caller’s scope (beneath the route’s parent unit, when the request is addressed through it), or the destination parent unit does not exist in the caller’s organization. The destination, like every other node the move reads, is resolved across the whole organization, never only among the route parent’s children.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The destination would create a cycle — the target parent sits inside the moved unit’s own subtree, or is the unit itself.', customMessageReference: ErrorCustomMessageReference.ORGANIZATION_UNIT_MOVE_CONFLICT },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'A sibling under the new parent already uses the moved unit’s `code`. The destination itself is valid; rename the unit or choose another parent.', customMessageReference: ErrorCustomMessageReference.ORGANIZATION_UNIT_CODE_EXISTS },\n ],\n idempotent: false,\n examples: [{\n title: 'Move a department below a new division',\n request: {\n newParentUnitId: 'organization_unit_revenue',\n reason: 'Sales now reports through the global revenue division.',\n },\n response: {\n ...ORGANIZATION_UNIT_EXAMPLE,\n parentUnitId: 'organization_unit_revenue',\n path: '/organization_unit_revenue/',\n },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n [OrganizationUnit_Operations.ARCHIVE]: {\n operationId: OrganizationUnit_Operations.ARCHIVE,\n purpose: 'Archive one organization unit without deleting its history or changing descendant states.',\n outcome: 'The unit becomes ARCHIVED and is hidden from default active-unit pickers. Descendants retain their own states.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The unit transitioned to `archived` and the updated node is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin role required to archive org tree nodes.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No unit exists for the supplied id in the caller’s scope.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The unit is already `archived`, so archiving is not a legal transition from its current state.' },\n ],\n idempotent: true,\n examples: [{\n title: 'Archive a department after a reorganization',\n request: { reason: 'The EMEA Sales department was consolidated into Global Revenue.' },\n response: { ...ORGANIZATION_UNIT_EXAMPLE, status: OrganizationUnitStatus.ARCHIVED },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n [OrganizationUnit_Operations.RESTORE]: {\n operationId: OrganizationUnit_Operations.RESTORE,\n purpose: 'Restore an archived unit after its parent branch is active.',\n outcome: 'The unit becomes ACTIVE and is available again to active-unit pickers and policies. The committed operation is audited, including the optional reason, despite its MEDIUM risk level.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The unit transitioned back to `ACTIVE` and the restored node is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin role required to restore archived org tree nodes.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No unit exists for the supplied id in the caller’s scope.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The unit is not `archived` (so there is nothing to restore), or its parent branch is still archived and must be restored first.' },\n ],\n idempotent: true,\n examples: [{\n title: 'Restore an archived department',\n request: { reason: 'The department is active again for the new fiscal year.' },\n response: ORGANIZATION_UNIT_EXAMPLE,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n businessConstraints: [\n 'Admin org presets do not add alternate variants for `ORGANIZATION_UNITS` — only main `organizations` presets apply.',\n 'Per-unit DELETE is refused while child units remain, but deleting the whole ORGANIZATION is not: that cascade is enabled and removes every unit of the tenant at once (each unit carries the tenant id, so tree depth is irrelevant). Tearing a tenant down does not require dismantling its org chart leaf-by-leaf.',\n // Scope note, recorded so the narrower guard is not later read as an oversight. An earlier\n // revision of this spec also named \"assigned members\" as a DELETE blocker; it was dropped\n // (2026-07-29) because it cannot be enforced honestly today, not because it stopped mattering.\n 'Unit assignments ARE checked on unit DELETE (since 2026-07-31). They live in the `ORGANIZATION_UNIT_MEMBERS` junction resource, promoted out of the members row precisely so this dependent could be guarded: as an embedded array it was not a registered relationship and not adapter-neutrally queryable (a nested-path filter resolves to null on the SQL adapter, and the list projection dropped the field), so either available check would have passed silently instead of blocking.',\n 'MOVE, ARCHIVE and RESTORE are implemented (2026-07-31). Their request payloads name no schema field, so each custom implementation translates the payload into the real field mutation: MOVE writes `parentUnitId` + `path` and rewrites the materialized `path` of every descendant in one transaction; ARCHIVE/RESTORE write `status`.',\n 'Re-parenting is owned exclusively by MOVE — `parentUnitId` is `.excludeFromUpdate()`. A reparent has a subtree-wide side effect (every descendant path must be rewritten) and must be refused when the destination sits inside the moved node’s own subtree; generic UPDATE performs neither check, so allowing it there would silently produce stale paths or a detached cycle.',\n '`path` is a materialized ANCESTOR chain (`/`, `/R/`, `/R/C/`) — the route TO the node, excluding the node itself. It is written by the CREATE prefix on the same write that inserts the row, because a CREATE custom implementation never receives the new row’s id and a second write would leave a window with no path at all. Descendants of a node are addressed by `path + _id + \"/\"`, which is also the O(1) cycle test MOVE relies on.',\n 'ARCHIVE is node-only: descendants keep their own status, which keeps ARCHIVE O(1) and makes restore order explicit. RESTORE pays for that by validating the ancestor chain, so a node cannot be restored underneath a still-archived parent.',\n 'MOVE, ARCHIVE and RESTORE retain the submitted reason in the committed RESOURCE_OPERATION_PERFORMED event; ARCHIVE requires one, while MOVE and RESTORE accept it optionally. The request reason is audit history, not a mutable organization-unit field.',\n 'Sibling `code` uniqueness is the schema business key (`organizationId`, `parentUnitId`, `code`) — sibling-scoped, so two teams called `sales` under different divisions are legitimate. Rows carrying NO `code` are outside the constraint entirely (any number of code-less siblings is fine), while roots ARE covered: an absent `parentUnitId` is a real position, so two roots may not share a code.',\n 'That business key is enforced at BOTH layers, and both raise `ORGANIZATION_UNIT_CODE_EXISTS`. On MongoDB a partial compound unique index closes the concurrency window. On a SQL adapter there is no index yet — the planner records uniqueness as intent and leaves enforcement migration-owned — so the application guard at CREATE, UPDATE (rename) and MOVE is retained as the cross-adapter backstop. That guard is a read-then-write and therefore still racy on its own; the index, not the guard, is what makes the constraint hold under concurrency. Treat schema-declared uniqueness as a MongoDB guarantee until the SQL migration lane closes the gap.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.ORGANIZATIONS },\n ),\n () => ({\n layout: {\n purpose: 'The organization\\'s unit hierarchy (Settings → Organization units): departments, teams, regions and project groups.',\n headerPurpose: 'The READ header: the unit name on the title line, then on the facts line its `status` badge, and — for a unit a SCIM directory created — the `externalSource` badge, which is what tells an administrator that a rename made here will be reverted by the directory.',\n displayPurpose: 'READ is one flat list of rows and documents no section: `code`, `type`, `parentUnitId`, `inheritanceType` and `externalId`, each optional row hidden when empty. The materialized `path` is not shown — it is `parentUnitId` spelled as a chain of ids. Sub-units are composed below as this resource\\'s own tab.',\n summaryPurpose: 'A unit card: the name as the title, then `status`, `type` and the directory badge as bare values.',\n editPurpose: 'One flat, stacked form: `name` focused first, `code` and `type` sharing a row, then `status`, `parentUnitId` (CREATE only — re-parenting is MOVE) and `inheritanceType`.',\n },\n views: {\n [Op.READ]: { purpose: 'Detail drawer for a single unit in org settings.', whenToUse: 'Org structure admin and HR flows.' },\n [Op.LIST]: { purpose: 'Flat or nested listing under an org.', whenToUse: 'Unit pickers in assignment UI.' },\n [Op.SEARCH]: { purpose: 'Searchable listing when the factory marks search enabled.', whenToUse: 'Large orgs with many nodes.' },\n [Op.CREATE]: { purpose: 'Create under an org from structure settings.', whenToUse: 'HR or IT modeling new groups.' },\n [Op.UPDATE]: { purpose: 'Edit name, code, type, status, and inheritance policy inline.', whenToUse: 'Organization-directory corrections that do not change the parent.' },\n [Op.DELETE]: { purpose: 'Remove an empty leaf unit.', whenToUse: 'After its child units and member assignments have been removed or moved.' },\n [OrganizationUnit_Operations.MOVE]: { purpose: 'Drag/drop or form-driven reparenting.', whenToUse: 'Rebalancing regions or reporting lines.' },\n [OrganizationUnit_Operations.ARCHIVE]: { purpose: 'Soft-close one unit without changing descendants.', whenToUse: 'Mergers and seasonal structures.' },\n [OrganizationUnit_Operations.RESTORE]: { purpose: 'Bring an archived unit back under an active parent.', whenToUse: 'Mistakes or revived departments.' },\n },\n }),\n);\n"]}
@@ -4,6 +4,11 @@ import { type SpecificationOwnerRef } from '../../_core';
4
4
  export declare const ENGINE_PROVIDER_OWNER_REF: SpecificationOwnerRef;
5
5
  /** The npm package the engine's backend provider modules live in. */
6
6
  export declare const ENGINE_BACKEND_PROVIDERS_PACKAGE = "@wildo-ai/external-connectors-private";
7
+ /**
8
+ * The npm package the engine's browser provider modules live in (`./app`, `./website`, `./techdoc`): where a provider
9
+ * with no backend facet is declared (#3995 item 5).
10
+ */
11
+ export declare const ENGINE_FRONTEND_PROVIDERS_PACKAGE = "@wildo-ai/external-connectors-public";
7
12
  /** The `BackendProviderModule` const a backend provider is declared as. */
8
13
  export declare function backendProviderModuleSymbol(exportName: string): CodeSymbolRef;
9
14
  //# sourceMappingURL=_engine-provider-shared.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"_engine-provider-shared.d.ts","sourceRoot":"","sources":["../../../../src/engine/providers/_engine-provider-shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,aAAa,EACnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,KAAK,qBAAqB,EAA0B,MAAM,6BAA6B,CAAC;AAEjG,4DAA4D;AAC5D,eAAO,MAAM,yBAAyB,EAAE,qBAGvC,CAAC;AAEF,qEAAqE;AACrE,eAAO,MAAM,gCAAgC,0CAA0C,CAAC;AAExF,2EAA2E;AAC3E,wBAAgB,2BAA2B,CAAC,UAAU,EAAE,MAAM,GAAG,aAAa,CAO7E"}
1
+ {"version":3,"file":"_engine-provider-shared.d.ts","sourceRoot":"","sources":["../../../../src/engine/providers/_engine-provider-shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,aAAa,EACnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,KAAK,qBAAqB,EAA0B,MAAM,6BAA6B,CAAC;AAEjG,4DAA4D;AAC5D,eAAO,MAAM,yBAAyB,EAAE,qBAGvC,CAAC;AAEF,qEAAqE;AACrE,eAAO,MAAM,gCAAgC,0CAA0C,CAAC;AAExF;;;GAGG;AACH,eAAO,MAAM,iCAAiC,yCAAyC,CAAC;AAExF,2EAA2E;AAC3E,wBAAgB,2BAA2B,CAAC,UAAU,EAAE,MAAM,GAAG,aAAa,CAO7E"}
@@ -7,6 +7,11 @@ export const ENGINE_PROVIDER_OWNER_REF = {
7
7
  };
8
8
  /** The npm package the engine's backend provider modules live in. */
9
9
  export const ENGINE_BACKEND_PROVIDERS_PACKAGE = '@wildo-ai/external-connectors-private';
10
+ /**
11
+ * The npm package the engine's browser provider modules live in (`./app`, `./website`, `./techdoc`): where a provider
12
+ * with no backend facet is declared (#3995 item 5).
13
+ */
14
+ export const ENGINE_FRONTEND_PROVIDERS_PACKAGE = '@wildo-ai/external-connectors-public';
10
15
  /** The `BackendProviderModule` const a backend provider is declared as. */
11
16
  export function backendProviderModuleSymbol(exportName) {
12
17
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"_engine-provider-shared.js","sourceRoot":"","sources":["../../../../src/engine/providers/_engine-provider-shared.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,cAAc,GAEf,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAA8B,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAEjG,4DAA4D;AAC5D,MAAM,CAAC,MAAM,yBAAyB,GAA0B;IAC9D,OAAO,EAAE,QAAQ;IACjB,SAAS,EAAE,sBAAsB,CAAC,MAAM;CACzC,CAAC;AAEF,qEAAqE;AACrE,MAAM,CAAC,MAAM,gCAAgC,GAAG,uCAAuC,CAAC;AAExF,2EAA2E;AAC3E,MAAM,UAAU,2BAA2B,CAAC,UAAkB;IAC5D,OAAO;QACL,WAAW,EAAE,gCAAgC;QAC7C,UAAU;QACV,UAAU,EAAE,cAAc,CAAC,MAAM;QACjC,eAAe,EAAE,mBAAmB,CAAC,YAAY;KAClD,CAAC;AACJ,CAAC","sourcesContent":["import {\n CodeDeclarationKind,\n CodeSymbolKind,\n type CodeSymbolRef,\n} from '@wildo-ai/zod-decorators';\nimport { type SpecificationOwnerRef, SpecificationOwnerKind } from '~wildo-specifications/_core';\n\n/** Owner of every engine-shipped provider specification. */\nexport const ENGINE_PROVIDER_OWNER_REF: SpecificationOwnerRef = {\n ownerId: 'engine',\n ownerKind: SpecificationOwnerKind.ENGINE,\n};\n\n/** The npm package the engine's backend provider modules live in. */\nexport const ENGINE_BACKEND_PROVIDERS_PACKAGE = '@wildo-ai/external-connectors-private';\n\n/** The `BackendProviderModule` const a backend provider is declared as. */\nexport function backendProviderModuleSymbol(exportName: string): CodeSymbolRef {\n return {\n packageName: ENGINE_BACKEND_PROVIDERS_PACKAGE,\n exportName,\n symbolKind: CodeSymbolKind.CONFIG,\n declarationKind: CodeDeclarationKind.CONST_OBJECT,\n };\n}\n"]}
1
+ {"version":3,"file":"_engine-provider-shared.js","sourceRoot":"","sources":["../../../../src/engine/providers/_engine-provider-shared.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,cAAc,GAEf,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAA8B,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAEjG,4DAA4D;AAC5D,MAAM,CAAC,MAAM,yBAAyB,GAA0B;IAC9D,OAAO,EAAE,QAAQ;IACjB,SAAS,EAAE,sBAAsB,CAAC,MAAM;CACzC,CAAC;AAEF,qEAAqE;AACrE,MAAM,CAAC,MAAM,gCAAgC,GAAG,uCAAuC,CAAC;AAExF;;;GAGG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,sCAAsC,CAAC;AAExF,2EAA2E;AAC3E,MAAM,UAAU,2BAA2B,CAAC,UAAkB;IAC5D,OAAO;QACL,WAAW,EAAE,gCAAgC;QAC7C,UAAU;QACV,UAAU,EAAE,cAAc,CAAC,MAAM;QACjC,eAAe,EAAE,mBAAmB,CAAC,YAAY;KAClD,CAAC;AACJ,CAAC","sourcesContent":["import {\n CodeDeclarationKind,\n CodeSymbolKind,\n type CodeSymbolRef,\n} from '@wildo-ai/zod-decorators';\nimport { type SpecificationOwnerRef, SpecificationOwnerKind } from '~wildo-specifications/_core';\n\n/** Owner of every engine-shipped provider specification. */\nexport const ENGINE_PROVIDER_OWNER_REF: SpecificationOwnerRef = {\n ownerId: 'engine',\n ownerKind: SpecificationOwnerKind.ENGINE,\n};\n\n/** The npm package the engine's backend provider modules live in. */\nexport const ENGINE_BACKEND_PROVIDERS_PACKAGE = '@wildo-ai/external-connectors-private';\n\n/**\n * The npm package the engine's browser provider modules live in (`./app`, `./website`, `./techdoc`): where a provider\n * with no backend facet is declared (#3995 item 5).\n */\nexport const ENGINE_FRONTEND_PROVIDERS_PACKAGE = '@wildo-ai/external-connectors-public';\n\n/** The `BackendProviderModule` const a backend provider is declared as. */\nexport function backendProviderModuleSymbol(exportName: string): CodeSymbolRef {\n return {\n packageName: ENGINE_BACKEND_PROVIDERS_PACKAGE,\n exportName,\n symbolKind: CodeSymbolKind.CONFIG,\n declarationKind: CodeDeclarationKind.CONST_OBJECT,\n };\n}\n"]}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Engine provider specification for `dropbox` (#3995 item 5): the frontend-only Dropbox Chooser, and the first engine
3
+ * provider specification with no backend facet. The FACTS mirror the application-tier frontend module
4
+ * (`DropboxFrontendAppProvider`), and the CLI's provider-specification reconciliation (#328) reads them back from it.
5
+ *
6
+ * Without this specification the `provider_registry` brief (#3992) could not list it, so a planner wanting a Dropbox
7
+ * picker saw nothing and could record it as a need no provider fills, which is a fork of a provider the engine ships.
8
+ *
9
+ * Attach-only, by the module's own decision (2026-09-18): the Chooser hands the browser a credential-free direct link,
10
+ * the framework ingests the file into the field's storage, and nothing is stored in Dropbox. The module declares no
11
+ * secret: the Chooser's app key is public configuration (`publicConfigSchema.appKey`).
12
+ */
13
+ export declare const dropboxProviderSpecification: import("../../_core").ProviderSpecificationConfig;
14
+ //# sourceMappingURL=dropbox.provider.specification.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dropbox.provider.specification.d.ts","sourceRoot":"","sources":["../../../../src/engine/providers/dropbox.provider.specification.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,4BAA4B,mEA2DxC,CAAC"}