@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
package/docs/events.md CHANGED
@@ -45,6 +45,12 @@ services:
45
45
  - NATS_TOKEN=your-token
46
46
  ```
47
47
 
48
+ **Browser access.** The dashboard only subscribes. With the WebSocket proxy (`wsProxy`, so browsers reach NATS through Long Tail at `<basePath>/nats-ws`), `GET /api/nats-credentials` returns a WebSocket URL carrying a short-lived ticket for the signed-in person (`NATS_WS_TICKET_TTL_SECONDS`, default 300) and no NATS credential. The proxy admits only a ticket holder, writes the server's `NATS_TOKEN` into the connection itself, and drops anything the browser tries to publish. When browsers connect to NATS directly, set `NATS_DASHBOARD_TOKEN` to a subscribe-only NATS credential and the route hands that out instead of `NATS_TOKEN`.
49
+
50
+ **What a browser receives.** Builders (superadmin, or the `engineer` role) receive events whole. Everyone else receives the browser view: escalation events keep their routing fields (`id`, `type`, `subtype`, `status`, `priority`, `role`, `assigned_to`, `assigned_until`, `workflow_id`, `workflow_type`, `origin_id`, `task_id`, `parent_id`, `resolved_at`, `claimed_at`, and the bulk and reassignment fields), and every other event arrives without `data` and `milestones`. Records are read through the scoped API by id, so pages refresh as before; the invoke page reads its own run's result from `GET /api/workflows/:id/result`. The WebSocket proxy applies the view per connection from the ticket's person, and the Socket.IO adapter per socket from the person its authenticator returns (`{ userId }`; an authenticator that returns `true` admits the socket with the browser view). Server-side consumers, such as agent triggers and callbacks, receive events whole.
51
+
52
+ **Reconnecting.** The dashboard fetches a fresh ticket from `GET /api/nats-credentials` for every connection attempt, through the same client as every API call, so an expired session is refreshed first. After a drop the first retry lands at a random point within `NATS_RECONNECT_SPREAD_MS` (default 5000), so tabs that dropped together after a deploy return gradually; later retries back off with jitter from `NATS_RECONNECT_INITIAL_MS` (default 1000) up to `NATS_RECONNECT_MAX_MS` (default 60000), one attempt at a time. It waits while the tab is hidden, and stops only when the person is signed out; a new sign-in starts it again. On reconnect it reopens every active subscription and refetches the open pages once, spread across the same window. When live updates stay down longer than `NATS_LIVE_NOTICE_AFTER_MS` (default 30000), a "Live updates unavailable" notice appears in the announcement banner row. `GET /api/settings` carries these values as `events.reconnect` (`initialDelayMs`, `maxDelayMs`, `noticeAfterMs`, `spreadMs`).
53
+
48
54
  Both adapters still publish events regardless of `EVENT_TRANSPORT` — the setting only controls what the dashboard listens on. This means server-side event consumers (callbacks, NATS subscribers) work independently of the dashboard transport.
49
55
 
50
56
  ## The event envelope
package/docs/iam.md CHANGED
@@ -123,14 +123,14 @@ Use `execute_as` when a workflow needs permissions or credentials that differ fr
123
123
  Two ways to set `execute_as`:
124
124
 
125
125
  1. **Workflow config** — set `execute_as` in `lt_config_workflows`. Every invocation of that workflow runs as the specified service account.
126
- 2. **Per-request override** — pass `executeAs` in the invocation payload. Requires admin or superadmin role.
126
+ 2. **Per-request override** — pass `execute_as` in the invocation body. A superadmin may act as any account. A caller holding an admin-type grant may act as an account that holds no superadmin grant and whose every role the caller also holds, at the same or a higher type. No other caller may set it.
127
127
 
128
128
  In both cases, the original invoker is preserved in `initiated_by`. The audit trail always shows both who asked and who executed.
129
129
 
130
130
  ### Lifecycle
131
131
 
132
132
  ```bash
133
- # Create a service account (admin-only)
133
+ # Create a service account (builder: superadmin or the engineer role)
134
134
  POST /api/bot-accounts
135
135
  { "name": "data-bot", "description": "Nightly analytics" }
136
136
 
@@ -287,13 +287,15 @@ The MCP client also emits debug-level audit logs for every tool invocation:
287
287
  | Credential | Scope | Lifetime | Revocation |
288
288
  |---|---|---|---|
289
289
  | User JWT | Full API (RBAC-scoped) | 24 hours | Logout / expiry |
290
- | Bot API key | Full API (RBAC-scoped) | Until revoked | Admin deletes key |
290
+ | Bot API key | Full API (RBAC-scoped) | Until revoked | A builder revokes the key |
291
291
  | Delegation token | Specific scopes | 5 min (max 1 hr) | Expires naturally |
