@hotmeshio/long-tail 0.1.21 → 0.2.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 (269) hide show
  1. package/build/api/agent-subscriptions.d.ts +15 -0
  2. package/build/api/agent-subscriptions.js +82 -0
  3. package/build/api/agents.d.ts +21 -0
  4. package/build/api/agents.js +100 -0
  5. package/build/api/capabilities.d.ts +2 -0
  6. package/build/api/capabilities.js +76 -0
  7. package/build/index.d.ts +2 -2
  8. package/build/index.js +5 -2
  9. package/build/lib/db/schemas/003_agents.sql +46 -0
  10. package/build/lib/db/schemas/004_agent_subscriptions.sql +38 -0
  11. package/build/lib/db/schemas/005_server_category.sql +6 -0
  12. package/build/lib/db/schemas/006_agent_sub_unique.sql +9 -0
  13. package/build/lib/events/callback.d.ts +4 -18
  14. package/build/lib/events/callback.js +8 -45
  15. package/build/lib/events/matching.d.ts +13 -0
  16. package/build/lib/events/matching.js +31 -0
  17. package/build/lib/events/publish.d.ts +20 -0
  18. package/build/lib/events/publish.js +33 -0
  19. package/build/routes/agents.d.ts +2 -0
  20. package/build/routes/agents.js +130 -0
  21. package/build/routes/capabilities.d.ts +2 -0
  22. package/build/routes/capabilities.js +47 -0
  23. package/build/routes/index.js +4 -0
  24. package/build/sdk/index.d.ts +13 -0
  25. package/build/sdk/index.js +14 -0
  26. package/build/services/agent/index.d.ts +32 -0
  27. package/build/services/agent/index.js +195 -0
  28. package/build/services/agent/input-mapper.d.ts +18 -0
  29. package/build/services/agent/input-mapper.js +51 -0
  30. package/build/services/agent/sql.d.ts +10 -0
  31. package/build/services/agent/sql.js +70 -0
  32. package/build/services/agent/subscription-sql.d.ts +7 -0
  33. package/build/services/agent/subscription-sql.js +49 -0
  34. package/build/services/agent/subscriptions.d.ts +30 -0
  35. package/build/services/agent/subscriptions.js +82 -0
  36. package/build/services/agent/trigger-registry.d.ts +45 -0
  37. package/build/services/agent/trigger-registry.js +232 -0
  38. package/build/services/cron/index.d.ts +17 -1
  39. package/build/services/cron/index.js +152 -4
  40. package/build/services/insight/index.js +11 -6
  41. package/build/services/mcp/db.d.ts +1 -0
  42. package/build/services/mcp/db.js +1 -0
  43. package/build/services/mcp/sql.d.ts +1 -1
  44. package/build/services/mcp/sql.js +2 -2
  45. package/build/start/workers.js +67 -0
  46. package/build/system/activities/knowledge.js +9 -2
  47. package/build/system/index.d.ts +2 -1
  48. package/build/system/index.js +93 -1
  49. package/build/system/mcp-servers/events.d.ts +5 -0
  50. package/build/system/mcp-servers/events.js +104 -0
  51. package/build/system/mcp-servers/playwright/schemas.d.ts +6 -6
  52. package/build/system/seed/tool-manifests-events.d.ts +37 -0
  53. package/build/system/seed/tool-manifests-events.js +30 -0
  54. package/build/tsconfig.tsbuildinfo +1 -1
  55. package/build/types/agent.d.ts +72 -0
  56. package/build/types/agent.js +6 -0
  57. package/build/types/events.d.ts +7 -1
  58. package/build/types/index.d.ts +2 -1
  59. package/build/types/mcp.d.ts +2 -0
  60. package/build/types/startup.d.ts +37 -0
  61. package/dashboard/dist/assets/{AdminDashboard-CsTOErp1.js → AdminDashboard-DThDjhN5.js} +2 -2
  62. package/dashboard/dist/assets/{AdminDashboard-CsTOErp1.js.map → AdminDashboard-DThDjhN5.js.map} +1 -1
  63. package/dashboard/dist/assets/AgentConfigPage-NgxblxBW.js +13 -0
  64. package/dashboard/dist/assets/AgentConfigPage-NgxblxBW.js.map +1 -0
  65. package/dashboard/dist/assets/AgentDetailPage-DMS46nYY.js +4 -0
  66. package/dashboard/dist/assets/AgentDetailPage-DMS46nYY.js.map +1 -0
  67. package/dashboard/dist/assets/AgentsPage-pKfjHe4u.js +2 -0
  68. package/dashboard/dist/assets/AgentsPage-pKfjHe4u.js.map +1 -0
  69. package/dashboard/dist/assets/{AvailableEscalationsPage-BqQA3IJp.js → AvailableEscalationsPage-BFzHVnPh.js} +2 -2
  70. package/dashboard/dist/assets/{AvailableEscalationsPage-BqQA3IJp.js.map → AvailableEscalationsPage-BFzHVnPh.js.map} +1 -1
  71. package/dashboard/dist/assets/BotPicker-Zxf7Npew.js +2 -0
  72. package/dashboard/dist/assets/BotPicker-Zxf7Npew.js.map +1 -0
  73. package/dashboard/dist/assets/CapabilitiesPage-6zOJ12cB.js +2 -0
  74. package/dashboard/dist/assets/CapabilitiesPage-6zOJ12cB.js.map +1 -0
  75. package/dashboard/dist/assets/{CollapsibleSection-CRtHQsAv.js → CollapsibleSection-DvBx4tmw.js} +2 -2
  76. package/dashboard/dist/assets/{CollapsibleSection-CRtHQsAv.js.map → CollapsibleSection-DvBx4tmw.js.map} +1 -1
  77. package/dashboard/dist/assets/{CredentialsPage-C7XT1bnO.js → CredentialsPage-C5f-Bg-o.js} +2 -2
  78. package/dashboard/dist/assets/{CredentialsPage-C7XT1bnO.js.map → CredentialsPage-C5f-Bg-o.js.map} +1 -1
  79. package/dashboard/dist/assets/CronLabel-CAVTt5AG.js +2 -0
  80. package/dashboard/dist/assets/CronLabel-CAVTt5AG.js.map +1 -0
  81. package/dashboard/dist/assets/{CustomDurationPicker-BABUv1V2.js → CustomDurationPicker-Bk7D38y7.js} +2 -2
  82. package/dashboard/dist/assets/{CustomDurationPicker-BABUv1V2.js.map → CustomDurationPicker-Bk7D38y7.js.map} +1 -1
  83. package/dashboard/dist/assets/{DataTable-D3-wSEf0.js → DataTable-D9yuBv0w.js} +2 -2
  84. package/dashboard/dist/assets/{DataTable-D3-wSEf0.js.map → DataTable-D9yuBv0w.js.map} +1 -1
  85. package/dashboard/dist/assets/{DropZone-DHKmMqRA.js → DropZone-2mGyDo1P.js} +2 -2
  86. package/dashboard/dist/assets/{DropZone-DHKmMqRA.js.map → DropZone-2mGyDo1P.js.map} +1 -1
  87. package/dashboard/dist/assets/{ElapsedCell-DrJif03B.js → ElapsedCell-BpJjG1s-.js} +2 -2
  88. package/dashboard/dist/assets/{ElapsedCell-DrJif03B.js.map → ElapsedCell-BpJjG1s-.js.map} +1 -1
  89. package/dashboard/dist/assets/{EscalationsOverview-H6CwfeR-.js → EscalationsOverview-DPNd1vjF.js} +2 -2
  90. package/dashboard/dist/assets/{EscalationsOverview-H6CwfeR-.js.map → EscalationsOverview-DPNd1vjF.js.map} +1 -1
  91. package/dashboard/dist/assets/{EventTable-Dh3_9DAY.js → EventTable-BoP8KC3M.js} +2 -2
  92. package/dashboard/dist/assets/{EventTable-Dh3_9DAY.js.map → EventTable-BoP8KC3M.js.map} +1 -1
  93. package/dashboard/dist/assets/EventTopicPill-BUxxvpNg.js +2 -0
  94. package/dashboard/dist/assets/EventTopicPill-BUxxvpNg.js.map +1 -0
  95. package/dashboard/dist/assets/HomePage-h8I5ZolJ.js +2 -0
  96. package/dashboard/dist/assets/HomePage-h8I5ZolJ.js.map +1 -0
  97. package/dashboard/dist/assets/ListToolbar-BaYIIsAt.js +2 -0
  98. package/dashboard/dist/assets/ListToolbar-BaYIIsAt.js.map +1 -0
  99. package/dashboard/dist/assets/{McpOverview-ChLa6Gl7.js → McpOverview-BhZ3lSO6.js} +2 -2
  100. package/dashboard/dist/assets/{McpOverview-ChLa6Gl7.js.map → McpOverview-BhZ3lSO6.js.map} +1 -1
  101. package/dashboard/dist/assets/McpQueryDetailPage-DVgcKa61.js +5 -0
  102. package/dashboard/dist/assets/McpQueryDetailPage-DVgcKa61.js.map +1 -0
  103. package/dashboard/dist/assets/{McpQueryPage-D2DmDFPu.js → McpQueryPage-CTWOBqKT.js} +2 -2
  104. package/dashboard/dist/assets/{McpQueryPage-D2DmDFPu.js.map → McpQueryPage-CTWOBqKT.js.map} +1 -1
  105. package/dashboard/dist/assets/{McpRunDetailPage-ERVuNEEK.js → McpRunDetailPage-CIpZJWRB.js} +2 -2
  106. package/dashboard/dist/assets/{McpRunDetailPage-ERVuNEEK.js.map → McpRunDetailPage-CIpZJWRB.js.map} +1 -1
  107. package/dashboard/dist/assets/McpRunsPage-B3zpzPBf.js +2 -0
  108. package/dashboard/dist/assets/McpRunsPage-B3zpzPBf.js.map +1 -0
  109. package/dashboard/dist/assets/{OperatorDashboard-CJm_BTPU.js → OperatorDashboard-l2hVlIF3.js} +2 -2
  110. package/dashboard/dist/assets/{OperatorDashboard-CJm_BTPU.js.map → OperatorDashboard-l2hVlIF3.js.map} +1 -1
  111. package/dashboard/dist/assets/{PageHeader-B-SN5GZ2.js → PageHeader-DLjHNYHX.js} +2 -2
  112. package/dashboard/dist/assets/{PageHeader-B-SN5GZ2.js.map → PageHeader-DLjHNYHX.js.map} +1 -1
  113. package/dashboard/dist/assets/{PageHeaderWithStats-BZ3AGT5s.js → PageHeaderWithStats-Oljg3n4j.js} +2 -2
  114. package/dashboard/dist/assets/{PageHeaderWithStats-BZ3AGT5s.js.map → PageHeaderWithStats-Oljg3n4j.js.map} +1 -1
  115. package/dashboard/dist/assets/{ProcessDetailPage-vfnCDyQK.js → ProcessDetailPage-BJ1rhK9_.js} +2 -2
  116. package/dashboard/dist/assets/{ProcessDetailPage-vfnCDyQK.js.map → ProcessDetailPage-BJ1rhK9_.js.map} +1 -1
  117. package/dashboard/dist/assets/{ProcessesListPage-DcAN6AJK.js → ProcessesListPage-IQKk_qkn.js} +2 -2
  118. package/dashboard/dist/assets/{ProcessesListPage-DcAN6AJK.js.map → ProcessesListPage-IQKk_qkn.js.map} +1 -1
  119. package/dashboard/dist/assets/RolePill-Bp10-WfX.js +2 -0
  120. package/dashboard/dist/assets/RolePill-Bp10-WfX.js.map +1 -0
  121. package/dashboard/dist/assets/{RolesPage-DYSt2aAr.js → RolesPage-Dwcirtze.js} +2 -2
  122. package/dashboard/dist/assets/{RolesPage-DYSt2aAr.js.map → RolesPage-Dwcirtze.js.map} +1 -1
  123. package/dashboard/dist/assets/RunAsSelector-D4Fu8LVG.js +2 -0
  124. package/dashboard/dist/assets/RunAsSelector-D4Fu8LVG.js.map +1 -0
  125. package/dashboard/dist/assets/ServerName-C9lUCFYb.js +2 -0
  126. package/dashboard/dist/assets/ServerName-C9lUCFYb.js.map +1 -0
  127. package/dashboard/dist/assets/SwimlaneTimeline-DQqgvwmC.js +2 -0
  128. package/dashboard/dist/assets/SwimlaneTimeline-DQqgvwmC.js.map +1 -0
  129. package/dashboard/dist/assets/{TagInput-DftaRHDV.js → TagInput-Dkljw_WI.js} +2 -2
  130. package/dashboard/dist/assets/{TagInput-DftaRHDV.js.map → TagInput-Dkljw_WI.js.map} +1 -1
  131. package/dashboard/dist/assets/{TaskDetailPage-BoA-cfwW.js → TaskDetailPage-AHBMSHAA.js} +2 -2
  132. package/dashboard/dist/assets/{TaskDetailPage-BoA-cfwW.js.map → TaskDetailPage-AHBMSHAA.js.map} +1 -1
  133. package/dashboard/dist/assets/{TaskQueuePill-Ce8KlXtR.js → TaskQueuePill-DPwm25Cc.js} +2 -2
  134. package/dashboard/dist/assets/{TaskQueuePill-Ce8KlXtR.js.map → TaskQueuePill-DPwm25Cc.js.map} +1 -1
  135. package/dashboard/dist/assets/{TasksListPage-g6XIbhju.js → TasksListPage-CnJdTsoX.js} +2 -2
  136. package/dashboard/dist/assets/{TasksListPage-g6XIbhju.js.map → TasksListPage-CnJdTsoX.js.map} +1 -1
  137. package/dashboard/dist/assets/{TimeAgo-BihIwEbB.js → TimeAgo-C3A1r1Cv.js} +2 -2
  138. package/dashboard/dist/assets/{TimeAgo-BihIwEbB.js.map → TimeAgo-C3A1r1Cv.js.map} +1 -1
  139. package/dashboard/dist/assets/{TimestampCell-GOFcvE-i.js → TimestampCell-DPfLR6bZ.js} +2 -2
  140. package/dashboard/dist/assets/{TimestampCell-GOFcvE-i.js.map → TimestampCell-DPfLR6bZ.js.map} +1 -1
  141. package/dashboard/dist/assets/ToolPill-D_DIWFJ5.js +2 -0
  142. package/dashboard/dist/assets/ToolPill-D_DIWFJ5.js.map +1 -0
  143. package/dashboard/dist/assets/ToolTestPanel-CwZ9zkD-.js +2 -0
  144. package/dashboard/dist/assets/ToolTestPanel-CwZ9zkD-.js.map +1 -0
  145. package/dashboard/dist/assets/{UserName-CmMVt4vS.js → UserName-ClO0a6Ar.js} +2 -2
  146. package/dashboard/dist/assets/{UserName-CmMVt4vS.js.map → UserName-ClO0a6Ar.js.map} +1 -1
  147. package/dashboard/dist/assets/{WorkflowExecutionPage-soRFz_30.js → WorkflowExecutionPage-B-2aHAHK.js} +2 -2
  148. package/dashboard/dist/assets/{WorkflowExecutionPage-soRFz_30.js.map → WorkflowExecutionPage-B-2aHAHK.js.map} +1 -1
  149. package/dashboard/dist/assets/{WorkflowPill-DUDDyBsj.js → WorkflowPill-BbgVTGgI.js} +2 -2
  150. package/dashboard/dist/assets/WorkflowPill-BbgVTGgI.js.map +1 -0
  151. package/dashboard/dist/assets/WorkflowsDashboard-NtiQKl_i.js +2 -0
  152. package/dashboard/dist/assets/WorkflowsDashboard-NtiQKl_i.js.map +1 -0
  153. package/dashboard/dist/assets/{WorkflowsOverview-z3Ztiz1y.js → WorkflowsOverview-BQip_pvL.js} +2 -2
  154. package/dashboard/dist/assets/{WorkflowsOverview-z3Ztiz1y.js.map → WorkflowsOverview-BQip_pvL.js.map} +1 -1
  155. package/dashboard/dist/assets/YamlWorkflowsPage-BWFCVQ8b.js +2 -0
  156. package/dashboard/dist/assets/YamlWorkflowsPage-BWFCVQ8b.js.map +1 -0
  157. package/dashboard/dist/assets/agents-5APoyRH8.js +2 -0
  158. package/dashboard/dist/assets/agents-5APoyRH8.js.map +1 -0
  159. package/dashboard/dist/assets/{bots-BZPXDh_y.js → bots-BoDH-pS7.js} +2 -2
  160. package/dashboard/dist/assets/{bots-BZPXDh_y.js.map → bots-BoDH-pS7.js.map} +1 -1
  161. package/dashboard/dist/assets/controlplane-D4NhQux3.js +2 -0
  162. package/dashboard/dist/assets/controlplane-D4NhQux3.js.map +1 -0
  163. package/dashboard/dist/assets/{escalation-DBUIq1Z4.js → escalation-BD2wtAt2.js} +2 -2
  164. package/dashboard/dist/assets/{escalation-DBUIq1Z4.js.map → escalation-BD2wtAt2.js.map} +1 -1
  165. package/dashboard/dist/assets/escalation-columns-DjHcNgjo.js +2 -0
  166. package/dashboard/dist/assets/{escalation-columns-DL4zsR8Y.js.map → escalation-columns-DjHcNgjo.js.map} +1 -1
  167. package/dashboard/dist/assets/{helpers-D50KFFkI.js → helpers-D1ZPA4kI.js} +2 -2
  168. package/dashboard/dist/assets/{helpers-D50KFFkI.js.map → helpers-D1ZPA4kI.js.map} +1 -1
  169. package/dashboard/dist/assets/index-B-Z9TisY.js +2 -0
  170. package/dashboard/dist/assets/index-B-Z9TisY.js.map +1 -0
  171. package/dashboard/dist/assets/index-B6vQeWwf.js +6 -0
  172. package/dashboard/dist/assets/index-B6vQeWwf.js.map +1 -0
  173. package/dashboard/dist/assets/{index-D9_hZmsW.js → index-BD2vW8MG.js} +3 -3
  174. package/dashboard/dist/assets/{index-D9_hZmsW.js.map → index-BD2vW8MG.js.map} +1 -1
  175. package/dashboard/dist/assets/index-BciXgS35.css +1 -0
  176. package/dashboard/dist/assets/index-BgJR7kwH.js +2 -0
  177. package/dashboard/dist/assets/index-BgJR7kwH.js.map +1 -0
  178. package/dashboard/dist/assets/index-D9qswqDQ.js +2 -0
  179. package/dashboard/dist/assets/{index-BpoHVMV7.js.map → index-D9qswqDQ.js.map} +1 -1
  180. package/dashboard/dist/assets/index-DC7f6rWu.js +2 -0
  181. package/dashboard/dist/assets/{index-CEnDYJOO.js.map → index-DC7f6rWu.js.map} +1 -1
  182. package/dashboard/dist/assets/{index-B-jzKfuv.js → index-Zn5XforP.js} +2 -2
  183. package/dashboard/dist/assets/{index-B-jzKfuv.js.map → index-Zn5XforP.js.map} +1 -1
  184. package/dashboard/dist/assets/index-_5qNyf9o.js +2 -0
  185. package/dashboard/dist/assets/index-_5qNyf9o.js.map +1 -0
  186. package/dashboard/dist/assets/index-_dKxJhey.js +2 -0
  187. package/dashboard/dist/assets/{index-DzICLMI7.js.map → index-_dKxJhey.js.map} +1 -1
  188. package/dashboard/dist/assets/index-jp94-YlF.js +2 -0
  189. package/dashboard/dist/assets/index-jp94-YlF.js.map +1 -0
  190. package/dashboard/dist/assets/{index-BUjxYyxc.js → index-oGYUhkFa.js} +27 -27
  191. package/dashboard/dist/assets/index-oGYUhkFa.js.map +1 -0
  192. package/dashboard/dist/assets/index-qdYsS9h2.js +15 -0
  193. package/dashboard/dist/assets/index-qdYsS9h2.js.map +1 -0
  194. package/dashboard/dist/assets/knowledge-DsAU_TGL.js +2 -0
  195. package/dashboard/dist/assets/knowledge-DsAU_TGL.js.map +1 -0
  196. package/dashboard/dist/assets/{mcp-D0GrHRFe.js → mcp-CA3OeIyH.js} +2 -2
  197. package/dashboard/dist/assets/{mcp-D0GrHRFe.js.map → mcp-CA3OeIyH.js.map} +1 -1
  198. package/dashboard/dist/assets/{mcp-query-DC5woQn5.js → mcp-query-BgmTDc7h.js} +2 -2
  199. package/dashboard/dist/assets/{mcp-query-DC5woQn5.js.map → mcp-query-BgmTDc7h.js.map} +1 -1
  200. package/dashboard/dist/assets/{mcp-runs-CsoVQoPB.js → mcp-runs-C-FK2SyD.js} +2 -2
  201. package/dashboard/dist/assets/{mcp-runs-CsoVQoPB.js.map → mcp-runs-C-FK2SyD.js.map} +1 -1
  202. package/dashboard/dist/assets/{namespaces-unpIb4gX.js → namespaces-B8KNk0Jb.js} +2 -2
  203. package/dashboard/dist/assets/{namespaces-unpIb4gX.js.map → namespaces-B8KNk0Jb.js.map} +1 -1
  204. package/dashboard/dist/assets/{roles--kBaFljg.js → roles-BAPy1LU_.js} +2 -2
  205. package/dashboard/dist/assets/{roles--kBaFljg.js.map → roles-BAPy1LU_.js.map} +1 -1
  206. package/dashboard/dist/assets/{settings-B96YkawY.js → settings-Da0QSQDH.js} +2 -2
  207. package/dashboard/dist/assets/{settings-B96YkawY.js.map → settings-Da0QSQDH.js.map} +1 -1
  208. package/dashboard/dist/assets/{tasks-D_1NCfOZ.js → tasks-BHlTusW0.js} +2 -2
  209. package/dashboard/dist/assets/{tasks-D_1NCfOZ.js.map → tasks-BHlTusW0.js.map} +1 -1
  210. package/dashboard/dist/assets/useEventHooks-DBMdj9vw.js +2 -0
  211. package/dashboard/dist/assets/useEventHooks-DBMdj9vw.js.map +1 -0
  212. package/dashboard/dist/assets/{useYamlActivityEvents-D3RQjfzo.js → useYamlActivityEvents-BH_ynR_L.js} +2 -2
  213. package/dashboard/dist/assets/{useYamlActivityEvents-D3RQjfzo.js.map → useYamlActivityEvents-BH_ynR_L.js.map} +1 -1
  214. package/dashboard/dist/assets/{users-e2oatvoj.js → users-C9K2cMyb.js} +2 -2
  215. package/dashboard/dist/assets/{users-e2oatvoj.js.map → users-C9K2cMyb.js.map} +1 -1
  216. package/dashboard/dist/assets/{vendor-icons-BkK55L-1.js → vendor-icons-E6836lXZ.js} +140 -95
  217. package/dashboard/dist/assets/vendor-icons-E6836lXZ.js.map +1 -0
  218. package/dashboard/dist/assets/workflows-B2rsLjoh.js +2 -0
  219. package/dashboard/dist/assets/workflows-B2rsLjoh.js.map +1 -0
  220. package/dashboard/dist/assets/{yaml-workflows-CAKU7LUu.js → yaml-workflows-BLiTvQM2.js} +2 -2
  221. package/dashboard/dist/assets/{yaml-workflows-CAKU7LUu.js.map → yaml-workflows-BLiTvQM2.js.map} +1 -1
  222. package/dashboard/dist/index.html +3 -3
  223. package/docs/agents.md +160 -0
  224. package/docs/api/http/agents.md +201 -0
  225. package/docs/api/sdk/agents.md +138 -0
  226. package/docs/story.md +101 -78
  227. package/package.json +3 -3
  228. package/dashboard/dist/assets/BotPicker-C2xR1xay.js +0 -2
  229. package/dashboard/dist/assets/BotPicker-C2xR1xay.js.map +0 -1
  230. package/dashboard/dist/assets/ListToolbar-CyEkulVR.js +0 -2
  231. package/dashboard/dist/assets/ListToolbar-CyEkulVR.js.map +0 -1
  232. package/dashboard/dist/assets/McpQueryDetailPage-5Dsj6PlL.js +0 -5
  233. package/dashboard/dist/assets/McpQueryDetailPage-5Dsj6PlL.js.map +0 -1
  234. package/dashboard/dist/assets/McpRunsPage-BKba-3Wl.js +0 -2
  235. package/dashboard/dist/assets/McpRunsPage-BKba-3Wl.js.map +0 -1
  236. package/dashboard/dist/assets/RolePill-BhVC0cc3.js +0 -2
  237. package/dashboard/dist/assets/RolePill-BhVC0cc3.js.map +0 -1
  238. package/dashboard/dist/assets/RunAsSelector-CD7_Dmb0.js +0 -2
  239. package/dashboard/dist/assets/RunAsSelector-CD7_Dmb0.js.map +0 -1
  240. package/dashboard/dist/assets/SwimlaneTimeline-CUl5RdXU.js +0 -2
  241. package/dashboard/dist/assets/SwimlaneTimeline-CUl5RdXU.js.map +0 -1
  242. package/dashboard/dist/assets/WorkflowPill-DUDDyBsj.js.map +0 -1
  243. package/dashboard/dist/assets/WorkflowsDashboard-Be1A1zAT.js +0 -2
  244. package/dashboard/dist/assets/WorkflowsDashboard-Be1A1zAT.js.map +0 -1
  245. package/dashboard/dist/assets/YamlWorkflowsPage-C6qzcQcJ.js +0 -2
  246. package/dashboard/dist/assets/YamlWorkflowsPage-C6qzcQcJ.js.map +0 -1
  247. package/dashboard/dist/assets/escalation-columns-DL4zsR8Y.js +0 -2
  248. package/dashboard/dist/assets/index-B-ioA6yv.js +0 -2
  249. package/dashboard/dist/assets/index-B-ioA6yv.js.map +0 -1
  250. package/dashboard/dist/assets/index-BMpoMc4A.js +0 -2
  251. package/dashboard/dist/assets/index-BMpoMc4A.js.map +0 -1
  252. package/dashboard/dist/assets/index-BU04qgJt.js +0 -15
  253. package/dashboard/dist/assets/index-BU04qgJt.js.map +0 -1
  254. package/dashboard/dist/assets/index-BUjxYyxc.js.map +0 -1
  255. package/dashboard/dist/assets/index-BpoHVMV7.js +0 -2
  256. package/dashboard/dist/assets/index-CEnDYJOO.js +0 -2
  257. package/dashboard/dist/assets/index-CbuH92vk.js +0 -6
  258. package/dashboard/dist/assets/index-CbuH92vk.js.map +0 -1
  259. package/dashboard/dist/assets/index-DrouIN-M.js +0 -2
  260. package/dashboard/dist/assets/index-DrouIN-M.js.map +0 -1
  261. package/dashboard/dist/assets/index-DzICLMI7.js +0 -2
  262. package/dashboard/dist/assets/index-efS5gKpv.css +0 -1
  263. package/dashboard/dist/assets/index-qT78AZDq.js +0 -2
  264. package/dashboard/dist/assets/index-qT78AZDq.js.map +0 -1
  265. package/dashboard/dist/assets/useEventHooks-BPjEkCpD.js +0 -2
  266. package/dashboard/dist/assets/useEventHooks-BPjEkCpD.js.map +0 -1
  267. package/dashboard/dist/assets/vendor-icons-BkK55L-1.js.map +0 -1
  268. package/dashboard/dist/assets/workflows-D6diL54s.js +0 -2
  269. package/dashboard/dist/assets/workflows-D6diL54s.js.map +0 -1
