@xopcai/xopc 0.0.407 → 0.0.408
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/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-CPNoFyoV.js → agent-avatar-dicebear-B0em9Xfs.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-BB0O3b4I.js → agent-defaults-settings-panel-CtE1h2xU.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-Y7XtlqVm.js → agents-DAgFeHEb.js} +3 -3
- package/dist/gateway/static/root/assets/{app-management-settings-panel-BOAkMTQ7.js → app-management-settings-panel-B1qR8ElB.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-BWPt4-vh.js → appearance-settings-GA819R2q.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-Ln5N1PK3.js → apps-page-DZptDZ7h.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-CNjE6PYZ.js → archive-plugin-BjWaZIHe.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-BsP4j7Nw.js → automations-page-IkrLEkMb.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-lq17XY3n.js → automations-workspace-qfEjk_ws.js} +1 -1
- package/dist/gateway/static/root/assets/{binary-plugins-AFWJskT6.js → binary-plugins-DKy1DC62.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-SQ53S4oy.js → block-editor-4E-OdmNm.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automation-inputs-C2SC9h-c.js → browser-automation-inputs-Bs-AkQ1q.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-kRoqj1qn.js → browser-automations-page-D0Vbe1Q_.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-dZhjL3oj.js → browser-settings-page-BXCNNpQd.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-page-Dnp_ilKR.js → capabilities-page-DMtxaYgt.js} +2 -2
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-BA9kBBqE.js → capabilities-settings-panel-BlWrMG6Z.js} +1 -1
- package/dist/gateway/static/root/assets/{capability-header-actions-Cq5XWEDs.js → capability-header-actions-BMffrHhT.js} +1 -1
- package/dist/gateway/static/root/assets/channels-C96r2Rqq.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-BC4EyhTx.js → chat-terminal-dock-vb3kBSeI.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-MxcoTOP1.js → computer-settings-page-75SDQxQW.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-tSQ3a_Ti.js → connector-service-page-DmJ9dIql.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-h5FTgews.js → connectors-page-Bua_nhSH.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-CavoWXMc.js → date-picker-BEDH1AbM.js} +1 -1
- package/dist/gateway/static/root/assets/dependency-picker-LwWL5fo8.js +1 -0
- package/dist/gateway/static/root/assets/{desktop-pet-B-RDVNqR.js → desktop-pet-Bb-s29ag.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-rttWyUzY.js → desktop-pet-settings-Btt-DzyT.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-6hqiv1ui.js → device-pairing-wizard-_UWo9-4N.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-1rEGI8IE.js → directory-picker-path-field-CkGfC105.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-BaswNoXz.js → extension-debug-page-Cm0F3rcI.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-uCMJMnc_.js → extension-page-B72a-tnZ.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-DiczmHyl.js → extension-settings-page-BEDAm_Ib.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-DH5MOwxf.js → gateway-settings-BapgXAhB.js} +1 -1
- package/dist/gateway/static/root/assets/{highlighted-body-KQOG7T2V-B62h4sJ4.js → highlighted-body-KQOG7T2V-BWjkqT5j.js} +1 -1
- package/dist/gateway/static/root/assets/{home-page-BsjMhloP.js → home-page-DNGjF6h4.js} +2 -2
- package/dist/gateway/static/root/assets/{image-generation-api-Di7HnFSL.js → image-generation-api-Bi1-Hvtr.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-DpKfYZMT.js → imports-page-b4VDs6Bd.js} +1 -1
- package/dist/gateway/static/root/assets/{index-BUv4J0JN.js → index-Cgd4fGVP.js} +16 -16
- package/dist/gateway/static/root/assets/index-gYRNcY2Q.css +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-D1Q1kTMI.js → keyboard-shortcuts-settings-Cf29ltoI.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-CnaLbgJb.js → local-app-workbench-page-dgUxHhW8.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-CSO0RkyG.js → local-apps-page-D3k9GjgF.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-DruO5LTf.js → logs-page-BUlU7t8l.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-Dw3tQKNe.js → management-settings-2L7XFZXc.js} +1 -1
- package/dist/gateway/static/root/assets/markdown-view-ixUWAmoy.css +1 -0
- package/dist/gateway/static/root/assets/{media-plugins-CrHXsih_.js → media-plugins-Bl1Xga_v.js} +1 -1
- package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-Bi62iXra.js +1 -0
- package/dist/gateway/static/root/assets/{note-detail-panel-DCZ6Vgd_.js → note-detail-panel-ogBu93h0.js} +3 -3
- package/dist/gateway/static/root/assets/note-image-lightbox-Dxvo_WsE.js +1 -0
- package/dist/gateway/static/root/assets/{notes-page-Bqy9Rh_j.js → notes-page-CNdoxzIZ.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-capture-button-DQHbuYER.js → page-context-capture-button-Bq4Xpop5.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-page-C--WEB5c.js → personal-page-7P2leCsB.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-settings-panel-Cwgc13ls.js → personal-settings-panel-D6n6TObP.js} +1 -1
- package/dist/gateway/static/root/assets/{plugin-details-dialog-DxkFHaU-.js → plugin-details-dialog-JTxDbMI4.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-BW7P2akd.js → preview-open-alternatives-6XU-2lVI.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-BnlpaYs-.js → product-open-page-BpB0klIl.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-DkXx1Vt8.js → product-preview-content-DxQaoQew.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-LilHE2OV.js +1 -0
- package/dist/gateway/static/root/assets/{projects-page-CJ0s-bI5.js → projects-page-D4Jxhuhq.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-yItNjAR3.js → remote-access-hub-Cy71CCQq.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-BGRbt79f.js → runtime-tools-settings-panel-CrbjrokA.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-B9VP7ldU.js → schema-form-DITi2cne.js} +1 -1
- package/dist/gateway/static/root/assets/{sessions-page-3O5S9efw.js → sessions-page-D1THmRXE.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-CjRLXfoo.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-BA2RkU1S.js → settings-form-section-Cl0eF4hl.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-BUT0FzfI.js → settings-page-1jcGeVtB.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-1oWs6iPS.js → setup-status-panel-CFhDHkyK.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-CVNey8Lq.js → share-preview-page-By4IKKgg.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-Bb6YoDmU.js → shares-settings-q2sa1VvF.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-api-BWi0G9Ii.js → skill-api-BxCyuPhf.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-DspV2olR.js → skill-reload-api-CIHSQxr1.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-SbNv1vpY.js → skills-page-BQaej_2C.js} +1 -1
- package/dist/gateway/static/root/assets/{style-DlOTU5bN.js → style-Dt_oHNvB.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-DbS1qtOh.js → system-settings-panel-C9ejxax1.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-uSwizzx8.js → task-detail-page-SipLlGGk.js} +1 -1
- package/dist/gateway/static/root/assets/{task-expandable-content-D0ahXP9o.js → task-expandable-content-BMCvE36l.js} +1 -1
- package/dist/gateway/static/root/assets/{tracing-settings-page-BMhVvXXd.js → tracing-settings-page-bn9vnLrf.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-CO9rJLFh.js → tunnel-api-BeTAD8BN.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-DVzIDec4.js → usage-page-BPuc6leN.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-DqPaXiX2.js → use-autosave-DwcmmxWR.js} +1 -1
- package/dist/gateway/static/root/assets/{user-model-page-BYZCHCzG.js → user-model-page-YWSqv_kR.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-C_iOzfIt.js → voice-api-key-field-Bk947X8N.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-n59s18s0.js → work-discovery-overlay-mjj7w_wU.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-Lp6Vumxc.js → workflow-run-setup-panel-xQUvtVUU.js} +1 -1
- package/dist/gateway/static/root/assets/{workflows-page-B5BqN1Y1.js → workflows-page-DbKRAEWP.js} +1 -1
- package/dist/gateway/static/root/assets/{xopc-cloud-account-card-QSDUy0uF.js → xopc-cloud-account-card-C4jQM6Uo.js} +1 -1
- package/dist/gateway/static/root/index.html +4 -4
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-manager.js +1 -1
- package/dist/src/agent/background-review/run-background-review.js +1 -1
- package/dist/src/agent/external-tools/cliProvider.js +2 -2
- package/dist/src/agent/external-tools/composio-provider.js +2 -2
- package/dist/src/agent/external-tools/endpoint-provider.js +2 -2
- package/dist/src/agent/service.js +1 -1
- package/dist/src/agent/skills/index.js +1 -1
- package/dist/src/agent/skills/managed-store.js +1 -1
- package/dist/src/agent/skills/skill-manage-ops.js +1 -1
- package/dist/src/agent/tools/personal-read-tool.js +1 -1
- package/dist/src/agent/tools/xopc-use-tool.js +2 -2
- package/dist/src/agent-catalog/capabilities.js +2 -2
- package/dist/src/agent-catalog/migrations/legacy-config-cutover.js +1 -1
- package/dist/src/agent-catalog/repository.js +1 -1
- package/dist/src/automations/capabilities/drafts.js +1 -1
- package/dist/src/bootstrap/application-state.js +1 -1
- package/dist/src/browser/providers/browser-ext-install.js +1 -1
- package/dist/src/capabilities/runtime/dispatcher.js +1 -1
- package/dist/src/capabilities/runtime/product.js +1 -1
- package/dist/src/cli/commands/agents.js +1 -1
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/cli/commands/onboard/model.js +1 -1
- package/dist/src/cli/utils/init-workspace-core.js +1 -1
- package/dist/src/config/agent-profile.js +1 -1
- package/dist/src/execution-environments/local-worktree-manager.js +1 -1
- package/dist/src/extensions/agent-plugins/cli-authorization.js +7 -3
- package/dist/src/extensions/agent-plugins/mcp-adapter.js +3 -1
- package/dist/src/extensions/agent-plugins/node-runtime.d.ts +5 -0
- package/dist/src/extensions/agent-plugins/node-runtime.js +14 -0
- package/dist/src/extensions/agent-plugins/skill-catalog.js +1 -1
- package/dist/src/extensions/agent-plugins/validation.js +1 -1
- package/dist/src/gateway/agents-admin.js +2 -2
- package/dist/src/gateway/hono/routes/agents.js +1 -1
- package/dist/src/gateway/hono/routes/config-patch/misc.js +1 -1
- package/dist/src/gateway/hono/routes/notes.js +2 -2
- package/dist/src/gateway/hono/routes/projects.js +2 -2
- package/dist/src/gateway/hono/routes/session-input-handler.js +1 -1
- package/dist/src/gateway/hono/routes/tasks.js +1 -1
- package/dist/src/gateway/image-generation-setup.js +1 -1
- package/dist/src/gateway/service.js +4 -4
- package/dist/src/gateway/xopc-cloud-capability-setup.js +1 -1
- package/dist/src/home-intelligence/host.js +2 -2
- package/dist/src/imports/importService.js +1 -1
- package/dist/src/local-apps/service.js +1 -1
- package/dist/src/personal-agent/communication.d.ts +1 -1
- package/dist/src/personal-agent/communication.js +1 -0
- package/dist/src/personal-agent/service.js +1 -1
- package/dist/src/runtime-tools/archive.js +1 -1
- package/dist/src/session/client-history.js +3 -0
- package/dist/src/session/session-context-for-llm.js +4 -0
- package/dist/src/session/task-allocation-status.d.ts +2 -0
- package/dist/src/session/task-allocation-status.js +14 -0
- package/dist/src/tasks/capabilities/read.js +2 -2
- package/dist/src/tasks/capabilities/write.js +1 -1
- package/dist/src/tasks/task-allocation-repository.js +8 -5
- package/dist/src/tui/backends/embedded-backend.js +1 -1
- package/dist/src/voice/realtime/persona-context.js +1 -1
- package/package.json +1 -1
- package/dist/gateway/static/root/assets/channels-BZCzeWtD.js +0 -1
- package/dist/gateway/static/root/assets/dependency-picker-Cl-3upFX.js +0 -1
- package/dist/gateway/static/root/assets/index-Cr4I4q1J.css +0 -1
- package/dist/gateway/static/root/assets/markdown-view-Ct4sKkUf.css +0 -1
- package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-CNzdVIcE.js +0 -1
- package/dist/gateway/static/root/assets/note-image-lightbox-BXNZw7lJ.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-CtyCpIx8.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BE-SKsf6.js +0 -1
- /package/dist/gateway/static/root/assets/{markdown-view-vQSMUUY_.js → markdown-view-B35a4o1v.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{d as i,f as a,g as o,t as s}from"./chunk-KS7C4IRE-B2HK1psj.js";import{t as c}from"./ellipsis-0k4rZLoy.js";import{t as l}from"./external-link-DjqjBmc3.js";import{t as u}from"./markdown-view-vQSMUUY_.js";import{t as d}from"./plus-Q2yW6OE7.js";import{t as f}from"./x-B_N4OPjy.js";import{t as p}from"./messages-D__oW2yE.js";import{t as m}from"./cn-0WouolD0.js";import{c as h,n as g}from"./locale-store-D_migb9R.js";import{a as _,i as v,o as y,r as b,s as x,t as S}from"./dist-BGTk37IG.js";import{a as C,i as w}from"./vendor-swr-BIWyz7Rc.js";import{o as T}from"./gateway-realtime-CP6L2jIR.js";import{$ as E,Ff as D,Jl as O,Kf as k,Ko as A,Ku as j,Q as M,Qc as N,Tf as P,X as F,Yl as I,Z as L,_o as R,_r as z,_u as B,br as V,bs as H,cl as U,ct as W,el as G,es as K,et as q,gr as J,hr as Y,hu as ee,it as X,ns as te,os as ne,rs as re,rt as ie,st as Z,ts as ae,ud as oe,vr as se}from"./index-BUv4J0JN.js";import{n as ce,t as le}from"./capability-header-actions-Cq5XWEDs.js";import{n as ue,r as de,t as fe}from"./plugin-presentation-CO5BFDGW.js";var pe=n(),me=`grid auto-rows-fr grid-cols-[repeat(auto-fill,minmax(min(100%,18rem),1fr))] items-stretch gap-4`,he=`relative h-full min-w-0 rounded-xl border border-edge bg-surface-panel p-4 transition-colors hover:border-edge-strong hover:bg-surface-hover/30`,ge=`absolute inset-0 cursor-pointer rounded-xl focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent`,Q=e(t(),1);function _e(e){return e===`builtin`||e===`user`?e:`marketplace`}var $=r();function ve(e,t){let n=e.find(e=>e.id===t||e.pluginId===t||e.provenance?.packageName===t);return n?n.source===`bundled`?`bundled`:`user`:`absent`}var ye={debounced:``,detailPkg:null,quickInstallPkg:null,rowBusy:null,actionError:null,restartHint:null};function be({className:e,query:t}){let n=a(),r=i(),o=g(e=>e.language),s=p(o).extensionsPage,c=h(e=>!!e.conversationId),l=K(),{mutate:u}=C(),[d,f]=(0,Q.useReducer)(R,ye),{debounced:_,detailPkg:v,quickInstallPkg:y,rowBusy:b,actionError:x,restartHint:S}=d,E=c?`marketplace-${_}`:null;(0,Q.useEffect)(()=>{let e=window.setTimeout(()=>f({type:`patch`,patch:{debounced:t.trim()}}),300);return()=>window.clearTimeout(e)},[t]);let{data:D,isLoading:O,error:k}=w(E,()=>F(_),{revalidateOnFocus:!1}),A=(0,Q.useCallback)(()=>{u(`gateway-extensions-list`),T()},[u]),N=(0,Q.useCallback)(async(e,t)=>{f({type:`patch`,patch:{actionError:null,restartHint:null,rowBusy:e}});try{let n=await M({name:e,overwrite:t});A(),n.requiresGatewayRestart&&f({type:`patch`,patch:{restartHint:s.marketplaceRestartHint}})}catch(e){throw f({type:`patch`,patch:{actionError:e instanceof Error?e.message:s.marketplaceInstallFailed}}),e}finally{f({type:`patch`,patch:{rowBusy:null}})}},[s.marketplaceInstallFailed,s.marketplaceRestartHint,A]),L=(0,Q.useCallback)(async e=>{f({type:`patch`,patch:{actionError:null,restartHint:null,rowBusy:e}});try{let t=await q(e);A(),t.requiresGatewayRestart&&f({type:`patch`,patch:{restartHint:s.marketplaceRestartHint}})}catch(e){throw f({type:`patch`,patch:{actionError:e instanceof Error?e.message:s.marketplaceUninstallFailed}}),e}finally{f({type:`patch`,patch:{rowBusy:null}})}},[s.marketplaceRestartHint,s.marketplaceUninstallFailed,A]),z=D??[];return(0,$.jsxs)(`div`,{className:m(`flex flex-col gap-4`,e),children:[k?(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:k instanceof Error?k.message:s.marketplaceLoadFailed}):null,x?(0,$.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:x}):null,S?(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:S}):null,O&&!D?(0,$.jsx)(`ul`,{className:me,"aria-label":s.marketplaceLoading,children:[0,1,2,3,4,5].map(e=>(0,$.jsxs)(`li`,{className:`rounded-xl border border-edge bg-surface-panel p-4`,children:[(0,$.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,$.jsx)(G,{className:`size-10 shrink-0 rounded-xl`}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2`,children:[(0,$.jsx)(G,{className:`h-5 w-full`}),(0,$.jsx)(G,{className:`h-3 w-2/3`})]}),(0,$.jsx)(G,{className:`h-9 w-16 shrink-0 rounded-lg`})]}),(0,$.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,$.jsx)(G,{className:`h-4 w-full`}),(0,$.jsx)(G,{className:`h-4 w-full`}),(0,$.jsx)(G,{className:`h-4 w-2/3`})]})]},e))}):(0,$.jsx)(`ul`,{className:me,children:z.length===0?(0,$.jsx)(`li`,{className:`col-span-full text-sm text-fg-muted`,children:s.marketplaceEmpty}):z.map(e=>{let t=ve(l,e.id),i=b===e.id,a=l.find(t=>t.pluginId===e.id||t.provenance?.packageName===e.id),c=e.localizations?.[o.startsWith(`zh`)?`zh-CN`:`en`],u=c?.displayName??e.name,d=c?.description??e.description;return(0,$.jsxs)(`li`,{className:he,children:[(0,$.jsx)(`button`,{type:`button`,"aria-label":`${u}, ${s.marketplaceDetailTitle}`,onClick:()=>a?.pluginId?n(Z(a.pluginId,`installed`,!1,r.pathname+r.search)):f({type:`patch`,patch:{detailPkg:e.id}}),className:ge}),(0,$.jsxs)(`div`,{className:`pointer-events-none relative flex items-start gap-3`,children:[(0,$.jsx)(X,{iconUrl:e.branding?.iconUrl,fallback:j}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 items-start gap-1.5`,children:[(0,$.jsx)(`h3`,{className:`line-clamp-2 break-words font-semibold leading-snug text-fg`,title:u,children:u}),e.verified?(0,$.jsx)(P,{className:`mt-0.5 size-3.5 shrink-0 text-emerald-600 dark:text-emerald-400`,strokeWidth:1.75,"aria-label":`Verified`}):null]}),(0,$.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-fg-subtle`,children:[e.version?(0,$.jsxs)(`span`,{children:[`v`,e.version]}):null,t===`user`?(0,$.jsx)(`span`,{className:a&&de(a)?`text-amber-700 dark:text-amber-400`:`text-fg-muted`,children:a&&de(a)?o.startsWith(`zh`)?`需要授权`:`Authorization required`:s.marketplaceInstalled}):null]})]}),(0,$.jsx)(`div`,{role:`group`,className:`pointer-events-auto relative z-10 flex max-w-[45%] shrink-0 items-start`,children:t===`bundled`?(0,$.jsx)(`span`,{className:`rounded-md bg-surface-hover px-2 py-1 text-[11px] font-medium text-fg-muted`,children:s.marketplaceBuiltin}):t===`user`?(0,$.jsx)($.Fragment,{children:e.packageType===`plugin`?(0,$.jsx)(`button`,{type:`button`,onClick:()=>a?.pluginId&&fe(a)?n(W(u,o.startsWith(`zh`))):a?.pluginId?n(Z(a.pluginId,`installed`,de(a),r.pathname+r.search)):f({type:`patch`,patch:{detailPkg:e.id,quickInstallPkg:null}}),className:m(`inline-flex items-center justify-center rounded-lg border border-edge px-3 py-2 text-xs font-medium text-fg`,`transition-colors active:scale-[0.98] active:bg-surface-hover/80`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`),children:a&&de(a)?o.startsWith(`zh`)?`去授权`:`Connect account`:a&&fe(a)?o.startsWith(`zh`)?`开始使用`:`Start using`:o.startsWith(`zh`)?`管理插件`:`Manage plugin`}):(0,$.jsxs)(`button`,{type:`button`,disabled:i,onClick:()=>{window.confirm(s.marketplaceUninstallConfirm)&&L(e.id).catch(()=>{})},className:m(`inline-flex items-center justify-center gap-1.5 rounded-lg border border-edge px-3 py-2 text-xs font-medium text-fg`,`transition-colors active:scale-[0.98] active:bg-surface-hover/80`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,`disabled:pointer-events-none disabled:opacity-50`),children:[i?(0,$.jsx)(oe,{className:`size-3.5 animate-spin`,"aria-hidden":!0}):(0,$.jsx)(I,{className:`size-3.5`,strokeWidth:2,"aria-hidden":!0}),s.marketplaceUninstall]})}):(0,$.jsx)(`button`,{type:`button`,onClick:()=>f({type:`patch`,patch:e.packageType===`plugin`?{detailPkg:e.id,quickInstallPkg:e.id}:{detailPkg:e.id,quickInstallPkg:null}}),className:m(`inline-flex min-w-16 items-center justify-center rounded-lg border border-edge px-3 py-2 text-xs font-medium text-fg`,`transition-[transform,background-color] active:scale-[0.98]`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`),children:e.packageType===`plugin`?o.startsWith(`zh`)?`安装`:`Install`:s.marketplaceReview})})]}),d?(0,$.jsx)(`p`,{className:`pointer-events-none relative mt-3 line-clamp-3 text-sm leading-relaxed text-fg-muted`,children:d}):null,(e.categories?.length??0)>0?(0,$.jsx)(`div`,{className:`pointer-events-none relative mt-3 flex flex-wrap gap-1.5`,children:e.categories?.map(e=>(0,$.jsx)(`span`,{className:`max-w-full truncate rounded-md border border-edge px-2 py-0.5 text-xs text-fg-muted`,children:e},e))}):null]},e.id)})}),v?(0,$.jsx)(xe,{packageName:v,autoInstall:y===v,copy:s,extensions:l,onClose:()=>f({type:`patch`,patch:{detailPkg:null,quickInstallPkg:null}}),onInstall:N,onUninstall:L}):null]})}function xe(e){let t=(0,pe.c)(98),{packageName:n,autoInstall:r,copy:i,extensions:a,onClose:o,onInstall:c,onUninstall:l}=e,[d,p]=(0,Q.useState)(!1),[g,v]=(0,Q.useState)(!1),C=h(Ee)?`ext-mp-detail-${n}`:null,T;t[0]===n?T=t[1]:(T=async()=>L(n),t[0]=n,t[1]=T);let E;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(E={revalidateOnFocus:!1},t[2]=E):E=t[2];let{data:D,error:A,isLoading:j}=w(C,T,E),M;t[3]!==a||t[4]!==n?(M=ve(a,n),t[3]=a,t[4]=n,t[5]=M):M=t[5];let N=M,P=N===`user`,F=D?.manifest?.permissions,R,z,B,V,H,U,W,K,q,J,Y,X;if(t[6]!==r||t[7]!==i||t[8]!==D||t[9]!==A||t[10]!==a||t[11]!==N||t[12]!==j||t[13]!==o||t[14]!==n||t[15]!==F||t[16]!==g){U=Symbol.for(`react.early_return_sentinel`);bb0:{let e=F&&typeof F==`object`&&!Array.isArray(F)?Object.entries(F):[],s;t[29]!==i||t[30]!==D?(s=D?.readme?.trim()||(D?.description?.trim()?`### ${D.name}\n\n${D.description}`:`*${i.marketplaceNoReadme}*`),t[29]=i,t[30]=D,t[31]=s):s=t[31];let c=s;if(D?.format===`agent-plugin`){let e;if(t[32]!==D||t[33]!==a||t[34]!==n){let r;t[36]!==D||t[37]!==n?(r=e=>e.provenance?.packageName===n||e.pluginId===D.manifest?.name,t[36]=D,t[37]=n,t[38]=r):r=t[38],e=a.find(r),t[32]=D,t[33]=a,t[34]=n,t[35]=e}else e=t[35];let i=`store:${n}`,s;t[39]!==r||t[40]!==D||t[41]!==o||t[42]!==e||t[43]!==i?(s=(0,$.jsx)(ie,{extension:e,initialSource:i,marketplace:D,autoInstall:r,onClose:o}),t[39]=r,t[40]=D,t[41]=o,t[42]=e,t[43]=i,t[44]=s):s=t[44],U=s;break bb0}B=S,V=!0,t[45]===o?H=t[46]:(H=e=>!e&&o(),t[45]=o,t[46]=H),z=y,t[47]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,$.jsx)(_,{className:`xopc-dialog-overlay fixed inset-0 z-[130] bg-scrim`}),t[47]=X):X=t[47],R=b,q=`xopc-dialog-content fixed left-1/2 top-1/2 z-[131] flex h-[min(44rem,calc(100vh-1.5rem))] w-[min(42rem,calc(100vw-1.5rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay`,J=Te;let l;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,$.jsx)(k,{className:`size-5`}),t[48]=l):l=t[48];let d;t[49]!==i.detailBack||t[50]!==o?(d=(0,$.jsx)(`button`,{type:`button`,onClick:o,className:`inline-flex size-9 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":i.detailBack,children:l}),t[49]=i.detailBack,t[50]=o,t[51]=d):d=t[51];let p;t[52]===i.marketplaceDetailTitle?p=t[53]:(p=(0,$.jsx)(x,{className:`min-w-0 flex-1 truncate text-center text-sm font-semibold text-fg`,children:i.marketplaceDetailTitle}),t[52]=i.marketplaceDetailTitle,t[53]=p);let m;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,$.jsx)(f,{className:`size-5`}),t[54]=m):m=t[54];let h;t[55]!==i.detailClose||t[56]!==o?(h=(0,$.jsx)(`button`,{type:`button`,onClick:o,className:`inline-flex size-9 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":i.detailClose,children:m}),t[55]=i.detailClose,t[56]=o,t[57]=h):h=t[57],t[58]!==d||t[59]!==p||t[60]!==h?(Y=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3`,children:[d,p,h]}),t[58]=d,t[59]=p,t[60]=h,t[61]=Y):Y=t[61],W=`min-h-0 flex-1 overflow-y-auto p-5`,K=j&&!D?(0,$.jsxs)(`div`,{className:`space-y-4`,"aria-label":i.marketplaceLoading,children:[(0,$.jsx)(G,{className:`h-6 w-48`}),(0,$.jsx)(G,{className:`h-4 w-28`}),(0,$.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,$.jsx)(G,{className:`h-12`}),(0,$.jsx)(G,{className:`h-12`})]}),(0,$.jsx)(G,{className:`h-28 w-full`}),(0,$.jsx)(G,{className:`h-36 w-full`})]}):A?(0,$.jsxs)(`div`,{className:`rounded-lg border border-red-300/70 bg-red-50 p-4 text-sm dark:border-red-900 dark:bg-red-950/30`,children:[(0,$.jsx)(`p`,{className:`font-medium text-red-700 dark:text-red-300`,children:i.marketplaceDetailLoadFailed}),(0,$.jsx)(`p`,{className:`mt-1 break-words text-red-600 dark:text-red-400`,children:A instanceof Error?A.message:i.marketplaceLoadFailed})]}):D?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`h3`,{className:`text-lg font-semibold text-fg`,children:D.name}),(0,$.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:(0,$.jsx)(`code`,{className:`rounded bg-surface-panel px-1 py-0.5`,children:D.id})}),(0,$.jsxs)(`dl`,{className:`mt-3 grid gap-2 text-xs text-fg-muted sm:grid-cols-2`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`font-medium text-fg`,children:i.marketplaceAuthor}),(0,$.jsx)(`dd`,{children:D.author.username})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`font-medium text-fg`,children:i.marketplaceVersion}),(0,$.jsx)(`dd`,{children:D.latestVersion.version})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`font-medium text-fg`,children:i.marketplaceDownloads}),(0,$.jsx)(`dd`,{children:D.downloads})]})]}),N===`bundled`?null:(0,$.jsxs)(`section`,{className:`mt-5 space-y-3 rounded-lg border border-edge bg-surface-base p-4`,children:[(0,$.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[D.installability.available?(0,$.jsx)(ee,{className:`mt-0.5 size-5 shrink-0 text-emerald-600 dark:text-emerald-400`,"aria-hidden":!0}):(0,$.jsx)(O,{className:`mt-0.5 size-5 shrink-0 text-amber-600 dark:text-amber-400`,"aria-hidden":!0}),(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`h4`,{className:`text-sm font-semibold text-fg`,children:D.installability.available?i.marketplaceRiskTitle:i.marketplaceUnavailableTitle}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-fg-muted`,children:D.installability.available?i.marketplaceCodeRisk:D.installability.reason??i.marketplaceUnavailableBody})]})]}),D.installability.available?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`dl`,{className:`grid gap-2 text-xs text-fg-muted sm:grid-cols-2`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`font-medium text-fg`,children:i.marketplaceIntegrity}),(0,$.jsx)(`dd`,{children:i.marketplaceIntegrityVerified})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`font-medium text-fg`,children:i.marketplaceDependencies}),(0,$.jsx)(`dd`,{children:D.packageSummary?.dependencyCount??0})]})]}),(0,$.jsxs)(`div`,{className:`text-xs text-fg-muted`,children:[(0,$.jsx)(`p`,{className:`font-medium text-fg`,children:i.marketplacePermissions}),e.length>0?(0,$.jsx)(`ul`,{className:`mt-1 space-y-1`,children:e.map(we)}):(0,$.jsx)(`p`,{className:`mt-1`,children:i.marketplacePermissionsNone})]}),(D.packageSummary?.lifecycleScripts.length??0)>0?(0,$.jsxs)(`p`,{className:`text-xs leading-relaxed text-amber-700 dark:text-amber-300`,children:[i.marketplaceLifecycleScripts,`: `,D.packageSummary?.lifecycleScripts.join(`, `)]}):null,(0,$.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-2 text-sm text-fg`,children:[(0,$.jsx)(`input`,{type:`checkbox`,checked:g,onChange:e=>v(e.target.checked),className:`mt-0.5 size-4 rounded border-edge accent-[var(--color-accent)]`}),(0,$.jsx)(`span`,{children:i.marketplaceRiskConfirm})]})]}):null]}),D.readme?.trim()?(0,$.jsx)(`h4`,{className:`mb-2 mt-6 text-sm font-semibold text-fg`,children:i.marketplaceDetailReadmeHeading}):null,(0,$.jsx)(`div`,{className:`markdown-content min-w-0 break-words text-sm`,children:(0,$.jsx)(u,{content:c})})]}):null}t[6]=r,t[7]=i,t[8]=D,t[9]=A,t[10]=a,t[11]=N,t[12]=j,t[13]=o,t[14]=n,t[15]=F,t[16]=g,t[17]=R,t[18]=z,t[19]=B,t[20]=V,t[21]=H,t[22]=U,t[23]=W,t[24]=K,t[25]=q,t[26]=J,t[27]=Y,t[28]=X}else R=t[17],z=t[18],B=t[19],V=t[20],H=t[21],U=t[22],W=t[23],K=t[24],q=t[25],J=t[26],Y=t[27],X=t[28];if(U!==Symbol.for(`react.early_return_sentinel`))return U;let te;t[62]!==W||t[63]!==K?(te=(0,$.jsx)(`div`,{className:W,children:K}),t[62]=W,t[63]=K,t[64]=te):te=t[64];let ne;t[65]!==d||t[66]!==i.marketplaceBuiltinGoBuiltin||t[67]!==i.marketplaceBuiltinManageHint||t[68]!==i.marketplaceInstall||t[69]!==i.marketplaceReinstall||t[70]!==i.marketplaceReinstallConfirm||t[71]!==i.marketplaceUninstall||t[72]!==i.marketplaceUninstallConfirm||t[73]!==D||t[74]!==N||t[75]!==o||t[76]!==c||t[77]!==l||t[78]!==n||t[79]!==g||t[80]!==P?(ne=D?(0,$.jsx)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-end gap-2 border-t border-edge-subtle px-5 py-4`,children:N===`bundled`?(0,$.jsxs)(`div`,{className:`flex w-full flex-col items-stretch gap-2`,children:[(0,$.jsx)(`p`,{className:`text-sm leading-relaxed text-fg-muted`,children:i.marketplaceBuiltinManageHint}),(0,$.jsx)(s,{to:`/capabilities/extensions?tab=builtin`,onClick:o,className:`inline-flex w-fit items-center justify-center rounded-lg border border-edge px-3 py-2 text-sm font-medium text-fg hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:i.marketplaceBuiltinGoBuiltin})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`button`,{type:`button`,disabled:d||!D.installability.available||!g,onClick:()=>{P&&!window.confirm(i.marketplaceReinstallConfirm)||(p(!0),c(n,P).catch(Ce).finally(()=>p(!1)))},className:m(`inline-flex items-center justify-center gap-1.5 rounded-lg px-3 py-2 text-sm font-medium`,`bg-accent text-on-accent shadow-surface hover:bg-accent-hover`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`,`disabled:pointer-events-none disabled:opacity-50`),children:[d?(0,$.jsx)(oe,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,P?i.marketplaceReinstall:i.marketplaceInstall]}),P?(0,$.jsxs)(`button`,{type:`button`,disabled:d,onClick:()=>{window.confirm(i.marketplaceUninstallConfirm)&&(p(!0),l(n).then(()=>o()).catch(Se).finally(()=>p(!1)))},className:m(`inline-flex items-center justify-center gap-1.5 rounded-lg border border-edge px-3 py-2 text-sm font-medium text-fg`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,`disabled:pointer-events-none disabled:opacity-50`),children:[(0,$.jsx)(I,{className:`size-4 shrink-0`,"aria-hidden":!0}),i.marketplaceUninstall]}):null]})}):null,t[65]=d,t[66]=i.marketplaceBuiltinGoBuiltin,t[67]=i.marketplaceBuiltinManageHint,t[68]=i.marketplaceInstall,t[69]=i.marketplaceReinstall,t[70]=i.marketplaceReinstallConfirm,t[71]=i.marketplaceUninstall,t[72]=i.marketplaceUninstallConfirm,t[73]=D,t[74]=N,t[75]=o,t[76]=c,t[77]=l,t[78]=n,t[79]=g,t[80]=P,t[81]=ne):ne=t[81];let re;t[82]!==R||t[83]!==te||t[84]!==ne||t[85]!==q||t[86]!==J||t[87]!==Y?(re=(0,$.jsxs)(R,{className:q,onOpenAutoFocus:J,children:[Y,te,ne]}),t[82]=R,t[83]=te,t[84]=ne,t[85]=q,t[86]=J,t[87]=Y,t[88]=re):re=t[88];let Z;t[89]!==z||t[90]!==re||t[91]!==X?(Z=(0,$.jsxs)(z,{children:[X,re]}),t[89]=z,t[90]=re,t[91]=X,t[92]=Z):Z=t[92];let ae;return t[93]!==B||t[94]!==V||t[95]!==H||t[96]!==Z?(ae=(0,$.jsx)(B,{defaultOpen:V,onOpenChange:H,children:Z}),t[93]=B,t[94]=V,t[95]=H,t[96]=Z,t[97]=ae):ae=t[97],ae}function Se(){}function Ce(){}function we(e){let[t,n]=e;return(0,$.jsxs)(`li`,{className:`break-words`,children:[(0,$.jsx)(`code`,{children:t}),`: `,Array.isArray(n)?n.join(`, `):String(n)]},t)}function Te(e){return e.preventDefault()}function Ee(e){return!!e.conversationId}function De({embedded:e=!1,onHeaderActionChange:t}){let n=a(),r=i(),l=g(e=>e.language),u=p(l),f=ne(e=>e.setPageHeader),h=ne(e=>e.clearPageHeader),_=K(),v=ae(),[y,b]=o(),x=_e(y.get(`tab`)??(_.some(e=>e.source!==`bundled`)?`user`:null)),S=(0,Q.useRef)(!1),C=y.get(`q`)??``,[w,T]=(0,Q.useState)(x),[E,O]=(0,Q.useState)(C),[k,A]=(0,Q.useState)(null),[j,M]=(0,Q.useState)(!1),P=y.toString(),F=(0,Q.useRef)(P);if(F.current!==P){F.current=P;let e=_e(y.get(`tab`)),t=y.get(`q`)??``;T(t=>t===e?t:e),O(e=>e===t?e:t)}(0,Q.useEffect)(()=>{b(e=>{let t=new URLSearchParams(e),n=E.trim();return n?t.set(`q`,n):t.delete(`q`),w===`marketplace`?t.delete(`tab`):t.set(`tab`,w),t.toString()===e.toString()?e:t},{replace:!0})},[w,E,b]);let I=(0,Q.useMemo)(()=>_.filter(e=>e.source===`bundled`),[_]),L=(0,Q.useMemo)(()=>_.filter(e=>e.source!==`bundled`),[_]);(0,Q.useEffect)(()=>{v||S.current||(S.current=!0,!y.has(`tab`)&&L.length&&T(`user`))},[v,y,L.length]);let R=w===`builtin`?I:L,B=(0,Q.useMemo)(()=>{let e=E.trim().toLowerCase(),t=R;return e&&(t=t.filter(t=>(t.name??``).toLowerCase().includes(e)||t.id.toLowerCase().includes(e)||(t.description??``).toLowerCase().includes(e))),t.toSorted((e,t)=>e.hasUi===t.hasUi?(e.name||e.id).localeCompare(t.name||t.id,l):e.hasUi?-1:1)},[R,E,l]);(0,Q.useEffect)(()=>{A(e=>{if(!e)return e;let t=_.find(t=>t.id===e.id);return t?Oe(e)===Oe(t)&&e.active===t.active&&JSON.stringify(e)===JSON.stringify(t)?e:t:null})},[_]);let W=(0,Q.useMemo)(()=>({searchLabel:w===`marketplace`?u.extensionsPage.marketplaceSearchPlaceholder:u.extensionsPage.searchPlaceholder,search:(0,$.jsx)(ce,{value:E,onChange:O,placeholder:w===`marketplace`?u.extensionsPage.marketplaceSearchPlaceholder:u.extensionsPage.searchPlaceholder}),overflow:(0,$.jsxs)(se,{children:[(0,$.jsx)(V,{asChild:!0,children:(0,$.jsx)(U,{variant:`secondary`,className:`size-9 shrink-0 p-0`,"aria-label":u.capabilitiesHub.moreActions,title:u.capabilitiesHub.moreActions,children:(0,$.jsx)(c,{className:`size-4`,"aria-hidden":!0})})}),(0,$.jsx)(z,{children:(0,$.jsxs)(Y,{align:`end`,sideOffset:6,className:`z-50 min-w-48 rounded-xl border border-edge bg-surface-overlay p-1 shadow-popover`,children:[(0,$.jsxs)(J,{className:m(`touch-target flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover`,N.transition),onSelect:()=>M(!0),children:[(0,$.jsx)(d,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),l.startsWith(`zh`)?`安装插件`:`Install plugin`]}),(0,$.jsx)(J,{asChild:!0,children:(0,$.jsxs)(s,{to:`/local-apps`,className:m(`touch-target flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover`,N.transition),children:[(0,$.jsx)(D,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),u.extensionsPage.openLocalApps]})})]})})]}),primary:(0,$.jsx)(U,{asChild:!0,variant:`primary`,className:`h-9 shrink-0`,children:(0,$.jsxs)(s,{to:`/local-apps/new`,"aria-label":u.extensionsPage.createLocalApp,children:[(0,$.jsx)(d,{className:`size-4`,"aria-hidden":!0}),(0,$.jsx)(`span`,{className:`hidden sm:inline`,children:u.extensionsPage.createLocalApp})]})})}),[l,u.capabilitiesHub.moreActions,u.extensionsPage,w,E]);(0,Q.useLayoutEffect)(()=>e?(t?.(W),()=>t?.(null)):(f({startExtra:null,main:(0,$.jsx)(`div`,{className:`min-w-0`,children:(0,$.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:u.extensionsPage.title})}),end:(0,$.jsx)(le,{contribution:W})}),()=>h()),[h,e,W,u.extensionsPage.title,t,f]);let G=[{id:`user`,label:u.extensionsPage.tabUser,count:v?void 0:L.length},{id:`marketplace`,label:u.extensionsPage.tabMarketplace},{id:`builtin`,label:u.extensionsPage.tabBuiltin,count:v?void 0:I.length}];return(0,$.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col bg-surface-panel`,children:[(0,$.jsxs)(`div`,{className:m(`mx-auto w-full max-w-7xl px-4 sm:px-6 lg:px-8`,`pb-7 pt-3 lg:pb-9 lg:pt-4`),children:[(0,$.jsx)(`div`,{className:`mb-6 border-b border-edge-subtle pb-3`,children:(0,$.jsx)(H,{items:G,activeTab:w,onChange:T,ariaLabel:u.extensionsPage.extensionsNavAria,tabIdPrefix:`extensions-tab`,panelIdPrefix:`extensions-panel`,className:`flex-wrap`})}),w===`marketplace`?(0,$.jsx)(be,{query:E}):v?(0,$.jsx)(Fe,{}):w===`builtin`&&I.length===0?(0,$.jsx)(Le,{message:u.extensionsPage.emptyBuiltin}):w===`user`&&L.length===0?(0,$.jsx)(Le,{message:u.extensionsPage.emptyUser}):B.length===0?(0,$.jsx)(`p`,{className:`px-3 py-14 text-center text-sm text-fg-muted sm:px-5 xl:px-6`,children:u.extensionsPage.noSearchResults}):(0,$.jsx)(`div`,{className:me,children:B.map(e=>(0,$.jsx)(je,{extension:e,copy:u.extensionsPage,onOpen:()=>e.pluginId?n(Z(e.pluginId,`installed`,!1,r.pathname+r.search)):A(e)},e.id))})]}),k?k.format===`agent-plugin`?(0,$.jsx)(ie,{extension:k,onClose:()=>A(null)},k.id):(0,$.jsx)(Ne,{extension:k,copy:u.extensionsPage,onClose:()=>A(null)},k.id):null,j?(0,$.jsx)(ie,{onClose:()=>M(!1)}):null]})}function Oe(e){return e.activationEligible??e.active}function ke(e,t){return e.source===`bundled`?t.providerBundled:e.source===`global`?t.providerGlobal:e.source===`workspace`?t.providerWorkspace:t.providerOther}function Ae(e,t){let n=Oe(e);return n&&e.active?t.runStateLive:n&&!e.active?t.runStatePendingOn:!n&&e.active?t.runStatePendingOff:t.runStateOff}function je(e){let t=(0,pe.c)(56),{extension:n,copy:r,onOpen:o}=e,s=g(Me),c,l;t[0]!==n||t[1]!==s?(l=s.startsWith(`zh`),c=ue(n,l),t[0]=n,t[1]=s,t[2]=c,t[3]=l):(c=t[2],l=t[3]);let u=c,d;t[4]===n?d=t[5]:(d=de(n),t[4]=n,t[5]=d);let f=d,p=n.localizations?.[l?`zh-CN`:`en`]?.description??n.description,m=a(),h=i(),_;t[6]===n?_=t[7]:(_=!!n.pluginId&&fe(n),t[6]=n,t[7]=_);let v=_,y=f?l?`去授权`:`Connect account`:v?l?`开始使用`:`Start using`:l?`管理插件`:`Manage plugin`,b;t[8]!==v||t[9]!==n.pluginId||t[10]!==h||t[11]!==u||t[12]!==m||t[13]!==f||t[14]!==o||t[15]!==l?(b=()=>{v?m(W(u,l)):f&&n.pluginId?m(Z(n.pluginId,`installed`,!0,h.pathname+h.search)):o()},t[8]=v,t[9]=n.pluginId,t[10]=h,t[11]=u,t[12]=m,t[13]=f,t[14]=o,t[15]=l,t[16]=b):b=t[16];let x=b,S=`${u}, ${r.marketplaceDetailTitle}`,C;t[17]!==o||t[18]!==S?(C=(0,$.jsx)(`button`,{type:`button`,"aria-label":S,onClick:o,className:ge}),t[17]=o,t[18]=S,t[19]=C):C=t[19];let w=n.branding?.iconUrl,T;t[20]===w?T=t[21]:(T=(0,$.jsx)(X,{iconUrl:w,fallback:D}),t[20]=w,t[21]=T);let E;t[22]===u?E=t[23]:(E=(0,$.jsx)(`h2`,{className:`line-clamp-2 break-words font-semibold leading-snug text-fg`,title:u,children:u}),t[22]=u,t[23]=E);let O;t[24]===n.provenance?.publisherVerification?O=t[25]:(O=n.provenance?.publisherVerification===`verified`?(0,$.jsx)(P,{className:`mt-0.5 size-3.5 shrink-0 text-emerald-600 dark:text-emerald-400`,strokeWidth:1.75,"aria-label":`Verified`}):null,t[24]=n.provenance?.publisherVerification,t[25]=O);let k;t[26]!==E||t[27]!==O?(k=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-start gap-1.5`,children:[E,O]}),t[26]=E,t[27]=O,t[28]=k):k=t[28];let A;t[29]===n.version?A=t[30]:(A=n.version?(0,$.jsxs)(`span`,{children:[`v`,n.version]}):null,t[29]=n.version,t[30]=A);let j=f?`text-amber-700 dark:text-amber-400`:`text-fg-muted`,M=f?l?`需要授权`:`Authorization required`:Oe(n)?r.statusEnabled:r.runStateOff,N;t[31]!==j||t[32]!==M?(N=(0,$.jsx)(`span`,{className:j,children:M}),t[31]=j,t[32]=M,t[33]=N):N=t[33];let F;t[34]!==A||t[35]!==N?(F=(0,$.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-fg-subtle`,children:[A,N]}),t[34]=A,t[35]=N,t[36]=F):F=t[36];let I;t[37]!==k||t[38]!==F?(I=(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[k,F]}),t[37]=k,t[38]=F,t[39]=I):I=t[39];let L;t[40]!==y||t[41]!==x?(L=(0,$.jsx)(`div`,{className:`pointer-events-auto relative z-10 flex max-w-[45%] shrink-0 items-start`,children:(0,$.jsx)(`button`,{type:`button`,onClick:x,className:`inline-flex items-center justify-center rounded-lg border border-edge px-3 py-2 text-xs font-medium text-fg transition-colors hover:bg-surface-hover active:scale-[0.98] active:bg-surface-hover/80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:y})}),t[40]=y,t[41]=x,t[42]=L):L=t[42];let R;t[43]!==I||t[44]!==L||t[45]!==T?(R=(0,$.jsxs)(`div`,{className:`pointer-events-none relative flex items-start gap-3`,children:[T,I,L]}),t[43]=I,t[44]=L,t[45]=T,t[46]=R):R=t[46];let z;t[47]!==r.cardNoDescription||t[48]!==p?(z=p?.trim()||r.cardNoDescription,t[47]=r.cardNoDescription,t[48]=p,t[49]=z):z=t[49];let B;t[50]===z?B=t[51]:(B=(0,$.jsx)(`p`,{className:`pointer-events-none relative mt-3 line-clamp-3 text-sm leading-relaxed text-fg-muted`,children:z}),t[50]=z,t[51]=B);let V;return t[52]!==R||t[53]!==B||t[54]!==C?(V=(0,$.jsxs)(`article`,{className:he,children:[C,R,B]}),t[52]=R,t[53]=B,t[54]=C,t[55]=V):V=t[55],V}function Me(e){return e.language}function Ne({extension:e,copy:t,onClose:n}){let{mutate:r}=C(),[i,a]=(0,Q.useState)(null),[o,c]=(0,Q.useState)(null),[u,d]=(0,Q.useState)(!1),p=e.activationEligible===!0,h=(0,Q.useCallback)(async()=>{c(null),d(!1),a(`toggle`);try{let{requiresGatewayRestart:t}=await E({extensionId:e.id,enabled:!p});await r(`gateway-extensions-list`),T(),d(t)}catch(e){c(e instanceof Error?e.message:t.extensionToggleFailed)}finally{a(null)}},[p,t.extensionToggleFailed,e.id,r]),g=(0,Q.useCallback)(async()=>{if(!(e.source===`bundled`||!window.confirm(t.extensionUninstallConfirm))){c(null),d(!1),a(`uninstall`);try{await q(e.id),await r(`gateway-extensions-list`),T(),n()}catch(e){c(e instanceof Error?e.message:t.marketplaceUninstallFailed),a(null)}}},[t.extensionUninstallConfirm,t.marketplaceUninstallFailed,e.id,e.source,r,n]),w=e.ui?.contributions?.pages??[],D=e.ui?.contributions?.settingsPanels??[],O=e.ui?.contributions?.chatWidgets??[],j=w.find(e=>e.showInNav)??w[0],M=D[0],N=j?A(e.id,j):null,P=M?`/settings/ext/${e.id}/${M.id}`:e.hasConfigSchema||te(e)?`/settings/ext/${e.id}`:null;return(0,$.jsx)(S,{defaultOpen:!0,onOpenChange:e=>!e&&n(),children:(0,$.jsxs)(y,{children:[(0,$.jsx)(_,{className:`xopc-dialog-overlay fixed inset-0 z-[130] bg-scrim`}),(0,$.jsxs)(b,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[131] flex max-h-[min(90vh,44rem)] w-[min(42rem,calc(100vw-1.5rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay`,onOpenAutoFocus:e=>e.preventDefault(),children:[(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3`,children:[(0,$.jsx)(`button`,{type:`button`,onClick:n,className:`inline-flex size-9 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":t.detailBack,children:(0,$.jsx)(k,{className:`size-5`})}),(0,$.jsx)(x,{className:`min-w-0 flex-1 truncate text-center text-sm font-semibold text-fg`,children:t.detailTitle}),(0,$.jsxs)(v,{className:`sr-only`,children:[e.name,` (`,e.id,`)`]}),(0,$.jsx)(`button`,{type:`button`,onClick:n,className:`inline-flex size-9 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":t.detailClose,children:(0,$.jsx)(f,{className:`size-5`})})]}),(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-start gap-4`,children:[(0,$.jsx)(`div`,{className:`flex size-16 shrink-0 items-center justify-center rounded-2xl bg-accent-soft text-xl font-semibold text-accent-fg`,"aria-hidden":!0,children:(e.name||e.id).charAt(0).toUpperCase()}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`h3`,{className:`text-lg font-semibold text-fg`,children:e.name}),(0,$.jsxs)(`p`,{className:`mt-0.5 text-sm text-fg-muted`,children:[t.detailProviderPrefix,` `,ke(e,t)]}),e.version?(0,$.jsxs)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:[`v`,e.version]}):null]})]}),(0,$.jsx)(`p`,{className:`mt-5 text-sm leading-relaxed text-fg`,children:e.description?.trim()||t.detailNoDescription}),e.hasUi?null:(0,$.jsx)(`p`,{className:`mt-3 text-xs text-fg-muted`,children:t.backendOnlyHint}),(0,$.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:Ae(e,t)}),e.source===`bundled`?(0,$.jsx)(`p`,{className:`mt-4 rounded-lg bg-surface-hover/40 px-3 py-2 text-xs text-fg-muted shadow-surface dark:bg-surface-hover/20`,children:t.builtinConfigHint}):null,(0,$.jsxs)(`div`,{className:`mt-3 rounded-lg bg-surface-hover/40 p-3 shadow-surface dark:bg-surface-hover/20`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,$.jsx)(`span`,{className:`text-xs font-medium text-fg`,children:t.builtinRuntimeToggle}),(0,$.jsx)(U,{type:`button`,variant:`secondary`,disabled:i!==null,onClick:()=>void h(),className:`shrink-0 py-1.5 text-xs`,children:i===`toggle`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(oe,{className:`mr-1.5 size-3.5 shrink-0 animate-spin`,"aria-hidden":!0}),t.builtinToggleBusy]}):p?t.builtinToggleDisable:t.builtinToggleEnable})]}),o?(0,$.jsx)(`p`,{className:`mt-2 text-xs text-rose-600 dark:text-rose-400`,children:o}):null,u?(0,$.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:t.builtinToggleRestartHint}):null,e.source===`bundled`?null:(0,$.jsx)(`div`,{className:`mt-3 flex justify-end border-t border-edge-subtle pt-3`,children:(0,$.jsxs)(U,{type:`button`,variant:`ghost`,disabled:i!==null,onClick:()=>void g(),className:`text-danger hover:bg-danger-soft hover:text-danger`,children:[i===`uninstall`?(0,$.jsx)(oe,{className:`size-3.5 animate-spin`,"aria-hidden":!0}):(0,$.jsx)(I,{className:`size-3.5`,"aria-hidden":!0}),t.marketplaceUninstall]})})]}),e.hasUi&&(w.length>0||D.length>0||O.length>0)?(0,$.jsxs)(`section`,{className:`mt-8`,children:[(0,$.jsx)(`h4`,{className:`mb-3 text-sm font-semibold text-fg`,children:t.detailSectionFeatures}),(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[(0,$.jsx)(Pe,{template:t.badgePages,count:w.length,hidden:w.length===0}),(0,$.jsx)(Pe,{template:t.badgeSettings,count:D.length,hidden:D.length===0}),(0,$.jsx)(Pe,{template:t.badgeWidgets,count:O.length,hidden:O.length===0})]})]}):null,re(e)&&(N||P)?(0,$.jsxs)(`div`,{className:`mt-6 flex flex-wrap gap-2 border-t border-edge-subtle pt-4`,children:[N?(0,$.jsxs)(s,{to:N,onClick:n,className:m(`inline-flex items-center gap-1.5 rounded-lg border border-edge px-3 py-2 text-sm font-medium text-fg`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`),children:[(0,$.jsx)(l,{className:`size-4 shrink-0 opacity-80`,"aria-hidden":!0}),t.open]}):null,P?(0,$.jsxs)(s,{to:P,onClick:n,className:m(`inline-flex items-center gap-1.5 rounded-lg border border-edge px-3 py-2 text-sm font-medium text-fg`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`),children:[(0,$.jsx)(B,{className:`size-4 shrink-0 opacity-80`,"aria-hidden":!0}),t.openSettings]}):null]}):null,(0,$.jsx)(`p`,{className:`mt-6 text-[11px] leading-relaxed text-fg-muted`,children:t.restartNote})]})]})]})})}function Pe(e){let t=(0,pe.c)(6),{template:n,count:r,hidden:i}=e;if(i||r===0)return null;let a;if(t[0]!==r||t[1]!==n){let e;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=/\{\{count\}\}/g,t[3]=e):e=t[3],a=n.replace(e,String(r)),t[0]=r,t[1]=n,t[2]=a}else a=t[2];let o;return t[4]===a?o=t[5]:(o=(0,$.jsx)(`span`,{className:`inline-flex items-center rounded-md bg-surface-hover px-2 py-0.5 text-[11px] font-medium text-fg-muted`,children:a}),t[4]=a,t[5]=o),o}function Fe(){let e=(0,pe.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(`div`,{className:me,"aria-busy":`true`,children:Array.from({length:6},Ie)}),e[0]=t):t=e[0],t}function Ie(e,t){return(0,$.jsx)(G,{className:`h-32 rounded-xl`},t)}function Le(e){let t=(0,pe.c)(2),{message:n}=e,r;return t[0]===n?r=t[1]:(r=(0,$.jsx)(`div`,{className:`flex min-h-[min(40vh,16rem)] flex-col items-center justify-center rounded-xl border border-edge-subtle bg-surface-base px-4 py-12 text-center shadow-surface`,children:(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n})}),t[0]=n,t[1]=r),r}export{De as ExtensionsPage};
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{d as i,f as a,g as o,t as s}from"./chunk-KS7C4IRE-B2HK1psj.js";import{t as c}from"./ellipsis-0k4rZLoy.js";import{t as l}from"./external-link-DjqjBmc3.js";import{t as u}from"./markdown-view-B35a4o1v.js";import{t as d}from"./plus-Q2yW6OE7.js";import{t as f}from"./x-B_N4OPjy.js";import{t as p}from"./messages-D__oW2yE.js";import{t as m}from"./cn-0WouolD0.js";import{c as h,n as g}from"./locale-store-D_migb9R.js";import{a as _,i as v,o as y,r as b,s as x,t as S}from"./dist-BGTk37IG.js";import{a as C,i as w}from"./vendor-swr-BIWyz7Rc.js";import{o as T}from"./gateway-realtime-CP6L2jIR.js";import{$ as E,Ff as D,Jl as O,Kf as k,Ko as A,Ku as j,Q as M,Qc as N,Tf as P,X as F,Yl as I,Z as L,_o as R,_r as z,_u as B,br as V,bs as H,cl as U,ct as W,el as G,es as K,et as q,gr as J,hr as Y,hu as ee,it as X,ns as te,os as ne,rs as re,rt as ie,st as Z,ts as ae,ud as oe,vr as se}from"./index-Cgd4fGVP.js";import{n as ce,t as le}from"./capability-header-actions-BMffrHhT.js";import{n as ue,r as de,t as fe}from"./plugin-presentation-CO5BFDGW.js";var pe=n(),me=`grid auto-rows-fr grid-cols-[repeat(auto-fill,minmax(min(100%,18rem),1fr))] items-stretch gap-4`,he=`relative h-full min-w-0 rounded-xl border border-edge bg-surface-panel p-4 transition-colors hover:border-edge-strong hover:bg-surface-hover/30`,ge=`absolute inset-0 cursor-pointer rounded-xl focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent`,Q=e(t(),1);function _e(e){return e===`builtin`||e===`user`?e:`marketplace`}var $=r();function ve(e,t){let n=e.find(e=>e.id===t||e.pluginId===t||e.provenance?.packageName===t);return n?n.source===`bundled`?`bundled`:`user`:`absent`}var ye={debounced:``,detailPkg:null,quickInstallPkg:null,rowBusy:null,actionError:null,restartHint:null};function be({className:e,query:t}){let n=a(),r=i(),o=g(e=>e.language),s=p(o).extensionsPage,c=h(e=>!!e.conversationId),l=K(),{mutate:u}=C(),[d,f]=(0,Q.useReducer)(R,ye),{debounced:_,detailPkg:v,quickInstallPkg:y,rowBusy:b,actionError:x,restartHint:S}=d,E=c?`marketplace-${_}`:null;(0,Q.useEffect)(()=>{let e=window.setTimeout(()=>f({type:`patch`,patch:{debounced:t.trim()}}),300);return()=>window.clearTimeout(e)},[t]);let{data:D,isLoading:O,error:k}=w(E,()=>F(_),{revalidateOnFocus:!1}),A=(0,Q.useCallback)(()=>{u(`gateway-extensions-list`),T()},[u]),N=(0,Q.useCallback)(async(e,t)=>{f({type:`patch`,patch:{actionError:null,restartHint:null,rowBusy:e}});try{let n=await M({name:e,overwrite:t});A(),n.requiresGatewayRestart&&f({type:`patch`,patch:{restartHint:s.marketplaceRestartHint}})}catch(e){throw f({type:`patch`,patch:{actionError:e instanceof Error?e.message:s.marketplaceInstallFailed}}),e}finally{f({type:`patch`,patch:{rowBusy:null}})}},[s.marketplaceInstallFailed,s.marketplaceRestartHint,A]),L=(0,Q.useCallback)(async e=>{f({type:`patch`,patch:{actionError:null,restartHint:null,rowBusy:e}});try{let t=await q(e);A(),t.requiresGatewayRestart&&f({type:`patch`,patch:{restartHint:s.marketplaceRestartHint}})}catch(e){throw f({type:`patch`,patch:{actionError:e instanceof Error?e.message:s.marketplaceUninstallFailed}}),e}finally{f({type:`patch`,patch:{rowBusy:null}})}},[s.marketplaceRestartHint,s.marketplaceUninstallFailed,A]),z=D??[];return(0,$.jsxs)(`div`,{className:m(`flex flex-col gap-4`,e),children:[k?(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:k instanceof Error?k.message:s.marketplaceLoadFailed}):null,x?(0,$.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:x}):null,S?(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:S}):null,O&&!D?(0,$.jsx)(`ul`,{className:me,"aria-label":s.marketplaceLoading,children:[0,1,2,3,4,5].map(e=>(0,$.jsxs)(`li`,{className:`rounded-xl border border-edge bg-surface-panel p-4`,children:[(0,$.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,$.jsx)(G,{className:`size-10 shrink-0 rounded-xl`}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2`,children:[(0,$.jsx)(G,{className:`h-5 w-full`}),(0,$.jsx)(G,{className:`h-3 w-2/3`})]}),(0,$.jsx)(G,{className:`h-9 w-16 shrink-0 rounded-lg`})]}),(0,$.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,$.jsx)(G,{className:`h-4 w-full`}),(0,$.jsx)(G,{className:`h-4 w-full`}),(0,$.jsx)(G,{className:`h-4 w-2/3`})]})]},e))}):(0,$.jsx)(`ul`,{className:me,children:z.length===0?(0,$.jsx)(`li`,{className:`col-span-full text-sm text-fg-muted`,children:s.marketplaceEmpty}):z.map(e=>{let t=ve(l,e.id),i=b===e.id,a=l.find(t=>t.pluginId===e.id||t.provenance?.packageName===e.id),c=e.localizations?.[o.startsWith(`zh`)?`zh-CN`:`en`],u=c?.displayName??e.name,d=c?.description??e.description;return(0,$.jsxs)(`li`,{className:he,children:[(0,$.jsx)(`button`,{type:`button`,"aria-label":`${u}, ${s.marketplaceDetailTitle}`,onClick:()=>a?.pluginId?n(Z(a.pluginId,`installed`,!1,r.pathname+r.search)):f({type:`patch`,patch:{detailPkg:e.id}}),className:ge}),(0,$.jsxs)(`div`,{className:`pointer-events-none relative flex items-start gap-3`,children:[(0,$.jsx)(X,{iconUrl:e.branding?.iconUrl,fallback:j}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 items-start gap-1.5`,children:[(0,$.jsx)(`h3`,{className:`line-clamp-2 break-words font-semibold leading-snug text-fg`,title:u,children:u}),e.verified?(0,$.jsx)(P,{className:`mt-0.5 size-3.5 shrink-0 text-emerald-600 dark:text-emerald-400`,strokeWidth:1.75,"aria-label":`Verified`}):null]}),(0,$.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-fg-subtle`,children:[e.version?(0,$.jsxs)(`span`,{children:[`v`,e.version]}):null,t===`user`?(0,$.jsx)(`span`,{className:a&&de(a)?`text-amber-700 dark:text-amber-400`:`text-fg-muted`,children:a&&de(a)?o.startsWith(`zh`)?`需要授权`:`Authorization required`:s.marketplaceInstalled}):null]})]}),(0,$.jsx)(`div`,{role:`group`,className:`pointer-events-auto relative z-10 flex max-w-[45%] shrink-0 items-start`,children:t===`bundled`?(0,$.jsx)(`span`,{className:`rounded-md bg-surface-hover px-2 py-1 text-[11px] font-medium text-fg-muted`,children:s.marketplaceBuiltin}):t===`user`?(0,$.jsx)($.Fragment,{children:e.packageType===`plugin`?(0,$.jsx)(`button`,{type:`button`,onClick:()=>a?.pluginId&&fe(a)?n(W(u,o.startsWith(`zh`))):a?.pluginId?n(Z(a.pluginId,`installed`,de(a),r.pathname+r.search)):f({type:`patch`,patch:{detailPkg:e.id,quickInstallPkg:null}}),className:m(`inline-flex items-center justify-center rounded-lg border border-edge px-3 py-2 text-xs font-medium text-fg`,`transition-colors active:scale-[0.98] active:bg-surface-hover/80`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`),children:a&&de(a)?o.startsWith(`zh`)?`去授权`:`Connect account`:a&&fe(a)?o.startsWith(`zh`)?`开始使用`:`Start using`:o.startsWith(`zh`)?`管理插件`:`Manage plugin`}):(0,$.jsxs)(`button`,{type:`button`,disabled:i,onClick:()=>{window.confirm(s.marketplaceUninstallConfirm)&&L(e.id).catch(()=>{})},className:m(`inline-flex items-center justify-center gap-1.5 rounded-lg border border-edge px-3 py-2 text-xs font-medium text-fg`,`transition-colors active:scale-[0.98] active:bg-surface-hover/80`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,`disabled:pointer-events-none disabled:opacity-50`),children:[i?(0,$.jsx)(oe,{className:`size-3.5 animate-spin`,"aria-hidden":!0}):(0,$.jsx)(I,{className:`size-3.5`,strokeWidth:2,"aria-hidden":!0}),s.marketplaceUninstall]})}):(0,$.jsx)(`button`,{type:`button`,onClick:()=>f({type:`patch`,patch:e.packageType===`plugin`?{detailPkg:e.id,quickInstallPkg:e.id}:{detailPkg:e.id,quickInstallPkg:null}}),className:m(`inline-flex min-w-16 items-center justify-center rounded-lg border border-edge px-3 py-2 text-xs font-medium text-fg`,`transition-[transform,background-color] active:scale-[0.98]`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`),children:e.packageType===`plugin`?o.startsWith(`zh`)?`安装`:`Install`:s.marketplaceReview})})]}),d?(0,$.jsx)(`p`,{className:`pointer-events-none relative mt-3 line-clamp-3 text-sm leading-relaxed text-fg-muted`,children:d}):null,(e.categories?.length??0)>0?(0,$.jsx)(`div`,{className:`pointer-events-none relative mt-3 flex flex-wrap gap-1.5`,children:e.categories?.map(e=>(0,$.jsx)(`span`,{className:`max-w-full truncate rounded-md border border-edge px-2 py-0.5 text-xs text-fg-muted`,children:e},e))}):null]},e.id)})}),v?(0,$.jsx)(xe,{packageName:v,autoInstall:y===v,copy:s,extensions:l,onClose:()=>f({type:`patch`,patch:{detailPkg:null,quickInstallPkg:null}}),onInstall:N,onUninstall:L}):null]})}function xe(e){let t=(0,pe.c)(98),{packageName:n,autoInstall:r,copy:i,extensions:a,onClose:o,onInstall:c,onUninstall:l}=e,[d,p]=(0,Q.useState)(!1),[g,v]=(0,Q.useState)(!1),C=h(Ee)?`ext-mp-detail-${n}`:null,T;t[0]===n?T=t[1]:(T=async()=>L(n),t[0]=n,t[1]=T);let E;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(E={revalidateOnFocus:!1},t[2]=E):E=t[2];let{data:D,error:A,isLoading:j}=w(C,T,E),M;t[3]!==a||t[4]!==n?(M=ve(a,n),t[3]=a,t[4]=n,t[5]=M):M=t[5];let N=M,P=N===`user`,F=D?.manifest?.permissions,R,z,B,V,H,U,W,K,q,J,Y,X;if(t[6]!==r||t[7]!==i||t[8]!==D||t[9]!==A||t[10]!==a||t[11]!==N||t[12]!==j||t[13]!==o||t[14]!==n||t[15]!==F||t[16]!==g){U=Symbol.for(`react.early_return_sentinel`);bb0:{let e=F&&typeof F==`object`&&!Array.isArray(F)?Object.entries(F):[],s;t[29]!==i||t[30]!==D?(s=D?.readme?.trim()||(D?.description?.trim()?`### ${D.name}\n\n${D.description}`:`*${i.marketplaceNoReadme}*`),t[29]=i,t[30]=D,t[31]=s):s=t[31];let c=s;if(D?.format===`agent-plugin`){let e;if(t[32]!==D||t[33]!==a||t[34]!==n){let r;t[36]!==D||t[37]!==n?(r=e=>e.provenance?.packageName===n||e.pluginId===D.manifest?.name,t[36]=D,t[37]=n,t[38]=r):r=t[38],e=a.find(r),t[32]=D,t[33]=a,t[34]=n,t[35]=e}else e=t[35];let i=`store:${n}`,s;t[39]!==r||t[40]!==D||t[41]!==o||t[42]!==e||t[43]!==i?(s=(0,$.jsx)(ie,{extension:e,initialSource:i,marketplace:D,autoInstall:r,onClose:o}),t[39]=r,t[40]=D,t[41]=o,t[42]=e,t[43]=i,t[44]=s):s=t[44],U=s;break bb0}B=S,V=!0,t[45]===o?H=t[46]:(H=e=>!e&&o(),t[45]=o,t[46]=H),z=y,t[47]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,$.jsx)(_,{className:`xopc-dialog-overlay fixed inset-0 z-[130] bg-scrim`}),t[47]=X):X=t[47],R=b,q=`xopc-dialog-content fixed left-1/2 top-1/2 z-[131] flex h-[min(44rem,calc(100vh-1.5rem))] w-[min(42rem,calc(100vw-1.5rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay`,J=Te;let l;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,$.jsx)(k,{className:`size-5`}),t[48]=l):l=t[48];let d;t[49]!==i.detailBack||t[50]!==o?(d=(0,$.jsx)(`button`,{type:`button`,onClick:o,className:`inline-flex size-9 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":i.detailBack,children:l}),t[49]=i.detailBack,t[50]=o,t[51]=d):d=t[51];let p;t[52]===i.marketplaceDetailTitle?p=t[53]:(p=(0,$.jsx)(x,{className:`min-w-0 flex-1 truncate text-center text-sm font-semibold text-fg`,children:i.marketplaceDetailTitle}),t[52]=i.marketplaceDetailTitle,t[53]=p);let m;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,$.jsx)(f,{className:`size-5`}),t[54]=m):m=t[54];let h;t[55]!==i.detailClose||t[56]!==o?(h=(0,$.jsx)(`button`,{type:`button`,onClick:o,className:`inline-flex size-9 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":i.detailClose,children:m}),t[55]=i.detailClose,t[56]=o,t[57]=h):h=t[57],t[58]!==d||t[59]!==p||t[60]!==h?(Y=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3`,children:[d,p,h]}),t[58]=d,t[59]=p,t[60]=h,t[61]=Y):Y=t[61],W=`min-h-0 flex-1 overflow-y-auto p-5`,K=j&&!D?(0,$.jsxs)(`div`,{className:`space-y-4`,"aria-label":i.marketplaceLoading,children:[(0,$.jsx)(G,{className:`h-6 w-48`}),(0,$.jsx)(G,{className:`h-4 w-28`}),(0,$.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,$.jsx)(G,{className:`h-12`}),(0,$.jsx)(G,{className:`h-12`})]}),(0,$.jsx)(G,{className:`h-28 w-full`}),(0,$.jsx)(G,{className:`h-36 w-full`})]}):A?(0,$.jsxs)(`div`,{className:`rounded-lg border border-red-300/70 bg-red-50 p-4 text-sm dark:border-red-900 dark:bg-red-950/30`,children:[(0,$.jsx)(`p`,{className:`font-medium text-red-700 dark:text-red-300`,children:i.marketplaceDetailLoadFailed}),(0,$.jsx)(`p`,{className:`mt-1 break-words text-red-600 dark:text-red-400`,children:A instanceof Error?A.message:i.marketplaceLoadFailed})]}):D?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`h3`,{className:`text-lg font-semibold text-fg`,children:D.name}),(0,$.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:(0,$.jsx)(`code`,{className:`rounded bg-surface-panel px-1 py-0.5`,children:D.id})}),(0,$.jsxs)(`dl`,{className:`mt-3 grid gap-2 text-xs text-fg-muted sm:grid-cols-2`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`font-medium text-fg`,children:i.marketplaceAuthor}),(0,$.jsx)(`dd`,{children:D.author.username})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`font-medium text-fg`,children:i.marketplaceVersion}),(0,$.jsx)(`dd`,{children:D.latestVersion.version})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`font-medium text-fg`,children:i.marketplaceDownloads}),(0,$.jsx)(`dd`,{children:D.downloads})]})]}),N===`bundled`?null:(0,$.jsxs)(`section`,{className:`mt-5 space-y-3 rounded-lg border border-edge bg-surface-base p-4`,children:[(0,$.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[D.installability.available?(0,$.jsx)(ee,{className:`mt-0.5 size-5 shrink-0 text-emerald-600 dark:text-emerald-400`,"aria-hidden":!0}):(0,$.jsx)(O,{className:`mt-0.5 size-5 shrink-0 text-amber-600 dark:text-amber-400`,"aria-hidden":!0}),(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`h4`,{className:`text-sm font-semibold text-fg`,children:D.installability.available?i.marketplaceRiskTitle:i.marketplaceUnavailableTitle}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-fg-muted`,children:D.installability.available?i.marketplaceCodeRisk:D.installability.reason??i.marketplaceUnavailableBody})]})]}),D.installability.available?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`dl`,{className:`grid gap-2 text-xs text-fg-muted sm:grid-cols-2`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`font-medium text-fg`,children:i.marketplaceIntegrity}),(0,$.jsx)(`dd`,{children:i.marketplaceIntegrityVerified})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`font-medium text-fg`,children:i.marketplaceDependencies}),(0,$.jsx)(`dd`,{children:D.packageSummary?.dependencyCount??0})]})]}),(0,$.jsxs)(`div`,{className:`text-xs text-fg-muted`,children:[(0,$.jsx)(`p`,{className:`font-medium text-fg`,children:i.marketplacePermissions}),e.length>0?(0,$.jsx)(`ul`,{className:`mt-1 space-y-1`,children:e.map(we)}):(0,$.jsx)(`p`,{className:`mt-1`,children:i.marketplacePermissionsNone})]}),(D.packageSummary?.lifecycleScripts.length??0)>0?(0,$.jsxs)(`p`,{className:`text-xs leading-relaxed text-amber-700 dark:text-amber-300`,children:[i.marketplaceLifecycleScripts,`: `,D.packageSummary?.lifecycleScripts.join(`, `)]}):null,(0,$.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-2 text-sm text-fg`,children:[(0,$.jsx)(`input`,{type:`checkbox`,checked:g,onChange:e=>v(e.target.checked),className:`mt-0.5 size-4 rounded border-edge accent-[var(--color-accent)]`}),(0,$.jsx)(`span`,{children:i.marketplaceRiskConfirm})]})]}):null]}),D.readme?.trim()?(0,$.jsx)(`h4`,{className:`mb-2 mt-6 text-sm font-semibold text-fg`,children:i.marketplaceDetailReadmeHeading}):null,(0,$.jsx)(`div`,{className:`markdown-content min-w-0 break-words text-sm`,children:(0,$.jsx)(u,{content:c})})]}):null}t[6]=r,t[7]=i,t[8]=D,t[9]=A,t[10]=a,t[11]=N,t[12]=j,t[13]=o,t[14]=n,t[15]=F,t[16]=g,t[17]=R,t[18]=z,t[19]=B,t[20]=V,t[21]=H,t[22]=U,t[23]=W,t[24]=K,t[25]=q,t[26]=J,t[27]=Y,t[28]=X}else R=t[17],z=t[18],B=t[19],V=t[20],H=t[21],U=t[22],W=t[23],K=t[24],q=t[25],J=t[26],Y=t[27],X=t[28];if(U!==Symbol.for(`react.early_return_sentinel`))return U;let te;t[62]!==W||t[63]!==K?(te=(0,$.jsx)(`div`,{className:W,children:K}),t[62]=W,t[63]=K,t[64]=te):te=t[64];let ne;t[65]!==d||t[66]!==i.marketplaceBuiltinGoBuiltin||t[67]!==i.marketplaceBuiltinManageHint||t[68]!==i.marketplaceInstall||t[69]!==i.marketplaceReinstall||t[70]!==i.marketplaceReinstallConfirm||t[71]!==i.marketplaceUninstall||t[72]!==i.marketplaceUninstallConfirm||t[73]!==D||t[74]!==N||t[75]!==o||t[76]!==c||t[77]!==l||t[78]!==n||t[79]!==g||t[80]!==P?(ne=D?(0,$.jsx)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-end gap-2 border-t border-edge-subtle px-5 py-4`,children:N===`bundled`?(0,$.jsxs)(`div`,{className:`flex w-full flex-col items-stretch gap-2`,children:[(0,$.jsx)(`p`,{className:`text-sm leading-relaxed text-fg-muted`,children:i.marketplaceBuiltinManageHint}),(0,$.jsx)(s,{to:`/capabilities/extensions?tab=builtin`,onClick:o,className:`inline-flex w-fit items-center justify-center rounded-lg border border-edge px-3 py-2 text-sm font-medium text-fg hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:i.marketplaceBuiltinGoBuiltin})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`button`,{type:`button`,disabled:d||!D.installability.available||!g,onClick:()=>{P&&!window.confirm(i.marketplaceReinstallConfirm)||(p(!0),c(n,P).catch(Ce).finally(()=>p(!1)))},className:m(`inline-flex items-center justify-center gap-1.5 rounded-lg px-3 py-2 text-sm font-medium`,`bg-accent text-on-accent shadow-surface hover:bg-accent-hover`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`,`disabled:pointer-events-none disabled:opacity-50`),children:[d?(0,$.jsx)(oe,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,P?i.marketplaceReinstall:i.marketplaceInstall]}),P?(0,$.jsxs)(`button`,{type:`button`,disabled:d,onClick:()=>{window.confirm(i.marketplaceUninstallConfirm)&&(p(!0),l(n).then(()=>o()).catch(Se).finally(()=>p(!1)))},className:m(`inline-flex items-center justify-center gap-1.5 rounded-lg border border-edge px-3 py-2 text-sm font-medium text-fg`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,`disabled:pointer-events-none disabled:opacity-50`),children:[(0,$.jsx)(I,{className:`size-4 shrink-0`,"aria-hidden":!0}),i.marketplaceUninstall]}):null]})}):null,t[65]=d,t[66]=i.marketplaceBuiltinGoBuiltin,t[67]=i.marketplaceBuiltinManageHint,t[68]=i.marketplaceInstall,t[69]=i.marketplaceReinstall,t[70]=i.marketplaceReinstallConfirm,t[71]=i.marketplaceUninstall,t[72]=i.marketplaceUninstallConfirm,t[73]=D,t[74]=N,t[75]=o,t[76]=c,t[77]=l,t[78]=n,t[79]=g,t[80]=P,t[81]=ne):ne=t[81];let re;t[82]!==R||t[83]!==te||t[84]!==ne||t[85]!==q||t[86]!==J||t[87]!==Y?(re=(0,$.jsxs)(R,{className:q,onOpenAutoFocus:J,children:[Y,te,ne]}),t[82]=R,t[83]=te,t[84]=ne,t[85]=q,t[86]=J,t[87]=Y,t[88]=re):re=t[88];let Z;t[89]!==z||t[90]!==re||t[91]!==X?(Z=(0,$.jsxs)(z,{children:[X,re]}),t[89]=z,t[90]=re,t[91]=X,t[92]=Z):Z=t[92];let ae;return t[93]!==B||t[94]!==V||t[95]!==H||t[96]!==Z?(ae=(0,$.jsx)(B,{defaultOpen:V,onOpenChange:H,children:Z}),t[93]=B,t[94]=V,t[95]=H,t[96]=Z,t[97]=ae):ae=t[97],ae}function Se(){}function Ce(){}function we(e){let[t,n]=e;return(0,$.jsxs)(`li`,{className:`break-words`,children:[(0,$.jsx)(`code`,{children:t}),`: `,Array.isArray(n)?n.join(`, `):String(n)]},t)}function Te(e){return e.preventDefault()}function Ee(e){return!!e.conversationId}function De({embedded:e=!1,onHeaderActionChange:t}){let n=a(),r=i(),l=g(e=>e.language),u=p(l),f=ne(e=>e.setPageHeader),h=ne(e=>e.clearPageHeader),_=K(),v=ae(),[y,b]=o(),x=_e(y.get(`tab`)??(_.some(e=>e.source!==`bundled`)?`user`:null)),S=(0,Q.useRef)(!1),C=y.get(`q`)??``,[w,T]=(0,Q.useState)(x),[E,O]=(0,Q.useState)(C),[k,A]=(0,Q.useState)(null),[j,M]=(0,Q.useState)(!1),P=y.toString(),F=(0,Q.useRef)(P);if(F.current!==P){F.current=P;let e=_e(y.get(`tab`)),t=y.get(`q`)??``;T(t=>t===e?t:e),O(e=>e===t?e:t)}(0,Q.useEffect)(()=>{b(e=>{let t=new URLSearchParams(e),n=E.trim();return n?t.set(`q`,n):t.delete(`q`),w===`marketplace`?t.delete(`tab`):t.set(`tab`,w),t.toString()===e.toString()?e:t},{replace:!0})},[w,E,b]);let I=(0,Q.useMemo)(()=>_.filter(e=>e.source===`bundled`),[_]),L=(0,Q.useMemo)(()=>_.filter(e=>e.source!==`bundled`),[_]);(0,Q.useEffect)(()=>{v||S.current||(S.current=!0,!y.has(`tab`)&&L.length&&T(`user`))},[v,y,L.length]);let R=w===`builtin`?I:L,B=(0,Q.useMemo)(()=>{let e=E.trim().toLowerCase(),t=R;return e&&(t=t.filter(t=>(t.name??``).toLowerCase().includes(e)||t.id.toLowerCase().includes(e)||(t.description??``).toLowerCase().includes(e))),t.toSorted((e,t)=>e.hasUi===t.hasUi?(e.name||e.id).localeCompare(t.name||t.id,l):e.hasUi?-1:1)},[R,E,l]);(0,Q.useEffect)(()=>{A(e=>{if(!e)return e;let t=_.find(t=>t.id===e.id);return t?Oe(e)===Oe(t)&&e.active===t.active&&JSON.stringify(e)===JSON.stringify(t)?e:t:null})},[_]);let W=(0,Q.useMemo)(()=>({searchLabel:w===`marketplace`?u.extensionsPage.marketplaceSearchPlaceholder:u.extensionsPage.searchPlaceholder,search:(0,$.jsx)(ce,{value:E,onChange:O,placeholder:w===`marketplace`?u.extensionsPage.marketplaceSearchPlaceholder:u.extensionsPage.searchPlaceholder}),overflow:(0,$.jsxs)(se,{children:[(0,$.jsx)(V,{asChild:!0,children:(0,$.jsx)(U,{variant:`secondary`,className:`size-9 shrink-0 p-0`,"aria-label":u.capabilitiesHub.moreActions,title:u.capabilitiesHub.moreActions,children:(0,$.jsx)(c,{className:`size-4`,"aria-hidden":!0})})}),(0,$.jsx)(z,{children:(0,$.jsxs)(Y,{align:`end`,sideOffset:6,className:`z-50 min-w-48 rounded-xl border border-edge bg-surface-overlay p-1 shadow-popover`,children:[(0,$.jsxs)(J,{className:m(`touch-target flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover`,N.transition),onSelect:()=>M(!0),children:[(0,$.jsx)(d,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),l.startsWith(`zh`)?`安装插件`:`Install plugin`]}),(0,$.jsx)(J,{asChild:!0,children:(0,$.jsxs)(s,{to:`/local-apps`,className:m(`touch-target flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover`,N.transition),children:[(0,$.jsx)(D,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),u.extensionsPage.openLocalApps]})})]})})]}),primary:(0,$.jsx)(U,{asChild:!0,variant:`primary`,className:`h-9 shrink-0`,children:(0,$.jsxs)(s,{to:`/local-apps/new`,"aria-label":u.extensionsPage.createLocalApp,children:[(0,$.jsx)(d,{className:`size-4`,"aria-hidden":!0}),(0,$.jsx)(`span`,{className:`hidden sm:inline`,children:u.extensionsPage.createLocalApp})]})})}),[l,u.capabilitiesHub.moreActions,u.extensionsPage,w,E]);(0,Q.useLayoutEffect)(()=>e?(t?.(W),()=>t?.(null)):(f({startExtra:null,main:(0,$.jsx)(`div`,{className:`min-w-0`,children:(0,$.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:u.extensionsPage.title})}),end:(0,$.jsx)(le,{contribution:W})}),()=>h()),[h,e,W,u.extensionsPage.title,t,f]);let G=[{id:`user`,label:u.extensionsPage.tabUser,count:v?void 0:L.length},{id:`marketplace`,label:u.extensionsPage.tabMarketplace},{id:`builtin`,label:u.extensionsPage.tabBuiltin,count:v?void 0:I.length}];return(0,$.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col bg-surface-panel`,children:[(0,$.jsxs)(`div`,{className:m(`mx-auto w-full max-w-7xl px-4 sm:px-6 lg:px-8`,`pb-7 pt-3 lg:pb-9 lg:pt-4`),children:[(0,$.jsx)(`div`,{className:`mb-6 border-b border-edge-subtle pb-3`,children:(0,$.jsx)(H,{items:G,activeTab:w,onChange:T,ariaLabel:u.extensionsPage.extensionsNavAria,tabIdPrefix:`extensions-tab`,panelIdPrefix:`extensions-panel`,className:`flex-wrap`})}),w===`marketplace`?(0,$.jsx)(be,{query:E}):v?(0,$.jsx)(Fe,{}):w===`builtin`&&I.length===0?(0,$.jsx)(Le,{message:u.extensionsPage.emptyBuiltin}):w===`user`&&L.length===0?(0,$.jsx)(Le,{message:u.extensionsPage.emptyUser}):B.length===0?(0,$.jsx)(`p`,{className:`px-3 py-14 text-center text-sm text-fg-muted sm:px-5 xl:px-6`,children:u.extensionsPage.noSearchResults}):(0,$.jsx)(`div`,{className:me,children:B.map(e=>(0,$.jsx)(je,{extension:e,copy:u.extensionsPage,onOpen:()=>e.pluginId?n(Z(e.pluginId,`installed`,!1,r.pathname+r.search)):A(e)},e.id))})]}),k?k.format===`agent-plugin`?(0,$.jsx)(ie,{extension:k,onClose:()=>A(null)},k.id):(0,$.jsx)(Ne,{extension:k,copy:u.extensionsPage,onClose:()=>A(null)},k.id):null,j?(0,$.jsx)(ie,{onClose:()=>M(!1)}):null]})}function Oe(e){return e.activationEligible??e.active}function ke(e,t){return e.source===`bundled`?t.providerBundled:e.source===`global`?t.providerGlobal:e.source===`workspace`?t.providerWorkspace:t.providerOther}function Ae(e,t){let n=Oe(e);return n&&e.active?t.runStateLive:n&&!e.active?t.runStatePendingOn:!n&&e.active?t.runStatePendingOff:t.runStateOff}function je(e){let t=(0,pe.c)(56),{extension:n,copy:r,onOpen:o}=e,s=g(Me),c,l;t[0]!==n||t[1]!==s?(l=s.startsWith(`zh`),c=ue(n,l),t[0]=n,t[1]=s,t[2]=c,t[3]=l):(c=t[2],l=t[3]);let u=c,d;t[4]===n?d=t[5]:(d=de(n),t[4]=n,t[5]=d);let f=d,p=n.localizations?.[l?`zh-CN`:`en`]?.description??n.description,m=a(),h=i(),_;t[6]===n?_=t[7]:(_=!!n.pluginId&&fe(n),t[6]=n,t[7]=_);let v=_,y=f?l?`去授权`:`Connect account`:v?l?`开始使用`:`Start using`:l?`管理插件`:`Manage plugin`,b;t[8]!==v||t[9]!==n.pluginId||t[10]!==h||t[11]!==u||t[12]!==m||t[13]!==f||t[14]!==o||t[15]!==l?(b=()=>{v?m(W(u,l)):f&&n.pluginId?m(Z(n.pluginId,`installed`,!0,h.pathname+h.search)):o()},t[8]=v,t[9]=n.pluginId,t[10]=h,t[11]=u,t[12]=m,t[13]=f,t[14]=o,t[15]=l,t[16]=b):b=t[16];let x=b,S=`${u}, ${r.marketplaceDetailTitle}`,C;t[17]!==o||t[18]!==S?(C=(0,$.jsx)(`button`,{type:`button`,"aria-label":S,onClick:o,className:ge}),t[17]=o,t[18]=S,t[19]=C):C=t[19];let w=n.branding?.iconUrl,T;t[20]===w?T=t[21]:(T=(0,$.jsx)(X,{iconUrl:w,fallback:D}),t[20]=w,t[21]=T);let E;t[22]===u?E=t[23]:(E=(0,$.jsx)(`h2`,{className:`line-clamp-2 break-words font-semibold leading-snug text-fg`,title:u,children:u}),t[22]=u,t[23]=E);let O;t[24]===n.provenance?.publisherVerification?O=t[25]:(O=n.provenance?.publisherVerification===`verified`?(0,$.jsx)(P,{className:`mt-0.5 size-3.5 shrink-0 text-emerald-600 dark:text-emerald-400`,strokeWidth:1.75,"aria-label":`Verified`}):null,t[24]=n.provenance?.publisherVerification,t[25]=O);let k;t[26]!==E||t[27]!==O?(k=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-start gap-1.5`,children:[E,O]}),t[26]=E,t[27]=O,t[28]=k):k=t[28];let A;t[29]===n.version?A=t[30]:(A=n.version?(0,$.jsxs)(`span`,{children:[`v`,n.version]}):null,t[29]=n.version,t[30]=A);let j=f?`text-amber-700 dark:text-amber-400`:`text-fg-muted`,M=f?l?`需要授权`:`Authorization required`:Oe(n)?r.statusEnabled:r.runStateOff,N;t[31]!==j||t[32]!==M?(N=(0,$.jsx)(`span`,{className:j,children:M}),t[31]=j,t[32]=M,t[33]=N):N=t[33];let F;t[34]!==A||t[35]!==N?(F=(0,$.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-fg-subtle`,children:[A,N]}),t[34]=A,t[35]=N,t[36]=F):F=t[36];let I;t[37]!==k||t[38]!==F?(I=(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[k,F]}),t[37]=k,t[38]=F,t[39]=I):I=t[39];let L;t[40]!==y||t[41]!==x?(L=(0,$.jsx)(`div`,{className:`pointer-events-auto relative z-10 flex max-w-[45%] shrink-0 items-start`,children:(0,$.jsx)(`button`,{type:`button`,onClick:x,className:`inline-flex items-center justify-center rounded-lg border border-edge px-3 py-2 text-xs font-medium text-fg transition-colors hover:bg-surface-hover active:scale-[0.98] active:bg-surface-hover/80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:y})}),t[40]=y,t[41]=x,t[42]=L):L=t[42];let R;t[43]!==I||t[44]!==L||t[45]!==T?(R=(0,$.jsxs)(`div`,{className:`pointer-events-none relative flex items-start gap-3`,children:[T,I,L]}),t[43]=I,t[44]=L,t[45]=T,t[46]=R):R=t[46];let z;t[47]!==r.cardNoDescription||t[48]!==p?(z=p?.trim()||r.cardNoDescription,t[47]=r.cardNoDescription,t[48]=p,t[49]=z):z=t[49];let B;t[50]===z?B=t[51]:(B=(0,$.jsx)(`p`,{className:`pointer-events-none relative mt-3 line-clamp-3 text-sm leading-relaxed text-fg-muted`,children:z}),t[50]=z,t[51]=B);let V;return t[52]!==R||t[53]!==B||t[54]!==C?(V=(0,$.jsxs)(`article`,{className:he,children:[C,R,B]}),t[52]=R,t[53]=B,t[54]=C,t[55]=V):V=t[55],V}function Me(e){return e.language}function Ne({extension:e,copy:t,onClose:n}){let{mutate:r}=C(),[i,a]=(0,Q.useState)(null),[o,c]=(0,Q.useState)(null),[u,d]=(0,Q.useState)(!1),p=e.activationEligible===!0,h=(0,Q.useCallback)(async()=>{c(null),d(!1),a(`toggle`);try{let{requiresGatewayRestart:t}=await E({extensionId:e.id,enabled:!p});await r(`gateway-extensions-list`),T(),d(t)}catch(e){c(e instanceof Error?e.message:t.extensionToggleFailed)}finally{a(null)}},[p,t.extensionToggleFailed,e.id,r]),g=(0,Q.useCallback)(async()=>{if(!(e.source===`bundled`||!window.confirm(t.extensionUninstallConfirm))){c(null),d(!1),a(`uninstall`);try{await q(e.id),await r(`gateway-extensions-list`),T(),n()}catch(e){c(e instanceof Error?e.message:t.marketplaceUninstallFailed),a(null)}}},[t.extensionUninstallConfirm,t.marketplaceUninstallFailed,e.id,e.source,r,n]),w=e.ui?.contributions?.pages??[],D=e.ui?.contributions?.settingsPanels??[],O=e.ui?.contributions?.chatWidgets??[],j=w.find(e=>e.showInNav)??w[0],M=D[0],N=j?A(e.id,j):null,P=M?`/settings/ext/${e.id}/${M.id}`:e.hasConfigSchema||te(e)?`/settings/ext/${e.id}`:null;return(0,$.jsx)(S,{defaultOpen:!0,onOpenChange:e=>!e&&n(),children:(0,$.jsxs)(y,{children:[(0,$.jsx)(_,{className:`xopc-dialog-overlay fixed inset-0 z-[130] bg-scrim`}),(0,$.jsxs)(b,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[131] flex max-h-[min(90vh,44rem)] w-[min(42rem,calc(100vw-1.5rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay`,onOpenAutoFocus:e=>e.preventDefault(),children:[(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3`,children:[(0,$.jsx)(`button`,{type:`button`,onClick:n,className:`inline-flex size-9 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":t.detailBack,children:(0,$.jsx)(k,{className:`size-5`})}),(0,$.jsx)(x,{className:`min-w-0 flex-1 truncate text-center text-sm font-semibold text-fg`,children:t.detailTitle}),(0,$.jsxs)(v,{className:`sr-only`,children:[e.name,` (`,e.id,`)`]}),(0,$.jsx)(`button`,{type:`button`,onClick:n,className:`inline-flex size-9 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":t.detailClose,children:(0,$.jsx)(f,{className:`size-5`})})]}),(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-start gap-4`,children:[(0,$.jsx)(`div`,{className:`flex size-16 shrink-0 items-center justify-center rounded-2xl bg-accent-soft text-xl font-semibold text-accent-fg`,"aria-hidden":!0,children:(e.name||e.id).charAt(0).toUpperCase()}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`h3`,{className:`text-lg font-semibold text-fg`,children:e.name}),(0,$.jsxs)(`p`,{className:`mt-0.5 text-sm text-fg-muted`,children:[t.detailProviderPrefix,` `,ke(e,t)]}),e.version?(0,$.jsxs)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:[`v`,e.version]}):null]})]}),(0,$.jsx)(`p`,{className:`mt-5 text-sm leading-relaxed text-fg`,children:e.description?.trim()||t.detailNoDescription}),e.hasUi?null:(0,$.jsx)(`p`,{className:`mt-3 text-xs text-fg-muted`,children:t.backendOnlyHint}),(0,$.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:Ae(e,t)}),e.source===`bundled`?(0,$.jsx)(`p`,{className:`mt-4 rounded-lg bg-surface-hover/40 px-3 py-2 text-xs text-fg-muted shadow-surface dark:bg-surface-hover/20`,children:t.builtinConfigHint}):null,(0,$.jsxs)(`div`,{className:`mt-3 rounded-lg bg-surface-hover/40 p-3 shadow-surface dark:bg-surface-hover/20`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,$.jsx)(`span`,{className:`text-xs font-medium text-fg`,children:t.builtinRuntimeToggle}),(0,$.jsx)(U,{type:`button`,variant:`secondary`,disabled:i!==null,onClick:()=>void h(),className:`shrink-0 py-1.5 text-xs`,children:i===`toggle`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(oe,{className:`mr-1.5 size-3.5 shrink-0 animate-spin`,"aria-hidden":!0}),t.builtinToggleBusy]}):p?t.builtinToggleDisable:t.builtinToggleEnable})]}),o?(0,$.jsx)(`p`,{className:`mt-2 text-xs text-rose-600 dark:text-rose-400`,children:o}):null,u?(0,$.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:t.builtinToggleRestartHint}):null,e.source===`bundled`?null:(0,$.jsx)(`div`,{className:`mt-3 flex justify-end border-t border-edge-subtle pt-3`,children:(0,$.jsxs)(U,{type:`button`,variant:`ghost`,disabled:i!==null,onClick:()=>void g(),className:`text-danger hover:bg-danger-soft hover:text-danger`,children:[i===`uninstall`?(0,$.jsx)(oe,{className:`size-3.5 animate-spin`,"aria-hidden":!0}):(0,$.jsx)(I,{className:`size-3.5`,"aria-hidden":!0}),t.marketplaceUninstall]})})]}),e.hasUi&&(w.length>0||D.length>0||O.length>0)?(0,$.jsxs)(`section`,{className:`mt-8`,children:[(0,$.jsx)(`h4`,{className:`mb-3 text-sm font-semibold text-fg`,children:t.detailSectionFeatures}),(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[(0,$.jsx)(Pe,{template:t.badgePages,count:w.length,hidden:w.length===0}),(0,$.jsx)(Pe,{template:t.badgeSettings,count:D.length,hidden:D.length===0}),(0,$.jsx)(Pe,{template:t.badgeWidgets,count:O.length,hidden:O.length===0})]})]}):null,re(e)&&(N||P)?(0,$.jsxs)(`div`,{className:`mt-6 flex flex-wrap gap-2 border-t border-edge-subtle pt-4`,children:[N?(0,$.jsxs)(s,{to:N,onClick:n,className:m(`inline-flex items-center gap-1.5 rounded-lg border border-edge px-3 py-2 text-sm font-medium text-fg`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`),children:[(0,$.jsx)(l,{className:`size-4 shrink-0 opacity-80`,"aria-hidden":!0}),t.open]}):null,P?(0,$.jsxs)(s,{to:P,onClick:n,className:m(`inline-flex items-center gap-1.5 rounded-lg border border-edge px-3 py-2 text-sm font-medium text-fg`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`),children:[(0,$.jsx)(B,{className:`size-4 shrink-0 opacity-80`,"aria-hidden":!0}),t.openSettings]}):null]}):null,(0,$.jsx)(`p`,{className:`mt-6 text-[11px] leading-relaxed text-fg-muted`,children:t.restartNote})]})]})]})})}function Pe(e){let t=(0,pe.c)(6),{template:n,count:r,hidden:i}=e;if(i||r===0)return null;let a;if(t[0]!==r||t[1]!==n){let e;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=/\{\{count\}\}/g,t[3]=e):e=t[3],a=n.replace(e,String(r)),t[0]=r,t[1]=n,t[2]=a}else a=t[2];let o;return t[4]===a?o=t[5]:(o=(0,$.jsx)(`span`,{className:`inline-flex items-center rounded-md bg-surface-hover px-2 py-0.5 text-[11px] font-medium text-fg-muted`,children:a}),t[4]=a,t[5]=o),o}function Fe(){let e=(0,pe.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(`div`,{className:me,"aria-busy":`true`,children:Array.from({length:6},Ie)}),e[0]=t):t=e[0],t}function Ie(e,t){return(0,$.jsx)(G,{className:`h-32 rounded-xl`},t)}function Le(e){let t=(0,pe.c)(2),{message:n}=e,r;return t[0]===n?r=t[1]:(r=(0,$.jsx)(`div`,{className:`flex min-h-[min(40vh,16rem)] flex-col items-center justify-center rounded-xl border border-edge-subtle bg-surface-base px-4 py-12 text-center shadow-surface`,children:(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n})}),t[0]=n,t[1]=r),r}export{De as ExtensionsPage};
|
package/dist/gateway/static/root/assets/{archive-plugin-CNjE6PYZ.js → archive-plugin-BjWaZIHe.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./messages-D__oW2yE.js";import{t as a}from"./jszip.min-DT31yWkU.js";import{t as o}from"./preview-open-alternatives-
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./messages-D__oW2yE.js";import{t as a}from"./jszip.min-DT31yWkU.js";import{t as o}from"./preview-open-alternatives-6XU-2lVI.js";var s=n(),c=e(a(),1),l=e(t(),1),u=r();function d(e){let t=(0,s.c)(17),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=[],t[0]=n):n=t[0];let[r,a]=(0,l.useState)(n),[d,m]=(0,l.useState)(null),h,g;if(t[1]===e.binaryBuffer?(h=t[2],g=t[3]):(h=()=>{if(!e.binaryBuffer)return;let t=!1;return c.default.loadAsync(e.binaryBuffer).then(e=>{t||a(Object.values(e.files).slice(0,500).map(p))}).catch(e=>{t||m(e instanceof Error?e.message:String(e))}),()=>{t=!0}},g=[e.binaryBuffer],t[1]=e.binaryBuffer,t[2]=h,t[3]=g),(0,l.useEffect)(h,g),d){let n;t[4]===e.language?n=t[5]:(n=i(e.language),t[4]=e.language,t[5]=n);let r=n,a;t[6]!==r.chat.attachmentPreviewDownloadFull||t[7]!==r.chat.attachmentPreviewOpenElsewhereHint||t[8]!==e.actions.onDownload?(a=(0,u.jsx)(o,{message:r.chat.attachmentPreviewOpenElsewhereHint,downloadLabel:r.chat.attachmentPreviewDownloadFull,onDownload:e.actions.onDownload}),t[6]=r.chat.attachmentPreviewDownloadFull,t[7]=r.chat.attachmentPreviewOpenElsewhereHint,t[8]=e.actions.onDownload,t[9]=a):a=t[9];let s;t[10]===d?s=t[11]:(s=(0,u.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:d}),t[10]=d,t[11]=s);let c;return t[12]!==a||t[13]!==s?(c=(0,u.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 overflow-auto p-4`,children:[a,s]}),t[12]=a,t[13]=s,t[14]=c):c=t[14],c}let _;return t[15]===r?_=t[16]:(_=(0,u.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto p-4`,children:(0,u.jsx)(`div`,{className:`overflow-hidden rounded-lg border border-edge bg-surface-panel`,children:r.length===0?(0,u.jsx)(`p`,{className:`p-4 text-sm text-fg-muted`,children:`Loading archive...`}):(0,u.jsx)(`table`,{className:`w-full text-left text-xs`,children:(0,u.jsx)(`tbody`,{children:r.map(f)})})})}),t[15]=r,t[16]=_),_}function f(e){return(0,u.jsxs)(`tr`,{className:`border-b border-edge-subtle last:border-b-0 dark:border-edge`,children:[(0,u.jsx)(`td`,{className:`max-w-0 truncate px-3 py-2 font-mono text-fg`,title:e.name,children:e.dir?`${e.name}/`:e.name}),(0,u.jsx)(`td`,{className:`w-24 px-3 py-2 text-right text-fg-muted`,children:e.dir?``:m(e.size)})]},e.name)}function p(e){return{name:e.name,dir:e.dir,size:e.dir?0:e._data?.uncompressedSize??0}}function m(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}export{d as ArchivePreviewPluginView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./vendor-react-BOUWij0V.js";import{t as n}from"./automations-workspace-
|
|
1
|
+
import{n as e,t}from"./vendor-react-BOUWij0V.js";import{t as n}from"./automations-workspace-qfEjk_ws.js";var r=e(),i=t();function a(){let e=(0,r.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,i.jsx)(n,{}),e[0]=t):t=e[0],t}export{a as AutomationsPage};
|