nodal-agents 0.4.2 → 0.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/README.md +12 -12
  2. package/package.json +2 -1
  3. package/runner.js +247 -66
  4. package/web/.next/BUILD_ID +1 -1
  5. package/web/.next/build-manifest.json +2 -2
  6. package/web/.next/prerender-manifest.json +3 -3
  7. package/web/.next/server/app/(dashboard)/agents/[id]/edit/page.js +3 -3
  8. package/web/.next/server/app/(dashboard)/agents/[id]/edit/page.js.nft.json +1 -1
  9. package/web/.next/server/app/(dashboard)/agents/[id]/edit/page_client-reference-manifest.js +1 -1
  10. package/web/.next/server/app/(dashboard)/agents/[id]/telegram/page.js +2 -2
  11. package/web/.next/server/app/(dashboard)/agents/[id]/telegram/page_client-reference-manifest.js +1 -1
  12. package/web/.next/server/app/(dashboard)/agents/page.js +2 -2
  13. package/web/.next/server/app/(dashboard)/agents/page_client-reference-manifest.js +1 -1
  14. package/web/.next/server/app/(dashboard)/approvals/page.js +2 -2
  15. package/web/.next/server/app/(dashboard)/approvals/page.js.nft.json +1 -1
  16. package/web/.next/server/app/(dashboard)/approvals/page_client-reference-manifest.js +1 -1
  17. package/web/.next/server/app/(dashboard)/automations/page.js +2 -2
  18. package/web/.next/server/app/(dashboard)/automations/page_client-reference-manifest.js +1 -1
  19. package/web/.next/server/app/(dashboard)/billing/page.js +2 -2
  20. package/web/.next/server/app/(dashboard)/billing/page_client-reference-manifest.js +1 -1
  21. package/web/.next/server/app/(dashboard)/chat/page.js +1 -1
  22. package/web/.next/server/app/(dashboard)/chat/page_client-reference-manifest.js +1 -1
  23. package/web/.next/server/app/(dashboard)/connectors/page.js +1 -1
  24. package/web/.next/server/app/(dashboard)/connectors/page.js.nft.json +1 -1
  25. package/web/.next/server/app/(dashboard)/connectors/page_client-reference-manifest.js +1 -1
  26. package/web/.next/server/app/(dashboard)/credentials/page.js +1 -1
  27. package/web/.next/server/app/(dashboard)/credentials/page.js.nft.json +1 -1
  28. package/web/.next/server/app/(dashboard)/credentials/page_client-reference-manifest.js +1 -1
  29. package/web/.next/server/app/(dashboard)/jobs/[id]/page.js +2 -2
  30. package/web/.next/server/app/(dashboard)/jobs/[id]/page_client-reference-manifest.js +1 -1
  31. package/web/.next/server/app/(dashboard)/jobs/page.js +2 -2
  32. package/web/.next/server/app/(dashboard)/jobs/page.js.nft.json +1 -1
  33. package/web/.next/server/app/(dashboard)/jobs/page_client-reference-manifest.js +1 -1
  34. package/web/.next/server/app/(dashboard)/llm-providers/page.js +1 -1
  35. package/web/.next/server/app/(dashboard)/llm-providers/page_client-reference-manifest.js +1 -1
  36. package/web/.next/server/app/(dashboard)/logs/page.js +2 -2
  37. package/web/.next/server/app/(dashboard)/logs/page_client-reference-manifest.js +1 -1
  38. package/web/.next/server/app/(dashboard)/mcp/page.js +1 -1
  39. package/web/.next/server/app/(dashboard)/mcp/page_client-reference-manifest.js +1 -1
  40. package/web/.next/server/app/(dashboard)/memories/page.js +2 -2
  41. package/web/.next/server/app/(dashboard)/memories/page_client-reference-manifest.js +1 -1
  42. package/web/.next/server/app/(dashboard)/page.js +4 -4
  43. package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
  44. package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  45. package/web/.next/server/app/(dashboard)/settings/page.js +2 -2
  46. package/web/.next/server/app/(dashboard)/settings/page_client-reference-manifest.js +1 -1
  47. package/web/.next/server/app/(dashboard)/skills/[id]/edit/page.js +1 -1
  48. package/web/.next/server/app/(dashboard)/skills/[id]/edit/page.js.nft.json +1 -1
  49. package/web/.next/server/app/(dashboard)/skills/[id]/edit/page_client-reference-manifest.js +1 -1
  50. package/web/.next/server/app/(dashboard)/skills/new/page.js +2 -2
  51. package/web/.next/server/app/(dashboard)/skills/new/page.js.nft.json +1 -1
  52. package/web/.next/server/app/(dashboard)/skills/new/page_client-reference-manifest.js +1 -1
  53. package/web/.next/server/app/(dashboard)/skills/page.js +1 -1
  54. package/web/.next/server/app/(dashboard)/skills/page_client-reference-manifest.js +1 -1
  55. package/web/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  56. package/web/.next/server/app/_global-error.html +1 -1
  57. package/web/.next/server/app/_global-error.rsc +2 -2
  58. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +2 -2
  59. package/web/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  60. package/web/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  61. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  62. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +2 -2
  63. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  64. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  65. package/web/.next/server/app/_not-found.html +1 -1
  66. package/web/.next/server/app/_not-found.rsc +2 -2
  67. package/web/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  68. package/web/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  69. package/web/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
  70. package/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  71. package/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  72. package/web/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  73. package/web/.next/server/app/api/oauth/[provider]/callback/route.js +1 -1
  74. package/web/.next/server/app/login/page_client-reference-manifest.js +1 -1
  75. package/web/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  76. package/web/.next/server/app/onboarding.html +1 -1
  77. package/web/.next/server/app/onboarding.rsc +2 -2
  78. package/web/.next/server/app/onboarding.segments/_full.segment.rsc +2 -2
  79. package/web/.next/server/app/onboarding.segments/_head.segment.rsc +1 -1
  80. package/web/.next/server/app/onboarding.segments/_index.segment.rsc +2 -2
  81. package/web/.next/server/app/onboarding.segments/_tree.segment.rsc +1 -1
  82. package/web/.next/server/app/onboarding.segments/onboarding/__PAGE__.segment.rsc +1 -1
  83. package/web/.next/server/app/onboarding.segments/onboarding.segment.rsc +1 -1
  84. package/web/.next/server/chunks/3233.js +1 -1
  85. package/web/.next/server/chunks/3889.js +1 -0
  86. package/web/.next/server/chunks/5329.js +1 -0
  87. package/web/.next/server/chunks/593.js +1 -0
  88. package/web/.next/server/chunks/7231.js +1 -0
  89. package/web/.next/server/chunks/7741.js +1 -1
  90. package/web/.next/server/middleware-build-manifest.js +1 -1
  91. package/web/.next/server/pages/404.html +1 -1
  92. package/web/.next/server/pages/500.html +1 -1
  93. package/web/.next/server/server-reference-manifest.js +1 -1
  94. package/web/.next/server/server-reference-manifest.json +1 -1
  95. package/web/.next/static/chunks/{9123-20653d928e33410a.js → 9123-67530ba510c58003.js} +1 -1
  96. package/web/.next/static/chunks/app/(dashboard)/agents/[id]/edit/page-a2c267f563cd1a70.js +2 -0
  97. package/web/.next/static/chunks/app/(dashboard)/agents/[id]/telegram/page-2d7cae43f5e6952a.js +1 -0
  98. package/web/.next/static/chunks/app/(dashboard)/agents/page-bed833ebdd3646fb.js +1 -0
  99. package/web/.next/static/chunks/app/(dashboard)/approvals/{page-79dea6e91956eeba.js → page-4b27762472802ce0.js} +1 -1
  100. package/web/.next/static/chunks/app/(dashboard)/automations/{page-3b863b7af8e2c1a3.js → page-9e5d2ce807ce1c37.js} +1 -1
  101. package/web/.next/static/chunks/app/(dashboard)/chat/page-8f81d7e3abb475a6.js +1 -0
  102. package/web/.next/static/chunks/app/(dashboard)/connectors/{page-4a437ba82f4086da.js → page-39b1d9560235d574.js} +1 -1
  103. package/web/.next/static/chunks/app/(dashboard)/jobs/[id]/page-112bb22a9ec43be0.js +1 -0
  104. package/web/.next/static/chunks/app/(dashboard)/jobs/{page-94a311f688a255d8.js → page-44351170ed5f9180.js} +1 -1
  105. package/web/.next/static/chunks/app/(dashboard)/{layout-e1b0d4fad2926646.js → layout-53e69de869cba0d0.js} +1 -1
  106. package/web/.next/static/chunks/app/(dashboard)/llm-providers/{page-e5e2c4e2b783d37f.js → page-8f6ce47ba228e38b.js} +1 -1
  107. package/web/.next/static/chunks/app/(dashboard)/mcp/page-cdf057e468c6e92e.js +1 -0
  108. package/web/.next/static/chunks/app/(dashboard)/memories/page-e706ab4aa681fa99.js +1 -0
  109. package/web/.next/static/chunks/app/(dashboard)/{page-fb50e1576a3ab2e4.js → page-29cfae3bf701076e.js} +1 -1
  110. package/web/.next/static/chunks/app/(dashboard)/settings/page-312ae27ae71ea6d1.js +1 -0
  111. package/web/.next/static/chunks/app/(dashboard)/skills/[id]/edit/page-89a8a30db5eb96e1.js +1 -0
  112. package/web/.next/static/chunks/app/(dashboard)/skills/new/page-46a424b203591560.js +1 -0
  113. package/web/.next/static/chunks/app/(dashboard)/skills/page-edad7bbd3230fb7a.js +1 -0
  114. package/web/.next/server/chunks/1945.js +0 -1
  115. package/web/.next/server/chunks/4839.js +0 -1
  116. package/web/.next/server/chunks/8206.js +0 -1
  117. package/web/.next/server/chunks/8398.js +0 -1
  118. package/web/.next/static/chunks/app/(dashboard)/agents/[id]/edit/page-a8e293c54c818084.js +0 -2
  119. package/web/.next/static/chunks/app/(dashboard)/agents/[id]/telegram/page-7a94ae67b2c3c9c3.js +0 -1
  120. package/web/.next/static/chunks/app/(dashboard)/agents/page-b258b8975ac6450b.js +0 -1
  121. package/web/.next/static/chunks/app/(dashboard)/chat/page-4d965bb7ee3732db.js +0 -1
  122. package/web/.next/static/chunks/app/(dashboard)/jobs/[id]/page-be20dcbf25c8f3ce.js +0 -1
  123. package/web/.next/static/chunks/app/(dashboard)/mcp/page-c071c54f76273ac4.js +0 -1
  124. package/web/.next/static/chunks/app/(dashboard)/memories/page-8ca0b34ad35eb1fa.js +0 -1
  125. package/web/.next/static/chunks/app/(dashboard)/settings/page-7b256e9c462e97f8.js +0 -1
  126. package/web/.next/static/chunks/app/(dashboard)/skills/[id]/edit/page-12930816795e8b20.js +0 -1
  127. package/web/.next/static/chunks/app/(dashboard)/skills/new/page-e3a19abaf7468db9.js +0 -1
  128. package/web/.next/static/chunks/app/(dashboard)/skills/page-43f1475a0bc9c45f.js +0 -1
  129. /package/web/.next/static/{ZuUX-HBTQOhLf0tFI6JQI → PV5qpGylrVW3jZ7zKHuhE}/_buildManifest.js +0 -0
  130. /package/web/.next/static/{ZuUX-HBTQOhLf0tFI6JQI → PV5qpGylrVW3jZ7zKHuhE}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
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()}]);
@@ -1 +0,0 @@
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()}]);
@@ -1 +0,0 @@
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()}]);
@@ -1 +0,0 @@
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()}]);