@@ -0,0 +1,201 @@
1
+ # Agents API
2
+
3
+ CRUD operations for agents — autonomous personas that react to events and run workflows on schedules. Each agent has an identity, motivation (goals/rules), event subscriptions, cron schedules, and a knowledge domain.
4
+
5
+ All endpoints require authentication.
6
+
7
+ ## List agents
8
+
9
+ ```
10
+ GET /api/agents?status=active&knowledge_domain=system-health&limit=25&offset=0
11
+ ```
12
+
13
+ Returns agents with subscription counts and topic lists (via JOIN).
14
+
15
+ | Parameter | Type | Required | Description |
16
+ |-----------|------|----------|-------------|
17
+ | `status` | `string` | No | Filter by status: `active`, `inactive`, `paused`, `error` |
18
+ | `knowledge_domain` | `string` | No | Filter by knowledge domain |
19
+ | `limit` | `number` | No | Max results (default: 50) |
20
+ | `offset` | `number` | No | Pagination offset |
21
+
22
+ **Response 200:**
23
+
24
+ ```json
25
+ {
26
+ "agents": [
27
+ {
28
+ "id": "uuid",
29
+ "name": "health-monitor",
30
+ "description": "Watches for workflow failures",
31
+ "status": "active",
32
+ "knowledge_domain": "system-health",
33
+ "behaviors": { "schedules": [{ "cron": "*/5 * * * *", "workflow_type": "basicEcho" }] },
34
+ "subscription_count": 4,
35
+ "sub_topics": ["workflow.failed", "activity.failed", "app.*.*.error", "task.failed"],
36
+ "last_run_at": "2026-05-15T04:24:58.351Z",
37
+ ...
38
+ }
39
+ ],
40
+ "total": 3
41
+ }
42
+ ```
43
+
44
+ ## Get agent
45
+
46
+ ```
47
+ GET /api/agents/:id
48
+ ```
49
+
50
+ Returns an agent with aggregated stats (knowledge entry count, escalation count).
51
+
52
+ **Response 200:**
53
+
54
+ ```json
55
+ {
56
+ "id": "uuid",
57
+ "name": "health-monitor",
58
+ "stats": { "knowledge_count": 3, "escalation_count": 0 },
59
+ ...
60
+ }
61
+ ```
62
+
63
+ ## Create agent
64
+
65
+ ```
66
+ POST /api/agents
67
+ ```
68
+
69
+ **Body:**
70
+
71
+ ```json
72
+ {
73
+ "name": "health-monitor",
74
+ "description": "Watches for workflow failures and schema drift",
75
+ "goals": "Detect failures early, capture diagnostics",
76
+ "rules": "Never auto-restart failed workflows",
77
+ "status": "active",
78
+ "knowledge_domain": "system-health",
79
+ "behaviors": {
80
+ "schedules": [
81
+ { "cron": "*/5 * * * *", "workflow_type": "basicEcho", "envelope": {} }
82
+ ]
83
+ }
84
+ }
85
+ ```
86
+
87
+ | Field | Type | Required | Description |
88
+ |-------|------|----------|-------------|
89
+ | `name` | `string` | Yes | Unique kebab-case identifier |
90
+ | `description` | `string` | No | One-sentence summary |
91
+ | `goals` | `string` | No | Agent's primary motivation |
92
+ | `rules` | `string` | No | Guardrails and constraints |
93
+ | `status` | `string` | No | `active`, `inactive`, `paused`, `error` (default: `inactive`) |
94
+ | `user_id` | `string` | No | Service account UUID |
95
+ | `knowledge_domain` | `string` | No | Knowledge domain to own |
96
+ | `behaviors` | `object` | No | `{ schedules?: AgentSchedule[] }` |
97
+
98
+ **Response 201:** The created agent.
99
+
100
+ ## Update agent
101
+
102
+ ```
103
+ PUT /api/agents/:id
104
+ ```
105
+
106
+ Partial update — only include fields to change. Changing `status` or `behaviors` automatically restarts event subscriptions and cron schedules.
107
+
108
+ **Response 200:** The updated agent.
109
+
110
+ ## Delete agent
111
+
112
+ ```
113
+ DELETE /api/agents/:id
114
+ ```
115
+
116
+ Permanently removes the agent. Event subscriptions are cascade-deleted. Cron schedules are stopped. Knowledge entries and workflow history are preserved.
117
+
118
+ **Response 200:** `{ "deleted": true }`
119
+
120
+ ---
121
+
122
+ ## Agent Subscriptions
123
+
124
+ Subscriptions wire events to workflows. When an event matches the topic pattern, the agent invokes the configured workflow.
125
+
126
+ ### List subscriptions
127
+
128
+ ```
129
+ GET /api/agents/:agentId/subscriptions
130
+ ```
131
+
132
+ **Response 200:**
133
+
134
+ ```json
135
+ {
136
+ "subscriptions": [
137
+ {
138
+ "id": "uuid",
139
+ "agent_id": "uuid",
140
+ "topic": "workflow.failed",
141
+ "filter": { "status": 422 },
142
+ "reaction_type": "durable",
143
+ "workflow_type": "basicEcho",
144
+ "input_mapping": { "data": { "error": "{event.data.error}" } },
145
+ "execute_as": null,
146
+ "enabled": true
147
+ }
148
+ ]
149
+ }
150
+ ```
151
+
152
+ ### Create subscription
153
+
154
+ ```
155
+ POST /api/agents/:agentId/subscriptions
156
+ ```
157
+
158
+ **Body:**
159
+
160
+ ```json
161
+ {
162
+ "topic": "workflow.failed",
163
+ "reaction_type": "durable",
164
+ "workflow_type": "basicEcho",
165
+ "input_mapping": { "data": { "error": "{event.status}" } },
166
+ "filter": { "status": 422 },
167
+ "enabled": true
168
+ }
169
+ ```
170
+
171
+ | Field | Type | Required | Description |
172
+ |-------|------|----------|-------------|
173
+ | `topic` | `string` | Yes | Event topic pattern. Supports `*` (one token) and `>` (rest of subject). |
174
+ | `reaction_type` | `string` | Yes | `durable`, `pipeline`, or `mcp_query` |
175
+ | `workflow_type` | `string` | For durable | Registered workflow name |
176
+ | `pipeline_id` | `string` | For pipeline | YAML workflow UUID |
177
+ | `mcp_prompt` | `string` | For mcp_query | Dynamic query prompt |
178
+ | `input_mapping` | `object` | No | Maps event fields to workflow envelope. Templates: `{event.data.field}` |
179
+ | `filter` | `object` | No | Shallow key-value match against `event.data` |
180
+ | `execute_as` | `string` | No | Identity override for this subscription |
181
+ | `enabled` | `boolean` | No | Default: `true` |
182
+
183
+ **Response 201:** The created subscription.
184
+
185
+ ### Update subscription
186
+
187
+ ```
188
+ PUT /api/agents/:agentId/subscriptions/:subId
189
+ ```
190
+
191
+ Partial update.
192
+
193
+ **Response 200:** The updated subscription.
194
+
195
+ ### Delete subscription
196
+
197
+ ```
198
+ DELETE /api/agents/:agentId/subscriptions/:subId
199
+ ```
200
+
201
+ **Response 200:** `{ "deleted": true }`
@@ -0,0 +1,138 @@
1
+ # lt.agents
2
+
3
+ Agent operations — create, configure, and manage autonomous event-driven agents.
4
+
5
+ ## list
6
+
7
+ List agents with optional filters.
8
+
9
+ ```typescript
10
+ const result = await lt.agents.list({ status: 'active', limit: 25 });
11
+ ```
12
+
13
+ | Parameter | Type | Required | Description |
14
+ |-----------|------|----------|-------------|
15
+ | `status` | `string` | No | Filter: `active`, `inactive`, `paused`, `error` |
16
+ | `knowledge_domain` | `string` | No | Filter by knowledge domain |
17
+ | `limit` | `number` | No | Max results (default: 50) |
18
+ | `offset` | `number` | No | Pagination offset |
19
+
20
+ **Returns:** `LTApiResult<{ agents: LTAgent[], total: number }>`
21
+
22
+ Each agent includes `subscription_count` and `sub_topics[]` from a JOIN on `lt_agent_subscriptions`.
23
+
24
+ ## get
25
+
26
+ Get a single agent with stats.
27
+
28
+ ```typescript
29
+ const result = await lt.agents.get({ id: 'uuid' });
30
+ ```
31
+
32
+ **Returns:** `LTApiResult<LTAgent & { stats: LTAgentStats }>`
33
+
34
+ ## create
35
+
36
+ Create an agent.
37
+
38
+ ```typescript
39
+ const result = await lt.agents.create({
40
+ name: 'health-monitor',
41
+ description: 'Watches for workflow failures',
42
+ goals: 'Detect failures early',
43
+ rules: 'Never auto-restart',
44
+ status: 'active',
45
+ knowledge_domain: 'system-health',
46
+ behaviors: {
47
+ schedules: [
48
+ { cron: '*/5 * * * *', workflow_type: 'basicEcho' },
49
+ ],
50
+ },
51
+ });
52
+ ```
53
+
54
+ **Returns:** `LTApiResult<LTAgent>`
55
+
56
+ ## update
57
+
58
+ Partial update. Changing `status` or `behaviors` automatically restarts event subscriptions and cron schedules.
59
+
60
+ ```typescript
61
+ await lt.agents.update({ id: 'uuid', status: 'paused' });
62
+ ```
63
+
64
+ **Returns:** `LTApiResult<LTAgent>`
65
+
66
+ ## delete
67
+
68
+ Delete an agent. Stops subscriptions and schedules. Knowledge and workflow history preserved.
69
+
70
+ ```typescript
71
+ await lt.agents.delete({ id: 'uuid' });
72
+ ```
73
+
74
+ **Returns:** `LTApiResult<{ deleted: true }>`
75
+
76
+ ## listSubscriptions
77
+
78
+ List event subscriptions for an agent.
79
+
80
+ ```typescript
81
+ const result = await lt.agents.listSubscriptions({ agentId: 'uuid' });
82
+ ```
83
+
84
+ **Returns:** `LTApiResult<{ subscriptions: AgentSubscription[] }>`
85
+
86
+ ## createSubscription
87
+
88
+ Create an event subscription.
89
+
90
+ ```typescript
91
+ const result = await lt.agents.createSubscription({
92
+ agentId: 'uuid',
93
+ topic: 'workflow.failed',
94
+ reaction_type: 'durable',
95
+ workflow_type: 'basicEcho',
96
+ input_mapping: {
97
+ data: { error: '{event.status}', workflowId: '{event.workflowId}' },
98
+ },
99
+ });
100
+ ```
101
+
102
+ | Parameter | Type | Required | Description |
103
+ |-----------|------|----------|-------------|
104
+ | `agentId` | `string` | Yes | Agent ID |
105
+ | `topic` | `string` | Yes | Event topic pattern (`*` = one token, `>` = rest) |
106
+ | `reaction_type` | `string` | Yes | `durable`, `pipeline`, or `mcp_query` |
107
+ | `workflow_type` | `string` | For durable | Workflow name |
108
+ | `pipeline_id` | `string` | For pipeline | YAML workflow UUID |
109
+ | `mcp_prompt` | `string` | For mcp_query | Query prompt |
110
+ | `input_mapping` | `object` | No | Event-to-envelope field mapping |
111
+ | `filter` | `object` | No | Shallow match against `event.data` |
112
+ | `execute_as` | `string` | No | Identity override |
113
+
114
+ **Returns:** `LTApiResult<AgentSubscription>`
115
+
116
+ ## updateSubscription
117
+
118
+ Partial update of a subscription.
119
+
120
+ ```typescript
121
+ await lt.agents.updateSubscription({
122
+ agentId: 'uuid',
123
+ subId: 'uuid',
124
+ topic: 'app.vendor.*.error',
125
+ });
126
+ ```
127
+
128
+ **Returns:** `LTApiResult<AgentSubscription>`
129
+
130
+ ## deleteSubscription
131
+
132
+ Delete a subscription.
133
+
134
+ ```typescript
135
+ await lt.agents.deleteSubscription({ agentId: 'uuid', subId: 'uuid' });
136
+ ```
137
+
138
+ **Returns:** `LTApiResult<{ deleted: true }>`
package/docs/story.md CHANGED
@@ -1,157 +1,180 @@
1
- # The Long Tail Story
1
+ # Long Tail — The Story
2
2
 
