@open-mercato/enterprise 0.7.1-develop.7193.1.910a5b0a1e → 0.7.1-develop.7194.1.ab4fc81f82

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 (962) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/README.md +1 -0
  3. package/dist/index.js +1 -1
  4. package/dist/index.js.map +2 -2
  5. package/dist/modules/agent_orchestrator/acl.js +132 -0
  6. package/dist/modules/agent_orchestrator/acl.js.map +7 -0
  7. package/dist/modules/agent_orchestrator/ai-agents.js +57 -0
  8. package/dist/modules/agent_orchestrator/ai-agents.js.map +7 -0
  9. package/dist/modules/agent_orchestrator/ai-skills.js +48 -0
  10. package/dist/modules/agent_orchestrator/ai-skills.js.map +7 -0
  11. package/dist/modules/agent_orchestrator/ai-tools.js +254 -0
  12. package/dist/modules/agent_orchestrator/ai-tools.js.map +7 -0
  13. package/dist/modules/agent_orchestrator/api/agents/[id]/files/route.js +69 -0
  14. package/dist/modules/agent_orchestrator/api/agents/[id]/files/route.js.map +7 -0
  15. package/dist/modules/agent_orchestrator/api/agents/[id]/metrics/route.js +81 -0
  16. package/dist/modules/agent_orchestrator/api/agents/[id]/metrics/route.js.map +7 -0
  17. package/dist/modules/agent_orchestrator/api/agents/[id]/route.js +154 -0
  18. package/dist/modules/agent_orchestrator/api/agents/[id]/route.js.map +7 -0
  19. package/dist/modules/agent_orchestrator/api/agents/[id]/run/route.js +250 -0
  20. package/dist/modules/agent_orchestrator/api/agents/[id]/run/route.js.map +7 -0
  21. package/dist/modules/agent_orchestrator/api/agents/[id]/settings/route.js +105 -0
  22. package/dist/modules/agent_orchestrator/api/agents/[id]/settings/route.js.map +7 -0
  23. package/dist/modules/agent_orchestrator/api/agents/route.js +114 -0
  24. package/dist/modules/agent_orchestrator/api/agents/route.js.map +7 -0
  25. package/dist/modules/agent_orchestrator/api/artifacts/file/[id]/route.js +64 -0
  26. package/dist/modules/agent_orchestrator/api/artifacts/file/[id]/route.js.map +7 -0
  27. package/dist/modules/agent_orchestrator/api/audit/by-instigator/[humanUserId]/route.js +105 -0
  28. package/dist/modules/agent_orchestrator/api/audit/by-instigator/[humanUserId]/route.js.map +7 -0
  29. package/dist/modules/agent_orchestrator/api/auto-approval/settings/route.js +110 -0
  30. package/dist/modules/agent_orchestrator/api/auto-approval/settings/route.js.map +7 -0
  31. package/dist/modules/agent_orchestrator/api/context-bundles/route.js +88 -0
  32. package/dist/modules/agent_orchestrator/api/context-bundles/route.js.map +7 -0
  33. package/dist/modules/agent_orchestrator/api/corrections/route.js +101 -0
  34. package/dist/modules/agent_orchestrator/api/corrections/route.js.map +7 -0
  35. package/dist/modules/agent_orchestrator/api/eval-assertions/preview/route.js +98 -0
  36. package/dist/modules/agent_orchestrator/api/eval-assertions/preview/route.js.map +7 -0
  37. package/dist/modules/agent_orchestrator/api/eval-assertions/route.js +196 -0
  38. package/dist/modules/agent_orchestrator/api/eval-assertions/route.js.map +7 -0
  39. package/dist/modules/agent_orchestrator/api/eval-cases/[id]/approve/route.js +86 -0
  40. package/dist/modules/agent_orchestrator/api/eval-cases/[id]/approve/route.js.map +7 -0
  41. package/dist/modules/agent_orchestrator/api/eval-cases/[id]/archive/route.js +85 -0
  42. package/dist/modules/agent_orchestrator/api/eval-cases/[id]/archive/route.js.map +7 -0
  43. package/dist/modules/agent_orchestrator/api/eval-cases/[id]/route.js +67 -0
  44. package/dist/modules/agent_orchestrator/api/eval-cases/[id]/route.js.map +7 -0
  45. package/dist/modules/agent_orchestrator/api/eval-cases/export/route.js +78 -0
  46. package/dist/modules/agent_orchestrator/api/eval-cases/export/route.js.map +7 -0
  47. package/dist/modules/agent_orchestrator/api/eval-cases/route.js +140 -0
  48. package/dist/modules/agent_orchestrator/api/eval-cases/route.js.map +7 -0
  49. package/dist/modules/agent_orchestrator/api/eval-runs/[id]/cancel/route.js +67 -0
  50. package/dist/modules/agent_orchestrator/api/eval-runs/[id]/cancel/route.js.map +7 -0
  51. package/dist/modules/agent_orchestrator/api/eval-runs/[id]/case-runs/[caseRunId]/results/route.js +66 -0
  52. package/dist/modules/agent_orchestrator/api/eval-runs/[id]/case-runs/[caseRunId]/results/route.js.map +7 -0
  53. package/dist/modules/agent_orchestrator/api/eval-runs/[id]/route.js +111 -0
  54. package/dist/modules/agent_orchestrator/api/eval-runs/[id]/route.js.map +7 -0
  55. package/dist/modules/agent_orchestrator/api/eval-runs/route.js +157 -0
  56. package/dist/modules/agent_orchestrator/api/eval-runs/route.js.map +7 -0
  57. package/dist/modules/agent_orchestrator/api/eval-scorers/route.js +34 -0
  58. package/dist/modules/agent_orchestrator/api/eval-scorers/route.js.map +7 -0
  59. package/dist/modules/agent_orchestrator/api/executions/[id]/route.js +72 -0
  60. package/dist/modules/agent_orchestrator/api/executions/[id]/route.js.map +7 -0
  61. package/dist/modules/agent_orchestrator/api/executions/route.js +185 -0
  62. package/dist/modules/agent_orchestrator/api/executions/route.js.map +7 -0
  63. package/dist/modules/agent_orchestrator/api/features/route.js +61 -0
  64. package/dist/modules/agent_orchestrator/api/features/route.js.map +7 -0
  65. package/dist/modules/agent_orchestrator/api/guardrail-checks/route.js +85 -0
  66. package/dist/modules/agent_orchestrator/api/guardrail-checks/route.js.map +7 -0
  67. package/dist/modules/agent_orchestrator/api/identity/agent/auth/route.js +95 -0
  68. package/dist/modules/agent_orchestrator/api/identity/agent/auth/route.js.map +7 -0
  69. package/dist/modules/agent_orchestrator/api/identity/grants/[id]/revoke/route.js +109 -0
  70. package/dist/modules/agent_orchestrator/api/identity/grants/[id]/revoke/route.js.map +7 -0
  71. package/dist/modules/agent_orchestrator/api/identity/token/route.js +80 -0
  72. package/dist/modules/agent_orchestrator/api/identity/token/route.js.map +7 -0
  73. package/dist/modules/agent_orchestrator/api/identity/well-known/route.js +44 -0
  74. package/dist/modules/agent_orchestrator/api/identity/well-known/route.js.map +7 -0
  75. package/dist/modules/agent_orchestrator/api/metrics/agents/route.js +122 -0
  76. package/dist/modules/agent_orchestrator/api/metrics/agents/route.js.map +7 -0
  77. package/dist/modules/agent_orchestrator/api/metrics/overview/route.js +165 -0
  78. package/dist/modules/agent_orchestrator/api/metrics/overview/route.js.map +7 -0
  79. package/dist/modules/agent_orchestrator/api/openapi.js +29 -0
  80. package/dist/modules/agent_orchestrator/api/openapi.js.map +7 -0
  81. package/dist/modules/agent_orchestrator/api/processes/[id]/executions/route.js +160 -0
  82. package/dist/modules/agent_orchestrator/api/processes/[id]/executions/route.js.map +7 -0
  83. package/dist/modules/agent_orchestrator/api/processes/[id]/route.js +53 -0
  84. package/dist/modules/agent_orchestrator/api/processes/[id]/route.js.map +7 -0
  85. package/dist/modules/agent_orchestrator/api/processes/route.js +357 -0
  86. package/dist/modules/agent_orchestrator/api/processes/route.js.map +7 -0
  87. package/dist/modules/agent_orchestrator/api/proposals/[id]/dispose/route.js +111 -0
  88. package/dist/modules/agent_orchestrator/api/proposals/[id]/dispose/route.js.map +7 -0
  89. package/dist/modules/agent_orchestrator/api/proposals/route.js +98 -0
  90. package/dist/modules/agent_orchestrator/api/proposals/route.js.map +7 -0
  91. package/dist/modules/agent_orchestrator/api/runs/[id]/artifact/route.js +71 -0
  92. package/dist/modules/agent_orchestrator/api/runs/[id]/artifact/route.js.map +7 -0
  93. package/dist/modules/agent_orchestrator/api/runs/[id]/artifacts/route.js +66 -0
  94. package/dist/modules/agent_orchestrator/api/runs/[id]/artifacts/route.js.map +7 -0
  95. package/dist/modules/agent_orchestrator/api/runs/[id]/eval-case/route.js +73 -0
  96. package/dist/modules/agent_orchestrator/api/runs/[id]/eval-case/route.js.map +7 -0
  97. package/dist/modules/agent_orchestrator/api/runs/[id]/flag/route.js +74 -0
  98. package/dist/modules/agent_orchestrator/api/runs/[id]/flag/route.js.map +7 -0
  99. package/dist/modules/agent_orchestrator/api/runs/[id]/rerun/route.js +165 -0
  100. package/dist/modules/agent_orchestrator/api/runs/[id]/rerun/route.js.map +7 -0
  101. package/dist/modules/agent_orchestrator/api/runs/[id]/route.js +86 -0
  102. package/dist/modules/agent_orchestrator/api/runs/[id]/route.js.map +7 -0
  103. package/dist/modules/agent_orchestrator/api/runs/route.js +137 -0
  104. package/dist/modules/agent_orchestrator/api/runs/route.js.map +7 -0
  105. package/dist/modules/agent_orchestrator/api/tokens/estimate/route.js +56 -0
  106. package/dist/modules/agent_orchestrator/api/tokens/estimate/route.js.map +7 -0
  107. package/dist/modules/agent_orchestrator/api/trace/ingest/route.js +80 -0
  108. package/dist/modules/agent_orchestrator/api/trace/ingest/route.js.map +7 -0
  109. package/dist/modules/agent_orchestrator/api/web-search/health/route.js +184 -0
  110. package/dist/modules/agent_orchestrator/api/web-search/health/route.js.map +7 -0
  111. package/dist/modules/agent_orchestrator/api/web-search/preview/route.js +150 -0
  112. package/dist/modules/agent_orchestrator/api/web-search/preview/route.js.map +7 -0
  113. package/dist/modules/agent_orchestrator/api/web-search/settings/route.js +213 -0
  114. package/dist/modules/agent_orchestrator/api/web-search/settings/route.js.map +7 -0
  115. package/dist/modules/agent_orchestrator/backend/agents/[id]/components/ActivityTab.js +112 -0
  116. package/dist/modules/agent_orchestrator/backend/agents/[id]/components/ActivityTab.js.map +7 -0
  117. package/dist/modules/agent_orchestrator/backend/agents/[id]/components/AgentConfigDrawer.js +58 -0
  118. package/dist/modules/agent_orchestrator/backend/agents/[id]/components/AgentConfigDrawer.js.map +7 -0
  119. package/dist/modules/agent_orchestrator/backend/agents/[id]/components/AgentHeaderCard.js +117 -0
  120. package/dist/modules/agent_orchestrator/backend/agents/[id]/components/AgentHeaderCard.js.map +7 -0
  121. package/dist/modules/agent_orchestrator/backend/agents/[id]/components/AssertionFormDrawer.js +318 -0
  122. package/dist/modules/agent_orchestrator/backend/agents/[id]/components/AssertionFormDrawer.js.map +7 -0
  123. package/dist/modules/agent_orchestrator/backend/agents/[id]/components/ConfigurationTab.js +126 -0
  124. package/dist/modules/agent_orchestrator/backend/agents/[id]/components/ConfigurationTab.js.map +7 -0
  125. package/dist/modules/agent_orchestrator/backend/agents/[id]/components/EvalCaseDrawer.js +379 -0
  126. package/dist/modules/agent_orchestrator/backend/agents/[id]/components/EvalCaseDrawer.js.map +7 -0
  127. package/dist/modules/agent_orchestrator/backend/agents/[id]/components/EvalResultsDrawer.js +159 -0
  128. package/dist/modules/agent_orchestrator/backend/agents/[id]/components/EvalResultsDrawer.js.map +7 -0
  129. package/dist/modules/agent_orchestrator/backend/agents/[id]/components/EvaluationTab.js +581 -0
  130. package/dist/modules/agent_orchestrator/backend/agents/[id]/components/EvaluationTab.js.map +7 -0
  131. package/dist/modules/agent_orchestrator/backend/agents/[id]/components/FilesTab.js +249 -0
  132. package/dist/modules/agent_orchestrator/backend/agents/[id]/components/FilesTab.js.map +7 -0
  133. package/dist/modules/agent_orchestrator/backend/agents/[id]/components/OverviewTab.js +162 -0
  134. package/dist/modules/agent_orchestrator/backend/agents/[id]/components/OverviewTab.js.map +7 -0
  135. package/dist/modules/agent_orchestrator/backend/agents/[id]/components/RunEvaluationDrawer.js +199 -0
  136. package/dist/modules/agent_orchestrator/backend/agents/[id]/components/RunEvaluationDrawer.js.map +7 -0
  137. package/dist/modules/agent_orchestrator/backend/agents/[id]/components/TokenCalculatorTab.js +137 -0
  138. package/dist/modules/agent_orchestrator/backend/agents/[id]/components/TokenCalculatorTab.js.map +7 -0
  139. package/dist/modules/agent_orchestrator/backend/agents/[id]/components/filesShared.js +97 -0
  140. package/dist/modules/agent_orchestrator/backend/agents/[id]/components/filesShared.js.map +7 -0
  141. package/dist/modules/agent_orchestrator/backend/agents/[id]/components/workspacePrimitives.js +159 -0
  142. package/dist/modules/agent_orchestrator/backend/agents/[id]/components/workspacePrimitives.js.map +7 -0
  143. package/dist/modules/agent_orchestrator/backend/agents/[id]/components/workspaceShared.js +132 -0
  144. package/dist/modules/agent_orchestrator/backend/agents/[id]/components/workspaceShared.js.map +7 -0
  145. package/dist/modules/agent_orchestrator/backend/agents/[id]/page.js +266 -0
  146. package/dist/modules/agent_orchestrator/backend/agents/[id]/page.js.map +7 -0
  147. package/dist/modules/agent_orchestrator/backend/agents/[id]/page.meta.js +18 -0
  148. package/dist/modules/agent_orchestrator/backend/agents/[id]/page.meta.js.map +7 -0
  149. package/dist/modules/agent_orchestrator/backend/agents/agentListFilters.js +44 -0
  150. package/dist/modules/agent_orchestrator/backend/agents/agentListFilters.js.map +7 -0
  151. package/dist/modules/agent_orchestrator/backend/agents/page.js +439 -0
  152. package/dist/modules/agent_orchestrator/backend/agents/page.js.map +7 -0
  153. package/dist/modules/agent_orchestrator/backend/agents/page.meta.js +28 -0
  154. package/dist/modules/agent_orchestrator/backend/agents/page.meta.js.map +7 -0
  155. package/dist/modules/agent_orchestrator/backend/audit/by-instigator/[humanUserId]/page.js +80 -0
  156. package/dist/modules/agent_orchestrator/backend/audit/by-instigator/[humanUserId]/page.js.map +7 -0
  157. package/dist/modules/agent_orchestrator/backend/audit/by-instigator/[humanUserId]/page.meta.js +19 -0
  158. package/dist/modules/agent_orchestrator/backend/audit/by-instigator/[humanUserId]/page.meta.js.map +7 -0
  159. package/dist/modules/agent_orchestrator/backend/audit/page.js +324 -0
  160. package/dist/modules/agent_orchestrator/backend/audit/page.js.map +7 -0
  161. package/dist/modules/agent_orchestrator/backend/audit/page.meta.js +27 -0
  162. package/dist/modules/agent_orchestrator/backend/audit/page.meta.js.map +7 -0
  163. package/dist/modules/agent_orchestrator/backend/caseload/[proposalId]/page.js +239 -0
  164. package/dist/modules/agent_orchestrator/backend/caseload/[proposalId]/page.js.map +7 -0
  165. package/dist/modules/agent_orchestrator/backend/caseload/[proposalId]/page.meta.js +18 -0
  166. package/dist/modules/agent_orchestrator/backend/caseload/[proposalId]/page.meta.js.map +7 -0
  167. package/dist/modules/agent_orchestrator/backend/caseload/hooks.js +344 -0
  168. package/dist/modules/agent_orchestrator/backend/caseload/hooks.js.map +7 -0
  169. package/dist/modules/agent_orchestrator/backend/caseload/page.js +1360 -0
  170. package/dist/modules/agent_orchestrator/backend/caseload/page.js.map +7 -0
  171. package/dist/modules/agent_orchestrator/backend/caseload/page.meta.js +25 -0
  172. package/dist/modules/agent_orchestrator/backend/caseload/page.meta.js.map +7 -0
  173. package/dist/modules/agent_orchestrator/backend/eval-cases/[id]/page.js +357 -0
  174. package/dist/modules/agent_orchestrator/backend/eval-cases/[id]/page.js.map +7 -0
  175. package/dist/modules/agent_orchestrator/backend/eval-cases/[id]/page.meta.js +18 -0
  176. package/dist/modules/agent_orchestrator/backend/eval-cases/[id]/page.meta.js.map +7 -0
  177. package/dist/modules/agent_orchestrator/backend/eval-runs/[id]/page.js +595 -0
  178. package/dist/modules/agent_orchestrator/backend/eval-runs/[id]/page.js.map +7 -0
  179. package/dist/modules/agent_orchestrator/backend/eval-runs/[id]/page.meta.js +18 -0
  180. package/dist/modules/agent_orchestrator/backend/eval-runs/[id]/page.meta.js.map +7 -0
  181. package/dist/modules/agent_orchestrator/backend/overview/page.js +593 -0
  182. package/dist/modules/agent_orchestrator/backend/overview/page.js.map +7 -0
  183. package/dist/modules/agent_orchestrator/backend/overview/page.meta.js +27 -0
  184. package/dist/modules/agent_orchestrator/backend/overview/page.meta.js.map +7 -0
  185. package/dist/modules/agent_orchestrator/backend/playground/PlaygroundEvalPanel.js +219 -0
  186. package/dist/modules/agent_orchestrator/backend/playground/PlaygroundEvalPanel.js.map +7 -0
  187. package/dist/modules/agent_orchestrator/backend/playground/page.js +443 -0
  188. package/dist/modules/agent_orchestrator/backend/playground/page.js.map +7 -0
  189. package/dist/modules/agent_orchestrator/backend/playground/page.meta.js +24 -0
  190. package/dist/modules/agent_orchestrator/backend/playground/page.meta.js.map +7 -0
  191. package/dist/modules/agent_orchestrator/backend/processes/[id]/page.js +611 -0
  192. package/dist/modules/agent_orchestrator/backend/processes/[id]/page.js.map +7 -0
  193. package/dist/modules/agent_orchestrator/backend/processes/[id]/page.meta.js +18 -0
  194. package/dist/modules/agent_orchestrator/backend/processes/[id]/page.meta.js.map +7 -0
  195. package/dist/modules/agent_orchestrator/backend/processes/definitions/MilestoneEditor.js +219 -0
  196. package/dist/modules/agent_orchestrator/backend/processes/definitions/MilestoneEditor.js.map +7 -0
  197. package/dist/modules/agent_orchestrator/backend/processes/definitions/TriggerEditor.js +326 -0
  198. package/dist/modules/agent_orchestrator/backend/processes/definitions/TriggerEditor.js.map +7 -0
  199. package/dist/modules/agent_orchestrator/backend/processes/definitions/[id]/page.js +565 -0
  200. package/dist/modules/agent_orchestrator/backend/processes/definitions/[id]/page.js.map +7 -0
  201. package/dist/modules/agent_orchestrator/backend/processes/definitions/[id]/page.meta.js +17 -0
  202. package/dist/modules/agent_orchestrator/backend/processes/definitions/[id]/page.meta.js.map +7 -0
  203. package/dist/modules/agent_orchestrator/backend/processes/definitions/formHelpers.js +69 -0
  204. package/dist/modules/agent_orchestrator/backend/processes/definitions/formHelpers.js.map +7 -0
  205. package/dist/modules/agent_orchestrator/backend/processes/definitions/navigation.js +9 -0
  206. package/dist/modules/agent_orchestrator/backend/processes/definitions/navigation.js.map +7 -0
  207. package/dist/modules/agent_orchestrator/backend/processes/definitions/page.js +735 -0
  208. package/dist/modules/agent_orchestrator/backend/processes/definitions/page.js.map +7 -0
  209. package/dist/modules/agent_orchestrator/backend/processes/definitions/page.meta.js +25 -0
  210. package/dist/modules/agent_orchestrator/backend/processes/definitions/page.meta.js.map +7 -0
  211. package/dist/modules/agent_orchestrator/backend/processes/page.js +244 -0
  212. package/dist/modules/agent_orchestrator/backend/processes/page.js.map +7 -0
  213. package/dist/modules/agent_orchestrator/backend/processes/page.meta.js +29 -0
  214. package/dist/modules/agent_orchestrator/backend/processes/page.meta.js.map +7 -0
  215. package/dist/modules/agent_orchestrator/backend/settings/auto-approval/page.js +204 -0
  216. package/dist/modules/agent_orchestrator/backend/settings/auto-approval/page.js.map +7 -0
  217. package/dist/modules/agent_orchestrator/backend/settings/auto-approval/page.meta.js +30 -0
  218. package/dist/modules/agent_orchestrator/backend/settings/auto-approval/page.meta.js.map +7 -0
  219. package/dist/modules/agent_orchestrator/backend/settings/web-search/AdapterRow.js +241 -0
  220. package/dist/modules/agent_orchestrator/backend/settings/web-search/AdapterRow.js.map +7 -0
  221. package/dist/modules/agent_orchestrator/backend/settings/web-search/WebSearchPreview.js +129 -0
  222. package/dist/modules/agent_orchestrator/backend/settings/web-search/WebSearchPreview.js.map +7 -0
  223. package/dist/modules/agent_orchestrator/backend/settings/web-search/page.js +644 -0
  224. package/dist/modules/agent_orchestrator/backend/settings/web-search/page.js.map +7 -0
  225. package/dist/modules/agent_orchestrator/backend/settings/web-search/page.meta.js +32 -0
  226. package/dist/modules/agent_orchestrator/backend/settings/web-search/page.meta.js.map +7 -0
  227. package/dist/modules/agent_orchestrator/backend/traces/[id]/page.js +1015 -0
  228. package/dist/modules/agent_orchestrator/backend/traces/[id]/page.js.map +7 -0
  229. package/dist/modules/agent_orchestrator/backend/traces/[id]/page.meta.js +18 -0
  230. package/dist/modules/agent_orchestrator/backend/traces/[id]/page.meta.js.map +7 -0
  231. package/dist/modules/agent_orchestrator/backend/traces/page.js +477 -0
  232. package/dist/modules/agent_orchestrator/backend/traces/page.js.map +7 -0
  233. package/dist/modules/agent_orchestrator/backend/traces/page.meta.js +24 -0
  234. package/dist/modules/agent_orchestrator/backend/traces/page.meta.js.map +7 -0
  235. package/dist/modules/agent_orchestrator/cli.js +592 -0
  236. package/dist/modules/agent_orchestrator/cli.js.map +7 -0
  237. package/dist/modules/agent_orchestrator/commands/artifacts.js +127 -0
  238. package/dist/modules/agent_orchestrator/commands/artifacts.js.map +7 -0
  239. package/dist/modules/agent_orchestrator/commands/corrections.js +284 -0
  240. package/dist/modules/agent_orchestrator/commands/corrections.js.map +7 -0
  241. package/dist/modules/agent_orchestrator/commands/dispose.js +265 -0
  242. package/dist/modules/agent_orchestrator/commands/dispose.js.map +7 -0
  243. package/dist/modules/agent_orchestrator/commands/evalRuns.js +202 -0
  244. package/dist/modules/agent_orchestrator/commands/evalRuns.js.map +7 -0
  245. package/dist/modules/agent_orchestrator/commands/grants.js +119 -0
  246. package/dist/modules/agent_orchestrator/commands/grants.js.map +7 -0
  247. package/dist/modules/agent_orchestrator/commands/index.js +11 -0
  248. package/dist/modules/agent_orchestrator/commands/index.js.map +7 -0
  249. package/dist/modules/agent_orchestrator/commands/processes.js +130 -0
  250. package/dist/modules/agent_orchestrator/commands/processes.js.map +7 -0
  251. package/dist/modules/agent_orchestrator/commands/proposals.js +67 -0
  252. package/dist/modules/agent_orchestrator/commands/proposals.js.map +7 -0
  253. package/dist/modules/agent_orchestrator/commands/runActions.js +42 -0
  254. package/dist/modules/agent_orchestrator/commands/runActions.js.map +7 -0
  255. package/dist/modules/agent_orchestrator/commands/runs.js +183 -0
  256. package/dist/modules/agent_orchestrator/commands/runs.js.map +7 -0
  257. package/dist/modules/agent_orchestrator/commands/trace.js +89 -0
  258. package/dist/modules/agent_orchestrator/commands/trace.js.map +7 -0
  259. package/dist/modules/agent_orchestrator/components/AgentIoDrawer.js +45 -0
  260. package/dist/modules/agent_orchestrator/components/AgentIoDrawer.js.map +7 -0
  261. package/dist/modules/agent_orchestrator/components/AgentTimeline.js +129 -0
  262. package/dist/modules/agent_orchestrator/components/AgentTimeline.js.map +7 -0
  263. package/dist/modules/agent_orchestrator/components/DisposeDialog.js +87 -0
  264. package/dist/modules/agent_orchestrator/components/DisposeDialog.js.map +7 -0
  265. package/dist/modules/agent_orchestrator/components/EmptyArt.js +50 -0
  266. package/dist/modules/agent_orchestrator/components/EmptyArt.js.map +7 -0
  267. package/dist/modules/agent_orchestrator/components/InvokeAgentNodeConfig.js +111 -0
  268. package/dist/modules/agent_orchestrator/components/InvokeAgentNodeConfig.js.map +7 -0
  269. package/dist/modules/agent_orchestrator/components/ProcessOutcomeLink.js +42 -0
  270. package/dist/modules/agent_orchestrator/components/ProcessOutcomeLink.js.map +7 -0
  271. package/dist/modules/agent_orchestrator/components/ProposalCard.js +431 -0
  272. package/dist/modules/agent_orchestrator/components/ProposalCard.js.map +7 -0
  273. package/dist/modules/agent_orchestrator/components/ProposalFacts.js +85 -0
  274. package/dist/modules/agent_orchestrator/components/ProposalFacts.js.map +7 -0
  275. package/dist/modules/agent_orchestrator/components/ProposalOptionList.js +190 -0
  276. package/dist/modules/agent_orchestrator/components/ProposalOptionList.js.map +7 -0
  277. package/dist/modules/agent_orchestrator/components/ProposeOnlyNotice.js +25 -0
  278. package/dist/modules/agent_orchestrator/components/ProposeOnlyNotice.js.map +7 -0
  279. package/dist/modules/agent_orchestrator/components/SkillDrawer.js +48 -0
  280. package/dist/modules/agent_orchestrator/components/SkillDrawer.js.map +7 -0
  281. package/dist/modules/agent_orchestrator/components/StartHereGuide.js +183 -0
  282. package/dist/modules/agent_orchestrator/components/StartHereGuide.js.map +7 -0
  283. package/dist/modules/agent_orchestrator/components/SystemHealthTile.js +135 -0
  284. package/dist/modules/agent_orchestrator/components/SystemHealthTile.js.map +7 -0
  285. package/dist/modules/agent_orchestrator/components/WebSearchActivity.js +87 -0
  286. package/dist/modules/agent_orchestrator/components/WebSearchActivity.js.map +7 -0
  287. package/dist/modules/agent_orchestrator/components/agentChips.js +90 -0
  288. package/dist/modules/agent_orchestrator/components/agentChips.js.map +7 -0
  289. package/dist/modules/agent_orchestrator/components/cockpitStatus.js +94 -0
  290. package/dist/modules/agent_orchestrator/components/cockpitStatus.js.map +7 -0
  291. package/dist/modules/agent_orchestrator/components/evalRunTypes.js +209 -0
  292. package/dist/modules/agent_orchestrator/components/evalRunTypes.js.map +7 -0
  293. package/dist/modules/agent_orchestrator/components/health/HealthRow.js +15 -0
  294. package/dist/modules/agent_orchestrator/components/health/HealthRow.js.map +7 -0
  295. package/dist/modules/agent_orchestrator/components/health/HealthStateBadge.js +13 -0
  296. package/dist/modules/agent_orchestrator/components/health/HealthStateBadge.js.map +7 -0
  297. package/dist/modules/agent_orchestrator/components/health/SystemHealthPanel.js +126 -0
  298. package/dist/modules/agent_orchestrator/components/health/SystemHealthPanel.js.map +7 -0
  299. package/dist/modules/agent_orchestrator/components/health/vocabulary.js +40 -0
  300. package/dist/modules/agent_orchestrator/components/health/vocabulary.js.map +7 -0
  301. package/dist/modules/agent_orchestrator/components/optionalRequest.js +7 -0
  302. package/dist/modules/agent_orchestrator/components/optionalRequest.js.map +7 -0
  303. package/dist/modules/agent_orchestrator/components/playgroundRunError.js +37 -0
  304. package/dist/modules/agent_orchestrator/components/playgroundRunError.js.map +7 -0
  305. package/dist/modules/agent_orchestrator/components/playgroundToolCalls.js +12 -0
  306. package/dist/modules/agent_orchestrator/components/playgroundToolCalls.js.map +7 -0
  307. package/dist/modules/agent_orchestrator/components/processTypes.js +454 -0
  308. package/dist/modules/agent_orchestrator/components/processTypes.js.map +7 -0
  309. package/dist/modules/agent_orchestrator/components/proposalCaseStatus.js +64 -0
  310. package/dist/modules/agent_orchestrator/components/proposalCaseStatus.js.map +7 -0
  311. package/dist/modules/agent_orchestrator/components/proposalEdit.js +71 -0
  312. package/dist/modules/agent_orchestrator/components/proposalEdit.js.map +7 -0
  313. package/dist/modules/agent_orchestrator/components/proposalFactsData.js +138 -0
  314. package/dist/modules/agent_orchestrator/components/proposalFactsData.js.map +7 -0
  315. package/dist/modules/agent_orchestrator/components/serverSort.js +34 -0
  316. package/dist/modules/agent_orchestrator/components/serverSort.js.map +7 -0
  317. package/dist/modules/agent_orchestrator/components/subjectRef.js +34 -0
  318. package/dist/modules/agent_orchestrator/components/subjectRef.js.map +7 -0
  319. package/dist/modules/agent_orchestrator/components/types.js +462 -0
  320. package/dist/modules/agent_orchestrator/components/types.js.map +7 -0
  321. package/dist/modules/agent_orchestrator/components/useAgentIcons.js +31 -0
  322. package/dist/modules/agent_orchestrator/components/useAgentIcons.js.map +7 -0
  323. package/dist/modules/agent_orchestrator/components/useAgentLabels.js +35 -0
  324. package/dist/modules/agent_orchestrator/components/useAgentLabels.js.map +7 -0
  325. package/dist/modules/agent_orchestrator/components/useAgentTags.js +32 -0
  326. package/dist/modules/agent_orchestrator/components/useAgentTags.js.map +7 -0
  327. package/dist/modules/agent_orchestrator/components/useCoalescedReload.js +33 -0
  328. package/dist/modules/agent_orchestrator/components/useCoalescedReload.js.map +7 -0
  329. package/dist/modules/agent_orchestrator/data/agentIcons.js +35 -0
  330. package/dist/modules/agent_orchestrator/data/agentIcons.js.map +7 -0
  331. package/dist/modules/agent_orchestrator/data/agentTags.js +26 -0
  332. package/dist/modules/agent_orchestrator/data/agentTags.js.map +7 -0
  333. package/dist/modules/agent_orchestrator/data/entities.js +1382 -0
  334. package/dist/modules/agent_orchestrator/data/entities.js.map +7 -0
  335. package/dist/modules/agent_orchestrator/data/proposalEnvelope.js +168 -0
  336. package/dist/modules/agent_orchestrator/data/proposalEnvelope.js.map +7 -0
  337. package/dist/modules/agent_orchestrator/data/validators.js +949 -0
  338. package/dist/modules/agent_orchestrator/data/validators.js.map +7 -0
  339. package/dist/modules/agent_orchestrator/di.js +169 -0
  340. package/dist/modules/agent_orchestrator/di.js.map +7 -0
  341. package/dist/modules/agent_orchestrator/encryption.js +100 -0
  342. package/dist/modules/agent_orchestrator/encryption.js.map +7 -0
  343. package/dist/modules/agent_orchestrator/events.js +87 -0
  344. package/dist/modules/agent_orchestrator/events.js.map +7 -0
  345. package/dist/modules/agent_orchestrator/examples/deals-health-check-workflow.json +124 -0
  346. package/dist/modules/agent_orchestrator/examples/refund-triage-workflow.json +210 -0
  347. package/dist/modules/agent_orchestrator/generated/file-agents.generated.js +169 -0
  348. package/dist/modules/agent_orchestrator/generated/file-agents.generated.js.map +7 -0
  349. package/dist/modules/agent_orchestrator/i18n/de.json +1495 -0
  350. package/dist/modules/agent_orchestrator/i18n/en.json +1495 -0
  351. package/dist/modules/agent_orchestrator/i18n/es.json +1495 -0
  352. package/dist/modules/agent_orchestrator/i18n/ko.json +1495 -0
  353. package/dist/modules/agent_orchestrator/i18n/pl.json +1495 -0
  354. package/dist/modules/agent_orchestrator/index.js +151 -0
  355. package/dist/modules/agent_orchestrator/index.js.map +7 -0
  356. package/dist/modules/agent_orchestrator/lib/automationLinks.js +12 -0
  357. package/dist/modules/agent_orchestrator/lib/automationLinks.js.map +7 -0
  358. package/dist/modules/agent_orchestrator/lib/context/contextResolver.js +317 -0
  359. package/dist/modules/agent_orchestrator/lib/context/contextResolver.js.map +7 -0
  360. package/dist/modules/agent_orchestrator/lib/context/documentIngest.js +93 -0
  361. package/dist/modules/agent_orchestrator/lib/context/documentIngest.js.map +7 -0
  362. package/dist/modules/agent_orchestrator/lib/context/documentOcrProvider.js +90 -0
  363. package/dist/modules/agent_orchestrator/lib/context/documentOcrProvider.js.map +7 -0
  364. package/dist/modules/agent_orchestrator/lib/context/documentSource.js +44 -0
  365. package/dist/modules/agent_orchestrator/lib/context/documentSource.js.map +7 -0
  366. package/dist/modules/agent_orchestrator/lib/context/index.js +64 -0
  367. package/dist/modules/agent_orchestrator/lib/context/index.js.map +7 -0
  368. package/dist/modules/agent_orchestrator/lib/context/packer.js +47 -0
  369. package/dist/modules/agent_orchestrator/lib/context/packer.js.map +7 -0
  370. package/dist/modules/agent_orchestrator/lib/context/redactor.js +72 -0
  371. package/dist/modules/agent_orchestrator/lib/context/redactor.js.map +7 -0
  372. package/dist/modules/agent_orchestrator/lib/context/registry.js +60 -0
  373. package/dist/modules/agent_orchestrator/lib/context/registry.js.map +7 -0
  374. package/dist/modules/agent_orchestrator/lib/context/retrievalSource.js +69 -0
  375. package/dist/modules/agent_orchestrator/lib/context/retrievalSource.js.map +7 -0
  376. package/dist/modules/agent_orchestrator/lib/crudCache.js +24 -0
  377. package/dist/modules/agent_orchestrator/lib/crudCache.js.map +7 -0
  378. package/dist/modules/agent_orchestrator/lib/disposition/autoApprovalPolicy.js +51 -0
  379. package/dist/modules/agent_orchestrator/lib/disposition/autoApprovalPolicy.js.map +7 -0
  380. package/dist/modules/agent_orchestrator/lib/disposition/dispositionService.js +190 -0
  381. package/dist/modules/agent_orchestrator/lib/disposition/dispositionService.js.map +7 -0
  382. package/dist/modules/agent_orchestrator/lib/disposition/resume.js +42 -0
  383. package/dist/modules/agent_orchestrator/lib/disposition/resume.js.map +7 -0
  384. package/dist/modules/agent_orchestrator/lib/disposition/tenantAutoApprovalPolicy.js +59 -0
  385. package/dist/modules/agent_orchestrator/lib/disposition/tenantAutoApprovalPolicy.js.map +7 -0
  386. package/dist/modules/agent_orchestrator/lib/eval/assertionResolution.js +53 -0
  387. package/dist/modules/agent_orchestrator/lib/eval/assertionResolution.js.map +7 -0
  388. package/dist/modules/agent_orchestrator/lib/eval/canonicalInputKey.js +20 -0
  389. package/dist/modules/agent_orchestrator/lib/eval/canonicalInputKey.js.map +7 -0
  390. package/dist/modules/agent_orchestrator/lib/eval/defaultAssertions.js +78 -0
  391. package/dist/modules/agent_orchestrator/lib/eval/defaultAssertions.js.map +7 -0
  392. package/dist/modules/agent_orchestrator/lib/eval/evalGate.js +71 -0
  393. package/dist/modules/agent_orchestrator/lib/eval/evalGate.js.map +7 -0
  394. package/dist/modules/agent_orchestrator/lib/eval/evalReplayService.js +277 -0
  395. package/dist/modules/agent_orchestrator/lib/eval/evalReplayService.js.map +7 -0
  396. package/dist/modules/agent_orchestrator/lib/eval/evalRuntimeService.js +141 -0
  397. package/dist/modules/agent_orchestrator/lib/eval/evalRuntimeService.js.map +7 -0
  398. package/dist/modules/agent_orchestrator/lib/eval/judgeRubric.js +150 -0
  399. package/dist/modules/agent_orchestrator/lib/eval/judgeRubric.js.map +7 -0
  400. package/dist/modules/agent_orchestrator/lib/eval/llmJudge.js +122 -0
  401. package/dist/modules/agent_orchestrator/lib/eval/llmJudge.js.map +7 -0
  402. package/dist/modules/agent_orchestrator/lib/eval/projectRunView.js +32 -0
  403. package/dist/modules/agent_orchestrator/lib/eval/projectRunView.js.map +7 -0
  404. package/dist/modules/agent_orchestrator/lib/eval/registry/agent.js +240 -0
  405. package/dist/modules/agent_orchestrator/lib/eval/registry/agent.js.map +7 -0
  406. package/dist/modules/agent_orchestrator/lib/eval/registry/economics.js +77 -0
  407. package/dist/modules/agent_orchestrator/lib/eval/registry/economics.js.map +7 -0
  408. package/dist/modules/agent_orchestrator/lib/eval/registry/index.js +97 -0
  409. package/dist/modules/agent_orchestrator/lib/eval/registry/index.js.map +7 -0
  410. package/dist/modules/agent_orchestrator/lib/eval/registry/judge.js +66 -0
  411. package/dist/modules/agent_orchestrator/lib/eval/registry/judge.js.map +7 -0
  412. package/dist/modules/agent_orchestrator/lib/eval/registry/shared.js +146 -0
  413. package/dist/modules/agent_orchestrator/lib/eval/registry/shared.js.map +7 -0
  414. package/dist/modules/agent_orchestrator/lib/eval/registry/structured.js +264 -0
  415. package/dist/modules/agent_orchestrator/lib/eval/registry/structured.js.map +7 -0
  416. package/dist/modules/agent_orchestrator/lib/eval/registry/text.js +110 -0
  417. package/dist/modules/agent_orchestrator/lib/eval/registry/text.js.map +7 -0
  418. package/dist/modules/agent_orchestrator/lib/eval/registry/tools.js +232 -0
  419. package/dist/modules/agent_orchestrator/lib/eval/registry/tools.js.map +7 -0
  420. package/dist/modules/agent_orchestrator/lib/eval/sampling.js +26 -0
  421. package/dist/modules/agent_orchestrator/lib/eval/sampling.js.map +7 -0
  422. package/dist/modules/agent_orchestrator/lib/eval/scorers.js +46 -0
  423. package/dist/modules/agent_orchestrator/lib/eval/scorers.js.map +7 -0
  424. package/dist/modules/agent_orchestrator/lib/eval/types.js +16 -0
  425. package/dist/modules/agent_orchestrator/lib/eval/types.js.map +7 -0
  426. package/dist/modules/agent_orchestrator/lib/featureFlags.js +9 -0
  427. package/dist/modules/agent_orchestrator/lib/featureFlags.js.map +7 -0
  428. package/dist/modules/agent_orchestrator/lib/guardrails/grounding.js +90 -0
  429. package/dist/modules/agent_orchestrator/lib/guardrails/grounding.js.map +7 -0
  430. package/dist/modules/agent_orchestrator/lib/guardrails/groundingSets.js +35 -0
  431. package/dist/modules/agent_orchestrator/lib/guardrails/groundingSets.js.map +7 -0
  432. package/dist/modules/agent_orchestrator/lib/guardrails/guardrailService.js +160 -0
  433. package/dist/modules/agent_orchestrator/lib/guardrails/guardrailService.js.map +7 -0
  434. package/dist/modules/agent_orchestrator/lib/guardrails/promptInjection.js +94 -0
  435. package/dist/modules/agent_orchestrator/lib/guardrails/promptInjection.js.map +7 -0
  436. package/dist/modules/agent_orchestrator/lib/guardrails/publicEndpointRateLimit.js +36 -0
  437. package/dist/modules/agent_orchestrator/lib/guardrails/publicEndpointRateLimit.js.map +7 -0
  438. package/dist/modules/agent_orchestrator/lib/guardrails/syncGroundingSets.js +43 -0
  439. package/dist/modules/agent_orchestrator/lib/guardrails/syncGroundingSets.js.map +7 -0
  440. package/dist/modules/agent_orchestrator/lib/identity/agentAuthMdService.js +136 -0
  441. package/dist/modules/agent_orchestrator/lib/identity/agentAuthMdService.js.map +7 -0
  442. package/dist/modules/agent_orchestrator/lib/identity/agentDelegationGrantService.js +55 -0
  443. package/dist/modules/agent_orchestrator/lib/identity/agentDelegationGrantService.js.map +7 -0
  444. package/dist/modules/agent_orchestrator/lib/identity/agentNoBypassSubscriber.js +50 -0
  445. package/dist/modules/agent_orchestrator/lib/identity/agentNoBypassSubscriber.js.map +7 -0
  446. package/dist/modules/agent_orchestrator/lib/identity/agentPrincipalService.js +149 -0
  447. package/dist/modules/agent_orchestrator/lib/identity/agentPrincipalService.js.map +7 -0
  448. package/dist/modules/agent_orchestrator/lib/identity/agentTokenService.js +138 -0
  449. package/dist/modules/agent_orchestrator/lib/identity/agentTokenService.js.map +7 -0
  450. package/dist/modules/agent_orchestrator/lib/identity/agentWriteScope.js +22 -0
  451. package/dist/modules/agent_orchestrator/lib/identity/agentWriteScope.js.map +7 -0
  452. package/dist/modules/agent_orchestrator/lib/metrics/metricRollupService.js +112 -0
  453. package/dist/modules/agent_orchestrator/lib/metrics/metricRollupService.js.map +7 -0
  454. package/dist/modules/agent_orchestrator/lib/processes/executionSearch.js +16 -0
  455. package/dist/modules/agent_orchestrator/lib/processes/executionSearch.js.map +7 -0
  456. package/dist/modules/agent_orchestrator/lib/processes/materializeAgentWorkflow.js +178 -0
  457. package/dist/modules/agent_orchestrator/lib/processes/materializeAgentWorkflow.js.map +7 -0
  458. package/dist/modules/agent_orchestrator/lib/processes/processProjection.js +220 -0
  459. package/dist/modules/agent_orchestrator/lib/processes/processProjection.js.map +7 -0
  460. package/dist/modules/agent_orchestrator/lib/processes/subjectContext.js +14 -0
  461. package/dist/modules/agent_orchestrator/lib/processes/subjectContext.js.map +7 -0
  462. package/dist/modules/agent_orchestrator/lib/processes/workflowGrant.js +41 -0
  463. package/dist/modules/agent_orchestrator/lib/processes/workflowGrant.js.map +7 -0
  464. package/dist/modules/agent_orchestrator/lib/queue.js +25 -0
  465. package/dist/modules/agent_orchestrator/lib/queue.js.map +7 -0
  466. package/dist/modules/agent_orchestrator/lib/runtime/actionVocabulary.js +66 -0
  467. package/dist/modules/agent_orchestrator/lib/runtime/actionVocabulary.js.map +7 -0
  468. package/dist/modules/agent_orchestrator/lib/runtime/admission.js +113 -0
  469. package/dist/modules/agent_orchestrator/lib/runtime/admission.js.map +7 -0
  470. package/dist/modules/agent_orchestrator/lib/runtime/agentRunSessionStore.js +92 -0
  471. package/dist/modules/agent_orchestrator/lib/runtime/agentRunSessionStore.js.map +7 -0
  472. package/dist/modules/agent_orchestrator/lib/runtime/agentRuntime.js +67 -0
  473. package/dist/modules/agent_orchestrator/lib/runtime/agentRuntime.js.map +7 -0
  474. package/dist/modules/agent_orchestrator/lib/runtime/agentWorkspaceManager.js +111 -0
  475. package/dist/modules/agent_orchestrator/lib/runtime/agentWorkspaceManager.js.map +7 -0
  476. package/dist/modules/agent_orchestrator/lib/runtime/artifactCollector.js +146 -0
  477. package/dist/modules/agent_orchestrator/lib/runtime/artifactCollector.js.map +7 -0
  478. package/dist/modules/agent_orchestrator/lib/runtime/artifactFileStore.js +85 -0
  479. package/dist/modules/agent_orchestrator/lib/runtime/artifactFileStore.js.map +7 -0
  480. package/dist/modules/agent_orchestrator/lib/runtime/attachmentStager.js +62 -0
  481. package/dist/modules/agent_orchestrator/lib/runtime/attachmentStager.js.map +7 -0
  482. package/dist/modules/agent_orchestrator/lib/runtime/errors.js +38 -0
  483. package/dist/modules/agent_orchestrator/lib/runtime/errors.js.map +7 -0
  484. package/dist/modules/agent_orchestrator/lib/runtime/executeProposal.js +37 -0
  485. package/dist/modules/agent_orchestrator/lib/runtime/executeProposal.js.map +7 -0
  486. package/dist/modules/agent_orchestrator/lib/runtime/fileAgentSkills.js +32 -0
  487. package/dist/modules/agent_orchestrator/lib/runtime/fileAgentSkills.js.map +7 -0
  488. package/dist/modules/agent_orchestrator/lib/runtime/fileInput.js +27 -0
  489. package/dist/modules/agent_orchestrator/lib/runtime/fileInput.js.map +7 -0
  490. package/dist/modules/agent_orchestrator/lib/runtime/invokeAgentForWorkflow.js +115 -0
  491. package/dist/modules/agent_orchestrator/lib/runtime/invokeAgentForWorkflow.js.map +7 -0
  492. package/dist/modules/agent_orchestrator/lib/runtime/modelPricing.js +77 -0
  493. package/dist/modules/agent_orchestrator/lib/runtime/modelPricing.js.map +7 -0
  494. package/dist/modules/agent_orchestrator/lib/runtime/nativeAgentRunner.js +422 -0
  495. package/dist/modules/agent_orchestrator/lib/runtime/nativeAgentRunner.js.map +7 -0
  496. package/dist/modules/agent_orchestrator/lib/runtime/nativeTraceCapture.js +132 -0
  497. package/dist/modules/agent_orchestrator/lib/runtime/nativeTraceCapture.js.map +7 -0
  498. package/dist/modules/agent_orchestrator/lib/runtime/openCodeAgentRunner.js +581 -0
  499. package/dist/modules/agent_orchestrator/lib/runtime/openCodeAgentRunner.js.map +7 -0
  500. package/dist/modules/agent_orchestrator/lib/runtime/persistence.js +110 -0
  501. package/dist/modules/agent_orchestrator/lib/runtime/persistence.js.map +7 -0
  502. package/dist/modules/agent_orchestrator/lib/runtime/providerBudget.js +152 -0
  503. package/dist/modules/agent_orchestrator/lib/runtime/providerBudget.js.map +7 -0
  504. package/dist/modules/agent_orchestrator/lib/runtime/rerunContext.js +13 -0
  505. package/dist/modules/agent_orchestrator/lib/runtime/rerunContext.js.map +7 -0
  506. package/dist/modules/agent_orchestrator/lib/runtime/runContext.js +17 -0
  507. package/dist/modules/agent_orchestrator/lib/runtime/runContext.js.map +7 -0
  508. package/dist/modules/agent_orchestrator/lib/runtime/sandboxedScript.js +39 -0
  509. package/dist/modules/agent_orchestrator/lib/runtime/sandboxedScript.js.map +7 -0
  510. package/dist/modules/agent_orchestrator/lib/sdk/agentMarkdown.js +91 -0
  511. package/dist/modules/agent_orchestrator/lib/sdk/agentMarkdown.js.map +7 -0
  512. package/dist/modules/agent_orchestrator/lib/sdk/agentOutcomeContract.js +35 -0
  513. package/dist/modules/agent_orchestrator/lib/sdk/agentOutcomeContract.js.map +7 -0
  514. package/dist/modules/agent_orchestrator/lib/sdk/defineAgent.js +214 -0
  515. package/dist/modules/agent_orchestrator/lib/sdk/defineAgent.js.map +7 -0
  516. package/dist/modules/agent_orchestrator/lib/sdk/defineFileAgent.js +417 -0
  517. package/dist/modules/agent_orchestrator/lib/sdk/defineFileAgent.js.map +7 -0
  518. package/dist/modules/agent_orchestrator/lib/sdk/defineSkill.js +40 -0
  519. package/dist/modules/agent_orchestrator/lib/sdk/defineSkill.js.map +7 -0
  520. package/dist/modules/agent_orchestrator/lib/sdk/outcomeSchema.js +129 -0
  521. package/dist/modules/agent_orchestrator/lib/sdk/outcomeSchema.js.map +7 -0
  522. package/dist/modules/agent_orchestrator/lib/sdk/skillMarkdown.js +78 -0
  523. package/dist/modules/agent_orchestrator/lib/sdk/skillMarkdown.js.map +7 -0
  524. package/dist/modules/agent_orchestrator/lib/seeds.js +224 -0
  525. package/dist/modules/agent_orchestrator/lib/seeds.js.map +7 -0
  526. package/dist/modules/agent_orchestrator/lib/settings/agentSettings.js +55 -0
  527. package/dist/modules/agent_orchestrator/lib/settings/agentSettings.js.map +7 -0
  528. package/dist/modules/agent_orchestrator/lib/systemHealth.js +94 -0
  529. package/dist/modules/agent_orchestrator/lib/systemHealth.js.map +7 -0
  530. package/dist/modules/agent_orchestrator/lib/tasks/eventTriggerMatch.js +81 -0
  531. package/dist/modules/agent_orchestrator/lib/tasks/eventTriggerMatch.js.map +7 -0
  532. package/dist/modules/agent_orchestrator/lib/tasks/milestones.js +96 -0
  533. package/dist/modules/agent_orchestrator/lib/tasks/milestones.js.map +7 -0
  534. package/dist/modules/agent_orchestrator/lib/tasks/outcome.js +44 -0
  535. package/dist/modules/agent_orchestrator/lib/tasks/outcome.js.map +7 -0
  536. package/dist/modules/agent_orchestrator/lib/tasks/outcomeLink.js +45 -0
  537. package/dist/modules/agent_orchestrator/lib/tasks/outcomeLink.js.map +7 -0
  538. package/dist/modules/agent_orchestrator/lib/tasks/schedule.js +63 -0
  539. package/dist/modules/agent_orchestrator/lib/tasks/schedule.js.map +7 -0
  540. package/dist/modules/agent_orchestrator/lib/tasks/scheduleValidation.js +25 -0
  541. package/dist/modules/agent_orchestrator/lib/tasks/scheduleValidation.js.map +7 -0
  542. package/dist/modules/agent_orchestrator/lib/tasks/triggers.js +34 -0
  543. package/dist/modules/agent_orchestrator/lib/tasks/triggers.js.map +7 -0
  544. package/dist/modules/agent_orchestrator/lib/tokens/computeAgentTokenUsage.js +70 -0
  545. package/dist/modules/agent_orchestrator/lib/tokens/computeAgentTokenUsage.js.map +7 -0
  546. package/dist/modules/agent_orchestrator/lib/tokens/types.js +1 -0
  547. package/dist/modules/agent_orchestrator/lib/tokens/types.js.map +7 -0
  548. package/dist/modules/agent_orchestrator/lib/trace/artifactStore.js +89 -0
  549. package/dist/modules/agent_orchestrator/lib/trace/artifactStore.js.map +7 -0
  550. package/dist/modules/agent_orchestrator/lib/trace/correctionService.js +61 -0
  551. package/dist/modules/agent_orchestrator/lib/trace/correctionService.js.map +7 -0
  552. package/dist/modules/agent_orchestrator/lib/trace/ingestAuth.js +39 -0
  553. package/dist/modules/agent_orchestrator/lib/trace/ingestAuth.js.map +7 -0
  554. package/dist/modules/agent_orchestrator/lib/trace/redactToolSummary.js +44 -0
  555. package/dist/modules/agent_orchestrator/lib/trace/redactToolSummary.js.map +7 -0
  556. package/dist/modules/agent_orchestrator/lib/trace/spanTimeline.js +96 -0
  557. package/dist/modules/agent_orchestrator/lib/trace/spanTimeline.js.map +7 -0
  558. package/dist/modules/agent_orchestrator/lib/trace/traceIngestionService.js +168 -0
  559. package/dist/modules/agent_orchestrator/lib/trace/traceIngestionService.js.map +7 -0
  560. package/dist/modules/agent_orchestrator/lib/webSearch/guardrails.js +116 -0
  561. package/dist/modules/agent_orchestrator/lib/webSearch/guardrails.js.map +7 -0
  562. package/dist/modules/agent_orchestrator/lib/webSearch/healthCache.js +68 -0
  563. package/dist/modules/agent_orchestrator/lib/webSearch/healthCache.js.map +7 -0
  564. package/dist/modules/agent_orchestrator/lib/webSearch/healthProbePlan.js +16 -0
  565. package/dist/modules/agent_orchestrator/lib/webSearch/healthProbePlan.js.map +7 -0
  566. package/dist/modules/agent_orchestrator/lib/webSearch/policy.js +172 -0
  567. package/dist/modules/agent_orchestrator/lib/webSearch/policy.js.map +7 -0
  568. package/dist/modules/agent_orchestrator/lib/webSearch/registry.js +113 -0
  569. package/dist/modules/agent_orchestrator/lib/webSearch/registry.js.map +7 -0
  570. package/dist/modules/agent_orchestrator/lib/webSearch/secretStorage.js +87 -0
  571. package/dist/modules/agent_orchestrator/lib/webSearch/secretStorage.js.map +7 -0
  572. package/dist/modules/agent_orchestrator/lib/webSearch/steps.js +48 -0
  573. package/dist/modules/agent_orchestrator/lib/webSearch/steps.js.map +7 -0
  574. package/dist/modules/agent_orchestrator/lib/webSearch/tools.js +176 -0
  575. package/dist/modules/agent_orchestrator/lib/webSearch/tools.js.map +7 -0
  576. package/dist/modules/agent_orchestrator/lib/workInbox/agentDispositionSource.js +151 -0
  577. package/dist/modules/agent_orchestrator/lib/workInbox/agentDispositionSource.js.map +7 -0
  578. package/dist/modules/agent_orchestrator/migrations/Migration20260906141535_agent_orchestrator.js +200 -0
  579. package/dist/modules/agent_orchestrator/migrations/Migration20260906141535_agent_orchestrator.js.map +7 -0
  580. package/dist/modules/agent_orchestrator/notifications.js +32 -0
  581. package/dist/modules/agent_orchestrator/notifications.js.map +7 -0
  582. package/dist/modules/agent_orchestrator/setup.js +147 -0
  583. package/dist/modules/agent_orchestrator/setup.js.map +7 -0
  584. package/dist/modules/agent_orchestrator/subscribers/process-event-trigger.js +140 -0
  585. package/dist/modules/agent_orchestrator/subscribers/process-event-trigger.js.map +7 -0
  586. package/dist/modules/agent_orchestrator/subscribers/process-proposal-created.js +17 -0
  587. package/dist/modules/agent_orchestrator/subscribers/process-proposal-created.js.map +7 -0
  588. package/dist/modules/agent_orchestrator/subscribers/process-proposal-disposed.js +15 -0
  589. package/dist/modules/agent_orchestrator/subscribers/process-proposal-disposed.js.map +7 -0
  590. package/dist/modules/agent_orchestrator/subscribers/process-run-completed.js +17 -0
  591. package/dist/modules/agent_orchestrator/subscribers/process-run-completed.js.map +7 -0
  592. package/dist/modules/agent_orchestrator/subscribers/process-run-ingested.js +17 -0
  593. package/dist/modules/agent_orchestrator/subscribers/process-run-ingested.js.map +7 -0
  594. package/dist/modules/agent_orchestrator/subscribers/process-workflow-cancelled.js +20 -0
  595. package/dist/modules/agent_orchestrator/subscribers/process-workflow-cancelled.js.map +7 -0
  596. package/dist/modules/agent_orchestrator/subscribers/process-workflow-completed.js +20 -0
  597. package/dist/modules/agent_orchestrator/subscribers/process-workflow-completed.js.map +7 -0
  598. package/dist/modules/agent_orchestrator/subscribers/process-workflow-failed.js +21 -0
  599. package/dist/modules/agent_orchestrator/subscribers/process-workflow-failed.js.map +7 -0
  600. package/dist/modules/agent_orchestrator/subscribers/process-workflow-milestone.js +30 -0
  601. package/dist/modules/agent_orchestrator/subscribers/process-workflow-milestone.js.map +7 -0
  602. package/dist/modules/agent_orchestrator/subscribers/process-workflow-started.js +25 -0
  603. package/dist/modules/agent_orchestrator/subscribers/process-workflow-started.js.map +7 -0
  604. package/dist/modules/agent_orchestrator/subscribers/proposal-disposed-notification-clear.js +34 -0
  605. package/dist/modules/agent_orchestrator/subscribers/proposal-disposed-notification-clear.js.map +7 -0
  606. package/dist/modules/agent_orchestrator/subscribers/proposal-pending-notification.js +53 -0
  607. package/dist/modules/agent_orchestrator/subscribers/proposal-pending-notification.js.map +7 -0
  608. package/dist/modules/agent_orchestrator/widgets/injection/caseload-nav-badge/widget.client.js +44 -0
  609. package/dist/modules/agent_orchestrator/widgets/injection/caseload-nav-badge/widget.client.js.map +7 -0
  610. package/dist/modules/agent_orchestrator/widgets/injection/caseload-nav-badge/widget.js +17 -0
  611. package/dist/modules/agent_orchestrator/widgets/injection/caseload-nav-badge/widget.js.map +7 -0
  612. package/dist/modules/agent_orchestrator/widgets/injection/task-proposal-draft/widget.client.js +107 -0
  613. package/dist/modules/agent_orchestrator/widgets/injection/task-proposal-draft/widget.client.js.map +7 -0
  614. package/dist/modules/agent_orchestrator/widgets/injection/task-proposal-draft/widget.js +17 -0
  615. package/dist/modules/agent_orchestrator/widgets/injection/task-proposal-draft/widget.js.map +7 -0
  616. package/dist/modules/agent_orchestrator/widgets/injection/task-proposal-link/widget.js +28 -0
  617. package/dist/modules/agent_orchestrator/widgets/injection/task-proposal-link/widget.js.map +7 -0
  618. package/dist/modules/agent_orchestrator/widgets/injection-table.js +33 -0
  619. package/dist/modules/agent_orchestrator/widgets/injection-table.js.map +7 -0
  620. package/dist/modules/agent_orchestrator/workers/eval-suite-runner.js +56 -0
  621. package/dist/modules/agent_orchestrator/workers/eval-suite-runner.js.map +7 -0
  622. package/dist/modules/agent_orchestrator/workers/llm-judge.js +29 -0
  623. package/dist/modules/agent_orchestrator/workers/llm-judge.js.map +7 -0
  624. package/dist/modules/agent_orchestrator/workers/metric-rollup.js +29 -0
  625. package/dist/modules/agent_orchestrator/workers/metric-rollup.js.map +7 -0
  626. package/dist/modules/agent_orchestrator/workers/process-execution-starter.js +130 -0
  627. package/dist/modules/agent_orchestrator/workers/process-execution-starter.js.map +7 -0
  628. package/dist/modules/record_locks/lib/conflictValues.js +78 -0
  629. package/dist/modules/record_locks/lib/conflictValues.js.map +7 -0
  630. package/dist/modules/record_locks/lib/crudMutationGuardService.js +19 -4
  631. package/dist/modules/record_locks/lib/crudMutationGuardService.js.map +2 -2
  632. package/dist/modules/record_locks/lib/recordLockService.js +1 -44
  633. package/dist/modules/record_locks/lib/recordLockService.js.map +2 -2
  634. package/jest.config.cjs +2 -0
  635. package/package.json +18 -6
  636. package/src/index.ts +1 -1
  637. package/src/modules/agent_orchestrator/.ai/skills/om-create-opencode-agent/SKILL.md +251 -0
  638. package/src/modules/agent_orchestrator/AGENTS.md +374 -0
  639. package/src/modules/agent_orchestrator/DEMO.md +175 -0
  640. package/src/modules/agent_orchestrator/acl.ts +131 -0
  641. package/src/modules/agent_orchestrator/ai-agents.ts +70 -0
  642. package/src/modules/agent_orchestrator/ai-skills.ts +59 -0
  643. package/src/modules/agent_orchestrator/ai-tools.ts +391 -0
  644. package/src/modules/agent_orchestrator/api/agents/[id]/files/route.ts +77 -0
  645. package/src/modules/agent_orchestrator/api/agents/[id]/metrics/route.ts +106 -0
  646. package/src/modules/agent_orchestrator/api/agents/[id]/route.ts +166 -0
  647. package/src/modules/agent_orchestrator/api/agents/[id]/run/route.ts +339 -0
  648. package/src/modules/agent_orchestrator/api/agents/[id]/settings/route.ts +119 -0
  649. package/src/modules/agent_orchestrator/api/agents/route.ts +124 -0
  650. package/src/modules/agent_orchestrator/api/artifacts/file/[id]/route.ts +80 -0
  651. package/src/modules/agent_orchestrator/api/audit/by-instigator/[humanUserId]/route.ts +143 -0
  652. package/src/modules/agent_orchestrator/api/auto-approval/settings/route.ts +143 -0
  653. package/src/modules/agent_orchestrator/api/context-bundles/route.ts +89 -0
  654. package/src/modules/agent_orchestrator/api/corrections/route.ts +119 -0
  655. package/src/modules/agent_orchestrator/api/eval-assertions/preview/route.ts +123 -0
  656. package/src/modules/agent_orchestrator/api/eval-assertions/route.ts +228 -0
  657. package/src/modules/agent_orchestrator/api/eval-cases/[id]/approve/route.ts +101 -0
  658. package/src/modules/agent_orchestrator/api/eval-cases/[id]/archive/route.ts +100 -0
  659. package/src/modules/agent_orchestrator/api/eval-cases/[id]/route.ts +84 -0
  660. package/src/modules/agent_orchestrator/api/eval-cases/export/route.ts +92 -0
  661. package/src/modules/agent_orchestrator/api/eval-cases/route.ts +159 -0
  662. package/src/modules/agent_orchestrator/api/eval-runs/[id]/cancel/route.ts +78 -0
  663. package/src/modules/agent_orchestrator/api/eval-runs/[id]/case-runs/[caseRunId]/results/route.ts +82 -0
  664. package/src/modules/agent_orchestrator/api/eval-runs/[id]/route.ts +133 -0
  665. package/src/modules/agent_orchestrator/api/eval-runs/route.ts +197 -0
  666. package/src/modules/agent_orchestrator/api/eval-scorers/route.ts +51 -0
  667. package/src/modules/agent_orchestrator/api/executions/[id]/route.ts +106 -0
  668. package/src/modules/agent_orchestrator/api/executions/route.ts +206 -0
  669. package/src/modules/agent_orchestrator/api/features/route.ts +71 -0
  670. package/src/modules/agent_orchestrator/api/guardrail-checks/route.ts +86 -0
  671. package/src/modules/agent_orchestrator/api/identity/agent/auth/route.ts +121 -0
  672. package/src/modules/agent_orchestrator/api/identity/grants/[id]/revoke/route.ts +133 -0
  673. package/src/modules/agent_orchestrator/api/identity/token/route.ts +102 -0
  674. package/src/modules/agent_orchestrator/api/identity/well-known/route.ts +60 -0
  675. package/src/modules/agent_orchestrator/api/metrics/agents/route.ts +160 -0
  676. package/src/modules/agent_orchestrator/api/metrics/overview/route.ts +240 -0
  677. package/src/modules/agent_orchestrator/api/openapi.ts +31 -0
  678. package/src/modules/agent_orchestrator/api/processes/[id]/executions/route.ts +211 -0
  679. package/src/modules/agent_orchestrator/api/processes/[id]/route.ts +70 -0
  680. package/src/modules/agent_orchestrator/api/processes/route.ts +458 -0
  681. package/src/modules/agent_orchestrator/api/proposals/[id]/dispose/route.ts +131 -0
  682. package/src/modules/agent_orchestrator/api/proposals/route.ts +113 -0
  683. package/src/modules/agent_orchestrator/api/runs/[id]/artifact/route.ts +93 -0
  684. package/src/modules/agent_orchestrator/api/runs/[id]/artifacts/route.ts +83 -0
  685. package/src/modules/agent_orchestrator/api/runs/[id]/eval-case/route.ts +91 -0
  686. package/src/modules/agent_orchestrator/api/runs/[id]/flag/route.ts +89 -0
  687. package/src/modules/agent_orchestrator/api/runs/[id]/rerun/route.ts +195 -0
  688. package/src/modules/agent_orchestrator/api/runs/[id]/route.ts +102 -0
  689. package/src/modules/agent_orchestrator/api/runs/route.ts +146 -0
  690. package/src/modules/agent_orchestrator/api/tokens/estimate/route.ts +61 -0
  691. package/src/modules/agent_orchestrator/api/trace/ingest/route.ts +98 -0
  692. package/src/modules/agent_orchestrator/api/web-search/health/route.ts +268 -0
  693. package/src/modules/agent_orchestrator/api/web-search/preview/route.ts +184 -0
  694. package/src/modules/agent_orchestrator/api/web-search/settings/route.ts +309 -0
  695. package/src/modules/agent_orchestrator/auth.md +107 -0
  696. package/src/modules/agent_orchestrator/backend/agents/[id]/components/ActivityTab.tsx +118 -0
  697. package/src/modules/agent_orchestrator/backend/agents/[id]/components/AgentConfigDrawer.tsx +96 -0
  698. package/src/modules/agent_orchestrator/backend/agents/[id]/components/AgentHeaderCard.tsx +174 -0
  699. package/src/modules/agent_orchestrator/backend/agents/[id]/components/AssertionFormDrawer.tsx +418 -0
  700. package/src/modules/agent_orchestrator/backend/agents/[id]/components/ConfigurationTab.tsx +185 -0
  701. package/src/modules/agent_orchestrator/backend/agents/[id]/components/EvalCaseDrawer.tsx +488 -0
  702. package/src/modules/agent_orchestrator/backend/agents/[id]/components/EvalResultsDrawer.tsx +244 -0
  703. package/src/modules/agent_orchestrator/backend/agents/[id]/components/EvaluationTab.tsx +715 -0
  704. package/src/modules/agent_orchestrator/backend/agents/[id]/components/FilesTab.tsx +328 -0
  705. package/src/modules/agent_orchestrator/backend/agents/[id]/components/OverviewTab.tsx +211 -0
  706. package/src/modules/agent_orchestrator/backend/agents/[id]/components/RunEvaluationDrawer.tsx +247 -0
  707. package/src/modules/agent_orchestrator/backend/agents/[id]/components/TokenCalculatorTab.tsx +143 -0
  708. package/src/modules/agent_orchestrator/backend/agents/[id]/components/filesShared.ts +149 -0
  709. package/src/modules/agent_orchestrator/backend/agents/[id]/components/workspacePrimitives.tsx +236 -0
  710. package/src/modules/agent_orchestrator/backend/agents/[id]/components/workspaceShared.ts +193 -0
  711. package/src/modules/agent_orchestrator/backend/agents/[id]/page.meta.ts +14 -0
  712. package/src/modules/agent_orchestrator/backend/agents/[id]/page.tsx +335 -0
  713. package/src/modules/agent_orchestrator/backend/agents/agentListFilters.ts +95 -0
  714. package/src/modules/agent_orchestrator/backend/agents/page.meta.ts +26 -0
  715. package/src/modules/agent_orchestrator/backend/agents/page.tsx +549 -0
  716. package/src/modules/agent_orchestrator/backend/audit/by-instigator/[humanUserId]/page.meta.ts +15 -0
  717. package/src/modules/agent_orchestrator/backend/audit/by-instigator/[humanUserId]/page.tsx +126 -0
  718. package/src/modules/agent_orchestrator/backend/audit/page.meta.ts +25 -0
  719. package/src/modules/agent_orchestrator/backend/audit/page.tsx +392 -0
  720. package/src/modules/agent_orchestrator/backend/caseload/[proposalId]/page.meta.ts +14 -0
  721. package/src/modules/agent_orchestrator/backend/caseload/[proposalId]/page.tsx +298 -0
  722. package/src/modules/agent_orchestrator/backend/caseload/hooks.ts +583 -0
  723. package/src/modules/agent_orchestrator/backend/caseload/page.meta.ts +23 -0
  724. package/src/modules/agent_orchestrator/backend/caseload/page.tsx +1761 -0
  725. package/src/modules/agent_orchestrator/backend/eval-cases/[id]/page.meta.ts +14 -0
  726. package/src/modules/agent_orchestrator/backend/eval-cases/[id]/page.tsx +446 -0
  727. package/src/modules/agent_orchestrator/backend/eval-runs/[id]/page.meta.ts +14 -0
  728. package/src/modules/agent_orchestrator/backend/eval-runs/[id]/page.tsx +824 -0
  729. package/src/modules/agent_orchestrator/backend/overview/page.meta.ts +25 -0
  730. package/src/modules/agent_orchestrator/backend/overview/page.tsx +755 -0
  731. package/src/modules/agent_orchestrator/backend/playground/PlaygroundEvalPanel.tsx +292 -0
  732. package/src/modules/agent_orchestrator/backend/playground/page.meta.ts +22 -0
  733. package/src/modules/agent_orchestrator/backend/playground/page.tsx +647 -0
  734. package/src/modules/agent_orchestrator/backend/processes/[id]/page.meta.ts +14 -0
  735. package/src/modules/agent_orchestrator/backend/processes/[id]/page.tsx +856 -0
  736. package/src/modules/agent_orchestrator/backend/processes/definitions/MilestoneEditor.tsx +285 -0
  737. package/src/modules/agent_orchestrator/backend/processes/definitions/TriggerEditor.tsx +391 -0
  738. package/src/modules/agent_orchestrator/backend/processes/definitions/[id]/page.meta.ts +13 -0
  739. package/src/modules/agent_orchestrator/backend/processes/definitions/[id]/page.tsx +705 -0
  740. package/src/modules/agent_orchestrator/backend/processes/definitions/formHelpers.ts +100 -0
  741. package/src/modules/agent_orchestrator/backend/processes/definitions/navigation.ts +6 -0
  742. package/src/modules/agent_orchestrator/backend/processes/definitions/page.meta.ts +23 -0
  743. package/src/modules/agent_orchestrator/backend/processes/definitions/page.tsx +904 -0
  744. package/src/modules/agent_orchestrator/backend/processes/page.meta.ts +27 -0
  745. package/src/modules/agent_orchestrator/backend/processes/page.tsx +317 -0
  746. package/src/modules/agent_orchestrator/backend/settings/auto-approval/page.meta.ts +28 -0
  747. package/src/modules/agent_orchestrator/backend/settings/auto-approval/page.tsx +315 -0
  748. package/src/modules/agent_orchestrator/backend/settings/web-search/AdapterRow.tsx +351 -0
  749. package/src/modules/agent_orchestrator/backend/settings/web-search/WebSearchPreview.tsx +203 -0
  750. package/src/modules/agent_orchestrator/backend/settings/web-search/page.meta.ts +30 -0
  751. package/src/modules/agent_orchestrator/backend/settings/web-search/page.tsx +913 -0
  752. package/src/modules/agent_orchestrator/backend/traces/[id]/page.meta.ts +14 -0
  753. package/src/modules/agent_orchestrator/backend/traces/[id]/page.tsx +1383 -0
  754. package/src/modules/agent_orchestrator/backend/traces/page.meta.ts +22 -0
  755. package/src/modules/agent_orchestrator/backend/traces/page.tsx +601 -0
  756. package/src/modules/agent_orchestrator/cli.ts +719 -0
  757. package/src/modules/agent_orchestrator/commands/artifacts.ts +171 -0
  758. package/src/modules/agent_orchestrator/commands/corrections.ts +345 -0
  759. package/src/modules/agent_orchestrator/commands/dispose.ts +380 -0
  760. package/src/modules/agent_orchestrator/commands/evalRuns.ts +291 -0
  761. package/src/modules/agent_orchestrator/commands/grants.ts +149 -0
  762. package/src/modules/agent_orchestrator/commands/index.ts +10 -0
  763. package/src/modules/agent_orchestrator/commands/processes.ts +176 -0
  764. package/src/modules/agent_orchestrator/commands/proposals.ts +82 -0
  765. package/src/modules/agent_orchestrator/commands/runActions.ts +52 -0
  766. package/src/modules/agent_orchestrator/commands/runs.ts +212 -0
  767. package/src/modules/agent_orchestrator/commands/trace.ts +118 -0
  768. package/src/modules/agent_orchestrator/components/AgentIoDrawer.tsx +87 -0
  769. package/src/modules/agent_orchestrator/components/AgentTimeline.tsx +175 -0
  770. package/src/modules/agent_orchestrator/components/DisposeDialog.tsx +112 -0
  771. package/src/modules/agent_orchestrator/components/EmptyArt.tsx +51 -0
  772. package/src/modules/agent_orchestrator/components/InvokeAgentNodeConfig.tsx +150 -0
  773. package/src/modules/agent_orchestrator/components/ProcessOutcomeLink.tsx +50 -0
  774. package/src/modules/agent_orchestrator/components/ProposalCard.tsx +602 -0
  775. package/src/modules/agent_orchestrator/components/ProposalFacts.tsx +139 -0
  776. package/src/modules/agent_orchestrator/components/ProposalOptionList.tsx +273 -0
  777. package/src/modules/agent_orchestrator/components/ProposeOnlyNotice.tsx +40 -0
  778. package/src/modules/agent_orchestrator/components/SkillDrawer.tsx +75 -0
  779. package/src/modules/agent_orchestrator/components/StartHereGuide.tsx +241 -0
  780. package/src/modules/agent_orchestrator/components/SystemHealthTile.tsx +189 -0
  781. package/src/modules/agent_orchestrator/components/WebSearchActivity.tsx +180 -0
  782. package/src/modules/agent_orchestrator/components/agentChips.tsx +123 -0
  783. package/src/modules/agent_orchestrator/components/cockpitStatus.tsx +154 -0
  784. package/src/modules/agent_orchestrator/components/evalRunTypes.ts +339 -0
  785. package/src/modules/agent_orchestrator/components/health/HealthRow.tsx +36 -0
  786. package/src/modules/agent_orchestrator/components/health/HealthStateBadge.tsx +21 -0
  787. package/src/modules/agent_orchestrator/components/health/SystemHealthPanel.tsx +206 -0
  788. package/src/modules/agent_orchestrator/components/health/vocabulary.ts +53 -0
  789. package/src/modules/agent_orchestrator/components/optionalRequest.ts +18 -0
  790. package/src/modules/agent_orchestrator/components/playgroundRunError.ts +63 -0
  791. package/src/modules/agent_orchestrator/components/playgroundToolCalls.ts +32 -0
  792. package/src/modules/agent_orchestrator/components/processTypes.ts +613 -0
  793. package/src/modules/agent_orchestrator/components/proposalCaseStatus.ts +100 -0
  794. package/src/modules/agent_orchestrator/components/proposalEdit.ts +118 -0
  795. package/src/modules/agent_orchestrator/components/proposalFactsData.ts +222 -0
  796. package/src/modules/agent_orchestrator/components/serverSort.ts +56 -0
  797. package/src/modules/agent_orchestrator/components/subjectRef.ts +61 -0
  798. package/src/modules/agent_orchestrator/components/types.ts +834 -0
  799. package/src/modules/agent_orchestrator/components/useAgentIcons.ts +42 -0
  800. package/src/modules/agent_orchestrator/components/useAgentLabels.ts +44 -0
  801. package/src/modules/agent_orchestrator/components/useAgentTags.ts +38 -0
  802. package/src/modules/agent_orchestrator/components/useCoalescedReload.ts +43 -0
  803. package/src/modules/agent_orchestrator/data/agentIcons.ts +52 -0
  804. package/src/modules/agent_orchestrator/data/agentTags.ts +39 -0
  805. package/src/modules/agent_orchestrator/data/entities.ts +1904 -0
  806. package/src/modules/agent_orchestrator/data/proposalEnvelope.ts +263 -0
  807. package/src/modules/agent_orchestrator/data/validators.ts +1585 -0
  808. package/src/modules/agent_orchestrator/di.ts +182 -0
  809. package/src/modules/agent_orchestrator/encryption.ts +98 -0
  810. package/src/modules/agent_orchestrator/events.ts +97 -0
  811. package/src/modules/agent_orchestrator/examples/deals-health-check-workflow.json +124 -0
  812. package/src/modules/agent_orchestrator/examples/refund-triage-workflow.json +210 -0
  813. package/src/modules/agent_orchestrator/generated/file-agents.generated.ts +207 -0
  814. package/src/modules/agent_orchestrator/i18n/.hardcoded-allowlist.json +22 -0
  815. package/src/modules/agent_orchestrator/i18n/de.json +1495 -0
  816. package/src/modules/agent_orchestrator/i18n/en.json +1495 -0
  817. package/src/modules/agent_orchestrator/i18n/es.json +1495 -0
  818. package/src/modules/agent_orchestrator/i18n/ko.json +1495 -0
  819. package/src/modules/agent_orchestrator/i18n/pl.json +1495 -0
  820. package/src/modules/agent_orchestrator/index.ts +155 -0
  821. package/src/modules/agent_orchestrator/lib/automationLinks.ts +20 -0
  822. package/src/modules/agent_orchestrator/lib/context/contextResolver.ts +528 -0
  823. package/src/modules/agent_orchestrator/lib/context/documentIngest.ts +187 -0
  824. package/src/modules/agent_orchestrator/lib/context/documentOcrProvider.ts +189 -0
  825. package/src/modules/agent_orchestrator/lib/context/documentSource.ts +88 -0
  826. package/src/modules/agent_orchestrator/lib/context/index.ts +68 -0
  827. package/src/modules/agent_orchestrator/lib/context/packer.ts +114 -0
  828. package/src/modules/agent_orchestrator/lib/context/redactor.ts +138 -0
  829. package/src/modules/agent_orchestrator/lib/context/registry.ts +153 -0
  830. package/src/modules/agent_orchestrator/lib/context/retrievalSource.ts +146 -0
  831. package/src/modules/agent_orchestrator/lib/crudCache.ts +62 -0
  832. package/src/modules/agent_orchestrator/lib/disposition/autoApprovalPolicy.ts +163 -0
  833. package/src/modules/agent_orchestrator/lib/disposition/dispositionService.ts +310 -0
  834. package/src/modules/agent_orchestrator/lib/disposition/resume.ts +81 -0
  835. package/src/modules/agent_orchestrator/lib/disposition/tenantAutoApprovalPolicy.ts +100 -0
  836. package/src/modules/agent_orchestrator/lib/eval/assertionResolution.ts +105 -0
  837. package/src/modules/agent_orchestrator/lib/eval/canonicalInputKey.ts +32 -0
  838. package/src/modules/agent_orchestrator/lib/eval/defaultAssertions.ts +103 -0
  839. package/src/modules/agent_orchestrator/lib/eval/evalGate.ts +139 -0
  840. package/src/modules/agent_orchestrator/lib/eval/evalReplayService.ts +517 -0
  841. package/src/modules/agent_orchestrator/lib/eval/evalRuntimeService.ts +215 -0
  842. package/src/modules/agent_orchestrator/lib/eval/judgeRubric.ts +212 -0
  843. package/src/modules/agent_orchestrator/lib/eval/llmJudge.ts +174 -0
  844. package/src/modules/agent_orchestrator/lib/eval/projectRunView.ts +53 -0
  845. package/src/modules/agent_orchestrator/lib/eval/registry/agent.ts +334 -0
  846. package/src/modules/agent_orchestrator/lib/eval/registry/economics.ts +91 -0
  847. package/src/modules/agent_orchestrator/lib/eval/registry/index.ts +157 -0
  848. package/src/modules/agent_orchestrator/lib/eval/registry/judge.ts +102 -0
  849. package/src/modules/agent_orchestrator/lib/eval/registry/shared.ts +208 -0
  850. package/src/modules/agent_orchestrator/lib/eval/registry/structured.ts +297 -0
  851. package/src/modules/agent_orchestrator/lib/eval/registry/text.ts +125 -0
  852. package/src/modules/agent_orchestrator/lib/eval/registry/tools.ts +263 -0
  853. package/src/modules/agent_orchestrator/lib/eval/sampling.ts +33 -0
  854. package/src/modules/agent_orchestrator/lib/eval/scorers.ts +90 -0
  855. package/src/modules/agent_orchestrator/lib/eval/types.ts +189 -0
  856. package/src/modules/agent_orchestrator/lib/featureFlags.ts +22 -0
  857. package/src/modules/agent_orchestrator/lib/guardrails/grounding.ts +172 -0
  858. package/src/modules/agent_orchestrator/lib/guardrails/groundingSets.ts +61 -0
  859. package/src/modules/agent_orchestrator/lib/guardrails/guardrailService.ts +293 -0
  860. package/src/modules/agent_orchestrator/lib/guardrails/promptInjection.ts +163 -0
  861. package/src/modules/agent_orchestrator/lib/guardrails/publicEndpointRateLimit.ts +74 -0
  862. package/src/modules/agent_orchestrator/lib/guardrails/syncGroundingSets.ts +68 -0
  863. package/src/modules/agent_orchestrator/lib/identity/agentAuthMdService.ts +247 -0
  864. package/src/modules/agent_orchestrator/lib/identity/agentDelegationGrantService.ts +85 -0
  865. package/src/modules/agent_orchestrator/lib/identity/agentNoBypassSubscriber.ts +98 -0
  866. package/src/modules/agent_orchestrator/lib/identity/agentPrincipalService.ts +230 -0
  867. package/src/modules/agent_orchestrator/lib/identity/agentTokenService.ts +281 -0
  868. package/src/modules/agent_orchestrator/lib/identity/agentWriteScope.ts +68 -0
  869. package/src/modules/agent_orchestrator/lib/metrics/metricRollupService.ts +168 -0
  870. package/src/modules/agent_orchestrator/lib/processes/executionSearch.ts +35 -0
  871. package/src/modules/agent_orchestrator/lib/processes/materializeAgentWorkflow.ts +320 -0
  872. package/src/modules/agent_orchestrator/lib/processes/processProjection.ts +401 -0
  873. package/src/modules/agent_orchestrator/lib/processes/subjectContext.ts +30 -0
  874. package/src/modules/agent_orchestrator/lib/processes/workflowGrant.ts +84 -0
  875. package/src/modules/agent_orchestrator/lib/queue.ts +56 -0
  876. package/src/modules/agent_orchestrator/lib/runtime/actionVocabulary.ts +127 -0
  877. package/src/modules/agent_orchestrator/lib/runtime/admission.ts +177 -0
  878. package/src/modules/agent_orchestrator/lib/runtime/agentRunSessionStore.ts +166 -0
  879. package/src/modules/agent_orchestrator/lib/runtime/agentRuntime.ts +108 -0
  880. package/src/modules/agent_orchestrator/lib/runtime/agentWorkspaceManager.ts +187 -0
  881. package/src/modules/agent_orchestrator/lib/runtime/artifactCollector.ts +188 -0
  882. package/src/modules/agent_orchestrator/lib/runtime/artifactFileStore.ts +189 -0
  883. package/src/modules/agent_orchestrator/lib/runtime/attachmentStager.ts +100 -0
  884. package/src/modules/agent_orchestrator/lib/runtime/errors.ts +63 -0
  885. package/src/modules/agent_orchestrator/lib/runtime/executeProposal.ts +78 -0
  886. package/src/modules/agent_orchestrator/lib/runtime/fileAgentSkills.ts +81 -0
  887. package/src/modules/agent_orchestrator/lib/runtime/fileInput.ts +44 -0
  888. package/src/modules/agent_orchestrator/lib/runtime/invokeAgentForWorkflow.ts +255 -0
  889. package/src/modules/agent_orchestrator/lib/runtime/modelPricing.ts +146 -0
  890. package/src/modules/agent_orchestrator/lib/runtime/nativeAgentRunner.ts +617 -0
  891. package/src/modules/agent_orchestrator/lib/runtime/nativeTraceCapture.ts +217 -0
  892. package/src/modules/agent_orchestrator/lib/runtime/openCodeAgentRunner.ts +889 -0
  893. package/src/modules/agent_orchestrator/lib/runtime/persistence.ts +314 -0
  894. package/src/modules/agent_orchestrator/lib/runtime/providerBudget.ts +230 -0
  895. package/src/modules/agent_orchestrator/lib/runtime/rerunContext.ts +26 -0
  896. package/src/modules/agent_orchestrator/lib/runtime/runContext.ts +47 -0
  897. package/src/modules/agent_orchestrator/lib/runtime/sandboxedScript.ts +106 -0
  898. package/src/modules/agent_orchestrator/lib/sdk/agentMarkdown.ts +157 -0
  899. package/src/modules/agent_orchestrator/lib/sdk/agentOutcomeContract.ts +58 -0
  900. package/src/modules/agent_orchestrator/lib/sdk/defineAgent.ts +525 -0
  901. package/src/modules/agent_orchestrator/lib/sdk/defineFileAgent.ts +765 -0
  902. package/src/modules/agent_orchestrator/lib/sdk/defineSkill.ts +80 -0
  903. package/src/modules/agent_orchestrator/lib/sdk/outcomeSchema.ts +190 -0
  904. package/src/modules/agent_orchestrator/lib/sdk/skillMarkdown.ts +139 -0
  905. package/src/modules/agent_orchestrator/lib/seeds.ts +335 -0
  906. package/src/modules/agent_orchestrator/lib/settings/agentSettings.ts +92 -0
  907. package/src/modules/agent_orchestrator/lib/systemHealth.ts +212 -0
  908. package/src/modules/agent_orchestrator/lib/tasks/eventTriggerMatch.ts +116 -0
  909. package/src/modules/agent_orchestrator/lib/tasks/milestones.ts +201 -0
  910. package/src/modules/agent_orchestrator/lib/tasks/outcome.ts +93 -0
  911. package/src/modules/agent_orchestrator/lib/tasks/outcomeLink.ts +91 -0
  912. package/src/modules/agent_orchestrator/lib/tasks/schedule.ts +106 -0
  913. package/src/modules/agent_orchestrator/lib/tasks/scheduleValidation.ts +34 -0
  914. package/src/modules/agent_orchestrator/lib/tasks/triggers.ts +47 -0
  915. package/src/modules/agent_orchestrator/lib/tokens/computeAgentTokenUsage.ts +111 -0
  916. package/src/modules/agent_orchestrator/lib/tokens/types.ts +77 -0
  917. package/src/modules/agent_orchestrator/lib/trace/artifactStore.ts +198 -0
  918. package/src/modules/agent_orchestrator/lib/trace/correctionService.ts +117 -0
  919. package/src/modules/agent_orchestrator/lib/trace/ingestAuth.ts +65 -0
  920. package/src/modules/agent_orchestrator/lib/trace/redactToolSummary.ts +76 -0
  921. package/src/modules/agent_orchestrator/lib/trace/spanTimeline.ts +181 -0
  922. package/src/modules/agent_orchestrator/lib/trace/traceIngestionService.ts +250 -0
  923. package/src/modules/agent_orchestrator/lib/webSearch/guardrails.ts +199 -0
  924. package/src/modules/agent_orchestrator/lib/webSearch/healthCache.ts +109 -0
  925. package/src/modules/agent_orchestrator/lib/webSearch/healthProbePlan.ts +58 -0
  926. package/src/modules/agent_orchestrator/lib/webSearch/policy.ts +283 -0
  927. package/src/modules/agent_orchestrator/lib/webSearch/registry.ts +177 -0
  928. package/src/modules/agent_orchestrator/lib/webSearch/secretStorage.ts +181 -0
  929. package/src/modules/agent_orchestrator/lib/webSearch/steps.ts +77 -0
  930. package/src/modules/agent_orchestrator/lib/webSearch/tools.ts +246 -0
  931. package/src/modules/agent_orchestrator/lib/workInbox/agentDispositionSource.ts +324 -0
  932. package/src/modules/agent_orchestrator/migrations/.snapshot-open-mercato.json +7083 -0
  933. package/src/modules/agent_orchestrator/migrations/Migration20260906141535_agent_orchestrator.ts +278 -0
  934. package/src/modules/agent_orchestrator/migrations/adopt-squash.mjs +232 -0
  935. package/src/modules/agent_orchestrator/notifications.ts +43 -0
  936. package/src/modules/agent_orchestrator/setup.ts +190 -0
  937. package/src/modules/agent_orchestrator/skills/deals.stage_playbook.md +37 -0
  938. package/src/modules/agent_orchestrator/subscribers/process-event-trigger.ts +198 -0
  939. package/src/modules/agent_orchestrator/subscribers/process-proposal-created.ts +28 -0
  940. package/src/modules/agent_orchestrator/subscribers/process-proposal-disposed.ts +20 -0
  941. package/src/modules/agent_orchestrator/subscribers/process-run-completed.ts +23 -0
  942. package/src/modules/agent_orchestrator/subscribers/process-run-ingested.ts +22 -0
  943. package/src/modules/agent_orchestrator/subscribers/process-workflow-cancelled.ts +22 -0
  944. package/src/modules/agent_orchestrator/subscribers/process-workflow-completed.ts +32 -0
  945. package/src/modules/agent_orchestrator/subscribers/process-workflow-failed.ts +23 -0
  946. package/src/modules/agent_orchestrator/subscribers/process-workflow-milestone.ts +47 -0
  947. package/src/modules/agent_orchestrator/subscribers/process-workflow-started.ts +34 -0
  948. package/src/modules/agent_orchestrator/subscribers/proposal-disposed-notification-clear.ts +50 -0
  949. package/src/modules/agent_orchestrator/subscribers/proposal-pending-notification.ts +84 -0
  950. package/src/modules/agent_orchestrator/widgets/injection/caseload-nav-badge/widget.client.tsx +68 -0
  951. package/src/modules/agent_orchestrator/widgets/injection/caseload-nav-badge/widget.ts +16 -0
  952. package/src/modules/agent_orchestrator/widgets/injection/task-proposal-draft/widget.client.tsx +148 -0
  953. package/src/modules/agent_orchestrator/widgets/injection/task-proposal-draft/widget.ts +24 -0
  954. package/src/modules/agent_orchestrator/widgets/injection/task-proposal-link/widget.ts +34 -0
  955. package/src/modules/agent_orchestrator/widgets/injection-table.ts +42 -0
  956. package/src/modules/agent_orchestrator/workers/eval-suite-runner.ts +85 -0
  957. package/src/modules/agent_orchestrator/workers/llm-judge.ts +39 -0
  958. package/src/modules/agent_orchestrator/workers/metric-rollup.ts +39 -0
  959. package/src/modules/agent_orchestrator/workers/process-execution-starter.ts +227 -0
  960. package/src/modules/record_locks/lib/conflictValues.ts +107 -0
  961. package/src/modules/record_locks/lib/crudMutationGuardService.ts +47 -3
  962. package/src/modules/record_locks/lib/recordLockService.ts +1 -51
