@hotmeshio/long-tail 0.23.2 → 0.24.1

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 (499) hide show
  1. package/build/adapters/express.d.ts +11 -1
  2. package/build/adapters/express.js +42 -41
  3. package/build/api/auth-sso.d.ts +1 -1
  4. package/build/api/bot-accounts.d.ts +2 -0
  5. package/build/api/bot-accounts.js +4 -0
  6. package/build/api/capabilities.d.ts +7 -2
  7. package/build/api/capabilities.js +13 -2
  8. package/build/api/escalations/analytics.js +5 -0
  9. package/build/api/escalations/bulk.d.ts +2 -0
  10. package/build/api/escalations/bulk.js +9 -4
  11. package/build/api/escalations/helpers.d.ts +5 -0
  12. package/build/api/escalations/helpers.js +7 -0
  13. package/build/api/escalations/metadata.js +3 -0
  14. package/build/api/escalations/single.d.ts +3 -2
  15. package/build/api/escalations/single.js +8 -3
  16. package/build/api/mcp/tools.d.ts +12 -0
  17. package/build/api/mcp/tools.js +113 -9
  18. package/build/api/scan-codes/choice.js +31 -7
  19. package/build/api/settings.js +9 -0
  20. package/build/api/tasks.d.ts +3 -3
  21. package/build/api/tasks.js +30 -7
  22. package/build/api/workflows/input-lookups.js +1 -1
  23. package/build/api/workflows/invocable.js +2 -2
  24. package/build/api/workflows/invocation.js +1 -1
  25. package/build/api/yaml-workflows/cron.d.ts +3 -2
  26. package/build/api/yaml-workflows/cron.js +6 -1
  27. package/build/api/yaml-workflows/deploy.d.ts +15 -2
  28. package/build/api/yaml-workflows/deploy.js +69 -2
  29. package/build/lib/db/schemas/038_oauth_server.sql +46 -0
  30. package/build/lib/db/schemas/039_nats_ws_tickets.sql +12 -0
  31. package/build/lib/events/browser-view.d.ts +20 -0
  32. package/build/lib/events/browser-view.js +117 -0
  33. package/build/lib/events/nats-ws-filter.d.ts +29 -0
  34. package/build/lib/events/nats-ws-filter.js +109 -0
  35. package/build/lib/events/nats-ws-proxy.d.ts +7 -0
  36. package/build/lib/events/nats-ws-proxy.js +86 -7
  37. package/build/lib/events/nats-ws-server-filter.d.ts +16 -0
  38. package/build/lib/events/nats-ws-server-filter.js +56 -0
  39. package/build/lib/events/nats-ws-ticket.d.ts +19 -0
  40. package/build/lib/events/nats-ws-ticket.js +63 -0
  41. package/build/lib/events/socketio.d.ts +10 -1
  42. package/build/lib/events/socketio.js +10 -3
  43. package/build/lib/http/index.d.ts +27 -0
  44. package/build/lib/http/index.js +55 -0
  45. package/build/modules/auth.d.ts +15 -24
  46. package/build/modules/auth.js +43 -126
  47. package/build/modules/capabilities.d.ts +62 -0
  48. package/build/modules/capabilities.js +188 -0
  49. package/build/modules/config.d.ts +19 -0
  50. package/build/modules/config.js +27 -0
  51. package/build/modules/defaults.d.ts +10 -0
  52. package/build/modules/defaults.js +12 -1
  53. package/build/modules/maintenance.d.ts +2 -0
  54. package/build/modules/maintenance.js +7 -0
  55. package/build/modules/mcp-auth.d.ts +11 -0
  56. package/build/modules/mcp-auth.js +56 -0
  57. package/build/modules/oauth-server.d.ts +18 -0
  58. package/build/modules/oauth-server.js +40 -0
  59. package/build/routes/agents.js +47 -14
  60. package/build/routes/announcements.js +2 -2
  61. package/build/routes/auth-sso.js +2 -2
  62. package/build/routes/auth.js +2 -2
  63. package/build/routes/bot-accounts.js +26 -3
  64. package/build/routes/capabilities.js +4 -4
  65. package/build/routes/controlplane.js +2 -2
  66. package/build/routes/dba.js +2 -2
  67. package/build/routes/delegation.js +2 -2
  68. package/build/routes/diagnostics.js +2 -2
  69. package/build/routes/docs.js +2 -2
  70. package/build/routes/domain.js +2 -2
  71. package/build/routes/escalations/accumulate.d.ts +1 -1
  72. package/build/routes/escalations/acting.d.ts +1 -1
  73. package/build/routes/escalations/analytics.d.ts +1 -1
  74. package/build/routes/escalations/bulk.d.ts +1 -1
  75. package/build/routes/escalations/facets.d.ts +1 -1
  76. package/build/routes/escalations/index.js +2 -2
  77. package/build/routes/escalations/list.d.ts +1 -1
  78. package/build/routes/escalations/metadata.d.ts +1 -1
  79. package/build/routes/escalations/related.d.ts +1 -1
  80. package/build/routes/escalations/resolve.d.ts +1 -1
  81. package/build/routes/escalations/single.d.ts +1 -1
  82. package/build/routes/escalations/single.js +1 -1
  83. package/build/routes/exports.js +14 -13
  84. package/build/routes/file-browser.js +9 -8
  85. package/build/routes/files.js +2 -2
  86. package/build/routes/index.js +4 -2
  87. package/build/routes/insight.js +5 -4
  88. package/build/routes/knowledge.js +2 -2
  89. package/build/routes/maintenance.js +2 -2
  90. package/build/routes/mcp-endpoint.d.ts +3 -1
  91. package/build/routes/mcp-endpoint.js +18 -8
  92. package/build/routes/mcp.js +35 -15
  93. package/build/routes/me.js +2 -2
  94. package/build/routes/namespaces.js +4 -3
  95. package/build/routes/nats-credentials.js +27 -3
  96. package/build/routes/oauth-server/authorize.d.ts +2 -0
  97. package/build/routes/oauth-server/authorize.js +110 -0
  98. package/build/routes/oauth-server/grants.d.ts +2 -0
  99. package/build/routes/oauth-server/grants.js +35 -0
  100. package/build/routes/oauth-server/index.d.ts +8 -0
  101. package/build/routes/oauth-server/index.js +52 -0
  102. package/build/routes/oauth-server/registration.d.ts +2 -0
  103. package/build/routes/oauth-server/registration.js +38 -0
  104. package/build/routes/oauth-server/token.d.ts +2 -0
  105. package/build/routes/oauth-server/token.js +100 -0
  106. package/build/routes/oauth-well-known.d.ts +8 -0
  107. package/build/routes/oauth-well-known.js +31 -0
  108. package/build/routes/oauth.js +2 -2
  109. package/build/routes/overview.js +2 -2
  110. package/build/routes/personas.js +2 -2
  111. package/build/routes/pipelines.js +6 -5
  112. package/build/routes/roles.js +2 -2
  113. package/build/routes/scan-codes.js +2 -2
  114. package/build/routes/settings.js +2 -2
  115. package/build/routes/tasks.js +5 -5
  116. package/build/routes/topics.js +21 -9
  117. package/build/routes/users.js +25 -22
  118. package/build/routes/workflow-sets.js +13 -12
  119. package/build/routes/workflows/config.js +15 -2
  120. package/build/routes/workflows/discovery.js +2 -2
  121. package/build/routes/workflows/index.js +2 -2
  122. package/build/routes/workflows/invocation.js +11 -10
  123. package/build/routes/yaml-workflows/cron.js +20 -7
  124. package/build/routes/yaml-workflows/crud.js +13 -12
  125. package/build/routes/yaml-workflows/deployment.js +11 -10
  126. package/build/routes/yaml-workflows/index.js +2 -2
  127. package/build/routes/yaml-workflows/versions.js +2 -2
  128. package/build/services/agent/authority.d.ts +15 -0
  129. package/build/services/agent/authority.js +59 -0
  130. package/build/services/agent/trigger-registry.js +7 -2
  131. package/build/services/auth/bot-api-key.d.ts +2 -0
  132. package/build/services/auth/bot-api-key.js +10 -0
  133. package/build/services/auth/oauth-server/access-token.d.ts +36 -0
  134. package/build/services/auth/oauth-server/access-token.js +80 -0
  135. package/build/services/auth/oauth-server/authorization.d.ts +47 -0
  136. package/build/services/auth/oauth-server/authorization.js +54 -0
  137. package/build/services/auth/oauth-server/constants.d.ts +11 -0
  138. package/build/services/auth/oauth-server/constants.js +16 -0
  139. package/build/services/auth/oauth-server/index.d.ts +3 -0
  140. package/build/services/auth/oauth-server/index.js +27 -0
  141. package/build/services/auth/oauth-server/metadata.d.ts +21 -0
  142. package/build/services/auth/oauth-server/metadata.js +53 -0
  143. package/build/services/auth/oauth-server/registration.d.ts +42 -0
  144. package/build/services/auth/oauth-server/registration.js +134 -0
  145. package/build/services/auth/oauth-server/sql.d.ts +50 -0
  146. package/build/services/auth/oauth-server/sql.js +156 -0
  147. package/build/services/auth/oauth-server/store.d.ts +88 -0
  148. package/build/services/auth/oauth-server/store.js +171 -0
  149. package/build/services/auth/sql.d.ts +1 -0
  150. package/build/services/auth/sql.js +3 -1
  151. package/build/services/cron/index.js +5 -3
  152. package/build/services/escalation/queries.js +7 -2
  153. package/build/services/export/index.d.ts +10 -0
  154. package/build/services/export/index.js +27 -0
  155. package/build/services/invocation-access.d.ts +25 -4
  156. package/build/services/invocation-access.js +39 -7
  157. package/build/services/maintenance/index.js +8 -0
  158. package/build/services/mcp/client/connection-dispatch.d.ts +6 -1
  159. package/build/services/mcp/client/connection-dispatch.js +3 -2
  160. package/build/services/mcp/client/connection-lifecycle.d.ts +10 -2
  161. package/build/services/mcp/client/connection-lifecycle.js +45 -7
  162. package/build/services/mcp/client/connection-test.js +2 -6
  163. package/build/services/mcp/client/connection.d.ts +1 -1
  164. package/build/services/mcp/client/connection.js +3 -1
  165. package/build/services/mcp/client/index.d.ts +2 -2
  166. package/build/services/mcp/client/index.js +4 -1
  167. package/build/services/mcp/client/network-transport.d.ts +12 -0
  168. package/build/services/mcp/client/network-transport.js +20 -0
  169. package/build/services/mcp/client/tools.d.ts +13 -0
  170. package/build/services/mcp/client/tools.js +18 -0
  171. package/build/services/mcp/db-server/index.js +2 -1
  172. package/build/services/mcp/external-server.d.ts +9 -4
  173. package/build/services/mcp/external-server.js +34 -11
  174. package/build/services/mcp/playwright-server/index.js +2 -1
  175. package/build/services/mcp/registered-tools.d.ts +3 -0
  176. package/build/services/mcp/registered-tools.js +7 -0
  177. package/build/services/mcp/seed-service-account.d.ts +4 -1
  178. package/build/services/mcp/seed-service-account.js +11 -6
  179. package/build/services/mcp/server-lifecycle.js +2 -1
  180. package/build/services/workflow-invocation.d.ts +16 -3
  181. package/build/services/workflow-invocation.js +42 -10
  182. package/build/services/yaml-workflow/deployer.d.ts +10 -2
  183. package/build/services/yaml-workflow/deployer.js +17 -5
  184. package/build/services/yaml-workflow/invoke.js +31 -26
  185. package/build/services/yaml-workflow/workers/register.js +3 -13
  186. package/build/services/yaml-workflow/workers/step-tool.d.ts +7 -0
  187. package/build/services/yaml-workflow/workers/step-tool.js +69 -0
  188. package/build/start/config.js +7 -0
  189. package/build/start/index.js +4 -22
  190. package/build/start/server.d.ts +6 -4
  191. package/build/start/server.js +11 -35
  192. package/build/start/socket-auth.js +2 -1
  193. package/build/start/workers.js +1 -1
  194. package/build/system/mcp-servers/admin/agent-subscriptions.js +25 -1
  195. package/build/system/mcp-servers/admin/agents.js +25 -2
  196. package/build/system/mcp-servers/admin/announcements.js +3 -2
  197. package/build/system/mcp-servers/admin/bot-accounts.js +37 -5
  198. package/build/system/mcp-servers/admin/escalations.d.ts +3 -5
  199. package/build/system/mcp-servers/admin/escalations.js +74 -70
  200. package/build/system/mcp-servers/admin/exports.js +7 -1
  201. package/build/system/mcp-servers/admin/index.js +24 -25
  202. package/build/system/mcp-servers/admin/overview.d.ts +2 -2
  203. package/build/system/mcp-servers/admin/run-read.d.ts +2 -0
  204. package/build/system/mcp-servers/admin/run-read.js +5 -0
  205. package/build/system/mcp-servers/admin/scan-codes.d.ts +2 -2
  206. package/build/system/mcp-servers/admin/scan-codes.js +5 -11
  207. package/build/system/mcp-servers/admin/schemas.d.ts +26 -26
  208. package/build/system/mcp-servers/admin/tasks.js +7 -2
  209. package/build/system/mcp-servers/admin/users.js +31 -4
  210. package/build/system/mcp-servers/admin/workflow-config.js +12 -1
  211. package/build/system/mcp-servers/admin/workflows.js +27 -5
  212. package/build/system/mcp-servers/admin/yaml-workflows.js +13 -21
  213. package/build/system/mcp-servers/caller-auth.d.ts +18 -0
  214. package/build/system/mcp-servers/caller-auth.js +29 -0
  215. package/build/system/mcp-servers/claude-code.js +2 -1
  216. package/build/system/mcp-servers/db-query/index.js +2 -1
  217. package/build/system/mcp-servers/file-storage.js +2 -1
  218. package/build/system/mcp-servers/http-fetch.js +2 -1
  219. package/build/system/mcp-servers/human-queue.js +7 -3
  220. package/build/system/mcp-servers/oauth.js +31 -4
  221. package/build/system/mcp-servers/schema-exchange.js +2 -1
  222. package/build/system/mcp-servers/vision.d.ts +1 -0
  223. package/build/system/mcp-servers/vision.js +17 -7
  224. package/build/system/mcp-servers/workflow.js +13 -25
  225. package/build/system/seed/tool-manifests-admin.d.ts +2 -17985
  226. package/build/system/seed/tool-manifests-admin.js +121 -121
  227. package/build/system/seed/tool-manifests-data.d.ts +8 -374
  228. package/build/system/seed/tool-manifests-data.js +22 -4
  229. package/build/system/seed/tool-manifests-escalation.d.ts +2 -352
  230. package/build/system/seed/tool-manifests-escalation.js +11 -1
  231. package/build/system/seed/tool-manifests-events.d.ts +2 -116
  232. package/build/system/seed/tool-manifests-events.js +6 -2
  233. package/build/system/seed/tool-manifests-knowledge.d.ts +2 -221
  234. package/build/system/seed/tool-manifests-knowledge.js +41 -1
  235. package/build/system/seed/tool-manifests-workflows.d.ts +2 -71
  236. package/build/system/seed/tool-manifests-workflows.js +3 -1
  237. package/build/system/workflows/shared/principal-tools.d.ts +20 -0
  238. package/build/system/workflows/shared/principal-tools.js +64 -0
  239. package/build/system/workflows/shared/tool-executor.js +21 -11
  240. package/build/system/workflows/shared/tool-loader.js +8 -1
  241. package/build/tsconfig.tsbuildinfo +1 -1
  242. package/build/types/auth.d.ts +1 -1
  243. package/build/types/capability.d.ts +14 -0
  244. package/build/types/capability.js +2 -0
  245. package/build/types/events.d.ts +1 -1
  246. package/build/types/index.d.ts +3 -1
  247. package/build/types/maintenance.d.ts +2 -2
  248. package/build/types/mcp.d.ts +3 -1
  249. package/build/types/oauth-server.d.ts +52 -0
  250. package/build/types/oauth-server.js +2 -0
  251. package/build/types/startup.d.ts +15 -7
  252. package/build/vitest.config.js +2 -1
  253. package/build/vitest.fast.config.d.ts +2 -0
  254. package/build/vitest.fast.config.js +20 -0
  255. package/build/vitest.llm.config.d.ts +2 -0
  256. package/build/vitest.llm.config.js +16 -0
  257. package/dashboard/dist/assets/{AdminDashboard-BPWsgMfZ.js → AdminDashboard-B3mkMIOT.js} +2 -2
  258. package/dashboard/dist/assets/{AdminDashboard-BPWsgMfZ.js.map → AdminDashboard-B3mkMIOT.js.map} +1 -1
  259. package/dashboard/dist/assets/{AgentConfigPage-De9imyo5.js → AgentConfigPage-CQj2B678.js} +2 -2
  260. package/dashboard/dist/assets/{AgentConfigPage-De9imyo5.js.map → AgentConfigPage-CQj2B678.js.map} +1 -1
  261. package/dashboard/dist/assets/{AgentDetailPage-B6o96Y5G.js → AgentDetailPage-CzrD8JJI.js} +3 -3
  262. package/dashboard/dist/assets/{AgentDetailPage-B6o96Y5G.js.map → AgentDetailPage-CzrD8JJI.js.map} +1 -1
  263. package/dashboard/dist/assets/{AgentsPage-DMEmiK_W.js → AgentsPage-jg2OFwyW.js} +2 -2
  264. package/dashboard/dist/assets/{AgentsPage-DMEmiK_W.js.map → AgentsPage-jg2OFwyW.js.map} +1 -1
  265. package/dashboard/dist/assets/{AvailableEscalationsPage-DeYMngwE.js → AvailableEscalationsPage-IS28XBRe.js} +2 -2
  266. package/dashboard/dist/assets/{AvailableEscalationsPage-DeYMngwE.js.map → AvailableEscalationsPage-IS28XBRe.js.map} +1 -1
  267. package/dashboard/dist/assets/{BotPicker-DDmpgGHZ.js → BotPicker-DvEJFpwS.js} +2 -2
  268. package/dashboard/dist/assets/{BotPicker-DDmpgGHZ.js.map → BotPicker-DvEJFpwS.js.map} +1 -1
  269. package/dashboard/dist/assets/{BulkAssignModal-BqlklomG.js → BulkAssignModal-BoQCi-YC.js} +2 -2
  270. package/dashboard/dist/assets/{BulkAssignModal-BqlklomG.js.map → BulkAssignModal-BoQCi-YC.js.map} +1 -1
  271. package/dashboard/dist/assets/{CapabilitiesPage-DOtjDTbK.js → CapabilitiesPage-kwlrcb_t.js} +2 -2
  272. package/dashboard/dist/assets/{CapabilitiesPage-DOtjDTbK.js.map → CapabilitiesPage-kwlrcb_t.js.map} +1 -1
  273. package/dashboard/dist/assets/{CollapsibleSection-CLr8LP0V.js → CollapsibleSection-UMIV4KIj.js} +2 -2
  274. package/dashboard/dist/assets/{CollapsibleSection-CLr8LP0V.js.map → CollapsibleSection-UMIV4KIj.js.map} +1 -1
  275. package/dashboard/dist/assets/ConfirmDeleteModal-C5puwMg7.js +2 -0
  276. package/dashboard/dist/assets/ConfirmDeleteModal-C5puwMg7.js.map +1 -0
  277. package/dashboard/dist/assets/ConnectedAppsPage-drZa65kP.js +2 -0
  278. package/dashboard/dist/assets/ConnectedAppsPage-drZa65kP.js.map +1 -0
  279. package/dashboard/dist/assets/{CountdownTimer-DxX72PwV.js → CountdownTimer-LG03dVgR.js} +2 -2
  280. package/dashboard/dist/assets/{CountdownTimer-DxX72PwV.js.map → CountdownTimer-LG03dVgR.js.map} +1 -1
  281. package/dashboard/dist/assets/{CredentialsPage-CObc9Rs5.js → CredentialsPage-CaFQ6vLb.js} +2 -2
  282. package/dashboard/dist/assets/{CredentialsPage-CObc9Rs5.js.map → CredentialsPage-CaFQ6vLb.js.map} +1 -1
  283. package/dashboard/dist/assets/{CronLabel-Bb8GoNY5.js → CronLabel-Co5j7tzW.js} +2 -2
  284. package/dashboard/dist/assets/{CronLabel-Bb8GoNY5.js.map → CronLabel-Co5j7tzW.js.map} +1 -1
  285. package/dashboard/dist/assets/{ElapsedCell-CmGhVlYl.js → ElapsedCell-WJyE9G0T.js} +2 -2
  286. package/dashboard/dist/assets/{ElapsedCell-CmGhVlYl.js.map → ElapsedCell-WJyE9G0T.js.map} +1 -1
  287. package/dashboard/dist/assets/{EntityTimelinePanel-B4Jwy1w3.js → EntityTimelinePanel-CDFFfX9d.js} +2 -2
  288. package/dashboard/dist/assets/{EntityTimelinePanel-B4Jwy1w3.js.map → EntityTimelinePanel-CDFFfX9d.js.map} +1 -1
  289. package/dashboard/dist/assets/{EscalationListSchemaPage-CZZbZ4Aa.js → EscalationListSchemaPage-CMrUlaKI.js} +3 -3
  290. package/dashboard/dist/assets/{EscalationListSchemaPage-CZZbZ4Aa.js.map → EscalationListSchemaPage-CMrUlaKI.js.map} +1 -1
  291. package/dashboard/dist/assets/{EscalationSchemaPage-D0ko59_S.js → EscalationSchemaPage-Dx2Lyfrz.js} +2 -2
  292. package/dashboard/dist/assets/{EscalationSchemaPage-D0ko59_S.js.map → EscalationSchemaPage-Dx2Lyfrz.js.map} +1 -1
  293. package/dashboard/dist/assets/{EscalationTimeline-BcnJEKFD.js → EscalationTimeline-d3nvshOk.js} +2 -2
  294. package/dashboard/dist/assets/{EscalationTimeline-BcnJEKFD.js.map → EscalationTimeline-d3nvshOk.js.map} +1 -1
  295. package/dashboard/dist/assets/{EscalationTitleSelect-P0q5sck4.js → EscalationTitleSelect-DWQieOM9.js} +2 -2
  296. package/dashboard/dist/assets/{EscalationTitleSelect-P0q5sck4.js.map → EscalationTitleSelect-DWQieOM9.js.map} +1 -1
  297. package/dashboard/dist/assets/{EscalationsOverview-BLPmh4AF.js → EscalationsOverview-BX8Cpi0X.js} +2 -2
  298. package/dashboard/dist/assets/{EscalationsOverview-BLPmh4AF.js.map → EscalationsOverview-BX8Cpi0X.js.map} +1 -1
  299. package/dashboard/dist/assets/{EventTable-gBzi5tIS.js → EventTable-D1-ITVXS.js} +2 -2
  300. package/dashboard/dist/assets/{EventTable-gBzi5tIS.js.map → EventTable-D1-ITVXS.js.map} +1 -1
  301. package/dashboard/dist/assets/{FilterBar-BulSsWb2.js → FilterBar-ABC9ctin.js} +2 -2
  302. package/dashboard/dist/assets/{FilterBar-BulSsWb2.js.map → FilterBar-ABC9ctin.js.map} +1 -1
  303. package/dashboard/dist/assets/{FormattedValue-BMHRrvrL.js → FormattedValue-k27T4bG7.js} +2 -2
  304. package/dashboard/dist/assets/{FormattedValue-BMHRrvrL.js.map → FormattedValue-k27T4bG7.js.map} +1 -1
  305. package/dashboard/dist/assets/{GraphInvokePage--997yNRr.js → GraphInvokePage-DKUErxWc.js} +2 -2
  306. package/dashboard/dist/assets/{GraphInvokePage--997yNRr.js.map → GraphInvokePage-DKUErxWc.js.map} +1 -1
  307. package/dashboard/dist/assets/{HomePage-CwXFz--v.js → HomePage-C6u9dIpR.js} +2 -2
  308. package/dashboard/dist/assets/{HomePage-CwXFz--v.js.map → HomePage-C6u9dIpR.js.map} +1 -1
  309. package/dashboard/dist/assets/{ListToolbar-Df4qZryJ.js → ListToolbar-gA5rFzkz.js} +2 -2
  310. package/dashboard/dist/assets/{ListToolbar-Df4qZryJ.js.map → ListToolbar-gA5rFzkz.js.map} +1 -1
  311. package/dashboard/dist/assets/{McpOverview-DrogIAKJ.js → McpOverview-BOPo3J_i.js} +2 -2
  312. package/dashboard/dist/assets/{McpOverview-DrogIAKJ.js.map → McpOverview-BOPo3J_i.js.map} +1 -1
  313. package/dashboard/dist/assets/{McpQueryDetailPage-CJmvCAE6.js → McpQueryDetailPage-BRVVi0Zh.js} +2 -2
  314. package/dashboard/dist/assets/{McpQueryDetailPage-CJmvCAE6.js.map → McpQueryDetailPage-BRVVi0Zh.js.map} +1 -1
  315. package/dashboard/dist/assets/{McpQueryPage-lygo4Yq0.js → McpQueryPage-Dmbb6SAc.js} +2 -2
  316. package/dashboard/dist/assets/{McpQueryPage-lygo4Yq0.js.map → McpQueryPage-Dmbb6SAc.js.map} +1 -1
  317. package/dashboard/dist/assets/{McpRunDetailPage-hvns2sCm.js → McpRunDetailPage-bMXNO-6V.js} +2 -2
  318. package/dashboard/dist/assets/{McpRunDetailPage-hvns2sCm.js.map → McpRunDetailPage-bMXNO-6V.js.map} +1 -1
  319. package/dashboard/dist/assets/{McpRunsPage-C2_7spTX.js → McpRunsPage-Bi9AMWja.js} +2 -2
  320. package/dashboard/dist/assets/{McpRunsPage-C2_7spTX.js.map → McpRunsPage-Bi9AMWja.js.map} +1 -1
  321. package/dashboard/dist/assets/{OperationsPage-BlK8WlsY.js → OperationsPage-CvR74ZUJ.js} +3 -3
  322. package/dashboard/dist/assets/{OperationsPage-BlK8WlsY.js.map → OperationsPage-CvR74ZUJ.js.map} +1 -1
  323. package/dashboard/dist/assets/{OperatorDashboard-BeWBiMGX.js → OperatorDashboard-DctmZw10.js} +2 -2
  324. package/dashboard/dist/assets/{OperatorDashboard-BeWBiMGX.js.map → OperatorDashboard-DctmZw10.js.map} +1 -1
  325. package/dashboard/dist/assets/{PersonaDetailPage-CNHpsX_i.js → PersonaDetailPage-Ubqm2rQH.js} +2 -2
  326. package/dashboard/dist/assets/{PersonaDetailPage-CNHpsX_i.js.map → PersonaDetailPage-Ubqm2rQH.js.map} +1 -1
  327. package/dashboard/dist/assets/{PersonasPage-ChASEZRg.js → PersonasPage-BpFL2rpo.js} +2 -2
  328. package/dashboard/dist/assets/{PersonasPage-ChASEZRg.js.map → PersonasPage-BpFL2rpo.js.map} +1 -1
  329. package/dashboard/dist/assets/{PortalPage-D5Lk-PKF.js → PortalPage-Dfc_Q02R.js} +2 -2
  330. package/dashboard/dist/assets/{PortalPage-D5Lk-PKF.js.map → PortalPage-Dfc_Q02R.js.map} +1 -1
  331. package/dashboard/dist/assets/ProcessDetailPage-liJspvQh.js +2 -0
  332. package/dashboard/dist/assets/{ProcessDetailPage-DNgCIwRl.js.map → ProcessDetailPage-liJspvQh.js.map} +1 -1
  333. package/dashboard/dist/assets/{ProcessesListPage-pRjWuWlH.js → ProcessesListPage-C3OM5ZUy.js} +2 -2
  334. package/dashboard/dist/assets/{ProcessesListPage-pRjWuWlH.js.map → ProcessesListPage-C3OM5ZUy.js.map} +1 -1
  335. package/dashboard/dist/assets/ResolverForm-B1_x8Blv.js +8 -0
  336. package/dashboard/dist/assets/ResolverForm-B1_x8Blv.js.map +1 -0
  337. package/dashboard/dist/assets/{RoleDetailPage-Bh_UcfYY.js → RoleDetailPage-CrlYCh-R.js} +2 -2
  338. package/dashboard/dist/assets/{RoleDetailPage-Bh_UcfYY.js.map → RoleDetailPage-CrlYCh-R.js.map} +1 -1
  339. package/dashboard/dist/assets/{RolesPage-CK17N7zz.js → RolesPage-BaazL_pt.js} +2 -2
  340. package/dashboard/dist/assets/{RolesPage-CK17N7zz.js.map → RolesPage-BaazL_pt.js.map} +1 -1
  341. package/dashboard/dist/assets/{RunAsSelector-BEKUP0p2.js → RunAsSelector-DxuV0fa1.js} +2 -2
  342. package/dashboard/dist/assets/{RunAsSelector-BEKUP0p2.js.map → RunAsSelector-DxuV0fa1.js.map} +1 -1
  343. package/dashboard/dist/assets/{ScanCodesPage-Bd0Pflqx.js → ScanCodesPage-C0mvmYTq.js} +2 -2
  344. package/dashboard/dist/assets/{ScanCodesPage-Bd0Pflqx.js.map → ScanCodesPage-C0mvmYTq.js.map} +1 -1
  345. package/dashboard/dist/assets/{ScanSchemeDetailPage-CnuhozmJ.js → ScanSchemeDetailPage-CiJgt5dZ.js} +2 -2
  346. package/dashboard/dist/assets/{ScanSchemeDetailPage-CnuhozmJ.js.map → ScanSchemeDetailPage-CiJgt5dZ.js.map} +1 -1
  347. package/dashboard/dist/assets/{ScanStationPage-CoLc-q3h.js → ScanStationPage-DzGaXc40.js} +2 -2
  348. package/dashboard/dist/assets/{ScanStationPage-CoLc-q3h.js.map → ScanStationPage-DzGaXc40.js.map} +1 -1
  349. package/dashboard/dist/assets/{StickyPagination-COrfvkBi.js → StickyPagination-CqbjVY6T.js} +2 -2
  350. package/dashboard/dist/assets/{StickyPagination-COrfvkBi.js.map → StickyPagination-CqbjVY6T.js.map} +1 -1
  351. package/dashboard/dist/assets/{StreamMessageDetail-Cif2egLy.js → StreamMessageDetail-wX3i0aqs.js} +2 -2
  352. package/dashboard/dist/assets/{StreamMessageDetail-Cif2egLy.js.map → StreamMessageDetail-wX3i0aqs.js.map} +1 -1
  353. package/dashboard/dist/assets/{SwimlaneTimeline-BnZYTrAh.js → SwimlaneTimeline-C50PsFoV.js} +2 -2
  354. package/dashboard/dist/assets/{SwimlaneTimeline-BnZYTrAh.js.map → SwimlaneTimeline-C50PsFoV.js.map} +1 -1
  355. package/dashboard/dist/assets/{TaskDetailPage-DEz_dqyR.js → TaskDetailPage-bbNSv4Ae.js} +2 -2
  356. package/dashboard/dist/assets/{TaskDetailPage-DEz_dqyR.js.map → TaskDetailPage-bbNSv4Ae.js.map} +1 -1
  357. package/dashboard/dist/assets/{TasksListPage-oEfEGj0_.js → TasksListPage-CDWnm_d9.js} +2 -2
  358. package/dashboard/dist/assets/{TasksListPage-oEfEGj0_.js.map → TasksListPage-CDWnm_d9.js.map} +1 -1
  359. package/dashboard/dist/assets/{TimeAgo-Dz5TgZZZ.js → TimeAgo-BLjqlfoX.js} +2 -2
  360. package/dashboard/dist/assets/{TimeAgo-Dz5TgZZZ.js.map → TimeAgo-BLjqlfoX.js.map} +1 -1
  361. package/dashboard/dist/assets/{TimestampCell-BUTgE244.js → TimestampCell-CnW0ENb5.js} +2 -2
  362. package/dashboard/dist/assets/{TimestampCell-BUTgE244.js.map → TimestampCell-CnW0ENb5.js.map} +1 -1
  363. package/dashboard/dist/assets/{ToolTestPanel-BS4g6vt-.js → ToolTestPanel-DkMgCB-k.js} +2 -2
  364. package/dashboard/dist/assets/{ToolTestPanel-BS4g6vt-.js.map → ToolTestPanel-DkMgCB-k.js.map} +1 -1
  365. package/dashboard/dist/assets/{TopicDetailPage-C_I6JIVD.js → TopicDetailPage-g3pljKKX.js} +2 -2
  366. package/dashboard/dist/assets/{TopicDetailPage-C_I6JIVD.js.map → TopicDetailPage-g3pljKKX.js.map} +1 -1
  367. package/dashboard/dist/assets/{TopicsPage-Cr6-wfhJ.js → TopicsPage-CVcCYdy-.js} +2 -2
  368. package/dashboard/dist/assets/{TopicsPage-Cr6-wfhJ.js.map → TopicsPage-CVcCYdy-.js.map} +1 -1
  369. package/dashboard/dist/assets/{UserName-ZFpWMaFF.js → UserName-D6zGIK2i.js} +2 -2
  370. package/dashboard/dist/assets/{UserName-ZFpWMaFF.js.map → UserName-D6zGIK2i.js.map} +1 -1
  371. package/dashboard/dist/assets/{WorkflowExecutionPage-ByPixDZW.js → WorkflowExecutionPage-B8g81FCJ.js} +2 -2
  372. package/dashboard/dist/assets/{WorkflowExecutionPage-ByPixDZW.js.map → WorkflowExecutionPage-B8g81FCJ.js.map} +1 -1
  373. package/dashboard/dist/assets/{WorkflowsDashboard-CWsJdMdR.js → WorkflowsDashboard-nxT3bv6W.js} +2 -2
  374. package/dashboard/dist/assets/{WorkflowsDashboard-CWsJdMdR.js.map → WorkflowsDashboard-nxT3bv6W.js.map} +1 -1
  375. package/dashboard/dist/assets/{WorkflowsOverview-Dk9gyqZN.js → WorkflowsOverview-grI-KAI2.js} +2 -2
  376. package/dashboard/dist/assets/{WorkflowsOverview-Dk9gyqZN.js.map → WorkflowsOverview-grI-KAI2.js.map} +1 -1
  377. package/dashboard/dist/assets/{YamlWorkflowDetailPage-CHwcrsaT.js → YamlWorkflowDetailPage-BoZ-hfBE.js} +2 -2
  378. package/dashboard/dist/assets/{YamlWorkflowDetailPage-CHwcrsaT.js.map → YamlWorkflowDetailPage-BoZ-hfBE.js.map} +1 -1
  379. package/dashboard/dist/assets/{YamlWorkflowsPage-B5jRX2Ph.js → YamlWorkflowsPage-Bf04rwRv.js} +2 -2
  380. package/dashboard/dist/assets/{YamlWorkflowsPage-B5jRX2Ph.js.map → YamlWorkflowsPage-Bf04rwRv.js.map} +1 -1
  381. package/dashboard/dist/assets/{agents-Dd7E-27d.js → agents-Dphpdi8l.js} +2 -2
  382. package/dashboard/dist/assets/{agents-Dd7E-27d.js.map → agents-Dphpdi8l.js.map} +1 -1
  383. package/dashboard/dist/assets/{bots-CpaYjZTk.js → bots-DIFE298x.js} +2 -2
  384. package/dashboard/dist/assets/{bots-CpaYjZTk.js.map → bots-DIFE298x.js.map} +1 -1
  385. package/dashboard/dist/assets/{capabilities-CNjg_qv1.js → capabilities-D7Y7LClY.js} +2 -2
  386. package/dashboard/dist/assets/{capabilities-CNjg_qv1.js.map → capabilities-D7Y7LClY.js.map} +1 -1
  387. package/dashboard/dist/assets/{controlplane-DgmvnAtU.js → controlplane-D1TGcYsS.js} +2 -2
  388. package/dashboard/dist/assets/{controlplane-DgmvnAtU.js.map → controlplane-D1TGcYsS.js.map} +1 -1
  389. package/dashboard/dist/assets/{escalation-columns-Uj4U9g5H.js → escalation-columns-cwZE6xyo.js} +2 -2
  390. package/dashboard/dist/assets/{escalation-columns-Uj4U9g5H.js.map → escalation-columns-cwZE6xyo.js.map} +1 -1
  391. package/dashboard/dist/assets/{index-x5z73M9N.js → index-BzYcUPdD.js} +2 -2
  392. package/dashboard/dist/assets/{index-x5z73M9N.js.map → index-BzYcUPdD.js.map} +1 -1
  393. package/dashboard/dist/assets/index-CeCtqujG.js +67 -0
  394. package/dashboard/dist/assets/index-CeCtqujG.js.map +1 -0
  395. package/dashboard/dist/assets/{index-RIFT3RlO.js → index-ChV7pBjM.js} +2 -2
  396. package/dashboard/dist/assets/{index-RIFT3RlO.js.map → index-ChV7pBjM.js.map} +1 -1
  397. package/dashboard/dist/assets/{index-OfO0173w.js → index-CniRa65p.js} +2 -2
  398. package/dashboard/dist/assets/{index-OfO0173w.js.map → index-CniRa65p.js.map} +1 -1
  399. package/dashboard/dist/assets/{index-ByBy9M3L.js → index-CxdjT1Yk.js} +2 -2
  400. package/dashboard/dist/assets/{index-ByBy9M3L.js.map → index-CxdjT1Yk.js.map} +1 -1
  401. package/dashboard/dist/assets/{index-C_K7OlzT.js → index-DAvi5_2T.js} +2 -2
  402. package/dashboard/dist/assets/{index-C_K7OlzT.js.map → index-DAvi5_2T.js.map} +1 -1
  403. package/dashboard/dist/assets/{index-BrwqtXRh.js → index-DN-kX7hL.js} +2 -2
  404. package/dashboard/dist/assets/{index-BrwqtXRh.js.map → index-DN-kX7hL.js.map} +1 -1
  405. package/dashboard/dist/assets/index-Dl_8hbYI.js +2 -0
  406. package/dashboard/dist/assets/index-Dl_8hbYI.js.map +1 -0
  407. package/dashboard/dist/assets/{index-D4Dlznn9.js → index-DpKOr311.js} +2 -2
  408. package/dashboard/dist/assets/{index-D4Dlznn9.js.map → index-DpKOr311.js.map} +1 -1
  409. package/dashboard/dist/assets/{index-CnOvJz6U.js → index-Dy1wWu2e.js} +2 -2
  410. package/dashboard/dist/assets/{index-CnOvJz6U.js.map → index-Dy1wWu2e.js.map} +1 -1
  411. package/dashboard/dist/assets/{index-BT1Ms5Q5.js → index-HLu98Sqh.js} +2 -2
  412. package/dashboard/dist/assets/{index-BT1Ms5Q5.js.map → index-HLu98Sqh.js.map} +1 -1
  413. package/dashboard/dist/assets/{index-BFASQ7_X.js → index-ag2pCAPu.js} +2 -2
  414. package/dashboard/dist/assets/{index-BFASQ7_X.js.map → index-ag2pCAPu.js.map} +1 -1
  415. package/dashboard/dist/assets/{index-BsHVgWH6.js → index-gkxPN7Vx.js} +2 -2
  416. package/dashboard/dist/assets/{index-BsHVgWH6.js.map → index-gkxPN7Vx.js.map} +1 -1
  417. package/dashboard/dist/assets/index-m9A3UYst.css +1 -0
  418. package/dashboard/dist/assets/{knowledge-Cci_r6Kl.js → knowledge-DnMs-SOJ.js} +2 -2
  419. package/dashboard/dist/assets/{knowledge-Cci_r6Kl.js.map → knowledge-DnMs-SOJ.js.map} +1 -1
  420. package/dashboard/dist/assets/{mcp-NY4iL0L-.js → mcp-CwW-K3r4.js} +2 -2
  421. package/dashboard/dist/assets/{mcp-NY4iL0L-.js.map → mcp-CwW-K3r4.js.map} +1 -1
  422. package/dashboard/dist/assets/{mcp-query-CbvZo_I_.js → mcp-query-BZt5e8_Q.js} +2 -2
  423. package/dashboard/dist/assets/{mcp-query-CbvZo_I_.js.map → mcp-query-BZt5e8_Q.js.map} +1 -1
  424. package/dashboard/dist/assets/{personas-Fy-f7QQd.js → personas-UA-Xn60f.js} +2 -2
  425. package/dashboard/dist/assets/{personas-Fy-f7QQd.js.map → personas-UA-Xn60f.js.map} +1 -1
  426. package/dashboard/dist/assets/{pipelines-DKiuozxV.js → pipelines-Cu3PARum.js} +2 -2
  427. package/dashboard/dist/assets/{pipelines-DKiuozxV.js.map → pipelines-Cu3PARum.js.map} +1 -1
  428. package/dashboard/dist/assets/{tasks-CdM1Rkk9.js → tasks-BO6h8GJE.js} +2 -2
  429. package/dashboard/dist/assets/{tasks-CdM1Rkk9.js.map → tasks-BO6h8GJE.js.map} +1 -1
  430. package/dashboard/dist/assets/{topics-XNy2mf3n.js → topics-CWjCR-17.js} +2 -2
  431. package/dashboard/dist/assets/{topics-XNy2mf3n.js.map → topics-CWjCR-17.js.map} +1 -1
  432. package/dashboard/dist/assets/{useDebouncedValue-CyGcU3_S.js → useDebouncedValue-6t0jx1RB.js} +2 -2
  433. package/dashboard/dist/assets/{useDebouncedValue-CyGcU3_S.js.map → useDebouncedValue-6t0jx1RB.js.map} +1 -1
  434. package/dashboard/dist/assets/{useNamespace-C2RIh_IN.js → useNamespace-CqpoQx6D.js} +2 -2
  435. package/dashboard/dist/assets/{useNamespace-C2RIh_IN.js.map → useNamespace-CqpoQx6D.js.map} +1 -1
  436. package/dashboard/dist/assets/{useYamlActivityEvents-CDiV5fjf.js → useYamlActivityEvents-hmCQQwzB.js} +2 -2
  437. package/dashboard/dist/assets/{useYamlActivityEvents-CDiV5fjf.js.map → useYamlActivityEvents-hmCQQwzB.js.map} +1 -1
  438. package/dashboard/dist/assets/{validate-DcGWN82Y.js → validate-BIRn4a6d.js} +2 -2
  439. package/dashboard/dist/assets/{validate-DcGWN82Y.js.map → validate-BIRn4a6d.js.map} +1 -1
  440. package/dashboard/dist/assets/{yaml-workflows-CH8UrouH.js → yaml-workflows-ziUdZhKY.js} +2 -2
  441. package/dashboard/dist/assets/{yaml-workflows-CH8UrouH.js.map → yaml-workflows-ziUdZhKY.js.map} +1 -1
  442. package/dashboard/dist/index.html +2 -2
  443. package/docs/agents.md +3 -1
  444. package/docs/api/http/agents.md +15 -1
  445. package/docs/api/http/escalations.md +3 -3
  446. package/docs/api/http/exports.md +3 -1
  447. package/docs/api/http/file-browser.md +3 -1
  448. package/docs/api/http/mcp-endpoint.md +8 -5
  449. package/docs/api/http/mcp-servers.md +34 -4
  450. package/docs/api/http/namespaces.md +2 -0
  451. package/docs/api/http/pipelines.md +2 -0
  452. package/docs/api/http/roles.md +11 -8
  453. package/docs/api/http/service-accounts.md +8 -2
  454. package/docs/api/http/settings.md +29 -2
  455. package/docs/api/http/tasks.md +3 -1
  456. package/docs/api/http/topics.md +7 -1
  457. package/docs/api/http/users.md +8 -2
  458. package/docs/api/http/workflows.md +25 -10
  459. package/docs/api/http/yaml-workflows.md +21 -0
  460. package/docs/api/mcp/admin.md +409 -49
  461. package/docs/api/mcp/file-storage.md +4 -0
  462. package/docs/api/mcp/http-fetch.md +6 -2
  463. package/docs/api/mcp/human-queue.md +53 -0
  464. package/docs/api/mcp/index.md +13 -10
  465. package/docs/api/mcp/knowledge.md +34 -0
  466. package/docs/api/mcp/oauth.md +1 -1
  467. package/docs/api/mcp/ortho.md +113 -0
  468. package/docs/api/mcp/vision.md +1 -1
  469. package/docs/api/sdk/bot-accounts.md +1 -0
  470. package/docs/api/sdk/escalations.md +2 -2
  471. package/docs/api/sdk/mcp.md +2 -2
  472. package/docs/api/sdk/settings.md +1 -1
  473. package/docs/api/sdk/tasks.md +2 -2
  474. package/docs/api/sdk/workflows.md +2 -2
  475. package/docs/api/sdk/yaml-workflows.md +1 -1
  476. package/docs/architecture.md +3 -1
  477. package/docs/auth.md +3 -2
  478. package/docs/cloud.md +7 -2
  479. package/docs/dashboard.md +16 -7
  480. package/docs/data.md +1 -1
  481. package/docs/escalation-strategies.md +9 -20
  482. package/docs/events.md +6 -0
  483. package/docs/iam.md +7 -5
  484. package/docs/maintenance.md +51 -28
  485. package/docs/mcp.md +159 -210
  486. package/docs/oauth-and-delegation.md +32 -21
  487. package/docs/topics.md +2 -0
  488. package/docs/workflows.md +14 -112
  489. package/package.json +5 -3
  490. package/dashboard/dist/assets/ConfirmDeleteModal-DW4DrPur.js +0 -2
  491. package/dashboard/dist/assets/ConfirmDeleteModal-DW4DrPur.js.map +0 -1
  492. package/dashboard/dist/assets/ProcessDetailPage-DNgCIwRl.js +0 -2
  493. package/dashboard/dist/assets/ResolverForm-CKIOAGtY.js +0 -8
  494. package/dashboard/dist/assets/ResolverForm-CKIOAGtY.js.map +0 -1
  495. package/dashboard/dist/assets/index-CtlBjl8o.js +0 -2
  496. package/dashboard/dist/assets/index-CtlBjl8o.js.map +0 -1
  497. package/dashboard/dist/assets/index-LRYC__mE.js +0 -67
  498. package/dashboard/dist/assets/index-LRYC__mE.js.map +0 -1
  499. package/dashboard/dist/assets/index-MYI2_Xb3.css +0 -1