3
- ## Infrastructure That Learns
3
+ ## What It Feels Like
4
4
 
5
- Most software you deploy stays exactly as capable as the day you shipped it. It doesn't get smarter. It doesn't absorb what your team knows. It runs the same logic on day one thousand that it ran on day one.
5
+ You open the dashboard. There's a quiet hum of activity processes running, knowledge accumulating, agents doing their work. You didn't write most of this. You described what you needed. The system figured out how.
6
6
 
7
- Long Tail is different. Every problem solved through it becomes a permanent capability. The first time, an LLM reasons through it. A human reviews the result. The system compiles the solution into a deterministic tool. The next occurrence runs without AI, without human intervention, without cost. The tool inventory grows. The need for reasoning shrinks. The system gets cheaper and more capable simultaneously.
7
+ A notification appears: your retirement account agent found a deadline. It read your Gmail, extracted the action item, organized the context in your knowledge store, and created a task for you with a link, a summary, and a phone number to call. You review, make the call, mark it done. The agent learns that this type of deadline requires a phone call and adjusts.
8
8
 
9
- This document walks through what happens when an organization adopts Long Tail, told from the perspective of what accumulates over time.
9
+ Nobody wrote that workflow. Nobody will maintain it. It emerged from a conversation you had on a Tuesday afternoon, and it's been running every hour since.
10
10
 