@@ -0,0 +1,69 @@
1
+ import { z } from "zod";
2
+ const searchHitSchema = z.object({
3
+ entityId: z.string().min(1),
4
+ recordId: z.string().min(1),
5
+ score: z.number(),
6
+ source: z.string().optional(),
7
+ presenter: z.object({
8
+ title: z.string().optional(),
9
+ subtitle: z.string().optional()
10
+ }).passthrough().optional(),
11
+ url: z.string().optional()
12
+ }).passthrough();
13
+ const DEFAULT_RETRIEVAL_LIMIT = 20;
14
+ async function readRetrievalSource(container, source, query, scope) {
15
+ if (source.kind !== "retrieval") return [];
16
+ const trimmedQuery = query.trim();
17
+ if (!trimmedQuery) return [];
18
+ const searchService = resolveSearchService(container);
19
+ if (!searchService) return [];
20
+ const entityTypes = (source.entityTypes ?? []).filter((value) => value.length > 0);
21
+ const rawHits = await searchService.search(trimmedQuery, {
22
+ tenantId: scope.tenantId,
23
+ organizationId: scope.organizationId,
24
+ ...entityTypes.length ? { entityTypes } : {},
25
+ limit: source.limit ?? DEFAULT_RETRIEVAL_LIMIT
26
+ });
27
+ if (!Array.isArray(rawHits)) return [];
28
+ const hits = [];
29
+ for (const raw of rawHits) {
30
+ const parsed = searchHitSchema.safeParse(raw);
31
+ if (!parsed.success) continue;
32
+ const hit = parsed.data;
33
+ const locator = `${hit.entityId}:${hit.recordId}`;
34
+ const snippet = buildSnippet(hit);
35
+ hits.push({
36
+ ref: locator,
37
+ locator,
38
+ score: hit.score,
39
+ record: {
40
+ entityType: hit.entityId,
41
+ recordId: hit.recordId,
42
+ snippet,
43
+ ...hit.url ? { url: hit.url } : {}
44
+ }
45
+ });
46
+ }
47
+ return hits;
48
+ }
49
+ function resolveSearchService(container) {
50
+ const hasRegistration = typeof container.hasRegistration === "function" ? container.hasRegistration.bind(container) : null;
51
+ if (hasRegistration && !hasRegistration("searchService")) return null;
52
+ try {
53
+ const resolved = container.resolve("searchService");
54
+ return typeof resolved?.search === "function" ? resolved : null;
55
+ } catch {
56
+ return null;
57
+ }
58
+ }
59
+ function buildSnippet(hit) {
60
+ const title = hit.presenter?.title?.trim();
61
+ const subtitle = hit.presenter?.subtitle?.trim();
62
+ const parts = [title, subtitle].filter((value) => !!value && value.length > 0);
63
+ if (parts.length) return parts.join(" \u2014 ");
64
+ return `${hit.entityId}:${hit.recordId}`;
65
+ }
66
+ export {
67
+ readRetrievalSource
68
+ };
69
+ //# sourceMappingURL=retrievalSource.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/modules/agent_orchestrator/lib/context/retrievalSource.ts"],
4
+ "sourcesContent": ["import type { AwilixContainer } from 'awilix'\nimport { z } from 'zod'\nimport type { ContextSourceDecl, ContextSourceHit } from './registry'\n\n/**\n * Retrieval source (context overlay, Phase 2).\n *\n * Wraps the platform `searchService` (`packages/search`, RRF-fused vector /\n * fulltext / token strategies) as a retrieval-ranked OPTIONAL fill for the TDCR\n * resolver, and powers the standalone `retrieve()` grounding contract that the\n * Wave 3 guardrails cite-or-abstain check consumes.\n *\n * Hard contract (the grounding check depends on it): EVERY hit this source emits\n * is citable \u2014 it carries `sourceRef` + `locator` + `score`. No hit may lack a\n * locator or score; a malformed `searchService` row is dropped rather than\n * emitted uncited.\n *\n * Tenancy: reads are ALWAYS org+tenant scoped via `SearchOptions` \u2014 cross-tenant\n * retrieval is structurally impossible (the org filter is passed on every call\n * and never taken from anywhere but the run scope).\n *\n * Decoupling: `@open-mercato/search` is not a direct dependency of\n * `@open-mercato/enterprise`. We consume the service structurally through the DI\n * container (the same pattern the resolver uses for `queryEngine`) so the search\n * package's contract surface is consumed, never imported/modified, and retrieval\n * degrades to an empty fill when search is not registered.\n */\n\n/** The minimal structural shape of a `searchService.search` hit we consume. */\nconst searchHitSchema = z\n .object({\n entityId: z.string().min(1),\n recordId: z.string().min(1),\n score: z.number(),\n source: z.string().optional(),\n presenter: z\n .object({\n title: z.string().optional(),\n subtitle: z.string().optional(),\n })\n .passthrough()\n .optional(),\n url: z.string().optional(),\n })\n .passthrough()\nexport type SearchHit = z.infer<typeof searchHitSchema>\n\n/** The structural `searchService` contract we depend on (consumed via DI, never imported). */\nexport type SearchServiceLike = {\n search(\n query: string,\n options: {\n tenantId: string\n organizationId?: string | null\n entityTypes?: string[]\n limit?: number\n },\n ): Promise<unknown[]>\n}\n\nexport type RetrievalScope = {\n tenantId: string\n organizationId: string\n}\n\n/** A conservative default cap on hits pulled before the packer trims to budget. */\nconst DEFAULT_RETRIEVAL_LIMIT = 20\n\n/**\n * Read a `retrieval` source via `searchService` (RRF), org+tenant scoped, and\n * map each row to a citable `ContextSourceHit` (`ref` + `locator` + `score`).\n *\n * Returns `[]` (never throws) when `searchService` is unregistered or the query\n * is empty \u2014 retrieval is optional fill, so its absence must not break assembly.\n */\nexport async function readRetrievalSource(\n container: AwilixContainer,\n source: ContextSourceDecl,\n query: string,\n scope: RetrievalScope,\n): Promise<ContextSourceHit[]> {\n if (source.kind !== 'retrieval') return []\n const trimmedQuery = query.trim()\n if (!trimmedQuery) return []\n\n const searchService = resolveSearchService(container)\n if (!searchService) return []\n\n const entityTypes = (source.entityTypes ?? []).filter((value) => value.length > 0)\n const rawHits = await searchService.search(trimmedQuery, {\n tenantId: scope.tenantId,\n organizationId: scope.organizationId,\n ...(entityTypes.length ? { entityTypes } : {}),\n limit: source.limit ?? DEFAULT_RETRIEVAL_LIMIT,\n })\n\n if (!Array.isArray(rawHits)) return []\n\n const hits: ContextSourceHit[] = []\n for (const raw of rawHits) {\n const parsed = searchHitSchema.safeParse(raw)\n // Drop malformed rows: an uncitable hit (no entity/record/score) MUST NOT be\n // emitted \u2014 the grounding check requires every hit to carry locator + score.\n if (!parsed.success) continue\n const hit = parsed.data\n const locator = `${hit.entityId}:${hit.recordId}`\n const snippet = buildSnippet(hit)\n hits.push({\n ref: locator,\n locator,\n score: hit.score,\n record: {\n entityType: hit.entityId,\n recordId: hit.recordId,\n snippet,\n ...(hit.url ? { url: hit.url } : {}),\n },\n })\n }\n return hits\n}\n\n/**\n * Resolve `searchService` from the container, returning null when it is not\n * registered (search module disabled / standalone app without search).\n */\nfunction resolveSearchService(container: AwilixContainer): SearchServiceLike | null {\n const hasRegistration =\n typeof container.hasRegistration === 'function' ? container.hasRegistration.bind(container) : null\n if (hasRegistration && !hasRegistration('searchService')) return null\n try {\n const resolved = container.resolve('searchService') as SearchServiceLike\n return typeof resolved?.search === 'function' ? resolved : null\n } catch {\n return null\n }\n}\n\n/** Build the agent-visible snippet text from a hit's presenter (no raw record bodies). */\nfunction buildSnippet(hit: SearchHit): string {\n const title = hit.presenter?.title?.trim()\n const subtitle = hit.presenter?.subtitle?.trim()\n const parts = [title, subtitle].filter((value): value is string => !!value && value.length > 0)\n if (parts.length) return parts.join(' \u2014 ')\n return `${hit.entityId}:${hit.recordId}`\n}\n"],
5
+ "mappings": "AACA,SAAS,SAAS;AA4BlB,MAAM,kBAAkB,EACrB,OAAO;AAAA,EACN,UAAU,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EAC1B,UAAU,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EAC1B,OAAO,EAAE,OAAO;AAAA,EAChB,QAAQ,EAAE,OAAO,EAAE,SAAS;AAAA,EAC5B,WAAW,EACR,OAAO;AAAA,IACN,OAAO,EAAE,OAAO,EAAE,SAAS;AAAA,IAC3B,UAAU,EAAE,OAAO,EAAE,SAAS;AAAA,EAChC,CAAC,EACA,YAAY,EACZ,SAAS;AAAA,EACZ,KAAK,EAAE,OAAO,EAAE,SAAS;AAC3B,CAAC,EACA,YAAY;AAsBf,MAAM,0BAA0B;AAShC,eAAsB,oBACpB,WACA,QACA,OACA,OAC6B;AAC7B,MAAI,OAAO,SAAS,YAAa,QAAO,CAAC;AACzC,QAAM,eAAe,MAAM,KAAK;AAChC,MAAI,CAAC,aAAc,QAAO,CAAC;AAE3B,QAAM,gBAAgB,qBAAqB,SAAS;AACpD,MAAI,CAAC,cAAe,QAAO,CAAC;AAE5B,QAAM,eAAe,OAAO,eAAe,CAAC,GAAG,OAAO,CAAC,UAAU,MAAM,SAAS,CAAC;AACjF,QAAM,UAAU,MAAM,cAAc,OAAO,cAAc;AAAA,IACvD,UAAU,MAAM;AAAA,IAChB,gBAAgB,MAAM;AAAA,IACtB,GAAI,YAAY,SAAS,EAAE,YAAY,IAAI,CAAC;AAAA,IAC5C,OAAO,OAAO,SAAS;AAAA,EACzB,CAAC;AAED,MAAI,CAAC,MAAM,QAAQ,OAAO,EAAG,QAAO,CAAC;AAErC,QAAM,OAA2B,CAAC;AAClC,aAAW,OAAO,SAAS;AACzB,UAAM,SAAS,gBAAgB,UAAU,GAAG;AAG5C,QAAI,CAAC,OAAO,QAAS;AACrB,UAAM,MAAM,OAAO;AACnB,UAAM,UAAU,GAAG,IAAI,QAAQ,IAAI,IAAI,QAAQ;AAC/C,UAAM,UAAU,aAAa,GAAG;AAChC,SAAK,KAAK;AAAA,MACR,KAAK;AAAA,MACL;AAAA,MACA,OAAO,IAAI;AAAA,MACX,QAAQ;AAAA,QACN,YAAY,IAAI;AAAA,QAChB,UAAU,IAAI;AAAA,QACd;AAAA,QACA,GAAI,IAAI,MAAM,EAAE,KAAK,IAAI,IAAI,IAAI,CAAC;AAAA,MACpC;AAAA,IACF,CAAC;AAAA,EACH;AACA,SAAO;AACT;AAMA,SAAS,qBAAqB,WAAsD;AAClF,QAAM,kBACJ,OAAO,UAAU,oBAAoB,aAAa,UAAU,gBAAgB,KAAK,SAAS,IAAI;AAChG,MAAI,mBAAmB,CAAC,gBAAgB,eAAe,EAAG,QAAO;AACjE,MAAI;AACF,UAAM,WAAW,UAAU,QAAQ,eAAe;AAClD,WAAO,OAAO,UAAU,WAAW,aAAa,WAAW;AAAA,EAC7D,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAGA,SAAS,aAAa,KAAwB;AAC5C,QAAM,QAAQ,IAAI,WAAW,OAAO,KAAK;AACzC,QAAM,WAAW,IAAI,WAAW,UAAU,KAAK;AAC/C,QAAM,QAAQ,CAAC,OAAO,QAAQ,EAAE,OAAO,CAAC,UAA2B,CAAC,CAAC,SAAS,MAAM,SAAS,CAAC;AAC9F,MAAI,MAAM,OAAQ,QAAO,MAAM,KAAK,UAAK;AACzC,SAAO,GAAG,IAAI,QAAQ,IAAI,IAAI,QAAQ;AACxC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,24 @@
1
+ import { canonicalizeResourceTag, invalidateCrudCache } from "@open-mercato/shared/lib/crud/cache";
2
+ import { AgentProposal, AgentRun } from "../data/entities.js";
3
+ const AGENT_RUN_RESOURCE = canonicalizeResourceTag(AgentRun.name) ?? "agent.run";
4
+ const AGENT_PROPOSAL_RESOURCE = canonicalizeResourceTag(AgentProposal.name) ?? "agent.proposal";
5
+ async function invalidate(container, resource, target, reason) {
6
+ await invalidateCrudCache(
7
+ container,
8
+ resource,
9
+ { id: target.id, organizationId: target.organizationId, tenantId: target.tenantId },
10
+ target.tenantId,
11
+ reason
12
+ );
13
+ }
14
+ function invalidateAgentRunCache(container, target, reason) {
15
+ return invalidate(container, AGENT_RUN_RESOURCE, target, reason);
16
+ }
17
+ function invalidateAgentProposalCache(container, target, reason) {
18
+ return invalidate(container, AGENT_PROPOSAL_RESOURCE, target, reason);
19
+ }
20
+ export {
21
+ invalidateAgentProposalCache,
22
+ invalidateAgentRunCache
23
+ };
24
+ //# sourceMappingURL=crudCache.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/modules/agent_orchestrator/lib/crudCache.ts"],
4
+ "sourcesContent": ["import { canonicalizeResourceTag, invalidateCrudCache } from '@open-mercato/shared/lib/crud/cache'\nimport { AgentProposal, AgentRun } from '../data/entities'\n\n/**\n * CRUD GET-cache invalidation for runs and proposals written outside a route.\n *\n * `/api/agent_orchestrator/runs` and `/api/agent_orchestrator/proposals` are\n * `makeCrudRoute` lists, so under `ENABLE_CRUD_API_CACHE=true` (the integration\n * and snapshot environments, and any deployment that opts in) their responses\n * are cached behind tags the factory flushes on ITS OWN writes. Every write in\n * this module is a Command or an ingestion service instead, so nothing flushed\n * those tags: a disposed proposal kept reading back `pending` and never left the\n * operator's caseload, and a finished run kept reading `running`, until the\n * entry expired on TTL. The same explicit-invalidation precedent as the\n * warranty_claims commands.\n *\n * The tags are derived from the ORM class names rather than written out: neither\n * route configures `events`/`actions`, so `resolveResourceAliasesList` falls back\n * to the entity name, and reading it from the class keeps write and read in step\n * through a rename.\n */\nconst AGENT_RUN_RESOURCE = canonicalizeResourceTag(AgentRun.name) ?? 'agent.run'\nconst AGENT_PROPOSAL_RESOURCE = canonicalizeResourceTag(AgentProposal.name) ?? 'agent.proposal'\n\ntype CacheContainer = Parameters<typeof invalidateCrudCache>[0]\n\nexport type AgentOrchestratorCacheTarget = {\n id: string\n tenantId: string | null\n organizationId: string | null\n}\n\nasync function invalidate(\n container: CacheContainer,\n resource: string,\n target: AgentOrchestratorCacheTarget,\n reason: string,\n): Promise<void> {\n await invalidateCrudCache(\n container,\n resource,\n { id: target.id, organizationId: target.organizationId, tenantId: target.tenantId },\n target.tenantId,\n reason,\n )\n}\n\nexport function invalidateAgentRunCache(\n container: CacheContainer,\n target: AgentOrchestratorCacheTarget,\n reason: string,\n): Promise<void> {\n return invalidate(container, AGENT_RUN_RESOURCE, target, reason)\n}\n\nexport function invalidateAgentProposalCache(\n container: CacheContainer,\n target: AgentOrchestratorCacheTarget,\n reason: string,\n): Promise<void> {\n return invalidate(container, AGENT_PROPOSAL_RESOURCE, target, reason)\n}\n"],
5
+ "mappings": "AAAA,SAAS,yBAAyB,2BAA2B;AAC7D,SAAS,eAAe,gBAAgB;AAoBxC,MAAM,qBAAqB,wBAAwB,SAAS,IAAI,KAAK;AACrE,MAAM,0BAA0B,wBAAwB,cAAc,IAAI,KAAK;AAU/E,eAAe,WACb,WACA,UACA,QACA,QACe;AACf,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,EAAE,IAAI,OAAO,IAAI,gBAAgB,OAAO,gBAAgB,UAAU,OAAO,SAAS;AAAA,IAClF,OAAO;AAAA,IACP;AAAA,EACF;AACF;AAEO,SAAS,wBACd,WACA,QACA,QACe;AACf,SAAO,WAAW,WAAW,oBAAoB,QAAQ,MAAM;AACjE;AAEO,SAAS,6BACd,WACA,QACA,QACe;AACf,SAAO,WAAW,WAAW,yBAAyB,QAAQ,MAAM;AACtE;",
6
+ "names": []
7
+ }
@@ -0,0 +1,51 @@
1
+ import { rankProposalOptions } from "../../data/proposalEnvelope.js";
2
+ const ACTION_RISK_TIERS = ["low", "medium", "high"];
3
+ const RISK_ORDER = { low: 0, medium: 1, high: 2 };
4
+ const DEFAULT_ACTION_RISK = "medium";
5
+ const DEFAULT_TENANT_AUTO_APPROVAL_POLICY = {
6
+ enabled: true,
7
+ maxAutoApproveRisk: "medium"
8
+ };
9
+ function optionActionRisk(option) {
10
+ let highest = "low";
11
+ for (const action of option.actions) {
12
+ const risk = action.risk ?? DEFAULT_ACTION_RISK;
13
+ if (RISK_ORDER[risk] > RISK_ORDER[highest]) highest = risk;
14
+ }
15
+ return option.actions.length === 0 ? DEFAULT_ACTION_RISK : highest;
16
+ }
17
+ function evaluateAutoApproval(input) {
18
+ const { options, onResult } = input;
19
+ const policy = input.tenantPolicy ?? DEFAULT_TENANT_AUTO_APPROVAL_POLICY;
20
+ if ("alwaysAsk" in onResult) return { kind: "review", block: null };
21
+ if (options.length === 0) return { kind: "review", block: null };
22
+ if (!policy.enabled) return { kind: "review", block: "policy" };
23
+ if (input.guardrailsPassed === false) return { kind: "review", block: "guardrail" };
24
+ if (input.traceComplete === false) return { kind: "review", block: "trace_incomplete" };
25
+ const ranked = rankProposalOptions(options);
26
+ const [top, runnerUp] = ranked;
27
+ const risk = input.actionRisk ?? optionActionRisk(top);
28
+ if (RISK_ORDER[risk] > RISK_ORDER[policy.maxAutoApproveRisk]) {
29
+ return { kind: "review", block: "risk" };
30
+ }
31
+ if (typeof top.confidence !== "number") return { kind: "review", block: null };
32
+ if (top.confidence < onResult.autoApproveThreshold) return { kind: "review", block: null };
33
+ const margin = onResult.autoApproveMargin ?? 0;
34
+ if (runnerUp && top.confidence - (runnerUp.confidence ?? 0) < margin) {
35
+ return { kind: "review", block: "near_tie" };
36
+ }
37
+ return { kind: "approve", option: top };
38
+ }
39
+ function autoApprovable(input) {
40
+ const decision = evaluateAutoApproval(input);
41
+ return decision.kind === "approve" ? decision.option : null;
42
+ }
43
+ export {
44
+ ACTION_RISK_TIERS,
45
+ DEFAULT_ACTION_RISK,
46
+ DEFAULT_TENANT_AUTO_APPROVAL_POLICY,
47
+ autoApprovable,
48
+ evaluateAutoApproval,
49
+ optionActionRisk
50
+ };
51
+ //# sourceMappingURL=autoApprovalPolicy.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/modules/agent_orchestrator/lib/disposition/autoApprovalPolicy.ts"],
4
+ "sourcesContent": ["import type { AutoDispositionBlock, ProposalOption } from '../../data/validators'\nimport { rankProposalOptions } from '../../data/proposalEnvelope'\n\n/**\n * The auto-approval POLICY.\n *\n * Auto-approval used to be a single comparison: `confidence >= threshold`. But\n * confidence is the model's evidence about ITSELF. It knows nothing about how\n * damaging the action is, whether the guardrails passed, whether the run left a\n * trace anyone can audit, or what the tenant has decided it is willing to have\n * done unattended.\n *\n * **Confidence is evidence, not authorization.** This module is the one place\n * that turns evidence into a decision, and it takes every input that decision\n * actually depends on.\n *\n * Pure and dependency-free: no ORM, no container, no clock. The disposition\n * service gathers the inputs; this decides.\n */\n\n/**\n * How much damage the proposed action can do if it is wrong.\n *\n * Declared, never inferred from a command id: guessing \"delete\" is high-risk from\n * a substring gets the interesting cases exactly backwards \u2014 a `notify` that\n * emails ten thousand customers is not low risk, and a `deleteDraft` is not high.\n * An undeclared risk is `medium`, which is the conservative reading of \"nobody\n * said\".\n */\nexport const ACTION_RISK_TIERS = ['low', 'medium', 'high'] as const\nexport type ActionRisk = (typeof ACTION_RISK_TIERS)[number]\n\nconst RISK_ORDER: Record<ActionRisk, number> = { low: 0, medium: 1, high: 2 }\n\nexport const DEFAULT_ACTION_RISK: ActionRisk = 'medium'\n\n/**\n * The tenant's standing decision about unattended action.\n *\n * `maxAutoApproveRisk` defaults to `medium`: a tenant that has said nothing has\n * not consented to unattended high-risk writes, and reading silence as consent is\n * the failure this layer exists to prevent.\n */\nexport type TenantAutoApprovalPolicy = {\n /** Master switch. `false` sends every proposal to a human regardless of anything else. */\n enabled: boolean\n maxAutoApproveRisk: ActionRisk\n}\n\nexport const DEFAULT_TENANT_AUTO_APPROVAL_POLICY: TenantAutoApprovalPolicy = {\n enabled: true,\n maxAutoApproveRisk: 'medium',\n}\n\n/**\n * Disposition config carried verbatim from the INVOKE_AGENT node's `onResult`.\n * `alwaysAsk` always routes to a human; otherwise a confidence threshold plus an\n * optional separation MARGIN is ONE of the policy's inputs \u2014 no longer the whole\n * policy.\n */\nexport type DispositionOnResult =\n | { autoApproveThreshold: number; autoApproveMargin?: number }\n | { alwaysAsk: true }\n\nexport type AutoApprovalInput = {\n options: readonly ProposalOption[]\n onResult: DispositionOnResult\n /**\n * Overrides the risk declared on the leading option's actions. For a caller\n * that knows more than the declaration; absent means the option's own.\n */\n actionRisk?: ActionRisk\n /** False when any guardrail check on this run did not pass. */\n guardrailsPassed?: boolean\n /**\n * Whether the run left a trace an auditor can read. A run nobody can review\n * after the fact must not act unattended: that combination is precisely an\n * unaccountable mutation.\n */\n traceComplete?: boolean\n tenantPolicy?: TenantAutoApprovalPolicy\n}\n\n/**\n * The risk of an option \u2014 the HIGHEST risk among the actions its plan runs.\n *\n * A plan is a conjunction: every action in the chosen option happens, so the\n * option is exactly as dangerous as its most dangerous step. Taking the lowest,\n * or an average, would let one safe action launder an unsafe one.\n */\nexport function optionActionRisk(option: ProposalOption): ActionRisk {\n let highest: ActionRisk = 'low'\n for (const action of option.actions) {\n const risk = (action as { risk?: ActionRisk }).risk ?? DEFAULT_ACTION_RISK\n if (RISK_ORDER[risk] > RISK_ORDER[highest]) highest = risk\n }\n return option.actions.length === 0 ? DEFAULT_ACTION_RISK : highest\n}\n\nexport type AutoApprovalDecision =\n | { kind: 'approve'; option: ProposalOption }\n | { kind: 'review'; block: AutoDispositionBlock | null }\n\n/**\n * Decides whether a proposal may be applied without a human.\n *\n * The order is FAIL-CLOSED and load-bearing at every step:\n *\n * 1. `alwaysAsk` short-circuits first. Dropping it makes every `alwaysAsk: true`\n * node start auto-approving, which is the worst regression this module can\n * produce.\n * 2. The tenant switch, then the guardrail verdict, then trace completeness, then\n * the risk of the option that would actually run \u2014 every gate that does not\n * depend on the model's own opinion is answered BEFORE the model's opinion is\n * consulted. A high-confidence proposal to do something the tenant forbids is\n * still forbidden.\n * 3. A missing confidence fails closed to a human, never to approval.\n * 4. Threshold, then margin. The margin exists because a 0.81/0.80 split under an\n * 0.8 threshold is the agent saying it cannot tell its top two apart; reading\n * that as certainty is how an auto-approved wrong answer happens. It defaults\n * to 0, which is the historic rule exactly.\n *\n * A `block` is recorded only when the proposal CLEARED the bar it was measured\n * against and was held anyway \u2014 silence would otherwise read as the threshold\n * simply not being met. `null` means \"did not clear\", which needs no explanation.\n */\nexport function evaluateAutoApproval(input: AutoApprovalInput): AutoApprovalDecision {\n const { options, onResult } = input\n const policy = input.tenantPolicy ?? DEFAULT_TENANT_AUTO_APPROVAL_POLICY\n\n if ('alwaysAsk' in onResult) return { kind: 'review', block: null }\n if (options.length === 0) return { kind: 'review', block: null }\n\n if (!policy.enabled) return { kind: 'review', block: 'policy' }\n if (input.guardrailsPassed === false) return { kind: 'review', block: 'guardrail' }\n if (input.traceComplete === false) return { kind: 'review', block: 'trace_incomplete' }\n\n const ranked = rankProposalOptions(options)\n const [top, runnerUp] = ranked\n\n // Risk is a property of the OPTION that would actually run, so it is weighed\n // against the leading one rather than the set. An explicit `actionRisk` from\n // the caller wins \u2014 it is how a caller that knows more than the declaration\n // (a resolved command catalogue, say) raises the tier.\n const risk = input.actionRisk ?? optionActionRisk(top)\n if (RISK_ORDER[risk] > RISK_ORDER[policy.maxAutoApproveRisk]) {\n return { kind: 'review', block: 'risk' }\n }\n\n if (typeof top.confidence !== 'number') return { kind: 'review', block: null }\n if (top.confidence < onResult.autoApproveThreshold) return { kind: 'review', block: null }\n const margin = onResult.autoApproveMargin ?? 0\n if (runnerUp && top.confidence - (runnerUp.confidence ?? 0) < margin) {\n return { kind: 'review', block: 'near_tie' }\n }\n return { kind: 'approve', option: top }\n}\n\n/** The option auto-approval would run, or null when a human must decide. */\nexport function autoApprovable(input: AutoApprovalInput): ProposalOption | null {\n const decision = evaluateAutoApproval(input)\n return decision.kind === 'approve' ? decision.option : null\n}\n"],
5
+ "mappings": "AACA,SAAS,2BAA2B;AA4B7B,MAAM,oBAAoB,CAAC,OAAO,UAAU,MAAM;AAGzD,MAAM,aAAyC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,EAAE;AAErE,MAAM,sBAAkC;AAexC,MAAM,sCAAgE;AAAA,EAC3E,SAAS;AAAA,EACT,oBAAoB;AACtB;AAsCO,SAAS,iBAAiB,QAAoC;AACnE,MAAI,UAAsB;AAC1B,aAAW,UAAU,OAAO,SAAS;AACnC,UAAM,OAAQ,OAAiC,QAAQ;AACvD,QAAI,WAAW,IAAI,IAAI,WAAW,OAAO,EAAG,WAAU;AAAA,EACxD;AACA,SAAO,OAAO,QAAQ,WAAW,IAAI,sBAAsB;AAC7D;AA6BO,SAAS,qBAAqB,OAAgD;AACnF,QAAM,EAAE,SAAS,SAAS,IAAI;AAC9B,QAAM,SAAS,MAAM,gBAAgB;AAErC,MAAI,eAAe,SAAU,QAAO,EAAE,MAAM,UAAU,OAAO,KAAK;AAClE,MAAI,QAAQ,WAAW,EAAG,QAAO,EAAE,MAAM,UAAU,OAAO,KAAK;AAE/D,MAAI,CAAC,OAAO,QAAS,QAAO,EAAE,MAAM,UAAU,OAAO,SAAS;AAC9D,MAAI,MAAM,qBAAqB,MAAO,QAAO,EAAE,MAAM,UAAU,OAAO,YAAY;AAClF,MAAI,MAAM,kBAAkB,MAAO,QAAO,EAAE,MAAM,UAAU,OAAO,mBAAmB;AAEtF,QAAM,SAAS,oBAAoB,OAAO;AAC1C,QAAM,CAAC,KAAK,QAAQ,IAAI;AAMxB,QAAM,OAAO,MAAM,cAAc,iBAAiB,GAAG;AACrD,MAAI,WAAW,IAAI,IAAI,WAAW,OAAO,kBAAkB,GAAG;AAC5D,WAAO,EAAE,MAAM,UAAU,OAAO,OAAO;AAAA,EACzC;AAEA,MAAI,OAAO,IAAI,eAAe,SAAU,QAAO,EAAE,MAAM,UAAU,OAAO,KAAK;AAC7E,MAAI,IAAI,aAAa,SAAS,qBAAsB,QAAO,EAAE,MAAM,UAAU,OAAO,KAAK;AACzF,QAAM,SAAS,SAAS,qBAAqB;AAC7C,MAAI,YAAY,IAAI,cAAc,SAAS,cAAc,KAAK,QAAQ;AACpE,WAAO,EAAE,MAAM,UAAU,OAAO,WAAW;AAAA,EAC7C;AACA,SAAO,EAAE,MAAM,WAAW,QAAQ,IAAI;AACxC;AAGO,SAAS,eAAe,OAAiD;AAC9E,QAAM,WAAW,qBAAqB,KAAK;AAC3C,SAAO,SAAS,SAAS,YAAY,SAAS,SAAS;AACzD;",
6
+ "names": []
7
+ }
@@ -0,0 +1,190 @@
1
+ import { createLogger } from "@open-mercato/shared/lib/logger";
2
+ import { AgentGuardrailCheck, AgentProposal, AgentSpan } from "../../data/entities.js";
3
+ import { normalizeProposalEnvelope } from "../../data/proposalEnvelope.js";
4
+ import { invalidateAgentProposalCache } from "../crudCache.js";
5
+ import { resolveTenantAutoApprovalPolicy } from "./tenantAutoApprovalPolicy.js";
6
+ import {
7
+ autoApprovable,
8
+ evaluateAutoApproval
9
+ } from "./autoApprovalPolicy.js";
10
+ const logger = createLogger("agent_orchestrator").child({ component: "disposition-service" });
11
+ class DispositionServiceImpl {
12
+ constructor(container) {
13
+ this.container = container;
14
+ }
15
+ async dispose(proposal, onResult, ctx) {
16
+ const { options } = normalizeProposalEnvelope(proposal.payload, proposal.agentId);
17
+ if (options.length === 0) {
18
+ return { kind: "none_proposed", proposalId: proposal.id };
19
+ }
20
+ const decision = evaluateAutoApproval({
21
+ options,
22
+ onResult,
23
+ ...await this.resolvePolicyEvidence(proposal)
24
+ });
25
+ if (decision.kind === "approve") {
26
+ return this.autoApprove(proposal, decision.option);
27
+ }
28
+ return this.raiseUserTask(proposal, ctx, decision.block);
29
+ }
30
+ /**
31
+ * The run-level evidence the policy weighs beside the model's own confidence.
32
+ *
33
+ * Every read here is best-effort and fails CLOSED in the direction that matters:
34
+ * a guardrail table we cannot read reports `guardrailsPassed: false` (an
35
+ * unreadable safety check is not a passed one), while an unreadable tenant
36
+ * policy falls back to the conservative default rather than to "allow
37
+ * everything".
38
+ */
39
+ async resolvePolicyEvidence(proposal) {
40
+ const em = this.container.resolve("em").fork();
41
+ const scope = { tenantId: proposal.tenantId, organizationId: proposal.organizationId };
42
+ let guardrailsPassed = false;
43
+ let traceComplete = false;
44
+ try {
45
+ const [blocked, spanCount] = await Promise.all([
46
+ em.count(AgentGuardrailCheck, { ...scope, agentRunId: proposal.runId, result: "block" }),
47
+ em.count(AgentSpan, { ...scope, agentRunId: proposal.runId })
48
+ ]);
49
+ guardrailsPassed = blocked === 0;
50
+ traceComplete = spanCount > 0;
51
+ } catch (error) {
52
+ logger.warn("auto-approval evidence unavailable; holding the proposal for a human", {
53
+ proposalId: proposal.id,
54
+ error: error instanceof Error ? error.message : String(error)
55
+ });
56
+ }
57
+ return {
58
+ guardrailsPassed,
59
+ traceComplete,
60
+ tenantPolicy: await resolveTenantAutoApprovalPolicy(this.container, proposal.tenantId)
61
+ };
62
+ }
63
+ async autoApprove(proposal, option) {
64
+ const commandBus = this.container.resolve("commandBus");
65
+ const commandCtx = {
66
+ container: this.container,
67
+ auth: null,
68
+ organizationScope: null,
69
+ selectedOrganizationId: proposal.organizationId,
70
+ organizationIds: [proposal.organizationId],
71
+ systemActor: true
72
+ };
73
+ await commandBus.execute(
74
+ "agent_orchestrator.proposals.dispose",
75
+ {
76
+ input: {
77
+ proposalId: proposal.id,
78
+ tenantId: proposal.tenantId,
79
+ organizationId: proposal.organizationId,
80
+ disposition: "auto_approved",
81
+ dispositionBy: "rule:threshold",
82
+ selectedOptionId: option.id,
83
+ skipResume: true
84
+ },
85
+ ctx: commandCtx
86
+ }
87
+ );
88
+ return { kind: "auto_approved", proposalId: proposal.id, selectedOptionId: option.id };
89
+ }
90
+ async raiseUserTask(proposal, ctx, block) {
91
+ if (block) await this.recordAutoDispositionBlock(proposal, block);
92
+ const userTaskId = await this.createUserTask(proposal, ctx);
93
+ return { kind: "user_task", userTaskId, proposalId: proposal.id };
94
+ }
95
+ /**
96
+ * A blocked auto-approval is not a failure — it is a proposal that cleared its
97
+ * threshold and was held anyway, and silence would read as the threshold simply not
98
+ * being met. Written with a targeted `nativeUpdate` for the same reason
99
+ * `recordUserTaskId` is: `updated_at` is the proposal's optimistic-lock token and
100
+ * bumping it here would turn the annotation into a spurious 409 for the operator.
101
+ */
102
+ async recordAutoDispositionBlock(proposal, block) {
103
+ try {
104
+ const em = this.container.resolve("em").fork();
105
+ await em.nativeUpdate(
106
+ AgentProposal,
107
+ { id: proposal.id, tenantId: proposal.tenantId, organizationId: proposal.organizationId },
108
+ { autoDispositionBlock: block }
109
+ );
110
+ proposal.autoDispositionBlock = block;
111
+ await invalidateAgentProposalCache(
112
+ this.container,
113
+ { id: proposal.id, tenantId: proposal.tenantId, organizationId: proposal.organizationId },
114
+ "agent_orchestrator.proposals.auto_block"
115
+ );
116
+ } catch (error) {
117
+ logger.warn("auto-disposition block not recorded", {
118
+ proposalId: proposal.id,
119
+ block,
120
+ error: error instanceof Error ? error.message : String(error)
121
+ });
122
+ }
123
+ }
124
+ async createUserTask(proposal, ctx) {
125
+ try {
126
+ const dispositionTask = await import("@open-mercato/core/modules/workflows/lib/agent-disposition-task");
127
+ const em = this.container.resolve("em").fork();
128
+ const created = await dispositionTask.createAgentDispositionTask(em, this.container, {
129
+ workflowInstanceId: ctx.workflowInstanceId,
130
+ stepId: ctx.stepId,
131
+ proposalId: proposal.id,
132
+ agentId: proposal.agentId,
133
+ proposalPayload: proposal.payload,
134
+ confidence: proposal.confidence ?? null,
135
+ taskName: `Dispose agent proposal (${proposal.agentId})`,
136
+ description: "Review and approve, edit, or reject the agent proposal.",
137
+ review: ctx.review ?? null,
138
+ tenantId: ctx.tenantId,
139
+ organizationId: ctx.organizationId,
140
+ userId: ctx.userId
141
+ });
142
+ await this.recordUserTaskId(proposal, created.userTaskId);
143
+ return created.userTaskId;
144
+ } catch (error) {
145
+ logger.warn("USER_TASK not created (workflows peer absent?)", {
146
+ proposalId: proposal.id,
147
+ workflowInstanceId: ctx.workflowInstanceId,
148
+ error: error instanceof Error ? error.message : String(error)
149
+ });
150
+ return `pending:${proposal.id}`;
151
+ }
152
+ }
153
+ /**
154
+ * Link the proposal to the review task raised for it, so `commands/dispose.ts`
155
+ * can close that task once a verdict lands (A7).
156
+ *
157
+ * A targeted `nativeUpdate` rather than a managed write: it must NOT touch
158
+ * `updated_at`, which is the proposal's optimistic-lock token — bumping it
159
+ * here would invalidate a caseload modal that had already loaded the row and
160
+ * turn the link into a spurious 409 for the operator.
161
+ */
162
+ async recordUserTaskId(proposal, userTaskId) {
163
+ try {
164
+ const em = this.container.resolve("em").fork();
165
+ await em.nativeUpdate(
166
+ AgentProposal,
167
+ { id: proposal.id, tenantId: proposal.tenantId, organizationId: proposal.organizationId },
168
+ { userTaskId }
169
+ );
170
+ proposal.userTaskId = userTaskId;
171
+ await invalidateAgentProposalCache(
172
+ this.container,
173
+ { id: proposal.id, tenantId: proposal.tenantId, organizationId: proposal.organizationId },
174
+ "agent_orchestrator.proposals.review_task"
175
+ );
176
+ } catch (error) {
177
+ logger.warn("proposal not linked to its review task", {
178
+ proposalId: proposal.id,
179
+ userTaskId,
180
+ error: error instanceof Error ? error.message : String(error)
181
+ });
182
+ }
183
+ }
184
+ }
185
+ export {
186
+ DispositionServiceImpl,
187
+ autoApprovable,
188
+ evaluateAutoApproval
189
+ };
190
+ //# sourceMappingURL=dispositionService.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/modules/agent_orchestrator/lib/disposition/dispositionService.ts"],
4
+ "sourcesContent": ["import type { AwilixContainer } from 'awilix'\nimport type { EntityManager } from '@mikro-orm/postgresql'\nimport type { CommandBus, CommandRuntimeContext } from '@open-mercato/shared/lib/commands'\nimport { createLogger } from '@open-mercato/shared/lib/logger'\nimport { AgentGuardrailCheck, AgentProposal, AgentSpan } from '../../data/entities'\nimport type { AutoDispositionBlock, ProposalOption } from '../../data/validators'\nimport { normalizeProposalEnvelope, rankProposalOptions } from '../../data/proposalEnvelope'\nimport type {\n DisposeProposalCommandInput,\n DisposeProposalCommandResult,\n} from '../../commands/dispose'\nimport { invalidateAgentProposalCache } from '../crudCache'\nimport { resolveTenantAutoApprovalPolicy } from './tenantAutoApprovalPolicy'\nimport {\n autoApprovable,\n evaluateAutoApproval,\n type AutoApprovalDecision,\n type DispositionOnResult,\n type TenantAutoApprovalPolicy,\n} from './autoApprovalPolicy'\n\nconst logger = createLogger('agent_orchestrator').child({ component: 'disposition-service' })\n\n/**\n * Disposition config carried verbatim from the INVOKE_AGENT node's `onResult`.\n *\n * `autoApproveMargin` is optional here (not just defaulted in the zod schema)\n * because a queue job enqueued before the field existed carries no value \u2014\n * absent means `0`, which is exactly the historic rule.\n *\n * Re-exported from the policy layer, which owns the decision this feeds.\n */\n\n\n/**\n * The Invoke Agent node's Review section (spec \u00A77.5), already resolved by the\n * workflows engine against the run context. Re-exported from the workflows\n * module so the two sides cannot drift; `workflows` is an OPTIONAL peer, so the\n * import is type-only and erased at run time.\n */\nexport type AgentDispositionReview =\n import('@open-mercato/core/modules/workflows/lib/agent-disposition-task').AgentDispositionReview\n\nexport type DispositionCtx = {\n tenantId: string\n organizationId: string\n userId?: string\n workflowInstanceId: string\n stepId: string\n /**\n * Who reviews this proposal and by when, authored on the agent node. Absent\n * means the unassigned task this service raised before \u00A77.5 \u2014 which under the\n * workflows \u00A76.4 visibility model is a task nobody can act on.\n */\n review?: AgentDispositionReview\n}\n\nexport type DispositionOutcome =\n | { kind: 'auto_approved'; proposalId: string; selectedOptionId: string }\n | { kind: 'user_task'; userTaskId: string; proposalId: string }\n /** The agent proposed nothing; there is no decision to raise and none to auto-approve. */\n | { kind: 'none_proposed'; proposalId: string }\n\nexport interface DispositionService {\n dispose(\n proposal: AgentProposal,\n onResult: DispositionOnResult,\n ctx: DispositionCtx,\n ): Promise<DispositionOutcome>\n}\n\nexport type { AutoApprovalDecision, DispositionOnResult }\nexport { autoApprovable, evaluateAutoApproval }\n\n/**\n * MVP DispositionService \u2014 a thin DI service called INLINE by the area-02\n * `INVOKE_AGENT` executor right after `agentRuntime.run`. It does NOT subscribe\n * to `proposal.created` (an event-driven seam would lose the activity's\n * transaction scope and race `WAIT_FOR_SIGNAL`).\n *\n * - Auto-approve (confidence \u2265 threshold, not `alwaysAsk`): dispose through the\n * audited `agent_orchestrator.proposals.dispose` Command with the internal\n * `auto_approved` verdict (`dispositionBy = 'rule:threshold'`, `skipResume`),\n * then return `{ kind:'auto_approved' }`. The Command emits\n * `proposal.disposed`. NO `proposal.ready` is emitted and the executor\n * proceeds without parking (avoids a park-before-signal race).\n * - Ask-a-human (below threshold / `alwaysAsk` / null confidence): raise a\n * workflows `USER_TASK` surfacing the proposal payload, routed to whoever the\n * agent node's Review section names (spec \u00A77.5); the instance stays parked at\n * `WAIT_FOR_SIGNAL`. Return `{ kind:'user_task' }`. The operator's dispose\n * endpoint later emits `proposal.ready` to resume. Building that row belongs\n * to the workflows module \u2014 it owns the entity, the audit log and the\n * assignment event \u2014 so this service passes the Review descriptor to\n * `createAgentDispositionTask` rather than assembling the row itself.\n *\n * `workflows` is an optional peer: the USER_TASK creation is guarded so the\n * service degrades gracefully when the module is absent (it still returns a\n * `user_task` outcome with a synthetic id).\n */\nexport class DispositionServiceImpl implements DispositionService {\n constructor(private readonly container: AwilixContainer) {}\n\n async dispose(\n proposal: AgentProposal,\n onResult: DispositionOnResult,\n ctx: DispositionCtx,\n ): Promise<DispositionOutcome> {\n const { options } = normalizeProposalEnvelope(proposal.payload, proposal.agentId)\n // Nothing proposed: terminal at creation, so there is neither a decision to raise\n // nor a plan to approve. Routed onto the researcher outcome handle downstream.\n if (options.length === 0) {\n return { kind: 'none_proposed', proposalId: proposal.id }\n }\n const decision = evaluateAutoApproval({\n options,\n onResult,\n ...(await this.resolvePolicyEvidence(proposal)),\n })\n if (decision.kind === 'approve') {\n return this.autoApprove(proposal, decision.option)\n }\n return this.raiseUserTask(proposal, ctx, decision.block)\n }\n\n /**\n * The run-level evidence the policy weighs beside the model's own confidence.\n *\n * Every read here is best-effort and fails CLOSED in the direction that matters:\n * a guardrail table we cannot read reports `guardrailsPassed: false` (an\n * unreadable safety check is not a passed one), while an unreadable tenant\n * policy falls back to the conservative default rather than to \"allow\n * everything\".\n */\n private async resolvePolicyEvidence(proposal: AgentProposal): Promise<{\n guardrailsPassed: boolean\n traceComplete: boolean\n tenantPolicy: TenantAutoApprovalPolicy\n }> {\n const em = (this.container.resolve('em') as EntityManager).fork()\n const scope = { tenantId: proposal.tenantId, organizationId: proposal.organizationId }\n\n let guardrailsPassed = false\n let traceComplete = false\n try {\n const [blocked, spanCount] = await Promise.all([\n em.count(AgentGuardrailCheck, { ...scope, agentRunId: proposal.runId, result: 'block' }),\n em.count(AgentSpan, { ...scope, agentRunId: proposal.runId }),\n ])\n guardrailsPassed = blocked === 0\n // A run that left no trace at all cannot be audited after the fact, and an\n // unauditable mutation is exactly what auto-approval must not produce.\n traceComplete = spanCount > 0\n } catch (error) {\n logger.warn('auto-approval evidence unavailable; holding the proposal for a human', {\n proposalId: proposal.id,\n error: error instanceof Error ? error.message : String(error),\n })\n }\n\n return {\n guardrailsPassed,\n traceComplete,\n tenantPolicy: await resolveTenantAutoApprovalPolicy(this.container, proposal.tenantId),\n }\n }\n\n private async autoApprove(\n proposal: AgentProposal,\n option: ProposalOption,\n ): Promise<DispositionOutcome> {\n const commandBus = this.container.resolve('commandBus') as CommandBus\n const commandCtx: CommandRuntimeContext = {\n container: this.container,\n auth: null,\n organizationScope: null,\n selectedOrganizationId: proposal.organizationId,\n organizationIds: [proposal.organizationId],\n systemActor: true,\n }\n await commandBus.execute<DisposeProposalCommandInput, DisposeProposalCommandResult>(\n 'agent_orchestrator.proposals.dispose',\n {\n input: {\n proposalId: proposal.id,\n tenantId: proposal.tenantId,\n organizationId: proposal.organizationId,\n disposition: 'auto_approved',\n dispositionBy: 'rule:threshold',\n selectedOptionId: option.id,\n skipResume: true,\n },\n ctx: commandCtx,\n },\n )\n return { kind: 'auto_approved', proposalId: proposal.id, selectedOptionId: option.id }\n }\n\n private async raiseUserTask(\n proposal: AgentProposal,\n ctx: DispositionCtx,\n block: AutoDispositionBlock | null,\n ): Promise<DispositionOutcome> {\n if (block) await this.recordAutoDispositionBlock(proposal, block)\n const userTaskId = await this.createUserTask(proposal, ctx)\n return { kind: 'user_task', userTaskId, proposalId: proposal.id }\n }\n\n /**\n * A blocked auto-approval is not a failure \u2014 it is a proposal that cleared its\n * threshold and was held anyway, and silence would read as the threshold simply not\n * being met. Written with a targeted `nativeUpdate` for the same reason\n * `recordUserTaskId` is: `updated_at` is the proposal's optimistic-lock token and\n * bumping it here would turn the annotation into a spurious 409 for the operator.\n */\n private async recordAutoDispositionBlock(\n proposal: AgentProposal,\n block: AutoDispositionBlock,\n ): Promise<void> {\n try {\n const em = (this.container.resolve('em') as EntityManager).fork()\n await em.nativeUpdate(\n AgentProposal,\n { id: proposal.id, tenantId: proposal.tenantId, organizationId: proposal.organizationId },\n { autoDispositionBlock: block },\n )\n proposal.autoDispositionBlock = block\n await invalidateAgentProposalCache(\n this.container as Parameters<typeof invalidateAgentProposalCache>[0],\n { id: proposal.id, tenantId: proposal.tenantId, organizationId: proposal.organizationId },\n 'agent_orchestrator.proposals.auto_block',\n )\n } catch (error) {\n logger.warn('auto-disposition block not recorded', {\n proposalId: proposal.id,\n block,\n error: error instanceof Error ? error.message : String(error),\n })\n }\n }\n\n private async createUserTask(\n proposal: AgentProposal,\n ctx: DispositionCtx,\n ): Promise<string> {\n try {\n const dispositionTask = (await import(\n '@open-mercato/core/modules/workflows/lib/agent-disposition-task'\n )) as typeof import('@open-mercato/core/modules/workflows/lib/agent-disposition-task')\n const em = (this.container.resolve('em') as EntityManager).fork()\n\n const created = await dispositionTask.createAgentDispositionTask(em, this.container, {\n workflowInstanceId: ctx.workflowInstanceId,\n stepId: ctx.stepId,\n proposalId: proposal.id,\n agentId: proposal.agentId,\n proposalPayload: proposal.payload,\n confidence: proposal.confidence ?? null,\n taskName: `Dispose agent proposal (${proposal.agentId})`,\n description: 'Review and approve, edit, or reject the agent proposal.',\n review: ctx.review ?? null,\n tenantId: ctx.tenantId,\n organizationId: ctx.organizationId,\n userId: ctx.userId,\n })\n await this.recordUserTaskId(proposal, created.userTaskId)\n return created.userTaskId\n } catch (error) {\n logger.warn('USER_TASK not created (workflows peer absent?)', {\n proposalId: proposal.id,\n workflowInstanceId: ctx.workflowInstanceId,\n error: error instanceof Error ? error.message : String(error),\n })\n return `pending:${proposal.id}`\n }\n }\n\n /**\n * Link the proposal to the review task raised for it, so `commands/dispose.ts`\n * can close that task once a verdict lands (A7).\n *\n * A targeted `nativeUpdate` rather than a managed write: it must NOT touch\n * `updated_at`, which is the proposal's optimistic-lock token \u2014 bumping it\n * here would invalidate a caseload modal that had already loaded the row and\n * turn the link into a spurious 409 for the operator.\n */\n private async recordUserTaskId(proposal: AgentProposal, userTaskId: string): Promise<void> {\n try {\n const em = (this.container.resolve('em') as EntityManager).fork()\n await em.nativeUpdate(\n AgentProposal,\n { id: proposal.id, tenantId: proposal.tenantId, organizationId: proposal.organizationId },\n { userTaskId },\n )\n proposal.userTaskId = userTaskId\n await invalidateAgentProposalCache(\n this.container as Parameters<typeof invalidateAgentProposalCache>[0],\n { id: proposal.id, tenantId: proposal.tenantId, organizationId: proposal.organizationId },\n 'agent_orchestrator.proposals.review_task',\n )\n } catch (error) {\n // The task exists and the proposal is pending; losing the link costs the\n // automatic close, never the review itself.\n logger.warn('proposal not linked to its review task', {\n proposalId: proposal.id,\n userTaskId,\n error: error instanceof Error ? error.message : String(error),\n })\n }\n }\n}\n"],
5
+ "mappings": "AAGA,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB,eAAe,iBAAiB;AAE9D,SAAS,iCAAsD;AAK/D,SAAS,oCAAoC;AAC7C,SAAS,uCAAuC;AAChD;AAAA,EACE;AAAA,EACA;AAAA,OAIK;AAEP,MAAM,SAAS,aAAa,oBAAoB,EAAE,MAAM,EAAE,WAAW,sBAAsB,CAAC;AA8ErF,MAAM,uBAAqD;AAAA,EAChE,YAA6B,WAA4B;AAA5B;AAAA,EAA6B;AAAA,EAE1D,MAAM,QACJ,UACA,UACA,KAC6B;AAC7B,UAAM,EAAE,QAAQ,IAAI,0BAA0B,SAAS,SAAS,SAAS,OAAO;AAGhF,QAAI,QAAQ,WAAW,GAAG;AACxB,aAAO,EAAE,MAAM,iBAAiB,YAAY,SAAS,GAAG;AAAA,IAC1D;AACA,UAAM,WAAW,qBAAqB;AAAA,MACpC;AAAA,MACA;AAAA,MACA,GAAI,MAAM,KAAK,sBAAsB,QAAQ;AAAA,IAC/C,CAAC;AACD,QAAI,SAAS,SAAS,WAAW;AAC/B,aAAO,KAAK,YAAY,UAAU,SAAS,MAAM;AAAA,IACnD;AACA,WAAO,KAAK,cAAc,UAAU,KAAK,SAAS,KAAK;AAAA,EACzD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWA,MAAc,sBAAsB,UAIjC;AACD,UAAM,KAAM,KAAK,UAAU,QAAQ,IAAI,EAAoB,KAAK;AAChE,UAAM,QAAQ,EAAE,UAAU,SAAS,UAAU,gBAAgB,SAAS,eAAe;AAErF,QAAI,mBAAmB;AACvB,QAAI,gBAAgB;AACpB,QAAI;AACF,YAAM,CAAC,SAAS,SAAS,IAAI,MAAM,QAAQ,IAAI;AAAA,QAC7C,GAAG,MAAM,qBAAqB,EAAE,GAAG,OAAO,YAAY,SAAS,OAAO,QAAQ,QAAQ,CAAC;AAAA,QACvF,GAAG,MAAM,WAAW,EAAE,GAAG,OAAO,YAAY,SAAS,MAAM,CAAC;AAAA,MAC9D,CAAC;AACD,yBAAmB,YAAY;AAG/B,sBAAgB,YAAY;AAAA,IAC9B,SAAS,OAAO;AACd,aAAO,KAAK,wEAAwE;AAAA,QAClF,YAAY,SAAS;AAAA,QACrB,OAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAAA,MAC9D,CAAC;AAAA,IACH;AAEA,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA,cAAc,MAAM,gCAAgC,KAAK,WAAW,SAAS,QAAQ;AAAA,IACvF;AAAA,EACF;AAAA,EAEA,MAAc,YACZ,UACA,QAC6B;AAC7B,UAAM,aAAa,KAAK,UAAU,QAAQ,YAAY;AACtD,UAAM,aAAoC;AAAA,MACxC,WAAW,KAAK;AAAA,MAChB,MAAM;AAAA,MACN,mBAAmB;AAAA,MACnB,wBAAwB,SAAS;AAAA,MACjC,iBAAiB,CAAC,SAAS,cAAc;AAAA,MACzC,aAAa;AAAA,IACf;AACA,UAAM,WAAW;AAAA,MACf;AAAA,MACA;AAAA,QACE,OAAO;AAAA,UACL,YAAY,SAAS;AAAA,UACrB,UAAU,SAAS;AAAA,UACnB,gBAAgB,SAAS;AAAA,UACzB,aAAa;AAAA,UACb,eAAe;AAAA,UACf,kBAAkB,OAAO;AAAA,UACzB,YAAY;AAAA,QACd;AAAA,QACA,KAAK;AAAA,MACP;AAAA,IACF;AACA,WAAO,EAAE,MAAM,iBAAiB,YAAY,SAAS,IAAI,kBAAkB,OAAO,GAAG;AAAA,EACvF;AAAA,EAEA,MAAc,cACZ,UACA,KACA,OAC6B;AAC7B,QAAI,MAAO,OAAM,KAAK,2BAA2B,UAAU,KAAK;AAChE,UAAM,aAAa,MAAM,KAAK,eAAe,UAAU,GAAG;AAC1D,WAAO,EAAE,MAAM,aAAa,YAAY,YAAY,SAAS,GAAG;AAAA,EAClE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAc,2BACZ,UACA,OACe;AACf,QAAI;AACF,YAAM,KAAM,KAAK,UAAU,QAAQ,IAAI,EAAoB,KAAK;AAChE,YAAM,GAAG;AAAA,QACP;AAAA,QACA,EAAE,IAAI,SAAS,IAAI,UAAU,SAAS,UAAU,gBAAgB,SAAS,eAAe;AAAA,QACxF,EAAE,sBAAsB,MAAM;AAAA,MAChC;AACA,eAAS,uBAAuB;AAChC,YAAM;AAAA,QACJ,KAAK;AAAA,QACL,EAAE,IAAI,SAAS,IAAI,UAAU,SAAS,UAAU,gBAAgB,SAAS,eAAe;AAAA,QACxF;AAAA,MACF;AAAA,IACF,SAAS,OAAO;AACd,aAAO,KAAK,uCAAuC;AAAA,QACjD,YAAY,SAAS;AAAA,QACrB;AAAA,QACA,OAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAAA,MAC9D,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEA,MAAc,eACZ,UACA,KACiB;AACjB,QAAI;AACF,YAAM,kBAAmB,MAAM,OAC7B,iEACF;AACA,YAAM,KAAM,KAAK,UAAU,QAAQ,IAAI,EAAoB,KAAK;AAEhE,YAAM,UAAU,MAAM,gBAAgB,2BAA2B,IAAI,KAAK,WAAW;AAAA,QACnF,oBAAoB,IAAI;AAAA,QACxB,QAAQ,IAAI;AAAA,QACZ,YAAY,SAAS;AAAA,QACrB,SAAS,SAAS;AAAA,QAClB,iBAAiB,SAAS;AAAA,QAC1B,YAAY,SAAS,cAAc;AAAA,QACnC,UAAU,2BAA2B,SAAS,OAAO;AAAA,QACrD,aAAa;AAAA,QACb,QAAQ,IAAI,UAAU;AAAA,QACtB,UAAU,IAAI;AAAA,QACd,gBAAgB,IAAI;AAAA,QACpB,QAAQ,IAAI;AAAA,MACd,CAAC;AACD,YAAM,KAAK,iBAAiB,UAAU,QAAQ,UAAU;AACxD,aAAO,QAAQ;AAAA,IACjB,SAAS,OAAO;AACd,aAAO,KAAK,kDAAkD;AAAA,QAC5D,YAAY,SAAS;AAAA,QACrB,oBAAoB,IAAI;AAAA,QACxB,OAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAAA,MAC9D,CAAC;AACD,aAAO,WAAW,SAAS,EAAE;AAAA,IAC/B;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWA,MAAc,iBAAiB,UAAyB,YAAmC;AACzF,QAAI;AACF,YAAM,KAAM,KAAK,UAAU,QAAQ,IAAI,EAAoB,KAAK;AAChE,YAAM,GAAG;AAAA,QACP;AAAA,QACA,EAAE,IAAI,SAAS,IAAI,UAAU,SAAS,UAAU,gBAAgB,SAAS,eAAe;AAAA,QACxF,EAAE,WAAW;AAAA,MACf;AACA,eAAS,aAAa;AACtB,YAAM;AAAA,QACJ,KAAK;AAAA,QACL,EAAE,IAAI,SAAS,IAAI,UAAU,SAAS,UAAU,gBAAgB,SAAS,eAAe;AAAA,QACxF;AAAA,MACF;AAAA,IACF,SAAS,OAAO;AAGd,aAAO,KAAK,0CAA0C;AAAA,QACpD,YAAY,SAAS;AAAA,QACrB;AAAA,QACA,OAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAAA,MAC9D,CAAC;AAAA,IACH;AAAA,EACF;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,42 @@
1
+ import { createLogger } from "@open-mercato/shared/lib/logger";
2
+ import { emitAgentOrchestratorEvent } from "../../events.js";
3
+ const logger = createLogger("agent_orchestrator").child({ component: "disposition-resume" });
4
+ async function resumeWorkflowForProposal(container, em, input) {
5
+ await emitAgentOrchestratorEvent(
6
+ "agent_orchestrator.proposal.ready",
7
+ {
8
+ workflowInstanceId: input.workflowInstanceId,
9
+ stepId: input.stepId,
10
+ proposalId: input.proposalId,
11
+ tenantId: input.tenantId,
12
+ organizationId: input.organizationId
13
+ },
14
+ { persistent: true }
15
+ );
16
+ try {
17
+ const signalHandler = await import("@open-mercato/core/modules/workflows/lib/signal-handler");
18
+ await signalHandler.sendSignal(em, container, {
19
+ instanceId: input.workflowInstanceId,
20
+ signalName: "agent_orchestrator.proposal.ready",
21
+ payload: {
22
+ proposalId: input.proposalId,
23
+ stepId: input.stepId,
24
+ disposition: input.disposition,
25
+ proposalPayload: input.proposalPayload
26
+ },
27
+ userId: input.userId ?? void 0,
28
+ tenantId: input.tenantId,
29
+ organizationId: input.organizationId
30
+ });
31
+ } catch (error) {
32
+ logger.warn("proposal.ready resume signal not delivered", {
33
+ workflowInstanceId: input.workflowInstanceId,
34
+ proposalId: input.proposalId,
35
+ error: error instanceof Error ? error.message : String(error)
36
+ });
37
+ }
38
+ }
39
+ export {
40
+ resumeWorkflowForProposal
41
+ };
42
+ //# sourceMappingURL=resume.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/modules/agent_orchestrator/lib/disposition/resume.ts"],
4
+ "sourcesContent": ["import type { AwilixContainer } from 'awilix'\nimport type { EntityManager } from '@mikro-orm/postgresql'\nimport { createLogger } from '@open-mercato/shared/lib/logger'\nimport { emitAgentOrchestratorEvent } from '../../events'\nimport type { AgentProposalDisposition } from '../../data/entities'\n\nconst logger = createLogger('agent_orchestrator').child({ component: 'disposition-resume' })\n\nexport type ResumeWorkflowForProposalInput = {\n proposalId: string\n workflowInstanceId: string\n stepId: string | null\n disposition: AgentProposalDisposition\n proposalPayload?: unknown\n tenantId: string\n organizationId: string\n userId?: string | null\n}\n\n/**\n * Human-path resume seam (area 03 \u2192 area 02).\n *\n * Emits the `agent_orchestrator.proposal.ready { workflowInstanceId, stepId, proposalId }`\n * audit/broadcast event, then delivers the resume signal to the parked workflow\n * instance via the workflows module's `sendSignal`. Area 02's `WAIT_FOR_SIGNAL`\n * keys on `signalName = 'agent_orchestrator.proposal.ready'` and matches the\n * parked instance by `workflowInstanceId`; the merged `disposition`/`payload` lands in\n * `WorkflowInstance.context` so the downstream effector reads the approved\n * (possibly edited) payload. A `rejected` proposal resumes too \u2014 the workflow\n * definition's effector transition condition (`disposition \u2208 {auto_approved,\n * approved, edited}`) skips the effector.\n *\n * The auto-approve path NEVER reaches here (the executor proceeded inline and\n * never parked). `proposal.ready` is therefore the human-path resume signal only.\n *\n * `workflows` is an optional peer: the resume is best-effort and degrades\n * gracefully (logs) when the module is absent, so the disposition itself is\n * already committed and audited regardless of signal delivery.\n */\nexport async function resumeWorkflowForProposal(\n container: AwilixContainer,\n em: EntityManager,\n input: ResumeWorkflowForProposalInput,\n): Promise<void> {\n await emitAgentOrchestratorEvent(\n 'agent_orchestrator.proposal.ready',\n {\n workflowInstanceId: input.workflowInstanceId,\n stepId: input.stepId,\n proposalId: input.proposalId,\n tenantId: input.tenantId,\n organizationId: input.organizationId,\n },\n { persistent: true },\n )\n\n try {\n const signalHandler = (await import(\n '@open-mercato/core/modules/workflows/lib/signal-handler'\n )) as typeof import('@open-mercato/core/modules/workflows/lib/signal-handler')\n await signalHandler.sendSignal(em, container, {\n instanceId: input.workflowInstanceId,\n signalName: 'agent_orchestrator.proposal.ready',\n payload: {\n proposalId: input.proposalId,\n stepId: input.stepId,\n disposition: input.disposition,\n proposalPayload: input.proposalPayload,\n },\n userId: input.userId ?? undefined,\n tenantId: input.tenantId,\n organizationId: input.organizationId,\n })\n } catch (error) {\n logger.warn('proposal.ready resume signal not delivered', {\n workflowInstanceId: input.workflowInstanceId,\n proposalId: input.proposalId,\n error: error instanceof Error ? error.message : String(error),\n })\n }\n}\n"],
5
+ "mappings": "AAEA,SAAS,oBAAoB;AAC7B,SAAS,kCAAkC;AAG3C,MAAM,SAAS,aAAa,oBAAoB,EAAE,MAAM,EAAE,WAAW,qBAAqB,CAAC;AAiC3F,eAAsB,0BACpB,WACA,IACA,OACe;AACf,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,MACE,oBAAoB,MAAM;AAAA,MAC1B,QAAQ,MAAM;AAAA,MACd,YAAY,MAAM;AAAA,MAClB,UAAU,MAAM;AAAA,MAChB,gBAAgB,MAAM;AAAA,IACxB;AAAA,IACA,EAAE,YAAY,KAAK;AAAA,EACrB;AAEA,MAAI;AACF,UAAM,gBAAiB,MAAM,OAC3B,yDACF;AACA,UAAM,cAAc,WAAW,IAAI,WAAW;AAAA,MAC5C,YAAY,MAAM;AAAA,MAClB,YAAY;AAAA,MACZ,SAAS;AAAA,QACP,YAAY,MAAM;AAAA,QAClB,QAAQ,MAAM;AAAA,QACd,aAAa,MAAM;AAAA,QACnB,iBAAiB,MAAM;AAAA,MACzB;AAAA,MACA,QAAQ,MAAM,UAAU;AAAA,MACxB,UAAU,MAAM;AAAA,MAChB,gBAAgB,MAAM;AAAA,IACxB,CAAC;AAAA,EACH,SAAS,OAAO;AACd,WAAO,KAAK,8CAA8C;AAAA,MACxD,oBAAoB,MAAM;AAAA,MAC1B,YAAY,MAAM;AAAA,MAClB,OAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAAA,IAC9D,CAAC;AAAA,EACH;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,59 @@
1
+ import { z } from "zod";
2
+ import { createLogger } from "@open-mercato/shared/lib/logger";
3
+ import {
4
+ ACTION_RISK_TIERS,
5
+ DEFAULT_TENANT_AUTO_APPROVAL_POLICY
6
+ } from "./autoApprovalPolicy.js";
7
+ const logger = createLogger("agent_orchestrator").child({ component: "tenant-auto-approval-policy" });
8
+ const AUTO_APPROVAL_CONFIG_MODULE = "agent_orchestrator";
9
+ const AUTO_APPROVAL_CONFIG_NAME = "auto_approval_policy";
10
+ const tenantAutoApprovalPolicySchema = z.object({
11
+ enabled: z.boolean(),
12
+ maxAutoApproveRisk: z.enum(ACTION_RISK_TIERS)
13
+ });
14
+ function resolveModuleConfig(container) {
15
+ try {
16
+ return container.resolve("moduleConfigService");
17
+ } catch {
18
+ return null;
19
+ }
20
+ }
21
+ async function resolveTenantAutoApprovalPolicy(container, tenantId) {
22
+ return (await readTenantAutoApprovalPolicy(container, tenantId)).policy;
23
+ }
24
+ async function readTenantAutoApprovalPolicy(container, tenantId) {
25
+ const fallback = {
26
+ policy: DEFAULT_TENANT_AUTO_APPROVAL_POLICY,
27
+ source: "default"
28
+ };
29
+ const service = resolveModuleConfig(container);
30
+ if (!service) return fallback;
31
+ try {
32
+ const record = await service.getRecord(AUTO_APPROVAL_CONFIG_MODULE, AUTO_APPROVAL_CONFIG_NAME, {
33
+ tenantId
34
+ });
35
+ if (!record) return fallback;
36
+ const parsed = tenantAutoApprovalPolicySchema.safeParse(record.value);
37
+ if (!parsed.success) {
38
+ logger.warn("stored auto-approval policy is malformed; using the conservative default", {
39
+ tenantId
40
+ });
41
+ return fallback;
42
+ }
43
+ return { policy: parsed.data, source: "tenant" };
44
+ } catch (error) {
45
+ logger.warn("auto-approval policy unreadable; using the conservative default", {
46
+ tenantId,
47
+ error: error instanceof Error ? error.message : String(error)
48
+ });
49
+ return fallback;
50
+ }
51
+ }
52
+ export {
53
+ AUTO_APPROVAL_CONFIG_MODULE,
54
+ AUTO_APPROVAL_CONFIG_NAME,
55
+ readTenantAutoApprovalPolicy,
56
+ resolveTenantAutoApprovalPolicy,
57
+ tenantAutoApprovalPolicySchema
58
+ };
59
+ //# sourceMappingURL=tenantAutoApprovalPolicy.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/modules/agent_orchestrator/lib/disposition/tenantAutoApprovalPolicy.ts"],
4
+ "sourcesContent": ["import type { AwilixContainer } from 'awilix'\nimport { z } from 'zod'\nimport { createLogger } from '@open-mercato/shared/lib/logger'\nimport {\n ACTION_RISK_TIERS,\n DEFAULT_TENANT_AUTO_APPROVAL_POLICY,\n type TenantAutoApprovalPolicy,\n} from './autoApprovalPolicy'\n\nconst logger = createLogger('agent_orchestrator').child({ component: 'tenant-auto-approval-policy' })\n\nexport const AUTO_APPROVAL_CONFIG_MODULE = 'agent_orchestrator'\nexport const AUTO_APPROVAL_CONFIG_NAME = 'auto_approval_policy'\n\nexport const tenantAutoApprovalPolicySchema = z.object({\n enabled: z.boolean(),\n maxAutoApproveRisk: z.enum(ACTION_RISK_TIERS),\n})\n\ntype ModuleConfigServiceLike = {\n getRecord(\n moduleId: string,\n name: string,\n scope?: { tenantId?: string | null },\n ): Promise<{ value: unknown } | null>\n}\n\nfunction resolveModuleConfig(container: AwilixContainer): ModuleConfigServiceLike | null {\n try {\n return container.resolve('moduleConfigService') as ModuleConfigServiceLike\n } catch {\n return null\n }\n}\n\n/**\n * The tenant's standing decision about what may happen without a human.\n *\n * A tenant that has configured nothing gets\n * `DEFAULT_TENANT_AUTO_APPROVAL_POLICY` \u2014 enabled, ceiling `medium` \u2014 which is\n * the historic behaviour for every action nobody has declared risky, and refuses\n * unattended `high`-risk actions. Reading an unset policy as \"allow everything\"\n * would make the ceiling opt-in, i.e. absent exactly where it matters.\n *\n * A malformed or unreadable record falls back to that default rather than\n * failing the disposition: losing per-tenant tuning is recoverable, losing the\n * ability to dispose a proposal is not. It is never read as a LOOSER policy than\n * the default \u2014 the schema only accepts a complete object, so a partially\n * corrupted record cannot raise the ceiling by omission.\n */\nexport async function resolveTenantAutoApprovalPolicy(\n container: AwilixContainer,\n tenantId: string | null,\n): Promise<TenantAutoApprovalPolicy> {\n return (await readTenantAutoApprovalPolicy(container, tenantId)).policy\n}\n\n/**\n * Where the effective policy came from \u2014 `'tenant'` when this tenant actually\n * saved one, `'default'` when it is inheriting.\n *\n * The disposition path does not care (a policy is a policy), but the settings\n * screen does: an admin looking at `enabled: true / medium` has to be able to\n * tell \"we decided this\" from \"nobody has decided anything yet\", and every\n * fallback arm below \u2014 no store, no record, a malformed record, an unreadable\n * one \u2014 is honestly `'default'`.\n */\nexport type TenantAutoApprovalPolicySource = 'tenant' | 'default'\n\nexport async function readTenantAutoApprovalPolicy(\n container: AwilixContainer,\n tenantId: string | null,\n): Promise<{ policy: TenantAutoApprovalPolicy; source: TenantAutoApprovalPolicySource }> {\n const fallback = {\n policy: DEFAULT_TENANT_AUTO_APPROVAL_POLICY,\n source: 'default' as const,\n }\n const service = resolveModuleConfig(container)\n if (!service) return fallback\n try {\n const record = await service.getRecord(AUTO_APPROVAL_CONFIG_MODULE, AUTO_APPROVAL_CONFIG_NAME, {\n tenantId,\n })\n if (!record) return fallback\n const parsed = tenantAutoApprovalPolicySchema.safeParse(record.value)\n if (!parsed.success) {\n logger.warn('stored auto-approval policy is malformed; using the conservative default', {\n tenantId,\n })\n return fallback\n }\n return { policy: parsed.data, source: 'tenant' }\n } catch (error) {\n logger.warn('auto-approval policy unreadable; using the conservative default', {\n tenantId,\n error: error instanceof Error ? error.message : String(error),\n })\n return fallback\n }\n}\n"],
5
+ "mappings": "AACA,SAAS,SAAS;AAClB,SAAS,oBAAoB;AAC7B;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AAEP,MAAM,SAAS,aAAa,oBAAoB,EAAE,MAAM,EAAE,WAAW,8BAA8B,CAAC;AAE7F,MAAM,8BAA8B;AACpC,MAAM,4BAA4B;AAElC,MAAM,iCAAiC,EAAE,OAAO;AAAA,EACrD,SAAS,EAAE,QAAQ;AAAA,EACnB,oBAAoB,EAAE,KAAK,iBAAiB;AAC9C,CAAC;AAUD,SAAS,oBAAoB,WAA4D;AACvF,MAAI;AACF,WAAO,UAAU,QAAQ,qBAAqB;AAAA,EAChD,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAiBA,eAAsB,gCACpB,WACA,UACmC;AACnC,UAAQ,MAAM,6BAA6B,WAAW,QAAQ,GAAG;AACnE;AAcA,eAAsB,6BACpB,WACA,UACuF;AACvF,QAAM,WAAW;AAAA,IACf,QAAQ;AAAA,IACR,QAAQ;AAAA,EACV;AACA,QAAM,UAAU,oBAAoB,SAAS;AAC7C,MAAI,CAAC,QAAS,QAAO;AACrB,MAAI;AACF,UAAM,SAAS,MAAM,QAAQ,UAAU,6BAA6B,2BAA2B;AAAA,MAC7F;AAAA,IACF,CAAC;AACD,QAAI,CAAC,OAAQ,QAAO;AACpB,UAAM,SAAS,+BAA+B,UAAU,OAAO,KAAK;AACpE,QAAI,CAAC,OAAO,SAAS;AACnB,aAAO,KAAK,4EAA4E;AAAA,QACtF;AAAA,MACF,CAAC;AACD,aAAO;AAAA,IACT;AACA,WAAO,EAAE,QAAQ,OAAO,MAAM,QAAQ,SAAS;AAAA,EACjD,SAAS,OAAO;AACd,WAAO,KAAK,mEAAmE;AAAA,MAC7E;AAAA,MACA,OAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAAA,IAC9D,CAAC;AACD,WAAO;AAAA,EACT;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,53 @@
1
+ import { evalCaseAssertionRefSchema } from "../../data/validators.js";
2
+ import { parseScorerConfig, resolveScorerKey } from "./registry/index.js";
3
+ function parseCaseAssertionRefs(raw) {
4
+ if (!Array.isArray(raw)) return [];
5
+ return raw.flatMap((entry) => {
6
+ const parsed = evalCaseAssertionRefSchema.safeParse(entry);
7
+ if (!parsed.success) return [];
8
+ return [
9
+ {
10
+ assertionId: parsed.data.assertionId,
11
+ configOverride: parsed.data.configOverride ?? null,
12
+ disabled: parsed.data.disabled === true
13
+ }
14
+ ];
15
+ });
16
+ }
17
+ function resolveEffectiveAssertions(assertions, refs) {
18
+ const bySlug = /* @__PURE__ */ new Map();
19
+ for (const assertion of assertions) {
20
+ const current = bySlug.get(assertion.key);
21
+ if (!current) {
22
+ bySlug.set(assertion.key, assertion);
23
+ continue;
24
+ }
25
+ const incomingIsSpecific = assertion.appliesTo !== "*";
26
+ const currentIsSpecific = current.appliesTo !== "*";
27
+ const wouldWeakenGate = current.severity === "gate" && assertion.severity !== "gate";
28
+ if (incomingIsSpecific && !currentIsSpecific && !wouldWeakenGate) bySlug.set(assertion.key, assertion);
29
+ }
30
+ const refsById = new Map(refs.map((ref) => [ref.assertionId, ref]));
31
+ const resolved = [];
32
+ for (const assertion of bySlug.values()) {
33
+ const ref = refsById.get(assertion.id);
34
+ if (ref?.disabled) continue;
35
+ const scorerKey = resolveScorerKey(assertion);
36
+ const stored = assertion.config ?? {};
37
+ const config = ref?.configOverride ? { ...stored, ...ref.configOverride } : stored;
38
+ if (ref?.configOverride) {
39
+ const parsed = parseScorerConfig(scorerKey, config);
40
+ if (!parsed.ok) {
41
+ resolved.push({ assertion, scorerKey, config, configError: parsed.issues });
42
+ continue;
43
+ }
44
+ }
45
+ resolved.push({ assertion, scorerKey, config });
46
+ }
47
+ return resolved;
48
+ }
49
+ export {
50
+ parseCaseAssertionRefs,
51
+ resolveEffectiveAssertions
52
+ };
53
+ //# sourceMappingURL=assertionResolution.js.map