@tom2012/cc-web 2026.4.19-o → 2026.4.19-p

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/README.md +2 -2
  2. package/backend/dist/adapters/claude-adapter.d.ts +1 -2
  3. package/backend/dist/adapters/claude-adapter.d.ts.map +1 -1
  4. package/backend/dist/adapters/claude-adapter.js +0 -22
  5. package/backend/dist/adapters/claude-adapter.js.map +1 -1
  6. package/backend/dist/adapters/codex-adapter.d.ts +3 -4
  7. package/backend/dist/adapters/codex-adapter.d.ts.map +1 -1
  8. package/backend/dist/adapters/codex-adapter.js +2 -40
  9. package/backend/dist/adapters/codex-adapter.js.map +1 -1
  10. package/backend/dist/adapters/gemini-adapter.d.ts +1 -7
  11. package/backend/dist/adapters/gemini-adapter.d.ts.map +1 -1
  12. package/backend/dist/adapters/gemini-adapter.js +0 -8
  13. package/backend/dist/adapters/gemini-adapter.js.map +1 -1
  14. package/backend/dist/adapters/opencode-adapter.d.ts +1 -2
  15. package/backend/dist/adapters/opencode-adapter.d.ts.map +1 -1
  16. package/backend/dist/adapters/opencode-adapter.js +0 -1
  17. package/backend/dist/adapters/opencode-adapter.js.map +1 -1
  18. package/backend/dist/adapters/qwen-adapter.d.ts +1 -2
  19. package/backend/dist/adapters/qwen-adapter.d.ts.map +1 -1
  20. package/backend/dist/adapters/qwen-adapter.js +0 -1
  21. package/backend/dist/adapters/qwen-adapter.js.map +1 -1
  22. package/backend/dist/adapters/terminal-adapter.d.ts +1 -2
  23. package/backend/dist/adapters/terminal-adapter.d.ts.map +1 -1
  24. package/backend/dist/adapters/terminal-adapter.js +0 -1
  25. package/backend/dist/adapters/terminal-adapter.js.map +1 -1
  26. package/backend/dist/adapters/types.d.ts +1 -3
  27. package/backend/dist/adapters/types.d.ts.map +1 -1
  28. package/backend/dist/config.d.ts +0 -1
  29. package/backend/dist/config.d.ts.map +1 -1
  30. package/backend/dist/config.js +0 -4
  31. package/backend/dist/config.js.map +1 -1
  32. package/backend/dist/index.d.ts.map +1 -1
  33. package/backend/dist/index.js +0 -25
  34. package/backend/dist/index.js.map +1 -1
  35. package/backend/dist/routes/hooks.d.ts.map +1 -1
  36. package/backend/dist/routes/hooks.js +0 -21
  37. package/backend/dist/routes/hooks.js.map +1 -1
  38. package/backend/dist/routes/projects.d.ts.map +1 -1
  39. package/backend/dist/routes/projects.js +2 -208
  40. package/backend/dist/routes/projects.js.map +1 -1
  41. package/backend/dist/session-manager.d.ts +43 -35
  42. package/backend/dist/session-manager.d.ts.map +1 -1
  43. package/backend/dist/session-manager.js +142 -259
  44. package/backend/dist/session-manager.js.map +1 -1
  45. package/frontend/dist/assets/{AssistantMessageContent-DqROC6KU.js → AssistantMessageContent-wJrH2meJ.js} +1 -1
  46. package/frontend/dist/assets/{GraphPreview-BIuzGAbi.js → GraphPreview-Dc0doluU.js} +1 -1
  47. package/frontend/dist/assets/{MobilePage-DlL0D36Y.js → MobilePage-BpP-L6oO.js} +3 -3
  48. package/frontend/dist/assets/{OfficePreview-DURcco1V.js → OfficePreview-CuLXXJtC.js} +2 -2
  49. package/frontend/dist/assets/{PlanPanel-BjNmFaVk.js → PlanPanel-CxCXowAR.js} +1 -1
  50. package/frontend/dist/assets/{ProjectPage-OChorfDC.js → ProjectPage-B2D-WoYj.js} +5 -5
  51. package/frontend/dist/assets/{SettingsPage-BnD3RAIW.js → SettingsPage-BRdp1y0m.js} +1 -1
  52. package/frontend/dist/assets/{SkillHubPage-jgiKwTgm.js → SkillHubPage-jirxSrmL.js} +3 -3
  53. package/frontend/dist/assets/{chevron-down-Bzon7hPT.js → chevron-down-B6rODcyf.js} +1 -1
  54. package/frontend/dist/assets/{chevron-up-CPpzmtnj.js → chevron-up-CVjkTdMA.js} +1 -1
  55. package/frontend/dist/assets/{index-Bs_kzF7I.js → index-BzaacjGy.js} +8 -8
  56. package/frontend/dist/assets/{index-B_-Wdt1O.js → index-DD7aR8Sa.js} +1 -1
  57. package/frontend/dist/assets/index-D_umrsZK.css +1 -0
  58. package/frontend/dist/assets/{index-eYA5tcCV.js → index-Qcpg6uVd.js} +1 -1
  59. package/frontend/dist/assets/{jszip.min-B96GO4qd.js → jszip.min-C_V8wSYG.js} +1 -1
  60. package/frontend/dist/assets/{maximize-2-Dil4Qhky.js → maximize-2-C6Y5UA8p.js} +1 -1
  61. package/frontend/dist/assets/{search-CVR9qZ6f.js → search-BEl0zazi.js} +1 -1
  62. package/frontend/dist/index.html +2 -2
  63. package/package.json +1 -1
  64. package/frontend/dist/assets/ShareViewPage-BmNNrInp.js +0 -1
  65. package/frontend/dist/assets/bot-DiR-1KP3.js +0 -7
  66. package/frontend/dist/assets/index-CdG-i6ZW.css +0 -1
  67. package/frontend/dist/assets/user-D1xnGKon.js +0 -7
