flujo-ai 3.24.0 → 3.26.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 (363) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +233 -217
  3. package/.next/app-path-routes-manifest.json +8 -8
  4. package/.next/build-manifest.json +5 -5
  5. package/.next/react-loadable-manifest.json +25 -20
  6. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  7. package/.next/server/app/_not-found.html +1 -1
  8. package/.next/server/app/_not-found.rsc +3 -3
  9. package/.next/server/app/api/approvals/[id]/route.js +1 -1
  10. package/.next/server/app/api/approvals/[id]/route.js.nft.json +1 -1
  11. package/.next/server/app/api/approvals/[id]/route_client-reference-manifest.js +1 -1
  12. package/.next/server/app/api/approvals/route.js.nft.json +1 -1
  13. package/.next/server/app/api/approvals/route_client-reference-manifest.js +1 -1
  14. package/.next/server/app/api/backup/route.js +1 -1
  15. package/.next/server/app/api/backup/route.js.nft.json +1 -1
  16. package/.next/server/app/api/backup/route_client-reference-manifest.js +1 -1
  17. package/.next/server/app/api/browse/route.js +1 -1
  18. package/.next/server/app/api/browse/route_client-reference-manifest.js +1 -1
  19. package/.next/server/app/api/bugs/enhance/route.js +1 -1
  20. package/.next/server/app/api/bugs/enhance/route.js.nft.json +1 -1
  21. package/.next/server/app/api/bugs/enhance/route_client-reference-manifest.js +1 -1
  22. package/.next/server/app/api/cwd/route.js +1 -1
  23. package/.next/server/app/api/cwd/route_client-reference-manifest.js +1 -1
  24. package/.next/server/app/api/encryption/secure/route.js +1 -1
  25. package/.next/server/app/api/encryption/secure/route.js.nft.json +1 -1
  26. package/.next/server/app/api/encryption/secure/route_client-reference-manifest.js +1 -1
  27. package/.next/server/app/api/env/route.js +1 -1
  28. package/.next/server/app/api/env/route_client-reference-manifest.js +1 -1
  29. package/.next/server/app/api/flow/[id]/route.js.nft.json +1 -1
  30. package/.next/server/app/api/flow/[id]/route_client-reference-manifest.js +1 -1
  31. package/.next/server/app/api/flow/compile/route.js.nft.json +1 -1
  32. package/.next/server/app/api/flow/compile/route_client-reference-manifest.js +1 -1
  33. package/.next/server/app/api/flow/generate/route.js.nft.json +1 -1
  34. package/.next/server/app/api/flow/generate/route_client-reference-manifest.js +1 -1
  35. package/.next/server/app/api/flow/improve/route.js.nft.json +1 -1
  36. package/.next/server/app/api/flow/improve/route_client-reference-manifest.js +1 -1
  37. package/.next/server/app/api/flow/prompt-renderer/route.js.nft.json +1 -1
  38. package/.next/server/app/api/flow/prompt-renderer/route_client-reference-manifest.js +1 -1
  39. package/.next/server/app/api/flow/quick-chat/route.js.nft.json +1 -1
  40. package/.next/server/app/api/flow/quick-chat/route_client-reference-manifest.js +1 -1
  41. package/.next/server/app/api/flow/repair/route.js.nft.json +1 -1
  42. package/.next/server/app/api/flow/repair/route_client-reference-manifest.js +1 -1
  43. package/.next/server/app/api/flow/route.js.nft.json +1 -1
  44. package/.next/server/app/api/flow/route_client-reference-manifest.js +1 -1
  45. package/.next/server/app/api/git/route.js +1 -1
  46. package/.next/server/app/api/git/route_client-reference-manifest.js +1 -1
  47. package/.next/server/app/api/init/route.js.nft.json +1 -1
  48. package/.next/server/app/api/init/route_client-reference-manifest.js +1 -1
  49. package/.next/server/app/api/local-models/capability/route_client-reference-manifest.js +1 -1
  50. package/.next/server/app/api/local-models/pull/route_client-reference-manifest.js +1 -1
  51. package/.next/server/app/api/local-models/suggest/route_client-reference-manifest.js +1 -1
  52. package/.next/server/app/api/mcp/cancel/route.js.nft.json +1 -1
  53. package/.next/server/app/api/mcp/cancel/route_client-reference-manifest.js +1 -1
  54. package/.next/server/app/api/mcp/servers/[name]/prompts/get/route.js.nft.json +1 -1
  55. package/.next/server/app/api/mcp/servers/[name]/prompts/get/route_client-reference-manifest.js +1 -1
  56. package/.next/server/app/api/mcp/servers/[name]/prompts/route.js.nft.json +1 -1
  57. package/.next/server/app/api/mcp/servers/[name]/prompts/route_client-reference-manifest.js +1 -1
  58. package/.next/server/app/api/mcp/servers/[name]/resources/read/route.js.nft.json +1 -1
  59. package/.next/server/app/api/mcp/servers/[name]/resources/read/route_client-reference-manifest.js +1 -1
  60. package/.next/server/app/api/mcp/servers/[name]/resources/route.js.nft.json +1 -1
  61. package/.next/server/app/api/mcp/servers/[name]/resources/route_client-reference-manifest.js +1 -1
  62. package/.next/server/app/api/mcp/servers/[name]/route.js +1 -1
  63. package/.next/server/app/api/mcp/servers/[name]/route.js.nft.json +1 -1
  64. package/.next/server/app/api/mcp/servers/[name]/route_client-reference-manifest.js +1 -1
  65. package/.next/server/app/api/mcp/servers/[name]/status/route.js.nft.json +1 -1
  66. package/.next/server/app/api/mcp/servers/[name]/status/route_client-reference-manifest.js +1 -1
  67. package/.next/server/app/api/mcp/servers/[name]/tools/[toolName]/route.js.nft.json +1 -1
  68. package/.next/server/app/api/mcp/servers/[name]/tools/[toolName]/route_client-reference-manifest.js +1 -1
  69. package/.next/server/app/api/mcp/servers/[name]/tools/route.js.nft.json +1 -1
  70. package/.next/server/app/api/mcp/servers/[name]/tools/route_client-reference-manifest.js +1 -1
  71. package/.next/server/app/api/mcp/servers/route.js +1 -1
  72. package/.next/server/app/api/mcp/servers/route.js.nft.json +1 -1
  73. package/.next/server/app/api/mcp/servers/route_client-reference-manifest.js +1 -1
  74. package/.next/server/app/api/mcp/test-connection/route.js +1 -1
  75. package/.next/server/app/api/mcp/test-connection/route.js.nft.json +1 -1
  76. package/.next/server/app/api/mcp/test-connection/route_client-reference-manifest.js +1 -1
  77. package/.next/server/app/api/mcp/test-connection/stream/route.js +1 -1
  78. package/.next/server/app/api/mcp/test-connection/stream/route.js.nft.json +1 -1
  79. package/.next/server/app/api/mcp/test-connection/stream/route_client-reference-manifest.js +1 -1
  80. package/.next/server/app/api/mcp-registry/route.js.nft.json +1 -1
  81. package/.next/server/app/api/mcp-registry/route_client-reference-manifest.js +1 -1
  82. package/.next/server/app/api/mcp-registry/spotlight/route_client-reference-manifest.js +1 -1
  83. package/.next/server/app/api/model/[id]/route.js.nft.json +1 -1
  84. package/.next/server/app/api/model/[id]/route_client-reference-manifest.js +1 -1
  85. package/.next/server/app/api/model/provider/route.js.nft.json +1 -1
  86. package/.next/server/app/api/model/provider/route_client-reference-manifest.js +1 -1
  87. package/.next/server/app/api/model/route.js.nft.json +1 -1
  88. package/.next/server/app/api/model/route_client-reference-manifest.js +1 -1
  89. package/.next/server/app/api/model/test/route.js.nft.json +1 -1
  90. package/.next/server/app/api/model/test/route_client-reference-manifest.js +1 -1
  91. package/.next/server/app/api/oauth/callback/route_client-reference-manifest.js +1 -1
  92. package/.next/server/app/api/oauth/initiate/route_client-reference-manifest.js +1 -1
  93. package/.next/server/app/api/oauth/reset/route.js.nft.json +1 -1
  94. package/.next/server/app/api/oauth/reset/route_client-reference-manifest.js +1 -1
  95. package/.next/server/app/api/planned-executions/[id]/route.js.nft.json +1 -1
  96. package/.next/server/app/api/planned-executions/[id]/route_client-reference-manifest.js +1 -1
  97. package/.next/server/app/api/planned-executions/[id]/run/route.js.nft.json +1 -1
  98. package/.next/server/app/api/planned-executions/[id]/run/route_client-reference-manifest.js +1 -1
  99. package/.next/server/app/api/planned-executions/[id]/runs/route.js.nft.json +1 -1
  100. package/.next/server/app/api/planned-executions/[id]/runs/route_client-reference-manifest.js +1 -1
  101. package/.next/server/app/api/planned-executions/preview-schedule/route_client-reference-manifest.js +1 -1
  102. package/.next/server/app/api/planned-executions/reconcile/route.js.nft.json +1 -1
  103. package/.next/server/app/api/planned-executions/reconcile/route_client-reference-manifest.js +1 -1
  104. package/.next/server/app/api/planned-executions/route.js.nft.json +1 -1
  105. package/.next/server/app/api/planned-executions/route_client-reference-manifest.js +1 -1
  106. package/.next/server/app/api/restore/route.js +1 -1
  107. package/.next/server/app/api/restore/route.js.nft.json +1 -1
  108. package/.next/server/app/api/restore/route_client-reference-manifest.js +1 -1
  109. package/.next/server/app/api/runs/active/route.js.nft.json +1 -1
  110. package/.next/server/app/api/runs/active/route_client-reference-manifest.js +1 -1
  111. package/.next/server/app/api/storage/route_client-reference-manifest.js +1 -1
  112. package/.next/server/app/api/update/route.js +1 -1
  113. package/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
  114. package/.next/server/app/api/waves/route.js +1 -1
  115. package/.next/server/app/api/waves/route.js.nft.json +1 -1
  116. package/.next/server/app/api/waves/route_client-reference-manifest.js +1 -1
  117. package/.next/server/app/api/webhooks/[id]/route.js +1 -1
  118. package/.next/server/app/api/webhooks/[id]/route.js.nft.json +1 -1
  119. package/.next/server/app/api/webhooks/[id]/route_client-reference-manifest.js +1 -1
  120. package/.next/server/app/chat/page.js +9 -9
  121. package/.next/server/app/chat/page.js.nft.json +1 -1
  122. package/.next/server/app/chat/page_client-reference-manifest.js +1 -1
  123. package/.next/server/app/chat.html +1 -1
  124. package/.next/server/app/chat.rsc +4 -4
  125. package/.next/server/app/docs/page.js +11 -8
  126. package/.next/server/app/docs/page.js.nft.json +1 -1
  127. package/.next/server/app/docs/page_client-reference-manifest.js +1 -1
  128. package/.next/server/app/docs.html +1 -1
  129. package/.next/server/app/docs.rsc +4 -4
  130. package/.next/server/app/executions/page.js +3 -3
  131. package/.next/server/app/executions/page.js.nft.json +1 -1
  132. package/.next/server/app/executions/page_client-reference-manifest.js +1 -1
  133. package/.next/server/app/executions.html +1 -1
  134. package/.next/server/app/executions.rsc +4 -4
  135. package/.next/server/app/flows/page.js +3 -3
  136. package/.next/server/app/flows/page.js.nft.json +1 -1
  137. package/.next/server/app/flows/page_client-reference-manifest.js +1 -1
  138. package/.next/server/app/flows.html +1 -1
  139. package/.next/server/app/flows.rsc +4 -4
  140. package/.next/server/app/index.html +1 -1
  141. package/.next/server/app/index.rsc +4 -4
  142. package/.next/server/app/mcp/page.js +5 -5
  143. package/.next/server/app/mcp/page.js.nft.json +1 -1
  144. package/.next/server/app/mcp/page_client-reference-manifest.js +1 -1
  145. package/.next/server/app/mcp-flows/route.js +1 -1
  146. package/.next/server/app/mcp-flows/route.js.nft.json +1 -1
  147. package/.next/server/app/mcp-flows/route_client-reference-manifest.js +1 -1
  148. package/.next/server/app/mcp-proxy/[server]/route.js +1 -1
  149. package/.next/server/app/mcp-proxy/[server]/route.js.nft.json +1 -1
  150. package/.next/server/app/mcp-proxy/[server]/route_client-reference-manifest.js +1 -1
  151. package/.next/server/app/mcp.html +1 -1
  152. package/.next/server/app/mcp.rsc +4 -4
  153. package/.next/server/app/models/page.js +2 -2
  154. package/.next/server/app/models/page.js.nft.json +1 -1
  155. package/.next/server/app/models/page_client-reference-manifest.js +1 -1
  156. package/.next/server/app/page.js +2 -2
  157. package/.next/server/app/page_client-reference-manifest.js +1 -1
  158. package/.next/server/app/settings/page.js +2 -57
  159. package/.next/server/app/settings/page.js.nft.json +1 -1
  160. package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  161. package/.next/server/app/settings.html +1 -1
  162. package/.next/server/app/settings.rsc +4 -4
  163. package/.next/server/app/v1/chat/completions/route.js +1 -1
  164. package/.next/server/app/v1/chat/completions/route.js.nft.json +1 -1
  165. package/.next/server/app/v1/chat/completions/route_client-reference-manifest.js +1 -1
  166. package/.next/server/app/v1/chat/conversations/[conversationId]/breakpoints/route.js +1 -1
  167. package/.next/server/app/v1/chat/conversations/[conversationId]/breakpoints/route.js.nft.json +1 -1
  168. package/.next/server/app/v1/chat/conversations/[conversationId]/breakpoints/route_client-reference-manifest.js +1 -1
  169. package/.next/server/app/v1/chat/conversations/[conversationId]/cancel/route.js +1 -1
  170. package/.next/server/app/v1/chat/conversations/[conversationId]/cancel/route.js.nft.json +1 -1
  171. package/.next/server/app/v1/chat/conversations/[conversationId]/cancel/route_client-reference-manifest.js +1 -1
  172. package/.next/server/app/v1/chat/conversations/[conversationId]/debug/continue/route.js +1 -1
  173. package/.next/server/app/v1/chat/conversations/[conversationId]/debug/continue/route.js.nft.json +1 -1
  174. package/.next/server/app/v1/chat/conversations/[conversationId]/debug/continue/route_client-reference-manifest.js +1 -1
  175. package/.next/server/app/v1/chat/conversations/[conversationId]/debug/step/route.js +1 -1
  176. package/.next/server/app/v1/chat/conversations/[conversationId]/debug/step/route.js.nft.json +1 -1
  177. package/.next/server/app/v1/chat/conversations/[conversationId]/debug/step/route_client-reference-manifest.js +1 -1
  178. package/.next/server/app/v1/chat/conversations/[conversationId]/edit-state/route.js +1 -1
  179. package/.next/server/app/v1/chat/conversations/[conversationId]/edit-state/route.js.nft.json +1 -1
  180. package/.next/server/app/v1/chat/conversations/[conversationId]/edit-state/route_client-reference-manifest.js +1 -1
  181. package/.next/server/app/v1/chat/conversations/[conversationId]/events/route.js.nft.json +1 -1
  182. package/.next/server/app/v1/chat/conversations/[conversationId]/events/route_client-reference-manifest.js +1 -1
  183. package/.next/server/app/v1/chat/conversations/[conversationId]/resources/route_client-reference-manifest.js +1 -1
  184. package/.next/server/app/v1/chat/conversations/[conversationId]/respond/route.js +1 -1
  185. package/.next/server/app/v1/chat/conversations/[conversationId]/respond/route.js.nft.json +1 -1
  186. package/.next/server/app/v1/chat/conversations/[conversationId]/respond/route_client-reference-manifest.js +1 -1
  187. package/.next/server/app/v1/chat/conversations/[conversationId]/route.js +1 -1
  188. package/.next/server/app/v1/chat/conversations/[conversationId]/route.js.nft.json +1 -1
  189. package/.next/server/app/v1/chat/conversations/[conversationId]/route_client-reference-manifest.js +1 -1
  190. package/.next/server/app/v1/chat/conversations/route.js +1 -1
  191. package/.next/server/app/v1/chat/conversations/route.js.nft.json +1 -1
  192. package/.next/server/app/v1/chat/conversations/route_client-reference-manifest.js +1 -1
  193. package/.next/server/app/v1/models/route.js.nft.json +1 -1
  194. package/.next/server/app/v1/models/route_client-reference-manifest.js +1 -1
  195. package/.next/server/app/waves/page.js +3 -3
  196. package/.next/server/app/waves/page.js.nft.json +1 -1
  197. package/.next/server/app/waves/page_client-reference-manifest.js +1 -1
  198. package/.next/server/app/waves.html +1 -1
  199. package/.next/server/app/waves.rsc +4 -4
  200. package/.next/server/app-paths-manifest.json +8 -8
  201. package/.next/server/chunks/1083.js +1 -1
  202. package/.next/server/chunks/1114.js +1 -0
  203. package/.next/server/chunks/1197.js +2 -2
  204. package/.next/server/chunks/1226.js +1 -1
  205. package/.next/server/chunks/166.js +5 -0
  206. package/.next/server/chunks/2373.js +1 -0
  207. package/.next/server/chunks/2859.js +1 -3
  208. package/.next/server/chunks/289.js +1 -1
  209. package/.next/server/chunks/3030.js +1 -1
  210. package/.next/server/chunks/3298.js +2 -0
  211. package/.next/server/chunks/3312.js +1 -0
  212. package/.next/server/chunks/3774.js +1 -1
  213. package/.next/server/chunks/3823.js +7 -7
  214. package/.next/server/chunks/3855.js +1 -0
  215. package/.next/server/chunks/3924.js +52 -0
  216. package/.next/server/chunks/4545.js +6 -2
  217. package/.next/server/chunks/4561.js +7 -7
  218. package/.next/server/chunks/4578.js +1 -0
  219. package/.next/server/chunks/4671.js +1 -1
  220. package/.next/server/chunks/4677.js +37 -0
  221. package/.next/server/chunks/4771.js +2 -2
  222. package/.next/server/chunks/4793.js +2 -0
  223. package/.next/server/chunks/4836.js +1 -0
  224. package/.next/server/chunks/5311.js +1 -1
  225. package/.next/server/chunks/5463.js +1 -0
  226. package/.next/server/chunks/5544.js +5 -0
  227. package/.next/server/chunks/5708.js +11 -8
  228. package/.next/server/chunks/584.js +1 -0
  229. package/.next/server/chunks/62.js +1 -1
  230. package/.next/server/chunks/6240.js +1 -0
  231. package/.next/server/chunks/6306.js +1 -0
  232. package/.next/server/chunks/{3928.js → 6745.js} +1 -1
  233. package/.next/server/chunks/6908.js +2 -2
  234. package/.next/server/chunks/701.js +1 -1
  235. package/.next/server/chunks/7214.js +6 -0
  236. package/.next/server/chunks/7362.js +9 -5
  237. package/.next/server/chunks/7463.js +6 -0
  238. package/.next/server/chunks/7506.js +1 -1
  239. package/.next/server/chunks/7579.js +82 -0
  240. package/.next/server/chunks/8216.js +1 -0
  241. package/.next/server/chunks/8387.js +1 -0
  242. package/.next/server/chunks/856.js +5 -0
  243. package/.next/server/chunks/8739.js +2 -2
  244. package/.next/server/chunks/9165.js +1 -0
  245. package/.next/server/chunks/94.js +1 -0
  246. package/.next/server/chunks/9427.js +1 -0
  247. package/.next/server/functions-config-manifest.json +2 -2
  248. package/.next/server/instrumentation.js.nft.json +1 -1
  249. package/.next/server/middleware-build-manifest.js +1 -1
  250. package/.next/server/middleware-manifest.json +1 -1
  251. package/.next/server/middleware-react-loadable-manifest.js +1 -1
  252. package/.next/server/pages/404.html +1 -1
  253. package/.next/server/pages/500.html +1 -1
  254. package/.next/server/server-reference-manifest.js +1 -1
  255. package/.next/server/server-reference-manifest.json +1 -1
  256. package/.next/server/src/middleware.js +2 -2
  257. package/.next/server/src/middleware.js.map +1 -1
  258. package/.next/static/chunks/1675-773454288de4309d.js +1 -0
  259. package/.next/static/chunks/1731-6e45fb529f9044a3.js +1 -0
  260. package/.next/static/chunks/1871-14c3e63ca865d85e.js +1 -0
  261. package/.next/static/chunks/2003-7710c23acaef11c9.js +1 -0
  262. package/.next/static/chunks/2318-76fcb6c769b1a569.js +1 -0
  263. package/.next/static/chunks/2566-6e2b9d9349814789.js +1 -0
  264. package/.next/static/chunks/2734-59fbe2f62a59df86.js +1 -0
  265. package/.next/static/chunks/3089.6b4e21e1faa304e2.js +1 -0
  266. package/.next/static/chunks/3109-11bdec9bdfd996c3.js +1 -0
  267. package/.next/static/chunks/3217.f728df99ab5da33c.js +1 -0
  268. package/.next/static/chunks/333-5f3c5be57c80c48c.js +1 -0
  269. package/.next/static/chunks/3333-b7b3e5758a568013.js +1 -0
  270. package/.next/static/chunks/3556-3b6f7c99b015b752.js +1 -0
  271. package/.next/static/chunks/{6257-ee5d8d88050d7705.js → 4003-3b3768446ae333df.js} +1 -1
  272. package/.next/static/chunks/4523-a540747aa2ed34e8.js +1 -0
  273. package/.next/static/chunks/4635-0fe310d3be64e71e.js +1 -0
  274. package/.next/static/chunks/4690-ec7d397cfacedac3.js +1 -0
  275. package/.next/static/chunks/4775-cb9c0be621363a08.js +8 -0
  276. package/.next/static/chunks/5336-81da1080de29ebfc.js +1 -0
  277. package/.next/static/chunks/5512.d01d565f73109a1a.js +1 -0
  278. package/.next/static/chunks/6691-117567b2b40cd9f4.js +1 -0
  279. package/.next/static/chunks/7274-1184563607f2b5f5.js +1 -0
  280. package/.next/static/chunks/8166-e75acdc559b34fcd.js +1 -0
  281. package/.next/static/chunks/8345.fbc0af16acce7256.js +1 -0
  282. package/.next/static/chunks/8405.e728bc83a7c9fed6.js +1 -0
  283. package/.next/static/chunks/8470-72cf748472d4d501.js +1 -0
  284. package/.next/static/chunks/8607-5787e42775fc3acb.js +1 -0
  285. package/.next/static/chunks/8610-660d5088bc1dd7a7.js +1 -0
  286. package/.next/static/chunks/8834-faf121e257b517d5.js +1 -0
  287. package/.next/static/chunks/8989-401559d9f3bc80a0.js +1 -0
  288. package/.next/static/chunks/{9164-d9f1abba780231e0.js → 9164-829ab5b085ec06d6.js} +1 -1
  289. package/.next/static/chunks/9240-d0a51f4d504f34b1.js +1 -0
  290. package/.next/static/chunks/9562-b7922ceb400ec536.js +1 -0
  291. package/.next/static/chunks/9704-6b7415964d7c042a.js +1 -0
  292. package/.next/static/chunks/app/chat/page-04ad1fad78048afb.js +1 -0
  293. package/.next/static/chunks/app/docs/page-5475c616764dbb18.js +1 -0
  294. package/.next/static/chunks/app/executions/page-c18708ed96d228ec.js +1 -0
  295. package/.next/static/chunks/app/flows/page-f7e44aa545bcc56e.js +1 -0
  296. package/.next/static/chunks/app/layout-e6fbae80e0f456a6.js +1 -0
  297. package/.next/static/chunks/app/mcp/page-3638fbee04a3a6ea.js +1 -0
  298. package/.next/static/chunks/app/models/error-5732fbb053e182c5.js +1 -0
  299. package/.next/static/chunks/app/models/page-e690a986047b1e62.js +1 -0
  300. package/.next/static/chunks/app/{page-a859e4dbd180df98.js → page-0a95c40a65dbd2eb.js} +1 -1
  301. package/.next/static/chunks/app/settings/page-3ef9b95187e18a5a.js +1 -0
  302. package/.next/static/chunks/app/waves/page-c9a307e2236423a4.js +1 -0
  303. package/.next/static/chunks/webpack-a6844e1074885c2f.js +1 -0
  304. package/.next/static/css/40f9bef305b11bf5.css +1 -0
  305. package/.next/trace +10 -8
  306. package/README.md +31 -1
  307. package/package.json +1 -1
  308. package/.next/server/chunks/1119.js +0 -1
  309. package/.next/server/chunks/1439.js +0 -1
  310. package/.next/server/chunks/1910.js +0 -37
  311. package/.next/server/chunks/1999.js +0 -1
  312. package/.next/server/chunks/2246.js +0 -1
  313. package/.next/server/chunks/2823.js +0 -6
  314. package/.next/server/chunks/2998.js +0 -52
  315. package/.next/server/chunks/3286.js +0 -6
  316. package/.next/server/chunks/3291.js +0 -1
  317. package/.next/server/chunks/4637.js +0 -81
  318. package/.next/server/chunks/6644.js +0 -1
  319. package/.next/server/chunks/7427.js +0 -1
  320. package/.next/server/chunks/7723.js +0 -1
  321. package/.next/server/chunks/7769.js +0 -6
  322. package/.next/server/chunks/8518.js +0 -2
  323. package/.next/static/chunks/1620-0d8ecd877f123f7b.js +0 -1
  324. package/.next/static/chunks/1871-dd8c10ed9d37100b.js +0 -1
  325. package/.next/static/chunks/1983-242862b3dc022a26.js +0 -1
  326. package/.next/static/chunks/2003-460f30484998c05d.js +0 -1
  327. package/.next/static/chunks/2619-04bc32f026a0d946.js +0 -1
  328. package/.next/static/chunks/3217.058098140ec3f563.js +0 -1
  329. package/.next/static/chunks/3454-a8db9caba457e5fa.js +0 -1
  330. package/.next/static/chunks/3730-149f2f058529f75f.js +0 -1
  331. package/.next/static/chunks/3736-5e2b3f6cda1bb923.js +0 -1
  332. package/.next/static/chunks/4207-41abb9622eb4b4f8.js +0 -1
  333. package/.next/static/chunks/4749-f8796d16ff604d54.js +0 -1
  334. package/.next/static/chunks/4812-4a9aceb49632a973.js +0 -1
  335. package/.next/static/chunks/5501-f5b093c8dfd74196.js +0 -1
  336. package/.next/static/chunks/6016.8201fa15ab6aa90e.js +0 -1
  337. package/.next/static/chunks/6288-a285bbbd701e0dbf.js +0 -1
  338. package/.next/static/chunks/6731-c230e88cf0032609.js +0 -1
  339. package/.next/static/chunks/7430-6e78aaeac66988a9.js +0 -1
  340. package/.next/static/chunks/7583.7af90b94e3c263f2.js +0 -1
  341. package/.next/static/chunks/7687-7edf1a6e1f063b08.js +0 -1
  342. package/.next/static/chunks/8083.16fda2c7f6d10d0c.js +0 -1
  343. package/.next/static/chunks/8480-229fd353b68b570f.js +0 -1
  344. package/.next/static/chunks/8548-8e4a95334064e8b2.js +0 -1
  345. package/.next/static/chunks/8611-f6d51119761d52ff.js +0 -8
  346. package/.next/static/chunks/8834-bda798efab40c60a.js +0 -1
  347. package/.next/static/chunks/9356-99ba407b60b9dfe9.js +0 -1
  348. package/.next/static/chunks/9451-680fa09f81f18806.js +0 -1
  349. package/.next/static/chunks/9659-a279e3aaba407251.js +0 -1
  350. package/.next/static/chunks/app/chat/page-6a5b5f9ea2542fb3.js +0 -1
  351. package/.next/static/chunks/app/docs/page-935b0386917b91bb.js +0 -1
  352. package/.next/static/chunks/app/executions/page-d72027b0179e8fa2.js +0 -1
  353. package/.next/static/chunks/app/flows/page-fbce5abe34500f28.js +0 -1
  354. package/.next/static/chunks/app/layout-2ebf01d97702a18a.js +0 -1
  355. package/.next/static/chunks/app/mcp/page-8666173926cabf31.js +0 -1
  356. package/.next/static/chunks/app/models/error-a3183f168e8a9b04.js +0 -1
  357. package/.next/static/chunks/app/models/page-18dbd8e01cf87e98.js +0 -1
  358. package/.next/static/chunks/app/settings/page-7a68583660508ffd.js +0 -1
  359. package/.next/static/chunks/app/waves/page-ec33cf79f6103a9e.js +0 -1
  360. package/.next/static/chunks/webpack-f4a471ab560eb19e.js +0 -1
  361. package/.next/static/css/39393a79f7cb0dee.css +0 -1
  362. /package/.next/static/{eUM7C1boixGI469h5wtIk → Il6IDWxf3CN0dv-P6QQrp}/_buildManifest.js +0 -0
  363. /package/.next/static/{eUM7C1boixGI469h5wtIk → Il6IDWxf3CN0dv-P6QQrp}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- "use strict";exports.id=4671,exports.ids=[4671],exports.modules={84671:(a,b,c)=>{c.d(b,{nC:()=>m});var d=c(49181),e=c(67512),f=c(41527),g=c(58505);function h(a){return a.data?.type??a.type??"unknown"}function i(a){return a.data?.label||a.id}function j(a){return a.data?.edgeType==="mcp"}function k(a){return a.data?.edgeType==="resource"}function l(a){return j(a)||k(a)}function m(a,b={}){let c=[],n=Array.isArray(a?.nodes)?a.nodes:[],o=Array.isArray(a?.edges)?a.edges:[],p=(a,b,d,e)=>c.push({severity:a,code:b,message:d,nodeId:e?.id,nodeLabel:e?i(e):void 0}),q=new Map((b.models??[]).map(a=>[a.id,a])),r=new Map((b.servers??[]).map(a=>[a.name,a])),s=!!b.models,t=!!b.servers,u=n.filter(a=>"start"===h(a)),v=n.filter(a=>"finish"===h(a)),w=n.filter(a=>"process"===h(a)),x=n.filter(a=>"mcp"===h(a));if(0===u.length)p("error","no-start-node","The flow has no Start node, so it has no entry point.");else if(u.length>1)for(let a of u.slice(1))p("error","multiple-start-nodes","The flow has more than one Start node; only one is allowed.",a);for(let a of(0===v.length&&p("warning","no-finish-node","The flow has no Finish node; it will run but never reaches a defined end."),w)){let b=a.data?.properties??{},c=b.boundModel;if(c){if(s&&!q.has(c)){let c="string"==typeof b.modelName&&b.modelName?` (was "${b.modelName}")`:"";p("error","process-model-missing",`Process node "${i(a)}" is bound to a model that no longer exists${c}.`,a)}}else p("error","process-missing-model",`Process node "${i(a)}" has no model bound.`,a)}for(let a of x){let b=(a.data?.properties??{}).boundServer;if(b){if(t&&!r.has(b))p("warning","mcp-server-missing",`MCP node "${i(a)}" is bound to server "${b}", which isn't in your current MCP server list. It may be offline (e.g. not connected), renamed, or removed — if it was renamed or removed, rebind this node.`,a);else if(t){let c=r.get(b);if(c.status&&"connected"!==c.status){let d="disabled"===c.status?"disabled":`not connected (${c.status})`;p("warning","mcp-server-disconnected",`MCP node "${i(a)}" is bound to server "${b}", which is currently ${d}. It will provide tools again once it reconnects.`,a)}}}else p("warning","mcp-missing-server",`MCP node "${i(a)}" is not bound to a server.`,a);o.some(b=>j(b)&&(b.source===a.id||b.target===a.id))||p("warning","mcp-node-unconnected",`MCP node "${i(a)}" is not connected to any Process node.`,a)}for(let a of n.filter(a=>"resource"===h(a))){let b=a.data?.properties??{},c="run"===b.scope?"run":"mcp",d="string"==typeof b.boundServer?b.boundServer:"",e="string"==typeof b.uri?b.uri:"",g="string"==typeof b.runName?b.runName.trim():"";"mcp"!==c||d&&e||p("warning","resource-missing-binding",`Resource node "${i(a)}" has no ${!d?"server":"resource URI"} bound; connected steps will receive nothing.`,a),"run"!==c||g||p("warning","resource-missing-binding",`Resource node "${i(a)}" is a run artifact with no name; give it a name so steps can produce/consume it.`,a),"run"===c&&g&&!(0,f.qW)(g)&&p("warning","resource-run-name",`Resource node "${i(a)}" is named "${g}", which is not a valid artifact name (letters, digits, _ and - only, not starting with a digit); it will be awkward to reference with \${res:...}.`,a),"mcp"===c&&d&&t&&!r.has(d)&&p("warning","resource-server-missing",`Resource node "${i(a)}" is bound to server "${d}", which isn't in your current MCP server list.`,a);let h=o.filter(b=>k(b)&&(b.source===a.id||b.target===a.id));0===h.length&&p("warning","resource-node-unconnected",`Resource node "${i(a)}" is not connected to any Process node.`,a);let j=h.filter(b=>b.target===a.id);"mcp"===c&&j.length>0&&p("error","resource-produce-static",`Resource node "${i(a)}" is a static MCP resource, but a step writes INTO it. Only run artifacts (scope "run") can be produced by a step — flip the edge or make this a run artifact.`,a),"run"===c&&j.length>1&&p("warning","resource-multiple-producers",`Resource node "${i(a)}" is produced by ${j.length} steps; the last writer wins. Consider one producer per artifact.`,a),"run"===c&&0===j.length&&h.length>0&&p("warning","resource-consumed-never-produced",`Resource node "${i(a)}" is consumed but no step in this flow produces it; it resolves to nothing unless an earlier run captured it.`,a)}for(let a of n.filter(a=>"signal"===h(a))){let b=a.data?.properties??{};("string"==typeof b.topic?b.topic.trim():"")||p("warning","signal-missing-topic",`Signal node "${i(a)}" has no topic; it emits nothing. Give it a topic that a flow-event trigger can listen for.`,a)}if(u.length>0){let a=function(a){let b=new Map,c=(a,c)=>{b.has(a)||b.set(a,[]),b.get(a).push(c)};for(let b of a)!l(b)&&(c(b.source,b.target),b.data?.bidirectional&&c(b.target,b.source));return b}(o);for(let b of u)a.get(b.id)?.length||p("error","start-no-outgoing","The Start node is not connected to anything; the flow cannot run.",b);let b=function(a,b){let c=new Set(a),d=[...a];for(;d.length;){let a=d.shift();for(let e of b.get(a)??[])c.has(e)||(c.add(e),d.push(e))}return c}(u.map(a=>a.id),a);for(let a of[...w,...v])b.has(a.id)||p("warning","unreachable-node",`${"finish"===h(a)?"Finish":"Process"} node "${i(a)}" is not reachable from the Start node.`,a)}for(let a of n.filter(a=>"subflow"===h(a))){let b=o.filter(b=>!l(b)&&(b.source===a.id||b.target===a.id&&!!b.data?.bidirectional));b.length>1&&p("error","subflow-multiple-outgoing",`Subflow node "${i(a)}" has ${b.length} outgoing connections; a subflow can only have one (either A > B > C or a bidirectional A <> B).`,a);let c=a.data?.properties??{},d="string"==typeof c.subflowId&&c.subflowId?c.subflowId:void 0,e=Array.isArray(c.parallelSubflowIds)?c.parallelSubflowIds.filter(a=>"string"==typeof a&&!!a):[];d&&e.length>0&&p("error","subflow-both-targets",`Subflow node "${i(a)}" sets both a single "subflowId" and "parallelSubflowIds"; use one or the other.`,a);let g=!0===c.mapOverList;g&&e.length>0&&p("error","subflow-map-and-parallel",`Subflow node "${i(a)}" combines "mapOverList" with "parallelSubflowIds"; map-over-list runs a single child once per item and cannot be combined with parallel fan-out.`,a),g&&!d&&0===e.length&&p("error","subflow-map-no-child",`Subflow node "${i(a)}" has "mapOverList" but no child flow ("subflowId"); select a flow to run once per item.`,a);let h="string"==typeof c.parallelSubflowIdsVar?c.parallelSubflowIdsVar.trim():"";if(h&&((0,f.qW)(h)||p("warning","subflow-parallel-var-name",`Subflow node "${i(a)}" reads dynamic fan-out targets from "${h}", which is not a valid variable name (letters, digits, _ and - only, not starting with a digit); it will be awkward to capture with \${var:...}.`,a),g&&p("error","subflow-map-and-parallel-var",`Subflow node "${i(a)}" combines "mapOverList" with dynamic fan-out ("parallelSubflowIdsVar"); map-over-list runs a single child once per item and cannot be combined with fan-out.`,a),n.some(a=>{let b=a.data?.properties?.captureVariable;return"string"==typeof b&&b.trim()===h})||p("warning","subflow-parallel-var-uncaptured",`Subflow node "${i(a)}" reads dynamic fan-out targets from variable "${h}", but no node captures it (captureVariable). It may be seeded by the caller; otherwise it resolves to no targets and the node falls back to its static parallel list.`,a)),!0===c.allowCallerFanout&&g&&p("error","subflow-map-and-caller-fanout",`Subflow node "${i(a)}" combines "mapOverList" with agentic fan-out ("allowCallerFanout"); map-over-list runs a single child once per item and cannot be combined with fan-out.`,a),e.length>0){let b=c.concurrencyLimit;"number"==typeof b&&b<1&&p("warning","subflow-concurrency-limit",`Subflow node "${i(a)}" has a concurrencyLimit of ${b}; it must be at least 1 (the runtime default will be used).`,a)}}{let a=new Map(n.map(a=>[a.id,a])),b=new Set;for(let c of o){if(l(c))continue;let d=c.data?.condition;if(!d||"object"!=typeof d)continue;let f=a.get(c.source),g=f?h(f):"unknown";if("process"!==g){p("error","edge-condition-non-process",`An edge leaving ${"unknown"===g?"an unknown":`the ${g}`} node "${f?i(f):c.source}" has a routing condition, but only process nodes can route on a condition.`,f??void 0);continue}b.add(c.source),(0,e.C)(d.kind)?"always"===d.kind||("string"!=typeof d.value||0===d.value.length?p("warning","edge-condition-value",`Process node "${i(f)}" has an outgoing edge condition with no "value"; it will never match.`,f):"regex"!==d.kind||(0,e.wM)(d.value)||p("warning","edge-condition-regex",`Process node "${i(f)}" has an outgoing edge with a regex condition that does not compile; it will never match.`,f)):p("warning","edge-condition-kind",`Process node "${i(f)}" has an outgoing edge whose condition kind "${String(d.kind)}" is unknown; it will never match.`,f)}for(let c of b){let b=a.get(c);b&&(o.some(a=>!l(a)&&(a.source===c?!a.data?.condition||"always"===a.data.condition.kind&&!a.data.condition.negate:!!(a.target===c&&a.data?.bidirectional)))||p("warning","edge-condition-no-fallback",`Process node "${i(b)}" has conditioned outgoing edges but no bare fallback edge; if no condition matches, the flow ends here.`,b))}}{let a=new Set;for(let b of n){let c=b.data?.properties?.captureVariable;if("string"==typeof c&&c.trim()){let d=c.trim();a.add(d),(0,f.qW)(d)||p("warning","capture-var-name",`${"subflow"===h(b)?"Subflow":"Process"} node "${i(b)}" captures into "${d}", which is not a valid variable name (letters, digits, _ and - only, not starting with a digit); it will be awkward to reference with \${var:...}.`,b)}}let b=["promptTemplate","isolatedPrompt"],c=new Set;for(let d of n){let e=d.data?.properties??{};for(let g of b){let b=e[g];if("string"==typeof b&&b)for(let e of(0,f.T9)(b)){if(a.has(e))continue;let b=`${d.id}:${e}`;c.has(b)||(c.add(b),p("warning","var-ref-uncaptured",`${i(d)} references \${var:${e}} but no step in this flow captures "${e}" (via captureVariable). It resolves to empty unless supplied as a run input — check for a typo or a step ordered after this one.`,d))}}}}{for(let a of n){let b=a.data?.properties?.captureKv;if("string"==typeof b&&b.trim()){let{key:c}=(0,g.g2)(b.trim());(0,g.ng)(c)||p("warning","capture-kv-name",`${"subflow"===h(a)?"Subflow":"Process"} node "${i(a)}" captures into kv "${b.trim()}", whose key is not a valid name (letters, digits, _ and - only, not starting with a digit); it will be awkward to reference with \${kv:...}.`,a)}}let a=["promptTemplate","isolatedPrompt"],b=new Set;for(let c of n){let d=c.data?.properties??{};for(let e of a){let a=d[e];if("string"==typeof a&&a)for(let d of(0,g.pf)(a)){let{key:a}=(0,g.g2)(d);if((0,g.ng)(a))continue;let e=`${c.id}:${d}`;b.has(e)||(b.add(e),p("warning","kv-ref-name",`${i(c)} references \${kv:${d}}, whose key is not a valid name (letters, digits, _ and - only, not starting with a digit); it resolves to empty.`,c))}}}}for(let a of w){let c=a.data?.properties?.promptTemplate;if("string"!=typeof c||!c)continue;let e=function(a,b,c){let d=new Map(b.map(a=>[a.id,a])),e=new Set;for(let b of c){if(!j(b))continue;let c=null;if(b.source===a?c=b.target:b.target===a&&(c=b.source),!c)continue;let f=d.get(c);if(!f||"mcp"!==h(f))continue;let g=f.data?.properties?.boundServer;"string"==typeof g&&g&&e.add(g)}return e}(a.id,n,o),f=new Set;for(let g of(0,d.A$)(c)){if("handoff"===g.server)continue;let c=`${g.kind}:${g.server}:${g.name}`;!f.has(c)&&(f.add(c),e.has(g.server)?"tool"===g.kind&&b.serverTools&&b.serverTools[g.server]&&!b.serverTools[g.server].includes(g.name)&&p("warning","tool-unavailable",`Process node "${i(a)}" references tool "${g.name}" which server "${g.server}" no longer provides.`,a):p("error","tool-pill-disconnected",`Process node "${i(a)}" references ${g.kind} "${g.name}" from server "${g.server}", but it is not connected to that server (the MCP node was removed or the server was renamed).`,a))}}let y=c.filter(a=>"error"===a.severity).length,z=c.length-y;return{issues:c,errorCount:y,warningCount:z,isRunnable:0===y}}}};
