@hotmeshio/long-tail 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (809) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +262 -0
  3. package/build/examples/external-mcp-server/server.d.ts +17 -0
  4. package/build/examples/external-mcp-server/server.js +116 -0
  5. package/build/examples/index.d.ts +2 -0
  6. package/build/examples/index.js +7 -0
  7. package/build/examples/seed.d.ts +5 -0
  8. package/build/examples/seed.js +221 -0
  9. package/build/examples/types/envelopes.d.ts +34 -0
  10. package/build/examples/types/envelopes.js +8 -0
  11. package/build/examples/types/index.d.ts +10 -0
  12. package/build/examples/types/index.js +9 -0
  13. package/build/examples/types/resolvers.d.ts +27 -0
  14. package/build/examples/types/resolvers.js +9 -0
  15. package/build/examples/workers.d.ts +10 -0
  16. package/build/examples/workers.js +49 -0
  17. package/build/examples/workflows/basic-echo/activities.d.ts +20 -0
  18. package/build/examples/workflows/basic-echo/activities.js +55 -0
  19. package/build/examples/workflows/basic-echo/index.d.ts +14 -0
  20. package/build/examples/workflows/basic-echo/index.js +66 -0
  21. package/build/examples/workflows/kitchen-sink/activities.d.ts +40 -0
  22. package/build/examples/workflows/kitchen-sink/activities.js +46 -0
  23. package/build/examples/workflows/kitchen-sink/index.d.ts +22 -0
  24. package/build/examples/workflows/kitchen-sink/index.js +123 -0
  25. package/build/examples/workflows/review-content/activities.d.ts +10 -0
  26. package/build/examples/workflows/review-content/activities.js +44 -0
  27. package/build/examples/workflows/review-content/index.d.ts +10 -0
  28. package/build/examples/workflows/review-content/index.js +95 -0
  29. package/build/examples/workflows/review-content/types.d.ts +28 -0
  30. package/build/examples/workflows/review-content/types.js +2 -0
  31. package/build/index.d.ts +37 -0
  32. package/build/index.js +151 -0
  33. package/build/modules/auth.d.ts +58 -0
  34. package/build/modules/auth.js +163 -0
  35. package/build/modules/config.d.ts +19 -0
  36. package/build/modules/config.js +26 -0
  37. package/build/modules/defaults.d.ts +58 -0
  38. package/build/modules/defaults.js +95 -0
  39. package/build/modules/ltconfig.d.ts +21 -0
  40. package/build/modules/ltconfig.js +110 -0
  41. package/build/modules/maintenance.d.ts +18 -0
  42. package/build/modules/maintenance.js +47 -0
  43. package/build/routes/auth.d.ts +2 -0
  44. package/build/routes/auth.js +48 -0
  45. package/build/routes/bot-accounts.d.ts +2 -0
  46. package/build/routes/bot-accounts.js +280 -0
  47. package/build/routes/controlplane.d.ts +2 -0
  48. package/build/routes/controlplane.js +144 -0
  49. package/build/routes/dba.d.ts +2 -0
  50. package/build/routes/dba.js +86 -0
  51. package/build/routes/delegation.d.ts +2 -0
  52. package/build/routes/delegation.js +81 -0
  53. package/build/routes/escalations/bulk.d.ts +2 -0
  54. package/build/routes/escalations/bulk.js +324 -0
  55. package/build/routes/escalations/helpers.d.ts +5 -0
  56. package/build/routes/escalations/helpers.js +48 -0
  57. package/build/routes/escalations/index.d.ts +2 -0
  58. package/build/routes/escalations/index.js +20 -0
  59. package/build/routes/escalations/list.d.ts +2 -0
  60. package/build/routes/escalations/list.js +140 -0
  61. package/build/routes/escalations/resolve.d.ts +2 -0
  62. package/build/routes/escalations/resolve.js +240 -0
  63. package/build/routes/escalations/single.d.ts +2 -0
  64. package/build/routes/escalations/single.js +195 -0
  65. package/build/routes/exports.d.ts +2 -0
  66. package/build/routes/exports.js +163 -0
  67. package/build/routes/files.d.ts +2 -0
  68. package/build/routes/files.js +47 -0
  69. package/build/routes/index.d.ts +2 -0
  70. package/build/routes/index.js +52 -0
  71. package/build/routes/insight.d.ts +2 -0
  72. package/build/routes/insight.js +58 -0
  73. package/build/routes/maintenance.d.ts +2 -0
  74. package/build/routes/maintenance.js +38 -0
  75. package/build/routes/mcp-runs.d.ts +2 -0
  76. package/build/routes/mcp-runs.js +85 -0
  77. package/build/routes/mcp.d.ts +2 -0
  78. package/build/routes/mcp.js +264 -0
  79. package/build/routes/namespaces.d.ts +2 -0
  80. package/build/routes/namespaces.js +71 -0
  81. package/build/routes/oauth.d.ts +7 -0
  82. package/build/routes/oauth.js +217 -0
  83. package/build/routes/resolve.d.ts +9 -0
  84. package/build/routes/resolve.js +19 -0
  85. package/build/routes/roles.d.ts +2 -0
  86. package/build/routes/roles.js +195 -0
  87. package/build/routes/settings.d.ts +2 -0
  88. package/build/routes/settings.js +35 -0
  89. package/build/routes/tasks.d.ts +2 -0
  90. package/build/routes/tasks.js +133 -0
  91. package/build/routes/users.d.ts +2 -0
  92. package/build/routes/users.js +206 -0
  93. package/build/routes/workflows/config.d.ts +2 -0
  94. package/build/routes/workflows/config.js +123 -0
  95. package/build/routes/workflows/discovery.d.ts +2 -0
  96. package/build/routes/workflows/discovery.js +146 -0
  97. package/build/routes/workflows/index.d.ts +2 -0
  98. package/build/routes/workflows/index.js +18 -0
  99. package/build/routes/workflows/invocation.d.ts +2 -0
  100. package/build/routes/workflows/invocation.js +162 -0
  101. package/build/routes/yaml-workflows/crud.d.ts +2 -0
  102. package/build/routes/yaml-workflows/crud.js +276 -0
  103. package/build/routes/yaml-workflows/deployment.d.ts +2 -0
  104. package/build/routes/yaml-workflows/deployment.js +179 -0
  105. package/build/routes/yaml-workflows/helpers.d.ts +2 -0
  106. package/build/routes/yaml-workflows/helpers.js +8 -0
  107. package/build/routes/yaml-workflows/index.d.ts +2 -0
  108. package/build/routes/yaml-workflows/index.js +21 -0
  109. package/build/routes/yaml-workflows/versions.d.ts +2 -0
  110. package/build/routes/yaml-workflows/versions.js +116 -0
  111. package/build/scripts/process-helpers.d.ts +11 -0
  112. package/build/scripts/process-helpers.js +59 -0
  113. package/build/scripts/process.d.ts +18 -0
  114. package/build/scripts/process.js +191 -0
  115. package/build/scripts/token.d.ts +13 -0
  116. package/build/scripts/token.js +42 -0
  117. package/build/services/auth/bot-api-key.d.ts +32 -0
  118. package/build/services/auth/bot-api-key.js +112 -0
  119. package/build/services/auth/delegation.d.ts +20 -0
  120. package/build/services/auth/delegation.js +53 -0
  121. package/build/services/auth/service-token.d.ts +23 -0
  122. package/build/services/auth/service-token.js +105 -0
  123. package/build/services/config/cache.d.ts +2 -0
  124. package/build/services/config/cache.js +24 -0
  125. package/build/services/config/index.d.ts +4 -0
  126. package/build/services/config/index.js +13 -0
  127. package/build/services/config/provider.d.ts +2 -0
  128. package/build/services/config/provider.js +30 -0
  129. package/build/services/config/read.d.ts +3 -0
  130. package/build/services/config/read.js +68 -0
  131. package/build/services/config/sql.d.ts +14 -0
  132. package/build/services/config/sql.js +58 -0
  133. package/build/services/config/write.d.ts +5 -0
  134. package/build/services/config/write.js +61 -0
  135. package/build/services/controlplane/index.d.ts +47 -0
  136. package/build/services/controlplane/index.js +124 -0
  137. package/build/services/controlplane/quorum-bridge.d.ts +15 -0
  138. package/build/services/controlplane/quorum-bridge.js +62 -0
  139. package/build/services/controlplane/sql.d.ts +21 -0
  140. package/build/services/controlplane/sql.js +70 -0
  141. package/build/services/controlplane/types.d.ts +13 -0
  142. package/build/services/controlplane/types.js +3 -0
  143. package/build/services/cron/index.d.ts +46 -0
  144. package/build/services/cron/index.js +199 -0
  145. package/build/services/db/index.d.ts +3 -0
  146. package/build/services/db/index.js +19 -0
  147. package/build/services/db/migrate.d.ts +1 -0
  148. package/build/services/db/migrate.js +78 -0
  149. package/build/services/dba.d.ts +28 -0
  150. package/build/services/dba.js +32 -0
  151. package/build/services/escalation/bulk.d.ts +27 -0
  152. package/build/services/escalation/bulk.js +57 -0
  153. package/build/services/escalation/crud.d.ts +47 -0
  154. package/build/services/escalation/crud.js +150 -0
  155. package/build/services/escalation/index.d.ts +4 -0
  156. package/build/services/escalation/index.js +20 -0
  157. package/build/services/escalation/queries.d.ts +37 -0
  158. package/build/services/escalation/queries.js +163 -0
  159. package/build/services/escalation/sql.d.ts +21 -0
  160. package/build/services/escalation/sql.js +135 -0
  161. package/build/services/escalation/types.d.ts +43 -0
  162. package/build/services/escalation/types.js +13 -0
  163. package/build/services/escalation-strategy/default.d.ts +12 -0
  164. package/build/services/escalation-strategy/default.js +17 -0
  165. package/build/services/escalation-strategy/index.d.ts +21 -0
  166. package/build/services/escalation-strategy/index.js +32 -0
  167. package/build/services/escalation-strategy/mcp.d.ts +13 -0
  168. package/build/services/escalation-strategy/mcp.js +51 -0
  169. package/build/services/events/index.d.ts +37 -0
  170. package/build/services/events/index.js +64 -0
  171. package/build/services/events/memory.d.ts +27 -0
  172. package/build/services/events/memory.js +40 -0
  173. package/build/services/events/nats.d.ts +29 -0
  174. package/build/services/events/nats.js +50 -0
  175. package/build/services/events/publish.d.ts +72 -0
  176. package/build/services/events/publish.js +106 -0
  177. package/build/services/events/socketio.d.ts +33 -0
  178. package/build/services/events/socketio.js +70 -0
  179. package/build/services/export/client.d.ts +2 -0
  180. package/build/services/export/client.js +16 -0
  181. package/build/services/export/index.d.ts +39 -0
  182. package/build/services/export/index.js +158 -0
  183. package/build/services/export/post-process.d.ts +16 -0
  184. package/build/services/export/post-process.js +133 -0
  185. package/build/services/export/types.d.ts +25 -0
  186. package/build/services/export/types.js +2 -0
  187. package/build/services/hotmesh-utils.d.ts +61 -0
  188. package/build/services/hotmesh-utils.js +204 -0
  189. package/build/services/iam/activity.d.ts +52 -0
  190. package/build/services/iam/activity.js +59 -0
  191. package/build/services/iam/bots.d.ts +83 -0
  192. package/build/services/iam/bots.js +157 -0
  193. package/build/services/iam/context.d.ts +14 -0
  194. package/build/services/iam/context.js +61 -0
  195. package/build/services/iam/credentials.d.ts +42 -0
  196. package/build/services/iam/credentials.js +86 -0
  197. package/build/services/iam/envelope.d.ts +10 -0
  198. package/build/services/iam/envelope.js +32 -0
  199. package/build/services/iam/ephemeral.d.ts +50 -0
  200. package/build/services/iam/ephemeral.js +131 -0
  201. package/build/services/iam/index.d.ts +19 -0
  202. package/build/services/iam/index.js +37 -0
  203. package/build/services/iam/principal.d.ts +12 -0
  204. package/build/services/iam/principal.js +53 -0
  205. package/build/services/iam/resolve.d.ts +48 -0
  206. package/build/services/iam/resolve.js +89 -0
  207. package/build/services/insight/index.d.ts +30 -0
  208. package/build/services/insight/index.js +81 -0
  209. package/build/services/insight/prompts.d.ts +4 -0
  210. package/build/services/insight/prompts.js +15 -0
  211. package/build/services/interceptor/activities/config.d.ts +21 -0
  212. package/build/services/interceptor/activities/config.js +26 -0
  213. package/build/services/interceptor/activities/escalation.d.ts +58 -0
  214. package/build/services/interceptor/activities/escalation.js +110 -0
  215. package/build/services/interceptor/activities/index.d.ts +4 -0
  216. package/build/services/interceptor/activities/index.js +23 -0
  217. package/build/services/interceptor/activities/task.d.ts +65 -0
  218. package/build/services/interceptor/activities/task.js +168 -0
  219. package/build/services/interceptor/activities/workflow.d.ts +26 -0
  220. package/build/services/interceptor/activities/workflow.js +41 -0
  221. package/build/services/interceptor/activity-interceptor.d.ts +32 -0
  222. package/build/services/interceptor/activity-interceptor.js +86 -0
  223. package/build/services/interceptor/completion.d.ts +16 -0
  224. package/build/services/interceptor/completion.js +149 -0
  225. package/build/services/interceptor/context.d.ts +11 -0
  226. package/build/services/interceptor/context.js +20 -0
  227. package/build/services/interceptor/escalation.d.ts +26 -0
  228. package/build/services/interceptor/escalation.js +150 -0
  229. package/build/services/interceptor/index.d.ts +45 -0
  230. package/build/services/interceptor/index.js +160 -0
  231. package/build/services/interceptor/lifecycle.d.ts +44 -0
  232. package/build/services/interceptor/lifecycle.js +174 -0
  233. package/build/services/interceptor/state.d.ts +22 -0
  234. package/build/services/interceptor/state.js +36 -0
  235. package/build/services/interceptor/types.d.ts +43 -0
  236. package/build/services/interceptor/types.js +3 -0
  237. package/build/services/llm/detect.d.ts +16 -0
  238. package/build/services/llm/detect.js +33 -0
  239. package/build/services/llm/index.d.ts +34 -0
  240. package/build/services/llm/index.js +106 -0
  241. package/build/services/llm/providers/anthropic.d.ts +11 -0
  242. package/build/services/llm/providers/anthropic.js +85 -0
  243. package/build/services/llm/providers/openai.d.ts +9 -0
  244. package/build/services/llm/providers/openai.js +46 -0
  245. package/build/services/llm/translate.d.ts +66 -0
  246. package/build/services/llm/translate.js +192 -0
  247. package/build/services/llm/types.d.ts +64 -0
  248. package/build/services/llm/types.js +8 -0
  249. package/build/services/logger/index.d.ts +32 -0
  250. package/build/services/logger/index.js +69 -0
  251. package/build/services/logger/pino.d.ts +24 -0
  252. package/build/services/logger/pino.js +59 -0
  253. package/build/services/maintenance/index.d.ts +43 -0
  254. package/build/services/maintenance/index.js +183 -0
  255. package/build/services/mcp/adapter.d.ts +23 -0
  256. package/build/services/mcp/adapter.js +119 -0
  257. package/build/services/mcp/client/connection.d.ts +46 -0
  258. package/build/services/mcp/client/connection.js +280 -0
  259. package/build/services/mcp/client/index.d.ts +2 -0
  260. package/build/services/mcp/client/index.js +16 -0
  261. package/build/services/mcp/client/tools.d.ts +22 -0
  262. package/build/services/mcp/client/tools.js +118 -0
  263. package/build/services/mcp/db-server/index.d.ts +25 -0
  264. package/build/services/mcp/db-server/index.js +49 -0
  265. package/build/services/mcp/db-server/schemas.d.ts +52 -0
  266. package/build/services/mcp/db-server/schemas.js +34 -0
  267. package/build/services/mcp/db-server/tools.d.ts +5 -0
  268. package/build/services/mcp/db-server/tools.js +224 -0
  269. package/build/services/mcp/db.d.ts +26 -0
  270. package/build/services/mcp/db.js +141 -0
  271. package/build/services/mcp/index.d.ts +25 -0
  272. package/build/services/mcp/index.js +47 -0
  273. package/build/services/mcp/playwright-server/index.d.ts +14 -0
  274. package/build/services/mcp/playwright-server/index.js +25 -0
  275. package/build/services/mcp/playwright-server/lifecycle.d.ts +7 -0
  276. package/build/services/mcp/playwright-server/lifecycle.js +63 -0
  277. package/build/services/mcp/playwright-server/schemas.d.ts +81 -0
  278. package/build/services/mcp/playwright-server/schemas.js +48 -0
  279. package/build/services/mcp/playwright-server/tools.d.ts +2 -0
  280. package/build/services/mcp/playwright-server/tools.js +224 -0
  281. package/build/services/mcp/server.d.ts +26 -0
  282. package/build/services/mcp/server.js +286 -0
  283. package/build/services/mcp/sql.d.ts +12 -0
  284. package/build/services/mcp/sql.js +59 -0
  285. package/build/services/mcp/types.d.ts +17 -0
  286. package/build/services/mcp/types.js +3 -0
  287. package/build/services/mcp/vision-server.d.ts +15 -0
  288. package/build/services/mcp/vision-server.js +214 -0
  289. package/build/services/mcp/workflow-compiler-server.d.ts +15 -0
  290. package/build/services/mcp/workflow-compiler-server.js +206 -0
  291. package/build/services/mcp/workflow-server.d.ts +24 -0
  292. package/build/services/mcp/workflow-server.js +230 -0
  293. package/build/services/mcp-runs/enrichment.d.ts +12 -0
  294. package/build/services/mcp-runs/enrichment.js +39 -0
  295. package/build/services/mcp-runs/events.d.ts +6 -0
  296. package/build/services/mcp-runs/events.js +126 -0
  297. package/build/services/mcp-runs/execution-builder.d.ts +12 -0
  298. package/build/services/mcp-runs/execution-builder.js +100 -0
  299. package/build/services/mcp-runs/index.d.ts +4 -0
  300. package/build/services/mcp-runs/index.js +8 -0
  301. package/build/services/mcp-runs/queries.d.ts +28 -0
  302. package/build/services/mcp-runs/queries.js +71 -0
  303. package/build/services/mcp-runs/sql.d.ts +4 -0
  304. package/build/services/mcp-runs/sql.js +17 -0
  305. package/build/services/mcp-runs/types.d.ts +65 -0
  306. package/build/services/mcp-runs/types.js +2 -0
  307. package/build/services/namespace/index.d.ts +17 -0
  308. package/build/services/namespace/index.js +41 -0
  309. package/build/services/namespace/sql.d.ts +4 -0
  310. package/build/services/namespace/sql.js +23 -0
  311. package/build/services/namespace/types.d.ts +11 -0
  312. package/build/services/namespace/types.js +3 -0
  313. package/build/services/oauth/crypto.d.ts +19 -0
  314. package/build/services/oauth/crypto.js +95 -0
  315. package/build/services/oauth/db.d.ts +20 -0
  316. package/build/services/oauth/db.js +140 -0
  317. package/build/services/oauth/index.d.ts +12 -0
  318. package/build/services/oauth/index.js +77 -0
  319. package/build/services/oauth/providers/anthropic.d.ts +3 -0
  320. package/build/services/oauth/providers/anthropic.js +111 -0
  321. package/build/services/oauth/providers/github.d.ts +3 -0
  322. package/build/services/oauth/providers/github.js +46 -0
  323. package/build/services/oauth/providers/google.d.ts +3 -0
  324. package/build/services/oauth/providers/google.js +44 -0
  325. package/build/services/oauth/providers/index.d.ts +2 -0
  326. package/build/services/oauth/providers/index.js +7 -0
  327. package/build/services/oauth/providers/microsoft.d.ts +3 -0
  328. package/build/services/oauth/providers/microsoft.js +46 -0
  329. package/build/services/oauth/providers/mock.d.ts +3 -0
  330. package/build/services/oauth/providers/mock.js +76 -0
  331. package/build/services/oauth/providers/registry.d.ts +8 -0
  332. package/build/services/oauth/providers/registry.js +46 -0
  333. package/build/services/oauth/providers/types.d.ts +13 -0
  334. package/build/services/oauth/providers/types.js +2 -0
  335. package/build/services/oauth/state.d.ts +30 -0
  336. package/build/services/oauth/state.js +83 -0
  337. package/build/services/orchestrator/index.d.ts +23 -0
  338. package/build/services/orchestrator/index.js +156 -0
  339. package/build/services/orchestrator/types.d.ts +15 -0
  340. package/build/services/orchestrator/types.js +3 -0
  341. package/build/services/role/index.d.ts +47 -0
  342. package/build/services/role/index.js +136 -0
  343. package/build/services/role/sql.d.ts +14 -0
  344. package/build/services/role/sql.js +80 -0
  345. package/build/services/role/types.d.ts +11 -0
  346. package/build/services/role/types.js +3 -0
  347. package/build/services/storage/index.d.ts +12 -0
  348. package/build/services/storage/index.js +31 -0
  349. package/build/services/storage/local.d.ts +26 -0
  350. package/build/services/storage/local.js +129 -0
  351. package/build/services/storage/s3.d.ts +31 -0
  352. package/build/services/storage/s3.js +180 -0
  353. package/build/services/storage/types.d.ts +41 -0
  354. package/build/services/storage/types.js +2 -0
  355. package/build/services/task/crud.d.ts +21 -0
  356. package/build/services/task/crud.js +123 -0
  357. package/build/services/task/index.d.ts +4 -0
  358. package/build/services/task/index.js +20 -0
  359. package/build/services/task/process.d.ts +14 -0
  360. package/build/services/task/process.js +98 -0
  361. package/build/services/task/resolve.d.ts +12 -0
  362. package/build/services/task/resolve.js +49 -0
  363. package/build/services/task/sql.d.ts +19 -0
  364. package/build/services/task/sql.js +92 -0
  365. package/build/services/task/types.d.ts +56 -0
  366. package/build/services/task/types.js +9 -0
  367. package/build/services/telemetry/honeycomb.d.ts +53 -0
  368. package/build/services/telemetry/honeycomb.js +79 -0
  369. package/build/services/telemetry/index.d.ts +46 -0
  370. package/build/services/telemetry/index.js +68 -0
  371. package/build/services/user/auth.d.ts +7 -0
  372. package/build/services/user/auth.js +26 -0
  373. package/build/services/user/crud.d.ts +19 -0
  374. package/build/services/user/crud.js +151 -0
  375. package/build/services/user/index.d.ts +5 -0
  376. package/build/services/user/index.js +26 -0
  377. package/build/services/user/rbac.d.ts +15 -0
  378. package/build/services/user/rbac.js +32 -0
  379. package/build/services/user/roles.d.ts +7 -0
  380. package/build/services/user/roles.js +42 -0
  381. package/build/services/user/sql.d.ts +22 -0
  382. package/build/services/user/sql.js +45 -0
  383. package/build/services/user/types.d.ts +23 -0
  384. package/build/services/user/types.js +4 -0
  385. package/build/services/workers/registry.d.ts +10 -0
  386. package/build/services/workers/registry.js +26 -0
  387. package/build/services/workflow-invocation.d.ts +46 -0
  388. package/build/services/workflow-invocation.js +184 -0
  389. package/build/services/yaml-workflow/db-utils.d.ts +25 -0
  390. package/build/services/yaml-workflow/db-utils.js +93 -0
  391. package/build/services/yaml-workflow/db.d.ts +27 -0
  392. package/build/services/yaml-workflow/db.js +196 -0
  393. package/build/services/yaml-workflow/deployer-helpers.d.ts +13 -0
  394. package/build/services/yaml-workflow/deployer-helpers.js +133 -0
  395. package/build/services/yaml-workflow/deployer.d.ts +54 -0
  396. package/build/services/yaml-workflow/deployer.js +203 -0
  397. package/build/services/yaml-workflow/generator.d.ts +21 -0
  398. package/build/services/yaml-workflow/generator.js +117 -0
  399. package/build/services/yaml-workflow/index.d.ts +4 -0
  400. package/build/services/yaml-workflow/index.js +20 -0
  401. package/build/services/yaml-workflow/input-analyzer-helpers.d.ts +48 -0
  402. package/build/services/yaml-workflow/input-analyzer-helpers.js +183 -0
  403. package/build/services/yaml-workflow/input-analyzer.d.ts +30 -0
  404. package/build/services/yaml-workflow/input-analyzer.js +109 -0
  405. package/build/services/yaml-workflow/pattern-detector/array-source.d.ts +22 -0
  406. package/build/services/yaml-workflow/pattern-detector/array-source.js +120 -0
  407. package/build/services/yaml-workflow/pattern-detector/collapse.d.ts +27 -0
  408. package/build/services/yaml-workflow/pattern-detector/collapse.js +92 -0
  409. package/build/services/yaml-workflow/pattern-detector/index.d.ts +18 -0
  410. package/build/services/yaml-workflow/pattern-detector/index.js +22 -0
  411. package/build/services/yaml-workflow/pattern-detector/run-detection.d.ts +28 -0
  412. package/build/services/yaml-workflow/pattern-detector/run-detection.js +81 -0
  413. package/build/services/yaml-workflow/pattern-detector/types.d.ts +29 -0
  414. package/build/services/yaml-workflow/pattern-detector/types.js +8 -0
  415. package/build/services/yaml-workflow/pipeline/analyze.d.ts +11 -0
  416. package/build/services/yaml-workflow/pipeline/analyze.js +64 -0
  417. package/build/services/yaml-workflow/pipeline/build/dag.d.ts +25 -0
  418. package/build/services/yaml-workflow/pipeline/build/dag.js +254 -0
  419. package/build/services/yaml-workflow/pipeline/build/index.d.ts +20 -0
  420. package/build/services/yaml-workflow/pipeline/build/index.js +115 -0
  421. package/build/services/yaml-workflow/pipeline/build/iteration.d.ts +25 -0
  422. package/build/services/yaml-workflow/pipeline/build/iteration.js +231 -0
  423. package/build/services/yaml-workflow/pipeline/build/metadata.d.ts +15 -0
  424. package/build/services/yaml-workflow/pipeline/build/metadata.js +126 -0
  425. package/build/services/yaml-workflow/pipeline/build/transform.d.ts +17 -0
  426. package/build/services/yaml-workflow/pipeline/build/transform.js +94 -0
  427. package/build/services/yaml-workflow/pipeline/build/utils.d.ts +22 -0
  428. package/build/services/yaml-workflow/pipeline/build/utils.js +129 -0
  429. package/build/services/yaml-workflow/pipeline/build/wiring.d.ts +9 -0
  430. package/build/services/yaml-workflow/pipeline/build/wiring.js +148 -0
  431. package/build/services/yaml-workflow/pipeline/compile/index.d.ts +17 -0
  432. package/build/services/yaml-workflow/pipeline/compile/index.js +64 -0
  433. package/build/services/yaml-workflow/pipeline/compile/llm-call.d.ts +14 -0
  434. package/build/services/yaml-workflow/pipeline/compile/llm-call.js +153 -0
  435. package/build/services/yaml-workflow/pipeline/compile/parse-plan.d.ts +12 -0
  436. package/build/services/yaml-workflow/pipeline/compile/parse-plan.js +88 -0
  437. package/build/services/yaml-workflow/pipeline/compile/summarize.d.ts +39 -0
  438. package/build/services/yaml-workflow/pipeline/compile/summarize.js +174 -0
  439. package/build/services/yaml-workflow/pipeline/extract-helpers.d.ts +42 -0
  440. package/build/services/yaml-workflow/pipeline/extract-helpers.js +88 -0
  441. package/build/services/yaml-workflow/pipeline/extract.d.ts +24 -0
  442. package/build/services/yaml-workflow/pipeline/extract.js +235 -0
  443. package/build/services/yaml-workflow/pipeline/prompts.d.ts +15 -0
  444. package/build/services/yaml-workflow/pipeline/prompts.js +254 -0
  445. package/build/services/yaml-workflow/pipeline/validate.d.ts +12 -0
  446. package/build/services/yaml-workflow/pipeline/validate.js +111 -0
  447. package/build/services/yaml-workflow/sql.d.ts +19 -0
  448. package/build/services/yaml-workflow/sql.js +83 -0
  449. package/build/services/yaml-workflow/types.d.ts +223 -0
  450. package/build/services/yaml-workflow/types.js +8 -0
  451. package/build/services/yaml-workflow/workers/callbacks.d.ts +17 -0
  452. package/build/services/yaml-workflow/workers/callbacks.js +194 -0
  453. package/build/services/yaml-workflow/workers/events.d.ts +7 -0
  454. package/build/services/yaml-workflow/workers/events.js +49 -0
  455. package/build/services/yaml-workflow/workers/index.d.ts +4 -0
  456. package/build/services/yaml-workflow/workers/index.js +15 -0
  457. package/build/services/yaml-workflow/workers/register.d.ts +15 -0
  458. package/build/services/yaml-workflow/workers/register.js +233 -0
  459. package/build/services/yaml-workflow/workers/scope.d.ts +13 -0
  460. package/build/services/yaml-workflow/workers/scope.js +37 -0
  461. package/build/start/adapters.d.ts +6 -0
  462. package/build/start/adapters.js +80 -0
  463. package/build/start/config.d.ts +10 -0
  464. package/build/start/config.js +88 -0
  465. package/build/start/index.d.ts +21 -0
  466. package/build/start/index.js +87 -0
  467. package/build/start/server.d.ts +6 -0
  468. package/build/start/server.js +46 -0
  469. package/build/start/workers.d.ts +32 -0
  470. package/build/start/workers.js +144 -0
  471. package/build/system/activities/claude-code.d.ts +56 -0
  472. package/build/system/activities/claude-code.js +258 -0
  473. package/build/system/activities/file-storage.d.ts +31 -0
  474. package/build/system/activities/file-storage.js +71 -0
  475. package/build/system/activities/http.d.ts +27 -0
  476. package/build/system/activities/http.js +56 -0
  477. package/build/system/activities/oauth.d.ts +39 -0
  478. package/build/system/activities/oauth.js +33 -0
  479. package/build/system/activities/triage/cache.d.ts +7 -0
  480. package/build/system/activities/triage/cache.js +10 -0
  481. package/build/system/activities/triage/context.d.ts +21 -0
  482. package/build/system/activities/triage/context.js +92 -0
  483. package/build/system/activities/triage/discovery.d.ts +25 -0
  484. package/build/system/activities/triage/discovery.js +170 -0
  485. package/build/system/activities/triage/index.d.ts +5 -0
  486. package/build/system/activities/triage/index.js +22 -0
  487. package/build/system/activities/triage/llm.d.ts +9 -0
  488. package/build/system/activities/triage/llm.js +34 -0
  489. package/build/system/activities/triage/tools.d.ts +24 -0
  490. package/build/system/activities/triage/tools.js +178 -0
  491. package/build/system/index.d.ts +16 -0
  492. package/build/system/index.js +100 -0
  493. package/build/system/mcp-servers/claude-code.d.ts +17 -0
  494. package/build/system/mcp-servers/claude-code.js +110 -0
  495. package/build/system/mcp-servers/db-query/index.d.ts +25 -0
  496. package/build/system/mcp-servers/db-query/index.js +49 -0
  497. package/build/system/mcp-servers/db-query/schemas.d.ts +52 -0
  498. package/build/system/mcp-servers/db-query/schemas.js +34 -0
  499. package/build/system/mcp-servers/db-query/tools.d.ts +5 -0
  500. package/build/system/mcp-servers/db-query/tools.js +224 -0
  501. package/build/system/mcp-servers/document-vision.d.ts +15 -0
  502. package/build/system/mcp-servers/document-vision.js +228 -0
  503. package/build/system/mcp-servers/file-storage.d.ts +4 -0
  504. package/build/system/mcp-servers/file-storage.js +101 -0
  505. package/build/system/mcp-servers/http-fetch.d.ts +4 -0
  506. package/build/system/mcp-servers/http-fetch.js +100 -0
  507. package/build/system/mcp-servers/human-queue.d.ts +26 -0
  508. package/build/system/mcp-servers/human-queue.js +287 -0
  509. package/build/system/mcp-servers/oauth.d.ts +11 -0
  510. package/build/system/mcp-servers/oauth.js +100 -0
  511. package/build/system/mcp-servers/playwright/browser-lifecycle.d.ts +26 -0
  512. package/build/system/mcp-servers/playwright/browser-lifecycle.js +125 -0
  513. package/build/system/mcp-servers/playwright/index.d.ts +25 -0
  514. package/build/system/mcp-servers/playwright/index.js +42 -0
  515. package/build/system/mcp-servers/playwright/schemas.d.ts +383 -0
  516. package/build/system/mcp-servers/playwright/schemas.js +87 -0
  517. package/build/system/mcp-servers/playwright/tools-atomic.d.ts +2 -0
  518. package/build/system/mcp-servers/playwright/tools-atomic.js +9 -0
  519. package/build/system/mcp-servers/playwright/tools-navigation.d.ts +2 -0
  520. package/build/system/mcp-servers/playwright/tools-navigation.js +140 -0
  521. package/build/system/mcp-servers/playwright/tools-page-interaction.d.ts +2 -0
  522. package/build/system/mcp-servers/playwright/tools-page-interaction.js +162 -0
  523. package/build/system/mcp-servers/playwright/tools-run-script.d.ts +2 -0
  524. package/build/system/mcp-servers/playwright/tools-run-script.js +190 -0
  525. package/build/system/mcp-servers/playwright/types.d.ts +8 -0
  526. package/build/system/mcp-servers/playwright/types.js +30 -0
  527. package/build/system/mcp-servers/playwright-cli/helpers.d.ts +11 -0
  528. package/build/system/mcp-servers/playwright-cli/helpers.js +20 -0
  529. package/build/system/mcp-servers/playwright-cli/index.d.ts +4 -0
  530. package/build/system/mcp-servers/playwright-cli/index.js +15 -0
  531. package/build/system/mcp-servers/playwright-cli/schemas.d.ts +219 -0
  532. package/build/system/mcp-servers/playwright-cli/schemas.js +75 -0
  533. package/build/system/mcp-servers/playwright-cli/tools-auth.d.ts +2 -0
  534. package/build/system/mcp-servers/playwright-cli/tools-auth.js +183 -0
  535. package/build/system/mcp-servers/playwright-cli/tools-capture.d.ts +2 -0
  536. package/build/system/mcp-servers/playwright-cli/tools-capture.js +267 -0
  537. package/build/system/mcp-servers/prompts.d.ts +4 -0
  538. package/build/system/mcp-servers/prompts.js +10 -0
  539. package/build/system/mcp-servers/workflow-compiler.d.ts +15 -0
  540. package/build/system/mcp-servers/workflow-compiler.js +230 -0
  541. package/build/system/mcp-servers/workflow.d.ts +24 -0
  542. package/build/system/mcp-servers/workflow.js +231 -0
  543. package/build/system/seed/index.d.ts +7 -0
  544. package/build/system/seed/index.js +36 -0
  545. package/build/system/seed/server-definitions.d.ts +1460 -0
  546. package/build/system/seed/server-definitions.js +160 -0
  547. package/build/system/seed/tool-manifests-browser.d.ts +577 -0
  548. package/build/system/seed/tool-manifests-browser.js +158 -0
  549. package/build/system/seed/tool-manifests-data.d.ts +322 -0
  550. package/build/system/seed/tool-manifests-data.js +173 -0
  551. package/build/system/seed/tool-manifests-escalation.d.ts +173 -0
  552. package/build/system/seed/tool-manifests-escalation.js +76 -0
  553. package/build/system/seed/tool-manifests-workflows.d.ts +211 -0
  554. package/build/system/seed/tool-manifests-workflows.js +136 -0
  555. package/build/system/workflows/mcp-deterministic/activities.d.ts +6 -0
  556. package/build/system/workflows/mcp-deterministic/activities.js +56 -0
  557. package/build/system/workflows/mcp-deterministic/index.d.ts +9 -0
  558. package/build/system/workflows/mcp-deterministic/index.js +72 -0
  559. package/build/system/workflows/mcp-query/activities/caches.d.ts +7 -0
  560. package/build/system/workflows/mcp-query/activities/caches.js +10 -0
  561. package/build/system/workflows/mcp-query/activities/discovery.d.ts +31 -0
  562. package/build/system/workflows/mcp-query/activities/discovery.js +172 -0
  563. package/build/system/workflows/mcp-query/activities/index.d.ts +4 -0
  564. package/build/system/workflows/mcp-query/activities/index.js +13 -0
  565. package/build/system/workflows/mcp-query/activities/llm.d.ts +8 -0
  566. package/build/system/workflows/mcp-query/activities/llm.js +33 -0
  567. package/build/system/workflows/mcp-query/activities/tool-executor.d.ts +5 -0
  568. package/build/system/workflows/mcp-query/activities/tool-executor.js +112 -0
  569. package/build/system/workflows/mcp-query/activities/tool-loader.d.ts +14 -0
  570. package/build/system/workflows/mcp-query/activities/tool-loader.js +93 -0
  571. package/build/system/workflows/mcp-query/index.d.ts +14 -0
  572. package/build/system/workflows/mcp-query/index.js +227 -0
  573. package/build/system/workflows/mcp-query/prompts.d.ts +4 -0
  574. package/build/system/workflows/mcp-query/prompts.js +101 -0
  575. package/build/system/workflows/mcp-query/strategy-advisors.d.ts +14 -0
  576. package/build/system/workflows/mcp-query/strategy-advisors.js +109 -0
  577. package/build/system/workflows/mcp-query/types.d.ts +10 -0
  578. package/build/system/workflows/mcp-query/types.js +3 -0
  579. package/build/system/workflows/mcp-query-router/activities.d.ts +6 -0
  580. package/build/system/workflows/mcp-query-router/activities.js +12 -0
  581. package/build/system/workflows/mcp-query-router/index.d.ts +13 -0
  582. package/build/system/workflows/mcp-query-router/index.js +107 -0
  583. package/build/system/workflows/mcp-query-router/prompts.d.ts +1 -0
  584. package/build/system/workflows/mcp-query-router/prompts.js +8 -0
  585. package/build/system/workflows/mcp-triage/index.d.ts +31 -0
  586. package/build/system/workflows/mcp-triage/index.js +222 -0
  587. package/build/system/workflows/mcp-triage/prompts.d.ts +7 -0
  588. package/build/system/workflows/mcp-triage/prompts.js +159 -0
  589. package/build/system/workflows/mcp-triage/response-builders.d.ts +17 -0
  590. package/build/system/workflows/mcp-triage/response-builders.js +96 -0
  591. package/build/system/workflows/mcp-triage/response.d.ts +8 -0
  592. package/build/system/workflows/mcp-triage/response.js +157 -0
  593. package/build/system/workflows/mcp-triage/types.d.ts +20 -0
  594. package/build/system/workflows/mcp-triage/types.js +3 -0
  595. package/build/system/workflows/mcp-triage-deterministic/activities.d.ts +4 -0
  596. package/build/system/workflows/mcp-triage-deterministic/activities.js +8 -0
  597. package/build/system/workflows/mcp-triage-deterministic/index.d.ts +12 -0
  598. package/build/system/workflows/mcp-triage-deterministic/index.js +83 -0
  599. package/build/system/workflows/mcp-triage-router/activities.d.ts +9 -0
  600. package/build/system/workflows/mcp-triage-router/activities.js +15 -0
  601. package/build/system/workflows/mcp-triage-router/index.d.ts +13 -0
  602. package/build/system/workflows/mcp-triage-router/index.js +122 -0
  603. package/build/tsconfig.tsbuildinfo +1 -0
  604. package/build/types/auth.d.ts +34 -0
  605. package/build/types/auth.js +2 -0
  606. package/build/types/config.d.ts +48 -0
  607. package/build/types/config.js +2 -0
  608. package/build/types/delegation.d.ts +41 -0
  609. package/build/types/delegation.js +2 -0
  610. package/build/types/discovery.d.ts +12 -0
  611. package/build/types/discovery.js +3 -0
  612. package/build/types/envelope.d.ts +53 -0
  613. package/build/types/envelope.js +2 -0
  614. package/build/types/escalation-strategy.d.ts +37 -0
  615. package/build/types/escalation-strategy.js +2 -0
  616. package/build/types/escalation.d.ts +39 -0
  617. package/build/types/escalation.js +21 -0
  618. package/build/types/events.d.ts +65 -0
  619. package/build/types/events.js +2 -0
  620. package/build/types/export.d.ts +78 -0
  621. package/build/types/export.js +11 -0
  622. package/build/types/index.d.ts +21 -0
  623. package/build/types/index.js +6 -0
  624. package/build/types/logger.d.ts +26 -0
  625. package/build/types/logger.js +2 -0
  626. package/build/types/maintenance.d.ts +24 -0
  627. package/build/types/maintenance.js +2 -0
  628. package/build/types/mcp.d.ts +80 -0
  629. package/build/types/mcp.js +2 -0
  630. package/build/types/oauth.d.ts +74 -0
  631. package/build/types/oauth.js +2 -0
  632. package/build/types/startup.d.ts +110 -0
  633. package/build/types/startup.js +2 -0
  634. package/build/types/task.d.ts +39 -0
  635. package/build/types/task.js +2 -0
  636. package/build/types/telemetry.d.ts +32 -0
  637. package/build/types/telemetry.js +2 -0
  638. package/build/types/tool-context.d.ts +68 -0
  639. package/build/types/tool-context.js +14 -0
  640. package/build/types/user.d.ts +18 -0
  641. package/build/types/user.js +2 -0
  642. package/build/types/workflow.d.ts +35 -0
  643. package/build/types/workflow.js +2 -0
  644. package/build/types/yaml-workflow.d.ts +101 -0
  645. package/build/types/yaml-workflow.js +5 -0
  646. package/build/vitest.config.d.ts +2 -0
  647. package/build/vitest.config.js +32 -0
  648. package/build/vitest.integration.config.d.ts +2 -0
  649. package/build/vitest.integration.config.js +25 -0
  650. package/build/workers/index.d.ts +6 -0
  651. package/build/workers/index.js +20 -0
  652. package/dashboard/dist/assets/AdminDashboard-jfacvOC7.js +2 -0
  653. package/dashboard/dist/assets/AdminDashboard-jfacvOC7.js.map +1 -0
  654. package/dashboard/dist/assets/AvailableEscalationsPage-BglLDoT8.js +2 -0
  655. package/dashboard/dist/assets/AvailableEscalationsPage-BglLDoT8.js.map +1 -0
  656. package/dashboard/dist/assets/BotPicker-D6FYW1Gt.js +2 -0
  657. package/dashboard/dist/assets/BotPicker-D6FYW1Gt.js.map +1 -0
  658. package/dashboard/dist/assets/CollapsibleSection-Cxk4wvjT.js +2 -0
  659. package/dashboard/dist/assets/CollapsibleSection-Cxk4wvjT.js.map +1 -0
  660. package/dashboard/dist/assets/ConfirmDeleteModal-FSXyKjaB.js +2 -0
  661. package/dashboard/dist/assets/ConfirmDeleteModal-FSXyKjaB.js.map +1 -0
  662. package/dashboard/dist/assets/CopyableId-CBdxWfp8.js +2 -0
  663. package/dashboard/dist/assets/CopyableId-CBdxWfp8.js.map +1 -0
  664. package/dashboard/dist/assets/CredentialsPage-Ikzsot0w.js +2 -0
  665. package/dashboard/dist/assets/CredentialsPage-Ikzsot0w.js.map +1 -0
  666. package/dashboard/dist/assets/CustomDurationPicker-CAninCbl.js +2 -0
  667. package/dashboard/dist/assets/CustomDurationPicker-CAninCbl.js.map +1 -0
  668. package/dashboard/dist/assets/DataTable-BDn1WBHS.js +2 -0
  669. package/dashboard/dist/assets/DataTable-BDn1WBHS.js.map +1 -0
  670. package/dashboard/dist/assets/EmptyState-2CmV-IaS.js +2 -0
  671. package/dashboard/dist/assets/EmptyState-2CmV-IaS.js.map +1 -0
  672. package/dashboard/dist/assets/EscalationsOverview-GXYFPASS.js +2 -0
  673. package/dashboard/dist/assets/EscalationsOverview-GXYFPASS.js.map +1 -0
  674. package/dashboard/dist/assets/EventTable-B01oJf6Y.js +2 -0
  675. package/dashboard/dist/assets/EventTable-B01oJf6Y.js.map +1 -0
  676. package/dashboard/dist/assets/Field-DuFBAYhu.js +2 -0
  677. package/dashboard/dist/assets/Field-DuFBAYhu.js.map +1 -0
  678. package/dashboard/dist/assets/FilterBar-Ck4K4rzu.js +2 -0
  679. package/dashboard/dist/assets/FilterBar-Ck4K4rzu.js.map +1 -0
  680. package/dashboard/dist/assets/McpOverview-JkvRcX2e.js +2 -0
  681. package/dashboard/dist/assets/McpOverview-JkvRcX2e.js.map +1 -0
  682. package/dashboard/dist/assets/McpQueryDetailPage-CUMqhQdS.js +2 -0
  683. package/dashboard/dist/assets/McpQueryDetailPage-CUMqhQdS.js.map +1 -0
  684. package/dashboard/dist/assets/McpQueryPage-DRRhw4nN.js +2 -0
  685. package/dashboard/dist/assets/McpQueryPage-DRRhw4nN.js.map +1 -0
  686. package/dashboard/dist/assets/McpRunDetailPage-CmPs5EvE.js +2 -0
  687. package/dashboard/dist/assets/McpRunDetailPage-CmPs5EvE.js.map +1 -0
  688. package/dashboard/dist/assets/McpRunsPage-Dl5Y2u6k.js +2 -0
  689. package/dashboard/dist/assets/McpRunsPage-Dl5Y2u6k.js.map +1 -0
  690. package/dashboard/dist/assets/Modal-B4rbIVAn.js +2 -0
  691. package/dashboard/dist/assets/Modal-B4rbIVAn.js.map +1 -0
  692. package/dashboard/dist/assets/OperatorDashboard-B56il28q.js +2 -0
  693. package/dashboard/dist/assets/OperatorDashboard-B56il28q.js.map +1 -0
  694. package/dashboard/dist/assets/PageHeader-CpWFly5S.js +2 -0
  695. package/dashboard/dist/assets/PageHeader-CpWFly5S.js.map +1 -0
  696. package/dashboard/dist/assets/PriorityBadge-DfQY9St9.js +2 -0
  697. package/dashboard/dist/assets/PriorityBadge-DfQY9St9.js.map +1 -0
  698. package/dashboard/dist/assets/ProcessDetailPage-CMLq4M7D.js +2 -0
  699. package/dashboard/dist/assets/ProcessDetailPage-CMLq4M7D.js.map +1 -0
  700. package/dashboard/dist/assets/ProcessesListPage-CZ_HF06v.js +2 -0
  701. package/dashboard/dist/assets/ProcessesListPage-CZ_HF06v.js.map +1 -0
  702. package/dashboard/dist/assets/RolePill-BTPa8L-P.js +2 -0
  703. package/dashboard/dist/assets/RolePill-BTPa8L-P.js.map +1 -0
  704. package/dashboard/dist/assets/RolesPage-9grZW7yR.js +2 -0
  705. package/dashboard/dist/assets/RolesPage-9grZW7yR.js.map +1 -0
  706. package/dashboard/dist/assets/RowActions-Dg-Fsm5O.js +2 -0
  707. package/dashboard/dist/assets/RowActions-Dg-Fsm5O.js.map +1 -0
  708. package/dashboard/dist/assets/SimpleMarkdown-CBlvaWP4.js +4 -0
  709. package/dashboard/dist/assets/SimpleMarkdown-CBlvaWP4.js.map +1 -0
  710. package/dashboard/dist/assets/StatCard-DlgF0CJC.js +2 -0
  711. package/dashboard/dist/assets/StatCard-DlgF0CJC.js.map +1 -0
  712. package/dashboard/dist/assets/StatusBadge-TlC4jiig.js +2 -0
  713. package/dashboard/dist/assets/StatusBadge-TlC4jiig.js.map +1 -0
  714. package/dashboard/dist/assets/StickyPagination-F9FZsRy9.js +2 -0
  715. package/dashboard/dist/assets/StickyPagination-F9FZsRy9.js.map +1 -0
  716. package/dashboard/dist/assets/SwimlaneTimeline-7SiwATsZ.js +2 -0
  717. package/dashboard/dist/assets/SwimlaneTimeline-7SiwATsZ.js.map +1 -0
  718. package/dashboard/dist/assets/TaskDetailPage-CbPVTakt.js +2 -0
  719. package/dashboard/dist/assets/TaskDetailPage-CbPVTakt.js.map +1 -0
  720. package/dashboard/dist/assets/TaskQueuePill-awmtb0qw.js +2 -0
  721. package/dashboard/dist/assets/TaskQueuePill-awmtb0qw.js.map +1 -0
  722. package/dashboard/dist/assets/TasksListPage-C_QF23c1.js +2 -0
  723. package/dashboard/dist/assets/TasksListPage-C_QF23c1.js.map +1 -0
  724. package/dashboard/dist/assets/TimeAgo-UPG6DoH8.js +2 -0
  725. package/dashboard/dist/assets/TimeAgo-UPG6DoH8.js.map +1 -0
  726. package/dashboard/dist/assets/TimestampCell-DoWMKg6w.js +2 -0
  727. package/dashboard/dist/assets/TimestampCell-DoWMKg6w.js.map +1 -0
  728. package/dashboard/dist/assets/UserName-DaP4YAKr.js +2 -0
  729. package/dashboard/dist/assets/UserName-DaP4YAKr.js.map +1 -0
  730. package/dashboard/dist/assets/VersionHistory-Bt7WBr6m.js +5 -0
  731. package/dashboard/dist/assets/VersionHistory-Bt7WBr6m.js.map +1 -0
  732. package/dashboard/dist/assets/WorkflowExecutionPage-DjtAQ3hy.js +2 -0
  733. package/dashboard/dist/assets/WorkflowExecutionPage-DjtAQ3hy.js.map +1 -0
  734. package/dashboard/dist/assets/WorkflowPill-CCDSVaQj.js +2 -0
  735. package/dashboard/dist/assets/WorkflowPill-CCDSVaQj.js.map +1 -0
  736. package/dashboard/dist/assets/WorkflowsDashboard-D8z9uBNB.js +2 -0
  737. package/dashboard/dist/assets/WorkflowsDashboard-D8z9uBNB.js.map +1 -0
  738. package/dashboard/dist/assets/WorkflowsOverview-D9OzzQqw.js +2 -0
  739. package/dashboard/dist/assets/WorkflowsOverview-D9OzzQqw.js.map +1 -0
  740. package/dashboard/dist/assets/YamlWorkflowDetailPage-DrDvvP62.js +3 -0
  741. package/dashboard/dist/assets/YamlWorkflowDetailPage-DrDvvP62.js.map +1 -0
  742. package/dashboard/dist/assets/YamlWorkflowsPage-COqiNCQK.js +2 -0
  743. package/dashboard/dist/assets/YamlWorkflowsPage-COqiNCQK.js.map +1 -0
  744. package/dashboard/dist/assets/bots-BkKVMbUW.js +2 -0
  745. package/dashboard/dist/assets/bots-BkKVMbUW.js.map +1 -0
  746. package/dashboard/dist/assets/constants-CgaZfe5d.js +2 -0
  747. package/dashboard/dist/assets/constants-CgaZfe5d.js.map +1 -0
  748. package/dashboard/dist/assets/escalation-columns-D6aqStaY.js +2 -0
  749. package/dashboard/dist/assets/escalation-columns-D6aqStaY.js.map +1 -0
  750. package/dashboard/dist/assets/escalation-qalymbKB.js +2 -0
  751. package/dashboard/dist/assets/escalation-qalymbKB.js.map +1 -0
  752. package/dashboard/dist/assets/format-gXZXQ-HJ.js +2 -0
  753. package/dashboard/dist/assets/format-gXZXQ-HJ.js.map +1 -0
  754. package/dashboard/dist/assets/helpers-0gSleuzT.js +2 -0
  755. package/dashboard/dist/assets/helpers-0gSleuzT.js.map +1 -0
  756. package/dashboard/dist/assets/index-BWvMHed7.js +6 -0
  757. package/dashboard/dist/assets/index-BWvMHed7.js.map +1 -0
  758. package/dashboard/dist/assets/index-BaszoPO_.css +1 -0
  759. package/dashboard/dist/assets/index-Cn2jyj9A.js +2 -0
  760. package/dashboard/dist/assets/index-Cn2jyj9A.js.map +1 -0
  761. package/dashboard/dist/assets/index-D8VH6K8B.js +54 -0
  762. package/dashboard/dist/assets/index-D8VH6K8B.js.map +1 -0
  763. package/dashboard/dist/assets/index-D9SYwJsi.js +3 -0
  764. package/dashboard/dist/assets/index-D9SYwJsi.js.map +1 -0
  765. package/dashboard/dist/assets/index-DTPzZr_X.js +2 -0
  766. package/dashboard/dist/assets/index-DTPzZr_X.js.map +1 -0
  767. package/dashboard/dist/assets/index-D_6AB5BE.js +2 -0
  768. package/dashboard/dist/assets/index-D_6AB5BE.js.map +1 -0
  769. package/dashboard/dist/assets/index-S9Ks2Lj2.js +2 -0
  770. package/dashboard/dist/assets/index-S9Ks2Lj2.js.map +1 -0
  771. package/dashboard/dist/assets/index-X85K5bHC.js +17 -0
  772. package/dashboard/dist/assets/index-X85K5bHC.js.map +1 -0
  773. package/dashboard/dist/assets/index-rjmgHlSH.js +2 -0
  774. package/dashboard/dist/assets/index-rjmgHlSH.js.map +1 -0
  775. package/dashboard/dist/assets/mcp-blCW6IL7.js +2 -0
  776. package/dashboard/dist/assets/mcp-blCW6IL7.js.map +1 -0
  777. package/dashboard/dist/assets/mcp-query-DoAyPbjC.js +2 -0
  778. package/dashboard/dist/assets/mcp-query-DoAyPbjC.js.map +1 -0
  779. package/dashboard/dist/assets/mcp-runs-ChPbpvXK.js +2 -0
  780. package/dashboard/dist/assets/mcp-runs-ChPbpvXK.js.map +1 -0
  781. package/dashboard/dist/assets/namespaces-BgbaC3ow.js +2 -0
  782. package/dashboard/dist/assets/namespaces-BgbaC3ow.js.map +1 -0
  783. package/dashboard/dist/assets/roles-ZNrqqnQl.js +2 -0
  784. package/dashboard/dist/assets/roles-ZNrqqnQl.js.map +1 -0
  785. package/dashboard/dist/assets/settings-eBRSE0mQ.js +2 -0
  786. package/dashboard/dist/assets/settings-eBRSE0mQ.js.map +1 -0
  787. package/dashboard/dist/assets/tasks-tRqClPns.js +2 -0
  788. package/dashboard/dist/assets/tasks-tRqClPns.js.map +1 -0
  789. package/dashboard/dist/assets/useFilterParams-BaXUAkYK.js +2 -0
  790. package/dashboard/dist/assets/useFilterParams-BaXUAkYK.js.map +1 -0
  791. package/dashboard/dist/assets/useNatsEvents-Xr43X1fG.js +2 -0
  792. package/dashboard/dist/assets/useNatsEvents-Xr43X1fG.js.map +1 -0
  793. package/dashboard/dist/assets/useYamlActivityEvents-BO51u8tm.js +2 -0
  794. package/dashboard/dist/assets/useYamlActivityEvents-BO51u8tm.js.map +1 -0
  795. package/dashboard/dist/assets/users-tMvNyOo8.js +2 -0
  796. package/dashboard/dist/assets/users-tMvNyOo8.js.map +1 -0
  797. package/dashboard/dist/assets/vendor-icons-ZTAKVwGc.js +292 -0
  798. package/dashboard/dist/assets/vendor-icons-ZTAKVwGc.js.map +1 -0
  799. package/dashboard/dist/assets/vendor-query-B2UbickB.js +18 -0
  800. package/dashboard/dist/assets/vendor-query-B2UbickB.js.map +1 -0
  801. package/dashboard/dist/assets/vendor-react-Cw8Gy8NJ.js +22 -0
  802. package/dashboard/dist/assets/vendor-react-Cw8Gy8NJ.js.map +1 -0
  803. package/dashboard/dist/assets/workflows-Cc4VHcrp.js +2 -0
  804. package/dashboard/dist/assets/workflows-Cc4VHcrp.js.map +1 -0
  805. package/dashboard/dist/assets/yaml-workflows-BL4V5CQy.js +2 -0
  806. package/dashboard/dist/assets/yaml-workflows-BL4V5CQy.js.map +1 -0
  807. package/dashboard/dist/index.html +20 -0
  808. package/dashboard/dist/logo512.png +0 -0
  809. package/package.json +96 -0