@@ -2,7 +2,9 @@
2
2
 
3
3
  CRUD operations for agent automations — autonomous personas that react to events and run workflows on schedules. Each automation has an identity, motivation (goals/rules), event subscriptions, cron schedules, and a knowledge domain.
4
4
 
5
- All endpoints require authentication.
5
+ All endpoints require authentication. Creating, updating, and deleting agents and subscriptions require builder access (superadmin or the `engineer` role).
6
+
7
+ Configuring an agent or subscription also requires that the caller may act as the identity it runs as (its `execute_as`, else the agent's `user_id`). The act-as rule: a superadmin may act as anyone, and a caller holding an `admin`-type grant may act as an account that holds no superadmin grant and whose every role the caller holds at the same or higher type. A schedule or subscription with no identity runs as lt-system, and a `capability` subscription calls a tool with lt-system authority; only a superadmin may configure either.
6
8
 
7
9
  ## List agent automations
8
10
 
@@ -64,6 +66,8 @@ Returns an agent with aggregated stats (knowledge entry count, escalation count)
64
66
  POST /api/agents
65
67
  ```
66
68
 
69
+ **Auth:** Requires builder access and the act-as rule for `user_id` and each schedule's identity.
70
+
67
71
  **Body:**
68
72
 
69
73
  ```json
@@ -101,6 +105,8 @@ POST /api/agents
101
105
  PUT /api/agents/:id
102
106
  ```
103
107
 
108
+ **Auth:** Same as create.
109
+
104
110
  Partial update — only include fields to change. Changing `status` or `behaviors` automatically restarts event subscriptions and cron schedules.
105
111
 
106
112
  **Response 200:** The updated agent.
@@ -111,6 +117,8 @@ Partial update — only include fields to change. Changing `status` or `behavior
111
117
  DELETE /api/agents/:id
112
118
  ```
113
119
 
120
+ **Auth:** Requires builder access.
121
+
114
122
  Permanently removes the agent. Event subscriptions are cascade-deleted. Cron schedules are stopped. Knowledge entries and workflow history are preserved.
115
123
 
116
124
  **Response 200:** `{ "deleted": true }`
@@ -153,6 +161,8 @@ GET /api/agents/:agentId/subscriptions
153
161
  POST /api/agents/:agentId/subscriptions
154
162
  ```
155
163
 
164
+ **Auth:** Requires builder access and the act-as rule for the subscription's identity. A `capability` subscription requires superadmin.
165
+
156
166
  **Body:**
157
167
 
158
168
  ```json
@@ -188,6 +198,8 @@ POST /api/agents/:agentId/subscriptions
188
198
  PUT /api/agents/:agentId/subscriptions/:subId
189
199
  ```
190
200
 
201
+ **Auth:** Same as create. Returns `404` when the subscription does not belong to the agent.
202
+
191
203
  Partial update.
192
204
 
193
205
  **Response 200:** The updated subscription.
@@ -198,4 +210,6 @@ Partial update.
198
210
  DELETE /api/agents/:agentId/subscriptions/:subId
199
211
  ```
200
212
 
213
+ **Auth:** Requires builder access.
214
+
201
215
  **Response 200:** `{ "deleted": true }`
@@ -24,7 +24,7 @@ A role is a task queue with four verbs — **search** (list/get), **claim**, **a
24
24
 
25
25
  - `read_scope` governs which escalations a member **sees** — list, `/available`, get-by-id, find-by-metadata, and stats. `self` means escalations assigned to the member (`assigned_to = user`); `all` means the whole role queue.
26
26
  - `write_scope` governs which escalations a member may **act on** — claim, resolve, cancel. `self` means only items already assigned to them; `none` is read-only.
27
- - Releasing and escalating are queue-management verbs and require `write_scope=all`. Creating a standalone escalation (`POST /api/escalations`) requires `write_scope=all` or global escalation access.
27
+ - Releasing, escalating and assigning by query are queue-management verbs and require `write_scope=all`. Creating a standalone escalation (`POST /api/escalations`) requires `write_scope=all` or global escalation access.
28
28
 
29
29
  Defaults are `read_scope=all` and `write_scope=all` — the full-queue worker — so a plain `member` works the whole queue. See [Work-Surface Scope](roles.md#work-surface-scope) in the Roles API for the five member profiles and the **write ⊆ read** constraint.
30
30
 
@@ -649,7 +649,7 @@ Assign multiple escalations to a specific user, by id-set or by query (exactly o
649
649
 
650
650
  **Rows under a live claim are skipped** by a plain assign and counted in the response's `skipped` — assignment is claim-on-behalf, and an active claim wins. To take over live claims, pass `reassign: true` (ids form; admin/superadmin only): the takeover is one guarded statement, the displaced holder's in-flight resolve fails its claim assertion, and each taken row's `claimed` event carries `reassigned_from`.
651
651
 
652
- The query form is one atomic statement: selection and claim happen in the same UPDATE, so a row that re-parks between a search and an ids-assign is still captured. Use it whenever the population is describable by role + facets.
652
+ The query form is one atomic statement: selection and claim happen in the same UPDATE, so a row that re-parks between a search and an ids-assign is still captured. Use it whenever the population is describable by role + facets. A member may use the query form only with `write_scope=all` on the queried role; the target user must hold that role.
653
653
 
654
654
  **Request body:**
655
655
 
@@ -830,7 +830,7 @@ Reassign a single escalation to a different role. The caller must be authorized
830
830
  GET /api/escalations/by-workflow/:workflowId
831
831
  ```
832
832
 
833
- Returns all escalations linked to a specific workflow ID.
833
+ Returns the escalations linked to a specific workflow ID that the caller may read: every escalation for callers with global escalation access, escalations in roles the caller reads at `all` scope, and, for roles held at `self` read scope, only those assigned to the caller.
834
834
 
835
835
  **Path parameters:**
836
836
 
@@ -1,6 +1,8 @@
1
1
  # Exports API
2
2
 
3
- Export endpoints expose workflow state and execution history. The execution history endpoint produces structured, typed events — useful for debugging, auditing, and migrating data. All endpoints require authentication.
3
+ Export endpoints expose workflow state and execution history. The execution history endpoint produces structured, typed events — useful for debugging, auditing, and migrating data.
4
+
5
+ **Auth:** Every endpoint requires builder access (superadmin or the `engineer` role), except `GET /api/workflow-states/:workflowId/execution`. That endpoint is open to builders and to the person who started the run or the account it runs as (read from the run's start envelope: `lt.userId`, or `lt.initiatedBy` when it runs under `execute_as`); others receive `403`.
4
6
 
5
7
  Every endpoint resolves the workflow automatically from the `workflowId` — no additional parameters needed.
6
8
 
@@ -1,6 +1,8 @@
1
1
  # File Browser API
2
2
 
3
- Browse, preview, download, share, and delete files in the storage backend (S3, MinIO, or local filesystem). All endpoints require authentication except file serving.
3
+ Browse, preview, download, share, and delete files in the storage backend (S3, MinIO, or local filesystem).
4
+
5
+ **Auth:** Every `/api/file-browser` endpoint (browse, metadata, signed-url, delete, download, upload) requires builder access (superadmin or the `engineer` role). Serving a file at `/api/files/{filePath}` requires the signed token from a signed URL (`?token=`).
4
6
 
5
7
  ## Browse files
6
8
 
@@ -75,7 +75,7 @@ Connect Claude Code to your Long Tail instance as an MCP server. Once connected,
75
75
 
76
76
  ### Step 1: Get an API key
77
77
 
78
- Start Long Tail (`docker compose up -d --build`). The startup log shows two seeded API keys:
78
+ Start Long Tail (`docker compose up -d --build`). On first start, docker compose sets `LT_SEED_SERVICE_KEYS=true`, so the container's stdout shows two seeded API keys:
79
79
 
80
80
  ```
81
81
  [seed-mcp] read key: lt_bot_<read-key>
@@ -139,13 +139,16 @@ Claude Code calls `get_system_overview` — one call returns triage, throughput,
139
139
 
140
140
  ## Authentication
141
141
 
142
- Two token types are supported:
142
+ The credential travels in the `Authorization: Bearer` header. The host's session cookie does not authenticate `/mcp`. Three token types are supported:
143
143
 
144
144
  | Type | Format | Use case |
145
145
  |------|--------|----------|
146
- | JWT | Standard Bearer token from `POST /api/auth/login` | Interactive sessions, testing |
146
+ | OAuth access token | Issued by the Long Tail OAuth server for this resource (when the OAuth server is enabled) | MCP clients that sign in a person |
147
+ | JWT | Signed user token, such as the one from `POST /api/auth/login` | Interactive sessions, testing |
147
148
  | API key | `lt_bot_*` prefix | Service accounts, automation |
148
149
 
150
+ When the OAuth server is enabled, a `401` response carries a `WWW-Authenticate: Bearer resource_metadata="..."` challenge so MCP clients can discover how to sign in. An access token authenticates only while its grant is live.
151
+
149
152
  ### Service Account Setup
150
153
 
151
154
  1. Create a service account: `POST /api/bot-accounts`
@@ -165,11 +168,11 @@ A read key cannot invoke write operations (create, update, delete, invoke workfl
165
168
 
166
169
  ### Seeded Service Account
167
170
 
168
- Long Tail seeds an `mcp-service` account at startup with two pre-configured API keys:
171
+ Long Tail seeds an `mcp-service` account at startup with two API keys:
169
172
  - **read** — scopes: `["mcp:read"]`
170
173
  - **full** — scopes: `["mcp:read", "mcp:full"]`
171
174
 
172
- Keys are logged once at startup and cannot be retrieved again. For production, create a new service account and generate keys via the dashboard or API.
175
+ With `LT_SEED_SERVICE_KEYS=true` (local docker compose), the keys are minted at first start and printed once to stdout, never through the logger; they cannot be retrieved again. Without it, the account is created with no keys, and a superadmin mints them from the dashboard or the bot-accounts API.
173
176
 
174
177
  ## Exposure Control
175
178
 
@@ -1,6 +1,8 @@
1
1
  # MCP Servers API
2
2
 
3
- Manage MCP server registrations, connections, and tool invocations. All endpoints require authentication.
3
+ Manage MCP server registrations, connections, and tool invocations. All endpoints require authentication. Registering, testing, updating, deleting, connecting, and disconnecting servers require builder access (superadmin or the `engineer` role).
4
+
5
+ A `stdio` server is a command Long Tail starts on its own host, with that host's environment and network. Builder access therefore includes running commands on the host: grant the `engineer` role with the same care as host access.
4
6
 
5
7
  ## List servers
6
8
 
@@ -8,6 +10,8 @@ Manage MCP server registrations, connections, and tool invocations. All endpoint
8
10
  GET /api/mcp/servers
9
11
  ```
10
12
 
13
+ `transport_config` is included only for builders.
14
+
11
15
  **Query parameters:**
12
16
 
13
17
  | Parameter | Type | Description |
@@ -53,6 +57,8 @@ GET /api/mcp/servers
53
57
  POST /api/mcp/servers
54
58
  ```
55
59
 
60
+ **Auth:** Requires builder access (superadmin or the `engineer` role).
61
+
56
62
  **Request body:**
57
63
 
58
64
  | Field | Type | Required | Description |
@@ -76,15 +82,17 @@ POST /api/mcp/servers
76
82
  **Transport config for `sse`:**
77
83
 
78
84
  ```json
79
- { "url": "http://localhost:3001/sse" }
85
+ { "url": "http://localhost:3001/sse", "headers": { "Authorization": "Bearer <token>" } }
80
86
  ```
81
87
 
82
88
  **Transport config for `streamable-http`:**
83
89
 
84
90
  ```json
85
- { "url": "http://localhost:3001/mcp" }
91
+ { "url": "http://localhost:3001/mcp", "headers": { "Authorization": "Bearer <token>" } }
86
92
  ```
87
93
 
94
+ `headers` is optional and is sent with every request to the server, the SSE stream included. Like the rest of `transport_config`, it is returned only to builders.
95
+
88
96
  **Response 201:** Created server record.
89
97
 
90
98
  **Response 409:** Server name already exists.
@@ -95,6 +103,8 @@ POST /api/mcp/servers
95
103
  GET /api/mcp/servers/:id
96
104
  ```
97
105
 
106
+ `transport_config` is included only for builders.
107
+
98
108
  **Response 200:** Server record.
99
109
 
100
110
  **Response 404:** Server not found.
@@ -105,6 +115,8 @@ GET /api/mcp/servers/:id
105
115
  PUT /api/mcp/servers/:id
106
116
  ```
107
117
 
118
+ **Auth:** Requires builder access (superadmin or the `engineer` role).
119
+
108
120
  **Request body:** Any fields from the registration (partial update), including `tags`, `compile_hints`, and `credential_providers`.
109
121
 
110
122
  **Response 200:** Updated server record.
@@ -117,6 +129,8 @@ PUT /api/mcp/servers/:id
117
129
  DELETE /api/mcp/servers/:id
118
130
  ```
119
131
 
132
+ **Auth:** Requires builder access (superadmin or the `engineer` role).
133
+
120
134
  **Response 200:**
121
135
 
122
136
  ```json
@@ -131,6 +145,8 @@ DELETE /api/mcp/servers/:id
131
145
  POST /api/mcp/servers/test-connection
132
146
  ```
133
147
 
148
+ **Auth:** Requires builder access (superadmin or the `engineer` role).
149
+
134
150
  Test connectivity to an MCP server without persisting a registration. Creates a temporary client, connects, lists tools, then disconnects.
135
151
 
136
152
  **Request body:**
@@ -167,6 +183,8 @@ On failure:
167
183
  POST /api/mcp/servers/:id/connect
168
184
  ```
169
185
 
186
+ **Auth:** Requires builder access (superadmin or the `engineer` role).
187
+
170
188
  Establishes a connection to the registered MCP server and caches its tool manifest.
171
189
 
172
190
  **Response 200:**
@@ -181,6 +199,8 @@ Establishes a connection to the registered MCP server and caches its tool manife
181
199
  POST /api/mcp/servers/:id/disconnect
182
200
  ```
183
201
 
202
+ **Auth:** Requires builder access (superadmin or the `engineer` role).
203
+
184
204
  **Response 200:**
185
205
 
186
206
  ```json
@@ -222,16 +242,24 @@ POST /api/mcp/servers/:id/tools/:toolName/call
222
242
 
223
243
  Invoke a tool on a connected MCP server.
224
244
 
245
+ **Auth:** The tool runs as the caller, or as the `execute_as` account when given. A built-in tool requires the capability its manifest `gate` declares, checked for the acting account; a built-in tool with no gate requires builder access. A tool on an external server (any registered network or local-process server) requires builder access, since it runs on the credential stored with that server. `execute_as` follows the act-as rule: a superadmin may act as anyone, and a caller holding an `admin`-type grant may act as an account that holds no superadmin grant and whose every role the caller holds at the same or higher type.
246
+
225
247
  **Request body:**
226
248
 
227
249
  ```json
228
250
  {
229
251
  "arguments": {
230
252
  "image_url": "https://example.com/image.png"
231
- }
253
+ },
254
+ "execute_as": "optional-account-id"
232
255
  }
233
256
  ```
234
257
 
258
+ | Field | Type | Required | Description |
259
+ |-------|------|----------|-------------|
260
+ | `arguments` | `object` | No | Tool arguments |
261
+ | `execute_as` | `string` | No | Account id or `external_id` to run the tool as |
262
+
235
263
  **Response 200:**
236
264
 
237
265
  ```json
@@ -242,6 +270,8 @@ Invoke a tool on a connected MCP server.
242
270
  }
