flujo-ai 3.38.0 → 3.40.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 (997) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +617 -433
  3. package/.next/app-path-routes-manifest.json +42 -26
  4. package/.next/build-manifest.json +5 -5
  5. package/.next/prerender-manifest.json +90 -18
  6. package/.next/react-loadable-manifest.json +40 -47
  7. package/.next/routes-manifest.json +34 -0
  8. package/.next/server/app/_not-found/page.js +3 -4
  9. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  10. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  11. package/.next/server/app/_not-found.html +1 -1
  12. package/.next/server/app/_not-found.rsc +5 -5
  13. package/.next/server/app/api/approvals/[id]/route.js +1 -1
  14. package/.next/server/app/api/approvals/[id]/route.js.nft.json +1 -1
  15. package/.next/server/app/api/approvals/[id]/route_client-reference-manifest.js +1 -1
  16. package/.next/server/app/api/approvals/route.js +2 -2
  17. package/.next/server/app/api/approvals/route.js.nft.json +1 -1
  18. package/.next/server/app/api/approvals/route_client-reference-manifest.js +1 -1
  19. package/.next/server/app/api/backup/route.js +1 -1
  20. package/.next/server/app/api/backup/route.js.nft.json +1 -1
  21. package/.next/server/app/api/backup/route_client-reference-manifest.js +1 -1
  22. package/.next/server/app/api/browse/route_client-reference-manifest.js +1 -1
  23. package/.next/server/app/api/bugs/enhance/route.js +2 -2
  24. package/.next/server/app/api/bugs/enhance/route.js.nft.json +1 -1
  25. package/.next/server/app/api/bugs/enhance/route_client-reference-manifest.js +1 -1
  26. package/.next/server/app/api/cwd/route_client-reference-manifest.js +1 -1
  27. package/.next/server/app/api/encryption/secure/route.js +1 -1
  28. package/.next/server/app/api/encryption/secure/route.js.nft.json +1 -1
  29. package/.next/server/app/api/encryption/secure/route_client-reference-manifest.js +1 -1
  30. package/.next/server/app/api/env/route.js +2 -2
  31. package/.next/server/app/api/env/route_client-reference-manifest.js +1 -1
  32. package/.next/server/app/api/flow/[id]/convert-process-to-subflow/route.js +1 -0
  33. package/.next/server/app/api/flow/[id]/convert-process-to-subflow/route.js.nft.json +1 -0
  34. package/.next/server/app/api/flow/[id]/convert-process-to-subflow/route_client-reference-manifest.js +1 -0
  35. package/.next/server/app/api/flow/[id]/route.js +1 -1
  36. package/.next/server/app/api/flow/[id]/route.js.nft.json +1 -1
  37. package/.next/server/app/api/flow/[id]/route_client-reference-manifest.js +1 -1
  38. package/.next/server/app/api/flow/[id]/versions/[versionId]/route.js +1 -1
  39. package/.next/server/app/api/flow/[id]/versions/[versionId]/route.js.nft.json +1 -1
  40. package/.next/server/app/api/flow/[id]/versions/[versionId]/route_client-reference-manifest.js +1 -1
  41. package/.next/server/app/api/flow/[id]/versions/route.js +1 -1
  42. package/.next/server/app/api/flow/[id]/versions/route.js.nft.json +1 -1
  43. package/.next/server/app/api/flow/[id]/versions/route_client-reference-manifest.js +1 -1
  44. package/.next/server/app/api/flow/assist/route.js +1 -0
  45. package/.next/server/app/api/flow/assist/route.js.nft.json +1 -0
  46. package/.next/server/app/api/flow/assist/route_client-reference-manifest.js +1 -0
  47. package/.next/server/app/api/flow/compile/route.js +1 -1
  48. package/.next/server/app/api/flow/compile/route.js.nft.json +1 -1
  49. package/.next/server/app/api/flow/compile/route_client-reference-manifest.js +1 -1
  50. package/.next/server/app/api/flow/generate/route.js +1 -1
  51. package/.next/server/app/api/flow/generate/route.js.nft.json +1 -1
  52. package/.next/server/app/api/flow/generate/route_client-reference-manifest.js +1 -1
  53. package/.next/server/app/api/flow/generator/route.js +2 -2
  54. package/.next/server/app/api/flow/generator/route.js.nft.json +1 -1
  55. package/.next/server/app/api/flow/generator/route_client-reference-manifest.js +1 -1
  56. package/.next/server/app/api/flow/improve/route.js +1 -1
  57. package/.next/server/app/api/flow/improve/route.js.nft.json +1 -1
  58. package/.next/server/app/api/flow/improve/route_client-reference-manifest.js +1 -1
  59. package/.next/server/app/api/flow/prompt-renderer/route.js +2 -2
  60. package/.next/server/app/api/flow/prompt-renderer/route.js.nft.json +1 -1
  61. package/.next/server/app/api/flow/prompt-renderer/route_client-reference-manifest.js +1 -1
  62. package/.next/server/app/api/flow/quick-chat/route.js +1 -1
  63. package/.next/server/app/api/flow/quick-chat/route.js.nft.json +1 -1
  64. package/.next/server/app/api/flow/quick-chat/route_client-reference-manifest.js +1 -1
  65. package/.next/server/app/api/flow/repair/route.js +1 -1
  66. package/.next/server/app/api/flow/repair/route.js.nft.json +1 -1
  67. package/.next/server/app/api/flow/repair/route_client-reference-manifest.js +1 -1
  68. package/.next/server/app/api/flow/route.js +1 -1
  69. package/.next/server/app/api/flow/route.js.nft.json +1 -1
  70. package/.next/server/app/api/flow/route_client-reference-manifest.js +1 -1
  71. package/.next/server/app/api/git/route.js +6 -6
  72. package/.next/server/app/api/git/route_client-reference-manifest.js +1 -1
  73. package/.next/server/app/api/init/route.js +1 -1
  74. package/.next/server/app/api/init/route.js.nft.json +1 -1
  75. package/.next/server/app/api/init/route_client-reference-manifest.js +1 -1
  76. package/.next/server/app/api/local-models/capability/route.js +1 -1
  77. package/.next/server/app/api/local-models/capability/route_client-reference-manifest.js +1 -1
  78. package/.next/server/app/api/local-models/pull/route.js +1 -1
  79. package/.next/server/app/api/local-models/pull/route_client-reference-manifest.js +1 -1
  80. package/.next/server/app/api/local-models/suggest/route.js +1 -1
  81. package/.next/server/app/api/local-models/suggest/route_client-reference-manifest.js +1 -1
  82. package/.next/server/app/api/mcp/app-sandbox/route_client-reference-manifest.js +1 -1
  83. package/.next/server/app/api/mcp/cancel/route.js +2 -2
  84. package/.next/server/app/api/mcp/cancel/route.js.nft.json +1 -1
  85. package/.next/server/app/api/mcp/cancel/route_client-reference-manifest.js +1 -1
  86. package/.next/server/app/api/mcp/flujo/authoring/route.js +1 -0
  87. package/.next/server/app/api/mcp/flujo/authoring/route.js.nft.json +1 -0
  88. package/.next/server/app/api/mcp/flujo/authoring/route_client-reference-manifest.js +1 -0
  89. package/.next/server/app/api/mcp/flujo/automation/route.js +1 -0
  90. package/.next/server/app/api/mcp/flujo/automation/route.js.nft.json +1 -0
  91. package/.next/server/app/api/mcp/flujo/automation/route_client-reference-manifest.js +1 -0
  92. package/.next/server/app/api/mcp/flujo/flows/route.js +1 -0
  93. package/.next/server/app/api/mcp/flujo/flows/route.js.nft.json +1 -0
  94. package/.next/server/app/api/mcp/flujo/flows/route_client-reference-manifest.js +1 -0
  95. package/.next/server/app/api/mcp/flujo/resources/read/route.js +1 -0
  96. package/.next/server/app/api/mcp/flujo/resources/read/route.js.nft.json +1 -0
  97. package/.next/server/app/api/mcp/flujo/resources/read/route_client-reference-manifest.js +1 -0
  98. package/.next/server/app/api/mcp/flujo/resources/route.js +1 -0
  99. package/.next/server/app/api/mcp/flujo/resources/route.js.nft.json +1 -0
  100. package/.next/server/app/api/mcp/flujo/resources/route_client-reference-manifest.js +1 -0
  101. package/.next/server/app/api/mcp/flujo/servers/route.js +1 -0
  102. package/.next/server/app/api/mcp/flujo/servers/route.js.nft.json +1 -0
  103. package/.next/server/app/api/mcp/flujo/servers/route_client-reference-manifest.js +1 -0
  104. package/.next/server/app/api/mcp/flujo/state/route.js +1 -0
  105. package/.next/server/app/api/mcp/flujo/state/route.js.nft.json +1 -0
  106. package/.next/server/app/api/mcp/flujo/state/route_client-reference-manifest.js +1 -0
  107. package/.next/server/app/api/mcp/flujo/tools/route.js +1 -0
  108. package/.next/server/app/api/mcp/flujo/tools/route.js.nft.json +1 -0
  109. package/.next/server/app/api/mcp/flujo/tools/route_client-reference-manifest.js +1 -0
  110. package/.next/server/app/api/mcp/oauth-capability/route.js +1 -1
  111. package/.next/server/app/api/mcp/oauth-capability/route.js.nft.json +1 -1
  112. package/.next/server/app/api/mcp/oauth-capability/route_client-reference-manifest.js +1 -1
  113. package/.next/server/app/api/mcp/servers/[name]/prompts/get/route.js +1 -1
  114. package/.next/server/app/api/mcp/servers/[name]/prompts/get/route.js.nft.json +1 -1
  115. package/.next/server/app/api/mcp/servers/[name]/prompts/get/route_client-reference-manifest.js +1 -1
  116. package/.next/server/app/api/mcp/servers/[name]/prompts/route.js +1 -1
  117. package/.next/server/app/api/mcp/servers/[name]/prompts/route.js.nft.json +1 -1
  118. package/.next/server/app/api/mcp/servers/[name]/prompts/route_client-reference-manifest.js +1 -1
  119. package/.next/server/app/api/mcp/servers/[name]/resources/read/route.js +1 -1
  120. package/.next/server/app/api/mcp/servers/[name]/resources/read/route.js.nft.json +1 -1
  121. package/.next/server/app/api/mcp/servers/[name]/resources/read/route_client-reference-manifest.js +1 -1
  122. package/.next/server/app/api/mcp/servers/[name]/resources/route.js +1 -1
  123. package/.next/server/app/api/mcp/servers/[name]/resources/route.js.nft.json +1 -1
  124. package/.next/server/app/api/mcp/servers/[name]/resources/route_client-reference-manifest.js +1 -1
  125. package/.next/server/app/api/mcp/servers/[name]/route.js +1 -1
  126. package/.next/server/app/api/mcp/servers/[name]/route.js.nft.json +1 -1
  127. package/.next/server/app/api/mcp/servers/[name]/route_client-reference-manifest.js +1 -1
  128. package/.next/server/app/api/mcp/servers/[name]/status/route.js +1 -1
  129. package/.next/server/app/api/mcp/servers/[name]/status/route.js.nft.json +1 -1
  130. package/.next/server/app/api/mcp/servers/[name]/status/route_client-reference-manifest.js +1 -1
  131. package/.next/server/app/api/mcp/servers/[name]/tools/[toolName]/route.js +1 -1
  132. package/.next/server/app/api/mcp/servers/[name]/tools/[toolName]/route.js.nft.json +1 -1
  133. package/.next/server/app/api/mcp/servers/[name]/tools/[toolName]/route_client-reference-manifest.js +1 -1
  134. package/.next/server/app/api/mcp/servers/[name]/tools/route.js +1 -1
  135. package/.next/server/app/api/mcp/servers/[name]/tools/route.js.nft.json +1 -1
  136. package/.next/server/app/api/mcp/servers/[name]/tools/route_client-reference-manifest.js +1 -1
  137. package/.next/server/app/api/mcp/servers/route.js +1 -1
  138. package/.next/server/app/api/mcp/servers/route.js.nft.json +1 -1
  139. package/.next/server/app/api/mcp/servers/route_client-reference-manifest.js +1 -1
  140. package/.next/server/app/api/mcp/test-connection/route.js +1 -1
  141. package/.next/server/app/api/mcp/test-connection/route.js.nft.json +1 -1
  142. package/.next/server/app/api/mcp/test-connection/route_client-reference-manifest.js +1 -1
  143. package/.next/server/app/api/mcp/test-connection/stream/route.js +1 -1
  144. package/.next/server/app/api/mcp/test-connection/stream/route.js.nft.json +1 -1
  145. package/.next/server/app/api/mcp/test-connection/stream/route_client-reference-manifest.js +1 -1
  146. package/.next/server/app/api/mcp-registry/route.js +2 -2
  147. package/.next/server/app/api/mcp-registry/route.js.nft.json +1 -1
  148. package/.next/server/app/api/mcp-registry/route_client-reference-manifest.js +1 -1
  149. package/.next/server/app/api/mcp-registry/spotlight/route_client-reference-manifest.js +1 -1
  150. package/.next/server/app/api/model/[id]/route.js +1 -1
  151. package/.next/server/app/api/model/[id]/route.js.nft.json +1 -1
  152. package/.next/server/app/api/model/[id]/route_client-reference-manifest.js +1 -1
  153. package/.next/server/app/api/model/provider/route.js +2 -2
  154. package/.next/server/app/api/model/provider/route.js.nft.json +1 -1
  155. package/.next/server/app/api/model/provider/route_client-reference-manifest.js +1 -1
  156. package/.next/server/app/api/model/route.js +1 -1
  157. package/.next/server/app/api/model/route.js.nft.json +1 -1
  158. package/.next/server/app/api/model/route_client-reference-manifest.js +1 -1
  159. package/.next/server/app/api/model/test/route.js +2 -2
  160. package/.next/server/app/api/model/test/route.js.nft.json +1 -1
  161. package/.next/server/app/api/model/test/route_client-reference-manifest.js +1 -1
  162. package/.next/server/app/api/oauth/callback/route.js +1 -1
  163. package/.next/server/app/api/oauth/callback/route_client-reference-manifest.js +1 -1
  164. package/.next/server/app/api/oauth/initiate/route.js +1 -1
  165. package/.next/server/app/api/oauth/initiate/route_client-reference-manifest.js +1 -1
  166. package/.next/server/app/api/oauth/reset/route.js +2 -2
  167. package/.next/server/app/api/oauth/reset/route.js.nft.json +1 -1
  168. package/.next/server/app/api/oauth/reset/route_client-reference-manifest.js +1 -1
  169. package/.next/server/app/api/packages/build/route.js +1 -1
  170. package/.next/server/app/api/packages/build/route.js.nft.json +1 -1
  171. package/.next/server/app/api/packages/build/route_client-reference-manifest.js +1 -1
  172. package/.next/server/app/api/packages/derive-secrets/route.js +1 -1
  173. package/.next/server/app/api/packages/derive-secrets/route.js.nft.json +1 -1
  174. package/.next/server/app/api/packages/derive-secrets/route_client-reference-manifest.js +1 -1
  175. package/.next/server/app/api/packages/install/route.js +1 -1
  176. package/.next/server/app/api/packages/install/route.js.nft.json +1 -1
  177. package/.next/server/app/api/packages/install/route_client-reference-manifest.js +1 -1
  178. package/.next/server/app/api/packages/install/status/route.js +1 -1
  179. package/.next/server/app/api/packages/install/status/route.js.nft.json +1 -1
  180. package/.next/server/app/api/packages/install/status/route_client-reference-manifest.js +1 -1
  181. package/.next/server/app/api/packages/installed/route.js +1 -1
  182. package/.next/server/app/api/packages/installed/route.js.nft.json +1 -1
  183. package/.next/server/app/api/packages/installed/route_client-reference-manifest.js +1 -1
  184. package/.next/server/app/api/packages/resolve/route.js +1 -1
  185. package/.next/server/app/api/packages/resolve/route.js.nft.json +1 -1
  186. package/.next/server/app/api/packages/resolve/route_client-reference-manifest.js +1 -1
  187. package/.next/server/app/api/packages/scan-targets/route.js +1 -1
  188. package/.next/server/app/api/packages/scan-targets/route.js.nft.json +1 -1
  189. package/.next/server/app/api/packages/scan-targets/route_client-reference-manifest.js +1 -1
  190. package/.next/server/app/api/packages/search/route_client-reference-manifest.js +1 -1
  191. package/.next/server/app/api/packages/uninstall/route.js +1 -1
  192. package/.next/server/app/api/packages/uninstall/route.js.nft.json +1 -1
  193. package/.next/server/app/api/packages/uninstall/route_client-reference-manifest.js +1 -1
  194. package/.next/server/app/api/planned-executions/[id]/route.js +2 -2
  195. package/.next/server/app/api/planned-executions/[id]/route.js.nft.json +1 -1
  196. package/.next/server/app/api/planned-executions/[id]/route_client-reference-manifest.js +1 -1
  197. package/.next/server/app/api/planned-executions/[id]/run/route.js +2 -2
  198. package/.next/server/app/api/planned-executions/[id]/run/route.js.nft.json +1 -1
  199. package/.next/server/app/api/planned-executions/[id]/run/route_client-reference-manifest.js +1 -1
  200. package/.next/server/app/api/planned-executions/[id]/runs/route.js +2 -2
  201. package/.next/server/app/api/planned-executions/[id]/runs/route.js.nft.json +1 -1
  202. package/.next/server/app/api/planned-executions/[id]/runs/route_client-reference-manifest.js +1 -1
  203. package/.next/server/app/api/planned-executions/preview-schedule/route_client-reference-manifest.js +1 -1
  204. package/.next/server/app/api/planned-executions/reconcile/route.js +1 -1
  205. package/.next/server/app/api/planned-executions/reconcile/route.js.nft.json +1 -1
  206. package/.next/server/app/api/planned-executions/reconcile/route_client-reference-manifest.js +1 -1
  207. package/.next/server/app/api/planned-executions/route.js +1 -1
  208. package/.next/server/app/api/planned-executions/route.js.nft.json +1 -1
  209. package/.next/server/app/api/planned-executions/route_client-reference-manifest.js +1 -1
  210. package/.next/server/app/api/registry/auth/resend/route.js +1 -1
  211. package/.next/server/app/api/registry/auth/resend/route_client-reference-manifest.js +1 -1
  212. package/.next/server/app/api/registry/auth/reset/route.js +1 -1
  213. package/.next/server/app/api/registry/auth/reset/route_client-reference-manifest.js +1 -1
  214. package/.next/server/app/api/registry/auth/route.js +1 -1
  215. package/.next/server/app/api/registry/auth/route_client-reference-manifest.js +1 -1
  216. package/.next/server/app/api/registry/feedback/route_client-reference-manifest.js +1 -1
  217. package/.next/server/app/api/registry/oauth/callback/route.js +1 -1
  218. package/.next/server/app/api/registry/oauth/callback/route_client-reference-manifest.js +1 -1
  219. package/.next/server/app/api/registry/oauth/initiate/route.js +1 -1
  220. package/.next/server/app/api/registry/oauth/initiate/route_client-reference-manifest.js +1 -1
  221. package/.next/server/app/api/registry/packages/route.js +1 -1
  222. package/.next/server/app/api/registry/packages/route_client-reference-manifest.js +1 -1
  223. package/.next/server/app/api/registry/publish/route.js +1 -1
  224. package/.next/server/app/api/registry/publish/route_client-reference-manifest.js +1 -1
  225. package/.next/server/app/api/registry/settings/route.js +1 -1
  226. package/.next/server/app/api/registry/settings/route_client-reference-manifest.js +1 -1
  227. package/.next/server/app/api/restore/route.js +1 -1
  228. package/.next/server/app/api/restore/route.js.nft.json +1 -1
  229. package/.next/server/app/api/restore/route_client-reference-manifest.js +1 -1
  230. package/.next/server/app/api/runs/active/route.js +2 -2
  231. package/.next/server/app/api/runs/active/route.js.nft.json +1 -1
  232. package/.next/server/app/api/runs/active/route_client-reference-manifest.js +1 -1
  233. package/.next/server/app/api/setup/ai-cli/route.js +3 -0
  234. package/.next/server/app/api/setup/ai-cli/route.js.nft.json +1 -0
  235. package/.next/server/app/api/setup/ai-cli/route_client-reference-manifest.js +1 -0
  236. package/.next/server/app/api/statistics/route.js +2 -0
  237. package/.next/server/app/api/statistics/route.js.nft.json +1 -0
  238. package/.next/server/app/api/statistics/route_client-reference-manifest.js +1 -0
  239. package/.next/server/app/api/storage/route_client-reference-manifest.js +1 -1
  240. package/.next/server/app/api/telemetry/daily-active/route.js +1 -1
  241. package/.next/server/app/api/telemetry/daily-active/route_client-reference-manifest.js +1 -1
  242. package/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
  243. package/.next/server/app/api/waves/route.js +1 -1
  244. package/.next/server/app/api/waves/route.js.nft.json +1 -1
  245. package/.next/server/app/api/waves/route_client-reference-manifest.js +1 -1
  246. package/.next/server/app/api/webhooks/[id]/route.js +1 -1
  247. package/.next/server/app/api/webhooks/[id]/route.js.nft.json +1 -1
  248. package/.next/server/app/api/webhooks/[id]/route_client-reference-manifest.js +1 -1
  249. package/.next/server/app/automation/triggers/page.js +2 -0
  250. package/.next/server/app/automation/triggers/page.js.nft.json +1 -0
  251. package/.next/server/app/automation/triggers/page_client-reference-manifest.js +1 -0
  252. package/.next/server/app/automation/triggers.html +1 -0
  253. package/.next/server/app/automation/triggers.meta +7 -0
  254. package/.next/server/app/automation/triggers.rsc +23 -0
  255. package/.next/server/app/automation/waves/page.js +2 -0
  256. package/.next/server/app/automation/waves/page.js.nft.json +1 -0
  257. package/.next/server/app/automation/waves/page_client-reference-manifest.js +1 -0
  258. package/.next/server/app/automation/waves.html +1 -0
  259. package/.next/server/app/automation/waves.meta +7 -0
  260. package/.next/server/app/automation/waves.rsc +22 -0
  261. package/.next/server/app/chat/page.js +6 -58
  262. package/.next/server/app/chat/page.js.nft.json +1 -1
  263. package/.next/server/app/chat/page_client-reference-manifest.js +1 -1
  264. package/.next/server/app/chat.html +1 -1
  265. package/.next/server/app/chat.rsc +7 -6
  266. package/.next/server/app/docs/page.js +3 -4
  267. package/.next/server/app/docs/page.js.nft.json +1 -1
  268. package/.next/server/app/docs/page_client-reference-manifest.js +1 -1
  269. package/.next/server/app/docs.html +1 -1
  270. package/.next/server/app/docs.rsc +6 -6
  271. package/.next/server/app/executions/page.js +2 -3
  272. package/.next/server/app/executions/page.js.nft.json +1 -1
  273. package/.next/server/app/executions/page_client-reference-manifest.js +1 -1
  274. package/.next/server/app/executions.html +1 -1
  275. package/.next/server/app/executions.rsc +7 -6
  276. package/.next/server/app/flows/page.js +3 -3
  277. package/.next/server/app/flows/page.js.nft.json +1 -1
  278. package/.next/server/app/flows/page_client-reference-manifest.js +1 -1
  279. package/.next/server/app/flows.html +1 -1
  280. package/.next/server/app/flows.rsc +7 -7
  281. package/.next/server/app/index.html +1 -1
  282. package/.next/server/app/index.rsc +6 -6
  283. package/.next/server/app/mcp/page.js +6 -57
  284. package/.next/server/app/mcp/page.js.nft.json +1 -1
  285. package/.next/server/app/mcp/page_client-reference-manifest.js +1 -1
  286. package/.next/server/app/mcp-flows/route.js +2 -1
  287. package/.next/server/app/mcp-flows/route.js.nft.json +1 -1
  288. package/.next/server/app/mcp-flows/route_client-reference-manifest.js +1 -1
  289. package/.next/server/app/mcp-proxy/[server]/route.js +2 -1
  290. package/.next/server/app/mcp-proxy/[server]/route.js.nft.json +1 -1
  291. package/.next/server/app/mcp-proxy/[server]/route_client-reference-manifest.js +1 -1
  292. package/.next/server/app/mcp.html +1 -1
  293. package/.next/server/app/mcp.rsc +7 -6
  294. package/.next/server/app/models/page.js +64 -2
  295. package/.next/server/app/models/page.js.nft.json +1 -1
  296. package/.next/server/app/models/page_client-reference-manifest.js +1 -1
  297. package/.next/server/app/packages/page.js +2 -2
  298. package/.next/server/app/packages/page.js.nft.json +1 -1
  299. package/.next/server/app/packages/page_client-reference-manifest.js +1 -1
  300. package/.next/server/app/packages.html +1 -1
  301. package/.next/server/app/packages.rsc +6 -6
  302. package/.next/server/app/page.js +3 -4
  303. package/.next/server/app/page.js.nft.json +1 -1
  304. package/.next/server/app/page_client-reference-manifest.js +1 -1
  305. package/.next/server/app/settings/page.js +2 -2
  306. package/.next/server/app/settings/page.js.nft.json +1 -1
  307. package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  308. package/.next/server/app/settings.html +1 -1
  309. package/.next/server/app/settings.rsc +6 -6
  310. package/.next/server/app/statistics/page.js +54 -0
  311. package/.next/server/app/statistics/page.js.nft.json +1 -0
  312. package/.next/server/app/statistics/page_client-reference-manifest.js +1 -0
  313. package/.next/server/app/statistics.html +1 -0
  314. package/.next/server/app/statistics.meta +7 -0
  315. package/.next/server/app/statistics.rsc +22 -0
  316. package/.next/server/app/v1/chat/completions/route.js +1 -1
  317. package/.next/server/app/v1/chat/completions/route.js.nft.json +1 -1
  318. package/.next/server/app/v1/chat/completions/route_client-reference-manifest.js +1 -1
  319. package/.next/server/app/v1/chat/conversations/[conversationId]/breakpoints/route.js +2 -2
  320. package/.next/server/app/v1/chat/conversations/[conversationId]/breakpoints/route.js.nft.json +1 -1
  321. package/.next/server/app/v1/chat/conversations/[conversationId]/breakpoints/route_client-reference-manifest.js +1 -1
  322. package/.next/server/app/v1/chat/conversations/[conversationId]/cancel/route.js +2 -2
  323. package/.next/server/app/v1/chat/conversations/[conversationId]/cancel/route.js.nft.json +1 -1
  324. package/.next/server/app/v1/chat/conversations/[conversationId]/cancel/route_client-reference-manifest.js +1 -1
  325. package/.next/server/app/v1/chat/conversations/[conversationId]/debug/continue/route.js +1 -1
  326. package/.next/server/app/v1/chat/conversations/[conversationId]/debug/continue/route.js.nft.json +1 -1
  327. package/.next/server/app/v1/chat/conversations/[conversationId]/debug/continue/route_client-reference-manifest.js +1 -1
  328. package/.next/server/app/v1/chat/conversations/[conversationId]/debug/step/route.js +1 -1
  329. package/.next/server/app/v1/chat/conversations/[conversationId]/debug/step/route.js.nft.json +1 -1
  330. package/.next/server/app/v1/chat/conversations/[conversationId]/debug/step/route_client-reference-manifest.js +1 -1
  331. package/.next/server/app/v1/chat/conversations/[conversationId]/edit-state/route.js +2 -2
  332. package/.next/server/app/v1/chat/conversations/[conversationId]/edit-state/route.js.nft.json +1 -1
  333. package/.next/server/app/v1/chat/conversations/[conversationId]/edit-state/route_client-reference-manifest.js +1 -1
  334. package/.next/server/app/v1/chat/conversations/[conversationId]/events/route.js +3 -3
  335. package/.next/server/app/v1/chat/conversations/[conversationId]/events/route.js.nft.json +1 -1
  336. package/.next/server/app/v1/chat/conversations/[conversationId]/events/route_client-reference-manifest.js +1 -1
  337. package/.next/server/app/v1/chat/conversations/[conversationId]/inject/route.js +2 -2
  338. package/.next/server/app/v1/chat/conversations/[conversationId]/inject/route.js.nft.json +1 -1
  339. package/.next/server/app/v1/chat/conversations/[conversationId]/inject/route_client-reference-manifest.js +1 -1
  340. package/.next/server/app/v1/chat/conversations/[conversationId]/resources/[resourceId]/content/route.js +1 -1
  341. package/.next/server/app/v1/chat/conversations/[conversationId]/resources/[resourceId]/content/route.js.nft.json +1 -1
  342. package/.next/server/app/v1/chat/conversations/[conversationId]/resources/[resourceId]/content/route_client-reference-manifest.js +1 -1
  343. package/.next/server/app/v1/chat/conversations/[conversationId]/resources/route.js +1 -1
  344. package/.next/server/app/v1/chat/conversations/[conversationId]/resources/route.js.nft.json +1 -1
  345. package/.next/server/app/v1/chat/conversations/[conversationId]/resources/route_client-reference-manifest.js +1 -1
  346. package/.next/server/app/v1/chat/conversations/[conversationId]/respond/route.js +1 -1
  347. package/.next/server/app/v1/chat/conversations/[conversationId]/respond/route.js.nft.json +1 -1
  348. package/.next/server/app/v1/chat/conversations/[conversationId]/respond/route_client-reference-manifest.js +1 -1
  349. package/.next/server/app/v1/chat/conversations/[conversationId]/revert/route.js +2 -0
  350. package/.next/server/app/v1/chat/conversations/[conversationId]/revert/route.js.nft.json +1 -0
  351. package/.next/server/app/v1/chat/conversations/[conversationId]/revert/route_client-reference-manifest.js +1 -0
  352. package/.next/server/app/v1/chat/conversations/[conversationId]/route.js +2 -2
  353. package/.next/server/app/v1/chat/conversations/[conversationId]/route.js.nft.json +1 -1
  354. package/.next/server/app/v1/chat/conversations/[conversationId]/route_client-reference-manifest.js +1 -1
  355. package/.next/server/app/v1/chat/conversations/route.js +2 -2
  356. package/.next/server/app/v1/chat/conversations/route.js.nft.json +1 -1
  357. package/.next/server/app/v1/chat/conversations/route_client-reference-manifest.js +1 -1
  358. package/.next/server/app/v1/chat/events/route.js +6 -6
  359. package/.next/server/app/v1/chat/events/route.js.nft.json +1 -1
  360. package/.next/server/app/v1/chat/events/route_client-reference-manifest.js +1 -1
  361. package/.next/server/app/v1/models/route.js +2 -2
  362. package/.next/server/app/v1/models/route.js.nft.json +1 -1
  363. package/.next/server/app/v1/models/route_client-reference-manifest.js +1 -1
  364. package/.next/server/app/waves/page.js +2 -4
  365. package/.next/server/app/waves/page.js.nft.json +1 -1
  366. package/.next/server/app/waves/page_client-reference-manifest.js +1 -1
  367. package/.next/server/app/waves.html +1 -1
  368. package/.next/server/app/waves.rsc +6 -6
  369. package/.next/server/app-paths-manifest.json +42 -26
  370. package/.next/server/chunks/1227.js +1 -1
  371. package/.next/server/chunks/1314.js +1 -1
  372. package/.next/server/chunks/1403.js +3 -0
  373. package/.next/server/chunks/{180.js → 1532.js} +1 -1
  374. package/.next/server/chunks/1539.js +1 -0
  375. package/.next/server/chunks/1662.js +2 -0
  376. package/.next/server/chunks/1805.js +1 -1
  377. package/.next/server/chunks/1925.js +1 -1
  378. package/.next/server/chunks/2069.js +1 -0
  379. package/.next/server/chunks/227.js +1 -1
  380. package/.next/server/chunks/2372.js +2 -2
  381. package/.next/server/chunks/2446.js +1 -0
  382. package/.next/server/chunks/2828.js +2 -0
  383. package/.next/server/chunks/2949.js +1 -0
  384. package/.next/server/chunks/{6034.js → 300.js} +15 -15
  385. package/.next/server/chunks/3032.js +29 -0
  386. package/.next/server/chunks/3206.js +2 -0
  387. package/.next/server/chunks/3262.js +90 -0
  388. package/.next/server/chunks/3418.js +1 -0
  389. package/.next/server/chunks/3945.js +10 -0
  390. package/.next/server/chunks/{6967.js → 3954.js} +3 -3
  391. package/.next/server/chunks/3963.js +6 -0
  392. package/.next/server/chunks/3991.js +2 -0
  393. package/.next/server/chunks/4265.js +1 -1
  394. package/.next/server/chunks/4306.js +1 -1
  395. package/.next/server/chunks/4671.js +1 -1
  396. package/.next/server/chunks/4681.js +1 -1
  397. package/.next/server/chunks/4771.js +2 -2
  398. package/.next/server/chunks/5096.js +1 -1
  399. package/.next/server/chunks/5141.js +2 -0
  400. package/.next/server/chunks/519.js +2 -2
  401. package/.next/server/chunks/5444.js +2 -0
  402. package/.next/server/chunks/5446.js +1 -0
  403. package/.next/server/chunks/{7058.js → 5494.js} +2 -2
  404. package/.next/server/chunks/558.js +1 -1
  405. package/.next/server/chunks/5591.js +1 -0
  406. package/.next/server/chunks/{3312.js → 5642.js} +1 -1
  407. package/.next/server/chunks/566.js +2 -0
  408. package/.next/server/chunks/5750.js +1 -0
  409. package/.next/server/chunks/{7519.js → 5807.js} +1 -1
  410. package/.next/server/chunks/5858.js +1 -0
  411. package/.next/server/chunks/5918.js +436 -0
  412. package/.next/server/chunks/5936.js +1 -0
  413. package/.next/server/chunks/6033.js +1 -0
  414. package/.next/server/chunks/6226.js +4 -4
  415. package/.next/server/chunks/6607.js +1 -0
  416. package/.next/server/chunks/6687.js +1 -0
  417. package/.next/server/chunks/701.js +2 -2
  418. package/.next/server/chunks/7031.js +1 -0
  419. package/.next/server/chunks/7147.js +1 -0
  420. package/.next/server/chunks/7480.js +2 -0
  421. package/.next/server/chunks/{8284.js → 7498.js} +2 -2
  422. package/.next/server/chunks/7506.js +2 -2
  423. package/.next/server/chunks/7508.js +5 -0
  424. package/.next/server/chunks/7628.js +1 -1
  425. package/.next/server/chunks/7630.js +1 -1
  426. package/.next/server/chunks/773.js +9 -0
  427. package/.next/server/chunks/7821.js +1 -1
  428. package/.next/server/chunks/7883.js +1 -0
  429. package/.next/server/chunks/7969.js +1 -1
  430. package/.next/server/chunks/8001.js +1 -1
  431. package/.next/server/chunks/8092.js +1 -1
  432. package/.next/server/chunks/8291.js +1 -0
  433. package/.next/server/chunks/8598.js +1 -0
  434. package/.next/server/chunks/8645.js +1 -1
  435. package/.next/server/chunks/{3489.js → 8730.js} +1 -1
  436. package/.next/server/chunks/8897.js +1 -0
  437. package/.next/server/chunks/8903.js +4 -0
  438. package/.next/server/chunks/8940.js +1 -0
  439. package/.next/server/chunks/9088.js +6 -0
  440. package/.next/server/chunks/9543.js +8 -0
  441. package/.next/server/chunks/9624.js +136 -0
  442. package/.next/server/functions-config-manifest.json +4 -3
  443. package/.next/server/instrumentation.js +1 -1
  444. package/.next/server/instrumentation.js.nft.json +1 -1
  445. package/.next/server/middleware-build-manifest.js +1 -1
  446. package/.next/server/middleware-manifest.json +1 -1
  447. package/.next/server/middleware-react-loadable-manifest.js +1 -1
  448. package/.next/server/pages/404.html +1 -1
  449. package/.next/server/pages/500.html +1 -1
  450. package/.next/server/server-reference-manifest.js +1 -1
  451. package/.next/server/server-reference-manifest.json +1 -1
  452. package/.next/static/b1aMk0634gkkiunttd1SQ/_buildManifest.js +1 -0
  453. package/.next/static/chunks/1161-19176c3e7c655121.js +1 -0
  454. package/.next/static/chunks/1521-1c98c9a56726e053.js +1 -0
  455. package/.next/static/chunks/155-12f2a537db5dacec.js +1 -0
  456. package/.next/static/chunks/1576.bc6ae6c9e6d939d8.js +1 -0
  457. package/.next/static/chunks/1871-dd8c10ed9d37100b.js +1 -0
  458. package/.next/static/chunks/1983-242862b3dc022a26.js +1 -0
  459. package/.next/static/chunks/2005.300528b5119c2d38.js +1 -0
  460. package/.next/static/chunks/2141-dba0d13715fe1a28.js +1 -0
  461. package/.next/static/chunks/2498-4f7f5de1cac6feba.js +1 -0
  462. package/.next/static/chunks/2499-92cd97ce4993999f.js +1 -0
  463. package/.next/static/chunks/3272-42d1acae08d1ef0a.js +1 -0
  464. package/.next/static/chunks/3303-febfba58226aebed.js +1 -0
  465. package/.next/static/chunks/{361.bb75b03b740930cd.js → 361.51d642c530c84295.js} +1 -1
  466. package/.next/static/chunks/3731-64070760ae44448f.js +1 -0
  467. package/.next/static/chunks/3776.72638b35ce9bb874.js +1 -0
  468. package/.next/static/chunks/3816-807978463638bb71.js +1 -0
  469. package/.next/static/chunks/4122-d82fad8d1fca26d6.js +1 -0
  470. package/.next/static/chunks/4123-906362aeb986d6db.js +1 -0
  471. package/.next/static/chunks/4156-3823d1c89c4a7e3d.js +1 -0
  472. package/.next/static/chunks/{4555-c9070f8c79bccfad.js → 4483-00dc5c1b601ec898.js} +3 -3
  473. package/.next/static/chunks/4755-83df83d0dbd97483.js +1 -0
  474. package/.next/static/chunks/4814-31eb5f3b10c651c1.js +1 -0
  475. package/.next/static/chunks/4965.39e24b54c3c6ca58.js +1 -0
  476. package/.next/static/chunks/57-64bab7d5db89c9cc.js +1 -0
  477. package/.next/static/chunks/5954-dd2b25224f389fc0.js +1 -0
  478. package/.next/static/chunks/5962-8c59d06b3ee1c42a.js +1 -0
  479. package/.next/static/chunks/5967-59fde8c214c9ca9f.js +1 -0
  480. package/.next/static/chunks/6417.70056fe81ca21682.js +1 -0
  481. package/.next/static/chunks/6420-25dd04f98f3b34b8.js +1 -0
  482. package/.next/static/chunks/6547-2adc20e1ace927fc.js +1 -0
  483. package/.next/static/chunks/684-289a73150568def2.js +1 -0
  484. package/.next/static/chunks/7203-2704865539fa551d.js +1 -0
  485. package/.next/static/chunks/760-2ad13a61701630da.js +1 -0
  486. package/.next/static/chunks/7711-4b017720ec49c96d.js +1 -0
  487. package/.next/static/chunks/7758-42ab0b9cce1dc0e3.js +1 -0
  488. package/.next/static/chunks/8124-94140ee1dd8ed87c.js +1 -0
  489. package/.next/static/chunks/8135-5b975b9014f8920b.js +1 -0
  490. package/.next/static/chunks/{8198.cd0d3f8429c02862.js → 8198.a9cc35771b354b03.js} +1 -1
  491. package/.next/static/chunks/8326-4915403bc93459d2.js +1 -0
  492. package/.next/static/chunks/8529.b5a43e728bb5bb8a.js +1 -0
  493. package/.next/static/chunks/{6428-951188daa6f74b86.js → 8620-c9fa9d75cdc18a5e.js} +3 -3
  494. package/.next/static/chunks/8853-b80e50cbec6fd13c.js +1 -0
  495. package/.next/static/chunks/8862-0e37dd5488b21c77.js +1 -0
  496. package/.next/static/chunks/889-e64385ddb2259b1b.js +1 -0
  497. package/.next/static/chunks/9001-4c27a608feddb878.js +1 -0
  498. package/.next/static/chunks/9050-fcb7a0c89314acb4.js +1 -0
  499. package/.next/static/chunks/9053-283dd8d615f904a5.js +8 -0
  500. package/.next/static/chunks/9136-9c415453ec02519c.js +1 -0
  501. package/.next/static/chunks/9140.6502327a2c098d33.js +1 -0
  502. package/.next/static/chunks/9195-3c9c4300e7505d9e.js +1 -0
  503. package/.next/static/chunks/9524-b9d2c7e4426edd07.js +1 -0
  504. package/.next/static/chunks/9562-5494feecd8c6f7a3.js +1 -0
  505. package/.next/static/chunks/9611-190b55ade8b3af3c.js +1 -0
  506. package/.next/static/chunks/app/api/approvals/[id]/route-e70b5e2b4e09002b.js +1 -0
  507. package/.next/static/chunks/app/api/approvals/route-e70b5e2b4e09002b.js +1 -0
  508. package/.next/static/chunks/app/api/backup/route-e70b5e2b4e09002b.js +1 -0
  509. package/.next/static/chunks/app/api/browse/route-e70b5e2b4e09002b.js +1 -0
  510. package/.next/static/chunks/app/api/bugs/enhance/route-e70b5e2b4e09002b.js +1 -0
  511. package/.next/static/chunks/app/api/cwd/route-e70b5e2b4e09002b.js +1 -0
  512. package/.next/static/chunks/app/api/encryption/secure/route-e70b5e2b4e09002b.js +1 -0
  513. package/.next/static/chunks/app/api/env/route-e70b5e2b4e09002b.js +1 -0
  514. package/.next/static/chunks/app/api/flow/[id]/convert-process-to-subflow/route-e70b5e2b4e09002b.js +1 -0
  515. package/.next/static/chunks/app/api/flow/[id]/route-e70b5e2b4e09002b.js +1 -0
  516. package/.next/static/chunks/app/api/flow/[id]/versions/[versionId]/route-e70b5e2b4e09002b.js +1 -0
  517. package/.next/static/chunks/app/api/flow/[id]/versions/route-e70b5e2b4e09002b.js +1 -0
  518. package/.next/static/chunks/app/api/flow/assist/route-e70b5e2b4e09002b.js +1 -0
  519. package/.next/static/chunks/app/api/flow/compile/route-e70b5e2b4e09002b.js +1 -0
  520. package/.next/static/chunks/app/api/flow/generate/route-e70b5e2b4e09002b.js +1 -0
  521. package/.next/static/chunks/app/api/flow/generator/route-e70b5e2b4e09002b.js +1 -0
  522. package/.next/static/chunks/app/api/flow/improve/route-e70b5e2b4e09002b.js +1 -0
  523. package/.next/static/chunks/app/api/flow/prompt-renderer/route-e70b5e2b4e09002b.js +1 -0
  524. package/.next/static/chunks/app/api/flow/quick-chat/route-e70b5e2b4e09002b.js +1 -0
  525. package/.next/static/chunks/app/api/flow/repair/route-e70b5e2b4e09002b.js +1 -0
  526. package/.next/static/chunks/app/api/flow/route-e70b5e2b4e09002b.js +1 -0
  527. package/.next/static/chunks/app/api/git/route-e70b5e2b4e09002b.js +1 -0
  528. package/.next/static/chunks/app/api/init/route-e70b5e2b4e09002b.js +1 -0
  529. package/.next/static/chunks/app/api/local-models/capability/route-e70b5e2b4e09002b.js +1 -0
  530. package/.next/static/chunks/app/api/local-models/pull/route-e70b5e2b4e09002b.js +1 -0
  531. package/.next/static/chunks/app/api/local-models/suggest/route-e70b5e2b4e09002b.js +1 -0
  532. package/.next/static/chunks/app/api/mcp/app-sandbox/route-e70b5e2b4e09002b.js +1 -0
  533. package/.next/static/chunks/app/api/mcp/cancel/route-e70b5e2b4e09002b.js +1 -0
  534. package/.next/static/chunks/app/api/mcp/flujo/authoring/route-e70b5e2b4e09002b.js +1 -0
  535. package/.next/static/chunks/app/api/mcp/flujo/automation/route-e70b5e2b4e09002b.js +1 -0
  536. package/.next/static/chunks/app/api/mcp/flujo/flows/route-e70b5e2b4e09002b.js +1 -0
  537. package/.next/static/chunks/app/api/mcp/flujo/resources/read/route-e70b5e2b4e09002b.js +1 -0
  538. package/.next/static/chunks/app/api/mcp/flujo/resources/route-e70b5e2b4e09002b.js +1 -0
  539. package/.next/static/chunks/app/api/mcp/flujo/servers/route-e70b5e2b4e09002b.js +1 -0
  540. package/.next/static/chunks/app/api/mcp/flujo/state/route-e70b5e2b4e09002b.js +1 -0
  541. package/.next/static/chunks/app/api/mcp/flujo/tools/route-e70b5e2b4e09002b.js +1 -0
  542. package/.next/static/chunks/app/api/mcp/oauth-capability/route-e70b5e2b4e09002b.js +1 -0
  543. package/.next/static/chunks/app/api/mcp/servers/[name]/prompts/get/route-e70b5e2b4e09002b.js +1 -0
  544. package/.next/static/chunks/app/api/mcp/servers/[name]/prompts/route-e70b5e2b4e09002b.js +1 -0
  545. package/.next/static/chunks/app/api/mcp/servers/[name]/resources/read/route-e70b5e2b4e09002b.js +1 -0
  546. package/.next/static/chunks/app/api/mcp/servers/[name]/resources/route-e70b5e2b4e09002b.js +1 -0
  547. package/.next/static/chunks/app/api/mcp/servers/[name]/route-e70b5e2b4e09002b.js +1 -0
  548. package/.next/static/chunks/app/api/mcp/servers/[name]/status/route-e70b5e2b4e09002b.js +1 -0
  549. package/.next/static/chunks/app/api/mcp/servers/[name]/tools/[toolName]/route-e70b5e2b4e09002b.js +1 -0
  550. package/.next/static/chunks/app/api/mcp/servers/[name]/tools/route-e70b5e2b4e09002b.js +1 -0
  551. package/.next/static/chunks/app/api/mcp/servers/route-e70b5e2b4e09002b.js +1 -0
  552. package/.next/static/chunks/app/api/mcp/test-connection/route-e70b5e2b4e09002b.js +1 -0
  553. package/.next/static/chunks/app/api/mcp/test-connection/stream/route-e70b5e2b4e09002b.js +1 -0
  554. package/.next/static/chunks/app/api/mcp-registry/route-e70b5e2b4e09002b.js +1 -0
  555. package/.next/static/chunks/app/api/mcp-registry/spotlight/route-e70b5e2b4e09002b.js +1 -0
  556. package/.next/static/chunks/app/api/model/[id]/route-e70b5e2b4e09002b.js +1 -0
  557. package/.next/static/chunks/app/api/model/provider/route-e70b5e2b4e09002b.js +1 -0
  558. package/.next/static/chunks/app/api/model/route-e70b5e2b4e09002b.js +1 -0
  559. package/.next/static/chunks/app/api/model/test/route-e70b5e2b4e09002b.js +1 -0
  560. package/.next/static/chunks/app/api/oauth/callback/route-e70b5e2b4e09002b.js +1 -0
  561. package/.next/static/chunks/app/api/oauth/initiate/route-e70b5e2b4e09002b.js +1 -0
  562. package/.next/static/chunks/app/api/oauth/reset/route-e70b5e2b4e09002b.js +1 -0
  563. package/.next/static/chunks/app/api/packages/build/route-e70b5e2b4e09002b.js +1 -0
  564. package/.next/static/chunks/app/api/packages/derive-secrets/route-e70b5e2b4e09002b.js +1 -0
  565. package/.next/static/chunks/app/api/packages/install/route-e70b5e2b4e09002b.js +1 -0
  566. package/.next/static/chunks/app/api/packages/install/status/route-e70b5e2b4e09002b.js +1 -0
  567. package/.next/static/chunks/app/api/packages/installed/route-e70b5e2b4e09002b.js +1 -0
  568. package/.next/static/chunks/app/api/packages/resolve/route-e70b5e2b4e09002b.js +1 -0
  569. package/.next/static/chunks/app/api/packages/scan-targets/route-e70b5e2b4e09002b.js +1 -0
  570. package/.next/static/chunks/app/api/packages/search/route-e70b5e2b4e09002b.js +1 -0
  571. package/.next/static/chunks/app/api/packages/uninstall/route-e70b5e2b4e09002b.js +1 -0
  572. package/.next/static/chunks/app/api/planned-executions/[id]/route-e70b5e2b4e09002b.js +1 -0
  573. package/.next/static/chunks/app/api/planned-executions/[id]/run/route-e70b5e2b4e09002b.js +1 -0
  574. package/.next/static/chunks/app/api/planned-executions/[id]/runs/route-e70b5e2b4e09002b.js +1 -0
  575. package/.next/static/chunks/app/api/planned-executions/preview-schedule/route-e70b5e2b4e09002b.js +1 -0
  576. package/.next/static/chunks/app/api/planned-executions/reconcile/route-e70b5e2b4e09002b.js +1 -0
  577. package/.next/static/chunks/app/api/planned-executions/route-e70b5e2b4e09002b.js +1 -0
  578. package/.next/static/chunks/app/api/registry/auth/resend/route-e70b5e2b4e09002b.js +1 -0
  579. package/.next/static/chunks/app/api/registry/auth/reset/route-e70b5e2b4e09002b.js +1 -0
  580. package/.next/static/chunks/app/api/registry/auth/route-e70b5e2b4e09002b.js +1 -0
  581. package/.next/static/chunks/app/api/registry/feedback/route-e70b5e2b4e09002b.js +1 -0
  582. package/.next/static/chunks/app/api/registry/oauth/callback/route-e70b5e2b4e09002b.js +1 -0
  583. package/.next/static/chunks/app/api/registry/oauth/initiate/route-e70b5e2b4e09002b.js +1 -0
  584. package/.next/static/chunks/app/api/registry/packages/route-e70b5e2b4e09002b.js +1 -0
  585. package/.next/static/chunks/app/api/registry/publish/route-e70b5e2b4e09002b.js +1 -0
  586. package/.next/static/chunks/app/api/registry/settings/route-e70b5e2b4e09002b.js +1 -0
  587. package/.next/static/chunks/app/api/restore/route-e70b5e2b4e09002b.js +1 -0
  588. package/.next/static/chunks/app/api/runs/active/route-e70b5e2b4e09002b.js +1 -0
  589. package/.next/static/chunks/app/api/setup/ai-cli/route-e70b5e2b4e09002b.js +1 -0
  590. package/.next/static/chunks/app/api/statistics/route-e70b5e2b4e09002b.js +1 -0
  591. package/.next/static/chunks/app/api/storage/route-e70b5e2b4e09002b.js +1 -0
  592. package/.next/static/chunks/app/api/telemetry/daily-active/route-e70b5e2b4e09002b.js +1 -0
  593. package/.next/static/chunks/app/api/update/route-e70b5e2b4e09002b.js +1 -0
  594. package/.next/static/chunks/app/api/waves/route-e70b5e2b4e09002b.js +1 -0
  595. package/.next/static/chunks/app/api/webhooks/[id]/route-e70b5e2b4e09002b.js +1 -0
  596. package/.next/static/chunks/app/automation/triggers/page-594a6294c58344bf.js +1 -0
  597. package/.next/static/chunks/app/automation/waves/page-ce2fef4996cad8e6.js +1 -0
  598. package/.next/static/chunks/app/chat/page-203cb7bf21638ada.js +1 -0
  599. package/.next/static/chunks/app/docs/page-c466a58caf5e3336.js +1 -0
  600. package/.next/static/chunks/app/executions/page-fcc848de86714386.js +1 -0
  601. package/.next/static/chunks/app/flows/page-172c759ca81ba02f.js +1 -0
  602. package/.next/static/chunks/app/layout-a6ca531683a518a7.js +1 -0
  603. package/.next/static/chunks/app/mcp/page-0a96e6b30e45b1e6.js +1 -0
  604. package/.next/static/chunks/app/mcp-flows/route-e70b5e2b4e09002b.js +1 -0
  605. package/.next/static/chunks/app/mcp-proxy/[server]/route-e70b5e2b4e09002b.js +1 -0
  606. package/.next/static/chunks/app/models/error-1964203c5c6e7d0e.js +1 -0
  607. package/.next/static/chunks/app/models/{loading-1687ae86584f5b1b.js → loading-0cdcf9bae7d3b8f3.js} +1 -1
  608. package/.next/static/chunks/app/models/page-ad1cbea6d3324966.js +1 -0
  609. package/.next/static/chunks/app/packages/page-dda48425be9fc137.js +1 -0
  610. package/.next/static/chunks/app/page-04189aa1b1318c2d.js +1 -0
  611. package/.next/static/chunks/app/settings/page-906c229c87011ead.js +1 -0
  612. package/.next/static/chunks/app/statistics/page-9b13a95549f438c0.js +1 -0
  613. package/.next/static/chunks/app/v1/chat/completions/route-e70b5e2b4e09002b.js +1 -0
  614. package/.next/static/chunks/app/v1/chat/conversations/[conversationId]/breakpoints/route-e70b5e2b4e09002b.js +1 -0
  615. package/.next/static/chunks/app/v1/chat/conversations/[conversationId]/cancel/route-e70b5e2b4e09002b.js +1 -0
  616. package/.next/static/chunks/app/v1/chat/conversations/[conversationId]/debug/continue/route-e70b5e2b4e09002b.js +1 -0
  617. package/.next/static/chunks/app/v1/chat/conversations/[conversationId]/debug/step/route-e70b5e2b4e09002b.js +1 -0
  618. package/.next/static/chunks/app/v1/chat/conversations/[conversationId]/edit-state/route-e70b5e2b4e09002b.js +1 -0
  619. package/.next/static/chunks/app/v1/chat/conversations/[conversationId]/events/route-e70b5e2b4e09002b.js +1 -0
  620. package/.next/static/chunks/app/v1/chat/conversations/[conversationId]/inject/route-e70b5e2b4e09002b.js +1 -0
  621. package/.next/static/chunks/app/v1/chat/conversations/[conversationId]/resources/[resourceId]/content/route-e70b5e2b4e09002b.js +1 -0
  622. package/.next/static/chunks/app/v1/chat/conversations/[conversationId]/resources/route-e70b5e2b4e09002b.js +1 -0
  623. package/.next/static/chunks/app/v1/chat/conversations/[conversationId]/respond/route-e70b5e2b4e09002b.js +1 -0
  624. package/.next/static/chunks/app/v1/chat/conversations/[conversationId]/revert/route-e70b5e2b4e09002b.js +1 -0
  625. package/.next/static/chunks/app/v1/chat/conversations/[conversationId]/route-e70b5e2b4e09002b.js +1 -0
  626. package/.next/static/chunks/app/v1/chat/conversations/route-e70b5e2b4e09002b.js +1 -0
  627. package/.next/static/chunks/app/v1/chat/events/route-e70b5e2b4e09002b.js +1 -0
  628. package/.next/static/chunks/app/v1/models/route-e70b5e2b4e09002b.js +1 -0
  629. package/.next/static/chunks/app/waves/page-5b53af3eb9409414.js +1 -0
  630. package/.next/static/chunks/webpack-9fbd3587b9ef4dca.js +1 -0
  631. package/.next/static/css/400b1b927c3ffaf6.css +1 -0
  632. package/.next/static/css/82efa7d39b03a714.css +1 -0
  633. package/.next/trace +11 -10
  634. package/.next/types/app/api/flow/[id]/convert-process-to-subflow/route.ts +347 -0
  635. package/.next/types/app/api/flow/assist/route.ts +347 -0
  636. package/.next/types/app/api/mcp/flujo/authoring/route.ts +347 -0
  637. package/.next/types/app/api/mcp/flujo/automation/route.ts +347 -0
  638. package/.next/types/app/api/mcp/flujo/flows/route.ts +347 -0
  639. package/.next/types/app/api/mcp/flujo/resources/read/route.ts +347 -0
  640. package/.next/types/app/api/mcp/flujo/resources/route.ts +347 -0
  641. package/.next/types/app/api/mcp/flujo/servers/route.ts +347 -0
  642. package/.next/types/app/api/mcp/flujo/state/route.ts +347 -0
  643. package/.next/types/app/api/mcp/flujo/tools/route.ts +347 -0
  644. package/.next/types/app/api/setup/ai-cli/route.ts +347 -0
  645. package/.next/types/app/api/statistics/route.ts +347 -0
  646. package/.next/types/app/{layout.ts → automation/triggers/page.ts} +6 -6
  647. package/.next/types/app/{waves → automation/waves}/page.ts +3 -3
  648. package/.next/types/app/{executions → statistics}/page.ts +3 -3
  649. package/.next/types/app/v1/chat/conversations/[conversationId]/revert/route.ts +347 -0
  650. package/.next/types/routes.d.ts +18 -2
  651. package/.next/types/validator.ts +144 -0
  652. package/README.md +79 -52
  653. package/bin/flujo.mjs +42 -5
  654. package/mcp-servers/README.md +94 -0
  655. package/mcp-servers/bash/dist/index.d.ts +3 -0
  656. package/mcp-servers/bash/dist/index.js +85 -0
  657. package/mcp-servers/bash/dist/index.js.map +1 -0
  658. package/mcp-servers/bash/dist/resources.d.ts +13 -0
  659. package/mcp-servers/bash/dist/resources.js +298 -0
  660. package/mcp-servers/bash/dist/resources.js.map +1 -0
  661. package/mcp-servers/bash/dist/shared.d.ts +24 -0
  662. package/mcp-servers/bash/dist/shared.js +161 -0
  663. package/mcp-servers/bash/dist/shared.js.map +1 -0
  664. package/mcp-servers/bash/dist/tools.d.ts +59 -0
  665. package/mcp-servers/bash/dist/tools.js +1493 -0
  666. package/mcp-servers/bash/dist/tools.js.map +1 -0
  667. package/mcp-servers/bash/package.json +33 -0
  668. package/mcp-servers/browser/dist/index.d.ts +4 -0
  669. package/mcp-servers/browser/dist/index.js +34 -0
  670. package/mcp-servers/browser/dist/index.js.map +1 -0
  671. package/mcp-servers/browser/dist/resources.d.ts +6 -0
  672. package/mcp-servers/browser/dist/resources.js +78 -0
  673. package/mcp-servers/browser/dist/resources.js.map +1 -0
  674. package/mcp-servers/browser/dist/runtime.d.ts +26 -0
  675. package/mcp-servers/browser/dist/runtime.js +343 -0
  676. package/mcp-servers/browser/dist/runtime.js.map +1 -0
  677. package/mcp-servers/browser/dist/tools.d.ts +3 -0
  678. package/mcp-servers/browser/dist/tools.js +283 -0
  679. package/mcp-servers/browser/dist/tools.js.map +1 -0
  680. package/mcp-servers/browser/package.json +31 -0
  681. package/mcp-servers/filesystem/dist/index.d.ts +3 -0
  682. package/mcp-servers/filesystem/dist/index.js +56 -0
  683. package/mcp-servers/filesystem/dist/index.js.map +1 -0
  684. package/mcp-servers/filesystem/dist/resources.d.ts +49 -0
  685. package/{.next/server/chunks/9724.js → mcp-servers/filesystem/dist/resources.js} +592 -391
  686. package/mcp-servers/filesystem/dist/resources.js.map +1 -0
  687. package/mcp-servers/filesystem/dist/shared.d.ts +24 -0
  688. package/mcp-servers/filesystem/dist/shared.js +161 -0
  689. package/mcp-servers/filesystem/dist/shared.js.map +1 -0
  690. package/mcp-servers/filesystem/dist/tools.d.ts +3 -0
  691. package/mcp-servers/filesystem/dist/tools.js +1229 -0
  692. package/mcp-servers/filesystem/dist/tools.js.map +1 -0
  693. package/mcp-servers/filesystem/package.json +30 -0
  694. package/mcp-servers/flujo/dist/client.d.ts +12 -0
  695. package/mcp-servers/flujo/dist/client.js +144 -0
  696. package/mcp-servers/flujo/dist/client.js.map +1 -0
  697. package/mcp-servers/flujo/dist/index.d.ts +2 -0
  698. package/mcp-servers/flujo/dist/index.js +31 -0
  699. package/mcp-servers/flujo/dist/index.js.map +1 -0
  700. package/mcp-servers/flujo/package.json +29 -0
  701. package/mcp-servers/mcp-whatsapp-web/dist/auth/link-page.d.ts +11 -0
  702. package/mcp-servers/mcp-whatsapp-web/dist/auth/link-page.js +161 -0
  703. package/mcp-servers/mcp-whatsapp-web/dist/auth/link-page.js.map +1 -0
  704. package/mcp-servers/mcp-whatsapp-web/dist/auth/oauth-provider.d.ts +53 -0
  705. package/mcp-servers/mcp-whatsapp-web/dist/auth/oauth-provider.js +206 -0
  706. package/mcp-servers/mcp-whatsapp-web/dist/auth/oauth-provider.js.map +1 -0
  707. package/mcp-servers/mcp-whatsapp-web/dist/index.d.ts +2 -0
  708. package/mcp-servers/mcp-whatsapp-web/dist/index.js +128 -0
  709. package/mcp-servers/mcp-whatsapp-web/dist/index.js.map +1 -0
  710. package/mcp-servers/mcp-whatsapp-web/dist/server.d.ts +28 -0
  711. package/mcp-servers/mcp-whatsapp-web/dist/server.js +268 -0
  712. package/mcp-servers/mcp-whatsapp-web/dist/server.js.map +1 -0
  713. package/mcp-servers/mcp-whatsapp-web/dist/services/whatsapp.d.ts +149 -0
  714. package/mcp-servers/mcp-whatsapp-web/dist/services/whatsapp.js +818 -0
  715. package/mcp-servers/mcp-whatsapp-web/dist/services/whatsapp.js.map +1 -0
  716. package/mcp-servers/mcp-whatsapp-web/dist/tools/auth.d.ts +8 -0
  717. package/mcp-servers/mcp-whatsapp-web/dist/tools/auth.js +232 -0
  718. package/mcp-servers/mcp-whatsapp-web/dist/tools/auth.js.map +1 -0
  719. package/mcp-servers/mcp-whatsapp-web/dist/tools/chats.d.ts +3 -0
  720. package/mcp-servers/mcp-whatsapp-web/dist/tools/chats.js +90 -0
  721. package/mcp-servers/mcp-whatsapp-web/dist/tools/chats.js.map +1 -0
  722. package/mcp-servers/mcp-whatsapp-web/dist/tools/contacts.d.ts +3 -0
  723. package/mcp-servers/mcp-whatsapp-web/dist/tools/contacts.js +65 -0
  724. package/mcp-servers/mcp-whatsapp-web/dist/tools/contacts.js.map +1 -0
  725. package/mcp-servers/mcp-whatsapp-web/dist/tools/media.d.ts +3 -0
  726. package/mcp-servers/mcp-whatsapp-web/dist/tools/media.js +245 -0
  727. package/mcp-servers/mcp-whatsapp-web/dist/tools/media.js.map +1 -0
  728. package/mcp-servers/mcp-whatsapp-web/dist/tools/messages.d.ts +3 -0
  729. package/mcp-servers/mcp-whatsapp-web/dist/tools/messages.js +141 -0
  730. package/mcp-servers/mcp-whatsapp-web/dist/tools/messages.js.map +1 -0
  731. package/mcp-servers/mcp-whatsapp-web/dist/types/index.d.ts +1 -0
  732. package/mcp-servers/mcp-whatsapp-web/dist/types/index.js +3 -0
  733. package/mcp-servers/mcp-whatsapp-web/dist/types/index.js.map +1 -0
  734. package/mcp-servers/mcp-whatsapp-web/dist/types/whatsapp.d.ts +16 -0
  735. package/mcp-servers/mcp-whatsapp-web/dist/types/whatsapp.js +5 -0
  736. package/mcp-servers/mcp-whatsapp-web/dist/types/whatsapp.js.map +1 -0
  737. package/mcp-servers/mcp-whatsapp-web/dist/utils/audio.d.ts +23 -0
  738. package/mcp-servers/mcp-whatsapp-web/dist/utils/audio.js +99 -0
  739. package/mcp-servers/mcp-whatsapp-web/dist/utils/audio.js.map +1 -0
  740. package/mcp-servers/mcp-whatsapp-web/dist/utils/browser-finder.d.ts +12 -0
  741. package/mcp-servers/mcp-whatsapp-web/dist/utils/browser-finder.js +72 -0
  742. package/mcp-servers/mcp-whatsapp-web/dist/utils/browser-finder.js.map +1 -0
  743. package/mcp-servers/mcp-whatsapp-web/dist/utils/browser-process-manager.d.ts +84 -0
  744. package/mcp-servers/mcp-whatsapp-web/dist/utils/browser-process-manager.js +297 -0
  745. package/mcp-servers/mcp-whatsapp-web/dist/utils/browser-process-manager.js.map +1 -0
  746. package/mcp-servers/mcp-whatsapp-web/dist/utils/cleanup-browsers.d.ts +12 -0
  747. package/mcp-servers/mcp-whatsapp-web/dist/utils/cleanup-browsers.js +141 -0
  748. package/mcp-servers/mcp-whatsapp-web/dist/utils/cleanup-browsers.js.map +1 -0
  749. package/mcp-servers/mcp-whatsapp-web/dist/utils/logger.d.ts +2 -0
  750. package/mcp-servers/mcp-whatsapp-web/dist/utils/logger.js +69 -0
  751. package/mcp-servers/mcp-whatsapp-web/dist/utils/logger.js.map +1 -0
  752. package/mcp-servers/mcp-whatsapp-web/package.json +75 -0
  753. package/mcp-servers/mcp-windows-desktop-automation/dist/index.d.ts +8 -0
  754. package/mcp-servers/mcp-windows-desktop-automation/dist/index.js +95 -0
  755. package/mcp-servers/mcp-windows-desktop-automation/dist/index.js.map +1 -0
  756. package/mcp-servers/mcp-windows-desktop-automation/dist/prompts/index.d.ts +8 -0
  757. package/mcp-servers/mcp-windows-desktop-automation/dist/prompts/index.js +195 -0
  758. package/mcp-servers/mcp-windows-desktop-automation/dist/prompts/index.js.map +1 -0
  759. package/mcp-servers/mcp-windows-desktop-automation/dist/resources/index.d.ts +8 -0
  760. package/mcp-servers/mcp-windows-desktop-automation/dist/resources/index.js +214 -0
  761. package/mcp-servers/mcp-windows-desktop-automation/dist/resources/index.js.map +1 -0
  762. package/mcp-servers/mcp-windows-desktop-automation/dist/server/server.d.ts +21 -0
  763. package/mcp-servers/mcp-windows-desktop-automation/dist/server/server.js +108 -0
  764. package/mcp-servers/mcp-windows-desktop-automation/dist/server/server.js.map +1 -0
  765. package/mcp-servers/mcp-windows-desktop-automation/dist/tools/control.d.ts +8 -0
  766. package/mcp-servers/mcp-windows-desktop-automation/dist/tools/control.js +301 -0
  767. package/mcp-servers/mcp-windows-desktop-automation/dist/tools/control.js.map +1 -0
  768. package/mcp-servers/mcp-windows-desktop-automation/dist/tools/index.d.ts +8 -0
  769. package/mcp-servers/mcp-windows-desktop-automation/dist/tools/index.js +22 -0
  770. package/mcp-servers/mcp-windows-desktop-automation/dist/tools/index.js.map +1 -0
  771. package/mcp-servers/mcp-windows-desktop-automation/dist/tools/keyboard.d.ts +8 -0
  772. package/mcp-servers/mcp-windows-desktop-automation/dist/tools/keyboard.js +146 -0
  773. package/mcp-servers/mcp-windows-desktop-automation/dist/tools/keyboard.js.map +1 -0
  774. package/mcp-servers/mcp-windows-desktop-automation/dist/tools/mouse.d.ts +8 -0
  775. package/mcp-servers/mcp-windows-desktop-automation/dist/tools/mouse.js +179 -0
  776. package/mcp-servers/mcp-windows-desktop-automation/dist/tools/mouse.js.map +1 -0
  777. package/mcp-servers/mcp-windows-desktop-automation/dist/tools/process.d.ts +8 -0
  778. package/mcp-servers/mcp-windows-desktop-automation/dist/tools/process.js +236 -0
  779. package/mcp-servers/mcp-windows-desktop-automation/dist/tools/process.js.map +1 -0
  780. package/mcp-servers/mcp-windows-desktop-automation/dist/tools/window.d.ts +8 -0
  781. package/mcp-servers/mcp-windows-desktop-automation/dist/tools/window.js +300 -0
  782. package/mcp-servers/mcp-windows-desktop-automation/dist/tools/window.js.map +1 -0
  783. package/mcp-servers/mcp-windows-desktop-automation/dist/utils/logger/logger.d.ts +50 -0
  784. package/mcp-servers/mcp-windows-desktop-automation/dist/utils/logger/logger.js +78 -0
  785. package/mcp-servers/mcp-windows-desktop-automation/dist/utils/logger/logger.js.map +1 -0
  786. package/mcp-servers/mcp-windows-desktop-automation/dist/utils/types.d.ts +51 -0
  787. package/mcp-servers/mcp-windows-desktop-automation/dist/utils/types.js +61 -0
  788. package/mcp-servers/mcp-windows-desktop-automation/dist/utils/types.js.map +1 -0
  789. package/mcp-servers/mcp-windows-desktop-automation/package.json +38 -0
  790. package/mcp-servers/patchright-mcp/package.json +32 -0
  791. package/mcp-servers/reddit-mcp-server/package.json +88 -0
  792. package/mcp-servers/servers/package.json +31 -0
  793. package/mcp-servers/shared/dist/index.d.ts +24 -0
  794. package/mcp-servers/shared/dist/index.js +161 -0
  795. package/mcp-servers/shared/dist/index.js.map +1 -0
  796. package/mcp-servers/shared/package.json +26 -0
  797. package/package.json +119 -99
  798. package/scripts/launch-next.mjs +13 -1
  799. package/.next/server/chunks/1114.js +0 -1
  800. package/.next/server/chunks/1439.js +0 -1
  801. package/.next/server/chunks/1578.js +0 -5
  802. package/.next/server/chunks/1634.js +0 -1
  803. package/.next/server/chunks/166.js +0 -5
  804. package/.next/server/chunks/1664.js +0 -2
  805. package/.next/server/chunks/1690.js +0 -1
  806. package/.next/server/chunks/2859.js +0 -1
  807. package/.next/server/chunks/3629.js +0 -1
  808. package/.next/server/chunks/3653.js +0 -2
  809. package/.next/server/chunks/366.js +0 -2
  810. package/.next/server/chunks/3717.js +0 -1
  811. package/.next/server/chunks/3935.js +0 -4
  812. package/.next/server/chunks/3984.js +0 -9
  813. package/.next/server/chunks/4013.js +0 -1
  814. package/.next/server/chunks/4436.js +0 -1
  815. package/.next/server/chunks/4466.js +0 -1
  816. package/.next/server/chunks/4551.js +0 -6
  817. package/.next/server/chunks/4663.js +0 -1
  818. package/.next/server/chunks/4822.js +0 -1
  819. package/.next/server/chunks/5200.js +0 -1
  820. package/.next/server/chunks/5285.js +0 -1
  821. package/.next/server/chunks/5309.js +0 -78
  822. package/.next/server/chunks/544.js +0 -136
  823. package/.next/server/chunks/5463.js +0 -1
  824. package/.next/server/chunks/5544.js +0 -5
  825. package/.next/server/chunks/5880.js +0 -1
  826. package/.next/server/chunks/6747.js +0 -435
  827. package/.next/server/chunks/6793.js +0 -1
  828. package/.next/server/chunks/7069.js +0 -6
  829. package/.next/server/chunks/7104.js +0 -1
  830. package/.next/server/chunks/7634.js +0 -4
  831. package/.next/server/chunks/793.js +0 -403
  832. package/.next/server/chunks/7965.js +0 -39
  833. package/.next/server/chunks/7993.js +0 -2
  834. package/.next/server/chunks/8356.js +0 -1
  835. package/.next/server/chunks/8387.js +0 -1
  836. package/.next/server/chunks/87.js +0 -1
  837. package/.next/server/chunks/9085.js +0 -2
  838. package/.next/server/chunks/9174.js +0 -1
  839. package/.next/server/chunks/9235.js +0 -29
  840. package/.next/server/chunks/94.js +0 -1
  841. package/.next/server/chunks/9983.js +0 -2
  842. package/.next/static/chunks/1871-14c3e63ca865d85e.js +0 -1
  843. package/.next/static/chunks/2003-f826c607d609d1fa.js +0 -1
  844. package/.next/static/chunks/2005.4eea65c00d9a29cd.js +0 -1
  845. package/.next/static/chunks/2318-13ef0d3048e97834.js +0 -1
  846. package/.next/static/chunks/3077-565833c67440a7fa.js +0 -1
  847. package/.next/static/chunks/3217.260785c2198d1e9d.js +0 -1
  848. package/.next/static/chunks/3272-fd8d59523f61da96.js +0 -1
  849. package/.next/static/chunks/3429-34fb1a84aed96703.js +0 -1
  850. package/.next/static/chunks/3545.353a62a68d3b7fd1.js +0 -1
  851. package/.next/static/chunks/3659-0ab9580d5ee5deea.js +0 -1
  852. package/.next/static/chunks/3772-20197853c04a6993.js +0 -1
  853. package/.next/static/chunks/422-61b173ba64cf0c94.js +0 -1
  854. package/.next/static/chunks/4523-a540747aa2ed34e8.js +0 -1
  855. package/.next/static/chunks/454.5fc2f8eef98483e3.js +0 -1
  856. package/.next/static/chunks/488-7ab54d8ae2b4b550.js +0 -1
  857. package/.next/static/chunks/4919-6c8a48e3cc642349.js +0 -1
  858. package/.next/static/chunks/4929-150b03595474c9d8.js +0 -1
  859. package/.next/static/chunks/5733-1419095a28c1ddc3.js +0 -1
  860. package/.next/static/chunks/639-90ed75d402dc872b.js +0 -1
  861. package/.next/static/chunks/6404-86615a5f5ce5c00f.js +0 -1
  862. package/.next/static/chunks/6430-8c6dac4a758119f2.js +0 -1
  863. package/.next/static/chunks/6539-118a0084e0bfae34.js +0 -1
  864. package/.next/static/chunks/7264-91d1fa99abcd91ad.js +0 -1
  865. package/.next/static/chunks/7328-c8a51bb8c7470d77.js +0 -1
  866. package/.next/static/chunks/7391-5a0abd837ba241f5.js +0 -1
  867. package/.next/static/chunks/7445-d8a8be6e451c522e.js +0 -1
  868. package/.next/static/chunks/7561-2b366ddcbc3cc0ec.js +0 -1
  869. package/.next/static/chunks/8124-4a80e3201b8e51b0.js +0 -1
  870. package/.next/static/chunks/8345.bc5534ec13abc9ee.js +0 -1
  871. package/.next/static/chunks/8404-5aa8ea49197b98b8.js +0 -1
  872. package/.next/static/chunks/8405.a425f94b6b13d2be.js +0 -1
  873. package/.next/static/chunks/8470-72cf748472d4d501.js +0 -1
  874. package/.next/static/chunks/8551-a28272acfda62ac9.js +0 -1
  875. package/.next/static/chunks/8650-f879564a0ed89bc3.js +0 -1
  876. package/.next/static/chunks/8989-5fa9c7c670eb9a1a.js +0 -1
  877. package/.next/static/chunks/9164-de1d167d87614a6d.js +0 -1
  878. package/.next/static/chunks/9195.294887f083b1a11b.js +0 -1
  879. package/.next/static/chunks/9203-786f457ecf60b49c.js +0 -1
  880. package/.next/static/chunks/9244-3281f7fd02003a2c.js +0 -1
  881. package/.next/static/chunks/9345-11d6e48d892b1862.js +0 -8
  882. package/.next/static/chunks/9562-f8371be653010627.js +0 -1
  883. package/.next/static/chunks/9581-6d2523fd68a5e3c4.js +0 -1
  884. package/.next/static/chunks/9611-9867e6e8e65172ec.js +0 -1
  885. package/.next/static/chunks/9951-566fc6b05c12209e.js +0 -1
  886. package/.next/static/chunks/app/api/approvals/[id]/route-b9c783850b4c2acf.js +0 -1
  887. package/.next/static/chunks/app/api/approvals/route-b9c783850b4c2acf.js +0 -1
  888. package/.next/static/chunks/app/api/backup/route-b9c783850b4c2acf.js +0 -1
  889. package/.next/static/chunks/app/api/browse/route-b9c783850b4c2acf.js +0 -1
  890. package/.next/static/chunks/app/api/bugs/enhance/route-b9c783850b4c2acf.js +0 -1
  891. package/.next/static/chunks/app/api/cwd/route-b9c783850b4c2acf.js +0 -1
  892. package/.next/static/chunks/app/api/encryption/secure/route-b9c783850b4c2acf.js +0 -1
  893. package/.next/static/chunks/app/api/env/route-b9c783850b4c2acf.js +0 -1
  894. package/.next/static/chunks/app/api/flow/[id]/route-b9c783850b4c2acf.js +0 -1
  895. package/.next/static/chunks/app/api/flow/[id]/versions/[versionId]/route-b9c783850b4c2acf.js +0 -1
  896. package/.next/static/chunks/app/api/flow/[id]/versions/route-b9c783850b4c2acf.js +0 -1
  897. package/.next/static/chunks/app/api/flow/compile/route-b9c783850b4c2acf.js +0 -1
  898. package/.next/static/chunks/app/api/flow/generate/route-b9c783850b4c2acf.js +0 -1
  899. package/.next/static/chunks/app/api/flow/generator/route-b9c783850b4c2acf.js +0 -1
  900. package/.next/static/chunks/app/api/flow/improve/route-b9c783850b4c2acf.js +0 -1
  901. package/.next/static/chunks/app/api/flow/prompt-renderer/route-b9c783850b4c2acf.js +0 -1
  902. package/.next/static/chunks/app/api/flow/quick-chat/route-b9c783850b4c2acf.js +0 -1
  903. package/.next/static/chunks/app/api/flow/repair/route-b9c783850b4c2acf.js +0 -1
  904. package/.next/static/chunks/app/api/flow/route-b9c783850b4c2acf.js +0 -1
  905. package/.next/static/chunks/app/api/git/route-b9c783850b4c2acf.js +0 -1
  906. package/.next/static/chunks/app/api/init/route-b9c783850b4c2acf.js +0 -1
  907. package/.next/static/chunks/app/api/local-models/capability/route-b9c783850b4c2acf.js +0 -1
  908. package/.next/static/chunks/app/api/local-models/pull/route-b9c783850b4c2acf.js +0 -1
  909. package/.next/static/chunks/app/api/local-models/suggest/route-b9c783850b4c2acf.js +0 -1
  910. package/.next/static/chunks/app/api/mcp/app-sandbox/route-b9c783850b4c2acf.js +0 -1
  911. package/.next/static/chunks/app/api/mcp/cancel/route-b9c783850b4c2acf.js +0 -1
  912. package/.next/static/chunks/app/api/mcp/oauth-capability/route-b9c783850b4c2acf.js +0 -1
  913. package/.next/static/chunks/app/api/mcp/servers/[name]/prompts/get/route-b9c783850b4c2acf.js +0 -1
  914. package/.next/static/chunks/app/api/mcp/servers/[name]/prompts/route-b9c783850b4c2acf.js +0 -1
  915. package/.next/static/chunks/app/api/mcp/servers/[name]/resources/read/route-b9c783850b4c2acf.js +0 -1
  916. package/.next/static/chunks/app/api/mcp/servers/[name]/resources/route-b9c783850b4c2acf.js +0 -1
  917. package/.next/static/chunks/app/api/mcp/servers/[name]/route-b9c783850b4c2acf.js +0 -1
  918. package/.next/static/chunks/app/api/mcp/servers/[name]/status/route-b9c783850b4c2acf.js +0 -1
  919. package/.next/static/chunks/app/api/mcp/servers/[name]/tools/[toolName]/route-b9c783850b4c2acf.js +0 -1
  920. package/.next/static/chunks/app/api/mcp/servers/[name]/tools/route-b9c783850b4c2acf.js +0 -1
  921. package/.next/static/chunks/app/api/mcp/servers/route-b9c783850b4c2acf.js +0 -1
  922. package/.next/static/chunks/app/api/mcp/test-connection/route-b9c783850b4c2acf.js +0 -1
  923. package/.next/static/chunks/app/api/mcp/test-connection/stream/route-b9c783850b4c2acf.js +0 -1
  924. package/.next/static/chunks/app/api/mcp-registry/route-b9c783850b4c2acf.js +0 -1
  925. package/.next/static/chunks/app/api/mcp-registry/spotlight/route-b9c783850b4c2acf.js +0 -1
  926. package/.next/static/chunks/app/api/model/[id]/route-b9c783850b4c2acf.js +0 -1
  927. package/.next/static/chunks/app/api/model/provider/route-b9c783850b4c2acf.js +0 -1
  928. package/.next/static/chunks/app/api/model/route-b9c783850b4c2acf.js +0 -1
  929. package/.next/static/chunks/app/api/model/test/route-b9c783850b4c2acf.js +0 -1
  930. package/.next/static/chunks/app/api/oauth/callback/route-b9c783850b4c2acf.js +0 -1
  931. package/.next/static/chunks/app/api/oauth/initiate/route-b9c783850b4c2acf.js +0 -1
  932. package/.next/static/chunks/app/api/oauth/reset/route-b9c783850b4c2acf.js +0 -1
  933. package/.next/static/chunks/app/api/packages/build/route-b9c783850b4c2acf.js +0 -1
  934. package/.next/static/chunks/app/api/packages/derive-secrets/route-b9c783850b4c2acf.js +0 -1
  935. package/.next/static/chunks/app/api/packages/install/route-b9c783850b4c2acf.js +0 -1
  936. package/.next/static/chunks/app/api/packages/install/status/route-b9c783850b4c2acf.js +0 -1
  937. package/.next/static/chunks/app/api/packages/installed/route-b9c783850b4c2acf.js +0 -1
  938. package/.next/static/chunks/app/api/packages/resolve/route-b9c783850b4c2acf.js +0 -1
  939. package/.next/static/chunks/app/api/packages/scan-targets/route-b9c783850b4c2acf.js +0 -1
  940. package/.next/static/chunks/app/api/packages/search/route-b9c783850b4c2acf.js +0 -1
  941. package/.next/static/chunks/app/api/packages/uninstall/route-b9c783850b4c2acf.js +0 -1
  942. package/.next/static/chunks/app/api/planned-executions/[id]/route-b9c783850b4c2acf.js +0 -1
  943. package/.next/static/chunks/app/api/planned-executions/[id]/run/route-b9c783850b4c2acf.js +0 -1
  944. package/.next/static/chunks/app/api/planned-executions/[id]/runs/route-b9c783850b4c2acf.js +0 -1
  945. package/.next/static/chunks/app/api/planned-executions/preview-schedule/route-b9c783850b4c2acf.js +0 -1
  946. package/.next/static/chunks/app/api/planned-executions/reconcile/route-b9c783850b4c2acf.js +0 -1
  947. package/.next/static/chunks/app/api/planned-executions/route-b9c783850b4c2acf.js +0 -1
  948. package/.next/static/chunks/app/api/registry/auth/resend/route-b9c783850b4c2acf.js +0 -1
  949. package/.next/static/chunks/app/api/registry/auth/reset/route-b9c783850b4c2acf.js +0 -1
  950. package/.next/static/chunks/app/api/registry/auth/route-b9c783850b4c2acf.js +0 -1
  951. package/.next/static/chunks/app/api/registry/feedback/route-b9c783850b4c2acf.js +0 -1
  952. package/.next/static/chunks/app/api/registry/oauth/callback/route-b9c783850b4c2acf.js +0 -1
  953. package/.next/static/chunks/app/api/registry/oauth/initiate/route-b9c783850b4c2acf.js +0 -1
  954. package/.next/static/chunks/app/api/registry/packages/route-b9c783850b4c2acf.js +0 -1
  955. package/.next/static/chunks/app/api/registry/publish/route-b9c783850b4c2acf.js +0 -1
  956. package/.next/static/chunks/app/api/registry/settings/route-b9c783850b4c2acf.js +0 -1
  957. package/.next/static/chunks/app/api/restore/route-b9c783850b4c2acf.js +0 -1
  958. package/.next/static/chunks/app/api/runs/active/route-b9c783850b4c2acf.js +0 -1
  959. package/.next/static/chunks/app/api/storage/route-b9c783850b4c2acf.js +0 -1
  960. package/.next/static/chunks/app/api/telemetry/daily-active/route-b9c783850b4c2acf.js +0 -1
  961. package/.next/static/chunks/app/api/update/route-b9c783850b4c2acf.js +0 -1
  962. package/.next/static/chunks/app/api/waves/route-b9c783850b4c2acf.js +0 -1
  963. package/.next/static/chunks/app/api/webhooks/[id]/route-b9c783850b4c2acf.js +0 -1
  964. package/.next/static/chunks/app/chat/page-e37bbc561f40ce60.js +0 -1
  965. package/.next/static/chunks/app/docs/page-3b9ce48854b2147d.js +0 -1
  966. package/.next/static/chunks/app/executions/page-8296fd69c439ccee.js +0 -1
  967. package/.next/static/chunks/app/flows/page-e52c8943555e38dd.js +0 -1
  968. package/.next/static/chunks/app/layout-abed1f211e03152f.js +0 -1
  969. package/.next/static/chunks/app/mcp/page-4a3e5a643d84ee89.js +0 -1
  970. package/.next/static/chunks/app/mcp-flows/route-b9c783850b4c2acf.js +0 -1
  971. package/.next/static/chunks/app/mcp-proxy/[server]/route-b9c783850b4c2acf.js +0 -1
  972. package/.next/static/chunks/app/models/error-1718b538d6967e56.js +0 -1
  973. package/.next/static/chunks/app/models/page-595597042e227970.js +0 -1
  974. package/.next/static/chunks/app/packages/page-2f2d29c17841b3cf.js +0 -1
  975. package/.next/static/chunks/app/page-2f9da78a4891731a.js +0 -1
  976. package/.next/static/chunks/app/settings/page-f35e939032b0277d.js +0 -1
  977. package/.next/static/chunks/app/v1/chat/completions/route-b9c783850b4c2acf.js +0 -1
  978. package/.next/static/chunks/app/v1/chat/conversations/[conversationId]/breakpoints/route-b9c783850b4c2acf.js +0 -1
  979. package/.next/static/chunks/app/v1/chat/conversations/[conversationId]/cancel/route-b9c783850b4c2acf.js +0 -1
  980. package/.next/static/chunks/app/v1/chat/conversations/[conversationId]/debug/continue/route-b9c783850b4c2acf.js +0 -1
  981. package/.next/static/chunks/app/v1/chat/conversations/[conversationId]/debug/step/route-b9c783850b4c2acf.js +0 -1
  982. package/.next/static/chunks/app/v1/chat/conversations/[conversationId]/edit-state/route-b9c783850b4c2acf.js +0 -1
  983. package/.next/static/chunks/app/v1/chat/conversations/[conversationId]/events/route-b9c783850b4c2acf.js +0 -1
  984. package/.next/static/chunks/app/v1/chat/conversations/[conversationId]/inject/route-b9c783850b4c2acf.js +0 -1
  985. package/.next/static/chunks/app/v1/chat/conversations/[conversationId]/resources/[resourceId]/content/route-b9c783850b4c2acf.js +0 -1
  986. package/.next/static/chunks/app/v1/chat/conversations/[conversationId]/resources/route-b9c783850b4c2acf.js +0 -1
  987. package/.next/static/chunks/app/v1/chat/conversations/[conversationId]/respond/route-b9c783850b4c2acf.js +0 -1
  988. package/.next/static/chunks/app/v1/chat/conversations/[conversationId]/route-b9c783850b4c2acf.js +0 -1
  989. package/.next/static/chunks/app/v1/chat/conversations/route-b9c783850b4c2acf.js +0 -1
  990. package/.next/static/chunks/app/v1/chat/events/route-b9c783850b4c2acf.js +0 -1
  991. package/.next/static/chunks/app/v1/models/route-b9c783850b4c2acf.js +0 -1
  992. package/.next/static/chunks/app/waves/page-dc99a16141dd902b.js +0 -1
  993. package/.next/static/chunks/webpack-9d09d53b271f49e2.js +0 -1
  994. package/.next/static/css/30253fcfa8035221.css +0 -1
  995. package/.next/static/css/69ab44eb350e0b6c.css +0 -1
  996. package/.next/static/kIFnN4S0HHOnvpPGsSzi9/_buildManifest.js +0 -1
  997. /package/.next/static/{kIFnN4S0HHOnvpPGsSzi9 → b1aMk0634gkkiunttd1SQ}/_ssgManifest.js +0 -0
