@inkeep/agents-manage-ui 0.7.2 → 0.8.1

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 (151) hide show
  1. package/.next/standalone/agents-manage-ui/.next/BUILD_ID +1 -1
  2. package/.next/standalone/agents-manage-ui/.next/app-build-manifest.json +102 -102
  3. package/.next/standalone/agents-manage-ui/.next/app-path-routes-manifest.json +5 -5
  4. package/.next/standalone/agents-manage-ui/.next/build-manifest.json +2 -2
  5. package/.next/standalone/agents-manage-ui/.next/prerender-manifest.json +15 -15
  6. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/page.js +1 -1
  7. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/page_client-reference-manifest.js +1 -1
  8. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/api-keys/page.js +3 -3
  9. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/api-keys/page_client-reference-manifest.js +1 -1
  10. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/artifact-components/[artifactComponentId]/page.js +1 -1
  11. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/artifact-components/[artifactComponentId]/page.js.nft.json +1 -1
  12. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/artifact-components/[artifactComponentId]/page_client-reference-manifest.js +1 -1
  13. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/artifact-components/new/page.js +2 -2
  14. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/artifact-components/new/page.js.nft.json +1 -1
  15. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/artifact-components/new/page_client-reference-manifest.js +1 -1
  16. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/artifact-components/page.js +2 -2
  17. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/artifact-components/page_client-reference-manifest.js +1 -1
  18. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/credentials/[credentialId]/page.js +1 -1
  19. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/credentials/[credentialId]/page.js.nft.json +1 -1
  20. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/credentials/[credentialId]/page_client-reference-manifest.js +1 -1
  21. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/credentials/new/bearer/page.js +2 -2
  22. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/credentials/new/bearer/page.js.nft.json +1 -1
  23. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/credentials/new/bearer/page_client-reference-manifest.js +1 -1
  24. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/credentials/new/page.js +1 -1
  25. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/credentials/new/page_client-reference-manifest.js +1 -1
  26. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/credentials/new/providers/[providerId]/page.js +1 -1
  27. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/credentials/new/providers/[providerId]/page.js.nft.json +1 -1
  28. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/credentials/new/providers/[providerId]/page_client-reference-manifest.js +1 -1
  29. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/credentials/new/providers/page.js +2 -2
  30. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/credentials/new/providers/page.js.nft.json +1 -1
  31. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/credentials/new/providers/page_client-reference-manifest.js +1 -1
  32. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/credentials/page.js +2 -2
  33. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/credentials/page_client-reference-manifest.js +1 -1
  34. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/data-components/[dataComponentId]/page.js +1 -1
  35. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/data-components/[dataComponentId]/page.js.nft.json +1 -1
  36. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/data-components/[dataComponentId]/page_client-reference-manifest.js +1 -1
  37. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/data-components/new/page.js +2 -2
  38. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/data-components/new/page.js.nft.json +1 -1
  39. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/data-components/new/page_client-reference-manifest.js +1 -1
  40. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/data-components/page.js +2 -2
  41. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/data-components/page_client-reference-manifest.js +1 -1
  42. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/graphs/[graphId]/page.js +2 -2
  43. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/graphs/[graphId]/page.js.nft.json +1 -1
  44. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/graphs/[graphId]/page_client-reference-manifest.js +1 -1
  45. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/graphs/new/page.js +2 -2
  46. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/graphs/new/page_client-reference-manifest.js +1 -1
  47. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/graphs/page.js +2 -2
  48. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/graphs/page_client-reference-manifest.js +1 -1
  49. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/mcp-servers/[mcpServerId]/edit/page.js +2 -2
  50. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/mcp-servers/[mcpServerId]/edit/page.js.nft.json +1 -1
  51. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/mcp-servers/[mcpServerId]/edit/page_client-reference-manifest.js +1 -1
  52. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/mcp-servers/[mcpServerId]/page.js +2 -2
  53. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/mcp-servers/[mcpServerId]/page_client-reference-manifest.js +1 -1
  54. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/mcp-servers/new/page.js +2 -2
  55. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/mcp-servers/new/page.js.nft.json +1 -1
  56. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/mcp-servers/new/page_client-reference-manifest.js +1 -1
  57. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/mcp-servers/page.js +2 -2
  58. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/mcp-servers/page_client-reference-manifest.js +1 -1
  59. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/page.js +2 -2
  60. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/page_client-reference-manifest.js +1 -1
  61. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/settings/page.js +2 -2
  62. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/settings/page_client-reference-manifest.js +1 -1
  63. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/traces/ai-calls/page.js +2 -2
  64. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/traces/ai-calls/page.js.nft.json +1 -1
  65. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/traces/ai-calls/page_client-reference-manifest.js +1 -1
  66. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/traces/conversations/[conversationId]/page.js +2 -2
  67. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/traces/conversations/[conversationId]/page_client-reference-manifest.js +1 -1
  68. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/traces/page.js +2 -2
  69. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/traces/page.js.nft.json +1 -1
  70. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/traces/page_client-reference-manifest.js +1 -1
  71. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/page.js +2 -2
  72. package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/page_client-reference-manifest.js +1 -1
  73. package/.next/standalone/agents-manage-ui/.next/server/app/_not-found/page.js +2 -2
  74. package/.next/standalone/agents-manage-ui/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  75. package/.next/standalone/agents-manage-ui/.next/server/app/_not-found.html +1 -1
  76. package/.next/standalone/agents-manage-ui/.next/server/app/_not-found.rsc +8 -8
  77. package/.next/standalone/agents-manage-ui/.next/server/app/api/signoz/conversations/[conversationId]/route_client-reference-manifest.js +1 -1
  78. package/.next/standalone/agents-manage-ui/.next/server/app/api/signoz/route_client-reference-manifest.js +1 -1
  79. package/.next/standalone/agents-manage-ui/.next/server/app/page.js +2 -2
  80. package/.next/standalone/agents-manage-ui/.next/server/app/page_client-reference-manifest.js +1 -1
  81. package/.next/standalone/agents-manage-ui/.next/server/app-paths-manifest.json +5 -5
  82. package/.next/standalone/agents-manage-ui/.next/server/chunks/2124.js +3 -3
  83. package/.next/standalone/agents-manage-ui/.next/server/chunks/{5260.js → 3080.js} +1 -1
  84. package/.next/standalone/agents-manage-ui/.next/server/chunks/3547.js +1 -1
  85. package/.next/standalone/agents-manage-ui/.next/server/chunks/3686.js +1 -0
  86. package/.next/standalone/agents-manage-ui/.next/server/chunks/3791.js +1 -0
  87. package/.next/standalone/agents-manage-ui/.next/server/chunks/404.js +1 -0
  88. package/.next/standalone/agents-manage-ui/.next/server/chunks/5232.js +1 -1
  89. package/.next/standalone/agents-manage-ui/.next/server/chunks/71.js +2 -2
  90. package/.next/standalone/agents-manage-ui/.next/server/chunks/7818.js +1 -0
  91. package/.next/standalone/agents-manage-ui/.next/server/chunks/8449.js +2 -2
  92. package/.next/standalone/agents-manage-ui/.next/server/chunks/9210.js +1 -0
  93. package/.next/standalone/agents-manage-ui/.next/server/pages/404.html +1 -1
  94. package/.next/standalone/agents-manage-ui/.next/server/pages/500.html +1 -1
  95. package/.next/standalone/agents-manage-ui/.next/server/server-reference-manifest.js +1 -1
  96. package/.next/standalone/agents-manage-ui/.next/server/server-reference-manifest.json +1 -1
  97. package/.next/standalone/agents-manage-ui/.next/static/chunks/3208-53d5998fe548a3e4.js +1 -0
  98. package/.next/standalone/agents-manage-ui/.next/static/chunks/6497-3fa2630d8e8ff958.js +1 -0
  99. package/.next/standalone/agents-manage-ui/.next/static/chunks/7167-87078a0197464832.js +1 -0
  100. package/.next/standalone/agents-manage-ui/.next/static/chunks/8458-bdc1cf68e2d13eda.js +1 -0
  101. package/.next/standalone/agents-manage-ui/.next/static/chunks/9816-02452b9a92f478de.js +1 -0
  102. package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/api-keys/{page-f8c7498c5cb8caf3.js → page-a55bc3ed24daae2f.js} +1 -1
  103. package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/artifact-components/[artifactComponentId]/{page-cd9f3056c50c6a42.js → page-b5da6700403ff374.js} +1 -1
  104. package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/artifact-components/new/{page-cd9f3056c50c6a42.js → page-b5da6700403ff374.js} +1 -1
  105. package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/artifact-components/page-f4a0f7e9543d8480.js +1 -0
  106. package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/credentials/[credentialId]/page-839e6b383a826a76.js +1 -0
  107. package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/credentials/new/bearer/page-a8e240bc6cf2ef59.js +1 -0
  108. package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/credentials/new/providers/[providerId]/page-dde463979e9dbc89.js +1 -0
  109. package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/credentials/{page-0c7c37247598a8b4.js → page-7fea5166844e2400.js} +1 -1
  110. package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/data-components/[dataComponentId]/{page-980ff492870685e8.js → page-36236acd9104e893.js} +1 -1
  111. package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/data-components/new/{page-980ff492870685e8.js → page-36236acd9104e893.js} +1 -1
  112. package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/data-components/page-600b0ed5c06531dc.js +1 -0
  113. package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/graphs/{page-84f99971442558d0.js → page-f318881eef71e221.js} +1 -1
  114. package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/mcp-servers/[mcpServerId]/edit/{page-ff58a0a0f46cedb4.js → page-99dcb7b369050a34.js} +1 -1
  115. package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/mcp-servers/new/{page-383d5e073ecb1090.js → page-e2fe56243e487ffe.js} +1 -1
  116. package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/mcp-servers/page-5b6387f3771508ac.js +1 -0
  117. package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/settings/{page-66de1bf9a6afb8db.js → page-bc77e94675276789.js} +1 -1
  118. package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/traces/page-f2c50f4dbcf729bc.js +1 -0
  119. package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/page-3ee642e1f54a32ad.js +1 -0
  120. package/.next/standalone/agents-manage-ui/.next/static/chunks/app/layout-4804c76840209a96.js +1 -0
  121. package/.next/standalone/agents-manage-ui/package.json +1 -1
  122. package/.next/standalone/packages/agents-core/package.json +1 -1
  123. package/package.json +4 -4
  124. package/src/components/graph/graph.tsx +57 -7
  125. package/src/components/graph/sidepane/nodes/mcp-node-editor.tsx +68 -0
  126. package/src/components/graph/sidepane/sidepane.tsx +5 -0
  127. package/src/components/projects/form/project-form.tsx +1 -0
  128. package/src/features/graph/domain/__tests__/serialize.test.ts +4 -0
  129. package/src/features/graph/domain/deserialize.ts +12 -1
  130. package/src/features/graph/domain/serialize.ts +29 -8
  131. package/.next/standalone/agents-manage-ui/.next/server/chunks/224.js +0 -1
  132. package/.next/standalone/agents-manage-ui/.next/server/chunks/4379.js +0 -1
  133. package/.next/standalone/agents-manage-ui/.next/server/chunks/5686.js +0 -1
  134. package/.next/standalone/agents-manage-ui/.next/server/chunks/6750.js +0 -1
  135. package/.next/standalone/agents-manage-ui/.next/server/chunks/8005.js +0 -1
  136. package/.next/standalone/agents-manage-ui/.next/static/chunks/4945-c13f309fabcbd97d.js +0 -1
  137. package/.next/standalone/agents-manage-ui/.next/static/chunks/6367-70b79c3bf09c948c.js +0 -1
  138. package/.next/standalone/agents-manage-ui/.next/static/chunks/6497-b90b21b559925fc6.js +0 -1
  139. package/.next/standalone/agents-manage-ui/.next/static/chunks/7167-95bc2d6f58fa4f49.js +0 -1
  140. package/.next/standalone/agents-manage-ui/.next/static/chunks/9317-ae3b10cf533e419f.js +0 -1
  141. package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/artifact-components/page-44b5beb15688df77.js +0 -1
  142. package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/credentials/[credentialId]/page-be1a24b6cfabfb7e.js +0 -1
  143. package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/credentials/new/bearer/page-741c91248af1c356.js +0 -1
  144. package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/credentials/new/providers/[providerId]/page-d89e95483ecf8eba.js +0 -1
  145. package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/data-components/page-c2b135ef335f1345.js +0 -1
  146. package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/mcp-servers/page-67b1a93066a9459e.js +0 -1
  147. package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/traces/page-7e37209e3c59560d.js +0 -1
  148. package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/page-ce7ad1f09ed7d10c.js +0 -1
  149. package/.next/standalone/agents-manage-ui/.next/static/chunks/app/layout-e076524dcc9f9526.js +0 -1
  150. /package/.next/standalone/agents-manage-ui/.next/static/{XhyddBkJQ1Fo3yt6OpEs8 → KsMqiaHOvY4o9nCLYVuGM}/_buildManifest.js +0 -0
  151. /package/.next/standalone/agents-manage-ui/.next/static/{XhyddBkJQ1Fo3yt6OpEs8 → KsMqiaHOvY4o9nCLYVuGM}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6497],{7768:(e,t,n)=>{n.d(t,{Ns:()=>a.Ns,o7:()=>a.o7});var a=n(14409)},14409:(e,t,n)=>{n.d(t,{IB:()=>o,L3:()=>a,Ns:()=>d,W0:()=>i,o7:()=>r});let a=["healthy","unhealthy","unknown","needs_auth"],o=["transfer","delegate"],r={streamableHttp:"streamable_http",sse:"sse"},i={nango:"nango",generic:"generic"},d={memory:"memory",keychain:"keychain",nango:"nango"}},23574:(e,t,n)=>{n.d(t,{a:()=>i});var a=n(60098),o=n(34186),r=n(35613);function i(e){let{control:t,name:n,label:i,placeholder:d,type:l="text",min:s,disabled:c,description:p,isRequired:u=!1}=e;return(0,a.jsx)(r.u,{control:t,name:n,label:i,description:p,isRequired:u,children:e=>{var t;return(0,a.jsx)(o.p,{type:l,placeholder:d,min:s,disabled:c,...e,value:null!=(t=e.value)?t:"",onChange:t=>{let n=t.target.value;"number"===l?e.onChange(""===n?void 0:Number(n)):e.onChange(n)}})}})}},35613:(e,t,n)=>{n.d(t,{u:()=>r});var a=n(60098),o=n(86312);function r(e){let{control:t,name:n,label:r,children:i,description:d,rules:l,isRequired:s}=e;return(0,a.jsx)(o.zB,{control:t,name:n,rules:l,render:e=>{let{field:t}=e;return(0,a.jsxs)(o.eI,{className:"relative",children:[(0,a.jsx)(o.lR,{isRequired:s,children:r}),(0,a.jsx)(o.MJ,{children:i(t)}),d&&(0,a.jsx)(o.Rr,{children:d}),(0,a.jsx)(o.C5,{})]})}})}},82886:(e,t,n)=>{n.d(t,{Ns:()=>o.Ns,o7:()=>o.o7,cA:()=>eQ,K_:()=>t5});var a=n(29583),o=n(7768),r=n(66688),i=n(43336),d=n(14290),l=n(63541),s=n(60865),c=n(55895),p=n(88362),u=n(8640),m=n(71038),g=n(78162),I=n(77177),f=n(80711),_=n(64130);function j(){let e=(0,d._)(["CURRENT_TIMESTAMP"]);return j=function(){return e},e}function N(){let e=(0,d._)(["CURRENT_TIMESTAMP"]);return N=function(){return e},e}function q(){let e=(0,d._)(["CURRENT_TIMESTAMP"]);return q=function(){return e},e}function x(){let e=(0,d._)(["CURRENT_TIMESTAMP"]);return x=function(){return e},e}function z(){let e=(0,d._)(["CURRENT_TIMESTAMP"]);return z=function(){return e},e}function Q(){let e=(0,d._)(["CURRENT_TIMESTAMP"]);return Q=function(){return e},e}function h(){let e=(0,d._)(["CURRENT_TIMESTAMP"]);return h=function(){return e},e}function T(){let e=(0,d._)(["CURRENT_TIMESTAMP"]);return T=function(){return e},e}function A(){let e=(0,d._)(["CURRENT_TIMESTAMP"]);return A=function(){return e},e}function y(){let e=(0,d._)(["CURRENT_TIMESTAMP"]);return y=function(){return e},e}function b(){let e=(0,d._)(["CURRENT_TIMESTAMP"]);return b=function(){return e},e}function C(){let e=(0,d._)(["CURRENT_TIMESTAMP"]);return C=function(){return e},e}function k(){let e=(0,d._)(["CURRENT_TIMESTAMP"]);return k=function(){return e},e}function R(){let e=(0,d._)(["CURRENT_TIMESTAMP"]);return R=function(){return e},e}function v(){let e=(0,d._)(["CURRENT_TIMESTAMP"]);return v=function(){return e},e}function M(){let e=(0,d._)(["CURRENT_TIMESTAMP"]);return M=function(){return e},e}function E(){let e=(0,d._)(["CURRENT_TIMESTAMP"]);return E=function(){return e},e}function P(){let e=(0,d._)(["CURRENT_TIMESTAMP"]);return P=function(){return e},e}function U(){let e=(0,d._)(["CURRENT_TIMESTAMP"]);return U=function(){return e},e}function S(){let e=(0,d._)(["CURRENT_TIMESTAMP"]);return S=function(){return e},e}function D(){let e=(0,d._)(["CURRENT_TIMESTAMP"]);return D=function(){return e},e}function w(){let e=(0,d._)(["CURRENT_TIMESTAMP"]);return w=function(){return e},e}function $(){let e=(0,d._)(["CURRENT_TIMESTAMP"]);return $=function(){return e},e}function K(){let e=(0,d._)(["CURRENT_TIMESTAMP"]);return K=function(){return e},e}function J(){let e=(0,d._)(["CURRENT_TIMESTAMP"]);return J=function(){return e},e}function O(){let e=(0,d._)(["CURRENT_TIMESTAMP"]);return O=function(){return e},e}function G(){let e=(0,d._)(["CURRENT_TIMESTAMP"]);return G=function(){return e},e}function W(){let e=(0,d._)(["CURRENT_TIMESTAMP"]);return W=function(){return e},e}function H(){let e=(0,d._)(["CURRENT_TIMESTAMP"]);return H=function(){return e},e}function L(){let e=(0,d._)(["CURRENT_TIMESTAMP"]);return L=function(){return e},e}function F(){let e=(0,d._)(["CURRENT_TIMESTAMP"]);return F=function(){return e},e}function B(){let e=(0,d._)(["CURRENT_TIMESTAMP"]);return B=function(){return e},e}function V(){let e=(0,d._)(["CURRENT_TIMESTAMP"]);return V=function(){return e},e}function Z(){let e=(0,d._)(["CURRENT_TIMESTAMP"]);return Z=function(){return e},e}function X(){let e=(0,d._)(["CURRENT_TIMESTAMP"]);return X=function(){return e},e}function Y(){let e=(0,d._)(["CURRENT_TIMESTAMP"]);return Y=function(){return e},e}function ee(){let e=(0,d._)(["CURRENT_TIMESTAMP"]);return ee=function(){return e},e}function et(){let e=(0,d._)(["CURRENT_TIMESTAMP"]);return et=function(){return e},e}let en=(0,c.D)("projects",{tenantId:(0,p.Qq)("tenant_id").notNull(),id:(0,p.Qq)("id").notNull(),name:(0,p.Qq)("name").notNull(),description:(0,p.Qq)("description").notNull(),models:(0,p.Qq)("models",{mode:"json"}).$type(),stopWhen:(0,p.Qq)("stop_when",{mode:"json"}).$type(),createdAt:(0,p.Qq)("created_at").notNull().default((0,l.ll)(j())),updatedAt:(0,p.Qq)("updated_at").notNull().default((0,l.ll)(N()))},e=>[(0,u.ie)({columns:[e.tenantId,e.id]})]),ea=(0,c.D)("agent_graph",{tenantId:(0,p.Qq)("tenant_id").notNull(),projectId:(0,p.Qq)("project_id").notNull(),id:(0,p.Qq)("id").notNull(),name:(0,p.Qq)("name").notNull(),description:(0,p.Qq)("description"),defaultAgentId:(0,p.Qq)("default_agent_id"),contextConfigId:(0,p.Qq)("context_config_id"),models:(0,p.Qq)("models",{mode:"json"}).$type(),statusUpdates:(0,p.Qq)("status_updates",{mode:"json"}).$type(),graphPrompt:(0,p.Qq)("graph_prompt"),stopWhen:(0,p.Qq)("stop_when",{mode:"json"}).$type(),createdAt:(0,p.Qq)("created_at").notNull().default((0,l.ll)(q())),updatedAt:(0,p.Qq)("updated_at").notNull().default((0,l.ll)(x()))},e=>[(0,u.ie)({columns:[e.tenantId,e.projectId,e.id]}),(0,m.mt)({columns:[e.tenantId,e.projectId],foreignColumns:[en.tenantId,en.id],name:"agent_graph_project_fk"}).onDelete("cascade")]),eo=(0,c.D)("context_configs",{tenantId:(0,p.Qq)("tenant_id").notNull(),projectId:(0,p.Qq)("project_id").notNull(),id:(0,p.Qq)("id").notNull(),name:(0,p.Qq)("name").notNull(),description:(0,p.Qq)("description").notNull(),requestContextSchema:(0,g.av)("request_context_schema",{mode:"json"}).$type(),contextVariables:(0,g.av)("context_variables",{mode:"json"}).$type(),createdAt:(0,p.Qq)("created_at").notNull().default((0,l.ll)(z())),updatedAt:(0,p.Qq)("updated_at").notNull().default((0,l.ll)(Q()))},e=>[(0,u.ie)({columns:[e.tenantId,e.projectId,e.id]}),(0,m.mt)({columns:[e.tenantId,e.projectId],foreignColumns:[en.tenantId,en.id],name:"context_configs_project_fk"}).onDelete("cascade")]),er=(0,c.D)("context_cache",{tenantId:(0,p.Qq)("tenant_id").notNull(),projectId:(0,p.Qq)("project_id").notNull(),id:(0,p.Qq)("id").notNull(),conversationId:(0,p.Qq)("conversation_id").notNull(),contextConfigId:(0,p.Qq)("context_config_id").notNull(),contextVariableKey:(0,p.Qq)("context_variable_key").notNull(),value:(0,g.av)("value",{mode:"json"}).$type().notNull(),requestHash:(0,p.Qq)("request_hash"),fetchedAt:(0,p.Qq)("fetched_at").notNull(),fetchSource:(0,p.Qq)("fetch_source"),fetchDurationMs:(0,I.nd)("fetch_duration_ms"),createdAt:(0,p.Qq)("created_at").notNull().default((0,l.ll)(h())),updatedAt:(0,p.Qq)("updated_at").notNull().default((0,l.ll)(T()))},e=>[(0,u.ie)({columns:[e.tenantId,e.projectId,e.id]}),(0,m.mt)({columns:[e.tenantId,e.projectId],foreignColumns:[en.tenantId,en.id],name:"context_cache_project_fk"}).onDelete("cascade"),(0,f.Pe)("context_cache_lookup_idx").on(e.conversationId,e.contextConfigId,e.contextVariableKey)]),ei=(0,c.D)("agents",{tenantId:(0,p.Qq)("tenant_id").notNull(),projectId:(0,p.Qq)("project_id").notNull(),graphId:(0,p.Qq)("graph_id").notNull(),id:(0,p.Qq)("id").notNull(),name:(0,p.Qq)("name").notNull(),description:(0,p.Qq)("description").notNull(),prompt:(0,p.Qq)("prompt").notNull(),conversationHistoryConfig:(0,p.Qq)("conversation_history_config",{mode:"json"}).$type(),models:(0,p.Qq)("models",{mode:"json"}).$type(),stopWhen:(0,p.Qq)("stop_when",{mode:"json"}).$type(),createdAt:(0,p.Qq)("created_at").notNull().default((0,l.ll)(A())),updatedAt:(0,p.Qq)("updated_at").notNull().default((0,l.ll)(y()))},e=>[(0,u.ie)({columns:[e.tenantId,e.projectId,e.graphId,e.id]}),(0,m.mt)({columns:[e.tenantId,e.projectId,e.graphId],foreignColumns:[ea.tenantId,ea.projectId,ea.id],name:"agents_graph_fk"}).onDelete("cascade")]),ed=(0,c.D)("agent_relations",{tenantId:(0,p.Qq)("tenant_id").notNull(),projectId:(0,p.Qq)("project_id").notNull(),graphId:(0,p.Qq)("graph_id").notNull(),id:(0,p.Qq)("id").notNull(),sourceAgentId:(0,p.Qq)("source_agent_id").notNull(),targetAgentId:(0,p.Qq)("target_agent_id"),externalAgentId:(0,p.Qq)("external_agent_id"),relationType:(0,p.Qq)("relation_type"),createdAt:(0,p.Qq)("created_at").notNull().default((0,l.ll)(b())),updatedAt:(0,p.Qq)("updated_at").notNull().default((0,l.ll)(C()))},e=>[(0,u.ie)({columns:[e.tenantId,e.projectId,e.graphId,e.id]}),(0,m.mt)({columns:[e.tenantId,e.projectId,e.graphId],foreignColumns:[ea.tenantId,ea.projectId,ea.id],name:"agent_relations_graph_fk"}).onDelete("cascade")]),el=(0,c.D)("external_agents",{tenantId:(0,p.Qq)("tenant_id").notNull(),projectId:(0,p.Qq)("project_id").notNull(),graphId:(0,p.Qq)("graph_id").notNull(),id:(0,p.Qq)("id").notNull(),name:(0,p.Qq)("name").notNull(),description:(0,p.Qq)("description").notNull(),baseUrl:(0,p.Qq)("base_url").notNull(),credentialReferenceId:(0,p.Qq)("credential_reference_id"),headers:(0,g.av)("headers",{mode:"json"}).$type(),createdAt:(0,p.Qq)("created_at").notNull().default((0,l.ll)(k())),updatedAt:(0,p.Qq)("updated_at").notNull().default((0,l.ll)(R()))},e=>[(0,u.ie)({columns:[e.tenantId,e.projectId,e.graphId,e.id]}),(0,m.mt)({columns:[e.tenantId,e.projectId,e.graphId],foreignColumns:[ea.tenantId,ea.projectId,ea.id],name:"external_agents_graph_fk"}).onDelete("cascade"),(0,m.mt)({columns:[e.tenantId,e.projectId,e.credentialReferenceId],foreignColumns:[ex.tenantId,ex.projectId,ex.id],name:"external_agents_credential_reference_fk"}).onDelete("set null")]),es=(0,c.D)("tasks",{tenantId:(0,p.Qq)("tenant_id").notNull(),projectId:(0,p.Qq)("project_id").notNull(),id:(0,p.Qq)("id").notNull(),contextId:(0,p.Qq)("context_id").notNull(),status:(0,p.Qq)("status").notNull(),metadata:(0,g.av)("metadata",{mode:"json"}).$type(),agentId:(0,p.Qq)("agent_id").notNull(),createdAt:(0,p.Qq)("created_at").notNull().default((0,l.ll)(v())),updatedAt:(0,p.Qq)("updated_at").notNull().default((0,l.ll)(M()))},e=>[(0,u.ie)({columns:[e.tenantId,e.projectId,e.id]}),(0,m.mt)({columns:[e.tenantId,e.projectId],foreignColumns:[en.tenantId,en.id],name:"tasks_project_fk"}).onDelete("cascade")]),ec=(0,c.D)("task_relations",{tenantId:(0,p.Qq)("tenant_id").notNull(),projectId:(0,p.Qq)("project_id").notNull(),id:(0,p.Qq)("id").notNull(),parentTaskId:(0,p.Qq)("parent_task_id").notNull(),childTaskId:(0,p.Qq)("child_task_id").notNull(),relationType:(0,p.Qq)("relation_type").default("parent_child"),createdAt:(0,p.Qq)("created_at").notNull().default((0,l.ll)(E())),updatedAt:(0,p.Qq)("updated_at").notNull().default((0,l.ll)(P()))},e=>[(0,u.ie)({columns:[e.tenantId,e.projectId,e.id]}),(0,m.mt)({columns:[e.tenantId,e.projectId],foreignColumns:[en.tenantId,en.id],name:"task_relations_project_fk"}).onDelete("cascade")]),ep=(0,c.D)("data_components",{tenantId:(0,p.Qq)("tenant_id").notNull(),projectId:(0,p.Qq)("project_id").notNull(),id:(0,p.Qq)("id").notNull(),name:(0,p.Qq)("name").notNull(),description:(0,p.Qq)("description").notNull(),props:(0,g.av)("props",{mode:"json"}).$type(),createdAt:(0,p.Qq)("created_at").notNull().default((0,l.ll)(U())),updatedAt:(0,p.Qq)("updated_at").notNull().default((0,l.ll)(S()))},e=>[(0,u.ie)({columns:[e.tenantId,e.projectId,e.id]}),(0,m.mt)({columns:[e.tenantId,e.projectId],foreignColumns:[en.tenantId,en.id],name:"data_components_project_fk"}).onDelete("cascade")]),eu=(0,c.D)("agent_data_components",{tenantId:(0,p.Qq)("tenant_id").notNull(),projectId:(0,p.Qq)("project_id").notNull(),graphId:(0,p.Qq)("graph_id").notNull(),agentId:(0,p.Qq)("agent_id").notNull(),id:(0,p.Qq)("id").notNull(),dataComponentId:(0,p.Qq)("data_component_id").notNull(),createdAt:(0,p.Qq)("created_at").notNull().default((0,l.ll)(D()))},e=>[(0,u.ie)({columns:[e.tenantId,e.projectId,e.id]}),(0,m.mt)({columns:[e.tenantId,e.projectId,e.graphId,e.agentId],foreignColumns:[ei.tenantId,ei.projectId,ei.graphId,ei.id],name:"agent_data_components_agent_fk"}).onDelete("cascade"),(0,m.mt)({columns:[e.tenantId,e.projectId,e.dataComponentId],foreignColumns:[ep.tenantId,ep.projectId,ep.id],name:"agent_data_components_data_component_fk"}).onDelete("cascade")]),em=(0,c.D)("artifact_components",{tenantId:(0,p.Qq)("tenant_id").notNull(),projectId:(0,p.Qq)("project_id").notNull(),id:(0,p.Qq)("id").notNull(),name:(0,p.Qq)("name").notNull(),description:(0,p.Qq)("description").notNull(),summaryProps:(0,g.av)("summary_props",{mode:"json"}).$type(),fullProps:(0,g.av)("full_props",{mode:"json"}).$type(),createdAt:(0,p.Qq)("created_at").notNull().default((0,l.ll)(w())),updatedAt:(0,p.Qq)("updated_at").notNull().default((0,l.ll)($()))},e=>[(0,u.ie)({columns:[e.tenantId,e.projectId,e.id]}),(0,m.mt)({columns:[e.tenantId,e.projectId],foreignColumns:[en.tenantId,en.id],name:"artifact_components_project_fk"}).onDelete("cascade")]),eg=(0,c.D)("agent_artifact_components",{tenantId:(0,p.Qq)("tenant_id").notNull(),projectId:(0,p.Qq)("project_id").notNull(),graphId:(0,p.Qq)("graph_id").notNull(),agentId:(0,p.Qq)("agent_id").notNull(),id:(0,p.Qq)("id").notNull(),artifactComponentId:(0,p.Qq)("artifact_component_id").notNull(),createdAt:(0,p.Qq)("created_at").notNull().default((0,l.ll)(K()))},e=>[(0,u.ie)({columns:[e.tenantId,e.projectId,e.graphId,e.agentId,e.id]}),(0,m.mt)({columns:[e.tenantId,e.projectId,e.graphId,e.agentId],foreignColumns:[ei.tenantId,ei.projectId,ei.graphId,ei.id],name:"agent_artifact_components_agent_fk"}).onDelete("cascade"),(0,m.mt)({columns:[e.tenantId,e.projectId,e.artifactComponentId],foreignColumns:[em.tenantId,em.projectId,em.id],name:"agent_artifact_components_artifact_component_fk"}).onDelete("cascade")]),eI=(0,c.D)("tools",{tenantId:(0,p.Qq)("tenant_id").notNull(),projectId:(0,p.Qq)("project_id").notNull(),id:(0,p.Qq)("id").notNull(),name:(0,p.Qq)("name").notNull(),config:(0,g.av)("config",{mode:"json"}).$type().notNull(),credentialReferenceId:(0,p.Qq)("credential_reference_id"),headers:(0,g.av)("headers",{mode:"json"}).$type(),imageUrl:(0,p.Qq)("image_url"),capabilities:(0,g.av)("capabilities",{mode:"json"}).$type(),lastError:(0,p.Qq)("last_error"),createdAt:(0,p.Qq)("created_at").notNull().default((0,l.ll)(J())),updatedAt:(0,p.Qq)("updated_at").notNull().default((0,l.ll)(O()))},e=>[(0,u.ie)({columns:[e.tenantId,e.projectId,e.id]}),(0,m.mt)({columns:[e.tenantId,e.projectId],foreignColumns:[en.tenantId,en.id],name:"tools_project_fk"}).onDelete("cascade")]),ef=(0,c.D)("agent_tool_relations",{tenantId:(0,p.Qq)("tenant_id").notNull(),projectId:(0,p.Qq)("project_id").notNull(),graphId:(0,p.Qq)("graph_id").notNull(),agentId:(0,p.Qq)("agent_id").notNull(),id:(0,p.Qq)("id").notNull(),toolId:(0,p.Qq)("tool_id").notNull(),selectedTools:(0,g.av)("selected_tools",{mode:"json"}).$type(),createdAt:(0,p.Qq)("created_at").notNull().default((0,l.ll)(G())),updatedAt:(0,p.Qq)("updated_at").notNull().default((0,l.ll)(W()))},e=>[(0,u.ie)({columns:[e.tenantId,e.projectId,e.graphId,e.id]}),(0,m.mt)({columns:[e.tenantId,e.projectId,e.graphId,e.agentId],foreignColumns:[ei.tenantId,ei.projectId,ei.graphId,ei.id],name:"agent_tool_relations_agent_fk"}).onDelete("cascade"),(0,m.mt)({columns:[e.tenantId,e.projectId,e.toolId],foreignColumns:[eI.tenantId,eI.projectId,eI.id],name:"agent_tool_relations_tool_fk"}).onDelete("cascade")]),e_=(0,c.D)("conversations",{tenantId:(0,p.Qq)("tenant_id").notNull(),projectId:(0,p.Qq)("project_id").notNull(),id:(0,p.Qq)("id").notNull(),userId:(0,p.Qq)("user_id"),activeAgentId:(0,p.Qq)("active_agent_id").notNull(),title:(0,p.Qq)("title"),lastContextResolution:(0,p.Qq)("last_context_resolution"),metadata:(0,g.av)("metadata",{mode:"json"}).$type(),createdAt:(0,p.Qq)("created_at").notNull().default((0,l.ll)(H())),updatedAt:(0,p.Qq)("updated_at").notNull().default((0,l.ll)(L()))},e=>[(0,u.ie)({columns:[e.tenantId,e.projectId,e.id]}),(0,m.mt)({columns:[e.tenantId,e.projectId],foreignColumns:[en.tenantId,en.id],name:"conversations_project_fk"}).onDelete("cascade")]),ej=(0,c.D)("messages",{tenantId:(0,p.Qq)("tenant_id").notNull(),projectId:(0,p.Qq)("project_id").notNull(),id:(0,p.Qq)("id").notNull(),conversationId:(0,p.Qq)("conversation_id").notNull(),role:(0,p.Qq)("role").notNull(),fromAgentId:(0,p.Qq)("from_agent_id"),toAgentId:(0,p.Qq)("to_agent_id"),fromExternalAgentId:(0,p.Qq)("from_external_agent_id"),toExternalAgentId:(0,p.Qq)("to_external_agent_id"),content:(0,g.av)("content",{mode:"json"}).$type().notNull(),visibility:(0,p.Qq)("visibility").notNull().default("user-facing"),messageType:(0,p.Qq)("message_type").notNull().default("chat"),agentId:(0,p.Qq)("agent_id"),taskId:(0,p.Qq)("task_id"),parentMessageId:(0,p.Qq)("parent_message_id"),a2aTaskId:(0,p.Qq)("a2a_task_id"),a2aSessionId:(0,p.Qq)("a2a_session_id"),metadata:(0,g.av)("metadata",{mode:"json"}).$type(),createdAt:(0,p.Qq)("created_at").notNull().default((0,l.ll)(F())),updatedAt:(0,p.Qq)("updated_at").notNull().default((0,l.ll)(B()))},e=>[(0,u.ie)({columns:[e.tenantId,e.projectId,e.id]}),(0,m.mt)({columns:[e.tenantId,e.projectId],foreignColumns:[en.tenantId,en.id],name:"messages_project_fk"}).onDelete("cascade")]),eN=(0,c.D)("ledger_artifacts",{tenantId:(0,p.Qq)("tenant_id").notNull(),projectId:(0,p.Qq)("project_id").notNull(),id:(0,p.Qq)("id").notNull(),taskId:(0,p.Qq)("task_id"),contextId:(0,p.Qq)("context_id").notNull(),type:(0,p.Qq)("type").notNull().default("source"),name:(0,p.Qq)("name"),description:(0,p.Qq)("description"),parts:(0,g.av)("parts",{mode:"json"}).$type(),metadata:(0,g.av)("metadata",{mode:"json"}).$type(),summary:(0,p.Qq)("summary"),mime:(0,g.av)("mime",{mode:"json"}).$type(),visibility:(0,p.Qq)("visibility").default("context"),allowedAgents:(0,g.av)("allowed_agents",{mode:"json"}).$type(),derivedFrom:(0,p.Qq)("derived_from"),createdAt:(0,p.Qq)("created_at").notNull().default((0,l.ll)(V())),updatedAt:(0,p.Qq)("updated_at").notNull().default((0,l.ll)(Z()))},e=>[(0,u.ie)({columns:[e.tenantId,e.projectId,e.id]}),(0,m.mt)({columns:[e.tenantId,e.projectId],foreignColumns:[en.tenantId,en.id],name:"ledger_artifacts_project_fk"}).onDelete("cascade")]),eq=(0,c.D)("api_keys",{id:(0,p.Qq)("id").primaryKey(),tenantId:(0,p.Qq)("tenant_id").notNull(),projectId:(0,p.Qq)("project_id").notNull(),graphId:(0,p.Qq)("graph_id").notNull(),publicId:(0,p.Qq)("public_id").notNull().unique(),keyHash:(0,p.Qq)("key_hash").notNull(),keyPrefix:(0,p.Qq)("key_prefix").notNull(),name:(0,p.Qq)("name"),lastUsedAt:(0,p.Qq)("last_used_at"),expiresAt:(0,p.Qq)("expires_at"),createdAt:(0,p.Qq)("created_at").notNull().default((0,l.ll)(X())),updatedAt:(0,p.Qq)("updated_at").notNull().default((0,l.ll)(Y()))},e=>[(0,m.mt)({columns:[e.tenantId,e.projectId],foreignColumns:[en.tenantId,en.id],name:"api_keys_project_fk"}).onDelete("cascade"),(0,m.mt)({columns:[e.tenantId,e.projectId,e.graphId],foreignColumns:[ea.tenantId,ea.projectId,ea.id],name:"api_keys_graph_fk"}).onDelete("cascade"),(0,f.Pe)("api_keys_tenant_graph_idx").on(e.tenantId,e.graphId),(0,f.Pe)("api_keys_prefix_idx").on(e.keyPrefix),(0,f.Pe)("api_keys_public_id_idx").on(e.publicId)]),ex=(0,c.D)("credential_references",{tenantId:(0,p.Qq)("tenant_id").notNull(),projectId:(0,p.Qq)("project_id").notNull(),id:(0,p.Qq)("id").notNull(),type:(0,p.Qq)("type").notNull(),credentialStoreId:(0,p.Qq)("credential_store_id").notNull(),retrievalParams:(0,g.av)("retrieval_params",{mode:"json"}).$type(),createdAt:(0,p.Qq)("created_at").notNull().default((0,l.ll)(ee())),updatedAt:(0,p.Qq)("updated_at").notNull().default((0,l.ll)(et()))},e=>[(0,u.ie)({columns:[e.tenantId,e.projectId,e.id]}),(0,m.mt)({columns:[e.tenantId,e.projectId],foreignColumns:[en.tenantId,en.id],name:"credential_references_project_fk"}).onDelete("cascade")]);(0,f.Pe)("ledger_artifacts_task_id_idx").on(eN.taskId),(0,f.Pe)("ledger_artifacts_context_id_idx").on(eN.contextId),(0,_.Am)("ledger_artifacts_task_context_name_unique").on(eN.taskId,eN.contextId,eN.name),(0,s.K1)(es,e=>{let{one:t,many:n}=e;return{project:t(en,{fields:[es.tenantId,es.projectId],references:[en.tenantId,en.id]}),parentRelations:n(ec,{relationName:"childTask"}),childRelations:n(ec,{relationName:"parentTask"}),agent:t(ei,{fields:[es.agentId],references:[ei.id]}),messages:n(ej),ledgerArtifacts:n(eN)}}),(0,s.K1)(en,e=>{let{many:t}=e;return{agents:t(ei),agentGraphs:t(ea),tools:t(eI),contextConfigs:t(eo),externalAgents:t(el),conversations:t(e_),tasks:t(es),dataComponents:t(ep),artifactComponents:t(em),ledgerArtifacts:t(eN),credentialReferences:t(ex)}}),(0,s.K1)(ec,e=>{let{one:t}=e;return{parentTask:t(es,{fields:[ec.parentTaskId],references:[es.id],relationName:"parentTask"}),childTask:t(es,{fields:[ec.childTaskId],references:[es.id],relationName:"childTask"})}}),(0,s.K1)(eo,e=>{let{many:t,one:n}=e;return{project:n(en,{fields:[eo.tenantId,eo.projectId],references:[en.tenantId,en.id]}),graphs:t(ea),cache:t(er)}}),(0,s.K1)(er,e=>{let{one:t}=e;return{contextConfig:t(eo,{fields:[er.contextConfigId],references:[eo.id]})}}),(0,s.K1)(ei,e=>{let{many:t,one:n}=e;return{project:n(en,{fields:[ei.tenantId,ei.projectId],references:[en.tenantId,en.id]}),tasks:t(es),defaultForGraphs:t(ea),sourceRelations:t(ed,{relationName:"sourceRelations"}),targetRelations:t(ed,{relationName:"targetRelations"}),sentMessages:t(ej,{relationName:"sentMessages"}),receivedMessages:t(ej,{relationName:"receivedMessages"}),associatedMessages:t(ej,{relationName:"associatedAgent"}),toolRelations:t(ef),dataComponentRelations:t(eu),artifactComponentRelations:t(eg)}}),(0,s.K1)(ea,e=>{let{one:t}=e;return{project:t(en,{fields:[ea.tenantId,ea.projectId],references:[en.tenantId,en.id]}),defaultAgent:t(ei,{fields:[ea.defaultAgentId],references:[ei.id]}),contextConfig:t(eo,{fields:[ea.contextConfigId],references:[eo.id]})}}),(0,s.K1)(el,e=>{let{one:t,many:n}=e;return{project:t(en,{fields:[el.tenantId,el.projectId],references:[en.tenantId,en.id]}),agentRelations:n(ed),credentialReference:t(ex,{fields:[el.credentialReferenceId],references:[ex.id]})}}),(0,s.K1)(eq,e=>{let{one:t}=e;return{project:t(en,{fields:[eq.tenantId,eq.projectId],references:[en.tenantId,en.id]}),graph:t(ea,{fields:[eq.graphId],references:[ea.id]})}}),(0,s.K1)(ef,e=>{let{one:t}=e;return{agent:t(ei,{fields:[ef.agentId],references:[ei.id]}),tool:t(eI,{fields:[ef.toolId],references:[eI.id]})}}),(0,s.K1)(ex,e=>{let{many:t}=e;return{tools:t(eI)}}),(0,s.K1)(eI,e=>{let{one:t,many:n}=e;return{project:t(en,{fields:[eI.tenantId,eI.projectId],references:[en.tenantId,en.id]}),agentRelations:n(ef),credentialReference:t(ex,{fields:[eI.credentialReferenceId],references:[ex.id]})}}),(0,s.K1)(e_,e=>{let{one:t,many:n}=e;return{project:t(en,{fields:[e_.tenantId,e_.projectId],references:[en.tenantId,en.id]}),messages:n(ej),activeAgent:t(ei,{fields:[e_.activeAgentId],references:[ei.id]})}}),(0,s.K1)(ej,e=>{let{one:t,many:n}=e;return{conversation:t(e_,{fields:[ej.conversationId],references:[e_.id]}),agent:t(ei,{fields:[ej.agentId],references:[ei.id],relationName:"associatedAgent"}),fromAgent:t(ei,{fields:[ej.fromAgentId],references:[ei.id],relationName:"sentMessages"}),toAgent:t(ei,{fields:[ej.toAgentId],references:[ei.id],relationName:"receivedMessages"}),fromExternalAgent:t(el,{fields:[ej.fromExternalAgentId],references:[el.id],relationName:"receivedExternalMessages"}),toExternalAgent:t(el,{fields:[ej.toExternalAgentId],references:[el.id],relationName:"sentExternalMessages"}),task:t(es,{fields:[ej.taskId],references:[es.id]}),parentMessage:t(ej,{fields:[ej.parentMessageId],references:[ej.id],relationName:"parentChild"}),childMessages:n(ej,{relationName:"parentChild"})}}),(0,s.K1)(em,e=>{let{many:t}=e;return{agentRelations:t(eg)}}),(0,s.K1)(eg,e=>{let{one:t}=e;return{agent:t(ei,{fields:[eg.agentId],references:[ei.id]}),artifactComponent:t(em,{fields:[eg.artifactComponentId],references:[em.id]})}}),(0,s.K1)(ep,e=>{let{many:t,one:n}=e;return{project:n(en,{fields:[ep.tenantId,ep.projectId],references:[en.tenantId,en.id]}),agentRelations:t(eu)}}),(0,s.K1)(eu,e=>{let{one:t}=e;return{agent:t(ei,{fields:[eu.agentId],references:[ei.id]}),dataComponent:t(ep,{fields:[eu.dataComponentId],references:[ep.id]})}}),(0,s.K1)(eN,e=>{let{one:t}=e;return{project:t(en,{fields:[eN.tenantId,eN.projectId],references:[en.tenantId,en.id]}),task:t(es,{fields:[eN.taskId],references:[es.id]})}}),(0,s.K1)(ed,e=>{let{one:t}=e;return{graph:t(ea,{fields:[ed.graphId],references:[ea.id]}),sourceAgent:t(ei,{fields:[ed.sourceAgentId],references:[ei.id],relationName:"sourceRelations"}),targetAgent:t(ei,{fields:[ed.targetAgentId],references:[ei.id],relationName:"targetRelations"}),externalAgent:t(el,{fields:[ed.externalAgentId],references:[el.id]})}});var ez=n(14409);let eQ=r.z.object({transferCountIs:r.z.number().min(1).max(100).optional(),stepCountIs:r.z.number().min(1).max(1e3).optional()}),eh=eQ.pick({transferCountIs:!0});eQ.pick({stepCountIs:!0});let eT=r.z.string().min(1).max(255).regex(/^[a-zA-Z0-9\-_.]+$/,{message:"ID must contain only letters, numbers, hyphens, underscores, and dots"}).openapi({description:"Resource identifier",example:"resource_789"}),eA=r.z.object({model:r.z.string().optional(),providerOptions:r.z.record(r.z.string(),r.z.unknown()).optional()}),ey=r.z.object({base:eA.optional(),structuredOutput:eA.optional(),summarizer:eA.optional()}),eb=r.z.object({base:eA,structuredOutput:eA.optional(),summarizer:eA.optional()}),eC=e=>e.omit({tenantId:!0,projectId:!0}),ek=e=>e.omit({tenantId:!0,projectId:!0}),eR=e=>e.omit({tenantId:!0,projectId:!0}).partial(),ev=e=>e.omit({tenantId:!0,projectId:!0,graphId:!0}),eM=e=>e.omit({tenantId:!0,projectId:!0,graphId:!0}),eE=e=>e.omit({tenantId:!0,projectId:!0,graphId:!0}).partial(),eP=(0,i.aJ)(ei),eU=(0,i.r)(ei).extend({id:eT,models:ey.optional()}),eS=eU.partial(),eD=ev(eP),ew=eM(eU);eE(eS);let e$=(0,i.aJ)(ed),eK=(0,i.r)(ed).extend({id:eT,graphId:eT,sourceAgentId:eT,targetAgentId:eT.optional(),externalAgentId:eT.optional()}),eJ=eK.partial();ev(e$),eM(eK).extend({relationType:r.z.enum(ez.IB)}).refine(e=>null!=e.targetAgentId!=(null!=e.externalAgentId),{message:"Must specify exactly one of targetAgentId or externalAgentId",path:["targetAgentId","externalAgentId"]}),eE(eJ).extend({relationType:r.z.enum(ez.IB).optional()}).refine(e=>{let t=null!=e.targetAgentId,n=null!=e.externalAgentId;return!t&&!n||t!==n},{message:"Must specify exactly one of targetAgentId or externalAgentId when updating agent relationships",path:["targetAgentId","externalAgentId"]}),r.z.object({sourceAgentId:r.z.string().optional(),targetAgentId:r.z.string().optional(),externalAgentId:r.z.string().optional()}),ek((0,i.r)(ed).extend({id:eT,graphId:eT,sourceAgentId:eT,externalAgentId:eT}));let eO=(0,i.aJ)(ea),eG=(0,i.r)(ea).extend({id:eT}),eW=eG.partial();eC(eO);let eH=ek(eG).extend({id:eT});eR(eW);let eL=(0,i.aJ)(es),eF=(0,i.r)(es).extend({id:eT,conversationId:eT.optional()}),eB=eF.partial();eC(eL),ek(eF),eR(eB);let eV=(0,i.aJ)(ec),eZ=(0,i.r)(ec).extend({id:eT,parentTaskId:eT,childTaskId:eT}),eX=eZ.partial();eC(eV),ek(eZ),eR(eX);let eY=r.z.string().optional().refine(e=>{if(!e)return!0;if(e.startsWith("data:image/")){let t=e.split(",")[1];return!!t&&t.length<14e5}try{let t=new URL(e);return"http:"===t.protocol||"https:"===t.protocol}catch(e){return!1}},{message:"Image URL must be a valid HTTP(S) URL or a base64 data URL (max 1MB)"}),e0=r.z.object({type:r.z.enum(ez.o7),requestInit:r.z.record(r.z.string(),r.z.unknown()).optional(),eventSourceInit:r.z.record(r.z.string(),r.z.unknown()).optional(),reconnectionOptions:r.z.custom().optional(),sessionId:r.z.string().optional()}),e1=r.z.enum(ez.L3),e5=r.z.object({name:r.z.string(),description:r.z.string().optional(),inputSchema:r.z.record(r.z.string(),r.z.unknown()).optional()}),e6=(0,i.aJ)(eI),e2=(0,i.r)(eI).extend({id:eT,imageUrl:eY}),e3=(0,i.aJ)(e_),e8=(0,i.r)(e_).extend({id:eT,contextConfigId:eT.optional()}),e7=e8.partial();eC(e3),ek(e8),eR(e7);let e4=(0,i.aJ)(ej),e9=(0,i.r)(ej).extend({id:eT,conversationId:eT,taskId:eT.optional()}),te=e9.partial();eC(e4),ek(e9),eR(te);let tt=(0,i.aJ)(er),tn=(0,i.r)(er),ta=tn.partial();eC(tt),ek(tn),eR(ta);let to=(0,i.aJ)(ep),tr=(0,i.r)(ep).extend({id:eT});tr.omit({createdAt:!0,updatedAt:!0});let ti=tr.partial();eC(to);let td=ek(tr);eR(ti);let tl=(0,i.aJ)(eu),ts=(0,i.r)(eu),tc=ts.partial();ev(tl),ts.omit({tenantId:!0,projectId:!0,id:!0,createdAt:!0}),eE(tc);let tp=(0,i.aJ)(em),tu=(0,i.r)(em).extend({id:eT}),tm=tu.partial();eC(tp);let tg=tu.omit({tenantId:!0,projectId:!0,createdAt:!0,updatedAt:!0});eR(tm);let tI=(0,i.aJ)(eg),tf=(0,i.r)(eg).extend({id:eT,agentId:eT,artifactComponentId:eT}),t_=tf.partial();ev(tI),tf.omit({tenantId:!0,projectId:!0,id:!0,createdAt:!0}),eE(t_);let tj=(0,i.aJ)(el).extend({credentialReferenceId:r.z.string().nullable().optional(),headers:r.z.record(r.z.string(),r.z.string()).nullable().optional()}),tN=(0,i.r)(el).extend({id:eT}),tq=tN.partial(),tx=ev(tj),tz=eM(tN);eE(tq),r.z.discriminatedUnion("type",[eD.extend({type:r.z.literal("internal")}),tx.extend({type:r.z.literal("external")})]);let tQ=(0,i.aJ)(eq),th=(0,i.r)(eq).extend({id:eT,graphId:eT});th.partial().omit({tenantId:!0,projectId:!0,id:!0,publicId:!0,keyHash:!0,keyPrefix:!0,createdAt:!0});let tT=tQ.omit({tenantId:!0,projectId:!0,keyHash:!0});r.z.object({data:r.z.object({apiKey:tT,key:r.z.string().describe("The full API key (shown only once)")})}),th.omit({tenantId:!0,projectId:!0,id:!0,publicId:!0,keyHash:!0,keyPrefix:!0,lastUsedAt:!0});let tA=r.z.object({id:r.z.string(),tenantId:r.z.string(),projectId:r.z.string(),type:r.z.string(),credentialStoreId:r.z.string(),retrievalParams:r.z.record(r.z.string(),r.z.unknown()).nullish(),createdAt:r.z.string(),updatedAt:r.z.string()}),ty=(0,i.r)(ex).extend({id:eT,type:r.z.string(),credentialStoreId:eT,retrievalParams:r.z.record(r.z.string(),r.z.unknown()).nullish()}),tb=ty.partial();eC(tA).extend({type:r.z.enum(ez.Ns),tools:r.z.array(e6).optional()});let tC=ek(ty).extend({type:r.z.enum(ez.Ns)});eR(tb).extend({type:r.z.enum(ez.Ns).optional()}),e2.extend({imageUrl:eY,availableTools:r.z.array(e5).optional(),status:e1.default("unknown"),version:r.z.string().optional(),createdAt:r.z.date(),updatedAt:r.z.date()}).omit({config:!0,tenantId:!0,projectId:!0,status:!0,version:!0,createdAt:!0,updatedAt:!0,credentialReferenceId:!0}).extend({tenantId:r.z.string().optional(),projectId:r.z.string().optional(),description:r.z.string().optional(),serverUrl:r.z.url(),activeTools:r.z.array(r.z.string()).optional(),mcpType:r.z.enum(ez.W0).optional(),transport:e0.optional(),credential:tC.optional()});let tk=e2.partial();eC(e6);let tR=ek(e2);eR(tk);let tv=r.z.object({url:r.z.string().min(1,"URL is required"),method:r.z.enum(["GET","POST","PUT","DELETE","PATCH"]).optional().default("GET"),headers:r.z.record(r.z.string(),r.z.string()).optional(),body:r.z.record(r.z.string(),r.z.unknown()).optional(),transform:r.z.string().optional(),timeout:r.z.number().min(0).optional().default(1e4).optional()});r.z.object({id:r.z.string().min(1,"Fetch definition ID is required"),name:r.z.string().optional(),trigger:r.z.enum(["initialization","invocation"]),fetchConfig:tv,responseSchema:r.z.any().optional(),defaultValue:r.z.unknown().optional(),credential:tC.optional()});let tM=(0,i.aJ)(eo).extend({requestContextSchema:r.z.unknown().optional()}),tE=(0,i.r)(eo).extend({id:eT,requestContextSchema:r.z.unknown().optional()}).omit({createdAt:!0,updatedAt:!0}),tP=tE.partial();eC(tM);let tU=ek(tE);eR(tP);let tS=(0,i.aJ)(ef),tD=(0,i.r)(ef).extend({id:eT,agentId:eT,toolId:eT,selectedTools:r.z.array(r.z.string()).nullish()}),tw=tD.partial();ev(tS),eM(tD),eE(tw);let t$=(0,i.aJ)(eN),tK=(0,i.r)(eN),tJ=tK.partial();eC(t$),ek(tK),eR(tJ);let tO=r.z.object({type:r.z.string(),description:r.z.string().optional(),detailsSchema:r.z.object({type:r.z.literal("object"),properties:r.z.record(r.z.string(),r.z.any()),required:r.z.array(r.z.string()).optional()}).optional()}),tG=r.z.object({enabled:r.z.boolean().optional(),numEvents:r.z.number().min(1).max(100).optional(),timeInSeconds:r.z.number().min(1).max(600).optional(),prompt:r.z.string().max(2e3,"Custom prompt cannot exceed 2000 characters").optional(),statusComponents:r.z.array(tO).optional()}),tW=r.z.object({toolId:r.z.string(),toolSelection:r.z.array(r.z.string()).nullable().optional()}),tH=ew.extend({type:r.z.literal("internal"),canUse:r.z.array(tW),dataComponents:r.z.array(r.z.string()).optional(),artifactComponents:r.z.array(r.z.string()).optional(),canTransferTo:r.z.array(r.z.string()).optional(),canDelegateTo:r.z.array(r.z.string()).optional()});eH.extend({agents:r.z.record(r.z.string(),r.z.union([tH,tz])),contextConfig:r.z.optional(tU),statusUpdates:r.z.optional(tG),models:ey.optional(),stopWhen:eh.optional(),graphPrompt:r.z.string().max(5e3,"Graph prompt cannot exceed 5000 characters").optional()});let tL=eH.extend({agents:r.z.record(r.z.string(),r.z.discriminatedUnion("type",[tH,tz.extend({type:r.z.literal("external")})])),models:ey.optional(),stopWhen:eh.optional(),graphPrompt:r.z.string().max(5e3,"Graph prompt cannot exceed 5000 characters").optional()});r.z.object({page:r.z.coerce.number().min(1).default(1),limit:r.z.coerce.number().min(1).max(100).default(10),total:r.z.number(),pages:r.z.number()}),r.z.object({error:r.z.string(),message:r.z.string().optional(),details:r.z.unknown().optional()}),r.z.object({exists:r.z.boolean()}),r.z.object({message:r.z.string(),removed:r.z.boolean()});let tF=(0,i.aJ)(en),tB=(0,i.r)(en).extend({models:eb.optional(),stopWhen:eQ.optional()}).omit({createdAt:!0,updatedAt:!0}),tV=tB.partial();tF.omit({tenantId:!0});let tZ=tB.omit({tenantId:!0});tV.omit({tenantId:!0}),tZ.extend({graphs:r.z.record(r.z.string(),tL),tools:r.z.record(r.z.string(),tR),dataComponents:r.z.record(r.z.string(),td).optional(),artifactComponents:r.z.record(r.z.string(),tg).optional(),contextConfig:r.z.record(r.z.string(),tU).optional(),statusUpdates:r.z.optional(tG),credentialReferences:r.z.record(r.z.string(),tC).optional(),createdAt:r.z.string().optional(),updatedAt:r.z.string().optional()}),r.z.object({"x-inkeep-tenant-id":r.z.string().optional().openapi({description:"Tenant identifier",example:"tenant_123"}),"x-inkeep-project-id":r.z.string().optional().openapi({description:"Project identifier",example:"project_456"}),"x-inkeep-graph-id":r.z.string().optional().openapi({description:"Graph identifier",example:"graph_789"})}),r.z.object({tenantId:r.z.string().openapi({description:"Tenant identifier",example:"tenant_123"})}).openapi("TenantParams"),r.z.object({tenantId:r.z.string().openapi({description:"Tenant identifier",example:"tenant_123"}),projectId:r.z.string().openapi({description:"Project identifier",example:"project_456"})}).openapi("TenantProjectParams"),r.z.object({tenantId:r.z.string().openapi({description:"Tenant identifier",example:"tenant_123"}),projectId:r.z.string().openapi({description:"Project identifier",example:"project_456"}),graphId:r.z.string().openapi({description:"Graph identifier",example:"graph_789"})}).openapi("TenantProjectGraphParams"),r.z.object({tenantId:r.z.string().openapi({description:"Tenant identifier",example:"tenant_123"}),projectId:r.z.string().openapi({description:"Project identifier",example:"project_456"}),graphId:r.z.string().openapi({description:"Graph identifier",example:"graph_789"}),id:eT}).openapi("TenantProjectGraphIdParams"),r.z.object({tenantId:r.z.string().openapi({description:"Tenant identifier",example:"tenant_123"}),projectId:r.z.string().openapi({description:"Project identifier",example:"project_456"}),id:eT}).openapi("TenantProjectIdParams"),r.z.object({tenantId:r.z.string().openapi({description:"Tenant identifier",example:"tenant_123"}),id:eT}).openapi("TenantIdParams"),r.z.object({id:eT}).openapi("IdParams"),r.z.object({page:r.z.coerce.number().min(1).default(1),limit:r.z.coerce.number().min(1).max(100).default(10)}),a.object({tenantId:a.string()}).extend({projectId:a.string()}).extend({id:a.string()}),a.object({id:a.string()}),a.object({page:a.coerce.number().min(1).default(1),limit:a.coerce.number().min(1).max(100).default(10),total:a.number(),pages:a.number()}),a.object({error:a.string(),message:a.string().optional(),details:a.unknown().optional()});let tX=a.object({model:a.string().optional(),structuredOutput:a.string().optional(),summarizer:a.string().optional(),providerOptions:a.record(a.string(),a.record(a.string(),a.unknown())).optional()});a.object({id:a.string().optional(),name:a.string(),description:a.string().optional(),prompt:a.string().optional(),model:tX.optional(),tools:a.array(a.string()).optional(),dataComponents:a.array(a.string()).optional(),artifactComponents:a.array(a.string()).optional(),canTransferTo:a.array(a.string()).optional(),canDelegateTo:a.array(a.string()).optional(),type:a.enum(["internal","external"]).optional()}),a.object({id:a.string().optional(),name:a.string(),description:a.string().optional(),type:a.enum(["mcp","hosted"]),config:a.record(a.string(),a.unknown()),credentialReferenceId:a.string().optional()});let tY=a.object({id:a.string(),tenantId:a.string(),projectId:a.string(),graphId:a.string(),publicId:a.string(),keyHash:a.string(),keyPrefix:a.string(),name:a.string().optional(),lastUsedAt:a.string().optional(),expiresAt:a.string().optional(),createdAt:a.string(),updatedAt:a.string()});a.object({data:a.object({apiKey:tY,key:a.string()})}),a.object({id:a.string(),tenantId:a.string().optional(),projectId:a.string().optional(),type:a.enum(o.Ns),credentialStoreId:a.string(),retrievalParams:a.record(a.string(),a.unknown()).nullish()}),a.object({id:a.string(),name:a.string(),description:a.string().optional(),props:a.record(a.string(),a.unknown())}),a.object({id:a.string(),name:a.string(),description:a.string().optional(),summaryProps:a.record(a.string(),a.unknown()),fullProps:a.record(a.string(),a.unknown())});let t0=a.object({id:a.string().optional(),name:a.string().optional(),description:a.string().optional(),type:a.string().optional(),config:a.record(a.string(),a.unknown()).optional()}),t1=a.object({id:a.string().optional(),name:a.string(),description:a.string().optional(),baseUrl:a.string(),type:a.literal("external").optional()});function t5(e){return e.toLowerCase().replace(/[^a-zA-Z0-9]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").slice(0,255)}a.object({id:a.string().optional(),name:a.string(),description:a.string().optional(),defaultAgentId:a.string().optional()}).extend({agents:a.record(a.string(),a.union([tH,t1.extend({id:a.string()})])),contextConfig:a.optional(t0),models:a.object({base:a.object({model:a.string(),providerOptions:a.record(a.string(),a.record(a.string(),a.unknown())).optional()}).optional(),structuredOutput:a.object({model:a.string(),providerOptions:a.record(a.string(),a.record(a.string(),a.unknown())).optional()}).optional(),summarizer:a.object({model:a.string(),providerOptions:a.record(a.string(),a.record(a.string(),a.unknown())).optional()}).optional()}).optional(),stopWhen:a.object({transferCountIs:a.number().min(1).max(100).optional()}).optional(),graphPrompt:a.string().max(5e3).optional(),statusUpdates:a.object({enabled:a.boolean().optional(),numEvents:a.number().min(1).max(100).optional(),timeInSeconds:a.number().min(1).max(600).optional(),prompt:a.string().max(2e3).optional(),statusComponents:a.array(a.object({type:a.string(),description:a.string().optional(),detailsSchema:a.object({type:a.literal("object"),properties:a.record(a.string(),a.any()),required:a.array(a.string()).optional()}).optional()})).optional()}).optional()}),a.string().min(1).max(255).regex(/^[a-zA-Z0-9\-_.]+$/,{message:"ID must contain only letters, numbers, hyphens, underscores, and dots"})},86312:(e,t,n)=>{n.d(t,{C5:()=>j,MJ:()=>f,Rr:()=>_,eI:()=>g,lR:()=>I,lV:()=>s,zB:()=>p});var a=n(60098),o=n(67244),r=n(79178),i=n(95118),d=n(92752),l=n(52681);let s=i.Op,c=r.createContext({}),p=e=>{let{...t}=e;return(0,a.jsx)(c.Provider,{value:{name:t.name},children:(0,a.jsx)(i.xI,{...t})})},u=()=>{let e=r.useContext(c),t=r.useContext(m),{getFieldState:n}=(0,i.xW)(),a=(0,i.lN)({name:e.name}),o=n(e.name,a);if(!e)throw Error("useFormField should be used within <FormField>");let{id:d}=t;return{id:d,name:e.name,formItemId:"".concat(d,"-form-item"),formDescriptionId:"".concat(d,"-form-item-description"),formMessageId:"".concat(d,"-form-item-message"),...o}},m=r.createContext({});function g(e){let{className:t,...n}=e,o=r.useId();return(0,a.jsx)(m.Provider,{value:{id:o},children:(0,a.jsx)("div",{"data-slot":"form-item",className:(0,l.cn)("grid gap-2",t),...n})})}function I(e){let{className:t,isRequired:n,children:o,...r}=e,{error:i,formItemId:s}=u();return(0,a.jsxs)(d.J,{"data-slot":"form-label","data-error":!!i,className:(0,l.cn)("data-[error=true]:text-destructive gap-1",t),htmlFor:s,...r,children:[o,n&&(0,a.jsx)("span",{className:"text-red-500",children:"*"})]})}function f(e){let{...t}=e,{error:n,formItemId:r,formDescriptionId:i,formMessageId:d}=u();return(0,a.jsx)(o.DX,{"data-slot":"form-control",id:r,"aria-describedby":n?"".concat(i," ").concat(d):"".concat(i),"aria-invalid":!!n,...t})}function _(e){let{className:t,...n}=e,{formDescriptionId:o}=u();return(0,a.jsx)("p",{"data-slot":"form-description",id:o,className:(0,l.cn)("text-muted-foreground text-sm",t),...n})}function j(e){var t;let{className:n,...o}=e,{error:r,formMessageId:i}=u(),d=r?String(null!=(t=null==r?void 0:r.message)?t:""):o.children;return d?(0,a.jsx)("p",{"data-slot":"form-message",id:i,className:(0,l.cn)("text-destructive text-sm",n),...o,children:d}):null}},92752:(e,t,n)=>{n.d(t,{J:()=>i});var a=n(60098),o=n(57076),r=n(52681);function i(e){let{className:t,...n}=e;return(0,a.jsx)(o.b,{"data-slot":"label",className:(0,r.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),...n})}}}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7167,8831],{1095:(e,t,a)=>{"use strict";a.d(t,{Separator:()=>o});var r=a(60098),n=a(16212),s=a(52681);function o(e){let{className:t,orientation:a="horizontal",decorative:o=!0,...l}=e;return(0,r.jsx)(n.b,{"data-slot":"separator",decorative:o,orientation:a,className:(0,s.cn)("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...l})}},9788:(e,t,a)=>{"use strict";a.d(t,{Graph:()=>t0});var r=a(60098),n=a(86977),s=a(37989),o=a(30953),l=a(93137),i=a(79178),d=a(32028);class c{execute(e){e.execute(),this.txBuffer?this.txBuffer.push(e):(this.undoStack.push(e),this.redoStack=[])}undo(){let e=this.undoStack.pop();e&&(e.undo(),this.redoStack.push(e))}redo(){let e=this.redoStack.pop();e&&(e.execute(),this.undoStack.push(e))}beginTransaction(){this.txBuffer||(this.txBuffer=[])}commitTransaction(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Batch";if(!this.txBuffer||0===this.txBuffer.length){this.txBuffer=null;return}let t=this.txBuffer.slice();this.txBuffer=null,this.undoStack.push({name:e,execute(){for(let e of t)e.execute()},undo(){for(let e of[...t].reverse())e.undo()}}),this.redoStack=[]}cancelTransaction(){if(this.txBuffer){for(let e of[...this.txBuffer].reverse())e.undo();this.txBuffer=null}}constructor(){this.undoStack=[],this.redoStack=[],this.txBuffer=null}}let u=new c;var m=a(36324),p=a(58954);function h(e){let{id:t,sourceX:a,sourceY:o,targetX:l,targetY:i,sourcePosition:d,targetPosition:c,label:u,selected:m,markerEnd:p}=e,[h]=(0,s.Fp)({sourceX:a,sourceY:o,sourcePosition:d,targetX:l,targetY:i,targetPosition:c});return(0,r.jsx)(n.tE,{id:t,path:h,label:u,markerEnd:p,style:{strokeWidth:2},className:"".concat(m?"!stroke-primary":"!stroke-border dark:!stroke-muted-foreground")})}var x=a(34640),g=function(e){return e.A2A="a2a",e.A2AExternal="a2a-external",e.Default="default",e.SelfLoop="self-loop",e}({});let f={a2a:function(e){let{sourceX:t,sourceY:a,targetX:o,targetY:l,sourcePosition:i,targetPosition:d,data:c,selected:u}=e,h=(null==c?void 0:c.relationships)||{transferTargetToSource:!1,transferSourceToTarget:!1,delegateTargetToSource:!1,delegateSourceToTarget:!1},x=h.delegateTargetToSource||h.delegateSourceToTarget,g=h.transferTargetToSource||h.transferSourceToTarget,f=e=>{let r=o-t,n=l-a,c=Math.sqrt(r*r+n*n),u=-(n/c)*e,m=r/c*e;return(0,s.Fp)({sourceX:t+u,sourceY:a+m,targetX:o+u,targetY:l+m,targetPosition:d,sourcePosition:i})},[v,b,j]=(0,s.Fp)({sourceX:t,sourceY:a,targetX:o,targetY:l,targetPosition:d,sourcePosition:i}),y=null,N=h.transferSourceToTarget||h.delegateSourceToTarget,k=h.transferTargetToSource||h.delegateTargetToSource;N&&k?y=m.A:g?y=p.A:x&&(y=p.A);let w=e=>e?"url(#marker-selected)":"url(#marker-default)",C=g&&h.transferTargetToSource?w(!!u):void 0,T=g&&h.transferSourceToTarget?w(!!u):void 0,S=x&&h.delegateTargetToSource?w(!!u):void 0,E=x&&h.delegateSourceToTarget?w(!!u):void 0;return(0,r.jsxs)(r.Fragment,{children:[g&&(0,r.jsx)(n.tE,{className:"".concat(u?"!stroke-primary":"!stroke-border dark:!stroke-muted-foreground"),path:x?f(-3)[0]:v,style:{strokeWidth:2},markerEnd:T,markerStart:C}),x&&(0,r.jsx)(n.tE,{className:"".concat(u?"!stroke-primary":"!stroke-border dark:!stroke-muted-foreground"),path:g?f(3)[0]:v,style:{strokeDasharray:"5,5",strokeWidth:2},markerEnd:E,markerStart:S}),y&&(0,r.jsx)(n.rV,{children:(0,r.jsx)("div",{style:{position:"absolute",transform:"translate(-50%, -50%) translate(".concat(b,"px,").concat(j,"px)"),pointerEvents:"none"},children:(0,r.jsx)("div",{className:"w-6 h-6 bg-background border rounded-full flex items-center justify-center border-border",children:(0,r.jsx)(y,{className:"w-3 h-3 text-muted-foreground"})})})})]})},default:h,"a2a-external":h,"self-loop":function(e){let{source:t,data:a,selected:s}=e,o=(0,n.Pj)(e=>e.nodes.find(e=>e.id===t));if(!o)return null;let l=(null==a?void 0:a.relationships)||{transferTargetToSource:!1,transferSourceToTarget:!1,delegateTargetToSource:!1,delegateSourceToTarget:!1},i=l.delegateTargetToSource||l.delegateSourceToTarget,d=l.transferTargetToSource||l.transferSourceToTarget,c=o.position.x,u=o.position.y,m=o.width||300,p=o.height||150,h=c+m/2,g=u+p/2,f=h+m/2,v=g-10,b=h+m/2,j=g+10,y="\n M ".concat(f," ").concat(v,"\n C ").concat(f+80," ").concat(v-40,",\n ").concat(b+80," ").concat(j+40,",\n ").concat(b," ").concat(j,"\n "),N="\n M ".concat(f-5," ").concat(v,"\n C ").concat(f+80-5," ").concat(v-40-5,",\n ").concat(b+80-5," ").concat(j+40+5,",\n ").concat(b-5," ").concat(j,"\n "),k=e=>e?"url(#marker-selected)":"url(#marker-default)",w=d?k(!!s):void 0,C=i?k(!!s):void 0;return(0,r.jsxs)(r.Fragment,{children:[d&&(0,r.jsx)(n.tE,{className:"".concat(s?"!stroke-primary":"!stroke-border dark:!stroke-muted-foreground"),path:y,style:{strokeWidth:2,fill:"none"},markerEnd:w}),i&&(0,r.jsx)(n.tE,{className:"".concat(s?"!stroke-primary":"!stroke-border dark:!stroke-muted-foreground"),path:d?N:y,style:{strokeDasharray:"5,5",strokeWidth:2,fill:"none"},markerEnd:C}),(d||i)&&(0,r.jsx)(n.rV,{children:(0,r.jsx)("div",{style:{position:"absolute",transform:"translate(-50%, -50%) translate(".concat(h+m/2+40,"px,").concat(g-40,"px)"),pointerEvents:"none"},children:(0,r.jsx)("div",{className:"w-6 h-6 bg-background border rounded-full flex items-center justify-center border-border",children:(0,r.jsx)(x.A,{className:"w-3 h-3 text-muted-foreground"})})})})]})}},v={a2a:{type:"a2a",name:"Agent connection",Icon:m.A}},b=[];var j=a(95744),y=a(61461);let N=(0,j.v)()((0,y.lt)((e,t)=>({nodes:[],edges:[],metadata:{id:void 0,name:"",description:"",contextConfig:{name:"",description:"",contextVariables:"",requestContextSchema:""},models:void 0,stopWhen:void 0,graphPrompt:void 0,statusUpdates:void 0},dataComponentLookup:{},artifactComponentLookup:{},dirty:!1,history:[],future:[],errors:null,showErrors:!1,setInitial(t,a,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};e({nodes:t,edges:a,metadata:r,dataComponentLookup:n,artifactComponentLookup:s,dirty:!1,history:[],future:[],errors:null,showErrors:!1})},setDataComponentLookup(t){e({dataComponentLookup:t})},setArtifactComponentLookup(t){e({artifactComponentLookup:t})},setNodes(t){e(e=>({nodes:t(e.nodes)}))},setEdges(t){e(e=>({edges:t(e.edges)}))},push(t,a){e(e=>({history:[...e.history,{nodes:t,edges:a}],future:[]}))},onNodesChange(t){let a=t.some(e=>"remove"===e.type||"add"===e.type||"replace"===e.type||"position"===e.type);e(e=>({history:[...e.history,{nodes:e.nodes,edges:e.edges}],nodes:(0,n._0)(t,e.nodes),dirty:!!a||e.dirty}))},onEdgesChange(t){let a=t.some(e=>"remove"===e.type||"add"===e.type||"replace"===e.type);e(e=>({history:[...e.history,{nodes:e.nodes,edges:e.edges}]})),e(e=>({history:[...e.history,{nodes:e.nodes,edges:e.edges}],edges:(0,n.zW)(t,e.edges),dirty:!!a||e.dirty}))},onConnect(t){e(e=>({edges:(0,s.rN)(t,e.edges)}))},setMetadata(t,a){e(e=>({metadata:{...e.metadata,[t]:a}}))},undo(){let{history:a}=t();if(0===a.length)return;let r=a[a.length-1];e(e=>({nodes:r.nodes,edges:r.edges,history:e.history.slice(0,-1),future:[{nodes:e.nodes,edges:e.edges},...e.future],dirty:e.dirty}))},redo(){let{future:a}=t();if(0===a.length)return;let r=a[0];e(e=>({nodes:r.nodes,edges:r.edges,future:e.future.slice(1),history:[...e.history,{nodes:e.nodes,edges:e.edges}],dirty:e.dirty}))},markSaved(){e({dirty:!1})},markUnsaved(){e({dirty:!0})},clearSelection(){e(e=>({nodes:e.nodes.map(e=>({...e,selected:!1})),edges:e.edges.map(e=>({...e,selected:!1})),dirty:e.dirty}))},deleteSelected(){e(e=>{let t=new Set(e.nodes.filter(e=>{var t;return e.selected&&(null==(t=e.deletable)||t)}).map(e=>e.id)),a=e.edges.filter(e=>!e.selected&&!t.has(e.source)&&!t.has(e.target)),r=e.nodes.filter(e=>!t.has(e.id));return{history:[...e.history,{nodes:e.nodes,edges:e.edges}],nodes:r,edges:a,dirty:!0}})},setErrors(t){e({errors:t,showErrors:null!==t})},clearErrors(){e({errors:null,showErrors:!1})},setShowErrors(t){e({showErrors:t})},hasErrors(){let{errors:e}=t();return null!==e&&e.totalErrors>0},getNodeErrors(e){let{errors:a}=t();return a&&a.nodeErrors[e]?a.nodeErrors[e]:[]},getEdgeErrors(e){let{errors:a}=t();return a&&a.edgeErrors[e]?a.edgeErrors[e]:[]}})));class k{on(e,t){var a;let r=null!=(a=this.listeners.get(e))?a:[];return r.push(t),this.listeners.set(e,r),()=>this.off(e,t)}off(e,t){let a=this.listeners.get(e);if(!a)return;let r=a.filter(e=>e!==t);this.listeners.set(e,r)}emit(e,t){let a=this.listeners.get(e);if(a)for(let e of a)e(t)}constructor(){this.listeners=new Map}}let w=new k;class C{execute(){let{setNodes:e}=N.getState();e(e=>e.concat(this.node))}undo(){let{setNodes:e}=N.getState();e(e=>e.filter(e=>e.id!==this.node.id))}constructor(e){this.name="AddNode",this.node=e}}class T{execute(){let{setEdges:e,setNodes:t}=N.getState();this.edge.type===g.A2A&&t(e=>e.map(e=>({...e,selected:!1}))),e(e=>{if(e.some(e=>e.id===this.edge.id))return e;let t=this.deselectOtherEdgesIfA2A&&this.edge.type===g.A2A?e.map(e=>({...e,selected:!1})):e,a=(0,s.rN)(this.edge,t);return w.emit("edgeConnected",{edgeId:this.edge.id}),a})}undo(){let{setEdges:e}=N.getState(),t=this.edge.id;e(e=>e.filter(e=>e.id!==t))}constructor(e,t){this.name="AddPreparedEdge",this.edge=e,this.deselectOtherEdgesIfA2A=!!(null==t?void 0:t.deselectOtherEdgesIfA2A)}}var S=a(44886),E=a(96441),A=a(20361),I=a(4778),O=a(44339),z=a(991),M=a(48851),P=a(84654),_=a(64202),L=a(39475);function U(){let e=N(e=>e.errors),t=N(e=>e.showErrors),a=N(e=>e.hasErrors),r=N(e=>e.getNodeErrors),n=N(e=>e.getEdgeErrors),s=N(e=>e.setErrors),o=N(e=>e.clearErrors),l=N(e=>e.setShowErrors),d=e=>r(e).length,c=e=>n(e).length,u=(0,i.useCallback)(e=>{let t=r(e),a={};for(let e of t)a[e.field]||(a[e.field]=[]),a[e.field].push(e.message);return a},[r]),m=(0,i.useCallback)((e,t)=>t in u(e),[u]),p=(0,i.useCallback)((e,t)=>{var a;return null==(a=u(e)[t])?void 0:a[0]},[u]),h=(0,i.useCallback)(e=>{var t;return null==(t=r(e)[0])?void 0:t.field},[r]);return{errors:e,showErrors:t,hasErrors:a(),getNodeErrors:r,getEdgeErrors:n,getNodeErrorCount:d,getEdgeErrorCount:c,hasNodeErrors:e=>d(e)>0,hasEdgeErrors:e=>c(e)>0,getFieldErrors:u,hasFieldError:m,getFieldErrorMessage:p,getFirstErrorField:h,setErrors:s,clearErrors:o,setShowErrors:l}}var B=a(76507),D=a(31011);function F(e){let{errors:t,className:a=""}=e;if(0===t.length)return null;let n=(0,r.jsx)("div",{className:"backdrop-blur-sm flex items-center justify-center bg-red-100 dark:bg-red-950/50 border border-red-300 dark:border-red-700 rounded-full ".concat(a),children:(0,r.jsx)(B.A,{className:"text-red-600 dark:text-red-400 w-3 h-3"})});return(0,r.jsx)(D.B,{children:(0,r.jsxs)(D.Tooltip,{children:[(0,r.jsx)(D.TooltipTrigger,{asChild:!0,children:n}),(0,r.jsx)(D.TooltipContent,{side:"top",className:"max-w-xs [--bg-color:var(--color-red-50)] dark:[--bg-color:var(--color-red-950)] border-red-200 dark:border-red-700 text-red-800 dark:text-red-300 bg-red-50 dark:bg-red-950/90",children:(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsxs)("div",{className:"font-medium",children:["Validation Error",t.length>1?"s":""]}),t.slice(0,3).map((e,t)=>(0,r.jsxs)("div",{className:"text-xs",children:[(0,r.jsxs)("span",{className:"font-medium",children:[e.field,":"]})," ",e.message]},t)),t.length>3&&(0,r.jsxs)("div",{className:"text-xs text-red-600 dark:text-red-400",children:["...and ",t.length-3," more error",t.length-3>1?"s":""]})]})})]})})}var R=a(52681);let V=(0,i.forwardRef)((e,t)=>{let{className:a,isSelected:n,...s}=e;return(0,r.jsx)("div",{ref:t,className:(0,R.cn)("relative rounded-lg border bg-card text-card-foreground","hover:ring-2 hover:ring-gray-700/5",n&&"ring-2 ring-primary hover:ring-primary",a),...s})});V.displayName="BaseNode";let W=(0,i.forwardRef)((e,t)=>{let{className:a,...n}=e;return(0,r.jsx)("header",{ref:t,...n,className:(0,R.cn)("mx-0 my-0 -mb-1 flex flex-row items-center justify-between gap-2 px-4 pt-4 pb-0",a)})});W.displayName="BaseNodeHeader";let J=(0,i.forwardRef)((e,t)=>{let{className:a,...n}=e;return(0,r.jsx)("h3",{ref:t,"data-slot":"base-node-title",className:(0,R.cn)("user-select-none flex-1 font-semibold text-sm truncate",a),...n})});J.displayName="BaseNodeHeaderTitle";let H=(0,i.forwardRef)((e,t)=>{let{className:a,...n}=e;return(0,r.jsx)("div",{ref:t,"data-slot":"base-node-content",className:(0,R.cn)("flex flex-col gap-y-2 p-4 text-foreground",a),...n})});function G(e){let{className:t,...a}=e;return(0,r.jsx)(n.h7,{...a,className:(0,R.cn)("!h-3 !w-3 !border-2 !border-border !bg-card dark:!bg-muted !shadow-sm",t)})}function $(e){let{selected:t,children:a}=e;return(0,r.jsx)("div",{className:(0,R.cn)(" px-2 py-0.5 rounded-t-md flex items-center gap-2 w-fit border border-b-0 font-medium font-mono text-xs uppercase",t?"bg-primary border-primary text-white ring-2 ring-primary":"bg-muted text-muted-foreground border-border"),children:a})}H.displayName="BaseNodeContent",(0,i.forwardRef)((e,t)=>{let{className:a,...n}=e;return(0,r.jsx)("div",{ref:t,"data-slot":"base-node-footer",className:(0,R.cn)("flex flex-col items-center gap-y-2 border-t px-4 pb-4 pt-3",a),...n})}).displayName="BaseNodeFooter";let q=e=>{let{title:t,items:a,Icon:n}=e;return(0,r.jsxs)("div",{className:"flex flex-col gap-3 pt-2",children:[(0,r.jsxs)("div",{className:"flex items-center justify-start gap-2",children:[(0,r.jsx)(n,{className:"size-3 text-xs text-muted-foreground"}),(0,r.jsx)("div",{className:"text-xs uppercase font-mono text-muted-foreground",children:t})]}),(0,r.jsx)("div",{className:"flex flex-wrap gap-2",children:null==a?void 0:a.map(e=>(0,r.jsx)(L.E,{className:"text-xs",variant:"code",children:e},e))})]})};var Z=a(77064),K=function(e){return e.Agent="agent",e.ExternalAgent="external-agent",e.MCP="mcp",e.MCPPlaceholder="mcp-placeholder",e}({});let X={agent:function(e){var t;let{data:a,selected:n,id:o}=e,{name:l,isDefault:d,description:c,models:u}=a,m=null==u||null==(t=u.base)?void 0:t.model,p=N(e=>e.dataComponentLookup),h=N(e=>e.artifactComponentLookup),{getNodeErrors:x,hasNodeErrors:g}=U(),f=a.id||o,v=x(f),b=g(f),j=(0,i.useMemo)(()=>{var e;return(null==a||null==(e=a.dataComponents)?void 0:e.map(e=>{var t;return null==(t=p[e])?void 0:t.name}).filter(Boolean))||[]},[null==a?void 0:a.dataComponents,p]),y=(0,i.useMemo)(()=>{var e;return(null==a||null==(e=a.artifactComponents)?void 0:e.map(e=>{var t;return null==(t=h[e])?void 0:t.name}).filter(Boolean))||[]},[null==a?void 0:a.artifactComponents,h]);return(0,r.jsxs)("div",{className:"relative",children:[d?(0,r.jsx)($,{selected:n,children:"Default"}):null,(0,r.jsxs)(V,{isSelected:n,className:"".concat(d?"rounded-tl-none":""," ").concat(b?"ring-2 ring-red-300 border-red-300":""),style:{width:en},children:[(0,r.jsxs)(W,{className:"flex items-center justify-between gap-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,r.jsx)(E.A,{className:"size-4 text-muted-foreground"}),(0,r.jsx)(J,{children:l||"Agent"})]}),(0,r.jsx)(L.E,{variant:"primary",className:"text-xs uppercase",children:"Agent"}),b&&(0,r.jsx)(F,{errors:v,className:"absolute -top-2 -right-2 w-6 h-6"})]}),(0,r.jsxs)(H,{children:[(0,r.jsx)("div",{className:"text-sm ".concat(c?" text-muted-foreground":"text-muted-foreground/50"),children:c||"No description"}),u&&m?(0,r.jsxs)(L.E,{className:"text-xs max-w-full flex-1",variant:"code",children:[(null==m?void 0:m.startsWith("openai"))?(0,r.jsx)(_.I,{className:"size-3 text-xs text-muted-foreground flex-shrink-0"}):(null==m?void 0:m.startsWith("anthropic"))?(0,r.jsx)(M.S,{className:"size-3 text-xs flex-shrink-0"}):(null==m?void 0:m.startsWith("google"))?(0,r.jsx)(P.A,{className:"size-3 text-xs flex-shrink-0"}):null,(0,r.jsx)("div",{className:"truncate w-full",children:m||""})]}):null,(null==j?void 0:j.length)>0&&(0,r.jsx)(q,{title:"Data components",items:j,Icon:O.A}),(null==y?void 0:y.length)>0&&(0,r.jsx)(q,{title:"Artifact components",items:y,Icon:z.A})]}),(0,r.jsx)(G,{id:ee,type:"source",position:s.yX.Top,isConnectable:!0}),(0,r.jsx)(G,{id:Q,type:"source",position:s.yX.Bottom,isConnectable:!0})]})]})},"external-agent":function(e){let{data:t,selected:a,id:n}=e,{name:o,description:l}=t,{getNodeErrors:i,hasNodeErrors:d}=U(),c=t.id||n,u=i(c),m=d(c);return(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)($,{selected:a,children:"External"}),(0,r.jsxs)(V,{isSelected:a,className:"rounded-tl-none ".concat(m?"ring-2 ring-red-300 border-red-300":""),style:{width:en},children:[(0,r.jsxs)(W,{className:"flex items-center justify-between gap-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,r.jsx)(A.A,{className:"size-4 text-muted-foreground"}),(0,r.jsx)(J,{children:o||"External agent"})]}),(0,r.jsx)(L.E,{variant:"primary",className:"text-xs uppercase",children:"Agent"}),m&&(0,r.jsx)(F,{errors:u,className:"absolute -top-2 -right-2 w-6 h-6"})]}),(0,r.jsx)(H,{children:(0,r.jsx)("div",{className:"text-sm ".concat(l?" text-muted-foreground":"text-muted-foreground/50"),children:l||"No description"})}),(0,r.jsx)(G,{id:et,type:"target",position:s.yX.Top,isConnectable:!0})]})]})},mcp:function(e){let{data:t,selected:a}=e,n=t.name||"Tool: ".concat(t.toolId),o=t.imageUrl,l=t.provider;return(0,r.jsxs)(V,{isSelected:a,className:"rounded-full min-w-40 min-h-13 max-w-3xs flex items-center justify-center",children:[(0,r.jsxs)(W,{className:"mb-0 py-3",children:[(0,r.jsx)(Z.u,{imageUrl:o,name:n,provider:l||void 0,size:24,className:"mt-[1px] flex-shrink-0"}),(0,r.jsx)(J,{children:n})]}),(0,r.jsx)(G,{id:Y,type:"target",position:s.yX.Top,isConnectable:!0})]})},"mcp-placeholder":function(e){let{data:t,selected:a}=e,{name:n}=t;return(0,r.jsx)(V,{isSelected:a,className:"rounded-full border-dashed min-w-40 min-h-13 flex items-center justify-center max-w-3xs ".concat(a?"outline-dashed outline-2 outline-gray-700 hover:outline-gray-700 ring-0 hover:ring-0":""),children:(0,r.jsxs)(W,{className:"mb-0 py-3",children:[(0,r.jsx)(I.A,{className:"size-4 text-muted-foreground/65"}),(0,r.jsx)(J,{className:"text-muted-foreground",children:n})]})})}},Y="target-mcp",Q="source-agent",ee="target-agent",et="target-external-agent",ea={agent:{name:""},"external-agent":{name:""},mcp:{name:"MCP"},"mcp-placeholder":{name:"Select MCP server"}},er={agent:{type:"agent",name:"Agent",Icon:E.A},"external-agent":{type:"external-agent",name:"External agent",Icon:A.A},"mcp-placeholder":{type:"mcp-placeholder",name:"MCP",Icon:I.A},mcp:{type:"mcp",name:"MCP",Icon:I.A}},en=300;function es(e){let t=120;if(e.type===K.Agent||e.type===K.ExternalAgent){var a,r;let n=e.data;n.description&&(t+=20),(null==(r=n.models)||null==(a=r.base)?void 0:a.model)&&(t+=30),n.dataComponents&&n.dataComponents.length>0&&(t+=60+30*Math.ceil(n.dataComponents.length/3)),n.artifactComponents&&n.artifactComponents.length>0&&(t+=60+30*Math.ceil(n.artifactComponents.length/3))}return e.type===K.MCP&&(t=100),Math.max(t,150)}function eo(e){if(e)try{return JSON.parse(e)}catch(e){console.error("Error parsing JSON:",e);return}}var el=a(6329);let ei=["graph","node","edge"];function ed(){let[e,t]=(0,el.ab)({pane:(0,el.M1)(ei),nodeId:el.tU,edgeId:el.tU});return{pane:e.pane,nodeId:e.nodeId,edgeId:e.edgeId,isOpen:!!e.pane,setQueryState:t,openGraphPane:()=>t({pane:"graph",nodeId:null,edgeId:null})}}var ec=a(97555);let eu=(0,ec.createServerReference)("782bc70f48bc594b547e2a595cf6a9f687c2ed2544",ec.callServer,void 0,ec.findSourceMapURL,"updateFullGraphAction"),em=(0,ec.createServerReference)("70d77ec4f223e5059cf64c0904bfd0dec7d1215a5b",ec.callServer,void 0,ec.findSourceMapURL,"createFullGraphAction");async function ep(e,t,a,r){return r?eu(e,t,r,a):em(e,t,a)}function eh(e,t){let a,r,n,s=[...t,...e.path],o="graph";"agents"===s[0]&&s[1]?(o="node",a=s[1]):"edges"===s[0]&&s[1]&&(o="edge",r=s[1]),n=e.path.join(".")||"configuration";let l=function(e,t,a){var r;let n="node"===a?"Agent":"edge"===a?"Connection":"Graph",s={instructions:"Instructions",projectId:"Project ID",baseUrl:"Host URL",name:"Name",description:"Description",model:"Model",temperature:"Temperature",maxTokens:"Max Tokens",systemPrompt:"System Prompt",tools:"Tools",dataComponents:"Data Components",artifactComponents:"Artifact Components",relationships:"Relationships",transferTargetToSource:"Transfer (Target to Source)",transferSourceToTarget:"Transfer (Source to Target)",delegateTargetToSource:"Delegate (Target to Source)",delegateSourceToTarget:"Delegate (Source to Target)",contextConfig:"Context Configuration",contextVariables:"Context Variables",requestContextSchema:"Request Context Schema"}[r=t]||r.replace(/([A-Z])/g," $1").replace(/^./,e=>e.toUpperCase());switch(e.code){case"invalid_type":if("string"===e.expected&&e.message.includes("undefined"))return"".concat(n," is missing required field: ").concat(s);return"".concat(n," ").concat(s," has invalid type. Expected ").concat(e.expected);case"too_small":return"".concat(n," ").concat(s," is too short. Please provide a valid value");case"invalid_enum_value":return"".concat(n," ").concat(s," has an invalid value. Please select a valid option");case"invalid_union":if(t.includes("type")||e.message.includes("discriminator"))return"".concat(n," type must be specified as either 'internal' or 'external'");return"".concat(n," configuration is incomplete. Please check all required fields");default:return"".concat(n," ").concat(s,": ").concat(e.message)}}(e,n,o);return{type:o,nodeId:a,edgeId:r,field:n,message:l,fullPath:s,originalError:e}}var ex=a(77186),eg=a(66894);function ef(e,t){if(void 0!==e.data.tempSelectedTools)return e.data.tempSelectedTools;let a=new Set,r=!1,n=!1,s=!1;return(Object.values(t).forEach(t=>{let o=t[e.data.toolId];void 0!==o&&(r=!0,Array.isArray(o)&&0===o.length?n=!0:null===o?s=!0:Array.isArray(o)&&o.forEach(e=>{a.add(e)}))}),s)?null:n?[]:r?Array.from(a):null}var ev=a(6826),eb=a(76636),ej=a(31184),ey=a(65299),eN=a(86714),ek=a(67696),ew=a(74598);function eC(e){let{title:t,errors:a,icon:n,onNavigate:s,getItemLabel:o}=e,[l,d]=(0,i.useState)(!1);if(0===a.length)return null;let c={};for(let e of a){let t=e.nodeId||e.edgeId||"general";c[t]||(c[t]=[]),c[t].push(e)}return(0,r.jsxs)(ew.Nt,{open:l,onOpenChange:d,children:[(0,r.jsx)(ew.R6,{asChild:!0,children:(0,r.jsx)(eN.$,{variant:"ghost",className:"w-full justify-start p-1.5 h-auto",children:(0,r.jsxs)("div",{className:"flex items-center gap-1.5 text-red-600 dark:text-red-400 text-xs",children:[n,(0,r.jsxs)("span",{className:"font-medium",children:[t," (",a.length,")"]}),l?(0,r.jsx)(ev.A,{className:"w-3 h-3 ml-auto"}):(0,r.jsx)(eb.A,{className:"w-3 h-3 ml-auto"})]})})}),(0,r.jsx)(ew.Ke,{className:"space-y-3 pl-4 max-h-48 overflow-y-auto scrollbar-thin scrollbar-thumb-red-200 dark:scrollbar-thumb-red-800 scrollbar-track-transparent hover:scrollbar-thumb-red-300 dark:hover:scrollbar-thumb-red-700",children:Object.entries(c).map(e=>{let[t,a]=e;return(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[o&&(0,r.jsx)("span",{className:"text-xs font-medium text-foreground truncate",children:o(a[0])}),s&&"general"!==t&&(0,r.jsx)(eN.$,{size:"sm",variant:"outline",onClick:()=>s(t),className:"h-5 px-1.5 text-xs",children:"Go to"})]}),(0,r.jsx)("div",{className:"space-y-2",children:a.map((e,a)=>(0,r.jsxs)("div",{className:"text-xs text-red-700 dark:text-red-300 bg-red-50/90 dark:bg-red-950/40 p-2 rounded border border-red-200 dark:border-red-700",children:[(0,r.jsxs)("div",{className:"font-medium mb-1",children:[e.field,":"]}),(0,r.jsx)("div",{className:"text-xs leading-relaxed",children:e.message})]},"".concat(t,"-").concat(a)))})]},t)})})]})}function eT(e){let{errorSummary:t,onClose:a,onNavigateToNode:n,onNavigateToEdge:s}=e,{setQueryState:o}=ed(),l=Object.values(t.nodeErrors).flat(),i=Object.values(t.edgeErrors).flat(),d=t.graphErrors;return(0,r.jsxs)(ek.Zp,{className:"border-red-200 dark:border-red-800 bg-red-50/50 dark:bg-red-950/30 backdrop-blur-sm shadow-xl gap-2 py-4 max-h-[80vh] animate-in slide-in-from-bottom-2 duration-300",children:[(0,r.jsx)(ek.aR,{className:"px-3",children:(0,r.jsxs)(ek.ZB,{className:"flex items-center justify-between text-red-700 dark:text-red-400 text-sm",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)(B.A,{className:"w-4 h-4"}),(0,r.jsxs)("span",{children:["Validation Errors (",t.totalErrors,")"]})]}),(0,r.jsx)(eN.$,{variant:"ghost",size:"sm",onClick:a,className:"h-6 w-6 p-0",children:(0,r.jsx)(ej.A,{className:"w-3 h-3"})})]})}),(0,r.jsxs)(ek.Wu,{className:"space-y-2 px-3 overflow-y-auto max-h-[calc(80vh-80px)] scrollbar-thin scrollbar-thumb-red-200 dark:scrollbar-thumb-red-800 scrollbar-track-transparent hover:scrollbar-thumb-red-300 dark:hover:scrollbar-thumb-red-700",children:[(0,r.jsx)("div",{className:"text-xs text-red-600 dark:text-red-400 mb-2",children:"Fix these issues to save your graph:"}),(0,r.jsx)(eC,{title:"Agent Errors",errors:l,icon:(0,r.jsx)(ey.A,{className:"w-3 h-3"}),onNavigate:e=>{o({pane:"node",nodeId:e,edgeId:null}),null==n||n(e)},getItemLabel:e=>"Agent (".concat(e.nodeId,")")}),(0,r.jsx)(eC,{title:"Connection Errors",errors:i,icon:(0,r.jsx)("div",{className:"w-3 h-3 border rounded-full"}),onNavigate:e=>{o({pane:"edge",nodeId:null,edgeId:e}),null==s||s(e)},getItemLabel:e=>"Connection (".concat(e.edgeId,")")}),(0,r.jsx)(eC,{title:"Graph Configuration Errors",errors:d,icon:(0,r.jsx)(B.A,{className:"w-3 h-3"})}),(0,r.jsx)("div",{className:"mt-2 pt-2 border-t border-red-200 dark:border-red-800",children:(0,r.jsx)("div",{className:"text-xs text-red-500 dark:text-red-400",children:'\uD83D\uDCA1 Click "Go to" buttons to navigate to issues'})})]})]})}function eS(){return(0,r.jsxs)("svg",{style:{position:"absolute",top:0,left:0},children:[(0,r.jsx)("title",{children:"arrow"}),(0,r.jsx)("defs",{children:(0,r.jsx)("marker",{className:"react-flow__arrowhead !stroke-border dark:!stroke-muted-foreground",id:"marker-default",markerWidth:"12.5",markerHeight:"12.5",viewBox:"-10 -10 20 20",markerUnits:"strokeWidth",orient:"auto-start-reverse",refX:"0",refY:"0",children:(0,r.jsx)("polyline",{strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4",strokeWidth:1.5})})})]})}function eE(){return(0,r.jsxs)("svg",{style:{position:"absolute",top:0,left:0},children:[(0,r.jsx)("title",{children:"arrow"}),(0,r.jsx)("defs",{children:(0,r.jsx)("marker",{className:"react-flow__arrowhead !stroke-primary",id:"marker-selected",markerWidth:"12.5",markerHeight:"12.5",viewBox:"-10 -10 20 20",markerUnits:"strokeWidth",orient:"auto-start-reverse",refX:"0",refY:"0",children:(0,r.jsx)("polyline",{strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4",strokeWidth:1.5})})})]})}var eA=a(52597);function eI(e){let{node:t}=e,{type:a,name:n,Icon:s,disabled:o}=t;return(0,r.jsxs)("div",{role:"button",tabIndex:o?-1:0,"aria-label":"Drag ".concat(n," node"),className:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 flex font-medium items-center text-sm rounded-md p-2 justify-between gap-2 text-left h-auto w-full group group-hover:bg-muted/50 transition-all ease-in-out duration-200 cursor-grab active:cursor-grabbing",draggable:!o,onDragStart:e=>{e.dataTransfer.setData("application/reactflow",JSON.stringify(t)),e.dataTransfer.effectAllowed="move"},children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(s,{className:"h-4 w-4 text-muted-foreground"}),(0,r.jsx)("div",{className:"flex flex-col items-start min-w-0",children:(0,r.jsx)("span",{className:"truncate w-full inline-block",children:n})})]}),(0,r.jsx)(eA.A,{className:"h-4 w-4 text-muted-foreground/30 opacity-0 group-hover:opacity-100 transition-all ease-in-out duration-200"})]},a)}let eO=[er[K.Agent],er[K.ExternalAgent],er[K.MCPPlaceholder]];function ez(){return(0,r.jsx)("div",{className:"flex flex-col gap-2 max-w-72 w-52 min-w-0",children:eO.map(e=>(0,r.jsx)(eI,{node:e},e.type))})}var eM=a(20833),eP=a(29490),e_=a(51433),eL=a(93385),eU=a(15660);function eB(e){let{graphId:t,projectId:a,tenantId:n,conversationId:s,setConversationId:l,startPolling:d,stopPolling:c,customHeaders:u={}}=e,{INKEEP_AGENTS_RUN_API_URL:m,INKEEP_AGENTS_RUN_API_BYPASS_SECRET:p}=(0,eU.y)(),h=(0,i.useRef)(null);return(0,i.useEffect)(()=>()=>{h.current&&(clearTimeout(h.current),h.current=null)},[]),(0,r.jsx)("div",{className:"h-full flex flex-row gap-4",children:(0,r.jsx)("div",{className:"flex-1 min-w-0 h-full",children:(0,r.jsx)(eL.Po,{baseSettings:{onEvent:e=>{"assistant_message_received"===e.eventName&&(h.current=setTimeout(()=>{c(),h.current=null},5e3)),"user_message_submitted"===e.eventName&&(h.current&&(clearTimeout(h.current),h.current=null),d()),"chat_clear_button_clicked"===e.eventName&&(h.current&&(clearTimeout(h.current),h.current=null),c(),l((0,o.Ak)()))},primaryBrandColor:"#3784ff",colorMode:{sync:{target:document.documentElement,attributes:["class"],isDarkMode:e=>{var t;return!!(null==e||null==(t=e.class)?void 0:t.includes("dark"))}}},theme:{styles:[{key:"custom-styles",type:"style",value:'\n.ikp-ai-chat-wrapper {\n height: 100%;\n max-height: unset;\n box-shadow: none;\n}\n.ikp-ai-chat-message-wrapper {\n padding-top: 1rem;\n padding-bottom: 1rem;\n\n}\n[data-role="user"] .ikp-ai-chat-message-header {\n display: none;\n}\n\n.ikp-ai-chat-message-header {\n margin-bottom: 16px;\n}\n\n.ikp-ai-chat-message-wrapper:not(:last-child):after {\n border-bottom-width: 0px;\n}\n [data-role="user"] .ikp-ai-chat-message-name {\n display: none;\n margin-bottom: 0px;\n}\n.ikp-ai-chat-message-content, .ikp-ai-chat-input {\n font-size: 14px;\n}\n.ikp-ai-chat-message-avatar-content {\n width: 24px;\n height: 24px;\n}\n[data-widget-md] .ikp-ai-chat-message-avatar {\n height: 24px;\n}\n.ikp-ai-chat-message-name {\n background: none;\n padding-left: 0px;\n padding-right: 0px;\n margin-left: 12px;\n font-size: 13px;\n font-weight: 500;\n color: var(--ikp-color-gray-600);\n}\n.ikp-ai-chat-tagline__text {\n font-size: 13px;\n}\n.ikp-ai-chat-input__fieldset {\n padding: 4px;\n}\n.ikp-ai-chat-input__send-button {\n height: 36px;\n width: 36px;\n}\n\n.ikp-ai-chat-message-loading {\n height: auto;\n}\n\n/* User message styles */\n[data-role="user"] .ikp-ai-chat-message-content-wrapper {\n align-items: flex-end;\n}\n[data-role="user"] .ikp-ai-chat-message-content {\n background-color: var(--ikp-color-gray-100);\n color: var(--ikp-color-gray-900);\n border-radius: 24px;\n border-bottom-right-radius: 2px;\n padding: 8px 16px;\n}\n[data-role="user"] .ikp-ai-chat-message-part > p {\n margin: 0px;\n}\n[data-role="user"] .ikp-ai-chat-message-part {\n margin-bottom: 0px;\n}\n[data-theme=dark] [data-role="user"] .ikp-ai-chat-message-content {\n background-color: var(--ikp-color-white-alpha-100);\n color: var(--ikp-color-white-alpha-950);\n}\n\n.ikp-markdown-code {\n background-color: var(--ikp-color-gray-100);\n color: var(--ikp-color-gray-900);\n}\n\n[data-theme=dark] .ikp-markdown-code {\n background-color: var(--ikp-color-white-alpha-100);\n color: var(--ikp-color-white-alpha-950);\n}\n\n/* Dark mode styles for chat containers */\n[data-theme=dark] .ikp-sidebar-chat__close-button {\n color: var(--ikp-color-gray-50);\n}\n[data-theme=dark] .ikp-ai-chat-message-name {\n background: none;\n}\n'}],colors:{gray:{50:"#fafaf9",100:"#f4f4f3",200:"#eeeceb",300:"#dedbd9",400:"#cec7c2",500:"#a9a19a",600:"#75716b",700:"#58534e",800:"#443f3e",900:"#2b2826",950:"#1a1817",1e3:"#080706"},grayDark:{950:"oklch(0.141 0.005 285.823)"}}}},aiChatSettings:{conversationId:s,graphUrl:t?"".concat(m,"/api/chat"):void 0,headers:{"x-inkeep-tenant-id":n,"x-inkeep-project-id":a,"x-inkeep-graph-id":t,Authorization:"Bearer ".concat(p),...u},introMessage:"Hi! How can I help?"}})})})}a(10242);var eD=a(36886),eF=a(34237),eR=a(96776),eV=a(95118),eW=a(29583),eJ=a(35613),eH=a(88418),eG=a(30958),e$=a(86312);let eq=eW.object({headers:eW.string().refine(e=>{try{let t=JSON.parse(e);return"object"==typeof t&&null!==t&&!Array.isArray(t)}catch(e){return!1}},"Must be valid JSON object").refine(e=>{try{let t=JSON.parse(e);return Object.values(t).every(e=>"string"==typeof e)}catch(e){return!1}},"All header values must be strings")}),eZ=function(e){let{customHeaders:t,setCustomHeaders:a}=e,n=Object.keys(t).length||0,[s,o]=(0,i.useState)(!1),l=(0,eV.mN)({defaultValues:{headers:JSON.stringify(t,null,2)},resolver:(0,eD.u)(eq)}),{isSubmitting:c}=l.formState,u=async e=>{let t,{headers:r}=e;if(r)try{t=JSON.parse(r)}catch(e){console.error("Error parsing JSON:",e),l.setError("headers",{message:e instanceof Error?e.message:"Invalid JSON"});return}a(t||{}),d.oR.success("Custom headers applied, you can now use them in the chat."),o(!1)};return(0,r.jsxs)(eG.lG,{open:s,onOpenChange:o,children:[(0,r.jsx)(eG.zM,{asChild:!0,children:(0,r.jsxs)(eN.$,{variant:"outline",children:[n>0?(0,r.jsx)(eF.A,{className:"w-4 h-4"}):(0,r.jsx)(eR.A,{className:"w-4 h-4"}),"Custom Headers",n>0&&(0,r.jsx)(L.E,{variant:"code",children:n})]})}),(0,r.jsxs)(eG.Cf,{className:"!max-w-2xl",children:[(0,r.jsxs)(eG.c7,{children:[(0,r.jsx)(eG.L3,{children:"Custom Headers"}),(0,r.jsx)(eG.rr,{children:"Add custom headers to the chat API requests."})]}),(0,r.jsx)(e$.lV,{...l,children:(0,r.jsxs)("form",{onSubmit:l.handleSubmit(u),className:"space-y-8",children:[(0,r.jsx)(eJ.u,{control:l.control,name:"headers",label:"Custom headers",children:e=>(0,r.jsx)(eH.i,{value:e.value||"",onChange:e.onChange,placeholder:"Enter headers...",...e})}),(0,r.jsxs)("div",{className:"flex justify-end gap-2",children:[n>0&&(0,r.jsx)(eN.$,{type:"button",variant:"outline",onClick:()=>{l.reset({headers:"{}"}),a({}),o(!1),d.oR.success("Custom headers removed.")},children:"Remove headers"}),(0,r.jsx)(eN.$,{type:"submit",disabled:c,children:"Apply"})]})]})})]})]})},eK=e=>{let{graphId:t,projectId:a,tenantId:n,setShowPlayground:s}=e,[l,d]=(0,i.useState)((0,o.Ak)()),[c,u]=(0,i.useState)({}),{chatActivities:m,isPolling:p,error:h,startPolling:x,stopPolling:g,retryConnection:f,refreshOnce:v}=(e=>{var t;let{conversationId:a,pollingInterval:r=1e3}=e,[n,s]=(0,i.useState)(null),[o,l]=(0,i.useState)(!1),[d,c]=(0,i.useState)(null),[u,m]=(0,i.useState)(0),p=(0,i.useRef)(null),h=(0,i.useRef)(!0),x=(0,i.useRef)(null),g=(0,i.useCallback)(async()=>{try{c(null),x.current=new AbortController;let t=await fetch("/api/signoz/conversations/".concat(a),{signal:x.current.signal});if(!t.ok){if(404===t.status)return null;let e="Failed to fetch chat activities";try{let a=await t.json();a.error&&(e=a.error)}catch(e){}throw Error(e)}let r=await t.json();if(h.current&&a==a){var e;let t=(null==(e=r.activities)?void 0:e.length)||0;t!==u&&(s(r),m(t))}return r}catch(e){if(e instanceof Error&&"AbortError"===e.name)return null;throw h.current&&(c(e instanceof Error?e.message:"An error occurred"),l(!1),p.current&&(clearInterval(p.current),p.current=null),x.current&&(x.current.abort(),x.current=null)),e}},[a,u]),f=(0,i.useCallback)(()=>{p.current||(l(!0),g().catch(()=>{}),p.current=setInterval(()=>{g().catch(()=>{})},r))},[g,r]),v=(0,i.useCallback)(()=>{l(!1),p.current&&(clearInterval(p.current),p.current=null),x.current&&(x.current.abort(),x.current=null)},[]),b=(0,i.useCallback)(()=>{c(null),v(),f()},[f,v]),j=(0,i.useCallback)(async()=>{var e,t;let a=(null==n||null==(e=n.activities)?void 0:e.length)||0,r=await g();return{hasNewActivity:((null==r||null==(t=r.activities)?void 0:t.length)||0)>a}},[g,null==n||null==(t=n.activities)?void 0:t.length]);(0,i.useEffect)(()=>(h.current=!0,()=>{h.current=!1,v()}),[v]);let y=(0,i.useRef)(a);return(0,i.useEffect)(()=>{y.current!==a&&(s(null),m(0),c(null),p.current&&(clearInterval(p.current),p.current=null),x.current&&(x.current.abort(),x.current=null),l(!1),y.current=a)}),{chatActivities:n,isPolling:o,error:d,startPolling:f,stopPolling:v,retryConnection:b,refreshOnce:j}})({conversationId:l});return(0,r.jsxs)("div",{className:"bg-background h-full w-full z-10 flex flex-col",children:[(0,r.jsxs)("div",{className:"flex min-h-0 items-center justify-between py-2 px-4 border-b flex-shrink-0",children:[(0,r.jsxs)(eN.$,{variant:"ghost",size:"sm",className:"h-6",onClick:()=>s(!1),children:[(0,r.jsx)(eM.A,{className:"h-4 w-4"}),(0,r.jsx)("span",{children:"Back to graph"})]}),(0,r.jsx)(eZ,{customHeaders:c,setCustomHeaders:u})]}),(0,r.jsx)("div",{className:"flex-1 min-h-0 w-full",children:(0,r.jsxs)(e_.HK,{direction:"horizontal",children:[(0,r.jsx)(e_.wV,{order:1,children:(0,r.jsx)(eB,{conversationId:l,setConversationId:d,startPolling:x,stopPolling:g,graphId:t,projectId:a,tenantId:n,customHeaders:c},JSON.stringify(c))}),(0,r.jsx)(e_.WM,{}),(0,r.jsx)(eP.B,{isPolling:p,conversation:m,enableAutoScroll:!0,error:h,retryConnection:f,refreshOnce:v,showConversationTracesLink:!0,conversationId:l})]})})]})};var eX=a(57713),eY=a(11729);let eQ={Root:function(e){let{isOpen:t,children:a}=e;return(0,r.jsx)("div",{className:"relative top-0 right-0 bg-background h-full flex flex-col rounded-br-[14px] transform transition-transform duration-300 ease-in-out group z-50 ".concat(t?"translate-x-0 w-[480px]":"translate-x-full w-0"),children:a})},Header:function(e){let{children:t}=e;return(0,r.jsx)("div",{className:"flex flex-row items-center justify-between px-6 py-2 border-l border-b flex-shrink-0 relative",children:t})},Content:function(e){let{children:t}=e;return(0,r.jsx)(eY.F,{className:"border-l border-border flex-1 h-0 [&>div>div]:table-fixed [&>div>div]:w-full",children:(0,r.jsx)("div",{className:"p-6",children:t})})},CloseButton:function(e){let{onClick:t}=e;return(0,r.jsxs)(eN.$,{variant:"ghost",size:"icon-sm",onClick:t,className:"-mr-1 text-foreground hover:text-foreground dark:text-foreground dark:hover:text-foreground",children:[(0,r.jsx)(ej.A,{className:"h-4 w-4"}),(0,r.jsx)("span",{className:"sr-only",children:"Close"})]})},BackButton:function(e){let{onClick:t}=e;return(0,r.jsxs)(eN.$,{variant:"ghost",size:"icon-sm",onClick:t,className:"-ml-1 transition-all duration-300 ease-in-out absolute left-0 opacity-0 -translate-x-6 group-hover:opacity-100 group-hover:translate-x-0 text-foreground hover:text-foreground dark:text-foreground dark:hover:text-foreground",children:[(0,r.jsx)(eM.A,{className:"h-4 w-4"}),(0,r.jsx)("span",{className:"sr-only",children:"Back"})]})}};var e0=a(82161),e1=a(69962);let e2=(0,i.forwardRef)((e,t)=>(0,r.jsxs)(e1.A,{ref:t,...e,children:[(0,r.jsx)("path",{d:"M19 7C20.1046 7 21 6.10457 21 5C21 3.89543 20.1046 3 19 3C17.8954 3 17 3.89543 17 5C17 6.10457 17.8954 7 19 7Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("path",{d:"M5 21C6.10457 21 7 20.1046 7 19C7 17.8954 6.10457 17 5 17C3.89543 17 3 17.8954 3 19C3 20.1046 3.89543 21 5 21Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("path",{d:"M5 17C5 13.8174 6.26428 10.7652 8.51472 8.51472C10.7652 6.26428 13.8174 5 17 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",strokeDasharray:"4 4"})]}));e2.displayName="DashedSplineIcon";var e5=a(84661),e4=a(92752);function e3(e){let{id:t,label:a,onCheckedChange:n,checked:s}=e;return(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)(e5.S,{id:t,onCheckedChange:e=>n(t,e),checked:s}),(0,r.jsx)("div",{className:"grid gap-2",children:(0,r.jsx)(e4.J,{htmlFor:t,children:a})})]})}function e8(e){let{icon:t,title:a,description:n,options:s,onCheckedChange:o,checkedValues:l}=e;return(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[t,(0,r.jsx)("h3",{className:"font-semibold text-sm",children:a})]}),(0,r.jsx)("p",{className:"text-muted-foreground text-sm",children:n})]}),s.map(e=>(0,r.jsx)(e3,{id:e.id,label:e.label,onCheckedChange:o,checked:(null==l?void 0:l[e.id])||!1},e.id))]})}let e6=function(e){var t,a;let{selectedEdge:s}=e,{updateEdgeData:o,setEdges:l}=(0,n.VH)(),i=(0,n.j7)(s.source),d=(0,n.j7)(s.target),c=N(e=>e.markUnsaved),u=s.source===s.target,m=(e,t)=>{var a,r;let n;if(u){let r={};"transferSourceToTarget"===e?(r.transferSourceToTarget=t,r.transferTargetToSource=t):"delegateSourceToTarget"===e&&(r.delegateSourceToTarget=t,r.delegateTargetToSource=t),n={...null==(a=s.data)?void 0:a.relationships,...r}}else n={...null==(r=s.data)?void 0:r.relationships,[e]:t};let i=n.transferSourceToTarget||n.transferTargetToSource||n.delegateSourceToTarget||n.delegateTargetToSource;c(),i?o(s.id,{relationships:n}):l(e=>e.filter(e=>e.id!==s.id))},p=u?[{id:"transferSourceToTarget",label:"".concat(null==i?void 0:i.data.name," can transfer to itself")}]:[{id:"transferSourceToTarget",label:"".concat(null==i?void 0:i.data.name," can transfer to ").concat(null==d?void 0:d.data.name)},{id:"transferTargetToSource",label:"".concat(null==d?void 0:d.data.name," can transfer to ").concat(null==i?void 0:i.data.name)}],h=u?[{id:"delegateSourceToTarget",label:"".concat(null==i?void 0:i.data.name," can delegate to itself")}]:[{id:"delegateSourceToTarget",label:"".concat(null==i?void 0:i.data.name," can delegate to ").concat(null==d?void 0:d.data.name)},{id:"delegateTargetToSource",label:"".concat(null==d?void 0:d.data.name," can delegate to ").concat(null==i?void 0:i.data.name)}];return(0,r.jsxs)("div",{className:"space-y-8",children:[(0,r.jsx)(e8,{icon:(0,r.jsx)(e0.A,{className:"w-4 h-4 text-muted-foreground"}),title:"Transfer relationships",description:"Transfer relationships completely relinquish control from one agent to another.",options:p,onCheckedChange:m,checkedValues:null==(t=s.data)?void 0:t.relationships}),(0,r.jsx)("hr",{}),(0,r.jsx)(e8,{icon:(0,r.jsx)(e2,{className:"w-4 h-4 text-muted-foreground"}),title:"Delegate relationships",description:"Delegate relationships are used to pass a task from one agent to another.",options:h,onCheckedChange:m,checkedValues:null==(a=s.data)?void 0:a.relationships})]})};function e7(e){let{heading:t,Icon:a,className:n}=e;return(0,r.jsxs)("div",{className:(0,R.cn)("text-sm font-medium flex items-center gap-2",n),children:[a&&(0,r.jsx)(a,{className:"size-4 text-muted-foreground"}),t]})}var e9=a(47140),te=a(26273),tt=a(77946),ta=a(79741),tr=a(30712),tn=a(49121),ts=a(27820),to=a(51952);function tl(e){let{isExplicit:t=!1,inheritedFrom:a,tooltip:n,size:s="sm",position:o="inline"}=e;return t?(0,r.jsx)(D.B,{children:(0,r.jsxs)(D.Tooltip,{children:[(0,r.jsx)(D.TooltipTrigger,{asChild:!0,children:(0,r.jsxs)(L.E,{variant:"outline",className:"\n ".concat("sm"===s?"h-5 px-1.5 text-xs":"h-6 px-2 text-sm","\n ").concat("absolute"===o?"absolute -top-2 -right-2":"inline-flex","\n bg-green-50 dark:bg-green-950/20 border-green-200 dark:border-green-800 \n text-green-800 dark:text-green-200 items-center gap-1\n "),children:[(0,r.jsx)(ts.A,{className:"sm"===s?"h-2.5 w-2.5":"h-3 w-3"}),"md"===s&&"Explicit"]})}),(0,r.jsx)(D.TooltipContent,{children:(0,r.jsx)("p",{children:n||"This value is explicitly set at this level"})})]})}):a?(0,r.jsx)(D.B,{children:(0,r.jsxs)(D.Tooltip,{children:[(0,r.jsx)(D.TooltipTrigger,{asChild:!0,children:(0,r.jsxs)(L.E,{variant:"outline",className:"\n ".concat("sm"===s?"h-5 px-1.5 text-xs":"h-6 px-2 text-sm","\n ").concat("absolute"===o?"absolute -top-2 -right-2":"inline-flex","\n bg-blue-50 dark:bg-blue-950/20 border-blue-200 dark:border-blue-800 \n text-blue-800 dark:text-blue-200 items-center gap-1\n "),children:[(0,r.jsx)(to.A,{className:"sm"===s?"h-2.5 w-2.5":"h-3 w-3"}),"md"===s&&"From ".concat(a)]})}),(0,r.jsx)(D.TooltipContent,{children:(0,r.jsx)("p",{children:n||"This value is inherited from ".concat(a," level")})})]})}):(0,r.jsx)(D.B,{children:(0,r.jsxs)(D.Tooltip,{children:[(0,r.jsx)(D.TooltipTrigger,{asChild:!0,children:(0,r.jsxs)(L.E,{variant:"outline",className:"\n ".concat("sm"===s?"h-5 px-1.5 text-xs":"h-6 px-2 text-sm","\n ").concat("absolute"===o?"absolute -top-2 -right-2":"inline-flex","\n bg-gray-50 dark:bg-gray-950/20 border-gray-200 dark:border-gray-800 \n text-gray-600 dark:text-gray-400 items-center gap-1\n "),children:[(0,r.jsx)(e9.A,{className:"sm"===s?"h-2.5 w-2.5":"h-3 w-3"}),"md"===s&&"Default"]})}),(0,r.jsx)(D.TooltipContent,{children:(0,r.jsx)("p",{children:n||"Using system default value"})})]})})}function ti(e,t,a,r){let n=null!=t&&""!==t,s=null!=a&&""!==a,o=null!=r&&""!==r;if("project"!==e){if(n&&s&&t===a){let t="agent"===e?"Graph":"Project";return{isExplicit:!1,inheritedFrom:t,tooltip:"This model is inherited from the ".concat(t.toLowerCase()," level")}}if("agent"===e&&n&&!s&&o&&t===r)return{isExplicit:!1,inheritedFrom:"Project",tooltip:"This model is inherited from the project level"}}if(n)return{isExplicit:!0,tooltip:"This model is explicitly configured at the ".concat(e," level")};switch(e){case"agent":if(s)return{isExplicit:!1,inheritedFrom:"Graph",tooltip:"Will inherit from the graph level"};if(o)return{isExplicit:!1,inheritedFrom:"Project",tooltip:"Will inherit from the project level"};break;case"graph":if(s)return{isExplicit:!1,inheritedFrom:"Project",tooltip:"Will inherit from the project level"}}return{isExplicit:!1,tooltip:"Using system default configuration"}}function td(e,t,a,r){let n=null!=a,s=null!=r;if(n&&s&&a===r){if("transferCountIs"===t&&"graph"===e)return{isExplicit:!1,inheritedFrom:"Project",tooltip:"This transfer limit is inherited from the project level"};if("stepCountIs"===t&&"agent"===e)return{isExplicit:!1,inheritedFrom:"Project",tooltip:"This step limit is inherited from the project level"}}if(n)return{isExplicit:!0,tooltip:"This ".concat("transferCountIs"===t?"transfer limit":"step limit"," is explicitly set at the ").concat(e," level")};if("transferCountIs"===t){if("graph"===e&&s)return{isExplicit:!1,inheritedFrom:"Project",tooltip:"Will inherit transfer limit from the project level"}}else if("stepCountIs"===t&&"agent"===e&&s)return{isExplicit:!1,inheritedFrom:"Project",tooltip:"Will inherit step limit from the project level"};return{isExplicit:!1,tooltip:"Using system default (".concat("transferCountIs"===t?"10":"50",")")}}var tc=a(34186),tu=a(1095),tm=a(86772),tp=a(47757);function th(e){let{nameValue:t,idValue:a,onIdChange:r,isEditing:n=!1}=e,s=(0,i.useRef)(!1),o=(0,i.useRef)(""),l=(0,i.useRef)(r),d=(0,i.useRef)(a);(0,i.useEffect)(()=>{l.current=r,d.current=a},[r,a]),(0,i.useEffect)(()=>{n&&(s.current=!1,o.current="")},[n]),(0,i.useEffect)(()=>{n||(a?a!==o.current&&(s.current=!0):(s.current=!1,o.current=""))},[a,n]),(0,i.useEffect)(()=>{if(!n&&t&&!s.current){let e=(0,tp.$)(t);e!==d.current&&(o.current=e,l.current(e))}},[t,n])}let tx=(0,ec.createServerReference)("6048842e0dd23160a8c2889bad072fb5502e3294ae",ec.callServer,void 0,ec.findSourceMapURL,"fetchProjectAction");function tg(){let{tenantId:e,projectId:t}=(0,l.useParams)(),[a,r]=(0,i.useState)(null),[n,s]=(0,i.useState)(!0),[o,d]=(0,i.useState)(null);return(0,i.useEffect)(()=>{!async function(){if(!e||!t)return s(!1);try{s(!0),d(null);let a=await tx(e,t);if(!a.success)throw Error(a.error||"Failed to fetch project");r(a.data||null)}catch(e){console.error("Error fetching project:",e),d(e instanceof Error?e.message:"Unknown error"),r(null)}finally{s(!1)}}()},[e,t]),{project:a,loading:n,error:o}}var tf=a(60049);function tv(e){let{...t}=e,a=function(){let e=(0,i.useRef)(null);return(0,i.useEffect)(()=>{if(e.current&&"function"==typeof e.current.setSelectionRange){var t;let a=e.current,r=(null==(t=a.value)?void 0:t.length)||0;try{a.setSelectionRange(r,r)}catch(e){console.error(e)}}},[]),e}();return(0,r.jsx)(tm.T,{...t,ref:a,className:"w-full max-h-full resize-none h-full",autoFocus:!0})}function tb(e){let{label:t,isRequired:a=!1,...n}=e;return(0,r.jsx)(tf.Z,{name:n.id||"expandable-textarea",label:t,isRequired:a,compactView:(0,r.jsx)(tm.T,{...n}),expandedView:(0,r.jsx)(tv,{...n})})}let tj=(0,i.forwardRef)((e,t)=>{let{id:a,name:n,label:s,value:o,onChange:l,placeholder:i,error:d,className:c="",description:u,tooltip:m,type:p="text",isRequired:h=!1,disabled:x=!1}=e;return(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)(e4.J,{htmlFor:a,className:(0,R.cn)(d?"text-red-600":"","gap-1"),children:[s,h&&(0,r.jsx)("span",{className:"text-red-500",children:"*"}),m&&(0,r.jsxs)(D.Tooltip,{children:[(0,r.jsx)(D.TooltipTrigger,{children:(0,r.jsx)(e9.A,{className:"w-3 h-3 text-muted-foreground ml-1"})}),(0,r.jsx)(D.TooltipContent,{className:"break-words",children:m})]})]}),(0,r.jsx)(tc.p,{ref:t,id:a,name:n,type:p,value:o,onChange:l,placeholder:i,"data-invalid":d?"":void 0,className:"w-full data-invalid:border-red-300 data-invalid:focus-visible:border-red-300 data-invalid:focus-visible:ring-red-300 ".concat(c),disabled:x}),d&&(0,r.jsx)("p",{className:"text-sm text-red-600",children:d}),u&&(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:u})]})});tj.displayName="InputField";let ty=(0,i.forwardRef)((e,t)=>{let{id:a,name:n,label:s,value:o,onChange:l,placeholder:i,error:d,className:c="",description:u,maxHeight:m="max-h-96",disabled:p=!1}=e;return(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(e4.J,{htmlFor:a,className:d?"text-red-600":"",children:s}),(0,r.jsx)(tm.T,{ref:t,id:a,name:n,value:o,onChange:l,placeholder:i,"data-invalid":d?"":void 0,className:"w-full ".concat(m," data-invalid:border-red-300 data-invalid:focus-visible:border-red-300 data-invalid:focus-visible:ring-red-300 ").concat(c),disabled:p}),d&&(0,r.jsx)("p",{className:"text-sm text-red-600",children:d}),u&&(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:u})]})});ty.displayName="TextareaField";var tN=a(52353);function tk(e){let{title:t}=e;return(0,r.jsx)("h3",{className:"text-sm font-semibold",children:t})}function tw(e){let{description:t}=e;return(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:t})}function tC(e){let{title:t,description:a}=e;return(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)(tk,{title:t}),(0,r.jsx)(tw,{description:a})]})}function tT(e){let{contextConfig:t,updateMetadata:a}=e,{id:n,name:s,description:o,contextVariables:l,requestContextSchema:i}=t,d=(e,r)=>{a("contextConfig",{...t,[e]:r})};return(0,r.jsxs)("div",{className:"space-y-8",children:[(0,r.jsx)(tC,{title:"Context configuration",description:"Configure dynamic context for this graph."}),(0,r.jsxs)("div",{className:"flex flex-col space-y-8",children:[(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(e4.J,{htmlFor:"id",children:"Id"}),(0,r.jsx)(tc.p,{id:"id",value:n||"",onChange:e=>d("id",e.target.value),placeholder:"my-context"}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:"Choose a unique identifier for this configuration. Using an existing id will replace that configuration."})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(e4.J,{htmlFor:"name",children:"Name"}),(0,r.jsx)(tc.p,{id:"name",value:s,onChange:e=>d("name",e.target.value),placeholder:"My context"})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(e4.J,{htmlFor:"description",children:"Description"}),(0,r.jsx)(tm.T,{id:"description",value:o,onChange:e=>d("description",e.target.value),placeholder:"Context description...",className:"max-h-96"})]}),(0,r.jsx)(te.y,{name:"contextVariables",label:"Context variables (JSON)",value:l,onChange:e=>d("contextVariables",e),placeholder:"{}",className:""}),(0,r.jsx)(te.y,{name:"requestContextSchema",label:"Request context schema (JSON)",value:i,onChange:e=>d("requestContextSchema",e),placeholder:"{}",className:""})]})]})}let tS=function(){var e,t,a,n,s,o,d,c,u,m,p,h,x,g,f,v,b,j,y,k,w,C,T,S,E,A,I,O,z,M;let P=(0,l.useParams)(),_=N(e=>e.metadata),{graphId:L,tenantId:U,projectId:B}=P,{id:F,name:R,description:V,contextConfig:W,models:J,stopWhen:H,graphPrompt:G,statusUpdates:$}=_,{INKEEP_AGENTS_RUN_API_URL:q}=(0,eU.y)(),{project:Z}=tg(),{markUnsaved:K,setMetadata:X}=N(),Y=(0,i.useCallback)(function(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];X(...t),K()},[X,K]);return th({nameValue:R,idValue:F,onIdChange:(0,i.useCallback)(e=>{Y("id",e)},[Y]),isEditing:!!L}),(0,r.jsxs)("div",{className:"space-y-8",children:[L&&(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("div",{className:"text-sm leading-none font-medium flex items-center gap-1",children:["Chat URL",(0,r.jsxs)(D.Tooltip,{children:[(0,r.jsx)(D.TooltipTrigger,{asChild:!0,children:(0,r.jsx)(e9.A,{className:"w-3 h-3 text-muted-foreground"})}),(0,r.jsx)(D.TooltipContent,{children:"Use this endpoint to chat with your graph or connect it to the Inkeep widget via the graphUrl prop. Supports streaming responses with the Vercel AI SDK data stream protocol."})]})]}),(0,r.jsx)(ta.r,{code:"".concat(q,"/api/chat")}),(0,r.jsx)(tr.G,{href:"/".concat(U,"/projects/").concat(B,"/api-keys"),children:"Create API key"})]}),(0,r.jsx)(tj,{id:"name",name:"name",label:"Name",value:R,onChange:e=>Y("name",e.target.value),placeholder:"My graph",isRequired:!0}),(0,r.jsx)(tj,{id:"id",name:"id",label:"Id",value:F||"",onChange:e=>Y("id",e.target.value),disabled:!!L,placeholder:"my-graph",description:L?void 0:"Choose a unique identifier for this graph. Using an existing id will replace that graph.",isRequired:!0}),(0,r.jsx)(ty,{id:"description",name:"description",label:"Description",value:V,onChange:e=>Y("description",e.target.value),placeholder:"This graph is used to...",className:"max-h-96"}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(tb,{id:"graph-prompt",name:"graph-prompt",label:"Graph prompt",value:G||"",onChange:e=>Y("graphPrompt",e.target.value),placeholder:"System-level instructions for this graph...",className:"max-h-96"}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:"System-level prompt that defines the intended audience and overall goal of this graph. Applied to all agents."})]}),(0,r.jsx)(tu.Separator,{}),(0,r.jsxs)("div",{className:"space-y-8",children:[(0,r.jsx)(tC,{title:"Default models",description:"Set default models that will be inherited by agents that don't have their own models configured."}),(0,r.jsx)("div",{className:"relative",children:(0,r.jsx)(tN.B,{value:(null==J||null==(e=J.base)?void 0:e.model)||"",inheritedValue:null==Z||null==(a=Z.models)||null==(t=a.base)?void 0:t.model,onValueChange:e=>{Y("models",{...J||{},base:e?{...(null==J?void 0:J.base)||{},model:e}:void 0})},label:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:["Base model",(0,r.jsx)(tl,{...ti("graph",null==J||null==(n=J.base)?void 0:n.model,null==Z||null==(o=Z.models)||null==(s=o.base)?void 0:s.model),size:"sm"})]}),tooltip:"Primary model for general agent responses"})}),(0,r.jsxs)(ew.Nt,{defaultOpen:!!(null==J?void 0:J.structuredOutput)||!!(null==J?void 0:J.summarizer),className:"border rounded-md bg-muted/30 dark:bg-muted/20",children:[(0,r.jsx)(ew.R6,{asChild:!0,children:(0,r.jsxs)(eN.$,{variant:"ghost",size:"sm",className:"flex items-center justify-start gap-1.5 p-0 h-auto font-normal text-xs text-foreground/80 dark:text-foreground/90 hover:text-foreground hover:!bg-transparent transition-colors group w-full py-2 px-4",children:[(0,r.jsx)(eb.A,{className:"h-3.5 w-3.5 transition-transform duration-200 group-data-[state=open]:rotate-90"}),"Advanced model options"]})}),(0,r.jsxs)(ew.Ke,{className:"space-y-8 mt-4 data-[state=closed]:animate-[collapsible-up_200ms_ease-out] data-[state=open]:animate-[collapsible-down_200ms_ease-out] overflow-hidden px-4 pb-6",children:[(0,r.jsx)("div",{className:"relative",children:(0,r.jsx)(tN.B,{value:(null==J||null==(d=J.structuredOutput)?void 0:d.model)||"",inheritedValue:(null==Z||null==(u=Z.models)||null==(c=u.structuredOutput)?void 0:c.model)||(null==J||null==(m=J.base)?void 0:m.model)||(null==Z||null==(h=Z.models)||null==(p=h.base)?void 0:p.model),onValueChange:e=>{Y("models",{...J||{},structuredOutput:e?{...(null==J?void 0:J.structuredOutput)||{},model:e}:void 0})},label:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:["Structured output model",(0,r.jsx)(tl,{...ti("graph",null==J||null==(x=J.structuredOutput)?void 0:x.model,null==Z||null==(f=Z.models)||null==(g=f.structuredOutput)?void 0:g.model),size:"sm"})]}),tooltip:"Model for structured outputs and data components (defaults to base model)"})}),(0,r.jsx)("div",{className:"relative",children:(0,r.jsx)(tN.B,{value:(null==J||null==(v=J.summarizer)?void 0:v.model)||"",inheritedValue:(null==Z||null==(j=Z.models)||null==(b=j.summarizer)?void 0:b.model)||(null==J||null==(y=J.base)?void 0:y.model)||(null==Z||null==(w=Z.models)||null==(k=w.base)?void 0:k.model),onValueChange:e=>{Y("models",{...J||{},summarizer:e?{...(null==J?void 0:J.summarizer)||{},model:e}:void 0})},label:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:["Summarizer model",(0,r.jsx)(tl,{...ti("graph",null==J||null==(C=J.summarizer)?void 0:C.model,null==Z||null==(S=Z.models)||null==(T=S.summarizer)?void 0:T.model),size:"sm"})]}),tooltip:"Model for summarization tasks (defaults to base model)"})})]})]}),(0,r.jsx)(tn.L,{title:"How model inheritance works:",Icon:e9.A,children:(0,r.jsx)(tt.O,{})}),(null==J||null==(E=J.base)?void 0:E.model)&&(0,r.jsx)(te.y,{name:"base-provider-options",label:"Base model provider options",onChange:e=>{var t;Y("models",{...J||{},base:{model:(null==(t=J.base)?void 0:t.model)||"",providerOptions:e}})},value:J.base.providerOptions||"",placeholder:'{\n "temperature": 0.7,\n "maxTokens": 2048\n}'}),(null==J||null==(A=J.structuredOutput)?void 0:A.model)&&(0,r.jsx)(te.y,{name:"structured-provider-options",label:"Structured output model provider options",onChange:e=>{var t;Y("models",{...J||{},structuredOutput:{model:(null==(t=J.structuredOutput)?void 0:t.model)||"",providerOptions:e}})},value:J.structuredOutput.providerOptions||"",placeholder:'{\n "temperature": 0.1,\n "maxTokens": 1024\n}'}),(null==J||null==(I=J.summarizer)?void 0:I.model)&&(0,r.jsx)(te.y,{name:"summarizer-provider-options",label:"Summarizer model provider options",onChange:e=>{var t;Y("models",{...J||{},summarizer:{model:(null==(t=J.summarizer)?void 0:t.model)||"",providerOptions:e}})},value:J.summarizer.providerOptions||"",placeholder:'{\n "temperature": 0.3,\n "maxTokens": 1024\n}'})]}),(0,r.jsx)(tu.Separator,{}),(0,r.jsxs)("div",{className:"space-y-8",children:[(0,r.jsx)(tC,{title:"Execution limits",description:"Configure graph-level execution limits for transfers between agents."}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(e4.J,{htmlFor:"transfer-count",children:"Max transfers"}),(0,r.jsx)(tl,{...td("graph","transferCountIs",null==H?void 0:H.transferCountIs,null==Z||null==(O=Z.stopWhen)?void 0:O.transferCountIs),size:"sm"})]}),(0,r.jsx)(tc.p,{id:"transfer-count",type:"number",min:"1",max:"100",value:(null==H?void 0:H.transferCountIs)||"",onChange:e=>{let t=e.target.value?parseInt(e.target.value,10):void 0;Y("stopWhen",{...H||{},transferCountIs:t})},placeholder:"10"}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:"Maximum number of agent transfers per conversation (defaults to 10 if not set)"})]}),(0,r.jsx)(tn.L,{title:"How execution limit inheritance works:",Icon:e9.A,children:(0,r.jsxs)("ul",{className:"space-y-1.5 list-disc list-outside pl-4",children:[(0,r.jsxs)("li",{children:[(0,r.jsx)("span",{className:"font-medium",children:"transferCountIs"}),": Project → Graph only (controls transfers between agents)"]}),(0,r.jsxs)("li",{children:[(0,r.jsx)("span",{className:"font-medium",children:"Explicit settings"})," always take precedence over inherited values"]}),(0,r.jsxs)("li",{children:[(0,r.jsx)("span",{className:"font-medium",children:"Default fallback"}),": transferCountIs = 10 if no value is set anywhere"]}),(0,r.jsxs)("li",{children:[(0,r.jsx)("span",{className:"font-medium",children:"Graph scope"}),": This limit applies to all agents within this graph"]})]})})]}),(0,r.jsx)(tu.Separator,{}),(0,r.jsxs)("div",{className:"space-y-8",children:[(0,r.jsx)(tC,{title:"Status updates",description:"Configure structured status updates for conversation progress tracking."}),(0,r.jsxs)("div",{className:"space-y-8",children:[(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)(e5.S,{id:"status-updates-enabled",checked:null==(z=null==$?void 0:$.enabled)||z,onCheckedChange:e=>{Y("statusUpdates",{...$||{},enabled:!0===e})}}),(0,r.jsx)(e4.J,{htmlFor:"status-updates-enabled",children:"Enable status updates"})]}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:"Send structured status updates during conversation execution"})]}),(null==(M=null==$?void 0:$.enabled)||M)&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(e4.J,{htmlFor:"status-updates-prompt",children:"Status updates prompt"}),(0,r.jsx)(tm.T,{id:"status-updates-prompt",value:(null==$?void 0:$.prompt)||"",onChange:e=>{Y("statusUpdates",{...$||{},prompt:e.target.value})},placeholder:"Generate a status update describing the current progress...",className:"max-h-32"}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:"Custom prompt for generating status updates (optional)"})]}),(0,r.jsxs)("div",{className:"space-y-8",children:[(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)(e4.J,{children:"Update frequency type"}),(0,r.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)(e5.S,{id:"event-based-updates",checked:!!(null==$?void 0:$.numEvents),onCheckedChange:e=>{if(e)Y("statusUpdates",{...$||{},numEvents:(null==$?void 0:$.numEvents)||10});else{let e={...$};delete e.numEvents,Y("statusUpdates",e)}}}),(0,r.jsx)(e4.J,{htmlFor:"event-based-updates",children:"Event-based updates"})]}),(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)(e5.S,{id:"time-based-updates",checked:!!(null==$?void 0:$.timeInSeconds),onCheckedChange:e=>{if(e)Y("statusUpdates",{...$||{},timeInSeconds:(null==$?void 0:$.timeInSeconds)||30});else{let e={...$};delete e.timeInSeconds,Y("statusUpdates",e)}}}),(0,r.jsx)(e4.J,{htmlFor:"time-based-updates",children:"Time-based updates"})]})]})]}),(null==$?void 0:$.numEvents)&&(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(e4.J,{htmlFor:"num-events",children:"Number of events"}),(0,r.jsx)(tc.p,{id:"num-events",type:"number",min:"1",max:"100",value:$.numEvents||"",onChange:e=>{let t=e.target.value?parseInt(e.target.value,10):void 0;Y("statusUpdates",{...$||{},numEvents:t})},placeholder:"10"}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:"Number of events/steps between status updates (default: 10)"})]}),(null==$?void 0:$.timeInSeconds)&&(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(e4.J,{htmlFor:"time-in-seconds",children:"Time interval (seconds)"}),(0,r.jsx)(tc.p,{id:"time-in-seconds",type:"number",min:"1",max:"600",value:$.timeInSeconds||"",onChange:e=>{let t=e.target.value?parseInt(e.target.value,10):void 0;Y("statusUpdates",{...$||{},timeInSeconds:t})},placeholder:"30"}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:"Time interval in seconds between status updates (default: 30)"})]})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(te.y,{name:"status-components",label:"Status components configuration",onChange:e=>{Y("statusUpdates",{...$||{},statusComponents:e})},value:(null==$?void 0:$.statusComponents)||"",placeholder:'[\n {\n "id": "tool_call_summary",\n "name": "Tool Call",\n "description": "A summary of a single tool call and why it was relevant to the current task. Be specific about what was found or accomplished.",\n "schema": {\n "type": "object",\n "properties": {\n "tool_name": {\n "type": "string",\n "description": "The name of the tool that was called"\n },\n "summary": {\n "type": "string",\n "description": "Brief summary of what was accomplished. Keep it to 3-5 words."\n },\n "status": {\n "type": "string",\n "enum": ["success", "error", "in_progress"],\n "description": "Status of the tool call"\n }\n },\n "required": ["tool_name", "summary"]\n }\n }\n]'}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:"Define structured components for status updates. Each component has an id, name, description, and JSON schema."})]})]})]})]}),(0,r.jsx)(tu.Separator,{}),(0,r.jsx)(tT,{contextConfig:W,updateMetadata:Y})]})};function tE(e){let{selectedNodeId:t,errorHelpers:a}=e,{updateNodeData:r}=(0,n.VH)(),s=N(e=>e.markUnsaved),o=(0,i.useRef)({}),l=(0,i.useCallback)((e,t)=>{t?o.current[e]=t:delete o.current[e]},[]),d=(0,i.useCallback)(e=>null==a?void 0:a.getFieldErrorMessage(e),[a]),c=(0,i.useCallback)((e,a)=>{r(t,{[e]:a}),s()},[t,r,s]),u=(0,i.useCallback)(e=>{let{name:t,value:a}=e.target;c(t,a)},[c]),m=(0,i.useCallback)((e,t)=>{e.split(".").length,c(e,t)},[c]),p=(0,i.useCallback)((e,t,a)=>{let r=e.split(".");if(1===r.length)c(e,t);else{let[e,...n]=r,s={...(null==a?void 0:a[e])||{}},o=s;for(let e=0;e<n.length-1;e++){let t=n[e];t in o&&null!==o[t]&&void 0!==o[t]||(o[t]={}),o=o[t]}let l=n[n.length-1];if(null==t||""===t){if(delete o[l],0===Object.keys(s).length||0===Object.keys(o).length)return void c(e,null)}else o[l]=t;c(e,s)}},[c]);return{updateField:c,updatePath:m,updateNestedPath:p,handleInputChange:u,getFieldError:d,setFieldRef:l,markUnsaved:s}}var tA=a(44001),tI=a(46205),tO=a(66041),tz=a(38678),tM=a(85276),tP=a.n(tM);function t_(e){let{message:t,actionText:a,actionHref:n}=e;return(0,r.jsxs)("div",{className:"flex flex-col gap-2 h-full justify-center items-center",children:[(0,r.jsx)("p",{className:"text-sm text-gray-400 dark:text-white/50",children:t}),(0,r.jsx)("div",{className:"inline-block",children:n&&(0,r.jsxs)(tP(),{target:"_blank",rel:"noopener noreferrer",href:n,className:"font-mono gap-2 text-xs flex items-center uppercase font-medium text-gray-500 hover:text-gray-700",children:[a,(0,r.jsx)(tz.A,{className:"w-4 h-4"})]})})]})}function tL(e){let{selectedComponents:t,handleToggle:a,availableComponents:n,emptyStateMessage:s,emptyStateActionText:o,emptyStateActionHref:l,placeholder:d="Select components..."}=e,[c,u]=(0,i.useState)(!1);return(0,r.jsx)("div",{className:"flex w-full",children:(0,r.jsxs)(tO.AM,{open:c,onOpenChange:u,children:[(0,r.jsx)(tO.Wv,{asChild:!0,children:(0,r.jsxs)(eN.$,{variant:"outline",role:"combobox","aria-expanded":c,className:"w-full justify-between bg-transparent text-gray-700",children:[0===t.length?(0,r.jsx)("div",{className:"text-muted-foreground",children:d}):"".concat(t.length," selected"),(0,r.jsx)(tA.A,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,r.jsx)(tO.hl,{className:"w-[var(--radix-popover-trigger-width)] p-0",children:(0,r.jsxs)(tI.uB,{children:[(0,r.jsx)(tI.G7,{placeholder:"Search components..."}),(0,r.jsx)(tI.xL,{children:(0,r.jsx)(t_,{message:s||"No components found.",actionText:o,actionHref:l})}),(0,r.jsx)(tI.oI,{className:"max-h-64",children:(0,r.jsx)(tI.L$,{children:n.map(e=>{let{id:n,name:s,description:o}=e;return(0,r.jsxs)(tI.h_,{onSelect:()=>a(n),className:"flex items-start gap-3 p-3 group cursor-pointer",children:[(0,r.jsx)(e5.S,{checked:t.includes(n),className:"mt-0.5 [&_svg]:!text-primary-foreground"}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("div",{className:"flex items-center gap-2 mb-1",children:(0,r.jsx)("span",{className:"font-medium",children:s})}),o&&(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:o})]})]},n)})})})]})})]})})}function tU(e){let{label:t,count:a}=e;return(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(e4.J,{children:t}),(0,r.jsx)(L.E,{variant:"code",className:"border-none px-2 text-[10px] text-muted-foreground",children:a})]})}function tB(e){let{selectedComponents:t,componentLookup:a,handleToggle:n}=e;return(0,r.jsx)("div",{className:"space-y-2",children:(0,r.jsx)("div",{className:"flex flex-wrap gap-2",children:t.map(e=>{let t=a[e];return(0,r.jsxs)(L.E,{variant:"code",className:"text-xs",children:[(null==t?void 0:t.name)||e,(0,r.jsx)(eN.$,{variant:"ghost",size:"icon-sm",className:" size-3 ml-1",onClick:()=>n(e),children:(0,r.jsx)(ej.A,{className:"size-3"})})]},e)})})})}function tD(e){let{label:t,componentLookup:a,selectedComponents:n,onSelectionChange:s,emptyStateMessage:o,emptyStateActionText:l,emptyStateActionHref:i,placeholder:d="Select components..."}=e,c=e=>{s(n.includes(e)?n.filter(t=>t!==e):[...n,e])};return(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,r.jsx)(tU,{label:t,count:n.length}),n.length>0&&(0,r.jsx)(tB,{selectedComponents:n,componentLookup:a,handleToggle:c})]}),(0,r.jsx)(tL,{selectedComponents:n,handleToggle:c,availableComponents:Object.values(a),emptyStateMessage:o,emptyStateActionText:l,emptyStateActionHref:i,placeholder:d})]})}function tF(e){var t,a,n,s,o,l,i,d,c,u,m,p,h,x,g,f,v,b,j,y,N,k,w,C,T,S,E,A,I,O;let{models:z,updatePath:M,projectModels:P,graphModels:_}=e,L=(null==z?void 0:z.structuredOutput)||(null==z?void 0:z.summarizer);return(null==z?void 0:z.base)||(null==z?void 0:z.structuredOutput)||null==z||z.summarizer,(0,r.jsxs)("div",{className:"space-y-8",children:[(0,r.jsx)("div",{className:"relative",children:(0,r.jsx)(tN.B,{value:(null==z||null==(t=z.base)?void 0:t.model)||"",onValueChange:e=>{M("models.base.model",e||void 0)},inheritedValue:(null==_||null==(a=_.base)?void 0:a.model)||(null==P||null==(n=P.base)?void 0:n.model),label:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:["Base model",(0,r.jsx)(tl,{...ti("agent",null==z||null==(s=z.base)?void 0:s.model,null==_||null==(o=_.base)?void 0:o.model,null==P||null==(l=P.base)?void 0:l.model),size:"sm"})]}),tooltip:"Primary model for general agent responses"})}),(0,r.jsxs)(ew.Nt,{defaultOpen:!!L,className:"border rounded-md bg-muted/30 dark:bg-muted/20",children:[(0,r.jsx)(ew.R6,{asChild:!0,children:(0,r.jsxs)(eN.$,{variant:"ghost",size:"sm",className:"flex items-center justify-start gap-1.5 p-0 h-auto font-normal text-xs text-foreground/80 dark:text-foreground/90 hover:text-foreground hover:!bg-transparent transition-colors group w-full py-2 px-4",children:[(0,r.jsx)(eb.A,{className:"h-3.5 w-3.5 transition-transform duration-200 group-data-[state=open]:rotate-90"}),"Advanced Model Options"]})}),(0,r.jsxs)(ew.Ke,{className:"space-y-8 mt-4 data-[state=closed]:animate-[collapsible-up_200ms_ease-out] data-[state=open]:animate-[collapsible-down_200ms_ease-out] overflow-hidden px-4 pb-6",children:[(0,r.jsx)("div",{className:"relative",children:(0,r.jsx)(tN.B,{value:(null==z||null==(i=z.structuredOutput)?void 0:i.model)||"",onValueChange:e=>{M("models.structuredOutput.model",e||void 0)},inheritedValue:(null==_||null==(d=_.structuredOutput)?void 0:d.model)||(null==P||null==(c=P.structuredOutput)?void 0:c.model)||(null==z||null==(u=z.base)?void 0:u.model)||(null==_||null==(m=_.base)?void 0:m.model)||(null==P||null==(p=P.base)?void 0:p.model),label:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:["Structured output model",(0,r.jsx)(tl,{...ti("agent",null==z||null==(h=z.structuredOutput)?void 0:h.model,null==_||null==(x=_.structuredOutput)?void 0:x.model,null==P||null==(g=P.structuredOutput)?void 0:g.model),size:"sm"})]}),tooltip:"The model used for structured output and data components (defaults to base model)"})}),(0,r.jsx)("div",{className:"relative",children:(0,r.jsx)(tN.B,{value:(null==z||null==(f=z.summarizer)?void 0:f.model)||"",onValueChange:e=>{M("models.summarizer.model",e||void 0)},inheritedValue:(null==_||null==(v=_.summarizer)?void 0:v.model)||(null==P||null==(b=P.summarizer)?void 0:b.model)||(null==z||null==(j=z.base)?void 0:j.model)||(null==_||null==(y=_.base)?void 0:y.model)||(null==P||null==(N=P.base)?void 0:N.model),label:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:["Summarizer model",(0,r.jsx)(tl,{...ti("agent",null==z||null==(k=z.summarizer)?void 0:k.model,null==_||null==(w=_.summarizer)?void 0:w.model,null==P||null==(C=P.summarizer)?void 0:C.model),size:"sm"})]}),tooltip:"The model used for summarization tasks (defaults to base model)"})})]})]}),(null==z||null==(T=z.base)?void 0:T.model)&&(0,r.jsx)(te.y,{name:"base-provider-options",label:"Base model provider options",onChange:e=>{M("models.base.providerOptions",e)},value:(null==z||null==(S=z.base)?void 0:S.providerOptions)||"",placeholder:'{\n "temperature": 0.7,\n "maxTokens": 2048\n}'}),(null==z||null==(E=z.structuredOutput)?void 0:E.model)&&(0,r.jsx)(te.y,{name:"structured-provider-options",label:"Structured output model provider options",onChange:e=>{M("models.structuredOutput.providerOptions",e)},value:(null==z||null==(A=z.structuredOutput)?void 0:A.providerOptions)||"",placeholder:'{\n "temperature": 0.1,\n "maxTokens": 1024\n}'}),(null==z||null==(I=z.summarizer)?void 0:I.model)&&(0,r.jsx)(te.y,{name:"summarizer-provider-options",label:"Summarizer model provider options",onChange:e=>{M("models.summarizer.providerOptions",e)},value:(null==z||null==(O=z.summarizer)?void 0:O.providerOptions)||"",placeholder:'{\n "temperature": 0.3,\n "maxTokens": 1024\n}'}),(0,r.jsx)(tn.L,{title:"How model inheritance works:",Icon:e9.A,children:(0,r.jsx)(tt.O,{})})]})}function tR(e){var t,a,n,s,o;let{selectedNode:d,dataComponentLookup:c,artifactComponentLookup:u,errorHelpers:m}=e,{tenantId:p,projectId:h}=(0,l.useParams)(),x=(null==(t=d.data)?void 0:t.dataComponents)||[],g=(null==(a=d.data)?void 0:a.artifactComponents)||[],{project:f}=tg(),v=N(e=>e.metadata),{updatePath:b,updateNestedPath:j,getFieldError:y,setFieldRef:k}=tE({selectedNodeId:d.id,errorHelpers:m}),w=(0,i.useCallback)((e,t)=>{j(e,t,d.data)},[j,d.data]),C=(0,i.useCallback)(e=>{b("id",e)},[b]);return th({nameValue:d.data.name,idValue:d.data.id,onIdChange:C,isEditing:!1}),(0,r.jsxs)("div",{className:"space-y-8 flex flex-col",children:[(0,r.jsx)(tj,{ref:e=>k("name",e),id:"name",name:"name",label:"Name",value:d.data.name||"",onChange:e=>b("name",e.target.value),placeholder:"Support agent",error:y("name"),isRequired:!0}),(0,r.jsx)(tj,{ref:e=>k("id",e),id:"id",name:"id",label:"Id",value:d.data.id||"",onChange:e=>b("id",e.target.value),placeholder:"my-agent",error:y("id"),description:"Choose a unique identifier for this agent. Using an existing id will replace that agent.",isRequired:!0}),(0,r.jsx)(ty,{ref:e=>k("description",e),id:"description",name:"description",label:"Description",value:d.data.description||"",onChange:e=>b("description",e.target.value),placeholder:"This agent is responsible for...",error:y("description")}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(tb,{ref:e=>k("prompt",e),id:"prompt",name:"prompt",value:d.data.prompt||"",onChange:e=>b("prompt",e.target.value),placeholder:"You are a helpful assistant...","data-invalid":(null==m?void 0:m.hasFieldError("prompt"))?"":void 0,className:"w-full max-h-96 data-invalid:border-red-300 data-invalid:focus-visible:border-red-300 data-invalid:focus-visible:ring-red-300",label:"Prompt",isRequired:!0}),y("prompt")&&(0,r.jsx)("p",{className:"text-sm text-red-600",children:y("prompt")})]}),(0,r.jsx)(tF,{models:d.data.models,updatePath:w,projectModels:null==f?void 0:f.models,graphModels:null==v?void 0:v.models}),(0,r.jsx)(tu.Separator,{}),(0,r.jsxs)("div",{className:"space-y-8 ",children:[(0,r.jsx)(tC,{title:"Execution limits",description:"Configure agent-level execution limits for steps within this agent."}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(e4.J,{htmlFor:"step-count",children:"Max steps"}),(0,r.jsx)(tl,{...td("agent","stepCountIs",null==(n=d.data.stopWhen)?void 0:n.stepCountIs,null==f||null==(s=f.stopWhen)?void 0:s.stepCountIs),size:"sm"})]}),(0,r.jsx)(tc.p,{id:"step-count",type:"number",min:"1",max:"1000",value:(null==(o=d.data.stopWhen)?void 0:o.stepCountIs)||"",onChange:e=>{let t=e.target.value?parseInt(e.target.value,10):void 0;b("stopWhen",{...d.data.stopWhen||{},stepCountIs:t})},placeholder:"50"}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:"Maximum number of execution steps for this agent (defaults to 50 if not set)"})]}),(0,r.jsx)(tn.L,{title:"How execution limit inheritance works:",Icon:e9.A,children:(0,r.jsxs)("ul",{className:"space-y-1.5 list-disc list-outside pl-4",children:[(0,r.jsxs)("li",{children:[(0,r.jsx)("span",{className:"font-medium",children:"stepCountIs"}),": Project → Agent only (agent-level execution limit)"]}),(0,r.jsxs)("li",{children:[(0,r.jsx)("span",{className:"font-medium",children:"Explicit settings"})," always take precedence over inherited values"]}),(0,r.jsxs)("li",{children:[(0,r.jsx)("span",{className:"font-medium",children:"Agent scope"}),": This limit applies only to this specific agent's execution steps"]}),(0,r.jsxs)("li",{children:[(0,r.jsx)("span",{className:"font-medium",children:"Independent from transfers"}),": Steps are counted per agent, transfers are counted per conversation"]})]})})]}),(0,r.jsx)(tu.Separator,{}),(0,r.jsx)(tD,{label:"Data components",componentLookup:c,selectedComponents:x,onSelectionChange:e=>{b("dataComponents",e)},emptyStateMessage:"No data components found.",emptyStateActionText:"Create data component",emptyStateActionHref:"/".concat(p,"/projects/").concat(h,"/data-components/new"),placeholder:"Select data components..."}),(0,r.jsx)(tD,{label:"Artifact components",componentLookup:u,selectedComponents:g,onSelectionChange:e=>{b("artifactComponents",e)},emptyStateMessage:"No artifact components found.",emptyStateActionText:"Create artifact component",emptyStateActionHref:"/".concat(p,"/projects/").concat(h,"/artifact-components/new"),placeholder:"Select artifact components..."})]})}function tV(e){let{selectedNode:t,errorHelpers:a}=e,{handleInputChange:n,getFieldError:s,setFieldRef:o}=tE({selectedNodeId:t.id,errorHelpers:a}),l=(0,i.useCallback)(e=>{n({target:{name:"id",value:e}})},[n]);return th({nameValue:t.data.name,idValue:t.data.id,onIdChange:l,isEditing:!1}),(0,r.jsxs)("div",{className:"space-y-8 flex flex-col",children:[(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:"External agents are agents external to a graph that can communicate using the A2A (Agent-to-Agent) protocol. External agents enable you to delegate tasks between graphs within the agent framework or to third-party services."}),(0,r.jsx)(tj,{ref:e=>o("name",e),id:"name",name:"name",label:"Name",value:t.data.name||"",onChange:n,placeholder:"Support agent",error:s("name")}),(0,r.jsx)(tj,{ref:e=>o("id",e),id:"id",name:"id",label:"Id",value:t.data.id||"",onChange:n,placeholder:"my-external-agent",error:s("id"),description:"Choose a unique identifier for this agent. Using an existing id will replace that agent.",isRequired:!0}),(0,r.jsx)(ty,{ref:e=>o("description",e),id:"description",name:"description",label:"Description",value:t.data.description||"",onChange:n,placeholder:"This agent is responsible for...",error:s("description")}),(0,r.jsx)(tj,{ref:e=>o("baseUrl",e),id:"baseUrl",name:"baseUrl",label:"Host URL",value:t.data.baseUrl||"",onChange:n,placeholder:"https://api.example.com/agent",error:s("baseUrl"),tooltip:"This URL is used to discover the agent's capabilities and communicate with it using the A2A protocol. For locally hosted graphs defined with the agent-framework this would be: http://localhost:3002/tenants/:tenantId/projects/:projectId/agents/:graphId"})]})}function tW(e){var t,a,s,o,i,d;let{selectedNode:c,selectedToolsLookup:u,toolLookup:m}=e,{updateNodeData:p}=(0,n.VH)(),{tenantId:h,projectId:x}=(0,l.useParams)(),g=N(e=>e.markUnsaved),f=m[c.data.toolId],v=null==f?void 0:f.availableTools,b=(0,eg.O)({availableTools:v,activeTools:null==f||null==(a=f.config)||null==(t=a.mcp)?void 0:t.activeTools});if(!f)return(0,r.jsx)("div",{className:"flex items-center justify-center p-4",children:(0,r.jsxs)("div",{className:"text-sm text-muted-foreground",children:["Tool data not found for ",c.data.toolId]})});let j=ef(c,u),y=j&&Array.isArray(j)?j.filter(e=>!(null==b?void 0:b.some(t=>t.name===e))):[],k=e=>{let t,a=null===j?(null==b?void 0:b.map(e=>e.name))||[]:[...j];t=a.includes(e)?a.filter(t=>t!==e):[...a,e];let r=(null==b?void 0:b.map(e=>e.name))||[],n=t;t.length===r.length&&r.every(e=>t.includes(e))&&(n=null),p(c.id,{...c.data,tempSelectedTools:n}),g()},w=e=>{let{name:t,value:a}=e.target;c&&(p(c.id,{[t]:a}),g())},C=null;try{C=f?(0,ex.T)(f).type:null}catch(e){console.error(e)}return(0,r.jsxs)("div",{className:"space-y-8",children:[(null==f?void 0:f.imageUrl)&&(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(Z.u,{imageUrl:f.imageUrl,name:f.name,provider:C||void 0,size:32,className:"rounded-lg"}),(0,r.jsx)("span",{className:"font-medium text-sm truncate",children:f.name})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(e4.J,{htmlFor:"node-id",children:"Id"}),(0,r.jsx)(tc.p,{id:"node-id",value:c.data.toolId,disabled:!0})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(e4.J,{htmlFor:"name",children:"Name"}),(0,r.jsx)(tc.p,{id:"name",name:"name",value:(null==f?void 0:f.name)||"",onChange:w,placeholder:"MCP server",className:"w-full",disabled:!0})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(e4.J,{htmlFor:"url",children:"URL"}),(0,r.jsx)(tc.p,{id:"url",name:"url",value:(null==f||null==(i=f.config)||null==(o=i.mcp)||null==(s=o.server)?void 0:s.url)||"",onChange:w,placeholder:"https://mcp.inkeep.com",disabled:!0,className:"w-full"})]}),(null==f?void 0:f.imageUrl)&&(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(e4.J,{htmlFor:"imageUrl",children:"Image URL"}),(0,r.jsx)(tc.p,{id:"imageUrl",name:"imageUrl",value:f.imageUrl||"",onChange:w,placeholder:"https://example.com/icon.png",disabled:!0,className:"w-full"})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(e4.J,{children:"Selected tools"}),(0,r.jsx)(L.E,{variant:"code",className:"border-none px-2 text-[10px] text-gray-700 dark:text-gray-300",children:null===j?null!=(d=null==b?void 0:b.length)?d:0:j.length})]}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground mb-1.5",children:"Click to select/deselect"}),b&&b.length>0||y.length>0?(0,r.jsxs)("div",{className:"flex flex-wrap gap-2",children:[null==b?void 0:b.map(e=>{let t=null===j||j.includes(e.name);return(0,r.jsxs)(D.Tooltip,{children:[(0,r.jsx)(D.TooltipTrigger,{asChild:!0,children:(0,r.jsxs)(L.E,{variant:t?"primary":"code",className:"flex items-center gap-1 cursor-pointer transition-colors ".concat(t?"hover:bg-primary/10":"bg-transparent dark:bg-transparent dark:hover:bg-muted/50 hover:bg-muted/100"),onClick:()=>k(e.name),children:[e.name,t&&(0,r.jsx)("span",{className:"text-xs",children:(0,r.jsx)(ts.A,{className:"w-2.5 h-2.5"})})]})}),(0,r.jsx)(D.TooltipContent,{className:"max-w-xs text-sm",children:(0,r.jsx)("div",{className:"line-clamp-4",children:e.description})})]},e.name)}),y.map(e=>(0,r.jsxs)(D.Tooltip,{children:[(0,r.jsx)(D.TooltipTrigger,{asChild:!0,children:(0,r.jsxs)(L.E,{variant:"warning",className:"flex items-center gap-1 cursor-pointer transition-colors hover:bg-primary/10 normal-case",onClick:()=>k(e),children:[e,(0,r.jsx)("span",{className:"text-xs",children:(0,r.jsx)(B.A,{className:"w-2.5 h-2.5"})})]})}),(0,r.jsx)(D.TooltipContent,{className:"max-w-xs text-sm",children:(0,r.jsx)("div",{className:"line-clamp-4",children:"This tool was selected but is not available in the MCP server. Click to remove it from the selection."})})]},"orphaned-".concat(e)))]}):null]}),(0,r.jsx)(tr.G,{href:"/".concat(h,"/projects/").concat(x,"/mcp-servers/").concat(c.data.toolId,"/edit"),children:"Edit MCP Server"})]})}var tJ=a(89834),tH=a(93431);function tG(e){let{title:t}=e;return(0,r.jsx)("div",{children:(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)("h3",{className:"text-sm font-medium mb-2",children:t}),(0,r.jsx)("div",{className:"flex flex-col gap-2 min-w-0 min-h-0",children:[1,2,3].map(e=>(0,r.jsx)(tH.E,{className:"w-full h-[72px] rounded-lg"},e))})]})})}function t$(e){var t,a,n,s;let{mcp:o,onClick:l}=e,i=null==(a=o.config)||null==(t=a.mcp)?void 0:t.server,{id:d,name:c,availableTools:u,imageUrl:m,config:p}=o,h=(0,eg.O)({availableTools:u,activeTools:null==p||null==(n=p.mcp)?void 0:n.activeTools}),x=null!=(s=null==h?void 0:h.length)?s:0;return(0,r.jsx)(eN.$,{variant:"unstyled",size:"unstyled",type:"button",className:"w-full p-3 rounded-lg border cursor-pointer transition-colors border-border hover:bg-muted/50 text-left inline-block",id:d,onClick:()=>l(o),children:(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)(Z.u,{imageUrl:m,name:c,provider:c,size:32,className:"flex-shrink-0 mt-0.5"}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-1 gap-2 min-w-0 truncate",children:[(0,r.jsx)("span",{className:"font-medium text-sm truncate",children:c}),u&&(0,r.jsx)("div",{children:(0,r.jsx)(L.E,{variant:"code",className:"text-2xs flex-shrink-0",children:1===x?"1 tool":"".concat(x," tools")})})]}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:null==i?void 0:i.url})]})]})},d)}function tq(e){let{selectedNode:t}=e,{updateNode:a}=(0,n.VH)(),{tenantId:s,projectId:o}=(0,l.useParams)(),{tools:c,isLoading:u,error:m}=(()=>{let[e,t]=(0,i.useState)([]),[a,r]=(0,i.useState)(!0),[n,s]=(0,i.useState)(null),{tenantId:o,projectId:c}=(0,l.useParams)();return(0,i.useEffect)(()=>{(async()=>{try{r(!0),s(null);let e=await (0,tJ.i)(o,c);t(e)}catch(t){let e=t instanceof Error?t.message:"Failed to load MCP tools";s(e),d.oR.error(e)}finally{r(!1)}})()},[o,c]),{tools:e,isLoading:a,error:n}})(),p=e=>{a(t.id,{type:K.MCP,data:{toolId:e.id}})};return u?(0,r.jsx)(tG,{title:"Select MCP server"}):m?(0,r.jsx)(t_,{message:"Something went wrong.",actionText:"Create MCP server",actionHref:"/".concat(s,"/projects/").concat(o,"/mcp-servers/new")}):(null==c?void 0:c.length)?(0,r.jsx)("div",{children:(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)("h3",{className:"text-sm font-medium mb-2",children:"Select MCP server"}),(0,r.jsx)("div",{className:"flex flex-col gap-2 min-w-0 min-h-0",children:c.map(e=>(0,r.jsx)(t$,{mcp:e,onClick:p},e.id))})]})}):(0,r.jsx)(t_,{message:"No MCP servers found.",actionText:"Create MCP server",actionHref:"/".concat(s,"/projects/").concat(o,"/mcp-servers/new")})}function tZ(e){let{selectedNodeId:t,selectedEdgeId:a,onClose:s,backToGraph:o,isOpen:l,dataComponentLookup:d,artifactComponentLookup:c,selectedToolsLookup:u,toolLookup:m}=e,p=(0,n.j7)(t||""),h=(0,n.Yu)(),{hasFieldError:x,getFieldErrorMessage:g,getFirstErrorField:f}=U(),b=(0,i.useMemo)(()=>a?h.find(e=>e.id===a):null,[a,h]),{heading:j,HeadingIcon:y}=(0,i.useMemo)(()=>{let e,t="";if(p){let a=er[null==p?void 0:p.type];t=(null==a?void 0:a.name)||"Node",e=null==a?void 0:a.Icon}else if(b){let a=v[(null==b?void 0:b.type)||"default"];t=(null==a?void 0:a.name)||"Connection",e=null==a?void 0:a.Icon}else t="Graph",e=eX.A;return{heading:t,HeadingIcon:e}},[p,b]),N=(0,i.useMemo)(()=>{if(p){var e;let t=null==p?void 0:p.type,a=(null==(e=p.data)?void 0:e.id)||p.id,n={hasFieldError:e=>x(a,e),getFieldErrorMessage:e=>g(a,e),getFirstErrorField:()=>f(a)};switch(t){case K.Agent:return(0,r.jsx)(tR,{selectedNode:p,dataComponentLookup:d,artifactComponentLookup:c,errorHelpers:n});case K.ExternalAgent:return(0,r.jsx)(tV,{selectedNode:p,errorHelpers:n});case K.MCPPlaceholder:return(0,r.jsx)(tq,{selectedNode:p});case K.MCP:return(0,r.jsx)(tW,{selectedNode:p,selectedToolsLookup:u,toolLookup:m});default:return null}}return b?(0,r.jsx)(e6,{selectedEdge:b}):(0,r.jsx)(tS,{})},[p,b,d,c,x,g,f,u,m]),k=(0,i.useMemo)(()=>p||b,[p,b]);return(0,r.jsx)(eQ.Root,{isOpen:l,children:l&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(eQ.Header,{children:[(0,r.jsxs)("div",{className:"flex items-center relative",children:[k&&(0,r.jsx)(eQ.BackButton,{onClick:o}),(0,r.jsx)(e7,{heading:j,Icon:y,className:k?"transition-all duration-300 ease-in-out group-hover:translate-x-8":""})]}),(0,r.jsx)(eQ.CloseButton,{onClick:s})]}),(0,r.jsx)(eQ.Content,{children:N})]})})}var tK=a(68506),tX=a(97405);function tY(e){let{onSubmit:t,isPreviewDisabled:a,toggleSidePane:n,setShowPlayground:s}=e,o=N(e=>e.dirty),l=(0,r.jsxs)(eN.$,{disabled:o||a,variant:"outline",type:"button",onClick:()=>s(!0),children:[(0,r.jsx)(tK.A,{className:"w-4 h-4 text-muted-foreground"}),"Try it"]});return(0,r.jsxs)("div",{className:"flex gap-2",children:[o||a?(0,r.jsxs)(D.Tooltip,{children:[(0,r.jsx)(D.TooltipTrigger,{asChild:!0,children:(0,r.jsx)("div",{children:l})}),(0,r.jsx)(D.TooltipContent,{children:o?"Please save your changes before trying the graph.":"Please save the graph to try it."})]}):l,(0,r.jsx)(eN.$,{onClick:t,variant:o?"default":"outline",disabled:!o&&!a,children:a?"Save":"Save changes"}),(0,r.jsxs)(eN.$,{type:"button",variant:"ghost",onClick:n,children:[(0,r.jsx)("span",{className:"sr-only",children:"Toggle side pane"}),(0,r.jsx)(tX.A,{className:"w-4 h-4"})]})]})}function tQ(e){let{graph:t,dataComponentLookup:a={},artifactComponentLookup:c={},toolLookup:m={}}=e,[p,h]=(0,i.useState)(!1),x=(0,l.useRouter)(),{tenantId:v,projectId:j}=(0,l.useParams)(),y=(0,i.useMemo)(()=>[{id:(0,o.Ak)(),type:K.Agent,position:{x:0,y:0},data:{name:"",isDefault:!0},deletable:!1}],[]),k=(0,i.useCallback)(e=>e.map(e=>{if(e.type===K.MCP&&e.data&&"toolId"in e.data){let t=m[e.data.toolId];if(t){let a=null;return a=(0,ex.T)(t).type,{...e,data:{...e.data,name:t.name,imageUrl:t.imageUrl,provider:a}}}}return e}),[m]),{nodes:w,edges:E}=(0,i.useMemo)(()=>{let e=t?function(e){let t=[],a=[],r=Object.keys(e.agents);for(let a of r){let r=e.agents[a],n=a===e.defaultAgentId,s="external"===r.type,o={id:a,type:s?K.ExternalAgent:K.Agent,position:{x:0,y:0},data:s?{id:r.id,name:r.name,description:r.description,baseUrl:r.baseUrl,type:r.type}:(()=>{var e,t,a;return{id:r.id,name:r.name,isDefault:n,prompt:r.prompt,description:r.description,dataComponents:r.dataComponents,artifactComponents:r.artifactComponents,models:r.models?{base:r.models.base?{model:null!=(e=r.models.base.model)?e:"",providerOptions:r.models.base.providerOptions?(0,R.S_)(r.models.base.providerOptions):void 0}:void 0,structuredOutput:r.models.structuredOutput?{model:null!=(t=r.models.structuredOutput.model)?t:"",providerOptions:r.models.structuredOutput.providerOptions?(0,R.S_)(r.models.structuredOutput.providerOptions):void 0}:void 0,summarizer:r.models.summarizer?{model:null!=(a=r.models.summarizer.model)?a:"",providerOptions:r.models.summarizer.providerOptions?(0,R.S_)(r.models.summarizer.providerOptions):void 0}:void 0}:void 0,stopWhen:r.stopWhen?{stepCountIs:r.stopWhen.stepCountIs}:void 0,type:r.type,tools:r.canUse?r.canUse.map(e=>e.toolId):[],selectedTools:r.canUse?r.canUse.reduce((e,t)=>(t.toolSelection&&(e[t.toolId]=t.toolSelection),e),{}):void 0}})(),deletable:!n};t.push(o)}for(let n of r){let r=e.agents[n];if("canUse"in r&&r.canUse&&r.canUse.length>0){let s=e.tools;if(s)for(let e of r.canUse){let r=e.toolId,l=s[r];if(!l){console.warn("Tool with ID ".concat(r," not found in tools object"));continue}let i=(0,o.Ak)(),d={id:i,type:K.MCP,position:{x:0,y:0},data:{toolId:l.id}};t.push(d);let c={id:"edge-".concat(i,"-").concat(n),type:g.Default,source:n,sourceHandle:Q,target:i,targetHandle:Y};a.push(c)}else for(let e of r.canUse){let r=e.toolId,s=(0,o.Ak)(),l={id:s,type:K.MCP,position:{x:0,y:0},data:{toolId:r}};t.push(l);let i={id:"edge-".concat(s,"-").concat(n),type:g.Default,source:n,sourceHandle:Q,target:s,targetHandle:Y};a.push(i)}}}let n=new Set;for(let t of r){var s,l,i,d,c,u,m,p;let r=e.agents[t];if("canTransferTo"in r&&r.canTransferTo){for(let o of r.canTransferTo)if(e.agents[o]){let c=t===o,u=c?"self-".concat(t):[t,o].sort().join("-");if(!n.has(u)){n.add(u);let m=e.agents[o],p="canTransferTo"in r&&(null==(s=r.canTransferTo)?void 0:s.includes(o))||!1,h="canTransferTo"in m&&(null==(l=m.canTransferTo)?void 0:l.includes(t))||!1,x="canDelegateTo"in r&&(null==(i=r.canDelegateTo)?void 0:i.includes(o))||!1,f="canDelegateTo"in m&&(null==(d=m.canDelegateTo)?void 0:d.includes(t))||!1,v="external"===m.type,b={id:c?"edge-self-".concat(t):"edge-".concat(o,"-").concat(t),type:c?g.SelfLoop:v?g.A2AExternal:g.A2A,source:t,sourceHandle:Q,target:o,targetHandle:v?et:ee,selected:!1,data:{relationships:{transferTargetToSource:h,transferSourceToTarget:p,delegateTargetToSource:f,delegateSourceToTarget:x}}};a.push(b)}}}if("canDelegateTo"in r&&r.canDelegateTo){for(let s of r.canDelegateTo)if(e.agents[s]){let o=t===s,l=o?"self-".concat(t):[t,s].sort().join("-");if(!n.has(l)){n.add(l);let i=e.agents[s],d="canTransferTo"in r&&(null==(c=r.canTransferTo)?void 0:c.includes(s))||!1,h="canTransferTo"in i&&(null==(u=i.canTransferTo)?void 0:u.includes(t))||!1,x="canDelegateTo"in r&&(null==(m=r.canDelegateTo)?void 0:m.includes(s))||!1,f="canDelegateTo"in i&&(null==(p=i.canDelegateTo)?void 0:p.includes(t))||!1,v="external"===i.type,b={id:o?"edge-self-".concat(t):"edge-".concat(s,"-").concat(t),type:o?g.SelfLoop:v?g.A2AExternal:g.A2A,source:t,sourceHandle:Q,target:s,targetHandle:v?et:ee,selected:!1,data:{relationships:{transferTargetToSource:h,transferSourceToTarget:d,delegateTargetToSource:f,delegateSourceToTarget:x}}};a.push(b)}}}}return{nodes:function(e,t){let a=new S.graphlib.Graph;for(let t of(a.setGraph({rankdir:"TB",nodesep:150,ranksep:150,edgesep:80,marginx:50,marginy:50}),a.setDefaultEdgeLabel(()=>({})),e)){let e=es(t);a.setNode(t.id,{width:en,height:e})}for(let e of t)a.setEdge(e.source,e.target);return S.layout(a),e.map(e=>{let t=a.node(e.id),r=es(e);return{...e,position:{x:t.x-en/2,y:t.y-r/2}}})}(t,a),edges:a}}(t):{nodes:y,edges:b};return{...e,nodes:k(e.nodes)}},[t,k,y]),A=(0,i.useMemo)(()=>{if(!(null==t?void 0:t.agents))return{};let e={};return Object.entries(t.agents).forEach(t=>{let[a,r]=t;if("canUse"in r&&r.canUse){let t={};r.canUse.forEach(e=>{e.toolSelection&&(t[e.toolId]=e.toolSelection)}),Object.keys(t).length>0&&(e[a]=t)}}),e},[null==t?void 0:t.agents]),{screenToFlowPosition:I}=(0,n.VH)(),{nodes:O,edges:z,setNodes:M,setEdges:P,onNodesChange:_,onEdgesChange:L,metadata:B,setMetadata:D,setInitial:F,markSaved:V,clearSelection:W,markUnsaved:J}=N(),H=(0,i.useMemo)(()=>k(O),[O,k]),{nodeId:G,edgeId:$,setQueryState:q,openGraphPane:Z,isOpen:er}=ed(),{errors:el,showErrors:ei,setErrors:ec,clearErrors:eu,setShowErrors:em}=U();(0,i.useEffect)(()=>{var e,r,n,s,o,l,i,d,u,m;F(w,E,{id:null==t?void 0:t.id,name:null!=(l=null==t?void 0:t.name)?l:"",description:null!=(i=null==t?void 0:t.description)?i:"",graphPrompt:null==t?void 0:t.graphPrompt,models:(null==t?void 0:t.models)?{base:t.models.base?{model:t.models.base.model,providerOptions:(0,R.S_)(t.models.base.providerOptions)}:void 0,structuredOutput:t.models.structuredOutput?{model:t.models.structuredOutput.model,providerOptions:(0,R.S_)(t.models.structuredOutput.providerOptions)}:void 0,summarizer:t.models.summarizer?{model:t.models.summarizer.model,providerOptions:(0,R.S_)(t.models.summarizer.providerOptions)}:void 0}:void 0,stopWhen:null==t?void 0:t.stopWhen,statusUpdates:(null==t?void 0:t.statusUpdates)?{...t.statusUpdates,statusComponents:(0,R.S_)(t.statusUpdates.statusComponents)||""}:void 0,contextConfig:{id:null!=(d=null==t||null==(e=t.contextConfig)?void 0:e.id)?d:"",name:null!=(u=null==t||null==(r=t.contextConfig)?void 0:r.name)?u:"",description:null!=(m=null==t||null==(n=t.contextConfig)?void 0:n.description)?m:"",contextVariables:(0,R.S_)(null==t||null==(s=t.contextConfig)?void 0:s.contextVariables)||"",requestContextSchema:(0,R.S_)(null==t||null==(o=t.contextConfig)?void 0:o.requestContextSchema)||""}},a,c)},[]),(0,i.useEffect)(()=>{if(!t)return void Z();G||$||Z(),G&&M(e=>e.map(e=>({...e,selected:e.id===G}))),$&&P(e=>e.map(e=>({...e,selected:e.id===$}))),G&&!w.some(e=>e.id===G)&&q(e=>({...e,nodeId:null,pane:"graph"})),$&&!E.some(e=>e.id===$)&&q(e=>({...e,edgeId:null,pane:"graph"}))},[]);let ev=(0,i.useCallback)(e=>{J();let t=e.source===e.target,a={id:t?"edge-self-".concat(e.source):function(e,t){let[a,r]=[e,t].sort();return"edge-".concat(a,"-").concat(r)}(e.source,e.target),...e},{sourceHandle:r,targetHandle:n}=e;t?a={...a,type:g.SelfLoop,selected:!0,data:{relationships:{transferTargetToSource:!1,transferSourceToTarget:!0,delegateTargetToSource:!1,delegateSourceToTarget:!1}}}:(r===Q||r===ee)&&(n===ee||n===Q)?a={...a,type:g.A2A,selected:!0,data:{relationships:{transferTargetToSource:!1,transferSourceToTarget:!0,delegateTargetToSource:!1,delegateSourceToTarget:!1}}}:(r===Q||r===ee)&&n===et&&(a={...a,type:g.A2AExternal,data:{relationships:{transferTargetToSource:!1,transferSourceToTarget:!1,delegateTargetToSource:!1,delegateSourceToTarget:!0}}}),requestAnimationFrame(()=>{u.execute(new T(a,{deselectOtherEdgesIfA2A:!0}))})},[]),eb=(0,i.useCallback)(e=>{let{sourceHandle:t,targetHandle:a}=e;return t!==Y||a!==Y},[]),ej=(0,i.useCallback)(e=>{e.preventDefault(),e.dataTransfer.dropEffect="move"},[]),ey=(0,i.useCallback)(e=>{e.preventDefault();let t=e.dataTransfer.getData("application/reactflow");if(!t)return;let a=JSON.parse(t),r=I({x:e.clientX,y:e.clientY}),n={id:(0,o.Ak)(),type:a.type,position:r,selected:!0,data:{...ea[a.type]}};W(),u.execute(new C(n))},[I,W]),eN=(0,i.useCallback)(e=>{var t,a;let{nodes:r,edges:n}=e,s=1===r.length?r[0]:null,o=1===n.length&&((null==(t=n[0])?void 0:t.type)===g.A2A||(null==(a=n[0])?void 0:a.type)===g.SelfLoop)?n[0]:null,l=er?"graph":null;q({pane:s?"node":o?"edge":l,nodeId:s?s.id:null,edgeId:o?o.id:null},{history:"replace"})},[q,er]);(0,n.p4)({onChange:eN});let{undo:ek,redo:ew,deleteSelected:eC}=N(),eA=(0,i.useCallback)(e=>{var t;if(null==(t=e.target)?void 0:t.classList.contains("react-flow__node")){if((e.metaKey||e.ctrlKey)&&"z"===e.key.toLowerCase()){e.preventDefault(),e.shiftKey?ew():ek();return}if("Delete"===e.key||"Backspace"===e.key){let t=e.target;t&&("INPUT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable)||(e.preventDefault(),eC())}}},[ek,ew,eC]);(0,i.useEffect)(()=>(window.addEventListener("keydown",eA),()=>window.removeEventListener("keydown",eA)),[eA]);let eI=(0,i.useCallback)(()=>{P(e=>e.map(e=>({...e,selected:!1}))),M(e=>e.map(e=>({...e,selected:!1}))),q({pane:null,nodeId:null,edgeId:null})},[q,P,M]),eO=(0,i.useCallback)(()=>{P(e=>e.map(e=>({...e,selected:!1}))),M(e=>e.map(e=>({...e,selected:!1}))),q({pane:"graph",nodeId:null,edgeId:null})},[q,P,M]),eM=(0,i.useCallback)(e=>{let t=H.find(t=>{var a;return t.id===e||(null==(a=t.data)?void 0:a.id)===e});t&&(M(e=>e.map(e=>({...e,selected:e.id===t.id}))),P(e=>e.map(e=>({...e,selected:!1}))),q({pane:"node",nodeId:t.id,edgeId:null}))},[M,P,H,q]),eP=(0,i.useCallback)(e=>{let t=z.find(t=>t.id===e);t&&(P(e=>e.map(e=>({...e,selected:e.id===t.id}))),M(e=>e.map(e=>({...e,selected:!1}))),q({pane:"edge",nodeId:null,edgeId:t.id}))},[P,M,z,q]),e_=(0,i.useCallback)(async()=>{let e=function(e,t,a){let r=function(e,t,a){let r=[];for(let o of e.filter(e=>e.type===K.MCP)){var n,s;let e=a[o.data.toolId];if(!e)continue;let l=(0,eg.O)({availableTools:e.availableTools,activeTools:null==(s=e.config)||null==(n=s.mcp)?void 0:n.activeTools}),i=ef(o,t),d=i&&Array.isArray(i)?i.filter(e=>!(null==l?void 0:l.some(t=>t.name===e))):[];d.length>0&&r.push({nodeId:o.data.toolId,nodeName:o.data.name||e.name||"Unnamed MCP Server",orphanedTools:d})}let o=r.reduce((e,t)=>e+t.orphanedTools.length,0);return{hasOrphanedTools:r.length>0,orphanedToolsByNode:r,totalOrphanedCount:o}}(e,t,a);return r.hasOrphanedTools?function(e){let t=e.orphanedToolsByNode.length,a=e.totalOrphanedCount;if(1===t){let t=e.orphanedToolsByNode[0],r=t.orphanedTools.join(", "),n=a>1?"tools":"tool",s=a>1?"are":"is",o=a>1?"These tools":"This tool";return'The MCP server "'.concat(t.nodeName,'" has ').concat(a," selected ").concat(n," that ").concat(s," no longer available: ").concat(r,". ").concat(o," will not be available at runtime. Please update your tool selections.")}return"".concat(t," MCP servers have a total of ").concat(a," selected tools that are no longer available. These orphaned tools will not be available at runtime. Please update your tool selections.")}(r):null}(H,A,m);e&&d.oR.warning(e,{closeButton:!0,duration:6e3});let r=function(e,t,a,r,n,s){var l,i,d;let c={},u=new Set,m=new Set,p="";for(let a of e)if(a.type===K.Agent){let r=a.data.id||a.id,n=a.data.dataComponents||[],o=a.data.artifactComponents||[];n.forEach(e=>{u.add(e)}),o.forEach(e=>{m.add(e)});let l=function(e){if(e&&"object"==typeof e&&Object.values(e).some(e=>null!=e&&""!==String(e).trim()))return{base:e.base?{model:e.base.model,providerOptions:eo(e.base.providerOptions)}:void 0,structuredOutput:e.structuredOutput?{model:e.structuredOutput.model,providerOptions:eo(e.structuredOutput.providerOptions)}:void 0,summarizer:e.summarizer?{model:e.summarizer.model,providerOptions:eo(e.summarizer.providerOptions)}:void 0}}(a.data.models),i=a.data.stopWhen,d=[];for(let n of t.filter(t=>t.source===a.id&&e.some(e=>e.id===t.target&&e.type===K.MCP))){let t=e.find(e=>e.id===n.target);if(t&&t.type===K.MCP){let e=t.data.toolId;if(e){let a=t.data.tempSelectedTools,n=null;void 0!==a?Array.isArray(a)?n=a:null===a&&(n=null):n=s&&s[r]&&void 0!==s[r][e]?s[r][e]:null,d.push({toolId:e,toolSelection:n})}}}let h={id:r,name:a.data.name,description:a.data.description||"",prompt:a.data.prompt,canUse:d,canTransferTo:[],canDelegateTo:[],dataComponents:n,artifactComponents:o,...l&&{models:l},type:"internal",...i&&{stopWhen:i}};a.data.isDefault&&(p=r),c[r]=h}else if(a.type===K.ExternalAgent){let e=a.data.id||a.id,t={id:e,name:a.data.name,description:a.data.description||"",baseUrl:a.data.baseUrl,type:"external"};a.data.isDefault&&(p=e),c[e]=t}for(let a of t)if(a.type===g.A2A||a.type===g.A2AExternal||a.type===g.SelfLoop){let t=e.find(e=>e.id===a.source),r=e.find(e=>e.id===a.target),n=(null==t?void 0:t.data.id)||(null==t?void 0:t.id),s=(null==r?void 0:r.data.id)||(null==r?void 0:r.id),o=c[n],l=c[s];if(o&&l&&(null==(d=a.data)?void 0:d.relationships)){let e=a.data.relationships,t=(e,t,a)=>{if("canUse"in e){e[t]||(e[t]=[]);let r=e[t];r&&!r.includes(a)&&r.push(a)}};e.transferSourceToTarget&&t(o,"canTransferTo",s),e.transferTargetToSource&&t(l,"canTransferTo",n),e.delegateSourceToTarget&&t(o,"canDelegateTo",s),e.delegateTargetToSource&&t(l,"canDelegateTo",n)}}let h=eo(null==a||null==(l=a.contextConfig)?void 0:l.contextVariables),x=eo(null==a||null==(i=a.contextConfig)?void 0:i.requestContextSchema),f=(null==a?void 0:a.contextConfig)&&(a.contextConfig.name&&""!==a.contextConfig.name.trim()||a.contextConfig.description&&""!==a.contextConfig.description.trim()||h&&"object"==typeof h&&null!==h&&Object.keys(h).length>0||x&&"object"==typeof x&&null!==x&&Object.keys(x).length>0),v={};r&&u.forEach(e=>{let t=r[e];t&&(v[e]=t)});let b={};n&&m.forEach(e=>{let t=n[e];t&&(b[e]=t)});let j={id:(null==a?void 0:a.id)||(0,o.Ak)(),name:(null==a?void 0:a.name)||"Untitled Graph",description:(null==a?void 0:a.description)||void 0,defaultAgentId:p,agents:c};if((null==a?void 0:a.models)&&(j.models={base:a.models.base?{model:a.models.base.model,providerOptions:eo(a.models.base.providerOptions)}:void 0,structuredOutput:a.models.structuredOutput?{model:a.models.structuredOutput.model,providerOptions:eo(a.models.structuredOutput.providerOptions)}:void 0,summarizer:a.models.summarizer?{model:a.models.summarizer.model,providerOptions:eo(a.models.summarizer.providerOptions)}:void 0}),(null==a?void 0:a.stopWhen)&&(j.stopWhen=a.stopWhen),(null==a?void 0:a.graphPrompt)&&(j.graphPrompt=a.graphPrompt),null==a?void 0:a.statusUpdates){let e=eo(a.statusUpdates.statusComponents);j.statusUpdates={...a.statusUpdates,statusComponents:e}}if(f&&(null==a?void 0:a.contextConfig)){let e=a.contextConfig.id||(0,o.Ak)();j.contextConfigId=e,j.contextConfig={id:e,name:a.contextConfig.name||"",description:a.contextConfig.description||"",requestContextSchema:x,contextVariables:h}}return j}(H,z,B,a,c,A),n=await ep(v,j,r,null==t?void 0:t.id);if(n.success){var s;eu(),d.oR.success("Graph saved",{closeButton:!0}),V(),!(null==t?void 0:t.id)&&(null==(s=n.data)?void 0:s.id)&&(D("id",n.data.id),x.push("/".concat(v,"/projects/").concat(j,"/graphs/").concat(n.data.id)))}else try{let e=function(e){try{let a=JSON.parse(e),r=[];for(let e of a)if("invalid_union"===e.code&&e.errors&&e.path)for(let t of e.errors)for(let a of t){let t=eh(a,e.path);t&&r.push(t)}else if(e.path){let t=eh(e,e.path);t&&r.push(t)}var t=r;let n={},s={},o=[];for(let e of t)switch(e.type){case"node":e.nodeId&&(n[e.nodeId]||(n[e.nodeId]=[]),n[e.nodeId].push(e));break;case"edge":e.edgeId&&(s[e.edgeId]||(s[e.edgeId]=[]),s[e.edgeId].push(e));break;case"graph":o.push(e)}return{totalErrors:t.length,nodeErrors:n,edgeErrors:s,graphErrors:o,allErrors:t}}catch(t){return{totalErrors:1,nodeErrors:{},edgeErrors:{},graphErrors:[{type:"graph",field:"unknown",message:"An unknown validation error occurred",fullPath:[],originalError:{code:"unknown",message:e,path:[]}}],allErrors:[]}}}(n.error);ec(e);let t=function(e){let{totalErrors:t,nodeErrors:a,edgeErrors:r,graphErrors:n}=e;if(0===t)return"";let s=[],o=Object.keys(a).length,l=Object.keys(r).length,i=n.length;o>0&&s.push("".concat(o," agent").concat(o>1?"s":"")),l>0&&s.push("".concat(l," connection").concat(l>1?"s":"")),i>0&&s.push("".concat(i," graph setting").concat(i>1?"s":""));let d=s.join(", ");return"Validation failed for ".concat(d,". Check the highlighted items for details.")}(e);d.oR.error(t||"Failed to save graph - validation errors found")}catch(e){console.error("Failed to parse validation errors:",e),d.oR.error("Failed to save graph",{closeButton:!0})}},[H,z,B,a,c,V,D,x,null==t?void 0:t.id,v,j,eu,ec,A,m]);return(0,r.jsxs)("div",{className:"w-full h-full relative bg-muted/20 dark:bg-background flex rounded-b-[14px] overflow-hidden",children:[(0,r.jsxs)("div",{className:"flex-1 h-full relative transition-all duration-300 ease-in-out",children:[(0,r.jsx)(eS,{}),(0,r.jsx)(eE,{}),(0,r.jsxs)(n.Gc,{defaultEdgeOptions:{type:"default"},nodeTypes:X,edgeTypes:f,nodes:H,edges:z,onNodesChange:_,onEdgesChange:L,onConnect:ev,onDrop:ey,onDragOver:ej,fitView:!0,snapToGrid:!0,snapGrid:[20,20],fitViewOptions:{maxZoom:1},connectionMode:s.WZ.Loose,isValidConnection:eb,children:[(0,r.jsx)(n.VS,{color:"#a8a29e",gap:20}),(0,r.jsx)(n.H2,{className:"text-foreground",showInteractive:!1}),(0,r.jsx)(n.Zk,{position:"top-left",children:(0,r.jsx)(ez,{})}),(0,r.jsx)(n.Zk,{position:"top-right",children:(0,r.jsx)(tY,{onSubmit:e_,isPreviewDisabled:!(null==t?void 0:t.id),toggleSidePane:er?eI:Z,setShowPlayground:()=>{eI(),h(!0)}})}),el&&ei&&(0,r.jsx)(n.Zk,{position:"bottom-left",className:"max-w-sm !left-8 mb-4",children:(0,r.jsx)(eT,{errorSummary:el,onClose:()=>em(!1),onNavigateToNode:eM,onNavigateToEdge:eP})})]})]}),(0,r.jsx)(tZ,{selectedNodeId:G,selectedEdgeId:$,isOpen:er,onClose:eI,backToGraph:eO,dataComponentLookup:a,artifactComponentLookup:c,selectedToolsLookup:A,toolLookup:m}),p&&(null==t?void 0:t.id)&&(0,r.jsx)(eK,{graphId:null==t?void 0:t.id,projectId:j,tenantId:v,setShowPlayground:h})]})}function t0(e){let{graph:t,dataComponentLookup:a,artifactComponentLookup:s,toolLookup:o}=e;return(0,r.jsx)(n.Ln,{children:(0,r.jsx)(tQ,{graph:t,dataComponentLookup:a,artifactComponentLookup:s,toolLookup:o})})}},11729:(e,t,a)=>{"use strict";a.d(t,{$:()=>l,F:()=>o});var r=a(60098),n=a(17242),s=a(52681);function o(e){let{className:t,children:a,...o}=e;return(0,r.jsxs)(n.bL,{"data-slot":"scroll-area",className:(0,s.cn)("relative",t),...o,children:[(0,r.jsx)(n.LM,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:a}),(0,r.jsx)(l,{}),(0,r.jsx)(n.OK,{})]})}function l(e){let{className:t,orientation:a="vertical",...o}=e;return(0,r.jsx)(n.VM,{"data-slot":"scroll-area-scrollbar",orientation:a,className:(0,s.cn)("flex touch-none p-px transition-colors select-none","vertical"===a&&"h-full w-2.5 border-l border-l-transparent","horizontal"===a&&"h-2.5 flex-col border-t border-t-transparent",t),...o,children:(0,r.jsx)(n.lr,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}},26273:(e,t,a)=>{"use strict";a.d(t,{y:()=>u});var r=a(60098),n=a(79178),s=a(88418),o=a(86714),l=a(52681),i=a(60049);let d=e=>{let[t,a]=(0,n.useState)(null);return(0,n.useEffect)(()=>{if(!(null==e?void 0:e.trim()))return void a(null);try{JSON.parse(e),a(null)}catch(e){a("Invalid JSON syntax")}},[e]),{error:t}};function c(e){let{value:t,onChange:a,placeholder:n,name:o}=e,{error:l}=d(t);return(0,r.jsxs)("div",{className:"flex flex-col min-h-0 w-full h-full",children:[(0,r.jsx)(s.i,{id:"".concat(o,"-expanded"),autoFocus:!0,value:t||"",onChange:a,placeholder:n,className:"[&>.cm-editor]:max-h-full"}),l&&(0,r.jsx)("p",{className:"text-sm text-destructive mt-2",children:l})]})}function u(e){var t;let{name:a,value:n,onChange:u,className:m,label:p="JSON",placeholder:h="Enter valid JSON...",error:x}=e,{error:g}=d(n),{handleFormat:f,canFormat:v}={handleFormat:()=>{!t&&(null==n?void 0:n.trim())&&u((0,l.IB)(n))},canFormat:!(t=!!(x||g))&&!!(null==n?void 0:n.trim())},b=x||g,j=(0,r.jsx)(o.$,{type:"button",onClick:f,disabled:!v,variant:"outline",size:"sm",className:"h-6 px-2 text-xs rounded-sm",children:"Format"});return(0,r.jsx)(i.Z,{name:a,label:p,className:m,actions:j,compactView:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.i,{id:a,value:n||"",onChange:u,placeholder:h,className:"font-mono text-sm max-h-96 ".concat(b?"mb-6":"")}),b&&(0,r.jsx)("p",{className:"text-sm mt-1 text-destructive absolute -bottom-6",children:b})]}),expandedView:(0,r.jsx)(c,{value:n,onChange:u,placeholder:h,name:a})})}},30958:(e,t,a)=>{"use strict";a.d(t,{Cf:()=>m,Es:()=>h,HM:()=>c,L3:()=>x,c7:()=>p,lG:()=>l,rr:()=>g,zM:()=>i});var r=a(60098),n=a(88226),s=a(31184),o=a(52681);function l(e){let{...t}=e;return(0,r.jsx)(n.bL,{"data-slot":"dialog",...t})}function i(e){let{...t}=e;return(0,r.jsx)(n.l9,{"data-slot":"dialog-trigger",...t})}function d(e){let{...t}=e;return(0,r.jsx)(n.ZL,{"data-slot":"dialog-portal",...t})}function c(e){let{...t}=e;return(0,r.jsx)(n.bm,{"data-slot":"dialog-close",...t})}function u(e){let{className:t,...a}=e;return(0,r.jsx)(n.hJ,{"data-slot":"dialog-overlay",className:(0,o.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function m(e){let{className:t,children:a,showCloseButton:l=!0,...i}=e;return(0,r.jsxs)(d,{"data-slot":"dialog-portal",children:[(0,r.jsx)(u,{}),(0,r.jsxs)(n.UC,{"data-slot":"dialog-content",className:(0,o.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg","max-h-[calc(100dvh-1.5rem)] overflow-y-auto scrollbar-thin scrollbar-thumb-muted-foreground/30 dark:scrollbar-thumb-muted-foreground/50 scrollbar-track-transparent",t),...i,children:[a,l&&(0,r.jsxs)(n.bm,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-md opacity-70 hover:opacity-100 transition-all focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent dark:hover:text-accent-foreground dark:text-foreground text-muted-foreground size-8 flex items-center justify-center",children:[(0,r.jsx)(s.A,{}),(0,r.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function p(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"dialog-header",className:(0,o.cn)("flex flex-col gap-2 text-center sm:text-left",t),...a})}function h(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"dialog-footer",className:(0,o.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...a})}function x(e){let{className:t,...a}=e;return(0,r.jsx)(n.hE,{"data-slot":"dialog-title",className:(0,o.cn)("text-lg leading-none font-medium",t),...a})}function g(e){let{className:t,...a}=e;return(0,r.jsx)(n.VY,{"data-slot":"dialog-description",className:(0,o.cn)("text-muted-foreground text-sm",t),...a})}},31011:(e,t,a)=>{"use strict";a.d(t,{B:()=>o,Tooltip:()=>l,TooltipContent:()=>d,TooltipTrigger:()=>i});var r=a(60098),n=a(1217),s=a(52681);function o(e){let{delayDuration:t=0,...a}=e;return(0,r.jsx)(n.Kq,{"data-slot":"tooltip-provider",delayDuration:t,...a})}function l(e){let{...t}=e;return(0,r.jsx)(o,{children:(0,r.jsx)(n.bL,{"data-slot":"tooltip",...t})})}function i(e){let{...t}=e;return(0,r.jsx)(n.l9,{"data-slot":"tooltip-trigger",...t})}function d(e){let{className:t,sideOffset:a=0,children:o,...l}=e;return(0,r.jsx)(n.ZL,{children:(0,r.jsxs)(n.UC,{"data-slot":"tooltip-content",sideOffset:a,className:(0,s.cn)("[--bg-color:var(--popover)] bg-(--bg-color) text-popover-foreground border border-border shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance max-w-xs",t),...l,children:[o,(0,r.jsx)(n.i3,{className:"bg-(--bg-color) fill-(--bg-color) z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}},34186:(e,t,a)=>{"use strict";a.d(t,{p:()=>s});var r=a(60098),n=a(52681);function s(e){let{className:t,type:a,...s}=e;return(0,r.jsx)("input",{type:a,"data-slot":"input",className:(0,n.cn)("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive disabled:bg-muted",t),...s})}},35613:(e,t,a)=>{"use strict";a.d(t,{u:()=>s});var r=a(60098),n=a(86312);function s(e){let{control:t,name:a,label:s,children:o,description:l,rules:i,isRequired:d}=e;return(0,r.jsx)(n.zB,{control:t,name:a,rules:i,render:e=>{let{field:t}=e;return(0,r.jsxs)(n.eI,{className:"relative",children:[(0,r.jsx)(n.lR,{isRequired:d,children:s}),(0,r.jsx)(n.MJ,{children:o(t)}),l&&(0,r.jsx)(n.Rr,{children:l}),(0,r.jsx)(n.C5,{})]})}})}},37479:(e,t,a)=>{"use strict";a.d(t,{i:()=>d});var r=a(60098),n=a(27820),s=a(28453),o=a(79178),l=a(52681),i=a(86714);function d(e){let{textToCopy:t,className:a,variant:d="ghost",size:c="icon-sm",iconClassName:u}=e,{isCopied:m,copyToClipboard:p}=function(e){let{timeout:t=2e3}=e,[a,r]=o.useState(!1);return{isCopied:a,copyToClipboard:e=>{var a;(null==(a=navigator.clipboard)?void 0:a.writeText)&&e&&navigator.clipboard.writeText(e).then(()=>{r(!0),setTimeout(()=>{r(!1)},t)})}}}({});return(0,r.jsxs)(i.$,{variant:d,size:c,className:(0,l.cn)("backdrop-blur-sm bg-card/90 hover:bg-card border border-border shadow-sm",a),onClick:()=>p(t),children:[m?(0,r.jsx)(n.A,{className:(0,l.cn)("w-4 h-4 text-green-600 dark:text-green-400",u)}):(0,r.jsx)(s.A,{className:(0,l.cn)("!w-3 !h-3 text-muted-foreground dark:text-foreground",u)}),(0,r.jsx)("span",{className:"sr-only",children:"Copy"})]})}},42503:(e,t,a)=>{"use strict";a.d(t,{r:()=>o});var r=a(60098),n=a(27764),s=a(79178);function o(e){let{provider:t,fallback:a=!1,className:o,size:l=20}=e,[i,d]=(0,s.useState)(!1),[c,u]=(0,s.useState)(!1),m=(e=>{let t=e.toLowerCase().replace(/[^a-z0-9-]/g,"-");return"/assets/provider-icons/".concat(t,".svg")})(t);return(0,r.jsxs)("div",{className:"inline-flex items-center justify-center relative ".concat(o||""),style:{width:l,height:l},children:[c&&(0,r.jsx)("div",{className:"absolute",children:a||((e,t)=>{let a=e.charAt(0),n=Math.max(8,Math.floor(.6*("string"==typeof t?Number.parseInt(t,10)||20:t)));return(0,r.jsx)("div",{className:"rounded-sm bg-gray-100 dark:bg-muted/50 text-muted-foreground font-medium flex items-center justify-center",style:{width:t,height:t,fontSize:"".concat(n,"px"),lineHeight:1},children:a})})(t,l)}),(0,r.jsx)(n.default,{src:m,alt:"".concat(t," icon"),width:"string"==typeof l?Number.parseInt(l,10)||20:l,height:"string"==typeof l?Number.parseInt(l,10)||20:l,onLoad:()=>{d(!0)},onError:()=>{u(!0)},style:{maxWidth:"100%",maxHeight:"100%",opacity:i&&!c?1:0},unoptimized:!0},t)]})}},46205:(e,t,a)=>{"use strict";a.d(t,{G7:()=>i,L$:()=>u,fx:()=>m,h_:()=>p,oI:()=>d,uB:()=>l,xL:()=>c});var r=a(60098),n=a(40417),s=a(60756);a(30958);var o=a(52681);function l(e){let{className:t,...a}=e;return(0,r.jsx)(n.uB,{"data-slot":"command",className:(0,o.cn)("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",t),...a})}function i(e){let{className:t,...a}=e;return(0,r.jsxs)("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[(0,r.jsx)(s.A,{className:"size-4 shrink-0 opacity-50"}),(0,r.jsx)(n.uB.Input,{"data-slot":"command-input",className:(0,o.cn)("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",t),...a})]})}function d(e){let{className:t,...a}=e;return(0,r.jsx)(n.uB.List,{"data-slot":"command-list",className:(0,o.cn)("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto scrollbar-thin scrollbar-thumb-muted-foreground/30 dark:scrollbar-thumb-muted-foreground/50 scrollbar-track-transparent",t),...a})}function c(e){let{...t}=e;return(0,r.jsx)(n.uB.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...t})}function u(e){let{className:t,...a}=e;return(0,r.jsx)(n.uB.Group,{"data-slot":"command-group",className:(0,o.cn)("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:uppercase [&_[cmdk-group-heading]]:font-mono [&_[cmdk-group-heading]]:tracking-wide",t),...a})}function m(e){let{className:t,...a}=e;return(0,r.jsx)(n.uB.Separator,{"data-slot":"command-separator",className:(0,o.cn)("bg-border -mx-1 h-px",t),...a})}function p(e){let{className:t,...a}=e;return(0,r.jsx)(n.uB.Item,{"data-slot":"command-item",className:(0,o.cn)("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...a})}},46395:(e,t,a)=>{"use strict";a.d(t,{Og:()=>o,jV:()=>n,nr:()=>r,tI:()=>s});let r="anthropic/claude-sonnet-4-20250514",n="anthropic/claude-haiku-3-5-20241022",s="anthropic/claude-haiku-3-5-20241022",o={anthropic:[{value:"anthropic/claude-opus-4-1-20250805",label:"anthropic/claude-opus-4-1-20250805"},{value:"anthropic/claude-sonnet-4-20250514",label:"anthropic/claude-sonnet-4-20250514"},{value:"anthropic/claude-haiku-3-5-20241022",label:"anthropic/claude-haiku-3-5-20241022"}],openai:[{value:"openai/gpt-4.1-2025-04-14",label:"openai/gpt-4.1-2025-04-14"},{value:"openai/gpt-4.1-mini-2025-04-14",label:"openai/gpt-4.1-mini-2025-04-14"},{value:"openai/gpt-4.1-nano-2025-04-14",label:"openai/gpt-4.1-nano-2025-04-14"},{value:"openai/gpt-5-2025-08-07",label:"openai/gpt-5-2025-08-07"},{value:"openai/gpt-5-mini-2025-08-07",label:"openai/gpt-5-mini-2025-08-07"},{value:"openai/gpt-5-nano-2025-08-07",label:"openai/gpt-5-nano-2025-08-07"}],google:[{value:"google/gemini-2.5-pro",label:"google/gemini-2.5-pro"},{value:"google/gemini-2.5-flash",label:"google/gemini-2.5-flash"},{value:"google/gemini-2.5-flash-lite",label:"google/gemini-2.5-flash-lite"}]}},47757:(e,t,a)=>{"use strict";a.d(t,{$:()=>r});let r=e=>e.toLowerCase().trim().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")},49121:(e,t,a)=>{"use strict";a.d(t,{L:()=>i,n:()=>l});var r=a(60098),n=a(63527),s=a(6826),o=a(86714);function l(e){let{title:t,Icon:a,children:n}=e;return(0,r.jsxs)("div",{className:"text-xs text-gray-800 dark:text-muted-foreground p-3 bg-gray-100/80 dark:bg-sidebar rounded-md",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[a&&(0,r.jsx)(a,{className:"w-3 h-3 text-muted-foreground"}),(0,r.jsx)("p",{className:"font-medium text-foreground font-mono uppercase",children:t})]}),n]})}function i(e){let{title:t,children:a,defaultOpen:l=!1,Icon:i}=e;return(0,r.jsxs)(n.Nt,{defaultOpen:l,className:"text-xs text-gray-800 dark:text-muted-foreground bg-gray-100/80 dark:bg-sidebar rounded-md",children:[(0,r.jsx)(n.R6,{asChild:!0,children:(0,r.jsxs)(o.$,{variant:"ghost",className:"text-xs flex items-center justify-between h-auto gap-2 py-3 px-3 w-full font-medium text-foreground font-mono uppercase group/info-card",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[i&&(0,r.jsx)(i,{size:12,className:"!w-3 !h-3 text-muted-foreground"}),t]}),(0,r.jsx)(s.A,{size:12,className:"w-3 h-3 text-muted-foreground group-data-[state=open]/info-card:rotate-180 transition-transform duration-200"})]})}),(0,r.jsx)(n.Ke,{className:"px-3 pt-0 py-3",children:a})]})}},52353:(e,t,a)=>{"use strict";a.d(t,{B:()=>g});var r=a(60098),n=a(47140),s=a(44001),o=a(27820),l=a(31184),i=a(79178),d=a(46395),c=a(86714),u=a(46205),m=a(92752),p=a(66041),h=a(31011),x=a(52681);function g(e){let{label:t="Model",tooltip:a,value:g,onValueChange:f,placeholder:v="Select a model...",inheritedValue:b,isRequired:j=!1,canClear:y=!0}=e,[N,k]=(0,i.useState)(!1),[w,C]=(0,i.useState)(null),[T,S]=(0,i.useState)(""),E=(0,i.useMemo)(()=>{for(let[e,t]of Object.entries(d.Og)){let e=t.find(e=>e.value===g);if(e)return e}if(g){if(g.startsWith("openrouter/")){let e=g.replace("openrouter/","");return{value:g,label:e,prefix:"openrouter/"}}if(g.startsWith("gateway/")){let e=g.replace("gateway/","");return{value:g,label:e,prefix:"gateway/"}}return{value:g,label:"".concat(g," (custom)")}}return null},[g]),A=(0,i.useMemo)(()=>{if(!b)return null;for(let[e,t]of Object.entries(d.Og)){let e=t.find(e=>e.value===b);if(e)return e}return b?{value:b,label:b}:null},[b]);return(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)(m.J,{children:[t,a&&(0,r.jsx)(h.B,{children:(0,r.jsxs)(h.Tooltip,{children:[(0,r.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,r.jsx)(n.A,{className:"w-3 h-3 text-muted-foreground"})}),(0,r.jsx)(h.TooltipContent,{children:a})]})}),j&&(0,r.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,r.jsx)("div",{className:"relative",children:(0,r.jsxs)("div",{className:"flex w-full shadow-xs rounded-md",children:[(0,r.jsxs)(p.AM,{open:N,onOpenChange:k,children:[(0,r.jsx)(p.Wv,{asChild:!0,children:(0,r.jsxs)(c.$,{variant:"outline",role:"combobox","aria-expanded":N,className:(0,x.cn)("justify-between bg-background dark:bg-background flex-1 text-foreground shadow-none truncate",E&&y?"rounded-r-none border-r-0":"rounded-r-md"),children:[E?(0,r.jsxs)("div",{className:"truncate",children:["prefix"in E&&E.prefix&&(0,r.jsx)("span",{className:"text-gray-400",children:E.prefix}),E.label]}):A?(0,r.jsxs)("div",{className:"truncate text-muted-foreground",children:[(0,r.jsx)("span",{className:"italic",children:A.label}),(0,r.jsx)("span",{className:"text-xs ml-1",children:"(inherited)"})]}):(0,r.jsx)("div",{className:"text-muted-foreground",children:v}),(0,r.jsx)(s.A,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,r.jsx)(p.hl,{className:"p-0 w-[var(--radix-popover-trigger-width)] transition-all duration-200 ease-in-out",align:"start",side:"bottom",onWheel:e=>{e.stopPropagation()},onTouchMove:e=>{e.stopPropagation()},children:(0,r.jsxs)(u.uB,{children:[(0,r.jsx)(u.G7,{placeholder:"Search models or type custom model ID..."}),(0,r.jsxs)(u.oI,{className:"max-h-64",children:[(0,r.jsx)(u.xL,{children:(()=>{if("undefined"!=typeof document){let e=document.querySelector("[cmdk-input]"),t=(null==e?void 0:e.value)||"";if(t.trim())return(0,r.jsxs)(u.h_,{className:"flex items-center justify-between cursor-pointer text-foreground",value:t,onSelect:()=>{let e=t.trim();e.includes("/")&&!e.startsWith("openrouter/")&&e.startsWith("gateway/"),null==f||f(e),k(!1)},children:['Use "',t,'" as custom model']})}return(0,r.jsx)("div",{className:"p-2 text-muted-foreground text-sm",children:"Type to search models or enter a custom model ID"})})()}),(0,r.jsxs)(u.L$,{heading:"LLM Gateway",children:[(0,r.jsx)(u.h_,{className:"flex items-center justify-between cursor-pointer text-foreground",value:"__openrouter__",onSelect:()=>{C("openrouter"),S("")},children:"OpenRouter ..."}),(0,r.jsx)(u.h_,{className:"flex items-center justify-between cursor-pointer text-foreground",value:"__gateway__",onSelect:()=>{C("gateway"),S("")},children:"Vercel AI Gateway ..."})]}),Object.entries(d.Og).map(e=>{let[t,a]=e;return(0,r.jsx)(u.L$,{heading:t,children:a.map(e=>(0,r.jsxs)(u.h_,{className:"flex items-center justify-between cursor-pointer text-foreground",value:e.value,onSelect:e=>{null==f||f(e===g?"":e),k(!1)},children:[e.label,(0,r.jsx)(o.A,{className:(0,x.cn)("ml-2 h-4 w-4",g===e.value?"opacity-100":"opacity-0")})]},e.value))},t)})]})]})})]}),w&&(0,r.jsx)("div",{className:"absolute top-full left-0 right-0 mt-1 p-3 bg-background border rounded-md shadow-lg z-20",children:(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)("div",{className:"text-sm font-medium",children:"openrouter"===w?"OpenRouter Model ID":"Vercel AI Gateway Model ID"}),(0,r.jsx)("div",{className:"text-xs text-muted-foreground",children:"openrouter"===w?"Examples: anthropic/claude-3-5-sonnet, meta-llama/llama-3.1-405b-instruct":"Examples: openai/gpt-4o, anthropic/claude-3-5-sonnet"}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("input",{className:"flex-1 px-3 py-2 text-sm border rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",placeholder:"openrouter"===w?"anthropic/claude-3-5-sonnet":"openai/gpt-4o",value:T,onChange:e=>S(e.target.value),onKeyDown:e=>{if("Enter"===e.key&&T.trim()){let e="openrouter"===w?"openrouter/":"gateway/";null==f||f("".concat(e).concat(T.trim())),C(null),S(""),k(!1)}"Escape"===e.key&&(C(null),S(""))}}),(0,r.jsx)(c.$,{size:"sm",onClick:()=>{if(T.trim()){let e="openrouter"===w?"openrouter/":"gateway/";null==f||f("".concat(e).concat(T.trim())),C(null),S(""),k(!1)}},disabled:!T.trim(),children:"Add"}),(0,r.jsx)(c.$,{size:"sm",variant:"outline",onClick:()=>{C(null),S("")},children:"Cancel"})]})]})}),y&&(0,r.jsx)("div",{className:(0,x.cn)("transition-all duration-200 ease-in-out overflow-hidden",E&&y?"w-10 opacity-100 scale-100":"w-0 opacity-0 scale-95"),children:(0,r.jsx)(c.$,{variant:"outline",size:"icon",className:"rounded-l-none border-l-0 px-2 bg-transparent w-10 transition-all duration-200 ease-in-out text-muted-foreground hover:text-foreground",onClick:()=>{null==f||f("")},"aria-label":"Clear model selection",type:"button",disabled:!E,children:(0,r.jsx)(l.A,{className:"h-4 w-4"})})})]})})]})}},52681:(e,t,a)=>{"use strict";a.d(t,{IB:()=>o,S_:()=>l,cn:()=>s});var r=a(51185),n=a(60881);function s(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return(0,n.QP)((0,r.$)(t))}function o(e){try{let t=JSON.parse(e);return JSON.stringify(t,null,2)}catch(t){return e}}function l(e){if(null==e)return"";let t=JSON.stringify(e);return(null==t?void 0:t.trim())?o(t):""}},57167:(e,t,a)=>{Promise.resolve().then(a.bind(a,9788)),Promise.resolve().then(a.bind(a,1095)),Promise.resolve().then(a.bind(a,88831)),Promise.resolve().then(a.t.bind(a,85276,23))},60049:(e,t,a)=>{"use strict";a.d(t,{Z:()=>i});var r=a(60098),n=a(70078),s=a(86714),o=a(30958),l=a(92752);function i(e){let{name:t,label:a,className:i,compactView:d,expandedView:c,actions:u,expandButtonLabel:m="Expand to full screen",isRequired:p=!1}=e;return(0,r.jsxs)(o.lG,{children:[(0,r.jsx)("div",{className:i,children:(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)(l.J,{className:"gap-1",htmlFor:t,children:[a,p&&(0,r.jsx)("span",{className:"text-red-500",children:"*"})]}),u&&(0,r.jsx)("div",{className:"flex gap-2",children:u})]}),(0,r.jsxs)("div",{className:"relative",children:[d,(0,r.jsx)(o.zM,{asChild:!0,children:(0,r.jsxs)(s.$,{variant:"ghost",size:"icon",className:"absolute bottom-2.5 right-2.5 h-6 w-6 hover:text-foreground transition-all backdrop-blur-sm bg-white/90 hover:bg-white/95 dark:bg-card dark:hover:bg-accent border border-border shadow-md dark:shadow-lg",type:"button",children:[(0,r.jsx)(n.A,{className:"h-4 w-4 text-muted-foreground "}),(0,r.jsx)("span",{className:"sr-only",children:m})]})})]})]})}),(0,r.jsxs)(o.Cf,{className:"!max-w-none h-screen w-screen max-h-screen p-0 gap-0 border-0 rounded-none",children:[(0,r.jsx)(o.L3,{className:"sr-only",children:a}),(0,r.jsxs)(o.rr,{className:"sr-only",children:[a," Editor"]}),(0,r.jsxs)("div",{className:"flex flex-col min-h-0 w-full h-full px-8 pb-8 pt-12 space-y-2 min-w-0 mx-auto max-w-7xl",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)(l.J,{htmlFor:"".concat(t,"-expanded"),children:a}),u]}),(0,r.jsx)("div",{className:"flex-1 min-h-0",children:c})]})]})]})}},66041:(e,t,a)=>{"use strict";a.d(t,{AM:()=>o,Wv:()=>l,hl:()=>i});var r=a(60098),n=a(81796),s=a(52681);function o(e){let{...t}=e;return(0,r.jsx)(n.bL,{"data-slot":"popover",...t})}function l(e){let{className:t,...a}=e;return(0,r.jsx)(n.l9,{"data-slot":"popover-trigger",className:(0,s.cn)("font-sans normal-case",t),...a})}function i(e){let{className:t,align:a="center",sideOffset:o=4,...l}=e;return(0,r.jsx)(n.ZL,{children:(0,r.jsx)(n.UC,{"data-slot":"popover-content",align:a,sideOffset:o,className:(0,s.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",t),...l})})}},66894:(e,t,a)=>{"use strict";function r(e){let{availableTools:t,activeTools:a}=e;if(t)return a?t.filter(e=>a.includes(e.name)):t}a.d(t,{O:()=>r})},74598:(e,t,a)=>{"use strict";a.d(t,{Ke:()=>l,Nt:()=>s,R6:()=>o});var r=a(60098),n=a(63527);function s(e){let{...t}=e;return(0,r.jsx)(n.bL,{"data-slot":"collapsible",...t})}function o(e){let{...t}=e;return(0,r.jsx)(n.R6,{"data-slot":"collapsible-trigger",...t})}function l(e){let{...t}=e;return(0,r.jsx)(n.Ke,{"data-slot":"collapsible-content",...t})}},77064:(e,t,a)=>{"use strict";a.d(t,{u:()=>d});var r=a(60098),n=a(4778),s=a(27764),o=a(79178),l=a(52681),i=a(42503);function d(e){let{imageUrl:t,name:a,provider:d,size:c=24,className:u}=e,[m,p]=(0,o.useState)(!1),[h,x]=(0,o.useState)(!0);return!t||m?d?(0,r.jsx)(i.r,{provider:d,size:c,className:u}):(0,r.jsx)(n.A,{className:(0,l.cn)("text-muted-foreground",u),style:{width:c,height:c}}):t.startsWith("data:image/")?(0,r.jsx)(s.default,{src:t,alt:a,width:c,height:c,className:(0,l.cn)("object-contain",u),onError:()=>p(!0)}):(0,r.jsxs)("div",{className:(0,l.cn)("relative",u),style:{width:c,height:c},children:[h&&d&&(0,r.jsx)(i.r,{provider:d,size:c,className:"absolute inset-0"}),(0,r.jsx)(s.default,{src:t,alt:a,width:c,height:c,className:(0,l.cn)("object-contain transition-opacity duration-200",h?"opacity-0":"opacity-100"),onError:()=>{p(!0),x(!1)},onLoad:()=>x(!1),unoptimized:!0})]})}},77186:(e,t,a)=>{"use strict";a.d(t,{T:()=>r});let r=e=>{let[t,a]=e.name.split("::");return{type:t,name:a}}},77946:(e,t,a)=>{"use strict";a.d(t,{O:()=>n});var r=a(60098);let n=()=>(0,r.jsxs)("ul",{className:"space-y-1.5 list-disc list-outside pl-4",children:[(0,r.jsxs)("li",{children:[(0,r.jsx)("span",{className:"font-medium",children:"Models"}),": Project → Graph → Agent (partial inheritance - missing models only)"]}),(0,r.jsxs)("li",{children:[(0,r.jsx)("span",{className:"font-medium",children:"Individual model types"})," inherit independently (base, structuredOutput, summarizer)"]}),(0,r.jsxs)("li",{children:[(0,r.jsx)("span",{className:"font-medium",children:"Explicit settings"})," always take precedence over inherited values"]}),(0,r.jsxs)("li",{children:[(0,r.jsx)("span",{className:"font-medium",children:"Provider options"})," are inherited along with the model if not explicitly set"]})]})},79741:(e,t,a)=>{"use strict";a.d(t,{r:()=>o});var r=a(60098),n=a(37479),s=a(11729);function o(e){let{code:t}=e;return(0,r.jsx)("div",{className:"flex items-center gap-2 relative bg-muted/50 dark:bg-muted/30 rounded-md border",children:(0,r.jsxs)(s.F,{dir:"ltr",className:"w-full",children:[(0,r.jsx)("pre",{className:"text-sm text-foreground/90 px-3 pr-8 py-2 font-mono",children:t}),(0,r.jsx)(n.i,{className:"absolute right-1 top-1/2 -translate-y-1/2",textToCopy:t}),(0,r.jsx)(s.$,{orientation:"horizontal"})]})})}},84661:(e,t,a)=>{"use strict";a.d(t,{S:()=>l});var r=a(60098),n=a(52266),s=a(27820),o=a(52681);function l(e){let{className:t,...a}=e;return(0,r.jsx)(n.bL,{"data-slot":"checkbox",className:(0,o.cn)("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...a,children:(0,r.jsx)(n.C1,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:(0,r.jsx)(s.A,{className:"size-3.5"})})})}},86312:(e,t,a)=>{"use strict";a.d(t,{C5:()=>v,MJ:()=>g,Rr:()=>f,eI:()=>h,lR:()=>x,lV:()=>d,zB:()=>u});var r=a(60098),n=a(67244),s=a(79178),o=a(95118),l=a(92752),i=a(52681);let d=o.Op,c=s.createContext({}),u=e=>{let{...t}=e;return(0,r.jsx)(c.Provider,{value:{name:t.name},children:(0,r.jsx)(o.xI,{...t})})},m=()=>{let e=s.useContext(c),t=s.useContext(p),{getFieldState:a}=(0,o.xW)(),r=(0,o.lN)({name:e.name}),n=a(e.name,r);if(!e)throw Error("useFormField should be used within <FormField>");let{id:l}=t;return{id:l,name:e.name,formItemId:"".concat(l,"-form-item"),formDescriptionId:"".concat(l,"-form-item-description"),formMessageId:"".concat(l,"-form-item-message"),...n}},p=s.createContext({});function h(e){let{className:t,...a}=e,n=s.useId();return(0,r.jsx)(p.Provider,{value:{id:n},children:(0,r.jsx)("div",{"data-slot":"form-item",className:(0,i.cn)("grid gap-2",t),...a})})}function x(e){let{className:t,isRequired:a,children:n,...s}=e,{error:o,formItemId:d}=m();return(0,r.jsxs)(l.J,{"data-slot":"form-label","data-error":!!o,className:(0,i.cn)("data-[error=true]:text-destructive gap-1",t),htmlFor:d,...s,children:[n,a&&(0,r.jsx)("span",{className:"text-red-500",children:"*"})]})}function g(e){let{...t}=e,{error:a,formItemId:s,formDescriptionId:o,formMessageId:l}=m();return(0,r.jsx)(n.DX,{"data-slot":"form-control",id:s,"aria-describedby":a?"".concat(o," ").concat(l):"".concat(o),"aria-invalid":!!a,...t})}function f(e){let{className:t,...a}=e,{formDescriptionId:n}=m();return(0,r.jsx)("p",{"data-slot":"form-description",id:n,className:(0,i.cn)("text-muted-foreground text-sm",t),...a})}function v(e){var t;let{className:a,...n}=e,{error:s,formMessageId:o}=m(),l=s?String(null!=(t=null==s?void 0:s.message)?t:""):n.children;return l?(0,r.jsx)("p",{"data-slot":"form-message",id:o,className:(0,i.cn)("text-destructive text-sm",a),...n,children:l}):null}},86714:(e,t,a)=>{"use strict";a.d(t,{$:()=>i,r:()=>l});var r=a(60098),n=a(67244),s=a(15625),o=a(52681);let l=(0,s.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90 font-mono uppercase",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60 font-mono uppercase",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 font-mono uppercase","outline-primary":"border border-primary/50 text-primary bg-background shadow-xs hover:bg-primary/10 hover:text-primary font-mono uppercase","gray-outline":"text-gray-600 border border-border bg-background hover:bg-accent dark:text-muted-foreground",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80 font-mono uppercase",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50 text-muted-foreground dark:text-muted-foreground font-mono uppercase",link:"text-primary underline-offset-4 hover:underline font-mono uppercase",unstyled:"font-inherit text-inherit text-[length:inherit] rounded-none"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-6",unstyled:"h-auto px-0 py-0"}},defaultVariants:{variant:"default",size:"default"}});function i(e){let{className:t,variant:a,size:s,asChild:i=!1,...d}=e,c=i?n.DX:"button";return(0,r.jsx)(c,{"data-slot":"button",className:(0,o.cn)(l({variant:a,size:s,className:t})),...d})}},86772:(e,t,a)=>{"use strict";a.d(t,{T:()=>s});var r=a(60098),n=a(52681);function s(e){let{className:t,...a}=e;return(0,r.jsx)("textarea",{"data-slot":"textarea",className:(0,n.cn)("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm disabled:bg-muted scrollbar-thin scrollbar-thumb-muted-foreground/30 dark:scrollbar-thumb-muted-foreground/50 scrollbar-track-transparent",t),...a})}},88418:(e,t,a)=>{"use strict";a.d(t,{i:()=>d});var r=a(60098),n=a(80884),s=a(59902),o=a(25957),l=a(3121),i=a(52681);function d(e){let{resolvedTheme:t}=(0,l.D)(),a=[(0,n.Pq)()],{className:d,value:c,onChange:u,placeholder:m,disabled:p,readOnly:h,...x}=e;return(0,r.jsx)(o.Ay,{...x,value:c||"",onChange:e=>u(e),extensions:a,theme:"dark"===t?s.nQ:s.Bs,placeholder:m||"Enter valid JSON schema...",editable:!p&&!h,basicSetup:{lineNumbers:!1,foldGutter:!1,dropCursor:!1,allowMultipleSelections:!1,bracketMatching:!0,closeBrackets:!0,autocompletion:!0},"data-disabled":p?"":void 0,"data-read-only":h?"":void 0,className:(0,i.cn)("h-full [&>.cm-editor]:max-h-[inherit] [&>.cm-editor]:!bg-transparent dark:[&>.cm-editor]:!bg-input/30 [&>.cm-editor]:!outline-none [&>.cm-editor]:rounded-[7px] [&>.cm-editor]:px-3 [&>.cm-editor]:py-2 leading-2 text-xs font-mono rounded-md border border-input shadow-xs transition-[color,box-shadow] data-disabled:cursor-not-allowed data-disabled:opacity-50 data-disabled:bg-muted data-invalid:border-destructive has-[.cm-focused]:border-ring has-[.cm-focused]:ring-ring/50 has-[.cm-focused]:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",d)})}},88831:(e,t,a)=>{"use strict";a.d(t,{Bx:()=>k,Yv:()=>E,CG:()=>S,Cn:()=>A,rQ:()=>I,Gh:()=>T,SidebarInset:()=>C,wZ:()=>O,Uj:()=>P,FX:()=>z,SidebarProvider:()=>N,SidebarTrigger:()=>w});var r=a(60098),n=a(67244),s=a(15625),o=a(54624),l=a(79178),i=a(86714);a(34186),a(1095);var d=a(88226),c=a(31184),u=a(52681);function m(e){let{...t}=e;return(0,r.jsx)(d.bL,{"data-slot":"sheet",...t})}function p(e){let{...t}=e;return(0,r.jsx)(d.ZL,{"data-slot":"sheet-portal",...t})}function h(e){let{className:t,...a}=e;return(0,r.jsx)(d.hJ,{"data-slot":"sheet-overlay",className:(0,u.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function x(e){let{className:t,children:a,side:n="right",...s}=e;return(0,r.jsxs)(p,{children:[(0,r.jsx)(h,{}),(0,r.jsxs)(d.UC,{"data-slot":"sheet-content",className:(0,u.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500","right"===n&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm","left"===n&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm","top"===n&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b","bottom"===n&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",t),...s,children:[a,(0,r.jsxs)(d.bm,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[(0,r.jsx)(c.A,{className:"size-4"}),(0,r.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function g(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"sheet-header",className:(0,u.cn)("flex flex-col gap-1.5 p-4",t),...a})}function f(e){let{className:t,...a}=e;return(0,r.jsx)(d.hE,{"data-slot":"sheet-title",className:(0,u.cn)("text-foreground font-semibold",t),...a})}function v(e){let{className:t,...a}=e;return(0,r.jsx)(d.VY,{"data-slot":"sheet-description",className:(0,u.cn)("text-muted-foreground text-sm",t),...a})}a(93431);var b=a(31011);let j=l.createContext(null);function y(){let e=l.useContext(j);if(!e)throw Error("useSidebar must be used within a SidebarProvider.");return e}function N(e){let{defaultOpen:t=!0,open:a,onOpenChange:n,className:s,style:o,children:i,...d}=e,c=function(){let[e,t]=l.useState(void 0);return l.useEffect(()=>{let e=window.matchMedia("(max-width: ".concat(767,"px)")),a=()=>{t(window.innerWidth<768)};return e.addEventListener("change",a),t(window.innerWidth<768),()=>e.removeEventListener("change",a)},[]),!!e}(),[m,p]=l.useState(!1),[h,x]=l.useState(t),g=null!=a?a:h,f=l.useCallback(e=>{let t="function"==typeof e?e(g):e;n?n(t):x(t),document.cookie="".concat("sidebar_state","=").concat(t,"; path=/; max-age=").concat(604800)},[n,g]),v=l.useCallback(()=>c?p(e=>!e):f(e=>!e),[c,f]);l.useEffect(()=>{let e=e=>{"b"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),v())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[v]);let y=g?"expanded":"collapsed",N=l.useMemo(()=>({state:y,open:g,setOpen:f,isMobile:c,openMobile:m,setOpenMobile:p,toggleSidebar:v}),[y,g,f,c,m,v]);return(0,r.jsx)(j.Provider,{value:N,children:(0,r.jsx)(b.B,{delayDuration:0,children:(0,r.jsx)("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":"16rem","--sidebar-width-icon":"3rem",...o},className:(0,u.cn)("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",s),...d,children:i})})})}function k(e){let{side:t="left",variant:a="sidebar",collapsible:n="offcanvas",className:s,children:o,...l}=e,{isMobile:i,state:d,openMobile:c,setOpenMobile:p}=y();return"none"===n?(0,r.jsx)("div",{"data-slot":"sidebar",className:(0,u.cn)("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",s),...l,children:o}):i?(0,r.jsx)(m,{open:c,onOpenChange:p,...l,children:(0,r.jsxs)(x,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":"18rem"},side:t,children:[(0,r.jsxs)(g,{className:"sr-only",children:[(0,r.jsx)(f,{children:"Sidebar"}),(0,r.jsx)(v,{children:"Displays the mobile sidebar."})]}),(0,r.jsx)("div",{className:"flex h-full w-full flex-col",children:o})]})}):(0,r.jsxs)("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":d,"data-collapsible":"collapsed"===d?n:"","data-variant":a,"data-side":t,"data-slot":"sidebar",children:[(0,r.jsx)("div",{"data-slot":"sidebar-gap",className:(0,u.cn)("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180","floating"===a||"inset"===a?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),(0,r.jsx)("div",{"data-slot":"sidebar-container",className:(0,u.cn)("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex","left"===t?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]","floating"===a||"inset"===a?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",s),...l,children:(0,r.jsx)("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:o})})]})}function w(e){let{className:t,onClick:a,...n}=e,{toggleSidebar:s}=y();return(0,r.jsxs)(i.$,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:(0,u.cn)("size-7",t),onClick:e=>{null==a||a(e),s()},type:"button",...n,children:[(0,r.jsx)(o.A,{}),(0,r.jsx)("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function C(e){let{className:t,...a}=e;return(0,r.jsx)("main",{"data-slot":"sidebar-inset",className:(0,u.cn)("bg-background relative flex w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",t),...a})}function T(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:(0,u.cn)("flex flex-col gap-2 p-2",t),...a})}function S(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:(0,u.cn)("flex flex-col gap-2 p-2",t),...a})}function E(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:(0,u.cn)("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),...a})}function A(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:(0,u.cn)("relative flex w-full min-w-0 flex-col p-2",t),...a})}function I(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:(0,u.cn)("w-full text-sm",t),...a})}function O(e){let{className:t,...a}=e;return(0,r.jsx)("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:(0,u.cn)("flex w-full min-w-0 flex-col gap-1",t),...a})}function z(e){let{className:t,...a}=e;return(0,r.jsx)("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:(0,u.cn)("group/menu-item relative",t),...a})}let M=(0,s.F)("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"text-sidebar-foreground/80 font-medium hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function P(e){let{asChild:t=!1,isActive:a=!1,variant:s="default",size:o="default",tooltip:l,className:i,...d}=e,c=t?n.DX:"button",{isMobile:m,state:p}=y(),h=(0,r.jsx)(c,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":o,"data-active":a,className:(0,u.cn)(M({variant:s,size:o}),i),...d});return l?("string"==typeof l&&(l={children:l}),(0,r.jsxs)(b.Tooltip,{children:[(0,r.jsx)(b.TooltipTrigger,{asChild:!0,children:h}),(0,r.jsx)(b.TooltipContent,{side:"right",align:"center",hidden:"collapsed"!==p||m,...l})]})):h}},89834:(e,t,a)=>{"use strict";a.d(t,{i:()=>n});var r=a(97555);let n=(0,r.createServerReference)("7c3794acfed555042088ded3e297602a7e27c1d7a0",r.callServer,void 0,r.findSourceMapURL,"fetchMCPTools")},92752:(e,t,a)=>{"use strict";a.d(t,{J:()=>o});var r=a(60098),n=a(57076),s=a(52681);function o(e){let{className:t,...a}=e;return(0,r.jsx)(n.b,{"data-slot":"label",className:(0,s.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),...a})}},93431:(e,t,a)=>{"use strict";a.d(t,{E:()=>s});var r=a(60098),n=a(52681);function s(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"skeleton",className:(0,n.cn)("bg-accent animate-pulse rounded-md",t),...a})}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9317],{30953:(e,r,t)=>{t.d(r,{Ak:()=>o});let o=(e=21)=>{let r="",t=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)r+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&t[e]];return r}},39475:(e,r,t)=>{t.d(r,{E:()=>d});var o=t(60098),a=t(67244),l=t(15625),s=t(52681);let n=(0,l.F)("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",primary:"border border-primary/50 text-primary bg-primary/5 rounded-sm p-0.5 px-1.5 font-mono",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",code:"text-xs text-muted-foreground border bg-muted/80 dark:bg-muted/50 rounded-sm p-0.5 px-1.5 font-mono",success:"text-xs text-muted-foreground border rounded-sm p-0.5 px-1.5 font-mono bg-emerald-50 border-emerald-200 text-emerald-800 dark:text-emerald-300 dark:bg-emerald-950/40 uppercase",error:"text-xs text-muted-foreground border rounded-sm p-0.5 px-1.5 font-mono bg-red-50 border-red-200 text-red-800 dark:border-red-700 dark:text-red-300 dark:bg-red-950/40 uppercase",warning:"text-xs text-muted-foreground border rounded-sm p-0.5 px-1.5 font-mono bg-amber-50 border-amber-200 text-amber-800 dark:border-amber-700 dark:text-amber-300 dark:bg-amber-950/40 uppercase",sky:"text-xs text-muted-foreground border rounded-sm p-0.5 px-1.5 font-mono bg-sky-50 border-sky-200 text-sky-800 dark:border-sky-700 dark:text-sky-300 dark:bg-sky-950/40",violet:"text-xs text-muted-foreground border rounded-sm p-0.5 px-1.5 font-mono bg-violet-50 border-violet-200 text-violet-800 dark:border-violet-700 dark:text-violet-300 dark:bg-violet-950/40",orange:"text-xs text-muted-foreground border rounded-sm p-0.5 px-1.5 font-mono bg-orange-50 border-orange-200 text-orange-800 dark:border-orange-700 dark:text-orange-300 dark:bg-orange-950/40"}},defaultVariants:{variant:"default"}});function d(e){let{className:r,variant:t,asChild:l=!1,...d}=e,i=l?a.DX:"span";return(0,o.jsx)(i,{"data-slot":"badge",className:(0,s.cn)(n({variant:t}),r),...d})}},49317:(e,r,t)=>{t.d(r,{MCPServerForm:()=>T});var o=t(60098),a=t(36886),l=t(82886),s=t(30953),n=t(93137),d=t(95118),i=t(32028),c=t(23574),m=t(58514),u=t(86714),p=t(86312),b=t(60468),x=t(97555);let g=(0,x.createServerReference)("706e1fc31410f539233d2833fe45cdfceaa39f10d8",x.callServer,void 0,x.findSourceMapURL,"createMCPTool");var f=t(31184),v=t(27820),h=t(79178),y=t(39475),j=t(84661),k=t(31011);function N(e){let{control:r,name:t,label:a,availableTools:l=[],description:s,disabled:n=!1}=e,{field:{value:i,onChange:c},fieldState:{error:m}}=(0,d.as)({name:t,control:r}),b=(0,h.useMemo)(()=>"object"==typeof i&&null!==i&&"type"in i?"all"===i.type?{type:"all"}:"selective"===i.type&&Array.isArray(i.tools)?{type:"selective",tools:i.tools}:{type:"selective",tools:[]}:{type:"selective",tools:[]},[i]),x=()=>{c({type:"all"})},g=()=>{c({type:"selective",tools:[]})},N=(e,r)=>{if("all"===b.type){let t=l.map(e=>e.name).filter(r=>r!==e);c({type:"selective",tools:r?[...t,e]:t})}else c({type:"selective",tools:r?[...b.tools.filter(r=>r!==e),e]:b.tools.filter(r=>r!==e)})},C=()=>{switch(b.type){case"all":return l.length;case"selective":return b.tools.filter(e=>l.some(r=>r.name===e)).length;default:return 0}},w=C()===l.length;return(0,o.jsx)(p.zB,{control:r,name:t,render:()=>(0,o.jsxs)(p.eI,{children:[(0,o.jsxs)(p.lR,{children:[a,(0,o.jsx)(y.E,{variant:"code",className:"border-none px-2 text-[10px] text-muted-foreground",children:C()})]}),s&&(0,o.jsx)("p",{className:"text-sm text-muted-foreground",children:s}),(0,o.jsxs)("div",{className:"mt-2",children:[0===l.length&&(0,o.jsx)("div",{className:"text-sm text-muted-foreground border rounded-md p-3 py-2 bg-gray-100/80 dark:bg-sidebar",children:"No tools available from this server"}),l.length>0&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{className:"flex items-center gap-2 justify-between py-3 px-6 rounded-t-lg border border-b-0",children:[(0,o.jsxs)("div",{className:"text-sm",children:[C()," ",(0,o.jsxs)("span",{className:"text-gray-400 dark:text-white/40",children:["/ ",l.length," tool",1===l.length?"":"s"]})]}),w?(0,o.jsxs)(u.$,{type:"button",variant:"outline",size:"sm",onClick:g,disabled:n,children:[(0,o.jsx)(f.A,{className:"w-4 h-4 text-muted-foreground"}),"Deselect all"]}):(0,o.jsxs)(u.$,{type:"button",variant:"outline",size:"sm",onClick:x,disabled:n,children:[(0,o.jsx)(v.A,{className:"w-4 h-4 text-muted-foreground"}),"Select all"]})]}),(0,o.jsx)("div",{className:"max-h-96 overflow-y-auto border rounded-lg rounded-t-none scrollbar-thin scrollbar-thumb-muted-foreground/30 dark:scrollbar-thumb-muted-foreground/50 scrollbar-track-transparent",children:l.map(e=>{let r=(e=>{switch(b.type){case"all":return l.some(r=>r.name===e);case"selective":return b.tools.includes(e)&&l.some(r=>r.name===e);default:return!1}})(e.name);return(0,o.jsxs)("div",{className:"space-y-2 flex items-start gap-6 border-b last:border-b-0 py-4 px-6 relative",children:[(0,o.jsx)("div",{className:"flex items-center h-[22px]",children:(0,o.jsx)(j.S,{checked:r,disabled:n,className:"mb-0",onClick:()=>!n&&N(e.name,!r)})}),(0,o.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,o.jsx)(y.E,{variant:r?"primary":"code",className:"font-mono font-medium text-xs cursor-pointer transition-colors ".concat(n?"opacity-50 cursor-not-allowed":""),onClick:()=>!n&&N(e.name,!r),children:e.name}),(0,o.jsxs)(k.Tooltip,{delayDuration:800,children:[(0,o.jsx)(k.TooltipTrigger,{asChild:!0,children:(0,o.jsx)("p",{className:"text-sm text-muted-foreground line-clamp-1",children:e.description})}),(0,o.jsx)(k.TooltipContent,{side:"bottom",align:"start",children:e.description})]})]})]},e.name)})})]})]}),(0,o.jsx)(p.C5,{children:null==m?void 0:m.message})]})})}var C=t(29583);let w=C.discriminatedUnion("type",[C.object({type:C.literal("all")}),C.object({type:C.literal("selective"),tools:C.array(C.string())})]),R=C.object({name:C.string().min(1,"Name is required."),config:C.object({type:C.literal("mcp"),mcp:C.object({server:C.object({url:C.string().url("Must be a valid URL.")}),transport:C.object({type:C.nativeEnum(l.o7)}),toolsConfig:w.default({type:"all"})})}),credentialReferenceId:C.string().nullish(),imageUrl:C.string().optional()}),S={name:"",config:{type:"mcp",mcp:{server:{url:""},transport:{type:l.o7.streamableHttp},toolsConfig:{type:"all"}}},imageUrl:"",credentialReferenceId:"none"};function T(e){let{initialData:r,mode:t="create",tool:x,credentials:f,tenantId:v,projectId:h}=e,y=(0,n.useRouter)(),j=(0,d.mN)({resolver:(0,a.u)(R),defaultValues:{...S,...r}}),{isSubmitting:k}=j.formState,C=async e=>{try{let r={...e,credentialReferenceId:"none"===e.credentialReferenceId?null:e.credentialReferenceId,config:{...e.config,mcp:{...e.config.mcp,activeTools:(e=>{var r;if("all"===e.type)return;let t=(null==x||null==(r=x.availableTools)?void 0:r.map(e=>e.name))||[];return e.tools.filter(e=>t.includes(e))})(e.config.mcp.toolsConfig)}}};if("update"===t&&x)await (0,b.Y)(v,h,x.id,r),i.oR.success("MCP server updated successfully"),y.push("/".concat(v,"/projects/").concat(h,"/mcp-servers/").concat(x.id));else{let e=await g(v,h,{...r,id:(0,s.Ak)()});i.oR.success("MCP server created successfully"),y.push("/".concat(v,"/projects/").concat(h,"/mcp-servers/").concat(e.id))}}catch(e){console.error("Failed to ".concat(t," MCP tool:"),e),i.oR.error("Failed to ".concat(t," MCP server. Please try again."))}};return(0,o.jsx)(p.lV,{...j,children:(0,o.jsxs)("form",{onSubmit:j.handleSubmit(C),className:"space-y-8",children:[(0,o.jsx)(c.a,{control:j.control,name:"name",label:"Name",placeholder:"MCP server",isRequired:!0}),(0,o.jsx)(c.a,{control:j.control,name:"config.mcp.server.url",label:"URL",placeholder:"https://api.example.com/mcp",isRequired:!0}),(0,o.jsx)(m.U,{control:j.control,selectTriggerClassName:"w-full",name:"config.mcp.transport.type",label:"Transport type",placeholder:"Select transport type",options:[{value:l.o7.streamableHttp,label:"Streamable HTTP"},{value:l.o7.sse,label:"Server-Sent Events (SSE)"}]}),(0,o.jsx)(c.a,{control:j.control,name:"imageUrl",label:"Image URL (optional)",placeholder:"https://example.com/icon.png or data:image/png;base64,..."}),(0,o.jsx)(m.U,{control:j.control,selectTriggerClassName:"w-full",name:"credentialReferenceId",label:"Credential",placeholder:"Select a credential",options:[{value:"none",label:"No Authentication"},...f.map(e=>({value:e.id,label:e.id}))]}),"update"===t&&(0,o.jsx)(N,{control:j.control,name:"config.mcp.toolsConfig",label:"Tools",availableTools:(null==x?void 0:x.availableTools)||[],description:"Select which tools should be enabled for this MCP server"}),(0,o.jsx)(u.$,{type:"submit",disabled:k,children:"update"===t?"Save":"Create"})]})})}}}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6508],{864:(e,t,r)=>{"use strict";r.d(t,{ArtifactComponentItem:()=>j});var n=r(60098),c=r(51332),s=r(80986),o=r(30836),a=r(21341),i=r(79178),l=r(86714),d=r(30958),u=r(80311),f=r(93137),h=r(32028),m=r(90035),p=r(97555);let v=(0,p.createServerReference)("70b6afb0cc038577cf58a18ce7e373b06be1aac9f3",p.callServer,void 0,p.findSourceMapURL,"deleteArtifactComponentAction");function x(e){let{artifactComponentId:t,artifactComponentName:r,setIsOpen:c}=e,[s,o]=(0,i.useState)(!1),{tenantId:a,projectId:l}=(0,f.useParams)(),d=async()=>{o(!0);try{let e=await v(a,l,t);e.success?(c(!1),h.oR.success("Artifact component deleted.")):h.oR.error(e.error)}finally{o(!1)}};return(0,n.jsx)(m.J,{itemName:r||"this artifact component",isSubmitting:s,onDelete:d})}function b(e){let{artifactComponentId:t,artifactComponentName:r}=e,[c,s]=(0,i.useState)(!1);return(0,n.jsxs)(d.lG,{open:c,onOpenChange:e=>{s(e)},children:[(0,n.jsxs)(u.rI,{children:[(0,n.jsx)(u.ty,{asChild:!0,children:(0,n.jsx)(l.$,{variant:"ghost",size:"icon-sm",className:" p-0 hover:bg-accent hover:text-accent-foreground rounded-sm -mr-2",children:(0,n.jsx)(o.A,{className:"h-4 w-4 text-muted-foreground"})})}),(0,n.jsx)(u.SQ,{align:"end",className:"w-48 shadow-lg border border-border bg-popover/95 backdrop-blur-sm",children:(0,n.jsx)(d.zM,{asChild:!0,children:(0,n.jsxs)(u._2,{className:"text-destructive hover:!bg-destructive/10 dark:hover:!bg-destructive/20 hover:!text-destructive cursor-pointer",children:[(0,n.jsx)(a.A,{className:"size-4 text-destructive"}),"Delete"]})})})]}),c&&(0,n.jsx)(x,{artifactComponentId:t,artifactComponentName:r,setIsOpen:s})]})}function j(e){let{id:t,name:r,description:o,createdAt:a,tenantId:i,projectId:l}=e,d="/".concat(i,"/projects/").concat(l,"/artifact-components/").concat(t);return(0,n.jsxs)(s.uS,{children:[(0,n.jsxs)(s.f1,{children:[(0,n.jsx)(s.KK,{href:d,children:(0,n.jsx)(s.Kl,{className:"text-md",children:r})}),(0,n.jsx)(b,{artifactComponentId:t,artifactComponentName:r})]}),(0,n.jsxs)(s.h6,{children:[(0,n.jsx)(s.MM,{hasContent:!!o,className:"line-clamp-2",children:o||"No description"}),(0,n.jsx)(s.B7,{footerText:"Created ".concat((0,c.Yq)(a))})]})]})}},91148:(e,t,r)=>{Promise.resolve().then(r.bind(r,864)),Promise.resolve().then(r.bind(r,1095)),Promise.resolve().then(r.bind(r,88831)),Promise.resolve().then(r.t.bind(r,85276,23))},97555:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{callServer:function(){return n.callServer},createServerReference:function(){return s.createServerReference},findSourceMapURL:function(){return c.findSourceMapURL}});let n=r(83600),c=r(81572),s=r(17928)}},e=>{e.O(0,[8246,8805,1269,2060,4773,2960,8831,318,9907,4918,7358],()=>e(e.s=91148)),_N_E=e.O()}]);