@inkeep/agents-manage-ui 0.0.0-dev-20251007180650 → 0.0.0-dev-20251007183021
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.
- package/.next/standalone/agents-manage-ui/.next/BUILD_ID +1 -1
- package/.next/standalone/agents-manage-ui/.next/app-build-manifest.json +110 -110
- package/.next/standalone/agents-manage-ui/.next/app-path-routes-manifest.json +8 -8
- package/.next/standalone/agents-manage-ui/.next/build-manifest.json +2 -2
- package/.next/standalone/agents-manage-ui/.next/prerender-manifest.json +3 -3
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/page.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/api-keys/page.js +3 -3
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/api-keys/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/artifacts/[artifactComponentId]/page.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/artifacts/[artifactComponentId]/page.js.nft.json +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/artifacts/[artifactComponentId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/artifacts/new/page.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/artifacts/new/page.js.nft.json +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/artifacts/new/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/artifacts/page.js +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/artifacts/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/components/[dataComponentId]/page.js +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/components/[dataComponentId]/page.js.nft.json +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/components/[dataComponentId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/components/new/page.js +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/components/new/page.js.nft.json +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/components/new/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/components/page.js +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/components/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/credentials/[credentialId]/page.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/credentials/[credentialId]/page.js.nft.json +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/credentials/[credentialId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/credentials/new/bearer/page.js +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/credentials/new/bearer/page.js.nft.json +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/credentials/new/bearer/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/credentials/new/page.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/credentials/new/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/credentials/new/providers/[providerId]/page.js +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/credentials/new/providers/[providerId]/page.js.nft.json +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/credentials/new/providers/[providerId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/credentials/new/providers/page.js +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/credentials/new/providers/page.js.nft.json +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/credentials/new/providers/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/credentials/page.js +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/credentials/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/graphs/[graphId]/page.js +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/graphs/[graphId]/page.js.nft.json +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/graphs/[graphId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/graphs/new/page.js +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/graphs/new/page.js.nft.json +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/graphs/new/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/graphs/page.js +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/graphs/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/mcp-servers/[mcpServerId]/edit/page.js +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/mcp-servers/[mcpServerId]/edit/page.js.nft.json +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/mcp-servers/[mcpServerId]/edit/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/mcp-servers/[mcpServerId]/page.js +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/mcp-servers/[mcpServerId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/mcp-servers/new/page.js +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/mcp-servers/new/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/mcp-servers/page.js +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/mcp-servers/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/page.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/settings/page.js +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/settings/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/traces/ai-calls/page.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/traces/ai-calls/page.js.nft.json +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/traces/ai-calls/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/traces/conversations/[conversationId]/page.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/traces/conversations/[conversationId]/page.js.nft.json +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/traces/conversations/[conversationId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/traces/page.js +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/traces/page.js.nft.json +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/traces/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/page.js +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/_not-found/page.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/_not-found.rsc +9 -9
- package/.next/standalone/agents-manage-ui/.next/server/app/api/signoz/conversations/[conversationId]/route_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/api/signoz/route_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/page.js +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app-paths-manifest.json +8 -8
- package/.next/standalone/agents-manage-ui/.next/server/chunks/2194.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/server/chunks/2539.js +3 -3
- package/.next/standalone/agents-manage-ui/.next/server/chunks/2637.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/server/chunks/3547.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/chunks/4619.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/server/chunks/5893.js +13 -13
- package/.next/standalone/agents-manage-ui/.next/server/chunks/6212.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/chunks/6747.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/chunks/{7606.js → 8029.js} +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/chunks/8100.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/chunks/{7351.js → 9684.js} +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/chunks/9813.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/pages/404.html +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/pages/500.html +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/server-reference-manifest.json +1 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/{1558-7907bb369073782b.js → 1558-26bfbd11b469388d.js} +1 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/3695-3699da44971d06e4.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/4492-20e1ab26a989aec8.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/7167-2c67d25acb837a8d.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/{8486-01fbe9371d862c28.js → 7548-72eac23478e21cf6.js} +2 -2
- package/.next/standalone/agents-manage-ui/.next/static/chunks/{1064-f747155da2f9bf6e.js → 8098-ddd83ff45bfe3a5d.js} +2 -2
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/api-keys/{page-38cc428b4fcec9b6.js → page-65054fb03060f369.js} +1 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/artifacts/[artifactComponentId]/page-6cc8a5e2569a0e96.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/artifacts/new/page-6cc8a5e2569a0e96.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/artifacts/page-45a02390d131ddc9.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/components/[dataComponentId]/{page-f1c5c271b66bc606.js → page-e9510eadb8f6feea.js} +1 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/components/new/{page-f1c5c271b66bc606.js → page-e9510eadb8f6feea.js} +1 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/components/{page-54cdeafa9909e73a.js → page-16589379dad32008.js} +1 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/credentials/[credentialId]/{page-4adbd9f9aa5a948e.js → page-db072d7cef52a0aa.js} +1 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/credentials/new/bearer/page-23c036bf50a39bc2.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/credentials/new/providers/[providerId]/page-1a2629a69d0e3df2.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/credentials/page-bcd32bbd71a47a9b.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/graphs/[graphId]/{page-34d40f96fca0a775.js → page-1eb60b0e4938c014.js} +1 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/graphs/new/{page-ec47cadccd7ea8cc.js → page-c5b98195dd79bb1b.js} +1 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/graphs/page-4eeba6b24e3524dd.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/mcp-servers/new/{page-9104063814ea2b4f.js → page-8e1512615bc059fb.js} +1 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/mcp-servers/page-e5afea20bb7e80f7.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/settings/{page-aa7af3afc45a375f.js → page-796fad4e9ca1439f.js} +1 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/traces/conversations/[conversationId]/{page-51e9f2349b48882c.js → page-9eaf84488f4f9f65.js} +1 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/traces/{page-7fa3d63d14ac0ef2.js → page-417d48bd147aaf8e.js} +1 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/{page-c19954fef3865335.js → page-dc931a9d54c9e32e.js} +1 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/layout-aa73a685c8ef40fa.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/static/css/7a51e3c22331b9a6.css +1 -0
- package/.next/standalone/package.json +1 -0
- package/package.json +4 -4
- package/src/components/traces/timeline/span-attributes.tsx +16 -21
- package/src/components/traces/timeline/timeline-item.tsx +22 -23
- package/src/components/traces/timeline/timeline-wrapper.tsx +6 -3
- package/.next/standalone/agents-manage-ui/.next/server/chunks/2096.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/server/chunks/3284.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/server/chunks/9166.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/4492-bbee4b343816f7ef.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/5780-e19e01b88495774a.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/7167-9a2082e2d3e4ce6b.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/artifacts/[artifactComponentId]/page-364b01b6c51ab854.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/artifacts/new/page-364b01b6c51ab854.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/artifacts/page-77a47cba609baadc.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/credentials/new/bearer/page-38711cc3c6d6d365.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/credentials/new/providers/[providerId]/page-d0140d8dde2ffa00.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/credentials/page-209919e7b3e9eadc.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/graphs/page-ffc29c36b3bc4015.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/mcp-servers/page-e3aa5507d2bc01d1.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/layout-668c73cc82c1c990.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/css/af3cf80caf41522b.css +0 -1
- /package/.next/standalone/agents-manage-ui/.next/static/{3yEUkzKAoJG7MzGM3kveK → XyDl5iQvWAhv6gkHhwLkc}/_buildManifest.js +0 -0
- /package/.next/standalone/agents-manage-ui/.next/static/{3yEUkzKAoJG7MzGM3kveK → XyDl5iQvWAhv6gkHhwLkc}/_ssgManifest.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7167],{6040:(e,t,a)=>{"use strict";a.d(t,{i:()=>s});var r=a(97555);let s=(0,r.createServerReference)("7c1777c9b1125e1d2fa08c6bedb1091b9cb51e7e8b",r.callServer,void 0,r.findSourceMapURL,"fetchMCPTools")},11729:(e,t,a)=>{"use strict";a.d(t,{$:()=>o,F:()=>l});var r=a(60098),s=a(34995),n=a(52681);function l(e){let{className:t,children:a,...l}=e;return(0,r.jsxs)(s.bL,{"data-slot":"scroll-area",className:(0,n.cn)("relative",t),...l,children:[(0,r.jsx)(s.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)(o,{}),(0,r.jsx)(s.OK,{})]})}function o(e){let{className:t,orientation:a="vertical",...l}=e;return(0,r.jsx)(s.VM,{"data-slot":"scroll-area-scrollbar",orientation:a,className:(0,n.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),...l,children:(0,r.jsx)(s.lr,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}},30958:(e,t,a)=>{"use strict";a.d(t,{Cf:()=>m,Es:()=>h,HM:()=>c,L3:()=>x,c7:()=>p,lG:()=>o,rr:()=>g,zM:()=>i});var r=a(60098),s=a(28008),n=a(31184),l=a(52681);function o(e){let{...t}=e;return(0,r.jsx)(s.bL,{"data-slot":"dialog",...t})}function i(e){let{...t}=e;return(0,r.jsx)(s.l9,{"data-slot":"dialog-trigger",...t})}function d(e){let{...t}=e;return(0,r.jsx)(s.ZL,{"data-slot":"dialog-portal",...t})}function c(e){let{...t}=e;return(0,r.jsx)(s.bm,{"data-slot":"dialog-close",...t})}function u(e){let{className:t,...a}=e;return(0,r.jsx)(s.hJ,{"data-slot":"dialog-overlay",className:(0,l.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:o=!0,...i}=e;return(0,r.jsxs)(d,{"data-slot":"dialog-portal",children:[(0,r.jsx)(u,{}),(0,r.jsxs)(s.UC,{"data-slot":"dialog-content",className:(0,l.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,o&&(0,r.jsxs)(s.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)(n.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,l.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,l.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)(s.hE,{"data-slot":"dialog-title",className:(0,l.cn)("text-lg leading-none font-medium",t),...a})}function g(e){let{className:t,...a}=e;return(0,r.jsx)(s.VY,{"data-slot":"dialog-description",className:(0,l.cn)("text-muted-foreground text-sm",t),...a})}},37479:(e,t,a)=>{"use strict";a.d(t,{i:()=>d});var r=a(60098),s=a(27820),n=a(28453),l=a(79178),o=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]=l.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,o.cn)("backdrop-blur-sm bg-card/90 hover:bg-card border border-border shadow-sm",a),onClick:()=>p(t),children:[m?(0,r.jsx)(s.A,{className:(0,o.cn)("w-4 h-4 text-green-600 dark:text-green-400",u)}):(0,r.jsx)(n.A,{className:(0,o.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:()=>l});var r=a(60098),s=a(27764),n=a(79178);function l(e){let{provider:t,fallback:a=!1,className:l,size:o=20}=e,[i,d]=(0,n.useState)(!1),[c,u]=(0,n.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(l||""),style:{width:o,height:o},children:[c&&(0,r.jsx)("div",{className:"absolute",children:a||((e,t)=>{let a=e.charAt(0),s=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(s,"px"),lineHeight:1},children:a})})(t,o)}),(0,r.jsx)(s.default,{src:m,alt:"".concat(t," icon"),width:"string"==typeof o?Number.parseInt(o,10)||20:o,height:"string"==typeof o?Number.parseInt(o,10)||20:o,onLoad:()=>{d(!0)},onError:()=>{u(!0)},style:{maxWidth:"100%",maxHeight:"100%",opacity:i&&!c?1:0},unoptimized:!0},t)]})}},57167:(e,t,a)=>{Promise.resolve().then(a.bind(a,68866)),Promise.resolve().then(a.bind(a,1095)),Promise.resolve().then(a.bind(a,88831)),Promise.resolve().then(a.t.bind(a,85276,23))},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})},68866:(e,t,a)=>{"use strict";a.d(t,{Graph:()=>ap});var r=a(60098),s=a(49282),n=a(14123),l=a(30953),o=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:l,targetX:o,targetY:i,sourcePosition:d,targetPosition:c,label:u,selected:m,markerEnd:p}=e,[h]=(0,n.Fp)({sourceX:a,sourceY:l,sourcePosition:d,targetX:o,targetY:i,targetPosition:c});return(0,r.jsx)(s.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:l,targetY:o,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=l-t,s=o-a,c=Math.sqrt(r*r+s*s),u=-(s/c)*e,m=r/c*e;return(0,n.Fp)({sourceX:t+u,sourceY:a+m,targetX:l+u,targetY:o+m,targetPosition:d,sourcePosition:i})},[v,j,b]=(0,n.Fp)({sourceX:t,sourceY:a,targetX:l,targetY:o,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 C=e=>e?"url(#marker-selected)":"url(#marker-default)",T=g&&h.transferTargetToSource?C(!!u):void 0,w=g&&h.transferSourceToTarget?C(!!u):void 0,S=x&&h.delegateTargetToSource?C(!!u):void 0,E=x&&h.delegateSourceToTarget?C(!!u):void 0;return(0,r.jsxs)(r.Fragment,{children:[g&&(0,r.jsx)(s.tE,{className:"".concat(u?"!stroke-primary":"!stroke-border dark:!stroke-muted-foreground"),path:x?f(-3)[0]:v,style:{strokeWidth:2},markerEnd:w,markerStart:T}),x&&(0,r.jsx)(s.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)(s.rV,{children:(0,r.jsx)("div",{style:{position:"absolute",transform:"translate(-50%, -50%) translate(".concat(j,"px,").concat(b,"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:n}=e,l=(0,s.Pj)(e=>e.nodes.find(e=>e.id===t));if(!l)return null;let o=(null==a?void 0:a.relationships)||{transferTargetToSource:!1,transferSourceToTarget:!1,delegateTargetToSource:!1,delegateSourceToTarget:!1},i=o.delegateTargetToSource||o.delegateSourceToTarget,d=o.transferTargetToSource||o.transferSourceToTarget,c=l.position.x,u=l.position.y,m=l.width||300,p=l.height||150,h=c+m/2,g=u+p/2,f=h+m/2,v=g-10,j=h+m/2,b=g+10,y="\n M ".concat(f," ").concat(v,"\n C ").concat(f+80," ").concat(v-40,",\n ").concat(j+80," ").concat(b+40,",\n ").concat(j," ").concat(b,"\n "),N="\n M ".concat(f-5," ").concat(v,"\n C ").concat(f+80-5," ").concat(v-40-5,",\n ").concat(j+80-5," ").concat(b+40+5,",\n ").concat(j-5," ").concat(b,"\n "),k=e=>e?"url(#marker-selected)":"url(#marker-default)",C=d?k(!!n):void 0,T=i?k(!!n):void 0;return(0,r.jsxs)(r.Fragment,{children:[d&&(0,r.jsx)(s.tE,{className:"".concat(n?"!stroke-primary":"!stroke-border dark:!stroke-muted-foreground"),path:y,style:{strokeWidth:2,fill:"none"},markerEnd:C}),i&&(0,r.jsx)(s.tE,{className:"".concat(n?"!stroke-primary":"!stroke-border dark:!stroke-muted-foreground"),path:d?N:y,style:{strokeDasharray:"5,5",strokeWidth:2,fill:"none"},markerEnd:T}),(d||i)&&(0,r.jsx)(s.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}},j=[];var b=a(81860),y=a(44249),N=a(96441),k=a(20361),C=a(4778),T=a(44339),w=a(991),S=a(48851),E=a(84654),A=a(64202),I=a(39475),O=a(44886),z=a(52681);function L(e){let t=120;if(e.type===Z.Agent||e.type===Z.ExternalAgent){var a,r;let s=e.data;s.description&&(t+=20),(null==(r=s.models)||null==(a=r.base)?void 0:a.model)&&(t+=30),s.dataComponents&&s.dataComponents.length>0&&(t+=60+30*Math.ceil(s.dataComponents.length/3)),s.artifactComponents&&s.artifactComponents.length>0&&(t+=60+30*Math.ceil(s.artifactComponents.length/3))}return e.type===Z.MCP&&(t=100),Math.max(t,150)}function U(e,t){let a=new O.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=L(t);a.setNode(t.id,{width:300,height:e})}for(let e of t)a.setEdge(e.source,e.target);return O.layout(a),e.map(e=>{let t=a.node(e.id),r=L(e);return{...e,position:{x:t.x-150,y:t.y-r/2}}})}function P(){let{errors:e,showErrors:t}=el(e=>({errors:e.errors,showErrors:e.showErrors})),{hasErrors:a,getNodeErrors:r,getEdgeErrors:s,setErrors:n,clearErrors:l,setShowErrors:o}=en(),d=e=>r(e).length,c=e=>s(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:s,getNodeErrorCount:d,getEdgeErrorCount:c,hasNodeErrors:e=>d(e)>0,hasEdgeErrors:e=>c(e)>0,getFieldErrors:u,hasFieldError:m,getFieldErrorMessage:p,getFirstErrorField:h,setErrors:n,clearErrors:l,setShowErrors:o}}var M=a(76507),R=a(31011);function D(e){let{errors:t,className:a=""}=e;if(0===t.length)return null;let s=(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)(M.A,{className:"text-red-600 dark:text-red-400 w-3 h-3"})});return(0,r.jsx)(R.B,{children:(0,r.jsxs)(R.Tooltip,{children:[(0,r.jsx)(R.TooltipTrigger,{asChild:!0,children:s}),(0,r.jsx)(R.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":""]})]})})]})})}let B=(0,i.forwardRef)((e,t)=>{let{className:a,isSelected:s,...n}=e;return(0,r.jsx)("div",{ref:t,className:(0,z.cn)("relative rounded-lg border bg-card text-card-foreground","hover:ring-2 hover:ring-gray-700/5",s&&"ring-2 ring-primary hover:ring-primary",a),...n})});B.displayName="BaseNode";let F=(0,i.forwardRef)((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("header",{ref:t,...s,className:(0,z.cn)("mx-0 my-0 -mb-1 flex flex-row items-center justify-between gap-2 px-4 pt-4 pb-0",a)})});F.displayName="BaseNodeHeader";let _=(0,i.forwardRef)((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("h3",{ref:t,"data-slot":"base-node-title",className:(0,z.cn)("user-select-none flex-1 font-semibold text-sm truncate",a),...s})});_.displayName="BaseNodeHeaderTitle";let V=(0,i.forwardRef)((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("div",{ref:t,"data-slot":"base-node-content",className:(0,z.cn)("flex flex-col gap-y-2 p-4 text-foreground",a),...s})});function H(e){let{className:t,...a}=e;return(0,r.jsx)(s.h7,{...a,className:(0,z.cn)("!h-3 !w-3 !border-2 !border-border !bg-card dark:!bg-muted !shadow-sm",t)})}function W(e){let{selected:t,children:a}=e;return(0,r.jsx)("div",{className:(0,z.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})}V.displayName="BaseNodeContent",(0,i.forwardRef)((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("div",{ref:t,"data-slot":"base-node-footer",className:(0,z.cn)("flex flex-col items-center gap-y-2 border-t px-4 pb-4 pt-3",a),...s})}).displayName="BaseNodeFooter";let J=e=>{let{title:t,items:a,Icon:s}=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)(s,{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)(I.E,{className:"text-xs",variant:"code",children:e},e))})]})};var q=a(66894),$=a(77064);function G(e,t,a){if(void 0!==e.data.tempSelectedTools)return e.data.tempSelectedTools;let r=e.data.relationshipId;if(r)for(let e of Object.values(t)){let t=e[r];if(t)return t.toolSelection||null}return null}var Z=function(e){return e.Agent="agent",e.ExternalAgent="external-agent",e.MCP="mcp",e.MCPPlaceholder="mcp-placeholder",e}({});let K={agent:function(e){var t;let{data:a,selected:s,id:l}=e,{name:o,isDefault:d,description:c,models:u}=a,m=null==u||null==(t=u.base)?void 0:t.model,{dataComponentLookup:p,artifactComponentLookup:h}=el(e=>({dataComponentLookup:e.dataComponentLookup,artifactComponentLookup:e.artifactComponentLookup})),{getNodeErrors:x,hasNodeErrors:g}=P(),f=a.id||l,v=x(f),j=g(f),b=(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)(W,{selected:s,children:"Default"}):null,(0,r.jsxs)(B,{isSelected:s,className:"".concat(d?"rounded-tl-none":""," ").concat(j?"ring-2 ring-red-300 border-red-300":""),style:{width:300},children:[(0,r.jsxs)(F,{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)(N.A,{className:"size-4 text-muted-foreground"}),(0,r.jsx)(_,{children:o||"Agent"})]}),(0,r.jsx)(I.E,{variant:"primary",className:"text-xs uppercase",children:"Agent"}),j&&(0,r.jsx)(D,{errors:v,className:"absolute -top-2 -right-2 w-6 h-6"})]}),(0,r.jsxs)(V,{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)(I.E,{className:"text-xs max-w-full flex-1",variant:"code",children:[(null==m?void 0:m.startsWith("openai"))?(0,r.jsx)(A.I,{className:"size-3 text-xs text-muted-foreground flex-shrink-0"}):(null==m?void 0:m.startsWith("anthropic"))?(0,r.jsx)(S.S,{className:"size-3 text-xs flex-shrink-0"}):(null==m?void 0:m.startsWith("google"))?(0,r.jsx)(E.A,{className:"size-3 text-xs flex-shrink-0"}):null,(0,r.jsx)("div",{className:"truncate w-full",children:m||""})]}):null,(null==b?void 0:b.length)>0&&(0,r.jsx)(J,{title:"Components",items:b,Icon:T.A}),(null==y?void 0:y.length)>0&&(0,r.jsx)(J,{title:"Artifacts",items:y,Icon:w.A})]}),(0,r.jsx)(H,{id:Q,type:"source",position:n.yX.Top,isConnectable:!0}),(0,r.jsx)(H,{id:Y,type:"source",position:n.yX.Bottom,isConnectable:!0})]})]})},"external-agent":function(e){let{data:t,selected:a,id:s}=e,{name:l,description:o}=t,{getNodeErrors:i,hasNodeErrors:d}=P(),c=t.id||s,u=i(c),m=d(c);return(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(W,{selected:a,children:"External"}),(0,r.jsxs)(B,{isSelected:a,className:"rounded-tl-none ".concat(m?"ring-2 ring-red-300 border-red-300":""),style:{width:300},children:[(0,r.jsxs)(F,{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)(k.A,{className:"size-4 text-muted-foreground"}),(0,r.jsx)(_,{children:l||"External agent"})]}),(0,r.jsx)(I.E,{variant:"primary",className:"text-xs uppercase",children:"Agent"}),m&&(0,r.jsx)(D,{errors:u,className:"absolute -top-2 -right-2 w-6 h-6"})]}),(0,r.jsx)(V,{children:(0,r.jsx)("div",{className:"text-sm ".concat(o?" text-muted-foreground":"text-muted-foreground/50"),children:o||"No description"})}),(0,r.jsx)(H,{id:ee,type:"target",position:n.yX.Top,isConnectable:!0})]})]})},mcp:function(e){var t,a;let{data:s,selected:l}=e,{toolLookup:o,agentToolConfigLookup:i,edges:d}=el(e=>({toolLookup:e.toolLookup,agentToolConfigLookup:e.agentToolConfigLookup,edges:e.edges})),c=s.name||"Tool: ".concat(s.toolId),u=s.imageUrl,m=s.provider,p=o[s.toolId],h=null==p?void 0:p.availableTools,x=(0,q.O)({availableTools:h,activeTools:null==p||null==(a=p.config)||null==(t=a.mcp)?void 0:t.activeTools}),g=G(e,i,d),f=(()=>{var e,t;if(null===g){let t=((null==x?void 0:x.slice(0,4))||[]).map(e=>e.name),a=(null!=(e=null==x?void 0:x.length)?e:0)-4,r=[...t];return a>0&&r.push("+".concat(a," (ALL)")),r}let a=g.length,r=null!=(t=null==x?void 0:x.length)?t:0;if(0===a)return["0"];if(a===r){let e=g.slice(0,4),t=a-4,r=[...e];return t>0&&r.push("+".concat(t," (ALL)")),r}return a<=4?g:[...g.slice(0,4),"+".concat(a-4)]})();return(0,r.jsxs)(B,{isSelected:l,className:"rounded-4xl min-w-40 min-h-13 max-w-3xs",children:[(0,r.jsx)(F,{className:"mb-0 py-3",children:(0,r.jsxs)("div",{className:"flex items-center flex-wrap gap-1",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0 mr-4",children:[(0,r.jsx)($.u,{imageUrl:u,name:c,provider:m||void 0,size:24,className:"mt-[1px] flex-shrink-0"}),(0,r.jsx)(_,{className:"flex-shrink-0",children:c})]}),(0,r.jsx)("div",{className:"flex items-center flex-wrap gap-1",children:f.map((e,t)=>(0,r.jsx)(I.E,{variant:"code",className:"px-2 text-2xs text-gray-700 dark:text-gray-300 flex-shrink-0",children:e},t))})]})}),(0,r.jsx)(H,{id:X,type:"target",position:n.yX.Top,isConnectable:!0})]})},"mcp-placeholder":function(e){let{data:t,selected:a}=e,{name:s}=t;return(0,r.jsx)(B,{isSelected:a,className:"rounded-4xl 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)(F,{className:"mb-0 py-3",children:[(0,r.jsx)(C.A,{className:"size-4 text-muted-foreground/65"}),(0,r.jsx)(_,{className:"text-muted-foreground",children:s})]})})}},X="target-mcp",Y="source-agent",Q="target-agent",ee="target-external-agent",et={agent:{name:""},"external-agent":{name:""},mcp:{name:"MCP",agentId:null,relationshipId:null},"mcp-placeholder":{name:"Select MCP server"}},ea={agent:{type:"agent",name:"Agent",Icon:N.A},"external-agent":{type:"external-agent",name:"External agent",Icon:k.A},"mcp-placeholder":{type:"mcp-placeholder",name:"MCP",Icon:C.A},mcp:{type:"mcp",name:"MCP",Icon:C.A}};var er=a(8279);let es=(0,b.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:{},toolLookup:{},agentToolConfigLookup:{},dirty:!1,history:[],future:[],errors:null,showErrors:!1,actions:{setInitial(t,a,r){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:{};e({nodes:t,edges:a,metadata:r,dataComponentLookup:s,artifactComponentLookup:n,toolLookup:l,agentToolConfigLookup:o,dirty:!1,history:[],future:[],errors:null,showErrors:!1})},setDataComponentLookup(t){e({dataComponentLookup:t})},setArtifactComponentLookup(t){e({artifactComponentLookup:t})},setToolLookup(t){e({toolLookup:t})},setAgentToolConfigLookup(t){e({agentToolConfigLookup: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);e(e=>({history:[...e.history,{nodes:e.nodes,edges:e.edges}],nodes:(0,s._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=>{let r=t.filter(e=>"remove"===e.type),n=e.nodes;for(let t of r){let a=e.edges.find(e=>e.id===t.id);if(a&&a.targetHandle===X){let t=e.nodes.find(e=>e.id===a.target);t&&t.type===Z.MCP&&(n=n.map(e=>e.id===t.id?{...e,data:{...e.data,agentId:null,relationshipId:null}}:e))}}return{history:[...e.history,{nodes:e.nodes,edges:e.edges}],nodes:n,edges:(0,s.zW)(t,e.edges),dirty:!!a||e.dirty}})},onConnect(t){e(e=>({edges:(0,n.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]:[]}}}))),en=()=>es(e=>e.actions);function el(e){return es((0,er.k)(e))}class eo{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 ei=new eo;class ed{execute(){let{actions:e}=es.getState();e.setNodes(e=>e.concat(this.node))}undo(){let{actions:e}=es.getState();e.setNodes(e=>e.filter(e=>e.id!==this.node.id))}constructor(e){this.name="AddNode",this.node=e}}class ec{execute(){let{actions:e}=es.getState();this.edge.type===g.A2A&&e.setNodes(e=>e.map(e=>({...e,selected:!1}))),e.setEdges(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,n.rN)(this.edge,t);return ei.emit("edgeConnected",{edgeId:this.edge.id}),a})}undo(){let{actions:e}=es.getState(),t=this.edge.id;e.setEdges(e=>e.filter(e=>e.id!==t))}constructor(e,t){this.name="AddPreparedEdge",this.edge=e,this.deselectOtherEdgesIfA2A=!!(null==t?void 0:t.deselectOtherEdgesIfA2A)}}function eu(e){if(e)try{return JSON.parse(e)}catch(e){console.error("Error parsing JSON:",e);return}}var em=a(48057);let ep=["graph","node","edge"];function eh(){let[e,t]=(0,em.ab)({pane:(0,em.M1)(ep),nodeId:em.tU,edgeId:em.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 ex=a(97555);let eg=(0,ex.createServerReference)("789101164fbf895225e79c4cea6cbdfd6631eceefc",ex.callServer,void 0,ex.findSourceMapURL,"updateFullGraphAction"),ef=(0,ex.createServerReference)("70bba73f40ce260a167dce69ec1af0860f15669a1c",ex.callServer,void 0,ex.findSourceMapURL,"createFullGraphAction");async function ev(e,t,a,r){return r?eg(e,t,r,a):ef(e,t,a)}function ej(e,t){let a,r,s,n=[...t,...e.path],l="graph";"agents"===n[0]&&n[1]?(l="node",a=n[1]):"edges"===n[0]&&n[1]&&(l="edge",r=n[1]),s=e.path.join(".")||"configuration";let o=function(e,t,a){var r;let s="node"===a?"Agent":"edge"===a?"Connection":"Graph",n={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:"Components",artifactComponents:"Artifacts",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(s," is missing required field: ").concat(n);return"".concat(s," ").concat(n," has invalid type. Expected ").concat(e.expected);case"too_small":return"".concat(s," ").concat(n," is too short. Please provide a valid value");case"invalid_enum_value":return"".concat(s," ").concat(n," has an invalid value. Please select a valid option");case"invalid_union":if(t.includes("type")||e.message.includes("discriminator"))return"".concat(s," type must be specified as either 'internal' or 'external'");return"".concat(s," configuration is incomplete. Please check all required fields");default:return"".concat(s," ").concat(n,": ").concat(e.message)}}(e,s,l);return{type:l,nodeId:a,edgeId:r,field:s,message:o,fullPath:n,originalError:e}}var eb=a(77186),ey=a(6826),eN=a(76636),ek=a(31184),eC=a(65299),eT=a(86714),ew=a(67696),eS=a(74598);function eE(e){let{title:t,errors:a,icon:s,onNavigate:n,getItemLabel:l}=e,[o,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)(eS.Nt,{open:o,onOpenChange:d,children:[(0,r.jsx)(eS.R6,{asChild:!0,children:(0,r.jsx)(eT.$,{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:[s,(0,r.jsxs)("span",{className:"font-medium",children:[t," (",a.length,")"]}),o?(0,r.jsx)(ey.A,{className:"w-3 h-3 ml-auto"}):(0,r.jsx)(eN.A,{className:"w-3 h-3 ml-auto"})]})})}),(0,r.jsx)(eS.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:[l&&(0,r.jsx)("span",{className:"text-xs font-medium text-foreground truncate",children:l(a[0])}),n&&"general"!==t&&(0,r.jsx)(eT.$,{size:"sm",variant:"outline",onClick:()=>n(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 eA(e){let{errorSummary:t,onClose:a,onNavigateToNode:s,onNavigateToEdge:n}=e,{setQueryState:l}=eh(),o=Object.values(t.nodeErrors).flat(),i=Object.values(t.edgeErrors).flat(),d=t.graphErrors;return(0,r.jsxs)(ew.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)(ew.aR,{className:"px-3",children:(0,r.jsxs)(ew.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)(M.A,{className:"w-4 h-4"}),(0,r.jsxs)("span",{children:["Validation Errors (",t.totalErrors,")"]})]}),(0,r.jsx)(eT.$,{variant:"ghost",size:"sm",onClick:a,className:"h-6 w-6 p-0",children:(0,r.jsx)(ek.A,{className:"w-3 h-3"})})]})}),(0,r.jsxs)(ew.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)(eE,{title:"Agent Errors",errors:o,icon:(0,r.jsx)(eC.A,{className:"w-3 h-3"}),onNavigate:e=>{l({pane:"node",nodeId:e,edgeId:null}),null==s||s(e)},getItemLabel:e=>"Agent (".concat(e.nodeId,")")}),(0,r.jsx)(eE,{title:"Connection Errors",errors:i,icon:(0,r.jsx)("div",{className:"w-3 h-3 border rounded-full"}),onNavigate:e=>{l({pane:"edge",nodeId:null,edgeId:e}),null==n||n(e)},getItemLabel:e=>"Connection (".concat(e.edgeId,")")}),(0,r.jsx)(eE,{title:"Graph Configuration Errors",errors:d,icon:(0,r.jsx)(M.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 eI(){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 eO(){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 ez=a(52597);function eL(e){let{node:t}=e,{type:a,name:s,Icon:n,disabled:l}=t;return(0,r.jsxs)("div",{role:"button",tabIndex:l?-1:0,"aria-label":"Drag ".concat(s," 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:!l,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)(n,{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:s})})]}),(0,r.jsx)(ez.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 eU=[ea[Z.Agent],ea[Z.ExternalAgent],ea[Z.MCPPlaceholder]];function eP(){return(0,r.jsx)("div",{className:"flex flex-col gap-2 max-w-72 w-52 min-w-0",children:eU.map(e=>(0,r.jsx)(eL,{node:e},e.type))})}var eM=a(82158),eR=a(69026),eD=a(51433),eB=a(55959),eF=a(15660);function e_(e){let{graphId:t,projectId:a,tenantId:s,conversationId:n,setConversationId:o,startPolling:d,stopPolling:c,customHeaders:u={}}=e,{INKEEP_AGENTS_RUN_API_URL:m,INKEEP_AGENTS_RUN_API_BYPASS_SECRET:p}=(0,eF.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)(eB.Po,{baseSettings:{onEvent:e=>{"assistant_message_received"===e.eventName&&(h.current=setTimeout(()=>{c(),h.current=null},15e3)),"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(),o((0,l.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:{aiAssistantAvatar:{light:"/assets/inkeep-icons/icon-blue.svg",dark:"/assets/inkeep-icons/icon-sky.svg"},conversationId:n,graphUrl:t?"".concat(m,"/api/chat"):void 0,headers:{"x-inkeep-tenant-id":s,"x-inkeep-project-id":a,"x-inkeep-graph-id":t,Authorization:"Bearer ".concat(p),...u},introMessage:"Hi! How can I help?"}})})})}a(49008);var eV=a(36886),eH=a(34237),eW=a(96776),eJ=a(95118),eq=a(29583),e$=a(35613),eG=a(88418),eZ=a(30958),eK=a(86312);let eX=eq.object({headers:eq.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")}),eY=function(e){let{customHeaders:t,setCustomHeaders:a}=e,s=Object.keys(t).length||0,[n,l]=(0,i.useState)(!1),o=(0,eJ.mN)({defaultValues:{headers:JSON.stringify(t,null,2)},resolver:(0,eV.u)(eX)}),{isSubmitting:c}=o.formState,u=async e=>{let t,{headers:r}=e;if(r)try{t=JSON.parse(r)}catch(e){console.error("Error parsing JSON:",e),o.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."),l(!1)};return(0,r.jsxs)(eZ.lG,{open:n,onOpenChange:l,children:[(0,r.jsx)(eZ.zM,{asChild:!0,children:(0,r.jsxs)(eT.$,{variant:"ghost",size:"sm",className:"h-6",children:[s>0?(0,r.jsx)(eH.A,{className:"w-4 h-4"}):(0,r.jsx)(eW.A,{className:"w-4 h-4"}),"Custom Headers",s>0&&(0,r.jsx)(I.E,{variant:"code",children:s})]})}),(0,r.jsxs)(eZ.Cf,{className:"!max-w-2xl",children:[(0,r.jsxs)(eZ.c7,{children:[(0,r.jsx)(eZ.L3,{children:"Custom Headers"}),(0,r.jsx)(eZ.rr,{children:"Add custom headers to the chat API requests."})]}),(0,r.jsx)(eK.lV,{...o,children:(0,r.jsxs)("form",{onSubmit:o.handleSubmit(u),className:"space-y-8",children:[(0,r.jsx)(e$.u,{control:o.control,name:"headers",label:"Custom headers",children:e=>(0,r.jsx)(eG.i,{value:e.value||"",onChange:e.onChange,placeholder:"Enter headers...",...e})}),(0,r.jsxs)("div",{className:"flex justify-end gap-2",children:[s>0&&(0,r.jsx)(eT.$,{type:"button",variant:"outline",onClick:()=>{o.reset({headers:"{}"}),a({}),l(!1),d.oR.success("Custom headers removed.")},children:"Remove headers"}),(0,r.jsx)(eT.$,{type:"submit",disabled:c,children:"Apply"})]})]})})]})]})},eQ=e=>{let{graphId:t,projectId:a,tenantId:s,closeSidePane:n,setShowPlayground:o}=e,[d,c]=(0,i.useState)((0,l.Ak)()),[u,m]=(0,i.useState)({}),[p,h]=(0,i.useState)(!1),{chatActivities:x,isPolling:g,error:f,startPolling:v,stopPolling:j,retryConnection:b,refreshOnce:y}=(e=>{var t;let{conversationId:a,pollingInterval:r=1e3}=e,[s,n]=(0,i.useState)(null),[l,o]=(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&&(n(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"),o(!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||(o(!0),g().catch(()=>{}),p.current=setInterval(()=>{g().catch(()=>{})},r))},[g,r]),v=(0,i.useCallback)(()=>{o(!1),p.current&&(clearInterval(p.current),p.current=null),x.current&&(x.current.abort(),x.current=null)},[]),j=(0,i.useCallback)(()=>{c(null),v(),f()},[f,v]),b=(0,i.useCallback)(async()=>{var e,t;let a=(null==s||null==(e=s.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==s||null==(t=s.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&&(n(null),m(0),c(null),p.current&&(clearInterval(p.current),p.current=null),x.current&&(x.current.abort(),x.current=null),o(!1),y.current=a)}),{chatActivities:s,isPolling:l,error:d,startPolling:f,stopPolling:v,retryConnection:j,refreshOnce:b}})({conversationId:d});return(0,r.jsxs)("div",{className:"bg-background z-10 flex flex-col border-l ".concat(p?"w-full":"w-1/3 min-w-96"),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.jsx)(eY,{customHeaders:u,setCustomHeaders:m}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsxs)(eT.$,{variant:"ghost",size:"sm",className:"h-6",onClick:()=>{h(!p),p||n()},children:[(0,r.jsx)(eM.A,{className:"h-4 w-4"}),p?"Hide debug":"Debug"]}),(0,r.jsx)(eT.$,{variant:"ghost",size:"sm",className:"h-6",onClick:()=>o(!1),children:(0,r.jsx)(ek.A,{className:"h-4 w-4"})})]})]}),(0,r.jsx)("div",{className:"flex-1 min-h-0 w-full",children:(0,r.jsxs)(eD.HK,{direction:"horizontal",children:[(0,r.jsx)(eD.wV,{order:1,children:(0,r.jsx)(e_,{conversationId:d,setConversationId:c,startPolling:v,stopPolling:j,graphId:t,projectId:a,tenantId:s,customHeaders:u},JSON.stringify(u))}),p&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(eD.WM,{}),(0,r.jsx)(eR.B,{isPolling:g,conversation:x,enableAutoScroll:!0,error:f,retryConnection:b,refreshOnce:y,showConversationTracesLink:!0,conversationId:d})]})]})})]})};var e0=a(57713),e1=a(20833),e2=a(11729);let e4={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)(e2.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)(eT.$,{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)(ek.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)(eT.$,{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)(e1.A,{className:"h-4 w-4"}),(0,r.jsx)("span",{className:"sr-only",children:"Back"})]})}};var e5=a(82161),e3=a(69962);let e6=(0,i.forwardRef)((e,t)=>(0,r.jsxs)(e3.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"})]}));e6.displayName="DashedSplineIcon";var e8=a(84661),e7=a(92752);function e9(e){let{id:t,label:a,onCheckedChange:s,checked:n}=e;return(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)(e8.S,{id:t,onCheckedChange:e=>s(t,e),checked:n}),(0,r.jsx)("div",{className:"grid gap-2",children:(0,r.jsx)(e7.J,{htmlFor:t,children:a})})]})}function te(e){let{icon:t,title:a,description:s,options:n,onCheckedChange:l,checkedValues:o}=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:s})]}),n.map(e=>(0,r.jsx)(e9,{id:e.id,label:e.label,onCheckedChange:l,checked:(null==o?void 0:o[e.id])||!1},e.id))]})}let tt=function(e){var t,a;let{selectedEdge:n}=e,{updateEdgeData:l,setEdges:o}=(0,s.VH)(),i=(0,s.j7)(n.source),d=(0,s.j7)(n.target),{markUnsaved:c}=en(),u=n.source===n.target,m=(e,t)=>{var a,r;let s;if(u){let r={};"transferSourceToTarget"===e?(r.transferSourceToTarget=t,r.transferTargetToSource=t):"delegateSourceToTarget"===e&&(r.delegateSourceToTarget=t,r.delegateTargetToSource=t),s={...null==(a=n.data)?void 0:a.relationships,...r}}else s={...null==(r=n.data)?void 0:r.relationships,[e]:t};let i=s.transferSourceToTarget||s.transferTargetToSource||s.delegateSourceToTarget||s.delegateTargetToSource;c(),i?l(n.id,{relationships:s}):o(e=>e.filter(e=>e.id!==n.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)(te,{icon:(0,r.jsx)(e5.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=n.data)?void 0:t.relationships}),(0,r.jsx)("hr",{}),(0,r.jsx)(te,{icon:(0,r.jsx)(e6,{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=n.data)?void 0:a.relationships})]})};function ta(e){let{heading:t,Icon:a,className:s}=e;return(0,r.jsxs)("div",{className:(0,z.cn)("text-sm font-medium flex items-center gap-2",s),children:[a&&(0,r.jsx)(a,{className:"size-4 text-muted-foreground"}),t]})}var tr=a(47140),ts=a(26273),tn=a(77946),tl=a(79741),to=a(30712),ti=a(27820),td=a(51952);function tc(e){let{isExplicit:t=!1,inheritedFrom:a,tooltip:s,size:n="sm",position:l="inline"}=e;return t?(0,r.jsx)(R.B,{children:(0,r.jsxs)(R.Tooltip,{children:[(0,r.jsx)(R.TooltipTrigger,{asChild:!0,children:(0,r.jsxs)(I.E,{variant:"outline",className:"\n ".concat("sm"===n?"h-5 px-1.5 text-xs":"h-6 px-2 text-sm","\n ").concat("absolute"===l?"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)(ti.A,{className:"sm"===n?"h-2.5 w-2.5":"h-3 w-3"}),"md"===n&&"Explicit"]})}),(0,r.jsx)(R.TooltipContent,{children:(0,r.jsx)("p",{children:s||"This value is explicitly set at this level"})})]})}):a?(0,r.jsx)(R.B,{children:(0,r.jsxs)(R.Tooltip,{children:[(0,r.jsx)(R.TooltipTrigger,{asChild:!0,children:(0,r.jsxs)(I.E,{variant:"outline",className:"\n ".concat("sm"===n?"h-5 px-1.5 text-xs":"h-6 px-2 text-sm","\n ").concat("absolute"===l?"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)(td.A,{className:"sm"===n?"h-2.5 w-2.5":"h-3 w-3"}),"md"===n&&"From ".concat(a)]})}),(0,r.jsx)(R.TooltipContent,{children:(0,r.jsx)("p",{children:s||"This value is inherited from ".concat(a," level")})})]})}):(0,r.jsx)(R.B,{children:(0,r.jsxs)(R.Tooltip,{children:[(0,r.jsx)(R.TooltipTrigger,{asChild:!0,children:(0,r.jsxs)(I.E,{variant:"outline",className:"\n ".concat("sm"===n?"h-5 px-1.5 text-xs":"h-6 px-2 text-sm","\n ").concat("absolute"===l?"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)(tr.A,{className:"sm"===n?"h-2.5 w-2.5":"h-3 w-3"}),"md"===n&&"Default"]})}),(0,r.jsx)(R.TooltipContent,{children:(0,r.jsx)("p",{children:s||"Using system default value"})})]})})}function tu(e,t,a,r){let s=null!=t&&""!==t,n=null!=a&&""!==a,l=null!=r&&""!==r;if("project"!==e){if(s&&n&&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&&s&&!n&&l&&t===r)return{isExplicit:!1,inheritedFrom:"Project",tooltip:"This model is inherited from the project level"}}if(s)return{isExplicit:!0,tooltip:"This model is explicitly configured at the ".concat(e," level")};switch(e){case"agent":if(n)return{isExplicit:!1,inheritedFrom:"Graph",tooltip:"Will inherit from the graph level"};if(l)return{isExplicit:!1,inheritedFrom:"Project",tooltip:"Will inherit from the project level"};break;case"graph":if(n)return{isExplicit:!1,inheritedFrom:"Project",tooltip:"Will inherit from the project level"}}return{isExplicit:!1,tooltip:"Using system default configuration"}}function tm(e,t,a,r){let s=null!=a,n=null!=r;if(s&&n&&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(s)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&&n)return{isExplicit:!1,inheritedFrom:"Project",tooltip:"Will inherit transfer limit from the project level"}}else if("stepCountIs"===t&&"agent"===e&&n)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 tp=a(34186),th=a(1095),tx=a(86772),tg=a(47757);function tf(e){let{nameValue:t,idValue:a,onIdChange:r,isEditing:s=!1}=e,n=(0,i.useRef)(!1),l=(0,i.useRef)(""),o=(0,i.useRef)(r),d=(0,i.useRef)(a);(0,i.useEffect)(()=>{o.current=r,d.current=a},[r,a]),(0,i.useEffect)(()=>{s&&(n.current=!1,l.current="")},[s]),(0,i.useEffect)(()=>{s||(a?a!==l.current&&(n.current=!0):(n.current=!1,l.current=""))},[a,s]),(0,i.useEffect)(()=>{if(!s&&t&&!n.current){let e=(0,tg.$)(t);e!==d.current&&(l.current=e,o.current(e))}},[t,s])}let tv=(0,ex.createServerReference)("60921c9e3dda64da7ba511c87216a332aefbbbc65f",ex.callServer,void 0,ex.findSourceMapURL,"fetchProjectAction");function tj(){let{tenantId:e,projectId:t}=(0,o.useParams)(),[a,r]=(0,i.useState)(null),[s,n]=(0,i.useState)(!0),[l,d]=(0,i.useState)(null);return(0,i.useEffect)(()=>{!async function(){if(!e||!t)return n(!1);try{n(!0),d(null);let a=await tv(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{n(!1)}}()},[e,t]),{project:a,loading:s,error:l}}function tb(e){let{defaultOpen:t=!1,title:a,children:s}=e;return(0,r.jsxs)(eS.Nt,{defaultOpen:t,className:"border rounded-md bg-muted/30 dark:bg-muted/20",children:[(0,r.jsx)(eS.R6,{asChild:!0,children:(0,r.jsxs)(eT.$,{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)(eN.A,{className:"h-3.5 w-3.5 transition-transform duration-200 group-data-[state=open]:rotate-90"}),a]})}),(0,r.jsx)(eS.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:s})]})}var ty=a(60049),tN=a(96412),tk=a(29848),tC=a(89077),tT=a(53245),tw=a(9242),tS=a(91905),tE=a(3121);function tA(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(r>=a||!e||"object"!=typeof e)return[];let s=[];if(e.anyOf||e.oneOf||e.allOf){for(let n of e.anyOf||e.oneOf||e.allOf)n&&"object"==typeof n&&s.push(...tA(n,t,a,r));return s}if("object"===e.type&&e.properties)for(let[n,l]of Object.entries(e.properties)){let e=t?"".concat(t,".").concat(n):n;s.push(e),"object"==typeof l&&null!==l&&s.push(...tA(l,e,a,r+1))}if("array"===e.type&&e.items){let n=t?"".concat(t,"[*]"):"[*]";s.push(n),e.items&&"object"==typeof e.items&&s.push(...tA(e.items,n,a,r+1))}return s}let tI=tC.NZ.mark({class:"cm-template-variable"}),tO=tC.Z9.fromClass(class{update(e){e.docChanged&&(this.decorations=this.buildDecorations(e.view))}buildDecorations(e){let t=[],a=/\{\{([^}]+)}}/g;for(let r=0;r<e.state.doc.lines;r++){let s,n=e.state.doc.line(r+1);for(;null!==(s=a.exec(n.text));){let e=n.from+s.index,a=n.from+s.index+s[0].length;t.push(tI.range(e,a))}}return tC.NZ.set(t)}constructor(e){this.decorations=this.buildDecorations(e)}},{decorations:e=>e.decorations}),tz=tC.Lz.theme({"& .cm-template-variable":{color:"#e67e22",fontWeight:"bold"},"&.cm-dark .cm-template-variable":{color:"#f39c12"}}),tL=new Set(["$time","$date","$timestamp","$now"]);function tU(e){if(!e.trim())return{};try{return JSON.parse(e)}catch(e){}return{}}let tP=e=>{let{className:t,value:a,onChange:s,placeholder:n,disabled:l,readOnly:o,ref:d,...c}=e,u=(0,i.useRef)(null),{resolvedTheme:m}=(0,tE.D)();(0,i.useEffect)(()=>{u.current=new tC.Lz},[]),(0,i.useImperativeHandle)(d,()=>({insertTemplateVariable(){var e;let t=null==(e=u.current)?void 0:e.view;if(!t)return;let{doc:a,selection:r}=t.state,s=r.main.empty?r.main.head:a.line(a.lines).to;t.dispatch({changes:{from:s,to:s,insert:"{}"},selection:{anchor:s+1},scrollIntoView:!0}),(0,tk.rB)(t)}}));let p=el(e=>e.metadata.contextConfig),h=(0,i.useMemo)(()=>{let e=tU(p.contextVariables),t=function(e){var t;let a=[];if(null==(t=e.requestContextSchema)?void 0:t.properties)for(let t of tA(e.requestContextSchema))a.push("requestContext.".concat(t));if(e.contextVariables){for(let[t,r]of Object.entries(e.contextVariables))if(a.push(t),r.responseSchema)for(let e of tA(r.responseSchema))a.push("".concat(t,".").concat(e))}return[...new Set(a)].sort()}({requestContextSchema:tU(p.requestContextSchema),contextVariables:e});return[(0,tk.yU)({override:[e=>{let{state:a,pos:r}=e,s=a.doc.lineAt(r),n=r-s.from,l=s.text.slice(0,n).match(/\{([^}]*)$/);if(!l)return null;let o=l[1].toLowerCase(),i=t.filter(e=>e.toLowerCase().includes(o)),d=s.text[n];return{from:r-l[1].length,to:r,options:["$env.",...tL,...i].map(e=>({label:e,apply:"{".concat(e).concat("}"===d?"}":"}}")}))}}],compareCompletions:(e,t)=>-1}),tO,tz,(0,tT.bu)(e=>{let a=[],r=new Set(t),s=/\{\{([^}]+)}}/g;for(let t=0;t<e.state.doc.lines;t++){let n,l=e.state.doc.line(t+1);for(;null!==(n=s.exec(l.text));){let e=l.from+n.index,t=l.from+n.index+n[0].length,s=n[1];r.has(s)||tL.has(s)||s.startsWith("$env.")||s.includes("[")||s.startsWith("length(")||s.includes("[?")||s.includes("[*]")||a.push({from:e,to:t,severity:"error",message:"Unknown variable: ".concat(s)})}}return a}),tC.Lz.lineWrapping]},[p]);return(0,r.jsx)(tS.Ay,{ref:u,...c,value:a||"",onChange:s,extensions:h,theme:"dark"===m?tw.nQ:tw.Bs,placeholder:n,editable:!l&&!o,basicSetup:{lineNumbers:!1,foldGutter:!1,highlightActiveLine:!1},"data-disabled":l?"":void 0,"data-read-only":o?"":void 0,className:(0,z.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",t)})},tM=e=>{let{tooltipClassName:t,...a}=e,s=(0,i.useRef)(null),n="Add variables";return(0,r.jsxs)("div",{className:"h-full relative",children:[(0,r.jsx)(tP,{ref:s,...a}),(0,r.jsxs)(R.Tooltip,{children:[(0,r.jsx)(R.TooltipTrigger,{asChild:!0,children:(0,r.jsxs)(eT.$,{variant:"ghost",size:"icon",className:(0,z.cn)("absolute bottom-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",t),type:"button",onClick:()=>{s.current.insertTemplateVariable()},children:[(0,r.jsx)(tN.A,{className:"h-4 w-4 text-muted-foreground"}),(0,r.jsx)("span",{className:"sr-only",children:n})]})}),(0,r.jsx)(R.TooltipContent,{children:n})]})]})};function tR(e){let{label:t,isRequired:a=!1,...s}=e;return(0,r.jsx)(ty.Z,{name:s.id||"expandable-textarea",label:t,isRequired:a,compactView:(0,r.jsx)(tM,{...s,tooltipClassName:"right-10"}),expandedView:(0,r.jsx)(tM,{...s,autoFocus:!0,className:"[&>.cm-editor]:h-full",tooltipClassName:"right-2.5"})})}let tD=(0,i.forwardRef)((e,t)=>{let{id:a,name:s,label:n,value:l,onChange:o,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)(e7.J,{htmlFor:a,className:(0,z.cn)(d?"text-red-600":"","gap-1"),children:[n,h&&(0,r.jsx)("span",{className:"text-red-500",children:"*"}),m&&(0,r.jsxs)(R.Tooltip,{children:[(0,r.jsx)(R.TooltipTrigger,{children:(0,r.jsx)(tr.A,{className:"w-3 h-3 text-muted-foreground ml-1"})}),(0,r.jsx)(R.TooltipContent,{className:"break-words",children:m})]})]}),(0,r.jsx)(tp.p,{ref:t,id:a,name:s,type:p,value:l,onChange:o,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})]})});tD.displayName="InputField";let tB=(0,i.forwardRef)((e,t)=>{let{id:a,name:s,label:n,value:l,onChange:o,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)(e7.J,{htmlFor:a,className:d?"text-red-600":"",children:n}),(0,r.jsx)(tx.T,{ref:t,id:a,name:s,value:l,onChange:o,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})]})});tB.displayName="TextareaField";var tF=a(52353);function t_(e){let{title:t,tooltip:a}=e;return(0,r.jsxs)("h3",{className:"text-sm font-semibold flex items-center",children:[t,a&&(0,r.jsxs)(R.Tooltip,{children:[(0,r.jsx)(R.TooltipTrigger,{asChild:!0,children:(0,r.jsx)(tr.A,{className:"w-3 h-3 text-muted-foreground ml-1"})}),(0,r.jsx)(R.TooltipContent,{children:a})]})," "]})}function tV(e){let{description:t}=e;return(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:t})}function tH(e){let{title:t,description:a,titleTooltip:s}=e;return(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)(t_,{title:t,tooltip:s}),(0,r.jsx)(tV,{description:a})]})}function tW(e){let{contextConfig:t,updateMetadata:a}=e,{id:s,name:n,description:l,contextVariables:o,requestContextSchema:i}=t,d=(e,r)=>{a("contextConfig",{...t,[e]:r})};return(0,r.jsxs)("div",{className:"space-y-8",children:[(0,r.jsx)(tH,{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)(e7.J,{htmlFor:"id",children:"Id"}),(0,r.jsx)(tp.p,{id:"id",value:s||"",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)(e7.J,{htmlFor:"name",children:"Name"}),(0,r.jsx)(tp.p,{id:"name",value:n,onChange:e=>d("name",e.target.value),placeholder:"My context"})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(e7.J,{htmlFor:"description",children:"Description"}),(0,r.jsx)(tx.T,{id:"description",value:l,onChange:e=>d("description",e.target.value),placeholder:"Context description...",className:"max-h-96"})]}),(0,r.jsx)(ts.y,{name:"contextVariables",label:"Context variables (JSON)",value:o,onChange:e=>d("contextVariables",e),placeholder:"{}",className:""}),(0,r.jsx)(ts.y,{name:"requestContextSchema",label:"Request context schema (JSON)",value:i,onChange:e=>d("requestContextSchema",e),placeholder:"{}",className:""})]})]})}let tJ=()=>(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"]})]}),tq=function(){var e,t,a,s,n,l,d,c,u,m,p,h,x,g,f,v,j,b,y,N,k,C,T,w,S,E,A,I,O,z;let L=(0,o.useParams)(),U=el(e=>e.metadata),{graphId:P,tenantId:M,projectId:D}=L,{id:B,name:F,description:_,contextConfig:V,models:H,stopWhen:W,graphPrompt:J,statusUpdates:q}=U,{INKEEP_AGENTS_RUN_API_URL:$}=(0,eF.y)(),{project:G}=tj(),{markUnsaved:Z,setMetadata:K}=en(),X=(0,i.useCallback)(function(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];K(...t),Z()},[K,Z]);return tf({nameValue:F,idValue:B,onIdChange:(0,i.useCallback)(e=>{X("id",e)},[X]),isEditing:!!P}),(0,r.jsxs)("div",{className:"space-y-8",children:[P&&(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)(R.Tooltip,{children:[(0,r.jsx)(R.TooltipTrigger,{asChild:!0,children:(0,r.jsx)(tr.A,{className:"w-3 h-3 text-muted-foreground"})}),(0,r.jsx)(R.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)(tl.r,{code:"".concat($,"/api/chat")}),(0,r.jsx)(to.G,{href:"/".concat(M,"/projects/").concat(D,"/api-keys"),children:"Create API key"})]}),(0,r.jsx)(tD,{id:"name",name:"name",label:"Name",value:F,onChange:e=>X("name",e.target.value),placeholder:"My graph",isRequired:!0}),(0,r.jsx)(tD,{id:"id",name:"id",label:"Id",value:B||"",onChange:e=>X("id",e.target.value),disabled:!!P,placeholder:"my-graph",description:P?void 0:"Choose a unique identifier for this graph. Using an existing id will replace that graph.",isRequired:!0}),(0,r.jsx)(tB,{id:"description",name:"description",label:"Description",value:_,onChange:e=>X("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)(tR,{id:"graph-prompt",label:"Graph prompt",value:J||"",onChange:e=>X("graphPrompt",e),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)(th.Separator,{}),(0,r.jsxs)("div",{className:"space-y-8",children:[(0,r.jsx)(tH,{title:"Default models",description:"Set default models that will be inherited by agents that don't have their own models configured.",titleTooltip:(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{children:"How model inheritance works:"}),(0,r.jsx)(tn.O,{})]})}),(0,r.jsxs)("div",{className:"relative space-y-2",children:[(0,r.jsx)(tF.B,{value:(null==H||null==(e=H.base)?void 0:e.model)||"",inheritedValue:null==G||null==(a=G.models)||null==(t=a.base)?void 0:t.model,onValueChange:e=>{X("models",{...H||{},base:e?{...(null==H?void 0:H.base)||{},model:e}:void 0})},label:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:["Base model",(0,r.jsx)(tc,{...tu("graph",null==H||null==(s=H.base)?void 0:s.model,null==G||null==(l=G.models)||null==(n=l.base)?void 0:n.model),size:"sm"})]})}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:"Primary model for general agent responses"})]}),(0,r.jsxs)(tb,{defaultOpen:!!(null==H?void 0:H.structuredOutput)||!!(null==H?void 0:H.summarizer),title:"Advanced model options",children:[(null==H||null==(d=H.base)?void 0:d.model)&&(0,r.jsx)(ts.y,{name:"base-provider-options",label:"Base model provider options",onChange:e=>{var t;X("models",{...H||{},base:{model:(null==(t=H.base)?void 0:t.model)||"",providerOptions:e}})},value:H.base.providerOptions||"",placeholder:'{\n "temperature": 0.7,\n "maxTokens": 2048\n}'}),(0,r.jsxs)("div",{className:"relative space-y-2",children:[(0,r.jsx)(tF.B,{value:(null==H||null==(c=H.structuredOutput)?void 0:c.model)||"",inheritedValue:(null==G||null==(m=G.models)||null==(u=m.structuredOutput)?void 0:u.model)||(null==H||null==(p=H.base)?void 0:p.model)||(null==G||null==(x=G.models)||null==(h=x.base)?void 0:h.model),onValueChange:e=>{X("models",{...H||{},structuredOutput:e?{...(null==H?void 0:H.structuredOutput)||{},model:e}:void 0})},label:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:["Structured output model",(0,r.jsx)(tc,{...tu("graph",null==H||null==(g=H.structuredOutput)?void 0:g.model,null==G||null==(v=G.models)||null==(f=v.structuredOutput)?void 0:f.model),size:"sm"})]})}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:"Model for structured outputs and components (defaults to base model)"})]}),(null==H||null==(j=H.structuredOutput)?void 0:j.model)&&(0,r.jsx)(ts.y,{name:"structured-provider-options",label:"Structured output model provider options",onChange:e=>{var t;X("models",{...H||{},structuredOutput:{model:(null==(t=H.structuredOutput)?void 0:t.model)||"",providerOptions:e}})},value:H.structuredOutput.providerOptions||"",placeholder:'{\n "temperature": 0.1,\n "maxTokens": 1024\n}'}),(0,r.jsxs)("div",{className:"relative space-y-2",children:[(0,r.jsx)(tF.B,{value:(null==H||null==(b=H.summarizer)?void 0:b.model)||"",inheritedValue:(null==G||null==(N=G.models)||null==(y=N.summarizer)?void 0:y.model)||(null==H||null==(k=H.base)?void 0:k.model)||(null==G||null==(T=G.models)||null==(C=T.base)?void 0:C.model),onValueChange:e=>{X("models",{...H||{},summarizer:e?{...(null==H?void 0:H.summarizer)||{},model:e}:void 0})},label:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:["Summarizer model",(0,r.jsx)(tc,{...tu("graph",null==H||null==(w=H.summarizer)?void 0:w.model,null==G||null==(E=G.models)||null==(S=E.summarizer)?void 0:S.model),size:"sm"})]})}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:"Model for summarization tasks (defaults to base model)"})]}),(null==H||null==(A=H.summarizer)?void 0:A.model)&&(0,r.jsx)(ts.y,{name:"summarizer-provider-options",label:"Summarizer model provider options",onChange:e=>{var t;X("models",{...H||{},summarizer:{model:(null==(t=H.summarizer)?void 0:t.model)||"",providerOptions:e}})},value:H.summarizer.providerOptions||"",placeholder:'{\n "temperature": 0.3,\n "maxTokens": 1024\n}'})]})]}),(0,r.jsx)(th.Separator,{}),(0,r.jsxs)("div",{className:"space-y-8",children:[(0,r.jsx)(tH,{title:"Execution limits",description:"Configure graph-level execution limits for transfers between agents.",titleTooltip:(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{children:"How execution limit inheritance works:"}),(0,r.jsx)(tJ,{})]})}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(e7.J,{htmlFor:"transfer-count",children:"Max transfers"}),(0,r.jsx)(tc,{...tm("graph","transferCountIs",null==W?void 0:W.transferCountIs,null==G||null==(I=G.stopWhen)?void 0:I.transferCountIs),size:"sm"})]}),(0,r.jsx)(tp.p,{id:"transfer-count",type:"number",min:"1",max:"100",value:(null==W?void 0:W.transferCountIs)||"",onChange:e=>{let t=e.target.value?parseInt(e.target.value,10):void 0;X("stopWhen",{...W||{},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)(th.Separator,{}),(0,r.jsxs)("div",{className:"space-y-8",children:[(0,r.jsx)(tH,{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)(e8.S,{id:"status-updates-enabled",checked:null==(O=null==q?void 0:q.enabled)||O,onCheckedChange:e=>{X("statusUpdates",{...q||{},enabled:!0===e})}}),(0,r.jsx)(e7.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==(z=null==q?void 0:q.enabled)||z)&&(0,r.jsxs)(tb,{title:"Status updates configuration",children:[(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(e7.J,{htmlFor:"status-updates-prompt",children:"Status updates prompt"}),(0,r.jsx)(tx.T,{id:"status-updates-prompt",value:(null==q?void 0:q.prompt)||"",onChange:e=>{X("statusUpdates",{...q||{},prompt:e.target.value})},placeholder:"Generate a status update describing the current progress...",className:"max-h-32 bg-background"}),(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)(e7.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)(e8.S,{id:"event-based-updates",className:"bg-background",checked:!!(null==q?void 0:q.numEvents),onCheckedChange:e=>{if(e)X("statusUpdates",{...q||{},numEvents:(null==q?void 0:q.numEvents)||10});else{let e={...q};delete e.numEvents,X("statusUpdates",e)}}}),(0,r.jsx)(e7.J,{htmlFor:"event-based-updates",children:"Event-based updates"})]}),(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)(e8.S,{id:"time-based-updates",className:"bg-background",checked:!!(null==q?void 0:q.timeInSeconds),onCheckedChange:e=>{if(e)X("statusUpdates",{...q||{},timeInSeconds:(null==q?void 0:q.timeInSeconds)||30});else{let e={...q};delete e.timeInSeconds,X("statusUpdates",e)}}}),(0,r.jsx)(e7.J,{htmlFor:"time-based-updates",children:"Time-based updates"})]})]})]}),(null==q?void 0:q.numEvents)&&(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(e7.J,{htmlFor:"num-events",children:"Number of events"}),(0,r.jsx)(tp.p,{id:"num-events",type:"number",min:"1",max:"100",value:q.numEvents||"",onChange:e=>{let t=e.target.value?parseInt(e.target.value,10):void 0;X("statusUpdates",{...q||{},numEvents:t})},placeholder:"10",className:"bg-background"}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:"Number of events/steps between status updates (default: 10)"})]}),(null==q?void 0:q.timeInSeconds)&&(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(e7.J,{htmlFor:"time-in-seconds",children:"Time interval (seconds)"}),(0,r.jsx)(tp.p,{id:"time-in-seconds",type:"number",min:"1",max:"600",value:q.timeInSeconds||"",onChange:e=>{let t=e.target.value?parseInt(e.target.value,10):void 0;X("statusUpdates",{...q||{},timeInSeconds:t})},placeholder:"30",className:"bg-background"}),(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)(ts.y,{name:"status-components",label:"Status components configuration",onChange:e=>{X("statusUpdates",{...q||{},statusComponents:e})},value:(null==q?void 0:q.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)(th.Separator,{}),(0,r.jsx)(tW,{contextConfig:V,updateMetadata:X})]})};function t$(e){let{selectedNodeId:t,errorHelpers:a}=e,{updateNodeData:r}=(0,s.VH)(),{markUnsaved:n}=en(),l=(0,i.useRef)({}),o=(0,i.useCallback)((e,t)=>{t?l.current[e]=t:delete l.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}),n()},[t,r,n]),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,...s]=r,n={...(null==a?void 0:a[e])||{}},l=n;for(let e=0;e<s.length-1;e++){let t=s[e];t in l&&null!==l[t]&&void 0!==l[t]||(l[t]={}),l=l[t]}let o=s[s.length-1];if(null==t||""===t){if(delete l[o],0===Object.keys(n).length)return void c(e,null)}else l[o]=t;c(e,n)}},[c]);return{updateField:c,updatePath:m,updateNestedPath:p,handleInputChange:u,getFieldError:d,setFieldRef:o,markUnsaved:n}}var tG=a(44001),tZ=a(46205),tK=a(66041),tX=a(38678),tY=a(85276),tQ=a.n(tY);function t0(e){let{message:t,actionText:a,actionHref:s}=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:s&&(0,r.jsxs)(tQ(),{target:"_blank",rel:"noopener noreferrer",href:s,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)(tX.A,{className:"w-4 h-4"})]})})]})}function t1(e){let{selectedComponents:t,handleToggle:a,availableComponents:s,emptyStateMessage:n,emptyStateActionText:l,emptyStateActionHref:o,placeholder:d="Select components..."}=e,[c,u]=(0,i.useState)(!1);return(0,r.jsx)("div",{className:"flex w-full",children:(0,r.jsxs)(tK.AM,{open:c,onOpenChange:u,children:[(0,r.jsx)(tK.Wv,{asChild:!0,children:(0,r.jsxs)(eT.$,{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)(tG.A,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,r.jsx)(tK.hl,{className:"w-[var(--radix-popover-trigger-width)] p-0",children:(0,r.jsxs)(tZ.uB,{children:[(0,r.jsx)(tZ.G7,{placeholder:"Search components..."}),(0,r.jsx)(tZ.xL,{children:(0,r.jsx)(t0,{message:n||"No components found.",actionText:l,actionHref:o})}),(0,r.jsx)(tZ.oI,{className:"max-h-64",children:(0,r.jsx)(tZ.L$,{children:s.map(e=>{let{id:s,name:n,description:l}=e;return(0,r.jsxs)(tZ.h_,{onSelect:()=>a(s),className:"flex items-start gap-3 p-3 group cursor-pointer",children:[(0,r.jsx)(e8.S,{checked:t.includes(s),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:n})}),l&&(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:l})]})]},s)})})})]})})]})})}function t2(e){let{label:t,count:a}=e;return(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(e7.J,{children:t}),(0,r.jsx)(I.E,{variant:"code",className:"border-none px-2 text-[10px] text-muted-foreground",children:a})]})}function t4(e){let{selectedComponents:t,componentLookup:a,handleToggle:s}=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)(I.E,{variant:"code",className:"text-xs",children:[(null==t?void 0:t.name)||e,(0,r.jsx)(eT.$,{variant:"ghost",size:"icon-sm",className:" size-3 ml-1",onClick:()=>s(e),children:(0,r.jsx)(ek.A,{className:"size-3"})})]},e)})})})}function t5(e){let{label:t,componentLookup:a,selectedComponents:s,onSelectionChange:n,emptyStateMessage:l,emptyStateActionText:o,emptyStateActionHref:i,placeholder:d="Select components..."}=e,c=e=>{n(s.includes(e)?s.filter(t=>t!==e):[...s,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)(t2,{label:t,count:s.length}),s.length>0&&(0,r.jsx)(t4,{selectedComponents:s,componentLookup:a,handleToggle:c})]}),(0,r.jsx)(t1,{selectedComponents:s,handleToggle:c,availableComponents:Object.values(a),emptyStateMessage:l,emptyStateActionText:o,emptyStateActionHref:i,placeholder:d})]})}function t3(e){var t,a,s,n,l,o,i,d,c,u,m,p,h,x,g,f,v,j,b,y,N,k,C,T,w,S,E,A,I,O;let{models:z,updatePath:L,projectModels:U,graphModels:P}=e,M=(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)(tH,{title:"Models",description:"Configure agent-level models.",titleTooltip:(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{children:"How model inheritance works:"}),(0,r.jsx)(tn.O,{})]})}),(0,r.jsxs)("div",{className:"relative space-y-2",children:[(0,r.jsx)(tF.B,{value:(null==z||null==(t=z.base)?void 0:t.model)||"",onValueChange:e=>{L("models.base.model",e||void 0)},inheritedValue:(null==P||null==(a=P.base)?void 0:a.model)||(null==U||null==(s=U.base)?void 0:s.model),label:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:["Base model",(0,r.jsx)(tc,{...tu("agent",null==z||null==(n=z.base)?void 0:n.model,null==P||null==(l=P.base)?void 0:l.model,null==U||null==(o=U.base)?void 0:o.model),size:"sm"})]})}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:"Primary model for general agent responses"})]}),(0,r.jsxs)(tb,{defaultOpen:!!M,title:"Advanced Model Options",children:[(null==z||null==(i=z.base)?void 0:i.model)&&(0,r.jsx)(ts.y,{name:"base-provider-options",label:"Base model provider options",onChange:e=>{L("models.base.providerOptions",e)},value:(null==z||null==(d=z.base)?void 0:d.providerOptions)||"",placeholder:'{\n "temperature": 0.7,\n "maxTokens": 2048\n}'}),(0,r.jsxs)("div",{className:"relative space-y-2",children:[(0,r.jsx)(tF.B,{value:(null==z||null==(c=z.structuredOutput)?void 0:c.model)||"",onValueChange:e=>{L("models.structuredOutput.model",e||void 0)},inheritedValue:(null==P||null==(u=P.structuredOutput)?void 0:u.model)||(null==U||null==(m=U.structuredOutput)?void 0:m.model)||(null==z||null==(p=z.base)?void 0:p.model)||(null==P||null==(h=P.base)?void 0:h.model)||(null==U||null==(x=U.base)?void 0:x.model),label:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:["Structured output model",(0,r.jsx)(tc,{...tu("agent",null==z||null==(g=z.structuredOutput)?void 0:g.model,null==P||null==(f=P.structuredOutput)?void 0:f.model,null==U||null==(v=U.structuredOutput)?void 0:v.model),size:"sm"})]})}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:"The model used for structured output and components (defaults to base model)"})]}),(null==z||null==(j=z.structuredOutput)?void 0:j.model)&&(0,r.jsx)(ts.y,{name:"structured-provider-options",label:"Structured output model provider options",onChange:e=>{L("models.structuredOutput.providerOptions",e)},value:(null==z||null==(b=z.structuredOutput)?void 0:b.providerOptions)||"",placeholder:'{\n "temperature": 0.1,\n "maxTokens": 1024\n}'}),(0,r.jsxs)("div",{className:"relative space-y-2",children:[(0,r.jsx)(tF.B,{value:(null==z||null==(y=z.summarizer)?void 0:y.model)||"",onValueChange:e=>{L("models.summarizer.model",e||void 0)},inheritedValue:(null==P||null==(N=P.summarizer)?void 0:N.model)||(null==U||null==(k=U.summarizer)?void 0:k.model)||(null==z||null==(C=z.base)?void 0:C.model)||(null==P||null==(T=P.base)?void 0:T.model)||(null==U||null==(w=U.base)?void 0:w.model),label:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:["Summarizer model",(0,r.jsx)(tc,{...tu("agent",null==z||null==(S=z.summarizer)?void 0:S.model,null==P||null==(E=P.summarizer)?void 0:E.model,null==U||null==(A=U.summarizer)?void 0:A.model),size:"sm"})]})}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:"The model used for summarization tasks (defaults to base model)"})]}),(null==z||null==(I=z.summarizer)?void 0:I.model)&&(0,r.jsx)(ts.y,{name:"summarizer-provider-options",label:"Summarizer model provider options",onChange:e=>{L("models.summarizer.providerOptions",e)},value:(null==z||null==(O=z.summarizer)?void 0:O.providerOptions)||"",placeholder:'{\n "temperature": 0.3,\n "maxTokens": 1024\n}'})]})]})}let t6=()=>(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"]})]});function t8(e){var t,a,s,n,l;let{selectedNode:d,dataComponentLookup:c,artifactComponentLookup:u,errorHelpers:m}=e,{tenantId:p,projectId:h}=(0,o.useParams)(),x=(null==(t=d.data)?void 0:t.dataComponents)||[],g=(null==(a=d.data)?void 0:a.artifactComponents)||[],{project:f}=tj(),v=el(e=>e.metadata),{updatePath:j,updateNestedPath:b,getFieldError:y,setFieldRef:N}=t$({selectedNodeId:d.id,errorHelpers:m}),k=(0,i.useCallback)((e,t)=>{b(e,t,d.data)},[b,d.data]),C=(0,i.useCallback)(e=>{j("id",e)},[j]);return tf({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)(tD,{ref:e=>N("name",e),id:"name",name:"name",label:"Name",value:d.data.name||"",onChange:e=>j("name",e.target.value),placeholder:"Support agent",error:y("name"),isRequired:!0}),(0,r.jsx)(tD,{ref:e=>N("id",e),id:"id",name:"id",label:"Id",value:d.data.id||"",onChange:e=>j("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)(tB,{ref:e=>N("description",e),id:"description",name:"description",label:"Description",value:d.data.description||"",onChange:e=>j("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)(tR,{id:"prompt",value:d.data.prompt||"",onChange:e=>j("prompt",e),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)(th.Separator,{}),(0,r.jsx)(t3,{models:d.data.models,updatePath:k,projectModels:null==f?void 0:f.models,graphModels:null==v?void 0:v.models}),(0,r.jsx)(th.Separator,{}),(0,r.jsxs)("div",{className:"space-y-8",children:[(0,r.jsx)(tH,{title:"Execution limits",description:"Configure agent-level execution limits for steps within this agent.",titleTooltip:(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{children:"How execution limit inheritance works:"}),(0,r.jsx)(t6,{})]})}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(e7.J,{htmlFor:"step-count",children:"Max steps"}),(0,r.jsx)(tc,{...tm("agent","stepCountIs",null==(s=d.data.stopWhen)?void 0:s.stepCountIs,null==f||null==(n=f.stopWhen)?void 0:n.stepCountIs),size:"sm"})]}),(0,r.jsx)(tp.p,{id:"step-count",type:"number",min:"1",max:"1000",value:(null==(l=d.data.stopWhen)?void 0:l.stepCountIs)||"",onChange:e=>{let t=e.target.value?parseInt(e.target.value,10):void 0;j("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)(th.Separator,{}),(0,r.jsx)(t5,{label:"Components",componentLookup:c,selectedComponents:x,onSelectionChange:e=>{j("dataComponents",e)},emptyStateMessage:"No components found.",emptyStateActionText:"Create component",emptyStateActionHref:"/".concat(p,"/projects/").concat(h,"/components/new"),placeholder:"Select components..."}),(0,r.jsx)(t5,{label:"Artifacts",componentLookup:u,selectedComponents:g,onSelectionChange:e=>{j("artifactComponents",e)},emptyStateMessage:"No artifacts found.",emptyStateActionText:"Create artifact",emptyStateActionHref:"/".concat(p,"/projects/").concat(h,"/artifacts/new"),placeholder:"Select artifacts..."})]})}function t7(e){let{label:t}=e;return(0,r.jsx)("div",{className:"flex gap-2",children:(0,r.jsx)(e7.J,{children:t})})}function t9(e){var t,a;let{selectedCredentialId:s,onSelect:n,availableCredentials:l,placeholder:d="Select credential..."}=e,[c,u]=(0,i.useState)(!1),{tenantId:m,projectId:p}=(0,o.useParams)();return(0,r.jsx)("div",{className:"flex w-full",children:(0,r.jsxs)(tK.AM,{open:c,onOpenChange:u,children:[(0,r.jsx)(tK.Wv,{asChild:!0,children:(0,r.jsxs)(eT.$,{variant:"outline",role:"combobox","aria-expanded":c,className:"w-full justify-between bg-transparent text-gray-700",children:[null===s?(0,r.jsx)("div",{className:"text-muted-foreground",children:"No Authentication"}):s?(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"font-medium",children:(null==(t=l.find(e=>e.id===s))?void 0:t.id)||s}),(0,r.jsxs)("span",{className:"text-xs text-muted-foreground",children:["(",(null==(a=l.find(e=>e.id===s))?void 0:a.type)||"Unknown",")"]})]}):(0,r.jsx)("div",{className:"text-muted-foreground",children:d}),(0,r.jsx)(tG.A,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,r.jsx)(tK.hl,{className:"w-[var(--radix-popover-trigger-width)] p-0",children:(0,r.jsxs)(tZ.uB,{children:[(0,r.jsx)(tZ.G7,{placeholder:"Search credentials..."}),(0,r.jsxs)(tZ.oI,{children:[(0,r.jsxs)(tZ.xL,{children:[" ",(0,r.jsx)(t0,{message:"No credentials found.",actionText:"Create credential",actionHref:"/".concat(m,"/projects/").concat(p,"/credentials/new")})]}),(0,r.jsxs)(tZ.L$,{children:[(0,r.jsx)(tZ.h_,{value:"",onSelect:()=>{n(null),u(!1)},className:"cursor-pointer",children:(0,r.jsxs)("div",{className:"flex items-center justify-between w-full",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"font-medium",children:"No Authentication"}),(0,r.jsx)("div",{className:"text-xs text-muted-foreground",children:"Unsecured connection"})]}),null===s&&(0,r.jsx)(ti.A,{className:"ml-2 h-4 w-4"})]})}),l.map(e=>(0,r.jsx)(tZ.h_,{value:e.id,onSelect:()=>{n(e.id),u(!1)},className:"cursor-pointer",children:(0,r.jsxs)("div",{className:"flex items-center justify-between w-full",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"font-medium",children:e.id}),(0,r.jsx)("div",{className:"text-xs text-muted-foreground",children:e.type})]}),s===e.id&&(0,r.jsx)(ti.A,{className:"ml-2 h-4 w-4"})]})},e.id))]})]})]})})]})})}function ae(e){let{label:t="Credential",value:a,credentialLookup:s,onValueChange:n,placeholder:l="Select credential..."}=e;return(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,r.jsx)("div",{className:"flex flex-col gap-2",children:(0,r.jsx)(t7,{label:t})}),(0,r.jsx)(t9,{selectedCredentialId:a||null,onSelect:e=>{null==n||n(e)},availableCredentials:Object.values(s),placeholder:l})]})}function at(e){let{selectedNode:t,credentialLookup:a,errorHelpers:s}=e,{handleInputChange:n,getFieldError:l,setFieldRef:o,updateField:d}=t$({selectedNodeId:t.id,errorHelpers:s}),c=(0,i.useCallback)(e=>{d("id",e)},[d]);return tf({nameValue:t.data.name,idValue:t.data.id,onIdChange:c,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)(tD,{ref:e=>o("name",e),id:"name",name:"name",label:"Name",value:t.data.name||"",onChange:n,placeholder:"Support agent",error:l("name")}),(0,r.jsx)(tD,{ref:e=>o("id",e),id:"id",name:"id",label:"Id",value:t.data.id||"",onChange:n,placeholder:"my-external-agent",error:l("id"),description:"Choose a unique identifier for this agent. Using an existing id will replace that agent.",isRequired:!0}),(0,r.jsx)(tB,{ref:e=>o("description",e),id:"description",name:"description",label:"Description",value:t.data.description||"",onChange:n,placeholder:"This agent is responsible for...",error:l("description")}),(0,r.jsx)(tD,{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:l("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"}),(0,r.jsx)(ts.y,{name:"headers",label:"Headers",value:t.data.headers,onChange:e=>d("headers",e),placeholder:"{}",className:""}),(0,r.jsx)(ae,{label:"Credential",credentialLookup:a,value:"string"==typeof t.data.credentialReferenceId?t.data.credentialReferenceId:null,onValueChange:e=>d("credentialReferenceId",e||""),placeholder:"Select a credential"})]})}function aa(e){var t,a,n,l,d,c;let{selectedNode:u,agentToolConfigLookup:m}=e,{updateNodeData:p}=(0,s.VH)(),{tenantId:h,projectId:x}=(0,o.useParams)(),{markUnsaved:g}=en(),{toolLookup:f,edges:v}=el(e=>({toolLookup:e.toolLookup,edges:e.edges})),j=(0,i.useCallback)(()=>(function(e,t,a){if(void 0!==e.data.tempHeaders)return e.data.tempHeaders;let r=e.data.relationshipId;if(r)for(let e of Object.values(t)){let t=e[r];if(t)return t.headers||{}}return{}})(u,m,0),[u,m,v]),[b,y]=(0,i.useState)("{}");(0,i.useEffect)(()=>{y(JSON.stringify(j(),null,2))},[u.id]);let N=f[u.data.toolId],k=null==N?void 0:N.availableTools,C=(0,q.O)({availableTools:k,activeTools:null==N||null==(a=N.config)||null==(t=a.mcp)?void 0:t.activeTools});if(!N)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 ",u.data.toolId]})});let T=G(u,m,v),w=T&&Array.isArray(T)?T.filter(e=>!(null==C?void 0:C.some(t=>t.name===e))):[],S=e=>{let t,a=null===T?(null==C?void 0:C.map(e=>e.name))||[]:[...T];t=a.includes(e)?a.filter(t=>t!==e):[...a,e];let r=(null==C?void 0:C.map(e=>e.name))||[],s=t;t.length===r.length&&r.every(e=>t.includes(e))&&(s=null),p(u.id,{...u.data,tempSelectedTools:s}),g()},E=e=>{let{name:t,value:a}=e.target;u&&(p(u.id,{[t]:a}),g())},A=null;try{A=N?(0,eb.T)(N).type:null}catch(e){console.error(e)}return(0,r.jsxs)("div",{className:"space-y-8",children:[(null==N?void 0:N.imageUrl)&&(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)($.u,{imageUrl:N.imageUrl,name:N.name,provider:A||void 0,size:32,className:"rounded-lg"}),(0,r.jsx)("span",{className:"font-medium text-sm truncate",children:N.name})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(e7.J,{htmlFor:"node-id",children:"Id"}),(0,r.jsx)(tp.p,{id:"node-id",value:u.data.toolId,disabled:!0})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(e7.J,{htmlFor:"name",children:"Name"}),(0,r.jsx)(tp.p,{id:"name",name:"name",value:(null==N?void 0:N.name)||"",onChange:E,placeholder:"MCP server",className:"w-full",disabled:!0})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(e7.J,{htmlFor:"url",children:"URL"}),(0,r.jsx)(tp.p,{id:"url",name:"url",value:(null==N||null==(d=N.config)||null==(l=d.mcp)||null==(n=l.server)?void 0:n.url)||"",onChange:E,placeholder:"https://mcp.inkeep.com",disabled:!0,className:"w-full"})]}),(null==N?void 0:N.imageUrl)&&(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(e7.J,{htmlFor:"imageUrl",children:"Image URL"}),(0,r.jsx)(tp.p,{id:"imageUrl",name:"imageUrl",value:N.imageUrl||"",onChange:E,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)(e7.J,{children:"Selected tools"}),(0,r.jsx)(I.E,{variant:"code",className:"border-none px-2 text-[10px] text-gray-700 dark:text-gray-300",children:null===T?null!=(c=null==C?void 0:C.length)?c:0:T.length})]}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground mb-1.5",children:"Click to select/deselect"}),C&&C.length>0||w.length>0?(0,r.jsxs)("div",{className:"flex flex-wrap gap-2",children:[null==C?void 0:C.map(e=>{let t=null===T||T.includes(e.name);return(0,r.jsxs)(R.Tooltip,{children:[(0,r.jsx)(R.TooltipTrigger,{asChild:!0,children:(0,r.jsxs)(I.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:()=>S(e.name),children:[e.name,t&&(0,r.jsx)("span",{className:"text-xs",children:(0,r.jsx)(ti.A,{className:"w-2.5 h-2.5"})})]})}),(0,r.jsx)(R.TooltipContent,{className:"max-w-xs text-sm",children:(0,r.jsx)("div",{className:"line-clamp-4",children:e.description})})]},e.name)}),w.map(e=>(0,r.jsxs)(R.Tooltip,{children:[(0,r.jsx)(R.TooltipTrigger,{asChild:!0,children:(0,r.jsxs)(I.E,{variant:"warning",className:"flex items-center gap-1 cursor-pointer transition-colors hover:bg-primary/10 normal-case",onClick:()=>S(e),children:[e,(0,r.jsx)("span",{className:"text-xs",children:(0,r.jsx)(M.A,{className:"w-2.5 h-2.5"})})]})}),(0,r.jsx)(R.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)("div",{className:"space-y-2",children:(0,r.jsx)(ts.y,{name:"headers",label:"Headers (JSON)",value:b,onChange:e=>{y(e);try{let t=""===e.trim()?{}:JSON.parse(e);"object"!=typeof t||null===t||Array.isArray(t)||(p(u.id,{...u.data,tempHeaders:t}),g())}catch(e){}},placeholder:'{"X-Your-Header": "your-value", "Content-Type": "application/json"}',className:""})}),(0,r.jsx)(to.G,{href:"/".concat(h,"/projects/").concat(x,"/mcp-servers/").concat(u.data.toolId,"/edit"),children:"Edit MCP Server"})]})}var ar=a(6040),as=a(93431);function an(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)(as.E,{className:"w-full h-[72px] rounded-lg"},e))})]})})}function al(e){var t,a,s,n;let{mcp:l,onClick:o}=e,i=null==(a=l.config)||null==(t=a.mcp)?void 0:t.server,{id:d,name:c,availableTools:u,imageUrl:m,config:p}=l,h=(0,q.O)({availableTools:u,activeTools:null==p||null==(s=p.mcp)?void 0:s.activeTools}),x=null!=(n=null==h?void 0:h.length)?n:0;return(0,r.jsx)(eT.$,{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:()=>o(l),children:(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)($.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)(I.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 ao(e){let{selectedNode:t}=e,{updateNode:a}=(0,s.VH)(),{tenantId:n,projectId:l}=(0,o.useParams)(),{tools:c,isLoading:u,error:m}=(()=>{let[e,t]=(0,i.useState)([]),[a,r]=(0,i.useState)(!0),[s,n]=(0,i.useState)(null),{tenantId:l,projectId:c}=(0,o.useParams)();return(0,i.useEffect)(()=>{(async()=>{try{r(!0),n(null);let e=await (0,ar.i)(l,c);t(e)}catch(t){let e=t instanceof Error?t.message:"Failed to load MCP tools";n(e),d.oR.error(e)}finally{r(!1)}})()},[l,c]),{tools:e,isLoading:a,error:s}})(),p=e=>{a(t.id,{type:Z.MCP,data:{toolId:e.id,agentId:null,relationshipId:null}})};return u?(0,r.jsx)(an,{title:"Select MCP server"}):m?(0,r.jsx)(t0,{message:"Something went wrong.",actionText:"Create MCP server",actionHref:"/".concat(n,"/projects/").concat(l,"/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)(al,{mcp:e,onClick:p},e.id))})]})}):(0,r.jsx)(t0,{message:"No MCP servers found.",actionText:"Create MCP server",actionHref:"/".concat(n,"/projects/").concat(l,"/mcp-servers/new")})}function ai(e){let{selectedNodeId:t,selectedEdgeId:a,onClose:n,backToGraph:l,isOpen:o,dataComponentLookup:d,artifactComponentLookup:c,agentToolConfigLookup:u,credentialLookup:m}=e,p=(0,s.j7)(t||""),h=(0,s.Yu)(),{hasFieldError:x,getFieldErrorMessage:g,getFirstErrorField:f}=P(),j=(0,i.useMemo)(()=>a?h.find(e=>e.id===a):null,[a,h]),{heading:b,HeadingIcon:y}=(0,i.useMemo)(()=>{let e,t="";if(p){let a=ea[null==p?void 0:p.type];t=(null==a?void 0:a.name)||"Node",e=null==a?void 0:a.Icon}else if(j){let a=v[(null==j?void 0:j.type)||"default"];t=(null==a?void 0:a.name)||"Connection",e=null==a?void 0:a.Icon}else t="Graph",e=e0.A;return{heading:t,HeadingIcon:e}},[p,j]),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,s={hasFieldError:e=>x(a,e),getFieldErrorMessage:e=>g(a,e),getFirstErrorField:()=>f(a)};switch(t){case Z.Agent:return(0,r.jsx)(t8,{selectedNode:p,dataComponentLookup:d,artifactComponentLookup:c,errorHelpers:s});case Z.ExternalAgent:return(0,r.jsx)(at,{selectedNode:p,credentialLookup:m,errorHelpers:s});case Z.MCPPlaceholder:return(0,r.jsx)(ao,{selectedNode:p});case Z.MCP:return(0,r.jsx)(aa,{selectedNode:p,agentToolConfigLookup:u});default:return null}}return j?(0,r.jsx)(tt,{selectedEdge:j}):(0,r.jsx)(tq,{})},[p,j,d,c,x,g,f,u,m]),k=(0,i.useMemo)(()=>p||j,[p,j]);return(0,r.jsx)(e4.Root,{isOpen:o,children:o&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(e4.Header,{children:[(0,r.jsxs)("div",{className:"flex items-center relative",children:[k&&(0,r.jsx)(e4.BackButton,{onClick:l}),(0,r.jsx)(ta,{heading:b,Icon:y,className:k?"transition-all duration-300 ease-in-out group-hover:translate-x-8":""})]}),(0,r.jsx)(e4.CloseButton,{onClick:n})]}),(0,r.jsx)(e4.Content,{children:N})]})})}var ad=a(68506),ac=a(97405);function au(e){let{onSubmit:t,isPreviewDisabled:a,toggleSidePane:s,setShowPlayground:n}=e,l=el(e=>e.dirty),o=(0,i.useRef)(null),d=(0,r.jsxs)(eT.$,{disabled:l||a,variant:"outline",type:"button",onClick:()=>n(!0),children:[(0,r.jsx)(ad.A,{className:"w-4 h-4 text-muted-foreground"}),"Try it"]});return(0,i.useEffect)(()=>{function e(e){((0,z.Ue)()?e.metaKey:e.ctrlKey)&&"s"===e.key&&(e.preventDefault(),o.current.click())}return window.addEventListener("keydown",e),()=>{window.removeEventListener("keydown",e)}},[]),(0,r.jsxs)("div",{className:"flex gap-2",children:[l||a?(0,r.jsxs)(R.Tooltip,{children:[(0,r.jsx)(R.TooltipTrigger,{asChild:!0,children:(0,r.jsx)("div",{children:d})}),(0,r.jsx)(R.TooltipContent,{children:l?"Please save your changes before trying the graph.":"Please save the graph to try it."})]}):d,(0,r.jsx)(eT.$,{onClick:t,variant:l?"default":"outline",disabled:!l&&!a,ref:o,children:a?"Save":"Save changes"}),(0,r.jsxs)(eT.$,{type:"button",variant:"ghost",onClick:s,children:[(0,r.jsx)("span",{className:"sr-only",children:"Toggle side pane"}),(0,r.jsx)(ac.A,{className:"w-4 h-4"})]})]})}function am(e){let{graph:t,dataComponentLookup:a={},artifactComponentLookup:c={},toolLookup:m={},credentialLookup:p={}}=e,[h,x]=(0,i.useState)(!1),v=(0,o.useRouter)(),{tenantId:b,projectId:y}=(0,o.useParams)(),N=(0,i.useMemo)(()=>[{id:(0,l.Ak)(),type:Z.Agent,position:{x:0,y:0},data:{name:"",isDefault:!0},deletable:!1}],[]),k=(0,i.useCallback)(e=>e.map(e=>{if(e.type===Z.MCP&&e.data&&"toolId"in e.data){let t=m[e.data.toolId];if(t){let a=null;return a=(0,eb.T)(t).type,{...e,data:{...e.data,name:t.name,imageUrl:t.imageUrl,provider:a}}}}return e}),[m]),{nodes:C,edges:T}=(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],s=a===e.defaultAgentId,n="external"===r.type,l={id:a,type:n?Z.ExternalAgent:Z.Agent,position:{x:0,y:0},data:n?{id:r.id,name:r.name,description:r.description,baseUrl:r.baseUrl,headers:(0,z.S_)(r.headers)||"{}",type:r.type,credentialReferenceId:r.credentialReferenceId}:(()=>{var e,t,a;return{id:r.id,name:r.name,isDefault:s,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,z.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,z.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,z.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,headers:r.canUse?r.canUse.reduce((e,t)=>(t.headers&&(e[t.toolId]=t.headers),e),{}):void 0}})(),deletable:!s};t.push(l)}for(let s of r){let r=e.agents[s];if("canUse"in r&&r.canUse&&r.canUse.length>0)for(let e of r.canUse){let r=e.toolId,n=(0,l.Ak)(),o=e.agentToolRelationId,i={id:n,type:Z.MCP,position:{x:0,y:0},data:{toolId:r,agentId:s,relationshipId:o}};t.push(i);let d={id:"edge-".concat(n,"-").concat(s),type:g.Default,source:s,sourceHandle:Y,target:n,targetHandle:X};a.push(d)}}let s=new Set;for(let t of r){var n,o,i,d,c,u,m,p;let r=e.agents[t];if("canTransferTo"in r&&r.canTransferTo){for(let l of r.canTransferTo)if(e.agents[l]){let c=t===l,u=c?"self-".concat(t):[t,l].sort().join("-");if(!s.has(u)){s.add(u);let m=e.agents[l],p="canTransferTo"in r&&(null==(n=r.canTransferTo)?void 0:n.includes(l))||!1,h="canTransferTo"in m&&(null==(o=m.canTransferTo)?void 0:o.includes(t))||!1,x="canDelegateTo"in r&&(null==(i=r.canDelegateTo)?void 0:i.includes(l))||!1,f="canDelegateTo"in m&&(null==(d=m.canDelegateTo)?void 0:d.includes(t))||!1,v="external"===m.type,j={id:c?"edge-self-".concat(t):"edge-".concat(l,"-").concat(t),type:c?g.SelfLoop:v?g.A2AExternal:g.A2A,source:t,sourceHandle:Y,target:l,targetHandle:v?ee:Q,selected:!1,data:{relationships:{transferTargetToSource:h,transferSourceToTarget:p,delegateTargetToSource:f,delegateSourceToTarget:x}}};a.push(j)}}}if("canDelegateTo"in r&&r.canDelegateTo){for(let n of r.canDelegateTo)if(e.agents[n]){let l=t===n,o=l?"self-".concat(t):[t,n].sort().join("-");if(!s.has(o)){s.add(o);let i=e.agents[n],d="canTransferTo"in r&&(null==(c=r.canTransferTo)?void 0:c.includes(n))||!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(n))||!1,f="canDelegateTo"in i&&(null==(p=i.canDelegateTo)?void 0:p.includes(t))||!1,v="external"===i.type,j={id:l?"edge-self-".concat(t):"edge-".concat(n,"-").concat(t),type:l?g.SelfLoop:v?g.A2AExternal:g.A2A,source:t,sourceHandle:Y,target:n,targetHandle:v?ee:Q,selected:!1,data:{relationships:{transferTargetToSource:h,transferSourceToTarget:d,delegateTargetToSource:f,delegateSourceToTarget:x}}};a.push(j)}}}}return{nodes:U(t,a),edges:a}}(t):{nodes:N,edges:j};return{...e,nodes:k(e.nodes)}},[t,k,N]),w=(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=>{if(e.agentToolRelationId){let a={toolId:e.toolId};e.toolSelection&&(a.toolSelection=e.toolSelection),e.headers&&(a.headers=e.headers),t[e.agentToolRelationId]=a}}),Object.keys(t).length>0&&(e[a]=t)}}),e},[null==t?void 0:t.agents]),{screenToFlowPosition:S,updateNodeData:E,fitView:A,getNodes:I,getEdges:O,getIntersectingNodes:L}=(0,s.VH)(),{storeNodes:M,edges:R,metadata:D}=el(e=>({storeNodes:e.nodes,edges:e.edges,metadata:e.metadata})),{setNodes:B,setEdges:F,onNodesChange:_,onEdgesChange:V,setMetadata:H,setInitial:W,markSaved:J,clearSelection:$,markUnsaved:ea}=en(),er=(0,i.useMemo)(()=>k(M),[M,k]),{nodeId:es,edgeId:eo,setQueryState:ei,openGraphPane:em,isOpen:ep}=eh(),{errors:ex,showErrors:eg,setErrors:ef,clearErrors:ey,setShowErrors:eN}=P(),ek=(0,i.useCallback)(e=>{_(e);let t=e.filter(e=>"replace"===e.type);t.length&&setTimeout(()=>{let e=I();for(let a of t){let t=e.find(e=>e.id===a.id);if(t&&L(t).length>0)return void B(e=>U(e,O()))}},0)},[I,O,L,B,_]);(0,i.useEffect)(()=>{var e,r,s,n,l,o,i,d,u,p;W(C,T,{id:null==t?void 0:t.id,name:null!=(o=null==t?void 0:t.name)?o:"",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,z.S_)(t.models.base.providerOptions)}:void 0,structuredOutput:t.models.structuredOutput?{model:t.models.structuredOutput.model,providerOptions:(0,z.S_)(t.models.structuredOutput.providerOptions)}:void 0,summarizer:t.models.summarizer?{model:t.models.summarizer.model,providerOptions:(0,z.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,z.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!=(p=null==t||null==(s=t.contextConfig)?void 0:s.description)?p:"",contextVariables:(0,z.S_)(null==t||null==(n=t.contextConfig)?void 0:n.contextVariables)||"",requestContextSchema:(0,z.S_)(null==t||null==(l=t.contextConfig)?void 0:l.requestContextSchema)||""}},a,c,m,w)},[]),(0,i.useEffect)(()=>{if(!t)return void em();es||eo||em(),es&&B(e=>e.map(e=>({...e,selected:e.id===es}))),eo&&F(e=>e.map(e=>({...e,selected:e.id===eo}))),es&&!C.some(e=>e.id===es)&&ei(e=>({...e,nodeId:null,pane:"graph"})),eo&&!T.some(e=>e.id===eo)&&ei(e=>({...e,edgeId:null,pane:"graph"}))},[]),(0,i.useEffect)(()=>{let e=setTimeout(()=>{A({maxZoom:1,duration:200})},350);return()=>clearTimeout(e)},[ep,A]),(0,i.useEffect)(()=>{let e=setTimeout(()=>{A({maxZoom:1,duration:200})},350);return()=>clearTimeout(e)},[h,A]);let eC=(0,i.useCallback)(e=>{ea();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:s}=e;if(t?a={...a,type:g.SelfLoop,selected:!0,data:{relationships:{transferTargetToSource:!1,transferSourceToTarget:!0,delegateTargetToSource:!1,delegateSourceToTarget:!1}}}:(r===Y||r===Q)&&(s===Q||s===Y)?a={...a,type:g.A2A,selected:!0,data:{relationships:{transferTargetToSource:!1,transferSourceToTarget:!0,delegateTargetToSource:!1,delegateSourceToTarget:!1}}}:(r===Y||r===Q)&&s===ee&&(a={...a,type:g.A2AExternal,data:{relationships:{transferTargetToSource:!1,transferSourceToTarget:!1,delegateTargetToSource:!1,delegateSourceToTarget:!0}}}),s===X&&(r===Y||r===Q)){let t=er.find(t=>t.id===e.target);if(t&&t.type===Z.MCP){let a=e.source;E(t.id,{...t.data,agentId:a,relationshipId:null})}}requestAnimationFrame(()=>{u.execute(new ec(a,{deselectOtherEdgesIfA2A:!0}))})},[]),eT=(0,i.useCallback)(e=>{let{sourceHandle:t,targetHandle:a}=e;return t!==X||a!==X},[]),ew=(0,i.useCallback)(e=>{e.preventDefault(),e.dataTransfer.dropEffect="move"},[]),eS=(0,i.useCallback)(e=>{e.preventDefault();let t=e.dataTransfer.getData("application/reactflow");if(!t)return;let a=JSON.parse(t),r=S({x:e.clientX,y:e.clientY}),s={id:(0,l.Ak)(),type:a.type,position:r,selected:!0,data:{...et[a.type]}};$(),u.execute(new ed(s))},[S,$]),eE=(0,i.useCallback)(e=>{var t,a;let{nodes:r,edges:s}=e,n=1===r.length?r[0]:null,l=1===s.length&&((null==(t=s[0])?void 0:t.type)===g.A2A||(null==(a=s[0])?void 0:a.type)===g.SelfLoop)?s[0]:null,o=ep?"graph":null;ei({pane:n?"node":l?"edge":o,nodeId:n?n.id:null,edgeId:l?l.id:null},{history:"replace"})},[ei,ep]);(0,s.p4)({onChange:eE});let{undo:ez,redo:eL,deleteSelected:eU}=en(),eM=(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?eL():ez();return}if("Delete"===e.key||"Backspace"===e.key){let t=e.target;t&&("INPUT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable)||(e.preventDefault(),eU())}}},[ez,eL,eU]);(0,i.useEffect)(()=>(window.addEventListener("keydown",eM),()=>window.removeEventListener("keydown",eM)),[eM]);let eR=(0,i.useCallback)(()=>{F(e=>e.map(e=>({...e,selected:!1}))),B(e=>e.map(e=>({...e,selected:!1}))),ei({pane:null,nodeId:null,edgeId:null})},[ei,F,B]),eD=(0,i.useCallback)(()=>{F(e=>e.map(e=>({...e,selected:!1}))),B(e=>e.map(e=>({...e,selected:!1}))),ei({pane:"graph",nodeId:null,edgeId:null})},[ei,F,B]),eB=(0,i.useCallback)(e=>{let t=er.find(t=>{var a;return t.id===e||(null==(a=t.data)?void 0:a.id)===e});t&&(B(e=>e.map(e=>({...e,selected:e.id===t.id}))),F(e=>e.map(e=>({...e,selected:!1}))),ei({pane:"node",nodeId:t.id,edgeId:null}))},[B,F,er,ei]),eF=(0,i.useCallback)(e=>{let t=R.find(t=>t.id===e);t&&(F(e=>e.map(e=>({...e,selected:e.id===t.id}))),B(e=>e.map(e=>({...e,selected:!1}))),ei({pane:"edge",nodeId:null,edgeId:t.id}))},[F,B,R,ei]),e_=(0,i.useCallback)(async()=>{let e=function(e,t,a){let r=function(e,t,a){let r=[];for(let l of e.filter(e=>e.type===Z.MCP)){var s,n;let e=a[l.data.toolId];if(!e)continue;let o=(0,q.O)({availableTools:e.availableTools,activeTools:null==(n=e.config)||null==(s=n.mcp)?void 0:s.activeTools}),i=G(l,t,[]),d=i&&Array.isArray(i)?i.filter(e=>!(null==o?void 0:o.some(t=>t.name===e))):[];d.length>0&&r.push({nodeId:l.data.toolId,nodeName:l.data.name||e.name||"Unnamed MCP Server",orphanedTools:d})}let l=r.reduce((e,t)=>e+t.orphanedTools.length,0);return{hasOrphanedTools:r.length>0,orphanedToolsByNode:r,totalOrphanedCount:l}}(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(", "),s=a>1?"tools":"tool",n=a>1?"are":"is",l=a>1?"These tools":"This tool";return'The MCP server "'.concat(t.nodeName,'" has ').concat(a," selected ").concat(s," that ").concat(n," no longer available: ").concat(r,". ").concat(l," 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}(er,w,m);e&&d.oR.warning(e,{closeButton:!0,duration:6e3});let r=function(e,t,a,r,s,n){var o,i,d,c,u;let m={},p=new Set,h=new Set,x="";for(let a of e)if(a.type===Z.Agent){let r=a.data.id||a.id,s=a.data.dataComponents||[],l=a.data.artifactComponents||[];s.forEach(e=>{p.add(e)}),l.forEach(e=>{h.add(e)});let o=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:eu(e.base.providerOptions)}:void 0,structuredOutput:e.structuredOutput?{model:e.structuredOutput.model,providerOptions:eu(e.structuredOutput.providerOptions)}:void 0,summarizer:e.summarizer?{model:e.summarizer.model,providerOptions:eu(e.summarizer.providerOptions)}:void 0}}(a.data.models),i=a.data.stopWhen,u=[];for(let s of t.filter(t=>t.source===a.id&&e.some(e=>e.id===t.target&&e.type===Z.MCP))){let t=e.find(e=>e.id===s.target);if(t&&t.type===Z.MCP){let e=t.data.toolId;if(e){let a=t.data.tempSelectedTools,s=null,l=t.data.relationshipId;if(void 0!==a)Array.isArray(a)?s=a:null===a&&(s=null);else{let e=l?null==n||null==(d=n[r])?void 0:d[l]:null;s=(null==e?void 0:e.toolSelection)?e.toolSelection:null}let o=t.data.tempHeaders,i={};if(void 0!==o)"object"!=typeof o||null===o||Array.isArray(o)||(i=o);else{let e=l?null==n||null==(c=n[r])?void 0:c[l]:null;(null==e?void 0:e.headers)&&(i=e.headers)}u.push({toolId:e,toolSelection:s,headers:i,...l&&{agentToolRelationId:l}})}}}let g={id:r,name:a.data.name,description:a.data.description||"",prompt:a.data.prompt,canUse:u,canTransferTo:[],canDelegateTo:[],dataComponents:s,artifactComponents:l,...o&&{models:o},type:"internal",...i&&{stopWhen:i}};a.data.isDefault&&(x=r),m[r]=g}else if(a.type===Z.ExternalAgent){let e=a.data.id||a.id,t=eu(a.data.headers),r={id:e,name:a.data.name,description:a.data.description||"",baseUrl:a.data.baseUrl,headers:t||null,type:"external",credentialReferenceId:a.data.credentialReferenceId||null};a.data.isDefault&&(x=e),m[e]=r}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),s=(null==t?void 0:t.data.id)||(null==t?void 0:t.id),n=(null==r?void 0:r.data.id)||(null==r?void 0:r.id),l=m[s],o=m[n];if(l&&o&&(null==(u=a.data)?void 0:u.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(l,"canTransferTo",n),e.transferTargetToSource&&t(o,"canTransferTo",s),e.delegateSourceToTarget&&t(l,"canDelegateTo",n),e.delegateTargetToSource&&t(o,"canDelegateTo",s)}}let f=eu(null==a||null==(o=a.contextConfig)?void 0:o.contextVariables),v=eu(null==a||null==(i=a.contextConfig)?void 0:i.requestContextSchema),j=(null==a?void 0:a.contextConfig)&&(a.contextConfig.name&&""!==a.contextConfig.name.trim()||a.contextConfig.description&&""!==a.contextConfig.description.trim()||f&&"object"==typeof f&&null!==f&&Object.keys(f).length>0||v&&"object"==typeof v&&null!==v&&Object.keys(v).length>0),b={};r&&p.forEach(e=>{let t=r[e];t&&(b[e]=t)});let y={};s&&h.forEach(e=>{let t=s[e];t&&(y[e]=t)});let N={id:(null==a?void 0:a.id)||(0,l.Ak)(),name:(null==a?void 0:a.name)||"Untitled Graph",description:(null==a?void 0:a.description)||void 0,defaultAgentId:x,agents:m};if((null==a?void 0:a.models)&&(N.models={base:a.models.base?{model:a.models.base.model,providerOptions:eu(a.models.base.providerOptions)}:void 0,structuredOutput:a.models.structuredOutput?{model:a.models.structuredOutput.model,providerOptions:eu(a.models.structuredOutput.providerOptions)}:void 0,summarizer:a.models.summarizer?{model:a.models.summarizer.model,providerOptions:eu(a.models.summarizer.providerOptions)}:void 0}),(null==a?void 0:a.stopWhen)&&(N.stopWhen=a.stopWhen),(null==a?void 0:a.graphPrompt)&&(N.graphPrompt=a.graphPrompt),null==a?void 0:a.statusUpdates){let e=eu(a.statusUpdates.statusComponents);N.statusUpdates={...a.statusUpdates,statusComponents:e}}if(j&&(null==a?void 0:a.contextConfig)){let e=a.contextConfig.id||(0,l.Ak)();N.contextConfigId=e,N.contextConfig={id:e,name:a.contextConfig.name||"",description:a.contextConfig.description||"",requestContextSchema:v,contextVariables:f}}return N}(er,R,D,a,c,w),s=await ev(b,y,r,null==t?void 0:t.id);if(s.success){var n;if(ey(),d.oR.success("Graph saved",{closeButton:!0}),J(),s.data){let e=new Set;B(t=>t.map(t=>{if(t.type===Z.MCP&&t.data.agentId&&t.data.toolId){if(t.data.relationshipId)return t;let a=t.data.agentId,r=t.data.toolId;if("canUse"in s.data.agents[a]&&s.data.agents[a].canUse){let n=s.data.agents[a].canUse.find(t=>t.toolId===r&&t.agentToolRelationId&&!e.has(t.agentToolRelationId));if(null==n?void 0:n.agentToolRelationId)return e.add(n.agentToolRelationId),{...t,data:{...t.data,relationshipId:n.agentToolRelationId}}}}return t}))}!(null==t?void 0:t.id)&&(null==(n=s.data)?void 0:n.id)&&(H("id",s.data.id),v.push("/".concat(b,"/projects/").concat(y,"/graphs/").concat(s.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=ej(a,e.path);t&&r.push(t)}else if(e.path){let t=ej(e,e.path);t&&r.push(t)}var t=r;let s={},n={},l=[];for(let e of t)switch(e.type){case"node":e.nodeId&&(s[e.nodeId]||(s[e.nodeId]=[]),s[e.nodeId].push(e));break;case"edge":e.edgeId&&(n[e.edgeId]||(n[e.edgeId]=[]),n[e.edgeId].push(e));break;case"graph":l.push(e)}return{totalErrors:t.length,nodeErrors:s,edgeErrors:n,graphErrors:l,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:[]}}}(s.error);ef(e);let t=function(e){let{totalErrors:t,nodeErrors:a,edgeErrors:r,graphErrors:s}=e;if(0===t)return"";let n=[],l=Object.keys(a).length,o=Object.keys(r).length,i=s.length;l>0&&n.push("".concat(l," agent").concat(l>1?"s":"")),o>0&&n.push("".concat(o," connection").concat(o>1?"s":"")),i>0&&n.push("".concat(i," graph setting").concat(i>1?"s":""));let d=n.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})}},[er,R,D,a,c,J,H,B,v,null==t?void 0:t.id,b,y,ey,ef,w,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)(eI,{}),(0,r.jsx)(eO,{}),(0,r.jsxs)(s.Gc,{defaultEdgeOptions:{type:"default"},nodeTypes:K,edgeTypes:f,nodes:er,edges:R,onNodesChange:ek,onEdgesChange:V,onConnect:eC,onDrop:eS,onDragOver:ew,fitView:!0,snapToGrid:!0,snapGrid:[20,20],fitViewOptions:{maxZoom:1},connectionMode:n.WZ.Loose,isValidConnection:eT,children:[(0,r.jsx)(s.VS,{color:"#a8a29e",gap:20}),(0,r.jsx)(s.H2,{className:"text-foreground",showInteractive:!1}),(0,r.jsx)(s.Zk,{position:"top-left",children:(0,r.jsx)(eP,{})}),(0,r.jsx)(s.Zk,{position:"top-right",children:(0,r.jsx)(au,{onSubmit:e_,isPreviewDisabled:!(null==t?void 0:t.id),toggleSidePane:ep?eD:em,setShowPlayground:()=>{eR(),x(!0)}})}),ex&&eg&&(0,r.jsx)(s.Zk,{position:"bottom-left",className:"max-w-sm !left-8 mb-4",children:(0,r.jsx)(eA,{errorSummary:ex,onClose:()=>eN(!1),onNavigateToNode:eB,onNavigateToEdge:eF})})]})]}),(0,r.jsx)(ai,{selectedNodeId:es,selectedEdgeId:eo,isOpen:ep,onClose:eR,backToGraph:eD,dataComponentLookup:a,artifactComponentLookup:c,agentToolConfigLookup:w,credentialLookup:p}),h&&(null==t?void 0:t.id)&&(0,r.jsx)(eQ,{graphId:null==t?void 0:t.id,projectId:y,tenantId:b,setShowPlayground:x,closeSidePane:eR})]})}function ap(e){let{graph:t,dataComponentLookup:a,artifactComponentLookup:n,toolLookup:l,credentialLookup:o}=e;return(0,r.jsx)(s.Ln,{children:(0,r.jsx)(am,{graph:t,dataComponentLookup:a,artifactComponentLookup:n,toolLookup:l,credentialLookup:o})})}},77064:(e,t,a)=>{"use strict";a.d(t,{u:()=>d});var r=a(60098),s=a(4778),n=a(27764),l=a(79178),o=a(52681),i=a(42503);function d(e){let{imageUrl:t,name:a,provider:d,size:c=24,className:u}=e,[m,p]=(0,l.useState)(!1),[h,x]=(0,l.useState)(!0);return!t||m?d?(0,r.jsx)(i.r,{provider:d,size:c,className:u}):(0,r.jsx)(s.A,{className:(0,o.cn)("text-muted-foreground",u),style:{width:c,height:c}}):t.startsWith("data:image/")?(0,r.jsx)(n.default,{src:t,alt:a,width:c,height:c,className:(0,o.cn)("object-contain",u),onError:()=>p(!0)}):(0,r.jsxs)("div",{className:(0,o.cn)("relative flex items-center justify-center",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)(n.default,{src:t,alt:a,width:c,height:c,className:(0,o.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}}},79741:(e,t,a)=>{"use strict";a.d(t,{r:()=>l});var r=a(60098),s=a(37479),n=a(11729);function l(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)(n.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)(s.i,{className:"absolute right-1 top-1/2 -translate-y-1/2",textToCopy:t}),(0,r.jsx)(n.$,{orientation:"horizontal"})]})})}},84661:(e,t,a)=>{"use strict";a.d(t,{S:()=>o});var r=a(60098),s=a(63433),n=a(27820),l=a(52681);function o(e){let{className:t,...a}=e;return(0,r.jsx)(s.bL,{"data-slot":"checkbox",className:(0,l.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)(s.C1,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:(0,r.jsx)(n.A,{className:"size-3.5"})})})}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1823,7851],{2609:(e,r,a)=>{Promise.resolve().then(a.bind(a,93760)),Promise.resolve().then(a.bind(a,1095)),Promise.resolve().then(a.bind(a,88831)),Promise.resolve().then(a.t.bind(a,85276,23))},93760:(e,r,a)=>{"use strict";a.d(r,{ArtifactComponentForm:()=>E});var t=a(60098),s=a(36886),o=a(93137),i=a(95118),c=a(32028),l=a(23574),n=a(41392),d=a(66905),u=a(86714),m=a(86312),p=a(56497),f=a(97555);let h=(0,f.createServerReference)("708af7b49d60595beb0a9b39f7d6d8105b8a8eb005",f.callServer,void 0,f.findSourceMapURL,"updateArtifactComponentAction"),b=(0,f.createServerReference)("70a3bceb153ce7db351d770ae777385018a5977d38",f.callServer,void 0,f.findSourceMapURL,"createArtifactComponentAction");var S=a(52681);let v={id:"",name:"",description:"",summaryProps:"",fullProps:""};var R=a(29583),N=a(57130),P=a(69823);let y=e=>R.string().min(1,"".concat(e," schema is required.")).transform((e,r)=>{try{let t=JSON.parse(e),s=(0,N._O)(e);if(!s.isValid){var a;let e=(null==(a=s.errors[0])?void 0:a.message)||"Invalid JSON schema";return r.addIssue({code:R.ZodIssueCode.custom,message:e}),R.NEVER}return t}catch(e){return r.addIssue({code:R.ZodIssueCode.custom,message:(0,N.SR)(e)}),R.NEVER}}),x=R.object({id:P.f,name:R.string().min(1,"Name is required."),description:R.string().min(1,"Description is required."),summaryProps:y("Summary props").optional(),fullProps:y("Full props").optional()});function E(e){let{id:r,tenantId:a,projectId:f,initialData:R}=e,N=(0,i.mN)({resolver:(0,s.u)(x),defaultValues:(e=>{if(!e)return v;let r={...e};return r.summaryProps&&(r.summaryProps=(0,S.S_)(r.summaryProps)),r.fullProps&&(r.fullProps=(0,S.S_)(r.fullProps)),r})(R)}),{isSubmitting:P}=N.formState,y=(0,o.useRouter)();(0,p.S)({form:N,nameField:"name",idField:"id",isEditing:!!r});let E=async e=>{try{let t={...e};if(r){let e=await h(a,f,t);if(!e.success)return void c.oR.error(e.error||"Failed to update artifact.");c.oR.success("Artifact updated.")}else{let e=await b(a,f,t);if(!e.success)return void c.oR.error(e.error||"Failed to create artifact");c.oR.success("Artifact created."),y.push("/".concat(a,"/projects/").concat(f,"/artifacts"))}}catch(r){console.error("Error submitting artifact:",r);let e=r instanceof Error?r.message:"An unexpected error occurred.";c.oR.error(e)}};return(0,t.jsx)(m.lV,{...N,children:(0,t.jsxs)("form",{onSubmit:N.handleSubmit(E),className:"space-y-8",children:[(0,t.jsx)(l.a,{control:N.control,name:"name",label:"Name",placeholder:"Document Artifact",isRequired:!0}),(0,t.jsx)(l.a,{control:N.control,name:"id",label:"Id",placeholder:"my-artifact",disabled:!!r,isRequired:!0,description:r?"":"Choose a unique identifier for this artifact. Using an existing id will replace that artifact."}),(0,t.jsx)(n.K,{control:N.control,name:"description",label:"Description",placeholder:"Structured factual information extracted from search results",className:"min-h-[80px]",isRequired:!0}),(0,t.jsx)(d.S,{control:N.control,name:"summaryProps",label:"Summary props (JSON schema)",placeholder:"Enter a valid JSON Schema...",isRequired:!0}),(0,t.jsx)(d.S,{control:N.control,name:"fullProps",label:"Full props (JSON schema)",placeholder:"Enter a valid JSON Schema...",isRequired:!0}),(0,t.jsx)(u.$,{type:"submit",disabled:P,children:"Save"})]})})}}},e=>{e.O(0,[4151,1482,9425,2060,2597,8096,6501,8637,8831,7305,9907,4918,7358],()=>e(e.s=2609)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1823,7851],{2609:(e,r,a)=>{Promise.resolve().then(a.bind(a,93760)),Promise.resolve().then(a.bind(a,1095)),Promise.resolve().then(a.bind(a,88831)),Promise.resolve().then(a.t.bind(a,85276,23))},93760:(e,r,a)=>{"use strict";a.d(r,{ArtifactComponentForm:()=>E});var t=a(60098),s=a(36886),o=a(93137),i=a(95118),c=a(32028),l=a(23574),n=a(41392),d=a(66905),u=a(86714),m=a(86312),p=a(56497),f=a(97555);let h=(0,f.createServerReference)("708af7b49d60595beb0a9b39f7d6d8105b8a8eb005",f.callServer,void 0,f.findSourceMapURL,"updateArtifactComponentAction"),b=(0,f.createServerReference)("70a3bceb153ce7db351d770ae777385018a5977d38",f.callServer,void 0,f.findSourceMapURL,"createArtifactComponentAction");var S=a(52681);let v={id:"",name:"",description:"",summaryProps:"",fullProps:""};var R=a(29583),N=a(57130),P=a(69823);let y=e=>R.string().min(1,"".concat(e," schema is required.")).transform((e,r)=>{try{let t=JSON.parse(e),s=(0,N._O)(e);if(!s.isValid){var a;let e=(null==(a=s.errors[0])?void 0:a.message)||"Invalid JSON schema";return r.addIssue({code:R.ZodIssueCode.custom,message:e}),R.NEVER}return t}catch(e){return r.addIssue({code:R.ZodIssueCode.custom,message:(0,N.SR)(e)}),R.NEVER}}),x=R.object({id:P.f,name:R.string().min(1,"Name is required."),description:R.string().min(1,"Description is required."),summaryProps:y("Summary props").optional(),fullProps:y("Full props").optional()});function E(e){let{id:r,tenantId:a,projectId:f,initialData:R}=e,N=(0,i.mN)({resolver:(0,s.u)(x),defaultValues:(e=>{if(!e)return v;let r={...e};return r.summaryProps&&(r.summaryProps=(0,S.S_)(r.summaryProps)),r.fullProps&&(r.fullProps=(0,S.S_)(r.fullProps)),r})(R)}),{isSubmitting:P}=N.formState,y=(0,o.useRouter)();(0,p.S)({form:N,nameField:"name",idField:"id",isEditing:!!r});let E=async e=>{try{let t={...e};if(r){let e=await h(a,f,t);if(!e.success)return void c.oR.error(e.error||"Failed to update artifact.");c.oR.success("Artifact updated.")}else{let e=await b(a,f,t);if(!e.success)return void c.oR.error(e.error||"Failed to create artifact");c.oR.success("Artifact created."),y.push("/".concat(a,"/projects/").concat(f,"/artifacts"))}}catch(r){console.error("Error submitting artifact:",r);let e=r instanceof Error?r.message:"An unexpected error occurred.";c.oR.error(e)}};return(0,t.jsx)(m.lV,{...N,children:(0,t.jsxs)("form",{onSubmit:N.handleSubmit(E),className:"space-y-8",children:[(0,t.jsx)(l.a,{control:N.control,name:"name",label:"Name",placeholder:"Document Artifact",isRequired:!0}),(0,t.jsx)(l.a,{control:N.control,name:"id",label:"Id",placeholder:"my-artifact",disabled:!!r,isRequired:!0,description:r?"":"Choose a unique identifier for this artifact. Using an existing id will replace that artifact."}),(0,t.jsx)(n.K,{control:N.control,name:"description",label:"Description",placeholder:"Structured factual information extracted from search results",className:"min-h-[80px]",isRequired:!0}),(0,t.jsx)(d.S,{control:N.control,name:"summaryProps",label:"Summary props (JSON schema)",placeholder:"Enter a valid JSON Schema...",isRequired:!0}),(0,t.jsx)(d.S,{control:N.control,name:"fullProps",label:"Full props (JSON schema)",placeholder:"Enter a valid JSON Schema...",isRequired:!0}),(0,t.jsx)(u.$,{type:"submit",disabled:P,children:"Save"})]})})}}},e=>{e.O(0,[4151,1482,9425,2060,2597,8096,6501,8637,8831,7305,9907,4918,7358],()=>e(e.s=2609)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[942],{62658:(e,t,r)=>{"use strict";r.d(t,{ArtifactComponentItem:()=>b});var s=r(60098),n=r(51332),a=r(80986),c=r(30836),o=r(21341),i=r(79178),d=r(86714),l=r(30958),h=r(80311),m=r(93137),u=r(32028),f=r(90035),x=r(97555);let p=(0,x.createServerReference)("70da8f35293af0acb58a1427a32a3df1caf854f8eb",x.callServer,void 0,x.findSourceMapURL,"deleteArtifactComponentAction");function j(e){let{artifactComponentId:t,artifactComponentName:r,setIsOpen:n}=e,[a,c]=(0,i.useState)(!1),{tenantId:o,projectId:d}=(0,m.useParams)(),l=async()=>{c(!0);try{let e=await p(o,d,t);e.success?(n(!1),u.oR.success("Artifact deleted.")):u.oR.error(e.error)}finally{c(!1)}};return(0,s.jsx)(f.J,{itemName:r||"this artifact",isSubmitting:a,onDelete:l})}function v(e){let{artifactComponentId:t,artifactComponentName:r}=e,[n,a]=(0,i.useState)(!1);return(0,s.jsxs)(l.lG,{open:n,onOpenChange:e=>{a(e)},children:[(0,s.jsxs)(h.rI,{children:[(0,s.jsx)(h.ty,{asChild:!0,children:(0,s.jsx)(d.$,{variant:"ghost",size:"icon-sm",className:" p-0 hover:bg-accent hover:text-accent-foreground rounded-sm -mr-2",children:(0,s.jsx)(c.A,{className:"h-4 w-4 text-muted-foreground"})})}),(0,s.jsx)(h.SQ,{align:"end",className:"w-48 shadow-lg border border-border bg-popover/95 backdrop-blur-sm",children:(0,s.jsx)(l.zM,{asChild:!0,children:(0,s.jsxs)(h._2,{className:"text-destructive hover:!bg-destructive/10 dark:hover:!bg-destructive/20 hover:!text-destructive cursor-pointer",children:[(0,s.jsx)(o.A,{className:"size-4 text-destructive"}),"Delete"]})})})]}),n&&(0,s.jsx)(j,{artifactComponentId:t,artifactComponentName:r,setIsOpen:a})]})}function b(e){let{id:t,name:r,description:c,createdAt:o,tenantId:i,projectId:d}=e,l="/".concat(i,"/projects/").concat(d,"/artifacts/").concat(t);return(0,s.jsxs)(a.uS,{children:[(0,s.jsxs)(a.f1,{children:[(0,s.jsx)(a.KK,{href:l,children:(0,s.jsx)(a.Kl,{className:"text-md",children:r})}),(0,s.jsx)(v,{artifactComponentId:t,artifactComponentName:r})]}),(0,s.jsxs)(a.h6,{children:[(0,s.jsx)(a.MM,{hasContent:!!c,className:"line-clamp-2",children:c||"No description"}),(0,s.jsx)(a.B7,{footerText:"Created ".concat((0,n.Yq)(o))})]})]})}},91148:(e,t,r)=>{Promise.resolve().then(r.bind(r,62658)),Promise.resolve().then(r.bind(r,1095)),Promise.resolve().then(r.bind(r,88831)),Promise.resolve().then(r.t.bind(r,85276,23))}},e=>{e.O(0,[1482,9425,2060,2811,1191,6118,8831,8197,9907,4918,7358],()=>e(e.s=91148)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6890],{3674:(e,t,a)=>{Promise.resolve().then(a.bind(a,95517)),Promise.resolve().then(a.bind(a,1095)),Promise.resolve().then(a.bind(a,88831)),Promise.resolve().then(a.t.bind(a,85276,23))},6040:(e,t,a)=>{"use strict";a.d(t,{i:()=>s});var r=a(97555);let s=(0,r.createServerReference)("7c1777c9b1125e1d2fa08c6bedb1091b9cb51e7e8b",r.callServer,void 0,r.findSourceMapURL,"fetchMCPTools")},9600:(e,t,a)=>{"use strict";a.d(t,{G:()=>o});var r=a(60098),s=a(31184),n=a(79178),l=a(86714),i=a(34186),d=a(35613);function o(e){let{control:t,name:a,label:o,description:c,keyPlaceholder:u="Key",valuePlaceholder:m="Value",examples:h=[]}=e,[p,x]=(0,n.useState)(""),[f,v]=(0,n.useState)("");return(0,r.jsx)(d.u,{control:t,name:a,label:o,children:e=>{let t=e.value||{},a=()=>{if(p.trim()&&f.trim()){let a={...t,[p.trim()]:f.trim()};e.onChange(a),x(""),v("")}},n=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("Enter"===e.key)if(e.preventDefault(),t)a();else{var r;let t=null==(r=e.currentTarget.parentElement)?void 0:r.querySelector("input:nth-child(2)");null==t||t.focus()}};return(0,r.jsxs)("div",{className:"space-y-3",children:[Object.entries(t).length>0&&(0,r.jsx)("div",{className:"space-y-2",children:Object.entries(t).map(a=>{let[n,i]=a;return(0,r.jsxs)("div",{className:"flex items-center gap-2 py-1.5 px-3 border rounded-md bg-muted/30",children:[(0,r.jsxs)("span",{className:"font-medium text-sm",children:[n,":"]}),(0,r.jsx)("span",{className:"text-sm text-muted-foreground flex-1",children:i}),(0,r.jsx)(l.$,{type:"button",variant:"ghost",size:"sm",onClick:()=>(a=>{let r={...t};delete r[a],e.onChange(r)})(n),className:"h-6 w-6 p-0 hover:bg-destructive/10 hover:text-destructive",children:(0,r.jsx)(s.A,{className:"h-4 w-4 opacity-50"})})]},n)})}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(i.p,{placeholder:u,value:p,onChange:e=>x(e.target.value),onKeyDown:e=>n(e,!1)}),(0,r.jsx)(i.p,{placeholder:m,value:f,onChange:e=>v(e.target.value),onKeyDown:e=>n(e,!0),onBlur:()=>{p.trim()&&f.trim()&&a()}})]}),(p.trim()||f.trim())&&(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:"Press Enter or click outside to add this entry"})]}),(c||h.length>0)&&(0,r.jsxs)("div",{className:"text-sm text-muted-foreground",children:[c&&(0,r.jsx)("p",{children:c}),h.length>0&&(0,r.jsxs)("p",{children:["Examples:"," ",h.map((e,t)=>(0,r.jsxs)("span",{children:[(0,r.jsx)("code",{className:"bg-muted px-1 py-0.5 rounded text-xs",children:e}),t<h.length-1&&", "]},e)),"."]})]})]})}})}},35190:(e,t,a)=>{"use strict";a.d(t,{U:()=>s});var r=a(97555);let s=(0,r.createServerReference)("70659eae90d1bfa2ff8a8444086465f66203467038",r.callServer,void 0,r.findSourceMapURL,"findOrCreateCredential")},49121:(e,t,a)=>{"use strict";a.d(t,{n:()=>s});var r=a(60098);function s(e){let{title:t,Icon:a,children:s}=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})]}),s]})}a(86714)},58514:(e,t,a)=>{"use strict";a.d(t,{U:()=>l});var r=a(60098),s=a(96182),n=a(35613);function l(e){let{control:t,name:a,label:l,placeholder:i,options:d,disabled:o=!1,selectTriggerClassName:c,isRequired:u=!1}=e;return(0,r.jsx)(n.u,{control:t,name:a,label:l,isRequired:u,children:e=>(0,r.jsxs)(s.l6,{onValueChange:e.onChange,defaultValue:e.value,disabled:o,children:[(0,r.jsx)(s.bq,{disabled:o,className:c,children:(0,r.jsx)(s.yv,{placeholder:i})}),(0,r.jsx)(s.gC,{children:d.map(e=>(0,r.jsx)(s.eb,{value:e.value,disabled:e.disabled,children:e.label},e.value))})]})})}},73033:(e,t,a)=>{"use strict";a.d(t,{Y:()=>s});var r=a(97555);let s=(0,r.createServerReference)("78ddcf4e8b9d881b043cc90552bd09b721c0df471d",r.callServer,void 0,r.findSourceMapURL,"updateMCPTool")},84661:(e,t,a)=>{"use strict";a.d(t,{S:()=>i});var r=a(60098),s=a(63433),n=a(27820),l=a(52681);function i(e){let{className:t,...a}=e;return(0,r.jsx)(s.bL,{"data-slot":"checkbox",className:(0,l.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)(s.C1,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:(0,r.jsx)(n.A,{className:"size-3.5"})})})}},95517:(e,t,a)=>{"use strict";a.d(t,{NewCredentialForm:()=>P});var r=a(60098),s=a(82886),n=a(7768),l=a(93137),i=a(32028),d=a(73033),o=a(97555);let c=(0,o.createServerReference)("40312a24a3e82e2d443667bc4a83821a0b41eee957",o.callServer,void 0,o.findSourceMapURL,"createNangoApiKeyConnection");var u=a(35190),m=a(36886),h=a(79178),p=a(95118),x=a(23574),f=a(9600),v=a(58514),b=a(86714),g=a(84661),j=a(86312),y=a(49121),N=a(6040),k=a(29583);let w=k.object({name:k.string().min(1,"Name is required").refine(e=>e.length>0,"Name cannot be empty after transformation").refine(e=>e.length<=50,"Name must be 50 characters or less"),apiKeyToSet:k.string().min(1,"Enter an API key"),metadata:k.record(k.string(),k.string()).default({}),selectedTool:k.string().optional()}),C={name:"",apiKeyToSet:"",metadata:{},selectedTool:void 0};function S(e){let{onCreateCredential:t,tenantId:a,projectId:s}=e,[n,l]=(0,h.useState)([]),[d,o]=(0,h.useState)(!0),[c,u]=(0,h.useState)(!1),k=(0,p.mN)({resolver:(0,m.u)(w),defaultValues:C}),{isSubmitting:S}=k.formState;(0,h.useEffect)(()=>{(async()=>{try{let e=(await (0,N.i)(a,s)).filter(e=>!e.credentialReferenceId);l(e)}catch(e){console.error("Failed to load MCP tools:",e)}finally{o(!1)}})()},[a,s]),(0,h.useEffect)(()=>{c||k.setValue("selectedTool",void 0)},[c,k]);let P=async e=>{try{if(c&&("loading"===e.selectedTool||"error"===e.selectedTool))return void(0,i.oR)("Please select a valid MCP server");await t(e)}catch(e){console.error("Failed to create credential:",e),(0,i.oR)(e instanceof Error?e.message:"Failed to create credential")}},T=(0,h.useMemo)(()=>[...d?[{value:"loading",label:"Loading MCP servers...",disabled:!0}]:[],...n.map(e=>({value:e.id,label:"".concat(e.name," - ").concat(e.config.mcp.server.url)}))],[n,d]);return(0,r.jsx)(j.lV,{...k,children:(0,r.jsxs)("form",{onSubmit:k.handleSubmit(P),className:"space-y-8",children:[(0,r.jsxs)("div",{className:"space-y-8",children:[(0,r.jsx)(x.a,{control:k.control,name:"name",label:"Name",placeholder:"e.g., production-api-key",isRequired:!0}),(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsx)(x.a,{control:k.control,name:"apiKeyToSet",label:"API key",placeholder:"e.g., sk-1234567890abcdef1234567890abcdef",isRequired:!0}),(0,r.jsxs)(y.n,{title:"How this works",children:[(0,r.jsx)("p",{children:"When your agent connects to the MCP server, this API key will be automatically sent as an authentication header:"}),(0,r.jsx)("p",{className:"my-2",children:(0,r.jsx)("code",{className:"bg-background px-1.5 py-0.5 rounded border",children:"Authorization: Bearer your-api-key-here"})}),(0,r.jsx)("p",{children:"This ensures secure access to the server's tools and data."})]})]}),(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsx)(f.G,{control:k.control,name:"metadata",label:"Metadata (optional)",keyPlaceholder:"Header name (e.g., X-API-Key)",valuePlaceholder:"Header value"}),(0,r.jsxs)(y.n,{title:"Additional headers",children:[(0,r.jsx)("p",{className:"mb-2",children:"Add extra headers to be included with authentication requests."}),(0,r.jsxs)("p",{children:["Examples:"," ",(0,r.jsx)("code",{className:"bg-background px-1.5 py-0.5 rounded border mx-1",children:"User-Agent"}),(0,r.jsx)("code",{className:"bg-background px-1.5 py-0.5 rounded border mx-1",children:"X-API-Key"}),(0,r.jsx)("code",{className:"bg-background px-1.5 py-0.5 rounded border mx-1",children:"Content-Type"})]})]})]}),n.length>0&&(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{className:"flex items-center space-x-3 relative",children:[(0,r.jsx)(g.S,{id:"linkToServer",checked:c,onCheckedChange:e=>{u(!0===e)}}),(0,r.jsx)("label",{htmlFor:"linkToServer",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Link this credential to an MCP server"})]}),c&&(0,r.jsx)(v.U,{control:k.control,name:"selectedTool",label:"",options:T,selectTriggerClassName:"w-full",placeholder:"Choose an MCP server"})]})]}),(0,r.jsx)("div",{className:"flex gap-3 pt-4",children:(0,r.jsx)(b.$,{type:"submit",disabled:S,children:S?"Creating...":"Create Credential"})})]})})}function P(){let e=(0,l.useRouter)(),{tenantId:t,projectId:a}=(0,l.useParams)(),o=async r=>{try{let l=(0,s.K_)(r.name.trim()),{integration:o}=await c({name:l,apiKeyToSet:r.apiKeyToSet,metadata:r.metadata}),m=await (0,u.U)(t,a,{id:l,type:n.Ns.nango,credentialStoreId:"nango-default",retrievalParams:{connectionId:l,providerConfigKey:o.unique_key,provider:o.provider,authMode:"API_KEY"}});if(r.selectedTool&&m){let e={credentialReferenceId:m.id};await (0,d.Y)(t,a,r.selectedTool,e)}i.oR.success("Credential created successfully"),e.push("/".concat(t,"/projects/").concat(a,"/credentials"))}catch(e){console.error("Failed to create credential:",e),i.oR.error("Failed to create credential. Please try again.")}};return(0,r.jsx)(S,{onCreateCredential:o,tenantId:t,projectId:a})}},96182:(e,t,a)=>{"use strict";a.d(t,{bq:()=>u,eb:()=>h,gC:()=>m,l6:()=>o,yv:()=>c});var r=a(60098),s=a(54651),n=a(6826),l=a(27820),i=a(5879),d=a(52681);function o(e){let{...t}=e;return(0,r.jsx)(s.bL,{"data-slot":"select",...t})}function c(e){let{...t}=e;return(0,r.jsx)(s.WT,{"data-slot":"select-value",...t})}function u(e){let{className:t,size:a="default",children:l,...i}=e;return(0,r.jsxs)(s.l9,{"data-slot":"select-trigger","data-size":a,className:(0,d.cn)("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]: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 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 font-normal normal-case",t),...i,children:[l,(0,r.jsx)(s.In,{asChild:!0,children:(0,r.jsx)(n.A,{className:"size-4 opacity-50"})})]})}function m(e){let{className:t,children:a,position:n="popper",...l}=e;return(0,r.jsx)(s.ZL,{children:(0,r.jsxs)(s.UC,{"data-slot":"select-content",className:(0,d.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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto scrollbar-thin scrollbar-thumb-muted-foreground/30 dark:scrollbar-thumb-muted-foreground/50 scrollbar-track-transparent rounded-md border shadow-md","popper"===n&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:n,...l,children:[(0,r.jsx)(p,{}),(0,r.jsx)(s.LM,{className:(0,d.cn)("p-1","popper"===n&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:a}),(0,r.jsx)(x,{})]})})}function h(e){let{className:t,children:a,...n}=e;return(0,r.jsxs)(s.q7,{"data-slot":"select-item",className:(0,d.cn)("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...n,children:[(0,r.jsx)("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:(0,r.jsx)(s.VF,{children:(0,r.jsx)(l.A,{className:"size-4"})})}),(0,r.jsx)(s.p4,{children:a})]})}function p(e){let{className:t,...a}=e;return(0,r.jsx)(s.PP,{"data-slot":"select-scroll-up-button",className:(0,d.cn)("flex cursor-default items-center justify-center py-1",t),...a,children:(0,r.jsx)(i.A,{className:"size-4"})})}function x(e){let{className:t,...a}=e;return(0,r.jsx)(s.wn,{"data-slot":"select-scroll-down-button",className:(0,d.cn)("flex cursor-default items-center justify-center py-1",t),...a,children:(0,r.jsx)(n.A,{className:"size-4"})})}}},e=>{e.O(0,[1482,9425,2060,2597,8096,2811,1216,102,6419,2334,8831,6497,9907,4918,7358],()=>e(e.s=3674)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7156],{15660:(e,t,r)=>{"use strict";r.d(t,{RuntimeConfigProvider:()=>l,y:()=>o});var a=r(60098),n=r(79178);let i=(0,n.createContext)(null);function l(e){let{value:t,children:r}=e;return(0,a.jsx)(i.Provider,{value:t,children:r})}function o(){let e=(0,n.useContext)(i);if(!e)throw Error("useRuntimeConfig must be used within <RuntimeConfigProvider>");return e}},35190:(e,t,r)=>{"use strict";r.d(t,{U:()=>n});var a=r(97555);let n=(0,a.createServerReference)("70659eae90d1bfa2ff8a8444086465f66203467038",a.callServer,void 0,a.findSourceMapURL,"findOrCreateCredential")},41392:(e,t,r)=>{"use strict";r.d(t,{K:()=>l});var a=r(60098),n=r(86772),i=r(35613);function l(e){let{control:t,name:r,label:l,placeholder:o,className:s,disabled:c,readOnly:d,isRequired:u=!1}=e;return(0,a.jsx)(i.u,{control:t,name:r,label:l,isRequired:u,children:e=>(0,a.jsx)(n.T,{placeholder:o,className:s,...e,readOnly:d,disabled:c})})}},42503:(e,t,r)=>{"use strict";r.d(t,{r:()=>l});var a=r(60098),n=r(27764),i=r(79178);function l(e){let{provider:t,fallback:r=!1,className:l,size:o=20}=e,[s,c]=(0,i.useState)(!1),[d,u]=(0,i.useState)(!1),p=(e=>{let t=e.toLowerCase().replace(/[^a-z0-9-]/g,"-");return"/assets/provider-icons/".concat(t,".svg")})(t);return(0,a.jsxs)("div",{className:"inline-flex items-center justify-center relative ".concat(l||""),style:{width:o,height:o},children:[d&&(0,a.jsx)("div",{className:"absolute",children:r||((e,t)=>{let r=e.charAt(0),n=Math.max(8,Math.floor(.6*("string"==typeof t?Number.parseInt(t,10)||20:t)));return(0,a.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:r})})(t,o)}),(0,a.jsx)(n.default,{src:p,alt:"".concat(t," icon"),width:"string"==typeof o?Number.parseInt(o,10)||20:o,height:"string"==typeof o?Number.parseInt(o,10)||20:o,onLoad:()=>{c(!0)},onError:()=>{u(!0)},style:{maxWidth:"100%",maxHeight:"100%",opacity:s&&!d?1:0},unoptimized:!0},t)]})}},52800:(e,t,r)=>{Promise.resolve().then(r.bind(r,85069))},70971:(e,t,r)=>{"use strict";r.d(t,{H:()=>c});var a=r(60098);function n(e){let{children:t}=e;return(0,a.jsx)("div",{className:"flex flex-1 flex-col overflow-y-auto scrollbar-thin scrollbar-thumb-muted-foreground/30 dark:scrollbar-thumb-muted-foreground/50 scrollbar-track-transparent h-full w-full min-h-0 bg-muted/20 dark:bg-background",children:(0,a.jsx)("div",{className:"@container/main min-h-0 flex flex-1 flex-col",children:t})})}var i=r(91096),l=r(1095),o=r(88831);function s(e){let{breadcrumbs:t}=e;return(0,a.jsx)("header",{className:"flex h-(--header-height) shrink-0 items-center gap-2 border-b transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-(--header-height) bg-muted/20 dark:bg-background rounded-t-[14px]",children:(0,a.jsxs)("div",{className:"flex w-full items-center gap-1 px-4 lg:gap-2 lg:px-6",children:[(0,a.jsx)(o.SidebarTrigger,{className:"-ml-1 text-muted-foreground hover:text-foreground hover:bg-accent dark:text-muted-foreground dark:hover:text-foreground dark:hover:bg-accent/50"}),(0,a.jsx)(l.Separator,{orientation:"vertical",className:"mx-2 data-[orientation=vertical]:h-4"}),(0,a.jsx)("div",{className:"flex flex-col gap-0.5",children:t&&t.length>0&&(0,a.jsx)(i.B,{items:t})})]})})}function c(e){let{children:t,breadcrumbs:r}=e;return(0,a.jsxs)("div",{className:"h-[calc(100vh-16px)] flex flex-col overflow-hidden",children:[(0,a.jsx)(s,{breadcrumbs:r}),(0,a.jsx)(n,{children:t})]})}},74989:(e,t,r)=>{"use strict";r.d(t,{D:()=>l});var a=r(60098),n=r(79178),i=r(52681);let l=(0,n.forwardRef)((e,t)=>{let{children:r,className:n,...l}=e;return(0,a.jsx)("div",{ref:t,className:(0,i.cn)("p-6",n),...l,children:r})});l.displayName="MainContent"},85069:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>T});var a=r(60098),n=r(82886),i=r(93137),l=r(79178),o=r(32028);let s={client_id:{key:"client_id",label:"Client ID",type:"text",component:"input",placeholder:"Enter your OAuth client ID",required:!0},client_secret:{key:"client_secret",label:"Client Secret",type:"password",component:"input",placeholder:"Enter your OAuth client secret",required:!0},scopes:{key:"scopes",label:"Scopes",type:"textarea",component:"textarea",placeholder:"Enter required scopes (space or comma separated)",helpText:"Leave empty to use default scopes for this provider",required:!1},app_id:{key:"app_id",label:"App ID",type:"text",component:"input",placeholder:"Enter your app ID",required:!0},app_link:{key:"app_link",label:"App Link",type:"url",component:"input",placeholder:"https://example.com/app",helpText:"The URL where your app is hosted or registered",required:!0,validate:e=>{if(e.trim())try{let t=new URL(e.trim());if(!["http:","https:"].includes(t.protocol))return"Only HTTP and HTTPS URLs are allowed";return}catch(e){return"Please enter a valid URL"}}},private_key:{key:"private_key",label:"Private Key",type:"textarea",component:"textarea",placeholder:"-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----",helpText:"Your app's private key for authentication",required:!0}},c={oauth:{title:"OAuth Credentials",description:"You'll need to create an OAuth application in the provider's developer console to get these credentials.",fields:[s.client_id,s.client_secret,s.scopes]},app:{title:"App Credentials",description:"You'll need to create an app in the provider's developer portal to get these credentials.",fields:[s.app_id,s.app_link,s.private_key]},oauthMinimal:{title:"OAuth Credentials",fields:[s.client_id,s.client_secret]},appMinimal:{title:"App Credentials",fields:[s.app_id,s.app_link,s.private_key]}},d={OAUTH1:{authMode:"OAUTH1",sections:[c.oauth]},OAUTH2:{authMode:"OAUTH2",sections:[c.oauth]},TBA:{authMode:"TBA",sections:[{title:"Authentication Credentials",description:"You'll need to create an application in the provider's developer console to get these credentials.",fields:[s.client_id,s.client_secret,s.scopes]}]},APP:{authMode:"APP",sections:[c.app]},CUSTOM:{authMode:"CUSTOM",sections:[c.oauthMinimal,c.appMinimal]}};var u=r(36886),p=r(95118),h=r(29583),m=r(23574),f=r(41392),x=r(42503),v=r(86714),g=r(86312);function b(e){let{provider:t,onBack:r,onSubmit:n,loading:i=!1}=e,l=d[t.auth_mode]||null,o=(null==l?void 0:l.sections.flatMap(e=>e.fields))||[],s=l?function(e){let t=e.sections.flatMap(e=>e.fields),r={};for(let e of t){let t=h.string();e.validate&&(t=t.refine(t=>{let r=String(t||"");return!r&&!e.required||!(e.validate?e.validate(r):void 0)},{message:"Invalid ".concat(e.label.toLowerCase())})),t=e.required?h.string().min(1,"".concat(e.label," is required")):h.string().optional().or(h.literal("")),r[e.key]=t}return h.object(r)}(l):h.object({_placeholder:h.string().optional()}),c=Object.fromEntries(o.map(e=>[e.key,""])),b=(0,p.mN)({resolver:l?(0,u.u)(s):void 0,defaultValues:c});if(!l)return(0,a.jsx)("div",{className:"space-y-6",children:(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[(0,a.jsx)(v.$,{variant:"outline",onClick:r,children:"← Back"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-2xl font-bold",children:"Configuration Not Available"}),(0,a.jsxs)("p",{className:"text-muted-foreground",children:["No configuration form is available for ",t.auth_mode," authentication mode."]})]})]})});let y=e=>{let t="private_key"===e.key,r="".concat(e.label).concat(e.required?" *":"");return"textarea"===e.component?(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(f.K,{control:b.control,name:e.key,label:r,placeholder:e.placeholder,className:t?"font-mono text-sm min-h-[120px]":"min-h-[80px]"}),e.helpText&&(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:e.helpText})]},e.key):(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(m.a,{control:b.control,name:e.key,label:r,type:e.type,placeholder:e.placeholder,disabled:i}),e.helpText&&(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:e.helpText})]},e.key)};return(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsx)("div",{className:"flex items-center gap-4",children:(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)(x.r,{provider:t.name,size:24}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("h1",{className:"text-lg font-medium",children:["Setup ",t.display_name||t.name]}),(0,a.jsx)("p",{className:"text-muted-foreground",children:"Complete the required fields to set up this credential."})]})]})}),(0,a.jsx)(g.lV,{...b,children:(0,a.jsxs)("form",{onSubmit:b.handleSubmit(e=>{let t={};for(let[r,a]of Object.entries(e)){let e=null==a?void 0:a.toString().trim();e&&(t[r]=e)}n(t)}),className:"space-y-6",children:[l.sections.map((e,t)=>(0,a.jsxs)("div",{className:"space-y-4",children:[e.title&&(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-lg font-medium",children:e.title}),e.description&&(0,a.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:e.description})]}),e.fields.map(y)]},t)),(0,a.jsxs)("div",{className:"flex gap-3 pt-4",children:[(0,a.jsx)(v.$,{type:"submit",disabled:i,children:i?"Creating Credential...":"Create Credential"}),(0,a.jsx)(v.$,{type:"button",variant:"outline",onClick:r,disabled:i,children:"Cancel"})]})]})})]})}var y=r(70971),j=r(74989),N=r(51695),k=r(15660),C=r(97555);let _=(0,C.createServerReference)("00cfec6e0f89d9cf3345842351df20579fd6c54942",C.callServer,void 0,C.findSourceMapURL,"fetchNangoProviders"),w=(0,C.createServerReference)("4071249c3ac158cafa4b714efbced893f82691a6b6",C.callServer,void 0,C.findSourceMapURL,"createProviderConnectSession");class S extends Error{constructor(e,t,r){super(e),this.operation=t,this.cause=r,this.name="NangoError"}}var R=r(35190);let T=function(e){let{params:t}=e,r=(0,i.useRouter)(),{providers:s,loading:c}=function(){let[e,t]=(0,l.useState)(null),[r,a]=(0,l.useState)(!0),[n,i]=(0,l.useState)(null);return(0,l.useEffect)(()=>{!async function(){try{a(!0),i(null);let e=await _();t(e)}catch(e){i(e instanceof Error?e.message:"Failed to load providers"),t([])}finally{a(!1)}}()},[]),{providers:e,loading:r,error:n}}(),[u,p]=(0,l.useState)(!1),[h,m]=(0,l.useState)(!1),f=function(){let{NANGO_SERVER_URL:e,NANGO_CONNECT_BASE_URL:t}=(0,k.y)();return(0,l.useCallback)(r=>{let{sessionToken:a,onEvent:n,connectOptions:i}=r,l=new N.Ay({host:e||void 0}).openConnectUI({baseURL:(null==i?void 0:i.baseURL)||t||void 0,apiURL:(null==i?void 0:i.apiURL)||e||void 0,onEvent:n,detectClosedAuthWindow:!0});return l.setSessionToken(a),l},[e,t])}(),{providerId:x,tenantId:g,projectId:C}=(0,l.use)(t),T=null==s?void 0:s.find(e=>encodeURIComponent(e.name)===x),E=(0,l.useCallback)(async e=>{var t,a,i;if(!T||"connect"!==e.type)return;if(!(null==(t=e.payload)?void 0:t.connectionId)||!(null==(a=e.payload)?void 0:a.providerConfigKey)){console.error("Missing required connection data:",e.payload),o.oR.error("Invalid connection data received");return}let l=(0,n.K_)("".concat(T.name,"-").concat(e.payload.connectionId));try{await (0,R.U)(g,C,{id:l,type:n.Ns.nango,credentialStoreId:"nango-default",retrievalParams:{connectionId:e.payload.connectionId,providerConfigKey:e.payload.providerConfigKey,provider:T.name,authMode:T.auth_mode}}),o.oR.success("Credential created successfully"),r.push("/".concat(g,"/projects/").concat(C,"/credentials"))}catch(e){console.error("Failed to create credential record:",e),e instanceof Error&&(null==(i=e.message)?void 0:i.includes("database"))?o.oR.error("Failed to save credential. Please check your connection and try again."):o.oR.error("Failed to save credential. Please try again.")}},[T,g,C,r]),P=(0,l.useCallback)(async e=>{if(T){p(!0),m(!0);try{let t=await w({providerName:T.name,credentials:e&&T.auth_mode?{...e,type:T.auth_mode}:void 0});f({sessionToken:t,onEvent:E})}catch(e){var t;console.error("Failed to create credential:",e),e instanceof S?"createConnectSession"===e.operation?o.oR.error("Failed to start authentication flow. Please try again."):o.oR.error("Service temporarily unavailable. Please try again later."):e instanceof Error&&(null==(t=e.message)?void 0:t.includes("NANGO_SECRET_KEY"))?o.oR.error("Configuration error. Please contact support."):o.oR.error("Failed to create credential. Please try again.")}finally{p(!1)}}},[T,f,E]);(0,l.useEffect)(()=>{!T||T.auth_mode in d||u||h||P()},[T,u,h,P]);let A=()=>{r.push("/".concat(g,"/projects/").concat(C,"/credentials/new/providers"))};return c?(0,a.jsx)("div",{className:"flex items-center justify-center h-64",children:"Loading provider..."}):T?T.auth_mode in d?(0,a.jsx)(y.H,{breadcrumbs:[{label:"Credentials",href:"/".concat(g,"/projects/").concat(C,"/credentials")},{label:"New credential",href:"/".concat(g,"/projects/").concat(C,"/credentials/new")},{label:"Providers",href:"/".concat(g,"/projects/").concat(C,"/credentials/new/providers")},{label:T.display_name}],children:(0,a.jsx)(j.D,{children:(0,a.jsx)("div",{className:"max-w-2xl mx-auto py-4",children:(0,a.jsx)(b,{provider:T,onBack:A,onSubmit:P,loading:u})})})}):(0,a.jsx)("div",{className:"flex items-center justify-center h-64",children:(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center space-y-4",children:[(0,a.jsxs)("h2",{className:"text-xl font-semibold",children:["Connecting to ",T.name,"..."]}),(0,a.jsxs)("p",{className:"text-muted-foreground",children:["Please wait while we connect to ",T.name,"..."]}),(0,a.jsx)(v.$,{onClick:A,children:"Back to providers"})]})}):(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center h-64 space-y-4",children:[(0,a.jsx)("h2",{className:"text-xl font-semibold",children:"Provider not found"}),(0,a.jsxs)("p",{className:"text-muted-foreground",children:['The provider "',decodeURIComponent(x),'" was not found.']}),(0,a.jsx)("button",{type:"button",onClick:A,className:"text-primary hover:underline",children:"← Back to providers"})]})}},86772:(e,t,r)=>{"use strict";r.d(t,{T:()=>i});var a=r(60098),n=r(52681);function i(e){let{className:t,...r}=e;return(0,a.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),...r})}},91096:(e,t,r)=>{"use strict";r.d(t,{B:()=>l});var a=r(60098),n=r(85276),i=r.n(n);function l(e){let{items:t}=e;return(null==t?void 0:t.length)?(0,a.jsx)("nav",{className:"text-sm text-muted-foreground","aria-label":"Breadcrumb",children:(0,a.jsx)("ol",{className:"flex items-center gap-2",children:t.map((e,r)=>{let n=r===t.length-1;return(0,a.jsxs)("li",{className:"flex items-center gap-2",children:[e.href&&!n?(0,a.jsx)(i(),{href:e.href,className:"hover:text-foreground",children:e.label}):(0,a.jsx)("span",{className:n?"font-medium text-foreground":"",children:e.label}),!n&&(0,a.jsx)("span",{className:"text-muted-foreground/60",children:"›"})]},"".concat(e.label,"-").concat(r))})})}):null}}},e=>{e.O(0,[1482,9425,2060,2597,8096,1216,7764,6419,645,8831,6497,9907,4918,7358],()=>e(e.s=52800)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2735],{42503:(e,t,r)=>{"use strict";r.d(t,{r:()=>i});var s=r(60098),a=r(27764),n=r(79178);function i(e){let{provider:t,fallback:r=!1,className:i,size:c=20}=e,[d,l]=(0,n.useState)(!1),[o,h]=(0,n.useState)(!1),u=(e=>{let t=e.toLowerCase().replace(/[^a-z0-9-]/g,"-");return"/assets/provider-icons/".concat(t,".svg")})(t);return(0,s.jsxs)("div",{className:"inline-flex items-center justify-center relative ".concat(i||""),style:{width:c,height:c},children:[o&&(0,s.jsx)("div",{className:"absolute",children:r||((e,t)=>{let r=e.charAt(0),a=Math.max(8,Math.floor(.6*("string"==typeof t?Number.parseInt(t,10)||20:t)));return(0,s.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(a,"px"),lineHeight:1},children:r})})(t,c)}),(0,s.jsx)(a.default,{src:u,alt:"".concat(t," icon"),width:"string"==typeof c?Number.parseInt(c,10)||20:c,height:"string"==typeof c?Number.parseInt(c,10)||20:c,onLoad:()=>{l(!0)},onError:()=>{h(!0)},style:{maxWidth:"100%",maxHeight:"100%",opacity:d&&!o?1:0},unoptimized:!0},t)]})}},43383:(e,t,r)=>{"use strict";r.d(t,{CredentialItem:()=>p});var s=r(60098),a=r(30836),n=r(21341),i=r(93137),c=r(79178),d=r(32028),l=r(51332),o=r(86714),h=r(30958),u=r(80311),m=r(80986),x=r(97555);let f=(0,x.createServerReference)("7064df42bc07f0103af41a3180ad8b7c2aed5afdab",x.callServer,void 0,x.findSourceMapURL,"deleteCredentialAction");var v=r(42503),j=r(90035);function g(e){let{credentialId:t,credentialName:r}=e,{tenantId:l,projectId:m}=(0,i.useParams)(),[x,v]=(0,c.useState)(!1),[g,p]=(0,c.useState)(!1),b=async()=>{p(!0);try{let e=await f(l,m,t);e.success?(v(!1),d.oR.success("Credential deleted.")):d.oR.error(e.error)}finally{p(!1)}};return(0,s.jsxs)(h.lG,{open:x,onOpenChange:e=>{v(e)},children:[(0,s.jsxs)(u.rI,{children:[(0,s.jsx)(u.ty,{asChild:!0,children:(0,s.jsx)(o.$,{variant:"ghost",size:"icon-sm",className:" p-0 hover:bg-accent hover:text-accent-foreground rounded-sm -mr-2",children:(0,s.jsx)(a.A,{className:"h-4 w-4 text-muted-foreground"})})}),(0,s.jsx)(u.SQ,{align:"end",className:"w-48 shadow-lg border border-border bg-popover/95 backdrop-blur-sm",children:(0,s.jsx)(h.zM,{asChild:!0,children:(0,s.jsxs)(u._2,{className:"text-destructive hover:!bg-destructive/10 dark:hover:!bg-destructive/20 hover:!text-destructive cursor-pointer",children:[(0,s.jsx)(n.A,{className:"size-4 text-destructive"}),"Delete"]})})})]}),x&&(0,s.jsx)(j.J,{itemName:r||"this credential",isSubmitting:g,onDelete:b})]})}function p(e){let{id:t,createdAt:r,tenantId:a,projectId:n,providerForIcon:i}=e,c="/".concat(a,"/projects/").concat(n,"/credentials/").concat(t);return(0,s.jsxs)(m.uS,{children:[(0,s.jsxs)(m.f1,{children:[(0,s.jsx)(m.KK,{href:c,children:(0,s.jsx)(m.Kl,{className:"text-md",children:(0,s.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,s.jsx)(v.r,{provider:i,size:24,className:"flex-shrink-0"}),(0,s.jsx)("span",{className:"truncate",children:t})]})})}),(0,s.jsx)(g,{credentialId:t,credentialName:t})]}),(0,s.jsx)(m.h6,{children:(0,s.jsx)(m.B7,{footerText:"Created ".concat((0,l.Yq)(r))})})]})}},76720:(e,t,r)=>{Promise.resolve().then(r.bind(r,43383)),Promise.resolve().then(r.bind(r,1095)),Promise.resolve().then(r.bind(r,88831)),Promise.resolve().then(r.t.bind(r,85276,23))}},e=>{e.O(0,[1482,9425,2060,2811,1191,7764,880,8831,8197,9907,4918,7358],()=>e(e.s=76720)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8474],{4377:(e,r,s)=>{Promise.resolve().then(s.bind(s,53163)),Promise.resolve().then(s.bind(s,1095)),Promise.resolve().then(s.bind(s,88831)),Promise.resolve().then(s.t.bind(s,85276,23))},53163:(e,r,s)=>{"use strict";s.d(r,{GraphItem:()=>v});var t=s(60098),n=s(51332),c=s(80986),a=s(30836),o=s(21341),d=s(79178),i=s(86714),l=s(30958),h=s(80311),u=s(93137),x=s(32028),m=s(90035),p=s(97555);let f=(0,p.createServerReference)("70f9dfdb998d5ff702fd3de8709c6b6166bff5f71b",p.callServer,void 0,p.findSourceMapURL,"deleteFullGraphAction");function b(e){let{graphId:r,graphName:s,setIsOpen:n}=e,{tenantId:c,projectId:a}=(0,u.useParams)(),[o,i]=(0,d.useState)(!1),l=async()=>{i(!0);try{let e=await f(c,a,r);e.success?(x.oR.success("Graph deleted."),n(!1)):x.oR.error(e.error)}finally{i(!1)}};return(0,t.jsx)(m.J,{itemName:s||"this graph",isSubmitting:o,onDelete:l})}function j(e){let{graphId:r,graphName:s}=e,[n,c]=(0,d.useState)(!1);return(0,t.jsxs)(l.lG,{open:n,onOpenChange:e=>{c(e)},children:[(0,t.jsxs)(h.rI,{children:[(0,t.jsx)(h.ty,{asChild:!0,children:(0,t.jsx)(i.$,{variant:"ghost",size:"icon-sm",className:" p-0 hover:bg-accent hover:text-accent-foreground rounded-sm -mr-2",children:(0,t.jsx)(a.A,{className:"h-4 w-4 text-muted-foreground"})})}),(0,t.jsx)(h.SQ,{align:"end",className:"w-48 shadow-lg border border-border bg-popover/95 backdrop-blur-sm",children:(0,t.jsx)(l.zM,{asChild:!0,children:(0,t.jsxs)(h._2,{className:"text-destructive hover:!bg-destructive/10 dark:hover:!bg-destructive/20 hover:!text-destructive cursor-pointer",children:[(0,t.jsx)(o.A,{className:"size-4 text-destructive"}),"Delete"]})})})]}),n&&(0,t.jsx)(b,{graphId:r,graphName:s,setIsOpen:c})]})}function v(e){let{id:r,name:s,description:a,createdAt:o,tenantId:d,projectId:i}=e,l="/".concat(d,"/projects/").concat(i,"/graphs/").concat(r);return(0,t.jsxs)(c.uS,{children:[(0,t.jsxs)(c.f1,{children:[(0,t.jsx)(c.KK,{href:l,children:(0,t.jsx)(c.Kl,{className:"text-sm",children:s})}),(0,t.jsx)(j,{graphId:r,graphName:s})]}),(0,t.jsxs)(c.h6,{children:[(0,t.jsx)(c.MM,{hasContent:!!a,children:a||"No description"}),(0,t.jsx)(c.B7,{footerText:"Created ".concat((0,n.Yq)(o))})]})]})}}},e=>{e.O(0,[1482,9425,2060,2811,1191,8499,8831,8197,9907,4918,7358],()=>e(e.s=4377)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3136],{30494:(e,r,t)=>{"use strict";t.d(r,{MCPToolsList:()=>T});var s=t(60098),a=t(93137),n=t(30836),o=t(21341),d=t(79178),i=t(32028),l=t(66894),c=t(51332),u=t(86714),m=t(30958),x=t(80311),g=t(80986),b=t(97555);let h=(0,b.createServerReference)("705b9f9bb37b66cfbdaddb38783f05d2e7767896fb",b.callServer,void 0,b.findSourceMapURL,"deleteToolAction");var v=t(77186),p=t(39475),f=t(67696),j=t(90035),y=t(31011),k=t(77064);function N(e){let{url:r}=e;return(0,s.jsxs)(y.Tooltip,{children:[(0,s.jsx)(y.TooltipTrigger,{asChild:!0,children:(0,s.jsx)("div",{className:"rounded py-1 min-w-0",children:(0,s.jsx)("code",{className:"text-sm text-muted-foreground block truncate",children:r})})}),(0,s.jsx)(y.TooltipContent,{side:"bottom",align:"start",className:"max-w-md",children:(0,s.jsx)("code",{className:"text-xs break-all",children:r})})]})}function w(e){let{toolId:r,toolName:t}=e,{tenantId:l,projectId:c}=(0,a.useParams)(),[g,b]=(0,d.useState)(!1),[v,p]=(0,d.useState)(!1),f=async()=>{p(!0);try{(await h(l,c,r)).success?(b(!1),i.oR.success("MCP server deleted.")):i.oR.error("Failed to delete MCP server.")}finally{p(!1)}};return(0,s.jsxs)(m.lG,{open:g,onOpenChange:e=>{b(e)},children:[(0,s.jsxs)(x.rI,{children:[(0,s.jsx)(x.ty,{asChild:!0,children:(0,s.jsx)(u.$,{variant:"ghost",size:"icon-sm",className:" p-0 hover:bg-accent hover:text-accent-foreground rounded-sm -mr-2",children:(0,s.jsx)(n.A,{className:"h-4 w-4 text-muted-foreground"})})}),(0,s.jsx)(x.SQ,{align:"end",className:"w-48 shadow-lg border border-border bg-popover/95 backdrop-blur-sm",children:(0,s.jsx)(m.zM,{asChild:!0,children:(0,s.jsxs)(x._2,{className:"text-destructive hover:!bg-destructive/10 dark:hover:!bg-destructive/20 hover:!text-destructive cursor-pointer",children:[(0,s.jsx)(o.A,{className:"size-4 text-destructive"}),"Delete"]})})})]}),g&&(0,s.jsx)(j.J,{itemName:t||"this MCP server",isSubmitting:v,onDelete:f})]})}function S(e){var r,t,a;let{tenantId:n,projectId:o,tool:d}=e,i="/".concat(n,"/projects/").concat(o,"/mcp-servers/").concat(d.id),u=(0,l.O)({availableTools:d.availableTools,activeTools:null==(t=d.config)||null==(r=t.mcp)?void 0:r.activeTools});return(0,s.jsxs)(g.uS,{children:[(0,s.jsxs)(g.f1,{children:[(0,s.jsx)(g.KK,{href:i,children:(0,s.jsx)(g.Kl,{className:"text-md",children:(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)(k.u,{imageUrl:d.imageUrl,name:d.name,provider:(0,v.T)(d).type,size:24,className:"mt-0.5 flex-shrink-0"}),(0,s.jsx)("div",{className:"flex-1 min-w-0",children:(0,s.jsx)(f.ZB,{className:"text-base truncate font-medium",children:(0,v.T)(d).name||d.name})})]})})}),(0,s.jsx)(w,{toolId:d.id,toolName:d.name})]}),(0,s.jsxs)(g.h6,{children:[(0,s.jsxs)("div",{className:"space-y-3 min-w-0",children:[(0,s.jsx)(N,{url:d.config.mcp.server.url}),(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[("unhealthy"===d.status||"unknown"===d.status)&&(0,s.jsx)(p.E,{variant:"error",children:d.status}),"healthy"===d.status&&(0,s.jsx)(p.E,{variant:"success",children:d.status}),"needs_auth"===d.status&&(0,s.jsx)("div",{className:"flex items-center gap-2",children:(0,s.jsx)(p.E,{variant:"warning",children:"Needs Login"})}),(0,s.jsxs)(p.E,{variant:"code",className:"uppercase bg-transparent",children:[null!=(a=null==u?void 0:u.length)?a:0," Active tool",(null==u?void 0:u.length)!==1?"s":""]})]})]}),(0,s.jsx)(g.B7,{footerText:"Created ".concat((0,c.Yq)("string"==typeof d.createdAt?d.createdAt:d.createdAt.toISOString()))})]})]})}function T(e){let{tools:r}=e,{tenantId:t,projectId:n}=(0,a.useParams)();return(0,s.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3 md:gap-4",children:null==r?void 0:r.map(e=>(0,s.jsx)(S,{tenantId:t,projectId:n,tool:e},e.id))})}},39475:(e,r,t)=>{"use strict";t.d(r,{E:()=>i});var s=t(60098),a=t(27968),n=t(15625),o=t(52681);let d=(0,n.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 i(e){let{className:r,variant:t,asChild:n=!1,...i}=e,l=n?a.DX:"span";return(0,s.jsx)(l,{"data-slot":"badge",className:(0,o.cn)(d({variant:t}),r),...i})}},42503:(e,r,t)=>{"use strict";t.d(r,{r:()=>o});var s=t(60098),a=t(27764),n=t(79178);function o(e){let{provider:r,fallback:t=!1,className:o,size:d=20}=e,[i,l]=(0,n.useState)(!1),[c,u]=(0,n.useState)(!1),m=(e=>{let r=e.toLowerCase().replace(/[^a-z0-9-]/g,"-");return"/assets/provider-icons/".concat(r,".svg")})(r);return(0,s.jsxs)("div",{className:"inline-flex items-center justify-center relative ".concat(o||""),style:{width:d,height:d},children:[c&&(0,s.jsx)("div",{className:"absolute",children:t||((e,r)=>{let t=e.charAt(0),a=Math.max(8,Math.floor(.6*("string"==typeof r?Number.parseInt(r,10)||20:r)));return(0,s.jsx)("div",{className:"rounded-sm bg-gray-100 dark:bg-muted/50 text-muted-foreground font-medium flex items-center justify-center",style:{width:r,height:r,fontSize:"".concat(a,"px"),lineHeight:1},children:t})})(r,d)}),(0,s.jsx)(a.default,{src:m,alt:"".concat(r," icon"),width:"string"==typeof d?Number.parseInt(d,10)||20:d,height:"string"==typeof d?Number.parseInt(d,10)||20:d,onLoad:()=>{l(!0)},onError:()=>{u(!0)},style:{maxWidth:"100%",maxHeight:"100%",opacity:i&&!c?1:0},unoptimized:!0},r)]})}},66894:(e,r,t)=>{"use strict";function s(e){let{availableTools:r,activeTools:t}=e;if(r)return t?r.filter(e=>t.includes(e.name)):r}t.d(r,{O:()=>s})},77064:(e,r,t)=>{"use strict";t.d(r,{u:()=>l});var s=t(60098),a=t(4778),n=t(27764),o=t(79178),d=t(52681),i=t(42503);function l(e){let{imageUrl:r,name:t,provider:l,size:c=24,className:u}=e,[m,x]=(0,o.useState)(!1),[g,b]=(0,o.useState)(!0);return!r||m?l?(0,s.jsx)(i.r,{provider:l,size:c,className:u}):(0,s.jsx)(a.A,{className:(0,d.cn)("text-muted-foreground",u),style:{width:c,height:c}}):r.startsWith("data:image/")?(0,s.jsx)(n.default,{src:r,alt:t,width:c,height:c,className:(0,d.cn)("object-contain",u),onError:()=>x(!0)}):(0,s.jsxs)("div",{className:(0,d.cn)("relative flex items-center justify-center",u),style:{width:c,height:c},children:[g&&l&&(0,s.jsx)(i.r,{provider:l,size:c,className:"absolute inset-0"}),(0,s.jsx)(n.default,{src:r,alt:t,width:c,height:c,className:(0,d.cn)("object-contain transition-opacity duration-200",g?"opacity-0":"opacity-100"),onError:()=>{x(!0),b(!1)},onLoad:()=>b(!1),unoptimized:!0})]})}},77186:(e,r,t)=>{"use strict";t.d(r,{T:()=>s});let s=e=>{let[r,t]=e.name.split("::");return{type:r,name:t}}},86924:(e,r,t)=>{Promise.resolve().then(t.bind(t,30494)),Promise.resolve().then(t.bind(t,1095)),Promise.resolve().then(t.bind(t,88831)),Promise.resolve().then(t.t.bind(t,85276,23))}},e=>{e.O(0,[1482,9425,2060,2811,1191,7764,7829,8831,8197,9907,4918,7358],()=>e(e.s=86924)),_N_E=e.O()}]);
|
package/.next/standalone/agents-manage-ui/.next/static/chunks/app/layout-668c73cc82c1c990.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{2971:(e,t,r)=>{"use strict";r.d(t,{iO:()=>n});var s=r(60098),a=r(30712);let n="https://docs.inkeep.com";s.Fragment,a.G,s.Fragment,a.G,s.Fragment,a.G,s.Fragment,s.Fragment,s.Fragment,a.G},12103:(e,t,r)=>{Promise.resolve().then(r.t.bind(r,94407,23)),Promise.resolve().then(r.bind(r,32419)),Promise.resolve().then(r.bind(r,91382)),Promise.resolve().then(r.bind(r,88831)),Promise.resolve().then(r.bind(r,78765)),Promise.resolve().then(r.bind(r,15660)),Promise.resolve().then(r.t.bind(r,30982,23)),Promise.resolve().then(r.t.bind(r,91e3,23)),Promise.resolve().then(r.bind(r,48503))},15660:(e,t,r)=>{"use strict";r.d(t,{RuntimeConfigProvider:()=>o,y:()=>l});var s=r(60098),a=r(79178);let n=(0,a.createContext)(null);function o(e){let{value:t,children:r}=e;return(0,s.jsx)(n.Provider,{value:t,children:r})}function l(){let e=(0,a.useContext)(n);if(!e)throw Error("useRuntimeConfig must be used within <RuntimeConfigProvider>");return e}},30712:(e,t,r)=>{"use strict";r.d(t,{G:()=>c});var s=r(60098),a=r(38678),n=r(85276),o=r.n(n),l=r(52681);function c(e){let{href:t,children:r,className:n,iconClassName:c,...i}=e;return(0,s.jsxs)(o(),{href:t,target:"_blank",rel:"noreferrer noopener",className:(0,l.cn)("text-sm text-muted-foreground underline underline-offset-2 inline-flex items-center gap-1 hover:text-primary ml-1 group/link font-mono uppercase transition-colors",n),...i,children:[r,(0,s.jsx)(a.A,{className:(0,l.cn)("size-3.5 text-muted-foreground/60 group-hover/link:text-primary",c)})]})}},30958:(e,t,r)=>{"use strict";r.d(t,{Cf:()=>x,Es:()=>h,HM:()=>d,L3:()=>f,c7:()=>m,lG:()=>l,rr:()=>p,zM:()=>c});var s=r(60098),a=r(28008),n=r(31184),o=r(52681);function l(e){let{...t}=e;return(0,s.jsx)(a.bL,{"data-slot":"dialog",...t})}function c(e){let{...t}=e;return(0,s.jsx)(a.l9,{"data-slot":"dialog-trigger",...t})}function i(e){let{...t}=e;return(0,s.jsx)(a.ZL,{"data-slot":"dialog-portal",...t})}function d(e){let{...t}=e;return(0,s.jsx)(a.bm,{"data-slot":"dialog-close",...t})}function u(e){let{className:t,...r}=e;return(0,s.jsx)(a.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),...r})}function x(e){let{className:t,children:r,showCloseButton:l=!0,...c}=e;return(0,s.jsxs)(i,{"data-slot":"dialog-portal",children:[(0,s.jsx)(u,{}),(0,s.jsxs)(a.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),...c,children:[r,l&&(0,s.jsxs)(a.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,s.jsx)(n.A,{}),(0,s.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function m(e){let{className:t,...r}=e;return(0,s.jsx)("div",{"data-slot":"dialog-header",className:(0,o.cn)("flex flex-col gap-2 text-center sm:text-left",t),...r})}function h(e){let{className:t,...r}=e;return(0,s.jsx)("div",{"data-slot":"dialog-footer",className:(0,o.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...r})}function f(e){let{className:t,...r}=e;return(0,s.jsx)(a.hE,{"data-slot":"dialog-title",className:(0,o.cn)("text-lg leading-none font-medium",t),...r})}function p(e){let{className:t,...r}=e;return(0,s.jsx)(a.VY,{"data-slot":"dialog-description",className:(0,o.cn)("text-muted-foreground text-sm",t),...r})}},32419:(e,t,r)=>{"use strict";r.d(t,{AppSidebar:()=>B});var s=r(60098),a=r(19256),n=r(76656),o=r(57713),l=r(30507),c=r(94199),i=r(90117),d=r(44339),u=r(991),x=r(97405),m=r(39810),h=r(85276),f=r.n(h),p=r(93137),j=r(79178),C=r(69962);let g=(0,j.forwardRef)((e,t)=>(0,s.jsxs)(C.A,{ref:t,...e,children:[(0,s.jsx)("path",{d:"M2.06895 11.2982L11.432 1.9351C12.7248 0.642325 14.8208 0.642325 16.1135 1.9351C17.4063 3.22786 17.4063 5.32386 16.1135 6.61663L9.04249 13.6877",stroke:"currentColor",strokeLinecap:"round"}),(0,s.jsx)("path",{d:"M9.14003 13.5902L16.1135 6.61663C17.4063 5.32385 19.5023 5.32385 20.7952 6.61663L20.8439 6.66538C22.1367 7.95816 22.1367 10.0542 20.8439 11.3469L12.3758 19.815C11.9449 20.2459 11.9449 20.9445 12.3758 21.3754L14.1146 23.1143",stroke:"currentColor",strokeLinecap:"round"}),(0,s.jsx)("path",{d:"M13.7728 4.27585L6.84802 11.2006C5.55526 12.4934 5.55526 14.5894 6.84802 15.8822C8.14079 17.1749 10.2368 17.1749 11.5296 15.8822L18.4543 8.95738",stroke:"currentColor",strokeLinecap:"round"})]}));g.displayName="MCPIcon";var v=r(52681);let b=e=>(0,s.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"890",height:"169",viewBox:"0 0 890 169",fill:"none",role:"img","aria-labelledby":"inkeep-logo","aria-label":"Inkeep Logo",...e,className:(0,v.cn)("text-[#231F20] dark:text-white",e.className),children:[(0,s.jsx)("path",{d:"M45.4714 3.11853C42.256 3.11853 39.2849 4.83392 37.6772 7.61853L1.77955 69.7951C0.171853 72.5797 0.171863 76.0105 1.77956 78.7951L37.6772 140.972C39.2849 143.756 42.2561 145.472 45.4714 145.472L117.267 145.472C120.482 145.472 123.453 143.756 125.061 140.972L160.959 78.7951C162.566 76.0105 162.566 72.5797 160.959 69.7951L125.061 7.61852C123.453 4.83391 120.482 3.11853 117.267 3.11853L45.4714 3.11853Z",fill:"#D5E5FF"}),(0,s.jsx)("path",{d:"M188.432 1.91439C210.239 7.42997 207.754 19.5937 216.797 44.3352C222.599 60.2085 250.649 79.8906 225.015 118.151C217.366 129.57 192.767 143.117 174.969 146.874C135.756 155.025 112.651 136.528 92.1543 106.03C76.776 82.9616 82.2098 49.7508 105.534 33.4431C127.638 18.0306 159.766 -5.88546 188.432 1.91439Z",fill:"#69A3FF"}),(0,s.jsx)("path",{d:"M279.121 19.2581H292.519V128.013H279.121V19.2581Z",fill:"currentColor"}),(0,s.jsx)("path",{d:"M311.461 19.258H324.859V46.516H325.229C328.74 36.9988 334.284 29.6992 341.676 24.6172C349.068 19.5352 358.308 16.948 369.304 16.948C376.511 16.948 382.794 17.9644 388.338 20.0896C393.79 22.2148 398.502 25.3564 402.29 29.5144C406.079 33.6724 408.943 38.9392 410.976 45.3148C412.916 51.598 413.933 58.8976 413.933 67.1212V127.92H400.535V68.5996C400.535 61.9468 399.796 56.218 398.317 51.3208C396.839 46.4236 394.621 42.358 391.757 39.0316C388.892 35.7052 385.289 33.3028 380.946 31.732C376.696 30.1612 371.798 29.422 366.254 29.422C359.879 29.422 354.15 30.346 349.068 32.2864C343.986 34.2268 339.643 36.9064 336.04 40.4176C332.436 43.9288 329.664 48.0868 327.816 52.7992C325.876 57.5116 324.952 62.8708 324.952 68.692V128.013H311.554V19.258H311.461Z",fill:"currentColor"}),(0,s.jsx)("path",{d:"M535.347 50.6715C538.119 43.7415 541.907 37.7355 546.804 32.6535C551.702 27.6639 557.523 23.7831 564.268 21.1035C571.013 18.4239 578.498 17.0379 586.629 17.0379C594.76 17.0379 602.152 18.4239 608.897 21.1959C615.642 23.9679 621.464 27.8487 626.361 32.7459C631.351 37.7355 635.139 43.6491 637.818 50.6715C640.498 57.6939 641.884 65.4555 641.884 73.9563V78.2067H542.646V66.3795H631.443L628.578 73.8639C628.578 67.2111 627.562 61.1127 625.437 55.6611C623.312 50.2095 620.447 45.4971 616.844 41.5239C613.148 37.5507 608.805 34.5939 603.63 32.4687C598.456 30.3435 592.82 29.3271 586.721 29.3271C580.623 29.3271 574.802 30.4359 569.627 32.5611C564.453 34.6863 560.018 37.7355 556.322 41.6163C552.626 45.4971 549.669 50.1171 547.544 55.5687C545.418 61.0203 544.402 66.9339 544.402 73.4943C544.402 80.0547 545.511 86.1531 547.636 91.6047C549.761 97.0563 552.81 101.676 556.599 105.557C560.387 109.438 564.915 112.395 570.089 114.612C575.264 116.737 580.992 117.846 587.276 117.846C597.07 117.846 605.386 115.351 612.316 110.454C619.246 105.557 624.143 98.6271 627.192 89.8491L640.221 94.2843C636.433 105.372 629.872 114.15 620.725 120.618C611.485 127.086 600.489 130.32 587.553 130.32C579.329 130.32 571.66 128.934 564.822 126.255C557.892 123.575 551.979 119.694 546.989 114.705C542 109.715 538.119 103.709 535.347 96.7791C532.575 89.8491 531.096 82.1799 531.096 73.5867C531.096 64.9935 532.482 57.6939 535.254 50.6715H535.347Z",fill:"currentColor"}),(0,s.jsx)("path",{d:"M657.317 50.6715C660.089 43.7415 663.877 37.7355 668.774 32.6535C673.671 27.5715 679.493 23.7831 686.238 21.1035C692.983 18.4239 700.467 17.0379 708.599 17.0379C716.73 17.0379 724.122 18.4239 730.867 21.1959C737.612 23.9679 743.433 27.8487 748.331 32.7459C753.32 37.7355 757.109 43.6491 759.788 50.6715C762.468 57.6939 763.854 65.4555 763.854 73.9563V78.2067H664.616V66.3795H753.413L750.548 73.8639C750.548 67.2111 749.532 61.1127 747.407 55.6611C745.281 50.2095 742.417 45.4971 738.721 41.5239C735.025 37.5507 730.682 34.5939 725.508 32.4687C720.333 30.3435 714.697 29.3271 708.599 29.3271C702.5 29.3271 696.679 30.4359 691.505 32.5611C686.33 34.6863 681.895 37.7355 678.199 41.6163C674.503 45.4971 671.546 50.1171 669.421 55.5687C667.296 61.0203 666.279 66.9339 666.279 73.4943C666.279 80.0547 667.388 86.1531 669.513 91.6047C671.639 97.0563 674.688 101.676 678.476 105.557C682.265 109.438 686.792 112.395 691.967 114.612C697.141 116.737 702.87 117.846 709.153 117.846C718.947 117.846 727.263 115.351 734.193 110.454C741.123 105.557 746.021 98.6271 749.07 89.8491L762.098 94.2843C758.31 105.372 751.842 114.15 742.602 120.618C733.362 127.086 722.366 130.32 709.43 130.32C701.207 130.32 693.537 128.934 686.7 126.255C679.77 123.575 673.856 119.694 668.959 114.705C663.969 109.715 660.089 103.709 657.317 96.7791C654.452 89.8491 653.066 82.1799 653.066 73.5867C653.066 64.9935 654.452 57.6939 657.224 50.6715H657.317Z",fill:"currentColor"}),(0,s.jsx)("path",{d:"M778.359 19.258H791.757V47.902H792.126C795.915 37.8304 801.828 30.2536 809.775 24.8944C817.814 19.6276 827.146 16.948 838.049 16.948C845.811 16.948 852.741 18.2416 859.116 20.9212C865.4 23.6008 870.759 27.2968 875.194 32.1016C879.629 36.9064 882.956 42.82 885.358 49.8424C887.76 56.8648 888.962 64.8112 888.962 73.5892C888.962 82.3672 887.76 90.3136 885.358 97.2436C882.956 104.266 879.629 110.18 875.194 114.984C870.759 119.882 865.492 123.578 859.209 126.165C853.018 128.752 845.996 130.046 838.234 130.046C827.423 130.046 817.906 127.366 809.867 122.099C801.828 116.832 795.915 109.163 792.034 99.0916H791.664V168.392H778.266V19.258H778.359ZM795.083 91.792C797.208 97.2436 800.258 101.956 804.138 105.837C808.019 109.718 812.639 112.674 818.091 114.8C823.542 116.925 829.364 117.941 835.554 117.941C841.745 117.941 847.197 116.925 852.186 114.984C857.176 113.044 861.426 110.18 864.938 106.299C868.449 102.418 871.036 97.8904 872.976 92.4388C874.917 86.9872 875.841 80.8888 875.841 73.9588C875.841 67.0288 874.824 60.6532 872.884 55.1092C870.944 49.6576 868.172 44.9452 864.753 41.0644C861.334 37.1836 857.084 34.3192 852.002 32.2864C847.012 30.346 841.468 29.3296 835.37 29.3296C829.271 29.3296 823.173 30.346 817.906 32.4712C812.639 34.5964 808.019 37.5532 804.138 41.434C800.258 45.3148 797.301 49.9348 795.083 55.3864C792.866 60.838 791.849 66.9364 791.849 73.6816C791.849 80.4268 792.958 86.1556 795.083 91.6996V91.792Z",fill:"currentColor"}),(0,s.jsx)("path",{d:"M481.386 61.2051L533.592 19.9023V19.4403H514.28L476.489 48.9159L444.426 74.6031H443.964V17.0379H430.566V128.01H443.964V90.8655L471.684 68.8743L522.042 128.01H539.136V127.641L481.386 61.2051Z",fill:"currentColor"})]});var w=r(88831);function N(e){let{title:t,url:r,icon:a,isExternal:n}=e,o=(0,p.usePathname)().startsWith(r);return(0,s.jsx)(w.FX,{children:(0,s.jsx)(w.Uj,{asChild:!0,tooltip:t,isActive:o,children:(0,s.jsxs)(f(),{href:r,rel:n?"noopener noreferrer":void 0,target:n?"_blank":void 0,children:[a&&(0,s.jsx)(a,{}),(0,s.jsx)("span",{children:t})]})})})}function k(e){let{items:t}=e;return(0,s.jsx)(w.Cn,{children:(0,s.jsx)(w.rQ,{className:"flex flex-col gap-2",children:(0,s.jsx)(w.wZ,{children:t.map(e=>(0,s.jsx)(N,{...e},e.title))})})})}var L=r(76233),y=r(93431),A=r(97555);let P=(0,A.createServerReference)("40f2d54d4fbce77990ac5b2f63c5107fa5133ec26e",A.callServer,void 0,A.findSourceMapURL,"fetchProjectsAction");var H=r(44001),V=r(27820),I=r(96776),S=r(86714),_=r(46205),M=r(66041);function z(e){let{projects:t,selectedProjectId:r,tenantId:a}=e,[n,o]=(0,j.useState)(!1),[l,c]=(0,j.useState)(!1),i=(0,p.useRouter)(),d=t.find(e=>e.projectId===r);return(0,s.jsxs)("div",{className:"flex w-full",children:[(0,s.jsxs)(M.AM,{open:n,onOpenChange:o,children:[(0,s.jsx)(M.Wv,{asChild:!0,children:(0,s.jsxs)(S.$,{variant:"ghost",role:"combobox","aria-expanded":n,className:"w-full h-auto justify-between bg-transparent text-foreground pr-2",children:[d?(0,s.jsxs)("div",{className:"flex flex-col text-left min-w-0 flex-1",children:[(0,s.jsx)("span",{className:"font-medium truncate text-foreground",children:d.name||d.projectId}),(0,s.jsx)("span",{className:"text-muted-foreground truncate text-xs",children:a})]}):(0,s.jsx)("div",{className:"text-muted-foreground",children:"Select a project"}),(0,s.jsx)(H.A,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,s.jsx)(M.hl,{className:"w-[var(--radix-popover-trigger-width)] p-0",children:(0,s.jsxs)(_.uB,{children:[(0,s.jsx)(_.xL,{children:"No projects found"}),(0,s.jsxs)(_.oI,{className:"max-h-64",children:[(0,s.jsx)(_.L$,{children:t.map(e=>(0,s.jsx)(_.h_,{onSelect:()=>{i.push("/".concat(a,"/projects/").concat(e.projectId)),o(!1)},className:"flex items-start gap-3 px-3 py-2 group cursor-pointer",children:(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"font-medium",children:e.name||e.projectId}),e.projectId===r&&(0,s.jsx)("span",{className:"text-muted-foreground",children:(0,s.jsx)(V.A,{className:"h-4 w-4"})})]}),e.description&&(0,s.jsx)("span",{className:"text-xs text-muted-foreground line-clamp-1",children:e.description})]})},e.projectId))}),(0,s.jsx)(_.fx,{}),(0,s.jsx)(_.L$,{children:(0,s.jsxs)(_.h_,{onSelect:()=>{o(!1),c(!0)},className:"flex items-center gap-2 px-3 py-2 cursor-pointer",children:[(0,s.jsx)(I.A,{className:"h-4 w-4 text-foreground"}),(0,s.jsx)("span",{className:"font-medium text-foreground uppercase font-mono tracking-wider",children:"Create Project"})]})})]})]})})]}),a&&(0,s.jsx)(L.NewProjectDialog,{tenantId:a,open:l,onOpenChange:c})]})}function F(){let[e,t]=(0,j.useState)(!0),[r,a]=(0,j.useState)([]),n=(0,p.useParams)(),o=n.tenantId,l=n.projectId;return(0,j.useEffect)(()=>{o&&P(o).then(e=>{t(!1),e.success&&e.data?a(e.data):a([])}).catch(e=>{console.error("Error fetching projects:",e),t(!1),a([])})},[o]),(0,s.jsx)("div",{className:"flex flex-col gap-2",children:e?(0,s.jsx)(y.E,{className:"h-14 w-full"}):0===r.length?(0,s.jsxs)("div",{className:"flex flex-col gap-2 px-2",children:[(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"No projects yet"}),(0,s.jsx)(L.NewProjectDialog,{tenantId:o})]}):(0,s.jsx)(z,{projects:r,selectedProjectId:l,tenantId:o})})}var Z=r(91058),E=r(90277),G=r(15154),R=r(3121),D=r(80311);function O(){let{setTheme:e}=(0,R.D)();return(0,s.jsxs)(D.rI,{children:[(0,s.jsx)(D.ty,{asChild:!0,children:(0,s.jsxs)(S.$,{variant:"ghost",size:"icon",className:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground text-sidebar-foreground/80 dark:text-sidebar-foreground",children:[(0,s.jsx)(Z.A,{className:"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),(0,s.jsx)(E.A,{className:"absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),(0,s.jsx)("span",{className:"sr-only",children:"Toggle theme"})]})}),(0,s.jsxs)(D.SQ,{align:"end",children:[(0,s.jsxs)(D._2,{onClick:()=>e("light"),children:[(0,s.jsx)(Z.A,{className:"mr-2 h-4 w-4"}),(0,s.jsx)("span",{children:"Light"})]}),(0,s.jsxs)(D._2,{onClick:()=>e("dark"),children:[(0,s.jsx)(E.A,{className:"mr-2 h-4 w-4"}),(0,s.jsx)("span",{children:"Dark"})]}),(0,s.jsxs)(D._2,{onClick:()=>e("system"),children:[(0,s.jsx)(G.A,{className:"mr-2 h-4 w-4"}),(0,s.jsx)("span",{children:"System"})]})]})]})}var $=r(2971);let U=[{title:"Support",url:"mailto:support@inkeep.com",icon:a.A},{title:"Documentation",url:"".concat($.iO,"/"),icon:n.A,isExternal:!0}];function B(e){let{...t}=e,{tenantId:r,projectId:a}=(0,p.useParams)(),n=a&&"undefined"!==a?[{title:"Graphs",url:"/".concat(r,"/projects/").concat(a,"/graphs"),icon:o.A},{title:"API Keys",url:"/".concat(r,"/projects/").concat(a,"/api-keys"),icon:l.A},{title:"MCP Servers",url:"/".concat(r,"/projects/").concat(a,"/mcp-servers"),icon:g},{title:"Credentials",url:"/".concat(r,"/projects/").concat(a,"/credentials"),icon:c.A},{title:"Traces",url:"/".concat(r,"/projects/").concat(a,"/traces"),icon:i.A},{title:"Components",url:"/".concat(r,"/projects/").concat(a,"/components"),icon:d.A},{title:"Artifacts",url:"/".concat(r,"/projects/").concat(a,"/artifacts"),icon:u.A},{title:"Settings",url:"/".concat(r,"/projects/").concat(a,"/settings"),icon:x.A}]:[{title:"Projects",url:"/".concat(r,"/projects"),icon:m.A}];return(0,s.jsxs)(w.Bx,{collapsible:"offcanvas",...t,children:[(0,s.jsx)(w.Gh,{children:(0,s.jsx)(w.wZ,{children:(0,s.jsx)(w.FX,{children:(0,s.jsxs)("div",{className:"flex items-center justify-between w-full gap-2",children:[(0,s.jsx)(w.Uj,{asChild:!0,className:"data-[slot=sidebar-menu-button]:!p-1.5 flex-1",children:(0,s.jsx)(f(),{href:r?"/".concat(r,"/projects"):"/",children:(0,s.jsx)(b,{className:"!w-[110px] !h-[32px]"})})}),(0,s.jsx)(O,{})]})})})}),(0,s.jsxs)(w.Yv,{className:"flex flex-col justify-between",children:[n.length>0&&(0,s.jsx)(k,{items:n}),(0,s.jsx)(k,{items:U})]}),r&&a&&(0,s.jsx)(w.CG,{children:(0,s.jsx)(F,{})})]})}},69962:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var s=r(60098),a=r(79178);let n={fill:"none",height:24,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg"},o=(0,a.forwardRef)((e,t)=>{let{color:r="currentColor",size:a=24,strokeWidth:o=2,absoluteStrokeWidth:l,className:c="",children:i,...d}=e;return(0,s.jsx)("svg",{role:"img","aria-label":"SVG Icon",ref:t,...n,className:c,height:a,stroke:r,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:l?24*Number(o)/Number(a):o,width:a,...d,children:i})});o.displayName="SvgIcon"},76233:(e,t,r)=>{"use strict";r.d(t,{NewProjectDialog:()=>d});var s=r(60098),a=r(96776),n=r(93137),o=r(79178),l=r(86714),c=r(30958),i=r(65780);function d(e){let{tenantId:t,triggerButton:r,children:d,open:u,onOpenChange:x}=e,[m,h]=(0,o.useState)(!1),f=(0,n.useRouter)(),p=x||h;return(0,s.jsxs)(c.lG,{open:void 0!==u?u:m,onOpenChange:p,children:[(d||r)&&(0,s.jsx)(c.zM,{asChild:!0,children:d||r||(0,s.jsxs)(l.$,{children:[(0,s.jsx)(a.A,{className:"mr-2 h-4 w-4"}),"Create Project"]})}),(0,s.jsxs)(c.Cf,{className:"!max-w-2xl",children:[(0,s.jsx)(c.L3,{children:"Create new project"}),(0,s.jsx)(c.rr,{children:"Create a new project to organize your agents, tools, and resources."}),(0,s.jsx)(i.ProjectForm,{tenantId:t,onSuccess:e=>{p(!1),f.push("/".concat(t,"/projects/").concat(e,"/graphs"))},onCancel:()=>p(!1)})]})]})}},78765:(e,t,r)=>{"use strict";r.d(t,{Toaster:()=>o});var s=r(60098),a=r(3121),n=r(32028);let o=e=>{let{...t}=e,{resolvedTheme:r}=(0,a.D)();return(0,s.jsx)(n.l$,{theme:r,className:"toaster group",style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)"},...t})}},80311:(e,t,r)=>{"use strict";r.d(t,{SQ:()=>c,_2:()=>i,rI:()=>o,ty:()=>l});var s=r(60098),a=r(71191),n=r(52681);function o(e){let{...t}=e;return(0,s.jsx)(a.bL,{"data-slot":"dropdown-menu",...t})}function l(e){let{...t}=e;return(0,s.jsx)(a.l9,{"data-slot":"dropdown-menu-trigger",...t})}function c(e){let{className:t,sideOffset:r=4,...o}=e;return(0,s.jsx)(a.ZL,{children:(0,s.jsx)(a.UC,{"data-slot":"dropdown-menu-content",sideOffset:r,className:(0,n.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 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md scrollbar-thin scrollbar-thumb-muted-foreground/30 dark:scrollbar-thumb-muted-foreground/50 scrollbar-track-transparent",t),...o})})}function i(e){let{className:t,inset:r,variant:o="default",...l}=e;return(0,s.jsx)(a.q7,{"data-slot":"dropdown-menu-item","data-inset":r,"data-variant":o,className:(0,n.cn)("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_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]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...l})}},91382:(e,t,r)=>{"use strict";r.d(t,{ThemeProvider:()=>n});var s=r(60098),a=r(3121);function n(e){let{children:t,...r}=e;return(0,s.jsx)(a.N,{...r,children:t})}},94407:()=>{}},e=>{e.O(0,[9736,8119,4151,1482,9425,2060,2597,8096,2811,6501,1191,9846,6410,8831,8130,5780,9907,4918,7358],()=>e(e.s=12103)),_N_E=e.O()}]);
|