243
271
  ```
244
272
 
273
+ **Response 403:** The caller may not act as `execute_as`, or the acting account lacks the tool's capability.
274
+
245
275
  **Response 422** (missing credential):
246
276
 
247
277
  ```json
@@ -33,6 +33,8 @@ GET /api/namespaces
33
33
  POST /api/namespaces
34
34
  ```
35
35
 
36
+ **Auth:** Requires builder access (superadmin or the `engineer` role).
37
+
36
38
  Creates or upserts a namespace. Typically called automatically during YAML workflow deployment.
37
39
 
38
40
  **Request body:**
@@ -114,6 +114,8 @@ Returns full execution detail for a specific run, including inflated activity ev
114
114
  POST /api/pipelines/:jobId/interrupt
115
115
  ```
116
116
 
117
+ **Auth:** Requires builder access (superadmin or the `engineer` role).
118
+
117
119
  Immediately terminates a running pipeline job via `HotMesh.interrupt()`. The job is marked as interrupted and its state is expired.
118
120
 
119
121
  **Body:**
@@ -71,10 +71,11 @@ Certain API endpoints require builder access (`superadmin` or `engineer` role):
71
71
 
72
72
  | Endpoint | Access |
73
73
  |----------|--------|
74
- | `POST/PUT/DELETE /api/users` | Builder |
75
- | `POST /api/users/:id/roles` | Admin (scoped — see below) |
74
+ | `POST/PUT/PATCH/DELETE /api/users` | Builder |
75
+ | `POST /api/users/:id/roles` | Admin (scoped, see below) |
76
+ | `DELETE /api/users/:id/roles/:role` | Admin (scoped, see below) |
76
77
  | All `/api/bot-accounts` | Builder |
