@wildo-ai/dev-companion 1.1.1 → 1.1.2

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 (224) hide show
  1. package/dist/esm/.tsbuildinfo +1 -1
  2. package/dist/esm/claude-cli/models/coding-agent-dispatch.models.d.ts +12 -1
  3. package/dist/esm/claude-cli/models/coding-agent-dispatch.models.d.ts.map +1 -1
  4. package/dist/esm/claude-cli/models/coding-agent-dispatch.models.js +11 -0
  5. package/dist/esm/claude-cli/models/coding-agent-dispatch.models.js.map +1 -1
  6. package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.d.ts +153 -1
  7. package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.d.ts.map +1 -1
  8. package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.js +419 -41
  9. package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.js.map +1 -1
  10. package/dist/esm/claude-cli/services/research-agent-dispatch.companion.service.d.ts +25 -10
  11. package/dist/esm/claude-cli/services/research-agent-dispatch.companion.service.d.ts.map +1 -1
  12. package/dist/esm/claude-cli/services/research-agent-dispatch.companion.service.js +65 -24
  13. package/dist/esm/claude-cli/services/research-agent-dispatch.companion.service.js.map +1 -1
  14. package/dist/esm/claude-cli/services/research-evidence-store.companion.d.ts +86 -0
  15. package/dist/esm/claude-cli/services/research-evidence-store.companion.d.ts.map +1 -0
  16. package/dist/esm/claude-cli/services/research-evidence-store.companion.js +127 -0
  17. package/dist/esm/claude-cli/services/research-evidence-store.companion.js.map +1 -0
  18. package/dist/esm/companion-api/companion-api.schemas.d.ts +59 -2
  19. package/dist/esm/companion-api/companion-api.schemas.d.ts.map +1 -1
  20. package/dist/esm/companion-api/companion-api.schemas.js +60 -0
  21. package/dist/esm/companion-api/companion-api.schemas.js.map +1 -1
  22. package/dist/esm/companion-api/controllers/companion.controller.d.ts +63 -1
  23. package/dist/esm/companion-api/controllers/companion.controller.d.ts.map +1 -1
  24. package/dist/esm/companion-api/controllers/companion.controller.js +322 -21
  25. package/dist/esm/companion-api/controllers/companion.controller.js.map +1 -1
  26. package/dist/esm/core/inject/models/container.d.ts.map +1 -1
  27. package/dist/esm/core/inject/models/container.js +11 -0
  28. package/dist/esm/core/inject/models/container.js.map +1 -1
  29. package/dist/esm/core/inject/models/service-types.d.ts +5 -0
  30. package/dist/esm/core/inject/models/service-types.d.ts.map +1 -1
  31. package/dist/esm/core/inject/models/service-types.js +5 -0
  32. package/dist/esm/core/inject/models/service-types.js.map +1 -1
  33. package/dist/esm/core/introspection/behaviors/companion-introspection-behavior-definitions.d.ts.map +1 -1
  34. package/dist/esm/core/introspection/behaviors/companion-introspection-behavior-definitions.js +81 -0
  35. package/dist/esm/core/introspection/behaviors/companion-introspection-behavior-definitions.js.map +1 -1
  36. package/dist/esm/core/introspection/models/companion-introspection.models.d.ts +11 -1
  37. package/dist/esm/core/introspection/models/companion-introspection.models.d.ts.map +1 -1
  38. package/dist/esm/core/introspection/models/companion-introspection.models.js +39 -0
  39. package/dist/esm/core/introspection/models/companion-introspection.models.js.map +1 -1
  40. package/dist/esm/core/introspection/resources/creation-plane-dispatch.custom-impl.companion.service.d.ts +8 -0
  41. package/dist/esm/core/introspection/resources/creation-plane-dispatch.custom-impl.companion.service.d.ts.map +1 -0
  42. package/dist/esm/core/introspection/resources/creation-plane-dispatch.custom-impl.companion.service.js +317 -0
  43. package/dist/esm/core/introspection/resources/creation-plane-dispatch.custom-impl.companion.service.js.map +1 -0
  44. package/dist/esm/core/introspection/resources/creation-plane-projection.companion.service.d.ts +45 -0
  45. package/dist/esm/core/introspection/resources/creation-plane-projection.companion.service.d.ts.map +1 -0
  46. package/dist/esm/core/introspection/resources/creation-plane-projection.companion.service.js +250 -0
  47. package/dist/esm/core/introspection/resources/creation-plane-projection.companion.service.js.map +1 -0
  48. package/dist/esm/core/introspection/resources/introspection-resource-notifier.companion.service.d.ts +123 -0
  49. package/dist/esm/core/introspection/resources/introspection-resource-notifier.companion.service.d.ts.map +1 -0
  50. package/dist/esm/core/introspection/resources/introspection-resource-notifier.companion.service.js +298 -0
  51. package/dist/esm/core/introspection/resources/introspection-resource-notifier.companion.service.js.map +1 -0
  52. package/dist/esm/core/introspection/resources/introspection-resource-source.companion.service.d.ts +78 -1
  53. package/dist/esm/core/introspection/resources/introspection-resource-source.companion.service.d.ts.map +1 -1
  54. package/dist/esm/core/introspection/resources/introspection-resource-source.companion.service.js +155 -6
  55. package/dist/esm/core/introspection/resources/introspection-resource-source.companion.service.js.map +1 -1
  56. package/dist/esm/core/introspection/services/companion-introspection.companion.service.d.ts +131 -2
  57. package/dist/esm/core/introspection/services/companion-introspection.companion.service.d.ts.map +1 -1
  58. package/dist/esm/core/introspection/services/companion-introspection.companion.service.js +259 -9
  59. package/dist/esm/core/introspection/services/companion-introspection.companion.service.js.map +1 -1
  60. package/dist/esm/core/introspection/services/introspection-derivation-state.companion.service.d.ts +243 -0
  61. package/dist/esm/core/introspection/services/introspection-derivation-state.companion.service.d.ts.map +1 -0
  62. package/dist/esm/core/introspection/services/introspection-derivation-state.companion.service.js +417 -0
  63. package/dist/esm/core/introspection/services/introspection-derivation-state.companion.service.js.map +1 -0
  64. package/dist/esm/core/introspection/services/introspection-source-state.companion.service.d.ts +186 -0
  65. package/dist/esm/core/introspection/services/introspection-source-state.companion.service.d.ts.map +1 -0
  66. package/dist/esm/core/introspection/services/introspection-source-state.companion.service.js +368 -0
  67. package/dist/esm/core/introspection/services/introspection-source-state.companion.service.js.map +1 -0
  68. package/dist/esm/core/introspection/services/introspection-source-watcher.companion.service.d.ts +101 -0
  69. package/dist/esm/core/introspection/services/introspection-source-watcher.companion.service.d.ts.map +1 -0
  70. package/dist/esm/core/introspection/services/introspection-source-watcher.companion.service.js +278 -0
  71. package/dist/esm/core/introspection/services/introspection-source-watcher.companion.service.js.map +1 -0
  72. package/dist/esm/core/introspection/subprocess/application-domain-model.behavior.d.ts +365 -0
  73. package/dist/esm/core/introspection/subprocess/application-domain-model.behavior.d.ts.map +1 -0
  74. package/dist/esm/core/introspection/subprocess/application-domain-model.behavior.js +167 -0
  75. package/dist/esm/core/introspection/subprocess/application-domain-model.behavior.js.map +1 -0
  76. package/dist/esm/core/introspection/subprocess/companion-introspection-behavior-handlers.d.ts.map +1 -1
  77. package/dist/esm/core/introspection/subprocess/companion-introspection-behavior-handlers.js +332 -3
  78. package/dist/esm/core/introspection/subprocess/companion-introspection-behavior-handlers.js.map +1 -1
  79. package/dist/esm/core/introspection/subprocess/family-aspects.behavior.d.ts +19 -0
  80. package/dist/esm/core/introspection/subprocess/family-aspects.behavior.d.ts.map +1 -0
  81. package/dist/esm/core/introspection/subprocess/family-aspects.behavior.js +164 -0
  82. package/dist/esm/core/introspection/subprocess/family-aspects.behavior.js.map +1 -0
  83. package/dist/esm/core/introspection/subprocess/openapi-generation-input.behavior.d.ts +3 -1
  84. package/dist/esm/core/introspection/subprocess/openapi-generation-input.behavior.d.ts.map +1 -1
  85. package/dist/esm/core/introspection/subprocess/openapi-generation-input.behavior.js +36 -23
  86. package/dist/esm/core/introspection/subprocess/openapi-generation-input.behavior.js.map +1 -1
  87. package/dist/esm/core/introspection/subprocess/specification-artifacts.behavior.d.ts +51 -0
  88. package/dist/esm/core/introspection/subprocess/specification-artifacts.behavior.d.ts.map +1 -0
  89. package/dist/esm/core/introspection/subprocess/specification-artifacts.behavior.js +391 -0
  90. package/dist/esm/core/introspection/subprocess/specification-artifacts.behavior.js.map +1 -0
  91. package/dist/esm/core/runtime/companion-startup-assembly.d.ts.map +1 -1
  92. package/dist/esm/core/runtime/companion-startup-assembly.js +5 -0
  93. package/dist/esm/core/runtime/companion-startup-assembly.js.map +1 -1
  94. package/dist/esm/core/runtime/dev-compile-quiet.companion.d.ts +103 -0
  95. package/dist/esm/core/runtime/dev-compile-quiet.companion.d.ts.map +1 -0
  96. package/dist/esm/core/runtime/dev-compile-quiet.companion.js +124 -0
  97. package/dist/esm/core/runtime/dev-compile-quiet.companion.js.map +1 -0
  98. package/dist/esm/core/runtime/services/start-companion-application.service.d.ts +39 -2
  99. package/dist/esm/core/runtime/services/start-companion-application.service.d.ts.map +1 -1
  100. package/dist/esm/core/runtime/services/start-companion-application.service.js +122 -11
  101. package/dist/esm/core/runtime/services/start-companion-application.service.js.map +1 -1
  102. package/dist/esm/core/specifications/non-composite-view-specification-context.shared.d.ts +6 -0
  103. package/dist/esm/core/specifications/non-composite-view-specification-context.shared.d.ts.map +1 -1
  104. package/dist/esm/core/specifications/non-composite-view-specification-context.shared.js.map +1 -1
  105. package/dist/esm/core/specifications/specification-context-factory.shared.d.ts +23 -0
  106. package/dist/esm/core/specifications/specification-context-factory.shared.d.ts.map +1 -1
  107. package/dist/esm/core/specifications/specification-context-factory.shared.js +26 -4
  108. package/dist/esm/core/specifications/specification-context-factory.shared.js.map +1 -1
  109. package/dist/esm/executions/services/companion-executions.companion.service.d.ts +82 -3
  110. package/dist/esm/executions/services/companion-executions.companion.service.d.ts.map +1 -1
  111. package/dist/esm/executions/services/companion-executions.companion.service.js +126 -12
  112. package/dist/esm/executions/services/companion-executions.companion.service.js.map +1 -1
  113. package/dist/esm/i18n/components/APP_LAYOUTS_MAIN_CONTAINER.en.d.ts +12 -0
  114. package/dist/esm/i18n/components/APP_LAYOUTS_MAIN_CONTAINER.en.d.ts.map +1 -0
  115. package/dist/esm/i18n/components/APP_LAYOUTS_MAIN_CONTAINER.en.js +12 -0
  116. package/dist/esm/i18n/components/APP_LAYOUTS_MAIN_CONTAINER.en.js.map +1 -0
  117. package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD.en.d.ts +1 -1
  118. package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD.en.js +1 -1
  119. package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD.en.js.map +1 -1
  120. package/dist/esm/i18n/composite_views/app.creation-board.en.d.ts +13 -0
  121. package/dist/esm/i18n/composite_views/app.creation-board.en.d.ts.map +1 -0
  122. package/dist/esm/i18n/composite_views/app.creation-board.en.js +91 -0
  123. package/dist/esm/i18n/composite_views/app.creation-board.en.js.map +1 -0
  124. package/dist/esm/i18n/composite_views/app.domain-model.en.d.ts +38 -0
  125. package/dist/esm/i18n/composite_views/app.domain-model.en.d.ts.map +1 -0
  126. package/dist/esm/i18n/composite_views/app.domain-model.en.js +41 -0
  127. package/dist/esm/i18n/composite_views/app.domain-model.en.js.map +1 -0
  128. package/dist/esm/i18n/index.d.ts +3 -3
  129. package/dist/esm/i18n/index.js +3 -3
  130. package/dist/esm/i18n/index.js.map +1 -1
  131. package/dist/esm/i18n/resources/wildoApplicationActorSystemExecutions.en.d.ts +24 -0
  132. package/dist/esm/i18n/resources/wildoApplicationActorSystemExecutions.en.d.ts.map +1 -0
  133. package/dist/esm/i18n/resources/wildoApplicationActorSystemExecutions.en.js +20 -0
  134. package/dist/esm/i18n/resources/wildoApplicationActorSystemExecutions.en.js.map +1 -0
  135. package/dist/esm/i18n/resources/wildoApplicationActorTasks.en.d.ts +31 -0
  136. package/dist/esm/i18n/resources/wildoApplicationActorTasks.en.d.ts.map +1 -0
  137. package/dist/esm/i18n/resources/wildoApplicationActorTasks.en.js +27 -0
  138. package/dist/esm/i18n/resources/wildoApplicationActorTasks.en.js.map +1 -0
  139. package/dist/esm/i18n/resources/wildoApplicationFlowSystemExecutions.en.d.ts +24 -0
  140. package/dist/esm/i18n/resources/wildoApplicationFlowSystemExecutions.en.d.ts.map +1 -0
  141. package/dist/esm/i18n/resources/wildoApplicationFlowSystemExecutions.en.js +20 -0
  142. package/dist/esm/i18n/resources/wildoApplicationFlowSystemExecutions.en.js.map +1 -0
  143. package/dist/esm/i18n/resources/workbenchBuildPlanTasks.en.d.ts +28 -0
  144. package/dist/esm/i18n/resources/workbenchBuildPlanTasks.en.d.ts.map +1 -0
  145. package/dist/esm/i18n/resources/workbenchBuildPlanTasks.en.js +24 -0
  146. package/dist/esm/i18n/resources/workbenchBuildPlanTasks.en.js.map +1 -0
  147. package/dist/esm/i18n/resources/workbenchDomainResources.en.d.ts +138 -0
  148. package/dist/esm/i18n/resources/workbenchDomainResources.en.d.ts.map +1 -0
  149. package/dist/esm/i18n/resources/workbenchDomainResources.en.js +100 -0
  150. package/dist/esm/i18n/resources/workbenchDomainResources.en.js.map +1 -0
  151. package/dist/esm/i18n/resources/workbenchPlaybooks.en.d.ts +29 -0
  152. package/dist/esm/i18n/resources/workbenchPlaybooks.en.d.ts.map +1 -0
  153. package/dist/esm/i18n/resources/workbenchPlaybooks.en.js +25 -0
  154. package/dist/esm/i18n/resources/workbenchPlaybooks.en.js.map +1 -0
  155. package/dist/esm/i18n/resources/workbenchRunWriteRecords.en.d.ts +27 -0
  156. package/dist/esm/i18n/resources/workbenchRunWriteRecords.en.d.ts.map +1 -0
  157. package/dist/esm/i18n/resources/workbenchRunWriteRecords.en.js +23 -0
  158. package/dist/esm/i18n/resources/workbenchRunWriteRecords.en.js.map +1 -0
  159. package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.d.ts +806 -0
  160. package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.d.ts.map +1 -0
  161. package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.js +326 -0
  162. package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.js.map +1 -0
  163. package/dist/esm/i18n/resources/workbenchTraceSessions.en.d.ts +26 -0
  164. package/dist/esm/i18n/resources/workbenchTraceSessions.en.d.ts.map +1 -0
  165. package/dist/esm/i18n/resources/workbenchTraceSessions.en.js +22 -0
  166. package/dist/esm/i18n/resources/workbenchTraceSessions.en.js.map +1 -0
  167. package/dist/esm/i18n/system_enums/market.en.d.ts +202 -0
  168. package/dist/esm/i18n/system_enums/market.en.d.ts.map +1 -0
  169. package/dist/esm/i18n/system_enums/market.en.js +209 -0
  170. package/dist/esm/i18n/system_enums/market.en.js.map +1 -0
  171. package/dist/esm/meta-workflows/models/application-coding-agent.actors-system.definitions.d.ts +112 -2
  172. package/dist/esm/meta-workflows/models/application-coding-agent.actors-system.definitions.d.ts.map +1 -1
  173. package/dist/esm/meta-workflows/models/application-coding-agent.actors-system.definitions.js +201 -34
  174. package/dist/esm/meta-workflows/models/application-coding-agent.actors-system.definitions.js.map +1 -1
  175. package/dist/esm/meta-workflows/models/application-research-agent.actors-system.definitions.d.ts +31 -3
  176. package/dist/esm/meta-workflows/models/application-research-agent.actors-system.definitions.d.ts.map +1 -1
  177. package/dist/esm/meta-workflows/models/application-research-agent.actors-system.definitions.js +48 -12
  178. package/dist/esm/meta-workflows/models/application-research-agent.actors-system.definitions.js.map +1 -1
  179. package/dist/esm/meta-workflows/models/brief-adequacy.actors-system.definitions.d.ts +36 -0
  180. package/dist/esm/meta-workflows/models/brief-adequacy.actors-system.definitions.d.ts.map +1 -0
  181. package/dist/esm/meta-workflows/models/brief-adequacy.actors-system.definitions.js +75 -0
  182. package/dist/esm/meta-workflows/models/brief-adequacy.actors-system.definitions.js.map +1 -0
  183. package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.d.ts +105 -7
  184. package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.d.ts.map +1 -1
  185. package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.js +298 -24
  186. package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.js.map +1 -1
  187. package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.d.ts +46 -3
  188. package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.d.ts.map +1 -1
  189. package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.js +95 -2
  190. package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.js.map +1 -1
  191. package/dist/esm/meta-workflows/services/execution-trace-read.companion.service.d.ts +9 -0
  192. package/dist/esm/meta-workflows/services/execution-trace-read.companion.service.d.ts.map +1 -1
  193. package/dist/esm/meta-workflows/services/execution-trace-read.companion.service.js +13 -0
  194. package/dist/esm/meta-workflows/services/execution-trace-read.companion.service.js.map +1 -1
  195. package/dist/esm/meta-workflows/services/playbook-run-write-register.companion.service.d.ts +12 -0
  196. package/dist/esm/meta-workflows/services/playbook-run-write-register.companion.service.d.ts.map +1 -1
  197. package/dist/esm/meta-workflows/services/playbook-run-write-register.companion.service.js +23 -0
  198. package/dist/esm/meta-workflows/services/playbook-run-write-register.companion.service.js.map +1 -1
  199. package/dist/esm/meta-workflows/services/playbook-run.companion.service.d.ts +120 -3
  200. package/dist/esm/meta-workflows/services/playbook-run.companion.service.d.ts.map +1 -1
  201. package/dist/esm/meta-workflows/services/playbook-run.companion.service.js +636 -81
  202. package/dist/esm/meta-workflows/services/playbook-run.companion.service.js.map +1 -1
  203. package/dist/esm/meta-workflows/services/playbook-suspended-run.companion.service.d.ts +40 -0
  204. package/dist/esm/meta-workflows/services/playbook-suspended-run.companion.service.d.ts.map +1 -1
  205. package/dist/esm/meta-workflows/services/playbook-suspended-run.companion.service.js +63 -1
  206. package/dist/esm/meta-workflows/services/playbook-suspended-run.companion.service.js.map +1 -1
  207. package/dist/esm/technical-doc/services/technical-doc.companion.service.d.ts +21 -0
  208. package/dist/esm/technical-doc/services/technical-doc.companion.service.d.ts.map +1 -1
  209. package/dist/esm/technical-doc/services/technical-doc.companion.service.js +86 -2
  210. package/dist/esm/technical-doc/services/technical-doc.companion.service.js.map +1 -1
  211. package/dist/esm/technical-doc/services/technical-documentation-application-derivation.companion.service.d.ts +12 -1
  212. package/dist/esm/technical-doc/services/technical-documentation-application-derivation.companion.service.d.ts.map +1 -1
  213. package/dist/esm/technical-doc/services/technical-documentation-application-derivation.companion.service.js +47 -1
  214. package/dist/esm/technical-doc/services/technical-documentation-application-derivation.companion.service.js.map +1 -1
  215. package/package.json +17 -17
  216. package/dist/esm/.builder.pid +0 -9
  217. package/dist/esm/i18n/resources/workbenchApplicationModules.en.d.ts +0 -36
  218. package/dist/esm/i18n/resources/workbenchApplicationModules.en.d.ts.map +0 -1
  219. package/dist/esm/i18n/resources/workbenchApplicationModules.en.js +0 -32
  220. package/dist/esm/i18n/resources/workbenchApplicationModules.en.js.map +0 -1
  221. package/dist/esm/i18n/resources/workbenchResourceRelationships.en.d.ts +0 -29
  222. package/dist/esm/i18n/resources/workbenchResourceRelationships.en.d.ts.map +0 -1
  223. package/dist/esm/i18n/resources/workbenchResourceRelationships.en.js +0 -25
  224. package/dist/esm/i18n/resources/workbenchResourceRelationships.en.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"companion-executions.companion.service.js","sourceRoot":"","sources":["../../../../../src/executions/services/companion-executions.companion.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE/C,OAAO,EACL,0BAA0B,EAE1B,qCAAqC,EACrC,aAAa,EACb,yCAAyC,EACzC,2CAA2C,EAC3C,+BAA+B,EAC/B,kBAAkB,GAEnB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAGL,qBAAqB,EACrB,2BAA2B,EAC3B,SAAS,EAET,uBAAuB,EACvB,kBAAkB,EAClB,0BAA0B,EAC1B,uCAAuC,EACvC,mBAAmB,GAEpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,yBAAyB,EAA0B,MAAM,gCAAgC,CAAC;AAUnG,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,EAAE,4BAA4B,EAAE,MAAM,wDAAwD,CAAC;AACtG,OAAO,EAAE,0BAA0B,EAAE,uBAAuB,EAAyC,MAAM,uDAAuD,CAAC;AA4BnK,MAAM,uDAAuD,GAAiB,uCAAuC,CAAC;AAEtH,MAAM,sDAAsD,GAAiB,sCAAsC,CAAC;AAEpH,MAAM,2CAA2C,GAAiB,4BAA4B,CAAC;AAE/F;;;;;;;;GAQG;AACH,MAAM,4CAA4C,GAAqC,MAAM,CAAC,MAAM,CAAC;IACnG,cAAc,EAAE,uDAAuD;IACvE,SAAS,EAAE,2CAA2C;CACvD,CAAC,CAAC;AAoBI,IAAM,mCAAmC,GAAzC,MAAM,mCAAmC;IAK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kB,CAAC,MAAM,CAAC,CAAA;IACjC,WAAA,MAAM,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAA;IAY9C,WAAA,MAAM,CAAC,kBAAkB,CAAC,oCAAoC,CAAC,CAAA;IAE/D,WAAA,MAAM,CAAC,kBAAkB,CAAC,kCAAkC,CAAC,CAAA;IAE7D,WAAA,MAAM,CAAC,kBAAkB,CAAC,uBAAuB,CAAC,CAAA;IAElD,WAAA,MAAM,CAAC,kBAAkB,CAAC,qCAAqC,CAAC,CAAA;IAEhE,WAAA,MAAM,CAAC,uBAAuB,CAAC,gBAAgB,CAAC,CAAA;IAEhD,WAAA,MAAM,CAAC,uBAAuB,CAAC,mBAAmB,CAAC,CAAA;qCAvBQ,aAAa;QAE1C,0BAA0B;QAYT,2CAA2C;QAEpD,yCAAyC;QAE5C,+BAA+B;QAEzB,qCAAqC,UAIzC,4BAA4B;GA7BzD,mCAAmC,CA6lD/C","sourcesContent":["import { inject, injectable } from \"inversify\";\nimport { z } from \"zod\";\nimport {\n ErrorBuilderBackendService,\n ExecutionContext,\n ExecutionContextCreatorBackendService,\n LoggerService,\n RepositoriesRegistryHandlerBackendService,\n ResourcePersistenceUnitOfWorkBackendService,\n ResourcesRegistryBackendService,\n SAAS_SERVICE_TYPES,\n type TransactionContext,\n} from \"@wildo-ai/saas-backend-lib\";\nimport {\n Actors_Task_Schema,\n ActorSystem_ExecutionSchema,\n CoreResourceOperation,\n ErrorCustomMessageReference,\n ErrorType,\n FlowSystem_Execution_Schema,\n FlowsActors_ElementKind,\n FlowsActors_Status,\n ResourceSerializationUtils,\n deriveTrustedSystemWritePreservedFields,\n isWildoBackendError,\n type ResourceType,\n} from '@wildo-ai/saas-models';\nimport { CustomShared_ResourceType, type Wildo_Application } from \"@wildo-ai/platform-core-shared\";\nimport type {\n CompanionActorTasksListQuery,\n CompanionCreateActorTaskRequest,\n CompanionCreateActorExecutionRequest,\n CompanionCreateFlowExecutionRequest,\n CompanionExecutionsListQuery,\n CompanionUpdateActorTaskRequest,\n} from \"../../companion-api/companion-api.schemas\";\nimport type { CompanionContext } from \"../../core/context/companion-context\";\nimport { COMPANION_SERVICE_TYPES } from \"../../core/inject/models/service-types\";\nimport { CompanionTraceabilityService } from \"../../core/traceability/companion-traceability.service\";\nimport { CompanionTraceabilityLevel, CompanionTraceAliasKind, type CompanionExecutionSessionContext } from \"../../core/traceability/companion-traceability.models\";\ninterface CompanionExecutionOwnership {\n organizationId: string;\n wildoApplicationId: string;\n}\n\ntype Wildo_Application_ActorSystem_Execution = z.infer<typeof ActorSystem_ExecutionSchema> & {\n _id: string;\n _version?: number;\n organizationId: string;\n wildoApplicationId: string;\n};\n\ntype Wildo_Application_FlowSystem_Execution = z.infer<typeof FlowSystem_Execution_Schema> & {\n _id: string;\n organizationId: string;\n wildoApplicationId: string;\n};\n\ntype Wildo_Application_Actor_Task = z.infer<typeof Actors_Task_Schema> & {\n _id: string;\n _version?: number;\n organizationId: string;\n wildoApplicationId: string;\n wildoApplicationActorSystemExecutionId?: string;\n continuityAttemptKey?: string;\n};\n\nconst WILDO_APPLICATION_ACTOR_SYSTEM_EXECUTIONS_RESOURCE_TYPE: ResourceType = \"wildoApplicationActorSystemExecutions\";\n\nconst WILDO_APPLICATION_FLOW_SYSTEM_EXECUTIONS_RESOURCE_TYPE: ResourceType = \"wildoApplicationFlowSystemExecutions\";\n\nconst WILDO_APPLICATION_ACTOR_TASKS_RESOURCE_TYPE: ResourceType = \"wildoApplicationActorTasks\";\n\n/**\n * The persistence participants of every companion execution boundary.\n *\n * Executions and their tasks are written together — creating an execution persists its\n * standalone tasks, and both task verbs read the owning execution back inside the same\n * transaction — so the two resources belong to ONE boundary. Declaring them is what lets the\n * unit of work resolve a single adapter and refuse the split-store case outright, instead of\n * discovering it at commit time on whichever adapter happened to open the transaction.\n */\nconst COMPANION_EXECUTION_PERSISTENCE_PARTICIPANTS: Readonly<Record<string, string>> = Object.freeze({\n actorExecution: WILDO_APPLICATION_ACTOR_SYSTEM_EXECUTIONS_RESOURCE_TYPE,\n actorTask: WILDO_APPLICATION_ACTOR_TASKS_RESOURCE_TYPE,\n});\n\ntype ExecutionCreateEnvelope = {\n status: FlowsActors_Status;\n statusChanges: Array<{ status: FlowsActors_Status; timestamp: string }>;\n createdAt?: string;\n updatedAt?: string;\n finishedAt?: string;\n};\n\ntype CompanionRepositoryOptions = {\n transaction?: TransactionContext;\n};\n\ntype PersistedExecutionTask = {\n sourceTaskId: string;\n task: Wildo_Application_Actor_Task;\n};\n\n@injectable()\nexport class CompanionExecutionsCompanionService {\n private readonly logDebug: (message: string, context?: Record<string, unknown>) => void;\n private ownershipPromise?: Promise<CompanionExecutionOwnership>;\n\n constructor(\n @inject(SAAS_SERVICE_TYPES.Logger) private readonly logger: LoggerService,\n @inject(SAAS_SERVICE_TYPES.ErrorBuilderService)\n private readonly errorBuilder: ErrorBuilderBackendService,\n /*\n * The ADAPTER-NEUTRAL transaction seam, not `MongoDBService`.\n *\n * These three boundaries used `mongoDBService.executeTransaction` until 2026-08-28, which\n * is one half of why the companion could not run on a PostgreSQL platform (issue #94):\n * even once the right store is connected, a Mongo-specific transaction cannot wrap a write\n * to a PostgreSQL-resolved repository. The unit of work resolves the adapter from the\n * DECLARED participants and refuses a boundary whose resources are split across two stores,\n * which is a configuration error rather than something to discover at commit time.\n */\n @inject(SAAS_SERVICE_TYPES.ResourcePersistenceUnitOfWorkService)\n private readonly resourcePersistenceUnitOfWork: ResourcePersistenceUnitOfWorkBackendService,\n @inject(SAAS_SERVICE_TYPES.RepositoriesRegistryHandlerService)\n private readonly repositoriesRegistry: RepositoriesRegistryHandlerBackendService,\n @inject(SAAS_SERVICE_TYPES.ResourceRegistryService)\n private readonly resourcesRegistry: ResourcesRegistryBackendService,\n @inject(SAAS_SERVICE_TYPES.ExecutionContextCreatorBackendService)\n private readonly executionContextCreator: ExecutionContextCreatorBackendService,\n @inject(COMPANION_SERVICE_TYPES.CompanionContext)\n private readonly companionContext: CompanionContext,\n @inject(COMPANION_SERVICE_TYPES.TraceabilityService)\n private readonly traceabilityService: CompanionTraceabilityService,\n ) {\n this.logDebug = this.logger.debugByType(\"CompanionExecutionsCompanionService\");\n this.logger.setDebugTypeLogging(\"CompanionExecutionsCompanionService\", true);\n }\n\n public async createActorExecution(\n payload: CompanionCreateActorExecutionRequest,\n sessionContext?: CompanionExecutionSessionContext,\n ): Promise<Wildo_Application_ActorSystem_Execution> {\n const traceStep = this.createOperationTraceStep(sessionContext, \"create-actor-execution\");\n await this.traceOperationStart({\n sessionContext,\n step: traceStep,\n type: \"actor-execution-create-start\",\n summary: `Create persisted actor execution for ${payload.systemRef}`,\n payload: {\n systemRef: payload.systemRef,\n status: payload.status,\n standaloneTaskCount: payload.standaloneTasks.length,\n },\n artifactFileName: \"actor-execution-create-request.json\",\n artifactContent: payload,\n });\n\n try {\n this.assertStandaloneTaskStateConsistency(payload);\n const execution = await this.resourcePersistenceUnitOfWork.executeTransaction(\n {\n boundary: 'companion-executions.create-actor-execution',\n participants: COMPANION_EXECUTION_PERSISTENCE_PARTICIPANTS,\n },\n async ({ transaction }) => {\n const ownership = await this.resolveOwnership(sessionContext);\n const repository = this.repositoriesRegistry.getRepositoryOrThrow(WILDO_APPLICATION_ACTOR_SYSTEM_EXECUTIONS_RESOURCE_TYPE);\n const executionContext = await this.createInternalExecutionContext(\n WILDO_APPLICATION_ACTOR_SYSTEM_EXECUTIONS_RESOURCE_TYPE,\n CoreResourceOperation.CREATE,\n sessionContext,\n );\n const normalizedPayload = this.normalizeCreateEnvelope(payload);\n const createData = {\n ...payload,\n ...normalizedPayload,\n organizationId: ownership.organizationId,\n wildoApplicationId: ownership.wildoApplicationId,\n };\n\n const createdExecution = await repository.create<Wildo_Application_ActorSystem_Execution>(executionContext, createData, {\n ...this.buildRepositoryOptions(transaction),\n preserveServerInjectedFields: this.deriveServerInjectedPreserveFields(\n WILDO_APPLICATION_ACTOR_SYSTEM_EXECUTIONS_RESOURCE_TYPE,\n createData,\n CoreResourceOperation.CREATE,\n ),\n });\n\n if (payload.standaloneTasks.length === 0) {\n return createdExecution;\n }\n\n const persistedTasks = await this.persistExecutionTasks(\n ownership,\n createdExecution._id,\n payload.standaloneTasks,\n payload.standaloneTaskStates,\n transaction,\n sessionContext,\n );\n\n const updatedExecution = await this.updateActorExecutionTaskSnapshot(\n createdExecution,\n ownership,\n persistedTasks.map(({ task }) => task),\n transaction,\n this.buildPersistedStandaloneTaskStates(persistedTasks, payload.standaloneTaskStates),\n sessionContext,\n );\n return updatedExecution;\n },\n );\n\n if (sessionContext) {\n await this.traceabilityService.registerAlias(sessionContext, CompanionTraceAliasKind.ACTOR_EXECUTION,execution._id);\n }\n\n await this.traceOperationSuccess({\n sessionContext,\n step: traceStep,\n type: \"actor-execution-create-success\",\n summary: `Created persisted actor execution ${execution._id}`,\n payload: {\n executionId: execution._id,\n status: execution.status,\n standaloneTaskCount: execution.standaloneTasks.length,\n },\n artifactFileName: \"actor-execution-create-result.json\",\n artifactContent: execution,\n });\n return execution;\n } catch (error) {\n await this.traceOperationFailure({\n sessionContext,\n step: traceStep,\n type: \"actor-execution-create-failure\",\n summary: `Failed to create persisted actor execution for ${payload.systemRef}`,\n error,\n payload: {\n systemRef: payload.systemRef,\n status: payload.status,\n standaloneTaskCount: payload.standaloneTasks.length,\n },\n });\n throw error;\n }\n }\n\n public async createFlowExecution(\n payload: CompanionCreateFlowExecutionRequest,\n sessionContext?: CompanionExecutionSessionContext,\n ): Promise<Wildo_Application_FlowSystem_Execution> {\n const traceStep = this.createOperationTraceStep(sessionContext, \"create-flow-execution\");\n await this.traceOperationStart({\n sessionContext,\n step: traceStep,\n type: \"flow-execution-create-start\",\n summary: `Create persisted flow execution for ${payload.systemRef}`,\n payload: {\n systemRef: payload.systemRef,\n status: payload.status,\n },\n artifactFileName: \"flow-execution-create-request.json\",\n artifactContent: payload,\n });\n\n try {\n const ownership = await this.resolveOwnership(sessionContext);\n const repository = this.repositoriesRegistry.getRepositoryOrThrow(WILDO_APPLICATION_FLOW_SYSTEM_EXECUTIONS_RESOURCE_TYPE);\n const executionContext = await this.createInternalExecutionContext(\n WILDO_APPLICATION_FLOW_SYSTEM_EXECUTIONS_RESOURCE_TYPE,\n CoreResourceOperation.CREATE,\n sessionContext,\n );\n const normalizedPayload = this.normalizeCreateEnvelope(payload);\n const createData = {\n ...payload,\n ...normalizedPayload,\n organizationId: ownership.organizationId,\n wildoApplicationId: ownership.wildoApplicationId,\n };\n\n const flowExecution = await repository.create<Wildo_Application_FlowSystem_Execution>(executionContext, createData, {\n preserveServerInjectedFields: this.deriveServerInjectedPreserveFields(\n WILDO_APPLICATION_FLOW_SYSTEM_EXECUTIONS_RESOURCE_TYPE,\n createData,\n CoreResourceOperation.CREATE,\n ),\n });\n if (sessionContext) {\n await this.traceabilityService.registerAlias(sessionContext, CompanionTraceAliasKind.FLOW_EXECUTION,flowExecution._id);\n }\n await this.traceOperationSuccess({\n sessionContext,\n step: traceStep,\n type: \"flow-execution-create-success\",\n summary: `Created persisted flow execution ${flowExecution._id}`,\n payload: {\n executionId: flowExecution._id,\n status: flowExecution.status,\n },\n artifactFileName: \"flow-execution-create-result.json\",\n artifactContent: flowExecution,\n });\n return flowExecution;\n } catch (error) {\n await this.traceOperationFailure({\n sessionContext,\n step: traceStep,\n type: \"flow-execution-create-failure\",\n summary: `Failed to create persisted flow execution for ${payload.systemRef}`,\n error,\n payload: {\n systemRef: payload.systemRef,\n status: payload.status,\n },\n });\n throw error;\n }\n }\n\n public async getActorExecution(executionId: string, _sessionContext?: CompanionExecutionSessionContext): Promise<Wildo_Application_ActorSystem_Execution> {\n const traceStep = this.createOperationTraceStep(_sessionContext, \"read-actor-execution\");\n await this.traceOperationStart({\n sessionContext: _sessionContext,\n step: traceStep,\n type: \"actor-execution-read-start\",\n summary: `Read persisted actor execution ${executionId}`,\n payload: { executionId },\n artifactFileName: \"actor-execution-read-request.json\",\n artifactContent: { executionId },\n });\n\n try {\n const ownership = await this.resolveOwnership(_sessionContext);\n const repository = this.repositoriesRegistry.getRepositoryOrThrow(WILDO_APPLICATION_ACTOR_SYSTEM_EXECUTIONS_RESOURCE_TYPE);\n const executionContext = await this.createInternalExecutionContext(\n WILDO_APPLICATION_ACTOR_SYSTEM_EXECUTIONS_RESOURCE_TYPE,\n CoreResourceOperation.READ,\n _sessionContext,\n );\n const execution = await repository.read<Wildo_Application_ActorSystem_Execution>(executionContext, {\n _id: executionId,\n wildoApplicationId: ownership.wildoApplicationId,\n });\n\n if (!execution) {\n throw this.buildExecutionNotFoundError(FlowsActors_ElementKind.ACTOR,executionId);\n }\n\n if (_sessionContext) {\n await this.traceabilityService.registerAlias(_sessionContext, CompanionTraceAliasKind.ACTOR_EXECUTION,execution._id);\n }\n await this.traceOperationSuccess({\n sessionContext: _sessionContext,\n step: traceStep,\n type: \"actor-execution-read-success\",\n summary: `Read persisted actor execution ${execution._id}`,\n payload: {\n executionId: execution._id,\n status: execution.status,\n },\n artifactFileName: \"actor-execution-read-result.json\",\n artifactContent: execution,\n });\n return execution;\n } catch (error) {\n await this.traceOperationFailure({\n sessionContext: _sessionContext,\n step: traceStep,\n type: \"actor-execution-read-failure\",\n summary: `Failed to read persisted actor execution ${executionId}`,\n error,\n payload: { executionId },\n });\n throw error;\n }\n }\n\n public async getFlowExecution(executionId: string, _sessionContext?: CompanionExecutionSessionContext): Promise<Wildo_Application_FlowSystem_Execution> {\n const traceStep = this.createOperationTraceStep(_sessionContext, \"read-flow-execution\");\n await this.traceOperationStart({\n sessionContext: _sessionContext,\n step: traceStep,\n type: \"flow-execution-read-start\",\n summary: `Read persisted flow execution ${executionId}`,\n payload: { executionId },\n artifactFileName: \"flow-execution-read-request.json\",\n artifactContent: { executionId },\n });\n\n try {\n const ownership = await this.resolveOwnership(_sessionContext);\n const repository = this.repositoriesRegistry.getRepositoryOrThrow(WILDO_APPLICATION_FLOW_SYSTEM_EXECUTIONS_RESOURCE_TYPE);\n const executionContext = await this.createInternalExecutionContext(\n WILDO_APPLICATION_FLOW_SYSTEM_EXECUTIONS_RESOURCE_TYPE,\n CoreResourceOperation.READ,\n _sessionContext,\n );\n const execution = await repository.read<Wildo_Application_FlowSystem_Execution>(executionContext, {\n _id: executionId,\n wildoApplicationId: ownership.wildoApplicationId,\n });\n\n if (!execution) {\n throw this.buildExecutionNotFoundError(FlowsActors_ElementKind.FLOW,executionId);\n }\n\n if (_sessionContext) {\n await this.traceabilityService.registerAlias(_sessionContext, CompanionTraceAliasKind.FLOW_EXECUTION,execution._id);\n }\n await this.traceOperationSuccess({\n sessionContext: _sessionContext,\n step: traceStep,\n type: \"flow-execution-read-success\",\n summary: `Read persisted flow execution ${execution._id}`,\n payload: {\n executionId: execution._id,\n status: execution.status,\n },\n artifactFileName: \"flow-execution-read-result.json\",\n artifactContent: execution,\n });\n return execution;\n } catch (error) {\n await this.traceOperationFailure({\n sessionContext: _sessionContext,\n step: traceStep,\n type: \"flow-execution-read-failure\",\n summary: `Failed to read persisted flow execution ${executionId}`,\n error,\n payload: { executionId },\n });\n throw error;\n }\n }\n\n public async listActorExecutions(\n query: CompanionExecutionsListQuery,\n _sessionContext?: CompanionExecutionSessionContext,\n ): Promise<Wildo_Application_ActorSystem_Execution[]> {\n const traceStep = this.createOperationTraceStep(_sessionContext, \"list-actor-executions\");\n await this.traceOperationStart({\n sessionContext: _sessionContext,\n step: traceStep,\n type: \"actor-executions-list-start\",\n summary: \"List persisted actor executions\",\n payload: query,\n artifactFileName: \"actor-executions-list-request.json\",\n artifactContent: query,\n });\n\n try {\n const executions = await this.listExecutions<Wildo_Application_ActorSystem_Execution>(\n WILDO_APPLICATION_ACTOR_SYSTEM_EXECUTIONS_RESOURCE_TYPE,\n query,\n _sessionContext,\n );\n await this.traceOperationSuccess({\n sessionContext: _sessionContext,\n step: traceStep,\n type: \"actor-executions-list-success\",\n summary: `Listed ${executions.length} persisted actor executions`,\n payload: {\n count: executions.length,\n status: query.status ?? null,\n systemRef: query.systemRef ?? null,\n limit: query.limit,\n },\n artifactFileName: \"actor-executions-list-result.json\",\n artifactContent: executions,\n });\n return executions;\n } catch (error) {\n await this.traceOperationFailure({\n sessionContext: _sessionContext,\n step: traceStep,\n type: \"actor-executions-list-failure\",\n summary: \"Failed to list persisted actor executions\",\n error,\n payload: query,\n });\n throw error;\n }\n }\n\n public async listFlowExecutions(\n query: CompanionExecutionsListQuery,\n _sessionContext?: CompanionExecutionSessionContext,\n ): Promise<Wildo_Application_FlowSystem_Execution[]> {\n const traceStep = this.createOperationTraceStep(_sessionContext, \"list-flow-executions\");\n await this.traceOperationStart({\n sessionContext: _sessionContext,\n step: traceStep,\n type: \"flow-executions-list-start\",\n summary: \"List persisted flow executions\",\n payload: query,\n artifactFileName: \"flow-executions-list-request.json\",\n artifactContent: query,\n });\n\n try {\n const executions = await this.listExecutions<Wildo_Application_FlowSystem_Execution>(\n WILDO_APPLICATION_FLOW_SYSTEM_EXECUTIONS_RESOURCE_TYPE,\n query,\n _sessionContext,\n );\n await this.traceOperationSuccess({\n sessionContext: _sessionContext,\n step: traceStep,\n type: \"flow-executions-list-success\",\n summary: `Listed ${executions.length} persisted flow executions`,\n payload: {\n count: executions.length,\n status: query.status ?? null,\n systemRef: query.systemRef ?? null,\n limit: query.limit,\n },\n artifactFileName: \"flow-executions-list-result.json\",\n artifactContent: executions,\n });\n return executions;\n } catch (error) {\n await this.traceOperationFailure({\n sessionContext: _sessionContext,\n step: traceStep,\n type: \"flow-executions-list-failure\",\n summary: \"Failed to list persisted flow executions\",\n error,\n payload: query,\n });\n throw error;\n }\n }\n\n public async createActorTask(\n payload: CompanionCreateActorTaskRequest,\n sessionContext?: CompanionExecutionSessionContext,\n ): Promise<Wildo_Application_Actor_Task> {\n const traceStep = this.createOperationTraceStep(sessionContext, \"create-actor-task\");\n await this.traceOperationStart({\n sessionContext,\n step: traceStep,\n type: \"actor-task-create-start\",\n summary: \"Create persisted actor task\",\n payload: {\n actorRef: payload.actors.actorRef,\n status: payload.status,\n executionId: payload.wildoApplicationActorSystemExecutionId ?? null,\n },\n artifactFileName: \"actor-task-create-request.json\",\n artifactContent: payload,\n });\n\n try {\n const task = await this.resourcePersistenceUnitOfWork.executeTransaction(\n {\n boundary: 'companion-executions.create-actor-task',\n participants: COMPANION_EXECUTION_PERSISTENCE_PARTICIPANTS,\n },\n async ({ transaction }) => {\n const ownership = await this.resolveOwnership(sessionContext);\n if (payload.wildoApplicationActorSystemExecutionId) {\n await this.readActorExecutionOrThrow(payload.wildoApplicationActorSystemExecutionId, ownership.wildoApplicationId, transaction, sessionContext);\n }\n const repository = this.repositoriesRegistry.getRepositoryOrThrow(WILDO_APPLICATION_ACTOR_TASKS_RESOURCE_TYPE);\n const executionContext = await this.createInternalExecutionContext(\n WILDO_APPLICATION_ACTOR_TASKS_RESOURCE_TYPE,\n CoreResourceOperation.CREATE,\n sessionContext,\n );\n const normalizedPayload = this.normalizeTaskCreatePayload(payload);\n const createData = {\n ...normalizedPayload,\n organizationId: ownership.organizationId,\n wildoApplicationId: ownership.wildoApplicationId,\n ...(payload.wildoApplicationActorSystemExecutionId ? { wildoApplicationActorSystemExecutionId: payload.wildoApplicationActorSystemExecutionId } : {}),\n };\n const createdTask = await repository.create<Wildo_Application_Actor_Task>(executionContext, createData, {\n ...this.buildRepositoryOptions(transaction),\n preserveServerInjectedFields: this.deriveServerInjectedPreserveFields(\n WILDO_APPLICATION_ACTOR_TASKS_RESOURCE_TYPE,\n createData,\n CoreResourceOperation.CREATE,\n ),\n });\n\n await this.syncTaskIntoExecutionSnapshot(createdTask, transaction, sessionContext);\n return createdTask;\n },\n );\n\n if (sessionContext) {\n await this.traceabilityService.registerAlias(sessionContext, CompanionTraceAliasKind.ACTOR_TASK,task._id);\n }\n\n await this.traceOperationSuccess({\n sessionContext,\n step: traceStep,\n type: \"actor-task-create-success\",\n summary: `Created persisted actor task ${task._id}`,\n payload: {\n taskId: task._id,\n status: task.status,\n executionId: task.wildoApplicationActorSystemExecutionId ?? null,\n },\n artifactFileName: \"actor-task-create-result.json\",\n artifactContent: task,\n });\n return task;\n } catch (error) {\n await this.traceOperationFailure({\n sessionContext,\n step: traceStep,\n type: \"actor-task-create-failure\",\n summary: \"Failed to create persisted actor task\",\n error,\n payload: {\n actorRef: payload.actors.actorRef,\n status: payload.status,\n executionId: payload.wildoApplicationActorSystemExecutionId ?? null,\n },\n });\n throw error;\n }\n }\n\n public async getActorTask(taskId: string, _sessionContext?: CompanionExecutionSessionContext): Promise<Wildo_Application_Actor_Task> {\n const traceStep = this.createOperationTraceStep(_sessionContext, \"read-actor-task\");\n await this.traceOperationStart({\n sessionContext: _sessionContext,\n step: traceStep,\n type: \"actor-task-read-start\",\n summary: `Read persisted actor task ${taskId}`,\n payload: { taskId },\n artifactFileName: \"actor-task-read-request.json\",\n artifactContent: { taskId },\n });\n\n try {\n const task = await this.readActorTaskOrThrow(taskId, undefined, _sessionContext);\n if (_sessionContext) {\n await this.traceabilityService.registerAlias(_sessionContext, CompanionTraceAliasKind.ACTOR_TASK,task._id);\n }\n await this.traceOperationSuccess({\n sessionContext: _sessionContext,\n step: traceStep,\n type: \"actor-task-read-success\",\n summary: `Read persisted actor task ${task._id}`,\n payload: {\n taskId: task._id,\n status: task.status,\n executionId: task.wildoApplicationActorSystemExecutionId ?? null,\n },\n artifactFileName: \"actor-task-read-result.json\",\n artifactContent: task,\n });\n return task;\n } catch (error) {\n await this.traceOperationFailure({\n sessionContext: _sessionContext,\n step: traceStep,\n type: \"actor-task-read-failure\",\n summary: `Failed to read persisted actor task ${taskId}`,\n error,\n payload: { taskId },\n });\n throw error;\n }\n }\n\n public async listActorTasks(\n query: CompanionActorTasksListQuery,\n _sessionContext?: CompanionExecutionSessionContext,\n ): Promise<Wildo_Application_Actor_Task[]> {\n const traceStep = this.createOperationTraceStep(_sessionContext, \"list-actor-tasks\");\n await this.traceOperationStart({\n sessionContext: _sessionContext,\n step: traceStep,\n type: \"actor-tasks-list-start\",\n summary: \"List persisted actor tasks\",\n payload: query,\n artifactFileName: \"actor-tasks-list-request.json\",\n artifactContent: query,\n });\n\n try {\n const ownership = await this.resolveOwnership(_sessionContext);\n const repository = this.repositoriesRegistry.getRepositoryOrThrow(WILDO_APPLICATION_ACTOR_TASKS_RESOURCE_TYPE);\n const executionContext = await this.createInternalExecutionContext(\n WILDO_APPLICATION_ACTOR_TASKS_RESOURCE_TYPE,\n CoreResourceOperation.LIST,\n _sessionContext,\n );\n const tasks = await repository.list<Wildo_Application_Actor_Task>(executionContext, {\n wildoApplicationId: ownership.wildoApplicationId,\n ...(query.executionId ? { wildoApplicationActorSystemExecutionId: query.executionId } : {}),\n ...(query.status ? { status: query.status } : {}),\n });\n\n const trimmedTasks = tasks.sort((left, right) => right.updatedAt.localeCompare(left.updatedAt)).slice(0, query.limit);\n await this.traceOperationSuccess({\n sessionContext: _sessionContext,\n step: traceStep,\n type: \"actor-tasks-list-success\",\n summary: `Listed ${trimmedTasks.length} persisted actor tasks`,\n payload: {\n count: trimmedTasks.length,\n executionId: query.executionId ?? null,\n status: query.status ?? null,\n limit: query.limit,\n },\n artifactFileName: \"actor-tasks-list-result.json\",\n artifactContent: trimmedTasks,\n });\n return trimmedTasks;\n } catch (error) {\n await this.traceOperationFailure({\n sessionContext: _sessionContext,\n step: traceStep,\n type: \"actor-tasks-list-failure\",\n summary: \"Failed to list persisted actor tasks\",\n error,\n payload: query,\n });\n throw error;\n }\n }\n\n public async updateActorTask(\n taskId: string,\n payload: CompanionUpdateActorTaskRequest,\n sessionContext?: CompanionExecutionSessionContext,\n ): Promise<Wildo_Application_Actor_Task> {\n const traceStep = this.createOperationTraceStep(sessionContext, \"update-actor-task\");\n await this.traceOperationStart({\n sessionContext,\n step: traceStep,\n type: \"actor-task-update-start\",\n summary: `Update persisted actor task ${taskId}`,\n payload: {\n taskId,\n status: payload.status ?? null,\n executionId: payload.wildoApplicationActorSystemExecutionId ?? null,\n clearExecutionLink: payload.clearExecutionLink === true,\n },\n artifactFileName: \"actor-task-update-request.json\",\n artifactContent: {\n taskId,\n payload,\n },\n });\n\n try {\n const task = await this.resourcePersistenceUnitOfWork.executeTransaction(\n {\n boundary: 'companion-executions.update-actor-task',\n participants: COMPANION_EXECUTION_PERSISTENCE_PARTICIPANTS,\n },\n async ({ transaction }) => {\n const ownership = await this.resolveOwnership(sessionContext);\n const existingTask = await this.readActorTaskOrThrow(taskId, transaction, sessionContext);\n if (\n payload.wildoApplicationActorSystemExecutionId &&\n payload.wildoApplicationActorSystemExecutionId !== existingTask.wildoApplicationActorSystemExecutionId\n ) {\n await this.readActorExecutionOrThrow(payload.wildoApplicationActorSystemExecutionId, ownership.wildoApplicationId, transaction, sessionContext);\n }\n const repository = this.repositoriesRegistry.getRepositoryOrThrow(WILDO_APPLICATION_ACTOR_TASKS_RESOURCE_TYPE);\n const executionContext = await this.createInternalExecutionContext(\n WILDO_APPLICATION_ACTOR_TASKS_RESOURCE_TYPE,\n CoreResourceOperation.UPDATE,\n sessionContext,\n );\n const updatedAt = payload.updatedAt ?? new Date().toISOString();\n const status = payload.status ?? existingTask.status;\n const shouldClearExecutionLink = payload.clearExecutionLink === true;\n const { clearExecutionLink: _clearExecutionLink, completedAt: payloadCompletedAt, ...payloadWithoutClearFlag } = payload;\n const shouldClearCompletedAt = !this.isTerminalStatus(status);\n const completedAt = shouldClearCompletedAt ? undefined : (payloadCompletedAt ?? existingTask.completedAt ?? updatedAt);\n const actorStates = payload.actorStates ?? existingTask.actorStates;\n\n const updateData = {\n ...payloadWithoutClearFlag,\n actorStates,\n status,\n updatedAt,\n ...(completedAt ? { completedAt } : {}),\n };\n\n await repository.update<Wildo_Application_Actor_Task>(executionContext, { _id: taskId, wildoApplicationId: ownership.wildoApplicationId }, updateData, {\n ...this.buildRepositoryOptions(transaction),\n // Derived allowlist (typically empty on UPDATE): the only fields the\n // update request DTO strips are the scope/audit FKs, and those are\n // never in this payload (`wildoApplicationId` is in the filter, not\n // the data). A re-linked `wildoApplicationActorSystemExecutionId` is\n // an ordinary relationship FK the DTO keeps, so it is not stripped.\n preserveServerInjectedFields: this.deriveServerInjectedPreserveFields(\n WILDO_APPLICATION_ACTOR_TASKS_RESOURCE_TYPE,\n updateData,\n CoreResourceOperation.UPDATE,\n ),\n });\n\n if (shouldClearExecutionLink || shouldClearCompletedAt) {\n await this.unsetActorTaskFields(\n taskId,\n ownership.wildoApplicationId,\n {\n ...(shouldClearExecutionLink ? { wildoApplicationActorSystemExecutionId: 1 } : {}),\n ...(shouldClearCompletedAt ? { completedAt: 1 } : {}),\n },\n transaction,\n );\n }\n\n const updatedTask = await this.readActorTaskOrThrow(taskId, transaction, sessionContext);\n\n if (\n existingTask.wildoApplicationActorSystemExecutionId &&\n existingTask.wildoApplicationActorSystemExecutionId !== updatedTask.wildoApplicationActorSystemExecutionId\n ) {\n await this.removeTaskFromExecutionSnapshot(existingTask, transaction, sessionContext);\n }\n\n await this.syncTaskIntoExecutionSnapshot(updatedTask, transaction, sessionContext);\n return updatedTask;\n },\n );\n\n if (sessionContext) {\n await this.traceabilityService.registerAlias(sessionContext, CompanionTraceAliasKind.ACTOR_TASK,task._id);\n }\n\n await this.traceOperationSuccess({\n sessionContext,\n step: traceStep,\n type: \"actor-task-update-success\",\n summary: `Updated persisted actor task ${task._id}`,\n payload: {\n taskId: task._id,\n status: task.status,\n executionId: task.wildoApplicationActorSystemExecutionId ?? null,\n },\n artifactFileName: \"actor-task-update-result.json\",\n artifactContent: task,\n });\n return task;\n } catch (error) {\n await this.traceOperationFailure({\n sessionContext,\n step: traceStep,\n type: \"actor-task-update-failure\",\n summary: `Failed to update persisted actor task ${taskId}`,\n error,\n payload: {\n taskId,\n status: payload.status ?? null,\n executionId: payload.wildoApplicationActorSystemExecutionId ?? null,\n clearExecutionLink: payload.clearExecutionLink === true,\n },\n });\n throw error;\n }\n }\n\n /**\n * Companion executions live in the shared apps-manager DB, but every local\n * companion instance is still attached to exactly one Wildo application row.\n * Resolving and memoizing that ownership keeps all repository calls scoped to\n * the truthful platform parent instead of falling back to tenant-app semantics.\n */\n private async resolveOwnership(sessionContext?: CompanionExecutionSessionContext): Promise<CompanionExecutionOwnership> {\n if (!this.ownershipPromise) {\n const ownershipPromise = this.loadOwnership(sessionContext).catch((error) => {\n if (this.ownershipPromise === ownershipPromise) {\n this.ownershipPromise = undefined;\n }\n\n throw error;\n });\n this.ownershipPromise = ownershipPromise;\n }\n\n return this.ownershipPromise;\n }\n\n private async loadOwnership(sessionContext?: CompanionExecutionSessionContext): Promise<CompanionExecutionOwnership> {\n const traceStep = sessionContext\n ? this.traceabilityService.createStep(sessionContext, {\n kind: \"execution-ownership\",\n label: \"resolve-companion-execution-ownership\",\n })\n : undefined;\n\n await this.traceOperationStart({\n sessionContext,\n step: traceStep,\n type: \"execution-ownership-resolution-start\",\n summary: \"Resolve companion execution ownership\",\n payload: {\n appSlug: this.companionContext.saasConfig.slug,\n },\n artifactFileName: \"execution-ownership-resolution-request.json\",\n artifactContent: {\n appSlug: this.companionContext.saasConfig.slug,\n },\n });\n\n try {\n const repository = this.repositoriesRegistry.getRepositoryOrThrow(CustomShared_ResourceType.WILDO_APPLICATION);\n const executionContext = await this.createInternalExecutionContext(\n CustomShared_ResourceType.WILDO_APPLICATION,\n CoreResourceOperation.READ,\n sessionContext,\n );\n const wildoApplication = await repository.read<Wildo_Application>(executionContext, {\n appSlug: this.companionContext.saasConfig.slug,\n });\n\n if (!wildoApplication) {\n throw this.errorBuilder.buildError(ErrorType.NOT_FOUND, undefined, {\n customMessageReference: ErrorCustomMessageReference.NOT_FOUND,\n context: {\n message: \"Companion app is not registered in the platform Wildo applications collection.\",\n appSlug: this.companionContext.saasConfig.slug,\n },\n });\n }\n\n this.logDebug(\"Resolved companion execution ownership\", {\n appSlug: this.companionContext.saasConfig.slug,\n organizationId: wildoApplication.organizationId,\n wildoApplicationId: wildoApplication._id,\n });\n\n const ownership = {\n organizationId: wildoApplication.organizationId,\n wildoApplicationId: wildoApplication._id,\n };\n\n await this.traceOperationSuccess({\n sessionContext,\n step: traceStep,\n type: \"execution-ownership-resolution-success\",\n summary: `Resolved companion execution ownership for ${this.companionContext.saasConfig.slug}`,\n payload: ownership,\n artifactFileName: \"execution-ownership-resolution-result.json\",\n artifactContent: {\n appSlug: this.companionContext.saasConfig.slug,\n ...ownership,\n },\n });\n\n return ownership;\n } catch (error) {\n await this.traceOperationFailure({\n sessionContext,\n step: traceStep,\n type: \"execution-ownership-resolution-failure\",\n summary: \"Failed to resolve companion execution ownership\",\n error,\n payload: {\n appSlug: this.companionContext.saasConfig.slug,\n },\n });\n throw error;\n }\n }\n\n /**\n * Builds an unattributed internal execution context for the companion's\n * control-plane reads/writes through the engine's REPOSITORY_ONLY-safe seam.\n * `createForInternalRepositoryOperation` resolves the operation path with a\n * repository-preferred (URL-fallback) resolver — the previous hand-rolled\n * `getOperationPathDefault → createForInternalOperation` pair used the\n * URL-only resolver and threw `RESOURCES_REGISTRY_OPERATION_PATH_NOT_FOUND`\n * for REPOSITORY_ONLY-only resources (migrated 2026-07-02, meta-workflows\n * Step 0 / P-12; the engine seam's JSDoc names this exact pattern).\n */\n /**\n * The `contextResourcesFieldIdentifier` map stays EMPTY on purpose. It\n * looks like the natural channel for the ownership FKs, but the engine's\n * context-map enrichment injects into EVERY schema path ending with the\n * field identifier — including `errorStates.errorItems[].initiatorIds.\n * organizationId` inside the embedded `WildoError_BackendSchema` — and\n * `setNestedValue` then fabricates a phantom error item that fails\n * Mongoose validation (observed live, 2026-07-03). The scope FK the strict\n * request-DTO parse strips (`organizationId`) is instead re-attached via\n * `RepositoryOptions.preserveServerInjectedFields`, derived per write by\n * {@link deriveServerInjectedPreserveFields}.\n */\n private async createInternalExecutionContext(\n resourceType: ResourceType,\n operationIdentifier: CoreResourceOperation,\n sessionContext?: CompanionExecutionSessionContext,\n ): Promise<ExecutionContext<any>> {\n const executionContext = await this.executionContextCreator.createForInternalRepositoryOperation({\n resourceType,\n operationIdentifier,\n contextResourcesFieldIdentifier: new Map(),\n initiatorIds: null,\n initiatorRoles: [],\n relationshipContexts: [],\n });\n if (sessionContext) {\n await this.traceInternalExecutionContext(sessionContext, executionContext, resourceType, operationIdentifier);\n }\n return executionContext;\n }\n\n /**\n * The row type is pinned through the repository handle's `TMainSchema`, NOT\n * through `list<T>` — and the difference is not cosmetic.\n *\n * `BackendResourceRepository.list<T>` returns\n * `ConditionalArrayReturnType<T, TMainSchema>`, i.e.\n * `T extends undefined ? z.infer<TMainSchema>[] : T[]`. That conditional can\n * only be evaluated when `T` is a CONCRETE type. Here `TExecution` is an\n * uninstantiated type parameter of this relay, so TypeScript defers the\n * conditional and falls back to its constraint — `unknown[]` — which is then\n * not assignable to `TExecution[]`. The sibling call sites in this file\n * (`list<Wildo_Application_Actor_Task>`) pass a concrete type, resolve the\n * false branch immediately, and are unaffected; this is the only generic\n * relay over a repository read in the companion.\n *\n * So the row shape is declared where the contract expects it: on the\n * repository handle. `list()` then takes its default `T = undefined`, the\n * conditional resolves eagerly to `z.infer<z.ZodType<TExecution>>[]` =\n * `TExecution[]`, and the value flows through with no cast.\n *\n * Rejected: `as unknown as TExecution[]` at the return. The correlation\n * between `resourceType` and `TExecution` is asserted by the caller either\n * way, but a value-level cast puts that assertion where nothing can see it,\n * and it would keep `left`/`right` typed `unknown` inside the comparator —\n * re-breaking the moment the sort key changes.\n */\n private async listExecutions<TExecution extends { updatedAt: string }>(\n resourceType: typeof WILDO_APPLICATION_ACTOR_SYSTEM_EXECUTIONS_RESOURCE_TYPE | typeof WILDO_APPLICATION_FLOW_SYSTEM_EXECUTIONS_RESOURCE_TYPE,\n query: CompanionExecutionsListQuery,\n sessionContext?: CompanionExecutionSessionContext,\n ): Promise<TExecution[]> {\n const ownership = await this.resolveOwnership(sessionContext);\n const repository = this.repositoriesRegistry.getRepositoryOrThrow<undefined, undefined, z.ZodType<TExecution>>(resourceType);\n const executionContext = await this.createInternalExecutionContext(resourceType, CoreResourceOperation.LIST, sessionContext);\n const executions = await repository.list(executionContext, {\n wildoApplicationId: ownership.wildoApplicationId,\n ...(query.systemRef ? { systemRef: query.systemRef } : {}),\n ...(query.status ? { status: query.status } : {}),\n });\n\n return executions.sort((left, right) => right.updatedAt.localeCompare(left.updatedAt)).slice(0, query.limit);\n }\n\n private async persistExecutionTasks(\n ownership: CompanionExecutionOwnership,\n executionId: string,\n tasks: CompanionCreateActorExecutionRequest[\"standaloneTasks\"],\n standaloneTaskStates: CompanionCreateActorExecutionRequest[\"standaloneTaskStates\"],\n transaction?: TransactionContext,\n sessionContext?: CompanionExecutionSessionContext,\n ): Promise<PersistedExecutionTask[]> {\n const repository = this.repositoriesRegistry.getRepositoryOrThrow(WILDO_APPLICATION_ACTOR_TASKS_RESOURCE_TYPE);\n const executionContext = await this.createInternalExecutionContext(\n WILDO_APPLICATION_ACTOR_TASKS_RESOURCE_TYPE,\n CoreResourceOperation.CREATE,\n sessionContext,\n );\n\n const persistedTasks: PersistedExecutionTask[] = [];\n\n for (const task of tasks) {\n const taskState = standaloneTaskStates.find((item) => item.taskId === task._id);\n const createData = {\n ...this.normalizeTaskCreatePayload({\n ...task,\n status: taskState?.status ?? task.status,\n updatedAt: taskState?.updatedAt ?? task.updatedAt,\n wildoApplicationActorSystemExecutionId: executionId,\n }),\n organizationId: ownership.organizationId,\n wildoApplicationId: ownership.wildoApplicationId,\n wildoApplicationActorSystemExecutionId: executionId,\n };\n const persistedTask = await repository.create<Wildo_Application_Actor_Task>(executionContext, createData, {\n ...this.buildRepositoryOptions(transaction),\n preserveServerInjectedFields: this.deriveServerInjectedPreserveFields(\n WILDO_APPLICATION_ACTOR_TASKS_RESOURCE_TYPE,\n createData,\n CoreResourceOperation.CREATE,\n ),\n });\n\n persistedTasks.push({\n sourceTaskId: task._id,\n task: persistedTask,\n });\n }\n\n return persistedTasks;\n }\n\n private async updateActorExecutionTaskSnapshot(\n execution: Wildo_Application_ActorSystem_Execution,\n ownership: CompanionExecutionOwnership,\n tasks: Wildo_Application_Actor_Task[],\n transaction?: TransactionContext,\n standaloneTaskStatesOverride?: Wildo_Application_ActorSystem_Execution[\"standaloneTaskStates\"],\n sessionContext?: CompanionExecutionSessionContext,\n ): Promise<Wildo_Application_ActorSystem_Execution> {\n const repository = this.repositoriesRegistry.getRepositoryOrThrow(WILDO_APPLICATION_ACTOR_SYSTEM_EXECUTIONS_RESOURCE_TYPE);\n const executionContext = await this.createInternalExecutionContext(\n WILDO_APPLICATION_ACTOR_SYSTEM_EXECUTIONS_RESOURCE_TYPE,\n CoreResourceOperation.UPDATE,\n sessionContext,\n );\n const updatedAt = new Date().toISOString();\n\n return repository.update<Wildo_Application_ActorSystem_Execution>(\n executionContext,\n { _id: execution._id, wildoApplicationId: ownership.wildoApplicationId },\n {\n standaloneTasks: tasks,\n standaloneTaskStates: standaloneTaskStatesOverride ?? this.buildStandaloneTaskStates(tasks, execution.standaloneTaskStates),\n updatedAt,\n },\n this.buildRepositoryOptions(transaction),\n );\n }\n\n private async syncTaskIntoExecutionSnapshot(\n task: Wildo_Application_Actor_Task,\n transaction?: TransactionContext,\n sessionContext?: CompanionExecutionSessionContext,\n ): Promise<void> {\n if (!task.wildoApplicationActorSystemExecutionId) {\n return;\n }\n\n const repository = this.repositoriesRegistry.getRepositoryOrThrow(WILDO_APPLICATION_ACTOR_SYSTEM_EXECUTIONS_RESOURCE_TYPE);\n const executionContext = await this.createInternalExecutionContext(\n WILDO_APPLICATION_ACTOR_SYSTEM_EXECUTIONS_RESOURCE_TYPE,\n CoreResourceOperation.READ,\n sessionContext,\n );\n const execution = await repository.read<Wildo_Application_ActorSystem_Execution>(\n executionContext,\n {\n _id: task.wildoApplicationActorSystemExecutionId,\n wildoApplicationId: task.wildoApplicationId,\n },\n this.buildRepositoryOptions(transaction),\n );\n\n if (!execution) {\n throw this.errorBuilder.buildError(ErrorType.NOT_FOUND, undefined, {\n customMessageReference: ErrorCustomMessageReference.NOT_FOUND,\n context: {\n message: \"Actor task references a missing persisted actor execution.\",\n taskId: task._id,\n wildoApplicationActorSystemExecutionId: task.wildoApplicationActorSystemExecutionId,\n appSlug: this.companionContext.saasConfig.slug,\n },\n });\n }\n\n await this.updateActorExecutionTaskSnapshot(\n execution,\n {\n organizationId: task.organizationId,\n wildoApplicationId: task.wildoApplicationId,\n },\n this.upsertTask(execution.standaloneTasks as Wildo_Application_Actor_Task[], task),\n transaction,\n undefined,\n sessionContext,\n );\n }\n\n private async removeTaskFromExecutionSnapshot(\n task: Pick<Wildo_Application_Actor_Task, \"_id\" | \"organizationId\" | \"wildoApplicationId\" | \"wildoApplicationActorSystemExecutionId\">,\n transaction?: TransactionContext,\n sessionContext?: CompanionExecutionSessionContext,\n ): Promise<void> {\n if (!task.wildoApplicationActorSystemExecutionId) {\n return;\n }\n\n const repository = this.repositoriesRegistry.getRepositoryOrThrow(WILDO_APPLICATION_ACTOR_SYSTEM_EXECUTIONS_RESOURCE_TYPE);\n const readExecutionContext = await this.createInternalExecutionContext(\n WILDO_APPLICATION_ACTOR_SYSTEM_EXECUTIONS_RESOURCE_TYPE,\n CoreResourceOperation.READ,\n sessionContext,\n );\n const execution = await repository.read<Wildo_Application_ActorSystem_Execution>(\n readExecutionContext,\n {\n _id: task.wildoApplicationActorSystemExecutionId,\n wildoApplicationId: task.wildoApplicationId,\n },\n this.buildRepositoryOptions(transaction),\n );\n\n if (!execution) {\n return;\n }\n\n await this.updateActorExecutionTaskSnapshot(\n execution,\n {\n organizationId: task.organizationId,\n wildoApplicationId: task.wildoApplicationId,\n },\n (execution.standaloneTasks as Wildo_Application_Actor_Task[]).filter((item) => item._id !== task._id),\n transaction,\n undefined,\n sessionContext,\n );\n }\n\n private async readActorTaskOrThrow(\n taskId: string,\n transaction?: TransactionContext,\n sessionContext?: CompanionExecutionSessionContext,\n ): Promise<Wildo_Application_Actor_Task> {\n const ownership = await this.resolveOwnership(sessionContext);\n const repository = this.repositoriesRegistry.getRepositoryOrThrow(WILDO_APPLICATION_ACTOR_TASKS_RESOURCE_TYPE);\n const executionContext = await this.createInternalExecutionContext(WILDO_APPLICATION_ACTOR_TASKS_RESOURCE_TYPE, CoreResourceOperation.READ, sessionContext);\n const task = await repository.read<Wildo_Application_Actor_Task>(\n executionContext,\n { _id: taskId, wildoApplicationId: ownership.wildoApplicationId },\n this.buildRepositoryOptions(transaction),\n );\n\n if (!task) {\n throw this.buildTaskNotFoundError(taskId);\n }\n\n return task;\n }\n\n private async readActorExecutionOrThrow(\n executionId: string,\n wildoApplicationId: string,\n transaction?: TransactionContext,\n sessionContext?: CompanionExecutionSessionContext,\n ): Promise<Wildo_Application_ActorSystem_Execution> {\n const repository = this.repositoriesRegistry.getRepositoryOrThrow(WILDO_APPLICATION_ACTOR_SYSTEM_EXECUTIONS_RESOURCE_TYPE);\n const executionContext = await this.createInternalExecutionContext(\n WILDO_APPLICATION_ACTOR_SYSTEM_EXECUTIONS_RESOURCE_TYPE,\n CoreResourceOperation.READ,\n sessionContext,\n );\n const execution = await repository.read<Wildo_Application_ActorSystem_Execution>(\n executionContext,\n { _id: executionId, wildoApplicationId },\n this.buildRepositoryOptions(transaction),\n );\n\n if (!execution) {\n throw this.buildExecutionNotFoundError(FlowsActors_ElementKind.ACTOR,executionId);\n }\n\n return execution;\n }\n\n private async listActorExecutionTasks(\n ownership: CompanionExecutionOwnership,\n executionId: string,\n transaction?: TransactionContext,\n ): Promise<Wildo_Application_Actor_Task[]> {\n const repository = this.repositoriesRegistry.getRepositoryOrThrow(WILDO_APPLICATION_ACTOR_TASKS_RESOURCE_TYPE);\n const executionContext = await this.createInternalExecutionContext(WILDO_APPLICATION_ACTOR_TASKS_RESOURCE_TYPE, CoreResourceOperation.LIST);\n return repository.list<Wildo_Application_Actor_Task>(\n executionContext,\n {\n wildoApplicationId: ownership.wildoApplicationId,\n wildoApplicationActorSystemExecutionId: executionId,\n },\n this.buildRepositoryOptions(transaction),\n );\n }\n\n private async traceInternalExecutionContext(\n sessionContext: CompanionExecutionSessionContext,\n executionContext: ExecutionContext<any>,\n resourceType: ResourceType,\n operationIdentifier: CoreResourceOperation,\n ): Promise<void> {\n const serializedExecutionContext = ResourceSerializationUtils.deserializeExecutionContextData(\n ResourceSerializationUtils.serializeExecutionContext({\n executionType: executionContext.executionType,\n initiatorIds: executionContext.initiatorIds,\n initiatorRoles: [...executionContext.initiatorRoles],\n getContextResourceIds: () => executionContext.getContextResourceIds(),\n relationshipContexts: [...executionContext.relationshipContexts],\n }),\n );\n /*\n * The EC reshape removed `requestUUID` from the platform JWT claims; `correlationId` is the per-request\n * identifier now. Mapped here rather than renamed downstream on purpose: `requestUUID` is a field of the\n * traceability contract (`CompanionExecutionContextArtifactRef`), which dedupes artifacts on it, so renaming it\n * is a change to that model and its tests — a separate decision from unbreaking this build.\n */\n const requestUUID = executionContext.toExecutionContextPlatformJwtClaims().correlationId;\n const fileName = `${resourceType}-${operationIdentifier}-${requestUUID}-execution-context.json`;\n\n await this.traceabilityService.traceEvent({\n session: sessionContext,\n minimumLevel: CompanionTraceabilityLevel.DEBUG,\n type: \"internal-execution-context-created\",\n summary: `Created internal execution context for ${resourceType}.${operationIdentifier}`,\n payload: {\n resourceType,\n operationIdentifier,\n requestUUID,\n },\n });\n const artifactPersisted = await this.traceabilityService.writeArtifact({\n session: sessionContext,\n minimumLevel: CompanionTraceabilityLevel.DEBUG_VERBOSE,\n fileName,\n content: {\n resourceType,\n operationIdentifier,\n requestUUID,\n serializedExecutionContext,\n },\n });\n if (artifactPersisted) {\n await this.traceabilityService.recordExecutionContextArtifact(sessionContext, {\n requestUUID,\n resourceType,\n operationIdentifier,\n fileName,\n recordedAt: new Date().toISOString(),\n });\n }\n }\n\n private createOperationTraceStep(sessionContext: CompanionExecutionSessionContext | undefined, label: string) {\n return sessionContext\n ? this.traceabilityService.createStep(sessionContext, {\n kind: \"execution-persistence\",\n label,\n })\n : undefined;\n }\n\n private async traceOperationStart(input: {\n sessionContext?: CompanionExecutionSessionContext;\n step?: ReturnType<CompanionTraceabilityService[\"createStep\"]>;\n type: string;\n summary: string;\n payload?: unknown;\n artifactFileName?: string;\n artifactContent?: unknown;\n }): Promise<void> {\n if (!input.sessionContext) {\n return;\n }\n\n await this.traceabilityService.traceEvent({\n session: input.sessionContext,\n minimumLevel: CompanionTraceabilityLevel.DEBUG,\n type: input.type,\n summary: input.summary,\n ...(input.payload !== undefined ? { payload: input.payload } : {}),\n ...(input.step ? { step: input.step } : {}),\n });\n if (input.artifactFileName && input.artifactContent !== undefined) {\n await this.traceabilityService.writeArtifact({\n session: input.sessionContext,\n minimumLevel: CompanionTraceabilityLevel.DEBUG_VERBOSE,\n fileName: input.artifactFileName,\n content: input.artifactContent,\n ...(input.step ? { step: input.step } : {}),\n });\n }\n }\n\n private async traceOperationSuccess(input: {\n sessionContext?: CompanionExecutionSessionContext;\n step?: ReturnType<CompanionTraceabilityService[\"createStep\"]>;\n type: string;\n summary: string;\n payload?: unknown;\n artifactFileName?: string;\n artifactContent?: unknown;\n }): Promise<void> {\n if (!input.sessionContext) {\n return;\n }\n\n if (input.artifactFileName && input.artifactContent !== undefined) {\n await this.traceabilityService.writeArtifact({\n session: input.sessionContext,\n minimumLevel: CompanionTraceabilityLevel.DEBUG_VERBOSE,\n fileName: input.artifactFileName,\n content: input.artifactContent,\n ...(input.step ? { step: input.step } : {}),\n });\n }\n await this.traceabilityService.traceEvent({\n session: input.sessionContext,\n minimumLevel: CompanionTraceabilityLevel.DEBUG,\n type: input.type,\n summary: input.summary,\n ...(input.payload !== undefined ? { payload: input.payload } : {}),\n ...(input.step ? { step: input.step } : {}),\n });\n }\n\n private async traceOperationFailure(input: {\n sessionContext?: CompanionExecutionSessionContext;\n step?: ReturnType<CompanionTraceabilityService[\"createStep\"]>;\n type: string;\n summary: string;\n error: unknown;\n payload?: unknown;\n }): Promise<void> {\n if (!input.sessionContext) {\n return;\n }\n\n await this.traceabilityService.traceEvent({\n session: input.sessionContext,\n minimumLevel: CompanionTraceabilityLevel.DEBUG,\n type: input.type,\n summary: input.summary,\n payload: {\n ...(input.payload && typeof input.payload === \"object\" ? (input.payload as Record<string, unknown>) : { input: input.payload }),\n error: this.buildTraceErrorPayload(input.error),\n },\n ...(input.step ? { step: input.step } : {}),\n });\n }\n\n private buildTraceErrorPayload(error: unknown) {\n if (isWildoBackendError(error)) {\n return error;\n }\n\n if (error instanceof Error) {\n return {\n message: error.message,\n name: error.name,\n ...(error.stack ? { stack: error.stack } : {}),\n };\n }\n\n return {\n message: String(error),\n };\n }\n\n private async unsetActorTaskFields(\n taskId: string,\n wildoApplicationId: string,\n fieldsToUnset: Partial<Record<\"completedAt\" | \"wildoApplicationActorSystemExecutionId\", 1>>,\n transaction?: TransactionContext,\n ): Promise<void> {\n const fieldEntries = Object.entries(fieldsToUnset);\n if (fieldEntries.length === 0) {\n return;\n }\n\n const repository = this.repositoriesRegistry.getRepositoryOrThrow(WILDO_APPLICATION_ACTOR_TASKS_RESOURCE_TYPE) as unknown as {\n mongooseModel: {\n findOneAndUpdate: (filter: Record<string, unknown>, update: Record<string, unknown>, options?: Record<string, unknown>) => Promise<unknown>;\n };\n getNativeSession: (options?: CompanionRepositoryOptions) => unknown;\n };\n const session = repository.getNativeSession(this.buildRepositoryOptions(transaction));\n\n await repository.mongooseModel.findOneAndUpdate(\n { _id: taskId, wildoApplicationId },\n {\n $unset: Object.fromEntries(fieldEntries),\n },\n {\n runValidators: true,\n new: true,\n ...(session ? { session } : {}),\n },\n );\n }\n\n private buildRepositoryOptions(transaction?: TransactionContext): CompanionRepositoryOptions | undefined {\n return transaction ? { transaction } : undefined;\n }\n\n /**\n * Compute the repository-write re-attach allowlist for a server-authored\n * payload — the SAME schema-derived set the engine's application-tier trusted\n * writes use ({@link deriveTrustedSystemWritePreservedFields}).\n *\n * WHY the companion needs it: every `repository.create/update` strict-parses\n * the payload against the resource's client-shaped request DTO, which omits\n * two field classes — `.isBackendOnly()` material and the context-auto-populated\n * scope/audit FKs (`CONTEXT_AUTO_POPULATED_FIELD_IDENTIFIERS`, stripped by NAME).\n * For these platform-persistence resources the only such field the companion\n * authors is `organizationId` (the ORGANIZATIONS primary-scope FK): on an\n * HTTP write it would be re-injected from the request context AFTER the parse,\n * but the companion's system-context writes have no request context, so without\n * this the strip silently drops it and the row fails Mongoose required-field\n * validation. `RepositoryOptions.preserveServerInjectedFields` re-attaches\n * exactly the derived keys after the parse.\n *\n * WHY it is DERIVED, not a hard-coded list: deriving from the registered\n * `mainSchema` is the single source of truth shared with the engine seam, so a\n * future schema change (a new backend-only field, an added scope FK) is covered\n * automatically. The other server-injected FKs (`wildoApplicationId`, the\n * `wildoApplicationActorSystemExecutionId` execution link) are ordinary\n * `.isForeignKey()` relationship fields that the request DTO does NOT strip —\n * they parse through normally — so the derivation correctly excludes them.\n *\n * TIER NOTE: the companion executions plane is local-platform-tier repository\n * CRUD (it never stands up the application `ServicesRegistryHandler`), so it\n * reuses the engine's DERIVATION helper directly at the repository tier rather\n * than routing through the application-services-tier\n * `SystemAccessBackendService.createAsSystem`/`updateAsSystem` (which resolve a\n * service/URL operation path these `REPOSITORY_ONLY` resources do not declare).\n */\n private deriveServerInjectedPreserveFields(\n resourceType: ResourceType,\n data: Record<string, unknown>,\n verb: CoreResourceOperation.CREATE | CoreResourceOperation.UPDATE | CoreResourceOperation.UPDATE_MANY,\n ): string[] {\n const config = this.resourcesRegistry.getResourceConfiguration(resourceType);\n return deriveTrustedSystemWritePreservedFields(config.mainSchema, Object.keys(data), verb);\n }\n\n private assertStandaloneTaskStateConsistency(payload: Pick<CompanionCreateActorExecutionRequest, \"standaloneTasks\" | \"standaloneTaskStates\">): void {\n const seenTaskIds = new Set<string>();\n for (const task of payload.standaloneTasks) {\n if (seenTaskIds.has(task._id)) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: {\n message: \"Actor execution payload contains duplicate standalone task ids.\",\n taskId: task._id,\n },\n });\n }\n\n seenTaskIds.add(task._id);\n }\n\n for (const taskState of payload.standaloneTaskStates) {\n if (!seenTaskIds.has(taskState.taskId)) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: {\n message: \"Actor execution task states must reference a declared standalone task.\",\n taskId: taskState.taskId,\n },\n });\n }\n }\n }\n\n\n private normalizeTaskCreatePayload(payload: CompanionCreateActorTaskRequest): Omit<\n CompanionCreateActorTaskRequest,\n \"wildoApplicationActorSystemExecutionId\"\n > & {\n createdAt: string;\n updatedAt: string;\n completedAt?: string;\n actorStates: Wildo_Application_Actor_Task[\"actorStates\"];\n } {\n const {\n completedAt: _completedAt,\n wildoApplicationActorSystemExecutionId: _wildoApplicationActorSystemExecutionId,\n ...payloadWithoutManagedFields\n } = payload;\n const now = new Date().toISOString();\n const createdAt = payload.createdAt ?? now;\n const updatedAt = payload.updatedAt ?? createdAt;\n const actorStates =\n payload.actorStates.length > 0\n ? payload.actorStates\n : [\n {\n actorRef: payload.actors.actorRef,\n status: payload.status,\n updatedAt,\n statusChanges: [{ status: payload.status, timestamp: updatedAt }],\n },\n ];\n const completedAt = this.isTerminalStatus(payload.status) ? (payload.completedAt ?? updatedAt) : undefined;\n\n return {\n ...payloadWithoutManagedFields,\n createdAt,\n updatedAt,\n actorStates,\n ...(completedAt ? { completedAt } : {}),\n };\n }\n\n private buildPersistedStandaloneTaskStates(\n persistedTasks: PersistedExecutionTask[],\n sourceStates: CompanionCreateActorExecutionRequest[\"standaloneTaskStates\"],\n ): Wildo_Application_ActorSystem_Execution[\"standaloneTaskStates\"] {\n const statesBySourceTaskId = new Map<string, CompanionCreateActorExecutionRequest[\"standaloneTaskStates\"][number]>(\n sourceStates.map((item) => [item.taskId, item]),\n );\n\n return persistedTasks.map(({ sourceTaskId, task }) => {\n const sourceState = statesBySourceTaskId.get(sourceTaskId);\n const updatedAt = this.toStrictIsoDatetime(task.updatedAt);\n\n return {\n taskId: task._id,\n status: task.status,\n updatedAt,\n statusChanges: sourceState?.statusChanges?.length\n ? sourceState.statusChanges.map((change) => ({\n status: change.status,\n timestamp: this.toStrictIsoDatetime(change.timestamp),\n }))\n : [{ status: task.status, timestamp: updatedAt }],\n };\n });\n }\n\n /**\n * Normalize a persisted timestamp to the STRICT ISO-8601 form the execution\n * contract requires. Control-plane resources (actor tasks/executions) get\n * their `createdAt`/`updatedAt` from Mongoose auto-timestamps, which write a\n * `Date` into the STRING-typed field — Mongoose then casts it with\n * `Date.prototype.toString()`, producing a locale form (\"Wed Jul 08 2026\n * 06:16:36 GMT+0200 (Central European Summer Time)\"). The task schema's own\n * `updatedAt` (`z.string().refine(Date.parse)`) tolerates that, but the\n * execution's `standaloneTaskStates[].updatedAt` / `statusChanges[].timestamp`\n * are strict `z.iso.datetime()` (Z-suffixed) and REJECT it — so projecting a\n * raw `task.updatedAt` into a standalone-task-state write fails validation.\n * The companion owns the task→execution projection, so it normalizes here at\n * that loose→strict boundary. `Date.parse` accepts both the locale and ISO\n * forms; the `NaN` fallback (never hit for real persisted rows) keeps a bad\n * source from throwing. NOTE (flagged for the engine layer): the underlying\n * locale-string storage also breaks the `updatedAt.localeCompare` ordering\n * used for run-recency — the deeper fix is to store ISO in the DB.\n */\n private toStrictIsoDatetime(value: string): string {\n const parsed = Date.parse(value);\n return Number.isNaN(parsed) ? new Date().toISOString() : new Date(parsed).toISOString();\n }\n\n private buildStandaloneTaskStates(\n tasks: Array<Pick<Wildo_Application_Actor_Task, \"_id\" | \"status\" | \"updatedAt\">>,\n existingStates: Wildo_Application_ActorSystem_Execution[\"standaloneTaskStates\"],\n ): Wildo_Application_ActorSystem_Execution[\"standaloneTaskStates\"] {\n const statesByTaskId = new Map<string, Wildo_Application_ActorSystem_Execution[\"standaloneTaskStates\"][number]>(\n existingStates.map((item) => [item.taskId, item]),\n );\n\n return tasks.map((task) => {\n const updatedAt = this.toStrictIsoDatetime(task.updatedAt);\n const existingState = statesByTaskId.get(task._id);\n const statusChanges = existingState?.statusChanges ?? [];\n const lastStatus = statusChanges[statusChanges.length - 1]?.status;\n const nextStatusChanges = lastStatus === task.status ? statusChanges : [...statusChanges, { status: task.status, timestamp: updatedAt }];\n\n return {\n taskId: task._id,\n status: task.status,\n updatedAt,\n statusChanges: nextStatusChanges.length > 0 ? nextStatusChanges : [{ status: task.status, timestamp: updatedAt }],\n };\n });\n }\n\n private upsertTask(tasks: Wildo_Application_Actor_Task[], task: Wildo_Application_Actor_Task): Wildo_Application_Actor_Task[] {\n const existingIndex = tasks.findIndex((item) => item._id === task._id);\n if (existingIndex === -1) {\n return [...tasks, task];\n }\n\n return tasks.map((item) => (item._id === task._id ? task : item));\n }\n\n private normalizeCreateEnvelope<TPayload extends ExecutionCreateEnvelope>(\n payload: TPayload,\n ): Pick<TPayload, \"statusChanges\" | \"createdAt\" | \"updatedAt\" | \"finishedAt\"> {\n const now = new Date().toISOString();\n const createdAt = payload.createdAt ?? now;\n const updatedAt = payload.updatedAt ?? createdAt;\n const statusChanges = payload.statusChanges.length > 0 ? payload.statusChanges : [{ status: payload.status, timestamp: createdAt }];\n const finishedAt = this.isTerminalStatus(payload.status) ? (payload.finishedAt ?? updatedAt) : undefined;\n\n return {\n statusChanges,\n createdAt,\n updatedAt,\n ...(finishedAt ? { finishedAt } : {}),\n };\n }\n\n private isTerminalStatus(status: FlowsActors_Status): boolean {\n return [FlowsActors_Status.COMPLETED, FlowsActors_Status.FAILED, FlowsActors_Status.CANCELLED, FlowsActors_Status.ABORTED].includes(status);\n }\n\n /**\n * The `kind` derives from the canonical `FlowsActors_ElementKind` vocabulary\n * and is narrowed to the two element kinds that have persisted executions —\n * its string value is interpolated into the user-facing message below.\n */\n private buildExecutionNotFoundError(kind: FlowsActors_ElementKind.ACTOR | FlowsActors_ElementKind.FLOW, executionId: string) {\n return this.errorBuilder.buildError(ErrorType.NOT_FOUND, undefined, {\n customMessageReference: ErrorCustomMessageReference.NOT_FOUND,\n context: {\n message: `No persisted ${kind} execution exists for this companion app.`,\n executionId,\n appSlug: this.companionContext.saasConfig.slug,\n },\n });\n }\n\n private buildTaskNotFoundError(taskId: string) {\n return this.errorBuilder.buildError(ErrorType.NOT_FOUND, undefined, {\n customMessageReference: ErrorCustomMessageReference.NOT_FOUND,\n context: {\n message: \"No persisted actor task exists for this companion app.\",\n taskId,\n appSlug: this.companionContext.saasConfig.slug,\n },\n });\n }\n}\n"]}
