@hotmeshio/long-tail 0.19.1 → 0.21.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 (393) hide show
  1. package/README.md +4 -4
  2. package/build/api/escalations/accumulate.d.ts +96 -0
  3. package/build/api/escalations/accumulate.js +516 -0
  4. package/build/api/escalations/index.d.ts +1 -0
  5. package/build/api/escalations/index.js +10 -1
  6. package/build/api/roles.d.ts +4 -5
  7. package/build/api/roles.js +53 -4
  8. package/build/api/scan-codes/execute.js +2 -0
  9. package/build/api/scan-codes/verbs.d.ts +15 -0
  10. package/build/api/scan-codes/verbs.js +65 -0
  11. package/build/api/workflows/config.d.ts +3 -0
  12. package/build/api/workflows/config.js +15 -0
  13. package/build/api/workflows/index.d.ts +1 -0
  14. package/build/api/workflows/index.js +3 -1
  15. package/build/api/workflows/input-lookups.d.ts +16 -0
  16. package/build/api/workflows/input-lookups.js +69 -0
  17. package/build/api/workflows/input-validation.d.ts +4 -3
  18. package/build/api/workflows/input-validation.js +7 -4
  19. package/build/api/workflows/invocable.js +1 -0
  20. package/build/api/workflows/invocation.js +1 -1
  21. package/build/index.js +60 -0
  22. package/build/lib/db/schemas/035_workflow_input_lookups.sql +9 -0
  23. package/build/lib/db/schemas/036_role_portals.sql +12 -0
  24. package/build/routes/escalations/accumulate.d.ts +7 -0
  25. package/build/routes/escalations/accumulate.js +150 -0
  26. package/build/routes/escalations/index.js +5 -0
  27. package/build/routes/workflows/config.js +10 -0
  28. package/build/sdk/index.d.ts +25 -0
  29. package/build/sdk/index.js +8 -0
  30. package/build/services/config/cache.js +1 -0
  31. package/build/services/config/read.js +2 -0
  32. package/build/services/config/sql.d.ts +2 -2
  33. package/build/services/config/sql.js +6 -5
  34. package/build/services/config/write.js +10 -1
  35. package/build/services/escalation/accumulate.d.ts +81 -0
  36. package/build/services/escalation/accumulate.js +154 -0
  37. package/build/services/escalation/index.d.ts +1 -0
  38. package/build/services/escalation/index.js +1 -0
  39. package/build/services/knowledge/index.d.ts +1 -0
  40. package/build/services/knowledge/index.js +1 -0
  41. package/build/services/knowledge/lookup-refs.d.ts +7 -0
  42. package/build/services/knowledge/lookup-refs.js +26 -0
  43. package/build/services/mcp/db-server/schemas.d.ts +2 -2
  44. package/build/services/mcp/playwright-server/schemas.d.ts +2 -2
  45. package/build/services/orchestrator/condition.d.ts +40 -3
  46. package/build/services/orchestrator/condition.js +42 -2
  47. package/build/services/role/index.js +1 -0
  48. package/build/services/role/seed.js +6 -1
  49. package/build/services/role/sql.d.ts +6 -3
  50. package/build/services/role/sql.js +7 -2
  51. package/build/services/role/types.d.ts +38 -10
  52. package/build/services/role/types.js +10 -1
  53. package/build/services/scan-code/validate.js +16 -0
  54. package/build/shared/form-validation/display-only-widgets.d.ts +16 -0
  55. package/build/shared/form-validation/display-only-widgets.js +25 -0
  56. package/build/shared/form-validation/field-validator.d.ts +1 -0
  57. package/build/shared/form-validation/field-validator.js +94 -6
  58. package/build/shared/form-validation/index.d.ts +2 -0
  59. package/build/shared/form-validation/index.js +2 -0
  60. package/build/shared/form-validation/invoke-context.d.ts +4 -3
  61. package/build/shared/form-validation/invoke-context.js +5 -4
  62. package/build/shared/form-validation/x-lt-bind.d.ts +2 -14
  63. package/build/shared/form-validation/x-lt-bind.js +12 -8
  64. package/build/shared/form-validation/x-lt-invoke.d.ts +38 -0
  65. package/build/shared/form-validation/x-lt-invoke.js +103 -0
  66. package/build/shared/form-validation/x-lt-options.d.ts +3 -3
  67. package/build/shared/form-validation/x-lt-options.js +19 -5
  68. package/build/shared/form-validation/x-lt-show-if.d.ts +5 -0
  69. package/build/shared/form-validation/x-lt-show-if.js +10 -0
  70. package/build/start/workers.js +10 -0
  71. package/build/system/mcp-servers/admin/escalations.js +39 -0
  72. package/build/system/mcp-servers/admin/schemas.d.ts +256 -33
  73. package/build/system/mcp-servers/admin/schemas.js +55 -3
  74. package/build/system/mcp-servers/admin/users.js +1 -0
  75. package/build/system/mcp-servers/admin/workflow-config.js +54 -9
  76. package/build/system/mcp-servers/admin/workflows.js +9 -7
  77. package/build/system/mcp-servers/db-query/schemas.d.ts +2 -2
  78. package/build/system/mcp-servers/docs.js +4 -0
  79. package/build/system/mcp-servers/human-queue-schemas.d.ts +85 -0
  80. package/build/system/mcp-servers/human-queue-schemas.js +19 -1
  81. package/build/system/mcp-servers/human-queue.d.ts +2 -0
  82. package/build/system/mcp-servers/human-queue.js +77 -0
  83. package/build/system/seed/tool-manifests-admin.d.ts +1509 -227
  84. package/build/system/seed/tool-manifests-admin.js +8 -4
  85. package/build/system/seed/tool-manifests-escalation.d.ts +174 -0
  86. package/build/system/seed/tool-manifests-escalation.js +56 -0
  87. package/build/tsconfig.tsbuildinfo +1 -1
  88. package/build/types/config.d.ts +4 -0
  89. package/build/types/escalation.d.ts +52 -0
  90. package/build/types/escalation.js +29 -1
  91. package/build/types/index.d.ts +2 -2
  92. package/build/types/index.js +3 -1
  93. package/build/types/scan-code.d.ts +24 -0
  94. package/build/types/scan-code.js +9 -0
  95. package/build/types/startup.d.ts +26 -0
  96. package/dashboard/dist/assets/{AdminDashboard-Drs-9TRM.js → AdminDashboard-uarpHB88.js} +2 -2
  97. package/dashboard/dist/assets/{AdminDashboard-Drs-9TRM.js.map → AdminDashboard-uarpHB88.js.map} +1 -1
  98. package/dashboard/dist/assets/{AgentConfigPage-BDPDZ7-v.js → AgentConfigPage-BcUaDD5E.js} +6 -6
  99. package/dashboard/dist/assets/{AgentConfigPage-BDPDZ7-v.js.map → AgentConfigPage-BcUaDD5E.js.map} +1 -1
  100. package/dashboard/dist/assets/{AgentDetailPage-CGBulM4_.js → AgentDetailPage-BaZBhK6i.js} +3 -3
  101. package/dashboard/dist/assets/{AgentDetailPage-CGBulM4_.js.map → AgentDetailPage-BaZBhK6i.js.map} +1 -1
  102. package/dashboard/dist/assets/AgentsPage-CuVFSDc4.js +2 -0
  103. package/dashboard/dist/assets/{AgentsPage-D77JeViQ.js.map → AgentsPage-CuVFSDc4.js.map} +1 -1
  104. package/dashboard/dist/assets/AvailableEscalationsPage-iO5NyyIK.js +2 -0
  105. package/dashboard/dist/assets/AvailableEscalationsPage-iO5NyyIK.js.map +1 -0
  106. package/dashboard/dist/assets/{BotPicker-CC5vI_Sv.js → BotPicker-CClMby6B.js} +2 -2
  107. package/dashboard/dist/assets/{BotPicker-CC5vI_Sv.js.map → BotPicker-CClMby6B.js.map} +1 -1
  108. package/dashboard/dist/assets/BulkAssignModal-BL8FRgkN.js +2 -0
  109. package/dashboard/dist/assets/{BulkAssignModal-BXiJnlqt.js.map → BulkAssignModal-BL8FRgkN.js.map} +1 -1
  110. package/dashboard/dist/assets/CapabilitiesPage-D53ogPor.js +2 -0
  111. package/dashboard/dist/assets/{CapabilitiesPage-D9TC2iKy.js.map → CapabilitiesPage-D53ogPor.js.map} +1 -1
  112. package/dashboard/dist/assets/{CollapsibleSection-D10lGw_u.js → CollapsibleSection-ow8jpbtD.js} +2 -2
  113. package/dashboard/dist/assets/{CollapsibleSection-D10lGw_u.js.map → CollapsibleSection-ow8jpbtD.js.map} +1 -1
  114. package/dashboard/dist/assets/{ConfirmDeleteModal-BJdLN6No.js → ConfirmDeleteModal-CeEDt9iJ.js} +2 -2
  115. package/dashboard/dist/assets/{ConfirmDeleteModal-BJdLN6No.js.map → ConfirmDeleteModal-CeEDt9iJ.js.map} +1 -1
  116. package/dashboard/dist/assets/{CountdownTimer-D9B-BjQ7.js → CountdownTimer-CSqyZMCG.js} +2 -2
  117. package/dashboard/dist/assets/{CountdownTimer-D9B-BjQ7.js.map → CountdownTimer-CSqyZMCG.js.map} +1 -1
  118. package/dashboard/dist/assets/{CredentialsPage-hniUAFBK.js → CredentialsPage-Dx7SxA23.js} +2 -2
  119. package/dashboard/dist/assets/{CredentialsPage-hniUAFBK.js.map → CredentialsPage-Dx7SxA23.js.map} +1 -1
  120. package/dashboard/dist/assets/{CronLabel-v9DCD2FX.js → CronLabel-LYPxpvNN.js} +2 -2
  121. package/dashboard/dist/assets/{CronLabel-v9DCD2FX.js.map → CronLabel-LYPxpvNN.js.map} +1 -1
  122. package/dashboard/dist/assets/DataTable-spX1dFyb.js +2 -0
  123. package/dashboard/dist/assets/DataTable-spX1dFyb.js.map +1 -0
  124. package/dashboard/dist/assets/{DropZone-XlcY8hEH.js → DropZone-f1o-GLM8.js} +2 -2
  125. package/dashboard/dist/assets/{DropZone-XlcY8hEH.js.map → DropZone-f1o-GLM8.js.map} +1 -1
  126. package/dashboard/dist/assets/{ElapsedCell-_xvVTK8N.js → ElapsedCell-BZJTSm9N.js} +2 -2
  127. package/dashboard/dist/assets/{ElapsedCell-_xvVTK8N.js.map → ElapsedCell-BZJTSm9N.js.map} +1 -1
  128. package/dashboard/dist/assets/EntityTimelinePanel-0wIIW2en.js +2 -0
  129. package/dashboard/dist/assets/{EntityTimelinePanel-1lT3jkCM.js.map → EntityTimelinePanel-0wIIW2en.js.map} +1 -1
  130. package/dashboard/dist/assets/{EscalationListSchemaPage-BeQUTUEO.js → EscalationListSchemaPage-CoYvtMzj.js} +3 -3
  131. package/dashboard/dist/assets/{EscalationListSchemaPage-BeQUTUEO.js.map → EscalationListSchemaPage-CoYvtMzj.js.map} +1 -1
  132. package/dashboard/dist/assets/EscalationListView-DWFHPufv.js +2 -0
  133. package/dashboard/dist/assets/EscalationListView-DWFHPufv.js.map +1 -0
  134. package/dashboard/dist/assets/{EscalationSchemaPage-D4VlEwyS.js → EscalationSchemaPage-C9Xu_A25.js} +3 -3
  135. package/dashboard/dist/assets/{EscalationSchemaPage-D4VlEwyS.js.map → EscalationSchemaPage-C9Xu_A25.js.map} +1 -1
  136. package/dashboard/dist/assets/EscalationTimeline-D8W2LNNk.js +2 -0
  137. package/dashboard/dist/assets/EscalationTimeline-D8W2LNNk.js.map +1 -0
  138. package/dashboard/dist/assets/EscalationTitleSelect-DLK8NWMp.js +2 -0
  139. package/dashboard/dist/assets/EscalationTitleSelect-DLK8NWMp.js.map +1 -0
  140. package/dashboard/dist/assets/{EscalationsOverview-Bx6Zrzm-.js → EscalationsOverview-CW57FaP9.js} +2 -2
  141. package/dashboard/dist/assets/{EscalationsOverview-Bx6Zrzm-.js.map → EscalationsOverview-CW57FaP9.js.map} +1 -1
  142. package/dashboard/dist/assets/{EventTable-KEC3YWBf.js → EventTable-D1ctWhKf.js} +2 -2
  143. package/dashboard/dist/assets/{EventTable-KEC3YWBf.js.map → EventTable-D1ctWhKf.js.map} +1 -1
  144. package/dashboard/dist/assets/{FilterBar-xwN_b5fj.js → FilterBar-C-iur-Nj.js} +2 -2
  145. package/dashboard/dist/assets/{FilterBar-xwN_b5fj.js.map → FilterBar-C-iur-Nj.js.map} +1 -1
  146. package/dashboard/dist/assets/GraphInvokePage-CcA_44M4.js +2 -0
  147. package/dashboard/dist/assets/{GraphInvokePage-DV7Y0fe2.js.map → GraphInvokePage-CcA_44M4.js.map} +1 -1
  148. package/dashboard/dist/assets/HomePage-Dc085ghJ.js +2 -0
  149. package/dashboard/dist/assets/{HomePage-G785SWcW.js.map → HomePage-Dc085ghJ.js.map} +1 -1
  150. package/dashboard/dist/assets/ListToolbar-h_ziBt4O.js +2 -0
  151. package/dashboard/dist/assets/{ListToolbar-zPVYPg3W.js.map → ListToolbar-h_ziBt4O.js.map} +1 -1
  152. package/dashboard/dist/assets/{McpOverview-CMGUq8hx.js → McpOverview-qXXhbNWV.js} +2 -2
  153. package/dashboard/dist/assets/{McpOverview-CMGUq8hx.js.map → McpOverview-qXXhbNWV.js.map} +1 -1
  154. package/dashboard/dist/assets/{McpQueryDetailPage-CdhLhaKn.js → McpQueryDetailPage-SEzSbZrd.js} +2 -2
  155. package/dashboard/dist/assets/{McpQueryDetailPage-CdhLhaKn.js.map → McpQueryDetailPage-SEzSbZrd.js.map} +1 -1
  156. package/dashboard/dist/assets/McpQueryPage-Cy0V0kv9.js +2 -0
  157. package/dashboard/dist/assets/{McpQueryPage-CNSNMagY.js.map → McpQueryPage-Cy0V0kv9.js.map} +1 -1
  158. package/dashboard/dist/assets/{McpRunDetailPage-DBm8hUaW.js → McpRunDetailPage-DjJO5vSb.js} +2 -2
  159. package/dashboard/dist/assets/{McpRunDetailPage-DBm8hUaW.js.map → McpRunDetailPage-DjJO5vSb.js.map} +1 -1
  160. package/dashboard/dist/assets/McpRunsPage-BfjiJ8mM.js +2 -0
  161. package/dashboard/dist/assets/{McpRunsPage-B6rb5QBf.js.map → McpRunsPage-BfjiJ8mM.js.map} +1 -1
  162. package/dashboard/dist/assets/{NamespacePill-Bb3revqD.js → NamespacePill-DADRJOUl.js} +2 -2
  163. package/dashboard/dist/assets/{NamespacePill-Bb3revqD.js.map → NamespacePill-DADRJOUl.js.map} +1 -1
  164. package/dashboard/dist/assets/OperationsPage-dJcER0T_.js +3 -0
  165. package/dashboard/dist/assets/OperationsPage-dJcER0T_.js.map +1 -0
  166. package/dashboard/dist/assets/OperatorDashboard-zCkW4eqk.js +2 -0
  167. package/dashboard/dist/assets/{OperatorDashboard-DBOscDnf.js.map → OperatorDashboard-zCkW4eqk.js.map} +1 -1
  168. package/dashboard/dist/assets/{PageHeader-Di5Sz3an.js → PageHeader-Csq434-v.js} +2 -2
  169. package/dashboard/dist/assets/{PageHeader-Di5Sz3an.js.map → PageHeader-Csq434-v.js.map} +1 -1
  170. package/dashboard/dist/assets/{PageHeaderWithStats-DutKJ-h2.js → PageHeaderWithStats-CSnk1p5A.js} +2 -2
  171. package/dashboard/dist/assets/{PageHeaderWithStats-DutKJ-h2.js.map → PageHeaderWithStats-CSnk1p5A.js.map} +1 -1
  172. package/dashboard/dist/assets/{PersonaDetailPage-BGRdGpeR.js → PersonaDetailPage-Cx6L3Jvu.js} +2 -2
  173. package/dashboard/dist/assets/{PersonaDetailPage-BGRdGpeR.js.map → PersonaDetailPage-Cx6L3Jvu.js.map} +1 -1
  174. package/dashboard/dist/assets/{PersonasPage-DRzOZcVa.js → PersonasPage-DOgGUlJl.js} +2 -2
  175. package/dashboard/dist/assets/{PersonasPage-DRzOZcVa.js.map → PersonasPage-DOgGUlJl.js.map} +1 -1
  176. package/dashboard/dist/assets/PortalPage-BKuL1BeJ.js +2 -0
  177. package/dashboard/dist/assets/PortalPage-BKuL1BeJ.js.map +1 -0
  178. package/dashboard/dist/assets/{ProcessDetailPage-BLGjZXpM.js → ProcessDetailPage-BFcFSDUv.js} +2 -2
  179. package/dashboard/dist/assets/{ProcessDetailPage-BLGjZXpM.js.map → ProcessDetailPage-BFcFSDUv.js.map} +1 -1
  180. package/dashboard/dist/assets/ProcessesListPage-BaHV2cXp.js +2 -0
  181. package/dashboard/dist/assets/{ProcessesListPage-5NnysKFC.js.map → ProcessesListPage-BaHV2cXp.js.map} +1 -1
  182. package/dashboard/dist/assets/ResolverForm-Bgc0Zrya.js +7 -0
  183. package/dashboard/dist/assets/ResolverForm-Bgc0Zrya.js.map +1 -0
  184. package/dashboard/dist/assets/RoleDetailPage-BPY6i3CU.js +8 -0
  185. package/dashboard/dist/assets/RoleDetailPage-BPY6i3CU.js.map +1 -0
  186. package/dashboard/dist/assets/{RolePill-DhnVPK4q.js → RolePill-BafrASDX.js} +2 -2
  187. package/dashboard/dist/assets/{RolePill-DhnVPK4q.js.map → RolePill-BafrASDX.js.map} +1 -1
  188. package/dashboard/dist/assets/{RolesPage-BmW1LzkU.js → RolesPage-DSqqKPbv.js} +2 -2
  189. package/dashboard/dist/assets/{RolesPage-BmW1LzkU.js.map → RolesPage-DSqqKPbv.js.map} +1 -1
  190. package/dashboard/dist/assets/RunAsSelector-B29iWwel.js +2 -0
  191. package/dashboard/dist/assets/{RunAsSelector-BwZTJ4Yj.js.map → RunAsSelector-B29iWwel.js.map} +1 -1
  192. package/dashboard/dist/assets/ScanCodesPage-S8aAJfnC.js +2 -0
  193. package/dashboard/dist/assets/{ScanCodesPage-FiYIYB-m.js.map → ScanCodesPage-S8aAJfnC.js.map} +1 -1
  194. package/dashboard/dist/assets/{ScanSchemeDetailPage-BiAqtD-a.js → ScanSchemeDetailPage-CUBRAtmJ.js} +2 -2
  195. package/dashboard/dist/assets/{ScanSchemeDetailPage-BiAqtD-a.js.map → ScanSchemeDetailPage-CUBRAtmJ.js.map} +1 -1
  196. package/dashboard/dist/assets/ScanStationPage-R9t1-CeQ.js +2 -0
  197. package/dashboard/dist/assets/{ScanStationPage-8CdOtbCD.js.map → ScanStationPage-R9t1-CeQ.js.map} +1 -1
  198. package/dashboard/dist/assets/{ScopeBadge-CXUg0FHo.js → ScopeBadge-b6MIBiYD.js} +2 -2
  199. package/dashboard/dist/assets/{ScopeBadge-CXUg0FHo.js.map → ScopeBadge-b6MIBiYD.js.map} +1 -1
  200. package/dashboard/dist/assets/{StickyPagination-DRuqKhZt.js → StickyPagination-CkW_A507.js} +2 -2
  201. package/dashboard/dist/assets/{StickyPagination-DRuqKhZt.js.map → StickyPagination-CkW_A507.js.map} +1 -1
  202. package/dashboard/dist/assets/{StreamMessageDetail-JwlbRiMn.js → StreamMessageDetail-yzWX0wac.js} +2 -2
  203. package/dashboard/dist/assets/{StreamMessageDetail-JwlbRiMn.js.map → StreamMessageDetail-yzWX0wac.js.map} +1 -1
  204. package/dashboard/dist/assets/{SwimlaneTimeline-hu3c4bCJ.js → SwimlaneTimeline-Cf4DXFxj.js} +2 -2
  205. package/dashboard/dist/assets/{SwimlaneTimeline-hu3c4bCJ.js.map → SwimlaneTimeline-Cf4DXFxj.js.map} +1 -1
  206. package/dashboard/dist/assets/{TagInput-BZ8vb2oW.js → TagInput-ZrIIrEUP.js} +2 -2
  207. package/dashboard/dist/assets/{TagInput-BZ8vb2oW.js.map → TagInput-ZrIIrEUP.js.map} +1 -1
  208. package/dashboard/dist/assets/{TaskDetailPage-NqVZF3jW.js → TaskDetailPage-DCDcEps9.js} +2 -2
  209. package/dashboard/dist/assets/{TaskDetailPage-NqVZF3jW.js.map → TaskDetailPage-DCDcEps9.js.map} +1 -1
  210. package/dashboard/dist/assets/{TaskQueuePill-Bxir8WRl.js → TaskQueuePill-DkQ1uc6y.js} +2 -2
  211. package/dashboard/dist/assets/{TaskQueuePill-Bxir8WRl.js.map → TaskQueuePill-DkQ1uc6y.js.map} +1 -1
  212. package/dashboard/dist/assets/TasksListPage-BBATgpf7.js +2 -0
  213. package/dashboard/dist/assets/{TasksListPage-BQNaSzCn.js.map → TasksListPage-BBATgpf7.js.map} +1 -1
  214. package/dashboard/dist/assets/{TimeAgo-Cv35DOiI.js → TimeAgo-CSNVEjch.js} +2 -2
  215. package/dashboard/dist/assets/{TimeAgo-Cv35DOiI.js.map → TimeAgo-CSNVEjch.js.map} +1 -1
  216. package/dashboard/dist/assets/{TimestampCell-DHUXey9s.js → TimestampCell-Du1nBrPn.js} +2 -2
  217. package/dashboard/dist/assets/{TimestampCell-DHUXey9s.js.map → TimestampCell-Du1nBrPn.js.map} +1 -1
  218. package/dashboard/dist/assets/{ToolPill-FkgTXIhq.js → ToolPill-Baxm02L6.js} +2 -2
  219. package/dashboard/dist/assets/{ToolPill-FkgTXIhq.js.map → ToolPill-Baxm02L6.js.map} +1 -1
  220. package/dashboard/dist/assets/ToolTestPanel-CF-h_5Rg.js +2 -0
  221. package/dashboard/dist/assets/{ToolTestPanel-DvuLFWqQ.js.map → ToolTestPanel-CF-h_5Rg.js.map} +1 -1
  222. package/dashboard/dist/assets/{TopicDetailPage-TXX3QNSo.js → TopicDetailPage-Dr1UmWcp.js} +3 -3
  223. package/dashboard/dist/assets/{TopicDetailPage-TXX3QNSo.js.map → TopicDetailPage-Dr1UmWcp.js.map} +1 -1
  224. package/dashboard/dist/assets/TopicsPage-CUUo-Ylf.js +2 -0
  225. package/dashboard/dist/assets/{TopicsPage-h-oyTeEJ.js.map → TopicsPage-CUUo-Ylf.js.map} +1 -1
  226. package/dashboard/dist/assets/{UserName-BceRCeDF.js → UserName-kBh1dc39.js} +2 -2
  227. package/dashboard/dist/assets/{UserName-BceRCeDF.js.map → UserName-kBh1dc39.js.map} +1 -1
  228. package/dashboard/dist/assets/{WorkflowExecutionPage-CmHGcaN9.js → WorkflowExecutionPage-CCRSbnDx.js} +2 -2
  229. package/dashboard/dist/assets/{WorkflowExecutionPage-CmHGcaN9.js.map → WorkflowExecutionPage-CCRSbnDx.js.map} +1 -1
  230. package/dashboard/dist/assets/{WorkflowPill--AYMW7u_.js → WorkflowPill-ZepbO_ny.js} +2 -2
  231. package/dashboard/dist/assets/{WorkflowPill--AYMW7u_.js.map → WorkflowPill-ZepbO_ny.js.map} +1 -1
  232. package/dashboard/dist/assets/WorkflowsDashboard-BNQVvyek.js +2 -0
  233. package/dashboard/dist/assets/{WorkflowsDashboard-B0r2lQXk.js.map → WorkflowsDashboard-BNQVvyek.js.map} +1 -1
  234. package/dashboard/dist/assets/{WorkflowsOverview-BTMc2PJ_.js → WorkflowsOverview-DswubNJN.js} +2 -2
  235. package/dashboard/dist/assets/{WorkflowsOverview-BTMc2PJ_.js.map → WorkflowsOverview-DswubNJN.js.map} +1 -1
  236. package/dashboard/dist/assets/{YamlWorkflowDetailPage-DUiCVnZp.js → YamlWorkflowDetailPage-Cw9Dlmup.js} +11 -11
  237. package/dashboard/dist/assets/{YamlWorkflowDetailPage-DUiCVnZp.js.map → YamlWorkflowDetailPage-Cw9Dlmup.js.map} +1 -1
  238. package/dashboard/dist/assets/{YamlWorkflowsPage-BAuXfwi0.js → YamlWorkflowsPage-DB8xnIXy.js} +2 -2
  239. package/dashboard/dist/assets/{YamlWorkflowsPage-BAuXfwi0.js.map → YamlWorkflowsPage-DB8xnIXy.js.map} +1 -1
  240. package/dashboard/dist/assets/{agents-BvmLCk4h.js → agents-BwEnf6N9.js} +2 -2
  241. package/dashboard/dist/assets/{agents-BvmLCk4h.js.map → agents-BwEnf6N9.js.map} +1 -1
  242. package/dashboard/dist/assets/{bots-f_tyhl4I.js → bots-CCmJTT2u.js} +2 -2
  243. package/dashboard/dist/assets/{bots-f_tyhl4I.js.map → bots-CCmJTT2u.js.map} +1 -1
  244. package/dashboard/dist/assets/{capabilities-DNo5bqLx.js → capabilities-BZHgp_nh.js} +2 -2
  245. package/dashboard/dist/assets/{capabilities-DNo5bqLx.js.map → capabilities-BZHgp_nh.js.map} +1 -1
  246. package/dashboard/dist/assets/{constants-BHkpVaqx.js → constants-CeBBTzf5.js} +2 -2
  247. package/dashboard/dist/assets/{constants-BHkpVaqx.js.map → constants-CeBBTzf5.js.map} +1 -1
  248. package/dashboard/dist/assets/{controlplane-Dyyj2Irb.js → controlplane-CyfwUlFA.js} +2 -2
  249. package/dashboard/dist/assets/{controlplane-Dyyj2Irb.js.map → controlplane-CyfwUlFA.js.map} +1 -1
  250. package/dashboard/dist/assets/escalation-columns-BJPTNmLW.js +2 -0
  251. package/dashboard/dist/assets/escalation-columns-BJPTNmLW.js.map +1 -0
  252. package/dashboard/dist/assets/index-3gbd5neL.js +67 -0
  253. package/dashboard/dist/assets/index-3gbd5neL.js.map +1 -0
  254. package/dashboard/dist/assets/index-BAAVTyZ-.js +2 -0
  255. package/dashboard/dist/assets/{index-DL83W7Gu.js.map → index-BAAVTyZ-.js.map} +1 -1
  256. package/dashboard/dist/assets/{index-CsKiRyhy.js → index-BC6Jenlo.js} +2 -2
  257. package/dashboard/dist/assets/{index-CsKiRyhy.js.map → index-BC6Jenlo.js.map} +1 -1
  258. package/dashboard/dist/assets/index-C7KHqOTQ.js +2 -0
  259. package/dashboard/dist/assets/{index-D7ESqn22.js.map → index-C7KHqOTQ.js.map} +1 -1
  260. package/dashboard/dist/assets/index-CDrqqbSR.js +3 -0
  261. package/dashboard/dist/assets/index-CDrqqbSR.js.map +1 -0
  262. package/dashboard/dist/assets/index-CVwzCZ43.js +2 -0
  263. package/dashboard/dist/assets/{index-DvxxrFBo.js.map → index-CVwzCZ43.js.map} +1 -1
  264. package/dashboard/dist/assets/index-CaGF6TCC.js +2 -0
  265. package/dashboard/dist/assets/index-CaGF6TCC.js.map +1 -0
  266. package/dashboard/dist/assets/index-ClVbfe4z.js +13 -0
  267. package/dashboard/dist/assets/index-ClVbfe4z.js.map +1 -0
  268. package/dashboard/dist/assets/{index-DWse7ERF.js → index-CuVkSmj5.js} +2 -2
  269. package/dashboard/dist/assets/{index-DWse7ERF.js.map → index-CuVkSmj5.js.map} +1 -1
  270. package/dashboard/dist/assets/{index-PcyGjmBm.js → index-DAuX_PlL.js} +2 -2
  271. package/dashboard/dist/assets/{index-PcyGjmBm.js.map → index-DAuX_PlL.js.map} +1 -1
  272. package/dashboard/dist/assets/{index-e2X-s0EQ.js → index-DBWS5QL8.js} +2 -2
  273. package/dashboard/dist/assets/{index-e2X-s0EQ.js.map → index-DBWS5QL8.js.map} +1 -1
  274. package/dashboard/dist/assets/index-DIWCI6HC.js +2 -0
  275. package/dashboard/dist/assets/{index-BNZknxFY.js.map → index-DIWCI6HC.js.map} +1 -1
  276. package/dashboard/dist/assets/{index-C-Xr2V3F.js → index-DZ8X_Gp4.js} +2 -2
  277. package/dashboard/dist/assets/{index-C-Xr2V3F.js.map → index-DZ8X_Gp4.js.map} +1 -1
  278. package/dashboard/dist/assets/index-Dh8MJl3L.css +1 -0
  279. package/dashboard/dist/assets/{knowledge-Coo6CKzo.js → knowledge-CqyLhUMg.js} +2 -2
  280. package/dashboard/dist/assets/{knowledge-Coo6CKzo.js.map → knowledge-CqyLhUMg.js.map} +1 -1
  281. package/dashboard/dist/assets/{mcp-Cz5eFnP_.js → mcp-Cvu6bFYH.js} +2 -2
  282. package/dashboard/dist/assets/{mcp-Cz5eFnP_.js.map → mcp-Cvu6bFYH.js.map} +1 -1
  283. package/dashboard/dist/assets/{mcp-query-BtnuO4LF.js → mcp-query-qC6A3e9l.js} +2 -2
  284. package/dashboard/dist/assets/{mcp-query-BtnuO4LF.js.map → mcp-query-qC6A3e9l.js.map} +1 -1
  285. package/dashboard/dist/assets/metadata-display-COo3mMCr.js +2 -0
  286. package/dashboard/dist/assets/metadata-display-COo3mMCr.js.map +1 -0
  287. package/dashboard/dist/assets/{personas-C2-LgpHQ.js → personas-BKN_lJuV.js} +2 -2
  288. package/dashboard/dist/assets/{personas-C2-LgpHQ.js.map → personas-BKN_lJuV.js.map} +1 -1
  289. package/dashboard/dist/assets/{pipelines-TuXQvUA-.js → pipelines-BldIfv85.js} +2 -2
  290. package/dashboard/dist/assets/{pipelines-TuXQvUA-.js.map → pipelines-BldIfv85.js.map} +1 -1
  291. package/dashboard/dist/assets/{tasks-OUzpu__z.js → tasks-B-Uay8uL.js} +2 -2
  292. package/dashboard/dist/assets/{tasks-OUzpu__z.js.map → tasks-B-Uay8uL.js.map} +1 -1
  293. package/dashboard/dist/assets/{topics-B8bdrBaW.js → topics-438EQogt.js} +2 -2
  294. package/dashboard/dist/assets/{topics-B8bdrBaW.js.map → topics-438EQogt.js.map} +1 -1
  295. package/dashboard/dist/assets/useContainerWidth-DSLp1gEm.js +2 -0
  296. package/dashboard/dist/assets/useContainerWidth-DSLp1gEm.js.map +1 -0
  297. package/dashboard/dist/assets/{useDebouncedValue-Cp5ZOtVE.js → useDebouncedValue-Cw8hYZ8y.js} +2 -2
  298. package/dashboard/dist/assets/{useDebouncedValue-Cp5ZOtVE.js.map → useDebouncedValue-Cw8hYZ8y.js.map} +1 -1
  299. package/dashboard/dist/assets/{useNamespace-DtQe3wZ5.js → useNamespace-D1218GQ8.js} +2 -2
  300. package/dashboard/dist/assets/{useNamespace-DtQe3wZ5.js.map → useNamespace-D1218GQ8.js.map} +1 -1
  301. package/dashboard/dist/assets/{useYamlActivityEvents-CS22c15X.js → useYamlActivityEvents-BAQf_y_U.js} +2 -2
  302. package/dashboard/dist/assets/{useYamlActivityEvents-CS22c15X.js.map → useYamlActivityEvents-BAQf_y_U.js.map} +1 -1
  303. package/dashboard/dist/assets/{vendor-icons-DeBdvyKJ.js → vendor-icons-B7OcUM6b.js} +2 -2
  304. package/dashboard/dist/assets/{vendor-icons-DeBdvyKJ.js.map → vendor-icons-B7OcUM6b.js.map} +1 -1
  305. package/dashboard/dist/assets/{yaml-workflows-HQIki3hI.js → yaml-workflows-CN01gEB0.js} +2 -2
  306. package/dashboard/dist/assets/{yaml-workflows-HQIki3hI.js.map → yaml-workflows-CN01gEB0.js.map} +1 -1
  307. package/dashboard/dist/index.html +3 -3
  308. package/docs/accumulator.md +113 -0
  309. package/docs/api/http/escalations.md +89 -0
  310. package/docs/api/http/roles.md +1 -0
  311. package/docs/api/http/workflows.md +28 -1
  312. package/docs/api/mcp/admin.md +40 -4
  313. package/docs/api/sdk/escalations.md +91 -0
  314. package/docs/api/sdk/roles.md +2 -0
  315. package/docs/architecture.md +1 -1
  316. package/docs/code-owned-configuration.md +3 -2
  317. package/docs/dashboard.md +11 -5
  318. package/docs/hitl/design.md +1 -1
  319. package/docs/hitl/escalation.md +37 -1
  320. package/docs/hitl/form.md +12 -7
  321. package/docs/hitl/invoke-form.md +10 -3
  322. package/docs/hitl/lookups.md +21 -0
  323. package/docs/hitl/pinned-views.md +4 -0
  324. package/docs/hitl/portal.md +97 -0
  325. package/docs/hitl/resolution.md +41 -0
  326. package/docs/hitl/x-lt-embed.md +1 -1
  327. package/docs/hitl/x-lt-invoke.md +95 -0
  328. package/docs/hitl/x-lt-list-schema.md +3 -1
  329. package/docs/hitl/x-lt-validation.md +50 -3
  330. package/docs/hitl/x-lt-widget.md +22 -0
  331. package/docs/hitl-guide.md +12 -2
  332. package/docs/scan-codes.md +15 -2
  333. package/docs/sdk.md +1 -1
  334. package/docs/workflows.md +2 -2
  335. package/package.json +4 -2
  336. package/dashboard/dist/assets/AgentsPage-D77JeViQ.js +0 -2
  337. package/dashboard/dist/assets/AvailableEscalationsPage-CqM_MOMy.js +0 -2
  338. package/dashboard/dist/assets/AvailableEscalationsPage-CqM_MOMy.js.map +0 -1
  339. package/dashboard/dist/assets/BulkAssignModal-BXiJnlqt.js +0 -2
  340. package/dashboard/dist/assets/CapabilitiesPage-D9TC2iKy.js +0 -2
  341. package/dashboard/dist/assets/DataTable-7C7riavf.js +0 -2
  342. package/dashboard/dist/assets/DataTable-7C7riavf.js.map +0 -1
  343. package/dashboard/dist/assets/EntityTimelinePanel-1lT3jkCM.js +0 -2
  344. package/dashboard/dist/assets/EscalationListView-uuZRMSLB.js +0 -2
  345. package/dashboard/dist/assets/EscalationListView-uuZRMSLB.js.map +0 -1
  346. package/dashboard/dist/assets/GraphInvokePage-DV7Y0fe2.js +0 -2
  347. package/dashboard/dist/assets/HomePage-G785SWcW.js +0 -2
  348. package/dashboard/dist/assets/ListToolbar-zPVYPg3W.js +0 -2
  349. package/dashboard/dist/assets/McpQueryPage-CNSNMagY.js +0 -2
  350. package/dashboard/dist/assets/McpRunsPage-B6rb5QBf.js +0 -2
  351. package/dashboard/dist/assets/OperationsPage-Dxk1fAMg.js +0 -3
  352. package/dashboard/dist/assets/OperationsPage-Dxk1fAMg.js.map +0 -1
  353. package/dashboard/dist/assets/OperatorDashboard-DBOscDnf.js +0 -2
  354. package/dashboard/dist/assets/ProcessesListPage-5NnysKFC.js +0 -2
  355. package/dashboard/dist/assets/ResolverForm-Dy0yirtP.js +0 -2
  356. package/dashboard/dist/assets/ResolverForm-Dy0yirtP.js.map +0 -1
  357. package/dashboard/dist/assets/RoleDetailPage-C_LIoe1j.js +0 -8
  358. package/dashboard/dist/assets/RoleDetailPage-C_LIoe1j.js.map +0 -1
  359. package/dashboard/dist/assets/RunAsSelector-BwZTJ4Yj.js +0 -2
  360. package/dashboard/dist/assets/ScanCodesPage-FiYIYB-m.js +0 -2
  361. package/dashboard/dist/assets/ScanStationPage-8CdOtbCD.js +0 -2
  362. package/dashboard/dist/assets/TasksListPage-BQNaSzCn.js +0 -2
  363. package/dashboard/dist/assets/ToolTestPanel-DvuLFWqQ.js +0 -2
  364. package/dashboard/dist/assets/TopicsPage-h-oyTeEJ.js +0 -2
  365. package/dashboard/dist/assets/WorkflowsDashboard-B0r2lQXk.js +0 -2
  366. package/dashboard/dist/assets/escalation-columns-DIigeTOK.js +0 -2
  367. package/dashboard/dist/assets/escalation-columns-DIigeTOK.js.map +0 -1
  368. package/dashboard/dist/assets/index-BMlQYOE1.js +0 -67
  369. package/dashboard/dist/assets/index-BMlQYOE1.js.map +0 -1
  370. package/dashboard/dist/assets/index-BNZknxFY.js +0 -2
  371. package/dashboard/dist/assets/index-Bpvfr4OW.css +0 -1
  372. package/dashboard/dist/assets/index-CegPUKpc.js +0 -3
  373. package/dashboard/dist/assets/index-CegPUKpc.js.map +0 -1
  374. package/dashboard/dist/assets/index-D7ESqn22.js +0 -2
  375. package/dashboard/dist/assets/index-DL83W7Gu.js +0 -2
  376. package/dashboard/dist/assets/index-DPLssnMW.js +0 -6
  377. package/dashboard/dist/assets/index-DPLssnMW.js.map +0 -1
  378. package/dashboard/dist/assets/index-DoETPlJP.js +0 -11
  379. package/dashboard/dist/assets/index-DoETPlJP.js.map +0 -1
  380. package/dashboard/dist/assets/index-DvxxrFBo.js +0 -2
  381. package/dashboard/dist/assets/metadata-display--TzK0REC.js +0 -2
  382. package/dashboard/dist/assets/metadata-display--TzK0REC.js.map +0 -1
  383. package/dashboard/dist/assets/resolver-payload-C1dXB3n6.js +0 -2
  384. package/dashboard/dist/assets/resolver-payload-C1dXB3n6.js.map +0 -1
  385. package/dashboard/dist/assets/seed-form-json-DvPsISxD.js +0 -2
  386. package/dashboard/dist/assets/seed-form-json-DvPsISxD.js.map +0 -1
  387. package/docs/compilation.md +0 -152
  388. package/docs/compiler.md +0 -311
  389. package/docs/contributing.md +0 -56
  390. package/docs/design-principles.md +0 -244
  391. package/docs/schema-exchange.md +0 -173
  392. package/docs/self-test.md +0 -106
  393. package/docs/story.md +0 -184