77
- | All `/api/roles` mutations | Builder |
78
+ | All `/api/roles` mutations | Admin access or the `engineer` role |
78
79
  | All `/api/controlplane` | Builder |
79
80
 
80
81
  ### Scoped Role Assignment
@@ -87,6 +88,8 @@ When assigning roles via `POST /api/users/:id/roles`, the caller's own roles det
87
88
  | `engineer` | Any role up to `admin` type (never `superadmin` type) |
88
89
  | `*/admin` (non-builder) | `member` or `admin` type for roles they themselves hold |
89
90
 
91
+ Removing a role follows the same rule for the role at the type the account holds it. Only a superadmin may change, remove roles from, or mint keys for an account that holds a superadmin grant; others receive `403`.
92
+
90
93
  A caller who may assign a role may set any work-surface scope (`read_scope`/`write_scope`) on it. Scope is a refinement of a `member` grant; it is ignored for `admin`/`superadmin`, which always act on the whole queue.
91
94
 
92
95
  ## List roles for a user
@@ -289,7 +292,7 @@ Returns all roles with metadata and usage counts.
289
292
  POST /api/roles
290
293
  ```
291
294
 
292
- Create a standalone role. Requires admin.
295
+ Create a standalone role. Requires role manager (admin type, superadmin, or engineer).
293
296
 
294
297
  **Request body:**
295
298
 
@@ -325,7 +328,7 @@ Create a standalone role. Requires admin.
325
328
  DELETE /api/roles/:role
326
329
  ```