@@ -0,0 +1,245 @@
1
+ import { z } from 'zod';
2
+ import { log } from '../utils/logger.js';
3
+ // Import the CommonJS module
4
+ import { createRequire } from 'module';
5
+ const require = createRequire(import.meta.url);
6
+ const { MessageMedia } = require('whatsapp-web.js');
7
+ // Using WAWebJS.Message directly instead of alias
8
+ import { AudioUtils } from '../utils/audio.js'; // To be created
9
+ import fs from 'fs';
10
+ import path from 'path';
11
+ import os from 'os';
12
+ import { fileTypeFromBuffer } from 'file-type'; // Need to install file-type
13
+ export function registerMediaTools(server, whatsappService) {
14
+ log.info('Registering media tools...');
15
+ // Combined tool for sending various media types
16
+ server.tool('send_media', 'Send media (image, video, document, audio) via WhatsApp.', {
17
+ recipient_jid: z.string().describe('The recipient JID (e.g., 123456789@c.us or 123456789-12345678@g.us)'),
18
+ media_path: z.string().optional().describe('Absolute path to the local media file'),
19
+ media_url: z.string().url().optional().describe('URL of the media file'),
20
+ media_content: z.string().optional().describe('Base64 encoded media content'),
21
+ mime_type: z.string().optional().describe('MIME type of the media_content (required if using media_content)'),
22
+ filename: z.string().optional().describe('Filename for the media (recommended if using media_content)'),
23
+ caption: z.string().optional().describe('Optional caption for the media'),
24
+ as_audio_message: z.boolean().optional().default(false).describe('Send audio specifically as a voice note (requires ffmpeg for conversion if not opus/ogg)'),
25
+ include_full_data: z.boolean().optional().default(false).describe('Whether to include the full base64 data in the response')
26
+ }, async ({ recipient_jid, media_path, media_url, media_content, mime_type, filename, caption, as_audio_message, include_full_data = false, }) => {
27
+ let mediaInput = null;
28
+ let inputType = null;
29
+ if (media_path) {
30
+ mediaInput = media_path;
31
+ inputType = 'path';
32
+ }
33
+ else if (media_url) {
34
+ mediaInput = media_url;
35
+ inputType = 'url';
36
+ }
37
+ else if (media_content) {
38
+ if (!mime_type) {
39
+ return { content: [{ type: 'text', text: 'mime_type is required when using media_content' }], isError: true };
40
+ }
41
+ mediaInput = media_content;
42
+ inputType = 'base64';
43
+ }
44
+ if (!mediaInput || !inputType) {
45
+ return { content: [{ type: 'text', text: 'One of media_path, media_url, or media_content must be provided' }], isError: true };
46
+ }
47
+ try {
48
+ let sentMessage;
49
+ let finalMediaPath = media_path; // Keep track of the path used, especially for temp files
50
+ if (as_audio_message) {
51
+ // Handle sending as audio message (voice note)
52
+ log.info(`Attempting to send audio message to ${recipient_jid}`);
53
+ let audioPath = '';
54
+ let tempFilePath = null;
55
+ let needsCleanup = false;
56
+ if (inputType === 'path') {
57
+ audioPath = mediaInput;
58
+ }
59
+ else if (inputType === 'url') {
60
+ return { content: [{ type: 'text', text: 'Sending audio message directly from URL is not yet supported. Download first.' }], isError: true };
61
+ // TODO: Implement download from URL first if needed
62
+ }
63
+ else { // base64
64
+ const buffer = Buffer.from(mediaInput, 'base64');
65
+ const detectedType = await fileTypeFromBuffer(buffer);
66
+ const ext = detectedType?.ext || 'bin'; // Fallback extension
67
+ tempFilePath = path.join(os.tmpdir(), `whatsapp_audio_${Date.now()}.${ext}`);
68
+ fs.writeFileSync(tempFilePath, buffer);
69
+ audioPath = tempFilePath;
70
+ needsCleanup = true;
71
+ mime_type = detectedType?.mime || mime_type || 'application/octet-stream'; // Use detected type if available
72
+ filename = filename || `audio.${ext}`;
73
+ }
74
+ if (!audioPath.endsWith('.ogg')) {
75
+ log.info(`Audio file ${audioPath} is not ogg, attempting conversion...`);
76
+ try {
77
+ const convertedPath = await AudioUtils.convertToOpusOggTemp(audioPath);
78
+ log.info(`Audio converted to ${convertedPath}`);
79
+ // If original was temp, clean it up now
80
+ if (needsCleanup && tempFilePath && fs.existsSync(tempFilePath)) {
81
+ fs.unlinkSync(tempFilePath);
82
+ }
83
+ tempFilePath = convertedPath; // Now the converted file is the temp file
84
+ needsCleanup = true; // Mark the converted file for cleanup
85
+ audioPath = convertedPath;
86
+ finalMediaPath = audioPath; // Update final path
87
+ }
88
+ catch (conversionError) {
89
+ log.warn(`Audio conversion failed: ${conversionError.message}. Sending as regular document/audio file.`);
90
+ // Fallback: Send as regular media without 'ptt' flag
91
+ const media = inputType === 'base64'
92
+ ? new MessageMedia(mime_type, mediaInput, filename)
93
+ : (inputType === 'path' ? MessageMedia.fromFilePath(mediaInput) : await MessageMedia.fromUrl(mediaInput, { unsafeMime: true })); // Corrected logic: check path or assume URL
94
+ sentMessage = await whatsappService.getClient().sendMessage(recipient_jid, media, { caption });
95
+ // Cleanup temp file if created from base64
96
+ if (needsCleanup && tempFilePath && fs.existsSync(tempFilePath)) {
97
+ fs.unlinkSync(tempFilePath);
98
+ }
99
+ // Return result for regular media sending
100
+ const result = { success: true, message: 'Audio sent as regular file (conversion failed).', messageId: sentMessage.id._serialized };
101
+ return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
102
+ }
103
+ }
104
+ // Send the (potentially converted) ogg file as a voice note
105
+ const media = MessageMedia.fromFilePath(audioPath);
106
+ sentMessage = await whatsappService.getClient().sendMessage(recipient_jid, media, { sendAudioAsVoice: true }); // Key option!
107
+ // Cleanup temp file if created
108
+ if (needsCleanup && tempFilePath && fs.existsSync(tempFilePath)) {
109
+ fs.unlinkSync(tempFilePath);
110
+ }
111
+ }
112
+ else {
113
+ // Handle sending regular media (image, video, document)
114
+ log.info(`Sending regular media to ${recipient_jid}`);
115
+ // Determine finalMediaPath based on inputType
116
+ if (inputType === 'path') {
117
+ finalMediaPath = mediaInput;
118
+ }
119
+ else {
120
+ finalMediaPath = undefined; // URL or base64 doesn't have a local path
121
+ }
122
+ // The sendMedia method in WhatsAppService handles the different input types (path/url)
123
+ // For base64, we need to call a different service method
124
+ if (inputType === 'base64') {
125
+ sentMessage = await whatsappService.sendMediaFromBase64(recipient_jid, mediaInput, mime_type, filename, caption);
126
+ }
127
+ else {
128
+ sentMessage = await whatsappService.sendMedia(recipient_jid, mediaInput, caption);
129
+ }
130
+ }
131
+ // Create result object with basic info
132
+ const result = {
133
+ success: true,
134
+ message: `Media (${as_audio_message ? 'audio message' : 'file'}) sent successfully.`,
135
+ messageId: sentMessage.id._serialized,
136
+ timestamp: sentMessage.timestamp,
137
+ filePathUsed: finalMediaPath // Include the path if a local file was ultimately sent
138
+ };
139
+ // If include_full_data is true, include the media content in the result
140
+ if (include_full_data && mediaInput) {
141
+ // For base64 input, we already have the data
142
+ if (inputType === 'base64') {
143
+ result.mediaData = media_content;
144
+ result.mimeType = mime_type;
145
+ }
146
+ // For path or URL, we need to get the data
147
+ else if (inputType === 'path' && fs.existsSync(mediaInput)) {
148
+ try {
149
+ const buffer = fs.readFileSync(mediaInput);
150
+ result.mediaData = buffer.toString('base64');
151
+ // Try to determine mime type
152
+ const detectedType = await fileTypeFromBuffer(buffer);
153
+ result.mimeType = detectedType?.mime || 'application/octet-stream';
154
+ }
155
+ catch (err) {
156
+ log.warn(`Could not read file for include_full_data: ${err}`);
157
+ }
158
+ }
159
+ // For URL, we don't re-download it to include in the response
160
+ }
161
+ log.debug('Send media result', JSON.stringify(result));
162
+ return {
163
+ content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
164
+ };
165
+ }
166
+ catch (error) {
167
+ log.error(`Error in send_media tool to ${recipient_jid}:`, error);
168
+ return {
169
+ content: [{ type: 'text', text: `Error sending media to ${recipient_jid}: ${error.message}` }],
170
+ isError: true,
171
+ };
172
+ }
173
+ });
174
+ server.tool('download_media', 'Download media from a WhatsApp message and return its content.', {
175
+ message_id: z.string().describe('The serialized ID of the message containing the media'),
176
+ include_full_data: z.boolean().optional().default(false).describe('Whether to include the full base64 data in the response')
177
+ }, async ({ message_id, include_full_data = false }) => {
178
+ try {
179
+ const media = await whatsappService.downloadMedia(message_id);
180
+ if (!media) {
181
+ return {
182
+ content: [{ type: 'text', text: `Media not found or failed to download for message: ${message_id}` }],
183
+ isError: true,
184
+ };
185
+ }
186
+ // Extract metadata
187
+ const metadata = {
188
+ filename: media.filename || 'unknown',
189
+ mimetype: media.mimetype,
190
+ filesize: media.filesize || 'unknown'
191
+ };
192
+ log.debug('Media metadata', JSON.stringify(metadata));
193
+ // Create a TextContent with metadata as the first item in the content array
194
+ const metadataContent = {
195
+ type: 'text',
196
+ text: JSON.stringify(metadata, null, 2)
197
+ };
198
+ // Prepare the array for the response content
199
+ const contentArray = [metadataContent];
200
+ // If include_full_data is true, add a second content object with the actual media data
201
+ if (include_full_data) {
202
+ if (media.mimetype.startsWith('image/')) {
203
+ // For images, add an ImageContent
204
+ contentArray.push({
205
+ type: 'image',
206
+ data: media.data,
207
+ mimeType: media.mimetype,
208
+ }); // Type assertion to satisfy TypeScript
209
+ }
210
+ else if (media.mimetype.startsWith('audio/')) {
211
+ // For audio, add an AudioContent
212
+ contentArray.push({
213
+ type: 'audio',
214
+ data: media.data,
215
+ mimeType: media.mimetype,
216
+ }); // Type assertion to satisfy TypeScript
217
+ }
218
+ else {
219
+ // For videos, documents, etc., add as TextContent
220
+ contentArray.push({
221
+ type: 'text',
222
+ text: `Base64 Data: ${media.data}`
223
+ });
224
+ }
225
+ }
226
+ log.debug('Download media result', JSON.stringify({
227
+ metadata,
228
+ hasFullData: include_full_data,
229
+ mediaType: media.mimetype
230
+ }));
231
+ return {
232
+ content: contentArray,
233
+ };
234
+ }
235
+ catch (error) {
236
+ log.error(`Error in download_media tool for message ${message_id}:`, error);
237
+ return {
238
+ content: [{ type: 'text', text: `Error downloading media for message ${message_id}: ${error.message}` }],
239
+ isError: true,
240
+ };
241
+ }
242
+ });
243
+ log.info('Media tools registered.');
244
+ }
245
+ //# sourceMappingURL=media.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"media.js","sourceRoot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EAAE,CAAC;oBAC/C,iCAAiC;oBACjC,YAAY,CAAC,IAAI,CAAC;wBAChB,IAAI,EAAE,OAAO;wBACb,IAAI,EAAE,KAAK,CAAC,IAAI;wBAChB,QAAQ,EAAE,KAAK,CAAC,QAAQ;qBACC,CAAC,CAAC,CAAC,uCAAuC;gBACvE,CAAC;qBAAM,CAAC;oBACN,kDAAkD;oBAClD,YAAY,CAAC,IAAI,CAAC;wBAChB,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,gBAAgB,KAAK,CAAC,IAAI,EAAE;qBACnC,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;YAED,GAAG,CAAC,KAAK,CAAC,uBAAuB,EAAE,IAAI,CAAC,SAAS,CAAC;gBAChD,QAAQ;gBACR,WAAW,EAAE,iBAAiB;gBAC9B,SAAS,EAAE,KAAK,CAAC,QAAQ;aAC1B,CAAC,CAAC,CAAC;YAEJ,OAAO;gBACL,OAAO,EAAE,YAAY;aACtB,CAAC;QACJ,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,GAAG,CAAC,KAAK,CAAC,4CAA4C,UAAU,GAAG,EAAE,KAAK,CAAC,CAAC;YAC5E,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,uCAAuC,UAAU,KAAK,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC;gBACxG,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;IAEF,GAAG,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC;AACtC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import { WhatsAppService } from '../services/whatsapp.js';
3
+ export declare function registerMessageTools(server: McpServer, whatsappService: WhatsAppService): void;
@@ -0,0 +1,141 @@
1
+ import { z } from 'zod';
2
+ import { log } from '../utils/logger.js';
3
+ export function registerMessageTools(server, whatsappService) {
4
+ log.info('Registering message tools...');
5
+ server.tool('list_messages', 'Get WhatsApp messages from a specific chat. This is the source of truth for actual message content: use it whenever the question is about what someone said/wrote. Entries include non-text events too (check the "type" field: "chat" = text message, "call_log" = call, "ptt" = voice note, "image"/"video" = media; non-text entries may have an empty "body").', {
6
+ chat_id: z.string().describe('The JID of the chat to retrieve messages from (e.g., 123456789@c.us or 123456789-12345678@g.us)'),
7
+ limit: z.number().int().positive().optional().default(50).describe('Maximum number of messages to return'),
8
+ // Note: whatsapp-web.js fetchMessages doesn't support date/sender/query filtering directly.
9
+ // Filtering would need to be done after fetching.
10
+ }, async ({ chat_id, limit }) => {
11
+ try {
12
+ const messages = await whatsappService.getMessages(chat_id, limit);
13
+ // Return the simplified message structure
14
+ return {
15
+ content: [{ type: 'text', text: JSON.stringify(messages, null, 2) }],
16
+ };
17
+ }
18
+ catch (error) {
19
+ log.error(`Error in list_messages tool for chat ${chat_id}:`, error);
20
+ return {
21
+ content: [{ type: 'text', text: `Error listing messages for chat ${chat_id}: ${error.message}` }],
22
+ isError: true,
23
+ };
24
+ }
25
+ });
26
+ server.tool('get_message_by_id', 'Get a specific WhatsApp message by its ID.', {
27
+ message_id: z.string().describe('The serialized ID of the message (e.g., true_123456789@c.us_ABCDEFGHIJKL)'),
28
+ }, async ({ message_id }) => {
29
+ try {
30
+ const message = await whatsappService.getMessageById(message_id);
31
+ if (!message) {
32
+ return {
33
+ content: [{ type: 'text', text: `Message not found for ID: ${message_id}` }],
34
+ isError: true,
35
+ };
36
+ }
37
+ return {
38
+ content: [{ type: 'text', text: JSON.stringify(message, null, 2) }],
39
+ };
40
+ }
41
+ catch (error) {
42
+ log.error(`Error in get_message_by_id tool for ID ${message_id}:`, error);
43
+ return {
44
+ content: [{ type: 'text', text: `Error getting message ${message_id}: ${error.message}` }],
45
+ isError: true,
46
+ };
47
+ }
48
+ });
49
+ // get_message_context is complex with whatsapp-web.js as it requires fetching messages around a specific one.
50
+ // A simple implementation might fetch N messages before/after based on timestamp, but exact context is hard.
51
+ // Let's implement a version that fetches recent messages and identifies the target.
52
+ server.tool('get_message_context', 'Get recent messages around a specific message ID within its chat (context accuracy depends on fetch limit).', {
53
+ message_id: z.string().describe('The serialized ID of the target message'),
54
+ limit: z.number().int().positive().optional().default(20).describe('Number of recent messages to fetch for context'),
55
+ }, async ({ message_id, limit }) => {
56
+ try {
57
+ // First, get the target message to find its chat ID
58
+ const targetMessage = await whatsappService.getMessageById(message_id);
59
+ if (!targetMessage) {
60
+ return {
61
+ content: [{ type: 'text', text: `Target message not found: ${message_id}` }],
62
+ isError: true,
63
+ };
64
+ }
65
+ // Fetch recent messages from the same chat
66
+ const recentMessages = await whatsappService.getMessages(targetMessage.to, limit);
67
+ // Find the index of the target message
68
+ const targetIndex = recentMessages.findIndex(msg => msg.id === message_id);
69
+ // Structure the context (this is approximate)
70
+ const context = {
71
+ targetMessage: targetMessage,
72
+ // Note: 'before' and 'after' here are just messages fetched chronologically,
73
+ // not necessarily the exact messages before/after in the full history.
74
+ contextMessages: recentMessages,
75
+ targetIndex: targetIndex, // Index within the fetched contextMessages array
76
+ };
77
+ return {
78
+ content: [{ type: 'text', text: JSON.stringify(context, null, 2) }],
79
+ };
80
+ }
81
+ catch (error) {
82
+ log.error(`Error in get_message_context tool for message ${message_id}:`, error);
83
+ return {
84
+ content: [{ type: 'text', text: `Error getting context for message ${message_id}: ${error.message}` }],
85
+ isError: true,
86
+ };
87
+ }
88
+ });
89
+ // get_last_interaction is similar to list_chats with limit 1
90
+ server.tool('get_last_interaction', 'Get the most recent event involving a specific contact or group JID. IMPORTANT: this returns the newest event of ANY type - including call logs, media, and system notifications, which have an empty "body" - NOT necessarily the last text message. To read what was actually said, use list_messages instead.', {
91
+ jid: z.string().describe('The JID of the contact or group (e.g., 123456789@c.us or 123456789-12345678@g.us)'),
92
+ }, async ({ jid }) => {
93
+ try {
94
+ // Fetch the chat to get the last message
95
+ const chat = await whatsappService.getChatById(jid);
96
+ if (!chat || !chat.lastMessage) {
97
+ return {
98
+ content: [{ type: 'text', text: `No recent interaction found for JID: ${jid}` }],
99
+ isError: true, // Consider if this should be an error or just empty result
100
+ };
101
+ }
102
+ return {
103
+ content: [{ type: 'text', text: JSON.stringify(chat.lastMessage, null, 2) }],
104
+ };
105
+ }
106
+ catch (error) {
107
+ log.error(`Error in get_last_interaction tool for JID ${jid}:`, error);
108
+ return {
109
+ content: [{ type: 'text', text: `Error getting last interaction for ${jid}: ${error.message}` }],
110
+ isError: true,
111
+ };
112
+ }
113
+ });
114
+ server.tool('send_message', 'Send a WhatsApp text message to a person or group.', {
115
+ recipient_jid: z.string().describe('The recipient JID (e.g., 123456789@c.us or 123456789-12345678@g.us)'),
116
+ message: z.string().describe('The message text to send'),
117
+ }, async ({ recipient_jid, message }) => {
118
+ try {
119
+ const sentMessage = await whatsappService.sendMessage(recipient_jid, message);
120
+ // Return confirmation or details of the sent message
121
+ const result = {
122
+ success: true,
123
+ message: 'Message sent successfully.',
124
+ messageId: sentMessage.id._serialized,
125
+ timestamp: sentMessage.timestamp,
126
+ };
127
+ return {
128
+ content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
129
+ };
130
+ }
131
+ catch (error) {
132
+ log.error(`Error in send_message tool to ${recipient_jid}:`, error);
133
+ return {
134
+ content: [{ type: 'text', text: `Error sending message to ${recipient_jid}: ${error.message}` }],
135
+ isError: true,
136
+ };
137
+ }
138
+ });
139
+ log.info('Message tools registered.');
140
+ }
141
+ //# sourceMappingURL=messages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/tools/messages.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAIzC,MAAM,UAAU,oBAAoB,CAClC,MAAiB,EACjB,eAAgC;IAEhC,GAAG,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC;IAEzC,MAAM,CAAC,I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AW,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;YAC3F,qDAAqD;YACrD,MAAM,MAAM,GAAG;gBACb,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE,4BAA4B;gBACrC,SAAS,EAAE,WAAW,CAAC,EAAE,CAAC,WAAW;gBACrC,SAAS,EAAE,WAAW,CAAC,SAAS;aACjC,CAAC;YACF,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;aACnE,CAAC;QACJ,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,GAAG,CAAC,KAAK,CAAC,iCAAiC,aAAa,GAAG,EAAE,KAAK,CAAC,CAAC;YACpE,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,4BAA4B,aAAa,KAAK,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC;gBAChG,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;IAEF,GAAG,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;AACxC,CAAC"}
@@ -0,0 +1 @@
1
+ export * from './whatsapp.js';
@@ -0,0 +1,3 @@
1
+ export * from './whatsapp.js';
2
+ // Export other type files if created
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,qCAAqC"}
@@ -0,0 +1,16 @@
1
+ export type { SimpleChat, SimpleContact, SimpleMessage, } from '../services/whatsapp.js';
2
+ export interface MediaDownloadResult {
3
+ success: boolean;
4
+ message: string;
5
+ mimeType?: string;
6
+ base64Data?: string;
7
+ filename?: string;
8
+ tempPath?: string;
9
+ }
10
+ export interface SendMediaResult {
11
+ success: boolean;
12
+ message: string;
13
+ messageId?: string;
14
+ timestamp?: number;
15
+ filePathUsed?: string | undefined;
16
+ }
@@ -0,0 +1,5 @@
1
+ // Re-exporting simplified types defined in WhatsAppService for clarity
2
+ // Or define more complex/specific types here if needed.
3
+ export {};
4
+ // Add any other WhatsApp-specific types required by your tools or services.
5
+ //# sourceMappingURL=whatsapp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"whatsapp.js","sourceRoot":"","sources":["../../src/types/whatsapp.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,wDAAwD;;AA0BxD,4EAA4E"}
@@ -0,0 +1,23 @@
1
+ export declare class AudioUtils {
2
+ /**
3
+ * Convert an audio file to Opus format in an Ogg container using ffmpeg.
4
+ * Throws an error if ffmpeg is not found or conversion fails.
5
+ *
6
+ * @param inputPath Path to the input audio file.
7
+ * @param outputPath Optional path for the output file. Defaults to input path with .ogg extension.
8
+ * @param bitrate Target bitrate (e.g., "32k").
9
+ * @param sampleRate Target sample rate (e.g., 24000).
10
+ * @returns Path to the converted file.
11
+ */
12
+ static convertToOpusOgg(inputPath: string, outputPath?: string, bitrate?: string, sampleRate?: number): Promise<string>;
13
+ /**
14
+ * Converts an audio file to Opus/Ogg and saves it to a temporary file.
15
+ * Useful when you need a temporary .ogg file for sending.
16
+ *
17
+ * @param inputPath Path to the input audio file.
18
+ * @param bitrate Target bitrate.
19
+ * @param sampleRate Target sample rate.
20
+ * @returns Path to the temporary converted file.
21
+ */
22
+ static convertToOpusOggTemp(inputPath: string, bitrate?: string, sampleRate?: number): Promise<string>;
23
+ }
@@ -0,0 +1,99 @@
1
+ import ffmpeg from 'fluent-ffmpeg';
2
+ import { createRequire } from 'module';
3
+ import fs from 'fs';
4
+ import path from 'path';
5
+ import os from 'os';
6
+ import { log } from './logger.js';
7
+ // ffmpeg-static is CommonJS (module.exports = <path string>), so load it via
8
+ // require to get correct typings under NodeNext module resolution.
9
+ const require = createRequire(import.meta.url);
10
+ const ffmpegStatic = require('ffmpeg-static');
11
+ // Resolution order: FFMPEG_PATH env var (manual override) -> binary bundled
12
+ // by ffmpeg-static (installed automatically with npm install) -> system PATH.
13
+ const FFMPEG_PATH = process.env.FFMPEG_PATH || ffmpegStatic || null;
14
+ if (FFMPEG_PATH) {
15
+ ffmpeg.setFfmpegPath(FFMPEG_PATH);
16
+ // Expose the resolved path so fluent-ffmpeg usages inside whatsapp-web.js
17
+ // (video/sticker conversion) pick up the same binary.
18
+ process.env.FFMPEG_PATH = FFMPEG_PATH;
19
+ log.info(`Using ffmpeg at: ${FFMPEG_PATH}`);
20
+ }
21
+ else {
22
+ log.warn('No ffmpeg binary found. Audio conversion will rely on ffmpeg being in the system PATH.');
23
+ }
24
+ export class AudioUtils {
25
+ /**
26
+ * Convert an audio file to Opus format in an Ogg container using ffmpeg.
27
+ * Throws an error if ffmpeg is not found or conversion fails.
28
+ *
29
+ * @param inputPath Path to the input audio file.
30
+ * @param outputPath Optional path for the output file. Defaults to input path with .ogg extension.
31
+ * @param bitrate Target bitrate (e.g., "32k").
32
+ * @param sampleRate Target sample rate (e.g., 24000).
33
+ * @returns Path to the converted file.
34
+ */
35
+ static convertToOpusOgg(inputPath, outputPath, bitrate = '32k', sampleRate = 24000) {
36
+ return new Promise((resolve, reject) => {
37
+ if (!fs.existsSync(inputPath)) {
38
+ return reject(new Error(`Input file not found: ${inputPath}`));
39
+ }
40
+ const finalOutputPath = outputPath || `${path.parse(inputPath).name}.ogg`;
41
+ const outputDir = path.dirname(finalOutputPath);
42
+ if (!fs.existsSync(outputDir)) {
43
+ fs.mkdirSync(outputDir, { recursive: true });
44
+ }
45
+ log.debug(`Starting ffmpeg conversion: ${inputPath} -> ${finalOutputPath}`);
46
+ ffmpeg(inputPath)
47
+ .audioCodec('libopus')
48
+ .audioBitrate(bitrate)
49
+ .audioFrequency(sampleRate)
50
+ .outputOptions([
51
+ '-application voip', // Optimize for voice
52
+ '-vbr on', // Variable bitrate
53
+ '-compression_level 10', // Max compression
54
+ '-frame_duration 60', // Good frame duration for voice
55
+ ])
56
+ .output(finalOutputPath)
57
+ .on('end', () => {
58
+ log.debug(`ffmpeg conversion finished: ${finalOutputPath}`);
59
+ resolve(finalOutputPath);
60
+ })
61
+ .on('error', (err) => {
62
+ log.error(`ffmpeg conversion error for ${inputPath}:`, err);
63
+ reject(new Error(`ffmpeg conversion failed: ${err.message}`));
64
+ })
65
+ .run();
66
+ });
67
+ }
68
+ /**
69
+ * Converts an audio file to Opus/Ogg and saves it to a temporary file.
70
+ * Useful when you need a temporary .ogg file for sending.
71
+ *
72
+ * @param inputPath Path to the input audio file.
73
+ * @param bitrate Target bitrate.
74
+ * @param sampleRate Target sample rate.
75
+ * @returns Path to the temporary converted file.
76
+ */
77
+ static async convertToOpusOggTemp(inputPath, bitrate = '32k', sampleRate = 24000) {
78
+ const tempFileName = `whatsapp_audio_converted_${Date.now()}.ogg`;
79
+ const tempOutputPath = path.join(os.tmpdir(), tempFileName);
80
+ log.debug(`Converting ${inputPath} to temporary file: ${tempOutputPath}`);
81
+ try {
82
+ const convertedPath = await this.convertToOpusOgg(inputPath, tempOutputPath, bitrate, sampleRate);
83
+ return convertedPath;
84
+ }
85
+ catch (error) {
86
+ // Clean up temp file if conversion failed partway
87
+ if (fs.existsSync(tempOutputPath)) {
88
+ try {
89
+ fs.unlinkSync(tempOutputPath);
90
+ }
91
+ catch (cleanupError) {
92
+ log.warn(`Failed to clean up temporary file ${tempOutputPath}:`, cleanupError);
93
+ }
94
+ }
95
+ throw error; // Re-throw the original conversion error
96
+ }
97
+ }
98
+ }
99
+ //# sourceMappingURL=audio.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audio.js","sourceRoot":"","sources":["../../src/utils/audio.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,eAAe,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,C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E,CAAC,MAAM,EAAE,EAAE,YAAY,CAAC,CAAC;QAC5D,GAAG,CAAC,KAAK,CAAC,cAAc,SAAS,uBAAuB,cAAc,EAAE,CAAC,CAAC;QAC1E,IAAI,CAAC;YACD,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,cAAc,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;YAClG,OAAO,aAAa,CAAC;QACzB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,kDAAkD;YAClD,IAAI,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,CAAC;gBAChC,IAAI,CAAC;oBACD,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;gBAClC,CAAC;gBAAC,OAAO,YAAY,EAAE,CAAC;oBACpB,GAAG,CAAC,IAAI,CAAC,qCAAqC,cAAc,GAAG,EAAE,YAAY,CAAC,CAAC;gBACnF,CAAC;YACL,CAAC;YACD,MAAM,KAAK,CAAC,CAAC,yCAAyC;QAC1D,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Resolve the browser executable to use for whatsapp-web.js.
3
+ *
4
+ * Resolution order:
5
+ * 1. BROWSER_EXECUTABLE_PATH env var (or legacy CHROME_EXECUTABLE_PATH)
6
+ * 2. Auto-detected Chrome or Edge in standard install locations
7
+ * 3. undefined - puppeteer falls back to its bundled Chromium
8
+ * (video/GIF sending will not work: bundled Chromium lacks H.264/AAC)
9
+ *
10
+ * @returns Absolute path to a browser executable, or undefined if none found.
11
+ */
12
+ export declare function findBrowserExecutable(): string | undefined;