11
11
  ---
12
12
 
13
- ## The Starting Point
13
+ ## Three People, One Platform
14
14
 
15
- You have Postgres and a problem. Maybe it's content review, document processing, customer onboarding, incident response any operational workflow where human judgment is currently the bottleneck.
15
+ ### MayaProduct Manager
16
16
 
17
- You install the package, point it at your database, and start it up. The system creates its schema, registers the built-in MCP servers, and opens the dashboard. Two container types from one codebase: API servers serve the dashboard and REST endpoints; workers execute workflows. Both read from Postgres.
17
+ Maya doesn't write code. She writes requirements, talks to customers, and needs things to happen across systems she doesn't control.
18
18
 
19
- That's the entire infrastructure story. No message queues to configure. No object stores to provision. No separate orchestration service. Postgres is the durable execution engine, the tool registry, the escalation queue, and the audit log.
19
+ **Her journey:**
20
20
 
21
- ---
21
+ She opens the dashboard and types into the prompt bar: *"Check our support inbox every morning for emails mentioning 'cancellation'. Summarize each thread, tag the customer's sentiment, and create a task for the retention team with the full context."*
22
22
 
23
- ## The First Tool
23
+ The system discovers the capabilities it needs — Gmail search, thread summarization, sentiment analysis, knowledge storage, task creation. It runs the sequence dynamically, shows Maya the result. She adjusts: *"Include the customer's subscription tier from our database."* It re-runs, incorporating the schema exchange tool to query the customer API.
24
24
 
