nodal-agents 0.4.3 → 0.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/README.md +8 -4
  2. package/package.json +1 -1
  3. package/runner.js +157 -51
  4. package/web/.next/BUILD_ID +1 -1
  5. package/web/.next/app-path-routes-manifest.json +1 -1
  6. package/web/.next/build-manifest.json +2 -2
  7. package/web/.next/prerender-manifest.json +3 -3
  8. package/web/.next/server/app/(dashboard)/agents/[id]/edit/page.js +3 -3
  9. package/web/.next/server/app/(dashboard)/agents/[id]/edit/page.js.nft.json +1 -1
  10. package/web/.next/server/app/(dashboard)/agents/[id]/edit/page_client-reference-manifest.js +1 -1
  11. package/web/.next/server/app/(dashboard)/agents/[id]/telegram/page.js +2 -2
  12. package/web/.next/server/app/(dashboard)/agents/[id]/telegram/page_client-reference-manifest.js +1 -1
  13. package/web/.next/server/app/(dashboard)/agents/page.js +2 -2
  14. package/web/.next/server/app/(dashboard)/agents/page_client-reference-manifest.js +1 -1
  15. package/web/.next/server/app/(dashboard)/approvals/page.js +2 -2
  16. package/web/.next/server/app/(dashboard)/approvals/page.js.nft.json +1 -1
  17. package/web/.next/server/app/(dashboard)/approvals/page_client-reference-manifest.js +1 -1
  18. package/web/.next/server/app/(dashboard)/automations/page.js +2 -2
  19. package/web/.next/server/app/(dashboard)/automations/page_client-reference-manifest.js +1 -1
  20. package/web/.next/server/app/(dashboard)/billing/page.js +2 -2
  21. package/web/.next/server/app/(dashboard)/billing/page_client-reference-manifest.js +1 -1
  22. package/web/.next/server/app/(dashboard)/chat/page.js +1 -1
  23. package/web/.next/server/app/(dashboard)/chat/page_client-reference-manifest.js +1 -1
  24. package/web/.next/server/app/(dashboard)/connectors/page.js +1 -1
  25. package/web/.next/server/app/(dashboard)/connectors/page.js.nft.json +1 -1
  26. package/web/.next/server/app/(dashboard)/connectors/page_client-reference-manifest.js +1 -1
  27. package/web/.next/server/app/(dashboard)/credentials/page.js +1 -1
  28. package/web/.next/server/app/(dashboard)/credentials/page.js.nft.json +1 -1
  29. package/web/.next/server/app/(dashboard)/credentials/page_client-reference-manifest.js +1 -1
  30. package/web/.next/server/app/(dashboard)/jobs/[id]/page.js +2 -2
  31. package/web/.next/server/app/(dashboard)/jobs/[id]/page_client-reference-manifest.js +1 -1
  32. package/web/.next/server/app/(dashboard)/jobs/page.js +2 -2
  33. package/web/.next/server/app/(dashboard)/jobs/page.js.nft.json +1 -1
  34. package/web/.next/server/app/(dashboard)/jobs/page_client-reference-manifest.js +1 -1
  35. package/web/.next/server/app/(dashboard)/llm-providers/page.js +2 -2
  36. package/web/.next/server/app/(dashboard)/llm-providers/page_client-reference-manifest.js +1 -1
  37. package/web/.next/server/app/(dashboard)/logs/page.js +2 -2
  38. package/web/.next/server/app/(dashboard)/logs/page_client-reference-manifest.js +1 -1
  39. package/web/.next/server/app/(dashboard)/mcp/page.js +1 -1
  40. package/web/.next/server/app/(dashboard)/mcp/page_client-reference-manifest.js +1 -1
  41. package/web/.next/server/app/(dashboard)/memories/page.js +2 -2
  42. package/web/.next/server/app/(dashboard)/memories/page_client-reference-manifest.js +1 -1
  43. package/web/.next/server/app/(dashboard)/page.js +3 -3
  44. package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
  45. package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  46. package/web/.next/server/app/(dashboard)/settings/page.js +1 -1
  47. package/web/.next/server/app/(dashboard)/settings/page_client-reference-manifest.js +1 -1
  48. package/web/.next/server/app/(dashboard)/skills/[id]/edit/page.js +1 -1
  49. package/web/.next/server/app/(dashboard)/skills/[id]/edit/page.js.nft.json +1 -1
  50. package/web/.next/server/app/(dashboard)/skills/[id]/edit/page_client-reference-manifest.js +1 -1
  51. package/web/.next/server/app/(dashboard)/skills/new/page.js +2 -2
  52. package/web/.next/server/app/(dashboard)/skills/new/page.js.nft.json +1 -1
  53. package/web/.next/server/app/(dashboard)/skills/new/page_client-reference-manifest.js +1 -1
  54. package/web/.next/server/app/(dashboard)/skills/page.js +1 -1
  55. package/web/.next/server/app/(dashboard)/skills/page_client-reference-manifest.js +1 -1
  56. package/web/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  57. package/web/.next/server/app/_global-error.html +1 -1
  58. package/web/.next/server/app/_global-error.rsc +2 -2
  59. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +2 -2
  60. package/web/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  61. package/web/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  62. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  63. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +2 -2
  64. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  65. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  66. package/web/.next/server/app/_not-found.html +1 -1
  67. package/web/.next/server/app/_not-found.rsc +2 -2
  68. package/web/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  69. package/web/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  70. package/web/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
  71. package/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  72. package/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  73. package/web/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  74. package/web/.next/server/app/api/oauth/[provider]/callback/route.js +1 -1
  75. package/web/.next/server/app/login/page_client-reference-manifest.js +1 -1
  76. package/web/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  77. package/web/.next/server/app/onboarding.html +1 -1
  78. package/web/.next/server/app/onboarding.rsc +2 -2
  79. package/web/.next/server/app/onboarding.segments/_full.segment.rsc +2 -2
  80. package/web/.next/server/app/onboarding.segments/_head.segment.rsc +1 -1
  81. package/web/.next/server/app/onboarding.segments/_index.segment.rsc +2 -2
  82. package/web/.next/server/app/onboarding.segments/_tree.segment.rsc +1 -1
  83. package/web/.next/server/app/onboarding.segments/onboarding/__PAGE__.segment.rsc +1 -1
  84. package/web/.next/server/app/onboarding.segments/onboarding.segment.rsc +1 -1
  85. package/web/.next/server/app-paths-manifest.json +1 -1
  86. package/web/.next/server/chunks/3233.js +1 -1
  87. package/web/.next/server/chunks/{8766.js → 3889.js} +1 -1
  88. package/web/.next/server/chunks/5329.js +1 -0
  89. package/web/.next/server/chunks/593.js +1 -0
  90. package/web/.next/server/chunks/7231.js +1 -0
  91. package/web/.next/server/chunks/7741.js +1 -1
  92. package/web/.next/server/middleware-build-manifest.js +1 -1
  93. package/web/.next/server/pages/404.html +1 -1
  94. package/web/.next/server/pages/500.html +1 -1
  95. package/web/.next/server/server-reference-manifest.js +1 -1
  96. package/web/.next/server/server-reference-manifest.json +1 -1
  97. package/web/.next/static/chunks/{9123-5c5ad180c831baa4.js → 9123-67530ba510c58003.js} +1 -1
  98. package/web/.next/static/chunks/app/(dashboard)/agents/[id]/edit/page-a2c267f563cd1a70.js +2 -0
  99. package/web/.next/static/chunks/app/(dashboard)/agents/[id]/telegram/page-2d7cae43f5e6952a.js +1 -0
  100. package/web/.next/static/chunks/app/(dashboard)/agents/{page-50005050a3304bee.js → page-bed833ebdd3646fb.js} +1 -1
  101. package/web/.next/static/chunks/app/(dashboard)/approvals/{page-7f4314908d1024f6.js → page-4b27762472802ce0.js} +1 -1
  102. package/web/.next/static/chunks/app/(dashboard)/automations/page-9e5d2ce807ce1c37.js +1 -0
  103. package/web/.next/static/chunks/app/(dashboard)/chat/page-8f81d7e3abb475a6.js +1 -0
  104. package/web/.next/static/chunks/app/(dashboard)/connectors/{page-a6a1d8f0a33d2faf.js → page-39b1d9560235d574.js} +1 -1
  105. package/web/.next/static/chunks/app/(dashboard)/jobs/[id]/page-112bb22a9ec43be0.js +1 -0
  106. package/web/.next/static/chunks/app/(dashboard)/jobs/page-44351170ed5f9180.js +1 -0
  107. package/web/.next/static/chunks/app/(dashboard)/{layout-769de8a52528194a.js → layout-53e69de869cba0d0.js} +1 -1
  108. package/web/.next/static/chunks/app/(dashboard)/llm-providers/page-8f6ce47ba228e38b.js +1 -0
  109. package/web/.next/static/chunks/app/(dashboard)/mcp/page-cdf057e468c6e92e.js +1 -0
  110. package/web/.next/static/chunks/app/(dashboard)/memories/{page-e201633b4bbbdf73.js → page-e706ab4aa681fa99.js} +1 -1
  111. package/web/.next/static/chunks/app/(dashboard)/{page-a42d880f7036e866.js → page-29cfae3bf701076e.js} +1 -1
  112. package/web/.next/static/chunks/app/(dashboard)/settings/page-312ae27ae71ea6d1.js +1 -0
  113. package/web/.next/static/chunks/app/(dashboard)/skills/[id]/edit/{page-ecaf3520da303237.js → page-89a8a30db5eb96e1.js} +1 -1
  114. package/web/.next/static/chunks/app/(dashboard)/skills/new/{page-cdbc2aada2be0bfc.js → page-46a424b203591560.js} +1 -1
  115. package/web/.next/static/chunks/app/(dashboard)/skills/{page-234553540bef945b.js → page-edad7bbd3230fb7a.js} +1 -1
  116. package/web/.next/server/chunks/8052.js +0 -1
  117. package/web/.next/server/chunks/8782.js +0 -1
  118. package/web/.next/server/chunks/9084.js +0 -1
  119. package/web/.next/static/chunks/app/(dashboard)/agents/[id]/edit/page-de6c8fc7cb73a3de.js +0 -2
  120. package/web/.next/static/chunks/app/(dashboard)/agents/[id]/telegram/page-6d4161f1e0b19885.js +0 -1
  121. package/web/.next/static/chunks/app/(dashboard)/automations/page-7693601b49363371.js +0 -1
  122. package/web/.next/static/chunks/app/(dashboard)/chat/page-839128f211f63728.js +0 -1
  123. package/web/.next/static/chunks/app/(dashboard)/jobs/[id]/page-4fc570c6c1e39edb.js +0 -1
  124. package/web/.next/static/chunks/app/(dashboard)/jobs/page-cf861b235dc54ced.js +0 -1
  125. package/web/.next/static/chunks/app/(dashboard)/llm-providers/page-99eab754716f9071.js +0 -1
  126. package/web/.next/static/chunks/app/(dashboard)/mcp/page-082442b4f9ac0f91.js +0 -1
  127. package/web/.next/static/chunks/app/(dashboard)/settings/page-d85cac3728506241.js +0 -1
  128. /package/web/.next/static/{n6jP_zB4kqJScKY_T2ciu → PV5qpGylrVW3jZ7zKHuhE}/_buildManifest.js +0 -0
  129. /package/web/.next/static/{n6jP_zB4kqJScKY_T2ciu → PV5qpGylrVW3jZ7zKHuhE}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9527],{5977:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var n=a(78604);let r=n.forwardRef((e,t)=>{let{alt:a,color:r="currentColor",size:l="1em",weight:s="regular",mirrored:i=!1,children:o,weights:c,...d}=e;return n.createElement("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:l,height:l,fill:r,viewBox:"0 0 256 256",transform:i?"scale(-1, 1)":void 0,...d},!!a&&n.createElement("title",null,a),o,c.get(s))});r.displayName="SSRBase"},21021:(e,t,a)=>{"use strict";a.d(t,{a:()=>n,d:()=>l});let n={gmail:"#ea4335","google-drive":"#4285f4","google-sheets":"#0f9d58","google-docs":"#4285f4","google-calendar":"#4285f4",notion:"#000000","notion-oauth":"#000000",airtable:"#f82b60","airtable-oauth":"#f82b60",github:"#24292f",linear:"#5e6ad2",hubspot:"#ff7a59",slack:"#4a154b",intercom:"#1f8ced",stripe:"#635bff",postgres:"#336791",apify:"#00aeff",firecrawl:"#f97316",tavily:"#6366f1",composio:"#000000"},r={gmail:"Gm","google-drive":"GD","google-sheets":"GS","google-docs":"GD","google-calendar":"GC",notion:"No","notion-oauth":"No",airtable:"At","airtable-oauth":"At",github:"Gh",linear:"Li",hubspot:"HS",slack:"Sl",intercom:"IC",stripe:"St",postgres:"PG",apify:"Ap",firecrawl:"FC",tavily:"Tv",composio:"Co","custom-http-mcp":"+","custom-stdio-mcp":"+","cogni-cortex":"CX"};function l(e,t){return r[e]??t.slice(0,2).toUpperCase()}},22089:(e,t,a)=>{"use strict";a.d(t,{N:()=>i});var n=a(78604),r=a(5977);let l=new Map([["bold",n.createElement(n.Fragment,null,n.createElement("path",{d:"M240.26,186.1,152.81,34.23h0a28.74,28.74,0,0,0-49.62,0L15.74,186.1a27.45,27.45,0,0,0,0,27.71A28.31,28.31,0,0,0,40.55,228h174.9a28.31,28.31,0,0,0,24.79-14.19A27.45,27.45,0,0,0,240.26,186.1Zm-20.8,15.7a4.46,4.46,0,0,1-4,2.2H40.55a4.46,4.46,0,0,1-4-2.2,3.56,3.56,0,0,1,0-3.73L124,46.2a4.77,4.77,0,0,1,8,0l87.44,151.87A3.56,3.56,0,0,1,219.46,201.8ZM116,136V104a12,12,0,0,1,24,0v32a12,12,0,0,1-24,0Zm28,40a16,16,0,1,1-16-16A16,16,0,0,1,144,176Z"}))],["duotone",n.createElement(n.Fragment,null,n.createElement("path",{d:"M215.46,216H40.54C27.92,216,20,202.79,26.13,192.09L113.59,40.22c6.3-11,22.52-11,28.82,0l87.46,151.87C236,202.79,228.08,216,215.46,216Z",opacity:"0.2"}),n.createElement("path",{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z"}))],["fill",n.createElement(n.Fragment,null,n.createElement("path",{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM120,104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm8,88a12,12,0,1,1,12-12A12,12,0,0,1,128,192Z"}))],["light",n.createElement(n.Fragment,null,n.createElement("path",{d:"M235.07,189.09,147.61,37.22h0a22.75,22.75,0,0,0-39.22,0L20.93,189.09a21.53,21.53,0,0,0,0,21.72A22.35,22.35,0,0,0,40.55,222h174.9a22.35,22.35,0,0,0,19.6-11.19A21.53,21.53,0,0,0,235.07,189.09ZM224.66,204.8a10.46,10.46,0,0,1-9.21,5.2H40.55a10.46,10.46,0,0,1-9.21-5.2,9.51,9.51,0,0,1,0-9.72L118.79,43.21a10.75,10.75,0,0,1,18.42,0l87.46,151.87A9.51,9.51,0,0,1,224.66,204.8ZM122,144V104a6,6,0,0,1,12,0v40a6,6,0,0,1-12,0Zm16,36a10,10,0,1,1-10-10A10,10,0,0,1,138,180Z"}))],["regular",n.createElement(n.Fragment,null,n.createElement("path",{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z"}))],["thin",n.createElement(n.Fragment,null,n.createElement("path",{d:"M233.34,190.09,145.88,38.22h0a20.75,20.75,0,0,0-35.76,0L22.66,190.09a19.52,19.52,0,0,0,0,19.71A20.36,20.36,0,0,0,40.54,220H215.46a20.36,20.36,0,0,0,17.86-10.2A19.52,19.52,0,0,0,233.34,190.09ZM226.4,205.8a12.47,12.47,0,0,1-10.94,6.2H40.54a12.47,12.47,0,0,1-10.94-6.2,11.45,11.45,0,0,1,0-11.72L117.05,42.21a12.76,12.76,0,0,1,21.9,0L226.4,194.08A11.45,11.45,0,0,1,226.4,205.8ZM124,144V104a4,4,0,0,1,8,0v40a4,4,0,0,1-8,0Zm12,36a8,8,0,1,1-8-8A8,8,0,0,1,136,180Z"}))]]),s=n.forwardRef((e,t)=>n.createElement(r.A,{ref:t,...e,weights:l}));s.displayName="WarningIcon";let i=s},22450:(e,t,a)=>{"use strict";a.d(t,{default:()=>s});var n=a(78604),r=a(27540),l=a(39504);function s({successLabel:e,errorMessage:t}){let a=(0,r.useRouter)(),i=(0,n.useRef)(!1);return(0,n.useEffect)(()=>{!i.current&&(i.current=!0,e&&(l.oR.success(`${e} connected`),a.replace("/connectors")),t&&console.error("[OAuth] connection failed:",t))},[e,t,a]),null}},40319:(e,t,a)=>{"use strict";a.d(t,{r:()=>i});var n=a(78604),r=a(53087),l=a(54935);let s=n.forwardRef((e,t)=>n.createElement(r.A,{ref:t,...e,weights:l.A}));s.displayName="CheckCircleIcon";let i=s},42357:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var n=a(3680);function r({items:e,value:t,onChange:a,className:l=""}){return(0,n.jsx)("div",{className:`flex flex-wrap items-center gap-2 ${l}`,children:e.map(e=>{let r=e.value===t;return(0,n.jsxs)("button",{type:"button",onClick:()=>a(e.value),className:`inline-flex h-8 items-center gap-1.5 rounded-[9px] border px-3.5 text-[12.5px] font-medium leading-none transition-colors ${r?"border-ink bg-ink text-canvas":"border-rule-2 bg-paper text-ink-2 hover:bg-hover"}`,children:[e.label,void 0!==e.count&&(0,n.jsx)("span",{className:`font-mono text-[11px] leading-none ${r?"opacity-65":"opacity-55"}`,children:e.count})]},e.value)})})}},43158:(e,t,a)=>{Promise.resolve().then(a.bind(a,60728)),Promise.resolve().then(a.bind(a,93275)),Promise.resolve().then(a.bind(a,22450))},54935:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var n=a(78604);let r=new Map([["bold",n.createElement(n.Fragment,null,n.createElement("path",{d:"M176.49,95.51a12,12,0,0,1,0,17l-56,56a12,12,0,0,1-17,0l-24-24a12,12,0,1,1,17-17L112,143l47.51-47.52A12,12,0,0,1,176.49,95.51ZM236,128A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Z"}))],["duotone",n.createElement(n.Fragment,null,n.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),n.createElement("path",{d:"M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["fill",n.createElement(n.Fragment,null,n.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm45.66,85.66-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35a8,8,0,0,1,11.32,11.32Z"}))],["light",n.createElement(n.Fragment,null,n.createElement("path",{d:"M172.24,99.76a6,6,0,0,1,0,8.48l-56,56a6,6,0,0,1-8.48,0l-24-24a6,6,0,0,1,8.48-8.48L112,151.51l51.76-51.75A6,6,0,0,1,172.24,99.76ZM230,128A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",n.createElement(n.Fragment,null,n.createElement("path",{d:"M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["thin",n.createElement(n.Fragment,null,n.createElement("path",{d:"M170.83,101.17a4,4,0,0,1,0,5.66l-56,56a4,4,0,0,1-5.66,0l-24-24a4,4,0,0,1,5.66-5.66L112,154.34l53.17-53.17A4,4,0,0,1,170.83,101.17ZM228,128A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]])},60728:(e,t,a)=>{"use strict";a.d(t,{default:()=>G});var n=a(3680),r=a(78604),l=a(32307),s=a(65668),i=a(28870),o=a(66736),c=a(77045),d=a(12120),x=a(81630),u=a(88499),m=a(93606),p=a(39504),h=a(64678);let b=(0,h.createServerReference)("40aae39d580d4781cc8351ddd88b96f7994c61d569",h.callServer,void 0,h.findSourceMapURL,"deleteConnectorAction"),g=(0,h.createServerReference)("6052d253ca93e75392ecc1ff6ca202d578bea91ba6",h.callServer,void 0,h.findSourceMapURL,"renameConnectorAction"),f=(0,h.createServerReference)("6054b62f607756e568d00b1f2015c08de067cc19a5",h.callServer,void 0,h.findSourceMapURL,"assignCredentialAction"),v=(0,h.createServerReference)("6053553b5afe7eb6cbf81b733ae74da8360a500a8a",h.callServer,void 0,h.findSourceMapURL,"updateConnectorApiKeyAction"),y=(0,h.createServerReference)("403843256c26146273a561c8c95aceb6553e3f2a56",h.callServer,void 0,h.findSourceMapURL,"refreshCredentialAction");var k=a(14308),j=a(38666);let N=new Set(["notion-oauth"]);function A({instance:e,catalogEntry:t,compatibleCredentials:a}){var l;let[s,i]=(0,r.useTransition)(),[o,c]=(0,r.useTransition)(),[d,x]=(0,r.useState)(!1),[u,m]=(0,r.useState)(!1),[h,w]=(0,r.useState)(!1),[C,S]=(0,r.useState)(e.name),[R,M]=(0,r.useState)(!1),[E,T]=(0,r.useState)(e.credentialId??a[0]?.id??""),[Z,L]=(0,r.useState)(!1),[$,F]=(0,r.useState)(""),D="api_key"===e.authType,_="oauth2"===e.authType,I=e.active,H=_&&!N.has(t.credentialType??""),P=t.credentialType,O=e.credentialId,B=e.credentialName,U=e.credentialAccountName,G=e.credentialExpiresAt,K=e.credentialScopes,V=!!(l=G??null)&&l.getTime()<Date.now(),q=I?"connected":"inactive";function z(){let t=C.trim();t&&t!==e.name?i(async()=>{let a=await g(e.id,t);a.ok?(p.oR.success("Renamed"),w(!1)):p.oR.error(a.message)}):w(!1)}function W(){let t=$.trim();t?i(async()=>{let a=await v(e.id,t);a.ok?(p.oR.success(`${e.name} key rotated`),L(!1),F("")):p.oR.error(a.message)}):p.oR.error("New API key is required")}return(0,n.jsxs)("div",{className:"bg-paper border border-rule-2 rounded-xl p-5 space-y-4",children:[(0,n.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[h?(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("input",{autoFocus:!0,value:C,onChange:e=>S(e.target.value),onKeyDown:t=>{"Enter"===t.key&&z(),"Escape"===t.key&&(S(e.name),w(!1))},className:"bg-hover border border-rule rounded-md px-2 py-1 text-sm text-ink focus:border-ink-3 focus:outline-none w-full max-w-xs"}),(0,n.jsx)("button",{type:"button",onClick:z,disabled:s,className:"text-xs text-ok hover:text-ok disabled:opacity-40",children:"Save"}),(0,n.jsx)("button",{type:"button",onClick:()=>{S(e.name),w(!1)},className:"text-xs text-ink-3 hover:text-ink-2",children:"Cancel"})]}):(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("h3",{className:"text-base font-semibold text-ink truncate",children:e.name}),(0,n.jsx)("button",{type:"button",onClick:()=>w(!0),"aria-label":"Rename connector",className:"text-ink-4 hover:text-ink-3 transition-colors text-xs leading-none",title:"Rename",children:"✎"}),(0,n.jsx)("span",{className:`inline-block px-2 py-0.5 rounded text-[10px] font-semibold uppercase tracking-wider ${"connected"===q?"bg-agent-vivid/15 text-ok":"bg-warn-bg text-warn"}`,children:q})]}),(0,n.jsxs)("p",{className:"text-xs text-ink-3 mt-1 font-mono",children:[t.slug," \xb7 ",e.authType]}),U&&(0,n.jsx)("p",{className:"text-xs text-ink-3 mt-1",children:U}),D&&e.hasApiKey&&(0,n.jsxs)("p",{className:"text-xs text-ink-4 mt-0.5 font-mono",children:["key: …",e.credentialId??"????"]})]}),(0,n.jsx)("div",{className:"flex gap-2 shrink-0 flex-wrap justify-end items-start",children:_?(0,n.jsxs)(n.Fragment,{children:[H&&(0,n.jsx)("button",{type:"button",onClick:function(){O&&c(async()=>{let e=await y(O);e.ok?p.oR.success("Token refreshed"):p.oR.error(e.message??"Refresh failed")})},disabled:o||s,className:"px-3 py-1.5 text-xs font-medium border border-rule-2 text-ink-3 rounded-md hover:border-rule hover:text-ink disabled:opacity-40",children:o?"Refreshing…":"Refresh now"}),(0,n.jsx)("button",{type:"button",onClick:()=>m(!0),disabled:s||o,className:"px-3 py-1.5 text-xs font-medium border border-rule-2 text-ink-3 rounded-md hover:border-rule hover:text-ink disabled:opacity-40",children:"Reconnect"}),a.length>0&&(0,n.jsx)("button",{type:"button",onClick:()=>M(e=>!e),disabled:s||o,className:"px-3 py-1.5 text-xs font-medium border border-rule-2 text-ink-3 rounded-md hover:border-rule hover:text-ink disabled:opacity-40",children:R?"Cancel":"Switch credential"}),(0,n.jsx)("button",{type:"button",onClick:()=>x(!0),disabled:s||o,className:"px-3 py-1.5 text-xs font-medium border border-err/30 text-err rounded-md hover:border-err/30 hover:text-err disabled:opacity-40",children:"Disconnect"})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{type:"button",onClick:()=>L(e=>!e),disabled:s,className:"px-3 py-1.5 text-xs font-medium border border-rule-2 text-ink-3 rounded-md hover:border-rule hover:text-ink disabled:opacity-40",children:Z?"Cancel":"Rotate key"}),(0,n.jsx)("button",{type:"button",onClick:()=>x(!0),disabled:s,className:"px-3 py-1.5 text-xs font-medium border border-err/30 text-err rounded-md hover:border-err/30 hover:text-err disabled:opacity-40",children:"Delete"})]})})]}),D&&Z&&(0,n.jsxs)("div",{className:"space-y-3 pt-2 border-t border-rule-2",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{htmlFor:`rotate-${e.id}`,className:"block text-xs text-ink-3 mb-1",children:"New API key"}),(0,n.jsx)("input",{id:`rotate-${e.id}`,type:"password",autoComplete:"off",autoFocus:!0,value:$,onChange:e=>F(e.target.value),onKeyDown:e=>{"Enter"===e.key&&W(),"Escape"===e.key&&(F(""),L(!1))},placeholder:"Paste the new key",className:"w-full bg-hover border border-rule rounded-md px-2 py-1.5 text-sm text-ink placeholder:text-ink-4 focus:border-ink-3 focus:outline-none font-mono"}),(0,n.jsx)("p",{className:"text-[11px] text-ink-4 mt-1",children:"Agent assignments stay intact — only the stored key changes."})]}),(0,n.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,n.jsx)("button",{type:"button",onClick:W,disabled:s||!$.trim(),className:"px-4 py-2 text-sm font-semibold bg-ink text-canvas rounded-md hover:brightness-[0.92] disabled:opacity-50",children:s?"Saving…":"Save new key"}),(0,n.jsx)("button",{type:"button",onClick:()=>{F(""),L(!1)},className:"text-xs text-ink-3 hover:text-ink underline",children:"Cancel"})]})]}),t.docsHint&&(0,n.jsx)("p",{className:"text-xs text-ink-3",children:t.docsHint}),_&&O&&(0,n.jsxs)("div",{className:"pt-2 border-t border-rule-2 space-y-2",children:[B&&(0,n.jsxs)("p",{className:"text-xs text-ink-3",children:["Credential: ",(0,n.jsx)("span",{className:"text-ink font-medium",children:B})]}),K&&(0,n.jsx)("div",{className:"flex flex-wrap gap-1",children:K.split(/\s+/).map(e=>(0,n.jsx)("span",{className:"px-1.5 py-0.5 bg-hover text-ink-3 rounded text-[10px] font-mono",children:e},e))}),H&&(0,n.jsx)("p",{className:"text-xs text-ink-3",children:"Auto-refreshes when used"}),!H&&G&&(0,n.jsx)("p",{className:`text-xs ${V?"text-warn":"text-ink-3"}`,children:function(e){let t;if(!e)return"";let a=Math.round((e.getTime()-Date.now())/1e3),n=Math.abs(a);return t=n<60?`${n}s`:n<3600?`${Math.round(n/60)} min`:n<86400?`${Math.round(n/3600)} h`:`${Math.round(n/86400)} d`,a>=0?`expires in ${t}`:`expired ${t} ago`}(G)})]}),_&&R&&(0,n.jsx)("div",{className:"space-y-3 pt-2 border-t border-rule-2",children:a.length>0?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-xs text-ink-3 mb-1",children:"Use credential"}),(0,n.jsx)("select",{value:E,onChange:e=>T(e.target.value),className:"w-full bg-hover border border-rule rounded-md px-2 py-1.5 text-sm text-ink focus:border-ink-3 focus:outline-none",children:a.map(e=>(0,n.jsxs)("option",{value:e.id,children:[e.name,e.accountName?` (${e.accountName})`:""]},e.id))})]}),(0,n.jsxs)("div",{className:"flex gap-2 items-center pt-1",children:[(0,n.jsx)("button",{type:"button",onClick:()=>E&&void i(async()=>{let t=await f(e.id,E);t.ok?(p.oR.success(`${e.name} credential updated`),M(!1)):p.oR.error(t.message)}),disabled:s||!E,className:"px-4 py-2 text-sm font-semibold bg-ink text-canvas rounded-md hover:brightness-[0.92] disabled:opacity-50",children:s?"Saving…":"Save"}),(0,n.jsx)("button",{type:"button",onClick:()=>{M(!1),m(!0)},className:"px-3 py-1.5 text-xs text-ink-3 hover:text-ink underline",children:"or create new"})]})]}):(0,n.jsxs)("p",{className:"text-xs text-ink-3",children:["No compatible credentials found."," ",(0,n.jsx)("button",{type:"button",onClick:()=>{M(!1),m(!0)},className:"text-indigo-400 hover:text-indigo-300 underline",children:"Create one"})]})}),(0,n.jsx)(k.A,{open:d,title:`${_?"Disconnect":"Delete"} "${e.name}"?`,message:_?"Tools that depend on this connector will fail until you reconnect. Existing job history is preserved.":"This connector instance will be permanently removed. Existing job history is preserved.",confirmLabel:_?"Disconnect":"Delete",onConfirm:function(){x(!1),i(async()=>{let t=await b(e.id);t.ok?p.oR.success(`${e.name} removed`):p.oR.error(t.message)})},onCancel:()=>x(!1)}),u&&P&&(0,n.jsx)(j.A,{initialType:P,returnToConnectorSlug:t.slug,onClose:()=>m(!1)})]})}var w=a(21021);function C({instances:e,credsByType:t}){return(0,n.jsx)("div",{className:"overflow-hidden rounded-2xl border border-rule-2 bg-paper",children:(0,n.jsxs)("table",{className:"w-full border-collapse",children:[(0,n.jsx)("thead",{children:(0,n.jsxs)("tr",{children:[(0,n.jsx)(S,{label:"Provider"}),(0,n.jsx)(S,{label:"Account"}),(0,n.jsx)(S,{label:"Scopes"}),(0,n.jsx)(S,{label:"Status"}),(0,n.jsx)(S,{label:"Actions",align:"right"})]})}),(0,n.jsx)("tbody",{children:e.map(e=>{let a=d.YT.find(t=>t.slug===e.slug),r=a?{...a,credentialType:a.credentialType??null}:{slug:e.slug,label:e.name,authType:e.authType,docsHint:"",credentialType:e.credentialType??null},l=r.credentialType?t[r.credentialType]??[]:[];return(0,n.jsx)(R,{instance:e,catalogEntry:r,compatibleCredentials:l},e.id)})})]})})}function S({label:e,align:t="left"}){return(0,n.jsx)("th",{className:`border-b border-rule-2 px-[18px] pt-3.5 pb-2.5 font-mono text-[9.5px] font-normal whitespace-nowrap uppercase tracking-[0.16em] text-ink-4 ${"right"===t?"text-right":"text-left"}`,scope:"col",children:e})}function R({instance:e,catalogEntry:t,compatibleCredentials:a}){let[l,s]=(0,r.useState)(!1),i=w.a[e.slug],o=(0,w.d)(e.slug,t.label),c=e.active,d=e.credentialScopes?e.credentialScopes.split(/\s+/).filter(Boolean):[];return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("tr",{className:"border-b border-rule-2 last:border-0 hover:bg-hover",children:[(0,n.jsx)("td",{className:"px-[18px] py-[13px] align-middle",children:(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsx)(x.A,{variant:"conn",size:"sm",shape:"square",background:i,children:(0,n.jsx)("span",{className:"font-mono text-[10px] font-semibold tracking-[0.04em]",children:o})}),(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("div",{className:"text-[13.5px] font-medium leading-[1.2] text-ink",children:t.label}),(0,n.jsx)("div",{className:"mt-0.5 font-mono text-[10.5px] uppercase tracking-[0.12em] text-ink-4",children:t.authType})]})]})}),(0,n.jsx)("td",{className:"px-[18px] py-[13px] align-middle",children:(0,n.jsx)("span",{className:"font-sans text-[13px] leading-[1.3] text-ink-2",children:e.credentialAccountName??e.name})}),(0,n.jsx)("td",{className:"px-[18px] py-[13px] align-middle",children:d.length>0?(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[d.slice(0,4).map(e=>(0,n.jsx)(u.A,{children:e},e)),d.length>4&&(0,n.jsxs)("span",{className:"font-mono text-[11px] text-ink-4",children:["+",d.length-4]})]}):(0,n.jsx)("span",{className:"font-mono text-[11px] text-ink-4",children:"api_key"===e.authType?"api_key":"—"})}),(0,n.jsx)("td",{className:"px-[18px] py-[13px] align-middle",children:(0,n.jsx)(m.A,{variant:c?"done":"warn",label:c?"Connected":"Needs auth"})}),(0,n.jsx)("td",{className:"px-[18px] py-[13px] align-middle",children:(0,n.jsx)("div",{className:"flex items-center justify-end gap-2",children:(0,n.jsx)("button",{type:"button",onClick:()=>s(e=>!e),className:"inline-flex h-[30px] items-center gap-1.5 rounded-[7px] border border-rule bg-paper px-3 text-[12px] font-medium leading-none text-ink-2 transition-colors hover:bg-hover hover:text-ink",children:l?"Close":"Configure"})})})]}),l&&(0,n.jsx)("tr",{className:"border-b border-rule-2 last:border-0 bg-hover/40",children:(0,n.jsx)("td",{colSpan:5,className:"px-[18px] py-3",children:(0,n.jsx)(A,{instance:e,catalogEntry:t,compatibleCredentials:a})})})]})}var M=a(27540),E=a(40319),T=a(42357),Z=a(37820),L=a(16237),$=a(13260);let F=(0,h.createServerReference)("40b46e5f74882ec891a618bbdc133c7fda56f151ac",h.callServer,void 0,h.findSourceMapURL,"saveApiKeyConnectorAction"),D=(0,h.createServerReference)("70eae4ed44a84057b091ae90dc3df3c82504511383",h.callServer,void 0,h.findSourceMapURL,"createOrAssignOAuthConnectorAction");var _=a(36762),I=a(10900);function H({catalogItem:e,compatibleCredentials:t,onDone:a,onCreateNew:l}){let[s,i]=(0,r.useTransition)(),[o,c]=(0,r.useState)(t[0]?.id??""),d="api_key"===e.authType,x="oauth2"===e.authType;return d?(0,n.jsxs)("form",{onSubmit:function(t){t.preventDefault();let n=new FormData(t.currentTarget),r=n.get("name")?.trim()??"",l=n.get("apiKey")?.trim()??"";r?l?i(async()=>{let t=await F({slug:e.slug,name:r,apiKey:l});t.ok?(p.oR.success(`${r} connected`),a?.()):p.oR.error(t.message)}):p.oR.error("API key is required"):p.oR.error("Name is required")},className:"space-y-3",children:[(0,n.jsxs)("div",{children:[(0,n.jsxs)("label",{htmlFor:`add-name-${e.slug}`,className:"block text-xs text-ink-3 mb-1",children:["Name ",(0,n.jsx)("span",{className:"text-ink-4",children:'(e.g. "Notion — perso")'})]}),(0,n.jsx)("input",{id:`add-name-${e.slug}`,name:"name",required:!0,placeholder:e.label,className:"w-full bg-hover border border-rule rounded-md px-2 py-1.5 text-sm text-ink placeholder:text-ink-4 focus:border-ink-3 focus:outline-none"})]}),I.m[e.slug]&&(0,n.jsxs)("details",{className:"group text-xs",children:[(0,n.jsx)("summary",{className:"cursor-pointer text-ink-3 hover:text-ink-2",children:"Where do I get this?"}),(0,n.jsx)("div",{className:"mt-3 pl-1",children:(0,n.jsx)(_.A,{guide:I.m[e.slug]})})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{htmlFor:`add-apikey-${e.slug}`,className:"block text-xs text-ink-3 mb-1",children:"API key"}),(0,n.jsx)("input",{id:`add-apikey-${e.slug}`,name:"apiKey",type:"password",required:!0,autoComplete:"off",className:"w-full bg-hover border border-rule rounded-md px-2 py-1.5 text-sm text-ink placeholder:text-ink-4 focus:border-ink-3 focus:outline-none font-mono"})]}),(0,n.jsx)("div",{className:"pt-1",children:(0,n.jsx)("button",{type:"submit",disabled:s,className:"px-4 py-2 text-sm font-semibold bg-ink text-canvas rounded-md hover:brightness-[0.92] disabled:opacity-50",children:s?"Connecting…":"Connect"})})]}):x&&t.length>0?(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-xs text-ink-3 mb-1",children:"Use existing credential"}),(0,n.jsx)("select",{value:o,onChange:e=>c(e.target.value),className:"w-full bg-hover border border-rule rounded-md px-2 py-1.5 text-sm text-ink focus:border-ink-3 focus:outline-none",children:t.map(e=>(0,n.jsxs)("option",{value:e.id,children:[e.name,e.accountName?` (${e.accountName})`:""]},e.id))})]}),(0,n.jsxs)("div",{className:"flex gap-2 items-center pt-1",children:[(0,n.jsx)("button",{type:"button",onClick:()=>o&&void i(async()=>{let t=await D(e.slug,o);t.ok?(p.oR.success(`${e.label} connected`),a?.()):p.oR.error(t.message)}),disabled:s||!o,className:"px-4 py-2 text-sm font-semibold bg-ink text-canvas rounded-md hover:brightness-[0.92] disabled:opacity-50",children:s?"Connecting…":"Connect"}),(0,n.jsx)("button",{type:"button",onClick:()=>l?.(),className:"px-3 py-1.5 text-xs text-ink-3 hover:text-ink underline",children:"or create new"})]})]}):(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsx)("p",{className:"text-xs text-ink-3",children:e.docsHint}),(0,n.jsx)("button",{type:"button",onClick:()=>l?.(),className:"px-4 py-2 text-sm font-semibold bg-ink text-canvas rounded-md hover:brightness-[0.92]",children:"Create credential"})]})}function P(e){return e.startsWith("google-")||"gmail"===e||"notion"===e||"notion-oauth"===e||"airtable"===e||"airtable-oauth"===e?"Productivity":"github"===e||"linear"===e?"DevTools":"hubspot"===e?"CRM":"slack"===e||"intercom"===e?"Comms":"apify"===e||"firecrawl"===e||"tavily"===e||"stripe"===e||"postgres"===e?"Data":"Other"}let O=[{value:"All",label:"All"},{value:"CRM",label:"CRM"},{value:"Productivity",label:"Productivity"},{value:"Data",label:"Data"},{value:"DevTools",label:"DevTools"},{value:"Comms",label:"Comms"},{value:"Other",label:"Other"}];function B({catalog:e,instances:t,credsByType:a,category:r,onCategoryChange:l}){return(0,n.jsxs)("div",{children:[(0,n.jsx)(T.A,{items:O,value:r,onChange:l,className:"mb-[18px]"}),0===e.length?(0,n.jsx)("div",{className:"rounded-2xl border border-rule-2 bg-paper px-6 py-12 text-center",children:(0,n.jsx)("p",{className:"text-[13px] text-ink-3",children:"No connectors in this category."})}):(0,n.jsx)("div",{className:"grid auto-rows-fr grid-cols-1 gap-3.5 md:grid-cols-2 lg:grid-cols-4",children:e.map(e=>{let r=t.filter(t=>t.slug===e.slug),l=r.length>0,s=e.credentialType?a[e.credentialType]??[]:[];return(0,n.jsx)(U,{catalogItem:e,isInstalled:l,installedCount:r.length,compatibleCredentials:s},e.slug)})})]})}function U({catalogItem:e,isInstalled:t,installedCount:a,compatibleCredentials:l}){let[s,i]=(0,r.useState)(!1),[o,c]=(0,r.useState)(!1),d=(0,M.useRouter)(),x=w.a[e.slug],u=(0,w.d)(e.slug,e.label),m=P(e.slug),p="oauth2"===e.authType&&0===l.length;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Z.A,{glyph:(0,n.jsx)("span",{className:"font-mono text-[10px] font-semibold tracking-[0.04em]",children:u}),glyphVariant:"conn",glyphBackground:x,name:e.label,description:e.docsHint,category:m,topRight:t?(0,n.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-[6px] bg-ok-bg px-2 py-1 font-sans text-[11px] font-medium text-ok",children:[(0,n.jsx)(E.r,{size:11,weight:"regular"}),a," installed"]}):void 0,foot:(0,n.jsx)(L.A,{ctaLabel:t?"Add account":"Install",ctaVariant:"blue",onCta:()=>p?c(!0):i(!0)})}),(0,n.jsx)($.A,{open:s,onClose:()=>i(!1),title:t?`Add account — ${e.label}`:`Install ${e.label}`,children:(0,n.jsx)(H,{catalogItem:e,compatibleCredentials:l,onDone:function(){i(!1),d.refresh()},onCreateNew:()=>{i(!1),c(!0)}})}),o&&e.credentialType&&(0,n.jsx)(j.A,{initialType:e.credentialType,returnToConnectorSlug:e.slug,onClose:()=>c(!1)})]})}function G({instances:e,catalog:t,credsByType:a}){let[d,x]=(0,r.useState)(e.length>0?"installed":"marketplace"),[u,m]=(0,r.useState)(""),[p,h]=(0,r.useState)("All"),b=(0,r.useMemo)(()=>{if(!u.trim())return e;let t=u.toLowerCase();return e.filter(e=>e.name.toLowerCase().includes(t)||e.slug.toLowerCase().includes(t)||(e.credentialAccountName??"").toLowerCase().includes(t))},[e,u]),g=(0,r.useMemo)(()=>{let e=t;if("All"!==p&&(e=e.filter(e=>P(e.slug)===p)),u.trim()){let t=u.toLowerCase();e=e.filter(e=>e.label.toLowerCase().includes(t)||e.slug.toLowerCase().includes(t))}return e},[t,p,u]);return(0,n.jsxs)("div",{className:"pb-10",children:[(0,n.jsx)(l.A,{title:"API Connectors",subtitle:"Wire your agents to external services — Gmail, Slack, HubSpot, and the rest. Browse the marketplace or manage the accounts you've already connected."}),(0,n.jsx)(s.A,{tabs:(0,n.jsx)(i.A,{value:d,onChange:e=>{x(e),m(""),h("All")},tabs:[{value:"installed",label:"Installed",count:e.length},{value:"marketplace",label:"Marketplace",count:t.length}]}),search:(0,n.jsx)(o.A,{value:u,onChange:m,placeholder:"installed"===d?"Search connectors…":"Search providers…"}),cta:(0,n.jsx)(c.A,{variant:"ink",href:"/credentials",children:"Manage credentials"})}),(0,n.jsx)("div",{className:"pt-5",children:"installed"===d?0===e.length?(0,n.jsx)(K,{onBrowse:()=>x("marketplace")}):0===b.length?(0,n.jsx)(V,{}):(0,n.jsx)(C,{instances:b,credsByType:a}):(0,n.jsx)(B,{catalog:g,instances:e,credsByType:a,category:p,onCategoryChange:h})})]})}function K({onBrowse:e}){return(0,n.jsxs)("div",{className:"rounded-2xl border border-rule-2 bg-paper px-6 py-12 text-center",children:[(0,n.jsxs)("p",{className:"text-[13px] leading-[1.5] text-ink-3",children:["No connectors installed yet.",(0,n.jsx)("br",{}),"Browse the Marketplace to add one."]}),(0,n.jsx)("div",{className:"mt-4 inline-flex",children:(0,n.jsx)(c.A,{variant:"blue",onClick:e,children:"Browse Marketplace"})})]})}function V(){return(0,n.jsx)("div",{className:"rounded-2xl border border-rule-2 bg-paper px-6 py-12 text-center",children:(0,n.jsx)("p",{className:"text-[13px] leading-[1.5] text-ink-3",children:"No connectors match your search."})})}},82592:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});var n=a(3680);let r={ok:"bg-ok",lime:"bg-agent-vivid",coral:"bg-skill-vivid",blue:"bg-conn-vivid"},l={ok:"animate-[blip_1.4s_ease-out_infinite]",lime:"animate-[blip-lime_1.5s_ease-out_infinite]",coral:"animate-[blip-coral_1.4s_ease-out_infinite]",blue:"animate-[blip-blue_1.4s_ease-out_infinite]"};function s({variant:e="ok",size:t="sm",animate:a=!0,className:i=""}){return(0,n.jsx)("span",{className:`inline-block shrink-0 rounded-full ${"sm"===t?"h-[7px] w-[7px]":"h-2 w-2"} ${r[e]} ${a?l[e]:""} ${i}`})}},86127:(e,t,a)=>{"use strict";a.d(t,{r:()=>i});var n=a(78604),r=a(5977),l=a(54935);let s=n.forwardRef((e,t)=>n.createElement(r.A,{ref:t,...e,weights:l.A}));s.displayName="CheckCircleIcon";let i=s},93275:(e,t,a)=>{"use strict";a.d(t,{default:()=>l});var n=a(3680),r=a(27540);function l({code:e,message:t}){let a=(0,r.useRouter)();return(0,n.jsx)("div",{role:"alert",className:"rounded-xl border border-err/30 bg-warn-bg px-5 py-4 text-sm text-err",children:(0,n.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,n.jsxs)("div",{className:"space-y-1.5 min-w-0",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{"aria-hidden":"true",className:"font-bold text-err",children:"!"}),(0,n.jsx)("p",{className:"font-semibold text-err",children:"OAuth connection failed"}),(0,n.jsx)("code",{className:"font-mono text-[10px] text-err/80 bg-warn-bg px-1.5 py-0.5 rounded",children:e})]}),(0,n.jsx)("p",{className:"text-err leading-relaxed",children:t})]}),(0,n.jsx)("button",{type:"button",onClick:function(){a.replace("/connectors")},"aria-label":"Dismiss",className:"shrink-0 text-err/70 hover:text-err transition-colors text-lg leading-none px-2 -mt-0.5",children:"\xd7"})]})})}},93606:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});var n=a(3680),r=a(86127),l=a(22089),s=a(82592);let i={done:"Done",warn:"Attention",run:"Running",idle:"Idle","lvl-info":"INFO","lvl-ok":"OK","lvl-warn":"WARN","lvl-err":"ERR"},o={done:"bg-ok-bg text-ok",warn:"bg-warn-bg text-warn",run:"bg-run-bg text-run",idle:"bg-black/5 text-ink-3 dark:bg-white/5","lvl-info":"bg-black/5 text-ink-3 dark:bg-white/5","lvl-ok":"bg-ok-bg text-ok","lvl-warn":"bg-warn-bg text-warn","lvl-err":"bg-warn-bg text-err"};function c({variant:e,label:t,icon:a,className:d=""}){let x=t??i[e],u=null;return void 0!==a?u=a:"done"===e?u=(0,n.jsx)(r.r,{size:11,weight:"regular"}):"warn"===e?u=(0,n.jsx)(l.N,{size:11,weight:"regular"}):"run"===e&&(u=(0,n.jsx)(s.A,{variant:"blue",size:"sm"})),(0,n.jsxs)("span",{className:`inline-flex h-[22px] items-center gap-1.5 rounded-[5px] px-2.5 text-[11px] font-medium leading-none ${o[e]} ${d}`,children:[u,x]})}}},e=>{e.O(0,[3363,9504,7025,9123,8396,8666,1065,8724,7358],()=>e(e.s=43158)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9527],{5977:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var n=a(78604);let r=n.forwardRef((e,t)=>{let{alt:a,color:r="currentColor",size:l="1em",weight:s="regular",mirrored:i=!1,children:o,weights:c,...d}=e;return n.createElement("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:l,height:l,fill:r,viewBox:"0 0 256 256",transform:i?"scale(-1, 1)":void 0,...d},!!a&&n.createElement("title",null,a),o,c.get(s))});r.displayName="SSRBase"},21021:(e,t,a)=>{"use strict";a.d(t,{a:()=>n,d:()=>l});let n={gmail:"#ea4335","google-drive":"#4285f4","google-sheets":"#0f9d58","google-docs":"#4285f4","google-calendar":"#4285f4",notion:"#000000","notion-oauth":"#000000",airtable:"#f82b60","airtable-oauth":"#f82b60",github:"#24292f",linear:"#5e6ad2",hubspot:"#ff7a59",slack:"#4a154b",intercom:"#1f8ced",stripe:"#635bff",postgres:"#336791",apify:"#00aeff",firecrawl:"#f97316",tavily:"#6366f1",composio:"#000000"},r={gmail:"Gm","google-drive":"GD","google-sheets":"GS","google-docs":"GD","google-calendar":"GC",notion:"No","notion-oauth":"No",airtable:"At","airtable-oauth":"At",github:"Gh",linear:"Li",hubspot:"HS",slack:"Sl",intercom:"IC",stripe:"St",postgres:"PG",apify:"Ap",firecrawl:"FC",tavily:"Tv",composio:"Co","custom-http-mcp":"+","custom-stdio-mcp":"+","cogni-cortex":"CX"};function l(e,t){return r[e]??t.slice(0,2).toUpperCase()}},22089:(e,t,a)=>{"use strict";a.d(t,{N:()=>i});var n=a(78604),r=a(5977);let l=new Map([["bold",n.createElement(n.Fragment,null,n.createElement("path",{d:"M240.26,186.1,152.81,34.23h0a28.74,28.74,0,0,0-49.62,0L15.74,186.1a27.45,27.45,0,0,0,0,27.71A28.31,28.31,0,0,0,40.55,228h174.9a28.31,28.31,0,0,0,24.79-14.19A27.45,27.45,0,0,0,240.26,186.1Zm-20.8,15.7a4.46,4.46,0,0,1-4,2.2H40.55a4.46,4.46,0,0,1-4-2.2,3.56,3.56,0,0,1,0-3.73L124,46.2a4.77,4.77,0,0,1,8,0l87.44,151.87A3.56,3.56,0,0,1,219.46,201.8ZM116,136V104a12,12,0,0,1,24,0v32a12,12,0,0,1-24,0Zm28,40a16,16,0,1,1-16-16A16,16,0,0,1,144,176Z"}))],["duotone",n.createElement(n.Fragment,null,n.createElement("path",{d:"M215.46,216H40.54C27.92,216,20,202.79,26.13,192.09L113.59,40.22c6.3-11,22.52-11,28.82,0l87.46,151.87C236,202.79,228.08,216,215.46,216Z",opacity:"0.2"}),n.createElement("path",{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z"}))],["fill",n.createElement(n.Fragment,null,n.createElement("path",{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM120,104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm8,88a12,12,0,1,1,12-12A12,12,0,0,1,128,192Z"}))],["light",n.createElement(n.Fragment,null,n.createElement("path",{d:"M235.07,189.09,147.61,37.22h0a22.75,22.75,0,0,0-39.22,0L20.93,189.09a21.53,21.53,0,0,0,0,21.72A22.35,22.35,0,0,0,40.55,222h174.9a22.35,22.35,0,0,0,19.6-11.19A21.53,21.53,0,0,0,235.07,189.09ZM224.66,204.8a10.46,10.46,0,0,1-9.21,5.2H40.55a10.46,10.46,0,0,1-9.21-5.2,9.51,9.51,0,0,1,0-9.72L118.79,43.21a10.75,10.75,0,0,1,18.42,0l87.46,151.87A9.51,9.51,0,0,1,224.66,204.8ZM122,144V104a6,6,0,0,1,12,0v40a6,6,0,0,1-12,0Zm16,36a10,10,0,1,1-10-10A10,10,0,0,1,138,180Z"}))],["regular",n.createElement(n.Fragment,null,n.createElement("path",{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z"}))],["thin",n.createElement(n.Fragment,null,n.createElement("path",{d:"M233.34,190.09,145.88,38.22h0a20.75,20.75,0,0,0-35.76,0L22.66,190.09a19.52,19.52,0,0,0,0,19.71A20.36,20.36,0,0,0,40.54,220H215.46a20.36,20.36,0,0,0,17.86-10.2A19.52,19.52,0,0,0,233.34,190.09ZM226.4,205.8a12.47,12.47,0,0,1-10.94,6.2H40.54a12.47,12.47,0,0,1-10.94-6.2,11.45,11.45,0,0,1,0-11.72L117.05,42.21a12.76,12.76,0,0,1,21.9,0L226.4,194.08A11.45,11.45,0,0,1,226.4,205.8ZM124,144V104a4,4,0,0,1,8,0v40a4,4,0,0,1-8,0Zm12,36a8,8,0,1,1-8-8A8,8,0,0,1,136,180Z"}))]]),s=n.forwardRef((e,t)=>n.createElement(r.A,{ref:t,...e,weights:l}));s.displayName="WarningIcon";let i=s},22450:(e,t,a)=>{"use strict";a.d(t,{default:()=>s});var n=a(78604),r=a(27540),l=a(39504);function s({successLabel:e,errorMessage:t}){let a=(0,r.useRouter)(),i=(0,n.useRef)(!1);return(0,n.useEffect)(()=>{!i.current&&(i.current=!0,e&&(l.oR.success(`${e} connected`),a.replace("/connectors")),t&&console.error("[OAuth] connection failed:",t))},[e,t,a]),null}},40319:(e,t,a)=>{"use strict";a.d(t,{r:()=>i});var n=a(78604),r=a(53087),l=a(54935);let s=n.forwardRef((e,t)=>n.createElement(r.A,{ref:t,...e,weights:l.A}));s.displayName="CheckCircleIcon";let i=s},42357:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var n=a(3680);function r({items:e,value:t,onChange:a,className:l=""}){return(0,n.jsx)("div",{className:`flex flex-wrap items-center gap-2 ${l}`,children:e.map(e=>{let r=e.value===t;return(0,n.jsxs)("button",{type:"button",onClick:()=>a(e.value),className:`inline-flex h-8 items-center gap-1.5 rounded-[9px] border px-3.5 text-[12.5px] font-medium leading-none transition-colors ${r?"border-ink bg-ink text-canvas":"border-rule-2 bg-paper text-ink-2 hover:bg-hover"}`,children:[e.label,void 0!==e.count&&(0,n.jsx)("span",{className:`font-mono text-[11px] leading-none ${r?"opacity-65":"opacity-55"}`,children:e.count})]},e.value)})})}},43158:(e,t,a)=>{Promise.resolve().then(a.bind(a,67572)),Promise.resolve().then(a.bind(a,93275)),Promise.resolve().then(a.bind(a,22450))},54935:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var n=a(78604);let r=new Map([["bold",n.createElement(n.Fragment,null,n.createElement("path",{d:"M176.49,95.51a12,12,0,0,1,0,17l-56,56a12,12,0,0,1-17,0l-24-24a12,12,0,1,1,17-17L112,143l47.51-47.52A12,12,0,0,1,176.49,95.51ZM236,128A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Z"}))],["duotone",n.createElement(n.Fragment,null,n.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),n.createElement("path",{d:"M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["fill",n.createElement(n.Fragment,null,n.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm45.66,85.66-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35a8,8,0,0,1,11.32,11.32Z"}))],["light",n.createElement(n.Fragment,null,n.createElement("path",{d:"M172.24,99.76a6,6,0,0,1,0,8.48l-56,56a6,6,0,0,1-8.48,0l-24-24a6,6,0,0,1,8.48-8.48L112,151.51l51.76-51.75A6,6,0,0,1,172.24,99.76ZM230,128A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",n.createElement(n.Fragment,null,n.createElement("path",{d:"M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["thin",n.createElement(n.Fragment,null,n.createElement("path",{d:"M170.83,101.17a4,4,0,0,1,0,5.66l-56,56a4,4,0,0,1-5.66,0l-24-24a4,4,0,0,1,5.66-5.66L112,154.34l53.17-53.17A4,4,0,0,1,170.83,101.17ZM228,128A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]])},67572:(e,t,a)=>{"use strict";a.d(t,{default:()=>G});var n=a(3680),r=a(78604),l=a(32307),s=a(65668),i=a(28870),o=a(66736),c=a(77045),d=a(12120),x=a(81630),u=a(88499),m=a(93606),p=a(39504),h=a(64678);let b=(0,h.createServerReference)("4072660be3387fc94a2f35564292dc159448f98a7b",h.callServer,void 0,h.findSourceMapURL,"deleteConnectorAction"),g=(0,h.createServerReference)("60aec87a5bf59e09f43f85105b3e58327f98feb9e8",h.callServer,void 0,h.findSourceMapURL,"renameConnectorAction"),f=(0,h.createServerReference)("60828079bdf7ac1433de3e057d76fdc01ba138233a",h.callServer,void 0,h.findSourceMapURL,"assignCredentialAction"),v=(0,h.createServerReference)("60f81a329cff55c862f755a177ae79c649aa3918e9",h.callServer,void 0,h.findSourceMapURL,"updateConnectorApiKeyAction"),y=(0,h.createServerReference)("40fcdbd9908b964c7863cbaf0537cb89f4199d80d1",h.callServer,void 0,h.findSourceMapURL,"refreshCredentialAction");var k=a(14308),j=a(38666);let N=new Set(["notion-oauth"]);function A({instance:e,catalogEntry:t,compatibleCredentials:a}){var l;let[s,i]=(0,r.useTransition)(),[o,c]=(0,r.useTransition)(),[d,x]=(0,r.useState)(!1),[u,m]=(0,r.useState)(!1),[h,w]=(0,r.useState)(!1),[C,S]=(0,r.useState)(e.name),[R,M]=(0,r.useState)(!1),[E,T]=(0,r.useState)(e.credentialId??a[0]?.id??""),[Z,L]=(0,r.useState)(!1),[$,F]=(0,r.useState)(""),D="api_key"===e.authType,_="oauth2"===e.authType,I=e.active,H=_&&!N.has(t.credentialType??""),P=t.credentialType,O=e.credentialId,B=e.credentialName,U=e.credentialAccountName,G=e.credentialExpiresAt,K=e.credentialScopes,V=!!(l=G??null)&&l.getTime()<Date.now(),q=I?"connected":"inactive";function z(){let t=C.trim();t&&t!==e.name?i(async()=>{let a=await g(e.id,t);a.ok?(p.oR.success("Renamed"),w(!1)):p.oR.error(a.message)}):w(!1)}function W(){let t=$.trim();t?i(async()=>{let a=await v(e.id,t);a.ok?(p.oR.success(`${e.name} key rotated`),L(!1),F("")):p.oR.error(a.message)}):p.oR.error("New API key is required")}return(0,n.jsxs)("div",{className:"bg-paper border border-rule-2 rounded-xl p-5 space-y-4",children:[(0,n.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[h?(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("input",{autoFocus:!0,value:C,onChange:e=>S(e.target.value),onKeyDown:t=>{"Enter"===t.key&&z(),"Escape"===t.key&&(S(e.name),w(!1))},className:"bg-hover border border-rule rounded-md px-2 py-1 text-sm text-ink focus:border-ink-3 focus:outline-none w-full max-w-xs"}),(0,n.jsx)("button",{type:"button",onClick:z,disabled:s,className:"text-xs text-ok hover:text-ok disabled:opacity-40",children:"Save"}),(0,n.jsx)("button",{type:"button",onClick:()=>{S(e.name),w(!1)},className:"text-xs text-ink-3 hover:text-ink-2",children:"Cancel"})]}):(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("h3",{className:"text-base font-semibold text-ink truncate",children:e.name}),(0,n.jsx)("button",{type:"button",onClick:()=>w(!0),"aria-label":"Rename connector",className:"text-ink-4 hover:text-ink-3 transition-colors text-xs leading-none",title:"Rename",children:"✎"}),(0,n.jsx)("span",{className:`inline-block px-2 py-0.5 rounded text-[10px] font-semibold uppercase tracking-wider ${"connected"===q?"bg-agent-vivid/15 text-ok":"bg-warn-bg text-warn"}`,children:q})]}),(0,n.jsxs)("p",{className:"text-xs text-ink-3 mt-1 font-mono",children:[t.slug," \xb7 ",e.authType]}),U&&(0,n.jsx)("p",{className:"text-xs text-ink-3 mt-1",children:U}),D&&e.hasApiKey&&(0,n.jsxs)("p",{className:"text-xs text-ink-4 mt-0.5 font-mono",children:["key: …",e.credentialId??"????"]})]}),(0,n.jsx)("div",{className:"flex gap-2 shrink-0 flex-wrap justify-end items-start",children:_?(0,n.jsxs)(n.Fragment,{children:[H&&(0,n.jsx)("button",{type:"button",onClick:function(){O&&c(async()=>{let e=await y(O);e.ok?p.oR.success("Token refreshed"):p.oR.error(e.message??"Refresh failed")})},disabled:o||s,className:"px-3 py-1.5 text-xs font-medium border border-rule-2 text-ink-3 rounded-md hover:border-rule hover:text-ink disabled:opacity-40",children:o?"Refreshing…":"Refresh now"}),(0,n.jsx)("button",{type:"button",onClick:()=>m(!0),disabled:s||o,className:"px-3 py-1.5 text-xs font-medium border border-rule-2 text-ink-3 rounded-md hover:border-rule hover:text-ink disabled:opacity-40",children:"Reconnect"}),a.length>0&&(0,n.jsx)("button",{type:"button",onClick:()=>M(e=>!e),disabled:s||o,className:"px-3 py-1.5 text-xs font-medium border border-rule-2 text-ink-3 rounded-md hover:border-rule hover:text-ink disabled:opacity-40",children:R?"Cancel":"Switch credential"}),(0,n.jsx)("button",{type:"button",onClick:()=>x(!0),disabled:s||o,className:"px-3 py-1.5 text-xs font-medium border border-err/30 text-err rounded-md hover:border-err/30 hover:text-err disabled:opacity-40",children:"Disconnect"})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{type:"button",onClick:()=>L(e=>!e),disabled:s,className:"px-3 py-1.5 text-xs font-medium border border-rule-2 text-ink-3 rounded-md hover:border-rule hover:text-ink disabled:opacity-40",children:Z?"Cancel":"Rotate key"}),(0,n.jsx)("button",{type:"button",onClick:()=>x(!0),disabled:s,className:"px-3 py-1.5 text-xs font-medium border border-err/30 text-err rounded-md hover:border-err/30 hover:text-err disabled:opacity-40",children:"Delete"})]})})]}),D&&Z&&(0,n.jsxs)("div",{className:"space-y-3 pt-2 border-t border-rule-2",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{htmlFor:`rotate-${e.id}`,className:"block text-xs text-ink-3 mb-1",children:"New API key"}),(0,n.jsx)("input",{id:`rotate-${e.id}`,type:"password",autoComplete:"off",autoFocus:!0,value:$,onChange:e=>F(e.target.value),onKeyDown:e=>{"Enter"===e.key&&W(),"Escape"===e.key&&(F(""),L(!1))},placeholder:"Paste the new key",className:"w-full bg-hover border border-rule rounded-md px-2 py-1.5 text-sm text-ink placeholder:text-ink-4 focus:border-ink-3 focus:outline-none font-mono"}),(0,n.jsx)("p",{className:"text-[11px] text-ink-4 mt-1",children:"Agent assignments stay intact — only the stored key changes."})]}),(0,n.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,n.jsx)("button",{type:"button",onClick:W,disabled:s||!$.trim(),className:"px-4 py-2 text-sm font-semibold bg-ink text-canvas rounded-md hover:brightness-[0.92] disabled:opacity-50",children:s?"Saving…":"Save new key"}),(0,n.jsx)("button",{type:"button",onClick:()=>{F(""),L(!1)},className:"text-xs text-ink-3 hover:text-ink underline",children:"Cancel"})]})]}),t.docsHint&&(0,n.jsx)("p",{className:"text-xs text-ink-3",children:t.docsHint}),_&&O&&(0,n.jsxs)("div",{className:"pt-2 border-t border-rule-2 space-y-2",children:[B&&(0,n.jsxs)("p",{className:"text-xs text-ink-3",children:["Credential: ",(0,n.jsx)("span",{className:"text-ink font-medium",children:B})]}),K&&(0,n.jsx)("div",{className:"flex flex-wrap gap-1",children:K.split(/\s+/).map(e=>(0,n.jsx)("span",{className:"px-1.5 py-0.5 bg-hover text-ink-3 rounded text-[10px] font-mono",children:e},e))}),H&&(0,n.jsx)("p",{className:"text-xs text-ink-3",children:"Auto-refreshes when used"}),!H&&G&&(0,n.jsx)("p",{className:`text-xs ${V?"text-warn":"text-ink-3"}`,children:function(e){let t;if(!e)return"";let a=Math.round((e.getTime()-Date.now())/1e3),n=Math.abs(a);return t=n<60?`${n}s`:n<3600?`${Math.round(n/60)} min`:n<86400?`${Math.round(n/3600)} h`:`${Math.round(n/86400)} d`,a>=0?`expires in ${t}`:`expired ${t} ago`}(G)})]}),_&&R&&(0,n.jsx)("div",{className:"space-y-3 pt-2 border-t border-rule-2",children:a.length>0?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-xs text-ink-3 mb-1",children:"Use credential"}),(0,n.jsx)("select",{value:E,onChange:e=>T(e.target.value),className:"w-full bg-hover border border-rule rounded-md px-2 py-1.5 text-sm text-ink focus:border-ink-3 focus:outline-none",children:a.map(e=>(0,n.jsxs)("option",{value:e.id,children:[e.name,e.accountName?` (${e.accountName})`:""]},e.id))})]}),(0,n.jsxs)("div",{className:"flex gap-2 items-center pt-1",children:[(0,n.jsx)("button",{type:"button",onClick:()=>E&&void i(async()=>{let t=await f(e.id,E);t.ok?(p.oR.success(`${e.name} credential updated`),M(!1)):p.oR.error(t.message)}),disabled:s||!E,className:"px-4 py-2 text-sm font-semibold bg-ink text-canvas rounded-md hover:brightness-[0.92] disabled:opacity-50",children:s?"Saving…":"Save"}),(0,n.jsx)("button",{type:"button",onClick:()=>{M(!1),m(!0)},className:"px-3 py-1.5 text-xs text-ink-3 hover:text-ink underline",children:"or create new"})]})]}):(0,n.jsxs)("p",{className:"text-xs text-ink-3",children:["No compatible credentials found."," ",(0,n.jsx)("button",{type:"button",onClick:()=>{M(!1),m(!0)},className:"text-indigo-400 hover:text-indigo-300 underline",children:"Create one"})]})}),(0,n.jsx)(k.A,{open:d,title:`${_?"Disconnect":"Delete"} "${e.name}"?`,message:_?"Tools that depend on this connector will fail until you reconnect. Existing job history is preserved.":"This connector instance will be permanently removed. Existing job history is preserved.",confirmLabel:_?"Disconnect":"Delete",onConfirm:function(){x(!1),i(async()=>{let t=await b(e.id);t.ok?p.oR.success(`${e.name} removed`):p.oR.error(t.message)})},onCancel:()=>x(!1)}),u&&P&&(0,n.jsx)(j.A,{initialType:P,returnToConnectorSlug:t.slug,onClose:()=>m(!1)})]})}var w=a(21021);function C({instances:e,credsByType:t}){return(0,n.jsx)("div",{className:"overflow-hidden rounded-2xl border border-rule-2 bg-paper",children:(0,n.jsxs)("table",{className:"w-full border-collapse",children:[(0,n.jsx)("thead",{children:(0,n.jsxs)("tr",{children:[(0,n.jsx)(S,{label:"Provider"}),(0,n.jsx)(S,{label:"Account"}),(0,n.jsx)(S,{label:"Scopes"}),(0,n.jsx)(S,{label:"Status"}),(0,n.jsx)(S,{label:"Actions",align:"right"})]})}),(0,n.jsx)("tbody",{children:e.map(e=>{let a=d.YT.find(t=>t.slug===e.slug),r=a?{...a,credentialType:a.credentialType??null}:{slug:e.slug,label:e.name,authType:e.authType,docsHint:"",credentialType:e.credentialType??null},l=r.credentialType?t[r.credentialType]??[]:[];return(0,n.jsx)(R,{instance:e,catalogEntry:r,compatibleCredentials:l},e.id)})})]})})}function S({label:e,align:t="left"}){return(0,n.jsx)("th",{className:`border-b border-rule-2 px-[18px] pt-3.5 pb-2.5 font-mono text-[9.5px] font-normal whitespace-nowrap uppercase tracking-[0.16em] text-ink-4 ${"right"===t?"text-right":"text-left"}`,scope:"col",children:e})}function R({instance:e,catalogEntry:t,compatibleCredentials:a}){let[l,s]=(0,r.useState)(!1),i=w.a[e.slug],o=(0,w.d)(e.slug,t.label),c=e.active,d=e.credentialScopes?e.credentialScopes.split(/\s+/).filter(Boolean):[];return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("tr",{className:"border-b border-rule-2 last:border-0 hover:bg-hover",children:[(0,n.jsx)("td",{className:"px-[18px] py-[13px] align-middle",children:(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsx)(x.A,{variant:"conn",size:"sm",shape:"square",background:i,children:(0,n.jsx)("span",{className:"font-mono text-[10px] font-semibold tracking-[0.04em]",children:o})}),(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("div",{className:"text-[13.5px] font-medium leading-[1.2] text-ink",children:t.label}),(0,n.jsx)("div",{className:"mt-0.5 font-mono text-[10.5px] uppercase tracking-[0.12em] text-ink-4",children:t.authType})]})]})}),(0,n.jsx)("td",{className:"px-[18px] py-[13px] align-middle",children:(0,n.jsx)("span",{className:"font-sans text-[13px] leading-[1.3] text-ink-2",children:e.credentialAccountName??e.name})}),(0,n.jsx)("td",{className:"px-[18px] py-[13px] align-middle",children:d.length>0?(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[d.slice(0,4).map(e=>(0,n.jsx)(u.A,{children:e},e)),d.length>4&&(0,n.jsxs)("span",{className:"font-mono text-[11px] text-ink-4",children:["+",d.length-4]})]}):(0,n.jsx)("span",{className:"font-mono text-[11px] text-ink-4",children:"api_key"===e.authType?"api_key":"—"})}),(0,n.jsx)("td",{className:"px-[18px] py-[13px] align-middle",children:(0,n.jsx)(m.A,{variant:c?"done":"warn",label:c?"Connected":"Needs auth"})}),(0,n.jsx)("td",{className:"px-[18px] py-[13px] align-middle",children:(0,n.jsx)("div",{className:"flex items-center justify-end gap-2",children:(0,n.jsx)("button",{type:"button",onClick:()=>s(e=>!e),className:"inline-flex h-[30px] items-center gap-1.5 rounded-[7px] border border-rule bg-paper px-3 text-[12px] font-medium leading-none text-ink-2 transition-colors hover:bg-hover hover:text-ink",children:l?"Close":"Configure"})})})]}),l&&(0,n.jsx)("tr",{className:"border-b border-rule-2 last:border-0 bg-hover/40",children:(0,n.jsx)("td",{colSpan:5,className:"px-[18px] py-3",children:(0,n.jsx)(A,{instance:e,catalogEntry:t,compatibleCredentials:a})})})]})}var M=a(27540),E=a(40319),T=a(42357),Z=a(37820),L=a(16237),$=a(13260);let F=(0,h.createServerReference)("402d0472dc019335cd4c5fe97bebaeb18ad96af5ee",h.callServer,void 0,h.findSourceMapURL,"saveApiKeyConnectorAction"),D=(0,h.createServerReference)("70fc0d769386dec2ad11c3269f562ca2c1e2871493",h.callServer,void 0,h.findSourceMapURL,"createOrAssignOAuthConnectorAction");var _=a(36762),I=a(10900);function H({catalogItem:e,compatibleCredentials:t,onDone:a,onCreateNew:l}){let[s,i]=(0,r.useTransition)(),[o,c]=(0,r.useState)(t[0]?.id??""),d="api_key"===e.authType,x="oauth2"===e.authType;return d?(0,n.jsxs)("form",{onSubmit:function(t){t.preventDefault();let n=new FormData(t.currentTarget),r=n.get("name")?.trim()??"",l=n.get("apiKey")?.trim()??"";r?l?i(async()=>{let t=await F({slug:e.slug,name:r,apiKey:l});t.ok?(p.oR.success(`${r} connected`),a?.()):p.oR.error(t.message)}):p.oR.error("API key is required"):p.oR.error("Name is required")},className:"space-y-3",children:[(0,n.jsxs)("div",{children:[(0,n.jsxs)("label",{htmlFor:`add-name-${e.slug}`,className:"block text-xs text-ink-3 mb-1",children:["Name ",(0,n.jsx)("span",{className:"text-ink-4",children:'(e.g. "Notion — perso")'})]}),(0,n.jsx)("input",{id:`add-name-${e.slug}`,name:"name",required:!0,placeholder:e.label,className:"w-full bg-hover border border-rule rounded-md px-2 py-1.5 text-sm text-ink placeholder:text-ink-4 focus:border-ink-3 focus:outline-none"})]}),I.m[e.slug]&&(0,n.jsxs)("details",{className:"group text-xs",children:[(0,n.jsx)("summary",{className:"cursor-pointer text-ink-3 hover:text-ink-2",children:"Where do I get this?"}),(0,n.jsx)("div",{className:"mt-3 pl-1",children:(0,n.jsx)(_.A,{guide:I.m[e.slug]})})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{htmlFor:`add-apikey-${e.slug}`,className:"block text-xs text-ink-3 mb-1",children:"API key"}),(0,n.jsx)("input",{id:`add-apikey-${e.slug}`,name:"apiKey",type:"password",required:!0,autoComplete:"off",className:"w-full bg-hover border border-rule rounded-md px-2 py-1.5 text-sm text-ink placeholder:text-ink-4 focus:border-ink-3 focus:outline-none font-mono"})]}),(0,n.jsx)("div",{className:"pt-1",children:(0,n.jsx)("button",{type:"submit",disabled:s,className:"px-4 py-2 text-sm font-semibold bg-ink text-canvas rounded-md hover:brightness-[0.92] disabled:opacity-50",children:s?"Connecting…":"Connect"})})]}):x&&t.length>0?(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-xs text-ink-3 mb-1",children:"Use existing credential"}),(0,n.jsx)("select",{value:o,onChange:e=>c(e.target.value),className:"w-full bg-hover border border-rule rounded-md px-2 py-1.5 text-sm text-ink focus:border-ink-3 focus:outline-none",children:t.map(e=>(0,n.jsxs)("option",{value:e.id,children:[e.name,e.accountName?` (${e.accountName})`:""]},e.id))})]}),(0,n.jsxs)("div",{className:"flex gap-2 items-center pt-1",children:[(0,n.jsx)("button",{type:"button",onClick:()=>o&&void i(async()=>{let t=await D(e.slug,o);t.ok?(p.oR.success(`${e.label} connected`),a?.()):p.oR.error(t.message)}),disabled:s||!o,className:"px-4 py-2 text-sm font-semibold bg-ink text-canvas rounded-md hover:brightness-[0.92] disabled:opacity-50",children:s?"Connecting…":"Connect"}),(0,n.jsx)("button",{type:"button",onClick:()=>l?.(),className:"px-3 py-1.5 text-xs text-ink-3 hover:text-ink underline",children:"or create new"})]})]}):(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsx)("p",{className:"text-xs text-ink-3",children:e.docsHint}),(0,n.jsx)("button",{type:"button",onClick:()=>l?.(),className:"px-4 py-2 text-sm font-semibold bg-ink text-canvas rounded-md hover:brightness-[0.92]",children:"Create credential"})]})}function P(e){return e.startsWith("google-")||"gmail"===e||"notion"===e||"notion-oauth"===e||"airtable"===e||"airtable-oauth"===e?"Productivity":"github"===e||"linear"===e?"DevTools":"hubspot"===e?"CRM":"slack"===e||"intercom"===e?"Comms":"apify"===e||"firecrawl"===e||"tavily"===e||"stripe"===e||"postgres"===e?"Data":"Other"}let O=[{value:"All",label:"All"},{value:"CRM",label:"CRM"},{value:"Productivity",label:"Productivity"},{value:"Data",label:"Data"},{value:"DevTools",label:"DevTools"},{value:"Comms",label:"Comms"},{value:"Other",label:"Other"}];function B({catalog:e,instances:t,credsByType:a,category:r,onCategoryChange:l}){return(0,n.jsxs)("div",{children:[(0,n.jsx)(T.A,{items:O,value:r,onChange:l,className:"mb-[18px]"}),0===e.length?(0,n.jsx)("div",{className:"rounded-2xl border border-rule-2 bg-paper px-6 py-12 text-center",children:(0,n.jsx)("p",{className:"text-[13px] text-ink-3",children:"No connectors in this category."})}):(0,n.jsx)("div",{className:"grid auto-rows-fr grid-cols-1 gap-3.5 md:grid-cols-2 lg:grid-cols-4",children:e.map(e=>{let r=t.filter(t=>t.slug===e.slug),l=r.length>0,s=e.credentialType?a[e.credentialType]??[]:[];return(0,n.jsx)(U,{catalogItem:e,isInstalled:l,installedCount:r.length,compatibleCredentials:s},e.slug)})})]})}function U({catalogItem:e,isInstalled:t,installedCount:a,compatibleCredentials:l}){let[s,i]=(0,r.useState)(!1),[o,c]=(0,r.useState)(!1),d=(0,M.useRouter)(),x=w.a[e.slug],u=(0,w.d)(e.slug,e.label),m=P(e.slug),p="oauth2"===e.authType&&0===l.length;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Z.A,{glyph:(0,n.jsx)("span",{className:"font-mono text-[10px] font-semibold tracking-[0.04em]",children:u}),glyphVariant:"conn",glyphBackground:x,name:e.label,description:e.docsHint,category:m,topRight:t?(0,n.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-[6px] bg-ok-bg px-2 py-1 font-sans text-[11px] font-medium text-ok",children:[(0,n.jsx)(E.r,{size:11,weight:"regular"}),a," installed"]}):void 0,foot:(0,n.jsx)(L.A,{ctaLabel:t?"Add account":"Install",ctaVariant:"blue",onCta:()=>p?c(!0):i(!0)})}),(0,n.jsx)($.A,{open:s,onClose:()=>i(!1),title:t?`Add account — ${e.label}`:`Install ${e.label}`,children:(0,n.jsx)(H,{catalogItem:e,compatibleCredentials:l,onDone:function(){i(!1),d.refresh()},onCreateNew:()=>{i(!1),c(!0)}})}),o&&e.credentialType&&(0,n.jsx)(j.A,{initialType:e.credentialType,returnToConnectorSlug:e.slug,onClose:()=>c(!1)})]})}function G({instances:e,catalog:t,credsByType:a}){let[d,x]=(0,r.useState)(e.length>0?"installed":"marketplace"),[u,m]=(0,r.useState)(""),[p,h]=(0,r.useState)("All"),b=(0,r.useMemo)(()=>{if(!u.trim())return e;let t=u.toLowerCase();return e.filter(e=>e.name.toLowerCase().includes(t)||e.slug.toLowerCase().includes(t)||(e.credentialAccountName??"").toLowerCase().includes(t))},[e,u]),g=(0,r.useMemo)(()=>{let e=t;if("All"!==p&&(e=e.filter(e=>P(e.slug)===p)),u.trim()){let t=u.toLowerCase();e=e.filter(e=>e.label.toLowerCase().includes(t)||e.slug.toLowerCase().includes(t))}return e},[t,p,u]);return(0,n.jsxs)("div",{className:"pb-10",children:[(0,n.jsx)(l.A,{title:"API Connectors",subtitle:"Wire your agents to external services — Gmail, Slack, HubSpot, and the rest. Browse the marketplace or manage the accounts you've already connected."}),(0,n.jsx)(s.A,{tabs:(0,n.jsx)(i.A,{value:d,onChange:e=>{x(e),m(""),h("All")},tabs:[{value:"installed",label:"Installed",count:e.length},{value:"marketplace",label:"Marketplace",count:t.length}]}),search:(0,n.jsx)(o.A,{value:u,onChange:m,placeholder:"installed"===d?"Search connectors…":"Search providers…"}),cta:(0,n.jsx)(c.A,{variant:"ink",href:"/credentials",children:"Manage credentials"})}),(0,n.jsx)("div",{className:"pt-5",children:"installed"===d?0===e.length?(0,n.jsx)(K,{onBrowse:()=>x("marketplace")}):0===b.length?(0,n.jsx)(V,{}):(0,n.jsx)(C,{instances:b,credsByType:a}):(0,n.jsx)(B,{catalog:g,instances:e,credsByType:a,category:p,onCategoryChange:h})})]})}function K({onBrowse:e}){return(0,n.jsxs)("div",{className:"rounded-2xl border border-rule-2 bg-paper px-6 py-12 text-center",children:[(0,n.jsxs)("p",{className:"text-[13px] leading-[1.5] text-ink-3",children:["No connectors installed yet.",(0,n.jsx)("br",{}),"Browse the Marketplace to add one."]}),(0,n.jsx)("div",{className:"mt-4 inline-flex",children:(0,n.jsx)(c.A,{variant:"blue",onClick:e,children:"Browse Marketplace"})})]})}function V(){return(0,n.jsx)("div",{className:"rounded-2xl border border-rule-2 bg-paper px-6 py-12 text-center",children:(0,n.jsx)("p",{className:"text-[13px] leading-[1.5] text-ink-3",children:"No connectors match your search."})})}},82592:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});var n=a(3680);let r={ok:"bg-ok",lime:"bg-agent-vivid",coral:"bg-skill-vivid",blue:"bg-conn-vivid"},l={ok:"animate-[blip_1.4s_ease-out_infinite]",lime:"animate-[blip-lime_1.5s_ease-out_infinite]",coral:"animate-[blip-coral_1.4s_ease-out_infinite]",blue:"animate-[blip-blue_1.4s_ease-out_infinite]"};function s({variant:e="ok",size:t="sm",animate:a=!0,className:i=""}){return(0,n.jsx)("span",{className:`inline-block shrink-0 rounded-full ${"sm"===t?"h-[7px] w-[7px]":"h-2 w-2"} ${r[e]} ${a?l[e]:""} ${i}`})}},86127:(e,t,a)=>{"use strict";a.d(t,{r:()=>i});var n=a(78604),r=a(5977),l=a(54935);let s=n.forwardRef((e,t)=>n.createElement(r.A,{ref:t,...e,weights:l.A}));s.displayName="CheckCircleIcon";let i=s},93275:(e,t,a)=>{"use strict";a.d(t,{default:()=>l});var n=a(3680),r=a(27540);function l({code:e,message:t}){let a=(0,r.useRouter)();return(0,n.jsx)("div",{role:"alert",className:"rounded-xl border border-err/30 bg-warn-bg px-5 py-4 text-sm text-err",children:(0,n.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,n.jsxs)("div",{className:"space-y-1.5 min-w-0",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{"aria-hidden":"true",className:"font-bold text-err",children:"!"}),(0,n.jsx)("p",{className:"font-semibold text-err",children:"OAuth connection failed"}),(0,n.jsx)("code",{className:"font-mono text-[10px] text-err/80 bg-warn-bg px-1.5 py-0.5 rounded",children:e})]}),(0,n.jsx)("p",{className:"text-err leading-relaxed",children:t})]}),(0,n.jsx)("button",{type:"button",onClick:function(){a.replace("/connectors")},"aria-label":"Dismiss",className:"shrink-0 text-err/70 hover:text-err transition-colors text-lg leading-none px-2 -mt-0.5",children:"\xd7"})]})})}},93606:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});var n=a(3680),r=a(86127),l=a(22089),s=a(82592);let i={done:"Done",warn:"Attention",run:"Running",idle:"Idle","lvl-info":"INFO","lvl-ok":"OK","lvl-warn":"WARN","lvl-err":"ERR"},o={done:"bg-ok-bg text-ok",warn:"bg-warn-bg text-warn",run:"bg-run-bg text-run",idle:"bg-black/5 text-ink-3 dark:bg-white/5","lvl-info":"bg-black/5 text-ink-3 dark:bg-white/5","lvl-ok":"bg-ok-bg text-ok","lvl-warn":"bg-warn-bg text-warn","lvl-err":"bg-warn-bg text-err"};function c({variant:e,label:t,icon:a,className:d=""}){let x=t??i[e],u=null;return void 0!==a?u=a:"done"===e?u=(0,n.jsx)(r.r,{size:11,weight:"regular"}):"warn"===e?u=(0,n.jsx)(l.N,{size:11,weight:"regular"}):"run"===e&&(u=(0,n.jsx)(s.A,{variant:"blue",size:"sm"})),(0,n.jsxs)("span",{className:`inline-flex h-[22px] items-center gap-1.5 rounded-[5px] px-2.5 text-[11px] font-medium leading-none ${o[e]} ${d}`,children:[u,x]})}}},e=>{e.O(0,[3363,9504,7025,9123,8396,8666,1065,8724,7358],()=>e(e.s=43158)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2771],{14308:(e,r,t)=>{"use strict";t.d(r,{A:()=>l});var n=t(3680),s=t(78604),a=t(51869);function l({open:e,title:r,message:t,confirmLabel:o="Confirm",cancelLabel:i="Cancel",destructive:d=!0,onConfirm:c,onCancel:u}){let b=(0,s.useRef)(null),[x,p]=(0,s.useState)(!1);return((0,s.useEffect)(()=>{p(!0)},[]),(0,s.useEffect)(()=>{if(e)return b.current?.focus(),window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r);function r(e){"Escape"===e.key&&u()}},[e,u]),e&&x)?(0,a.createPortal)((0,n.jsxs)("div",{role:"dialog","aria-modal":"true","aria-labelledby":"confirm-dialog-title",className:"fixed inset-0 z-50 flex items-center justify-center px-4 text-left",children:[(0,n.jsx)("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:u,"aria-hidden":"true"}),(0,n.jsxs)("div",{className:"relative bg-paper border border-rule-2 rounded-xl p-6 max-w-md w-full shadow-2xl",children:[(0,n.jsx)("h2",{id:"confirm-dialog-title",className:"text-base font-semibold text-ink",children:r}),t&&(0,n.jsx)("p",{className:"mt-2 text-sm text-ink-3 leading-relaxed",children:t}),(0,n.jsxs)("div",{className:"mt-6 flex justify-end gap-2",children:[(0,n.jsx)("button",{ref:b,type:"button",onClick:u,className:"px-4 py-2 text-sm font-medium border border-rule text-ink-2 rounded-lg hover:border-rule hover:text-ink transition-colors",children:i}),(0,n.jsx)("button",{type:"button",onClick:c,className:`px-4 py-2 text-sm font-semibold rounded-lg transition-colors ${d?"bg-err hover:brightness-[0.94] text-ink":"bg-ink hover:brightness-[0.92] text-canvas"}`,children:o})]})]})]}),document.body):null}},27540:(e,r,t)=>{"use strict";var n=t(71268);t.o(n,"usePathname")&&t.d(r,{usePathname:function(){return n.usePathname}}),t.o(n,"useRouter")&&t.d(r,{useRouter:function(){return n.useRouter}}),t.o(n,"useSearchParams")&&t.d(r,{useSearchParams:function(){return n.useSearchParams}})},52443:(e,r,t)=>{"use strict";t.d(r,{default:()=>c});var n=t(3680),s=t(78604),a=t(64678);let l=(0,a.createServerReference)("406b65614d4cacc360468c40774fa06b20027069fe",a.callServer,void 0,a.findSourceMapURL,"getJobStatusAction"),o={completed:{bg:"bg-ok-bg border border-ok/30",text:"text-ok",dot:"bg-ok",pulse:!1},failed:{bg:"bg-warn-bg border border-err/30",text:"text-err",dot:"bg-err",pulse:!1},processing:{bg:"bg-warn-bg border border-warn/30",text:"text-warn",dot:"bg-warn",pulse:!0},pending:{bg:"bg-hover border border-rule",text:"text-ink-3",dot:"bg-ink-3",pulse:!1},awaiting_approval:{bg:"bg-run-bg border border-run/30",text:"text-run",dot:"bg-run",pulse:!0},awaiting_delegation:{bg:"bg-run-bg border border-run/30",text:"text-run",dot:"bg-run",pulse:!0},cancelled:{bg:"bg-hover border border-rule",text:"text-ink-3",dot:"bg-ink-4",pulse:!1}};function i({status:e}){let r=o[e]??o.pending;return(0,n.jsxs)("span",{className:`inline-flex items-center gap-1.5 px-2 py-0.5 rounded-md text-xs font-semibold ${r.bg} ${r.text}`,children:[(0,n.jsx)("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${r.dot} ${r.pulse?"animate-pulse":""}`}),e]})}let d=new Set(["completed","failed","cancelled"]);function c({jobId:e,initialStatus:r}){let[t,a]=(0,s.useState)({status:r,result:null,error:null});return(0,s.useEffect)(()=>{if(d.has(t.status))return;let r=async()=>{let r=await l(e);r.ok&&a(r.data)},n=setInterval(()=>{r()},3e3);return()=>clearInterval(n)},[e,t.status]),(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsx)(i,{status:t.status}),!d.has(t.status)&&(0,n.jsx)("span",{className:"text-xs text-ink-4 animate-pulse",children:"Polling…"})]}),t.result&&(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"text-xs text-ink-3 font-semibold uppercase tracking-wider mb-1",children:"Result"}),(0,n.jsx)("pre",{className:"text-sm text-ink-2 whitespace-pre-wrap bg-paper rounded-lg p-4 border border-rule-2 max-h-80 overflow-auto",children:t.result})]}),t.error&&(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"text-xs text-err font-semibold uppercase tracking-wider mb-1",children:"Error"}),(0,n.jsx)("pre",{className:"text-sm text-err whitespace-pre-wrap bg-warn-bg rounded-lg p-4 border border-err/30",children:t.error})]})]})}},58001:(e,r,t)=>{"use strict";t.d(r,{default:()=>c});var n=t(3680),s=t(78604),a=t(27540),l=t(39504),o=t(14308),i=t(64678);let d=(0,i.createServerReference)("40cf8c4d455e06e10c47377dcd0525b8b750528bf8",i.callServer,void 0,i.findSourceMapURL,"cancelJobAction");function c({jobId:e}){let[r,t]=(0,s.useState)(!1),[i,u]=(0,s.useTransition)(),b=(0,a.useRouter)();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{type:"button",onClick:()=>t(!0),disabled:i,className:"inline-flex h-[30px] items-center gap-1.5 rounded-md border border-rule px-3 text-[12px] font-medium leading-none text-ink-3 transition-colors hover:border-warn/60 hover:bg-warn-bg hover:text-warn disabled:cursor-not-allowed disabled:opacity-50",children:i?"Cancelling…":"Cancel"}),(0,n.jsx)(o.A,{open:r,title:"Cancel this job?",message:"In-flight LLM turns will finish naturally — the loop bails at the next checkpoint. Use this to stop a job that's pending, awaiting, or stuck mid-execution.",confirmLabel:"Cancel job",cancelLabel:"Keep running",destructive:!0,onConfirm:function(){t(!1),u(async()=>{let r=await d(e);r.ok?(l.oR.success("Job cancelled"),b.refresh()):l.oR.error(r.message)})},onCancel:()=>t(!1)})]})}},64678:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={callServer:function(){return a.callServer},createServerReference:function(){return o.createServerReference},findSourceMapURL:function(){return l.findSourceMapURL}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});let a=t(22673),l=t(43145),o=t(87478)},82920:(e,r,t)=>{Promise.resolve().then(t.bind(t,58001)),Promise.resolve().then(t.bind(t,52443)),Promise.resolve().then(t.t.bind(t,63363,23))}},e=>{e.O(0,[3363,9504,1065,8724,7358],()=>e(e.s=82920)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8731],{5977:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});var l=a(78604);let n=l.forwardRef((e,t)=>{let{alt:a,color:n="currentColor",size:r="1em",weight:i="regular",mirrored:s=!1,children:o,weights:d,...c}=e;return l.createElement("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:r,height:r,fill:n,viewBox:"0 0 256 256",transform:s?"scale(-1, 1)":void 0,...c},!!a&&l.createElement("title",null,a),o,d.get(i))});n.displayName="SSRBase"},19349:(e,t,a)=>{Promise.resolve().then(a.bind(a,35196)),Promise.resolve().then(a.bind(a,77320))},22089:(e,t,a)=>{"use strict";a.d(t,{N:()=>s});var l=a(78604),n=a(5977);let r=new Map([["bold",l.createElement(l.Fragment,null,l.createElement("path",{d:"M240.26,186.1,152.81,34.23h0a28.74,28.74,0,0,0-49.62,0L15.74,186.1a27.45,27.45,0,0,0,0,27.71A28.31,28.31,0,0,0,40.55,228h174.9a28.31,28.31,0,0,0,24.79-14.19A27.45,27.45,0,0,0,240.26,186.1Zm-20.8,15.7a4.46,4.46,0,0,1-4,2.2H40.55a4.46,4.46,0,0,1-4-2.2,3.56,3.56,0,0,1,0-3.73L124,46.2a4.77,4.77,0,0,1,8,0l87.44,151.87A3.56,3.56,0,0,1,219.46,201.8ZM116,136V104a12,12,0,0,1,24,0v32a12,12,0,0,1-24,0Zm28,40a16,16,0,1,1-16-16A16,16,0,0,1,144,176Z"}))],["duotone",l.createElement(l.Fragment,null,l.createElement("path",{d:"M215.46,216H40.54C27.92,216,20,202.79,26.13,192.09L113.59,40.22c6.3-11,22.52-11,28.82,0l87.46,151.87C236,202.79,228.08,216,215.46,216Z",opacity:"0.2"}),l.createElement("path",{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z"}))],["fill",l.createElement(l.Fragment,null,l.createElement("path",{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM120,104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm8,88a12,12,0,1,1,12-12A12,12,0,0,1,128,192Z"}))],["light",l.createElement(l.Fragment,null,l.createElement("path",{d:"M235.07,189.09,147.61,37.22h0a22.75,22.75,0,0,0-39.22,0L20.93,189.09a21.53,21.53,0,0,0,0,21.72A22.35,22.35,0,0,0,40.55,222h174.9a22.35,22.35,0,0,0,19.6-11.19A21.53,21.53,0,0,0,235.07,189.09ZM224.66,204.8a10.46,10.46,0,0,1-9.21,5.2H40.55a10.46,10.46,0,0,1-9.21-5.2,9.51,9.51,0,0,1,0-9.72L118.79,43.21a10.75,10.75,0,0,1,18.42,0l87.46,151.87A9.51,9.51,0,0,1,224.66,204.8ZM122,144V104a6,6,0,0,1,12,0v40a6,6,0,0,1-12,0Zm16,36a10,10,0,1,1-10-10A10,10,0,0,1,138,180Z"}))],["regular",l.createElement(l.Fragment,null,l.createElement("path",{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z"}))],["thin",l.createElement(l.Fragment,null,l.createElement("path",{d:"M233.34,190.09,145.88,38.22h0a20.75,20.75,0,0,0-35.76,0L22.66,190.09a19.52,19.52,0,0,0,0,19.71A20.36,20.36,0,0,0,40.54,220H215.46a20.36,20.36,0,0,0,17.86-10.2A19.52,19.52,0,0,0,233.34,190.09ZM226.4,205.8a12.47,12.47,0,0,1-10.94,6.2H40.54a12.47,12.47,0,0,1-10.94-6.2,11.45,11.45,0,0,1,0-11.72L117.05,42.21a12.76,12.76,0,0,1,21.9,0L226.4,194.08A11.45,11.45,0,0,1,226.4,205.8ZM124,144V104a4,4,0,0,1,8,0v40a4,4,0,0,1-8,0Zm12,36a8,8,0,1,1-8-8A8,8,0,0,1,136,180Z"}))]]),i=l.forwardRef((e,t)=>l.createElement(n.A,{ref:t,...e,weights:r}));i.displayName="WarningIcon";let s=i},27540:(e,t,a)=>{"use strict";var l=a(71268);a.o(l,"usePathname")&&a.d(t,{usePathname:function(){return l.usePathname}}),a.o(l,"useRouter")&&a.d(t,{useRouter:function(){return l.useRouter}}),a.o(l,"useSearchParams")&&a.d(t,{useSearchParams:function(){return l.useSearchParams}})},32928:(e,t,a)=>{"use strict";a.d(t,{e:()=>s});var l=a(78604),n=a(53087);let r=new Map([["bold",l.createElement(l.Fragment,null,l.createElement("path",{d:"M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z"}))],["duotone",l.createElement(l.Fragment,null,l.createElement("path",{d:"M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z",opacity:"0.2"}),l.createElement("path",{d:"M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"}))],["fill",l.createElement(l.Fragment,null,l.createElement("path",{d:"M168,112a56,56,0,1,1-56-56A56,56,0,0,1,168,112Zm61.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88,88,0,1,1,11.32-11.31l50.06,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z"}))],["light",l.createElement(l.Fragment,null,l.createElement("path",{d:"M228.24,219.76l-51.38-51.38a86.15,86.15,0,1,0-8.48,8.48l51.38,51.38a6,6,0,0,0,8.48-8.48ZM38,112a74,74,0,1,1,74,74A74.09,74.09,0,0,1,38,112Z"}))],["regular",l.createElement(l.Fragment,null,l.createElement("path",{d:"M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"}))],["thin",l.createElement(l.Fragment,null,l.createElement("path",{d:"M226.83,221.17l-52.7-52.7a84.1,84.1,0,1,0-5.66,5.66l52.7,52.7a4,4,0,0,0,5.66-5.66ZM36,112a76,76,0,1,1,76,76A76.08,76.08,0,0,1,36,112Z"}))]]),i=l.forwardRef((e,t)=>l.createElement(n.A,{ref:t,...e,weights:r}));i.displayName="MagnifyingGlassIcon";let s=i},35196:(e,t,a)=>{"use strict";a.d(t,{default:()=>u});var l=a(3680),n=a(78604),r=a(63363),i=a.n(r);function s({tabs:e,value:t,defaultValue:a,onChange:r,variant:i="inset"}){let[o,d]=(0,n.useState)(t??a??e[0].value),c=t??o,m="inset"===i?"bg-paper text-ink shadow-[0_1px_2px_rgba(0,0,0,0.06)]":"bg-ink text-canvas";return(0,l.jsx)("div",{className:`inline-flex gap-0.5 rounded-md p-[3px] ${"inset"===i?"bg-black/[0.05]":"bg-black/[0.04]"}`,role:"tablist",children:e.map(e=>{let a=e.value===c;return(0,l.jsxs)("button",{type:"button",role:"tab","aria-selected":a,onClick:()=>{void 0===t&&d(e.value),r?.(e.value)},className:`inline-flex h-[26px] items-center gap-1.5 rounded-[6px] border-0 px-3 text-[11.5px] font-medium leading-none transition-colors ${a?m:"bg-transparent text-ink-3 hover:text-ink-2"}`,children:[e.label,void 0!==e.count&&(0,l.jsx)("span",{className:`font-mono text-[10px] ${a?"opacity-85":"opacity-65"}`,children:e.count})]},e.value)})})}var o=a(93606),d=a(99203),c=a(32928);let m=[{value:"All",label:"All"},{value:"Running",label:"Running"},{value:"Failed",label:"Failed"}];function u({jobs:e,agents:t,agentId:a}){let[r,h]=(0,n.useState)("All"),[p,g]=(0,n.useState)(""),b=(0,n.useMemo)(()=>new Map(t.map(e=>[e.id,e])),[t]),f=(0,n.useMemo)(()=>{let t=a?e.filter(e=>e.agentId===a):e;if("Running"===r?t=t.filter(e=>{let t=e.status??"";return"processing"===t||"pending"===t||t.startsWith("awaiting")}):"Failed"===r&&(t=t.filter(e=>"failed"===e.status||"cancelled"===e.status)),p.trim()){let e=p.toLowerCase();t=t.filter(t=>{let a=t.agentId?b.get(t.agentId)?.name??"":"";return t.task.toLowerCase().includes(e)||a.toLowerCase().includes(e)||t.channel.toLowerCase().includes(e)})}return t},[e,a,r,p,b]);return(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"mb-3.5 flex flex-wrap items-center gap-2.5",children:[(0,l.jsx)(s,{tabs:m,defaultValue:"All",variant:"dark-active",onChange:e=>h(e)}),(0,l.jsxs)("div",{className:"ml-auto flex h-[34px] min-w-[240px] items-center gap-2 rounded-md border border-rule-2 bg-paper px-3 text-[12.5px] text-ink-4",children:[(0,l.jsx)(c.e,{size:13,className:"shrink-0"}),(0,l.jsx)("input",{type:"search",value:p,onChange:e=>g(e.target.value),placeholder:"Search by task or agent…",className:"flex-1 border-0 bg-transparent text-[13px] leading-none text-ink outline-none placeholder:text-ink-4"})]})]}),(0,l.jsx)("div",{className:"overflow-hidden rounded-2xl border border-rule-2 bg-paper",children:0===f.length?(0,l.jsx)("div",{className:"px-6 py-12 text-center text-[13px] text-ink-4",children:0===e.length?"No runs yet. Use the form above to send your first task to an agent.":"No runs match the current filter."}):(0,l.jsx)("div",{className:"overflow-x-auto",children:(0,l.jsxs)("table",{className:"w-full border-collapse text-sm",children:[(0,l.jsx)("thead",{children:(0,l.jsxs)("tr",{children:[(0,l.jsx)(x,{children:"Agent"}),(0,l.jsx)(x,{children:"Task"}),(0,l.jsx)(x,{className:"hidden md:table-cell",children:"Channel"}),(0,l.jsx)(x,{className:"hidden lg:table-cell",children:"Started"}),(0,l.jsx)(x,{align:"right",children:"Status"})]})}),(0,l.jsx)("tbody",{children:f.map(e=>{var t,a,n,r;let s=e.agentId?b.get(e.agentId):null,c="completed"===(t=e.status)?"done":"failed"===t||"cancelled"===t?"warn":"processing"===t||"pending"===t||t?.startsWith("awaiting")?"run":"idle";return(0,l.jsxs)("tr",{className:"border-b border-dashed border-rule-2 last:border-0 hover:bg-hover transition-colors",children:[(0,l.jsx)("td",{className:"px-[18px] py-3 align-middle",children:s?(0,l.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,l.jsx)(d.A,{name:s.name,imageUrl:s.avatarUrl,size:"md",shape:"round"}),(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsx)("div",{className:"truncate text-[13px] font-medium leading-[1.2] text-ink",children:s.name}),(0,l.jsx)("div",{className:"truncate font-mono text-[10px] leading-none text-ink-4",children:s.slug})]})]}):(0,l.jsx)("span",{className:"font-mono text-[11px] text-ink-4",children:"—"})}),(0,l.jsx)("td",{className:"max-w-[320px] px-[18px] py-3 align-middle",children:(0,l.jsx)(i(),{href:`/jobs/${e.id}`,className:"line-clamp-1 text-[13px] text-ink-2 hover:text-ink transition-colors",title:e.task,children:(a=e.task).length>72?a.slice(0,72)+"…":a})}),(0,l.jsx)("td",{className:"hidden px-[18px] py-3 align-middle font-mono text-[11px] text-ink-4 md:table-cell",children:e.channel}),(0,l.jsx)("td",{className:"hidden px-[18px] py-3 align-middle font-mono text-[11px] text-ink-4 lg:table-cell",children:(n=e.createdAt)?("string"==typeof n?new Date(n):n).toLocaleString(void 0,{weekday:"short",hour:"2-digit",minute:"2-digit"}):"—"}),(0,l.jsx)("td",{className:"px-[18px] py-3 align-middle text-right",children:(0,l.jsx)(o.A,{variant:c,label:(r=e.status)?({pending:"Pending",processing:"Running",completed:"Done",failed:"Failed",awaiting_approval:"Awaiting",awaiting_delegation:"Awaiting",cancelled:"Cancelled"})[r]??r:"Pending"})})]},e.id)})})]})})})]})}function x({children:e,align:t="left",className:a=""}){return(0,l.jsx)("th",{className:`border-b border-rule-2 px-[18px] pt-1.5 pb-2.5 font-mono text-[9.5px] font-normal whitespace-nowrap uppercase tracking-[0.16em] text-ink-4 ${"right"===t?"text-right":"text-left"} ${a}`,children:e})}},53087:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var l=a(78604);let n=(0,l.createContext)({color:"currentColor",size:"1em",weight:"regular",mirrored:!1}),r=l.forwardRef((e,t)=>{let{alt:a,color:r,size:i,weight:s,mirrored:o,children:d,weights:c,...m}=e,{color:u="currentColor",size:x,weight:h="regular",mirrored:p=!1,...g}=l.useContext(n);return l.createElement("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:null!=i?i:x,height:null!=i?i:x,fill:null!=r?r:u,viewBox:"0 0 256 256",transform:o||p?"scale(-1, 1)":void 0,...g,...m},!!a&&l.createElement("title",null,a),d,c.get(null!=s?s:h))});r.displayName="IconBase"},54935:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});var l=a(78604);let n=new Map([["bold",l.createElement(l.Fragment,null,l.createElement("path",{d:"M176.49,95.51a12,12,0,0,1,0,17l-56,56a12,12,0,0,1-17,0l-24-24a12,12,0,1,1,17-17L112,143l47.51-47.52A12,12,0,0,1,176.49,95.51ZM236,128A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Z"}))],["duotone",l.createElement(l.Fragment,null,l.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),l.createElement("path",{d:"M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["fill",l.createElement(l.Fragment,null,l.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm45.66,85.66-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35a8,8,0,0,1,11.32,11.32Z"}))],["light",l.createElement(l.Fragment,null,l.createElement("path",{d:"M172.24,99.76a6,6,0,0,1,0,8.48l-56,56a6,6,0,0,1-8.48,0l-24-24a6,6,0,0,1,8.48-8.48L112,151.51l51.76-51.75A6,6,0,0,1,172.24,99.76ZM230,128A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",l.createElement(l.Fragment,null,l.createElement("path",{d:"M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["thin",l.createElement(l.Fragment,null,l.createElement("path",{d:"M170.83,101.17a4,4,0,0,1,0,5.66l-56,56a4,4,0,0,1-5.66,0l-24-24a4,4,0,0,1,5.66-5.66L112,154.34l53.17-53.17A4,4,0,0,1,170.83,101.17ZM228,128A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]])},64678:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l={callServer:function(){return r.callServer},createServerReference:function(){return s.createServerReference},findSourceMapURL:function(){return i.findSourceMapURL}};for(var n in l)Object.defineProperty(t,n,{enumerable:!0,get:l[n]});let r=a(22673),i=a(43145),s=a(87478)},77320:(e,t,a)=>{"use strict";a.d(t,{default:()=>d});var l=a(3680),n=a(78604),r=a(27540),i=a(39504),s=a(64678);let o=(0,s.createServerReference)("4009f2c76b78aa07f023a9dc32a2473dd3e025cb58",s.callServer,void 0,s.findSourceMapURL,"sendTaskAction");function d({agents:e}){let t=(0,n.useRef)(null),[a,s]=(0,n.useTransition)(),[c,m]=(0,n.useState)(!1),[u,x]=(0,n.useState)(""),h=(0,r.useRouter)(),p=e.find(e=>e.id===u);return c?(0,l.jsxs)("form",{ref:t,onSubmit:function(e){e.preventDefault();let a=Object.fromEntries(new FormData(e.currentTarget));s(async()=>{let e=await o(a);e.ok?(i.oR.success("Task sent — job created"),t.current?.reset(),m(!1),h.push(`/jobs/${e.data.jobId}`)):i.oR.error(e.message)})},className:"bg-paper border border-rule-2 rounded-xl p-5 space-y-4 max-w-lg",children:[(0,l.jsx)("h3",{className:"text-sm font-semibold text-ink",children:"Send a task"}),(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-xs text-ink-3 mb-1",htmlFor:"task-prompt",children:"Task description"}),(0,l.jsx)("textarea",{id:"task-prompt",name:"prompt",required:!0,rows:6,placeholder:"Summarise the last 10 emails from my inbox…",className:"w-full bg-hover border border-rule rounded-lg px-3 py-2 text-sm text-ink placeholder:text-ink-4 focus:border-ink-3 focus:outline-none resize-y min-h-[80px]"})]}),(0,l.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-xs text-ink-3 mb-1",htmlFor:"task-agent",children:"Assign to"}),(0,l.jsxs)("select",{id:"task-agent",name:"agentId",required:!0,value:u,onChange:e=>x(e.target.value),className:"w-full bg-hover border border-rule rounded-lg px-3 py-2 text-sm text-ink focus:border-ink-3 focus:outline-none",children:[(0,l.jsx)("option",{value:"",disabled:!0,children:"Select agent"}),e.map(e=>(0,l.jsxs)("option",{value:e.id,children:[e.name," (",e.slug,")"]},e.id))]})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-xs text-ink-3 mb-1",htmlFor:"task-priority",children:"Priority"}),(0,l.jsxs)("select",{id:"task-priority",name:"priority",defaultValue:"medium",className:"w-full bg-hover border border-rule rounded-lg px-3 py-2 text-sm text-ink focus:border-ink-3 focus:outline-none",children:[(0,l.jsx)("option",{value:"low",children:"Low"}),(0,l.jsx)("option",{value:"medium",children:"Medium"}),(0,l.jsx)("option",{value:"high",children:"High"})]})]})]}),p?.telegramBotToken&&p?.lastSeenChatIdTelegram&&(0,l.jsxs)("label",{className:"flex items-center gap-2 text-sm text-ink-2",children:[(0,l.jsx)("input",{type:"checkbox",name:"sendViaTelegram",value:"true",className:"rounded border border-rule bg-hover accent-white"}),"Send result via Telegram (chat: ",p.lastSeenChatIdTelegram,")"]}),(0,l.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,l.jsx)("button",{type:"submit",disabled:a,className:"px-4 py-2 text-sm font-semibold bg-ink text-canvas rounded-lg hover:brightness-[0.92] transition-colors disabled:opacity-50",children:a?"Sending…":"Send task"}),(0,l.jsx)("button",{type:"button",onClick:()=>m(!1),className:"px-4 py-2 text-sm font-medium border border-rule text-ink-3 rounded-lg hover:border-rule transition-colors",children:"Cancel"})]})]}):(0,l.jsx)("button",{onClick:()=>m(!0),className:"px-4 py-2 text-sm font-medium bg-ink text-canvas rounded-lg hover:brightness-[0.92] transition-colors",children:"+ Send task"})}},82592:(e,t,a)=>{"use strict";a.d(t,{A:()=>i});var l=a(3680);let n={ok:"bg-ok",lime:"bg-agent-vivid",coral:"bg-skill-vivid",blue:"bg-conn-vivid"},r={ok:"animate-[blip_1.4s_ease-out_infinite]",lime:"animate-[blip-lime_1.5s_ease-out_infinite]",coral:"animate-[blip-coral_1.4s_ease-out_infinite]",blue:"animate-[blip-blue_1.4s_ease-out_infinite]"};function i({variant:e="ok",size:t="sm",animate:a=!0,className:s=""}){return(0,l.jsx)("span",{className:`inline-block shrink-0 rounded-full ${"sm"===t?"h-[7px] w-[7px]":"h-2 w-2"} ${n[e]} ${a?r[e]:""} ${s}`})}},86127:(e,t,a)=>{"use strict";a.d(t,{r:()=>s});var l=a(78604),n=a(5977),r=a(54935);let i=l.forwardRef((e,t)=>l.createElement(n.A,{ref:t,...e,weights:r.A}));i.displayName="CheckCircleIcon";let s=i},93606:(e,t,a)=>{"use strict";a.d(t,{A:()=>d});var l=a(3680),n=a(86127),r=a(22089),i=a(82592);let s={done:"Done",warn:"Attention",run:"Running",idle:"Idle","lvl-info":"INFO","lvl-ok":"OK","lvl-warn":"WARN","lvl-err":"ERR"},o={done:"bg-ok-bg text-ok",warn:"bg-warn-bg text-warn",run:"bg-run-bg text-run",idle:"bg-black/5 text-ink-3 dark:bg-white/5","lvl-info":"bg-black/5 text-ink-3 dark:bg-white/5","lvl-ok":"bg-ok-bg text-ok","lvl-warn":"bg-warn-bg text-warn","lvl-err":"bg-warn-bg text-err"};function d({variant:e,label:t,icon:a,className:c=""}){let m=t??s[e],u=null;return void 0!==a?u=a:"done"===e?u=(0,l.jsx)(n.r,{size:11,weight:"regular"}):"warn"===e?u=(0,l.jsx)(r.N,{size:11,weight:"regular"}):"run"===e&&(u=(0,l.jsx)(i.A,{variant:"blue",size:"sm"})),(0,l.jsxs)("span",{className:`inline-flex h-[22px] items-center gap-1.5 rounded-[5px] px-2.5 text-[11px] font-medium leading-none ${o[e]} ${c}`,children:[u,m]})}},99203:(e,t,a)=>{"use strict";a.d(t,{A:()=>i});var l=a(3680),n=a(22575);let r={sm:{box:"h-6 w-6",text:"text-[9.5px]",px:24},md:{box:"h-[30px] w-[30px]",text:"text-[10.5px]",px:30},lg:{box:"h-[42px] w-[42px]",text:"text-[14px]",px:42}};function i({name:e,imageUrl:t,size:a="md",shape:s="round",className:o=""}){let d=r[a],c=`inline-flex shrink-0 items-center justify-center overflow-hidden bg-hover font-mono font-semibold tracking-[0.04em] text-ink-2 ${d.box} ${d.text} ${"round"===s?"rounded-full":"rounded-[8px]"} ${o}`;return t?(0,l.jsx)("span",{className:c,children:(0,l.jsx)(n.default,{src:t,alt:e,width:d.px,height:d.px,className:"h-full w-full object-cover"})}):(0,l.jsx)("span",{className:c,children:function(e){let t=e.trim();if(!t)return"?";let a=t.split(/\s+/);return a.length>=2?((a[0][0]??"")+(a[1][0]??"")).toUpperCase():t.slice(0,2).toUpperCase()}(e)})}}},e=>{e.O(0,[3363,9504,2575,1065,8724,7358],()=>e(e.s=19349)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9305],{8586:(e,t,n)=>{"use strict";n.d(t,{default:()=>I});var r=n(3680),i=n(78604),s=n(27540),a=n(71877),o=n(60352),l=n(38492),d=n(27245),c=n(30342),u=n(62089),x=n(37696),m=n(53054),p=n(58518),h=n(34484),f=n(34453),b=n(24792),g=n(37036),v=n(95543),k=n(76613),j=n(37223),N=n(54805),w=n(84976);function y(){return(0,r.jsx)("div",{className:"px-4 pb-3.5",children:(0,r.jsxs)("div",{className:"flex items-center gap-2 text-[16px] font-medium leading-none tracking-[-0.005em] text-ink",children:[(0,r.jsx)("span",{className:"flex h-[22px] w-[22px] items-center justify-center rounded-md bg-ink text-[11px] font-semibold leading-none tracking-[0.04em] text-canvas font-mono",children:"N"}),(0,r.jsx)("span",{children:"Nodal-Agents"})]})})}function S({children:e}){return(0,r.jsx)("div",{className:"px-3.5 pt-3.5 pb-1 font-mono text-[9.5px] uppercase tracking-[0.14em] text-ink-4",children:e})}var C=n(63363),_=n.n(C);let A={agent:"bg-agent-vivid",skill:"bg-skill-vivid",conn:"bg-conn-vivid"};function E({href:e,label:t,icon:n,dot:i,count:a,isActive:o}){let l=(0,s.usePathname)(),d=o??(l===e||l.startsWith(e+"/"));return(0,r.jsxs)(_(),{href:e,className:`group mx-2 flex h-[30px] items-center gap-2.5 rounded-lg px-2.5 text-[12.5px] leading-none transition-colors ${d?"bg-paper text-ink font-medium shadow-[0_1px_2px_rgba(0,0,0,0.04)]":"text-ink-2 hover:bg-hover"}`,children:[i?(0,r.jsx)("span",{className:`h-2 w-2 shrink-0 rounded-full ${A[i]}`}):(0,r.jsx)("span",{className:`flex h-3.5 w-3.5 shrink-0 items-center justify-center ${d?"text-ink":"text-ink-3 group-hover:text-ink-2"}`,children:n}),(0,r.jsx)("span",{className:"flex-1 truncate",children:t}),void 0!==a&&(0,r.jsx)("span",{className:"font-mono text-[10px] tracking-[0.02em] text-ink-4",children:a})]})}var $=n(82592);function z({runningAgents:e,throughput:t,fill:n=.36}){if(void 0===e)return null;let i=100*Math.max(0,Math.min(1,n));return(0,r.jsxs)("div",{className:"mx-3 mt-2.5 rounded-[10px] border border-rule-2 bg-paper px-3 pt-2.5 pb-3",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 font-mono text-[9.5px] uppercase leading-none tracking-[0.14em] text-ink-3",children:[(0,r.jsx)($.A,{variant:"lime"}),"Live"]}),(0,r.jsxs)("div",{className:"mt-1.5 text-[12.5px] leading-[1.35] text-ink-2",children:[(0,r.jsxs)("b",{className:"font-semibold text-ink",children:[e," agents"]}),t?` running \xb7 ${t}`:" running"]}),(0,r.jsx)("div",{className:"mt-2.5 h-[3px] overflow-hidden rounded-[2px] bg-black/[0.06] dark:bg-white/[0.06]",children:(0,r.jsx)("i",{className:"block h-full bg-agent-vivid",style:{width:`${i}%`}})})]})}var R=n(39504),P=n(49455),W=n(65816);function L({fleets:e,activeId:t,disabled:n,onChange:s,onNewWorkspace:a}){let[o,l]=(0,i.useState)(!1),d=(0,i.useRef)(null),c=e.find(e=>e.id===t)??e[0];return((0,i.useEffect)(()=>{if(!o)return;let e=e=>{d.current&&!d.current.contains(e.target)&&l(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[o]),c)?(0,r.jsxs)("div",{ref:d,className:"relative mx-3.5 mt-3.5 mb-1",children:[(0,r.jsxs)("button",{type:"button",onClick:()=>!n&&l(e=>!e),"aria-haspopup":"listbox","aria-expanded":o,"aria-disabled":n||void 0,className:`flex h-[38px] w-full items-center gap-2.5 rounded-[9px] border border-rule-2 bg-paper px-2.5 text-[13px] leading-none text-ink ${n?"cursor-default":"cursor-pointer hover:bg-hover-2/40"}`,children:[(0,r.jsx)("span",{className:"flex h-[22px] w-[22px] shrink-0 items-center justify-center rounded-[5px] font-mono text-[10.5px] font-semibold leading-none tracking-[0.04em] text-[#0a0a0a]",style:{background:c.color},children:c.icon??c.tag.slice(0,2)}),(0,r.jsx)("span",{className:"min-w-0 flex-1 truncate text-left text-[12.5px] font-medium text-ink",children:c.name}),!n&&(0,r.jsx)(P.a,{size:12,className:"shrink-0 text-ink-3"})]}),o&&!n&&(0,r.jsxs)("div",{role:"listbox",className:"absolute inset-x-0 top-[calc(100%+6px)] z-30 rounded-[9px] border border-rule-2 bg-paper p-1.5 shadow-[0_12px_32px_rgba(0,0,0,0.10)]",children:[e.map(e=>{let n=e.id===t;return(0,r.jsxs)("div",{role:"option","aria-selected":n,onClick:()=>{s?.(e.id),l(!1)},className:`flex cursor-pointer items-center gap-2.5 rounded-md px-2 py-1.5 text-[12.5px] leading-[1.2] text-ink-2 hover:bg-hover ${n?"bg-hover-2":""}`,children:[(0,r.jsx)("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center rounded-[5px] font-mono text-[10px] font-semibold leading-none tracking-[0.04em] text-[#0a0a0a]",style:{background:e.color},children:e.icon??e.tag.slice(0,2)}),(0,r.jsx)("span",{className:"min-w-0 flex-1 truncate font-medium text-ink",children:e.name}),(0,r.jsx)(W.J,{size:12,weight:"bold",className:`text-ink ${n?"opacity-100":"opacity-0"}`})]},e.id)}),a&&(0,r.jsxs)("button",{type:"button",onClick:()=>{l(!1),a()},className:"mt-1 flex w-full items-center gap-2 rounded-md border-t border-rule px-2 py-1.5 text-[12px] font-medium text-ink-3 hover:bg-hover hover:text-ink-2 transition-colors",children:[(0,r.jsx)("span",{className:"flex h-4 w-4 items-center justify-center rounded text-[12px] leading-none",children:"+"}),"New workspace"]})]})]}):null}var M=n(69811),O=n(42588),U=n(13154);let B=["#d4ff2e","#74b9ff","#a29bfe","#fd79a8","#55efc4","#fdcb6e","#e17055","#6c5ce7"];function F(e){return{id:e.id,name:e.name,tag:e.name.replace(/[^a-zA-Z0-9]/g,"").slice(0,3).toUpperCase()||"WS",color:function(e){let t=0;for(let n=0;n<e.length;n+=1)t=31*t+e.charCodeAt(n)>>>0;return B[t%B.length]??B[0]}(e.slug),icon:e.icon??void 0}}function T({workspaces:e}){let t=(0,s.useRouter)(),[n,a]=(0,i.useTransition)(),[o,l]=(0,i.useTransition)(),[d,c]=(0,i.useState)(!1),[u,x]=(0,i.useState)(""),[m,p]=(0,i.useState)(M.S[0]),h=(0,i.useRef)(null),f=e.map(F),b=e.find(e=>e.active),g=b?.id??f[0]?.id??"";return(0,r.jsxs)("div",{children:[(0,r.jsx)(L,{fleets:f,activeId:g,onChange:function(e){e===g||n||a(async()=>{let n=await (0,O.W)({id:e});n.ok?t.refresh():R.oR.error(n.message)})},disabled:n||0===f.length,onNewWorkspace:function(){c(!0),x(""),p(M.S[0]),requestAnimationFrame(()=>h.current?.focus())}}),d&&(0,r.jsxs)("form",{onSubmit:function(e){e.preventDefault();let n=u.trim();n&&l(async()=>{let e=await (0,U.O)({name:n,icon:m});if(!e.ok)return void R.oR.error(e.message);let r=await (0,O.W)({id:e.data.id});r.ok?(c(!1),x(""),R.oR.success(`Workspace "${n}" created`),t.refresh()):R.oR.error(r.message)})},className:"mx-3.5 mt-1 rounded-[9px] border border-rule-2 bg-paper p-2.5",children:[(0,r.jsx)("p",{className:"mb-1.5 font-mono text-[10px] uppercase tracking-[0.1em] text-ink-4",children:"New workspace"}),(0,r.jsx)("div",{className:"mb-2",children:(0,r.jsx)(M.A,{value:m,onChange:p,disabled:o})}),(0,r.jsxs)("div",{className:"flex gap-1.5",children:[(0,r.jsx)("input",{ref:h,type:"text",value:u,onChange:e=>x(e.target.value),placeholder:"Name…",maxLength:60,disabled:o,className:"min-w-0 flex-1 rounded-md border border-rule bg-canvas px-2.5 py-1.5 text-[12.5px] text-ink placeholder:text-ink-4 focus:border-ink-3 focus:outline-none disabled:opacity-50"}),(0,r.jsx)("button",{type:"submit",disabled:o||!u.trim(),className:"shrink-0 rounded-md bg-ink px-3 py-1.5 text-[12px] font-medium text-canvas hover:brightness-90 disabled:cursor-not-allowed disabled:opacity-50",children:o?"…":"Create"}),(0,r.jsx)("button",{type:"button",onClick:()=>c(!1),disabled:o,className:"shrink-0 rounded-md border border-rule px-2.5 py-1.5 text-[12px] text-ink-3 hover:border-rule-2 hover:text-ink-2 disabled:opacity-50",children:"✕"})]})]})]})}let D=[{section:"Overview",items:[{href:"/",label:"Home",icon:a.t},{href:"/chat",label:"Chat",icon:o.x},{href:"/jobs",label:"Runs",icon:l.T},{href:"/llm-providers",label:"LLM Providers",icon:d.R}]},{section:"Build",items:[{href:"/agents",label:"Agents",icon:c.n,dot:"agent"},{href:"/skills",label:"Skills",icon:u.f,dot:"skill"},{href:"/connectors",label:"API Connectors",icon:x.F,dot:"conn"},{href:"/mcp",label:"MCP Connectors",icon:m.X,dot:"conn"},{href:"/credentials",label:"Credentials",icon:p.U},{href:"/memories",label:"Memory",icon:h.j}]},{section:"Operate",items:[{href:"/automations",label:"Automation",icon:f.E},{href:"/approvals",label:"Approvals",icon:b.o},{href:"/logs",label:"Logs",icon:g.m}]},{section:"Workspace",items:[{href:"https://discord.gg/7UZsvZPgU",label:"Join Discord",external:!0},{href:"/billing",label:"Billing",icon:v.S},{href:"/settings",label:"Settings",icon:k._}]}];function I({workspaces:e,userMenu:t}){let n=(0,s.usePathname)(),[a,o]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{queueMicrotask(()=>o(!1))},[n]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"fixed top-0 right-0 left-0 z-40 flex items-center justify-between border-b border-rule-2 bg-sidebar px-4 py-3.5 lg:hidden",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 text-[14px] font-medium tracking-[-0.005em] text-ink",children:[(0,r.jsx)("span",{className:"flex h-[20px] w-[20px] items-center justify-center rounded-md bg-ink font-mono text-[10px] font-semibold text-canvas",children:"N"}),(0,r.jsx)("span",{children:"Nodal-Agents"})]}),(0,r.jsx)("button",{type:"button",onClick:()=>o(e=>!e),className:"text-ink-3 transition-colors hover:text-ink","aria-label":a?"Close menu":"Open menu",children:a?(0,r.jsx)(j.X,{size:20}):(0,r.jsx)(N.B,{size:20})})]}),a&&(0,r.jsx)("div",{className:"fixed inset-0 z-30 bg-black/40 lg:hidden",onClick:()=>o(!1),"aria-hidden":!0}),(0,r.jsxs)("aside",{className:`fixed top-0 left-0 z-40 flex h-full w-[220px] flex-col border-r border-rule-2 bg-sidebar pt-4 pb-3 transition-transform duration-200 lg:translate-x-0 ${a?"translate-x-0":"-translate-x-full"}`,children:[(0,r.jsx)(y,{}),(0,r.jsx)(T,{workspaces:e??[]}),(0,r.jsx)("nav",{className:"flex flex-1 flex-col overflow-y-auto py-1.5",children:D.map((e,t)=>(0,r.jsxs)("div",{children:[e.section&&(0,r.jsx)(S,{children:e.section}),e.items.map(e=>e.external?(0,r.jsxs)("a",{href:e.href,target:"_blank",rel:"noopener noreferrer",className:"group mx-2 flex h-[30px] items-center gap-2.5 rounded-lg bg-[#5865F2] px-2.5 text-[12.5px] font-medium leading-none text-white transition-[filter] hover:brightness-110",children:[(0,r.jsx)("span",{className:"flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:(0,r.jsx)(w.B,{size:14,weight:"bold"})}),(0,r.jsx)("span",{className:"flex-1 truncate",children:e.label})]},e.href):(0,r.jsx)(E,{href:e.href,label:e.label,icon:e.icon?(0,r.jsx)(e.icon,{size:14}):void 0,dot:e.dot,count:e.count,isActive:"/"===e.href?"/"===n:n===e.href||n.startsWith(e.href+"/")},e.href))]},t))}),(0,r.jsx)(z,{runningAgents:void 0}),t&&(0,r.jsx)("div",{className:"mt-2 border-t border-rule-2 px-3 pt-3","data-testid":"user-menu",children:t})]})]})}},10204:(e,t,n)=>{Promise.resolve().then(n.bind(n,8586)),Promise.resolve().then(n.bind(n,17345)),Promise.resolve().then(n.bind(n,64676)),Promise.resolve().then(n.bind(n,76556)),Promise.resolve().then(n.bind(n,11248)),Promise.resolve().then(n.t.bind(n,63363,23))},11248:(e,t,n)=>{"use strict";n.d(t,{default:()=>o});var r=n(3680),i=n(78604),s=n(32895),a=n(97713);function o(){let[e,t]=(0,i.useState)("light"),[n,o]=(0,i.useState)(!1);(0,i.useEffect)(()=>{t("u"<typeof document?"light":"dark"===document.documentElement.getAttribute("data-theme")?"dark":"light"),o(!0)},[]);let l="dark"===e?s.b:a.A,d="dark"===e?"Switch to light theme":"Switch to dark theme";return(0,r.jsx)("button",{type:"button",onClick:()=>{let n="dark"===e?"light":"dark";document.documentElement.setAttribute("data-theme",n);try{localStorage.setItem("nodal.theme",n)}catch{}t(n)},"aria-label":d,title:d,className:"flex h-[34px] w-[34px] items-center justify-center rounded-md border border-rule-2 bg-paper text-ink-2 transition-colors hover:text-ink",suppressHydrationWarning:!0,children:n?(0,r.jsx)(l,{size:15}):(0,r.jsx)(a.A,{size:15})})}},13154:(e,t,n)=>{"use strict";n.d(t,{O:()=>i});var r=n(64678);let i=(0,r.createServerReference)("40b5629a2c1493e3e6bd427fa18cae6532a7e3bdfb",r.callServer,void 0,r.findSourceMapURL,"createWorkspaceAction")},17345:(e,t,n)=>{"use strict";n.d(t,{default:()=>a});var r=n(3680),i=n(78604),s=n(50472);function a(){let[e,t]=(0,i.useState)(!1);async function n(){t(!0);try{let e=await fetch("/api/auth/sign-out",{method:"POST",headers:{"Content-Type":"application/json"},body:"{}",credentials:"same-origin"});e.ok||console.error("sign-out failed",e.status,await e.text().catch(()=>""))}catch(e){console.error("sign-out network error",e)}window.location.replace("/login")}return(0,r.jsx)("button",{type:"button",onClick:n,disabled:e,"data-testid":"user-menu-sign-out","aria-label":"Sign out",title:"Sign out",className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-ink-3 transition-colors hover:bg-hover hover:text-ink disabled:cursor-not-allowed disabled:opacity-40",children:(0,r.jsx)(s.M,{size:15})})}},42588:(e,t,n)=>{"use strict";n.d(t,{W:()=>i});var r=n(64678);let i=(0,r.createServerReference)("40c801d90e385a01ae9458120af744120248326b72",r.callServer,void 0,r.findSourceMapURL,"switchWorkspaceAction")},64676:(e,t,n)=>{"use strict";n.d(t,{default:()=>a});var r=n(3680),i=n(32928),s=n(78604);function a({placeholder:e="Search agents, skills, runs…",keyboardShortcut:t=!0,onSubmit:n,className:o=""}){let l=(0,s.useRef)(null);return(0,s.useEffect)(()=>{if(!t)return;let e=e=>{if("/"!==e.key)return;let t=e.target;t&&/^(input|textarea|select)$/i.test(t.tagName)||t?.isContentEditable||(e.preventDefault(),l.current?.focus())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[t]),(0,r.jsxs)("form",{onSubmit:e=>{e.preventDefault(),n?.(l.current?.value??"")},className:`flex h-[34px] min-w-[280px] items-center gap-2 rounded-md border border-rule-2 bg-paper px-3 text-[12.5px] text-ink-4 ${o}`,children:[(0,r.jsx)(i.e,{size:13,className:"shrink-0"}),(0,r.jsx)("input",{ref:l,type:"search",placeholder:e,className:"flex-1 border-0 bg-transparent text-[13px] leading-none text-ink outline-none placeholder:text-ink-4"}),(0,r.jsx)("span",{className:"rounded-[5px] border border-rule bg-black/5 px-1.5 py-[1px] font-mono text-[11px] leading-none text-ink-4 dark:bg-white/[0.06]",children:"/"})]})}},69811:(e,t,n)=>{"use strict";n.d(t,{A:()=>s,S:()=>i});var r=n(3680);let i=["\uD83D\uDDC2️","\uD83C\uDFE0","\uD83D\uDCBC","\uD83D\uDE80","\uD83E\uDDEA","\uD83C\uDFA8","\uD83D\uDCCA","\uD83D\uDEE0️","\uD83C\uDF10","⚡","\uD83E\uDD16","\uD83D\uDCE6"];function s({value:e,onChange:t,disabled:n}){return(0,r.jsx)("div",{className:"flex flex-wrap gap-1",children:i.map(i=>{let s=e===i;return(0,r.jsx)("button",{type:"button",disabled:n,"aria-pressed":s,onClick:()=>t(i),className:`flex h-8 w-8 items-center justify-center rounded-md border text-[15px] leading-none transition-colors disabled:opacity-50 ${s?"border-ink bg-hover-2":"border-rule-2 hover:bg-hover"}`,children:i},i)})})}},76556:(e,t,n)=>{"use strict";n.d(t,{default:()=>o});var r=n(3680),i=n(78604),s=n(39504);function a(){return"u"<typeof document?"light":"dark"===document.documentElement.getAttribute("data-theme")?"dark":"light"}function o(){let[e,t]=(0,i.useState)("light");return(0,i.useEffect)(()=>{t(a());let e=new MutationObserver(()=>t(a()));return e.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>e.disconnect()},[]),(0,r.jsx)(s.l$,{theme:e,position:"bottom-right",richColors:!0,closeButton:!0})}},82592:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(3680);let i={ok:"bg-ok",lime:"bg-agent-vivid",coral:"bg-skill-vivid",blue:"bg-conn-vivid"},s={ok:"animate-[blip_1.4s_ease-out_infinite]",lime:"animate-[blip-lime_1.5s_ease-out_infinite]",coral:"animate-[blip-coral_1.4s_ease-out_infinite]",blue:"animate-[blip-blue_1.4s_ease-out_infinite]"};function a({variant:e="ok",size:t="sm",animate:n=!0,className:o=""}){return(0,r.jsx)("span",{className:`inline-block shrink-0 rounded-full ${"sm"===t?"h-[7px] w-[7px]":"h-2 w-2"} ${i[e]} ${n?s[e]:""} ${o}`})}}},e=>{e.O(0,[3363,9504,9098,1065,8724,7358],()=>e(e.s=10204)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9305],{8586:(e,t,n)=>{"use strict";n.d(t,{default:()=>I});var r=n(3680),i=n(78604),s=n(27540),a=n(71877),o=n(60352),l=n(38492),c=n(27245),d=n(30342),u=n(62089),x=n(37696),m=n(53054),p=n(58518),h=n(34484),f=n(34453),b=n(24792),g=n(37036),v=n(95543),k=n(76613),j=n(37223),N=n(54805),w=n(84976);function y(){return(0,r.jsx)("div",{className:"px-4 pb-3.5",children:(0,r.jsxs)("div",{className:"flex items-center gap-2 text-[16px] font-medium leading-none tracking-[-0.005em] text-ink",children:[(0,r.jsx)("span",{className:"flex h-[22px] w-[22px] items-center justify-center rounded-md bg-ink text-[11px] font-semibold leading-none tracking-[0.04em] text-canvas font-mono",children:"N"}),(0,r.jsx)("span",{children:"Nodal-Agents"})]})})}function S({children:e}){return(0,r.jsx)("div",{className:"px-3.5 pt-3.5 pb-1 font-mono text-[9.5px] uppercase tracking-[0.14em] text-ink-4",children:e})}var C=n(63363),_=n.n(C);let A={agent:"bg-agent-vivid",skill:"bg-skill-vivid",conn:"bg-conn-vivid"};function E({href:e,label:t,icon:n,dot:i,count:a,isActive:o}){let l=(0,s.usePathname)(),c=o??(l===e||l.startsWith(e+"/"));return(0,r.jsxs)(_(),{href:e,className:`group mx-2 flex h-[30px] items-center gap-2.5 rounded-lg px-2.5 text-[12.5px] leading-none transition-colors ${c?"bg-paper text-ink font-medium shadow-[0_1px_2px_rgba(0,0,0,0.04)]":"text-ink-2 hover:bg-hover"}`,children:[i?(0,r.jsx)("span",{className:`h-2 w-2 shrink-0 rounded-full ${A[i]}`}):(0,r.jsx)("span",{className:`flex h-3.5 w-3.5 shrink-0 items-center justify-center ${c?"text-ink":"text-ink-3 group-hover:text-ink-2"}`,children:n}),(0,r.jsx)("span",{className:"flex-1 truncate",children:t}),void 0!==a&&(0,r.jsx)("span",{className:"font-mono text-[10px] tracking-[0.02em] text-ink-4",children:a})]})}var $=n(82592);function z({runningAgents:e,throughput:t,fill:n=.36}){if(void 0===e)return null;let i=100*Math.max(0,Math.min(1,n));return(0,r.jsxs)("div",{className:"mx-3 mt-2.5 rounded-[10px] border border-rule-2 bg-paper px-3 pt-2.5 pb-3",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 font-mono text-[9.5px] uppercase leading-none tracking-[0.14em] text-ink-3",children:[(0,r.jsx)($.A,{variant:"lime"}),"Live"]}),(0,r.jsxs)("div",{className:"mt-1.5 text-[12.5px] leading-[1.35] text-ink-2",children:[(0,r.jsxs)("b",{className:"font-semibold text-ink",children:[e," agents"]}),t?` running \xb7 ${t}`:" running"]}),(0,r.jsx)("div",{className:"mt-2.5 h-[3px] overflow-hidden rounded-[2px] bg-black/[0.06] dark:bg-white/[0.06]",children:(0,r.jsx)("i",{className:"block h-full bg-agent-vivid",style:{width:`${i}%`}})})]})}var R=n(39504),P=n(49455),W=n(65816);function L({fleets:e,activeId:t,disabled:n,onChange:s,onNewWorkspace:a}){let[o,l]=(0,i.useState)(!1),c=(0,i.useRef)(null),d=e.find(e=>e.id===t)??e[0];return((0,i.useEffect)(()=>{if(!o)return;let e=e=>{c.current&&!c.current.contains(e.target)&&l(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[o]),d)?(0,r.jsxs)("div",{ref:c,className:"relative mx-3.5 mt-3.5 mb-1",children:[(0,r.jsxs)("button",{type:"button",onClick:()=>!n&&l(e=>!e),"aria-haspopup":"listbox","aria-expanded":o,"aria-disabled":n||void 0,className:`flex h-[38px] w-full items-center gap-2.5 rounded-[9px] border border-rule-2 bg-paper px-2.5 text-[13px] leading-none text-ink ${n?"cursor-default":"cursor-pointer hover:bg-hover-2/40"}`,children:[(0,r.jsx)("span",{className:"flex h-[22px] w-[22px] shrink-0 items-center justify-center rounded-[5px] font-mono text-[10.5px] font-semibold leading-none tracking-[0.04em] text-[#0a0a0a]",style:{background:d.color},children:d.icon??d.tag.slice(0,2)}),(0,r.jsx)("span",{className:"min-w-0 flex-1 truncate text-left text-[12.5px] font-medium text-ink",children:d.name}),!n&&(0,r.jsx)(P.a,{size:12,className:"shrink-0 text-ink-3"})]}),o&&!n&&(0,r.jsxs)("div",{role:"listbox",className:"absolute inset-x-0 top-[calc(100%+6px)] z-30 rounded-[9px] border border-rule-2 bg-paper p-1.5 shadow-[0_12px_32px_rgba(0,0,0,0.10)]",children:[e.map(e=>{let n=e.id===t;return(0,r.jsxs)("div",{role:"option","aria-selected":n,onClick:()=>{s?.(e.id),l(!1)},className:`flex cursor-pointer items-center gap-2.5 rounded-md px-2 py-1.5 text-[12.5px] leading-[1.2] text-ink-2 hover:bg-hover ${n?"bg-hover-2":""}`,children:[(0,r.jsx)("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center rounded-[5px] font-mono text-[10px] font-semibold leading-none tracking-[0.04em] text-[#0a0a0a]",style:{background:e.color},children:e.icon??e.tag.slice(0,2)}),(0,r.jsx)("span",{className:"min-w-0 flex-1 truncate font-medium text-ink",children:e.name}),(0,r.jsx)(W.J,{size:12,weight:"bold",className:`text-ink ${n?"opacity-100":"opacity-0"}`})]},e.id)}),a&&(0,r.jsxs)("button",{type:"button",onClick:()=>{l(!1),a()},className:"mt-1 flex w-full items-center gap-2 rounded-md border-t border-rule px-2 py-1.5 text-[12px] font-medium text-ink-3 hover:bg-hover hover:text-ink-2 transition-colors",children:[(0,r.jsx)("span",{className:"flex h-4 w-4 items-center justify-center rounded text-[12px] leading-none",children:"+"}),"New workspace"]})]})]}):null}var M=n(69811),O=n(28511),U=n(57244);let B=["#d4ff2e","#74b9ff","#a29bfe","#fd79a8","#55efc4","#fdcb6e","#e17055","#6c5ce7"];function F(e){return{id:e.id,name:e.name,tag:e.name.replace(/[^a-zA-Z0-9]/g,"").slice(0,3).toUpperCase()||"WS",color:function(e){let t=0;for(let n=0;n<e.length;n+=1)t=31*t+e.charCodeAt(n)>>>0;return B[t%B.length]??B[0]}(e.slug),icon:e.icon??void 0}}function T({workspaces:e}){let t=(0,s.useRouter)(),[n,a]=(0,i.useTransition)(),[o,l]=(0,i.useTransition)(),[c,d]=(0,i.useState)(!1),[u,x]=(0,i.useState)(""),[m,p]=(0,i.useState)(M.S[0]),h=(0,i.useRef)(null),f=e.map(F),b=e.find(e=>e.active),g=b?.id??f[0]?.id??"";return(0,r.jsxs)("div",{children:[(0,r.jsx)(L,{fleets:f,activeId:g,onChange:function(e){e===g||n||a(async()=>{let n=await (0,O.W)({id:e});n.ok?t.refresh():R.oR.error(n.message)})},disabled:n||0===f.length,onNewWorkspace:function(){d(!0),x(""),p(M.S[0]),requestAnimationFrame(()=>h.current?.focus())}}),c&&(0,r.jsxs)("form",{onSubmit:function(e){e.preventDefault();let n=u.trim();n&&l(async()=>{let e=await (0,U.O)({name:n,icon:m});if(!e.ok)return void R.oR.error(e.message);let r=await (0,O.W)({id:e.data.id});r.ok?(d(!1),x(""),R.oR.success(`Workspace "${n}" created`),t.refresh()):R.oR.error(r.message)})},className:"mx-3.5 mt-1 rounded-[9px] border border-rule-2 bg-paper p-2.5",children:[(0,r.jsx)("p",{className:"mb-1.5 font-mono text-[10px] uppercase tracking-[0.1em] text-ink-4",children:"New workspace"}),(0,r.jsx)("div",{className:"mb-2",children:(0,r.jsx)(M.A,{value:m,onChange:p,disabled:o})}),(0,r.jsxs)("div",{className:"flex gap-1.5",children:[(0,r.jsx)("input",{ref:h,type:"text",value:u,onChange:e=>x(e.target.value),placeholder:"Name…",maxLength:60,disabled:o,className:"min-w-0 flex-1 rounded-md border border-rule bg-canvas px-2.5 py-1.5 text-[12.5px] text-ink placeholder:text-ink-4 focus:border-ink-3 focus:outline-none disabled:opacity-50"}),(0,r.jsx)("button",{type:"submit",disabled:o||!u.trim(),className:"shrink-0 rounded-md bg-ink px-3 py-1.5 text-[12px] font-medium text-canvas hover:brightness-90 disabled:cursor-not-allowed disabled:opacity-50",children:o?"…":"Create"}),(0,r.jsx)("button",{type:"button",onClick:()=>d(!1),disabled:o,className:"shrink-0 rounded-md border border-rule px-2.5 py-1.5 text-[12px] text-ink-3 hover:border-rule-2 hover:text-ink-2 disabled:opacity-50",children:"✕"})]})]})]})}let D=[{section:"Overview",items:[{href:"/",label:"Home",icon:a.t},{href:"/chat",label:"Chat",icon:o.x},{href:"/jobs",label:"Runs",icon:l.T},{href:"/llm-providers",label:"LLM Providers",icon:c.R}]},{section:"Build",items:[{href:"/agents",label:"Agents",icon:d.n,dot:"agent"},{href:"/skills",label:"Skills",icon:u.f,dot:"skill"},{href:"/connectors",label:"API Connectors",icon:x.F,dot:"conn"},{href:"/mcp",label:"MCP Connectors",icon:m.X,dot:"conn"},{href:"/credentials",label:"Credentials",icon:p.U},{href:"/memories",label:"Memory",icon:h.j}]},{section:"Operate",items:[{href:"/automations",label:"Automation",icon:f.E},{href:"/approvals",label:"Approvals",icon:b.o},{href:"/logs",label:"Logs",icon:g.m}]},{section:"Workspace",items:[{href:"https://discord.gg/7UZsvZPgU",label:"Join Discord",external:!0},{href:"/billing",label:"Billing",icon:v.S},{href:"/settings",label:"Settings",icon:k._}]}];function I({workspaces:e,userMenu:t}){let n=(0,s.usePathname)(),[a,o]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{queueMicrotask(()=>o(!1))},[n]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"fixed top-0 right-0 left-0 z-40 flex items-center justify-between border-b border-rule-2 bg-sidebar px-4 py-3.5 lg:hidden",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 text-[14px] font-medium tracking-[-0.005em] text-ink",children:[(0,r.jsx)("span",{className:"flex h-[20px] w-[20px] items-center justify-center rounded-md bg-ink font-mono text-[10px] font-semibold text-canvas",children:"N"}),(0,r.jsx)("span",{children:"Nodal-Agents"})]}),(0,r.jsx)("button",{type:"button",onClick:()=>o(e=>!e),className:"text-ink-3 transition-colors hover:text-ink","aria-label":a?"Close menu":"Open menu",children:a?(0,r.jsx)(j.X,{size:20}):(0,r.jsx)(N.B,{size:20})})]}),a&&(0,r.jsx)("div",{className:"fixed inset-0 z-30 bg-black/40 lg:hidden",onClick:()=>o(!1),"aria-hidden":!0}),(0,r.jsxs)("aside",{className:`fixed top-0 left-0 z-40 flex h-full w-[220px] flex-col border-r border-rule-2 bg-sidebar pt-4 pb-3 transition-transform duration-200 lg:translate-x-0 ${a?"translate-x-0":"-translate-x-full"}`,children:[(0,r.jsx)(y,{}),(0,r.jsx)(T,{workspaces:e??[]}),(0,r.jsx)("nav",{className:"flex flex-1 flex-col overflow-y-auto py-1.5",children:D.map((e,t)=>(0,r.jsxs)("div",{children:[e.section&&(0,r.jsx)(S,{children:e.section}),e.items.map(e=>e.external?(0,r.jsxs)("a",{href:e.href,target:"_blank",rel:"noopener noreferrer",className:"group mx-2 flex h-[30px] items-center gap-2.5 rounded-lg bg-[#5865F2] px-2.5 text-[12.5px] font-medium leading-none text-white transition-[filter] hover:brightness-110",children:[(0,r.jsx)("span",{className:"flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:(0,r.jsx)(w.B,{size:14,weight:"bold"})}),(0,r.jsx)("span",{className:"flex-1 truncate",children:e.label})]},e.href):(0,r.jsx)(E,{href:e.href,label:e.label,icon:e.icon?(0,r.jsx)(e.icon,{size:14}):void 0,dot:e.dot,count:e.count,isActive:"/"===e.href?"/"===n:n===e.href||n.startsWith(e.href+"/")},e.href))]},t))}),(0,r.jsx)(z,{runningAgents:void 0}),t&&(0,r.jsx)("div",{className:"mt-2 border-t border-rule-2 px-3 pt-3","data-testid":"user-menu",children:t})]})]})}},10204:(e,t,n)=>{Promise.resolve().then(n.bind(n,8586)),Promise.resolve().then(n.bind(n,17345)),Promise.resolve().then(n.bind(n,64676)),Promise.resolve().then(n.bind(n,76556)),Promise.resolve().then(n.bind(n,11248)),Promise.resolve().then(n.t.bind(n,63363,23))},11248:(e,t,n)=>{"use strict";n.d(t,{default:()=>o});var r=n(3680),i=n(78604),s=n(32895),a=n(97713);function o(){let[e,t]=(0,i.useState)("light"),[n,o]=(0,i.useState)(!1);(0,i.useEffect)(()=>{t("u"<typeof document?"light":"dark"===document.documentElement.getAttribute("data-theme")?"dark":"light"),o(!0)},[]);let l="dark"===e?s.b:a.A,c="dark"===e?"Switch to light theme":"Switch to dark theme";return(0,r.jsx)("button",{type:"button",onClick:()=>{let n="dark"===e?"light":"dark";document.documentElement.setAttribute("data-theme",n);try{localStorage.setItem("nodal.theme",n)}catch{}t(n)},"aria-label":c,title:c,className:"flex h-[34px] w-[34px] items-center justify-center rounded-md border border-rule-2 bg-paper text-ink-2 transition-colors hover:text-ink",suppressHydrationWarning:!0,children:n?(0,r.jsx)(l,{size:15}):(0,r.jsx)(a.A,{size:15})})}},17345:(e,t,n)=>{"use strict";n.d(t,{default:()=>a});var r=n(3680),i=n(78604),s=n(50472);function a(){let[e,t]=(0,i.useState)(!1);async function n(){t(!0);try{let e=await fetch("/api/auth/sign-out",{method:"POST",headers:{"Content-Type":"application/json"},body:"{}",credentials:"same-origin"});e.ok||console.error("sign-out failed",e.status,await e.text().catch(()=>""))}catch(e){console.error("sign-out network error",e)}window.location.replace("/login")}return(0,r.jsx)("button",{type:"button",onClick:n,disabled:e,"data-testid":"user-menu-sign-out","aria-label":"Sign out",title:"Sign out",className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-ink-3 transition-colors hover:bg-hover hover:text-ink disabled:cursor-not-allowed disabled:opacity-40",children:(0,r.jsx)(s.M,{size:15})})}},28511:(e,t,n)=>{"use strict";n.d(t,{W:()=>i});var r=n(64678);let i=(0,r.createServerReference)("40cbf23b485b0477c2fbdcffc6fcd45c4e64dc7b69",r.callServer,void 0,r.findSourceMapURL,"switchWorkspaceAction")},57244:(e,t,n)=>{"use strict";n.d(t,{O:()=>i});var r=n(64678);let i=(0,r.createServerReference)("404505375417085440a1ea853c50f33e5723dbbf0f",r.callServer,void 0,r.findSourceMapURL,"createWorkspaceAction")},64676:(e,t,n)=>{"use strict";n.d(t,{default:()=>a});var r=n(3680),i=n(32928),s=n(78604);function a({placeholder:e="Search agents, skills, runs…",keyboardShortcut:t=!0,onSubmit:n,className:o=""}){let l=(0,s.useRef)(null);return(0,s.useEffect)(()=>{if(!t)return;let e=e=>{if("/"!==e.key)return;let t=e.target;t&&/^(input|textarea|select)$/i.test(t.tagName)||t?.isContentEditable||(e.preventDefault(),l.current?.focus())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[t]),(0,r.jsxs)("form",{onSubmit:e=>{e.preventDefault(),n?.(l.current?.value??"")},className:`flex h-[34px] min-w-[280px] items-center gap-2 rounded-md border border-rule-2 bg-paper px-3 text-[12.5px] text-ink-4 ${o}`,children:[(0,r.jsx)(i.e,{size:13,className:"shrink-0"}),(0,r.jsx)("input",{ref:l,type:"search",placeholder:e,className:"flex-1 border-0 bg-transparent text-[13px] leading-none text-ink outline-none placeholder:text-ink-4"}),(0,r.jsx)("span",{className:"rounded-[5px] border border-rule bg-black/5 px-1.5 py-[1px] font-mono text-[11px] leading-none text-ink-4 dark:bg-white/[0.06]",children:"/"})]})}},69811:(e,t,n)=>{"use strict";n.d(t,{A:()=>s,S:()=>i});var r=n(3680);let i=["\uD83D\uDDC2️","\uD83C\uDFE0","\uD83D\uDCBC","\uD83D\uDE80","\uD83E\uDDEA","\uD83C\uDFA8","\uD83D\uDCCA","\uD83D\uDEE0️","\uD83C\uDF10","⚡","\uD83E\uDD16","\uD83D\uDCE6"];function s({value:e,onChange:t,disabled:n}){return(0,r.jsx)("div",{className:"flex flex-wrap gap-1",children:i.map(i=>{let s=e===i;return(0,r.jsx)("button",{type:"button",disabled:n,"aria-pressed":s,onClick:()=>t(i),className:`flex h-8 w-8 items-center justify-center rounded-md border text-[15px] leading-none transition-colors disabled:opacity-50 ${s?"border-ink bg-hover-2":"border-rule-2 hover:bg-hover"}`,children:i},i)})})}},76556:(e,t,n)=>{"use strict";n.d(t,{default:()=>o});var r=n(3680),i=n(78604),s=n(39504);function a(){return"u"<typeof document?"light":"dark"===document.documentElement.getAttribute("data-theme")?"dark":"light"}function o(){let[e,t]=(0,i.useState)("light");return(0,i.useEffect)(()=>{t(a());let e=new MutationObserver(()=>t(a()));return e.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>e.disconnect()},[]),(0,r.jsx)(s.l$,{theme:e,position:"bottom-right",richColors:!0,closeButton:!0})}},82592:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(3680);let i={ok:"bg-ok",lime:"bg-agent-vivid",coral:"bg-skill-vivid",blue:"bg-conn-vivid"},s={ok:"animate-[blip_1.4s_ease-out_infinite]",lime:"animate-[blip-lime_1.5s_ease-out_infinite]",coral:"animate-[blip-coral_1.4s_ease-out_infinite]",blue:"animate-[blip-blue_1.4s_ease-out_infinite]"};function a({variant:e="ok",size:t="sm",animate:n=!0,className:o=""}){return(0,r.jsx)("span",{className:`inline-block shrink-0 rounded-full ${"sm"===t?"h-[7px] w-[7px]":"h-2 w-2"} ${i[e]} ${n?s[e]:""} ${o}`})}}},e=>{e.O(0,[3363,9504,9098,1065,8724,7358],()=>e(e.s=10204)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[173],{14308:(e,t,a)=>{"use strict";a.d(t,{A:()=>i});var r=a(3680),n=a(78604),l=a(51869);function i({open:e,title:t,message:a,confirmLabel:s="Confirm",cancelLabel:o="Cancel",destructive:c=!0,onConfirm:d,onCancel:m}){let u=(0,n.useRef)(null),[p,x]=(0,n.useState)(!1);return((0,n.useEffect)(()=>{x(!0)},[]),(0,n.useEffect)(()=>{if(e)return u.current?.focus(),window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t);function t(e){"Escape"===e.key&&m()}},[e,m]),e&&p)?(0,l.createPortal)((0,r.jsxs)("div",{role:"dialog","aria-modal":"true","aria-labelledby":"confirm-dialog-title",className:"fixed inset-0 z-50 flex items-center justify-center px-4 text-left",children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:m,"aria-hidden":"true"}),(0,r.jsxs)("div",{className:"relative bg-paper border border-rule-2 rounded-xl p-6 max-w-md w-full shadow-2xl",children:[(0,r.jsx)("h2",{id:"confirm-dialog-title",className:"text-base font-semibold text-ink",children:t}),a&&(0,r.jsx)("p",{className:"mt-2 text-sm text-ink-3 leading-relaxed",children:a}),(0,r.jsxs)("div",{className:"mt-6 flex justify-end gap-2",children:[(0,r.jsx)("button",{ref:u,type:"button",onClick:m,className:"px-4 py-2 text-sm font-medium border border-rule text-ink-2 rounded-lg hover:border-rule hover:text-ink transition-colors",children:o}),(0,r.jsx)("button",{type:"button",onClick:d,className:`px-4 py-2 text-sm font-semibold rounded-lg transition-colors ${c?"bg-err hover:brightness-[0.94] text-ink":"bg-ink hover:brightness-[0.92] text-canvas"}`,children:s})]})]})]}),document.body):null}},27540:(e,t,a)=>{"use strict";var r=a(71268);a.o(r,"usePathname")&&a.d(t,{usePathname:function(){return r.usePathname}}),a.o(r,"useRouter")&&a.d(t,{useRouter:function(){return r.useRouter}}),a.o(r,"useSearchParams")&&a.d(t,{useSearchParams:function(){return r.useSearchParams}})},40189:(e,t,a)=>{"use strict";a.d(t,{F:()=>s});var r=a(78604),n=a(53087);let l=new Map([["bold",r.createElement(r.Fragment,null,r.createElement("path",{d:"M228,128a12,12,0,0,1-12,12H140v76a12,12,0,0,1-24,0V140H40a12,12,0,0,1,0-24h76V40a12,12,0,0,1,24,0v76h76A12,12,0,0,1,228,128Z"}))],["duotone",r.createElement(r.Fragment,null,r.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),r.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"}))],["fill",r.createElement(r.Fragment,null,r.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM184,136H136v48a8,8,0,0,1-16,0V136H72a8,8,0,0,1,0-16h48V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z"}))],["light",r.createElement(r.Fragment,null,r.createElement("path",{d:"M222,128a6,6,0,0,1-6,6H134v82a6,6,0,0,1-12,0V134H40a6,6,0,0,1,0-12h82V40a6,6,0,0,1,12,0v82h82A6,6,0,0,1,222,128Z"}))],["regular",r.createElement(r.Fragment,null,r.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"}))],["thin",r.createElement(r.Fragment,null,r.createElement("path",{d:"M220,128a4,4,0,0,1-4,4H132v84a4,4,0,0,1-8,0V132H40a4,4,0,0,1,0-8h84V40a4,4,0,0,1,8,0v84h84A4,4,0,0,1,220,128Z"}))]]),i=r.forwardRef((e,t)=>r.createElement(n.A,{ref:t,...e,weights:l}));i.displayName="PlusIcon";let s=i},53087:(e,t,a)=>{"use strict";a.d(t,{A:()=>l});var r=a(78604);let n=(0,r.createContext)({color:"currentColor",size:"1em",weight:"regular",mirrored:!1}),l=r.forwardRef((e,t)=>{let{alt:a,color:l,size:i,weight:s,mirrored:o,children:c,weights:d,...m}=e,{color:u="currentColor",size:p,weight:x="regular",mirrored:f=!1,...h}=r.useContext(n);return r.createElement("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:null!=i?i:p,height:null!=i?i:p,fill:null!=l?l:u,viewBox:"0 0 256 256",transform:o||f?"scale(-1, 1)":void 0,...h,...m},!!a&&r.createElement("title",null,a),c,d.get(null!=s?s:x))});l.displayName="IconBase"},63217:(e,t,a)=>{"use strict";function r(e){switch(e){case"openai-compatible":return"Local LLM";case"anthropic":return"Anthropic";case"openai":return"OpenAI";case"ollama":return"Ollama";case"openrouter":return"OpenRouter";case"google":return"Google";case"mistral":return"Mistral";case"groq":return"Groq";default:return e}}a.d(t,{R:()=>r})},64678:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={callServer:function(){return l.callServer},createServerReference:function(){return s.createServerReference},findSourceMapURL:function(){return i.findSourceMapURL}};for(var n in r)Object.defineProperty(t,n,{enumerable:!0,get:r[n]});let l=a(22673),i=a(43145),s=a(87478)},70397:(e,t,a)=>{Promise.resolve().then(a.bind(a,95568))},76613:(e,t,a)=>{"use strict";a.d(t,{_:()=>s});var r=a(78604),n=a(53087);let l=new Map([["bold",r.createElement(r.Fragment,null,r.createElement("path",{d:"M128,76a52,52,0,1,0,52,52A52.06,52.06,0,0,0,128,76Zm0,80a28,28,0,1,1,28-28A28,28,0,0,1,128,156Zm113.86-49.57A12,12,0,0,0,236,98.34L208.21,82.49l-.11-31.31a12,12,0,0,0-4.25-9.12,116,116,0,0,0-38-21.41,12,12,0,0,0-9.68.89L128,37.27,99.83,21.53a12,12,0,0,0-9.7-.9,116.06,116.06,0,0,0-38,21.47,12,12,0,0,0-4.24,9.1l-.14,31.34L20,98.35a12,12,0,0,0-5.85,8.11,110.7,110.7,0,0,0,0,43.11A12,12,0,0,0,20,157.66l27.82,15.85.11,31.31a12,12,0,0,0,4.25,9.12,116,116,0,0,0,38,21.41,12,12,0,0,0,9.68-.89L128,218.73l28.14,15.74a12,12,0,0,0,9.7.9,116.06,116.06,0,0,0,38-21.47,12,12,0,0,0,4.24-9.1l.14-31.34,27.81-15.81a12,12,0,0,0,5.85-8.11A110.7,110.7,0,0,0,241.86,106.43Zm-22.63,33.18-26.88,15.28a11.94,11.94,0,0,0-4.55,4.59c-.54,1-1.11,1.93-1.7,2.88a12,12,0,0,0-1.83,6.31L184.13,199a91.83,91.83,0,0,1-21.07,11.87l-27.15-15.19a12,12,0,0,0-5.86-1.53h-.29c-1.14,0-2.3,0-3.44,0a12.08,12.08,0,0,0-6.14,1.51L93,210.82A92.27,92.27,0,0,1,71.88,199l-.11-30.24a12,12,0,0,0-1.83-6.32c-.58-.94-1.16-1.91-1.7-2.88A11.92,11.92,0,0,0,63.7,155L36.8,139.63a86.53,86.53,0,0,1,0-23.24l26.88-15.28a12,12,0,0,0,4.55-4.58c.54-1,1.11-1.94,1.7-2.89a12,12,0,0,0,1.83-6.31L71.87,57A91.83,91.83,0,0,1,92.94,45.17l27.15,15.19a11.92,11.92,0,0,0,6.15,1.52c1.14,0,2.3,0,3.44,0a12.08,12.08,0,0,0,6.14-1.51L163,45.18A92.27,92.27,0,0,1,184.12,57l.11,30.24a12,12,0,0,0,1.83,6.32c.58.94,1.16,1.91,1.7,2.88A11.92,11.92,0,0,0,192.3,101l26.9,15.33A86.53,86.53,0,0,1,219.23,139.61Z"}))],["duotone",r.createElement(r.Fragment,null,r.createElement("path",{d:"M230.1,108.76,198.25,90.62c-.64-1.16-1.31-2.29-2-3.41l-.12-36A104.61,104.61,0,0,0,162,32L130,49.89c-1.34,0-2.69,0-4,0L94,32A104.58,104.58,0,0,0,59.89,51.25l-.16,36c-.7,1.12-1.37,2.26-2,3.41l-31.84,18.1a99.15,99.15,0,0,0,0,38.46l31.85,18.14c.64,1.16,1.31,2.29,2,3.41l.12,36A104.61,104.61,0,0,0,94,224l32-17.87c1.34,0,2.69,0,4,0L162,224a104.58,104.58,0,0,0,34.08-19.25l.16-36c.7-1.12,1.37-2.26,2-3.41l31.84-18.1A99.15,99.15,0,0,0,230.1,108.76ZM128,168a40,40,0,1,1,40-40A40,40,0,0,1,128,168Z",opacity:"0.2"}),r.createElement("path",{d:"M128,80a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Zm109.94-52.79a8,8,0,0,0-3.89-5.4l-29.83-17-.12-33.62a8,8,0,0,0-2.83-6.08,111.91,111.91,0,0,0-36.72-20.67,8,8,0,0,0-6.46.59L128,41.85,97.88,25a8,8,0,0,0-6.47-.6A111.92,111.92,0,0,0,54.73,45.15a8,8,0,0,0-2.83,6.07l-.15,33.65-29.83,17a8,8,0,0,0-3.89,5.4,106.47,106.47,0,0,0,0,41.56,8,8,0,0,0,3.89,5.4l29.83,17,.12,33.63a8,8,0,0,0,2.83,6.08,111.91,111.91,0,0,0,36.72,20.67,8,8,0,0,0,6.46-.59L128,214.15,158.12,231a7.91,7.91,0,0,0,3.9,1,8.09,8.09,0,0,0,2.57-.42,112.1,112.1,0,0,0,36.68-20.73,8,8,0,0,0,2.83-6.07l.15-33.65,29.83-17a8,8,0,0,0,3.89-5.4A106.47,106.47,0,0,0,237.94,107.21Zm-15,34.91-28.57,16.25a8,8,0,0,0-3,3c-.58,1-1.19,2.06-1.81,3.06a7.94,7.94,0,0,0-1.22,4.21l-.15,32.25a95.89,95.89,0,0,1-25.37,14.3L134,199.13a8,8,0,0,0-3.91-1h-.19c-1.21,0-2.43,0-3.64,0a8.1,8.1,0,0,0-4.1,1l-28.84,16.1A96,96,0,0,1,67.88,201l-.11-32.2a8,8,0,0,0-1.22-4.22c-.62-1-1.23-2-1.8-3.06a8.09,8.09,0,0,0-3-3.06l-28.6-16.29a90.49,90.49,0,0,1,0-28.26L61.67,97.63a8,8,0,0,0,3-3c.58-1,1.19-2.06,1.81-3.06a7.94,7.94,0,0,0,1.22-4.21l.15-32.25a95.89,95.89,0,0,1,25.37-14.3L122,56.87a8,8,0,0,0,4.1,1c1.21,0,2.43,0,3.64,0a8,8,0,0,0,4.1-1l28.84-16.1A96,96,0,0,1,188.12,55l.11,32.2a8,8,0,0,0,1.22,4.22c.62,1,1.23,2,1.8,3.06a8.09,8.09,0,0,0,3,3.06l28.6,16.29A90.49,90.49,0,0,1,222.9,142.12Z"}))],["fill",r.createElement(r.Fragment,null,r.createElement("path",{d:"M237.94,107.21a8,8,0,0,0-3.89-5.4l-29.83-17-.12-33.62a8,8,0,0,0-2.83-6.08,111.91,111.91,0,0,0-36.72-20.67,8,8,0,0,0-6.46.59L128,41.85,97.88,25a8,8,0,0,0-6.47-.6A111.92,111.92,0,0,0,54.73,45.15a8,8,0,0,0-2.83,6.07l-.15,33.65-29.83,17a8,8,0,0,0-3.89,5.4,106.47,106.47,0,0,0,0,41.56,8,8,0,0,0,3.89,5.4l29.83,17,.12,33.63a8,8,0,0,0,2.83,6.08,111.91,111.91,0,0,0,36.72,20.67,8,8,0,0,0,6.46-.59L128,214.15,158.12,231a7.91,7.91,0,0,0,3.9,1,8.09,8.09,0,0,0,2.57-.42,112.1,112.1,0,0,0,36.68-20.73,8,8,0,0,0,2.83-6.07l.15-33.65,29.83-17a8,8,0,0,0,3.89-5.4A106.47,106.47,0,0,0,237.94,107.21ZM128,168a40,40,0,1,1,40-40A40,40,0,0,1,128,168Z"}))],["light",r.createElement(r.Fragment,null,r.createElement("path",{d:"M128,82a46,46,0,1,0,46,46A46.06,46.06,0,0,0,128,82Zm0,80a34,34,0,1,1,34-34A34,34,0,0,1,128,162Zm108-54.4a6,6,0,0,0-2.92-4L202.64,86.22l-.42-.71L202.1,51.2A6,6,0,0,0,200,46.64a110.12,110.12,0,0,0-36.07-20.31,6,6,0,0,0-4.84.45L128.46,43.86h-1L96.91,26.76a6,6,0,0,0-4.86-.44A109.92,109.92,0,0,0,56,46.68a6,6,0,0,0-2.12,4.55l-.16,34.34c-.14.23-.28.47-.41.71L22.91,103.57A6,6,0,0,0,20,107.62a104.81,104.81,0,0,0,0,40.78,6,6,0,0,0,2.92,4l30.42,17.33.42.71.12,34.31A6,6,0,0,0,56,209.36a110.12,110.12,0,0,0,36.07,20.31,6,6,0,0,0,4.84-.45l30.61-17.08h1l30.56,17.1A6.09,6.09,0,0,0,162,230a5.83,5.83,0,0,0,1.93-.32,109.92,109.92,0,0,0,36-20.36,6,6,0,0,0,2.12-4.55l.16-34.34c.14-.23.28-.47.41-.71l30.42-17.29a6,6,0,0,0,2.92-4.05A104.81,104.81,0,0,0,236,107.6Zm-11.25,35.79L195.32,160.1a6.07,6.07,0,0,0-2.28,2.3c-.59,1-1.21,2.11-1.86,3.14a6,6,0,0,0-.91,3.16l-.16,33.21a98.15,98.15,0,0,1-27.52,15.53L133,200.88a6,6,0,0,0-2.93-.77h-.14c-1.24,0-2.5,0-3.74,0a6,6,0,0,0-3.07.76L93.45,217.43a98,98,0,0,1-27.56-15.49l-.12-33.17a6,6,0,0,0-.91-3.16c-.64-1-1.27-2.08-1.86-3.14a6,6,0,0,0-2.27-2.3L31.3,143.4a93,93,0,0,1,0-30.79L60.68,95.9A6.07,6.07,0,0,0,63,93.6c.59-1,1.21-2.11,1.86-3.14a6,6,0,0,0,.91-3.16l.16-33.21A98.15,98.15,0,0,1,93.41,38.56L123,55.12a5.81,5.81,0,0,0,3.07.76c1.24,0,2.5,0,3.74,0a6,6,0,0,0,3.07-.76l29.65-16.56a98,98,0,0,1,27.56,15.49l.12,33.17a6,6,0,0,0,.91,3.16c.64,1,1.27,2.08,1.86,3.14a6,6,0,0,0,2.27,2.3L224.7,112.6A93,93,0,0,1,224.73,143.39Z"}))],["regular",r.createElement(r.Fragment,null,r.createElement("path",{d:"M128,80a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Zm109.94-52.79a8,8,0,0,0-3.89-5.4l-29.83-17-.12-33.62a8,8,0,0,0-2.83-6.08,111.91,111.91,0,0,0-36.72-20.67,8,8,0,0,0-6.46.59L128,41.85,97.88,25a8,8,0,0,0-6.47-.6A112.1,112.1,0,0,0,54.73,45.15a8,8,0,0,0-2.83,6.07l-.15,33.65-29.83,17a8,8,0,0,0-3.89,5.4,106.47,106.47,0,0,0,0,41.56,8,8,0,0,0,3.89,5.4l29.83,17,.12,33.62a8,8,0,0,0,2.83,6.08,111.91,111.91,0,0,0,36.72,20.67,8,8,0,0,0,6.46-.59L128,214.15,158.12,231a7.91,7.91,0,0,0,3.9,1,8.09,8.09,0,0,0,2.57-.42,112.1,112.1,0,0,0,36.68-20.73,8,8,0,0,0,2.83-6.07l.15-33.65,29.83-17a8,8,0,0,0,3.89-5.4A106.47,106.47,0,0,0,237.94,107.21Zm-15,34.91-28.57,16.25a8,8,0,0,0-3,3c-.58,1-1.19,2.06-1.81,3.06a7.94,7.94,0,0,0-1.22,4.21l-.15,32.25a95.89,95.89,0,0,1-25.37,14.3L134,199.13a8,8,0,0,0-3.91-1h-.19c-1.21,0-2.43,0-3.64,0a8.08,8.08,0,0,0-4.1,1l-28.84,16.1A96,96,0,0,1,67.88,201l-.11-32.2a8,8,0,0,0-1.22-4.22c-.62-1-1.23-2-1.8-3.06a8.09,8.09,0,0,0-3-3.06l-28.6-16.29a90.49,90.49,0,0,1,0-28.26L61.67,97.63a8,8,0,0,0,3-3c.58-1,1.19-2.06,1.81-3.06a7.94,7.94,0,0,0,1.22-4.21l.15-32.25a95.89,95.89,0,0,1,25.37-14.3L122,56.87a8,8,0,0,0,4.1,1c1.21,0,2.43,0,3.64,0a8.08,8.08,0,0,0,4.1-1l28.84-16.1A96,96,0,0,1,188.12,55l.11,32.2a8,8,0,0,0,1.22,4.22c.62,1,1.23,2,1.8,3.06a8.09,8.09,0,0,0,3,3.06l28.6,16.29A90.49,90.49,0,0,1,222.9,142.12Z"}))],["thin",r.createElement(r.Fragment,null,r.createElement("path",{d:"M128,84a44,44,0,1,0,44,44A44.05,44.05,0,0,0,128,84Zm0,80a36,36,0,1,1,36-36A36,36,0,0,1,128,164Zm106-56a4,4,0,0,0-2-2.7l-30.89-17.6q-.47-.82-1-1.62L200.1,51.2a3.94,3.94,0,0,0-1.42-3,107.8,107.8,0,0,0-35.41-19.94,4,4,0,0,0-3.23.29L129,45.87h-2l-31-17.36a4,4,0,0,0-3.23-.3,108.05,108.05,0,0,0-35.39,20,4,4,0,0,0-1.41,3l-.16,34.9-1,1.62L23.9,105.3A4,4,0,0,0,22,108a102.76,102.76,0,0,0,0,40,4,4,0,0,0,1.95,2.7l30.89,17.6q.47.83,1,1.62l.12,34.87a3.94,3.94,0,0,0,1.42,3,107.8,107.8,0,0,0,35.41,19.94,4,4,0,0,0,3.23-.29L127,210.13h2l31,17.36a4,4,0,0,0,3.23.3,108.05,108.05,0,0,0,35.39-20,4,4,0,0,0,1.41-3l.16-34.9,1-1.62L232.1,150.7a4,4,0,0,0,2-2.71A102.76,102.76,0,0,0,234,108Zm-7.48,36.67L196.3,161.84a4,4,0,0,0-1.51,1.53c-.61,1.09-1.25,2.17-1.91,3.24a3.92,3.92,0,0,0-.61,2.1l-.16,34.15a99.8,99.8,0,0,1-29.7,16.77l-30.4-17a4.06,4.06,0,0,0-2-.51H130c-1.28,0-2.57,0-3.84,0a4.1,4.1,0,0,0-2.05.51l-30.45,17A100.23,100.23,0,0,1,63.89,202.9l-.12-34.12a3.93,3.93,0,0,0-.61-2.11c-.66-1-1.3-2.14-1.91-3.23a4,4,0,0,0-1.51-1.53L29.49,144.68a94.78,94.78,0,0,1,0-33.34L59.7,94.16a4,4,0,0,0,1.51-1.53c.61-1.09,1.25-2.17,1.91-3.23a4,4,0,0,0,.61-2.11l.16-34.15a99.8,99.8,0,0,1,29.7-16.77l30.4,17a4.1,4.1,0,0,0,2.05.51c1.28,0,2.57,0,3.84,0a4,4,0,0,0,2.05-.51l30.45-17A100.23,100.23,0,0,1,192.11,53.1l.12,34.12a3.93,3.93,0,0,0,.61,2.11c.66,1,1.3,2.14,1.91,3.23a4,4,0,0,0,1.51,1.53l30.25,17.23A94.78,94.78,0,0,1,226.54,144.66Z"}))]]),i=r.forwardRef((e,t)=>r.createElement(n.A,{ref:t,...e,weights:l}));i.displayName="GearSixIcon";let s=i},95568:(e,t,a)=>{"use strict";a.d(t,{default:()=>R});var r=a(3680),n=a(78604),l=a(27540),i=a(40189),s=a(63363),o=a.n(s),c=a(39504),d=a(76613),m=a(14308),u=a(64678);let p=(0,u.createServerReference)("401a9d0eede57ee72eff7a603fef0186534def2d16",u.callServer,void 0,u.findSourceMapURL,"deleteLlmKeyAction"),x=(0,u.createServerReference)("60524bd713205b07644a694f98b443e218cba53d69",u.callServer,void 0,u.findSourceMapURL,"setLlmKeyActiveAction");var f=a(63217);function h({row:e,onEdit:t,onDeleted:a}){let i=(0,l.useRouter)(),[s,o]=(0,n.useTransition)(),[u,b]=(0,n.useState)(!1),[v,k]=(0,n.useTransition)(),{bg:A,fg:j,initials:L}=function(e){switch(e){case"anthropic":return{bg:"#c96442",fg:"#fff",initials:"AN"};case"openai":return{bg:"#0fa47c",fg:"#fff",initials:"OA"};case"openai-compatible":return{bg:"#7c5cbf",fg:"#fff",initials:"LC"};case"ollama":return{bg:"#3b5a8a",fg:"#fff",initials:"OL"};case"openrouter":return{bg:"#b5455a",fg:"#fff",initials:"OR"};case"google":return{bg:"#1a73c8",fg:"#fff",initials:"GG"};case"mistral":return{bg:"#c47a1a",fg:"#fff",initials:"MI"};case"groq":return{bg:"#a33b50",fg:"#fff",initials:"GQ"};default:return{bg:"#4a4a50",fg:"#fff",initials:e.slice(0,2).toUpperCase()}}}(e.provider);return(0,r.jsxs)("div",{className:"flex flex-col gap-3 rounded-2xl border border-rule-2 bg-paper p-[18px]",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"flex h-[42px] w-[42px] shrink-0 items-center justify-center rounded-xl font-mono text-[13px] font-semibold tracking-[0.04em]",style:{background:A,color:j},children:L}),(0,r.jsx)("div",{className:"min-w-0 flex-1",children:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"text-[15px] font-semibold leading-[1.2] tracking-[-0.005em] text-ink",children:e.nickname??(0,f.R)(e.provider)}),e.nickname&&(0,r.jsx)("span",{className:"font-mono text-[10.5px] uppercase tracking-[0.06em] text-ink-4",children:(0,f.R)(e.provider)})]})}),(0,r.jsx)("button",{type:"button",role:"switch","aria-checked":e.isActive,"aria-label":e.isActive?"Deactivate provider":"Activate provider",onClick:function(){k(async()=>{let t=await x(e.id,!e.isActive);t.ok?i.refresh():c.oR.error(t.message)})},disabled:v||s,className:["relative inline-flex h-[22px] w-[38px] shrink-0 cursor-pointer items-center rounded-full border transition-colors focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",e.isActive?"border-ok/40 bg-ok/20":"border-rule-2 bg-canvas"].join(" "),children:(0,r.jsx)("span",{className:["inline-block h-[16px] w-[16px] rounded-full shadow-sm transition-transform",e.isActive?"translate-x-[18px] bg-ok":"translate-x-[2px] bg-ink-4"].join(" ")})})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[e.baseUrl&&(0,r.jsx)("div",{className:"flex items-center gap-2 rounded-lg bg-canvas px-[10px] py-[7px]",children:(0,r.jsx)("code",{className:"flex-1 truncate font-mono text-[12px] leading-none text-ink",children:e.baseUrl})}),(0,r.jsx)("div",{className:"flex items-center gap-2 rounded-lg bg-canvas px-[10px] py-[7px]",children:e.hasApiKey?(0,r.jsxs)("code",{className:"font-mono text-[12px] leading-none tracking-widest text-ink-3",children:["••••••••",e.apiKeyLast4??""]}):(0,r.jsx)("span",{className:"text-[12px] leading-none text-warn",children:"No API key"})})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between border-t border-rule-2 pt-[10px]",children:[(0,r.jsx)(g,{count:e.agentCount,keyId:e.id}),(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsxs)("button",{type:"button",onClick:t,className:"inline-flex h-[28px] items-center gap-1 rounded-md border border-rule px-[10px] text-[11.5px] font-medium text-ink-3 transition-colors hover:border-rule-2 hover:text-ink",children:[(0,r.jsx)(d._,{size:12,weight:"regular"}),"Configure"]}),(0,r.jsx)("button",{type:"button",onClick:()=>b(!0),disabled:s,className:"inline-flex h-[28px] items-center rounded-md border border-err/30 px-[10px] text-[11.5px] font-medium text-err transition-colors hover:border-err/60 hover:bg-warn-bg disabled:opacity-40",children:"Delete"})]})]}),(0,r.jsx)(m.A,{open:u,title:"Remove LLM provider?",message:`"${e.nickname??(0,f.R)(e.provider)}" will be removed. Agents using it will fall back to the default env-configured provider until reassigned.`,confirmLabel:"Remove",onConfirm:function(){b(!1),o(async()=>{let t=await p(e.id);t.ok?(c.oR.success("LLM provider removed"),a()):c.oR.error(t.message)})},onCancel:()=>b(!1)})]})}function g({count:e,keyId:t}){return 0===e?(0,r.jsx)("span",{className:"font-sans text-[12.5px] leading-none text-ink-3",children:"Not in use"}):(0,r.jsxs)(o(),{href:`/agents?llmKeyId=${t}`,className:"font-sans text-[12.5px] leading-none text-ink-3 transition-colors hover:text-ink",title:`${e} agent${1===e?"":"s"} use this key`,children:[(0,r.jsx)("span",{className:"font-mono tabular-nums",children:e})," agent",1===e?"":"s"," using"]})}let b=(0,u.createServerReference)("40dc3ad156374b24f4932c45c207a6b5ded0fafe31",u.callServer,void 0,u.findSourceMapURL,"testLlmKeyAction"),v=(0,u.createServerReference)("40106e1cae696378c9f7f89b4d0cc511df13c968d3",u.callServer,void 0,u.findSourceMapURL,"updateLlmKeyAction"),k=(0,u.createServerReference)("40357e9b617de7a42a00d52bfc453c33b6f103ba73",u.callServer,void 0,u.findSourceMapURL,"createLlmKeyAction"),A={anthropic:"https://api.anthropic.com/v1",openai:"https://api.openai.com/v1","openai-compatible":"http://localhost:1234/v1",ollama:"http://localhost:11434",openrouter:"https://openrouter.ai/api/v1",google:"https://generativelanguage.googleapis.com/v1beta",mistral:"https://api.mistral.ai/v1",groq:"https://api.groq.com/openai/v1"},j=["anthropic","openai","openai-compatible","ollama","openrouter","google","mistral","groq"],L="block font-mono text-[10px] uppercase tracking-[0.12em] text-ink-4 mb-1.5",y="w-full rounded-lg border border-rule bg-canvas px-3 py-2 text-[13px] text-ink placeholder-ink-4 transition-colors focus:border-ink-3 focus:outline-none",N=`${y} font-mono`;function w(e){let t="edit"===e.mode,a=t?e.initial:null,l=a?.provider??"anthropic",i="create"===e.mode?j.filter(t=>!e.configuredProviders.includes(t)):j,s="create"===e.mode?i[0]??"anthropic":l,[o,d]=(0,n.useState)(s),[m,u]=(0,n.useState)(a?.baseUrl??""),[p,x]=(0,n.useState)(""),[h,g]=(0,n.useState)(a?.isActive??!0),[w,R]=(0,n.useState)({state:"idle"}),[E,S]=(0,n.useTransition)(),[M,C]=(0,n.useState)(!1),Z=t&&0===p.length,F=t&&a?.apiKeyLast4!=null&&!M&&0===p.length;function H(){"idle"!==w.state&&R({state:"idle"})}async function P(){R({state:"testing"});let e=t&&0===p.length&&a?.id,r=await b({provider:o,baseUrl:m||void 0,apiKey:p||void 0,...e?{keyId:a.id}:{}});r.ok?R({state:"pass",message:r.data.message}):R({state:"fail",message:r.message})}let V=A[o]||"https://...";return(0,r.jsxs)("form",{onSubmit:function(r){(r.preventDefault(),"pass"===w.state||Z)?S(async()=>{if(t&&a){let t=await v({id:a.id,provider:o,baseUrl:m||void 0,apiKey:p||void 0,isActive:h});if(!t.ok)return void c.oR.error(t.message);c.oR.success("LLM provider updated"),e.onDone("saved")}else{let t=await k({provider:o,baseUrl:m||void 0,apiKey:p||void 0,isActive:h});if(!t.ok)return void c.oR.error(t.message);c.oR.success("LLM provider added"),e.onDone("saved")}}):c.oR.error("Test the connection before saving")},className:"space-y-4 rounded-2xl border border-rule-2 bg-paper p-5",children:[(0,r.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:L,htmlFor:"llm-provider",children:"Provider"}),t?(0,r.jsx)("div",{className:`${y} cursor-not-allowed bg-hover text-ink-3`,children:(0,f.R)(o)}):0===i.length?(0,r.jsx)("p",{className:"text-[12.5px] text-warn",children:"All providers already configured. Edit an existing key instead."}):(0,r.jsx)("select",{id:"llm-provider",value:o,onChange:e=>{var t;d(t=e.target.value),!m&&A[t]&&u(A[t]),H()},className:y,children:i.map(e=>(0,r.jsx)("option",{value:e,children:(0,f.R)(e)},e))})]})}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{className:L,htmlFor:"llm-base-url",children:["Base URL","openai-compatible"===o||"ollama"===o?(0,r.jsx)("span",{className:"ml-2 normal-case font-sans text-[11px] tracking-normal text-warn",children:"required"}):(0,r.jsx)("span",{className:"ml-2 normal-case font-sans text-[11px] tracking-normal text-ink-4",children:"optional"})]}),(0,r.jsx)("input",{id:"llm-base-url",type:"text",required:"openai-compatible"===o||"ollama"===o,value:m,onChange:e=>{u(e.target.value),H()},placeholder:V||"leave blank to use the provider default",className:N})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:L,htmlFor:"llm-api-key",children:"API key"}),F?(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsxs)("div",{className:"flex-1 rounded-lg border border-rule bg-canvas px-3 py-2 font-mono text-[13px] tracking-widest text-ink-3 select-none",children:["••••••••",a.apiKeyLast4]}),(0,r.jsx)("button",{type:"button",onClick:()=>{C(!0),H()},className:"shrink-0 rounded-md border border-rule px-3 py-2 text-[12px] font-medium text-ink-3 transition-colors hover:border-ink-3 hover:text-ink",children:"Replace"})]}):(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("input",{id:"llm-api-key",type:"password",autoComplete:"new-password",value:p,onChange:e=>{x(e.target.value),H()},placeholder:t&&!M?"Leave blank to keep current":"",className:"flex-1 rounded-lg border border-rule bg-canvas px-3 py-2 font-mono text-[13px] text-ink placeholder-ink-4 transition-colors focus:border-ink-3 focus:outline-none"}),t&&M&&(0,r.jsx)("button",{type:"button",onClick:()=>{C(!1),x(""),H()},className:"shrink-0 px-3 py-2 text-[12px] font-medium text-ink-4 transition-colors hover:text-ink-2",children:"Cancel"})]})]}),(0,r.jsxs)("label",{className:"flex cursor-pointer items-center gap-2.5 text-[13px] text-ink-2",children:[(0,r.jsx)("input",{type:"checkbox",checked:h,onChange:e=>g(e.target.checked),className:"accent-conn-vivid"}),(0,r.jsx)("span",{children:"Active — agents may select this provider"})]}),"pass"===w.state&&(0,r.jsx)("div",{className:"rounded-md border border-ok/30 bg-ok-bg px-3 py-2 text-[12px] text-ok",children:w.message}),"fail"===w.state&&(0,r.jsx)("div",{className:"rounded-md border border-err/30 bg-warn-bg px-3 py-2 text-[12px] text-err break-all",children:w.message}),(0,r.jsxs)("div",{className:"flex items-center gap-2 pt-1",children:[(0,r.jsx)("button",{type:"button",onClick:P,disabled:"testing"===w.state||E,className:"inline-flex h-[34px] items-center rounded-md border border-rule px-3.5 text-[13px] font-medium text-ink-2 transition-colors hover:border-rule-2 hover:text-ink disabled:opacity-50",children:"testing"===w.state?"Testing…":"Test connection"}),(0,r.jsx)("button",{type:"submit",disabled:E||"testing"===w.state||"pass"!==w.state&&!Z,className:"inline-flex h-[34px] items-center rounded-md bg-ink px-3.5 text-[13px] font-semibold text-canvas transition-[filter] hover:brightness-[0.92] disabled:opacity-50",title:"pass"===w.state||Z?void 0:"Test the connection before saving",children:E?"Saving…":t?"Save changes":"Add provider"}),(0,r.jsx)("button",{type:"button",onClick:()=>e.onDone("cancelled"),className:"inline-flex h-[34px] items-center px-3.5 text-[13px] font-medium text-ink-3 transition-colors hover:text-ink-2",children:"Cancel"})]})]})}function R({initialRows:e}){let t=(0,l.useRouter)(),[,a]=(0,n.useTransition)(),[s,o]=(0,n.useState)({kind:"closed"}),c=e.map(e=>e.provider);function d(){a(()=>{t.refresh()})}return(0,r.jsxs)("div",{className:"space-y-3",children:[0===e.length?(0,r.jsx)("div",{className:"rounded-2xl border border-rule-2 bg-paper px-6 py-12 text-center text-[13px] text-ink-3",children:"No LLM providers yet. Add one to start configuring agents."}):(0,r.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:e.map(e=>(0,r.jsx)(h,{row:e,onEdit:()=>o({kind:"edit",row:e}),onDeleted:d},e.id))}),"closed"===s.kind&&(0,r.jsxs)("button",{type:"button",onClick:()=>o({kind:"create"}),className:"inline-flex h-[34px] items-center gap-1.5 rounded-md border border-rule bg-paper px-3.5 text-[13px] font-medium text-ink-2 transition-colors hover:border-rule-2 hover:text-ink",children:[(0,r.jsx)(i.F,{size:13,weight:"bold"}),"Add provider"]}),"create"===s.kind&&(0,r.jsx)(w,{mode:"create",configuredProviders:c,onDone:e=>{o({kind:"closed"}),"saved"===e&&d()}}),"edit"===s.kind&&(0,r.jsx)(w,{mode:"edit",initial:s.row,onDone:e=>{o({kind:"closed"}),"saved"===e&&d()}})]})}}},e=>{e.O(0,[3363,9504,1065,8724,7358],()=>e(e.s=70397)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7513],{1489:(e,t,r)=>{Promise.resolve().then(r.bind(r,17016))},5977:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});var a=r(78604);let n=a.forwardRef((e,t)=>{let{alt:r,color:n="currentColor",size:s="1em",weight:l="regular",mirrored:i=!1,children:o,weights:d,...c}=e;return a.createElement("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,fill:n,viewBox:"0 0 256 256",transform:i?"scale(-1, 1)":void 0,...c},!!r&&a.createElement("title",null,r),o,d.get(l))});n.displayName="SSRBase"},14308:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});var a=r(3680),n=r(78604),s=r(51869);function l({open:e,title:t,message:r,confirmLabel:i="Confirm",cancelLabel:o="Cancel",destructive:d=!0,onConfirm:c,onCancel:u}){let m=(0,n.useRef)(null),[x,p]=(0,n.useState)(!1);return((0,n.useEffect)(()=>{p(!0)},[]),(0,n.useEffect)(()=>{if(e)return m.current?.focus(),window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t);function t(e){"Escape"===e.key&&u()}},[e,u]),e&&x)?(0,s.createPortal)((0,a.jsxs)("div",{role:"dialog","aria-modal":"true","aria-labelledby":"confirm-dialog-title",className:"fixed inset-0 z-50 flex items-center justify-center px-4 text-left",children:[(0,a.jsx)("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:u,"aria-hidden":"true"}),(0,a.jsxs)("div",{className:"relative bg-paper border border-rule-2 rounded-xl p-6 max-w-md w-full shadow-2xl",children:[(0,a.jsx)("h2",{id:"confirm-dialog-title",className:"text-base font-semibold text-ink",children:t}),r&&(0,a.jsx)("p",{className:"mt-2 text-sm text-ink-3 leading-relaxed",children:r}),(0,a.jsxs)("div",{className:"mt-6 flex justify-end gap-2",children:[(0,a.jsx)("button",{ref:m,type:"button",onClick:u,className:"px-4 py-2 text-sm font-medium border border-rule text-ink-2 rounded-lg hover:border-rule hover:text-ink transition-colors",children:o}),(0,a.jsx)("button",{type:"button",onClick:c,className:`px-4 py-2 text-sm font-semibold rounded-lg transition-colors ${d?"bg-err hover:brightness-[0.94] text-ink":"bg-ink hover:brightness-[0.92] text-canvas"}`,children:i})]})]})]}),document.body):null}},17016:(e,t,r)=>{"use strict";r.d(t,{default:()=>I});var a=r(3680),n=r(78604),s=r(27540),l=r(32307),i=r(65668),o=r(28870),d=r(66736),c=r(13260),u=r(81630),m=r(88499),x=r(93606),p=r(39504),h=r(64678);let b=(0,h.createServerReference)("4003fcb873df0181574d42fb4bea2505b54e5ed549",h.callServer,void 0,h.findSourceMapURL,"deleteMcpServerAction"),g=(0,h.createServerReference)("60387ec0d39228d66c460aac5516bbad2b8106ba4e",h.callServer,void 0,h.findSourceMapURL,"renameMcpServerAction"),v=(0,h.createServerReference)("604e81f2153543d44bfbe02554eee33fe9c7eb41b6",h.callServer,void 0,h.findSourceMapURL,"updateMcpServerApiKeyAction");var f=r(14308);let k=(0,h.createServerReference)("405da710852dfaf045979eb3bf4150d08015bfde18",h.callServer,void 0,h.findSourceMapURL,"getMcpServerConfigAction"),j=(0,h.createServerReference)("602e220c0c1799f123879c32ef57a75671b75d54dc",h.callServer,void 0,h.findSourceMapURL,"updateMcpServerConfigAction"),y="w-full bg-hover border border-rule rounded-md px-2 py-1.5 text-sm text-ink placeholder:text-ink-4 focus:border-ink-3 focus:outline-none";function N({mcpServerId:e,onDone:t,onCancel:r}){let[s,l]=(0,n.useState)(null),[i,o]=(0,n.useState)(null),[d,c]=(0,n.useTransition)(),[u,m]=(0,n.useState)(""),[x,h]=(0,n.useState)(""),[b,g]=(0,n.useState)("header"),[v,f]=(0,n.useState)(""),[C,w]=(0,n.useState)(""),[A,S]=(0,n.useState)(""),[R,$]=(0,n.useState)(""),[M,E]=(0,n.useState)([]);if((0,n.useEffect)(()=>{let t=!1;return(async()=>{let r=await k(e);if(t)return;if(!r.ok)return o(r.message);let a=r.data;l(a),m(a.name),h(a.url??""),g(a.authScheme??"header"),f(a.authParamName??""),S(a.command??""),$(a.args.join("\n")),E(a.envKeys.length>0?a.envKeys.map(e=>({key:e,value:""})):[{key:"",value:""}])})(),()=>{t=!0}},[e]),i)return(0,a.jsx)("div",{className:"bg-paper border border-rule-2 rounded-xl px-5 py-4",children:(0,a.jsx)("p",{className:"text-xs text-err",children:i})});if(!s)return(0,a.jsx)("div",{className:"bg-paper border border-rule-2 rounded-xl px-5 py-4",children:(0,a.jsx)("p",{className:"text-xs text-ink-4",children:"Loading configuration…"})});let L="stdio"===s.transport;function P(e,t){E(r=>r.map((r,a)=>a===e?{...r,...t}:r))}return(0,a.jsxs)("form",{onSubmit:function(e){if(e.preventDefault(),!s)return;let r=u.trim();if(!r)return void p.oR.error("Name is required");let a={name:r};if("http"===s.transport){let e=x.trim();if(!e)return void p.oR.error("Server URL is required");if(a.url=e,a.authScheme=b,"bearer"!==b){let e=v.trim();if(!e)return void p.oR.error("Auth param name is required for this scheme");a.authParamName=e}let t=C.trim();t&&(a.apiKey=t)}else{let e=A.trim();if(!e)return void p.oR.error("Command is required");a.command=e,a.args=R.split("\n").map(e=>e.trim()).filter(Boolean);let t={};for(let e of M){let r=e.key.trim();r&&(t[r]=e.value)}a.env=t}c(async()=>{let e=await j(s.id,a);e.ok?(p.oR.success("Configuration updated"),t?.()):p.oR.error(e.message)})},className:"bg-paper border border-rule-2 rounded-xl px-5 py-4 space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-[10px] font-semibold uppercase tracking-wider text-ink-4 font-mono",children:[(0,a.jsx)("span",{children:s.slug}),(0,a.jsx)("span",{children:"\xb7"}),(0,a.jsx)("span",{children:s.transport})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:`edit-name-${s.id}`,className:"block text-xs text-ink-3 mb-1",children:"Name"}),(0,a.jsx)("input",{id:`edit-name-${s.id}`,type:"text",required:!0,value:u,onChange:e=>m(e.target.value),className:y})]}),!L&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:`edit-url-${s.id}`,className:"block text-xs text-ink-3 mb-1",children:"Server URL"}),(0,a.jsx)("input",{id:`edit-url-${s.id}`,type:"url",required:!0,value:x,onChange:e=>h(e.target.value),placeholder:"https://…",className:`${y} font-mono`})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("p",{className:"block text-xs text-ink-3",children:"Auth scheme"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:["header","query","bearer"].map(e=>(0,a.jsxs)("label",{className:`flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs cursor-pointer border ${b===e?"bg-hover border-ink-3 text-ink":"bg-paper border-rule text-ink-3 hover:border-rule"}`,children:[(0,a.jsx)("input",{type:"radio",name:`edit-scheme-${s.id}`,value:e,checked:b===e,onChange:()=>g(e),className:"sr-only"}),"header"===e?"Header":"query"===e?"Query param":"Bearer"]},e))}),"bearer"!==b&&(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:`edit-auth-param-${s.id}`,className:"block text-xs text-ink-3 mb-1",children:"header"===b?"Header name":"Query param name"}),(0,a.jsx)("input",{id:`edit-auth-param-${s.id}`,type:"text",required:!0,value:v,onChange:e=>f(e.target.value),placeholder:"header"===b?"x-api-key":"api_key",className:`${y} font-mono`})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:`edit-key-${s.id}`,className:"block text-xs text-ink-3 mb-1",children:"API key"}),(0,a.jsx)("input",{id:`edit-key-${s.id}`,type:"password",autoComplete:"off",value:C,onChange:e=>w(e.target.value),placeholder:s.apiKeyLast4?`•••• ${s.apiKeyLast4} — leave blank to keep`:"Paste a key",className:`${y} font-mono`}),(0,a.jsx)("p",{className:"text-[11px] text-ink-4 mt-1",children:"Leave blank to keep the current key. The new config is verified against the live server before saving."})]})]}),L&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:`edit-command-${s.id}`,className:"block text-xs text-ink-3 mb-1",children:"Command"}),(0,a.jsx)("input",{id:`edit-command-${s.id}`,type:"text",required:!0,value:A,onChange:e=>S(e.target.value),placeholder:"npx",className:`${y} font-mono`})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{htmlFor:`edit-args-${s.id}`,className:"block text-xs text-ink-3 mb-1",children:["Arguments ",(0,a.jsx)("span",{className:"text-ink-4",children:"(one per line)"})]}),(0,a.jsx)("textarea",{id:`edit-args-${s.id}`,rows:Math.max(3,R.split("\n").length),value:R,onChange:e=>$(e.target.value),className:`${y} font-mono resize-none`})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{className:"block text-xs text-ink-3 mb-1",children:["Environment variables"," ",(0,a.jsx)("span",{className:"text-ink-4",children:"(encrypted — leave value blank to keep)"})]}),(0,a.jsx)("div",{className:"space-y-2",children:M.map((e,t)=>(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("input",{type:"text",value:e.key,onChange:e=>P(t,{key:e.target.value}),placeholder:"VAR_NAME",className:`${y} flex-1 font-mono`}),(0,a.jsx)("input",{type:"password",autoComplete:"off",value:e.value,onChange:e=>P(t,{value:e.target.value}),placeholder:s.envKeys.includes(e.key)?"leave blank to keep":"value",className:`${y} flex-1 font-mono`}),(0,a.jsx)("button",{type:"button",onClick:()=>{E(e=>e.filter((e,r)=>r!==t))},"aria-label":"Remove env var",className:"px-2 text-ink-3 hover:text-err",children:"\xd7"})]},t))}),(0,a.jsx)("button",{type:"button",onClick:function(){E(e=>[...e,{key:"",value:""}])},className:"mt-2 text-[11px] text-ink-3 hover:text-ink",children:"+ Add variable"})]})]}),(0,a.jsxs)("div",{className:"flex gap-2 items-center pt-1",children:[(0,a.jsx)("button",{type:"submit",disabled:d||!u.trim(),className:"px-4 py-2 text-sm font-semibold bg-ink text-canvas rounded-md hover:brightness-[0.92] disabled:opacity-50",children:d?"Verifying…":"Save changes"}),r&&(0,a.jsx)("button",{type:"button",onClick:r,className:"text-xs text-ink-3 hover:text-ink underline",children:"Cancel"})]})]})}function C({instance:e,catalogLabel:t,description:r}){let l=(0,s.useRouter)(),[i,o]=(0,n.useTransition)(),[d,c]=(0,n.useState)(!1),[u,m]=(0,n.useState)(!1),[x,h]=(0,n.useState)(!1),[k,j]=(0,n.useState)(e.name),[y,w]=(0,n.useState)(!1),[A,S]=(0,n.useState)("");function R(){let t=k.trim();t&&t!==e.name?o(async()=>{let r=await g(e.id,t);r.ok?(p.oR.success("Renamed"),h(!1)):p.oR.error(r.message)}):h(!1)}function $(){let t=A.trim();t?o(async()=>{let r=await v(e.id,t);r.ok?(p.oR.success(`${e.name} key rotated`),w(!1),S("")):p.oR.error(r.message)}):p.oR.error("New API key is required")}return(0,a.jsxs)("div",{className:"bg-paper border border-rule-2 rounded-xl px-5 py-4",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[x?(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{autoFocus:!0,value:k,onChange:e=>j(e.target.value),onKeyDown:t=>{"Enter"===t.key&&R(),"Escape"===t.key&&(j(e.name),h(!1))},className:"bg-hover border border-rule rounded-md px-2 py-1 text-sm text-ink focus:border-ink-3 focus:outline-none w-full max-w-xs"}),(0,a.jsx)("button",{type:"button",onClick:R,disabled:i,className:"text-xs text-ok hover:text-ok disabled:opacity-40",children:"Save"}),(0,a.jsx)("button",{type:"button",onClick:()=>{j(e.name),h(!1)},className:"text-xs text-ink-3 hover:text-ink-2",children:"Cancel"})]}):(0,a.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,a.jsx)("span",{className:"text-ink font-medium",children:e.name}),(0,a.jsx)("button",{type:"button",onClick:()=>h(!0),"aria-label":"Rename MCP server",className:"text-ink-4 hover:text-ink-3 transition-colors text-xs leading-none",title:"Rename",children:"✎"}),(0,a.jsx)("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-ink-3 font-mono",children:t}),(0,a.jsx)("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-ok",children:"connected"})]}),r&&(0,a.jsx)("p",{className:"text-xs text-ink-3 mt-0.5",children:r}),(0,a.jsxs)("p",{className:"text-xs text-ink-4 mt-1",children:[e.toolCount," tool",1===e.toolCount?"":"s"," discovered",e.apiKeyLast4?` \xb7 key …${e.apiKeyLast4}`:""]})]}),(0,a.jsxs)("div",{className:"shrink-0 flex gap-2 flex-wrap justify-end",children:[(0,a.jsx)("button",{type:"button",onClick:()=>{m(e=>!e),w(!1)},disabled:i,className:"px-2.5 py-1 text-xs font-medium border border-rule-2 text-ink-3 rounded-md hover:border-rule hover:text-ink disabled:opacity-40",children:u?"Cancel":"Edit config"}),(0,a.jsx)("button",{type:"button",onClick:()=>w(e=>!e),disabled:i,className:"px-2.5 py-1 text-xs font-medium border border-rule-2 text-ink-3 rounded-md hover:border-rule hover:text-ink disabled:opacity-40",children:y?"Cancel":"Rotate key"}),(0,a.jsx)("button",{type:"button",onClick:()=>c(!0),disabled:i,className:"px-2.5 py-1 text-xs font-medium border border-err/30 text-err rounded-md hover:border-err/30 hover:text-err disabled:opacity-40",children:"Disconnect"})]})]}),y&&(0,a.jsxs)("div",{className:"space-y-3 pt-3 mt-3 border-t border-rule-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:`mcp-rotate-${e.id}`,className:"block text-xs text-ink-3 mb-1",children:"New API key"}),(0,a.jsx)("input",{id:`mcp-rotate-${e.id}`,type:"password",autoComplete:"off",autoFocus:!0,value:A,onChange:e=>S(e.target.value),onKeyDown:e=>{"Enter"===e.key&&$(),"Escape"===e.key&&(S(""),w(!1))},placeholder:"Paste the new key",className:"w-full bg-hover border border-rule rounded-md px-2 py-1.5 text-sm text-ink placeholder:text-ink-4 focus:border-ink-3 focus:outline-none font-mono"}),(0,a.jsx)("p",{className:"text-[11px] text-ink-4 mt-1",children:"Agent assignments stay intact — the key is verified against the server before being saved."})]}),(0,a.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,a.jsx)("button",{type:"button",onClick:$,disabled:i||!A.trim(),className:"px-4 py-2 text-sm font-semibold bg-ink text-canvas rounded-md hover:brightness-[0.92] disabled:opacity-50",children:i?"Verifying…":"Save new key"}),(0,a.jsx)("button",{type:"button",onClick:()=>{S(""),w(!1)},className:"text-xs text-ink-3 hover:text-ink underline",children:"Cancel"})]})]}),u&&(0,a.jsx)("div",{className:"mt-3",children:(0,a.jsx)(N,{mcpServerId:e.id,onDone:()=>{m(!1),l.refresh()},onCancel:()=>m(!1)})}),(0,a.jsx)(f.A,{open:d,title:`Disconnect "${e.name}"?`,message:"The MCP connector and all its agent assignments will be removed. Re-connecting later requires the API key again.",confirmLabel:"Disconnect",onConfirm:function(){c(!1),o(async()=>{let t=await b(e.id);t.ok?p.oR.success(`${e.name} disconnected`):p.oR.error(t.message)})},onCancel:()=>c(!1)})]})}function w({instances:e,catalog:t}){return(0,a.jsx)("div",{className:"overflow-hidden rounded-2xl border border-rule-2 bg-paper",children:(0,a.jsxs)("table",{className:"w-full border-collapse",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{children:[(0,a.jsx)(A,{label:"Server"}),(0,a.jsx)(A,{label:"Tools"}),(0,a.jsx)(A,{label:"Transport"}),(0,a.jsx)(A,{label:"Status"}),(0,a.jsx)(A,{label:"Actions",align:"right"})]})}),(0,a.jsx)("tbody",{children:e.map(e=>{let r=t.find(t=>t.slug===e.slug);return(0,a.jsx)(S,{instance:e,catalogLabel:r?.label??e.name,description:r?.description??"",transport:r?.transport??"http"},e.id)})})]})})}function A({label:e,align:t="left"}){return(0,a.jsx)("th",{className:`border-b border-rule-2 px-[18px] pt-3.5 pb-2.5 font-mono text-[9.5px] font-normal whitespace-nowrap uppercase tracking-[0.16em] text-ink-4 ${"right"===t?"text-right":"text-left"}`,scope:"col",children:e})}function S({instance:e,catalogLabel:t,description:r,transport:s}){let[l,i]=(0,n.useState)(!1),o=t.slice(0,2).toUpperCase();return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("tr",{className:"border-b border-rule-2 last:border-0 hover:bg-hover",children:[(0,a.jsx)("td",{className:"px-[18px] py-[13px] align-middle",children:(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)(u.A,{variant:"conn",size:"sm",shape:"square",background:"#3565ff",children:(0,a.jsx)("span",{className:"font-mono text-[10px] font-semibold tracking-[0.04em]",children:o})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("div",{className:"text-[13.5px] font-medium leading-[1.2] text-ink",children:e.name}),(0,a.jsx)("div",{className:"mt-0.5 font-mono text-[10.5px] uppercase tracking-[0.12em] text-ink-4",children:t})]})]})}),(0,a.jsxs)("td",{className:"px-[18px] py-[13px] align-middle",children:[(0,a.jsx)("span",{className:"font-mono text-[12.5px] text-ink-2",children:e.toolCount}),0===e.toolCount&&(0,a.jsx)("span",{className:"ml-1 font-mono text-[11px] text-ink-4",children:"none"})]}),(0,a.jsx)("td",{className:"px-[18px] py-[13px] align-middle",children:(0,a.jsx)(m.A,{children:s})}),(0,a.jsx)("td",{className:"px-[18px] py-[13px] align-middle",children:(0,a.jsx)(x.A,{variant:e.active?"done":"warn",label:e.active?"Connected":"Inactive"})}),(0,a.jsx)("td",{className:"px-[18px] py-[13px] align-middle",children:(0,a.jsx)("div",{className:"flex items-center justify-end gap-2",children:(0,a.jsx)("button",{type:"button",onClick:()=>i(e=>!e),className:"inline-flex h-[30px] items-center gap-1.5 rounded-[7px] border border-rule bg-paper px-3 text-[12px] font-medium leading-none text-ink-2 transition-colors hover:bg-hover hover:text-ink",children:l?"Close":"Configure"})})})]}),l&&(0,a.jsx)("tr",{className:"border-b border-rule-2 last:border-0 bg-hover/40",children:(0,a.jsx)("td",{colSpan:5,className:"px-[18px] py-3",children:(0,a.jsx)(C,{instance:e,catalogLabel:t,description:r})})})]})}var R=r(40319),$=r(42357),M=r(37820),E=r(16237);let L=(0,h.createServerReference)("403f4b46d48174379803fe1c702be11cf63736ef46",h.callServer,void 0,h.findSourceMapURL,"createMcpServerFromCatalogAction");function P({catalogItem:e,onDone:t}){let[r,s]=(0,n.useTransition)(),[l,i]=(0,n.useState)(""),[o,d]=(0,n.useState)(""),[c,u]=(0,n.useState)(""),[m,x]=(0,n.useState)(""),[h,b]=(0,n.useState)("header"),[g,v]=(0,n.useState)(""),[f,k]=(0,n.useState)(""),[j,y]=(0,n.useState)(""),[N,C]=(0,n.useState)(()=>(e.args??[]).join("\n")),[w,A]=(0,n.useState)(()=>{let t=e.envVarNames??[];return t.length>0?t.map(e=>({key:e,value:""})):[{key:"",value:""}]}),S="custom-http-mcp"===e.slug,R="custom-stdio-mcp"===e.slug,$="stdio"===e.transport,M=$&&!R,E=!$&&null===e.serverUrl;function Z(){i(""),d(""),u(""),x(""),b("header"),v(""),k(""),y(""),C((e.args??[]).join("\n"));let t=e.envVarNames??[];A(t.length>0?t.map(e=>({key:e,value:""})):[{key:"",value:""}])}function F(){A(e=>[...e,{key:"",value:""}])}function _(e){A(t=>t.filter((t,r)=>r!==e))}function q(e,t){A(r=>r.map((r,a)=>a===e?{...r,...t}:r))}let I=m.trim()?`${m.trim().replace(/-/g,"_")}__list_things`:"my_slug__list_things";return(0,a.jsxs)("form",{onSubmit:function(r){r.preventDefault();let a=l.trim();if(!a)return void p.oR.error("Name is required");if(M){let r=N.split("\n").map(e=>e.trim()).filter(Boolean),n={};for(let e of w){let t=e.key.trim();t&&(n[t]=e.value)}s(async()=>{let s=await L({slug:e.slug,name:a,customArgs:r,customEnv:Object.keys(n).length>0?n:void 0});s.ok?(p.oR.success(`${a} connected`),Z(),t?.()):p.oR.error(s.message)});return}if(R){let r=m.trim(),n=f.trim();if(!r)return p.oR.error("Server slug is required");if(!/^[a-z0-9-]+$/.test(r))return p.oR.error("Slug must be lowercase letters, digits, dashes");if(!n)return p.oR.error("Command is required");let l=j.split("\n").map(e=>e.trim()).filter(Boolean),i={};for(let e of w){let t=e.key.trim();t&&(i[t]=e.value)}return void s(async()=>{let s=await L({slug:e.slug,name:a,customSlug:r,customCommand:n,customArgs:l,customEnv:i});s.ok?(p.oR.success(`${a} connected`),Z(),t?.()):p.oR.error(s.message)})}let n=o.trim(),i=c.trim();if(!n)return void p.oR.error("API key is required");if(E&&!i)return void p.oR.error("Server URL is required");if(S){let e=m.trim();if(!e)return p.oR.error("Server slug is required");if(!/^[a-z0-9-]+$/.test(e))return p.oR.error("Slug must be lowercase letters, digits, dashes");if("bearer"!==h&&!g.trim())return p.oR.error("Auth param name is required for this scheme")}s(async()=>{let r={slug:e.slug,name:a,apiKey:n};E&&(r.url=i),S&&(r.customSlug=m.trim(),r.customAuthScheme=h,"bearer"!==h&&(r.customAuthParamName=g.trim()));let s=await L(r);s.ok?(p.oR.success(`${a} connected`),Z(),t?.()):p.oR.error(s.message)})},className:"space-y-3",children:[e.description&&(0,a.jsx)("p",{className:"text-xs text-ink-4",children:e.description}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{htmlFor:`mcp-name-${e.slug}`,className:"block text-xs text-ink-3 mb-1",children:["Name ",(0,a.jsx)("span",{className:"text-ink-4",children:'(e.g. "Cortex — perso")'})]}),(0,a.jsx)("input",{id:`mcp-name-${e.slug}`,type:"text",required:!0,value:l,onChange:e=>i(e.target.value),placeholder:e.label,className:"w-full bg-hover border border-rule rounded-md px-2 py-1.5 text-sm text-ink placeholder:text-ink-4 focus:border-ink-3 focus:outline-none"})]}),(S||R)&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{htmlFor:`mcp-slug-${e.slug}`,className:"block text-xs text-ink-3 mb-1",children:["Server slug ",(0,a.jsx)("span",{className:"text-ink-4",children:"(tool name prefix)"})]}),(0,a.jsx)("input",{id:`mcp-slug-${e.slug}`,type:"text",required:!0,value:m,onChange:e=>x(e.target.value),placeholder:"my-server",pattern:"[a-z0-9-]+",className:"w-full bg-hover border border-rule rounded-md px-2 py-1.5 text-sm text-ink placeholder:text-ink-4 focus:border-ink-3 focus:outline-none font-mono"}),(0,a.jsxs)("p",{className:"text-[11px] text-ink-4 mt-1",children:["Tools will be named like ",(0,a.jsx)("span",{className:"font-mono text-ink-3",children:I}),". Lowercase letters, digits, dashes."]})]}),E&&(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:`mcp-url-${e.slug}`,className:"block text-xs text-ink-3 mb-1",children:"Server URL"}),(0,a.jsx)("input",{id:`mcp-url-${e.slug}`,type:"url",required:!0,value:c,onChange:e=>u(e.target.value),placeholder:"https://…",className:"w-full bg-hover border border-rule rounded-md px-2 py-1.5 text-sm text-ink placeholder:text-ink-4 focus:border-ink-3 focus:outline-none font-mono"})]}),S&&(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("p",{className:"block text-xs text-ink-3",children:"Auth scheme"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:["header","query","bearer"].map(t=>(0,a.jsxs)("label",{className:`flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs cursor-pointer border ${h===t?"bg-hover border-ink-3 text-ink":"bg-paper border-rule text-ink-3 hover:border-rule"}`,children:[(0,a.jsx)("input",{type:"radio",name:`mcp-scheme-${e.slug}`,value:t,checked:h===t,onChange:()=>b(t),className:"sr-only"}),"header"===t?"Header":"query"===t?"Query param":"Bearer"]},t))}),"bearer"!==h&&(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:`mcp-auth-param-${e.slug}`,className:"block text-xs text-ink-3 mb-1",children:"header"===h?"Header name":"Query param name"}),(0,a.jsx)("input",{id:`mcp-auth-param-${e.slug}`,type:"text",required:!0,value:g,onChange:e=>v(e.target.value),placeholder:"header"===h?"x-api-key":"api_key",className:"w-full bg-hover border border-rule rounded-md px-2 py-1.5 text-sm text-ink placeholder:text-ink-4 focus:border-ink-3 focus:outline-none font-mono"})]})]}),!$&&(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:`mcp-key-${e.slug}`,className:"block text-xs text-ink-3 mb-1",children:"API key"}),(0,a.jsx)("input",{id:`mcp-key-${e.slug}`,type:"password",required:!0,autoComplete:"off",value:o,onChange:e=>d(e.target.value),placeholder:e.keyPrefix[0]?`${e.keyPrefix[0]}…`:"",className:"w-full bg-hover border border-rule rounded-md px-2 py-1.5 text-sm text-ink placeholder:text-ink-4 focus:border-ink-3 focus:outline-none font-mono"}),e.docsHint&&(0,a.jsx)("p",{className:"text-[11px] text-ink-4 mt-1",children:e.docsHint})]}),M&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{htmlFor:`mcp-prefilled-args-${e.slug}`,className:"block text-xs text-ink-3 mb-1",children:["Arguments"," ",(0,a.jsx)("span",{className:"text-ink-4",children:"(one per line — edit placeholders like <root-directory>)"})]}),(0,a.jsx)("textarea",{id:`mcp-prefilled-args-${e.slug}`,rows:Math.max(3,(e.args??[]).length+1),value:N,onChange:e=>C(e.target.value),className:"w-full bg-hover border border-rule rounded-md px-2 py-1.5 text-sm text-ink placeholder:text-ink-4 focus:border-ink-3 focus:outline-none font-mono resize-none"}),(0,a.jsxs)("p",{className:"text-[11px] text-ink-4 mt-1",children:["Command: ",(0,a.jsx)("span",{className:"font-mono text-ink-3",children:e.command??"npx"})]})]}),(e.envVarNames??[]).length>0&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{className:"block text-xs text-ink-3 mb-1",children:["Environment variables ",(0,a.jsx)("span",{className:"text-ink-4",children:"(encrypted at rest)"})]}),(0,a.jsx)("div",{className:"space-y-2",children:w.map((e,t)=>(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("input",{type:"text",value:e.key,onChange:e=>q(t,{key:e.target.value}),placeholder:"VAR_NAME",className:"flex-1 bg-hover border border-rule rounded-md px-2 py-1.5 text-sm text-ink placeholder:text-ink-4 focus:border-ink-3 focus:outline-none font-mono"}),(0,a.jsx)("input",{type:"password",autoComplete:"off",value:e.value,onChange:e=>q(t,{value:e.target.value}),placeholder:"value",className:"flex-1 bg-hover border border-rule rounded-md px-2 py-1.5 text-sm text-ink placeholder:text-ink-4 focus:border-ink-3 focus:outline-none font-mono"}),(0,a.jsx)("button",{type:"button",onClick:()=>_(t),disabled:1===w.length,"aria-label":"Remove env var",className:"px-2 text-ink-3 hover:text-err disabled:opacity-30",children:"\xd7"})]},t))}),(0,a.jsx)("button",{type:"button",onClick:F,className:"mt-2 text-[11px] text-ink-3 hover:text-ink",children:"+ Add variable"})]}),e.docsHint&&(0,a.jsx)("p",{className:"text-[11px] text-ink-4",children:e.docsHint})]}),R&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:`mcp-command-${e.slug}`,className:"block text-xs text-ink-3 mb-1",children:"Command"}),(0,a.jsx)("input",{id:`mcp-command-${e.slug}`,type:"text",required:!0,value:f,onChange:e=>k(e.target.value),placeholder:"npx",className:"w-full bg-hover border border-rule rounded-md px-2 py-1.5 text-sm text-ink placeholder:text-ink-4 focus:border-ink-3 focus:outline-none font-mono"}),(0,a.jsx)("p",{className:"text-[11px] text-ink-4 mt-1",children:"Executable name (resolved via PATH) or absolute path."})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{htmlFor:`mcp-args-${e.slug}`,className:"block text-xs text-ink-3 mb-1",children:["Arguments ",(0,a.jsx)("span",{className:"text-ink-4",children:"(one per line)"})]}),(0,a.jsx)("textarea",{id:`mcp-args-${e.slug}`,rows:3,value:j,onChange:e=>y(e.target.value),placeholder:"-y\n@modelcontextprotocol/server-filesystem\n/path/to/folder",className:"w-full bg-hover border border-rule rounded-md px-2 py-1.5 text-sm text-ink placeholder:text-ink-4 focus:border-ink-3 focus:outline-none font-mono resize-none"})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{className:"block text-xs text-ink-3 mb-1",children:["Environment variables ",(0,a.jsx)("span",{className:"text-ink-4",children:"(encrypted at rest)"})]}),(0,a.jsx)("div",{className:"space-y-2",children:w.map((e,t)=>(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("input",{type:"text",value:e.key,onChange:e=>q(t,{key:e.target.value}),placeholder:"GITHUB_TOKEN",className:"flex-1 bg-hover border border-rule rounded-md px-2 py-1.5 text-sm text-ink placeholder:text-ink-4 focus:border-ink-3 focus:outline-none font-mono"}),(0,a.jsx)("input",{type:"password",autoComplete:"off",value:e.value,onChange:e=>q(t,{value:e.target.value}),placeholder:"value",className:"flex-1 bg-hover border border-rule rounded-md px-2 py-1.5 text-sm text-ink placeholder:text-ink-4 focus:border-ink-3 focus:outline-none font-mono"}),(0,a.jsx)("button",{type:"button",onClick:()=>_(t),disabled:1===w.length,"aria-label":"Remove env var",className:"px-2 text-ink-3 hover:text-err disabled:opacity-30",children:"\xd7"})]},t))}),(0,a.jsx)("button",{type:"button",onClick:F,className:"mt-2 text-[11px] text-ink-3 hover:text-ink",children:"+ Add variable"}),e.docsHint&&(0,a.jsx)("p",{className:"text-[11px] text-ink-4 mt-2",children:e.docsHint})]})]}),(0,a.jsx)("button",{type:"submit",disabled:r||!l.trim(),className:"px-4 py-2 text-sm font-semibold bg-ink text-canvas rounded-md hover:brightness-[0.92] disabled:opacity-50",children:r?"Connecting…":"Connect"})]})}function Z(e){return"cogni-cortex"===e?"Comms":"stripe"===e||"mcp-postgres"===e||"supabase"===e||"airtable"===e?"Data":"mcp-filesystem"===e||"mcp-git"===e||"mcp-github"===e||"sentry"===e?"Dev":"mcp-fetch"===e||"mcp-playwright"===e||"apify"===e?"Web":"composio"===e||"linear"===e||"n8n"===e||"notion"===e?"Productivity":e.startsWith("custom-")?"Custom":"Other"}let F=[{value:"All",label:"All"},{value:"Comms",label:"Comms"},{value:"Data",label:"Data"},{value:"Dev",label:"Dev"},{value:"Web",label:"Web"},{value:"Productivity",label:"Productivity"},{value:"Custom",label:"Custom"},{value:"Other",label:"Other"}];function _({catalog:e,instances:t,category:r,onCategoryChange:n}){return(0,a.jsxs)("div",{children:[(0,a.jsx)($.A,{items:F,value:r,onChange:n,className:"mb-[18px]"}),0===e.length?(0,a.jsx)("div",{className:"rounded-2xl border border-rule-2 bg-paper px-6 py-12 text-center",children:(0,a.jsx)("p",{className:"text-[13px] text-ink-3",children:"No servers in this category."})}):(0,a.jsx)("div",{className:"grid auto-rows-fr grid-cols-1 gap-3.5 md:grid-cols-2 lg:grid-cols-4",children:e.map(e=>{let r=t.filter(t=>t.slug===e.slug),n=r.length>0;return(0,a.jsx)(q,{catalogItem:e,isInstalled:n,installedCount:r.length},e.slug)})})]})}function q({catalogItem:e,isInstalled:t,installedCount:r}){let[l,i]=(0,n.useState)(!1),o=(0,s.useRouter)(),d=e.label.slice(0,2).toUpperCase(),u=Z(e.slug),m="pending"===e.status;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(M.A,{glyph:(0,a.jsx)("span",{className:"font-mono text-[10px] font-semibold tracking-[0.04em]",children:d}),glyphVariant:"conn",glyphBackground:"#3565ff",name:e.label,description:e.description,category:u,topRight:t||m?(0,a.jsxs)("span",{className:"flex items-center gap-1.5",children:[m&&(0,a.jsx)("span",{className:"inline-flex items-center rounded-[6px] bg-warn-bg px-2 py-1 font-sans text-[11px] font-medium text-warn",title:"Not yet verified end-to-end — connection params may need adjusting.",children:"Test pending"}),t&&(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-[6px] bg-ok-bg px-2 py-1 font-sans text-[11px] font-medium text-ok",children:[(0,a.jsx)(R.r,{size:11,weight:"regular"}),r," installed"]})]}):void 0,foot:(0,a.jsx)(E.A,{ctaLabel:t?"Add account":"Install",ctaVariant:"blue",onCta:()=>i(!0)})}),(0,a.jsx)(c.A,{open:l,onClose:()=>i(!1),title:t?`Add account — ${e.label}`:`Install ${e.label}`,children:(0,a.jsx)(P,{catalogItem:e,onDone:function(){i(!1),o.refresh()}})})]})}function I({instances:e,catalog:t}){let r=(0,s.useRouter)(),[u,m]=(0,n.useState)(e.length>0?"installed":"marketplace"),[x,p]=(0,n.useState)(""),[h,b]=(0,n.useState)("All"),[g,v]=(0,n.useState)(!1),[f,k]=(0,n.useState)("stdio"),j=t.find(e=>"custom-http-mcp"===e.slug),y=t.find(e=>"custom-stdio-mcp"===e.slug),N="http"===f?j:y,C=(0,n.useMemo)(()=>{if(!x.trim())return e;let t=x.toLowerCase();return e.filter(e=>e.name.toLowerCase().includes(t)||e.slug.toLowerCase().includes(t))},[e,x]),A=(0,n.useMemo)(()=>{let e=t;if("All"!==h&&(e=e.filter(e=>Z(e.slug)===h)),x.trim()){let t=x.toLowerCase();e=e.filter(e=>e.label.toLowerCase().includes(t)||e.description.toLowerCase().includes(t))}return e},[t,h,x]);return(0,a.jsxs)("div",{className:"pb-10",children:[(0,a.jsx)(l.A,{title:"MCP Connectors",subtitle:"Model Context Protocol servers your agents can call. Install from the marketplace or wire a custom HTTP / stdio server."}),(0,a.jsx)(i.A,{tabs:(0,a.jsx)(o.A,{value:u,onChange:e=>{m(e),p(""),b("All")},tabs:[{value:"installed",label:"Installed",count:e.length},{value:"marketplace",label:"Marketplace",count:t.length}]}),search:(0,a.jsx)(d.A,{value:x,onChange:p,placeholder:"installed"===u?"Search MCP servers…":"Search catalog…"}),cta:(0,a.jsx)("button",{type:"button",onClick:()=>v(!0),className:"inline-flex h-[34px] items-center gap-1.5 rounded-md bg-conn-vivid px-3.5 text-[13px] font-medium leading-none text-white transition-[filter] hover:brightness-[0.94]",children:"+ Add custom MCP"})}),(0,a.jsx)("div",{className:"pt-5",children:"installed"===u?0===e.length?(0,a.jsx)(H,{onBrowse:()=>m("marketplace")}):0===C.length?(0,a.jsx)(T,{}):(0,a.jsx)(w,{instances:C,catalog:t}):(0,a.jsx)(_,{catalog:A,instances:e,category:h,onCategoryChange:b})}),(0,a.jsx)(c.A,{open:g,onClose:()=>v(!1),title:"Add a custom MCP server",children:(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)("div",{className:"flex gap-2",children:["stdio","http"].map(e=>(0,a.jsx)("button",{type:"button",onClick:()=>k(e),className:`flex-1 rounded-md border px-3 py-2 text-xs font-medium ${f===e?"border-ink-3 bg-hover text-ink":"border-rule bg-paper text-ink-3 hover:border-rule"}`,children:"stdio"===e?"Local subprocess (stdio)":"Remote server (HTTP)"},e))}),(0,a.jsx)("p",{className:"text-[11px] text-ink-4",children:"stdio"===f?"Run any MCP package locally (npx, python, a binary…). Provide the command, args, and env vars.":"Connect any Streamable-HTTP MCP server. Provide the URL, auth scheme, and API key."}),N?(0,a.jsx)(P,{catalogItem:N,onDone:()=>{v(!1),r.refresh()}},f):(0,a.jsx)("p",{className:"text-xs text-err",children:"Custom MCP option is unavailable."})]})})]})}function H({onBrowse:e}){return(0,a.jsxs)("div",{className:"rounded-2xl border border-rule-2 bg-paper px-6 py-12 text-center",children:[(0,a.jsxs)("p",{className:"text-[13px] leading-[1.5] text-ink-3",children:["No MCP servers installed yet.",(0,a.jsx)("br",{}),"Pick one from the Marketplace — its tools become available to any agent you assign it to."]}),(0,a.jsx)("div",{className:"mt-4 inline-flex",children:(0,a.jsx)("button",{type:"button",onClick:e,className:"inline-flex h-[34px] items-center gap-1.5 rounded-md bg-conn-vivid px-3.5 text-[13px] font-medium leading-none text-white transition-[filter] hover:brightness-[0.94]",children:"Browse Marketplace"})})]})}function T(){return(0,a.jsx)("div",{className:"rounded-2xl border border-rule-2 bg-paper px-6 py-12 text-center",children:(0,a.jsx)("p",{className:"text-[13px] leading-[1.5] text-ink-3",children:"No servers match your search."})})}},22089:(e,t,r)=>{"use strict";r.d(t,{N:()=>i});var a=r(78604),n=r(5977);let s=new Map([["bold",a.createElement(a.Fragment,null,a.createElement("path",{d:"M240.26,186.1,152.81,34.23h0a28.74,28.74,0,0,0-49.62,0L15.74,186.1a27.45,27.45,0,0,0,0,27.71A28.31,28.31,0,0,0,40.55,228h174.9a28.31,28.31,0,0,0,24.79-14.19A27.45,27.45,0,0,0,240.26,186.1Zm-20.8,15.7a4.46,4.46,0,0,1-4,2.2H40.55a4.46,4.46,0,0,1-4-2.2,3.56,3.56,0,0,1,0-3.73L124,46.2a4.77,4.77,0,0,1,8,0l87.44,151.87A3.56,3.56,0,0,1,219.46,201.8ZM116,136V104a12,12,0,0,1,24,0v32a12,12,0,0,1-24,0Zm28,40a16,16,0,1,1-16-16A16,16,0,0,1,144,176Z"}))],["duotone",a.createElement(a.Fragment,null,a.createElement("path",{d:"M215.46,216H40.54C27.92,216,20,202.79,26.13,192.09L113.59,40.22c6.3-11,22.52-11,28.82,0l87.46,151.87C236,202.79,228.08,216,215.46,216Z",opacity:"0.2"}),a.createElement("path",{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z"}))],["fill",a.createElement(a.Fragment,null,a.createElement("path",{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM120,104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm8,88a12,12,0,1,1,12-12A12,12,0,0,1,128,192Z"}))],["light",a.createElement(a.Fragment,null,a.createElement("path",{d:"M235.07,189.09,147.61,37.22h0a22.75,22.75,0,0,0-39.22,0L20.93,189.09a21.53,21.53,0,0,0,0,21.72A22.35,22.35,0,0,0,40.55,222h174.9a22.35,22.35,0,0,0,19.6-11.19A21.53,21.53,0,0,0,235.07,189.09ZM224.66,204.8a10.46,10.46,0,0,1-9.21,5.2H40.55a10.46,10.46,0,0,1-9.21-5.2,9.51,9.51,0,0,1,0-9.72L118.79,43.21a10.75,10.75,0,0,1,18.42,0l87.46,151.87A9.51,9.51,0,0,1,224.66,204.8ZM122,144V104a6,6,0,0,1,12,0v40a6,6,0,0,1-12,0Zm16,36a10,10,0,1,1-10-10A10,10,0,0,1,138,180Z"}))],["regular",a.createElement(a.Fragment,null,a.createElement("path",{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z"}))],["thin",a.createElement(a.Fragment,null,a.createElement("path",{d:"M233.34,190.09,145.88,38.22h0a20.75,20.75,0,0,0-35.76,0L22.66,190.09a19.52,19.52,0,0,0,0,19.71A20.36,20.36,0,0,0,40.54,220H215.46a20.36,20.36,0,0,0,17.86-10.2A19.52,19.52,0,0,0,233.34,190.09ZM226.4,205.8a12.47,12.47,0,0,1-10.94,6.2H40.54a12.47,12.47,0,0,1-10.94-6.2,11.45,11.45,0,0,1,0-11.72L117.05,42.21a12.76,12.76,0,0,1,21.9,0L226.4,194.08A11.45,11.45,0,0,1,226.4,205.8ZM124,144V104a4,4,0,0,1,8,0v40a4,4,0,0,1-8,0Zm12,36a8,8,0,1,1-8-8A8,8,0,0,1,136,180Z"}))]]),l=a.forwardRef((e,t)=>a.createElement(n.A,{ref:t,...e,weights:s}));l.displayName="WarningIcon";let i=l},27540:(e,t,r)=>{"use strict";var a=r(71268);r.o(a,"usePathname")&&r.d(t,{usePathname:function(){return a.usePathname}}),r.o(a,"useRouter")&&r.d(t,{useRouter:function(){return a.useRouter}}),r.o(a,"useSearchParams")&&r.d(t,{useSearchParams:function(){return a.useSearchParams}})},40319:(e,t,r)=>{"use strict";r.d(t,{r:()=>i});var a=r(78604),n=r(53087),s=r(54935);let l=a.forwardRef((e,t)=>a.createElement(n.A,{ref:t,...e,weights:s.A}));l.displayName="CheckCircleIcon";let i=l},42357:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});var a=r(3680);function n({items:e,value:t,onChange:r,className:s=""}){return(0,a.jsx)("div",{className:`flex flex-wrap items-center gap-2 ${s}`,children:e.map(e=>{let n=e.value===t;return(0,a.jsxs)("button",{type:"button",onClick:()=>r(e.value),className:`inline-flex h-8 items-center gap-1.5 rounded-[9px] border px-3.5 text-[12.5px] font-medium leading-none transition-colors ${n?"border-ink bg-ink text-canvas":"border-rule-2 bg-paper text-ink-2 hover:bg-hover"}`,children:[e.label,void 0!==e.count&&(0,a.jsx)("span",{className:`font-mono text-[11px] leading-none ${n?"opacity-65":"opacity-55"}`,children:e.count})]},e.value)})})}},54935:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});var a=r(78604);let n=new Map([["bold",a.createElement(a.Fragment,null,a.createElement("path",{d:"M176.49,95.51a12,12,0,0,1,0,17l-56,56a12,12,0,0,1-17,0l-24-24a12,12,0,1,1,17-17L112,143l47.51-47.52A12,12,0,0,1,176.49,95.51ZM236,128A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Z"}))],["duotone",a.createElement(a.Fragment,null,a.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),a.createElement("path",{d:"M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["fill",a.createElement(a.Fragment,null,a.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm45.66,85.66-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35a8,8,0,0,1,11.32,11.32Z"}))],["light",a.createElement(a.Fragment,null,a.createElement("path",{d:"M172.24,99.76a6,6,0,0,1,0,8.48l-56,56a6,6,0,0,1-8.48,0l-24-24a6,6,0,0,1,8.48-8.48L112,151.51l51.76-51.75A6,6,0,0,1,172.24,99.76ZM230,128A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",a.createElement(a.Fragment,null,a.createElement("path",{d:"M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["thin",a.createElement(a.Fragment,null,a.createElement("path",{d:"M170.83,101.17a4,4,0,0,1,0,5.66l-56,56a4,4,0,0,1-5.66,0l-24-24a4,4,0,0,1,5.66-5.66L112,154.34l53.17-53.17A4,4,0,0,1,170.83,101.17ZM228,128A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]])},64678:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={callServer:function(){return s.callServer},createServerReference:function(){return i.createServerReference},findSourceMapURL:function(){return l.findSourceMapURL}};for(var n in a)Object.defineProperty(t,n,{enumerable:!0,get:a[n]});let s=r(22673),l=r(43145),i=r(87478)},82592:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});var a=r(3680);let n={ok:"bg-ok",lime:"bg-agent-vivid",coral:"bg-skill-vivid",blue:"bg-conn-vivid"},s={ok:"animate-[blip_1.4s_ease-out_infinite]",lime:"animate-[blip-lime_1.5s_ease-out_infinite]",coral:"animate-[blip-coral_1.4s_ease-out_infinite]",blue:"animate-[blip-blue_1.4s_ease-out_infinite]"};function l({variant:e="ok",size:t="sm",animate:r=!0,className:i=""}){return(0,a.jsx)("span",{className:`inline-block shrink-0 rounded-full ${"sm"===t?"h-[7px] w-[7px]":"h-2 w-2"} ${n[e]} ${r?s[e]:""} ${i}`})}},86127:(e,t,r)=>{"use strict";r.d(t,{r:()=>i});var a=r(78604),n=r(5977),s=r(54935);let l=a.forwardRef((e,t)=>a.createElement(n.A,{ref:t,...e,weights:s.A}));l.displayName="CheckCircleIcon";let i=l},93606:(e,t,r)=>{"use strict";r.d(t,{A:()=>d});var a=r(3680),n=r(86127),s=r(22089),l=r(82592);let i={done:"Done",warn:"Attention",run:"Running",idle:"Idle","lvl-info":"INFO","lvl-ok":"OK","lvl-warn":"WARN","lvl-err":"ERR"},o={done:"bg-ok-bg text-ok",warn:"bg-warn-bg text-warn",run:"bg-run-bg text-run",idle:"bg-black/5 text-ink-3 dark:bg-white/5","lvl-info":"bg-black/5 text-ink-3 dark:bg-white/5","lvl-ok":"bg-ok-bg text-ok","lvl-warn":"bg-warn-bg text-warn","lvl-err":"bg-warn-bg text-err"};function d({variant:e,label:t,icon:r,className:c=""}){let u=t??i[e],m=null;return void 0!==r?m=r:"done"===e?m=(0,a.jsx)(n.r,{size:11,weight:"regular"}):"warn"===e?m=(0,a.jsx)(s.N,{size:11,weight:"regular"}):"run"===e&&(m=(0,a.jsx)(l.A,{variant:"blue",size:"sm"})),(0,a.jsxs)("span",{className:`inline-flex h-[22px] items-center gap-1.5 rounded-[5px] px-2.5 text-[11px] font-medium leading-none ${o[e]} ${c}`,children:[m,u]})}}},e=>{e.O(0,[3363,9504,8396,1065,8724,7358],()=>e(e.s=1489)),_N_E=e.O()}]);