@nextclaw/ui 0.12.25 → 0.12.27
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/CHANGELOG.md +74 -0
- package/dist/assets/{channels-list-page-FJDuPwU6.js → channels-list-page-DkPvpAqc.js} +1 -1
- package/dist/assets/chat-page-b7Zf32fF.js +1 -0
- package/dist/assets/{desktop-kk7qvZ-v.js → desktop-DVUbOWbR.js} +1 -1
- package/dist/assets/index-DmWo8dX2.css +1 -0
- package/dist/assets/{index-D-AAMKCt.js → index-DqJ3CYwi.js} +34 -37
- package/dist/assets/marketplace-page-BVqFjnEB.js +105 -0
- package/dist/assets/marketplace-page-DkQ2hTs1.js +1 -0
- package/dist/assets/{mcp-marketplace-page-DIq_SpMe.js → mcp-marketplace-page-BOYJO0kp.js} +1 -1
- package/dist/assets/mcp-marketplace-page-DSML7NN0.js +1 -0
- package/dist/assets/{model-config-Bc6VVnxy.js → model-config-Bg2yycmn.js} +1 -1
- package/dist/assets/{providers-list-DN0tvISH.js → providers-list-DC1q3fvC.js} +1 -1
- package/dist/assets/{runtime-config-page-CRWOwBbl.js → runtime-config-page-q-nC0C5i.js} +1 -1
- package/dist/assets/{search-config-C4c1yZSP.js → search-config-CcKHif8O.js} +1 -1
- package/dist/assets/{secrets-config-zAF30YfO.js → secrets-config-DSg6O92a.js} +1 -1
- package/dist/assets/{use-infinite-scroll-loader-Cvz8ZteY.js → use-infinite-scroll-loader-DF2e6nQ2.js} +1 -1
- package/dist/index.html +3 -3
- package/package.json +9 -9
- package/src/features/agents/components/agents-page.test.tsx +1 -1
- package/src/features/agents/components/agents-page.tsx +1 -1
- package/src/features/chat/components/chat-session-workspace-panel.tsx +31 -45
- package/src/features/chat/components/chat-sidebar-session-item.tsx +7 -9
- package/src/features/chat/components/conversation/chat-conversation-header.test.tsx +5 -2
- package/src/features/chat/components/conversation/chat-conversation-header.tsx +2 -2
- package/src/features/chat/components/conversation/chat-conversation-panel.test.tsx +106 -78
- package/src/features/chat/components/conversation/chat-conversation-panel.tsx +172 -167
- package/src/features/chat/components/conversation/chat-input-bar.container.tsx +11 -1
- package/src/features/chat/components/conversation/session-header/chat-session-header-actions.tsx +2 -2
- package/src/features/chat/components/providers/chat-presenter.provider.tsx +2 -0
- package/src/features/chat/hooks/use-ncp-agent-runtime.test.tsx +147 -88
- package/src/features/chat/managers/ncp-chat-input.manager.test.ts +20 -0
- package/src/features/chat/managers/ncp-chat-input.manager.ts +18 -0
- package/src/features/chat/managers/ncp-chat-presenter.manager.ts +1 -0
- package/src/features/chat/pages/ncp-chat-page.tsx +4 -1
- package/src/features/chat/stores/chat-input.store.ts +3 -1
- package/src/features/chat/utils/ncp-chat-input-availability.utils.test.ts +1 -0
- package/src/features/marketplace/components/curated-shelves/marketplace-curated-scene-route.test.tsx +54 -16
- package/src/features/marketplace/components/curated-shelves/marketplace-curated-shelves.tsx +96 -24
- package/src/features/marketplace/components/marketplace-page.test.tsx +4 -0
- package/src/features/marketplace/components/marketplace-page.tsx +16 -12
- package/src/features/marketplace/hooks/use-marketplace-curated-scene-route.ts +14 -5
- package/src/platforms/desktop/components/desktop-app-shell.test.tsx +1 -0
- package/src/platforms/desktop/components/desktop-app-shell.tsx +1 -1
- package/dist/assets/chat-page-D1fMNBrT.js +0 -1
- package/dist/assets/index-DnBeV2Xm.css +0 -1
- package/dist/assets/marketplace-page-BrCLRIc4.js +0 -105
- package/dist/assets/marketplace-page-odDpPYEs.js +0 -1
- package/dist/assets/mcp-marketplace-page-CfbOBgKK.js +0 -1
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import{_ as e,m as t,p as n,r,u as i}from"./i18n-D1144VAA.js";import{A as a,At as o,D as s,E as c,Gt as l,Ht as u,Jt as d,Kt as f,Lt as p,M as m,O as h,Rt as g,Ut as _,Vt as v,Wt as y,Xt as b,an as x,en as S,in as ee,j as C,k as te,nn as w,qt as T,rn as E,tn as D,zt as O}from"./api-DGD9_Bg4.js";import{l as ne,t as re,u as ie}from"./cpu-DPPwMzoC.js";import{a as ae,c as oe,i as k,l as se,n as A,o as ce,s as le,t as ue}from"./use-infinite-scroll-loader-Cvz8ZteY.js";import{t as j}from"./createLucideIcon-DzY6wN61.js";import{n as M}from"./search-CRtQwr-h.js";import{t as N}from"./download-CMM8po31.js";import{t as P}from"./sparkles-BmgOD4nY.js";import{i as de}from"./doc-browser-context-FukQHvyo.js";import{n as fe}from"./doc-browser-CAhfnm0D.js";import{X as F,c as pe,f as I,h as L,m as R,p as z}from"./index-D-AAMKCt.js";import{t as me}from"./tabs-custom-D48zdZoc.js";function B(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}function he(e,t,n){let r=e.slice(0);return r[t]=n,r}var V=class extends x{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#p(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,D.batch(()=>{let e=this.#i,t=this.#f(this.#n);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),r=n.map(e=>e.getCurrentResult()),i=e.length!==n.length,a=n.some((t,n)=>t!==e[n]),o=i||a,s=o?!0:r.some((e,t)=>{let n=this.#t[t];return!n||!ee(e,n)});!o&&!s||(o&&(this.#l=t,this.#i=n),this.#t=r,this.hasListeners()&&(o&&(B(e,n).forEach(e=>{e.destroy()}),B(n,e).forEach(e=>{e.subscribe(t=>{this.#p(e,t)})})),this.#m()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#f(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),i=n.map(e=>e.defaultedQueryOptions.queryHash);return[r,e=>this.#d(e??r,t,i),()=>this.#u(r,n)]}#u(e,t){return t.map((n,r)=>{let i=e[r];return n.defaultedQueryOptions.notifyOnChangeProps?i:n.observer.trackResult(i,e=>{t.forEach(t=>{t.observer.trackProp(e)})})})}#d(e,t,n){if(t){let r=this.#c,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((e,t)=>e!==r[t]));return(!this.#a||this.#t!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#t,n!==void 0&&(this.#c=n),this.#a=E(this.#a,t(e))),this.#a}return e}#f(e){let t=new Map;this.#i.forEach(e=>{let n=e.options.queryHash;if(!n)return;let r=t.get(n);r?r.push(e):t.set(n,[e])});let n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash)?.shift()??new S(this.#e,r);n.push({defaultedQueryOptions:r,observer:i})}),n}#p(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=he(this.#t,n,t),this.#m())}#m(){if(this.hasListeners()){let e=this.#a,t=this.#u(this.#t,this.#l);e!==this.#d(t,this.#r?.combine)&&D.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},H=e(t(),1);function U({queries:e,...t},n){let r=b(n),i=d(),a=T(),o=H.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=i?`isRestoring`:`optimistic`,t}),[e,r,i]);o.forEach(e=>{v(e),y(e,a,r.getQueryCache().get(e.queryHash))}),f(a);let[s]=H.useState(()=>new V(r,o,t)),[c,p,m]=s.getOptimisticResult(o,t.combine),h=!i&&t.subscribed!==!1;H.useSyncExternalStore(H.useCallback(e=>h?s.subscribe(D.batchCalls(e)):w,[s,h]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),H.useEffect(()=>{s.setQueries(o,t)},[o,t,s]);let g=c.some((e,t)=>_(o[t],e))?c.flatMap((e,t)=>{let n=o[t];return n&&_(n,e)?u(n,new S(r,n),a):[]}):[];if(g.length>0)throw Promise.all(g);let x=c.find((e,t)=>{let n=o[t];return n&&l({result:e,errorResetBoundary:a,throwOnError:n.throwOnError,query:r.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(x?.error)throw x.error;return p(m())}var ge=j(`BriefcaseBusiness`,[[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M16 6V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v2`,key:`1ksdt3`}],[`path`,{d:`M22 13a18.15 18.15 0 0 1-20 0`,key:`12hx5q`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`6`,rx:`2`,key:`i6l2r4`}]]),W=j(`CircleCheck`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),_e=j(`Clock3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16.5 12`,key:`1aq6pp`}]]),ve=j(`Compass`,[[`path`,{d:`m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z`,key:`9ktpf1`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),ye=j(`Earth`,[[`path`,{d:`M21.54 15H17a2 2 0 0 0-2 2v4.54`,key:`1djwo0`}],[`path`,{d:`M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17`,key:`1tzkfa`}],[`path`,{d:`M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05`,key:`14pb5j`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),be=j(`MessagesSquare`,[[`path`,{d:`M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z`,key:`p1xzt8`}],[`path`,{d:`M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1`,key:`1cx29u`}]]),xe=j(`PenLine`,[[`path`,{d:`M12 20h9`,key:`t2du7b`}],[`path`,{d:`M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z`,key:`1ykcvy`}]]),Se=j(`PowerOff`,[[`path`,{d:`M18.36 6.64A9 9 0 0 1 20.77 15`,key:`dxknvb`}],[`path`,{d:`M6.16 6.16a9 9 0 1 0 12.68 12.68`,key:`1x7qb5`}],[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Ce=j(`Power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),we=j(`SquareTerminal`,[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]]);function G(e){return Array.from(new Set(e.map(e=>e.spec).filter(Boolean)))}function Te(e){let t=new Date().toISOString();return e.result.type===`skill`?{type:`skill`,spec:e.result.spec,id:e.request.skill??e.result.spec,label:e.request.skill??e.result.name??e.result.spec,source:`workspace`,installPath:e.request.installPath,installedAt:t}:{type:e.result.type,spec:e.result.spec,id:e.result.name??e.result.spec,label:e.result.name??e.result.spec,source:`marketplace`,origin:`marketplace`,enabled:e.request.enabled??!0,runtimeStatus:e.request.enabled===!1?`disabled`:`ready`,installedAt:t}}function K(e,t){return!!(t.spec&&e.spec===t.spec||t.id&&e.id===t.id)}function Ee(e,t){return t??{type:e,total:0,specs:[],records:[]}}function De(e){let t=Ee(e.result.type,e.view),n=Te(e),r=t.records.findIndex(e=>K(e,{id:n.id,spec:n.spec})),i=[...t.records];return r>=0?i[r]={...i[r],...n}:i.unshift(n),{...t,type:e.result.type,records:i,specs:G(i),total:i.length}}function Oe(e){let t=Ee(e.result.type,e.view);if(e.result.action===`uninstall`||e.result.action===`remove`){let n=t.records.filter(t=>!K(t,{id:e.result.id,spec:e.request.spec}));return{...t,records:n,specs:G(n),total:n.length}}let n=t.records.map(t=>K(t,{id:e.result.id,spec:e.request.spec})?e.result.action===`disable`?{...t,enabled:!1,runtimeStatus:`disabled`}:{...t,enabled:!0,runtimeStatus:`ready`}:t);return{...t,records:n,specs:G(n),total:n.length}}function ke(e){let t=se({queryKey:[`marketplace-items`,e],initialPageParam:1,queryFn:({pageParam:t})=>s({...e,page:t}),getNextPageParam:e=>e.page<e.totalPages?e.page+1:void 0,placeholderData:(t,n)=>{let r=n?.queryKey?.[1];if(!(!r||typeof r!=`object`||!r))return(`type`in r?r.type:void 0)===e.type&&Ae(r,e)?t:void 0},staleTime:15e3}),n=(0,H.useMemo)(()=>oe(t.data),[t.data]);return{...t,data:n}}function Ae(e,t){return e.q===t.q&&e.tag===t.tag&&e.scene===t.scene&&e.sort===t.sort&&e.pageSize===t.pageSize}function je(e=!0){return O({queryKey:[`marketplace-skill-scenes`],queryFn:a,enabled:e,staleTime:6e4})}function Me(e,t=!0){let n=U({queries:e.map(e=>({queryKey:[`marketplace-skill-scene-count`,e.scene],queryFn:()=>s({type:`skill`,scene:e.scene,pageSize:1}),enabled:t&&typeof e.count!=`number`,staleTime:6e4}))});return(0,H.useMemo)(()=>{let t=new Map;return e.forEach((e,r)=>{let i=typeof e.count==`number`?e.count:n[r]?.data?.total;typeof i==`number`&&t.set(e.scene,i)}),t},[n,e])}function Ne(e){return O({queryKey:[`marketplace-installed`,e],queryFn:()=>c(e),staleTime:1e4})}function Pe(){let e=b();return g({mutationFn:e=>C(e),onSuccess:(t,n)=>{e.setQueryData([`marketplace-installed`,t.type],e=>De({view:e,request:n,result:t})),e.invalidateQueries({queryKey:[`marketplace-installed`,t.type],refetchType:`inactive`}),t.type===`plugin`&&e.invalidateQueries({queryKey:[`ncp-session-types`]});let i=t.type===`plugin`?r(`marketplaceInstallSuccessPlugin`):r(`marketplaceInstallSuccessSkill`);p.success(t.message||i)},onError:e=>{p.error(e.message||r(`marketplaceInstallFailed`))}})}function Fe(){let e=b();return g({mutationFn:e=>m(e),onSuccess:(t,n)=>{e.setQueryData([`marketplace-installed`,t.type],e=>Oe({view:e,request:n,result:t})),e.invalidateQueries({queryKey:[`marketplace-installed`,t.type],refetchType:`inactive`}),t.type===`plugin`&&e.invalidateQueries({queryKey:[`ncp-session-types`]});let i=t.action===`enable`?r(`marketplaceEnableSuccess`):t.action===`disable`?r(`marketplaceDisableSuccess`):r(`marketplaceUninstallSuccess`);p.success(t.message||i)},onError:e=>{p.error(e.message||r(`marketplaceOperationFailed`))}})}function q(e){return(e??``).trim().toLowerCase()}function J(e,t){let n=q(t);return n.length>0?`${e}:${n}`:``}function Ie(e){let t=new Map;for(let n of e){let e=[n.install.spec,n.slug,n.id];for(let r of e){let e=J(n.type,r);!e||t.has(e)||t.set(e,n)}}return t}function Le(e){let t=new Map;for(let n of e){let e=[n.spec,n.id,n.label];for(let r of e){let e=J(n.type,r);!e||t.has(e)||t.set(e,n)}}return t}function Re(e,t){let n=[e.install.spec,e.slug,e.id];for(let r of n){let n=J(e.type,r);if(!n)continue;let i=t.get(n);if(i)return i}}function ze(e,t){return t.get(J(e.type,e.spec))||t.get(J(e.type,e.id))||t.get(J(e.type,e.label))}function Be(e,t,n,r){let i=q(n);if(!i)return!0;let a=k(t?.summaryI18n,t?.summary,r);return[e.id,e.spec,e.label,t?.name,t?.slug,t?.summary,a,...t?.tags??[]].map(e=>q(e)).filter(Boolean).some(e=>e.includes(i))}function Y(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}function Ve(e){let t=e.replace(/\r\n/g,`
|
|
2
|
-
`).split(`
|
|
3
|
-
`);if(t[0]?.trim()!==`---`)return e;let n=t.findIndex((e,t)=>t>0&&e.trim()===`---`);return n>0?t.slice(n+1).join(`
|
|
4
|
-
`).trim():e}function X(e){return Y(e).replace(/`([^`]+)`/g,`<code>$1</code>`).replace(/\*\*([^*]+)\*\*/g,`<strong>$1</strong>`).replace(/\[([^\]]+)\]\((https?:\/\/[^)\s]+)\)/g,`<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>`)}function He(e){return/^(#{1,4})\s+/.test(e)||/^([-*])\s+/.test(e)||/^\d+\.\s+/.test(e)||/^>\s?/.test(e)||/^```/.test(e)}function Ue(e,t,n){let r=[],i=t+1;for(;i<e.length&&!e[i]?.trim().startsWith("```");)r.push(e[i]??``),i+=1;return{html:`<div class="code-block">${n[1]?`<span class="code-language">${Y(n[1])}</span>`:``}<pre><code>${Y(r.join(`
|
|
5
|
-
`))}</code></pre></div>`,nextIndex:i+1}}function We(e,t){let n=Math.min(4,e[1]?.length??2);return{html:`<h${n}>${X(e[2]??``)}</h${n}>`,nextIndex:t+1}}function Ge(e,t,n){let r=[],i=t,a=n?/^\d+\.\s+/:/^[-*]\s+/;for(;i<e.length&&a.test(e[i]?.trim()??``);)r.push(`<li>${X((e[i]??``).trim().replace(a,``))}</li>`),i+=1;return{html:n?`<ol>${r.join(``)}</ol>`:`<ul>${r.join(``)}</ul>`,nextIndex:i}}function Ke(e,t){let n=[],r=t;for(;r<e.length&&/^>\s?/.test(e[r]?.trim()??``);)n.push((e[r]??``).trim().replace(/^>\s?/,``)),r+=1;return{html:`<blockquote>${X(n.join(` `))}</blockquote>`,nextIndex:r}}function qe(e,t){let n=[],r=t;for(;r<e.length;){let t=e[r]?.trim()??``;if(!t||He(t))break;n.push(t),r+=1}return{html:`<p>${X(n.join(` `))}</p>`,nextIndex:r}}function Je(e,t){let n=e[t]?.trim()??``,r=n.match(/^```(\S*)/);if(r)return Ue(e,t,r);let i=n.match(/^(#{1,4})\s+(.+)$/);return i?We(i,t):/^[-*]\s+/.test(n)?Ge(e,t,!1):/^\d+\.\s+/.test(n)?Ge(e,t,!0):/^>\s?/.test(n)?Ke(e,t):qe(e,t)}function Ye(e){let t=Ve(e).replace(/\r\n/g,`
|
|
6
|
-
`).split(`
|
|
7
|
-
`),n=[],r=0;for(;r<t.length;){if(!(t[r]??``).trim()){r+=1;continue}let e=Je(t,r);n.push(e.html),r=e.nextIndex}return n.join(``)}function Xe(e){return Array.isArray(e)?e.map(e=>Xe(e)).join(`, `):e&&typeof e==`object`?JSON.stringify(e):String(e??``)}function Ze(e){try{let t=JSON.parse(e);return!t||typeof t!=`object`||Array.isArray(t)?[]:Object.entries(t).map(([e,t])=>({key:e,value:Xe(t)})).filter(e=>e.value.trim().length>0)}catch{return[]}}function Qe(e){return e.replace(/\r\n/g,`
|
|
8
|
-
`).split(`
|
|
9
|
-
`).map(e=>e.match(/^([A-Za-z0-9_.-]+):\s*(.+)$/)).filter(e=>!!e).map(e=>({key:e[1]??``,value:e[2]?.replace(/^["']|["']$/g,``)??``})).filter(e=>e.key&&e.value.trim().length>0)}function $e(e){let t=Ze(e),n=t.length>0?t:Qe(e);return n.length===0?`<pre class="code">${Y(e)}</pre>`:`<dl class="metadata-list">${n.map(e=>`<div><dt>${Y(e.key)}</dt><dd>${Y(e.value)}</dd></div>`).join(``)}</dl>`}function Z(e){let{title:t,typeLabel:n,spec:r,summary:i,description:a,metadataRaw:o,contentRaw:s,sourceUrl:c,sourceLabel:l,tags:u,author:d,loading:f}=e,p=o?.trim()||`-`,m=s?.trim()||`-`,h=i?.trim(),g=a?.trim(),_=!!g&&g!==h,v=$e(p),y=Ye(m),b=`<!doctype html>
|
|
10
|
-
<html>
|
|
11
|
-
<head>
|
|
12
|
-
<meta charset="utf-8" />
|
|
13
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
14
|
-
<title>${Y(t)}</title>
|
|
15
|
-
<style>
|
|
16
|
-
:root { color-scheme: light; }
|
|
17
|
-
body { margin: 0; background: #f9f8f5; color: #2f2212; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
|
|
18
|
-
.wrap { max-width: 940px; margin: 0 auto; padding: 24px 20px 36px; }
|
|
19
|
-
.hero { border: 1px solid #f0e2c8; border-radius: 14px; background: linear-gradient(180deg, #fff9f1 0%, #ffffff 28%); padding: 18px; box-shadow: 0 1px 3px rgba(30, 20, 10, 0.05); }
|
|
20
|
-
.hero h1 { margin: 0; font-size: 22px; line-height: 1.2; letter-spacing: 0; }
|
|
21
|
-
.meta { margin-top: 7px; color: #78644d; font-size: 12px; overflow-wrap: anywhere; word-break: break-word; }
|
|
22
|
-
.summary { margin: 12px 0 0; font-size: 13px; line-height: 1.65; color: #5f5142; }
|
|
23
|
-
.grid { display: grid; grid-template-columns: minmax(220px, 0.42fr) minmax(0, 1fr); gap: 12px; margin-top: 12px; }
|
|
24
|
-
.card { border: 1px solid #eee3d1; background: #fffdf9; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 2px rgba(30, 20, 10, 0.035); }
|
|
25
|
-
.card h2 { margin: 0; padding: 11px 13px; font-size: 12px; font-weight: 650; color: #3f472f; border-bottom: 1px solid #f1e7d4; background: #fffaf2; }
|
|
26
|
-
.card .body { padding: 12px 13px; font-size: 12px; color: #4e463d; line-height: 1.65; }
|
|
27
|
-
.code { white-space: pre-wrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; line-height: 1.55; margin: 0; }
|
|
28
|
-
.metadata-list { margin: 0; }
|
|
29
|
-
.metadata-list div { display: grid; grid-template-columns: minmax(72px, 0.36fr) minmax(0, 1fr); gap: 10px; padding: 8px 0; border-bottom: 1px solid #f2eadc; }
|
|
30
|
-
.metadata-list div:last-child { border-bottom: 0; }
|
|
31
|
-
.metadata-list dt { color: #7a5a24; font-weight: 650; overflow-wrap: anywhere; }
|
|
32
|
-
.metadata-list dd { margin: 0; color: #4e463d; overflow-wrap: anywhere; }
|
|
33
|
-
.markdown { font-size: 13px; line-height: 1.68; }
|
|
34
|
-
.markdown > *:first-child { margin-top: 0; }
|
|
35
|
-
.markdown > *:last-child { margin-bottom: 0; }
|
|
36
|
-
.markdown h1, .markdown h2, .markdown h3, .markdown h4 { margin: 18px 0 8px; color: #2f2212; line-height: 1.25; letter-spacing: 0; }
|
|
37
|
-
.markdown h1 { font-size: 20px; }
|
|
38
|
-
.markdown h2 { font-size: 17px; }
|
|
39
|
-
.markdown h3 { font-size: 15px; }
|
|
40
|
-
.markdown h4 { font-size: 13px; }
|
|
41
|
-
.markdown p { margin: 10px 0; }
|
|
42
|
-
.markdown ul, .markdown ol { margin: 10px 0; padding-left: 20px; }
|
|
43
|
-
.markdown li { margin: 5px 0; }
|
|
44
|
-
.markdown blockquote { margin: 12px 0; padding: 8px 12px; border-left: 3px solid #d9b56f; border-radius: 8px; background: #fff7ea; color: #6d5841; }
|
|
45
|
-
.markdown code { border: 1px solid #eadcc6; border-radius: 5px; background: #fff7ea; padding: 1px 4px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; color: #6b4b16; }
|
|
46
|
-
.markdown a { color: #5f6b45; text-decoration: none; font-weight: 600; }
|
|
47
|
-
.markdown a:hover { text-decoration: underline; }
|
|
48
|
-
.code-block { position: relative; margin: 12px 0; overflow: hidden; border: 1px solid #eadcc6; border-radius: 10px; background: #2f2a24; }
|
|
49
|
-
.code-block pre { margin: 0; overflow-x: auto; padding: 13px; }
|
|
50
|
-
.code-block code { border: 0; border-radius: 0; background: transparent; padding: 0; color: #f7efe3; }
|
|
51
|
-
.code-language { position: absolute; right: 10px; top: 8px; color: #d8c3a0; font-size: 10px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
|
|
52
|
-
.tags { margin-top: 10px; }
|
|
53
|
-
.tag { display: inline-block; margin: 0 6px 6px 0; padding: 4px 8px; border: 1px solid #ecd9b5; border-radius: 999px; background: #fff7ea; color: #7a5a24; font-size: 11px; }
|
|
54
|
-
.source { color: #5f6b45; text-decoration: none; overflow-wrap: anywhere; word-break: break-all; }
|
|
55
|
-
.source:hover { text-decoration: underline; }
|
|
56
|
-
.skeleton { display: block; border-radius: 8px; background: linear-gradient(90deg, #f0e6d6 0%, #fffaf2 42%, #f0e6d6 78%); background-size: 220% 100%; animation: shimmer 1.35s ease-in-out infinite; }
|
|
57
|
-
.detail-skeleton .hero { padding: 18px; }
|
|
58
|
-
.sk-title { width: 52%; height: 24px; }
|
|
59
|
-
.sk-meta { width: 78%; height: 12px; margin-top: 12px; }
|
|
60
|
-
.sk-line { height: 12px; margin-top: 12px; }
|
|
61
|
-
.sk-line.short { width: 62%; }
|
|
62
|
-
.sk-line.mid { width: 82%; }
|
|
63
|
-
.sk-body { height: 220px; margin: 13px; }
|
|
64
|
-
@keyframes shimmer { 0% { background-position: 120% 0; } 100% { background-position: -120% 0; } }
|
|
65
|
-
@media (max-width: 860px) { .grid { grid-template-columns: 1fr; } }
|
|
66
|
-
</style>
|
|
67
|
-
</head>
|
|
68
|
-
<body>
|
|
69
|
-
<main class="wrap${f?` detail-skeleton`:``}"${f?` aria-busy="true"`:``}>
|
|
70
|
-
${f?`
|
|
71
|
-
<section class="hero">
|
|
72
|
-
<span class="skeleton sk-title"></span>
|
|
73
|
-
<span class="skeleton sk-meta"></span>
|
|
74
|
-
<span class="skeleton sk-line mid"></span>
|
|
75
|
-
<span class="skeleton sk-line"></span>
|
|
76
|
-
<span class="skeleton sk-line short"></span>
|
|
77
|
-
</section>
|
|
78
|
-
<section class="grid">
|
|
79
|
-
<article class="card"><span class="skeleton sk-body"></span></article>
|
|
80
|
-
<article class="card"><span class="skeleton sk-body"></span></article>
|
|
81
|
-
</section>
|
|
82
|
-
`:`
|
|
83
|
-
<section class="hero">
|
|
84
|
-
<h1>${Y(t)}</h1>
|
|
85
|
-
<div class="meta">${Y(n)} · ${Y(r)}${d?` · ${Y(d)}`:``}</div>
|
|
86
|
-
${h?`<p class="summary">${Y(h)}</p>`:``}
|
|
87
|
-
${_?`<p class="summary">${Y(g)}</p>`:``}
|
|
88
|
-
${u&&u.length>0?`<div class="tags">${u.map(e=>`<span class="tag">${Y(e)}</span>`).join(``)}</div>`:``}
|
|
89
|
-
${c?`<p class="meta" style="margin-top:12px;">${Y(l??`Source`)}: <a class="source" href="${Y(c)}" target="_blank" rel="noopener noreferrer">${Y(c)}</a></p>`:``}
|
|
90
|
-
</section>
|
|
91
|
-
|
|
92
|
-
<section class="grid">
|
|
93
|
-
<article class="card">
|
|
94
|
-
<h2>Metadata</h2>
|
|
95
|
-
<div class="body">${v}</div>
|
|
96
|
-
</article>
|
|
97
|
-
<article class="card">
|
|
98
|
-
<h2>Content</h2>
|
|
99
|
-
<div class="body markdown">${y}</div>
|
|
100
|
-
</article>
|
|
101
|
-
</section>
|
|
102
|
-
`}
|
|
103
|
-
</main>
|
|
104
|
-
</body>
|
|
105
|
-
</html>`;return`data:text/html;charset=utf-8,${encodeURIComponent(b)}`}var Q=n(),et=[`bg-amber-600`,`bg-orange-500`,`bg-yellow-600`,`bg-emerald-600`,`bg-teal-600`,`bg-cyan-600`,`bg-stone-600`,`bg-rose-500`,`bg-violet-500`];function tt(e){let{name:t,fallback:n,className:r}=e,a=t||n,o=a.substring(0,2).toUpperCase();return(0,Q.jsx)(`div`,{className:i(`flex h-10 w-10 shrink-0 items-center justify-center rounded-xl text-sm font-semibold text-white`,nt(a),r),children:o})}function nt(e){let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);return et[Math.abs(t)%et.length]}function rt({title:e,spec:t,summary:n}){return(0,Q.jsxs)(R,{delayDuration:400,children:[(0,Q.jsxs)(I,{children:[(0,Q.jsx)(L,{asChild:!0,children:(0,Q.jsx)(`div`,{className:`truncate text-[14px] font-semibold leading-tight text-gray-900`,children:e})}),(0,Q.jsx)(z,{className:`max-w-[300px] text-xs`,children:e})]}),(0,Q.jsx)(`div`,{className:`mb-1.5 mt-0.5 flex min-w-0 items-center gap-1.5`,children:t?(0,Q.jsxs)(I,{children:[(0,Q.jsx)(L,{asChild:!0,children:(0,Q.jsx)(`span`,{className:`max-w-full truncate text-[11px] font-mono text-gray-400`,children:t})}),(0,Q.jsx)(z,{className:`max-w-[300px] break-all font-mono text-xs`,children:t})]}):null}),(0,Q.jsx)(`p`,{className:`line-clamp-2 text-left text-[12px] leading-relaxed text-gray-500/90`,children:n})]})}function it(e){let{item:t,record:n,pluginRecord:a,isInstalling:o,isDisabled:s,canUninstall:c,busyAction:l,busyForRecord:u,language:d,onInstall:f,onManage:p}=e,m=!!(t&&!n||a||n&&c);return(0,Q.jsxs)(`div`,{className:i(`relative flex h-8 shrink-0 items-center justify-end`,n?`md:w-5`:`md:w-0`),children:[(0,Q.jsx)(`div`,{className:i(`hidden items-center justify-end transition-opacity duration-150 md:flex`,m&&`group-hover:opacity-0 group-focus-within:opacity-0`),children:n?(0,Q.jsx)(at,{disabled:s,language:d}):null}),(0,Q.jsxs)(`div`,{className:i(`flex w-max items-center justify-end gap-2 transition-opacity duration-150`,`opacity-100 md:pointer-events-none md:absolute md:right-0 md:opacity-0`,`md:group-hover:pointer-events-auto md:group-hover:opacity-100`,`md:group-focus-within:pointer-events-auto md:group-focus-within:opacity-100`),children:[t&&!n&&(0,Q.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),f(t)},disabled:o,className:`inline-flex h-8 items-center gap-1.5 whitespace-nowrap rounded-xl bg-primary px-3 text-xs font-medium text-white transition-colors hover:bg-primary-600 disabled:opacity-50`,children:[(0,Q.jsx)(N,{className:`h-3.5 w-3.5`}),r(o?`marketplaceInstalling`:`marketplaceInstall`)]}),a&&(0,Q.jsxs)(`button`,{disabled:u,onClick:e=>{e.stopPropagation(),p(s?`enable`:`disable`,a)},className:`inline-flex h-8 items-center gap-1.5 whitespace-nowrap rounded-xl border border-gray-200/80 bg-white px-3 text-xs font-medium text-gray-600 transition-colors hover:border-gray-300 hover:bg-gray-50 disabled:opacity-50`,children:[s?(0,Q.jsx)(Ce,{className:`h-3.5 w-3.5`}):(0,Q.jsx)(Se,{className:`h-3.5 w-3.5`}),r(l&&l!==`uninstall`?l===`enable`?`marketplaceEnabling`:`marketplaceDisabling`:s?`marketplaceEnable`:`marketplaceDisable`)]}),n&&c&&(0,Q.jsxs)(`button`,{disabled:u,onClick:e=>{e.stopPropagation(),p(`uninstall`,n)},className:`inline-flex h-8 items-center gap-1.5 whitespace-nowrap rounded-xl border border-gray-200/80 bg-white px-3 text-xs font-medium text-gray-500 transition-colors hover:border-rose-200 hover:bg-rose-50 hover:text-rose-600 disabled:opacity-50`,children:[(0,Q.jsx)(F,{className:`h-3.5 w-3.5`}),r(l===`uninstall`?`marketplaceRemoving`:`marketplaceUninstall`)]})]})]})}function at(e){let{disabled:t,language:n}=e,r=st(t?{zh:`已禁用`,en:`Disabled`}:{zh:`已安装`,en:`Installed`},n);return(0,Q.jsx)(R,{delayDuration:300,children:(0,Q.jsxs)(I,{children:[(0,Q.jsx)(L,{asChild:!0,children:(0,Q.jsx)(`span`,{"aria-label":r,className:i(`inline-flex h-5 w-5 items-center justify-center`,t?`text-gray-400`:`text-emerald-700`),children:t?(0,Q.jsx)(Se,{className:`h-4 w-4`}):(0,Q.jsx)(W,{className:`h-4 w-4`})})}),(0,Q.jsx)(z,{className:`text-xs`,children:r})]})})}function ot(e){let{item:t,record:n,language:i,installState:a,manageState:o,onOpen:s,onInstall:c,onManage:l}=e,u=A(i),d=n?.type===`plugin`?n:void 0,f=t?.name??n?.label??n?.id??n?.spec??r(`marketplaceUnknownItem`),p=k(t?.summaryI18n,t?.summary,u)||(n?r(`marketplaceInstalledLocalSummary`):``),m=t?.install.spec??n?.spec??``,h=n?.id||n?.spec,g=h?o.actionsByTarget.get(h):void 0,_=!!g,v=n?.type===`plugin`&&n.origin!==`bundled`||n?.type===`skill`&&n.source===`workspace`,y=n?n.enabled===!1||n.runtimeStatus===`disabled`:!1,b=t?.install.spec,x=typeof b==`string`&&a.installingSpecs.has(b);return(0,Q.jsxs)(`article`,{onClick:s,className:`group flex cursor-pointer items-start justify-between gap-3.5 rounded-2xl border border-gray-200/40 bg-white px-5 py-4 shadow-sm transition-all hover:border-blue-300/80 hover:shadow-md`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-1 gap-3`,children:[(0,Q.jsx)(tt,{name:f,fallback:m||r(`marketplaceTypeExtension`)}),(0,Q.jsx)(`div`,{className:`flex min-w-0 flex-1 flex-col justify-center`,children:(0,Q.jsx)(rt,{title:f,spec:m,summary:p})})]}),(0,Q.jsx)(it,{item:t,record:n,pluginRecord:d,isInstalling:x,isDisabled:y,canUninstall:v,busyAction:g,busyForRecord:_,language:i,onInstall:c,onManage:l})]})}function st(e,t){return t.startsWith(`zh`)?e.zh:e.en}function ct(e){let{scope:t,title:n,summary:r,showTitle:a,showListSkeleton:o,skeletonCardCount:s,allItems:c,installedEntries:l,installedRecordLookup:u,language:d,installState:f,manageState:p,onOpen:m,onInstall:h,onManage:g}=e;return(0,Q.jsxs)(`section`,{className:i(`flex min-h-full flex-col`,a&&`gap-3`),children:[a&&(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Q.jsx)(`h3`,{className:`text-[14px] font-semibold text-gray-950`,children:n}),(0,Q.jsx)(`span`,{className:`text-[12px] text-gray-500`,children:r})]}),(0,Q.jsxs)(`div`,{"data-testid":o?`marketplace-list-skeleton`:void 0,className:i(`grid grid-cols-1 gap-3 lg:grid-cols-2 2xl:grid-cols-3`,o&&`min-h-0 flex-1 auto-rows-[104px] content-start`),children:[o&&(0,Q.jsx)(le,{count:s}),!o&&t===`all`&&c.map(e=>(0,Q.jsx)(ot,{item:e,record:Re(e,u),language:d,installState:f,manageState:p,onOpen:()=>m(e,Re(e,u)),onInstall:h,onManage:g},e.id)),!o&&t===`installed`&&l.map(e=>(0,Q.jsx)(ot,{item:e.item,record:e.record,language:d,installState:f,manageState:p,onOpen:()=>m(e.item,e.record),onInstall:h,onManage:g},e.key))]})]})}function lt(e){let{entry:t,language:n,localeFallbacks:a,installState:o,layout:s=`rail`,onOpen:c,onInstall:l}=e,{item:u,record:d}=t,f=k(u.summaryI18n,u.summary,a),p=u.install.spec,m=o.installingSpecs.has(p),h=!!d;return(0,Q.jsxs)(`article`,{onClick:()=>c(t),className:i(`group flex min-h-[166px] cursor-pointer flex-col justify-between rounded-xl border border-gray-200/70 bg-white p-3 shadow-sm transition-colors hover:border-gray-300 hover:bg-gray-50/60`,s===`rail`?`w-[260px] shrink-0`:`w-full min-w-0`),children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`div`,{className:`mb-2.5 flex min-w-0 items-start gap-2.5`,children:[(0,Q.jsx)(tt,{name:u.name,fallback:u.install.spec}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1 pt-0.5`,children:[(0,Q.jsx)(`div`,{className:`truncate text-[13px] font-semibold leading-tight text-gray-950`,children:u.name}),(0,Q.jsx)(`div`,{className:`mt-0.5 truncate text-[11px] font-mono leading-tight text-gray-400`,children:ut(u)})]})]}),(0,Q.jsx)(`p`,{className:`line-clamp-2 text-[12px] leading-relaxed text-gray-500`,children:f}),(0,Q.jsx)(dt,{tags:u.tags})]}),(0,Q.jsxs)(`div`,{className:`mt-3 flex items-center justify-between gap-3 border-t border-gray-100 pt-2.5`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 truncate text-[11px] text-gray-400`,children:ft(u.updatedAt)}),h?(0,Q.jsxs)(`span`,{className:`inline-flex h-7 items-center gap-1.5 text-[11px] font-semibold text-emerald-700`,children:[(0,Q.jsx)(W,{className:`h-3.5 w-3.5`}),pt({zh:`已安装`,en:`Installed`},n)]}):(0,Q.jsxs)(`button`,{type:`button`,disabled:m,onClick:e=>{e.stopPropagation(),l(u)},className:`inline-flex h-7 items-center gap-1.5 rounded-md border border-gray-200 bg-white px-2 text-[11px] font-semibold text-gray-700 transition-colors hover:border-gray-300 hover:bg-gray-50 disabled:opacity-50`,children:[(0,Q.jsx)(N,{className:`h-3.5 w-3.5`}),r(m?`marketplaceInstalling`:`marketplaceInstall`)]})]})]})}function ut(e){return e.slug||e.install.spec}function dt({tags:e}){let t=e.slice(0,2);return t.length===0?null:(0,Q.jsx)(`div`,{className:`mt-2 truncate text-[11px] font-medium text-gray-400`,children:t.join(` / `)})}function ft(e){return e.slice(0,10)||e}function pt(e,t){return t.startsWith(`zh`)?e.zh:e.en}var mt=[{scene:`development-debugging`,title:{zh:`开发与调试`,en:`Development`},summary:{zh:`代码审查、错误定位、架构分析与交付验证。`,en:`Review, debug, analyze, and verify delivery work.`},icon:we,tone:`dark`,span:`md:col-span-2`},{scene:`office-collaboration`,title:{zh:`办公协作`,en:`Office Work`},summary:{zh:`连接文档、日历、会议、邮件和团队通信。`,en:`Connect docs, calendars, meetings, mail, and teams.`},icon:ge,tone:`green`,span:`md:col-span-2`},{scene:`writing-content`,title:{zh:`写作与内容`,en:`Writing`},summary:{zh:`把调研、写作、润色和发布组织成连续工作流。`,en:`Turn research, writing, polishing, and publishing into one flow.`},icon:xe,tone:`amber`,span:`md:col-span-2`},{scene:`browser-automation`,title:{zh:`浏览器自动化`,en:`Browser`},summary:{zh:`操作网页、捕获动态内容并验证真实用户路径。`,en:`Operate pages, capture dynamic content, and verify user paths.`},icon:ye,tone:`blue`,span:`md:col-span-2`},{scene:`local-environment`,title:{zh:`本地环境`,en:`Local`},summary:{zh:`管理终端、文件、运行时和本地服务。`,en:`Manage shells, files, runtimes, and local services.`},icon:re,tone:`violet`,span:`md:col-span-1`},{scene:`social-platforms`,title:{zh:`社交平台`,en:`Social`},summary:{zh:`处理发布、互动、检索和内容分发。`,en:`Handle posting, interaction, search, and distribution.`},icon:be,tone:`sky`,span:`md:col-span-1`},{scene:`nextclaw-official`,title:{zh:`NextClaw 官方`,en:`NextClaw Official`},summary:{zh:`优先查看由 NextClaw 维护的原生能力。`,en:`Browse native capabilities maintained by NextClaw.`},icon:P,tone:`teal`,span:`md:col-span-2`}],ht={icon:P,tone:`dark`,span:`md:col-span-2`},gt={dark:{card:`border-gray-200/80 bg-white text-gray-950`,icon:`border-stone-600 bg-stone-600 text-white`,title:`text-gray-950`,text:`text-gray-500`,meta:`text-gray-400`},blue:{card:`border-gray-200/80 bg-white text-gray-950`,icon:`border-cyan-600 bg-cyan-600 text-white`,title:`text-gray-950`,text:`text-gray-500`,meta:`text-gray-400`},green:{card:`border-gray-200/80 bg-white text-gray-950`,icon:`border-emerald-600 bg-emerald-600 text-white`,title:`text-gray-950`,text:`text-gray-500`,meta:`text-gray-400`},amber:{card:`border-gray-200/80 bg-white text-gray-950`,icon:`border-amber-600 bg-amber-600 text-white`,title:`text-gray-950`,text:`text-gray-500`,meta:`text-gray-400`},violet:{card:`border-gray-200/80 bg-white text-gray-950`,icon:`border-violet-500 bg-violet-500 text-white`,title:`text-gray-950`,text:`text-gray-500`,meta:`text-gray-400`},sky:{card:`border-gray-200/80 bg-white text-gray-950`,icon:`border-sky-500 bg-sky-500 text-white`,title:`text-gray-950`,text:`text-gray-500`,meta:`text-gray-400`},teal:{card:`border-gray-200/80 bg-white text-gray-950`,icon:`border-teal-600 bg-teal-600 text-white`,title:`text-gray-950`,text:`text-gray-500`,meta:`text-gray-400`}},_t=`grid grid-cols-[repeat(auto-fill,minmax(240px,320px))] justify-start gap-3`,vt=24;function yt(e){let{entries:t,scenes:n,language:r,installState:i,onOpen:a,onInstall:o,onOpenScene:s}=e,c=A(r),l=[...t].sort((e,t)=>wt(e.item,t.item)).slice(0,6);return(0,Q.jsxs)(`div`,{className:`mb-4 space-y-5`,children:[(0,Q.jsxs)(`section`,{className:`space-y-2.5`,children:[(0,Q.jsx)(Ct,{icon:ve,title:$({zh:`场景`,en:`Scenes`},r),description:$({zh:`按使用场景浏览适合的技能组合。`,en:`Browse skills by how you plan to use them.`},r)}),(0,Q.jsx)(`div`,{className:`grid grid-cols-2 gap-2 md:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5`,children:n.map(e=>(0,Q.jsx)(bt,{scene:e,language:r,onSelect:s},e.scene))})]}),l.length>0&&(0,Q.jsx)(St,{icon:_e,title:$({zh:`最近更新`,en:`Recently updated`},r),description:$({zh:`看看生态最近在补齐哪些能力。`,en:`See what the ecosystem has been improving lately.`},r),entries:l,language:r,localeFallbacks:c,installState:i,onOpen:a,onInstall:o})]})}function bt(e){let{scene:t,language:n,onSelect:r}=e,a=Tt(t.scene),o=a.icon,s=gt[a.tone];return(0,Q.jsx)(`button`,{type:`button`,onClick:()=>r(t.scene),className:i(`group flex min-h-[74px] flex-col justify-center rounded-lg border px-3 py-2.5 text-left shadow-sm transition-colors hover:border-gray-300 hover:bg-gray-50/70`,s.card),children:(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:i(`flex h-7 w-7 shrink-0 items-center justify-center rounded-md border`,s.icon),children:(0,Q.jsx)(o,{className:`h-3.5 w-3.5`})}),(0,Q.jsx)(`div`,{className:`min-w-0 flex-1 truncate text-[13px] font-semibold text-gray-950`,children:Et(t,a,n)}),typeof t.count==`number`&&(0,Q.jsx)(`span`,{className:`shrink-0 text-[11px] font-medium text-gray-400`,children:Ot(t.count,n)})]}),(0,Q.jsx)(`p`,{className:i(`mt-1 line-clamp-1 text-[11px] leading-relaxed`,s.text),children:Dt(t,a,n)})]})})}function xt(e){let{scene:t,entries:n,isLoading:r,language:a,localeFallbacks:o,installState:s,onBack:c,onOpen:l,onInstall:u}=e,d=Tt(t.scene),f=d.icon,p=gt[d.tone];return(0,Q.jsxs)(`section`,{className:`flex min-h-full flex-col`,children:[(0,Q.jsxs)(`div`,{className:`mb-4 flex min-w-0 items-start gap-2.5`,children:[(0,Q.jsx)(`button`,{type:`button`,onClick:c,className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-lg text-gray-600 transition-colors hover:bg-gray-100 hover:text-gray-900`,"aria-label":$({zh:`返回`,en:`Back`},a),children:(0,Q.jsx)(M,{className:`h-4 w-4`})}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:i(`flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border`,p.icon),children:(0,Q.jsx)(f,{className:`h-4 w-4`})}),(0,Q.jsx)(`h3`,{className:`min-w-0 flex-1 truncate text-[15px] font-semibold text-gray-950`,children:Et(t,d,a)}),(0,Q.jsx)(`span`,{className:`shrink-0 text-[11px] font-medium text-gray-400`,children:$(r?{zh:`加载中`,en:`Loading`}:{zh:`${n.length} 个技能`,en:`${n.length} skills`},a)})]}),(0,Q.jsx)(`div`,{className:`mt-1.5 flex min-w-0 items-center gap-2`,children:(0,Q.jsx)(`p`,{className:`min-w-0 flex-1 truncate text-[12px] leading-relaxed text-gray-500`,children:Dt(t,d,a)})})]})]}),r?(0,Q.jsx)(`div`,{"data-testid":`marketplace-scene-skeleton`,className:i(_t,`min-h-0 flex-1 auto-rows-[166px] content-start`),children:(0,Q.jsx)(le,{count:vt})}):n.length>0?(0,Q.jsx)(`div`,{className:_t,children:n.map(e=>(0,Q.jsx)(lt,{entry:e,language:a,localeFallbacks:o,installState:s,layout:`grid`,onOpen:l,onInstall:u},e.item.id))}):(0,Q.jsx)(`div`,{className:`rounded-lg border border-dashed border-gray-200 py-8 text-center text-[12px] text-gray-500`,children:$({zh:`这个模块暂无技能。`,en:`No skills in this module yet.`},a)})]})}function St(e){let{icon:t,title:n,description:r,entries:i,language:a,localeFallbacks:o,installState:s,onOpen:c,onInstall:l}=e;return(0,Q.jsxs)(`section`,{className:`space-y-2.5`,children:[(0,Q.jsx)(Ct,{icon:t,title:n,description:r}),(0,Q.jsx)(`div`,{className:`-mx-1 flex gap-2.5 overflow-x-auto px-1 pb-1.5 custom-scrollbar`,children:i.map(e=>(0,Q.jsx)(lt,{entry:e,language:a,localeFallbacks:o,installState:s,onOpen:c,onInstall:l},e.item.id))})]})}function Ct({icon:e,title:t,description:n}){return(0,Q.jsx)(`div`,{className:`flex items-end justify-between gap-4`,children:(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`h3`,{className:`flex items-center gap-2 text-[14px] font-semibold text-gray-950`,children:[(0,Q.jsx)(e,{className:`h-4 w-4 text-primary`}),t]}),(0,Q.jsx)(`p`,{className:`mt-0.5 text-[12px] leading-relaxed text-gray-500`,children:n})]})})}function wt(e,t){let n=Date.parse(e.updatedAt),r=Date.parse(t.updatedAt);return Number.isNaN(n)||Number.isNaN(r)?t.updatedAt.localeCompare(e.updatedAt):r-n}function $(e,t){return t.startsWith(`zh`)?e.zh:e.en}function Tt(e){return mt.find(t=>t.scene===e)??{scene:e,...ht}}function Et(e,t,n){return t.title?$(t.title,n):e.title}function Dt(e,t,n){return t.summary?$(t.summary,n):e.description??e.scene}function Ot(e,t){return t.startsWith(`zh`)?`${e} 个技能`:`${e} skills`}function kt(e){let{items:t,installedRecordLookup:n,scene:r,forcedType:i,typeFilter:a,scope:o,searchText:s,query:c,showListSkeleton:l,hasCatalogError:u}=e,d=je(a===`skill`),f=(0,H.useMemo)(()=>d.data?.scenes??[],[d.data?.scenes]),p=Me(f,a===`skill`),m=(0,H.useMemo)(()=>f.map(e=>({...e,count:typeof e.count==`number`?e.count:p.get(e.scene)})),[p,f]),h=(0,H.useMemo)(()=>t.map(e=>({item:e,record:Re(e,n)})),[t,n]),g=(0,H.useMemo)(()=>{let e=r?.trim();if(e)return m.find(t=>t.scene===e)??{scene:e,title:e}},[r,m]),_=a===`skill`&&!!r?.trim();return{entries:h,scenes:m,selectedScene:g,sceneEntries:h,isSceneRoute:_,showShelves:a===`skill`&&o===`all`&&!s.trim()&&!c&&!l&&!u&&m.length>0&&t.length>=4&&!_,backPath:i?`/skills`:`/marketplace/skills`,pathPrefix:i?`/skills/scenes`:`/marketplace/skills/scenes`}}var At=20,jt=36;function Mt(e){return e===`plugin`?{pageTitle:`marketplacePluginsPageTitle`,pageDescription:`marketplacePluginsPageDescription`,tabMarketplace:`marketplaceTabMarketplacePlugins`,tabInstalled:`marketplaceTabInstalledPlugins`,searchPlaceholder:`marketplaceSearchPlaceholderPlugins`,sectionCatalog:`marketplaceSectionPlugins`,sectionInstalled:`marketplaceSectionInstalledPlugins`,errorLoadData:`marketplaceErrorLoadingPluginsData`,errorLoadInstalled:`marketplaceErrorLoadingInstalledPlugins`,emptyData:`marketplaceNoPlugins`,emptyInstalled:`marketplaceNoInstalledPlugins`,installedCountSuffix:`marketplaceInstalledPluginsCountSuffix`}:{pageTitle:`marketplaceSkillsPageTitle`,pageDescription:`marketplaceSkillsPageDescription`,tabMarketplace:`marketplaceTabMarketplaceSkills`,tabInstalled:`marketplaceTabInstalledSkills`,searchPlaceholder:`marketplaceSearchPlaceholderSkills`,sectionCatalog:`marketplaceSectionSkills`,sectionInstalled:`marketplaceSectionInstalledSkills`,errorLoadData:`marketplaceErrorLoadingSkillsData`,errorLoadInstalled:`marketplaceErrorLoadingInstalledSkills`,emptyData:`marketplaceNoSkills`,emptyInstalled:`marketplaceNoInstalledSkills`,installedCountSuffix:`marketplaceInstalledSkillsCountSuffix`}}function Nt(e={}){let{forcedType:t}=e,n=ne(),i=ie(),{language:a}=fe(),s=de(),c=(0,H.useMemo)(()=>t===`plugins`||t===`skills`?t:i.type===`plugins`||i.type===`skills`?i.type:null,[t,i.type]);(0,H.useEffect)(()=>{t||c||n(`/marketplace/plugins`,{replace:!0})},[t,c,n]);let l=c===`skills`?`skill`:`plugin`,u=(0,H.useMemo)(()=>A(a),[a]),d=Mt(l),[f,p]=(0,H.useState)(``),[m,g]=(0,H.useState)(``),[_,v]=(0,H.useState)(`all`),[y,b]=(0,H.useState)(`relevance`),[x,S]=(0,H.useState)(new Set),[ee,C]=(0,H.useState)(new Map),w=(0,H.useRef)({byKey:new Map,seq:0});(0,H.useEffect)(()=>{let e=setTimeout(()=>{g(f.trim())},250);return()=>clearTimeout(e)},[f]);let T=Ne(l),E=l===`skill`?i.scene?.trim():void 0,D=ke({q:E?void 0:m||void 0,scene:E,type:l,sort:y,pageSize:At}),O=ue({disabled:_!==`all`||D.isError||!D.hasNextPage||D.isFetchingNextPage,onLoadMore:()=>D.fetchNextPage(),watchValue:`${l}:${_}:${m}:${E??``}:${y}:${D.data?.loadedItems??0}:${D.data?.loadedPages??0}`});(0,H.useEffect)(()=>{let e=O.containerRef.current;e&&typeof e.scrollTo==`function`&&e.scrollTo({top:0})},[O.containerRef,m,E,_,y,l]);let re=Pe(),oe=Fe(),{confirm:se,ConfirmDialog:le}=pe(),j=(0,H.useMemo)(()=>T.data?.records??[],[T.data?.records]),M=(0,H.useMemo)(()=>D.data?.items??[],[D.data?.items]),N=(0,H.useMemo)(()=>Ie(M),[M]),P=(0,H.useMemo)(()=>Le(j),[j]),F=(0,H.useMemo)(()=>{let e=j.filter(e=>e.type===l).map(e=>({key:`${e.type}:${e.spec}:${e.id??``}`,record:e,item:ze(e,N)})).filter(e=>Be(e.record,e.item,m,u));return e.sort((e,t)=>{let n=e.record.installedAt?Date.parse(e.record.installedAt):NaN,r=t.record.installedAt?Date.parse(t.record.installedAt):NaN;return!Number.isNaN(n)&&!Number.isNaN(r)&&n!==r?r-n:e.record.spec.localeCompare(t.record.spec)}),e},[j,l,N,m,u]),I=_===`installed`?F.length:D.data?.total??0,L={showCatalog:_===`all`&&D.isLoading&&!D.data,showInstalled:_===`installed`&&T.isLoading&&!T.data},R=L.showCatalog||L.showInstalled,z=(0,H.useMemo)(()=>_===`installed`?T.isLoading&&!T.data?r(`loading`):`${F.length} ${r(d.installedCountSuffix)}`:D.data?`${M.length} / ${I}`:r(`loading`),[_,T.data,T.isLoading,F.length,D.data,M.length,I,d.installedCountSuffix]),B={installingSpecs:x},he={actionsByTarget:ee},V=kt({items:M,installedRecordLookup:P,scene:E,forcedType:t,typeFilter:l,scope:_,searchText:f,query:m,showListSkeleton:R,hasCatalogError:D.isError}),U=async e=>{let t=e.install.spec;if(!x.has(t)){S(e=>{let n=new Set(e);return n.add(t),n});try{await re.mutateAsync({type:e.type,spec:t,kind:e.install.kind,...e.type===`skill`?{skill:e.slug,installPath:`skills/${e.slug}`}:{}})}catch{}finally{S(e=>{if(!e.has(t))return e;let n=new Set(e);return n.delete(t),n})}}},ge=async(e,t)=>{let n=t.id||t.spec;if(n&&!ee.has(n)&&!(e===`uninstall`&&!await se({title:`${r(`marketplaceUninstallTitle`)} ${n}?`,description:r(`marketplaceUninstallDescription`),confirmLabel:r(`marketplaceUninstall`),variant:`destructive`}))){C(t=>{let r=new Map(t);return r.set(n,e),r});try{await oe.mutateAsync({type:t.type,action:e,id:n,spec:t.spec})}finally{C(e=>{if(!e.has(n))return e;let t=new Map(e);return t.delete(n),t})}}},W=async(e,t)=>{let n=e?.name??t?.label??t?.id??t?.spec??r(`marketplaceUnknownItem`),i=e?`marketplace:${e.type}:${e.slug}`:`marketplace:${t?.type??`unknown`}:${t?.id??t?.spec??n}`,a={title:n,kind:`content`,dedupeKey:i},o={...a,activate:!1};if(!e){let e=Z({title:n,typeLabel:t?.type===`plugin`?r(`marketplaceTypePlugin`):r(`marketplaceTypeSkill`),spec:t?.spec??`-`,summary:r(`marketplaceInstalledLocalSummary`),metadataRaw:JSON.stringify(t??{},null,2),contentRaw:`-`});s.open(e,a);return}let c=w.current.seq+1;w.current.seq=c,w.current.byKey.set(i,c);let l=k(e.summaryI18n,e.summary,u),d=e.type===`skill`?{typeLabel:r(`marketplaceTypeSkill`),loadContent:()=>te(e.slug),fallbackContent:r(`marketplaceOperationFailed`),defaultContent:void 0}:{typeLabel:r(`marketplaceTypePlugin`),loadContent:()=>h(e.slug),fallbackContent:`-`,defaultContent:e.summary};s.open(Z({title:n,typeLabel:d.typeLabel,spec:e.install.spec,loading:!0}),a);try{let t=await d.loadContent();if(w.current.byKey.get(i)!==c)return;let r=Z({title:n,typeLabel:d.typeLabel,spec:e.install.spec,summary:l,metadataRaw:t.metadataRaw,contentRaw:t.bodyRaw||t.raw||d.defaultContent,sourceUrl:t.sourceUrl,sourceLabel:`Source (${t.source})`,tags:e.tags,author:e.author});s.open(r,o)}catch(t){if(w.current.byKey.get(i)!==c)return;let r=Z({title:n,typeLabel:d.typeLabel,spec:e.install.spec,summary:l,metadataRaw:JSON.stringify({error:t instanceof Error?t.message:String(t)},null,2),contentRaw:d.fallbackContent});s.open(r,o)}};return(0,Q.jsxs)(o,{className:`flex h-full min-h-0 flex-col pb-0`,children:[!V.isSceneRoute&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(me,{tabs:[{id:`all`,label:r(d.tabMarketplace)},{id:`installed`,label:r(d.tabInstalled),count:T.data?.total??0}],activeTab:_,onChange:e=>v(e),className:`mb-3`}),(0,Q.jsx)(ae,{scope:_,searchText:f,searchPlaceholder:r(d.searchPlaceholder),sort:y,onSearchTextChange:p,onSortChange:b})]}),(0,Q.jsxs)(`section`,{className:`flex min-h-0 flex-1 flex-col`,children:[!V.isSceneRoute&&!V.showShelves&&(0,Q.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[(0,Q.jsx)(`h3`,{className:`text-[14px] font-semibold text-gray-900`,children:r(_===`installed`?d.sectionInstalled:d.sectionCatalog)}),(0,Q.jsx)(`span`,{className:`text-[12px] text-gray-500`,children:z})]}),_===`all`&&D.isError&&(0,Q.jsxs)(`div`,{className:`rounded-xl border border-rose-200 bg-rose-50 p-4 text-sm text-rose-700`,children:[r(d.errorLoadData),`: `,D.error.message]}),_===`installed`&&T.isError&&(0,Q.jsxs)(`div`,{className:`rounded-xl border border-rose-200 bg-rose-50 p-4 text-sm text-rose-700`,children:[r(d.errorLoadInstalled),`: `,T.error.message]}),(0,Q.jsxs)(`div`,{ref:O.containerRef,className:`min-h-0 flex-1 overflow-y-auto custom-scrollbar pr-1`,"aria-busy":R||D.isFetchingNextPage,children:[V.isSceneRoute&&V.selectedScene&&(0,Q.jsx)(xt,{scene:V.selectedScene,entries:V.sceneEntries,isLoading:R,language:a,localeFallbacks:u,installState:B,onBack:()=>n(V.backPath),onOpen:e=>void W(e.item,e.record),onInstall:U}),V.showShelves&&(0,Q.jsx)(yt,{entries:V.entries,scenes:V.scenes,language:a,installState:B,onOpen:e=>void W(e.item,e.record),onInstall:U,onOpenScene:e=>n(`${V.pathPrefix}/${e}`)}),!V.isSceneRoute&&(0,Q.jsx)(ct,{scope:_,title:r(_===`installed`?d.sectionInstalled:d.sectionCatalog),summary:z,showTitle:V.showShelves,showListSkeleton:R,skeletonCardCount:jt,allItems:M,installedEntries:F,installedRecordLookup:P,language:a,installState:B,manageState:he,onOpen:(e,t)=>void W(e,t),onInstall:U,onManage:ge}),_===`all`&&!V.isSceneRoute&&!R&&!D.isError&&M.length===0&&(0,Q.jsx)(`div`,{className:`py-8 text-center text-[13px] text-gray-500`,children:r(d.emptyData)}),_===`installed`&&!V.isSceneRoute&&!R&&!T.isError&&F.length===0&&(0,Q.jsx)(`div`,{className:`py-8 text-center text-[13px] text-gray-500`,children:r(d.emptyInstalled)}),_===`all`&&!L.showCatalog&&!D.isError&&(0,Q.jsx)(ce,{hasMore:!!D.hasNextPage,loading:D.isFetchingNextPage,sentinelRef:O.sentinelRef})]})]}),(0,Q.jsx)(le,{})]})}export{Ce as n,Nt as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./marketplace-page-BrCLRIc4.js";export{e as MarketplacePage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./mcp-marketplace-page-DIq_SpMe.js";export{e as McpMarketplacePage};
|