25
- The system ships with MCP servers for common capabilities: browser automation, file storage, document vision, database queries, HTTP requests. You can add your own — npm packages, remote services, custom TypeScript and their tools immediately appear in the designer and compiler.
25
+ Maya clicks **Compile**. The dynamic exploration becomes a deterministic pipeline no AI in the loop, no token cost, sub-second execution. She schedules it for 7 AM daily. An agent is born.
26
26
 
27
- Open the MCP Tool Designer. Describe what you need in natural language:
27
+ Two weeks later, the customer API changes a field name. The pipeline fails. The agent escalates to Maya's team. An engineer resolves it, the pipeline recompiles. Maya never knew it happened.
28
28
 
29
- > *"Screenshot every page in the admin panel and flag any that return errors."*
29
+ **What Maya sees:** Agents, processes, escalations. She lives in outcomes.
30
30
 
31
- The system discovers the relevant tools across registered servers, plans the execution, and runs it. The browser server navigates pages. The vision server inspects screenshots. The file server stores results. Each step is a durable activity if the process crashes mid-run, it resumes from the last completed step, not from the beginning.
31
+ ### DevProduct Engineer
32
32
 
33
- The result lands in your dashboard: a structured output with screenshots, error flags, and metadata. It worked. But it cost tokens, took time, and required an LLM to reason through each step.
33
+ Dev writes code when it makes sense and uses the platform when it's faster. He understands both worlds and moves between them.
34
34
 
