@inkeep/agents-manage-ui 0.38.1 → 0.38.2
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-path-routes-manifest.json +5 -5
- package/.next/standalone/agents-manage-ui/.next/build-manifest.json +3 -3
- package/.next/standalone/agents-manage-ui/.next/prerender-manifest.json +3 -3
- package/.next/standalone/agents-manage-ui/.next/react-loadable-manifest.json +6 -6
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/page.js +2 -2
- 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]/agents/[agentId]/page.js +7 -26
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/agents/[agentId]/page.js.nft.json +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/agents/[agentId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/agents/page.js +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/agents/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 +2 -2
- 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 +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_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/components/page.js +1 -1
- 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 +2 -2
- 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_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/credentials/new/page.js +2 -2
- 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_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/credentials/page.js +1 -1
- 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]/external-agents/[externalAgentId]/edit/page.js +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/external-agents/[externalAgentId]/edit/page.js.nft.json +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/external-agents/[externalAgentId]/edit/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/external-agents/[externalAgentId]/page.js +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/external-agents/[externalAgentId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/external-agents/new/page.js +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/external-agents/new/page.js.nft.json +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/external-agents/new/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/external-agents/page.js +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/external-agents/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.js.nft.json +1 -1
- 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.js.nft.json +1 -1
- 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 +2 -2
- 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 +2 -2
- 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 +3 -3
- 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 +3 -3
- 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/[projectId]/traces/tool-calls/page.js +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/traces/tool-calls/page.js.nft.json +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/traces/tool-calls/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/[tenantId]/settings/page.js +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/settings/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/_global-error.html +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/_global-error.rsc +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/_global-error.segments/_tree.segment.rsc +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 +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/accept-invitation/[invitationId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/api/data-components/[dataComponentId]/generate-render/route.js +4 -4
- package/.next/standalone/agents-manage-ui/.next/server/app/api/data-components/[dataComponentId]/generate-render/route_client-reference-manifest.js +1 -1
- 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/index.html +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/index.rsc +3 -3
- package/.next/standalone/agents-manage-ui/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/index.segments/_full.segment.rsc +3 -3
- package/.next/standalone/agents-manage-ui/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/index.segments/_index.segment.rsc +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/login.html +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/login.rsc +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/login.segments/_full.segment.rsc +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/login.segments/_head.segment.rsc +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/login.segments/_index.segment.rsc +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/login.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/login.segments/login/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/login.segments/login.segment.rsc +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/logout/route_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/no-organization/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/no-organization.html +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/no-organization.rsc +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/no-organization.segments/_full.segment.rsc +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/no-organization.segments/_head.segment.rsc +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/no-organization.segments/_index.segment.rsc +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/no-organization.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/no-organization.segments/no-organization/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/no-organization.segments/no-organization.segment.rsc +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/page.js +1 -1
- 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 +5 -5
- package/.next/standalone/agents-manage-ui/.next/server/chunks/2196.js +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/chunks/3138.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/server/chunks/4286.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/server/chunks/6125.js +4 -4
- package/.next/standalone/agents-manage-ui/.next/server/chunks/{4812.js → 8185.js} +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/chunks/8324.js +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/chunks/8431.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/server/chunks/8870.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/chunks/902.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/server/chunks/9329.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/middleware-build-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/middleware-react-loadable-manifest.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 +2 -2
- 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/1186-3ef8f167f43c3be2.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/12234-474d684407384eb7.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/22300-cfe99b8beeb99a13.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/32565-9960b0c6406911bf.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/{31278-f7be57d573dfa6f3.js → 33568-25f6aa1950287007.js} +1 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/34981-cebc039f5c48e794.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/53067.aa17db986ac34425.js +23 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/63188-c7b5d51fbc726886.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/64295-81f2477010363e89.js +14 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/{78295-a953cea9b4ddefb0.js → 78295-d8598f3e9deed8c6.js} +2 -2
- package/.next/standalone/agents-manage-ui/.next/static/chunks/{9798a8e4-0862900761f4e98d.js → 9798a8e4-faa839481f967a8d.js} +1 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/{layout-fabda89d39b7e2de.js → layout-fd9a2deae59d7b43.js} +1 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/agents/[agentId]/page-d18719edcc62b822.js +414 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/agents/page-899dfd9cc3a19b47.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/api-keys/page-9c225515b7592228.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/artifacts/[artifactComponentId]/page-e64fd0598fd2e8a1.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/artifacts/new/page-d36acf62988cfc7a.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/artifacts/page-b0ea0b749b30d3c7.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/components/[dataComponentId]/{page-b8aefcf527976d02.js → page-98e2a8d5ba3cd923.js} +1 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/components/new/{page-db140fb74668d035.js → page-498a31b87266f054.js} +1 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/components/page-eea2c82071a52151.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/credentials/[credentialId]/page-5adc992fc318b399.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/credentials/new/bearer/page-3a55286c4c8308f5.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/credentials/new/providers/[providerId]/{page-1d68beacd49d04fd.js → page-7cc8bc8d35818be6.js} +1 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/credentials/{page-7f007f54e7a5365d.js → page-794c945cd39b2b80.js} +1 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/external-agents/[externalAgentId]/edit/{page-d93e308361a58e4d.js → page-7ec6c909eb17c859.js} +1 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/external-agents/new/{page-662592f3fef95760.js → page-234b8c244b962c55.js} +1 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/external-agents/page-f8118fd8fbba2b62.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/mcp-servers/[mcpServerId]/edit/page-f869ad73bdd0cd2c.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/mcp-servers/[mcpServerId]/page-88b18c22edb72177.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/mcp-servers/new/page-eb107dfa3a0f725b.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/mcp-servers/page-af62c83660580b24.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/settings/{page-73d80e750d00bae9.js → page-f34b264880d32767.js} +1 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/traces/{page-b13b3271ceceb494.js → page-9000b358f48e450a.js} +2 -2
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/page-50eb02fea8f22fc7.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/settings/page-d71718217286b332.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/{page-521f939156584b03.js → page-fc1b7c4d94b91546.js} +1 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/{webpack-82d89792eb6c6a88.js → webpack-9ed0b890bbcbcc6c.js} +1 -1
- package/.next/standalone/agents-manage-ui/.next/static/css/16c4611e249100df.css +1 -0
- package/.next/standalone/agents-manage-ui/package.json +1 -1
- package/.next/standalone/packages/agents-core/package.json +1 -1
- package/package.json +4 -4
- package/src/app/[tenantId]/projects/[projectId]/agents/[agentId]/page.client.tsx +9 -1
- package/src/components/agent/configuration/model-options.tsx +6 -2
- package/src/components/agent/copilot/components/code-diff.tsx +6 -4
- package/src/components/agent/copilot/copilot-chat.tsx +4 -0
- package/src/components/agent/copilot/message-parts/loading.tsx +8 -1
- package/src/components/agent/copilot-streaming-overlay.tsx +20 -0
- package/src/components/agent/ship/mcp-guide/snippets/cursor.ts +0 -6
- package/src/components/agent/ship/mcp-guide/snippets/vscode.ts +0 -7
- package/src/components/agent/ship/mcp-guide/snippets/windsurf.ts +0 -6
- package/src/components/agent/sidepane/sidepane.tsx +7 -1
- package/src/components/form/expandable-field.tsx +4 -1
- package/src/components/mcp-servers/form/mcp-server-form.tsx +1 -5
- package/src/components/mcp-servers/selection/mcp-server-selection.tsx +1 -8
- package/src/components/ui/dialog.tsx +2 -2
- package/src/lib/actions/__tests__/tool-approval.test.ts +10 -10
- package/src/lib/actions/tool-approval.ts +3 -8
- package/src/lib/utils/__tests__/tool-approval-mapper.test.ts +10 -10
- package/.next/standalone/agents-manage-ui/.next/server/chunks/428.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/server/chunks/4425.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/server/chunks/6081.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/server/chunks/8345.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/12234-99449e826b5bb0fb.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/27865-816884567056e373.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/32565-25ff21521bc669d8.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/57783-c32ae1e36a5feef4.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/57862-247ba5b2eeebea14.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/58158-b2ca2e105be4d0e3.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/77868.3c9e85d7db83c461.js +0 -23
- package/.next/standalone/agents-manage-ui/.next/static/chunks/83531-ef6d194db3071636.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/94816-0542bc0b8ed3b045.js +0 -14
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/agents/[agentId]/page-a5dac55f422396b5.js +0 -433
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/agents/page-9d87435c822e0d34.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/api-keys/page-56d8206271236bff.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/artifacts/[artifactComponentId]/page-88b43ea00fb4dfd8.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/artifacts/new/page-8ced567ece490895.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/artifacts/page-7160d31d6824d799.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/components/page-a98e524c19a2aaf9.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/credentials/[credentialId]/page-739a324b4a888c10.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/credentials/new/bearer/page-bfb7ff17e33193ca.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/external-agents/page-14d30afd510c0378.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/mcp-servers/[mcpServerId]/edit/page-043fdfc484fe24ce.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/mcp-servers/[mcpServerId]/page-41c5e4c87fae2a08.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/mcp-servers/new/page-a9a43c31caa5c173.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/mcp-servers/page-31f14f3b3799a87f.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/page-196113e6e40316a9.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/settings/page-366fd8682c726ca5.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/css/104a74bda41fa978.css +0 -1
- /package/.next/standalone/agents-manage-ui/.next/static/{KGWtwxWYpo0z-5efJaAEr → cEZrzrKK_4Wmz-9nyuTwO}/_buildManifest.js +0 -0
- /package/.next/standalone/agents-manage-ui/.next/static/{KGWtwxWYpo0z-5efJaAEr → cEZrzrKK_4Wmz-9nyuTwO}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,414 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9540,43189],{1391:(e,t,a)=>{"use strict";a.d(t,{Fc:()=>o,TN:()=>d,XL:()=>l});var s=a(59112),r=a(81878),n=a(29944);let i=(0,r.F)("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",warning:"text-amber-700 bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-amber-700/90 *:data-[slot=alert-description]:dark:text-amber-300/90 dark:text-amber-300 bg-amber-50 border-amber-200 dark:bg-amber-950/40 dark:border-amber-700"}},defaultVariants:{variant:"default"}});function o({className:e,variant:t,...a}){return(0,s.jsx)("div",{"data-slot":"alert",role:"alert",className:(0,n.cn)(i({variant:t}),e),...a})}function l({className:e,...t}){return(0,s.jsx)("div",{"data-slot":"alert-title",className:(0,n.cn)("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t})}function d({className:e,...t}){return(0,s.jsx)("div",{"data-slot":"alert-description",className:(0,n.cn)("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...t})}},7707:(e,t,a)=>{"use strict";a.d(t,{G:()=>l});var s=a(59112),r=a(90515),n=a(62351),i=a.n(n),o=a(29944);function l({href:e,children:t,className:a,iconClassName:n,...l}){return(0,s.jsxs)(i(),{href:e,target:"_blank",rel:"noreferrer noopener",className:(0,o.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",a),...l,children:[t,(0,s.jsx)(r.A,{className:(0,o.cn)("size-3.5 text-muted-foreground opacity-60 group-hover/link:text-primary",n)})]})}},9754:(e,t,a)=>{"use strict";a.d(t,{B:()=>i});var s=a(59112),r=a(95556),n=a(39968);let i=({uri:e,placeholder:t="Enter code...",editorOptions:a,...i})=>{let o=(0,r.useId)();return e??=`${o}.jsx`,(0,s.jsx)(n.T,{uri:e,placeholder:t,editorOptions:{ariaLabel:"Code editor",...a},...i})}},14711:(e,t,a)=>{"use strict";a.d(t,{F:()=>l,W:()=>o});var s=a(59112),r=a(95556),n=a(1439);let i=(0,r.createContext)(null);function o({children:e}){let[t,a]=(0,r.useState)(!1),[o,l]=(0,r.useState)(!1),d=(0,r.useRef)(null),[c,u]=(0,r.useState)({}),{PUBLIC_INKEEP_COPILOT_AGENT_ID:m,PUBLIC_INKEEP_COPILOT_PROJECT_ID:p,PUBLIC_INKEEP_COPILOT_TENANT_ID:h}=(0,n.y)(),x=!!(m&&p&&h);return x||console.warn("Copilot is not configured."),(0,s.jsx)(i.Provider,{value:{isOpen:t,setIsOpen:a,isStreaming:o,setIsStreaming:l,chatFunctionsRef:d,openCopilot:()=>a(!0),dynamicHeaders:c,setDynamicHeaders:u,isCopilotConfigured:x},children:e})}function l(){let e=(0,r.useContext)(i);if(!e)throw Error("useCopilotContext must be used within CopilotProvider");return e}},22408:(e,t,a)=>{"use strict";a.d(t,{D:()=>i});var s=a(59112),r=a(95556),n=a(29944);let i=(0,r.forwardRef)(({children:e,className:t,...a},r)=>(0,s.jsx)("div",{ref:r,className:(0,n.cn)("p-6",t),...a,children:e}));i.displayName="MainContent"},26831:(e,t,a)=>{"use strict";a.d(t,{Bf:()=>f,ib:()=>b,Y1:()=>v});var s=a(89101),r=a(3361),n=a(56887),i=a(94962),o=a(12699);let l="github-light-default",d="github-dark-default",c="template",u=JSON.parse('{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://json-schema.org/draft/2020-12/schema","title":"JSON Schema Draft 2020-12 (Monaco Compatible)","type":"object","properties":{"$schema":{"type":"string","description":"The JSON Schema meta-schema identifier"},"$id":{"type":"string","description":"A unique identifier for the schema"},"title":{"type":"string","description":"A descriptive title for the schema"},"description":{"type":"string","description":"A description of the schema"},"type":{"type":"string","enum":["string","number","integer","boolean","array","object","null"],"description":"The type of the data"},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"description":"Properties of the object"},"required":{"type":"array","items":{"type":"string"},"description":"Required properties"},"items":{"description":"Schema for array items"},"additionalProperties":{"description":"Schema for additional properties"},"enum":{"type":"array","description":"Enumeration of valid values"},"const":{"description":"A constant value"},"default":{"description":"Default value"},"examples":{"type":"array","description":"Example values"},"format":{"type":"string","description":"Format specification"},"pattern":{"type":"string","description":"Regular expression pattern"},"minimum":{"type":"number","description":"Minimum value"},"maximum":{"type":"number","description":"Maximum value"},"minLength":{"type":"integer","minimum":0,"description":"Minimum string length"},"maxLength":{"type":"integer","minimum":0,"description":"Maximum string length"},"minItems":{"type":"integer","minimum":0,"description":"Minimum array length"},"maxItems":{"type":"integer","minimum":0,"description":"Maximum array length"},"uniqueItems":{"type":"boolean","description":"Whether array items must be unique"},"oneOf":{"type":"array","items":{"$ref":"#"},"description":"Schema must match exactly one of the schemas"},"anyOf":{"type":"array","items":{"$ref":"#"},"description":"Schema must match at least one of the schemas"},"allOf":{"type":"array","items":{"$ref":"#"},"description":"Schema must match all of the schemas"},"not":{"$ref":"#","description":"Schema must not match"},"if":{"$ref":"#","description":"Conditional schema"},"then":{"$ref":"#","description":"Schema to apply if condition is true"},"else":{"$ref":"#","description":"Schema to apply if condition is false"}},"additionalProperties":false}'),m=["javascript","typescript","json"],p=[l,d],h={monaco:null,variableSuggestions:[],highlighter:null},x=null,g=async()=>(x??=(0,r.O_)({themes:[...p],langs:[...m]}),await x),f=(0,n.v)()((0,i.lt)((e,t)=>({...h,actions:{setVariableSuggestions(t){e({variableSuggestions:t})},setMonacoTheme(e){let a=t().monaco;a&&(a.editor.defineTheme("github-light-default",{base:"vs",inherit:!0,rules:[],colors:{"diffEditor.insertedTextBackground":"#3784ff19","diffEditor.insertedLineBackground":"#3784ff0d","scrollbarSlider.background":"#ccc5","scrollbarSlider.hoverBackground":"#bbb5","scrollbarSlider.activeBackground":"#aaa5"}}),a.editor.defineTheme("github-dark-default",{base:"vs-dark",inherit:!0,rules:[],colors:{"diffEditor.insertedTextBackground":"#69a3ff4d","diffEditor.insertedLineBackground":"#69a3ff33","scrollbarSlider.background":"#aaa5","scrollbarSlider.hoverBackground":"#bbb5","scrollbarSlider.activeBackground":"#ccc5"}}),a.editor.setTheme(e?d:l))},async setupHighlighter(a){let{highlighter:r,monaco:n,actions:i}=t();if(!n)return;let o=r??await g();(0,s.H)(o,n),i.setMonacoTheme(a),r||(e({highlighter:o}),x=null)},async setMonaco(){let s=await Promise.all([a.e(97698),a.e(35823),a.e(9143),a.e(89173),a.e(3767),a.e(34194)]).then(a.bind(a,34194));return window.monaco=s,e({monaco:s}),s.languages.register({id:c}),s.languages.json.jsonDefaults.setDiagnosticsOptions({schemas:[{uri:"https://json-schema.org/draft/2020-12/schema",fileMatch:["json-schema-*.json"],schema:u}],enableSchemaRequest:!0}),[s.languages.setMonarchTokensProvider(c,{tokenizer:{root:[[/\{\{([^}]+)}}/,"variable"]]}}),s.languages.registerCompletionItemProvider(c,{triggerCharacters:["{"],provideCompletionItems(e,a){let{variableSuggestions:r}=t(),n=e.getValueInRange({startLineNumber:1,startColumn:1,endLineNumber:a.lineNumber,endColumn:a.column}).match(/\{([^}]*)$/);if(!n)return console.log("No template variable match found"),{suggestions:[]};let i=n[1].toLowerCase(),o=r.filter(e=>e.toLowerCase().includes(i)),l=e.getWordUntilPosition(a),d=new s.Range(a.lineNumber,l.startColumn,a.lineNumber,l.endColumn);return{suggestions:[...o.map(e=>({label:e,detail:"Context variable",sortText:"0"})),{label:"$env.",detail:"Environment variable",sortText:"1"}].map(e=>({kind:s.languages.CompletionItemKind.Module,range:d,insertText:`{${e.label}}}`,...e}))}}})]}}}))),b=()=>f(e=>e.actions);function v(e){return f((0,o.k)(e))}},28018:(e,t,a)=>{"use strict";a.d(t,{HK:()=>o,WM:()=>d,wV:()=>l});var s=a(59112),r=a(17250),n=a(43647),i=a(29944);function o({className:e,...t}){return(0,s.jsx)(n.YZ,{"data-slot":"resizable-panel-group",className:(0,i.cn)("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t})}function l(e){return(0,s.jsx)(n.Zk,{"data-slot":"resizable-panel",...e})}function d({withHandle:e,className:t,...a}){return(0,s.jsx)(n.TW,{"data-slot":"resizable-handle",className:(0,i.cn)("bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:translate-x-0 data-[panel-group-direction=vertical]:after:-translate-y-1/2 [&[data-panel-group-direction=vertical]>div]:rotate-90",t),...a,children:e&&(0,s.jsx)("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:(0,s.jsx)(r.A,{className:"size-2.5"})})})}},37139:(e,t,a)=>{"use strict";a.d(t,{O:()=>r});var s=a(71506);let r=(0,s.createServerReference)("601dadc060641723dc094deeca51942d6663813bc6",s.callServer,void 0,s.findSourceMapURL,"getAllAgentsAction")},39968:(e,t,a)=>{"use strict";a.d(t,{T:()=>c});var s=a(59112),r=a(36608),n=a(95556),i=a(78522),o=a(26831),l=a(66552),d=a(29944);a(61946);let c=({value:e="",uri:t,readOnly:a,children:c,className:u,disabled:m,onChange:p,placeholder:h="",autoFocus:x,editorOptions:g,hasDynamicHeight:f=!0,onMount:b,...v})=>{let j=(0,n.useRef)(null),y=(0,n.useRef)(null),N=(0,n.useRef)(void 0),C=(0,o.Y1)(e=>e.monaco),{setupHighlighter:k}=(0,o.ib)();(0,n.useEffect)(()=>{let e=g?.wordWrap??"on";y.current?.updateOptions({readOnly:a||m,wordWrap:e,scrollbar:{horizontal:"on"===e?"hidden":"auto",alwaysConsumeMouseWheel:"on"!==e}})},[a,m,g?.wordWrap]),(0,n.useEffect)(()=>{let t=y.current?.getModel();t&&t.getValue()!==e&&t.setValue(e)},[e]),(0,n.useEffect)(()=>{N.current=p},[p]);let S="dark"===(0,r.D)().resolvedTheme;return(0,n.useEffect)(()=>{let s=j.current;if(!s||!C)return;let{editor:r}=C,{model:n,language:i}=(0,l.pj)({monaco:C,uri:t,value:e}),o=r.create(s,{model:n,language:i,extraEditorClassName:"[--vscode-editor-background:transparent]! [--vscode-editorGutter-background:transparent]! [--vscode-focusBorder:transparent]!",automaticLayout:!0,minimap:{enabled:!1},overviewRulerLanes:0,scrollBeyondLastLine:!1,lineNumbers:"off",wordWrap:"on",contextmenu:!1,fixedOverflowWidgets:!0,padding:{top:12,bottom:12},scrollbar:{horizontal:"hidden",useShadows:!1,alwaysConsumeMouseWheel:!1},stickyScroll:{enabled:!1},tabSize:2,readOnly:a,placeholder:h.replaceAll(/^\s+/gm,e=>"\xa0".repeat(e.length)),fontSize:12,lineDecorationsWidth:0,editContext:!1,...g});y.current=o;let d=[n,n.onDidChangeContent(()=>{let e=N.current;e&&e(n.getValue())}),o,o.addAction({id:"disable-command-palette",label:"Disable Command Palette",keybindings:[C.KeyCode.F1],run(){}}),o.onKeyDown(e=>{"Space"===e.code&&e.browserEvent.stopPropagation()})];if(x&&requestAnimationFrame(()=>{o.focus()}),f){function c(){if(n.isDisposed())return;let e=o.getContentHeight();if(!n.getValue()&&h){let t=h.split("\n"),a=o.getOption(r.EditorOption.lineHeight),{top:s,bottom:n}=o.getOption(r.EditorOption.padding);e=t.length*a+s+n}s&&(s.style.height=`${e}px`)}c(),d.push(o.onDidContentSizeChange(c))}return k(S),b?.(o),(0,l.Ye)(d)},[C]),(0,s.jsxs)("div",{className:(0,d.cn)("max-h-screen",!f&&"h-full","rounded-md relative dark:bg-input/30 transition-colors text-foreground","border border-input shadow-xs",m?"cursor-not-allowed opacity-50 bg-muted [&>.monaco-editor]:pointer-events-none":"has-[&>.focused]:border-ring has-[&>.focused]:ring-ring/50 has-[&>.focused]:ring-[3px]","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",u,!C&&"px-3 py-4","[&_.native-edit-context]:caret-transparent"),...v,ref:j,children:[!C&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.E,{className:"h-4 w-4/5"}),(0,s.jsx)(i.E,{className:"h-4 w-3/5 mt-3 mb-full"})]}),c]})}},42135:(e,t,a)=>{"use strict";a.d(t,{U:()=>i});var s=a(59112),r=a(98163),n=a(99716);function i({control:e,name:t,label:a,placeholder:i,options:o,disabled:l=!1,selectTriggerClassName:d,description:c,isRequired:u=!1}){return(0,s.jsx)(n.u,{control:e,name:t,label:a,description:c,isRequired:u,children:e=>(0,s.jsxs)(r.l6,{onValueChange:e.onChange,defaultValue:e.value,disabled:l,children:[(0,s.jsx)(r.bq,{disabled:l,className:d,children:(0,s.jsx)(r.yv,{placeholder:i})}),(0,s.jsx)(r.gC,{children:o.map(e=>(0,s.jsx)(r.eb,{value:e.value,disabled:e.disabled,children:e.label},e.value))})]})})}},43189:(e,t,a)=>{"use strict";a.d(t,{i:()=>i});var s=a(59112),r=a(95556),n=a(39968);let i=({uri:e,editorOptions:t,...a})=>{let i=(0,r.useId)();return e??=`${i}.json`,(0,s.jsx)(n.T,{uri:e,editorOptions:{ariaLabel:"JSON editor",...t},...a})}},45667:(e,t,a)=>{"use strict";a.d(t,{d:()=>i});var s=a(59112),r=a(21911),n=a(29944);function i({className:e,...t}){return(0,s.jsx)(r.bL,{"data-slot":"switch",className:(0,n.cn)("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,children:(0,s.jsx)(r.zi,{"data-slot":"switch-thumb",className:"pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0"})})}},47629:(e,t,a)=>{"use strict";a.d(t,{$:()=>d});var s=a(59112),r=a(95556),n=a(43189),i=a(46539),o=a(49769),l=a(29944);let d=({value:e="",onChange:t,actions:a,...d})=>{let c=(0,r.useCallback)(()=>{e.trim()&&t((0,l.IB)(e))},[t,e]),u=(0,r.useCallback)(()=>{t((0,o.Qj)())},[t]),m=(0,s.jsxs)(s.Fragment,{children:[a,!e.trim()&&(0,s.jsx)(i.$,{type:"button",onClick:u,variant:"outline",size:"sm",className:"backdrop-blur-xl h-6 px-2 text-xs rounded-sm",children:"Template"}),(0,s.jsx)(i.$,{type:"button",onClick:c,variant:"outline",size:"sm",className:"backdrop-blur-xl h-6 px-2 text-xs rounded-sm",disabled:!e.trim(),children:"Format"})]});return(0,s.jsx)(n.i,{value:e,onChange:t,...d,children:(0,s.jsx)("div",{className:"absolute end-2 top-2 flex gap-2 z-1",children:m})})}},49609:(e,t,a)=>{"use strict";a.d(t,{BT:()=>l,Wu:()=>d,ZB:()=>o,Zp:()=>n,aR:()=>i,wL:()=>c});var s=a(59112),r=a(29944);function n({className:e,...t}){return(0,s.jsx)("div",{"data-slot":"card",className:(0,r.cn)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function i({className:e,...t}){return(0,s.jsx)("div",{"data-slot":"card-header",className:(0,r.cn)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function o({className:e,...t}){return(0,s.jsx)("div",{"data-slot":"card-title",className:(0,r.cn)("leading-none font-semibold",e),...t})}function l({className:e,...t}){return(0,s.jsx)("div",{"data-slot":"card-description",className:(0,r.cn)("text-muted-foreground text-sm",e),...t})}function d({className:e,...t}){return(0,s.jsx)("div",{"data-slot":"card-content",className:(0,r.cn)("px-6",e),...t})}function c({className:e,...t}){return(0,s.jsx)("div",{"data-slot":"card-footer",className:(0,r.cn)("flex items-center px-6 [.border-t]:pt-6",e),...t})}},49769:(e,t,a)=>{"use strict";a.d(t,{Qj:()=>c,SR:()=>u,_O:()=>d});var s=a(44940),r=a(71608);let n=s.ZU.Object({type:s.ZU.Union([s.ZU.Literal("string"),s.ZU.Literal("number"),s.ZU.Literal("integer"),s.ZU.Literal("boolean"),s.ZU.Literal("array"),s.ZU.Literal("object"),s.ZU.Literal("null")]),description:s.ZU.String({minLength:1}),format:s.ZU.Optional(s.ZU.String()),pattern:s.ZU.Optional(s.ZU.String()),minimum:s.ZU.Optional(s.ZU.Number()),maximum:s.ZU.Optional(s.ZU.Number()),minLength:s.ZU.Optional(s.ZU.Number()),maxLength:s.ZU.Optional(s.ZU.Number()),items:s.ZU.Optional(s.ZU.Any()),properties:s.ZU.Optional(s.ZU.Any()),enum:s.ZU.Optional(s.ZU.Array(s.ZU.Any())),const:s.ZU.Optional(s.ZU.Any()),default:s.ZU.Optional(s.ZU.Any())}),i=s.ZU.Object({type:s.ZU.Literal("object"),properties:s.ZU.Record(s.ZU.String(),n),required:s.ZU.Array(s.ZU.String(),{minItems:1}),additionalProperties:s.ZU.Optional(s.ZU.Boolean()),description:s.ZU.Optional(s.ZU.String())}),o=r.gv.Compile(n),l=r.gv.Compile(i);function d(e){let t,a,s=[],{parsed:r,errors:n}=function(e){let t=[],a=null;if(!e?.trim())return{parsed:null,errors:t};try{a=JSON.parse(e)}catch(e){t.push({path:"root",message:e instanceof Error?e.message:"Invalid JSON syntax",type:"syntax"})}return{parsed:a,errors:t}}(e);if(n.length>0)return{isValid:!1,errors:n,warnings:s};if(!r)return{isValid:!0,errors:[],warnings:["Empty schema provided"]};let i=[...(t=[],r&&"object"==typeof r?!l.Check(r)&&(r.type&&"object"===r.type||t.push({path:"type",message:'Schema must have type: "object" for LLM compatibility',type:"llm_requirement"}),r.properties&&"object"==typeof r.properties||t.push({path:"properties",message:'Schema must have a "properties" object',type:"schema"}),r.required&&!Array.isArray(r.required)&&t.push({path:"required",message:'Schema must have a "required" array (can be empty)',type:"llm_requirement"}),r.properties&&"object"==typeof r.properties&&Object.entries(r.properties).forEach(([e,a])=>{o.Check(a)||[...o.Errors(a)].forEach(a=>{let s=a.message;"/description"===a.path?s='Each property must have a "description" for LLM compatibility':"/type"===a.path&&(s='Each property must have a valid "type"'),t.push({path:`properties.${e}${a.path}`,message:s,type:"/description"===a.path?"llm_requirement":"schema"})})})):t.push({path:"root",message:"Schema must be an object",type:"schema"}),t),...(a=[],r&&"object"==typeof r&&(r.required&&Array.isArray(r.required)&&r.properties&&r.required.forEach(e=>{r.properties[e]||a.push({path:"required",message:`Required property "${e}" must exist in properties`,type:"schema"})}),r.properties&&"object"==typeof r.properties&&Object.entries(r.properties).forEach(([e,t])=>{t.description&&"string"==typeof t.description&&0!==t.description.trim().length||a.push({path:`properties.${e}.description`,message:"Each property must have a non-empty description for LLM compatibility",type:"llm_requirement"})})),a)];return{isValid:0===i.length,errors:i,warnings:s}}function c(){return JSON.stringify({type:"object",properties:{example_property:{type:"string",description:"Description of what this property represents"}},required:["example_property"]},null,2)}function u(e){if(e instanceof SyntaxError){let t=e.message.toLowerCase();return t.includes("unexpected end of json input")?"Incomplete JSON - missing closing brackets or quotes":t.includes("unexpected token")?"Invalid character in JSON - check for missing commas, quotes, or brackets":t.includes("expected property name")||t.includes("expected ':' after property name")?"Property names must be in double quotes":t.includes("duplicate keys")?"Duplicate property names are not allowed":"Invalid JSON syntax - check structure and formatting"}return"Unable to parse JSON"}},53716:(e,t,a)=>{"use strict";a.d(t,{S:()=>o});var s=a(59112),r=a(82199),n=a(72715),i=a(29944);function o({className:e,...t}){return(0,s.jsx)(r.bL,{"data-slot":"checkbox",className:(0,i.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",e),...t,children:(0,s.jsx)(r.C1,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:(0,s.jsx)(n.A,{className:"size-3.5"})})})}},59314:(e,t,a)=>{"use strict";a.d(t,{r:()=>i});var s=a(59112),r=a(81186),n=a(81586);function i({code:e}){return(0,s.jsx)("div",{className:"flex items-center gap-2 relative bg-muted/50 dark:bg-muted/30 rounded-md border",children:(0,s.jsxs)(n.F,{dir:"ltr",className:"w-full",children:[(0,s.jsx)("pre",{className:"text-sm text-foreground/90 px-3 pr-8 py-2 font-mono",children:e}),(0,s.jsx)(r.i,{className:"absolute right-1 top-1/2 -translate-y-1/2",textToCopy:e}),(0,s.jsx)(n.$,{orientation:"horizontal"})]})})}},59994:(e,t,a)=>{"use strict";a.d(t,{O:()=>r});var s=a(71506);let r=(0,s.createServerReference)("78d7668931e501abf38bee2881466c42f8a6c3786b",s.callServer,void 0,s.findSourceMapURL,"fetchExternalAgents")},61946:(e,t,a)=>{globalThis.MonacoEnvironment={getWorker:(e,t)=>new Worker((console.info("setup-workers/webpack",{label:t}),"json"===t)?a.tu(new URL(a.p+a.u(22063),a.b)):"typescript"===t||"javascript"===t?a.tu(new URL(a.p+a.u(44444),a.b)):a.tu(new URL(a.p+a.u(48830),a.b)))}},64869:(e,t,a)=>{"use strict";a.d(t,{t:()=>n});var s=a(95556),r=a(1439);function n({tenantId:e,projectId:t,agentId:a,enabled:n=!0}){let{PUBLIC_INKEEP_AGENTS_MANAGE_API_URL:i}=(0,r.y)(),[o,l]=(0,s.useState)(null),[d,c]=(0,s.useState)(null),[u,m]=(0,s.useState)(!0),[p,h]=(0,s.useState)(null),x=(0,s.useCallback)(async()=>{try{let s=await fetch(`${i}/tenants/${e}/playground/token`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectId:t,agentId:a})});if(!s.ok)throw Error("Failed to fetch temporary API key");let r=await s.json();l(r.apiKey),c(r.expiresAt),h(null)}catch(e){h(e instanceof Error?e:Error("Unknown error"))}finally{m(!1)}},[e,t,a,i]);return(0,s.useEffect)(()=>{n&&a?x():m(!1)},[n,a,x]),(0,s.useEffect)(()=>{if(!d)return;let e=setTimeout(()=>{console.log("Auto-refreshing temporary API key before expiry..."),x()},Math.max(0,new Date(d).getTime()-Date.now()-3e5));return()=>clearTimeout(e)},[d,x]),{apiKey:o,isLoading:u,error:p,refresh:x}}},65006:(e,t,a)=>{"use strict";a.d(t,{ErrorContent:()=>f,default:()=>m});var s=a(59112),r=a(79814),n=a(66517),i=a(85500),o=a(62351),l=a.n(o),d=a(73027),c=a(22408),u=a(46539);function m({statusCode:e,errorCode:t,...a}){let r=e??g(t);return(0,s.jsx)(d.H,{breadcrumbs:[{label:r?`${r} Error`:"Error"}],children:(0,s.jsx)(c.D,{className:"flex-1",children:(0,s.jsx)(f,{statusCode:r,errorCode:t,...a})})})}function p(e){return"object"==typeof e&&null!==e&&"status"in e&&"number"==typeof e.status}let h={not_found:404,forbidden:403,unauthorized:401,internal_server_error:500,service_unavailable:503,bad_request:400,validation_error:400,unprocessable_entity:422},x={404:"not_found",403:"forbidden",401:"unauthorized",500:"internal_server_error",503:"service_unavailable",400:"bad_request",422:"unprocessable_entity"};function g(e){if(e)return h[e]}function f({error:e,errorCode:t,icon:a=r.A,reset:o,title:d,description:c,link:m,linkText:h,statusCode:f,showRetry:b=!0,onRetry:v,context:j="resource"}){let y=t,N=f;!y&&!N&&e&&("object"==typeof e&&null!==e&&"status"in e&&"number"==typeof e.status&&"error"in e&&"object"==typeof e.error&&null!==e.error&&"message"in e.error&&"string"==typeof e.error.message?N=e.status:p(e.cause)?N=e.cause.status:p(e)&&(N=e.status));y&&!N?N=g(y):N&&!y&&(y=function(e){if(e)return x[e]}(N));let C=d,k=c;if(!C){let e=function(e,t){let a=t.charAt(0).toUpperCase()+t.slice(1);switch(e){case"not_found":return{title:`${a} not found`,description:`The ${t} you are looking for does not exist or has been deleted.`};case"forbidden":return{title:"Access denied",description:`You do not have permission to access this ${t}.`};case"unauthorized":return{title:"Authentication required",description:"Please sign in to access this resource."};case"internal_server_error":return{title:"Server error",description:"An error occurred on the server. Please try again later."};case"service_unavailable":return{title:"Service unavailable",description:"The service is temporarily unavailable. Please try again in a few moments."};case"bad_request":case"validation_error":case"unprocessable_entity":return{title:"Invalid request",description:`The request to load this ${t} was invalid. Please try again.`};default:return{title:`Failed to load ${t}`,description:`An unexpected error occurred while loading this ${t}.`}}}(y,j);C=e.title,k||(k=e.description)}return k||(k="An unexpected error occurred. Please try again."),(0,s.jsxs)("main",{"aria-labelledby":"error-title",className:"flex flex-col items-center justify-center h-full gap-10 px-4",children:[(0,s.jsx)("h1",{id:"error-title",className:"sr-only",children:C}),N?(0,s.jsx)("div",{className:"text-8xl font-mono font-bold text-foreground","aria-hidden":"true",children:N}):(0,s.jsx)(a,{className:"w-14 h-14 text-foreground",strokeWidth:1,"aria-hidden":"true"}),(0,s.jsxs)("div",{className:"flex flex-col items-center gap-2 text-center max-w-md",children:[(0,s.jsx)("h2",{className:"text-lg text-muted-foreground font-mono uppercase",children:C}),(0,s.jsx)("p",{className:"text-muted-foreground text-sm",children:k})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[b&&(0,s.jsxs)(u.$,{onClick:()=>{o?o():v?v():window.location.reload()},variant:"outline",children:[(0,s.jsx)(n.A,{className:"w-4 h-4"}),"Try Again"]}),m&&h&&(0,s.jsx)(u.$,{asChild:!0,variant:"outline",children:(0,s.jsxs)(l(),{href:m,className:"flex items-center gap-2",children:[(0,s.jsx)(i.A,{className:"w-4 h-4"}),h]})})]})]})}},66552:(e,t,a)=>{"use strict";function s({monaco:e,editorInstance:t,content:a,addedContent:s=" #"}){let r=[],n=e.editor.tokenize(a,"json"),i=a.split("\n");for(let[t,a]of n.entries()){let n=t+1,o=i[n-1];for(let t=a.length-1;t>=0;t--){if(!function(e){switch(e){case"string.value.json":case"number.json":case"keyword.json":case"string":return!0}return!1}(a[t].type))continue;let i=a[t+1],l=i?i.offset+1:o.length,d=new e.Range(n,l,n,l+1);r.push({range:d,options:{after:{content:s,inlineClassName:"copy-button-icon"}}});break}}let o=t.createDecorationsCollection(r);return{decorations:r,decorationCollection:o}}function r({uri:e,value:t,monaco:a}){let s=a.Uri.file(e),r=s.path.split(".").at(-1);if(!r)throw Error(`Could not determine file language from path: "${s.path}"`);switch(r){case"js":case"jsx":r="javascript";break;case"ts":case"tsx":r="typescript"}return{language:r,model:a.editor.getModel(s)??a.editor.createModel(t,r,s)}}function n(e){return()=>{for(let t of e)t.dispose()}}a.d(t,{Xe:()=>s,Ye:()=>n,pj:()=>r})},70757:(e,t,a)=>{"use strict";a.d(t,{Q:()=>i});var s=a(59112),r=a(95556),n=a(73955);let i=(0,r.forwardRef)((e,t)=>(0,s.jsxs)(n.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"})]}));i.displayName="MCPIcon"},73027:(e,t,a)=>{"use strict";a.d(t,{H:()=>d});var s=a(59112),r=a(41815),n=a(97512),i=a(58038),o=a(29752);function l({breadcrumbs:e}){return(0,s.jsxs)("header",{className:"h-(--header-height) shrink-0 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] flex items-center gap-1 px-4 lg:gap-2 lg:px-6",children:[(0,s.jsx)(i.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,s.jsx)(n.Separator,{orientation:"vertical",className:"mx-2 data-[orientation=vertical]:h-4"}),(0,s.jsx)(r.Breadcrumbs,{items:e}),(0,s.jsx)(n.Separator,{orientation:"vertical",className:"mx-2 data-[orientation=vertical]:h-4 ml-auto"}),(0,s.jsx)(o.HeaderMenus,{})]})}function d({children:e,breadcrumbs:t}){return(0,s.jsxs)("div",{className:"h-[calc(100vh-16px)] flex flex-col overflow-hidden",children:[(0,s.jsx)(l,{breadcrumbs:t}),(0,s.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,s.jsx)("div",{id:"main-content",className:"@container/main min-h-0 flex flex-1 flex-col",children:e})})]})}},81186:(e,t,a)=>{"use strict";a.d(t,{i:()=>d});var s=a(59112),r=a(72715),n=a(68856),i=a(95556),o=a(29944),l=a(46539);function d({textToCopy:e,className:t,variant:a="ghost",size:d="icon-sm",iconClassName:c}){let{isCopied:u,copyToClipboard:m}=function({timeout:e=2e3}){let[t,a]=i.useState(!1);return{isCopied:t,copyToClipboard:t=>{!navigator.clipboard?.writeText||t&&navigator.clipboard.writeText(t).then(()=>{a(!0),setTimeout(()=>{a(!1)},e)})}}}({});return(0,s.jsxs)(l.$,{variant:a,size:d,className:(0,o.cn)("backdrop-blur-sm bg-card/90 hover:bg-card border border-border shadow-sm",t),onClick:()=>m(e),children:[u?(0,s.jsx)(r.A,{className:(0,o.cn)("w-4 h-4 text-green-600 dark:text-green-400",c)}):(0,s.jsx)(n.A,{className:(0,o.cn)("!w-3 !h-3 text-muted-foreground dark:text-foreground",c)}),(0,s.jsx)("span",{className:"sr-only",children:"Copy"})]})}},81586:(e,t,a)=>{"use strict";a.d(t,{$:()=>o,F:()=>i});var s=a(59112),r=a(2807),n=a(29944);function i({className:e,children:t,...a}){return(0,s.jsxs)(r.bL,{"data-slot":"scroll-area",className:(0,n.cn)("relative",e),...a,children:[(0,s.jsx)(r.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:t}),(0,s.jsx)(o,{}),(0,s.jsx)(r.OK,{})]})}function o({className:e,orientation:t="vertical",...a}){return(0,s.jsx)(r.VM,{"data-slot":"scroll-area-scrollbar",orientation:t,className:(0,n.cn)("flex touch-none p-px transition-colors select-none","vertical"===t&&"h-full w-2.5 border-l border-l-transparent","horizontal"===t&&"h-2.5 flex-col border-t border-t-transparent",e),...a,children:(0,s.jsx)(r.lr,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}},86576:(e,t,a)=>{Promise.resolve().then(a.bind(a,99686)),Promise.resolve().then(a.bind(a,65006)),Promise.resolve().then(a.bind(a,29752)),Promise.resolve().then(a.bind(a,41815)),Promise.resolve().then(a.bind(a,97512)),Promise.resolve().then(a.bind(a,58038))},88031:(e,t,a)=>{"use strict";a.d(t,{i:()=>r});var s=a(71506);let r=(0,s.createServerReference)("7cf9743e3d8fa97d44b3dc5e51d3765b501afa32fa",s.callServer,void 0,s.findSourceMapURL,"fetchMCPTools")},94172:(e,t,a)=>{"use strict";a.d(t,{_g:()=>i,iO:()=>n});var s=a(59112),r=a(7707);let n="https://docs.inkeep.com";s.Fragment,r.G,s.Fragment,r.G;let i=(0,s.jsxs)(s.Fragment,{children:["Agents are visual representations of the data flow between sub agents and tools.","\n",(0,s.jsx)(r.G,{href:`${n}/visual-builder/agent`,children:"Learn more"})]});s.Fragment,s.Fragment,s.Fragment,r.G},98163:(e,t,a)=>{"use strict";a.d(t,{bq:()=>u,eb:()=>p,gC:()=>m,l6:()=>d,yv:()=>c});var s=a(59112),r=a(63027),n=a(62063),i=a(72715),o=a(4774),l=a(29944);function d({...e}){return(0,s.jsx)(r.bL,{"data-slot":"select",...e})}function c({...e}){return(0,s.jsx)(r.WT,{"data-slot":"select-value",...e})}function u({className:e,size:t="default",children:a,...i}){return(0,s.jsxs)(r.l9,{"data-slot":"select-trigger","data-size":t,className:(0,l.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",e),...i,children:[a,(0,s.jsx)(r.In,{asChild:!0,children:(0,s.jsx)(n.A,{className:"size-4 opacity-50"})})]})}function m({className:e,children:t,position:a="popper",...n}){return(0,s.jsx)(r.ZL,{children:(0,s.jsxs)(r.UC,{"data-slot":"select-content",className:(0,l.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"===a&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:a,...n,children:[(0,s.jsx)(h,{}),(0,s.jsx)(r.LM,{className:(0,l.cn)("p-1","popper"===a&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),(0,s.jsx)(x,{})]})})}function p({className:e,children:t,...a}){return(0,s.jsxs)(r.q7,{"data-slot":"select-item",className:(0,l.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",e),...a,children:[(0,s.jsx)("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:(0,s.jsx)(r.VF,{children:(0,s.jsx)(i.A,{className:"size-4"})})}),(0,s.jsx)(r.p4,{children:t})]})}function h({className:e,...t}){return(0,s.jsx)(r.PP,{"data-slot":"select-scroll-up-button",className:(0,l.cn)("flex cursor-default items-center justify-center py-1",e),...t,children:(0,s.jsx)(o.A,{className:"size-4"})})}function x({className:e,...t}){return(0,s.jsx)(r.wn,{"data-slot":"select-scroll-down-button",className:(0,l.cn)("flex cursor-default items-center justify-center py-1",e),...t,children:(0,s.jsx)(n.A,{className:"size-4"})})}},98788:(e,t,a)=>{"use strict";a.d(t,{I:()=>n});var s=a(59112),r=a(95556);function n({messages:e=["Thinking","Looking for content","Analyzing"],variant:t="inkeep"}){let[a,n]=(0,r.useState)(0);return(0,r.useEffect)(()=>{let t=setInterval(()=>{n(a=>a+1<e.length?a+1:(clearInterval(t),a))},3500);return()=>clearInterval(t)},[e.length]),(0,s.jsxs)("div",{className:"flex items-center space-x-2 font-medium text-sm text-gray-700 dark:text-gray-dark-300","aria-live":"polite",children:[(0,s.jsx)("span",{className:`animate-shimmer ${"inkeep"===t?"bg-[linear-gradient(to_bottom_right,_var(--ikp-color-gray-700),_var(--ikp-color-gray-400))] dark:bg-[linear-gradient(to_bottom_right,_var(--ikp-color-gray-dark-300),_var(--ikp-color-gray-dark-100))]":"bg-[linear-gradient(to_bottom_right,_#374151,_#9ca3af)] dark:bg-[linear-gradient(to_bottom_right,_#d1d5db,_#f3f4f6)]"} bg-clip-text text-transparent`,children:e[a]}),(0,s.jsx)("div",{className:"flex space-x-1",children:[0,1,2].map(e=>(0,s.jsx)("span",{className:"animate-bounce-dot opacity-30",style:{animationDelay:`${.2*e}s`},children:"."},e))})]})}},99686:(e,t,a)=>{"use strict";a.d(t,{Agent:()=>sa});var s,r=a(59112),n=a(54808),i=a(93337),o=a(45393),l=a(92400),d=a(95556),c=a(21933),u=a(41825),m=a(50467),p=a(14711),h=a(65905),x=a(98788);let g=()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"w-full h-full bg-background/50 absolute top-0 left-0 z-1"}),(0,r.jsx)(n.Zk,{position:"top-center",className:"z-10",children:(0,r.jsxs)("div",{className:"flex items-center gap-2 bg-background dark:bg-sidebar px-4 py-2 rounded-lg shadow-[0_2px_20px_rgba(0,0,0,0.08)] dark:shadow-none z-10",children:[(0,r.jsx)(h.A,{className:"w-4 h-4 animate-spin text-primary"}),(0,r.jsx)(x.I,{messages:["Thinking","Reviewing agent","Preparing changes"],variant:"tailwind"})]})})]});var f=a(46539),b=a(97512),v=a(16559),j=a(79808),y=a(32618),N=a(65686),C=a(80381),k=a(21785);let S=[{label:"Build a weather agent",value:"Help me build an agent that can tell me the weather in any city."},{label:"Build a recipe agent",value:"Help me build an agent that can help me find recipes."},{label:"Build a travel agent",value:"Help me build an agent that can help me plan my travel."}],T=N.object({message:N.string().min(1,"Message is required")}),w={message:""};function A(){let e=(0,y.mN)({resolver:(0,v.u)(T),defaultValues:w}),{isSubmitting:t}=e.formState,{chatFunctionsRef:a,openCopilot:s}=(0,p.F)();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(C.lV,{...e,children:(0,r.jsxs)("form",{className:"flex flex-col items-center border bg-background rounded-xl w-full focus-within:border-ring focus-within:ring-ring/50 shadow-sm",onSubmit:e.handleSubmit(({message:e})=>{a?.current&&(s(),setTimeout(()=>{a?.current?.submitMessage(e)},100))}),children:[(0,r.jsx)(C.zB,{control:e.control,name:"message",render:({field:e})=>(0,r.jsx)(C.MJ,{children:(0,r.jsx)(k.T,{placeholder:"Ask Agent Builder to build...",className:"w-full border-none focus-visible:ring-0 focus-visible:border-none resize-none shadow-none p-3 max-h-[200px] min-h-[54px] rounded-b-none rounded-t-xl",autoFocus:!0,...e})})}),(0,r.jsx)("div",{className:"flex justify-end w-full px-3 pb-3 dark:bg-input/30 rounded-b-xl",children:(0,r.jsxs)(f.$,{size:"icon",className:"h-7 w-7",type:"submit",disabled:t,children:[(0,r.jsx)("span",{className:"sr-only",children:"Submit"}),(0,r.jsx)(j.A,{className:"size-5"})]})})]})}),(0,r.jsx)("div",{className:"flex flex-row items-center justify-center gap-2 mt-3",children:S.map(t=>(0,r.jsx)(f.$,{type:"button",size:"xs",variant:"outline",className:"justify-center rounded-full font-normal font-sans normal-case backdrop-blur-3xl",onClick:()=>e.setValue("message",t.value),children:(0,r.jsx)("span",{className:"text-sm text-muted-foreground",children:t.label})},t.value))})]})}let E=()=>(0,r.jsxs)("div",{className:"w-2xl max-w-screen",children:[(0,r.jsx)("h3",{className:"text-lg text-muted-foreground font-medium text-center mb-3",children:"What would you like to build?"}),(0,r.jsx)(A,{})]}),I=({onAddInitialNode:e})=>(0,r.jsxs)("div",{children:[(0,r.jsx)(E,{}),(0,r.jsxs)("div",{className:"flex items-center gap-4 my-10",children:[(0,r.jsx)(b.Separator,{className:"flex-1"}),(0,r.jsx)("span",{className:"text-gray-400 dark:text-white/30 text-sm font-mono uppercase",children:"or"}),(0,r.jsx)(b.Separator,{className:"flex-1"})]}),(0,r.jsx)("div",{className:"flex justify-center",children:(0,r.jsx)(f.$,{type:"button",variant:"outline-primary",className:"backdrop-blur-3xl",size:"sm",onClick:e,children:"Start from scratch"})})]});var L=a(62063),O=a(16239),_=a(22978),$=a(18471),P=a(28968),z=a(34680),D=a(49609),M=a(31273),U=a(93534);let R=["agent","node","edge"];function H(){let[e,t]=(0,U.ab)({pane:(0,U.M1)(R),nodeId:U.tU,edgeId:U.tU});return{pane:e.pane,nodeId:e.nodeId,edgeId:e.edgeId,isOpen:!!e.pane,setQueryState:t,openAgentPane:()=>t({pane:"agent",nodeId:null,edgeId:null})}}function V({title:e,errors:t,icon:a,onNavigate:s,getItemLabel:n}){let[i,o]=(0,d.useState)(!1);if(0===t.length)return null;let l={};for(let e of t){let t=e.nodeId||e.edgeId||"general";l[t]||(l[t]=[]),l[t].push(e)}return(0,r.jsxs)(M.Nt,{open:i,onOpenChange:o,children:[(0,r.jsx)(M.R6,{asChild:!0,children:(0,r.jsx)(f.$,{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:[a,(0,r.jsxs)("span",{className:"font-medium",children:[e," (",t.length,")"]}),i?(0,r.jsx)(L.A,{className:"w-3 h-3 ml-auto"}):(0,r.jsx)(O.A,{className:"w-3 h-3 ml-auto"})]})})}),(0,r.jsx)(M.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(l).map(([e,t])=>(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[n&&(0,r.jsx)("span",{className:"text-xs font-medium text-foreground truncate",children:n(t[0])}),s&&"general"!==e&&(0,r.jsx)(f.$,{size:"sm",variant:"outline",onClick:()=>s(e),className:"h-5 px-1.5 text-xs",children:"Go to"})]}),(0,r.jsx)("div",{className:"space-y-2",children:t.map((t,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:[t.field,":"]}),(0,r.jsx)("div",{className:"text-xs leading-relaxed",children:t.message})]},`${e}-${a}`))})]},e))})]})}function B({errorSummary:e,onClose:t,onNavigateToNode:a,onNavigateToEdge:s}){let{setQueryState:n}=H(),i=e=>{n({pane:"node",nodeId:e,edgeId:null}),a?.(e)},o=Object.values(e.subAgentErrors).flat(),l=Object.values(e.functionToolErrors).flat(),d=Object.values(e.edgeErrors).flat(),c=e.agentErrors;return(0,r.jsxs)(D.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)(D.aR,{className:"px-3",children:(0,r.jsxs)(D.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)(_.A,{className:"w-4 h-4"}),(0,r.jsxs)("span",{children:["Validation Errors (",e.totalErrors,")"]})]}),(0,r.jsx)(f.$,{variant:"ghost",size:"sm",onClick:t,className:"h-6 w-6 p-0",children:(0,r.jsx)($.A,{className:"w-3 h-3"})})]})}),(0,r.jsxs)(D.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 agent:"}),(0,r.jsx)(V,{title:"Sub Agent Errors",errors:o,icon:(0,r.jsx)(P.A,{className:"w-3 h-3"}),onNavigate:i,getItemLabel:e=>`Agent (${e.nodeId})`}),(0,r.jsx)(V,{title:"Function Tool Errors",errors:l,icon:(0,r.jsx)(z.A,{className:"w-3 h-3"}),onNavigate:i,getItemLabel:e=>`Function Tool (${e.nodeId})`}),(0,r.jsx)(V,{title:"Connection Errors",errors:d,icon:(0,r.jsx)("div",{className:"w-3 h-3 border rounded-full"}),onNavigate:e=>{n({pane:"edge",nodeId:null,edgeId:e}),s?.(e)},getItemLabel:e=>`Connection (${e.edgeId})`}),(0,r.jsx)(V,{title:"Agent Configuration Errors",errors:c,icon:(0,r.jsx)(_.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 Z(){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 F(){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 q=a(59322);function W(){let{openCopilot:e,isCopilotConfigured:t}=(0,p.F)(),{agentId:a}=(0,l.useParams)();return t?(0,r.jsxs)(f.$,{className:"normal-case justify-start font-sans dark:bg-input/30 dark:border-input dark:hover:bg-input/50 backdrop-blur-3xl",variant:"outline-primary",type:"button",onClick:e,children:[(0,r.jsx)(q.A,{}),a?"Edit with AI":"Build with AI"]}):null}var J=a(17250);function G({node:e}){let{type:t,name:a,Icon:s,disabled:n}=e;return(0,r.jsxs)("div",{role:"button",tabIndex:n?-1:0,"aria-label":`Drag ${a} node`,className:"backdrop-blur-3xl 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:!n,onDragStart:t=>{t.dataTransfer.setData("application/reactflow",JSON.stringify(e)),t.dataTransfer.effectAllowed="move"},children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(s,{className:"h-4 w-4 text-muted-foreground"}),(0,r.jsx)("div",{className:"flex flex-col items-start min-w-0",children:(0,r.jsx)("span",{className:"truncate w-full inline-block",children:a})})]}),(0,r.jsx)(J.A,{className:"h-4 w-4 text-muted-foreground/30 opacity-0 group-hover:opacity-100 transition-all ease-in-out duration-200"})]},t)}let K=[m.fL[m.Z6.SubAgent],m.fL[m.Z6.TeamAgentPlaceholder],m.fL[m.Z6.ExternalAgentPlaceholder],m.fL[m.Z6.MCPPlaceholder],m.fL[m.Z6.FunctionTool]];function Y(){return(0,r.jsxs)("div",{className:"flex flex-col gap-2 max-w-72 w-40 min-w-0",children:[K.map(e=>(0,r.jsx)(G,{node:e},e.type)),(0,r.jsx)(W,{})]})}var X=a(78522),Q=a(29944);let ee=({className:e,...t})=>(0,r.jsxs)("div",{className:(0,Q.cn)("space-y-8 flex flex-col",e),...t,children:[(0,r.jsxs)("div",{className:"space-y-8",children:[(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(X.E,{className:"h-3.5 w-16"}),(0,r.jsx)(X.E,{className:"h-9 w-full rounded-md"})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(X.E,{className:"h-3.5 w-16"}),(0,r.jsx)(X.E,{className:"h-9 w-full rounded-md"})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(X.E,{className:"h-3.5 w-20"}),(0,r.jsx)(X.E,{className:"h-20 w-full rounded-md"})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(X.E,{className:"h-3.5 w-20"}),(0,r.jsx)(X.E,{className:"h-9 w-full rounded-md"})]})]}),(0,r.jsx)("div",{className:"h-px bg-border"}),(0,r.jsxs)("div",{className:"space-y-8",children:[(0,r.jsx)(X.E,{className:"h-6 w-32"}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(X.E,{className:"h-4 w-16"}),(0,r.jsx)(X.E,{className:"h-9 w-full rounded-md"})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(X.E,{className:"h-4 w-28"}),(0,r.jsx)(X.E,{className:"h-9 w-full rounded-md"})]})]})]});var et=a(90032),ea=a(98264),es=a(85631),er=a(85500),en=a(81586);let ei=function({children:e}){return(0,r.jsx)("div",{className:"relative top-0 right-0 bg-background h-full flex flex-col rounded-br-[14px] group",children:e})},eo=function({children:e}){return(0,r.jsx)("div",{className:"flex items-center justify-between px-6 py-2 border-b flex-shrink-0 relative",children:e})},el=function({children:e}){return(0,r.jsx)(en.F,{className:"flex-1 h-0 [&>div>div]:table-fixed [&>div>div]:w-full",children:(0,r.jsx)("div",{className:"p-6",children:e})})},ed=function({onClick:e}){return(0,r.jsxs)(f.$,{variant:"ghost",size:"icon-sm",onClick:e,className:"-mr-1 text-foreground hover:text-foreground dark:text-foreground dark:hover:text-foreground",children:[(0,r.jsx)($.A,{className:"h-4 w-4"}),(0,r.jsx)("span",{className:"sr-only",children:"Close"})]})},ec=function({onClick:e}){return(0,r.jsxs)(f.$,{variant:"ghost",size:"icon-sm",onClick:e,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)(er.A,{className:"h-4 w-4"}),(0,r.jsx)("span",{className:"sr-only",children:"Back"})]})};var eu=a(46024),em=a(39470),ep=a(73955);let eh=(0,d.forwardRef)((e,t)=>(0,r.jsxs)(ep.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"})]}));eh.displayName="DashedSplineIcon";var ex=a(95684),eg=a(53716),ef=a(23579),eb=a(24689),ev=a(97253);function ej({className:e,...t}){return(0,r.jsx)(eb.bL,{className:(0,Q.cn)("grid gap-2",e),...t})}function ey({className:e,...t}){return(0,r.jsx)(eb.q7,{"data-slot":"radio-item",className:(0,Q.cn)("peer border-input text-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 dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-primary",e),...t,children:(0,r.jsx)(eb.C1,{"data-slot":"radio-indicator",className:"flex items-center justify-center",children:(0,r.jsx)(ev.A,{className:"size-2.5 fill-primary text-current"})})})}let eN="none";function eC({id:e,label:t,onCheckedChange:a,checked:s}){return(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)(eg.S,{id:e,onCheckedChange:t=>a(e,t),checked:s,className:"mt-[5px]"}),(0,r.jsx)("div",{className:"grid gap-2",children:(0,r.jsx)(ef.J,{htmlFor:e,className:"font-normal",children:t})})]})}function ek({icon:e,title:t,description:a,options:s,onCheckedChange:n,checkedValues:i,useRadio:o=!1,onRadioChange:l,defaultRadioValue:d}){let c;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:[e,(0,r.jsx)("h3",{className:"font-semibold text-sm",children:t})]}),(0,r.jsx)("p",{className:"text-muted-foreground text-sm",children:a})]}),o&&l?(0,r.jsx)(ej,{value:(c=s.find(e=>(!d||e.id!==d)&&i?.[e.id]))?c.id:d&&s.find(e=>e.id===d)?d:"",onValueChange:l,children:s.map(e=>(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)(ey,{value:e.id,id:e.id,className:"mt-[5px]"}),(0,r.jsx)("div",{className:"grid gap-2",children:(0,r.jsx)(ef.J,{htmlFor:e.id,className:"font-normal",children:e.label})})]},e.id))}):s.map(e=>(0,r.jsx)(eC,{id:e.id,label:e.label,onCheckedChange:n,checked:i?.[e.id]||!1},e.id))]})}let eS=function({selectedEdge:e}){let{updateEdgeData:t,setEdges:a,deleteElements:s,getEdges:i}=(0,n.VH)(),o=(0,d.useCallback)(()=>{s({edges:[{id:e.id}]})},[e.id,s]),l=(0,n.j7)(e.source),u=(0,n.j7)(e.target),{markUnsaved:m}=(0,ea.Sm)(),p=e.source===e.target,h=s=>{let r=s.transferSourceToTarget||s.transferTargetToSource||s.delegateSourceToTarget||s.delegateTargetToSource;m(),r?t(e.id,{relationships:s}):a(t=>t.filter(t=>t.id!==e.id))},x=(t,a)=>{let s;if(p){let r={};"transferSourceToTarget"===t?(r.transferSourceToTarget=a,r.transferTargetToSource=a):"delegateSourceToTarget"===t&&(r.delegateSourceToTarget=a,r.delegateTargetToSource=a),s={...e.data?.relationships,...r}}else{let r={[t]:a};a&&("delegateSourceToTarget"===t?r.delegateTargetToSource=!1:"delegateTargetToSource"===t&&(r.delegateSourceToTarget=!1)),s={...e.data?.relationships,...r}}h(s)},g=l?.data.name||l?.data.id||"Sub Agent",v=u?.data.name||u?.data.id||"Sub Agent",j=p?[{id:"transferSourceToTarget",label:(0,r.jsxs)("div",{children:[(0,r.jsx)(ex.E,{variant:"code",className:"my-0.5",children:g})," ","can transfer to itself"]})}]:[{id:"transferSourceToTarget",label:(0,r.jsxs)("div",{children:[(0,r.jsx)(ex.E,{variant:"code",className:"my-0.5",children:g})," ","can transfer to"," ",(0,r.jsx)(ex.E,{variant:"code",className:"my-0.5",children:v})]})},{id:"transferTargetToSource",label:(0,r.jsxs)("div",{children:[(0,r.jsx)(ex.E,{variant:"code",className:"my-0.5",children:v})," ","can transfer to"," ",(0,r.jsx)(ex.E,{variant:"code",className:"my-0.5",children:g})]})}],y=p?[{id:"delegateSourceToTarget",label:(0,r.jsxs)("div",{children:[(0,r.jsx)(ex.E,{variant:"code",className:"my-0.5",children:g})," ","can delegate to itself"]})},{id:eN,label:(0,r.jsx)("div",{className:"my-0.5 leading-[22px]",children:"None"})}]:[{id:"delegateSourceToTarget",label:(0,r.jsxs)("div",{children:[(0,r.jsx)(ex.E,{variant:"code",className:"my-0.5",children:g})," ","can delegate to"," ",(0,r.jsx)(ex.E,{variant:"code",className:"my-0.5",children:v})]})},{id:"delegateTargetToSource",label:(0,r.jsxs)("div",{children:[(0,r.jsx)(ex.E,{variant:"code",className:"my-0.5",children:v})," ","can delegate to"," ",(0,r.jsx)(ex.E,{variant:"code",className:"my-0.5",children:g})]})},{id:eN,label:(0,r.jsx)("div",{className:"my-0.5 leading-[22px]",children:"None"})}];return(0,r.jsxs)("div",{className:"space-y-8",children:[(0,r.jsx)(ek,{icon:(0,r.jsx)(eu.A,{className:"w-4 h-4 text-muted-foreground"}),title:"Transfer relationships",description:"Transfer relationships completely relinquish control from one agent to another.",options:j,onCheckedChange:x,checkedValues:e.data?.relationships}),(0,r.jsx)("hr",{}),(0,r.jsx)(ek,{icon:(0,r.jsx)(eh,{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. Delegate relationships cannot be bi-directional.",options:y,onCheckedChange:x,checkedValues:e.data?.relationships,useRadio:!0,onRadioChange:t=>{if(t&&(t=>{var a,s,r,n;let o,d,m="delegateSourceToTarget"===t?e.source:e.target,p="delegateSourceToTarget"===t?e.target:e.source;if(a=i().filter(t=>t.id!==e.id),s={source:m,target:p},d=(o=function(e){let t=new Map;for(let a of e){let e=a.data?.relationships;if(e){if(e.delegateSourceToTarget){let e=t.get(a.source)||[];t.set(a.source,[...e,a.target])}if(e.delegateTargetToSource){let e=t.get(a.target)||[];t.set(a.target,[...e,a.source])}}}return t}(a)).get(s.source)||[],o.set(s.source,[...d,s.target]),function(e){let t=new Set,a=new Set;for(let s of e.keys())if(!t.has(s)&&function s(r){for(let n of(t.add(r),a.add(r),e.get(r)||[]))if(t.has(n)){if(a.has(n))return!0}else if(s(n))return!0;return a.delete(r),!1}(s))return!0;return!1}(o)){let e=l?.data.name||l?.data.id||"Sub Agent",a=u?.data.name||u?.data.id||"Sub Agent";return c.oR.error("Circular Delegation Detected",{description:(r="delegateSourceToTarget"===t?e:a,n="delegateSourceToTarget"===t?a:e,`Cannot create delegation from "${r}" to "${n}" as it would create a circular delegation chain. Circular delegations can cause infinite loops.`)}),!0}return!1})(t))return;let a={...e.data?.relationships,delegateSourceToTarget:!1,delegateTargetToSource:!1};t===eN?(a.delegateSourceToTarget=!1,a.delegateTargetToSource=!1):t&&(p&&"delegateSourceToTarget"===t?(a.delegateSourceToTarget=!0,a.delegateTargetToSource=!0):a[t]=!0),h(a)},defaultRadioValue:eN}),(0,r.jsx)(b.Separator,{}),(0,r.jsx)("div",{className:"flex justify-end",children:(0,r.jsxs)(f.$,{variant:"destructive-outline",size:"sm",onClick:o,children:[(0,r.jsx)(em.A,{className:"size-4"}),"Delete"]})})]})};function eT({heading:e,Icon:t,className:a}){return(0,r.jsxs)("div",{className:(0,Q.cn)("text-sm font-medium flex items-center gap-2",a),children:[t&&(0,r.jsx)(t,{className:"size-4 text-muted-foreground"}),e]})}var ew=a(93409),eA=a(34368),eE=a(92013),eI=a(59314),eL=a(7707),eO=a(72715),e_=a(16125),e$=a(5892);function eP({isExplicit:e=!1,inheritedFrom:t,tooltip:a,size:s="sm",position:n="inline"}){return e?(0,r.jsx)(e$.B,{children:(0,r.jsxs)(e$.Tooltip,{children:[(0,r.jsx)(e$.TooltipTrigger,{asChild:!0,children:(0,r.jsxs)(ex.E,{variant:"outline",className:`
|
|
2
|
+
${"sm"===s?"h-5 px-1.5 text-xs":"h-6 px-2 text-sm"}
|
|
3
|
+
${"absolute"===n?"absolute -top-2 -right-2":"inline-flex"}
|
|
4
|
+
bg-green-50 dark:bg-green-950/20 border-green-200 dark:border-green-800
|
|
5
|
+
text-green-800 dark:text-green-200 items-center gap-1
|
|
6
|
+
`,children:[(0,r.jsx)(eO.A,{className:"sm"===s?"h-2.5 w-2.5":"h-3 w-3"}),"md"===s&&"Explicit"]})}),(0,r.jsx)(e$.TooltipContent,{children:(0,r.jsx)("p",{children:a||"This value is explicitly set at this level"})})]})}):t?(0,r.jsx)(e$.B,{children:(0,r.jsxs)(e$.Tooltip,{children:[(0,r.jsx)(e$.TooltipTrigger,{asChild:!0,children:(0,r.jsxs)(ex.E,{variant:"outline",className:`
|
|
7
|
+
${"sm"===s?"h-5 px-1.5 text-xs":"h-6 px-2 text-sm"}
|
|
8
|
+
${"absolute"===n?"absolute -top-2 -right-2":"inline-flex"}
|
|
9
|
+
bg-blue-50 dark:bg-blue-950/20 border-blue-200 dark:border-blue-800
|
|
10
|
+
text-blue-800 dark:text-blue-200 items-center gap-1
|
|
11
|
+
`,children:[(0,r.jsx)(e_.A,{className:"sm"===s?"h-2.5 w-2.5":"h-3 w-3"}),"md"===s&&`From ${t}`]})}),(0,r.jsx)(e$.TooltipContent,{children:(0,r.jsx)("p",{children:a||`This value is inherited from ${t} level`})})]})}):(0,r.jsx)(e$.B,{children:(0,r.jsxs)(e$.Tooltip,{children:[(0,r.jsx)(e$.TooltipTrigger,{asChild:!0,children:(0,r.jsxs)(ex.E,{variant:"outline",className:`
|
|
12
|
+
${"sm"===s?"h-5 px-1.5 text-xs":"h-6 px-2 text-sm"}
|
|
13
|
+
${"absolute"===n?"absolute -top-2 -right-2":"inline-flex"}
|
|
14
|
+
bg-gray-50 dark:bg-gray-950/20 border-gray-200 dark:border-gray-800
|
|
15
|
+
text-gray-600 dark:text-gray-400 items-center gap-1
|
|
16
|
+
`,children:[(0,r.jsx)(ew.A,{className:"sm"===s?"h-2.5 w-2.5":"h-3 w-3"}),"md"===s&&"Default"]})}),(0,r.jsx)(e$.TooltipContent,{children:(0,r.jsx)("p",{children:a||"Using system default value"})})]})})}function ez(e,t,a,s){let r=null!=t&&""!==t,n=null!=a&&""!==a,i=null!=s&&""!==s;if("project"!==e){if(r&&n&&t===a){let t="agent"===e?"Agent":"Project";return{isExplicit:!1,inheritedFrom:t,tooltip:`This model is inherited from the ${t.toLowerCase()} level`}}if("agent"===e&&r&&!n&&i&&t===s)return{isExplicit:!1,inheritedFrom:"Project",tooltip:"This model is inherited from the project level"}}if(r)return{isExplicit:!0,tooltip:`This model is explicitly configured at the ${e} level`};switch(e){case"subagent":if(n)return{isExplicit:!1,inheritedFrom:"Agent",tooltip:"Will inherit from the agent level"};if(i)return{isExplicit:!1,inheritedFrom:"Project",tooltip:"Will inherit from the project level"};break;case"agent":if(n)return{isExplicit:!1,inheritedFrom:"Project",tooltip:"Will inherit from the project level"}}return{isExplicit:!1,tooltip:"Using system default configuration"}}function eD(e,t,a,s){let r=null!=a,n=null!=s;if(r&&n&&a===s){if("transferCountIs"===t&&"agent"===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(r)return{isExplicit:!0,tooltip:`This ${"transferCountIs"===t?"transfer limit":"step limit"} is explicitly set at the ${e} level`};if("transferCountIs"===t){if("agent"===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 (${"transferCountIs"===t?"10":"50"})`}}var eM=a(78685),eU=a(1439),eR=a(23488);function eH({nameValue:e,idValue:t,onIdChange:a,isEditing:s=!1}){let r=(0,d.useRef)(!1),n=(0,d.useRef)(""),i=(0,d.useRef)(a),o=(0,d.useRef)(t);(0,d.useEffect)(()=>{i.current=a,o.current=t},[a,t]),(0,d.useEffect)(()=>{s&&(r.current=!1,n.current="")},[s]),(0,d.useEffect)(()=>{s||(t?t!==n.current&&(r.current=!0):(r.current=!1,n.current=""))},[t,s]),(0,d.useEffect)(()=>{if(!s&&e&&!r.current){let t=(0,eR.K)(e);t!==o.current&&(n.current=t,i.current(t))}},[e,s])}var eV=a(56887),eB=a(94962),eZ=a(12699);let eF={project:null},eq=(0,eV.v)()((0,eB.lt)(e=>({...eF,actions:{setProject(t){e({project:t})},reset(){e(eF)}}}),{name:"inkeep:project"})),eW=()=>eq(e=>e.actions);var eJ=a(71506);let eG=(0,eJ.createServerReference)("60cd660c02fa4e8108521aaab85dd9761c049d4a76",eJ.callServer,void 0,eJ.findSourceMapURL,"fetchProjectAction");function eK(){var e;let{tenantId:t,projectId:a}=(0,l.useParams)(),[s,r]=(0,d.useState)(!0),[n,i]=(0,d.useState)(null),o=(e=e=>e.project,eq((0,eZ.k)(e))),{setProject:c}=eW(),u=o?.projectId;return(0,d.useEffect)(()=>{async function e(){if(!t||!a||u&&u===a)return void r(!1);try{r(!0),i(null);let e=await eG(t,a);if(!e.success)throw Error(e.error||"Failed to fetch project");e.data&&c(e.data)}catch(e){console.error("Error fetching project:",e),i(e instanceof Error?e.message:"Unknown error")}finally{r(!1)}}u&&u===a?r(!1):e()},[t,a,u,c]),{project:o,loading:s,error:n}}var eY=a(5201),eX=a(26831),eQ=a(66552),e0=a(39968);let e1=({uri:e,editorOptions:t,onMount:a,...s})=>{let n=(0,d.useId)();e??=`${n}.template`;let[i,o]=(0,d.useState)(),l=(0,eX.Y1)(e=>e.monaco);(0,d.useEffect)(()=>{let e=i?.getModel();if(!l||!i||!e)return;let t=()=>{let t=new Set(eX.Bf.getState().variableSuggestions),a=/\{\{([^}]+)}}/g,s=[];for(let r=1;r<=e.getLineCount();r++){let n,i=e.getLineContent(r);for(;null!==(n=a.exec(i));){let e=n[1];t.has(e)||e.startsWith("$env.")||e.includes("[")||e.startsWith("length(")||s.push({startLineNumber:r,startColumn:n.index+3,endLineNumber:r,endColumn:n.index+n[0].length-1,message:`Unknown variable: ${e}`,severity:l.MarkerSeverity.Error})}}l.editor.setModelMarkers(e,"template-variables",s)},a=[];return a.push(e.onDidChangeContent(t)),t(),(0,eQ.Ye)(a)},[i,l]);let c=(0,d.useCallback)(e=>{o(e),a?.(e)},[a]);return(0,r.jsx)(e0.T,{uri:e,onMount:c,editorOptions:{autoClosingBrackets:"never",renderLineHighlight:"none",ariaLabel:"Prompt input editor",quickSuggestions:!1,...t},...s})};var e2=a(280);function e5({label:e,isRequired:t=!1,className:a,error:s,name:n,...i}){let[o,l]=(0,d.useState)(!1),c=(0,eX.Y1)(e=>e.monaco),u=`${o?"expanded-":""}${n}.template`,m=(0,d.useCallback)(()=>{if(!c)return;let e=c.editor.getModel(c.Uri.parse(u)),[t]=c.editor.getEditors().filter(t=>t.getModel()===e);if(!t)return;let a=t.getSelection(),s=a?a.getStartPosition():t.getPosition();if(!s)return;let r=new c.Range(s.lineNumber,s.column,s.lineNumber,s.column);t.executeEdits("insert-template-variable",[{range:r,text:"{"}]),t.setPosition({lineNumber:s.lineNumber,column:s.column+1}),t.focus(),t.trigger("insert-template-variable","editor.action.triggerSuggest",{})},[c,u]),p=`${n}-label`;return(0,r.jsxs)(e2.Z,{id:p,open:o,onOpenChange:l,uri:u,label:e,isRequired:t,hasError:!!s,actions:(0,r.jsxs)(f.$,{size:"sm",variant:"link",className:"text-xs rounded-sm h-6",type:"button",onClick:m,children:[(0,r.jsx)(eY.A,{className:"size-3.5"}),"Add variables"]}),children:[(0,r.jsx)(e1,{uri:u,autoFocus:o,"aria-invalid":s?"true":void 0,className:(0,Q.cn)(!o&&"max-h-96","min-h-16",a),hasDynamicHeight:!o,"aria-labelledby":p,...i}),s&&(0,r.jsx)("p",{className:"text-sm text-red-600",children:s})]})}function e3({defaultOpen:e=!1,title:t,children:a}){return(0,r.jsxs)(M.Nt,{defaultOpen:e,className:"border rounded-md bg-muted/30 dark:bg-muted/20",children:[(0,r.jsx)(M.R6,{asChild:!0,children:(0,r.jsxs)(f.$,{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)(O.A,{className:"h-3.5 w-3.5 transition-transform duration-200 group-data-[state=open]:rotate-90"}),t]})}),(0,r.jsx)(M.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:a})]})}let e4=({id:e,label:t,isRequired:a,tooltip:s,error:n})=>(0,r.jsxs)(ef.J,{htmlFor:e,className:(0,Q.cn)(n&&"text-red-600","gap-1"),children:[t,a&&(0,r.jsx)("span",{className:"text-red-500",children:"*"}),s&&(0,r.jsxs)(e$.Tooltip,{children:[(0,r.jsx)(e$.TooltipTrigger,{children:(0,r.jsx)(ew.A,{className:"w-3 h-3 text-muted-foreground ml-1"})}),(0,r.jsx)(e$.TooltipContent,{className:"wrap-break-word",children:s})]})]}),e6=({id:e,name:t,label:a,value:s,onChange:n,placeholder:i,error:o,className:l,description:d,tooltip:c,type:u="text",isRequired:m,disabled:p,ref:h,readOnly:x})=>(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(e4,{id:e,label:a,isRequired:m,tooltip:c,error:o}),(0,r.jsx)(eM.p,{ref:h,id:e,name:t,type:u,value:s,onChange:n,placeholder:i,"aria-invalid":o?"true":void 0,className:(0,Q.cn)("aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",l),disabled:p,readOnly:x}),o&&(0,r.jsx)("p",{className:"text-sm text-red-600",children:o}),d&&(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:d})]}),e8=({id:e,name:t,label:a,value:s,onChange:n,placeholder:i,error:o,className:l,description:d,tooltip:c,maxHeight:u="max-h-96",isRequired:m,disabled:p,ref:h,readOnly:x})=>(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(e4,{id:e,label:a,isRequired:m,tooltip:c,error:o}),(0,r.jsx)(k.T,{ref:h,id:e,name:t,value:s,onChange:n,placeholder:i,"aria-invalid":o?"true":void 0,className:(0,Q.cn)("aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",u,l),disabled:p,readOnly:x}),o&&(0,r.jsx)("p",{className:"text-sm text-red-600",children:o}),d&&(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:d})]});var e9=a(41707);function e7({title:e,tooltip:t}){return(0,r.jsxs)("h3",{className:"text-sm font-semibold flex items-center",children:[e,t&&(0,r.jsxs)(e$.Tooltip,{children:[(0,r.jsx)(e$.TooltipTrigger,{asChild:!0,children:(0,r.jsx)(ew.A,{className:"w-3 h-3 text-muted-foreground ml-1"})}),(0,r.jsx)(e$.TooltipContent,{children:t})]})," "]})}function te({description:e}){return(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:e})}function tt({title:e,description:t,titleTooltip:a}){return(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)(e7,{title:e,tooltip:a}),(0,r.jsx)(te,{description:t})]})}function ta({contextConfig:e,updateMetadata:t}){let{contextVariables:a,headersSchema:s}=e,n=(a,s)=>{t("contextConfig",{...e,[a]:s})};return(0,r.jsxs)("div",{className:"space-y-8",children:[(0,r.jsx)(tt,{title:"Context configuration",description:"Configure dynamic context for this agent."}),(0,r.jsxs)("div",{className:"flex flex-col space-y-8",children:[(0,r.jsx)(eA.y,{name:"contextVariables",label:"Context variables (JSON)",value:a,onChange:e=>n("contextVariables",e),placeholder:"{}"}),(0,r.jsx)(eA.y,{name:"headersSchema",label:"Headers schema (JSON)",value:s,onChange:e=>n("headersSchema",e),placeholder:"{}"})]})]})}let ts=()=>(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 → Agent only (controls transfers between sub 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:"Agent scope"}),": This limit applies to all sub agents within this agent"]})]}),tr=function(){let{agentId:e,tenantId:t,projectId:a}=(0,l.useParams)(),{id:s,name:n,description:i,contextConfig:o,models:c,stopWhen:u,prompt:m,statusUpdates:p}=(0,ea.ow)(e=>e.metadata),{PUBLIC_INKEEP_AGENTS_RUN_API_URL:h}=(0,eU.y)(),x=`${h}/api/chat`,{project:g}=eK(),{markUnsaved:f,setMetadata:v}=(0,ea.Sm)(),j=(0,d.useCallback)((...e)=>{v(...e),f()},[v,f]);return eH({nameValue:n,idValue:s,onIdChange:(0,d.useCallback)(e=>{j("id",e)},[j]),isEditing:!!e}),(0,r.jsxs)("div",{className:"space-y-8",children:[e&&(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)(e$.Tooltip,{children:[(0,r.jsx)(e$.TooltipTrigger,{asChild:!0,children:(0,r.jsx)(ew.A,{className:"w-3 h-3 text-muted-foreground"})}),(0,r.jsx)(e$.TooltipContent,{children:"Use this endpoint to chat with your agent or connect it to the Inkeep widget via the agentUrl prop. Supports streaming responses with the Vercel AI SDK data stream protocol."})]})]}),(0,r.jsx)(eI.r,{code:x}),(0,r.jsx)(eL.G,{href:`/${t}/projects/${a}/api-keys`,children:"Create API key"})]}),(0,r.jsx)(e6,{id:"name",name:"name",label:"Name",value:n,onChange:e=>j("name",e.target.value),placeholder:"My agent",isRequired:!0}),(0,r.jsx)(e6,{id:"id",name:"id",label:"Id",value:s||"",onChange:e=>j("id",e.target.value),disabled:!!e,placeholder:"my-agent",description:e?void 0:"Choose a unique identifier for this agent. Using an existing id will replace that agent.",isRequired:!0}),(0,r.jsx)(e8,{id:"description",name:"description",label:"Description",value:i,onChange:e=>j("description",e.target.value),placeholder:"This agent is used to...",className:"max-h-96"}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(e5,{name:"agent-prompt",label:"Agent prompt",value:m,onChange:e=>j("prompt",e),placeholder:"System-level instructions for this agent..."}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:"System-level prompt that defines the intended audience and overall goal of this agent. Applied to all sub agents."})]}),(0,r.jsx)(b.Separator,{}),(0,r.jsxs)("div",{className:"space-y-8",children:[(0,r.jsx)(tt,{title:"Default models",description:"Set default models that will be inherited by sub 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)(eE.O,{})]})}),(0,r.jsxs)("div",{className:"relative space-y-2",children:[(0,r.jsx)(e9.B,{value:c?.base?.model||"",inheritedValue:g?.models?.base?.model,onValueChange:e=>{j("models",{...c||{},base:e?{...c?.base||{},model:e}:void 0})},label:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:["Base model",(0,r.jsx)(eP,{...ez("agent",c?.base?.model,g?.models?.base?.model),size:"sm"})]})}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:"Primary model for general agent responses"})]}),(0,r.jsxs)(e3,{defaultOpen:!!c?.structuredOutput||!!c?.summarizer,title:"Advanced model options",children:[c?.base?.model&&(0,r.jsx)(eA.y,{name:"base-provider-options",label:"Base model provider options",onChange:e=>{j("models",{...c||{},base:{model:c.base?.model||"",providerOptions:e}})},value:c.base.providerOptions||"",placeholder:`{
|
|
17
|
+
"temperature": 0.7,
|
|
18
|
+
"maxOutputTokens": 2048
|
|
19
|
+
}`}),(0,r.jsxs)("div",{className:"relative space-y-2",children:[(0,r.jsx)(e9.B,{value:c?.structuredOutput?.model||"",inheritedValue:g?.models?.structuredOutput?.model||c?.base?.model||g?.models?.base?.model,onValueChange:e=>{j("models",{...c||{},structuredOutput:e?{...c?.structuredOutput||{},model:e}:void 0})},label:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:["Structured output model",(0,r.jsx)(eP,{...ez("agent",c?.structuredOutput?.model,g?.models?.structuredOutput?.model),size:"sm"})]})}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:"Model for structured outputs and components (defaults to base model)"})]}),c?.structuredOutput?.model&&(0,r.jsx)(eA.y,{name:"structured-provider-options",label:"Structured output model provider options",onChange:e=>{j("models",{...c||{},structuredOutput:{model:c.structuredOutput?.model||"",providerOptions:e}})},value:c.structuredOutput.providerOptions||"",placeholder:`{
|
|
20
|
+
"temperature": 0.1,
|
|
21
|
+
"maxOutputTokens": 1024
|
|
22
|
+
}`}),(0,r.jsxs)("div",{className:"relative space-y-2",children:[(0,r.jsx)(e9.B,{value:c?.summarizer?.model||"",inheritedValue:g?.models?.summarizer?.model||c?.base?.model||g?.models?.base?.model,onValueChange:e=>{j("models",{...c||{},summarizer:e?{...c?.summarizer||{},model:e}:void 0})},label:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:["Summarizer model",(0,r.jsx)(eP,{...ez("agent",c?.summarizer?.model,g?.models?.summarizer?.model),size:"sm"})]})}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:"Model for summarization tasks (defaults to base model)"})]}),c?.summarizer?.model&&(0,r.jsx)(eA.y,{name:"summarizer-provider-options",label:"Summarizer model provider options",onChange:e=>{j("models",{...c||{},summarizer:{model:c.summarizer?.model||"",providerOptions:e}})},value:c.summarizer.providerOptions||"",placeholder:`{
|
|
23
|
+
"temperature": 0.3,
|
|
24
|
+
"maxOutputTokens": 1024
|
|
25
|
+
}`})]})]}),(0,r.jsx)(b.Separator,{}),(0,r.jsxs)("div",{className:"space-y-8",children:[(0,r.jsx)(tt,{title:"Execution limits",description:"Configure agent-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)(ts,{})]})}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(ef.J,{htmlFor:"transfer-count",children:"Max transfers"}),(0,r.jsx)(eP,{...eD("agent","transferCountIs",u?.transferCountIs,g?.stopWhen?.transferCountIs),size:"sm"})]}),(0,r.jsx)(eM.p,{id:"transfer-count",type:"number",min:"1",max:"100",value:u?.transferCountIs||"",onChange:e=>{let t=e.target.value?parseInt(e.target.value,10):void 0;j("stopWhen",{...u||{},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)(b.Separator,{}),(0,r.jsxs)("div",{className:"space-y-8",children:[(0,r.jsx)(tt,{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)(eg.S,{id:"status-updates-enabled",checked:p?.enabled??!0,onCheckedChange:e=>{j("statusUpdates",{...p||{},enabled:!0===e})}}),(0,r.jsx)(ef.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"})]}),(p?.enabled??!0)&&(0,r.jsxs)(e3,{title:"Status updates configuration",children:[(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(ef.J,{htmlFor:"status-updates-prompt",children:"Status updates prompt"}),(0,r.jsx)(k.T,{id:"status-updates-prompt",value:p?.prompt||"",onChange:e=>{j("statusUpdates",{...p||{},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)(ef.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)(eg.S,{id:"event-based-updates",className:"bg-background",checked:p&&"numEvents"in p,onCheckedChange:e=>{if(e)j("statusUpdates",{...p||{},numEvents:p?.numEvents||10});else{let e={...p};delete e.numEvents,j("statusUpdates",e)}}}),(0,r.jsx)(ef.J,{htmlFor:"event-based-updates",children:"Event-based updates"})]}),(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)(eg.S,{id:"time-based-updates",className:"bg-background",checked:p&&"timeInSeconds"in p,onCheckedChange:e=>{if(e)j("statusUpdates",{...p||{},timeInSeconds:p?.timeInSeconds||30});else{let e={...p};delete e.timeInSeconds,j("statusUpdates",e)}}}),(0,r.jsx)(ef.J,{htmlFor:"time-based-updates",children:"Time-based updates"})]})]})]}),p&&"numEvents"in p&&(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(ef.J,{htmlFor:"num-events",children:"Number of events"}),(0,r.jsx)(eM.p,{id:"num-events",type:"number",min:"1",max:"100",value:p.numEvents||"",onChange:e=>{let t=e.target.value?parseInt(e.target.value,10):void 0;j("statusUpdates",{...p||{},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)"})]}),p&&"timeInSeconds"in p&&(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(ef.J,{htmlFor:"time-in-seconds",children:"Time interval (seconds)"}),(0,r.jsx)(eM.p,{id:"time-in-seconds",type:"number",min:"1",max:"600",value:p.timeInSeconds||"",onChange:e=>{let t=e.target.value?parseInt(e.target.value,10):void 0;j("statusUpdates",{...p||{},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)(eA.y,{name:"status-components",label:"Status components configuration",onChange:e=>{j("statusUpdates",{...p||{},statusComponents:e})},value:p?.statusComponents||"",placeholder:`[
|
|
26
|
+
{
|
|
27
|
+
"id": "tool_call_summary",
|
|
28
|
+
"name": "Tool Call",
|
|
29
|
+
"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.",
|
|
30
|
+
"schema": {
|
|
31
|
+
"type": "object",
|
|
32
|
+
"properties": {
|
|
33
|
+
"tool_name": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"description": "The name of the tool that was called"
|
|
36
|
+
},
|
|
37
|
+
"summary": {
|
|
38
|
+
"type": "string",
|
|
39
|
+
"description": "Brief summary of what was accomplished. Keep it to 3-5 words."
|
|
40
|
+
},
|
|
41
|
+
"status": {
|
|
42
|
+
"type": "string",
|
|
43
|
+
"enum": ["success", "error", "in_progress"],
|
|
44
|
+
"description": "Status of the tool call"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"required": ["tool_name", "summary"]
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
]`}),(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)(b.Separator,{}),(0,r.jsx)(ta,{contextConfig:o,updateMetadata:j})]})};function tn({selectedNodeId:e,errorHelpers:t}){let{updateNodeData:a,setNodes:s,deleteElements:r,getNode:i}=(0,n.VH)(),{markUnsaved:o}=(0,ea.Sm)(),l=(0,d.useCallback)(()=>{r({nodes:[{id:e}]})},[e,r]),c=(0,d.useCallback)(t=>{s(a=>a.map(a=>a.id===e?{...a,data:{...a.data,isDefault:t},deletable:!t}:t&&a.data.isDefault?{...a,data:{...a.data,isDefault:!1},deletable:!0}:a))},[e,s]),u=(0,d.useRef)({}),m=(0,d.useCallback)((e,t)=>{t?u.current[e]=t:delete u.current[e]},[]),p=(0,d.useCallback)(e=>t?.getFieldErrorMessage(e),[t]),h=(0,d.useCallback)((t,s)=>{let r=i(e);r?.data?.[t]!==s&&(a(e,{[t]:s}),o())},[e,a,o,i]),x=(0,d.useCallback)(e=>{let{name:t,value:a}=e.target;h(t,a)},[h]),g=(0,d.useCallback)((e,t)=>{e.split(".").length,h(e,t)},[h]),f=(0,d.useCallback)((e,t,a)=>{let s=e.split(".");if(1===s.length)h(e,t);else{let[e,...r]=s,n={...a?.[e]||{}},i=n;for(let e=0;e<r.length-1;e++){let t=r[e];t in i&&null!==i[t]&&void 0!==i[t]||(i[t]={}),i=i[t]}let o=r[r.length-1];if(null==t||""===t){if(delete i[o],0===Object.keys(n).length)return void h(e,null)}else i[o]=t;h(e,n)}},[h]);return{updateField:h,updatePath:g,updateNestedPath:f,handleInputChange:x,updateDefaultSubAgent:c,deleteNode:l,getFieldError:p,setFieldRef:m,markUnsaved:o}}function ti({selectedNode:e,subAgentExternalAgentConfigLookup:t,errorHelpers:a}){let{updateNodeData:s}=(0,n.VH)(),{markUnsaved:i}=(0,ea.Sm)(),{handleInputChange:o,getFieldError:c,setFieldRef:u,updateField:m,deleteNode:p}=tn({selectedNodeId:e.id,errorHelpers:a}),{tenantId:h,projectId:x}=(0,l.useParams)(),{edges:g}=(0,ea.ow)(e=>({edges:e.edges})),v=(0,d.useCallback)(e=>{m("id",e)},[m]);eH({nameValue:e.data.name,idValue:e.data.id,onIdChange:v,isEditing:!1});let j=(0,d.useCallback)(()=>(function(e,t,a){if(void 0!==e.data.tempHeaders)return e.data.tempHeaders;let s=e.data.relationshipId;if(s)for(let e of Object.values(t)){let t=e[s];if(t)return t.headers??{}}return{}})(e,t,0),[e,t,g]),[y,N]=(0,d.useState)("{}");return(0,d.useEffect)(()=>{N(JSON.stringify(j(),null,2))},[e.id]),(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 that live outside of your project that can communicate using the A2A (Agent-to-Agent) protocol. External agents enable you to delegate tasks between agents within the agent framework or to third-party services."}),(0,r.jsx)(e6,{ref:e=>u("name",e),id:"name",name:"name",label:"Name",value:e.data.name||"",onChange:o,placeholder:"Support agent",disabled:!0,error:c("name")}),(0,r.jsx)(e6,{ref:e=>u("id",e),id:"id",name:"id",label:"Id",value:e.data.id||"",onChange:o,placeholder:"my-external-agent",error:c("id"),disabled:!0,description:"Choose a unique identifier for this agent. Using an existing id will replace that agent.",isRequired:!0}),(0,r.jsx)(e8,{ref:e=>u("description",e),id:"description",name:"description",label:"Description",value:e.data.description||"",onChange:o,placeholder:"This agent is responsible for...",error:c("description"),disabled:!0}),(0,r.jsx)(e6,{ref:e=>u("baseUrl",e),id:"baseUrl",name:"baseUrl",label:"Host URL",value:e.data.baseUrl||"",onChange:o,placeholder:"https://api.example.com/agent",error:c("baseUrl"),tooltip:"This URL is used to discover the agent's capabilities and communicate with it using the A2A protocol. For locally hosted agent defined with the agent-framework this would be: http://localhost:3002/tenants/:tenantId/projects/:projectId/agents/:agentId",disabled:!0}),(0,r.jsx)(eA.y,{name:"headers",label:"Headers",value:y,onChange:t=>{N(t);try{let a=""===t.trim()?{}:JSON.parse(t);"object"!=typeof a||null===a||Array.isArray(a)||(s(e.id,{...e.data,tempHeaders:a}),i())}catch{}},placeholder:"{}"}),(0,r.jsx)(eL.G,{href:`/${h}/projects/${x}/external-agents/${e.data.id}/edit`,children:"Edit External Agent"}),(0,r.jsx)(b.Separator,{}),(0,r.jsx)("div",{className:"flex justify-end",children:(0,r.jsxs)(f.$,{variant:"destructive-outline",size:"sm",onClick:p,children:[(0,r.jsx)(em.A,{className:"size-4"}),"Delete"]})})]})}var to=a(59994),tl=a(90515),td=a(62351),tc=a.n(td);function tu({message:e,actionText:t,actionHref:a}){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:e}),(0,r.jsx)("div",{className:"inline-block",children:a&&(0,r.jsxs)(tc(),{target:"_blank",rel:"noopener noreferrer",href:a,className:"font-mono gap-2 text-xs flex items-center uppercase font-medium text-gray-500 hover:text-gray-700",children:[t,(0,r.jsx)(tl.A,{className:"w-4 h-4"})]})})]})}var tm=a(81666);function tp({externalAgent:e,onClick:t}){let{id:a,name:s,description:n,baseUrl:i}=e;return(0,r.jsx)(f.$,{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:a,onClick:()=>t(e),children:(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)("div",{className:"flex-shrink-0 mt-0.5 size-8 rounded bg-muted flex items-center justify-center",children:(0,r.jsx)(tm.A,{className:"size-4 text-muted-foreground"})}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("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:s})}),n&&(0,r.jsx)("p",{className:"text-xs text-muted-foreground truncate mb-1",children:n}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground/70 truncate",children:i})]})]})},a)}function th({title:e}){return(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)("h3",{className:"text-sm font-medium mb-2",children:e}),(0,r.jsx)("div",{className:"flex flex-col gap-2",children:[void 0,void 0,void 0].map((e,t)=>(0,r.jsx)("div",{className:"w-full p-3 rounded-lg border border-border",children:(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)(X.E,{className:"size-8 rounded flex-shrink-0"}),(0,r.jsxs)("div",{className:"flex-1 min-w-0 space-y-2",children:[(0,r.jsx)(X.E,{className:"h-4 w-3/4"}),(0,r.jsx)(X.E,{className:"h-3 w-1/2"})]})]})},t))})]})}function tx({selectedNode:e}){let{updateNode:t}=(0,n.VH)(),{tenantId:a,projectId:s}=(0,l.useParams)(),{externalAgents:i,isLoading:o,error:u}=(()=>{let[e,t]=(0,d.useState)([]),[a,s]=(0,d.useState)(!0),[r,n]=(0,d.useState)(null),{tenantId:i,projectId:o}=(0,l.useParams)();return(0,d.useEffect)(()=>{(async()=>{try{s(!0),n(null);let e=await (0,to.O)(i,o);t(e)}catch(t){let e=t instanceof Error?t.message:"Failed to load external agents";n(e),c.oR.error(e)}finally{s(!1)}})()},[i,o]),{externalAgents:e,isLoading:a,error:r}})(),p=a=>{t(e.id,{type:m.Z6.ExternalAgent,data:{id:a.id,name:a.name,description:a.description,baseUrl:a.baseUrl,createdAt:a.createdAt,updatedAt:a.updatedAt,credentialReferenceId:a.credentialReferenceId,relationshipId:null,tempHeaders:null}})};return o?(0,r.jsx)(th,{title:"Select external agent"}):u?(0,r.jsx)(tu,{message:"Something went wrong.",actionText:"Create external agent",actionHref:`/${a}/projects/${s}/external-agents/new`}):i?.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 external agent"}),(0,r.jsx)("div",{className:"flex flex-col gap-2 min-w-0 min-h-0",children:i.map(e=>(0,r.jsx)(tp,{externalAgent:e,onClick:p},e.id))})]})}):(0,r.jsx)(tu,{message:"No external agents found.",actionText:"Create external agent",actionHref:`/${a}/projects/${s}/external-agents/new`})}var tg=a(9754);function tf({name:e,value:t,onChange:a,className:s,label:n,placeholder:i,error:o,isRequired:l}){let[c,u]=(0,d.useState)(!1),m=`${c?"expanded-":""}${e}.jsx`,p=`${e}-label`;return(0,r.jsxs)(e2.Z,{id:p,open:c,onOpenChange:u,uri:m,label:n,className:s,isRequired:l,hasError:!!o,children:[(0,r.jsx)(tg.B,{uri:m,value:t,onChange:a,placeholder:i,"aria-invalid":o?"true":void 0,hasDynamicHeight:!c,className:(0,Q.cn)(!c&&o&&"max-h-96"),"aria-labelledby":p}),o&&(0,r.jsx)("p",{className:"text-sm text-red-600",children:o})]})}var tb=a(47629);function tv({selectedNode:e}){let{getFieldError:t,setFieldRef:a,updatePath:s,deleteNode:n}=tn({selectedNodeId:e.id}),i=e.data,[o,l]=(0,d.useState)(String(i.name||"")),[c,u]=(0,d.useState)(String(i.description||"")),[m,p]=(0,d.useState)(String(i.code||"")),[h,x]=(0,d.useState)(i.inputSchema?JSON.stringify(i.inputSchema,null,2):""),[g,v]=(0,d.useState)(i.dependencies?JSON.stringify(i.dependencies,null,2):"");(0,d.useEffect)(()=>{l(String(i.name||"")),u(String(i.description||"")),p(String(i.code||"")),x(i.inputSchema?JSON.stringify(i.inputSchema,null,2):""),v(i.dependencies?JSON.stringify(i.dependencies,null,2):"")},[i]);let j=(0,d.useCallback)(e=>{if(x(e),!e?.trim())return void s("inputSchema",void 0);try{let t=JSON.parse(e);s("inputSchema",t)}catch{}},[s]),y=(0,d.useCallback)(e=>{if(v(e),!e?.trim())return void s("dependencies",void 0);try{let t=JSON.parse(e);s("dependencies",t)}catch{}},[s]),N=(0,d.useCallback)(e=>{let t=e.target.value;l(t),s("name",t)},[s]),C=(0,d.useCallback)(e=>{p(e),s("code",e)},[s]),k=(0,d.useCallback)(e=>{let t=e.target.value;u(t),s("description",t)},[s]);return(0,r.jsxs)("div",{className:"space-y-8",children:[(0,r.jsx)(e6,{ref:e=>a("name",e),id:"function-tool-name",name:"name",label:"Name",value:o,onChange:N,placeholder:"Enter function tool name...",error:t("name"),isRequired:!0}),(0,r.jsx)(e8,{ref:e=>a("description",e),id:"function-tool-description",name:"description",label:"Description",value:c,onChange:k,placeholder:"Enter function tool description...",error:t("description"),maxHeight:"max-h-32"}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(tf,{name:"code",label:"Code",value:m,onChange:C,placeholder:"Enter function code here...",error:t("code"),isRequired:!0}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:"JavaScript function code to be executed by the tool. The function will receive arguments based on the input schema and should return a result."})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("div",{className:"text-sm font-medium",children:["Input Schema ",(0,r.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,r.jsx)(tb.$,{value:h,onChange:j,placeholder:`{
|
|
51
|
+
"type": "object",
|
|
52
|
+
"properties": {
|
|
53
|
+
"param1": {
|
|
54
|
+
"type": "string",
|
|
55
|
+
"description": "Description of parameter 1"
|
|
56
|
+
},
|
|
57
|
+
"param2": {
|
|
58
|
+
"type": "number",
|
|
59
|
+
"description": "Description of parameter 2"
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"required": ["param1"]
|
|
63
|
+
}`}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:"JSON schema defining the parameters that the function will receive. This defines the structure and validation rules for the function's input arguments."}),t("inputSchema")&&(0,r.jsx)("p",{className:"text-sm text-red-600",children:t("inputSchema")})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)("div",{className:"text-sm font-medium",children:"Dependencies"}),(0,r.jsx)(tb.$,{value:g,onChange:y,placeholder:`{
|
|
64
|
+
"axios": "^1.6.0",
|
|
65
|
+
"lodash": "^4.17.21"
|
|
66
|
+
}`}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:"External npm packages that the function code requires. These packages will be installed before executing the function."}),t("dependencies")&&(0,r.jsx)("p",{className:"text-sm text-red-600",children:t("dependencies")})]}),(0,r.jsx)(b.Separator,{}),(0,r.jsx)("div",{className:"flex justify-end",children:(0,r.jsxs)(f.$,{variant:"destructive-outline",size:"sm",onClick:n,children:[(0,r.jsx)(em.A,{className:"size-4"}),"Delete"]})})]})}var tj=a(79814),ty=a(91109),tN=a(81523),tC=a(1391),tk=a(22297);function tS({selectedNode:e,agentToolConfigLookup:t}){let a,{deleteNode:s}=tn({selectedNodeId:e.id}),{updateNodeData:i}=(0,n.VH)(),{tenantId:o,projectId:c}=(0,l.useParams)(),{markUnsaved:u}=(0,ea.Sm)(),{toolLookup:m,edges:p}=(0,ea.ow)(e=>({toolLookup:e.toolLookup,edges:e.edges})),h=(0,d.useCallback)(()=>(0,tk.FE)(e,t,p),[e,t,p]),[x,g]=(0,d.useState)("{}");(0,d.useEffect)(()=>{g(JSON.stringify(h(),null,2))},[e.id]);let v=m[e.data.toolId],j=v?.availableTools,y=(0,ty.O)({availableTools:j,activeTools:v?.config&&"mcp"===v.config.type?v.config.mcp.activeTools:void 0});if(!v)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 ",e.data.toolId,"."]})});let N=(0,tk.Jh)(e,t,p),C=(0,tk.t3)(e,t,p),k=N&&Array.isArray(N)?N.filter(e=>!y?.some(t=>t.name===e)):[],S=t=>{let a,s=null===N?y?.map(e=>e.name)||[]:[...N],r=s.includes(t);a=r?s.filter(e=>e!==t):[...s,t];let n=y?.map(e=>e.name)||[],o=a.length===n.length&&n.every(e=>a.includes(e))?null:a,l={...C};r&&!a.includes(t)&&delete l[t],i(e.id,{...e.data,tempSelectedTools:o,tempToolPolicies:l}),u()},T=t=>{let a={...C};a[t]?.needsApproval?delete a[t]:a[t]={needsApproval:!0},i(e.id,{...e.data,tempToolPolicies:a}),u()},w=t=>{let{name:a,value:s}=t.target;e&&(i(e.id,{[a]:s}),u())};return(0,r.jsxs)("div",{className:"space-y-8",children:[v?.imageUrl&&(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(tN.u,{imageUrl:v.imageUrl,name:v.name,size:32,className:"rounded-lg"}),(0,r.jsx)("span",{className:"font-medium text-sm truncate",children:v.name})]}),v?.status==="needs_auth"&&(0,r.jsxs)(tC.Fc,{className:"border-amber-300 dark:border-amber-700 bg-amber-50 dark:bg-amber-950/20 [&>svg]:text-amber-600",children:[(0,r.jsx)(tj.A,{className:"h-4 w-4"}),(0,r.jsx)(tC.XL,{className:"text-foreground",children:"Authentication Required"}),(0,r.jsxs)(tC.TN,{className:"text-muted-foreground",children:["This MCP server requires authentication to work properly."," ",(0,r.jsx)(tc(),{href:`/${o}/projects/${c}/mcp-servers/${e.data.toolId}`,target:"_blank",rel:"noopener noreferrer",className:"font-medium text-foreground underline hover:no-underline",children:"Go to MCP Server details to connect"})]})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(ef.J,{htmlFor:"node-id",children:"Id"}),(0,r.jsx)(eM.p,{id:"node-id",value:e.data.toolId,disabled:!0})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(ef.J,{htmlFor:"name",children:"Name"}),(0,r.jsx)(eM.p,{id:"name",name:"name",value:v?.name||"",onChange:w,placeholder:"MCP server",className:"w-full",disabled:!0})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(ef.J,{htmlFor:"url",children:"URL"}),(0,r.jsx)(eM.p,{id:"url",name:"url",value:v?.config&&"mcp"===v.config.type?v.config.mcp.server.url:"",onChange:w,placeholder:"https://mcp.inkeep.com",disabled:!0,className:"w-full"})]}),v?.imageUrl&&(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(ef.J,{htmlFor:"imageUrl",children:"Image URL"}),(0,r.jsx)(eM.p,{id:"imageUrl",name:"imageUrl",value:v.imageUrl||"",onChange:w,placeholder:"https://example.com/icon.png",disabled:!0,className:"w-full"})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(ef.J,{children:"Tool Configuration"}),(0,r.jsx)(ex.E,{variant:"count",children:null===N?y?.length??0:N.length})]}),y&&y.length>1&&(a=null===N||null!==N&&N.length===y.length,(0,r.jsx)(r.Fragment,{children:a?(0,r.jsxs)(f.$,{type:"button",variant:"ghost",size:"sm",onClick:()=>{i(e.id,{...e.data,tempSelectedTools:[],tempToolPolicies:{}}),u()},children:[(0,r.jsx)($.A,{className:"w-4 h-4 text-muted-foreground"}),"Deselect all"]}):(0,r.jsxs)(f.$,{type:"button",variant:"ghost",size:"sm",onClick:()=>{i(e.id,{...e.data,tempSelectedTools:null}),u()},children:[(0,r.jsx)(eO.A,{className:"w-4 h-4 text-muted-foreground"}),"Select all"]})}))]}),y&&y.length>0||k.length>0?(0,r.jsxs)("div",{className:"border rounded-md",children:[(0,r.jsx)("div",{className:"grid grid-cols-[1fr_auto] gap-4 px-3 py-2.5 text-xs font-medium text-muted-foreground rounded-t-md border-b",children:(0,r.jsx)("div",{children:"Tool"})}),y?.map(e=>{let t=null===N||N.includes(e.name),a=C[e.name]?.needsApproval||!1;return(0,r.jsxs)("div",{className:"grid grid-cols-[1fr_auto] gap-4 px-3 py-2 hover:bg-muted/30 transition-colors border-b last:border-b-0",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2.5 min-w-0",children:[(0,r.jsx)(eg.S,{checked:t,onCheckedChange:()=>S(e.name)}),(0,r.jsxs)(e$.Tooltip,{children:[(0,r.jsx)(e$.TooltipTrigger,{asChild:!0,children:(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("div",{className:"text-sm font-medium truncate",children:e.name}),(0,r.jsx)("div",{className:"text-xs text-muted-foreground line-clamp-1",children:e.description})]})}),(0,r.jsx)(e$.TooltipContent,{className:"max-w-xs text-sm",children:(0,r.jsx)("div",{children:e.description})})]})]}),(0,r.jsx)("div",{className:"items-center hidden mcp-needs-approval",children:(0,r.jsx)(eg.S,{checked:a,disabled:!t,onCheckedChange:()=>T(e.name)})})]},e.name)}),k.map(e=>{let t=C[e]?.needsApproval||!1;return(0,r.jsxs)("div",{className:"grid grid-cols-[1fr_auto] gap-4 px-3 py-2 bg-amber-50 dark:bg-amber-950/20 border-b last:border-b-0 border-amber-200 dark:border-amber-800",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,r.jsx)(eg.S,{checked:!0,onCheckedChange:()=>S(e)}),(0,r.jsxs)(e$.Tooltip,{children:[(0,r.jsx)(e$.TooltipTrigger,{asChild:!0,children:(0,r.jsxs)("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("div",{className:"text-sm font-medium truncate",children:e}),(0,r.jsx)("div",{className:"text-xs text-amber-600 dark:text-amber-400",children:"Tool no longer available"})]}),(0,r.jsx)(_.A,{className:"w-4 h-4 text-amber-500 flex-shrink-0"})]})}),(0,r.jsx)(e$.TooltipContent,{className:"max-w-xs text-sm",children:"This tool was selected but is not available in the MCP server. Uncheck to remove it."})]})]}),(0,r.jsx)("div",{className:"hidden items-center mcp-needs-approval",children:(0,r.jsx)(eg.S,{checked:t,onCheckedChange:()=>T(e)})})]},`orphaned-${e}`)})]}):(0,r.jsx)("div",{className:"text-sm text-muted-foreground py-8 text-center border rounded-md bg-muted/10",children:"No tools available for this MCP server"})]}),(0,r.jsx)("div",{className:"space-y-2",children:(0,r.jsx)(eA.y,{name:"headers",label:"Headers (JSON)",value:x,onChange:t=>{g(t);try{let a=""===t.trim()?{}:JSON.parse(t);"object"!=typeof a||null===a||Array.isArray(a)||(i(e.id,{...e.data,tempHeaders:a}),u())}catch{}},placeholder:'{"X-Your-Header": "your-value", "Content-Type": "application/json"}'})}),(0,r.jsx)(eL.G,{href:`/${o}/projects/${c}/mcp-servers/${e.data.toolId}/edit`,children:"Edit MCP Server"}),(0,r.jsx)(b.Separator,{}),(0,r.jsx)("div",{className:"flex justify-end",children:(0,r.jsxs)(f.$,{variant:"destructive-outline",size:"sm",onClick:s,children:[(0,r.jsx)(em.A,{className:"size-4"}),"Delete"]})})]})}var tT=a(88031);function tw({title: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:e}),(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)(X.E,{className:"w-full h-[72px] rounded-lg"},e))})]})})}function tA({mcp:e,onClick:t}){let a=e.config?.type==="mcp"?e.config.mcp?.server:void 0,{id:s,name:n,availableTools:i,imageUrl:o,config:l}=e,d=(0,ty.O)({availableTools:i,activeTools:l?.type==="mcp"?l.mcp?.activeTools:void 0}),c=d?.length??0;return(0,r.jsx)(f.$,{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:s,onClick:()=>t(e),children:(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)(tN.u,{imageUrl:o,name:n,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:n}),(0,r.jsxs)("div",{className:"flex items-center gap-1.5 shrink-0",children:[(0,r.jsx)(ex.E,{variant:"outline",className:"text-2xs",children:"user"===e.credentialScope?"User":"Project"}),i&&(0,r.jsx)(ex.E,{variant:"code",className:"text-2xs",children:1===c?"1 tool":`${c} tools`})]})]}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:a?.url})]})]})},s)}function tE({selectedNode:e}){let{updateNode:t}=(0,n.VH)(),{tenantId:a,projectId:s}=(0,l.useParams)(),{tools:i,isLoading:o,error:u}=(()=>{let[e,t]=(0,d.useState)([]),[a,s]=(0,d.useState)(!0),[r,n]=(0,d.useState)(null),{tenantId:i,projectId:o}=(0,l.useParams)();return(0,d.useEffect)(()=>{(async()=>{try{s(!0),n(null);let e=await (0,tT.i)(i,o);t(e)}catch(t){let e=t instanceof Error?t.message:"Failed to load MCP tools";n(e),c.oR.error(e)}finally{s(!1)}})()},[i,o]),{tools:e,isLoading:a,error:r}})(),p=a=>{t(e.id,{type:m.Z6.MCP,data:{toolId:a.id,subAgentId:null,relationshipId:null}})};return o?(0,r.jsx)(tw,{title:"Select MCP server"}):u?(0,r.jsx)(tu,{message:"Something went wrong.",actionText:"Create MCP server",actionHref:`/${a}/projects/${s}/mcp-servers/new`}):i?.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:i.map(e=>(0,r.jsx)(tA,{mcp:e,onClick:p},e.id))})]})}):(0,r.jsx)(tu,{message:"No MCP servers found.",actionText:"Create MCP server",actionHref:`/${a}/projects/${s}/mcp-servers/new`})}var tI=a(2256),tL=a(198),tO=a(98570);function t_({selectedComponents:e,handleToggle:t,availableComponents:a,emptyStateMessage:s,emptyStateActionText:n,emptyStateActionHref:i,placeholder:o="Select components..."}){let[l,c]=(0,d.useState)(!1);return(0,r.jsx)("div",{className:"flex w-full",children:(0,r.jsxs)(tO.AM,{open:l,onOpenChange:c,children:[(0,r.jsx)(tO.Wv,{asChild:!0,children:(0,r.jsxs)(f.$,{variant:"outline",role:"combobox","aria-expanded":l,className:"w-full justify-between bg-transparent text-gray-700",children:[0===e.length?(0,r.jsx)("div",{className:"text-muted-foreground",children:o}):`${e.length} selected`,(0,r.jsx)(tI.A,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,r.jsx)(tO.hl,{className:"w-[var(--radix-popover-trigger-width)] p-0",children:(0,r.jsxs)(tL.uB,{children:[(0,r.jsx)(tL.G7,{placeholder:"Search components..."}),(0,r.jsx)(tL.xL,{children:(0,r.jsx)(tu,{message:s||"No components found.",actionText:n,actionHref:i})}),(0,r.jsx)(tL.oI,{className:"max-h-64",children:(0,r.jsx)(tL.L$,{children:a.map(({id:a,name:s,description:n})=>(0,r.jsxs)(tL.h_,{onSelect:()=>t(a),className:"flex items-start gap-3 p-3 group cursor-pointer",children:[(0,r.jsx)(eg.S,{checked:e.includes(a),className:"mt-0.5 [&_svg]:!text-primary-foreground"}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("div",{className:"flex items-center gap-2 mb-1",children:(0,r.jsx)("span",{className:"font-medium",children:s})}),n&&(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:n})]})]},a))})})]})})]})})}function t$({label:e,count:t}){return(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(ef.J,{children:e}),(0,r.jsx)(ex.E,{variant:"count",children:t})]})}function tP({selectedComponents:e,componentLookup:t,handleToggle:a}){return(0,r.jsx)("div",{className:"space-y-2",children:(0,r.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map(e=>{let s=t[e];return(0,r.jsxs)(ex.E,{variant:"code",className:"text-xs",children:[s?.name||e,(0,r.jsx)(f.$,{variant:"ghost",size:"icon-sm",className:" size-3 ml-1",onClick:()=>a(e),children:(0,r.jsx)($.A,{className:"size-3"})})]},e)})})})}function tz({label:e,componentLookup:t,selectedComponents:a,onSelectionChange:s,emptyStateMessage:n,emptyStateActionText:i,emptyStateActionHref:o,placeholder:l="Select components..."}){let d=e=>{s(a.includes(e)?a.filter(t=>t!==e):[...a,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)(t$,{label:e,count:a.length}),a.length>0&&(0,r.jsx)(tP,{selectedComponents:a,componentLookup:t,handleToggle:d})]}),(0,r.jsx)(t_,{selectedComponents:a,handleToggle:d,availableComponents:Object.values(t),emptyStateMessage:n,emptyStateActionText:i,emptyStateActionHref:o,placeholder:l})]})}function tD({models:e,updatePath:t,projectModels:a,agentModels:s}){let n=e?.structuredOutput||e?.summarizer;return e?.base||e?.structuredOutput||e?.summarizer,(0,r.jsxs)("div",{className:"space-y-8",children:[(0,r.jsx)(tt,{title:"Models",description:"Configure sub agent-level models.",titleTooltip:(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{children:"How model inheritance works:"}),(0,r.jsx)(eE.O,{})]})}),(0,r.jsxs)("div",{className:"relative space-y-2",children:[(0,r.jsx)(e9.B,{value:e?.base?.model||"",onValueChange:e=>{t("models.base.model",e||void 0)},inheritedValue:s?.base?.model||a?.base?.model,label:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:["Base model",(0,r.jsx)(eP,{...ez("agent",e?.base?.model,s?.base?.model,a?.base?.model),size:"sm"})]})}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:"Primary model for general sub agent responses"})]}),(0,r.jsxs)(e3,{defaultOpen:!!n,title:"Advanced Model Options",children:[e?.base?.model&&(0,r.jsx)(eA.y,{name:"base-provider-options",label:"Base model provider options",onChange:e=>{t("models.base.providerOptions",e)},value:e?.base?.providerOptions||"",placeholder:`{
|
|
67
|
+
"temperature": 0.7,
|
|
68
|
+
"maxOutputTokens": 2048
|
|
69
|
+
}`}),(0,r.jsxs)("div",{className:"relative space-y-2",children:[(0,r.jsx)(e9.B,{value:e?.structuredOutput?.model||"",onValueChange:e=>{t("models.structuredOutput.model",e||void 0)},inheritedValue:s?.structuredOutput?.model||a?.structuredOutput?.model||e?.base?.model||s?.base?.model||a?.base?.model,label:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:["Structured output model",(0,r.jsx)(eP,{...ez("agent",e?.structuredOutput?.model,s?.structuredOutput?.model,a?.structuredOutput?.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)"})]}),e?.structuredOutput?.model&&(0,r.jsx)(eA.y,{name:"structured-provider-options",label:"Structured output model provider options",onChange:e=>{t("models.structuredOutput.providerOptions",e)},value:e?.structuredOutput?.providerOptions||"",placeholder:`{
|
|
70
|
+
"temperature": 0.1,
|
|
71
|
+
"maxOutputTokens": 1024
|
|
72
|
+
}`}),(0,r.jsxs)("div",{className:"relative space-y-2",children:[(0,r.jsx)(e9.B,{value:e?.summarizer?.model||"",onValueChange:e=>{t("models.summarizer.model",e||void 0)},inheritedValue:s?.summarizer?.model||a?.summarizer?.model||e?.base?.model||s?.base?.model||a?.base?.model,label:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:["Summarizer model",(0,r.jsx)(eP,{...ez("agent",e?.summarizer?.model,s?.summarizer?.model,a?.summarizer?.model),size:"sm"})]})}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:"The model used for summarization tasks (defaults to base model)"})]}),e?.summarizer?.model&&(0,r.jsx)(eA.y,{name:"summarizer-provider-options",label:"Summarizer model provider options",onChange:e=>{t("models.summarizer.providerOptions",e)},value:e?.summarizer?.providerOptions||"",placeholder:`{
|
|
73
|
+
"temperature": 0.3,
|
|
74
|
+
"maxOutputTokens": 1024
|
|
75
|
+
}`})]})]})}let tM=()=>(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 (sub 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 sub agent's execution steps"]}),(0,r.jsxs)("li",{children:[(0,r.jsx)("span",{className:"font-medium",children:"Independent from transfers"}),": Steps are counted per sub agent, transfers are counted per conversation"]})]});function tU({selectedNode:e,dataComponentLookup:t,artifactComponentLookup:a,errorHelpers:s}){let{tenantId:n,projectId:i}=(0,l.useParams)(),o=e.data?.dataComponents||[],c=e.data?.artifactComponents||[],u=e.data?.isDefault||!1,{project:m}=eK(),p=(0,ea.ow)(e=>e.metadata),{updatePath:h,updateNestedPath:x,getFieldError:g,setFieldRef:v,updateDefaultSubAgent:j,deleteNode:y}=tn({selectedNodeId:e.id,errorHelpers:s}),N=(0,d.useCallback)((t,a)=>{x(t,a,e.data)},[x,e.data]),C=(0,d.useCallback)(e=>{h("id",e)},[h]);return eH({nameValue:e.data.name,idValue:e.data.id,onIdChange:C,isEditing:!1}),(0,r.jsxs)("div",{className:"space-y-8 flex flex-col",children:[(0,r.jsx)(e6,{ref:e=>v("name",e),id:"name",name:"name",label:"Name",value:e.data.name||"",onChange:e=>h("name",e.target.value),placeholder:"Support agent",error:g("name")}),(0,r.jsx)(e6,{ref:e=>v("id",e),id:"id",name:"id",label:"Id",value:e.data.id||"",onChange:e=>h("id",e.target.value),placeholder:"my-agent",error:g("id"),description:"Choose a unique identifier for this sub agent. Using an existing id will replace that sub agent."}),(0,r.jsx)(e8,{ref:e=>v("description",e),id:"description",name:"description",label:"Description",value:e.data.description||"",onChange:e=>h("description",e.target.value),placeholder:"This sub agent is responsible for...",error:g("description")}),(0,r.jsx)("div",{className:"space-y-2",children:(0,r.jsx)(e5,{name:"prompt",value:e.data.prompt,onChange:e=>h("prompt",e),placeholder:"You are a helpful assistant...",error:g("prompt"),label:"Prompt"},e.id)}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)(eg.S,{id:"is-default-sub-agent",checked:u,onCheckedChange:e=>{j(!0===e)}}),(0,r.jsx)(ef.J,{htmlFor:"is-default-sub-agent",children:"Is default sub agent"})]}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:"The default sub agent is the initial entry point for conversations."})]}),(0,r.jsx)(b.Separator,{}),(0,r.jsx)(tD,{models:e.data.models,updatePath:N,projectModels:m?.models,agentModels:p?.models}),(0,r.jsx)(b.Separator,{}),(0,r.jsxs)("div",{className:"space-y-8",children:[(0,r.jsx)(tt,{title:"Execution limits",description:"Configure sub agent-level execution limits for steps within this sub agent.",titleTooltip:(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{children:"How execution limit inheritance works:"}),(0,r.jsx)(tM,{})]})}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(ef.J,{htmlFor:"step-count",children:"Max steps"}),(0,r.jsx)(eP,{...eD("agent","stepCountIs",e.data.stopWhen?.stepCountIs,m?.stopWhen?.stepCountIs),size:"sm"})]}),(0,r.jsx)(eM.p,{id:"step-count",type:"number",min:"1",max:"1000",value:e.data.stopWhen?.stepCountIs||"",onChange:t=>{let a=t.target.value?parseInt(t.target.value,10):void 0;h("stopWhen",{...e.data.stopWhen||{},stepCountIs:a})},placeholder:"50"}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:"Maximum number of execution steps for this sub agent (defaults to 50 if not set)"})]})]}),(0,r.jsx)(b.Separator,{}),(0,r.jsx)(tz,{label:"Components",componentLookup:t,selectedComponents:o,onSelectionChange:e=>{h("dataComponents",e)},emptyStateMessage:"No components found.",emptyStateActionText:"Create component",emptyStateActionHref:`/${n}/projects/${i}/components/new`,placeholder:"Select components..."}),(0,r.jsx)(tz,{label:"Artifacts",componentLookup:a,selectedComponents:c,onSelectionChange:e=>{h("artifactComponents",e)},emptyStateMessage:"No artifacts found.",emptyStateActionText:"Create artifact",emptyStateActionHref:`/${n}/projects/${i}/artifacts/new`,placeholder:"Select artifacts..."}),!u&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(b.Separator,{}),(0,r.jsx)("div",{className:"flex justify-end",children:(0,r.jsxs)(f.$,{variant:"destructive-outline",size:"sm",onClick:y,children:[(0,r.jsx)(em.A,{className:"size-4"}),"Delete"]})})]})]})}function tR({selectedNode:e,subAgentTeamAgentConfigLookup:t,errorHelpers:a}){let{updateNodeData:s}=(0,n.VH)(),{markUnsaved:i}=(0,ea.Sm)(),{handleInputChange:o,getFieldError:c,setFieldRef:u,updateField:m,deleteNode:p}=tn({selectedNodeId:e.id,errorHelpers:a}),{tenantId:h,projectId:x}=(0,l.useParams)(),g=(0,d.useCallback)(e=>{m("id",e)},[m]);eH({nameValue:e.data.name,idValue:e.data.id,onIdChange:g,isEditing:!1});let v=(0,d.useCallback)(()=>(function(e,t,a){if(void 0!==e.data.tempHeaders)return e.data.tempHeaders;let s=e.data.relationshipId;if(s)for(let e of Object.values(t)){let t=e[s];if(t)return t.headers??{}}return{}})(e,t,0),[e,t]),[j,y]=(0,d.useState)("{}");return(0,d.useEffect)(()=>{y(JSON.stringify(v(),null,2))},[e.id]),(0,r.jsxs)("div",{className:"space-y-8 flex flex-col",children:[(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:"Team agents are other agents within the same project that can collaborate and delegate tasks using the A2A (Agent-to-Agent) protocol. Team agents enable you to create specialized agents that work together to accomplish complex tasks."}),(0,r.jsx)(e6,{ref:e=>u("name",e),id:"name",name:"name",label:"Name",value:e.data.name||"",onChange:o,placeholder:"Support agent",disabled:!0,error:c("name")}),(0,r.jsx)(e6,{ref:e=>u("id",e),id:"id",name:"id",label:"Id",value:e.data.id||"",onChange:o,placeholder:"my-external-agent",error:c("id"),disabled:!0,description:"Choose a unique identifier for this agent. Using an existing id will replace that agent.",isRequired:!0}),(0,r.jsx)(e8,{ref:e=>u("description",e),id:"description",name:"description",label:"Description",value:e.data.description||"",onChange:o,placeholder:"This agent is responsible for...",error:c("description"),disabled:!0}),(0,r.jsx)(eA.y,{name:"headers",label:"Headers",value:j,onChange:t=>{y(t);try{let a=""===t.trim()?{}:JSON.parse(t);"object"!=typeof a||null===a||Array.isArray(a)||(s(e.id,{...e.data,tempHeaders:a}),i())}catch{}},placeholder:"{}",className:""}),(0,r.jsx)(eL.G,{href:`/${h}/projects/${x}/agents/${e.data.id}`,children:"Edit Agent"}),(0,r.jsx)(b.Separator,{}),(0,r.jsx)("div",{className:"flex justify-end",children:(0,r.jsxs)(f.$,{variant:"destructive-outline",size:"sm",onClick:p,children:[(0,r.jsx)(em.A,{className:"size-4"}),"Delete"]})})]})}var tH=a(37139);function tV({title:e}){return(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)("h3",{className:"text-sm font-medium mb-2",children:e}),(0,r.jsx)("div",{className:"flex flex-col gap-2",children:[void 0,void 0,void 0].map((e,t)=>(0,r.jsx)("div",{className:"w-full p-3 rounded-lg border border-border",children:(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)(X.E,{className:"size-8 rounded flex-shrink-0"}),(0,r.jsxs)("div",{className:"flex-1 min-w-0 space-y-2",children:[(0,r.jsx)(X.E,{className:"h-4 w-3/4"}),(0,r.jsx)(X.E,{className:"h-3 w-1/2"})]})]})},t))})]})}var tB=a(33551);function tZ({agent:e,onClick:t}){let{id:a,name:s,description:n}=e;return(0,r.jsx)(f.$,{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:a,onClick:()=>t(e),children:(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)("div",{className:"flex-shrink-0 mt-0.5 size-8 rounded bg-muted flex items-center justify-center",children:(0,r.jsx)(tB.A,{className:"size-4 text-muted-foreground"})}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("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:s})}),n&&(0,r.jsx)("p",{className:"text-xs text-muted-foreground truncate mb-1",children:n})]})]})},a)}function tF({selectedNode:e}){let{updateNode:t}=(0,n.VH)(),{tenantId:a,projectId:s}=(0,l.useParams)(),{agents:i,isLoading:o,error:u}=(()=>{let[e,t]=(0,d.useState)([]),[a,s]=(0,d.useState)(!0),[r,n]=(0,d.useState)(null),{tenantId:i,projectId:o,agentId:u}=(0,l.useParams)();return(0,d.useEffect)(()=>{(async()=>{try{s(!0),n(null);let e=await (0,tH.O)(i,o);if(e.success){let a=u?e.data.filter(e=>e.id!==u):e.data;t(a)}else n(e.error),c.oR.error(e.error)}catch(t){let e=t instanceof Error?t.message:"Failed to load agents";n(e),c.oR.error(e)}finally{s(!1)}})()},[i,o,u]),{agents:e,isLoading:a,error:r}})(),p=a=>{t(e.id,{type:m.Z6.TeamAgent,data:{id:a.id,name:a.name,description:a.description,relationshipId:null}})};return o?(0,r.jsx)(tV,{title:"Select team agent"}):u?(0,r.jsx)(tu,{message:"Something went wrong.",actionText:"Create agent",actionHref:`/${a}/projects/${s}/agents/`}):i?.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 team agent"}),(0,r.jsx)("div",{className:"flex flex-col gap-2 min-w-0 min-h-0",children:i.map(e=>(0,r.jsx)(tZ,{agent:e,onClick:p},e.id))})]})}):(0,r.jsx)(tu,{message:"No agents found.",actionText:"Create agent",actionHref:`/${a}/projects/${s}/agents/`})}function tq({selectedNodeId:e,selectedEdgeId:t,onClose:a,backToAgent:s,dataComponentLookup:i,artifactComponentLookup:o,agentToolConfigLookup:l,subAgentExternalAgentConfigLookup:c,subAgentTeamAgentConfigLookup:p,credentialLookup:h,disabled:x=!1}){let g=(0,n.j7)(e||""),f=(0,n.Yu)(),{hasFieldError:b,getFieldErrorMessage:v,getFirstErrorField:j}=(0,es.K)(),y=(0,ea.ow)(e=>e.errors),N=(0,d.useMemo)(()=>t?f.find(e=>e.id===t):null,[t,f]),{heading:C,HeadingIcon:k}=(0,d.useMemo)(()=>{let a,s="";if(e){let e=g?.type||m.Z6.SubAgent,t=m.fL[e];s=t?.name||"Node",a=t?.Icon}else if(t){let e=N?.type||"default",t=u.YY[e];s=t?.name||"Connection",a=t?.Icon}else s="Agent",a=et.A;return{heading:s,HeadingIcon:a}},[g,N,e,t]),S=(0,d.useMemo)(()=>{if(e&&!g||t&&!N)return(0,r.jsx)(ee,{});if(g){let e=g?.type,t=g.data?.id||g.id,a={hasFieldError:e=>b(t,e),getFieldErrorMessage:e=>v(t,e),getFirstErrorField:()=>j(t)};switch(e){case m.Z6.SubAgent:return(0,r.jsx)(tU,{selectedNode:g,dataComponentLookup:i,artifactComponentLookup:o,errorHelpers:a});case m.Z6.ExternalAgent:return(0,r.jsx)(ti,{selectedNode:g,credentialLookup:h,subAgentExternalAgentConfigLookup:c,errorHelpers:a});case m.Z6.ExternalAgentPlaceholder:return(0,r.jsx)(tx,{selectedNode:g});case m.Z6.TeamAgent:return(0,r.jsx)(tR,{selectedNode:g,subAgentTeamAgentConfigLookup:p,errorHelpers:a});case m.Z6.TeamAgentPlaceholder:return(0,r.jsx)(tF,{selectedNode:g});case m.Z6.MCPPlaceholder:return(0,r.jsx)(tE,{selectedNode:g});case m.Z6.MCP:return(0,r.jsx)(tS,{selectedNode:g,agentToolConfigLookup:l});case m.Z6.FunctionTool:return(0,r.jsx)(tv,{selectedNode:g});default:return null}}return N?(0,r.jsx)(eS,{selectedEdge:N}):(0,r.jsx)(tr,{})},[e,t,g,N,i,o,b,v,j,l,h,c,p,y]),T=g||N;return(0,r.jsxs)(ei,{children:[(0,r.jsxs)(eo,{children:[(0,r.jsxs)("div",{className:"flex items-center relative",children:[T&&(0,r.jsx)(ec,{onClick:s}),(0,r.jsx)(eT,{heading:C,Icon:k,className:(0,Q.cn)(T&&"transition-all duration-300 ease-in-out group-hover:translate-x-8")})]}),(0,r.jsx)(ed,{onClick:a})]}),(0,r.jsx)(el,{children:(0,r.jsx)("fieldset",{disabled:x,className:"contents",children:S})})]})}var tW=a(36815),tJ=a(62516);function tG({className:e,...t}){return(0,r.jsx)(h.A,{role:"status","aria-label":"Loading",className:(0,Q.cn)("size-4 animate-spin",e),...t})}var tK=a(25599),tY=a(71199),tX=a(23273),tQ=a(97661),t0=a(40048),t1=a(70757);let t2=(0,d.forwardRef)((e,t)=>(0,r.jsxs)(ep.A,{ref:t,...e,strokeWidth:0,children:[(0,r.jsx)("title",{children:"Vercel icon"}),(0,r.jsx)("g",{clipPath:"url(#clip0_24_207)",children:(0,r.jsx)("path",{d:"M11.9573 1.5L23.9146 22.2109H0L11.9573 1.5Z",fill:"currentColor"})}),(0,r.jsx)("defs",{})]}));t2.displayName="VercelIcon";var t5=a(6871),t3=a(73803),t4=a(89736),t6=a(94172),t8=a(17587);let t9=({children:e})=>(0,r.jsx)("div",{className:"flex justify-between items-center mb-6",children:e}),t7=({title:e})=>(0,r.jsx)("h3",{className:"text-md font-medium",children:e});function ae({href:e}){return(0,r.jsx)(f.$,{asChild:!0,variant:"outline",size:"sm",children:(0,r.jsxs)(tc(),{href:e,target:"_blank",rel:"noreferrer noopener",children:[(0,r.jsx)(t8.A,{className:"size-4"}),"View Docs"]})})}var at=a(20606),aa=a(9819);let as=(e,t)=>{let a=e;for(let[e,s]of Object.entries(t))a=a.replace(RegExp(`{{${e}}}`,"g"),s);return a},ar=(e,t)=>{let a=" ".repeat(t);return e.split("\n").map((e,t)=>0===t?e:`${a}${e}`).join("\n")};var an=a(8641),ai=a(42135),ao=a(81086),al=a(13408);function ad({placeholder:e,color:t,setColor:a}){return(0,r.jsxs)("div",{className:"relative flex items-center flex-row max-w-full",children:[(0,r.jsx)("div",{className:"absolute left-3 text-sm text-muted-foreground",children:"#"}),(0,r.jsx)(al.HC,{className:(0,Q.cn)("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive disabled:bg-muted","pl-7 pr-12"),color:t,onChange:a,placeholder:e}),(0,r.jsx)("div",{className:"z-10 absolute right-3",children:(0,r.jsxs)(ao.AM,{children:[(0,r.jsx)(ao.Wv,{asChild:!0,children:(0,r.jsx)(f.$,{"aria-label":"color picker",className:"flex flex-row gap-2 rounded w-6 h-6",size:"sm",variant:"ghost",style:{background:t},children:(0,r.jsx)("span",{className:"sr-only",children:"Color picker"})})}),(0,r.jsx)(ao.hl,{className:"flex flex-row w-fit p-2",children:(0,r.jsx)(al.jI,{color:t,onChange:a})})]})})]})}var ac=a(45667),au=((s={}).EMBEDDED_CHAT="Embedded Chat",s.CHAT_BUTTON="Chat Button",s.SIDEBAR_CHAT="Sidebar Chat",s);let am=({form:e})=>(0,r.jsx)(C.lV,{...e,children:(0,r.jsxs)("form",{className:"space-y-8 flex-2/5",children:[(0,r.jsx)(ai.U,{control:e.control,name:"component",label:"Component",options:Object.values(au).map(e=>({value:e,label:e})),selectTriggerClassName:"w-full"}),(0,r.jsxs)(C.eI,{className:"relative",children:[(0,r.jsx)(C.lR,{children:"Primary brand color"}),(0,r.jsx)(ad,{color:e.watch("baseSettings.primaryBrandColor"),setColor:t=>e.setValue("baseSettings.primaryBrandColor",t),placeholder:"#000000"})]}),(0,r.jsx)(an.a,{control:e.control,name:"aiChatSettings.aiAssistantAvatar",label:"AI assistant avatar",placeholder:"https://example.com/assistant-avatar.png"}),(0,r.jsx)(an.a,{control:e.control,name:"aiChatSettings.introMessage",label:"Intro message",placeholder:"Hi! How can I help?",description:"Supports markdown formatting. For example: **bold** or _italic_ or [link](https://example.com)"}),(0,r.jsx)(an.a,{control:e.control,name:"aiChatSettings.placeholder",label:"Placeholder",placeholder:"How do I get started?"}),(0,r.jsxs)(C.eI,{className:"relative flex flex-row gap-2 items-center w-full justify-between",children:[(0,r.jsxs)("div",{className:"flex flex-row gap-2 items-center",children:[(0,r.jsx)(C.lR,{children:"Show data operations"}),(0,r.jsxs)(e$.Tooltip,{children:[(0,r.jsx)(e$.TooltipTrigger,{children:(0,r.jsx)(ew.A,{className:"w-3 h-3 text-muted-foreground"})}),(0,r.jsx)(e$.TooltipContent,{children:"Controls whether data operations are included in the response stream."})]})]}),(0,r.jsx)(y.xI,{control:e.control,name:"shouldEmitDataOperations",render:({field:e})=>(0,r.jsx)(ac.d,{checked:e.value,onCheckedChange:e.onChange})})]})]})}),ap=`import { {{COMPONENT_NAME}}, type {{COMPONENT_NAME}}Props } from "@inkeep/agents-ui";
|
|
76
|
+
|
|
77
|
+
const props: {{COMPONENT_NAME}}Props = {
|
|
78
|
+
baseSettings: {{BASE_SETTINGS}},
|
|
79
|
+
aiChatSettings: {{AI_CHAT_SETTINGS}},
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export const InkeepWidget = () => {
|
|
83
|
+
return (
|
|
84
|
+
<>
|
|
85
|
+
<button data-inkeep-sidebar-chat-trigger>
|
|
86
|
+
Toggle sidebar
|
|
87
|
+
</button>
|
|
88
|
+
<{{COMPONENT_NAME}} {...props} />
|
|
89
|
+
</>
|
|
90
|
+
);
|
|
91
|
+
};`,ah=`import { {{COMPONENT_NAME}}, type {{COMPONENT_NAME}}Props } from "@inkeep/agents-ui";
|
|
92
|
+
|
|
93
|
+
const props: {{COMPONENT_NAME}}Props = {
|
|
94
|
+
baseSettings: {{BASE_SETTINGS}},
|
|
95
|
+
aiChatSettings: {{AI_CHAT_SETTINGS}},
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
export const InkeepWidget = () => {
|
|
99
|
+
return <{{COMPONENT_NAME}} {...props} />;
|
|
100
|
+
};`,ax=`Install the package:
|
|
101
|
+
|
|
102
|
+
\`\`\`bash
|
|
103
|
+
npm install @inkeep/agents-ui
|
|
104
|
+
\`\`\``,ag=`Add the chat button component to your application:
|
|
105
|
+
|
|
106
|
+
\`\`\`js
|
|
107
|
+
const config = {
|
|
108
|
+
baseSettings: {{BASE_SETTINGS}},
|
|
109
|
+
aiChatSettings: {{AI_CHAT_SETTINGS}}
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
const chatButton = Inkeep.ChatButton(config);
|
|
113
|
+
\`\`\``,af=`Add the sidebar chat component to your application:
|
|
114
|
+
|
|
115
|
+
Define an element in your page that will be the "container" for the sidebar chat. Also add a button that will trigger the sidebar chat and give it the data attribute \`data-inkeep-sidebar-chat-trigger\`.
|
|
116
|
+
|
|
117
|
+
\`\`\`html
|
|
118
|
+
<div style="display: flex; flex-direction: row; height: 100vh; max-height: 100vh; padding: 0; margin: 0; overflow: hidden;">
|
|
119
|
+
<div style="display: flex; flex-direction: column; height: 100vh; max-height: 100vh; padding: 0; margin: 0; overflow-y: auto; flex: 1;">
|
|
120
|
+
<!-- your app content here -->
|
|
121
|
+
<button data-inkeep-sidebar-chat-trigger="">Toggle Sidebar Chat</button>
|
|
122
|
+
</div>
|
|
123
|
+
<!-- the sidebar chat will be inserted into this div -->
|
|
124
|
+
<div id="ikp-sidebar-chat-target"></div>
|
|
125
|
+
</div>
|
|
126
|
+
\`\`\`
|
|
127
|
+
|
|
128
|
+
Insert the SidebarChat widget by using the \`Inkeep.SidebarChat()\` function.
|
|
129
|
+
|
|
130
|
+
\`\`\`js
|
|
131
|
+
const config = {
|
|
132
|
+
baseSettings: {{BASE_SETTINGS}},
|
|
133
|
+
aiChatSettings: {{AI_CHAT_SETTINGS}}
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
const sidebarChat = Inkeep.SidebarChat("#ikp-sidebar-chat-target", config);
|
|
137
|
+
\`\`\``,ab=`Add the embedded chat component to your application:
|
|
138
|
+
|
|
139
|
+
Define an element in your page that will be the "container" for the embedded chat.
|
|
140
|
+
|
|
141
|
+
\`\`\`html
|
|
142
|
+
<div style="display: flex; align-items: center; justify-content: center; height: calc(100vh - 16px);">
|
|
143
|
+
<div style="max-height: 600px; height: 100%;">
|
|
144
|
+
<div id="ikp-embedded-chat-target"></div>
|
|
145
|
+
</div>
|
|
146
|
+
</div>
|
|
147
|
+
\`\`\`
|
|
148
|
+
|
|
149
|
+
Insert the EmbeddedChat widget by using the \`Inkeep.EmbeddedChat()\` function.
|
|
150
|
+
|
|
151
|
+
\`\`\`js
|
|
152
|
+
const config = {
|
|
153
|
+
baseSettings: {{BASE_SETTINGS}},
|
|
154
|
+
aiChatSettings: {{AI_CHAT_SETTINGS}}
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
const embeddedChat = Inkeep.EmbeddedChat("#ikp-embedded-chat-target", config);
|
|
158
|
+
\`\`\``,av=`Add the below script tag to the \`<head>\` or \`<body>\` of your website.
|
|
159
|
+
|
|
160
|
+
\`\`\`html
|
|
161
|
+
<script
|
|
162
|
+
type="module"
|
|
163
|
+
src="https://cdn.jsdelivr.net/npm/@inkeep/cxkit-js@0.5/dist/embed.js"
|
|
164
|
+
defer
|
|
165
|
+
></script>
|
|
166
|
+
\`\`\``,aj=({component:e,baseSettings:t,aiChatSettings:a})=>{let s,n,i={[au.EMBEDDED_CHAT]:"InkeepEmbeddedChat",[au.CHAT_BUTTON]:"InkeepChatButton",[au.SIDEBAR_CHAT]:"InkeepSidebarChat"}[e],o=ar(JSON.stringify(t,null,2),2),l=ar(JSON.stringify(a,null,2),2),d=(s=as(e===au.SIDEBAR_CHAT?ap:ah,{COMPONENT_NAME:i,BASE_SETTINGS:o,AI_CHAT_SETTINGS:l}),`${ax}
|
|
167
|
+
|
|
168
|
+
Add the component to your application:
|
|
169
|
+
\`\`\`tsx
|
|
170
|
+
${s}
|
|
171
|
+
\`\`\``),c=(n=as({[au.CHAT_BUTTON]:ag,[au.SIDEBAR_CHAT]:af,[au.EMBEDDED_CHAT]:ab}[e],{BASE_SETTINGS:o,AI_CHAT_SETTINGS:l}),`${av}
|
|
172
|
+
|
|
173
|
+
${n}`);return(0,r.jsx)("div",{children:(0,r.jsxs)(t3.tU,{defaultValue:"react",children:[(0,r.jsxs)(t3.j7,{className:"mb-4 h-8",children:[(0,r.jsx)(t3.Xi,{value:"react",className:"py-0.5",children:"React"}),(0,r.jsx)(t3.Xi,{value:"js",className:"py-0.5",children:"Javascript"})]}),(0,r.jsx)(aa.av,{value:"react",children:(0,r.jsx)(t4.jH,{children:d})}),(0,r.jsx)(aa.av,{value:"js",children:(0,r.jsx)(t4.jH,{children:c})})]})})};var ay=a(70807),aN=a(83238),aC=a(22764),ak=a(28129),aS=a(64869);let aT=`
|
|
174
|
+
.ikp-chat-bubble__root {
|
|
175
|
+
position: absolute;
|
|
176
|
+
}
|
|
177
|
+
.ikp-chat-button__container {
|
|
178
|
+
position: absolute;
|
|
179
|
+
}
|
|
180
|
+
.ikp-sidebar-chat__root {
|
|
181
|
+
border-radius: 0px 9px 9px 0px;
|
|
182
|
+
}
|
|
183
|
+
[data-sidebar] .ikp-ai-chat-wrapper {
|
|
184
|
+
border-radius: inherit;
|
|
185
|
+
}
|
|
186
|
+
`,aw={[au.EMBEDDED_CHAT]:ay.Po,[au.CHAT_BUTTON]:aN.b,[au.SIDEBAR_CHAT]:aC.V};function aA({component:e,baseSettings:t,aiChatSettings:a,shouldEmitDataOperations:s}){let{tenantId:n,projectId:i,agentId:o}=(0,l.useParams)(),{apiKey:d,isLoading:c}=(0,aS.t)({tenantId:n,projectId:i,agentId:o}),u=aw[e];return c||!d?(0,r.jsx)("div",{className:"h-full flex items-center justify-center",children:(0,r.jsx)("p",{className:"text-muted-foreground",children:c?"Loading preview...":"Failed to load preview"})}):(0,r.jsxs)("div",{className:`relative flex flex-row gap-2 h-full w-full ${e===au.EMBEDDED_CHAT?"bg-background justify-center":"rounded-lg border bg-sidebar justify-between"}`,children:[e===au.SIDEBAR_CHAT&&(0,r.jsx)("div",{className:"p-4",children:(0,r.jsxs)(f.$,{variant:"outline",size:"sm","data-inkeep-sidebar-chat-trigger":!0,children:[(0,r.jsx)(ak.A,{className:"size-4"}),"Toggle sidebar"]})}),(0,r.jsx)("div",{className:`h-full ${e===au.SIDEBAR_CHAT?"rounded-[0_9px_9px_0]":"w-full"} ${e===au.EMBEDDED_CHAT?"max-w-[500px]":""}`,children:(0,r.jsx)(u,{shouldAutoFocusInput:!1,openSettings:{defaultOpen:!0},baseSettings:{...t,colorMode:{sync:{target:document.documentElement,attributes:["class"],isDarkMode:e=>!!e?.class?.includes("dark")}},theme:{styles:[{key:"custom-styles",type:"style",value:aT}]}},aiChatSettings:{...a,headers:{"x-inkeep-tenant-id":n,"x-inkeep-project-id":i,"x-inkeep-agent-id":o,Authorization:`Bearer ${d}`,"x-emit-operations":s?"true":"false"}}})})]})}let aE=(0,d.forwardRef)((e,t)=>(0,r.jsxs)(ep.A,{ref:t,...e,strokeWidth:0,children:[(0,r.jsx)("title",{children:"Claude icon"}),(0,r.jsx)("g",{clipPath:"url(#clip0_23_202)",children:(0,r.jsx)("path",{d:"M4.704 15.96L9.432 13.32L9.504 13.08L9.432 12.96H9.192L8.4 12.912L5.712 12.84L3.36 12.72L1.08 12.6L0.504 12.48L0 11.76L0.048 11.4L0.528 11.088L1.224 11.136L2.736 11.256L5.016 11.4L6.672 11.496L9.12 11.784H9.504L9.552 11.616L9.432 11.52L9.336 11.424L6.96 9.84L4.416 8.16L3.072 7.176L2.352 6.696L1.992 6.216L1.848 5.208L2.496 4.488L3.384 4.56L3.6 4.608L4.488 5.304L6.408 6.768L8.88 8.64L9.24 8.928L9.384 8.832L9.408 8.76L9.24 8.496L7.92 6L6.48 3.504L5.832 2.472L5.664 1.848C5.592 1.608 5.568 1.368 5.568 1.128L6.288 0.12L6.72 0L7.728 0.144L8.112 0.48L8.736 1.92L9.72 4.152L11.28 7.176L11.76 8.088L12 8.904L12.072 9.144H12.24V9.024L12.36 7.296L12.6 5.208L12.84 2.52L12.912 1.752L13.296 0.84L14.016 0.36L14.64 0.624L15.12 1.32L15.048 1.752L14.784 3.6L14.16 6.504L13.8 8.472H14.016L14.256 8.208L15.24 6.912L16.896 4.848L17.616 4.008L18.48 3.12L19.032 2.688H20.064L20.808 3.816L20.472 4.992L19.416 6.336L18.528 7.464L17.256 9.168L16.488 10.536L16.56 10.632H16.728L19.608 10.008L21.144 9.744L22.968 9.432L23.808 9.816L23.904 10.2L23.568 11.016L21.6 11.496L19.296 11.976L15.864 12.768L15.816 12.792L15.864 12.864L17.4 13.008L18.072 13.056H19.704L22.728 13.296L23.52 13.776L23.976 14.424L23.904 14.904L22.68 15.528L21.048 15.144L17.208 14.232L15.912 13.92H15.72V14.016L16.824 15.096L18.816 16.896L21.36 19.224L21.48 19.8L21.168 20.28L20.832 20.232L18.624 18.552L17.76 17.832L15.84 16.2H15.72V16.368L16.152 17.016L18.504 20.544L18.624 21.624L18.456 21.96L17.832 22.2L17.184 22.056L15.792 20.136L14.352 17.976L13.224 16.008L13.104 16.104L12.408 23.352L12.096 23.712L11.376 24L10.776 23.52L10.44 22.8L10.776 21.312L11.16 19.392L11.472 17.856L11.76 15.96L11.928 15.336V15.288H11.76L10.32 17.28L8.16 20.232L6.432 22.056L6.024 22.224L5.304 21.864L5.376 21.192L5.76 20.64L8.16 17.568L9.6 15.672L10.56 14.568L10.536 14.448H10.464L4.128 18.576L3 18.72L2.52 18.24L2.568 17.52L2.808 17.28L4.728 15.96H4.704Z",fill:"currentColor"})}),(0,r.jsx)("defs",{children:(0,r.jsx)("clipPath",{id:"clip0_23_202",children:(0,r.jsx)("rect",{width:"24",height:"24",fill:"white"})})})]}));aE.displayName="ClaudeIcon";let aI=(0,d.forwardRef)((e,t)=>(0,r.jsxs)(ep.A,{ref:t,...e,strokeWidth:0,children:[(0,r.jsx)("title",{children:"Cursor icon"}),(0,r.jsx)("path",{xmlns:"http://www.w3.org/2000/svg",d:"M22.1323 5.6806L12.5245 0.133623C12.216 -0.0445409 11.8353 -0.0445409 11.5268 0.133623L1.91947 5.6806C1.66012 5.83035 1.5 6.10727 1.5 6.40723V17.5928C1.5 17.8923 1.66012 18.1697 1.91947 18.3194L11.5272 23.8664C11.8358 24.0445 12.2164 24.0445 12.525 23.8664L22.1327 18.3194C22.3921 18.1697 22.5522 17.8927 22.5522 17.5928V6.40723C22.5522 6.10774 22.3921 5.83035 22.1327 5.6806H22.1323ZM21.5288 6.85558L12.2539 22.9201C12.1912 23.0283 12.0257 22.9841 12.0257 22.8587V12.3399C12.0257 12.1297 11.9133 11.9353 11.7311 11.8297L2.62176 6.57052C2.51351 6.50784 2.55771 6.34227 2.6831 6.34227H21.2329C21.4963 6.34227 21.6609 6.6278 21.5292 6.85605H21.5288V6.85558Z",fill:"currentColor"})]}));aI.displayName="CursorIcon";let aL=(0,d.forwardRef)((e,t)=>(0,r.jsxs)(ep.A,{ref:t,...e,strokeWidth:0,children:[(0,r.jsx)("title",{children:"VS Code icon"}),(0,r.jsxs)("g",{clipPath:"url(#clip0_22_190)",children:[(0,r.jsx)("path",{d:"M18.0011 0.957249C18.0011 0.203854 17.1576 0.203846 16.7827 0.29802C17.3075 -0.116349 17.9231 -0.0158829 18.1417 0.10968L23.2103 2.59498C23.6933 2.83179 23.9996 3.32452 23.9996 3.86449V20.2141C23.9996 20.7613 23.6851 21.2593 23.1923 21.4923L18.4229 23.7475C18.0948 23.8887 17.3825 24.2372 16.7827 23.7474C17.5325 23.8888 17.9387 23.3551 18.0011 22.9941V0.957249Z",fill:"currentColor"}),(0,r.jsx)("path",{d:"M16.8439 0.285044C17.2418 0.206418 18.0016 0.242881 18.0016 0.957858V6.58559L2.63451 18.2108C2.3659 18.4141 1.98789 18.3803 1.75911 18.1327L0.175313 16.419C-0.0728021 16.1505 -0.0554421 15.7302 0.213964 15.4834L16.783 0.29863L16.8439 0.285044Z",fill:"currentColor"}),(0,r.jsx)("path",{d:"M18.0016 17.461L2.63451 5.83572C2.3659 5.63251 1.98789 5.66623 1.75911 5.91379L0.175313 7.62757C-0.0728021 7.89602 -0.0554421 8.31628 0.213964 8.56322L16.783 23.7479C17.5329 23.8892 17.9391 23.3555 18.0016 22.9945V17.461Z",fill:"currentColor"})]})]}));aL.displayName="VSCodeIcon";let aO=(0,d.forwardRef)((e,t)=>(0,r.jsxs)(ep.A,{ref:t,...e,strokeWidth:0,children:[(0,r.jsx)("title",{children:"Windsurf icon"}),(0,r.jsx)("path",{xmlns:"http://www.w3.org/2000/svg",d:"M23.7787 5.00376H23.55C22.3463 5.00188 21.3695 5.97669 21.3695 7.18024V12.0478C21.3695 13.0198 20.566 13.8072 19.6098 13.8072C19.0417 13.8072 18.4746 13.5213 18.138 13.0414L13.1667 5.94109C12.7542 5.35149 12.083 5 11.3564 5C10.223 5 9.20307 5.96357 9.20307 7.15308V12.0488C9.20307 13.0208 8.40623 13.8081 7.44346 13.8081C6.87349 13.8081 6.30724 13.5222 5.97068 13.0424L0.407794 5.09655C0.28217 4.91657 0 5.00564 0 5.22498V9.47015C0 9.68481 0.0656303 9.89291 0.188421 10.0691L5.66319 17.8874C5.98663 18.3495 6.46382 18.6926 7.01408 18.8173C8.39123 19.1303 9.65869 18.0702 9.65869 16.7195V11.8266C9.65869 10.8546 10.4462 10.0672 11.4183 10.0672H11.4211C12.007 10.0672 12.5564 10.3531 12.8929 10.833L17.8652 17.9324C18.2787 18.523 18.9152 18.8735 19.6745 18.8735C20.8332 18.8735 21.826 17.909 21.826 16.7204V11.8257C21.826 10.8537 22.6135 10.0663 23.5856 10.0663H23.7797C23.9015 10.0663 24 9.96787 24 9.84604V5.22402C24 5.10219 23.9015 5.00376 23.7797 5.00376H23.7787Z",fill:"currentColor"})]}));aO.displayName="WindsurfIcon";let a_="cursor",a$=[{label:"Cursor",value:a_,content:`
|
|
187
|
+
1. Open [Cursor](https://cursor.com/docs/context/mcp). Create a \`.cursor\` directory in your project root if there isn't one already.
|
|
188
|
+
2. Create or open the \`mcp.json\` file in the \`.cursor\` directory.
|
|
189
|
+
3. Add the following configuration:
|
|
190
|
+
\`\`\`bash
|
|
191
|
+
{
|
|
192
|
+
"mcpServers": {
|
|
193
|
+
"{{AGENT_NAME}}": {
|
|
194
|
+
"type": "mcp",
|
|
195
|
+
"url": "{{MCP_SERVER_URL}}",
|
|
196
|
+
"headers": {
|
|
197
|
+
"Authorization": "Bearer INKEEP_AGENT_API_KEY"
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
\`\`\`
|
|
203
|
+
4. Save the configuration file. You may need to restart Cursor to see the changes.
|
|
204
|
+
5. You can also add the configuration globally by opening the command palette (\`Cmd/Ctrl + Shift + P\`) and selecting **Cursor Settings > MCP > Add new global MCP server**.
|
|
205
|
+
6. You can verify the connection by opening the composer (\`Cmd + I\`) in **agent mode** and asking a question.
|
|
206
|
+
`,IconComponent:aI},{label:"VS Code",value:"vs-code",content:`
|
|
207
|
+
1. Open [Visual Studio Code](https://code.visualstudio.com/docs/copilot/customization/mcp-servers). Create a \`.vscode\` directory in your project root if there isn't one already.
|
|
208
|
+
2. Create or open the \`mcp.json\` file in the \`.vscode\` directory.
|
|
209
|
+
3. Add the following configuration:
|
|
210
|
+
\`\`\`bash
|
|
211
|
+
{
|
|
212
|
+
"servers": {
|
|
213
|
+
"{{AGENT_NAME}}": {
|
|
214
|
+
"type": "http",
|
|
215
|
+
"url": "{{MCP_SERVER_URL}}",
|
|
216
|
+
"headers": {
|
|
217
|
+
"Authorization": "Bearer INKEEP_AGENT_API_KEY"
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
\`\`\`
|
|
223
|
+
4. Save the configuration file. You may need to restart VS Code to see the changes.
|
|
224
|
+
5. You can verify the connection by opening the composer (\`Ctrl + Alt + I\`) in **agent mode** and asking a question.
|
|
225
|
+
`,IconComponent:aL},{label:"Windsurf",value:"windsurf",content:`
|
|
226
|
+
1. Open [Windsurf](https://docs.windsurf.com/windsurf/cascade/mcp). Create a \`.windsurf\` directory in your project root if there isn't one already.
|
|
227
|
+
2. Create or open the \`mcp_config.json\` file in the \`.windsurf\` directory.
|
|
228
|
+
3. Add the following configuration:
|
|
229
|
+
\`\`\`bash
|
|
230
|
+
{
|
|
231
|
+
"mcpServers": {
|
|
232
|
+
"{{AGENT_NAME}}": {
|
|
233
|
+
"serverUrl": "{{MCP_SERVER_URL}}",
|
|
234
|
+
"headers": {
|
|
235
|
+
"Authorization": "Bearer INKEEP_AGENT_API_KEY"
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
\`\`\`
|
|
241
|
+
4. Save the configuration file. You may need to restart Windsurf to see the changes.
|
|
242
|
+
5. You can verify the connection by opening the composer (\`Cmd/Ctrl + L\`) in **code mode** and asking a question.
|
|
243
|
+
`,IconComponent:aO},{label:"Claude Code",value:"claude-code",content:`
|
|
244
|
+
1. Install [Claude Code](https://claude.com/product/claude-code) by running the following command in your terminal:
|
|
245
|
+
|
|
246
|
+
\`\`\`bash
|
|
247
|
+
curl -fsSL https://claude.ai/install.sh | bash
|
|
248
|
+
\`\`\`
|
|
249
|
+
|
|
250
|
+
2. Navigate to the folder where your project is located and run the following command to add the MCP server to your Claude Code settings.
|
|
251
|
+
|
|
252
|
+
\`\`\`bash
|
|
253
|
+
claude mcp add --transport http --scope local {{AGENT_NAME}} {{MCP_SERVER_URL}} --header "Authorization: Bearer INKEEP_AGENT_API_KEY"
|
|
254
|
+
\`\`\`
|
|
255
|
+
|
|
256
|
+
3. You can verify the connection by entering the \`claude\` command and asking a question to Claude Code.
|
|
257
|
+
|
|
258
|
+
`,IconComponent:aE}],aP="chat-ui",az="mcp-server",aD="node-js",aM={[aP]:function(){let{PUBLIC_INKEEP_AGENTS_RUN_API_URL:e}=(0,eU.y)(),t=`${e}/api/chat`,a=(0,y.mN)({defaultValues:{component:au.EMBEDDED_CHAT,baseSettings:{primaryBrandColor:"#3784ff"},aiChatSettings:{agentUrl:t,aiAssistantAvatar:"",introMessage:"Hi! How can I help?",placeholder:"How do I get started?"},shouldEmitDataOperations:!0}}),s=a.watch(),n=s.component??au.EMBEDDED_CHAT,i=s.baseSettings??{primaryBrandColor:"#3784ff"},o=s.aiChatSettings??{agentUrl:t},l=s.shouldEmitDataOperations??!0;return(0,r.jsxs)(t3.tU,{defaultValue:"preview",children:[(0,r.jsxs)(t9,{children:[(0,r.jsx)(t7,{title:"Chat UI"}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsxs)(t3.j7,{className:"h-8",children:[(0,r.jsxs)(t3.Xi,{value:"preview",className:"py-0.5 px-2.5 gap-2",children:[(0,r.jsx)(at.A,{className:"size-4"}),(0,r.jsx)("span",{children:"Preview"})]}),(0,r.jsxs)(t3.Xi,{value:"code",className:"py-0.5 px-2.5 gap-2",children:[(0,r.jsx)(z.A,{className:"size-4"}),(0,r.jsx)("span",{children:"Code"})]})]}),(0,r.jsx)(ae,{href:`${t6.iO}/talk-to-your-agents/react/chat-button`})]})]}),(0,r.jsx)(t3.av,{value:"preview",children:(0,r.jsxs)("div",{className:"flex flex-row gap-12 w-full",children:[(0,r.jsx)(am,{form:a}),(0,r.jsx)("div",{className:"flex-3/5 w-full h-[500px]",children:(0,r.jsx)(aA,{component:n,baseSettings:i,aiChatSettings:o,shouldEmitDataOperations:l},l?"true":"false")})]})}),(0,r.jsx)(t3.av,{value:"code",children:(0,r.jsx)(aj,{component:n,baseSettings:{...i},aiChatSettings:{...o,apiKey:"INKEEP_AGENT_API_KEY",headers:{"x-emit-operations":l?"true":"false"}}})})]})},[az]:function(){let{PUBLIC_INKEEP_AGENTS_RUN_API_URL:e}=(0,eU.y)(),t=`${e}/v1/mcp`,a=(0,ea.ow)(e=>e.metadata),s=(a?.name||"agentName").toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g,(e,t)=>t.toUpperCase()).replace(/^[^a-zA-Z]+/,"");return(0,r.jsxs)("div",{children:[(0,r.jsxs)(t9,{children:[(0,r.jsx)(t7,{title:"MCP Server"}),(0,r.jsx)(ae,{href:`${t6.iO}/talk-to-your-agents/mcp-server`})]}),(0,r.jsxs)(t3.tU,{defaultValue:a_,children:[(0,r.jsx)(t3.j7,{className:"mb-3 bg-transparent gap-3 px-0",children:a$.map(e=>(0,r.jsxs)(t3.Xi,{value:e.value,className:"rounded-full border gap-2 data-[state=active]:bg-primary/5 data-[state=active]:text-primary data-[state=active]:border-primary data-[state=active]:shadow-none",children:[e.IconComponent&&(0,r.jsx)(e.IconComponent,{className:"size-4"}),e.label]},e.value))}),a$.map(e=>(0,r.jsx)(t3.av,{value:e.value,children:(0,r.jsx)(t4.jH,{children:as(e.content,{AGENT_NAME:s,MCP_SERVER_URL:t})})},e.value))]})]})},sdk:function(){let{PUBLIC_INKEEP_AGENTS_RUN_API_URL:e}=(0,eU.y)(),t=`${e}/api/chat`;return(0,r.jsxs)("div",{children:[(0,r.jsxs)(t9,{children:[(0,r.jsx)(t7,{title:"Vercel SDK"}),(0,r.jsx)(ae,{href:`${t6.iO}/talk-to-your-agents/vercel-ai-sdk/use-chat`})]}),(0,r.jsx)(t4.jH,{children:`Install the package:
|
|
259
|
+
|
|
260
|
+
\`\`\`bash
|
|
261
|
+
npm install ai @ai-sdk/react
|
|
262
|
+
\`\`\`
|
|
263
|
+
|
|
264
|
+
Example Next.js implementation using Vercel AI SDK:
|
|
265
|
+
|
|
266
|
+
\`\`\`tsx
|
|
267
|
+
"use client";
|
|
268
|
+
|
|
269
|
+
import { useChat } from "@ai-sdk/react";
|
|
270
|
+
import { DefaultChatTransport } from "ai";
|
|
271
|
+
import { useState } from "react";
|
|
272
|
+
|
|
273
|
+
export default function Page() {
|
|
274
|
+
const { messages, sendMessage } = useChat({
|
|
275
|
+
transport: new DefaultChatTransport({
|
|
276
|
+
api: "${t}",
|
|
277
|
+
headers: {
|
|
278
|
+
Authorization: "Bearer INKEEP_AGENT_API_KEY",
|
|
279
|
+
},
|
|
280
|
+
}),
|
|
281
|
+
});
|
|
282
|
+
const [input, setInput] = useState("");
|
|
283
|
+
|
|
284
|
+
return (
|
|
285
|
+
<div className="max-w-2xl mx-auto p-4">
|
|
286
|
+
<div className="space-y-4 mb-4">
|
|
287
|
+
{messages.map((message) => (
|
|
288
|
+
<div key={message.id} className="border rounded p-3">
|
|
289
|
+
<div className="font-semibold mb-2">
|
|
290
|
+
{message.role === "user" ? "👤 User" : "🤖 Assistant"}
|
|
291
|
+
</div>
|
|
292
|
+
|
|
293
|
+
<div className="space-y-2">
|
|
294
|
+
{message.parts.map((part, partIndex) => {
|
|
295
|
+
const partKey = \`\${message.id}-\${part.type}-\${partIndex}\`;
|
|
296
|
+
|
|
297
|
+
if (part.type === "text") {
|
|
298
|
+
return (
|
|
299
|
+
<div key={partKey} className="whitespace-pre-wrap">
|
|
300
|
+
{part.text}
|
|
301
|
+
</div>
|
|
302
|
+
);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
return null;
|
|
306
|
+
})}
|
|
307
|
+
</div>
|
|
308
|
+
</div>
|
|
309
|
+
))}
|
|
310
|
+
</div>
|
|
311
|
+
|
|
312
|
+
<form
|
|
313
|
+
onSubmit={(e) => {
|
|
314
|
+
e.preventDefault();
|
|
315
|
+
if (input.trim()) {
|
|
316
|
+
sendMessage({ text: input });
|
|
317
|
+
setInput("");
|
|
318
|
+
}
|
|
319
|
+
}}
|
|
320
|
+
className="flex gap-2"
|
|
321
|
+
>
|
|
322
|
+
<input
|
|
323
|
+
value={input}
|
|
324
|
+
onChange={(e) => setInput(e.target.value)}
|
|
325
|
+
placeholder="Type your message..."
|
|
326
|
+
className="flex-1 p-2 border rounded"
|
|
327
|
+
/>
|
|
328
|
+
<button
|
|
329
|
+
type="submit"
|
|
330
|
+
className="px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600"
|
|
331
|
+
>
|
|
332
|
+
Send
|
|
333
|
+
</button>
|
|
334
|
+
</form>
|
|
335
|
+
</div>
|
|
336
|
+
);
|
|
337
|
+
}
|
|
338
|
+
\`\`\`
|
|
339
|
+
`})]})},[aD]:function(){let{PUBLIC_INKEEP_AGENTS_RUN_API_URL:e}=(0,eU.y)(),t=`${e}/api/chat`,{agentId:a}=(0,l.useParams)();return(0,r.jsxs)("div",{children:[(0,r.jsxs)(t9,{children:[(0,r.jsx)(t7,{title:"Node.js Backend"}),(0,r.jsx)(ae,{href:`${t6.iO}/talk-to-your-agents/chat-api`})]}),(0,r.jsx)(t4.jH,{children:`Example Next.js API route (\`app/api/chat/route.ts\`):
|
|
340
|
+
|
|
341
|
+
\`\`\`typescript
|
|
342
|
+
export async function POST(req: Request) {
|
|
343
|
+
const { messages, conversationId } = await req.json();
|
|
344
|
+
|
|
345
|
+
const response = await fetch('${t}', {
|
|
346
|
+
method: 'POST',
|
|
347
|
+
headers: {
|
|
348
|
+
'Authorization': \`Bearer \${process.env.INKEEP_AGENT_API_KEY}\`,
|
|
349
|
+
'Content-Type': 'application/json',
|
|
350
|
+
'x-emit-operations': 'true',
|
|
351
|
+
},
|
|
352
|
+
body: JSON.stringify({
|
|
353
|
+
messages,
|
|
354
|
+
conversationId,
|
|
355
|
+
}),
|
|
356
|
+
});
|
|
357
|
+
|
|
358
|
+
return new Response(response.body, {
|
|
359
|
+
headers: {
|
|
360
|
+
'Content-Type': 'text/event-stream',
|
|
361
|
+
'Cache-Control': 'no-cache',
|
|
362
|
+
'Connection': 'keep-alive',
|
|
363
|
+
},
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
\`\`\`
|
|
367
|
+
|
|
368
|
+
Example response (Server-Sent Events stream):
|
|
369
|
+
|
|
370
|
+
\`\`\`bash
|
|
371
|
+
data: {"type":"data-operation","data":{"type":"agent_initializing","details":{"sessionId":"chatds-12345678910111","agentId":"${a}"}}}
|
|
372
|
+
|
|
373
|
+
data: {"type":"text-start","id":"1234567891011-abcdefghi"}
|
|
374
|
+
|
|
375
|
+
data: {"type":"text-delta","id":"1234567891011-abcdefghi","delta":"I answer"}
|
|
376
|
+
|
|
377
|
+
data: {"type":"text-delta","id":"1234567891011-abcdefghi","delta":" technical questions"}
|
|
378
|
+
|
|
379
|
+
data: {"type":"text-end","id":"1234567891011-abcdefghi"}
|
|
380
|
+
|
|
381
|
+
data: [DONE]
|
|
382
|
+
\`\`\`
|
|
383
|
+
`})]})},api:function(){let{PUBLIC_INKEEP_AGENTS_RUN_API_URL:e}=(0,eU.y)(),{agentId:t}=(0,l.useParams)(),a=`${e}/api/chat`;return(0,r.jsxs)("div",{children:[(0,r.jsxs)(t9,{children:[(0,r.jsx)(t7,{title:"REST API"}),(0,r.jsx)(ae,{href:`${t6.iO}/talk-to-your-agents/chat-api`})]}),(0,r.jsx)(t4.jH,{children:`Example cURL request:
|
|
384
|
+
|
|
385
|
+
\`\`\`bash
|
|
386
|
+
curl -N \\
|
|
387
|
+
-X POST "${a}" \\
|
|
388
|
+
-H "Authorization: Bearer INKEEP_AGENT_API_KEY" \\
|
|
389
|
+
-H "Content-Type: application/json" \\
|
|
390
|
+
-H "x-emit-operations: true" \\
|
|
391
|
+
-d '{
|
|
392
|
+
"messages": [
|
|
393
|
+
{ "role": "user", "content": "What can you do?" }
|
|
394
|
+
],
|
|
395
|
+
"conversationId": "chat-1234"
|
|
396
|
+
}'
|
|
397
|
+
\`\`\`
|
|
398
|
+
|
|
399
|
+
Example response (Server-Sent Events stream):
|
|
400
|
+
|
|
401
|
+
\`\`\`bash
|
|
402
|
+
data: {"type":"data-operation","data":{"type":"agent_initializing","details":{"sessionId":"chatds-12345678910111","agentId":"${t}"}}}
|
|
403
|
+
|
|
404
|
+
data: {"type":"text-start","id":"1234567891011-abcdefghi"}
|
|
405
|
+
|
|
406
|
+
data: {"type":"text-delta","id":"1234567891011-abcdefghi","delta":"I answer"}
|
|
407
|
+
|
|
408
|
+
data: {"type":"text-delta","id":"1234567891011-abcdefghi","delta":" technical questions"}
|
|
409
|
+
|
|
410
|
+
data: {"type":"text-end","id":"1234567891011-abcdefghi"}
|
|
411
|
+
|
|
412
|
+
data: [DONE]
|
|
413
|
+
\`\`\`
|
|
414
|
+
`})]})}},aU=[{label:"Chat UI",value:aP,IconComponent:tK.A},{label:"MCP Server",value:az,IconComponent:t1.Q},{label:"Vercel SDK",value:"sdk",IconComponent:t2},{label:"Node JS",value:aD,IconComponent:tY.A},{label:"REST API",value:"api",IconComponent:tX.A}],aR=({buttonClassName:e})=>{let{tenantId:t,projectId:a}=(0,l.useParams)();return(0,r.jsxs)(t5.Dialog,{children:[(0,r.jsx)(t5.DialogTrigger,{asChild:!0,children:(0,r.jsxs)(f.$,{variant:"outline",className:e,children:[(0,r.jsx)(tQ.A,{className:"size-4"}),"Ship"]})}),(0,r.jsxs)(t5.DialogContent,{className:"max-w-full! w-7xl",position:"top",showCloseButton:!1,onWheel:e=>e.stopPropagation(),onTouchMove:e=>e.stopPropagation(),children:[(0,r.jsxs)(t5.DialogHeader,{children:[(0,r.jsxs)("div",{className:"flex items-center justify-between w-full gap-2",children:[(0,r.jsx)(t5.DialogTitle,{children:"Talk to your agent"}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(f.$,{asChild:!0,variant:"outline",size:"sm",children:(0,r.jsxs)(tc(),{href:`/${t}/projects/${a}/api-keys`,target:"_blank",rel:"noreferrer noopener",children:[(0,r.jsx)(t0.A,{className:"size-4"}),"Create API key"]})}),(0,r.jsx)(t5.HM,{asChild:!0,children:(0,r.jsxs)(f.$,{variant:"ghost",className:"size-8",children:[(0,r.jsx)($.A,{className:"size-4 text-muted-foreground"}),(0,r.jsx)("span",{className:"sr-only",children:"Close"})]})})]})]}),(0,r.jsx)(t5.DialogDescription,{className:"sr-only",children:"Talk to your agent."})]}),(0,r.jsxs)(t3.tU,{defaultValue:aP,className:"min-w-0",children:[(0,r.jsx)(t3.j7,{className:"bg-transparent relative rounded-none border-b p-0 w-full justify-start gap-4",children:aU.map(e=>(0,r.jsxs)(t3.Xi,{variant:"underline",value:e.value,className:"text-sm gap-2",children:[e.IconComponent&&(0,r.jsx)(e.IconComponent,{className:"size-4"}),e.label]},e.value))}),Object.entries(aM).map(([e,t])=>(0,r.jsx)(t3.av,{value:e,className:"py-4",children:(0,r.jsx)(t,{})},e))]})]})]})};function aH({onSubmit:e,toggleSidePane:t,setShowPlayground:a}){let s=(0,ea.ow)(e=>e.dirty),n=(0,d.useRef)(null),i={className:"backdrop-blur-3xl",type:"button",variant:"outline"},o=(0,r.jsxs)(f.$,{...i,disabled:s,onClick:()=>a(!0),children:[(0,r.jsx)(tW.A,{className:"size-4 text-muted-foreground"}),"Try it"]});(0,d.useEffect)(()=>{function e(e){((0,Q.Ue)()?e.metaKey:e.ctrlKey)&&"s"===e.key&&(e.preventDefault(),n.current?.click())}return window.addEventListener("keydown",e),()=>{window.removeEventListener("keydown",e)}},[]);let[l,c]=(0,d.useState)(!1),u=(0,d.useCallback)(async()=>{c(!0),await e(),c(!1)},[e]);return(0,r.jsxs)("div",{className:"flex gap-2 flex-wrap justify-end content-start",children:[(0,r.jsx)(aR,{buttonClassName:i.className}),s?(0,r.jsxs)(e$.Tooltip,{children:[(0,r.jsx)(e$.TooltipTrigger,{asChild:!0,children:(0,r.jsx)("div",{children:o})}),(0,r.jsx)(e$.TooltipContent,{children:s?"Please save your changes before trying the agent.":"Please save the agent to try it."})]}):o,(0,r.jsxs)(f.$,{...i,onClick:u,variant:s?"default":"outline",disabled:l||!s,ref:n,children:[(0,r.jsx)(tG,{className:(0,Q.cn)(!l&&"hidden")}),"Save changes"]}),(0,r.jsxs)(f.$,{...i,onClick:t,children:[(0,r.jsx)(tJ.A,{className:"size-4"}),"Agent Settings"]})]})}let aV=({onSubmit:e})=>{let[t,a]=(0,d.useState)(!1),[s,n]=(0,d.useTransition)(),i=(0,ea.ow)(e=>e.dirty),o=(0,d.useRef)(null),c=(0,d.useRef)(!1),u=(0,l.useRouter)(),m=(0,d.useCallback)(()=>{o.current=null,a(!1)},[]),p=(0,d.useCallback)(()=>{let e=o.current;m(),e&&(c.current=!0,e())},[m]),h=(0,d.useCallback)(()=>{s||n(async()=>{await e()&&p(),a(!1)})},[s,e,p]);return(0,d.useEffect)(()=>{if(!i)return;let e=e=>{if(!i||c.current)return;let t=e.target?.closest("a[href]"),s=t?.href;if(!s||s.startsWith("#")||s.startsWith("javascript:")||s.startsWith("mailto:")||s.startsWith("tel:"))return;let r=new URL(s,location.href);e.preventDefault(),o.current=()=>{r.origin===location.origin?u.push(`${r.pathname}${r.search}${r.hash}`):location.href=r.href},a(!0)};return document.addEventListener("click",e,!0),()=>{document.removeEventListener("click",e,!0)}},[i,u]),(0,d.useEffect)(()=>{if(!i)return void requestAnimationFrame(m);let e=e=>{c.current||(e.preventDefault(),a(!0))};return window.addEventListener("beforeunload",e),()=>{window.removeEventListener("beforeunload",e)}},[i,m]),(0,r.jsx)(t5.Dialog,{open:t,onOpenChange:e=>{e||m()},children:(0,r.jsxs)(t5.DialogContent,{children:[(0,r.jsxs)(t5.DialogHeader,{children:[(0,r.jsx)(t5.DialogTitle,{children:"Unsaved changes"}),(0,r.jsx)(t5.DialogDescription,{children:"You have unsaved changes. Are you sure you want to leave this page and discard your changes?"})]}),(0,r.jsxs)(t5.Es,{children:[(0,r.jsx)(f.$,{variant:"ghost",onClick:m,className:"sm:mr-auto",children:"Go back"}),(0,r.jsx)(f.$,{variant:"secondary",onClick:p,className:"max-sm:order-1",children:"Discard"}),(0,r.jsx)(f.$,{onClick:h,disabled:s,children:s?"Saving...":"Save changes"})]})]})})};var aB=a(28018);class aZ{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(e="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 aF=new aZ;class aq{on(e,t){let a=this.listeners.get(e)??[];return a.push(t),this.listeners.set(e,a),()=>this.off(e,t)}off(e,t){let a=this.listeners.get(e);if(!a)return;let s=a.filter(e=>e!==t);this.listeners.set(e,s)}emit(e,t){let a=this.listeners.get(e);if(a)for(let e of a)e(t)}constructor(){this.listeners=new Map}}let aW=new aq;class aJ{constructor(e){this.name="AddNode",this.node=e}execute(){let{actions:e}=ea.hD.getState();e.setNodes(e=>e.concat(this.node))}undo(){let{actions:e}=ea.hD.getState();e.setNodes(e=>e.filter(e=>e.id!==this.node.id))}}class aG{constructor(e,t){this.name="AddPreparedEdge",this.edge=e,this.deselectOtherEdgesIfA2A=!!t?.deselectOtherEdgesIfA2A}execute(){let{actions:e}=ea.hD.getState();this.edge.type===u.gP.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===u.gP.A2A?e.map(e=>({...e,selected:!1})):e,a=(0,i.rN)(this.edge,t);return aW.emit("edgeConnected",{edgeId:this.edge.id}),a})}undo(){let{actions:e}=ea.hD.getState(),t=this.edge.id;e.setEdges(e=>e.filter(e=>e.id!==t))}}function aK(e){return{id:e?.id,name:e?.name??"",description:e?.description??"",prompt:e?.prompt,models:e?.models?{base:e.models.base?{model:e.models.base.model,providerOptions:(0,Q.S_)(e.models.base.providerOptions)}:void 0,structuredOutput:e.models.structuredOutput?{model:e.models.structuredOutput.model,providerOptions:(0,Q.S_)(e.models.structuredOutput.providerOptions)}:void 0,summarizer:e.models.summarizer?{model:e.models.summarizer.model,providerOptions:(0,Q.S_)(e.models.summarizer.providerOptions)}:void 0}:void 0,stopWhen:e?.stopWhen,statusUpdates:e?.statusUpdates?{...e.statusUpdates,statusComponents:(0,Q.S_)(e.statusUpdates.statusComponents)||""}:void 0,contextConfig:{id:e?.contextConfig?.id??"",contextVariables:(0,Q.S_)(e?.contextConfig?.contextVariables)||"",headersSchema:(0,Q.S_)(e?.contextConfig?.headersSchema)||""}}}var aY=a(20507),aX=a(37064);let aQ=e=>{let t=Error("contextVariables"===e?"Context variables must be valid JSON":"Headers schema must be valid JSON");return t.name="ContextConfigParseError",t.field=e,t};function a0(e){if(e)try{return JSON.parse(e)}catch(e){console.warn("Error parsing JSON:",e);return}}var a1=a(10629);let a2=(0,eJ.createServerReference)("60e17565c7d577719b2a1f05a5f1dae3d2b844a3b8",eJ.callServer,void 0,eJ.findSourceMapURL,"getFullProjectAction"),a5=(0,eJ.createServerReference)("607adf541f702c4e1f35b35999cf91fabe5203dba7",eJ.callServer,void 0,eJ.findSourceMapURL,"fetchToolsAction"),a3=(0,eJ.createServerReference)("7821baa3990f53f20bc847b317ffe952536fcd5e4d",eJ.callServer,void 0,eJ.findSourceMapURL,"updateFullAgentAction"),a4=(0,eJ.createServerReference)("70ce8ff67ed937d1739e8da5abbfe09364477548c9",eJ.callServer,void 0,eJ.findSourceMapURL,"createFullAgentAction");async function a6(e,t,a,s){return s?a3(e,t,s,a):a4(e,t,a)}function a8(e){try{e=e.replace(/^\[\d\d\d]/,"");let t=JSON.parse(e),a=[];for(let e of t)if("invalid_union"===e.code&&e.errors&&e.path)for(let t of e.errors)for(let s of t){let t=a9(s,e.path);t&&a.push(t)}else if(e.path){let t=a9(e,e.path);t&&a.push(t)}return function(e){let t={},a={},s={},r={},n=[];for(let i of e)switch(i.type){case"node":i.nodeId&&("functionTool"===i.nodeType?(a[i.nodeId]||(a[i.nodeId]=[]),a[i.nodeId].push(i)):(t[i.nodeId]||(t[i.nodeId]=[]),t[i.nodeId].push(i)),s[i.nodeId]||(s[i.nodeId]=[]),s[i.nodeId].push(i));break;case"edge":i.edgeId&&(r[i.edgeId]||(r[i.edgeId]=[]),r[i.edgeId].push(i));break;case"agent":n.push(i)}return{totalErrors:e.length,subAgentErrors:t,functionToolErrors:a,nodeErrors:s,edgeErrors:r,agentErrors:n,allErrors:e}}(a)}catch(t){return console.error(t),{totalErrors:1,subAgentErrors:{},functionToolErrors:{},nodeErrors:{},edgeErrors:{},agentErrors:[{type:"agent",field:"unknown",message:"An unknown validation error occurred",fullPath:[],originalError:{code:"unknown",message:e,path:[]}}],allErrors:[]}}}function a9(e,t){let a,s,r,n,i=[...t,...e.path],o="agent";e.functionToolId?(o="node",a="functionTool",s=e.functionToolId,n=e.field||"configuration"):"functionTools"===i[0]&&i[1]?(o="node",a="functionTool",s=i[1],n=e.path.slice(2).join(".")||e.field||"configuration"):"subAgents"===i[0]&&i[1]?(o="node",a="subAgent",s=i[1],n=e.path.slice(2).join(".")||"configuration"):("edges"===i[0]&&i[1]&&(o="edge",r=i[1]),n=e.path.join(".")||"configuration");let l=function(e,t,a,s){var r;let n;n="node"===a?"functionTool"===s?"Function Tool":"Sub Agent":"edge"===a?"Connection":"Agent";let i={instructions:"Instructions",projectId:"Project id",baseUrl:"Host URL",name:"Name",description:"Description",model:"Model",temperature:"Temperature",maxOutputTokens:"Max output 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",headersSchema:"Headers 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`${n} is missing required field: ${i}`;return`${n} ${i} has invalid type. Expected ${e.expected}`;case"too_small":return`${n} ${i} is too short. Please provide a valid value`;case"invalid_enum_value":return`${n} ${i} has an invalid value. Please select a valid option`;case"invalid_union":if(t.includes("type")||e.message.includes("discriminator"))return`${n} type must be specified as either 'internal' or 'external'`;return`${n} configuration is incomplete. Please check all required fields`;default:return`${n} ${i}: ${e.message}`}}(e,n,o,a);return{type:o,nodeType:a,nodeId:s,edgeId:r,field:n,message:l,fullPath:i,originalError:e}}function a7(e){let{totalErrors:t,subAgentErrors:a,functionToolErrors:s,edgeErrors:r,agentErrors:n}=e;if(0===t)return"";let i=[],o=Object.keys(a).length,l=Object.keys(s).length,d=Object.keys(r).length,c=n.length;o>0&&i.push(`${o} sub agent${o>1?"s":""}`),l>0&&i.push(`${l} function tool${l>1?"s":""}`),d>0&&i.push(`${d} connection${d>1?"s":""}`),c>0&&i.push(`${c} agent setting${c>1?"s":""}`);let u=i.join(", ");return`Validation failed for ${u}. Check the highlighted items for details.`}let se=(0,o.default)(()=>Promise.all([a.e(19759),a.e(35232),a.e(78295),a.e(77451),a.e(52939)]).then(a.bind(a,25988)).then(e=>e.Playground),{loadableGenerated:{webpack:()=>[25988]},ssr:!1,loading:()=>(0,r.jsx)(ee,{className:"p-6"})}),st=(0,o.default)(()=>Promise.all([a.e(35232),a.e(57544),a.e(2661),a.e(78295),a.e(84345),a.e(37211),a.e(53067)]).then(a.bind(a,53067)).then(e=>e.CopilotChat),{loadableGenerated:{webpack:()=>[53067]},ssr:!1}),sa=({agent:e,dataComponentLookup:t={},artifactComponentLookup:a={},toolLookup:s={},credentialLookup:o={}})=>{let[h,x]=(0,d.useState)(!1),{isOpen:f,isCopilotConfigured:b,isStreaming:v}=(0,p.F)(),j=(0,l.useRouter)(),{tenantId:y,projectId:N}=(0,l.useParams)(),{nodeId:C,edgeId:k,setQueryState:S,openAgentPane:T,isOpen:w}=H(),A=(0,d.useMemo)(()=>({id:(0,aX.$)(),type:m.Z6.SubAgent,position:{x:0,y:0},data:{name:"",isDefault:!0},deletable:!1}),[]),E=(0,d.useMemo)(()=>[A],[A]),L=(0,d.useCallback)(e=>e.map(e=>{if(e.type===m.Z6.MCP&&e.data&&"toolId"in e.data){let t=s[e.data.toolId];if(t)return{...e,data:{...e.data,name:t.name,imageUrl:t.imageUrl}}}return e}),[s]),{nodes:O,edges:_}=(0,d.useMemo)(()=>{let t=e?(0,aY.bJ)(e):{nodes:E,edges:u.H_};return{...t,nodes:C?L(t.nodes).map(e=>({...e,selected:e.id===C})):L(t.nodes),edges:k?t.edges.map(e=>({...e,selected:e.id===k})):t.edges}},[e,L,E,C,k]),$=(0,d.useCallback)(e=>{if(!e?.subAgents)return{};let t={};return Object.entries(e.subAgents).forEach(([e,a])=>{if("canUse"in a&&a.canUse){let s={};a.canUse.forEach(e=>{if(e.agentToolRelationId){let t={toolId:e.toolId};void 0!==e.toolSelection&&(t.toolSelection=e.toolSelection),e.headers&&(t.headers=e.headers),e.toolPolicies&&(t.toolPolicies=e.toolPolicies),s[e.agentToolRelationId]=t}}),Object.keys(s).length>0&&(t[e]=s)}}),t},[]),P=(0,d.useCallback)(e=>{if(!e?.subAgents)return{};let t={};return Object.entries(e.subAgents).forEach(([e,a])=>{if("canDelegateTo"in a&&a.canDelegateTo){let s={};a.canDelegateTo.filter(e=>"object"==typeof e&&"externalAgentId"in e).forEach(e=>{s[e.externalAgentId]={externalAgentId:e.externalAgentId,headers:e.headers??void 0}}),Object.keys(s).length>0&&(t[e]=s)}}),t},[]),z=(0,d.useMemo)(()=>$(e),[e,$]),D=(0,d.useMemo)(()=>P(e),[e,P]),M=(0,d.useMemo)(()=>{if(!e.subAgents)return{};let t={};return Object.entries(e.subAgents).forEach(([e,a])=>{if("canDelegateTo"in a&&a.canDelegateTo){let s={};a.canDelegateTo.filter(e=>"object"==typeof e&&"agentId"in e).forEach(e=>{s[e.agentId]={agentId:e.agentId,headers:e.headers??void 0}}),Object.keys(s).length>0&&(t[e]=s)}}),t},[e.subAgents]),{screenToFlowPosition:U,updateNodeData:R,fitView:V,getNodes:q,getEdges:W,getIntersectingNodes:J}=(0,n.VH)(),{storeNodes:G,edges:K,metadata:X}=(0,ea.ow)(e=>({storeNodes:e.nodes,edges:e.edges,metadata:e.metadata})),{setNodes:ee,setEdges:et,onNodesChange:er,onEdgesChange:en,setMetadata:ei,setInitial:eo,markSaved:el,clearSelection:ed,markUnsaved:ec,reset:eu,animateGraph:em}=(0,ea.Sm)(),{setProject:ep,reset:eh}=eW(),ex=(0,d.useMemo)(()=>L(G),[G,L]),{errors:eg,showErrors:ef,setErrors:eb,clearErrors:ev,setShowErrors:ej}=(0,es.K)(),ey=(0,d.useCallback)(e=>{er(e);let t=e.filter(e=>"replace"===e.type);t.length&&setTimeout(()=>{let e=q();for(let a of t){let t=e.find(e=>e.id===a.id);if(t&&J(t).length>0)return void ee(e=>(0,aY.ul)(e,W()))}},0)},[q,W,J,ee,er]);(0,d.useEffect)(()=>(eo(O,_,aK(e),t,a,s,z),0!==O.length||b||ew(),()=>{eu(),eh()}),[]),(0,d.useEffect)(()=>{C&&!O.some(e=>e.id===C)&&S(e=>({...e,nodeId:null,pane:"agent"})),k&&!_.some(e=>e.id===k)&&S(e=>({...e,edgeId:null,pane:"agent"}))},[]),(0,d.useEffect)(()=>{if(w)return;let e=setTimeout(()=>{V({maxZoom:1,duration:200})},350);return()=>clearTimeout(e)},[w,V]),(0,d.useEffect)(()=>{let e=setTimeout(()=>{V({maxZoom:1,duration:200})},350);return()=>clearTimeout(e)},[h,f,V]);let eN=(0,d.useCallback)(async t=>{if(e.id)try{let a,s,[r,n]=await Promise.all([a2(y,N),t?.fetchTools?a5(y,N):Promise.resolve(null)]);if(!r.success)return void console.error("Failed to refresh agent graph:",r.error);let i=r.data,o=i?.agents?.[e.id],l=n?.success?(0,Q.BL)(n.data):i.tools||{},{nodes:d,edges:c}=(0,aY.bJ)(o),u=C?d.map(e=>({...e,selected:e.id===C})):d,m=k?c.map(e=>({...e,selected:e.id===k})):c,p=aK(o),h=i.dataComponents||{},x=i.artifactComponents||{},g=i.externalAgents||{},f=$(o),b=P(o);eo(L(u),m,p,h,x,l,f,g,b);let v=(a=i.models?.base?{base:i.models.base,...i.models.structuredOutput&&{structuredOutput:i.models.structuredOutput},...i.models.summarizer&&{summarizer:i.models.summarizer}}:{base:{model:"",providerOptions:void 0}},s=i.stopWhen||void 0,{id:i.id,projectId:i.id,tenantId:y,name:i.name,description:i.description||"",models:a,stopWhen:s,createdAt:i.createdAt||new Date().toISOString(),updatedAt:i.updatedAt||new Date().toISOString()});ep(v)}catch(e){console.error("Failed to refresh agent graph:",e)}},[e.id,y,N,C,k,eo,$,P,L,ep]),eC=(0,d.useCallback)(e=>{ec();let t=e.source===e.target,a={id:t?`edge-self-${e.source}`:function(e,t){let[a,s]=[e,t].sort();return`edge-${a}-${s}`}(e.source,e.target),...e},{sourceHandle:s,targetHandle:r}=e;if(t?a={...a,type:u.gP.SelfLoop,selected:!0,data:{relationships:{transferTargetToSource:!1,transferSourceToTarget:!0,delegateTargetToSource:!1,delegateSourceToTarget:!1}}}:(s===m.Ow||s===m.Y1)&&(r===m.Y1||r===m.Ow)?a={...a,type:u.gP.A2A,selected:!0,data:{relationships:{transferTargetToSource:!1,transferSourceToTarget:!1,delegateTargetToSource:!1,delegateSourceToTarget:!0}}}:(s===m.Ow||s===m.Y1)&&r===m.Rm?a={...a,type:u.gP.A2AExternal,data:{relationships:{transferTargetToSource:!1,transferSourceToTarget:!1,delegateTargetToSource:!1,delegateSourceToTarget:!0}}}:(s===m.Ow||s===m.Y1)&&r===m.ju&&(a={...a,type:u.gP.A2ATeam,selected:!0,data:{relationships:{transferTargetToSource:!1,transferSourceToTarget:!1,delegateTargetToSource:!1,delegateSourceToTarget:!0}}}),r===m.y8&&(s===m.Ow||s===m.Y1)){let t=ex.find(t=>t.id===e.target);if(t&&t.type===m.Z6.MCP){let a=e.source;R(t.id,{...t.data,subAgentId:a,relationshipId:null})}}requestAnimationFrame(()=>{aF.execute(new aG(a,{deselectOtherEdgesIfA2A:!0}))})},[]),ek=(0,d.useCallback)(({sourceHandle:e,targetHandle:t})=>e!==m.y8||t!==m.y8,[]),eS=(0,d.useCallback)(e=>{e.preventDefault(),e.dataTransfer.dropEffect="move"},[]),eT=(0,d.useCallback)(e=>{e.preventDefault();let t=e.dataTransfer.getData("application/reactflow");if(!t)return;let a=JSON.parse(t),s=U({x:e.clientX,y:e.clientY}),r={id:(0,aX.$)(),type:a.type,position:s,selected:!0,data:{...m.HO[a.type]}};ed(),aF.execute(new aJ(r))},[U,ed]),ew=(0,d.useCallback)(()=>{let e={...A,selected:!0};ed(),ec(),aF.execute(new aJ(e)),setTimeout(()=>{V({maxZoom:1,duration:200,nodes:[e]})},350)},[ed,A,V,ec]),eA=(0,d.useCallback)(({nodes:e,edges:t})=>{let a=1===e.length?e[0]:null,s=1===t.length&&(t[0]?.type===u.gP.A2A||t[0]?.type===u.gP.SelfLoop)?t[0]:null,r=w?"agent":null;S({pane:a?"node":s?"edge":r,nodeId:a?a.id:null,edgeId:s?s.id:null},{history:"replace"})},[S,w]);(0,n.p4)({onChange:eA}),function(){let{undo:e,redo:t,deleteSelected:a}=(0,ea.Sm)(),s=(0,d.useCallback)(s=>{if(s.target?.classList.contains("react-flow__node")){if((s.metaKey||s.ctrlKey)&&"z"===s.key.toLowerCase()){s.preventDefault(),s.shiftKey?t():e();return}if("Delete"===s.key||"Backspace"===s.key){let e=s.target;e&&("INPUT"===e.tagName||"TEXTAREA"===e.tagName||e.isContentEditable)||(s.preventDefault(),a())}}},[e,t,a]);(0,d.useEffect)(()=>(window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)),[s])}();let eE=(0,d.useCallback)(()=>{et(e=>e.map(e=>({...e,selected:!1}))),ee(e=>e.map(e=>({...e,selected:!1}))),S({pane:null,nodeId:null,edgeId:null})},[S,et,ee]),eI=(0,d.useCallback)(()=>{et(e=>e.map(e=>({...e,selected:!1}))),ee(e=>e.map(e=>({...e,selected:!1}))),S({pane:"agent",nodeId:null,edgeId:null})},[S,et,ee]),eL=(0,d.useCallback)(e=>{let t=ex.find(t=>t.id===e||t.data?.id===e);t&&(ee(e=>e.map(e=>({...e,selected:e.id===t.id}))),et(e=>e.map(e=>({...e,selected:!1}))),S({pane:"node",nodeId:t.id,edgeId:null}))},[ee,et,ex,S]),eO=(0,d.useCallback)(e=>{let t=K.find(t=>t.id===e);t&&(et(e=>e.map(e=>({...e,selected:e.id===t.id}))),ee(e=>e.map(e=>({...e,selected:!1}))),S({pane:"edge",nodeId:null,edgeId:t.id}))},[et,ee,K,S]),e_=(0,d.useCallback)(async()=>{let r,n=(0,tk.Pp)(ex,z,s);n&&c.oR.warning(n,{closeButton:!0,duration:6e3});try{r=function(e,t,a,s,r,n,i,o){let l={},d={},c={},p={},h={},x=new Set,g=new Set,f="";for(let a of e)if(a.type===m.Z6.SubAgent){let s=a.data.id??a.id,r=a.data.dataComponents||[],i=a.data.artifactComponents||[];r.forEach(e=>{x.add(e)}),i.forEach(e=>{g.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:a0(e.base.providerOptions)}:void 0,structuredOutput:e.structuredOutput?{model:e.structuredOutput.model,providerOptions:a0(e.structuredOutput.providerOptions)}:void 0,summarizer:e.summarizer?{model:e.summarizer.model,providerOptions:a0(e.summarizer.providerOptions)}:void 0}}(a.data.models),d=a.data.stopWhen,c=[];for(let r of t.filter(t=>t.source===a.id&&e.some(e=>e.id===t.target&&e.type===m.Z6.MCP))){let t=e.find(e=>e.id===r.target);if(t&&t.type===m.Z6.MCP){let e=t.data.toolId;if(e){let a=t.data.tempSelectedTools,r=null,i=t.data.relationshipId;if(void 0!==a)Array.isArray(a)?r=a:null===a&&(r=null);else{let e=i?n?.[s]?.[i]:null;r=e?.toolSelection?e.toolSelection:null}let o=t.data.tempHeaders,l=null;if(void 0!==o)"object"!=typeof o||null===o||Array.isArray(o)||(l=o);else{let e=i?n?.[s]?.[i]:null;e?.headers&&(l=e.headers)}let d=t.data.tempToolPolicies,u=null;if(void 0!==d)"object"!=typeof d||null===d||Array.isArray(d)||(u=d);else{let e=i?n?.[s]?.[i]:null;e?.toolPolicies&&(u=e.toolPolicies)}c.push({toolId:e,toolSelection:r,headers:l,toolPolicies:u,...i&&{agentToolRelationId:i}})}}}for(let s of t.filter(t=>t.source===a.id&&e.some(e=>e.id===t.target&&e.type===m.Z6.FunctionTool))){let t=e.find(e=>e.id===s.target);if(t&&t.type===m.Z6.FunctionTool){let e=t.data,a=e.functionToolId||e.toolId||t.id,s=e.relationshipId,r=e.functionId||a,n={id:a,name:e.name||"",description:e.description||"",functionId:r},i={id:r,name:e.name||"",description:e.description||"",executeCode:e.code||"",inputSchema:e.inputSchema||{},dependencies:e.dependencies||{}};h[r]=i,p[a]=n,c.push({toolId:a,toolSelection:null,headers:null,...s&&{agentToolRelationId:s}})}}let u={id:s,name:a.data.name,description:a.data.description||"",prompt:a.data.prompt,canUse:c,canTransferTo:[],canDelegateTo:[],dataComponents:r,artifactComponents:i,...o&&{models:o},type:"internal",...d&&{stopWhen:d}};a.data.isDefault&&(f=s),l[s]=u}else if(a.type===m.Z6.ExternalAgent){let e=a.data.id||a.id,t={id:e,name:a.data.name,description:a.data.description||"",baseUrl:a.data.baseUrl,createdAt:a.data.createdAt,updatedAt:a.data.updatedAt,credentialReferenceId:a.data.credentialReferenceId||null,tempHeaders:a.data.tempHeaders||null,relationshipId:a.data.relationshipId||null};d[e]=t}else if(a.type===m.Z6.TeamAgent){let e=a.data.id||a.id,t={id:e,name:a.data.name,description:a.data.description||"",tempHeaders:a.data.tempHeaders||null,relationshipId:a.data.relationshipId||null};c[e]=t}let b={},v={},j={},y={};for(let a of(Object.entries(l).forEach(([e,t])=>{t.canDelegateTo&&t.canDelegateTo.forEach(t=>{"object"==typeof t&&("externalAgentId"in t?(b[e]||(b[e]={}),t.subAgentExternalAgentRelationId&&(b[e][t.subAgentExternalAgentRelationId]=t)):"agentId"in t&&(j[e]||(j[e]={}),t.subAgentTeamAgentRelationId&&(j[e][t.subAgentTeamAgentRelationId]=t)))})}),t))if(a.type===u.gP.A2A||a.type===u.gP.A2AExternal||a.type===u.gP.A2ATeam||a.type===u.gP.SelfLoop){let t=e.find(e=>e.id===a.source),s=e.find(e=>e.id===a.target),r=t?.data.id||t?.id,n=s?.data.id||s?.id,u=l[r],m=l[n],p=d[n],h=c[n],x=void 0!==p,g=void 0!==h;if(!u||!a.data?.relationships)continue;let f=a.data.relationships,N=(e,t,a,s=!1,r=!1,n,i)=>{if("canDelegateTo"===t)if(e.canDelegateTo||(e.canDelegateTo=[]),s){let t={externalAgentId:a,headers:n??null};i&&(t.subAgentExternalAgentRelationId=i),i?(b[e.id]||(b[e.id]={}),b[e.id][i]=t):(v[e.id]||(v[e.id]={}),v[e.id]=t)}else if(r){let t={agentId:a,headers:n??null};i&&(t.subAgentTeamAgentRelationId=i),i?(j[e.id]||(j[e.id]={}),j[e.id][i]=t):(y[e.id]||(y[e.id]={}),y[e.id]=t)}else e.canDelegateTo.includes(a)||e.canDelegateTo.push(a);else e.canTransferTo||(e.canTransferTo=[]),e.canTransferTo.includes(a)||e.canTransferTo.push(a)};if(x){if(f.delegateSourceToTarget){let e,t=p.tempHeaders,a=p.relationshipId;if(void 0!==t)"object"!=typeof t||null===t||Array.isArray(t)||(e=t);else{let t=a?i?.[r]?.[a]:null;t?.headers&&(e=t.headers)}N(u,"canDelegateTo",n,!0,!1,e,a)}continue}if(g){if(f.delegateSourceToTarget){let e,t=s.data?.tempHeaders,a=s.data?.relationshipId;if(void 0!==t)"object"!=typeof t||null===t||Array.isArray(t)||(e=t);else{let t=a?o?.[r]?.[a]:null;t?.headers&&(e=t.headers)}N(u,"canDelegateTo",n,!1,!0,e,a)}continue}m&&(f.transferSourceToTarget&&N(u,"canTransferTo",n),f.transferTargetToSource&&N(m,"canTransferTo",r),f.delegateSourceToTarget&&N(u,"canDelegateTo",n),f.delegateTargetToSource&&N(m,"canDelegateTo",r))}let N=a?.contextConfig?.contextVariables?.trim(),C=a0(N);if(N&&!C)throw aQ("contextVariables");let k=a?.contextConfig?.headersSchema?.trim(),S=a0(k);if(k&&!S)throw aQ("headersSchema");let T=!!(C&&"object"==typeof C&&Object.keys(C).length)||!!(S&&"object"==typeof S&&Object.keys(S).length),w={};s&&x.forEach(e=>{let t=s[e];t&&(w[e]=t)});let A={};r&&g.forEach(e=>{let t=r[e];t&&(A[e]=t)});let E={id:a?.id||(0,aX.$)(),name:a?.name??"",description:a?.description||void 0,defaultSubAgentId:f,subAgents:l,...Object.keys(p).length>0&&{functionTools:p},...Object.keys(h).length>0&&{functions:h}};if(a?.models&&(E.models={base:a.models.base?{model:a.models.base.model,providerOptions:a0(a.models.base.providerOptions)}:void 0,structuredOutput:a.models.structuredOutput?{model:a.models.structuredOutput.model,providerOptions:a0(a.models.structuredOutput.providerOptions)}:void 0,summarizer:a.models.summarizer?{model:a.models.summarizer.model,providerOptions:a0(a.models.summarizer.providerOptions)}:void 0}),a?.stopWhen&&(E.stopWhen=a.stopWhen),a&&(E.prompt=a.prompt),a?.statusUpdates){let e=a0(a.statusUpdates.statusComponents);E.statusUpdates={...a.statusUpdates,statusComponents:e}}if(T&&a?.contextConfig){let e=a.contextConfig.id||(0,aX.$)();E.contextConfigId=e,E.contextConfig={id:e,headersSchema:S,contextVariables:C}}return Object.entries(l).forEach(([e,t])=>{if(t.canDelegateTo){let a=t.canDelegateTo.filter(e=>"string"==typeof e),s=Object.values(b[e]||{});t.canDelegateTo=[...a,...s,...Object.values(j[e]||{})],v[e]&&t.canDelegateTo.push(v[e]),y[e]&&t.canDelegateTo.push(y[e])}}),E}(ex,K,X,t,a,z,D,M)}catch(e){if(e&&"object"==typeof e&&"ContextConfigParseError"===e.name&&"string"==typeof e.field){let t=a8(JSON.stringify([{message:e.message,field:e.field,code:"invalid_json",path:[e.field]}]));eb(t);let a=a7(t);return c.oR.error(a),!1}throw e}let i=new Map;ex.forEach(e=>{if(e.type===m.Z6.FunctionTool){let t=e.data,a=t.toolId||t.functionToolId||e.id;i.set(a,e.id)}});let o=function(e,t){let a=[];for(let[s,r]of(e.defaultSubAgentId||a.push({message:"Default sub agent ID is required, please select a default sub agent.",field:"defaultSubAgentId",code:"required",path:["defaultSubAgentId"]}),e.defaultSubAgentId&&!e.subAgents[e.defaultSubAgentId]&&a.push({message:`Default sub agent ID '${e.defaultSubAgentId}' not found in sub agents.`,field:"defaultSubAgentId",code:"invalid_reference",path:["defaultSubAgentId"]}),Object.entries(e.subAgents))){if(r.canUse){let t=e.tools;if(t)for(let e of r.canUse){let r=e.toolId;t[r]||a.push({message:`Tool '${r}' not found.`,field:"toolId",code:"invalid_reference",path:["agents",s,"canUse"]})}}if(r.canUse)for(let e of r.canUse){let s=e.toolId;if("function"===e.toolType){let r=e.functionTool;if(!r){let e=t?.get(s)||s;a.push({message:"Function tool is missing function tool data",field:"functionTool",code:"missing_data",path:["functionTools",s],functionToolId:e});continue}let n=t?.get(s)||s;r.name&&""!==String(r.name).trim()||a.push({message:"Function tool name is required",field:"name",code:"required",path:["functionTools",s,"name"],functionToolId:n}),r.description&&""!==String(r.description).trim()||a.push({message:"Function tool description is required",field:"description",code:"required",path:["functionTools",s,"description"],functionToolId:n}),r.executeCode&&""!==String(r.executeCode).trim()||a.push({message:"Function tool code is required",field:"code",code:"required",path:["functionTools",s,"executeCode"],functionToolId:n}),r.inputSchema&&0!==Object.keys(r.inputSchema).length||a.push({message:"Function tool input schema is required",field:"inputSchema",code:"required",path:["functionTools",s,"inputSchema"],functionToolId:n})}}for(let t of r.canTransferTo??[])e.subAgents[t]||a.push({message:`Transfer target '${t}' not found in agents.`,field:"canTransferTo",code:"invalid_reference",path:["agents",s,"canTransferTo"]});for(let t of r.canDelegateTo??[])"string"!=typeof t||e.subAgents[t]||a.push({message:`Delegate target '${t}' not found in agents.`,field:"canDelegateTo",code:"invalid_reference",path:["agents",s,"canDelegateTo"]})}return a}(r,i);if(o.length>0)return eb(a8(JSON.stringify(o.map(e=>({message:e.message,field:e.field,code:e.code,path:e.path,functionToolId:e.functionToolId}))))),c.oR.error(`Validation failed: ${o[0].message}`),!1;let l=await a6(y,N,r,e.id);if(l.success){if(ev(),c.oR.success("Agent saved",{closeButton:!0}),el(),l.data){let e=new Set;ee(t=>t.map(t=>{if(t.type===m.Z6.MCP&&t.data.subAgentId&&t.data.toolId){if(t.data.relationshipId)return t;let a=t.data.subAgentId,s=t.data.toolId;if("canUse"in l.data.subAgents[a]&&l.data.subAgents[a].canUse){let r=l.data.subAgents[a].canUse.find(t=>t.toolId===s&&t.agentToolRelationId&&!e.has(t.agentToolRelationId));if(r?.agentToolRelationId)return e.add(r.agentToolRelationId),{...t,data:{...t.data,relationshipId:r.agentToolRelationId}}}}return t}))}return!e.id&&l.data?.id&&(ei("id",l.data.id),j.push(`/${y}/projects/${N}/agents/${l.data.id}`)),!0}if(l.code&&["forbidden","unauthorized","not_found","internal_server_error","bad_request"].includes(l.code))return c.oR.error(l.error||"An error occurred while saving the agent",{closeButton:!0}),!1;try{let e=a8(l.error);eb(e);let t=a7(e);c.oR.error(t||"Failed to save agent - validation errors found.")}catch(e){console.error("Failed to parse validation errors:",e),c.oR.error("Failed to save agent",{closeButton:!0})}return!1},[ex,K,X,t,a,el,ei,ee,j,e.id,y,N,ev,eb,z,s,D,M]);(0,d.useEffect)(()=>{let e=()=>{em({detail:{type:"completion"}})};return document.addEventListener("ikp-data-operation",em),document.addEventListener("ikp-aborted",e),()=>{document.removeEventListener("ikp-data-operation",em),document.removeEventListener("ikp-aborted",e)}},[]);let e$=(0,d.useCallback)((e,t)=>{w||setTimeout(()=>{V({maxZoom:1,duration:200,nodes:[t]})},350)},[V,w]),[eP,ez]=(0,d.useState)(!1),eD=(0,a1.a)(),eM=(0,d.useMemo)(()=>0===ex.length&&0===O.length&&b,[ex,O,b]);return(0,r.jsxs)(aB.HK,{id:"agent-panel-group",direction:"horizontal",autoSaveId:"agent-resizable-layout-state",className:"w-full h-full relative bg-muted/20 dark:bg-background flex rounded-b-[14px] overflow-hidden",children:[(0,r.jsx)(st,{agentId:e.id,projectId:N,tenantId:y,refreshAgentGraph:eN}),(0,r.jsxs)(aB.wV,{id:"react-flow-pane",order:1,minSize:30,defaultSize:100,className:"relative",children:[v&&(0,r.jsx)(g,{}),(0,r.jsx)(Z,{}),(0,r.jsx)(F,{}),(0,r.jsxs)(n.Gc,{defaultEdgeOptions:{type:"custom"},nodeTypes:m.c_,edgeTypes:u.nd,nodes:ex,edges:K,onNodesChange:ey,onEdgesChange:en,onConnect:eC,onDrop:eT,onDragOver:eS,fitView:!0,snapToGrid:!0,snapGrid:[20,20],fitViewOptions:{maxZoom:1},minZoom:.3,connectionMode:i.WZ.Loose,isValidConnection:ek,onNodeClick:e$,children:[(0,r.jsx)(n.VS,{color:"#a8a29e",gap:20}),(0,r.jsx)(n.H2,{className:"text-foreground",showInteractive:!1}),!eM&&(0,r.jsx)(n.Zk,{position:"top-left",children:(0,r.jsx)(Y,{})}),eM&&(0,r.jsx)(n.Zk,{position:"top-center",className:"top-1/2! translate-y-[-50%]",children:(0,r.jsx)(I,{onAddInitialNode:ew})}),!eM&&(0,r.jsx)(n.Zk,{position:"top-right",className:"left-40",children:(0,r.jsx)(aH,{onSubmit:e_,toggleSidePane:w?eI:T,setShowPlayground:()=>{eE(),x(!0)}})}),eg&&ef&&(0,r.jsx)(n.Zk,{position:"bottom-left",className:"max-w-sm !left-8 mb-4",children:(0,r.jsx)(B,{errorSummary:eg,onClose:()=>ej(!1),onNavigateToNode:eL,onNavigateToEdge:eO})})]})]}),w&&eD&&!eM&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(aB.WM,{withHandle:!0}),(0,r.jsx)(aB.wV,{minSize:30,id:"side-pane",order:2,children:(0,r.jsx)(tq,{selectedNodeId:C,selectedEdgeId:k,onClose:eE,backToAgent:eI,dataComponentLookup:t,artifactComponentLookup:a,agentToolConfigLookup:z,subAgentExternalAgentConfigLookup:D,subAgentTeamAgentConfigLookup:M,credentialLookup:o,disabled:v})})]}),h&&e.id&&(0,r.jsxs)(r.Fragment,{children:[!eP&&(0,r.jsx)(aB.WM,{withHandle:!0}),(0,r.jsx)(aB.wV,{minSize:25,id:"playground-pane",order:3,className:eP?"w-full flex-none!":"",children:(0,r.jsx)(se,{agentId:e.id,projectId:N,tenantId:y,setShowPlayground:x,closeSidePane:eE,dataComponentLookup:t,showTraces:eP,setShowTraces:ez})})]}),(0,r.jsx)(aV,{onSubmit:e_})]})}}},e=>{e.O(0,[25710,76213,19705,55240,15416,2072,33538,17665,73160,37431,21933,65686,83059,65449,36731,83348,52238,50925,24434,6920,82635,61729,8918,94967,50694,42700,90663,50467,32565,87353,41166,77358],()=>e(e.s=86576)),_N_E=e.O()}]);
|