327
330
 
328
- Delete a role if it has no references. Requires admin.
331
+ Delete a role if it has no references. Requires role manager (admin type, superadmin, or engineer).
329
332
 
330
333
  **Path parameters:**
331
334
 
@@ -494,7 +497,7 @@ Returns all escalation chain pairs.
494
497
  POST /api/roles/escalation-chains
495
498
  ```
496
499
 
497
- Add a single escalation chain entry. Requires admin.
500
+ Add a single escalation chain entry. Requires role manager (admin type, superadmin, or engineer).
498
501
 
499
502
  **Request body:**
500
503
 
@@ -527,7 +530,7 @@ Add a single escalation chain entry. Requires admin.
527
530
  DELETE /api/roles/escalation-chains
528
531
  ```
529
532
 
530
- Remove a single escalation chain entry. Requires admin.
533
+ Remove a single escalation chain entry. Requires role manager (admin type, superadmin, or engineer).
531
534
 
532
535
  **Request body:**
533
536
 
@@ -576,7 +579,7 @@ Returns the allowed escalation targets for a specific role.
576
579
  PUT /api/roles/:role/escalation-targets
577
580
  ```
578
581
 
579
- Replace all escalation targets for a role. Requires admin.
582
+ Replace all escalation targets for a role. Requires role manager (admin type, superadmin, or engineer).
580
583
 
581
584
  **Path parameters:**
582
585
 
@@ -1,6 +1,6 @@
1
1
  # Service Accounts API
2
2
 
3
- Service accounts are named identities that authenticate with API keys instead of passwords. They share the same role-based access control as human users. All endpoints require admin access.
3
+ Service accounts are named identities that authenticate with API keys instead of passwords. They share the same role-based access control as human users. All endpoints require builder access (superadmin or the `engineer` role). Role assignments follow the [scoped role assignment](roles.md#scoped-role-assignment) rules, and only a superadmin may change, delete, assign or remove roles on, or create or revoke keys for an account that holds a superadmin grant.
4
4
 
5
5
  ## List service accounts
6
6
 
@@ -107,7 +107,7 @@ Deletes the service account and all its API keys (cascade).
107
107
 
108
108
  ## Service account roles
109
109
 
110
- Roles work identically to user roles.
110
+ Roles work identically to user roles, including the [scoped role assignment](roles.md#scoped-role-assignment) rules.
111
111
 
112
112
  ```