1
+ "use strict";exports.id=4671,exports.ids=[4671],exports.modules={84671:(a,b,c)=>{c.d(b,{nC:()=>m});var d=c(49181),e=c(67512),f=c(41527),g=c(58505);function h(a){return a.data?.type??a.type??"unknown"}function i(a){return a.data?.label||a.id}function j(a){return a.data?.edgeType==="mcp"}function k(a){return a.data?.edgeType==="resource"}function l(a){return j(a)||k(a)}function m(a,b={}){let c=[],n=Array.isArray(a?.nodes)?a.nodes:[],o=Array.isArray(a?.edges)?a.edges:[],p=(a,b,d,e)=>c.push({severity:a,code:b,message:d,nodeId:e?.id,nodeLabel:e?i(e):void 0}),q=new Map((b.models??[]).map(a=>[a.id,a])),r=new Map((b.servers??[]).map(a=>[a.name,a])),s=!!b.models,t=!!b.servers,u=n.filter(a=>"start"===h(a)),v=n.filter(a=>"finish"===h(a)),w=n.filter(a=>"process"===h(a)),x=n.filter(a=>"mcp"===h(a));if(0===u.length)p("error","no-start-node","The flow has no Start node, so it has no entry point.");else if(u.length>1)for(let a of u.slice(1))p("error","multiple-start-nodes","The flow has more than one Start node; only one is allowed.",a);for(let a of(0===v.length&&p("warning","no-finish-node","The flow has no Finish node; it will run but never reaches a defined end."),w)){let b=a.data?.properties??{},c=b.boundModel;if(c){if(s&&!q.has(c)){let c="string"==typeof b.modelName&&b.modelName?` (was "${b.modelName}")`:"";p("error","process-model-missing",`Process node "${i(a)}" is bound to a model that no longer exists${c}.`,a)}}else p("error","process-missing-model",`Process node "${i(a)}" has no model bound.`,a)}for(let a of x){let b=(a.data?.properties??{}).boundServer;if(b){if(t&&!r.has(b))p("warning","mcp-server-missing",`MCP node "${i(a)}" is bound to server "${b}", which isn't in your current MCP server list. It may be offline (e.g. not connected), renamed, or removed — if it was renamed or removed, rebind this node.`,a);else if(t){let c=r.get(b);if(c.status&&"connected"!==c.status){let d="disabled"===c.status?"disabled":`not connected (${c.status})`;p("warning","mcp-server-disconnected",`MCP node "${i(a)}" is bound to server "${b}", which is currently ${d}. It will provide tools again once it reconnects.`,a)}}}else p("warning","mcp-missing-server",`MCP node "${i(a)}" is not bound to a server.`,a);o.some(b=>j(b)&&(b.source===a.id||b.target===a.id))||p("warning","mcp-node-unconnected",`MCP node "${i(a)}" is not connected to any Process node.`,a)}for(let a of n.filter(a=>"resource"===h(a))){let b=a.data?.properties??{},c="run"===b.scope?"run":"mcp",d="string"==typeof b.boundServer?b.boundServer:"",e="string"==typeof b.uri?b.uri:"",g="string"==typeof b.runName?b.runName.trim():"";"mcp"!==c||d&&e||p("warning","resource-missing-binding",`Resource node "${i(a)}" has no ${!d?"server":"resource URI"} bound; connected steps will receive nothing.`,a),"run"!==c||g||p("warning","resource-missing-binding",`Resource node "${i(a)}" is a run artifact with no name; give it a name so steps can produce/consume it.`,a),"run"===c&&g&&!(0,f.qW)(g)&&p("warning","resource-run-name",`Resource node "${i(a)}" is named "${g}", which is not a valid artifact name (letters, digits, _ and - only, not starting with a digit); it will be awkward to reference with \${res:...}.`,a),"mcp"===c&&d&&t&&!r.has(d)&&p("warning","resource-server-missing",`Resource node "${i(a)}" is bound to server "${d}", which isn't in your current MCP server list.`,a);let h=o.filter(b=>k(b)&&(b.source===a.id||b.target===a.id));0===h.length&&p("warning","resource-node-unconnected",`Resource node "${i(a)}" is not connected to any Process node.`,a);let j=h.filter(b=>b.target===a.id);"mcp"===c&&j.length>0&&p("error","resource-produce-static",`Resource node "${i(a)}" is a static MCP resource, but a step writes INTO it. Only run artifacts (scope "run") can be produced by a step — flip the edge or make this a run artifact.`,a),"run"===c&&j.length>1&&p("warning","resource-multiple-producers",`Resource node "${i(a)}" is produced by ${j.length} steps; the last writer wins. Consider one producer per artifact.`,a),"run"===c&&0===j.length&&h.length>0&&p("warning","resource-consumed-never-produced",`Resource node "${i(a)}" is consumed but no step in this flow produces it; it resolves to nothing unless an earlier run captured it.`,a)}for(let a of n.filter(a=>"signal"===h(a))){let b=a.data?.properties??{};("string"==typeof b.topic?b.topic.trim():"")||p("warning","signal-missing-topic",`Signal node "${i(a)}" has no topic; it emits nothing. Give it a topic that a flow-event trigger can listen for.`,a)}if(u.length>0){let a=function(a){let b=new Map,c=(a,c)=>{b.has(a)||b.set(a,[]),b.get(a).push(c)};for(let b of a)!l(b)&&(c(b.source,b.target),b.data?.bidirectional&&c(b.target,b.source));return b}(o);for(let b of u)a.get(b.id)?.length||p("error","start-no-outgoing","The Start node is not connected to anything; the flow cannot run.",b);let b=function(a,b){let c=new Set(a),d=[...a];for(;d.length;){let a=d.shift();for(let e of b.get(a)??[])c.has(e)||(c.add(e),d.push(e))}return c}(u.map(a=>a.id),a);for(let a of[...w,...v])b.has(a.id)||p("warning","unreachable-node",`${"finish"===h(a)?"Finish":"Process"} node "${i(a)}" is not reachable from the Start node.`,a)}for(let a of n.filter(a=>"subflow"===h(a))){let b=o.filter(b=>!l(b)&&(b.source===a.id||b.target===a.id&&!!b.data?.bidirectional));b.length>1&&p("error","subflow-multiple-outgoing",`Subflow node "${i(a)}" has ${b.length} outgoing connections; a subflow can only have one (either A > B > C or a bidirectional A <> B).`,a);let c=a.data?.properties??{},d="string"==typeof c.subflowId&&c.subflowId?c.subflowId:void 0,e=Array.isArray(c.parallelSubflowIds)?c.parallelSubflowIds.filter(a=>"string"==typeof a&&!!a):[];d&&e.length>0&&p("error","subflow-both-targets",`Subflow node "${i(a)}" sets both a single "subflowId" and "parallelSubflowIds"; use one or the other.`,a);let g=!0===c.mapOverList;g&&e.length>0&&p("error","subflow-map-and-parallel",`Subflow node "${i(a)}" combines "mapOverList" with "parallelSubflowIds"; map-over-list runs a single child once per item and cannot be combined with parallel fan-out.`,a),g&&!d&&0===e.length&&p("error","subflow-map-no-child",`Subflow node "${i(a)}" has "mapOverList" but no child flow ("subflowId"); select a flow to run once per item.`,a);let h=Array.isArray(c.spawnBriefs)?c.spawnBriefs.filter(a=>"string"==typeof a&&""!==a.trim()):[];h.length>0&&!d&&p("error","subflow-spawn-no-child",`Subflow node "${i(a)}" has spawn briefs but no sub-agent flow ("subflowId"); select the flow to spawn once per brief.`,a),h.length>0&&e.length>0&&p("error","subflow-spawn-and-parallel",`Subflow node "${i(a)}" combines "spawnBriefs" with "parallelSubflowIds"; spawn briefs run one sub-agent per brief and cannot be combined with a multi-flow fan-out list.`,a),h.length>0&&g&&p("error","subflow-spawn-and-map",`Subflow node "${i(a)}" combines "spawnBriefs" with "mapOverList"; use one lane source or the other.`,a);let j="string"==typeof c.parallelSubflowIdsVar?c.parallelSubflowIdsVar.trim():"";if(j&&((0,f.qW)(j)||p("warning","subflow-parallel-var-name",`Subflow node "${i(a)}" reads dynamic fan-out targets from "${j}", which is not a valid variable name (letters, digits, _ and - only, not starting with a digit); it will be awkward to capture with \${var:...}.`,a),g&&p("error","subflow-map-and-parallel-var",`Subflow node "${i(a)}" combines "mapOverList" with dynamic fan-out ("parallelSubflowIdsVar"); map-over-list runs a single child once per item and cannot be combined with fan-out.`,a),n.some(a=>{let b=a.data?.properties?.captureVariable;return"string"==typeof b&&b.trim()===j})||p("warning","subflow-parallel-var-uncaptured",`Subflow node "${i(a)}" reads dynamic fan-out targets from variable "${j}", but no node captures it (captureVariable). It may be seeded by the caller; otherwise it resolves to no targets and the node falls back to its static parallel list.`,a)),!0===c.allowCallerFanout&&g&&p("error","subflow-map-and-caller-fanout",`Subflow node "${i(a)}" combines "mapOverList" with agentic fan-out ("allowCallerFanout"); map-over-list runs a single child once per item and cannot be combined with fan-out.`,a),e.length>0||h.length>0){let b=c.concurrencyLimit;"number"==typeof b&&b<1&&p("warning","subflow-concurrency-limit",`Subflow node "${i(a)}" has a concurrencyLimit of ${b}; it must be at least 1 (the runtime default will be used).`,a)}}{let a=new Map(n.map(a=>[a.id,a])),b=new Set;for(let c of o){if(l(c))continue;let d=c.data?.condition;if(!d||"object"!=typeof d)continue;let f=a.get(c.source),g=f?h(f):"unknown";if("process"!==g){p("error","edge-condition-non-process",`An edge leaving ${"unknown"===g?"an unknown":`the ${g}`} node "${f?i(f):c.source}" has a routing condition, but only process nodes can route on a condition.`,f??void 0);continue}b.add(c.source),(0,e.C)(d.kind)?"always"===d.kind||("string"!=typeof d.value||0===d.value.length?p("warning","edge-condition-value",`Process node "${i(f)}" has an outgoing edge condition with no "value"; it will never match.`,f):"regex"!==d.kind||(0,e.wM)(d.value)||p("warning","edge-condition-regex",`Process node "${i(f)}" has an outgoing edge with a regex condition that does not compile; it will never match.`,f)):p("warning","edge-condition-kind",`Process node "${i(f)}" has an outgoing edge whose condition kind "${String(d.kind)}" is unknown; it will never match.`,f)}for(let c of b){let b=a.get(c);b&&(o.some(a=>!l(a)&&(a.source===c?!a.data?.condition||"always"===a.data.condition.kind&&!a.data.condition.negate:!!(a.target===c&&a.data?.bidirectional)))||p("warning","edge-condition-no-fallback",`Process node "${i(b)}" has conditioned outgoing edges but no bare fallback edge; if no condition matches, the flow ends here.`,b))}}{let a=new Set;for(let b of n){let c=b.data?.properties?.captureVariable;if("string"==typeof c&&c.trim()){let d=c.trim();a.add(d),(0,f.qW)(d)||p("warning","capture-var-name",`${"subflow"===h(b)?"Subflow":"Process"} node "${i(b)}" captures into "${d}", which is not a valid variable name (letters, digits, _ and - only, not starting with a digit); it will be awkward to reference with \${var:...}.`,b)}}let b=["promptTemplate","isolatedPrompt"],c=new Set;for(let d of n){let e=d.data?.properties??{};for(let g of b){let b=e[g];if("string"==typeof b&&b)for(let e of(0,f.T9)(b)){if(a.has(e))continue;let b=`${d.id}:${e}`;c.has(b)||(c.add(b),p("warning","var-ref-uncaptured",`${i(d)} references \${var:${e}} but no step in this flow captures "${e}" (via captureVariable). It resolves to empty unless supplied as a run input — check for a typo or a step ordered after this one.`,d))}}}}{for(let a of n){let b=a.data?.properties?.captureKv;if("string"==typeof b&&b.trim()){let{key:c}=(0,g.g2)(b.trim());(0,g.ng)(c)||p("warning","capture-kv-name",`${"subflow"===h(a)?"Subflow":"Process"} node "${i(a)}" captures into kv "${b.trim()}", whose key is not a valid name (letters, digits, _ and - only, not starting with a digit); it will be awkward to reference with \${kv:...}.`,a)}}let a=["promptTemplate","isolatedPrompt"],b=new Set;for(let c of n){let d=c.data?.properties??{};for(let e of a){let a=d[e];if("string"==typeof a&&a)for(let d of(0,g.pf)(a)){let{key:a}=(0,g.g2)(d);if((0,g.ng)(a))continue;let e=`${c.id}:${d}`;b.has(e)||(b.add(e),p("warning","kv-ref-name",`${i(c)} references \${kv:${d}}, whose key is not a valid name (letters, digits, _ and - only, not starting with a digit); it resolves to empty.`,c))}}}}for(let a of w){let c=a.data?.properties?.promptTemplate;if("string"!=typeof c||!c)continue;let e=function(a,b,c){let d=new Map(b.map(a=>[a.id,a])),e=new Set;for(let b of c){if(!j(b))continue;let c=null;if(b.source===a?c=b.target:b.target===a&&(c=b.source),!c)continue;let f=d.get(c);if(!f||"mcp"!==h(f))continue;let g=f.data?.properties?.boundServer;"string"==typeof g&&g&&e.add(g)}return e}(a.id,n,o),f=new Set;for(let g of(0,d.A$)(c)){if("handoff"===g.server)continue;let c=`${g.kind}:${g.server}:${g.name}`;!f.has(c)&&(f.add(c),e.has(g.server)?"tool"===g.kind&&b.serverTools&&b.serverTools[g.server]&&!b.serverTools[g.server].includes(g.name)&&p("warning","tool-unavailable",`Process node "${i(a)}" references tool "${g.name}" which server "${g.server}" no longer provides.`,a):p("error","tool-pill-disconnected",`Process node "${i(a)}" references ${g.kind} "${g.name}" from server "${g.server}", but it is not connected to that server (the MCP node was removed or the server was renamed).`,a))}}let y=c.filter(a=>"error"===a.severity).length,z=c.length-y;return{issues:c,errorCount:y,warningCount:z,isRunnable:0===y}}}};
@@ -0,0 +1,37 @@
1
+ "use strict";exports.id=4677,exports.ids=[4677],exports.modules={2117:(a,b,c)=>{c.d(b,{A:()=>i});var d=c(55511);let e={randomUUID:d.randomUUID},f=new Uint8Array(256),g=f.length,h=[];for(let a=0;a<256;++a)h.push((a+256).toString(16).slice(1));let i=function(a,b,c){if(e.randomUUID&&!b&&!a)return e.randomUUID();let i=(a=a||{}).random??a.rng?.()??(g>f.length-16&&((0,d.randomFillSync)(f),g=0),f.slice(g,g+=16));if(i.length<16)throw Error("Random bytes length must be >= 16");if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,b){if((c=c||0)<0||c+16>b.length)throw RangeError(`UUID byte range ${c}:${c+15} is out of buffer bounds`);for(let a=0;a<16;++a)b[c+a]=i[a];return b}return function(a,b=0){return(h[a[b+0]]+h[a[b+1]]+h[a[b+2]]+h[a[b+3]]+"-"+h[a[b+4]]+h[a[b+5]]+"-"+h[a[b+6]]+h[a[b+7]]+"-"+h[a[b+8]]+h[a[b+9]]+"-"+h[a[b+10]]+h[a[b+11]]+h[a[b+12]]+h[a[b+13]]+h[a[b+14]]+h[a[b+15]]).toLowerCase()}(i)}},22797:(a,b,c)=>{c.d(b,{A:()=>f});var d=c(27080),e=c(21124);let f=(0,d.A)((0,e.jsx)("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"ErrorOutline")},40216:(a,b,c)=>{c.d(b,{A:()=>f});var d=c(27080),e=c(21124);let f=(0,d.A)((0,e.jsx)("path",{d:"M22 11V3h-7v3H9V3H2v8h7V8h2v10h4v3h7v-8h-7v3h-2V8h2v3zM7 9H4V5h3zm10 6h3v4h-3zm0-10h3v4h-3z"}),"AccountTreeOutlined")},48823:(a,b,c)=>{c.d(b,{A:()=>f});var d=c(27080),e=c(21124);let f=(0,d.A)((0,e.jsx)("path",{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2M6 9h12v2H6zm8 5H6v-2h8zm4-6H6V6h12z"}),"Chat")},63908:(a,b,c)=>{c.d(b,{A:()=>f});var d=c(27080),e=c(21124);let f=(0,d.A)((0,e.jsx)("path",{d:"m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"}),"ExpandLess")},72197:(a,b,c)=>{c.d(b,{A:()=>u});var d=c(38301),e=c(43249),f=c(2783),g=c(37489),h=c(78871),i=c(18168),j=c(68333),k=c(6636),l=c(29565),m=c(33105);function n(a){return(0,m.Ay)("MuiSkeleton",a)}(0,l.A)("MuiSkeleton",["root","text","rectangular","rounded","circular","pulse","wave","withChildren","fitContent","heightAuto"]);var o=c(21124);let p=(0,h.i7)`
2
+ 0% {
3
+ opacity: 1;
4
+ }
5
+
6
+ 50% {
7
+ opacity: 0.4;
8
+ }
9
+
10
+ 100% {
11
+ opacity: 1;
12
+ }
13
+ `,q=(0,h.i7)`
14
+ 0% {
15
+ transform: translateX(-100%);
16
+ }
17
+
18
+ 50% {
19
+ /* +0.5s of delay between each loop */
20
+ transform: translateX(100%);
21
+ }
22
+
23
+ 100% {
24
+ transform: translateX(100%);
25
+ }
26
+ `,r="string"!=typeof p?(0,h.AH)`
27
+ animation: ${p} 2s ease-in-out 0.5s infinite;
28
+ `:null,s="string"!=typeof q?(0,h.AH)`
29
+ &::after {
30
+ animation: ${q} 2s linear 0.5s infinite;
31
+ }
32
+ `:null,t=(0,i.Ay)("span",{name:"MuiSkeleton",slot:"Root",overridesResolver:(a,b)=>{let{ownerState:c}=a;return[b.root,b[c.variant],!1!==c.animation&&b[c.animation],c.hasChildren&&b.withChildren,c.hasChildren&&!c.width&&b.fitContent,c.hasChildren&&!c.height&&b.heightAuto]}})((0,j.A)(({theme:a})=>{let b=String(a.shape.borderRadius).match(/[\d.\-+]*\s*(.*)/)[1]||"px",c=parseFloat(a.shape.borderRadius);return{display:"block",backgroundColor:a.vars?a.vars.palette.Skeleton.bg:(0,g.X4)(a.palette.text.primary,"light"===a.palette.mode?.11:.13),height:"1.2em",variants:[{props:{variant:"text"},style:{marginTop:0,marginBottom:0,height:"auto",transformOrigin:"0 55%",transform:"scale(1, 0.60)",borderRadius:`${c}${b}/${Math.round(c/.6*10)/10}${b}`,"&:empty:before":{content:'"\\00a0"'}}},{props:{variant:"circular"},style:{borderRadius:"50%"}},{props:{variant:"rounded"},style:{borderRadius:(a.vars||a).shape.borderRadius}},{props:({ownerState:a})=>a.hasChildren,style:{"& > *":{visibility:"hidden"}}},{props:({ownerState:a})=>a.hasChildren&&!a.width,style:{maxWidth:"fit-content"}},{props:({ownerState:a})=>a.hasChildren&&!a.height,style:{height:"auto"}},{props:{animation:"pulse"},style:r||{animation:`${p} 2s ease-in-out 0.5s infinite`}},{props:{animation:"wave"},style:{position:"relative",overflow:"hidden",WebkitMaskImage:"-webkit-radial-gradient(white, black)","&::after":{background:`linear-gradient(
33
+ 90deg,
34
+ transparent,
35
+ ${(a.vars||a).palette.action.hover},
36
+ transparent
37
+ )`,content:'""',position:"absolute",transform:"translateX(-100%)",bottom:0,left:0,right:0,top:0}}},{props:{animation:"wave"},style:s||{"&::after":{animation:`${q} 2s linear 0.5s infinite`}}}]}})),u=d.forwardRef(function(a,b){let c=(0,k.b)({props:a,name:"MuiSkeleton"}),{animation:d="pulse",className:g,component:h="span",height:i,style:j,variant:l="text",width:m,...p}=c,q={...c,animation:d,component:h,variant:l,hasChildren:!!p.children},r=(a=>{let{classes:b,variant:c,animation:d,hasChildren:e,width:g,height:h}=a;return(0,f.A)({root:["root",c,d,e&&"withChildren",e&&!g&&"fitContent",e&&!h&&"heightAuto"]},n,b)})(q);return(0,o.jsx)(t,{as:h,ref:b,className:(0,e.A)(r.root,g),ownerState:q,...p,style:{width:m,height:i,...j}})})},83144:(a,b,c)=>{c.d(b,{A:()=>f});var d=c(27080),e=c(21124);let f=(0,d.A)([(0,e.jsx)("path",{d:"m17 17 5-5-5-5-1.41 1.41L18.17 11H9v2h9.17l-2.58 2.59z"},"0"),(0,e.jsx)("path",{d:"M19 19H5V5h14v2h2V5c0-1.1-.89-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.11 0 2-.9 2-2v-2h-2z"},"1")],"Output")},87351:(a,b,c)=>{c.d(b,{A:()=>f});var d=c(27080),e=c(21124);let f=(0,d.A)((0,e.jsx)("path",{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm2 16H8v-2h8zm0-4H8v-2h8zm-3-5V3.5L18.5 9z"}),"Description")},93995:(a,b,c)=>{c.d(b,{A:()=>f});var d=c(27080),e=c(21124);let f=(0,d.A)((0,e.jsx)("path",{d:"M7.58 4.08 6.15 2.65C3.75 4.48 2.17 7.3 2.03 10.5h2c.15-2.65 1.51-4.97 3.55-6.42m12.39 6.42h2c-.15-3.2-1.73-6.02-4.12-7.85l-1.42 1.43c2.02 1.45 3.39 3.77 3.54 6.42M18 11c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2zm-6 11c.14 0 .27-.01.4-.04.65-.14 1.18-.58 1.44-1.18q.15-.36.15-.78h-4c.01 1.1.9 2 2.01 2"}),"NotificationsActive")},98540:(a,b,c)=>{c.d(b,{A:()=>f});var d=c(27080),e=c(21124);let f=(0,d.A)((0,e.jsx)("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"}),"Settings")}};
@@ -1,6 +1,6 @@
1
- "use strict";exports.id=4771,exports.ids=[4771,6793],exports.modules={4771:(a,b,c)=>{c.d(b,{z:()=>F});var d=c(32524),e=c(92372),f=c(46480),g=c(50846),h=c(58739),i=c(52189),j=c(33873),k=c.n(j),l=c(29021),m=c(9794);let n=(0,g.h)("backend/services/scheduler/triggers/fileWatch");var o=c(73736),p=c(10960),q=c(51875);let r=(0,g.h)("backend/services/scheduler/triggers/mcpPoll"),s=(0,g.h)("backend/services/scheduler/triggers/urlWatch");var t=c(56793);let u=(0,g.h)("backend/services/scheduler/triggers/flowEvent");function v(a){return a&&a.length>8192?`${a.slice(0,8192)}… (truncated)`:a}var w=c(59911);let x=(0,g.h)("backend/services/scheduler/state"),y=a=>`planned-execution-state/${a}`;async function z(a){try{return await (0,e.YM)(y(a),{})}catch(b){return x.error(`Failed to load trigger state for ${a}:`,b),{}}}async function A(a,b){await (0,e.VH)(y(a),b)}async function B(a){await (0,e.N2)(y(a))}let C=(0,g.h)("backend/services/scheduler/index"),D={version:1,paused:!1,executions:[]};class E{static{this.MAX_QUEUE_DEPTH=50}async start(){this.started||(this.started=!0,C.info("Starting scheduler"),await this.reconcile())}reconcile(){let a=this.reconcileChain.catch(()=>{}).then(()=>this.doReconcile());return this.reconcileChain=a,a}async doReconcile(){for(let[a,b]of this.armed)try{b.dispose()}catch(b){C.warn(`Failed to dispose trigger for ${a}:`,b)}this.armed.clear();let a=await this.loadFile();if(this.pausedCache=a.paused,a.paused)return void C.info("Scheduler is paused — nothing armed");for(let b of a.executions)if(b.enabled)try{await this.armExecution(b)}catch(c){let a=c instanceof Error?c.message:String(c);this.lastTriggerErrors.set(b.id,a),C.error(`Failed to arm "${b.name}" (${b.id}):`,c)}C.info(`Scheduler armed ${this.armed.size} execution(s)`)}async armExecution(a){let b=a.trigger;switch(b.type){case"schedule":{let c=await z(a.id);c.lastScheduledFireAt?b.catchUp&&(0,i.hk)(b,c.lastScheduledFireAt)&&(await A(a.id,{...c,lastScheduledFireAt:new Date().toISOString()}),C.info(`Catch-up run for "${a.name}" (missed while closed)`),this.fire(a,{kind:"schedule-catchup",summary:"Schedule (missed while FLUJO was closed — ran once at startup)"})):await A(a.id,{...c,lastScheduledFireAt:new Date().toISOString()}),this.armed.set(a.id,(0,i.wv)(b,()=>{(async()=>{let b=await z(a.id);await A(a.id,{...b,lastScheduledFireAt:new Date().toISOString()}),await this.fire(a,{kind:"schedule",summary:"Schedule"})})().catch(b=>C.error(`Scheduled fire failed for ${a.id}:`,b))}));break}case"webhook":break;case"file-watch":this.armed.set(a.id,function(a,b,c){let d,e=a.debounceMs??2e3,f=new Set(a.events),g=a.glob?.trim()?function(a){let b=a.replace(/\\/g,"/"),c="";for(let a=0;a<b.length;a++){let d=b[a];"*"===d?"*"===b[a+1]?"/"===b[++a+1]?(a++,c+="(?:.*/)?"):c+=".*":c+="[^/]*":"?"===d?c+="[^/]":c+=d.replace(/[.+^${}()|[\]\\]/g,"\\$&")}return RegExp(`^${c}$`)}(a.glob.trim()):null;try{d=l.realpathSync.native(a.path)}catch(d){let b=d instanceof Error?d.message:String(d);return n.warn(`Cannot watch "${a.path}": ${b}`),c(`Cannot watch "${a.path}": ${b}`),{dispose:()=>void 0}}let h=[],i=!1,j=null,o=!1,p=()=>{if(j=null,o||0===h.length)return;let a=h;i&&n.info("File-watch batch overflowed; reporting first 50 events"),h=[],i=!1,b({events:a})},q=(0,m.wB)(d,{ignoreInitial:!0,awaitWriteFinish:{stabilityThreshold:500,pollInterval:100}});return q.on("all",(a,b)=>{if(!o&&("add"===a||"change"===a||"unlink"===a)&&f.has(a)){if(g){let a=k().relative(d,b).replace(/\\/g,"/")||k().basename(b);if(!g.test(a))return}h.length>=50?i=!0:h.push({event:a,path:b}),j&&clearTimeout(j),j=setTimeout(p,e),j.unref?.()}}),q.on("error",a=>{let b=a instanceof Error?a.message:String(a);n.warn(`Watcher error for ${d}: ${b}`),c(b)}),{dispose:()=>{o=!0,j&&(clearTimeout(j),j=null),h=[],q.close().catch(a=>n.warn(`Failed to close watcher for ${d}:`,a))}}}(b,({events:c})=>{this.lastTriggerErrors.delete(a.id),this.fire(a,{kind:"file",summary:1===c.length?`File ${"unlink"===c[0].event?"deleted":"add"===c[0].event?"added":"changed"}`:`${c.length} file changes`,context:{watchedPath:b.path,events:c}})},b=>this.lastTriggerErrors.set(a.id,b)));break;case"mcp-poll":Promise.all([c.e(6996),c.e(1223),c.e(5734),c.e(4545)]).then(c.bind(c,61397)).then(async({mcpService:c})=>{await c.isServerDisabled(b.serverName)&&this.lastTriggerErrors.set(a.id,`MCP server '${b.serverName}' is disabled — enable it on the MCP page or change the trigger`)}).catch(b=>C.warn(`Arm-time disabled-server check failed for ${a.id}:`,b)),this.armed.set(a.id,function(a,b){let c=a.cron||(0,p.X)(a.intervalMs),d=!1,e=!1,f=0,g=0,h=async()=>{if(!e&&!d){if(g>0)return void g--;d=!0;try{let c,d=await b.callTool(a.serverName,a.toolName,a.args);if(!d.success)throw Error(d.error||"Tool call failed");f=0;let g=await b.loadState(),h=a.evaluate;if(c="on-change"===h.mode?(0,q.Jl)(d.data,g):"new-items"===h.mode?(0,q.A1)(d.data,h.itemsPath,h.idField,g):b.evaluateAiGate?await b.evaluateAiGate(d.data,h,g):{fire:!1,newState:{},error:'The "AI decides" condition is not available yet'},e)return;if(Object.keys(c.newState).length>0&&await b.saveState(c.newState),c.error)b.onError(c.error);else if(c.fire){let{status:d}=await b.onFire({summary:`Watched tool: ${c.summary??"condition met"}`,context:{server:a.serverName,tool:a.toolName,..."object"==typeof c.context&&null!==c.context?c.context:{result:c.context}}});if(e)return;if(c.pendingState){let{giveUpError:a}=await (0,q.vV)({status:d,pendingState:c.pendingState,priorFailures:g.pendingFailures??0,saveState:b.saveState});a&&b.onError(a)}}else b.onSuccess?.()}catch(d){f++,g=Math.min(2**(f-1),8);let c=d instanceof Error?d.message:String(d);r.warn(`Poll failed for ${a.serverName}/${a.toolName} (backing off ${g} check(s)): ${c}`),b.onError(c)}finally{d=!1}}},i=new o.l4(c,{timezone:a.timezone,unref:!0},()=>void h());return h(),{dispose:()=>{e=!0,i.stop()},nextRun:()=>i.nextRun()?.toISOString()??null}}(b,{callTool:async(a,b,d)=>{let{mcpService:e}=await Promise.all([c.e(6996),c.e(1223),c.e(5734),c.e(4545)]).then(c.bind(c,61397)),f=await e.callTool(a,b,d);return{success:!0===f.success,data:f.data,error:"string"==typeof f.error?f.error:void 0}},loadState:()=>z(a.id),saveState:async b=>{let c=await z(a.id);await A(a.id,{...c,...b})},onFire:async({summary:b,context:c})=>(this.lastTriggerErrors.delete(a.id),{status:(await this.fire(a,{kind:"mcp-poll",summary:b,context:c})).status}),onError:b=>this.lastTriggerErrors.set(a.id,b),onSuccess:()=>this.lastTriggerErrors.delete(a.id),evaluateAiGate:async(a,b,d)=>{let{evaluateAiGate:e}=await c.e(7506).then(c.bind(c,47506));return e(a,b,d)}}));break;case"url-watch":this.armed.set(a.id,function(a,b){let c=b.fetchImpl??fetch,d=!1,e=!1,f=async()=>{if(!e&&!d){d=!0;try{let d=await c(a.url,{redirect:"follow",headers:{"User-Agent":"FLUJO-url-watch"},signal:AbortSignal.timeout(3e4)});if(!d.ok)return void b.onError(`The URL answered with HTTP ${d.status}`);let f=await d.text(),g=(0,q.qq)(f),h=await b.loadState();if(e)return;if(!h.lastHash){await b.saveState({lastHash:g}),b.onSuccess?.();return}if(h.lastHash===g)return void b.onSuccess?.();let{status:i}=await b.onFire({summary:"Online content changed",context:{url:a.url,status:d.status,contentType:d.headers.get("content-type")??void 0,content:f.length>8192?`${f.slice(0,8192)}… (truncated, ${f.length} chars total)`:f}});if(e)return;let{giveUpError:j}=await (0,q.vV)({status:i,pendingState:{lastHash:g},priorFailures:h.pendingFailures??0,saveState:b.saveState});j&&b.onError(j)}catch(d){let c=d instanceof Error&&"TimeoutError"===d.name?"The URL did not answer within 30s":d instanceof Error?d.message:String(d);s.warn(`URL check failed for ${a.url}: ${c}`),b.onError(c)}finally{d=!1}}},g=new o.l4(a.cron,{timezone:a.timezone,unref:!0},()=>void f());return f(),{dispose:()=>{e=!0,g.stop()},nextRun:()=>g.nextRun()?.toISOString()??null}}(b,{loadState:()=>z(a.id),saveState:async b=>{let c=await z(a.id);await A(a.id,{...c,...b})},onFire:async({summary:b,context:c})=>(this.lastTriggerErrors.delete(a.id),{status:(await this.fire(a,{kind:"url-watch",summary:b,context:c})).status}),onError:b=>this.lastTriggerErrors.set(a.id,b),onSuccess:()=>this.lastTriggerErrors.delete(a.id)}));break;case"flow-event":this.armed.set(a.id,function(a,b){let c=a.maxChainDepth??5,d="string"==typeof a.source.topic?a.source.topic.trim():"",e=d.length>0,f=0,g=null,h=!1;if(a.outputMatch?.regex)try{g=new RegExp(a.outputMatch.regex)}catch(c){h=!0;let a=`Invalid output-match regex: ${c instanceof Error?c.message:String(c)}`;u.warn(a),b.onError(a)}let i=b=>{if(!a.outputMatch)return!0;if(h)return!1;let c=(b??"").slice(0,16384);return(!a.outputMatch.contains||!!c.includes(a.outputMatch.contains))&&(!g||!!g.test(c))},j=(d,e,g)=>{if(d>=c){let a=`Flow-event chain reached the depth limit (${c}); not firing again`;u.info(a),b.onSkip(a);return}let h=Date.now();if(a.minIntervalMs&&h-f<a.minIntervalMs)return void u.debug(`Flow-event cooldown active (${a.minIntervalMs}ms); ignoring event`);f=h,b.onFire({summary:e,context:g,chainDepth:d+1})},k=(0,t.eh)().subscribe(c=>{try{if(e){if(!(0,t.ru)(c)||c.topic!==d||!i(c.payload))return;j(c.chainDepth,`Signal "${c.topic}"`,{topic:c.topic,payload:v(c.payload),emitterFlowId:c.emitterFlowId,flowName:c.flowName,runId:c.runId,conversationId:c.conversationId,firedBy:c.firedBy});return}if((0,t.ru)(c)||!(b=>{let c=a.source;return c.executionId?b.executionId===c.executionId:c.flowId?b.flowId===c.flowId:!!c.flowName&&b.flowName===c.flowName})(c)||!c.status||!(a.on??[]).includes(c.status)||!i(c.outputText))return;let b=c.flowName??c.flowId;j(c.chainDepth,`Flow "${b}" ${c.status}`,{flowId:c.flowId,flowName:c.flowName,executionId:c.executionId,runId:c.runId,conversationId:c.conversationId,status:c.status,firedBy:c.firedBy,outputText:v(c.outputText),error:c.error})}catch(c){let a=c instanceof Error?c.message:String(c);u.warn(`Flow-event handling failed: ${a}`),b.onError(a)}});return{dispose:()=>k(),nextRun:()=>null}}(b,{onFire:({summary:b,context:c,chainDepth:d})=>{this.lastTriggerErrors.delete(a.id),this.fire(a,{kind:"flow-event",summary:b,context:c,chainDepth:d}).catch(b=>C.error(`Flow-event fire failed for ${a.id}:`,b))},onSkip:b=>{let c=new Date().toISOString();(0,w.Hy)(a.id,{runId:(0,d.A)(),conversationId:"",firedAt:c,finishedAt:c,status:"skipped",triggerSummary:"Flow event",error:b}).catch(b=>C.warn(`Failed to record flow-event skip for ${a.id}:`,b))},onError:b=>this.lastTriggerErrors.set(a.id,b)}));break;default:C.warn(`Trigger type "${b.type}" is not implemented — "${a.name}" not armed`)}}async loadFile(){let a=await (0,e.YM)(f.Z.PLANNED_EXECUTIONS,D);return{version:1,paused:!0===a.paused,executions:Array.isArray(a.executions)?a.executions:[]}}async saveFile(a){await (0,e.VH)(f.Z.PLANNED_EXECUTIONS,a)}async isPaused(){return(await this.loadFile()).paused}async setPaused(a){let b=await this.loadFile();if(await this.saveFile({...b,paused:a}),await this.reconcile(),a)for(let a of[...this.queued.keys()])await this.cancelQueued(a,"scheduler paused",!0)}async list(){return Promise.all((await this.loadFile()).executions.map(async a=>({execution:a,status:this.getStatus(a),lastRun:await (0,w.tl)(a.id)})))}async get(a){return(await this.loadFile()).executions.find(b=>b.id===a)??null}async create(a){let b=this.validateInput(a);if(b)return{error:b};if(void 0!==a.id&&!/^[A-Za-z0-9._:-]{1,128}$/.test(a.id))return{error:"The id must be 1-128 characters of letters, digits, dot, underscore, colon or hyphen"};if("."===a.id||".."===a.id)return{error:'The id must be a safe identifier, not "." or ".."'};let c=new Date().toISOString(),e={...a,trigger:this.normalizeTrigger(a.trigger),id:a.id??(0,d.A)(),createdAt:c,updatedAt:c},f=await this.loadFile();return f.executions.some(a=>a.id===e.id)?{error:`A planned execution with id "${e.id}" already exists`,conflict:!0}:(await this.saveFile({...f,executions:[...f.executions,e]}),await this.reconcile(),{execution:e})}async update(a,b){let c=await this.loadFile(),d=c.executions.findIndex(b=>b.id===a);if(d<0)return{error:`No planned execution with id "${a}"`};let e={...c.executions[d],...b,...b.trigger?{trigger:this.normalizeTrigger(b.trigger)}:{},id:a,createdAt:c.executions[d].createdAt,updatedAt:new Date().toISOString()},f=this.validateInput(e);if(f)return{error:f};let g=[...c.executions];return g[d]=e,await this.saveFile({...c,executions:g}),await this.reconcile(),await this.cancelQueued(a,"execution updated",!0),{execution:e}}async delete(a){let b=await this.loadFile();return b.executions.some(b=>b.id===a)?(await this.saveFile({...b,executions:b.executions.filter(b=>b.id!==a)}),await this.reconcile(),this.lastTriggerErrors.delete(a),await this.cancelQueued(a,"execution deleted",!1),await (0,w.xC)(a),await B(a),{success:!0}):{success:!1,error:`No planned execution with id "${a}"`}}normalizeTrigger(a){return a?.type!=="webhook"||a.token?a?.type!=="mcp-poll"||a.cron?a:{...a,cron:(0,p.X)(a.intervalMs)}:{...a,token:(0,d.A)()}}validateInput(a){if(!a.name?.trim())return"A name is required";if(!a.flowId)return"A flow is required";if("string"!=typeof a.prompt)return"A prompt is required (may be empty)";if(void 0!==a.overlapStrategy&&!["skip","queue","parallel","error"].includes(a.overlapStrategy))return"Overlap strategy must be one of: skip, queue, parallel, error";let b=a.trigger;if(!b||"object"!=typeof b)return"A trigger is required";switch(b.type){case"schedule":{let a=(0,i.O9)(b.cron,b.timezone);return a.valid?null:`Invalid schedule: ${a.error}`}case"webhook":return null;case"file-watch":if(!b.path?.trim())return"A folder or file path to watch is required";if(!Array.isArray(b.events)||0===b.events.length)return"At least one file event is required";return null;case"mcp-poll":if(!b.serverName||!b.toolName)return"A server and tool are required";if(b.cron){let a=(0,i.O9)(b.cron,b.timezone);if(!a.valid)return`Invalid schedule: ${a.error}`}if(b.evaluate?.mode==="new-items"&&!b.evaluate.idField?.trim())return"An id field is required to detect new items";if((b.evaluate?.mode==="llm-gate"||b.evaluate?.mode==="flow-gate")&&!b.evaluate.condition?.trim())return"A condition is required for the AI to check";if(b.evaluate?.mode==="llm-gate"&&!b.evaluate.modelId)return"A model is required to check the condition";if(b.evaluate?.mode==="flow-gate"&&!b.evaluate.flowId)return"A flow is required to check the condition";return null;case"url-watch":{try{let a=new URL(b.url??"");if("http:"!==a.protocol&&"https:"!==a.protocol)return"The URL must start with http:// or https://"}catch{return"A valid URL is required"}let a=(0,i.O9)(b.cron,b.timezone);return a.valid?null:`Invalid schedule: ${a.error}`}case"flow-event":{let a=b.source;if(1!==[a?.executionId,a?.flowId,a?.flowName,a?.topic].filter(a=>"string"==typeof a&&a.trim().length>0).length)return"Choose exactly one source: a flow, a planned execution, or a signal topic";if(!("string"==typeof a?.topic&&a.topic.trim().length>0)){if(!Array.isArray(b.on)||0===b.on.length)return"Select at least one outcome to react to (completed or error)";if(b.on.some(a=>"completed"!==a&&"error"!==a))return'Outcomes must be "completed" or "error"'}if(b.outputMatch?.regex)try{new RegExp(b.outputMatch.regex)}catch(a){return`Invalid output-match regex: ${a instanceof Error?a.message:String(a)}`}if(void 0!==b.maxChainDepth&&(!Number.isInteger(b.maxChainDepth)||b.maxChainDepth<1))return"Max chain depth must be a positive whole number";if(void 0!==b.minIntervalMs&&(!Number.isFinite(b.minIntervalMs)||b.minIntervalMs<0))return"Minimum interval must be zero or more milliseconds";return null}default:return"Unknown trigger type"}}isRunning(a){let b=this.running.get(a);return void 0!==b&&b.size>0}addRunning(a,b,c){let d=this.running.get(a);d||(d=new Map,this.running.set(a,d)),d.set(b,c)}removeRunning(a,b){let c=this.running.get(a);c&&(c.delete(b),0===c.size&&this.running.delete(a))}earliestRunningSince(a){let b,c=this.running.get(a);if(c&&0!==c.size){for(let a of c.values())(void 0===b||a<b)&&(b=a);return b}}skippedRecord(a,b){let c=new Date().toISOString();return{runId:a.runId,conversationId:"",firedAt:c,finishedAt:c,status:"skipped",triggerSummary:a.payload.summary,error:b}}async cancelQueued(a,b,c){let d=this.queued.get(a);if(d&&0!==d.length){for(let e of(this.queued.delete(a),d)){let d=this.skippedRecord(e,b);if(c)try{await (0,w.Hy)(a,d)}catch(b){C.warn(`Failed to record cancelled queued fire for ${a}:`,b)}e.resolve(d)}C.info(`Cancelled ${d.length} queued fire(s) for ${a}: ${b}`)}}drainQueue(a){let b=this.queued.get(a);if(!b||0===b.length||this.isRunning(a))return;let c=b.shift();0===b.length&&this.queued.delete(a),c&&(async()=>{let b=await this.get(a);if(!b||!b.enabled||this.pausedCache){let a=b?b.enabled?"scheduler paused":"execution disabled":"execution deleted";c.resolve(this.skippedRecord(c,a));return}let d=await this.fire(b,c.payload,c.runId);c.resolve(d)})().catch(b=>C.error(`Queued fire failed for ${a}:`,b))}getStatus(a){let b=this.armed.get(a.id),c=void 0!==b||a.enabled&&"webhook"===a.trigger.type&&this.started&&!this.pausedCache,d=this.earliestRunningSince(a.id),e=c?void 0:a.enabled?this.pausedCache?"paused":void 0:"disabled";return{armed:c,notArmedReason:e,nextRun:b?.nextRun?b.nextRun():void 0,lastTriggerError:this.lastTriggerErrors.get(a.id),running:void 0!==d,runningSince:d}}async runNow(a){let b=await this.get(a);return b?{record:await this.fire(b,{kind:"manual",summary:"Manual run"},(0,d.A)(),!0)}:{error:`No planned execution with id "${a}"`}}async fire(a,b,e=(0,d.A)(),f=!1){let g,i=new Date().toISOString();if(await (0,h.isEncryptionLocked)()){let c={runId:e,conversationId:"",firedAt:i,finishedAt:i,status:"skipped",triggerSummary:b.summary,error:"encryption locked"};return await (0,w.Hy)(a.id,c),C.info(`Skipped fire for "${a.name}" — encryption locked`),c}let j=a.overlapStrategy??"skip";if(!f&&this.isRunning(a.id)){if("skip"===j){let c={runId:e,conversationId:"",firedAt:i,finishedAt:i,status:"skipped",triggerSummary:b.summary,error:"Previous run still in progress"};return await (0,w.Hy)(a.id,c),C.info(`Skipped overlapping fire for "${a.name}"`),c}if("error"===j){let c={runId:e,conversationId:"",firedAt:i,finishedAt:i,status:"error",triggerSummary:b.summary,error:"Overlapping run rejected (overlapStrategy=error)"};return await (0,w.Hy)(a.id,c),C.info(`Rejected overlapping fire for "${a.name}" (overlapStrategy=error)`),c}if("queue"===j){let c=this.queued.get(a.id)?.length??0;if(c>=E.MAX_QUEUE_DEPTH){let c={runId:e,conversationId:"",firedAt:i,finishedAt:i,status:"skipped",triggerSummary:b.summary,error:`Overlap queue full (cap ${E.MAX_QUEUE_DEPTH}) — fire dropped`};return await (0,w.Hy)(a.id,c),C.warn(`Overlap queue full for "${a.name}" — dropped fire`),c}return C.info(`Queued overlapping fire for "${a.name}" (depth ${c+1})`),new Promise(c=>{let d=this.queued.get(a.id)??[];d.push({execution:a,payload:b,runId:e,resolve:c}),this.queued.set(a.id,d)})}}this.addRunning(a.id,e,i);let k=(0,d.A)();try{C.info(`Firing "${a.name}" (${b.kind})`);let d=await (0,w.Sw)(a.id),f=d.length>0?d[d.length-1]:null,h={executionName:a.name,trigger:b.kind,now:i,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,lastRun:f?{at:f.firedAt,status:f.status}:null,nextPlannedRun:this.getStatus(a).nextRun??null},j=a.approvalPolicy??"auto",l=a.saveConversations||"pause"===j?"conversation":"ephemeral",{runFlow:m}=await Promise.all([c.e(6996),c.e(1223),c.e(5734),c.e(1373),c.e(4545),c.e(7821),c.e(724),c.e(3823),c.e(4671),c.e(7769)]).then(c.bind(c,47769)),n=await m({flowId:a.flowId,prompt:this.composePrompt(a.prompt,b,h),mode:l,conversationId:k,source:"schedule",plannedExecutionId:a.id,chainDepth:b.chainDepth??0,requireApproval:"auto"!==j,onApprovalRequired:j,debug:!1,userTurn:!0});g=await this.recordFromResult(a,n,{runId:e,conversationId:k,firedAt:i,payload:b})}catch(c){g={runId:e,conversationId:k,firedAt:i,finishedAt:new Date().toISOString(),status:"error",triggerSummary:b.summary,error:c instanceof Error?c.message:String(c)},C.error(`Run crashed for "${a.name}":`,c)}finally{this.removeRunning(a.id,e),this.drainQueue(a.id)}return await this.get(a.id)===null?C.info(`Dropping run record for deleted execution ${a.id}`):(await (0,w.Hy)(a.id,g),("completed"===g.status||"error"===g.status)&&await this.publishFlowRunEvent(a,g,b)),g}async recordFromResult(a,b,c){let{runId:d,conversationId:e,firedAt:f,payload:g}=c,h=new Date().toISOString(),i="awaiting_tool_approval"===b.status,j="error"===b.status&&b.error?.details?.type==="approval_required";if(i||j){let c=(b.pendingToolCalls??[]).map(a=>({id:a.id,name:"function"===a.type?a.function.name:String(a.type)})),k={runId:d,conversationId:e,firedAt:f,finishedAt:h,status:"needs_approval",triggerSummary:g.summary,outputText:this.truncateOutput(b.outputText),usage:b.usage,error:j?b.error?.message??"Tool approval required":"Awaiting tool approval",pendingApproval:{tool:c[0]?.name??b.error?.details?.name,toolCallId:c[0]?.id,pendingToolCalls:c.length>0?c:void 0}};return i&&await this.registerPendingApproval(a,k,c),k}return{runId:d,conversationId:e,firedAt:f,finishedAt:h,status:"completed"===b.status?"completed":"error",triggerSummary:g.summary,outputText:this.truncateOutput(b.outputText),usage:b.usage,error:"completed"===b.status?void 0:b.error?.message??`Run ended with status "${b.status}"`}}async registerPendingApproval(a,b,d){try{let e;try{let{flowService:b}=await c.e(7821).then(c.bind(c,87821));e=(await b.getFlow(a.flowId))?.name??void 0}catch(b){C.debug(`Could not resolve flow name for pending approval (${a.flowId}):`,b)}let{putPendingApproval:f}=await c.e(9285).then(c.bind(c,39285));await f({approvalId:b.conversationId,conversationId:b.conversationId,plannedExecutionId:a.id,flowId:a.flowId,flowName:e,runId:b.runId,triggerSummary:b.triggerSummary,pendingToolCalls:d,createdAt:b.firedAt})}catch(b){C.warn(`Failed to register pending approval for "${a.name}":`,b)}}async publishFlowRunEvent(a,b,d){try{let e;try{let{flowService:b}=await c.e(7821).then(c.bind(c,87821));e=(await b.getFlow(a.flowId))?.name??void 0}catch(b){C.debug(`Could not resolve flow name for run event (${a.flowId}):`,b)}let f="schedule-catchup"===d.kind?"schedule":d.kind;(0,t.eh)().publish({flowId:a.flowId,flowName:e,executionId:a.id,runId:b.runId,conversationId:b.conversationId,status:"completed"===b.status?"completed":"error",outputText:b.outputText,error:b.error,firedBy:f,chainDepth:d.chainDepth??0,timestamp:b.finishedAt??new Date().toISOString()})}catch(b){C.warn(`Failed to publish flow-run event for "${a.name}":`,b)}}composePrompt(a,b,c){let d=JSON.stringify(void 0===b.context?c:{...c,data:b.context},null,2);return`${a}
1
+ "use strict";exports.id=4771,exports.ids=[4771,6793],exports.modules={4771:(a,b,c)=>{c.d(b,{z:()=>F});var d=c(32524),e=c(92372),f=c(46480),g=c(50846),h=c(58739),i=c(52189),j=c(33873),k=c.n(j),l=c(29021),m=c(9794);let n=(0,g.h)("backend/services/scheduler/triggers/fileWatch");var o=c(73736),p=c(10960),q=c(51875);let r=(0,g.h)("backend/services/scheduler/triggers/mcpPoll"),s=(0,g.h)("backend/services/scheduler/triggers/urlWatch");var t=c(56793);let u=(0,g.h)("backend/services/scheduler/triggers/flowEvent");function v(a){return a&&a.length>8192?`${a.slice(0,8192)}… (truncated)`:a}var w=c(59911);let x=(0,g.h)("backend/services/scheduler/state"),y=a=>`planned-execution-state/${a}`;async function z(a){try{return await (0,e.YM)(y(a),{})}catch(b){return x.error(`Failed to load trigger state for ${a}:`,b),{}}}async function A(a,b){await (0,e.VH)(y(a),b)}async function B(a){await (0,e.N2)(y(a))}let C=(0,g.h)("backend/services/scheduler/index"),D={version:1,paused:!1,executions:[]};class E{static{this.MAX_QUEUE_DEPTH=50}async start(){this.started||(this.started=!0,C.info("Starting scheduler"),await this.reconcile())}reconcile(){let a=this.reconcileChain.catch(()=>{}).then(()=>this.doReconcile());return this.reconcileChain=a,a}async doReconcile(){for(let[a,b]of this.armed)try{b.dispose()}catch(b){C.warn(`Failed to dispose trigger for ${a}:`,b)}this.armed.clear();let a=await this.loadFile();if(this.pausedCache=a.paused,a.paused)return void C.info("Scheduler is paused — nothing armed");for(let b of a.executions)if(b.enabled)try{await this.armExecution(b)}catch(c){let a=c instanceof Error?c.message:String(c);this.lastTriggerErrors.set(b.id,a),C.error(`Failed to arm "${b.name}" (${b.id}):`,c)}C.info(`Scheduler armed ${this.armed.size} execution(s)`)}async armExecution(a){let b=a.trigger;switch(b.type){case"schedule":{let c=await z(a.id);c.lastScheduledFireAt?b.catchUp&&(0,i.hk)(b,c.lastScheduledFireAt)&&(await A(a.id,{...c,lastScheduledFireAt:new Date().toISOString()}),C.info(`Catch-up run for "${a.name}" (missed while closed)`),this.fire(a,{kind:"schedule-catchup",summary:"Schedule (missed while FLUJO was closed — ran once at startup)"})):await A(a.id,{...c,lastScheduledFireAt:new Date().toISOString()}),this.armed.set(a.id,(0,i.wv)(b,()=>{(async()=>{let b=await z(a.id);await A(a.id,{...b,lastScheduledFireAt:new Date().toISOString()}),await this.fire(a,{kind:"schedule",summary:"Schedule"})})().catch(b=>C.error(`Scheduled fire failed for ${a.id}:`,b))}));break}case"webhook":break;case"file-watch":this.armed.set(a.id,function(a,b,c){let d,e=a.debounceMs??2e3,f=new Set(a.events),g=a.glob?.trim()?function(a){let b=a.replace(/\\/g,"/"),c="";for(let a=0;a<b.length;a++){let d=b[a];"*"===d?"*"===b[a+1]?"/"===b[++a+1]?(a++,c+="(?:.*/)?"):c+=".*":c+="[^/]*":"?"===d?c+="[^/]":c+=d.replace(/[.+^${}()|[\]\\]/g,"\\$&")}return RegExp(`^${c}$`)}(a.glob.trim()):null;try{d=l.realpathSync.native(a.path)}catch(d){let b=d instanceof Error?d.message:String(d);return n.warn(`Cannot watch "${a.path}": ${b}`),c(`Cannot watch "${a.path}": ${b}`),{dispose:()=>void 0}}let h=[],i=!1,j=null,o=!1,p=()=>{if(j=null,o||0===h.length)return;let a=h;i&&n.info("File-watch batch overflowed; reporting first 50 events"),h=[],i=!1,b({events:a})},q=(0,m.wB)(d,{ignoreInitial:!0,awaitWriteFinish:{stabilityThreshold:500,pollInterval:100}});return q.on("all",(a,b)=>{if(!o&&("add"===a||"change"===a||"unlink"===a)&&f.has(a)){if(g){let a=k().relative(d,b).replace(/\\/g,"/")||k().basename(b);if(!g.test(a))return}h.length>=50?i=!0:h.push({event:a,path:b}),j&&clearTimeout(j),j=setTimeout(p,e),j.unref?.()}}),q.on("error",a=>{let b=a instanceof Error?a.message:String(a);n.warn(`Watcher error for ${d}: ${b}`),c(b)}),{dispose:()=>{o=!0,j&&(clearTimeout(j),j=null),h=[],q.close().catch(a=>n.warn(`Failed to close watcher for ${d}:`,a))}}}(b,({events:c})=>{this.lastTriggerErrors.delete(a.id),this.fire(a,{kind:"file",summary:1===c.length?`File ${"unlink"===c[0].event?"deleted":"add"===c[0].event?"added":"changed"}`:`${c.length} file changes`,context:{watchedPath:b.path,events:c}})},b=>this.lastTriggerErrors.set(a.id,b)));break;case"mcp-poll":Promise.all([c.e(6996),c.e(1223),c.e(5734),c.e(4545)]).then(c.bind(c,61397)).then(async({mcpService:c})=>{await c.isServerDisabled(b.serverName)&&this.lastTriggerErrors.set(a.id,`MCP server '${b.serverName}' is disabled — enable it on the MCP page or change the trigger`)}).catch(b=>C.warn(`Arm-time disabled-server check failed for ${a.id}:`,b)),this.armed.set(a.id,function(a,b){let c=a.cron||(0,p.X)(a.intervalMs),d=!1,e=!1,f=0,g=0,h=async()=>{if(!e&&!d){if(g>0)return void g--;d=!0;try{let c,d=await b.callTool(a.serverName,a.toolName,a.args);if(!d.success)throw Error(d.error||"Tool call failed");f=0;let g=await b.loadState(),h=a.evaluate;if(c="on-change"===h.mode?(0,q.Jl)(d.data,g):"new-items"===h.mode?(0,q.A1)(d.data,h.itemsPath,h.idField,g):b.evaluateAiGate?await b.evaluateAiGate(d.data,h,g):{fire:!1,newState:{},error:'The "AI decides" condition is not available yet'},e)return;if(Object.keys(c.newState).length>0&&await b.saveState(c.newState),c.error)b.onError(c.error);else if(c.fire){let{status:d}=await b.onFire({summary:`Watched tool: ${c.summary??"condition met"}`,context:{server:a.serverName,tool:a.toolName,..."object"==typeof c.context&&null!==c.context?c.context:{result:c.context}}});if(e)return;if(c.pendingState){let{giveUpError:a}=await (0,q.vV)({status:d,pendingState:c.pendingState,priorFailures:g.pendingFailures??0,saveState:b.saveState});a&&b.onError(a)}}else b.onSuccess?.()}catch(d){f++,g=Math.min(2**(f-1),8);let c=d instanceof Error?d.message:String(d);r.warn(`Poll failed for ${a.serverName}/${a.toolName} (backing off ${g} check(s)): ${c}`),b.onError(c)}finally{d=!1}}},i=new o.l4(c,{timezone:a.timezone,unref:!0},()=>void h());return h(),{dispose:()=>{e=!0,i.stop()},nextRun:()=>i.nextRun()?.toISOString()??null}}(b,{callTool:async(a,b,d)=>{let{mcpService:e}=await Promise.all([c.e(6996),c.e(1223),c.e(5734),c.e(4545)]).then(c.bind(c,61397)),f=await e.callTool(a,b,d);return{success:!0===f.success,data:f.data,error:"string"==typeof f.error?f.error:void 0}},loadState:()=>z(a.id),saveState:async b=>{let c=await z(a.id);await A(a.id,{...c,...b})},onFire:async({summary:b,context:c})=>(this.lastTriggerErrors.delete(a.id),{status:(await this.fire(a,{kind:"mcp-poll",summary:b,context:c})).status}),onError:b=>this.lastTriggerErrors.set(a.id,b),onSuccess:()=>this.lastTriggerErrors.delete(a.id),evaluateAiGate:async(a,b,d)=>{let{evaluateAiGate:e}=await c.e(7506).then(c.bind(c,47506));return e(a,b,d)}}));break;case"url-watch":this.armed.set(a.id,function(a,b){let c=b.fetchImpl??fetch,d=!1,e=!1,f=async()=>{if(!e&&!d){d=!0;try{let d=await c(a.url,{redirect:"follow",headers:{"User-Agent":"FLUJO-url-watch"},signal:AbortSignal.timeout(3e4)});if(!d.ok)return void b.onError(`The URL answered with HTTP ${d.status}`);let f=await d.text(),g=(0,q.qq)(f),h=await b.loadState();if(e)return;if(!h.lastHash){await b.saveState({lastHash:g}),b.onSuccess?.();return}if(h.lastHash===g)return void b.onSuccess?.();let{status:i}=await b.onFire({summary:"Online content changed",context:{url:a.url,status:d.status,contentType:d.headers.get("content-type")??void 0,content:f.length>8192?`${f.slice(0,8192)}… (truncated, ${f.length} chars total)`:f}});if(e)return;let{giveUpError:j}=await (0,q.vV)({status:i,pendingState:{lastHash:g},priorFailures:h.pendingFailures??0,saveState:b.saveState});j&&b.onError(j)}catch(d){let c=d instanceof Error&&"TimeoutError"===d.name?"The URL did not answer within 30s":d instanceof Error?d.message:String(d);s.warn(`URL check failed for ${a.url}: ${c}`),b.onError(c)}finally{d=!1}}},g=new o.l4(a.cron,{timezone:a.timezone,unref:!0},()=>void f());return f(),{dispose:()=>{e=!0,g.stop()},nextRun:()=>g.nextRun()?.toISOString()??null}}(b,{loadState:()=>z(a.id),saveState:async b=>{let c=await z(a.id);await A(a.id,{...c,...b})},onFire:async({summary:b,context:c})=>(this.lastTriggerErrors.delete(a.id),{status:(await this.fire(a,{kind:"url-watch",summary:b,context:c})).status}),onError:b=>this.lastTriggerErrors.set(a.id,b),onSuccess:()=>this.lastTriggerErrors.delete(a.id)}));break;case"flow-event":this.armed.set(a.id,function(a,b){let c=a.maxChainDepth??5,d="string"==typeof a.source.topic?a.source.topic.trim():"",e=d.length>0,f=0,g=null,h=!1;if(a.outputMatch?.regex)try{g=new RegExp(a.outputMatch.regex)}catch(c){h=!0;let a=`Invalid output-match regex: ${c instanceof Error?c.message:String(c)}`;u.warn(a),b.onError(a)}let i=b=>{if(!a.outputMatch)return!0;if(h)return!1;let c=(b??"").slice(0,16384);return(!a.outputMatch.contains||!!c.includes(a.outputMatch.contains))&&(!g||!!g.test(c))},j=(d,e,g)=>{if(d>=c){let a=`Flow-event chain reached the depth limit (${c}); not firing again`;u.info(a),b.onSkip(a);return}let h=Date.now();if(a.minIntervalMs&&h-f<a.minIntervalMs)return void u.debug(`Flow-event cooldown active (${a.minIntervalMs}ms); ignoring event`);f=h,b.onFire({summary:e,context:g,chainDepth:d+1})},k=(0,t.eh)().subscribe(c=>{try{if(e){if(!(0,t.ru)(c)||c.topic!==d||!i(c.payload))return;j(c.chainDepth,`Signal "${c.topic}"`,{topic:c.topic,payload:v(c.payload),emitterFlowId:c.emitterFlowId,flowName:c.flowName,runId:c.runId,conversationId:c.conversationId,firedBy:c.firedBy});return}if((0,t.ru)(c)||!(b=>{let c=a.source;return c.executionId?b.executionId===c.executionId:c.flowId?b.flowId===c.flowId:!!c.flowName&&b.flowName===c.flowName})(c)||!c.status||!(a.on??[]).includes(c.status)||!i(c.outputText))return;let b=c.flowName??c.flowId;j(c.chainDepth,`Flow "${b}" ${c.status}`,{flowId:c.flowId,flowName:c.flowName,executionId:c.executionId,runId:c.runId,conversationId:c.conversationId,status:c.status,firedBy:c.firedBy,outputText:v(c.outputText),error:c.error})}catch(c){let a=c instanceof Error?c.message:String(c);u.warn(`Flow-event handling failed: ${a}`),b.onError(a)}});return{dispose:()=>k(),nextRun:()=>null}}(b,{onFire:({summary:b,context:c,chainDepth:d})=>{this.lastTriggerErrors.delete(a.id),this.fire(a,{kind:"flow-event",summary:b,context:c,chainDepth:d}).catch(b=>C.error(`Flow-event fire failed for ${a.id}:`,b))},onSkip:b=>{let c=new Date().toISOString();(0,w.Hy)(a.id,{runId:(0,d.A)(),conversationId:"",firedAt:c,finishedAt:c,status:"skipped",triggerSummary:"Flow event",error:b}).catch(b=>C.warn(`Failed to record flow-event skip for ${a.id}:`,b))},onError:b=>this.lastTriggerErrors.set(a.id,b)}));break;default:C.warn(`Trigger type "${b.type}" is not implemented — "${a.name}" not armed`)}}async loadFile(){let a=await (0,e.YM)(f.Z.PLANNED_EXECUTIONS,D);return{version:1,paused:!0===a.paused,executions:Array.isArray(a.executions)?a.executions:[]}}async saveFile(a){await (0,e.VH)(f.Z.PLANNED_EXECUTIONS,a)}async isPaused(){return(await this.loadFile()).paused}async setPaused(a){let b=await this.loadFile();if(await this.saveFile({...b,paused:a}),await this.reconcile(),a){for(let a of[...this.queued.keys()])await this.cancelQueued(a,"scheduler paused",!0);await this.cancelAllExclusiveWaiting("scheduler paused",!0)}}async list(){return Promise.all((await this.loadFile()).executions.map(async a=>({execution:a,status:this.getStatus(a),lastRun:await (0,w.tl)(a.id)})))}async get(a){return(await this.loadFile()).executions.find(b=>b.id===a)??null}async create(a){let b=this.validateInput(a);if(b)return{error:b};if(void 0!==a.id&&!/^[A-Za-z0-9._:-]{1,128}$/.test(a.id))return{error:"The id must be 1-128 characters of letters, digits, dot, underscore, colon or hyphen"};if("."===a.id||".."===a.id)return{error:'The id must be a safe identifier, not "." or ".."'};let c=new Date().toISOString(),e={...a,trigger:this.normalizeTrigger(a.trigger),id:a.id??(0,d.A)(),createdAt:c,updatedAt:c},f=await this.loadFile();return f.executions.some(a=>a.id===e.id)?{error:`A planned execution with id "${e.id}" already exists`,conflict:!0}:(await this.saveFile({...f,executions:[...f.executions,e]}),await this.reconcile(),{execution:e})}async update(a,b){let c=await this.loadFile(),d=c.executions.findIndex(b=>b.id===a);if(d<0)return{error:`No planned execution with id "${a}"`};let e={...c.executions[d],...b,...b.trigger?{trigger:this.normalizeTrigger(b.trigger)}:{},id:a,createdAt:c.executions[d].createdAt,updatedAt:new Date().toISOString()},f=this.validateInput(e);if(f)return{error:f};let g=[...c.executions];return g[d]=e,await this.saveFile({...c,executions:g}),await this.reconcile(),await this.cancelQueued(a,"execution updated",!0),await this.cancelExclusiveWaiting(a,"execution updated",!0),{execution:e}}async delete(a){let b=await this.loadFile();return b.executions.some(b=>b.id===a)?(await this.saveFile({...b,executions:b.executions.filter(b=>b.id!==a)}),await this.reconcile(),this.lastTriggerErrors.delete(a),await this.cancelQueued(a,"execution deleted",!1),await this.cancelExclusiveWaiting(a,"execution deleted",!1),await (0,w.xC)(a),await B(a),{success:!0}):{success:!1,error:`No planned execution with id "${a}"`}}normalizeTrigger(a){return a?.type!=="webhook"||a.token?a?.type!=="mcp-poll"||a.cron?a:{...a,cron:(0,p.X)(a.intervalMs)}:{...a,token:(0,d.A)()}}validateInput(a){if(!a.name?.trim())return"A name is required";if(!a.flowId)return"A flow is required";if("string"!=typeof a.prompt)return"A prompt is required (may be empty)";if(void 0!==a.overlapStrategy&&!["skip","queue","parallel","error"].includes(a.overlapStrategy))return"Overlap strategy must be one of: skip, queue, parallel, error";if(void 0!==a.exclusive&&"boolean"!=typeof a.exclusive)return"Exclusive must be true or false";if(void 0!==a.nonExclusiveBehavior&&!["queue","skip","error"].includes(a.nonExclusiveBehavior))return"When exclusive is on, other triggers must be one of: queue, skip, error";let b=a.trigger;if(!b||"object"!=typeof b)return"A trigger is required";switch(b.type){case"schedule":{let a=(0,i.O9)(b.cron,b.timezone);return a.valid?null:`Invalid schedule: ${a.error}`}case"webhook":return null;case"file-watch":if(!b.path?.trim())return"A folder or file path to watch is required";if(!Array.isArray(b.events)||0===b.events.length)return"At least one file event is required";return null;case"mcp-poll":if(!b.serverName||!b.toolName)return"A server and tool are required";if(b.cron){let a=(0,i.O9)(b.cron,b.timezone);if(!a.valid)return`Invalid schedule: ${a.error}`}if(b.evaluate?.mode==="new-items"&&!b.evaluate.idField?.trim())return"An id field is required to detect new items";if((b.evaluate?.mode==="llm-gate"||b.evaluate?.mode==="flow-gate")&&!b.evaluate.condition?.trim())return"A condition is required for the AI to check";if(b.evaluate?.mode==="llm-gate"&&!b.evaluate.modelId)return"A model is required to check the condition";if(b.evaluate?.mode==="flow-gate"&&!b.evaluate.flowId)return"A flow is required to check the condition";return null;case"url-watch":{try{let a=new URL(b.url??"");if("http:"!==a.protocol&&"https:"!==a.protocol)return"The URL must start with http:// or https://"}catch{return"A valid URL is required"}let a=(0,i.O9)(b.cron,b.timezone);return a.valid?null:`Invalid schedule: ${a.error}`}case"flow-event":{let a=b.source;if(1!==[a?.executionId,a?.flowId,a?.flowName,a?.topic].filter(a=>"string"==typeof a&&a.trim().length>0).length)return"Choose exactly one source: a flow, a planned execution, or a signal topic";if(!("string"==typeof a?.topic&&a.topic.trim().length>0)){if(!Array.isArray(b.on)||0===b.on.length)return"Select at least one outcome to react to (completed or error)";if(b.on.some(a=>"completed"!==a&&"error"!==a))return'Outcomes must be "completed" or "error"'}if(b.outputMatch?.regex)try{new RegExp(b.outputMatch.regex)}catch(a){return`Invalid output-match regex: ${a instanceof Error?a.message:String(a)}`}if(void 0!==b.maxChainDepth&&(!Number.isInteger(b.maxChainDepth)||b.maxChainDepth<1))return"Max chain depth must be a positive whole number";if(void 0!==b.minIntervalMs&&(!Number.isFinite(b.minIntervalMs)||b.minIntervalMs<0))return"Minimum interval must be zero or more milliseconds";return null}default:return"Unknown trigger type"}}isRunning(a){let b=this.running.get(a);return void 0!==b&&b.size>0}addRunning(a,b,c){let d=this.running.get(a);d||(d=new Map,this.running.set(a,d)),d.set(b,c)}removeRunning(a,b){let c=this.running.get(a);c&&(c.delete(b),0===c.size&&this.running.delete(a))}earliestRunningSince(a){let b,c=this.running.get(a);if(c&&0!==c.size){for(let a of c.values())(void 0===b||a<b)&&(b=a);return b}}skippedRecord(a,b){let c=new Date().toISOString();return{runId:a.runId,conversationId:"",firedAt:c,finishedAt:c,status:"skipped",triggerSummary:a.payload.summary,error:b}}async cancelQueued(a,b,c){let d=this.queued.get(a);if(d&&0!==d.length){for(let e of(this.queued.delete(a),d)){let d=this.skippedRecord(e,b);if(c)try{await (0,w.Hy)(a,d)}catch(b){C.warn(`Failed to record cancelled queued fire for ${a}:`,b)}e.resolve(d)}C.info(`Cancelled ${d.length} queued fire(s) for ${a}: ${b}`)}}drainQueue(a){let b=this.queued.get(a);if(!b||0===b.length||this.isRunning(a))return;let c=b.shift();0===b.length&&this.queued.delete(a),c&&(async()=>{let b=await this.get(a);if(!b||!b.enabled||this.pausedCache){let a=b?b.enabled?"scheduler paused":"execution disabled":"execution deleted";c.resolve(this.skippedRecord(c,a));return}let d=await this.fire(b,c.payload,c.runId);c.resolve(d)})().catch(b=>C.error(`Queued fire failed for ${a}:`,b))}isSchedulerIdle(){for(let a of this.running.values())if(a.size>0)return!1;return!0}isExclusiveActive(){return null!==this.exclusiveHolder||this.exclusiveWaiting.length>0}currentExclusiveBehavior(){return null!==this.exclusiveHolder?this.exclusiveHolderBehavior:this.exclusiveWaiting[0]?.execution.nonExclusiveBehavior??"queue"}exclusiveGateFor(a){return!0!==a.exclusive&&this.isExclusiveActive()?this.currentExclusiveBehavior():null}drainExclusive(){if(null===this.exclusiveHolder&&this.exclusiveWaiting.length>0&&this.isSchedulerIdle())return void this.acquireNextExclusive();this.isExclusiveActive()||this.drainBlockedByExclusive()}acquireNextExclusive(){if(null!==this.exclusiveHolder||!this.isSchedulerIdle())return;let a=this.exclusiveWaiting.shift();if(!a)return;let b=a.execution.id;this.exclusiveHolder=b,this.exclusiveHolderBehavior=a.execution.nonExclusiveBehavior??"queue",(async()=>{let c=await this.get(b);if(!c||!c.enabled||this.pausedCache||!0!==c.exclusive){let d=c?c.enabled?this.pausedCache?"scheduler paused":"no longer exclusive":"execution disabled":"execution deleted";this.exclusiveHolder===b&&(this.exclusiveHolder=null),a.resolve(this.skippedRecord(a,d)),this.drainExclusive();return}this.exclusiveHolderBehavior=c.nonExclusiveBehavior??"queue";let d=await this.fire(c,a.payload,a.runId);a.resolve(d)})().catch(c=>{this.exclusiveHolder===b&&(this.exclusiveHolder=null),C.error(`Exclusive acquire failed for ${b}:`,c),a.resolve(this.skippedRecord(a,"exclusive acquire failed")),this.drainExclusive()})}drainBlockedByExclusive(){if(0===this.blockedByExclusive.length)return;let a=this.blockedByExclusive;for(let b of(this.blockedByExclusive=[],a))(async()=>{let a=await this.get(b.execution.id);if(!a||!a.enabled||this.pausedCache){let c=a?a.enabled?"scheduler paused":"execution disabled":"execution deleted";b.resolve(this.skippedRecord(b,c));return}let c=await this.fire(a,b.payload,b.runId);b.resolve(c)})().catch(a=>C.error(`Deferred non-exclusive fire failed for ${b.execution.id}:`,a))}async cancelExclusiveWaiting(a,b,c){let d=[];if(this.exclusiveWaiting=this.exclusiveWaiting.filter(b=>b.execution.id!==a||(d.push(b),!1)),this.blockedByExclusive=this.blockedByExclusive.filter(b=>b.execution.id!==a||(d.push(b),!1)),0!==d.length){for(let e of d){let d=this.skippedRecord(e,b);if(c)try{await (0,w.Hy)(a,d)}catch(b){C.warn(`Failed to record cancelled exclusive fire for ${a}:`,b)}e.resolve(d)}C.info(`Cancelled ${d.length} exclusive-related fire(s) for ${a}: ${b}`)}}async cancelAllExclusiveWaiting(a,b){let c=[...this.exclusiveWaiting,...this.blockedByExclusive];if(this.exclusiveWaiting=[],this.blockedByExclusive=[],0!==c.length){for(let d of c){let c=this.skippedRecord(d,a);if(b)try{await (0,w.Hy)(d.execution.id,c)}catch(a){C.warn(`Failed to record cancelled exclusive fire for ${d.execution.id}:`,a)}d.resolve(c)}C.info(`Cancelled ${c.length} exclusive-related fire(s): ${a}`)}}getStatus(a){let b=this.armed.get(a.id),c=void 0!==b||a.enabled&&"webhook"===a.trigger.type&&this.started&&!this.pausedCache,d=this.earliestRunningSince(a.id),e=c?void 0:a.enabled?this.pausedCache?"paused":void 0:"disabled",f=this.exclusiveHolder??void 0,g=!0!==a.exclusive&&this.isExclusiveActive();return{armed:c,notArmedReason:e,nextRun:b?.nextRun?b.nextRun():void 0,lastTriggerError:this.lastTriggerErrors.get(a.id),running:void 0!==d,runningSince:d,exclusiveHolderId:f,blockedByExclusive:g}}async runNow(a){let b=await this.get(a);return b?{record:await this.fire(b,{kind:"manual",summary:"Manual run"},(0,d.A)(),!0)}:{error:`No planned execution with id "${a}"`}}async fire(a,b,e=(0,d.A)(),f=!1){let g,i=new Date().toISOString();if(await (0,h.isEncryptionLocked)()){let c={runId:e,conversationId:"",firedAt:i,finishedAt:i,status:"skipped",triggerSummary:b.summary,error:"encryption locked"};return await (0,w.Hy)(a.id,c),C.info(`Skipped fire for "${a.name}" — encryption locked`),c}let j="flow-event"===b.kind;if(!f&&!j){if(!0===a.exclusive){if(this.exclusiveHolder!==a.id){if(null!==this.exclusiveHolder||!this.isSchedulerIdle()){let c=this.exclusiveWaiting.length;if(c>=E.MAX_QUEUE_DEPTH){let c={runId:e,conversationId:"",firedAt:i,finishedAt:i,status:"skipped",triggerSummary:b.summary,error:`Exclusive wait queue full (cap ${E.MAX_QUEUE_DEPTH}) — fire dropped`};return await (0,w.Hy)(a.id,c),C.warn(`Exclusive wait queue full for "${a.name}" — dropped fire`),c}return C.info(`Exclusive "${a.name}" waiting for scheduler to idle (depth ${c+1})`),new Promise(c=>{this.exclusiveWaiting.push({execution:a,payload:b,runId:e,resolve:c})})}this.exclusiveHolder=a.id,this.exclusiveHolderBehavior=a.nonExclusiveBehavior??"queue",C.info(`Exclusive "${a.name}" acquired the scheduler lock`)}}else if(this.isExclusiveActive()){let c=this.currentExclusiveBehavior();if("skip"===c){let c={runId:e,conversationId:"",firedAt:i,finishedAt:i,status:"skipped",triggerSummary:b.summary,error:"Skipped — an exclusive execution holds the scheduler lock"};return await (0,w.Hy)(a.id,c),C.info(`Skipped non-exclusive fire for "${a.name}" — exclusive lock held`),c}if("error"===c){let c={runId:e,conversationId:"",firedAt:i,finishedAt:i,status:"error",triggerSummary:b.summary,error:"Rejected — an exclusive execution holds the scheduler lock"};return await (0,w.Hy)(a.id,c),C.info(`Rejected non-exclusive fire for "${a.name}" — exclusive lock held`),c}let d=this.blockedByExclusive.length;if(d>=E.MAX_QUEUE_DEPTH){let c={runId:e,conversationId:"",firedAt:i,finishedAt:i,status:"skipped",triggerSummary:b.summary,error:`Exclusive-block queue full (cap ${E.MAX_QUEUE_DEPTH}) — fire dropped`};return await (0,w.Hy)(a.id,c),C.warn(`Exclusive-block queue full for "${a.name}" — dropped fire`),c}return C.info(`Deferred non-exclusive fire for "${a.name}" — exclusive lock held (depth ${d+1})`),new Promise(c=>{this.blockedByExclusive.push({execution:a,payload:b,runId:e,resolve:c})})}}let k=a.overlapStrategy??"skip";if(!f&&this.isRunning(a.id)){if("skip"===k){let c={runId:e,conversationId:"",firedAt:i,finishedAt:i,status:"skipped",triggerSummary:b.summary,error:"Previous run still in progress"};return await (0,w.Hy)(a.id,c),C.info(`Skipped overlapping fire for "${a.name}"`),c}if("error"===k){let c={runId:e,conversationId:"",firedAt:i,finishedAt:i,status:"error",triggerSummary:b.summary,error:"Overlapping run rejected (overlapStrategy=error)"};return await (0,w.Hy)(a.id,c),C.info(`Rejected overlapping fire for "${a.name}" (overlapStrategy=error)`),c}if("queue"===k){let c=this.queued.get(a.id)?.length??0;if(c>=E.MAX_QUEUE_DEPTH){let c={runId:e,conversationId:"",firedAt:i,finishedAt:i,status:"skipped",triggerSummary:b.summary,error:`Overlap queue full (cap ${E.MAX_QUEUE_DEPTH}) — fire dropped`};return await (0,w.Hy)(a.id,c),C.warn(`Overlap queue full for "${a.name}" — dropped fire`),c}return C.info(`Queued overlapping fire for "${a.name}" (depth ${c+1})`),new Promise(c=>{let d=this.queued.get(a.id)??[];d.push({execution:a,payload:b,runId:e,resolve:c}),this.queued.set(a.id,d)})}}this.addRunning(a.id,e,i);let l=(0,d.A)();try{C.info(`Firing "${a.name}" (${b.kind})`);let d=await (0,w.Sw)(a.id),f=d.length>0?d[d.length-1]:null,h={executionName:a.name,trigger:b.kind,now:i,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,lastRun:f?{at:f.firedAt,status:f.status}:null,nextPlannedRun:this.getStatus(a).nextRun??null},j=a.approvalPolicy??"auto",k=a.saveConversations||"pause"===j?"conversation":"ephemeral",{runFlow:m}=await Promise.all([c.e(6996),c.e(1223),c.e(5734),c.e(1373),c.e(4545),c.e(7821),c.e(724),c.e(3823),c.e(4671),c.e(7214)]).then(c.bind(c,57214)),n=await m({flowId:a.flowId,prompt:this.composePrompt(a.prompt,b,h),mode:k,conversationId:l,source:"schedule",plannedExecutionId:a.id,chainDepth:b.chainDepth??0,requireApproval:"auto"!==j,onApprovalRequired:j,debug:!1,userTurn:!0});g=await this.recordFromResult(a,n,{runId:e,conversationId:l,firedAt:i,payload:b})}catch(c){g={runId:e,conversationId:l,firedAt:i,finishedAt:new Date().toISOString(),status:"error",triggerSummary:b.summary,error:c instanceof Error?c.message:String(c)},C.error(`Run crashed for "${a.name}":`,c)}finally{this.removeRunning(a.id,e),this.exclusiveHolder!==a.id||this.isRunning(a.id)||(this.exclusiveHolder=null,C.info(`Exclusive "${a.name}" released the scheduler lock`)),this.drainExclusive(),this.drainQueue(a.id)}return await this.get(a.id)===null?C.info(`Dropping run record for deleted execution ${a.id}`):(await (0,w.Hy)(a.id,g),("completed"===g.status||"error"===g.status)&&await this.publishFlowRunEvent(a,g,b)),g}async recordFromResult(a,b,c){let{runId:d,conversationId:e,firedAt:f,payload:g}=c,h=new Date().toISOString(),i="awaiting_tool_approval"===b.status,j="error"===b.status&&b.error?.details?.type==="approval_required";if(i||j){let c=(b.pendingToolCalls??[]).map(a=>({id:a.id,name:"function"===a.type?a.function.name:String(a.type)})),k={runId:d,conversationId:e,firedAt:f,finishedAt:h,status:"needs_approval",triggerSummary:g.summary,outputText:this.truncateOutput(b.outputText),usage:b.usage,error:j?b.error?.message??"Tool approval required":"Awaiting tool approval",pendingApproval:{tool:c[0]?.name??b.error?.details?.name,toolCallId:c[0]?.id,pendingToolCalls:c.length>0?c:void 0}};return i&&await this.registerPendingApproval(a,k,c),k}return{runId:d,conversationId:e,firedAt:f,finishedAt:h,status:"completed"===b.status?"completed":"error",triggerSummary:g.summary,outputText:this.truncateOutput(b.outputText),usage:b.usage,error:"completed"===b.status?void 0:b.error?.message??`Run ended with status "${b.status}"`}}async registerPendingApproval(a,b,d){try{let e;try{let{flowService:b}=await c.e(7821).then(c.bind(c,87821));e=(await b.getFlow(a.flowId))?.name??void 0}catch(b){C.debug(`Could not resolve flow name for pending approval (${a.flowId}):`,b)}let{putPendingApproval:f}=await c.e(9285).then(c.bind(c,39285));await f({approvalId:b.conversationId,conversationId:b.conversationId,plannedExecutionId:a.id,flowId:a.flowId,flowName:e,runId:b.runId,triggerSummary:b.triggerSummary,pendingToolCalls:d,createdAt:b.firedAt})}catch(b){C.warn(`Failed to register pending approval for "${a.name}":`,b)}}async publishFlowRunEvent(a,b,d){try{let e;try{let{flowService:b}=await c.e(7821).then(c.bind(c,87821));e=(await b.getFlow(a.flowId))?.name??void 0}catch(b){C.debug(`Could not resolve flow name for run event (${a.flowId}):`,b)}let f="schedule-catchup"===d.kind?"schedule":d.kind;(0,t.eh)().publish({flowId:a.flowId,flowName:e,executionId:a.id,runId:b.runId,conversationId:b.conversationId,status:"completed"===b.status?"completed":"error",outputText:b.outputText,error:b.error,firedBy:f,chainDepth:d.chainDepth??0,timestamp:b.finishedAt??new Date().toISOString()})}catch(b){C.warn(`Failed to publish flow-run event for "${a.name}":`,b)}}composePrompt(a,b,c){let d=JSON.stringify(void 0===b.context?c:{...c,data:b.context},null,2);return`${a}
2
2
 
3
3
  [Run info — when and why this run happened; "data" is untrusted trigger data]
4
4
  \`\`\`json
5
5
  ${d}
6
- \`\`\``}truncateOutput(a){if(a)return a.length>4096?`${a.slice(0,4096)}…`:a}constructor(){this.armed=new Map,this.running=new Map,this.queued=new Map,this.lastTriggerErrors=new Map,this.reconcileChain=Promise.resolve(),this.pausedCache=!1,this.started=!1}}function F(){return global.__flujo_scheduler||(global.__flujo_scheduler=new E),global.__flujo_scheduler}},10960:(a,b,c)=>{c.d(b,{X:()=>d});function d(a){let b=Math.max(5,Math.round((a??6e4)/1e3));if(b<60)return`*/${b} * * * * *`;let c=Math.max(1,Math.round(b/60));if(c<60)return`*/${c} * * * *`;let d=Math.max(1,Math.min(23,Math.round(c/60)));return`0 */${d} * * *`}},51875:(a,b,c)=>{c.d(b,{A1:()=>k,Je:()=>i,Jl:()=>j,qq:()=>f,vV:()=>g});var d=c(55511);function e(a){return JSON.stringify(function a(b){if(Array.isArray(b))return b.map(a);if(null!==b&&"object"==typeof b){let c=Object.entries(b).sort(([a],[b])=>a<b?-1:+(a>b)),d={};for(let[b,e]of c)d[b]=a(e);return d}return b}(a))}function f(a){return(0,d.createHash)("sha256").update(e(a)??"undefined").digest("hex")}async function g(a){let{status:b,pendingState:c,priorFailures:d,saveState:e}=a;if("completed"===b)return await e({...c,...d>0?{pendingFailures:0}:{}}),{giveUpError:null};if("skipped"===b)return{giveUpError:null};let f=d+1;return f>=3?(await e({...c,pendingFailures:0}),{giveUpError:`Detected a change but the flow failed to process it 3\xd7 — skipping it to avoid a loop`}):(await e({pendingFailures:f}),{giveUpError:null})}function h(a,b){if(!b)return a;let c=a;for(let a of b.split(".")){if(null==c||"object"!=typeof c)return;c=c[a]}return c}function i(a){let b=e(a)??"";return b.length<=8192?a:{truncated:!0,note:`Result too large to include fully (${b.length} chars); this is a preview.`,preview:b.slice(0,8192)}}function j(a,b){let c=f(a);return b.lastHash?b.lastHash===c?{fire:!1,newState:{}}:{fire:!0,summary:"Tool result changed",context:{result:i(a)},newState:{},pendingState:{lastHash:c}}:{fire:!1,newState:{lastHash:c}}}function k(a,b,c,d){let e=h(a,b);if(!Array.isArray(e))return{fire:!1,newState:{},error:`"${b||"(root)"}" did not resolve to a list in the tool result`};let g=e.map(a=>{let b=h(a,c);return{id:null==b||"object"==typeof b?`hash:${f(a)}`:String(b),item:a}}),j=d.seenIds,k=g.map(({id:a})=>a),l=(a,b)=>{let c=[...a??[]],d=new Set(c);for(let a of b)d.has(a)||(d.add(a),c.push(a));return c.slice(-1e3)};if(!j)return{fire:!1,newState:{seenIds:l(void 0,k)}};let m=new Set(j),n=g.filter(({id:a})=>!m.has(a));if(0===n.length)return{fire:!1,newState:{}};let o=n.slice(0,50);return{fire:!0,summary:1===n.length?"1 new item":`${n.length} new items`,context:{newItems:i(o.map(({item:a})=>a)),...n.length>50?{omitted:n.length-50}:{}},newState:{},pendingState:{seenIds:l(j,o.map(({id:a})=>a))}}}},52189:(a,b,c)=>{c.d(b,{O9:()=>e,Z9:()=>f,hk:()=>g,wv:()=>h});var d=c(73736);function e(a,b){try{let c=new d.l4(a,{timezone:b,paused:!0});return c.nextRun(),c.stop(),{valid:!0}}catch(a){return{valid:!1,error:a instanceof Error?a.message:"Invalid cron pattern"}}}function f(a,b,c){let e=new d.l4(a,{timezone:b,paused:!0});try{return e.nextRuns(c).map(a=>a.toISOString())}finally{e.stop()}}function g(a,b){let c=new d.l4(a.cron,{timezone:a.timezone,paused:!0});try{let a=c.nextRun(new Date(b));return null!==a&&a.getTime()<=Date.now()}finally{c.stop()}}function h(a,b){let c=new d.l4(a.cron,{timezone:a.timezone,unref:!0},b);return{dispose:()=>c.stop(),nextRun:()=>c.nextRun()?.toISOString()??null}}},56793:(a,b,c)=>{c.d(b,{eh:()=>g,ru:()=>e});let d=(0,c(50846).h)("backend/services/scheduler/flowRunEventBus");function e(a){return"signal"===a.kind}class f{publish(a){if(0===this.listeners.size)return;let b=e(a)?`signal topic=${a.topic} emitter=${a.emitterFlowId}`:`flow=${a.flowId} status=${a.status}`;for(let c of(d.debug(`Publishing flow event: ${b} firedBy=${a.firedBy} depth=${a.chainDepth} listeners=${this.listeners.size}`),[...this.listeners]))try{c(a)}catch(a){d.warn("A flow-run event listener threw:",a)}}subscribe(a){return this.listeners.add(a),()=>{this.listeners.delete(a)}}get listenerCount(){return this.listeners.size}constructor(){this.listeners=new Set}}function g(){return global.__flujo_flow_run_event_bus||(global.__flujo_flow_run_event_bus=new f),global.__flujo_flow_run_event_bus}},59911:(a,b,c)=>{c.d(b,{Hy:()=>i,Sw:()=>h,s1:()=>j,tl:()=>k,xC:()=>l});var d=c(92372);let e=(0,c(50846).h)("backend/services/scheduler/runHistory"),f=a=>`planned-execution-runs/${a}`,g=new Map;async function h(a){try{return await (0,d.YM)(f(a),[])}catch(b){return e.error(`Failed to load run history for ${a}:`,b),[]}}async function i(a,b){let c=(g.get(a)??Promise.resolve()).catch(()=>{}).then(async()=>{let c=await h(a);c.push(b);let e=c.slice(-100);await (0,d.VH)(f(a),e)});g.set(a,c);try{await c}finally{g.get(a)===c&&g.delete(a)}}async function j(a,b,c){let e=g.get(a)??Promise.resolve(),i=null,j=e.catch(()=>{}).then(async()=>{let e=await h(a),g=e.findIndex(a=>a.runId===b);if(g<0){i=null;return}e[g]={...e[g],...c,runId:b},i=e[g],await (0,d.VH)(f(a),e)});g.set(a,j);try{await j}finally{g.get(a)===j&&g.delete(a)}return i}async function k(a){let b=await h(a);return b.length>0?b[b.length-1]:null}async function l(a){await (0,d.N2)(f(a))}}};
6
+ \`\`\``}truncateOutput(a){if(a)return a.length>4096?`${a.slice(0,4096)}…`:a}constructor(){this.armed=new Map,this.running=new Map,this.queued=new Map,this.exclusiveHolder=null,this.exclusiveHolderBehavior="queue",this.exclusiveWaiting=[],this.blockedByExclusive=[],this.lastTriggerErrors=new Map,this.reconcileChain=Promise.resolve(),this.pausedCache=!1,this.started=!1}}function F(){return global.__flujo_scheduler||(global.__flujo_scheduler=new E),global.__flujo_scheduler}},10960:(a,b,c)=>{c.d(b,{X:()=>d});function d(a){let b=Math.max(5,Math.round((a??6e4)/1e3));if(b<60)return`*/${b} * * * * *`;let c=Math.max(1,Math.round(b/60));if(c<60)return`*/${c} * * * *`;let d=Math.max(1,Math.min(23,Math.round(c/60)));return`0 */${d} * * *`}},51875:(a,b,c)=>{c.d(b,{A1:()=>k,Je:()=>i,Jl:()=>j,qq:()=>f,vV:()=>g});var d=c(55511);function e(a){return JSON.stringify(function a(b){if(Array.isArray(b))return b.map(a);if(null!==b&&"object"==typeof b){let c=Object.entries(b).sort(([a],[b])=>a<b?-1:+(a>b)),d={};for(let[b,e]of c)d[b]=a(e);return d}return b}(a))}function f(a){return(0,d.createHash)("sha256").update(e(a)??"undefined").digest("hex")}async function g(a){let{status:b,pendingState:c,priorFailures:d,saveState:e}=a;if("completed"===b)return await e({...c,...d>0?{pendingFailures:0}:{}}),{giveUpError:null};if("skipped"===b)return{giveUpError:null};let f=d+1;return f>=3?(await e({...c,pendingFailures:0}),{giveUpError:`Detected a change but the flow failed to process it 3\xd7 — skipping it to avoid a loop`}):(await e({pendingFailures:f}),{giveUpError:null})}function h(a,b){if(!b)return a;let c=a;for(let a of b.split(".")){if(null==c||"object"!=typeof c)return;c=c[a]}return c}function i(a){let b=e(a)??"";return b.length<=8192?a:{truncated:!0,note:`Result too large to include fully (${b.length} chars); this is a preview.`,preview:b.slice(0,8192)}}function j(a,b){let c=f(a);return b.lastHash?b.lastHash===c?{fire:!1,newState:{}}:{fire:!0,summary:"Tool result changed",context:{result:i(a)},newState:{},pendingState:{lastHash:c}}:{fire:!1,newState:{lastHash:c}}}function k(a,b,c,d){let e=h(a,b);if(!Array.isArray(e))return{fire:!1,newState:{},error:`"${b||"(root)"}" did not resolve to a list in the tool result`};let g=e.map(a=>{let b=h(a,c);return{id:null==b||"object"==typeof b?`hash:${f(a)}`:String(b),item:a}}),j=d.seenIds,k=g.map(({id:a})=>a),l=(a,b)=>{let c=[...a??[]],d=new Set(c);for(let a of b)d.has(a)||(d.add(a),c.push(a));return c.slice(-1e3)};if(!j)return{fire:!1,newState:{seenIds:l(void 0,k)}};let m=new Set(j),n=g.filter(({id:a})=>!m.has(a));if(0===n.length)return{fire:!1,newState:{}};let o=n.slice(0,50);return{fire:!0,summary:1===n.length?"1 new item":`${n.length} new items`,context:{newItems:i(o.map(({item:a})=>a)),...n.length>50?{omitted:n.length-50}:{}},newState:{},pendingState:{seenIds:l(j,o.map(({id:a})=>a))}}}},52189:(a,b,c)=>{c.d(b,{O9:()=>e,Z9:()=>f,hk:()=>g,wv:()=>h});var d=c(73736);function e(a,b){try{let c=new d.l4(a,{timezone:b,paused:!0});return c.nextRun(),c.stop(),{valid:!0}}catch(a){return{valid:!1,error:a instanceof Error?a.message:"Invalid cron pattern"}}}function f(a,b,c){let e=new d.l4(a,{timezone:b,paused:!0});try{return e.nextRuns(c).map(a=>a.toISOString())}finally{e.stop()}}function g(a,b){let c=new d.l4(a.cron,{timezone:a.timezone,paused:!0});try{let a=c.nextRun(new Date(b));return null!==a&&a.getTime()<=Date.now()}finally{c.stop()}}function h(a,b){let c=new d.l4(a.cron,{timezone:a.timezone,unref:!0},b);return{dispose:()=>c.stop(),nextRun:()=>c.nextRun()?.toISOString()??null}}},56793:(a,b,c)=>{c.d(b,{eh:()=>g,ru:()=>e});let d=(0,c(50846).h)("backend/services/scheduler/flowRunEventBus");function e(a){return"signal"===a.kind}class f{publish(a){if(0===this.listeners.size)return;let b=e(a)?`signal topic=${a.topic} emitter=${a.emitterFlowId}`:`flow=${a.flowId} status=${a.status}`;for(let c of(d.debug(`Publishing flow event: ${b} firedBy=${a.firedBy} depth=${a.chainDepth} listeners=${this.listeners.size}`),[...this.listeners]))try{c(a)}catch(a){d.warn("A flow-run event listener threw:",a)}}subscribe(a){return this.listeners.add(a),()=>{this.listeners.delete(a)}}get listenerCount(){return this.listeners.size}constructor(){this.listeners=new Set}}function g(){return global.__flujo_flow_run_event_bus||(global.__flujo_flow_run_event_bus=new f),global.__flujo_flow_run_event_bus}},59911:(a,b,c)=>{c.d(b,{Hy:()=>i,Sw:()=>h,s1:()=>j,tl:()=>k,xC:()=>l});var d=c(92372);let e=(0,c(50846).h)("backend/services/scheduler/runHistory"),f=a=>`planned-execution-runs/${a}`,g=new Map;async function h(a){try{return await (0,d.YM)(f(a),[])}catch(b){return e.error(`Failed to load run history for ${a}:`,b),[]}}async function i(a,b){let c=(g.get(a)??Promise.resolve()).catch(()=>{}).then(async()=>{let c=await h(a);c.push(b);let e=c.slice(-100);await (0,d.VH)(f(a),e)});g.set(a,c);try{await c}finally{g.get(a)===c&&g.delete(a)}}async function j(a,b,c){let e=g.get(a)??Promise.resolve(),i=null,j=e.catch(()=>{}).then(async()=>{let e=await h(a),g=e.findIndex(a=>a.runId===b);if(g<0){i=null;return}e[g]={...e[g],...c,runId:b},i=e[g],await (0,d.VH)(f(a),e)});g.set(a,j);try{await j}finally{g.get(a)===j&&g.delete(a)}return i}async function k(a){let b=await h(a);return b.length>0?b[b.length-1]:null}async function l(a){await (0,d.N2)(f(a))}}};
@@ -0,0 +1,2 @@
1
+ "use strict";exports.id=4793,exports.ids=[4793],exports.modules={13516:(a,b,c)=>{c.d(b,{G:()=>d});let d={LOG_LEVEL:3,INCLUDE_TOOL_CALLS_IN_RESPONSE:!0,ENABLE_EXECUTION_TRACKER:!1}},32631:(a,b,c)=>{c.d(b,{D:()=>h}),c(21124);var d=c(38301),e=c(19815);c(48748),c(9718);let f=(0,e.h)("frontend/contexts/ThemeContext"),g=(0,d.createContext)(void 0),h=()=>{let a=(0,d.useContext)(g);if(!a)throw f.error("useTheme hook used outside of ThemeProvider"),Error("useTheme must be used within a ThemeProvider");return f.debug("useTheme hook accessed"),a}},48748:(a,b,c)=>{c.d(b,{Ic:()=>h});var d=c(32631),e=c(19815);let f={light:{background:"#FFFFFF",foreground:"#2C3E50",surface:"#F5F6FA",surfaceRaised:"#FFFFFF",paperBackground:"#F5F6FA",textSecondary:"#7F8C8D",textDisabled:"#9CA3AF",border:"#e5e7eb",heading:"#111",text:"#333",secondaryText:"#666",error:{background:"#fef2f2",border:"#fecaca",text:"#dc2626"},domain:{resource:"#009688",resourceSoft:"#4DB6AC",signal:"#7E57C2",startNode:"#795548",codeBackground:"#f5f5f5",http:{get:"#2e7d32",post:"#1565c0",put:"#e65100",patch:"#6a1b9a",delete:"#c62828"},transport:{stdio:{fg:"#1976d2",bg:"#e3f2fd"},websocket:{fg:"#2e7d32",bg:"#e8f5e8"},sse:{fg:"#f57c00",bg:"#fff3e0"},streamable:{fg:"#00796b",bg:"#e0f2f1"},default:{fg:"#757575",bg:"#f5f5f5"}}}},dark:{background:"#0f1319",foreground:"#eef1f5",surface:"#1a212b",surfaceRaised:"#242d3a",paperBackground:"#1a212b",textSecondary:"#b4bdca",textDisabled:"#6b7280",border:"#37404e",heading:"#f5f7fa",text:"#eef1f5",secondaryText:"#b4bdca",error:{background:"#2a1618",border:"#5a2a2e",text:"#ff6b6b"},domain:{resource:"#26a69a",resourceSoft:"#4DB6AC",signal:"#9575CD",startNode:"#a1887f",codeBackground:"#242d3a",http:{get:"#66bb6a",post:"#5b9dff",put:"#ffa726",patch:"#ba68c8",delete:"#ef5350"},transport:{stdio:{fg:"#90caf9",bg:"#1e2a3a"},websocket:{fg:"#a5d6a7",bg:"#1e2e22"},sse:{fg:"#ffcc80",bg:"#33281a"},streamable:{fg:"#80cbc4",bg:"#17322e"},default:{fg:"#b4bdca",bg:"#242d3a"}}}}},g=(0,e.h)("frontend/utils/theme");function h(){let{isDarkMode:a}=(0,d.D)();return g.debug(`useThemeUtils called with isDarkMode: ${a}`),{getThemeValue:(b,c)=>a?c:b,getThemeColor:b=>{let c=b.split("."),d=f[a?"dark":"light"];for(let a of c)if(!d||"object"!=typeof d||!(a in d))return g.warn(`Theme color path not found: ${b}`),"";else d=d[a];return d},colors:a?f.dark:f.light,isDarkMode:a}}},50846:(a,b,c)=>{c.d(b,{h:()=>i});var d=c(13516);let e={VERBOSE:-1,DEBUG:0,INFO:1,WARN:2,ERROR:3},f="number"==typeof d.G.LOG_LEVEL?d.G.LOG_LEVEL:e.ERROR;function g(a,b=0){if(b>6)return String(a);if(!(a instanceof Error))return a;let c={name:a.name,message:a.message};for(let d of Object.getOwnPropertyNames(a)){if("name"===d||"message"===d)continue;let e=a[d];"function"!=typeof e&&("stack"===d?c.stack=e:"cause"===d?c.cause=g(e,b+1):"errors"===d&&Array.isArray(e)?c.errors=e.map(a=>g(a,b+1)):c[d]=e)}return c}function h(a,b,c,d,h){if(a>=("number"==typeof h?h:f)){if("function"==typeof d)try{d=d()}catch{d="[lazy log data threw]"}let f=new Date().toISOString(),h=`[${f}] [${b}]`,i=`${h} ${c}`;if(void 0!==d)if(d instanceof Error||"object"==typeof d)try{let a=d instanceof Error?g(d):d,b=JSON.stringify(a,(a,b)=>b instanceof Error?g(b):b,2);i+=`:
2
+ ${b}`}catch(a){i+=": [Object cannot be stringified]"}else i+=`: ${d}`;switch(a){case e.VERBOSE:console.debug(`[VERBOSE] ${i}`);break;case e.DEBUG:console.debug(i);break;case e.INFO:console.info(i);break;case e.WARN:console.warn(i);break;case e.ERROR:console.error(i);break;default:console.log(i)}}}function i(a,b){let c,d=((c=a.replace(/^src\//,"")).startsWith("/")&&(c=c.substring(1)),c);return{verbose:(a,c)=>{h(e.VERBOSE,d,a,c,b)},debug:(a,c)=>{h(e.DEBUG,d,a,c,b)},info:(a,c)=>{h(e.INFO,d,a,c,b)},warn:(a,c)=>{h(e.WARN,d,a,c,b)},error:(a,c)=>{h(e.ERROR,d,a,c,b)}}}}};
@@ -0,0 +1 @@
1
+ "use strict";exports.id=4836,exports.ids=[4836],exports.modules={17332:(a,b,c)=>{c.d(b,{A:()=>f});var d=c(27080),e=c(21124);let f=(0,d.A)((0,e.jsx)("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore")},19925:(a,b,c)=>{c.d(b,{A:()=>n});var d=c(38301),e=c(43249),f=c(2783),g=c(18168),h=c(6636),i=c(29565),j=c(33105);function k(a){return(0,j.Ay)("MuiDialogActions",a)}(0,i.A)("MuiDialogActions",["root","spacing"]);var l=c(21124);let m=(0,g.Ay)("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(a,b)=>{let{ownerState:c}=a;return[b.root,!c.disableSpacing&&b.spacing]}})({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto",variants:[{props:({ownerState:a})=>!a.disableSpacing,style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),n=d.forwardRef(function(a,b){let c=(0,h.b)({props:a,name:"MuiDialogActions"}),{className:d,disableSpacing:g=!1,...i}=c,j={...c,disableSpacing:g},n=(a=>{let{classes:b,disableSpacing:c}=a;return(0,f.A)({root:["root",!c&&"spacing"]},k,b)})(j);return(0,l.jsx)(m,{className:(0,e.A)(n.root,d),ownerState:j,ref:b,...i})})},40512:(a,b,c)=>{c.d(b,{A:()=>B});var d=c(38301),e=c(43249),f=c(2783),g=c(92869),h=c(6638),i=c(6537),j=c(49565),k=c(54573),l=c(29565),m=c(33105);function n(a){return(0,m.Ay)("MuiDialog",a)}let o=(0,l.A)("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]);var p=c(94842),q=c(65012),r=c(18168),s=c(60839),t=c(68333),u=c(6636),v=c(20385),w=c(21124);let x=(0,r.Ay)(q.A,{name:"MuiDialog",slot:"Backdrop",overrides:(a,b)=>b.backdrop})({zIndex:-1}),y=(0,r.Ay)(i.A,{name:"MuiDialog",slot:"Root",overridesResolver:(a,b)=>b.root})({"@media print":{position:"absolute !important"}}),z=(0,r.Ay)("div",{name:"MuiDialog",slot:"Container",overridesResolver:(a,b)=>{let{ownerState:c}=a;return[b.container,b[`scroll${(0,h.A)(c.scroll)}`]]}})({height:"100%","@media print":{height:"auto"},outline:0,variants:[{props:{scroll:"paper"},style:{display:"flex",justifyContent:"center",alignItems:"center"}},{props:{scroll:"body"},style:{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}}}]}),A=(0,r.Ay)(k.A,{name:"MuiDialog",slot:"Paper",overridesResolver:(a,b)=>{let{ownerState:c}=a;return[b.paper,b[`scrollPaper${(0,h.A)(c.scroll)}`],b[`paperWidth${(0,h.A)(String(c.maxWidth))}`],c.fullWidth&&b.paperFullWidth,c.fullScreen&&b.paperFullScreen]}})((0,t.A)(({theme:a})=>({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"},variants:[{props:{scroll:"paper"},style:{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"}},{props:{scroll:"body"},style:{display:"inline-block",verticalAlign:"middle",textAlign:"initial"}},{props:({ownerState:a})=>!a.maxWidth,style:{maxWidth:"calc(100% - 64px)"}},{props:{maxWidth:"xs"},style:{maxWidth:"px"===a.breakpoints.unit?Math.max(a.breakpoints.values.xs,444):`max(${a.breakpoints.values.xs}${a.breakpoints.unit}, 444px)`,[`&.${o.paperScrollBody}`]:{[a.breakpoints.down(Math.max(a.breakpoints.values.xs,444)+64)]:{maxWidth:"calc(100% - 64px)"}}}},...Object.keys(a.breakpoints.values).filter(a=>"xs"!==a).map(b=>({props:{maxWidth:b},style:{maxWidth:`${a.breakpoints.values[b]}${a.breakpoints.unit}`,[`&.${o.paperScrollBody}`]:{[a.breakpoints.down(a.breakpoints.values[b]+64)]:{maxWidth:"calc(100% - 64px)"}}}})),{props:({ownerState:a})=>a.fullWidth,style:{width:"calc(100% - 64px)"}},{props:({ownerState:a})=>a.fullScreen,style:{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${o.paperScrollBody}`]:{margin:0,maxWidth:"100%"}}}]}))),B=d.forwardRef(function(a,b){let c=(0,u.b)({props:a,name:"MuiDialog"}),i=(0,s.A)(),l={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{"aria-describedby":m,"aria-labelledby":o,"aria-modal":q=!0,BackdropComponent:r,BackdropProps:t,children:B,className:C,disableEscapeKeyDown:D=!1,fullScreen:E=!1,fullWidth:F=!1,maxWidth:G="sm",onBackdropClick:H,onClick:I,onClose:J,open:K,PaperComponent:L=k.A,PaperProps:M={},scroll:N="paper",slots:O={},slotProps:P={},TransitionComponent:Q=j.A,transitionDuration:R=l,TransitionProps:S,...T}=c,U={...c,disableEscapeKeyDown:D,fullScreen:E,fullWidth:F,maxWidth:G,scroll:N},V=(a=>{let{classes:b,scroll:c,maxWidth:d,fullWidth:e,fullScreen:g}=a,i={root:["root"],container:["container",`scroll${(0,h.A)(c)}`],paper:["paper",`paperScroll${(0,h.A)(c)}`,`paperWidth${(0,h.A)(String(d))}`,e&&"paperFullWidth",g&&"paperFullScreen"]};return(0,f.A)(i,n,b)})(U),W=d.useRef(),X=(0,g.A)(o),Y=d.useMemo(()=>({titleId:X}),[X]),Z={slots:{transition:Q,...O},slotProps:{transition:S,paper:M,backdrop:t,...P}},[$,_]=(0,v.A)("root",{elementType:y,shouldForwardComponentProp:!0,externalForwardedProps:Z,ownerState:U,className:(0,e.A)(V.root,C),ref:b}),[aa,ab]=(0,v.A)("backdrop",{elementType:x,shouldForwardComponentProp:!0,externalForwardedProps:Z,ownerState:U}),[ac,ad]=(0,v.A)("paper",{elementType:A,shouldForwardComponentProp:!0,externalForwardedProps:Z,ownerState:U,className:(0,e.A)(V.paper,M.className)}),[ae,af]=(0,v.A)("container",{elementType:z,externalForwardedProps:Z,ownerState:U,className:(0,e.A)(V.container)}),[ag,ah]=(0,v.A)("transition",{elementType:j.A,externalForwardedProps:Z,ownerState:U,additionalProps:{appear:!0,in:K,timeout:R,role:"presentation"}});return(0,w.jsx)($,{closeAfterTransition:!0,slots:{backdrop:aa},slotProps:{backdrop:{transitionDuration:R,as:r,...ab}},disableEscapeKeyDown:D,onClose:J,open:K,onClick:a=>{I&&I(a),W.current&&(W.current=null,H&&H(a),J&&J(a,"backdropClick"))},..._,...T,children:(0,w.jsx)(ag,{...ah,children:(0,w.jsx)(ae,{onMouseDown:a=>{W.current=a.target===a.currentTarget},...af,children:(0,w.jsx)(ac,{as:L,elevation:24,role:"dialog","aria-describedby":m,"aria-labelledby":X,"aria-modal":q,...ad,children:(0,w.jsx)(p.A.Provider,{value:Y,children:B})})})})})})},47902:(a,b,c)=>{c.d(b,{A:()=>f});var d=c(27080),e=c(21124);let f=(0,d.A)((0,e.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add")},51791:(a,b,c)=>{c.d(b,{A:()=>g,t:()=>f});var d=c(29565),e=c(33105);function f(a){return(0,e.Ay)("MuiDialogTitle",a)}let g=(0,d.A)("MuiDialogTitle",["root"])},52327:(a,b,c)=>{c.d(b,{A:()=>p});var d=c(38301),e=c(43249),f=c(2783),g=c(18168),h=c(68333),i=c(6636),j=c(29565),k=c(33105);function l(a){return(0,k.Ay)("MuiDialogContent",a)}(0,j.A)("MuiDialogContent",["root","dividers"]);var m=c(51791),n=c(21124);let o=(0,g.Ay)("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(a,b)=>{let{ownerState:c}=a;return[b.root,c.dividers&&b.dividers]}})((0,h.A)(({theme:a})=>({flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px",variants:[{props:({ownerState:a})=>a.dividers,style:{padding:"16px 24px",borderTop:`1px solid ${(a.vars||a).palette.divider}`,borderBottom:`1px solid ${(a.vars||a).palette.divider}`}},{props:({ownerState:a})=>!a.dividers,style:{[`.${m.A.root} + &`]:{paddingTop:0}}}]}))),p=d.forwardRef(function(a,b){let c=(0,i.b)({props:a,name:"MuiDialogContent"}),{className:d,dividers:g=!1,...h}=c,j={...c,dividers:g},k=(a=>{let{classes:b,dividers:c}=a;return(0,f.A)({root:["root",c&&"dividers"]},l,b)})(j);return(0,n.jsx)(o,{className:(0,e.A)(k.root,d),ownerState:j,ref:b,...h})})},83899:(a,b,c)=>{c.d(b,{A:()=>n});var d=c(38301),e=c(43249),f=c(2783),g=c(79515),h=c(18168),i=c(6636),j=c(51791),k=c(94842),l=c(21124);let m=(0,h.Ay)(g.default,{name:"MuiDialogTitle",slot:"Root",overridesResolver:(a,b)=>b.root})({padding:"16px 24px",flex:"0 0 auto"}),n=d.forwardRef(function(a,b){let c=(0,i.b)({props:a,name:"MuiDialogTitle"}),{className:g,id:h,...n}=c,o=(a=>{let{classes:b}=a;return(0,f.A)({root:["root"]},j.t,b)})(c),{titleId:p=h}=d.useContext(k.A);return(0,l.jsx)(m,{component:"h2",className:(0,e.A)(o.root,g),ownerState:c,ref:b,variant:"h6",id:h??p,...n})})},91034:(a,b,c)=>{c.d(b,{A:()=>f});var d=c(27080),e=c(21124);let f=(0,d.A)((0,e.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}),"Delete")},93083:(a,b,c)=>{c.d(b,{A:()=>f});var d=c(27080),e=c(21124);let f=(0,d.A)((0,e.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12z"}),"Cancel")},94842:(a,b,c)=>{c.d(b,{A:()=>d});let d=c(38301).createContext({})},99561:(a,b,c)=>{c.d(b,{A:()=>x});var d=c(38301),e=c(43249),f=c(65823),g=c(74846),h=c(2783),i=c(18168),j=c(60839),k=c(68333),l=c(6636),m=c(29031),n=c(28366),o=c(26636),p=c(29565),q=c(33105);function r(a){return(0,q.Ay)("MuiCollapse",a)}(0,p.A)("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);var s=c(21124);let t=(0,i.Ay)("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(a,b)=>{let{ownerState:c}=a;return[b.root,b[c.orientation],"entered"===c.state&&b.entered,"exited"===c.state&&!c.in&&"0px"===c.collapsedSize&&b.hidden]}})((0,k.A)(({theme:a})=>({height:0,overflow:"hidden",transition:a.transitions.create("height"),variants:[{props:{orientation:"horizontal"},style:{height:"auto",width:0,transition:a.transitions.create("width")}},{props:{state:"entered"},style:{height:"auto",overflow:"visible"}},{props:{state:"entered",orientation:"horizontal"},style:{width:"auto"}},{props:({ownerState:a})=>"exited"===a.state&&!a.in&&"0px"===a.collapsedSize,style:{visibility:"hidden"}}]}))),u=(0,i.Ay)("div",{name:"MuiCollapse",slot:"Wrapper",overridesResolver:(a,b)=>b.wrapper})({display:"flex",width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),v=(0,i.Ay)("div",{name:"MuiCollapse",slot:"WrapperInner",overridesResolver:(a,b)=>b.wrapperInner})({width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),w=d.forwardRef(function(a,b){let c=(0,l.b)({props:a,name:"MuiCollapse"}),{addEndListener:i,children:k,className:p,collapsedSize:q="0px",component:w,easing:x,in:y,onEnter:z,onEntered:A,onEntering:B,onExit:C,onExited:D,onExiting:E,orientation:F="vertical",style:G,timeout:H=m.p0.standard,TransitionComponent:I=f.Ay,...J}=c,K={...c,orientation:F,collapsedSize:q},L=(a=>{let{orientation:b,classes:c}=a,d={root:["root",`${b}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${b}`],wrapperInner:["wrapperInner",`${b}`]};return(0,h.A)(d,r,c)})(K),M=(0,j.A)(),N=(0,g.A)(),O=d.useRef(null),P=d.useRef(),Q="number"==typeof q?`${q}px`:q,R="horizontal"===F,S=R?"width":"height",T=d.useRef(null),U=(0,o.A)(b,T),V=a=>b=>{if(a){let c=T.current;void 0===b?a(c):a(c,b)}},W=()=>O.current?O.current[R?"clientWidth":"clientHeight"]:0,X=V((a,b)=>{O.current&&R&&(O.current.style.position="absolute"),a.style[S]=Q,z&&z(a,b)}),Y=V((a,b)=>{let c=W();O.current&&R&&(O.current.style.position="");let{duration:d,easing:e}=(0,n.c)({style:G,timeout:H,easing:x},{mode:"enter"});if("auto"===H){let b=M.transitions.getAutoHeightDuration(c);a.style.transitionDuration=`${b}ms`,P.current=b}else a.style.transitionDuration="string"==typeof d?d:`${d}ms`;a.style[S]=`${c}px`,a.style.transitionTimingFunction=e,B&&B(a,b)}),Z=V((a,b)=>{a.style[S]="auto",A&&A(a,b)}),$=V(a=>{a.style[S]=`${W()}px`,C&&C(a)}),_=V(D),aa=V(a=>{let b=W(),{duration:c,easing:d}=(0,n.c)({style:G,timeout:H,easing:x},{mode:"exit"});if("auto"===H){let c=M.transitions.getAutoHeightDuration(b);a.style.transitionDuration=`${c}ms`,P.current=c}else a.style.transitionDuration="string"==typeof c?c:`${c}ms`;a.style[S]=Q,a.style.transitionTimingFunction=d,E&&E(a)});return(0,s.jsx)(I,{in:y,onEnter:X,onEntered:Z,onEntering:Y,onExit:$,onExited:_,onExiting:aa,addEndListener:a=>{"auto"===H&&N.start(P.current||0,a),i&&i(T.current,a)},nodeRef:T,timeout:"auto"===H?null:H,...J,children:(a,{ownerState:b,...c})=>(0,s.jsx)(t,{as:w,className:(0,e.A)(L.root,p,{entered:L.entered,exited:!y&&"0px"===Q&&L.hidden}[a]),style:{[R?"minWidth":"minHeight"]:Q,...G},ref:U,ownerState:{...K,state:a},...c,children:(0,s.jsx)(u,{ownerState:{...K,state:a},className:L.wrapper,ref:O,children:(0,s.jsx)(v,{ownerState:{...K,state:a},className:L.wrapperInner,children:k})})})})});w&&(w.muiSupportAuto=!0);let x=w}};
@@ -1 +1 @@
1
- exports.id=5311,exports.ids=[5311],exports.modules={8188:(a,b,c)=>{"use strict";c.d(b,{A:()=>K});var d=c(21124),e=c(38301),f=c(27114),g=c(79515),h=c(81637),i=c(43312),j=c(41893),k=c(30818),l=c(423),m=c(98463),n=c(44079),o=c(12033),p=c(91034),q=c(56667),r=c(96955),s=c(18467),t=c(76133),u=c(83434),v=c(19815),w=c(40512),x=c(83899),y=c(52327),z=c(8521),A=c(88745),B=c(91059),C=c(19925),D=c(68730),E=c(8165),F=c(65343);let G=({title:a,attempt:b})=>(0,d.jsxs)(h.default,{sx:{mb:2},children:[(0,d.jsxs)(h.default,{sx:{display:"flex",alignItems:"center",gap:1,mb:.5},children:[b.ok?(0,d.jsx)(E.A,{color:"success",fontSize:"small"}):(0,d.jsx)(F.A,{color:"error",fontSize:"small"}),(0,d.jsx)(g.default,{variant:"subtitle2",children:a}),"number"==typeof b.status&&(0,d.jsx)(j.A,{size:"small",label:`HTTP ${b.status}`}),(0,d.jsx)(j.A,{size:"small",variant:"outlined",label:`${b.durationMs} ms`})]}),b.ok?(0,d.jsxs)(g.default,{variant:"body2",color:"text.secondary",sx:{pl:3},children:["Response: ",b.content?`"${b.content}"`:"(empty)"]}):(0,d.jsxs)(h.default,{sx:{pl:3},children:[(0,d.jsx)(g.default,{variant:"body2",color:"error.main",children:b.error?.message}),(b.error?.code||b.error?.type)&&(0,d.jsxs)(g.default,{variant:"caption",color:"text.secondary",display:"block",children:[b.error?.type?`type: ${b.error.type}`:"",b.error?.type&&b.error?.code?" \xb7 ":"",b.error?.code?`code: ${b.error.code}`:""]}),b.error?.retryAfter&&(0,d.jsxs)(g.default,{variant:"caption",color:"text.secondary",display:"block",children:["retry-after: ",b.error.retryAfter,"s"]}),b.error?.body!==void 0&&(0,d.jsx)(h.default,{component:"pre",sx:{mt:.5,p:1,bgcolor:"action.hover",borderRadius:1,fontSize:"0.7rem",overflowX:"auto",maxHeight:160},children:JSON.stringify(b.error.body,null,2)})]})]}),H=({open:a,modelLabel:b,loading:c,result:e,error:f,onClose:i,onRetry:j})=>(0,d.jsxs)(w.A,{open:a,onClose:i,maxWidth:"sm",fullWidth:!0,children:[(0,d.jsxs)(x.A,{children:["Test model: ",b]}),(0,d.jsx)(y.A,{dividers:!0,children:c?(0,d.jsxs)(h.default,{sx:{display:"flex",alignItems:"center",gap:2,py:3},children:[(0,d.jsx)(z.default,{size:24}),(0,d.jsx)(g.default,{variant:"body2",children:"Sending a direct test request (SDK + axios)…"})]}):f?(0,d.jsx)(A.A,{severity:"error",children:f}):e?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(A.A,{severity:e.ok?"success":"warning",sx:{mb:2},children:e.diagnosis}),(0,d.jsxs)(g.default,{variant:"caption",color:"text.secondary",display:"block",sx:{mb:2},children:["model: ",e.model,e.baseUrl?` \xb7 ${e.baseUrl}`:"",e.provider?` \xb7 ${e.provider}`:""]}),(0,d.jsx)(B.A,{sx:{mb:2}}),(0,d.jsx)(G,{title:"OpenAI SDK (used by flows)",attempt:e.sdk}),(0,d.jsx)(G,{title:"axios (independent cross-check)",attempt:e.axios})]}):null}),(0,d.jsxs)(C.A,{children:[(0,d.jsx)(D.A,{onClick:j,disabled:c,children:"Run again"}),(0,d.jsx)(D.A,{onClick:i,variant:"contained",children:"Close"})]})]});var I=c(78352);let J=(0,v.h)("frontend/components/models/list/ModelCard"),K=({model:a,onEdit:b,onDelete:c,folder:v,folders:w=[],onSetFolder:x,selectable:y=!1,selected:z=!1,onSelect:A})=>{let[B,C]=(0,e.useState)(!1),[D,E]=(0,e.useState)(!1),[F,G]=(0,e.useState)(null),[K,L]=(0,e.useState)(null),[M,N]=(0,e.useState)(null),O=async()=>{E(!0),L(null),G(null);try{let b=await (0,u.X)().testModel({modelId:a.id});G(b)}catch(b){J.error("Model test failed",{modelId:a.id,error:b}),L(b instanceof Error?b.message:"Failed to run test")}finally{E(!1)}},P=(0,d.jsx)(d.Fragment,{children:(0,d.jsxs)(f.A,{sx:{flexGrow:1},children:[(0,d.jsx)(g.default,{variant:"h6",gutterBottom:!0,children:a.displayName||a.name}),(0,d.jsx)(g.default,{variant:"body2",color:"text.secondary",sx:{mb:2},style:{display:"-webkit-box",WebkitLineClamp:3,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis"},children:a.description}),(0,d.jsxs)(h.default,{sx:{mb:1},children:[(0,d.jsxs)(g.default,{variant:"body2",color:"text.secondary",children:["Provider: ",(0,t.T_)(a.provider,a.adapter).label]}),a.displayName&&(0,d.jsxs)(g.default,{variant:"body2",color:"text.secondary",noWrap:!0,children:["Model: ",a.name]}),"number"==typeof a.contextWindow&&(0,d.jsxs)(g.default,{variant:"body2",color:"text.secondary",children:["Context: ",a.contextWindow.toLocaleString()," tokens"]})]}),a.baseUrl&&(0,d.jsx)(i.A,{title:a.baseUrl,arrow:!0,placement:"top",children:(0,d.jsxs)(g.default,{variant:"body2",color:"text.secondary",noWrap:!0,children:["Base URL: ",a.baseUrl]})}),v&&(0,d.jsx)(j.A,{icon:(0,d.jsx)(s.A,{}),label:v,size:"small",variant:"outlined",sx:{mt:1,maxWidth:"100%"}})]})});return y?(0,d.jsx)(k.A,{elevation:z?4:2,role:"radio","aria-checked":z,sx:{height:"100%",display:"flex",flexDirection:"column",border:a=>z?`2px solid ${a.palette.primary.main}`:"2px solid transparent",transition:"border-color 120ms, box-shadow 120ms"},children:(0,d.jsx)(l.A,{onClick:()=>A?.(a.id),sx:{height:"100%",display:"flex",flexDirection:"column",alignItems:"stretch"},children:P})}):(0,d.jsxs)(k.A,{elevation:2,sx:{height:"100%",display:"flex",flexDirection:"column"},children:[P,(0,d.jsxs)(m.A,{disableSpacing:!0,children:[(0,d.jsx)(i.A,{title:"Test model (direct SDK call, no flow)",arrow:!0,children:(0,d.jsx)(n.A,{"aria-label":"test",onClick:()=>{C(!0),O()},children:(0,d.jsx)(q.A,{})})}),(0,d.jsx)(n.A,{"aria-label":"edit",onClick:b,children:(0,d.jsx)(o.A,{})}),(0,d.jsx)(n.A,{"aria-label":"delete",onClick:c,children:(0,d.jsx)(p.A,{})}),x&&(0,d.jsx)(i.A,{title:"Move to folder…",arrow:!0,children:(0,d.jsx)(n.A,{"aria-label":"move to folder",onClick:a=>N(a.currentTarget),sx:{ml:"auto"},children:(0,d.jsx)(r.A,{})})})]}),x&&(0,d.jsx)(I.A,{anchorEl:M,open:!!M,currentFolder:v,folders:w,onClose:()=>N(null),onAssign:x}),(0,d.jsx)(H,{open:B,modelLabel:a.displayName||a.name,loading:D,result:F,error:K,onClose:()=>C(!1),onRetry:O})]})}},43010:()=>{},64535:(a,b,c)=>{"use strict";c.d(b,{A$:()=>j,X8:()=>g,YP:()=>k,js:()=>i});let d="_-_-_",e=/^(tool|resource):(.+)$/,f=/\$\{((?:tool|resource):[^}]+|_-_-_[^}]+)\}/g;function g(a,b,c){return`\${${a}:${b}__${c}}`}function h(a){let b=e.exec(a);if(b){let a=b[1],c=function(a){let b=a.indexOf("__");if(b<=0)return null;let c=a.slice(b+2);return c?{server:a.slice(0,b),name:c}:null}(b[2]);return c?{kind:a,server:c.server,name:c.name}:null}if(a.startsWith(d)){let b=a.split(d);if(3===b.length&&b[1]&&b[2])return{kind:"tool",server:b[1],name:b[2]}}return null}function i(a){return a.startsWith("${")&&a.endsWith("}")?h(a.slice(2,-1)):null}function j(a){let b,c=[];for(f.lastIndex=0;null!==(b=f.exec(a));){let a=h(b[1]);a&&c.push({...a,fullMatch:b[0],index:b.index})}return c}function k(a){var b,c;return"tool"===a.kind&&"handoff"===a.server?`handoff:${a.name}`:`${a.kind}:${b=a.server,c=a.name,`${b}__${c}`}`}},85838:(a,b,c)=>{"use strict";c.d(b,{A:()=>C});var d=c(21124),e=c(38301),f=c(19815),g=c(90647),h=c(49257),i=c(74576),j=c(81637),k=c(79515),l=c(48317),m=c(7499),n=c(54573),o=c(9604),p=c(22813),q=c(28055);c(43010);var r=c(64535);let s=(0,f.h)("frontend/components/shared/PromptBuilder"),t=a=>{s.debug("Deserializing markdown to Slate value");let b=a.split("\n").map(a=>({type:"paragraph",children:(a=>{let b=(0,r.A$)(a);if(0===b.length)return[{text:a}];let c=[],d=0;for(let e of b)e.index>d&&c.push({text:a.slice(d,e.index)}),c.push({type:"binding-reference",kind:e.kind,server:e.server,name:e.name,children:[{text:""}]}),d=e.index+e.fullMatch.length;return d<a.length&&c.push({text:a.slice(d)}),c})(a)}));return b.length>0?b:[{type:"paragraph",children:[{text:""}]}]},u=a=>{s.debug("Serializing Slate value to markdown");let b=0,c=a.map(a=>a.children?a.children.map(a=>g.EY.isText(a)?a.text:"binding-reference"===a.type?(b++,(0,r.X8)(a.kind,a.server,a.name)):"").join(""):"").join("\n");return b>0&&s.debug(`Serialized ${b} binding references`),c},v=a=>{let{attributes:b,children:c,element:e}=a;return"binding-reference"===e.type?(0,d.jsxs)("span",{...b,className:"tool-reference-wrapper",children:[(0,d.jsx)(()=>{let a=(0,h.Zi)(),b=(a=>"tool"===a.kind&&"handoff"===a.server)(e),c="resource"===e.kind?"resource":b?"handoff":"",f=()=>{let b=h.rL.findPath(a,e);s.debug(`Removing binding reference: ${e.kind}:${e.server}:${e.name}`),g.gB.removeNodes(a,{at:b})};return(0,d.jsxs)("span",{contentEditable:!1,className:`tool-reference-container ${c}`,children:[(0,d.jsx)("span",{className:`tool-reference ${c}`,children:(0,r.YP)(e)}),(0,d.jsx)("span",{className:`tool-reference-delete ${c}`,role:"button",tabIndex:0,onClick:a=>{a.preventDefault(),a.stopPropagation(),f()},onKeyDown:a=>{("Enter"===a.key||" "===a.key)&&(a.preventDefault(),a.stopPropagation(),f())},children:"\xd7"})]})},{}),c," "]}):(0,d.jsx)("p",{...b,children:c})},w=a=>{let{attributes:b,children:c,leaf:e}=a,f=c;return e.bold&&(f=(0,d.jsx)("strong",{children:f})),e.italic&&(f=(0,d.jsx)("em",{children:f})),e.code&&(f=(0,d.jsx)("code",{children:f})),(0,d.jsx)("span",{...b,children:f})},x=({server:a,name:b})=>{let c="handoff"===a,[f,g]=(0,e.useState)(null),[h,i]=(0,e.useState)(!0);return((0,e.useEffect)(()=>{let c=!1;return(async()=>{try{i(!0);let d=await q.S.listServerTools(a),e=d.tools?.find(a=>a.name===b);c||g(e||null)}catch(c){s.error(`Failed to fetch tool info for ${a}:${b}`,c)}finally{c||i(!1)}})(),()=>{c=!0}},[a,b]),h)?(0,d.jsx)("span",{className:`tool-reference-preview loading ${c?"handoff":""}`,children:`tool:${a}__${b}`}):f?(0,d.jsxs)("span",{className:`tool-reference-preview ${c?"handoff":""}`,children:["[The user is referencing a ",c?"handoff":"tool"," `tool:",a,"__",b,"` (",f.description||"No description",")]"]}):(0,d.jsx)("span",{className:`tool-reference-preview not-found ${c?"handoff":""}`,children:`tool:${a}__${b} (Tool not found)`})},y=({server:a,name:b})=>{let[c,f]=(0,e.useState)(null),[g,h]=(0,e.useState)(!0);return((0,e.useEffect)(()=>{let c=!1;return(async()=>{try{h(!0);let d=await q.S.listServerResources(a),e=[...d.resources||[],...d.resourceTemplates||[]].find(a=>a.uri===b||a.uriTemplate===b);c||f(e?.description||e?.name||null)}catch(c){s.error(`Failed to fetch resource info for ${a}:${b}`,c)}finally{c||h(!1)}})(),()=>{c=!0}},[a,b]),g)?(0,d.jsx)("span",{className:"tool-reference-preview loading resource",children:`resource:${a}__${b}`}):(0,d.jsxs)("span",{className:"tool-reference-preview resource",children:["[The contents of resource `",b,"` from `",a,"`",c?` (${c})`:""," will be inserted here]"]})},z=({binding:a})=>"resource"===a.kind?(0,d.jsx)(y,{server:a.server,name:a.name}):(0,d.jsx)(x,{server:a.server,name:a.name}),A=({value:a})=>{s.debug("Rendering preview");let b=[],c=0;for(let d of(0,r.A$)(a))d.index>c&&b.push({type:"text",value:a.slice(c,d.index)}),b.push({type:"binding",binding:d,key:d.index}),c=d.index+d.fullMatch.length;c<a.length&&b.push({type:"text",value:a.slice(c)});let e=[],f=[],g=()=>{e.push((0,d.jsx)("p",{children:f},`p-${e.length}`)),f=[]};for(let a of b)if("text"===a.type){let b=a.value.split("\n");for(let a=0;a<b.length;a++)f.push(b[a]),a<b.length-1&&g()}else f.push((0,d.jsx)(z,{binding:a.binding},`binding-${a.key}`));return f.length>0&&g(),(0,d.jsx)("div",{className:"preview-content",children:e})},B=(0,e.forwardRef)(({value:a,onChange:b,label:c="Prompt Builder",height:f=300,onModeChange:q,customPreviewRenderer:x},y)=>{s.info("PromptBuilder initialized");let z=(0,e.useMemo)(()=>{let a=(0,i.$k)((0,h.o$)((0,g.ie)())),{isInline:b,isVoid:c}=a;return a.isInline=a=>"binding-reference"===a.type||b(a),a.isVoid=a=>"binding-reference"===a.type||c(a),a},[]),[B,C]=(0,e.useState)("raw"),[D,E]=(0,e.useState)(()=>t(a||"")),F=(0,e.useRef)(!1),[,G]=(0,e.useState)(0);(0,e.useImperativeHandle)(y,()=>({insertText:a=>{s.info(`insertText called with text length: ${a.length}`);let c=(0,r.js)(a);if(c){s.info(`Inserting ${c.kind} reference: ${c.server}:${c.name}`);let a={type:"binding-reference",kind:c.kind,server:c.server,name:c.name,children:[{text:""}]};z.selection||g.gB.select(z,g.KE.end(z,[])),g.gB.insertNodes(z,a),g.gB.move(z),G(a=>a+1),E([...z.children])}else z.selection||g.gB.select(z,g.KE.end(z,[])),g.gB.insertText(z,a);b(u(z.children)),s.info("insertText completed successfully")},getMode:()=>B})),(0,e.useEffect)(()=>{u(D)!==u(t(a||""))&&(s.debug("External value change detected"),F.current=!0,E(t(a||"")))},[a,D]);let H=(0,e.useCallback)(a=>{if(F.current){F.current=!1;return}E(a),b(u(a))},[b]);return(0,d.jsxs)(j.default,{sx:{width:"100%",height:"100%",display:"flex",flexDirection:"column"},children:[c&&(0,d.jsx)(k.default,{variant:"subtitle1",gutterBottom:!0,sx:{fontWeight:"medium",mb:1},children:c}),(0,d.jsx)(j.default,{sx:{mb:1},children:(0,d.jsxs)(l.A,{value:B,exclusive:!0,onChange:(a,b)=>{null!==b&&(s.info(`Mode changed from ${B} to ${b}`),C(b),q&&q(b))},size:"small",children:[(0,d.jsxs)(m.A,{value:"raw",children:[(0,d.jsx)(o.A,{fontSize:"small",sx:{mr:.5}}),"Raw"]}),(0,d.jsxs)(m.A,{value:"preview",children:[(0,d.jsx)(p.A,{fontSize:"small",sx:{mr:.5}}),"Preview"]})]})}),(0,d.jsx)(n.A,{elevation:0,sx:{border:"1px solid rgba(0, 0, 0, 0.12)",borderRadius:1,overflow:"hidden",flexGrow:1,display:"flex",flexDirection:"column"},children:"raw"===B?(0,d.jsx)(j.default,{className:"slate-editor-container",sx:{height:"number"==typeof f?f:"100%",overflow:"auto",p:2},children:(0,d.jsx)(h.A,{editor:z,initialValue:D,onChange:H,children:(0,d.jsx)(h.Fo,{className:"slate-editor",renderElement:v,renderLeaf:w,placeholder:"Write your prompt here..."})})}):x?(0,d.jsx)(j.default,{className:"custom-preview-container",sx:{height:"number"==typeof f?f:"100%",overflow:"auto"},children:x()}):(0,d.jsx)(j.default,{className:"preview-container",sx:{height:"number"==typeof f?f:"100%",overflow:"auto",p:2},children:(0,d.jsx)(A,{value:a})})})]})});B.displayName="PromptBuilder";let C=B}};
1
+ exports.id=5311,exports.ids=[5311],exports.modules={8188:(a,b,c)=>{"use strict";c.d(b,{A:()=>O});var d=c(21124),e=c(38301),f=c(60839),g=c(43312),h=c(44079),i=c(37489),j=c(27114),k=c(79515),l=c(81637),m=c(41893),n=c(30818),o=c(423),p=c(98463),q=c(12033),r=c(91034),s=c(56667),t=c(96955),u=c(18467),v=c(5501),w=c(99587),x=c(76133),y=c(83434),z=c(19815),A=c(40512),B=c(83899),C=c(52327),D=c(8521),E=c(88745),F=c(91059),G=c(19925),H=c(68730),I=c(8165),J=c(65343);let K=({title:a,attempt:b})=>(0,d.jsxs)(l.default,{sx:{mb:2},children:[(0,d.jsxs)(l.default,{sx:{display:"flex",alignItems:"center",gap:1,mb:.5},children:[b.ok?(0,d.jsx)(I.A,{color:"success",fontSize:"small"}):(0,d.jsx)(J.A,{color:"error",fontSize:"small"}),(0,d.jsx)(k.default,{variant:"subtitle2",children:a}),"number"==typeof b.status&&(0,d.jsx)(m.A,{size:"small",label:`HTTP ${b.status}`}),(0,d.jsx)(m.A,{size:"small",variant:"outlined",label:`${b.durationMs} ms`})]}),b.ok?(0,d.jsxs)(k.default,{variant:"body2",color:"text.secondary",sx:{pl:3},children:["Response: ",b.content?`"${b.content}"`:"(empty)"]}):(0,d.jsxs)(l.default,{sx:{pl:3},children:[(0,d.jsx)(k.default,{variant:"body2",color:"error.main",children:b.error?.message}),(b.error?.code||b.error?.type)&&(0,d.jsxs)(k.default,{variant:"caption",color:"text.secondary",display:"block",children:[b.error?.type?`type: ${b.error.type}`:"",b.error?.type&&b.error?.code?" \xb7 ":"",b.error?.code?`code: ${b.error.code}`:""]}),b.error?.retryAfter&&(0,d.jsxs)(k.default,{variant:"caption",color:"text.secondary",display:"block",children:["retry-after: ",b.error.retryAfter,"s"]}),b.error?.body!==void 0&&(0,d.jsx)(l.default,{component:"pre",sx:{mt:.5,p:1,bgcolor:"action.hover",borderRadius:1,fontSize:"0.7rem",overflowX:"auto",maxHeight:160},children:JSON.stringify(b.error.body,null,2)})]})]}),L=({open:a,modelLabel:b,loading:c,result:e,error:f,onClose:g,onRetry:h})=>(0,d.jsxs)(A.A,{open:a,onClose:g,maxWidth:"sm",fullWidth:!0,children:[(0,d.jsxs)(B.A,{children:["Test model: ",b]}),(0,d.jsx)(C.A,{dividers:!0,children:c?(0,d.jsxs)(l.default,{sx:{display:"flex",alignItems:"center",gap:2,py:3},children:[(0,d.jsx)(D.default,{size:24}),(0,d.jsx)(k.default,{variant:"body2",children:"Sending a direct test request (SDK + axios)…"})]}):f?(0,d.jsx)(E.A,{severity:"error",children:f}):e?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(E.A,{severity:e.ok?"success":"warning",sx:{mb:2},children:e.diagnosis}),(0,d.jsxs)(k.default,{variant:"caption",color:"text.secondary",display:"block",sx:{mb:2},children:["model: ",e.model,e.baseUrl?` \xb7 ${e.baseUrl}`:"",e.provider?` \xb7 ${e.provider}`:""]}),(0,d.jsx)(F.A,{sx:{mb:2}}),(0,d.jsx)(K,{title:"OpenAI SDK (used by flows)",attempt:e.sdk}),(0,d.jsx)(K,{title:"axios (independent cross-check)",attempt:e.axios})]}):null}),(0,d.jsxs)(G.A,{children:[(0,d.jsx)(H.A,{onClick:h,disabled:c,children:"Run again"}),(0,d.jsx)(H.A,{onClick:g,variant:"contained",children:"Close"})]})]});var M=c(78352);let N=(0,z.h)("frontend/components/models/list/ModelCard"),O=({model:a,onEdit:b,onDelete:c,folder:z,folders:A=[],onSetFolder:B,selectable:C=!1,selected:D=!1,onSelect:E,onToggleFavorite:F})=>{let G=(0,f.A)(),[H,I]=(0,e.useState)(!1),[J,K]=(0,e.useState)(!1),[O,P]=(0,e.useState)(null),[Q,R]=(0,e.useState)(null),[S,T]=(0,e.useState)(null),U=async()=>{K(!0),R(null),P(null);try{let b=await (0,y.X)().testModel({modelId:a.id});P(b)}catch(b){N.error("Model test failed",{modelId:a.id,error:b}),R(b instanceof Error?b.message:"Failed to run test")}finally{K(!1)}},V=F?(0,d.jsx)(g.A,{title:a.favorite?"Remove from favorites":"Add to favorites",arrow:!0,placement:"top",children:(0,d.jsx)(h.A,{size:"small","aria-label":a.favorite?"remove from favorites":"add to favorites",onClick:b=>{b.stopPropagation(),F?.(a.id)},sx:{position:"absolute",top:4,left:4,zIndex:2,color:a.favorite?G.palette.warning.main:G.palette.text.secondary,backgroundColor:(0,i.X4)(G.palette.background.paper,.6),"&:hover":{backgroundColor:(0,i.X4)(G.palette.background.paper,.9)}},children:a.favorite?(0,d.jsx)(v.A,{fontSize:"small"}):(0,d.jsx)(w.A,{fontSize:"small"})})}):null,W=(0,d.jsx)(d.Fragment,{children:(0,d.jsxs)(j.A,{sx:{flexGrow:1},children:[(0,d.jsx)(k.default,{variant:"h6",gutterBottom:!0,children:a.displayName||a.name}),(0,d.jsx)(k.default,{variant:"body2",color:"text.secondary",sx:{mb:2},style:{display:"-webkit-box",WebkitLineClamp:3,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis"},children:a.description}),(0,d.jsxs)(l.default,{sx:{mb:1},children:[(0,d.jsxs)(k.default,{variant:"body2",color:"text.secondary",children:["Provider: ",(0,x.T_)(a.provider,a.adapter).label]}),a.displayName&&(0,d.jsxs)(k.default,{variant:"body2",color:"text.secondary",noWrap:!0,children:["Model: ",a.name]}),"number"==typeof a.contextWindow&&(0,d.jsxs)(k.default,{variant:"body2",color:"text.secondary",children:["Context: ",a.contextWindow.toLocaleString()," tokens"]})]}),a.baseUrl&&(0,d.jsx)(g.A,{title:a.baseUrl,arrow:!0,placement:"top",children:(0,d.jsxs)(k.default,{variant:"body2",color:"text.secondary",noWrap:!0,children:["Base URL: ",a.baseUrl]})}),z&&(0,d.jsx)(m.A,{icon:(0,d.jsx)(u.A,{}),label:z,size:"small",variant:"outlined",sx:{mt:1,maxWidth:"100%"}})]})});return C?(0,d.jsxs)(n.A,{elevation:D?4:2,role:"radio","aria-checked":D,sx:{height:"100%",display:"flex",flexDirection:"column",position:"relative",border:a=>D?`2px solid ${a.palette.primary.main}`:"2px solid transparent",transition:"border-color 120ms, box-shadow 120ms"},children:[V,(0,d.jsx)(o.A,{onClick:()=>E?.(a.id),sx:{height:"100%",display:"flex",flexDirection:"column",alignItems:"stretch"},children:W})]}):(0,d.jsxs)(n.A,{elevation:2,sx:{height:"100%",display:"flex",flexDirection:"column",position:"relative"},children:[V,W,(0,d.jsxs)(p.A,{disableSpacing:!0,children:[(0,d.jsx)(g.A,{title:"Test model (direct SDK call, no flow)",arrow:!0,children:(0,d.jsx)(h.A,{"aria-label":"test",onClick:()=>{I(!0),U()},children:(0,d.jsx)(s.A,{})})}),(0,d.jsx)(h.A,{"aria-label":"edit",onClick:b,children:(0,d.jsx)(q.A,{})}),(0,d.jsx)(h.A,{"aria-label":"delete",onClick:c,children:(0,d.jsx)(r.A,{})}),B&&(0,d.jsx)(g.A,{title:"Move to folder…",arrow:!0,children:(0,d.jsx)(h.A,{"aria-label":"move to folder",onClick:a=>T(a.currentTarget),sx:{ml:"auto"},children:(0,d.jsx)(t.A,{})})})]}),B&&(0,d.jsx)(M.A,{anchorEl:S,open:!!S,currentFolder:z,folders:A,onClose:()=>T(null),onAssign:B}),(0,d.jsx)(L,{open:H,modelLabel:a.displayName||a.name,loading:J,result:O,error:Q,onClose:()=>I(!1),onRetry:U})]})}},43010:()=>{},64535:(a,b,c)=>{"use strict";c.d(b,{A$:()=>j,X8:()=>g,YP:()=>k,js:()=>i});let d="_-_-_",e=/^(tool|resource):(.+)$/,f=/\$\{((?:tool|resource):[^}]+|_-_-_[^}]+)\}/g;function g(a,b,c){return`\${${a}:${b}__${c}}`}function h(a){let b=e.exec(a);if(b){let a=b[1],c=function(a){let b=a.indexOf("__");if(b<=0)return null;let c=a.slice(b+2);return c?{server:a.slice(0,b),name:c}:null}(b[2]);return c?{kind:a,server:c.server,name:c.name}:null}if(a.startsWith(d)){let b=a.split(d);if(3===b.length&&b[1]&&b[2])return{kind:"tool",server:b[1],name:b[2]}}return null}function i(a){return a.startsWith("${")&&a.endsWith("}")?h(a.slice(2,-1)):null}function j(a){let b,c=[];for(f.lastIndex=0;null!==(b=f.exec(a));){let a=h(b[1]);a&&c.push({...a,fullMatch:b[0],index:b.index})}return c}function k(a){var b,c;return"tool"===a.kind&&"handoff"===a.server?`handoff:${a.name}`:`${a.kind}:${b=a.server,c=a.name,`${b}__${c}`}`}},85838:(a,b,c)=>{"use strict";c.d(b,{A:()=>C});var d=c(21124),e=c(38301),f=c(19815),g=c(90647),h=c(49257),i=c(74576),j=c(81637),k=c(79515),l=c(48317),m=c(7499),n=c(54573),o=c(9604),p=c(22813),q=c(28055);c(43010);var r=c(64535);let s=(0,f.h)("frontend/components/shared/PromptBuilder"),t=a=>{s.debug("Deserializing markdown to Slate value");let b=a.split("\n").map(a=>({type:"paragraph",children:(a=>{let b=(0,r.A$)(a);if(0===b.length)return[{text:a}];let c=[],d=0;for(let e of b)e.index>d&&c.push({text:a.slice(d,e.index)}),c.push({type:"binding-reference",kind:e.kind,server:e.server,name:e.name,children:[{text:""}]}),d=e.index+e.fullMatch.length;return d<a.length&&c.push({text:a.slice(d)}),c})(a)}));return b.length>0?b:[{type:"paragraph",children:[{text:""}]}]},u=a=>{s.debug("Serializing Slate value to markdown");let b=0,c=a.map(a=>a.children?a.children.map(a=>g.EY.isText(a)?a.text:"binding-reference"===a.type?(b++,(0,r.X8)(a.kind,a.server,a.name)):"").join(""):"").join("\n");return b>0&&s.debug(`Serialized ${b} binding references`),c},v=a=>{let{attributes:b,children:c,element:e}=a;return"binding-reference"===e.type?(0,d.jsxs)("span",{...b,className:"tool-reference-wrapper",children:[(0,d.jsx)(()=>{let a=(0,h.Zi)(),b=(a=>"tool"===a.kind&&"handoff"===a.server)(e),c="resource"===e.kind?"resource":b?"handoff":"",f=()=>{let b=h.rL.findPath(a,e);s.debug(`Removing binding reference: ${e.kind}:${e.server}:${e.name}`),g.gB.removeNodes(a,{at:b})};return(0,d.jsxs)("span",{contentEditable:!1,className:`tool-reference-container ${c}`,children:[(0,d.jsx)("span",{className:`tool-reference ${c}`,children:(0,r.YP)(e)}),(0,d.jsx)("span",{className:`tool-reference-delete ${c}`,role:"button",tabIndex:0,onClick:a=>{a.preventDefault(),a.stopPropagation(),f()},onKeyDown:a=>{("Enter"===a.key||" "===a.key)&&(a.preventDefault(),a.stopPropagation(),f())},children:"\xd7"})]})},{}),c," "]}):(0,d.jsx)("p",{...b,children:c})},w=a=>{let{attributes:b,children:c,leaf:e}=a,f=c;return e.bold&&(f=(0,d.jsx)("strong",{children:f})),e.italic&&(f=(0,d.jsx)("em",{children:f})),e.code&&(f=(0,d.jsx)("code",{children:f})),(0,d.jsx)("span",{...b,children:f})},x=({server:a,name:b})=>{let c="handoff"===a,[f,g]=(0,e.useState)(null),[h,i]=(0,e.useState)(!0);return((0,e.useEffect)(()=>{let c=!1;return(async()=>{try{i(!0);let d=await q.S.listServerTools(a),e=d.tools?.find(a=>a.name===b);c||g(e||null)}catch(c){s.error(`Failed to fetch tool info for ${a}:${b}`,c)}finally{c||i(!1)}})(),()=>{c=!0}},[a,b]),h)?(0,d.jsx)("span",{className:`tool-reference-preview loading ${c?"handoff":""}`,children:`tool:${a}__${b}`}):f?(0,d.jsxs)("span",{className:`tool-reference-preview ${c?"handoff":""}`,children:["[The user is referencing a ",c?"handoff":"tool"," `tool:",a,"__",b,"` (",f.description||"No description",")]"]}):(0,d.jsx)("span",{className:`tool-reference-preview not-found ${c?"handoff":""}`,children:`tool:${a}__${b} (Tool not found)`})},y=({server:a,name:b})=>{let[c,f]=(0,e.useState)(null),[g,h]=(0,e.useState)(!0);return((0,e.useEffect)(()=>{let c=!1;return(async()=>{try{h(!0);let d=await q.S.listServerResources(a),e=[...d.resources||[],...d.resourceTemplates||[]].find(a=>a.uri===b||a.uriTemplate===b);c||f(e?.description||e?.name||null)}catch(c){s.error(`Failed to fetch resource info for ${a}:${b}`,c)}finally{c||h(!1)}})(),()=>{c=!0}},[a,b]),g)?(0,d.jsx)("span",{className:"tool-reference-preview loading resource",children:`resource:${a}__${b}`}):(0,d.jsxs)("span",{className:"tool-reference-preview resource",children:["[The contents of resource `",b,"` from `",a,"`",c?` (${c})`:""," will be inserted here]"]})},z=({binding:a})=>"resource"===a.kind?(0,d.jsx)(y,{server:a.server,name:a.name}):(0,d.jsx)(x,{server:a.server,name:a.name}),A=({value:a})=>{s.debug("Rendering preview");let b=[],c=0;for(let d of(0,r.A$)(a))d.index>c&&b.push({type:"text",value:a.slice(c,d.index)}),b.push({type:"binding",binding:d,key:d.index}),c=d.index+d.fullMatch.length;c<a.length&&b.push({type:"text",value:a.slice(c)});let e=[],f=[],g=()=>{e.push((0,d.jsx)("p",{children:f},`p-${e.length}`)),f=[]};for(let a of b)if("text"===a.type){let b=a.value.split("\n");for(let a=0;a<b.length;a++)f.push(b[a]),a<b.length-1&&g()}else f.push((0,d.jsx)(z,{binding:a.binding},`binding-${a.key}`));return f.length>0&&g(),(0,d.jsx)("div",{className:"preview-content",children:e})},B=(0,e.forwardRef)(({value:a,onChange:b,label:c="Prompt Builder",height:f=300,onModeChange:q,customPreviewRenderer:x},y)=>{s.info("PromptBuilder initialized");let z=(0,e.useMemo)(()=>{let a=(0,i.$k)((0,h.o$)((0,g.ie)())),{isInline:b,isVoid:c}=a;return a.isInline=a=>"binding-reference"===a.type||b(a),a.isVoid=a=>"binding-reference"===a.type||c(a),a},[]),[B,C]=(0,e.useState)("raw"),[D,E]=(0,e.useState)(()=>t(a||"")),F=(0,e.useRef)(!1),[,G]=(0,e.useState)(0);(0,e.useImperativeHandle)(y,()=>({insertText:a=>{s.info(`insertText called with text length: ${a.length}`);let c=(0,r.js)(a);if(c){s.info(`Inserting ${c.kind} reference: ${c.server}:${c.name}`);let a={type:"binding-reference",kind:c.kind,server:c.server,name:c.name,children:[{text:""}]};z.selection||g.gB.select(z,g.KE.end(z,[])),g.gB.insertNodes(z,a),g.gB.move(z),G(a=>a+1),E([...z.children])}else z.selection||g.gB.select(z,g.KE.end(z,[])),g.gB.insertText(z,a);b(u(z.children)),s.info("insertText completed successfully")},getMode:()=>B})),(0,e.useEffect)(()=>{u(D)!==u(t(a||""))&&(s.debug("External value change detected"),F.current=!0,E(t(a||"")))},[a,D]);let H=(0,e.useCallback)(a=>{if(F.current){F.current=!1;return}E(a),b(u(a))},[b]);return(0,d.jsxs)(j.default,{sx:{width:"100%",height:"100%",display:"flex",flexDirection:"column"},children:[c&&(0,d.jsx)(k.default,{variant:"subtitle1",gutterBottom:!0,sx:{fontWeight:"medium",mb:1},children:c}),(0,d.jsx)(j.default,{sx:{mb:1},children:(0,d.jsxs)(l.A,{value:B,exclusive:!0,onChange:(a,b)=>{null!==b&&(s.info(`Mode changed from ${B} to ${b}`),C(b),q&&q(b))},size:"small",children:[(0,d.jsxs)(m.A,{value:"raw",children:[(0,d.jsx)(o.A,{fontSize:"small",sx:{mr:.5}}),"Raw"]}),(0,d.jsxs)(m.A,{value:"preview",children:[(0,d.jsx)(p.A,{fontSize:"small",sx:{mr:.5}}),"Preview"]})]})}),(0,d.jsx)(n.A,{elevation:0,sx:{border:"1px solid rgba(0, 0, 0, 0.12)",borderRadius:1,overflow:"hidden",flexGrow:1,display:"flex",flexDirection:"column"},children:"raw"===B?(0,d.jsx)(j.default,{className:"slate-editor-container",sx:{height:"number"==typeof f?f:"100%",overflow:"auto",p:2},children:(0,d.jsx)(h.A,{editor:z,initialValue:D,onChange:H,children:(0,d.jsx)(h.Fo,{className:"slate-editor",renderElement:v,renderLeaf:w,placeholder:"Write your prompt here..."})})}):x?(0,d.jsx)(j.default,{className:"custom-preview-container",sx:{height:"number"==typeof f?f:"100%",overflow:"auto"},children:x()}):(0,d.jsx)(j.default,{className:"preview-container",sx:{height:"number"==typeof f?f:"100%",overflow:"auto",p:2},children:(0,d.jsx)(A,{value:a})})})]})});B.displayName="PromptBuilder";let C=B}};
@@ -0,0 +1 @@
1
+ "use strict";exports.id=5463,exports.ids=[5463],exports.modules={25463:(a,b,c)=>{c.d(b,{internalCallToolFor:()=>g,internalToolDefinitionsFor:()=>f});var d=c(81495),e=c(7658);async function f(a){switch(a){case d._:{let{internalToolDefinitions:a}=await Promise.all([c.e(1373),c.e(3736),c.e(9794),c.e(7821),c.e(724),c.e(3823),c.e(4671),c.e(6826),c.e(4771),c.e(7214),c.e(1226),c.e(4265),c.e(5708),c.e(227),c.e(2859)]).then(c.bind(c,42859));return a()}case e.K3:{let{filesystemToolDefinitions:a}=await c.e(8387).then(c.bind(c,18387));return a()}case e.PA:{let{bashToolDefinitions:a}=await c.e(5544).then(c.bind(c,35544));return a()}default:return[]}}async function g(a,b,f,g){switch(b){case d._:{let{internalCallTool:b}=await Promise.all([c.e(1373),c.e(3736),c.e(9794),c.e(7821),c.e(724),c.e(3823),c.e(4671),c.e(6826),c.e(4771),c.e(7214),c.e(1226),c.e(4265),c.e(5708),c.e(227),c.e(2859)]).then(c.bind(c,42859));return b(a,f,g)}case e.K3:{let{filesystemCallTool:a}=await c.e(8387).then(c.bind(c,18387));return a(f,g)}case e.PA:{let{bashCallTool:a}=await c.e(5544).then(c.bind(c,35544));return a(f,g)}default:return{content:[{type:"text",text:`Unknown built-in server: ${b}`}],isError:!0}}}}};
@@ -0,0 +1,5 @@
1
+ "use strict";exports.id=5544,exports.ids=[5544],exports.modules={3233:(a,b,c)=>{c.d(b,{g:()=>f});var d=c(79646);let e=(0,c(50846).h)("utils/process/killProcessTree");function f(a,b=2e3){let c=a.pid;if(void 0===c)return()=>{};if("win32"===process.platform){try{(0,d.spawn)("taskkill",["/pid",String(c),"/T","/F"]).on("error",a=>e.debug(`taskkill failed for pid ${c}: ${a.message}`))}catch(a){e.debug(`taskkill spawn threw for pid ${c}: ${a instanceof Error?a.message:String(a)}`)}return()=>{}}try{process.kill(-c,"SIGTERM")}catch{}let g=setTimeout(()=>{try{process.kill(-c,"SIGKILL")}catch{}},b);return g.unref?.(),()=>clearTimeout(g)}},35544:(a,b,c)=>{c.d(b,{bashCallTool:()=>w,bashToolDefinitions:()=>q});var d=c(33873),e=c.n(d),f=c(79646),g=c(3233),h=c(50846),i=c(43326);let j=(0,h.h)("backend/services/mcp/internal/bashTools");function k(){return global.__flujo_bash_sessions||(global.__flujo_bash_sessions=new Map),global.__flujo_bash_sessions}function l(a,b=!1){return{content:[{type:"text",text:"string"==typeof a?a:JSON.stringify(a,null,2)}],...b?{isError:!0}:{}}}function m(a){let b=(0,i.ok)(),c="string"==typeof a?a.trim():"";return c?e().isAbsolute(c)?c:e().join(b,c):b}function n(a){return"pwsh"===a||"bash"===a?a:"default"}function o(a,b,c){let{file:d,args:e,useShell:g}="pwsh"===c?{file:"win32"===process.platform?"pwsh.exe":"pwsh",args:["-NoProfile","-NonInteractive","-Command",a],useShell:!1}:"bash"===c?{file:"bash",args:["-c",a],useShell:!1}:{file:a,args:[],useShell:!0},h="win32"!==process.platform;try{return{child:(0,f.spawn)(d,e,{cwd:b,shell:g,env:process.env,detached:h})}}catch(a){return{child:void 0,startError:a instanceof Error?a.message:String(a)}}}function p(a,b){return c=>{let d=a();if(d.length>=1e5)return;let e=!1;(d+=c).length>1e5&&(d=d.slice(0,1e5)+"\n…[output truncated]",e=!0),b(d,e)}}function q(){let a={type:"string",enum:["default","pwsh","bash"],description:'Which shell to use: "default" (the OS shell), "pwsh" (PowerShell 7+), or "bash". Falls back to the default shell if the requested one is unavailable.'},b={type:"string",description:"Working directory. Relative paths resolve against the FLUJO data directory. Defaults to the data directory."};return[{name:"run",description:"Run a shell command to completion and return combined stdout/stderr plus the exit code. Pipes and chained commands work. Killed if it exceeds the timeout; large output is truncated. Returns { exitCode, cwd, shell, output, timedOut }.",inputSchema:{type:"object",properties:{command:{type:"string",description:'The command line to execute, e.g. "grep -r foo ." or "curl -s https://…".'},cwd:b,shell:a,timeout:{type:"number",description:"Timeout in seconds (default 60, max 600)."},normalizeNewlines:{type:"boolean",description:"If true, CRLF/CR in the captured output are normalized to LF."}},required:["command"]}},{name:"start",description:"Start a command in the BACKGROUND and return immediately with a { sessionId }. Use status/wait to observe it, write_stdin to feed it input, and kill to stop it.",inputSchema:{type:"object",properties:{command:{type:"string",description:"The command line to execute in the background."},cwd:b,shell:a},required:["command"]}},{name:"status",description:"Return the current state of a background session: { sessionId, running, exitCode, output, truncated }.",inputSchema:{type:"object",properties:{sessionId:{type:"string",description:"The id returned by start."}},required:["sessionId"]}},{name:"wait",description:"Wait until a background session finishes (or the timeout elapses). Returns { sessionId, running, exitCode, output, truncated, timedOut }.",inputSchema:{type:"object",properties:{sessionId:{type:"string",description:"The id returned by start."},timeout:{type:"number",description:"Max seconds to wait (default 60, max 600)."}},required:["sessionId"]}},{name:"write_stdin",description:'Write a string to a running background session\'s stdin. Pass "newline": false to omit the trailing newline. Returns { sessionId, written }.',inputSchema:{type:"object",properties:{sessionId:{type:"string",description:"The id returned by start."},data:{type:"string",description:"Text to write to stdin."},newline:{type:"boolean",description:"Append a trailing newline (default true)."}},required:["sessionId","data"]}},{name:"kill",description:"Kill a background session (and its whole process tree). Returns { sessionId, killed }.",inputSchema:{type:"object",properties:{sessionId:{type:"string",description:"The id returned by start."}},required:["sessionId"]}},{name:"list_sessions",description:"List all known background sessions with their state. Returns { sessions: [{ sessionId, command, running, exitCode, startedAt, endedAt }] }.",inputSchema:{type:"object",properties:{}}}]}function r(a,b){return b?a.replace(/\r\n?/g,"\n"):a}async function s(a){let b=String(a?.command??"").trim();if(!b)return l({error:'Provide "command": a shell command line to run.'},!0);let c=m(a.cwd),d=n(a.shell),e=!0===a.normalizeNewlines,f=Math.min(1e3*("number"==typeof a.timeout&&a.timeout>0?a.timeout:60),6e5);return await new Promise(a=>{let h,i="",j=!1,k=!1,m=!1,n=p(()=>i,(a,b)=>{i=a,j=b||j}),{child:q,startError:s}=o(b,c,d);if(s||!q)return void a(l({error:`Failed to start command (${d}): ${s??"unknown error"}`,cwd:c,shell:d},!0));let t=setTimeout(()=>{m=!0,h=(0,g.g)(q)},f),u=b=>{k||(k=!0,clearTimeout(t),h?.(),a(b))};q.stdout?.on("data",a=>n(a.toString())),q.stderr?.on("data",a=>n(a.toString())),q.on("error",a=>{n(`
2
+ ${a.message}`),u(l({error:`Command failed to start (${d}): ${a.message}`,cwd:c,shell:d,output:r(i,e)},!0))}),q.on("close",a=>{let b=r(i,e);if(m)return void u(l({timedOut:!0,cwd:c,shell:d,exitCode:a,truncated:j,output:`${b}
3
+ [killed after ${f/1e3}s timeout]`},!0));u(l({exitCode:a,cwd:c,shell:d,truncated:j,output:b},0!==a))})})}function t(a){a.reapTimer=setTimeout(()=>{k().delete(a.id)},6e5),a.reapTimer.unref?.()}function u(a,b={}){return{sessionId:a.id,running:a.running,exitCode:a.exitCode,output:a.output,truncated:a.truncated,...b}}async function v(a){let b=String(a?.sessionId??""),c=k().get(b);if(!c)return l({error:`No background session with id "${b}".`},!0);if(!c.running)return l(u(c,{timedOut:!1}));let d=Math.min(1e3*("number"==typeof a.timeout&&a.timeout>0?a.timeout:60),6e5),e=await new Promise(a=>{let b=Date.now(),e=()=>c.running?Date.now()-b>=d?a(!0):void setTimeout(e,100):a(!1);e()});return l(u(c,{timedOut:e}))}async function w(a,b){try{switch(a){case"run":return await s(b);case"start":return function(a){let b=String(a?.command??"").trim();if(!b)return l({error:'Provide "command": a shell command line to run.'},!0);let c=k();if(c.size>=25)for(let[a,b]of c)b.running||c.delete(a);if(c.size>=25)return l({error:"Too many active background sessions (max 25). Kill some first."},!0);!function(){if(global.__flujo_bash_cleanup_registered)return;global.__flujo_bash_cleanup_registered=!0;let a=()=>(function(){for(let a of k().values()){if(a.running)try{(0,g.g)(a.child)}catch{}a.reapTimer&&clearTimeout(a.reapTimer)}})();process.on("exit",a),process.on("SIGINT",a),process.on("SIGTERM",a)}();let d=m(a.cwd),e=n(a.shell),{child:f,startError:h}=o(b,d,e);if(h||!f)return l({error:`Failed to start command (${e}): ${h??"unknown error"}`,cwd:d,shell:e},!0);let i=`bash-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,j={id:i,command:b,cwd:d,child:f,output:"",truncated:!1,running:!0,exitCode:null,startedAt:Date.now()};c.set(i,j);let q=p(()=>j.output,(a,b)=>{j.output=a,j.truncated=b||j.truncated});return f.stdout?.on("data",a=>q(a.toString())),f.stderr?.on("data",a=>q(a.toString())),f.on("error",a=>{q(`
4
+ ${a.message}`),j.running=!1,j.endedAt=Date.now(),t(j)}),f.on("close",a=>{j.running=!1,j.exitCode=a,j.endedAt=Date.now(),t(j)}),l({sessionId:i,cwd:d,shell:e})}(b);case"status":let c=String(b?.sessionId??""),d=k().get(c);return d?l(u(d)):l({error:`No background session with id "${c}".`},!0);case"wait":return await v(b);case"write_stdin":let e=String(b?.sessionId??""),f=k().get(e);if(!f)return l({error:`No background session with id "${e}".`},!0);if(!f.running)return l({error:`Session "${e}" has already exited.`},!0);let h="string"==typeof b.data?b.data:"",i=!1===b.newline?h:`${h}
5
+ `;try{f.child.stdin?.write(i)}catch(a){return l({error:`Failed to write to stdin: ${a instanceof Error?a.message:String(a)}`},!0)}return l({sessionId:e,written:Buffer.byteLength(i,"utf8")});case"kill":let j=String(b?.sessionId??""),q=k().get(j);return q?(q.running&&(q.cancelEscalation=(0,g.g)(q.child)),l({sessionId:j,killed:!0})):l({error:`No background session with id "${j}".`},!0);case"list_sessions":return l({sessions:Array.from(k().values()).map(a=>({sessionId:a.id,command:a.command,running:a.running,exitCode:a.exitCode,startedAt:new Date(a.startedAt).toISOString(),endedAt:a.endedAt?new Date(a.endedAt).toISOString():void 0}))});default:return l({error:`Unknown tool on the built-in bash server: ${a}`},!0)}}catch(b){return j.warn("bashCallTool failed",{toolName:a,err:b}),l({error:`Tool failed: ${b instanceof Error?b.message:String(b)}`},!0)}}}};
@@ -12,7 +12,7 @@ NODE TYPES:
12
12
  "model": "<model id or name from the catalog>",
13
13
  "prompt": "instructions for this step",
14
14
  "servers": [ { "name": "<server name>", "tools": ["tool_a"] } ], // optional; omit "tools" to enable all
15
- "inputMode": "full-history" | "latest-message" | "isolated", // optional, default full-history
15
+ "inputMode": "full-history" | "latest-message" | "isolated", // optional, default full-history. Reshapes ONLY the wire view the model sees (persisted history stays lossless): full-history = the whole assembled context; latest-message = leading system prompt(s) + everything FROM the most recent user message ONWARD (NOT "last user + last assistant"), INCLUDING this turn's in-flight tool calls/results; isolated = system prompt(s) + isolatedPrompt as a synthetic user message, prior conversation dropped. NOTE: for Claude-subscription models the whole wire history (incl. prior tool calls/results under full-history) is flattened into one text prompt rather than sent as native tool turns
16
16
  "isolatedPrompt": "...", // only with inputMode "isolated"
17
17
  "outputMode": "full-conversation" | "latest-message", // optional, default full-conversation; latest-message hides this step's tool calls/results from later steps (they see only its final response)
18
18
  "maxTurns": 20, // optional; per-step cap on agentic tool-loop turns (retry-until-done in ONE node). Unset = model/system default (50)
@@ -32,12 +32,13 @@ NODE TYPES:
32
32
  "mapOverList": true | false, // optional; run the SINGLE child ("flow"/"subflowSpec") ONCE PER ITEM parsed from the input; mutually exclusive with parallelFlows/parallelSubflowSpecs
33
33
  "itemSplit": "json-array" | "lines", // optional (mapOverList only), how to split the input into items, default json-array
34
34
  "sequential": true | false, // optional (mapOverList only), run items one at a time in order instead of concurrently, default false
35
- "concurrencyLimit": 4, // optional (parallel / mapOverList), default 4
36
- "joinSeparator": "\\n\\n---\\n\\n", // optional (parallel / mapOverList), string between joined lane outputs, default "\\n\\n"
37
- "errorStrategy": "collect-all" | "fail-fast", // optional (parallel / mapOverList), default collect-all
38
- "inputMode": "full-history" | "latest-message" | "isolated",
35
+ "spawnBriefs": ["brief 1", "brief 2"], // optional (rule 7d); run the SINGLE child once PER BRIEF, in parallel — the author-defined spawn set; mutually exclusive with parallelFlows/parallelSubflowSpecs/mapOverList
36
+ "concurrencyLimit": 4, // optional (parallel / mapOverList / spawn), default 4
37
+ "joinSeparator": "\\n\\n---\\n\\n", // optional (parallel / mapOverList / spawn), string between joined lane outputs, default "\\n\\n"
38
+ "errorStrategy": "collect-all" | "fail-fast", // optional (parallel / mapOverList / spawn), default collect-all
39
+ "inputMode": "full-history" | "latest-message" | "isolated", // optional, default full-history. DIFFERS from a process node: history modes ALWAYS sanitize the parent transcript first — system messages, tool-result messages, and ANY assistant turn that made tool calls are dropped (only user + prose-only assistant messages survive). full-history = the full sanitized transcript; latest-message = the sanitized transcript FROM the most recent user message ONWARD (NOT "last user + last assistant"); isolated = ignore the parent conversation and send "prompt" as the child's single user message
39
40
  "allowCallerPrompt": true | false, // optional, only with inputMode "isolated"; when true a routing step may pass a "prompt" via its handoff tool that overrides the subflow's "prompt" (default)
40
- "allowCallerFanout": true | false, // optional (subflow); when true a routing step may pass a "parallelFlows" array (+ optional "concurrencyLimit") via its handoff tool to CHOOSE the parallel fan-out set at runtime (rule 7c)
41
+ "allowCallerFanout": true | false, // optional (subflow); makes this a SPAWNABLE sub-agent: the routing step may call its handoff tool SEVERAL TIMES in one turn, each call with a "task" brief spawning one parallel instance of the child flow (rule 7c)
41
42
  "captureVariable": "NAME", // optional; save the subflow's output into a run variable other steps inject with \${var:NAME}
42
43
  "captureResource": "NAME", // optional; ALSO save the subflow's output as a tracked run resource (\${res:NAME}, rule 9b)
43
44
  "captureKv": "NAME", // optional; ALSO save the subflow's output to a PERSISTENT cross-run key (\${kv:NAME}, rule 9d)
@@ -65,11 +66,13 @@ RULES:
65
66
  6. A subflow node may have only ONE outgoing edge. Give it EITHER a "flow" (naming an existing flow) OR a "subflowSpec" (an inline nested FlowSpec that becomes its own child flow) — not both. A "subflowSpec" may itself contain subflow nodes with their own "subflowSpec" (bounded nesting), so you can author whole multi-level flows in one object.
66
67
  7. A subflow node may instead fan out to SEVERAL child flows CONCURRENTLY via "parallelFlows" (existing flows) or "parallelSubflowSpecs" (inline). These are STATIC (fixed at author time): the same input is sent to every lane and their outputs are joined. This is about multiple CHILDREN, not successors — the single-outgoing-edge rule (rule 6) still holds. Prefer "parallelFlows" for large fan-outs.
67
68
  7b. For DYNAMIC fan-out — when the set of target flows should be decided AT RUNTIME by an earlier step — use "parallelFlowsVariable": "NAME". An upstream process/subflow node captures a JSON array of flow ids/names (or a newline list) into run variable NAME via "captureVariable": "NAME"; this subflow node then fans out over exactly those flows. Unknown ids and a self-reference are dropped, the count is capped, and a non-empty resolution overrides any static "parallelFlows" (empty falls back to it). Mutually exclusive with "mapOverList". Still one outgoing edge (rule 6).
68
- 7c. For AGENTIC fan-out — when the ROUTING MODEL itself should decide the parallel set at the very moment it hands off — set "allowCallerFanout": true on the target subflow node. Its handoff tool then exposes an optional "parallelFlows" (array of flow ids/names) argument plus an optional "concurrencyLimit"; the model passes them at call time to fan out over exactly those flows. A non-empty caller set overrides "parallelFlows"/"parallelFlowsVariable"; unknown ids and a self-reference are dropped and the count is capped. Mutually exclusive with "mapOverList". Still one outgoing edge (rule 6). Prefer 7b's "parallelFlowsVariable" when an EARLIER step computes the set; use 7c when the DECIDING (routing) step is the one that chooses it.
69
+ 7c. For AGENTIC spawning — when the ROUTING MODEL itself should split the work at the very moment it hands off — set "allowCallerFanout": true on the target subflow node. This makes it a SPAWNABLE sub-agent: its handoff tool gains an optional "task" (string) argument and the routing model may call the tool SEVERAL TIMES IN ONE TURN, each call spawning one parallel instance of the child flow briefed with that call's "task". All instances run concurrently, their outputs are joined in call order, and the flow continues once every instance finishes. A call with no "task" is a plain single handoff. Caller briefs override "spawnBriefs"/"parallelFlows"/"parallelFlowsVariable"; the count is capped. Mutually exclusive with "mapOverList". Still one outgoing edge (rule 6). Use 7c when the deciding (routing) step should choose how to split the work; use 7d's "spawnBriefs" when the AUTHOR fixes the briefs; use 7b when an earlier step computes a set of DIFFERENT flows.
70
+ 7d. For AUTHOR-DEFINED spawning — a fixed set of parallel briefs for ONE sub-agent — give the subflow node "spawnBriefs": ["...", "..."]. Every visit runs the single child once per brief, concurrently (same pool/tuning as parallel). Each brief may inject \${var:NAME}/\${res:NAME}/\${kv:NAME}. With inputMode "isolated" the brief is the lane's whole prompt; with history modes each lane sees the conversation plus its brief as the closing instruction. Mutually exclusive with "parallelFlows"/"parallelSubflowSpecs"/"mapOverList"; needs a single child ("flow"/"subflowSpec").
69
71
  8. A subflow node may instead run its SINGLE child flow ONCE PER ITEM via "mapOverList": true. The input is split into items by "itemSplit" ("json-array" default, or "lines"), each item is sent to its own child run, and the per-item outputs are joined (same pool/tuning as parallel). Use "sequential": true to run items in order. Mutually exclusive with "parallelFlows"/"parallelSubflowSpecs".
70
72
  9. Named variables (scratchpad): a step can save its output with "captureVariable": "NAME" (process or subflow) and any LATER step injects it with \${var:NAME} inside its "prompt" / "isolatedPrompt" / subflow prompt. This survives "latest-message"/"isolated" scoping, unlike conversation history — use it to carry a todo list, a file path, a diff, or a captured result across steps that don't share history. \${var:NAME} is run-scoped and plaintext; it is DISTINCT from \${global:VAR} (configured secrets/config, resolved only for tool args). Capture a subflow's output on the PARENT subflow node — a variable set inside a child flow is not visible to the parent.
71
73
  9b. Run resources (tracked data): "captureResource": "NAME" (process or subflow) ALSO saves the step's output as a run-scoped RESOURCE — an addressable artifact (flujo://run/... URI) with lineage (which step produced it, which steps read it), readable via the built-in "flujo" MCP server. A later step injects it with \${res:NAME} exactly like \${var:NAME}. Prefer "captureVariable" for short strings; use "captureResource" when the output is a large document/report/dataset worth tracking, or when other tools/agents should be able to read it back. Large or binary MCP tool results (screenshots, files) are auto-captured as run resources without any spec field.
72
74
  9c. Resource nodes are OPTIONAL/advanced — most flows should not use them; prefer rule 9b's captureResource/\${res:NAME}. Emit one only when the data artifact itself should be VISIBLE in the graph: an edge resource→process means the step READS the artifact (its contents are injected into the step's context); process→resource means the step's output is SAVED to it (run artifacts only, equivalent to captureResource with the node's runName). Resource edges are data wiring, not flow control — they never carry conditions and don't count as a step's successor.
73
75
  9d. Persistent state (cross-run): "captureKv": "NAME" (process or subflow) saves the step's output to a PERSISTENT key-value store that SURVIVES ACROSS RUNS, injected by any step with \${kv:NAME}. Unlike \${var:} / \${res:} (discarded when the run ends), \${kv:} is what a long-lived SCHEDULED flow uses to carry a loop counter, a pagination cursor, a last-seen id, or a flag to its NEXT run. By default a key lives on the flow's FOLDER board (flows in the same folder share it); prefix the name to change scope: "flow/NAME" (this flow only) or "global/NAME" (whole instance). Plaintext, never secrets (distinct from \${global:VAR}). A model can also read/update a key mid-run via the built-in "flujo" server's kv_get / kv_set tools.
74
76
  10. Keep flows minimal — only the steps the task needs. Write clear, specific prompts and labels; fill "description" on process nodes.
75
- 11. Signals (fire-and-forget events): a "signal" node is a deterministic pass-through that, when the path reaches it, emits an event {topic, payload} onto the flow-run event bus and then continues to its successor unchanged (it never calls a model or touches the conversation). Use it when the flow should notify or kick off ANOTHER flow mid-run — a flow-event trigger configured elsewhere listens for the same "topic" (e.g. "when the review finds blockers, emit a review-blocked signal"). Always give it a "topic" (a signal with no topic emits nothing); "payloadTemplate" is the optional event body and may inject \${var:NAME}. Make emission conditional by putting a conditioned edge (rule 5b) INTO the signal node.`}};
77
+ 11. Signals (fire-and-forget events): a "signal" node is a deterministic pass-through that, when the path reaches it, emits an event {topic, payload} onto the flow-run event bus and then continues to its successor unchanged (it never calls a model or touches the conversation). Use it when the flow should notify or kick off ANOTHER flow mid-run — a flow-event trigger configured elsewhere listens for the same "topic" (e.g. "when the review finds blockers, emit a review-blocked signal"). Always give it a "topic" (a signal with no topic emits nothing); "payloadTemplate" is the optional event body and may inject \${var:NAME}. Make emission conditional by putting a conditioned edge (rule 5b) INTO the signal node.
78
+ 12. Input vs output modes are two DISTINCT axes whose value names differ per node type (issue #152 clarification). inputMode ("full-history" | "latest-message" | "isolated") controls what a step RECEIVES and exists on BOTH process and subflow nodes, but they behave differently: a process node keeps the current turn's tool calls/results, while a subflow node ALWAYS strips system/tool-result/tool-call turns from the parent transcript in every history mode (see the inputMode notes above). "latest-message" means "from the most recent user message onward", NOT "last user + last assistant". outputMode controls what LATER steps see of a step's work and is a SEPARATE enum per node type: a process node uses "full-conversation" | "latest-message" (latest-message hides this step's tool exchange from later steps), a subflow node uses "steps" | "final-only" (live-view folding only). Common word traps: "last-message" = inputMode latest-message; "full-conversation" is a process outputMode value, NOT an input mode. A subflow's final answer is always injected back into the parent transcript regardless of outputMode.`}};
@@ -0,0 +1 @@
1
+ "use strict";exports.id=584,exports.ids=[584],exports.modules={22042:(a,b,c)=>{c.d(b,{A:()=>Q});var d=c(38301),e=c(43249),f=c(2783),g=c(38404),h=c(94633),i=c(18168),j=c(60839),k=c(68333),l=c(6636),m=c(74907);function n(a){return(1+Math.sin(Math.PI*a-Math.PI/2))/2}var o=c(14758),p=c(5141),q=c(21124);let r={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};var s=c(27080);let t=(0,s.A)((0,q.jsx)("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),u=(0,s.A)((0,q.jsx)("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight");var v=c(14328),w=c(29565),x=c(33105);function y(a){return(0,x.Ay)("MuiTabScrollButton",a)}let z=(0,w.A)("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),A=(0,i.Ay)(v.A,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(a,b)=>{let{ownerState:c}=a;return[b.root,c.orientation&&b[c.orientation]]}})({width:40,flexShrink:0,opacity:.8,[`&.${z.disabled}`]:{opacity:0},variants:[{props:{orientation:"vertical"},style:{width:"100%",height:40,"& svg":{transform:"var(--TabScrollButton-svgRotate)"}}}]}),B=d.forwardRef(function(a,b){let c=(0,l.b)({props:a,name:"MuiTabScrollButton"}),{className:d,slots:i={},slotProps:j={},direction:k,orientation:m,disabled:n,...o}=c,p=(0,g.I)(),r={isRtl:p,...c},s=(a=>{let{classes:b,orientation:c,disabled:d}=a;return(0,f.A)({root:["root",c,d&&"disabled"]},y,b)})(r),v=i.StartScrollButtonIcon??t,w=i.EndScrollButtonIcon??u,x=(0,h.A)({elementType:v,externalSlotProps:j.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:r}),z=(0,h.A)({elementType:w,externalSlotProps:j.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:r});return(0,q.jsx)(A,{component:"div",className:(0,e.A)(s.root,d),ref:b,role:null,ownerState:r,tabIndex:null,...o,style:{...o.style,..."vertical"===m&&{"--TabScrollButton-svgRotate":`rotate(${p?-90:90}deg)`}},children:"left"===k?(0,q.jsx)(v,{...x}):(0,q.jsx)(w,{...z})})});var C=c(87974);function D(a){return(0,x.Ay)("MuiTabs",a)}let E=(0,w.A)("MuiTabs",["root","vertical","list","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]);var F=c(97896),G=c(20385);let H=(a,b)=>a===b?a.firstChild:b&&b.nextElementSibling?b.nextElementSibling:a.firstChild,I=(a,b)=>a===b?a.lastChild:b&&b.previousElementSibling?b.previousElementSibling:a.lastChild,J=(a,b,c)=>{let d=!1,e=c(a,b);for(;e;){if(e===a.firstChild){if(d)return;d=!0}let b=e.disabled||"true"===e.getAttribute("aria-disabled");if(e.hasAttribute("tabindex")&&!b)return void e.focus();e=c(a,e)}},K=(0,i.Ay)("div",{name:"MuiTabs",slot:"Root",overridesResolver:(a,b)=>{let{ownerState:c}=a;return[{[`& .${E.scrollButtons}`]:b.scrollButtons},{[`& .${E.scrollButtons}`]:c.scrollButtonsHideMobile&&b.scrollButtonsHideMobile},b.root,c.vertical&&b.vertical]}})((0,k.A)(({theme:a})=>({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex",variants:[{props:({ownerState:a})=>a.vertical,style:{flexDirection:"column"}},{props:({ownerState:a})=>a.scrollButtonsHideMobile,style:{[`& .${E.scrollButtons}`]:{[a.breakpoints.down("sm")]:{display:"none"}}}}]}))),L=(0,i.Ay)("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(a,b)=>{let{ownerState:c}=a;return[b.scroller,c.fixed&&b.fixed,c.hideScrollbar&&b.hideScrollbar,c.scrollableX&&b.scrollableX,c.scrollableY&&b.scrollableY]}})({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap",variants:[{props:({ownerState:a})=>a.fixed,style:{overflowX:"hidden",width:"100%"}},{props:({ownerState:a})=>a.hideScrollbar,style:{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}},{props:({ownerState:a})=>a.scrollableX,style:{overflowX:"auto",overflowY:"hidden"}},{props:({ownerState:a})=>a.scrollableY,style:{overflowY:"auto",overflowX:"hidden"}}]}),M=(0,i.Ay)("div",{name:"MuiTabs",slot:"List",overridesResolver:(a,b)=>{let{ownerState:c}=a;return[b.list,b.flexContainer,c.vertical&&b.flexContainerVertical,c.centered&&b.centered]}})({display:"flex",variants:[{props:({ownerState:a})=>a.vertical,style:{flexDirection:"column"}},{props:({ownerState:a})=>a.centered,style:{justifyContent:"center"}}]}),N=(0,i.Ay)("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(a,b)=>b.indicator})((0,k.A)(({theme:a})=>({position:"absolute",height:2,bottom:0,width:"100%",transition:a.transitions.create(),variants:[{props:{indicatorColor:"primary"},style:{backgroundColor:(a.vars||a).palette.primary.main}},{props:{indicatorColor:"secondary"},style:{backgroundColor:(a.vars||a).palette.secondary.main}},{props:({ownerState:a})=>a.vertical,style:{height:"100%",width:2,right:0}}]}))),O=(0,i.Ay)(function(a){let{onChange:b,...c}=a,e=d.useRef(),f=d.useRef(null),g=()=>{e.current=f.current.offsetHeight-f.current.clientHeight};return(0,o.A)(()=>{let a=(0,m.A)(()=>{let a=e.current;g(),a!==e.current&&b(e.current)}),c=(0,p.A)(f.current);return c.addEventListener("resize",a),()=>{a.clear(),c.removeEventListener("resize",a)}},[b]),d.useEffect(()=>{g(),b(e.current)},[b]),(0,q.jsx)("div",{style:r,...c,ref:f})})({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),P={},Q=d.forwardRef(function(a,b){let c=(0,l.b)({props:a,name:"MuiTabs"}),i=(0,j.A)(),k=(0,g.I)(),{"aria-label":o,"aria-labelledby":r,action:s,centered:t=!1,children:u,className:v,component:w="div",allowScrollButtonsMobile:x=!1,indicatorColor:y="primary",onChange:z,orientation:A="horizontal",ScrollButtonComponent:E,scrollButtons:Q="auto",selectionFollowsFocus:R,slots:S={},slotProps:T={},TabIndicatorProps:U={},TabScrollButtonProps:V={},textColor:W="primary",value:X,variant:Y="standard",visibleScrollbar:Z=!1,...$}=c,_="scrollable"===Y,aa="vertical"===A,ab=aa?"scrollTop":"scrollLeft",ac=aa?"top":"left",ad=aa?"bottom":"right",ae=aa?"clientHeight":"clientWidth",af=aa?"height":"width",ag={...c,component:w,allowScrollButtonsMobile:x,indicatorColor:y,orientation:A,vertical:aa,scrollButtons:Q,textColor:W,variant:Y,visibleScrollbar:Z,fixed:!_,hideScrollbar:_&&!Z,scrollableX:_&&!aa,scrollableY:_&&aa,centered:t&&!_,scrollButtonsHideMobile:!x},ah=(a=>{let{vertical:b,fixed:c,hideScrollbar:d,scrollableX:e,scrollableY:g,centered:h,scrollButtonsHideMobile:i,classes:j}=a;return(0,f.A)({root:["root",b&&"vertical"],scroller:["scroller",c&&"fixed",d&&"hideScrollbar",e&&"scrollableX",g&&"scrollableY"],list:["list","flexContainer",b&&"flexContainerVertical",b&&"vertical",h&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",i&&"scrollButtonsHideMobile"],scrollableX:[e&&"scrollableX"],hideScrollbar:[d&&"hideScrollbar"]},D,j)})(ag),ai=(0,h.A)({elementType:S.StartScrollButtonIcon,externalSlotProps:T.startScrollButtonIcon,ownerState:ag}),aj=(0,h.A)({elementType:S.EndScrollButtonIcon,externalSlotProps:T.endScrollButtonIcon,ownerState:ag}),[ak,al]=d.useState(!1),[am,an]=d.useState(P),[ao,ap]=d.useState(!1),[aq,ar]=d.useState(!1),[as,at]=d.useState(!1),[au,av]=d.useState({overflow:"hidden",scrollbarWidth:0}),aw=new Map,ax=d.useRef(null),ay=d.useRef(null),az={slots:S,slotProps:{indicator:U,scrollButton:V,...T}},aA=()=>{let a,b,c=ax.current;if(c){let b=c.getBoundingClientRect();a={clientWidth:c.clientWidth,scrollLeft:c.scrollLeft,scrollTop:c.scrollTop,scrollWidth:c.scrollWidth,top:b.top,bottom:b.bottom,left:b.left,right:b.right}}if(c&&!1!==X){let a=ay.current.children;if(a.length>0){let c=a[aw.get(X)];b=c?c.getBoundingClientRect():null}}return{tabsMeta:a,tabMeta:b}},aB=(0,C.A)(()=>{let a,{tabsMeta:b,tabMeta:c}=aA(),d=0;aa?(a="top",c&&b&&(d=c.top-b.top+b.scrollTop)):(a=k?"right":"left",c&&b&&(d=(k?-1:1)*(c[a]-b[a]+b.scrollLeft)));let e={[a]:d,[af]:c?c[af]:0};if("number"!=typeof am[a]||"number"!=typeof am[af])an(e);else{let b=Math.abs(am[a]-e[a]),c=Math.abs(am[af]-e[af]);(b>=1||c>=1)&&an(e)}}),aC=(a,{animation:b=!0}={})=>{b?function(a,b,c,d={},e=()=>{}){let{ease:f=n,duration:g=300}=d,h=null,i=b[a],j=!1,k=d=>{if(j)return void e(Error("Animation cancelled"));null===h&&(h=d);let l=Math.min(1,(d-h)/g);if(b[a]=f(l)*(c-i)+i,l>=1)return void requestAnimationFrame(()=>{e(null)});requestAnimationFrame(k)};i===c?e(Error("Element already at target position")):requestAnimationFrame(k)}(ab,ax.current,a,{duration:i.transitions.duration.standard}):ax.current[ab]=a},aD=a=>{let b=ax.current[ab];aa?b+=a:b+=a*(k?-1:1),aC(b)},aE=()=>{let a=ax.current[ae],b=0,c=Array.from(ay.current.children);for(let d=0;d<c.length;d+=1){let e=c[d];if(b+e[ae]>a){0===d&&(b=a);break}b+=e[ae]}return b},aF=()=>{aD(-1*aE())},aG=()=>{aD(aE())},[aH,{onChange:aI,...aJ}]=(0,G.A)("scrollbar",{className:(0,e.A)(ah.scrollableX,ah.hideScrollbar),elementType:O,shouldForwardComponentProp:!0,externalForwardedProps:az,ownerState:ag}),aK=d.useCallback(a=>{aI?.(a),av({overflow:null,scrollbarWidth:a})},[aI]),[aL,aM]=(0,G.A)("scrollButtons",{className:(0,e.A)(ah.scrollButtons,V.className),elementType:B,externalForwardedProps:az,ownerState:ag,additionalProps:{orientation:A,slots:{StartScrollButtonIcon:S.startScrollButtonIcon||S.StartScrollButtonIcon,EndScrollButtonIcon:S.endScrollButtonIcon||S.EndScrollButtonIcon},slotProps:{startScrollButtonIcon:ai,endScrollButtonIcon:aj}}}),aN=(0,C.A)(a=>{let{tabsMeta:b,tabMeta:c}=aA();c&&b&&(c[ac]<b[ac]?aC(b[ab]+(c[ac]-b[ac]),{animation:a}):c[ad]>b[ad]&&aC(b[ab]+(c[ad]-b[ad]),{animation:a}))}),aO=(0,C.A)(()=>{_&&!1!==Q&&at(!as)});d.useEffect(()=>{let a,b,c=(0,m.A)(()=>{ax.current&&aB()}),d=(0,p.A)(ax.current);return d.addEventListener("resize",c),"undefined"!=typeof ResizeObserver&&(a=new ResizeObserver(c),Array.from(ay.current.children).forEach(b=>{a.observe(b)})),"undefined"!=typeof MutationObserver&&(b=new MutationObserver(b=>{b.forEach(b=>{b.removedNodes.forEach(b=>{a?.unobserve(b)}),b.addedNodes.forEach(b=>{a?.observe(b)})}),c(),aO()})).observe(ay.current,{childList:!0}),()=>{c.clear(),d.removeEventListener("resize",c),b?.disconnect(),a?.disconnect()}},[aB,aO]),d.useEffect(()=>{let a=Array.from(ay.current.children),b=a.length;if("undefined"!=typeof IntersectionObserver&&b>0&&_&&!1!==Q){let c=a[0],d=a[b-1],e={root:ax.current,threshold:.99},f=new IntersectionObserver(a=>{ap(!a[0].isIntersecting)},e);f.observe(c);let g=new IntersectionObserver(a=>{ar(!a[0].isIntersecting)},e);return g.observe(d),()=>{f.disconnect(),g.disconnect()}}},[_,Q,as,u?.length]),d.useEffect(()=>{al(!0)},[]),d.useEffect(()=>{aB()}),d.useEffect(()=>{aN(P!==am)},[aN,am]),d.useImperativeHandle(s,()=>({updateIndicator:aB,updateScrollButtons:aO}),[aB,aO]);let[aP,aQ]=(0,G.A)("indicator",{className:(0,e.A)(ah.indicator,U.className),elementType:N,externalForwardedProps:az,ownerState:ag,additionalProps:{style:am}}),aR=(0,q.jsx)(aP,{...aQ}),aS=0,aT=d.Children.map(u,a=>{if(!d.isValidElement(a))return null;let b=void 0===a.props.value?aS:a.props.value;aw.set(b,aS);let c=b===X;return aS+=1,d.cloneElement(a,{fullWidth:"fullWidth"===Y,indicator:c&&!ak&&aR,selected:c,selectionFollowsFocus:R,onChange:z,textColor:W,value:b,...1===aS&&!1===X&&!a.props.tabIndex?{tabIndex:0}:{}})}),aU=(()=>{let a={};a.scrollbarSizeListener=_?(0,q.jsx)(aH,{...aJ,onChange:aK}):null;let b=_&&("auto"===Q&&(ao||aq)||!0===Q);return a.scrollButtonStart=b?(0,q.jsx)(aL,{direction:k?"right":"left",onClick:aF,disabled:!ao,...aM}):null,a.scrollButtonEnd=b?(0,q.jsx)(aL,{direction:k?"left":"right",onClick:aG,disabled:!aq,...aM}):null,a})(),[aV,aW]=(0,G.A)("root",{ref:b,className:(0,e.A)(ah.root,v),elementType:K,externalForwardedProps:{...az,...$,component:w},ownerState:ag}),[aX,aY]=(0,G.A)("scroller",{ref:ax,className:ah.scroller,elementType:L,externalForwardedProps:az,ownerState:ag,additionalProps:{style:{overflow:au.overflow,[aa?`margin${k?"Left":"Right"}`:"marginBottom"]:Z?void 0:-au.scrollbarWidth}}}),[aZ,a$]=(0,G.A)("list",{ref:ay,className:(0,e.A)(ah.list,ah.flexContainer),elementType:M,externalForwardedProps:az,ownerState:ag,getSlotProps:a=>({...a,onKeyDown:b=>{(a=>{if(a.altKey||a.shiftKey||a.ctrlKey||a.metaKey)return;let b=ay.current,c=(0,F.A)(b).activeElement;if("tab"!==c.getAttribute("role"))return;let d="horizontal"===A?"ArrowLeft":"ArrowUp",e="horizontal"===A?"ArrowRight":"ArrowDown";switch("horizontal"===A&&k&&(d="ArrowRight",e="ArrowLeft"),a.key){case d:a.preventDefault(),J(b,c,I);break;case e:a.preventDefault(),J(b,c,H);break;case"Home":a.preventDefault(),J(b,null,H);break;case"End":a.preventDefault(),J(b,null,I)}})(b),a.onKeyDown?.(b)}})});return(0,q.jsxs)(aV,{...aW,children:[aU.scrollButtonStart,aU.scrollbarSizeListener,(0,q.jsxs)(aX,{...aY,children:[(0,q.jsx)(aZ,{"aria-label":o,"aria-labelledby":r,"aria-orientation":"vertical"===A?"vertical":null,role:"tablist",...a$,children:aT}),ak&&aR]}),aU.scrollButtonEnd]})})},27409:(a,b,c)=>{c.d(b,{A:()=>f});var d=c(27080),e=c(21124);let f=(0,d.A)((0,e.jsx)("path",{d:"m7 10 5 5 5-5z"}),"ArrowDropDown")},34304:(a,b,c)=>{c.d(b,{A:()=>r});var d=c(38301),e=c(43249),f=c(2783),g=c(14328),h=c(6638),i=c(18168),j=c(68333),k=c(6636),l=c(29565),m=c(33105);function n(a){return(0,m.Ay)("MuiTab",a)}let o=(0,l.A)("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper","icon"]);var p=c(21124);let q=(0,i.Ay)(g.A,{name:"MuiTab",slot:"Root",overridesResolver:(a,b)=>{let{ownerState:c}=a;return[b.root,c.label&&c.icon&&b.labelIcon,b[`textColor${(0,h.A)(c.textColor)}`],c.fullWidth&&b.fullWidth,c.wrapped&&b.wrapped,{[`& .${o.iconWrapper}`]:b.iconWrapper},{[`& .${o.icon}`]:b.icon}]}})((0,j.A)(({theme:a})=>({...a.typography.button,maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center",lineHeight:1.25,variants:[{props:({ownerState:a})=>a.label&&("top"===a.iconPosition||"bottom"===a.iconPosition),style:{flexDirection:"column"}},{props:({ownerState:a})=>a.label&&"top"!==a.iconPosition&&"bottom"!==a.iconPosition,style:{flexDirection:"row"}},{props:({ownerState:a})=>a.icon&&a.label,style:{minHeight:72,paddingTop:9,paddingBottom:9}},{props:({ownerState:a,iconPosition:b})=>a.icon&&a.label&&"top"===b,style:{[`& > .${o.icon}`]:{marginBottom:6}}},{props:({ownerState:a,iconPosition:b})=>a.icon&&a.label&&"bottom"===b,style:{[`& > .${o.icon}`]:{marginTop:6}}},{props:({ownerState:a,iconPosition:b})=>a.icon&&a.label&&"start"===b,style:{[`& > .${o.icon}`]:{marginRight:a.spacing(1)}}},{props:({ownerState:a,iconPosition:b})=>a.icon&&a.label&&"end"===b,style:{[`& > .${o.icon}`]:{marginLeft:a.spacing(1)}}},{props:{textColor:"inherit"},style:{color:"inherit",opacity:.6,[`&.${o.selected}`]:{opacity:1},[`&.${o.disabled}`]:{opacity:(a.vars||a).palette.action.disabledOpacity}}},{props:{textColor:"primary"},style:{color:(a.vars||a).palette.text.secondary,[`&.${o.selected}`]:{color:(a.vars||a).palette.primary.main},[`&.${o.disabled}`]:{color:(a.vars||a).palette.text.disabled}}},{props:{textColor:"secondary"},style:{color:(a.vars||a).palette.text.secondary,[`&.${o.selected}`]:{color:(a.vars||a).palette.secondary.main},[`&.${o.disabled}`]:{color:(a.vars||a).palette.text.disabled}}},{props:({ownerState:a})=>a.fullWidth,style:{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"}},{props:({ownerState:a})=>a.wrapped,style:{fontSize:a.typography.pxToRem(12)}}]}))),r=d.forwardRef(function(a,b){let c=(0,k.b)({props:a,name:"MuiTab"}),{className:g,disabled:i=!1,disableFocusRipple:j=!1,fullWidth:l,icon:m,iconPosition:o="top",indicator:r,label:s,onChange:t,onClick:u,onFocus:v,selected:w,selectionFollowsFocus:x,textColor:y="inherit",value:z,wrapped:A=!1,...B}=c,C={...c,disabled:i,disableFocusRipple:j,selected:w,icon:!!m,iconPosition:o,label:!!s,fullWidth:l,textColor:y,wrapped:A},D=(a=>{let{classes:b,textColor:c,fullWidth:d,wrapped:e,icon:g,label:i,selected:j,disabled:k}=a,l={root:["root",g&&i&&"labelIcon",`textColor${(0,h.A)(c)}`,d&&"fullWidth",e&&"wrapped",j&&"selected",k&&"disabled"],icon:["iconWrapper","icon"]};return(0,f.A)(l,n,b)})(C),E=m&&s&&d.isValidElement(m)?d.cloneElement(m,{className:(0,e.A)(D.icon,m.props.className)}):m;return(0,p.jsxs)(q,{focusRipple:!j,className:(0,e.A)(D.root,g),ref:b,role:"tab","aria-selected":w,disabled:i,onClick:a=>{!w&&t&&t(a,z),u&&u(a)},onFocus:a=>{x&&!w&&t&&t(a,z),v&&v(a)},ownerState:C,tabIndex:w?0:-1,...B,children:["top"===o||"start"===o?(0,p.jsxs)(d.Fragment,{children:[E,s]}):(0,p.jsxs)(d.Fragment,{children:[s,E]}),r]})})},35406:(a,b,c)=>{c.d(b,{A:()=>x});var d=c(38301),e=c(43249),f=c(37489),g=c(2783),h=c(4007),i=c(6638),j=c(18168),k=c(60839),l=c(68333),m=c(54716),n=c(6636),o=c(79515),p=c(29565),q=c(33105);function r(a){return(0,q.Ay)("MuiLink",a)}let s=(0,p.A)("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]);var t=c(97287),u=c(21124);let v={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},w=(0,j.Ay)(o.default,{name:"MuiLink",slot:"Root",overridesResolver:(a,b)=>{let{ownerState:c}=a;return[b.root,b[`underline${(0,i.A)(c.underline)}`],"button"===c.component&&b.button]}})((0,l.A)(({theme:a})=>({variants:[{props:{underline:"none"},style:{textDecoration:"none"}},{props:{underline:"hover"},style:{textDecoration:"none","&:hover":{textDecoration:"underline"}}},{props:{underline:"always"},style:{textDecoration:"underline","&:hover":{textDecorationColor:"inherit"}}},{props:({underline:a,ownerState:b})=>"always"===a&&"inherit"!==b.color,style:{textDecorationColor:"var(--Link-underlineColor)"}},...Object.entries(a.palette).filter((0,m.A)()).map(([b])=>({props:{underline:"always",color:b},style:{"--Link-underlineColor":a.vars?`rgba(${a.vars.palette[b].mainChannel} / 0.4)`:(0,f.X4)(a.palette[b].main,.4)}})),{props:{underline:"always",color:"textPrimary"},style:{"--Link-underlineColor":a.vars?`rgba(${a.vars.palette.text.primaryChannel} / 0.4)`:(0,f.X4)(a.palette.text.primary,.4)}},{props:{underline:"always",color:"textSecondary"},style:{"--Link-underlineColor":a.vars?`rgba(${a.vars.palette.text.secondaryChannel} / 0.4)`:(0,f.X4)(a.palette.text.secondary,.4)}},{props:{underline:"always",color:"textDisabled"},style:{"--Link-underlineColor":(a.vars||a).palette.text.disabled}},{props:{component:"button"},style:{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none","&::-moz-focus-inner":{borderStyle:"none"},[`&.${s.focusVisible}`]:{outline:"auto"}}}]}))),x=d.forwardRef(function(a,b){let c=(0,n.b)({props:a,name:"MuiLink"}),j=(0,k.A)(),{className:l,color:m="primary",component:o="a",onBlur:p,onFocus:q,TypographyClasses:s,underline:x="always",variant:y="inherit",sx:z,...A}=c,[B,C]=d.useState(!1),D={...c,color:m,component:o,focusVisible:B,underline:x,variant:y},E=(a=>{let{classes:b,component:c,focusVisible:d,underline:e}=a,f={root:["root",`underline${(0,i.A)(e)}`,"button"===c&&"button",d&&"focusVisible"]};return(0,g.A)(f,r,b)})(D);return(0,u.jsx)(w,{color:m,className:(0,e.A)(E.root,l),classes:s,component:o,onBlur:a=>{(0,h.A)(a.target)||C(!1),p&&p(a)},onFocus:a=>{(0,h.A)(a.target)&&C(!0),q&&q(a)},ref:b,ownerState:D,variant:y,...A,sx:[...void 0===v[m]?[{color:m}]:[],...Array.isArray(z)?z:[z]],style:{...A.style,..."always"===x&&"inherit"!==m&&!v[m]&&{"--Link-underlineColor":(({theme:a,ownerState:b})=>{let c=b.color,d=(0,t.Yn)(a,`palette.${c}.main`,!1)||(0,t.Yn)(a,`palette.${c}`,!1)||b.color,e=(0,t.Yn)(a,`palette.${c}.mainChannel`)||(0,t.Yn)(a,`palette.${c}Channel`);return"vars"in a&&e?`rgba(${e} / 0.4)`:(0,f.X4)(d,.4)})({theme:j,ownerState:D})}}})})},95345:(a,b,c)=>{c.d(b,{A:()=>f});var d=c(27080),e=c(21124);let f=(0,d.A)((0,e.jsx)("path",{d:"M19 2h-4.18C14.4.84 13.3 0 12 0S9.6.84 9.18 2H5c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1m7 18H5V4h2v3h10V4h2z"}),"ContentPaste")}};