35
- This is the dynamic path. It's powerful and flexible. It's also the most expensive way to run anything.
35
+ **His journey:**
36
36
 
37
- ---
37
+ Dev is building an integration with a new vendor. He registers a schema exchange endpoint — paste the API docs, define request/response schemas. The system creates a validated, self-testing MCP tool automatically.
38
38
 
39
- ## The Compilation Moment
39
+ He could write a durable workflow in TypeScript to orchestrate the vendor calls. Instead, he opens the pipeline builder and describes the sequence: authenticate → fetch orders → validate → store in knowledge → escalate anomalies. The builder compiles it to a deterministic YAML DAG.
40
40
 
41
- This is the pivot — the point where Long Tail stops being "an AI tool" and starts being infrastructure.
41
+ But the anomaly detection logic is complex. Dev writes that as a proper activity function tested, type-safe, version-controlled. He registers it alongside the compiled pipeline. The system doesn't care how the activity was authored. It's a pearl on the string either way.
42
42
 
43
- Open the compiler. It examines the execution trace from the dynamic run: which tools were called, in what order, with what arguments. It identifies what's dynamic (the URL, the credentials, the list of pages) versus what's fixed (the CSS selectors, the wait times, the error-detection logic). It produces a deterministic DAG — a directed acyclic graph that encodes the exact same workflow without any LLM reasoning.
43
+ When Maya's agent needs the vendor data, it discovers Dev's tools and uses them. Maya's conversation-compiled pipeline calls Dev's hand-crafted activity. Neither knows about the other. The capability just exists.
44
44
 
45
- Deploy it. It's now a tool — tagged, versioned, invocable. It has typed inputs and outputs. It runs in milliseconds instead of seconds. It costs nothing in API tokens. And it's just as reliable as the dynamic version, because it was extracted from a successful execution, not written by hand.
45
+ **What Dev sees:** Servers & tools, workflows, pipeline designer, execution traces. He lives in build mode but watches the outcomes.
46
46
 
47
- The compilation step is where operational knowledge crosses the boundary from tacit to executable. Before compilation, the knowledge of "how to screenshot admin pages and check for errors" lived in the LLM prompt and the human who wrote it. After compilation, it lives in the database as a versioned, deterministic tool that anyone or any other workflow — can invoke.
47
+ ### SamPlatform Engineer
48
48
 