@@ -0,0 +1,235 @@
1
+ "use strict";
2
+ /**
3
+ * Extract stage: Parse execution events into an ordered step sequence.
4
+ *
5
+ * Supports four patterns:
6
+ * 1a. callLLM → callDbTool/callVisionTool (Insight/agentic paired calls)
7
+ * 1b. callLLM → callMcpTool (mcpQuery with qualified names)
8
+ * 2. mcp_* activities (direct external tool calls via proxyActivities)
9
+ * 3. callLLM (interpretation) — final LLM text response
10
+ */
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.extractStepSequence = extractStepSequence;
13
+ exports.resolveServerIds = resolveServerIds;
14
+ exports.extract = extract;
15
+ const db_1 = require("../../mcp/db");
16
+ const extract_helpers_1 = require("./extract-helpers");
17
+ /**
18
+ * Extract the ordered step sequence from an execution's events.
19
+ */
20
+ function extractStepSequence(events) {
21
+ const steps = [];
22
+ let pendingLlmCall = null;
23
+ const pendingQueue = [];
24
+ // Pre-index signaled events for pairing with escalate_and_wait tool calls
25
+ const signaledEvents = new Map();
26
+ for (const evt of events) {
27
+ if (evt.event_type === 'workflow_execution_signaled') {
28
+ const attrs = evt.attributes;
29
+ const signalName = attrs.signal_name;
30
+ const input = attrs.input;
31
+ if (signalName && input) {
32
+ signaledEvents.set(signalName, input);
33
+ }
34
+ }
35
+ }
36
+ for (const evt of events) {
37
+ if (evt.event_type !== 'activity_task_completed')
38
+ continue;
39
+ const attrs = evt.attributes;
40
+ // Pattern 1a: callLLM/callTriageLLM with tool_calls — record pending tool call
41
+ if (attrs.activity_type === 'callLLM' || attrs.activity_type === 'callTriageLLM' || attrs.activity_type === 'callQueryLLM') {
42
+ const result = attrs.result;
43
+ const toolCalls = result?.tool_calls;
44
+ if (toolCalls && toolCalls.length > 0) {
45
+ for (const tc of toolCalls) {
46
+ let parsedArgs = {};
47
+ try {
48
+ parsedArgs = JSON.parse(tc.function.arguments || '{}');
49
+ }
50
+ catch {
51
+ // malformed arguments — use empty
52
+ }
53
+ pendingQueue.push({
54
+ toolName: tc.function.name,
55
+ arguments: parsedArgs,
56
+ });
57
+ }
58
+ pendingLlmCall = pendingQueue.shift() || null;
59
+ continue;
60
+ }
61
+ // Pattern 3: callLLM with text content (no tool_calls) — interpretation step
62
+ const content = result?.content;
63
+ if (content) {
64
+ let parsed = content;
65
+ try {
66
+ const cleaned = content
67
+ .replace(/^```(?:json)?\s*/m, '')
68
+ .replace(/\s*```$/m, '')
69
+ .trim();
70
+ parsed = JSON.parse(cleaned);
71
+ }
72
+ catch {
73
+ parsed = { response: content };
74
+ }
75
+ steps.push({
76
+ kind: 'llm',
77
+ toolName: 'interpret',
78
+ arguments: {},
79
+ result: parsed,
80
+ source: 'llm',
81
+ promptMessages: (0, extract_helpers_1.extractLlmMessages)(attrs) || (0, extract_helpers_1.buildDefaultPrompt)(steps),
82
+ });
83
+ }
84
+ continue;
85
+ }
86
+ // Pattern 1b: callDbTool/callVisionTool — paired with the preceding callLLM
87
+ if ((attrs.activity_type === 'callDbTool' || attrs.activity_type === 'callVisionTool') && pendingLlmCall) {
88
+ const actualArgs = (0, extract_helpers_1.extractToolArgs)(attrs);
89
+ const args = Object.keys(actualArgs).length > 0 ? actualArgs : pendingLlmCall.arguments;
90
+ const isDbTool = attrs.activity_type === 'callDbTool';
91
+ steps.push({
92
+ kind: 'tool',
93
+ toolName: pendingLlmCall.toolName,
94
+ arguments: args,
95
+ result: attrs.result,
96
+ source: isDbTool ? 'db' : 'mcp',
97
+ ...(!isDbTool ? { mcpServerId: attrs.activity_type.replace(/^call/, '').replace(/Tool$/, '').toLowerCase() } : {}),
98
+ });
99
+ pendingLlmCall = null;
100
+ continue;
101
+ }
102
+ // Pattern 1c: callMcpTool/callTriageTool — uses qualified names (server_slug__tool_name)
103
+ if ((attrs.activity_type === 'callMcpTool' || attrs.activity_type === 'callTriageTool') && pendingLlmCall) {
104
+ const qualifiedName = pendingLlmCall.toolName;
105
+ const sepIdx = qualifiedName.indexOf('__');
106
+ const serverSlug = sepIdx >= 0 ? qualifiedName.slice(0, sepIdx) : qualifiedName;
107
+ const toolName = sepIdx >= 0 ? qualifiedName.slice(sepIdx + 2) : qualifiedName;
108
+ const actualArgs = (0, extract_helpers_1.extractToolArgs)(attrs);
109
+ const args = Object.keys(actualArgs).length > 0 ? actualArgs : pendingLlmCall.arguments;
110
+ const result = attrs.result;
111
+ // Skip failed steps
112
+ if (result && (result.error || result.code === 'TIMEOUT')) {
113
+ pendingLlmCall = pendingQueue.shift() || null;
114
+ continue;
115
+ }
116
+ steps.push({
117
+ kind: 'tool',
118
+ toolName,
119
+ arguments: args,
120
+ result,
121
+ source: 'mcp',
122
+ mcpServerId: serverSlug,
123
+ });
124
+ // Detect escalate_and_wait → waitFor pattern: emit a signal step
125
+ if (result?.type === 'waitFor' && result?.signalId) {
126
+ const signalId = result.signalId;
127
+ const signalData = signaledEvents.get(signalId) || {};
128
+ const formSchema = args.form_schema;
129
+ steps.push({
130
+ kind: 'signal',
131
+ toolName: 'wait_for_human',
132
+ arguments: {},
133
+ result: signalData,
134
+ source: 'signal',
135
+ signalSchema: formSchema || {
136
+ type: 'object',
137
+ properties: signalData
138
+ ? Object.fromEntries(Object.keys(signalData).map(k => [k, { type: 'string' }]))
139
+ : {},
140
+ },
141
+ });
142
+ }
143
+ pendingLlmCall = pendingQueue.shift() || null;
144
+ continue;
145
+ }
146
+ // Pattern 2: mcp_* activities (external MCP tools called via proxyActivities)
147
+ if (attrs.activity_type?.startsWith('mcp_')) {
148
+ const { serverName, toolName } = (0, extract_helpers_1.parseMcpActivityType)(attrs.activity_type);
149
+ const args = (0, extract_helpers_1.extractToolArgs)(attrs);
150
+ steps.push({
151
+ kind: 'tool',
152
+ toolName,
153
+ arguments: args,
154
+ result: attrs.result,
155
+ source: 'mcp',
156
+ mcpServerId: serverName,
157
+ });
158
+ continue;
159
+ }
160
+ }
161
+ return steps;
162
+ }
163
+ /**
164
+ * Resolve slugified server IDs (e.g., "my_server") back to
165
+ * real MCP server names (e.g., "my-server").
166
+ */
167
+ async function resolveServerIds(steps) {
168
+ const mcpSteps = steps.filter((s) => s.source === 'mcp' && s.mcpServerId);
169
+ if (mcpSteps.length === 0)
170
+ return;
171
+ const { servers } = await (0, db_1.listMcpServers)({ limit: 100 });
172
+ const slugToName = new Map();
173
+ for (const srv of servers) {
174
+ const slug = srv.name.replace(/[^a-zA-Z0-9]/g, '_');
175
+ slugToName.set(slug, srv.name);
176
+ }
177
+ for (const step of mcpSteps) {
178
+ const realName = slugToName.get(step.mcpServerId);
179
+ if (realName) {
180
+ step.mcpServerId = realName;
181
+ }
182
+ }
183
+ }
184
+ /**
185
+ * Extract pipeline stage: parse execution events into ordered steps.
186
+ */
187
+ async function extract(ctx) {
188
+ // Extract the original prompt: try start event first, then fall back to
189
+ // the user message in the first callQueryLLM activity (for child workflows
190
+ // spawned by mcpQueryRouter where input isn't in the start event).
191
+ const startEvent = ctx.execution.events.find(e => e.event_type === 'workflow_execution_started');
192
+ let prompt = startEvent?.attributes?.input?.prompt || '';
193
+ if (!prompt) {
194
+ // Look for the prompt in the LLM call's input messages (mcpQuery or mcpTriage)
195
+ const llmActivityTypes = ['callQueryLLM', 'callTriageLLM'];
196
+ for (const e of ctx.execution.events) {
197
+ const attrs = e.attributes;
198
+ if (llmActivityTypes.includes(attrs.activity_type) && e.event_type === 'activity_task_completed') {
199
+ const input = attrs.input;
200
+ if (Array.isArray(input) && Array.isArray(input[0])) {
201
+ const messages = input[0];
202
+ const userMsg = messages.find(m => m.role === 'user');
203
+ if (userMsg?.content) {
204
+ prompt = userMsg.content;
205
+ break;
206
+ }
207
+ }
208
+ break;
209
+ }
210
+ }
211
+ }
212
+ // Also try discovery activity input (router child workflows — both query and triage)
213
+ if (!prompt) {
214
+ const discoveryTypes = ['findCompiledWorkflows', 'findTriageWorkflows'];
215
+ for (const e of ctx.execution.events) {
216
+ const attrs = e.attributes;
217
+ if (discoveryTypes.includes(attrs.activity_type) && Array.isArray(attrs.input)) {
218
+ const input = attrs.input;
219
+ if (typeof input[0] === 'string') {
220
+ prompt = input[0];
221
+ break;
222
+ }
223
+ }
224
+ }
225
+ }
226
+ ctx.originalPrompt = prompt;
227
+ // Extract ordered steps
228
+ ctx.rawSteps = extractStepSequence(ctx.execution.events);
229
+ if (ctx.rawSteps.length === 0) {
230
+ throw new Error('No steps found in this execution. Expected callLLM→callDbTool pairs, mcp_* activities, or LLM interpretation steps.');
231
+ }
232
+ // Resolve slugified server IDs back to real MCP server names
233
+ await resolveServerIds(ctx.rawSteps);
234
+ return ctx;
235
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Externalized LLM prompt constants for the yaml-workflow pipeline.
3
+ *
4
+ * Consolidates all system/user prompt strings used by compile, validate,
5
+ * and extract stages so they can be reviewed and tuned in one place.
6
+ */
7
+ export declare const COMPILATION_PROMPT = "You are a workflow compiler. You analyze MCP tool execution traces and produce a COMPILATION PLAN \u2014 a complete specification for building a deterministic YAML DAG workflow.\n\nGiven:\n1. The user's ORIGINAL PROMPT \u2014 the single most important signal for understanding intent\n2. EXECUTION STEPS \u2014 tool calls with arguments, result structure samples, and server IDs\n3. PATTERN ANNOTATIONS \u2014 pre-detected iteration candidates from static analysis\n4. NAIVE INPUT CLASSIFICATION \u2014 initial argument classification\n\nYour job: produce a plan that makes the workflow truly reusable and deterministic.\n\n## Critical: Understand Intent\n\nThe original prompt describes what the user wanted. The execution trace shows HOW an LLM accomplished it, but may include exploratory detours. Your compilation captures INTENT, not a blind replay.\n\nFor example, if the prompt says \"login to site X and take screenshots of all pages\":\n- INTENT: login \u2192 discover pages \u2192 iterate and screenshot each one\n- Execution may have included probing steps \u2014 exclude those\n- Deterministic version: accept credentials \u2192 login \u2192 extract links \u2192 iterate taking screenshots\n\n## Critical: Preserve Discovery Steps\n\nMany workflows follow a \"discover then act\" pattern: one step DISCOVERS data (e.g., extract navigation links, query a database, list files) and a later step ACTS on that data (e.g., screenshot each page, process each record, transform each file).\n\n**NEVER collapse discovery + action into a single step with the discovered data as a user input.** If the execution trace shows:\n1. Step A: extract_content \u2192 produces `links: [{text, href}, ...]`\n2. Step B: capture_pages(pages=[...array built from step A's links...])\n\nThe compiled workflow MUST keep BOTH steps: A produces the array, B consumes it. Do NOT make the array a trigger input \u2014 it was runtime-discovered, not user-provided.\n\n**How to detect**: If a step's argument contains a large array of items that closely mirrors a prior step's output array (same URLs, same items, possibly reshaped), that array was DERIVED from the prior step. Keep both steps and wire them with a data_flow edge (with a transform if formats differ).\n\n## Rules\n\n### Step Dispositions\n- **core**: Directly serves the workflow intent. Produces data consumed by later steps. **Discovery steps that produce arrays consumed by later action steps are ALWAYS core.**\n- **exploratory**: Probing/debugging/discovery steps that don't produce data needed by the workflow. Exclude these:\n - Checking if compiled workflows exist (list_workflows, list_yaml_workflows)\n - Listing files to see what exists (list_files, read_file)\n - Initial tool calls that failed and were retried with different parameters\n - Any step whose result is not consumed by a subsequent core step\n - **NEVER mark a discovery step as exploratory if its output was used to build arguments for a later step**\n\n### Signal Steps (Human-in-the-Loop)\nSteps with kind \"signal\" represent a durable pause where the workflow waits for human input (e.g., credentials, approval). These are ALWAYS core \u2014 they are essential to the workflow's data flow. The signal step receives data from a human and makes it available to subsequent steps. Do NOT mark signal steps as exploratory. The escalation tool call (escalate_and_wait) that precedes a signal step is also always core.\n\n**Signal data flow**: The signal step result contains the human response fields (e.g., password). These MUST be wired via data_flow edges to every downstream step that needs them. Add a data_flow edge from the signal step index to the consuming step with the matching field name.\n\n**Credentials from signals**: When the signal provides a credential (format: password in the schema), downstream tools that need it should receive it as a separate named input argument. The runtime exchanges ephemeral credential tokens automatically. For tools with complex stored arguments (like run_script steps arrays), wire the credential as a top-level argument name \u2014 the runtime merges it with stored defaults.\n\n### Iteration Specifications\nWhen the execution shows repeated tool calls with varying arguments (the pattern detector may have already collapsed these):\n- Identify the SOURCE: which prior step's result contains the array being iterated. This is the step that PRODUCED the list of items \u2014 look for a step whose result contains an array field with items matching the iteration's varying values. For example, if the iteration visits multiple URLs, find the step that returned those URLs (e.g., extract_content with links).\n- The source is NEVER a step that doesn't have the array in its output. Double-check: does the source step's resultKeys include the source_field?\n- Specify the source_field: the dot-path to the array (e.g., \"links\", \"results.pages\")\n- List varying_keys (change per item) vs constant_args (shared)\n- **KEY MAPPINGS are critical**: array items often use different key names than the tool expects.\n E.g., extract_content returns `links: [{text, href}, ...]` but the screenshot tool wants `url`.\n Map: `{ \"url\": \"href\" }` \u2014 tool arg name \u2192 array item key name.\n Use null for keys that are COMPUTED at runtime, not sourced from the array.\n For example, screenshot_path is often derived from the link text or URL \u2014 it's not a field in the source array directly:\n `{ \"screenshot_path\": null }` \u2014 the value must be computed or provided by the trigger.\n\n### Tool Simplification for Iterations (CRITICAL)\nThe iteration pattern works by extracting individual values from array items and passing them as simple key=value arguments to the iterated tool. This means:\n\n**The iterated tool MUST accept simple, flat arguments** (url, path, page_id \u2014 not complex nested structures like a `steps` array).\n\nIf the execution used a complex multi-step scripting tool (e.g., `run_script` with a `steps: [{action, url}, {action, path}]` array) for each iteration, you MUST replace it with a simpler tool from the same server that accepts flat arguments. Check the server's tool inventory for a simpler alternative.\n\nFor example:\n- `run_script(steps=[navigate, wait, screenshot])` per page \u2192 replace with `capture_page(url, path, full_page, wait_ms)` (1 call, flat args)\n- `run_script(steps=[navigate, fill, click])` per item \u2192 replace with `submit_form(url, fields)` (1 call, flat args)\n\nWhen replacing: use the same server_id but the simpler tool_name. The varying_keys and key_mappings should map directly to the simple tool's argument names.\n\n**If no simpler tool alternative exists**, use a data_flow edge with a transform to feed the array into a batch/composite tool that accepts the full array (like `capture_authenticated_pages` which takes a `pages` array).\n\n### Data Flow Graph\nSpecify directed edges showing how data flows between steps:\n- from_step: \"trigger\" (user input) or step index number\n- from_field: the output field name (or trigger input key)\n- to_step: the consuming step index\n- to_field: the argument key name\n- is_session_wire: true for session handles (page_id, _handle, session_id)\n\nSession handles are critical \u2014 they maintain authenticated browser sessions, database connections, etc. They must be threaded from their producer through ALL subsequent steps that need them.\n\n### Data Flow Transforms (CRITICAL for array reshaping)\nWhen a source step produces an array of objects in one format but the consuming step expects a DIFFERENT format, add a `transform` to the data_flow edge. Compare the source step's result structure with the consuming step's actual arguments from the trace.\n\n**Choosing the correct source field**: When a step produces multiple output fields, check the result sample to determine which field actually contains an ARRAY OF OBJECTS suitable for iteration/reshaping. Prefer structured array fields over raw/unstructured fields. Check the Tool-Specific Compilation Hints section (if present) for guidance on which fields to use for specific tools.\n\nFor example: extract_content returns `links: [{text, href}]` but capture tool expects `pages: [{url, screenshot_path, wait_ms, full_page}]`.\nAdd a transform with:\n- `field_map`: maps target keys \u2192 source keys (e.g., `{\"url\": \"href\"}`). Use null for keys not in the source.\n- `defaults`: static values to inject (e.g., `{\"wait_ms\": 3000, \"full_page\": true}`)\n- `derivations`: for computed keys (null in field_map), how to derive them from source data\n - strategy: \"slugify\" (lowercase, replace spaces/special with hyphens), \"prefix\", \"template\"\n - source_key: which source field to derive from\n - prefix/suffix/template: string manipulation params\n\nExample edge with transform:\n```\n{\n \"from_step\": 1, \"from_field\": \"links\", \"to_step\": 2, \"to_field\": \"pages\",\n \"is_session_wire\": false,\n \"transform\": {\n \"field_map\": { \"url\": \"href\", \"screenshot_path\": null },\n \"defaults\": { \"wait_ms\": 3000, \"full_page\": true },\n \"derivations\": {\n \"screenshot_path\": {\n \"source_key\": \"href\",\n \"strategy\": \"slugify\",\n \"prefix\": \"screenshots/\",\n \"suffix\": \".png\"\n }\n }\n }\n}\n```\n\nIMPORTANT: Check EVERY array-typed data_flow edge. Compare the source step's result item keys with the consuming step's argument item keys. If they differ, add a transform. Look at the actual tool_arguments in the execution trace to determine the correct field_map, defaults, and derivations.\n\n### Input Classification\n- **dynamic**: Simple values callers MUST provide: URLs, credentials, file paths, queries, search terms. These are always scalar strings, numbers, or booleans \u2014 NEVER complex objects or arrays.\n- **fixed**: Implementation details with sensible defaults: selectors, timeouts, boolean flags, AND complex structured arguments like `steps` arrays, `login` objects, or `pages` arrays. These are baked into stored tool_arguments.\n\n**Complex tool arguments (arrays of objects, nested structures) are ALWAYS fixed.** They represent the implementation recipe, not user input. For example:\n- A `steps` array describing browser actions (navigate, fill, click, screenshot) \u2192 **fixed**\n- A `login` object with selectors and credentials \u2192 flatten the credentials (username, password) as dynamic, but the selectors as fixed\n- A `pages` array of URLs to capture \u2192 **fixed** if hardcoded from the trace, or a data_flow edge if discovered at runtime\n\nFlatten nested objects containing dynamic values. E.g., `login: {url, username, password}` \u2192 separate `login_url`, `username`, `password` fields. But NEVER expose the full nested object or array as a trigger input.\n\n**Arrays that were DISCOVERED at runtime (by a prior step) are NOT inputs.** They flow between steps via data_flow edges. Only make an array a trigger input if the user explicitly provided it in their prompt. If the array was produced by a discovery step (extract_content, query, list), keep the discovery step as core and wire its output to the consuming step.\n\n### Data Flow Wiring Precision\n- **Only wire inputs that semantically match.** A directory name (e.g., `screenshot_dir = \"screenshots\"`) must NOT be wired to a file path argument (e.g., `screenshot_path` which expects `\"screenshots/home.png\"`). If a tool argument needs a specific file path but the trigger only provides a directory, leave that argument unwired \u2014 the stored tool_arguments default will provide the correct value.\n- **Trigger inputs should map to the EXACT tool argument they represent.** Don't reuse a trigger input for a different-purpose argument just because the names are vaguely related.\n- **When in doubt, don't wire.** An unwired argument falls back to the stored tool_arguments default from the original execution \u2014 this is always correct. An incorrectly wired argument overrides the correct default with a wrong value.\n\n### Session Fields and Threading Rules\nList all fields that represent session tokens/handles that must flow through the DAG (e.g., page_id, _handle, session_id).\n\n**Critical**: When a login/setup step produces a page_id or _handle, ALL subsequent browser/page steps must receive that session wire \u2014 including steps inside iterations. The data_flow graph must include session wire edges from the producing step to EVERY downstream step that operates on the same session, not just the immediately next one. For iterations: wire the session from the setup step directly to the iteration body step.\n\n**COMPLETENESS REQUIREMENT**: For EACH step that uses a session field (check the step's argumentKeys \u2014 if it includes page_id, _handle, or session_id), you MUST emit a data_flow edge wiring that field from its producer. If step 0 produces _handle and steps 1, 2, and 3 all use it, you need THREE edges: 0\u21921, 0\u21922, 0\u21923. Do NOT assume downstream steps will \"inherit\" session fields \u2014 each consumer needs an explicit edge.\n\n### Data Flow Completeness Check\nBefore finalizing the plan, verify:\n1. Every step that has a session field in its argumentKeys has a corresponding is_session_wire edge\n2. Every step that consumes data from a prior step has a data_flow edge for that field\n3. Every dynamic trigger input is wired to at least one step via a data_flow edge from \"trigger\"\n4. Transform edges include the source field AND the consuming step can access all fields it needs\n\n## Output Format\n\nReturn a JSON object (no markdown fences):\n{\n \"intent\": \"Brief generic description of what this workflow does\",\n \"description\": \"Suggested workflow description for discovery\",\n \"steps\": [\n { \"index\": 0, \"purpose\": \"Navigate to the target site\", \"disposition\": \"core\" },\n { \"index\": 1, \"purpose\": \"Extract navigation links from the page\", \"disposition\": \"core\" },\n { \"index\": 2, \"purpose\": \"List files to check directory structure\", \"disposition\": \"exploratory\" }\n ],\n \"core_step_indices\": [0, 1, 3],\n \"inputs\": [\n { \"key\": \"base_url\", \"type\": \"string\", \"classification\": \"dynamic\", \"description\": \"The base URL of the site\" },\n { \"key\": \"username\", \"type\": \"string\", \"classification\": \"dynamic\", \"description\": \"Login username\" },\n { \"key\": \"timeout\", \"type\": \"number\", \"classification\": \"fixed\", \"description\": \"Page load timeout\", \"default\": 30000 }\n ],\n \"iterations\": [\n {\n \"body_step_index\": 3,\n \"tool_name\": \"screenshot\",\n \"server_id\": \"playwright\",\n \"source_step_index\": 1,\n \"source_field\": \"links\",\n \"varying_keys\": [\"url\", \"screenshot_path\"],\n \"constant_args\": { \"full_page\": true },\n \"key_mappings\": { \"url\": \"href\", \"screenshot_path\": null }\n }\n ],\n \"data_flow\": [\n { \"from_step\": \"trigger\", \"from_field\": \"base_url\", \"to_step\": 0, \"to_field\": \"url\", \"is_session_wire\": false },\n { \"from_step\": 0, \"from_field\": \"page_id\", \"to_step\": 1, \"to_field\": \"page_id\", \"is_session_wire\": true },\n { \"from_step\": 0, \"from_field\": \"_handle\", \"to_step\": 1, \"to_field\": \"_handle\", \"is_session_wire\": true }\n ],\n \"session_fields\": [\"page_id\", \"_handle\"]\n}";
8
+ /**
9
+ * Build the retry hint injected into the compile stage when
10
+ * user feedback or a prior deployment error triggers recompilation.
11
+ */
12
+ export declare function buildRecompilationHint(feedback: string, priorYaml?: string): string;
13
+ export declare const VALIDATION_PROMPT = "You are a YAML workflow validator. Given a workflow intent, activity manifest, and generated YAML DAG, identify data flow issues.\n\nCheck for:\n1. Missing input wiring: a step needs data but no prior step provides it and it's not in the trigger\n2. Broken iteration sources: a cycle references an array field that doesn't exist in the source step's output\n3. Lost session handles: a session field (page_id, _handle) is produced by an early step (e.g., login) but not threaded to later browser/page steps that need it \u2014 including steps inside iteration loops\n4. Unparameterized hardcoded values: URLs, credentials, or paths that should be dynamic inputs but are baked in\n5. Iteration array source: verify the referenced items field in a cycle hook actually exists in the source activity's output fields\n6. Trigger completeness: every dynamic input in the trigger schema should be referenced by at least one activity's input maps\n\nIGNORE these internal fields \u2014 they are injected by the build system and are always correct:\n- \"workflowName\" in input maps: internal dispatch routing field, always a literal string \u2014 NOT a hardcoded value bug\n- \"_scope\" in input maps: internal IAM context field, always wired from trigger \u2014 NOT a missing trigger input\n\nReturn a JSON object:\n{\n \"issues\": [\"description of issue 1\", \"description of issue 2\"],\n \"valid\": true\n}\n\nIf no issues, return { \"issues\": [], \"valid\": true }.\nBe concise. Only report real problems, not style suggestions.";
14
+ export declare const EXTRACT_DEFAULT_SYSTEM_PROMPT = "You are a data analysis assistant. Interpret the provided data and return a structured JSON response with: title, summary, sections (array of {heading, content}), and metrics (array of {label, value}).";
15
+ export declare const EXTRACT_DEFAULT_USER_TEMPLATE = "{dataRef}\n\nData:\n{input_data}\n\nProvide a concise analysis.";
@@ -0,0 +1,254 @@
1
+ "use strict";
2
+ /**
3
+ * Externalized LLM prompt constants for the yaml-workflow pipeline.
4
+ *
5
+ * Consolidates all system/user prompt strings used by compile, validate,
6
+ * and extract stages so they can be reviewed and tuned in one place.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.EXTRACT_DEFAULT_USER_TEMPLATE = exports.EXTRACT_DEFAULT_SYSTEM_PROMPT = exports.VALIDATION_PROMPT = exports.COMPILATION_PROMPT = void 0;
10
+ exports.buildRecompilationHint = buildRecompilationHint;
11
+ // ── Compile stage ─────────────────────────────────────────────────────────────
12
+ exports.COMPILATION_PROMPT = `You are a workflow compiler. You analyze MCP tool execution traces and produce a COMPILATION PLAN — a complete specification for building a deterministic YAML DAG workflow.
13
+
14
+ Given:
15
+ 1. The user's ORIGINAL PROMPT — the single most important signal for understanding intent
16
+ 2. EXECUTION STEPS — tool calls with arguments, result structure samples, and server IDs
17
+ 3. PATTERN ANNOTATIONS — pre-detected iteration candidates from static analysis
18
+ 4. NAIVE INPUT CLASSIFICATION — initial argument classification
19
+
20
+ Your job: produce a plan that makes the workflow truly reusable and deterministic.
21
+
22
+ ## Critical: Understand Intent
23
+
24
+ The original prompt describes what the user wanted. The execution trace shows HOW an LLM accomplished it, but may include exploratory detours. Your compilation captures INTENT, not a blind replay.
25
+
26
+ For example, if the prompt says "login to site X and take screenshots of all pages":
27
+ - INTENT: login → discover pages → iterate and screenshot each one
28
+ - Execution may have included probing steps — exclude those
29
+ - Deterministic version: accept credentials → login → extract links → iterate taking screenshots
30
+
31
+ ## Critical: Preserve Discovery Steps
32
+
33
+ Many workflows follow a "discover then act" pattern: one step DISCOVERS data (e.g., extract navigation links, query a database, list files) and a later step ACTS on that data (e.g., screenshot each page, process each record, transform each file).
34
+
35
+ **NEVER collapse discovery + action into a single step with the discovered data as a user input.** If the execution trace shows:
36
+ 1. Step A: extract_content → produces \`links: [{text, href}, ...]\`
37
+ 2. Step B: capture_pages(pages=[...array built from step A's links...])
38
+
39
+ The compiled workflow MUST keep BOTH steps: A produces the array, B consumes it. Do NOT make the array a trigger input — it was runtime-discovered, not user-provided.
40
+
41
+ **How to detect**: If a step's argument contains a large array of items that closely mirrors a prior step's output array (same URLs, same items, possibly reshaped), that array was DERIVED from the prior step. Keep both steps and wire them with a data_flow edge (with a transform if formats differ).
42
+
43
+ ## Rules
44
+
45
+ ### Step Dispositions
46
+ - **core**: Directly serves the workflow intent. Produces data consumed by later steps. **Discovery steps that produce arrays consumed by later action steps are ALWAYS core.**
47
+ - **exploratory**: Probing/debugging/discovery steps that don't produce data needed by the workflow. Exclude these:
48
+ - Checking if compiled workflows exist (list_workflows, list_yaml_workflows)
49
+ - Listing files to see what exists (list_files, read_file)
50
+ - Initial tool calls that failed and were retried with different parameters
51
+ - Any step whose result is not consumed by a subsequent core step
52
+ - **NEVER mark a discovery step as exploratory if its output was used to build arguments for a later step**
53
+
54
+ ### Signal Steps (Human-in-the-Loop)
55
+ Steps with kind "signal" represent a durable pause where the workflow waits for human input (e.g., credentials, approval). These are ALWAYS core — they are essential to the workflow's data flow. The signal step receives data from a human and makes it available to subsequent steps. Do NOT mark signal steps as exploratory. The escalation tool call (escalate_and_wait) that precedes a signal step is also always core.
56
+
57
+ **Signal data flow**: The signal step result contains the human response fields (e.g., password). These MUST be wired via data_flow edges to every downstream step that needs them. Add a data_flow edge from the signal step index to the consuming step with the matching field name.
58
+
59
+ **Credentials from signals**: When the signal provides a credential (format: password in the schema), downstream tools that need it should receive it as a separate named input argument. The runtime exchanges ephemeral credential tokens automatically. For tools with complex stored arguments (like run_script steps arrays), wire the credential as a top-level argument name — the runtime merges it with stored defaults.
60
+
61
+ ### Iteration Specifications
62
+ When the execution shows repeated tool calls with varying arguments (the pattern detector may have already collapsed these):
63
+ - Identify the SOURCE: which prior step's result contains the array being iterated. This is the step that PRODUCED the list of items — look for a step whose result contains an array field with items matching the iteration's varying values. For example, if the iteration visits multiple URLs, find the step that returned those URLs (e.g., extract_content with links).
64
+ - The source is NEVER a step that doesn't have the array in its output. Double-check: does the source step's resultKeys include the source_field?
65
+ - Specify the source_field: the dot-path to the array (e.g., "links", "results.pages")
66
+ - List varying_keys (change per item) vs constant_args (shared)
67
+ - **KEY MAPPINGS are critical**: array items often use different key names than the tool expects.
68
+ E.g., extract_content returns \`links: [{text, href}, ...]\` but the screenshot tool wants \`url\`.
69
+ Map: \`{ "url": "href" }\` — tool arg name → array item key name.
70
+ Use null for keys that are COMPUTED at runtime, not sourced from the array.
71
+ For example, screenshot_path is often derived from the link text or URL — it's not a field in the source array directly:
72
+ \`{ "screenshot_path": null }\` — the value must be computed or provided by the trigger.
73
+
74
+ ### Tool Simplification for Iterations (CRITICAL)
75
+ The iteration pattern works by extracting individual values from array items and passing them as simple key=value arguments to the iterated tool. This means:
76
+
77
+ **The iterated tool MUST accept simple, flat arguments** (url, path, page_id — not complex nested structures like a \`steps\` array).
78
+
79
+ If the execution used a complex multi-step scripting tool (e.g., \`run_script\` with a \`steps: [{action, url}, {action, path}]\` array) for each iteration, you MUST replace it with a simpler tool from the same server that accepts flat arguments. Check the server's tool inventory for a simpler alternative.
80
+
81
+ For example:
82
+ - \`run_script(steps=[navigate, wait, screenshot])\` per page → replace with \`capture_page(url, path, full_page, wait_ms)\` (1 call, flat args)
83
+ - \`run_script(steps=[navigate, fill, click])\` per item → replace with \`submit_form(url, fields)\` (1 call, flat args)
84
+
85
+ When replacing: use the same server_id but the simpler tool_name. The varying_keys and key_mappings should map directly to the simple tool's argument names.
86
+
87
+ **If no simpler tool alternative exists**, use a data_flow edge with a transform to feed the array into a batch/composite tool that accepts the full array (like \`capture_authenticated_pages\` which takes a \`pages\` array).
88
+
89
+ ### Data Flow Graph
90
+ Specify directed edges showing how data flows between steps:
91
+ - from_step: "trigger" (user input) or step index number
92
+ - from_field: the output field name (or trigger input key)
93
+ - to_step: the consuming step index
94
+ - to_field: the argument key name
95
+ - is_session_wire: true for session handles (page_id, _handle, session_id)
96
+
97
+ Session handles are critical — they maintain authenticated browser sessions, database connections, etc. They must be threaded from their producer through ALL subsequent steps that need them.
98
+
99
+ ### Data Flow Transforms (CRITICAL for array reshaping)
100
+ When a source step produces an array of objects in one format but the consuming step expects a DIFFERENT format, add a \`transform\` to the data_flow edge. Compare the source step's result structure with the consuming step's actual arguments from the trace.
101
+
102
+ **Choosing the correct source field**: When a step produces multiple output fields, check the result sample to determine which field actually contains an ARRAY OF OBJECTS suitable for iteration/reshaping. Prefer structured array fields over raw/unstructured fields. Check the Tool-Specific Compilation Hints section (if present) for guidance on which fields to use for specific tools.
103
+
104
+ For example: extract_content returns \`links: [{text, href}]\` but capture tool expects \`pages: [{url, screenshot_path, wait_ms, full_page}]\`.
105
+ Add a transform with:
106
+ - \`field_map\`: maps target keys → source keys (e.g., \`{"url": "href"}\`). Use null for keys not in the source.
107
+ - \`defaults\`: static values to inject (e.g., \`{"wait_ms": 3000, "full_page": true}\`)
108
+ - \`derivations\`: for computed keys (null in field_map), how to derive them from source data
109
+ - strategy: "slugify" (lowercase, replace spaces/special with hyphens), "prefix", "template"
110
+ - source_key: which source field to derive from
111
+ - prefix/suffix/template: string manipulation params
112
+
113
+ Example edge with transform:
114
+ \`\`\`
115
+ {
116
+ "from_step": 1, "from_field": "links", "to_step": 2, "to_field": "pages",
117
+ "is_session_wire": false,
118
+ "transform": {
119
+ "field_map": { "url": "href", "screenshot_path": null },
120
+ "defaults": { "wait_ms": 3000, "full_page": true },
121
+ "derivations": {
122
+ "screenshot_path": {
123
+ "source_key": "href",
124
+ "strategy": "slugify",
125
+ "prefix": "screenshots/",
126
+ "suffix": ".png"
127
+ }
128
+ }
129
+ }
130
+ }
131
+ \`\`\`
132
+
133
+ IMPORTANT: Check EVERY array-typed data_flow edge. Compare the source step's result item keys with the consuming step's argument item keys. If they differ, add a transform. Look at the actual tool_arguments in the execution trace to determine the correct field_map, defaults, and derivations.
134
+
135
+ ### Input Classification
136
+ - **dynamic**: Simple values callers MUST provide: URLs, credentials, file paths, queries, search terms. These are always scalar strings, numbers, or booleans — NEVER complex objects or arrays.
137
+ - **fixed**: Implementation details with sensible defaults: selectors, timeouts, boolean flags, AND complex structured arguments like \`steps\` arrays, \`login\` objects, or \`pages\` arrays. These are baked into stored tool_arguments.
138
+
139
+ **Complex tool arguments (arrays of objects, nested structures) are ALWAYS fixed.** They represent the implementation recipe, not user input. For example:
140
+ - A \`steps\` array describing browser actions (navigate, fill, click, screenshot) → **fixed**
141
+ - A \`login\` object with selectors and credentials → flatten the credentials (username, password) as dynamic, but the selectors as fixed
142
+ - A \`pages\` array of URLs to capture → **fixed** if hardcoded from the trace, or a data_flow edge if discovered at runtime
143
+
144
+ Flatten nested objects containing dynamic values. E.g., \`login: {url, username, password}\` → separate \`login_url\`, \`username\`, \`password\` fields. But NEVER expose the full nested object or array as a trigger input.
145
+
146
+ **Arrays that were DISCOVERED at runtime (by a prior step) are NOT inputs.** They flow between steps via data_flow edges. Only make an array a trigger input if the user explicitly provided it in their prompt. If the array was produced by a discovery step (extract_content, query, list), keep the discovery step as core and wire its output to the consuming step.
147
+
148
+ ### Data Flow Wiring Precision
149
+ - **Only wire inputs that semantically match.** A directory name (e.g., \`screenshot_dir = "screenshots"\`) must NOT be wired to a file path argument (e.g., \`screenshot_path\` which expects \`"screenshots/home.png"\`). If a tool argument needs a specific file path but the trigger only provides a directory, leave that argument unwired — the stored tool_arguments default will provide the correct value.
150
+ - **Trigger inputs should map to the EXACT tool argument they represent.** Don't reuse a trigger input for a different-purpose argument just because the names are vaguely related.
151
+ - **When in doubt, don't wire.** An unwired argument falls back to the stored tool_arguments default from the original execution — this is always correct. An incorrectly wired argument overrides the correct default with a wrong value.
152
+
153
+ ### Session Fields and Threading Rules
154
+ List all fields that represent session tokens/handles that must flow through the DAG (e.g., page_id, _handle, session_id).
155
+
156
+ **Critical**: When a login/setup step produces a page_id or _handle, ALL subsequent browser/page steps must receive that session wire — including steps inside iterations. The data_flow graph must include session wire edges from the producing step to EVERY downstream step that operates on the same session, not just the immediately next one. For iterations: wire the session from the setup step directly to the iteration body step.
157
+
158
+ **COMPLETENESS REQUIREMENT**: For EACH step that uses a session field (check the step's argumentKeys — if it includes page_id, _handle, or session_id), you MUST emit a data_flow edge wiring that field from its producer. If step 0 produces _handle and steps 1, 2, and 3 all use it, you need THREE edges: 0→1, 0→2, 0→3. Do NOT assume downstream steps will "inherit" session fields — each consumer needs an explicit edge.
159
+
160
+ ### Data Flow Completeness Check
161
+ Before finalizing the plan, verify:
162
+ 1. Every step that has a session field in its argumentKeys has a corresponding is_session_wire edge
163
+ 2. Every step that consumes data from a prior step has a data_flow edge for that field
164
+ 3. Every dynamic trigger input is wired to at least one step via a data_flow edge from "trigger"
165
+ 4. Transform edges include the source field AND the consuming step can access all fields it needs
166
+
167
+ ## Output Format
168
+
169
+ Return a JSON object (no markdown fences):
170
+ {
171
+ "intent": "Brief generic description of what this workflow does",
172
+ "description": "Suggested workflow description for discovery",
173
+ "steps": [
174
+ { "index": 0, "purpose": "Navigate to the target site", "disposition": "core" },
175
+ { "index": 1, "purpose": "Extract navigation links from the page", "disposition": "core" },
176
+ { "index": 2, "purpose": "List files to check directory structure", "disposition": "exploratory" }
177
+ ],
178
+ "core_step_indices": [0, 1, 3],
179
+ "inputs": [
180
+ { "key": "base_url", "type": "string", "classification": "dynamic", "description": "The base URL of the site" },
181
+ { "key": "username", "type": "string", "classification": "dynamic", "description": "Login username" },
182
+ { "key": "timeout", "type": "number", "classification": "fixed", "description": "Page load timeout", "default": 30000 }
183
+ ],
184
+ "iterations": [
185
+ {
186
+ "body_step_index": 3,
187
+ "tool_name": "screenshot",
188
+ "server_id": "playwright",
189
+ "source_step_index": 1,
190
+ "source_field": "links",
191
+ "varying_keys": ["url", "screenshot_path"],
192
+ "constant_args": { "full_page": true },
193
+ "key_mappings": { "url": "href", "screenshot_path": null }
194
+ }
195
+ ],
196
+ "data_flow": [
197
+ { "from_step": "trigger", "from_field": "base_url", "to_step": 0, "to_field": "url", "is_session_wire": false },
198
+ { "from_step": 0, "from_field": "page_id", "to_step": 1, "to_field": "page_id", "is_session_wire": true },
199
+ { "from_step": 0, "from_field": "_handle", "to_step": 1, "to_field": "_handle", "is_session_wire": true }
200
+ ],
201
+ "session_fields": ["page_id", "_handle"]
202
+ }`;
203
+ // ── Recompilation hint (compile stage retry) ──────────────────────────────────
204
+ /**
205
+ * Build the retry hint injected into the compile stage when
206
+ * user feedback or a prior deployment error triggers recompilation.
207
+ */
208
+ function buildRecompilationHint(feedback, priorYaml) {
209
+ return [
210
+ `\n## RECOMPILATION — User Feedback`,
211
+ `The user reviewed the compiled output and provided this feedback:`,
212
+ `> ${feedback}`,
213
+ ``,
214
+ `You MUST produce a plan that addresses this feedback. Key rules:`,
215
+ `- Complex tool arguments (steps arrays, script strings, selector objects) are ALWAYS fixed — never dynamic inputs.`,
216
+ `- Only simple scalar values (URLs, credentials, file paths) should be dynamic trigger inputs.`,
217
+ `- If the feedback says certain fields should not be inputs, classify them as "fixed" with their default values from the execution trace.`,
218
+ `- If the feedback mentions input key mismatches, ensure dataFlow edges use the exact field names each tool expects.`,
219
+ `- Session fields (_handle, page_id) must be threaded through ALL subsequent steps via dataFlow edges.`,
220
+ ...(priorYaml ? [
221
+ ``,
222
+ `### Previous YAML (to improve upon)`,
223
+ '```yaml',
224
+ priorYaml.slice(0, 2000),
225
+ '```',
226
+ ] : []),
227
+ ].join('\n');
228
+ }
229
+ // ── Validate stage ────────────────────────────────────────────────────────────
230
+ exports.VALIDATION_PROMPT = `You are a YAML workflow validator. Given a workflow intent, activity manifest, and generated YAML DAG, identify data flow issues.
231
+
232
+ Check for:
233
+ 1. Missing input wiring: a step needs data but no prior step provides it and it's not in the trigger
234
+ 2. Broken iteration sources: a cycle references an array field that doesn't exist in the source step's output
235
+ 3. Lost session handles: a session field (page_id, _handle) is produced by an early step (e.g., login) but not threaded to later browser/page steps that need it — including steps inside iteration loops
236
+ 4. Unparameterized hardcoded values: URLs, credentials, or paths that should be dynamic inputs but are baked in
237
+ 5. Iteration array source: verify the referenced items field in a cycle hook actually exists in the source activity's output fields
238
+ 6. Trigger completeness: every dynamic input in the trigger schema should be referenced by at least one activity's input maps
239
+
240
+ IGNORE these internal fields — they are injected by the build system and are always correct:
241
+ - "workflowName" in input maps: internal dispatch routing field, always a literal string — NOT a hardcoded value bug
242
+ - "_scope" in input maps: internal IAM context field, always wired from trigger — NOT a missing trigger input
243
+
244
+ Return a JSON object:
245
+ {
246
+ "issues": ["description of issue 1", "description of issue 2"],
247
+ "valid": true
248
+ }
249
+
250
+ If no issues, return { "issues": [], "valid": true }.
251
+ Be concise. Only report real problems, not style suggestions.`;
252
+ // ── Extract stage ─────────────────────────────────────────────────────────────
253
+ exports.EXTRACT_DEFAULT_SYSTEM_PROMPT = 'You are a data analysis assistant. Interpret the provided data and return a structured JSON response with: title, summary, sections (array of {heading, content}), and metrics (array of {label, value}).';
254
+ exports.EXTRACT_DEFAULT_USER_TEMPLATE = '{dataRef}\n\nData:\n{input_data}\n\nProvide a concise analysis.';
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Validate stage: optional LLM review of generated YAML against intent.
3
+ *
4
+ * Checks for missing data flow connections, broken iteration sources,
5
+ * and session handles that get lost mid-pipeline. Records issues as
6
+ * informational warnings — does NOT modify the YAML.
7
+ */
8
+ import type { PipelineContext } from '../types';
9
+ /**
10
+ * Validate pipeline stage: optional LLM review.
11
+ */
12
+ export declare function validate(ctx: PipelineContext): Promise<PipelineContext>;