113
113
  GET /api/bot-accounts/:id/roles
@@ -191,6 +191,12 @@ DELETE /api/bot-accounts/:id/api-keys/:keyId
191
191
  { "revoked": true }
192
192
  ```
193
193
 
194
+ **Response 404:** The key does not exist or belongs to a different service account than `:id`.
195
+
196
+ ```json
197
+ { "error": "API key not found" }
198
+ ```
199
+
194
200
  ## Using a service account API key
195
201
 
196
202
  Include the raw key as a Bearer token in any API request:
@@ -21,7 +21,7 @@ GET /api/settings
21
21
  "events": {
22
22
  "transport": "socketio",
23
23
  "natsWsUrl": null,
24
- "natsToken": null
24
+ "reconnect": { "initialDelayMs": 1000, "maxDelayMs": 60000, "noticeAfterMs": 30000, "spreadMs": 5000 }
25
25
  },
26
26
  "auth": {
27
27
  "sso": false,
@@ -42,8 +42,35 @@ GET /api/settings
42
42
  | `escalation.claimDurations` | `number[]` | Available claim duration options in minutes. Used by the frontend to populate duration selectors. Configurable via the `LT_CLAIM_DURATION_OPTIONS` environment variable (JSON array). |
43
43
  | `events.transport` | `'socketio' \| 'nats' \| 'none'` | Dashboard event transport. Defaults to `socketio`. Reports `nats` only when `EVENT_TRANSPORT=nats` is set and a NATS adapter is registered. |
44
44
  | `events.natsWsUrl` | `string \| null` | NATS WebSocket URL for browser connections. Only present when a NATS adapter is registered. Read from `NATS_WS_URL`. |
45
- | `events.natsToken` | `string \| null` | NATS auth token for browser connections. Only present when a NATS adapter is registered. Read from `NATS_TOKEN`. |
45
+ | `events.reconnect.initialDelayMs` | `number` | First delay before the dashboard retries a dropped event connection. Read from `NATS_RECONNECT_INITIAL_MS` (default `1000`). |
46
+ | `events.reconnect.maxDelayMs` | `number` | Upper bound on the retry delay as it backs off. Read from `NATS_RECONNECT_MAX_MS` (default `60000`). |
47
+ | `events.reconnect.noticeAfterMs` | `number` | How long the connection may stay down before the dashboard shows a notice. Read from `NATS_LIVE_NOTICE_AFTER_MS` (default `30000`). |
48
+ | `events.reconnect.spreadMs` | `number` | Window the first retry after a drop, and the catch-up refetch after reconnecting, are spread across, so tabs return gradually after a deploy. Read from `NATS_RECONNECT_SPREAD_MS` (default `5000`). |
46
49
  | `auth.sso` | `boolean` | Whether SSO is configured for embedded deployments. When `true`, the dashboard auto-exchanges host auth for an LT JWT instead of showing the login form. |
47
50
  | `auth.ssoLogoutUrl` | `string \| null` | URL to redirect the browser on logout. Set by the host via `sso.logoutUrl` in the startup config. When `null`, the dashboard shows its own login page on logout. |
48
51
  | `ai.enabled` | `boolean` | Whether an LLM API key is configured. When `false`, the dashboard hides AI-specific features (pipelines designer, AI assistant, triage). |
49
52
  | `branding.appName` | `string` | The product name shown in the dashboard header. Configured via `branding.appName` in the startup config; defaults to `"LongTail"`. |
53
+
54
+ ## Get NATS credentials
55
+
56
+ ```
57
+ GET /api/nats-credentials
58
+ ```
59
+
60
+ **Auth:** Requires authentication.
61
+
62
+ Returns the connection details the dashboard uses to subscribe to NATS events.
63
+
64
+ **Response 200:**
65
+
66
+ ```json
67
+ {
68
+ "natsWsUrl": "wss://example.com/nats?ticket=...",
69
+ "natsToken": null
70
+ }
71
+ ```
72
+
73
+ | Field | Type | Description |
74
+ |-------|------|-------------|
75
+ | `natsWsUrl` | `string \| null` | NATS WebSocket URL. Behind the WebSocket proxy, the URL carries a `ticket` query parameter for the caller, valid for `NATS_WS_TICKET_TTL_SECONDS` (default `300`). `null` when no NATS adapter is registered. |
76
+ | `natsToken` | `string \| null` | `null` behind the WebSocket proxy, since the proxy holds the NATS credential and the ticket allows subscribing only. For direct connections, `NATS_DASHBOARD_TOKEN` when set, else `NATS_TOKEN`. |
@@ -49,6 +49,8 @@ POST /api/tasks
49
49
 
50
50
  ---
51
51
 
52
+ **Run data.** A task row carries its run's input (`envelope`), output (`data`) and `metadata`. A builder, and the person who started the run or the account it runs as, receive them; for any other caller those three fields are omitted from list, process and single-task responses.
53
+
52
54
  ## List tasks
53
55
 
54
56
  ```
