nodal-agents 0.4.0 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. package/README.md +38 -14
  2. package/cli.js +16 -1
  3. package/migrations/0030_agent_fallback_llm_keys.sql +6 -0
  4. package/migrations/0031_llm_key_capabilities.sql +7 -0
  5. package/migrations/0032_drop_llm_key_model_caps.sql +9 -0
  6. package/migrations/0033_agent_fallback_chain.sql +21 -0
  7. package/migrations/meta/_journal.json +28 -0
  8. package/package.json +1 -1
  9. package/runner.js +512 -79
  10. package/web/.next/BUILD_ID +1 -1
  11. package/web/.next/build-manifest.json +2 -2
  12. package/web/.next/prerender-manifest.json +3 -3
  13. package/web/.next/server/app/(dashboard)/agents/[id]/edit/page.js +3 -3
  14. package/web/.next/server/app/(dashboard)/agents/[id]/edit/page.js.nft.json +1 -1
  15. package/web/.next/server/app/(dashboard)/agents/[id]/edit/page_client-reference-manifest.js +1 -1
  16. package/web/.next/server/app/(dashboard)/agents/[id]/telegram/page.js +1 -1
  17. package/web/.next/server/app/(dashboard)/agents/[id]/telegram/page.js.nft.json +1 -1
  18. package/web/.next/server/app/(dashboard)/agents/[id]/telegram/page_client-reference-manifest.js +1 -1
  19. package/web/.next/server/app/(dashboard)/agents/page.js +2 -2
  20. package/web/.next/server/app/(dashboard)/agents/page.js.nft.json +1 -1
  21. package/web/.next/server/app/(dashboard)/agents/page_client-reference-manifest.js +1 -1
  22. package/web/.next/server/app/(dashboard)/approvals/page.js +2 -2
  23. package/web/.next/server/app/(dashboard)/approvals/page.js.nft.json +1 -1
  24. package/web/.next/server/app/(dashboard)/approvals/page_client-reference-manifest.js +1 -1
  25. package/web/.next/server/app/(dashboard)/automations/page.js +1 -1
  26. package/web/.next/server/app/(dashboard)/automations/page.js.nft.json +1 -1
  27. package/web/.next/server/app/(dashboard)/automations/page_client-reference-manifest.js +1 -1
  28. package/web/.next/server/app/(dashboard)/billing/page.js +1 -1
  29. package/web/.next/server/app/(dashboard)/billing/page.js.nft.json +1 -1
  30. package/web/.next/server/app/(dashboard)/billing/page_client-reference-manifest.js +1 -1
  31. package/web/.next/server/app/(dashboard)/chat/page.js +2 -2
  32. package/web/.next/server/app/(dashboard)/chat/page.js.nft.json +1 -1
  33. package/web/.next/server/app/(dashboard)/chat/page_client-reference-manifest.js +1 -1
  34. package/web/.next/server/app/(dashboard)/connectors/page.js +1 -1
  35. package/web/.next/server/app/(dashboard)/connectors/page.js.nft.json +1 -1
  36. package/web/.next/server/app/(dashboard)/connectors/page_client-reference-manifest.js +1 -1
  37. package/web/.next/server/app/(dashboard)/credentials/page.js +1 -1
  38. package/web/.next/server/app/(dashboard)/credentials/page.js.nft.json +1 -1
  39. package/web/.next/server/app/(dashboard)/credentials/page_client-reference-manifest.js +1 -1
  40. package/web/.next/server/app/(dashboard)/jobs/[id]/page.js +2 -2
  41. package/web/.next/server/app/(dashboard)/jobs/[id]/page.js.nft.json +1 -1
  42. package/web/.next/server/app/(dashboard)/jobs/[id]/page_client-reference-manifest.js +1 -1
  43. package/web/.next/server/app/(dashboard)/jobs/page.js +2 -2
  44. package/web/.next/server/app/(dashboard)/jobs/page.js.nft.json +1 -1
  45. package/web/.next/server/app/(dashboard)/jobs/page_client-reference-manifest.js +1 -1
  46. package/web/.next/server/app/(dashboard)/llm-providers/page.js +2 -2
  47. package/web/.next/server/app/(dashboard)/llm-providers/page.js.nft.json +1 -1
  48. package/web/.next/server/app/(dashboard)/llm-providers/page_client-reference-manifest.js +1 -1
  49. package/web/.next/server/app/(dashboard)/logs/page.js +1 -1
  50. package/web/.next/server/app/(dashboard)/logs/page.js.nft.json +1 -1
  51. package/web/.next/server/app/(dashboard)/logs/page_client-reference-manifest.js +1 -1
  52. package/web/.next/server/app/(dashboard)/mcp/page.js +2 -2
  53. package/web/.next/server/app/(dashboard)/mcp/page.js.nft.json +1 -1
  54. package/web/.next/server/app/(dashboard)/mcp/page_client-reference-manifest.js +1 -1
  55. package/web/.next/server/app/(dashboard)/memories/page.js +2 -2
  56. package/web/.next/server/app/(dashboard)/memories/page.js.nft.json +1 -1
  57. package/web/.next/server/app/(dashboard)/memories/page_client-reference-manifest.js +1 -1
  58. package/web/.next/server/app/(dashboard)/page.js +3 -3
  59. package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
  60. package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  61. package/web/.next/server/app/(dashboard)/settings/page.js +2 -2
  62. package/web/.next/server/app/(dashboard)/settings/page.js.nft.json +1 -1
  63. package/web/.next/server/app/(dashboard)/settings/page_client-reference-manifest.js +1 -1
  64. package/web/.next/server/app/(dashboard)/skills/[id]/edit/page.js +1 -1
  65. package/web/.next/server/app/(dashboard)/skills/[id]/edit/page.js.nft.json +1 -1
  66. package/web/.next/server/app/(dashboard)/skills/[id]/edit/page_client-reference-manifest.js +1 -1
  67. package/web/.next/server/app/(dashboard)/skills/new/page.js +2 -2
  68. package/web/.next/server/app/(dashboard)/skills/new/page.js.nft.json +1 -1
  69. package/web/.next/server/app/(dashboard)/skills/new/page_client-reference-manifest.js +1 -1
  70. package/web/.next/server/app/(dashboard)/skills/page.js +2 -2
  71. package/web/.next/server/app/(dashboard)/skills/page.js.nft.json +1 -1
  72. package/web/.next/server/app/(dashboard)/skills/page_client-reference-manifest.js +1 -1
  73. package/web/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  74. package/web/.next/server/app/_global-error.html +1 -1
  75. package/web/.next/server/app/_global-error.rsc +2 -2
  76. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +2 -2
  77. package/web/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  78. package/web/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  79. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  80. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +2 -2
  81. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  82. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  83. package/web/.next/server/app/_not-found.html +1 -1
  84. package/web/.next/server/app/_not-found.rsc +3 -3
  85. package/web/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
  86. package/web/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  87. package/web/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
  88. package/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  89. package/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  90. package/web/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  91. package/web/.next/server/app/api/oauth/[provider]/callback/route.js +1 -1
  92. package/web/.next/server/app/api/oauth/[provider]/start/route.js +1 -1
  93. package/web/.next/server/app/login/page_client-reference-manifest.js +1 -1
  94. package/web/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  95. package/web/.next/server/app/onboarding.html +1 -1
  96. package/web/.next/server/app/onboarding.rsc +3 -3
  97. package/web/.next/server/app/onboarding.segments/_full.segment.rsc +3 -3
  98. package/web/.next/server/app/onboarding.segments/_head.segment.rsc +1 -1
  99. package/web/.next/server/app/onboarding.segments/_index.segment.rsc +3 -3
  100. package/web/.next/server/app/onboarding.segments/_tree.segment.rsc +2 -2
  101. package/web/.next/server/app/onboarding.segments/onboarding/__PAGE__.segment.rsc +1 -1
  102. package/web/.next/server/app/onboarding.segments/onboarding.segment.rsc +1 -1
  103. package/web/.next/server/chunks/1945.js +1 -0
  104. package/web/.next/server/chunks/3233.js +1 -0
  105. package/web/.next/server/chunks/4574.js +1 -1
  106. package/web/.next/server/chunks/4808.js +1 -0
  107. package/web/.next/server/chunks/4839.js +1 -0
  108. package/web/.next/server/chunks/{3057.js → 7466.js} +1 -1
  109. package/web/.next/server/chunks/7741.js +3 -3
  110. package/web/.next/server/chunks/8206.js +1 -0
  111. package/web/.next/server/chunks/8398.js +1 -0
  112. package/web/.next/server/chunks/{7557.js → 9606.js} +2 -2
  113. package/web/.next/server/middleware-build-manifest.js +1 -1
  114. package/web/.next/server/pages/404.html +1 -1
  115. package/web/.next/server/pages/500.html +1 -1
  116. package/web/.next/server/server-reference-manifest.js +1 -1
  117. package/web/.next/server/server-reference-manifest.json +1 -1
  118. package/web/.next/static/chunks/{9060-df7c0c4c6fa27737.js → 2575-e660568bd1a9bcb6.js} +2 -2
  119. package/web/.next/static/chunks/3233-e6efb7fb1fa24591.js +1 -0
  120. package/web/.next/static/chunks/5436-c1006a40e59853ed.js +1 -0
  121. package/web/.next/static/chunks/7025-7afa82fda10bddc4.js +62 -0
  122. package/web/.next/static/chunks/{5801-e411029984b17b8b.js → 8396-f3502b9af3172006.js} +1 -1
  123. package/web/.next/static/chunks/{8503-ced632da5c3fce79.js → 9098-2bfef80a73c706b3.js} +1 -1
  124. package/web/.next/static/chunks/9123-20653d928e33410a.js +1 -0
  125. package/web/.next/static/chunks/{6679-7c76034b83edeb06.js → 9582-fbf7c8d9b2a39101.js} +1 -1
  126. package/web/.next/static/chunks/app/(dashboard)/agents/[id]/edit/page-a8e293c54c818084.js +2 -0
  127. package/web/.next/static/chunks/app/(dashboard)/agents/[id]/telegram/{page-e6b35d5f361044a9.js → page-7a94ae67b2c3c9c3.js} +1 -1
  128. package/web/.next/static/chunks/app/(dashboard)/agents/page-b258b8975ac6450b.js +1 -0
  129. package/web/.next/static/chunks/app/(dashboard)/approvals/page-79dea6e91956eeba.js +1 -0
  130. package/web/.next/static/chunks/app/(dashboard)/automations/page-3b863b7af8e2c1a3.js +1 -0
  131. package/web/.next/static/chunks/app/(dashboard)/chat/page-4d965bb7ee3732db.js +1 -0
  132. package/web/.next/static/chunks/app/(dashboard)/connectors/page-4a437ba82f4086da.js +1 -0
  133. package/web/.next/static/chunks/app/(dashboard)/jobs/[id]/page-be20dcbf25c8f3ce.js +1 -0
  134. package/web/.next/static/chunks/app/(dashboard)/jobs/page-94a311f688a255d8.js +1 -0
  135. package/web/.next/static/chunks/app/(dashboard)/layout-e1b0d4fad2926646.js +1 -0
  136. package/web/.next/static/chunks/app/(dashboard)/llm-providers/page-e5e2c4e2b783d37f.js +1 -0
  137. package/web/.next/static/chunks/app/(dashboard)/mcp/page-c071c54f76273ac4.js +1 -0
  138. package/web/.next/static/chunks/app/(dashboard)/memories/page-8ca0b34ad35eb1fa.js +1 -0
  139. package/web/.next/static/chunks/app/(dashboard)/{page-fc49d7ed8e472118.js → page-fb50e1576a3ab2e4.js} +1 -1
  140. package/web/.next/static/chunks/app/(dashboard)/settings/page-7b256e9c462e97f8.js +1 -0
  141. package/web/.next/static/chunks/app/(dashboard)/skills/[id]/edit/page-12930816795e8b20.js +1 -0
  142. package/web/.next/static/chunks/app/(dashboard)/skills/new/page-e3a19abaf7468db9.js +1 -0
  143. package/web/.next/static/chunks/app/(dashboard)/skills/page-43f1475a0bc9c45f.js +1 -0
  144. package/web/.next/static/css/78ead23854ab041e.css +3 -0
  145. package/web/.next/server/chunks/1511.js +0 -1
  146. package/web/.next/server/chunks/2103.js +0 -1
  147. package/web/.next/server/chunks/211.js +0 -1
  148. package/web/.next/server/chunks/8178.js +0 -1
  149. package/web/.next/server/chunks/9201.js +0 -1
  150. package/web/.next/server/chunks/9824.js +0 -1
  151. package/web/.next/static/chunks/1165-ec573be2aa63710b.js +0 -1
  152. package/web/.next/static/chunks/2569-6b5e0af9c1f584a4.js +0 -1
  153. package/web/.next/static/chunks/6522-3f865de55adb618d.js +0 -1
  154. package/web/.next/static/chunks/921-f437093debcddbb3.js +0 -1
  155. package/web/.next/static/chunks/9421-d522a48618c4fe37.js +0 -62
  156. package/web/.next/static/chunks/app/(dashboard)/agents/[id]/edit/page-d3724fbf38b71806.js +0 -2
  157. package/web/.next/static/chunks/app/(dashboard)/agents/page-b58294bf588f4581.js +0 -1
  158. package/web/.next/static/chunks/app/(dashboard)/approvals/page-b9e504918d043b6d.js +0 -1
  159. package/web/.next/static/chunks/app/(dashboard)/automations/page-4807e81e2af3030e.js +0 -1
  160. package/web/.next/static/chunks/app/(dashboard)/chat/page-2c8f9571a443f250.js +0 -1
  161. package/web/.next/static/chunks/app/(dashboard)/connectors/page-72ccb0e3a5ed6f2d.js +0 -1
  162. package/web/.next/static/chunks/app/(dashboard)/jobs/[id]/page-40172a14d0b1368f.js +0 -1
  163. package/web/.next/static/chunks/app/(dashboard)/jobs/page-d4a3a16745e02fd1.js +0 -1
  164. package/web/.next/static/chunks/app/(dashboard)/layout-4d5634ba460464d7.js +0 -1
  165. package/web/.next/static/chunks/app/(dashboard)/llm-providers/page-90fb785e2ab32759.js +0 -1
  166. package/web/.next/static/chunks/app/(dashboard)/mcp/page-426478332dfe8313.js +0 -1
  167. package/web/.next/static/chunks/app/(dashboard)/memories/page-aa46f5f7efbfa262.js +0 -1
  168. package/web/.next/static/chunks/app/(dashboard)/settings/page-1cc10beb46234c7d.js +0 -1
  169. package/web/.next/static/chunks/app/(dashboard)/skills/[id]/edit/page-0b61f21847f4c7a0.js +0 -1
  170. package/web/.next/static/chunks/app/(dashboard)/skills/new/page-9de96e643c361732.js +0 -1
  171. package/web/.next/static/chunks/app/(dashboard)/skills/page-4566512d74e54bfe.js +0 -1
  172. package/web/.next/static/css/0a81480f93d3ab37.css +0 -3
  173. /package/web/.next/static/{9FXcaPSw8KYgjKzjKLpT2 → ZuUX-HBTQOhLf0tFI6JQI}/_buildManifest.js +0 -0
  174. /package/web/.next/static/{9FXcaPSw8KYgjKzjKLpT2 → ZuUX-HBTQOhLf0tFI6JQI}/_ssgManifest.js +0 -0
