@xopcai/xopc 0.0.342 → 0.0.343

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/dist/browser-ext/manifest.json +1 -1
  2. package/dist/extensions/telegram/xopc.extension.json +1 -1
  3. package/dist/gateway/static/root/assets/{agent-avatar-dicebear-BHTH7Hzp.js → agent-avatar-dicebear-OdCjh7Uk.js} +1 -1
  4. package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-C70FWAHE.js → agent-defaults-settings-panel-D2jM8-6a.js} +1 -1
  5. package/dist/gateway/static/root/assets/agent-plugin-dialog-DROFTZFm.js +1 -0
  6. package/dist/gateway/static/root/assets/{agents-BqIiqYmt.js → agents-DbNmfDz4.js} +3 -3
  7. package/dist/gateway/static/root/assets/{agents-admin-api-Op3XAo56.js → agents-admin-api-BTYHoqlW.js} +1 -1
  8. package/dist/gateway/static/root/assets/{app-management-settings-panel-DrvjGsNn.js → app-management-settings-panel-BXw-vVlF.js} +1 -1
  9. package/dist/gateway/static/root/assets/{appearance-settings-CdYUxeW5.js → appearance-settings-Cay2hdZQ.js} +1 -1
  10. package/dist/gateway/static/root/assets/apps-page-CGOWQcfW.js +1 -0
  11. package/dist/gateway/static/root/assets/{archive-plugin-Dvl6N_oW.js → archive-plugin-DHMiyjSI.js} +1 -1
  12. package/dist/gateway/static/root/assets/{automations-page-7eSAb9Fz.js → automations-page-BThSFXHJ.js} +1 -1
  13. package/dist/gateway/static/root/assets/{automations-workspace-BXLmMZKj.js → automations-workspace-CjcoBe8C.js} +1 -1
  14. package/dist/gateway/static/root/assets/{binary-plugins-B6fBdtZm.js → binary-plugins-byt96_qG.js} +1 -1
  15. package/dist/gateway/static/root/assets/{block-editor-DnMibNrZ.js → block-editor-K802cFyb.js} +1 -1
  16. package/dist/gateway/static/root/assets/{browser-automation-inputs-CX5HElxM.js → browser-automation-inputs-UYRx7nE_.js} +1 -1
  17. package/dist/gateway/static/root/assets/{browser-automations-page-fTkFKnIa.js → browser-automations-page-B1lQGEkW.js} +1 -1
  18. package/dist/gateway/static/root/assets/{browser-settings-page-CGF08LW0.js → browser-settings-page-DZ5180rV.js} +1 -1
  19. package/dist/gateway/static/root/assets/{capabilities-DSg8th5w.js → capabilities-B-2wxCUQ.js} +1 -1
  20. package/dist/gateway/static/root/assets/{capabilities-page-CBQUqwHq.js → capabilities-page-DnVJ1i4a.js} +2 -2
  21. package/dist/gateway/static/root/assets/{capabilities-settings-panel-BIXA7-_a.js → capabilities-settings-panel-DJy_36Jt.js} +1 -1
  22. package/dist/gateway/static/root/assets/{capability-header-actions-UQmVc6ea.js → capability-header-actions-C8R83Cav.js} +1 -1
  23. package/dist/gateway/static/root/assets/{channels-Cwqvvnpy.js → channels-Bx3FJ4TT.js} +1 -1
  24. package/dist/gateway/static/root/assets/{chat-terminal-dock-81LOYomp.js → chat-terminal-dock-BW7zsvzW.js} +1 -1
  25. package/dist/gateway/static/root/assets/{computer-settings-page-DffgMAWa.js → computer-settings-page-3Z0kjf87.js} +1 -1
  26. package/dist/gateway/static/root/assets/{connector-service-page-DjKxEmO4.js → connector-service-page-C4HYXHOH.js} +1 -1
  27. package/dist/gateway/static/root/assets/{connectors-page-w-DTg9X-.js → connectors-page-De6zFI3V.js} +1 -1
  28. package/dist/gateway/static/root/assets/{date-picker--gtRUEYY.js → date-picker-CSUv46BG.js} +1 -1
  29. package/dist/gateway/static/root/assets/{dependency-picker-OM5MJcAI.js → dependency-picker-sEG3RRYM.js} +1 -1
  30. package/dist/gateway/static/root/assets/{desktop-pet-Ck5QncbS.js → desktop-pet-CQlnRx7M.js} +1 -1
  31. package/dist/gateway/static/root/assets/{desktop-pet-settings-Be9YZ7dP.js → desktop-pet-settings-qgp30ZmU.js} +1 -1
  32. package/dist/gateway/static/root/assets/{device-pairing-wizard-CG2bKfYq.js → device-pairing-wizard-CuOOp_vt.js} +1 -1
  33. package/dist/gateway/static/root/assets/{directory-picker-path-field-CS-rIYvx.js → directory-picker-path-field-D6BzEAES.js} +1 -1
  34. package/dist/gateway/static/root/assets/{extension-debug-page-yeovsc29.js → extension-debug-page-C4ZjNBTE.js} +1 -1
  35. package/dist/gateway/static/root/assets/{extension-page-BGXlLDIK.js → extension-page-ClPR-yDj.js} +1 -1
  36. package/dist/gateway/static/root/assets/{extension-settings-page-1T5JWoRQ.js → extension-settings-page-Dst317-q.js} +1 -1
  37. package/dist/gateway/static/root/assets/{gateway-config-swr-D_oNkPwY.js → gateway-config-swr-DcE8n_ZS.js} +1 -1
  38. package/dist/gateway/static/root/assets/{gateway-realtime-B6tO02l7.js → gateway-realtime-BeUJkjA3.js} +1 -1
  39. package/dist/gateway/static/root/assets/gateway-realtime-store-C-8wwbt_.js +1 -0
  40. package/dist/gateway/static/root/assets/{gateway-settings-DXaGFC4E.js → gateway-settings-BlaPXdIN.js} +1 -1
  41. package/dist/gateway/static/root/assets/{gateway-startup-retry-DVo2M1Ed.js → gateway-startup-retry-CCPlq9Lk.js} +1 -1
  42. package/dist/gateway/static/root/assets/{home-page-Be8_HeNB.js → home-page-C2Gp_tso.js} +1 -1
  43. package/dist/gateway/static/root/assets/{image-generation-api-DjyB_9yW.js → image-generation-api-D1Uh-05P.js} +1 -1
  44. package/dist/gateway/static/root/assets/{imports-page-DHoZ6dWz.js → imports-page-BDgxU2ET.js} +1 -1
  45. package/dist/gateway/static/root/assets/index-Ca6iqaCn.css +1 -0
  46. package/dist/gateway/static/root/assets/index-D-LtkNzW.js +106 -0
  47. package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-DOloJmHM.js → keyboard-shortcuts-settings-BHZF0_KC.js} +1 -1
  48. package/dist/gateway/static/root/assets/{local-app-workbench-page-DzvhfcOp.js → local-app-workbench-page-BOoe51nH.js} +1 -1
  49. package/dist/gateway/static/root/assets/{local-apps-page-BcZxG7Sm.js → local-apps-page-vbEe3zju.js} +1 -1
  50. package/dist/gateway/static/root/assets/{local-session-drafts-yZc4OIxG.js → local-session-drafts-D9DeB55u.js} +1 -1
  51. package/dist/gateway/static/root/assets/{locale-store-CCYf4Qxv.js → locale-store-B0WmWiCo.js} +1 -1
  52. package/dist/gateway/static/root/assets/{logs-page-jPeHW3s9.js → logs-page-HIFM6HX7.js} +1 -1
  53. package/dist/gateway/static/root/assets/{management-settings-Dal0gIED.js → management-settings-Ik8JRg3D.js} +1 -1
  54. package/dist/gateway/static/root/assets/{markdown-view-gPnGW4pR.js → markdown-view-CSADmLmZ.js} +1 -1
  55. package/dist/gateway/static/root/assets/{media-plugins-BqXBeW_0.js → media-plugins-DAJm1Z0g.js} +1 -1
  56. package/dist/gateway/static/root/assets/messages-CTKYRqR-.js +3 -0
  57. package/dist/gateway/static/root/assets/{note-detail-panel-Dnd6FEft.js → note-detail-panel-CBz3J5Ey.js} +3 -3
  58. package/dist/gateway/static/root/assets/{notes-page-DWMxG17u.js → notes-page-B-TZr_pZ.js} +1 -1
  59. package/dist/gateway/static/root/assets/{page-context-capture-button-CblMYGvM.js → page-context-capture-button-Dwi5saHc.js} +1 -1
  60. package/dist/gateway/static/root/assets/{page-tabs-BQLuzP2G.js → page-tabs-DSZXUBG2.js} +1 -1
  61. package/dist/gateway/static/root/assets/{preview-open-alternatives-bAtTMiqI.js → preview-open-alternatives-DgdXWIdH.js} +1 -1
  62. package/dist/gateway/static/root/assets/{product-open-page-BiZx2t3O.js → product-open-page-D93y1-f7.js} +1 -1
  63. package/dist/gateway/static/root/assets/{project-detail-page-BeCtOOvf.js → project-detail-page-BDQELA9m.js} +1 -1
  64. package/dist/gateway/static/root/assets/{projects-page-DVFst1Zv.js → projects-page-BozmRhtR.js} +1 -1
  65. package/dist/gateway/static/root/assets/{registry-api-DGRLQQ_H.js → registry-api-Bw0ZkSav.js} +1 -1
  66. package/dist/gateway/static/root/assets/{remote-access-hub-xlX73tyv.js → remote-access-hub-ObyFW5uB.js} +1 -1
  67. package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-BL43kX94.js → runtime-tools-settings-panel-CYSLDqmA.js} +1 -1
  68. package/dist/gateway/static/root/assets/{scenes-page-CHIai08O.js → scenes-page-Ayyu3DyB.js} +1 -1
  69. package/dist/gateway/static/root/assets/{schema-form-BpTqO-iv.js → schema-form-C3cirNuC.js} +1 -1
  70. package/dist/gateway/static/root/assets/{session-api-BXyyrPIk.js → session-api-BY3dAGBn.js} +1 -1
  71. package/dist/gateway/static/root/assets/session-manager-D10sD8IN.js +16 -0
  72. package/dist/gateway/static/root/assets/{sessions-page-DEcTMG-C.js → sessions-page-Bsv-4-ri.js} +1 -1
  73. package/dist/gateway/static/root/assets/settings-advanced-gate-DUUqY9pB.js +1 -0
  74. package/dist/gateway/static/root/assets/{settings-form-section-DTsRLeno.js → settings-form-section-1BZlPCGE.js} +1 -1
  75. package/dist/gateway/static/root/assets/{settings-page-DXuAkBPd.js → settings-page-CB9C6vJ3.js} +1 -1
  76. package/dist/gateway/static/root/assets/{setup-status-panel-Di0Ed3Y_.js → setup-status-panel-CAFpSX37.js} +1 -1
  77. package/dist/gateway/static/root/assets/{share-preview-page-kKdqUjj2.js → share-preview-page-CkFCoa0_.js} +1 -1
  78. package/dist/gateway/static/root/assets/{shares-settings-Deazms2V.js → shares-settings-wej5UAUb.js} +1 -1
  79. package/dist/gateway/static/root/assets/{skill-api-BYnK8QTQ.js → skill-api-Fd4xaSkn.js} +1 -1
  80. package/dist/gateway/static/root/assets/skill-reload-api-ClQ2etFr.js +1 -0
  81. package/dist/gateway/static/root/assets/{skills-page-BAEDw1ez.js → skills-page-VIuakXwb.js} +1 -1
  82. package/dist/gateway/static/root/assets/{system-settings-panel-DbULjt1I.js → system-settings-panel-Bl0Ilhk-.js} +1 -1
  83. package/dist/gateway/static/root/assets/{task-detail-page-Dwa6P2yd.js → task-detail-page-FhG4jvPW.js} +1 -1
  84. package/dist/gateway/static/root/assets/{tunnel-api-CEoNfQtH.js → tunnel-api-Cuwj_Vvh.js} +1 -1
  85. package/dist/gateway/static/root/assets/{usage-page-BFFftzL6.js → usage-page--OhmzMUP.js} +1 -1
  86. package/dist/gateway/static/root/assets/{use-autosave-qKVzK824.js → use-autosave-B1nOhZ-m.js} +1 -1
  87. package/dist/gateway/static/root/assets/{user-model-page-Cb9EhncT.js → user-model-page-yTocj4jU.js} +1 -1
  88. package/dist/gateway/static/root/assets/{voice-api-key-field-DUg1IyGa.js → voice-api-key-field-CVYw_wvN.js} +1 -1
  89. package/dist/gateway/static/root/assets/{voice-config-api-Dh_RxWat.js → voice-config-api-st1q4lqP.js} +1 -1
  90. package/dist/gateway/static/root/assets/{work-discovery-overlay-C8RS5pAe.js → work-discovery-overlay-DPaybMFQ.js} +1 -1
  91. package/dist/gateway/static/root/assets/{workflow-run-setup-panel-FkVKYHxF.js → workflow-run-setup-panel-CNmLZHFm.js} +1 -1
  92. package/dist/gateway/static/root/assets/{workflows-page-CXTfjyCR.js → workflows-page-Cbu1ZJxa.js} +1 -1
  93. package/dist/gateway/static/root/index.html +15 -15
  94. package/dist/package.js +1 -1
  95. package/dist/src/agent/skills/marketplace/adapters/store/store-api-client.d.ts +4 -0
  96. package/dist/src/extensions/marketplace.d.ts +4 -0
  97. package/dist/src/extensions/marketplace.js +10 -1
  98. package/package.json +3 -3
  99. package/dist/gateway/static/root/assets/agent-plugin-dialog-BmYHMIPz.js +0 -1
  100. package/dist/gateway/static/root/assets/apps-page-DmDgodab.js +0 -1
  101. package/dist/gateway/static/root/assets/gateway-realtime-store-DA3d45t6.js +0 -1
  102. package/dist/gateway/static/root/assets/index-Bbo9EJvY.js +0 -106
  103. package/dist/gateway/static/root/assets/index-CRfBe1x4.css +0 -1
  104. package/dist/gateway/static/root/assets/messages-6j-AkWdj.js +0 -3
  105. package/dist/gateway/static/root/assets/session-manager-OBkrb3ow.js +0 -16
  106. package/dist/gateway/static/root/assets/settings-advanced-gate-DXWLgEoV.js +0 -1
  107. package/dist/gateway/static/root/assets/skill-reload-api-B6GZUBNC.js +0 -1
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,t as n}from"./vendor-react-BOUWij0V.js";import{t as r}from"./chunk-KS7C4IRE-BMYIfy9x.js";import{t as i}from"./circle-check-C23XjkUj.js";import{t as a}from"./folder-open-CyzJ19I9.js";import{t as o}from"./loader-circle-CifKLtgG.js";import{t as s}from"./messages-6j-AkWdj.js";import{t as c}from"./cn-JdwAhgNB.js";import{a as l,i as u,n as ee,r as d}from"./locale-store-CCYf4Qxv.js";import{a as f,i as te,o as p,r as m,s as h,t as g}from"./dist-BGTk37IG.js";import{a as ne}from"./vendor-swr-BIWyz7Rc.js";import{t as _}from"./button-CS04eWY9.js";import{n as v}from"./gateway-config-swr-D_oNkPwY.js";import{t as y}from"./skeleton-BwbyijEw.js";import{Ea as b,Hu as x,Lc as S,Mt as C,Nt as w,Pt as T,mu as re,pc as ie}from"./index-Bbo9EJvY.js";var E=e(t(),1),D=/^([^:=]+)[:=](.*)$/;function O(e){let t=e.trim();if(!t)return null;try{let e=JSON.parse(t);if(e&&typeof e==`object`&&!Array.isArray(e))return Object.entries(e).map(([e,t])=>({key:e,value:t==null?``:String(t)}))}catch{}let n=[];for(let e of t.split(/\r?\n/)){let t=e.trim();if(!t)continue;let r=D.exec(t);r&&n.push({key:r[1].trim(),value:r[2].trim()})}return n.length>0?n:null}function k(e){let t={};for(let n of e){let e=n.key.trim();e&&(t[e]=n.value)}return Object.keys(t).length>0?t:void 0}function A(e){if(!e||typeof e!=`object`)return[{key:``,value:``}];let t=Object.entries(e).map(([e,t])=>({key:e,value:t==null?``:String(t)}));return t.length>0?t:[{key:``,value:``}]}function j(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e.xopcConnector;return!!(t&&typeof t==`object`&&!Array.isArray(t)&&t.managed===!0)}function M(e){let t=e&&typeof e==`object`&&`mcp`in e?e.mcp:void 0,n=(t&&typeof t==`object`?t:{}).servers,r={};if(!n||typeof n!=`object`||Array.isArray(n))return r;for(let[e,t]of Object.entries(n))!t||typeof t!=`object`||Array.isArray(t)||j(t)&&(r[e]=t);return r}function ae(e){let t=e.trim();if(t)return t.split(/\s+/).filter(Boolean)}function N(e){let t=e.trim();if(!t)return;let n=JSON.parse(t);if(!n||typeof n!=`object`||Array.isArray(n))throw Error(`Expected a JSON object`);return n}function P(e){if(e.transport===`stdio`){let t={command:e.command.trim()},n=ae(e.argsText);return n?.length&&(t.args=n),e.cwd.trim()&&(t.cwd=e.cwd.trim()),e.envJson.trim()&&(t.env=N(e.envJson)),e.connectionTimeoutMs!=null&&Number.isFinite(e.connectionTimeoutMs)&&(t.connectionTimeoutMs=e.connectionTimeoutMs),e.requestTimeoutMs!=null&&Number.isFinite(e.requestTimeoutMs)&&(t.requestTimeoutMs=e.requestTimeoutMs),t}let t={url:e.url.trim(),transport:e.transport},n=k(e.headers);return n&&(t.headers=n),e.transport===`streamable-http`&&e.auth===`oauth`&&(t.auth={type:`oauth`,...e.oauthClientId.trim()?{clientId:e.oauthClientId.trim()}:{}}),e.connectionTimeoutMs!=null&&Number.isFinite(e.connectionTimeoutMs)&&(t.connectionTimeoutMs=e.connectionTimeoutMs),e.requestTimeoutMs!=null&&Number.isFinite(e.requestTimeoutMs)&&(t.requestTimeoutMs=e.requestTimeoutMs),t}function oe(e,t){let n=typeof t.url==`string`&&t.url.trim().length>0,r=typeof t.transport==`string`?t.transport.trim().toLowerCase():``,i=n?r===`sse`?`sse`:`streamable-http`:`stdio`,a=t.headers&&typeof t.headers==`object`&&!Array.isArray(t.headers)?t.headers:void 0,o=t.auth&&typeof t.auth==`object`&&!Array.isArray(t.auth)?t.auth:void 0,s=o?.type===`oauth`?`oauth`:`none`;return{clientKey:e,id:e,transport:i,command:typeof t.command==`string`?t.command:``,argsText:Array.isArray(t.args)?t.args.map(String).join(` `):``,envJson:t.env&&typeof t.env==`object`?JSON.stringify(t.env,null,2):``,cwd:typeof t.cwd==`string`?t.cwd:typeof t.workingDirectory==`string`?t.workingDirectory:``,url:typeof t.url==`string`?t.url:``,headers:A(a),auth:s,oauthClientId:typeof o?.clientId==`string`?o.clientId:``,connectionTimeoutMs:typeof t.connectionTimeoutMs==`number`&&Number.isFinite(t.connectionTimeoutMs)?t.connectionTimeoutMs:void 0,requestTimeoutMs:typeof t.requestTimeoutMs==`number`&&Number.isFinite(t.requestTimeoutMs)?t.requestTimeoutMs:void 0}}function F(e=``){return{clientKey:crypto.randomUUID(),id:e,transport:`stdio`,command:``,argsText:``,envJson:``,cwd:``,url:``,headers:[{key:`Authorization`,value:``}],auth:`none`,oauthClientId:``,connectionTimeoutMs:void 0,requestTimeoutMs:void 0}}function se(e){let t=e&&typeof e==`object`&&`mcp`in e?e.mcp:void 0,n=t&&typeof t==`object`?t:{},r=n.servers,i=r&&typeof r==`object`&&!Array.isArray(r)?Object.entries(r).flatMap(([e,t])=>!t||typeof t!=`object`||Array.isArray(t)||j(t)?[]:[oe(e,t)]).sort((e,t)=>e.id.localeCompare(t.id)):[],a=typeof n.sessionIdleTtlMs==`number`?n.sessionIdleTtlMs:void 0;return{sessionIdleTtlMinutes:a==null?void 0:a===0?0:Math.round(a/6e4),servers:i}}function ce(e){return P(e)}async function le(e,t={}){let n={};for(let r of e.servers){let e=r.id.trim();if(e){if(t[e])throw Error(`Server id "${e}" is reserved by an installed connector.`);n[e]=P(r)}}let r={servers:{...t,...n}};e.sessionIdleTtlMinutes!=null&&Number.isFinite(e.sessionIdleTtlMinutes)&&(r.sessionIdleTtlMs=e.sessionIdleTtlMinutes===0?0:Math.round(e.sessionIdleTtlMinutes*6e4)),await l(d(`/api/config`),{method:`PATCH`,body:JSON.stringify({mcp:r})}),v()}async function I(e,t,n=``){let r=await l(d(`/api/mcp/servers/${encodeURIComponent(e)}/oauth${n}`),{method:t});if(!r.payload)throw Error(r.error??`MCP OAuth request failed`);return r.payload}function L(e){return I(e,`GET`)}function R(e){return I(e,`POST`,`/start`)}function z(e){return I(e,`DELETE`)}function B(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){if(!n||typeof n!=`object`)continue;let e=n;if(typeof e.name!=`string`)continue;let r=e.name.trim();if(!r)continue;let i=typeof e.shortName==`string`&&e.shortName.trim()?e.shortName.trim():void 0,a=typeof e.description==`string`&&e.description.trim()?e.description.trim():void 0;t.push({name:r,shortName:i,description:a})}return t}function ue(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){if(!n||typeof n!=`object`)continue;let e=n;if(typeof e.uri!=`string`||typeof e.name!=`string`)continue;let r=e.uri.trim(),i=e.name.trim();!r||!i||t.push({uri:r,name:i,title:typeof e.title==`string`&&e.title.trim()?e.title.trim():void 0,description:typeof e.description==`string`&&e.description.trim()?e.description.trim():void 0,mimeType:typeof e.mimeType==`string`&&e.mimeType.trim()?e.mimeType.trim():void 0})}return t}function de(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){if(!n||typeof n!=`object`)continue;let e=n;if(typeof e.name!=`string`)continue;let r=e.name.trim();r&&t.push({name:r,title:typeof e.title==`string`&&e.title.trim()?e.title.trim():void 0,description:typeof e.description==`string`&&e.description.trim()?e.description.trim():void 0,argumentCount:typeof e.argumentCount==`number`?e.argumentCount:0})}return t}async function fe(e,t){let n=await l(d(`/api/mcp/servers/${encodeURIComponent(e)}/test`),{method:`POST`,body:t?JSON.stringify({server:t}):void 0});if(!n.payload)throw Error(n.error??`MCP test failed`);let r=B(n.payload.tools),i=ue(n.payload.resources),a=de(n.payload.prompts);return{serverId:n.payload.serverId??e,toolCount:typeof n.payload.toolCount==`number`?n.payload.toolCount:r.length,resourceCount:typeof n.payload.resourceCount==`number`?n.payload.resourceCount:i.length,promptCount:typeof n.payload.promptCount==`number`?n.payload.promptCount:a.length,tools:r,resources:i,prompts:a}}function V(e){return e.connectionTimeoutMs==null||!Number.isFinite(e.connectionTimeoutMs)?``:String(Math.round(e.connectionTimeoutMs/1e3))}function H(e){let t=e.trim();if(!t)return;let n=Number.parseInt(t,10);if(!(!Number.isFinite(n)||n<1||n>600))return n*1e3}function U(e){return e.requestTimeoutMs==null||!Number.isFinite(e.requestTimeoutMs)?``:String(Math.round(e.requestTimeoutMs/1e3))}function W(e){let t=e.trim();if(!t)return;let n=Number.parseInt(t,10);if(!(!Number.isFinite(n)||n<1||n>14400))return n*1e3}var G=n(),K=`w-full rounded-lg border border-edge bg-surface-inset px-3 py-2 text-sm text-fg`;function pe(e,t){if(e.startsWith(`content.skills:`)){let n=e.slice(15);return t?`提供技能:${n}`:`Add skill: ${n}`}if(e.startsWith(`runtime.mcp.stdio:`)){let n=e.slice(18).split(`:`,1)[0];return t?`在本机运行工具服务:${n}`:`Run a local tool service: ${n}`}if(e.startsWith(`network.mcp:`)){let n=e.slice(12).split(`:`,1)[0];return t?`连接外部工具服务:${n}`:`Connect to an external tool service: ${n}`}return e}function me(e,t){return t?.publisher?.verification!==`verified`||t.latestVersion.riskTier&&t.latestVersion.riskTier!==`content`?!0:e.addedCapabilities.some(e=>!e.startsWith(`content.skills:`))}async function q(e,t,n){let r=await l(d(e),{method:t,...n===void 0?{}:{body:JSON.stringify(n)}});if(!r.ok)throw Error(r.error??`Request failed`);return r.payload}function he({pluginId:e,server:t,enabled:n}){let{mutate:r}=ne(),i=ee(e=>e.language).startsWith(`zh`),[a,o]=(0,E.useState)(!1),[s,c]=(0,E.useState)(null),[l,f]=(0,E.useState)(``),[te,p]=(0,E.useState)(!1),[m,h]=(0,E.useState)(!1),[g,v]=(0,E.useState)(``),[b,x]=(0,E.useState)(t.type===`stdio`?`API_KEY`:`Authorization`),[S,re]=(0,E.useState)(t.type===`stdio`?``:`Bearer `),[ie,D]=(0,E.useState)(!1),[O,k]=(0,E.useState)(``),A=`/api/mcp/servers/${encodeURIComponent(t.id)}`;async function j(){let e=await u(d(`${A}/test`),{method:`POST`,body:`{}`}),t=await e.json();if(r(`gateway-extensions-list`),p(t.code===`MCP_AUTHORIZATION_REQUIRED`),!e.ok||!t.ok)throw Error(t.error??`Connection failed`);f(i?`连接成功 · ${t.payload.toolCount} 个工具`:`Connected · ${t.payload.toolCount} tools`)}(0,E.useEffect)(()=>{if(!n||t.type!==`streamable-http`)return;let e=!1;return L(t.id).then(t=>{e||(c(t),D(!0))}).catch(t=>{e||(f(String(t)),D(!0))}),()=>{e=!0}},[n,t.id,t.type]),(0,E.useEffect)(()=>{if(s?.status!==`authorizing`)return;let e=!1,n=window.setInterval(()=>{L(t.id).then(t=>{e||(c(t),t.status===`connected`&&(p(!1),f(i?`已连接,可以重试原任务`:`Connected. Retry your task.`),r(`gateway-extensions-list`)),t.status===`error`&&f(t.session?.error??`Authorization failed`))}).catch(t=>{e||f(String(t))})},1500);return()=>{e=!0,window.clearInterval(n)}},[s?.status,t.id,i,r]);async function M(e){o(!0),f(``);try{await e()}catch(e){f(e instanceof Error?e.message:String(e))}finally{o(!1)}}return(0,G.jsxs)(`div`,{className:`rounded-lg border border-edge p-3 text-sm`,children:[(0,G.jsxs)(`div`,{className:`mb-2 flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`font-medium`,children:t.name}),(0,G.jsxs)(`span`,{className:`text-xs text-fg-muted`,children:[e,` · `,t.type]})]}),n?(0,G.jsxs)(G.Fragment,{children:[t.type===`streamable-http`&&!ie?(0,G.jsx)(y,{className:`mb-2 h-4 w-24`}):null,(0,G.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,G.jsx)(_,{variant:`secondary`,disabled:a,onClick:()=>void M(j),children:i?`测试连接`:`Test connection`}),t.type===`streamable-http`&&s?.status!==`connected`?(0,G.jsx)(_,{variant:te?`primary`:`secondary`,disabled:a,onClick:()=>{let e=T();M(async()=>{try{let n=await R(t.id);if(c(n),n.session?.authorizationUrl){if(!await w(n.session.authorizationUrl,e))throw Error(i?`无法打开授权页面`:`Could not open authorization page`)}else if(C(e),n.session?.error)throw Error(n.session.error)}catch(t){throw C(e),t}})},children:i?`连接账号`:`Connect account`}):null,s?.status===`connected`?(0,G.jsx)(_,{variant:`secondary`,disabled:a,onClick:()=>void M(async()=>{c(await z(t.id)),r(`gateway-extensions-list`)}),children:i?`断开连接`:`Disconnect`}):null,(0,G.jsx)(_,{variant:`ghost`,disabled:a,onClick:()=>h(!m),children:i?`设置密钥`:`Set API key`})]}),m?(0,G.jsxs)(`form`,{className:`mt-3 space-y-2`,onSubmit:n=>{n.preventDefault(),M(async()=>{await q(`/api/extensions/agent-plugins/${encodeURIComponent(e)}/mcp/${encodeURIComponent(t.name)}/auth`,`PUT`,{mode:`api-key`,secrets:[{target:t.type===`stdio`?`env`:`headers`,key:b,value:g,prefix:S}]}),v(``),h(!1),c(null),p(!1),await j()})},children:[(0,G.jsxs)(`label`,{className:`block`,children:[i?`字段名`:`Field name`,(0,G.jsx)(`input`,{className:K,value:b,onChange:e=>x(e.target.value),required:!0})]}),(0,G.jsxs)(`label`,{className:`block`,children:[i?`前缀(可选)`:`Prefix (optional)`,(0,G.jsx)(`input`,{className:K,value:S,onChange:e=>re(e.target.value)})]}),(0,G.jsxs)(`label`,{className:`block`,children:[i?`密钥`:`Secret`,(0,G.jsx)(`input`,{className:K,type:`password`,autoComplete:`off`,value:g,onChange:e=>v(e.target.value),required:!0})]}),(0,G.jsx)(_,{type:`submit`,disabled:a||!g,children:i?`保存并测试`:`Save and test`})]}):null]}):(0,G.jsx)(`p`,{className:`text-fg-muted`,children:i?`启用插件后连接服务`:`Enable the plugin to connect`}),s?.status===`authorizing`?(0,G.jsxs)(`div`,{className:`mt-2 space-y-2 text-fg-muted`,children:[(0,G.jsx)(`p`,{children:i?`请在浏览器完成授权`:`Complete authorization in your browser`}),(0,G.jsxs)(`details`,{children:[(0,G.jsx)(`summary`,{children:i?`使用远程 Gateway?`:`Using a remote Gateway?`}),(0,G.jsxs)(`form`,{className:`mt-2 space-y-2`,onSubmit:e=>{e.preventDefault(),M(async()=>{c(await q(`${A}/oauth/callback`,`POST`,{callbackUrl:O})),k(``)})},children:[(0,G.jsxs)(`label`,{children:[i?`如果浏览器跳转后无法连接,请粘贴地址栏中的完整回调 URL`:`If the browser cannot reach the callback, paste its full address-bar URL`,(0,G.jsx)(`input`,{type:`password`,autoComplete:`off`,className:K,value:O,onChange:e=>k(e.target.value)})]}),(0,G.jsx)(_,{type:`submit`,disabled:a||!O,children:i?`完成连接`:`Complete connection`})]})]})]}):null,l?(0,G.jsx)(`p`,{role:`status`,className:`mt-2 break-words text-fg-muted`,children:l}):null]})}function J({extension:e,onClose:t,initialSource:n=``,marketplace:l,autoInstall:u=!1}){let d=ee(e=>e.language),v=d.startsWith(`zh`),y=(0,E.useId)(),{mutate:C}=ne(),[w,T]=(0,E.useState)(e),[D,O]=(0,E.useState)(n),[k,A]=(0,E.useState)(null),[j,M]=(0,E.useState)(!1),[ae,N]=(0,E.useState)(``),[P,oe]=(0,E.useState)(!1),[F,se]=(0,E.useState)(!1),[ce,le]=(0,E.useState)(!1),[I,L]=(0,E.useState)(!1),[R,z]=(0,E.useState)(!1),[B,ue]=(0,E.useState)(!1),[de,fe]=(0,E.useState)(!1),V=(0,E.useRef)(!1),H=`/api/extensions/agent-plugins/${encodeURIComponent(w?.pluginId??``)}`,U=D.trim().startsWith(`store:`),W=()=>C(`gateway-extensions-list`);async function J(e){M(!0),N(``);try{await e()}catch(e){N(e instanceof Error?e.message:String(e))}finally{M(!1)}}function Y(e){O(e),A(null),N(``)}let X=typeof window<`u`?window.electronAPI?.file:void 0,Z=/^(?:\/|[A-Za-z]:[\\/])/.test(D.trim())?D.trim():void 0;async function ge(){if(!X?.openDirectory){z(!0);return}let e=await X.openDirectory(Z?{defaultPath:Z}:void 0);e&&Y(e)}async function _e(){if(!X?.openFile){z(!0);return}let e=await X.openFile({...Z?{defaultPath:Z}:{},extensions:[`zip`]});e&&Y(e)}function Q(e){return[...e.dataTransfer.types].some(e=>e===`Files`||e===`text/plain`||e===`text/uri-list`)}function ve(e){if(!Q(e))return;e.preventDefault(),L(!1);let t=Array.from(e.dataTransfer.files);if(t.length){if(t.length>1){N(v?`一次只能选择一个插件目录或 ZIP。`:`Choose one plugin directory or ZIP at a time.`);return}let e=X?.getPathForFile?.(t[0]);e?Y(e):N(v?`浏览器无法读取本机文件路径,请使用“选择文件或目录”选择安装包。`:`The browser cannot read local file paths. Use Choose file or folder to select the package.`);return}let n=e.dataTransfer.getData(`text/uri-list`)||e.dataTransfer.getData(`text/plain`);n.trim()&&Y(n.trim().split(/\r?\n/)[0])}async function ye(e){T(await q(`${H}/activation`,`POST`,{enabled:e})),await W()}async function be(e){let t=!w,n=await q(t?`/api/extensions/install`:`${H}/update`,`POST`,{source:D,reviewHash:e.reviewHash});T(n),await W(),t&&!n.activationEligible&&n.readiness!==`blocked`&&n.pluginId&&(n=await q(`/api/extensions/agent-plugins/${encodeURIComponent(n.pluginId)}/activation`,`POST`,{enabled:!0}),T(n),await W()),A(null),fe(t&&n.activationEligible===!0)}async function xe(){let e=await q(`/api/extensions/inspect`,`POST`,{source:D});if(me(e,l)){A(e);return}await be(e)}(0,E.useEffect)(()=>{e&&T(e)},[e]),(0,E.useEffect)(()=>{!u||w||!U||V.current||(V.current=!0,J(xe))},[u,w,U]);let Se=u&&!w&&U&&!V.current,$=w?.components;return(0,G.jsx)(g,{defaultOpen:!0,onOpenChange:e=>!e&&t(),children:(0,G.jsxs)(p,{children:[(0,G.jsx)(f,{className:`fixed inset-0 z-[130] bg-scrim`}),(0,G.jsxs)(m,{className:`fixed left-1/2 top-1/2 z-[131] flex h-[min(76vh,30rem)] w-[min(34rem,calc(100vw-1.5rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay shadow-popover`,children:[(0,G.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between border-b border-edge p-4`,children:[(0,G.jsx)(h,{className:`font-semibold`,children:w?.name??l?.name??(v?`安装 Agent Plugin`:`Install Agent Plugin`)}),(0,G.jsx)(_,{variant:`ghost`,onClick:t,children:v?`关闭`:`Close`})]}),(0,G.jsx)(te,{className:`sr-only`,children:v?`安装、组件、账号连接和权限`:`Installation, components, connections and permissions`}),(0,G.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto p-4`,children:[!w&&U?(0,G.jsxs)(`section`,{className:`space-y-4`,children:[(0,G.jsxs)(`div`,{className:`flex items-start gap-3 rounded-xl border border-edge bg-surface-base p-4`,children:[(0,G.jsx)(S,{className:`mt-0.5 size-5 shrink-0 text-emerald-600 dark:text-emerald-400`,"aria-hidden":!0}),(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`p`,{className:`font-medium text-fg`,children:l?.name??k?.manifest.name??D.slice(6)}),l?.description?(0,G.jsx)(`p`,{className:`mt-1 text-sm leading-relaxed text-fg-muted`,children:l.description}):null,(0,G.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:l?.publisher?.verification===`verified`?v?`已认证发布者 · 安装后自动启用`:`Verified publisher · enabled automatically after installation`:v?`安装前会检查来源和所需权限`:`Source and required permissions are checked before installation`})]})]}),k?null:(0,G.jsxs)(_,{className:`w-full`,disabled:j||Se,onClick:()=>void J(xe),children:[j||Se?(0,G.jsx)(o,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,j||Se?v?`正在安全检查并安装…`:`Checking and installing…`:v?`一键安装`:`Install`]})]}):null,w?(0,G.jsxs)(G.Fragment,{children:[de?(0,G.jsxs)(`div`,{role:`status`,className:`flex items-start gap-3 rounded-lg border border-emerald-500/25 bg-emerald-500/10 p-4`,children:[(0,G.jsx)(i,{className:`mt-0.5 size-5 shrink-0 text-emerald-600 dark:text-emerald-400`,"aria-hidden":!0}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{className:`font-medium text-fg`,children:v?`插件已安装并启用`:`Plugin installed and enabled`}),(0,G.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:v?`现在可以直接在对话中使用它。`:`It is ready to use in your conversations.`})]})]}):null,w.activationEligible?null:(0,G.jsxs)(`div`,{role:`status`,className:`space-y-3 rounded-lg border border-accent/25 bg-accent-soft p-4`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{className:`font-medium text-accent-fg`,children:v?`插件已安装,当前尚未启用`:`Plugin installed. It is not enabled yet.`}),(0,G.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:v?`启用后,Skills 和 MCP 才会加入 Agent 运行时。`:`Enable it to make its skills and MCP servers available to the Agent runtime.`})]}),(0,G.jsx)(_,{disabled:j||w.readiness===`blocked`,onClick:()=>void J(()=>ye(!0)),children:v?`启用插件`:`Enable plugin`})]}),(0,G.jsxs)(`p`,{className:`text-sm text-fg-muted`,children:[`Agent Plugin · `,w.version,` · `,w.readiness&&{ready:v?`已就绪`:`Ready`,setup_required:v?`待连接`:`Setup required`,degraded:v?`部分不可用`:`Partially available`,blocked:v?`已阻止`:`Blocked`}[w.readiness]]}),w.provenance?(0,G.jsxs)(`p`,{className:`break-words text-xs text-fg-muted`,children:[w.provenance.publisherVerification===`verified`?v?`已认证发布者`:`Verified publisher`:v?`社区发布者`:`Community publisher`,` · `,w.provenance.packageName,`@`,w.provenance.version,` · SHA-256 `,w.provenance.sha256.slice(0,12),`…`,w.provenance.riskTier?` · ${w.provenance.riskTier}`:``]}):null,(0,G.jsx)(`p`,{className:`text-sm`,children:w.description}),w.activationEligible?(0,G.jsx)(_,{disabled:j,variant:`secondary`,onClick:()=>void J(()=>ye(!1)),children:v?`停用`:`Disable`}):null,w.canRollback?(0,G.jsx)(_,{disabled:j,variant:`secondary`,onClick:()=>void J(async()=>{T(await q(`${H}/rollback`,`POST`)),await W()}),children:v?`回滚上一版本`:`Roll back`}):null,$?.skills.length||$?.mcp.length?(0,G.jsxs)(`div`,{className:`space-y-3 rounded-lg border border-edge p-3`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{className:`text-sm font-medium`,children:v?`此插件提供的能力`:`Capabilities from this plugin`}),$.skills.length?(0,G.jsxs)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:[`Skills: `,$.skills.map(e=>e.name).join(`, `)]}):null,$.mcp.length?(0,G.jsxs)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:[`MCP: `,$.mcp.map(e=>e.name).join(`, `)]}):null]}),(0,G.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[$.skills.length?(0,G.jsx)(_,{asChild:!0,variant:`secondary`,children:(0,G.jsx)(r,{to:`/capabilities/skills?source=plugin`,children:v?`管理技能`:`Manage skills`})}):null,$.mcp.length?(0,G.jsx)(_,{asChild:!0,variant:`secondary`,children:(0,G.jsx)(r,{to:`/capabilities/connectors?tab=connected`,children:v?`管理连接`:`Manage connections`})}):null]})]}):null,w.components?.mcp.length?(0,G.jsxs)(`details`,{className:`group rounded-lg border border-edge p-3`,children:[(0,G.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center justify-between gap-3 text-sm font-medium text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,G.jsx)(`span`,{children:v?`连接与密钥(按需)`:`Connections and API keys (as needed)`}),(0,G.jsx)(x,{className:`size-4 text-fg-muted transition-transform group-open:rotate-180 motion-reduce:transition-none`,"aria-hidden":!0})]}),(0,G.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:v?`仅当工具服务提示登录或缺少密钥时设置。`:`Only configure this when a tool service asks you to sign in or provide a key.`}),(0,G.jsx)(`div`,{className:`mt-3 space-y-3`,children:w.components.mcp.map(e=>(0,G.jsx)(he,{pluginId:w.pluginId,server:e,enabled:w.active},e.id))})]}):null,w.diagnostics?.map((e,t)=>(0,G.jsxs)(`p`,{className:`text-sm text-fg-muted`,children:[e.component,`: `,e.message]},t))]}):null,U&&w?(0,G.jsxs)(_,{variant:`ghost`,className:`px-0`,"aria-expanded":B,onClick:()=>ue(e=>!e),children:[(0,G.jsx)(x,{className:c(`size-4 transition-transform motion-reduce:transition-none`,B&&`rotate-180`),"aria-hidden":!0}),v?`高级操作`:`Advanced actions`]}):null,!U||B?(0,G.jsxs)(`form`,{className:c(`space-y-3`,w&&`border-t border-edge pt-4`),onSubmit:e=>{e.preventDefault(),J(async()=>{A(await q(`/api/extensions/inspect`,`POST`,{source:D}))})},children:[(0,G.jsxs)(`div`,{"data-testid":`plugin-source-dropzone`,className:c(`rounded-xl border border-dashed p-3 transition-colors`,I?`border-accent bg-accent-soft`:`border-edge bg-surface-inset/40`),onDragEnter:e=>{Q(e)&&(e.preventDefault(),L(!0))},onDragOver:e=>{Q(e)&&(e.preventDefault(),e.dataTransfer.dropEffect=`copy`,L(!0))},onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||L(!1)},onDrop:ve,children:[(0,G.jsxs)(`div`,{className:`mb-2 flex items-start gap-2`,children:[(0,G.jsx)(ie,{className:`mt-0.5 size-4 shrink-0 text-fg-muted`,"aria-hidden":!0}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`label`,{htmlFor:y,className:`block text-sm font-medium`,children:w?v?`更新包来源`:`Update package source`:v?`安装包来源`:`Package source`}),(0,G.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:v?`拖入插件目录或 ZIP,也可输入 HTTPS ZIP 或 store:包名`:`Drop a plugin directory or ZIP, or enter an HTTPS ZIP or store:package`})]})]}),(0,G.jsx)(`input`,{id:y,className:K,value:D,onChange:e=>Y(e.target.value),placeholder:v?`/插件目录/或/插件.zip`:`/plugin/folder/or/plugin.zip`,autoComplete:`off`,spellCheck:!1,required:!0}),(0,G.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:X?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(_,{type:`button`,variant:`secondary`,disabled:j,onClick:()=>void J(ge),children:[(0,G.jsx)(a,{className:`size-4`,"aria-hidden":!0}),v?`选择目录`:`Choose directory`]}),(0,G.jsxs)(_,{type:`button`,variant:`secondary`,disabled:j,onClick:()=>void J(_e),children:[(0,G.jsx)(re,{className:`size-4`,"aria-hidden":!0}),v?`选择 ZIP`:`Choose ZIP`]})]}):(0,G.jsxs)(_,{type:`button`,variant:`secondary`,disabled:j,onClick:()=>z(!0),children:[(0,G.jsx)(a,{className:`size-4`,"aria-hidden":!0}),v?`选择文件或目录`:`Choose file or folder`]})})]}),(0,G.jsx)(_,{type:`submit`,variant:`secondary`,disabled:j||!D,children:v?`检查安装包`:`Inspect package`})]}):null,k?(0,G.jsxs)(`div`,{role:`region`,"aria-labelledby":`plugin-authorization-title`,className:`space-y-3 rounded-xl border border-amber-500/30 bg-amber-500/10 p-4 text-sm`,children:[(0,G.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,G.jsx)(S,{className:`mt-0.5 size-5 shrink-0 text-amber-700 dark:text-amber-300`,"aria-hidden":!0}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{id:`plugin-authorization-title`,className:`font-medium text-fg`,children:v?`需要你的授权`:`Your authorization is required`}),(0,G.jsx)(`p`,{className:`mt-1 text-fg-muted`,children:v?`此插件需要以下新增能力。确认后会自动完成安装并启用。`:`This plugin requests the capabilities below. After approval, installation and activation continue automatically.`})]})]}),(0,G.jsx)(`ul`,{className:`space-y-2 rounded-lg border border-edge bg-surface-panel p-3 break-words`,children:k.addedCapabilities.map(e=>(0,G.jsxs)(`li`,{className:`flex gap-2`,children:[(0,G.jsx)(`span`,{"aria-hidden":!0,children:`•`}),(0,G.jsx)(`span`,{children:pe(e,v)})]},e))}),k.diagnostics.map((e,t)=>(0,G.jsxs)(`p`,{children:[e.component,`: `,e.message]},t)),(0,G.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,G.jsxs)(_,{disabled:j||!!w&&k.manifest.name!==w.pluginId,onClick:()=>void J(()=>be(k)),children:[j?(0,G.jsx)(o,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,v?`授权并安装`:`Authorize and install`]}),(0,G.jsx)(_,{variant:`ghost`,disabled:j,onClick:()=>A(null),children:v?`取消`:`Cancel`})]})]}):null,w&&(!U||B)?(0,G.jsx)(`div`,{className:`border-t border-edge pt-4`,children:ce?(0,G.jsxs)(`div`,{className:`space-y-3 text-sm`,children:[(0,G.jsx)(`p`,{children:v?`卸载保留账号凭据;服务端授权需到相应服务撤销。`:`Credentials are retained. Revoke provider authorization in the service itself.`}),(0,G.jsxs)(`label`,{className:`flex gap-2`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:P,onChange:e=>oe(e.target.checked)}),v?`同时删除插件数据`:`Also delete plugin data`]}),(0,G.jsxs)(`label`,{className:`flex gap-2`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:F,onChange:e=>se(e.target.checked)}),v?`同时删除本地凭据`:`Also delete local credentials`]}),(0,G.jsx)(_,{disabled:j,onClick:()=>void J(async()=>{await q(H,`DELETE`,{removeData:P,removeCredentials:F}),await W(),t()}),children:v?`确认卸载`:`Confirm uninstall`})]}):(0,G.jsx)(_,{variant:`ghost`,disabled:j,onClick:()=>le(!0),children:v?`卸载插件`:`Uninstall`})}):null,ae?(0,G.jsx)(`p`,{role:`alert`,className:`break-words text-sm text-fg-muted`,children:ae}):null]})]}),X?null:(0,G.jsx)(b,{open:R,onOpenChange:z,initialAbsolutePath:Z,onConfirm:async e=>Y(e),wd:s(d).chat.workingDirectory,selectKind:`file-or-directory`,fileExtensions:[`zip`],title:v?`选择插件安装包`:`Choose plugin package`,description:v?`选择插件目录或 ZIP 文件。`:`Choose a plugin directory or ZIP file.`,confirmLabel:v?`使用此来源`:`Use this source`,nested:!0})]})})}export{z as a,L as c,W as d,le as f,O as g,fe as h,V as i,se as l,R as m,he as n,F as o,U as p,ce as r,M as s,J as t,H as u};
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{g as i,t as a}from"./chunk-KS7C4IRE-BMYIfy9x.js";import{t as o}from"./check-DUBLcKHA.js";import{t as s}from"./ellipsis-0k4rZLoy.js";import{t as c}from"./external-link-DjqjBmc3.js";import{t as l}from"./markdown-view-gPnGW4pR.js";import{t as u}from"./loader-circle-CifKLtgG.js";import{t as d}from"./plus-Q2yW6OE7.js";import{t as f}from"./x-B_N4OPjy.js";import{t as p}from"./messages-6j-AkWdj.js";import{t as m}from"./cn-JdwAhgNB.js";import{c as h,i as g,n as _,r as v}from"./locale-store-CCYf4Qxv.js";import{a as y,i as b,o as x,r as S,s as C,t as w}from"./dist-BGTk37IG.js";import{a as T,i as E}from"./vendor-swr-BIWyz7Rc.js";import{t as D}from"./button-CS04eWY9.js";import{o as O}from"./gateway-realtime-B6tO02l7.js";import{t as k}from"./skeleton-BwbyijEw.js";import{Bn as A,Hn as j,Ju as M,Lc as N,Ms as P,Ru as F,Vn as I,Wn as ee,_c as te,_o as L,ad as ne,gc as re,go as R,ho as z,ka as B,ul as V,vo as H,xo as U,yo as W,zc as G,zn as K}from"./index-Bbo9EJvY.js";import{n as q,t as J}from"./capability-header-actions-UQmVc6ea.js";import{t as Y}from"./page-tabs-BQLuzP2G.js";import{t as ie}from"./agent-plugin-dialog-BmYHMIPz.js";import{t as X}from"./capability-icon-BYm2-nS-.js";var Z=e(t(),1),ae=n();function Q(e){return e===`builtin`||e===`user`?e:`marketplace`}async function oe(e=``){let t=await g(v(`/api/marketplace${e.trim()?`?q=${encodeURIComponent(e.trim())}`:``}`),{cache:`no-store`});if(!t.ok)throw Error(await se(t));let n=await t.json();if(!n.ok||!Array.isArray(n.extensions))throw Error(n.error??`Invalid response`);return n.extensions}async function se(e){try{let t=await e.json();if(typeof t.error==`string`)return t.error;if(t.error&&typeof t.error==`object`&&typeof t.error.message==`string`)return t.error.message;if(typeof t.message==`string`)return t.message}catch{}return e.statusText||`HTTP ${e.status}`}async function ce(e){let t=await g(v(`/api/marketplace/packages/${encodeURIComponent(e.trim())}`),{cache:`no-store`});if(!t.ok)throw Error(await se(t));let n=await t.json();if(!n.ok||!n.payload?.id)throw Error(n.error??`Invalid response`);return n.payload}async function le(e){let t=await g(v(`/api/marketplace/install`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(await se(t));let n=await t.json();if(!n.ok||!n.payload?.extensionId)throw Error(n.error??`Invalid response`);return n.payload}async function ue(e){let t=await g(v(`/api/extensions/${encodeURIComponent(e.extensionId.trim())}/activation`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({enabled:e.enabled})});if(!t.ok)throw Error(await se(t));let n=await t.json();if(!n.ok||!n.payload)throw Error(n.error?.message??`Invalid response`);return n.payload}async function de(e){let t=await g(v(`/api/marketplace/uninstall`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({extensionId:e})});if(!t.ok)throw Error(await se(t));let n=await t.json();if(!n.ok||!n.payload)throw Error(n.error??`Invalid response`);return n.payload}var $=r();function fe(e,t){let n=e.find(e=>e.id===t||e.pluginId===t);return n?n.source===`bundled`?`bundled`:`user`:`absent`}var pe={debounced:``,detailPkg:null,quickInstallPkg:null,rowBusy:null,actionError:null,restartHint:null};function me({className:e,query:t}){let n=_(e=>e.language),r=p(n).extensionsPage,i=h(e=>!!e.conversationId),a=R(),{mutate:o}=T(),[s,c]=(0,Z.useReducer)(B,pe),{debounced:l,detailPkg:d,quickInstallPkg:f,rowBusy:g,actionError:v,restartHint:y}=s,b=i?`marketplace-${l}`:null;(0,Z.useEffect)(()=>{let e=window.setTimeout(()=>c({type:`patch`,patch:{debounced:t.trim()}}),300);return()=>window.clearTimeout(e)},[t]);let{data:x,isLoading:S,error:C}=E(b,()=>oe(l),{revalidateOnFocus:!1}),w=(0,Z.useCallback)(()=>{o(`gateway-extensions-list`),O()},[o]),D=(0,Z.useCallback)(async(e,t)=>{c({type:`patch`,patch:{actionError:null,restartHint:null,rowBusy:e}});try{let n=await le({name:e,overwrite:t});w(),n.requiresGatewayRestart&&c({type:`patch`,patch:{restartHint:r.marketplaceRestartHint}})}catch(e){throw c({type:`patch`,patch:{actionError:e instanceof Error?e.message:r.marketplaceInstallFailed}}),e}finally{c({type:`patch`,patch:{rowBusy:null}})}},[r.marketplaceInstallFailed,r.marketplaceRestartHint,w]),A=(0,Z.useCallback)(async e=>{c({type:`patch`,patch:{actionError:null,restartHint:null,rowBusy:e}});try{let t=await de(e);w(),t.requiresGatewayRestart&&c({type:`patch`,patch:{restartHint:r.marketplaceRestartHint}})}catch(e){throw c({type:`patch`,patch:{actionError:e instanceof Error?e.message:r.marketplaceUninstallFailed}}),e}finally{c({type:`patch`,patch:{rowBusy:null}})}},[r.marketplaceRestartHint,r.marketplaceUninstallFailed,w]),j=x??[];return(0,$.jsxs)(`div`,{className:m(`flex flex-col gap-4`,e),children:[C?(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:C instanceof Error?C.message:r.marketplaceLoadFailed}):null,v?(0,$.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:v}):null,y?(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:y}):null,S&&!x?(0,$.jsx)(`ul`,{className:`flex flex-col gap-3`,"aria-label":r.marketplaceLoading,children:[0,1,2].map(e=>(0,$.jsx)(`li`,{className:`rounded-xl bg-surface-panel p-4 shadow-surface`,children:(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,$.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2.5`,children:[(0,$.jsx)(k,{className:`h-5 w-40`}),(0,$.jsx)(k,{className:`h-4 w-full max-w-xl`}),(0,$.jsx)(k,{className:`h-4 w-2/3 max-w-md`})]}),(0,$.jsx)(k,{className:`h-8 w-20`})]})},e))}):(0,$.jsx)(`ul`,{className:`flex flex-col gap-3`,children:j.length===0?(0,$.jsx)(`li`,{className:`text-sm text-fg-muted`,children:r.marketplaceEmpty}):j.map(e=>{let t=fe(a,e.id),i=g===e.id;return(0,$.jsx)(`li`,{className:`list-none`,children:(0,$.jsxs)(`div`,{role:`button`,tabIndex:0,"aria-label":`${e.name}, ${r.marketplaceDetailTitle}`,onClick:()=>c({type:`patch`,patch:{detailPkg:e.id}}),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),c({type:`patch`,patch:{detailPkg:e.id}}))},className:m(`flex w-full cursor-pointer flex-wrap items-start gap-3 rounded-xl bg-surface-panel p-4 text-left shadow-surface`,`transition-[transform,background-color,box-shadow] duration-150 ease-out`,`hover:bg-surface-hover/40`,`active:scale-[0.992] active:bg-surface-hover/55`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`,`dark:hover:bg-surface-hover/25 dark:active:bg-surface-hover/35`),children:[(0,$.jsx)(X,{iconUrl:e.branding?.iconUrl,fallback:V}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,$.jsx)(`h3`,{className:`font-semibold text-fg`,children:e.name}),e.verified?(0,$.jsx)(F,{className:`size-4 shrink-0 text-emerald-600 dark:text-emerald-400`,strokeWidth:1.75,"aria-label":`Verified`}):null,e.version?(0,$.jsx)(`span`,{className:`text-xs text-fg-muted`,children:e.version}):null]}),e.description?(0,$.jsx)(`p`,{className:`mt-1 line-clamp-2 text-sm text-fg-muted`,children:e.description}):null,(0,$.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:(e.categories??[]).map(e=>(0,$.jsx)(`span`,{className:`rounded-md border border-edge bg-surface-panel px-2 py-0.5 text-[11px] text-fg-muted`,children:e},e))}),(0,$.jsxs)(`p`,{className:`mt-2 flex items-center gap-1.5 text-xs text-fg-muted`,children:[(0,$.jsx)(V,{className:`size-3.5 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}),(0,$.jsx)(`code`,{className:`rounded bg-surface-panel px-1 py-0.5`,children:e.npmPackage})]})]}),(0,$.jsx)(`div`,{role:`group`,className:`flex shrink-0 flex-col items-end gap-2 sm:min-w-[9rem]`,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:t===`bundled`?(0,$.jsx)(`span`,{className:`rounded-md bg-surface-hover px-2 py-1 text-[11px] font-medium text-fg-muted`,children:r.marketplaceBuiltin}):t===`user`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`text-[11px] font-medium text-fg-muted`,children:r.marketplaceInstalled}),e.packageType===`plugin`?(0,$.jsx)(`button`,{type:`button`,onClick:()=>c({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:n.startsWith(`zh`)?`管理`:`Manage`}):(0,$.jsxs)(`button`,{type:`button`,disabled:i,onClick:()=>{window.confirm(r.marketplaceUninstallConfirm)&&A(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)(u,{className:`size-3.5 animate-spin`,"aria-hidden":!0}):(0,$.jsx)(te,{className:`size-3.5`,strokeWidth:2,"aria-hidden":!0}),r.marketplaceUninstall]})]}):(0,$.jsx)(`button`,{type:`button`,onClick:()=>c({type:`patch`,patch:e.packageType===`plugin`?{detailPkg:e.id,quickInstallPkg:e.id}:{detailPkg:e.id,quickInstallPkg:null}}),className:m(`inline-flex w-full 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`?n.startsWith(`zh`)?`安装`:`Install`:r.marketplaceReview})})]})},e.id)})}),d?(0,$.jsx)(he,{packageName:d,autoInstall:f===d,copy:r,extensions:a,onClose:()=>c({type:`patch`,patch:{detailPkg:null,quickInstallPkg:null}}),onInstall:D,onUninstall:A}):null]})}function he(e){let t=(0,ae.c)(96),{packageName:n,autoInstall:r,copy:i,extensions:o,onClose:s,onInstall:c,onUninstall:d}=e,[p,g]=(0,Z.useState)(!1),[_,v]=(0,Z.useState)(!1),b=h(be)?`ext-mp-detail-${n}`:null,T;t[0]===n?T=t[1]:(T=async()=>ce(n),t[0]=n,t[1]=T);let D;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(D={revalidateOnFocus:!1},t[2]=D):D=t[2];let{data:O,error:A,isLoading:j}=E(b,T,D),M;t[3]!==o||t[4]!==n?(M=fe(o,n),t[3]=o,t[4]=n,t[5]=M):M=t[5];let P=M,F=P===`user`,I=O?.manifest?.permissions,ee,L,R,z,B,V,H,U,W,G,K,q;if(t[6]!==r||t[7]!==i||t[8]!==O||t[9]!==A||t[10]!==o||t[11]!==P||t[12]!==j||t[13]!==s||t[14]!==n||t[15]!==I||t[16]!==_){V=Symbol.for(`react.early_return_sentinel`);bb0:{let e=I&&typeof I==`object`&&!Array.isArray(I)?Object.entries(I):[],a;t[29]!==i||t[30]!==O?(a=O?.readme?.trim()||(O?.description?.trim()?`### ${O.name}\n\n${O.description}`:`*${i.marketplaceNoReadme}*`),t[29]=i,t[30]=O,t[31]=a):a=t[31];let c=a;if(O?.format===`agent-plugin`){let e;if(t[32]!==O||t[33]!==o){let n;t[35]===O?n=t[36]:(n=e=>e.pluginId===O.manifest?.name,t[35]=O,t[36]=n),e=o.find(n),t[32]=O,t[33]=o,t[34]=e}else e=t[34];let i=`store:${n}`,a;t[37]!==r||t[38]!==O||t[39]!==s||t[40]!==e||t[41]!==i?(a=(0,$.jsx)(ie,{extension:e,initialSource:i,marketplace:O,autoInstall:r,onClose:s}),t[37]=r,t[38]=O,t[39]=s,t[40]=e,t[41]=i,t[42]=a):a=t[42],V=a;break bb0}R=w,z=!0,t[43]===s?B=t[44]:(B=e=>!e&&s(),t[43]=s,t[44]=B),L=x,t[45]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,$.jsx)(y,{className:`xopc-dialog-overlay fixed inset-0 z-[130] bg-scrim`}),t[45]=q):q=t[45],ee=S,W=`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`,G=ye;let u;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(ne,{className:`size-5`}),t[46]=u):u=t[46];let d;t[47]!==i.detailBack||t[48]!==s?(d=(0,$.jsx)(`button`,{type:`button`,onClick:s,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:u}),t[47]=i.detailBack,t[48]=s,t[49]=d):d=t[49];let p;t[50]===i.marketplaceDetailTitle?p=t[51]:(p=(0,$.jsx)(C,{className:`min-w-0 flex-1 truncate text-center text-sm font-semibold text-fg`,children:i.marketplaceDetailTitle}),t[50]=i.marketplaceDetailTitle,t[51]=p);let m;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,$.jsx)(f,{className:`size-5`}),t[52]=m):m=t[52];let h;t[53]!==i.detailClose||t[54]!==s?(h=(0,$.jsx)(`button`,{type:`button`,onClick:s,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[53]=i.detailClose,t[54]=s,t[55]=h):h=t[55],t[56]!==d||t[57]!==p||t[58]!==h?(K=(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[56]=d,t[57]=p,t[58]=h,t[59]=K):K=t[59],H=`min-h-0 flex-1 overflow-y-auto p-5`,U=j&&!O?(0,$.jsxs)(`div`,{className:`space-y-4`,"aria-label":i.marketplaceLoading,children:[(0,$.jsx)(k,{className:`h-6 w-48`}),(0,$.jsx)(k,{className:`h-4 w-28`}),(0,$.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,$.jsx)(k,{className:`h-12`}),(0,$.jsx)(k,{className:`h-12`})]}),(0,$.jsx)(k,{className:`h-28 w-full`}),(0,$.jsx)(k,{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})]}):O?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`h3`,{className:`text-lg font-semibold text-fg`,children:O.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:O.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:O.author.username})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`font-medium text-fg`,children:i.marketplaceVersion}),(0,$.jsx)(`dd`,{children:O.latestVersion.version})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`font-medium text-fg`,children:i.marketplaceDownloads}),(0,$.jsx)(`dd`,{children:O.downloads})]})]}),P===`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:[O.installability.available?(0,$.jsx)(N,{className:`mt-0.5 size-5 shrink-0 text-emerald-600 dark:text-emerald-400`,"aria-hidden":!0}):(0,$.jsx)(re,{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:O.installability.available?i.marketplaceRiskTitle:i.marketplaceUnavailableTitle}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-fg-muted`,children:O.installability.available?i.marketplaceCodeRisk:O.installability.reason??i.marketplaceUnavailableBody})]})]}),O.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:O.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(ve)}):(0,$.jsx)(`p`,{className:`mt-1`,children:i.marketplacePermissionsNone})]}),(O.packageSummary?.lifecycleScripts.length??0)>0?(0,$.jsxs)(`p`,{className:`text-xs leading-relaxed text-amber-700 dark:text-amber-300`,children:[i.marketplaceLifecycleScripts,`: `,O.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:_,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]}),O.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)(l,{content:c})})]}):null}t[6]=r,t[7]=i,t[8]=O,t[9]=A,t[10]=o,t[11]=P,t[12]=j,t[13]=s,t[14]=n,t[15]=I,t[16]=_,t[17]=ee,t[18]=L,t[19]=R,t[20]=z,t[21]=B,t[22]=V,t[23]=H,t[24]=U,t[25]=W,t[26]=G,t[27]=K,t[28]=q}else ee=t[17],L=t[18],R=t[19],z=t[20],B=t[21],V=t[22],H=t[23],U=t[24],W=t[25],G=t[26],K=t[27],q=t[28];if(V!==Symbol.for(`react.early_return_sentinel`))return V;let J;t[60]!==H||t[61]!==U?(J=(0,$.jsx)(`div`,{className:H,children:U}),t[60]=H,t[61]=U,t[62]=J):J=t[62];let Y;t[63]!==p||t[64]!==i.marketplaceBuiltinGoBuiltin||t[65]!==i.marketplaceBuiltinManageHint||t[66]!==i.marketplaceInstall||t[67]!==i.marketplaceReinstall||t[68]!==i.marketplaceReinstallConfirm||t[69]!==i.marketplaceUninstall||t[70]!==i.marketplaceUninstallConfirm||t[71]!==O||t[72]!==P||t[73]!==s||t[74]!==c||t[75]!==d||t[76]!==n||t[77]!==_||t[78]!==F?(Y=O?(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:P===`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)(a,{to:`/capabilities/extensions?tab=builtin`,onClick:s,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:p||!O.installability.available||!_,onClick:()=>{F&&!window.confirm(i.marketplaceReinstallConfirm)||(g(!0),c(n,F).catch(_e).finally(()=>g(!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:[p?(0,$.jsx)(u,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,F?i.marketplaceReinstall:i.marketplaceInstall]}),F?(0,$.jsxs)(`button`,{type:`button`,disabled:p,onClick:()=>{window.confirm(i.marketplaceUninstallConfirm)&&(g(!0),d(n).then(()=>s()).catch(ge).finally(()=>g(!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)(te,{className:`size-4 shrink-0`,"aria-hidden":!0}),i.marketplaceUninstall]}):null]})}):null,t[63]=p,t[64]=i.marketplaceBuiltinGoBuiltin,t[65]=i.marketplaceBuiltinManageHint,t[66]=i.marketplaceInstall,t[67]=i.marketplaceReinstall,t[68]=i.marketplaceReinstallConfirm,t[69]=i.marketplaceUninstall,t[70]=i.marketplaceUninstallConfirm,t[71]=O,t[72]=P,t[73]=s,t[74]=c,t[75]=d,t[76]=n,t[77]=_,t[78]=F,t[79]=Y):Y=t[79];let X;t[80]!==ee||t[81]!==J||t[82]!==Y||t[83]!==W||t[84]!==G||t[85]!==K?(X=(0,$.jsxs)(ee,{className:W,onOpenAutoFocus:G,children:[K,J,Y]}),t[80]=ee,t[81]=J,t[82]=Y,t[83]=W,t[84]=G,t[85]=K,t[86]=X):X=t[86];let Q;t[87]!==L||t[88]!==X||t[89]!==q?(Q=(0,$.jsxs)(L,{children:[q,X]}),t[87]=L,t[88]=X,t[89]=q,t[90]=Q):Q=t[90];let oe;return t[91]!==R||t[92]!==z||t[93]!==B||t[94]!==Q?(oe=(0,$.jsx)(R,{defaultOpen:z,onOpenChange:B,children:Q}),t[91]=R,t[92]=z,t[93]=B,t[94]=Q,t[95]=oe):oe=t[95],oe}function ge(){}function _e(){}function ve(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 ye(e){return e.preventDefault()}function be(e){return!!e.conversationId}function xe({embedded:e=!1,onHeaderActionChange:t}){let n=_(e=>e.language),r=p(n),o=U(e=>e.setPageHeader),c=U(e=>e.clearPageHeader),l=R(),u=L(),[f,h]=i(),g=Q(f.get(`tab`)),v=f.get(`q`)??``,[y,b]=(0,Z.useState)(g),[x,S]=(0,Z.useState)(v),[C,w]=(0,Z.useState)(null),[T,E]=(0,Z.useState)(!1),O=f.toString(),k=(0,Z.useRef)(O);if(k.current!==O){k.current=O;let e=Q(f.get(`tab`)),t=f.get(`q`)??``;b(t=>t===e?t:e),S(e=>e===t?e:t)}(0,Z.useEffect)(()=>{h(e=>{let t=new URLSearchParams(e),n=x.trim();return n?t.set(`q`,n):t.delete(`q`),y===`marketplace`?t.delete(`tab`):t.set(`tab`,y),t.toString()===e.toString()?e:t},{replace:!0})},[y,x,h]);let N=(0,Z.useMemo)(()=>l.filter(e=>e.source===`bundled`),[l]),F=(0,Z.useMemo)(()=>l.filter(e=>e.source!==`bundled`),[l]),te=y===`builtin`?N:F,ne=(0,Z.useMemo)(()=>{let e=x.trim().toLowerCase(),t=te;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,n):e.hasUi?-1:1)},[te,x,n]);(0,Z.useEffect)(()=>{w(e=>{if(!e)return e;let t=l.find(t=>t.id===e.id);return t?Se(e)===Se(t)&&e.active===t.active&&JSON.stringify(e)===JSON.stringify(t)?e:t:null})},[l]);let re=(0,Z.useMemo)(()=>({searchLabel:y===`marketplace`?r.extensionsPage.marketplaceSearchPlaceholder:r.extensionsPage.searchPlaceholder,search:(0,$.jsx)(q,{value:x,onChange:S,placeholder:y===`marketplace`?r.extensionsPage.marketplaceSearchPlaceholder:r.extensionsPage.searchPlaceholder}),overflow:(0,$.jsxs)(j,{children:[(0,$.jsx)(ee,{asChild:!0,children:(0,$.jsx)(D,{variant:`secondary`,className:`size-9 shrink-0 p-0`,"aria-label":r.capabilitiesHub.moreActions,title:r.capabilitiesHub.moreActions,children:(0,$.jsx)(s,{className:`size-4`,"aria-hidden":!0})})}),(0,$.jsx)(I,{children:(0,$.jsxs)(K,{align:`end`,sideOffset:6,className:`z-50 min-w-48 rounded-xl border border-edge bg-surface-panel p-1 shadow-popover`,children:[(0,$.jsxs)(A,{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`,P.transition),onSelect:()=>E(!0),children:[(0,$.jsx)(d,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),n.startsWith(`zh`)?`安装插件`:`Install plugin`]}),(0,$.jsx)(A,{asChild:!0,children:(0,$.jsxs)(a,{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`,P.transition),children:[(0,$.jsx)(M,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),r.extensionsPage.openLocalApps]})})]})})]}),primary:(0,$.jsx)(D,{asChild:!0,variant:`primary`,className:`h-9 shrink-0`,children:(0,$.jsxs)(a,{to:`/local-apps/new`,"aria-label":r.extensionsPage.createLocalApp,children:[(0,$.jsx)(d,{className:`size-4`,"aria-hidden":!0}),(0,$.jsx)(`span`,{className:`hidden sm:inline`,children:r.extensionsPage.createLocalApp})]})})}),[n,r.capabilitiesHub.moreActions,r.extensionsPage,y,x]);if((0,Z.useLayoutEffect)(()=>e?(t?.(re),()=>t?.(null)):(o({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:r.extensionsPage.title})}),end:(0,$.jsx)(J,{contribution:re})}),()=>c()),[c,e,re,r.extensionsPage.title,t,o]),u&&y!==`marketplace`)return(0,$.jsx)(ke,{});let z=[{id:`marketplace`,label:r.extensionsPage.tabMarketplace},{id:`builtin`,label:r.extensionsPage.tabBuiltin,count:N.length},{id:`user`,label:r.extensionsPage.tabUser,count:F.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`,e?`pb-7 pt-3 lg:pb-9 lg:pt-4`:`py-7 lg:py-9`),children:[(0,$.jsx)(`div`,{className:`mb-6 border-b border-edge-subtle pb-3`,children:(0,$.jsx)(Y,{items:z,activeTab:y,onChange:b,ariaLabel:r.extensionsPage.extensionsNavAria,tabIdPrefix:`extensions-tab`,panelIdPrefix:`extensions-panel`,className:`flex-wrap`})}),y===`marketplace`?(0,$.jsx)(me,{query:x}):y===`builtin`&&N.length===0?(0,$.jsx)(je,{message:r.extensionsPage.emptyBuiltin}):y===`user`&&F.length===0?(0,$.jsx)(je,{message:r.extensionsPage.emptyUser}):ne.length===0?(0,$.jsx)(`p`,{className:`px-3 py-14 text-center text-sm text-fg-muted sm:px-5 xl:px-6`,children:r.extensionsPage.noSearchResults}):(0,$.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:ne.map(e=>(0,$.jsx)(Ee,{extension:e,copy:r.extensionsPage,showSourceBadge:y===`user`,onOpen:()=>w(e)},e.id))})]}),C?C.format===`agent-plugin`?(0,$.jsx)(ie,{extension:C,onClose:()=>w(null)},C.id):(0,$.jsx)(De,{extension:C,copy:r.extensionsPage,onClose:()=>w(null)},C.id):null,T?(0,$.jsx)(ie,{onClose:()=>E(!1)}):null]})}function Se(e){return e.activationEligible??e.active}function Ce(e,t){return e.source===`bundled`?t.providerBundled:e.source===`global`?t.providerGlobal:e.source===`workspace`?t.providerWorkspace:t.providerOther}function we(e,t){return e.source===`global`?t.badgeSourceGlobal:e.source===`workspace`?t.badgeSourceWorkspace:t.badgeSourceOther}function Te(e,t){let n=Se(e);return n&&e.active?t.runStateLive:n&&!e.active?t.runStatePendingOn:!n&&e.active?t.runStatePendingOff:t.runStateOff}function Ee(e){let t=(0,ae.c)(45),{extension:n,copy:r,showSourceBadge:i,onOpen:a}=e,s;t[0]===n?s=t[1]:(s=Se(n),t[0]=n,t[1]=s);let c=s,l=n.hasUi?r.cardTooltipHasUi:r.cardTooltipNoUi,u;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=m(`group flex w-full flex-col rounded-xl border border-edge-subtle bg-surface-base p-4 text-left shadow-surface transition-colors`,`hover:bg-surface-hover/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,`dark:hover:bg-surface-hover/25`),t[2]=u):u=t[2];let f=n.name||n.id,p;t[3]===f?p=t[4]:(p=f.charAt(0).toUpperCase(),t[3]=f,t[4]=p);let h;t[5]===p?h=t[6]:(h=(0,$.jsx)(`div`,{className:`flex size-12 shrink-0 items-center justify-center rounded-xl bg-accent-soft text-base font-semibold text-accent-fg`,"aria-hidden":!0,children:p}),t[5]=p,t[6]=h);let g;t[7]===n.name?g=t[8]:(g=(0,$.jsx)(`h2`,{className:`truncate text-sm font-semibold text-fg`,children:n.name}),t[7]=n.name,t[8]=g);let _;t[9]===n.version?_=t[10]:(_=n.version?(0,$.jsxs)(`span`,{className:`text-[11px] text-fg-muted`,children:[`v`,n.version]}):null,t[9]=n.version,t[10]=_);let v;t[11]!==g||t[12]!==_?(v=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[g,_]}),t[11]=g,t[12]=_,t[13]=v):v=t[13];let y;t[14]!==r.statusEnabled||t[15]!==c?(y=c?(0,$.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 rounded-full bg-surface-hover px-2 py-0.5 text-[11px] font-medium text-fg-muted`,children:[(0,$.jsx)(o,{className:`size-3`,strokeWidth:2.5,"aria-hidden":!0}),r.statusEnabled]}):(0,$.jsx)(`span`,{className:`flex size-8 shrink-0 items-center justify-center rounded-full border-2 border-accent text-accent`,"aria-hidden":!0,children:(0,$.jsx)(d,{className:`size-4`,strokeWidth:2.5})}),t[14]=r.statusEnabled,t[15]=c,t[16]=y):y=t[16];let b;t[17]!==v||t[18]!==y?(b=(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[v,y]}),t[17]=v,t[18]=y,t[19]=b):b=t[19];let x;t[20]!==r.cardNoDescription||t[21]!==n.description?(x=n.description?.trim()||r.cardNoDescription,t[20]=r.cardNoDescription,t[21]=n.description,t[22]=x):x=t[22];let S;t[23]===x?S=t[24]:(S=(0,$.jsx)(`p`,{className:`mt-2 line-clamp-2 text-xs leading-relaxed text-fg-muted`,children:x}),t[23]=x,t[24]=S);let C=n.format===`agent-plugin`?`Agent Plugin`:n.hasUi?r.badgeKindUi:r.badgeKindBackend,w;t[25]!==C||t[26]!==l?(w=(0,$.jsx)(`span`,{title:l,className:`rounded-md bg-surface-hover px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide text-fg-muted`,children:C}),t[25]=C,t[26]=l,t[27]=w):w=t[27];let T;t[28]!==r||t[29]!==n||t[30]!==i?(T=n.source===`bundled`?(0,$.jsx)(`span`,{className:`rounded-md bg-surface-hover px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide text-fg-muted`,children:r.badgeBundled}):i?(0,$.jsx)(`span`,{title:Ce(n,r),className:`rounded-md bg-surface-hover px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide text-fg-muted`,children:we(n,r)}):null,t[28]=r,t[29]=n,t[30]=i,t[31]=T):T=t[31];let E;t[32]!==w||t[33]!==T?(E=(0,$.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:[w,T]}),t[32]=w,t[33]=T,t[34]=E):E=t[34];let D;t[35]!==b||t[36]!==S||t[37]!==E?(D=(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[b,S,E]}),t[35]=b,t[36]=S,t[37]=E,t[38]=D):D=t[38];let O;t[39]!==D||t[40]!==h?(O=(0,$.jsxs)(`div`,{className:`flex gap-3`,children:[h,D]}),t[39]=D,t[40]=h,t[41]=O):O=t[41];let k;return t[42]!==a||t[43]!==O?(k=(0,$.jsx)(`button`,{type:`button`,onClick:a,className:u,children:O}),t[42]=a,t[43]=O,t[44]=k):k=t[44],k}function De({extension:e,copy:t,onClose:n}){let{mutate:r}=T(),[i,o]=(0,Z.useState)(null),[s,l]=(0,Z.useState)(null),[d,p]=(0,Z.useState)(!1),h=e.activationEligible===!0,g=(0,Z.useCallback)(async()=>{l(null),p(!1),o(`toggle`);try{let{requiresGatewayRestart:t}=await ue({extensionId:e.id,enabled:!h});await r(`gateway-extensions-list`),O(),p(t)}catch(e){l(e instanceof Error?e.message:t.extensionToggleFailed)}finally{o(null)}},[h,t.extensionToggleFailed,e.id,r]),_=(0,Z.useCallback)(async()=>{if(!(e.source===`bundled`||!window.confirm(t.extensionUninstallConfirm))){l(null),p(!1),o(`uninstall`);try{await de(e.id),await r(`gateway-extensions-list`),O(),n()}catch(e){l(e instanceof Error?e.message:t.marketplaceUninstallFailed),o(null)}}},[t.extensionUninstallConfirm,t.marketplaceUninstallFailed,e.id,e.source,r,n]),v=e.ui?.contributions?.pages??[],E=e.ui?.contributions?.settingsPanels??[],k=e.ui?.contributions?.chatWidgets??[],A=v.find(e=>e.showInNav)??v[0],j=E[0],M=A?z(e.id,A):null,N=j?`/settings/ext/${e.id}/${j.id}`:e.hasConfigSchema||H(e)?`/settings/ext/${e.id}`:null;return(0,$.jsx)(w,{defaultOpen:!0,onOpenChange:e=>!e&&n(),children:(0,$.jsxs)(x,{children:[(0,$.jsx)(y,{className:`xopc-dialog-overlay fixed inset-0 z-[130] bg-scrim`}),(0,$.jsxs)(S,{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)(ne,{className:`size-5`})}),(0,$.jsx)(C,{className:`min-w-0 flex-1 truncate text-center text-sm font-semibold text-fg`,children:t.detailTitle}),(0,$.jsxs)(b,{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,` `,Ce(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:Te(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)(D,{type:`button`,variant:`secondary`,disabled:i!==null,onClick:()=>void g(),className:`shrink-0 py-1.5 text-xs`,children:i===`toggle`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(u,{className:`mr-1.5 size-3.5 shrink-0 animate-spin`,"aria-hidden":!0}),t.builtinToggleBusy]}):h?t.builtinToggleDisable:t.builtinToggleEnable})]}),s?(0,$.jsx)(`p`,{className:`mt-2 text-xs text-rose-600 dark:text-rose-400`,children:s}):null,d?(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)(D,{type:`button`,variant:`ghost`,disabled:i!==null,onClick:()=>void _(),className:`text-danger hover:bg-danger-soft hover:text-danger`,children:[i===`uninstall`?(0,$.jsx)(u,{className:`size-3.5 animate-spin`,"aria-hidden":!0}):(0,$.jsx)(te,{className:`size-3.5`,"aria-hidden":!0}),t.marketplaceUninstall]})})]}),e.hasUi&&(v.length>0||E.length>0||k.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)(Oe,{template:t.badgePages,count:v.length,hidden:v.length===0}),(0,$.jsx)(Oe,{template:t.badgeSettings,count:E.length,hidden:E.length===0}),(0,$.jsx)(Oe,{template:t.badgeWidgets,count:k.length,hidden:k.length===0})]})]}):null,W(e)&&(M||N)?(0,$.jsxs)(`div`,{className:`mt-6 flex flex-wrap gap-2 border-t border-edge-subtle pt-4`,children:[M?(0,$.jsxs)(a,{to:M,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)(c,{className:`size-4 shrink-0 opacity-80`,"aria-hidden":!0}),t.open]}):null,N?(0,$.jsxs)(a,{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)(G,{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 Oe(e){let t=(0,ae.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 ke(){let e=(0,ae.c)(5),t,n,r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(`div`,{className:`mb-6 h-8 w-40 max-w-full animate-pulse rounded-md bg-surface-hover`}),n=(0,$.jsx)(`div`,{className:`mb-2 h-4 w-full max-w-md animate-pulse rounded bg-surface-hover`}),r=(0,$.jsx)(`div`,{className:`mb-5 h-9 w-full max-w-lg animate-pulse rounded-full bg-surface-hover`}),e[0]=t,e[1]=n,e[2]=r):(t=e[0],n=e[1],r=e[2]);let i;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=[`ap0`,`ap1`,`ap2`,`ap3`,`ap4`,`ap5`],e[3]=i):i=e[3];let a;return e[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col bg-surface-panel`,children:(0,$.jsxs)(`div`,{className:`w-full px-3 py-8 sm:px-5 xl:px-6`,children:[t,n,r,(0,$.jsx)(`div`,{className:`mt-6 grid gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:i.map(Ae)})]})}),e[4]=a):a=e[4],a}function Ae(e){return(0,$.jsx)(`div`,{className:`h-36 animate-pulse rounded-xl border border-edge-subtle bg-surface-base shadow-surface`},e)}function je(e){let t=(0,ae.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{xe as ExtensionsPage};
@@ -1 +0,0 @@
1
- import{p as e}from"./locale-store-CCYf4Qxv.js";var t=e(()=>({connectionState:`idle`,error:null}));function n(e){t.setState(e)}export{t as n,n as t};