flujo-ai 3.33.0 → 3.35.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 (549) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +292 -285
  3. package/.next/app-path-routes-manifest.json +20 -19
  4. package/.next/build-manifest.json +5 -5
  5. package/.next/prerender-manifest.json +21 -21
  6. package/.next/react-loadable-manifest.json +3 -3
  7. package/.next/routes-manifest.json +9 -0
  8. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  9. package/.next/server/app/_not-found.html +1 -1
  10. package/.next/server/app/_not-found.rsc +2 -2
  11. package/.next/server/app/api/approvals/[id]/route.js +1 -1
  12. package/.next/server/app/api/approvals/[id]/route.js.nft.json +1 -1
  13. package/.next/server/app/api/approvals/[id]/route_client-reference-manifest.js +1 -1
  14. package/.next/server/app/api/approvals/route.js +2 -2
  15. package/.next/server/app/api/approvals/route.js.nft.json +1 -1
  16. package/.next/server/app/api/approvals/route_client-reference-manifest.js +1 -1
  17. package/.next/server/app/api/backup/route.js +1 -1
  18. package/.next/server/app/api/backup/route.js.nft.json +1 -1
  19. package/.next/server/app/api/backup/route_client-reference-manifest.js +1 -1
  20. package/.next/server/app/api/browse/route_client-reference-manifest.js +1 -1
  21. package/.next/server/app/api/bugs/enhance/route.js +1 -1
  22. package/.next/server/app/api/bugs/enhance/route.js.nft.json +1 -1
  23. package/.next/server/app/api/bugs/enhance/route_client-reference-manifest.js +1 -1
  24. package/.next/server/app/api/cwd/route_client-reference-manifest.js +1 -1
  25. package/.next/server/app/api/encryption/secure/route.js +1 -1
  26. package/.next/server/app/api/encryption/secure/route.js.nft.json +1 -1
  27. package/.next/server/app/api/encryption/secure/route_client-reference-manifest.js +1 -1
  28. package/.next/server/app/api/env/route.js +2 -2
  29. package/.next/server/app/api/env/route_client-reference-manifest.js +1 -1
  30. package/.next/server/app/api/flow/[id]/route.js.nft.json +1 -1
  31. package/.next/server/app/api/flow/[id]/route_client-reference-manifest.js +1 -1
  32. package/.next/server/app/api/flow/[id]/versions/[versionId]/route.js.nft.json +1 -1
  33. package/.next/server/app/api/flow/[id]/versions/[versionId]/route_client-reference-manifest.js +1 -1
  34. package/.next/server/app/api/flow/[id]/versions/route.js.nft.json +1 -1
  35. package/.next/server/app/api/flow/[id]/versions/route_client-reference-manifest.js +1 -1
  36. package/.next/server/app/api/flow/compile/route.js +1 -1
  37. package/.next/server/app/api/flow/compile/route.js.nft.json +1 -1
  38. package/.next/server/app/api/flow/compile/route_client-reference-manifest.js +1 -1
  39. package/.next/server/app/api/flow/generate/route.js +1 -1
  40. package/.next/server/app/api/flow/generate/route.js.nft.json +1 -1
  41. package/.next/server/app/api/flow/generate/route_client-reference-manifest.js +1 -1
  42. package/.next/server/app/api/flow/generator/route.js +25 -4
  43. package/.next/server/app/api/flow/generator/route.js.nft.json +1 -1
  44. package/.next/server/app/api/flow/generator/route_client-reference-manifest.js +1 -1
  45. package/.next/server/app/api/flow/improve/route.js +1 -1
  46. package/.next/server/app/api/flow/improve/route.js.nft.json +1 -1
  47. package/.next/server/app/api/flow/improve/route_client-reference-manifest.js +1 -1
  48. package/.next/server/app/api/flow/prompt-renderer/route.js +1 -1
  49. package/.next/server/app/api/flow/prompt-renderer/route.js.nft.json +1 -1
  50. package/.next/server/app/api/flow/prompt-renderer/route_client-reference-manifest.js +1 -1
  51. package/.next/server/app/api/flow/quick-chat/route.js.nft.json +1 -1
  52. package/.next/server/app/api/flow/quick-chat/route_client-reference-manifest.js +1 -1
  53. package/.next/server/app/api/flow/repair/route.js +1 -1
  54. package/.next/server/app/api/flow/repair/route.js.nft.json +1 -1
  55. package/.next/server/app/api/flow/repair/route_client-reference-manifest.js +1 -1
  56. package/.next/server/app/api/flow/route.js.nft.json +1 -1
  57. package/.next/server/app/api/flow/route_client-reference-manifest.js +1 -1
  58. package/.next/server/app/api/git/route_client-reference-manifest.js +1 -1
  59. package/.next/server/app/api/init/route.js +1 -1
  60. package/.next/server/app/api/init/route.js.nft.json +1 -1
  61. package/.next/server/app/api/init/route_client-reference-manifest.js +1 -1
  62. package/.next/server/app/api/local-models/capability/route_client-reference-manifest.js +1 -1
  63. package/.next/server/app/api/local-models/pull/route_client-reference-manifest.js +1 -1
  64. package/.next/server/app/api/local-models/suggest/route_client-reference-manifest.js +1 -1
  65. package/.next/server/app/api/mcp/app-sandbox/route_client-reference-manifest.js +1 -1
  66. package/.next/server/app/api/mcp/cancel/route.js +1 -1
  67. package/.next/server/app/api/mcp/cancel/route.js.nft.json +1 -1
  68. package/.next/server/app/api/mcp/cancel/route_client-reference-manifest.js +1 -1
  69. package/.next/server/app/api/mcp/oauth-capability/route.js.nft.json +1 -1
  70. package/.next/server/app/api/mcp/oauth-capability/route_client-reference-manifest.js +1 -1
  71. package/.next/server/app/api/mcp/servers/[name]/prompts/get/route.js.nft.json +1 -1
  72. package/.next/server/app/api/mcp/servers/[name]/prompts/get/route_client-reference-manifest.js +1 -1
  73. package/.next/server/app/api/mcp/servers/[name]/prompts/route.js.nft.json +1 -1
  74. package/.next/server/app/api/mcp/servers/[name]/prompts/route_client-reference-manifest.js +1 -1
  75. package/.next/server/app/api/mcp/servers/[name]/resources/read/route.js.nft.json +1 -1
  76. package/.next/server/app/api/mcp/servers/[name]/resources/read/route_client-reference-manifest.js +1 -1
  77. package/.next/server/app/api/mcp/servers/[name]/resources/route.js.nft.json +1 -1
  78. package/.next/server/app/api/mcp/servers/[name]/resources/route_client-reference-manifest.js +1 -1
  79. package/.next/server/app/api/mcp/servers/[name]/route.js.nft.json +1 -1
  80. package/.next/server/app/api/mcp/servers/[name]/route_client-reference-manifest.js +1 -1
  81. package/.next/server/app/api/mcp/servers/[name]/status/route.js.nft.json +1 -1
  82. package/.next/server/app/api/mcp/servers/[name]/status/route_client-reference-manifest.js +1 -1
  83. package/.next/server/app/api/mcp/servers/[name]/tools/[toolName]/route.js.nft.json +1 -1
  84. package/.next/server/app/api/mcp/servers/[name]/tools/[toolName]/route_client-reference-manifest.js +1 -1
  85. package/.next/server/app/api/mcp/servers/[name]/tools/route.js.nft.json +1 -1
  86. package/.next/server/app/api/mcp/servers/[name]/tools/route_client-reference-manifest.js +1 -1
  87. package/.next/server/app/api/mcp/servers/route.js.nft.json +1 -1
  88. package/.next/server/app/api/mcp/servers/route_client-reference-manifest.js +1 -1
  89. package/.next/server/app/api/mcp/test-connection/route.js.nft.json +1 -1
  90. package/.next/server/app/api/mcp/test-connection/route_client-reference-manifest.js +1 -1
  91. package/.next/server/app/api/mcp/test-connection/stream/route.js.nft.json +1 -1
  92. package/.next/server/app/api/mcp/test-connection/stream/route_client-reference-manifest.js +1 -1
  93. package/.next/server/app/api/mcp-registry/route.js +1 -1
  94. package/.next/server/app/api/mcp-registry/route.js.nft.json +1 -1
  95. package/.next/server/app/api/mcp-registry/route_client-reference-manifest.js +1 -1
  96. package/.next/server/app/api/mcp-registry/spotlight/route.js +1 -1
  97. package/.next/server/app/api/mcp-registry/spotlight/route_client-reference-manifest.js +1 -1
  98. package/.next/server/app/api/model/[id]/route.js.nft.json +1 -1
  99. package/.next/server/app/api/model/[id]/route_client-reference-manifest.js +1 -1
  100. package/.next/server/app/api/model/provider/route.js +1 -1
  101. package/.next/server/app/api/model/provider/route.js.nft.json +1 -1
  102. package/.next/server/app/api/model/provider/route_client-reference-manifest.js +1 -1
  103. package/.next/server/app/api/model/route.js.nft.json +1 -1
  104. package/.next/server/app/api/model/route_client-reference-manifest.js +1 -1
  105. package/.next/server/app/api/model/test/route.js +1 -1
  106. package/.next/server/app/api/model/test/route.js.nft.json +1 -1
  107. package/.next/server/app/api/model/test/route_client-reference-manifest.js +1 -1
  108. package/.next/server/app/api/oauth/callback/route.js +1 -1
  109. package/.next/server/app/api/oauth/callback/route_client-reference-manifest.js +1 -1
  110. package/.next/server/app/api/oauth/initiate/route.js +1 -1
  111. package/.next/server/app/api/oauth/initiate/route_client-reference-manifest.js +1 -1
  112. package/.next/server/app/api/oauth/reset/route.js +1 -1
  113. package/.next/server/app/api/oauth/reset/route.js.nft.json +1 -1
  114. package/.next/server/app/api/oauth/reset/route_client-reference-manifest.js +1 -1
  115. package/.next/server/app/api/packages/build/route.js +1 -1
  116. package/.next/server/app/api/packages/build/route.js.nft.json +1 -1
  117. package/.next/server/app/api/packages/build/route_client-reference-manifest.js +1 -1
  118. package/.next/server/app/api/packages/derive-secrets/route.js.nft.json +1 -1
  119. package/.next/server/app/api/packages/derive-secrets/route_client-reference-manifest.js +1 -1
  120. package/.next/server/app/api/packages/install/route.js.nft.json +1 -1
  121. package/.next/server/app/api/packages/install/route_client-reference-manifest.js +1 -1
  122. package/.next/server/app/api/packages/install/status/route.js.nft.json +1 -1
  123. package/.next/server/app/api/packages/install/status/route_client-reference-manifest.js +1 -1
  124. package/.next/server/app/api/packages/installed/route.js.nft.json +1 -1
  125. package/.next/server/app/api/packages/installed/route_client-reference-manifest.js +1 -1
  126. package/.next/server/app/api/packages/resolve/route.js +1 -1
  127. package/.next/server/app/api/packages/resolve/route.js.nft.json +1 -1
  128. package/.next/server/app/api/packages/resolve/route_client-reference-manifest.js +1 -1
  129. package/.next/server/app/api/packages/scan-targets/route.js.nft.json +1 -1
  130. package/.next/server/app/api/packages/scan-targets/route_client-reference-manifest.js +1 -1
  131. package/.next/server/app/api/packages/search/route.js +1 -1
  132. package/.next/server/app/api/packages/search/route_client-reference-manifest.js +1 -1
  133. package/.next/server/app/api/packages/uninstall/route.js.nft.json +1 -1
  134. package/.next/server/app/api/packages/uninstall/route_client-reference-manifest.js +1 -1
  135. package/.next/server/app/api/planned-executions/[id]/route.js +1 -1
  136. package/.next/server/app/api/planned-executions/[id]/route.js.nft.json +1 -1
  137. package/.next/server/app/api/planned-executions/[id]/route_client-reference-manifest.js +1 -1
  138. package/.next/server/app/api/planned-executions/[id]/run/route.js +1 -1
  139. package/.next/server/app/api/planned-executions/[id]/run/route.js.nft.json +1 -1
  140. package/.next/server/app/api/planned-executions/[id]/run/route_client-reference-manifest.js +1 -1
  141. package/.next/server/app/api/planned-executions/[id]/runs/route.js +1 -1
  142. package/.next/server/app/api/planned-executions/[id]/runs/route.js.nft.json +1 -1
  143. package/.next/server/app/api/planned-executions/[id]/runs/route_client-reference-manifest.js +1 -1
  144. package/.next/server/app/api/planned-executions/preview-schedule/route_client-reference-manifest.js +1 -1
  145. package/.next/server/app/api/planned-executions/reconcile/route.js +1 -1
  146. package/.next/server/app/api/planned-executions/reconcile/route.js.nft.json +1 -1
  147. package/.next/server/app/api/planned-executions/reconcile/route_client-reference-manifest.js +1 -1
  148. package/.next/server/app/api/planned-executions/route.js +1 -1
  149. package/.next/server/app/api/planned-executions/route.js.nft.json +1 -1
  150. package/.next/server/app/api/planned-executions/route_client-reference-manifest.js +1 -1
  151. package/.next/server/app/api/registry/auth/resend/route_client-reference-manifest.js +1 -1
  152. package/.next/server/app/api/registry/auth/reset/route_client-reference-manifest.js +1 -1
  153. package/.next/server/app/api/registry/auth/route_client-reference-manifest.js +1 -1
  154. package/.next/server/app/api/registry/feedback/route.js +1 -1
  155. package/.next/server/app/api/registry/feedback/route_client-reference-manifest.js +1 -1
  156. package/.next/server/app/api/registry/oauth/callback/route_client-reference-manifest.js +1 -1
  157. package/.next/server/app/api/registry/oauth/initiate/route_client-reference-manifest.js +1 -1
  158. package/.next/server/app/api/registry/packages/route_client-reference-manifest.js +1 -1
  159. package/.next/server/app/api/registry/publish/route_client-reference-manifest.js +1 -1
  160. package/.next/server/app/api/registry/settings/route_client-reference-manifest.js +1 -1
  161. package/.next/server/app/api/restore/route.js +1 -1
  162. package/.next/server/app/api/restore/route.js.nft.json +1 -1
  163. package/.next/server/app/api/restore/route_client-reference-manifest.js +1 -1
  164. package/.next/server/app/api/runs/active/route.js +1 -1
  165. package/.next/server/app/api/runs/active/route.js.nft.json +1 -1
  166. package/.next/server/app/api/runs/active/route_client-reference-manifest.js +1 -1
  167. package/.next/server/app/api/storage/route.js +1 -1
  168. package/.next/server/app/api/storage/route_client-reference-manifest.js +1 -1
  169. package/.next/server/app/api/telemetry/daily-active/route.js +1 -1
  170. package/.next/server/app/api/telemetry/daily-active/route_client-reference-manifest.js +1 -1
  171. package/.next/server/app/api/update/route.js +1 -1
  172. package/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
  173. package/.next/server/app/api/waves/route.js +1 -1
  174. package/.next/server/app/api/waves/route.js.nft.json +1 -1
  175. package/.next/server/app/api/waves/route_client-reference-manifest.js +1 -1
  176. package/.next/server/app/api/webhooks/[id]/route.js +1 -1
  177. package/.next/server/app/api/webhooks/[id]/route.js.nft.json +1 -1
  178. package/.next/server/app/api/webhooks/[id]/route_client-reference-manifest.js +1 -1
  179. package/.next/server/app/chat/page.js +2 -2
  180. package/.next/server/app/chat/page.js.nft.json +1 -1
  181. package/.next/server/app/chat/page_client-reference-manifest.js +1 -1
  182. package/.next/server/app/chat.html +1 -1
  183. package/.next/server/app/chat.rsc +3 -3
  184. package/.next/server/app/docs/page_client-reference-manifest.js +1 -1
  185. package/.next/server/app/docs.html +1 -1
  186. package/.next/server/app/docs.rsc +2 -2
  187. package/.next/server/app/executions/page.js +2 -2
  188. package/.next/server/app/executions/page.js.nft.json +1 -1
  189. package/.next/server/app/executions/page_client-reference-manifest.js +1 -1
  190. package/.next/server/app/executions.html +1 -1
  191. package/.next/server/app/executions.rsc +3 -3
  192. package/.next/server/app/flows/page.js +3 -3
  193. package/.next/server/app/flows/page.js.nft.json +1 -1
  194. package/.next/server/app/flows/page_client-reference-manifest.js +1 -1
  195. package/.next/server/app/flows.html +1 -1
  196. package/.next/server/app/flows.rsc +3 -3
  197. package/.next/server/app/index.html +1 -1
  198. package/.next/server/app/index.rsc +3 -3
  199. package/.next/server/app/mcp/page.js +1 -1
  200. package/.next/server/app/mcp/page_client-reference-manifest.js +1 -1
  201. package/.next/server/app/mcp-flows/route.js +1 -1
  202. package/.next/server/app/mcp-flows/route.js.nft.json +1 -1
  203. package/.next/server/app/mcp-flows/route_client-reference-manifest.js +1 -1
  204. package/.next/server/app/mcp-proxy/[server]/route.js +1 -1
  205. package/.next/server/app/mcp-proxy/[server]/route.js.nft.json +1 -1
  206. package/.next/server/app/mcp-proxy/[server]/route_client-reference-manifest.js +1 -1
  207. package/.next/server/app/mcp.html +1 -1
  208. package/.next/server/app/mcp.rsc +3 -3
  209. package/.next/server/app/models/page.js +1 -1
  210. package/.next/server/app/models/page.js.nft.json +1 -1
  211. package/.next/server/app/models/page_client-reference-manifest.js +1 -1
  212. package/.next/server/app/packages/page.js +1 -1
  213. package/.next/server/app/packages/page_client-reference-manifest.js +1 -1
  214. package/.next/server/app/packages.html +1 -1
  215. package/.next/server/app/packages.rsc +3 -3
  216. package/.next/server/app/page.js +4 -2
  217. package/.next/server/app/page_client-reference-manifest.js +1 -1
  218. package/.next/server/app/settings/page.js +1 -1
  219. package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  220. package/.next/server/app/settings.html +1 -1
  221. package/.next/server/app/settings.rsc +3 -3
  222. package/.next/server/app/v1/chat/completions/route.js.nft.json +1 -1
  223. package/.next/server/app/v1/chat/completions/route_client-reference-manifest.js +1 -1
  224. package/.next/server/app/v1/chat/conversations/[conversationId]/breakpoints/route.js +2 -2
  225. package/.next/server/app/v1/chat/conversations/[conversationId]/breakpoints/route.js.nft.json +1 -1
  226. package/.next/server/app/v1/chat/conversations/[conversationId]/breakpoints/route_client-reference-manifest.js +1 -1
  227. package/.next/server/app/v1/chat/conversations/[conversationId]/cancel/route.js +2 -2
  228. package/.next/server/app/v1/chat/conversations/[conversationId]/cancel/route.js.nft.json +1 -1
  229. package/.next/server/app/v1/chat/conversations/[conversationId]/cancel/route_client-reference-manifest.js +1 -1
  230. package/.next/server/app/v1/chat/conversations/[conversationId]/debug/continue/route.js +1 -1
  231. package/.next/server/app/v1/chat/conversations/[conversationId]/debug/continue/route.js.nft.json +1 -1
  232. package/.next/server/app/v1/chat/conversations/[conversationId]/debug/continue/route_client-reference-manifest.js +1 -1
  233. package/.next/server/app/v1/chat/conversations/[conversationId]/debug/step/route.js +1 -1
  234. package/.next/server/app/v1/chat/conversations/[conversationId]/debug/step/route.js.nft.json +1 -1
  235. package/.next/server/app/v1/chat/conversations/[conversationId]/debug/step/route_client-reference-manifest.js +1 -1
  236. package/.next/server/app/v1/chat/conversations/[conversationId]/edit-state/route.js +2 -2
  237. package/.next/server/app/v1/chat/conversations/[conversationId]/edit-state/route.js.nft.json +1 -1
  238. package/.next/server/app/v1/chat/conversations/[conversationId]/edit-state/route_client-reference-manifest.js +1 -1
  239. package/.next/server/app/v1/chat/conversations/[conversationId]/events/route.js +1 -1
  240. package/.next/server/app/v1/chat/conversations/[conversationId]/events/route.js.nft.json +1 -1
  241. package/.next/server/app/v1/chat/conversations/[conversationId]/events/route_client-reference-manifest.js +1 -1
  242. package/.next/server/app/v1/chat/conversations/[conversationId]/inject/route.js +1 -1
  243. package/.next/server/app/v1/chat/conversations/[conversationId]/inject/route.js.nft.json +1 -1
  244. package/.next/server/app/v1/chat/conversations/[conversationId]/inject/route_client-reference-manifest.js +1 -1
  245. package/.next/server/app/v1/chat/conversations/[conversationId]/resources/[resourceId]/content/route.js +1 -0
  246. package/.next/server/app/v1/chat/conversations/[conversationId]/resources/[resourceId]/content/route.js.nft.json +1 -0
  247. package/.next/server/app/v1/chat/conversations/[conversationId]/resources/[resourceId]/content/route_client-reference-manifest.js +1 -0
  248. package/.next/server/app/v1/chat/conversations/[conversationId]/resources/route.js +1 -1
  249. package/.next/server/app/v1/chat/conversations/[conversationId]/resources/route_client-reference-manifest.js +1 -1
  250. package/.next/server/app/v1/chat/conversations/[conversationId]/respond/route.js +1 -1
  251. package/.next/server/app/v1/chat/conversations/[conversationId]/respond/route.js.nft.json +1 -1
  252. package/.next/server/app/v1/chat/conversations/[conversationId]/respond/route_client-reference-manifest.js +1 -1
  253. package/.next/server/app/v1/chat/conversations/[conversationId]/route.js +1 -1
  254. package/.next/server/app/v1/chat/conversations/[conversationId]/route.js.nft.json +1 -1
  255. package/.next/server/app/v1/chat/conversations/[conversationId]/route_client-reference-manifest.js +1 -1
  256. package/.next/server/app/v1/chat/conversations/route.js +1 -1
  257. package/.next/server/app/v1/chat/conversations/route.js.nft.json +1 -1
  258. package/.next/server/app/v1/chat/conversations/route_client-reference-manifest.js +1 -1
  259. package/.next/server/app/v1/chat/events/route.js +1 -1
  260. package/.next/server/app/v1/chat/events/route.js.nft.json +1 -1
  261. package/.next/server/app/v1/chat/events/route_client-reference-manifest.js +1 -1
  262. package/.next/server/app/v1/models/route.js +1 -1
  263. package/.next/server/app/v1/models/route.js.nft.json +1 -1
  264. package/.next/server/app/v1/models/route_client-reference-manifest.js +1 -1
  265. package/.next/server/app/waves/page_client-reference-manifest.js +1 -1
  266. package/.next/server/app/waves.html +1 -1
  267. package/.next/server/app/waves.rsc +2 -2
  268. package/.next/server/app-paths-manifest.json +20 -19
  269. package/.next/server/chunks/1114.js +1 -1
  270. package/.next/server/chunks/1226.js +1 -1
  271. package/.next/server/chunks/1227.js +1 -1
  272. package/.next/server/chunks/166.js +5 -5
  273. package/.next/server/chunks/1664.js +1 -1
  274. package/.next/server/chunks/1805.js +1 -1
  275. package/.next/server/chunks/227.js +1 -1
  276. package/.next/server/chunks/2273.js +2 -2
  277. package/.next/server/chunks/2372.js +1 -1
  278. package/.next/server/chunks/2859.js +1 -1
  279. package/.next/server/chunks/3717.js +1 -0
  280. package/.next/server/chunks/3935.js +4 -0
  281. package/.next/server/chunks/4265.js +1 -1
  282. package/.next/server/chunks/4466.js +1 -1
  283. package/.next/server/chunks/4551.js +1 -1
  284. package/.next/server/chunks/4771.js +2 -2
  285. package/.next/server/chunks/4822.js +1 -1
  286. package/.next/server/chunks/5096.js +1 -1
  287. package/.next/server/chunks/519.js +2 -0
  288. package/.next/server/chunks/5285.js +1 -0
  289. package/.next/server/chunks/5309.js +78 -0
  290. package/.next/server/chunks/544.js +16 -16
  291. package/.next/server/chunks/5463.js +1 -1
  292. package/.next/server/chunks/5544.js +4 -4
  293. package/.next/server/chunks/5703.js +2 -2
  294. package/.next/server/chunks/{5708.js → 6041.js} +1 -1
  295. package/.next/server/chunks/6226.js +1 -1
  296. package/.next/server/chunks/6747.js +72 -43
  297. package/.next/server/chunks/701.js +1 -1
  298. package/.next/server/chunks/7069.js +4 -4
  299. package/.next/server/chunks/7506.js +1 -1
  300. package/.next/server/chunks/7628.js +1 -1
  301. package/.next/server/chunks/7630.js +11 -0
  302. package/.next/server/chunks/7891.js +1 -1
  303. package/.next/server/chunks/7993.js +1 -1
  304. package/.next/server/chunks/8284.js +42 -0
  305. package/.next/server/chunks/8387.js +1 -1
  306. package/.next/server/chunks/8645.js +1 -1
  307. package/.next/server/chunks/8739.js +1 -1
  308. package/.next/server/chunks/9085.js +1 -1
  309. package/.next/server/chunks/9235.js +26 -5
  310. package/.next/server/chunks/9285.js +1 -1
  311. package/.next/server/functions-config-manifest.json +1 -1
  312. package/.next/server/instrumentation.js.nft.json +1 -1
  313. package/.next/server/middleware-build-manifest.js +1 -1
  314. package/.next/server/middleware-manifest.json +1 -1
  315. package/.next/server/middleware-react-loadable-manifest.js +1 -1
  316. package/.next/server/pages/404.html +1 -1
  317. package/.next/server/pages/500.html +1 -1
  318. package/.next/server/server-reference-manifest.js +1 -1
  319. package/.next/server/server-reference-manifest.json +1 -1
  320. package/.next/static/chunks/2005.4eea65c00d9a29cd.js +1 -0
  321. package/.next/static/chunks/3429-34fb1a84aed96703.js +1 -0
  322. package/.next/static/chunks/{2005-f9d38c39f10c321f.js → 4386-e9621d3c94969a68.js} +1 -1
  323. package/.next/static/chunks/4919-6c8a48e3cc642349.js +1 -0
  324. package/.next/static/chunks/7561-2b366ddcbc3cc0ec.js +1 -0
  325. package/.next/static/chunks/8404-5aa8ea49197b98b8.js +1 -0
  326. package/.next/static/chunks/{8650-41c2afc0eba37fb8.js → 8650-aa22dbf7b37348f0.js} +1 -1
  327. package/.next/static/chunks/9611-9867e6e8e65172ec.js +1 -0
  328. package/.next/static/chunks/app/api/approvals/[id]/{route-9ea2990be4b67136.js → route-b9c783850b4c2acf.js} +1 -1
  329. package/.next/static/chunks/app/api/approvals/{route-9ea2990be4b67136.js → route-b9c783850b4c2acf.js} +1 -1
  330. package/.next/static/chunks/app/api/backup/{route-9ea2990be4b67136.js → route-b9c783850b4c2acf.js} +1 -1
  331. package/.next/static/chunks/app/api/browse/{route-9ea2990be4b67136.js → route-b9c783850b4c2acf.js} +1 -1
  332. package/.next/static/chunks/app/api/bugs/enhance/route-b9c783850b4c2acf.js +1 -0
  333. package/.next/static/chunks/app/api/cwd/route-b9c783850b4c2acf.js +1 -0
  334. package/.next/static/chunks/app/api/encryption/secure/route-b9c783850b4c2acf.js +1 -0
  335. package/.next/static/chunks/app/api/env/route-b9c783850b4c2acf.js +1 -0
  336. package/.next/static/chunks/app/api/flow/[id]/route-b9c783850b4c2acf.js +1 -0
  337. package/.next/static/chunks/app/api/flow/[id]/versions/[versionId]/route-b9c783850b4c2acf.js +1 -0
  338. package/.next/static/chunks/app/api/flow/[id]/versions/route-b9c783850b4c2acf.js +1 -0
  339. package/.next/static/chunks/app/api/flow/compile/route-b9c783850b4c2acf.js +1 -0
  340. package/.next/static/chunks/app/api/flow/generate/route-b9c783850b4c2acf.js +1 -0
  341. package/.next/static/chunks/app/api/flow/generator/route-b9c783850b4c2acf.js +1 -0
  342. package/.next/static/chunks/app/api/flow/improve/route-b9c783850b4c2acf.js +1 -0
  343. package/.next/static/chunks/app/api/flow/prompt-renderer/route-b9c783850b4c2acf.js +1 -0
  344. package/.next/static/chunks/app/api/flow/quick-chat/route-b9c783850b4c2acf.js +1 -0
  345. package/.next/static/chunks/app/api/flow/repair/route-b9c783850b4c2acf.js +1 -0
  346. package/.next/static/chunks/app/api/flow/route-b9c783850b4c2acf.js +1 -0
  347. package/.next/static/chunks/app/api/git/route-b9c783850b4c2acf.js +1 -0
  348. package/.next/static/chunks/app/api/init/route-b9c783850b4c2acf.js +1 -0
  349. package/.next/static/chunks/app/api/local-models/capability/route-b9c783850b4c2acf.js +1 -0
  350. package/.next/static/chunks/app/api/local-models/pull/route-b9c783850b4c2acf.js +1 -0
  351. package/.next/static/chunks/app/api/local-models/suggest/route-b9c783850b4c2acf.js +1 -0
  352. package/.next/static/chunks/app/api/mcp/app-sandbox/route-b9c783850b4c2acf.js +1 -0
  353. package/.next/static/chunks/app/api/mcp/cancel/route-b9c783850b4c2acf.js +1 -0
  354. package/.next/static/chunks/app/api/mcp/oauth-capability/route-b9c783850b4c2acf.js +1 -0
  355. package/.next/static/chunks/app/api/mcp/servers/[name]/prompts/get/route-b9c783850b4c2acf.js +1 -0
  356. package/.next/static/chunks/app/api/mcp/servers/[name]/prompts/route-b9c783850b4c2acf.js +1 -0
  357. package/.next/static/chunks/app/api/mcp/servers/[name]/resources/read/route-b9c783850b4c2acf.js +1 -0
  358. package/.next/static/chunks/app/api/mcp/servers/[name]/resources/route-b9c783850b4c2acf.js +1 -0
  359. package/.next/static/chunks/app/api/mcp/servers/[name]/route-b9c783850b4c2acf.js +1 -0
  360. package/.next/static/chunks/app/api/mcp/servers/[name]/status/route-b9c783850b4c2acf.js +1 -0
  361. package/.next/static/chunks/app/api/mcp/servers/[name]/tools/[toolName]/route-b9c783850b4c2acf.js +1 -0
  362. package/.next/static/chunks/app/api/mcp/servers/[name]/tools/route-b9c783850b4c2acf.js +1 -0
  363. package/.next/static/chunks/app/api/mcp/servers/route-b9c783850b4c2acf.js +1 -0
  364. package/.next/static/chunks/app/api/mcp/test-connection/route-b9c783850b4c2acf.js +1 -0
  365. package/.next/static/chunks/app/api/mcp/test-connection/stream/route-b9c783850b4c2acf.js +1 -0
  366. package/.next/static/chunks/app/api/mcp-registry/route-b9c783850b4c2acf.js +1 -0
  367. package/.next/static/chunks/app/api/mcp-registry/spotlight/route-b9c783850b4c2acf.js +1 -0
  368. package/.next/static/chunks/app/api/model/[id]/route-b9c783850b4c2acf.js +1 -0
  369. package/.next/static/chunks/app/api/model/provider/route-b9c783850b4c2acf.js +1 -0
  370. package/.next/static/chunks/app/api/model/route-b9c783850b4c2acf.js +1 -0
  371. package/.next/static/chunks/app/api/model/test/route-b9c783850b4c2acf.js +1 -0
  372. package/.next/static/chunks/app/api/oauth/callback/route-b9c783850b4c2acf.js +1 -0
  373. package/.next/static/chunks/app/api/oauth/initiate/route-b9c783850b4c2acf.js +1 -0
  374. package/.next/static/chunks/app/api/oauth/reset/route-b9c783850b4c2acf.js +1 -0
  375. package/.next/static/chunks/app/api/packages/build/route-b9c783850b4c2acf.js +1 -0
  376. package/.next/static/chunks/app/api/packages/derive-secrets/route-b9c783850b4c2acf.js +1 -0
  377. package/.next/static/chunks/app/api/packages/install/route-b9c783850b4c2acf.js +1 -0
  378. package/.next/static/chunks/app/api/packages/install/status/route-b9c783850b4c2acf.js +1 -0
  379. package/.next/static/chunks/app/api/packages/installed/route-b9c783850b4c2acf.js +1 -0
  380. package/.next/static/chunks/app/api/packages/resolve/route-b9c783850b4c2acf.js +1 -0
  381. package/.next/static/chunks/app/api/packages/scan-targets/route-b9c783850b4c2acf.js +1 -0
  382. package/.next/static/chunks/app/api/packages/search/route-b9c783850b4c2acf.js +1 -0
  383. package/.next/static/chunks/app/api/packages/uninstall/route-b9c783850b4c2acf.js +1 -0
  384. package/.next/static/chunks/app/api/planned-executions/[id]/route-b9c783850b4c2acf.js +1 -0
  385. package/.next/static/chunks/app/api/planned-executions/[id]/run/route-b9c783850b4c2acf.js +1 -0
  386. package/.next/static/chunks/app/api/planned-executions/[id]/runs/route-b9c783850b4c2acf.js +1 -0
  387. package/.next/static/chunks/app/api/planned-executions/preview-schedule/route-b9c783850b4c2acf.js +1 -0
  388. package/.next/static/chunks/app/api/planned-executions/reconcile/route-b9c783850b4c2acf.js +1 -0
  389. package/.next/static/chunks/app/api/planned-executions/route-b9c783850b4c2acf.js +1 -0
  390. package/.next/static/chunks/app/api/registry/auth/resend/route-b9c783850b4c2acf.js +1 -0
  391. package/.next/static/chunks/app/api/registry/auth/reset/route-b9c783850b4c2acf.js +1 -0
  392. package/.next/static/chunks/app/api/registry/auth/route-b9c783850b4c2acf.js +1 -0
  393. package/.next/static/chunks/app/api/registry/feedback/route-b9c783850b4c2acf.js +1 -0
  394. package/.next/static/chunks/app/api/registry/oauth/callback/route-b9c783850b4c2acf.js +1 -0
  395. package/.next/static/chunks/app/api/registry/oauth/initiate/route-b9c783850b4c2acf.js +1 -0
  396. package/.next/static/chunks/app/api/registry/packages/route-b9c783850b4c2acf.js +1 -0
  397. package/.next/static/chunks/app/api/registry/publish/route-b9c783850b4c2acf.js +1 -0
  398. package/.next/static/chunks/app/api/registry/settings/route-b9c783850b4c2acf.js +1 -0
  399. package/.next/static/chunks/app/api/restore/route-b9c783850b4c2acf.js +1 -0
  400. package/.next/static/chunks/app/api/runs/active/route-b9c783850b4c2acf.js +1 -0
  401. package/.next/static/chunks/app/api/storage/route-b9c783850b4c2acf.js +1 -0
  402. package/.next/static/chunks/app/api/telemetry/daily-active/route-b9c783850b4c2acf.js +1 -0
  403. package/.next/static/chunks/app/api/update/route-b9c783850b4c2acf.js +1 -0
  404. package/.next/static/chunks/app/api/waves/route-b9c783850b4c2acf.js +1 -0
  405. package/.next/static/chunks/app/api/webhooks/[id]/route-b9c783850b4c2acf.js +1 -0
  406. package/.next/static/chunks/app/chat/{page-1d100e5d974c919e.js → page-e37bbc561f40ce60.js} +1 -1
  407. package/.next/static/chunks/app/executions/page-8296fd69c439ccee.js +1 -0
  408. package/.next/static/chunks/app/flows/page-e52c8943555e38dd.js +1 -0
  409. package/.next/static/chunks/app/{layout-38b88f3b057f4852.js → layout-abed1f211e03152f.js} +1 -1
  410. package/.next/static/chunks/app/mcp/page-1648e6fde0c41461.js +1 -0
  411. package/.next/static/chunks/app/mcp-flows/route-b9c783850b4c2acf.js +1 -0
  412. package/.next/static/chunks/app/mcp-proxy/[server]/route-b9c783850b4c2acf.js +1 -0
  413. package/.next/static/chunks/app/models/page-595597042e227970.js +1 -0
  414. package/.next/static/chunks/app/packages/page-f1a22789a6c0e0b6.js +1 -0
  415. package/.next/static/chunks/app/page-2f9da78a4891731a.js +1 -0
  416. package/.next/static/chunks/app/settings/page-f35e939032b0277d.js +1 -0
  417. package/.next/static/chunks/app/v1/chat/completions/route-b9c783850b4c2acf.js +1 -0
  418. package/.next/static/chunks/app/v1/chat/conversations/[conversationId]/breakpoints/route-b9c783850b4c2acf.js +1 -0
  419. package/.next/static/chunks/app/v1/chat/conversations/[conversationId]/cancel/route-b9c783850b4c2acf.js +1 -0
  420. package/.next/static/chunks/app/v1/chat/conversations/[conversationId]/debug/continue/route-b9c783850b4c2acf.js +1 -0
  421. package/.next/static/chunks/app/v1/chat/conversations/[conversationId]/debug/step/route-b9c783850b4c2acf.js +1 -0
  422. package/.next/static/chunks/app/v1/chat/conversations/[conversationId]/edit-state/route-b9c783850b4c2acf.js +1 -0
  423. package/.next/static/chunks/app/v1/chat/conversations/[conversationId]/events/route-b9c783850b4c2acf.js +1 -0
  424. package/.next/static/chunks/app/v1/chat/conversations/[conversationId]/inject/route-b9c783850b4c2acf.js +1 -0
  425. package/.next/static/chunks/app/v1/chat/conversations/[conversationId]/resources/[resourceId]/content/route-b9c783850b4c2acf.js +1 -0
  426. package/.next/static/chunks/app/v1/chat/conversations/[conversationId]/resources/route-b9c783850b4c2acf.js +1 -0
  427. package/.next/static/chunks/app/v1/chat/conversations/[conversationId]/respond/route-b9c783850b4c2acf.js +1 -0
  428. package/.next/static/chunks/app/v1/chat/conversations/[conversationId]/route-b9c783850b4c2acf.js +1 -0
  429. package/.next/static/chunks/app/v1/chat/conversations/route-b9c783850b4c2acf.js +1 -0
  430. package/.next/static/chunks/app/v1/chat/events/route-b9c783850b4c2acf.js +1 -0
  431. package/.next/static/chunks/app/v1/models/route-b9c783850b4c2acf.js +1 -0
  432. package/.next/static/chunks/{webpack-dccb4f149ebdedcc.js → webpack-9d09d53b271f49e2.js} +1 -1
  433. package/.next/trace +10 -10
  434. package/.next/types/app/v1/chat/conversations/[conversationId]/resources/[resourceId]/content/route.ts +347 -0
  435. package/.next/types/routes.d.ts +2 -1
  436. package/.next/types/validator.ts +9 -0
  437. package/README.md +47 -47
  438. package/package.json +5 -5
  439. package/.next/server/chunks/2985.js +0 -1
  440. package/.next/server/chunks/4308.js +0 -4
  441. package/.next/server/chunks/4366.js +0 -2
  442. package/.next/server/chunks/5040.js +0 -48
  443. package/.next/server/chunks/8187.js +0 -78
  444. package/.next/server/chunks/8851.js +0 -1
  445. package/.next/static/chunks/289-98f50bfcf833d661.js +0 -1
  446. package/.next/static/chunks/3089.df88f3b16898aad7.js +0 -1
  447. package/.next/static/chunks/6733-c9029143901e62e9.js +0 -1
  448. package/.next/static/chunks/8041-05830e887c133085.js +0 -1
  449. package/.next/static/chunks/8404-bfa9203e4296f3fb.js +0 -1
  450. package/.next/static/chunks/95-b9691d3cb15556dc.js +0 -1
  451. package/.next/static/chunks/app/api/bugs/enhance/route-9ea2990be4b67136.js +0 -1
  452. package/.next/static/chunks/app/api/cwd/route-9ea2990be4b67136.js +0 -1
  453. package/.next/static/chunks/app/api/encryption/secure/route-9ea2990be4b67136.js +0 -1
  454. package/.next/static/chunks/app/api/env/route-9ea2990be4b67136.js +0 -1
  455. package/.next/static/chunks/app/api/flow/[id]/route-9ea2990be4b67136.js +0 -1
  456. package/.next/static/chunks/app/api/flow/[id]/versions/[versionId]/route-9ea2990be4b67136.js +0 -1
  457. package/.next/static/chunks/app/api/flow/[id]/versions/route-9ea2990be4b67136.js +0 -1
  458. package/.next/static/chunks/app/api/flow/compile/route-9ea2990be4b67136.js +0 -1
  459. package/.next/static/chunks/app/api/flow/generate/route-9ea2990be4b67136.js +0 -1
  460. package/.next/static/chunks/app/api/flow/generator/route-9ea2990be4b67136.js +0 -1
  461. package/.next/static/chunks/app/api/flow/improve/route-9ea2990be4b67136.js +0 -1
  462. package/.next/static/chunks/app/api/flow/prompt-renderer/route-9ea2990be4b67136.js +0 -1
  463. package/.next/static/chunks/app/api/flow/quick-chat/route-9ea2990be4b67136.js +0 -1
  464. package/.next/static/chunks/app/api/flow/repair/route-9ea2990be4b67136.js +0 -1
  465. package/.next/static/chunks/app/api/flow/route-9ea2990be4b67136.js +0 -1
  466. package/.next/static/chunks/app/api/git/route-9ea2990be4b67136.js +0 -1
  467. package/.next/static/chunks/app/api/init/route-9ea2990be4b67136.js +0 -1
  468. package/.next/static/chunks/app/api/local-models/capability/route-9ea2990be4b67136.js +0 -1
  469. package/.next/static/chunks/app/api/local-models/pull/route-9ea2990be4b67136.js +0 -1
  470. package/.next/static/chunks/app/api/local-models/suggest/route-9ea2990be4b67136.js +0 -1
  471. package/.next/static/chunks/app/api/mcp/app-sandbox/route-9ea2990be4b67136.js +0 -1
  472. package/.next/static/chunks/app/api/mcp/cancel/route-9ea2990be4b67136.js +0 -1
  473. package/.next/static/chunks/app/api/mcp/oauth-capability/route-9ea2990be4b67136.js +0 -1
  474. package/.next/static/chunks/app/api/mcp/servers/[name]/prompts/get/route-9ea2990be4b67136.js +0 -1
  475. package/.next/static/chunks/app/api/mcp/servers/[name]/prompts/route-9ea2990be4b67136.js +0 -1
  476. package/.next/static/chunks/app/api/mcp/servers/[name]/resources/read/route-9ea2990be4b67136.js +0 -1
  477. package/.next/static/chunks/app/api/mcp/servers/[name]/resources/route-9ea2990be4b67136.js +0 -1
  478. package/.next/static/chunks/app/api/mcp/servers/[name]/route-9ea2990be4b67136.js +0 -1
  479. package/.next/static/chunks/app/api/mcp/servers/[name]/status/route-9ea2990be4b67136.js +0 -1
  480. package/.next/static/chunks/app/api/mcp/servers/[name]/tools/[toolName]/route-9ea2990be4b67136.js +0 -1
  481. package/.next/static/chunks/app/api/mcp/servers/[name]/tools/route-9ea2990be4b67136.js +0 -1
  482. package/.next/static/chunks/app/api/mcp/servers/route-9ea2990be4b67136.js +0 -1
  483. package/.next/static/chunks/app/api/mcp/test-connection/route-9ea2990be4b67136.js +0 -1
  484. package/.next/static/chunks/app/api/mcp/test-connection/stream/route-9ea2990be4b67136.js +0 -1
  485. package/.next/static/chunks/app/api/mcp-registry/route-9ea2990be4b67136.js +0 -1
  486. package/.next/static/chunks/app/api/mcp-registry/spotlight/route-9ea2990be4b67136.js +0 -1
  487. package/.next/static/chunks/app/api/model/[id]/route-9ea2990be4b67136.js +0 -1
  488. package/.next/static/chunks/app/api/model/provider/route-9ea2990be4b67136.js +0 -1
  489. package/.next/static/chunks/app/api/model/route-9ea2990be4b67136.js +0 -1
  490. package/.next/static/chunks/app/api/model/test/route-9ea2990be4b67136.js +0 -1
  491. package/.next/static/chunks/app/api/oauth/callback/route-9ea2990be4b67136.js +0 -1
  492. package/.next/static/chunks/app/api/oauth/initiate/route-9ea2990be4b67136.js +0 -1
  493. package/.next/static/chunks/app/api/oauth/reset/route-9ea2990be4b67136.js +0 -1
  494. package/.next/static/chunks/app/api/packages/build/route-9ea2990be4b67136.js +0 -1
  495. package/.next/static/chunks/app/api/packages/derive-secrets/route-9ea2990be4b67136.js +0 -1
  496. package/.next/static/chunks/app/api/packages/install/route-9ea2990be4b67136.js +0 -1
  497. package/.next/static/chunks/app/api/packages/install/status/route-9ea2990be4b67136.js +0 -1
  498. package/.next/static/chunks/app/api/packages/installed/route-9ea2990be4b67136.js +0 -1
  499. package/.next/static/chunks/app/api/packages/resolve/route-9ea2990be4b67136.js +0 -1
  500. package/.next/static/chunks/app/api/packages/scan-targets/route-9ea2990be4b67136.js +0 -1
  501. package/.next/static/chunks/app/api/packages/search/route-9ea2990be4b67136.js +0 -1
  502. package/.next/static/chunks/app/api/packages/uninstall/route-9ea2990be4b67136.js +0 -1
  503. package/.next/static/chunks/app/api/planned-executions/[id]/route-9ea2990be4b67136.js +0 -1
  504. package/.next/static/chunks/app/api/planned-executions/[id]/run/route-9ea2990be4b67136.js +0 -1
  505. package/.next/static/chunks/app/api/planned-executions/[id]/runs/route-9ea2990be4b67136.js +0 -1
  506. package/.next/static/chunks/app/api/planned-executions/preview-schedule/route-9ea2990be4b67136.js +0 -1
  507. package/.next/static/chunks/app/api/planned-executions/reconcile/route-9ea2990be4b67136.js +0 -1
  508. package/.next/static/chunks/app/api/planned-executions/route-9ea2990be4b67136.js +0 -1
  509. package/.next/static/chunks/app/api/registry/auth/resend/route-9ea2990be4b67136.js +0 -1
  510. package/.next/static/chunks/app/api/registry/auth/reset/route-9ea2990be4b67136.js +0 -1
  511. package/.next/static/chunks/app/api/registry/auth/route-9ea2990be4b67136.js +0 -1
  512. package/.next/static/chunks/app/api/registry/feedback/route-9ea2990be4b67136.js +0 -1
  513. package/.next/static/chunks/app/api/registry/oauth/callback/route-9ea2990be4b67136.js +0 -1
  514. package/.next/static/chunks/app/api/registry/oauth/initiate/route-9ea2990be4b67136.js +0 -1
  515. package/.next/static/chunks/app/api/registry/packages/route-9ea2990be4b67136.js +0 -1
  516. package/.next/static/chunks/app/api/registry/publish/route-9ea2990be4b67136.js +0 -1
  517. package/.next/static/chunks/app/api/registry/settings/route-9ea2990be4b67136.js +0 -1
  518. package/.next/static/chunks/app/api/restore/route-9ea2990be4b67136.js +0 -1
  519. package/.next/static/chunks/app/api/runs/active/route-9ea2990be4b67136.js +0 -1
  520. package/.next/static/chunks/app/api/storage/route-9ea2990be4b67136.js +0 -1
  521. package/.next/static/chunks/app/api/telemetry/daily-active/route-9ea2990be4b67136.js +0 -1
  522. package/.next/static/chunks/app/api/update/route-9ea2990be4b67136.js +0 -1
  523. package/.next/static/chunks/app/api/waves/route-9ea2990be4b67136.js +0 -1
  524. package/.next/static/chunks/app/api/webhooks/[id]/route-9ea2990be4b67136.js +0 -1
  525. package/.next/static/chunks/app/executions/page-10ec7d58c7fbdd6f.js +0 -1
  526. package/.next/static/chunks/app/flows/page-9a78a2915268b2f8.js +0 -1
  527. package/.next/static/chunks/app/mcp/page-56b43b2f8752e9a5.js +0 -1
  528. package/.next/static/chunks/app/mcp-flows/route-9ea2990be4b67136.js +0 -1
  529. package/.next/static/chunks/app/mcp-proxy/[server]/route-9ea2990be4b67136.js +0 -1
  530. package/.next/static/chunks/app/models/page-808c0568ebc5e2c7.js +0 -1
  531. package/.next/static/chunks/app/packages/page-af6ec89522915206.js +0 -1
  532. package/.next/static/chunks/app/page-30bf4293efa47a47.js +0 -1
  533. package/.next/static/chunks/app/settings/page-59ae1b658838f0bc.js +0 -1
  534. package/.next/static/chunks/app/v1/chat/completions/route-9ea2990be4b67136.js +0 -1
  535. package/.next/static/chunks/app/v1/chat/conversations/[conversationId]/breakpoints/route-9ea2990be4b67136.js +0 -1
  536. package/.next/static/chunks/app/v1/chat/conversations/[conversationId]/cancel/route-9ea2990be4b67136.js +0 -1
  537. package/.next/static/chunks/app/v1/chat/conversations/[conversationId]/debug/continue/route-9ea2990be4b67136.js +0 -1
  538. package/.next/static/chunks/app/v1/chat/conversations/[conversationId]/debug/step/route-9ea2990be4b67136.js +0 -1
  539. package/.next/static/chunks/app/v1/chat/conversations/[conversationId]/edit-state/route-9ea2990be4b67136.js +0 -1
  540. package/.next/static/chunks/app/v1/chat/conversations/[conversationId]/events/route-9ea2990be4b67136.js +0 -1
  541. package/.next/static/chunks/app/v1/chat/conversations/[conversationId]/inject/route-9ea2990be4b67136.js +0 -1
  542. package/.next/static/chunks/app/v1/chat/conversations/[conversationId]/resources/route-9ea2990be4b67136.js +0 -1
  543. package/.next/static/chunks/app/v1/chat/conversations/[conversationId]/respond/route-9ea2990be4b67136.js +0 -1
  544. package/.next/static/chunks/app/v1/chat/conversations/[conversationId]/route-9ea2990be4b67136.js +0 -1
  545. package/.next/static/chunks/app/v1/chat/conversations/route-9ea2990be4b67136.js +0 -1
  546. package/.next/static/chunks/app/v1/chat/events/route-9ea2990be4b67136.js +0 -1
  547. package/.next/static/chunks/app/v1/models/route-9ea2990be4b67136.js +0 -1
  548. /package/.next/static/{jfb1GsjSGMjBmwfa3kM26 → hbjnLG9RCje2AApS9TzP8}/_buildManifest.js +0 -0
  549. /package/.next/static/{jfb1GsjSGMjBmwfa3kM26 → hbjnLG9RCje2AApS9TzP8}/_ssgManifest.js +0 -0