@@ -1,173 +0,0 @@
1
- # Surfacing Any API
2
-
3
- ## The Gap Between Plumbing and Domain
4
-
5
- Long Tail ships with built-in MCP servers. Browser automation for navigating web interfaces. File storage for persisting artifacts. Vision for analyzing images. Knowledge for accumulating structured state. An admin server for the platform to look inward — list its own workflows, manage its own configuration, query its own execution history.
6
-
7
- These are plumbing. They solve cross-cutting problems that every deployment shares. But they don't know anything about your domain. They don't know what Epic's FHIR API returns for a `ServiceRequest` resource. They don't know the shape of Stripe's charge response. They don't know that your internal inventory service returns `{ items: [...], cursor: string }` and paginates with cursor-based tokens.
8
-
9
- Traditionally, closing this gap meant writing an MCP server. Define the tools. Map each one to an API call. Handle serialization, error cases, pagination. Register the server. Tag it. Write compile hints so the builder knows how to wire it. A week of engineering per external service.
10
-
11
- The schema-exchange primitive eliminates that week.
12
-
13
- ---
14
-
15
- ## The Principle: Endpoint + Schema
16
-
17
- The `exchange` tool doesn't know HTTP from Playwright. It knows three things: where to send data, what the data should look like going out, and what it should look like coming back.
18
-
19
- ```
20
- endpoint: where
21
- request_schema: what leaves
22
- response_schema: what returns
23
- ```
24
-
25
- Transport is an implementation detail. Today it's Node.js `fetch`. Tomorrow it could be a browser automation step that fills a form, submits, and scrapes the result. Or a gRPC call. Or a SOAP envelope. The consumer doesn't know and doesn't care.
26
-
27
- What the consumer gets is a contract. The request is validated before it leaves the system. The response is validated when it arrives. If either validation fails, the failure is structural and specific — "the response is missing the `resourceType` field" — not a vague 500 error three layers deep.
28
-
29
- This is the difference between a fetch call and a schema-driven exchange. A fetch call succeeds or fails. An exchange succeeds, fails, or *detects drift* — the call succeeded but the shape changed. That third state is what makes API integrations maintainable over time.
30
-
31
- ---
32
-
33
- ## From Spec to Toolset
34
-
35
- Open the Pipeline Designer. Choose Build mode. Paste:
36
-
37
- ```
38
- Stripe Charges API (base: https://api.stripe.com/v1)
39
-
40
- POST /charges
41
- Headers: Authorization: Bearer {api_key}
42
- Request: { amount: number, currency: string, source: string, description?: string }
43
- Response: { id: string, amount: number, currency: string, status: string, created: number }
44
-
45
- GET /charges/{id}
46
- Headers: Authorization: Bearer {api_key}
47
- Response: { id: string, amount: number, currency: string, status: string, created: number }
48
- ```
49
-
50
- The planner decomposes this into two leaf tools. The builder discovers the `exchange` tool in its inventory, reads the compile hints, and constructs each workflow:
51
-
52
- - **`create_charge`** — trigger accepts `api_key`, `amount`, `currency`, `source`. Worker calls `exchange` with the request schema embedded as a static value. Response schema validates the charge object. If Stripe changes the response shape, `validated` flips to `false` and the error names the exact field that changed.
53
-
54
- - **`get_charge`** — trigger accepts `api_key`, `charge_id`. Worker calls `exchange` with the charge ID interpolated into the URL. Response schema validates the same shape.
55
-
56
- Both deploy under a server namespace: `stripe`. They're compiled, versioned, invocable. They have typed inputs and outputs. They compose into larger workflows — a refund pipeline, an invoicing process, a reconciliation job.
57
-
58
- The engineer didn't write an MCP server. They didn't write any code. They pasted two endpoint descriptions and got two schema-validated tools that will catch API drift the moment Stripe changes a field.
59
-
60
- ---
61
-
62
- ## Schema Drift: The Silent Killer
63
-
64
- APIs change. Fields get renamed. Required properties appear. Types shift from strings to objects. These changes are rarely announced in time, rarely caught by tests that don't run against live endpoints, and rarely surfaced until a downstream consumer produces wrong results.
65
-
66
- The response schema embedded in each compiled tool is a contract. It doesn't enforce — it detects. When the contract breaks, the tool reports exactly what changed:
67
-
68
- ```
69
- response: (root): must have required property 'source' ({"missingProperty":"source"})
70
- ```
71
-
72
- Not "API error." Not "unexpected response." The structural diff, in human-readable text, identifying the exact field.
73
-
74
- Schedule the tool on cron against a staging or dev endpoint. Every midnight, it calls the API and validates the response. If the schema matches, nothing happens. If it doesn't, the system knows before production does. The team fixes the tool, updates the schema, redeploys. No customer impact.
75
-
76
- This is what makes compiled API tools self-maintaining. The schema is both the integration logic and the regression test. They're the same artifact.
77
-
78
- ---
79
-
80
- ## The Request Gate
81
-
82
- Schema enforcement works in both directions. The request schema validates outbound data before it leaves the system. If a caller passes `{ amount: "fifty" }` to `create_charge`, the exchange tool rejects it immediately:
83
-
84
- ```
85
- request: /amount: must be number ({"type":"number"})
86
- ```
87
-
88
- The request never hits Stripe. The error is instant, specific, and local. No network round-trip. No API rate limit consumed. No partial state created on the remote service.
89
-
90
- This matters in compiled workflows where one tool's output feeds another's input. A data-mapping error in step 3 of a 7-step pipeline is caught at step 3, not when Stripe returns a 400 in step 5. The failure is close to the cause.
91
-
92
- ---
93
-
94
- ## Growing a Toolset
95
-
96
- The Pipeline Designer organizes tools into sets — collections of related tools that share a namespace and evolve together. You start with two Stripe endpoints. Next week you add `list_charges` and `create_refund`. The following month, `get_balance` and `list_payouts`.
97
-
98
- Each addition goes through the same flow: paste the spec, the planner builds the tool, it deploys into the existing namespace. The server version increments. All tools in the namespace are redeployed together. Active workflows don't stop — the new version activates atomically.
99
-
100
- The set is the workbench. It preserves the full specification history — every endpoint description that was pasted, in order. It's the source of truth for what the toolset covers and how it evolved.
101
-
102
- Over time, the set becomes a complete API surface. Not hand-written bindings. Not auto-generated client code that drifts from the spec. Compiled tools with embedded schemas that validate on every call.
103
-
104
- ---
105
-
106
- ## Composition: Tools Built From Tools
107
-
108
- Individual API tools are building blocks. A compiled tool that calls `create_charge` can be composed with one that calls `get_customer` and one that calls `send_receipt`. The composition is itself a compiled tool — a pipeline that executes the three steps in sequence, wiring the charge ID from step 1 to the receipt in step 3.
109
-
110
- The schema exchange is invisible at the composition level. The composer sees tools with typed inputs and outputs. It doesn't know — or need to know — that these tools validate their data against schemas before every call. The validation is infrastructure, not application logic.
111
-
112
- This is where the Epic story begins. The FHIR endpoints are individual tools — `get_patient`, `search_coverage`, `create_task`. Each validates its request and response. Linda's intake process composes them into a pipeline that encodes her institutional knowledge: which checks to run, in what order, with what branching logic. The individual tools handle the API contract. The composition handles the business process. Neither knows about the other's concerns.
113
-
114
- ---
115
-
116
- ## What This Replaces
117
-
118
- Without schema-driven exchange, wrapping an external API requires:
119
-
120
- 1. Writing an MCP server (TypeScript, tool definitions, error handling)
121
- 2. Registering it with the platform
122
- 3. Writing compile hints so the builder knows how to use it
123
- 4. Maintaining it when the API changes
124
- 5. Repeating for every external service
125
-
126
- With schema-driven exchange, wrapping an external API requires:
127
-
128
- 1. Pasting the endpoint specs into the Pipeline Designer
129
-
130
- The MCP server is the `exchange` tool. The compile hints are on the `exchange` tool. The schema validation is in the `exchange` tool. The only thing that changes per API is the spec the engineer pastes — the endpoints, the schemas, the auth pattern.
131
-
132
- This is what makes the Epic story practical. The engineering team doesn't spend a week writing a FHIR MCP server. They paste the endpoint descriptions and get compiled tools that speak FHIR with schema enforcement. The week they would have spent on plumbing is spent with Linda instead, capturing the institutional knowledge that makes the tools valuable.
133
-
134
- ---
135
-
136
- ## The Reflexive Case
137
-
138
- Long Tail wraps its own API using the same primitive. The platform's REST endpoints — login, list servers, list workflows — are compiled tools in the `longtailapi` namespace. They validate their own response shapes. They detect drift in their own API surface.
139
-
140
- This isn't a special case. It's a proof point. The same `exchange` tool that wraps Epic's FHIR server wraps Long Tail's own REST API. The same schema enforcement that catches Stripe's field changes catches Long Tail's own field changes. The platform doesn't have a privileged self-knowledge path. It discovers its own capabilities the same way it discovers any external service — through endpoints and schemas.
141
-
142
- The admin server (`long-tail-admin`) still exists for operations that require internal access — managing workflows, modifying configuration, operations that go beyond data exchange. But for anything that's "call an endpoint, validate the response, return the data" — the schema exchange primitive is the universal answer. Internal or external. FHIR or REST. Stripe or self.
143
-
144
- ---
145
-
146
- ## Identity: The Third Pillar
147
-
148
- Endpoint and schema handle the data contract. The third pillar — identity — handles who's calling.
149
-
150
- The `exchange` tool accepts an optional `credential_provider` field. When set, the tool resolves authentication from the platform's connection store using the calling principal's identity. No token input. No manual header wiring. No `get_access_token` step in the workflow.
151
-
152
- ```
153
- credential_provider: "stripe"
154
- ```
155
-
156
- That single field means: look up the calling user's Stripe credentials from the encrypted connection store, auto-refresh if expired, inject into the request headers. The credential never appears in the workflow state, the execution trace, or the YAML. It's resolved at the last mile — inside the tool execution, after the HotMesh event log has already been written.
157
-
158
- This is how the Epic story works in practice. The engineering team registers their SMART on FHIR credentials as a connection. Every compiled FHIR tool specifies `credential_provider: "epic"`. When the tool runs for Customer A, it gets Customer A's token. When it runs for Customer B, it gets Customer B's. Same compiled tool. Different identities. The routing is invisible.
159
-
160
- Three auth patterns, one tool:
161
- - **credential_provider** — resolve from the connection store. Fresh token, auto-refresh, per-principal. The default for production.
162
- - **Ephemeral references** — opaque `eph:v1:*` strings in headers, exchanged at the last mile. For workflows that need human-provided credentials with TTL.
163
- - **Raw headers** — pass `Authorization: Bearer {token}` directly. For testing, one-off calls, or systems where the caller manages tokens externally.
164
-
165
- ---
166
-
167
- ## What Remains
168
-
169
- The schema-exchange tool is plumbing. It doesn't know about healthcare or payments or logistics. It knows about endpoints, schemas, identity, and whether the data matched.
170
-
171
- Everything above it — the domain knowledge, the business logic, the institutional expertise — comes from the people who use it. Linda's referral intake rules. Maria's document requirements. The Stripe integration team's charge flow. The ops team's self-monitoring pipeline.
172
-
173
- The platform's job is to make that knowledge executable, composable, and self-testing. The schema exchange is the foundation layer — endpoint, schema, identity. The three pillars that make "paste an API spec, get a validated tool with automatic auth" possible. Everything else builds on top of it. The tools are the building. The exchange is the foundation.
package/docs/self-test.md DELETED
@@ -1,106 +0,0 @@
1
- # The Self-Test: Long Tail Wraps Its Own API
2
-
3
- ## The Tool That Wanted to Extend Itself
4
-
5
- Long Tail ships with a schema-exchange tool — a baseline capability for exchanging data with any external service under schema enforcement. The tool validates requests before sending and responses after receiving. It doesn't know HTTP from Playwright. It knows endpoints, schemas, and whether the data matched.
6
-
7
- This is the story of what happened when someone pointed that tool at Long Tail's own API.
8
-
9
- ---
10
-
11
- ## The Starting Point
12
-
13
- Long Tail has a REST API. It has endpoints for authentication, for listing registered MCP servers, for querying compiled workflows. Every deployment uses these endpoints — the dashboard calls them, integrations call them, crons call them.
14
-
15
- But nobody had ever formalized what those endpoints return. The shapes were implicit — TypeScript interfaces in the codebase, but nothing the runtime could assert against. If a deployment changed a response shape, you found out when the dashboard broke. Or when a customer's integration broke. Or, worst case, you didn't find out at all because the consumer silently swallowed the new shape and produced wrong results downstream.
16
-
17
- The schema-exchange tool exists precisely for this problem. It doesn't care whether the endpoint is Epic's FHIR server or Long Tail's own API. The principle is the same: endpoint + schema + validated exchange.
18
-
19
- ---
20
-
21
- ## Wrapping the API
22
-
23
- An engineer opens Plan Mode in the dashboard and pastes three endpoint specifications:
24
-
25
- ```
26
- Long Tail API (base: http://localhost:3000/api)
27
-
28
- POST /auth/login
29
- Request: { username: string, password: string }
30
- Response: { token: string, user: { id: string, external_id: string, display_name: string, roles: [{ role: string, type: string }] } }
31
-
32
- GET /mcp/servers (requires Bearer token)
33
- Response: { servers: [{ id: string, name: string, description: string, tags: string[], status: string, tool_manifest: [{ name: string, description: string }] }] }
34
-
35
- GET /yaml-workflows (requires Bearer token)
36
- Response: { workflows: [{ id: string, name: string, app_id: string, status: string, graph_topic: string, tags: string[] }], total: number }
37
- ```
38
-
39
- The planner decomposes this into three leaf workflows. The builder discovers the `exchange` tool in the inventory, reads the compile hints, and constructs each workflow as a trigger → exchange → output DAG with embedded schemas.
40
-
41
- All three deploy under a server namespace: `longtailapi`.
42
-
43
- ---
44
-
45
- ## What the Compiled Tools Do
46
-
47
- **`login`** — Takes a username and password. Validates the request body (both strings, both required) against the request schema before sending. Calls POST /auth/login. Validates the response (must have `token` string and `user` object with required fields). Returns the token and user profile.
48
-
49
- If someone changes the login response — adds a field, removes `display_name`, changes `roles` from an array to a string — the schema validation catches it. `validated: false`, with a human-readable error explaining exactly what changed.
50
-
51
- **`list_servers`** — Takes a bearer token. Calls GET /mcp/servers. Validates the response (must be an object with a `servers` array, each server must have `id`, `name`, `tags`). Returns the server list.
52
-
53
- This tool can answer the question: "does the schema-exchange server exist?" If `long-tail-schema-exchange` isn't in the returned list, the tool that's asking the question knows its own infrastructure is broken. The snake eating its own tail.
54
-
55
- **`list_workflows`** — Takes a bearer token. Calls GET /yaml-workflows. Validates the response (must be an object with `workflows` array and `total` number). Returns the compiled tool inventory.
56
-
57
- This tool can check whether the `longtailapi` tools themselves are deployed and active. It can verify that the very workflows it belongs to are in the list. Self-referential validation — the compiled tool confirms its own existence.
58
-
59
- ---
60
-
61
- ## The Composition: Self-Health-Check
62
-
63
- The three leaf tools compose into a single workflow: `self_health_check`.
64
-
65
- 1. **Login** — authenticate with a service account
66
- 2. **List servers** — verify all expected MCP servers are registered
67
- 3. **List workflows** — verify all expected compiled tools are deployed
68
-
69
- Each step validates its response schema. If any step fails validation, the workflow knows exactly what changed — not "the API is down" but "the `servers` response is missing the `tags` field on server objects."
70
-
71
- Schedule it on cron. Every midnight, the platform checks its own API surface against the schemas it captured when the tools were compiled. Schema drift is caught within 24 hours, automatically, without a human looking at anything.
72
-
73
- ---
74
-
75
- ## Why This Matters
76
-
77
- This isn't a testing framework. It's the same schema-exchange primitive that wraps Epic's FHIR endpoints or Stripe's payment API or any other external service. The fact that it can wrap Long Tail's own API is a proof point, not a special case.
78
-
79
- The proof point is:
80
-
81
- 1. **Any API surface can be formalized as compiled tools.** Paste the endpoint specs. Get schema-validated, cron-testable tools. No MCP server to hand-write. No integration code. The schema is the integration.
82
-
83
- 2. **Schema drift detection is automatic.** The response_schema embedded in each compiled tool is the contract. When the contract breaks, the tool reports exactly what changed. Not "500 error" — the actual structural diff.
84
-
85
- 3. **The tools compose.** Login → use token → check servers → check workflows. Each step is independently testable, independently schedulable, independently versionable. But together they form a health check that validates the entire platform surface.
86
-
87
- 4. **The platform can extend itself.** The schema-exchange tool is a baseline capability. The compiled API tools are built from it. The health check composes them. Every layer uses the same machinery. New endpoints are absorbed the same way — paste, compile, deploy, schedule.
88
-
89
- This is the starting point the Epic story describes: "The engineering team registers a custom MCP server that wraps the FHIR endpoints their referral workflows need." Except here, the engineering team is us, the FHIR endpoints are our own API, and the custom MCP server assembled itself from pasted specs and a schema-exchange primitive.
90
-
91
- The SOPs come next. But the plumbing works.
92
-
93
- ---
94
-
95
- ## The Integration Test
96
-
97
- The file `tests/integration/schema-exchange.test.ts` proves this end-to-end:
98
-
99
- 1. Calls `exchange` to login (POST /auth/login with request + response schema)
100
- 2. Calls `exchange` to list servers (GET /mcp/servers with response schema)
101
- 3. Asserts the schema-exchange server exists in the response
102
- 4. Calls `exchange` to list workflows (GET /yaml-workflows with response schema)
103
- 5. Deliberately uses a wrong schema to prove drift detection
104
- 6. Deliberately sends a malformed request to prove pre-send rejection
105
-
106
- If any assertion fails, the schema-exchange tool isn't doing its job. If they all pass, the platform can wrap any API — including its own.
package/docs/story.md DELETED
@@ -1,184 +0,0 @@
1
- # Long Tail — The Story
2
-
3
- ## What It Feels Like
4
-
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
-
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
-
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
-
11
- ---
12
-
13
- ## Three People, One Platform
14
-
15
- ### Maya — Product Manager
16
-
17
- Maya doesn't write code. She writes requirements, talks to customers, and needs things to happen across systems she doesn't control.
18
-
19
- **Her journey:**
20
-
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
-
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
-
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
-
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
-
29
- **What Maya sees:** Agents, processes, escalations. She lives in outcomes.
30
-
31
- ### Dev — Product Engineer
32
-
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
-
35
- **His journey:**
36
-
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
-
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
-
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
-
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
-
45
- **What Dev sees:** Servers & tools, workflows, pipeline designer, execution traces. He lives in build mode but watches the outcomes.
46
-
47
- ### Sam — Platform Engineer
48
-
49
- Sam owns the infrastructure. She thinks in terms of reliability, observability, and cost.
50
-
51
- **Her journey:**
52
-
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
-
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
-
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
-
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
-
61
- **What Sam sees:** Task queues, execution metrics, knowledge usage, DB maintenance, agent health. She lives in the system view.
62
-
63
- ---
64
-
65
- ## The Surface
66
-
67
- ### Home: What's Alive
68
-
69
- The home page isn't a dashboard of charts. It's a **living view of work in motion**:
70
-
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
74
-
75
- No distinction between durable and compiled. No mention of YAML or TypeScript. Just: work happening, knowledge growing, agents running.
76
-
77
- ### Agents: Who's Working
78
-
79
- Each agent is a card:
80
-
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
- ```
94
-
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.
96
-
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.
98
-
99
- ### Capabilities: What's Possible
100
-
101
- A single searchable view of every activity — not grouped by server or workflow, but by **what it does**:
102
-
103
- ```
104
- Communication
105
- gmail_search · gmail_read · gmail_draft · send_sms · notify
106
-
107
- Analysis
108
- analyze_image · describe_image · translate · sentiment
109
-
110
- Data
111
- store_knowledge · search_knowledge · schema_exchange · http_fetch
112
-
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.
118
-
119
- ### Orchestrate: How It Works
120
-
121
- The orchestration backstage — the same durable workflow, offered two ways:
122
-
123
- - **Procedural** — readable, durable TypeScript. Configure it, invoke it, watch its executions. Emulated atop the graph: cheap to maintain, heavier to run.
124
- - **Graph** — that same workflow as a compiled, deterministic DAG. Same guarantees, roughly 3x faster, less to read. Run or schedule it; the router discovers it and pulls the work when it's healthy to.
125
-
126
- Every procedural pattern has a graph equivalent and the reverse, so the choice is readability or speed — never durability, escalation, or transactional safety. Engineers move freely between them: execution traces, durable cycle replay, swimlane timelines. Nothing is hidden. The technical depth is the product.
127
-
128
- **Design** sits alongside as an optional add-on. With an Anthropic key, the Designer turns a description — or a recorded run of MCP tools — into a graph flow. Without a key, procedural and graph orchestration stand on their own, no tradeoff.
129
-
130
- ### Storage: What's Remembered
131
-
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.
136
-
137
- ---
138
-
139
- ## The Event Spine
140
-
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.
142
-
143
- But the real power is **subscription**. An agent can trigger on any event:
144
-
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
149
-
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.**
151
-
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.
153
-
154
- And though orchestration *feels* top-down — you invoke a flow, it drives the steps — execution is pull-based underneath. A flexible fleet of routers consumes work as a quorum, adapting their draw to find the healthiest throughput the database can sustain. That's how back-pressure is solved without anyone configuring it. NATS is the in-memory adjunct: it filters millions of events down to the ones that matter, and idempotent request handling guarantees exactly one workflow runs in response to each. Choreography this rich starts to look like orchestration — and orchestration, underneath, is just disciplined choreography.
155
-
156
- ---
157
-
158
- ## The Transition
159
-
160
- The beautiful thing about this system is that it doesn't require a "big bang." It's additive:
161
-
162
- **Week 1:** An engineer adds activities and a workflow. Old school. Works great.
163
-
164
- **Week 2:** Someone discovers the Designer. Compiles a working run into a graph flow. Faster, no tokens.
165
-
166
- **Week 3:** A product manager creates their first agent from a conversation. It runs on a schedule.
167
-
168
- **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.
169
-
170
- **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.
171
-
172
- **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 flow they can run, inspect, and modify. The knowledge is alive.
173
-
174
- **The turn:** none of this was built for AI — it was built for a human-only team. But every activity was authored as an MCP tool: schema-backed with Zod, discoverable, composable. Every compiled flow is itself an MCP server. So the same reflexive API the dashboard calls is open to an LLM under the same RBAC — a service account with exactly the access a person has. Claiming and resolving an escalation is just another tool call. The human-only core becomes the seed: humans first, then humans and AI sharing one set of tools, and eventually work that resolves itself. Nothing about the plumbing changes — only who pulls the next task.
175
-
176
- ---
177
-
178
- ## The Name
179
-
180
- 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.
181
-
182
- 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.
183
-
184
- That's the story. Activities are permanent. Agents compose them. Humans guide the evolution. The system accumulates.