@@ -169,7 +171,7 @@ List distinct `origin_id` values with summary stats. Each origin ID represents a
169
171
  GET /api/tasks/processes/:originId
170
172
  ```
171
173
 
172
- Returns all tasks and escalations for a process (identified by `origin_id`).
174
+ Returns all tasks for a process (identified by `origin_id`), and the escalations in that process the caller may read (the same read-scope rule as `GET /api/escalations/by-workflow/:workflowId`).
173
175
 
174
176
  **Path parameters:**
175
177
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Browse, register, and manage the topic catalog — a persistent registry of known event topics with descriptions, payload schemas, and subscriber counts.
4
4
 
5
- All endpoints require authentication.
5
+ All endpoints require authentication. Registering, updating, deleting, and publishing (`POST /api/topics/by-name/:topic/publish`) require builder access (superadmin or the `engineer` role). Publishing a subject that starts with `system.` or `agent.` requires superadmin.
6
6
 
7
7
  ## List topics
8
8
 
@@ -94,6 +94,8 @@ Subscribers are matched using NATS-style pattern matching — an agent subscribe
94
94
  POST /api/topics
95
95
  ```
96
96
 
97
+ **Auth:** Requires builder access.
98
+
97
99
  Manually register a topic in the catalog. Use this to pre-declare topics before first publish.
98
100
 
99
101
  **Body:**