49
- ---
49
+ Sam owns the infrastructure. She thinks in terms of reliability, observability, and cost.
50
50
 
51
- ## The Accumulation
51
+ **Her journey:**
52
52
 
53
- Next week, someone describes a similar task. The router examines the request, searches the compiled tool registry by tags and capability descriptions, and finds a match. It extracts the parameters from the natural language request and routes directly to the compiled tool.
53
+ Sam looks at the capabilities view every activity the system can perform, sorted by usage, success rate, and cost. She sees that `gmail_search` is called 3,000 times a day across 12 agents. The dynamic path is used 0.2% of the time. 99.8% deterministic. Cost: near zero.
54
54
 
55
- No LLM. No tokens. Sub-second execution.
55
+ She checks the knowledge store. Each agent has its own domain — clean isolation, no cross-contamination. The retirement agent has accumulated 847 entries over six weeks. The support monitoring agent has 12,000.
56
56
 
57
- The tool that was born from one person's request now serves the whole team. And it can be composed. Another workflow can call it as a step. The DAG that screenshots pages becomes an activity inside a larger workflow that audits, compares, and reports across environments.
57
+ An alert fires: a compiled pipeline is failing at a 15% rate. Sam traces the execution timeline swimlane view shows the `schema_exchange` step timing out. The vendor's API is degrading. She doesn't fix the code. She adjusts the retry policy and timeout on the workflow config. The pipeline adapts.
58
58
 
59
- This is the accumulation effect. Each compiled tool is both an endpoint and a building block. The library of tools grows monotonically new compilations only add capabilities, never remove them. Workflows that compose multiple tools inherit the reliability and speed of each component.
59
+ A new engineer joins. Sam points them to the boilerplate project: "Clone it, add your activities to `src/activities/`, register your MCP server in `src/mcp-servers/`, declare your workflow config in `start()`. Push. It deploys. The dashboard shows your tools immediately."
60
60
 
61
- Over time, the system develops a vocabulary of operations specific to your organization. Not generic "send HTTP request" primitives, but domain-specific tools like "audit staging environment" or "validate customer document against policy template." These are your operations, encoded in your database, reflecting your team's actual practices.
61
+ **What Sam sees:** Task queues, execution metrics, knowledge usage, DB maintenance, agent health. She lives in the system view.
62
62
 
63
63
  ---
64
64
 
65
- ## The Long Tail
65
+ ## The Surface
66
66
 
67
- The name comes from the distribution of problems.
67
+ ### Home: What's Alive
68
68
 
69
- Most operational tasks converge to patterns. After a month of use, the common paths the head of the distribution — are compiled. Content reviews follow templates. Document processing has known formats. Onboarding flows have standard steps. These run deterministically, cheaply, instantly.
69
+ The home page isn't a dashboard of charts. It's a **living view of work in motion**:
70
70
 
71
- What remains is the long tail: novel requests, edge cases, genuine unknowns. A document format nobody's seen before. An admin page with non-standard markup. A customer request that doesn't match any existing workflow.
71
+ - Active processes grouped by origin, showing progress through multi-step workflows
72
+ - Recent escalations — what needs human attention right now
73
+ - Agent activity — which agents ran, what they found, what they learned
72
74
 
73
- For these, the dynamic path still runs. The LLM reasons through the problem with the full tool inventory available. When it succeeds, the solution is a candidate for compilation. The tail gets shorter.
75
+ No distinction between durable and compiled. No mention of YAML or TypeScript. Just: work happening, knowledge growing, agents running.
74
76
 
75
- When it fails — when the available tools can't solve the problem or the LLM's reasoning produces an incorrect result — the system escalates. RBAC-scoped chains route the problem to the right human based on the credentials, domain, and tool requirements involved. The human resolves it through the dashboard, with full context: what was attempted, what failed, and why.
77
+ ### Agents: Who's Working
76
78
 
77
- If the resolution reveals a repeatable pattern, it compiles too. The escalation itself becomes the training data for the next compiled tool.
79
+ Each agent is a card:
78
80
 
79
- This is the dynamic the name describes: the long tail of problems that resist automation. Long Tail doesn't eliminate the tail. It systematically shortens it by converting each solved problem into a permanent, reusable capability.
81
+ ```
82
+ ┌─────────────────────────────────────────────┐
83
+ │ 📧 Retirement Monitor │
84
+ │ Checks Gmail hourly for 401k updates │
85
+ │ │
86
+ │ Last run: 12 minutes ago │
87
+ │ Knowledge: 847 entries in `retirement` │
88
+ │ Escalations: 3 pending review │
89
+ │ Status: ● Active │
90
+ │ │
91
+ │ [View Knowledge] [Execution Log] [Edit] │
92
+ └─────────────────────────────────────────────┘
93
+ ```
80
94
 
81
- ---
95
+ Click into an agent and see: its knowledge domain (browsable), its execution history (timeline), its escalation feed, its configuration. Everything an agent knows, everything it's done, everything it's waiting on.
82
96
 
83
- ## What You Own
97
+ **Creating an agent** is a conversation. The agent builder is the MCP query router with a purpose: instead of executing once, it compiles and schedules. The output is an agent, not a one-shot result.
84
98
 
85
- Long Tail runs on your Postgres. This isn't a philosophical stance about data sovereignty — it's an architectural consequence of using durable execution backed by a database you control.
99
+ ### Capabilities: What's Possible
86
100
 
87
- The compiled tools live in your database. The execution history lives in your database. The escalation patterns, the credential flows, the audit trail all in your database. You can back it up, replicate it, query it with SQL, migrate it to another provider, or inspect it with any tool that speaks Postgres.
101
+ A single searchable view of every activitynot grouped by server or workflow, but by **what it does**:
88
102
 
89
- When the system compiles a workflow, that compiled DAG is a row in a table you own. When a team member resolves an escalation, that resolution is recorded in a schema you can read. The institutional knowledge that accumulates over months of use — the specific ways your organization handles its specific problems — never leaves your infrastructure.
103
+ ```
104
+ Communication
105
+ gmail_search · gmail_read · gmail_draft · send_sms · notify
90
106
 
91
- This matters for a practical reason beyond principle. Operational knowledge is one of the few genuine competitive advantages an organization has. The specific patterns of how your team reviews content, processes documents, responds to incidents — these reflect hard-won expertise. Infrastructure that captures and encodes that expertise should store it where you control access, retention, and usage.
107
+ Analysis
108
+ analyze_image · describe_image · translate · sentiment
92
109
 
93
- Two container types scale independently behind a load balancer. Add API servers for dashboard traffic. Add workers for execution throughput. Both connect to the same Postgres. There's no orchestration service to license, no execution platform to subscribe to, no vendor that accumulates your operational patterns as a side effect of providing the service.
110
+ Data
111
+ store_knowledge · search_knowledge · schema_exchange · http_fetch
94
112
 
95
- ---
113
+ Automation
114
+ escalate_and_wait · create_task · capture_page · run_script
115
+ ```
116
+
117
+ Each capability shows who uses it: which agents, which pipelines, which workflows. Click one and see its schema, its compile hints, its execution history. This is the **institutional memory map** — it tells you what your organization has taught this system to do.
96
118
 
97
- ## The Pluggable Platform
119
+ ### Build: How It Works
98
120
 
99
- MCP servers are the extension mechanism. Each server registers a set of tools with typed inputs, outputs, and descriptive metadata. The system uses this metadata for discovery — both by the LLM during dynamic execution and by the router during compiled tool matching.
121
+ The engineering backstage. Everything that exists today, reorganized:
100
122
 
101
- The built-in servers cover common ground: browser automation for web interaction, file storage for document handling, vision for image analysis, database queries for structured data, HTTP for external API integration. But the real power is in what you add.
123
+ - **Workflows** durable TypeScript workflows, config, invocation, executions
124
+ - **Pipelines** — compiled YAML DAGs, plan/build/compose, pipeline executions
125
+ - **Servers & Tools** — MCP server registry, tool manifests, try-tool panel
126
+ - **Designer** — the six-step compilation wizard
102
127
 
