plexus-agent-config 0.0.3 → 0.0.6
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/dist/bin.js +0 -0
- package/package.json +10 -4
- package/vendor/plexus-agent-config-core/package.json +3 -3
- package/vendor/plexus-agent-config-web/.next/BUILD_ID +1 -1
- package/vendor/plexus-agent-config-web/.next/app-path-routes-manifest.json +3 -3
- package/vendor/plexus-agent-config-web/.next/build-manifest.json +6 -6
- package/vendor/plexus-agent-config-web/.next/next-server.js.nft.json +1 -1
- package/vendor/plexus-agent-config-web/.next/prerender-manifest.json +3 -3
- package/vendor/plexus-agent-config-web/.next/required-server-files.js +4 -4
- package/vendor/plexus-agent-config-web/.next/required-server-files.json +4 -4
- package/vendor/plexus-agent-config-web/.next/server/app/_global-error/page.js +3 -3
- package/vendor/plexus-agent-config-web/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/_global-error.html +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/_global-error.rsc +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/_not-found/page.js +2 -2
- package/vendor/plexus-agent-config-web/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/about/page.js +2 -2
- package/vendor/plexus-agent-config-web/.next/server/app/about/page.js.nft.json +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/about/page_client-reference-manifest.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/agents/[id]/page.js +2 -2
- package/vendor/plexus-agent-config-web/.next/server/app/agents/[id]/page.js.nft.json +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/agents/[id]/page_client-reference-manifest.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/api/agent/[id]/file/route.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/api/agent/[id]/file/route_client-reference-manifest.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/api/agent/[id]/route.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/api/agent/[id]/route_client-reference-manifest.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/api/agent-catalog/route.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/api/agent-catalog/route_client-reference-manifest.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/api/agents/route.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/api/agents/route_client-reference-manifest.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/api/backups/[id]/restore/route.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/api/backups/[id]/restore/route_client-reference-manifest.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/api/backups/route.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/api/backups/route_client-reference-manifest.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/api/config/route.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/api/config/route_client-reference-manifest.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/api/custom-agents/[id]/file/route.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/api/custom-agents/[id]/file/route_client-reference-manifest.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/api/custom-agents/[id]/route.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/api/custom-agents/[id]/route_client-reference-manifest.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/api/custom-agents/route.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/api/custom-agents/route_client-reference-manifest.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/api/debug/route.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/api/debug/route_client-reference-manifest.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/api/import/route.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/api/import/route_client-reference-manifest.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/api/mcp/[id]/toggle/route.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/api/mcp/[id]/toggle/route_client-reference-manifest.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/api/mcp/effective/route.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/api/mcp/effective/route_client-reference-manifest.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/api/mcp/route.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/api/mcp/route_client-reference-manifest.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/api/rules/route.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/api/rules/route_client-reference-manifest.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/api/skills/[id]/route.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/api/skills/[id]/route_client-reference-manifest.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/api/skills/[id]/toggle/route.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/api/skills/[id]/toggle/route_client-reference-manifest.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/api/skills/effective/route.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/api/skills/effective/route_client-reference-manifest.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/api/skills/route.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/api/spread/route.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/api/spread/route_client-reference-manifest.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/api/sync/route.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/api/sync/route_client-reference-manifest.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/api/team/route.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/api/team/route_client-reference-manifest.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/backups/page.js +2 -2
- package/vendor/plexus-agent-config-web/.next/server/app/backups/page.js.nft.json +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/backups/page_client-reference-manifest.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/debug/page.js +2 -2
- package/vendor/plexus-agent-config-web/.next/server/app/debug/page.js.nft.json +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/debug/page_client-reference-manifest.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/mcp/page.js +2 -2
- package/vendor/plexus-agent-config-web/.next/server/app/mcp/page.js.nft.json +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/mcp/page_client-reference-manifest.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/mirror/page.js +2 -2
- package/vendor/plexus-agent-config-web/.next/server/app/mirror/page.js.nft.json +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/mirror/page_client-reference-manifest.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/page.js +2 -2
- package/vendor/plexus-agent-config-web/.next/server/app/page.js.nft.json +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/page_client-reference-manifest.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/rules/page.js +3 -3
- package/vendor/plexus-agent-config-web/.next/server/app/rules/page.js.nft.json +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/rules/page_client-reference-manifest.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/settings/page.js +2 -2
- package/vendor/plexus-agent-config-web/.next/server/app/settings/page.js.nft.json +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/skills/page.js +2 -2
- package/vendor/plexus-agent-config-web/.next/server/app/skills/page.js.nft.json +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/spread/page.js +2 -2
- package/vendor/plexus-agent-config-web/.next/server/app/spread/page.js.nft.json +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/spread/page_client-reference-manifest.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/team/page.js +2 -2
- package/vendor/plexus-agent-config-web/.next/server/app/team/page.js.nft.json +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app/team/page_client-reference-manifest.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/app-paths-manifest.json +3 -3
- package/vendor/plexus-agent-config-web/.next/server/chunks/479.js +4 -4
- package/vendor/plexus-agent-config-web/.next/server/chunks/554.js +1 -0
- package/vendor/plexus-agent-config-web/.next/server/chunks/750.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/middleware-build-manifest.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/next-font-manifest.js +1 -1
- package/vendor/plexus-agent-config-web/.next/server/next-font-manifest.json +1 -1
- package/vendor/plexus-agent-config-web/.next/server/pages/500.html +1 -1
- package/vendor/plexus-agent-config-web/.next/server/server-reference-manifest.json +1 -1
- package/vendor/plexus-agent-config-web/.next/static/chunks/{1968-9d19293a29f03646.js → 1968-5981314117a6ea1f.js} +2 -2
- package/vendor/plexus-agent-config-web/.next/static/chunks/{87c73c54-64138e17754e338c.js → 87c73c54-f46fec743414da25.js} +1 -1
- package/vendor/plexus-agent-config-web/.next/static/chunks/app/_not-found/page-8ba48265c993686c.js +1 -0
- package/vendor/plexus-agent-config-web/.next/static/chunks/app/about/{page-64a1ee41b87ea86c.js → page-1999365195d3b81a.js} +1 -1
- package/vendor/plexus-agent-config-web/.next/static/chunks/app/agents/[id]/page-02c1c68007fb9b26.js +1 -0
- package/vendor/plexus-agent-config-web/.next/static/chunks/app/backups/{page-6842a663db4fab47.js → page-5d03fe15d06b372e.js} +2 -2
- package/vendor/plexus-agent-config-web/.next/static/chunks/app/debug/{page-19e534df1d13eb98.js → page-2edfcee509b8438c.js} +1 -1
- package/vendor/plexus-agent-config-web/.next/static/chunks/app/layout-ebb341e17e16f301.js +1 -0
- package/vendor/plexus-agent-config-web/.next/static/chunks/app/mcp/{page-d0d518965db961f1.js → page-d4c83712d8c29f02.js} +1 -1
- package/vendor/plexus-agent-config-web/.next/static/chunks/app/mirror/page-5d4ac07dcc3218c5.js +1 -0
- package/vendor/plexus-agent-config-web/.next/static/chunks/app/{page-039dbbfad47ff659.js → page-4f00de3290a21755.js} +1 -1
- package/vendor/plexus-agent-config-web/.next/static/chunks/app/rules/{page-5bb663fc0ee9960b.js → page-f391407e2ebfcf64.js} +2 -2
- package/vendor/plexus-agent-config-web/.next/static/chunks/app/settings/page-0befc46d439ee26c.js +1 -0
- package/vendor/plexus-agent-config-web/.next/static/chunks/app/skills/{page-6067058898aa6e10.js → page-a90fec8f4dae0d22.js} +1 -1
- package/vendor/plexus-agent-config-web/.next/static/chunks/app/team/{page-edd7f54640e60e94.js → page-ecee567abc21176a.js} +1 -1
- package/vendor/plexus-agent-config-web/.next/static/chunks/main-927a633bb48df053.js +5 -0
- package/vendor/plexus-agent-config-web/.next/static/chunks/{main-app-4c4bad3c22a66283.js → main-app-e8d8ab3098122763.js} +1 -1
- package/vendor/plexus-agent-config-web/.next/static/chunks/next/dist/client/components/builtin/global-error-7dbae5819d7bfddc.js +1 -0
- package/vendor/plexus-agent-config-web/.next/static/chunks/webpack-59c0cf3deef5f26f.js +1 -0
- package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/package.json +3 -3
- package/vendor/plexus-agent-config-web/package.json +3 -3
- package/vendor/plexus-agent-config-web/.next/server/chunks/620.js +0 -1
- package/vendor/plexus-agent-config-web/.next/static/chunks/app/_not-found/page-303a3bb713044693.js +0 -1
- package/vendor/plexus-agent-config-web/.next/static/chunks/app/agents/[id]/page-c3c89d8ae72c75c2.js +0 -1
- package/vendor/plexus-agent-config-web/.next/static/chunks/app/layout-c148ba3a96b46ad6.js +0 -1
- package/vendor/plexus-agent-config-web/.next/static/chunks/app/mirror/page-e88f348e1a12487a.js +0 -1
- package/vendor/plexus-agent-config-web/.next/static/chunks/app/settings/page-8164e1d1a8a08038.js +0 -1
- package/vendor/plexus-agent-config-web/.next/static/chunks/main-488dba80110e3bfb.js +0 -5
- package/vendor/plexus-agent-config-web/.next/static/chunks/next/dist/client/components/builtin/global-error-821a044f296e83b5.js +0 -1
- package/vendor/plexus-agent-config-web/.next/static/chunks/webpack-dd4b9bd51624284c.js +0 -1
- /package/vendor/plexus-agent-config-web/.next/static/{cYvZNrsyPRNUjzvxkVMIa → F1j5cMKRUWnwXIl46BSnB}/_buildManifest.js +0 -0
- /package/vendor/plexus-agent-config-web/.next/static/{cYvZNrsyPRNUjzvxkVMIa → F1j5cMKRUWnwXIl46BSnB}/_ssgManifest.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9670],{4110:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(9789).A)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9670],{2456:(e,t,a)=>{Promise.resolve().then(a.bind(a,8287))},4110:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(9789).A)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},6197:(e,t,a)=>{"use strict";a.d(t,{E:()=>i,m:()=>r});var s=a(4568),n=a(7483);let l=(0,a(1397).F)("inline-flex items-center gap-1 rounded-sm px-2 h-5 text-[11px] font-medium tracking-[0.01em]",{variants:{variant:{team:"bg-plexus-info/15 text-plexus-info",personal:"bg-plexus-accent-faint text-plexus-accent",synced:"bg-plexus-ok/15 text-plexus-ok",divergent:"bg-plexus-warn/15 text-plexus-warn",native:"bg-plexus-text-3/15 text-plexus-text-3",beta:"bg-plexus-accent-faint text-plexus-accent border border-plexus-accent/25",danger:"bg-plexus-err/13 text-plexus-err",outline:"border border-plexus-border text-plexus-text-2"}},defaultVariants:{variant:"outline"}});function i({className:e,variant:t,...a}){return(0,s.jsx)("span",{className:(0,n.cn)(l({variant:t}),e),...a})}function r({className:e,tone:t="ok"}){return(0,s.jsx)("span",{className:(0,n.cn)("inline-block h-1.5 w-1.5 rounded-full",{ok:"bg-plexus-ok",warn:"bg-plexus-warn",err:"bg-plexus-err",info:"bg-plexus-info",accent:"bg-plexus-accent",mute:"bg-plexus-text-3"}[t],e)})}},6439:(e,t,a)=>{"use strict";a.d(t,{LanguageProvider:()=>c,o:()=>u});var s=a(4568);let n="plexus.locale";function l(e){if(!e)return null;let t=e.toLowerCase();return"zh"===t||t.startsWith("zh-")?"zh":"en"===t||t.startsWith("en-")?"en":null}var i=a(9748),r=a(7620);let o=(0,r.createContext)(null);function d(e){window.localStorage.setItem(n,e),document.cookie=`plexus-locale=${e}; path=/; max-age=31536000; samesite=lax`}function c({children:e,initialLocale:t}){let a=(0,i.useRouter)(),[u,p]=(0,r.useState)(t);(0,r.useEffect)(()=>{var e;let s,i=l(window.localStorage.getItem(n))??t??(s=(Array.isArray(e=window.navigator.languages??window.navigator.language)?e.map((e,t)=>({value:e,q:1,index:t})):"string"==typeof e?e.split(",").map((e,t)=>{let[a="",...s]=e.trim().split(";"),n=s.find(e=>e.trim().startsWith("q=")),l=n?Number(n.trim().slice(2)):1;return{value:a,q:Number.isFinite(l)?l:1,index:t}}):[]).map(e=>({...e,locale:l(e.value)})).filter(e=>null!==e.locale).sort((e,t)=>t.q-e.q||e.index-t.index),s[0]?.locale??"en");if(i!==t){d(i),a.refresh();return}d(i),p(t)},[t,a]);let x=(0,r.useMemo)(()=>({locale:u,setLocale(e){d(e),a.refresh()},toggleLocale(){d("zh"===u?"en":"zh"),a.refresh()}}),[u,a]);return(0,s.jsx)(o.Provider,{value:x,children:e})}function u(){let e=(0,r.useContext)(o);if(!e)throw Error("useLanguage must be used inside LanguageProvider");return e}},7294:(e,t,a)=>{"use strict";a.d(t,{Z:()=>i});var s=a(4568),n=a(7483),l=a(7620);let i=(0,l.forwardRef)(({className:e,...t},a)=>(0,s.jsx)("div",{ref:a,className:(0,n.cn)("rounded-md border border-plexus-border bg-plexus-surface","transition-colors duration-plexus-normal ease-plexus-out",e),...t}));i.displayName="Card",(0,l.forwardRef)(({className:e,...t},a)=>(0,s.jsx)(i,{ref:a,className:(0,n.cn)("hover:border-plexus-border-strong hover:-translate-y-px",e),...t})).displayName="CardHover"},7483:(e,t,a)=>{"use strict";a.d(t,{cn:()=>l});var s=a(9917),n=a(2809);function l(...e){return(0,n.QP)((0,s.$)(e))}},7788:(e,t,a)=>{"use strict";a.d(t,{Button:()=>d});var s=a(4568),n=a(7483),l=a(8347),i=a(1397),r=a(7620);let o=(0,i.F)((0,n.cn)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded font-medium","transition-colors duration-plexus-normal ease-plexus-out","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-plexus-accent/50 focus-visible:ring-offset-1 focus-visible:ring-offset-plexus-bg","disabled:pointer-events-none disabled:opacity-50"),{variants:{variant:{primary:"bg-plexus-accent text-[#1a1a17] hover:bg-plexus-accent-2 border border-plexus-accent",secondary:"bg-plexus-surface-2 text-plexus-text border border-plexus-border hover:bg-plexus-surface hover:border-plexus-border-strong",ghost:"bg-transparent text-plexus-text-2 hover:bg-plexus-surface-2 hover:text-plexus-text border border-transparent",danger:"bg-transparent text-plexus-err border border-plexus-err/35 hover:bg-plexus-err/10","danger-solid":"bg-plexus-err text-white border border-plexus-err hover:bg-plexus-err/90"},size:{default:"h-9 px-3.5 text-sm",sm:"h-7 px-2.5 text-xs",lg:"h-10 px-4 text-sm",icon:"h-9 w-9 p-0"}},defaultVariants:{variant:"secondary",size:"default"}}),d=(0,r.forwardRef)(({className:e,variant:t,size:a,asChild:i=!1,type:r="button",...d},c)=>{let u=i?l.DX:"button";return(0,s.jsx)(u,{ref:c,type:i?void 0:r,className:(0,n.cn)(o({variant:t,size:a}),e),...d})});d.displayName="Button"},8287:(e,t,a)=>{"use strict";a.d(t,{RulesPanel:()=>R});var s=a(4568),n=a(6439),l=a(6197),i=a(7788),r=a(7294);let o="~/.config/plexus/personal/rules/global.md",d={"claude-code":"Claude Code",cursor:"Cursor",codex:"Codex","gemini-cli":"Gemini CLI","qwen-code":"Qwen Code","factory-droid":"Factory Droid"};function c(e){return"object"==typeof e&&null!==e}function u(e){return"string"==typeof e?e:void 0}function p(e){return"boolean"==typeof e?e:void 0}var x=a(7483),h=a(9250),m=a(8874),g=a(4110),f=a(9789);let y=(0,f.A)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]),v=(0,f.A)("send-horizontal",[["path",{d:"M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z",key:"117uat"}],["path",{d:"M6 12h16",key:"s4cdu5"}]]),b=(0,f.A)("arrow-down-to-line",[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]]),k=(0,f.A)("link-2-off",[["path",{d:"M9 17H7A5 5 0 0 1 7 7",key:"10o201"}],["path",{d:"M15 7h2a5 5 0 0 1 4 8",key:"1d3206"}],["line",{x1:"8",x2:"12",y1:"12",y2:"12",key:"rvw6j4"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]),w=(0,f.A)("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]),j=(0,f.A)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);var N=a(7620);function A(e){return function e(t){if(!c(t))return{content:"",canonicalPath:o,agents:[],unavailableReason:"Rules status response was empty."};if(c(t.status))return e(t.status);let a=c(t.canonical)?t.canonical:void 0,s=!!a?.exists||!!t.content,n=Array.isArray(t.agents)?t.agents.map(e=>(function(e,t){if(!c(e))return null;if("exists"in e||"inSync"in e||"agent"in e){let a,s,n,l,i,r,o;return a=p(e.exists)??!1,s=p(e.inSync)??!1,n=p(e.isSymlink)??!1,l=u(e.agent)??u(e.agentId)??"unknown",i=p(e.installed)??!0,r=p(e.enabled)??!0,o="missing",i?r?a&&s?o=n?"linked":"in sync":a&&!t.hasBaseline?o="local only":a&&(o="drift"):o="disabled":o="not installed",{agentId:l,displayName:u(e.displayName)??d[l],targetPath:u(e.targetPath)??"",status:o,installed:i,enabled:r,lastAppliedAt:u(e.lastAppliedAt)}}return{agentId:u(e.agentId)??"unknown",displayName:u(e.displayName)??d[u(e.agentId)??"unknown"],targetPath:u(e.targetPath)??"",status:u(e.status)??"missing",installed:p(e.installed),enabled:p(e.enabled),lastAppliedAt:u(e.lastAppliedAt)}})(e,{hasBaseline:s})).filter(e=>null!==e):[];return{content:u(t.content)??u(a?.content)??"",canonicalPath:u(t.canonicalPath)??u(a?.path)??o,agents:n,updatedAt:u(t.updatedAt)??u(a?.updatedAt),unavailableReason:u(t.unavailableReason)}}(e)}let C={en:{title:"Global Rules",unsaved:"unsaved",saved:"saved",refresh:"Refresh",save:"Save",apply:"Apply to detected agents",applyDirtyTitle:"Save the baseline before applying it.",placeholder:"Write the shared operating rules every agent should receive.",notSavedYet:"Not saved yet",refreshFailed:"Could not refresh rules status.",saveFailed:"Could not save rules.",savedMessage:"Saved to personal rules baseline.",applyFailed:"Could not apply rules.",appliedMessage:"Applied rules to detected agents.",importFailed:"Could not import rules.",importedMessage:"Imported agent rules into the personal baseline.",detachFailed:"Could not detach rules.",linkFailed:"Could not link rules.",targets:"Targets",targetsUsingBaseline:(e,t)=>`${e} of ${t} targets using baseline`,pendingSave:"pending save",baselineReady:"baseline ready",explanation:"Plexus writes the same baseline to Claude Code as CLAUDE.md and to other tools as AGENTS.md. Managed link means the agent file is a symlink to this baseline. Detach keeps a local copy for that agent; Re-link replaces that agent's file with the current baseline and keeps a backup.",lastUpdated:"Last updated:",agentTarget:"Agent target",status:"Status",noTargets:"Rules targets are waiting for the core rules API.",noApplyRecord:"no apply record",appliedAt:e=>`applied ${e}`,import:"Import",detach:"Detach",link:"Link",relink:"Re-link",detachDirtyTitle:"Save or discard baseline edits before detaching.",relinkDirtyTitle:"Save the baseline before linking it.",privacy:"Rules are plain text and user-authored. This page does not read or reveal MCP command environment variables or tokens.",managedLink:"managed link",localCopy:"local copy",detachConfirm:e=>`Detach ${e} from Global Rules?
|
|
2
2
|
|
|
3
3
|
${e} will keep the current rules as a local file. Future edits to Global Rules will not affect it until you re-link it.`,relinkConfirm:e=>`Re-link ${e} to Global Rules?
|
|
4
4
|
|
|
@@ -6,4 +6,4 @@ This replaces ${e}'s current instruction file with the saved Plexus baseline. Pl
|
|
|
6
6
|
|
|
7
7
|
${e} 会保留当前规则作为本地文件。之后全局规则的改动不会影响它,除非你重新链接。`,relinkConfirm:e=>`确定要把 ${e} 重新链接到全局规则吗?
|
|
8
8
|
|
|
9
|
-
这会用已保存的 Plexus 基线替换 ${e} 当前的指令文件。Plexus 会先做快照,你可以在备份页恢复。`,detachedMessage:e=>`${e} 已解除同步,现在使用本地规则文件。`,linkedMessage:e=>`${e} 已链接到全局规则。`}};function M(e,t,a){return e?new Date(e).toLocaleString("zh"===a?"zh-CN":"en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}):t.notSavedYet}async function S(e,t){try{let a=await e.json();return a.error??a.message??t}catch{return t}}function R({initial:e}){let{locale:t}=(0,n.o)(),a=C[t],[o,d]=(0,N.useState)(e),[c,u]=(0,N.useState)(e.content??""),[p,f]=(0,N.useState)(null),[P,$]=(0,N.useState)(e.unavailableReason??null),z=c!==(o.content??""),T=(0,N.useMemo)(()=>o.agents.filter(e=>!1!==e.installed&&!1!==e.enabled),[o.agents]),F=(0,N.useMemo)(()=>T.filter(e=>["linked","copied","in sync"].includes(e.status)).length,[T]);async function I(e){f("refresh");try{let t=await fetch("/api/rules");if(!t.ok)return void $(await S(t,a.refreshFailed));let s=A(await t.json());d(s),u(s.content??""),$(e??s.unavailableReason??null)}finally{f(null)}}async function D(){f("save"),$(null);try{let e=await fetch("/api/rules",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({content:c})});if(!e.ok)return void $(await S(e,a.saveFailed));let t=A(await e.json());d(t),u(t.content??c),$(a.savedMessage)}finally{f(null)}}async function L(){f("apply"),$(null);try{let e=await fetch("/api/rules",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({action:"apply"})});if(!e.ok)return void $(await S(e,a.applyFailed));let t=A(await e.json());d(t),u(t.content??c),$(a.appliedMessage)}finally{f(null)}}async function W(e){f(`import:${e}`),$(null);try{let t=await fetch("/api/rules",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({action:"import",agentId:e})});if(!t.ok)return void $(await S(t,a.importFailed));let s=A(await t.json());d(s),u(s.content??""),$(a.importedMessage)}finally{f(null)}}async function E(e,t){if(confirm(a.detachConfirm(t))){f(`detach:${e}`),$(null);try{let s=await fetch("/api/rules",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({action:"detach",agentId:e})});if(!s.ok)return void $(await S(s,a.detachFailed));let n=A(await s.json());d(n),u(n.content??c),$(a.detachedMessage(t))}finally{f(null)}}}async function B(e,t,s){if("missing"===s||confirm(a.relinkConfirm(t))){f(`relink:${e}`),$(null);try{let s=await fetch("/api/rules",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({action:"relink",agentId:e})});if(!s.ok)return void $(await S(s,a.linkFailed));let n=A(await s.json());d(n),u(n.content??c),$(a.linkedMessage(t))}finally{f(null)}}}let O=!!o.unavailableReason;return(0,s.jsxs)("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,1fr)_380px]",children:[(0,s.jsxs)(r.Z,{className:"overflow-hidden",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3 border-b border-plexus-border px-5 py-4",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(h.A,{className:"h-4 w-4 text-plexus-accent",strokeWidth:1.5}),(0,s.jsx)("h2",{className:"plexus-title",children:a.title}),z?(0,s.jsx)(l.E,{variant:"divergent",children:a.unsaved}):(0,s.jsx)(l.E,{variant:"synced",children:a.saved})]}),(0,s.jsx)("code",{className:"mt-1 block truncate font-mono text-xs text-plexus-text-3",children:o.canonicalPath})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)(i.Button,{variant:"ghost",size:"sm",onClick:()=>I(),disabled:null!=p,children:["refresh"===p?(0,s.jsx)(m.A,{className:"h-3.5 w-3.5 animate-spin",strokeWidth:1.5}):(0,s.jsx)(g.A,{className:"h-3.5 w-3.5",strokeWidth:1.5}),a.refresh]}),(0,s.jsxs)(i.Button,{variant:"secondary",size:"sm",onClick:D,disabled:null!=p||O,children:["save"===p?(0,s.jsx)(m.A,{className:"h-3.5 w-3.5 animate-spin",strokeWidth:1.5}):(0,s.jsx)(y,{className:"h-3.5 w-3.5",strokeWidth:1.5}),a.save]}),(0,s.jsxs)(i.Button,{variant:"primary",size:"sm",onClick:L,disabled:null!=p||z||O,title:z?a.applyDirtyTitle:void 0,children:["apply"===p?(0,s.jsx)(m.A,{className:"h-3.5 w-3.5 animate-spin",strokeWidth:1.5}):(0,s.jsx)(v,{className:"h-3.5 w-3.5",strokeWidth:1.5}),a.apply]})]})]}),P&&(0,s.jsx)("div",{className:(0,x.cn)("border-b border-plexus-border px-5 py-2 text-xs",o.unavailableReason?"bg-plexus-warn/10 text-plexus-warn":"bg-plexus-surface-2 text-plexus-text-2"),children:P}),(0,s.jsx)("textarea",{className:"min-h-[520px] w-full resize-y bg-plexus-bg p-5 font-mono text-[13px] leading-6 text-plexus-text outline-none placeholder:text-plexus-text-mute focus:bg-plexus-bg",value:c,onChange:e=>u(e.target.value),disabled:O,placeholder:a.placeholder,spellCheck:!1})]}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)(r.Z,{className:"px-5 py-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"plexus-eyebrow mb-1",children:a.targets}),(0,s.jsx)("div",{className:"text-sm text-plexus-text-2",children:a.targetsUsingBaseline(F,T.length)})]}),(0,s.jsxs)(l.E,{variant:z?"divergent":"synced",children:[(0,s.jsx)(l.m,{tone:z?"warn":"ok"}),z?a.pendingSave:a.baselineReady]})]}),(0,s.jsx)("div",{className:"mt-4 text-xs leading-relaxed text-plexus-text-3",children:a.explanation}),(0,s.jsxs)("div",{className:"mt-3 text-xs text-plexus-text-3",children:[a.lastUpdated," ",(0,s.jsx)("span",{className:"text-plexus-text-2",children:M(o.updatedAt,a,t)})]})]}),(0,s.jsxs)(r.Z,{className:"overflow-hidden",children:[(0,s.jsxs)("div",{className:"grid grid-cols-[1fr_auto] border-b border-plexus-border px-4 py-3 text-[11px] uppercase tracking-[0.10em] text-plexus-text-3",children:[(0,s.jsx)("div",{children:a.agentTarget}),(0,s.jsx)("div",{children:a.status})]}),0===T.length?(0,s.jsx)("div",{className:"px-4 py-8 text-center text-sm text-plexus-text-3",children:a.noTargets}):T.map(e=>{var n,r,o;let d=p===`import:${e.agentId}`,c=p===`detach:${e.agentId}`,u=p===`relink:${e.agentId}`,x=e.displayName??e.agentId,h=null==p&&!O&&"disabled"!==e.status&&"not installed"!==e.status&&!z,g="linked"===e.status,f=!g&&"disabled"!==e.status&&"not installed"!==e.status;return(0,s.jsxs)("div",{className:"border-b border-plexus-border/60 px-4 py-3 last:border-0 hover:bg-plexus-surface-2/40",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("div",{className:"text-sm font-medium text-plexus-text",children:x}),(0,s.jsx)("code",{className:"mt-1 block truncate font-mono text-xs text-plexus-text-3",children:e.targetPath})]}),(0,s.jsxs)(l.E,{variant:"linked"===(n=e.status)||"copied"===n||"in sync"===n?"synced":"drift"===n?"divergent":"local only"===n?"outline":"missing"===n||"disabled"===n||"not installed"===n?"native":"outline",children:[(0,s.jsx)(l.m,{tone:"linked"===(r=e.status)||"copied"===r||"in sync"===r?"ok":"drift"===r?"warn":"local only"===r?"info":"missing"===r||"disabled"===r||"not installed"===r?"mute":"info"}),(o=e.status,"linked"===o?a.managedLink:"copied"===o||"in sync"===o?a.localCopy:o)]})]}),(0,s.jsxs)("div",{className:"mt-3 flex items-center justify-between gap-3",children:[(0,s.jsx)("span",{className:"text-[11px] text-plexus-text-mute",children:e.lastAppliedAt?a.appliedAt(M(e.lastAppliedAt,a,t)):a.noApplyRecord}),(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[g?null:(0,s.jsxs)(i.Button,{variant:"ghost",size:"sm",onClick:()=>W(e.agentId),disabled:null!=p||O||"missing"===e.status,children:[d?(0,s.jsx)(m.A,{className:"h-3.5 w-3.5 animate-spin",strokeWidth:1.5}):(0,s.jsx)(b,{className:"h-3.5 w-3.5",strokeWidth:1.5}),a.import]}),g?(0,s.jsxs)(i.Button,{variant:"ghost",size:"sm",onClick:()=>E(e.agentId,x),disabled:null!=p||O||z,title:z?a.detachDirtyTitle:void 0,children:[c?(0,s.jsx)(m.A,{className:"h-3.5 w-3.5 animate-spin",strokeWidth:1.5}):(0,s.jsx)(k,{className:"h-3.5 w-3.5",strokeWidth:1.5}),a.detach]}):null,f?(0,s.jsxs)(i.Button,{variant:"secondary",size:"sm",onClick:()=>B(e.agentId,x,e.status),disabled:!h,title:z?a.relinkDirtyTitle:void 0,children:[u?(0,s.jsx)(m.A,{className:"h-3.5 w-3.5 animate-spin",strokeWidth:1.5}):(0,s.jsx)(w,{className:"h-3.5 w-3.5",strokeWidth:1.5}),"missing"===e.status?a.link:a.relink]}):null]})]})]},e.agentId)})]}),(0,s.jsxs)(r.Z,{className:"flex items-start gap-3 px-5 py-4 text-sm text-plexus-text-2",children:[(0,s.jsx)(j,{className:"mt-0.5 h-4 w-4 shrink-0 text-plexus-ok",strokeWidth:1.5}),(0,s.jsx)("div",{children:a.privacy})]})]})]})}},8874:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(9789).A)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},9250:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(9789).A)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]])},9748:(e,t,a)=>{"use strict";var s=a(9796);a.o(s,"usePathname")&&a.d(t,{usePathname:function(){return s.usePathname}}),a.o(s,"useRouter")&&a.d(t,{useRouter:function(){return s.useRouter}})}},e=>{e.O(0,[4399,587,1968,7358],()=>e(e.s=
|
|
9
|
+
这会用已保存的 Plexus 基线替换 ${e} 当前的指令文件。Plexus 会先做快照,你可以在备份页恢复。`,detachedMessage:e=>`${e} 已解除同步,现在使用本地规则文件。`,linkedMessage:e=>`${e} 已链接到全局规则。`}};function M(e,t,a){return e?new Date(e).toLocaleString("zh"===a?"zh-CN":"en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}):t.notSavedYet}async function S(e,t){try{let a=await e.json();return a.error??a.message??t}catch{return t}}function R({initial:e}){let{locale:t}=(0,n.o)(),a=C[t],[o,d]=(0,N.useState)(e),[c,u]=(0,N.useState)(e.content??""),[p,f]=(0,N.useState)(null),[P,$]=(0,N.useState)(e.unavailableReason??null),z=c!==(o.content??""),T=(0,N.useMemo)(()=>o.agents.filter(e=>!1!==e.installed&&!1!==e.enabled),[o.agents]),F=(0,N.useMemo)(()=>T.filter(e=>["linked","copied","in sync"].includes(e.status)).length,[T]);async function I(e){f("refresh");try{let t=await fetch("/api/rules");if(!t.ok)return void $(await S(t,a.refreshFailed));let s=A(await t.json());d(s),u(s.content??""),$(e??s.unavailableReason??null)}finally{f(null)}}async function D(){f("save"),$(null);try{let e=await fetch("/api/rules",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({content:c})});if(!e.ok)return void $(await S(e,a.saveFailed));let t=A(await e.json());d(t),u(t.content??c),$(a.savedMessage)}finally{f(null)}}async function L(){f("apply"),$(null);try{let e=await fetch("/api/rules",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({action:"apply"})});if(!e.ok)return void $(await S(e,a.applyFailed));let t=A(await e.json());d(t),u(t.content??c),$(a.appliedMessage)}finally{f(null)}}async function W(e){f(`import:${e}`),$(null);try{let t=await fetch("/api/rules",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({action:"import",agentId:e})});if(!t.ok)return void $(await S(t,a.importFailed));let s=A(await t.json());d(s),u(s.content??""),$(a.importedMessage)}finally{f(null)}}async function E(e,t){if(confirm(a.detachConfirm(t))){f(`detach:${e}`),$(null);try{let s=await fetch("/api/rules",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({action:"detach",agentId:e})});if(!s.ok)return void $(await S(s,a.detachFailed));let n=A(await s.json());d(n),u(n.content??c),$(a.detachedMessage(t))}finally{f(null)}}}async function B(e,t,s){if("missing"===s||confirm(a.relinkConfirm(t))){f(`relink:${e}`),$(null);try{let s=await fetch("/api/rules",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({action:"relink",agentId:e})});if(!s.ok)return void $(await S(s,a.linkFailed));let n=A(await s.json());d(n),u(n.content??c),$(a.linkedMessage(t))}finally{f(null)}}}let O=!!o.unavailableReason;return(0,s.jsxs)("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,1fr)_380px]",children:[(0,s.jsxs)(r.Z,{className:"overflow-hidden",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3 border-b border-plexus-border px-5 py-4",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(h.A,{className:"h-4 w-4 text-plexus-accent",strokeWidth:1.5}),(0,s.jsx)("h2",{className:"plexus-title",children:a.title}),z?(0,s.jsx)(l.E,{variant:"divergent",children:a.unsaved}):(0,s.jsx)(l.E,{variant:"synced",children:a.saved})]}),(0,s.jsx)("code",{className:"mt-1 block truncate font-mono text-xs text-plexus-text-3",children:o.canonicalPath})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)(i.Button,{variant:"ghost",size:"sm",onClick:()=>I(),disabled:null!=p,children:["refresh"===p?(0,s.jsx)(m.A,{className:"h-3.5 w-3.5 animate-spin",strokeWidth:1.5}):(0,s.jsx)(g.A,{className:"h-3.5 w-3.5",strokeWidth:1.5}),a.refresh]}),(0,s.jsxs)(i.Button,{variant:"secondary",size:"sm",onClick:D,disabled:null!=p||O,children:["save"===p?(0,s.jsx)(m.A,{className:"h-3.5 w-3.5 animate-spin",strokeWidth:1.5}):(0,s.jsx)(y,{className:"h-3.5 w-3.5",strokeWidth:1.5}),a.save]}),(0,s.jsxs)(i.Button,{variant:"primary",size:"sm",onClick:L,disabled:null!=p||z||O,title:z?a.applyDirtyTitle:void 0,children:["apply"===p?(0,s.jsx)(m.A,{className:"h-3.5 w-3.5 animate-spin",strokeWidth:1.5}):(0,s.jsx)(v,{className:"h-3.5 w-3.5",strokeWidth:1.5}),a.apply]})]})]}),P&&(0,s.jsx)("div",{className:(0,x.cn)("border-b border-plexus-border px-5 py-2 text-xs",o.unavailableReason?"bg-plexus-warn/10 text-plexus-warn":"bg-plexus-surface-2 text-plexus-text-2"),children:P}),(0,s.jsx)("textarea",{className:"min-h-[520px] w-full resize-y bg-plexus-bg p-5 font-mono text-[13px] leading-6 text-plexus-text outline-none placeholder:text-plexus-text-mute focus:bg-plexus-bg",value:c,onChange:e=>u(e.target.value),disabled:O,placeholder:a.placeholder,spellCheck:!1})]}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)(r.Z,{className:"px-5 py-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"plexus-eyebrow mb-1",children:a.targets}),(0,s.jsx)("div",{className:"text-sm text-plexus-text-2",children:a.targetsUsingBaseline(F,T.length)})]}),(0,s.jsxs)(l.E,{variant:z?"divergent":"synced",children:[(0,s.jsx)(l.m,{tone:z?"warn":"ok"}),z?a.pendingSave:a.baselineReady]})]}),(0,s.jsx)("div",{className:"mt-4 text-xs leading-relaxed text-plexus-text-3",children:a.explanation}),(0,s.jsxs)("div",{className:"mt-3 text-xs text-plexus-text-3",children:[a.lastUpdated," ",(0,s.jsx)("span",{className:"text-plexus-text-2",children:M(o.updatedAt,a,t)})]})]}),(0,s.jsxs)(r.Z,{className:"overflow-hidden",children:[(0,s.jsxs)("div",{className:"grid grid-cols-[1fr_auto] border-b border-plexus-border px-4 py-3 text-[11px] uppercase tracking-[0.10em] text-plexus-text-3",children:[(0,s.jsx)("div",{children:a.agentTarget}),(0,s.jsx)("div",{children:a.status})]}),0===T.length?(0,s.jsx)("div",{className:"px-4 py-8 text-center text-sm text-plexus-text-3",children:a.noTargets}):T.map(e=>{var n,r,o;let d=p===`import:${e.agentId}`,c=p===`detach:${e.agentId}`,u=p===`relink:${e.agentId}`,x=e.displayName??e.agentId,h=null==p&&!O&&"disabled"!==e.status&&"not installed"!==e.status&&!z,g="linked"===e.status,f=!g&&"disabled"!==e.status&&"not installed"!==e.status;return(0,s.jsxs)("div",{className:"border-b border-plexus-border/60 px-4 py-3 last:border-0 hover:bg-plexus-surface-2/40",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("div",{className:"text-sm font-medium text-plexus-text",children:x}),(0,s.jsx)("code",{className:"mt-1 block truncate font-mono text-xs text-plexus-text-3",children:e.targetPath})]}),(0,s.jsxs)(l.E,{variant:"linked"===(n=e.status)||"copied"===n||"in sync"===n?"synced":"drift"===n?"divergent":"local only"===n?"outline":"missing"===n||"disabled"===n||"not installed"===n?"native":"outline",children:[(0,s.jsx)(l.m,{tone:"linked"===(r=e.status)||"copied"===r||"in sync"===r?"ok":"drift"===r?"warn":"local only"===r?"info":"missing"===r||"disabled"===r||"not installed"===r?"mute":"info"}),(o=e.status,"linked"===o?a.managedLink:"copied"===o||"in sync"===o?a.localCopy:o)]})]}),(0,s.jsxs)("div",{className:"mt-3 flex items-center justify-between gap-3",children:[(0,s.jsx)("span",{className:"text-[11px] text-plexus-text-mute",children:e.lastAppliedAt?a.appliedAt(M(e.lastAppliedAt,a,t)):a.noApplyRecord}),(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[g?null:(0,s.jsxs)(i.Button,{variant:"ghost",size:"sm",onClick:()=>W(e.agentId),disabled:null!=p||O||"missing"===e.status,children:[d?(0,s.jsx)(m.A,{className:"h-3.5 w-3.5 animate-spin",strokeWidth:1.5}):(0,s.jsx)(b,{className:"h-3.5 w-3.5",strokeWidth:1.5}),a.import]}),g?(0,s.jsxs)(i.Button,{variant:"ghost",size:"sm",onClick:()=>E(e.agentId,x),disabled:null!=p||O||z,title:z?a.detachDirtyTitle:void 0,children:[c?(0,s.jsx)(m.A,{className:"h-3.5 w-3.5 animate-spin",strokeWidth:1.5}):(0,s.jsx)(k,{className:"h-3.5 w-3.5",strokeWidth:1.5}),a.detach]}):null,f?(0,s.jsxs)(i.Button,{variant:"secondary",size:"sm",onClick:()=>B(e.agentId,x,e.status),disabled:!h,title:z?a.relinkDirtyTitle:void 0,children:[u?(0,s.jsx)(m.A,{className:"h-3.5 w-3.5 animate-spin",strokeWidth:1.5}):(0,s.jsx)(w,{className:"h-3.5 w-3.5",strokeWidth:1.5}),"missing"===e.status?a.link:a.relink]}):null]})]})]},e.agentId)})]}),(0,s.jsxs)(r.Z,{className:"flex items-start gap-3 px-5 py-4 text-sm text-plexus-text-2",children:[(0,s.jsx)(j,{className:"mt-0.5 h-4 w-4 shrink-0 text-plexus-ok",strokeWidth:1.5}),(0,s.jsx)("div",{children:a.privacy})]})]})]})}},8874:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(9789).A)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},9250:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(9789).A)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]])},9748:(e,t,a)=>{"use strict";var s=a(9796);a.o(s,"usePathname")&&a.d(t,{usePathname:function(){return s.usePathname}}),a.o(s,"useRouter")&&a.d(t,{useRouter:function(){return s.useRouter}})}},e=>{e.O(0,[4399,587,1968,7358],()=>e(e.s=2456)),_N_E=e.O()}]);
|
package/vendor/plexus-agent-config-web/.next/static/chunks/app/settings/page-0befc46d439ee26c.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4662],{906:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(9789).A)("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},1405:(e,t,s)=>{"use strict";s.d(t,{SettingsPanel:()=>c});var a=s(4568),l=s(6439),r=s(7788),n=s(7294),i=s(906),o=s(7620);let d={en:{saved:"Saved",privacyTitle:"Privacy pledge.",privacy:"Plexus runs entirely on your machine. No data is sent anywhere — not even crash reports. The only outbound traffic is the optional git pull when you subscribe to a team config repo.",enabledAgents:"Enabled agents",enabledAgentsHelp:"Disable an agent to skip it during sync, even if it is installed.",syncStrategy:"Sync strategy",syncStrategyHelp:"Symlinks are preferred — changes propagate instantly without re-running sync. Copy fallback is more portable across operating systems but requires sync to refresh files."},zh:{saved:"已保存",privacyTitle:"隐私承诺。",privacy:"Plexus 完全在你的机器上运行。不会发送任何数据,包括崩溃报告。唯一的外部网络请求是你订阅团队配置仓库时可选的 git pull。",enabledAgents:"启用的 Agent",enabledAgentsHelp:"关闭某个 Agent 后,即使它已安装,同步时也会跳过它。",syncStrategy:"同步策略",syncStrategyHelp:"优先使用软链接:改动会立即传播,不需要再次同步。复制模式跨系统更稳,但文件刷新需要重新同步。"}};function c({config:e,agents:t,displayNames:s}){let{locale:x}=(0,l.o)(),u=d[x],[p,m]=(0,o.useState)(e),[g,h]=(0,o.useState)(null);async function b(e){m(e);let t=await fetch("/api/config",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(e)});t.ok?(h(u.saved),setTimeout(()=>h(null),1200)):h(`Error: ${await t.text()}`)}return(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsx)(n.Z,{className:"border-l-[3px] border-l-plexus-ok px-5 py-4",children:(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)(i.A,{className:"mt-0.5 h-4 w-4 shrink-0 text-plexus-ok",strokeWidth:1.5}),(0,a.jsxs)("div",{className:"text-xs leading-relaxed text-plexus-text-2",children:[(0,a.jsx)("span",{className:"font-semibold text-plexus-text",children:u.privacyTitle})," ",u.privacy]})]})}),(0,a.jsxs)(n.Z,{className:"p-5",children:[(0,a.jsx)("div",{className:"plexus-eyebrow mb-1",children:u.enabledAgents}),(0,a.jsx)("p",{className:"text-xs text-plexus-text-3",children:u.enabledAgentsHelp}),(0,a.jsx)("div",{className:"mt-4 grid grid-cols-2 gap-3",children:t.map(e=>{let t=!1!==p.agents[e];return(0,a.jsxs)("label",{className:"flex cursor-pointer items-center gap-3 rounded border border-plexus-border bg-plexus-bg px-3 py-2 text-sm hover:border-plexus-border-strong",children:[(0,a.jsx)("input",{type:"checkbox",checked:t,onChange:t=>b({...p,agents:{...p.agents,[e]:t.target.checked}}),className:"h-4 w-4 cursor-pointer accent-plexus-accent"}),(0,a.jsx)("span",{className:t?"text-plexus-text":"text-plexus-text-3",children:s[e]??e})]},e)})})]}),(0,a.jsxs)(n.Z,{className:"p-5",children:[(0,a.jsx)("div",{className:"plexus-eyebrow mb-1",children:u.syncStrategy}),(0,a.jsx)("p",{className:"text-xs text-plexus-text-3",children:u.syncStrategyHelp}),(0,a.jsx)("div",{className:"mt-4 flex gap-2",children:["symlink","copy"].map(e=>{let t=p.syncStrategy===e;return(0,a.jsx)(r.Button,{variant:t?"primary":"secondary",size:"sm",onClick:()=>b({...p,syncStrategy:e}),children:e},e)})})]}),g&&(0,a.jsx)("div",{className:"text-xs text-plexus-text-3",children:g})]})}},3035:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(9789).A)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]])},3932:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(9789).A)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},5392:(e,t,s)=>{"use strict";s.d(t,{CustomAgentsPanel:()=>h});var a=s(4568),l=s(6439),r=s(6197),n=s(7788),i=s(7294),o=s(7378),d=s(3932),c=s(9250),x=s(3035),u=s(6969),p=s(8874),m=s(7620);let g={en:{catalog:"Agent catalog",catalogHelp:"Built-in agents sync Rules, MCP, and Skills. Other popular tools are listed as manual presets so users can quickly track an instruction file without waiting for a native adapter.",addAgent:"Add agent",agent:"Agent",status:"Status",support:"Support",action:"Action",installed:"installed",missing:"missing",fullSync:"full sync",manual:"manual",builtIn:"built-in",tracked:"tracked",trackFile:"Track file",agentId:"Agent id",displayName:"Display name",instructionFilePath:"Instruction file path",pathHelp:"Absolute or ~/ relative. Plexus will create or read the file when you click View / Edit.",note:"Note",optional:"optional",notePlaceholder:"Anything to remember about this agent...",cancel:"Cancel",adding:"Adding...",loading:"Loading custom agents...",noCustom:"No custom agents yet. Click Add agent to register one.",lite:"Lite",instructionsOnly:"instructions only",remove:"Remove",edit:"Edit",close:"Close",save:"Save",saving:"Saving...",editing:"editing",newFile:"new file",snapshotNotice:"Plexus snapshots the current file before save. Missing files are created on first save.",removeConfirm:e=>`Remove custom agent '${e}'? The instruction file on disk is not deleted.`,addFailed:"Failed to add custom agent",readFailed:"Failed to read file",saveFailed:"Failed to save file",saved:"Saved.",savedBackup:e=>`Saved. Backup: ${e}`},zh:{catalog:"Agent 目录",catalogHelp:"内置 Agent 支持 Rules、MCP 和 Skills 的完整同步。其他常见工具会作为手动预设展示,用户可以先追踪一个指令文件,不必等原生适配器。",addAgent:"新增 Agent",agent:"Agent",status:"状态",support:"支持",action:"操作",installed:"已安装",missing:"未发现",fullSync:"完整同步",manual:"手动",builtIn:"内置",tracked:"已追踪",trackFile:"追踪文件",agentId:"Agent ID",displayName:"展示名称",instructionFilePath:"指令文件路径",pathHelp:"支持绝对路径或 ~/ 相对路径。点击查看/编辑时,Plexus 会读取或创建该文件。",note:"备注",optional:"可选",notePlaceholder:"记录这个 Agent 的用途或注意事项...",cancel:"取消",adding:"正在新增...",loading:"正在加载自定义 Agent...",noCustom:"还没有自定义 Agent。点击新增 Agent 登记一个。",lite:"轻量",instructionsOnly:"仅指令文件",remove:"移除",edit:"编辑",close:"关闭",save:"保存",saving:"保存中...",editing:"编辑中",newFile:"新文件",snapshotNotice:"Plexus 会在保存前快照当前文件。缺失文件会在第一次保存时创建。",removeConfirm:e=>`移除自定义 Agent '${e}'?磁盘上的指令文件不会被删除。`,addFailed:"新增自定义 Agent 失败",readFailed:"读取文件失败",saveFailed:"保存文件失败",saved:"已保存。",savedBackup:e=>`已保存。备份:${e}`}};function h(){let{locale:e}=(0,l.o)(),t=g[e],[s,u]=(0,m.useState)([]),[p,h]=(0,m.useState)([]),[f,v]=(0,m.useState)(!0),[y,j]=(0,m.useState)(!1),[N,k]=(0,m.useState)({id:"",displayName:"",instructionFile:"",note:""}),[w,A]=(0,m.useState)(!1),[S,C]=(0,m.useState)(null),F=(0,m.useId)(),P=(0,m.useId)(),z=(0,m.useId)(),E=(0,m.useId)();function M(){j(!1),C(null),k({id:"",displayName:"",instructionFile:"",note:""})}async function H(){v(!0);try{let[e,t]=await Promise.all([fetch("/api/custom-agents"),fetch("/api/agent-catalog")]),s=await e.json(),a=await t.json();u(s.agents??[]),h(a.agents??[])}finally{v(!1)}}async function I(e){e.preventDefault(),A(!0),C(null);try{let e=await fetch("/api/custom-agents",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({id:N.id.trim(),displayName:N.displayName.trim(),instructionFile:N.instructionFile.trim(),note:N.note.trim()||void 0})}),s=await e.json();if(!s.ok)return void C(s.error??t.addFailed);M(),await H()}catch(e){C(e.message)}finally{A(!1)}}async function B(e){if(e.instructionFile){A(!0),C(null);try{let s=await fetch("/api/custom-agents",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({id:e.id,displayName:e.displayName,instructionFile:e.instructionFile,note:e.note})}),a=await s.json();if(!a.ok)return void C(a.error??t.addFailed);await H()}catch(e){C(e.message)}finally{A(!1)}}}async function _(e){if(confirm(t.removeConfirm(e))){A(!0);try{await fetch(`/api/custom-agents/${encodeURIComponent(e)}`,{method:"DELETE"}),await H()}finally{A(!1)}}}(0,m.useEffect)(()=>{let e=!1;return(async()=>{try{let[t,s]=await Promise.all([fetch("/api/custom-agents"),fetch("/api/agent-catalog")]),a=await t.json(),l=await s.json();e||(u(a.agents??[]),h(l.agents??[]))}finally{e||v(!1)}})(),()=>{e=!0}},[]);let R=new Set(s.map(e=>e.id)),T=[...p].sort((e,t)=>Number(t.installed)-Number(e.installed)||e.displayName.localeCompare(t.displayName));return(0,a.jsxs)(i.Z,{className:"p-5",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"plexus-eyebrow mb-1",children:t.catalog}),(0,a.jsx)("p",{className:"max-w-xl text-xs text-plexus-text-3",children:t.catalogHelp})]}),(0,a.jsxs)(n.Button,{variant:"secondary",size:"sm",onClick:()=>j(!0),children:[(0,a.jsx)(o.A,{className:"h-3.5 w-3.5",strokeWidth:1.5}),t.addAgent]})]}),p.length>0&&(0,a.jsxs)("div",{className:"mt-5 overflow-x-auto rounded border border-plexus-border",children:[(0,a.jsxs)("div",{className:"grid min-w-[720px] grid-cols-[1fr_86px_92px_96px] gap-x-4 border-b border-plexus-border bg-plexus-surface-2/40 px-4 py-2.5 text-[11px] uppercase tracking-[0.10em] text-plexus-text-3",children:[(0,a.jsx)("div",{children:t.agent}),(0,a.jsx)("div",{className:"text-right",children:t.status}),(0,a.jsx)("div",{className:"text-right",children:t.support}),(0,a.jsx)("div",{className:"text-right",children:t.action})]}),T.map(e=>{let s=R.has(e.id);return(0,a.jsxs)("div",{className:`grid min-w-[720px] grid-cols-[1fr_86px_92px_96px] gap-x-4 border-b border-plexus-border/60 px-4 py-3 text-sm last:border-0 ${e.installed?"bg-plexus-bg":"bg-plexus-surface text-plexus-text-3"}`,children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("div",{className:"font-semibold text-plexus-text",children:e.displayName}),(0,a.jsx)("div",{className:"font-mono text-[11px] text-plexus-text-3",children:e.id}),(0,a.jsx)("div",{className:"mt-1 truncate font-mono text-[11px] text-plexus-text-2",children:e.mcpPath??e.instructionFile??e.rootDir})]}),(0,a.jsx)("div",{className:"text-right",children:(0,a.jsx)(r.E,{variant:e.installed?"synced":"native",children:e.installed?t.installed:t.missing})}),(0,a.jsx)("div",{className:"text-right",children:(0,a.jsx)(r.E,{variant:e.managed?"personal":"outline",children:"full"===e.support?t.fullSync:t.manual})}),(0,a.jsx)("div",{className:"text-right",children:e.managed?(0,a.jsx)(r.E,{variant:"synced",children:t.builtIn}):s?(0,a.jsx)(r.E,{variant:"native",children:t.tracked}):(0,a.jsx)(n.Button,{variant:"ghost",size:"sm",onClick:()=>B(e),disabled:w||!e.instructionFile,children:t.trackFile})})]},e.id)})]}),y&&(0,a.jsx)("dialog",{open:!0,"aria-labelledby":"custom-agent-form-title",className:"fixed inset-0 z-50 m-0 h-full w-full max-w-none border-0 bg-transparent p-0",children:(0,a.jsx)("div",{role:"presentation",className:"flex h-full w-full cursor-default items-center justify-center bg-black/70 p-4",onClick:M,children:(0,a.jsxs)("form",{onSubmit:I,className:"w-full max-w-2xl space-y-4 rounded-md border border-plexus-border bg-plexus-surface p-5 text-left shadow-lg",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-4 border-b border-plexus-border pb-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{id:"custom-agent-form-title",className:"text-sm font-semibold text-plexus-text",children:t.addAgent}),(0,a.jsx)("p",{className:"mt-1 text-xs text-plexus-text-3",children:t.pathHelp})]}),(0,a.jsx)("button",{type:"button","aria-label":t.close,onClick:M,className:"text-plexus-text-3 hover:text-plexus-text",children:(0,a.jsx)(d.A,{className:"h-4 w-4",strokeWidth:1.5})})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:F,className:"mb-1 block text-[11px] uppercase tracking-[0.10em] text-plexus-text-3",children:t.agentId}),(0,a.jsx)("input",{id:F,type:"text",required:!0,placeholder:"e.g. copilot-cli",value:N.id,onChange:e=>k({...N,id:e.target.value}),pattern:"[a-z0-9](?:[a-z0-9-]*[a-z0-9])?",className:"w-full rounded border border-plexus-border bg-plexus-bg px-3 py-2 text-sm text-plexus-text outline-none focus:border-plexus-accent"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:P,className:"mb-1 block text-[11px] uppercase tracking-[0.10em] text-plexus-text-3",children:t.displayName}),(0,a.jsx)("input",{id:P,type:"text",required:!0,placeholder:"e.g. GitHub Copilot CLI",value:N.displayName,onChange:e=>k({...N,displayName:e.target.value}),className:"w-full rounded border border-plexus-border bg-plexus-bg px-3 py-2 text-sm text-plexus-text outline-none focus:border-plexus-accent"})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:z,className:"mb-1 block text-[11px] uppercase tracking-[0.10em] text-plexus-text-3",children:t.instructionFilePath}),(0,a.jsx)("input",{id:z,type:"text",required:!0,placeholder:"e.g. ~/.config/copilot/AGENTS.md",value:N.instructionFile,onChange:e=>k({...N,instructionFile:e.target.value}),className:"w-full rounded border border-plexus-border bg-plexus-bg px-3 py-2 font-mono text-xs text-plexus-text outline-none focus:border-plexus-accent"})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{htmlFor:E,className:"mb-1 block text-[11px] uppercase tracking-[0.10em] text-plexus-text-3",children:[t.note," ",(0,a.jsxs)("span",{className:"lowercase text-plexus-text-3",children:["(",t.optional,")"]})]}),(0,a.jsx)("input",{id:E,type:"text",maxLength:280,placeholder:t.notePlaceholder,value:N.note,onChange:e=>k({...N,note:e.target.value}),className:"w-full rounded border border-plexus-border bg-plexus-bg px-3 py-2 text-sm text-plexus-text outline-none focus:border-plexus-accent"})]}),S&&(0,a.jsx)("div",{className:"rounded border border-plexus-err/40 bg-plexus-err/10 px-3 py-2 text-xs text-plexus-err",children:S}),(0,a.jsxs)("div",{className:"flex justify-end gap-2 border-t border-plexus-border pt-3",children:[(0,a.jsx)(n.Button,{type:"button",variant:"ghost",size:"sm",onClick:M,children:t.cancel}),(0,a.jsx)(n.Button,{type:"submit",variant:"primary",size:"sm",disabled:w,children:w?t.adding:t.addAgent})]})]})})}),(0,a.jsxs)("div",{className:"mt-5",children:[f&&(0,a.jsx)("div",{className:"text-xs text-plexus-text-3",children:t.loading}),!f&&0===s.length&&(0,a.jsx)("div",{className:"rounded border border-dashed border-plexus-border bg-plexus-bg/40 px-4 py-6 text-center text-xs text-plexus-text-3",children:t.noCustom}),s.length>0&&(0,a.jsxs)("div",{className:"overflow-x-auto rounded border border-plexus-border",children:[(0,a.jsxs)("div",{className:"grid min-w-[720px] grid-cols-[1fr_130px_180px] gap-x-4 border-b border-plexus-border bg-plexus-surface-2/40 px-4 py-2.5 text-[11px] uppercase tracking-[0.10em] text-plexus-text-3",children:[(0,a.jsx)("div",{children:t.agent}),(0,a.jsx)("div",{className:"text-right",children:t.lite}),(0,a.jsx)("div",{className:"text-right",children:t.action})]}),s.map(e=>(0,a.jsxs)("div",{className:"grid min-w-[720px] grid-cols-[1fr_130px_180px] gap-x-4 border-b border-plexus-border/60 px-4 py-3 text-sm last:border-0",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"font-semibold text-plexus-text",children:e.displayName}),(0,a.jsx)("div",{className:"font-mono text-[11px] text-plexus-text-3",children:e.id}),(0,a.jsxs)("div",{className:"mt-1 flex items-center gap-1.5 font-mono text-[11px] text-plexus-text-2",children:[(0,a.jsx)(c.A,{className:"h-3 w-3",strokeWidth:1.5}),e.instructionFile]}),e.note&&(0,a.jsx)("div",{className:"mt-1 text-[11px] italic text-plexus-text-3",children:e.note})]}),(0,a.jsx)("div",{className:"text-right",children:(0,a.jsx)(r.E,{variant:"native",children:t.instructionsOnly})}),(0,a.jsxs)("div",{className:"flex justify-end gap-2 text-right",children:[(0,a.jsx)(b,{agent:e,copy:t}),(0,a.jsxs)(n.Button,{variant:"ghost",size:"sm",onClick:()=>_(e.id),disabled:w,children:[(0,a.jsx)(x.A,{className:"h-3.5 w-3.5",strokeWidth:1.5}),t.remove]})]})]},e.id))]})]})]})}function b({agent:e,copy:t}){let[s,l]=(0,m.useState)(!1),[i,o]=(0,m.useState)(!1),[c,x]=(0,m.useState)(!1),[g,h]=(0,m.useState)(""),[f,v]=(0,m.useState)(!1),[y,j]=(0,m.useState)(null);async function N(){v(!0),j(null);try{let s=await fetch(`/api/custom-agents/${encodeURIComponent(e.id)}/file`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({content:g})}),a=await s.json();if(!a.ok)return void j(a.message??t.saveFailed);x(!0),j(a.backup?t.savedBackup(a.backup):t.saved)}catch(e){j(e.message)}finally{v(!1)}}return(0,m.useEffect)(()=>{s&&!i&&(v(!0),fetch(`/api/custom-agents/${encodeURIComponent(e.id)}/file`).then(e=>e.json()).then(e=>{e.ok?(h(e.content??""),x(!!e.exists)):j(e.message??t.readFailed)}).catch(e=>j(e.message)).finally(()=>{o(!0),v(!1)}))},[s,i,e.id]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(n.Button,{variant:"ghost",size:"sm",onClick:()=>l(!0),children:[(0,a.jsx)(u.A,{className:"h-3.5 w-3.5",strokeWidth:1.5}),t.edit]}),s&&(0,a.jsx)("div",{role:"presentation",className:"fixed inset-0 z-50 flex cursor-default items-center justify-center bg-black/70 p-6",onClick:()=>l(!1),children:(0,a.jsxs)("div",{className:"flex h-[80vh] w-[80vw] max-w-5xl cursor-default flex-col overflow-hidden rounded-md border border-plexus-border bg-plexus-surface text-left shadow-lg",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between border-b border-plexus-border px-5 py-3",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(r.E,{variant:c?"synced":"native",children:c?t.editing:t.newFile}),(0,a.jsx)("span",{className:"text-sm font-semibold text-plexus-text",children:e.displayName})]}),(0,a.jsx)("code",{className:"mt-1 block truncate font-mono text-xs text-plexus-text-3",children:e.instructionFile})]}),(0,a.jsx)("button",{type:"button","aria-label":"Close",onClick:()=>l(!1),className:"text-plexus-text-3 hover:text-plexus-text",children:(0,a.jsx)(d.A,{className:"h-4 w-4",strokeWidth:1.5})})]}),(0,a.jsx)("div",{className:"border-b border-plexus-border bg-plexus-surface-2/40 px-5 py-2 text-xs text-plexus-text-3",children:t.snapshotNotice}),y&&(0,a.jsx)("div",{className:"border-b border-plexus-border bg-plexus-surface-2 px-5 py-2 text-xs text-plexus-text-2",children:y}),(0,a.jsx)("textarea",{className:"flex-1 resize-none bg-plexus-bg p-4 font-mono text-xs text-plexus-text outline-none",value:g,onChange:e=>h(e.target.value)}),(0,a.jsxs)("div",{className:"flex items-center justify-end gap-2 border-t border-plexus-border px-5 py-3",children:[(0,a.jsx)(n.Button,{variant:"ghost",size:"sm",onClick:()=>l(!1),children:t.close}),(0,a.jsxs)(n.Button,{variant:"primary",size:"sm",onClick:N,disabled:f,children:[f&&(0,a.jsx)(p.A,{className:"h-3.5 w-3.5 animate-spin",strokeWidth:1.5}),f?t.saving:t.save]})]})]})})]})}},6197:(e,t,s)=>{"use strict";s.d(t,{E:()=>n,m:()=>i});var a=s(4568),l=s(7483);let r=(0,s(1397).F)("inline-flex items-center gap-1 rounded-sm px-2 h-5 text-[11px] font-medium tracking-[0.01em]",{variants:{variant:{team:"bg-plexus-info/15 text-plexus-info",personal:"bg-plexus-accent-faint text-plexus-accent",synced:"bg-plexus-ok/15 text-plexus-ok",divergent:"bg-plexus-warn/15 text-plexus-warn",native:"bg-plexus-text-3/15 text-plexus-text-3",beta:"bg-plexus-accent-faint text-plexus-accent border border-plexus-accent/25",danger:"bg-plexus-err/13 text-plexus-err",outline:"border border-plexus-border text-plexus-text-2"}},defaultVariants:{variant:"outline"}});function n({className:e,variant:t,...s}){return(0,a.jsx)("span",{className:(0,l.cn)(r({variant:t}),e),...s})}function i({className:e,tone:t="ok"}){return(0,a.jsx)("span",{className:(0,l.cn)("inline-block h-1.5 w-1.5 rounded-full",{ok:"bg-plexus-ok",warn:"bg-plexus-warn",err:"bg-plexus-err",info:"bg-plexus-info",accent:"bg-plexus-accent",mute:"bg-plexus-text-3"}[t],e)})}},6439:(e,t,s)=>{"use strict";s.d(t,{LanguageProvider:()=>c,o:()=>x});var a=s(4568);let l="plexus.locale";function r(e){if(!e)return null;let t=e.toLowerCase();return"zh"===t||t.startsWith("zh-")?"zh":"en"===t||t.startsWith("en-")?"en":null}var n=s(9748),i=s(7620);let o=(0,i.createContext)(null);function d(e){window.localStorage.setItem(l,e),document.cookie=`plexus-locale=${e}; path=/; max-age=31536000; samesite=lax`}function c({children:e,initialLocale:t}){let s=(0,n.useRouter)(),[x,u]=(0,i.useState)(t);(0,i.useEffect)(()=>{var e;let a,n=r(window.localStorage.getItem(l))??t??(a=(Array.isArray(e=window.navigator.languages??window.navigator.language)?e.map((e,t)=>({value:e,q:1,index:t})):"string"==typeof e?e.split(",").map((e,t)=>{let[s="",...a]=e.trim().split(";"),l=a.find(e=>e.trim().startsWith("q=")),r=l?Number(l.trim().slice(2)):1;return{value:s,q:Number.isFinite(r)?r:1,index:t}}):[]).map(e=>({...e,locale:r(e.value)})).filter(e=>null!==e.locale).sort((e,t)=>t.q-e.q||e.index-t.index),a[0]?.locale??"en");if(n!==t){d(n),s.refresh();return}d(n),u(t)},[t,s]);let p=(0,i.useMemo)(()=>({locale:x,setLocale(e){d(e),s.refresh()},toggleLocale(){d("zh"===x?"en":"zh"),s.refresh()}}),[x,s]);return(0,a.jsx)(o.Provider,{value:p,children:e})}function x(){let e=(0,i.useContext)(o);if(!e)throw Error("useLanguage must be used inside LanguageProvider");return e}},6969:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(9789).A)("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]])},7294:(e,t,s)=>{"use strict";s.d(t,{Z:()=>n});var a=s(4568),l=s(7483),r=s(7620);let n=(0,r.forwardRef)(({className:e,...t},s)=>(0,a.jsx)("div",{ref:s,className:(0,l.cn)("rounded-md border border-plexus-border bg-plexus-surface","transition-colors duration-plexus-normal ease-plexus-out",e),...t}));n.displayName="Card",(0,r.forwardRef)(({className:e,...t},s)=>(0,a.jsx)(n,{ref:s,className:(0,l.cn)("hover:border-plexus-border-strong hover:-translate-y-px",e),...t})).displayName="CardHover"},7378:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(9789).A)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},7483:(e,t,s)=>{"use strict";s.d(t,{cn:()=>r});var a=s(9917),l=s(2809);function r(...e){return(0,l.QP)((0,a.$)(e))}},7788:(e,t,s)=>{"use strict";s.d(t,{Button:()=>d});var a=s(4568),l=s(7483),r=s(8347),n=s(1397),i=s(7620);let o=(0,n.F)((0,l.cn)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded font-medium","transition-colors duration-plexus-normal ease-plexus-out","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-plexus-accent/50 focus-visible:ring-offset-1 focus-visible:ring-offset-plexus-bg","disabled:pointer-events-none disabled:opacity-50"),{variants:{variant:{primary:"bg-plexus-accent text-[#1a1a17] hover:bg-plexus-accent-2 border border-plexus-accent",secondary:"bg-plexus-surface-2 text-plexus-text border border-plexus-border hover:bg-plexus-surface hover:border-plexus-border-strong",ghost:"bg-transparent text-plexus-text-2 hover:bg-plexus-surface-2 hover:text-plexus-text border border-transparent",danger:"bg-transparent text-plexus-err border border-plexus-err/35 hover:bg-plexus-err/10","danger-solid":"bg-plexus-err text-white border border-plexus-err hover:bg-plexus-err/90"},size:{default:"h-9 px-3.5 text-sm",sm:"h-7 px-2.5 text-xs",lg:"h-10 px-4 text-sm",icon:"h-9 w-9 p-0"}},defaultVariants:{variant:"secondary",size:"default"}}),d=(0,i.forwardRef)(({className:e,variant:t,size:s,asChild:n=!1,type:i="button",...d},c)=>{let x=n?r.DX:"button";return(0,a.jsx)(x,{ref:c,type:n?void 0:i,className:(0,l.cn)(o({variant:t,size:s}),e),...d})});d.displayName="Button"},8874:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(9789).A)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},9250:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(9789).A)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]])},9305:(e,t,s)=>{Promise.resolve().then(s.bind(s,5392)),Promise.resolve().then(s.bind(s,1405)),Promise.resolve().then(s.bind(s,7788)),Promise.resolve().then(s.bind(s,4228)),Promise.resolve().then(s.t.bind(s,5587,23))},9748:(e,t,s)=>{"use strict";var a=s(9796);s.o(a,"usePathname")&&s.d(t,{usePathname:function(){return a.usePathname}}),s.o(a,"useRouter")&&s.d(t,{useRouter:function(){return a.useRouter}})}},e=>{e.O(0,[4399,5587,587,1968,7358],()=>e(e.s=9305)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9501],{3035:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(9789).A)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]])},3932:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(9789).A)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},4895:(e,t,s)=>{Promise.resolve().then(s.bind(s,8257))},6197:(e,t,s)=>{"use strict";s.d(t,{E:()=>n,m:()=>o});var r=s(4568),a=s(7483);let l=(0,s(1397).F)("inline-flex items-center gap-1 rounded-sm px-2 h-5 text-[11px] font-medium tracking-[0.01em]",{variants:{variant:{team:"bg-plexus-info/15 text-plexus-info",personal:"bg-plexus-accent-faint text-plexus-accent",synced:"bg-plexus-ok/15 text-plexus-ok",divergent:"bg-plexus-warn/15 text-plexus-warn",native:"bg-plexus-text-3/15 text-plexus-text-3",beta:"bg-plexus-accent-faint text-plexus-accent border border-plexus-accent/25",danger:"bg-plexus-err/13 text-plexus-err",outline:"border border-plexus-border text-plexus-text-2"}},defaultVariants:{variant:"outline"}});function n({className:e,variant:t,...s}){return(0,r.jsx)("span",{className:(0,a.cn)(l({variant:t}),e),...s})}function o({className:e,tone:t="ok"}){return(0,r.jsx)("span",{className:(0,a.cn)("inline-block h-1.5 w-1.5 rounded-full",{ok:"bg-plexus-ok",warn:"bg-plexus-warn",err:"bg-plexus-err",info:"bg-plexus-info",accent:"bg-plexus-accent",mute:"bg-plexus-text-3"}[t],e)})}},7294:(e,t,s)=>{"use strict";s.d(t,{Z:()=>n});var r=s(4568),a=s(7483),l=s(7620);let n=(0,l.forwardRef)(({className:e,...t},s)=>(0,r.jsx)("div",{ref:s,className:(0,a.cn)("rounded-md border border-plexus-border bg-plexus-surface","transition-colors duration-plexus-normal ease-plexus-out",e),...t}));n.displayName="Card",(0,l.forwardRef)(({className:e,...t},s)=>(0,r.jsx)(n,{ref:s,className:(0,a.cn)("hover:border-plexus-border-strong hover:-translate-y-px",e),...t})).displayName="CardHover"},7378:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(9789).A)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},7483:(e,t,s)=>{"use strict";s.d(t,{cn:()=>l});var r=s(9917),a=s(2809);function l(...e){return(0,a.QP)((0,r.$)(e))}},7788:(e,t,s)=>{"use strict";s.d(t,{Button:()=>d});var r=s(4568),a=s(7483),l=s(8347),n=s(1397),o=s(7620);let i=(0,n.F)((0,a.cn)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded font-medium","transition-colors duration-plexus-normal ease-plexus-out","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-plexus-accent/50 focus-visible:ring-offset-1 focus-visible:ring-offset-plexus-bg","disabled:pointer-events-none disabled:opacity-50"),{variants:{variant:{primary:"bg-plexus-accent text-[#1a1a17] hover:bg-plexus-accent-2 border border-plexus-accent",secondary:"bg-plexus-surface-2 text-plexus-text border border-plexus-border hover:bg-plexus-surface hover:border-plexus-border-strong",ghost:"bg-transparent text-plexus-text-2 hover:bg-plexus-surface-2 hover:text-plexus-text border border-transparent",danger:"bg-transparent text-plexus-err border border-plexus-err/35 hover:bg-plexus-err/10","danger-solid":"bg-plexus-err text-white border border-plexus-err hover:bg-plexus-err/90"},size:{default:"h-9 px-3.5 text-sm",sm:"h-7 px-2.5 text-xs",lg:"h-10 px-4 text-sm",icon:"h-9 w-9 p-0"}},defaultVariants:{variant:"secondary",size:"default"}}),d=(0,o.forwardRef)(({className:e,variant:t,size:s,asChild:n=!1,type:o="button",...d},c)=>{let x=n?l.DX:"button";return(0,r.jsx)(x,{ref:c,type:n?void 0:o,className:(0,a.cn)(i({variant:t,size:s}),e),...d})});d.displayName="Button"},8257:(e,t,s)=>{"use strict";s.d(t,{SkillsEditor:()=>p});var r=s(4568),a=s(6197),l=s(7788),n=s(7294),o=s(8742),i=s(3932),d=s(7378),c=s(3035),x=s(7620);let u={"claude-code":"Claude",cursor:"Cursor",codex:"Codex","gemini-cli":"Gemini","qwen-code":"Qwen","factory-droid":"Droid"};function p({initial:e,agents:t,displayNames:s,installed:h}){let[m,b]=(0,x.useState)(e),[f,g]=(0,x.useState)(null),[y,v]=(0,x.useState)(!1),[j,k]=(0,x.useState)({id:"",name:"",description:"",body:"",layer:"personal",enabledAgents:t}),[w,N]=(0,x.useState)(null),[C,S]=(0,x.useState)("");async function A(){let e=await fetch("/api/skills/effective");b((await e.json()).rows??[])}async function _(e,t,s){if("team"!==e.authority){g(`${e.id}:${t}`);try{let r=await fetch(`/api/skills/${encodeURIComponent(e.id)}/toggle`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({agent:t,enabled:s})}),a=await r.json();a.ok||N(`Error: ${a.message}`),await A()}finally{g(null)}}}async function E(e){if("personal"===e.authority&&confirm(`Delete skill "${e.id}"?`)){g(e.id);try{await fetch(`/api/skills/${encodeURIComponent(e.id)}?layer=personal`,{method:"DELETE"}),await fetch("/api/sync",{method:"POST"}),await A()}finally{g(null)}}}async function L(){if(!j.id||!j.name)return void N("id and name are required");g("__new__");try{let e=await fetch("/api/skills",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(j)});if(!e.ok)return void N(await e.text());await fetch("/api/sync",{method:"POST"}),k({id:"",name:"",description:"",body:"",layer:"personal",enabledAgents:t}),v(!1),N(null),await A()}finally{g(null)}}let P=C?m.filter(e=>e.id.toLowerCase().includes(C.toLowerCase())||e.name.toLowerCase().includes(C.toLowerCase())):m;return(0,r.jsxs)("div",{className:"space-y-5",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,r.jsxs)("div",{className:"text-xs tracking-[0.02em] text-plexus-text-3",children:[m.length," unique skill",1===m.length?"":"s"," \xb7"," ",m.filter(e=>"personal"===e.authority).length," in personal store \xb7"," ",m.filter(e=>"native"===e.authority).length," native-only"]}),(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(o.A,{className:"-translate-y-1/2 absolute top-1/2 left-2.5 h-3.5 w-3.5 text-plexus-text-mute",strokeWidth:1.5}),(0,r.jsx)("input",{className:"h-8 w-52 rounded border border-plexus-border bg-plexus-surface-2 pr-3 pl-8 text-xs placeholder:text-plexus-text-mute focus:border-plexus-accent focus:outline-none",placeholder:"Filter id or name…",value:C,onChange:e=>S(e.target.value)})]}),w&&(0,r.jsx)("span",{className:"text-xs text-plexus-err",children:w}),(0,r.jsxs)(l.Button,{variant:y?"ghost":"secondary",size:"sm",onClick:()=>v(!y),children:[y?(0,r.jsx)(i.A,{className:"h-3.5 w-3.5",strokeWidth:1.5}):(0,r.jsx)(d.A,{className:"h-3.5 w-3.5",strokeWidth:1.5}),y?"Cancel":"Add Skill"]})]})]}),y&&(0,r.jsxs)(n.Z,{className:"space-y-3 border-l-[3px] border-l-plexus-accent p-4",children:[(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,r.jsx)("input",{className:"h-9 rounded border border-plexus-border bg-plexus-bg px-3 text-sm placeholder:text-plexus-text-mute focus:border-plexus-accent focus:outline-none",placeholder:"id (folder-safe, e.g. code-review)",value:j.id,onChange:e=>k({...j,id:e.target.value.replace(/[^a-z0-9-_]/gi,"-")})}),(0,r.jsx)("input",{className:"h-9 rounded border border-plexus-border bg-plexus-bg px-3 text-sm placeholder:text-plexus-text-mute focus:border-plexus-accent focus:outline-none",placeholder:"name (display)",value:j.name,onChange:e=>k({...j,name:e.target.value})})]}),(0,r.jsx)("input",{className:"h-9 w-full rounded border border-plexus-border bg-plexus-bg px-3 text-sm placeholder:text-plexus-text-mute focus:border-plexus-accent focus:outline-none",placeholder:"description (optional)",value:j.description,onChange:e=>k({...j,description:e.target.value})}),(0,r.jsx)("textarea",{className:"h-48 w-full rounded border border-plexus-border bg-plexus-bg px-3 py-2 font-mono text-xs placeholder:text-plexus-text-mute focus:border-plexus-accent focus:outline-none",placeholder:"SKILL.md body (markdown). Frontmatter is generated automatically.",value:j.body,onChange:e=>k({...j,body:e.target.value})}),(0,r.jsx)(l.Button,{variant:"primary",size:"sm",onClick:L,disabled:"__new__"===f,children:"Save and sync"})]}),(0,r.jsx)(n.Z,{className:"overflow-hidden",children:(0,r.jsxs)("table",{className:"w-full border-collapse text-sm",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{className:"border-b border-plexus-border text-left text-[11px] uppercase tracking-[0.10em] text-plexus-text-3",children:[(0,r.jsx)("th",{className:"px-4 py-3 font-medium",children:"ID"}),(0,r.jsx)("th",{className:"px-4 py-3 font-medium",children:"Name"}),(0,r.jsx)("th",{className:"px-4 py-3 font-medium",children:"Layer"}),t.map(e=>(0,r.jsx)("th",{className:"px-2 py-3 text-center font-medium",children:s[e]??u[e]??e},e)),(0,r.jsx)("th",{className:"px-4 py-3"})]})}),(0,r.jsxs)("tbody",{children:[0===P.length&&(0,r.jsx)("tr",{children:(0,r.jsx)("td",{colSpan:4+t.length,className:"px-4 py-10 text-center text-sm text-plexus-text-3",children:0===m.length?"No skills found in any agent or in your store.":"No skills match your filter."})}),P.map(e=>{var l;return(0,r.jsxs)("tr",{className:"border-b border-plexus-border/60 last:border-0 hover:bg-plexus-surface-2/40",children:[(0,r.jsx)("td",{className:"px-4 py-3 font-mono text-[13px] text-plexus-text",children:e.id}),(0,r.jsx)("td",{className:"px-4 py-3 text-plexus-text-2",children:e.name}),(0,r.jsx)("td",{className:"px-4 py-3",children:(0,r.jsx)(a.E,{variant:"team"===(l=e.authority)?"team":"personal"===l?"personal":"native",children:e.authority})}),t.map(t=>{let a=e.effectiveAgents.includes(t),l=f===`${e.id}:${t}`,n="team"===e.authority||!h[t];return(0,r.jsx)("td",{className:"px-2 py-3 text-center",children:(0,r.jsx)("input",{type:"checkbox",checked:a,disabled:n||l,onChange:s=>_(e,t,s.target.checked),className:"h-4 w-4 cursor-pointer accent-plexus-accent disabled:cursor-not-allowed disabled:opacity-40",title:h[t]?"":`${s[t]} not installed`})},t)}),(0,r.jsx)("td",{className:"px-4 py-3 text-right",children:"personal"===e.authority&&(0,r.jsx)("button",{type:"button",onClick:()=>E(e),disabled:f===e.id,className:"text-plexus-text-3 hover:text-plexus-err disabled:opacity-50",title:"Delete skill",children:(0,r.jsx)(c.A,{className:"h-3.5 w-3.5",strokeWidth:1.5})})})]},e.id)})]})]})}),(0,r.jsxs)(n.Z,{className:"space-y-2 px-4 py-3 text-xs leading-relaxed text-plexus-text-3",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)(a.E,{variant:"native",children:"native"})," skills are still only in the agent's own folder. Toggling promotes them into your personal Plexus store. ",(0,r.jsx)(a.E,{variant:"team",children:"team"})," ","skills are read-only here — propose changes via PR."]}),(0,r.jsxs)("details",{children:[(0,r.jsx)("summary",{className:"cursor-pointer text-plexus-text-2 hover:text-plexus-text",children:"How does checking a box change the file system?"}),(0,r.jsxs)("div",{className:"mt-2 space-y-2 leading-relaxed",children:[(0,r.jsxs)("p",{children:["The skill folder is written into"," ",(0,r.jsx)("code",{className:"rounded bg-plexus-surface-2 px-1 py-0.5 font-mono text-[11px]",children:"~/.config/plexus/personal/skills/<id>/"})," ","(the canonical Plexus copy). Each enabled agent gets a symlink from its own skills directory to that folder, so all agents read the same SKILL.md."]}),(0,r.jsx)("p",{children:"Toggling a skill off removes the symlink from that agent only; the Plexus copy stays. Other agents still see it."}),(0,r.jsx)("p",{children:"Every toggle takes a backup snapshot first."})]})]})]})]})}},8742:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(9789).A)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]])}},e=>{e.O(0,[4399,587,1968,7358],()=>e(e.s=4895)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9501],{2148:(e,t,s)=>{Promise.resolve().then(s.bind(s,8257))},3035:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(9789).A)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]])},3932:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(9789).A)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},6197:(e,t,s)=>{"use strict";s.d(t,{E:()=>n,m:()=>o});var r=s(4568),a=s(7483);let l=(0,s(1397).F)("inline-flex items-center gap-1 rounded-sm px-2 h-5 text-[11px] font-medium tracking-[0.01em]",{variants:{variant:{team:"bg-plexus-info/15 text-plexus-info",personal:"bg-plexus-accent-faint text-plexus-accent",synced:"bg-plexus-ok/15 text-plexus-ok",divergent:"bg-plexus-warn/15 text-plexus-warn",native:"bg-plexus-text-3/15 text-plexus-text-3",beta:"bg-plexus-accent-faint text-plexus-accent border border-plexus-accent/25",danger:"bg-plexus-err/13 text-plexus-err",outline:"border border-plexus-border text-plexus-text-2"}},defaultVariants:{variant:"outline"}});function n({className:e,variant:t,...s}){return(0,r.jsx)("span",{className:(0,a.cn)(l({variant:t}),e),...s})}function o({className:e,tone:t="ok"}){return(0,r.jsx)("span",{className:(0,a.cn)("inline-block h-1.5 w-1.5 rounded-full",{ok:"bg-plexus-ok",warn:"bg-plexus-warn",err:"bg-plexus-err",info:"bg-plexus-info",accent:"bg-plexus-accent",mute:"bg-plexus-text-3"}[t],e)})}},7294:(e,t,s)=>{"use strict";s.d(t,{Z:()=>n});var r=s(4568),a=s(7483),l=s(7620);let n=(0,l.forwardRef)(({className:e,...t},s)=>(0,r.jsx)("div",{ref:s,className:(0,a.cn)("rounded-md border border-plexus-border bg-plexus-surface","transition-colors duration-plexus-normal ease-plexus-out",e),...t}));n.displayName="Card",(0,l.forwardRef)(({className:e,...t},s)=>(0,r.jsx)(n,{ref:s,className:(0,a.cn)("hover:border-plexus-border-strong hover:-translate-y-px",e),...t})).displayName="CardHover"},7378:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(9789).A)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},7483:(e,t,s)=>{"use strict";s.d(t,{cn:()=>l});var r=s(9917),a=s(2809);function l(...e){return(0,a.QP)((0,r.$)(e))}},7788:(e,t,s)=>{"use strict";s.d(t,{Button:()=>d});var r=s(4568),a=s(7483),l=s(8347),n=s(1397),o=s(7620);let i=(0,n.F)((0,a.cn)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded font-medium","transition-colors duration-plexus-normal ease-plexus-out","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-plexus-accent/50 focus-visible:ring-offset-1 focus-visible:ring-offset-plexus-bg","disabled:pointer-events-none disabled:opacity-50"),{variants:{variant:{primary:"bg-plexus-accent text-[#1a1a17] hover:bg-plexus-accent-2 border border-plexus-accent",secondary:"bg-plexus-surface-2 text-plexus-text border border-plexus-border hover:bg-plexus-surface hover:border-plexus-border-strong",ghost:"bg-transparent text-plexus-text-2 hover:bg-plexus-surface-2 hover:text-plexus-text border border-transparent",danger:"bg-transparent text-plexus-err border border-plexus-err/35 hover:bg-plexus-err/10","danger-solid":"bg-plexus-err text-white border border-plexus-err hover:bg-plexus-err/90"},size:{default:"h-9 px-3.5 text-sm",sm:"h-7 px-2.5 text-xs",lg:"h-10 px-4 text-sm",icon:"h-9 w-9 p-0"}},defaultVariants:{variant:"secondary",size:"default"}}),d=(0,o.forwardRef)(({className:e,variant:t,size:s,asChild:n=!1,type:o="button",...d},c)=>{let x=n?l.DX:"button";return(0,r.jsx)(x,{ref:c,type:n?void 0:o,className:(0,a.cn)(i({variant:t,size:s}),e),...d})});d.displayName="Button"},8257:(e,t,s)=>{"use strict";s.d(t,{SkillsEditor:()=>p});var r=s(4568),a=s(6197),l=s(7788),n=s(7294),o=s(8742),i=s(3932),d=s(7378),c=s(3035),x=s(7620);let u={"claude-code":"Claude",cursor:"Cursor",codex:"Codex","gemini-cli":"Gemini","qwen-code":"Qwen","factory-droid":"Droid"};function p({initial:e,agents:t,displayNames:s,installed:h}){let[m,b]=(0,x.useState)(e),[f,g]=(0,x.useState)(null),[y,v]=(0,x.useState)(!1),[j,k]=(0,x.useState)({id:"",name:"",description:"",body:"",layer:"personal",enabledAgents:t}),[w,N]=(0,x.useState)(null),[C,S]=(0,x.useState)("");async function A(){let e=await fetch("/api/skills/effective");b((await e.json()).rows??[])}async function _(e,t,s){if("team"!==e.authority){g(`${e.id}:${t}`);try{let r=await fetch(`/api/skills/${encodeURIComponent(e.id)}/toggle`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({agent:t,enabled:s})}),a=await r.json();a.ok||N(`Error: ${a.message}`),await A()}finally{g(null)}}}async function E(e){if("personal"===e.authority&&confirm(`Delete skill "${e.id}"?`)){g(e.id);try{await fetch(`/api/skills/${encodeURIComponent(e.id)}?layer=personal`,{method:"DELETE"}),await fetch("/api/sync",{method:"POST"}),await A()}finally{g(null)}}}async function L(){if(!j.id||!j.name)return void N("id and name are required");g("__new__");try{let e=await fetch("/api/skills",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(j)});if(!e.ok)return void N(await e.text());await fetch("/api/sync",{method:"POST"}),k({id:"",name:"",description:"",body:"",layer:"personal",enabledAgents:t}),v(!1),N(null),await A()}finally{g(null)}}let P=C?m.filter(e=>e.id.toLowerCase().includes(C.toLowerCase())||e.name.toLowerCase().includes(C.toLowerCase())):m;return(0,r.jsxs)("div",{className:"space-y-5",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,r.jsxs)("div",{className:"text-xs tracking-[0.02em] text-plexus-text-3",children:[m.length," unique skill",1===m.length?"":"s"," \xb7"," ",m.filter(e=>"personal"===e.authority).length," in personal store \xb7"," ",m.filter(e=>"native"===e.authority).length," native-only"]}),(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(o.A,{className:"-translate-y-1/2 absolute top-1/2 left-2.5 h-3.5 w-3.5 text-plexus-text-mute",strokeWidth:1.5}),(0,r.jsx)("input",{className:"h-8 w-52 rounded border border-plexus-border bg-plexus-surface-2 pr-3 pl-8 text-xs placeholder:text-plexus-text-mute focus:border-plexus-accent focus:outline-none",placeholder:"Filter id or name…",value:C,onChange:e=>S(e.target.value)})]}),w&&(0,r.jsx)("span",{className:"text-xs text-plexus-err",children:w}),(0,r.jsxs)(l.Button,{variant:y?"ghost":"secondary",size:"sm",onClick:()=>v(!y),children:[y?(0,r.jsx)(i.A,{className:"h-3.5 w-3.5",strokeWidth:1.5}):(0,r.jsx)(d.A,{className:"h-3.5 w-3.5",strokeWidth:1.5}),y?"Cancel":"Add Skill"]})]})]}),y&&(0,r.jsxs)(n.Z,{className:"space-y-3 border-l-[3px] border-l-plexus-accent p-4",children:[(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,r.jsx)("input",{className:"h-9 rounded border border-plexus-border bg-plexus-bg px-3 text-sm placeholder:text-plexus-text-mute focus:border-plexus-accent focus:outline-none",placeholder:"id (folder-safe, e.g. code-review)",value:j.id,onChange:e=>k({...j,id:e.target.value.replace(/[^a-z0-9-_]/gi,"-")})}),(0,r.jsx)("input",{className:"h-9 rounded border border-plexus-border bg-plexus-bg px-3 text-sm placeholder:text-plexus-text-mute focus:border-plexus-accent focus:outline-none",placeholder:"name (display)",value:j.name,onChange:e=>k({...j,name:e.target.value})})]}),(0,r.jsx)("input",{className:"h-9 w-full rounded border border-plexus-border bg-plexus-bg px-3 text-sm placeholder:text-plexus-text-mute focus:border-plexus-accent focus:outline-none",placeholder:"description (optional)",value:j.description,onChange:e=>k({...j,description:e.target.value})}),(0,r.jsx)("textarea",{className:"h-48 w-full rounded border border-plexus-border bg-plexus-bg px-3 py-2 font-mono text-xs placeholder:text-plexus-text-mute focus:border-plexus-accent focus:outline-none",placeholder:"SKILL.md body (markdown). Frontmatter is generated automatically.",value:j.body,onChange:e=>k({...j,body:e.target.value})}),(0,r.jsx)(l.Button,{variant:"primary",size:"sm",onClick:L,disabled:"__new__"===f,children:"Save and sync"})]}),(0,r.jsx)(n.Z,{className:"overflow-hidden",children:(0,r.jsxs)("table",{className:"w-full border-collapse text-sm",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{className:"border-b border-plexus-border text-left text-[11px] uppercase tracking-[0.10em] text-plexus-text-3",children:[(0,r.jsx)("th",{className:"px-4 py-3 font-medium",children:"ID"}),(0,r.jsx)("th",{className:"px-4 py-3 font-medium",children:"Name"}),(0,r.jsx)("th",{className:"px-4 py-3 font-medium",children:"Layer"}),t.map(e=>(0,r.jsx)("th",{className:"px-2 py-3 text-center font-medium",children:s[e]??u[e]??e},e)),(0,r.jsx)("th",{className:"px-4 py-3"})]})}),(0,r.jsxs)("tbody",{children:[0===P.length&&(0,r.jsx)("tr",{children:(0,r.jsx)("td",{colSpan:4+t.length,className:"px-4 py-10 text-center text-sm text-plexus-text-3",children:0===m.length?"No skills found in any agent or in your store.":"No skills match your filter."})}),P.map(e=>{var l;return(0,r.jsxs)("tr",{className:"border-b border-plexus-border/60 last:border-0 hover:bg-plexus-surface-2/40",children:[(0,r.jsx)("td",{className:"px-4 py-3 font-mono text-[13px] text-plexus-text",children:e.id}),(0,r.jsx)("td",{className:"px-4 py-3 text-plexus-text-2",children:e.name}),(0,r.jsx)("td",{className:"px-4 py-3",children:(0,r.jsx)(a.E,{variant:"team"===(l=e.authority)?"team":"personal"===l?"personal":"native",children:e.authority})}),t.map(t=>{let a=e.effectiveAgents.includes(t),l=f===`${e.id}:${t}`,n="team"===e.authority||!h[t];return(0,r.jsx)("td",{className:"px-2 py-3 text-center",children:(0,r.jsx)("input",{type:"checkbox",checked:a,disabled:n||l,onChange:s=>_(e,t,s.target.checked),className:"h-4 w-4 cursor-pointer accent-plexus-accent disabled:cursor-not-allowed disabled:opacity-40",title:h[t]?"":`${s[t]} not installed`})},t)}),(0,r.jsx)("td",{className:"px-4 py-3 text-right",children:"personal"===e.authority&&(0,r.jsx)("button",{type:"button",onClick:()=>E(e),disabled:f===e.id,className:"text-plexus-text-3 hover:text-plexus-err disabled:opacity-50",title:"Delete skill",children:(0,r.jsx)(c.A,{className:"h-3.5 w-3.5",strokeWidth:1.5})})})]},e.id)})]})]})}),(0,r.jsxs)(n.Z,{className:"space-y-2 px-4 py-3 text-xs leading-relaxed text-plexus-text-3",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)(a.E,{variant:"native",children:"native"})," skills are still only in the agent's own folder. Toggling promotes them into your personal Plexus store. ",(0,r.jsx)(a.E,{variant:"team",children:"team"})," ","skills are read-only here — propose changes via PR."]}),(0,r.jsxs)("details",{children:[(0,r.jsx)("summary",{className:"cursor-pointer text-plexus-text-2 hover:text-plexus-text",children:"How does checking a box change the file system?"}),(0,r.jsxs)("div",{className:"mt-2 space-y-2 leading-relaxed",children:[(0,r.jsxs)("p",{children:["The skill folder is written into"," ",(0,r.jsx)("code",{className:"rounded bg-plexus-surface-2 px-1 py-0.5 font-mono text-[11px]",children:"~/.config/plexus/personal/skills/<id>/"})," ","(the canonical Plexus copy). Each enabled agent gets a symlink from its own skills directory to that folder, so all agents read the same SKILL.md."]}),(0,r.jsx)("p",{children:"Toggling a skill off removes the symlink from that agent only; the Plexus copy stays. Other agents still see it."}),(0,r.jsx)("p",{children:"Every toggle takes a backup snapshot first."})]})]})]})]})}},8742:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(9789).A)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]])}},e=>{e.O(0,[4399,587,1968,7358],()=>e(e.s=2148)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8898],{1279:(e,t,s)=>{Promise.resolve().then(s.bind(s,8484))},4110:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(9789).A)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},4725:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(9789).A)("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]])},6197:(e,t,s)=>{"use strict";s.d(t,{E:()=>n,m:()=>i});var r=s(4568),a=s(7483);let l=(0,s(1397).F)("inline-flex items-center gap-1 rounded-sm px-2 h-5 text-[11px] font-medium tracking-[0.01em]",{variants:{variant:{team:"bg-plexus-info/15 text-plexus-info",personal:"bg-plexus-accent-faint text-plexus-accent",synced:"bg-plexus-ok/15 text-plexus-ok",divergent:"bg-plexus-warn/15 text-plexus-warn",native:"bg-plexus-text-3/15 text-plexus-text-3",beta:"bg-plexus-accent-faint text-plexus-accent border border-plexus-accent/25",danger:"bg-plexus-err/13 text-plexus-err",outline:"border border-plexus-border text-plexus-text-2"}},defaultVariants:{variant:"outline"}});function n({className:e,variant:t,...s}){return(0,r.jsx)("span",{className:(0,a.cn)(l({variant:t}),e),...s})}function i({className:e,tone:t="ok"}){return(0,r.jsx)("span",{className:(0,a.cn)("inline-block h-1.5 w-1.5 rounded-full",{ok:"bg-plexus-ok",warn:"bg-plexus-warn",err:"bg-plexus-err",info:"bg-plexus-info",accent:"bg-plexus-accent",mute:"bg-plexus-text-3"}[t],e)})}},6439:(e,t,s)=>{"use strict";s.d(t,{LanguageProvider:()=>p,o:()=>d});var r=s(4568);let a="plexus.locale";function l(e){if(!e)return null;let t=e.toLowerCase();return"zh"===t||t.startsWith("zh-")?"zh":"en"===t||t.startsWith("en-")?"en":null}var n=s(9748),i=s(7620);let o=(0,i.createContext)(null);function u(e){window.localStorage.setItem(a,e),document.cookie=`plexus-locale=${e}; path=/; max-age=31536000; samesite=lax`}function p({children:e,initialLocale:t}){let s=(0,n.useRouter)(),[d,x]=(0,i.useState)(t);(0,i.useEffect)(()=>{var e;let r,n=l(window.localStorage.getItem(a))??t??(r=(Array.isArray(e=window.navigator.languages??window.navigator.language)?e.map((e,t)=>({value:e,q:1,index:t})):"string"==typeof e?e.split(",").map((e,t)=>{let[s="",...r]=e.trim().split(";"),a=r.find(e=>e.trim().startsWith("q=")),l=a?Number(a.trim().slice(2)):1;return{value:s,q:Number.isFinite(l)?l:1,index:t}}):[]).map(e=>({...e,locale:l(e.value)})).filter(e=>null!==e.locale).sort((e,t)=>t.q-e.q||e.index-t.index),r[0]?.locale??"en");if(n!==t){u(n),s.refresh();return}u(n),x(t)},[t,s]);let c=(0,i.useMemo)(()=>({locale:d,setLocale(e){u(e),s.refresh()},toggleLocale(){u("zh"===d?"en":"zh"),s.refresh()}}),[d,s]);return(0,r.jsx)(o.Provider,{value:c,children:e})}function d(){let e=(0,i.useContext)(o);if(!e)throw Error("useLanguage must be used inside LanguageProvider");return e}},7294:(e,t,s)=>{"use strict";s.d(t,{Z:()=>n});var r=s(4568),a=s(7483),l=s(7620);let n=(0,l.forwardRef)(({className:e,...t},s)=>(0,r.jsx)("div",{ref:s,className:(0,a.cn)("rounded-md border border-plexus-border bg-plexus-surface","transition-colors duration-plexus-normal ease-plexus-out",e),...t}));n.displayName="Card",(0,l.forwardRef)(({className:e,...t},s)=>(0,r.jsx)(n,{ref:s,className:(0,a.cn)("hover:border-plexus-border-strong hover:-translate-y-px",e),...t})).displayName="CardHover"},7483:(e,t,s)=>{"use strict";s.d(t,{cn:()=>l});var r=s(9917),a=s(2809);function l(...e){return(0,a.QP)((0,r.$)(e))}},7788:(e,t,s)=>{"use strict";s.d(t,{Button:()=>u});var r=s(4568),a=s(7483),l=s(8347),n=s(1397),i=s(7620);let o=(0,n.F)((0,a.cn)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded font-medium","transition-colors duration-plexus-normal ease-plexus-out","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-plexus-accent/50 focus-visible:ring-offset-1 focus-visible:ring-offset-plexus-bg","disabled:pointer-events-none disabled:opacity-50"),{variants:{variant:{primary:"bg-plexus-accent text-[#1a1a17] hover:bg-plexus-accent-2 border border-plexus-accent",secondary:"bg-plexus-surface-2 text-plexus-text border border-plexus-border hover:bg-plexus-surface hover:border-plexus-border-strong",ghost:"bg-transparent text-plexus-text-2 hover:bg-plexus-surface-2 hover:text-plexus-text border border-transparent",danger:"bg-transparent text-plexus-err border border-plexus-err/35 hover:bg-plexus-err/10","danger-solid":"bg-plexus-err text-white border border-plexus-err hover:bg-plexus-err/90"},size:{default:"h-9 px-3.5 text-sm",sm:"h-7 px-2.5 text-xs",lg:"h-10 px-4 text-sm",icon:"h-9 w-9 p-0"}},defaultVariants:{variant:"secondary",size:"default"}}),u=(0,i.forwardRef)(({className:e,variant:t,size:s,asChild:n=!1,type:i="button",...u},p)=>{let d=n?l.DX:"button";return(0,r.jsx)(d,{ref:p,type:n?void 0:i,className:(0,a.cn)(o({variant:t,size:s}),e),...u})});u.displayName="Button"},8484:(e,t,s)=>{"use strict";s.d(t,{TeamPanel:()=>v});var r=s(4568),a=s(6439),l=s(6197),n=s(7788),i=s(7294),o=s(9789);let u=(0,o.A)("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]),p=(0,o.A)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);var d=s(9250),x=s(4725);let c=(0,o.A)("book-open",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);var m=s(8874),h=s(4110),b=s(7620);let g="https://github.com/miniLV/agent-primer.git",f={en:{betaTitle:"Team workflow is in beta",betaBody:"Team subscription, shared baselines, and pull-based updates are already wired. PR proposal and conflict UX are still being refined.",starterLink:"View agent-primer starter repo",subscribedTo:"Subscribed to",upToDate:"Up-to-date",updateAvailable:e=>`${e??0} update${1===e?"":"s"} available`,pullUpdates:"Pull updates",pulling:"Pulling…",refresh:"Refresh",noSubscription:"No team subscription yet",noSubscriptionBody:"Paste a GitHub repo with Plexus team config. Plexus clones it into ~/.config/plexus/team/ and merges it below your personal layer at sync time.",starterTitle:"Recommended starter",starterBody:"agent-primer is a compact baseline for rules, MCP servers, and reusable skills. Use it as the first team repo, then customize through pull requests.",useStarter:"Use agent-primer",placeholder:g,join:"Join",joining:"Joining…",rules:"Rules",rulesPresent:"present",rulesMissing:"missing",mcp:"MCP",skills:"Skills",proposeTitle:"Propose to team",proposeBody:"To share a personal MCP server, rule, or skill with the rest of the team, copy it into the team repo and open a pull request.",steps:["Branch the team repo.","Copy files from ~/.config/plexus/personal/ into the same path under the team repo.","Open a pull request for review.","After merge, pull updates here and sync agents."]},zh:{betaTitle:"Team 工作流仍处于 beta",betaBody:"Team 订阅、共享基线和 pull 更新已经接好。PR proposal 和冲突处理体验还在打磨。",starterLink:"查看 agent-primer starter repo",subscribedTo:"当前订阅",upToDate:"已是最新",updateAvailable:e=>`有 ${e??0} 个更新可拉取`,pullUpdates:"拉取更新",pulling:"拉取中…",refresh:"刷新",noSubscription:"还没有订阅 Team repo",noSubscriptionBody:"填入一个 Plexus team config GitHub repo。Plexus 会 clone 到 ~/.config/plexus/team/,同步时在你的 personal layer 下面合并它。",starterTitle:"推荐 starter",starterBody:"agent-primer 是一套轻量基线,包含 rules、MCP servers 和可复用 skills。可以先用它作为第一个 team repo,再通过 PR 慢慢定制。",useStarter:"使用 agent-primer",placeholder:g,join:"加入",joining:"加入中…",rules:"Rules",rulesPresent:"已提供",rulesMissing:"未提供",mcp:"MCP",skills:"Skills",proposeTitle:"提交给团队",proposeBody:"如果想把个人 MCP、规则或 skill 分享给团队,把它复制进 team repo 并发起 pull request。",steps:["在 team repo 建一个 branch。","把 ~/.config/plexus/personal/ 里的文件复制到 team repo 的相同路径。","发起 pull request 等团队 review。","合并后回到这里拉取更新,再同步到各个 agent。"]}};function v({status:e}){let{locale:t}=(0,a.o)(),s=f[t],[o,j]=(0,b.useState)(e),[k,w]=(0,b.useState)(""),[N,P]=(0,b.useState)(!1),[M,S]=(0,b.useState)(null);async function A(){let e=await fetch("/api/team");j(await e.json())}async function T(){P(!0),S(null);try{let e=await fetch("/api/team",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({action:"join",repoUrl:k})}),t=await e.json();S(t.message),t.ok&&await A()}finally{P(!1)}}async function z(){P(!0),S(null);try{let e=await fetch("/api/team",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({action:"pull"})}),t=await e.json();S(t.message),t.ok&&await A()}finally{P(!1)}}return(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsx)(i.Z,{className:"border-l-[3px] border-l-plexus-accent p-5",children:(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)(u,{className:"mt-0.5 h-4 w-4 shrink-0 text-plexus-accent",strokeWidth:1.5}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-sm font-semibold text-plexus-text",children:s.betaTitle}),(0,r.jsx)("p",{className:"mt-1 max-w-2xl text-xs leading-relaxed text-plexus-text-3",children:s.betaBody}),(0,r.jsxs)("a",{className:"mt-3 inline-flex items-center gap-1 text-xs font-medium text-plexus-accent hover:underline",href:"https://github.com/miniLV/agent-primer",rel:"noreferrer",target:"_blank",children:[s.starterLink,(0,r.jsx)(p,{className:"h-3 w-3",strokeWidth:1.5})]})]})]})}),(0,r.jsxs)(i.Z,{className:"p-5",children:[o.subscribed?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"plexus-eyebrow",children:s.subscribedTo}),(0,r.jsx)("div",{className:"mt-1 font-mono text-sm text-plexus-text",children:o.repoUrl}),(0,r.jsx)("div",{className:"mt-3 flex items-center gap-2 text-sm",children:o.hasUpstreamUpdate?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.m,{tone:"warn"}),(0,r.jsx)("span",{className:"text-plexus-warn",children:s.updateAvailable(o.behind)})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.m,{tone:"ok"}),(0,r.jsx)("span",{className:"text-plexus-ok",children:s.upToDate})]})}),o.summary&&(0,r.jsxs)("div",{className:"mt-4 grid gap-2 sm:grid-cols-3",children:[(0,r.jsx)(y,{icon:(0,r.jsx)(d.A,{className:"h-3.5 w-3.5",strokeWidth:1.5}),label:s.rules,value:o.summary.rules?s.rulesPresent:s.rulesMissing}),(0,r.jsx)(y,{icon:(0,r.jsx)(x.A,{className:"h-3.5 w-3.5",strokeWidth:1.5}),label:s.mcp,value:String(o.summary.mcp)}),(0,r.jsx)(y,{icon:(0,r.jsx)(c,{className:"h-3.5 w-3.5",strokeWidth:1.5}),label:s.skills,value:String(o.summary.skills)})]}),(0,r.jsxs)("div",{className:"mt-4 flex gap-2",children:[(0,r.jsxs)(n.Button,{variant:"primary",size:"sm",onClick:z,disabled:N,children:[N?(0,r.jsx)(m.A,{className:"h-3.5 w-3.5 animate-spin",strokeWidth:1.5}):(0,r.jsx)(h.A,{className:"h-3.5 w-3.5",strokeWidth:1.5}),N?s.pulling:s.pullUpdates]}),(0,r.jsx)(n.Button,{variant:"ghost",size:"sm",onClick:A,disabled:N,children:s.refresh})]})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"plexus-eyebrow",children:s.noSubscription}),(0,r.jsx)("p",{className:"mt-1 max-w-xl text-xs text-plexus-text-3",children:s.noSubscriptionBody}),(0,r.jsxs)("div",{className:"mt-4 rounded border border-plexus-border bg-plexus-surface-2 p-3",children:[(0,r.jsx)("div",{className:"text-xs font-semibold text-plexus-text",children:s.starterTitle}),(0,r.jsx)("p",{className:"mt-1 text-xs leading-relaxed text-plexus-text-3",children:s.starterBody}),(0,r.jsx)(n.Button,{className:"mt-3",size:"sm",variant:"secondary",onClick:()=>w(g),children:s.useStarter})]}),(0,r.jsxs)("div",{className:"mt-3 flex gap-2",children:[(0,r.jsx)("input",{value:k,onChange:e=>w(e.target.value),placeholder:s.placeholder,className:"h-9 flex-1 rounded border border-plexus-border bg-plexus-bg px-3 text-sm placeholder:text-plexus-text-mute focus:border-plexus-accent focus:outline-none"}),(0,r.jsx)(n.Button,{variant:"primary",onClick:T,disabled:N||!k,children:N?s.joining:s.join})]})]}),M&&(0,r.jsx)("div",{className:"mt-3 text-xs text-plexus-text-3",children:M})]}),(0,r.jsxs)(i.Z,{className:"p-5",children:[(0,r.jsx)("div",{className:"text-sm font-semibold text-plexus-text",children:s.proposeTitle}),(0,r.jsx)("p",{className:"mt-1 text-xs leading-relaxed text-plexus-text-3",children:s.proposeBody}),(0,r.jsx)("ol",{className:"mt-3 list-decimal space-y-1 pl-5 text-xs text-plexus-text-3",children:s.steps.map(e=>(0,r.jsx)("li",{children:e},e))})]})]})}function y({icon:e,label:t,value:s}){return(0,r.jsxs)("div",{className:"flex items-center gap-2 rounded border border-plexus-border bg-plexus-bg px-3 py-2",children:[(0,r.jsx)("span",{className:"text-plexus-text-3",children:e}),(0,r.jsx)("span",{className:"text-xs text-plexus-text-3",children:t}),(0,r.jsx)("span",{className:"ml-auto text-xs font-semibold text-plexus-text",children:s})]})}},8874:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(9789).A)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},9250:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(9789).A)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]])},9748:(e,t,s)=>{"use strict";var r=s(9796);s.o(r,"usePathname")&&s.d(t,{usePathname:function(){return r.usePathname}}),s.o(r,"useRouter")&&s.d(t,{useRouter:function(){return r.useRouter}})}},e=>{e.O(0,[4399,587,1968,7358],()=>e(e.s=1279)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8898],{2008:(e,t,s)=>{Promise.resolve().then(s.bind(s,8484))},4110:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(9789).A)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},4725:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(9789).A)("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]])},6197:(e,t,s)=>{"use strict";s.d(t,{E:()=>n,m:()=>i});var r=s(4568),a=s(7483);let l=(0,s(1397).F)("inline-flex items-center gap-1 rounded-sm px-2 h-5 text-[11px] font-medium tracking-[0.01em]",{variants:{variant:{team:"bg-plexus-info/15 text-plexus-info",personal:"bg-plexus-accent-faint text-plexus-accent",synced:"bg-plexus-ok/15 text-plexus-ok",divergent:"bg-plexus-warn/15 text-plexus-warn",native:"bg-plexus-text-3/15 text-plexus-text-3",beta:"bg-plexus-accent-faint text-plexus-accent border border-plexus-accent/25",danger:"bg-plexus-err/13 text-plexus-err",outline:"border border-plexus-border text-plexus-text-2"}},defaultVariants:{variant:"outline"}});function n({className:e,variant:t,...s}){return(0,r.jsx)("span",{className:(0,a.cn)(l({variant:t}),e),...s})}function i({className:e,tone:t="ok"}){return(0,r.jsx)("span",{className:(0,a.cn)("inline-block h-1.5 w-1.5 rounded-full",{ok:"bg-plexus-ok",warn:"bg-plexus-warn",err:"bg-plexus-err",info:"bg-plexus-info",accent:"bg-plexus-accent",mute:"bg-plexus-text-3"}[t],e)})}},6439:(e,t,s)=>{"use strict";s.d(t,{LanguageProvider:()=>p,o:()=>d});var r=s(4568);let a="plexus.locale";function l(e){if(!e)return null;let t=e.toLowerCase();return"zh"===t||t.startsWith("zh-")?"zh":"en"===t||t.startsWith("en-")?"en":null}var n=s(9748),i=s(7620);let o=(0,i.createContext)(null);function u(e){window.localStorage.setItem(a,e),document.cookie=`plexus-locale=${e}; path=/; max-age=31536000; samesite=lax`}function p({children:e,initialLocale:t}){let s=(0,n.useRouter)(),[d,x]=(0,i.useState)(t);(0,i.useEffect)(()=>{var e;let r,n=l(window.localStorage.getItem(a))??t??(r=(Array.isArray(e=window.navigator.languages??window.navigator.language)?e.map((e,t)=>({value:e,q:1,index:t})):"string"==typeof e?e.split(",").map((e,t)=>{let[s="",...r]=e.trim().split(";"),a=r.find(e=>e.trim().startsWith("q=")),l=a?Number(a.trim().slice(2)):1;return{value:s,q:Number.isFinite(l)?l:1,index:t}}):[]).map(e=>({...e,locale:l(e.value)})).filter(e=>null!==e.locale).sort((e,t)=>t.q-e.q||e.index-t.index),r[0]?.locale??"en");if(n!==t){u(n),s.refresh();return}u(n),x(t)},[t,s]);let c=(0,i.useMemo)(()=>({locale:d,setLocale(e){u(e),s.refresh()},toggleLocale(){u("zh"===d?"en":"zh"),s.refresh()}}),[d,s]);return(0,r.jsx)(o.Provider,{value:c,children:e})}function d(){let e=(0,i.useContext)(o);if(!e)throw Error("useLanguage must be used inside LanguageProvider");return e}},7294:(e,t,s)=>{"use strict";s.d(t,{Z:()=>n});var r=s(4568),a=s(7483),l=s(7620);let n=(0,l.forwardRef)(({className:e,...t},s)=>(0,r.jsx)("div",{ref:s,className:(0,a.cn)("rounded-md border border-plexus-border bg-plexus-surface","transition-colors duration-plexus-normal ease-plexus-out",e),...t}));n.displayName="Card",(0,l.forwardRef)(({className:e,...t},s)=>(0,r.jsx)(n,{ref:s,className:(0,a.cn)("hover:border-plexus-border-strong hover:-translate-y-px",e),...t})).displayName="CardHover"},7483:(e,t,s)=>{"use strict";s.d(t,{cn:()=>l});var r=s(9917),a=s(2809);function l(...e){return(0,a.QP)((0,r.$)(e))}},7788:(e,t,s)=>{"use strict";s.d(t,{Button:()=>u});var r=s(4568),a=s(7483),l=s(8347),n=s(1397),i=s(7620);let o=(0,n.F)((0,a.cn)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded font-medium","transition-colors duration-plexus-normal ease-plexus-out","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-plexus-accent/50 focus-visible:ring-offset-1 focus-visible:ring-offset-plexus-bg","disabled:pointer-events-none disabled:opacity-50"),{variants:{variant:{primary:"bg-plexus-accent text-[#1a1a17] hover:bg-plexus-accent-2 border border-plexus-accent",secondary:"bg-plexus-surface-2 text-plexus-text border border-plexus-border hover:bg-plexus-surface hover:border-plexus-border-strong",ghost:"bg-transparent text-plexus-text-2 hover:bg-plexus-surface-2 hover:text-plexus-text border border-transparent",danger:"bg-transparent text-plexus-err border border-plexus-err/35 hover:bg-plexus-err/10","danger-solid":"bg-plexus-err text-white border border-plexus-err hover:bg-plexus-err/90"},size:{default:"h-9 px-3.5 text-sm",sm:"h-7 px-2.5 text-xs",lg:"h-10 px-4 text-sm",icon:"h-9 w-9 p-0"}},defaultVariants:{variant:"secondary",size:"default"}}),u=(0,i.forwardRef)(({className:e,variant:t,size:s,asChild:n=!1,type:i="button",...u},p)=>{let d=n?l.DX:"button";return(0,r.jsx)(d,{ref:p,type:n?void 0:i,className:(0,a.cn)(o({variant:t,size:s}),e),...u})});u.displayName="Button"},8484:(e,t,s)=>{"use strict";s.d(t,{TeamPanel:()=>v});var r=s(4568),a=s(6439),l=s(6197),n=s(7788),i=s(7294),o=s(9789);let u=(0,o.A)("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]),p=(0,o.A)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);var d=s(9250),x=s(4725);let c=(0,o.A)("book-open",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);var m=s(8874),h=s(4110),b=s(7620);let g="https://github.com/miniLV/agent-primer.git",f={en:{betaTitle:"Team workflow is in beta",betaBody:"Team subscription, shared baselines, and pull-based updates are already wired. PR proposal and conflict UX are still being refined.",starterLink:"View agent-primer starter repo",subscribedTo:"Subscribed to",upToDate:"Up-to-date",updateAvailable:e=>`${e??0} update${1===e?"":"s"} available`,pullUpdates:"Pull updates",pulling:"Pulling…",refresh:"Refresh",noSubscription:"No team subscription yet",noSubscriptionBody:"Paste a GitHub repo with Plexus team config. Plexus clones it into ~/.config/plexus/team/ and merges it below your personal layer at sync time.",starterTitle:"Recommended starter",starterBody:"agent-primer is a compact baseline for rules, MCP servers, and reusable skills. Use it as the first team repo, then customize through pull requests.",useStarter:"Use agent-primer",placeholder:g,join:"Join",joining:"Joining…",rules:"Rules",rulesPresent:"present",rulesMissing:"missing",mcp:"MCP",skills:"Skills",proposeTitle:"Propose to team",proposeBody:"To share a personal MCP server, rule, or skill with the rest of the team, copy it into the team repo and open a pull request.",steps:["Branch the team repo.","Copy files from ~/.config/plexus/personal/ into the same path under the team repo.","Open a pull request for review.","After merge, pull updates here and sync agents."]},zh:{betaTitle:"Team 工作流仍处于 beta",betaBody:"Team 订阅、共享基线和 pull 更新已经接好。PR proposal 和冲突处理体验还在打磨。",starterLink:"查看 agent-primer starter repo",subscribedTo:"当前订阅",upToDate:"已是最新",updateAvailable:e=>`有 ${e??0} 个更新可拉取`,pullUpdates:"拉取更新",pulling:"拉取中…",refresh:"刷新",noSubscription:"还没有订阅 Team repo",noSubscriptionBody:"填入一个 Plexus team config GitHub repo。Plexus 会 clone 到 ~/.config/plexus/team/,同步时在你的 personal layer 下面合并它。",starterTitle:"推荐 starter",starterBody:"agent-primer 是一套轻量基线,包含 rules、MCP servers 和可复用 skills。可以先用它作为第一个 team repo,再通过 PR 慢慢定制。",useStarter:"使用 agent-primer",placeholder:g,join:"加入",joining:"加入中…",rules:"Rules",rulesPresent:"已提供",rulesMissing:"未提供",mcp:"MCP",skills:"Skills",proposeTitle:"提交给团队",proposeBody:"如果想把个人 MCP、规则或 skill 分享给团队,把它复制进 team repo 并发起 pull request。",steps:["在 team repo 建一个 branch。","把 ~/.config/plexus/personal/ 里的文件复制到 team repo 的相同路径。","发起 pull request 等团队 review。","合并后回到这里拉取更新,再同步到各个 agent。"]}};function v({status:e}){let{locale:t}=(0,a.o)(),s=f[t],[o,j]=(0,b.useState)(e),[k,w]=(0,b.useState)(""),[N,P]=(0,b.useState)(!1),[M,S]=(0,b.useState)(null);async function A(){let e=await fetch("/api/team");j(await e.json())}async function T(){P(!0),S(null);try{let e=await fetch("/api/team",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({action:"join",repoUrl:k})}),t=await e.json();S(t.message),t.ok&&await A()}finally{P(!1)}}async function z(){P(!0),S(null);try{let e=await fetch("/api/team",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({action:"pull"})}),t=await e.json();S(t.message),t.ok&&await A()}finally{P(!1)}}return(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsx)(i.Z,{className:"border-l-[3px] border-l-plexus-accent p-5",children:(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)(u,{className:"mt-0.5 h-4 w-4 shrink-0 text-plexus-accent",strokeWidth:1.5}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-sm font-semibold text-plexus-text",children:s.betaTitle}),(0,r.jsx)("p",{className:"mt-1 max-w-2xl text-xs leading-relaxed text-plexus-text-3",children:s.betaBody}),(0,r.jsxs)("a",{className:"mt-3 inline-flex items-center gap-1 text-xs font-medium text-plexus-accent hover:underline",href:"https://github.com/miniLV/agent-primer",rel:"noreferrer",target:"_blank",children:[s.starterLink,(0,r.jsx)(p,{className:"h-3 w-3",strokeWidth:1.5})]})]})]})}),(0,r.jsxs)(i.Z,{className:"p-5",children:[o.subscribed?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"plexus-eyebrow",children:s.subscribedTo}),(0,r.jsx)("div",{className:"mt-1 font-mono text-sm text-plexus-text",children:o.repoUrl}),(0,r.jsx)("div",{className:"mt-3 flex items-center gap-2 text-sm",children:o.hasUpstreamUpdate?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.m,{tone:"warn"}),(0,r.jsx)("span",{className:"text-plexus-warn",children:s.updateAvailable(o.behind)})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.m,{tone:"ok"}),(0,r.jsx)("span",{className:"text-plexus-ok",children:s.upToDate})]})}),o.summary&&(0,r.jsxs)("div",{className:"mt-4 grid gap-2 sm:grid-cols-3",children:[(0,r.jsx)(y,{icon:(0,r.jsx)(d.A,{className:"h-3.5 w-3.5",strokeWidth:1.5}),label:s.rules,value:o.summary.rules?s.rulesPresent:s.rulesMissing}),(0,r.jsx)(y,{icon:(0,r.jsx)(x.A,{className:"h-3.5 w-3.5",strokeWidth:1.5}),label:s.mcp,value:String(o.summary.mcp)}),(0,r.jsx)(y,{icon:(0,r.jsx)(c,{className:"h-3.5 w-3.5",strokeWidth:1.5}),label:s.skills,value:String(o.summary.skills)})]}),(0,r.jsxs)("div",{className:"mt-4 flex gap-2",children:[(0,r.jsxs)(n.Button,{variant:"primary",size:"sm",onClick:z,disabled:N,children:[N?(0,r.jsx)(m.A,{className:"h-3.5 w-3.5 animate-spin",strokeWidth:1.5}):(0,r.jsx)(h.A,{className:"h-3.5 w-3.5",strokeWidth:1.5}),N?s.pulling:s.pullUpdates]}),(0,r.jsx)(n.Button,{variant:"ghost",size:"sm",onClick:A,disabled:N,children:s.refresh})]})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"plexus-eyebrow",children:s.noSubscription}),(0,r.jsx)("p",{className:"mt-1 max-w-xl text-xs text-plexus-text-3",children:s.noSubscriptionBody}),(0,r.jsxs)("div",{className:"mt-4 rounded border border-plexus-border bg-plexus-surface-2 p-3",children:[(0,r.jsx)("div",{className:"text-xs font-semibold text-plexus-text",children:s.starterTitle}),(0,r.jsx)("p",{className:"mt-1 text-xs leading-relaxed text-plexus-text-3",children:s.starterBody}),(0,r.jsx)(n.Button,{className:"mt-3",size:"sm",variant:"secondary",onClick:()=>w(g),children:s.useStarter})]}),(0,r.jsxs)("div",{className:"mt-3 flex gap-2",children:[(0,r.jsx)("input",{value:k,onChange:e=>w(e.target.value),placeholder:s.placeholder,className:"h-9 flex-1 rounded border border-plexus-border bg-plexus-bg px-3 text-sm placeholder:text-plexus-text-mute focus:border-plexus-accent focus:outline-none"}),(0,r.jsx)(n.Button,{variant:"primary",onClick:T,disabled:N||!k,children:N?s.joining:s.join})]})]}),M&&(0,r.jsx)("div",{className:"mt-3 text-xs text-plexus-text-3",children:M})]}),(0,r.jsxs)(i.Z,{className:"p-5",children:[(0,r.jsx)("div",{className:"text-sm font-semibold text-plexus-text",children:s.proposeTitle}),(0,r.jsx)("p",{className:"mt-1 text-xs leading-relaxed text-plexus-text-3",children:s.proposeBody}),(0,r.jsx)("ol",{className:"mt-3 list-decimal space-y-1 pl-5 text-xs text-plexus-text-3",children:s.steps.map(e=>(0,r.jsx)("li",{children:e},e))})]})]})}function y({icon:e,label:t,value:s}){return(0,r.jsxs)("div",{className:"flex items-center gap-2 rounded border border-plexus-border bg-plexus-bg px-3 py-2",children:[(0,r.jsx)("span",{className:"text-plexus-text-3",children:e}),(0,r.jsx)("span",{className:"text-xs text-plexus-text-3",children:t}),(0,r.jsx)("span",{className:"ml-auto text-xs font-semibold text-plexus-text",children:s})]})}},8874:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(9789).A)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},9250:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(9789).A)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]])},9748:(e,t,s)=>{"use strict";var r=s(9796);s.o(r,"usePathname")&&s.d(t,{usePathname:function(){return r.usePathname}}),s.o(r,"useRouter")&&s.d(t,{useRouter:function(){return r.useRouter}})}},e=>{e.O(0,[4399,587,1968,7358],()=>e(e.s=2008)),_N_E=e.O()}]);
|