@hotmeshio/long-tail 0.1.13 → 0.1.15
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.
- package/README.md +15 -0
- package/build/api/escalations/bulk.d.ts +78 -0
- package/build/api/escalations/bulk.js +279 -0
- package/build/api/escalations/claim.d.ts +30 -0
- package/build/api/escalations/claim.js +121 -0
- package/build/api/escalations/create.d.ts +29 -0
- package/build/api/escalations/create.js +101 -0
- package/build/api/escalations/helpers.d.ts +10 -0
- package/build/api/escalations/helpers.js +80 -0
- package/build/api/escalations/index.d.ts +6 -0
- package/build/api/escalations/index.js +26 -0
- package/build/api/escalations/list.d.ts +75 -0
- package/build/api/escalations/list.js +170 -0
- package/build/api/escalations/resolve.d.ts +18 -0
- package/build/api/escalations/resolve.js +243 -0
- package/build/api/escalations/single.d.ts +37 -0
- package/build/api/escalations/single.js +123 -0
- package/build/api/files.d.ts +16 -0
- package/build/api/files.js +61 -0
- package/build/api/knowledge.d.ts +36 -0
- package/build/api/knowledge.js +112 -0
- package/build/api/mcp/index.d.ts +2 -0
- package/build/api/mcp/index.js +16 -0
- package/build/api/{mcp.d.ts → mcp/servers.d.ts} +1 -33
- package/build/api/{mcp.js → mcp/servers.js} +4 -65
- package/build/api/mcp/tools.d.ts +33 -0
- package/build/api/mcp/tools.js +64 -0
- package/build/api/mcp-runs.d.ts +2 -0
- package/build/api/mcp-runs.js +2 -0
- package/build/api/settings.js +9 -1
- package/build/api/workflow-sets.d.ts +11 -0
- package/build/api/workflow-sets.js +62 -0
- package/build/api/workflows/config.d.ts +64 -0
- package/build/api/workflows/config.js +142 -0
- package/build/api/workflows/discovery.d.ts +29 -0
- package/build/api/workflows/discovery.js +153 -0
- package/build/api/workflows/index.d.ts +3 -0
- package/build/api/workflows/index.js +18 -0
- package/build/api/workflows/invocation.d.ts +67 -0
- package/build/api/workflows/invocation.js +188 -0
- package/build/api/yaml-workflows/cron.d.ts +39 -0
- package/build/api/yaml-workflows/cron.js +127 -0
- package/build/api/{yaml-workflows.d.ts → yaml-workflows/crud.d.ts} +22 -137
- package/build/api/{yaml-workflows.js → yaml-workflows/crud.js} +86 -358
- package/build/api/yaml-workflows/deploy.d.ts +71 -0
- package/build/api/yaml-workflows/deploy.js +223 -0
- package/build/api/yaml-workflows/helpers.d.ts +2 -0
- package/build/api/yaml-workflows/helpers.js +8 -0
- package/build/api/yaml-workflows/index.d.ts +4 -0
- package/build/api/yaml-workflows/index.js +27 -0
- package/build/api/yaml-workflows/versions.d.ts +43 -0
- package/build/api/yaml-workflows/versions.js +124 -0
- package/build/bin/ltc.d.ts +2 -0
- package/build/bin/ltc.js +220 -0
- package/build/examples/seed-data.d.ts +55 -0
- package/build/examples/seed-data.js +161 -0
- package/build/examples/seed.js +7 -164
- package/build/lib/cli/auth.d.ts +23 -0
- package/build/lib/cli/auth.js +167 -0
- package/build/lib/cli/client.d.ts +6 -0
- package/build/lib/cli/client.js +31 -0
- package/build/lib/cli/commands/escalations.d.ts +19 -0
- package/build/lib/cli/commands/escalations.js +69 -0
- package/build/lib/cli/commands/knowledge.d.ts +18 -0
- package/build/lib/cli/commands/knowledge.js +87 -0
- package/build/lib/cli/commands/mcp.d.ts +8 -0
- package/build/lib/cli/commands/mcp.js +33 -0
- package/build/lib/cli/commands/pipelines.d.ts +16 -0
- package/build/lib/cli/commands/pipelines.js +67 -0
- package/build/lib/cli/commands/status.d.ts +1 -0
- package/build/lib/cli/commands/status.js +28 -0
- package/build/lib/cli/commands/users.d.ts +7 -0
- package/build/lib/cli/commands/users.js +25 -0
- package/build/lib/cli/commands/workflows.d.ts +16 -0
- package/build/lib/cli/commands/workflows.js +104 -0
- package/build/lib/cli/compile.d.ts +2 -0
- package/build/lib/cli/compile.js +165 -0
- package/build/lib/cli/format.d.ts +23 -0
- package/build/lib/cli/format.js +94 -0
- package/build/lib/cli/init.d.ts +1 -0
- package/build/lib/cli/init.js +61 -0
- package/build/lib/cli/output.d.ts +27 -0
- package/build/lib/cli/output.js +126 -0
- package/build/lib/cli/scanner.d.ts +10 -0
- package/build/lib/cli/scanner.js +164 -0
- package/build/lib/cli/types.d.ts +16 -0
- package/build/lib/cli/types.js +2 -0
- package/build/lib/logger/index.d.ts +0 -9
- package/build/lib/logger/index.js +9 -4
- package/build/lib/storage/index.js +2 -2
- package/build/lib/storage/local.d.ts +15 -0
- package/build/lib/storage/local.js +63 -0
- package/build/lib/storage/mime.d.ts +4 -0
- package/build/lib/storage/mime.js +31 -0
- package/build/lib/storage/s3.d.ts +16 -0
- package/build/lib/storage/s3.js +70 -0
- package/build/lib/storage/types.d.ts +18 -0
- package/build/modules/utils.d.ts +73 -0
- package/build/modules/utils.js +84 -0
- package/build/routes/file-browser.d.ts +2 -0
- package/build/routes/file-browser.js +126 -0
- package/build/routes/files.js +25 -17
- package/build/routes/index.js +4 -0
- package/build/routes/knowledge.d.ts +2 -0
- package/build/routes/knowledge.js +141 -0
- package/build/routes/mcp-runs.js +2 -0
- package/build/routes/workflow-sets.js +9 -0
- package/build/routes/yaml-workflows/crud.js +9 -0
- package/build/routes/yaml-workflows/deployment.js +8 -0
- package/build/sdk/index.d.ts +17 -0
- package/build/sdk/index.js +19 -0
- package/build/services/insight/index.d.ts +13 -0
- package/build/services/insight/index.js +4 -7
- package/build/services/insight/prompts.d.ts +1 -1
- package/build/services/insight/prompts.js +1 -1
- package/build/services/mcp/client/connection-dispatch.d.ts +18 -0
- package/build/services/mcp/client/connection-dispatch.js +78 -0
- package/build/services/mcp/client/connection-lifecycle.d.ts +48 -0
- package/build/services/mcp/client/connection-lifecycle.js +296 -0
- package/build/services/mcp/client/connection-test.d.ts +10 -0
- package/build/services/mcp/client/connection-test.js +49 -0
- package/build/services/mcp/client/connection.d.ts +3 -68
- package/build/services/mcp/client/connection.js +15 -393
- package/build/services/mcp/server-lifecycle.d.ts +27 -0
- package/build/services/mcp/server-lifecycle.js +49 -0
- package/build/services/mcp/server-tools.d.ts +13 -0
- package/build/services/mcp/server-tools.js +287 -0
- package/build/services/mcp/server.d.ts +2 -26
- package/build/services/mcp/server.js +7 -315
- package/build/services/mcp-runs/queries.d.ts +2 -0
- package/build/services/mcp-runs/queries.js +11 -1
- package/build/services/mcp-runs/sql.d.ts +1 -1
- package/build/services/mcp-runs/sql.js +2 -2
- package/build/services/workflow-sets/db.d.ts +1 -0
- package/build/services/workflow-sets/db.js +6 -0
- package/build/services/workflow-sets/index.d.ts +1 -1
- package/build/services/workflow-sets/index.js +2 -1
- package/build/services/workflow-sets/sql.d.ts +1 -0
- package/build/services/workflow-sets/sql.js +6 -1
- package/build/services/yaml-workflow/builder-regenerate.d.ts +25 -0
- package/build/services/yaml-workflow/builder-regenerate.js +111 -0
- package/build/services/yaml-workflow/db-versions.d.ts +17 -0
- package/build/services/yaml-workflow/db-versions.js +76 -0
- package/build/services/yaml-workflow/db.d.ts +14 -12
- package/build/services/yaml-workflow/db.js +32 -70
- package/build/services/yaml-workflow/deployer-helpers.js +48 -17
- package/build/services/yaml-workflow/durable-compiler/index.d.ts +22 -0
- package/build/services/yaml-workflow/durable-compiler/index.js +168 -0
- package/build/services/yaml-workflow/durable-compiler/parser.d.ts +12 -0
- package/build/services/yaml-workflow/durable-compiler/parser.js +110 -0
- package/build/services/yaml-workflow/durable-compiler/prompts.d.ts +18 -0
- package/build/services/yaml-workflow/durable-compiler/prompts.js +570 -0
- package/build/services/yaml-workflow/durable-compiler/types.d.ts +51 -0
- package/build/services/yaml-workflow/durable-compiler/types.js +5 -0
- package/build/services/yaml-workflow/generator.js +4 -4
- package/build/services/yaml-workflow/pipeline/build/dag-assembly.d.ts +17 -0
- package/build/services/yaml-workflow/pipeline/build/dag-assembly.js +192 -0
- package/build/services/yaml-workflow/pipeline/build/dag.d.ts +4 -13
- package/build/services/yaml-workflow/pipeline/build/dag.js +9 -185
- package/build/services/yaml-workflow/pipeline/build/index.d.ts +2 -1
- package/build/services/yaml-workflow/pipeline/build/index.js +3 -2
- package/build/services/yaml-workflow/pipeline/build/utils.d.ts +0 -2
- package/build/services/yaml-workflow/pipeline/build/utils.js +0 -8
- package/build/services/yaml-workflow/pipeline/prompt-templates.d.ts +10 -0
- package/build/services/yaml-workflow/pipeline/prompt-templates.js +270 -0
- package/build/services/yaml-workflow/pipeline/prompts.d.ts +3 -6
- package/build/services/yaml-workflow/pipeline/prompts.js +8 -263
- package/build/services/yaml-workflow/sql.d.ts +2 -1
- package/build/services/yaml-workflow/sql.js +10 -3
- package/build/start/workers.js +6 -5
- package/build/system/activities/file-storage.d.ts +4 -0
- package/build/system/activities/file-storage.js +7 -1
- package/build/system/activities/knowledge.d.ts +23 -0
- package/build/system/activities/knowledge.js +50 -10
- package/build/system/activities/schema-exchange.d.ts +50 -0
- package/build/system/activities/schema-exchange.js +210 -0
- package/build/system/activities/sql.d.ts +4 -1
- package/build/system/activities/sql.js +37 -2
- package/build/system/index.js +1 -0
- package/build/system/mcp-servers/file-storage.js +3 -1
- package/build/system/mcp-servers/human-queue-schemas.d.ts +91 -0
- package/build/system/mcp-servers/human-queue-schemas.js +42 -0
- package/build/system/mcp-servers/human-queue.d.ts +2 -6
- package/build/system/mcp-servers/human-queue.js +9 -51
- package/build/system/mcp-servers/knowledge.js +69 -6
- package/build/system/mcp-servers/schema-exchange.d.ts +4 -0
- package/build/system/mcp-servers/schema-exchange.js +93 -0
- package/build/system/mcp-servers/workflow-compiler.js +54 -0
- package/build/system/seed/server-definitions.d.ts +112 -1
- package/build/system/seed/server-definitions.js +37 -0
- package/build/system/seed/tool-manifests-data.d.ts +87 -0
- package/build/system/seed/tool-manifests-data.js +37 -1
- package/build/system/seed/tool-manifests-knowledge.d.ts +9 -1
- package/build/system/seed/tool-manifests-knowledge.js +6 -5
- package/build/system/workflows/mcp-triage/activities-proxy.d.ts +21 -0
- package/build/system/workflows/mcp-triage/activities-proxy.js +70 -0
- package/build/system/workflows/mcp-triage/index.js +17 -75
- package/build/system/workflows/mcp-workflow-builder/prompts.d.ts +1 -1
- package/build/system/workflows/mcp-workflow-builder/prompts.js +21 -20
- package/build/system/workflows/mcp-workflow-planner/activities/persist.d.ts +2 -1
- package/build/system/workflows/mcp-workflow-planner/activities/persist.js +4 -3
- package/build/system/workflows/mcp-workflow-planner/index.js +41 -5
- package/build/system/workflows/mcp-workflow-planner/prompts.d.ts +1 -1
- package/build/system/workflows/mcp-workflow-planner/prompts.js +3 -3
- package/build/tsconfig.tsbuildinfo +1 -1
- package/dashboard/dist/assets/{AdminDashboard-DUrSBQOl.js → AdminDashboard-NLryl1_B.js} +2 -2
- package/dashboard/dist/assets/{AdminDashboard-DUrSBQOl.js.map → AdminDashboard-NLryl1_B.js.map} +1 -1
- package/dashboard/dist/assets/AvailableEscalationsPage-6vexlrk3.js +2 -0
- package/dashboard/dist/assets/AvailableEscalationsPage-6vexlrk3.js.map +1 -0
- package/dashboard/dist/assets/{BotPicker-Cg5iNEkm.js → BotPicker-DWhn0tr1.js} +2 -2
- package/dashboard/dist/assets/{BotPicker-Cg5iNEkm.js.map → BotPicker-DWhn0tr1.js.map} +1 -1
- package/dashboard/dist/assets/{CollapsibleSection-Kd9UIyeU.js → CollapsibleSection-CgYgQiOc.js} +2 -2
- package/dashboard/dist/assets/{CollapsibleSection-Kd9UIyeU.js.map → CollapsibleSection-CgYgQiOc.js.map} +1 -1
- package/dashboard/dist/assets/{ConfirmDeleteModal-DZMgmlof.js → ConfirmDeleteModal-DCKAPXD3.js} +2 -2
- package/dashboard/dist/assets/{ConfirmDeleteModal-DZMgmlof.js.map → ConfirmDeleteModal-DCKAPXD3.js.map} +1 -1
- package/dashboard/dist/assets/{CopyableId-cPFTRm8q.js → CopyableId-DXkaAOYk.js} +2 -2
- package/dashboard/dist/assets/{CopyableId-cPFTRm8q.js.map → CopyableId-DXkaAOYk.js.map} +1 -1
- package/dashboard/dist/assets/CredentialsPage-B361BOfU.js +2 -0
- package/dashboard/dist/assets/{CredentialsPage-DJablIbs.js.map → CredentialsPage-B361BOfU.js.map} +1 -1
- package/dashboard/dist/assets/{CustomDurationPicker-NgIP6YDW.js → CustomDurationPicker-D2G1ldiF.js} +2 -2
- package/dashboard/dist/assets/{CustomDurationPicker-NgIP6YDW.js.map → CustomDurationPicker-D2G1ldiF.js.map} +1 -1
- package/dashboard/dist/assets/{DataTable-CTRhTAfT.js → DataTable-DXSUbA26.js} +2 -2
- package/dashboard/dist/assets/{DataTable-CTRhTAfT.js.map → DataTable-DXSUbA26.js.map} +1 -1
- package/dashboard/dist/assets/{ElapsedCell-HcSJ_MMs.js → ElapsedCell-CQGqkXP_.js} +2 -2
- package/dashboard/dist/assets/{ElapsedCell-HcSJ_MMs.js.map → ElapsedCell-CQGqkXP_.js.map} +1 -1
- package/dashboard/dist/assets/{EmptyState-joNbd4gg.js → EmptyState-Dep92Wkg.js} +2 -2
- package/dashboard/dist/assets/{EmptyState-joNbd4gg.js.map → EmptyState-Dep92Wkg.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationsOverview-DpXDnQux.js → EscalationsOverview-DVEFVjs7.js} +2 -2
- package/dashboard/dist/assets/{EscalationsOverview-DpXDnQux.js.map → EscalationsOverview-DVEFVjs7.js.map} +1 -1
- package/dashboard/dist/assets/{EventTable-CYem3v8n.js → EventTable-BMJAPkMi.js} +2 -2
- package/dashboard/dist/assets/{EventTable-CYem3v8n.js.map → EventTable-BMJAPkMi.js.map} +1 -1
- package/dashboard/dist/assets/{FilterBar-BiO8SOzc.js → FilterBar-DbVbCzH2.js} +2 -2
- package/dashboard/dist/assets/{FilterBar-BiO8SOzc.js.map → FilterBar-DbVbCzH2.js.map} +1 -1
- package/dashboard/dist/assets/{ListToolbar-6yRDh2e9.js → ListToolbar-0XNuXj0M.js} +2 -2
- package/dashboard/dist/assets/{ListToolbar-6yRDh2e9.js.map → ListToolbar-0XNuXj0M.js.map} +1 -1
- package/dashboard/dist/assets/{McpOverview-CUgSxkQe.js → McpOverview-CeYnCzBN.js} +2 -2
- package/dashboard/dist/assets/{McpOverview-CUgSxkQe.js.map → McpOverview-CeYnCzBN.js.map} +1 -1
- package/dashboard/dist/assets/McpQueryDetailPage-t3qW3QNa.js +5 -0
- package/dashboard/dist/assets/McpQueryDetailPage-t3qW3QNa.js.map +1 -0
- package/dashboard/dist/assets/McpQueryPage-CfUcdzaj.js +2 -0
- package/dashboard/dist/assets/{McpQueryPage-lV6kfDG5.js.map → McpQueryPage-CfUcdzaj.js.map} +1 -1
- package/dashboard/dist/assets/McpRunDetailPage-CZtodW_Z.js +2 -0
- package/dashboard/dist/assets/McpRunDetailPage-CZtodW_Z.js.map +1 -0
- package/dashboard/dist/assets/McpRunsPage-Dzgq7HGt.js +2 -0
- package/dashboard/dist/assets/McpRunsPage-Dzgq7HGt.js.map +1 -0
- package/dashboard/dist/assets/{Modal-BuTvD0pz.js → Modal-yyhUeKoA.js} +2 -2
- package/dashboard/dist/assets/{Modal-BuTvD0pz.js.map → Modal-yyhUeKoA.js.map} +1 -1
- package/dashboard/dist/assets/OperatorDashboard-Ceh7OQtZ.js +2 -0
- package/dashboard/dist/assets/{OperatorDashboard-C9SSV96T.js.map → OperatorDashboard-Ceh7OQtZ.js.map} +1 -1
- package/dashboard/dist/assets/{PageHeader-BcTVF9ul.js → PageHeader-CZ9a8cpr.js} +2 -2
- package/dashboard/dist/assets/{PageHeader-BcTVF9ul.js.map → PageHeader-CZ9a8cpr.js.map} +1 -1
- package/dashboard/dist/assets/{PageHeaderWithStats-BI7JG5x6.js → PageHeaderWithStats-BJuNs5NM.js} +2 -2
- package/dashboard/dist/assets/{PageHeaderWithStats-BI7JG5x6.js.map → PageHeaderWithStats-BJuNs5NM.js.map} +1 -1
- package/dashboard/dist/assets/{PriorityBadge-DqVaOU65.js → PriorityBadge-BrPikMFy.js} +2 -2
- package/dashboard/dist/assets/{PriorityBadge-DqVaOU65.js.map → PriorityBadge-BrPikMFy.js.map} +1 -1
- package/dashboard/dist/assets/{ProcessDetailPage-hFMhf9qa.js → ProcessDetailPage-2miaYd8G.js} +2 -2
- package/dashboard/dist/assets/{ProcessDetailPage-hFMhf9qa.js.map → ProcessDetailPage-2miaYd8G.js.map} +1 -1
- package/dashboard/dist/assets/{ProcessesListPage-ByVoBCQ3.js → ProcessesListPage-DqpRDqjk.js} +2 -2
- package/dashboard/dist/assets/{ProcessesListPage-ByVoBCQ3.js.map → ProcessesListPage-DqpRDqjk.js.map} +1 -1
- package/dashboard/dist/assets/{RolePill-D9ZIkYiu.js → RolePill-DxbJMfJu.js} +2 -2
- package/dashboard/dist/assets/{RolePill-D9ZIkYiu.js.map → RolePill-DxbJMfJu.js.map} +1 -1
- package/dashboard/dist/assets/{RolesPage-SMedMuqa.js → RolesPage-CYHRo21-.js} +2 -2
- package/dashboard/dist/assets/{RolesPage-SMedMuqa.js.map → RolesPage-CYHRo21-.js.map} +1 -1
- package/dashboard/dist/assets/{RowActions-yDhwwDbU.js → RowActions-DurFwIwe.js} +2 -2
- package/dashboard/dist/assets/{RowActions-yDhwwDbU.js.map → RowActions-DurFwIwe.js.map} +1 -1
- package/dashboard/dist/assets/RunAsSelector-CNKraP6u.js +2 -0
- package/dashboard/dist/assets/RunAsSelector-CNKraP6u.js.map +1 -0
- package/dashboard/dist/assets/{StatCard-BrBnQFxh.js → StatCard-CKplpK3w.js} +2 -2
- package/dashboard/dist/assets/{StatCard-BrBnQFxh.js.map → StatCard-CKplpK3w.js.map} +1 -1
- package/dashboard/dist/assets/{StatusBadge-xgb-lZku.js → StatusBadge-Dm0V1dNN.js} +2 -2
- package/dashboard/dist/assets/{StatusBadge-xgb-lZku.js.map → StatusBadge-Dm0V1dNN.js.map} +1 -1
- package/dashboard/dist/assets/{StepIndicator-B9ps2SvM.js → StepIndicator-Dicx0WTZ.js} +2 -2
- package/dashboard/dist/assets/{StepIndicator-B9ps2SvM.js.map → StepIndicator-Dicx0WTZ.js.map} +1 -1
- package/dashboard/dist/assets/{StickyPagination-DTIjBKN3.js → StickyPagination-B2jYvU3-.js} +2 -2
- package/dashboard/dist/assets/{StickyPagination-DTIjBKN3.js.map → StickyPagination-B2jYvU3-.js.map} +1 -1
- package/dashboard/dist/assets/SwimlaneTimeline-ClwumkT1.js +2 -0
- package/dashboard/dist/assets/SwimlaneTimeline-ClwumkT1.js.map +1 -0
- package/dashboard/dist/assets/{TagInput-CdNUuqk4.js → TagInput-CypDZ6Kl.js} +2 -2
- package/dashboard/dist/assets/{TagInput-CdNUuqk4.js.map → TagInput-CypDZ6Kl.js.map} +1 -1
- package/dashboard/dist/assets/{TaskDetailPage-C-nzaNea.js → TaskDetailPage-DooDNJGT.js} +2 -2
- package/dashboard/dist/assets/{TaskDetailPage-C-nzaNea.js.map → TaskDetailPage-DooDNJGT.js.map} +1 -1
- package/dashboard/dist/assets/{TaskQueuePill-Lvr2-NzS.js → TaskQueuePill-C1hZ-j31.js} +2 -2
- package/dashboard/dist/assets/{TaskQueuePill-Lvr2-NzS.js.map → TaskQueuePill-C1hZ-j31.js.map} +1 -1
- package/dashboard/dist/assets/{TasksListPage-DSUmD84y.js → TasksListPage-D7CdkAeg.js} +2 -2
- package/dashboard/dist/assets/{TasksListPage-DSUmD84y.js.map → TasksListPage-D7CdkAeg.js.map} +1 -1
- package/dashboard/dist/assets/{TimeAgo-BZdLdrIh.js → TimeAgo-B5LXB2aj.js} +2 -2
- package/dashboard/dist/assets/{TimeAgo-BZdLdrIh.js.map → TimeAgo-B5LXB2aj.js.map} +1 -1
- package/dashboard/dist/assets/{TimestampCell-QX_0i5FK.js → TimestampCell-Crb9b0Gw.js} +2 -2
- package/dashboard/dist/assets/{TimestampCell-QX_0i5FK.js.map → TimestampCell-Crb9b0Gw.js.map} +1 -1
- package/dashboard/dist/assets/{UserName-DyZMXcBm.js → UserName-OPg-nkRa.js} +2 -2
- package/dashboard/dist/assets/{UserName-DyZMXcBm.js.map → UserName-OPg-nkRa.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowExecutionPage-DjVxfZaF.js → WorkflowExecutionPage-CcLVrs9b.js} +2 -2
- package/dashboard/dist/assets/{WorkflowExecutionPage-DjVxfZaF.js.map → WorkflowExecutionPage-CcLVrs9b.js.map} +1 -1
- package/dashboard/dist/assets/WorkflowPill-CCV4MMj7.js +2 -0
- package/dashboard/dist/assets/WorkflowPill-CCV4MMj7.js.map +1 -0
- package/dashboard/dist/assets/{WorkflowsDashboard-DZjuiFZ0.js → WorkflowsDashboard-DB1SncBi.js} +2 -2
- package/dashboard/dist/assets/{WorkflowsDashboard-DZjuiFZ0.js.map → WorkflowsDashboard-DB1SncBi.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowsOverview-CLnLRpOu.js → WorkflowsOverview-DvShiYJV.js} +2 -2
- package/dashboard/dist/assets/{WorkflowsOverview-CLnLRpOu.js.map → WorkflowsOverview-DvShiYJV.js.map} +1 -1
- package/dashboard/dist/assets/YamlWorkflowsPage-DCBoMeGI.js +2 -0
- package/dashboard/dist/assets/YamlWorkflowsPage-DCBoMeGI.js.map +1 -0
- package/dashboard/dist/assets/{bots-DIM6lBoY.js → bots-Dqos20NE.js} +2 -2
- package/dashboard/dist/assets/{bots-DIM6lBoY.js.map → bots-Dqos20NE.js.map} +1 -1
- package/dashboard/dist/assets/{escalation-JOTuOqjq.js → escalation-A0CsbvNV.js} +2 -2
- package/dashboard/dist/assets/{escalation-JOTuOqjq.js.map → escalation-A0CsbvNV.js.map} +1 -1
- package/dashboard/dist/assets/escalation-columns-BpBJN6k4.js +2 -0
- package/dashboard/dist/assets/{escalation-columns-Cyg58nkg.js.map → escalation-columns-BpBJN6k4.js.map} +1 -1
- package/dashboard/dist/assets/{helpers-B1BDxBZd.js → helpers-CmznCuAx.js} +2 -2
- package/dashboard/dist/assets/{helpers-B1BDxBZd.js.map → helpers-CmznCuAx.js.map} +1 -1
- package/dashboard/dist/assets/index-BIeYV5QK.js +2 -0
- package/dashboard/dist/assets/index-BIeYV5QK.js.map +1 -0
- package/dashboard/dist/assets/index-BYwD3kHN.js +5 -0
- package/dashboard/dist/assets/index-BYwD3kHN.js.map +1 -0
- package/dashboard/dist/assets/index-C5TUqJu0.css +1 -0
- package/dashboard/dist/assets/index-C8-UaN4N.js +2 -0
- package/dashboard/dist/assets/{index-Cg5nfiYX.js.map → index-C8-UaN4N.js.map} +1 -1
- package/dashboard/dist/assets/index-CAj5LT9H.js +15 -0
- package/dashboard/dist/assets/index-CAj5LT9H.js.map +1 -0
- package/dashboard/dist/assets/index-CjxHCVxl.js +2 -0
- package/dashboard/dist/assets/{index-Cf60K3x9.js.map → index-CjxHCVxl.js.map} +1 -1
- package/dashboard/dist/assets/index-Cr0Rqsj7.js +2 -0
- package/dashboard/dist/assets/index-Cr0Rqsj7.js.map +1 -0
- package/dashboard/dist/assets/index-DZHNte4o.js +2 -0
- package/dashboard/dist/assets/{index-Di12t56M.js.map → index-DZHNte4o.js.map} +1 -1
- package/dashboard/dist/assets/{index-Ds0JoXS2.js → index-VnYkWW8r.js} +2 -2
- package/dashboard/dist/assets/{index-Ds0JoXS2.js.map → index-VnYkWW8r.js.map} +1 -1
- package/dashboard/dist/assets/{index-BcR6PfpY.js → index-XGOmZ117.js} +2 -2
- package/dashboard/dist/assets/{index-BcR6PfpY.js.map → index-XGOmZ117.js.map} +1 -1
- package/dashboard/dist/assets/index-ZjOUzWhc.js +2 -0
- package/dashboard/dist/assets/index-ZjOUzWhc.js.map +1 -0
- package/dashboard/dist/assets/{index-BYZX9tOb.js → index-puKKZ5l8.js} +77 -77
- package/dashboard/dist/assets/index-puKKZ5l8.js.map +1 -0
- package/dashboard/dist/assets/{index-BizfauqT.js → index-t5frSddy.js} +4 -4
- package/dashboard/dist/assets/{index-BizfauqT.js.map → index-t5frSddy.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-B_xbczAt.js → mcp-DrWymhSu.js} +2 -2
- package/dashboard/dist/assets/{mcp-B_xbczAt.js.map → mcp-DrWymhSu.js.map} +1 -1
- package/dashboard/dist/assets/mcp-query-BhUxVEMS.js +2 -0
- package/dashboard/dist/assets/mcp-query-BhUxVEMS.js.map +1 -0
- package/dashboard/dist/assets/mcp-runs-DUfz4mLd.js +2 -0
- package/dashboard/dist/assets/mcp-runs-DUfz4mLd.js.map +1 -0
- package/dashboard/dist/assets/{namespaces-C3WtdO_9.js → namespaces-Cm6AY5sh.js} +2 -2
- package/dashboard/dist/assets/{namespaces-C3WtdO_9.js.map → namespaces-Cm6AY5sh.js.map} +1 -1
- package/dashboard/dist/assets/{roles-BDAsPpZG.js → roles-2v1Kc7BJ.js} +2 -2
- package/dashboard/dist/assets/{roles-BDAsPpZG.js.map → roles-2v1Kc7BJ.js.map} +1 -1
- package/dashboard/dist/assets/{settings-Ife_UwAp.js → settings-DTQNp6tH.js} +2 -2
- package/dashboard/dist/assets/{settings-Ife_UwAp.js.map → settings-DTQNp6tH.js.map} +1 -1
- package/dashboard/dist/assets/{tasks-BquNDHDI.js → tasks-CS1rgG1s.js} +2 -2
- package/dashboard/dist/assets/{tasks-BquNDHDI.js.map → tasks-CS1rgG1s.js.map} +1 -1
- package/dashboard/dist/assets/useEventHooks-BjXX8x3a.js +2 -0
- package/dashboard/dist/assets/{useEventHooks-anv_B2Yy.js.map → useEventHooks-BjXX8x3a.js.map} +1 -1
- package/dashboard/dist/assets/useFilterParams-CGRYFw_A.js +2 -0
- package/dashboard/dist/assets/useFilterParams-CGRYFw_A.js.map +1 -0
- package/dashboard/dist/assets/useYamlActivityEvents-BeR-nVWQ.js +2 -0
- package/dashboard/dist/assets/useYamlActivityEvents-BeR-nVWQ.js.map +1 -0
- package/dashboard/dist/assets/{users-CFcxB4v6.js → users-DYsdQ7Md.js} +2 -2
- package/dashboard/dist/assets/{users-CFcxB4v6.js.map → users-DYsdQ7Md.js.map} +1 -1
- package/dashboard/dist/assets/{vendor-icons-T4r2DSPD.js → vendor-icons-CWl44VA6.js} +132 -82
- package/dashboard/dist/assets/vendor-icons-CWl44VA6.js.map +1 -0
- package/dashboard/dist/assets/{workflows-CeRci9z3.js → workflows-2QAXh3UD.js} +2 -2
- package/dashboard/dist/assets/{workflows-CeRci9z3.js.map → workflows-2QAXh3UD.js.map} +1 -1
- package/dashboard/dist/assets/yaml-workflows-sx8-UEE3.js +2 -0
- package/dashboard/dist/assets/yaml-workflows-sx8-UEE3.js.map +1 -0
- package/dashboard/dist/index.html +3 -3
- package/docs/api/http/file-browser.md +101 -0
- package/docs/api/http/knowledge.md +203 -0
- package/docs/api/http/settings.md +6 -4
- package/docs/api/sdk/files.md +68 -0
- package/docs/api/sdk/knowledge.md +126 -0
- package/docs/api/sdk/settings.md +3 -2
- package/docs/cli.md +171 -0
- package/docs/compilation.md +16 -0
- package/docs/compiler.md +311 -0
- package/docs/events.md +19 -0
- package/docs/schema-exchange.md +173 -0
- package/docs/self-test.md +106 -0
- package/docs/workflows.md +19 -0
- package/package.json +15 -2
- package/build/api/escalations.d.ts +0 -271
- package/build/api/escalations.js +0 -932
- package/build/api/workflows.d.ts +0 -158
- package/build/api/workflows.js +0 -414
- package/dashboard/dist/assets/AvailableEscalationsPage-Dbd1qUK_.js +0 -2
- package/dashboard/dist/assets/AvailableEscalationsPage-Dbd1qUK_.js.map +0 -1
- package/dashboard/dist/assets/CredentialsPage-DJablIbs.js +0 -2
- package/dashboard/dist/assets/McpQueryDetailPage-BWbinTM_.js +0 -5
- package/dashboard/dist/assets/McpQueryDetailPage-BWbinTM_.js.map +0 -1
- package/dashboard/dist/assets/McpQueryPage-lV6kfDG5.js +0 -2
- package/dashboard/dist/assets/McpRunDetailPage-D6gaxH3_.js +0 -2
- package/dashboard/dist/assets/McpRunDetailPage-D6gaxH3_.js.map +0 -1
- package/dashboard/dist/assets/McpRunsPage-DKvTklh9.js +0 -2
- package/dashboard/dist/assets/McpRunsPage-DKvTklh9.js.map +0 -1
- package/dashboard/dist/assets/OperatorDashboard-C9SSV96T.js +0 -2
- package/dashboard/dist/assets/SwimlaneTimeline-RK4Yu66z.js +0 -2
- package/dashboard/dist/assets/SwimlaneTimeline-RK4Yu66z.js.map +0 -1
- package/dashboard/dist/assets/WorkflowPill-CZqGslD6.js +0 -2
- package/dashboard/dist/assets/WorkflowPill-CZqGslD6.js.map +0 -1
- package/dashboard/dist/assets/YamlWorkflowsPage-VjdhnLmO.js +0 -2
- package/dashboard/dist/assets/YamlWorkflowsPage-VjdhnLmO.js.map +0 -1
- package/dashboard/dist/assets/escalation-columns-Cyg58nkg.js +0 -2
- package/dashboard/dist/assets/helpers-BCix9c_m.js +0 -2
- package/dashboard/dist/assets/helpers-BCix9c_m.js.map +0 -1
- package/dashboard/dist/assets/index-BUK3qR-1.js +0 -2
- package/dashboard/dist/assets/index-BUK3qR-1.js.map +0 -1
- package/dashboard/dist/assets/index-BYZX9tOb.js.map +0 -1
- package/dashboard/dist/assets/index-Cf60K3x9.js +0 -2
- package/dashboard/dist/assets/index-Cg5nfiYX.js +0 -2
- package/dashboard/dist/assets/index-D1wVX50Z.js +0 -15
- package/dashboard/dist/assets/index-D1wVX50Z.js.map +0 -1
- package/dashboard/dist/assets/index-DDYFpi4l.js +0 -5
- package/dashboard/dist/assets/index-DDYFpi4l.js.map +0 -1
- package/dashboard/dist/assets/index-DcIKW-cZ.css +0 -1
- package/dashboard/dist/assets/index-Di12t56M.js +0 -2
- package/dashboard/dist/assets/mcp-query-B8-P_QoG.js +0 -2
- package/dashboard/dist/assets/mcp-query-B8-P_QoG.js.map +0 -1
- package/dashboard/dist/assets/mcp-runs-CWeZinoF.js +0 -2
- package/dashboard/dist/assets/mcp-runs-CWeZinoF.js.map +0 -1
- package/dashboard/dist/assets/useEventHooks-anv_B2Yy.js +0 -2
- package/dashboard/dist/assets/useFilterParams-BUyLHcx_.js +0 -2
- package/dashboard/dist/assets/useFilterParams-BUyLHcx_.js.map +0 -1
- package/dashboard/dist/assets/useYamlActivityEvents-DN-PTgVx.js +0 -2
- package/dashboard/dist/assets/useYamlActivityEvents-DN-PTgVx.js.map +0 -1
- package/dashboard/dist/assets/vendor-icons-T4r2DSPD.js.map +0 -1
- package/dashboard/dist/assets/yaml-workflows-DLwd2BOX.js +0 -2
- package/dashboard/dist/assets/yaml-workflows-DLwd2BOX.js.map +0 -1
package/docs/compiler.md
ADDED
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
# The Workflow Compiler
|
|
2
|
+
|
|
3
|
+
You wrote a durable workflow. It works. `proxyActivities`, `sleep`, `condition` — the Temporal-like API is productive and familiar. But under the hood, the durable engine replays the entire workflow function on every wake-up. Sleep three times in a ten-step workflow? Steps 1–3 replay on wake one. Steps 1–6 replay on wake two. Steps 1–9 replay on wake three. The replay is deterministic — it skips completed activities — but the function still executes from the top every time.
|
|
4
|
+
|
|
5
|
+
The compiled YAML DAG does the same work without replay. Each step fires exactly once. State flows explicitly between activities through input mappings. No function re-execution, no replay loop, no wasted cycles.
|
|
6
|
+
|
|
7
|
+
`ltc` is the compiler. It reads your TypeScript source and produces an equivalent YAML DAG. Write procedural because it's productive. Run the DAG because it's fast.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## The Analogy
|
|
12
|
+
|
|
13
|
+
`tsc` compiles TypeScript to JavaScript. You write in the language that's expressive. You run the artifact that's efficient. The source is authoritative — you edit it, test it, review it. The compiled output is what actually executes.
|
|
14
|
+
|
|
15
|
+
`ltc` does the same for workflows:
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
TypeScript source ltc compile YAML DAG
|
|
19
|
+
(developer-friendly) ──────────────────→ (execution-optimized)
|
|
20
|
+
|
|
21
|
+
assembly-line.ts → assembly-line.compiled.yaml
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
The `.ts` file is the spec. The `.compiled.yaml` is the optimized execution. Both live in the repo. A reviewer reads both side-by-side and traces every line of orchestration logic to its DAG equivalent.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Quick Start
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npm install -g @hotmeshio/long-tail
|
|
32
|
+
export ANTHROPIC_API_KEY=sk-ant-...
|
|
33
|
+
|
|
34
|
+
ltc compile workflows/basic-echo/index.ts
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Output:
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
✓ index.ts → workflows/basic-echo/index.compiled.yaml
|
|
41
|
+
1 activities · 2 inputs (message, sleepSeconds) · topic: basic.echo
|
|
42
|
+
|
|
43
|
+
Compiled 1 workflow in 18.1s
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
The compiled YAML appears adjacent to the source file.
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Before and After
|
|
51
|
+
|
|
52
|
+
### The source (procedural)
|
|
53
|
+
|
|
54
|
+
```typescript
|
|
55
|
+
import { Durable } from '@hotmeshio/hotmesh';
|
|
56
|
+
import * as activities from './activities';
|
|
57
|
+
|
|
58
|
+
const { echo } = Durable.workflow.proxyActivities<typeof activities>({
|
|
59
|
+
activities,
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
export async function basicEcho(envelope: LTEnvelope): Promise<any> {
|
|
63
|
+
const { message = 'Hello, Long Tail!', sleepSeconds = 1 } = envelope.data;
|
|
64
|
+
|
|
65
|
+
// 1. Durable sleep — the engine replays to this point on wake-up
|
|
66
|
+
await Durable.workflow.sleep(`${sleepSeconds} seconds`);
|
|
67
|
+
|
|
68
|
+
// 2. Activity call — replayed as a no-op if already completed
|
|
69
|
+
const echoResult = await echo({ message });
|
|
70
|
+
|
|
71
|
+
return {
|
|
72
|
+
type: 'return' as const,
|
|
73
|
+
data: { ...echoResult, sleepSeconds, userId: envelope.lt?.userId },
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
This function executes three times: once on initial invocation, once when the sleep timer fires, and once when the echo activity completes. Each time, the engine replays from the top, skipping completed steps. For a two-step workflow this is fine. For a twenty-step workflow with multiple sleeps, the replay cost compounds.
|
|
79
|
+
|
|
80
|
+
### The compiled output (DAG)
|
|
81
|
+
|
|
82
|
+
```yaml
|
|
83
|
+
app:
|
|
84
|
+
id: longtail
|
|
85
|
+
version: '1'
|
|
86
|
+
graphs:
|
|
87
|
+
- subscribes: basic.echo
|
|
88
|
+
expire: 300
|
|
89
|
+
input:
|
|
90
|
+
schema:
|
|
91
|
+
type: object
|
|
92
|
+
properties:
|
|
93
|
+
message:
|
|
94
|
+
type: string
|
|
95
|
+
default: 'Hello, Long Tail!'
|
|
96
|
+
sleepSeconds:
|
|
97
|
+
type: number
|
|
98
|
+
default: 1
|
|
99
|
+
activities:
|
|
100
|
+
trigger_m7qz:
|
|
101
|
+
type: trigger
|
|
102
|
+
output:
|
|
103
|
+
schema:
|
|
104
|
+
type: object
|
|
105
|
+
properties:
|
|
106
|
+
message: { type: string }
|
|
107
|
+
sleepSeconds: { type: number }
|
|
108
|
+
|
|
109
|
+
delay_m7qz:
|
|
110
|
+
type: hook
|
|
111
|
+
sleep: '{trigger_m7qz.output.data.sleepSeconds}'
|
|
112
|
+
|
|
113
|
+
echo_m7qz:
|
|
114
|
+
type: worker
|
|
115
|
+
topic: basic.echo
|
|
116
|
+
input:
|
|
117
|
+
maps:
|
|
118
|
+
message: '{trigger_m7qz.output.data.message}'
|
|
119
|
+
workflowName: echo
|
|
120
|
+
|
|
121
|
+
transitions:
|
|
122
|
+
trigger_m7qz:
|
|
123
|
+
- to: delay_m7qz
|
|
124
|
+
delay_m7qz:
|
|
125
|
+
- to: echo_m7qz
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### The mapping
|
|
129
|
+
|
|
130
|
+
| TypeScript | YAML | What happens |
|
|
131
|
+
|---|---|---|
|
|
132
|
+
| `envelope.data` destructuring | `trigger` activity with input schema | Inputs declared as typed schema with defaults |
|
|
133
|
+
| `Durable.workflow.sleep(N)` | `hook` activity with `sleep` field | Engine sets a timer; no replay on wake |
|
|
134
|
+
| `await echo({ message })` | `worker` activity with input `maps` | Worker fires once; result stored in job hash |
|
|
135
|
+
| `return { data: ... }` | `job.maps` on the final activity | Output fields plucked from activity results |
|
|
136
|
+
|
|
137
|
+
Each step executes exactly once. The `sleep` hook pauses the DAG. When the timer fires, execution resumes at `echo_m7qz` — not from the top of the function.
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## Discovery
|
|
142
|
+
|
|
143
|
+
Point `ltc` at a directory and it finds workflow files automatically:
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
ltc compile examples/workflows/ --dry-run
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
```
|
|
150
|
+
Found 10 workflows:
|
|
151
|
+
|
|
152
|
+
● assembly-line/index.ts
|
|
153
|
+
Function: assemblyLine · HotMesh Durable
|
|
154
|
+
Control flow: startChild, condition
|
|
155
|
+
|
|
156
|
+
● basic-echo/index.ts
|
|
157
|
+
Function: basicEcho · HotMesh Durable
|
|
158
|
+
Activities: echo
|
|
159
|
+
Control flow: sleep
|
|
160
|
+
|
|
161
|
+
● basic-signal/index.ts
|
|
162
|
+
Function: basicSignal · HotMesh Durable
|
|
163
|
+
Activities: ltCreateEscalation, processApproval
|
|
164
|
+
Control flow: conditionLT
|
|
165
|
+
|
|
166
|
+
● kitchen-sink/index.ts
|
|
167
|
+
Function: kitchenSink · HotMesh Durable
|
|
168
|
+
Activities: greet, fetchData, transformData, notifyComplete
|
|
169
|
+
Control flow: sleep, executeLT
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### What the scanner looks for
|
|
173
|
+
|
|
174
|
+
| Pattern | Classification |
|
|
175
|
+
|---|---|
|
|
176
|
+
| `proxyActivities` / `Durable.workflow.proxyActivities` | HotMesh Durable workflow |
|
|
177
|
+
| `@temporalio/workflow` import | Temporal workflow |
|
|
178
|
+
| `sleep`, `condition`, `signal` | Control flow primitives |
|
|
179
|
+
| `startChild`, `executeChild`, `executeLT` | Composition (parent workflow) |
|
|
180
|
+
| Exported async function | Workflow entry point |
|
|
181
|
+
|
|
182
|
+
Files in `node_modules/`, `build/`, `dist/`, and test files (`*.test.ts`, `*.spec.ts`) are excluded.
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## How Compilation Works
|
|
187
|
+
|
|
188
|
+
The compiler is not an AST parser. It uses the LLM to translate orchestration logic, grounded by structural metadata extracted from the source.
|
|
189
|
+
|
|
190
|
+
1. **Read source** — file or inline string
|
|
191
|
+
2. **Extract metadata** — lightweight regex extraction: activity names, durable primitives, envelope fields, import paths, control flow markers (loops, Promise.all, conditionals, escalation)
|
|
192
|
+
3. **Resolve activities** — if the source imports activity modules, the compiler reads them too and includes them in the LLM context
|
|
193
|
+
4. **LLM translation** — the source code, extracted metadata, and the full HotMesh YAML specification are sent to the LLM. Temperature 0. Up to 3 retry attempts on parse failure.
|
|
194
|
+
5. **Fix patterns** — known LLM anti-patterns in YAML pipe expressions are corrected deterministically
|
|
195
|
+
|
|
196
|
+
The metadata extraction is intentionally lightweight — regex, not a TypeScript AST. It gives the LLM structural hints (which functions are activities, which primitives are used) without requiring `ts-morph` or the TypeScript compiler API as a dependency.
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## Composition
|
|
201
|
+
|
|
202
|
+
When a workflow uses `startChild` or `executeChild`, the compiler resolves the child workflow source through imports and compiles children first (leaf-first ordering). The parent's compiled YAML references each child by topic using the `await` activity type — the same mechanism used by the Pipeline Designer's Plan Build mode.
|
|
203
|
+
|
|
204
|
+
```
|
|
205
|
+
parent.ts ──→ parent.compiled.yaml
|
|
206
|
+
└─ startChild(worker)
|
|
207
|
+
└─ worker.ts ──→ worker.compiled.yaml
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
All compiled workflows in the same composition share the same `app.id` namespace, enabling cross-graph invocation.
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
## Three Surfaces
|
|
215
|
+
|
|
216
|
+
The compiler is the same function regardless of how you invoke it.
|
|
217
|
+
|
|
218
|
+
### CLI
|
|
219
|
+
|
|
220
|
+
```bash
|
|
221
|
+
ltc compile workflows/assembly-line.ts
|
|
222
|
+
ltc compile src/workflows/ --dry-run
|
|
223
|
+
ltc compile --model claude-sonnet-4-6
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
### HTTP API
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
curl -X POST http://localhost:3000/api/yaml-workflows/from-durable \
|
|
230
|
+
-H "Authorization: Bearer $TOKEN" \
|
|
231
|
+
-H "Content-Type: application/json" \
|
|
232
|
+
-d '{
|
|
233
|
+
"source": "export async function basicEcho(envelope) { ... }",
|
|
234
|
+
"workflow_name": "basicEcho",
|
|
235
|
+
"name": "basic_echo"
|
|
236
|
+
}'
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
### SDK
|
|
240
|
+
|
|
241
|
+
```typescript
|
|
242
|
+
import { createClient } from '@hotmeshio/long-tail/sdk';
|
|
243
|
+
|
|
244
|
+
const lt = createClient({ auth: { userId: 'system' } });
|
|
245
|
+
|
|
246
|
+
const result = await lt.yamlWorkflows.compileDurable({
|
|
247
|
+
source: fs.readFileSync('workflows/assembly-line.ts', 'utf-8'),
|
|
248
|
+
workflow_name: 'assemblyLine',
|
|
249
|
+
name: 'assembly_line',
|
|
250
|
+
});
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
The CLI writes `.compiled.yaml` files to disk. The HTTP and SDK surfaces store the compiled workflow in the database and return the record. All three use the same underlying `compileDurableToYaml()` function.
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
## Configuration
|
|
258
|
+
|
|
259
|
+
| Variable | Default | Description |
|
|
260
|
+
|---|---|---|
|
|
261
|
+
| `ANTHROPIC_API_KEY` | — | Required for Claude models |
|
|
262
|
+
| `OPENAI_API_KEY` | — | Required for OpenAI models |
|
|
263
|
+
| `LT_LLM_MODEL_PRIMARY` | `claude-sonnet-4-6` | Model used for compilation |
|
|
264
|
+
| `LT_LLM_BASE_URL` | — | Custom endpoint for OpenAI-compatible models |
|
|
265
|
+
|
|
266
|
+
The CLI loads `.env` automatically if present in the current directory.
|
|
267
|
+
|
|
268
|
+
---
|
|
269
|
+
|
|
270
|
+
## CLI Reference
|
|
271
|
+
|
|
272
|
+
```
|
|
273
|
+
Usage: ltc compile [options] [target]
|
|
274
|
+
|
|
275
|
+
Compile durable TypeScript workflows to YAML DAGs
|
|
276
|
+
|
|
277
|
+
Arguments:
|
|
278
|
+
target File or directory to compile (default: current directory)
|
|
279
|
+
|
|
280
|
+
Options:
|
|
281
|
+
--dry-run Show discovered workflows without compiling
|
|
282
|
+
-o, --output <dir> Output directory (default: adjacent to source file)
|
|
283
|
+
--model <model> LLM model to use (default: claude-sonnet-4-6)
|
|
284
|
+
--function <name> Workflow function name (auto-detected if omitted)
|
|
285
|
+
-h, --help Display help
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
### Examples
|
|
289
|
+
|
|
290
|
+
```bash
|
|
291
|
+
# Compile a single file
|
|
292
|
+
ltc compile workflows/basic-echo/index.ts
|
|
293
|
+
|
|
294
|
+
# Scan and compile all workflows in a directory
|
|
295
|
+
ltc compile src/workflows/
|
|
296
|
+
|
|
297
|
+
# Compile everything in the current directory
|
|
298
|
+
ltc compile
|
|
299
|
+
|
|
300
|
+
# Preview what would be compiled
|
|
301
|
+
ltc compile examples/workflows/ --dry-run
|
|
302
|
+
|
|
303
|
+
# Use a specific model
|
|
304
|
+
ltc compile workflows/complex.ts --model claude-opus-4-6
|
|
305
|
+
|
|
306
|
+
# Write output to a separate directory
|
|
307
|
+
ltc compile workflows/ -o compiled/
|
|
308
|
+
|
|
309
|
+
# Compile a specific function from a multi-export file
|
|
310
|
+
ltc compile workflows/multi.ts --function assemblyLine
|
|
311
|
+
```
|
package/docs/events.md
CHANGED
|
@@ -26,6 +26,25 @@ await start({
|
|
|
26
26
|
|
|
27
27
|
`start()` handles adapter connection and graceful disconnection on shutdown automatically.
|
|
28
28
|
|
|
29
|
+
## Dashboard Transport Selection
|
|
30
|
+
|
|
31
|
+
The dashboard auto-detects its event transport via `GET /api/settings`. By default, Socket.IO is reported — it works in-process with no additional infrastructure.
|
|
32
|
+
|
|
33
|
+
For multi-container deployments where the API and workers run as separate processes, set `EVENT_TRANSPORT=nats` to tell the dashboard to connect via NATS WebSocket instead of Socket.IO:
|
|
34
|
+
|
|
35
|
+
```yaml
|
|
36
|
+
# docker-compose.yml
|
|
37
|
+
services:
|
|
38
|
+
app:
|
|
39
|
+
environment:
|
|
40
|
+
- EVENT_TRANSPORT=nats
|
|
41
|
+
- NATS_URL=nats://nats:4222
|
|
42
|
+
- NATS_WS_URL=ws://localhost:9222
|
|
43
|
+
- NATS_TOKEN=your-token
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Both adapters still publish events regardless of `EVENT_TRANSPORT` — the setting only controls what the dashboard listens on. This means server-side event consumers (callbacks, NATS subscribers) work independently of the dashboard transport.
|
|
47
|
+
|
|
29
48
|
## LTEvent
|
|
30
49
|
|
|
31
50
|
Every published event conforms to the `LTEvent` interface:
|
|
@@ -0,0 +1,173 @@
|
|
|
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.
|
|
@@ -0,0 +1,106 @@
|
|
|
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/workflows.md
CHANGED
|
@@ -693,3 +693,22 @@ OPENAI_API_KEY=sk-... npm run test:vision
|
|
|
693
693
|
# Full backend suite
|
|
694
694
|
npm test
|
|
695
695
|
```
|
|
696
|
+
|
|
697
|
+
---
|
|
698
|
+
|
|
699
|
+
## From Durable to DAG
|
|
700
|
+
|
|
701
|
+
Every durable workflow you write is a candidate for compilation. The `ltc` CLI reads your workflow source and produces an equivalent YAML DAG that runs without replay overhead.
|
|
702
|
+
|
|
703
|
+
```bash
|
|
704
|
+
ltc compile workflows/my-workflow.ts
|
|
705
|
+
```
|
|
706
|
+
|
|
707
|
+
The durable code is the spec — developer-friendly, familiar, testable with standard tools. The compiled YAML is the optimized execution path — each step fires exactly once, state is plucked explicitly from upstream activities, no replay loop.
|
|
708
|
+
|
|
709
|
+
```
|
|
710
|
+
my-workflow.ts → my-workflow.compiled.yaml
|
|
711
|
+
(write and test here) (deploy and run this)
|
|
712
|
+
```
|
|
713
|
+
|
|
714
|
+
Write procedural because it's productive. Compile because it's fast. See the [Compiler Guide](compiler.md) for details.
|