103
- Install an npm package that exposes an MCP server. Register it. Its tools are immediately available to the designer, the compiler, and the router. A server that wraps your internal API becomes a set of tools that workflows can compose. A server that connects to a third-party service extends the platform's reach without modifying any core code.
128
+ Engineers move freely between these. They see execution traces, YAML DAGs, durable cycle replay, swimlane timelines. Nothing is hidden. The technical depth is the product.
104
129
 
105
- The LLM can even discover what's missing. If a dynamic execution fails because no available tool can perform a required step, the triage system surfaces the gap: "This workflow needs access to [capability] but no registered server provides it." Install the server, register the tools, and re-run. The platform grows in response to the problems it encounters.
130
+ ### Storage: What's Remembered
106
131
 
107
- Tags organize the tool space. Servers and tools carry tags that describe their domain and capabilities. The router uses tags to scope discovery — a database analytics query doesn't need to search browser automation tools. As the tool inventory grows, tags keep discovery focused and fast.
132
+ - **Files** drag-and-drop, signed URLs, image preview
133
+ - **Knowledge** — domain browser, entry editor, JSON drop
134
+
135
+ These aren't utilities. They're the **memory system**. When an agent stores extracted email data, it appears here. When a pipeline writes a screenshot, it appears here. The knowledge store is the agent's brain, browsable by anyone.
108
136
 
109
137
  ---
110
138
 
111
- ## The Three Execution Tiers
139
+ ## The Event Spine
112
140
 
113
- Every request flows through a routing decision:
141
+ Everything that happens publishes to NATS. Every workflow start, every activity completion, every escalation claim, every knowledge write, every agent run. The event feed at the bottom of the dashboard is a live window into this stream.
114
142
 
115
- **Deterministic.** A compiled tool matches the request. Parameters are extracted and the DAG executes directly. No LLM involved. Sub-second. Free.
143
+ But the real power is **subscription**. An agent can trigger on any event:
116
144
 
117
- **Dynamic.** No compiled tool matches, but the available tools can likely solve the problem. The LLM reasons through the execution, calling tools as needed. Durable — survives crashes and restarts. Successful runs are candidates for compilation.
145
+ - A new escalation is created the triage agent evaluates whether AI can resolve it
146
+ - A file is uploaded → the image analysis agent processes it
147
+ - Knowledge is updated in domain X → the report generator agent recompiles
148
+ - A pipeline fails → the health monitoring agent escalates
118
149
 
119
- **Escalation.** The dynamic path fails or the system determines it can't solve the problem autonomously. RBAC-scoped routing sends it to the right human with full context. The human resolves it through the dashboard. Resolutions that reveal patterns feed back into compilation.
150
+ The event spine is NATS. Clean pub/sub. Topic-based routing. No polling. The dashboard's real-time updates come from the same pipe that agents use to trigger. **One event system for humans and machines.**
120
151
 
121
- The ratio shifts over time. Early on, most requests take the dynamic path. As compilations accumulate, more requests route deterministically. The escalation path handles a shrinking residual. The system is always getting cheaper and faster, with no manual optimization required.
152
+ This is what makes the system feel alive. It's not cron-only (check every hour). It's reactive (respond when something happens). Agents that react are faster, cheaper, and more natural than agents that poll.
122
153
 
123
154
  ---
124
155
 
125
- ## The Workflow Lifecycle
156
+ ## The Transition
126
157
 
127
- A workflow in Long Tail has a natural lifecycle:
158
+ The beautiful thing about this system is that it doesn't require a "big bang." It's additive:
128
159
 
129
- **Born dynamic.** Someone describes a need. The LLM orchestrates tools to meet it. The execution is durable — each step is checkpointed in Postgres. If the worker crashes, it resumes from the last completed activity, not from scratch.
160
+ **Week 1:** An engineer adds activities and a workflow. Old school. Works great.
130
161
 
131
- **Reviewed.** The result appears in the dashboard. A human confirms it's correct, flags issues, or provides corrections. This review step is optional but valuable — it's the quality gate that ensures compiled tools encode correct behavior.
162
+ **Week 2:** Someone discovers the pipeline designer. Compiles a dynamic workflow into a tool. Faster, no tokens.
132
163
 
133
- **Compiled.** The successful execution trace is fed to the compiler. The compiler extracts the fixed structure, parameterizes the dynamic inputs, and produces a deterministic DAG. The DAG is deployed as a new tool with typed inputs, outputs, and tags.
164
+ **Week 3:** A product manager creates their first agent from a conversation. It runs on a schedule.
134
165
 
135
- **Composed.** The compiled tool becomes available as an activity for other workflows. A tool that validates a single document can be composed into a workflow that processes a batch. A tool that checks a single page can be composed into a site-wide audit. Composition is how individual capabilities combine into organizational processes.
166
+ **Week 4:** The agent's compiled pipeline uses the engineer's activities alongside AI-compiled ones. No one planned this composition. The capability graph grew organically.
136
167
 
137
- **Evolved.** When the domain changes new document formats, new page layouts, new policies the compiled tool may start failing. Failures route to escalation. The human resolution captures the new pattern. A new compilation encodes the updated behavior. The old version remains available for rollback.
168
+ **Month 3:** The system has 40 compiled tools, 8 agents, and 3 active knowledge domains. 94% of executions are deterministic. Cost has dropped. Reliability has increased. The team has institutional memory encoded in executable tools that survive personnel changes.
138
169
 
139
- This lifecycle runs continuously. The system is always compiling, always accumulating, always refining. No migration projects. No "automation initiatives." Just a steady conversion of operational knowledge into executable tools.
170
+ **Month 6:** A new team member asks: "How do we handle the Aetna prior-auth process?" The answer isn't a wiki page. It's a compiled pipeline they can run, inspect, and modify. The knowledge is alive.
140
171
 
141
172
  ---
142
173
 
143
- ## What You're Really Building
144
-
145
- Long Tail isn't a workflow engine that happens to use AI. It's a **knowledge compiler** that uses workflows as the intermediate representation.
146
-
147
- The input is human expertise and LLM reasoning — the tacit operational knowledge of how your team solves problems. The output is deterministic, versioned, composable tools that run without either.
148
-
149
- Every organization has operational patterns that live in people's heads, in runbooks, in tribal knowledge, in the "ask Sarah, she knows how to handle that" moments. These patterns are valuable, fragile, and almost never systematically captured. When someone leaves, the knowledge leaves with them. When a team scales, the patterns dilute.
150
-
151
- Long Tail is the machine that extracts those patterns and makes them executable. Not by asking people to document their processes — that rarely works and the documentation immediately drifts from reality. Instead, by observing how problems are actually solved, compiling the successful patterns, and deploying them as tools that anyone can invoke.
174
+ ## The Name
152
175
 
153
- The LLM is scaffolding. It provides the initial reasoning capability that bridges the gap between "describe what you need" and "here's a working solution." But scaffolding is temporary by design. As compiled tools accumulate, the LLM handles less. The deterministic tools handle more. The system converges toward a state where the LLM is only needed for genuinely novel problems — the shrinking long tail.
176
+ Long Tail because it systematically shortens the tail. Every novel problem that gets solved compiles into a permanent capability. The tail of unsolved problems shrinks. The head of automated, reliable, institutional knowledge grows.
154
177
 
155
- The compiled tools are the building--the durable artifact. They're what remains after the LLM has done its work and moved on. They encode your organization's operational knowledge in a form that's versioned, testable, composable, and entirely under your control.
178
+ What starts as "I need someone to check my email" becomes an agent that runs 24/7, learns from every interaction, escalates when uncertain, and evolves when the world changes.
156
179
 
157
- That's the Long Tail.
180
+ That's the story. Activities are permanent. Agents compose them. Humans guide the evolution. The system accumulates.