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
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1488],{2457:(e,t,l)=>{"use strict";l.d(t,{A:()=>r});var n=l(12115);let r=e=>{let t=n.useRef({});return n.useEffect(()=>{t.current=e}),t.current}},17325:(e,t,l)=>{"use strict";l.d(t,{A:()=>p});var n=l(12115),r=l(2821),a=l(57001),o=l(48116),s=l(16625),i=l(85795),c=l(95195);function d(e){return(0,c.Ay)("MuiFormGroup",e)}(0,i.A)("MuiFormGroup",["root","row","error"]);var u=l(45918),h=l(75108),x=l(95155);let f=(0,o.Ay)("div",{name:"MuiFormGroup",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:l}=e;return[t.root,l.row&&t.row]}})({display:"flex",flexDirection:"column",flexWrap:"wrap",variants:[{props:{row:!0},style:{flexDirection:"row"}}]}),p=n.forwardRef(function(e,t){let l=(0,s.b)({props:e,name:"MuiFormGroup"}),{className:n,row:o=!1,...i}=l,c=(0,u.A)(),p=(0,h.A)({props:l,muiFormControl:c,states:["error"]}),m={...l,row:o,error:p.error},g=(e=>{let{classes:t,row:l,error:n}=e;return(0,a.A)({root:["root",l&&"row",n&&"error"]},d,t)})(m);return(0,x.jsx)(f,{className:(0,r.A)(g.root,n),ownerState:m,ref:t,...i})})},17427:(e,t,l)=>{"use strict";l.d(t,{A:()=>f});var n=l(95155),r=l(12115),a=l(25635),o=l(94049),s=l(99944),i=l(9957),c=l(52641),d=l(51221),u=l(55606),h=l(86973),x=l(9562);let f=e=>{var t;let{schema:l,values:f,onChange:p,size:m="small"}=e,[g,v]=(0,r.useState)({}),y=null!=(t=null==l?void 0:l.properties)?t:{},w=Array.isArray(null==l?void 0:l.required)?l.required:[],j=Object.keys(y);if(0===j.length)return(0,n.jsx)(a.default,{variant:"body2",color:"text.secondary",children:"This tool takes no parameters."});let b=(e,t)=>{let l={...f};void 0===t?delete l[e]:l[e]=t,p(l)};return(0,n.jsx)(o.default,{sx:{display:"flex",flexDirection:"column",gap:2},children:j.map(e=>{var t,l;let r=null!=(t=y[e])?t:{},p=w.includes(e)?"".concat(e," *"):e,j="string"==typeof r.description?r.description:"";if("boolean"===r.type)return(0,n.jsx)(s.A,{control:(0,n.jsx)(i.A,{size:m,checked:!0===f[e],onChange:t=>b(e,t.target.checked)}),label:(0,n.jsxs)(o.default,{children:[(0,n.jsx)(a.default,{variant:"body2",children:p}),j&&(0,n.jsx)(a.default,{variant:"caption",color:"text.secondary",children:j})]})},e);if(Array.isArray(r.enum)&&r.enum.length>0){let t=f[e];return(0,n.jsxs)(c.A,{size:m,fullWidth:!0,children:[(0,n.jsx)(d.A,{id:"schema-param-".concat(e),children:p}),(0,n.jsx)(u.A,{labelId:"schema-param-".concat(e),label:p,value:r.enum.includes(t)?t:"",onChange:t=>b(e,t.target.value),children:r.enum.map(e=>(0,n.jsx)(h.A,{value:e,children:String(e)},String(e)))}),j&&(0,n.jsx)(a.default,{variant:"caption",color:"text.secondary",sx:{mt:.5,mx:1.75},children:j})]},e)}if("number"===r.type||"integer"===r.type)return(0,n.jsx)(x.A,{fullWidth:!0,size:m,type:"number",label:p,value:void 0!==f[e]?String(f[e]):"",onChange:t=>{let l=t.target.value;if(""===l)return void b(e,void 0);let n="integer"===r.type?parseInt(l,10):parseFloat(l);b(e,Number.isNaN(n)?void 0:n)},helperText:j},e);if("object"===r.type||"array"===r.type){let t=null!=(l=g[e])?l:void 0!==f[e]?JSON.stringify(f[e],null,2):"",a=null;if(t.trim())try{JSON.parse(t)}catch(e){a="Not valid JSON yet"}return(0,n.jsx)(x.A,{fullWidth:!0,size:m,multiline:!0,minRows:2,label:"".concat(p," (JSON ").concat(r.type,")"),value:t,error:!!a,helperText:null!=a?a:j,onChange:t=>{let l=t.target.value;if(v(t=>({...t,[e]:l})),!l.trim())return void b(e,void 0);try{b(e,JSON.parse(l))}catch(e){}},slotProps:{input:{sx:{fontFamily:"monospace",fontSize:13}}}},e)}return(0,n.jsx)(x.A,{fullWidth:!0,size:m,label:p,value:void 0!==f[e]?String(f[e]):"",onChange:t=>b(e,""===t.target.value?void 0:t.target.value),helperText:j},e)})})}},53657:(e,t,l)=>{"use strict";l.d(t,{A:()=>a});var n=l(36697),r=l(95155);let a=(0,n.A)((0,r.jsx)("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2m6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56M12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96M4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2s.06 1.34.14 2zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56m2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8M12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96M14.34 14H9.66c-.09-.66-.16-1.32-.16-2s.07-1.35.16-2h4.68c.09.65.16 1.32.16 2s-.07 1.34-.16 2m.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56M16.36 14c.08-.66.14-1.32.14-2s-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2z"}),"Language")},55406:(e,t,l)=>{"use strict";l.d(t,{A:()=>a});var n=l(36697),r=l(95155);let a=(0,n.A)((0,r.jsx)("path",{d:"M8 5v14l11-7z"}),"PlayArrow")},60187:(e,t,l)=>{Promise.resolve().then(l.bind(l,68324))},68324:(e,t,l)=>{"use strict";l.r(t),l.d(t,{default:()=>eG});var n=l(95155),r=l(94049),a=l(12115),o=l(25635),s=l(99944),i=l(9957),c=l(91871),d=l(22003),u=l(80422),h=l(2778),x=l(52363),f=l(65036),p=l(75912),m=l(86946),g=l(76530),v=l(78470),y=l(41983),w=l(87021);let j=(0,w.h)("frontend/services/plannedExecutions");class b{async list(){try{let e=await fetch("/api/planned-executions");if(!e.ok)throw Error("HTTP ".concat(e.status));return await e.json()}catch(e){return j.warn("Failed to list planned executions",e),{paused:!1,executions:[]}}}async create(e){try{let t=await fetch("/api/planned-executions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),l=await t.json();if(!t.ok)return{success:!1,error:(null==l?void 0:l.error)||"HTTP ".concat(t.status)};return{success:!0,execution:l.execution}}catch(e){return{success:!1,error:e instanceof Error?e.message:"Request failed"}}}async update(e,t){try{let l=await fetch("/api/planned-executions/".concat(e),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),n=await l.json();if(!l.ok)return{success:!1,error:(null==n?void 0:n.error)||"HTTP ".concat(l.status)};return{success:!0,execution:n.execution}}catch(e){return{success:!1,error:e instanceof Error?e.message:"Request failed"}}}async delete(e){try{let t=await fetch("/api/planned-executions/".concat(e),{method:"DELETE"});if(!t.ok){let e=await t.json().catch(()=>null);return{success:!1,error:(null==e?void 0:e.error)||"HTTP ".concat(t.status)}}return{success:!0}}catch(e){return{success:!1,error:e instanceof Error?e.message:"Request failed"}}}async setPaused(e){try{let t=await fetch("/api/planned-executions",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({paused:e})});if(!t.ok){let e=await t.json().catch(()=>null);return{success:!1,error:(null==e?void 0:e.error)||"HTTP ".concat(t.status)}}return{success:!0}}catch(e){return{success:!1,error:e instanceof Error?e.message:"Request failed"}}}async runNow(e){try{let t=await fetch("/api/planned-executions/".concat(e,"/run"),{method:"POST"}),l=await t.json();if(!t.ok)return{success:!1,error:(null==l?void 0:l.error)||"HTTP ".concat(t.status)};return{success:!0,record:l.record}}catch(e){return{success:!1,error:e instanceof Error?e.message:"Request failed"}}}async loadRuns(e){try{let t=await fetch("/api/planned-executions/".concat(e,"/runs"));if(!t.ok)throw Error("HTTP ".concat(t.status));let l=await t.json();return Array.isArray(null==l?void 0:l.runs)?l.runs:[]}catch(t){return j.warn("Failed to load runs for ".concat(e),t),[]}}async previewSchedule(e,t){try{let l=await fetch("/api/planned-executions/preview-schedule",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cron:e,timezone:t})});if(!l.ok)throw Error("HTTP ".concat(l.status));return await l.json()}catch(e){return{valid:!1,error:e instanceof Error?e.message:"Preview failed",nextRuns:[]}}}}let A=new b;var k=l(2300),S=l(28548),C=l(4474),T=l(50430),I=l(55406),N=l(14915),W=l(4484),M=l(63186),E=l(62962),P=l(36697);let R=(0,P.A)((0,n.jsx)("path",{d:"M21 11V3h-8l3.29 3.29-10 10L3 13v8h8l-3.29-3.29 10-10z"}),"OpenInFull"),z=e=>String(e).padStart(2,"0"),F=e=>{switch(e){case"completed":return"success.main";case"error":return"error.main";case"skipped":return"warning.main";default:return"transparent"}},O=e=>e?new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"",L=e=>{if(!e.finishedAt)return"";let t=new Date(e.finishedAt).getTime()-new Date(e.firedAt).getTime();return t<1e3?"<1s":t<6e4?"".concat(Math.round(t/1e3),"s"):"".concat(Math.round(t/6e4),"min")},D=e=>{var t;let{entry:l,paused:s,onEdit:d,onDelete:u,onToggleEnabled:m,onRanNow:g}=e,{execution:w,status:j,lastRun:b}=l,[P,D]=(0,a.useState)(!1),[H,U]=(0,a.useState)(null),[J,q]=(0,a.useState)(!1),[G,B]=(0,a.useState)(!1),[$,V]=(0,a.useState)(null),[_,K]=(0,a.useState)(10),Q=(0,a.useCallback)(async()=>{q(!0),U([...await A.loadRuns(w.id)].reverse()),K(10),q(!1)},[w.id]);(0,a.useEffect)(()=>{P&&Q()},[P,Q,null==b?void 0:b.runId]);let X=async()=>{B(!0),await A.runNow(w.id),B(!1),P&&Q(),g()};return(0,n.jsxs)(k.A,{variant:"outlined",sx:{p:2},children:[(0,n.jsxs)(r.default,{sx:{display:"flex",alignItems:"center",gap:1.5,flexWrap:"wrap"},children:[(0,n.jsxs)(r.default,{sx:{flexGrow:1,minWidth:220},children:[(0,n.jsxs)(r.default,{sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"wrap"},children:[(0,n.jsx)(o.default,{variant:"subtitle1",sx:{fontWeight:600},children:w.name}),(0,n.jsx)(S.A,{size:"small",label:function(e){var t,l,n;switch(e.type){case"schedule":{let l,n=(t=e.cron,(l=/^\*\/(\d+) \* \* \* \* \*$/.exec(t))?"Every ".concat(l[1],"s"):(l=/^\*\/(\d+) \* \* \* \*$/.exec(t))?"Every ".concat(l[1]," min"):(l=/^0 \*\/(\d+) \* \* \*$/.exec(t))?1===Number(l[1])?"Every hour":"Every ".concat(l[1]," hours"):(l=/^(\d+) (\d+) \* \* \*$/.exec(t))?"Daily at ".concat(z(Number(l[2])),":").concat(z(Number(l[1]))):(l=/^(\d+) (\d+) \* \* 1-5$/.exec(t))?"Weekdays at ".concat(z(Number(l[2])),":").concat(z(Number(l[1]))):null);return null!=n?n:"Schedule: ".concat(e.cron)}case"webhook":return"Webhook";case"file-watch":return"Watching ".concat(e.path);case"mcp-poll":return"Watching ".concat(e.serverName," › ").concat(e.toolName);case"url-watch":try{return"Watching ".concat(new URL(e.url).hostname)}catch(e){return"Watching a URL"}case"flow-event":{if(null==(l=e.source)?void 0:l.topic)return"On signal “".concat(e.source.topic,"”");let t=(null!=(n=e.on)?n:[]).join("/")||"terminal";return"When a flow is ".concat(t)}default:return"Trigger"}}(w.trigger)}),w.exclusive&&(0,n.jsx)(v.A,{title:"Only runs when the scheduler is idle; blocks other runs while active",children:(0,n.jsx)(S.A,{size:"small",color:"secondary",label:"Exclusive"})}),!w.enabled&&(0,n.jsx)(S.A,{size:"small",label:"Off",variant:"outlined"})]}),j.running?(0,n.jsxs)(r.default,{sx:{display:"flex",alignItems:"center",gap:.75,mt:.5},children:[(0,n.jsx)(C.default,{size:12,thickness:6}),(0,n.jsxs)(o.default,{variant:"body2",color:"text.secondary",children:["Running…",j.runningSince?" — started ".concat(O(j.runningSince)):""]})]}):j.blockedByExclusive?(0,n.jsxs)(o.default,{variant:"body2",color:"text.secondary",sx:{mt:.5},children:["Blocked — an exclusive execution holds the scheduler",j.lastTriggerError?" — trigger error: ".concat(j.lastTriggerError):""]}):(0,n.jsxs)(o.default,{variant:"body2",color:"text.secondary",sx:{mt:.5},children:[(e=>{let{execution:t,status:l}=e;if(!t.enabled)return"";if(l.nextRun)return"Next run: ".concat(O(l.nextRun));if("paused"===l.notArmedReason)return"Paused (global)";if(l.armed)switch(t.trigger.type){case"webhook":return"Listening for webhook";case"file-watch":return"Watching ".concat(t.trigger.path);case"mcp-poll":case"url-watch":return"Watching for changes";case"flow-event":return"Waiting for flow event";default:return"Armed"}return"Not armed"})(l),j.lastTriggerError?" — trigger error: ".concat(j.lastTriggerError):""]}),b&&(0,n.jsxs)(r.default,{sx:{display:"flex",alignItems:"center",gap:.75,mt:.5},children:[(0,n.jsx)(v.A,{title:b.status,children:(0,n.jsx)(r.default,{sx:{width:10,height:10,borderRadius:"50%",bgcolor:F(b.status),flexShrink:0}})}),(0,n.jsxs)(o.default,{variant:"body2",color:"text.secondary",children:["Last run ",O(b.firedAt),"error"===b.status&&b.error?" — ".concat(b.error):""]})]})]}),(0,n.jsx)(v.A,{title:"Run now",children:(0,n.jsx)("span",{children:(0,n.jsx)(y.A,{onClick:X,disabled:G,color:"primary",children:G?(0,n.jsx)(C.default,{size:20}):(0,n.jsx)(I.A,{})})})}),(0,n.jsx)(v.A,{title:s?"Scheduler is paused globally — switch it to Active (top right) to arm triggers":w.enabled?"Turn off":"Turn on",children:(0,n.jsx)(i.A,{checked:w.enabled,onChange:e=>m(e.target.checked)})}),(0,n.jsx)(v.A,{title:"Edit",children:(0,n.jsx)(y.A,{onClick:d,children:(0,n.jsx)(N.A,{})})}),(0,n.jsx)(v.A,{title:"Delete",children:(0,n.jsx)(y.A,{onClick:u,children:(0,n.jsx)(W.A,{})})}),(0,n.jsx)(v.A,{title:P?"Hide run history":"Show run history",children:(0,n.jsx)(y.A,{onClick:()=>D(e=>!e),children:P?(0,n.jsx)(E.A,{}):(0,n.jsx)(M.A,{})})})]}),(0,n.jsx)(T.A,{in:P,timeout:"auto",unmountOnExit:!0,children:(0,n.jsxs)(r.default,{sx:{mt:2,borderTop:1,borderColor:"divider",pt:1.5},children:[J&&!H&&(0,n.jsx)(o.default,{variant:"body2",color:"text.secondary",children:"Loading runs…"}),H&&0===H.length&&(0,n.jsx)(o.default,{variant:"body2",color:"text.secondary",children:"No runs yet. Use the play button to try it now."}),null==H?void 0:H.slice(0,_).map(e=>{var t;return(0,n.jsxs)(r.default,{sx:{display:"flex",gap:1,py:.75,alignItems:"flex-start","&:hover .run-detail-button":{opacity:1}},children:[(0,n.jsx)(r.default,{sx:{width:10,height:10,borderRadius:"50%",bgcolor:F(e.status),mt:"5px",flexShrink:0}}),(0,n.jsxs)(r.default,{sx:{minWidth:0,flexGrow:1},children:[(0,n.jsxs)(o.default,{variant:"body2",children:[O(e.firedAt),L(e)?" \xb7 ".concat(L(e)):""," \xb7 ",e.triggerSummary,(null==(t=e.usage)?void 0:t.totalTokens)?" \xb7 ".concat(e.usage.totalTokens.toLocaleString()," tokens"):""]}),e.error&&(0,n.jsx)(o.default,{variant:"body2",color:"error",children:e.error}),e.outputText&&(0,n.jsx)(o.default,{variant:"body2",color:"text.secondary",sx:{whiteSpace:"pre-wrap",display:"-webkit-box",WebkitLineClamp:3,WebkitBoxOrient:"vertical",overflow:"hidden"},children:e.outputText})]}),(0,n.jsx)(v.A,{title:"Show full output",children:(0,n.jsx)(y.A,{className:"run-detail-button",size:"small",onClick:()=>V(e),sx:{opacity:{xs:1,md:.35},transition:"opacity 120ms",flexShrink:0},children:(0,n.jsx)(R,{fontSize:"inherit"})})})]},e.runId)}),H&&H.length>_&&(0,n.jsxs)(c.A,{size:"small",onClick:()=>K(e=>e+10),sx:{mt:1},children:["Load more (",H.length-_," older)"]})]})}),(0,n.jsxs)(h.A,{open:null!==$,onClose:()=>V(null),maxWidth:"md",fullWidth:!0,children:[(0,n.jsx)(x.A,{component:"div",children:(0,n.jsxs)(r.default,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,n.jsx)(r.default,{sx:{width:10,height:10,borderRadius:"50%",bgcolor:$?F($.status):"transparent",flexShrink:0}}),(0,n.jsxs)(o.default,{variant:"h6",children:[w.name," — ",$?O($.firedAt):""]})]})}),(0,n.jsx)(f.A,{dividers:!0,children:$&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(o.default,{variant:"body2",color:"text.secondary",sx:{mb:1.5},children:[$.status,L($)?" \xb7 ".concat(L($)):""," \xb7 ",$.triggerSummary,(null==(t=$.usage)?void 0:t.totalTokens)?" \xb7 ".concat($.usage.totalTokens.toLocaleString()," tokens (").concat($.usage.promptTokens.toLocaleString()," in / ").concat($.usage.completionTokens.toLocaleString()," out)"):""]}),$.error&&(0,n.jsx)(o.default,{variant:"body2",color:"error",sx:{mb:1.5,whiteSpace:"pre-wrap"},children:$.error}),$.outputText?(0,n.jsx)(r.default,{sx:{whiteSpace:"pre-wrap",wordBreak:"break-word",bgcolor:"action.hover",borderRadius:1,p:2,fontSize:14,maxHeight:"55vh",overflow:"auto"},children:$.outputText}):!$.error&&(0,n.jsx)(o.default,{variant:"body2",color:"text.secondary",children:"This run produced no output text."})]})}),(0,n.jsx)(p.A,{children:(0,n.jsx)(c.A,{onClick:()=>V(null),children:"Close"})})]})]})};var H=l(21067),U=l(9562),J=l(52641),q=l(51221),G=l(55606),B=l(86973),$=l(18369),V=l(77073);let _=(0,P.A)([(0,n.jsx)("path",{d:"M11.99 2C6.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"},"0"),(0,n.jsx)("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"},"1")],"Schedule"),K=(0,P.A)((0,n.jsx)("path",{d:"M10 15h5.88c.27-.31.67-.5 1.12-.5.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5c-.44 0-.84-.19-1.12-.5H11.9c-.46 2.28-2.48 4-4.9 4-2.76 0-5-2.24-5-5 0-2.42 1.72-4.44 4-4.9v2.07c-1.16.41-2 1.53-2 2.83 0 1.65 1.35 3 3 3s3-1.35 3-3zm2.5-11c1.65 0 3 1.35 3 3h2c0-2.76-2.24-5-5-5s-5 2.24-5 5c0 1.43.6 2.71 1.55 3.62l-2.35 3.9c-.68.14-1.2.75-1.2 1.48 0 .83.67 1.5 1.5 1.5s1.5-.67 1.5-1.5c0-.16-.02-.31-.07-.45l3.38-5.63C10.49 9.61 9.5 8.42 9.5 7c0-1.65 1.35-3 3-3m4.5 9c-.64 0-1.23.2-1.72.54l-3.05-5.07C11.53 8.35 11 7.74 11 7c0-.83.67-1.5 1.5-1.5S14 6.17 14 7c0 .15-.02.29-.06.43l2.19 3.65c.28-.05.57-.08.87-.08 2.76 0 5 2.24 5 5s-2.24 5-5 5c-1.85 0-3.47-1.01-4.33-2.5h2.67c.48.32 1.05.5 1.66.5 1.65 0 3-1.35 3-3s-1.35-3-3-3"}),"Webhook");var Q=l(79299);let X=(0,P.A)((0,n.jsx)("path",{d:"M19.3 16.9c.4-.7.7-1.5.7-2.4 0-2.5-2-4.5-4.5-4.5S11 12 11 14.5s2 4.5 4.5 4.5c.9 0 1.7-.3 2.4-.7l3.2 3.2 1.4-1.4zm-3.8.1c-1.4 0-2.5-1.1-2.5-2.5s1.1-2.5 2.5-2.5 2.5 1.1 2.5 2.5-1.1 2.5-2.5 2.5M12 20v2C6.48 22 2 17.52 2 12S6.48 2 12 2c4.84 0 8.87 3.44 9.8 8h-2.07c-.64-2.46-2.4-4.47-4.73-5.41V5c0 1.1-.9 2-2 2h-2v2c0 .55-.45 1-1 1H8v2h2v3H9l-4.79-4.79C4.08 10.79 4 11.38 4 12c0 4.41 3.59 8 8 8"}),"TravelExplore");var Y=l(53657);let Z=(0,P.A)((0,n.jsx)("path",{d:"m9.78 11.16-1.42 1.42c-.68-.69-1.34-1.58-1.79-2.94l1.94-.49c.32.89.77 1.5 1.27 2.01M11 6 7 2 3 6h3.02c.02.81.08 1.54.19 2.17l1.94-.49C8.08 7.2 8.03 6.63 8.02 6zm10 0-4-4-4 4h2.99c-.1 3.68-1.28 4.75-2.54 5.88-.5.44-1.01.92-1.45 1.55-.34-.49-.73-.88-1.13-1.24L9.46 13.6c.93.85 1.54 1.54 1.54 3.4v5h2v-5c0-2.02.71-2.66 1.79-3.63 1.38-1.24 3.08-2.78 3.2-7.37z"}),"AltRoute");var ee=l(90057),et=l(36741);let el=e=>{let{selected:t,icon:l,title:a,description:s,onClick:i}=e;return(0,n.jsxs)(r.default,{role:"radio","aria-checked":t,tabIndex:0,onClick:i,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),i())},sx:{flex:1,minWidth:200,position:"relative",p:2,borderRadius:2,border:2,borderColor:t?"primary.main":"divider",bgcolor:t?"action.selected":"background.paper",cursor:"pointer",transition:"border-color 120ms, background-color 120ms","&:hover":{borderColor:t?"primary.main":"text.disabled"},outline:"none","&:focus-visible":{boxShadow:e=>"0 0 0 3px ".concat(e.palette.primary.light)}},children:[t&&(0,n.jsx)(et.A,{color:"primary",fontSize:"small",sx:{position:"absolute",top:8,right:8}}),(0,n.jsxs)(r.default,{sx:{display:"flex",alignItems:"center",gap:1,mb:.5,color:t?"primary.main":"text.secondary"},children:[l,(0,n.jsx)(o.default,{variant:"subtitle1",sx:{fontWeight:600,color:"text.primary"},children:a})]}),(0,n.jsx)(o.default,{variant:"body2",color:"text.secondary",children:s})]})};var en=l(22822),er=l(98267),ea=l(20537),eo=l(37960);let es=e=>String(e).padStart(2,"0"),ei=e=>{let{cron:t,timezone:l,onChange:i,verb:c="Runs",catchUp:u,onCatchUpChange:h}=e,x=(0,a.useMemo)(()=>(function(e){let t=/^\*\/(\d+) \* \* \* \* \*$/.exec(e);return t?{mode:"seconds",n:Number(t[1]),time:"09:00"}:(t=/^\*\/(\d+) \* \* \* \*$/.exec(e))?{mode:"minutes",n:Number(t[1]),time:"09:00"}:(t=/^0 \*\/(\d+) \* \* \*$/.exec(e))?{mode:"hours",n:Number(t[1]),time:"09:00"}:(t=/^(\d+) (\d+) \* \* \*$/.exec(e))?{mode:"daily",n:1,time:"".concat(es(Number(t[2])),":").concat(es(Number(t[1])))}:(t=/^(\d+) (\d+) \* \* 1-5$/.exec(e))?{mode:"weekdays",n:1,time:"".concat(es(Number(t[2])),":").concat(es(Number(t[1])))}:{mode:"custom",n:15,time:"09:00"}})(t),[]),[f,p]=(0,a.useState)(x.mode),[m,g]=(0,a.useState)(x.n),[v,y]=(0,a.useState)(x.time),[w,j]=(0,a.useState)(t),[b,k]=(0,a.useState)(null),S=function(e,t,l,n){let[r,a]=l.split(":").map(Number);switch(e){case"seconds":return"*/".concat(Math.max(1,Math.min(59,Math.floor(t)||1))," * * * * *");case"minutes":return"*/".concat(Math.max(1,Math.min(59,Math.floor(t)||1))," * * * *");case"hours":return"0 */".concat(Math.max(1,Math.min(23,Math.floor(t)||1))," * * *");case"daily":return"".concat(a||0," ").concat(r||0," * * *");case"weekdays":return"".concat(a||0," ").concat(r||0," * * 1-5");default:return n}}(f,m,v,w);return(0,a.useEffect)(()=>{S!==t&&i({cron:S,timezone:l})},[S]),(0,a.useEffect)(()=>{let e=!1,t=setTimeout(()=>{A.previewSchedule(S,l).then(t=>{e||k(t)})},300);return()=>{e=!0,clearTimeout(t)}},[S,l]),(0,n.jsxs)(r.default,{children:[(0,n.jsxs)(r.default,{sx:{display:"flex",gap:2,flexWrap:"wrap",alignItems:"center",mt:1},children:[(0,n.jsxs)(J.A,{sx:{minWidth:180},children:[(0,n.jsx)(q.A,{id:"schedule-preset-label",children:c}),(0,n.jsxs)(G.A,{labelId:"schedule-preset-label",label:c,value:f,onChange:e=>p(e.target.value),children:[(0,n.jsx)(B.A,{value:"seconds",children:"Every N seconds"}),(0,n.jsx)(B.A,{value:"minutes",children:"Every N minutes"}),(0,n.jsx)(B.A,{value:"hours",children:"Every N hours"}),(0,n.jsx)(B.A,{value:"daily",children:"Daily at a time"}),(0,n.jsx)(B.A,{value:"weekdays",children:"Weekdays at a time"}),(0,n.jsx)(B.A,{value:"custom",children:"Custom (cron)"})]})]}),("seconds"===f||"minutes"===f||"hours"===f)&&(0,n.jsx)(U.A,{label:"seconds"===f?"Seconds":"minutes"===f?"Minutes":"Hours",type:"number",value:m,onChange:e=>g(Number(e.target.value)),inputProps:{min:1,max:"hours"===f?23:59},sx:{width:120}}),("daily"===f||"weekdays"===f)&&(0,n.jsx)(U.A,{label:"Time",type:"time",value:v,onChange:e=>y(e.target.value),sx:{width:150},InputLabelProps:{shrink:!0}}),"custom"===f&&(0,n.jsx)(U.A,{label:"Cron pattern",value:w,onChange:e=>j(e.target.value),sx:{minWidth:220},placeholder:"*/15 * * * *"})]}),b&&!b.valid&&(0,n.jsx)(d.A,{severity:"error",sx:{mt:2},children:b.error||"This schedule is not valid."}),b&&b.valid&&b.nextRuns.length>0&&(0,n.jsxs)(o.default,{variant:"body2",color:"text.secondary",sx:{mt:2},children:["Next: ",b.nextRuns.map(e=>new Date(e).toLocaleString()).join(" \xb7 ")]}),h&&(0,n.jsx)(s.A,{sx:{mt:1,display:"flex"},control:(0,n.jsx)(en.A,{checked:!0===u,onChange:e=>h(e.target.checked)}),label:"If FLUJO was closed at a scheduled time, run once on startup"}),(0,n.jsxs)(er.A,{disableGutters:!0,elevation:0,sx:{mt:1,"&:before":{display:"none"}},children:[(0,n.jsx)(ea.A,{expandIcon:(0,n.jsx)(M.A,{}),sx:{px:0},children:(0,n.jsx)(o.default,{variant:"body2",color:"text.secondary",children:"Advanced"})}),(0,n.jsx)(eo.A,{sx:{px:0},children:(0,n.jsxs)(r.default,{sx:{display:"flex",gap:2,flexWrap:"wrap"},children:[(0,n.jsx)(U.A,{label:"Timezone (optional)",value:l||"",onChange:e=>i({cron:S,timezone:e.target.value||void 0}),placeholder:"e.g. Europe/Berlin",helperText:"IANA timezone name. Empty = this computer's timezone.",sx:{minWidth:260}}),(0,n.jsx)(U.A,{label:"Generated cron pattern",value:S,InputProps:{readOnly:"custom"!==f},onChange:e=>{p("custom"),j(e.target.value)},helperText:"Editing switches to Custom mode.",sx:{minWidth:220}})]})})]})]})};var ec=l(52277),ed=l(9693);let eu=e=>{let{config:t,onChange:l,executionId:i,saved:u}=e,[h,x]=(0,a.useState)(null),f=window.location.origin,p="".concat(f,"/api/webhooks/").concat(i),m=async(e,t)=>{try{await navigator.clipboard.writeText(t),x(e),setTimeout(()=>x(null),1500)}catch(e){}};return(0,n.jsxs)(r.default,{sx:{mt:1},children:[!u&&(0,n.jsx)(d.A,{severity:"info",sx:{mb:2},children:"This URL and token are ready to copy now — they become active when you save."}),(0,n.jsxs)(r.default,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,n.jsx)(U.A,{fullWidth:!0,label:"Webhook URL",value:p,InputProps:{readOnly:!0},size:"small"}),(0,n.jsx)(v.A,{title:"Copy URL",children:(0,n.jsx)(y.A,{onClick:()=>m("url",p),children:"url"===h?(0,n.jsx)(ed.A,{color:"success"}):(0,n.jsx)(ec.A,{})})})]}),(0,n.jsxs)(r.default,{sx:{display:"flex",alignItems:"center",gap:1,mt:2},children:[(0,n.jsx)(U.A,{fullWidth:!0,label:"Secret token",value:t.token,InputProps:{readOnly:!0},size:"small",type:"password"}),(0,n.jsx)(v.A,{title:"Copy token",children:(0,n.jsx)(y.A,{onClick:()=>m("token",t.token),disabled:!t.token,children:"token"===h?(0,n.jsx)(ed.A,{color:"success"}):(0,n.jsx)(ec.A,{})})}),(0,n.jsx)(c.A,{size:"small",onClick:()=>l({...t,token:crypto.randomUUID()}),sx:{whiteSpace:"nowrap"},children:"New token"})]}),(0,n.jsx)(o.default,{variant:"caption",color:"text.secondary",children:u?"A new token takes effect when you save — callers using the old one are cut off.":""}),(0,n.jsxs)(o.default,{variant:"body2",color:"text.secondary",sx:{mt:1.5},children:["Callers send a POST with the token in the ",(0,n.jsx)("code",{children:"X-Flujo-Token"})," ","header (or ",(0,n.jsx)("code",{children:"?token=…"}),"). The request body becomes part of the flow's input — treat it as untrusted data in your prompt."]}),(0,n.jsx)(s.A,{sx:{mt:1,display:"flex"},control:(0,n.jsx)(en.A,{checked:!0===t.allowExternal,onChange:e=>l({...t,allowExternal:e.target.checked})}),label:"Allow calls from other machines (default: this computer only)"}),t.allowExternal&&(0,n.jsx)(d.A,{severity:"warning",children:"FLUJO assumes a single user on this machine. If you expose it beyond localhost (port forwarding, tunnels), securing that access is your responsibility — anyone with the URL and token can run this flow."})]})};var eh=l(56422),ex=l(17325),ef=l(80007),ep=l(62640);let em=[{value:"add",label:"A file appears"},{value:"change",label:"A file changes"},{value:"unlink",label:"A file is deleted"}],eg=e=>{var t;let{config:l,onChange:i}=e,[c,u]=(0,a.useState)(!1);return(0,n.jsxs)(r.default,{sx:{mt:1},children:[(0,n.jsx)(U.A,{fullWidth:!0,label:"Folder (or file) to watch",value:l.path,onChange:e=>i({...l,path:e.target.value}),placeholder:"e.g. C:\\Users\\me\\Documents\\inbox",margin:"normal",InputProps:{endAdornment:(0,n.jsx)(eh.A,{position:"end",children:(0,n.jsx)(v.A,{title:"Browse folders (on the FLUJO machine)",children:(0,n.jsx)(y.A,{edge:"end",onClick:()=>u(!0),children:(0,n.jsx)(ef.A,{})})})})}}),(0,n.jsx)(ep.A,{open:c,title:"Choose what to watch",selectFiles:!0,initialPath:l.path||void 0,onClose:()=>u(!1),onSelect:e=>i({...l,path:e})}),(0,n.jsx)(U.A,{fullWidth:!0,label:"Only files matching (optional)",value:l.glob||"",onChange:e=>i({...l,glob:e.target.value||void 0}),placeholder:"e.g. *.pdf or reports/**/*.csv",helperText:"Simple patterns: * matches within a folder, ** across folders, ? one character.",margin:"normal"}),(0,n.jsx)(o.default,{variant:"subtitle2",sx:{mt:1},children:"Run when…"}),(0,n.jsx)(ex.A,{row:!0,children:em.map(e=>(0,n.jsx)(s.A,{control:(0,n.jsx)(en.A,{checked:l.events.includes(e.value),onChange:t=>((e,t)=>{let n=t?[...l.events,e]:l.events.filter(t=>t!==e);i({...l,events:n})})(e.value,t.target.checked)}),label:e.label},e.value))}),(0,n.jsx)(d.A,{severity:"info",sx:{mt:1},children:"Bursts are batched: many files changing at once produce one run with all changes listed. If this flow writes into the watched folder, it will trigger itself in a loop — point its output somewhere else."}),(0,n.jsxs)(er.A,{disableGutters:!0,elevation:0,sx:{mt:1,"&:before":{display:"none"}},children:[(0,n.jsx)(ea.A,{expandIcon:(0,n.jsx)(M.A,{}),sx:{px:0},children:(0,n.jsx)(o.default,{variant:"body2",color:"text.secondary",children:"Advanced"})}),(0,n.jsx)(eo.A,{sx:{px:0},children:(0,n.jsx)(U.A,{label:"Quiet window (ms)",type:"number",value:null!=(t=l.debounceMs)?t:2e3,onChange:e=>i({...l,debounceMs:Math.max(0,Number(e.target.value)||0)}),helperText:"How long to wait after the last change before running.",inputProps:{min:0,step:500},sx:{width:220}})})]})]})},ev=(0,P.A)((0,n.jsx)("path",{d:"M18 23H4c-1.1 0-2-.9-2-2V7h2v14h14zM15 1H8c-1.1 0-1.99.9-1.99 2L6 17c0 1.1.89 2 1.99 2H19c1.1 0 2-.9 2-2V7zm1.5 14h-6v-2h6zm0-6h-2v2h-2V9h-2V7h2V5h2v2h2z"}),"Difference"),ey=(0,P.A)([(0,n.jsx)("path",{d:"M13 8.57c-.79 0-1.43.64-1.43 1.43s.64 1.43 1.43 1.43 1.43-.64 1.43-1.43-.64-1.43-1.43-1.43"},"0"),(0,n.jsx)("path",{d:"M13 3C9.25 3 6.2 5.94 6.02 9.64L4.1 12.2c-.25.33-.01.8.4.8H6v3c0 1.1.9 2 2 2h1v3h7v-4.68c2.36-1.12 4-3.53 4-6.32 0-3.87-3.13-7-7-7m3 7c0 .13-.01.26-.02.39l.83.66c.08.06.1.16.05.25l-.8 1.39c-.05.09-.16.12-.24.09l-.99-.4c-.21.16-.43.29-.67.39L14 13.83c-.01.1-.1.17-.2.17h-1.6c-.1 0-.18-.07-.2-.17l-.15-1.06c-.25-.1-.47-.23-.68-.39l-.99.4c-.09.03-.2 0-.25-.09l-.8-1.39c-.05-.08-.03-.19.05-.25l.84-.66c-.01-.13-.02-.26-.02-.39s.02-.27.04-.39l-.85-.66c-.08-.06-.1-.16-.05-.26l.8-1.38c.05-.09.15-.12.24-.09l1 .4c.2-.15.43-.29.67-.39L12 6.17c.02-.1.1-.17.2-.17h1.6c.1 0 .18.07.2.17l.15 1.06c.24.1.46.23.67.39l1-.4c.09-.03.2 0 .24.09l.8 1.38c.05.09.03.2-.05.26l-.85.66c.03.12.04.25.04.39"},"1")],"Psychology");var ew=l(17897),ej=l(43076),eb=l(17427),eA=l(96362),ek=l(40962),eS=l(68503);let eC=(0,w.h)("frontend/components/PlannedExecutions/WatchToolPanel"),eT=e=>{var t,l;let{config:s,onChange:i}=e,[u,h]=(0,a.useState)([]),[x,f]=(0,a.useState)(!1),[p,m]=(0,a.useState)([]),[g,v]=(0,a.useState)(!1),[y,w]=(0,a.useState)(Object.keys(s.args||{}).length>0?JSON.stringify(s.args,null,2):""),[j,b]=(0,a.useState)(null),[A,k]=(0,a.useState)(!1),[S,T]=(0,a.useState)(null),[I,N]=(0,a.useState)(null),[W,M]=(0,a.useState)([]),[E,P]=(0,a.useState)([]);(0,a.useEffect)(()=>{let e=!1;return ew.S.loadServerConfigs().then(t=>{e||(Array.isArray(t)?h(t.filter(e=>!e.disabled)):(eC.warn("Failed to load MCP servers for watch-tool panel",t),h([])))}),()=>{e=!0}},[]),(0,a.useEffect)(()=>{if(!s.serverName)return void m([]);let e=!1;return v(!0),ew.S.listServerTools(s.serverName).then(t=>{let{tools:l}=t;e||m(l||[])}).finally(()=>{e||v(!1)}),()=>{e=!0}},[s.serverName]),(0,a.useEffect)(()=>{let e=!1;return ej.N.loadModels().then(t=>{e||M(Array.isArray(t)?t:[])}).catch(()=>{e||M([])}),ee.g.loadFlows().then(t=>{e||P(t||[])}).catch(()=>{e||P([])}),()=>{e=!0}},[]);let R=async()=>{k(!0),T(null),N(null);try{let l=await ew.S.callTool(s.serverName,s.toolName,s.args||{});if(null==l?void 0:l.error)N("string"==typeof l.error?l.error:"Tool call failed");else{var e,t;let n=null!=(e=null==l?void 0:l.data)?e:l,r=null!=(t=JSON.stringify(n,null,2))?t:"";T(r.length>6e3?"".concat(r.slice(0,6e3),"\n… (truncated)"):r)}}catch(e){N(e instanceof Error?e.message:"Tool call failed")}finally{k(!1)}},z=s.evaluate,F=p.find(e=>e.name===s.toolName),O=(0,eS.E)("mcp",u),L=e=>({key:e.name,content:(e=>(0,n.jsx)(ek.A,{name:e.name,status:e.status||"disconnected",path:e.rootPath||"",enabled:!e.disabled,transport:e.transport||"stdio",pickerMode:!0,selected:s.serverName===e.name,onClick:()=>{var t;return t=e.name,void(i({...s,serverName:t,toolName:""}),f(!1))}}))(e)}),D=O.items.map(L),H=O.groups?O.groups.map(e=>({...e,items:e.items.map(L)})):null;return(0,n.jsxs)(r.default,{sx:{mt:1},children:[(0,n.jsxs)(r.default,{sx:{display:"flex",gap:2,flexWrap:"wrap"},children:[(0,n.jsxs)(r.default,{sx:{minWidth:220,flex:1,mt:2,mb:1},children:[(0,n.jsx)(o.default,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.5},children:"Server"}),(0,n.jsx)(c.A,{variant:"outlined",fullWidth:!0,onClick:()=>f(!0),sx:{justifyContent:"flex-start",textTransform:"none"},children:s.serverName?"".concat(s.serverName," — change"):"Choose an MCP server…"}),(0,n.jsx)(eA.A,{open:x,onClose:()=>f(!1),title:"Choose an MCP server",description:"Pick the server whose tool you want to watch.",emptyMessage:"No MCP servers configured.",searchable:!0,searchPlaceholder:"Search servers…",searchTerm:O.searchTerm,onSearchChange:O.setSearchTerm,columns:{xs:12,sm:6},items:D,groups:H,collapsedKeys:O.collapsedKeys,onToggleGroup:O.toggleGroup})]}),(0,n.jsxs)(J.A,{sx:{minWidth:220,flex:1},margin:"normal",disabled:!s.serverName,children:[(0,n.jsx)(q.A,{id:"watch-tool-label",children:"Tool"}),(0,n.jsxs)(G.A,{labelId:"watch-tool-label",label:"Tool",value:p.some(e=>e.name===s.toolName)?s.toolName:"",onChange:e=>i({...s,toolName:e.target.value,args:{}}),children:[0===p.length&&(0,n.jsx)(B.A,{value:"",disabled:!0,children:g?"Loading tools…":"Pick a server first"}),p.map(e=>(0,n.jsx)(B.A,{value:e.name,children:e.name},e.name))]})]})]}),(0,n.jsx)(o.default,{variant:"subtitle2",sx:{mt:1},children:"How often to check"}),(0,n.jsx)(ei,{verb:"Check",cron:null!=(t=s.cron)?t:function(e){let t=Math.max(5,Math.round((null!=e?e:6e4)/1e3));if(t<60)return"*/".concat(t," * * * * *");let l=Math.max(1,Math.round(t/60));if(l<60)return"*/".concat(l," * * * *");let n=Math.max(1,Math.min(23,Math.round(l/60)));return"0 */".concat(n," * * *")}(s.intervalMs),timezone:s.timezone,onChange:e=>{let{cron:t,timezone:l}=e;return i({...s,cron:t,timezone:l})}}),F?(0,n.jsxs)(r.default,{sx:{my:1.5},children:[(0,n.jsx)(o.default,{variant:"subtitle2",sx:{mb:1.5},children:"Tool parameters — sent on every check"}),(0,n.jsx)(eb.A,{schema:F.inputSchema,values:s.args||{},onChange:e=>i({...s,args:e})})]}):(0,n.jsx)(U.A,{fullWidth:!0,label:"Tool arguments (JSON, optional)",value:y,onChange:e=>(e=>{if(w(e),!e.trim()){b(null),i({...s,args:{}});return}try{let t=JSON.parse(e);if(null===t||"object"!=typeof t||Array.isArray(t))return void b('Arguments must be a JSON object, e.g. { "query": "…" }');b(null),i({...s,args:t})}catch(e){b("Not valid JSON yet")}})(e.target.value),margin:"normal",multiline:!0,minRows:2,placeholder:'{ "query": "is:unread" }',error:!!j,helperText:null!=j?j:"Sent to the tool on every check.",slotProps:{input:{sx:{fontFamily:"monospace",fontSize:14}}}}),(0,n.jsxs)(r.default,{sx:{display:"flex",alignItems:"center",gap:2,mb:1},children:[(0,n.jsx)(c.A,{variant:"outlined",size:"small",onClick:R,disabled:!s.serverName||!s.toolName||A||!!j,startIcon:A?(0,n.jsx)(C.default,{size:16}):void 0,children:"Test: call the tool now"}),(0,n.jsx)(o.default,{variant:"caption",color:"text.secondary",children:"See what the result looks like — useful for the settings below."})]}),I&&(0,n.jsx)(d.A,{severity:"error",sx:{mb:1},children:I}),S&&(0,n.jsx)(r.default,{component:"pre",sx:{maxHeight:240,overflow:"auto",bgcolor:"action.hover",borderRadius:1,p:1.5,fontSize:12,m:0,mb:1},children:S}),(0,n.jsx)(o.default,{variant:"subtitle2",sx:{mt:2,mb:1},children:"Run the flow when…"}),(0,n.jsxs)(r.default,{role:"radiogroup","aria-label":"Poll condition",sx:{display:"flex",gap:2,flexWrap:"wrap"},children:[(0,n.jsx)(el,{selected:"on-change"===z.mode,onClick:()=>i({...s,evaluate:{mode:"on-change"}}),icon:(0,n.jsx)(ev,{}),title:"The result changes",description:"Any difference from the last check runs the flow. Simplest — no setup."}),(0,n.jsx)(el,{selected:"llm-gate"===z.mode||"flow-gate"===z.mode,onClick:()=>{"llm-gate"!==z.mode&&"flow-gate"!==z.mode&&i({...s,evaluate:{mode:"llm-gate",condition:"",modelId:""}})},icon:(0,n.jsx)(ey,{}),title:"AI decides",description:"Describe the condition in plain language; a model — or one of your flows — checks the result whenever it changes."})]}),("llm-gate"===z.mode||"flow-gate"===z.mode)&&(0,n.jsxs)(r.default,{sx:{mt:1},children:[(0,n.jsx)(U.A,{fullWidth:!0,label:"Run the flow if…",value:z.condition,onChange:e=>i({...s,evaluate:{...z,condition:e.target.value}}),multiline:!0,minRows:2,margin:"normal",placeholder:"e.g. any email mentions an invoice or a payment reminder"}),(0,n.jsxs)(r.default,{sx:{display:"flex",gap:2,flexWrap:"wrap",alignItems:"flex-start"},children:[(0,n.jsxs)(J.A,{sx:{minWidth:170},children:[(0,n.jsx)(q.A,{id:"gate-checker-label",children:"Checked by"}),(0,n.jsxs)(G.A,{labelId:"gate-checker-label",label:"Checked by",value:z.mode,onChange:e=>{let t=e.target.value;if(t===z.mode)return;let l={condition:z.condition,maxCallsPerDay:z.maxCallsPerDay};i({...s,evaluate:"llm-gate"===t?{mode:t,...l,modelId:""}:{mode:t,...l,flowId:""}})},children:[(0,n.jsx)(B.A,{value:"llm-gate",children:"A model"}),(0,n.jsx)(B.A,{value:"flow-gate",children:"One of my flows"})]})]}),"llm-gate"===z.mode&&(0,n.jsxs)(J.A,{sx:{minWidth:240,flex:1},children:[(0,n.jsx)(q.A,{id:"gate-model-label",children:"Model that checks"}),(0,n.jsxs)(G.A,{labelId:"gate-model-label",label:"Model that checks",value:W.some(e=>e.id===z.modelId)?z.modelId:"",onChange:e=>i({...s,evaluate:{...z,modelId:e.target.value}}),children:[0===W.length&&(0,n.jsx)(B.A,{value:"",disabled:!0,children:"No models configured"}),W.map(e=>(0,n.jsx)(B.A,{value:e.id,children:e.displayName||e.name},e.id))]})]}),"flow-gate"===z.mode&&(0,n.jsxs)(J.A,{sx:{minWidth:240,flex:1},children:[(0,n.jsx)(q.A,{id:"gate-flow-label",children:"Flow that checks"}),(0,n.jsxs)(G.A,{labelId:"gate-flow-label",label:"Flow that checks",value:E.some(e=>e.id===z.flowId)?z.flowId:"",onChange:e=>i({...s,evaluate:{...z,flowId:e.target.value}}),children:[0===E.length&&(0,n.jsx)(B.A,{value:"",disabled:!0,children:"No flows available"}),E.map(e=>(0,n.jsx)(B.A,{value:e.id,children:e.name},e.id))]})]}),(0,n.jsx)(U.A,{label:"Max checks per day",type:"number",value:null!=(l=z.maxCallsPerDay)?l:500,onChange:e=>i({...s,evaluate:{...z,maxCallsPerDay:Math.max(1,Number(e.target.value)||1)}}),inputProps:{min:1},helperText:"Cost guard per check.",sx:{width:180}})]}),(0,n.jsx)(o.default,{variant:"caption",color:"text.secondary",sx:{display:"block",mt:.5},children:"flow-gate"===z.mode?'The checker flow runs invisibly (never in the chat), gets the condition + tool result, and must answer with {"fire": true/false, "reason": "…"} — it can use its own tools to verify before deciding.':"The model is only asked when the result actually changed since the last check — an idle feed costs nothing. Pick a small, cheap model."})]}),(0,n.jsx)(d.A,{severity:"info",sx:{mt:2},children:"The first check only takes a snapshot — the flow runs from the second check onwards, when something actually changed. FLUJO must be running for checks to happen."})]})},eI=e=>{let{config:t,onChange:l}=e;return(0,n.jsxs)(r.default,{sx:{mt:1},children:[(0,n.jsx)(U.A,{fullWidth:!0,label:"URL to watch",value:t.url,onChange:e=>l({...t,url:e.target.value}),placeholder:"https://example.com/status or an API/feed URL",margin:"normal",type:"url"}),(0,n.jsx)(o.default,{variant:"subtitle2",sx:{mt:1},children:"How often to check"}),(0,n.jsx)(ei,{verb:"Check",cron:t.cron,timezone:t.timezone,onChange:e=>{let{cron:n,timezone:r}=e;return l({...t,cron:n,timezone:r})}}),(0,n.jsx)(d.A,{severity:"info",sx:{mt:1},children:"The first check only takes a snapshot; the flow runs when a later check finds different content, and the fetched content is handed to the flow. Pages that embed ever-changing bits (timestamps, session tokens) look “changed” on every check — plain APIs, feeds, and raw files work best."})]})};var eN=l(63109);function eW(e){if(!e||!Array.isArray(e.nodes))return[];let t=[];for(let r of e.nodes){var l,n;if((null==r||null==(l=r.data)?void 0:l.type)!=="signal")continue;let e=null==(n=r.data.properties)?void 0:n.topic;"string"==typeof e&&e.trim()&&t.push(e.trim())}return t}let eM=(0,w.h)("frontend/components/PlannedExecutions/FlowEventPanel"),eE=e=>{var t,l,i,c,u,h,x,f,p,m,g,v,y,w,j,b,k,S;let{config:C,onChange:T,flows:I,currentExecutionId:N}=e,[W,M]=(0,a.useState)([]),[E,P]=(0,a.useState)(void 0!==C.maxChainDepth||void 0!==C.minIntervalMs),R=(null==(t=C.source)?void 0:t.topic)!==void 0?"topic":(null==(l=C.source)?void 0:l.executionId)!==void 0?"execution":"flow",z="topic"===R,F=(0,a.useMemo)(()=>(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,l=new Map;for(let t of e)t&&"string"==typeof t.id&&l.set(t.id,t);let n=new Map,r=(e,t)=>{n.has(e)||n.set(e,[]),n.get(e).push(t)};for(let n of e){if(!n||"string"!=typeof n.id)continue;let e=new Map;for(let t of eW(n)){var a;e.set(t,(null!=(a=e.get(t))?a:0)+1)}for(let[t,l]of e)r(t,{flowId:n.id,flowName:n.name,signalNodeCount:l,viaSubflow:!1});for(let a of function(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,n=new Set,r=new Set,a=(e,o)=>{if(r.has(e)||o>l)return;r.add(e);let s=t.get(e);for(let e of eW(s))n.add(e);for(let e of function(e){if(!e||!Array.isArray(e.nodes))return[];let t=[];for(let r of e.nodes){var l,n;if((null==r||null==(l=r.data)?void 0:l.type)!=="subflow")continue;let e=null!=(n=r.data.properties)?n:{};if("string"==typeof e.subflowId&&e.subflowId.trim()&&t.push(e.subflowId.trim()),Array.isArray(e.parallelSubflowIds))for(let l of e.parallelSubflowIds)"string"==typeof l&&l.trim()&&t.push(l.trim())}return Array.from(new Set(t))}(s))a(e,o+1)};return a(e,0),n}(n.id,l,t))e.has(a)||r(a,{flowId:n.id,flowName:n.name,signalNodeCount:0,viaSubflow:!0})}return n})(I),[I]),O=(0,a.useMemo)(()=>{let e=new Map;for(let t of I)(null==t?void 0:t.id)&&e.set(t.id,t.name);return e},[I]),L=(0,a.useMemo)(()=>{let e=new Map;for(let n of W){var t,l;let r=n.execution;if(r.id===N||(null==(t=r.trigger)?void 0:t.type)!=="flow-event")continue;let a=null==(l=r.trigger.source)?void 0:l.topic;if("string"!=typeof a||!a.trim())continue;let o=a.trim();e.has(o)||e.set(o,[]),e.get(o).push({executionId:r.id,executionName:r.name,flowId:r.flowId,flowName:O.get(r.flowId)})}return e},[W,N,O]),D=(0,a.useMemo)(()=>Array.from(new Set([...F.keys(),...L.keys()])).sort((e,t)=>e.localeCompare(t)),[F,L]),$=e=>{let t=F.get(e);if(!t||0===t.length)return null;let l=Array.from(new Set(t.map(e=>(e.flowName||e.flowId)+(e.viaSubflow?" (via subflow)":""))));return"Emitted in: ".concat(l.join(", "))},V=(null!=(p=null==(i=C.source)?void 0:i.topic)?p:"").trim(),_=!V||F.has(V);(0,a.useEffect)(()=>{let e=!1;return A.list().then(t=>{e||M(t.executions||[])}).catch(t=>{eM.warn("Failed to load planned executions for source picker",t),e||M([])}),()=>{e=!0}},[]);let K=(e,t)=>{var l;let n=new Set(null!=(l=C.on)?l:[]);t?n.add(e):n.delete(e),T({...C,on:Array.from(n)})};return(0,n.jsxs)(r.default,{sx:{mt:1},children:[(0,n.jsx)(o.default,{variant:"subtitle2",sx:{mt:1},children:"React to"}),(0,n.jsxs)(r.default,{sx:{display:"flex",gap:2,mt:1},children:[(0,n.jsxs)(J.A,{sx:{minWidth:180},children:[(0,n.jsx)(q.A,{id:"flow-event-source-kind",children:"Source"}),(0,n.jsxs)(G.A,{labelId:"flow-event-source-kind",label:"Source",value:R,onChange:e=>(e=>{T({...C,source:"flow"===e?{flowId:""}:"execution"===e?{executionId:""}:{topic:""}})})(e.target.value),children:[(0,n.jsx)(B.A,{value:"flow",children:"A flow (any run)"}),(0,n.jsx)(B.A,{value:"execution",children:"A planned execution"}),(0,n.jsx)(B.A,{value:"topic",children:"A signal topic"})]})]}),"topic"===R?(0,n.jsx)(J.A,{fullWidth:!0,children:(0,n.jsx)(eN.A,{freeSolo:!0,autoHighlight:!0,options:D,value:null!=(m=null==(c=C.source)?void 0:c.topic)?m:"",inputValue:null!=(g=null==(u=C.source)?void 0:u.topic)?g:"",onInputChange:(e,t)=>T({...C,source:{topic:t}}),renderOption:(e,t)=>{let l=$(t),s=(e=>{let t=L.get(e);if(!t||0===t.length)return null;let l=Array.from(new Set(t.map(e=>e.flowName||e.flowId)));return"Used by ".concat(t.length," trigger").concat(1===t.length?"":"s"," → starts ").concat(l.join(", "))})(t);return(0,a.createElement)(r.default,{component:"li",...e,key:t},(0,n.jsxs)(r.default,{sx:{display:"flex",flexDirection:"column",py:.25},children:[(0,n.jsx)(o.default,{variant:"body2",sx:{fontWeight:600},children:t}),l&&(0,n.jsx)(o.default,{variant:"caption",color:"text.secondary",children:l}),s&&(0,n.jsx)(o.default,{variant:"caption",color:"text.secondary",children:s}),!l&&(0,n.jsx)(o.default,{variant:"caption",color:"warning.main",children:"No flow currently emits this signal"})]}))},renderInput:e=>{var t;return(0,n.jsx)(U.A,{...e,label:"Signal topic",placeholder:"e.g. review-blocked",helperText:V?_?null!=(t=$(V))?t:"React when this signal is emitted.":"No flow currently emits this signal — the trigger will stay idle until one does.":"React when a signal node in any flow emits this topic. Suggestions come from your existing flows."})}})}):"flow"===R?(0,n.jsxs)(J.A,{fullWidth:!0,children:[(0,n.jsx)(q.A,{id:"flow-event-flow",children:"Flow to watch"}),(0,n.jsxs)(G.A,{labelId:"flow-event-flow",label:"Flow to watch",value:null!=(v=null==(h=C.source)?void 0:h.flowId)?v:"",onChange:e=>T({...C,source:{flowId:e.target.value}}),displayEmpty:!0,children:[0===I.length&&(0,n.jsx)(B.A,{value:"",disabled:!0,children:"No flows available"}),I.map(e=>(0,n.jsx)(B.A,{value:e.id,children:e.name},e.id))]})]}):(0,n.jsxs)(J.A,{fullWidth:!0,children:[(0,n.jsx)(q.A,{id:"flow-event-execution",children:"Planned execution to watch"}),(0,n.jsxs)(G.A,{labelId:"flow-event-execution",label:"Planned execution to watch",value:null!=(y=null==(x=C.source)?void 0:x.executionId)?y:"",onChange:e=>T({...C,source:{executionId:e.target.value}}),displayEmpty:!0,children:[0===W.filter(e=>e.execution.id!==N).length&&(0,n.jsx)(B.A,{value:"",disabled:!0,children:"No other planned executions"}),W.filter(e=>e.execution.id!==N).map(e=>(0,n.jsx)(B.A,{value:e.execution.id,children:e.execution.name},e.execution.id))]})]})]}),!z&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.default,{variant:"subtitle2",sx:{mt:2},children:"When it…"}),(0,n.jsxs)(ex.A,{row:!0,children:[(0,n.jsx)(s.A,{control:(0,n.jsx)(en.A,{checked:(null!=(w=C.on)?w:[]).includes("completed"),onChange:e=>K("completed",e.target.checked)}),label:"completes"}),(0,n.jsx)(s.A,{control:(0,n.jsx)(en.A,{checked:(null!=(j=C.on)?j:[]).includes("error"),onChange:e=>K("error",e.target.checked)}),label:"errors"})]})]}),(0,n.jsx)(U.A,{fullWidth:!0,label:z?"Only when the payload contains (optional)":"Only when the output contains (optional)",value:null!=(b=null==(f=C.outputMatch)?void 0:f.contains)?b:"",onChange:e=>{let t=e.target.value,l={...C.outputMatch,contains:t||void 0},n=l.contains||l.regex?l:void 0;T({...C,outputMatch:n})},margin:"normal",placeholder:"e.g. FAILED, or leave empty to react to every matching run"}),(0,n.jsx)(s.A,{sx:{mt:1},control:(0,n.jsx)(en.A,{checked:E,onChange:e=>P(e.target.checked)}),label:"Advanced (loop safety)"}),E&&(0,n.jsxs)(r.default,{sx:{display:"flex",gap:2,mt:1},children:[(0,n.jsx)(U.A,{label:"Max chain depth",type:"number",value:null!=(k=C.maxChainDepth)?k:"",onChange:e=>T({...C,maxChainDepth:""===e.target.value?void 0:Number(e.target.value)}),helperText:"Stop after this many hops (default 5)",inputProps:{min:1}}),(0,n.jsx)(U.A,{label:"Cooldown (ms)",type:"number",value:null!=(S=C.minIntervalMs)?S:"",onChange:e=>T({...C,minIntervalMs:""===e.target.value?void 0:Number(e.target.value)}),helperText:"Minimum gap between fires",inputProps:{min:0}})]}),(0,n.jsx)(H.A,{sx:{mt:2}}),(0,n.jsx)(d.A,{severity:"info",sx:{mt:2},children:z?"The signal’s payload is handed to this flow. Emit a signal from a signal node in any flow to fire this one — fire-and-forget. To avoid runaway loops, a chain of fires stops at the max depth above, and the overlap-skip prevents a single execution from re-triggering itself while it’s still running.":"The upstream run’s output is handed to this flow, so it can build on what the other flow produced. To avoid runaway loops, a chain of flow-event fires stops at the max depth above, and the existing overlap-skip prevents a single execution from re-triggering itself while it’s still running."})]})};var eP=l(75870);let eR=(0,w.h)("frontend/components/PlannedExecutions/ExecutionModal"),ez={type:"schedule",cron:"0 9 * * *"},eF={type:"file-watch",path:"",events:["add","change"]},eO={type:"mcp-poll",serverName:"",toolName:"",args:{},cron:"*/5 * * * *",evaluate:{mode:"on-change"}},eL={type:"url-watch",url:"",cron:"*/15 * * * *"},eD={type:"flow-event",source:{flowId:""},on:["completed"]},eH=e=>{var t,l;let{open:u,execution:m,onClose:g,onSaved:v}=e,[w,j]=(0,a.useState)(""),[b,k]=(0,a.useState)(""),[S,C]=(0,a.useState)(""),[T,I]=(0,a.useState)(!1),[N,W]=(0,a.useState)("skip"),[M,E]=(0,a.useState)(!1),[P,R]=(0,a.useState)("queue"),[z,F]=(0,a.useState)(ez),[O,L]=(0,a.useState)(""),[D,et]=(0,a.useState)([]),[en,er]=(0,a.useState)(!1),[ea,eo]=(0,a.useState)(!1),[es,ec]=(0,a.useState)(null);(0,a.useEffect)(()=>{var e,t,l,n,r,a;u&&(ec(null),j(null!=(e=null==m?void 0:m.name)?e:""),k(null!=(t=null==m?void 0:m.flowId)?t:""),C(null!=(l=null==m?void 0:m.prompt)?l:""),I((null==m?void 0:m.saveConversations)===!0),W(null!=(n=null==m?void 0:m.overlapStrategy)?n:"skip"),E((null==m?void 0:m.exclusive)===!0),R(null!=(r=null==m?void 0:m.nonExclusiveBehavior)?r:"queue"),F(null!=(a=null==m?void 0:m.trigger)?a:ez),L(m?"":crypto.randomUUID()))},[u,m]),(0,a.useEffect)(()=>{if(!u)return;let e=!1;return er(!0),ee.g.loadFlows().then(t=>{e||et(t||[])}).catch(t=>{eR.warn("Failed to load flows for execution picker",t),e||et([])}).finally(()=>{e||er(!1)}),()=>{e=!0}},[u]);let ed=!!b&&!en&&D.length>0&&!D.some(e=>e.id===b),eh=async()=>{var e;eo(!0),ec(null);let t={name:w,flowId:b,prompt:S,saveConversations:T,overlapStrategy:N,exclusive:M,nonExclusiveBehavior:P,trigger:z,enabled:null==(e=null==m?void 0:m.enabled)||e,...m?{}:{id:O}},l=m?await A.update(m.id,t):await A.create(t);if(eo(!1),!l.success)return void ec(l.error||"Failed to save");v(),g()};return(0,n.jsxs)(h.A,{open:u,onClose:g,maxWidth:"md",fullWidth:!0,PaperProps:{sx:{borderTop:5,borderColor:"primary.main",maxWidth:"95vw",maxHeight:"90vh"}},children:[(0,n.jsx)(x.A,{component:"div",children:(0,n.jsxs)(r.default,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[(0,n.jsx)(o.default,{variant:"h6",children:m?"Edit planned execution":"New planned execution"}),(0,n.jsx)(y.A,{edge:"end",color:"inherit",onClick:g,"aria-label":"close",children:(0,n.jsx)(V.A,{})})]})}),(0,n.jsx)(H.A,{}),(0,n.jsxs)(f.A,{sx:{p:3},children:[(0,n.jsx)(o.default,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"A planned execution runs one of your flows automatically — on a schedule or when something happens — without anyone sitting in the chat. Results show up in its run history on the Executions page."}),(0,n.jsx)(U.A,{fullWidth:!0,label:"Name",value:w,onChange:e=>j(e.target.value),margin:"normal",placeholder:"e.g. Morning news digest"}),(0,n.jsx)(o.default,{variant:"subtitle1",sx:{mt:3,mb:1,fontWeight:600},children:"1 \xb7 When should it run?"}),(0,n.jsxs)(r.default,{role:"radiogroup","aria-label":"Trigger type",sx:{display:"flex",gap:2,flexWrap:"wrap"},children:[(0,n.jsx)(el,{selected:"schedule"===z.type,onClick:()=>{"schedule"!==z.type&&F((null==m?void 0:m.trigger.type)==="schedule"?m.trigger:ez)},icon:(0,n.jsx)(_,{}),title:"On a schedule",description:"Run at fixed times — every few minutes, daily, on weekdays, or a custom rhythm."}),(0,n.jsx)(el,{selected:"webhook"===z.type,onClick:()=>{"webhook"!==z.type&&F((null==m?void 0:m.trigger.type)==="webhook"?m.trigger:{type:"webhook",token:crypto.randomUUID()})},icon:(0,n.jsx)(K,{}),title:"When called (webhook)",description:"Other apps run this flow by calling a URL — GitHub, Stripe, Slack and most services can send webhooks."}),(0,n.jsx)(el,{selected:"file-watch"===z.type,onClick:()=>{"file-watch"!==z.type&&F((null==m?void 0:m.trigger.type)==="file-watch"?m.trigger:eF)},icon:(0,n.jsx)(Q.A,{}),title:"When files change",description:"Watch a folder on this computer and run when files appear, change, or disappear."}),(0,n.jsx)(el,{selected:"mcp-poll"===z.type,onClick:()=>{"mcp-poll"!==z.type&&F((null==m?void 0:m.trigger.type)==="mcp-poll"?m.trigger:eO)},icon:(0,n.jsx)(X,{}),title:"Watch a tool",description:"Check one of your MCP tools regularly — run when its result changes, or let AI decide."}),(0,n.jsx)(el,{selected:"url-watch"===z.type,onClick:()=>{"url-watch"!==z.type&&F((null==m?void 0:m.trigger.type)==="url-watch"?m.trigger:eL)},icon:(0,n.jsx)(Y.A,{}),title:"When a website changes",description:"Check a URL regularly and run when its content is different from the last check."}),(0,n.jsx)(el,{selected:"flow-event"===z.type,onClick:()=>{"flow-event"!==z.type&&F((null==m?void 0:m.trigger.type)==="flow-event"?m.trigger:eD)},icon:(0,n.jsx)(Z,{}),title:"When another flow finishes",description:"React to another flow completing or erroring — chain flows together or run triage when something fails."})]}),"schedule"===z.type&&(0,n.jsx)(ei,{cron:z.cron,timezone:z.timezone,onChange:e=>{let{cron:t,timezone:l}=e;return F({...z,cron:t,timezone:l})},catchUp:!0===z.catchUp,onCatchUpChange:e=>F({...z,catchUp:e})}),"webhook"===z.type&&(0,n.jsx)(eu,{config:z,onChange:F,executionId:null!=(t=null==m?void 0:m.id)?t:O,saved:null!==m}),"file-watch"===z.type&&(0,n.jsx)(eg,{config:z,onChange:F}),"mcp-poll"===z.type&&(0,n.jsx)(eT,{config:z,onChange:F}),"url-watch"===z.type&&(0,n.jsx)(eI,{config:z,onChange:F}),"flow-event"===z.type&&(0,n.jsx)(eE,{config:z,onChange:F,flows:D,currentExecutionId:null!=(l=null==m?void 0:m.id)?l:O}),(0,n.jsxs)(J.A,{fullWidth:!0,margin:"normal",children:[(0,n.jsx)(q.A,{id:"overlap-strategy-label",children:"If it's already running…"}),(0,n.jsxs)(G.A,{labelId:"overlap-strategy-label",label:"If it's already running…",value:N,onChange:e=>W(e.target.value),children:[(0,n.jsx)(B.A,{value:"skip",children:"Skip the new run (default)"}),(0,n.jsx)(B.A,{value:"queue",children:"Queue it — run after the current one finishes"}),(0,n.jsx)(B.A,{value:"parallel",children:"Run in parallel — allow concurrent runs"}),(0,n.jsx)(B.A,{value:"error",children:"Reject it — record an error (webhook gets 409)"})]}),(0,n.jsx)($.A,{children:"parallel"===N&&("url-watch"===z.type||"mcp-poll"===z.type)?"Heads up: parallel runs of a change-watching trigger can race each other — skip or queue is usually safer here.":"queue"===N?"Queued fires run one at a time, in order. A burst is capped so it can’t grow without limit.":"What happens when this trigger fires while a previous run of it is still going."})]}),(0,n.jsx)(s.A,{sx:{mt:1},control:(0,n.jsx)(i.A,{checked:M,onChange:e=>E(e.target.checked)}),label:"Exclusive — only run when nothing else is running, and block other runs while it does"}),M&&(0,n.jsxs)(J.A,{fullWidth:!0,margin:"normal",children:[(0,n.jsx)(q.A,{id:"non-exclusive-behavior-label",children:"While this runs, other triggers…"}),(0,n.jsxs)(G.A,{labelId:"non-exclusive-behavior-label",label:"While this runs, other triggers…",value:P,onChange:e=>R(e.target.value),children:[(0,n.jsx)(B.A,{value:"queue",children:"Queue — run them after this finishes (default)"}),(0,n.jsx)(B.A,{value:"skip",children:"Skip — drop them"}),(0,n.jsx)(B.A,{value:"error",children:"Fail — reject them (webhook gets 423)"})]}),(0,n.jsx)($.A,{children:"An exclusive run waits until the scheduler is idle, then holds a global lock so no other planned execution can start until it finishes."})]}),(0,n.jsx)(H.A,{sx:{mt:3}}),(0,n.jsx)(o.default,{variant:"subtitle1",sx:{mt:2,mb:0,fontWeight:600},children:"2 \xb7 What should it run?"}),(0,n.jsx)(r.default,{sx:{mt:2},children:(0,n.jsx)(eP.A,{selectedFlowId:b||null,onSelectFlow:k,disabled:ea,hideLabel:!0})}),ed&&(0,n.jsx)(d.A,{severity:"warning",sx:{mt:1},children:"The previously selected flow no longer exists. Please choose another."}),(0,n.jsx)(U.A,{fullWidth:!0,label:"What should the flow do?",value:S,onChange:e=>C(e.target.value),margin:"normal",multiline:!0,rows:3,helperText:"Sent to the flow as the user message each time this runs. Run details are attached automatically: current time, what triggered it, the previous run, the next planned run, and any trigger data."}),(0,n.jsx)(s.A,{sx:{mt:1},control:(0,n.jsx)(i.A,{checked:T,onChange:e=>I(e.target.checked)}),label:"Save full conversations (each run appears in the chat sidebar — useful for debugging)"}),es&&(0,n.jsx)(d.A,{severity:"error",sx:{mt:2},children:es})]}),(0,n.jsxs)(p.A,{children:[(0,n.jsx)(c.A,{onClick:g,children:"Cancel"}),(0,n.jsx)(c.A,{onClick:eh,variant:"contained",color:"primary",disabled:ea||!w.trim()||!b,children:ea?"Saving…":"Save"})]})]})},eU=(0,w.h)("frontend/components/PlannedExecutions"),eJ=()=>{let[e,t]=(0,a.useState)([]),[l,w]=(0,a.useState)(!1),[j,b]=(0,a.useState)(!1),[k,S]=(0,a.useState)(!1),[C,T]=(0,a.useState)(null),[I,N]=(0,a.useState)(null),[W,M]=(0,a.useState)(null),E=(0,a.useCallback)(async()=>{let e=await A.list();t(e.executions),w(e.paused),b(!0)},[]);(0,a.useEffect)(()=>{E()},[E]);let P=e.some(e=>e.status.running);(0,a.useEffect)(()=>{let e=setInterval(()=>{document.hidden||E()},P?3e3:1e4);return()=>clearInterval(e)},[E,P]);let R=async e=>{w(e);let t=await A.setPaused(e);t.success||eU.warn("Failed to toggle pause",t.error),E()},z=async(e,t)=>{let l=await A.update(e.id,{enabled:t});if(!l.success){let e=l.error||"Failed to update the planned execution.";eU.warn("Failed to toggle enabled",e),M(e)}E()},F=async()=>{I&&(await A.delete(I.id),N(null),E())};return(0,n.jsxs)(r.default,{sx:{p:3,maxWidth:1100,mx:"auto",width:"100%"},children:[(0,n.jsxs)(r.default,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:2,mb:1},children:[(0,n.jsx)(o.default,{variant:"h5",children:"Planned Executions"}),(0,n.jsxs)(r.default,{sx:{display:"flex",alignItems:"center",gap:2},children:[(0,n.jsx)(v.A,{title:"Refresh",children:(0,n.jsx)(y.A,{onClick:()=>void E(),children:(0,n.jsx)(g.A,{})})}),(0,n.jsx)(s.A,{control:(0,n.jsx)(i.A,{checked:!l,onChange:e=>R(!e.target.checked)}),label:l?"Paused":"Active"}),(0,n.jsx)(c.A,{variant:"contained",startIcon:(0,n.jsx)(m.A,{}),onClick:()=>{T(null),S(!0)},"data-tour":"add-execution",children:"Add"})]})]}),(0,n.jsxs)(o.default,{variant:"body2",color:"text.secondary",sx:{mb:3},children:["Run your flows automatically — on a schedule or when something happens — without opening the chat. FLUJO must be running for triggers to fire. The Active/Paused switch above gates ",(0,n.jsx)("em",{children:"all"})," triggers globally."]}),l&&e.length>0&&(0,n.jsx)(d.A,{severity:"info",sx:{mb:3},children:"The scheduler is paused — no triggers will fire, so every execution below shows “Paused (global)”. Switch it to Active (top right) to arm them."}),j&&0===e.length&&(0,n.jsxs)(r.default,{sx:{border:1,borderColor:"divider",borderRadius:2,borderStyle:"dashed",p:6,textAlign:"center"},children:[(0,n.jsx)(o.default,{variant:"h6",sx:{mb:1},children:"Nothing planned yet"}),(0,n.jsx)(o.default,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"Create your first planned execution to run a flow on a schedule."}),(0,n.jsx)(c.A,{variant:"contained",startIcon:(0,n.jsx)(m.A,{}),onClick:()=>{T(null),S(!0)},children:"New planned execution"})]}),(0,n.jsx)(r.default,{sx:{display:"flex",flexDirection:"column",gap:2},children:e.map(e=>(0,n.jsx)(D,{entry:e,onEdit:()=>{T(e.execution),S(!0)},onDelete:()=>N(e.execution),onToggleEnabled:t=>z(e.execution,t),onRanNow:()=>void E(),paused:l},e.execution.id))}),(0,n.jsx)(eH,{open:k,execution:C,onClose:()=>S(!1),onSaved:()=>void E()}),(0,n.jsx)(u.A,{open:null!==W,autoHideDuration:6e3,onClose:()=>M(null),anchorOrigin:{vertical:"bottom",horizontal:"center"},children:(0,n.jsx)(d.A,{severity:"error",onClose:()=>M(null),sx:{width:"100%"},children:W})}),(0,n.jsxs)(h.A,{open:null!==I,onClose:()=>N(null),children:[(0,n.jsxs)(x.A,{children:["Delete “",null==I?void 0:I.name,"”?"]}),(0,n.jsx)(f.A,{children:(0,n.jsx)(o.default,{variant:"body2",color:"text.secondary",children:"This removes the planned execution and its run history. The flow itself is not affected."})}),(0,n.jsxs)(p.A,{children:[(0,n.jsx)(c.A,{onClick:()=>N(null),children:"Cancel"}),(0,n.jsx)(c.A,{color:"error",variant:"contained",onClick:F,children:"Delete"})]})]})]})},eq=(0,w.h)("app/executions/page");function eG(){return eq.debug("Rendering ExecutionsPage"),(0,n.jsx)(r.default,{sx:{height:"100%",display:"flex",flexDirection:"column"},children:(0,n.jsx)(eJ,{})})}},75870:(e,t,l)=>{"use strict";l.d(t,{A:()=>f});var n=l(95155),r=l(12115),a=l(94049),o=l(25635),s=l(4474),i=l(91871),c=l(56900),d=l(90057),u=l(96362),h=l(9226),x=l(68503);let f=e=>{let{selectedFlowId:t,onSelectFlow:l,disabled:f=!1,hideLabel:p=!1}=e,[m,g]=(0,r.useState)([]),[v,y]=(0,r.useState)(!0),[w,j]=(0,r.useState)(null),[b,A]=(0,r.useState)(!1);(0,r.useEffect)(()=>{(async()=>{y(!0),j(null);try{let e=await d.g.loadFlows();g(e)}catch(e){console.error("Error loading flows:",e),j("Failed to load flows")}finally{y(!1)}})()},[]);let k=e=>{l(e),A(!1)},S=async e=>{let t=m.find(t=>t.id===e);if(!t)return;let l=!t.favorite,n={...t,favorite:l||void 0};try{(await d.g.updateFlow(n)).success&&g(t=>t.map(t=>t.id===e?n:t))}catch(e){console.error("Error toggling flow favorite:",e)}},C=(0,x.E)("flows",m),T=e=>({key:e.id,content:(e=>(0,n.jsx)(h.A,{flow:e,selected:e.id===t,onSelect:k,onToggleFavorite:S,pickerMode:!0}))(e)}),I=C.items.map(T),N=C.groups?C.groups.map(e=>({...e,items:e.items.map(T)})):null,W=(()=>{if(!t)return"";let e=m.find(e=>e.id===t);return e?e.name:""})();return(0,n.jsxs)(a.default,{children:[!p&&(0,n.jsx)(o.default,{variant:"subtitle1",gutterBottom:!0,children:"Select Flow"}),v?(0,n.jsxs)(a.default,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,n.jsx)(s.default,{size:20}),(0,n.jsx)(o.default,{variant:"body2",color:"text.secondary",children:"Loading flows..."})]}):w?(0,n.jsx)(o.default,{color:"error",variant:"body2",children:w}):0===m.length?(0,n.jsx)(o.default,{variant:"body2",color:"text.secondary",children:"No flows available. Create some flows in the Flow Builder first."}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(i.A,{variant:"outlined",startIcon:(0,n.jsx)(c.A,{}),onClick:()=>A(!0),disabled:f,sx:{textTransform:"none",maxWidth:"100%"},children:(0,n.jsx)(a.default,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t&&W||"Select a flow"})}),(0,n.jsx)(o.default,{variant:"caption",color:"text.secondary",display:"block",sx:{mt:.5},children:t?'Using "'.concat(W,'" flow for this conversation'):"Select a flow to use for this conversation"}),(0,n.jsx)(u.A,{open:b,onClose:()=>A(!1),title:"Select a flow",description:"Pick the flow this conversation will run.",skeleton:(0,n.jsx)(h.o,{}),emptyMessage:"No flows available. Create some flows in the Flow Builder first.",searchable:!0,searchPlaceholder:"Search flows…",searchTerm:C.searchTerm,onSearchChange:C.setSearchTerm,items:I,groups:N,collapsedKeys:C.collapsedKeys,onToggleGroup:C.toggleGroup})]})]})}}},e=>{e.O(0,[3862,2678,4754,9244,7274,1871,9704,2003,9562,488,3272,8470,3077,8598,9240,2403,3333,3556,1731,9554,4690,8607,3109,812,2566,5336,8441,1255,7358],()=>e(e.s=60187)),_N_E=e.O()}]);