@@ -1,4 +1,4 @@
1
- import{c as e,r as t,ap as n,aj as r,aB as o,j as s,ak as a,an as i,am as l,b as c,aC as d,R as u,aD as f,ao as p,al as h,aE as m,aF as x,aG as g,aH as v,aI as y,aJ as w,aK as b,z as j,aL as N,U as S,V as C,W as k,Y as R,$ as T,B as A,a0 as D,I as E,a1 as P,aM as _,aN as I,aO as O,aP as M,aQ as L,aa as F,aR as H,m as V,T as W,a8 as z,aS as B,f as $,S as K,aT as U,a9 as q,aU as G,G as X,A as Y,v as Z,X as Q,s as J,t as ee,aV as te,aW as ne,aX as re,aY as oe,aZ as se,a_ as ae,a$ as ie,b0 as le}from"./index-Bs_kzF7I.js";import{u as ce,c as de,S as ue}from"./index-eYA5tcCV.js";import{C as fe}from"./chevron-down-Bzon7hPT.js";import{C as pe}from"./chevron-up-CPpzmtnj.js";
1
+ import{c as e,r as t,am as n,ag as r,ay as o,j as s,ah as a,ak as i,aj as l,b as c,az as d,R as u,aA as f,al as p,ai as h,aB as m,aC as x,aD as g,aE as v,aF as y,aG as w,aH as b,z as j,aI as N,U as S,V as C,W as k,Y as R,$ as T,B as A,a0 as D,I as E,a1 as P,aJ as _,aK as I,aL as O,aM as M,aN as L,a7 as F,aO as H,m as V,T as W,a5 as z,aP as B,f as $,S as K,aQ as U,a6 as q,aR as G,G as X,A as Y,v as Z,X as Q,s as J,t as ee,aS as te,aT as ne,aU as re,aV as oe,aW as se,aX as ae,aY as ie,aZ as le}from"./index-BzaacjGy.js";import{u as ce,c as de,S as ue}from"./index-Qcpg6uVd.js";import{C as fe}from"./chevron-down-B6rODcyf.js";import{C as pe}from"./chevron-up-CVjkTdMA.js";
2
2
  /**
3
3
  * @license lucide-react v0.309.0 - ISC
4
4
  *
@@ -1,13 +1,13 @@
1
- import{c as e,a8 as s,r as t,b1 as a,b2 as r,t as n,b3 as l,b4 as i,b5 as d,j as c,B as o,a9 as m,b as x,I as u,T as h,v as p,D as g,O as f,A as j,b6 as b}from"./index-Bs_kzF7I.js";import{S as N}from"./search-CVR9qZ6f.js";import{U as v}from"./user-D1xnGKon.js";import{C as y}from"./chevron-down-Bzon7hPT.js";
1
+ import{c as e,a5 as s,r as t,a_ as a,a$ as r,t as l,b0 as n,b1 as i,b2 as d,j as c,B as o,a6 as m,b as x,I as u,T as h,v as p,D as g,O as f,A as j,b3 as b}from"./index-BzaacjGy.js";import{S as N}from"./search-BEl0zazi.js";import{C as v}from"./chevron-down-B6rODcyf.js";
2
2
  /**
3
3
  * @license lucide-react v0.309.0 - ISC
4
4
  *
5
5
  * This source code is licensed under the ISC license.
6
6
  * See the LICENSE file in the root directory of this source tree.
7
- */const w=e("Power",[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]),k=e("Puzzle",[["path",{d:"M19.439 7.85c-.049.322.059.648.289.878l1.568 1.568c.47.47.706 1.087.706 1.704s-.235 1.233-.706 1.704l-1.611 1.611a.98.98 0 0 1-.837.276c-.47-.07-.802-.48-.968-.925a2.501 2.501 0 1 0-3.214 3.214c.446.166.855.497.925.968a.979.979 0 0 1-.276.837l-1.61 1.61a2.404 2.404 0 0 1-1.705.707 2.402 2.402 0 0 1-1.704-.706l-1.568-1.568a1.026 1.026 0 0 0-.877-.29c-.493.074-.84.504-1.02.968a2.5 2.5 0 1 1-3.237-3.237c.464-.18.894-.527.967-1.02a1.026 1.026 0 0 0-.289-.877l-1.568-1.568A2.402 2.402 0 0 1 1.998 12c0-.617.236-1.234.706-1.704L4.23 8.77c.24-.24.581-.353.917-.303.515.077.877.528 1.073 1.01a2.5 2.5 0 1 0 3.259-3.259c-.482-.196-.933-.558-1.01-1.073-.05-.336.062-.676.303-.917l1.525-1.525A2.402 2.402 0 0 1 12 1.998c.617 0 1.234.236 1.704.706l1.568 1.568c.23.23.556.338.877.29.493-.074.84-.504 1.02-.968a2.5 2.5 0 1 1 3.237 3.237c-.464.18-.894.527-.967 1.02Z",key:"i0oyt7"}]]),C=e("Tag",[["path",{d:"M12 2H2v10l9.29 9.29c.94.94 2.48.94 3.42 0l6.58-6.58c.94-.94.94-2.48 0-3.42L12 2Z",key:"14b2ls"}],["path",{d:"M7 7h.01",key:"7u93v4"}]]);
7
+ */const y=e("Power",[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]),w=e("Puzzle",[["path",{d:"M19.439 7.85c-.049.322.059.648.289.878l1.568 1.568c.47.47.706 1.087.706 1.704s-.235 1.233-.706 1.704l-1.611 1.611a.98.98 0 0 1-.837.276c-.47-.07-.802-.48-.968-.925a2.501 2.501 0 1 0-3.214 3.214c.446.166.855.497.925.968a.979.979 0 0 1-.276.837l-1.61 1.61a2.404 2.404 0 0 1-1.705.707 2.402 2.402 0 0 1-1.704-.706l-1.568-1.568a1.026 1.026 0 0 0-.877-.29c-.493.074-.84.504-1.02.968a2.5 2.5 0 1 1-3.237-3.237c.464-.18.894-.527.967-1.02a1.026 1.026 0 0 0-.289-.877l-1.568-1.568A2.402 2.402 0 0 1 1.998 12c0-.617.236-1.234.706-1.704L4.23 8.77c.24-.24.581-.353.917-.303.515.077.877.528 1.073 1.01a2.5 2.5 0 1 0 3.259-3.259c-.482-.196-.933-.558-1.01-1.073-.05-.336.062-.676.303-.917l1.525-1.525A2.402 2.402 0 0 1 12 1.998c.617 0 1.234.236 1.704.706l1.568 1.568c.23.23.556.338.877.29.493-.074.84-.504 1.02-.968a2.5 2.5 0 1 1 3.237 3.237c-.464.18-.894.527-.967 1.02Z",key:"i0oyt7"}]]),k=e("Tag",[["path",{d:"M12 2H2v10l9.29 9.29c.94.94 2.48.94 3.42 0l6.58-6.58c.94-.94.94-2.48 0-3.42L12 2Z",key:"14b2ls"}],["path",{d:"M7 7h.01",key:"7u93v4"}]]),C=e("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);
8
8
  /**
9
9
  * @license lucide-react v0.309.0 - ISC
10
10
  *
11
11
  * This source code is licensed under the ISC license.
12
12
  * See the LICENSE file in the root directory of this source tree.
13
- */function S(){const e=s(),[S,_]=t.useState("skills"),[E,z]=t.useState([]),[L,M]=t.useState([]),[A,H]=t.useState(!1),[I,P]=t.useState(null);t.useEffect(()=>{"plugins"===S&&(H(!0),Promise.all([a().catch(()=>[]),fetch("/api/skillhub/plugins").then(e=>e.ok?e.json():[]).catch(()=>[])]).then(([e,s])=>{z(e),M(s)}).finally(()=>H(!1)))},[S]);const F=t.useCallback(async e=>{if(!I){P(e.id);try{await r(e.downloadUrl),n.success(`已安装 ${e.name}`);const s=await a().catch(()=>[]);z(s)}catch(s){n.error(s instanceof Error?s.message:"安装失败")}finally{P(null)}}},[I]),O=t.useCallback(async e=>{try{await l(e),z(s=>s.filter(s=>s.id!==e)),n.success("已卸载")}catch(s){n.error(s instanceof Error?s.message:"卸载失败")}},[]),D=t.useCallback(async(e,s)=>{try{await i(e,s),z(t=>t.map(t=>t.id===e?{...t,enabled:s}:t))}catch(t){n.error(t instanceof Error?t.message:"操作失败")}},[]),[T,U]=t.useState([]),[Z,$]=t.useState(!0),[B,q]=t.useState(null),[G,J]=t.useState(""),[K,Q]=t.useState(null),[R,V]=t.useState(null),[W,X]=t.useState(null),[Y,ee]=t.useState(new Set);t.useEffect(()=>{d().then(U).catch(e=>q(e instanceof Error?e.message:"Failed to load SkillHub")).finally(()=>$(!1))},[]);const se=t.useMemo(()=>{const e=new Set;return T.forEach(s=>{var t;return null==(t=s.tags)?void 0:t.forEach(s=>e.add(s))}),Array.from(e).sort()},[T]),te=t.useMemo(()=>T.some(e=>!e.tags||0===e.tags.length),[T]),ae=t.useMemo(()=>{let e=T;if("__untagged__"===K?e=e.filter(e=>!e.tags||0===e.tags.length):K&&(e=e.filter(e=>{var s;return null==(s=e.tags)?void 0:s.includes(K)})),G.trim()){const s=G.toLowerCase();e=e.filter(e=>{var t;return e.label.toLowerCase().includes(s)||e.description.toLowerCase().includes(s)||e.command.toLowerCase().includes(s)||e.author.toLowerCase().includes(s)||(null==(t=e.tags)?void 0:t.some(e=>e.toLowerCase().includes(s)))})}return e},[T,G,K]);return c.jsxs("div",{className:"min-h-screen bg-background",children:[c.jsx("header",{className:"border-b sticky top-0 bg-background z-10",children:c.jsxs("div",{className:"max-w-4xl mx-auto px-4 h-14 flex items-center gap-4",children:[c.jsxs(o,{variant:"ghost",size:"sm",onClick:()=>e("/"),children:[c.jsx(m,{className:"h-4 w-4 mr-1"}),"返回"]}),c.jsx("h1",{className:"font-semibold text-lg",children:"SkillHub"}),c.jsxs("div",{className:"flex items-center gap-1 ml-4",children:[c.jsx("button",{onClick:()=>_("skills"),className:x("px-3 py-1 rounded-md text-sm transition-colors","skills"===S?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent"),children:"技能"}),c.jsxs("button",{onClick:()=>_("plugins"),className:x("px-3 py-1 rounded-md text-sm transition-colors flex items-center gap-1","plugins"===S?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent"),children:[c.jsx(k,{className:"h-3.5 w-3.5"}),"插件"]})]}),c.jsx("div",{className:"flex-1"}),c.jsxs("div",{className:"relative w-64",children:[c.jsx(N,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),c.jsx(u,{placeholder:"搜索命令...",value:G,onChange:e=>J(e.target.value),className:"pl-8 h-9"})]})]})}),c.jsxs("main",{className:"max-w-4xl mx-auto px-4 py-6",children:["plugins"===S&&c.jsxs("div",{children:[A&&c.jsx("div",{className:"text-center text-muted-foreground py-20",children:"加载中..."}),!A&&c.jsxs(c.Fragment,{children:[E.length>0&&c.jsxs("div",{className:"mb-8",children:[c.jsx("h2",{className:"text-sm font-medium text-muted-foreground mb-3",children:"已安装"}),c.jsx("div",{className:"space-y-2",children:E.map(e=>c.jsxs("div",{className:"rounded-lg border bg-card p-4 flex items-center gap-4",children:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"font-medium text-sm",children:e.name}),c.jsxs("span",{className:"text-xs text-muted-foreground",children:["v",e.version]}),c.jsx("span",{className:x("text-xs px-1.5 py-0.5 rounded",e.enabled?"bg-green-500/10 text-green-500":"bg-muted text-muted-foreground"),children:e.enabled?"启用":"禁用"})]}),c.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:e.description}),e.permissions.length>0&&c.jsx("div",{className:"flex gap-1 mt-1 flex-wrap",children:e.permissions.map(e=>c.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-blue-500/10 text-blue-400",children:e},e))})]}),c.jsx(o,{size:"sm",variant:"ghost",onClick:()=>D(e.id,!e.enabled),title:e.enabled?"禁用":"启用",children:c.jsx(w,{className:x("h-4 w-4",e.enabled?"text-green-500":"text-muted-foreground")})}),c.jsx(o,{size:"sm",variant:"ghost",onClick:()=>O(e.id),title:"卸载",children:c.jsx(h,{className:"h-4 w-4 text-red-400"})})]},e.id))})]}),c.jsxs("div",{children:[c.jsx("h2",{className:"text-sm font-medium text-muted-foreground mb-3",children:E.length>0?"更多插件":"可用插件"}),0===L.length&&c.jsxs("div",{className:"text-center text-muted-foreground py-20",children:[c.jsx(k,{className:"h-10 w-10 mx-auto mb-3 opacity-30"}),c.jsx("p",{className:"text-sm",children:"插件中心暂无可用插件"})]}),c.jsx("div",{className:"space-y-2",children:L.filter(e=>!E.some(s=>s.id===e.id)).map((e,s)=>{const t=I===e.id;return c.jsxs(p.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.25,delay:.03*s},className:"rounded-lg border bg-card p-4 flex items-center gap-4",children:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"font-medium text-sm",children:e.name}),c.jsxs("span",{className:"text-xs text-muted-foreground",children:["v",e.version]}),c.jsxs("span",{className:"text-xs text-muted-foreground",children:["by ",e.author]})]}),c.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:e.description}),e.permissions.length>0&&c.jsx("div",{className:"flex gap-1 mt-1 flex-wrap",children:e.permissions.map(e=>c.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-blue-500/10 text-blue-400",children:e},e))})]}),c.jsxs(o,{size:"sm",disabled:t,onClick:()=>F(e),children:[c.jsx(g,{className:"h-3.5 w-3.5 mr-1"}),t?"安装中...":"安装"]})]},e.id)})})]})]})]}),"skills"===S&&c.jsxs(c.Fragment,{children:[se.length>0&&c.jsxs("div",{className:"flex flex-wrap gap-2 mb-6",children:[c.jsx("button",{className:x("px-3 py-1 rounded-full text-xs font-medium transition-colors",null===K?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-accent"),onClick:()=>Q(null),children:"全部"}),se.map(e=>c.jsx("button",{className:x("px-3 py-1 rounded-full text-xs font-medium transition-colors",K===e?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-accent"),onClick:()=>Q(K===e?null:e),children:e},e)),te&&c.jsx("button",{className:x("px-3 py-1 rounded-full text-xs font-medium transition-colors","__untagged__"===K?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-accent"),onClick:()=>Q("__untagged__"===K?null:"__untagged__"),children:"无标签"})]}),Z&&c.jsx("div",{className:"text-center text-muted-foreground py-20",children:"加载中..."}),B&&c.jsx("div",{className:"text-center text-destructive py-20",children:B}),!Z&&!B&&0===T.length&&c.jsxs("div",{className:"text-center text-muted-foreground py-20",children:[c.jsx("p",{className:"text-lg mb-2",children:"SkillHub 还没有命令"}),c.jsx("p",{className:"text-sm",children:"在快捷命令面板中点击分享按钮来提交第一个命令吧!"})]}),!Z&&!B&&T.length>0&&0===ae.length&&c.jsx("div",{className:"text-center text-muted-foreground py-20",children:"没有匹配的命令"}),c.jsx("div",{className:"space-y-3",children:ae.map((e,s)=>{var t;const a=R===e.id,r=Y.has(e.id),l=W===e.id,i=e.parentId?T.find(s=>s.id===e.parentId):void 0;return c.jsxs(p.div,{layout:!0,initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.25,delay:.03*s,ease:"easeOut"},className:"rounded-lg border bg-card p-4 cursor-pointer hover:border-muted-foreground/30 transition-colors",onClick:()=>V(a?null:e.id),children:[c.jsxs("div",{className:"flex items-start justify-between gap-4",children:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("h3",{className:"font-medium text-sm truncate",children:e.label}),null==(t=e.tags)?void 0:t.map(e=>c.jsxs("span",{className:"inline-flex items-center gap-0.5 px-2 py-0.5 rounded-full text-xs bg-muted text-muted-foreground",children:[c.jsx(C,{className:"h-2.5 w-2.5"}),e]},e))]}),i&&c.jsxs("div",{className:"flex items-center gap-1 mt-1",children:[c.jsx(f,{className:"h-3 w-3 text-muted-foreground"}),c.jsxs("span",{className:"text-xs text-muted-foreground",children:["继承: ",i.label]})]}),e.description&&c.jsx("p",{className:"text-xs text-muted-foreground mt-1 truncate",children:e.description}),c.jsxs("div",{className:"flex items-center gap-3 mt-2 text-xs text-muted-foreground",children:[c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx(v,{className:"h-3 w-3"}),e.author]}),c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx(g,{className:"h-3 w-3"}),e.downloads||0]}),c.jsx("span",{children:e.createdAt})]})]}),c.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[c.jsxs(o,{size:"sm",variant:r?"outline":"default",disabled:l||r,onClick:s=>(async(e,s)=>{if(s.stopPropagation(),!W&&!Y.has(e.id)){X(e.id);try{await b(e.id),ee(s=>new Set(s).add(e.id)),U(s=>s.map(s=>s.id===e.id?{...s,downloads:(s.downloads||0)+1}:s))}catch(t){n.error(t instanceof Error?t.message:"Download failed")}finally{X(null)}}})(e,s),title:i?`将同时下载继承的「${i.label}」`:void 0,children:[c.jsx(g,{className:"h-3.5 w-3.5 mr-1"}),r?"已下载":l?"下载中...":"下载"]}),c.jsx(p.span,{animate:{rotate:a?180:0},transition:{duration:.2},children:c.jsx(y,{className:"h-4 w-4 text-muted-foreground"})})]})]}),c.jsx(j,{children:a&&c.jsx(p.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:c.jsx("div",{className:"mt-3 pt-3 border-t",children:c.jsx("pre",{className:"text-xs font-mono bg-muted rounded p-3 whitespace-pre-wrap break-words max-h-64 overflow-y-auto",children:e.command})})})})]},e.id)})})]})]})]})}export{S as SkillHubPage};
13
+ */function S(){const e=s(),[S,_]=t.useState("skills"),[E,M]=t.useState([]),[z,L]=t.useState([]),[A,H]=t.useState(!1),[I,P]=t.useState(null);t.useEffect(()=>{"plugins"===S&&(H(!0),Promise.all([a().catch(()=>[]),fetch("/api/skillhub/plugins").then(e=>e.ok?e.json():[]).catch(()=>[])]).then(([e,s])=>{M(e),L(s)}).finally(()=>H(!1)))},[S]);const F=t.useCallback(async e=>{if(!I){P(e.id);try{await r(e.downloadUrl),l.success(`已安装 ${e.name}`);const s=await a().catch(()=>[]);M(s)}catch(s){l.error(s instanceof Error?s.message:"安装失败")}finally{P(null)}}},[I]),O=t.useCallback(async e=>{try{await n(e),M(s=>s.filter(s=>s.id!==e)),l.success("已卸载")}catch(s){l.error(s instanceof Error?s.message:"卸载失败")}},[]),$=t.useCallback(async(e,s)=>{try{await i(e,s),M(t=>t.map(t=>t.id===e?{...t,enabled:s}:t))}catch(t){l.error(t instanceof Error?t.message:"操作失败")}},[]),[D,T]=t.useState([]),[U,Z]=t.useState(!0),[B,q]=t.useState(null),[G,J]=t.useState(""),[K,Q]=t.useState(null),[R,V]=t.useState(null),[W,X]=t.useState(null),[Y,ee]=t.useState(new Set);t.useEffect(()=>{d().then(T).catch(e=>q(e instanceof Error?e.message:"Failed to load SkillHub")).finally(()=>Z(!1))},[]);const se=t.useMemo(()=>{const e=new Set;return D.forEach(s=>{var t;return null==(t=s.tags)?void 0:t.forEach(s=>e.add(s))}),Array.from(e).sort()},[D]),te=t.useMemo(()=>D.some(e=>!e.tags||0===e.tags.length),[D]),ae=t.useMemo(()=>{let e=D;if("__untagged__"===K?e=e.filter(e=>!e.tags||0===e.tags.length):K&&(e=e.filter(e=>{var s;return null==(s=e.tags)?void 0:s.includes(K)})),G.trim()){const s=G.toLowerCase();e=e.filter(e=>{var t;return e.label.toLowerCase().includes(s)||e.description.toLowerCase().includes(s)||e.command.toLowerCase().includes(s)||e.author.toLowerCase().includes(s)||(null==(t=e.tags)?void 0:t.some(e=>e.toLowerCase().includes(s)))})}return e},[D,G,K]);return c.jsxs("div",{className:"min-h-screen bg-background",children:[c.jsx("header",{className:"border-b sticky top-0 bg-background z-10",children:c.jsxs("div",{className:"max-w-4xl mx-auto px-4 h-14 flex items-center gap-4",children:[c.jsxs(o,{variant:"ghost",size:"sm",onClick:()=>e("/"),children:[c.jsx(m,{className:"h-4 w-4 mr-1"}),"返回"]}),c.jsx("h1",{className:"font-semibold text-lg",children:"SkillHub"}),c.jsxs("div",{className:"flex items-center gap-1 ml-4",children:[c.jsx("button",{onClick:()=>_("skills"),className:x("px-3 py-1 rounded-md text-sm transition-colors","skills"===S?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent"),children:"技能"}),c.jsxs("button",{onClick:()=>_("plugins"),className:x("px-3 py-1 rounded-md text-sm transition-colors flex items-center gap-1","plugins"===S?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent"),children:[c.jsx(w,{className:"h-3.5 w-3.5"}),"插件"]})]}),c.jsx("div",{className:"flex-1"}),c.jsxs("div",{className:"relative w-64",children:[c.jsx(N,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),c.jsx(u,{placeholder:"搜索命令...",value:G,onChange:e=>J(e.target.value),className:"pl-8 h-9"})]})]})}),c.jsxs("main",{className:"max-w-4xl mx-auto px-4 py-6",children:["plugins"===S&&c.jsxs("div",{children:[A&&c.jsx("div",{className:"text-center text-muted-foreground py-20",children:"加载中..."}),!A&&c.jsxs(c.Fragment,{children:[E.length>0&&c.jsxs("div",{className:"mb-8",children:[c.jsx("h2",{className:"text-sm font-medium text-muted-foreground mb-3",children:"已安装"}),c.jsx("div",{className:"space-y-2",children:E.map(e=>c.jsxs("div",{className:"rounded-lg border bg-card p-4 flex items-center gap-4",children:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"font-medium text-sm",children:e.name}),c.jsxs("span",{className:"text-xs text-muted-foreground",children:["v",e.version]}),c.jsx("span",{className:x("text-xs px-1.5 py-0.5 rounded",e.enabled?"bg-green-500/10 text-green-500":"bg-muted text-muted-foreground"),children:e.enabled?"启用":"禁用"})]}),c.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:e.description}),e.permissions.length>0&&c.jsx("div",{className:"flex gap-1 mt-1 flex-wrap",children:e.permissions.map(e=>c.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-blue-500/10 text-blue-400",children:e},e))})]}),c.jsx(o,{size:"sm",variant:"ghost",onClick:()=>$(e.id,!e.enabled),title:e.enabled?"禁用":"启用",children:c.jsx(y,{className:x("h-4 w-4",e.enabled?"text-green-500":"text-muted-foreground")})}),c.jsx(o,{size:"sm",variant:"ghost",onClick:()=>O(e.id),title:"卸载",children:c.jsx(h,{className:"h-4 w-4 text-red-400"})})]},e.id))})]}),c.jsxs("div",{children:[c.jsx("h2",{className:"text-sm font-medium text-muted-foreground mb-3",children:E.length>0?"更多插件":"可用插件"}),0===z.length&&c.jsxs("div",{className:"text-center text-muted-foreground py-20",children:[c.jsx(w,{className:"h-10 w-10 mx-auto mb-3 opacity-30"}),c.jsx("p",{className:"text-sm",children:"插件中心暂无可用插件"})]}),c.jsx("div",{className:"space-y-2",children:z.filter(e=>!E.some(s=>s.id===e.id)).map((e,s)=>{const t=I===e.id;return c.jsxs(p.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.25,delay:.03*s},className:"rounded-lg border bg-card p-4 flex items-center gap-4",children:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"font-medium text-sm",children:e.name}),c.jsxs("span",{className:"text-xs text-muted-foreground",children:["v",e.version]}),c.jsxs("span",{className:"text-xs text-muted-foreground",children:["by ",e.author]})]}),c.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:e.description}),e.permissions.length>0&&c.jsx("div",{className:"flex gap-1 mt-1 flex-wrap",children:e.permissions.map(e=>c.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-blue-500/10 text-blue-400",children:e},e))})]}),c.jsxs(o,{size:"sm",disabled:t,onClick:()=>F(e),children:[c.jsx(g,{className:"h-3.5 w-3.5 mr-1"}),t?"安装中...":"安装"]})]},e.id)})})]})]})]}),"skills"===S&&c.jsxs(c.Fragment,{children:[se.length>0&&c.jsxs("div",{className:"flex flex-wrap gap-2 mb-6",children:[c.jsx("button",{className:x("px-3 py-1 rounded-full text-xs font-medium transition-colors",null===K?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-accent"),onClick:()=>Q(null),children:"全部"}),se.map(e=>c.jsx("button",{className:x("px-3 py-1 rounded-full text-xs font-medium transition-colors",K===e?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-accent"),onClick:()=>Q(K===e?null:e),children:e},e)),te&&c.jsx("button",{className:x("px-3 py-1 rounded-full text-xs font-medium transition-colors","__untagged__"===K?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-accent"),onClick:()=>Q("__untagged__"===K?null:"__untagged__"),children:"无标签"})]}),U&&c.jsx("div",{className:"text-center text-muted-foreground py-20",children:"加载中..."}),B&&c.jsx("div",{className:"text-center text-destructive py-20",children:B}),!U&&!B&&0===D.length&&c.jsxs("div",{className:"text-center text-muted-foreground py-20",children:[c.jsx("p",{className:"text-lg mb-2",children:"SkillHub 还没有命令"}),c.jsx("p",{className:"text-sm",children:"在快捷命令面板中点击分享按钮来提交第一个命令吧!"})]}),!U&&!B&&D.length>0&&0===ae.length&&c.jsx("div",{className:"text-center text-muted-foreground py-20",children:"没有匹配的命令"}),c.jsx("div",{className:"space-y-3",children:ae.map((e,s)=>{var t;const a=R===e.id,r=Y.has(e.id),n=W===e.id,i=e.parentId?D.find(s=>s.id===e.parentId):void 0;return c.jsxs(p.div,{layout:!0,initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.25,delay:.03*s,ease:"easeOut"},className:"rounded-lg border bg-card p-4 cursor-pointer hover:border-muted-foreground/30 transition-colors",onClick:()=>V(a?null:e.id),children:[c.jsxs("div",{className:"flex items-start justify-between gap-4",children:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("h3",{className:"font-medium text-sm truncate",children:e.label}),null==(t=e.tags)?void 0:t.map(e=>c.jsxs("span",{className:"inline-flex items-center gap-0.5 px-2 py-0.5 rounded-full text-xs bg-muted text-muted-foreground",children:[c.jsx(k,{className:"h-2.5 w-2.5"}),e]},e))]}),i&&c.jsxs("div",{className:"flex items-center gap-1 mt-1",children:[c.jsx(f,{className:"h-3 w-3 text-muted-foreground"}),c.jsxs("span",{className:"text-xs text-muted-foreground",children:["继承: ",i.label]})]}),e.description&&c.jsx("p",{className:"text-xs text-muted-foreground mt-1 truncate",children:e.description}),c.jsxs("div",{className:"flex items-center gap-3 mt-2 text-xs text-muted-foreground",children:[c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx(C,{className:"h-3 w-3"}),e.author]}),c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx(g,{className:"h-3 w-3"}),e.downloads||0]}),c.jsx("span",{children:e.createdAt})]})]}),c.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[c.jsxs(o,{size:"sm",variant:r?"outline":"default",disabled:n||r,onClick:s=>(async(e,s)=>{if(s.stopPropagation(),!W&&!Y.has(e.id)){X(e.id);try{await b(e.id),ee(s=>new Set(s).add(e.id)),T(s=>s.map(s=>s.id===e.id?{...s,downloads:(s.downloads||0)+1}:s))}catch(t){l.error(t instanceof Error?t.message:"Download failed")}finally{X(null)}}})(e,s),title:i?`将同时下载继承的「${i.label}」`:void 0,children:[c.jsx(g,{className:"h-3.5 w-3.5 mr-1"}),r?"已下载":n?"下载中...":"下载"]}),c.jsx(p.span,{animate:{rotate:a?180:0},transition:{duration:.2},children:c.jsx(v,{className:"h-4 w-4 text-muted-foreground"})})]})]}),c.jsx(j,{children:a&&c.jsx(p.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:c.jsx("div",{className:"mt-3 pt-3 border-t",children:c.jsx("pre",{className:"text-xs font-mono bg-muted rounded p-3 whitespace-pre-wrap break-words max-h-64 overflow-y-auto",children:e.command})})})})]},e.id)})})]})]})]})}export{S as SkillHubPage};
@@ -1,4 +1,4 @@
1
- import{c as o}from"./index-Bs_kzF7I.js";
1
+ import{c as o}from"./index-BzaacjGy.js";
2
2
  /**
3
3
  * @license lucide-react v0.309.0 - ISC
4
4
  *
@@ -1,4 +1,4 @@
1
- import{c as o}from"./index-Bs_kzF7I.js";
1
+ import{c as o}from"./index-BzaacjGy.js";
2
2
  /**
3
3
  * @license lucide-react v0.309.0 - ISC
4
4
  *