@euraika-labs/pan-ui 0.7.0 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/standalone/package.json +1 -1
- package/.next/static/chunks/1257.395895f93de63e8d.js +1 -0
- package/.next/static/chunks/2433-bbcb48ffbdc15ce7.js +1 -0
- package/.next/static/chunks/{3140.a3aebdd856baf0d3.js → 3140.edb5839e5b9986a9.js} +1 -1
- package/.next/static/chunks/app/chat/{page-f3942a49cfe4b77b.js → page-8e941e75074dda93.js} +1 -1
- package/.next/static/chunks/app/extensions/{page-e0ed118aa408f2e3.js → page-97611bf7fedd7072.js} +1 -1
- package/.next/static/chunks/app/marketplace/{page-e9f839ad75b7f4a8.js → page-d9a4cdeb605d3b23.js} +1 -1
- package/.next/static/chunks/app/plugins/page-3c351f43e298b9a1.js +1 -0
- package/.next/static/chunks/app/settings/health/page-017959e72f77dedc.js +1 -0
- package/.next/static/chunks/app/settings/page-882dfc9ed730aaed.js +1 -0
- package/.next/static/chunks/app/skills/[id]/{page-241027df81583175.js → page-ce5077e8468bb7aa.js} +1 -1
- package/.next/static/chunks/app/skills/page-ef7c206ea7f039f9.js +1 -0
- package/.next/static/chunks/{webpack-3f60b0ecd96bfc29.js → webpack-22e2d008c9d8a257.js} +1 -1
- package/.next/static/css/16c1f909f514ee8b.css +3 -0
- package/README.md +17 -0
- package/package.json +1 -1
- package/.next/static/chunks/1257.5a9a3f3bc1e6e4ed.js +0 -1
- package/.next/static/chunks/9860-b632f9e287faaf54.js +0 -1
- package/.next/static/chunks/app/plugins/page-12765968a2205454.js +0 -1
- package/.next/static/chunks/app/settings/health/page-61496548509805ea.js +0 -1
- package/.next/static/chunks/app/settings/page-c2f930a6fe7cde0f.js +0 -1
- package/.next/static/chunks/app/skills/page-cdeae1ae5c2ca918.js +0 -1
- package/.next/static/css/371b679522737b32.css +0 -3
- /package/.next/static/{1rIKKfgwcoD-Sz4I0QlZE → FrHkQzc0k7oikVrPWRE1J}/_buildManifest.js +0 -0
- /package/.next/static/{1rIKKfgwcoD-Sz4I0QlZE → FrHkQzc0k7oikVrPWRE1J}/_ssgManifest.js +0 -0
package/.next/static/chunks/app/extensions/{page-e0ed118aa408f2e3.js → page-97611bf7fedd7072.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[513],{630:(e,r,t)=>{"use strict";t.d(r,{BF:()=>h,Ot:()=>i,bF:()=>c,qr:()=>m,rz:()=>p,yX:()=>x});var s=t(2454),n=t(9776),l=t(549),o=t(9678),a=t(9054),d=t(1119);function i(){return(0,s.I)({queryKey:["extensions"],queryFn:()=>(0,o.n)("/api/extensions"),select:e=>({extensions:(0,a.C5)(e.extensions),tools:(0,a.YM)(e.tools)})})}function c(e){return(0,s.I)({queryKey:["extension",e],queryFn:()=>(0,o.n)("/api/extensions/".concat(e)),select:e=>(0,a.HB)(e.extension),enabled:!!e})}function u(e,r){let t=(0,a.HB)(r);e.invalidateQueries({queryKey:["extensions"]}),e.setQueryData(["extension",t.id],{extension:t})}function m(){let e=(0,n.jE)();return(0,l.n)({mutationFn:e=>(0,o.n)("/api/extensions/mcp",{method:"POST",body:JSON.stringify(e)}),onSuccess:r=>{let{extension:t}=r;(0,d.x)("extension.updated",{extensionId:t.id}),u(e,t)}})}function x(){let e=(0,n.jE)();return(0,l.n)({mutationFn:e=>{let{extensionId:r,patch:t}=e;return(0,o.n)("/api/extensions/".concat(r),{method:"PATCH",body:JSON.stringify(t)})},onSuccess:r=>{let{extension:t}=r;(0,d.x)("extension.config.updated",{extensionId:t.id}),u(e,t)}})}function p(){let e=(0,n.jE)();return(0,l.n)({mutationFn:e=>(0,o.n)("/api/extensions/".concat(e,"/test"),{method:"POST"}),onSuccess:r=>{let{extension:t}=r;(0,d.x)("extension.tested",{extensionId:t.id,health:t.health}),u(e,t)}})}function h(){let e=(0,n.jE)();return(0,l.n)({mutationFn:e=>{let{extensionId:r,capabilityId:t,patch:s}=e;return(0,o.n)("/api/extensions/".concat(r,"/capabilities/").concat(t),{method:"PATCH",body:JSON.stringify(s)})},onSuccess:r=>{let{extension:t}=r;(0,d.x)("extension.capability.updated",{extensionId:t.id}),u(e,t)}})}},685:(e,r,t)=>{"use strict";function s(e,r){return"builtin"===e?"Built in for every workspace":"global"===e?"Installed for all profiles":r?"Profile scoped \xb7 ".concat(r):"Profile scoped"}function n(e){switch(e){case"built-in":return"Official";case"verified":return"Verified";case"custom":return"Community";case"local-process":return"Local";default:return e}}function l(e){switch(e){case"built-in":return"Official";case"verified":return"Verified";case"custom":return"Community";case"self-hosted":return"Self-hosted";case"local-process":return"Local process";default:return"Unknown source"}}function o(e){switch(e){case"read":case"low":return"Low risk";case"write":case"medium":return"Writes data";case"execute":return"Executes commands";case"admin":case"high":return"High privilege";default:return e}}function a(e){let r=String(null!=e?e:"unknown");return"needs-auth"===r?"Needs auth":"expired"===r?"Auth expired":"none"===r?"No auth required":"unknown"===r?"Auth unknown":"Auth connected"}function d(e){switch(e){case"enabled":return"Enabled by policy";case"blocked":return"Blocked by policy";case"approval-gated":return"Approval required";case"policy-limited":return"Policy limited";default:return"Governance unknown"}}function i(e){switch(e){case"auto":return"Auto approve";case"on-request":return"On request";case"always":return"Always ask";default:return"Policy inherited"}}function c(e){switch(e){case"global":return"Visible to every profile";case"profile":return"Visible only in this profile";case"session":return"Loaded only in the active session";default:return e}}t.d(r,{B6:()=>i,BX:()=>a,CF:()=>l,CV:()=>n,Ow:()=>d,VJ:()=>s,b:()=>o,mF:()=>c})},1119:(e,r,t)=>{"use strict";function s(e,r){fetch("/api/telemetry",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({event:e,source:"client",payload:null!=r?r:{}}),keepalive:!0}).catch(()=>void 0),console.debug("[telemetry]",e,null!=r?r:{})}t.d(r,{x:()=>s})},1336:(e,r,t)=>{"use strict";t.d(r,{ExtensionsScreen:()=>N});var s=t(5155),n=t(2619),l=t.n(n),o=t(2115),a=t(63),d=t(4412),i=t(1375),c=t(630);function u(e){let{open:r,onClose:t,onSubmit:n}=e,[l,a]=(0,o.useState)(""),[d,i]=(0,o.useState)(""),[c,u]=(0,o.useState)(""),[m,x]=(0,o.useState)("none"),[p,h]=(0,o.useState)(""),[b,g]=(0,o.useState)(null);return r?(0,s.jsx)("div",{className:"fixed inset-0 z-30 flex items-center justify-center bg-black/50 p-4",children:(0,s.jsxs)("div",{className:"w-full max-w-lg rounded-2xl border border-border bg-background p-5 shadow-xl",children:[(0,s.jsx)("h3",{className:"text-lg font-semibold",children:"Add MCP server"}),(0,s.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:"Create a new MCP extension by command or URL."}),(0,s.jsxs)("div",{className:"mt-4 space-y-3",children:[(0,s.jsx)("input",{value:l,onChange:e=>a(e.target.value),placeholder:"Server name",className:"w-full rounded-lg border border-input bg-background px-3 py-2 text-sm"}),(0,s.jsx)("input",{value:d,onChange:e=>i(e.target.value),placeholder:"Command (optional if URL is provided)",className:"w-full rounded-lg border border-input bg-background px-3 py-2 text-sm"}),(0,s.jsx)("input",{value:c,onChange:e=>u(e.target.value),placeholder:"URL (optional if command is provided)",className:"w-full rounded-lg border border-input bg-background px-3 py-2 text-sm"}),(0,s.jsxs)("select",{value:m,onChange:e=>x(e.target.value),className:"w-full rounded-lg border border-input bg-background px-3 py-2 text-sm",children:[(0,s.jsx)("option",{value:"none",children:"No auth"}),(0,s.jsx)("option",{value:"api-key",children:"API key"}),(0,s.jsx)("option",{value:"oauth",children:"OAuth"})]}),"none"!==m?(0,s.jsx)("input",{value:p,onChange:e=>h(e.target.value),placeholder:"Token / secret",className:"w-full rounded-lg border border-input bg-background px-3 py-2 text-sm"}):null,b?(0,s.jsx)("p",{className:"text-sm text-danger",children:b}):null]}),(0,s.jsxs)("div",{className:"mt-5 flex justify-end gap-2",children:[(0,s.jsx)("button",{type:"button",onClick:t,className:"rounded-lg border border-border px-4 py-2 text-sm",children:"Cancel"}),(0,s.jsx)("button",{type:"button",onClick:async()=>{if(!l.trim()||!d.trim()&&!c.trim())return void g("Name plus command or URL is required.");g(null),await n({name:l.trim(),command:d.trim()||void 0,url:c.trim()||void 0,authType:m,token:p.trim()||void 0})},className:"rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground",children:"Add server"})]})]})}):null}var m=t(4226),x=t(685);function p(e){let{extension:r}=e;return(0,s.jsxs)(l(),{href:"/extensions/".concat(r.id),className:"block rounded-2xl border border-border bg-card p-4 shadow-sm transition hover:bg-muted/40",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-sm font-semibold",children:r.name}),(0,s.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:r.description})]}),(0,s.jsxs)("div",{className:"space-y-2 text-right",children:[(0,s.jsx)(m.R,{health:r.health}),(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:[(0,x.b)(r.riskLevel)," \xb7 ",(0,x.BX)(r.authState)]})]})]}),(0,s.jsxs)("div",{className:"mt-4 flex flex-wrap gap-2 text-xs text-muted-foreground",children:[(0,s.jsx)("span",{className:"rounded-full border border-border px-2 py-1",children:(0,x.CF)(r.provenance)}),(0,s.jsx)("span",{className:"rounded-full border border-border px-2 py-1",children:(0,x.Ow)(r.governance)}),(0,s.jsxs)("span",{className:"rounded-full border border-border px-2 py-1",children:[r.capabilities.length," capabilities"]})]})]})}var h=t(9475);let b=[{id:"global",title:"Available everywhere",description:"These tools are available across chats and do not depend on the active profile or thread."},{id:"profile",title:"Follows the active profile",description:"These tools move with the current profile and change when you switch profiles."},{id:"session",title:"Only in this chat",description:"These tools are limited to the current conversation for safer, more local experimentation."}];function g(e){let{tools:r}=e;return 0===r.length?(0,s.jsx)(i.pp,{layout:"banner",title:"No tools available right now",description:"Nothing is currently exposed to the agent from the active integrations, plugins, profile, and chat context."}):(0,s.jsx)("div",{className:"space-y-5",children:b.map(e=>{let t=r.filter(r=>r.scope===e.id);return t.length?(0,s.jsxs)("section",{className:"space-y-3 rounded-2xl border border-border/60 bg-card/55 p-4 shadow-sm",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:e.title}),(0,s.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:e.description})]}),(0,s.jsx)("div",{className:"space-y-3",children:t.map(e=>(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-card p-4 shadow-sm",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"font-medium",children:e.name}),(0,s.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:e.sourceExtensionName})]}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-2 text-xs text-muted-foreground",children:[(0,s.jsx)("span",{className:"rounded-full border border-border px-2 py-1",children:e.category}),(0,s.jsx)("span",{className:"rounded-full border border-border px-2 py-1",children:(0,x.b)(e.riskLevel)}),(0,s.jsx)("span",{className:"rounded-full border border-border px-2 py-1",children:(0,x.B6)(e.approvalPolicy)}),(0,s.jsx)("span",{className:"rounded-full border border-border px-2 py-1",children:e.enabled?"Available now":"Blocked"})]})]}),(0,s.jsx)("p",{className:"mt-3 text-xs text-muted-foreground",children:(0,x.mF)(e.scope)})]},e.id))})]},e.id):null})})}var f=t(7102),v=t(592),j=t(2604);let y={installed:{label:"Connected now",title:"Installed integrations",description:"Everything already connected for this workspace, including built-in and MCP-backed integrations."},mcp:{label:"MCP servers",title:"Installed MCP servers",description:"Only the MCP servers already configured for the active profile."},discover:{label:"MCP Hub",title:"Discover MCP servers",description:"Browse more MCP servers to install without mixing them into the current inventory."},tools:{label:"Available tools",title:"Tools the agent can use",description:"This view explains what is currently available everywhere, by profile, or only in this chat."},approvals:{label:"Approval rules",title:"Integrations that need extra approval",description:"See which integrations are blocked, approval-gated, or limited by policy before a tool can run."},diagnostics:{label:"Diagnostics",title:"Runtime diagnostics",description:"Inspect runtime health when discovery or live checks look incomplete or degraded."}};function N(e){var r,t,n,m,b,N,w,k,C,P,S;let{initialTab:A="installed"}=e,M=(0,a.useRouter)(),[O,T]=(0,o.useState)(!1),[I,F]=(0,o.useState)(A),{activeSessionId:q}=(0,j.j)(),E=(0,c.Ot)(),B=(0,v.w)(),L=(0,c.qr)(),R=null!=(k=null==(r=E.data)?void 0:r.extensions)?k:[],H=null!=(C=null==(t=E.data)?void 0:t.tools)?C:[],U="mcp"===I?R.filter(e=>"mcp"===e.type):R,D=R.filter(e=>"approval-gated"===e.governance||"auto"!==e.approvalPolicy),V=H.filter(e=>"session"===e.scope),W=H.filter(e=>"profile"===e.scope),_=H.filter(e=>"global"===e.scope),J=R.filter(e=>"healthy"!==e.health||"needs-auth"===e.authState||"expired"===e.authState),K=null!=(S=null!=(P=null==(m=B.data)||null==(n=m.profileContext)?void 0:n.label)?P:null==(b=B.data)?void 0:b.activeProfile)?S:"Unknown profile",X=y[I];return(0,s.jsxs)("div",{className:"h-full space-y-6 overflow-y-auto p-4 lg:p-6",children:[(0,s.jsxs)("section",{className:"space-y-4 rounded-3xl border border-border/70 bg-card/60 p-5 shadow-[var(--shadow-elevated)] lg:p-6",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[(0,s.jsxs)("div",{className:"max-w-3xl",children:[(0,s.jsx)("h1",{className:"text-2xl font-semibold",children:"Integrations"}),(0,s.jsx)("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:"Understand what is installed, what the agent can use right now, and what still needs setup. MCP servers live here; repo-based plugins stay on the separate Plugins page."})]}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,s.jsx)("button",{type:"button",onClick:()=>T(!0),className:"rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground",children:"Add MCP server"}),(0,s.jsx)(l(),{href:"/plugins",className:"rounded-lg border border-border/70 bg-background/80 px-4 py-2 text-sm font-medium text-foreground",children:"Open plugins"})]})]}),(0,s.jsxs)("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-4",children:[(0,s.jsxs)("div",{className:"rounded-2xl border border-border bg-card p-4 shadow-sm",children:[(0,s.jsx)("p",{className:"text-xs uppercase tracking-label text-muted-foreground",children:"Installed now"}),(0,s.jsx)("p",{className:"mt-2 text-2xl font-semibold",children:R.length}),(0,s.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:"Connected integrations across built-in and MCP sources."})]}),(0,s.jsxs)("div",{className:"rounded-2xl border border-border bg-card p-4 shadow-sm",children:[(0,s.jsx)("p",{className:"text-xs uppercase tracking-label text-muted-foreground",children:"Available tools"}),(0,s.jsx)("p",{className:"mt-2 text-2xl font-semibold",children:H.length}),(0,s.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:"Tools the agent can reach from the current workspace context."})]}),(0,s.jsxs)("div",{className:"rounded-2xl border border-border bg-card p-4 shadow-sm",children:[(0,s.jsx)("p",{className:"text-xs uppercase tracking-label text-muted-foreground",children:"Needs attention"}),(0,s.jsx)("p",{className:"mt-2 text-2xl font-semibold",children:J.length}),(0,s.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:"Integrations that are degraded, blocked, or missing auth."})]}),(0,s.jsxs)("div",{className:"rounded-2xl border border-border bg-card p-4 shadow-sm",children:[(0,s.jsx)("p",{className:"text-xs uppercase tracking-label text-muted-foreground",children:"Active profile"}),(0,s.jsx)("p",{className:"mt-2 text-lg font-semibold",children:K}),(0,s.jsxs)("p",{className:"mt-1 text-sm text-muted-foreground",children:[W.length," tools follow the active profile."]})]})]}),(0,s.jsxs)("div",{className:"grid gap-3 lg:grid-cols-3",children:[(0,s.jsxs)("div",{className:"rounded-2xl border border-border/60 bg-background/70 p-4 text-sm text-muted-foreground shadow-sm",children:[(0,s.jsx)("p",{className:"font-medium text-foreground",children:"What is an integration?"}),(0,s.jsx)("p",{className:"mt-2",children:"An integration is a connected capability Pan can inspect and the agent can call. MCP servers show up here because they expose live tools."})]}),(0,s.jsxs)("div",{className:"rounded-2xl border border-border/60 bg-background/70 p-4 text-sm text-muted-foreground shadow-sm",children:[(0,s.jsx)("p",{className:"font-medium text-foreground",children:"What are tools?"}),(0,s.jsx)("p",{className:"mt-2",children:"Tools are the actions the agent can actually run. Some are global, some follow the active profile, and some only apply to the current chat."})]}),(0,s.jsxs)("div",{className:"rounded-2xl border border-border/60 bg-background/70 p-4 text-sm text-muted-foreground shadow-sm",children:[(0,s.jsx)("p",{className:"font-medium text-foreground",children:"Where do plugins fit?"}),(0,s.jsx)("p",{className:"mt-2",children:"Plugins are deeper repo-based extensions. They can add hooks and tool bundles, but they are managed separately so this page can stay focused on live availability."})]})]})]}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:Object.entries(y).map(e=>{let[r,t]=e;return(0,s.jsx)("button",{type:"button",onClick:()=>F(r),className:"rounded-lg px-4 py-2 text-sm ".concat(I===r?"bg-primary text-primary-foreground":"border border-border text-muted-foreground"),children:t.label},r)})}),(0,s.jsxs)("section",{className:"space-y-4 rounded-2xl border border-border/60 bg-card/55 p-4 shadow-sm",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold text-foreground",children:X.title}),(0,s.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:X.description})]}),(null==(N=B.data)?void 0:N.available)&&(null==(w=B.data)?void 0:w.apiReachable)===!1?(0,s.jsx)(i.eS,{layout:"banner",title:"Runtime data is currently degraded",description:"Some integration information is still readable, but live runtime checks are unavailable right now."}):null,E.isLoading?(0,s.jsx)(d.O,{count:3,cardClassName:"h-32"}):null,E.isError?(0,s.jsx)(i.W5,{title:"Could not load integrations",error:E.error,description:"Pan could not read the current integrations state from the runtime."}):null,"tools"===I?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"grid gap-3 md:grid-cols-3",children:[(0,s.jsxs)("div",{className:"rounded-2xl border border-border bg-card p-4 shadow-sm",children:[(0,s.jsx)("p",{className:"text-xs uppercase tracking-label text-muted-foreground",children:"Available everywhere"}),(0,s.jsx)("p",{className:"mt-2 text-2xl font-semibold",children:_.length}),(0,s.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:"Tools that do not depend on profile or chat scope."})]}),(0,s.jsxs)("div",{className:"rounded-2xl border border-border bg-card p-4 shadow-sm",children:[(0,s.jsx)("p",{className:"text-xs uppercase tracking-label text-muted-foreground",children:"Follows profile"}),(0,s.jsx)("p",{className:"mt-2 text-2xl font-semibold",children:W.length}),(0,s.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:"Changes when you switch the active profile."})]}),(0,s.jsxs)("div",{className:"rounded-2xl border border-border bg-card p-4 shadow-sm",children:[(0,s.jsx)("p",{className:"text-xs uppercase tracking-label text-muted-foreground",children:"Only this chat"}),(0,s.jsx)("p",{className:"mt-2 text-2xl font-semibold",children:V.length}),(0,s.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:q?"Limited to the active chat for safer experimentation.":"These appear once a chat-level tool is attached."})]})]}),(0,s.jsx)(g,{tools:H})]}):null,"diagnostics"===I?(0,s.jsx)(f.McpDiagnosticsPanel,{}):null,"approvals"===I?(0,s.jsxs)("div",{className:"space-y-3",children:[D.map(e=>(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-card p-4 shadow-sm",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,s.jsx)("p",{className:"font-medium",children:e.name}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-2 text-xs text-muted-foreground",children:[(0,s.jsx)("span",{className:"rounded-full border border-border px-2 py-1",children:(0,x.Ow)(e.governance)}),(0,s.jsx)("span",{className:"rounded-full border border-border px-2 py-1",children:(0,x.B6)(e.approvalPolicy)})]})]}),(0,s.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:e.description})]},e.id)),0===D.length?(0,s.jsx)(i.pp,{layout:"banner",title:"No extra approval rules right now",description:"No installed integrations currently need explicit approval handling beyond the default runtime posture."}):null]}):null,"installed"===I||"mcp"===I?U.length>0?(0,s.jsx)("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:U.map(e=>(0,s.jsx)(p,{extension:e},e.id))}):(0,s.jsx)(i.pp,{title:"mcp"===I?"No MCP servers installed":"No integrations installed",description:"mcp"===I?"Add an MCP server directly or browse the MCP Hub to connect one.":"This profile has no connected integrations yet. Start with an MCP server, then inspect tools and approvals once it is live.",primaryAction:(0,s.jsx)("button",{type:"button",onClick:()=>T(!0),className:"rounded-2xl bg-primary px-4 py-2 text-sm font-medium text-primary-foreground",children:"Add MCP server"}),secondaryAction:(0,s.jsx)("button",{type:"button",onClick:()=>F("discover"),className:"rounded-2xl border border-border/70 bg-background/80 px-4 py-2 text-sm font-medium text-foreground",children:"Browse MCP Hub"})}):null,"discover"===I?(0,s.jsx)(h.McpHub,{}):null]}),(0,s.jsx)(u,{open:O,onClose:()=>T(!1),onSubmit:async e=>{let{extension:r}=await L.mutateAsync(e);T(!1),M.push("/extensions/".concat(r.id))}})]})}},2596:(e,r,t)=>{"use strict";t.d(r,{G:()=>o,o:()=>l});var s=t(2454),n=t(9678);function l(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return(0,s.I)({queryKey:["runtime-runs",e],queryFn:()=>(0,n.n)("/api/runtime/runs".concat(e?"?sessionId=".concat(encodeURIComponent(e)):"")),select:e=>e.runs})}function o(){return(0,s.I)({queryKey:["mcp-probe-results"],queryFn:()=>(0,n.n)("/api/runtime/mcp-probes"),select:e=>e.results})}},4226:(e,r,t)=>{"use strict";t.d(r,{R:()=>o});var s=t(5155),n=t(2263),l=t(4695);function o(e){let{health:r}=e,t=(0,l.Ds)(r),o="healthy"===t||"degraded"===t||"unreachable"===t?(0,l.OX)(t):"connected"===t||"needs-auth"===t||"expired"===t?(0,l.P0)(t):(0,l.fh)(t);return(0,s.jsx)(n.W,{label:(0,l.MU)(r),tone:o})}},5495:(e,r,t)=>{Promise.resolve().then(t.bind(t,1935)),Promise.resolve().then(t.bind(t,9136)),Promise.resolve().then(t.bind(t,6981)),Promise.resolve().then(t.bind(t,1336))},7102:(e,r,t)=>{"use strict";t.d(r,{McpDiagnosticsPanel:()=>o});var s=t(5155),n=t(2596),l=t(592);function o(){var e,r,t,o,a,d,i;let c=(0,l.w)(),u=(0,n.G)(),m=c.data,x=null!=(r=u.data)?r:[];return(0,s.jsxs)("div",{className:"space-y-4 p-4 lg:p-6",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-2xl font-semibold",children:"MCP diagnostics"}),(0,s.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"Inspect configured MCP servers, last probe results, active profile context, and remediation hints."})]}),(0,s.jsxs)("div",{className:"grid gap-3 md:grid-cols-3",children:[(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-card p-4 text-sm shadow-sm",children:[(0,s.jsx)("p",{className:"text-xs uppercase tracking-label text-muted-foreground",children:"Runtime profile"}),(0,s.jsx)("p",{className:"mt-2 font-semibold",children:null!=(o=null!=(t=null==m||null==(e=m.profileContext)?void 0:e.label)?t:null==m?void 0:m.activeProfile)?o:"unknown"})]}),(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-card p-4 text-sm shadow-sm",children:[(0,s.jsx)("p",{className:"text-xs uppercase tracking-label text-muted-foreground",children:"Configured servers"}),(0,s.jsx)("p",{className:"mt-2 font-semibold",children:null!=(a=null==m?void 0:m.mcpServers.length)?a:0})]}),(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-card p-4 text-sm shadow-sm",children:[(0,s.jsx)("p",{className:"text-xs uppercase tracking-label text-muted-foreground",children:"Probe records"}),(0,s.jsx)("p",{className:"mt-2 font-semibold",children:x.length})]})]}),(0,s.jsxs)("div",{className:"space-y-3",children:[(null!=(d=null==m?void 0:m.mcpServers)?d:[]).map(e=>{let r=x.find(r=>r.serverName===e.name);return(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-card p-4 shadow-sm",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:e.name}),(0,s.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:e.url||e.command||"No transport configured"})]}),(0,s.jsx)("span",{className:"rounded-full border border-border px-2 py-1 text-xs text-muted-foreground",children:r?r.success?"success":"failed":"unknown"})]}),(0,s.jsxs)("div",{className:"mt-3 rounded-lg border border-border bg-background p-3 text-xs text-muted-foreground",children:[(0,s.jsxs)("p",{children:[(0,s.jsx)("strong",{children:"Last probe:"})," ",r?String(r.probedAt):"never"]}),(0,s.jsxs)("p",{children:[(0,s.jsx)("strong",{children:"Error:"})," ",r&&r.errorText?String(r.errorText):"none captured"]}),(0,s.jsxs)("p",{children:[(0,s.jsx)("strong",{children:"Tools seen:"})," ",r&&Array.isArray(r.tools)?r.tools.length:0]})]})]},e.name)}),(null!=(i=null==m?void 0:m.mcpServers.length)?i:0)?null:(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"No MCP servers are currently configured."})]})]})}}},e=>{e.O(0,[2231,1635,4879,5097,9475,9860,8441,1255,7358],()=>e(e.s=5495)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[513],{630:(e,r,t)=>{"use strict";t.d(r,{BF:()=>h,Ot:()=>i,bF:()=>c,qr:()=>m,rz:()=>p,yX:()=>x});var s=t(2454),n=t(9776),l=t(549),o=t(9678),a=t(9054),d=t(1119);function i(){return(0,s.I)({queryKey:["extensions"],queryFn:()=>(0,o.n)("/api/extensions"),select:e=>({extensions:(0,a.C5)(e.extensions),tools:(0,a.YM)(e.tools)})})}function c(e){return(0,s.I)({queryKey:["extension",e],queryFn:()=>(0,o.n)("/api/extensions/".concat(e)),select:e=>(0,a.HB)(e.extension),enabled:!!e})}function u(e,r){let t=(0,a.HB)(r);e.invalidateQueries({queryKey:["extensions"]}),e.setQueryData(["extension",t.id],{extension:t})}function m(){let e=(0,n.jE)();return(0,l.n)({mutationFn:e=>(0,o.n)("/api/extensions/mcp",{method:"POST",body:JSON.stringify(e)}),onSuccess:r=>{let{extension:t}=r;(0,d.x)("extension.updated",{extensionId:t.id}),u(e,t)}})}function x(){let e=(0,n.jE)();return(0,l.n)({mutationFn:e=>{let{extensionId:r,patch:t}=e;return(0,o.n)("/api/extensions/".concat(r),{method:"PATCH",body:JSON.stringify(t)})},onSuccess:r=>{let{extension:t}=r;(0,d.x)("extension.config.updated",{extensionId:t.id}),u(e,t)}})}function p(){let e=(0,n.jE)();return(0,l.n)({mutationFn:e=>(0,o.n)("/api/extensions/".concat(e,"/test"),{method:"POST"}),onSuccess:r=>{let{extension:t}=r;(0,d.x)("extension.tested",{extensionId:t.id,health:t.health}),u(e,t)}})}function h(){let e=(0,n.jE)();return(0,l.n)({mutationFn:e=>{let{extensionId:r,capabilityId:t,patch:s}=e;return(0,o.n)("/api/extensions/".concat(r,"/capabilities/").concat(t),{method:"PATCH",body:JSON.stringify(s)})},onSuccess:r=>{let{extension:t}=r;(0,d.x)("extension.capability.updated",{extensionId:t.id}),u(e,t)}})}},685:(e,r,t)=>{"use strict";function s(e,r){return"builtin"===e?"Built in for every workspace":"global"===e?"Installed for all profiles":r?"Profile scoped \xb7 ".concat(r):"Profile scoped"}function n(e){switch(e){case"built-in":return"Official";case"verified":return"Verified";case"custom":return"Community";case"local-process":return"Local";default:return e}}function l(e){switch(e){case"built-in":return"Official";case"verified":return"Verified";case"custom":return"Community";case"self-hosted":return"Self-hosted";case"local-process":return"Local process";default:return"Unknown source"}}function o(e){switch(e){case"read":case"low":return"Low risk";case"write":case"medium":return"Writes data";case"execute":return"Executes commands";case"admin":case"high":return"High privilege";default:return e}}function a(e){let r=String(null!=e?e:"unknown");return"needs-auth"===r?"Needs auth":"expired"===r?"Auth expired":"none"===r?"No auth required":"unknown"===r?"Auth unknown":"Auth connected"}function d(e){switch(e){case"enabled":return"Enabled by policy";case"blocked":return"Blocked by policy";case"approval-gated":return"Approval required";case"policy-limited":return"Policy limited";default:return"Governance unknown"}}function i(e){switch(e){case"auto":return"Auto approve";case"on-request":return"On request";case"always":return"Always ask";default:return"Policy inherited"}}function c(e){switch(e){case"global":return"Visible to every profile";case"profile":return"Visible only in this profile";case"session":return"Loaded only in the active session";default:return e}}t.d(r,{B6:()=>i,BX:()=>a,CF:()=>l,CV:()=>n,Ow:()=>d,VJ:()=>s,b:()=>o,mF:()=>c})},1119:(e,r,t)=>{"use strict";function s(e,r){fetch("/api/telemetry",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({event:e,source:"client",payload:null!=r?r:{}}),keepalive:!0}).catch(()=>void 0),console.debug("[telemetry]",e,null!=r?r:{})}t.d(r,{x:()=>s})},1336:(e,r,t)=>{"use strict";t.d(r,{ExtensionsScreen:()=>N});var s=t(5155),n=t(2619),l=t.n(n),o=t(2115),a=t(63),d=t(4412),i=t(2932),c=t(630);function u(e){let{open:r,onClose:t,onSubmit:n}=e,[l,a]=(0,o.useState)(""),[d,i]=(0,o.useState)(""),[c,u]=(0,o.useState)(""),[m,x]=(0,o.useState)("none"),[p,h]=(0,o.useState)(""),[b,g]=(0,o.useState)(null);return r?(0,s.jsx)("div",{className:"fixed inset-0 z-30 flex items-center justify-center bg-black/50 p-4",children:(0,s.jsxs)("div",{className:"w-full max-w-lg rounded-2xl border border-border bg-background p-5 shadow-xl",children:[(0,s.jsx)("h3",{className:"text-lg font-semibold",children:"Add MCP server"}),(0,s.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:"Create a new MCP extension by command or URL."}),(0,s.jsxs)("div",{className:"mt-4 space-y-3",children:[(0,s.jsx)("input",{value:l,onChange:e=>a(e.target.value),placeholder:"Server name",className:"w-full rounded-lg border border-input bg-background px-3 py-2 text-sm"}),(0,s.jsx)("input",{value:d,onChange:e=>i(e.target.value),placeholder:"Command (optional if URL is provided)",className:"w-full rounded-lg border border-input bg-background px-3 py-2 text-sm"}),(0,s.jsx)("input",{value:c,onChange:e=>u(e.target.value),placeholder:"URL (optional if command is provided)",className:"w-full rounded-lg border border-input bg-background px-3 py-2 text-sm"}),(0,s.jsxs)("select",{value:m,onChange:e=>x(e.target.value),className:"w-full rounded-lg border border-input bg-background px-3 py-2 text-sm",children:[(0,s.jsx)("option",{value:"none",children:"No auth"}),(0,s.jsx)("option",{value:"api-key",children:"API key"}),(0,s.jsx)("option",{value:"oauth",children:"OAuth"})]}),"none"!==m?(0,s.jsx)("input",{value:p,onChange:e=>h(e.target.value),placeholder:"Token / secret",className:"w-full rounded-lg border border-input bg-background px-3 py-2 text-sm"}):null,b?(0,s.jsx)("p",{className:"text-sm text-danger",children:b}):null]}),(0,s.jsxs)("div",{className:"mt-5 flex justify-end gap-2",children:[(0,s.jsx)("button",{type:"button",onClick:t,className:"rounded-lg border border-border px-4 py-2 text-sm",children:"Cancel"}),(0,s.jsx)("button",{type:"button",onClick:async()=>{if(!l.trim()||!d.trim()&&!c.trim())return void g("Name plus command or URL is required.");g(null),await n({name:l.trim(),command:d.trim()||void 0,url:c.trim()||void 0,authType:m,token:p.trim()||void 0})},className:"rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground",children:"Add server"})]})]})}):null}var m=t(4226),x=t(685);function p(e){let{extension:r}=e;return(0,s.jsxs)(l(),{href:"/extensions/".concat(r.id),className:"block rounded-2xl border border-border bg-card p-4 shadow-sm transition hover:bg-muted/40",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-sm font-semibold",children:r.name}),(0,s.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:r.description})]}),(0,s.jsxs)("div",{className:"space-y-2 text-right",children:[(0,s.jsx)(m.R,{health:r.health}),(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:[(0,x.b)(r.riskLevel)," \xb7 ",(0,x.BX)(r.authState)]})]})]}),(0,s.jsxs)("div",{className:"mt-4 flex flex-wrap gap-2 text-xs text-muted-foreground",children:[(0,s.jsx)("span",{className:"rounded-full border border-border px-2 py-1",children:(0,x.CF)(r.provenance)}),(0,s.jsx)("span",{className:"rounded-full border border-border px-2 py-1",children:(0,x.Ow)(r.governance)}),(0,s.jsxs)("span",{className:"rounded-full border border-border px-2 py-1",children:[r.capabilities.length," capabilities"]})]})]})}var h=t(9475);let b=[{id:"global",title:"Available everywhere",description:"These tools are available across chats and do not depend on the active profile or thread."},{id:"profile",title:"Follows the active profile",description:"These tools move with the current profile and change when you switch profiles."},{id:"session",title:"Only in this chat",description:"These tools are limited to the current conversation for safer, more local experimentation."}];function g(e){let{tools:r}=e;return 0===r.length?(0,s.jsx)(i.pp,{layout:"banner",title:"No tools available right now",description:"Nothing is currently exposed to the agent from the active integrations, plugins, profile, and chat context."}):(0,s.jsx)("div",{className:"space-y-5",children:b.map(e=>{let t=r.filter(r=>r.scope===e.id);return t.length?(0,s.jsxs)("section",{className:"space-y-3 rounded-2xl border border-border/60 bg-card/55 p-4 shadow-sm",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:e.title}),(0,s.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:e.description})]}),(0,s.jsx)("div",{className:"space-y-3",children:t.map(e=>(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-card p-4 shadow-sm",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"font-medium",children:e.name}),(0,s.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:e.sourceExtensionName})]}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-2 text-xs text-muted-foreground",children:[(0,s.jsx)("span",{className:"rounded-full border border-border px-2 py-1",children:e.category}),(0,s.jsx)("span",{className:"rounded-full border border-border px-2 py-1",children:(0,x.b)(e.riskLevel)}),(0,s.jsx)("span",{className:"rounded-full border border-border px-2 py-1",children:(0,x.B6)(e.approvalPolicy)}),(0,s.jsx)("span",{className:"rounded-full border border-border px-2 py-1",children:e.enabled?"Available now":"Blocked"})]})]}),(0,s.jsx)("p",{className:"mt-3 text-xs text-muted-foreground",children:(0,x.mF)(e.scope)})]},e.id))})]},e.id):null})})}var f=t(7102),v=t(592),j=t(2604);let y={installed:{label:"Connected now",title:"Installed integrations",description:"Everything already connected for this workspace, including built-in and MCP-backed integrations."},mcp:{label:"MCP servers",title:"Installed MCP servers",description:"Only the MCP servers already configured for the active profile."},discover:{label:"MCP Hub",title:"Discover MCP servers",description:"Browse more MCP servers to install without mixing them into the current inventory."},tools:{label:"Available tools",title:"Tools the agent can use",description:"This view explains what is currently available everywhere, by profile, or only in this chat."},approvals:{label:"Approval rules",title:"Integrations that need extra approval",description:"See which integrations are blocked, approval-gated, or limited by policy before a tool can run."},diagnostics:{label:"Diagnostics",title:"Runtime diagnostics",description:"Inspect runtime health when discovery or live checks look incomplete or degraded."}};function N(e){var r,t,n,m,b,N,w,k,C,P,S;let{initialTab:A="installed"}=e,M=(0,a.useRouter)(),[O,T]=(0,o.useState)(!1),[I,F]=(0,o.useState)(A),{activeSessionId:q}=(0,j.j)(),E=(0,c.Ot)(),B=(0,v.w)(),L=(0,c.qr)(),R=null!=(k=null==(r=E.data)?void 0:r.extensions)?k:[],H=null!=(C=null==(t=E.data)?void 0:t.tools)?C:[],U="mcp"===I?R.filter(e=>"mcp"===e.type):R,D=R.filter(e=>"approval-gated"===e.governance||"auto"!==e.approvalPolicy),V=H.filter(e=>"session"===e.scope),W=H.filter(e=>"profile"===e.scope),_=H.filter(e=>"global"===e.scope),J=R.filter(e=>"healthy"!==e.health||"needs-auth"===e.authState||"expired"===e.authState),K=null!=(S=null!=(P=null==(m=B.data)||null==(n=m.profileContext)?void 0:n.label)?P:null==(b=B.data)?void 0:b.activeProfile)?S:"Unknown profile",X=y[I];return(0,s.jsxs)("div",{className:"h-full space-y-6 overflow-y-auto p-4 lg:p-6",children:[(0,s.jsxs)("section",{className:"space-y-4 rounded-3xl border border-border/70 bg-card/60 p-5 shadow-[var(--shadow-elevated)] lg:p-6",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[(0,s.jsxs)("div",{className:"max-w-3xl",children:[(0,s.jsx)("h1",{className:"text-2xl font-semibold",children:"Integrations"}),(0,s.jsx)("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:"Understand what is installed, what the agent can use right now, and what still needs setup. MCP servers live here; repo-based plugins stay on the separate Plugins page."})]}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,s.jsx)("button",{type:"button",onClick:()=>T(!0),className:"rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground",children:"Add MCP server"}),(0,s.jsx)(l(),{href:"/plugins",className:"rounded-lg border border-border/70 bg-background/80 px-4 py-2 text-sm font-medium text-foreground",children:"Open plugins"})]})]}),(0,s.jsxs)("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-4",children:[(0,s.jsxs)("div",{className:"rounded-2xl border border-border bg-card p-4 shadow-sm",children:[(0,s.jsx)("p",{className:"text-xs uppercase tracking-label text-muted-foreground",children:"Installed now"}),(0,s.jsx)("p",{className:"mt-2 text-2xl font-semibold",children:R.length}),(0,s.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:"Connected integrations across built-in and MCP sources."})]}),(0,s.jsxs)("div",{className:"rounded-2xl border border-border bg-card p-4 shadow-sm",children:[(0,s.jsx)("p",{className:"text-xs uppercase tracking-label text-muted-foreground",children:"Available tools"}),(0,s.jsx)("p",{className:"mt-2 text-2xl font-semibold",children:H.length}),(0,s.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:"Tools the agent can reach from the current workspace context."})]}),(0,s.jsxs)("div",{className:"rounded-2xl border border-border bg-card p-4 shadow-sm",children:[(0,s.jsx)("p",{className:"text-xs uppercase tracking-label text-muted-foreground",children:"Needs attention"}),(0,s.jsx)("p",{className:"mt-2 text-2xl font-semibold",children:J.length}),(0,s.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:"Integrations that are degraded, blocked, or missing auth."})]}),(0,s.jsxs)("div",{className:"rounded-2xl border border-border bg-card p-4 shadow-sm",children:[(0,s.jsx)("p",{className:"text-xs uppercase tracking-label text-muted-foreground",children:"Active profile"}),(0,s.jsx)("p",{className:"mt-2 text-lg font-semibold",children:K}),(0,s.jsxs)("p",{className:"mt-1 text-sm text-muted-foreground",children:[W.length," tools follow the active profile."]})]})]}),(0,s.jsxs)("div",{className:"grid gap-3 lg:grid-cols-3",children:[(0,s.jsxs)("div",{className:"rounded-2xl border border-border/60 bg-background/70 p-4 text-sm text-muted-foreground shadow-sm",children:[(0,s.jsx)("p",{className:"font-medium text-foreground",children:"What is an integration?"}),(0,s.jsx)("p",{className:"mt-2",children:"An integration is a connected capability Pan can inspect and the agent can call. MCP servers show up here because they expose live tools."})]}),(0,s.jsxs)("div",{className:"rounded-2xl border border-border/60 bg-background/70 p-4 text-sm text-muted-foreground shadow-sm",children:[(0,s.jsx)("p",{className:"font-medium text-foreground",children:"What are tools?"}),(0,s.jsx)("p",{className:"mt-2",children:"Tools are the actions the agent can actually run. Some are global, some follow the active profile, and some only apply to the current chat."})]}),(0,s.jsxs)("div",{className:"rounded-2xl border border-border/60 bg-background/70 p-4 text-sm text-muted-foreground shadow-sm",children:[(0,s.jsx)("p",{className:"font-medium text-foreground",children:"Where do plugins fit?"}),(0,s.jsx)("p",{className:"mt-2",children:"Plugins are deeper repo-based extensions. They can add hooks and tool bundles, but they are managed separately so this page can stay focused on live availability."})]})]})]}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:Object.entries(y).map(e=>{let[r,t]=e;return(0,s.jsx)("button",{type:"button",onClick:()=>F(r),className:"rounded-lg px-4 py-2 text-sm ".concat(I===r?"bg-primary text-primary-foreground":"border border-border text-muted-foreground"),children:t.label},r)})}),(0,s.jsxs)("section",{className:"space-y-4 rounded-2xl border border-border/60 bg-card/55 p-4 shadow-sm",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold text-foreground",children:X.title}),(0,s.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:X.description})]}),(null==(N=B.data)?void 0:N.available)&&(null==(w=B.data)?void 0:w.apiReachable)===!1?(0,s.jsx)(i.eS,{layout:"banner",title:"Runtime data is currently degraded",description:"Some integration information is still readable, but live runtime checks are unavailable right now."}):null,E.isLoading?(0,s.jsx)(d.O,{count:3,cardClassName:"h-32"}):null,E.isError?(0,s.jsx)(i.W5,{title:"Could not load integrations",error:E.error,description:"Pan could not read the current integrations state from the runtime."}):null,"tools"===I?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"grid gap-3 md:grid-cols-3",children:[(0,s.jsxs)("div",{className:"rounded-2xl border border-border bg-card p-4 shadow-sm",children:[(0,s.jsx)("p",{className:"text-xs uppercase tracking-label text-muted-foreground",children:"Available everywhere"}),(0,s.jsx)("p",{className:"mt-2 text-2xl font-semibold",children:_.length}),(0,s.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:"Tools that do not depend on profile or chat scope."})]}),(0,s.jsxs)("div",{className:"rounded-2xl border border-border bg-card p-4 shadow-sm",children:[(0,s.jsx)("p",{className:"text-xs uppercase tracking-label text-muted-foreground",children:"Follows profile"}),(0,s.jsx)("p",{className:"mt-2 text-2xl font-semibold",children:W.length}),(0,s.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:"Changes when you switch the active profile."})]}),(0,s.jsxs)("div",{className:"rounded-2xl border border-border bg-card p-4 shadow-sm",children:[(0,s.jsx)("p",{className:"text-xs uppercase tracking-label text-muted-foreground",children:"Only this chat"}),(0,s.jsx)("p",{className:"mt-2 text-2xl font-semibold",children:V.length}),(0,s.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:q?"Limited to the active chat for safer experimentation.":"These appear once a chat-level tool is attached."})]})]}),(0,s.jsx)(g,{tools:H})]}):null,"diagnostics"===I?(0,s.jsx)(f.McpDiagnosticsPanel,{}):null,"approvals"===I?(0,s.jsxs)("div",{className:"space-y-3",children:[D.map(e=>(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-card p-4 shadow-sm",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,s.jsx)("p",{className:"font-medium",children:e.name}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-2 text-xs text-muted-foreground",children:[(0,s.jsx)("span",{className:"rounded-full border border-border px-2 py-1",children:(0,x.Ow)(e.governance)}),(0,s.jsx)("span",{className:"rounded-full border border-border px-2 py-1",children:(0,x.B6)(e.approvalPolicy)})]})]}),(0,s.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:e.description})]},e.id)),0===D.length?(0,s.jsx)(i.pp,{layout:"banner",title:"No extra approval rules right now",description:"No installed integrations currently need explicit approval handling beyond the default runtime posture."}):null]}):null,"installed"===I||"mcp"===I?U.length>0?(0,s.jsx)("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:U.map(e=>(0,s.jsx)(p,{extension:e},e.id))}):(0,s.jsx)(i.pp,{title:"mcp"===I?"No MCP servers installed":"No integrations installed",description:"mcp"===I?"Add an MCP server directly or browse the MCP Hub to connect one.":"This profile has no connected integrations yet. Start with an MCP server, then inspect tools and approvals once it is live.",primaryAction:(0,s.jsx)("button",{type:"button",onClick:()=>T(!0),className:"rounded-2xl bg-primary px-4 py-2 text-sm font-medium text-primary-foreground",children:"Add MCP server"}),secondaryAction:(0,s.jsx)("button",{type:"button",onClick:()=>F("discover"),className:"rounded-2xl border border-border/70 bg-background/80 px-4 py-2 text-sm font-medium text-foreground",children:"Browse MCP Hub"})}):null,"discover"===I?(0,s.jsx)(h.McpHub,{}):null]}),(0,s.jsx)(u,{open:O,onClose:()=>T(!1),onSubmit:async e=>{let{extension:r}=await L.mutateAsync(e);T(!1),M.push("/extensions/".concat(r.id))}})]})}},2596:(e,r,t)=>{"use strict";t.d(r,{G:()=>o,o:()=>l});var s=t(2454),n=t(9678);function l(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return(0,s.I)({queryKey:["runtime-runs",e],queryFn:()=>(0,n.n)("/api/runtime/runs".concat(e?"?sessionId=".concat(encodeURIComponent(e)):"")),select:e=>e.runs})}function o(){return(0,s.I)({queryKey:["mcp-probe-results"],queryFn:()=>(0,n.n)("/api/runtime/mcp-probes"),select:e=>e.results})}},4226:(e,r,t)=>{"use strict";t.d(r,{R:()=>o});var s=t(5155),n=t(2263),l=t(4695);function o(e){let{health:r}=e,t=(0,l.Ds)(r),o="healthy"===t||"degraded"===t||"unreachable"===t?(0,l.OX)(t):"connected"===t||"needs-auth"===t||"expired"===t?(0,l.P0)(t):(0,l.fh)(t);return(0,s.jsx)(n.W,{label:(0,l.MU)(r),tone:o})}},5495:(e,r,t)=>{Promise.resolve().then(t.bind(t,1935)),Promise.resolve().then(t.bind(t,9136)),Promise.resolve().then(t.bind(t,6981)),Promise.resolve().then(t.bind(t,1336))},7102:(e,r,t)=>{"use strict";t.d(r,{McpDiagnosticsPanel:()=>o});var s=t(5155),n=t(2596),l=t(592);function o(){var e,r,t,o,a,d,i;let c=(0,l.w)(),u=(0,n.G)(),m=c.data,x=null!=(r=u.data)?r:[];return(0,s.jsxs)("div",{className:"space-y-4 p-4 lg:p-6",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-2xl font-semibold",children:"MCP diagnostics"}),(0,s.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"Inspect configured MCP servers, last probe results, active profile context, and remediation hints."})]}),(0,s.jsxs)("div",{className:"grid gap-3 md:grid-cols-3",children:[(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-card p-4 text-sm shadow-sm",children:[(0,s.jsx)("p",{className:"text-xs uppercase tracking-label text-muted-foreground",children:"Runtime profile"}),(0,s.jsx)("p",{className:"mt-2 font-semibold",children:null!=(o=null!=(t=null==m||null==(e=m.profileContext)?void 0:e.label)?t:null==m?void 0:m.activeProfile)?o:"unknown"})]}),(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-card p-4 text-sm shadow-sm",children:[(0,s.jsx)("p",{className:"text-xs uppercase tracking-label text-muted-foreground",children:"Configured servers"}),(0,s.jsx)("p",{className:"mt-2 font-semibold",children:null!=(a=null==m?void 0:m.mcpServers.length)?a:0})]}),(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-card p-4 text-sm shadow-sm",children:[(0,s.jsx)("p",{className:"text-xs uppercase tracking-label text-muted-foreground",children:"Probe records"}),(0,s.jsx)("p",{className:"mt-2 font-semibold",children:x.length})]})]}),(0,s.jsxs)("div",{className:"space-y-3",children:[(null!=(d=null==m?void 0:m.mcpServers)?d:[]).map(e=>{let r=x.find(r=>r.serverName===e.name);return(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-card p-4 shadow-sm",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:e.name}),(0,s.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:e.url||e.command||"No transport configured"})]}),(0,s.jsx)("span",{className:"rounded-full border border-border px-2 py-1 text-xs text-muted-foreground",children:r?r.success?"success":"failed":"unknown"})]}),(0,s.jsxs)("div",{className:"mt-3 rounded-lg border border-border bg-background p-3 text-xs text-muted-foreground",children:[(0,s.jsxs)("p",{children:[(0,s.jsx)("strong",{children:"Last probe:"})," ",r?String(r.probedAt):"never"]}),(0,s.jsxs)("p",{children:[(0,s.jsx)("strong",{children:"Error:"})," ",r&&r.errorText?String(r.errorText):"none captured"]}),(0,s.jsxs)("p",{children:[(0,s.jsx)("strong",{children:"Tools seen:"})," ",r&&Array.isArray(r.tools)?r.tools.length:0]})]})]},e.name)}),(null!=(i=null==m?void 0:m.mcpServers.length)?i:0)?null:(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"No MCP servers are currently configured."})]})]})}}},e=>{e.O(0,[2231,1635,4879,5097,9475,2433,8441,1255,7358],()=>e(e.s=5495)),_N_E=e.O()}]);
|
package/.next/static/chunks/app/marketplace/{page-e9f839ad75b7f4a8.js → page-d9a4cdeb605d3b23.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5094],{962:(e,s,t)=>{"use strict";t.d(s,{Ho:()=>o,P4:()=>c,c$:()=>d,qw:()=>i});var l=t(2454),r=t(9776),n=t(549),a=t(9678);function i(){return(0,l.I)({queryKey:["plugins"],queryFn:()=>(0,a.n)("/api/plugins"),select:e=>e.plugins})}function d(){let e=(0,r.jE)();return(0,n.n)({mutationFn:e=>(0,a.n)("/api/plugins/install",{method:"POST",body:JSON.stringify(e)}),onSuccess:()=>{e.invalidateQueries({queryKey:["plugins"]})}})}function o(){let e=(0,r.jE)();return(0,n.n)({mutationFn:e=>(0,a.n)("/api/plugins/".concat(e),{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:["plugins"]})}})}function c(){let e=(0,r.jE)();return(0,n.n)({mutationFn:e=>{let{id:s,enabled:t}=e;return(0,a.n)("/api/plugins/".concat(s,"/enable"),{method:"POST",body:JSON.stringify({enabled:t})})},onSuccess:()=>{e.invalidateQueries({queryKey:["plugins"]})}})}},1339:(e,s,t)=>{"use strict";t.d(s,{MarketplaceScreen:()=>L});var l=t(5155),r=t(2115),n=t(8486),a=t(8192),i=t(8599),d=t(5136),o=t(6651),c=t(5229),u=t(5740),m=t(3842),x=t(4269),p=t(4412),h=t(1375),g=t(2454),f=t(9678);async function b(e){let s=encodeURIComponent(e),[t,l,r]=await Promise.all([(0,f.n)("/api/skills/hub?q=".concat(s)),(0,f.n)("/api/extensions/hub?q=".concat(s)),(0,f.n)("/api/plugins")]),n=e.toLowerCase(),a=r.plugins.filter(e=>e.name.toLowerCase().includes(n)||e.description.toLowerCase().includes(n));return{skills:t.skills,mcpServers:l.servers,plugins:a,total:t.skills.length+l.servers.length+a.length}}var y=t(6670),v=t(962),j=t(9318);let N=(0,r.lazy)(()=>t.e(9475).then(t.bind(t,9475)).then(e=>({default:e.McpHub}))),k=(0,r.lazy)(()=>t.e(3140).then(t.bind(t,3140)).then(e=>({default:e.PluginsScreen}))),w=(0,r.lazy)(()=>t.e(1257).then(t.bind(t,1257)).then(e=>({default:e.SkillsScreen}))),S=[{id:"skills",label:"Skills",icon:n.A,discoverLabel:"Reusable procedures, references, and templates ready to install.",inventoryLabel:"Review the skills already installed in this workspace."},{id:"mcp-servers",label:"MCP servers",icon:a.A,discoverLabel:"Connect live tools and external systems through the MCP ecosystem.",inventoryLabel:"See which MCP servers are available to this profile right now."},{id:"plugins",label:"Plugins",icon:i.A,discoverLabel:"Extend Pan with custom tool bundles, hooks, and integrations.",inventoryLabel:"Manage installed plugins and add more when needed."}];function P(e){let{icon:s,eyebrow:t,title:r,description:n,meta:a,onOpen:i}=e;return(0,l.jsxs)("button",{type:"button",onClick:i,className:"rounded-2xl border border-border/70 bg-card/70 p-4 text-left shadow-[var(--shadow-card)] transition hover:-translate-y-0.5 hover:bg-card",children:[(0,l.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-xl bg-primary/10 text-primary",children:(0,l.jsx)(s,{className:"h-5 w-5"})}),(0,l.jsx)("p",{className:"mt-4 text-2xs font-semibold uppercase tracking-label text-muted-foreground",children:t}),(0,l.jsx)("h3",{className:"mt-1 text-base font-semibold text-foreground",children:r}),(0,l.jsx)("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:n}),(0,l.jsx)("p",{className:"mt-4 text-xs font-medium text-foreground",children:a})]})}function q(e){var s;let{skill:t}=e;return(0,l.jsxs)("div",{className:"rounded-2xl border border-border/70 bg-card/70 p-4 shadow-[var(--shadow-card)]",children:[(0,l.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsx)("h3",{className:"truncate text-sm font-semibold text-foreground",children:t.name}),(0,l.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:t.repo})]}),(0,l.jsx)("span",{className:"rounded-full border border-border/70 bg-background/70 px-2 py-1 text-2xs font-medium text-foreground",children:t.trustLevel})]}),(0,l.jsx)("p",{className:"mt-3 line-clamp-3 text-sm leading-6 text-muted-foreground",children:(null==(s=t.detail)?void 0:s.summary)||t.description}),(0,l.jsxs)("div",{className:"mt-3 flex flex-wrap gap-2",children:[null!=t.installs?(0,l.jsxs)("span",{className:"rounded-full bg-muted/60 px-2 py-1 text-2xs text-muted-foreground",children:[t.installs.toLocaleString()," installs"]}):null,t.tags.slice(0,2).map(e=>(0,l.jsx)("span",{className:"rounded-full bg-muted/60 px-2 py-1 text-2xs text-muted-foreground",children:e},e))]})]})}function C(e){let{server:s}=e;return(0,l.jsxs)("div",{className:"rounded-2xl border border-border/70 bg-card/70 p-4 shadow-[var(--shadow-card)]",children:[(0,l.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsx)("h3",{className:"truncate text-sm font-semibold text-foreground",children:s.title||s.name}),(0,l.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:s.author||s.category})]}),(0,l.jsx)("span",{className:"rounded-full border border-border/70 bg-background/70 px-2 py-1 text-2xs font-medium text-foreground",children:s.verified?"verified":s.transport})]}),(0,l.jsx)("p",{className:"mt-3 line-clamp-3 text-sm leading-6 text-muted-foreground",children:s.description}),(0,l.jsxs)("div",{className:"mt-3 flex flex-wrap gap-2",children:[(0,l.jsx)("span",{className:"rounded-full bg-muted/60 px-2 py-1 text-2xs text-muted-foreground",children:s.transport}),(0,l.jsx)("span",{className:"rounded-full bg-muted/60 px-2 py-1 text-2xs text-muted-foreground",children:s.category}),s.tools.length?(0,l.jsxs)("span",{className:"rounded-full bg-muted/60 px-2 py-1 text-2xs text-muted-foreground",children:[s.tools.length," tools"]}):null]})]})}function A(e){let{plugin:s}=e;return(0,l.jsxs)("div",{className:"rounded-2xl border border-border/70 bg-card/70 p-4 shadow-[var(--shadow-card)]",children:[(0,l.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsx)("h3",{className:"truncate text-sm font-semibold text-foreground",children:s.name}),(0,l.jsxs)("p",{className:"mt-1 text-xs text-muted-foreground",children:["v",s.version]})]}),(0,l.jsx)("span",{className:"rounded-full border border-border/70 bg-background/70 px-2 py-1 text-2xs font-medium text-foreground",children:s.enabled?"enabled":"installed"})]}),(0,l.jsx)("p",{className:"mt-3 line-clamp-3 text-sm leading-6 text-muted-foreground",children:s.description}),(0,l.jsxs)("div",{className:"mt-3 flex flex-wrap gap-2",children:[(0,l.jsx)("span",{className:"rounded-full bg-muted/60 px-2 py-1 text-2xs text-muted-foreground",children:s.source}),s.providedTools.length?(0,l.jsxs)("span",{className:"rounded-full bg-muted/60 px-2 py-1 text-2xs text-muted-foreground",children:[s.providedTools.length," tools"]}):null,s.providedHooks.length?(0,l.jsxs)("span",{className:"rounded-full bg-muted/60 px-2 py-1 text-2xs text-muted-foreground",children:[s.providedHooks.length," hooks"]}):null]})]})}function L(){var e,s,t,f,L,O,E,F,M;let[I,T]=(0,r.useState)("skills"),[K,Q]=(0,r.useState)("discover"),[R,J]=(0,r.useState)(""),[_,D]=(0,r.useState)(""),z=(0,r.useRef)(null);(0,r.useEffect)(()=>(z.current&&clearTimeout(z.current),z.current=setTimeout(()=>{D(R.trim())},300),()=>{z.current&&clearTimeout(z.current)}),[R]);let H=_.length>0,U=(0,g.I)({queryKey:["marketplace-search",_],queryFn:()=>b(_),enabled:_.trim().length>0}),W=(0,j.vb)(),$=(0,y.J)(),B=(0,v.qw)(),G=(0,r.useMemo)(()=>{var e,s;return(null!=(s=null==(e=W.data)?void 0:e.skills)?s:[]).slice(0,3)},[null==(e=W.data)?void 0:e.skills]),V=(0,r.useMemo)(()=>{var e,s;return(null!=(s=null==(e=$.data)?void 0:e.servers)?s:[]).filter(e=>e.verified).slice(0,3)},[null==(s=$.data)?void 0:s.servers]),X=(0,r.useMemo)(()=>{var e;return(null!=(e=B.data)?e:[]).slice(0,3)},[B.data]),Y=null!=(O=S.find(e=>e.id===I))?O:S[0];return(0,l.jsxs)("div",{className:"h-full space-y-5 overflow-y-auto p-4 pb-8 lg:p-6 lg:pb-10",children:[(0,l.jsx)("section",{className:"rounded-3xl border border-border/70 bg-[linear-gradient(135deg,rgba(7,52,85,0.14),rgba(9,70,104,0.08),rgba(233,200,25,0.08))] p-5 shadow-[var(--shadow-elevated)] lg:p-6",children:(0,l.jsxs)("div",{className:"flex flex-col gap-5 lg:flex-row lg:items-end lg:justify-between",children:[(0,l.jsxs)("div",{className:"max-w-3xl",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"flex h-11 w-11 items-center justify-center rounded-2xl bg-primary/12 text-primary",children:(0,l.jsx)(d.A,{className:"h-5 w-5"})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-xs font-semibold uppercase tracking-label text-muted-foreground",children:"Marketplace"}),(0,l.jsx)("h1",{className:"text-2xl font-semibold text-foreground",children:"Discover what to add next"})]})]}),(0,l.jsx)("p",{className:"mt-4 text-sm leading-6 text-muted-foreground",children:"Browse skills, MCP servers, and plugins from one place. Use the search bar for the full marketplace, then switch into a section only when you want local filters and deeper inventory controls."})]}),(0,l.jsxs)("div",{className:"grid gap-3 sm:grid-cols-3 lg:min-w-[420px]",children:[(0,l.jsx)(P,{icon:n.A,eyebrow:"Skills",title:"Reusable know-how",description:"Install proven procedures, references, and templates for recurring work.",meta:"".concat(null!=(E=null==(t=W.data)?void 0:t.skills.length)?E:0," discoverable now"),onOpen:()=>{Q("discover"),T("skills")}}),(0,l.jsx)(P,{icon:a.A,eyebrow:"MCP servers",title:"Live tools",description:"Connect external systems and tool surfaces through the MCP ecosystem.",meta:"".concat(null!=(F=null==(f=$.data)?void 0:f.servers.length)?F:0," listed right now"),onOpen:()=>{Q("discover"),T("mcp-servers")}}),(0,l.jsx)(P,{icon:i.A,eyebrow:"Plugins",title:"Agent extensions",description:"Add custom tool bundles, hooks, and runtime integrations when you need them.",meta:"".concat(null!=(M=null==(L=B.data)?void 0:L.length)?M:0," installed in this workspace"),onOpen:()=>{Q("installed"),T("plugins")}})]})]})}),(0,l.jsxs)("section",{className:"space-y-3 rounded-2xl border border-border/70 bg-card/60 p-4 shadow-[var(--shadow-card)]",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-xs font-semibold uppercase tracking-label text-muted-foreground",children:"Marketplace search"}),(0,l.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:"This searches across skills, MCP servers, and plugins. Any extra search controls below only filter the current section."})]}),(0,l.jsxs)("div",{className:"relative max-w-2xl",children:[(0,l.jsx)(o.A,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),(0,l.jsx)("input",{type:"text",placeholder:"Search the full marketplace catalog…",value:R,onChange:e=>J(e.target.value),className:"w-full rounded-xl border border-border/70 bg-background/80 py-2.5 pl-9 pr-9 text-sm outline-none placeholder:text-muted-foreground focus:ring-2 focus:ring-primary/30"}),R?(0,l.jsx)("button",{type:"button",onClick:()=>J(""),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:(0,l.jsx)(c.A,{className:"h-4 w-4"})}):null]})]}),H?(0,l.jsxs)("section",{className:"space-y-6",children:[(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,l.jsx)("span",{className:"rounded-full bg-primary/10 px-3 py-1 text-xs font-medium text-primary",children:"Searching across the marketplace"}),(0,l.jsxs)("span",{className:"text-sm text-muted-foreground",children:["Results for “",_,"” are grouped by type so discovery and inventory do not blur together."]})]}),U.isLoading?(0,l.jsx)(p.O,{}):null,U.isError?(0,l.jsx)(h.W5,{title:"Search failed",error:U.error,description:"We could not load marketplace results right now. Try again in a moment."}):null,U.data&&0===U.data.total?(0,l.jsx)(h.pp,{title:"No marketplace results",description:(0,l.jsxs)(l.Fragment,{children:["No results found for “",_,"”. Try a broader term or clear the marketplace search."]})}):null,U.data&&U.data.skills.length>0?(0,l.jsxs)("div",{className:"space-y-3",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(n.A,{className:"h-4 w-4 text-primary"}),(0,l.jsx)("h2",{className:"text-sm font-semibold text-foreground",children:"Skills"}),(0,l.jsx)("span",{className:"rounded-full bg-muted/60 px-2 py-0.5 text-2xs text-muted-foreground",children:U.data.skills.length})]}),(0,l.jsx)("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:U.data.skills.map(e=>(0,l.jsx)(q,{skill:e},e.id))})]}):null,U.data&&U.data.mcpServers.length>0?(0,l.jsxs)("div",{className:"space-y-3",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(a.A,{className:"h-4 w-4 text-primary"}),(0,l.jsx)("h2",{className:"text-sm font-semibold text-foreground",children:"MCP servers"}),(0,l.jsx)("span",{className:"rounded-full bg-muted/60 px-2 py-0.5 text-2xs text-muted-foreground",children:U.data.mcpServers.length})]}),(0,l.jsx)("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:U.data.mcpServers.map(e=>(0,l.jsx)(C,{server:e},e.id))})]}):null,U.data&&U.data.plugins.length>0?(0,l.jsxs)("div",{className:"space-y-3",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(i.A,{className:"h-4 w-4 text-primary"}),(0,l.jsx)("h2",{className:"text-sm font-semibold text-foreground",children:"Plugins"}),(0,l.jsx)("span",{className:"rounded-full bg-muted/60 px-2 py-0.5 text-2xs text-muted-foreground",children:U.data.plugins.length})]}),(0,l.jsx)("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:U.data.plugins.map(e=>(0,l.jsx)(A,{plugin:e},e.id))})]}):null]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("section",{className:"flex flex-wrap items-center gap-2",children:[(0,l.jsxs)("button",{type:"button",onClick:()=>Q("discover"),className:(0,x.cn)("inline-flex items-center gap-2 rounded-2xl px-4 py-2 text-sm font-medium transition","discover"===K?"bg-primary text-primary-foreground shadow-sm":"border border-border/70 text-muted-foreground hover:bg-card"),children:[(0,l.jsx)(u.A,{className:"h-4 w-4"}),"Discover"]}),(0,l.jsxs)("button",{type:"button",onClick:()=>Q("installed"),className:(0,x.cn)("inline-flex items-center gap-2 rounded-2xl px-4 py-2 text-sm font-medium transition","installed"===K?"bg-primary text-primary-foreground shadow-sm":"border border-border/70 text-muted-foreground hover:bg-card"),children:[(0,l.jsx)(m.A,{className:"h-4 w-4"}),"Installed inventory"]})]}),"discover"===K?(0,l.jsxs)("div",{className:"space-y-6",children:[(0,l.jsxs)("section",{className:"grid gap-6 xl:grid-cols-3",children:[(0,l.jsxs)("div",{className:"space-y-3 xl:col-span-2",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(n.A,{className:"h-4 w-4 text-primary"}),(0,l.jsx)("h2",{className:"text-sm font-semibold text-foreground",children:"Featured skills"})]}),(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:"Start with reusable instructions and references before you reach for lower-level wiring."}),W.isLoading?(0,l.jsx)(p.O,{}):null,!W.isLoading&&G.length?(0,l.jsx)("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:G.map(e=>(0,l.jsx)(q,{skill:e},e.id))}):null]}),(0,l.jsxs)("div",{className:"space-y-3",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(i.A,{className:"h-4 w-4 text-primary"}),(0,l.jsx)("h2",{className:"text-sm font-semibold text-foreground",children:"Plugin posture"})]}),(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:"Plugins are the most opinionated extensions. Keep them secondary to discovery, but visible when you need deeper customization."}),X.length?(0,l.jsx)("div",{className:"space-y-4",children:X.map(e=>(0,l.jsx)(A,{plugin:e},e.id))}):(0,l.jsx)(h.pp,{title:"No plugins installed yet",description:"Use plugins when you need custom tool bundles, lifecycle hooks, or repo-based extensions. They stay secondary to skills and MCP discovery by design."})]})]}),(0,l.jsxs)("section",{className:"space-y-3",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(a.A,{className:"h-4 w-4 text-primary"}),(0,l.jsx)("h2",{className:"text-sm font-semibold text-foreground",children:"Recommended MCP servers"})]}),(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:"These cards surface trust, transport, and tool scope before you dive into the full catalog."}),$.isLoading?(0,l.jsx)(p.O,{}):null,!$.isLoading&&V.length?(0,l.jsx)("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:V.map(e=>(0,l.jsx)(C,{server:e},e.id))}):null]})]}):null,(0,l.jsxs)("section",{className:"space-y-4 rounded-2xl border border-border/70 bg-card/60 p-4 shadow-[var(--shadow-card)]",children:[(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:S.map(e=>{let{id:s,label:t,icon:r}=e;return(0,l.jsxs)("button",{type:"button",onClick:()=>T(s),className:(0,x.cn)("inline-flex items-center gap-1.5 rounded-2xl px-4 py-2 text-sm font-medium transition",I===s?"bg-primary text-primary-foreground shadow-sm":"border border-border/70 text-muted-foreground hover:bg-card"),children:[(0,l.jsx)(r,{className:"h-3.5 w-3.5"}),t]},s)})}),(0,l.jsxs)("p",{className:"text-sm text-muted-foreground",children:["discover"===K?Y.discoverLabel:Y.inventoryLabel," Local controls below only affect this section."]})]}),(0,l.jsxs)(r.Suspense,{fallback:(0,l.jsx)(p.O,{}),children:["skills"===I?(0,l.jsx)(w,{}):null,"mcp-servers"===I?(0,l.jsx)(N,{}):null,"plugins"===I?(0,l.jsx)(k,{}):null]})]})]})]})}},3842:(e,s,t)=>{"use strict";t.d(s,{A:()=>l});let l=(0,t(1847).A)("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]])},5971:(e,s,t)=>{Promise.resolve().then(t.bind(t,1935)),Promise.resolve().then(t.bind(t,9136)),Promise.resolve().then(t.bind(t,6981)),Promise.resolve().then(t.bind(t,1339))},9318:(e,s,t)=>{"use strict";t.d(s,{$P:()=>g,F8:()=>p,I3:()=>u,Pt:()=>o,Qc:()=>f,a$:()=>d,aO:()=>m,b_:()=>x,hL:()=>h,jM:()=>y,vb:()=>b});var l=t(2454),r=t(9776),n=t(549),a=t(9678),i=t(9054);function d(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];return(0,l.I)({queryKey:["skills",e],queryFn:()=>(0,a.n)("/api/skills".concat(e?"?installed=true":"")),select:e=>(0,i.iF)(e.skills)})}function o(e){return(0,l.I)({queryKey:["skill",e],queryFn:()=>(0,a.n)("/api/skills/".concat(e)),select:e=>(0,i.d)(e.skill),enabled:!!e})}function c(e,s){let t=(0,i.d)(s);e.invalidateQueries({queryKey:["skills"]}),e.setQueryData(["skill",t.id],{skill:t})}function u(){let e=(0,r.jE)();return(0,n.n)({mutationFn:e=>(0,a.n)("/api/skills/".concat(e,"/install"),{method:"POST"}),onSuccess:s=>{let{skill:t}=s;return c(e,t)}})}function m(){let e=(0,r.jE)();return(0,n.n)({mutationFn:e=>{let{skillId:s,enabled:t}=e;return(0,a.n)("/api/skills/".concat(s,"/enable"),{method:"POST",body:JSON.stringify({enabled:t})})},onSuccess:s=>{let{skill:t}=s;return c(e,t)}})}function x(){let e=(0,r.jE)();return(0,n.n)({mutationFn:e=>{let{skillId:s,content:t}=e;return(0,a.n)("/api/skills/".concat(s),{method:"PATCH",body:JSON.stringify({content:t})})},onSuccess:s=>{let{skill:t}=s;return c(e,t)}})}function p(){let e=(0,r.jE)();return(0,n.n)({mutationFn:e=>{let{skillId:s,sessionId:t}=e;return(0,a.n)("/api/skills/".concat(s,"/load"),{method:"POST",body:JSON.stringify({sessionId:t})})},onSuccess:(s,t)=>{let{skill:l}=s;c(e,l),e.setQueryData(["session",t.sessionId],e=>{var s;if(!(null==e?void 0:e.session))return e;let l=null!=(s=e.session.loadedSkillIds)?s:[];return{...e,session:{...e.session,loadedSkillIds:l.includes(t.skillId)?l:[t.skillId,...l]}}}),e.invalidateQueries({queryKey:["session",t.sessionId]})}})}function h(){let e=(0,r.jE)();return(0,n.n)({mutationFn:e=>(0,a.n)("/api/skills/".concat(e),{method:"DELETE"}),onSuccess:s=>{let{skill:t}=s;return c(e,t)}})}function g(){return(0,l.I)({queryKey:["skill-categories"],queryFn:()=>(0,a.n)("/api/skills/categories"),select:e=>e.categories})}function f(e,s){return(0,l.I)({queryKey:["skill-file",e,s],queryFn:()=>(0,a.n)("/api/skills/".concat(e,"/files?path=").concat(encodeURIComponent(s))),enabled:!!(e&&s)})}function b(e){let s=e?"?q=".concat(encodeURIComponent(e)):"";return(0,l.I)({queryKey:["hub-skills",null!=e?e:""],queryFn:()=>(0,a.n)("/api/skills/hub".concat(s))})}function y(){let e=(0,r.jE)();return(0,n.n)({mutationFn:e=>{let{identifier:s,category:t}=e;return(0,a.n)("/api/skills/hub/install",{method:"POST",body:JSON.stringify({identifier:s,category:t})})},onSuccess:()=>{e.invalidateQueries({queryKey:["skills"]}),e.invalidateQueries({queryKey:["hub-skills"]}),e.invalidateQueries({queryKey:["skill-categories"]})}})}}},e=>{e.O(0,[2231,1635,4879,5097,9860,8441,1255,7358],()=>e(e.s=5971)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5094],{962:(e,s,t)=>{"use strict";t.d(s,{Ho:()=>o,P4:()=>c,c$:()=>d,qw:()=>i});var l=t(2454),r=t(9776),n=t(549),a=t(9678);function i(){return(0,l.I)({queryKey:["plugins"],queryFn:()=>(0,a.n)("/api/plugins"),select:e=>e.plugins})}function d(){let e=(0,r.jE)();return(0,n.n)({mutationFn:e=>(0,a.n)("/api/plugins/install",{method:"POST",body:JSON.stringify(e)}),onSuccess:()=>{e.invalidateQueries({queryKey:["plugins"]})}})}function o(){let e=(0,r.jE)();return(0,n.n)({mutationFn:e=>(0,a.n)("/api/plugins/".concat(e),{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:["plugins"]})}})}function c(){let e=(0,r.jE)();return(0,n.n)({mutationFn:e=>{let{id:s,enabled:t}=e;return(0,a.n)("/api/plugins/".concat(s,"/enable"),{method:"POST",body:JSON.stringify({enabled:t})})},onSuccess:()=>{e.invalidateQueries({queryKey:["plugins"]})}})}},1339:(e,s,t)=>{"use strict";t.d(s,{MarketplaceScreen:()=>L});var l=t(5155),r=t(2115),n=t(8486),a=t(8192),i=t(8599),d=t(5136),o=t(6651),c=t(5229),u=t(5740),m=t(3842),x=t(4269),p=t(4412),h=t(2932),g=t(2454),f=t(9678);async function b(e){let s=encodeURIComponent(e),[t,l,r]=await Promise.all([(0,f.n)("/api/skills/hub?q=".concat(s)),(0,f.n)("/api/extensions/hub?q=".concat(s)),(0,f.n)("/api/plugins")]),n=e.toLowerCase(),a=r.plugins.filter(e=>e.name.toLowerCase().includes(n)||e.description.toLowerCase().includes(n));return{skills:t.skills,mcpServers:l.servers,plugins:a,total:t.skills.length+l.servers.length+a.length}}var y=t(6670),v=t(962),j=t(9318);let N=(0,r.lazy)(()=>t.e(9475).then(t.bind(t,9475)).then(e=>({default:e.McpHub}))),k=(0,r.lazy)(()=>t.e(3140).then(t.bind(t,3140)).then(e=>({default:e.PluginsScreen}))),w=(0,r.lazy)(()=>t.e(1257).then(t.bind(t,1257)).then(e=>({default:e.SkillsScreen}))),S=[{id:"skills",label:"Skills",icon:n.A,discoverLabel:"Reusable procedures, references, and templates ready to install.",inventoryLabel:"Review the skills already installed in this workspace."},{id:"mcp-servers",label:"MCP servers",icon:a.A,discoverLabel:"Connect live tools and external systems through the MCP ecosystem.",inventoryLabel:"See which MCP servers are available to this profile right now."},{id:"plugins",label:"Plugins",icon:i.A,discoverLabel:"Extend Pan with custom tool bundles, hooks, and integrations.",inventoryLabel:"Manage installed plugins and add more when needed."}];function P(e){let{icon:s,eyebrow:t,title:r,description:n,meta:a,onOpen:i}=e;return(0,l.jsxs)("button",{type:"button",onClick:i,className:"rounded-2xl border border-border/70 bg-card/70 p-4 text-left shadow-[var(--shadow-card)] transition hover:-translate-y-0.5 hover:bg-card",children:[(0,l.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-xl bg-primary/10 text-primary",children:(0,l.jsx)(s,{className:"h-5 w-5"})}),(0,l.jsx)("p",{className:"mt-4 text-2xs font-semibold uppercase tracking-label text-muted-foreground",children:t}),(0,l.jsx)("h3",{className:"mt-1 text-base font-semibold text-foreground",children:r}),(0,l.jsx)("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:n}),(0,l.jsx)("p",{className:"mt-4 text-xs font-medium text-foreground",children:a})]})}function q(e){var s;let{skill:t}=e;return(0,l.jsxs)("div",{className:"rounded-2xl border border-border/70 bg-card/70 p-4 shadow-[var(--shadow-card)]",children:[(0,l.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsx)("h3",{className:"truncate text-sm font-semibold text-foreground",children:t.name}),(0,l.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:t.repo})]}),(0,l.jsx)("span",{className:"rounded-full border border-border/70 bg-background/70 px-2 py-1 text-2xs font-medium text-foreground",children:t.trustLevel})]}),(0,l.jsx)("p",{className:"mt-3 line-clamp-3 text-sm leading-6 text-muted-foreground",children:(null==(s=t.detail)?void 0:s.summary)||t.description}),(0,l.jsxs)("div",{className:"mt-3 flex flex-wrap gap-2",children:[null!=t.installs?(0,l.jsxs)("span",{className:"rounded-full bg-muted/60 px-2 py-1 text-2xs text-muted-foreground",children:[t.installs.toLocaleString()," installs"]}):null,t.tags.slice(0,2).map(e=>(0,l.jsx)("span",{className:"rounded-full bg-muted/60 px-2 py-1 text-2xs text-muted-foreground",children:e},e))]})]})}function C(e){let{server:s}=e;return(0,l.jsxs)("div",{className:"rounded-2xl border border-border/70 bg-card/70 p-4 shadow-[var(--shadow-card)]",children:[(0,l.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsx)("h3",{className:"truncate text-sm font-semibold text-foreground",children:s.title||s.name}),(0,l.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:s.author||s.category})]}),(0,l.jsx)("span",{className:"rounded-full border border-border/70 bg-background/70 px-2 py-1 text-2xs font-medium text-foreground",children:s.verified?"verified":s.transport})]}),(0,l.jsx)("p",{className:"mt-3 line-clamp-3 text-sm leading-6 text-muted-foreground",children:s.description}),(0,l.jsxs)("div",{className:"mt-3 flex flex-wrap gap-2",children:[(0,l.jsx)("span",{className:"rounded-full bg-muted/60 px-2 py-1 text-2xs text-muted-foreground",children:s.transport}),(0,l.jsx)("span",{className:"rounded-full bg-muted/60 px-2 py-1 text-2xs text-muted-foreground",children:s.category}),s.tools.length?(0,l.jsxs)("span",{className:"rounded-full bg-muted/60 px-2 py-1 text-2xs text-muted-foreground",children:[s.tools.length," tools"]}):null]})]})}function A(e){let{plugin:s}=e;return(0,l.jsxs)("div",{className:"rounded-2xl border border-border/70 bg-card/70 p-4 shadow-[var(--shadow-card)]",children:[(0,l.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsx)("h3",{className:"truncate text-sm font-semibold text-foreground",children:s.name}),(0,l.jsxs)("p",{className:"mt-1 text-xs text-muted-foreground",children:["v",s.version]})]}),(0,l.jsx)("span",{className:"rounded-full border border-border/70 bg-background/70 px-2 py-1 text-2xs font-medium text-foreground",children:s.enabled?"enabled":"installed"})]}),(0,l.jsx)("p",{className:"mt-3 line-clamp-3 text-sm leading-6 text-muted-foreground",children:s.description}),(0,l.jsxs)("div",{className:"mt-3 flex flex-wrap gap-2",children:[(0,l.jsx)("span",{className:"rounded-full bg-muted/60 px-2 py-1 text-2xs text-muted-foreground",children:s.source}),s.providedTools.length?(0,l.jsxs)("span",{className:"rounded-full bg-muted/60 px-2 py-1 text-2xs text-muted-foreground",children:[s.providedTools.length," tools"]}):null,s.providedHooks.length?(0,l.jsxs)("span",{className:"rounded-full bg-muted/60 px-2 py-1 text-2xs text-muted-foreground",children:[s.providedHooks.length," hooks"]}):null]})]})}function L(){var e,s,t,f,L,O,E,F,M;let[I,T]=(0,r.useState)("skills"),[K,Q]=(0,r.useState)("discover"),[R,J]=(0,r.useState)(""),[_,D]=(0,r.useState)(""),z=(0,r.useRef)(null);(0,r.useEffect)(()=>(z.current&&clearTimeout(z.current),z.current=setTimeout(()=>{D(R.trim())},300),()=>{z.current&&clearTimeout(z.current)}),[R]);let H=_.length>0,U=(0,g.I)({queryKey:["marketplace-search",_],queryFn:()=>b(_),enabled:_.trim().length>0}),W=(0,j.vb)(),$=(0,y.J)(),B=(0,v.qw)(),G=(0,r.useMemo)(()=>{var e,s;return(null!=(s=null==(e=W.data)?void 0:e.skills)?s:[]).slice(0,3)},[null==(e=W.data)?void 0:e.skills]),V=(0,r.useMemo)(()=>{var e,s;return(null!=(s=null==(e=$.data)?void 0:e.servers)?s:[]).filter(e=>e.verified).slice(0,3)},[null==(s=$.data)?void 0:s.servers]),X=(0,r.useMemo)(()=>{var e;return(null!=(e=B.data)?e:[]).slice(0,3)},[B.data]),Y=null!=(O=S.find(e=>e.id===I))?O:S[0];return(0,l.jsxs)("div",{className:"h-full space-y-5 overflow-y-auto p-4 pb-8 lg:p-6 lg:pb-10",children:[(0,l.jsx)("section",{className:"rounded-3xl border border-border/70 bg-[linear-gradient(135deg,rgba(7,52,85,0.14),rgba(9,70,104,0.08),rgba(233,200,25,0.08))] p-5 shadow-[var(--shadow-elevated)] lg:p-6",children:(0,l.jsxs)("div",{className:"flex flex-col gap-5 lg:flex-row lg:items-end lg:justify-between",children:[(0,l.jsxs)("div",{className:"max-w-3xl",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"flex h-11 w-11 items-center justify-center rounded-2xl bg-primary/12 text-primary",children:(0,l.jsx)(d.A,{className:"h-5 w-5"})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-xs font-semibold uppercase tracking-label text-muted-foreground",children:"Marketplace"}),(0,l.jsx)("h1",{className:"text-2xl font-semibold text-foreground",children:"Discover what to add next"})]})]}),(0,l.jsx)("p",{className:"mt-4 text-sm leading-6 text-muted-foreground",children:"Browse skills, MCP servers, and plugins from one place. Use the search bar for the full marketplace, then switch into a section only when you want local filters and deeper inventory controls."})]}),(0,l.jsxs)("div",{className:"grid gap-3 sm:grid-cols-3 lg:min-w-[420px]",children:[(0,l.jsx)(P,{icon:n.A,eyebrow:"Skills",title:"Reusable know-how",description:"Install proven procedures, references, and templates for recurring work.",meta:"".concat(null!=(E=null==(t=W.data)?void 0:t.skills.length)?E:0," discoverable now"),onOpen:()=>{Q("discover"),T("skills")}}),(0,l.jsx)(P,{icon:a.A,eyebrow:"MCP servers",title:"Live tools",description:"Connect external systems and tool surfaces through the MCP ecosystem.",meta:"".concat(null!=(F=null==(f=$.data)?void 0:f.servers.length)?F:0," listed right now"),onOpen:()=>{Q("discover"),T("mcp-servers")}}),(0,l.jsx)(P,{icon:i.A,eyebrow:"Plugins",title:"Agent extensions",description:"Add custom tool bundles, hooks, and runtime integrations when you need them.",meta:"".concat(null!=(M=null==(L=B.data)?void 0:L.length)?M:0," installed in this workspace"),onOpen:()=>{Q("installed"),T("plugins")}})]})]})}),(0,l.jsxs)("section",{className:"space-y-3 rounded-2xl border border-border/70 bg-card/60 p-4 shadow-[var(--shadow-card)]",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-xs font-semibold uppercase tracking-label text-muted-foreground",children:"Marketplace search"}),(0,l.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:"This searches across skills, MCP servers, and plugins. Any extra search controls below only filter the current section."})]}),(0,l.jsxs)("div",{className:"relative max-w-2xl",children:[(0,l.jsx)(o.A,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),(0,l.jsx)("input",{type:"text",placeholder:"Search the full marketplace catalog…",value:R,onChange:e=>J(e.target.value),className:"w-full rounded-xl border border-border/70 bg-background/80 py-2.5 pl-9 pr-9 text-sm outline-none placeholder:text-muted-foreground focus:ring-2 focus:ring-primary/30"}),R?(0,l.jsx)("button",{type:"button",onClick:()=>J(""),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:(0,l.jsx)(c.A,{className:"h-4 w-4"})}):null]})]}),H?(0,l.jsxs)("section",{className:"space-y-6",children:[(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,l.jsx)("span",{className:"rounded-full bg-primary/10 px-3 py-1 text-xs font-medium text-primary",children:"Searching across the marketplace"}),(0,l.jsxs)("span",{className:"text-sm text-muted-foreground",children:["Results for “",_,"” are grouped by type so discovery and inventory do not blur together."]})]}),U.isLoading?(0,l.jsx)(p.O,{}):null,U.isError?(0,l.jsx)(h.W5,{title:"Search failed",error:U.error,description:"We could not load marketplace results right now. Try again in a moment."}):null,U.data&&0===U.data.total?(0,l.jsx)(h.pp,{title:"No marketplace results",description:(0,l.jsxs)(l.Fragment,{children:["No results found for “",_,"”. Try a broader term or clear the marketplace search."]})}):null,U.data&&U.data.skills.length>0?(0,l.jsxs)("div",{className:"space-y-3",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(n.A,{className:"h-4 w-4 text-primary"}),(0,l.jsx)("h2",{className:"text-sm font-semibold text-foreground",children:"Skills"}),(0,l.jsx)("span",{className:"rounded-full bg-muted/60 px-2 py-0.5 text-2xs text-muted-foreground",children:U.data.skills.length})]}),(0,l.jsx)("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:U.data.skills.map(e=>(0,l.jsx)(q,{skill:e},e.id))})]}):null,U.data&&U.data.mcpServers.length>0?(0,l.jsxs)("div",{className:"space-y-3",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(a.A,{className:"h-4 w-4 text-primary"}),(0,l.jsx)("h2",{className:"text-sm font-semibold text-foreground",children:"MCP servers"}),(0,l.jsx)("span",{className:"rounded-full bg-muted/60 px-2 py-0.5 text-2xs text-muted-foreground",children:U.data.mcpServers.length})]}),(0,l.jsx)("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:U.data.mcpServers.map(e=>(0,l.jsx)(C,{server:e},e.id))})]}):null,U.data&&U.data.plugins.length>0?(0,l.jsxs)("div",{className:"space-y-3",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(i.A,{className:"h-4 w-4 text-primary"}),(0,l.jsx)("h2",{className:"text-sm font-semibold text-foreground",children:"Plugins"}),(0,l.jsx)("span",{className:"rounded-full bg-muted/60 px-2 py-0.5 text-2xs text-muted-foreground",children:U.data.plugins.length})]}),(0,l.jsx)("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:U.data.plugins.map(e=>(0,l.jsx)(A,{plugin:e},e.id))})]}):null]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("section",{className:"flex flex-wrap items-center gap-2",children:[(0,l.jsxs)("button",{type:"button",onClick:()=>Q("discover"),className:(0,x.cn)("inline-flex items-center gap-2 rounded-2xl px-4 py-2 text-sm font-medium transition","discover"===K?"bg-primary text-primary-foreground shadow-sm":"border border-border/70 text-muted-foreground hover:bg-card"),children:[(0,l.jsx)(u.A,{className:"h-4 w-4"}),"Discover"]}),(0,l.jsxs)("button",{type:"button",onClick:()=>Q("installed"),className:(0,x.cn)("inline-flex items-center gap-2 rounded-2xl px-4 py-2 text-sm font-medium transition","installed"===K?"bg-primary text-primary-foreground shadow-sm":"border border-border/70 text-muted-foreground hover:bg-card"),children:[(0,l.jsx)(m.A,{className:"h-4 w-4"}),"Installed inventory"]})]}),"discover"===K?(0,l.jsxs)("div",{className:"space-y-6",children:[(0,l.jsxs)("section",{className:"grid gap-6 xl:grid-cols-3",children:[(0,l.jsxs)("div",{className:"space-y-3 xl:col-span-2",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(n.A,{className:"h-4 w-4 text-primary"}),(0,l.jsx)("h2",{className:"text-sm font-semibold text-foreground",children:"Featured skills"})]}),(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:"Start with reusable instructions and references before you reach for lower-level wiring."}),W.isLoading?(0,l.jsx)(p.O,{}):null,!W.isLoading&&G.length?(0,l.jsx)("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:G.map(e=>(0,l.jsx)(q,{skill:e},e.id))}):null]}),(0,l.jsxs)("div",{className:"space-y-3",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(i.A,{className:"h-4 w-4 text-primary"}),(0,l.jsx)("h2",{className:"text-sm font-semibold text-foreground",children:"Plugin posture"})]}),(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:"Plugins are the most opinionated extensions. Keep them secondary to discovery, but visible when you need deeper customization."}),X.length?(0,l.jsx)("div",{className:"space-y-4",children:X.map(e=>(0,l.jsx)(A,{plugin:e},e.id))}):(0,l.jsx)(h.pp,{title:"No plugins installed yet",description:"Use plugins when you need custom tool bundles, lifecycle hooks, or repo-based extensions. They stay secondary to skills and MCP discovery by design."})]})]}),(0,l.jsxs)("section",{className:"space-y-3",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(a.A,{className:"h-4 w-4 text-primary"}),(0,l.jsx)("h2",{className:"text-sm font-semibold text-foreground",children:"Recommended MCP servers"})]}),(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:"These cards surface trust, transport, and tool scope before you dive into the full catalog."}),$.isLoading?(0,l.jsx)(p.O,{}):null,!$.isLoading&&V.length?(0,l.jsx)("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:V.map(e=>(0,l.jsx)(C,{server:e},e.id))}):null]})]}):null,(0,l.jsxs)("section",{className:"space-y-4 rounded-2xl border border-border/70 bg-card/60 p-4 shadow-[var(--shadow-card)]",children:[(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:S.map(e=>{let{id:s,label:t,icon:r}=e;return(0,l.jsxs)("button",{type:"button",onClick:()=>T(s),className:(0,x.cn)("inline-flex items-center gap-1.5 rounded-2xl px-4 py-2 text-sm font-medium transition",I===s?"bg-primary text-primary-foreground shadow-sm":"border border-border/70 text-muted-foreground hover:bg-card"),children:[(0,l.jsx)(r,{className:"h-3.5 w-3.5"}),t]},s)})}),(0,l.jsxs)("p",{className:"text-sm text-muted-foreground",children:["discover"===K?Y.discoverLabel:Y.inventoryLabel," Local controls below only affect this section."]})]}),(0,l.jsxs)(r.Suspense,{fallback:(0,l.jsx)(p.O,{}),children:["skills"===I?(0,l.jsx)(w,{}):null,"mcp-servers"===I?(0,l.jsx)(N,{}):null,"plugins"===I?(0,l.jsx)(k,{}):null]})]})]})]})}},3842:(e,s,t)=>{"use strict";t.d(s,{A:()=>l});let l=(0,t(1847).A)("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]])},5971:(e,s,t)=>{Promise.resolve().then(t.bind(t,1935)),Promise.resolve().then(t.bind(t,9136)),Promise.resolve().then(t.bind(t,6981)),Promise.resolve().then(t.bind(t,1339))},9318:(e,s,t)=>{"use strict";t.d(s,{$P:()=>g,F8:()=>p,I3:()=>u,Pt:()=>o,Qc:()=>f,a$:()=>d,aO:()=>m,b_:()=>x,hL:()=>h,jM:()=>y,vb:()=>b});var l=t(2454),r=t(9776),n=t(549),a=t(9678),i=t(9054);function d(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];return(0,l.I)({queryKey:["skills",e],queryFn:()=>(0,a.n)("/api/skills".concat(e?"?installed=true":"")),select:e=>(0,i.iF)(e.skills)})}function o(e){return(0,l.I)({queryKey:["skill",e],queryFn:()=>(0,a.n)("/api/skills/".concat(e)),select:e=>(0,i.d)(e.skill),enabled:!!e})}function c(e,s){let t=(0,i.d)(s);e.invalidateQueries({queryKey:["skills"]}),e.setQueryData(["skill",t.id],{skill:t})}function u(){let e=(0,r.jE)();return(0,n.n)({mutationFn:e=>(0,a.n)("/api/skills/".concat(e,"/install"),{method:"POST"}),onSuccess:s=>{let{skill:t}=s;return c(e,t)}})}function m(){let e=(0,r.jE)();return(0,n.n)({mutationFn:e=>{let{skillId:s,enabled:t}=e;return(0,a.n)("/api/skills/".concat(s,"/enable"),{method:"POST",body:JSON.stringify({enabled:t})})},onSuccess:s=>{let{skill:t}=s;return c(e,t)}})}function x(){let e=(0,r.jE)();return(0,n.n)({mutationFn:e=>{let{skillId:s,content:t}=e;return(0,a.n)("/api/skills/".concat(s),{method:"PATCH",body:JSON.stringify({content:t})})},onSuccess:s=>{let{skill:t}=s;return c(e,t)}})}function p(){let e=(0,r.jE)();return(0,n.n)({mutationFn:e=>{let{skillId:s,sessionId:t}=e;return(0,a.n)("/api/skills/".concat(s,"/load"),{method:"POST",body:JSON.stringify({sessionId:t})})},onSuccess:(s,t)=>{let{skill:l}=s;c(e,l),e.setQueryData(["session",t.sessionId],e=>{var s;if(!(null==e?void 0:e.session))return e;let l=null!=(s=e.session.loadedSkillIds)?s:[];return{...e,session:{...e.session,loadedSkillIds:l.includes(t.skillId)?l:[t.skillId,...l]}}}),e.invalidateQueries({queryKey:["session",t.sessionId]})}})}function h(){let e=(0,r.jE)();return(0,n.n)({mutationFn:e=>(0,a.n)("/api/skills/".concat(e),{method:"DELETE"}),onSuccess:s=>{let{skill:t}=s;return c(e,t)}})}function g(){return(0,l.I)({queryKey:["skill-categories"],queryFn:()=>(0,a.n)("/api/skills/categories"),select:e=>e.categories})}function f(e,s){return(0,l.I)({queryKey:["skill-file",e,s],queryFn:()=>(0,a.n)("/api/skills/".concat(e,"/files?path=").concat(encodeURIComponent(s))),enabled:!!(e&&s)})}function b(e){let s=e?"?q=".concat(encodeURIComponent(e)):"";return(0,l.I)({queryKey:["hub-skills",null!=e?e:""],queryFn:()=>(0,a.n)("/api/skills/hub".concat(s))})}function y(){let e=(0,r.jE)();return(0,n.n)({mutationFn:e=>{let{identifier:s,category:t,force:l}=e;return(0,a.n)("/api/skills/hub/install",{method:"POST",body:JSON.stringify({identifier:s,category:t,force:l})})},onSuccess:()=>{e.invalidateQueries({queryKey:["skills"]}),e.invalidateQueries({queryKey:["hub-skills"]}),e.invalidateQueries({queryKey:["skill-categories"]})}})}}},e=>{e.O(0,[2231,1635,4879,5097,2433,8441,1255,7358],()=>e(e.s=5971)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3140,8153],{140:(e,s,t)=>{Promise.resolve().then(t.bind(t,1935)),Promise.resolve().then(t.bind(t,9136)),Promise.resolve().then(t.bind(t,6981)),Promise.resolve().then(t.bind(t,3140))},962:(e,s,t)=>{"use strict";t.d(s,{Ho:()=>o,P4:()=>c,c$:()=>i,qw:()=>d});var n=t(2454),r=t(9776),l=t(549),a=t(9678);function d(){return(0,n.I)({queryKey:["plugins"],queryFn:()=>(0,a.n)("/api/plugins"),select:e=>e.plugins})}function i(){let e=(0,r.jE)();return(0,l.n)({mutationFn:e=>(0,a.n)("/api/plugins/install",{method:"POST",body:JSON.stringify(e)}),onSuccess:()=>{e.invalidateQueries({queryKey:["plugins"]})}})}function o(){let e=(0,r.jE)();return(0,l.n)({mutationFn:e=>(0,a.n)("/api/plugins/".concat(e),{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:["plugins"]})}})}function c(){let e=(0,r.jE)();return(0,l.n)({mutationFn:e=>{let{id:s,enabled:t}=e;return(0,a.n)("/api/plugins/".concat(s,"/enable"),{method:"POST",body:JSON.stringify({enabled:t})})},onSuccess:()=>{e.invalidateQueries({queryKey:["plugins"]})}})}},2056:(e,s,t)=>{"use strict";t.d(s,{A:()=>n});let n=(0,t(1847).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},2932:(e,s,t)=>{"use strict";t.d(s,{eS:()=>u,pp:()=>c,W5:()=>m,Gu:()=>o});var n=t(5155),r=t(5299);let l=(0,t(1847).A)("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);var a=t(2056),d=t(4269);function i(e){return"banner"===e?"rounded-xl border border-border/60 bg-card/50 p-4 shadow-[var(--shadow-card)]":"rounded-2xl border border-border/60 bg-card/55 p-6 shadow-[var(--shadow-card)]"}function o(e){var s;let{title:t,message:l,description:a,layout:o="card",className:c,children:u}=e,m=null!=(s=null!=t?t:l)?s:"Loading…";return(0,n.jsxs)("div",{className:(0,d.cn)(i(o),c),children:[(0,n.jsxs)("div",{className:"flex items-start gap-3",children:[(0,n.jsx)(r.A,{className:"mt-0.5 h-4 w-4 animate-spin text-primary"}),(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("p",{className:"font-semibold text-foreground",children:m}),a?(0,n.jsx)("div",{className:"mt-1 text-sm leading-6 text-muted-foreground",children:a}):null]})]}),u?(0,n.jsx)("div",{className:"mt-4",children:u}):null]})}function c(e){let{title:s,description:t,icon:r,primaryAction:a,secondaryAction:o,action:c,layout:u="card",className:m}=e,x=null!=a?a:c;return(0,n.jsx)("div",{className:(0,d.cn)(i(u),"border-dashed",m),children:(0,n.jsxs)("div",{className:"flex items-start gap-3",children:[(0,n.jsx)("div",{className:"mt-0.5 text-primary",children:null!=r?r:(0,n.jsx)(l,{className:"h-4 w-4"})}),(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("p",{className:"font-semibold text-foreground",children:s}),(0,n.jsx)("div",{className:"mt-1 text-sm leading-6 text-muted-foreground",children:t}),x||o?(0,n.jsxs)("div",{className:"mt-4 flex flex-wrap gap-2",children:[x,o]}):null]})]})})}function u(e){let{title:s,description:t,severity:r="warning",icon:l,details:o,primaryAction:c,secondaryAction:u,layout:m="card",className:x}=e;return(0,n.jsx)("div",{className:(0,d.cn)(i(m),"danger"===r?"border-danger/35 bg-danger/10":"border-warning/35 bg-warning/10",x),children:(0,n.jsxs)("div",{className:"flex items-start gap-3",children:[(0,n.jsx)("div",{className:(0,d.cn)("mt-0.5","danger"===r?"text-danger":"text-warning"),children:null!=l?l:(0,n.jsx)(a.A,{className:"h-4 w-4"})}),(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("p",{className:"font-semibold text-foreground",children:s}),(0,n.jsx)("div",{className:"mt-1 text-sm leading-6 text-muted-foreground",children:t}),o?(0,n.jsx)("div",{className:"mt-2 text-xs leading-5 text-muted-foreground",children:o}):null,c||u?(0,n.jsxs)("div",{className:"mt-4 flex flex-wrap gap-2",children:[c,u]}):null]})]})})}function m(e){let{title:s="Something went wrong",error:t,message:r,description:l,primaryAction:o,secondaryAction:c,layout:u="card",className:m}=e,x=null!=r?r:t,p="string"==typeof x?x:x instanceof Error?x.message:null;return(0,n.jsx)("div",{className:(0,d.cn)(i(u),"border-danger/35 bg-danger/10",m),children:(0,n.jsxs)("div",{className:"flex items-start gap-3",children:[(0,n.jsx)(a.A,{className:"mt-0.5 h-4 w-4 text-danger"}),(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("p",{className:"font-semibold text-foreground",children:s}),l?(0,n.jsx)("div",{className:"mt-1 text-sm leading-6 text-muted-foreground",children:l}):null,p?(0,n.jsx)("p",{className:"mt-1 text-sm leading-6 text-foreground",children:p}):null,o||c?(0,n.jsxs)("div",{className:"mt-4 flex flex-wrap gap-2",children:[o,c]}):null]})]})})}},3140:(e,s,t)=>{"use strict";t.r(s),t.d(s,{PluginsScreen:()=>f});var n=t(5155),r=t(2115),l=t(8599),a=t(2932),d=t(962),i=t(1847);let o=(0,i.A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);var c=t(4269);let u={user:"bg-blue-500/15 text-blue-400",builtin:"bg-emerald-500/15 text-emerald-400",pip:"bg-amber-500/15 text-amber-400"};function m(e){let{plugin:s,onToggle:t,onRemove:r}=e;return(0,n.jsxs)("div",{className:"rounded-2xl border border-border bg-card p-5 shadow-sm",children:[(0,n.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("h3",{className:"truncate text-lg font-semibold",children:s.name}),(0,n.jsxs)("span",{className:"shrink-0 rounded-full bg-muted/70 px-2 py-0.5 text-2xs text-muted-foreground",children:["v",s.version]})]}),s.author&&(0,n.jsxs)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:["by ",s.author]})]}),(0,n.jsx)("span",{className:(0,c.cn)("shrink-0 rounded-full px-2 py-0.5 text-2xs font-medium",u[s.source]),children:s.source})]}),s.description&&(0,n.jsx)("p",{className:"mt-3 text-sm leading-relaxed text-muted-foreground",children:s.description}),s.providedTools.length>0&&(0,n.jsxs)("div",{className:"mt-3",children:[(0,n.jsx)("p",{className:"text-2xs font-medium uppercase tracking-label text-muted-foreground",children:"Tools"}),(0,n.jsx)("div",{className:"mt-1 flex flex-wrap gap-1",children:s.providedTools.map(e=>(0,n.jsx)("span",{className:"rounded-md bg-muted/50 px-1.5 py-0.5 text-2xs text-muted-foreground",children:e},e))})]}),s.providedHooks.length>0&&(0,n.jsxs)("div",{className:"mt-2",children:[(0,n.jsx)("p",{className:"text-2xs font-medium uppercase tracking-label text-muted-foreground",children:"Hooks"}),(0,n.jsx)("div",{className:"mt-1 flex flex-wrap gap-1",children:s.providedHooks.map(e=>(0,n.jsx)("span",{className:"rounded-md bg-muted/50 px-1.5 py-0.5 text-2xs text-muted-foreground",children:e},e))})]}),(0,n.jsxs)("div",{className:"mt-4 flex items-center justify-between border-t border-border/70 pt-4",children:[(0,n.jsxs)("label",{className:"flex cursor-pointer items-center gap-2",children:[(0,n.jsx)("button",{type:"button",role:"switch","aria-checked":s.enabled,onClick:()=>t(s.id,!s.enabled),className:(0,c.cn)("relative inline-flex h-5 w-9 shrink-0 items-center rounded-full transition-colors",s.enabled?"bg-primary":"bg-muted"),children:(0,n.jsx)("span",{className:(0,c.cn)("pointer-events-none block h-4 w-4 rounded-full bg-white shadow-sm transition-transform",s.enabled?"translate-x-[18px]":"translate-x-0.5")})}),(0,n.jsx)("span",{className:"text-sm text-muted-foreground",children:s.enabled?"Enabled":"Disabled"})]}),"user"===s.source&&r&&(0,n.jsxs)("button",{type:"button",onClick:()=>r(s.id),className:"flex items-center gap-1.5 rounded-lg border border-danger/30 bg-danger/10 px-2.5 py-1.5 text-xs text-danger transition hover:bg-danger/20",children:[(0,n.jsx)(o,{className:"h-3.5 w-3.5"}),"Remove"]})]})]})}let x=(0,i.A)("Package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7",key:"yx3hmr"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);var p=t(5299);let g=/^[a-zA-Z0-9][a-zA-Z0-9._-]*\/[a-zA-Z0-9._-]+$/;function h(e){let{open:s,onClose:t}=e,[l,a]=(0,r.useState)(""),[i,o]=(0,r.useState)(null),c=(0,d.c$)();if(!s)return null;let u=g.test(l);async function m(){if(!l.trim())return void o("Repository is required.");if(!u)return void o("Invalid format. Use owner/repo (for example nousresearch/hermes-plugin-web).");o(null);try{await c.mutateAsync({identifier:l.trim()}),a(""),o(null),t()}catch(e){o(function(e){let s=e.toLowerCase();return s.includes("plugin.yaml")?"This repository cloned successfully, but it is not a valid Hermes plugin yet. A valid plugin repo must include a plugin.yaml manifest.":s.includes("__init__.py")?"This repository is missing the required __init__.py plugin entrypoint, so Pan cannot treat it as a real plugin.":s.includes("already exists")||s.includes("already installed")?"That plugin is already installed in this workspace.":e}(e instanceof Error?e.message:String(e)))}}return(0,n.jsx)("div",{className:"fixed inset-0 z-30 flex items-center justify-center bg-black/50 p-4",children:(0,n.jsxs)("div",{className:"w-full max-w-md rounded-2xl border border-border bg-background p-5 shadow-xl",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(x,{className:"h-5 w-5 text-primary"}),(0,n.jsx)("h3",{className:"text-lg font-semibold",children:"Install plugin"})]}),(0,n.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:"Install a repo-based plugin when you need custom hooks or tool bundles beyond MCP servers and built-in integrations."}),(0,n.jsxs)("div",{className:"mt-4 rounded-xl border border-border/70 bg-card/60 p-3 text-sm text-muted-foreground",children:[(0,n.jsx)("p",{className:"font-medium text-foreground",children:"What counts as a valid plugin repo?"}),(0,n.jsxs)("ul",{className:"mt-2 list-disc space-y-1 pl-5 text-xs leading-5",children:[(0,n.jsxs)("li",{children:["Use the GitHub format ",(0,n.jsx)("span",{className:"font-medium text-foreground",children:"owner/repo"}),"."]}),(0,n.jsxs)("li",{children:["The repository must contain a ",(0,n.jsx)("span",{className:"font-medium text-foreground",children:"plugin.yaml"})," manifest."]}),(0,n.jsxs)("li",{children:["The repository must also include the required ",(0,n.jsx)("span",{className:"font-medium text-foreground",children:"__init__.py"})," entrypoint."]})]})]}),(0,n.jsxs)("div",{className:"mt-4",children:[(0,n.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:"GitHub repository"}),(0,n.jsx)("input",{value:l,onChange:e=>{a(e.target.value),o(null)},placeholder:"owner/repo",className:"mt-1 w-full rounded-lg border bg-background px-3 py-2 text-sm outline-none placeholder:text-muted-foreground/50 focus:border-primary/50 ".concat(i?"border-red-500/70":"border-input"),autoFocus:!0,onKeyDown:e=>{"Enter"===e.key&&m()}}),!l||u||i?null:(0,n.jsx)("p",{className:"mt-1 text-xs text-amber-400",children:"Format: owner/repo (for example nousresearch/hermes-plugin-web)"}),l||i?null:(0,n.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:"Pan validates the repo before counting the install as successful."})]}),i?(0,n.jsx)("div",{className:"mt-3 rounded-lg border border-red-500/30 bg-red-500/10 px-3 py-2 text-sm text-red-400",children:i}):null,c.isSuccess?(0,n.jsx)("div",{className:"mt-3 rounded-lg border border-emerald-500/30 bg-emerald-500/10 px-3 py-2 text-sm text-emerald-400",children:"Plugin installed successfully."}):null,(0,n.jsxs)("div",{className:"mt-5 flex justify-end gap-2",children:[(0,n.jsx)("button",{type:"button",onClick:function(){a(""),o(null),c.reset(),t()},className:"rounded-lg border border-border px-4 py-2 text-sm",children:"Cancel"}),(0,n.jsxs)("button",{type:"button",onClick:()=>void m(),disabled:c.isPending||!l.trim()||!u,className:"flex items-center gap-2 rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground disabled:opacity-50",children:[c.isPending?(0,n.jsx)(p.A,{className:"h-4 w-4 animate-spin"}):null,c.isPending?"Installing…":"Install plugin"]})]})]})})}function f(){var e;let s=(0,d.qw)(),t=(0,d.P4)(),i=(0,d.Ho)(),[o,c]=(0,r.useState)(!1),u=null!=(e=s.data)?e:[];function x(e,s){t.mutateAsync({id:e,enabled:s})}function p(e){i.mutateAsync(e)}return(0,n.jsxs)("div",{className:"h-full overflow-y-auto space-y-6 p-4 pb-8 lg:p-6 lg:pb-10",children:[(0,n.jsxs)("div",{className:"flex flex-col gap-4 md:flex-row md:items-start md:justify-between",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h1",{className:"text-2xl font-semibold",children:"Plugins"}),(0,n.jsx)("p",{className:"mt-2 max-w-3xl text-sm text-muted-foreground",children:"Plugins are repo-based extensions for custom hooks and bundled tools. Use MCP servers for live external systems, and use plugins when you need deeper runtime customization."})]}),(0,n.jsx)("button",{type:"button",onClick:()=>c(!0),className:"rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground",children:"Install plugin"})]}),(0,n.jsxs)("div",{className:"rounded-2xl border border-border/60 bg-card/55 p-4 text-sm text-muted-foreground shadow-sm",children:[(0,n.jsx)("p",{className:"font-medium text-foreground",children:"How plugins differ from integrations"}),(0,n.jsx)("p",{className:"mt-2",children:"Integrations and MCP servers focus on what the agent can reach right now. Plugins focus on adding custom hooks, packaged tools, and deeper behavior changes to the runtime."})]}),s.isLoading?(0,n.jsx)(a.Gu,{title:"Loading plugins…",description:"Reading installed plugins and their tool/hook metadata for this workspace."}):null,s.isError?(0,n.jsx)(a.W5,{title:"Could not load plugins",error:s.error,description:"Pan could not read the installed plugin inventory right now."}):null,s.isSuccess&&0===u.length?(0,n.jsx)(a.pp,{title:"No plugins installed",description:"Plugins are optional and usually come after skills and MCP servers. Install one when you need repo-based hooks, tool bundles, or runtime customization.",icon:(0,n.jsx)(l.A,{className:"h-5 w-5"}),primaryAction:(0,n.jsx)("button",{type:"button",onClick:()=>c(!0),className:"rounded-2xl bg-primary px-4 py-2 text-sm font-medium text-primary-foreground",children:"Install your first plugin"})}):null,s.isSuccess&&u.length>0?(0,n.jsx)("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:u.map(e=>(0,n.jsx)(m,{plugin:e,onToggle:x,onRemove:p},e.id))}):null,(0,n.jsx)(h,{open:o,onClose:()=>c(!1)})]})}},5299:(e,s,t)=>{"use strict";t.d(s,{A:()=>n});let n=(0,t(1847).A)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])}},e=>{e.O(0,[2231,1635,5097,8441,1255,7358],()=>e(e.s=140)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7805],{586:(e,r,s)=>{Promise.resolve().then(s.bind(s,1935)),Promise.resolve().then(s.bind(s,9136)),Promise.resolve().then(s.bind(s,6981)),Promise.resolve().then(s.bind(s,3111))},2056:(e,r,s)=>{"use strict";s.d(r,{A:()=>n});let n=(0,s(1847).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},2932:(e,r,s)=>{"use strict";s.d(r,{eS:()=>m,pp:()=>c,W5:()=>x,Gu:()=>i});var n=s(5155),t=s(5299);let d=(0,s(1847).A)("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);var a=s(2056),l=s(4269);function o(e){return"banner"===e?"rounded-xl border border-border/60 bg-card/50 p-4 shadow-[var(--shadow-card)]":"rounded-2xl border border-border/60 bg-card/55 p-6 shadow-[var(--shadow-card)]"}function i(e){var r;let{title:s,message:d,description:a,layout:i="card",className:c,children:m}=e,x=null!=(r=null!=s?s:d)?r:"Loading…";return(0,n.jsxs)("div",{className:(0,l.cn)(o(i),c),children:[(0,n.jsxs)("div",{className:"flex items-start gap-3",children:[(0,n.jsx)(t.A,{className:"mt-0.5 h-4 w-4 animate-spin text-primary"}),(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("p",{className:"font-semibold text-foreground",children:x}),a?(0,n.jsx)("div",{className:"mt-1 text-sm leading-6 text-muted-foreground",children:a}):null]})]}),m?(0,n.jsx)("div",{className:"mt-4",children:m}):null]})}function c(e){let{title:r,description:s,icon:t,primaryAction:a,secondaryAction:i,action:c,layout:m="card",className:x}=e,u=null!=a?a:c;return(0,n.jsx)("div",{className:(0,l.cn)(o(m),"border-dashed",x),children:(0,n.jsxs)("div",{className:"flex items-start gap-3",children:[(0,n.jsx)("div",{className:"mt-0.5 text-primary",children:null!=t?t:(0,n.jsx)(d,{className:"h-4 w-4"})}),(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("p",{className:"font-semibold text-foreground",children:r}),(0,n.jsx)("div",{className:"mt-1 text-sm leading-6 text-muted-foreground",children:s}),u||i?(0,n.jsxs)("div",{className:"mt-4 flex flex-wrap gap-2",children:[u,i]}):null]})]})})}function m(e){let{title:r,description:s,severity:t="warning",icon:d,details:i,primaryAction:c,secondaryAction:m,layout:x="card",className:u}=e;return(0,n.jsx)("div",{className:(0,l.cn)(o(x),"danger"===t?"border-danger/35 bg-danger/10":"border-warning/35 bg-warning/10",u),children:(0,n.jsxs)("div",{className:"flex items-start gap-3",children:[(0,n.jsx)("div",{className:(0,l.cn)("mt-0.5","danger"===t?"text-danger":"text-warning"),children:null!=d?d:(0,n.jsx)(a.A,{className:"h-4 w-4"})}),(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("p",{className:"font-semibold text-foreground",children:r}),(0,n.jsx)("div",{className:"mt-1 text-sm leading-6 text-muted-foreground",children:s}),i?(0,n.jsx)("div",{className:"mt-2 text-xs leading-5 text-muted-foreground",children:i}):null,c||m?(0,n.jsxs)("div",{className:"mt-4 flex flex-wrap gap-2",children:[c,m]}):null]})]})})}function x(e){let{title:r="Something went wrong",error:s,message:t,description:d,primaryAction:i,secondaryAction:c,layout:m="card",className:x}=e,u=null!=t?t:s,p="string"==typeof u?u:u instanceof Error?u.message:null;return(0,n.jsx)("div",{className:(0,l.cn)(o(m),"border-danger/35 bg-danger/10",x),children:(0,n.jsxs)("div",{className:"flex items-start gap-3",children:[(0,n.jsx)(a.A,{className:"mt-0.5 h-4 w-4 text-danger"}),(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("p",{className:"font-semibold text-foreground",children:r}),d?(0,n.jsx)("div",{className:"mt-1 text-sm leading-6 text-muted-foreground",children:d}):null,p?(0,n.jsx)("p",{className:"mt-1 text-sm leading-6 text-foreground",children:p}):null,i||c?(0,n.jsxs)("div",{className:"mt-4 flex flex-wrap gap-2",children:[i,c]}):null]})]})})}},3111:(e,r,s)=>{"use strict";s.d(r,{RuntimeHealthPanel:()=>c});var n=s(5155),t=s(2115),d=s(2932),a=s(2454),l=s(9678),o=s(2604);function i(){let{activeSessionId:e}=(0,o.j)(),[r,s]=(0,t.useState)(""),[d,i]=(0,t.useState)(""),c=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return(0,a.I)({queryKey:["runtime-export",e,r,s],queryFn:()=>(0,l.n)("/api/runtime/export?sessionId=".concat(encodeURIComponent(e||""),"&query=").concat(encodeURIComponent(r),"&status=").concat(encodeURIComponent(s))),enabled:!!e})}(e,r,d),m=(0,t.useMemo)(()=>{var e;return JSON.stringify(null!=(e=c.data)?e:{},null,2)},[c.data]);return(0,n.jsxs)("section",{className:"rounded-2xl border border-border bg-card p-5 shadow-sm",children:[(0,n.jsx)("h2",{className:"text-lg font-semibold",children:"Runtime exports"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:"Filter and export runtime timeline, artifacts, approvals, and telemetry for the active session."}),(0,n.jsxs)("div",{className:"mt-4 grid gap-3 md:grid-cols-2",children:[(0,n.jsx)("input",{value:r,onChange:e=>s(e.target.value),placeholder:"Filter query",className:"rounded-lg border border-input bg-background px-3 py-2 text-sm"}),(0,n.jsxs)("select",{value:d,onChange:e=>i(e.target.value),className:"rounded-lg border border-input bg-background px-3 py-2 text-sm",children:[(0,n.jsx)("option",{value:"",children:"All approval states"}),(0,n.jsx)("option",{value:"pending",children:"Pending"}),(0,n.jsx)("option",{value:"approved",children:"Approved"}),(0,n.jsx)("option",{value:"rejected",children:"Rejected"})]})]}),(0,n.jsxs)("div",{className:"mt-4 flex gap-2",children:[(0,n.jsx)("a",{href:"data:application/json;charset=utf-8,".concat(encodeURIComponent(m)),download:"runtime-export-".concat(e||"global",".json"),className:"rounded-lg border border-border px-4 py-2 text-sm",children:"Download JSON"}),(0,n.jsx)("a",{href:"/api/runtime/export?sessionId=".concat(encodeURIComponent(e||""),"&query=").concat(encodeURIComponent(r),"&status=").concat(encodeURIComponent(d),"&format=csv"),className:"rounded-lg border border-border px-4 py-2 text-sm",children:"Download CSV"})]}),(0,n.jsx)("pre",{className:"mt-4 overflow-x-auto rounded-xl border border-border bg-background p-4 text-xs text-muted-foreground",children:m})]})}function c(){let[e,r]=(0,t.useState)(""),s=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(0,a.I)({queryKey:["runtime-health",e],queryFn:()=>(0,l.n)("/api/runtime/health?query=".concat(encodeURIComponent(e)))})}(e);if(s.isLoading)return(0,n.jsx)(d.Gu,{message:"Running health diagnostics…"});let o=s.data;return o?(0,n.jsxs)("div",{className:"space-y-6 p-4 lg:p-6",children:[(0,n.jsxs)("section",{className:"rounded-2xl border border-border bg-card p-5 shadow-sm",children:[(0,n.jsxs)("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h2",{className:"text-lg font-semibold",children:"Runtime health"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:"Configuration, provider, MCP, profile context, memory files, and runtime diagnostics."})]}),(0,n.jsxs)("div",{className:"grid gap-3 text-sm sm:grid-cols-2",children:[(0,n.jsx)("div",{className:"rounded-xl border border-border bg-background px-4 py-3",children:(0,n.jsxs)("p",{children:[(0,n.jsx)("strong",{children:"Passing:"})," ",o.summary.okCount]})}),(0,n.jsx)("div",{className:"rounded-xl border border-border bg-background px-4 py-3",children:(0,n.jsxs)("p",{children:[(0,n.jsx)("strong",{children:"Needs attention:"})," ",o.summary.failingCount]})})]})]}),(0,n.jsx)("input",{value:e,onChange:e=>r(e.target.value),placeholder:"Filter checks",className:"mt-4 w-full rounded-lg border border-input bg-background px-3 py-2 text-sm"}),(0,n.jsx)("div",{className:"mt-4 grid gap-3 md:grid-cols-2",children:o.checks.map(e=>(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-background p-4 text-sm",children:[(0,n.jsx)("p",{className:"font-medium",children:e.key}),(0,n.jsx)("p",{className:"mt-1 text-muted-foreground",children:e.detail}),(0,n.jsxs)("p",{className:"mt-2 text-xs",children:["Status: ",e.ok?"ok":"needs attention"]}),e.remediation?(0,n.jsxs)("p",{className:"mt-2 text-xs text-muted-foreground",children:["Hint: ",e.remediation]}):null]},e.key))}),(0,n.jsx)("pre",{className:"mt-4 overflow-x-auto rounded-xl border border-border bg-background p-4 text-xs text-muted-foreground",children:o.doctorOutput})]}),(0,n.jsx)(i,{})]}):null}},5299:(e,r,s)=>{"use strict";s.d(r,{A:()=>n});let n=(0,s(1847).A)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])}},e=>{e.O(0,[2231,1635,5097,8441,1255,7358],()=>e(e.s=586)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4662],{492:(e,s,r)=>{"use strict";r.d(s,{$:()=>l});var t=r(2454),d=r(9678);function l(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(0,t.I)({queryKey:["audit",e],queryFn:()=>(0,d.n)("/api/audit?query=".concat(encodeURIComponent(e))),select:e=>e.events})}},2056:(e,s,r)=>{"use strict";r.d(s,{A:()=>t});let t=(0,r(1847).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},2841:(e,s,r)=>{"use strict";r.d(s,{SettingsScreen:()=>b});var t=r(5155),d=r(2619),l=r.n(d),n=r(7510),a=r(492);function i(){var e;let s=(0,a.$)();return(0,t.jsxs)("section",{className:"rounded-2xl border border-border bg-card p-5 shadow-sm",children:[(0,t.jsx)("h2",{className:"text-lg font-semibold",children:"Audit log"}),(0,t.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:"Recent approvals, config changes, and profile or memory updates."}),(0,t.jsx)("div",{className:"mt-4 space-y-3",children:(null!=(e=s.data)?e:[]).map(e=>(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-background p-4",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e.action}),(0,t.jsxs)("p",{className:"mt-1 text-xs text-muted-foreground",children:[e.targetType," \xb7 ",e.targetId," \xb7 ",new Date(e.createdAt).toLocaleString()]}),(0,t.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:e.detail})]},e.id))})]})}var o=r(9896),c=r(3804),m=r(2932),x=r(592),u=r(4269);function h(){var e,s,r,d,l,n,a,i;let o=(0,x.w)();if(o.isLoading)return(0,t.jsx)(m.Gu,{message:"Inspecting runtime…"});if(o.isError)return(0,t.jsx)(m.W5,{message:o.error.message});if(!(null==(e=o.data)?void 0:e.available))return(0,t.jsx)(m.pp,{title:"Runtime not detected",description:"Set HERMES_HOME and install the Hermes runtime to enable live chat, skill, and extension views.",action:(0,t.jsx)("button",{type:"button",onClick:()=>void o.refetch(),className:"rounded-2xl border border-border/70 bg-background/80 px-4 py-2 text-sm font-medium text-foreground",children:"Retry detection"})});let h=o.data;return(0,t.jsxs)("section",{className:"rounded-xl border border-border/70 bg-card/60 p-5 shadow-[var(--shadow-soft)]",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-3 md:flex-row md:items-start md:justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-lg font-semibold",children:"Runtime status"}),(0,t.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:"Installed runtime, profile context, API reachability, memory files, and recent persisted sessions."})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:(0,u.cn)("inline-flex items-center rounded-full border px-3 py-1 text-xs font-medium",h.apiReachable?"border-success/30 bg-success/10 text-foreground":"border-warning/30 bg-warning/10 text-foreground"),children:h.apiReachable?"API reachable":"API unavailable"}),(0,t.jsxs)("button",{type:"button",onClick:()=>void o.refetch(),className:"inline-flex items-center gap-2 rounded-2xl border border-border/70 bg-background/80 px-3 py-2 text-sm font-medium text-foreground",children:[(0,t.jsx)(c.A,{className:"h-4 w-4"}),"Refresh"]})]})]}),(0,t.jsxs)("div",{className:"mt-4 grid gap-4 md:grid-cols-2",children:[(0,t.jsxs)("div",{className:"rounded-lg border border-border/70 bg-background/80 p-4 text-sm shadow-[var(--shadow-card)]",children:[(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{children:"Version:"})," ",h.hermesVersion]}),(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{children:"Binary:"})," ",h.hermesPath]}),(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{children:"Home:"})," ",h.hermesHome]}),(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{children:"Config:"})," ",h.configPath]}),(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{children:"Profile context:"})," ",null!=(l=null==(s=h.profileContext)?void 0:s.label)?l:"n/a"]})]}),(0,t.jsxs)("div",{className:"rounded-lg border border-border/70 bg-background/80 p-4 text-sm shadow-[var(--shadow-card)]",children:[(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{children:"Default model:"})," ",null!=(n=h.modelDefault)?n:"n/a"]}),(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{children:"Provider:"})," ",null!=(a=h.provider)?a:"n/a"]}),(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{children:"Memory provider:"})," ",null!=(i=h.memoryProvider)?i:"n/a"]}),(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{children:"Memory files:"})," ",(null==(r=h.memoryFilesPresent)?void 0:r.join(", "))||"none detected"]}),(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{children:"API status:"})," ",h.apiMessage]})]})]}),(null==(d=h.remediationHints)?void 0:d.length)?(0,t.jsxs)("div",{className:"mt-4 rounded-lg border border-border/70 bg-background/80 p-4 text-sm shadow-[var(--shadow-card)]",children:[(0,t.jsx)("p",{className:"font-medium text-foreground",children:"Remediation hints"}),(0,t.jsx)("ul",{className:"mt-2 list-disc space-y-1 pl-5 text-muted-foreground",children:h.remediationHints.map(e=>(0,t.jsx)("li",{children:e},e))})]}):null]})}var p=r(2604);let g=[{href:"/settings/approvals",title:"Approvals browser",description:"Review blocked actions, reasons, and operator decisions."},{href:"/settings/runs",title:"Runs explorer",description:"Inspect durable run state, phases, artifacts, and failures."},{href:"/settings/telemetry",title:"Telemetry browser",description:"Trace client and server events for debugging and product insight."},{href:"/settings/audit",title:"Audit browser",description:"Search persistent governance and configuration changes."},{href:"/settings/health",title:"Runtime health",description:"Check runtime, provider, memory, and MCP remediation signals."},{href:"/settings/mcp-diagnostics",title:"MCP diagnostics",description:"Validate MCP servers, discovered tools, and probe failures."},{href:"/settings/artifacts",title:"Artifacts browser",description:"Browse files, plans, and outputs emitted by prior runs."}];function b(){var e,s,r,d,a,c,m,u,b,f,j,v;let{selectedProfileId:N}=(0,p.j)(),w=(0,n.Sj)(),y=(0,x.w)(),k=(0,n.Sn)(),A=null!=(m=null!=(a=(null!=(r=w.data)?r:[]).find(e=>e.id===N))?a:(null!=(d=w.data)?d:[]).find(e=>e.active))?m:(null!=(c=w.data)?c:[])[0],P=y.data;return(0,t.jsxs)("div",{className:"h-full overflow-y-auto space-y-6 p-4 lg:p-6",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("h1",{className:"text-2xl font-semibold",children:"Settings cockpit"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"Operate with explicit visibility into runtime state, policy posture, diagnostics, and durable history."})]}),(0,t.jsxs)("section",{className:"grid gap-4 lg:grid-cols-[1.2fr_0.8fr]",children:[(0,t.jsxs)("div",{className:"rounded-2xl border border-border bg-card p-5 shadow-sm",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-lg font-semibold",children:"Runtime posture"}),(0,t.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:"This panel tells you whether the runtime is live, which profile is active, and what the workspace can safely do right now."})]}),(0,t.jsxs)("div",{className:"grid gap-2 text-sm sm:grid-cols-2",children:[(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-background px-4 py-3",children:[(0,t.jsx)("p",{className:"text-xs uppercase tracking-label text-muted-foreground",children:"Connection"}),(0,t.jsx)("p",{className:"mt-2 font-semibold",children:(null==P?void 0:P.apiReachable)?"Runtime live":(null==P?void 0:P.available)?"Runtime degraded":"Runtime unavailable"})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-background px-4 py-3",children:[(0,t.jsx)("p",{className:"text-xs uppercase tracking-label text-muted-foreground",children:"Profile context"}),(0,t.jsx)("p",{className:"mt-2 font-semibold",children:null!=(b=null!=(u=null==P||null==(e=P.profileContext)?void 0:e.label)?u:null==P?void 0:P.activeProfile)?b:"Loading"})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-background px-4 py-3",children:[(0,t.jsx)("p",{className:"text-xs uppercase tracking-label text-muted-foreground",children:"MCP servers"}),(0,t.jsx)("p",{className:"mt-2 font-semibold",children:null!=(f=null==P?void 0:P.mcpServers.length)?f:0})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-background px-4 py-3",children:[(0,t.jsx)("p",{className:"text-xs uppercase tracking-label text-muted-foreground",children:"Skills indexed"}),(0,t.jsx)("p",{className:"mt-2 font-semibold",children:null!=(j=null==P?void 0:P.skillsCount)?j:0})]})]})]}),(null==P||null==(s=P.remediationHints)?void 0:s.length)?(0,t.jsxs)("div",{className:"mt-4 rounded-xl border border-warning/30 bg-warning/10 p-4 text-sm text-foreground",children:[(0,t.jsx)("p",{className:"font-medium",children:"Recommended remediation"}),(0,t.jsx)("ul",{className:"mt-2 list-disc space-y-1 pl-5 text-muted-foreground",children:P.remediationHints.slice(0,4).map(e=>(0,t.jsx)("li",{children:e},e))})]}):null]}),A?(0,t.jsxs)("section",{className:"rounded-2xl border border-border bg-card p-5 shadow-sm",children:[(0,t.jsx)("h2",{className:"text-lg font-semibold",children:"Active profile policy"}),(0,t.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:"The selected profile controls memory scope, default guardrails, and which integrations are visible across the workspace."}),(0,t.jsxs)("div",{className:"mt-4 space-y-3 text-sm text-muted-foreground",children:[(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-background px-4 py-3",children:[(0,t.jsx)("p",{className:"text-xs uppercase tracking-label text-muted-foreground",children:"Selected profile"}),(0,t.jsx)("p",{className:"mt-2 font-semibold text-foreground",children:A.name})]}),(0,t.jsx)(o.j,{value:null!=(v=A.policyPreset)?v:"safe-chat",onChange:e=>void k.mutateAsync({profileId:A.id,policyPreset:e})})]})]}):null]}),(0,t.jsxs)("section",{className:"rounded-2xl border border-border bg-card p-5 shadow-sm",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-lg font-semibold",children:"Operational browsers"}),(0,t.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:"Dedicated operator views for approvals, runs, telemetry, audit, diagnostics, and generated outputs."})]}),(0,t.jsx)(l(),{href:"/settings/health",className:"rounded-xl border border-border bg-background px-4 py-2 text-sm font-medium",children:"Open diagnostics first"})]}),(0,t.jsx)("div",{className:"mt-4 grid gap-3 md:grid-cols-2 xl:grid-cols-3",children:g.map(e=>(0,t.jsxs)(l(),{href:e.href,className:"rounded-xl border border-border bg-background p-4 transition hover:bg-muted/40",children:[(0,t.jsx)("p",{className:"text-sm font-semibold",children:e.title}),(0,t.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:e.description})]},e.href))})]}),(0,t.jsx)(h,{}),(0,t.jsx)(i,{})]})}},2932:(e,s,r)=>{"use strict";r.d(s,{eS:()=>m,pp:()=>c,W5:()=>x,Gu:()=>o});var t=r(5155),d=r(5299);let l=(0,r(1847).A)("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);var n=r(2056),a=r(4269);function i(e){return"banner"===e?"rounded-xl border border-border/60 bg-card/50 p-4 shadow-[var(--shadow-card)]":"rounded-2xl border border-border/60 bg-card/55 p-6 shadow-[var(--shadow-card)]"}function o(e){var s;let{title:r,message:l,description:n,layout:o="card",className:c,children:m}=e,x=null!=(s=null!=r?r:l)?s:"Loading…";return(0,t.jsxs)("div",{className:(0,a.cn)(i(o),c),children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)(d.A,{className:"mt-0.5 h-4 w-4 animate-spin text-primary"}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("p",{className:"font-semibold text-foreground",children:x}),n?(0,t.jsx)("div",{className:"mt-1 text-sm leading-6 text-muted-foreground",children:n}):null]})]}),m?(0,t.jsx)("div",{className:"mt-4",children:m}):null]})}function c(e){let{title:s,description:r,icon:d,primaryAction:n,secondaryAction:o,action:c,layout:m="card",className:x}=e,u=null!=n?n:c;return(0,t.jsx)("div",{className:(0,a.cn)(i(m),"border-dashed",x),children:(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"mt-0.5 text-primary",children:null!=d?d:(0,t.jsx)(l,{className:"h-4 w-4"})}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("p",{className:"font-semibold text-foreground",children:s}),(0,t.jsx)("div",{className:"mt-1 text-sm leading-6 text-muted-foreground",children:r}),u||o?(0,t.jsxs)("div",{className:"mt-4 flex flex-wrap gap-2",children:[u,o]}):null]})]})})}function m(e){let{title:s,description:r,severity:d="warning",icon:l,details:o,primaryAction:c,secondaryAction:m,layout:x="card",className:u}=e;return(0,t.jsx)("div",{className:(0,a.cn)(i(x),"danger"===d?"border-danger/35 bg-danger/10":"border-warning/35 bg-warning/10",u),children:(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:(0,a.cn)("mt-0.5","danger"===d?"text-danger":"text-warning"),children:null!=l?l:(0,t.jsx)(n.A,{className:"h-4 w-4"})}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("p",{className:"font-semibold text-foreground",children:s}),(0,t.jsx)("div",{className:"mt-1 text-sm leading-6 text-muted-foreground",children:r}),o?(0,t.jsx)("div",{className:"mt-2 text-xs leading-5 text-muted-foreground",children:o}):null,c||m?(0,t.jsxs)("div",{className:"mt-4 flex flex-wrap gap-2",children:[c,m]}):null]})]})})}function x(e){let{title:s="Something went wrong",error:r,message:d,description:l,primaryAction:o,secondaryAction:c,layout:m="card",className:x}=e,u=null!=d?d:r,h="string"==typeof u?u:u instanceof Error?u.message:null;return(0,t.jsx)("div",{className:(0,a.cn)(i(m),"border-danger/35 bg-danger/10",x),children:(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)(n.A,{className:"mt-0.5 h-4 w-4 text-danger"}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("p",{className:"font-semibold text-foreground",children:s}),l?(0,t.jsx)("div",{className:"mt-1 text-sm leading-6 text-muted-foreground",children:l}):null,h?(0,t.jsx)("p",{className:"mt-1 text-sm leading-6 text-foreground",children:h}):null,o||c?(0,t.jsxs)("div",{className:"mt-4 flex flex-wrap gap-2",children:[o,c]}):null]})]})})}},3804:(e,s,r)=>{"use strict";r.d(s,{A:()=>t});let t=(0,r(1847).A)("RefreshCcw",[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]])},5299:(e,s,r)=>{"use strict";r.d(s,{A:()=>t});let t=(0,r(1847).A)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},6116:(e,s,r)=>{Promise.resolve().then(r.bind(r,1935)),Promise.resolve().then(r.bind(r,9136)),Promise.resolve().then(r.bind(r,6981)),Promise.resolve().then(r.bind(r,2841))},9896:(e,s,r)=>{"use strict";r.d(s,{j:()=>d});var t=r(5155);function d(e){let{value:s,onChange:r}=e;return(0,t.jsxs)("select",{value:s,onChange:e=>r(e.target.value),className:"w-full rounded-lg border border-input bg-background px-3 py-2 text-sm","aria-label":"Policy preset selector",children:[(0,t.jsx)("option",{value:"safe-chat",children:"Safe Chat"}),(0,t.jsx)("option",{value:"research",children:"Research"}),(0,t.jsx)("option",{value:"builder",children:"Builder"}),(0,t.jsx)("option",{value:"full-power",children:"Full Power"})]})}}},e=>{e.O(0,[2231,1635,5097,8441,1255,7358],()=>e(e.s=6116)),_N_E=e.O()}]);
|
package/.next/static/chunks/app/skills/[id]/{page-241027df81583175.js → page-ce5077e8468bb7aa.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7809],{685:(e,t,l)=>{"use strict";function s(e,t){return"builtin"===e?"Built in for every workspace":"global"===e?"Installed for all profiles":t?"Profile scoped \xb7 ".concat(t):"Profile scoped"}function n(e){switch(e){case"built-in":return"Official";case"verified":return"Verified";case"custom":return"Community";case"local-process":return"Local";default:return e}}function r(e){switch(e){case"built-in":return"Official";case"verified":return"Verified";case"custom":return"Community";case"self-hosted":return"Self-hosted";case"local-process":return"Local process";default:return"Unknown source"}}function o(e){switch(e){case"read":case"low":return"Low risk";case"write":case"medium":return"Writes data";case"execute":return"Executes commands";case"admin":case"high":return"High privilege";default:return e}}function a(e){let t=String(null!=e?e:"unknown");return"needs-auth"===t?"Needs auth":"expired"===t?"Auth expired":"none"===t?"No auth required":"unknown"===t?"Auth unknown":"Auth connected"}function i(e){switch(e){case"enabled":return"Enabled by policy";case"blocked":return"Blocked by policy";case"approval-gated":return"Approval required";case"policy-limited":return"Policy limited";default:return"Governance unknown"}}function d(e){switch(e){case"auto":return"Auto approve";case"on-request":return"On request";case"always":return"Always ask";default:return"Policy inherited"}}function c(e){switch(e){case"global":return"Visible to every profile";case"profile":return"Visible only in this profile";case"session":return"Loaded only in the active session";default:return e}}l.d(t,{B6:()=>d,BX:()=>a,CF:()=>r,CV:()=>n,Ow:()=>i,VJ:()=>s,b:()=>o,mF:()=>c})},803:(e,t,l)=>{"use strict";l.d(t,{A:()=>s});let s=(0,l(1847).A)("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]])},1613:(e,t,l)=>{"use strict";l.d(t,{A:()=>s});let s=(0,l(1847).A)("FileCode",[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]])},3705:(e,t,l)=>{"use strict";l.d(t,{SkillDetail:()=>y});var s=l(5155),n=l(2115),r=l(2619),o=l.n(r),a=l(63),i=l(1613),d=l(9715),c=l(8734),u=l(803),p=l(7726),m=l(6288),x=l(9318);function h(e){let{skill:t,hasActiveSession:l,onInstall:n,onEnableToggle:r,onLoadIntoSession:o,onUninstall:a}=e,i="builtin"!==t.scope;return(0,s.jsxs)("div",{className:"flex flex-wrap gap-2",children:["builtin"===t.scope?(0,s.jsx)("button",{type:"button",onClick:n,className:"rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground",children:i?"Install":"Copy to profile scope"}):null,t.scope&&"builtin"===t.scope?null:(0,s.jsx)("button",{type:"button",onClick:r,className:"rounded-lg border border-border px-4 py-2 text-sm",children:t.enabled?"Disable":"Enable"}),(0,s.jsx)("button",{type:"button",onClick:o,disabled:!l,className:"rounded-lg border border-border px-4 py-2 text-sm disabled:cursor-not-allowed disabled:opacity-50",children:"Load into current session"}),"builtin"!==t.scope?(0,s.jsx)("button",{type:"button",onClick:a,className:"rounded-lg border border-border px-4 py-2 text-sm text-danger",children:"Remove local copy"}):null]})}function b(e){let{content:t,readOnly:l,targetPath:r,scopeLabel:o,onSave:a}=e,[i,d]=(0,n.useState)(t),[c,u]=(0,n.useState)(!1);(0,n.useEffect)(()=>{d(t)},[t]);let p=i!==t,m=(0,n.useMemo)(()=>i.split("\n").length,[i]);return(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-background p-3 text-xs text-muted-foreground",children:[(0,s.jsxs)("p",{children:[(0,s.jsx)("strong",{children:"Edit mode:"})," ",l?"Read-only until copied into profile scope.":"Saving writes the local SKILL.md file directly."]}),o?(0,s.jsxs)("p",{className:"mt-1",children:[(0,s.jsx)("strong",{children:"Target scope:"})," ",o]}):null,r?(0,s.jsxs)("p",{className:"mt-1 break-all",children:[(0,s.jsx)("strong",{children:"Target path:"})," ",r]}):null,(0,s.jsxs)("p",{className:"mt-1",children:[(0,s.jsx)("strong",{children:"Validation:"})," YAML frontmatter and body content are checked before save."]})]}),(0,s.jsx)("textarea",{value:i,onChange:e=>d(e.target.value),readOnly:l,className:"min-h-72 w-full rounded-2xl border border-border bg-card p-4 font-mono text-sm outline-none focus:border-primary"}),(0,s.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:[m," lines ",p?"\xb7 unsaved changes":"\xb7 no local changes"]}),(0,s.jsx)("button",{type:"button",onClick:async()=>{u(!0);try{await a(i)}finally{u(!1)}},disabled:l||!p||c,className:"rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground disabled:cursor-not-allowed disabled:opacity-50",children:c?"Saving…":"Save skill"})]})]})}var j=l(685),f=l(2604);function g(e){let{skillId:t,filePath:l}=e,n=(0,x.Qc)(t,l);return n.isLoading?(0,s.jsxs)("div",{className:"rounded-xl border border-border/70 bg-background/60 p-4 text-sm text-muted-foreground",children:["Loading ",l,"…"]}):n.error||!n.data?(0,s.jsxs)("div",{className:"rounded-xl border border-danger/30 bg-danger/5 p-4 text-sm text-muted-foreground",children:["Failed to load ",l]}):(0,s.jsxs)("div",{className:"rounded-xl border border-border/70 bg-background/60",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 border-b border-border/50 px-4 py-2 text-xs text-muted-foreground",children:[(0,s.jsx)(i.A,{className:"h-3.5 w-3.5"}),(0,s.jsx)("span",{className:"font-medium text-foreground",children:l}),(0,s.jsxs)("span",{className:"ml-auto",children:[n.data.content.split("\n").length," lines"]})]}),(0,s.jsx)("pre",{className:"max-h-[400px] overflow-auto px-4 py-3 text-xs leading-6",children:(0,s.jsx)("code",{children:n.data.content})})]})}let k={references:(0,s.jsx)(d.A,{className:"h-3.5 w-3.5"}),templates:(0,s.jsx)(c.A,{className:"h-3.5 w-3.5"}),scripts:(0,s.jsx)(u.A,{className:"h-3.5 w-3.5"}),assets:(0,s.jsx)(i.A,{className:"h-3.5 w-3.5"})};function y(e){var t,l,r,d,u,y,v;let{skillId:Y}=e,N=(0,a.useRouter)(),w=(0,a.useSearchParams)().get("session"),I=(0,x.Pt)(Y),S=(0,x.I3)(),A=(0,x.aO)(),O=(0,x.b_)(),P=(0,x.F8)(),C=(0,x.hL)(),{activeSessionId:L,setActiveSessionId:q,rememberLoadedSkillInSession:F}=(0,f.j)(),E=null!=w?w:L,[T,M]=(0,n.useState)(null);(0,n.useEffect)(()=>{w&&(w!==L&&q(w),N.replace("/skills/".concat(Y),{scroll:!1}))},[L,w,N,q,Y]);let V=(0,m.wV)(E);if(I.isLoading||!I.data)return(0,s.jsx)("div",{className:"p-4 text-sm text-muted-foreground lg:p-6",children:"Loading skill…"});let K=I.data,U=!!(null==(l=V.data)||null==(t=l.loadedSkillIds)?void 0:t.includes(K.id)),R="builtin"===K.scope,_={};for(let e of null!=(y=K.linkedFiles)?y:[])_[e.group]||(_[e.group]=[]),_[e.group].push(e);return(0,s.jsxs)("div",{className:"h-full overflow-y-auto space-y-6 p-4 lg:p-6",children:[(0,s.jsx)(o(),{href:E?"/skills?session=".concat(encodeURIComponent(E)):"/skills",className:"text-sm text-muted-foreground hover:text-foreground",children:"← Back to Skills"}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[(0,s.jsx)("span",{className:"rounded-full border border-border px-2 py-1",children:(0,j.VJ)(K.scope,K.ownerProfileId)}),(0,s.jsx)("span",{className:"rounded-full border border-border px-2 py-1",children:(0,j.CV)(K.provenance)}),(0,s.jsxs)("span",{className:"rounded-full border border-border px-2 py-1",children:["v",null!=(v=K.version)?v:"unversioned"]}),(0,s.jsx)("span",{className:"rounded-full border border-border px-2 py-1",children:K.enabled?"Enabled":"Disabled"}),U?(0,s.jsx)("span",{className:"rounded-full bg-primary/10 px-2 py-1 text-foreground",children:"Loaded in current session"}):null,K.category?(0,s.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-primary/20 bg-primary/5 px-2 py-1",children:[(0,s.jsx)(c.A,{className:"h-3 w-3"}),K.category]}):null,K.author?(0,s.jsxs)("span",{className:"rounded-full border border-border px-2 py-1",children:["by ",K.author]}):null]}),(0,s.jsx)("h1",{className:"text-2xl font-semibold",children:K.name}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:K.description}),K.tags&&K.tags.length>0?(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5",children:K.tags.map(e=>(0,s.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-lg bg-primary/8 px-2 py-1 text-xs text-muted-foreground",children:[(0,s.jsx)(p.A,{className:"h-3 w-3"}),e]},e))}):null,(0,s.jsx)(h,{skill:K,hasActiveSession:!!E,onInstall:()=>void S.mutateAsync(K.id),onEnableToggle:()=>void A.mutateAsync({skillId:K.id,enabled:!K.enabled}),onLoadIntoSession:()=>{E&&(q(E),F(E,K.id),N.replace("/skills/".concat(Y,"?session=").concat(encodeURIComponent(E),"&loadedSkill=").concat(encodeURIComponent(K.id)),{scroll:!1}),P.mutateAsync({skillId:K.id,sessionId:E}))},onUninstall:()=>void C.mutateAsync(K.id)}),E?(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Current chat session available: ",E,U?" \xb7 skill already loaded":""]}):(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Open Chat and select a session before loading a skill into it."})]}),(0,s.jsxs)("section",{className:"grid gap-4 xl:grid-cols-[1.2fr_0.8fr]",children:[(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"rounded-2xl border border-border bg-card p-5 shadow-sm",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:"Skill source"}),(0,s.jsxs)("p",{className:"mt-1 text-sm text-muted-foreground",children:["SKILL.md — ",K.content.split("\n").length," lines",K.filePath?" \xb7 ".concat(K.filePath):""]}),(0,s.jsx)("div",{className:"mt-4",children:(0,s.jsx)(b,{content:K.content,readOnly:R,targetPath:K.filePath,scopeLabel:(0,j.VJ)(K.scope,K.ownerProfileId),onSave:async e=>{await O.mutateAsync({skillId:K.id,content:e})}})})]}),Object.keys(_).length>0?(0,s.jsxs)("div",{className:"rounded-2xl border border-border bg-card p-5 shadow-sm",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:"Linked files"}),(0,s.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:"Supporting references, templates, and scripts bundled with this skill."}),(0,s.jsx)("div",{className:"mt-4 space-y-3",children:Object.entries(_).map(e=>{var t;let[l,n]=e;return(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:[null!=(t=k[l])?t:(0,s.jsx)(i.A,{className:"h-3.5 w-3.5"}),l," (",n.length,")"]}),(0,s.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:n.map(e=>(0,s.jsx)("button",{type:"button",onClick:()=>M(T===e.path?null:e.path),className:"rounded-lg border px-3 py-1.5 text-xs font-medium transition ".concat(T===e.path?"border-primary/40 bg-primary/10 text-foreground":"border-border/60 text-muted-foreground hover:bg-muted/40"),children:e.name},e.path))})]},l)})}),T?(0,s.jsx)("div",{className:"mt-4",children:(0,s.jsx)(g,{skillId:Y,filePath:T})}):null]}):null]}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("section",{className:"rounded-2xl border border-border bg-card p-5 shadow-sm",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:"Session impact"}),(0,s.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"Skills attach reusable instructions and can imply tool requirements for the current workspace."}),(0,s.jsxs)("div",{className:"mt-4 space-y-2 text-sm text-muted-foreground",children:[(0,s.jsxs)("p",{children:[(0,s.jsx)("strong",{className:"text-foreground",children:"Owner:"})," ",(0,j.VJ)(K.scope,K.ownerProfileId)]}),(0,s.jsxs)("p",{children:[(0,s.jsx)("strong",{className:"text-foreground",children:"Updated:"})," ",K.updatedAt?new Date(K.updatedAt).toLocaleString():"Unknown"]}),(0,s.jsxs)("p",{children:[(0,s.jsx)("strong",{className:"text-foreground",children:"Loaded sessions:"})," ",(null==(r=K.loadedInSessions)?void 0:r.length)?K.loadedInSessions.join(", "):"None recorded yet"]}),(null==(d=K.linkedFiles)?void 0:d.length)?(0,s.jsxs)("p",{children:[(0,s.jsx)("strong",{className:"text-foreground",children:"Linked files:"})," ",K.linkedFiles.length," (",Object.entries(_).map(e=>{let[t,l]=e;return"".concat(l.length," ").concat(t)}).join(", "),")"]}):null]})]}),(0,s.jsxs)("section",{className:"rounded-2xl border border-border bg-card p-5 shadow-sm",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:"Tool expectations"}),(0,s.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"Rendered only from available metadata. No capability assumptions are fabricated."}),(0,s.jsx)("div",{className:"mt-4 flex flex-wrap gap-2",children:((null==(u=K.impliedTools)?void 0:u.length)?K.impliedTools:["No declared tool dependencies"]).map(e=>(0,s.jsx)("span",{className:"rounded-full border border-border px-2 py-1 text-xs text-muted-foreground",children:e},e))})]}),K.relatedSkills&&K.relatedSkills.length>0?(0,s.jsxs)("section",{className:"rounded-2xl border border-border bg-card p-5 shadow-sm",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:"Related skills"}),(0,s.jsx)("div",{className:"mt-3 flex flex-wrap gap-2",children:K.relatedSkills.map(e=>(0,s.jsx)(o(),{href:"/skills/".concat(e),className:"rounded-lg border border-border/60 px-3 py-1.5 text-xs font-medium text-muted-foreground transition hover:bg-muted/40 hover:text-foreground",children:e},e))})]}):null]})]})]})}},7191:(e,t,l)=>{Promise.resolve().then(l.bind(l,1935)),Promise.resolve().then(l.bind(l,9136)),Promise.resolve().then(l.bind(l,6981)),Promise.resolve().then(l.bind(l,3705))},7726:(e,t,l)=>{"use strict";l.d(t,{A:()=>s});let s=(0,l(1847).A)("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]])},8734:(e,t,l)=>{"use strict";l.d(t,{A:()=>s});let s=(0,l(1847).A)("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]])},9054:(e,t,l)=>{"use strict";l.d(t,{HB:()=>m,C5:()=>x,d:()=>u,iF:()=>p,YM:()=>h});var s=l(4879);s.gM("type",[s.Ik({type:s.eu("assistant.delta"),delta:s.Yj()}),s.Ik({type:s.eu("run.phase"),phase:s.k5(["drafting","tool-started","waiting-approval","completed"]),label:s.Yj()}),s.Ik({type:s.eu("tool.started"),toolCallId:s.Yj(),toolName:s.Yj(),riskLevel:s.k5(["read","write","execute","admin"]).optional(),provenance:s.k5(["built-in","verified","custom","self-hosted","local-process"]).optional()}),s.Ik({type:s.eu("tool.awaiting_approval"),toolCallId:s.Yj(),toolName:s.Yj(),summary:s.Yj(),riskLevel:s.k5(["read","write","execute","admin"]).optional(),governance:s.k5(["enabled","blocked","approval-gated","policy-limited"]).optional()}),s.Ik({type:s.eu("tool.completed"),toolCallId:s.Yj(),toolName:s.Yj(),output:s.Yj().optional(),riskLevel:s.k5(["read","write","execute","admin"]).optional()}),s.Ik({type:s.eu("artifact.emitted"),artifactId:s.Yj(),artifactType:s.Yj(),label:s.Yj(),content:s.Yj().optional()}),s.Ik({type:s.eu("source.emitted"),source:s.Ik({id:s.Yj(),title:s.Yj(),href:s.Yj().optional(),snippet:s.Yj().optional(),sourceType:s.k5(["web","file","workspace","integration","unknown"]),provenance:s.k5(["built-in","verified","custom","self-hosted","local-process"]),note:s.Yj().optional(),label:s.Yj().optional()})}),s.Ik({type:s.eu("error"),message:s.Yj()})]),s.Ik({model:s.Yj(),provider:s.Yj(),policyPreset:s.k5(["safe-chat","research","builder","full-power"]),memoryMode:s.k5(["standard","minimal"])}),s.Ik({id:s.Yj(),title:s.Yj(),updatedAt:s.Yj(),preview:s.Yj().optional()});let n=s.Ik({id:s.Yj(),name:s.Yj(),description:s.Yj(),enabled:s.zM(),riskLevel:s.k5(["read","write","execute","admin"]),scope:s.k5(["global","profile","session"]),approvalPolicy:s.k5(["auto","on-request","always"]).optional(),lastUsedAt:s.Yj().optional()}),r=s.Ik({command:s.Yj().optional(),url:s.Yj().optional(),authType:s.k5(["none","api-key","oauth"]).optional(),token:s.Yj().optional()}),o=s.Ik({source:s.k5(["live","cache","persisted","failed"]),errorText:s.Yj().nullable().optional(),remediation:s.YO(s.Yj()).optional(),discoveredTools:s.ai().optional(),probedAt:s.Yj().optional()}),a=s.Ik({id:s.Yj(),name:s.Yj(),description:s.Yj(),health:s.k5(["healthy","degraded","blocked","failed"]),riskLevel:s.k5(["read","write","execute","admin"]),authState:s.k5(["connected","needs-auth","expired"]),governance:s.k5(["enabled","blocked","approval-gated","policy-limited"]),provenance:s.k5(["built-in","verified","custom","self-hosted","local-process"]),approvalPolicy:s.k5(["auto","on-request","always"]),type:s.k5(["mcp","native","builtin"]),installed:s.zM(),config:r,capabilities:s.YO(n),toolCount:s.ai(),profilesUsing:s.YO(s.Yj()),diagnostics:o.optional(),version:s.Yj().optional(),updatedAt:s.Yj().optional()}),i=s.Ik({id:s.Yj(),name:s.Yj(),sourceExtensionId:s.Yj(),sourceExtensionName:s.Yj(),category:s.k5(["mcp","builtin","native"]),riskLevel:s.k5(["read","write","execute","admin"]),enabled:s.zM(),approvalPolicy:s.k5(["auto","on-request","always"]),lastUsedAt:s.Yj().optional(),scope:s.k5(["global","profile","session"])});s.Ik({id:s.Yj(),createdAt:s.Yj(),action:s.Yj(),targetType:s.Yj(),targetId:s.Yj(),detail:s.Yj()}),s.Ik({id:s.Yj(),content:s.Yj(),updatedAt:s.Yj().optional(),scope:s.k5(["user","agent"])}),s.Ik({activeProfileId:s.Yj().nullable(),activeSessionId:s.Yj().nullable(),activeSessionTitle:s.Yj().optional(),activeSessionPreview:s.Yj().optional(),loadedSkillIds:s.YO(s.Yj()),model:s.Yj().optional(),provider:s.Yj().optional(),policyPreset:s.k5(["safe-chat","research","builder","full-power"]).optional(),memoryMode:s.k5(["standard","minimal"]).optional(),userMemory:s.YO(s.Yj()),agentMemory:s.YO(s.Yj())}),s.Ik({id:s.Yj(),name:s.Yj(),modelDefault:s.Yj().optional(),policyPreset:s.k5(["safe-chat","research","builder","full-power"]).optional(),sessionCount:s.ai().optional(),skillCount:s.ai().optional(),extensionCount:s.ai().optional(),active:s.zM().optional()}),s.Ik({id:s.Yj(),title:s.Yj(),updatedAt:s.Yj(),status:s.k5(["active","archived"]),preview:s.Yj().optional(),parentSessionId:s.Yj().optional()});let d=s.Ik({path:s.Yj(),name:s.Yj(),group:s.Yj()}),c=s.Ik({id:s.Yj(),name:s.Yj(),description:s.Yj(),source:s.k5(["bundled","local","hub","agent-created"]),scope:s.k5(["builtin","global","profile"]),provenance:s.k5(["built-in","verified","custom","local-process"]),installed:s.zM(),enabled:s.zM(),content:s.Yj(),loadedInSessions:s.YO(s.Yj()).optional(),ownerProfileId:s.Yj().nullable().optional(),filePath:s.Yj().optional(),version:s.Yj().optional(),updatedAt:s.Yj().optional(),impliedTools:s.YO(s.Yj()).optional(),category:s.Yj().optional(),tags:s.YO(s.Yj()).optional(),relatedSkills:s.YO(s.Yj()).optional(),linkedFiles:s.YO(d).optional(),author:s.Yj().optional()}),u=e=>c.parse(e),p=e=>c.array().parse(e),m=e=>a.parse(e),x=e=>a.array().parse(e),h=e=>i.array().parse(e)},9318:(e,t,l)=>{"use strict";l.d(t,{$P:()=>b,F8:()=>x,I3:()=>u,Pt:()=>d,Qc:()=>j,a$:()=>i,aO:()=>p,b_:()=>m,hL:()=>h,jM:()=>g,vb:()=>f});var s=l(2454),n=l(9776),r=l(549),o=l(9678),a=l(9054);function i(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];return(0,s.I)({queryKey:["skills",e],queryFn:()=>(0,o.n)("/api/skills".concat(e?"?installed=true":"")),select:e=>(0,a.iF)(e.skills)})}function d(e){return(0,s.I)({queryKey:["skill",e],queryFn:()=>(0,o.n)("/api/skills/".concat(e)),select:e=>(0,a.d)(e.skill),enabled:!!e})}function c(e,t){let l=(0,a.d)(t);e.invalidateQueries({queryKey:["skills"]}),e.setQueryData(["skill",l.id],{skill:l})}function u(){let e=(0,n.jE)();return(0,r.n)({mutationFn:e=>(0,o.n)("/api/skills/".concat(e,"/install"),{method:"POST"}),onSuccess:t=>{let{skill:l}=t;return c(e,l)}})}function p(){let e=(0,n.jE)();return(0,r.n)({mutationFn:e=>{let{skillId:t,enabled:l}=e;return(0,o.n)("/api/skills/".concat(t,"/enable"),{method:"POST",body:JSON.stringify({enabled:l})})},onSuccess:t=>{let{skill:l}=t;return c(e,l)}})}function m(){let e=(0,n.jE)();return(0,r.n)({mutationFn:e=>{let{skillId:t,content:l}=e;return(0,o.n)("/api/skills/".concat(t),{method:"PATCH",body:JSON.stringify({content:l})})},onSuccess:t=>{let{skill:l}=t;return c(e,l)}})}function x(){let e=(0,n.jE)();return(0,r.n)({mutationFn:e=>{let{skillId:t,sessionId:l}=e;return(0,o.n)("/api/skills/".concat(t,"/load"),{method:"POST",body:JSON.stringify({sessionId:l})})},onSuccess:(t,l)=>{let{skill:s}=t;c(e,s),e.setQueryData(["session",l.sessionId],e=>{var t;if(!(null==e?void 0:e.session))return e;let s=null!=(t=e.session.loadedSkillIds)?t:[];return{...e,session:{...e.session,loadedSkillIds:s.includes(l.skillId)?s:[l.skillId,...s]}}}),e.invalidateQueries({queryKey:["session",l.sessionId]})}})}function h(){let e=(0,n.jE)();return(0,r.n)({mutationFn:e=>(0,o.n)("/api/skills/".concat(e),{method:"DELETE"}),onSuccess:t=>{let{skill:l}=t;return c(e,l)}})}function b(){return(0,s.I)({queryKey:["skill-categories"],queryFn:()=>(0,o.n)("/api/skills/categories"),select:e=>e.categories})}function j(e,t){return(0,s.I)({queryKey:["skill-file",e,t],queryFn:()=>(0,o.n)("/api/skills/".concat(e,"/files?path=").concat(encodeURIComponent(t))),enabled:!!(e&&t)})}function f(e){let t=e?"?q=".concat(encodeURIComponent(e)):"";return(0,s.I)({queryKey:["hub-skills",null!=e?e:""],queryFn:()=>(0,o.n)("/api/skills/hub".concat(t))})}function g(){let e=(0,n.jE)();return(0,r.n)({mutationFn:e=>{let{identifier:t,category:l}=e;return(0,o.n)("/api/skills/hub/install",{method:"POST",body:JSON.stringify({identifier:t,category:l})})},onSuccess:()=>{e.invalidateQueries({queryKey:["skills"]}),e.invalidateQueries({queryKey:["hub-skills"]}),e.invalidateQueries({queryKey:["skill-categories"]})}})}}},e=>{e.O(0,[2231,1635,4879,5097,8441,1255,7358],()=>e(e.s=7191)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7809],{685:(e,t,l)=>{"use strict";function s(e,t){return"builtin"===e?"Built in for every workspace":"global"===e?"Installed for all profiles":t?"Profile scoped \xb7 ".concat(t):"Profile scoped"}function n(e){switch(e){case"built-in":return"Official";case"verified":return"Verified";case"custom":return"Community";case"local-process":return"Local";default:return e}}function r(e){switch(e){case"built-in":return"Official";case"verified":return"Verified";case"custom":return"Community";case"self-hosted":return"Self-hosted";case"local-process":return"Local process";default:return"Unknown source"}}function o(e){switch(e){case"read":case"low":return"Low risk";case"write":case"medium":return"Writes data";case"execute":return"Executes commands";case"admin":case"high":return"High privilege";default:return e}}function a(e){let t=String(null!=e?e:"unknown");return"needs-auth"===t?"Needs auth":"expired"===t?"Auth expired":"none"===t?"No auth required":"unknown"===t?"Auth unknown":"Auth connected"}function i(e){switch(e){case"enabled":return"Enabled by policy";case"blocked":return"Blocked by policy";case"approval-gated":return"Approval required";case"policy-limited":return"Policy limited";default:return"Governance unknown"}}function d(e){switch(e){case"auto":return"Auto approve";case"on-request":return"On request";case"always":return"Always ask";default:return"Policy inherited"}}function c(e){switch(e){case"global":return"Visible to every profile";case"profile":return"Visible only in this profile";case"session":return"Loaded only in the active session";default:return e}}l.d(t,{B6:()=>d,BX:()=>a,CF:()=>r,CV:()=>n,Ow:()=>i,VJ:()=>s,b:()=>o,mF:()=>c})},803:(e,t,l)=>{"use strict";l.d(t,{A:()=>s});let s=(0,l(1847).A)("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]])},1613:(e,t,l)=>{"use strict";l.d(t,{A:()=>s});let s=(0,l(1847).A)("FileCode",[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]])},3705:(e,t,l)=>{"use strict";l.d(t,{SkillDetail:()=>y});var s=l(5155),n=l(2115),r=l(2619),o=l.n(r),a=l(63),i=l(1613),d=l(9715),c=l(8734),u=l(803),p=l(7726),m=l(6288),x=l(9318);function h(e){let{skill:t,hasActiveSession:l,onInstall:n,onEnableToggle:r,onLoadIntoSession:o,onUninstall:a}=e,i="builtin"!==t.scope;return(0,s.jsxs)("div",{className:"flex flex-wrap gap-2",children:["builtin"===t.scope?(0,s.jsx)("button",{type:"button",onClick:n,className:"rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground",children:i?"Install":"Copy to profile scope"}):null,t.scope&&"builtin"===t.scope?null:(0,s.jsx)("button",{type:"button",onClick:r,className:"rounded-lg border border-border px-4 py-2 text-sm",children:t.enabled?"Disable":"Enable"}),(0,s.jsx)("button",{type:"button",onClick:o,disabled:!l,className:"rounded-lg border border-border px-4 py-2 text-sm disabled:cursor-not-allowed disabled:opacity-50",children:"Load into current session"}),"builtin"!==t.scope?(0,s.jsx)("button",{type:"button",onClick:a,className:"rounded-lg border border-border px-4 py-2 text-sm text-danger",children:"Remove local copy"}):null]})}function b(e){let{content:t,readOnly:l,targetPath:r,scopeLabel:o,onSave:a}=e,[i,d]=(0,n.useState)(t),[c,u]=(0,n.useState)(!1);(0,n.useEffect)(()=>{d(t)},[t]);let p=i!==t,m=(0,n.useMemo)(()=>i.split("\n").length,[i]);return(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-background p-3 text-xs text-muted-foreground",children:[(0,s.jsxs)("p",{children:[(0,s.jsx)("strong",{children:"Edit mode:"})," ",l?"Read-only until copied into profile scope.":"Saving writes the local SKILL.md file directly."]}),o?(0,s.jsxs)("p",{className:"mt-1",children:[(0,s.jsx)("strong",{children:"Target scope:"})," ",o]}):null,r?(0,s.jsxs)("p",{className:"mt-1 break-all",children:[(0,s.jsx)("strong",{children:"Target path:"})," ",r]}):null,(0,s.jsxs)("p",{className:"mt-1",children:[(0,s.jsx)("strong",{children:"Validation:"})," YAML frontmatter and body content are checked before save."]})]}),(0,s.jsx)("textarea",{value:i,onChange:e=>d(e.target.value),readOnly:l,className:"min-h-72 w-full rounded-2xl border border-border bg-card p-4 font-mono text-sm outline-none focus:border-primary"}),(0,s.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:[m," lines ",p?"\xb7 unsaved changes":"\xb7 no local changes"]}),(0,s.jsx)("button",{type:"button",onClick:async()=>{u(!0);try{await a(i)}finally{u(!1)}},disabled:l||!p||c,className:"rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground disabled:cursor-not-allowed disabled:opacity-50",children:c?"Saving…":"Save skill"})]})]})}var j=l(685),f=l(2604);function g(e){let{skillId:t,filePath:l}=e,n=(0,x.Qc)(t,l);return n.isLoading?(0,s.jsxs)("div",{className:"rounded-xl border border-border/70 bg-background/60 p-4 text-sm text-muted-foreground",children:["Loading ",l,"…"]}):n.error||!n.data?(0,s.jsxs)("div",{className:"rounded-xl border border-danger/30 bg-danger/5 p-4 text-sm text-muted-foreground",children:["Failed to load ",l]}):(0,s.jsxs)("div",{className:"rounded-xl border border-border/70 bg-background/60",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 border-b border-border/50 px-4 py-2 text-xs text-muted-foreground",children:[(0,s.jsx)(i.A,{className:"h-3.5 w-3.5"}),(0,s.jsx)("span",{className:"font-medium text-foreground",children:l}),(0,s.jsxs)("span",{className:"ml-auto",children:[n.data.content.split("\n").length," lines"]})]}),(0,s.jsx)("pre",{className:"max-h-[400px] overflow-auto px-4 py-3 text-xs leading-6",children:(0,s.jsx)("code",{children:n.data.content})})]})}let k={references:(0,s.jsx)(d.A,{className:"h-3.5 w-3.5"}),templates:(0,s.jsx)(c.A,{className:"h-3.5 w-3.5"}),scripts:(0,s.jsx)(u.A,{className:"h-3.5 w-3.5"}),assets:(0,s.jsx)(i.A,{className:"h-3.5 w-3.5"})};function y(e){var t,l,r,d,u,y,v;let{skillId:Y}=e,N=(0,a.useRouter)(),w=(0,a.useSearchParams)().get("session"),I=(0,x.Pt)(Y),S=(0,x.I3)(),A=(0,x.aO)(),O=(0,x.b_)(),P=(0,x.F8)(),C=(0,x.hL)(),{activeSessionId:L,setActiveSessionId:q,rememberLoadedSkillInSession:F}=(0,f.j)(),E=null!=w?w:L,[T,M]=(0,n.useState)(null);(0,n.useEffect)(()=>{w&&(w!==L&&q(w),N.replace("/skills/".concat(Y),{scroll:!1}))},[L,w,N,q,Y]);let V=(0,m.wV)(E);if(I.isLoading||!I.data)return(0,s.jsx)("div",{className:"p-4 text-sm text-muted-foreground lg:p-6",children:"Loading skill…"});let K=I.data,U=!!(null==(l=V.data)||null==(t=l.loadedSkillIds)?void 0:t.includes(K.id)),R="builtin"===K.scope,_={};for(let e of null!=(y=K.linkedFiles)?y:[])_[e.group]||(_[e.group]=[]),_[e.group].push(e);return(0,s.jsxs)("div",{className:"h-full overflow-y-auto space-y-6 p-4 lg:p-6",children:[(0,s.jsx)(o(),{href:E?"/skills?session=".concat(encodeURIComponent(E)):"/skills",className:"text-sm text-muted-foreground hover:text-foreground",children:"← Back to Skills"}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[(0,s.jsx)("span",{className:"rounded-full border border-border px-2 py-1",children:(0,j.VJ)(K.scope,K.ownerProfileId)}),(0,s.jsx)("span",{className:"rounded-full border border-border px-2 py-1",children:(0,j.CV)(K.provenance)}),(0,s.jsxs)("span",{className:"rounded-full border border-border px-2 py-1",children:["v",null!=(v=K.version)?v:"unversioned"]}),(0,s.jsx)("span",{className:"rounded-full border border-border px-2 py-1",children:K.enabled?"Enabled":"Disabled"}),U?(0,s.jsx)("span",{className:"rounded-full bg-primary/10 px-2 py-1 text-foreground",children:"Loaded in current session"}):null,K.category?(0,s.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-primary/20 bg-primary/5 px-2 py-1",children:[(0,s.jsx)(c.A,{className:"h-3 w-3"}),K.category]}):null,K.author?(0,s.jsxs)("span",{className:"rounded-full border border-border px-2 py-1",children:["by ",K.author]}):null]}),(0,s.jsx)("h1",{className:"text-2xl font-semibold",children:K.name}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:K.description}),K.tags&&K.tags.length>0?(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5",children:K.tags.map(e=>(0,s.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-lg bg-primary/8 px-2 py-1 text-xs text-muted-foreground",children:[(0,s.jsx)(p.A,{className:"h-3 w-3"}),e]},e))}):null,(0,s.jsx)(h,{skill:K,hasActiveSession:!!E,onInstall:()=>void S.mutateAsync(K.id),onEnableToggle:()=>void A.mutateAsync({skillId:K.id,enabled:!K.enabled}),onLoadIntoSession:()=>{E&&(q(E),F(E,K.id),N.replace("/skills/".concat(Y,"?session=").concat(encodeURIComponent(E),"&loadedSkill=").concat(encodeURIComponent(K.id)),{scroll:!1}),P.mutateAsync({skillId:K.id,sessionId:E}))},onUninstall:()=>void C.mutateAsync(K.id)}),E?(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Current chat session available: ",E,U?" \xb7 skill already loaded":""]}):(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Open Chat and select a session before loading a skill into it."})]}),(0,s.jsxs)("section",{className:"grid gap-4 xl:grid-cols-[1.2fr_0.8fr]",children:[(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"rounded-2xl border border-border bg-card p-5 shadow-sm",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:"Skill source"}),(0,s.jsxs)("p",{className:"mt-1 text-sm text-muted-foreground",children:["SKILL.md — ",K.content.split("\n").length," lines",K.filePath?" \xb7 ".concat(K.filePath):""]}),(0,s.jsx)("div",{className:"mt-4",children:(0,s.jsx)(b,{content:K.content,readOnly:R,targetPath:K.filePath,scopeLabel:(0,j.VJ)(K.scope,K.ownerProfileId),onSave:async e=>{await O.mutateAsync({skillId:K.id,content:e})}})})]}),Object.keys(_).length>0?(0,s.jsxs)("div",{className:"rounded-2xl border border-border bg-card p-5 shadow-sm",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:"Linked files"}),(0,s.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:"Supporting references, templates, and scripts bundled with this skill."}),(0,s.jsx)("div",{className:"mt-4 space-y-3",children:Object.entries(_).map(e=>{var t;let[l,n]=e;return(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:[null!=(t=k[l])?t:(0,s.jsx)(i.A,{className:"h-3.5 w-3.5"}),l," (",n.length,")"]}),(0,s.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:n.map(e=>(0,s.jsx)("button",{type:"button",onClick:()=>M(T===e.path?null:e.path),className:"rounded-lg border px-3 py-1.5 text-xs font-medium transition ".concat(T===e.path?"border-primary/40 bg-primary/10 text-foreground":"border-border/60 text-muted-foreground hover:bg-muted/40"),children:e.name},e.path))})]},l)})}),T?(0,s.jsx)("div",{className:"mt-4",children:(0,s.jsx)(g,{skillId:Y,filePath:T})}):null]}):null]}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("section",{className:"rounded-2xl border border-border bg-card p-5 shadow-sm",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:"Session impact"}),(0,s.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"Skills attach reusable instructions and can imply tool requirements for the current workspace."}),(0,s.jsxs)("div",{className:"mt-4 space-y-2 text-sm text-muted-foreground",children:[(0,s.jsxs)("p",{children:[(0,s.jsx)("strong",{className:"text-foreground",children:"Owner:"})," ",(0,j.VJ)(K.scope,K.ownerProfileId)]}),(0,s.jsxs)("p",{children:[(0,s.jsx)("strong",{className:"text-foreground",children:"Updated:"})," ",K.updatedAt?new Date(K.updatedAt).toLocaleString():"Unknown"]}),(0,s.jsxs)("p",{children:[(0,s.jsx)("strong",{className:"text-foreground",children:"Loaded sessions:"})," ",(null==(r=K.loadedInSessions)?void 0:r.length)?K.loadedInSessions.join(", "):"None recorded yet"]}),(null==(d=K.linkedFiles)?void 0:d.length)?(0,s.jsxs)("p",{children:[(0,s.jsx)("strong",{className:"text-foreground",children:"Linked files:"})," ",K.linkedFiles.length," (",Object.entries(_).map(e=>{let[t,l]=e;return"".concat(l.length," ").concat(t)}).join(", "),")"]}):null]})]}),(0,s.jsxs)("section",{className:"rounded-2xl border border-border bg-card p-5 shadow-sm",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:"Tool expectations"}),(0,s.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"Rendered only from available metadata. No capability assumptions are fabricated."}),(0,s.jsx)("div",{className:"mt-4 flex flex-wrap gap-2",children:((null==(u=K.impliedTools)?void 0:u.length)?K.impliedTools:["No declared tool dependencies"]).map(e=>(0,s.jsx)("span",{className:"rounded-full border border-border px-2 py-1 text-xs text-muted-foreground",children:e},e))})]}),K.relatedSkills&&K.relatedSkills.length>0?(0,s.jsxs)("section",{className:"rounded-2xl border border-border bg-card p-5 shadow-sm",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:"Related skills"}),(0,s.jsx)("div",{className:"mt-3 flex flex-wrap gap-2",children:K.relatedSkills.map(e=>(0,s.jsx)(o(),{href:"/skills/".concat(e),className:"rounded-lg border border-border/60 px-3 py-1.5 text-xs font-medium text-muted-foreground transition hover:bg-muted/40 hover:text-foreground",children:e},e))})]}):null]})]})]})}},7191:(e,t,l)=>{Promise.resolve().then(l.bind(l,1935)),Promise.resolve().then(l.bind(l,9136)),Promise.resolve().then(l.bind(l,6981)),Promise.resolve().then(l.bind(l,3705))},7726:(e,t,l)=>{"use strict";l.d(t,{A:()=>s});let s=(0,l(1847).A)("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]])},8734:(e,t,l)=>{"use strict";l.d(t,{A:()=>s});let s=(0,l(1847).A)("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]])},9054:(e,t,l)=>{"use strict";l.d(t,{HB:()=>m,C5:()=>x,d:()=>u,iF:()=>p,YM:()=>h});var s=l(4879);s.gM("type",[s.Ik({type:s.eu("assistant.delta"),delta:s.Yj()}),s.Ik({type:s.eu("run.phase"),phase:s.k5(["drafting","tool-started","waiting-approval","completed"]),label:s.Yj()}),s.Ik({type:s.eu("tool.started"),toolCallId:s.Yj(),toolName:s.Yj(),riskLevel:s.k5(["read","write","execute","admin"]).optional(),provenance:s.k5(["built-in","verified","custom","self-hosted","local-process"]).optional()}),s.Ik({type:s.eu("tool.awaiting_approval"),toolCallId:s.Yj(),toolName:s.Yj(),summary:s.Yj(),riskLevel:s.k5(["read","write","execute","admin"]).optional(),governance:s.k5(["enabled","blocked","approval-gated","policy-limited"]).optional()}),s.Ik({type:s.eu("tool.completed"),toolCallId:s.Yj(),toolName:s.Yj(),output:s.Yj().optional(),riskLevel:s.k5(["read","write","execute","admin"]).optional()}),s.Ik({type:s.eu("artifact.emitted"),artifactId:s.Yj(),artifactType:s.Yj(),label:s.Yj(),content:s.Yj().optional()}),s.Ik({type:s.eu("source.emitted"),source:s.Ik({id:s.Yj(),title:s.Yj(),href:s.Yj().optional(),snippet:s.Yj().optional(),sourceType:s.k5(["web","file","workspace","integration","unknown"]),provenance:s.k5(["built-in","verified","custom","self-hosted","local-process"]),note:s.Yj().optional(),label:s.Yj().optional()})}),s.Ik({type:s.eu("error"),message:s.Yj()})]),s.Ik({model:s.Yj(),provider:s.Yj(),policyPreset:s.k5(["safe-chat","research","builder","full-power"]),memoryMode:s.k5(["standard","minimal"])}),s.Ik({id:s.Yj(),title:s.Yj(),updatedAt:s.Yj(),preview:s.Yj().optional()});let n=s.Ik({id:s.Yj(),name:s.Yj(),description:s.Yj(),enabled:s.zM(),riskLevel:s.k5(["read","write","execute","admin"]),scope:s.k5(["global","profile","session"]),approvalPolicy:s.k5(["auto","on-request","always"]).optional(),lastUsedAt:s.Yj().optional()}),r=s.Ik({command:s.Yj().optional(),url:s.Yj().optional(),authType:s.k5(["none","api-key","oauth"]).optional(),token:s.Yj().optional()}),o=s.Ik({source:s.k5(["live","cache","persisted","failed"]),errorText:s.Yj().nullable().optional(),remediation:s.YO(s.Yj()).optional(),discoveredTools:s.ai().optional(),probedAt:s.Yj().optional()}),a=s.Ik({id:s.Yj(),name:s.Yj(),description:s.Yj(),health:s.k5(["healthy","degraded","blocked","failed"]),riskLevel:s.k5(["read","write","execute","admin"]),authState:s.k5(["connected","needs-auth","expired"]),governance:s.k5(["enabled","blocked","approval-gated","policy-limited"]),provenance:s.k5(["built-in","verified","custom","self-hosted","local-process"]),approvalPolicy:s.k5(["auto","on-request","always"]),type:s.k5(["mcp","native","builtin"]),installed:s.zM(),config:r,capabilities:s.YO(n),toolCount:s.ai(),profilesUsing:s.YO(s.Yj()),diagnostics:o.optional(),version:s.Yj().optional(),updatedAt:s.Yj().optional()}),i=s.Ik({id:s.Yj(),name:s.Yj(),sourceExtensionId:s.Yj(),sourceExtensionName:s.Yj(),category:s.k5(["mcp","builtin","native"]),riskLevel:s.k5(["read","write","execute","admin"]),enabled:s.zM(),approvalPolicy:s.k5(["auto","on-request","always"]),lastUsedAt:s.Yj().optional(),scope:s.k5(["global","profile","session"])});s.Ik({id:s.Yj(),createdAt:s.Yj(),action:s.Yj(),targetType:s.Yj(),targetId:s.Yj(),detail:s.Yj()}),s.Ik({id:s.Yj(),content:s.Yj(),updatedAt:s.Yj().optional(),scope:s.k5(["user","agent"])}),s.Ik({activeProfileId:s.Yj().nullable(),activeSessionId:s.Yj().nullable(),activeSessionTitle:s.Yj().optional(),activeSessionPreview:s.Yj().optional(),loadedSkillIds:s.YO(s.Yj()),model:s.Yj().optional(),provider:s.Yj().optional(),policyPreset:s.k5(["safe-chat","research","builder","full-power"]).optional(),memoryMode:s.k5(["standard","minimal"]).optional(),userMemory:s.YO(s.Yj()),agentMemory:s.YO(s.Yj())}),s.Ik({id:s.Yj(),name:s.Yj(),modelDefault:s.Yj().optional(),policyPreset:s.k5(["safe-chat","research","builder","full-power"]).optional(),sessionCount:s.ai().optional(),skillCount:s.ai().optional(),extensionCount:s.ai().optional(),active:s.zM().optional()}),s.Ik({id:s.Yj(),title:s.Yj(),updatedAt:s.Yj(),status:s.k5(["active","archived"]),preview:s.Yj().optional(),parentSessionId:s.Yj().optional()});let d=s.Ik({path:s.Yj(),name:s.Yj(),group:s.Yj()}),c=s.Ik({id:s.Yj(),name:s.Yj(),description:s.Yj(),source:s.k5(["bundled","local","hub","agent-created"]),scope:s.k5(["builtin","global","profile"]),provenance:s.k5(["built-in","verified","custom","local-process"]),installed:s.zM(),enabled:s.zM(),content:s.Yj(),loadedInSessions:s.YO(s.Yj()).optional(),ownerProfileId:s.Yj().nullable().optional(),filePath:s.Yj().optional(),version:s.Yj().optional(),updatedAt:s.Yj().optional(),impliedTools:s.YO(s.Yj()).optional(),category:s.Yj().optional(),tags:s.YO(s.Yj()).optional(),relatedSkills:s.YO(s.Yj()).optional(),linkedFiles:s.YO(d).optional(),author:s.Yj().optional()}),u=e=>c.parse(e),p=e=>c.array().parse(e),m=e=>a.parse(e),x=e=>a.array().parse(e),h=e=>i.array().parse(e)},9318:(e,t,l)=>{"use strict";l.d(t,{$P:()=>b,F8:()=>x,I3:()=>u,Pt:()=>d,Qc:()=>j,a$:()=>i,aO:()=>p,b_:()=>m,hL:()=>h,jM:()=>g,vb:()=>f});var s=l(2454),n=l(9776),r=l(549),o=l(9678),a=l(9054);function i(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];return(0,s.I)({queryKey:["skills",e],queryFn:()=>(0,o.n)("/api/skills".concat(e?"?installed=true":"")),select:e=>(0,a.iF)(e.skills)})}function d(e){return(0,s.I)({queryKey:["skill",e],queryFn:()=>(0,o.n)("/api/skills/".concat(e)),select:e=>(0,a.d)(e.skill),enabled:!!e})}function c(e,t){let l=(0,a.d)(t);e.invalidateQueries({queryKey:["skills"]}),e.setQueryData(["skill",l.id],{skill:l})}function u(){let e=(0,n.jE)();return(0,r.n)({mutationFn:e=>(0,o.n)("/api/skills/".concat(e,"/install"),{method:"POST"}),onSuccess:t=>{let{skill:l}=t;return c(e,l)}})}function p(){let e=(0,n.jE)();return(0,r.n)({mutationFn:e=>{let{skillId:t,enabled:l}=e;return(0,o.n)("/api/skills/".concat(t,"/enable"),{method:"POST",body:JSON.stringify({enabled:l})})},onSuccess:t=>{let{skill:l}=t;return c(e,l)}})}function m(){let e=(0,n.jE)();return(0,r.n)({mutationFn:e=>{let{skillId:t,content:l}=e;return(0,o.n)("/api/skills/".concat(t),{method:"PATCH",body:JSON.stringify({content:l})})},onSuccess:t=>{let{skill:l}=t;return c(e,l)}})}function x(){let e=(0,n.jE)();return(0,r.n)({mutationFn:e=>{let{skillId:t,sessionId:l}=e;return(0,o.n)("/api/skills/".concat(t,"/load"),{method:"POST",body:JSON.stringify({sessionId:l})})},onSuccess:(t,l)=>{let{skill:s}=t;c(e,s),e.setQueryData(["session",l.sessionId],e=>{var t;if(!(null==e?void 0:e.session))return e;let s=null!=(t=e.session.loadedSkillIds)?t:[];return{...e,session:{...e.session,loadedSkillIds:s.includes(l.skillId)?s:[l.skillId,...s]}}}),e.invalidateQueries({queryKey:["session",l.sessionId]})}})}function h(){let e=(0,n.jE)();return(0,r.n)({mutationFn:e=>(0,o.n)("/api/skills/".concat(e),{method:"DELETE"}),onSuccess:t=>{let{skill:l}=t;return c(e,l)}})}function b(){return(0,s.I)({queryKey:["skill-categories"],queryFn:()=>(0,o.n)("/api/skills/categories"),select:e=>e.categories})}function j(e,t){return(0,s.I)({queryKey:["skill-file",e,t],queryFn:()=>(0,o.n)("/api/skills/".concat(e,"/files?path=").concat(encodeURIComponent(t))),enabled:!!(e&&t)})}function f(e){let t=e?"?q=".concat(encodeURIComponent(e)):"";return(0,s.I)({queryKey:["hub-skills",null!=e?e:""],queryFn:()=>(0,o.n)("/api/skills/hub".concat(t))})}function g(){let e=(0,n.jE)();return(0,r.n)({mutationFn:e=>{let{identifier:t,category:l,force:s}=e;return(0,o.n)("/api/skills/hub/install",{method:"POST",body:JSON.stringify({identifier:t,category:l,force:s})})},onSuccess:()=>{e.invalidateQueries({queryKey:["skills"]}),e.invalidateQueries({queryKey:["hub-skills"]}),e.invalidateQueries({queryKey:["skill-categories"]})}})}}},e=>{e.O(0,[2231,1635,4879,5097,8441,1255,7358],()=>e(e.s=7191)),_N_E=e.O()}]);
|