@hotmeshio/long-tail 0.1.0

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 (809) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +262 -0
  3. package/build/examples/external-mcp-server/server.d.ts +17 -0
  4. package/build/examples/external-mcp-server/server.js +116 -0
  5. package/build/examples/index.d.ts +2 -0
  6. package/build/examples/index.js +7 -0
  7. package/build/examples/seed.d.ts +5 -0
  8. package/build/examples/seed.js +221 -0
  9. package/build/examples/types/envelopes.d.ts +34 -0
  10. package/build/examples/types/envelopes.js +8 -0
  11. package/build/examples/types/index.d.ts +10 -0
  12. package/build/examples/types/index.js +9 -0
  13. package/build/examples/types/resolvers.d.ts +27 -0
  14. package/build/examples/types/resolvers.js +9 -0
  15. package/build/examples/workers.d.ts +10 -0
  16. package/build/examples/workers.js +49 -0
  17. package/build/examples/workflows/basic-echo/activities.d.ts +20 -0
  18. package/build/examples/workflows/basic-echo/activities.js +55 -0
  19. package/build/examples/workflows/basic-echo/index.d.ts +14 -0
  20. package/build/examples/workflows/basic-echo/index.js +66 -0
  21. package/build/examples/workflows/kitchen-sink/activities.d.ts +40 -0
  22. package/build/examples/workflows/kitchen-sink/activities.js +46 -0
  23. package/build/examples/workflows/kitchen-sink/index.d.ts +22 -0
  24. package/build/examples/workflows/kitchen-sink/index.js +123 -0
  25. package/build/examples/workflows/review-content/activities.d.ts +10 -0
  26. package/build/examples/workflows/review-content/activities.js +44 -0
  27. package/build/examples/workflows/review-content/index.d.ts +10 -0
  28. package/build/examples/workflows/review-content/index.js +95 -0
  29. package/build/examples/workflows/review-content/types.d.ts +28 -0
  30. package/build/examples/workflows/review-content/types.js +2 -0
  31. package/build/index.d.ts +37 -0
  32. package/build/index.js +151 -0
  33. package/build/modules/auth.d.ts +58 -0
  34. package/build/modules/auth.js +163 -0
  35. package/build/modules/config.d.ts +19 -0
  36. package/build/modules/config.js +26 -0
  37. package/build/modules/defaults.d.ts +58 -0
  38. package/build/modules/defaults.js +95 -0
  39. package/build/modules/ltconfig.d.ts +21 -0
  40. package/build/modules/ltconfig.js +110 -0
  41. package/build/modules/maintenance.d.ts +18 -0
  42. package/build/modules/maintenance.js +47 -0
  43. package/build/routes/auth.d.ts +2 -0
  44. package/build/routes/auth.js +48 -0
  45. package/build/routes/bot-accounts.d.ts +2 -0
  46. package/build/routes/bot-accounts.js +280 -0
  47. package/build/routes/controlplane.d.ts +2 -0
  48. package/build/routes/controlplane.js +144 -0
  49. package/build/routes/dba.d.ts +2 -0
  50. package/build/routes/dba.js +86 -0
  51. package/build/routes/delegation.d.ts +2 -0
  52. package/build/routes/delegation.js +81 -0
  53. package/build/routes/escalations/bulk.d.ts +2 -0
  54. package/build/routes/escalations/bulk.js +324 -0
  55. package/build/routes/escalations/helpers.d.ts +5 -0
  56. package/build/routes/escalations/helpers.js +48 -0
  57. package/build/routes/escalations/index.d.ts +2 -0
  58. package/build/routes/escalations/index.js +20 -0
  59. package/build/routes/escalations/list.d.ts +2 -0
  60. package/build/routes/escalations/list.js +140 -0
  61. package/build/routes/escalations/resolve.d.ts +2 -0
  62. package/build/routes/escalations/resolve.js +240 -0
  63. package/build/routes/escalations/single.d.ts +2 -0
  64. package/build/routes/escalations/single.js +195 -0
  65. package/build/routes/exports.d.ts +2 -0
  66. package/build/routes/exports.js +163 -0
  67. package/build/routes/files.d.ts +2 -0
  68. package/build/routes/files.js +47 -0
  69. package/build/routes/index.d.ts +2 -0
  70. package/build/routes/index.js +52 -0
  71. package/build/routes/insight.d.ts +2 -0
  72. package/build/routes/insight.js +58 -0
  73. package/build/routes/maintenance.d.ts +2 -0
  74. package/build/routes/maintenance.js +38 -0
  75. package/build/routes/mcp-runs.d.ts +2 -0
  76. package/build/routes/mcp-runs.js +85 -0
  77. package/build/routes/mcp.d.ts +2 -0
  78. package/build/routes/mcp.js +264 -0
  79. package/build/routes/namespaces.d.ts +2 -0
  80. package/build/routes/namespaces.js +71 -0
  81. package/build/routes/oauth.d.ts +7 -0
  82. package/build/routes/oauth.js +217 -0
  83. package/build/routes/resolve.d.ts +9 -0
  84. package/build/routes/resolve.js +19 -0
  85. package/build/routes/roles.d.ts +2 -0
  86. package/build/routes/roles.js +195 -0
  87. package/build/routes/settings.d.ts +2 -0
  88. package/build/routes/settings.js +35 -0
  89. package/build/routes/tasks.d.ts +2 -0
  90. package/build/routes/tasks.js +133 -0
  91. package/build/routes/users.d.ts +2 -0
  92. package/build/routes/users.js +206 -0
  93. package/build/routes/workflows/config.d.ts +2 -0
  94. package/build/routes/workflows/config.js +123 -0
  95. package/build/routes/workflows/discovery.d.ts +2 -0
  96. package/build/routes/workflows/discovery.js +146 -0
  97. package/build/routes/workflows/index.d.ts +2 -0
  98. package/build/routes/workflows/index.js +18 -0
  99. package/build/routes/workflows/invocation.d.ts +2 -0
  100. package/build/routes/workflows/invocation.js +162 -0
  101. package/build/routes/yaml-workflows/crud.d.ts +2 -0
  102. package/build/routes/yaml-workflows/crud.js +276 -0
  103. package/build/routes/yaml-workflows/deployment.d.ts +2 -0
  104. package/build/routes/yaml-workflows/deployment.js +179 -0
  105. package/build/routes/yaml-workflows/helpers.d.ts +2 -0
  106. package/build/routes/yaml-workflows/helpers.js +8 -0
  107. package/build/routes/yaml-workflows/index.d.ts +2 -0
  108. package/build/routes/yaml-workflows/index.js +21 -0
  109. package/build/routes/yaml-workflows/versions.d.ts +2 -0
  110. package/build/routes/yaml-workflows/versions.js +116 -0
  111. package/build/scripts/process-helpers.d.ts +11 -0
  112. package/build/scripts/process-helpers.js +59 -0
  113. package/build/scripts/process.d.ts +18 -0
  114. package/build/scripts/process.js +191 -0
  115. package/build/scripts/token.d.ts +13 -0
  116. package/build/scripts/token.js +42 -0
  117. package/build/services/auth/bot-api-key.d.ts +32 -0
  118. package/build/services/auth/bot-api-key.js +112 -0
  119. package/build/services/auth/delegation.d.ts +20 -0
  120. package/build/services/auth/delegation.js +53 -0
  121. package/build/services/auth/service-token.d.ts +23 -0
  122. package/build/services/auth/service-token.js +105 -0
  123. package/build/services/config/cache.d.ts +2 -0
  124. package/build/services/config/cache.js +24 -0
  125. package/build/services/config/index.d.ts +4 -0
  126. package/build/services/config/index.js +13 -0
  127. package/build/services/config/provider.d.ts +2 -0
  128. package/build/services/config/provider.js +30 -0
  129. package/build/services/config/read.d.ts +3 -0
  130. package/build/services/config/read.js +68 -0
  131. package/build/services/config/sql.d.ts +14 -0
  132. package/build/services/config/sql.js +58 -0
  133. package/build/services/config/write.d.ts +5 -0
  134. package/build/services/config/write.js +61 -0
  135. package/build/services/controlplane/index.d.ts +47 -0
  136. package/build/services/controlplane/index.js +124 -0
  137. package/build/services/controlplane/quorum-bridge.d.ts +15 -0
  138. package/build/services/controlplane/quorum-bridge.js +62 -0
  139. package/build/services/controlplane/sql.d.ts +21 -0
  140. package/build/services/controlplane/sql.js +70 -0
  141. package/build/services/controlplane/types.d.ts +13 -0
  142. package/build/services/controlplane/types.js +3 -0
  143. package/build/services/cron/index.d.ts +46 -0
  144. package/build/services/cron/index.js +199 -0
  145. package/build/services/db/index.d.ts +3 -0
  146. package/build/services/db/index.js +19 -0
  147. package/build/services/db/migrate.d.ts +1 -0
  148. package/build/services/db/migrate.js +78 -0
  149. package/build/services/dba.d.ts +28 -0
  150. package/build/services/dba.js +32 -0
  151. package/build/services/escalation/bulk.d.ts +27 -0
  152. package/build/services/escalation/bulk.js +57 -0
  153. package/build/services/escalation/crud.d.ts +47 -0
  154. package/build/services/escalation/crud.js +150 -0
  155. package/build/services/escalation/index.d.ts +4 -0
  156. package/build/services/escalation/index.js +20 -0
  157. package/build/services/escalation/queries.d.ts +37 -0
  158. package/build/services/escalation/queries.js +163 -0
  159. package/build/services/escalation/sql.d.ts +21 -0
  160. package/build/services/escalation/sql.js +135 -0
  161. package/build/services/escalation/types.d.ts +43 -0
  162. package/build/services/escalation/types.js +13 -0
  163. package/build/services/escalation-strategy/default.d.ts +12 -0
  164. package/build/services/escalation-strategy/default.js +17 -0
  165. package/build/services/escalation-strategy/index.d.ts +21 -0
  166. package/build/services/escalation-strategy/index.js +32 -0
  167. package/build/services/escalation-strategy/mcp.d.ts +13 -0
  168. package/build/services/escalation-strategy/mcp.js +51 -0
  169. package/build/services/events/index.d.ts +37 -0
  170. package/build/services/events/index.js +64 -0
  171. package/build/services/events/memory.d.ts +27 -0
  172. package/build/services/events/memory.js +40 -0
  173. package/build/services/events/nats.d.ts +29 -0
  174. package/build/services/events/nats.js +50 -0
  175. package/build/services/events/publish.d.ts +72 -0
  176. package/build/services/events/publish.js +106 -0
  177. package/build/services/events/socketio.d.ts +33 -0
  178. package/build/services/events/socketio.js +70 -0
  179. package/build/services/export/client.d.ts +2 -0
  180. package/build/services/export/client.js +16 -0
  181. package/build/services/export/index.d.ts +39 -0
  182. package/build/services/export/index.js +158 -0
  183. package/build/services/export/post-process.d.ts +16 -0
  184. package/build/services/export/post-process.js +133 -0
  185. package/build/services/export/types.d.ts +25 -0
  186. package/build/services/export/types.js +2 -0
  187. package/build/services/hotmesh-utils.d.ts +61 -0
  188. package/build/services/hotmesh-utils.js +204 -0
  189. package/build/services/iam/activity.d.ts +52 -0
  190. package/build/services/iam/activity.js +59 -0
  191. package/build/services/iam/bots.d.ts +83 -0
  192. package/build/services/iam/bots.js +157 -0
  193. package/build/services/iam/context.d.ts +14 -0
  194. package/build/services/iam/context.js +61 -0
  195. package/build/services/iam/credentials.d.ts +42 -0
  196. package/build/services/iam/credentials.js +86 -0
  197. package/build/services/iam/envelope.d.ts +10 -0
  198. package/build/services/iam/envelope.js +32 -0
  199. package/build/services/iam/ephemeral.d.ts +50 -0
  200. package/build/services/iam/ephemeral.js +131 -0
  201. package/build/services/iam/index.d.ts +19 -0
  202. package/build/services/iam/index.js +37 -0
  203. package/build/services/iam/principal.d.ts +12 -0
  204. package/build/services/iam/principal.js +53 -0
  205. package/build/services/iam/resolve.d.ts +48 -0
  206. package/build/services/iam/resolve.js +89 -0
  207. package/build/services/insight/index.d.ts +30 -0
  208. package/build/services/insight/index.js +81 -0
  209. package/build/services/insight/prompts.d.ts +4 -0
  210. package/build/services/insight/prompts.js +15 -0
  211. package/build/services/interceptor/activities/config.d.ts +21 -0
  212. package/build/services/interceptor/activities/config.js +26 -0
  213. package/build/services/interceptor/activities/escalation.d.ts +58 -0
  214. package/build/services/interceptor/activities/escalation.js +110 -0
  215. package/build/services/interceptor/activities/index.d.ts +4 -0
  216. package/build/services/interceptor/activities/index.js +23 -0
  217. package/build/services/interceptor/activities/task.d.ts +65 -0
  218. package/build/services/interceptor/activities/task.js +168 -0
  219. package/build/services/interceptor/activities/workflow.d.ts +26 -0
  220. package/build/services/interceptor/activities/workflow.js +41 -0
  221. package/build/services/interceptor/activity-interceptor.d.ts +32 -0
  222. package/build/services/interceptor/activity-interceptor.js +86 -0
  223. package/build/services/interceptor/completion.d.ts +16 -0
  224. package/build/services/interceptor/completion.js +149 -0
  225. package/build/services/interceptor/context.d.ts +11 -0
  226. package/build/services/interceptor/context.js +20 -0
  227. package/build/services/interceptor/escalation.d.ts +26 -0
  228. package/build/services/interceptor/escalation.js +150 -0
  229. package/build/services/interceptor/index.d.ts +45 -0
  230. package/build/services/interceptor/index.js +160 -0
  231. package/build/services/interceptor/lifecycle.d.ts +44 -0
  232. package/build/services/interceptor/lifecycle.js +174 -0
  233. package/build/services/interceptor/state.d.ts +22 -0
  234. package/build/services/interceptor/state.js +36 -0
  235. package/build/services/interceptor/types.d.ts +43 -0
  236. package/build/services/interceptor/types.js +3 -0
  237. package/build/services/llm/detect.d.ts +16 -0
  238. package/build/services/llm/detect.js +33 -0
  239. package/build/services/llm/index.d.ts +34 -0
  240. package/build/services/llm/index.js +106 -0
  241. package/build/services/llm/providers/anthropic.d.ts +11 -0
  242. package/build/services/llm/providers/anthropic.js +85 -0
  243. package/build/services/llm/providers/openai.d.ts +9 -0
  244. package/build/services/llm/providers/openai.js +46 -0
  245. package/build/services/llm/translate.d.ts +66 -0
  246. package/build/services/llm/translate.js +192 -0
  247. package/build/services/llm/types.d.ts +64 -0
  248. package/build/services/llm/types.js +8 -0
  249. package/build/services/logger/index.d.ts +32 -0
  250. package/build/services/logger/index.js +69 -0
  251. package/build/services/logger/pino.d.ts +24 -0
  252. package/build/services/logger/pino.js +59 -0
  253. package/build/services/maintenance/index.d.ts +43 -0
  254. package/build/services/maintenance/index.js +183 -0
  255. package/build/services/mcp/adapter.d.ts +23 -0
  256. package/build/services/mcp/adapter.js +119 -0
  257. package/build/services/mcp/client/connection.d.ts +46 -0
  258. package/build/services/mcp/client/connection.js +280 -0
  259. package/build/services/mcp/client/index.d.ts +2 -0
  260. package/build/services/mcp/client/index.js +16 -0
  261. package/build/services/mcp/client/tools.d.ts +22 -0
  262. package/build/services/mcp/client/tools.js +118 -0
  263. package/build/services/mcp/db-server/index.d.ts +25 -0
  264. package/build/services/mcp/db-server/index.js +49 -0
  265. package/build/services/mcp/db-server/schemas.d.ts +52 -0
  266. package/build/services/mcp/db-server/schemas.js +34 -0
  267. package/build/services/mcp/db-server/tools.d.ts +5 -0
  268. package/build/services/mcp/db-server/tools.js +224 -0
  269. package/build/services/mcp/db.d.ts +26 -0
  270. package/build/services/mcp/db.js +141 -0
  271. package/build/services/mcp/index.d.ts +25 -0
  272. package/build/services/mcp/index.js +47 -0
  273. package/build/services/mcp/playwright-server/index.d.ts +14 -0
  274. package/build/services/mcp/playwright-server/index.js +25 -0
  275. package/build/services/mcp/playwright-server/lifecycle.d.ts +7 -0
  276. package/build/services/mcp/playwright-server/lifecycle.js +63 -0
  277. package/build/services/mcp/playwright-server/schemas.d.ts +81 -0
  278. package/build/services/mcp/playwright-server/schemas.js +48 -0
  279. package/build/services/mcp/playwright-server/tools.d.ts +2 -0
  280. package/build/services/mcp/playwright-server/tools.js +224 -0
  281. package/build/services/mcp/server.d.ts +26 -0
  282. package/build/services/mcp/server.js +286 -0
  283. package/build/services/mcp/sql.d.ts +12 -0
  284. package/build/services/mcp/sql.js +59 -0
  285. package/build/services/mcp/types.d.ts +17 -0
  286. package/build/services/mcp/types.js +3 -0
  287. package/build/services/mcp/vision-server.d.ts +15 -0
  288. package/build/services/mcp/vision-server.js +214 -0
  289. package/build/services/mcp/workflow-compiler-server.d.ts +15 -0
  290. package/build/services/mcp/workflow-compiler-server.js +206 -0
  291. package/build/services/mcp/workflow-server.d.ts +24 -0
  292. package/build/services/mcp/workflow-server.js +230 -0
  293. package/build/services/mcp-runs/enrichment.d.ts +12 -0
  294. package/build/services/mcp-runs/enrichment.js +39 -0
  295. package/build/services/mcp-runs/events.d.ts +6 -0
  296. package/build/services/mcp-runs/events.js +126 -0
  297. package/build/services/mcp-runs/execution-builder.d.ts +12 -0
  298. package/build/services/mcp-runs/execution-builder.js +100 -0
  299. package/build/services/mcp-runs/index.d.ts +4 -0
  300. package/build/services/mcp-runs/index.js +8 -0
  301. package/build/services/mcp-runs/queries.d.ts +28 -0
  302. package/build/services/mcp-runs/queries.js +71 -0
  303. package/build/services/mcp-runs/sql.d.ts +4 -0
  304. package/build/services/mcp-runs/sql.js +17 -0
  305. package/build/services/mcp-runs/types.d.ts +65 -0
  306. package/build/services/mcp-runs/types.js +2 -0
  307. package/build/services/namespace/index.d.ts +17 -0
  308. package/build/services/namespace/index.js +41 -0
  309. package/build/services/namespace/sql.d.ts +4 -0
  310. package/build/services/namespace/sql.js +23 -0
  311. package/build/services/namespace/types.d.ts +11 -0
  312. package/build/services/namespace/types.js +3 -0
  313. package/build/services/oauth/crypto.d.ts +19 -0
  314. package/build/services/oauth/crypto.js +95 -0
  315. package/build/services/oauth/db.d.ts +20 -0
  316. package/build/services/oauth/db.js +140 -0
  317. package/build/services/oauth/index.d.ts +12 -0
  318. package/build/services/oauth/index.js +77 -0
  319. package/build/services/oauth/providers/anthropic.d.ts +3 -0
  320. package/build/services/oauth/providers/anthropic.js +111 -0
  321. package/build/services/oauth/providers/github.d.ts +3 -0
  322. package/build/services/oauth/providers/github.js +46 -0
  323. package/build/services/oauth/providers/google.d.ts +3 -0
  324. package/build/services/oauth/providers/google.js +44 -0
  325. package/build/services/oauth/providers/index.d.ts +2 -0
  326. package/build/services/oauth/providers/index.js +7 -0
  327. package/build/services/oauth/providers/microsoft.d.ts +3 -0
  328. package/build/services/oauth/providers/microsoft.js +46 -0
  329. package/build/services/oauth/providers/mock.d.ts +3 -0
  330. package/build/services/oauth/providers/mock.js +76 -0
  331. package/build/services/oauth/providers/registry.d.ts +8 -0
  332. package/build/services/oauth/providers/registry.js +46 -0
  333. package/build/services/oauth/providers/types.d.ts +13 -0
  334. package/build/services/oauth/providers/types.js +2 -0
  335. package/build/services/oauth/state.d.ts +30 -0
  336. package/build/services/oauth/state.js +83 -0
  337. package/build/services/orchestrator/index.d.ts +23 -0
  338. package/build/services/orchestrator/index.js +156 -0
  339. package/build/services/orchestrator/types.d.ts +15 -0
  340. package/build/services/orchestrator/types.js +3 -0
  341. package/build/services/role/index.d.ts +47 -0
  342. package/build/services/role/index.js +136 -0
  343. package/build/services/role/sql.d.ts +14 -0
  344. package/build/services/role/sql.js +80 -0
  345. package/build/services/role/types.d.ts +11 -0
  346. package/build/services/role/types.js +3 -0
  347. package/build/services/storage/index.d.ts +12 -0
  348. package/build/services/storage/index.js +31 -0
  349. package/build/services/storage/local.d.ts +26 -0
  350. package/build/services/storage/local.js +129 -0
  351. package/build/services/storage/s3.d.ts +31 -0
  352. package/build/services/storage/s3.js +180 -0
  353. package/build/services/storage/types.d.ts +41 -0
  354. package/build/services/storage/types.js +2 -0
  355. package/build/services/task/crud.d.ts +21 -0
  356. package/build/services/task/crud.js +123 -0
  357. package/build/services/task/index.d.ts +4 -0
  358. package/build/services/task/index.js +20 -0
  359. package/build/services/task/process.d.ts +14 -0
  360. package/build/services/task/process.js +98 -0
  361. package/build/services/task/resolve.d.ts +12 -0
  362. package/build/services/task/resolve.js +49 -0
  363. package/build/services/task/sql.d.ts +19 -0
  364. package/build/services/task/sql.js +92 -0
  365. package/build/services/task/types.d.ts +56 -0
  366. package/build/services/task/types.js +9 -0
  367. package/build/services/telemetry/honeycomb.d.ts +53 -0
  368. package/build/services/telemetry/honeycomb.js +79 -0
  369. package/build/services/telemetry/index.d.ts +46 -0
  370. package/build/services/telemetry/index.js +68 -0
  371. package/build/services/user/auth.d.ts +7 -0
  372. package/build/services/user/auth.js +26 -0
  373. package/build/services/user/crud.d.ts +19 -0
  374. package/build/services/user/crud.js +151 -0
  375. package/build/services/user/index.d.ts +5 -0
  376. package/build/services/user/index.js +26 -0
  377. package/build/services/user/rbac.d.ts +15 -0
  378. package/build/services/user/rbac.js +32 -0
  379. package/build/services/user/roles.d.ts +7 -0
  380. package/build/services/user/roles.js +42 -0
  381. package/build/services/user/sql.d.ts +22 -0
  382. package/build/services/user/sql.js +45 -0
  383. package/build/services/user/types.d.ts +23 -0
  384. package/build/services/user/types.js +4 -0
  385. package/build/services/workers/registry.d.ts +10 -0
  386. package/build/services/workers/registry.js +26 -0
  387. package/build/services/workflow-invocation.d.ts +46 -0
  388. package/build/services/workflow-invocation.js +184 -0
  389. package/build/services/yaml-workflow/db-utils.d.ts +25 -0
  390. package/build/services/yaml-workflow/db-utils.js +93 -0
  391. package/build/services/yaml-workflow/db.d.ts +27 -0
  392. package/build/services/yaml-workflow/db.js +196 -0
  393. package/build/services/yaml-workflow/deployer-helpers.d.ts +13 -0
  394. package/build/services/yaml-workflow/deployer-helpers.js +133 -0
  395. package/build/services/yaml-workflow/deployer.d.ts +54 -0
  396. package/build/services/yaml-workflow/deployer.js +203 -0
  397. package/build/services/yaml-workflow/generator.d.ts +21 -0
  398. package/build/services/yaml-workflow/generator.js +117 -0
  399. package/build/services/yaml-workflow/index.d.ts +4 -0
  400. package/build/services/yaml-workflow/index.js +20 -0
  401. package/build/services/yaml-workflow/input-analyzer-helpers.d.ts +48 -0
  402. package/build/services/yaml-workflow/input-analyzer-helpers.js +183 -0
  403. package/build/services/yaml-workflow/input-analyzer.d.ts +30 -0
  404. package/build/services/yaml-workflow/input-analyzer.js +109 -0
  405. package/build/services/yaml-workflow/pattern-detector/array-source.d.ts +22 -0
  406. package/build/services/yaml-workflow/pattern-detector/array-source.js +120 -0
  407. package/build/services/yaml-workflow/pattern-detector/collapse.d.ts +27 -0
  408. package/build/services/yaml-workflow/pattern-detector/collapse.js +92 -0
  409. package/build/services/yaml-workflow/pattern-detector/index.d.ts +18 -0
  410. package/build/services/yaml-workflow/pattern-detector/index.js +22 -0
  411. package/build/services/yaml-workflow/pattern-detector/run-detection.d.ts +28 -0
  412. package/build/services/yaml-workflow/pattern-detector/run-detection.js +81 -0
  413. package/build/services/yaml-workflow/pattern-detector/types.d.ts +29 -0
  414. package/build/services/yaml-workflow/pattern-detector/types.js +8 -0
  415. package/build/services/yaml-workflow/pipeline/analyze.d.ts +11 -0
  416. package/build/services/yaml-workflow/pipeline/analyze.js +64 -0
  417. package/build/services/yaml-workflow/pipeline/build/dag.d.ts +25 -0
  418. package/build/services/yaml-workflow/pipeline/build/dag.js +254 -0
  419. package/build/services/yaml-workflow/pipeline/build/index.d.ts +20 -0
  420. package/build/services/yaml-workflow/pipeline/build/index.js +115 -0
  421. package/build/services/yaml-workflow/pipeline/build/iteration.d.ts +25 -0
  422. package/build/services/yaml-workflow/pipeline/build/iteration.js +231 -0
  423. package/build/services/yaml-workflow/pipeline/build/metadata.d.ts +15 -0
  424. package/build/services/yaml-workflow/pipeline/build/metadata.js +126 -0
  425. package/build/services/yaml-workflow/pipeline/build/transform.d.ts +17 -0
  426. package/build/services/yaml-workflow/pipeline/build/transform.js +94 -0
  427. package/build/services/yaml-workflow/pipeline/build/utils.d.ts +22 -0
  428. package/build/services/yaml-workflow/pipeline/build/utils.js +129 -0
  429. package/build/services/yaml-workflow/pipeline/build/wiring.d.ts +9 -0
  430. package/build/services/yaml-workflow/pipeline/build/wiring.js +148 -0
  431. package/build/services/yaml-workflow/pipeline/compile/index.d.ts +17 -0
  432. package/build/services/yaml-workflow/pipeline/compile/index.js +64 -0
  433. package/build/services/yaml-workflow/pipeline/compile/llm-call.d.ts +14 -0
  434. package/build/services/yaml-workflow/pipeline/compile/llm-call.js +153 -0
  435. package/build/services/yaml-workflow/pipeline/compile/parse-plan.d.ts +12 -0
  436. package/build/services/yaml-workflow/pipeline/compile/parse-plan.js +88 -0
  437. package/build/services/yaml-workflow/pipeline/compile/summarize.d.ts +39 -0
  438. package/build/services/yaml-workflow/pipeline/compile/summarize.js +174 -0
  439. package/build/services/yaml-workflow/pipeline/extract-helpers.d.ts +42 -0
  440. package/build/services/yaml-workflow/pipeline/extract-helpers.js +88 -0
  441. package/build/services/yaml-workflow/pipeline/extract.d.ts +24 -0
  442. package/build/services/yaml-workflow/pipeline/extract.js +235 -0
  443. package/build/services/yaml-workflow/pipeline/prompts.d.ts +15 -0
  444. package/build/services/yaml-workflow/pipeline/prompts.js +254 -0
  445. package/build/services/yaml-workflow/pipeline/validate.d.ts +12 -0
  446. package/build/services/yaml-workflow/pipeline/validate.js +111 -0
  447. package/build/services/yaml-workflow/sql.d.ts +19 -0
  448. package/build/services/yaml-workflow/sql.js +83 -0
  449. package/build/services/yaml-workflow/types.d.ts +223 -0
  450. package/build/services/yaml-workflow/types.js +8 -0
  451. package/build/services/yaml-workflow/workers/callbacks.d.ts +17 -0
  452. package/build/services/yaml-workflow/workers/callbacks.js +194 -0
  453. package/build/services/yaml-workflow/workers/events.d.ts +7 -0
  454. package/build/services/yaml-workflow/workers/events.js +49 -0
  455. package/build/services/yaml-workflow/workers/index.d.ts +4 -0
  456. package/build/services/yaml-workflow/workers/index.js +15 -0
  457. package/build/services/yaml-workflow/workers/register.d.ts +15 -0
  458. package/build/services/yaml-workflow/workers/register.js +233 -0
  459. package/build/services/yaml-workflow/workers/scope.d.ts +13 -0
  460. package/build/services/yaml-workflow/workers/scope.js +37 -0
  461. package/build/start/adapters.d.ts +6 -0
  462. package/build/start/adapters.js +80 -0
  463. package/build/start/config.d.ts +10 -0
  464. package/build/start/config.js +88 -0
  465. package/build/start/index.d.ts +21 -0
  466. package/build/start/index.js +87 -0
  467. package/build/start/server.d.ts +6 -0
  468. package/build/start/server.js +46 -0
  469. package/build/start/workers.d.ts +32 -0
  470. package/build/start/workers.js +144 -0
  471. package/build/system/activities/claude-code.d.ts +56 -0
  472. package/build/system/activities/claude-code.js +258 -0
  473. package/build/system/activities/file-storage.d.ts +31 -0
  474. package/build/system/activities/file-storage.js +71 -0
  475. package/build/system/activities/http.d.ts +27 -0
  476. package/build/system/activities/http.js +56 -0
  477. package/build/system/activities/oauth.d.ts +39 -0
  478. package/build/system/activities/oauth.js +33 -0
  479. package/build/system/activities/triage/cache.d.ts +7 -0
  480. package/build/system/activities/triage/cache.js +10 -0
  481. package/build/system/activities/triage/context.d.ts +21 -0
  482. package/build/system/activities/triage/context.js +92 -0
  483. package/build/system/activities/triage/discovery.d.ts +25 -0
  484. package/build/system/activities/triage/discovery.js +170 -0
  485. package/build/system/activities/triage/index.d.ts +5 -0
  486. package/build/system/activities/triage/index.js +22 -0
  487. package/build/system/activities/triage/llm.d.ts +9 -0
  488. package/build/system/activities/triage/llm.js +34 -0
  489. package/build/system/activities/triage/tools.d.ts +24 -0
  490. package/build/system/activities/triage/tools.js +178 -0
  491. package/build/system/index.d.ts +16 -0
  492. package/build/system/index.js +100 -0
  493. package/build/system/mcp-servers/claude-code.d.ts +17 -0
  494. package/build/system/mcp-servers/claude-code.js +110 -0
  495. package/build/system/mcp-servers/db-query/index.d.ts +25 -0
  496. package/build/system/mcp-servers/db-query/index.js +49 -0
  497. package/build/system/mcp-servers/db-query/schemas.d.ts +52 -0
  498. package/build/system/mcp-servers/db-query/schemas.js +34 -0
  499. package/build/system/mcp-servers/db-query/tools.d.ts +5 -0
  500. package/build/system/mcp-servers/db-query/tools.js +224 -0
  501. package/build/system/mcp-servers/document-vision.d.ts +15 -0
  502. package/build/system/mcp-servers/document-vision.js +228 -0
  503. package/build/system/mcp-servers/file-storage.d.ts +4 -0
  504. package/build/system/mcp-servers/file-storage.js +101 -0
  505. package/build/system/mcp-servers/http-fetch.d.ts +4 -0
  506. package/build/system/mcp-servers/http-fetch.js +100 -0
  507. package/build/system/mcp-servers/human-queue.d.ts +26 -0
  508. package/build/system/mcp-servers/human-queue.js +287 -0
  509. package/build/system/mcp-servers/oauth.d.ts +11 -0
  510. package/build/system/mcp-servers/oauth.js +100 -0
  511. package/build/system/mcp-servers/playwright/browser-lifecycle.d.ts +26 -0
  512. package/build/system/mcp-servers/playwright/browser-lifecycle.js +125 -0
  513. package/build/system/mcp-servers/playwright/index.d.ts +25 -0
  514. package/build/system/mcp-servers/playwright/index.js +42 -0
  515. package/build/system/mcp-servers/playwright/schemas.d.ts +383 -0
  516. package/build/system/mcp-servers/playwright/schemas.js +87 -0
  517. package/build/system/mcp-servers/playwright/tools-atomic.d.ts +2 -0
  518. package/build/system/mcp-servers/playwright/tools-atomic.js +9 -0
  519. package/build/system/mcp-servers/playwright/tools-navigation.d.ts +2 -0
  520. package/build/system/mcp-servers/playwright/tools-navigation.js +140 -0
  521. package/build/system/mcp-servers/playwright/tools-page-interaction.d.ts +2 -0
  522. package/build/system/mcp-servers/playwright/tools-page-interaction.js +162 -0
  523. package/build/system/mcp-servers/playwright/tools-run-script.d.ts +2 -0
  524. package/build/system/mcp-servers/playwright/tools-run-script.js +190 -0
  525. package/build/system/mcp-servers/playwright/types.d.ts +8 -0
  526. package/build/system/mcp-servers/playwright/types.js +30 -0
  527. package/build/system/mcp-servers/playwright-cli/helpers.d.ts +11 -0
  528. package/build/system/mcp-servers/playwright-cli/helpers.js +20 -0
  529. package/build/system/mcp-servers/playwright-cli/index.d.ts +4 -0
  530. package/build/system/mcp-servers/playwright-cli/index.js +15 -0
  531. package/build/system/mcp-servers/playwright-cli/schemas.d.ts +219 -0
  532. package/build/system/mcp-servers/playwright-cli/schemas.js +75 -0
  533. package/build/system/mcp-servers/playwright-cli/tools-auth.d.ts +2 -0
  534. package/build/system/mcp-servers/playwright-cli/tools-auth.js +183 -0
  535. package/build/system/mcp-servers/playwright-cli/tools-capture.d.ts +2 -0
  536. package/build/system/mcp-servers/playwright-cli/tools-capture.js +267 -0
  537. package/build/system/mcp-servers/prompts.d.ts +4 -0
  538. package/build/system/mcp-servers/prompts.js +10 -0
  539. package/build/system/mcp-servers/workflow-compiler.d.ts +15 -0
  540. package/build/system/mcp-servers/workflow-compiler.js +230 -0
  541. package/build/system/mcp-servers/workflow.d.ts +24 -0
  542. package/build/system/mcp-servers/workflow.js +231 -0
  543. package/build/system/seed/index.d.ts +7 -0
  544. package/build/system/seed/index.js +36 -0
  545. package/build/system/seed/server-definitions.d.ts +1460 -0
  546. package/build/system/seed/server-definitions.js +160 -0
  547. package/build/system/seed/tool-manifests-browser.d.ts +577 -0
  548. package/build/system/seed/tool-manifests-browser.js +158 -0
  549. package/build/system/seed/tool-manifests-data.d.ts +322 -0
  550. package/build/system/seed/tool-manifests-data.js +173 -0
  551. package/build/system/seed/tool-manifests-escalation.d.ts +173 -0
  552. package/build/system/seed/tool-manifests-escalation.js +76 -0
  553. package/build/system/seed/tool-manifests-workflows.d.ts +211 -0
  554. package/build/system/seed/tool-manifests-workflows.js +136 -0
  555. package/build/system/workflows/mcp-deterministic/activities.d.ts +6 -0
  556. package/build/system/workflows/mcp-deterministic/activities.js +56 -0
  557. package/build/system/workflows/mcp-deterministic/index.d.ts +9 -0
  558. package/build/system/workflows/mcp-deterministic/index.js +72 -0
  559. package/build/system/workflows/mcp-query/activities/caches.d.ts +7 -0
  560. package/build/system/workflows/mcp-query/activities/caches.js +10 -0
  561. package/build/system/workflows/mcp-query/activities/discovery.d.ts +31 -0
  562. package/build/system/workflows/mcp-query/activities/discovery.js +172 -0
  563. package/build/system/workflows/mcp-query/activities/index.d.ts +4 -0
  564. package/build/system/workflows/mcp-query/activities/index.js +13 -0
  565. package/build/system/workflows/mcp-query/activities/llm.d.ts +8 -0
  566. package/build/system/workflows/mcp-query/activities/llm.js +33 -0
  567. package/build/system/workflows/mcp-query/activities/tool-executor.d.ts +5 -0
  568. package/build/system/workflows/mcp-query/activities/tool-executor.js +112 -0
  569. package/build/system/workflows/mcp-query/activities/tool-loader.d.ts +14 -0
  570. package/build/system/workflows/mcp-query/activities/tool-loader.js +93 -0
  571. package/build/system/workflows/mcp-query/index.d.ts +14 -0
  572. package/build/system/workflows/mcp-query/index.js +227 -0
  573. package/build/system/workflows/mcp-query/prompts.d.ts +4 -0
  574. package/build/system/workflows/mcp-query/prompts.js +101 -0
  575. package/build/system/workflows/mcp-query/strategy-advisors.d.ts +14 -0
  576. package/build/system/workflows/mcp-query/strategy-advisors.js +109 -0
  577. package/build/system/workflows/mcp-query/types.d.ts +10 -0
  578. package/build/system/workflows/mcp-query/types.js +3 -0
  579. package/build/system/workflows/mcp-query-router/activities.d.ts +6 -0
  580. package/build/system/workflows/mcp-query-router/activities.js +12 -0
  581. package/build/system/workflows/mcp-query-router/index.d.ts +13 -0
  582. package/build/system/workflows/mcp-query-router/index.js +107 -0
  583. package/build/system/workflows/mcp-query-router/prompts.d.ts +1 -0
  584. package/build/system/workflows/mcp-query-router/prompts.js +8 -0
  585. package/build/system/workflows/mcp-triage/index.d.ts +31 -0
  586. package/build/system/workflows/mcp-triage/index.js +222 -0
  587. package/build/system/workflows/mcp-triage/prompts.d.ts +7 -0
  588. package/build/system/workflows/mcp-triage/prompts.js +159 -0
  589. package/build/system/workflows/mcp-triage/response-builders.d.ts +17 -0
  590. package/build/system/workflows/mcp-triage/response-builders.js +96 -0
  591. package/build/system/workflows/mcp-triage/response.d.ts +8 -0
  592. package/build/system/workflows/mcp-triage/response.js +157 -0
  593. package/build/system/workflows/mcp-triage/types.d.ts +20 -0
  594. package/build/system/workflows/mcp-triage/types.js +3 -0
  595. package/build/system/workflows/mcp-triage-deterministic/activities.d.ts +4 -0
  596. package/build/system/workflows/mcp-triage-deterministic/activities.js +8 -0
  597. package/build/system/workflows/mcp-triage-deterministic/index.d.ts +12 -0
  598. package/build/system/workflows/mcp-triage-deterministic/index.js +83 -0
  599. package/build/system/workflows/mcp-triage-router/activities.d.ts +9 -0
  600. package/build/system/workflows/mcp-triage-router/activities.js +15 -0
  601. package/build/system/workflows/mcp-triage-router/index.d.ts +13 -0
  602. package/build/system/workflows/mcp-triage-router/index.js +122 -0
  603. package/build/tsconfig.tsbuildinfo +1 -0
  604. package/build/types/auth.d.ts +34 -0
  605. package/build/types/auth.js +2 -0
  606. package/build/types/config.d.ts +48 -0
  607. package/build/types/config.js +2 -0
  608. package/build/types/delegation.d.ts +41 -0
  609. package/build/types/delegation.js +2 -0
  610. package/build/types/discovery.d.ts +12 -0
  611. package/build/types/discovery.js +3 -0
  612. package/build/types/envelope.d.ts +53 -0
  613. package/build/types/envelope.js +2 -0
  614. package/build/types/escalation-strategy.d.ts +37 -0
  615. package/build/types/escalation-strategy.js +2 -0
  616. package/build/types/escalation.d.ts +39 -0
  617. package/build/types/escalation.js +21 -0
  618. package/build/types/events.d.ts +65 -0
  619. package/build/types/events.js +2 -0
  620. package/build/types/export.d.ts +78 -0
  621. package/build/types/export.js +11 -0
  622. package/build/types/index.d.ts +21 -0
  623. package/build/types/index.js +6 -0
  624. package/build/types/logger.d.ts +26 -0
  625. package/build/types/logger.js +2 -0
  626. package/build/types/maintenance.d.ts +24 -0
  627. package/build/types/maintenance.js +2 -0
  628. package/build/types/mcp.d.ts +80 -0
  629. package/build/types/mcp.js +2 -0
  630. package/build/types/oauth.d.ts +74 -0
  631. package/build/types/oauth.js +2 -0
  632. package/build/types/startup.d.ts +110 -0
  633. package/build/types/startup.js +2 -0
  634. package/build/types/task.d.ts +39 -0
  635. package/build/types/task.js +2 -0
  636. package/build/types/telemetry.d.ts +32 -0
  637. package/build/types/telemetry.js +2 -0
  638. package/build/types/tool-context.d.ts +68 -0
  639. package/build/types/tool-context.js +14 -0
  640. package/build/types/user.d.ts +18 -0
  641. package/build/types/user.js +2 -0
  642. package/build/types/workflow.d.ts +35 -0
  643. package/build/types/workflow.js +2 -0
  644. package/build/types/yaml-workflow.d.ts +101 -0
  645. package/build/types/yaml-workflow.js +5 -0
  646. package/build/vitest.config.d.ts +2 -0
  647. package/build/vitest.config.js +32 -0
  648. package/build/vitest.integration.config.d.ts +2 -0
  649. package/build/vitest.integration.config.js +25 -0
  650. package/build/workers/index.d.ts +6 -0
  651. package/build/workers/index.js +20 -0
  652. package/dashboard/dist/assets/AdminDashboard-jfacvOC7.js +2 -0
  653. package/dashboard/dist/assets/AdminDashboard-jfacvOC7.js.map +1 -0
  654. package/dashboard/dist/assets/AvailableEscalationsPage-BglLDoT8.js +2 -0
  655. package/dashboard/dist/assets/AvailableEscalationsPage-BglLDoT8.js.map +1 -0
  656. package/dashboard/dist/assets/BotPicker-D6FYW1Gt.js +2 -0
  657. package/dashboard/dist/assets/BotPicker-D6FYW1Gt.js.map +1 -0
  658. package/dashboard/dist/assets/CollapsibleSection-Cxk4wvjT.js +2 -0
  659. package/dashboard/dist/assets/CollapsibleSection-Cxk4wvjT.js.map +1 -0
  660. package/dashboard/dist/assets/ConfirmDeleteModal-FSXyKjaB.js +2 -0
  661. package/dashboard/dist/assets/ConfirmDeleteModal-FSXyKjaB.js.map +1 -0
  662. package/dashboard/dist/assets/CopyableId-CBdxWfp8.js +2 -0
  663. package/dashboard/dist/assets/CopyableId-CBdxWfp8.js.map +1 -0
  664. package/dashboard/dist/assets/CredentialsPage-Ikzsot0w.js +2 -0
  665. package/dashboard/dist/assets/CredentialsPage-Ikzsot0w.js.map +1 -0
  666. package/dashboard/dist/assets/CustomDurationPicker-CAninCbl.js +2 -0
  667. package/dashboard/dist/assets/CustomDurationPicker-CAninCbl.js.map +1 -0
  668. package/dashboard/dist/assets/DataTable-BDn1WBHS.js +2 -0
  669. package/dashboard/dist/assets/DataTable-BDn1WBHS.js.map +1 -0
  670. package/dashboard/dist/assets/EmptyState-2CmV-IaS.js +2 -0
  671. package/dashboard/dist/assets/EmptyState-2CmV-IaS.js.map +1 -0
  672. package/dashboard/dist/assets/EscalationsOverview-GXYFPASS.js +2 -0
  673. package/dashboard/dist/assets/EscalationsOverview-GXYFPASS.js.map +1 -0
  674. package/dashboard/dist/assets/EventTable-B01oJf6Y.js +2 -0
  675. package/dashboard/dist/assets/EventTable-B01oJf6Y.js.map +1 -0
  676. package/dashboard/dist/assets/Field-DuFBAYhu.js +2 -0
  677. package/dashboard/dist/assets/Field-DuFBAYhu.js.map +1 -0
  678. package/dashboard/dist/assets/FilterBar-Ck4K4rzu.js +2 -0
  679. package/dashboard/dist/assets/FilterBar-Ck4K4rzu.js.map +1 -0
  680. package/dashboard/dist/assets/McpOverview-JkvRcX2e.js +2 -0
  681. package/dashboard/dist/assets/McpOverview-JkvRcX2e.js.map +1 -0
  682. package/dashboard/dist/assets/McpQueryDetailPage-CUMqhQdS.js +2 -0
  683. package/dashboard/dist/assets/McpQueryDetailPage-CUMqhQdS.js.map +1 -0
  684. package/dashboard/dist/assets/McpQueryPage-DRRhw4nN.js +2 -0
  685. package/dashboard/dist/assets/McpQueryPage-DRRhw4nN.js.map +1 -0
  686. package/dashboard/dist/assets/McpRunDetailPage-CmPs5EvE.js +2 -0
  687. package/dashboard/dist/assets/McpRunDetailPage-CmPs5EvE.js.map +1 -0
  688. package/dashboard/dist/assets/McpRunsPage-Dl5Y2u6k.js +2 -0
  689. package/dashboard/dist/assets/McpRunsPage-Dl5Y2u6k.js.map +1 -0
  690. package/dashboard/dist/assets/Modal-B4rbIVAn.js +2 -0
  691. package/dashboard/dist/assets/Modal-B4rbIVAn.js.map +1 -0
  692. package/dashboard/dist/assets/OperatorDashboard-B56il28q.js +2 -0
  693. package/dashboard/dist/assets/OperatorDashboard-B56il28q.js.map +1 -0
  694. package/dashboard/dist/assets/PageHeader-CpWFly5S.js +2 -0
  695. package/dashboard/dist/assets/PageHeader-CpWFly5S.js.map +1 -0
  696. package/dashboard/dist/assets/PriorityBadge-DfQY9St9.js +2 -0
  697. package/dashboard/dist/assets/PriorityBadge-DfQY9St9.js.map +1 -0
  698. package/dashboard/dist/assets/ProcessDetailPage-CMLq4M7D.js +2 -0
  699. package/dashboard/dist/assets/ProcessDetailPage-CMLq4M7D.js.map +1 -0
  700. package/dashboard/dist/assets/ProcessesListPage-CZ_HF06v.js +2 -0
  701. package/dashboard/dist/assets/ProcessesListPage-CZ_HF06v.js.map +1 -0
  702. package/dashboard/dist/assets/RolePill-BTPa8L-P.js +2 -0
  703. package/dashboard/dist/assets/RolePill-BTPa8L-P.js.map +1 -0
  704. package/dashboard/dist/assets/RolesPage-9grZW7yR.js +2 -0
  705. package/dashboard/dist/assets/RolesPage-9grZW7yR.js.map +1 -0
  706. package/dashboard/dist/assets/RowActions-Dg-Fsm5O.js +2 -0
  707. package/dashboard/dist/assets/RowActions-Dg-Fsm5O.js.map +1 -0
  708. package/dashboard/dist/assets/SimpleMarkdown-CBlvaWP4.js +4 -0
  709. package/dashboard/dist/assets/SimpleMarkdown-CBlvaWP4.js.map +1 -0
  710. package/dashboard/dist/assets/StatCard-DlgF0CJC.js +2 -0
  711. package/dashboard/dist/assets/StatCard-DlgF0CJC.js.map +1 -0
  712. package/dashboard/dist/assets/StatusBadge-TlC4jiig.js +2 -0
  713. package/dashboard/dist/assets/StatusBadge-TlC4jiig.js.map +1 -0
  714. package/dashboard/dist/assets/StickyPagination-F9FZsRy9.js +2 -0
  715. package/dashboard/dist/assets/StickyPagination-F9FZsRy9.js.map +1 -0
  716. package/dashboard/dist/assets/SwimlaneTimeline-7SiwATsZ.js +2 -0
  717. package/dashboard/dist/assets/SwimlaneTimeline-7SiwATsZ.js.map +1 -0
  718. package/dashboard/dist/assets/TaskDetailPage-CbPVTakt.js +2 -0
  719. package/dashboard/dist/assets/TaskDetailPage-CbPVTakt.js.map +1 -0
  720. package/dashboard/dist/assets/TaskQueuePill-awmtb0qw.js +2 -0
  721. package/dashboard/dist/assets/TaskQueuePill-awmtb0qw.js.map +1 -0
  722. package/dashboard/dist/assets/TasksListPage-C_QF23c1.js +2 -0
  723. package/dashboard/dist/assets/TasksListPage-C_QF23c1.js.map +1 -0
  724. package/dashboard/dist/assets/TimeAgo-UPG6DoH8.js +2 -0
  725. package/dashboard/dist/assets/TimeAgo-UPG6DoH8.js.map +1 -0
  726. package/dashboard/dist/assets/TimestampCell-DoWMKg6w.js +2 -0
  727. package/dashboard/dist/assets/TimestampCell-DoWMKg6w.js.map +1 -0
  728. package/dashboard/dist/assets/UserName-DaP4YAKr.js +2 -0
  729. package/dashboard/dist/assets/UserName-DaP4YAKr.js.map +1 -0
  730. package/dashboard/dist/assets/VersionHistory-Bt7WBr6m.js +5 -0
  731. package/dashboard/dist/assets/VersionHistory-Bt7WBr6m.js.map +1 -0
  732. package/dashboard/dist/assets/WorkflowExecutionPage-DjtAQ3hy.js +2 -0
  733. package/dashboard/dist/assets/WorkflowExecutionPage-DjtAQ3hy.js.map +1 -0
  734. package/dashboard/dist/assets/WorkflowPill-CCDSVaQj.js +2 -0
  735. package/dashboard/dist/assets/WorkflowPill-CCDSVaQj.js.map +1 -0
  736. package/dashboard/dist/assets/WorkflowsDashboard-D8z9uBNB.js +2 -0
  737. package/dashboard/dist/assets/WorkflowsDashboard-D8z9uBNB.js.map +1 -0
  738. package/dashboard/dist/assets/WorkflowsOverview-D9OzzQqw.js +2 -0
  739. package/dashboard/dist/assets/WorkflowsOverview-D9OzzQqw.js.map +1 -0
  740. package/dashboard/dist/assets/YamlWorkflowDetailPage-DrDvvP62.js +3 -0
  741. package/dashboard/dist/assets/YamlWorkflowDetailPage-DrDvvP62.js.map +1 -0
  742. package/dashboard/dist/assets/YamlWorkflowsPage-COqiNCQK.js +2 -0
  743. package/dashboard/dist/assets/YamlWorkflowsPage-COqiNCQK.js.map +1 -0
  744. package/dashboard/dist/assets/bots-BkKVMbUW.js +2 -0
  745. package/dashboard/dist/assets/bots-BkKVMbUW.js.map +1 -0
  746. package/dashboard/dist/assets/constants-CgaZfe5d.js +2 -0
  747. package/dashboard/dist/assets/constants-CgaZfe5d.js.map +1 -0
  748. package/dashboard/dist/assets/escalation-columns-D6aqStaY.js +2 -0
  749. package/dashboard/dist/assets/escalation-columns-D6aqStaY.js.map +1 -0
  750. package/dashboard/dist/assets/escalation-qalymbKB.js +2 -0
  751. package/dashboard/dist/assets/escalation-qalymbKB.js.map +1 -0
  752. package/dashboard/dist/assets/format-gXZXQ-HJ.js +2 -0
  753. package/dashboard/dist/assets/format-gXZXQ-HJ.js.map +1 -0
  754. package/dashboard/dist/assets/helpers-0gSleuzT.js +2 -0
  755. package/dashboard/dist/assets/helpers-0gSleuzT.js.map +1 -0
  756. package/dashboard/dist/assets/index-BWvMHed7.js +6 -0
  757. package/dashboard/dist/assets/index-BWvMHed7.js.map +1 -0
  758. package/dashboard/dist/assets/index-BaszoPO_.css +1 -0
  759. package/dashboard/dist/assets/index-Cn2jyj9A.js +2 -0
  760. package/dashboard/dist/assets/index-Cn2jyj9A.js.map +1 -0
  761. package/dashboard/dist/assets/index-D8VH6K8B.js +54 -0
  762. package/dashboard/dist/assets/index-D8VH6K8B.js.map +1 -0
  763. package/dashboard/dist/assets/index-D9SYwJsi.js +3 -0
  764. package/dashboard/dist/assets/index-D9SYwJsi.js.map +1 -0
  765. package/dashboard/dist/assets/index-DTPzZr_X.js +2 -0
  766. package/dashboard/dist/assets/index-DTPzZr_X.js.map +1 -0
  767. package/dashboard/dist/assets/index-D_6AB5BE.js +2 -0
  768. package/dashboard/dist/assets/index-D_6AB5BE.js.map +1 -0
  769. package/dashboard/dist/assets/index-S9Ks2Lj2.js +2 -0
  770. package/dashboard/dist/assets/index-S9Ks2Lj2.js.map +1 -0
  771. package/dashboard/dist/assets/index-X85K5bHC.js +17 -0
  772. package/dashboard/dist/assets/index-X85K5bHC.js.map +1 -0
  773. package/dashboard/dist/assets/index-rjmgHlSH.js +2 -0
  774. package/dashboard/dist/assets/index-rjmgHlSH.js.map +1 -0
  775. package/dashboard/dist/assets/mcp-blCW6IL7.js +2 -0
  776. package/dashboard/dist/assets/mcp-blCW6IL7.js.map +1 -0
  777. package/dashboard/dist/assets/mcp-query-DoAyPbjC.js +2 -0
  778. package/dashboard/dist/assets/mcp-query-DoAyPbjC.js.map +1 -0
  779. package/dashboard/dist/assets/mcp-runs-ChPbpvXK.js +2 -0
  780. package/dashboard/dist/assets/mcp-runs-ChPbpvXK.js.map +1 -0
  781. package/dashboard/dist/assets/namespaces-BgbaC3ow.js +2 -0
  782. package/dashboard/dist/assets/namespaces-BgbaC3ow.js.map +1 -0
  783. package/dashboard/dist/assets/roles-ZNrqqnQl.js +2 -0
  784. package/dashboard/dist/assets/roles-ZNrqqnQl.js.map +1 -0
  785. package/dashboard/dist/assets/settings-eBRSE0mQ.js +2 -0
  786. package/dashboard/dist/assets/settings-eBRSE0mQ.js.map +1 -0
  787. package/dashboard/dist/assets/tasks-tRqClPns.js +2 -0
  788. package/dashboard/dist/assets/tasks-tRqClPns.js.map +1 -0
  789. package/dashboard/dist/assets/useFilterParams-BaXUAkYK.js +2 -0
  790. package/dashboard/dist/assets/useFilterParams-BaXUAkYK.js.map +1 -0
  791. package/dashboard/dist/assets/useNatsEvents-Xr43X1fG.js +2 -0
  792. package/dashboard/dist/assets/useNatsEvents-Xr43X1fG.js.map +1 -0
  793. package/dashboard/dist/assets/useYamlActivityEvents-BO51u8tm.js +2 -0
  794. package/dashboard/dist/assets/useYamlActivityEvents-BO51u8tm.js.map +1 -0
  795. package/dashboard/dist/assets/users-tMvNyOo8.js +2 -0
  796. package/dashboard/dist/assets/users-tMvNyOo8.js.map +1 -0
  797. package/dashboard/dist/assets/vendor-icons-ZTAKVwGc.js +292 -0
  798. package/dashboard/dist/assets/vendor-icons-ZTAKVwGc.js.map +1 -0
  799. package/dashboard/dist/assets/vendor-query-B2UbickB.js +18 -0
  800. package/dashboard/dist/assets/vendor-query-B2UbickB.js.map +1 -0
  801. package/dashboard/dist/assets/vendor-react-Cw8Gy8NJ.js +22 -0
  802. package/dashboard/dist/assets/vendor-react-Cw8Gy8NJ.js.map +1 -0
  803. package/dashboard/dist/assets/workflows-Cc4VHcrp.js +2 -0
  804. package/dashboard/dist/assets/workflows-Cc4VHcrp.js.map +1 -0
  805. package/dashboard/dist/assets/yaml-workflows-BL4V5CQy.js +2 -0
  806. package/dashboard/dist/assets/yaml-workflows-BL4V5CQy.js.map +1 -0
  807. package/dashboard/dist/index.html +20 -0
  808. package/dashboard/dist/logo512.png +0 -0
  809. package/package.json +96 -0
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+ "Commons Clause" License Condition v1.0
2
+
3
+ The Software is provided to you by the Licensor under the License, as
4
+ defined below, subject to the following condition.
5
+
6
+ Without limiting other conditions in the License, the grant of rights
7
+ under the License will not include, and the License does not grant to
8
+ you, the right to Sell the Software.
9
+
10
+ For purposes of the foregoing, "Sell" means practicing any or all of
11
+ the rights granted to you under the License to provide to third parties,
12
+ for a fee or other consideration (including without limitation fees for
13
+ hosting or consulting/support services related to the Software), a
14
+ product or service whose value derives, entirely or substantially, from
15
+ the functionality of the Software. Any license notice or attribution
16
+ required by the License must also include this Commons Clause License
17
+ Condition notice.
18
+
19
+ Software: HotMesh LongTail
20
+
21
+ License: Apache 2.0
22
+
23
+ Licensor: HotMeshIO
24
+
25
+ ---
26
+
27
+ Apache License
28
+ Version 2.0, January 2004
29
+ http://www.apache.org/licenses/
30
+
31
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
32
+
33
+ 1. Definitions.
34
+
35
+ "License" shall mean the terms and conditions for use, reproduction,
36
+ and distribution as defined by Sections 1 through 9 of this document.
37
+
38
+ "Licensor" shall mean the copyright owner or entity authorized by
39
+ the copyright owner that is granting the License.
40
+
41
+ "Legal Entity" shall mean the union of the acting entity and all
42
+ other entities that control, are controlled by, or are under common
43
+ control with that entity. For the purposes of this definition,
44
+ "control" means (i) the power, direct or indirect, to cause the
45
+ direction or management of such entity, whether by contract or
46
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
47
+ outstanding shares, or (iii) beneficial ownership of such entity.
48
+
49
+ "You" (or "Your") shall mean an individual or Legal Entity
50
+ exercising permissions granted by this License.
51
+
52
+ "Source" form shall mean the preferred form for making modifications,
53
+ including but not limited to software source code, documentation
54
+ source, and configuration files.
55
+
56
+ "Object" form shall mean any form resulting from mechanical
57
+ transformation or translation of a Source form, including but
58
+ not limited to compiled object code, generated documentation,
59
+ and conversions to other media types.
60
+
61
+ "Work" shall mean the work of authorship, whether in Source or
62
+ Object form, made available under the License, as indicated by a
63
+ copyright notice that is included in or attached to the work
64
+ (an example is provided in the Appendix below).
65
+
66
+ "Derivative Works" shall mean any work, whether in Source or Object
67
+ form, that is based on (or derived from) the Work and for which the
68
+ editorial revisions, annotations, elaborations, or other modifications
69
+ represent, as a whole, an original work of authorship. For the purposes
70
+ of this License, Derivative Works shall not include works that remain
71
+ separable from, or merely link (or bind by name) to the interfaces of,
72
+ the Work and Derivative Works thereof.
73
+
74
+ "Contribution" shall mean any work of authorship, including
75
+ the original version of the Work and any modifications or additions
76
+ to that Work or Derivative Works thereof, that is intentionally
77
+ submitted to Licensor for inclusion in the Work by the copyright owner
78
+ or by an individual or Legal Entity authorized to submit on behalf of
79
+ the copyright owner. For the purposes of this definition, "submitted"
80
+ means any form of electronic, verbal, or written communication sent
81
+ to the Licensor or its representatives, including but not limited to
82
+ communication on electronic mailing lists, source code control systems,
83
+ and issue tracking systems that are managed by, or on behalf of, the
84
+ Licensor for the purpose of discussing and improving the Work, but
85
+ excluding communication that is conspicuously marked or otherwise
86
+ designated in writing by the copyright owner as "Not a Contribution."
87
+
88
+ "Contributor" shall mean Licensor and any individual or Legal Entity
89
+ on behalf of whom a Contribution has been received by Licensor and
90
+ subsequently incorporated within the Work.
91
+
92
+ 2. Grant of Copyright License. Subject to the terms and conditions of
93
+ this License, each Contributor hereby grants to You a perpetual,
94
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
95
+ copyright license to reproduce, prepare Derivative Works of,
96
+ publicly display, publicly perform, sublicense, and distribute the
97
+ Work and such Derivative Works in Source or Object form.
98
+
99
+ 3. Grant of Patent License. Subject to the terms and conditions of
100
+ this License, each Contributor hereby grants to You a perpetual,
101
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
102
+ (except as stated in this section) patent license to make, have made,
103
+ use, offer to sell, sell, import, and otherwise transfer the Work,
104
+ where such license applies only to those patent claims licensable
105
+ by such Contributor that are necessarily infringed by their
106
+ Contribution(s) alone or by combination of their Contribution(s)
107
+ with the Work to which such Contribution(s) was submitted. If You
108
+ institute patent litigation against any entity (including a
109
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
110
+ or a Contribution incorporated within the Work constitutes direct
111
+ or contributory patent infringement, then any patent licenses
112
+ granted to You under this License for that Work shall terminate
113
+ as of the date such litigation is filed.
114
+
115
+ 4. Redistribution. You may reproduce and distribute copies of the
116
+ Work or Derivative Works thereof in any medium, with or without
117
+ modifications, and in Source or Object form, provided that You
118
+ meet the following conditions:
119
+
120
+ (a) You must give any other recipients of the Work or
121
+ Derivative Works a copy of this License; and
122
+
123
+ (b) You must cause any modified files to carry prominent notices
124
+ stating that You changed the files; and
125
+
126
+ (c) You must retain, in the Source form of any Derivative Works
127
+ that You distribute, all copyright, patent, trademark, and
128
+ attribution notices from the Source form of the Work,
129
+ excluding those notices that do not pertain to any part of
130
+ the Derivative Works; and
131
+
132
+ (d) If the Work includes a "NOTICE" text file as part of its
133
+ distribution, then any Derivative Works that You distribute must
134
+ include a readable copy of the attribution notices contained
135
+ within such NOTICE file, excluding those notices that do not
136
+ pertain to any part of the Derivative Works, in at least one
137
+ of the following places: within a NOTICE text file distributed
138
+ as part of the Derivative Works; within the Source form or
139
+ documentation, if provided along with the Derivative Works; or,
140
+ within a display generated by the Derivative Works, if and
141
+ wherever such third-party notices normally appear. The contents
142
+ of the NOTICE file are for informational purposes only and
143
+ do not modify the License. You may add Your own attribution
144
+ notices within Derivative Works that You distribute, alongside
145
+ or as an addendum to the NOTICE text from the Work, provided
146
+ that such additional attribution notices cannot be construed
147
+ as modifying the License.
148
+
149
+ You may add Your own copyright statement to Your modifications and
150
+ may provide additional or different license terms and conditions
151
+ for use, reproduction, or distribution of Your modifications, or
152
+ for any such Derivative Works as a whole, provided Your use,
153
+ reproduction, and distribution of the Work otherwise complies with
154
+ the conditions stated in this License.
155
+
156
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
157
+ any Contribution intentionally submitted for inclusion in the Work
158
+ by You to the Licensor shall be under the terms and conditions of
159
+ this License, without any additional terms or conditions.
160
+ Notwithstanding the above, nothing herein shall supersede or modify
161
+ the terms of any separate license agreement you may have executed
162
+ with Licensor regarding such Contributions.
163
+
164
+ 6. Trademarks. This License does not grant permission to use the trade
165
+ names, trademarks, service marks, or product names of the Licensor,
166
+ except as required for reasonable and customary use in describing the
167
+ origin of the Work and reproducing the content of the NOTICE file.
168
+
169
+ 7. Disclaimer of Warranty. Unless required by applicable law or
170
+ agreed to in writing, Licensor provides the Work (and each
171
+ Contributor provides its Contributions) on an "AS IS" BASIS,
172
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
173
+ implied, including, without limitation, any warranties or conditions
174
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
175
+ PARTICULAR PURPOSE. You are solely responsible for determining the
176
+ appropriateness of using or redistributing the Work and assume any
177
+ risks associated with Your exercise of permissions under this License.
178
+
179
+ 8. Limitation of Liability. In no event and under no legal theory,
180
+ whether in tort (including negligence), contract, or otherwise,
181
+ unless required by applicable law (such as deliberate and grossly
182
+ negligent acts) or agreed to in writing, shall any Contributor be
183
+ liable to You for damages, including any direct, indirect, special,
184
+ incidental, or consequential damages of any character arising as a
185
+ result of this License or out of the use or inability to use the
186
+ Work (including but not limited to damages for loss of goodwill,
187
+ work stoppage, computer failure or malfunction, or any and all
188
+ other commercial damages or losses), even if such Contributor
189
+ has been advised of the possibility of such damages.
190
+
191
+ 9. Accepting Warranty or Additional Liability. While redistributing
192
+ the Work or Derivative Works thereof, You may choose to offer,
193
+ and charge a fee for, acceptance of support, warranty, indemnity,
194
+ or other liability obligations and/or rights consistent with this
195
+ License. However, in accepting such obligations, You may act only
196
+ on Your own behalf and on Your sole responsibility, not on behalf
197
+ of any other Contributor, and only if You agree to indemnify,
198
+ defend, and hold each Contributor harmless for any liability
199
+ incurred by, or claims asserted against, such Contributor by reason
200
+ of your accepting any such warranty or additional liability.
201
+
202
+ END OF TERMS AND CONDITIONS
package/README.md ADDED
@@ -0,0 +1,262 @@
1
+ # Long Tail
2
+
3
+ Long Tail treats uncertainty as part of the workflow — not as an error, but as an undiscovered pathway. When confidence is low, the task escalates. When a human can't fix it, AI triages with the tools at hand. When AI finds the fix, the solution is compiled into a deterministic workflow so the next occurrence runs automatically — no LLM, no human, no cost.
4
+
5
+ The system works because everything is treated as a **tool**.
6
+
7
+ Activities, AI models, human reviewers, and compiled workflows all expose the same interface. A workflow doesn't need to know whether its next step is code, a model, or a person waiting on a screen. The protocol is the same. This is what makes handoffs seamless and what lets the system compose solutions from parts it already has.
8
+
9
+ ## Quick Start
10
+
11
+ ```bash
12
+ git clone https://github.com/hotmeshio/long-tail.git
13
+ cd long-tail
14
+ docker compose up -d --build
15
+ ```
16
+
17
+ Open [http://localhost:3000](http://localhost:3000) once healthy (~10s). Four workflows seed the dashboard.
18
+
19
+ | User | Password | Role |
20
+ |------|----------|------|
21
+ | `superadmin` | `l0ngt@1l` | superadmin |
22
+ | `admin` | `l0ngt@1l` | admin |
23
+ | `engineer` | `l0ngt@1l` | engineer |
24
+ | `reviewer` | `l0ngt@1l` | reviewer |
25
+
26
+ To reset: `docker compose down -v && docker compose up -d --build`
27
+
28
+ ## Write a Workflow
29
+
30
+ A **workflow** is a deterministic function. It receives an envelope, makes decisions, and returns a result. If the process crashes mid-execution, the workflow replays from its last checkpoint — no work is lost, no step runs twice.
31
+
32
+ Register it with Long Tail and it becomes a **certified workflow**. The interceptor wraps every execution in an escalation chain: sub-workflows that would normally throw instead escalate, humans and AI collaborate to resolve, and the original workflow resumes with the answer. A certified workflow cannot silently fail — every error is either handled or surfaced.
33
+
34
+ ```typescript
35
+ import { Durable } from '@hotmeshio/hotmesh';
36
+ import type { LTEnvelope, LTReturn, LTEscalation } from '@hotmeshio/long-tail';
37
+ import * as activities from './activities';
38
+
39
+ const { analyzeContent } = Durable.workflow.proxyActivities<typeof activities>({
40
+ activities,
41
+ });
42
+
43
+ export async function reviewContent(
44
+ envelope: LTEnvelope,
45
+ ): Promise<LTReturn | LTEscalation> {
46
+
47
+ // A resolved escalation re-enters here with the human's decision
48
+ if (envelope.resolver) {
49
+ return {
50
+ type: 'return',
51
+ data: {
52
+ ...envelope.data,
53
+ resolution: envelope.resolver,
54
+ },
55
+ };
56
+ }
57
+
58
+ const analysis = await analyzeContent(envelope.data.content);
59
+
60
+ if (analysis.confidence >= 0.85) {
61
+ return {
62
+ type: 'return',
63
+ data: { approved: true, analysis },
64
+ };
65
+ }
66
+
67
+ // Low confidence — escalate to a human reviewer
68
+ return {
69
+ type: 'escalation',
70
+ data: {
71
+ content: envelope.data.content,
72
+ analysis,
73
+ },
74
+ message: `Review needed (confidence: ${analysis.confidence})`,
75
+ role: 'reviewer',
76
+ };
77
+ }
78
+ ```
79
+
80
+ Side effects — API calls, LLM invocations, database queries — live in **activity** functions. The `proxyActivities` call wraps them so the workflow engine can checkpoint each result. If a crash occurs, activities replay from cache rather than re-executing.
81
+
82
+ ## Every Activity is a Tool
83
+
84
+ The `proxyActivities` call in the workflow above does more than checkpoint `analyzeContent` — it also registers it as an **MCP tool**. The function you write is both a durable workflow step and a tool that any agent, workflow, or compiled pipeline can invoke.
85
+
86
+ The same is true in reverse: register an MCP server and its tools become proxy activities automatically.
87
+
88
+ ```typescript
89
+ // This function is BOTH an activity AND a tool.
90
+ // Called by a workflow via proxyActivities, it's checkpointed.
91
+ // Exposed via MCP, it's discoverable by agents and other workflows.
92
+ export async function classify(args: { content: string }) {
93
+ const response = await llm.analyze(args.content);
94
+ return { category: response.category, confidence: response.confidence };
95
+ }
96
+ ```
97
+
98
+ Humans are tools too. Long Tail exposes its escalation queue as an MCP server (`long-tail-human-queue`). Compiled workflows are tools. An agent can call a human the same way it calls a database. A human can kick a task to AI the same way they'd assign it to a colleague. The protocol doesn't care who's on either end.
99
+
100
+ This uniformity is what makes the system composable — and it's what closes the loop from uncertainty to automation.
101
+
102
+ See the [Architecture Guide](docs/architecture.md) for project structure, conventions, built-in servers, and tag-based tool discovery. See the [MCP Guide](docs/mcp.md) for server registration, tool calls, and the human queue protocol.
103
+
104
+ ## Workflow Function Registration and Startup
105
+
106
+ Register and start. MCP Servers initialize, workers start, and the API listens. The only infrastructure is PostgreSQL.
107
+
108
+ ```typescript
109
+ import { start } from '@hotmeshio/long-tail';
110
+ import * as myWorkflow from './workflows/my-workflow';
111
+
112
+ const lt = await start({
113
+ database: {
114
+ host: 'localhost',
115
+ port: 5432,
116
+ user: 'postgres',
117
+ password: 'password',
118
+ database: 'mydb',
119
+ },
120
+ workers: [{
121
+ taskQueue: 'my-queue',
122
+ workflow: myWorkflow.reviewContent,
123
+ }],
124
+ });
125
+
126
+ const handle = await lt.client.workflow.start({
127
+ args: [{
128
+ data: { content: 'Review this' },
129
+ metadata: {},
130
+ }],
131
+ taskQueue: 'my-queue',
132
+ workflowName: 'reviewContent',
133
+ workflowId: `review-${Date.now()}`,
134
+ });
135
+ ```
136
+
137
+ See the full [Workflows Guide](docs/workflows.md) for activities, the interceptor, escalation lifecycle, composition, and testing.
138
+
139
+ ## How the System Evolves
140
+
141
+ The escalation in the workflow above — `{ type: 'escalation' }` — is where the system starts learning. Four layers work together, each one feeding the next.
142
+
143
+ ### 1. Escalation
144
+
145
+ When AI isn't confident, the workflow returns `{ type: 'escalation' }`. The interceptor creates a record with full context — what the AI tried, what it saw, why it wasn't sure. A human claims the work through the dashboard or API, resolves it, and the workflow re-runs with their decision.
146
+
147
+ ```
148
+ POST /api/escalations/esc-abc123/resolve
149
+ { "resolverPayload": { "approved": true, "notes": "Content is fine" } }
150
+ ```
151
+
152
+ Most escalations end here. The human had the judgment the AI lacked. But sometimes the human *can't* fix it — the problem isn't a judgment call, it's a process gap.
153
+
154
+ ### 2. Triage
155
+
156
+ An upside-down page, a document in the wrong language, a missing API credential — the human flags `needsTriage` with a hint, and an AI triage agent takes over.
157
+
158
+ Because every activity is a tool, the triage agent already has what it needs. It queries the escalation history, discovers available tools by tag, and runs an agentic loop — rotate the page, re-extract data, call an external API, validate against a database. Every tool call is checkpointed. If the agent can't fix it either, it escalates to an engineer with a full diagnosis. The engineer might install a missing tool, fix a configuration, then send it back. The handoff is always bidirectional — human to AI, AI to human, human to different human — until the problem is resolved and the original workflow gets its answer.
159
+
160
+ ### 3. Compilation — Dynamic to Deterministic
161
+
162
+ Every dynamic execution — whether from triage, an MCP query, or any agentic workflow — produces a recording of which tools were called, in what order, with what data flow between them. The workflow compiler analyzes that recording and converts it into a deterministic YAML pipeline:
163
+
164
+ ```
165
+ Dynamic execution (LLM-driven) Compiled workflow (deterministic)
166
+ navigate_to(url) step 1: navigate_to
167
+ extract_links(page) → step 2: extract_links
168
+ screenshot(link) × N step 3: screenshot (iterates over step 2 output)
169
+ ```
170
+
171
+ The compiler detects iteration patterns, traces data provenance between steps, classifies which inputs are dynamic (user-provided) versus fixed (implementation details), and generates a parameterized input schema. A dashboard wizard walks through the full lifecycle: review the original execution, profile the tool pipeline, configure inputs and tags, deploy, test side-by-side against the original, and verify end-to-end.
172
+
173
+ The compiled workflow deploys as a new MCP tool — tagged for discovery, versioned, and invocable by any agent, workflow, or API call. See the [Compilation Pipeline Guide](docs/compilation.md) for a detailed walkthrough with screenshots.
174
+
175
+ ### 4. Routing — The Loop Closes
176
+
177
+ Once deployed, the system routes automatically. Every request passes through the `mcpQueryRouter`, which checks: has this problem been solved before?
178
+
179
+ ```
180
+ User prompt → Router → Discovery (FTS + tags) → LLM Judge (scope match?)
181
+ │ │
182
+ │ confidence ≥ 0.7 │ no match
183
+ ▼ ▼
184
+ mcpDeterministic mcpQuery
185
+ (compiled YAML, no LLM) (dynamic, LLM agentic loop)
186
+ ```
187
+
188
+ The deterministic path skips LLM reasoning entirely — it extracts structured inputs from the prompt, maps them to the compiled workflow's schema, and executes the YAML pipeline directly. What took minutes with an LLM now runs in seconds. What cost tokens now costs nothing.
189
+
190
+ The dynamic path still works exactly as before — and every dynamic execution is a candidate for compilation. The system accumulates deterministic solutions over time. The inventory of tools grows. The need for LLM reasoning shrinks. Problems that once required a human, then required an AI, eventually require neither.
191
+
192
+ ## Developer API
193
+
194
+ ```typescript
195
+ import { start } from '@hotmeshio/long-tail';
196
+
197
+ const lt = await start({
198
+ database: { connectionString: process.env.DATABASE_URL },
199
+ workers: [{ taskQueue: 'my-queue', workflow: myWorkflow.reviewContent }],
200
+
201
+ // Everything below is optional
202
+ examples: true, // seed demo workflows
203
+ mcp: { server: { enabled: true } }, // MCP server + clients
204
+ escalation: { strategy: 'mcp' }, // AI triage on escalation
205
+ auth: { secret: process.env.JWT_SECRET }, // JWT auth + IAM identity context
206
+ telemetry: { honeycomb: { apiKey: process.env.HNY } }, // OpenTelemetry
207
+ events: { nats: { url: 'nats://localhost:4222' } }, // real-time events
208
+ logging: { pino: { level: 'info' } }, // structured logging
209
+ maintenance: true, // scheduled cleanup
210
+ });
211
+ ```
212
+
213
+ Every cross-cutting concern follows the same pattern: implement a typed interface, register at startup, done. Every workflow executes with identity context — who initiated the request, which user or bot it runs as, and what credentials it holds. Escalations carry the same context, so reviewers see exactly who triggered the work and what permissions were in play. See the [Docs](#docs) section for the full list of guides.
214
+
215
+ ## Deployment
216
+
217
+ Two container types from the same codebase — one serves the API, the other executes workflows:
218
+
219
+ ```typescript
220
+ // api.ts — REST endpoints, no workflow execution
221
+ await start({ database: { connectionString: process.env.DATABASE_URL } });
222
+
223
+ // worker.ts — workflow execution, no HTTP server
224
+ await start({
225
+ database: { connectionString: process.env.DATABASE_URL },
226
+ server: { enabled: false },
227
+ workers: [{ taskQueue: 'my-queue', workflow: reviewContent.reviewContent }],
228
+ });
229
+ ```
230
+
231
+ Both share PostgreSQL and scale independently. See [Cloud Deployment](docs/cloud.md).
232
+
233
+ ## Docs
234
+
235
+ | Guide | What it covers |
236
+ |-------|---------------|
237
+ | [Compilation Pipeline](docs/compilation.md) | Dynamic → deterministic: full wizard walkthrough with screenshots |
238
+ | [Workflows](docs/workflows.md) | Activities, interceptor, escalation lifecycle, composition, testing |
239
+ | [Architecture](docs/architecture.md) | Project structure, conventions, built-in MCP servers, tag-based discovery |
240
+ | [MCP](docs/mcp.md) | Server registration, tool calls, human queue, compiled workflows as tools |
241
+ | [Escalation Strategies](docs/escalation-strategies.md) | Default, MCP triage, and custom escalation handlers |
242
+ | [Cloud Deployment](docs/cloud.md) | AWS ECS, GCP Cloud Run, Docker configurations |
243
+ | [Data Model](docs/data.md) | Database schema and tables |
244
+ | [Contributing](docs/contributing.md) | Development setup and guidelines |
245
+
246
+ ### Adapter Guides
247
+
248
+ [Auth](docs/auth.md) | [Events](docs/events.md) | [Telemetry](docs/telemetry.md) | [Logging](docs/logging.md) | [Maintenance](docs/maintenance.md)
249
+
250
+ ### API Reference
251
+
252
+ [Workflows](docs/api/workflows.md) | [Tasks](docs/api/tasks.md) | [Escalations](docs/api/escalations.md) | [YAML Workflows](docs/api/yaml-workflows.md) | [Users](docs/api/users.md) | [Roles](docs/api/roles.md) | [MCP Servers](docs/api/mcp-servers.md) | [MCP Runs](docs/api/mcp-runs.md) | [Namespaces](docs/api/namespaces.md) | [Settings](docs/api/settings.md) | [Maintenance](docs/api/maintenance.md) | [DBA](docs/api/dba.md) | [Exports](docs/api/exports.md)
253
+
254
+ ## Install
255
+
256
+ ```bash
257
+ npm install @hotmeshio/long-tail @hotmeshio/hotmesh
258
+ ```
259
+
260
+ ## License
261
+
262
+ See [LICENSE](LICENSE).
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Example External MCP Server
3
+ *
4
+ * Demonstrates how an external MCP server authenticates to Long Tail,
5
+ * receives delegation tokens via tool args, and fetches user-scoped
6
+ * OAuth credentials through the delegation API.
7
+ *
8
+ * This server exposes an SSE-based MCP interface with one tool:
9
+ * fetch_external_data — simulates fetching data from an external API
10
+ * using the user's OAuth credentials.
11
+ *
12
+ * Environment:
13
+ * LT_API_URL — Long Tail API base URL (e.g., http://long-tail:3000)
14
+ * LT_SERVICE_TOKEN — Service token for authenticating back to Long Tail
15
+ * PORT — Port to listen on (default: 9090)
16
+ */
17
+ export {};
@@ -0,0 +1,116 @@
1
+ "use strict";
2
+ /**
3
+ * Example External MCP Server
4
+ *
5
+ * Demonstrates how an external MCP server authenticates to Long Tail,
6
+ * receives delegation tokens via tool args, and fetches user-scoped
7
+ * OAuth credentials through the delegation API.
8
+ *
9
+ * This server exposes an SSE-based MCP interface with one tool:
10
+ * fetch_external_data — simulates fetching data from an external API
11
+ * using the user's OAuth credentials.
12
+ *
13
+ * Environment:
14
+ * LT_API_URL — Long Tail API base URL (e.g., http://long-tail:3000)
15
+ * LT_SERVICE_TOKEN — Service token for authenticating back to Long Tail
16
+ * PORT — Port to listen on (default: 9090)
17
+ */
18
+ var __importDefault = (this && this.__importDefault) || function (mod) {
19
+ return (mod && mod.__esModule) ? mod : { "default": mod };
20
+ };
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ const express_1 = __importDefault(require("express"));
23
+ const app = (0, express_1.default)();
24
+ app.use(express_1.default.json());
25
+ const PORT = parseInt(process.env.PORT || '9090', 10);
26
+ const LT_API_URL = process.env.LT_API_URL || 'http://localhost:3000';
27
+ const LT_SERVICE_TOKEN = process.env.LT_SERVICE_TOKEN || '';
28
+ /**
29
+ * Validate a delegation token against Long Tail.
30
+ */
31
+ async function validateDelegation(token) {
32
+ const res = await fetch(`${LT_API_URL}/api/delegation/validate`, {
33
+ method: 'POST',
34
+ headers: {
35
+ 'Content-Type': 'application/json',
36
+ Authorization: `Bearer ${LT_SERVICE_TOKEN}`,
37
+ },
38
+ body: JSON.stringify({ token }),
39
+ });
40
+ return res.json();
41
+ }
42
+ /**
43
+ * Get a user's OAuth access token via the delegation API.
44
+ */
45
+ async function getUserOAuthToken(delegationToken, provider) {
46
+ const res = await fetch(`${LT_API_URL}/api/delegation/oauth/${provider}/token`, {
47
+ headers: { Authorization: `Bearer ${delegationToken}` },
48
+ });
49
+ if (!res.ok) {
50
+ const err = await res.json();
51
+ throw new Error(err.error || `Failed to get OAuth token: ${res.status}`);
52
+ }
53
+ return res.json();
54
+ }
55
+ // ── MCP Tool: fetch_external_data ────────────────────────────────────────────
56
+ /**
57
+ * Simulates an external MCP tool that needs user-scoped credentials.
58
+ *
59
+ * In a real server, this would:
60
+ * 1. Extract the delegation token from _auth.token
61
+ * 2. Call the delegation API to get a fresh OAuth access token
62
+ * 3. Use that token to call an external API (Google Calendar, GitHub, etc.)
63
+ * 4. Return the results
64
+ */
65
+ app.post('/tools/fetch_external_data', async (req, res) => {
66
+ const { provider, query, _auth } = req.body;
67
+ if (!_auth?.token) {
68
+ res.status(400).json({
69
+ error: 'No delegation token provided. This tool requires user authorization.',
70
+ });
71
+ return;
72
+ }
73
+ try {
74
+ // 1. Validate the delegation token
75
+ const validation = await validateDelegation(_auth.token);
76
+ if (!validation.valid) {
77
+ res.status(403).json({ error: `Invalid delegation: ${validation.error}` });
78
+ return;
79
+ }
80
+ // 2. Get the user's OAuth token for the requested provider
81
+ const oauth = await getUserOAuthToken(_auth.token, provider || 'google');
82
+ // 3. Simulate calling an external API with the OAuth token
83
+ // In production, this would be a real API call like:
84
+ // const data = await fetch('https://api.example.com/data', {
85
+ // headers: { Authorization: `Bearer ${oauth.access_token}` }
86
+ // });
87
+ res.json({
88
+ success: true,
89
+ userId: validation.userId,
90
+ provider: provider || 'google',
91
+ query,
92
+ result: {
93
+ message: `Successfully fetched data for user ${validation.userId} using ${provider || 'google'} OAuth token`,
94
+ token_preview: `${oauth.access_token.slice(0, 10)}...`,
95
+ expires_at: oauth.expires_at,
96
+ },
97
+ });
98
+ }
99
+ catch (err) {
100
+ res.status(500).json({ error: err.message });
101
+ }
102
+ });
103
+ // ── Health check ─────────────────────────────────────────────────────────────
104
+ app.get('/health', (_req, res) => {
105
+ res.json({
106
+ status: 'ok',
107
+ service: 'external-mcp-server',
108
+ lt_api: LT_API_URL,
109
+ has_service_token: !!LT_SERVICE_TOKEN,
110
+ });
111
+ });
112
+ app.listen(PORT, () => {
113
+ console.log(`[external-mcp] listening on :${PORT}`);
114
+ console.log(`[external-mcp] Long Tail API: ${LT_API_URL}`);
115
+ console.log(`[external-mcp] Service token: ${LT_SERVICE_TOKEN ? 'configured' : 'NOT SET'}`);
116
+ });
@@ -0,0 +1,2 @@
1
+ export { exampleWorkers } from './workers';
2
+ export { seedExamples } from './seed';
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.seedExamples = exports.exampleWorkers = void 0;
4
+ var workers_1 = require("./workers");
5
+ Object.defineProperty(exports, "exampleWorkers", { enumerable: true, get: function () { return workers_1.exampleWorkers; } });
6
+ var seed_1 = require("./seed");
7
+ Object.defineProperty(exports, "seedExamples", { enumerable: true, get: function () { return seed_1.seedExamples; } });
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Seed example workflows so the dashboard tells a story immediately.
3
+ * Called automatically when `examples: true` is set in the start config.
4
+ */
5
+ export declare function seedExamples(client: any): Promise<void>;