292
292
  | OAuth token | Provider scopes | Provider-set | User revokes in Connections |
293
293
 
294
- Service accounts inherit the same RBAC constraints as human users. A service account with the `member` role cannot access admin endpoints. A service account without `engineer` cannot invoke workflows gated by `invocation_roles`.
294
+ Service accounts inherit the same RBAC constraints as human users. A service account with the `member` role cannot access admin endpoints. A service account that holds none of a workflow's `invocation_roles` cannot invoke it.
295
295
 
296
- The `execute_as` override requires admin role. There is no way for a non-admin to impersonate a service account through the API.
296
+ Invocation roles are checked against the caller's current grants in the database, never the role claims a token carries. A workflow with an empty `invocation_roles` list is open to every authenticated caller. A superadmin, or a holder of the `admin` role at admin type, invokes any invocable workflow. `capabilityInvoke`, which calls tools with system authority, is invocable by superadmins only. Identity context for a compiled workflow comes from the server: a caller-supplied `_scope` in the input data is ignored.
297
+
298
+ The `execute_as` override never exceeds the caller's own authority. A superadmin may act as any account; a caller holding an admin-type grant may act as a non-superadmin account all of whose roles the caller holds at the same or a higher type. Anyone else is refused with `403`.
297
299
 
298
300
  ## Key Files
299
301
 
@@ -2,19 +2,26 @@
2
2
 
3
3
  HotMesh stores execution artifacts in PostgreSQL: stream messages that carry internal signals between activities, transient job rows that track bookkeeping for individual activity invocations, and entity job rows that represent durable workflow instances. Left unmanaged, these tables grow without bound. The maintenance system provides scheduled, rule-based cleanup that runs as a durable cron workflow inside HotMesh itself.
4
4
 
5
- A default configuration ships with Long Tail. It runs nightly at 2 AM, applies four rules in sequence, and requires no setup. The schedule and rules can be replaced at startup or at runtime through the REST API.
5
+ Maintenance is opt-in. A default configuration ships with Long Tail: pass `maintenance: true` to `start()` and it runs weekly, Sundays at 2 AM, applying five rules in sequence. A config object of your own replaces it, and the rules can be replaced at runtime through the REST API.
6
6
 
7
7
  ## Configuration via start()
8
8
 