@@ -134,6 +136,8 @@ Manually register a topic in the catalog. Use this to pre-declare topics before
134
136
  PUT /api/topics/by-name/:topic
135
137
  ```
136
138
 
139
+ **Auth:** Requires builder access.
140
+
137
141
  Partial update — only include fields to change. System topics (`source: 'system'`) can be updated (description, tags) but not deleted.
138
142
 
139
143
  **Body:**
@@ -155,6 +159,8 @@ Partial update — only include fields to change. System topics (`source: 'syste
155
159
  DELETE /api/topics/by-name/:topic
156
160
  ```
157
161
 
162
+ **Auth:** Requires builder access.
163
+
158
164
  Permanently removes a topic from the catalog. System topics are protected.
159
165
 
160
166
  **Response 200:** `{ "deleted": true }`
@@ -1,6 +1,6 @@
1
1
  # Users API
2
2
 
3
- Users represent the humans who claim and resolve escalations. Each user has a unique `external_id` that maps to your application's identity system. All endpoints require authentication. Mutating endpoints (create, update, delete, role management) require admin access (`admin` or `superadmin` role).
3
+ Users represent the humans who claim and resolve escalations. Each user has a unique `external_id` that maps to your application's identity system. All endpoints require authentication. Creating, updating, patching, and deleting users require builder access (superadmin or the `engineer` role). Adding and removing roles require admin access and follow the assignment rules in the [Roles API](roles.md#scoped-role-assignment). Only a superadmin may grant the `superadmin` type or change a superadmin account.
4
4
 
5
5
  For service identities (CI bots, schedulers, automated agents), use the [Service Accounts API](service-accounts.md) instead. Service accounts share the same RBAC system but authenticate with API keys rather than passwords or OAuth.
6
6
 
@@ -76,6 +76,8 @@ GET /api/users/:id
76
76
  POST /api/users
77
77
  ```
78
78
 
79
+ **Auth:** Requires builder access. Every initial role must be one the caller may assign (see [Roles API](roles.md#scoped-role-assignment)); otherwise `403`.
80
+
79
81
  **Request body:**
80
82
 
81
83
  | Field | Type | Required | Description |
@@ -140,6 +142,8 @@ Each element in `roles`:
140
142
  PUT /api/users/:id
141
143
  ```
142
144
 
145
+ **Auth:** Requires builder access. Changing a superadmin account requires superadmin (`403` otherwise).
146
+
143
147
  Partial update — only the fields you include are changed.
144
148
 
145
149
  **Request body:**
@@ -174,7 +178,7 @@ Partial update — only the fields you include are changed.
174
178
  PATCH /api/users/:id/properties
175
179
  ```
176
180
 
177
- Atomically patch the user's properties dictionary (`metadata`) — one statement, never read-merge-write. Editing one property can never clobber another; a rename preserves its value with no key-absent window. Builder only (the same gate as every other user write).
181
+ Atomically patch the user's properties dictionary (`metadata`) — one statement, never read-merge-write. Editing one property can never clobber another; a rename preserves its value with no key-absent window. Requires builder access, the same gate as every other user write. Changing a superadmin account requires superadmin.
178
182
 
179
183
  **Request body:**
180
184
 
@@ -226,6 +230,8 @@ The property keys the platform itself resolves identities against — every enab
226
230
  DELETE /api/users/:id
227
231
  ```
228
232
 
233
+ **Auth:** Requires builder access. Changing a superadmin account requires superadmin (`403` otherwise).
234
+
229
235
  Deletes the user and all associated role assignments (cascade).
230
236
 
231
237
  **Response 200:**
@@ -232,7 +232,7 @@ Start a workflow by its registered type. The workflow must have `invocable: true
232
232
  |-------|------|----------|-------------|
233
233
  | `data` | `object` | yes | Business data passed to the workflow as `envelope.data` |
234
234
  | `metadata` | `object` | no | Control flow metadata passed as `envelope.metadata` |
235
- | `execute_as` | `string` | no | Service account `external_id` to run as (admin only) |
235
+ | `execute_as` | `string` | no | Account `external_id` or id to run as. Requires admin access and must satisfy the act-as rule below. |
236
236
 
237
237
  The input gate validates against the `metadata` in the request; the dashboard sends the config's `envelope_schema.metadata` with every invoke it starts.
238
238
 
@@ -268,12 +268,16 @@ The workflow starts on its configured `task_queue` with a generated workflow ID
268
268
  | `403` | `{ "error": "Workflow is not invocable" }` | `invocable` is `false` |
269
269
  | `403` | `{ "error": "User not registered" }` | RBAC check failed — no matching user |
270
270
  | `403` | `{ "error": "Insufficient role for invocation" }` | User lacks a required invocation role |
271
+ | `403` | `{ "error": "execute_as may not exceed your own authority" }` | The caller may not act as the `execute_as` account |
272
+ | `404` | `{ "error": "execute_as principal \"...\" not found" }` | No account matches `execute_as` |
271
273
  | `404` | `{ "error": "Workflow not found" }` | No config exists for this type |
272
274
  | `422` | `{ "error": "data failed input schema validation (n violations)", "code": "schema_validation", "violations": [{ "field", "message" }], "role": null, "schemaVersion": null, "workflowType" }` | The config declares `input_schema` and `data` violates it; `x-lt-options` over pinned `input_lookups` constrains values to the resolved edition |
273
275
 
274
276
  **Authorization:**
275
277
 
276
- When `invocation_roles` is empty, any authenticated user can invoke. When set, the user must hold at least one of the listed roles (checked against `lt_user_roles` via the user's `external_id`). Superadmins bypass this check.
278
+ When `invocation_roles` is empty, any authenticated user can invoke. When set, the user must hold at least one of the listed roles. Roles are read from the caller's current grants in `lt_user_roles`, not from token claims. A superadmin grant, or the `admin` role held with `admin` type, invokes any workflow. `capabilityInvoke` requires a superadmin grant.
279
+
280
+ `execute_as` follows the act-as rule: a superadmin may act as anyone. A caller holding an `admin`-type grant may act as an account that holds no superadmin grant and whose every role the caller holds at the same or higher type. Nobody else may.
277
281
 
278
282
  ### List the caller's invokable workflows
279
283
 
@@ -307,6 +311,8 @@ These endpoints let you check on running or completed workflows. The `workflowId
307
311
  GET /api/workflows/:workflowId/status
308
312
  ```
309
313
 
314
+ **Auth:** Requires builder access (superadmin or the `engineer` role).
315
+
310
316
  **Response 200:**
311
317
 
312
318
  ```json
@@ -330,6 +336,8 @@ GET /api/workflows/:workflowId/result
330
336
 
331
337
  Returns the result if the workflow is complete, or `202` if it's still running. Never blocks.
332
338
 
339
+ **Auth:** Requires builder access, or being the person who started the run or the account it runs as (read from the run's start envelope: `lt.userId`, or `lt.initiatedBy` when it runs under `execute_as`). Others receive `403`.
340
+
333
341
  **Response 200** (complete):
334
342
 
335
343
  ```json
@@ -361,6 +369,8 @@ Returns the result if the workflow is complete, or `202` if it's still running.
361
369
 
362
370
  ## Execution History Export
363
371
 
372
+ Every `/api/workflow-states` endpoint requires builder access, except `/:workflowId/execution`, which follows the same rule as `GET /api/workflows/:workflowId/result`.
373
+
364
374
  Every workflow's full execution history is exportable in JSON. Two formats are available: a raw state export (HotMesh-native) and a structured execution event history with typed events, ISO timestamps, durations, and cross-references.
365
375
 
366
376
  Because workflows are durably executed — state is transactionally checkpointed to Postgres after every step — the export is a complete, faithful record of everything that happened. Every activity scheduled, every result returned, every signal received, every child workflow spawned. Nothing is reconstructed or approximated.
@@ -371,6 +381,8 @@ Because workflows are durably executed — state is transactionally checkpointed
371
381
  GET /api/workflows/:workflowId/export
372
382
  ```
373
383
 
384
+ **Auth:** Requires builder access.
385
+
374
386
  Returns the raw workflow state from HotMesh. For full control over facet filtering and execution format, use the dedicated `/api/workflow-states` endpoints below.
375
387
 
376
388
  **Response 200:** Raw workflow state object (data, state, status, timeline, transitions).
@@ -658,6 +670,8 @@ POST /api/workflows/:workflowId/terminate
658
670
 
659
671
  Interrupt a running workflow. The workflow is immediately terminated.
660
672
 
673
+ **Auth:** Requires builder access.
674
+
661
675
  **Path parameters:**
662
676
 
663
677
  | Parameter | Description |
@@ -688,16 +702,17 @@ Interrupt a running workflow. The workflow is immediately terminated.
688
702
  | `DELETE` | `/:type/config` | admin | Delete a workflow configuration (cascade) |
689
703
  | `GET` | `/:type/input-lookups` | RBAC | Resolve the config's pinned knowledge lookups (invoke predicate) |
690
704
  | `POST` | `/:type/invoke` | RBAC | Invoke a workflow (requires `invocable: true`) |
691
- | `GET` | `/:workflowId/status` | any | Workflow status |
692
- | `GET` | `/:workflowId/result` | any | Get workflow result (200 if complete, 202 if running) |
693
- | `POST` | `/:workflowId/terminate` | any | Terminate a running workflow |
694
- | `GET` | `/:workflowId/export` | any | Raw state export (convenience alias) |
705
+ | `GET` | `/:workflowId/status` | builder | Workflow status |
706
+ | `GET` | `/:workflowId/result` | builder or run owner | Get workflow result (200 if complete, 202 if running) |
707
+ | `POST` | `/:workflowId/terminate` | builder | Terminate a running workflow |
708
+ | `GET` | `/:workflowId/export` | builder | Raw state export (convenience alias) |
695
709
 
696
710
  ### `/api/workflow-states`
697
711
 
698
712
  | Method | Path | Auth | Description |
699
713
  |--------|------|------|-------------|
700
- | `GET` | `/:workflowId` | any | Raw state export with facet filtering |
701
- | `GET` | `/:workflowId/execution` | any | Structured execution history |
702
- | `GET` | `/:workflowId/status` | any | Status semaphore |
703
- | `GET` | `/:workflowId/state` | any | Current workflow state snapshot |
714
+ | `GET` | `/:workflowId` | builder | Raw state export with facet filtering |
715
+ | `GET` | `/:workflowId/execution` | builder or run owner | Structured execution history |
716
+ | `GET` | `/:workflowId/envelopes` | builder | Input and output envelopes |
717
+ | `GET` | `/:workflowId/status` | builder | Status semaphore |
718
+ | `GET` | `/:workflowId/state` | builder | Current workflow state snapshot |