1
+ {"version":3,"file":"companion-executions.companion.service.js","sourceRoot":"","sources":["../../../../../src/executions/services/companion-executions.companion.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE/C,OAAO,EACL,0BAA0B,EAE1B,qCAAqC,EACrC,aAAa,EACb,yCAAyC,EACzC,2CAA2C,EAC3C,+BAA+B,EAC/B,kBAAkB,EAClB,gBAAgB,EAChB,iCAAiC,EACjC,mCAAmC,GAEpC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAGL,qBAAqB,EACrB,kBAAkB,EAClB,2BAA2B,EAC3B,SAAS,EAET,uBAAuB,EACvB,kBAAkB,EAClB,cAAc,EACd,oBAAoB,EACpB,0BAA0B,EAC1B,uCAAuC,EACvC,mBAAmB,GAEpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,yBAAyB,EAA0B,MAAM,gCAAgC,CAAC;AAUnG,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,EAAE,4BAA4B,EAAE,MAAM,wDAAwD,CAAC;AACtG,OAAO,EAAE,0BAA0B,EAAE,uBAAuB,EAAyC,MAAM,uDAAuD,CAAC;AACnK;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,qCAAqC,CACnD,YAAoB,EACpB,SAAsC,EACtC,UAAkB,EAClB,MAAsB;IAEtB,OAAO;QACL,YAAY;QACZ,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,oBAAoB,CAAC,YAAY,EAAE,OAAO,EAAE,SAAS,CAAC,cAAc,EAAE,CAAC;QAC3F,KAAK,EAAE,kBAAkB,CAAC,gBAAgB;QAC1C,OAAO,EAAE;YACP,YAAY;YACZ,UAAU;YACV,0BAA0B,EAAE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AA;IAE7D,WAAA,MAAM,CAAC,kBAAkB,CAAC,uBAAuB,CAAC,CAAA;IAElD,WAAA,MAAM,CAAC,kBAAkB,CAAC,qCAAqC,CAAC,CAAA;IAEhE,WAAA,MAAM,CAAC,uBAAuB,CAAC,gBAAgB,CAAC,CAAA;IAEhD,WAAA,MAAM,CAAC,uBAAuB,CAAC,mBAAmB,CAAC,CAAA;IAMnD,WAAA,MAAM,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAA;qCA7BgB,aAAa;QAE1C,0BAA0B;QAYT,2CAA2C;QAEpD,yCAAyC;QAE5C,+BAA+B;QAEzB,qCAAqC,UAIzC,4BAA4B;QAM/B,gBAAgB;GAnC1C,mCAAmC,CA8sD/C","sourcesContent":["import { inject, injectable } from \"inversify\";\nimport { z } from \"zod\";\nimport {\n ErrorBuilderBackendService,\n ExecutionContext,\n ExecutionContextCreatorBackendService,\n LoggerService,\n RepositoriesRegistryHandlerBackendService,\n ResourcePersistenceUnitOfWorkBackendService,\n ResourcesRegistryBackendService,\n SAAS_SERVICE_TYPES,\n WebSocketService,\n buildScopeRoomNotificationPayload,\n registerTransactionPostCommitEffect,\n type TransactionContext,\n} from \"@wildo-ai/saas-backend-lib\";\nimport {\n Actors_Task_Schema,\n ActorSystem_ExecutionSchema,\n CoreResourceOperation,\n CoreWebSocketEvent,\n ErrorCustomMessageReference,\n ErrorType,\n FlowSystem_Execution_Schema,\n FlowsActors_ElementKind,\n FlowsActors_Status,\n ResourceAction,\n ResourceScopeRoomKey,\n ResourceSerializationUtils,\n deriveTrustedSystemWritePreservedFields,\n isWildoBackendError,\n type ResourceType,\n} from '@wildo-ai/saas-models';\nimport { CustomShared_ResourceType, type Wildo_Application } from \"@wildo-ai/platform-core-shared\";\nimport type {\n CompanionActorTasksListQuery,\n CompanionCreateActorTaskRequest,\n CompanionCreateActorExecutionRequest,\n CompanionCreateFlowExecutionRequest,\n CompanionExecutionsListQuery,\n CompanionUpdateActorTaskRequest,\n} from \"../../companion-api/companion-api.schemas\";\nimport type { CompanionContext } from \"../../core/context/companion-context\";\nimport { COMPANION_SERVICE_TYPES } from \"../../core/inject/models/service-types\";\nimport { CompanionTraceabilityService } from \"../../core/traceability/companion-traceability.service\";\nimport { CompanionTraceabilityLevel, CompanionTraceAliasKind, type CompanionExecutionSessionContext } from \"../../core/traceability/companion-traceability.models\";\n/**\n * The room and payload for one repository-direct control-plane mutation (issue #286).\n *\n * Exported and pure so the two properties that MATTER can be pinned without standing up the whole\n * service: which room the event goes to, and what it carries.\n *\n * ## The ORGANIZATION room is a tenant-isolation decision, not a detail\n *\n * `wildoApplicationActorTasks` and both execution resources declare `isPrimaryScope: true` on their\n * ORGANIZATIONS relationship, so a row belongs to ONE tenant. The sibling introspection notifier\n * legitimately broadcasts to the APPLICATION room because every resource it serves is\n * APPLICATION-anchored; doing that here would carry one tenant's row ids to every user of the\n * application.\n *\n * ## Notification-grade, never row data\n *\n * `currentObject` is deliberately absent. A scope room fans out to every member of the tenant, and\n * these rows carry coding-agent input and output that a collection event has no business\n * broadcasting. Subscribers learn WHAT moved and refetch through their own authorization — the same\n * contract the introspection notifier's collection lane uses.\n */\nexport function buildControlPlaneMutationNotification(\n resourceType: string,\n ownership: CompanionExecutionOwnership,\n resourceId: string,\n action: ResourceAction,\n) {\n return {\n resourceType,\n rooms: [{ scopeKey: ResourceScopeRoomKey.ORGANIZATION, scopeId: ownership.organizationId }],\n event: CoreWebSocketEvent.RESOURCE_UPDATED,\n payload: {\n resourceType,\n resourceId,\n contextResourceIdentifiers: {\n organizationId: ownership.organizationId,\n applicationId: ownership.wildoApplicationId,\n },\n action,\n affectedIds: [resourceId],\n operationIdentifier: CoreResourceOperation.LIST,\n currentObject: undefined,\n },\n };\n}\n\ninterface CompanionExecutionOwnership {\n organizationId: string;\n wildoApplicationId: string;\n}\n\ntype Wildo_Application_ActorSystem_Execution = z.infer<typeof ActorSystem_ExecutionSchema> & {\n _id: string;\n _version?: number;\n organizationId: string;\n wildoApplicationId: string;\n};\n\ntype Wildo_Application_FlowSystem_Execution = z.infer<typeof FlowSystem_Execution_Schema> & {\n _id: string;\n organizationId: string;\n wildoApplicationId: string;\n};\n\ntype Wildo_Application_Actor_Task = z.infer<typeof Actors_Task_Schema> & {\n _id: string;\n _version?: number;\n organizationId: string;\n wildoApplicationId: string;\n wildoApplicationActorSystemExecutionId?: string;\n continuityAttemptKey?: string;\n};\n\nconst WILDO_APPLICATION_ACTOR_SYSTEM_EXECUTIONS_RESOURCE_TYPE: ResourceType = \"wildoApplicationActorSystemExecutions\";\n\nconst WILDO_APPLICATION_FLOW_SYSTEM_EXECUTIONS_RESOURCE_TYPE: ResourceType = \"wildoApplicationFlowSystemExecutions\";\n\nconst WILDO_APPLICATION_ACTOR_TASKS_RESOURCE_TYPE: ResourceType = \"wildoApplicationActorTasks\";\n\n/**\n * The persistence participants of every companion execution boundary.\n *\n * Executions and their tasks are written together — creating an execution persists its\n * standalone tasks, and both task verbs read the owning execution back inside the same\n * transaction — so the two resources belong to ONE boundary. Declaring them is what lets the\n * unit of work resolve a single adapter and refuse the split-store case outright, instead of\n * discovering it at commit time on whichever adapter happened to open the transaction.\n */\nconst COMPANION_EXECUTION_PERSISTENCE_PARTICIPANTS: Readonly<Record<string, string>> = Object.freeze({\n actorExecution: WILDO_APPLICATION_ACTOR_SYSTEM_EXECUTIONS_RESOURCE_TYPE,\n actorTask: WILDO_APPLICATION_ACTOR_TASKS_RESOURCE_TYPE,\n});\n\ntype ExecutionCreateEnvelope = {\n status: FlowsActors_Status;\n statusChanges: Array<{ status: FlowsActors_Status; timestamp: string }>;\n createdAt?: string;\n updatedAt?: string;\n finishedAt?: string;\n};\n\ntype CompanionRepositoryOptions = {\n transaction?: TransactionContext;\n};\n\ntype PersistedExecutionTask = {\n sourceTaskId: string;\n task: Wildo_Application_Actor_Task;\n};\n\n@injectable()\nexport class CompanionExecutionsCompanionService {\n private readonly logDebug: (message: string, context?: Record<string, unknown>) => void;\n private ownershipPromise?: Promise<CompanionExecutionOwnership>;\n\n constructor(\n @inject(SAAS_SERVICE_TYPES.Logger) private readonly logger: LoggerService,\n @inject(SAAS_SERVICE_TYPES.ErrorBuilderService)\n private readonly errorBuilder: ErrorBuilderBackendService,\n /*\n * The ADAPTER-NEUTRAL transaction seam, not `MongoDBService`.\n *\n * These three boundaries used `mongoDBService.executeTransaction` until 2026-08-28, which\n * is one half of why the companion could not run on a PostgreSQL platform (issue #94):\n * even once the right store is connected, a Mongo-specific transaction cannot wrap a write\n * to a PostgreSQL-resolved repository. The unit of work resolves the adapter from the\n * DECLARED participants and refuses a boundary whose resources are split across two stores,\n * which is a configuration error rather than something to discover at commit time.\n */\n @inject(SAAS_SERVICE_TYPES.ResourcePersistenceUnitOfWorkService)\n private readonly resourcePersistenceUnitOfWork: ResourcePersistenceUnitOfWorkBackendService,\n @inject(SAAS_SERVICE_TYPES.RepositoriesRegistryHandlerService)\n private readonly repositoriesRegistry: RepositoriesRegistryHandlerBackendService,\n @inject(SAAS_SERVICE_TYPES.ResourceRegistryService)\n private readonly resourcesRegistry: ResourcesRegistryBackendService,\n @inject(SAAS_SERVICE_TYPES.ExecutionContextCreatorBackendService)\n private readonly executionContextCreator: ExecutionContextCreatorBackendService,\n @inject(COMPANION_SERVICE_TYPES.CompanionContext)\n private readonly companionContext: CompanionContext,\n @inject(COMPANION_SERVICE_TYPES.TraceabilityService)\n private readonly traceabilityService: CompanionTraceabilityService,\n /*\n * The companion MOUNTS the engine WebSocket server, and these control-plane writes were the\n * one lane that never used it (issue #286). See `publishControlPlaneMutation`.\n */\n @inject(SAAS_SERVICE_TYPES.WebSocketService)\n private readonly websocketService: WebSocketService,\n ) {\n this.logDebug = this.logger.debugByType(\"CompanionExecutionsCompanionService\");\n this.logger.setDebugTypeLogging(\"CompanionExecutionsCompanionService\", true);\n }\n\n public async createActorExecution(\n payload: CompanionCreateActorExecutionRequest,\n sessionContext?: CompanionExecutionSessionContext,\n ): Promise<Wildo_Application_ActorSystem_Execution> {\n const traceStep = this.createOperationTraceStep(sessionContext, \"create-actor-execution\");\n await this.traceOperationStart({\n sessionContext,\n step: traceStep,\n type: \"actor-execution-create-start\",\n summary: `Create persisted actor execution for ${payload.systemRef}`,\n payload: {\n systemRef: payload.systemRef,\n status: payload.status,\n standaloneTaskCount: payload.standaloneTasks.length,\n },\n artifactFileName: \"actor-execution-create-request.json\",\n artifactContent: payload,\n });\n\n try {\n this.assertStandaloneTaskStateConsistency(payload);\n const execution = await this.resourcePersistenceUnitOfWork.executeTransaction(\n {\n boundary: 'companion-executions.create-actor-execution',\n participants: COMPANION_EXECUTION_PERSISTENCE_PARTICIPANTS,\n },\n async ({ transaction }) => {\n const ownership = await this.resolveOwnership(sessionContext);\n const repository = this.repositoriesRegistry.getRepositoryOrThrow(WILDO_APPLICATION_ACTOR_SYSTEM_EXECUTIONS_RESOURCE_TYPE);\n const executionContext = await this.createInternalExecutionContext(\n WILDO_APPLICATION_ACTOR_SYSTEM_EXECUTIONS_RESOURCE_TYPE,\n CoreResourceOperation.CREATE,\n sessionContext,\n );\n const normalizedPayload = this.normalizeCreateEnvelope(payload);\n const createData = {\n ...payload,\n ...normalizedPayload,\n organizationId: ownership.organizationId,\n wildoApplicationId: ownership.wildoApplicationId,\n };\n\n const createdExecution = await repository.create<Wildo_Application_ActorSystem_Execution>(executionContext, createData, {\n ...this.buildRepositoryOptions(transaction),\n preserveServerInjectedFields: this.deriveServerInjectedPreserveFields(\n WILDO_APPLICATION_ACTOR_SYSTEM_EXECUTIONS_RESOURCE_TYPE,\n createData,\n CoreResourceOperation.CREATE,\n ),\n });\n\n this.publishControlPlaneMutation(\n transaction,\n WILDO_APPLICATION_ACTOR_SYSTEM_EXECUTIONS_RESOURCE_TYPE,\n ownership,\n String(createdExecution._id),\n ResourceAction.CREATED,\n );\n // Announced ONCE, here, because both return paths below concern this same row — the\n // snapshot update that may follow is the same execution, not a second one.\n if (payload.standaloneTasks.length === 0) {\n return createdExecution;\n }\n\n const persistedTasks = await this.persistExecutionTasks(\n ownership,\n createdExecution._id,\n payload.standaloneTasks,\n payload.standaloneTaskStates,\n transaction,\n sessionContext,\n );\n\n const updatedExecution = await this.updateActorExecutionTaskSnapshot(\n createdExecution,\n ownership,\n persistedTasks.map(({ task }) => task),\n transaction,\n this.buildPersistedStandaloneTaskStates(persistedTasks, payload.standaloneTaskStates),\n sessionContext,\n );\n return updatedExecution;\n },\n );\n\n if (sessionContext) {\n await this.traceabilityService.registerAlias(sessionContext, CompanionTraceAliasKind.ACTOR_EXECUTION,execution._id);\n }\n\n await this.traceOperationSuccess({\n sessionContext,\n step: traceStep,\n type: \"actor-execution-create-success\",\n summary: `Created persisted actor execution ${execution._id}`,\n payload: {\n executionId: execution._id,\n status: execution.status,\n standaloneTaskCount: execution.standaloneTasks.length,\n },\n artifactFileName: \"actor-execution-create-result.json\",\n artifactContent: execution,\n });\n return execution;\n } catch (error) {\n await this.traceOperationFailure({\n sessionContext,\n step: traceStep,\n type: \"actor-execution-create-failure\",\n summary: `Failed to create persisted actor execution for ${payload.systemRef}`,\n error,\n payload: {\n systemRef: payload.systemRef,\n status: payload.status,\n standaloneTaskCount: payload.standaloneTasks.length,\n },\n });\n throw error;\n }\n }\n\n public async createFlowExecution(\n payload: CompanionCreateFlowExecutionRequest,\n sessionContext?: CompanionExecutionSessionContext,\n ): Promise<Wildo_Application_FlowSystem_Execution> {\n const traceStep = this.createOperationTraceStep(sessionContext, \"create-flow-execution\");\n await this.traceOperationStart({\n sessionContext,\n step: traceStep,\n type: \"flow-execution-create-start\",\n summary: `Create persisted flow execution for ${payload.systemRef}`,\n payload: {\n systemRef: payload.systemRef,\n status: payload.status,\n },\n artifactFileName: \"flow-execution-create-request.json\",\n artifactContent: payload,\n });\n\n try {\n const ownership = await this.resolveOwnership(sessionContext);\n const repository = this.repositoriesRegistry.getRepositoryOrThrow(WILDO_APPLICATION_FLOW_SYSTEM_EXECUTIONS_RESOURCE_TYPE);\n const executionContext = await this.createInternalExecutionContext(\n WILDO_APPLICATION_FLOW_SYSTEM_EXECUTIONS_RESOURCE_TYPE,\n CoreResourceOperation.CREATE,\n sessionContext,\n );\n const normalizedPayload = this.normalizeCreateEnvelope(payload);\n const createData = {\n ...payload,\n ...normalizedPayload,\n organizationId: ownership.organizationId,\n wildoApplicationId: ownership.wildoApplicationId,\n };\n\n const flowExecution = await repository.create<Wildo_Application_FlowSystem_Execution>(executionContext, createData, {\n preserveServerInjectedFields: this.deriveServerInjectedPreserveFields(\n WILDO_APPLICATION_FLOW_SYSTEM_EXECUTIONS_RESOURCE_TYPE,\n createData,\n CoreResourceOperation.CREATE,\n ),\n });\n // `null` transaction: this write is NOT wrapped in one, so it is already durable here.\n this.publishControlPlaneMutation(\n null,\n WILDO_APPLICATION_FLOW_SYSTEM_EXECUTIONS_RESOURCE_TYPE,\n ownership,\n String(flowExecution._id),\n ResourceAction.CREATED,\n );\n if (sessionContext) {\n await this.traceabilityService.registerAlias(sessionContext, CompanionTraceAliasKind.FLOW_EXECUTION,flowExecution._id);\n }\n await this.traceOperationSuccess({\n sessionContext,\n step: traceStep,\n type: \"flow-execution-create-success\",\n summary: `Created persisted flow execution ${flowExecution._id}`,\n payload: {\n executionId: flowExecution._id,\n status: flowExecution.status,\n },\n artifactFileName: \"flow-execution-create-result.json\",\n artifactContent: flowExecution,\n });\n return flowExecution;\n } catch (error) {\n await this.traceOperationFailure({\n sessionContext,\n step: traceStep,\n type: \"flow-execution-create-failure\",\n summary: `Failed to create persisted flow execution for ${payload.systemRef}`,\n error,\n payload: {\n systemRef: payload.systemRef,\n status: payload.status,\n },\n });\n throw error;\n }\n }\n\n public async getActorExecution(executionId: string, _sessionContext?: CompanionExecutionSessionContext): Promise<Wildo_Application_ActorSystem_Execution> {\n const traceStep = this.createOperationTraceStep(_sessionContext, \"read-actor-execution\");\n await this.traceOperationStart({\n sessionContext: _sessionContext,\n step: traceStep,\n type: \"actor-execution-read-start\",\n summary: `Read persisted actor execution ${executionId}`,\n payload: { executionId },\n artifactFileName: \"actor-execution-read-request.json\",\n artifactContent: { executionId },\n });\n\n try {\n const ownership = await this.resolveOwnership(_sessionContext);\n const repository = this.repositoriesRegistry.getRepositoryOrThrow(WILDO_APPLICATION_ACTOR_SYSTEM_EXECUTIONS_RESOURCE_TYPE);\n const executionContext = await this.createInternalExecutionContext(\n WILDO_APPLICATION_ACTOR_SYSTEM_EXECUTIONS_RESOURCE_TYPE,\n CoreResourceOperation.READ,\n _sessionContext,\n );\n const execution = await repository.read<Wildo_Application_ActorSystem_Execution>(executionContext, {\n _id: executionId,\n wildoApplicationId: ownership.wildoApplicationId,\n });\n\n if (!execution) {\n throw this.buildExecutionNotFoundError(FlowsActors_ElementKind.ACTOR,executionId);\n }\n\n if (_sessionContext) {\n await this.traceabilityService.registerAlias(_sessionContext, CompanionTraceAliasKind.ACTOR_EXECUTION,execution._id);\n }\n await this.traceOperationSuccess({\n sessionContext: _sessionContext,\n step: traceStep,\n type: \"actor-execution-read-success\",\n summary: `Read persisted actor execution ${execution._id}`,\n payload: {\n executionId: execution._id,\n status: execution.status,\n },\n artifactFileName: \"actor-execution-read-result.json\",\n artifactContent: execution,\n });\n return execution;\n } catch (error) {\n await this.traceOperationFailure({\n sessionContext: _sessionContext,\n step: traceStep,\n type: \"actor-execution-read-failure\",\n summary: `Failed to read persisted actor execution ${executionId}`,\n error,\n payload: { executionId },\n });\n throw error;\n }\n }\n\n public async getFlowExecution(executionId: string, _sessionContext?: CompanionExecutionSessionContext): Promise<Wildo_Application_FlowSystem_Execution> {\n const traceStep = this.createOperationTraceStep(_sessionContext, \"read-flow-execution\");\n await this.traceOperationStart({\n sessionContext: _sessionContext,\n step: traceStep,\n type: \"flow-execution-read-start\",\n summary: `Read persisted flow execution ${executionId}`,\n payload: { executionId },\n artifactFileName: \"flow-execution-read-request.json\",\n artifactContent: { executionId },\n });\n\n try {\n const ownership = await this.resolveOwnership(_sessionContext);\n const repository = this.repositoriesRegistry.getRepositoryOrThrow(WILDO_APPLICATION_FLOW_SYSTEM_EXECUTIONS_RESOURCE_TYPE);\n const executionContext = await this.createInternalExecutionContext(\n WILDO_APPLICATION_FLOW_SYSTEM_EXECUTIONS_RESOURCE_TYPE,\n CoreResourceOperation.READ,\n _sessionContext,\n );\n const execution = await repository.read<Wildo_Application_FlowSystem_Execution>(executionContext, {\n _id: executionId,\n wildoApplicationId: ownership.wildoApplicationId,\n });\n\n if (!execution) {\n throw this.buildExecutionNotFoundError(FlowsActors_ElementKind.FLOW,executionId);\n }\n\n if (_sessionContext) {\n await this.traceabilityService.registerAlias(_sessionContext, CompanionTraceAliasKind.FLOW_EXECUTION,execution._id);\n }\n await this.traceOperationSuccess({\n sessionContext: _sessionContext,\n step: traceStep,\n type: \"flow-execution-read-success\",\n summary: `Read persisted flow execution ${execution._id}`,\n payload: {\n executionId: execution._id,\n status: execution.status,\n },\n artifactFileName: \"flow-execution-read-result.json\",\n artifactContent: execution,\n });\n return execution;\n } catch (error) {\n await this.traceOperationFailure({\n sessionContext: _sessionContext,\n step: traceStep,\n type: \"flow-execution-read-failure\",\n summary: `Failed to read persisted flow execution ${executionId}`,\n error,\n payload: { executionId },\n });\n throw error;\n }\n }\n\n public async listActorExecutions(\n query: CompanionExecutionsListQuery,\n _sessionContext?: CompanionExecutionSessionContext,\n ): Promise<Wildo_Application_ActorSystem_Execution[]> {\n const traceStep = this.createOperationTraceStep(_sessionContext, \"list-actor-executions\");\n await this.traceOperationStart({\n sessionContext: _sessionContext,\n step: traceStep,\n type: \"actor-executions-list-start\",\n summary: \"List persisted actor executions\",\n payload: query,\n artifactFileName: \"actor-executions-list-request.json\",\n artifactContent: query,\n });\n\n try {\n const executions = await this.listExecutions<Wildo_Application_ActorSystem_Execution>(\n WILDO_APPLICATION_ACTOR_SYSTEM_EXECUTIONS_RESOURCE_TYPE,\n query,\n _sessionContext,\n );\n await this.traceOperationSuccess({\n sessionContext: _sessionContext,\n step: traceStep,\n type: \"actor-executions-list-success\",\n summary: `Listed ${executions.length} persisted actor executions`,\n payload: {\n count: executions.length,\n status: query.status ?? null,\n systemRef: query.systemRef ?? null,\n limit: query.limit,\n },\n artifactFileName: \"actor-executions-list-result.json\",\n artifactContent: executions,\n });\n return executions;\n } catch (error) {\n await this.traceOperationFailure({\n sessionContext: _sessionContext,\n step: traceStep,\n type: \"actor-executions-list-failure\",\n summary: \"Failed to list persisted actor executions\",\n error,\n payload: query,\n });\n throw error;\n }\n }\n\n public async listFlowExecutions(\n query: CompanionExecutionsListQuery,\n _sessionContext?: CompanionExecutionSessionContext,\n ): Promise<Wildo_Application_FlowSystem_Execution[]> {\n const traceStep = this.createOperationTraceStep(_sessionContext, \"list-flow-executions\");\n await this.traceOperationStart({\n sessionContext: _sessionContext,\n step: traceStep,\n type: \"flow-executions-list-start\",\n summary: \"List persisted flow executions\",\n payload: query,\n artifactFileName: \"flow-executions-list-request.json\",\n artifactContent: query,\n });\n\n try {\n const executions = await this.listExecutions<Wildo_Application_FlowSystem_Execution>(\n WILDO_APPLICATION_FLOW_SYSTEM_EXECUTIONS_RESOURCE_TYPE,\n query,\n _sessionContext,\n );\n await this.traceOperationSuccess({\n sessionContext: _sessionContext,\n step: traceStep,\n type: \"flow-executions-list-success\",\n summary: `Listed ${executions.length} persisted flow executions`,\n payload: {\n count: executions.length,\n status: query.status ?? null,\n systemRef: query.systemRef ?? null,\n limit: query.limit,\n },\n artifactFileName: \"flow-executions-list-result.json\",\n artifactContent: executions,\n });\n return executions;\n } catch (error) {\n await this.traceOperationFailure({\n sessionContext: _sessionContext,\n step: traceStep,\n type: \"flow-executions-list-failure\",\n summary: \"Failed to list persisted flow executions\",\n error,\n payload: query,\n });\n throw error;\n }\n }\n\n public async createActorTask(\n payload: CompanionCreateActorTaskRequest,\n sessionContext?: CompanionExecutionSessionContext,\n ): Promise<Wildo_Application_Actor_Task> {\n const traceStep = this.createOperationTraceStep(sessionContext, \"create-actor-task\");\n await this.traceOperationStart({\n sessionContext,\n step: traceStep,\n type: \"actor-task-create-start\",\n summary: \"Create persisted actor task\",\n payload: {\n actorRef: payload.actors.actorRef,\n status: payload.status,\n executionId: payload.wildoApplicationActorSystemExecutionId ?? null,\n },\n artifactFileName: \"actor-task-create-request.json\",\n artifactContent: payload,\n });\n\n try {\n const task = await this.resourcePersistenceUnitOfWork.executeTransaction(\n {\n boundary: 'companion-executions.create-actor-task',\n participants: COMPANION_EXECUTION_PERSISTENCE_PARTICIPANTS,\n },\n async ({ transaction }) => {\n const ownership = await this.resolveOwnership(sessionContext);\n if (payload.wildoApplicationActorSystemExecutionId) {\n await this.readActorExecutionOrThrow(payload.wildoApplicationActorSystemExecutionId, ownership.wildoApplicationId, transaction, sessionContext);\n }\n const repository = this.repositoriesRegistry.getRepositoryOrThrow(WILDO_APPLICATION_ACTOR_TASKS_RESOURCE_TYPE);\n const executionContext = await this.createInternalExecutionContext(\n WILDO_APPLICATION_ACTOR_TASKS_RESOURCE_TYPE,\n CoreResourceOperation.CREATE,\n sessionContext,\n );\n const normalizedPayload = this.normalizeTaskCreatePayload(payload);\n const createData = {\n ...normalizedPayload,\n organizationId: ownership.organizationId,\n wildoApplicationId: ownership.wildoApplicationId,\n ...(payload.wildoApplicationActorSystemExecutionId ? { wildoApplicationActorSystemExecutionId: payload.wildoApplicationActorSystemExecutionId } : {}),\n ...(payload.workbenchBuildPlanTaskId ? { workbenchBuildPlanTaskId: payload.workbenchBuildPlanTaskId } : {}),\n };\n const createdTask = await repository.create<Wildo_Application_Actor_Task>(executionContext, createData, {\n ...this.buildRepositoryOptions(transaction),\n preserveServerInjectedFields: this.deriveServerInjectedPreserveFields(\n WILDO_APPLICATION_ACTOR_TASKS_RESOURCE_TYPE,\n createData,\n CoreResourceOperation.CREATE,\n ),\n });\n\n await this.syncTaskIntoExecutionSnapshot(createdTask, transaction, sessionContext);\n this.publishControlPlaneMutation(\n transaction,\n WILDO_APPLICATION_ACTOR_TASKS_RESOURCE_TYPE,\n ownership,\n String(createdTask._id),\n ResourceAction.CREATED,\n );\n return createdTask;\n },\n );\n\n if (sessionContext) {\n await this.traceabilityService.registerAlias(sessionContext, CompanionTraceAliasKind.ACTOR_TASK,task._id);\n }\n\n await this.traceOperationSuccess({\n sessionContext,\n step: traceStep,\n type: \"actor-task-create-success\",\n summary: `Created persisted actor task ${task._id}`,\n payload: {\n taskId: task._id,\n status: task.status,\n executionId: task.wildoApplicationActorSystemExecutionId ?? null,\n },\n artifactFileName: \"actor-task-create-result.json\",\n artifactContent: task,\n });\n return task;\n } catch (error) {\n await this.traceOperationFailure({\n sessionContext,\n step: traceStep,\n type: \"actor-task-create-failure\",\n summary: \"Failed to create persisted actor task\",\n error,\n payload: {\n actorRef: payload.actors.actorRef,\n status: payload.status,\n executionId: payload.wildoApplicationActorSystemExecutionId ?? null,\n },\n });\n throw error;\n }\n }\n\n public async getActorTask(taskId: string, _sessionContext?: CompanionExecutionSessionContext): Promise<Wildo_Application_Actor_Task> {\n const traceStep = this.createOperationTraceStep(_sessionContext, \"read-actor-task\");\n await this.traceOperationStart({\n sessionContext: _sessionContext,\n step: traceStep,\n type: \"actor-task-read-start\",\n summary: `Read persisted actor task ${taskId}`,\n payload: { taskId },\n artifactFileName: \"actor-task-read-request.json\",\n artifactContent: { taskId },\n });\n\n try {\n const task = await this.readActorTaskOrThrow(taskId, undefined, _sessionContext);\n if (_sessionContext) {\n await this.traceabilityService.registerAlias(_sessionContext, CompanionTraceAliasKind.ACTOR_TASK,task._id);\n }\n await this.traceOperationSuccess({\n sessionContext: _sessionContext,\n step: traceStep,\n type: \"actor-task-read-success\",\n summary: `Read persisted actor task ${task._id}`,\n payload: {\n taskId: task._id,\n status: task.status,\n executionId: task.wildoApplicationActorSystemExecutionId ?? null,\n },\n artifactFileName: \"actor-task-read-result.json\",\n artifactContent: task,\n });\n return task;\n } catch (error) {\n await this.traceOperationFailure({\n sessionContext: _sessionContext,\n step: traceStep,\n type: \"actor-task-read-failure\",\n summary: `Failed to read persisted actor task ${taskId}`,\n error,\n payload: { taskId },\n });\n throw error;\n }\n }\n\n public async listActorTasks(\n query: CompanionActorTasksListQuery,\n _sessionContext?: CompanionExecutionSessionContext,\n ): Promise<Wildo_Application_Actor_Task[]> {\n const traceStep = this.createOperationTraceStep(_sessionContext, \"list-actor-tasks\");\n await this.traceOperationStart({\n sessionContext: _sessionContext,\n step: traceStep,\n type: \"actor-tasks-list-start\",\n summary: \"List persisted actor tasks\",\n payload: query,\n artifactFileName: \"actor-tasks-list-request.json\",\n artifactContent: query,\n });\n\n try {\n const ownership = await this.resolveOwnership(_sessionContext);\n const repository = this.repositoriesRegistry.getRepositoryOrThrow(WILDO_APPLICATION_ACTOR_TASKS_RESOURCE_TYPE);\n const executionContext = await this.createInternalExecutionContext(\n WILDO_APPLICATION_ACTOR_TASKS_RESOURCE_TYPE,\n CoreResourceOperation.LIST,\n _sessionContext,\n );\n const tasks = await repository.list<Wildo_Application_Actor_Task>(executionContext, {\n wildoApplicationId: ownership.wildoApplicationId,\n ...(query.executionId ? { wildoApplicationActorSystemExecutionId: query.executionId } : {}),\n ...(query.status ? { status: query.status } : {}),\n });\n\n const trimmedTasks = tasks.sort((left, right) => right.updatedAt.localeCompare(left.updatedAt)).slice(0, query.limit);\n await this.traceOperationSuccess({\n sessionContext: _sessionContext,\n step: traceStep,\n type: \"actor-tasks-list-success\",\n summary: `Listed ${trimmedTasks.length} persisted actor tasks`,\n payload: {\n count: trimmedTasks.length,\n executionId: query.executionId ?? null,\n status: query.status ?? null,\n limit: query.limit,\n },\n artifactFileName: \"actor-tasks-list-result.json\",\n artifactContent: trimmedTasks,\n });\n return trimmedTasks;\n } catch (error) {\n await this.traceOperationFailure({\n sessionContext: _sessionContext,\n step: traceStep,\n type: \"actor-tasks-list-failure\",\n summary: \"Failed to list persisted actor tasks\",\n error,\n payload: query,\n });\n throw error;\n }\n }\n\n public async updateActorTask(\n taskId: string,\n payload: CompanionUpdateActorTaskRequest,\n sessionContext?: CompanionExecutionSessionContext,\n ): Promise<Wildo_Application_Actor_Task> {\n const traceStep = this.createOperationTraceStep(sessionContext, \"update-actor-task\");\n await this.traceOperationStart({\n sessionContext,\n step: traceStep,\n type: \"actor-task-update-start\",\n summary: `Update persisted actor task ${taskId}`,\n payload: {\n taskId,\n status: payload.status ?? null,\n executionId: payload.wildoApplicationActorSystemExecutionId ?? null,\n clearExecutionLink: payload.clearExecutionLink === true,\n },\n artifactFileName: \"actor-task-update-request.json\",\n artifactContent: {\n taskId,\n payload,\n },\n });\n\n try {\n const task = await this.resourcePersistenceUnitOfWork.executeTransaction(\n {\n boundary: 'companion-executions.update-actor-task',\n participants: COMPANION_EXECUTION_PERSISTENCE_PARTICIPANTS,\n },\n async ({ transaction }) => {\n const ownership = await this.resolveOwnership(sessionContext);\n const existingTask = await this.readActorTaskOrThrow(taskId, transaction, sessionContext);\n if (\n payload.wildoApplicationActorSystemExecutionId &&\n payload.wildoApplicationActorSystemExecutionId !== existingTask.wildoApplicationActorSystemExecutionId\n ) {\n await this.readActorExecutionOrThrow(payload.wildoApplicationActorSystemExecutionId, ownership.wildoApplicationId, transaction, sessionContext);\n }\n const repository = this.repositoriesRegistry.getRepositoryOrThrow(WILDO_APPLICATION_ACTOR_TASKS_RESOURCE_TYPE);\n const executionContext = await this.createInternalExecutionContext(\n WILDO_APPLICATION_ACTOR_TASKS_RESOURCE_TYPE,\n CoreResourceOperation.UPDATE,\n sessionContext,\n );\n const updatedAt = payload.updatedAt ?? new Date().toISOString();\n const status = payload.status ?? existingTask.status;\n const shouldClearExecutionLink = payload.clearExecutionLink === true;\n const { clearExecutionLink: _clearExecutionLink, completedAt: payloadCompletedAt, ...payloadWithoutClearFlag } = payload;\n const shouldClearCompletedAt = !this.isTerminalStatus(status);\n const completedAt = shouldClearCompletedAt ? undefined : (payloadCompletedAt ?? existingTask.completedAt ?? updatedAt);\n const actorStates = payload.actorStates ?? existingTask.actorStates;\n\n const updateData = {\n ...payloadWithoutClearFlag,\n actorStates,\n status,\n updatedAt,\n ...(completedAt ? { completedAt } : {}),\n };\n\n await repository.update<Wildo_Application_Actor_Task>(executionContext, { _id: taskId, wildoApplicationId: ownership.wildoApplicationId }, updateData, {\n ...this.buildRepositoryOptions(transaction),\n // Derived allowlist (typically empty on UPDATE): the only fields the\n // update request DTO strips are the scope/audit FKs, and those are\n // never in this payload (`wildoApplicationId` is in the filter, not\n // the data). A re-linked `wildoApplicationActorSystemExecutionId` is\n // an ordinary relationship FK the DTO keeps, so it is not stripped.\n preserveServerInjectedFields: this.deriveServerInjectedPreserveFields(\n WILDO_APPLICATION_ACTOR_TASKS_RESOURCE_TYPE,\n updateData,\n CoreResourceOperation.UPDATE,\n ),\n });\n\n if (shouldClearExecutionLink || shouldClearCompletedAt) {\n await this.unsetActorTaskFields(\n taskId,\n ownership.wildoApplicationId,\n {\n ...(shouldClearExecutionLink ? { wildoApplicationActorSystemExecutionId: 1 } : {}),\n ...(shouldClearCompletedAt ? { completedAt: 1 } : {}),\n },\n transaction,\n );\n }\n\n const updatedTask = await this.readActorTaskOrThrow(taskId, transaction, sessionContext);\n\n if (\n existingTask.wildoApplicationActorSystemExecutionId &&\n existingTask.wildoApplicationActorSystemExecutionId !== updatedTask.wildoApplicationActorSystemExecutionId\n ) {\n await this.removeTaskFromExecutionSnapshot(existingTask, transaction, sessionContext);\n }\n\n await this.syncTaskIntoExecutionSnapshot(updatedTask, transaction, sessionContext);\n this.publishControlPlaneMutation(\n transaction,\n WILDO_APPLICATION_ACTOR_TASKS_RESOURCE_TYPE,\n ownership,\n String(updatedTask._id),\n ResourceAction.UPDATED,\n );\n return updatedTask;\n },\n );\n\n if (sessionContext) {\n await this.traceabilityService.registerAlias(sessionContext, CompanionTraceAliasKind.ACTOR_TASK,task._id);\n }\n\n await this.traceOperationSuccess({\n sessionContext,\n step: traceStep,\n type: \"actor-task-update-success\",\n summary: `Updated persisted actor task ${task._id}`,\n payload: {\n taskId: task._id,\n status: task.status,\n executionId: task.wildoApplicationActorSystemExecutionId ?? null,\n },\n artifactFileName: \"actor-task-update-result.json\",\n artifactContent: task,\n });\n return task;\n } catch (error) {\n await this.traceOperationFailure({\n sessionContext,\n step: traceStep,\n type: \"actor-task-update-failure\",\n summary: `Failed to update persisted actor task ${taskId}`,\n error,\n payload: {\n taskId,\n status: payload.status ?? null,\n executionId: payload.wildoApplicationActorSystemExecutionId ?? null,\n clearExecutionLink: payload.clearExecutionLink === true,\n },\n });\n throw error;\n }\n }\n\n /**\n * Companion executions live in the shared apps-manager DB, but every local\n * companion instance is still attached to exactly one Wildo application row.\n * Resolving and memoizing that ownership keeps all repository calls scoped to\n * the truthful platform parent instead of falling back to tenant-app semantics.\n */\n /**\n * Announce a control-plane row the companion wrote REPOSITORY-DIRECT (issue #286).\n *\n * ## Why these writes were silent\n *\n * The engine emits `RESOURCE_UPDATED` from its resource CONTROLLERS, after the operation commits.\n * These rows never pass through one: the companion writes them straight to the repository inside\n * its own transaction, which is deliberate (they are control-plane records, and their CREATE and\n * UPDATE variants are `REPOSITORY_ONLY` precisely so no generated write API exists). The cost was\n * that nothing ever announced them: a board watching actor tasks or executions learned about a\n * new row only from a 30-second poll, and a SECOND browser learned nothing at all, because the\n * only invalidation was one the dispatching page emitted to itself.\n *\n * ## The ORGANIZATION room, and why not the application room\n *\n * These resources declare `isPrimaryScope: true` on their ORGANIZATIONS relationship, so a row\n * belongs to one tenant. Broadcasting to the application room — which the sibling introspection\n * notifier legitimately uses, because every resource IT serves is APPLICATION-anchored — would\n * carry one tenant's row ids to every user of the application. The room is keyed on the row's own\n * `organizationId`, which the ownership resolution has already established for the write itself.\n *\n * ## Notification-grade, and after COMMIT\n *\n * Registered as a post-commit effect: announcing a row inside the transaction would advertise a\n * write that can still roll back. The payload carries no `currentObject` — a scope room fans out\n * to every member, and these rows carry coding-agent input and output that a collection event has\n * no business broadcasting. Subscribers learn WHAT moved and refetch through their own\n * authorization, which is the same contract the introspection notifier's collection lane uses.\n *\n * Failure is swallowed by design: an announcement that could fail a committed write would make a\n * notification defect look like a persistence defect.\n */\n private publishControlPlaneMutation(\n /** `null` for a write that was not wrapped in a transaction — it is already committed. */\n transaction: unknown | null,\n resourceType: string,\n ownership: CompanionExecutionOwnership,\n resourceId: string,\n action: ResourceAction,\n ): void {\n if (!resourceId) return;\n const announce = async (): Promise<void> => {\n {\n try {\n const notification = buildControlPlaneMutationNotification(resourceType, ownership, resourceId, action);\n this.websocketService.emitToScopeRooms(\n notification.resourceType,\n notification.rooms,\n notification.event,\n buildScopeRoomNotificationPayload(notification.payload),\n );\n } catch (error) {\n this.logger.warn?.(\n `[CompanionExecutions] Could not announce ${resourceType} ${resourceId}: `\n + `${error instanceof Error ? error.message : String(error)}`,\n );\n }\n }\n };\n if (transaction === null) {\n void announce();\n return;\n }\n registerTransactionPostCommitEffect(transaction as never, {\n key: `control-plane-notify:${resourceType}:${resourceId}:${action}`,\n execute: announce,\n });\n }\n\n private async resolveOwnership(sessionContext?: CompanionExecutionSessionContext): Promise<CompanionExecutionOwnership> {\n if (!this.ownershipPromise) {\n const ownershipPromise = this.loadOwnership(sessionContext).catch((error) => {\n if (this.ownershipPromise === ownershipPromise) {\n this.ownershipPromise = undefined;\n }\n\n throw error;\n });\n this.ownershipPromise = ownershipPromise;\n }\n\n return this.ownershipPromise;\n }\n\n private async loadOwnership(sessionContext?: CompanionExecutionSessionContext): Promise<CompanionExecutionOwnership> {\n const traceStep = sessionContext\n ? this.traceabilityService.createStep(sessionContext, {\n kind: \"execution-ownership\",\n label: \"resolve-companion-execution-ownership\",\n })\n : undefined;\n\n await this.traceOperationStart({\n sessionContext,\n step: traceStep,\n type: \"execution-ownership-resolution-start\",\n summary: \"Resolve companion execution ownership\",\n payload: {\n appSlug: this.companionContext.saasConfig.slug,\n },\n artifactFileName: \"execution-ownership-resolution-request.json\",\n artifactContent: {\n appSlug: this.companionContext.saasConfig.slug,\n },\n });\n\n try {\n const repository = this.repositoriesRegistry.getRepositoryOrThrow(CustomShared_ResourceType.WILDO_APPLICATION);\n const executionContext = await this.createInternalExecutionContext(\n CustomShared_ResourceType.WILDO_APPLICATION,\n CoreResourceOperation.READ,\n sessionContext,\n );\n const wildoApplication = await repository.read<Wildo_Application>(executionContext, {\n appSlug: this.companionContext.saasConfig.slug,\n });\n\n if (!wildoApplication) {\n throw this.errorBuilder.buildError(ErrorType.NOT_FOUND, undefined, {\n customMessageReference: ErrorCustomMessageReference.NOT_FOUND,\n context: {\n message: \"Companion app is not registered in the platform Wildo applications collection.\",\n appSlug: this.companionContext.saasConfig.slug,\n },\n });\n }\n\n this.logDebug(\"Resolved companion execution ownership\", {\n appSlug: this.companionContext.saasConfig.slug,\n organizationId: wildoApplication.organizationId,\n wildoApplicationId: wildoApplication._id,\n });\n\n const ownership = {\n organizationId: wildoApplication.organizationId,\n wildoApplicationId: wildoApplication._id,\n };\n\n await this.traceOperationSuccess({\n sessionContext,\n step: traceStep,\n type: \"execution-ownership-resolution-success\",\n summary: `Resolved companion execution ownership for ${this.companionContext.saasConfig.slug}`,\n payload: ownership,\n artifactFileName: \"execution-ownership-resolution-result.json\",\n artifactContent: {\n appSlug: this.companionContext.saasConfig.slug,\n ...ownership,\n },\n });\n\n return ownership;\n } catch (error) {\n await this.traceOperationFailure({\n sessionContext,\n step: traceStep,\n type: \"execution-ownership-resolution-failure\",\n summary: \"Failed to resolve companion execution ownership\",\n error,\n payload: {\n appSlug: this.companionContext.saasConfig.slug,\n },\n });\n throw error;\n }\n }\n\n /**\n * Builds an unattributed internal execution context for the companion's\n * control-plane reads/writes through the engine's REPOSITORY_ONLY-safe seam.\n * `createForInternalRepositoryOperation` resolves the operation path with a\n * repository-preferred (URL-fallback) resolver — the previous hand-rolled\n * `getOperationPathDefault → createForInternalOperation` pair used the\n * URL-only resolver and threw `RESOURCES_REGISTRY_OPERATION_PATH_NOT_FOUND`\n * for REPOSITORY_ONLY-only resources (migrated 2026-07-02, meta-workflows\n * Step 0 / P-12; the engine seam's JSDoc names this exact pattern).\n */\n /**\n * The `contextResourcesFieldIdentifier` map stays EMPTY on purpose. It\n * looks like the natural channel for the ownership FKs, but the engine's\n * context-map enrichment injects into EVERY schema path ending with the\n * field identifier — including `errorStates.errorItems[].initiatorIds.\n * organizationId` inside the embedded `WildoError_BackendSchema` — and\n * `setNestedValue` then fabricates a phantom error item that fails\n * Mongoose validation (observed live, 2026-07-03). The scope FK the strict\n * request-DTO parse strips (`organizationId`) is instead re-attached via\n * `RepositoryOptions.preserveServerInjectedFields`, derived per write by\n * {@link deriveServerInjectedPreserveFields}.\n */\n private async createInternalExecutionContext(\n resourceType: ResourceType,\n operationIdentifier: CoreResourceOperation,\n sessionContext?: CompanionExecutionSessionContext,\n ): Promise<ExecutionContext<any>> {\n const executionContext = await this.executionContextCreator.createForInternalRepositoryOperation({\n resourceType,\n operationIdentifier,\n contextResourcesFieldIdentifier: new Map(),\n initiatorIds: null,\n initiatorRoles: [],\n relationshipContexts: [],\n });\n if (sessionContext) {\n await this.traceInternalExecutionContext(sessionContext, executionContext, resourceType, operationIdentifier);\n }\n return executionContext;\n }\n\n /**\n * The row type is pinned through the repository handle's `TMainSchema`, NOT\n * through `list<T>` — and the difference is not cosmetic.\n *\n * `BackendResourceRepository.list<T>` returns\n * `ConditionalArrayReturnType<T, TMainSchema>`, i.e.\n * `T extends undefined ? z.infer<TMainSchema>[] : T[]`. That conditional can\n * only be evaluated when `T` is a CONCRETE type. Here `TExecution` is an\n * uninstantiated type parameter of this relay, so TypeScript defers the\n * conditional and falls back to its constraint — `unknown[]` — which is then\n * not assignable to `TExecution[]`. The sibling call sites in this file\n * (`list<Wildo_Application_Actor_Task>`) pass a concrete type, resolve the\n * false branch immediately, and are unaffected; this is the only generic\n * relay over a repository read in the companion.\n *\n * So the row shape is declared where the contract expects it: on the\n * repository handle. `list()` then takes its default `T = undefined`, the\n * conditional resolves eagerly to `z.infer<z.ZodType<TExecution>>[]` =\n * `TExecution[]`, and the value flows through with no cast.\n *\n * Rejected: `as unknown as TExecution[]` at the return. The correlation\n * between `resourceType` and `TExecution` is asserted by the caller either\n * way, but a value-level cast puts that assertion where nothing can see it,\n * and it would keep `left`/`right` typed `unknown` inside the comparator —\n * re-breaking the moment the sort key changes.\n */\n private async listExecutions<TExecution extends { updatedAt: string }>(\n resourceType: typeof WILDO_APPLICATION_ACTOR_SYSTEM_EXECUTIONS_RESOURCE_TYPE | typeof WILDO_APPLICATION_FLOW_SYSTEM_EXECUTIONS_RESOURCE_TYPE,\n query: CompanionExecutionsListQuery,\n sessionContext?: CompanionExecutionSessionContext,\n ): Promise<TExecution[]> {\n const ownership = await this.resolveOwnership(sessionContext);\n const repository = this.repositoriesRegistry.getRepositoryOrThrow<undefined, undefined, z.ZodType<TExecution>>(resourceType);\n const executionContext = await this.createInternalExecutionContext(resourceType, CoreResourceOperation.LIST, sessionContext);\n const executions = await repository.list(executionContext, {\n wildoApplicationId: ownership.wildoApplicationId,\n ...(query.systemRef ? { systemRef: query.systemRef } : {}),\n ...(query.status ? { status: query.status } : {}),\n });\n\n return executions.sort((left, right) => right.updatedAt.localeCompare(left.updatedAt)).slice(0, query.limit);\n }\n\n private async persistExecutionTasks(\n ownership: CompanionExecutionOwnership,\n executionId: string,\n tasks: CompanionCreateActorExecutionRequest[\"standaloneTasks\"],\n standaloneTaskStates: CompanionCreateActorExecutionRequest[\"standaloneTaskStates\"],\n transaction?: TransactionContext,\n sessionContext?: CompanionExecutionSessionContext,\n ): Promise<PersistedExecutionTask[]> {\n const repository = this.repositoriesRegistry.getRepositoryOrThrow(WILDO_APPLICATION_ACTOR_TASKS_RESOURCE_TYPE);\n const executionContext = await this.createInternalExecutionContext(\n WILDO_APPLICATION_ACTOR_TASKS_RESOURCE_TYPE,\n CoreResourceOperation.CREATE,\n sessionContext,\n );\n\n const persistedTasks: PersistedExecutionTask[] = [];\n\n for (const task of tasks) {\n const taskState = standaloneTaskStates.find((item) => item.taskId === task._id);\n const createData = {\n ...this.normalizeTaskCreatePayload({\n ...task,\n status: taskState?.status ?? task.status,\n updatedAt: taskState?.updatedAt ?? task.updatedAt,\n wildoApplicationActorSystemExecutionId: executionId,\n }),\n organizationId: ownership.organizationId,\n wildoApplicationId: ownership.wildoApplicationId,\n wildoApplicationActorSystemExecutionId: executionId,\n };\n const persistedTask = await repository.create<Wildo_Application_Actor_Task>(executionContext, createData, {\n ...this.buildRepositoryOptions(transaction),\n preserveServerInjectedFields: this.deriveServerInjectedPreserveFields(\n WILDO_APPLICATION_ACTOR_TASKS_RESOURCE_TYPE,\n createData,\n CoreResourceOperation.CREATE,\n ),\n });\n\n persistedTasks.push({\n sourceTaskId: task._id,\n task: persistedTask,\n });\n }\n\n return persistedTasks;\n }\n\n private async updateActorExecutionTaskSnapshot(\n execution: Wildo_Application_ActorSystem_Execution,\n ownership: CompanionExecutionOwnership,\n tasks: Wildo_Application_Actor_Task[],\n transaction?: TransactionContext,\n standaloneTaskStatesOverride?: Wildo_Application_ActorSystem_Execution[\"standaloneTaskStates\"],\n sessionContext?: CompanionExecutionSessionContext,\n ): Promise<Wildo_Application_ActorSystem_Execution> {\n const repository = this.repositoriesRegistry.getRepositoryOrThrow(WILDO_APPLICATION_ACTOR_SYSTEM_EXECUTIONS_RESOURCE_TYPE);\n const executionContext = await this.createInternalExecutionContext(\n WILDO_APPLICATION_ACTOR_SYSTEM_EXECUTIONS_RESOURCE_TYPE,\n CoreResourceOperation.UPDATE,\n sessionContext,\n );\n const updatedAt = new Date().toISOString();\n\n return repository.update<Wildo_Application_ActorSystem_Execution>(\n executionContext,\n { _id: execution._id, wildoApplicationId: ownership.wildoApplicationId },\n {\n standaloneTasks: tasks,\n standaloneTaskStates: standaloneTaskStatesOverride ?? this.buildStandaloneTaskStates(tasks, execution.standaloneTaskStates),\n updatedAt,\n },\n this.buildRepositoryOptions(transaction),\n );\n }\n\n private async syncTaskIntoExecutionSnapshot(\n task: Wildo_Application_Actor_Task,\n transaction?: TransactionContext,\n sessionContext?: CompanionExecutionSessionContext,\n ): Promise<void> {\n if (!task.wildoApplicationActorSystemExecutionId) {\n return;\n }\n\n const repository = this.repositoriesRegistry.getRepositoryOrThrow(WILDO_APPLICATION_ACTOR_SYSTEM_EXECUTIONS_RESOURCE_TYPE);\n const executionContext = await this.createInternalExecutionContext(\n WILDO_APPLICATION_ACTOR_SYSTEM_EXECUTIONS_RESOURCE_TYPE,\n CoreResourceOperation.READ,\n sessionContext,\n );\n const execution = await repository.read<Wildo_Application_ActorSystem_Execution>(\n executionContext,\n {\n _id: task.wildoApplicationActorSystemExecutionId,\n wildoApplicationId: task.wildoApplicationId,\n },\n this.buildRepositoryOptions(transaction),\n );\n\n if (!execution) {\n throw this.errorBuilder.buildError(ErrorType.NOT_FOUND, undefined, {\n customMessageReference: ErrorCustomMessageReference.NOT_FOUND,\n context: {\n message: \"Actor task references a missing persisted actor execution.\",\n taskId: task._id,\n wildoApplicationActorSystemExecutionId: task.wildoApplicationActorSystemExecutionId,\n appSlug: this.companionContext.saasConfig.slug,\n },\n });\n }\n\n await this.updateActorExecutionTaskSnapshot(\n execution,\n {\n organizationId: task.organizationId,\n wildoApplicationId: task.wildoApplicationId,\n },\n this.upsertTask(execution.standaloneTasks as Wildo_Application_Actor_Task[], task),\n transaction,\n undefined,\n sessionContext,\n );\n }\n\n private async removeTaskFromExecutionSnapshot(\n task: Pick<Wildo_Application_Actor_Task, \"_id\" | \"organizationId\" | \"wildoApplicationId\" | \"wildoApplicationActorSystemExecutionId\">,\n transaction?: TransactionContext,\n sessionContext?: CompanionExecutionSessionContext,\n ): Promise<void> {\n if (!task.wildoApplicationActorSystemExecutionId) {\n return;\n }\n\n const repository = this.repositoriesRegistry.getRepositoryOrThrow(WILDO_APPLICATION_ACTOR_SYSTEM_EXECUTIONS_RESOURCE_TYPE);\n const readExecutionContext = await this.createInternalExecutionContext(\n WILDO_APPLICATION_ACTOR_SYSTEM_EXECUTIONS_RESOURCE_TYPE,\n CoreResourceOperation.READ,\n sessionContext,\n );\n const execution = await repository.read<Wildo_Application_ActorSystem_Execution>(\n readExecutionContext,\n {\n _id: task.wildoApplicationActorSystemExecutionId,\n wildoApplicationId: task.wildoApplicationId,\n },\n this.buildRepositoryOptions(transaction),\n );\n\n if (!execution) {\n return;\n }\n\n await this.updateActorExecutionTaskSnapshot(\n execution,\n {\n organizationId: task.organizationId,\n wildoApplicationId: task.wildoApplicationId,\n },\n (execution.standaloneTasks as Wildo_Application_Actor_Task[]).filter((item) => item._id !== task._id),\n transaction,\n undefined,\n sessionContext,\n );\n }\n\n private async readActorTaskOrThrow(\n taskId: string,\n transaction?: TransactionContext,\n sessionContext?: CompanionExecutionSessionContext,\n ): Promise<Wildo_Application_Actor_Task> {\n const ownership = await this.resolveOwnership(sessionContext);\n const repository = this.repositoriesRegistry.getRepositoryOrThrow(WILDO_APPLICATION_ACTOR_TASKS_RESOURCE_TYPE);\n const executionContext = await this.createInternalExecutionContext(WILDO_APPLICATION_ACTOR_TASKS_RESOURCE_TYPE, CoreResourceOperation.READ, sessionContext);\n const task = await repository.read<Wildo_Application_Actor_Task>(\n executionContext,\n { _id: taskId, wildoApplicationId: ownership.wildoApplicationId },\n this.buildRepositoryOptions(transaction),\n );\n\n if (!task) {\n throw this.buildTaskNotFoundError(taskId);\n }\n\n return task;\n }\n\n private async readActorExecutionOrThrow(\n executionId: string,\n wildoApplicationId: string,\n transaction?: TransactionContext,\n sessionContext?: CompanionExecutionSessionContext,\n ): Promise<Wildo_Application_ActorSystem_Execution> {\n const repository = this.repositoriesRegistry.getRepositoryOrThrow(WILDO_APPLICATION_ACTOR_SYSTEM_EXECUTIONS_RESOURCE_TYPE);\n const executionContext = await this.createInternalExecutionContext(\n WILDO_APPLICATION_ACTOR_SYSTEM_EXECUTIONS_RESOURCE_TYPE,\n CoreResourceOperation.READ,\n sessionContext,\n );\n const execution = await repository.read<Wildo_Application_ActorSystem_Execution>(\n executionContext,\n { _id: executionId, wildoApplicationId },\n this.buildRepositoryOptions(transaction),\n );\n\n if (!execution) {\n throw this.buildExecutionNotFoundError(FlowsActors_ElementKind.ACTOR,executionId);\n }\n\n return execution;\n }\n\n private async listActorExecutionTasks(\n ownership: CompanionExecutionOwnership,\n executionId: string,\n transaction?: TransactionContext,\n ): Promise<Wildo_Application_Actor_Task[]> {\n const repository = this.repositoriesRegistry.getRepositoryOrThrow(WILDO_APPLICATION_ACTOR_TASKS_RESOURCE_TYPE);\n const executionContext = await this.createInternalExecutionContext(WILDO_APPLICATION_ACTOR_TASKS_RESOURCE_TYPE, CoreResourceOperation.LIST);\n return repository.list<Wildo_Application_Actor_Task>(\n executionContext,\n {\n wildoApplicationId: ownership.wildoApplicationId,\n wildoApplicationActorSystemExecutionId: executionId,\n },\n this.buildRepositoryOptions(transaction),\n );\n }\n\n private async traceInternalExecutionContext(\n sessionContext: CompanionExecutionSessionContext,\n executionContext: ExecutionContext<any>,\n resourceType: ResourceType,\n operationIdentifier: CoreResourceOperation,\n ): Promise<void> {\n const serializedExecutionContext = ResourceSerializationUtils.deserializeExecutionContextData(\n ResourceSerializationUtils.serializeExecutionContext({\n executionType: executionContext.executionType,\n initiatorIds: executionContext.initiatorIds,\n initiatorRoles: [...executionContext.initiatorRoles],\n getContextResourceIds: () => executionContext.getContextResourceIds(),\n relationshipContexts: [...executionContext.relationshipContexts],\n }),\n );\n /*\n * The EC reshape removed `requestUUID` from the platform JWT claims; `correlationId` is the per-request\n * identifier now. Mapped here rather than renamed downstream on purpose: `requestUUID` is a field of the\n * traceability contract (`CompanionExecutionContextArtifactRef`), which dedupes artifacts on it, so renaming it\n * is a change to that model and its tests — a separate decision from unbreaking this build.\n */\n const requestUUID = executionContext.toExecutionContextPlatformJwtClaims().correlationId;\n const fileName = `${resourceType}-${operationIdentifier}-${requestUUID}-execution-context.json`;\n\n await this.traceabilityService.traceEvent({\n session: sessionContext,\n minimumLevel: CompanionTraceabilityLevel.DEBUG,\n type: \"internal-execution-context-created\",\n summary: `Created internal execution context for ${resourceType}.${operationIdentifier}`,\n payload: {\n resourceType,\n operationIdentifier,\n requestUUID,\n },\n });\n const artifactPersisted = await this.traceabilityService.writeArtifact({\n session: sessionContext,\n minimumLevel: CompanionTraceabilityLevel.DEBUG_VERBOSE,\n fileName,\n content: {\n resourceType,\n operationIdentifier,\n requestUUID,\n serializedExecutionContext,\n },\n });\n if (artifactPersisted) {\n await this.traceabilityService.recordExecutionContextArtifact(sessionContext, {\n requestUUID,\n resourceType,\n operationIdentifier,\n fileName,\n recordedAt: new Date().toISOString(),\n });\n }\n }\n\n private createOperationTraceStep(sessionContext: CompanionExecutionSessionContext | undefined, label: string) {\n return sessionContext\n ? this.traceabilityService.createStep(sessionContext, {\n kind: \"execution-persistence\",\n label,\n })\n : undefined;\n }\n\n private async traceOperationStart(input: {\n sessionContext?: CompanionExecutionSessionContext;\n step?: ReturnType<CompanionTraceabilityService[\"createStep\"]>;\n type: string;\n summary: string;\n payload?: unknown;\n artifactFileName?: string;\n artifactContent?: unknown;\n }): Promise<void> {\n if (!input.sessionContext) {\n return;\n }\n\n await this.traceabilityService.traceEvent({\n session: input.sessionContext,\n minimumLevel: CompanionTraceabilityLevel.DEBUG,\n type: input.type,\n summary: input.summary,\n ...(input.payload !== undefined ? { payload: input.payload } : {}),\n ...(input.step ? { step: input.step } : {}),\n });\n if (input.artifactFileName && input.artifactContent !== undefined) {\n await this.traceabilityService.writeArtifact({\n session: input.sessionContext,\n minimumLevel: CompanionTraceabilityLevel.DEBUG_VERBOSE,\n fileName: input.artifactFileName,\n content: input.artifactContent,\n ...(input.step ? { step: input.step } : {}),\n });\n }\n }\n\n private async traceOperationSuccess(input: {\n sessionContext?: CompanionExecutionSessionContext;\n step?: ReturnType<CompanionTraceabilityService[\"createStep\"]>;\n type: string;\n summary: string;\n payload?: unknown;\n artifactFileName?: string;\n artifactContent?: unknown;\n }): Promise<void> {\n if (!input.sessionContext) {\n return;\n }\n\n if (input.artifactFileName && input.artifactContent !== undefined) {\n await this.traceabilityService.writeArtifact({\n session: input.sessionContext,\n minimumLevel: CompanionTraceabilityLevel.DEBUG_VERBOSE,\n fileName: input.artifactFileName,\n content: input.artifactContent,\n ...(input.step ? { step: input.step } : {}),\n });\n }\n await this.traceabilityService.traceEvent({\n session: input.sessionContext,\n minimumLevel: CompanionTraceabilityLevel.DEBUG,\n type: input.type,\n summary: input.summary,\n ...(input.payload !== undefined ? { payload: input.payload } : {}),\n ...(input.step ? { step: input.step } : {}),\n });\n }\n\n private async traceOperationFailure(input: {\n sessionContext?: CompanionExecutionSessionContext;\n step?: ReturnType<CompanionTraceabilityService[\"createStep\"]>;\n type: string;\n summary: string;\n error: unknown;\n payload?: unknown;\n }): Promise<void> {\n if (!input.sessionContext) {\n return;\n }\n\n await this.traceabilityService.traceEvent({\n session: input.sessionContext,\n minimumLevel: CompanionTraceabilityLevel.DEBUG,\n type: input.type,\n summary: input.summary,\n payload: {\n ...(input.payload && typeof input.payload === \"object\" ? (input.payload as Record<string, unknown>) : { input: input.payload }),\n error: this.buildTraceErrorPayload(input.error),\n },\n ...(input.step ? { step: input.step } : {}),\n });\n }\n\n private buildTraceErrorPayload(error: unknown) {\n if (isWildoBackendError(error)) {\n return error;\n }\n\n if (error instanceof Error) {\n return {\n message: error.message,\n name: error.name,\n ...(error.stack ? { stack: error.stack } : {}),\n };\n }\n\n return {\n message: String(error),\n };\n }\n\n private async unsetActorTaskFields(\n taskId: string,\n wildoApplicationId: string,\n fieldsToUnset: Partial<Record<\"completedAt\" | \"wildoApplicationActorSystemExecutionId\", 1>>,\n transaction?: TransactionContext,\n ): Promise<void> {\n const fieldEntries = Object.entries(fieldsToUnset);\n if (fieldEntries.length === 0) {\n return;\n }\n\n /*\n * ADAPTER-NEUTRAL on purpose, and the previous body is the cautionary tale: it reached\n * `mongooseModel.findOneAndUpdate` + `getNativeSession` directly, which exists only on the\n * MongoDB repository — on a PostgreSQL-backed application (wonder-crm) the call threw\n * `repository.getNativeSession is not a function`, the interactive lane's park-persistence\n * write died on it, and the failure handler then recorded the whole parked run as\n * `agent_execution_failed`, destroying the suspension the restart-durability door needed\n * (measured 2026-09-04, first live park on PG). `atomicConditionalSet` is on the repository\n * CONTRACT — an adapter that cannot compile it fails to build — and its `clearFields` is\n * exactly the unset: `$unset` on MongoDB, `SET col = NULL` (+ read-path omission) on PG.\n */\n const repository = this.repositoriesRegistry.getRepositoryOrThrow(WILDO_APPLICATION_ACTOR_TASKS_RESOURCE_TYPE) as unknown as {\n atomicConditionalSet: (\n filter: Record<string, unknown>,\n setFields: Record<string, unknown> | undefined,\n clearFields: readonly string[] | undefined,\n options?: CompanionRepositoryOptions,\n ) => Promise<unknown>;\n };\n await repository.atomicConditionalSet(\n { _id: taskId, wildoApplicationId },\n undefined,\n fieldEntries.map(([field]) => field),\n this.buildRepositoryOptions(transaction),\n );\n }\n\n private buildRepositoryOptions(transaction?: TransactionContext): CompanionRepositoryOptions | undefined {\n return transaction ? { transaction } : undefined;\n }\n\n /**\n * Compute the repository-write re-attach allowlist for a server-authored\n * payload — the SAME schema-derived set the engine's application-tier trusted\n * writes use ({@link deriveTrustedSystemWritePreservedFields}).\n *\n * WHY the companion needs it: every `repository.create/update` strict-parses\n * the payload against the resource's client-shaped request DTO, which omits\n * two field classes — `.isBackendOnly()` material and the context-auto-populated\n * scope/audit FKs (`CONTEXT_AUTO_POPULATED_FIELD_IDENTIFIERS`, stripped by NAME).\n * For these platform-persistence resources the only such field the companion\n * authors is `organizationId` (the ORGANIZATIONS primary-scope FK): on an\n * HTTP write it would be re-injected from the request context AFTER the parse,\n * but the companion's system-context writes have no request context, so without\n * this the strip silently drops it and the row fails Mongoose required-field\n * validation. `RepositoryOptions.preserveServerInjectedFields` re-attaches\n * exactly the derived keys after the parse.\n *\n * WHY it is DERIVED, not a hard-coded list: deriving from the registered\n * `mainSchema` is the single source of truth shared with the engine seam, so a\n * future schema change (a new backend-only field, an added scope FK) is covered\n * automatically. The other server-injected FKs (`wildoApplicationId`, the\n * `wildoApplicationActorSystemExecutionId` execution link) are ordinary\n * `.isForeignKey()` relationship fields that the request DTO does NOT strip —\n * they parse through normally — so the derivation correctly excludes them.\n *\n * TIER NOTE: the companion executions plane is local-platform-tier repository\n * CRUD (it never stands up the application `ServicesRegistryHandler`), so it\n * reuses the engine's DERIVATION helper directly at the repository tier rather\n * than routing through the application-services-tier\n * `SystemAccessBackendService.createAsSystem`/`updateAsSystem` (which resolve a\n * service/URL operation path these `REPOSITORY_ONLY` resources do not declare).\n */\n private deriveServerInjectedPreserveFields(\n resourceType: ResourceType,\n data: Record<string, unknown>,\n verb: CoreResourceOperation.CREATE | CoreResourceOperation.UPDATE | CoreResourceOperation.UPDATE_MANY,\n ): string[] {\n const config = this.resourcesRegistry.getResourceConfiguration(resourceType);\n return deriveTrustedSystemWritePreservedFields(config.mainSchema, Object.keys(data), verb);\n }\n\n private assertStandaloneTaskStateConsistency(payload: Pick<CompanionCreateActorExecutionRequest, \"standaloneTasks\" | \"standaloneTaskStates\">): void {\n const seenTaskIds = new Set<string>();\n for (const task of payload.standaloneTasks) {\n if (seenTaskIds.has(task._id)) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: {\n message: \"Actor execution payload contains duplicate standalone task ids.\",\n taskId: task._id,\n },\n });\n }\n\n seenTaskIds.add(task._id);\n }\n\n for (const taskState of payload.standaloneTaskStates) {\n if (!seenTaskIds.has(taskState.taskId)) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: {\n message: \"Actor execution task states must reference a declared standalone task.\",\n taskId: taskState.taskId,\n },\n });\n }\n }\n }\n\n\n private normalizeTaskCreatePayload(payload: CompanionCreateActorTaskRequest): Omit<\n CompanionCreateActorTaskRequest,\n \"wildoApplicationActorSystemExecutionId\"\n > & {\n createdAt: string;\n updatedAt: string;\n completedAt?: string;\n actorStates: Wildo_Application_Actor_Task[\"actorStates\"];\n } {\n const {\n completedAt: _completedAt,\n wildoApplicationActorSystemExecutionId: _wildoApplicationActorSystemExecutionId,\n ...payloadWithoutManagedFields\n } = payload;\n const now = new Date().toISOString();\n const createdAt = payload.createdAt ?? now;\n const updatedAt = payload.updatedAt ?? createdAt;\n const actorStates =\n payload.actorStates.length > 0\n ? payload.actorStates\n : [\n {\n actorRef: payload.actors.actorRef,\n status: payload.status,\n updatedAt,\n statusChanges: [{ status: payload.status, timestamp: updatedAt }],\n },\n ];\n const completedAt = this.isTerminalStatus(payload.status) ? (payload.completedAt ?? updatedAt) : undefined;\n\n return {\n ...payloadWithoutManagedFields,\n createdAt,\n updatedAt,\n actorStates,\n ...(completedAt ? { completedAt } : {}),\n };\n }\n\n private buildPersistedStandaloneTaskStates(\n persistedTasks: PersistedExecutionTask[],\n sourceStates: CompanionCreateActorExecutionRequest[\"standaloneTaskStates\"],\n ): Wildo_Application_ActorSystem_Execution[\"standaloneTaskStates\"] {\n const statesBySourceTaskId = new Map<string, CompanionCreateActorExecutionRequest[\"standaloneTaskStates\"][number]>(\n sourceStates.map((item) => [item.taskId, item]),\n );\n\n return persistedTasks.map(({ sourceTaskId, task }) => {\n const sourceState = statesBySourceTaskId.get(sourceTaskId);\n const updatedAt = this.toStrictIsoDatetime(task.updatedAt);\n\n return {\n taskId: task._id,\n status: task.status,\n updatedAt,\n statusChanges: sourceState?.statusChanges?.length\n ? sourceState.statusChanges.map((change) => ({\n status: change.status,\n timestamp: this.toStrictIsoDatetime(change.timestamp),\n }))\n : [{ status: task.status, timestamp: updatedAt }],\n };\n });\n }\n\n /**\n * Normalize a persisted timestamp to the STRICT ISO-8601 form the execution\n * contract requires. Control-plane resources (actor tasks/executions) get\n * their `createdAt`/`updatedAt` from Mongoose auto-timestamps, which write a\n * `Date` into the STRING-typed field — Mongoose then casts it with\n * `Date.prototype.toString()`, producing a locale form (\"Wed Jul 08 2026\n * 06:16:36 GMT+0200 (Central European Summer Time)\"). The task schema's own\n * `updatedAt` (`z.string().refine(Date.parse)`) tolerates that, but the\n * execution's `standaloneTaskStates[].updatedAt` / `statusChanges[].timestamp`\n * are strict `z.iso.datetime()` (Z-suffixed) and REJECT it — so projecting a\n * raw `task.updatedAt` into a standalone-task-state write fails validation.\n * The companion owns the task→execution projection, so it normalizes here at\n * that loose→strict boundary. `Date.parse` accepts both the locale and ISO\n * forms; the `NaN` fallback (never hit for real persisted rows) keeps a bad\n * source from throwing. NOTE (flagged for the engine layer): the underlying\n * locale-string storage also breaks the `updatedAt.localeCompare` ordering\n * used for run-recency — the deeper fix is to store ISO in the DB.\n */\n private toStrictIsoDatetime(value: string): string {\n const parsed = Date.parse(value);\n return Number.isNaN(parsed) ? new Date().toISOString() : new Date(parsed).toISOString();\n }\n\n private buildStandaloneTaskStates(\n tasks: Array<Pick<Wildo_Application_Actor_Task, \"_id\" | \"status\" | \"updatedAt\">>,\n existingStates: Wildo_Application_ActorSystem_Execution[\"standaloneTaskStates\"],\n ): Wildo_Application_ActorSystem_Execution[\"standaloneTaskStates\"] {\n const statesByTaskId = new Map<string, Wildo_Application_ActorSystem_Execution[\"standaloneTaskStates\"][number]>(\n existingStates.map((item) => [item.taskId, item]),\n );\n\n return tasks.map((task) => {\n const updatedAt = this.toStrictIsoDatetime(task.updatedAt);\n const existingState = statesByTaskId.get(task._id);\n const statusChanges = existingState?.statusChanges ?? [];\n const lastStatus = statusChanges[statusChanges.length - 1]?.status;\n const nextStatusChanges = lastStatus === task.status ? statusChanges : [...statusChanges, { status: task.status, timestamp: updatedAt }];\n\n return {\n taskId: task._id,\n status: task.status,\n updatedAt,\n statusChanges: nextStatusChanges.length > 0 ? nextStatusChanges : [{ status: task.status, timestamp: updatedAt }],\n };\n });\n }\n\n private upsertTask(tasks: Wildo_Application_Actor_Task[], task: Wildo_Application_Actor_Task): Wildo_Application_Actor_Task[] {\n const existingIndex = tasks.findIndex((item) => item._id === task._id);\n if (existingIndex === -1) {\n return [...tasks, task];\n }\n\n return tasks.map((item) => (item._id === task._id ? task : item));\n }\n\n private normalizeCreateEnvelope<TPayload extends ExecutionCreateEnvelope>(\n payload: TPayload,\n ): Pick<TPayload, \"statusChanges\" | \"createdAt\" | \"updatedAt\" | \"finishedAt\"> {\n const now = new Date().toISOString();\n const createdAt = payload.createdAt ?? now;\n const updatedAt = payload.updatedAt ?? createdAt;\n const statusChanges = payload.statusChanges.length > 0 ? payload.statusChanges : [{ status: payload.status, timestamp: createdAt }];\n const finishedAt = this.isTerminalStatus(payload.status) ? (payload.finishedAt ?? updatedAt) : undefined;\n\n return {\n statusChanges,\n createdAt,\n updatedAt,\n ...(finishedAt ? { finishedAt } : {}),\n };\n }\n\n private isTerminalStatus(status: FlowsActors_Status): boolean {\n return [FlowsActors_Status.COMPLETED, FlowsActors_Status.FAILED, FlowsActors_Status.CANCELLED, FlowsActors_Status.ABORTED].includes(status);\n }\n\n /**\n * The `kind` derives from the canonical `FlowsActors_ElementKind` vocabulary\n * and is narrowed to the two element kinds that have persisted executions —\n * its string value is interpolated into the user-facing message below.\n */\n private buildExecutionNotFoundError(kind: FlowsActors_ElementKind.ACTOR | FlowsActors_ElementKind.FLOW, executionId: string) {\n return this.errorBuilder.buildError(ErrorType.NOT_FOUND, undefined, {\n customMessageReference: ErrorCustomMessageReference.NOT_FOUND,\n context: {\n message: `No persisted ${kind} execution exists for this companion app.`,\n executionId,\n appSlug: this.companionContext.saasConfig.slug,\n },\n });\n }\n\n private buildTaskNotFoundError(taskId: string) {\n return this.errorBuilder.buildError(ErrorType.NOT_FOUND, undefined, {\n customMessageReference: ErrorCustomMessageReference.NOT_FOUND,\n context: {\n message: \"No persisted actor task exists for this companion app.\",\n taskId,\n appSlug: this.companionContext.saasConfig.slug,\n },\n });\n }\n}\n"]}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * English (en) — application labels.
3
+ * Primary locale source-of-truth file generated from application context.
4
+ */
5
+ export declare const labels: {
6
+ readonly components: {
7
+ readonly APP_LAYOUTS_MAIN_CONTAINER: {
8
+ readonly zoneEmptyState: "Select an item to see its details here.";
9
+ };
10
+ };
11
+ };
12
+ //# sourceMappingURL=APP_LAYOUTS_MAIN_CONTAINER.en.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"APP_LAYOUTS_MAIN_CONTAINER.en.d.ts","sourceRoot":"","sources":["../../../../../src/i18n/components/APP_LAYOUTS_MAIN_CONTAINER.en.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,MAAM;;;;;;CAMT,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * English (en) — application labels.
3
+ * Primary locale source-of-truth file generated from application context.
4
+ */
5
+ export const labels = {
6
+ "components": {
7
+ "APP_LAYOUTS_MAIN_CONTAINER": {
8
+ "zoneEmptyState": "Select an item to see its details here."
9
+ }
10
+ }
11
+ };
12
+ //# sourceMappingURL=APP_LAYOUTS_MAIN_CONTAINER.en.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"APP_LAYOUTS_MAIN_CONTAINER.en.js","sourceRoot":"","sources":["../../../../../src/i18n/components/APP_LAYOUTS_MAIN_CONTAINER.en.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,YAAY,EAAE;QACZ,4BAA4B,EAAE;YAC5B,gBAAgB,EAAE,yCAAyC;SAC5D;KACF;CACO,CAAC","sourcesContent":["/**\n * English (en) — application labels.\n * Primary locale source-of-truth file generated from application context.\n */\nexport const labels = {\n \"components\": {\n \"APP_LAYOUTS_MAIN_CONTAINER\": {\n \"zoneEmptyState\": \"Select an item to see its details here.\"\n }\n }\n} as const;\n"]}
@@ -14,7 +14,7 @@ export declare const labels: {
14
14
  readonly clear: "Clear selection";
15
15
  readonly displayError: "Unable to display this value.";
16
16
  readonly object: "Item details";
17
- readonly depthLimitReached: "Some details couldn't be displayed.";
17
+ readonly resourceLinkLimitReached: "Further linked records aren't shown here.";
18
18
  readonly list: "List of items";
19
19
  readonly showMore: "Show {count} more";
20
20
  readonly editField: "Edit {label}";