9
- Maintenance is enabled by default when you call `start()`. To customize or disable it:
9
+ `start()` registers maintenance only when its `maintenance` option asks for it:
10
+
11
+ | `maintenance` | Effect |
12
+ |---|---|
13
+ | omitted or `false` | No maintenance runs. |
14
+ | `true` | The default configuration (see [Default schedule](#default-schedule)). |
15
+ | an `LTMaintenanceConfig` | That configuration, in place of the default. |
10
16
 
11
17
  ```typescript
12
18
  import { start } from '@hotmeshio/long-tail';
13
19
 
14
- // Default: nightly 2 AM cleanup (no config needed)
20
+ // Default: Sundays at 2 AM
15
21
  await start({
16
22
  database: { connectionString: process.env.DATABASE_URL },
17
23
  workers: [ ... ],
24
+ maintenance: true,
18
25
  });
19
26
 
20
27
  // Custom schedule and rules
@@ -22,6 +29,7 @@ await start({
22
29
  database: { connectionString: process.env.DATABASE_URL },
23
30
  workers: [ ... ],
24
31
  maintenance: {
32
+ appId: 'durable',
25
33
  schedule: '0 3 * * *',
26
34
  rules: [
27
35
  { target: 'streams', olderThan: '24 hours', action: 'delete' },
@@ -29,21 +37,23 @@ await start({
29
37
  { target: 'jobs', olderThan: '14 days', action: 'prune', hasEntity: true },
30
38
  { target: 'jobs', olderThan: '180 days', action: 'delete', pruned: true },
31
39
  { target: 'escalations', olderThan: '180 days', action: 'delete' },
40
+ { target: 'oauth', olderThan: '7 days', action: 'delete' },
32
41
  ],
33
42
  },
34
43
  });
35
44
 
36
- // Disabled entirely
45
+ // No maintenance: omit the option (or pass false)
37
46
  await start({
38
47
  database: { connectionString: process.env.DATABASE_URL },
39
48
  workers: [ ... ],
40
- maintenance: false,
41
49
  });
42
50
  ```
43
51
 
52
+ Maintenance starts once workers start, and not on a readonly instance.
53
+
44
54
  ## What gets cleaned
45
55
 
46
- Five categories of data are subject to maintenance:
56
+ Six categories of data are subject to maintenance:
47
57
 
48
58
  | Category | Description |
49
59
  |---|---|
@@ -52,6 +62,7 @@ Five categories of data are subject to maintenance:
52
62
  | **Entity jobs** | Job rows where `entity` is set. These represent actual workflow instances -- the rows that back `Durable.Client.workflow.search()` calls and execution exports. Deleting them removes the workflow record entirely. |
53
63
  | **Pruned jobs** | Entity jobs that have already had their execution artifacts stripped (the `pruned_at` column is not `NULL`). These retain core data but no longer carry execution scaffolding. They can be hard-deleted after a longer retention window. |
54
64
  | **Terminal escalations** | Escalation rows in a terminal status (`resolved`, `cancelled`, `expired`). Terminal rows are inert audit records -- every engine state transition guards on `status = 'pending'`, so aging them out is safe for live waiters, claims, and signal delivery. The engine-owned prune deletes in atomic batches until the retention horizon is drained. Pending rows are never touched. |
65
+ | **OAuth server rows** | The `/mcp` authorization server's records. Refresh tokens and authorization codes past expiry, or rotated out, longer ago than the window; then grants left with neither, or revoked longer ago than the window; then clients registered longer ago than the window with no live grant. A client still holding a live refresh token keeps its grant and its registration. |
55
66
 
56
67
  ## Prune vs. delete
57
68
 
@@ -64,26 +75,31 @@ The intended lifecycle for an entity job is: execute, then prune after a short r
64
75
 
65
76
  ## Default schedule
66
77
 
67
- The built-in configuration (`modules/maintenance.ts`) runs at 2 AM daily and applies four rules in order:
78
+ The default configuration (`modules/maintenance.ts`, enabled with `maintenance: true`) runs Sundays at 2 AM and applies five rules in order:
68
79
 
69
80
  ```typescript
70
81
  {
71
- schedule: '0 2 * * *',
82
+ appId: 'durable',
83
+ schedule: '0 2 * * 0',
72
84
  rules: [
73
- { target: 'streams', action: 'delete', olderThan: '7 days' },
74
- { target: 'jobs', action: 'delete', olderThan: '7 days', hasEntity: false },
75
- { target: 'jobs', action: 'prune', olderThan: '7 days', hasEntity: true },
76
- { target: 'jobs', action: 'delete', olderThan: '90 days', pruned: true },
85
+ { target: 'streams', action: 'delete', olderThan: '30 days' },
86
+ { target: 'jobs', action: 'delete', olderThan: '30 days', hasEntity: false },
87
+ { target: 'jobs', action: 'prune', olderThan: '30 days', hasEntity: true },
88
+ { target: 'jobs', action: 'delete', olderThan: '180 days', pruned: true },
89
+ { target: 'oauth', action: 'delete', olderThan: '7 days' },
77
90
  ],
78
91
  }
79
92
  ```
80
93
 
81
94
  | Rule | Effect |
82
95
  |---|---|
83
- | 1. Delete streams older than 7 days | Removes internal message data that is no longer needed for replay or debugging. |
84
- | 2. Delete transient jobs older than 7 days | Removes activity-level bookkeeping rows that have no associated workflow entity. |
85
- | 3. Prune entity jobs older than 7 days | Strips execution artifacts from workflow instances while preserving core data. Exports and search remain functional. |
86
- | 4. Delete pruned jobs older than 90 days | Hard-deletes workflow instances that were pruned at least 90 days ago. This is the final removal. |
96
+ | 1. Delete streams older than 30 days | Removes internal message data that is no longer needed for replay or debugging. |
97
+ | 2. Delete transient jobs older than 30 days | Removes activity-level bookkeeping rows that have no associated workflow entity. |
98
+ | 3. Prune entity jobs older than 30 days | Strips execution artifacts from workflow instances while preserving core data. Exports and search remain functional. |
99
+ | 4. Delete pruned jobs older than 180 days | Hard-deletes workflow instances that were pruned at least 180 days ago. This is the final removal. |
100
+ | 5. Delete OAuth server rows older than 7 days | Removes expired codes and tokens, unused or revoked grants, and clients with no live grant. |
101
+
102
+ A custom `rules` list replaces the defaults, so include the `oauth` rule when the OAuth server is enabled.
87
103
 
88
104
  Rules execute sequentially. If one fails, the remaining rules still run; failures are logged and do not halt the cycle.
89
105
 
@@ -95,7 +111,7 @@ Defined in `types/maintenance.ts`. Each rule describes a single cleanup operatio
95
111
 
96
112
  | Field | Type | Required | Description |
97
113
  |---|---|---|---|
98
- | `target` | `'streams' \| 'jobs' \| 'escalations'` | Yes | The resource type to act on. |
114
+ | `target` | `'streams' \| 'jobs' \| 'escalations' \| 'oauth'` | Yes | The resource type to act on. |
99
115
  | `action` | `'delete' \| 'prune'` | Yes | Whether to remove entirely or strip execution artifacts. |
100
116
  | `olderThan` | `string` | Yes | A PostgreSQL interval expression: `'7 days'`, `'24 hours'`, `'90 days'`. |
101
117
  | `hasEntity` | `boolean` | No | When `target` is `'jobs'`: `true` selects entity jobs, `false` selects transient jobs (where `entity IS NULL`). |
@@ -106,6 +122,7 @@ Defined in `types/maintenance.ts`. Each rule describes a single cleanup operatio
106
122
 
107
123
  | Field | Type | Description |
108
124
  |---|---|---|
125
+ | `appId` | `string` | The HotMesh application namespace to prune. The default configuration uses `'durable'`. |
109
126
  | `schedule` | `string` | A cron expression (`'0 2 * * *'`) or an interval string (`'1 day'`). Passed directly to `Virtual.cron` as the `interval` option. |
110
127
  | `rules` | `LTMaintenanceRule[]` | An ordered array of rules. Executed sequentially on each cron tick. |
111
128
 
@@ -117,14 +134,14 @@ The `maintenanceRegistry` singleton (`services/maintenance/index.ts`) follows th
117
134
  |---|---|
118
135
  | `register(config)` | Store a maintenance configuration. Replaces any previously registered config. Call before `connect()`. |
119
136
  | `connect()` | Start the `Virtual.cron` workflow that fires on the configured schedule. Idempotent -- given the same internal cron ID, duplicate calls do not create duplicate schedules. |
120
- | `disconnect()` | Cancel the running cron by calling `Virtual.interrupt`. Safe to call if no cron is running. |
137
+ | `disconnect()` | Mark this registry disconnected, on graceful shutdown or before a reconfiguration. The durable cron job is left in place: it is shared by every container, and another container (or this one after a restart) keeps servicing it. |
121
138
  | `clear()` | Remove the config and reset internal state. Used in tests. |
122
139
  | `hasConfig` | Boolean property. `true` when a config has been registered. |
123
140
  | `config` | Returns the current `LTMaintenanceConfig` or `null`. |
124
141
 
125
142
  ## Programmatic registration
126
143
 
127
- For advanced use cases, you can register maintenance programmatically instead of through `start()`. The `start()` function handles this automatically when a `maintenance` config is provided (or uses the default when omitted):
144
+ For advanced use cases, you can register maintenance programmatically instead of through `start()`. `start()` does this itself when `maintenance` is `true` (the default configuration) or a config object:
128
145
 
129
146
  ```typescript
130
147
  import { maintenanceRegistry, defaultMaintenanceConfig } from '@hotmeshio/long-tail';
@@ -138,6 +155,7 @@ To use a custom config instead, register it in place of the default:
138
155
  import { maintenanceRegistry } from '@hotmeshio/long-tail';
139
156
 
140
157
  maintenanceRegistry.register({
158
+ appId: 'durable',
141
159
  schedule: '0 3 * * 0', // Sundays at 3 AM
142
160
  rules: [
143
161
  { target: 'streams', action: 'delete', olderThan: '14 days' },
@@ -148,7 +166,7 @@ maintenanceRegistry.register({
148
166
  });
149
167
  ```
150
168
 
151
- The registry accepts exactly one config at a time. Calling `register()` again overwrites the previous config. The cron does not start until `connect()` is called — which happens inside `start()` when `hasConfig` is `true`.
169
+ The registry accepts exactly one config at a time. Calling `register()` again overwrites the previous config. The cron does not start until `connect()` is called, which `start()` does when `hasConfig` is `true`.
152
170
 
153
171
  ## Runtime API
154
172
 
@@ -156,12 +174,13 @@ The REST API allows administrators to replace the maintenance config while the s
156
174
 
157
175
  ### `GET /api/config/maintenance`
158
176
 
159
- Returns the current configuration and whether a cron is active.
177
+ Returns the current configuration. `active` is `true` when a configuration is registered; `config` is `null` and `active` is `false` when none is.
160
178
 
161
179
  ```json
162
180
  {
163
181
  "config": {
164
- "schedule": "0 2 * * *",
182
+ "appId": "durable",
183
+ "schedule": "0 2 * * 0",
165
184
  "rules": [ ... ]
166
185
  },
167
186
  "active": true
@@ -174,6 +193,7 @@ Admin-only (requires `requireAdmin` middleware). Accepts a full replacement conf
174
193
 
175
194
  ```json
176
195
  {
196
+ "appId": "durable",
177
197
  "schedule": "0 4 * * *",
178
198
  "rules": [
179
199
  { "target": "streams", "action": "delete", "olderThan": "3 days" },
@@ -186,11 +206,13 @@ Admin-only (requires `requireAdmin` middleware). Accepts a full replacement conf
186
206
 
187
207
  The endpoint performs three operations in sequence:
188
208
 
189
- 1. **Disconnect** -- calls `maintenanceRegistry.disconnect()` to cancel the running cron via `Virtual.interrupt`.
209
+ 1. **Disconnect** -- calls `maintenanceRegistry.disconnect()`.
190
210
  2. **Register** -- calls `maintenanceRegistry.register()` with the new config.
191
- 3. **Connect** -- calls `maintenanceRegistry.connect()` to start a new cron with the updated schedule and rules.
211
+ 3. **Connect** -- calls `maintenanceRegistry.connect()`, which registers this container's cron worker with the new rules.
212
+
213
+ The new rules apply to the ticks this container runs. The configuration is held in memory: other containers keep the rules they started with, and a restart returns this one to its `start()` configuration. The schedule is fixed when the cron job is first created: an existing job keeps its schedule (see [How it works internally](#how-it-works-internally)).
192
214
 
193
- Returns the new config and `{ "restarted": true }` on success. Returns `400` if `schedule` or `rules` is missing, and `500` if any step fails.
215
+ Returns the new config and `{ "restarted": true }` on success. Returns `400` if `appId`, `schedule` or `rules` is missing, and `500` if any step fails.
194
216
 
195
217
  ## Custom schedule example
196
218
 
@@ -200,6 +222,7 @@ A production deployment that processes high volumes might want aggressive short-
200
222
  import { maintenanceRegistry } from '@hotmeshio/long-tail';
201
223
 
202
224
  maintenanceRegistry.register({
225
+ appId: 'durable',
203
226
  schedule: '0 */6 * * *', // every 6 hours
204
227
  rules: [
205
228
  { target: 'streams', action: 'delete', olderThan: '24 hours' },
@@ -217,8 +240,8 @@ This cleans streams and transient jobs within two days, prunes entity jobs after
217
240
  The maintenance system runs on top of HotMesh's `Virtual.cron`, the same primitive that powers durable recurring workflows throughout the platform.
218
241
 
219
242
  1. **Registration.** `maintenanceRegistry.register(config)` stores the config in memory. No I/O occurs.
220
- 2. **Connection.** `maintenanceRegistry.connect()` calls `Virtual.cron()` with a fixed topic (`lt.maintenance.prune`) and a fixed cron ID (`lt-maintenance-nightly`). HotMesh persists the cron schedule in PostgreSQL, making it durable across restarts. If a cron with that ID already exists, it is replaced.
221
- 3. **Execution.** On each tick of the schedule, the cron callback iterates the rules array. For each rule, it translates the rule's fields into the appropriate `dbaService.prune()` parameters and executes the call. Rules run sequentially; a failure in one rule is logged and does not prevent subsequent rules from running.
222
- 4. **Disconnection.** `maintenanceRegistry.disconnect()` calls `Virtual.interrupt()` with the same topic and cron ID, which cancels the recurring schedule. This is called during graceful shutdown and before reconfiguration via the REST API.
243
+ 2. **Connection.** `maintenanceRegistry.connect()` calls `Virtual.cron()` with a fixed topic (`lt.maintenance.prune`) and a fixed cron ID (`lt-maintenance-nightly`). This registers the container's worker for the topic and starts the cron job. HotMesh persists the job in PostgreSQL, making it durable across restarts. If a job with that ID already exists, it keeps running on the schedule it was created with, and no second job starts.
244
+ 3. **Execution.** On each tick of the schedule, the worker that takes the tick runs its rules in order. Stream and job rules call `dbaService.prune()`; escalation rules call the escalation client's batched prune until the window is drained; the `oauth` rule calls the OAuth server prune. A failure in one rule is logged and does not prevent subsequent rules from running.
245
+ 4. **Disconnection.** `maintenanceRegistry.disconnect()` marks the registry disconnected, during graceful shutdown and before reconfiguration via the REST API. It does not interrupt the cron job, which other containers keep servicing.
223
246
 
224
247
  Because the cron is itself a durable workflow, the schedule survives process restarts. If the server goes down at 2 AM and comes back at 2:05 AM, the missed tick executes on reconnection.