@@ -0,0 +1,78 @@
1
+ "use strict";exports.id=5309,exports.ids=[5309],exports.modules={85309:(a,b,c)=>{let d;c.d(b,{internalCallTool:()=>ba,internalToolDefinitions:()=>aG});var e=c(33873),f=c.n(e),g=c(29021),h=c(18230),i=c(11659),j=c(12763),k=c(50010),l=c(35432),m=c(64551),n=c(60269);let o={type:"object",additionalProperties:!1,required:["name","goal","steps"],properties:{profile:{type:"string",const:"simple"},version:{type:"integer",const:1},name:{type:"string",minLength:1},goal:{type:"string",minLength:1},model:{type:"string",minLength:1},steps:{type:"array",minItems:1,items:{type:"object",additionalProperties:!1,required:["id","task"],properties:{id:{type:"string",minLength:1,pattern:"^[A-Za-z][A-Za-z0-9_-]*$"},task:{type:"string",minLength:1},label:{type:"string",minLength:1},model:{type:"string",minLength:1},tools:{type:"array",uniqueItems:!0,items:{type:"string",minLength:1}},flow:{type:"string",minLength:1}}}},routes:{type:"array",items:{type:"object",additionalProperties:!1,required:["from","to"],properties:{from:{type:"string",minLength:1},to:{type:"string",minLength:1},when:{type:"object",additionalProperties:!1,required:["kind"],properties:{kind:{type:"string",enum:["contains","equals","regex","always"]},value:{type:"string"},ignoreCase:{type:"boolean"},negate:{type:"boolean"}}}}}}}};var p=c(54898),q=c(13739);let r=(0,h.h)("backend/services/flow/compileFlow");async function s(a,b={}){if(!a||"object"!=typeof a||Array.isArray(a))return{success:!1,error:"The spec must be a JSON object (a FlowSpec)",statusCode:400};let c=await (0,q.jY)(),d=c.compile;if(b.updateFlowId){let a=d.flows??[];if(!a.some(a=>a.id===b.updateFlowId))return{success:!1,error:`No flow with id "${b.updateFlowId}" to update`,statusCode:404};d={...d,flows:a.filter(a=>a.id!==b.updateFlowId)}}let e="simple"===b.profile?function(a,b={},c={}){let d=function(a){let b=[],c=Array.isArray(a?.steps)?a.steps:[],d=new Set,e=[];for(let a of c){let c="string"==typeof a?.id?a.id.trim():"",f="string"==typeof a?.task?a.task.trim():"";if(!c||!/^[A-Za-z][A-Za-z0-9_-]*$/.test(c)){b.push({severity:"error",code:"simple-step-id-invalid",message:"Every simple step needs an id matching ^[A-Za-z][A-Za-z0-9_-]*$."});continue}if(d.has(c)){b.push({severity:"error",code:"simple-step-id-duplicate",nodeKey:c,message:`Duplicate simple step id "${c}"; the later step was dropped.`});continue}if(!f){b.push({severity:"error",code:"simple-step-task-missing",nodeKey:c,message:`Step "${c}" needs a non-empty task.`});continue}d.add(c),e.push({...a,id:c,task:f})}let f="__start",g="__finish",h=[{key:f,type:"start",label:"Start",prompt:`Execute this workflow toward its stated goal: ${"string"==typeof a?.goal?a.goal.trim():""}`}];for(let c of e){let d="string"==typeof c.label&&c.label.trim()?c.label.trim():function(a){let b=a.replace(/[_-]+/g," ").trim();return b?b.replace(/\b\w/g,a=>a.toUpperCase()):"Step"}(c.id),e="string"==typeof c.flow?c.flow.trim():"";if(e){h.push({key:c.id,type:"subflow",label:d,description:c.task,flow:e,prompt:c.task,inputMode:"full-history",outputMode:"final-only"});continue}let f="string"==typeof c.model&&c.model.trim()?c.model.trim():"string"==typeof a?.model?a.model.trim():"";h.push({key:c.id,type:"process",label:d,description:c.task,prompt:c.task,...f?{model:f}:{},servers:function(a,b,c){let d=new Map;for(let e of a??[]){let a="string"==typeof e?e.trim():"";if(!a)continue;let f=a.indexOf("/"),g=(f>=0?a.slice(0,f):a).trim(),h=f>=0?a.slice(f+1).trim():"";if(!g){c.push({severity:"warning",code:"simple-tool-invalid",nodeKey:b,message:`Step "${b}": ignored tool reference "${a}"; use server/tool.`});continue}d.has(g)||d.set(g,new Set),h&&d.get(g).add(h)}return[...d].map(([a,b])=>({name:a,...b.size>0?{tools:[...b]}:{}}))}(c.tools,c.id,b),inputMode:"full-history",outputMode:"latest-message"})}h.push({key:g,type:"finish",label:"Finish"});let i=[],j=Array.isArray(a?.routes)?a.routes:[];if(0===j.length){let a=[f,...e.map(a=>a.id),g];for(let b=0;b<a.length-1;b++)i.push({from:a[b],to:a[b+1]})}else{let a=new Set,c=new Set;for(let e of j){let f="string"==typeof e?.from?e.from.trim():"",g="string"==typeof e?.to?e.to.trim():"";if(!d.has(f)||!d.has(g)){b.push({severity:"error",code:"simple-route-unresolved",nodeKey:f||void 0,message:`Simple route "${f}" → "${g}" references an unknown step.`});continue}i.push({from:f,to:g,...e.when?{condition:e.when}:{}}),c.add(f),a.add(g)}for(let b of e)a.has(b.id)||i.push({from:f,to:b.id}),c.has(b.id)||i.push({from:b.id,to:g})}return{spec:{name:"string"==typeof a?.name?a.name.trim():"",description:"string"==typeof a?.goal?a.goal.trim():"",nodes:h,edges:i},issues:b}}(a),e=(0,n.dM)(d.spec,b,c),f=[...d.issues,...e.issues];return{...e,loweredSpec:d.spec,issues:f,errorCount:f.filter(a=>"error"===a.severity).length,warningCount:f.filter(a=>"warning"===a.severity).length}}(a,d,{keepPills:b.keepPills}):(0,n.dM)(a,d,{keepPills:b.keepPills});if(!e.flow)return{success:!1,error:"The spec could not be compiled into a flow",statusCode:422,issues:e.issues.map(a=>({severity:a.severity,code:a.code,message:a.message}))};b.updateFlowId&&(e.flow.id=b.updateFlowId);let f=e.flows.flatMap(a=>(0,p.nC)(a,{models:c.compile.models,servers:c.validatorServers,serverTools:c.compile.serverTools}).issues),g=(0,q.RB)(e.issues,{issues:f,errorCount:0,warningCount:0,isRunnable:!0}),h=!1;if(b.save&&0===g.errorCount){for(let a of e.flows)await i.flowService.saveFlow(a);h=!0,r.info(`Compiled and saved ${e.flows.length} flow(s); root "${e.flow.name}" (${e.flow.id})`)}else b.save&&r.info(`Compiled flow "${e.flow.name}" has ${g.errorCount} error(s); NOT saved`);return{success:!0,flow:e.flow,flows:e.flows,validation:g,saved:h}}var t=c(71666),u=c(79111),v=c(34115),w=c(76654);let x=(0,h.h)("backend/execution/flow/loadConversationState");async function y(a){try{(0,u.ln)(a)}catch{x.warn("Rejected unsafe conversationId on load",{conversationId:a});return}if(t.FlowExecutor.conversationStates.has(a))return x.debug("Loaded state from memory",{conversationId:a}),t.FlowExecutor.conversationStates.get(a);let b=`conversations/${a}`;try{let c=await (0,u.YM)(b,void 0);if(c){x.debug("Loaded state from storage",{conversationId:a}),await (0,v.recoverMessagesFromLog)(c);try{let d=(0,v.repairDanglingToolCalls)(c);d.length&&(x.info("Repaired dangling tool call(s) on load",{conversationId:a,count:d.length}),await (0,v.appendRawForState)(c,d.map(a=>({type:"message",message:a}))),await (0,w.persistConversationState)(b,c))}catch(b){x.warn("Failed to repair dangling tool calls on load; continuing",{conversationId:a,repairError:b})}return t.FlowExecutor.conversationStates.set(a,c),c}}catch(b){x.warn("Error loading conversation state from storage",{conversationId:a,error:b})}}var z=c(96249),A=c(85510),B=c(51172);let C=`A FlowSpec is a JSON object describing a FLUJO flow semantically — node keys and edges, no coordinates, no ids, no layout:
2
+ {
3
+ "name": "short_flow_name", // letters/digits/_/- only
4
+ "description": "what the flow does",
5
+ "nodes": [ ... ],
6
+ "edges": [ ... ]
7
+ }
8
+
9
+ NODE TYPES:
10
+ - { "key": "unique_key", "type": "start", "label": "...", "prompt": "system-level instructions for the whole flow" }
11
+ - { "key": "...", "type": "process", "label": "...", "description": "what this step does",
12
+ "model": "<model id or name from the catalog>",
13
+ "prompt": "instructions for this step",
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. Reshapes ONLY the wire view the model sees (persisted history stays lossless): full-history = the whole assembled context; latest-message = leading system prompt(s) + the most recent EXCHANGE (the last user message + the last assistant response, intermediate turns since the last user message dropped) + 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
+ "isolatedPrompt": "...", // only with inputMode "isolated"
17
+ "allowCallerPrompt": true | false, // optional, only with inputMode "isolated"; default true — a step that hands off to this isolated step may pass a "prompt" via its handoff tool that overrides "isolatedPrompt". Set false to forbid it
18
+ "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)
19
+ "maxTurns": 20, // optional; per-step cap on agentic tool-loop turns (retry-until-done in ONE node). Unset = model/system default (50)
20
+ "allowedTools": ["tool_a"], // optional; step-level tool allowlist (independent of servers[].tools)
21
+ "captureVariable": "NAME", // optional; save this step's output into a run variable other steps inject with \${var:NAME}
22
+ "captureKv": "NAME", // optional; ALSO save this step's output to a PERSISTENT cross-run key other steps inject with \${kv:NAME} (see rule 9d)
23
+ "excludeModelPrompt": true|false, // optional; drop the model's base prompt
24
+ "excludeStartNodePrompt": true|false, // optional; drop the start node's prompt for this step
25
+ "excludeSystemPrompt": true|false } // optional; drop the workflow/handoff guidance block
26
+ - { "key": "...", "type": "subflow", "label": "...",
27
+ "flow": "<existing flow name or id>", // reference an EXISTING flow, OR:
28
+ "subflowSpec": { ...a nested FlowSpec... }, // define a brand-new child flow INLINE (compiled into its own flow and wired automatically), OR fan out concurrently:
29
+ "parallelFlows": ["flow_a", "flow_b"], // run several EXISTING child flows CONCURRENTLY, same input to each, outputs joined; OR:
30
+ "parallelSubflowSpecs": [ { ...FlowSpec... } ], // run several INLINE child flows concurrently; OR:
31
+ "parallelFlowsVariable": "NAME", // DYNAMIC fan-out (rule 7b): pick the target flows AT RUNTIME from run variable \${var:NAME} (a JSON array of flow ids/names, or newline list); mutually exclusive with mapOverList
32
+ "mapOverList": true | false, // optional; run the SINGLE child ("flow"/"subflowSpec") ONCE PER ITEM parsed from the input; mutually exclusive with parallelFlows/parallelSubflowSpecs
33
+ "itemSplit": "json-array" | "lines", // optional (mapOverList only), how to split the input into items, default json-array
34
+ "sequential": true | false, // optional (mapOverList only), run items one at a time in order instead of concurrently, default false
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 most recent EXCHANGE of the sanitized transcript (the last user message + the last assistant response after it, intermediate turns dropped); isolated = ignore the parent conversation and send "prompt" as the child's single user message
40
+ "allowCallerPrompt": true | false, // optional, only with inputMode "isolated"; default true — a routing step may pass a "prompt" via its handoff tool that overrides the subflow's "prompt". Set false to forbid it
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)
42
+ "captureVariable": "NAME", // optional; save the subflow's output into a run variable other steps inject with \${var:NAME}
43
+ "captureResource": "NAME", // optional; ALSO save the subflow's output as a tracked run resource (\${res:NAME}, rule 9b)
44
+ "captureKv": "NAME", // optional; ALSO save the subflow's output to a PERSISTENT cross-run key (\${kv:NAME}, rule 9d)
45
+ "outputMode": "steps" | "final-only" }
46
+ - { "key": "...", "type": "finish" } // a finish node is ALWAYS named "Finish Node"; omit "label" (any label you supply is ignored)
47
+ - { "key": "...", "type": "signal", "label": "...", // fire-and-forget event (rule 11): emits {topic, payload} then passes through unchanged
48
+ "topic": "<event topic other flows' triggers listen for>", // REQUIRED — a signal with no topic emits nothing
49
+ "payloadTemplate": "event body, may use \${var:NAME}" } // optional; defaults to the node prompt
50
+ - { "key": "...", "type": "resource", "label": "...", // OPTIONAL/advanced (rule 9c): a data artifact shown in the graph
51
+ "server": "<server name>", "uri": "<resource uri>", // EITHER a static MCP resource…
52
+ "runName": "NAME" } // …OR a run artifact steps produce/consume
53
+
54
+ EDGES: { "from": "<node key>", "to": "<node key>", "bidirectional": true|false,
55
+ "condition": { "kind": "contains"|"regex"|"equals", "value": "...",
56
+ "target": "last-assistant"|"last-message", // optional, default last-assistant
57
+ "ignoreCase": true|false, "negate": true|false } } // condition optional; process-node edges only
58
+
59
+ RULES:
60
+ 1. Exactly ONE start node; at least one finish node reachable from it.
61
+ 2. Every process node MUST reference a configured model (by id, display name, or name).
62
+ 3. A process step uses MCP tools ONLY via its "servers" list — never emit nodes of type "mcp".
63
+ 4. Do not embed \${tool:...} or \${resource:...} references in prompts — tools are wired through "servers".
64
+ 5. Branching: give a process node multiple outgoing edges; its model decides where to hand off at runtime. "bidirectional": true lets the target hand back to the source (agent <-> agent).
65
+ 5b. Deterministic routing: give a process node's outgoing edges a "condition" to route WITHOUT the model — the engine takes the first outgoing edge whose predicate matches the last message (default the step's own last assistant message), and a bare (condition-less) edge is the fallback. Use this for reliable data-driven branches (e.g. output contains "FAIL" -> fix step, else -> publish) instead of relying on a small model to emit a handoff. Only process-node edges may carry a condition. Without any condition on a node, that node keeps model-decided handoff (rule 5). If the model still calls a handoff tool, that wins over the condition.
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.
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.
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).
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").
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".
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.
73
+ 9b. Run resources (tracked data): a SUBFLOW may use "captureResource": "NAME" because its folded child output is a concrete result. A PROCESS must use an explicit Resource node: process→resource arms write_resource so the process writes the full artifact; resource→process injects it into a reader with \${res:NAME}. Do not put passive captureResource on a process node. Large or binary MCP tool results are auto-captured as run resources without any spec field.
74
+ 9c. Resource nodes are OPTIONAL/advanced — most flows should use conversation history. Resource edges are data wiring, not flow control: they never carry conditions and do not count as a step's successor.
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.
76
+ 10. Keep flows minimal — only the steps the task needs. Write clear, specific prompts and labels; fill "description" on process nodes.
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.`;var D=c(23826),E=c(12700),F=c(79861),G=c(88400);let H=(0,h.h)("backend/services/mcp/quality/cache"),I="mcp-quality-cache";class J{constructor(a=Date.now()){this.entries={},this.dirty=!1,this.now=a}async load(){try{let a=await (0,u.YM)(I,{entries:{}});this.entries=a?.entries&&"object"==typeof a.entries?a.entries:{}}catch(a){H.warn("Failed to load quality cache; starting empty",a),this.entries={}}}get(a,b){let c=this.entries[`${a}::${b}`];if(c&&!(this.now-c.at>864e5))return c.signal}set(a,b,c){this.entries[`${a}::${b}`]={at:this.now,signal:c},this.dirty=!0}async flush(){let a=!1;for(let[b,c]of Object.entries(this.entries))this.now-c.at>864e5&&(delete this.entries[b],a=!0);if(this.dirty||a)try{await (0,u.VH)(I,{entries:this.entries})}catch(a){H.warn("Failed to persist quality cache",a)}}}function K(a){return!Number.isFinite(a)||a<0?0:a>1?1:a}function L(a,b){return!Number.isFinite(a)||a<=0?0:!Number.isFinite(b)||b<=1?+(a>0):K(Math.log10(a+1)/Math.log10(b+1))}let M=(0,h.h)("backend/services/mcp/quality/providers/githubStars"),N="github",O=new Map;function P(){return d??(process.env.GITHUB_TOKEN||void 0)}function Q(a){let b,c=a.server.repository;if(c?.source&&"github"!==c.source.toLowerCase())return null;var d=c?.url;if(!d)return null;try{b=new URL(d.replace(/^git\+/,""))}catch{return null}if(!/(^|\.)github\.com$/i.test(b.hostname))return null;let e=b.pathname.replace(/\.git$/i,"").split("/").filter(Boolean);return e.length<2?null:`${e[0]}/${e[1]}`.toLowerCase()}async function R(a,b){let c=new AbortController,d=()=>c.abort();b.addEventListener("abort",d,{once:!0});let e=setTimeout(()=>c.abort(),6e3);try{return await fetch(`https://api.github.com${a}`,{headers:function(){let a={Accept:"application/vnd.github+json","User-Agent":"FLUJO-mcp-quality","X-GitHub-Api-Version":"2022-11-28"},b=P();return b&&(a.Authorization=`Bearer ${b}`),a}(),signal:c.signal,cache:"no-store"})}catch(b){return M.warn(`GitHub request failed (${a})`,b instanceof Error?b.message:b),null}finally{clearTimeout(e),b.removeEventListener("abort",d)}}function S(a){return(403===a.status||429===a.status)&&"0"===a.headers.get("x-ratelimit-remaining")}let T=(0,h.h)("backend/services/mcp/quality/providers/npmDownloads"),U="npm-downloads",V=new Map;function W(a){for(let b of a.server.packages??[])if("npm"===b.registryType&&b.identifier)return b.identifier;return null}function X(a){return a.startsWith("@")}async function Y(a,b){let c=new AbortController,d=()=>c.abort();b.addEventListener("abort",d,{once:!0});let e=setTimeout(()=>c.abort(),6e3);try{return await fetch(`https://api.npmjs.org${a}`,{signal:c.signal,cache:"no-store"})}catch(b){return T.warn(`npm request failed (${a})`,b instanceof Error?b.message:b),null}finally{clearTimeout(e),b.removeEventListener("abort",d)}}let Z="registry-status",$=[{id:N,label:"GitHub Stars & Activity",defaultWeight:.5,isApplicable:a=>null!==Q(a),cacheKey:a=>Q(a),async prefetch(a,b,c){let d=`${a??""} mcp`.trim(),e=`/search/repositories?q=${encodeURIComponent(d)}&sort=stars&order=desc&per_page=50`,f=await R(e,c);if(f&&f.ok)try{for(let a of(await f.json()).items??[])a.full_name&&O.set(a.full_name.toLowerCase(),{stars:"number"==typeof a.stargazers_count?a.stargazers_count:0,pushedAtMs:a.pushed_at?Date.parse(a.pushed_at):null})}catch(a){M.warn("Failed to parse GitHub search response",a)}else if(f&&S(f))return void M.warn("GitHub search rate-limited; ranking will degrade to other providers");if(!P())return;let g=3;for(let a of b){if(g<=0)break;let b=Q(a);if(!b||O.has(b))continue;g-=1;let d=await R(`/repos/${b}`,c);if(d){if(S(d))break;if(d.ok)try{let a=await d.json();O.set(b,{stars:"number"==typeof a.stargazers_count?a.stargazers_count:0,pushedAtMs:a.pushed_at?Date.parse(a.pushed_at):null})}catch{}}}},async fetch(a){let b=Q(a);if(!b)return null;let c=O.get(b);if(!c)return null;let d=L(c.stars,5e4),e=function(a,b,c=30,d=730){if(!a||!Number.isFinite(a))return 0;let e=(b-a)/864e5;return e<=c?1:e>=d?0:K(1-(e-c)/(d-c))}(c.pushedAtMs,Date.now());return{providerId:N,score:K(.7*d+.3*e),evidence:{repo:b,stars:c.stars,...c.pushedAtMs?{pushedAt:new Date(c.pushedAtMs).toISOString()}:{},starsScore:d,recencyScore:e}}}},{id:U,label:"npm Weekly Downloads",defaultWeight:.35,isApplicable:a=>null!==W(a),cacheKey:a=>W(a),async prefetch(a,b,c){let d=b.map(W).filter(a=>!!a&&!V.has(a)),e=d.filter(a=>!X(a)),f=d.filter(X);for(let a=0;a<e.length;a+=100){let b=e.slice(a,a+100),d=await Y(`/downloads/point/last-week/${b.join(",")}`,c);if(d&&d.ok)try{let a=await d.json();if(1===b.length)"number"==typeof a.downloads&&V.set(b[0],a.downloads);else for(let c of b){let b=a[c];V.set(c,b&&"number"==typeof b.downloads?b.downloads:0)}}catch(a){T.warn("Failed to parse npm bulk downloads response",a)}}for(let a of f){let b=await Y(`/downloads/point/last-week/${a}`,c);if(b&&b.ok)try{let c=await b.json();"number"==typeof c.downloads&&V.set(a,c.downloads)}catch{}}},async fetch(a){let b=W(a);if(!b)return null;let c=V.get(b);return void 0===c?null:{providerId:U,score:L(c,1e6),evidence:{package:b,weeklyDownloads:c}}}},{id:Z,label:"Registry Status",defaultWeight:.15,isApplicable:a=>!0,cacheKey:()=>null,fetch:async a=>({providerId:Z,score:+("active"===a.verificationStatus),evidence:{status:a.verificationStatus}})}];var _=c(14247);let aa=(0,h.h)("backend/services/mcp/quality/settings");function ab(){return{providers:$.map(a=>({id:a.id,enabled:!0,weight:a.defaultWeight})),minScore:0,worksGate:!0}}async function ac(){try{let a=await (0,u.YM)(_.Z.MCP_QUALITY_SETTINGS,ab());return function(a){var b,c;let d=ab(),e=a??{},f=new Map;if(Array.isArray(e.providers))for(let a of e.providers)a&&"string"==typeof a.id&&f.set(a.id,a);return{providers:d.providers.map(a=>{let b=f.get(a.id);return{id:a.id,enabled:"boolean"==typeof b?.enabled?b.enabled:a.enabled,weight:"number"==typeof b?.weight&&Number.isFinite(b.weight)&&b.weight>=0?b.weight:a.weight}}),minScore:(b=e.minScore,c=d.minScore,"number"==typeof b&&Number.isFinite(b)?Math.min(1,Math.max(0,b)):c),worksGate:"boolean"==typeof e.worksGate?e.worksGate:d.worksGate,..."string"==typeof e.githubToken&&e.githubToken.length>0?{githubToken:e.githubToken}:{}}}(a)}catch(a){return aa.warn("Failed to load mcpQuality settings; using defaults",a),ab()}}let ad=(0,h.h)("backend/services/mcp/quality/orchestrator");async function ae(a,b){let c=new AbortController,d=setTimeout(()=>c.abort(),b);try{return await a(c.signal)}finally{clearTimeout(d)}}async function af(a,b,c={}){let e=c.topN??10;try{var f;let g=c.settings??await ac(),h=$.filter(a=>(function(a,b){let c=a.providers.find(a=>a.id===b);return!!c?.enabled})(g,a.id));if(0===h.length)return b.map(a=>({candidate:a,score:0,signals:[]}));d=(f=g.githubToken)&&f.length>0?f:void 0;let i=b.slice(0,e),j=b.slice(e),k=new J(c.now??Date.now());await k.load();let l=i.map(()=>[]);for(let b of h){let c=i.map((a,b)=>({c:a,i:b})).filter(({c:a})=>b.isApplicable(a)),d=[],e=[];for(let a of c){let c=b.cacheKey(a.c);if(c){let d=k.get(b.id,c);if(d){e.push({i:a.i,signal:d});continue}}d.push(a)}if(b.prefetch&&d.length>0)try{await ae(c=>b.prefetch(a,d.map(a=>a.c),c),12e3)}catch(a){ad.warn(`Provider "${b.id}" prefetch failed; degrading`,a)}for(let{c:a,i:c}of d)try{let d=await ae(c=>b.fetch(a,c),2e3);if(d){l[c].push(d);let e=b.cacheKey(a);e&&k.set(b.id,e,d)}}catch(c){ad.warn(`Provider "${b.id}" fetch failed for "${a.registryName}"`,c)}for(let{i:a,signal:b}of e)l[a].push(b)}await k.flush();let m=i.map((a,b)=>{let c=l[b],d=new Map(c.map(a=>[a.providerId,a])),e=h.filter(b=>b.isApplicable(a)).map(a=>({providerId:a.id,weight:function(a,b){let c=a.providers.find(a=>a.id===b);return c&&c.enabled?c.weight:0}(g,a.id),score:d.get(a.id)?.score??0})),{score:f}=function(a){let b=0,c=0;for(let d of a){let a=Number.isFinite(d.weight)&&d.weight>0?d.weight:0,e=K(d.score);b+=a,c+=a*e}return{score:b>0?c/b:0,breakdown:a}}(e);return{candidate:a,score:f,signals:c}}).map((a,b)=>({s:a,idx:b})).sort((a,b)=>b.s.score-a.s.score||a.idx-b.idx).map(a=>a.s),n=j.map(a=>({candidate:a,score:0,signals:[]}));return[...m,...n]}catch(a){return ad.warn("enrichAndRank failed; returning unranked candidates",a),b.map(a=>({candidate:a,score:0,signals:[]}))}}let ag=(0,h.h)("backend/services/mcp/registryInstall"),ah="/v0.1/servers";function ai(a){return{registryName:a.server.name,server:a.server,verificationStatus:(0,F.vf)(a)}}async function aj(a,b=8){let c=await ak(a,b);return(await af(a,c.map(ai))).map(a=>(function(a,b){let c=(0,F.AH)(a),d=c[0];return{name:a.name,...a.title?{title:a.title}:{},...a.description?{description:a.description}:{},installable:c.length>0,requiredEnv:d?(0,F.jg)(d):[],...b?{quality:function(a){let b=b=>a.signals.find(a=>a.providerId===b)?.evidence,c=b(N),d=b(U),e=b(Z);return{score:a.score,..."number"==typeof c?.stars?{stars:c.stars}:{},..."number"==typeof d?.weeklyDownloads?{weeklyDownloads:d.weeklyDownloads}:{},..."string"==typeof e?.status?{status:e.status}:{}}}(b)}:{}}})(a.candidate.server,a))}async function ak(a,b){let c=new URL(E.jD+ah);c.searchParams.set("version","latest"),c.searchParams.set("limit",String(Math.min(Math.max(b,1),30))),a&&c.searchParams.set("search",a);let d=await (0,E.Ws)(c,15e3);return Array.isArray(d?.servers)?d.servers:[]}async function al(a){let b=new URL(E.jD+ah);b.searchParams.set("version","latest"),b.searchParams.set("limit","10"),b.searchParams.set("search",a);let c=await (0,E.Ws)(b,15e3),d=Array.isArray(c?.servers)?c.servers:[];return d.find(b=>b.server?.name===a)??d[0]??null}async function am(a,b,c){let d;if(!a||"string"!=typeof a)return{installed:!1,error:"A registry server name is required"};try{d=await al(a)}catch(a){return{installed:!1,error:`Registry lookup failed: ${a instanceof Error?a.message:String(a)}`}}let e=d?.server??null;if(!e)return{installed:!1,error:`No registry entry found for "${a}"`};let f=(0,F.AH)(e)[0];if(!f)return{installed:!1,error:`"${e.name}" has no install method FLUJO supports (stdio package or HTTP remote)`};let g=(0,F.vf)(d),h=(0,F.O$)(a,e,f,g);if(c?.resolveOnly)return{installed:!1,serverName:h.serverName,plan:h};let i=(0,F.jg)(f,b);if(i.length>0)return{installed:!1,needsEnv:i,plan:h,error:`"${e.name}" requires values for: ${i.join(", ")}`};let j=function(a,b){if(!b?.length)return a;if("stdio"!==a.transport||!Array.isArray(a.args))return{error:"Package argument templates require a stdio registry server"};let c=[...a.args];for(let a of b){if(!Number.isInteger(a.index)||a.index<0||a.index>c.length||a.index<c.length&&!/\$\{global:[A-Za-z0-9_.-]+\}/.test(c[a.index])||!/\$\{global:[A-Za-z0-9_.-]+\}/.test(a.value))return{error:`Invalid package argument template at index ${String(a.index)}; templates may append arguments or replace an existing global-backed argument`};c[a.index]=a.value}return{...a,args:c}}((0,F.cy)((0,F.Yr)(e,f),b),c?.argTemplates);if("error"in j)return{installed:!1,plan:h,error:j.error};let k=j.name,l=await G.mcpService.loadServerConfigs();if(Array.isArray(l)&&l.some(a=>a.name===k)){ag.info(`installRegistryServer: "${k}" already configured; reusing`);let{tools:a,error:b}=await G.mcpService.listServerTools(k);return{installed:!0,alreadyExisted:!0,serverName:k,plan:h,tools:(a??[]).map(a=>({name:a.name,...a.description?{description:a.description}:{}})),...b?{error:b}:{}}}ag.info(`installRegistryServer: installing "${e.name}" as "${k}" (${f.kind})`);let m=await G.mcpService.updateServerConfig(k,j);if(!Array.isArray(m)&&m&&"success"in m&&!1===m.success)return{installed:!1,error:`Saving the server failed: ${m.error??"unknown error"}`};let{tools:n,error:o}=await G.mcpService.listServerTools(k),p=(n??[]).map(a=>({name:a.name,...a.description?{description:a.description}:{}}));if((c?.worksGate??(await ac()).worksGate)&&0===p.length){ag.warn(`installRegistryServer: "${k}" exposed no tools${o?` (${o})`:""}; rolling back (works-gate)`);try{await G.mcpService.deleteServerConfig(k)}catch(a){ag.error(`installRegistryServer: rollback of "${k}" failed`,a)}return{installed:!1,worksGateRejected:!0,serverName:k,plan:h,error:o?`"${e.name}" failed to start: ${o}`:`"${e.name}" connected but exposed no tools — rejected by the works-gate. Try a different server.`}}return{installed:!0,serverName:k,plan:h,tools:p,...o?{error:o}:{}}}async function an(a,b,c){let d;if(!a||"string"!=typeof a)return{installed:!1,error:"A capability search query is required"};try{d=await ak(a,10)}catch(a){return{installed:!1,error:`Registry lookup failed: ${a instanceof Error?a.message:String(a)}`}}let e=await af(a,d.map(ai)),f=await ac(),g=c?.minScore??f.minScore,h=c?.maxAttempts??3,i=[],j=0;for(let a of e){let d=a.candidate.registryName;if(a.score<g){i.push({name:d,score:a.score,reason:`below minScore ${g}`});break}if(0===(0,F.AH)(a.candidate.server).length){i.push({name:d,score:a.score,reason:"no supported install method"});continue}if(j>=h)break;j+=1;let e=await am(d,b,{worksGate:!0});if(c?.onAttempt)try{await c.onAttempt(e.plan,e)}catch(a){ag.error("installBestForCapability: onAttempt hook failed",a)}if(e.installed)return{...e,attempts:i};let f=e.needsEnv?.length?`needs env: ${e.needsEnv.join(", ")}`:e.worksGateRejected?"works-gate rejected (no tools / failed to start)":e.error??"install failed";i.push({name:d,score:a.score,reason:f})}return{installed:!1,attempts:i,error:`No working server found for "${a}" among the top ${j} installable candidate(s).`}}let ao={requireConsent:!0,namespaceAllowlist:[],trustBrainStem:!0};function ap(a){let{caller:b,settings:c,registryName:d,allowInstall:e}=a;if("generator"===b)return!0===e?{allowed:!0,reason:"generator-allowinstall",message:"Approved by the per-generation allowInstall opt-in."}:{allowed:!1,reason:"generator-not-allowed",message:"Installing is not allowed in this generation (allowInstall is off)."};if("authoring-tool"===b&&c.trustBrainStem)return{allowed:!0,reason:"brainstem-trusted",message:"Approved: the /mcp-flows authoring tool is trusted (mcpAutoInstall.trustBrainStem)."};if(!c.requireConsent)return{allowed:!0,reason:"consent-disabled",message:"Approved: consent is not required (mcpAutoInstall.requireConsent is off)."};let f=function(a){if("string"!=typeof a)return"";let b=a.indexOf("/");return b>0?a.slice(0,b):""}(d);return""!==f&&c.namespaceAllowlist.includes(f)?{allowed:!0,reason:"namespace-allowlisted",message:`Approved: namespace "${f}" is allowlisted.`}:{allowed:!1,reason:"consent-required",message:"Consent required: review the exact command and arguments, then approve this install (SEP-1024)."}}function aq(a,b,c,d,e){return{at:new Date().toISOString(),caller:b,registryName:a.registryName,resolvedName:a.resolvedName,serverName:a.serverName,transport:a.transport,...a.command?{command:a.command}:{},...a.args?{args:a.args}:{},...a.serverUrl?{serverUrl:a.serverUrl}:{},requiredEnvNames:a.requiredEnvNames,verificationStatus:a.verificationStatus,consent:{allowed:c.allowed,reason:c.reason},installed:d,...e?{error:e}:{}}}let ar=(0,h.h)("backend/services/mcp/autoInstall");async function as(){try{let a=await (0,u.YM)(_.Z.MCP_AUTO_INSTALL_SETTINGS,ao)??{};return{requireConsent:"boolean"==typeof a.requireConsent?a.requireConsent:ao.requireConsent,namespaceAllowlist:Array.isArray(a.namespaceAllowlist)?a.namespaceAllowlist.filter(a=>"string"==typeof a&&a.length>0):[],trustBrainStem:"boolean"==typeof a.trustBrainStem?a.trustBrainStem:ao.trustBrainStem}}catch(a){return ar.warn("Failed to load mcpAutoInstall settings; using safe defaults",a),{...ao}}}let at="mcp-install-audit",au=Promise.resolve();async function av(){try{return await (0,u.YM)(at,[])}catch(a){return ar.error("Failed to load MCP install audit log",a),[]}}async function aw(a){let b=au.catch(()=>{}).then(async()=>{let b=await av();b.push(a);let c=b.slice(-300);await (0,u.VH)(at,c)}).catch(a=>{ar.error("Failed to append MCP install audit entry",a)});au=b,await b}let ax=(0,h.h)("backend/services/mcp/flowAuthoringTools"),ay=["list_flow_building_blocks","get_flow_authoring_guide","validate_flow_spec","draft_flow","draft_generated_flow","create_flow","search_mcp_marketplace","install_mcp_server","install_best_mcp_server"];function az(){return{type:"object",additionalProperties:!1,properties:{spec:{oneOf:[o,{type:"object",description:'Legacy advanced FlowSpec with nodes and edges. Pass profile="advanced"; fetch its contract with get_flow_authoring_guide.'}],description:"A guided SimpleFlowSpec by default, or a legacy advanced FlowSpec."},profile:{type:"string",enum:["simple","advanced"],description:"Authoring profile. Defaults to simple; legacy specs containing nodes+edges are auto-detected as advanced."},keepPills:{type:"boolean",description:"When true, binding pills (${tool:server__name}) that resolve against the node's wired servers are preserved in the compiled output instead of being stripped. Pills that cannot be resolved are still stripped with a warning. Default: false (strip all pills — generator-safe behaviour)."}},required:["spec"]}}function aA(a){let b=a?.spec;if("string"==typeof b)try{return JSON.parse(b)}catch{return null}return b??null}function aB(a,b=!1){return{content:[{type:"text",text:JSON.stringify(a,null,2)}],...b?{isError:!0}:{}}}async function aC(a,b){try{if("list_flow_building_blocks"===a){let a=await (0,q.jY)();return aB(a.blocks)}if("get_flow_authoring_guide"===a){let a=b?.profile==="advanced"?"advanced":"simple";if("advanced"===a)return aB({profile:a,guide:C});return aB({profile:a,schema:o,guide:["Set name, goal, and one or more ordered steps.","Each step needs id and task. model overrides the top-level default.","Tools use server/tool references from list_flow_building_blocks.","Set flow on a step to run an existing flow instead of a model.","Omit routes for a linear flow. Routes are only for branches; omit when for the fallback.","Start, Finish, layout, data handoff, and ordinary defaults are inferred."]})}if("search_mcp_marketplace"===a){let a="string"==typeof b?.query?b.query:"",c=await aj(a);return aB(c)}if("install_mcp_server"===a){let a="string"==typeof b?.name?b.name:"",c=b?.env&&"object"==typeof b.env&&!Array.isArray(b.env)?b.env:void 0,d=await am(a,c,{resolveOnly:!0});if(!d.plan)return aB(d,!0);let e=await as(),f=ap({caller:"authoring-tool",settings:e,registryName:a}),g=(0,F.nO)(d.plan.verificationStatus)?void 0:`Unverified / self-asserted registry entry (status: ${d.plan.verificationStatus}). Registry entries are publisher-asserted — review the command before approving.`;if(await aw(aq(d.plan,"authoring-tool",f,!1)),!f.allowed)return aB({installed:!1,consentRequired:!0,message:f.message,plan:d.plan,...g?{verificationWarning:g}:{}});let h=await am(a,c);return await aw(aq(h.plan??d.plan,"authoring-tool",f,h.installed,h.error)),aB({...h,...g?{verificationWarning:g}:{}},!h.installed)}if("install_best_mcp_server"===a){let a="string"==typeof b?.capability?b.capability:"",c=b?.env&&"object"==typeof b.env&&!Array.isArray(b.env)?b.env:void 0;if(!a)return aB({error:'Provide a "capability" search term.'},!0);let d=await as(),e=ap({caller:"authoring-tool",settings:d,registryName:a});if(!e.allowed){let b=(await aj(a)).find(a=>a.installable),d=b?await am(b.name,c,{resolveOnly:!0}):null;return d?.plan&&await aw(aq(d.plan,"authoring-tool",e,!1)),aB({installed:!1,consentRequired:!0,message:e.message,...d?.plan?{plan:d.plan}:{}})}let f=await an(a,c,{onAttempt:async(a,b)=>{a&&await aw(aq(a,"authoring-tool",e,b.installed,b.error))}}),g=f.installed&&!(0,F.nO)(f.plan?.verificationStatus)?`Installed an unverified / self-asserted registry entry (status: ${f.plan?.verificationStatus}).`:void 0;return aB({...f,...g?{verificationWarning:g}:{}},!f.installed)}if("draft_generated_flow"===a){let a=aA(b);if(!a||"object"!=typeof a||Array.isArray(a))return aB({error:'Provide a complete advanced FlowSpec object in "spec".'},!0);let c=await (0,q.jY)(),d=(0,D.oW)(a,c);if(!d.success)return aB({error:"The generated specification could not be compiled.",spec:d.spec,issues:d.issues,hardening:{guardChanges:d.guardChanges,repairChanges:d.repairChanges}},!0);return aB({profile:"advanced",pipeline:"production-generator",saved:!1,rootFlowId:d.flow.id,flow:d.flow,flows:d.flows.map(a=>a.flow),spec:d.spec,validation:d.validation,hardening:{guardChanges:d.guardChanges,repairChanges:d.repairChanges}})}if("validate_flow_spec"===a||"draft_flow"===a||"create_flow"===a){let c=aA(b);if(!c)return aB({error:'Provide a "spec" argument: a SimpleFlowSpec object (or JSON string).'},!0);let d=c&&"object"==typeof c&&!Array.isArray(c)?c:{},e="advanced"===b.profile?"advanced":"simple"===b.profile?"simple":Array.isArray(d.nodes)&&Array.isArray(d.edges)?"advanced":"simple",f=!0===b.keepPills,g=await s(c,{save:"create_flow"===a,keepPills:f,profile:e});if(!g.success)return aB({error:g.error,issues:g.issues??[]},!0);let h=g.flows.length,i=h>1?` (plus ${h-1} nested subflow flow(s))`:"",j={profile:e,flowId:g.flow.id,flowName:g.flow.name,nodeCount:g.flow.nodes.length,edgeCount:g.flow.edges.length,...h>1?{flows:g.flows.map(a=>({id:a.id,name:a.name}))}:{},validation:g.validation,..."draft_flow"===a?{saved:!1,rootFlowId:g.flow.id,flow:g.flow,flows:g.flows}:{},..."create_flow"===a?{saved:g.saved,...g.saved?{note:`Flow "${g.flow.name}"${i} was created. It is callable as a tool on this MCP server (after a fresh tools/list) and as model "flow-${g.flow.name}" on the OpenAI-compatible endpoint.`}:{note:"NOT saved: validation found errors. Fix the issues and call create_flow again."}}:{}};return aB(j,"create_flow"===a&&!g.saved)}return aB({error:`Unknown authoring tool: ${a}`},!0)}catch(b){return ax.error("authoringCallTool failed",{toolName:a,err:b}),aB({error:`Authoring tool failed: ${b instanceof Error?b.message:String(b)}`},!0)}}var aD=c(92018);let aE=(0,h.h)("backend/services/mcp/internalTools");function aF(a,b=!1){return{content:[{type:"text",text:"string"==typeof a?a:JSON.stringify(a,null,2)}],...b?{isError:!0}:{}}}function aG(){return[{name:"list_flow_building_blocks",description:"List models, MCP server/tool references, and existing flows available to a new flow.",inputSchema:{type:"object",properties:{}}},{name:"get_flow_authoring_guide",description:"Fetch the flow-authoring contract only when needed. The simple guide is compact; the advanced guide contains the complete FlowSpec reference.",inputSchema:{type:"object",properties:{profile:{type:"string",enum:["simple","advanced"],description:"Guide to return. Defaults to simple."}}}},{name:"validate_flow_spec",description:"Compile and validate a guided flow without saving. Returns a compact summary and issues. Use draft_flow when the caller needs the complete unsaved draft.",inputSchema:az()},{name:"draft_flow",description:"Compile and validate a flow WITHOUT saving and return the complete draft bundle for review or opening in the Flow Builder.",inputSchema:az()},{name:"draft_generated_flow",description:"Run the production Flow Generator post-processing pipeline on a complete advanced FlowSpec: scratchpad safety guard, structural auto-repair, bounded nested compilation, generated-flow defaults, and whole-bundle validation. Returns the complete UNSAVED draft and hardened spec.",inputSchema:{type:"object",additionalProperties:!1,properties:{spec:{type:"object",description:'A complete advanced FlowSpec authored using get_flow_authoring_guide(profile="advanced").'}},required:["spec"]}},{name:"create_flow",description:"Compile, validate, and save a guided flow. Saving occurs only when validation has no errors. Use list_flow_building_blocks for valid references.",inputSchema:az()},{name:"search_mcp_marketplace",description:"Search the public MCP server registry for new capabilities (voice, browsing, files, email, vision, …). The registry matches the query against server NAMES only (substring) — use short single terms and try several. Returns name, description, whether FLUJO can install it, and which env vars/keys it would require.",inputSchema:{type:"object",properties:{query:{type:"string",description:"Short search term matched against server names."}},required:["query"]}},{name:"install_mcp_server",description:'Install an MCP server from the public registry (by the exact name returned by search_mcp_marketplace) and connect it — this DOWNLOADS AND RUNS a third-party package on the FLUJO host. Installs are gated by consent (SEP-1024): unless this trusted authoring tool is allowed via the mcpAutoInstall settings (trustBrainStem / requireConsent / namespaceAllowlist), the tool returns the exact resolved command + arguments with consentRequired=true INSTEAD of installing, and the caller must obtain explicit approval. Every attempt is written to an audit log (command, args, env NAMES, verification status — never secret values) before any spawn. Returns the FLUJO server name (reference it in FlowSpec "servers") and the tools it provides, or needsEnv when required keys are missing (supply values via the optional "env" argument), or the resolved plan when consent is required. First install can take minutes (package download).',inputSchema:{type:"object",properties:{name:{type:"string",description:'Exact registry name from search results, e.g. "ai.keenable/web-search".'},env:{type:"object",description:"Optional env var values for the server (e.g. required API keys).",additionalProperties:{type:"string"}}},required:["name"]}},{name:"install_best_mcp_server",description:"Install the BEST WORKING MCP server for a capability, unattended — the recommended way to acquire a capability when you don't already have a specific server name. Searches the registry, RANKS candidates by blended quality (GitHub stars + recent activity, npm weekly downloads, registry status), then installs best→worst until one actually boots and exposes tools (the \"works-gate\"): candidates that need unavailable keys, can't be installed, or start with zero tools are skipped automatically. Same consent/audit rules and third-party-code warning as install_mcp_server. Returns the installed server name + its tools and the list of candidates tried, or needsEnv/consentRequired. Prefer this over search+install for headless self-improvement; use install_mcp_server only when you must pin an exact server.",inputSchema:{type:"object",properties:{capability:{type:"string",description:'Short capability term matched against server names, e.g. "youtube", "email", "browser".'},env:{type:"object",description:"Optional env var values shared across attempted servers (e.g. an API key).",additionalProperties:{type:"string"}}},required:["capability"]}},{name:"list_flows",description:"List all flows in this FLUJO instance with lightweight metadata only (id, name, description, node count) and no flow content. Use this to enumerate flows cheaply. Use list_flow_building_blocks only when you need the full authoring catalog (models + servers + flows).",inputSchema:{type:"object",properties:{}}},{name:"execute_flow",description:"Run another FLUJO flow (by name or id) with the given input and return its final output. The run is ephemeral (no chat conversation is created). Use list_flow_building_blocks to see the available flows. Nested runs are limited in depth — a flow cannot recurse through itself indefinitely.",inputSchema:{type:"object",properties:{flow:{type:"string",description:"Flow name or flow id."},input:{type:"string",description:"The message to send to the flow as the user turn."}},required:["flow","input"]}},{name:"read_flow",description:"Read a FLUJO flow's full definition (by name or id): its nodes with their prompts, bound models, attached MCP servers/tools and input/output modes, plus the control and MCP edges. Note this is the COMPILED flow (node ids, not FlowSpec keys) — to change it, author a fresh FlowSpec and call update_flow.",inputSchema:{type:"object",properties:{flow:{type:"string",description:"Flow name or flow id."}},required:["flow"]}},{name:"update_flow",description:"REPLACE an existing FLUJO flow's definition (by name or id) with a newly compiled FlowSpec, keeping the flow's id — so planned executions, subflow nodes and conversations that reference it keep working. The spec format is the same as create_flow/validate_flow_spec (see those tool descriptions); saving is gated on zero validation errors. The replaced definition is archived automatically — list_flow_versions / revert_flow can restore it. Note that manual canvas edits made in the builder are part of what gets replaced. Use read_flow first to see what you are replacing.",inputSchema:{type:"object",properties:{flow:{type:"string",description:"Flow name or flow id of the flow to replace."},spec:{type:"object",description:"The FlowSpec object (see the create_flow tool description for the format)."}},required:["flow","spec"]}},{name:"list_flow_versions",description:"List a flow's archived versions (by name or id), newest first. A version is created automatically whenever the flow's definition is overwritten (builder save, update_flow, revert_flow) and holds the definition that was replaced. Use read_flow_version to inspect one and revert_flow to restore one.",inputSchema:{type:"object",properties:{flow:{type:"string",description:"Flow name or flow id."}},required:["flow"]}},{name:"read_flow_version",description:"Read one archived version of a flow (see list_flow_versions): the full definition it held before it was replaced, in the same format as read_flow.",inputSchema:{type:"object",properties:{flow:{type:"string",description:"Flow name or flow id."},version:{type:"string",description:"The version id (see list_flow_versions)."}},required:["flow","version"]}},{name:"revert_flow",description:"Restore an archived version (see list_flow_versions) as the flow's CURRENT definition. The definition being reverted away from is archived first, so a revert can itself be undone. References by flow id keep working.",inputSchema:{type:"object",properties:{flow:{type:"string",description:"Flow name or flow id."},version:{type:"string",description:"The version id to restore (see list_flow_versions)."}},required:["flow","version"]}},{name:"delete_flow",description:"PERMANENTLY delete a FLUJO flow (by name or id). This cannot be undone — the flow's version history is deleted with it. Verify the target with list_flow_building_blocks first.",inputSchema:{type:"object",properties:{flow:{type:"string",description:"Flow name or flow id."}},required:["flow"]}},{name:"list_mcp_servers",description:"List the MCP servers configured in this FLUJO instance with their transport, enabled/disabled state and live connection status. Config details (env vars, headers, credentials) are never included.",inputSchema:{type:"object",properties:{}}},{name:"list_mcp_server_tools",description:"List the tools of one configured MCP server (name, description, input schema). Use together with call_mcp_tool for servers that are not bound to this flow.",inputSchema:{type:"object",properties:{server:{type:"string",description:"The FLUJO server name (see list_mcp_servers)."}},required:["server"]}},{name:"call_mcp_tool",description:"Call a tool on any configured MCP server by server name + tool name. This lets you use servers that are not bound to the current flow. Check the tool's input schema with list_mcp_server_tools first.",inputSchema:{type:"object",properties:{server:{type:"string",description:"The FLUJO server name."},tool:{type:"string",description:"The tool name on that server."},args:{type:"object",description:"Arguments for the tool (per its input schema)."},timeout:{type:"number",description:"Optional timeout in seconds."}},required:["server","tool"]}},{name:"restart_mcp_server",description:"Force-reconnect a configured MCP server (tears the connection down and rebuilds it). Useful when a server is in an error state after a config or environment change.",inputSchema:{type:"object",properties:{server:{type:"string",description:"The FLUJO server name."}},required:["server"]}},{name:"set_mcp_server_enabled",description:"Enable or disable a configured MCP server. Disabling disconnects it and prevents any further use; enabling connects it.",inputSchema:{type:"object",properties:{server:{type:"string",description:"The FLUJO server name."},enabled:{type:"boolean",description:"true to enable + connect, false to disable + disconnect."}},required:["server","enabled"]}},{name:"list_models",description:"List the models configured in this FLUJO instance (id, name, display name, description, provider, base URL, context window). API keys are never included. Reference models by id or name in FlowSpecs.",inputSchema:{type:"object",properties:{}}},{name:"list_planned_executions",description:"List the planned (scheduled/triggered) executions in this FLUJO instance with their trigger type, enabled state, armed status and last run outcome.",inputSchema:{type:"object",properties:{}}},{name:"run_planned_execution",description:"Fire a planned execution immediately (by id, see list_planned_executions) and return the run record with its output.",inputSchema:{type:"object",properties:{id:{type:"string",description:"The planned execution id."}},required:["id"]}},{name:"update_planned_execution",description:'Modify an existing planned execution (by id or name, see list_planned_executions). Patch any of: "enabled" (turn the schedule on/off), "prompt" (the run prompt), "flowId" (the flow to run — accepts a flow name or id), "cron" (a convenience for the trigger\'s cron pattern — works for schedule / mcp-poll / url-watch triggers) or a full "trigger" object for complete control. Flow-driven cadence changes are clamped to a minimum interval (a runaway every-second schedule is rejected). The webhook secret token is never returned.',inputSchema:{type:"object",properties:{execution:{type:"string",description:"The planned execution id or name."},enabled:{type:"boolean",description:"Enable or disable the execution."},prompt:{type:"string",description:"The run prompt."},flowId:{type:"string",description:"The flow to run — a flow name or id (resolved to the flow id)."},cron:{type:"string",description:"Cron pattern (croner syntax; 6-field form for seconds) for the trigger's schedule. Applies to schedule / mcp-poll / url-watch triggers."},trigger:{type:"object",description:"Full trigger config object (escape hatch for complete control). Prefer the named fields above."}},required:["execution"]}},{name:"create_planned_execution",description:'Create a new planned execution: bind a flow to a trigger so it runs headlessly. Provide "name", "flow" (a flow name or id), an optional "prompt", optional "enabled" (default true), and EITHER a full "trigger" object OR a convenience "cron" (which creates a schedule trigger). Flow-driven cadence is clamped to a minimum interval. A webhook trigger\'s secret token is minted server-side and never returned.',inputSchema:{type:"object",properties:{name:{type:"string",description:"A name for the planned execution."},flow:{type:"string",description:"The flow to run — a flow name or id."},prompt:{type:"string",description:"The run prompt (may be empty)."},enabled:{type:"boolean",description:"Whether to arm the trigger immediately (default true)."},cron:{type:"string",description:'Cron pattern for a schedule trigger (convenience — use "trigger" for other trigger types).'},trigger:{type:"object",description:"Full trigger config object (schedule / webhook / file-watch / mcp-poll / url-watch)."}},required:["name","flow"]}},{name:"delete_planned_execution",description:"Permanently delete a planned execution (by id or name, see list_planned_executions), along with its run history. This cannot be undone.",inputSchema:{type:"object",properties:{execution:{type:"string",description:"The planned execution id or name."}},required:["execution"]}},{name:"list_conversations",description:"List the chat conversations stored in this FLUJO instance (id, title, bound flow, status, created/updated timestamps), newest first. Use read_conversation to get a transcript.",inputSchema:{type:"object",properties:{limit:{type:"number",description:"Optional maximum number of conversations to return (newest first). Default: all."}}}},{name:"read_conversation",description:'Read one chat conversation\'s transcript by conversation id (see list_conversations). Returns the displayed messages: system prompts are excluded, nested subflow steps carry a "depth" marker, assistant tool calls are summarized. Long conversations return only the most recent messages — raise "limit" to get more.',inputSchema:{type:"object",properties:{conversation:{type:"string",description:"The conversation id."},limit:{type:"number",description:"Maximum number of most-recent messages to return (default 50). The total transcript size is capped regardless."}},required:["conversation"]}},{name:"kv_get",description:'Read a value from FLUJO\'s PERSISTENT key-value store (the ${kv:NAME} store) — state that survives ACROSS flow runs (loop counters, cursors, flags). Returns { found, value }. Defaults to the instance-global board; pass "scope" to target another board (e.g. a flow-folder board id). Values are plain strings, never secrets.',inputSchema:{type:"object",properties:{name:{type:"string",description:"The key to read (an identifier: letters, digits, _ and -, not starting with a digit)."},scope:{type:"string",description:'Optional board id to read from. Defaults to "global".'}},required:["name"]}},{name:"kv_set",description:'Write a value to FLUJO\'s PERSISTENT key-value store (the ${kv:NAME} store) — state that survives ACROSS flow runs. Last-write-wins. Defaults to the instance-global board; pass "scope" to target another board. Values are plain strings (never secrets — use ${global:} for those) and are size-capped; an oversized write is refused with { saved:false, skipped }.',inputSchema:{type:"object",properties:{name:{type:"string",description:"The key to write (an identifier: letters, digits, _ and -, not starting with a digit)."},value:{type:"string",description:"The string value to store."},scope:{type:"string",description:'Optional board id to write to. Defaults to "global".'}},required:["name","value"]}}]}async function aH(a){let b=await i.flowService.loadFlows();return b.find(b=>b.id===a)??b.find(b=>b.name===a)}async function aI(a){let b=String(a?.flow??"").trim();if(!b)return aF({error:'Provide "flow": a flow name or id.'},!0);let c=await aH(b);if(!c)return aF({error:`No flow named or with id "${b}". Use list_flow_building_blocks to see the available flows.`},!0);let d=global.__flujo_internal_flow_depth??0;if(d>=4)return aF({error:`execute_flow nesting limit (4) reached — refusing to start "${c.name}" to prevent runaway recursion.`},!0);global.__flujo_internal_flow_depth=d+1;try{let b=await (0,m.runFlow)({flowId:c.id,prompt:String(a?.input??""),mode:"ephemeral",flujo:!0,requireApproval:!1});if(b.flowNotFound)return aF({error:`Flow not found: ${b.flowNotFound.name}`},!0);if("error"===b.status)return aF({error:b.error?.message??"Unknown error during flow execution."},!0);return aF(b.outputText??"")}finally{global.__flujo_internal_flow_depth=d}}async function aJ(a){let b=String(a?.flow??"").trim();if(!b)return aF({error:'Provide "flow": a flow name or id.'},!0);let c=await aH(b);if(!c)return aF({error:`No flow named or with id "${b}".`},!0);let d=await i.flowService.deleteFlow(c.id);return d.success?aF({deleted:!0,flowId:c.id,flowName:c.name}):aF({error:d.error??`Failed to delete flow "${c.name}".`},!0)}function aK(a){let b=a.nodes.map(a=>{let{mcpNodes:b,...c}=a.data?.properties??{};return{id:a.id,type:a.type,label:a.data?.label,...a.data?.description?{description:a.data.description}:{},properties:c}}),c=a.edges.map(a=>{let b=a.data;return{from:a.source,to:a.target,type:b?.edgeType==="mcp"?"mcp":b?.edgeType==="resource"?"resource":"control",...b?.bidirectional?{bidirectional:!0}:{}}});return{id:a.id,name:a.name,...a.description?{description:a.description}:{},nodes:b,edges:c}}async function aL(a){let b=String(a?.flow??"").trim();if(!b)return aF({error:'Provide "flow": a flow name or id.'},!0);let c=await aH(b);return c?aF({...aK(c),note:"This is the compiled flow (node ids, not FlowSpec keys). To change it, author a fresh FlowSpec and call update_flow — it replaces the whole definition while keeping this flow id."}):aF({error:`No flow named or with id "${b}". Use list_flow_building_blocks to see the available flows.`},!0)}async function aM(a){let b=String(a?.flow??"").trim();if(!b)return aF({error:'Provide "flow": a flow name or id.'},!0);let c=await aH(b);if(!c)return aF({error:`No flow named or with id "${b}".`},!0);let d=await i.flowService.listFlowVersions(c.id);return aF({flowId:c.id,flowName:c.name,versions:d,...0===d.length?{note:"No archived versions yet — versions appear once the flow's definition is overwritten for the first time."}:{}})}async function aN(a){let b=String(a?.flow??"").trim(),c=String(a?.version??"").trim();if(!b||!c)return aF({error:'Provide "flow" (name or id) and "version" (see list_flow_versions).'},!0);let d=await aH(b);if(!d)return aF({error:`No flow named or with id "${b}".`},!0);let e=await i.flowService.getFlowVersion(d.id,c);return e?aF({versionId:e.versionId,savedAt:e.savedAt,...aK(e.flow)}):aF({error:`No version "${c}" of flow "${d.name}". Use list_flow_versions to see the archived versions.`},!0)}async function aO(a){let b=String(a?.flow??"").trim(),c=String(a?.version??"").trim();if(!b||!c)return aF({error:'Provide "flow" (name or id) and "version" (see list_flow_versions).'},!0);let d=await aH(b);if(!d)return aF({error:`No flow named or with id "${b}".`},!0);let e=await i.flowService.revertFlow(d.id,c);return e.success?aF({reverted:!0,flowId:d.id,versionId:c,note:"The definition that was just replaced has been archived too, so this revert can itself be undone via list_flow_versions / revert_flow."}):aF({error:e.error??`Failed to revert flow "${d.name}".`},!0)}async function aP(a){let b=String(a?.flow??"").trim();if(!b)return aF({error:'Provide "flow": the name or id of the flow to replace.'},!0);let c=function(a){let b=a?.spec;if("string"==typeof b)try{return JSON.parse(b)}catch{return null}return b??null}(a);if(!c)return aF({error:'Provide a "spec" argument: a FlowSpec object (or a JSON string of one).'},!0);let d=await aH(b);if(!d)return aF({error:`No flow named or with id "${b}". Use list_flow_building_blocks to see the available flows.`},!0);let e=await s(c,{save:!0,updateFlowId:d.id});return e.success?aF({flowId:e.flow.id,flowName:e.flow.name,nodeCount:e.flow.nodes.length,edgeCount:e.flow.edges.length,validation:e.validation,saved:e.saved,...e.saved?{note:`Flow "${e.flow.name}" was replaced (id ${e.flow.id} kept — existing references keep working).`}:{note:"NOT saved: validation found errors. The existing flow is unchanged. Fix the issues and call update_flow again."}},!e.saved):aF({error:e.error,issues:e.issues??[]},!0)}async function aQ(a){let b=await a.loadServerConfigs();return Array.isArray(b)?aF(await Promise.all(b.map(async b=>{let c="unknown";try{c=(await a.getServerStatus(b.name)).status}catch(a){aE.debug(`list_mcp_servers: getServerStatus failed for ${b.name}`,a)}return{name:b.name,transport:b.transport,enabled:!b.disabled,status:c,...b.builtIn?{builtIn:!0}:{}}}))):aF({error:b.error??"Failed to load server configs."},!0)}async function aR(a,b,c){let d=String(b?.server??"").trim();if(!d)return aF({error:'Provide "server": a FLUJO server name.'},!0);if(d===aD._)return aF(aG().map(a=>({name:a.name,description:a.description,inputSchema:a.inputSchema})));let{tools:e,error:f}=await a.listServerTools(d,"host"===c?"all":c);return f?aF({error:f},!0):aF(e.map(a=>({name:a.name,description:a.description,inputSchema:a.inputSchema})))}async function aS(a,b,c){let d=String(b?.server??"").trim(),e=String(b?.tool??"").trim();if(!d||!e)return aF({error:'Provide "server" and "tool".'},!0);if(d===aD._)return aF({error:`"${aD._}" is this server — call its tools directly instead of through call_mcp_tool.`},!0);let f=b?.args&&"object"==typeof b.args&&!Array.isArray(b.args)?b.args:{},g="number"==typeof b?.timeout?b.timeout:void 0,h=await a.callTool(d,e,f,g,void 0,void 0,void 0,c);if(!h.success)return aF({error:h.error??`Tool call failed on ${d}.`},!0);let i=h.data;return i&&Array.isArray(i.content)?i:aF(i??{ok:!0})}async function aT(a,b){let c=String(b?.server??"").trim();if(!c)return aF({error:'Provide "server": a FLUJO server name.'},!0);if(c===aD._)return aF({ok:!0,note:`"${aD._}" is the built-in server — it is always running.`});let d=await a.forceReconnect(c);if(!d.success)return aF({error:d.error??`Failed to restart ${c}.`},!0);let e=await a.getServerStatus(c);return aF({restarted:!0,server:c,status:e.status})}async function aU(a,b){let c=String(b?.server??"").trim(),d=b?.enabled;if(!c||"boolean"!=typeof d)return aF({error:'Provide "server" (string) and "enabled" (boolean).'},!0);if(c===aD._)return aF({error:`The built-in "${aD._}" server cannot be disabled.`},!0);let e=await a.updateServerConfig(c,{disabled:!d});return"error"in e?aF({error:e.error},!0):aF({server:c,enabled:d})}async function aV(){try{let a=(await i.flowService.loadFlows()).map(a=>({id:a.id,name:a.name,...a.description?{description:(0,q.xv)(a.description,q.bD)}:{},nodeCount:a.nodes?.length??0}));return aF(a)}catch(a){return aE.error("list_flows failed",a),aF({error:"Failed to load flows."},!0)}}async function aW(){return aF((await j.modelService.loadModels()).map(a=>({id:a.id,name:a.name,...a.displayName?{displayName:a.displayName}:{},...a.description?{description:a.description}:{},...a.provider?{provider:a.provider}:{},...a.baseUrl?{baseUrl:a.baseUrl}:{},...a.contextWindow?{contextWindow:a.contextWindow}:{}})))}async function aX(){return aF((await (0,k.z)().list()).map(({execution:a,status:b,lastRun:c})=>({id:a.id,name:a.name,enabled:a.enabled,flowId:a.flowId,triggerType:a.trigger?.type,armed:b?.armed??!1,...c?{lastRun:{status:c.status,firedAt:c.firedAt,...c.error?{error:c.error}:{}}}:{}})))}async function aY(a){let b=String(a?.id??"").trim();if(!b)return aF({error:'Provide "id": a planned execution id (see list_planned_executions).'},!0);let{record:c,error:d}=await (0,k.z)().runNow(b);return d||!c?aF({error:d??"Run failed."},!0):aF({runId:c.runId,status:c.status,firedAt:c.firedAt,...c.finishedAt?{finishedAt:c.finishedAt}:{},...c.outputText?{outputText:c.outputText}:{},...c.error?{error:c.error}:{}})}async function aZ(a){let b=await (0,k.z)().list(),c=b.find(b=>b.execution.id===a),d=b.find(b=>b.execution.name===a);return(c??d)?.execution??null}function a$(a){return{id:a.id,name:a.name,enabled:a.enabled,flowId:a.flowId,triggerType:a.trigger?.type}}function a_(a,b){try{let c=(0,l.Z9)(a,b,5).map(a=>new Date(a).getTime()),d=1/0;for(let a=1;a<c.length;a++){let b=c[a]-c[a-1];b>0&&b<d&&(d=b)}return Number.isFinite(d)?d:null}catch{return null}}function a0(a){let b=null;return("schedule"===a.type||"url-watch"===a.type?a.cron&&(b=a_(a.cron,a.timezone)):"mcp-poll"===a.type&&(a.cron?b=a_(a.cron,a.timezone):"number"==typeof a.intervalMs&&(b=a.intervalMs)),null!==b&&b<6e4)?`Cadence too fast: the trigger would fire about every ${Math.round(b/1e3)}s, but flow-driven schedule changes are clamped to a minimum interval of 60s. Choose a slower cadence (change it from the Planned Executions page for a faster one).`:null}async function a1(a){let b,c=String(a?.execution??"").trim();if(!c)return aF({error:'Provide "execution": a planned execution id or name (see list_planned_executions).'},!0);let d=await aZ(c);if(!d)return aF({error:`No planned execution with id or name "${c}". Use list_planned_executions to see them.`},!0);let e={};"boolean"==typeof a?.enabled&&(e.enabled=a.enabled),"string"==typeof a?.prompt&&(e.prompt=a.prompt);let f=String(a?.flowId??a?.flow??"").trim();if(f){let a=await aH(f);if(!a)return aF({error:`No flow named or with id "${f}". Use list_flow_building_blocks to see the flows.`},!0);e.flowId=a.id}a?.trigger&&"object"==typeof a.trigger&&!Array.isArray(a.trigger)&&(b=a.trigger);let g="string"==typeof a?.cron?a.cron.trim():"";if(g){let a=b??d.trigger;if("schedule"!==a.type&&"mcp-poll"!==a.type&&"url-watch"!==a.type)return aF({error:`The "${a.type}" trigger has no schedule to change with "cron". Pass a full "trigger" object instead.`},!0);b={...a,cron:g}}if(b){let a=a0(b);if(a)return aF({error:a},!0);e.trigger=b}if(0===Object.keys(e).length)return aF({error:"Nothing to update. Provide at least one of: enabled, prompt, flowId, cron, trigger."},!0);let h=await (0,k.z)().update(d.id,e);return h.error||!h.execution?aF({error:h.error??"Update failed."},!0):aF({updated:!0,...a$(h.execution)})}async function a2(a){let b,c=String(a?.name??"").trim();if(!c)return aF({error:'Provide "name": a name for the planned execution.'},!0);let d=String(a?.flow??a?.flowId??"").trim();if(!d)return aF({error:'Provide "flow": a flow name or id to run.'},!0);let e=await aH(d);if(!e)return aF({error:`No flow named or with id "${d}". Use list_flow_building_blocks to see the flows.`},!0);if(a?.trigger&&"object"==typeof a.trigger&&!Array.isArray(a.trigger))b=a.trigger;else{let c="string"==typeof a?.cron?a.cron.trim():"";if(!c)return aF({error:'Provide a "trigger" object or a "cron" pattern (which creates a schedule trigger).'},!0);b={type:"schedule",cron:c}}let f=a0(b);if(f)return aF({error:f},!0);let g={name:c,enabled:"boolean"!=typeof a?.enabled||a.enabled,flowId:e.id,prompt:"string"==typeof a?.prompt?a.prompt:"",trigger:b},h=await (0,k.z)().create(g);return h.error||!h.execution?aF({error:h.error??"Create failed."},!0):aF({created:!0,...a$(h.execution)})}async function a3(a){let b=String(a?.execution??"").trim();if(!b)return aF({error:'Provide "execution": a planned execution id or name (see list_planned_executions).'},!0);let c=await aZ(b);if(!c)return aF({error:`No planned execution with id or name "${b}". Use list_planned_executions to see them.`},!0);let d=await (0,k.z)().delete(c.id);return d.success?aF({deleted:!0,id:c.id,name:c.name}):aF({error:d.error??`Failed to delete "${c.name}".`},!0)}async function a4(a){let b,c=f().join((0,A.getDataDir)(),"db","conversations");try{b=await g.promises.readdir(c)}catch(a){if("ENOENT"===a.code)return aF([]);return aF({error:`Failed to list conversations: ${a instanceof Error?a.message:String(a)}`},!0)}let d=(await Promise.all(b.filter(a=>a.endsWith(".json")).map(async a=>{try{let b=await g.promises.readFile(f().join(c,a),"utf-8"),d=JSON.parse(b),e=d.conversationId||a.replace(/\.json$/,""),h=d.status;return"running"===h&&0===z.$.currentSeq(e)&&(h="error"),{id:e,title:d.title||"Untitled Conversation",flowId:d.flowId||null,...h?{status:h}:{},createdAt:d.createdAt||0,updatedAt:d.updatedAt||0}}catch(b){return aE.warn(`list_conversations: skipping unreadable conversation file ${a}`,b),null}}))).filter(a=>null!==a).sort((a,b)=>b.updatedAt-a.updatedAt),e="number"==typeof a?.limit&&a.limit>0?Math.floor(a.limit):void 0;return aF(e?d.slice(0,e):d)}async function a5(a){let b=String(a?.conversation??"").trim();if(!b)return aF({error:'Provide "conversation": a conversation id (see list_conversations).'},!0);await (0,v.flushConversationLog)(b);let c=await y(b);if(!c)return aF({error:`No conversation with id "${b}". Use list_conversations to see the stored conversations.`},!0);let d=await (0,v.readConversationLog)(b),e=d?(0,v.projectMessages)(d):[],f=e.length>0?e:(c.messages||[]).filter(a=>"system"!==a.role),g="number"==typeof a?.limit&&a.limit>0?Math.floor(a.limit):50,h=[],i=0;for(let a=f.length-1;a>=0&&h.length<g;a--){let b=function(a){let b="";"string"==typeof a.content?b=a.content:Array.isArray(a.content)&&(b=a.content.map(a=>"text"in a&&"string"==typeof a.text?a.text:"").filter(Boolean).join("\n"));let c={role:a.role,...b?{content:b}:{},...a.timestamp?{timestamp:a.timestamp}:{},...a.depth?{depth:a.depth}:{}};return"assistant"===a.role&&Array.isArray(a.tool_calls)&&a.tool_calls.length>0&&(c.toolCalls=a.tool_calls.map(a=>{let b="function"in a?a.function:void 0,c=b&&"string"==typeof b.arguments?b.arguments:void 0;return{id:a.id,...b?.name?{name:b.name}:{},...void 0!==c?{arguments:c.length>2e3?c.slice(0,2e3)+"…[truncated]":c}:{}}})),"tool"===a.role&&a.tool_call_id&&(c.toolCallId=a.tool_call_id),c}(f[a]),c=JSON.stringify(b).length;if(h.length>0&&i+c>1e5)break;h.push(b),i+=c}return h.reverse(),aF({id:c.conversationId||b,title:c.title||"Untitled Conversation",flowId:c.flowId||null,...c.status?{status:c.status}:{},createdAt:c.createdAt||0,updatedAt:c.updatedAt||0,totalMessages:f.length,...h.length<f.length?{note:`Returning the ${h.length} most recent of ${f.length} messages — raise "limit" to get more.`}:{},messages:h})}let a6=/^[A-Za-z0-9_-]{1,64}$/,a7=/^[A-Za-z_][\w-]*$/;async function a8(a){let b="string"==typeof a.name?a.name.trim():"",c="string"==typeof a.scope&&a.scope.trim()?a.scope.trim():"global";if(!a7.test(b))return aF({error:'kv_get requires a valid "name" (letters, digits, _ and -, not starting with a digit).'},!0);if(!a6.test(c))return aF({error:`Invalid kv scope id: ${c}`},!0);let d=await (0,B.M3)(c,b);return aF({scope:c,name:b,found:void 0!==d,value:d??null})}async function a9(a){let b="string"==typeof a.name?a.name.trim():"",c="string"==typeof a.scope&&a.scope.trim()?a.scope.trim():"global",d="string"==typeof a.value?a.value:null==a.value?"":String(a.value);if(!a7.test(b))return aF({error:'kv_set requires a valid "name" (letters, digits, _ and -, not starting with a digit).'},!0);if(!a6.test(c))return aF({error:`Invalid kv scope id: ${c}`},!0);let e=await (0,B.or)(c,b,d);return"skipped"in e?aF({scope:c,name:b,saved:!1,skipped:e.skipped},!0):aF({scope:c,name:b,saved:!0,size:e.size})}async function ba(a,b,c,d="host"){try{if(ay.includes(b))return await aC(b,c);switch(b){case"list_flows":return await aV();case"execute_flow":return await aI(c);case"read_flow":return await aL(c);case"update_flow":return await aP(c);case"list_flow_versions":return await aM(c);case"read_flow_version":return await aN(c);case"revert_flow":return await aO(c);case"delete_flow":return await aJ(c);case"list_mcp_servers":return await aQ(a);case"list_mcp_server_tools":return await aR(a,c,d);case"call_mcp_tool":return await aS(a,c,d);case"restart_mcp_server":return await aT(a,c);case"set_mcp_server_enabled":return await aU(a,c);case"list_models":return await aW();case"list_planned_executions":return await aX();case"run_planned_execution":return await aY(c);case"update_planned_execution":return await a1(c);case"create_planned_execution":return await a2(c);case"delete_planned_execution":return await a3(c);case"list_conversations":return await a4(c);case"read_conversation":return await a5(c);case"kv_get":return await a8(c);case"kv_set":return await a9(c);default:return aF({error:`Unknown tool on the built-in FLUJO server: ${b}`},!0)}}catch(a){return aE.error("internalCallTool failed",{toolName:b,err:a}),aF({error:`Tool failed: ${a instanceof Error?a.message:String(a)}`},!0)}}}};