@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,157 @@
1
+ import { NextResponse } from "next/server";
2
+ import { z } from "zod";
3
+ import { getAuthFromRequest } from "@open-mercato/shared/lib/auth/server";
4
+ import { createRequestContainer } from "@open-mercato/shared/lib/di/container";
5
+ import { isCrudHttpError } from "@open-mercato/shared/lib/crud/errors";
6
+ import { readJsonSafe } from "@open-mercato/shared/lib/http/readJsonSafe";
7
+ import { AgentEvalSuiteRun } from "../../data/entities.js";
8
+ import { evalRunCreateSchema, evalRunListQuerySchema } from "../../data/validators.js";
9
+ import { replaySuiteRun } from "../../lib/eval/evalReplayService.js";
10
+ import { AGENT_ORCHESTRATOR_EVAL_SUITE_QUEUE, getAgentOrchestratorQueue } from "../../lib/queue.js";
11
+ import { agentOrchestratorTag } from "../openapi.js";
12
+ const metadata = {
13
+ GET: { requireAuth: true, requireFeatures: ["agent_orchestrator.eval.manage"] },
14
+ POST: { requireAuth: true, requireFeatures: ["agent_orchestrator.eval.run"] }
15
+ };
16
+ const MAX_SYNCHRONOUS_CASE_RUNS = 5;
17
+ const errorSchema = z.object({ error: z.string() });
18
+ function toScope(auth) {
19
+ return { tenantId: auth.tenantId, organizationId: auth.orgId };
20
+ }
21
+ async function GET(req) {
22
+ const auth = await getAuthFromRequest(req);
23
+ if (!auth) return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
24
+ if (!auth.tenantId || !auth.orgId) return NextResponse.json({ error: "Tenant context required" }, { status: 400 });
25
+ const url = new URL(req.url);
26
+ const parsed = evalRunListQuerySchema.safeParse(Object.fromEntries(url.searchParams));
27
+ if (!parsed.success) return NextResponse.json({ error: "Invalid query" }, { status: 400 });
28
+ const query = parsed.data;
29
+ const container = await createRequestContainer();
30
+ const em = container.resolve("em").fork();
31
+ const where = toScope(auth);
32
+ if (query.agentDefinitionId) where.agentDefinitionId = query.agentDefinitionId;
33
+ if (query.status) where.status = query.status;
34
+ const [items, total] = await em.findAndCount(AgentEvalSuiteRun, where, {
35
+ orderBy: { createdAt: "DESC" },
36
+ limit: query.pageSize,
37
+ offset: (query.page - 1) * query.pageSize
38
+ });
39
+ return NextResponse.json({
40
+ items: items.map((run) => ({
41
+ id: run.id,
42
+ agent_definition_id: run.agentDefinitionId,
43
+ trigger: run.trigger,
44
+ status: run.status,
45
+ outcome: run.outcome ?? null,
46
+ case_count: run.caseCount,
47
+ error_count: run.errorCount,
48
+ pass_score: run.passScore ?? null,
49
+ score_variance: run.scoreVariance ?? null,
50
+ repeat_count: run.repeatCount,
51
+ judge_may_gate: run.judgeMayGate,
52
+ triggered_by: run.triggeredBy ?? null,
53
+ started_at: run.startedAt?.toISOString() ?? null,
54
+ finished_at: run.finishedAt?.toISOString() ?? null,
55
+ created_at: run.createdAt.toISOString()
56
+ })),
57
+ total,
58
+ page: query.page,
59
+ pageSize: query.pageSize
60
+ });
61
+ }
62
+ async function POST(req) {
63
+ const auth = await getAuthFromRequest(req);
64
+ if (!auth) return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
65
+ if (!auth.tenantId || !auth.orgId || !auth.sub) {
66
+ return NextResponse.json({ error: "Tenant context required" }, { status: 400 });
67
+ }
68
+ const body = await readJsonSafe(req, {});
69
+ const parsed = evalRunCreateSchema.safeParse(body);
70
+ if (!parsed.success) {
71
+ return NextResponse.json({ error: "Invalid body", issues: parsed.error.issues }, { status: 400 });
72
+ }
73
+ const input = parsed.data;
74
+ const requested = input.evalCaseIds.length * input.repeatCount;
75
+ const container = await createRequestContainer();
76
+ const commandBus = container.resolve("commandBus");
77
+ const scope = toScope(auth);
78
+ const commandCtx = {
79
+ container,
80
+ auth: { sub: auth.sub, tenantId: auth.tenantId, orgId: auth.orgId },
81
+ organizationScope: null,
82
+ selectedOrganizationId: auth.orgId,
83
+ organizationIds: [auth.orgId],
84
+ request: req
85
+ };
86
+ try {
87
+ const { result: started } = await commandBus.execute(
88
+ "agent_orchestrator.evalRuns.start",
89
+ {
90
+ input: {
91
+ ...scope,
92
+ agentDefinitionId: input.agentDefinitionId,
93
+ evalCaseIds: input.evalCaseIds,
94
+ repeatCount: input.repeatCount,
95
+ trigger: "manual",
96
+ judgeMayGate: input.judgeMayGate,
97
+ triggeredBy: auth.sub
98
+ },
99
+ ctx: commandCtx
100
+ }
101
+ );
102
+ if (requested > MAX_SYNCHRONOUS_CASE_RUNS) {
103
+ await getAgentOrchestratorQueue(AGENT_ORCHESTRATOR_EVAL_SUITE_QUEUE).enqueue({
104
+ suiteRunId: started.suiteRunId
105
+ });
106
+ return NextResponse.json(
107
+ { suiteRunId: started.suiteRunId, status: "queued", outcome: null, passScore: null, caseRunCount: started.caseRunCount },
108
+ { status: 202 }
109
+ );
110
+ }
111
+ await replaySuiteRun(container, started.suiteRunId, scope, auth.sub);
112
+ const { result: completed } = await commandBus.execute("agent_orchestrator.evalRuns.complete", {
113
+ input: { ...scope, suiteRunId: started.suiteRunId },
114
+ ctx: commandCtx
115
+ });
116
+ return NextResponse.json({ ...completed, caseRunCount: started.caseRunCount });
117
+ } catch (err) {
118
+ if (isCrudHttpError(err)) return NextResponse.json(err.body, { status: err.status });
119
+ throw err;
120
+ }
121
+ }
122
+ const openApi = {
123
+ tag: agentOrchestratorTag,
124
+ summary: "List and trigger agent evaluation runs",
125
+ methods: {
126
+ GET: {
127
+ summary: "Paginated history of evaluation runs for the organization",
128
+ description: "Suite-run history, newest first. Filterable by agentDefinitionId and status. pageSize is capped at 100. Gated by agent_orchestrator.eval.manage.",
129
+ responses: [{ status: 200, description: "Paged suite runs" }],
130
+ errors: [
131
+ { status: 401, description: "Unauthorized", schema: errorSchema },
132
+ { status: 403, description: "Missing agent_orchestrator.eval.manage", schema: errorSchema }
133
+ ]
134
+ },
135
+ POST: {
136
+ summary: "Run an evaluation of an agent against selected approved eval cases",
137
+ description: `Replays each selected case through the real agent runtime (FRESH inference under the agent's own principal, propose-only: no proposal is ever disposed) and scores the resulting run against the effective assertion set. Only approved cases are accepted. Selections of 5 case runs or fewer execute inline and return 200 with the finished summary; larger ones are queued and return 202 with status "queued" \u2014 follow them via the eval_case_run.* SSE events. Gated by agent_orchestrator.eval.run.`,
138
+ responses: [
139
+ { status: 200, description: "The completed suite run summary (executed inline)" },
140
+ { status: 202, description: "The suite run was queued for the eval worker" }
141
+ ],
142
+ errors: [
143
+ { status: 400, description: "Invalid body", schema: errorSchema },
144
+ { status: 401, description: "Unauthorized", schema: errorSchema },
145
+ { status: 403, description: "Missing agent_orchestrator.eval.run", schema: errorSchema },
146
+ { status: 422, description: "No approved cases matched, or selection too large", schema: errorSchema }
147
+ ]
148
+ }
149
+ }
150
+ };
151
+ export {
152
+ GET,
153
+ POST,
154
+ metadata,
155
+ openApi
156
+ };
157
+ //# sourceMappingURL=route.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/modules/agent_orchestrator/api/eval-runs/route.ts"],
4
+ "sourcesContent": ["import { NextResponse } from 'next/server'\nimport { z } from 'zod'\nimport type { EntityManager } from '@mikro-orm/postgresql'\nimport type { OpenApiRouteDoc } from '@open-mercato/shared/lib/openapi'\nimport { getAuthFromRequest } from '@open-mercato/shared/lib/auth/server'\nimport { createRequestContainer } from '@open-mercato/shared/lib/di/container'\nimport type { CommandBus, CommandRuntimeContext } from '@open-mercato/shared/lib/commands'\nimport { isCrudHttpError } from '@open-mercato/shared/lib/crud/errors'\nimport { readJsonSafe } from '@open-mercato/shared/lib/http/readJsonSafe'\nimport { AgentEvalSuiteRun } from '../../data/entities'\nimport { evalRunCreateSchema, evalRunListQuerySchema } from '../../data/validators'\nimport { replaySuiteRun } from '../../lib/eval/evalReplayService'\nimport { AGENT_ORCHESTRATOR_EVAL_SUITE_QUEUE, getAgentOrchestratorQueue } from '../../lib/queue'\nimport type {\n CompleteEvalRunCommandInput,\n CompleteEvalRunCommandResult,\n StartEvalRunCommandInput,\n StartEvalRunCommandResult,\n} from '../../commands/evalRuns'\nimport { agentOrchestratorTag } from '../openapi'\n\n/**\n * Evaluation runs. `eval.run` is required to TRIGGER one because a run performs\n * real inference against a real model; reading history needs only `eval.manage`.\n */\nexport const metadata = {\n GET: { requireAuth: true, requireFeatures: ['agent_orchestrator.eval.manage'] },\n POST: { requireAuth: true, requireFeatures: ['agent_orchestrator.eval.run'] },\n}\n\n/**\n * Small selections run INLINE so the caller gets a finished result in one round\n * trip (and the trigger dialog can show it immediately). Anything larger would\n * outlive a serverless request, so it is handed to the eval-suite worker and the\n * caller follows progress over SSE.\n */\nconst MAX_SYNCHRONOUS_CASE_RUNS = 5\n\nconst errorSchema = z.object({ error: z.string() })\n\nfunction toScope(auth: { tenantId?: string | null; orgId?: string | null }) {\n return { tenantId: auth.tenantId as string, organizationId: auth.orgId as string }\n}\n\nexport async function GET(req: Request) {\n const auth = await getAuthFromRequest(req)\n if (!auth) return NextResponse.json({ error: 'Unauthorized' }, { status: 401 })\n if (!auth.tenantId || !auth.orgId) return NextResponse.json({ error: 'Tenant context required' }, { status: 400 })\n\n const url = new URL(req.url)\n const parsed = evalRunListQuerySchema.safeParse(Object.fromEntries(url.searchParams))\n if (!parsed.success) return NextResponse.json({ error: 'Invalid query' }, { status: 400 })\n const query = parsed.data\n\n const container = await createRequestContainer()\n const em = (container.resolve('em') as EntityManager).fork()\n\n const where: Record<string, unknown> = toScope(auth)\n if (query.agentDefinitionId) where.agentDefinitionId = query.agentDefinitionId\n if (query.status) where.status = query.status\n\n const [items, total] = await em.findAndCount(AgentEvalSuiteRun, where, {\n orderBy: { createdAt: 'DESC' },\n limit: query.pageSize,\n offset: (query.page - 1) * query.pageSize,\n })\n\n return NextResponse.json({\n items: items.map((run) => ({\n id: run.id,\n agent_definition_id: run.agentDefinitionId,\n trigger: run.trigger,\n status: run.status,\n outcome: run.outcome ?? null,\n case_count: run.caseCount,\n error_count: run.errorCount,\n pass_score: run.passScore ?? null,\n score_variance: run.scoreVariance ?? null,\n repeat_count: run.repeatCount,\n judge_may_gate: run.judgeMayGate,\n triggered_by: run.triggeredBy ?? null,\n started_at: run.startedAt?.toISOString() ?? null,\n finished_at: run.finishedAt?.toISOString() ?? null,\n created_at: run.createdAt.toISOString(),\n })),\n total,\n page: query.page,\n pageSize: query.pageSize,\n })\n}\n\nexport async function POST(req: Request) {\n const auth = await getAuthFromRequest(req)\n if (!auth) return NextResponse.json({ error: 'Unauthorized' }, { status: 401 })\n if (!auth.tenantId || !auth.orgId || !auth.sub) {\n return NextResponse.json({ error: 'Tenant context required' }, { status: 400 })\n }\n\n const body = await readJsonSafe<unknown>(req, {})\n const parsed = evalRunCreateSchema.safeParse(body)\n if (!parsed.success) {\n return NextResponse.json({ error: 'Invalid body', issues: parsed.error.issues }, { status: 400 })\n }\n const input = parsed.data\n\n const requested = input.evalCaseIds.length * input.repeatCount\n\n const container = await createRequestContainer()\n const commandBus = container.resolve('commandBus') as CommandBus\n const scope = toScope(auth)\n const commandCtx: CommandRuntimeContext = {\n container,\n auth: { sub: auth.sub, tenantId: auth.tenantId, orgId: auth.orgId } as CommandRuntimeContext['auth'],\n organizationScope: null,\n selectedOrganizationId: auth.orgId,\n organizationIds: [auth.orgId],\n request: req,\n }\n\n try {\n const { result: started } = await commandBus.execute<StartEvalRunCommandInput, StartEvalRunCommandResult>(\n 'agent_orchestrator.evalRuns.start',\n {\n input: {\n ...scope,\n agentDefinitionId: input.agentDefinitionId,\n evalCaseIds: input.evalCaseIds,\n repeatCount: input.repeatCount,\n trigger: 'manual',\n judgeMayGate: input.judgeMayGate,\n triggeredBy: auth.sub,\n },\n ctx: commandCtx,\n },\n )\n\n if (requested > MAX_SYNCHRONOUS_CASE_RUNS) {\n // Enqueued AFTER the suite run and its pending case runs are committed, so\n // the worker always finds a complete, durable work list \u2014 and a payload\n // carrying only the id cannot cross tenants.\n await getAgentOrchestratorQueue(AGENT_ORCHESTRATOR_EVAL_SUITE_QUEUE).enqueue({\n suiteRunId: started.suiteRunId,\n })\n return NextResponse.json(\n { suiteRunId: started.suiteRunId, status: 'queued', outcome: null, passScore: null, caseRunCount: started.caseRunCount },\n { status: 202 },\n )\n }\n\n await replaySuiteRun(container, started.suiteRunId, scope, auth.sub)\n\n const { result: completed } = await commandBus.execute<\n CompleteEvalRunCommandInput,\n CompleteEvalRunCommandResult\n >('agent_orchestrator.evalRuns.complete', {\n input: { ...scope, suiteRunId: started.suiteRunId },\n ctx: commandCtx,\n })\n\n return NextResponse.json({ ...completed, caseRunCount: started.caseRunCount })\n } catch (err) {\n if (isCrudHttpError(err)) return NextResponse.json(err.body, { status: err.status })\n throw err\n }\n}\n\nexport const openApi: OpenApiRouteDoc = {\n tag: agentOrchestratorTag,\n summary: 'List and trigger agent evaluation runs',\n methods: {\n GET: {\n summary: 'Paginated history of evaluation runs for the organization',\n description:\n 'Suite-run history, newest first. Filterable by agentDefinitionId and status. pageSize is capped at 100. Gated by agent_orchestrator.eval.manage.',\n responses: [{ status: 200, description: 'Paged suite runs' }],\n errors: [\n { status: 401, description: 'Unauthorized', schema: errorSchema },\n { status: 403, description: 'Missing agent_orchestrator.eval.manage', schema: errorSchema },\n ],\n },\n POST: {\n summary: 'Run an evaluation of an agent against selected approved eval cases',\n description:\n 'Replays each selected case through the real agent runtime (FRESH inference under the agent\\'s own principal, propose-only: no proposal is ever disposed) and scores the resulting run against the effective assertion set. Only approved cases are accepted. Selections of 5 case runs or fewer execute inline and return 200 with the finished summary; larger ones are queued and return 202 with status \"queued\" \u2014 follow them via the eval_case_run.* SSE events. Gated by agent_orchestrator.eval.run.',\n responses: [\n { status: 200, description: 'The completed suite run summary (executed inline)' },\n { status: 202, description: 'The suite run was queued for the eval worker' },\n ],\n errors: [\n { status: 400, description: 'Invalid body', schema: errorSchema },\n { status: 401, description: 'Unauthorized', schema: errorSchema },\n { status: 403, description: 'Missing agent_orchestrator.eval.run', schema: errorSchema },\n { status: 422, description: 'No approved cases matched, or selection too large', schema: errorSchema },\n ],\n },\n },\n}\n"],
5
+ "mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,SAAS;AAGlB,SAAS,0BAA0B;AACnC,SAAS,8BAA8B;AAEvC,SAAS,uBAAuB;AAChC,SAAS,oBAAoB;AAC7B,SAAS,yBAAyB;AAClC,SAAS,qBAAqB,8BAA8B;AAC5D,SAAS,sBAAsB;AAC/B,SAAS,qCAAqC,iCAAiC;AAO/E,SAAS,4BAA4B;AAM9B,MAAM,WAAW;AAAA,EACtB,KAAK,EAAE,aAAa,MAAM,iBAAiB,CAAC,gCAAgC,EAAE;AAAA,EAC9E,MAAM,EAAE,aAAa,MAAM,iBAAiB,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A,EACtC,KAAK;AAAA,EACL,SAAS;AAAA,EACT,SAAS;AAAA,IACP,KAAK;AAAA,MACH,SAAS;AAAA,MACT,aACE;AAAA,MACF,WAAW,CAAC,EAAE,QAAQ,KAAK,aAAa,mBAAmB,CAAC;AAAA,MAC5D,QAAQ;AAAA,QACN,EAAE,QAAQ,KAAK,aAAa,gBAAgB,QAAQ,YAAY;AAAA,QAChE,EAAE,QAAQ,KAAK,aAAa,0CAA0C,QAAQ,YAAY;AAAA,MAC5F;AAAA,IACF;AAAA,IACA,MAAM;AAAA,MACJ,SAAS;AAAA,MACT,aACE;AAAA,MACF,WAAW;AAAA,QACT,EAAE,QAAQ,KAAK,aAAa,oDAAoD;AAAA,QAChF,EAAE,QAAQ,KAAK,aAAa,+CAA+C;AAAA,MAC7E;AAAA,MACA,QAAQ;AAAA,QACN,EAAE,QAAQ,KAAK,aAAa,gBAAgB,QAAQ,YAAY;AAAA,QAChE,EAAE,QAAQ,KAAK,aAAa,gBAAgB,QAAQ,YAAY;AAAA,QAChE,EAAE,QAAQ,KAAK,aAAa,uCAAuC,QAAQ,YAAY;AAAA,QACvF,EAAE,QAAQ,KAAK,aAAa,qDAAqD,QAAQ,YAAY;AAAA,MACvG;AAAA,IACF;AAAA,EACF;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,34 @@
1
+ import { NextResponse } from "next/server";
2
+ import { z } from "zod";
3
+ import { describeScorers } from "../../lib/eval/registry/index.js";
4
+ import { agentOrchestratorTag } from "../openapi.js";
5
+ const metadata = {
6
+ GET: { requireAuth: true, requireFeatures: ["agent_orchestrator.eval.manage"] }
7
+ };
8
+ const errorSchema = z.object({ error: z.string() });
9
+ let cached = null;
10
+ async function GET() {
11
+ if (!cached) cached = { scorers: describeScorers() };
12
+ return NextResponse.json(cached);
13
+ }
14
+ const openApi = {
15
+ tag: agentOrchestratorTag,
16
+ summary: "List available eval scorers",
17
+ methods: {
18
+ GET: {
19
+ summary: "Scorer registry descriptors used to render the evaluation-assertion form",
20
+ description: "Returns every registered scorer as { scorerKey, labelKey, group, kind, fields[] }. `fields[]` is UI metadata (kind, label key, bounds, options) from which the assertion form is generated, so a new scorer becomes configurable without a UI change. `kind` maps to the assertion `type` column: only `deterministic` scorers may back a `gate`-severity assertion. Deprecated aliases are included and flagged with `deprecated: true` plus `deprecatedInFavourOf`. Gated by agent_orchestrator.eval.manage.",
21
+ responses: [{ status: 200, description: "Scorer descriptors" }],
22
+ errors: [
23
+ { status: 401, description: "Unauthorized", schema: errorSchema },
24
+ { status: 403, description: "Missing agent_orchestrator.eval.manage", schema: errorSchema }
25
+ ]
26
+ }
27
+ }
28
+ };
29
+ export {
30
+ GET,
31
+ metadata,
32
+ openApi
33
+ };
34
+ //# sourceMappingURL=route.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/modules/agent_orchestrator/api/eval-scorers/route.ts"],
4
+ "sourcesContent": ["import { NextResponse } from 'next/server'\nimport { z } from 'zod'\nimport type { OpenApiRouteDoc } from '@open-mercato/shared/lib/openapi'\nimport { describeScorers } from '../../lib/eval/registry'\nimport { agentOrchestratorTag } from '../openapi'\n\n/**\n * Projection of the scorer registry that DRIVES the generated assertion form.\n *\n * The backend page used to import the registry module directly, which shipped\n * every scorer's zod schema, `score` body and PII regexes to the browser. Serving\n * the descriptors instead keeps the registry server-side and the client bundle\n * flat, and gives third parties a stable contract for the catalog.\n *\n * The payload is a projection of CODE, not of tenant data, so it is identical for\n * every caller and is cached for the process lifetime \u2014 a deploy replaces the\n * process, so there is no invalidation path to get wrong.\n */\nexport const metadata = {\n GET: { requireAuth: true, requireFeatures: ['agent_orchestrator.eval.manage'] },\n}\n\nconst errorSchema = z.object({ error: z.string() })\n\nlet cached: { scorers: ReturnType<typeof describeScorers> } | null = null\n\nexport async function GET() {\n if (!cached) cached = { scorers: describeScorers() }\n return NextResponse.json(cached)\n}\n\nexport const openApi: OpenApiRouteDoc = {\n tag: agentOrchestratorTag,\n summary: 'List available eval scorers',\n methods: {\n GET: {\n summary: 'Scorer registry descriptors used to render the evaluation-assertion form',\n description:\n 'Returns every registered scorer as { scorerKey, labelKey, group, kind, fields[] }. `fields[]` is UI ' +\n 'metadata (kind, label key, bounds, options) from which the assertion form is generated, so a new ' +\n 'scorer becomes configurable without a UI change. `kind` maps to the assertion `type` column: only ' +\n '`deterministic` scorers may back a `gate`-severity assertion. Deprecated aliases are included and ' +\n 'flagged with `deprecated: true` plus `deprecatedInFavourOf`. Gated by agent_orchestrator.eval.manage.',\n responses: [{ status: 200, description: 'Scorer descriptors' }],\n errors: [\n { status: 401, description: 'Unauthorized', schema: errorSchema },\n { status: 403, description: 'Missing agent_orchestrator.eval.manage', schema: errorSchema },\n ],\n },\n },\n}\n"],
5
+ "mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,SAAS;AAElB,SAAS,uBAAuB;AAChC,SAAS,4BAA4B;AAc9B,MAAM,WAAW;AAAA,EACtB,KAAK,EAAE,aAAa,MAAM,iBAAiB,CAAC,gCAAgC,EAAE;AAChF;AAEA,MAAM,cAAc,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;AAElD,IAAI,SAAiE;AAErE,eAAsB,MAAM;AAC1B,MAAI,CAAC,OAAQ,UAAS,EAAE,SAAS,gBAAgB,EAAE;AACnD,SAAO,aAAa,KAAK,MAAM;AACjC;AAEO,MAAM,UAA2B;AAAA,EACtC,KAAK;AAAA,EACL,SAAS;AAAA,EACT,SAAS;AAAA,IACP,KAAK;AAAA,MACH,SAAS;AAAA,MACT,aACE;AAAA,MAKF,WAAW,CAAC,EAAE,QAAQ,KAAK,aAAa,qBAAqB,CAAC;AAAA,MAC9D,QAAQ;AAAA,QACN,EAAE,QAAQ,KAAK,aAAa,gBAAgB,QAAQ,YAAY;AAAA,QAChE,EAAE,QAAQ,KAAK,aAAa,0CAA0C,QAAQ,YAAY;AAAA,MAC5F;AAAA,IACF;AAAA,EACF;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,72 @@
1
+ import { NextResponse } from "next/server";
2
+ import { z } from "zod";
3
+ import { getAuthFromRequest } from "@open-mercato/shared/lib/auth/server";
4
+ import { createRequestContainer } from "@open-mercato/shared/lib/di/container";
5
+ import { findOneWithDecryption } from "@open-mercato/shared/lib/encryption/find";
6
+ import { ProcessDefinition, ProcessInstance } from "../../../data/entities.js";
7
+ import { buildMilestoneStages, parseMilestonesReached, parseProcessMilestones } from "../../../lib/tasks/milestones.js";
8
+ import { readProcessOutcome } from "../../../lib/tasks/outcome.js";
9
+ import { resolveOutcomeHref } from "../../../lib/tasks/outcomeLink.js";
10
+ const metadata = {
11
+ GET: { requireAuth: true, requireFeatures: ["agent_orchestrator.processes.view"] }
12
+ };
13
+ const idSchema = z.string().uuid();
14
+ const errorSchema = z.object({ error: z.string() });
15
+ async function GET(req, ctx) {
16
+ const auth = await getAuthFromRequest(req);
17
+ if (!auth?.tenantId) return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
18
+ const { id } = await ctx.params;
19
+ const parsedId = idSchema.safeParse(id);
20
+ if (!parsedId.success) return NextResponse.json({ error: "Execution not found" }, { status: 404 });
21
+ const scope = { tenantId: auth.tenantId, organizationId: auth.orgId ?? void 0 };
22
+ const decryptionScope = { tenantId: auth.tenantId, organizationId: auth.orgId ?? null };
23
+ const container = await createRequestContainer();
24
+ const em = container.resolve("em").fork();
25
+ const byInstance = await findOneWithDecryption(
26
+ em,
27
+ ProcessInstance,
28
+ { workflowInstanceId: parsedId.data, ...scope, deletedAt: null },
29
+ void 0,
30
+ decryptionScope
31
+ );
32
+ const execution = byInstance ?? await findOneWithDecryption(
33
+ em,
34
+ ProcessInstance,
35
+ { id: parsedId.data, ...scope, deletedAt: null },
36
+ void 0,
37
+ decryptionScope
38
+ );
39
+ if (!execution) return NextResponse.json({ error: "Execution not found" }, { status: 404 });
40
+ const definition = execution.processDefinitionId ? await em.findOne(ProcessDefinition, { id: execution.processDefinitionId, ...scope, deletedAt: null }) : null;
41
+ const reached = parseMilestonesReached(execution.milestonesReached);
42
+ const terminal = ["completed", "auto_completed", "failed", "cancelled"].includes(execution.status);
43
+ const milestones = definition ? buildMilestoneStages(parseProcessMilestones(definition.milestones), reached, { terminal }) : reached.map((entry) => ({ key: entry.key, label: entry.key, state: "done", at: entry.at }));
44
+ const outcome = readProcessOutcome(execution);
45
+ return NextResponse.json({
46
+ execution,
47
+ milestones,
48
+ outcome: outcome ? { ...outcome, href: resolveOutcomeHref(outcome) } : null
49
+ });
50
+ }
51
+ const openApi = {
52
+ tag: "Agent Orchestrator",
53
+ summary: "Get one business execution",
54
+ methods: {
55
+ GET: {
56
+ summary: "Get a process execution with its milestones and outcome",
57
+ description: "Returns the business-facing view of one execution: derived status, the declared milestones with the ones reached marked done, and the optional outcome with a resolved href. Accepts the execution id or the workflow instance id. Org-scoped; gated by agent_orchestrator.processes.view.",
58
+ responses: [{ status: 200, description: "Process execution" }],
59
+ errors: [
60
+ { status: 401, description: "Unauthorized", schema: errorSchema },
61
+ { status: 403, description: "Missing agent_orchestrator.processes.view", schema: errorSchema },
62
+ { status: 404, description: "Unknown execution id", schema: errorSchema }
63
+ ]
64
+ }
65
+ }
66
+ };
67
+ export {
68
+ GET,
69
+ metadata,
70
+ openApi
71
+ };
72
+ //# sourceMappingURL=route.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/modules/agent_orchestrator/api/executions/%5Bid%5D/route.ts"],
4
+ "sourcesContent": ["import { NextResponse } from 'next/server'\nimport type { EntityManager } from '@mikro-orm/postgresql'\nimport { z } from 'zod'\nimport type { OpenApiRouteDoc } from '@open-mercato/shared/lib/openapi'\nimport { getAuthFromRequest } from '@open-mercato/shared/lib/auth/server'\nimport { createRequestContainer } from '@open-mercato/shared/lib/di/container'\nimport { findOneWithDecryption } from '@open-mercato/shared/lib/encryption/find'\nimport { ProcessDefinition, ProcessInstance } from '../../../data/entities'\nimport { buildMilestoneStages, parseMilestonesReached, parseProcessMilestones } from '../../../lib/tasks/milestones'\nimport { readProcessOutcome } from '../../../lib/tasks/outcome'\nimport { resolveOutcomeHref } from '../../../lib/tasks/outcomeLink'\n\n/**\n * One business execution, as a business reader and an external integrator see it.\n *\n * This is the whole external contract for a running process: its status, the\n * milestones it has reached, what it produced. Nothing here exposes how many\n * agents ran, which runtime executed them, or which workflow step they sat on \u2014\n * that is internal orchestration topology, and an integrator coupled to it cannot\n * be refactored around.\n *\n * `:id` accepts EITHER the execution id or the workflow instance id, because\n * runs, proposals and the trace inspector all carry the latter. Org-scoped \u2014\n * cross-org ids return 404, never the row.\n */\nexport const metadata = {\n GET: { requireAuth: true, requireFeatures: ['agent_orchestrator.processes.view'] },\n}\n\nconst idSchema = z.string().uuid()\n\ntype RouteContext = { params: Promise<{ id: string }> }\n\nconst errorSchema = z.object({ error: z.string() })\n\nexport async function GET(req: Request, ctx: RouteContext) {\n const auth = await getAuthFromRequest(req)\n if (!auth?.tenantId) return NextResponse.json({ error: 'Unauthorized' }, { status: 401 })\n\n const { id } = await ctx.params\n const parsedId = idSchema.safeParse(id)\n if (!parsedId.success) return NextResponse.json({ error: 'Execution not found' }, { status: 404 })\n\n const scope = { tenantId: auth.tenantId, organizationId: auth.orgId ?? undefined }\n const decryptionScope = { tenantId: auth.tenantId, organizationId: auth.orgId ?? null }\n const container = await createRequestContainer()\n const em = (container.resolve('em') as EntityManager).fork()\n\n const byInstance = await findOneWithDecryption(\n em,\n ProcessInstance,\n { workflowInstanceId: parsedId.data, ...scope, deletedAt: null },\n undefined,\n decryptionScope,\n )\n const execution =\n byInstance ??\n (await findOneWithDecryption(\n em,\n ProcessInstance,\n { id: parsedId.data, ...scope, deletedAt: null },\n undefined,\n decryptionScope,\n ))\n if (!execution) return NextResponse.json({ error: 'Execution not found' }, { status: 404 })\n\n // The declared milestone VOCABULARY lives on the definition; what the execution\n // actually reached lives on the row. An execution started outside a business\n // process (straight from the Studio) has no vocabulary, and then the reached\n // list is the whole story it can tell.\n const definition = execution.processDefinitionId\n ? await em.findOne(ProcessDefinition, { id: execution.processDefinitionId, ...scope, deletedAt: null })\n : null\n\n const reached = parseMilestonesReached(execution.milestonesReached)\n const terminal = ['completed', 'auto_completed', 'failed', 'cancelled'].includes(execution.status)\n const milestones = definition\n ? buildMilestoneStages(parseProcessMilestones(definition.milestones), reached, { terminal })\n : reached.map((entry) => ({ key: entry.key, label: entry.key, state: 'done' as const, at: entry.at }))\n\n const outcome = readProcessOutcome(execution)\n\n return NextResponse.json({\n execution,\n milestones,\n outcome: outcome ? { ...outcome, href: resolveOutcomeHref(outcome) } : null,\n })\n}\n\nexport const openApi: OpenApiRouteDoc = {\n tag: 'Agent Orchestrator',\n summary: 'Get one business execution',\n methods: {\n GET: {\n summary: 'Get a process execution with its milestones and outcome',\n description:\n 'Returns the business-facing view of one execution: derived status, the declared milestones with the ones reached marked done, and the optional outcome with a resolved href. Accepts the execution id or the workflow instance id. Org-scoped; gated by agent_orchestrator.processes.view.',\n responses: [{ status: 200, description: 'Process execution' }],\n errors: [\n { status: 401, description: 'Unauthorized', schema: errorSchema },\n { status: 403, description: 'Missing agent_orchestrator.processes.view', schema: errorSchema },\n { status: 404, description: 'Unknown execution id', schema: errorSchema },\n ],\n },\n },\n}\n"],
5
+ "mappings": "AAAA,SAAS,oBAAoB;AAE7B,SAAS,SAAS;AAElB,SAAS,0BAA0B;AACnC,SAAS,8BAA8B;AACvC,SAAS,6BAA6B;AACtC,SAAS,mBAAmB,uBAAuB;AACnD,SAAS,sBAAsB,wBAAwB,8BAA8B;AACrF,SAAS,0BAA0B;AACnC,SAAS,0BAA0B;AAe5B,MAAM,WAAW;AAAA,EACtB,KAAK,EAAE,aAAa,MAAM,iBAAiB,CAAC,mCAAmC,EAAE;AACnF;AAEA,MAAM,WAAW,EAAE,OAAO,EAAE,KAAK;AAIjC,MAAM,cAAc,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;AAElD,eAAsB,IAAI,KAAc,KAA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,SAAS,CAAC,IACzF,QAAQ,IAAI,CAAC,WAAW,EAAE,KAAK,MAAM,KAAK,OAAO,MAAM,KAAK,OAAO,QAAiB,IAAI,MAAM,GAAG,EAAE;AAEvG,QAAM,UAAU,mBAAmB,SAAS;AAE5C,SAAO,aAAa,KAAK;AAAA,IACvB;AAAA,IACA;AAAA,IACA,SAAS,UAAU,EAAE,GAAG,SAAS,MAAM,mBAAmB,OAAO,EAAE,IAAI;AAAA,EACzE,CAAC;AACH;AAEO,MAAM,UAA2B;AAAA,EACtC,KAAK;AAAA,EACL,SAAS;AAAA,EACT,SAAS;AAAA,IACP,KAAK;AAAA,MACH,SAAS;AAAA,MACT,aACE;AAAA,MACF,WAAW,CAAC,EAAE,QAAQ,KAAK,aAAa,oBAAoB,CAAC;AAAA,MAC7D,QAAQ;AAAA,QACN,EAAE,QAAQ,KAAK,aAAa,gBAAgB,QAAQ,YAAY;AAAA,QAChE,EAAE,QAAQ,KAAK,aAAa,6CAA6C,QAAQ,YAAY;AAAA,QAC7F,EAAE,QAAQ,KAAK,aAAa,wBAAwB,QAAQ,YAAY;AAAA,MAC1E;AAAA,IACF;AAAA,EACF;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,185 @@
1
+ import { z } from "zod";
2
+ import { makeCrudRoute } from "@open-mercato/shared/lib/crud/factory";
3
+ import { ProcessInstance } from "../../data/entities.js";
4
+ import { buildExecutionSearchBranches } from "../../lib/processes/executionSearch.js";
5
+ import {
6
+ processExecutionListQuerySchema,
7
+ processMilestoneReachedSchema,
8
+ processRunTriggeredBySchema
9
+ } from "../../data/validators.js";
10
+ import { readProcessOutcome } from "../../lib/tasks/outcome.js";
11
+ import { resolveOutcomeHref } from "../../lib/tasks/outcomeLink.js";
12
+ import {
13
+ createAgentOrchestratorCrudOpenApi,
14
+ createPagedListResponseSchema
15
+ } from "../openapi.js";
16
+ const ENTITY_TYPE = "agent_orchestrator:process_instance";
17
+ const NEEDS_DECISION_STATUSES = ["waiting_on_you", "question_open", "docs_requested", "fraud_hold"];
18
+ const HIGH_VALUE_MINOR = 4e6;
19
+ const STUCK_MS = 24 * 60 * 60 * 1e3;
20
+ const routeMetadata = {
21
+ GET: { requireAuth: true, requireFeatures: ["agent_orchestrator.processes.view"] }
22
+ };
23
+ const metadata = routeMetadata;
24
+ const crud = makeCrudRoute({
25
+ metadata: routeMetadata,
26
+ orm: {
27
+ entity: ProcessInstance,
28
+ idField: "id",
29
+ orgField: "organizationId",
30
+ tenantField: "tenantId"
31
+ },
32
+ indexer: { entityType: ENTITY_TYPE },
33
+ list: {
34
+ schema: processExecutionListQuerySchema,
35
+ entityId: ENTITY_TYPE,
36
+ fields: [
37
+ "id",
38
+ "workflow_instance_id",
39
+ "process_definition_id",
40
+ "workflow_id",
41
+ "workflow_version",
42
+ "triggered_by",
43
+ "idempotency_key",
44
+ "source_entity_type",
45
+ "source_entity_id",
46
+ "subject_type",
47
+ "subject_id",
48
+ "subject_label",
49
+ "subject_title",
50
+ "subject_value_minor",
51
+ "subject_fraud",
52
+ "subject_facets",
53
+ "status",
54
+ "current_stage",
55
+ "milestones_reached",
56
+ "agent_ids",
57
+ "cost_minor",
58
+ "currency",
59
+ "run_count",
60
+ "pending_proposal_count",
61
+ "outcome_type",
62
+ "outcome_id",
63
+ "outcome_label",
64
+ "failure_reason",
65
+ "assignee_user_id",
66
+ "team_id",
67
+ "waiting_since",
68
+ "opened_at",
69
+ "completed_at",
70
+ "last_activity_at",
71
+ "organization_id",
72
+ "tenant_id",
73
+ "created_at",
74
+ "updated_at"
75
+ ],
76
+ sortFieldMap: {
77
+ age: "opened_at",
78
+ openedAt: "opened_at",
79
+ cost: "cost_minor",
80
+ value: "subject_value_minor",
81
+ lastActivity: "last_activity_at",
82
+ status: "status",
83
+ createdAt: "created_at",
84
+ updatedAt: "updated_at",
85
+ completedAt: "completed_at"
86
+ },
87
+ defaultSort: { field: "created_at", dir: "desc" },
88
+ buildFilters: async (query) => {
89
+ const filters = {};
90
+ if (query.id) filters.id = { $eq: query.id };
91
+ if (query.workflowInstanceId) filters.workflow_instance_id = { $eq: query.workflowInstanceId };
92
+ if (query.processDefinitionId) filters.process_definition_id = { $eq: query.processDefinitionId };
93
+ if (query.status) filters.status = { $eq: query.status };
94
+ if (query.subjectType) filters.subject_type = { $eq: query.subjectType };
95
+ if (query.sourceEntityType) filters.source_entity_type = { $eq: query.sourceEntityType };
96
+ if (query.sourceEntityId) filters.source_entity_id = { $eq: query.sourceEntityId };
97
+ if (query.q) {
98
+ const searchBranches = buildExecutionSearchBranches(query.q);
99
+ if (searchBranches) filters.$or = searchBranches;
100
+ }
101
+ switch (query.scope) {
102
+ case "needs_decision":
103
+ filters.status = { $in: NEEDS_DECISION_STATUSES };
104
+ break;
105
+ case "stuck_24h":
106
+ filters.waiting_since = { $lte: new Date(Date.now() - STUCK_MS).toISOString() };
107
+ break;
108
+ case "high_value":
109
+ filters.subject_value_minor = { $gte: HIGH_VALUE_MINOR };
110
+ break;
111
+ case "fraud_flagged":
112
+ filters.subject_fraud = { $eq: true };
113
+ break;
114
+ default:
115
+ break;
116
+ }
117
+ return filters;
118
+ },
119
+ /**
120
+ * The outcome's owning module is resolved HERE, server-side: the module
121
+ * registry lives on the server, and the client must never guess a URL for a
122
+ * module that is not part of the deployment. A null href is the honest
123
+ * degraded answer — the client falls back to the label snapshot.
124
+ */
125
+ transformItem: (item) => {
126
+ const outcome = readProcessOutcome(item);
127
+ return { ...item, outcome_href: outcome ? resolveOutcomeHref(outcome) : null };
128
+ }
129
+ }
130
+ });
131
+ const GET = crud.GET;
132
+ const executionListItemSchema = z.object({
133
+ id: z.string().uuid(),
134
+ workflow_instance_id: z.string().uuid().nullable().optional(),
135
+ process_definition_id: z.string().uuid().nullable().optional(),
136
+ workflow_id: z.string().nullable().optional(),
137
+ workflow_version: z.string().nullable().optional(),
138
+ triggered_by: processRunTriggeredBySchema.nullable().optional(),
139
+ idempotency_key: z.string().nullable().optional(),
140
+ source_entity_type: z.string().nullable().optional(),
141
+ source_entity_id: z.string().uuid().nullable().optional(),
142
+ subject_type: z.string().nullable().optional(),
143
+ subject_id: z.string().nullable().optional(),
144
+ subject_label: z.string().nullable().optional(),
145
+ subject_title: z.string().nullable().optional(),
146
+ subject_value_minor: z.number().nullable().optional(),
147
+ subject_fraud: z.boolean().nullable().optional(),
148
+ subject_facets: z.unknown().nullable().optional(),
149
+ status: z.string(),
150
+ current_stage: z.string().nullable().optional(),
151
+ milestones_reached: z.array(processMilestoneReachedSchema).nullable().optional(),
152
+ agent_ids: z.array(z.string()).nullable().optional(),
153
+ cost_minor: z.number().nullable().optional(),
154
+ currency: z.string().nullable().optional(),
155
+ run_count: z.number().nullable().optional(),
156
+ pending_proposal_count: z.number().nullable().optional(),
157
+ outcome_type: z.string().nullable().optional(),
158
+ outcome_id: z.string().nullable().optional(),
159
+ outcome_label: z.string().nullable().optional(),
160
+ /** Resolved server-side; null when the owning module is absent from this deployment. */
161
+ outcome_href: z.string().nullable().optional(),
162
+ failure_reason: z.string().nullable().optional(),
163
+ assignee_user_id: z.string().uuid().nullable().optional(),
164
+ team_id: z.string().uuid().nullable().optional(),
165
+ waiting_since: z.string().nullable().optional(),
166
+ opened_at: z.string().nullable().optional(),
167
+ completed_at: z.string().nullable().optional(),
168
+ last_activity_at: z.string().nullable().optional(),
169
+ organization_id: z.string().uuid().nullable().optional(),
170
+ tenant_id: z.string().uuid().nullable().optional(),
171
+ created_at: z.string().nullable().optional(),
172
+ updated_at: z.string().nullable().optional()
173
+ });
174
+ const openApi = createAgentOrchestratorCrudOpenApi({
175
+ resourceName: "ProcessExecution",
176
+ pluralName: "Process executions",
177
+ querySchema: processExecutionListQuerySchema,
178
+ listResponseSchema: createPagedListResponseSchema(executionListItemSchema)
179
+ });
180
+ export {
181
+ GET,
182
+ metadata,
183
+ openApi
184
+ };
185
+ //# sourceMappingURL=route.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/modules/agent_orchestrator/api/executions/route.ts"],
4
+ "sourcesContent": ["import { z } from 'zod'\nimport { makeCrudRoute } from '@open-mercato/shared/lib/crud/factory'\nimport { ProcessInstance } from '../../data/entities'\nimport { buildExecutionSearchBranches } from '../../lib/processes/executionSearch'\nimport {\n processExecutionListQuerySchema,\n processMilestoneReachedSchema,\n processRunTriggeredBySchema,\n} from '../../data/validators'\nimport { readProcessOutcome, type ProcessOutcomeColumns } from '../../lib/tasks/outcome'\nimport { resolveOutcomeHref } from '../../lib/tasks/outcomeLink'\nimport {\n createAgentOrchestratorCrudOpenApi,\n createPagedListResponseSchema,\n} from '../openapi'\n\n// PascalCases to the MikroORM class `ProcessInstance` \u2192 real table\n// `process_instances` via ORM metadata (mirrors the proposals route's naming note).\nconst ENTITY_TYPE = 'agent_orchestrator:process_instance'\n\n// `needs_decision` is status-driven (assignment signals are not emitted by\n// workflows yet), and the high-value threshold is a fixed default until it\n// becomes a tenant setting.\nconst NEEDS_DECISION_STATUSES = ['waiting_on_you', 'question_open', 'docs_requested', 'fraud_hold']\nconst HIGH_VALUE_MINOR = 4_000_000\nconst STUCK_MS = 24 * 60 * 60 * 1000\n\nconst routeMetadata = {\n GET: { requireAuth: true, requireFeatures: ['agent_orchestrator.processes.view'] },\n}\n\nexport const metadata = routeMetadata\n\n/**\n * The ONE business-execution surface.\n *\n * It replaces the split between a run ledger and a projection list \u2014 two reads\n * over the same execution that could disagree about its status. Everything a\n * business reader or an external integrator needs is here: the derived status,\n * the milestones reached, the proposal counters, the outcome, and how the\n * execution was entered.\n *\n * Read-only. Executions are created by `processes.startExecution` and advanced by\n * the workflow engine; there is deliberately no POST/PUT/DELETE.\n */\nconst crud = makeCrudRoute<never, never, z.infer<typeof processExecutionListQuerySchema>>({\n metadata: routeMetadata,\n orm: {\n entity: ProcessInstance,\n idField: 'id',\n orgField: 'organizationId',\n tenantField: 'tenantId',\n },\n indexer: { entityType: ENTITY_TYPE },\n list: {\n schema: processExecutionListQuerySchema,\n entityId: ENTITY_TYPE,\n fields: [\n 'id',\n 'workflow_instance_id',\n 'process_definition_id',\n 'workflow_id',\n 'workflow_version',\n 'triggered_by',\n 'idempotency_key',\n 'source_entity_type',\n 'source_entity_id',\n 'subject_type',\n 'subject_id',\n 'subject_label',\n 'subject_title',\n 'subject_value_minor',\n 'subject_fraud',\n 'subject_facets',\n 'status',\n 'current_stage',\n 'milestones_reached',\n 'agent_ids',\n 'cost_minor',\n 'currency',\n 'run_count',\n 'pending_proposal_count',\n 'outcome_type',\n 'outcome_id',\n 'outcome_label',\n 'failure_reason',\n 'assignee_user_id',\n 'team_id',\n 'waiting_since',\n 'opened_at',\n 'completed_at',\n 'last_activity_at',\n 'organization_id',\n 'tenant_id',\n 'created_at',\n 'updated_at',\n ],\n sortFieldMap: {\n age: 'opened_at',\n openedAt: 'opened_at',\n cost: 'cost_minor',\n value: 'subject_value_minor',\n lastActivity: 'last_activity_at',\n status: 'status',\n createdAt: 'created_at',\n updatedAt: 'updated_at',\n completedAt: 'completed_at',\n },\n defaultSort: { field: 'created_at', dir: 'desc' },\n buildFilters: async (query) => {\n const filters: Record<string, unknown> = {}\n if (query.id) filters.id = { $eq: query.id }\n if (query.workflowInstanceId) filters.workflow_instance_id = { $eq: query.workflowInstanceId }\n if (query.processDefinitionId) filters.process_definition_id = { $eq: query.processDefinitionId }\n if (query.status) filters.status = { $eq: query.status }\n if (query.subjectType) filters.subject_type = { $eq: query.subjectType }\n if (query.sourceEntityType) filters.source_entity_type = { $eq: query.sourceEntityType }\n if (query.sourceEntityId) filters.source_entity_id = { $eq: query.sourceEntityId }\n // Matches the subject reference AND the id the list actually shows; every\n // branch is a column of this row, so the factory's tenant/org scope holds.\n if (query.q) {\n const searchBranches = buildExecutionSearchBranches(query.q)\n if (searchBranches) filters.$or = searchBranches\n }\n switch (query.scope) {\n case 'needs_decision':\n filters.status = { $in: NEEDS_DECISION_STATUSES }\n break\n case 'stuck_24h':\n filters.waiting_since = { $lte: new Date(Date.now() - STUCK_MS).toISOString() }\n break\n case 'high_value':\n filters.subject_value_minor = { $gte: HIGH_VALUE_MINOR }\n break\n case 'fraud_flagged':\n filters.subject_fraud = { $eq: true }\n break\n default:\n break\n }\n return filters\n },\n /**\n * The outcome's owning module is resolved HERE, server-side: the module\n * registry lives on the server, and the client must never guess a URL for a\n * module that is not part of the deployment. A null href is the honest\n * degraded answer \u2014 the client falls back to the label snapshot.\n */\n transformItem: (item: ProcessOutcomeColumns & Record<string, unknown>) => {\n const outcome = readProcessOutcome(item)\n return { ...item, outcome_href: outcome ? resolveOutcomeHref(outcome) : null }\n },\n },\n})\n\nexport const GET = crud.GET\n\nconst executionListItemSchema = z.object({\n id: z.string().uuid(),\n workflow_instance_id: z.string().uuid().nullable().optional(),\n process_definition_id: z.string().uuid().nullable().optional(),\n workflow_id: z.string().nullable().optional(),\n workflow_version: z.string().nullable().optional(),\n triggered_by: processRunTriggeredBySchema.nullable().optional(),\n idempotency_key: z.string().nullable().optional(),\n source_entity_type: z.string().nullable().optional(),\n source_entity_id: z.string().uuid().nullable().optional(),\n subject_type: z.string().nullable().optional(),\n subject_id: z.string().nullable().optional(),\n subject_label: z.string().nullable().optional(),\n subject_title: z.string().nullable().optional(),\n subject_value_minor: z.number().nullable().optional(),\n subject_fraud: z.boolean().nullable().optional(),\n subject_facets: z.unknown().nullable().optional(),\n status: z.string(),\n current_stage: z.string().nullable().optional(),\n milestones_reached: z.array(processMilestoneReachedSchema).nullable().optional(),\n agent_ids: z.array(z.string()).nullable().optional(),\n cost_minor: z.number().nullable().optional(),\n currency: z.string().nullable().optional(),\n run_count: z.number().nullable().optional(),\n pending_proposal_count: z.number().nullable().optional(),\n outcome_type: z.string().nullable().optional(),\n outcome_id: z.string().nullable().optional(),\n outcome_label: z.string().nullable().optional(),\n /** Resolved server-side; null when the owning module is absent from this deployment. */\n outcome_href: z.string().nullable().optional(),\n failure_reason: z.string().nullable().optional(),\n assignee_user_id: z.string().uuid().nullable().optional(),\n team_id: z.string().uuid().nullable().optional(),\n waiting_since: z.string().nullable().optional(),\n opened_at: z.string().nullable().optional(),\n completed_at: z.string().nullable().optional(),\n last_activity_at: z.string().nullable().optional(),\n organization_id: z.string().uuid().nullable().optional(),\n tenant_id: z.string().uuid().nullable().optional(),\n created_at: z.string().nullable().optional(),\n updated_at: z.string().nullable().optional(),\n})\n\nexport const openApi = createAgentOrchestratorCrudOpenApi({\n resourceName: 'ProcessExecution',\n pluralName: 'Process executions',\n querySchema: processExecutionListQuerySchema,\n listResponseSchema: createPagedListResponseSchema(executionListItemSchema),\n})\n"],
5
+ "mappings": "AAAA,SAAS,SAAS;AAClB,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;AAChC,SAAS,oCAAoC;AAC7C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,0BAAsD;AAC/D,SAAS,0BAA0B;AACnC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAIP,MAAM,cAAc;AAKpB,MAAM,0BAA0B,CAAC,kBAAkB,iBAAiB,kBAAkB,YAAY;AAClG,MAAM,mBAAmB;AACzB,MAAM,WAAW,KAAK,KAAK,KAAK;AAEhC,MAAM,gBAAgB;AAAA,EACpB,KAAK,EAAE,aAAa,MAAM,iBAAiB,CAAC,mCAAmC,EAAE;AACnF;AAEO,MAAM,WAAW;AAcxB,MAAM,OAAO,cAA6E;AAAA,EACxF,UAAU;AAAA,EACV,KAAK;AAAA,IACH,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,UAAU;AAAA,IACV,aAAa;AAAA,EACf;AAAA,EACA,SAAS,EAAE,YAAY,YAAY;AAAA,EACnC,MAAM;AAAA,IACJ,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,QAAQ;AAAA,MACN;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;A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,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS;AAAA,EACjD,iBAAiB,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS;AAAA,EACvD,WAAW,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS;AAAA,EACjD,YAAY,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS;AAAA,EAC3C,YAAY,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS;AAC7C,CAAC;AAEM,MAAM,UAAU,mCAAmC;AAAA,EACxD,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,oBAAoB,8BAA8B,uBAAuB;AAC3E,CAAC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,61 @@
1
+ import { NextResponse } from "next/server";
2
+ import { z } from "zod";
3
+ import { getAuthFromRequest } from "@open-mercato/shared/lib/auth/server";
4
+ import { getModules } from "@open-mercato/shared/lib/i18n/server";
5
+ const metadata = {
6
+ GET: { requireAuth: true, requireFeatures: ["agent_orchestrator.processes.manage"] }
7
+ };
8
+ async function GET(req) {
9
+ const auth = await getAuthFromRequest(req);
10
+ if (!auth) return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
11
+ const modules = getModules();
12
+ const byId = /* @__PURE__ */ new Map();
13
+ for (const mod of modules || []) {
14
+ const features = mod.features || [];
15
+ for (const feature of features) {
16
+ const id = typeof feature.id === "string" ? feature.id : String(feature.id ?? "");
17
+ if (!id || byId.has(id)) continue;
18
+ byId.set(id, {
19
+ id,
20
+ title: typeof feature.title === "string" && feature.title ? feature.title : id,
21
+ module: typeof feature.module === "string" && feature.module ? feature.module : String(mod.id ?? "")
22
+ });
23
+ }
24
+ }
25
+ const items = Array.from(byId.values()).sort(
26
+ (a, b) => a.module.localeCompare(b.module) || a.id.localeCompare(b.id)
27
+ );
28
+ return NextResponse.json({ items });
29
+ }
30
+ const featureItemSchema = z.object({
31
+ id: z.string(),
32
+ title: z.string(),
33
+ module: z.string()
34
+ });
35
+ const openApi = {
36
+ tag: "Agent Orchestrator",
37
+ summary: "List declared ACL features for the process definition permissions picker",
38
+ methods: {
39
+ GET: {
40
+ summary: "List declared ACL feature ids and titles",
41
+ description: "Flattens the enabled modules\u2019 static feature declarations to id/title/module triples for the agentic-task grantedFeatures picker. Gated by agent_orchestrator.processes.manage.",
42
+ responses: [
43
+ {
44
+ status: 200,
45
+ description: "Declared feature catalog",
46
+ schema: z.object({ items: z.array(featureItemSchema) })
47
+ }
48
+ ],
49
+ errors: [
50
+ { status: 401, description: "Unauthorized", schema: z.object({ error: z.string() }) },
51
+ { status: 403, description: "Missing agent_orchestrator.processes.manage", schema: z.object({ error: z.string() }) }
52
+ ]
53
+ }
54
+ }
55
+ };
56
+ export {
57
+ GET,
58
+ metadata,
59
+ openApi
60
+ };
61
+ //# sourceMappingURL=route.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/modules/agent_orchestrator/api/features/route.ts"],
4
+ "sourcesContent": ["import { NextResponse } from 'next/server'\nimport { z } from 'zod'\nimport type { OpenApiRouteDoc } from '@open-mercato/shared/lib/openapi'\nimport { getAuthFromRequest } from '@open-mercato/shared/lib/auth/server'\nimport { getModules } from '@open-mercato/shared/lib/i18n/server'\n\n/**\n * Read-only feature catalog for the process-definition permissions picker.\n * Mirrors `packages/core/src/modules/auth/api/features.ts` over the same\n * `getModules()` source but is gated `tasks.manage` instead of\n * `auth.acl.manage` \u2014 task admins are generally not ACL admins, yet they need\n * the id vocabulary to grant least-privilege features to a task's execution\n * principal. Ids + titles only; no role or grant data leaks through here.\n */\nexport const metadata = {\n GET: { requireAuth: true, requireFeatures: ['agent_orchestrator.processes.manage'] },\n}\n\ntype FeatureItem = { id: string; title: string; module: string }\n\nexport async function GET(req: Request) {\n const auth = await getAuthFromRequest(req)\n if (!auth) return NextResponse.json({ error: 'Unauthorized' }, { status: 401 })\n const modules = getModules()\n const byId = new Map<string, FeatureItem>()\n for (const mod of modules || []) {\n const features = (mod as { features?: Array<Record<string, unknown>> }).features || []\n for (const feature of features) {\n const id = typeof feature.id === 'string' ? feature.id : String(feature.id ?? '')\n if (!id || byId.has(id)) continue\n byId.set(id, {\n id,\n title: typeof feature.title === 'string' && feature.title ? feature.title : id,\n module: typeof feature.module === 'string' && feature.module ? feature.module : String(mod.id ?? ''),\n })\n }\n }\n const items = Array.from(byId.values()).sort(\n (a, b) => a.module.localeCompare(b.module) || a.id.localeCompare(b.id),\n )\n return NextResponse.json({ items })\n}\n\nconst featureItemSchema = z.object({\n id: z.string(),\n title: z.string(),\n module: z.string(),\n})\n\nexport const openApi: OpenApiRouteDoc = {\n tag: 'Agent Orchestrator',\n summary: 'List declared ACL features for the process definition permissions picker',\n methods: {\n GET: {\n summary: 'List declared ACL feature ids and titles',\n description:\n 'Flattens the enabled modules\u2019 static feature declarations to id/title/module triples for the agentic-task grantedFeatures picker. Gated by agent_orchestrator.processes.manage.',\n responses: [\n {\n status: 200,\n description: 'Declared feature catalog',\n schema: z.object({ items: z.array(featureItemSchema) }),\n },\n ],\n errors: [\n { status: 401, description: 'Unauthorized', schema: z.object({ error: z.string() }) },\n { status: 403, description: 'Missing agent_orchestrator.processes.manage', schema: z.object({ error: z.string() }) },\n ],\n },\n },\n}\n"],
5
+ "mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,SAAS;AAElB,SAAS,0BAA0B;AACnC,SAAS,kBAAkB;AAUpB,MAAM,WAAW;AAAA,EACtB,KAAK,EAAE,aAAa,MAAM,iBAAiB,CAAC,qCAAqC,EAAE;AACrF;AAIA,eAAsB,IAAI,KAAc;AACtC,QAAM,OAAO,MAAM,mBAAmB,GAAG;AACzC,MAAI,CAAC,KAAM,QAAO,aAAa,KAAK,EAAE,OAAO,eAAe,GAAG,EAAE,QAAQ,IAAI,CAAC;AAC9E,QAAM,UAAU,WAAW;AAC3B,QAAM,OAAO,oBAAI,IAAyB;AAC1C,aAAW,OAAO,WAAW,CAAC,GAAG;AAC/B,U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