@@ -0,0 +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(39035),U=n(47232);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})})}},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})})}},39035:(e,t,n)=>{"use strict";n.d(t,{W:()=>i});var r=n(64678);let i=(0,r.createServerReference)("4052967950b494e22cd435b66a556d540a965df63a",r.callServer,void 0,r.findSourceMapURL,"switchWorkspaceAction")},47232:(e,t,n)=>{"use strict";n.d(t,{O:()=>i});var r=n(64678);let i=(0,r.createServerReference)("40a2f99fceaa61fd4a74b0c6f3b01f599d36e2ea48",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,80492))},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},80492:(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)("40de046de0bddf3387f259087a088306728aef5546",u.callServer,void 0,u.findSourceMapURL,"deleteLlmKeyAction"),x=(0,u.createServerReference)("6027df2597319ed4f15048c44cfae75dec92fd42fc",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,v]=(0,n.useState)(!1),[b,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:b||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:()=>v(!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(){v(!1),o(async()=>{let t=await p(e.id);t.ok?(c.oR.success("LLM provider removed"),a()):c.oR.error(t.message)})},onCancel:()=>v(!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 v=(0,u.createServerReference)("40162d8df2e52a907c99cd0a9d8d4bc05202f4d5e5",u.callServer,void 0,u.findSourceMapURL,"testLlmKeyAction"),b=(0,u.createServerReference)("4037207befca10bb542d700e5232bd286c98781d5e",u.callServer,void 0,u.findSourceMapURL,"updateLlmKeyAction"),k=(0,u.createServerReference)("405e6ab4f6b3f7d0ca79943dd7c850fefad7099fbe",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 v({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 b({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,24170))},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}},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},24170:(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)("409c323309b6e0c70c7e5fa891476c4f8a5724ed85",h.callServer,void 0,h.findSourceMapURL,"deleteMcpServerAction"),g=(0,h.createServerReference)("60e1dae0f6fcb459194ac6847f177cd7ea5167958d",h.callServer,void 0,h.findSourceMapURL,"renameMcpServerAction"),v=(0,h.createServerReference)("60a525fb1a7d0371de2f00a8eb7c3bda7a31685ea6",h.callServer,void 0,h.findSourceMapURL,"updateMcpServerApiKeyAction");var f=r(14308);let k=(0,h.createServerReference)("4067a8d48830fe5172f84c37187e6a2383152974dc",h.callServer,void 0,h.findSourceMapURL,"getMcpServerConfigAction"),j=(0,h.createServerReference)("60b2ec0fde8727e97be37bfe26f8a86ad2dcb409be",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)("40c2a1a8bbe7ffe80d3ff0c990a6c8654ded77d9a1",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."})})}},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()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4244],{1442:(e,t,r)=>{"use strict";r.d(t,{default:()=>Z});var l=r(3680),a=r(78604),n=r(63363),s=r.n(n),i=r(39504),c=r(32307),o=r(65668),d=r(28870),x=r(66736),m=r(77045),u=r(5977);let p=new Map([["bold",a.createElement(a.Fragment,null,a.createElement("path",{d:"M208.49,152.49l-72,72a12,12,0,0,1-17,0l-72-72a12,12,0,0,1,17-17L116,187V40a12,12,0,0,1,24,0V187l51.51-51.52a12,12,0,0,1,17,17Z"}))],["duotone",a.createElement(a.Fragment,null,a.createElement("path",{d:"M200,144l-72,72L56,144Z",opacity:"0.2"}),a.createElement("path",{d:"M207.39,140.94A8,8,0,0,0,200,136H136V40a8,8,0,0,0-16,0v96H56a8,8,0,0,0-5.66,13.66l72,72a8,8,0,0,0,11.32,0l72-72A8,8,0,0,0,207.39,140.94ZM128,204.69,75.31,152H180.69Z"}))],["fill",a.createElement(a.Fragment,null,a.createElement("path",{d:"M205.66,149.66l-72,72a8,8,0,0,1-11.32,0l-72-72A8,8,0,0,1,56,136h64V40a8,8,0,0,1,16,0v96h64a8,8,0,0,1,5.66,13.66Z"}))],["light",a.createElement(a.Fragment,null,a.createElement("path",{d:"M204.24,148.24l-72,72a6,6,0,0,1-8.48,0l-72-72a6,6,0,0,1,8.48-8.48L122,201.51V40a6,6,0,0,1,12,0V201.51l61.76-61.75a6,6,0,0,1,8.48,8.48Z"}))],["regular",a.createElement(a.Fragment,null,a.createElement("path",{d:"M205.66,149.66l-72,72a8,8,0,0,1-11.32,0l-72-72a8,8,0,0,1,11.32-11.32L120,196.69V40a8,8,0,0,1,16,0V196.69l58.34-58.35a8,8,0,0,1,11.32,11.32Z"}))],["thin",a.createElement(a.Fragment,null,a.createElement("path",{d:"M202.83,146.83l-72,72a4,4,0,0,1-5.66,0l-72-72a4,4,0,0,1,5.66-5.66L124,206.34V40a4,4,0,0,1,8,0V206.34l65.17-65.17a4,4,0,0,1,5.66,5.66Z"}))]]),h=a.forwardRef((e,t)=>a.createElement(u.A,{ref:t,...e,weights:p}));h.displayName="ArrowDownIcon";let g=new Map([["bold",a.createElement(a.Fragment,null,a.createElement("path",{d:"M208.49,120.49a12,12,0,0,1-17,0L140,69V216a12,12,0,0,1-24,0V69L64.49,120.49a12,12,0,0,1-17-17l72-72a12,12,0,0,1,17,0l72,72A12,12,0,0,1,208.49,120.49Z"}))],["duotone",a.createElement(a.Fragment,null,a.createElement("path",{d:"M200,112H56l72-72Z",opacity:"0.2"}),a.createElement("path",{d:"M205.66,106.34l-72-72a8,8,0,0,0-11.32,0l-72,72A8,8,0,0,0,56,120h64v96a8,8,0,0,0,16,0V120h64a8,8,0,0,0,5.66-13.66ZM75.31,104,128,51.31,180.69,104Z"}))],["fill",a.createElement(a.Fragment,null,a.createElement("path",{d:"M207.39,115.06A8,8,0,0,1,200,120H136v96a8,8,0,0,1-16,0V120H56a8,8,0,0,1-5.66-13.66l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,207.39,115.06Z"}))],["light",a.createElement(a.Fragment,null,a.createElement("path",{d:"M204.24,116.24a6,6,0,0,1-8.48,0L134,54.49V216a6,6,0,0,1-12,0V54.49L60.24,116.24a6,6,0,0,1-8.48-8.48l72-72a6,6,0,0,1,8.48,0l72,72A6,6,0,0,1,204.24,116.24Z"}))],["regular",a.createElement(a.Fragment,null,a.createElement("path",{d:"M205.66,117.66a8,8,0,0,1-11.32,0L136,59.31V216a8,8,0,0,1-16,0V59.31L61.66,117.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,205.66,117.66Z"}))],["thin",a.createElement(a.Fragment,null,a.createElement("path",{d:"M202.83,114.83a4,4,0,0,1-5.66,0L132,49.66V216a4,4,0,0,1-8,0V49.66L58.83,114.83a4,4,0,0,1-5.66-5.66l72-72a4,4,0,0,1,5.66,0l72,72A4,4,0,0,1,202.83,114.83Z"}))]]),f=a.forwardRef((e,t)=>a.createElement(u.A,{ref:t,...e,weights:g}));function v({label:e,value:t,unit:r,subtle:a,delta:n}){let s=n?.upIsGood??!0,i=n&&"up"===n.direction===s,c=n?i?"text-ok":"text-err":"",o=n?.direction==="down"?h:f;return(0,l.jsxs)("div",{className:"flex min-w-0 flex-col gap-1 rounded-xl border border-rule-2 bg-paper px-3.5 py-3",children:[(0,l.jsx)("div",{className:"truncate font-mono text-[9.5px] uppercase tracking-[0.14em] text-ink-4",children:e}),(0,l.jsxs)("div",{className:"mt-1 truncate text-[22px] font-medium leading-[1.1] tracking-[-0.02em] text-ink",children:[t,r&&(0,l.jsx)("span",{className:"ml-0.5 text-[11px] font-medium text-ink-4",children:r})]}),a&&(0,l.jsx)("div",{className:"text-[11px] leading-none text-ink-3",children:a}),n&&(0,l.jsxs)("div",{className:`mt-0.5 inline-flex items-center gap-1 font-mono text-[11px] leading-none tracking-[0.02em] ${c}`,children:[(0,l.jsx)(o,{size:9,weight:"bold"}),n.text]})]})}f.displayName="ArrowUpIcon";var b=r(42357),w=r(81630),j=r(99203),k=r(82592);function y({children:e,badge:t,size:r="md",className:a="",type:n="button",...s}){return(0,l.jsxs)("button",{type:n,className:`relative flex shrink-0 items-center justify-center border border-rule-2 bg-paper text-ink-2 transition-colors hover:text-ink ${"md"===r?"h-[34px] w-[34px] rounded-md":"h-[30px] w-[30px] rounded-[7px]"} ${a}`,...s,children:[e,t&&(0,l.jsx)("span",{className:"absolute top-[6px] right-[7px] h-1.5 w-1.5 rounded-full bg-skill-vivid"})]})}var N=r(14308),M=r(64678);let A=(0,M.createServerReference)("40d69a1ce58eda67b96c81a500c437e9107611b2d7",M.callServer,void 0,M.findSourceMapURL,"unarchiveMemoryAction"),E=(0,M.createServerReference)("4052b64a6183fe248882f2c27441addf9e9e07bb4a",M.callServer,void 0,M.findSourceMapURL,"archiveMemoryAction"),_=(0,M.createServerReference)("406bc57145dd20a43bf9eb44ad644423cd40feacc5",M.callServer,void 0,M.findSourceMapURL,"deleteMemoryAction"),C={preference:{color:"#3565ff",label:"Preference",icon:(0,l.jsxs)("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.6",children:[(0,l.jsx)("circle",{cx:"4",cy:"5",r:"1",fill:"currentColor"}),(0,l.jsx)("circle",{cx:"4",cy:"11",r:"1",fill:"currentColor"}),(0,l.jsx)("circle",{cx:"4",cy:"8",r:"1",fill:"currentColor"}),(0,l.jsx)("path",{d:"M7 5h6M7 8h6M7 11h4"})]})},context:{color:"#22a3aa",label:"Context",icon:(0,l.jsxs)("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.6",children:[(0,l.jsx)("circle",{cx:"8",cy:"8",r:"5.5"}),(0,l.jsx)("path",{d:"M3 8h10M8 2.5c2 1.5 3 3.3 3 5.5s-1 4-3 5.5c-2-1.5-3-3.3-3-5.5s1-4 3-5.5z"})]})},outcome:{color:"#1e7a44",label:"Outcome",icon:(0,l.jsxs)("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.6",children:[(0,l.jsx)("path",{d:"M3.5 2.5h6L12.5 5.5v8h-9z"}),(0,l.jsx)("path",{d:"M9.5 2.5v3h3"})]})},learned_rule:{color:"#ff5631",label:"Rule",icon:(0,l.jsx)("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.6",children:(0,l.jsx)("path",{d:"M2.5 3.5h9v6h-5l-3 3v-3h-1zM5.5 7.5h8v4h-1l-2 2v-2h-5z"})})}};function $(e){return C[e??"context"]??C.context}function L({category:e}){let t=$(e);return(0,l.jsxs)("span",{style:{background:t.color+"22",color:t.color},className:"inline-flex h-[24px] items-center gap-1.5 rounded-[6px] px-2.5 text-[11.5px] font-medium leading-none capitalize [&_svg]:h-[12px] [&_svg]:w-[12px]",children:[t.icon,t.label]})}function S({id:e,archived:t}){let[r,n]=(0,a.useTransition)(),[s,c]=(0,a.useState)(!1);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex items-center justify-end gap-1.5",children:[(0,l.jsx)("button",{type:"button",onClick:function(){n(async()=>{let r=await (t?A:E)(e);r.ok?i.oR.success(t?"Memory restored":"Memory archived"):i.oR.error(r.message)})},disabled:r,className:"rounded-md border border-rule-2 px-2.5 py-1 text-[11.5px] font-medium text-ink-3 transition-colors hover:border-rule hover:text-ink disabled:opacity-40",children:t?"Restore":"Archive"}),(0,l.jsx)(y,{size:"sm",disabled:r,onClick:()=>c(!0),title:"Delete memory",children:(0,l.jsxs)("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:"h-[13px] w-[13px]",children:[(0,l.jsx)("circle",{cx:"4",cy:"8",r:"1.2"}),(0,l.jsx)("circle",{cx:"8",cy:"8",r:"1.2"}),(0,l.jsx)("circle",{cx:"12",cy:"8",r:"1.2"})]})})]}),(0,l.jsx)(N.A,{open:s,title:"Delete memory?",message:"This memory will be permanently removed. This action cannot be undone.",confirmLabel:"Delete",onConfirm:function(){c(!1),n(async()=>{let t=await _(e);t.ok?i.oR.success("Memory deleted"):i.oR.error(t.message)})},onCancel:()=>c(!1)})]})}function Z({initialItems:e,agents:t,totalCount:r}){let[n,i]=(0,a.useState)("all"),[u,p]=(0,a.useState)("all"),[h,g]=(0,a.useState)(""),f=(0,a.useMemo)(()=>e.filter(e=>!e.archived).length,[e]),y=(0,a.useMemo)(()=>e.filter(e=>e.archived).length,[e]),N=(0,a.useMemo)(()=>{let t=e;if(t="all"===n?t.filter(e=>!e.archived):t.filter(e=>e.archived),"all"!==u&&(t=t.filter(e=>e.agent_id===u)),h.trim()){let e=h.toLowerCase();t=t.filter(t=>t.fact.toLowerCase().includes(e)||(t.agentName??"").toLowerCase().includes(e)||(t.category??"").toLowerCase().includes(e)||(t.skill_tags??[]).some(t=>t.toLowerCase().includes(e)))}return t},[e,n,u,h]),M=(0,a.useMemo)(()=>{let a=new Map;for(let t of e)t.agent_id&&t.agentName&&a.set(t.agent_id,(a.get(t.agent_id)??0)+1);let n=[{value:"all",label:"All agents",count:`\xb7 ${r}`}];for(let e of t){let t=a.get(e.id);t&&n.push({value:e.id,label:(0,l.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,l.jsx)("span",{className:"h-[7px] w-[7px] rounded-full bg-agent-vivid"}),e.name]}),count:`\xb7 ${t}`})}return n},[e,t,r]);return(0,l.jsxs)("div",{className:"pb-10",children:[(0,l.jsx)(c.A,{title:"Memory",subtitle:"What your agents remember between runs. Search across facts and outcomes, filter by agent, or archive what's no longer relevant."}),(0,l.jsx)(o.A,{tabs:(0,l.jsx)(d.A,{tabs:[{value:"all",label:"All",count:f},{value:"archived",label:"Archived",count:y}],value:n,onChange:i}),search:(0,l.jsx)(x.A,{value:h,onChange:g,placeholder:"Search memories…",minWidth:260}),cta:(0,l.jsx)(m.A,{variant:"coral",disabled:!0,children:"+ Add source"})}),(0,l.jsxs)("div",{className:"mt-4 grid grid-cols-2 gap-2.5 md:grid-cols-2",children:[(0,l.jsx)(v,{label:"Total memories",value:String(r)}),(0,l.jsx)(v,{label:"Archived",value:String(y),subtle:"excluded from agent context"})]}),(0,l.jsx)(b.A,{items:M,value:u,onChange:p,className:"mt-3"}),(0,l.jsx)("div",{className:"mt-4 overflow-hidden rounded-xl border border-rule-2 bg-paper",children:0===N.length?(0,l.jsxs)("div",{className:"px-6 py-12 text-center text-sm text-ink-4",children:["No memories match these filters."," ","all"!==n||h||"all"!==u?"Try a different filter.":"Agents save memories automatically when they call save_memory."]}):(0,l.jsxs)("table",{className:"w-full text-sm",children:[(0,l.jsx)("thead",{children:(0,l.jsxs)("tr",{className:"border-b border-rule-2",children:[(0,l.jsx)("th",{className:"px-5 py-3 text-left text-[10.5px] font-semibold uppercase tracking-wider whitespace-nowrap text-ink-4",children:"Memory"}),(0,l.jsx)("th",{className:"hidden px-5 py-3 text-left text-[10.5px] font-semibold uppercase tracking-wider whitespace-nowrap text-ink-4 md:table-cell",children:"Agent"}),(0,l.jsx)("th",{className:"hidden px-5 py-3 text-left text-[10.5px] font-semibold uppercase tracking-wider whitespace-nowrap text-ink-4 lg:table-cell",children:"Category"}),(0,l.jsx)("th",{className:"hidden px-5 py-3 text-left text-[10.5px] font-semibold uppercase tracking-wider whitespace-nowrap text-ink-4 xl:table-cell",children:"Last accessed"}),(0,l.jsx)("th",{className:"px-5 py-3 text-right text-[10.5px] font-semibold uppercase tracking-wider whitespace-nowrap text-ink-4",children:"Actions"})]})}),(0,l.jsx)("tbody",{children:N.map(e=>{let t=$(e.category),r=function(e){if(!e)return!1;let t=e instanceof Date?e:new Date(e);return Date.now()-t.getTime()<12e4}(e.last_accessed_at);return(0,l.jsxs)("tr",{className:"align-middle border-b border-rule-2/60 transition-colors last:border-0 hover:bg-hover/50",children:[(0,l.jsx)("td",{className:"px-5 py-3.5",children:(0,l.jsxs)("div",{className:"flex items-start gap-3",children:[(0,l.jsx)(w.A,{variant:"neutral",size:"md",shape:"square",background:t.color,className:"mt-0.5 shrink-0 [&_svg]:h-[14px] [&_svg]:w-[14px]",children:t.icon}),(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsx)("div",{className:"line-clamp-2 text-[13px] leading-snug text-ink",children:e.fact}),(0,l.jsxs)("div",{className:"mt-0.5 font-mono text-[11px] text-ink-4",children:[e.created_at?new Date(e.created_at).toLocaleString():"—",(e.access_count??0)>0?` \xb7 accessed ${e.access_count}\xd7`:""]})]})]})}),(0,l.jsx)("td",{className:"hidden px-5 py-3.5 md:table-cell",children:e.agentName?(0,l.jsxs)(s(),{href:"/agents",className:"inline-flex items-center gap-2 text-[12px] text-ink-2 transition-colors hover:text-ink",children:[(0,l.jsx)(j.A,{name:e.agentName,size:"sm"}),e.agentName]}):(0,l.jsx)("span",{className:"text-ink-4",children:"—"})}),(0,l.jsx)("td",{className:"hidden px-5 py-3.5 lg:table-cell",children:(0,l.jsx)(L,{category:e.category})}),(0,l.jsx)("td",{className:"hidden px-5 py-3.5 xl:table-cell",children:(0,l.jsxs)("span",{className:"inline-flex items-center gap-1.5 font-mono text-[12px] text-ink-3",children:[function(e){if(!e)return"—";let t=e instanceof Date?e:new Date(e),r=Date.now()-t.getTime();return r<6e4?"just now":r<36e5?`${Math.floor(r/6e4)}m ago`:r<864e5?`${Math.floor(r/36e5)}h ago`:t.toLocaleDateString()}(e.last_accessed_at),r&&(0,l.jsx)(k.A,{variant:"ok",size:"sm"})]})}),(0,l.jsx)("td",{className:"px-5 py-3.5 text-right",children:(0,l.jsx)(S,{id:e.id,archived:e.archived??!1})})]},e.id)})})]})})]})}},5977:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var l=r(78604);let a=l.forwardRef((e,t)=>{let{alt:r,color:a="currentColor",size:n="1em",weight:s="regular",mirrored:i=!1,children:c,weights:o,...d}=e;return l.createElement("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:n,height:n,fill:a,viewBox:"0 0 256 256",transform:i?"scale(-1, 1)":void 0,...d},!!r&&l.createElement("title",null,r),c,o.get(s))});a.displayName="SSRBase"},14308:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});var l=r(3680),a=r(78604),n=r(51869);function s({open:e,title:t,message:r,confirmLabel:i="Confirm",cancelLabel:c="Cancel",destructive:o=!0,onConfirm:d,onCancel:x}){let m=(0,a.useRef)(null),[u,p]=(0,a.useState)(!1);return((0,a.useEffect)(()=>{p(!0)},[]),(0,a.useEffect)(()=>{if(e)return m.current?.focus(),window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t);function t(e){"Escape"===e.key&&x()}},[e,x]),e&&u)?(0,n.createPortal)((0,l.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,l.jsx)("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:x,"aria-hidden":"true"}),(0,l.jsxs)("div",{className:"relative bg-paper border border-rule-2 rounded-xl p-6 max-w-md w-full shadow-2xl",children:[(0,l.jsx)("h2",{id:"confirm-dialog-title",className:"text-base font-semibold text-ink",children:t}),r&&(0,l.jsx)("p",{className:"mt-2 text-sm text-ink-3 leading-relaxed",children:r}),(0,l.jsxs)("div",{className:"mt-6 flex justify-end gap-2",children:[(0,l.jsx)("button",{ref:m,type:"button",onClick:x,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:c}),(0,l.jsx)("button",{type:"button",onClick:d,className:`px-4 py-2 text-sm font-semibold rounded-lg transition-colors ${o?"bg-err hover:brightness-[0.94] text-ink":"bg-ink hover:brightness-[0.92] text-canvas"}`,children:i})]})]})]}),document.body):null}},28870:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});var l=r(3680),a=r(78604);function n({tabs:e,value:t,defaultValue:r,onChange:s}){let[i,c]=(0,a.useState)(t??r??e[0].value),o=t??i;return(0,l.jsx)("div",{className:"inline-flex gap-1 rounded-[11px] border border-rule-2 bg-paper p-1",role:"tablist",children:e.map(e=>{let r=e.value===o;return(0,l.jsxs)("button",{type:"button",role:"tab","aria-selected":r,onClick:()=>{void 0===t&&c(e.value),s?.(e.value)},className:`inline-flex h-[30px] items-center gap-2 rounded-lg border-0 px-3.5 text-[12.5px] font-medium leading-none transition-colors ${r?"bg-ink text-canvas":"bg-transparent text-ink-3 hover:text-ink-2"}`,children:[e.label,void 0!==e.count&&(0,l.jsxs)("span",{className:`font-mono text-[11px] leading-none ${r?"opacity-65":"opacity-60"}`,children:["\xb7 ",e.count]})]},e.value)})})}},32307:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var l=r(3680);function a({title:e,subtitle:t,actions:r,className:n=""}){return(0,l.jsxs)("div",{className:`flex flex-wrap items-end justify-between gap-4 pt-7 pb-5 ${n}`,children:[(0,l.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,l.jsx)("h1",{className:"text-[28px] font-semibold leading-[1.15] tracking-[-0.015em] text-ink",children:e}),t&&(0,l.jsx)("p",{className:"mt-1.5 text-[13px] leading-[1.5] text-ink-3",children:t})]}),r&&(0,l.jsx)("div",{className:"shrink-0",children:r})]})}},32928:(e,t,r)=>{"use strict";r.d(t,{e:()=>i});var l=r(78604),a=r(53087);let n=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"}))]]),s=l.forwardRef((e,t)=>l.createElement(a.A,{ref:t,...e,weights:n}));s.displayName="MagnifyingGlassIcon";let i=s},42357:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var l=r(3680);function a({items:e,value:t,onChange:r,className:n=""}){return(0,l.jsx)("div",{className:`flex flex-wrap items-center gap-2 ${n}`,children:e.map(e=>{let a=e.value===t;return(0,l.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 ${a?"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,l.jsx)("span",{className:`font-mono text-[11px] leading-none ${a?"opacity-65":"opacity-55"}`,children:e.count})]},e.value)})})}},53087:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});var l=r(78604);let a=(0,l.createContext)({color:"currentColor",size:"1em",weight:"regular",mirrored:!1}),n=l.forwardRef((e,t)=>{let{alt:r,color:n,size:s,weight:i,mirrored:c,children:o,weights:d,...x}=e,{color:m="currentColor",size:u,weight:p="regular",mirrored:h=!1,...g}=l.useContext(a);return l.createElement("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:null!=s?s:u,height:null!=s?s:u,fill:null!=n?n:m,viewBox:"0 0 256 256",transform:c||h?"scale(-1, 1)":void 0,...g,...x},!!r&&l.createElement("title",null,r),o,d.get(null!=i?i:p))});n.displayName="IconBase"},64678:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l={callServer:function(){return n.callServer},createServerReference:function(){return i.createServerReference},findSourceMapURL:function(){return s.findSourceMapURL}};for(var a in l)Object.defineProperty(t,a,{enumerable:!0,get:l[a]});let n=r(22673),s=r(43145),i=r(87478)},65668:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var l=r(3680);function a({tabs:e,search:t,cta:r,extra:n,className:s=""}){return(0,l.jsxs)("div",{className:`flex flex-wrap items-center gap-2.5 pt-4 ${s}`,children:[e,(0,l.jsx)("div",{className:"flex-1"}),t,n,r]})}},66736:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});var l=r(3680),a=r(32928);function n({value:e,onChange:t,placeholder:r="Search…",minWidth:s=300,className:i=""}){return(0,l.jsxs)("div",{className:`flex h-[34px] items-center gap-2 rounded-[9px] border border-rule-2 bg-paper px-3 text-[12.5px] text-ink-4 ${i}`,style:{minWidth:s},children:[(0,l.jsx)(a.e,{size:13,className:"shrink-0"}),(0,l.jsx)("input",{type:"search",value:e,onChange:e=>t(e.target.value),placeholder:r,className:"flex-1 border-0 bg-transparent text-[13px] leading-none text-ink outline-none placeholder:text-ink-4"})]})}},68769:(e,t,r)=>{Promise.resolve().then(r.bind(r,1442))},77045:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var l=r(3680),a=r(63363),n=r.n(a);let s={ink:"bg-ink text-canvas hover:brightness-[0.92]",coral:"bg-skill-vivid text-white hover:brightness-[0.94]",blue:"bg-conn-vivid text-white hover:brightness-[0.94]"};function i(e){let{children:t,variant:r="ink",size:a="md",className:i=""}=e,c=`inline-flex items-center justify-center gap-1.5 rounded-md font-medium leading-none border-0 cursor-pointer transition-[filter] ${"md"===a?"h-[34px] px-3.5 text-[13px]":"h-[30px] px-3 text-[12px]"} ${s[r]} ${i}`;if("href"in e&&e.href){let{href:r,variant:a,size:s,className:i,children:o,...d}=e;return(0,l.jsx)(n(),{href:r,className:c,...d,children:t})}let{variant:o,size:d,className:x,children:m,...u}=e;return(0,l.jsx)("button",{type:"button",className:c,...u,children:t})}},81630:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var l=r(3680);let a={agent:"bg-agent-vivid text-[#0a0a0a]",skill:"bg-skill-vivid text-white",conn:"bg-conn-vivid text-white",ink:"bg-ink text-canvas",neutral:"bg-hover text-ink-3"},n={sm:"h-[30px] w-[30px]",md:"h-[34px] w-[34px]",lg:"h-[38px] w-[38px]",xl:"h-[42px] w-[42px]"},s={sm:"[&_svg]:h-[13px] [&_svg]:w-[13px]",md:"[&_svg]:h-[14px] [&_svg]:w-[14px]",lg:"[&_svg]:h-[16px] [&_svg]:w-[16px]",xl:"[&_svg]:h-[18px] [&_svg]:w-[18px]"};function i({variant:e,size:t="md",shape:r="round",background:c,children:o,className:d=""}){let x=c?"":a[e];return(0,l.jsx)("span",{style:c?{background:c}:void 0,className:`inline-flex shrink-0 items-center justify-center ${n[t]} ${s[t]} ${"round"===r?"rounded-full":"rounded-[9px]"} ${x} ${c?"text-white":""} ${d}`,children:o})}},82592:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});var l=r(3680);let a={ok:"bg-ok",lime:"bg-agent-vivid",coral:"bg-skill-vivid",blue:"bg-conn-vivid"},n={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:r=!0,className:i=""}){return(0,l.jsx)("span",{className:`inline-block shrink-0 rounded-full ${"sm"===t?"h-[7px] w-[7px]":"h-2 w-2"} ${a[e]} ${r?n[e]:""} ${i}`})}},99203:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});var l=r(3680),a=r(22575);let n={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 s({name:e,imageUrl:t,size:r="md",shape:i="round",className:c=""}){let o=n[r],d=`inline-flex shrink-0 items-center justify-center overflow-hidden bg-hover font-mono font-semibold tracking-[0.04em] text-ink-2 ${o.box} ${o.text} ${"round"===i?"rounded-full":"rounded-[8px]"} ${c}`;return t?(0,l.jsx)("span",{className:d,children:(0,l.jsx)(a.default,{src:t,alt:e,width:o.px,height:o.px,className:"h-full w-full object-cover"})}):(0,l.jsx)("span",{className:d,children:function(e){let t=e.trim();if(!t)return"?";let r=t.split(/\s+/);return r.length>=2?((r[0][0]??"")+(r[1][0]??"")).toUpperCase():t.slice(0,2).toUpperCase()}(e)})}}},e=>{e.O(0,[3363,9504,2575,1065,8724,7358],()=>e(e.s=68769)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1966],{41736:(e,t,n)=>{Promise.resolve().then(n.bind(n,52021)),Promise.resolve().then(n.bind(n,47549)),Promise.resolve().then(n.t.bind(n,63363,23)),Promise.resolve().then(n.t.bind(n,27364,23))},47549:(e,t,n)=>{"use strict";n.d(t,{default:()=>u});var a=n(3680),i=n(22799),s=n(87404),l=n(61453),r=n(81906),o=n(80957),c=n(14099),d=n(78986),x=n(53878);let m={completed:{color:"#d4ff2e",label:"Completed"},awaiting:{color:"#3565ff",label:"Awaiting"},pending:{color:"#8aa8ff",label:"Pending"},cancelled:{color:"#9a9a9a",label:"Cancelled"},failed:{color:"#ff5631",label:"Failed"}};function p(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString("en-US",{month:"short",day:"numeric"})}function u({data:e}){let t=e.reduce((e,t)=>e+t.completed+t.awaiting+t.pending+t.cancelled+t.failed,0);return(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"mb-2 font-mono text-[10.5px] uppercase tracking-[0.16em] text-ink-4",children:"Weekly activity"}),(0,a.jsx)("div",{className:"rounded-2xl border border-rule-2 bg-paper px-3 py-4",children:0===t?(0,a.jsx)("div",{className:"flex h-[220px] items-center justify-center text-sm text-ink-3",children:"No jobs in the last 12 weeks."}):(0,a.jsx)(i.u,{width:"100%",height:220,children:(0,a.jsxs)(s.E,{data:e,margin:{top:5,right:10,left:-20,bottom:0},children:[(0,a.jsx)(l.d,{stroke:"var(--c-rule-2)",vertical:!1}),(0,a.jsx)(r.W,{dataKey:"week",tickFormatter:p,stroke:"var(--c-ink-4)",tick:{fill:"var(--c-ink-4)",fontSize:11},axisLine:!1,tickLine:!1}),(0,a.jsx)(o.h,{stroke:"var(--c-ink-4)",tick:{fill:"var(--c-ink-4)",fontSize:11},axisLine:!1,tickLine:!1,allowDecimals:!1}),(0,a.jsx)(c.m,{cursor:{fill:"var(--c-hover)"},contentStyle:{background:"var(--c-paper)",border:"1px solid var(--c-rule)",borderRadius:10,fontSize:12,color:"var(--c-ink)",boxShadow:"0 6px 20px rgba(0,0,0,0.08)"},labelStyle:{color:"var(--c-ink-3)"},labelFormatter:e=>`Week of ${p(String(e??""))}`}),(0,a.jsx)(d.s,{wrapperStyle:{fontSize:11,paddingTop:8,color:"var(--c-ink-3)"},formatter:e=>m[e]?.label??e}),Object.keys(m).map(e=>(0,a.jsx)(x.yP,{dataKey:e,stackId:"status",fill:m[e].color},e))]})})})]})}},52021:(e,t,n)=>{"use strict";n.d(t,{default:()=>d});var a=n(3680),i=n(63363),s=n.n(i),l=n(78604),r=n(83156),o=n(99203),c=n(82592);function d({initial:e}){let[t,n]=(0,l.useState)(e),[i,s]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{let e=!1,t=async()=>{let t=await (0,r.V)();e||(t.ok?(n(t.data),s(!1)):s(!0))},a=setInterval(()=>void t(),5e3);return()=>{e=!0,clearInterval(a)}},[]),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"mb-2 flex items-center justify-between",children:[(0,a.jsx)("h2",{className:"font-mono text-[10.5px] uppercase tracking-[0.16em] text-ink-4",children:"Agents at work"}),(0,a.jsx)("span",{className:"inline-flex items-center gap-1.5 font-mono text-[10px] text-ink-4",children:i?"reconnect…":(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.A,{variant:"lime",size:"sm"}),"live \xb7 ",5,"s"]})})]}),0===t.length?(0,a.jsx)("div",{className:"rounded-2xl border border-rule-2 bg-paper px-5 py-6 text-center text-sm text-ink-3",children:"All agents idle — no jobs in flight."}):(0,a.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:t.map(e=>(0,a.jsx)(x,{row:e},e.agentId))})]})}function x({row:e}){return(0,a.jsxs)(s(),{href:`/jobs?agentId=${e.agentId}`,className:"block rounded-2xl border border-rule-2 bg-paper px-4 py-3 transition-colors hover:border-ink-4",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-2.5",children:[(0,a.jsx)(o.A,{name:e.agentName,imageUrl:e.avatarUrl,size:"lg",shape:"round"}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"truncate text-[14px] font-semibold leading-[1.2] text-ink",children:e.agentName}),(0,a.jsx)("p",{className:"truncate font-mono text-[11px] text-ink-4",children:e.agentSlug})]})]}),(0,a.jsx)("span",{className:"shrink-0 font-mono text-[24px] font-semibold leading-none tracking-[-0.02em] text-ink tabular-nums",children:e.total})]}),(0,a.jsxs)("div",{className:"mt-2 flex items-center gap-3 text-[11px]",children:[e.processing>0&&(0,a.jsxs)("span",{className:"text-run",children:[(0,a.jsx)("span",{className:"font-mono tabular-nums",children:e.processing})," running"]}),e.awaiting>0&&(0,a.jsxs)("span",{className:"text-warn",children:[(0,a.jsx)("span",{className:"font-mono tabular-nums",children:e.awaiting})," awaiting"]}),e.pending>0&&(0,a.jsxs)("span",{className:"text-ink-3",children:[(0,a.jsx)("span",{className:"font-mono tabular-nums",children:e.pending})," pending"]})]})]})}},82592:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var a=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 l({variant:e="ok",size:t="sm",animate:n=!0,className:r=""}){return(0,a.jsx)("span",{className:`inline-block shrink-0 rounded-full ${"sm"===t?"h-[7px] w-[7px]":"h-2 w-2"} ${i[e]} ${n?s[e]:""} ${r}`})}},83156:(e,t,n)=>{"use strict";n.d(t,{V:()=>i});var a=n(64678);let i=(0,a.createServerReference)("00afbd341c4eea987f6f392db2b88b4411562c066f",a.callServer,void 0,a.findSourceMapURL,"getActiveJobsByAgentAction")},99203:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var a=n(3680),i=n(22575);let s={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 l({name:e,imageUrl:t,size:n="md",shape:r="round",className:o=""}){let c=s[n],d=`inline-flex shrink-0 items-center justify-center overflow-hidden bg-hover font-mono font-semibold tracking-[0.04em] text-ink-2 ${c.box} ${c.text} ${"round"===r?"rounded-full":"rounded-[8px]"} ${o}`;return t?(0,a.jsx)("span",{className:d,children:(0,a.jsx)(i.default,{src:t,alt:e,width:c.px,height:c.px,className:"h-full w-full object-cover"})}):(0,a.jsx)("span",{className:d,children:function(e){let t=e.trim();if(!t)return"?";let n=t.split(/\s+/);return n.length>=2?((n[0][0]??"")+(n[1][0]??"")).toUpperCase():t.slice(0,2).toUpperCase()}(e)})}}},e=>{e.O(0,[3363,9060,269,921,1065,8724,7358],()=>e(e.s=41736)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1966],{41736:(e,t,n)=>{Promise.resolve().then(n.bind(n,52021)),Promise.resolve().then(n.bind(n,47549)),Promise.resolve().then(n.t.bind(n,63363,23)),Promise.resolve().then(n.t.bind(n,27364,23))},47549:(e,t,n)=>{"use strict";n.d(t,{default:()=>u});var a=n(3680),i=n(22799),s=n(87404),l=n(61453),r=n(81906),o=n(80957),c=n(14099),d=n(78986),x=n(53878);let m={completed:{color:"#d4ff2e",label:"Completed"},awaiting:{color:"#3565ff",label:"Awaiting"},pending:{color:"#8aa8ff",label:"Pending"},cancelled:{color:"#9a9a9a",label:"Cancelled"},failed:{color:"#ff5631",label:"Failed"}};function p(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString("en-US",{month:"short",day:"numeric"})}function u({data:e}){let t=e.reduce((e,t)=>e+t.completed+t.awaiting+t.pending+t.cancelled+t.failed,0);return(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"mb-2 font-mono text-[10.5px] uppercase tracking-[0.16em] text-ink-4",children:"Weekly activity"}),(0,a.jsx)("div",{className:"rounded-2xl border border-rule-2 bg-paper px-3 py-4",children:0===t?(0,a.jsx)("div",{className:"flex h-[220px] items-center justify-center text-sm text-ink-3",children:"No jobs in the last 12 weeks."}):(0,a.jsx)(i.u,{width:"100%",height:220,children:(0,a.jsxs)(s.E,{data:e,margin:{top:5,right:10,left:-20,bottom:0},children:[(0,a.jsx)(l.d,{stroke:"var(--c-rule-2)",vertical:!1}),(0,a.jsx)(r.W,{dataKey:"week",tickFormatter:p,stroke:"var(--c-ink-4)",tick:{fill:"var(--c-ink-4)",fontSize:11},axisLine:!1,tickLine:!1}),(0,a.jsx)(o.h,{stroke:"var(--c-ink-4)",tick:{fill:"var(--c-ink-4)",fontSize:11},axisLine:!1,tickLine:!1,allowDecimals:!1}),(0,a.jsx)(c.m,{cursor:{fill:"var(--c-hover)"},contentStyle:{background:"var(--c-paper)",border:"1px solid var(--c-rule)",borderRadius:10,fontSize:12,color:"var(--c-ink)",boxShadow:"0 6px 20px rgba(0,0,0,0.08)"},labelStyle:{color:"var(--c-ink-3)"},labelFormatter:e=>`Week of ${p(String(e??""))}`}),(0,a.jsx)(d.s,{wrapperStyle:{fontSize:11,paddingTop:8,color:"var(--c-ink-3)"},formatter:e=>m[e]?.label??e}),Object.keys(m).map(e=>(0,a.jsx)(x.yP,{dataKey:e,stackId:"status",fill:m[e].color},e))]})})})]})}},52021:(e,t,n)=>{"use strict";n.d(t,{default:()=>d});var a=n(3680),i=n(63363),s=n.n(i),l=n(78604),r=n(57581),o=n(99203),c=n(82592);function d({initial:e}){let[t,n]=(0,l.useState)(e),[i,s]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{let e=!1,t=async()=>{let t=await (0,r.V)();e||(t.ok?(n(t.data),s(!1)):s(!0))},a=setInterval(()=>void t(),5e3);return()=>{e=!0,clearInterval(a)}},[]),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"mb-2 flex items-center justify-between",children:[(0,a.jsx)("h2",{className:"font-mono text-[10.5px] uppercase tracking-[0.16em] text-ink-4",children:"Agents at work"}),(0,a.jsx)("span",{className:"inline-flex items-center gap-1.5 font-mono text-[10px] text-ink-4",children:i?"reconnect…":(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.A,{variant:"lime",size:"sm"}),"live \xb7 ",5,"s"]})})]}),0===t.length?(0,a.jsx)("div",{className:"rounded-2xl border border-rule-2 bg-paper px-5 py-6 text-center text-sm text-ink-3",children:"All agents idle — no jobs in flight."}):(0,a.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:t.map(e=>(0,a.jsx)(x,{row:e},e.agentId))})]})}function x({row:e}){return(0,a.jsxs)(s(),{href:`/jobs?agentId=${e.agentId}`,className:"block rounded-2xl border border-rule-2 bg-paper px-4 py-3 transition-colors hover:border-ink-4",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-2.5",children:[(0,a.jsx)(o.A,{name:e.agentName,imageUrl:e.avatarUrl,size:"lg",shape:"round"}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"truncate text-[14px] font-semibold leading-[1.2] text-ink",children:e.agentName}),(0,a.jsx)("p",{className:"truncate font-mono text-[11px] text-ink-4",children:e.agentSlug})]})]}),(0,a.jsx)("span",{className:"shrink-0 font-mono text-[24px] font-semibold leading-none tracking-[-0.02em] text-ink tabular-nums",children:e.total})]}),(0,a.jsxs)("div",{className:"mt-2 flex items-center gap-3 text-[11px]",children:[e.processing>0&&(0,a.jsxs)("span",{className:"text-run",children:[(0,a.jsx)("span",{className:"font-mono tabular-nums",children:e.processing})," running"]}),e.awaiting>0&&(0,a.jsxs)("span",{className:"text-warn",children:[(0,a.jsx)("span",{className:"font-mono tabular-nums",children:e.awaiting})," awaiting"]}),e.pending>0&&(0,a.jsxs)("span",{className:"text-ink-3",children:[(0,a.jsx)("span",{className:"font-mono tabular-nums",children:e.pending})," pending"]})]})]})}},57581:(e,t,n)=>{"use strict";n.d(t,{V:()=>i});var a=n(64678);let i=(0,a.createServerReference)("00e93f5a30fbb4748e0f30addc55e311d26b3a1e21",a.callServer,void 0,a.findSourceMapURL,"getActiveJobsByAgentAction")},82592:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var a=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 l({variant:e="ok",size:t="sm",animate:n=!0,className:r=""}){return(0,a.jsx)("span",{className:`inline-block shrink-0 rounded-full ${"sm"===t?"h-[7px] w-[7px]":"h-2 w-2"} ${i[e]} ${n?s[e]:""} ${r}`})}},99203:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var a=n(3680),i=n(22575);let s={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 l({name:e,imageUrl:t,size:n="md",shape:r="round",className:o=""}){let c=s[n],d=`inline-flex shrink-0 items-center justify-center overflow-hidden bg-hover font-mono font-semibold tracking-[0.04em] text-ink-2 ${c.box} ${c.text} ${"round"===r?"rounded-full":"rounded-[8px]"} ${o}`;return t?(0,a.jsx)("span",{className:d,children:(0,a.jsx)(i.default,{src:t,alt:e,width:c.px,height:c.px,className:"h-full w-full object-cover"})}):(0,a.jsx)("span",{className:d,children:function(e){let t=e.trim();if(!t)return"?";let n=t.split(/\s+/);return n.length>=2?((n[0][0]??"")+(n[1][0]??"")).toUpperCase():t.slice(0,2).toUpperCase()}(e)})}}},e=>{e.O(0,[3363,2575,269,3233,1065,8724,7358],()=>e(e.s=41736)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1670],{5848:(e,t,a)=>{"use strict";a.d(t,{default:()=>p});var n=a(3680),r=a(78604),o=a(39504),s=a(64678);let l=(0,s.createServerReference)("40de7de0d0c60c355737be884a0f4a3fb4344e7b12",s.callServer,void 0,s.findSourceMapURL,"updateAuthSettingsAction");var i=a(14308),c=a(21115),d=a(6145);function m({name:e,description:t,action:a}){return(0,n.jsxs)("div",{className:"flex items-center gap-3.5 px-4 py-3.5 rounded-[10px] bg-canvas/40 border border-rule-2 mt-2",children:[(0,n.jsxs)("span",{className:"flex-1 min-w-0",children:[(0,n.jsx)("span",{className:"block text-[13.5px] font-medium leading-[1.3] text-ink",children:e}),(0,n.jsx)("span",{className:"block text-[12.5px] leading-[1.4] text-ink-3 mt-0.5",children:t})]}),(0,n.jsx)("span",{className:"flex-shrink-0",children:a})]})}var u=a(78933),x=a(6057);function p({initial:e}){let[t,a]=(0,r.useState)(e.configuredMode),[s,h]=(0,r.useState)(!1),[g,v]=(0,r.useTransition)(),[b,f]=(0,r.useState)(!1),[k,A]=(0,r.useState)(!1);return(0,n.jsxs)("form",{onSubmit:function(e){e.preventDefault();let a=new FormData(e.currentTarget);v(async()=>{let e=await l({mode:t,googleClientId:s?a.get("googleClientId"):void 0,googleClientSecret:s?a.get("googleClientSecret"):void 0,clearGoogle:!1});e.ok?(o.oR.success("Auth settings saved"),A(e.data.requiresRestart)):o.oR.error(e.message)})},children:[(0,n.jsxs)(x.v,{label:"Auth mode",children:[(0,n.jsx)(c.t,{active:"local-trust"===t,onClick:()=>a("local-trust"),name:"No auth (local-trust)",description:"Single hardcoded user. Recommended for solo loopback installs."}),(0,n.jsx)(c.t,{active:"local-auth"===t,onClick:()=>a("local-auth"),name:"Email + password (local-auth)",description:"Sign-up + login via better-auth. Optional Google OAuth on top."}),"local-auth"===t&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(d.A,{variant:"info",children:"Each user signs in with email + password. Sessions are stored in the local DB and can be revoked from this page."}),(0,n.jsx)(m,{name:"Google OAuth",description:e.googleConfigured?"Configured.":"Optional. Add to allow Google sign-in alongside email + password.",action:(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)("button",{type:"button",onClick:()=>h(e=>!e),className:"flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium border border-rule text-ink-3 rounded-[7px] hover:border-rule-2 hover:text-ink transition-colors",children:s?"Hide fields":e.googleConfigured?"Rotate":"Add"}),e.googleConfigured&&(0,n.jsx)("button",{type:"button",onClick:()=>f(!0),disabled:g,className:"px-3 py-1.5 text-xs font-medium border border-warn/40 text-warn rounded-[7px] hover:border-warn hover:bg-warn-bg disabled:opacity-40 transition-colors",children:"Remove"})]})}),s&&(0,n.jsxs)("div",{className:"mt-3 grid grid-cols-1 sm:grid-cols-2 gap-3 px-1",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-xs text-ink-3 mb-1",htmlFor:"google-client-id",children:"Client ID"}),(0,n.jsx)("input",{id:"google-client-id",name:"googleClientId",type:"text",placeholder:"xxx.apps.googleusercontent.com",className:"w-full bg-canvas 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.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-xs text-ink-3 mb-1",htmlFor:"google-client-secret",children:"Client secret"}),(0,n.jsx)("input",{id:"google-client-secret",name:"googleClientSecret",type:"password",placeholder:e.googleConfigured?"•••••••• (overwrite)":"",className:"w-full bg-canvas 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.jsxs)("p",{className:"sm:col-span-2 text-[11px] text-ink-4",children:["Use authorized JavaScript origins"," ",(0,n.jsx)("code",{className:"font-mono",children:"http://localhost:3000"})," and redirect URI"," ",(0,n.jsx)("code",{className:"font-mono",children:"http://localhost:3000/api/auth/callback/google"})," ","in the Google Cloud Console."]})]})]}),!e.configPathExists&&(0,n.jsxs)(d.A,{variant:"warn",children:[(0,n.jsx)("b",{className:"block font-medium text-ink",children:"Config file missing"}),"~/.nodalai/config.json wasn't found. Save will fail until you've run"," ",(0,n.jsx)("code",{className:"font-mono text-[11px]",children:"nodal-agents init"})," at least once."]}),(0,n.jsx)(d.A,{variant:"warn",children:(0,n.jsxs)("span",{children:[(0,n.jsx)("b",{className:"block font-medium text-ink",children:"Switching auth mode signs everyone out"}),"Active sessions are invalidated when the auth mode changes. Make sure you can still sign in with the new method before applying."]})}),k&&(0,n.jsxs)(d.A,{variant:"info",title:"Saved. Restart required.",children:["Run ",(0,n.jsx)("code",{className:"font-mono text-[11px]",children:"nodal-agents down && nodal-agents up"})," ","to activate the new auth mode."]}),(0,n.jsx)(u.h,{onCancel:function(){a(e.configuredMode),h(!1),A(!1)},pending:g})]}),(0,n.jsx)(i.A,{open:b,title:"Remove Google OAuth credentials?",message:"The clientId and clientSecret will be removed from ~/.nodalai/config.json. Users with active Google sessions will need to sign in again with email + password.",confirmLabel:"Remove",onConfirm:function(){f(!1),v(async()=>{let e=await l({mode:t,clearGoogle:!0});e.ok?o.oR.success("Google credentials removed"):o.oR.error(e.message)})},onCancel:()=>f(!1)})]})}},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:o="1em",weight:s="regular",mirrored:l=!1,children:i,weights:c,...d}=e;return n.createElement("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,fill:r,viewBox:"0 0 256 256",transform:l?"scale(-1, 1)":void 0,...d},!!a&&n.createElement("title",null,a),i,c.get(s))});r.displayName="SSRBase"},6057:(e,t,a)=>{"use strict";a.d(t,{v:()=>r});var n=a(3680);function r({label:e,children:t}){return(0,n.jsxs)("div",{className:"mt-3.5 bg-paper border border-rule-2 rounded-[14px] p-5",children:[e&&(0,n.jsx)("div",{className:"text-[13px] leading-none text-ink-3 mb-2.5",children:e}),t]})}},6145:(e,t,a)=>{"use strict";a.d(t,{A:()=>x});var n=a(3680),r=a(78604),o=a(5977);let s=new Map([["bold",r.createElement(r.Fragment,null,r.createElement("path",{d:"M108,84a16,16,0,1,1,16,16A16,16,0,0,1,108,84Zm128,44A108,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,128Zm-72,36.68V132a20,20,0,0,0-20-20,12,12,0,0,0-4,23.32V168a20,20,0,0,0,20,20,12,12,0,0,0,4-23.32Z"}))],["duotone",r.createElement(r.Fragment,null,r.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),r.createElement("path",{d:"M144,176a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176Zm88-48A104,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,128ZM124,96a12,12,0,1,0-12-12A12,12,0,0,0,124,96Z"}))],["fill",r.createElement(r.Fragment,null,r.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-4,48a12,12,0,1,1-12,12A12,12,0,0,1,124,72Zm12,112a16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40a8,8,0,0,1,0,16Z"}))],["light",r.createElement(r.Fragment,null,r.createElement("path",{d:"M142,176a6,6,0,0,1-6,6,14,14,0,0,1-14-14V128a2,2,0,0,0-2-2,6,6,0,0,1,0-12,14,14,0,0,1,14,14v40a2,2,0,0,0,2,2A6,6,0,0,1,142,176ZM124,94a10,10,0,1,0-10-10A10,10,0,0,0,124,94Zm106,34A102,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",r.createElement(r.Fragment,null,r.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z"}))],["thin",r.createElement(r.Fragment,null,r.createElement("path",{d:"M140,176a4,4,0,0,1-4,4,12,12,0,0,1-12-12V128a4,4,0,0,0-4-4,4,4,0,0,1,0-8,12,12,0,0,1,12,12v40a4,4,0,0,0,4,4A4,4,0,0,1,140,176ZM124,92a8,8,0,1,0-8-8A8,8,0,0,0,124,92Zm104,36A100,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"}))]]),l=r.forwardRef((e,t)=>r.createElement(o.A,{ref:t,...e,weights:s}));l.displayName="InfoIcon";var i=a(22089);let c=new Map([["bold",r.createElement(r.Fragment,null,r.createElement("path",{d:"M180,232a12,12,0,0,1-12,12H88a12,12,0,0,1,0-24h80A12,12,0,0,1,180,232Zm40-128a91.51,91.51,0,0,1-35.17,72.35A12.26,12.26,0,0,0,180,186v2a20,20,0,0,1-20,20H96a20,20,0,0,1-20-20v-2a12,12,0,0,0-4.7-9.51A91.57,91.57,0,0,1,36,104.52C35.73,54.69,76,13.2,125.79,12A92,92,0,0,1,220,104Zm-24,0a68,68,0,0,0-69.65-68C89.56,36.88,59.8,67.55,60,104.38a67.71,67.71,0,0,0,26.1,53.19A35.87,35.87,0,0,1,100,184h56.1A36.13,36.13,0,0,1,170,157.49,67.68,67.68,0,0,0,196,104Zm-20.07-5.32a48.5,48.5,0,0,0-31.91-40,12,12,0,0,0-8,22.62,24.31,24.31,0,0,1,16.09,20,12,12,0,0,0,23.86-2.64Z"}))],["duotone",r.createElement(r.Fragment,null,r.createElement("path",{d:"M208,104a79.86,79.86,0,0,1-30.59,62.92A24.29,24.29,0,0,0,168,186v6a8,8,0,0,1-8,8H96a8,8,0,0,1-8-8v-6a24.11,24.11,0,0,0-9.3-19A79.87,79.87,0,0,1,48,104.45C47.76,61.09,82.72,25,126.07,24A80,80,0,0,1,208,104Z",opacity:"0.2"}),r.createElement("path",{d:"M176,232a8,8,0,0,1-8,8H88a8,8,0,0,1,0-16h80A8,8,0,0,1,176,232Zm40-128a87.55,87.55,0,0,1-33.64,69.21A16.24,16.24,0,0,0,176,186v6a16,16,0,0,1-16,16H96a16,16,0,0,1-16-16v-6a16,16,0,0,0-6.23-12.66A87.59,87.59,0,0,1,40,104.49C39.74,56.83,78.26,17.14,125.88,16A88,88,0,0,1,216,104Zm-16,0a72,72,0,0,0-73.74-72c-39,.92-70.47,33.39-70.26,72.39a71.65,71.65,0,0,0,27.64,56.3A32,32,0,0,1,96,186v6h64v-6a32.15,32.15,0,0,1,12.47-25.35A71.65,71.65,0,0,0,200,104Zm-16.11-9.34a57.6,57.6,0,0,0-46.56-46.55,8,8,0,0,0-2.66,15.78c16.57,2.79,30.63,16.85,33.44,33.45A8,8,0,0,0,176,104a9,9,0,0,0,1.35-.11A8,8,0,0,0,183.89,94.66Z"}))],["fill",r.createElement(r.Fragment,null,r.createElement("path",{d:"M176,232a8,8,0,0,1-8,8H88a8,8,0,0,1,0-16h80A8,8,0,0,1,176,232Zm40-128a87.55,87.55,0,0,1-33.64,69.21A16.24,16.24,0,0,0,176,186v6a16,16,0,0,1-16,16H96a16,16,0,0,1-16-16v-6a16,16,0,0,0-6.23-12.66A87.59,87.59,0,0,1,40,104.49C39.74,56.83,78.26,17.14,125.88,16A88,88,0,0,1,216,104Zm-32.11-9.34a57.6,57.6,0,0,0-46.56-46.55,8,8,0,0,0-2.66,15.78c16.57,2.79,30.63,16.85,33.44,33.45A8,8,0,0,0,176,104a9,9,0,0,0,1.35-.11A8,8,0,0,0,183.89,94.66Z"}))],["light",r.createElement(r.Fragment,null,r.createElement("path",{d:"M174,232a6,6,0,0,1-6,6H88a6,6,0,0,1,0-12h80A6,6,0,0,1,174,232Zm40-128a85.56,85.56,0,0,1-32.88,67.64A18.23,18.23,0,0,0,174,186v6a14,14,0,0,1-14,14H96a14,14,0,0,1-14-14v-6a18,18,0,0,0-7-14.23h0a85.59,85.59,0,0,1-33-67.24C41.74,57.91,79.39,19.12,125.93,18A86,86,0,0,1,214,104Zm-12,0a74,74,0,0,0-75.79-74C86.17,31,53.78,64.34,54,104.42a73.67,73.67,0,0,0,28.4,57.87A29.92,29.92,0,0,1,94,186v6a2,2,0,0,0,2,2h64a2,2,0,0,0,2-2v-6a30.18,30.18,0,0,1,11.7-23.78A73.59,73.59,0,0,0,202,104Zm-20.08-9A55.58,55.58,0,0,0,137,50.08a6,6,0,1,0-2,11.84C152.38,64.84,167.13,79.6,170.08,97a6,6,0,0,0,5.91,5,6.87,6.87,0,0,0,1-.08A6,6,0,0,0,181.92,95Z"}))],["regular",r.createElement(r.Fragment,null,r.createElement("path",{d:"M176,232a8,8,0,0,1-8,8H88a8,8,0,0,1,0-16h80A8,8,0,0,1,176,232Zm40-128a87.55,87.55,0,0,1-33.64,69.21A16.24,16.24,0,0,0,176,186v6a16,16,0,0,1-16,16H96a16,16,0,0,1-16-16v-6a16,16,0,0,0-6.23-12.66A87.59,87.59,0,0,1,40,104.49C39.74,56.83,78.26,17.14,125.88,16A88,88,0,0,1,216,104Zm-16,0a72,72,0,0,0-73.74-72c-39,.92-70.47,33.39-70.26,72.39a71.65,71.65,0,0,0,27.64,56.3A32,32,0,0,1,96,186v6h64v-6a32.15,32.15,0,0,1,12.47-25.35A71.65,71.65,0,0,0,200,104Zm-16.11-9.34a57.6,57.6,0,0,0-46.56-46.55,8,8,0,0,0-2.66,15.78c16.57,2.79,30.63,16.85,33.44,33.45A8,8,0,0,0,176,104a9,9,0,0,0,1.35-.11A8,8,0,0,0,183.89,94.66Z"}))],["thin",r.createElement(r.Fragment,null,r.createElement("path",{d:"M172,232a4,4,0,0,1-4,4H88a4,4,0,0,1,0-8h80A4,4,0,0,1,172,232Zm40-128a83.59,83.59,0,0,1-32.11,66.06A20.2,20.2,0,0,0,172,186v6a12,12,0,0,1-12,12H96a12,12,0,0,1-12-12v-6a20,20,0,0,0-7.76-15.81A83.58,83.58,0,0,1,44,104.47C43.75,59,80.52,21.09,126,20a84,84,0,0,1,86,84Zm-8,0a76,76,0,0,0-77.83-76C85,29,51.77,63.27,52,104.43a75.62,75.62,0,0,0,29.17,59.43A28,28,0,0,1,92,186v6a4,4,0,0,0,4,4h64a4,4,0,0,0,4-4v-6a28.14,28.14,0,0,1,10.94-22.2A75.62,75.62,0,0,0,204,104ZM136.66,52.06a4,4,0,0,0-1.32,7.88C153.53,63,169,78.45,172.06,96.67A4,4,0,0,0,176,100a3.88,3.88,0,0,0,.67-.06,4,4,0,0,0,3.27-4.61A53.51,53.51,0,0,0,136.66,52.06Z"}))]]),d=r.forwardRef((e,t)=>r.createElement(o.A,{ref:t,...e,weights:c}));d.displayName="LightbulbIcon";let m={info:{bg:"bg-run-bg",icon:"text-conn-vivid",iconColor:"text-conn-vivid"},warn:{bg:"bg-warn-bg",icon:"text-skill-vivid",iconColor:"text-skill-vivid"},tip:{bg:"bg-paper border border-rule-2",icon:"text-ink-3",iconColor:"text-ink-3"}},u={info:l,warn:i.N,tip:d};function x({variant:e,title:t,children:a,className:r=""}){let o=m[e],s=u[e];return(0,n.jsxs)("div",{className:`flex items-start gap-2.5 rounded-[9px] px-3.5 py-2.5 text-[12.5px] leading-[1.5] text-ink-2 ${o.bg} ${r}`,children:[(0,n.jsx)(s,{size:16,weight:"regular",className:`mt-0.5 shrink-0 ${o.iconColor}`}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[t&&(0,n.jsx)("b",{className:"block font-medium text-ink",children:t}),a]})]})}},21115:(e,t,a)=>{"use strict";a.d(t,{t:()=>r});var n=a(3680);function r({active:e,onClick:t,name:a,description:o}){return(0,n.jsxs)("div",{role:"radio","aria-checked":e,tabIndex:0,onClick:t,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),t())},className:["flex items-start gap-3.5 px-4 py-3.5 rounded-[10px] border cursor-pointer mb-2 transition-[border-color,background-color] duration-[120ms]",e?"border-conn-vivid bg-conn-vivid/[0.06]":"border-rule-2 bg-paper hover:border-rule"].join(" "),children:[(0,n.jsx)("span",{className:["mt-0.5 flex-shrink-0 w-[18px] h-[18px] rounded-full border-[1.6px] flex items-center justify-center",e?"border-conn-vivid":"border-rule"].join(" "),children:e&&(0,n.jsx)("span",{className:"w-2 h-2 rounded-full bg-conn-vivid"})}),(0,n.jsxs)("span",{className:"flex-1 min-w-0",children:[(0,n.jsx)("span",{className:"block text-[13.5px] font-medium leading-[1.3] text-ink",children:a}),(0,n.jsx)("span",{className:"block text-[12.5px] leading-[1.4] text-ink-3 mt-0.5",children:o})]})]})}},22089:(e,t,a)=>{"use strict";a.d(t,{N:()=>l});var n=a(78604),r=a(5977);let o=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:o}));s.displayName="WarningIcon";let l=s},33254:(e,t,a)=>{"use strict";a.d(t,{w:()=>r});var n=a(3680);function r({label:e,lede:t,children:a}){return(0,n.jsxs)("section",{className:"mt-7",children:[(0,n.jsx)("div",{className:"font-mono text-[10.5px] tracking-[0.18em] uppercase text-ink-4",children:e}),t&&(0,n.jsx)("p",{className:"text-[13px] leading-[1.5] text-ink-3 mt-1.5",children:t}),a]})}},35292:(e,t,a)=>{"use strict";a.d(t,{default:()=>h});var n=a(3680),r=a(78604),o=a(27540),s=a(39504),l=a(64678);let i=(0,l.createServerReference)("40ebde0ab3fe9c43462ac8e177421049003d8f251a",l.callServer,void 0,l.findSourceMapURL,"setRootAgentAction");var c=a(12120),d=a(33254),m=a(6057),u=a(78933),x=a(21115);let p=[{value:"propose_confirm",name:"Propose & confirm",description:"The ROOT agent proposes each meta-tool call (create agent, skill, etc.) and waits for your approval in the Approvals queue before executing."},{value:"destructive_gate",name:"Autonomous, gate destructive",description:"Non-destructive meta-tools execute automatically. Destructive ones (none exist yet in the MVT toolset) would still require approval."},{value:"fully_autonomous",name:"Fully autonomous",description:"All enabled meta-tools execute without any approval step. Use only for agents you fully trust."}];function h({agents:e,initialRootAgentId:t,initialGrants:a}){let l=(0,o.useRouter)(),[g,v]=(0,r.useTransition)(),b=e.find(e=>e.id===t)??null,[f,k]=(0,r.useState)(a??c.zw);return(0,n.jsx)(d.w,{label:"ROOT agent",lede:"Your first orchestrator is automatically this workspace's ROOT — the single top-level agent that can manage it (create skills/agents, assign skills) on your behalf. Tune its powers below.",children:null===b?(0,n.jsx)("div",{className:"mt-3.5 rounded-xl border border-rule-2 bg-paper px-[18px] py-4",children:(0,n.jsxs)("p",{className:"text-[13px] text-ink-3",children:["No ROOT agent yet."," ",(0,n.jsx)("a",{href:"/agents",className:"font-medium text-ink underline decoration-rule underline-offset-[3px] hover:decoration-ink-3",children:"Create an orchestrator agent"})," ","— the first one you create becomes this workspace's ROOT automatically."]})}):(0,n.jsx)("form",{onSubmit:function(e){e.preventDefault(),v(async()=>{let e=await i({grants:f});e.ok?(s.oR.success("ROOT agent configuration saved"),l.refresh()):s.oR.error(e.message)})},children:(0,n.jsxs)(m.v,{children:[(0,n.jsxs)("div",{className:"mb-4",children:[(0,n.jsx)("div",{className:"mb-1.5 text-[13px] leading-none text-ink-3",children:"ROOT agent"}),(0,n.jsxs)("div",{className:"flex items-center gap-2 rounded-lg border border-rule bg-paper px-3 py-2",children:[(0,n.jsx)("span",{className:"text-[13px] font-medium text-ink",children:b.name}),(0,n.jsx)("span",{className:"rounded-full border border-rule-2 px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide text-ink-4",children:"Origin orchestrator"})]})]}),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"mb-4",children:[(0,n.jsx)("div",{className:"mb-2 text-[13px] leading-none text-ink-3",children:"Allowed actions"}),(0,n.jsx)("div",{className:"flex flex-col gap-1.5",children:[{key:"createAgent",label:"Create agents"},{key:"createSkill",label:"Create skills"},{key:"updateSkill",label:"Update skills"},{key:"assignSkill",label:"Assign skills"},{key:"createMcp",label:"Create MCP servers"},{key:"createConnector",label:"Create connectors"}].map(({key:e,label:t})=>(0,n.jsxs)("label",{className:"flex cursor-pointer items-center gap-2.5 select-none",children:[(0,n.jsx)("input",{type:"checkbox",checked:f[e],onChange:()=>{k(t=>({...t,[e]:!t[e]}))},disabled:g,className:"h-4 w-4 cursor-pointer rounded border border-rule bg-canvas accent-conn-vivid disabled:opacity-50"}),(0,n.jsx)("span",{className:"text-[13.5px] text-ink-2",children:t})]},e))})]}),(0,n.jsxs)("div",{className:"mb-1",children:[(0,n.jsx)("div",{className:"mb-2.5 text-[13px] leading-none text-ink-3",children:"Autonomy level"}),(0,n.jsx)("div",{role:"radiogroup","aria-label":"Autonomy level",children:p.map(e=>(0,n.jsx)(x.t,{active:f.autonomy===e.value,onClick:()=>{var t;return t=e.value,void k(e=>({...e,autonomy:t}))},name:e.name,description:e.description},e.value))})]})]}),(0,n.jsx)(u.h,{onCancel:function(){k(a??c.zw)},pending:g,saveLabel:"Save"})]})})})}},39035:(e,t,a)=>{"use strict";a.d(t,{W:()=>r});var n=a(64678);let r=(0,n.createServerReference)("4052967950b494e22cd435b66a556d540a965df63a",n.callServer,void 0,n.findSourceMapURL,"switchWorkspaceAction")},47232:(e,t,a)=>{"use strict";a.d(t,{O:()=>r});var n=a(64678);let r=(0,n.createServerReference)("40a2f99fceaa61fd4a74b0c6f3b01f599d36e2ea48",n.callServer,void 0,n.findSourceMapURL,"createWorkspaceAction")},67293:(e,t,a)=>{"use strict";a.d(t,{default:()=>f});var n=a(3680),r=a(78604),o=a(27540),s=a(39504),l=a(64678);let i=(0,l.createServerReference)("00f347a602753f7d10260f90aab34af24d59ebbd3e",l.callServer,void 0,l.findSourceMapURL,"listWorkspacesAction");var c=a(47232);let d=(0,l.createServerReference)("406439137cb7d4544c2b414e89282a6e3c5c373da2",l.callServer,void 0,l.findSourceMapURL,"renameWorkspaceAction"),m=(0,l.createServerReference)("4015389522a581e79a290ddf4ccda681da7e3e602f",l.callServer,void 0,l.findSourceMapURL,"deleteWorkspaceAction");var u=a(39035),x=a(14308),p=a(33254),h=a(6057),g=a(78933);function v({variant:e,children:t}){return(0,n.jsx)("span",{className:["inline-flex items-center gap-1.5 h-[22px] px-2 rounded-[5px] font-mono font-semibold text-[10px] tracking-[0.08em]","ok"===e?"bg-lime-400/20 text-lime-600 dark:text-lime-300":"bg-orange-500/[0.13] text-orange-700 dark:text-orange-400"].join(" "),children:t})}var b=a(69811);function f({initial:e}){let t=(0,o.useRouter)(),[a,l]=(0,r.useState)(e),[k,A]=(0,r.useState)(""),[j,w]=(0,r.useState)(b.S[0]),[y,N]=(0,r.useTransition)(),[C,S]=(0,r.useState)(null),[Z,R]=(0,r.useState)(""),[M,E]=(0,r.useState)(b.S[0]),[L,F]=(0,r.useTransition)(),[O,T]=(0,r.useState)(null),[H,W]=(0,r.useTransition)();async function D(){let e=await i();e.ok&&l(e.data)}function U(){S(null),R("")}async function V(e){let a=await (0,u.W)({id:e});a.ok?(await D(),t.refresh()):s.oR.error(a.message)}return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(p.w,{label:"Workspaces",lede:"Manage your workspaces. Each workspace scopes agents, credentials, and data independently.",children:[(0,n.jsx)("div",{className:"mt-3.5 rounded-xl border border-rule-2 bg-paper overflow-hidden",children:0===a.length?(0,n.jsx)("p",{className:"px-[18px] py-4 text-[13px] text-ink-4",children:"No workspaces found."}):a.map(e=>{let a=C===e.id;return(0,n.jsxs)("div",{className:"flex items-center gap-3 px-[18px] py-3.5 border-b border-rule-2 last:border-b-0",children:[(0,n.jsx)("span",{className:"flex h-[28px] w-[28px] shrink-0 items-center justify-center rounded-md border border-rule-2 bg-canvas font-mono text-[13px] leading-none",children:e.icon??e.name.slice(0,1).toUpperCase()}),(0,n.jsxs)("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[a?(0,n.jsxs)("form",{onSubmit:a=>{var n;let r;return n=e.id,a.preventDefault(),void((r=Z.trim())&&F(async()=>{let e=await d({id:n,name:r,icon:M});e.ok?(s.oR.success("Workspace updated"),S(null),await D(),t.refresh()):s.oR.error(e.message)}))},className:"flex flex-col gap-2",children:[(0,n.jsx)(b.A,{value:M,onChange:E,disabled:L}),(0,n.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,n.jsx)("input",{autoFocus:!0,type:"text",value:Z,onChange:e=>R(e.target.value),maxLength:60,disabled:L,className:"w-44 rounded-md border border-rule bg-canvas px-2 py-1 text-[12.5px] text-ink focus:border-ink-3 focus:outline-none"}),(0,n.jsx)("button",{type:"submit",disabled:!Z.trim(),className:"rounded-md bg-ink px-2.5 py-1 text-[11.5px] font-medium text-canvas hover:brightness-90 disabled:opacity-50",children:"Save"}),(0,n.jsx)("button",{type:"button",onClick:U,className:"rounded-md border border-rule px-2 py-1 text-[11.5px] text-ink-3 hover:border-rule-2 hover:text-ink-2",children:"Cancel"})]})]}):(0,n.jsx)("span",{className:"text-[13.5px] font-medium text-ink leading-none",children:e.name}),(0,n.jsx)("span",{className:"font-mono text-[10px] text-ink-4 leading-none mt-0.5",children:e.role})]}),(0,n.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[e.active&&(0,n.jsx)(v,{variant:"ok",children:"ACTIVE"}),!e.active&&(0,n.jsx)("button",{type:"button",onClick:()=>V(e.id),className:"rounded-md border border-rule px-2.5 py-1 text-[11.5px] text-ink-3 hover:border-rule-2 hover:text-ink-2 transition-colors",children:"Switch"}),!a&&(0,n.jsx)("button",{type:"button",onClick:()=>{S(e.id),R(e.name),E(e.icon??b.S[0])},className:"rounded-md border border-rule px-2.5 py-1 text-[11.5px] text-ink-3 hover:border-rule-2 hover:text-ink-2 transition-colors",children:"Rename"}),"owner"===e.role&&!e.active&&(0,n.jsx)("button",{type:"button",onClick:()=>T(e),disabled:H,className:"rounded-md border border-rule px-2.5 py-1 text-[11.5px] text-err hover:border-err/40 hover:bg-err/5 disabled:opacity-50 transition-colors",children:"Delete"})]})]},e.id)})}),(0,n.jsx)("form",{onSubmit:function(e){e.preventDefault();let a=k.trim();a&&N(async()=>{let e=await (0,c.O)({name:a,icon:j});e.ok?(s.oR.success(`Workspace "${a}" created`),A(""),w(b.S[0]),await D(),t.refresh()):s.oR.error(e.message)})},children:(0,n.jsxs)(h.v,{label:"Create workspace",children:[(0,n.jsx)("div",{className:"mb-2",children:(0,n.jsx)(b.A,{value:j,onChange:w,disabled:y})}),(0,n.jsx)("div",{className:"flex gap-2 items-center",children:(0,n.jsx)("input",{type:"text",value:k,onChange:e=>A(e.target.value),placeholder:"Workspace name",maxLength:60,disabled:y,className:"min-w-0 flex-1 rounded-lg border border-rule bg-canvas px-3 py-2 text-[13px] text-ink placeholder:text-ink-4 focus:border-ink-3 focus:outline-none disabled:opacity-50"})}),(0,n.jsx)(g.h,{onCancel:()=>A(""),pending:y,saveLabel:"Create"})]})})]}),(0,n.jsx)(x.A,{open:null!==O,title:"Delete workspace?",message:O?`This will permanently delete "${O.name}" and all its data (agents, jobs, credentials). This cannot be undone.`:"",confirmLabel:"Delete",destructive:!0,onConfirm:function(){if(!O)return;let{id:e,name:a}=O;W(async()=>{T(null);let n=await m({id:e});n.ok?(s.oR.success(`Workspace "${a}" deleted`),await D(),t.refresh()):s.oR.error(n.message)})},onCancel:()=>T(null)})]})}},67345:(e,t,a)=>{Promise.resolve().then(a.bind(a,86981)),Promise.resolve().then(a.bind(a,35292)),Promise.resolve().then(a.bind(a,5848)),Promise.resolve().then(a.bind(a,67293))},69811:(e,t,a)=>{"use strict";a.d(t,{A:()=>o,S:()=>r});var n=a(3680);let r=["\uD83D\uDDC2️","\uD83C\uDFE0","\uD83D\uDCBC","\uD83D\uDE80","\uD83E\uDDEA","\uD83C\uDFA8","\uD83D\uDCCA","\uD83D\uDEE0️","\uD83C\uDF10","⚡","\uD83E\uDD16","\uD83D\uDCE6"];function o({value:e,onChange:t,disabled:a}){return(0,n.jsx)("div",{className:"flex flex-wrap gap-1",children:r.map(r=>{let o=e===r;return(0,n.jsx)("button",{type:"button",disabled:a,"aria-pressed":o,onClick:()=>t(r),className:`flex h-8 w-8 items-center justify-center rounded-md border text-[15px] leading-none transition-colors disabled:opacity-50 ${o?"border-ink bg-hover-2":"border-rule-2 hover:bg-hover"}`,children:r},r)})})}},78933:(e,t,a)=>{"use strict";a.d(t,{h:()=>r});var n=a(3680);function r({onCancel:e,pending:t,saveLabel:a="Save"}){return(0,n.jsxs)("div",{className:"flex justify-end gap-2 mt-[18px]",children:[(0,n.jsx)("button",{type:"button",onClick:e,className:"h-[34px] px-3.5 rounded-[9px] cursor-pointer bg-paper border border-rule text-[13px] font-medium text-ink-2 hover:bg-hover hover:border-rule-2 transition-colors",children:"Cancel"}),(0,n.jsx)("button",{type:"submit",disabled:t,className:"h-[34px] px-4 rounded-[9px] border-0 cursor-pointer bg-ink text-canvas text-[13px] font-medium hover:brightness-90 disabled:opacity-50 transition-[filter,opacity]",children:t?"Saving…":a})]})}},86981:(e,t,a)=>{"use strict";a.d(t,{default:()=>x});var n=a(3680),r=a(78604),o=a(39504),s=a(64678);let l=(0,s.createServerReference)("4074fba9a9b77f695cae5c335f58c9cb06018ef143",s.callServer,void 0,s.findSourceMapURL,"updateNetworkSettingsAction");var i=a(21115),c=a(6145);function d({subtitle:e,url:t}){async function a(){try{await navigator.clipboard.writeText(t),o.oR.success("Copied")}catch{o.oR.error("Could not copy")}}return(0,n.jsxs)("div",{className:"flex items-center gap-3 bg-canvas/40 border border-rule-2 rounded-[9px] px-4 py-3.5 mt-2",children:[(0,n.jsxs)("span",{className:"flex-1 min-w-0",children:[(0,n.jsx)("span",{className:"block text-xs leading-[1.4] text-ink-4",children:e}),(0,n.jsx)("span",{className:"block font-mono text-[13px] leading-[1.4] text-ink tracking-[0.02em] mt-1.5",children:t})]}),(0,n.jsxs)("button",{type:"button",onClick:a,className:"flex-shrink-0 flex items-center gap-1.5 px-2.5 py-1.5 border border-rule text-ink-3 rounded-[7px] text-xs font-medium hover:border-rule-2 hover:text-ink transition-colors",children:[(0,n.jsxs)("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-3.5 h-3.5",children:[(0,n.jsx)("rect",{x:"3",y:"3",width:"8",height:"8",rx:"1"}),(0,n.jsx)("rect",{x:"5",y:"5",width:"8",height:"8",rx:"1"})]}),"Copy"]})]})}var m=a(78933),u=a(6057);function x({initial:e}){let[t,a]=(0,r.useState)(e.configuredBind),[s,p]=(0,r.useTransition)(),[h,g]=(0,r.useState)(!1);return(0,n.jsx)("form",{onSubmit:function(e){e.preventDefault(),p(async()=>{let e=await l({bind:t});e.ok?(o.oR.success("Network settings saved"),g(e.data.requiresRestart)):o.oR.error(e.message)})},children:(0,n.jsxs)(u.v,{label:"Network access",children:[(0,n.jsx)(i.t,{active:"loopback"===t,onClick:()=>a("loopback"),name:"Local only (127.0.0.1)",description:"Only this machine can reach the dashboard. No auth required by default."}),(0,n.jsx)(i.t,{active:"lan"===t,onClick:()=>a("lan"),name:"LAN (0.0.0.0) — accessible from your network",description:"Other devices on the same Wi-Fi can reach the dashboard. Sign-in required (local-auth)."}),"lan"===t&&e.lanAddresses.length>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(c.A,{variant:"info",children:"Any device on the same Wi-Fi can open the dashboard. Combine with email + password auth to avoid unintended access."}),e.lanAddresses.map(t=>{let a=`http://${t}:${e.webPort}`;return(0,n.jsx)(d,{subtitle:"From your phone or another device on the same network, open:",url:a},t)}),(0,n.jsx)("p",{className:"text-[12px] leading-[1.5] text-ink-4 mt-2.5 mx-1",children:"Windows Defender may prompt the first time another device tries to connect — allow access on private networks."}),(0,n.jsx)(c.A,{variant:"warn",children:(0,n.jsxs)("span",{children:[(0,n.jsx)("b",{className:"block font-medium text-ink",children:"LAN exposes this dashboard beyond your machine"}),"Anyone on the same Wi-Fi can attempt to reach the URL above. Keep email + password auth enabled and avoid open / public networks."]})})]}),"lan"===t&&0===e.lanAddresses.length&&(0,n.jsx)(c.A,{variant:"warn",children:"No LAN interface detected. Make sure this machine is connected to a network before enabling LAN access."}),!e.configPathExists&&(0,n.jsxs)(c.A,{variant:"warn",children:[(0,n.jsx)("b",{className:"block font-medium text-ink",children:"Config file missing"}),"~/.nodalai/config.json wasn't found. Save will fail until you've run"," ",(0,n.jsx)("code",{className:"font-mono text-[11px]",children:"nodal-agents init"})," at least once."]}),h&&(0,n.jsxs)(c.A,{variant:"info",title:"Saved. Restart required.",children:["Run ",(0,n.jsx)("code",{className:"font-mono text-[11px]",children:"nodal-agents down && nodal-agents up"})," ","to activate the new network mode."]}),(0,n.jsx)(m.h,{onCancel:function(){a(e.configuredBind),g(!1)},pending:s})]})})}}},e=>{e.O(0,[9504,7025,9123,1065,8724,7358],()=>e(e.s=67345)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[694],{8563:(e,t,r)=>{"use strict";r.d(t,{default:()=>m});var n=r(3680),l=r(78604),s=r(27540),i=r(39504),a=r(64678);let o=(0,a.createServerReference)("4092dc652d59fc1cd56ed109ecf08033028030b03b",a.callServer,void 0,a.findSourceMapURL,"resetSkillToDefaultAction"),d=(0,a.createServerReference)("40314db96cdaf34762dd2363662db4bee58982baf4",a.callServer,void 0,a.findSourceMapURL,"updateSkillAction"),c=(0,a.createServerReference)("409ec0cda17508fdfbb081f36bb78f64a0cedcc1de",a.callServer,void 0,a.findSourceMapURL,"createSkillAction");var u=r(14308);function m(e){let t="edit"===e.mode,r=(0,s.useRouter)(),[a,m]=(0,l.useState)(t||!0===e.defaultOpen),[b,x]=(0,l.useTransition)(),[f,p]=(0,l.useState)(!1),h=t&&!0===e.initial.contentOverridden&&null!==e.initial.defaultContent;if(!a)return(0,n.jsx)("button",{type:"button",onClick:()=>m(!0),className:"px-4 py-2 text-sm font-medium bg-ink text-canvas rounded-lg hover:brightness-[0.92]",children:"+ New skill"});let k=t?e.initial:void 0;return(0,n.jsxs)("form",{onSubmit:function(n){n.preventDefault();let l=n.currentTarget,s=new FormData(l);if(t&&"edit"===e.mode){let t={id:e.initial.id,name:s.get("name"),content:s.get("content"),description:s.get("description")||void 0};x(async()=>{let e=await d(t);e.ok?(i.oR.success("Skill updated"),r.push("/skills")):i.oR.error(e.message)})}else x(async()=>{let e=await c({slug:s.get("slug"),name:s.get("name"),content:s.get("content"),description:s.get("description")||void 0});e.ok?(i.oR.success("Skill created"),l.reset(),m(!1)):i.oR.error(e.message)})},className:"bg-paper border border-rule-2 rounded-xl p-5 space-y-3",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,n.jsx)("h3",{className:"text-sm font-semibold text-ink",children:t?"Edit skill":"New skill"}),h&&(0,n.jsx)("button",{type:"button",onClick:()=>p(!0),disabled:b,title:"Restore the catalog default content for this skill",className:"text-xs px-2.5 py-1 rounded border border-warn/30 text-warn hover:bg-warn-bg transition-colors disabled:opacity-50",children:"Reset to default"})]}),(0,n.jsx)(u.A,{open:f,title:"Reset skill to default?",message:"Your customised instructions will be replaced with the catalog default shipped with NodalAI. This cannot be undone.",confirmLabel:"Reset",cancelLabel:"Cancel",destructive:!0,onConfirm:function(){if(!t)return;let n=e.initial.id;p(!1),x(async()=>{let e=await o(n);e.ok?(i.oR.success("Skill reset to default"),r.refresh()):i.oR.error(e.message)})},onCancel:()=>p(!1)}),(0,n.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,n.jsxs)("div",{children:[(0,n.jsxs)("label",{className:"block text-xs text-ink-3 mb-1",htmlFor:"skill-slug",children:["Slug ",t&&(0,n.jsx)("span",{className:"text-ink-4",children:"(stable — not editable)"})]}),(0,n.jsx)("input",{id:"skill-slug",name:"slug",required:!t,readOnly:t,disabled:t,pattern:t?void 0:"[a-z0-9\\-]+",placeholder:"my-skill",defaultValue:k?.slug,title:t?"Slug is a stable identifier and cannot be changed":void 0,className:t?"w-full bg-hover border border-rule rounded-md px-2 py-1.5 text-sm text-ink-3 cursor-not-allowed font-mono":"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.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-xs text-ink-3 mb-1",htmlFor:"skill-name",children:"Name"}),(0,n.jsx)("input",{id:"skill-name",name:"name",required:!0,placeholder:"My Skill",defaultValue:k?.name,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"})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsxs)("label",{className:"block text-xs text-ink-3 mb-1",htmlFor:"skill-description",children:["Description ",(0,n.jsx)("span",{className:"text-ink-4",children:"(optional)"})]}),(0,n.jsx)("input",{id:"skill-description",name:"description",maxLength:500,placeholder:"What does this skill teach the agent?",defaultValue:k?.description??"",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"})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-xs text-ink-3 mb-1",htmlFor:"skill-content",children:"Instructions"}),(0,n.jsx)("textarea",{id:"skill-content",name:"content",required:!0,rows:18,placeholder:"Step-by-step instructions or context the agent gets when this skill is enabled.",defaultValue:k?.content,className:"w-full bg-hover border border-rule rounded-md px-3 py-2 text-sm leading-relaxed text-ink placeholder:text-ink-4 focus:border-ink-3 focus:outline-none resize-y min-h-[440px]"})]}),(0,n.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,n.jsx)("button",{type:"submit",disabled:b,className:"px-4 py-2 text-sm font-semibold bg-ink text-canvas rounded-md hover:brightness-[0.92] disabled:opacity-50",children:b?t?"Saving…":"Creating…":t?"Save changes":"Create skill"}),(0,n.jsx)("button",{type:"button",onClick:()=>t?r.push("/skills"):m(!1),className:"px-4 py-2 text-sm font-medium border border-rule text-ink-3 rounded-md hover:border-rule",children:"Cancel"})]})]})}},14308:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var n=r(3680),l=r(78604),s=r(51869);function i({open:e,title:t,message:r,confirmLabel:a="Confirm",cancelLabel:o="Cancel",destructive:d=!0,onConfirm:c,onCancel:u}){let m=(0,l.useRef)(null),[b,x]=(0,l.useState)(!1);return((0,l.useEffect)(()=>{x(!0)},[]),(0,l.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&&b)?(0,s.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:t}),r&&(0,n.jsx)("p",{className:"mt-2 text-sm text-ink-3 leading-relaxed",children:r}),(0,n.jsxs)("div",{className:"mt-6 flex justify-end gap-2",children:[(0,n.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,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:a})]})]})]}),document.body):null}},27540:(e,t,r)=>{"use strict";var n=r(71268);r.o(n,"usePathname")&&r.d(t,{usePathname:function(){return n.usePathname}}),r.o(n,"useRouter")&&r.d(t,{useRouter:function(){return n.useRouter}}),r.o(n,"useSearchParams")&&r.d(t,{useSearchParams:function(){return n.useSearchParams}})},40607:(e,t,r)=>{Promise.resolve().then(r.bind(r,8563)),Promise.resolve().then(r.t.bind(r,63363,23))},64678:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={callServer:function(){return s.callServer},createServerReference:function(){return a.createServerReference},findSourceMapURL:function(){return i.findSourceMapURL}};for(var l in n)Object.defineProperty(t,l,{enumerable:!0,get:n[l]});let s=r(22673),i=r(43145),a=r(87478)}},e=>{e.O(0,[3363,9504,1065,8724,7358],()=>e(e.s=40607)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7092],{8563:(e,t,r)=>{"use strict";r.d(t,{default:()=>m});var l=r(3680),n=r(78604),a=r(27540),s=r(39504),i=r(64678);let o=(0,i.createServerReference)("4092dc652d59fc1cd56ed109ecf08033028030b03b",i.callServer,void 0,i.findSourceMapURL,"resetSkillToDefaultAction"),d=(0,i.createServerReference)("40314db96cdaf34762dd2363662db4bee58982baf4",i.callServer,void 0,i.findSourceMapURL,"updateSkillAction"),c=(0,i.createServerReference)("409ec0cda17508fdfbb081f36bb78f64a0cedcc1de",i.callServer,void 0,i.findSourceMapURL,"createSkillAction");var u=r(14308);function m(e){let t="edit"===e.mode,r=(0,a.useRouter)(),[i,m]=(0,n.useState)(t||!0===e.defaultOpen),[b,x]=(0,n.useTransition)(),[f,h]=(0,n.useState)(!1),p=t&&!0===e.initial.contentOverridden&&null!==e.initial.defaultContent;if(!i)return(0,l.jsx)("button",{type:"button",onClick:()=>m(!0),className:"px-4 py-2 text-sm font-medium bg-ink text-canvas rounded-lg hover:brightness-[0.92]",children:"+ New skill"});let g=t?e.initial:void 0;return(0,l.jsxs)("form",{onSubmit:function(l){l.preventDefault();let n=l.currentTarget,a=new FormData(n);if(t&&"edit"===e.mode){let t={id:e.initial.id,name:a.get("name"),content:a.get("content"),description:a.get("description")||void 0};x(async()=>{let e=await d(t);e.ok?(s.oR.success("Skill updated"),r.push("/skills")):s.oR.error(e.message)})}else x(async()=>{let e=await c({slug:a.get("slug"),name:a.get("name"),content:a.get("content"),description:a.get("description")||void 0});e.ok?(s.oR.success("Skill created"),n.reset(),m(!1)):s.oR.error(e.message)})},className:"bg-paper border border-rule-2 rounded-xl p-5 space-y-3",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,l.jsx)("h3",{className:"text-sm font-semibold text-ink",children:t?"Edit skill":"New skill"}),p&&(0,l.jsx)("button",{type:"button",onClick:()=>h(!0),disabled:b,title:"Restore the catalog default content for this skill",className:"text-xs px-2.5 py-1 rounded border border-warn/30 text-warn hover:bg-warn-bg transition-colors disabled:opacity-50",children:"Reset to default"})]}),(0,l.jsx)(u.A,{open:f,title:"Reset skill to default?",message:"Your customised instructions will be replaced with the catalog default shipped with NodalAI. This cannot be undone.",confirmLabel:"Reset",cancelLabel:"Cancel",destructive:!0,onConfirm:function(){if(!t)return;let l=e.initial.id;h(!1),x(async()=>{let e=await o(l);e.ok?(s.oR.success("Skill reset to default"),r.refresh()):s.oR.error(e.message)})},onCancel:()=>h(!1)}),(0,l.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,l.jsxs)("div",{children:[(0,l.jsxs)("label",{className:"block text-xs text-ink-3 mb-1",htmlFor:"skill-slug",children:["Slug ",t&&(0,l.jsx)("span",{className:"text-ink-4",children:"(stable — not editable)"})]}),(0,l.jsx)("input",{id:"skill-slug",name:"slug",required:!t,readOnly:t,disabled:t,pattern:t?void 0:"[a-z0-9\\-]+",placeholder:"my-skill",defaultValue:g?.slug,title:t?"Slug is a stable identifier and cannot be changed":void 0,className:t?"w-full bg-hover border border-rule rounded-md px-2 py-1.5 text-sm text-ink-3 cursor-not-allowed font-mono":"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,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-xs text-ink-3 mb-1",htmlFor:"skill-name",children:"Name"}),(0,l.jsx)("input",{id:"skill-name",name:"name",required:!0,placeholder:"My Skill",defaultValue:g?.name,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"})]})]}),(0,l.jsxs)("div",{children:[(0,l.jsxs)("label",{className:"block text-xs text-ink-3 mb-1",htmlFor:"skill-description",children:["Description ",(0,l.jsx)("span",{className:"text-ink-4",children:"(optional)"})]}),(0,l.jsx)("input",{id:"skill-description",name:"description",maxLength:500,placeholder:"What does this skill teach the agent?",defaultValue:g?.description??"",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"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-xs text-ink-3 mb-1",htmlFor:"skill-content",children:"Instructions"}),(0,l.jsx)("textarea",{id:"skill-content",name:"content",required:!0,rows:18,placeholder:"Step-by-step instructions or context the agent gets when this skill is enabled.",defaultValue:g?.content,className:"w-full bg-hover border border-rule rounded-md px-3 py-2 text-sm leading-relaxed text-ink placeholder:text-ink-4 focus:border-ink-3 focus:outline-none resize-y min-h-[440px]"})]}),(0,l.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,l.jsx)("button",{type:"submit",disabled:b,className:"px-4 py-2 text-sm font-semibold bg-ink text-canvas rounded-md hover:brightness-[0.92] disabled:opacity-50",children:b?t?"Saving…":"Creating…":t?"Save changes":"Create skill"}),(0,l.jsx)("button",{type:"button",onClick:()=>t?r.push("/skills"):m(!1),className:"px-4 py-2 text-sm font-medium border border-rule text-ink-3 rounded-md hover:border-rule",children:"Cancel"})]})]})}},10834:(e,t,r)=>{"use strict";r.d(t,{default:()=>d});var l=r(3680),n=r(27540),a=r(78604),s=r(53087);let i=new Map([["bold",a.createElement(a.Fragment,null,a.createElement("path",{d:"M168.49,199.51a12,12,0,0,1-17,17l-80-80a12,12,0,0,1,0-17l80-80a12,12,0,0,1,17,17L97,128Z"}))],["duotone",a.createElement(a.Fragment,null,a.createElement("path",{d:"M160,48V208L80,128Z",opacity:"0.2"}),a.createElement("path",{d:"M163.06,40.61a8,8,0,0,0-8.72,1.73l-80,80a8,8,0,0,0,0,11.32l80,80A8,8,0,0,0,168,208V48A8,8,0,0,0,163.06,40.61ZM152,188.69,91.31,128,152,67.31Z"}))],["fill",a.createElement(a.Fragment,null,a.createElement("path",{d:"M168,48V208a8,8,0,0,1-13.66,5.66l-80-80a8,8,0,0,1,0-11.32l80-80A8,8,0,0,1,168,48Z"}))],["light",a.createElement(a.Fragment,null,a.createElement("path",{d:"M164.24,203.76a6,6,0,1,1-8.48,8.48l-80-80a6,6,0,0,1,0-8.48l80-80a6,6,0,0,1,8.48,8.48L88.49,128Z"}))],["regular",a.createElement(a.Fragment,null,a.createElement("path",{d:"M165.66,202.34a8,8,0,0,1-11.32,11.32l-80-80a8,8,0,0,1,0-11.32l80-80a8,8,0,0,1,11.32,11.32L91.31,128Z"}))],["thin",a.createElement(a.Fragment,null,a.createElement("path",{d:"M162.83,205.17a4,4,0,0,1-5.66,5.66l-80-80a4,4,0,0,1,0-5.66l80-80a4,4,0,1,1,5.66,5.66L85.66,128Z"}))]]),o=a.forwardRef((e,t)=>a.createElement(s.A,{ref:t,...e,weights:i}));function d({href:e,label:t="Back",className:r=""}){let a=(0,n.useRouter)();return(0,l.jsxs)("button",{type:"button",onClick:()=>e?a.push(e):a.back(),className:`inline-flex items-center gap-1.5 border-0 bg-transparent py-2 text-[13px] font-medium leading-none text-ink-3 transition-colors hover:text-ink ${r}`,children:[(0,l.jsx)(o,{size:14,weight:"bold"}),t]})}o.displayName="CaretLeftIcon"},14308:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});var l=r(3680),n=r(78604),a=r(51869);function s({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),[b,x]=(0,n.useState)(!1);return((0,n.useEffect)(()=>{x(!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&&b)?(0,a.createPortal)((0,l.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,l.jsx)("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:u,"aria-hidden":"true"}),(0,l.jsxs)("div",{className:"relative bg-paper border border-rule-2 rounded-xl p-6 max-w-md w-full shadow-2xl",children:[(0,l.jsx)("h2",{id:"confirm-dialog-title",className:"text-base font-semibold text-ink",children:t}),r&&(0,l.jsx)("p",{className:"mt-2 text-sm text-ink-3 leading-relaxed",children:r}),(0,l.jsxs)("div",{className:"mt-6 flex justify-end gap-2",children:[(0,l.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,l.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}},27540:(e,t,r)=>{"use strict";var l=r(71268);r.o(l,"usePathname")&&r.d(t,{usePathname:function(){return l.usePathname}}),r.o(l,"useRouter")&&r.d(t,{useRouter:function(){return l.useRouter}}),r.o(l,"useSearchParams")&&r.d(t,{useSearchParams:function(){return l.useSearchParams}})},53087:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var l=r(78604);let n=(0,l.createContext)({color:"currentColor",size:"1em",weight:"regular",mirrored:!1}),a=l.forwardRef((e,t)=>{let{alt:r,color:a,size:s,weight:i,mirrored:o,children:d,weights:c,...u}=e,{color:m="currentColor",size:b,weight:x="regular",mirrored:f=!1,...h}=l.useContext(n);return l.createElement("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:null!=s?s:b,height:null!=s?s:b,fill:null!=a?a:m,viewBox:"0 0 256 256",transform:o||f?"scale(-1, 1)":void 0,...h,...u},!!r&&l.createElement("title",null,r),d,c.get(null!=i?i:x))});a.displayName="IconBase"},64678:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l={callServer:function(){return a.callServer},createServerReference:function(){return i.createServerReference},findSourceMapURL:function(){return s.findSourceMapURL}};for(var n in l)Object.defineProperty(t,n,{enumerable:!0,get:l[n]});let a=r(22673),s=r(43145),i=r(87478)},90870:(e,t,r)=>{Promise.resolve().then(r.bind(r,8563)),Promise.resolve().then(r.bind(r,10834))}},e=>{e.O(0,[9504,1065,8724,7358],()=>e(e.s=90870)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8141],{14308:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var n=a(3680),s=a(78604),l=a(51869);function r({open:e,title:t,message:a,confirmLabel:i="Confirm",cancelLabel:o="Cancel",destructive:d=!0,onConfirm:c,onCancel:m}){let x=(0,s.useRef)(null),[u,h]=(0,s.useState)(!1);return((0,s.useEffect)(()=>{h(!0)},[]),(0,s.useEffect)(()=>{if(e)return x.current?.focus(),window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t);function t(e){"Escape"===e.key&&m()}},[e,m]),e&&u)?(0,l.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:m,"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:t}),a&&(0,n.jsx)("p",{className:"mt-2 text-sm text-ink-3 leading-relaxed",children:a}),(0,n.jsxs)("div",{className:"mt-6 flex justify-end gap-2",children:[(0,n.jsx)("button",{ref:x,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,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:i})]})]})]}),document.body):null}},27540:(e,t,a)=>{"use strict";var n=a(71268);a.o(n,"usePathname")&&a.d(t,{usePathname:function(){return n.usePathname}}),a.o(n,"useRouter")&&a.d(t,{useRouter:function(){return n.useRouter}}),a.o(n,"useSearchParams")&&a.d(t,{useSearchParams:function(){return n.useSearchParams}})},40764:(e,t,a)=>{"use strict";a.d(t,{default:()=>_});var n=a(3680),s=a(78604),l=a(63363),r=a.n(l),i=a(40189),o=a(32307),d=a(65668),c=a(28870),m=a(66736),x=a(77045),u=a(39504),h=a(53087);let p=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M230.14,70.54,185.46,25.85a20,20,0,0,0-28.29,0L33.86,149.17A19.85,19.85,0,0,0,28,163.31V208a20,20,0,0,0,20,20H92.69a19.86,19.86,0,0,0,14.14-5.86L230.14,98.82a20,20,0,0,0,0-28.28ZM91,204H52V165l84-84,39,39ZM192,103,153,64l18.34-18.34,39,39Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M221.66,90.34,192,120,136,64l29.66-29.66a8,8,0,0,1,11.31,0L221.66,79A8,8,0,0,1,221.66,90.34Z",opacity:"0.2"}),s.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M225.9,74.78,181.21,30.09a14,14,0,0,0-19.8,0L38.1,153.41a13.94,13.94,0,0,0-4.1,9.9V208a14,14,0,0,0,14,14H92.69a13.94,13.94,0,0,0,9.9-4.1L225.9,94.58a14,14,0,0,0,0-19.8ZM94.1,209.41a2,2,0,0,1-1.41.59H48a2,2,0,0,1-2-2V163.31a2,2,0,0,1,.59-1.41L136,72.48,183.51,120ZM217.41,86.1,192,111.51,144.49,64,169.9,38.58a2,2,0,0,1,2.83,0l44.68,44.69a2,2,0,0,1,0,2.83Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224.49,76.2,179.8,31.51a12,12,0,0,0-17,0L133.17,61.17h0L39.52,154.83A11.9,11.9,0,0,0,36,163.31V208a12,12,0,0,0,12,12H92.69a12,12,0,0,0,8.48-3.51L224.48,93.17a12,12,0,0,0,0-17Zm-129,134.63A4,4,0,0,1,92.69,212H48a4,4,0,0,1-4-4V163.31a4,4,0,0,1,1.17-2.83L136,69.65,186.34,120ZM218.83,87.51,192,114.34,141.66,64l26.82-26.83a4,4,0,0,1,5.66,0l44.69,44.68a4,4,0,0,1,0,5.66Z"}))]]),g=s.forwardRef((e,t)=>s.createElement(h.A,{ref:t,...e,weights:p}));g.displayName="PencilSimpleIcon";let f=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M144,128a16,16,0,1,1-16-16A16,16,0,0,1,144,128ZM60,112a16,16,0,1,0,16,16A16,16,0,0,0,60,112Zm136,0a16,16,0,1,0,16,16A16,16,0,0,0,196,112Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M240,96v64a16,16,0,0,1-16,16H32a16,16,0,0,1-16-16V96A16,16,0,0,1,32,80H224A16,16,0,0,1,240,96Z",opacity:"0.2"}),s.createElement("path",{d:"M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,80H32A16,16,0,0,0,16,96v64a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V96A16,16,0,0,0,224,80ZM60,140a12,12,0,1,1,12-12A12,12,0,0,1,60,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,128,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,196,140Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M138,128a10,10,0,1,1-10-10A10,10,0,0,1,138,128ZM60,118a10,10,0,1,0,10,10A10,10,0,0,0,60,118Zm136,0a10,10,0,1,0,10,10A10,10,0,0,0,196,118Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M136,128a8,8,0,1,1-8-8A8,8,0,0,1,136,128Zm-76-8a8,8,0,1,0,8,8A8,8,0,0,0,60,120Zm136,0a8,8,0,1,0,8,8A8,8,0,0,0,196,120Z"}))]]),b=s.forwardRef((e,t)=>s.createElement(h.A,{ref:t,...e,weights:f}));b.displayName="DotsThreeIcon";let v=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,48H180V36A28,28,0,0,0,152,8H104A28,28,0,0,0,76,36V48H40a12,12,0,0,0,0,24h4V208a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V72h4a12,12,0,0,0,0-24ZM100,36a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4V48H100Zm88,168H68V72H188ZM116,104v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Zm48,0v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z",opacity:"0.2"}),s.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM112,168a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm0-120H96V40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,50H174V40a22,22,0,0,0-22-22H104A22,22,0,0,0,82,40V50H40a6,6,0,0,0,0,12H50V208a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V62h10a6,6,0,0,0,0-12ZM94,40a10,10,0,0,1,10-10h48a10,10,0,0,1,10,10V50H94ZM194,208a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V62H194ZM110,104v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Zm48,0v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,52H172V40a20,20,0,0,0-20-20H104A20,20,0,0,0,84,40V52H40a4,4,0,0,0,0,8H52V208a12,12,0,0,0,12,12H192a12,12,0,0,0,12-12V60h12a4,4,0,0,0,0-8ZM92,40a12,12,0,0,1,12-12h48a12,12,0,0,1,12,12V52H92ZM196,208a4,4,0,0,1-4,4H64a4,4,0,0,1-4-4V60H196ZM108,104v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Zm48,0v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Z"}))]]),j=s.forwardRef((e,t)=>s.createElement(h.A,{ref:t,...e,weights:v}));j.displayName="TrashIcon";var k=a(64678);let N=(0,k.createServerReference)("40cf6a26aa9acd16be3a0c9b353c8102210c884458",k.callServer,void 0,k.findSourceMapURL,"deleteSkillAction");function A({avatars:e,max:t=5,label:a,className:s=""}){if(0===e.length)return a?(0,n.jsx)("span",{className:`font-sans text-[12.5px] leading-none text-ink-3 ${s}`,children:a}):null;let l=e.slice(0,t),r=e.length-l.length;return(0,n.jsxs)("span",{className:`inline-flex items-center gap-2.5 ${s}`,children:[(0,n.jsxs)("span",{className:"inline-flex",children:[l.map((e,t)=>(0,n.jsx)("span",{className:`flex h-6 w-6 items-center justify-center overflow-hidden rounded-full border-2 border-paper bg-agent-vivid text-[9.5px] font-semibold leading-none tracking-[0.04em] text-[#0a0a0a] ${0===t?"":"-ml-[7px]"}`,title:e.name,children:e.avatarUrl?(0,n.jsx)("img",{src:e.avatarUrl,alt:"",className:"h-full w-full object-cover"}):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.name)},e.id)),r>0&&(0,n.jsxs)("span",{className:"flex h-6 w-6 -ml-[7px] items-center justify-center rounded-full border-2 border-paper bg-hover text-[9.5px] font-semibold leading-none text-ink-3",children:["+",r]})]}),a&&(0,n.jsx)("span",{className:"font-sans text-[12.5px] leading-none text-ink-3",children:a})]})}var Z=a(88499),y=a(14308),M=a(27540);let w=(0,k.createServerReference)("40044cbfd30d3a380dfa65d1f1bac57af888684dfa",k.callServer,void 0,k.findSourceMapURL,"unassignSkillAction"),H=(0,k.createServerReference)("40dc8a6b4278d8a81c973ba871e34e76afa12c60fb",k.callServer,void 0,k.findSourceMapURL,"assignSkillAction");var V=a(13260);function E({open:e,onClose:t,skill:a,agents:s}){return(0,n.jsx)(V.A,{open:e,onClose:t,title:`Assign "${a.name}"`,children:(0,n.jsx)(S,{skill:a,agents:s,onClose:t})})}function S({skill:e,agents:t,onClose:a}){let l=(0,M.useRouter)(),[i,o]=(0,s.useState)(()=>new Set(e.assignedAgents.map(e=>e.id))),[d,c]=(0,s.useTransition)();return 0===t.length?(0,n.jsxs)("div",{className:"space-y-3 py-6 text-center",children:[(0,n.jsx)("p",{className:"text-sm text-ink-3",children:"No agents yet — create one first."}),(0,n.jsx)(r(),{href:"/agents",onClick:a,className:"inline-flex items-center gap-1 text-sm font-medium text-blue-400 underline underline-offset-2 hover:text-blue-300",children:"Go to Agents"})]}):(0,n.jsxs)("div",{className:"space-y-1",children:[(0,n.jsx)("p",{className:"mb-3 text-xs text-ink-3",children:"Toggle to assign or unassign this skill from each agent."}),(0,n.jsx)("div",{className:"divide-y divide-rule-2 overflow-hidden rounded-lg border border-rule-2 bg-canvas/30",children:t.map(t=>{let a=i.has(t.id);return(0,n.jsxs)("label",{className:"flex cursor-pointer items-center gap-3 px-3 py-2.5 transition-colors hover:bg-hover",children:[(0,n.jsx)("input",{type:"checkbox",checked:a,disabled:d,onChange:()=>{var a;let n;return a=t.id,n=i.has(a),void(o(e=>{let t=new Set(e);return n?t.delete(a):t.add(a),t}),c(async()=>{let t={skillId:e.id,agentId:a},s=n?await w(t):await H(t);if(!s.ok){o(e=>{let t=new Set(e);return n?t.add(a):t.delete(a),t}),u.oR.error(s.message);return}u.oR.success(n?"Skill unassigned":"Skill assigned"),l.refresh()}))},className:"h-4 w-4 shrink-0 accent-skill-vivid"}),(0,n.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,n.jsx)("span",{className:"block truncate text-sm text-ink",children:t.name}),(0,n.jsx)("span",{className:"block truncate font-mono text-[11px] text-ink-3",children:t.slug})]}),(0,n.jsx)("span",{className:`shrink-0 text-[11px] font-medium ${a?"text-ok":"text-ink-4"}`,children:a?"Assigned":"Not assigned"})]},t.id)})})]})}function C({skills:e,agents: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)(L,{label:"Skill"}),(0,n.jsx)(L,{label:"Assigned to"}),(0,n.jsx)(L,{label:"Required built-ins"}),(0,n.jsx)(L,{label:"Actions",align:"right"})]})}),(0,n.jsx)("tbody",{children:e.map(e=>(0,n.jsx)(F,{skill:e,agents:t},e.id))})]})})}function L({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 F({skill:e,agents:t}){let[a,l]=(0,s.useState)(!1),[o,d]=(0,s.useState)(!1),[c,m]=(0,s.useState)(!1),[x,h]=(0,s.useTransition)();return(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-4 align-middle",children:(0,n.jsx)("div",{className:"flex items-center gap-3",children:(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:e.name}),(0,n.jsx)("div",{className:"mt-0.5 text-[12px] leading-[1.3] text-ink-3",children:e.description??(0,n.jsx)("span",{className:"font-mono text-ink-4",children:e.slug})})]})})}),(0,n.jsx)("td",{className:"px-[18px] py-4 align-middle",children:e.assignmentCount>0?(0,n.jsx)(A,{avatars:e.assignedAgents,max:4,label:`+${e.assignmentCount}`}):(0,n.jsx)("span",{className:"font-mono text-[11px] text-ink-4",children:"Unassigned"})}),(0,n.jsx)("td",{className:"px-[18px] py-4 align-middle",children:e.requiredBuiltins.length>0?(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[e.requiredBuiltins.slice(0,4).map(e=>(0,n.jsx)(Z.A,{children:e},e)),e.requiredBuiltins.length>4&&(0,n.jsxs)("span",{className:"font-mono text-[10.5px] text-ink-4",children:["+",e.requiredBuiltins.length-4]})]}):(0,n.jsx)("span",{className:"font-mono text-[11px] text-ink-4",children:"none"})}),(0,n.jsxs)("td",{className:"px-[18px] py-4 align-middle",children:[(0,n.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,n.jsxs)("button",{type:"button",onClick:()=>m(!0),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:[(0,n.jsx)(i.F,{size:13,weight:"bold"}),"Assign"]}),(0,n.jsxs)(r(),{href:`/skills/${e.id}/edit`,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:[(0,n.jsx)(g,{size:13}),"Customise"]}),(0,n.jsxs)("div",{className:"relative",children:[(0,n.jsx)("button",{type:"button",onClick:()=>d(e=>!e),"aria-label":"More actions",className:"flex h-[30px] w-[30px] items-center justify-center rounded-[7px] border border-rule bg-paper text-ink-3 transition-colors hover:text-ink",children:(0,n.jsx)(b,{size:16,weight:"bold"})}),o&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"fixed inset-0 z-10",onClick:()=>d(!1)}),(0,n.jsx)("div",{className:"absolute top-[calc(100%+4px)] right-0 z-20 min-w-[140px] rounded-[9px] border border-rule-2 bg-paper p-1 shadow-[0_12px_32px_rgba(0,0,0,0.10)]",children:(0,n.jsxs)("button",{type:"button",onClick:()=>{d(!1),l(!0)},disabled:x,className:"flex w-full items-center gap-2 rounded-md px-2.5 py-1.5 text-left text-[12.5px] text-err transition-colors hover:bg-warn-bg disabled:opacity-40",children:[(0,n.jsx)(j,{size:13}),"Delete"]})})]})]})]}),(0,n.jsx)(y.A,{open:a,title:`Delete skill "${e.name}"?`,message:"The skill and all its agent assignments will be removed. Existing job logs are kept.",confirmLabel:"Delete",onConfirm:()=>{l(!1),h(async()=>{let t=await N(e.id);t.ok?u.oR.success("Skill deleted"):u.oR.error(t.message)})},onCancel:()=>l(!1)}),(0,n.jsx)(E,{open:c,onClose:()=>m(!1),skill:e,agents:t})]})]})}var R=a(37820),$=a(16237);function P({skills:e,agents:t}){return(0,n.jsx)("div",{className:"grid auto-rows-fr grid-cols-1 gap-3.5 sm:grid-cols-2 lg:grid-cols-3",children:e.map(e=>(0,n.jsx)(U,{skill:e,agents:t},e.id))})}function U({skill:e,agents:t}){let[a,l]=(0,s.useState)(!1);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(R.A,{name:e.name,description:e.description??(0,n.jsx)("span",{className:"font-mono",children:e.slug}),foot:(0,n.jsx)($.A,{status:e.assignmentCount>0?(0,n.jsx)(A,{avatars:e.assignedAgents,max:4,label:`+${e.assignmentCount}`}):(0,n.jsx)("span",{className:"font-mono text-[11px] text-ink-4",children:"Unassigned"}),ctaLabel:"Assign",ctaVariant:"coral",onCta:()=>l(!0),secondary:(0,n.jsx)(r(),{href:`/skills/${e.id}/edit`,className:"inline-flex h-[30px] items-center 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:"Customise"})})}),(0,n.jsx)(E,{open:a,onClose:()=>l(!1),skill:e,agents:t})]})}function _({skills:e,agents:t}){let a=(0,s.useMemo)(()=>e.filter(e=>e.assignmentCount>0),[e]),l=(0,s.useMemo)(()=>e.filter(e=>!e.isSystem),[e]),r=(0,s.useMemo)(()=>e.filter(e=>e.isSystem),[e]),u=a.length>0?"assigned":l.length>0?"custom":"library",[h,p]=(0,s.useState)(u),[g,f]=(0,s.useState)(""),b="assigned"===h?a:"custom"===h?l:r,v=(0,s.useMemo)(()=>{if(!g.trim())return b;let e=g.toLowerCase();return b.filter(t=>t.name.toLowerCase().includes(e)||(t.description??"").toLowerCase().includes(e))},[b,g]);return(0,n.jsxs)("div",{className:"pb-10",children:[(0,n.jsx)(o.A,{title:"Skills",subtitle:`${e.length} reusable instruction${1===e.length?"":"s"} you can attach to any agent.`}),(0,n.jsx)(d.A,{tabs:(0,n.jsx)(c.A,{value:h,onChange:e=>{p(e),f("")},tabs:[{value:"assigned",label:"Assigned",count:a.length},{value:"custom",label:"Custom",count:l.length},{value:"library",label:"Built-in Library",count:r.length}]}),search:(0,n.jsx)(m.A,{value:g,onChange:f,placeholder:"assigned"===h?"Search assigned skills…":"custom"===h?"Search your skills…":"Search the library…"}),cta:(0,n.jsxs)(x.A,{variant:"coral",href:"/skills/new",children:[(0,n.jsx)(i.F,{size:13,weight:"bold"}),"Create skill"]})}),(0,n.jsx)("div",{className:"pt-5",children:"assigned"===h?0===a.length?(0,n.jsx)(z,{}):(0,n.jsx)(C,{skills:v,agents:t}):"custom"===h?0===l.length?(0,n.jsx)(B,{onBrowse:()=>p("library")}):(0,n.jsx)(C,{skills:v,agents:t}):0===r.length?(0,n.jsx)(T,{}):(0,n.jsx)(P,{skills:v,agents:t})})]})}function z(){return(0,n.jsx)("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 skills assigned to any agent yet.",(0,n.jsx)("br",{}),"Assign one from the Custom or Built-in Library tab."]})})}function B({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.jsx)("p",{className:"text-[13px] leading-[1.5] text-ink-3",children:"You haven't created any skills yet — skills are reusable instructions you append to an agent's system prompt when assigned."}),(0,n.jsxs)("div",{className:"mt-4 flex items-center justify-center gap-2.5",children:[(0,n.jsxs)(r(),{href:"/skills/new",className:"inline-flex h-[34px] items-center gap-1.5 rounded-md bg-skill-vivid px-3.5 text-[13px] font-medium leading-none text-white transition-[filter] hover:brightness-[0.94]",children:[(0,n.jsx)(i.F,{size:13,weight:"bold"}),"Create a skill"]}),(0,n.jsx)("button",{type:"button",onClick:e,className:"text-[13px] font-medium text-ink-3 underline underline-offset-2 hover:text-ink",children:"or browse the Built-in Library"})]})]})}function T(){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 built-in skills available."})})}},52033:(e,t,a)=>{Promise.resolve().then(a.bind(a,40764))},64678:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={callServer:function(){return l.callServer},createServerReference:function(){return i.createServerReference},findSourceMapURL:function(){return r.findSourceMapURL}};for(var s in n)Object.defineProperty(t,s,{enumerable:!0,get:n[s]});let l=a(22673),r=a(43145),i=a(87478)}},e=>{e.O(0,[3363,9504,8396,1065,8724,7358],()=>e(e.s=52033)),_N_E=e.O()}]);