@xopcai/xopc 0.0.425 → 0.0.426
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/{activity-store-CMw8qBuC.js → activity-store-D_DXNHba.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-JI0YWOIm.js → agent-avatar-dicebear-CjaQxFQt.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-display-YqmwzOSa.js → agent-avatar-display-6Z4m31Fz.js} +2 -2
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-DlvjxWg6.js → agent-defaults-settings-panel-Dne9A10p.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-OBueuQSc.js → agent-plugin-dialog-BoHL-b1o.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-Cp6_5OOQ.js → agents-CIiIlVBp.js} +3 -3
- package/dist/gateway/static/root/assets/{agents-admin-api-DLnmdC1h.js → agents-admin-api-u5c3GREg.js} +1 -1
- package/dist/gateway/static/root/assets/{api-Boc-CVh7.js → api-C3Tp9MkF.js} +1 -1
- package/dist/gateway/static/root/assets/{api-bL7sxjAF.js → api-CRT9ZyH0.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-jIG5i7KE.js → app-management-settings-panel-C8yc3yHG.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-BnaQW9Xd.js → appearance-settings-BELgtR3O.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-C2WKUwtN.js → apps-page-vgS1CHDj.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-DjboG3kA.js → archive-plugin-BCQnOkV8.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-api-CZqL9l_d.js → automation-api-hRsGx-qe.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-result-state-DRd-X_Ai.js → automation-result-state-CMfVTv_i.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-task-card-wbnR5i6N.js → automation-task-card-MnzgyTVA.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-HyBQIfmn.js → automations-page-CdIPdwF0.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-D6cTOKr7.js → automations-workspace-C3xZLafX.js} +2 -2
- package/dist/gateway/static/root/assets/{binary-plugins-Bg8ARZUH.js → binary-plugins-CIB5cbvQ.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-DKohqFAW.js → block-editor-BQtTLe6Q.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automation-inputs-YeibTzw4.js → browser-automation-inputs-DeraGZ1y.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-BWNcbuz2.js → browser-automations-page-SpPzRNqU.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-control-api-CDeuxy2x.js → browser-control-api-CbbPvhHR.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-L0nBjfhG.js → browser-settings-page-BD1uF_Nb.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-aT-QjNTl.js → capabilities-BGE6hiUE.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-BcQa8c9n.js → capabilities-DLMuj21P.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-page-DlpuHdHi.js → capabilities-page-Bda4mSdf.js} +2 -2
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-pvqkN2-2.js → capabilities-settings-panel-B2B7no22.js} +2 -2
- package/dist/gateway/static/root/assets/{channels-BUPtawh6.js → channels-NtsjZThx.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-agents-api-B8JO6Tcj.js → chat-agents-api-D8YS5amE.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-chart-block-DRtuFfF1.js → chat-chart-block-DCzUECct.js} +1 -1
- package/dist/gateway/static/root/assets/chat-page-BnOCCAXG.js +72 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-Dkqq5FSL.js → chat-terminal-dock-Dl-OTkJI.js} +1 -1
- package/dist/gateway/static/root/assets/{command-palette-api-qujvNqkK.js → command-palette-api-Dijix7V6.js} +1 -1
- package/dist/gateway/static/root/assets/{composer-payload-handoff-CYIhcczq.js → composer-payload-handoff-CQc-VTaL.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-8q4hRmoo.js → computer-settings-page-B-lGMimW.js} +1 -1
- package/dist/gateway/static/root/assets/connected-providers-grid-CcXe9kz5.js +1 -0
- package/dist/gateway/static/root/assets/{connector-service-page-DQaTI21R.js → connector-service-page-C8InhrMt.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-api-BjypBp2g.js → connectors-api-DEJU8mgn.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-Lf1ZzaVn.js → connectors-page-Ci0L2How.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-D_PSHGpe.js → date-picker-kqic8j73.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-UqKVJ9dv.js → dependency-picker-cbC6-2Ya.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-1Et9VqkM.js → desktop-pet-DFNehTtd.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-narrative-rADKU0FX.js → desktop-pet-narrative-ChwjpnsG.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-0fCGgaG7.js → desktop-pet-settings-BDS7_tQ_.js} +1 -1
- package/dist/gateway/static/root/assets/{dev-view-store-TTj_djD8.js → dev-view-store-CeZZLOc6.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-ByEL5lvM.js → device-pairing-wizard-_3BJFWVQ.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-C07a7wYX.js → directory-picker-path-field-Di0h3ws4.js} +1 -1
- package/dist/gateway/static/root/assets/{discussion-annotation-sync-BFqKm9ky.js → discussion-annotation-sync-ClKEyXmN.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-DFaVlqas.js → extension-debug-page-DwB5KMGk.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-iframe-host-BfzPfXBq.js → extension-iframe-host-Cqg1K70e.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-marketplace-api-ow0K1Y4_.js → extension-marketplace-api-DRBszrCR.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-CrDADV5W.js → extension-page-DyrQtG82.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-mnRoa63o.js → extension-provider-C_uKqJxP.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-BLl02GFY.js → extension-settings-page-BAMQHzkX.js} +1 -1
- package/dist/gateway/static/root/assets/{file-preview-surface-TGdKqhCf.js → file-preview-surface-DfkXvFnc.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-DfPQIHOL.js → gateway-config-swr-BOCt_zOo.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-67vWg_M2.js → gateway-realtime-BL_Cf0OQ.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-BHBOPF_q.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-restart-CLtR2wkL.js → gateway-restart-CHf8qY7H.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-COvC3r-l.js → gateway-settings-uAboiElC.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-9YQllbw2.js → gateway-startup-retry-CvkJYurV.js} +1 -1
- package/dist/gateway/static/root/assets/{global-defaults-api-DYMRjGvd.js → global-defaults-api-BWMbKu72.js} +1 -1
- package/dist/gateway/static/root/assets/{home-page-k9LFXcVa.js → home-page-D6pCBY1V.js} +2 -2
- package/dist/gateway/static/root/assets/{image-generation-api-Dzydfvy8.js → image-generation-api-CQxZSTWA.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-Csd_YZXZ.js → imports-page-C90644id.js} +1 -1
- package/dist/gateway/static/root/assets/index-Cc41XQid.css +1 -0
- package/dist/gateway/static/root/assets/{index-DKW7BeT_.js → index-CnOYR6jq.js} +5 -5
- package/dist/gateway/static/root/assets/{install-connector-dialog-CTQAKTPv.js → install-connector-dialog-BuNXON0P.js} +1 -1
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-B201bMIa.js → keyboard-shortcuts-settings-CbeubKe1.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-CD_8_gd_.js → local-app-workbench-page-CP-BkbB6.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-BOwqNH0L.js → local-apps-page-C6zFgwkr.js} +1 -1
- package/dist/gateway/static/root/assets/{local-session-drafts-DjmK-SM9.js → local-session-drafts-BJ1B1dQ7.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-Bg_XR36n.js → locale-store-Br7IfbXK.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-gw3E9CMQ.js → logs-page-CpVCvAWE.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-t_Z2mCyw.js → management-settings-I-pXv4ML.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-BUpXJUPv.js → markdown-view-DrVAMlwc.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-_shnaEMY.js → media-plugins-Ba6vUE4J.js} +1 -1
- package/dist/gateway/static/root/assets/messages-ByFlEbsu.js +3 -0
- package/dist/gateway/static/root/assets/{model-selector-a7PIT1Lk.js → model-selector-CXcxc30J.js} +1 -1
- package/dist/gateway/static/root/assets/{models-hub-cache-KOJC3z6Q.js → models-hub-cache-Bd-fYUrV.js} +1 -1
- package/dist/gateway/static/root/assets/{note-detail-panel-BsHYUFgk.js → note-detail-panel-CbpLXAVh.js} +3 -3
- package/dist/gateway/static/root/assets/note-image-lightbox-cLGiF8oU.js +1 -0
- package/dist/gateway/static/root/assets/{notes-api-BSmikUKI.js → notes-api-CUlhTRv0.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-CA0NRL8O.js → notes-page-eoKX85K5.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-api-D2t9HXoC.js → oauth-api-DMMdeaNd.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-provider-connect-DGGGGtcB.js → oauth-provider-connect-C8BXow79.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-capture-button-BH54VO0V.js → page-context-capture-button-CBFK41OS.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-draft-BS5y8Cx9.js → page-context-draft-LF33STHC.js} +1 -1
- package/dist/gateway/static/root/assets/page-header-store-Du44NIEJ.js +1 -0
- package/dist/gateway/static/root/assets/{personal-avatar-D8DtpDTa.js → personal-avatar-D6CzIIfo.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-page-KJezmTKP.js → personal-page-CXR1Gy0x.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-settings-panel-9uDaNJy5.js → personal-settings-panel-DnYapLo7.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-dependencies-card-DLYrI0C4.js → phone-dependencies-card-DBiKtzwz.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-picker-BbA2iI-3.js → phone-model-picker-BmSxEr7M.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-settings-page-Cg_BPss4.js → phone-settings-page-vg65qilc.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-workspace-store-CVDk80Bf.js → phone-workspace-store-SN7hfddU.js} +1 -1
- package/dist/gateway/static/root/assets/{plugin-details-dialog-DgibLkc3.js → plugin-details-dialog-B3Hn2cbx.js} +1 -1
- package/dist/gateway/static/root/assets/{preference-select-fields-BVoN-lAv.js → preference-select-fields-Cu_ZC9Up.js} +1 -1
- package/dist/gateway/static/root/assets/{product-automation-feedback-DCo90zGh.js → product-automation-feedback-Tn2dUJWM.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-OWl8IAoY.js → product-open-page-Nf-Oqf1h.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-Cjas7UNe.js → product-preview-content-D6NwUm3A.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-modal-CPWRvBI9.js → product-preview-modal-BfNcGgXA.js} +2 -2
- package/dist/gateway/static/root/assets/{project-detail-page-B_HlZux_.js → project-detail-page-Ch-ZMyTu.js} +1 -1
- package/dist/gateway/static/root/assets/{project-understanding-Ba02SFzB.js → project-understanding-B1BK7Ixi.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-CdfKjp95.js → projects-page-B7cetxao.js} +1 -1
- package/dist/gateway/static/root/assets/{providers-api-rwQ4LWzr.js → providers-api-DOnNfkwQ.js} +1 -1
- package/dist/gateway/static/root/assets/{recording-upload-BSmvRrZQ.js → recording-upload-RAhaLUcQ.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-Vy7LfH6E.js → registry-api-DFDvOTg4.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-UXrnpGev.js → remote-access-hub-DWsOWetc.js} +1 -1
- package/dist/gateway/static/root/assets/{resource-unavailable-f9OzSi4W.js → resource-unavailable-TQcRCpAg.js} +1 -1
- package/dist/gateway/static/root/assets/{route-preload-BtObM-co.js → route-preload-Zc5Z3fNv.js} +2 -2
- package/dist/gateway/static/root/assets/{runtime-tools-api-Bt8t37z5.js → runtime-tools-api-9o3Wfji1.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-DU4UXnBm.js → runtime-tools-settings-panel-BGiXeHF5.js} +1 -1
- package/dist/gateway/static/root/assets/{service-recommendation-list-CuYsRcBB.js → service-recommendation-list-BEnNx0u7.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-DJI9eSgw.js → session-api-Bs3r_d2_.js} +1 -1
- package/dist/gateway/static/root/assets/{session-manager-CtKgACGl.js → session-manager-ChUtTAoG.js} +1 -1
- package/dist/gateway/static/root/assets/{sessions-page-BAsKzRHt.js → sessions-page-Bt52kBvJ.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BI4DMz4_.js +1 -0
- package/dist/gateway/static/root/assets/{settings-advanced-section-BxUuF_yi.js → settings-advanced-section-CURRjsLK.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-mode-store-CaoRh2gt.js → settings-mode-store-CiRpsdTJ.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-qQ8-6dJ_.js → settings-page-GtsbT6as.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-header-CyUHrn7c.js → settings-page-header-DBL0_u0Z.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-DGVqXrlp.js → settings-page-layout-IAvpbz4A.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-BpaPb625.js → setup-status-panel-A6uMpGRy.js} +1 -1
- package/dist/gateway/static/root/assets/{share-link-dialog-CQJ6Ykm2.js → share-link-dialog-D1otGSXD.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-Cem96FbB.js → share-preview-page-L9KYu8M7.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-api-Dowes16l.js → shares-api-D8Q-m46d.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-DZEkZDR0.js → shares-settings-Bmfadz8A.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-api-D8ZwFEVe.js → skill-api-uKU4sRiv.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-list-api-B4gp00-f.js → skill-list-api-BzKzG-xG.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-ClmaaDXo.js → skill-reload-api-DkUXekcd.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-CV0X9rvG.js → skills-page-BZklXTX9.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-D095uacX.js → system-settings-panel-CsvcFoaJ.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-SjZGW1Dx.js +2 -0
- package/dist/gateway/static/root/assets/{task-result-evidence-LUrJlUhb.js → task-result-evidence-B8xUiwW3.js} +1 -1
- package/dist/gateway/static/root/assets/{terminal-panel-store-BqEDB1Vl.js → terminal-panel-store-DJVC7HqA.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-gAcojLgP.js → theme-store-Dlnmgryi.js} +1 -1
- package/dist/gateway/static/root/assets/tool-friendly-title-DcCc6g7o.js +1 -0
- package/dist/gateway/static/root/assets/{tracing-settings-page-B1ZRh-Is.js → tracing-settings-page-MvG4SH64.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-C9u9E3UQ.js → tunnel-api-BB7u79ID.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-activity-store-BTrzsR6_.js → understanding-activity-store-C4bblRnQ.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-refresh-store-5Qava3jh.js → understanding-refresh-store-BvCj9-Ue.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-DFMLYKAc.js → usage-page-Cv4Je5XJ.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-3O-X7x15.js → use-autosave-YHxQ-UZg.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-BLc4dBfe.js → use-composer-attachments-vDdxHtUb.js} +1 -1
- package/dist/gateway/static/root/assets/{use-file-preview-expanded-BaOmTXsT.js → use-file-preview-expanded-Ce2mgYme.js} +2 -2
- package/dist/gateway/static/root/assets/{use-personal-profile-MusPgljM.js → use-personal-profile-D2Un8G1L.js} +1 -1
- package/dist/gateway/static/root/assets/{use-workspace-tree-Ck_U2yTw.js → use-workspace-tree-BQEiJzK7.js} +1 -1
- package/dist/gateway/static/root/assets/{user-model-page-Den5Lg-k.js → user-model-page-DRSsn4EV.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-C5zJApoa.js → voice-api-key-field-DCM69u8Y.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-DC1bYDt1.js → voice-config-api-CrULrSKC.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-input-shortcut-events-0SZjJdVV.js → voice-input-shortcut-events-DFMNIyy4.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-transcribe-api-CxVeANPX.js → voice-transcribe-api-Bbyj0yGR.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-DAQ8McVe.js → work-discovery-overlay-CVe9UmFl.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-page-DUQysEyb.js → work-discovery-page-CtqkRMN5.js} +1 -1
- package/dist/gateway/static/root/assets/{working-directory-picker-modal-BO9qdJyZ.js → working-directory-picker-modal-CDZ1xh3o.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-api-ZrN6yUER.js → workspace-api-tbifz2zY.js} +2 -2
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-4cZ26iaD.js +1 -0
- package/dist/gateway/static/root/assets/{workspace-file-preview-dialog-Yj_kBWSb.js → workspace-file-preview-dialog-BubQwQwU.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-open-location-menu-yxT7wajO.js → workspace-open-location-menu-DZk3MBSa.js} +1 -1
- package/dist/gateway/static/root/assets/{xopc-cloud-account-card-IcH9KDzx.js → xopc-cloud-account-card-CIavPUr3.js} +1 -1
- package/dist/gateway/static/root/index.html +81 -81
- package/dist/package.js +1 -1
- package/dist/src/cli/commands/backup.js +1 -1
- package/dist/src/config/models-json.d.ts +12 -0
- package/dist/src/gateway/global-defaults-admin.js +1 -1
- package/dist/src/gateway/hono/routes/phone-setup.js +12 -7
- package/dist/src/gateway/hono/routes/phone.js +2 -4
- package/dist/src/gateway/service.js +4 -4
- package/dist/src/gateway/xopc-cloud-capability-setup.js +9 -1
- package/dist/src/home-intelligence/host.js +2 -2
- package/dist/src/phone/cloud-adb-connection.js +8 -5
- package/dist/src/phone/contracts.d.ts +4 -0
- package/dist/src/phone/contracts.js +6 -1
- package/dist/src/phone/gui-protocol.d.ts +7 -0
- package/dist/src/phone/gui-protocol.js +302 -0
- package/dist/src/phone/model-adapter.d.ts +1 -1
- package/dist/src/phone/model-adapter.js +7 -4
- package/dist/src/phone/runtime.js +8 -2
- package/dist/src/phone/ui-dump-binary.d.ts +1 -1
- package/dist/src/phone/ui-dump-binary.js +1 -1
- package/dist/src/phone/ui-session.d.ts +2 -0
- package/dist/src/phone/ui-session.js +23 -4
- package/dist/src/providers/env-keys.js +2 -0
- package/dist/src/providers/index.js +11 -0
- package/dist/src/providers/model-catalog-types.d.ts +1 -1
- package/dist/src/providers/model-supplements.d.ts +1 -1
- package/dist/src/providers/model-supplements.js +6 -3
- package/dist/src/providers/phone-models.d.ts +3 -0
- package/dist/src/providers/phone-models.js +33 -0
- package/dist/src/providers/presentation.js +0 -1
- package/dist/src/tui/tui.js +1 -1
- package/dist/src/voice/platform-catalog.d.ts +1 -1
- package/package.json +1 -1
- package/dist/gateway/static/root/assets/chat-page-BP0huA-W.js +0 -72
- package/dist/gateway/static/root/assets/connected-providers-grid-CKZfhHSD.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-Bkt1z-xo.js +0 -1
- package/dist/gateway/static/root/assets/index-CpwPxKQ8.css +0 -1
- package/dist/gateway/static/root/assets/messages-DG4HLOER.js +0 -3
- package/dist/gateway/static/root/assets/note-image-lightbox-B-bEtjhj.js +0 -1
- package/dist/gateway/static/root/assets/page-header-store-BdZnUh-D.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-CjAFqg2U.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-CY2C4AM2.js +0 -2
- package/dist/gateway/static/root/assets/tool-friendly-title-o6sxGVUu.js +0 -1
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-Bo5dwoWP.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,o as t}from"./locale-store-
|
|
1
|
+
import{i as e,o as t}from"./locale-store-Br7IfbXK.js";async function n(){return(await t(e(`/api/local-apps`))).apps}async function r(n){return(await t(e(`/api/local-apps/${encodeURIComponent(n)}`))).app}async function i(n){return(await t(e(`/api/local-apps/${encodeURIComponent(n)}/validate`),{method:`POST`})).validation}async function a(n,r){return(await t(e(`/api/local-apps/${encodeURIComponent(n)}/snapshots/${encodeURIComponent(r)}`))).snapshot}async function o(n,r){return(await t(e(`/api/local-apps/${encodeURIComponent(n)}/fix-guidance`),{method:`POST`,body:JSON.stringify(r)})).guidance}async function s(n,r,i){return(await t(e(`/api/local-apps/${encodeURIComponent(n)}/acceptance-runs`),{method:`POST`,body:JSON.stringify({sourceHash:r,...i})})).acceptance}async function c(n){return(await t(e(`/api/local-apps`),{method:`POST`,body:JSON.stringify(n)})).app}async function l(n){return(await t(e(`/api/local-apps/${encodeURIComponent(n)}/install`),{method:`POST`})).app}async function u(n,r){return(await t(e(`/api/local-apps/${encodeURIComponent(n)}/releases/${encodeURIComponent(r)}/rollback`),{method:`POST`})).app}async function d(n,r){return(await t(e(`/api/local-apps/${encodeURIComponent(n)}/${r?`enable`:`disable`}`),{method:`POST`})).app}async function f(n){return(await t(e(`/api/local-apps/${encodeURIComponent(n)}/install`),{method:`DELETE`})).app}export{l as a,u as c,i as d,a as i,d as l,r as n,n as o,o as r,s,c as t,f as u};
|
|
@@ -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{i,n as a,o}from"./locale-store-Bg_XR36n.js";import{t as s}from"./messages-DG4HLOER.js";import{t as c}from"./copy-Dv6d4Dvw.js";import{t as l}from"./loader-circle-CifKLtgG.js";import{t as u}from"./package-wATCyihJ.js";import{t as d}from"./cn-0WouolD0.js";import{t as f}from"./button-CnRSIP6m.js";import{t as p}from"./skeleton-BI5TyibZ.js";import{a as m,i as h,o as g,r as _,s as v,t as y}from"./dist-DfWfZ9iu.js";import{i as b,o as x}from"./settings-shell-dialog-layer-BU3UuiJr.js";import{i as S}from"./vendor-swr-CdRzEUwF.js";import{t as C}from"./copy-to-clipboard-HOJ79TWv.js";import{n as w}from"./interaction-BdhHBbYa.js";import{n as T}from"./electron-env-DHOGevH3.js";import{r as E}from"./settings-form-draft-Dy10ldo8.js";import{t as D}from"./settings-loading-skeleton-BTqvr_Fw.js";import{n as O,t as k}from"./settings-page-header-CyUHrn7c.js";import"./settings-page-layout-DGVqXrlp.js";import{r as A,t as j}from"./settings-form-section-num14vSv.js";var M=n(),N=e(t(),1),P=r();function F(e,t){return e==null?t:e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function I(e,t){return e===`PENDING_UPDATE`?t.pendingUpdate??t.generic:e===`UNINSTALLER_NOT_FOUND`?t.uninstallerNotFound??t.generic:e===`NOT_PACKAGED`?t.notPackaged??t.generic:t.generic}function L(e,t){if(e.platform===`darwin`)return t.uninstallDescDarwin;if(e.platform===`win32`)return t.uninstallDescWin;if(e.platform===`linux`){if(e.linuxPackageKind===`appimage`)return t.uninstallDescLinuxAppImage;if(e.linuxPackageKind===`deb`){let n=e.linuxDebPackageName??`xopc`;return t.uninstallDescLinuxDeb.replace(/\{\{package\}\}/g,n)}return t.uninstallDescLinuxUnknown}return t.uninstallDescLinuxUnknown}var R={info:null,loadError:null,actionError:null,copiedField:null,clearDialogOpen:!1,clearConfirmChecked:!1,clearConfirmText:``,uninstallDialogOpen:!1,removeUserDataOnUninstall:!1,busy:!1};function z({api:e,messages:t,embedded:n=!0}){let[r,i]=(0,N.useReducer)(E,R),{info:a,loadError:o,actionError:s,copiedField:p,clearDialogOpen:S,clearConfirmChecked:T,clearConfirmText:O,uninstallDialogOpen:k,removeUserDataOnUninstall:A,busy:M}=r,z=(0,N.useCallback)(async()=>{if(e?.getUninstallInfo){i({type:`patch`,patch:{loadError:null}});try{let t=await e.getUninstallInfo();i({type:`patch`,patch:{info:t}})}catch(e){i({type:`patch`,patch:{loadError:e instanceof Error?e.message:String(e)}})}}},[e]);(0,N.useEffect)(()=>{z()},[z]);let B=async(e,n)=>{if(await C(e)){i({type:`patch`,patch:{actionError:null,copiedField:n}}),window.setTimeout(()=>i({type:`patch`,patch:{copiedField:null}}),2e3);return}i({type:`patch`,patch:{actionError:t.copyFailed}})},V=async()=>{if(!(!e?.clearUserData||M)){i({type:`patch`,patch:{busy:!0,actionError:null}});try{let n=await e.clearUserData();n.ok||i({type:`patch`,patch:{actionError:I(n.error,t.errors)}})}catch(e){i({type:`patch`,patch:{actionError:e instanceof Error?e.message:t.errors.generic}})}finally{i({type:`patch`,patch:{busy:!1,clearDialogOpen:!1,clearConfirmChecked:!1,clearConfirmText:``}})}}},H=async()=>{if(e?.uninstallApp){i({type:`patch`,patch:{busy:!0,actionError:null}});try{let n=await e.uninstallApp({removeUserData:A});n.ok||i({type:`patch`,patch:{actionError:I(n.error,t.errors)}})}catch(e){i({type:`patch`,patch:{actionError:e instanceof Error?e.message:t.errors.generic}})}finally{i({type:`patch`,patch:{busy:!1,uninstallDialogOpen:!1}})}}};if(o)return(0,P.jsx)(`p`,{className:`text-sm text-amber-600 dark:text-amber-400`,role:`alert`,children:o});if(!a)return(0,P.jsx)(D,{rows:2});let U=!a.packaged,W=M||a.pendingUpdate||U,G=!U&&a.uninstallMode!==`unsupported`,K=L(a,t),q=T&&O.trim()===t.clearDataConfirmPhrase;return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(j,{children:[n?(0,P.jsxs)(`div`,{className:`mb-4 flex items-center gap-2 text-sm font-semibold text-fg`,children:[(0,P.jsx)(u,{className:`size-4 text-accent`,strokeWidth:1.75}),t.title]}):null,s?(0,P.jsx)(`p`,{className:`mb-3 text-sm text-amber-600 dark:text-amber-400`,role:`alert`,children:s}):null,U?(0,P.jsxs)(`div`,{className:`mb-4 rounded-xl bg-surface-panel/70 px-3 py-2.5 shadow-surface`,children:[(0,P.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:t.devOnlyTitle}),(0,P.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:t.devOnlyBody})]}):null,a.pendingUpdate?(0,P.jsx)(`p`,{className:`mb-3 rounded-xl bg-amber-500/10 px-3 py-2 text-xs text-amber-800 dark:text-amber-200`,children:t.pendingUpdateBlocked}):null,(0,P.jsxs)(`dl`,{className:`space-y-3 text-sm`,children:[(0,P.jsxs)(`div`,{className:`rounded-xl bg-surface-panel/70 p-3 shadow-surface`,children:[(0,P.jsx)(`dt`,{className:`text-xs font-medium text-fg-muted`,children:t.appPath}),(0,P.jsxs)(`dd`,{className:`mt-1 flex items-start justify-between gap-2`,children:[(0,P.jsx)(`code`,{className:`break-all text-xs text-fg`,children:a.appPath}),(0,P.jsxs)(`button`,{type:`button`,className:d(`inline-flex shrink-0 items-center gap-1 rounded-lg border border-edge px-2 py-1 text-xs text-fg hover:bg-surface-hover`,w.press),onClick:()=>void B(a.appPath,`app`),children:[(0,P.jsx)(c,{className:`size-3`,"aria-hidden":!0}),p===`app`?t.copied:t.copyPath]})]})]}),(0,P.jsxs)(`div`,{className:`rounded-xl bg-surface-panel/70 p-3 shadow-surface`,children:[(0,P.jsx)(`dt`,{className:`text-xs font-medium text-fg-muted`,children:t.dataPath}),(0,P.jsxs)(`dd`,{className:`mt-1 flex items-start justify-between gap-2`,children:[(0,P.jsx)(`code`,{className:`break-all text-xs text-fg`,children:a.dataPath}),(0,P.jsxs)(`button`,{type:`button`,className:d(`inline-flex shrink-0 items-center gap-1 rounded-lg border border-edge px-2 py-1 text-xs text-fg hover:bg-surface-hover`,w.press),onClick:()=>void B(a.dataPath,`data`),children:[(0,P.jsx)(c,{className:`size-3`,"aria-hidden":!0}),p===`data`?t.copied:t.copyPath]})]}),(0,P.jsxs)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:[t.dataSize,`: `,F(a.dataSizeBytes,t.dataSizeUnknown)]}),(0,P.jsx)(`p`,{className:`mt-2 text-xs leading-relaxed text-amber-800 dark:text-amber-200`,children:t.sharedDataWarning})]})]}),(0,P.jsxs)(`div`,{className:`mt-4 space-y-3`,children:[(0,P.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-xl bg-surface-panel/70 p-3 shadow-surface sm:flex-row sm:items-center sm:justify-between`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:t.clearData}),(0,P.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:t.clearDataDesc})]}),(0,P.jsx)(`button`,{type:`button`,disabled:W,className:d(`inline-flex shrink-0 items-center justify-center rounded-lg border border-danger/40 bg-danger px-3 py-1.5 text-sm font-medium text-white hover:bg-danger/90 disabled:opacity-50`,w.press),onClick:()=>{i({type:`patch`,patch:{clearConfirmChecked:!1,clearConfirmText:``,clearDialogOpen:!0}})},children:t.clearData})]}),G?(0,P.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-xl bg-surface-panel/70 p-3 shadow-surface sm:flex-row sm:items-center sm:justify-between`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:t.uninstall}),(0,P.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:K})]}),(0,P.jsx)(`button`,{type:`button`,disabled:W,className:d(`inline-flex shrink-0 items-center justify-center rounded-lg border border-edge bg-surface-base px-3 py-1.5 text-sm font-medium text-fg hover:bg-surface-hover disabled:opacity-50`,w.press),onClick:()=>{i({type:`patch`,patch:{removeUserDataOnUninstall:!1,uninstallDialogOpen:!0}})},children:t.uninstall})]}):null]})]}),(0,P.jsx)(y,{open:S,onOpenChange:e=>{!e&&!M&&i({type:`patch`,patch:{clearDialogOpen:!1,clearConfirmChecked:!1,clearConfirmText:``}})},children:(0,P.jsxs)(g,{children:[(0,P.jsx)(m,{className:d(`xopc-dialog-overlay fixed inset-0 bg-scrim backdrop-blur-[1px]`,x)}),(0,P.jsxs)(_,{className:d(`xopc-dialog-content fixed left-1/2 top-1/2 flex h-[min(30rem,calc(100dvh-2rem))] w-[min(100%-2rem,28rem)] flex-col overflow-hidden -translate-x-1/2 -translate-y-1/2`,b,`rounded-2xl border border-edge bg-surface-overlay p-6 shadow-popover outline-none dark:border-edge`),onOpenAutoFocus:e=>e.preventDefault(),onEscapeKeyDown:e=>{M&&e.preventDefault()},onInteractOutside:e=>{M&&e.preventDefault()},"aria-busy":M,children:[(0,P.jsx)(v,{className:`text-base font-semibold text-fg`,children:t.clearDataConfirmTitle}),(0,P.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain`,children:[(0,P.jsx)(h,{className:`mt-2 text-sm text-fg-muted`,children:t.clearDataConfirmDesc}),(0,P.jsxs)(`label`,{className:`mt-4 flex cursor-pointer items-start gap-2 text-sm text-fg`,children:[(0,P.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox mt-0.5`,disabled:M,checked:T,onChange:e=>i({type:`patch`,patch:{clearConfirmChecked:e.target.checked}})}),(0,P.jsx)(`span`,{children:t.clearDataConfirmCheckbox})]}),(0,P.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,P.jsx)(`label`,{className:`block text-sm font-medium text-fg`,htmlFor:`clear-data-confirm`,children:t.clearDataConfirmLabel}),(0,P.jsx)(`input`,{id:`clear-data-confirm`,disabled:M,type:`text`,autoComplete:`off`,spellCheck:!1,className:d(`w-full rounded-md border border-edge bg-surface-panel px-3 py-1.5 font-mono text-xs text-fg`,`placeholder:text-fg-subtle`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`,`dark:border-edge`),placeholder:t.clearDataConfirmPhrase,value:O,onChange:e=>i({type:`patch`,patch:{clearConfirmText:e.target.value}})}),M?(0,P.jsxs)(`div`,{className:`space-y-2`,role:`status`,"aria-live":`polite`,children:[(0,P.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:t.clearDataProgress}),(0,P.jsx)(`div`,{role:`progressbar`,"aria-label":t.clearDataProgress,className:`h-1.5 overflow-hidden rounded-full bg-surface-active`,children:(0,P.jsx)(`div`,{className:`xopc-clear-data-progress h-full w-1/3 rounded-full bg-accent`})}),(0,P.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.clearDataProgressHint})]}):(0,P.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.clearDataConfirmHint})]})]}),(0,P.jsxs)(`div`,{className:`mt-6 flex shrink-0 justify-end gap-2`,children:[(0,P.jsx)(f,{type:`button`,variant:`secondary`,disabled:M,onClick:()=>{i({type:`patch`,patch:{clearDialogOpen:!1,clearConfirmChecked:!1,clearConfirmText:``}})},children:t.cancel}),(0,P.jsxs)(f,{type:`button`,variant:`secondary`,className:`border-danger/40 bg-danger text-white hover:bg-danger/90 dark:border-danger/40`,disabled:M||!q,onClick:()=>void V(),children:[M?(0,P.jsx)(l,{className:`size-4 animate-spin motion-reduce:animate-none`,"aria-hidden":!0}):null,M?t.clearDataProgress:t.confirmClear]})]})]})]})}),G?(0,P.jsx)(y,{open:k,onOpenChange:e=>{e||i({type:`patch`,patch:{uninstallDialogOpen:!1}})},children:(0,P.jsxs)(g,{children:[(0,P.jsx)(m,{className:d(`xopc-dialog-overlay fixed inset-0 bg-scrim backdrop-blur-[1px]`,x)}),(0,P.jsxs)(_,{className:d(`xopc-dialog-content fixed left-1/2 top-1/2 w-[min(100%-2rem,28rem)] -translate-x-1/2 -translate-y-1/2`,b,`rounded-2xl border border-edge bg-surface-overlay p-6 shadow-popover outline-none dark:border-edge`),onOpenAutoFocus:e=>e.preventDefault(),children:[(0,P.jsx)(v,{className:`text-base font-semibold text-fg`,children:t.uninstallConfirmTitle}),(0,P.jsx)(h,{className:`mt-2 text-sm text-fg-muted`,children:K}),(0,P.jsxs)(`label`,{className:`mt-4 flex cursor-pointer items-start gap-2 text-sm text-fg`,children:[(0,P.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox mt-0.5`,checked:A,onChange:e=>i({type:`patch`,patch:{removeUserDataOnUninstall:e.target.checked}})}),(0,P.jsx)(`span`,{children:t.removeUserDataCheckbox})]}),A?(0,P.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:t.clearDataConfirmDesc}):null,(0,P.jsxs)(`div`,{className:`mt-6 flex justify-end gap-2`,children:[(0,P.jsx)(f,{type:`button`,variant:`secondary`,disabled:M,onClick:()=>i({type:`patch`,patch:{uninstallDialogOpen:!1}}),children:t.cancel}),(0,P.jsx)(f,{type:`button`,variant:`secondary`,className:`border-danger/40 bg-danger text-white hover:bg-danger/90 dark:border-danger/40`,disabled:M,onClick:()=>void H(),children:t.confirmUninstall})]})]})]})}):null]})}async function B(){return(await o(i(`/api/migrations/status`))).payload}async function V(){await o(i(`/api/migrations/apply`),{method:`POST`,body:`{}`})}function H({messages:e}){let{data:t,error:n,isLoading:r,mutate:i}=S(`settings-migration-status`,B,{refreshInterval:0,revalidateOnFocus:!1}),[a,o]=(0,N.useState)(!1),[s,c]=(0,N.useState)(null);async function l(){o(!0),c(null);try{await V(),await i(),window.dispatchEvent(new CustomEvent(`config-reload`))}catch(e){c(e instanceof Error?e.message:String(e))}finally{o(!1)}}if(r)return(0,P.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-4`,"aria-busy":`true`,children:[(0,P.jsx)(p,{className:`h-5 w-40 max-w-full`}),(0,P.jsx)(p,{className:`mt-2 h-4 w-64 max-w-full`})]});if(n)return(0,P.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-4`,children:[(0,P.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:e.title}),(0,P.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:e.checkFailed})]});let u=t?.items??[],d=u.filter(e=>e.status===`conflict`||e.status===`error`),m=u.filter(e=>e.safety===`auto`&&e.status===`planned`),h=d.length>0||u.some(e=>e.safety!==`auto`);return(0,P.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-4`,children:[(0,P.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:e.title}),(0,P.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:u.length===0?e.upToDate:h?e.manualAttention:e.safeRepairs.replace(`{{count}}`,String(m.length))})]}),m.length>0&&!h?(0,P.jsx)(f,{type:`button`,variant:`primary`,className:`px-3 py-1.5 text-xs`,onClick:()=>void l(),disabled:a,children:a?e.applying:e.apply}):null]}),u.length>0?(0,P.jsx)(`div`,{className:`mt-3 space-y-2`,children:u.map(e=>(0,P.jsxs)(`div`,{className:`rounded-xl bg-surface-base/55 px-3 py-2`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,P.jsx)(`div`,{className:`truncate text-sm font-medium text-fg`,children:e.title}),(0,P.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2 py-0.5 text-[11px] uppercase tracking-wide text-fg-muted`,children:e.status})]}),(0,P.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:e.message})]},e.id))}):null,s?(0,P.jsx)(`p`,{className:`mt-3 text-sm text-red-500`,children:s}):null]})}function U(){let e=(0,M.c)(28),t=a(W),n;e[0]===t?n=e[1]:(n=s(t),e[0]=t,e[1]=n);let r=n.systemSettings,i=r.desktopApp,o=typeof window<`u`?window.electronAPI?.system:void 0;if(!T()||!o){let t;e[2]===i.title?t=e[3]:(t=(0,P.jsx)(k,{title:i.title}),e[2]=i.title,e[3]=t);let n;e[4]===i.migrations?n=e[5]:(n=(0,P.jsx)(H,{messages:i.migrations}),e[4]=i.migrations,e[5]=n);let a;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(a=A(),e[6]=a):a=e[6];let o;e[7]===r.desktopOnlyTitle?o=e[8]:(o=(0,P.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:r.desktopOnlyTitle}),e[7]=r.desktopOnlyTitle,e[8]=o);let s;e[9]===r.desktopOnlyBody?s=e[10]:(s=(0,P.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:r.desktopOnlyBody}),e[9]=r.desktopOnlyBody,e[10]=s);let c;e[11]!==o||e[12]!==s?(c=(0,P.jsxs)(`div`,{className:a,children:[o,s]}),e[11]=o,e[12]=s,e[13]=c):c=e[13];let l;return e[14]!==t||e[15]!==n||e[16]!==c?(l=(0,P.jsxs)(O,{gap:`gap-3`,children:[t,n,c]}),e[14]=t,e[15]=n,e[16]=c,e[17]=l):l=e[17],l}let c;e[18]===i.title?c=e[19]:(c=(0,P.jsx)(k,{title:i.title}),e[18]=i.title,e[19]=c);let l;e[20]===i.migrations?l=e[21]:(l=(0,P.jsx)(H,{messages:i.migrations}),e[20]=i.migrations,e[21]=l);let u;e[22]===i?u=e[23]:(u=(0,P.jsx)(z,{api:o,messages:i,embedded:!1}),e[22]=i,e[23]=u);let d;return e[24]!==c||e[25]!==l||e[26]!==u?(d=(0,P.jsxs)(O,{gap:`gap-6`,children:[c,l,u]}),e[24]=c,e[25]=l,e[26]=u,e[27]=d):d=e[27],d}function W(e){return e.language}export{U as AppManagementSettingsPanel};
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{i,n as a,o}from"./locale-store-Br7IfbXK.js";import{t as s}from"./messages-ByFlEbsu.js";import{t as c}from"./copy-Dv6d4Dvw.js";import{t as l}from"./loader-circle-CifKLtgG.js";import{t as u}from"./package-wATCyihJ.js";import{t as d}from"./cn-0WouolD0.js";import{t as f}from"./button-CnRSIP6m.js";import{t as p}from"./skeleton-BI5TyibZ.js";import{a as m,i as h,o as g,r as _,s as v,t as y}from"./dist-DfWfZ9iu.js";import{i as b,o as x}from"./settings-shell-dialog-layer-BU3UuiJr.js";import{i as S}from"./vendor-swr-CdRzEUwF.js";import{t as C}from"./copy-to-clipboard-HOJ79TWv.js";import{n as w}from"./interaction-BdhHBbYa.js";import{n as T}from"./electron-env-DHOGevH3.js";import{r as E}from"./settings-form-draft-Dy10ldo8.js";import{t as D}from"./settings-loading-skeleton-BTqvr_Fw.js";import{n as O,t as k}from"./settings-page-header-DBL0_u0Z.js";import"./settings-page-layout-IAvpbz4A.js";import{r as A,t as j}from"./settings-form-section-num14vSv.js";var M=n(),N=e(t(),1),P=r();function F(e,t){return e==null?t:e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function I(e,t){return e===`PENDING_UPDATE`?t.pendingUpdate??t.generic:e===`UNINSTALLER_NOT_FOUND`?t.uninstallerNotFound??t.generic:e===`NOT_PACKAGED`?t.notPackaged??t.generic:t.generic}function L(e,t){if(e.platform===`darwin`)return t.uninstallDescDarwin;if(e.platform===`win32`)return t.uninstallDescWin;if(e.platform===`linux`){if(e.linuxPackageKind===`appimage`)return t.uninstallDescLinuxAppImage;if(e.linuxPackageKind===`deb`){let n=e.linuxDebPackageName??`xopc`;return t.uninstallDescLinuxDeb.replace(/\{\{package\}\}/g,n)}return t.uninstallDescLinuxUnknown}return t.uninstallDescLinuxUnknown}var R={info:null,loadError:null,actionError:null,copiedField:null,clearDialogOpen:!1,clearConfirmChecked:!1,clearConfirmText:``,uninstallDialogOpen:!1,removeUserDataOnUninstall:!1,busy:!1};function z({api:e,messages:t,embedded:n=!0}){let[r,i]=(0,N.useReducer)(E,R),{info:a,loadError:o,actionError:s,copiedField:p,clearDialogOpen:S,clearConfirmChecked:T,clearConfirmText:O,uninstallDialogOpen:k,removeUserDataOnUninstall:A,busy:M}=r,z=(0,N.useCallback)(async()=>{if(e?.getUninstallInfo){i({type:`patch`,patch:{loadError:null}});try{let t=await e.getUninstallInfo();i({type:`patch`,patch:{info:t}})}catch(e){i({type:`patch`,patch:{loadError:e instanceof Error?e.message:String(e)}})}}},[e]);(0,N.useEffect)(()=>{z()},[z]);let B=async(e,n)=>{if(await C(e)){i({type:`patch`,patch:{actionError:null,copiedField:n}}),window.setTimeout(()=>i({type:`patch`,patch:{copiedField:null}}),2e3);return}i({type:`patch`,patch:{actionError:t.copyFailed}})},V=async()=>{if(!(!e?.clearUserData||M)){i({type:`patch`,patch:{busy:!0,actionError:null}});try{let n=await e.clearUserData();n.ok||i({type:`patch`,patch:{actionError:I(n.error,t.errors)}})}catch(e){i({type:`patch`,patch:{actionError:e instanceof Error?e.message:t.errors.generic}})}finally{i({type:`patch`,patch:{busy:!1,clearDialogOpen:!1,clearConfirmChecked:!1,clearConfirmText:``}})}}},H=async()=>{if(e?.uninstallApp){i({type:`patch`,patch:{busy:!0,actionError:null}});try{let n=await e.uninstallApp({removeUserData:A});n.ok||i({type:`patch`,patch:{actionError:I(n.error,t.errors)}})}catch(e){i({type:`patch`,patch:{actionError:e instanceof Error?e.message:t.errors.generic}})}finally{i({type:`patch`,patch:{busy:!1,uninstallDialogOpen:!1}})}}};if(o)return(0,P.jsx)(`p`,{className:`text-sm text-amber-600 dark:text-amber-400`,role:`alert`,children:o});if(!a)return(0,P.jsx)(D,{rows:2});let U=!a.packaged,W=M||a.pendingUpdate||U,G=!U&&a.uninstallMode!==`unsupported`,K=L(a,t),q=T&&O.trim()===t.clearDataConfirmPhrase;return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(j,{children:[n?(0,P.jsxs)(`div`,{className:`mb-4 flex items-center gap-2 text-sm font-semibold text-fg`,children:[(0,P.jsx)(u,{className:`size-4 text-accent`,strokeWidth:1.75}),t.title]}):null,s?(0,P.jsx)(`p`,{className:`mb-3 text-sm text-amber-600 dark:text-amber-400`,role:`alert`,children:s}):null,U?(0,P.jsxs)(`div`,{className:`mb-4 rounded-xl bg-surface-panel/70 px-3 py-2.5 shadow-surface`,children:[(0,P.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:t.devOnlyTitle}),(0,P.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:t.devOnlyBody})]}):null,a.pendingUpdate?(0,P.jsx)(`p`,{className:`mb-3 rounded-xl bg-amber-500/10 px-3 py-2 text-xs text-amber-800 dark:text-amber-200`,children:t.pendingUpdateBlocked}):null,(0,P.jsxs)(`dl`,{className:`space-y-3 text-sm`,children:[(0,P.jsxs)(`div`,{className:`rounded-xl bg-surface-panel/70 p-3 shadow-surface`,children:[(0,P.jsx)(`dt`,{className:`text-xs font-medium text-fg-muted`,children:t.appPath}),(0,P.jsxs)(`dd`,{className:`mt-1 flex items-start justify-between gap-2`,children:[(0,P.jsx)(`code`,{className:`break-all text-xs text-fg`,children:a.appPath}),(0,P.jsxs)(`button`,{type:`button`,className:d(`inline-flex shrink-0 items-center gap-1 rounded-lg border border-edge px-2 py-1 text-xs text-fg hover:bg-surface-hover`,w.press),onClick:()=>void B(a.appPath,`app`),children:[(0,P.jsx)(c,{className:`size-3`,"aria-hidden":!0}),p===`app`?t.copied:t.copyPath]})]})]}),(0,P.jsxs)(`div`,{className:`rounded-xl bg-surface-panel/70 p-3 shadow-surface`,children:[(0,P.jsx)(`dt`,{className:`text-xs font-medium text-fg-muted`,children:t.dataPath}),(0,P.jsxs)(`dd`,{className:`mt-1 flex items-start justify-between gap-2`,children:[(0,P.jsx)(`code`,{className:`break-all text-xs text-fg`,children:a.dataPath}),(0,P.jsxs)(`button`,{type:`button`,className:d(`inline-flex shrink-0 items-center gap-1 rounded-lg border border-edge px-2 py-1 text-xs text-fg hover:bg-surface-hover`,w.press),onClick:()=>void B(a.dataPath,`data`),children:[(0,P.jsx)(c,{className:`size-3`,"aria-hidden":!0}),p===`data`?t.copied:t.copyPath]})]}),(0,P.jsxs)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:[t.dataSize,`: `,F(a.dataSizeBytes,t.dataSizeUnknown)]}),(0,P.jsx)(`p`,{className:`mt-2 text-xs leading-relaxed text-amber-800 dark:text-amber-200`,children:t.sharedDataWarning})]})]}),(0,P.jsxs)(`div`,{className:`mt-4 space-y-3`,children:[(0,P.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-xl bg-surface-panel/70 p-3 shadow-surface sm:flex-row sm:items-center sm:justify-between`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:t.clearData}),(0,P.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:t.clearDataDesc})]}),(0,P.jsx)(`button`,{type:`button`,disabled:W,className:d(`inline-flex shrink-0 items-center justify-center rounded-lg border border-danger/40 bg-danger px-3 py-1.5 text-sm font-medium text-white hover:bg-danger/90 disabled:opacity-50`,w.press),onClick:()=>{i({type:`patch`,patch:{clearConfirmChecked:!1,clearConfirmText:``,clearDialogOpen:!0}})},children:t.clearData})]}),G?(0,P.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-xl bg-surface-panel/70 p-3 shadow-surface sm:flex-row sm:items-center sm:justify-between`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:t.uninstall}),(0,P.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:K})]}),(0,P.jsx)(`button`,{type:`button`,disabled:W,className:d(`inline-flex shrink-0 items-center justify-center rounded-lg border border-edge bg-surface-base px-3 py-1.5 text-sm font-medium text-fg hover:bg-surface-hover disabled:opacity-50`,w.press),onClick:()=>{i({type:`patch`,patch:{removeUserDataOnUninstall:!1,uninstallDialogOpen:!0}})},children:t.uninstall})]}):null]})]}),(0,P.jsx)(y,{open:S,onOpenChange:e=>{!e&&!M&&i({type:`patch`,patch:{clearDialogOpen:!1,clearConfirmChecked:!1,clearConfirmText:``}})},children:(0,P.jsxs)(g,{children:[(0,P.jsx)(m,{className:d(`xopc-dialog-overlay fixed inset-0 bg-scrim backdrop-blur-[1px]`,x)}),(0,P.jsxs)(_,{className:d(`xopc-dialog-content fixed left-1/2 top-1/2 flex h-[min(30rem,calc(100dvh-2rem))] w-[min(100%-2rem,28rem)] flex-col overflow-hidden -translate-x-1/2 -translate-y-1/2`,b,`rounded-2xl border border-edge bg-surface-overlay p-6 shadow-popover outline-none dark:border-edge`),onOpenAutoFocus:e=>e.preventDefault(),onEscapeKeyDown:e=>{M&&e.preventDefault()},onInteractOutside:e=>{M&&e.preventDefault()},"aria-busy":M,children:[(0,P.jsx)(v,{className:`text-base font-semibold text-fg`,children:t.clearDataConfirmTitle}),(0,P.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain`,children:[(0,P.jsx)(h,{className:`mt-2 text-sm text-fg-muted`,children:t.clearDataConfirmDesc}),(0,P.jsxs)(`label`,{className:`mt-4 flex cursor-pointer items-start gap-2 text-sm text-fg`,children:[(0,P.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox mt-0.5`,disabled:M,checked:T,onChange:e=>i({type:`patch`,patch:{clearConfirmChecked:e.target.checked}})}),(0,P.jsx)(`span`,{children:t.clearDataConfirmCheckbox})]}),(0,P.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,P.jsx)(`label`,{className:`block text-sm font-medium text-fg`,htmlFor:`clear-data-confirm`,children:t.clearDataConfirmLabel}),(0,P.jsx)(`input`,{id:`clear-data-confirm`,disabled:M,type:`text`,autoComplete:`off`,spellCheck:!1,className:d(`w-full rounded-md border border-edge bg-surface-panel px-3 py-1.5 font-mono text-xs text-fg`,`placeholder:text-fg-subtle`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`,`dark:border-edge`),placeholder:t.clearDataConfirmPhrase,value:O,onChange:e=>i({type:`patch`,patch:{clearConfirmText:e.target.value}})}),M?(0,P.jsxs)(`div`,{className:`space-y-2`,role:`status`,"aria-live":`polite`,children:[(0,P.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:t.clearDataProgress}),(0,P.jsx)(`div`,{role:`progressbar`,"aria-label":t.clearDataProgress,className:`h-1.5 overflow-hidden rounded-full bg-surface-active`,children:(0,P.jsx)(`div`,{className:`xopc-clear-data-progress h-full w-1/3 rounded-full bg-accent`})}),(0,P.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.clearDataProgressHint})]}):(0,P.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.clearDataConfirmHint})]})]}),(0,P.jsxs)(`div`,{className:`mt-6 flex shrink-0 justify-end gap-2`,children:[(0,P.jsx)(f,{type:`button`,variant:`secondary`,disabled:M,onClick:()=>{i({type:`patch`,patch:{clearDialogOpen:!1,clearConfirmChecked:!1,clearConfirmText:``}})},children:t.cancel}),(0,P.jsxs)(f,{type:`button`,variant:`secondary`,className:`border-danger/40 bg-danger text-white hover:bg-danger/90 dark:border-danger/40`,disabled:M||!q,onClick:()=>void V(),children:[M?(0,P.jsx)(l,{className:`size-4 animate-spin motion-reduce:animate-none`,"aria-hidden":!0}):null,M?t.clearDataProgress:t.confirmClear]})]})]})]})}),G?(0,P.jsx)(y,{open:k,onOpenChange:e=>{e||i({type:`patch`,patch:{uninstallDialogOpen:!1}})},children:(0,P.jsxs)(g,{children:[(0,P.jsx)(m,{className:d(`xopc-dialog-overlay fixed inset-0 bg-scrim backdrop-blur-[1px]`,x)}),(0,P.jsxs)(_,{className:d(`xopc-dialog-content fixed left-1/2 top-1/2 w-[min(100%-2rem,28rem)] -translate-x-1/2 -translate-y-1/2`,b,`rounded-2xl border border-edge bg-surface-overlay p-6 shadow-popover outline-none dark:border-edge`),onOpenAutoFocus:e=>e.preventDefault(),children:[(0,P.jsx)(v,{className:`text-base font-semibold text-fg`,children:t.uninstallConfirmTitle}),(0,P.jsx)(h,{className:`mt-2 text-sm text-fg-muted`,children:K}),(0,P.jsxs)(`label`,{className:`mt-4 flex cursor-pointer items-start gap-2 text-sm text-fg`,children:[(0,P.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox mt-0.5`,checked:A,onChange:e=>i({type:`patch`,patch:{removeUserDataOnUninstall:e.target.checked}})}),(0,P.jsx)(`span`,{children:t.removeUserDataCheckbox})]}),A?(0,P.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:t.clearDataConfirmDesc}):null,(0,P.jsxs)(`div`,{className:`mt-6 flex justify-end gap-2`,children:[(0,P.jsx)(f,{type:`button`,variant:`secondary`,disabled:M,onClick:()=>i({type:`patch`,patch:{uninstallDialogOpen:!1}}),children:t.cancel}),(0,P.jsx)(f,{type:`button`,variant:`secondary`,className:`border-danger/40 bg-danger text-white hover:bg-danger/90 dark:border-danger/40`,disabled:M,onClick:()=>void H(),children:t.confirmUninstall})]})]})]})}):null]})}async function B(){return(await o(i(`/api/migrations/status`))).payload}async function V(){await o(i(`/api/migrations/apply`),{method:`POST`,body:`{}`})}function H({messages:e}){let{data:t,error:n,isLoading:r,mutate:i}=S(`settings-migration-status`,B,{refreshInterval:0,revalidateOnFocus:!1}),[a,o]=(0,N.useState)(!1),[s,c]=(0,N.useState)(null);async function l(){o(!0),c(null);try{await V(),await i(),window.dispatchEvent(new CustomEvent(`config-reload`))}catch(e){c(e instanceof Error?e.message:String(e))}finally{o(!1)}}if(r)return(0,P.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-4`,"aria-busy":`true`,children:[(0,P.jsx)(p,{className:`h-5 w-40 max-w-full`}),(0,P.jsx)(p,{className:`mt-2 h-4 w-64 max-w-full`})]});if(n)return(0,P.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-4`,children:[(0,P.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:e.title}),(0,P.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:e.checkFailed})]});let u=t?.items??[],d=u.filter(e=>e.status===`conflict`||e.status===`error`),m=u.filter(e=>e.safety===`auto`&&e.status===`planned`),h=d.length>0||u.some(e=>e.safety!==`auto`);return(0,P.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-4`,children:[(0,P.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:e.title}),(0,P.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:u.length===0?e.upToDate:h?e.manualAttention:e.safeRepairs.replace(`{{count}}`,String(m.length))})]}),m.length>0&&!h?(0,P.jsx)(f,{type:`button`,variant:`primary`,className:`px-3 py-1.5 text-xs`,onClick:()=>void l(),disabled:a,children:a?e.applying:e.apply}):null]}),u.length>0?(0,P.jsx)(`div`,{className:`mt-3 space-y-2`,children:u.map(e=>(0,P.jsxs)(`div`,{className:`rounded-xl bg-surface-base/55 px-3 py-2`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,P.jsx)(`div`,{className:`truncate text-sm font-medium text-fg`,children:e.title}),(0,P.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2 py-0.5 text-[11px] uppercase tracking-wide text-fg-muted`,children:e.status})]}),(0,P.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:e.message})]},e.id))}):null,s?(0,P.jsx)(`p`,{className:`mt-3 text-sm text-red-500`,children:s}):null]})}function U(){let e=(0,M.c)(28),t=a(W),n;e[0]===t?n=e[1]:(n=s(t),e[0]=t,e[1]=n);let r=n.systemSettings,i=r.desktopApp,o=typeof window<`u`?window.electronAPI?.system:void 0;if(!T()||!o){let t;e[2]===i.title?t=e[3]:(t=(0,P.jsx)(k,{title:i.title}),e[2]=i.title,e[3]=t);let n;e[4]===i.migrations?n=e[5]:(n=(0,P.jsx)(H,{messages:i.migrations}),e[4]=i.migrations,e[5]=n);let a;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(a=A(),e[6]=a):a=e[6];let o;e[7]===r.desktopOnlyTitle?o=e[8]:(o=(0,P.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:r.desktopOnlyTitle}),e[7]=r.desktopOnlyTitle,e[8]=o);let s;e[9]===r.desktopOnlyBody?s=e[10]:(s=(0,P.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:r.desktopOnlyBody}),e[9]=r.desktopOnlyBody,e[10]=s);let c;e[11]!==o||e[12]!==s?(c=(0,P.jsxs)(`div`,{className:a,children:[o,s]}),e[11]=o,e[12]=s,e[13]=c):c=e[13];let l;return e[14]!==t||e[15]!==n||e[16]!==c?(l=(0,P.jsxs)(O,{gap:`gap-3`,children:[t,n,c]}),e[14]=t,e[15]=n,e[16]=c,e[17]=l):l=e[17],l}let c;e[18]===i.title?c=e[19]:(c=(0,P.jsx)(k,{title:i.title}),e[18]=i.title,e[19]=c);let l;e[20]===i.migrations?l=e[21]:(l=(0,P.jsx)(H,{messages:i.migrations}),e[20]=i.migrations,e[21]=l);let u;e[22]===i?u=e[23]:(u=(0,P.jsx)(z,{api:o,messages:i,embedded:!1}),e[22]=i,e[23]=u);let d;return e[24]!==c||e[25]!==l||e[26]!==u?(d=(0,P.jsxs)(O,{gap:`gap-6`,children:[c,l,u]}),e[24]=c,e[25]=l,e[26]=u,e[27]=d):d=e[27],d}function W(e){return e.language}export{U as AppManagementSettingsPanel};
|
|
@@ -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{i,n as a,o}from"./locale-store-Bg_XR36n.js";import{t as s}from"./messages-DG4HLOER.js";import{n as c,r as l}from"./popover-select-DD8fmrxH.js";import{t as u}from"./cn-0WouolD0.js";import{t as d}from"./skeleton-BI5TyibZ.js";import{n as f}from"./interaction-BdhHBbYa.js";import{n as p,r as m}from"./gateway-config-swr-DfPQIHOL.js";import{t as h}from"./preference-select-fields-BVoN-lAv.js";import{i as g}from"./theme-store-gAcojLgP.js";import{t as _}from"./dev-view-store-TTj_djD8.js";import{n as v,t as y}from"./settings-page-header-CyUHrn7c.js";import"./settings-page-layout-DGVqXrlp.js";import{t as b}from"./settings-advanced-gate-CjAFqg2U.js";var x=e(t(),1),S=n();function C(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function w(e){let t=C(e)?e:{},n=C(t.gateway)?t.gateway:{},r=(C(n.webchat)?n.webchat:{}).activityDetailDefault;return r===`off`||r===`stream`||r===`on`?r:`on`}async function T(e){await o(i(`/api/config`),{method:`PATCH`,body:JSON.stringify({gateway:{webchat:{activityDetailDefault:e}}})}),await p()}var E=r();function D(e){let t=(0,S.c)(13),{title:n,footer:r,children:i,className:a}=e,o;t[0]===a?o=t[1]:(o=u(`min-w-0`,a),t[0]=a,t[1]=o);let s;t[2]===n?s=t[3]:(s=n?(0,E.jsx)(`h2`,{className:`mb-2 px-1 text-xs font-medium text-fg-muted`,children:n}):null,t[2]=n,t[3]=s);let c;t[4]===i?c=t[5]:(c=(0,E.jsx)(`div`,{className:`flex flex-col gap-1 overflow-hidden rounded-xl bg-surface-hover/20 p-1 [&>*]:rounded-lg [&>*]:bg-surface-base/45`,children:i}),t[4]=i,t[5]=c);let l;t[6]===r?l=t[7]:(l=r?(0,E.jsx)(`p`,{className:`mt-2 px-1 text-xs leading-5 text-fg-subtle`,children:r}):null,t[6]=r,t[7]=l);let d;return t[8]!==o||t[9]!==s||t[10]!==c||t[11]!==l?(d=(0,E.jsxs)(`section`,{className:o,children:[s,c,l]}),t[8]=o,t[9]=s,t[10]=c,t[11]=l,t[12]=d):d=t[12],d}var O={default:{light:{canvas:`#ffffff`,panel:`#fafafa`,accent:`#3a6bff`,fg:`#111111`,muted:`#ececec`},dark:{canvas:`#0a0a0a`,panel:`#121212`,accent:`#3a6bff`,fg:`#f5f5f5`,muted:`#222222`}},emerald:{light:{canvas:`#f0fdf4`,panel:`#ffffff`,accent:`#059669`,fg:`#052e16`,muted:`#86efac`},dark:{canvas:`#000000`,panel:`#0a0a0a`,accent:`#10b981`,fg:`#d1fae5`,muted:`#134e2a`}},clay:{light:{canvas:`#fffaf0`,panel:`#ffffff`,accent:`#1a3a3a`,fg:`#0a0a0a`,muted:`#e5e5e5`},dark:{canvas:`#0a1a1a`,panel:`#1a2a2a`,accent:`#ffb084`,fg:`#fffaf0`,muted:`#2a3a3a`}},porcelain:{light:{canvas:`#f6f0e7`,panel:`#fffcf7`,accent:`#985d4d`,fg:`#352e2a`,muted:`#e8d9cf`},dark:{canvas:`#211c19`,panel:`#2b2420`,accent:`#d4a08c`,fg:`#f3eae1`,muted:`#493a32`}},dawn:{light:{canvas:`#accdec`,panel:`#f8fbff`,accent:`#34363a`,fg:`#262626`,muted:`#e7ebf4`},dark:{canvas:`#172433`,panel:`#253342`,accent:`#d9dde2`,fg:`#f3f6fa`,muted:`#415264`}}};function k(e){let t=(0,S.c)(23),{canvas:n,panel:r,accent:i,fg:a,muted:o}=e,s;t[0]===n?s=t[1]:(s={backgroundColor:n},t[0]=n,t[1]=s);let c;t[2]===r?c=t[3]:(c={backgroundColor:r},t[2]=r,t[3]=c);let l;t[4]===i?l=t[5]:(l=(0,E.jsx)(`div`,{className:`size-1 shrink-0 rounded-full`,style:{backgroundColor:i}}),t[4]=i,t[5]=l);let u;t[6]===a?u=t[7]:(u=(0,E.jsx)(`div`,{className:`h-1 min-w-0 flex-1 rounded-full`,style:{backgroundColor:a,opacity:.85}}),t[6]=a,t[7]=u);let d;t[8]!==l||t[9]!==u?(d=(0,E.jsxs)(`div`,{className:`flex items-center gap-1`,children:[l,u]}),t[8]=l,t[9]=u,t[10]=d):d=t[10];let f;t[11]===o?f=t[12]:(f=(0,E.jsx)(`div`,{className:`h-1 w-2/3 max-w-[70%] rounded-full`,style:{backgroundColor:o}}),t[11]=o,t[12]=f);let p;t[13]===o?p=t[14]:(p=(0,E.jsx)(`div`,{className:`size-1/2 max-w-[55%] rounded-full`,style:{backgroundColor:o}}),t[13]=o,t[14]=p);let m;t[15]!==c||t[16]!==d||t[17]!==f||t[18]!==p?(m=(0,E.jsxs)(`div`,{className:`flex flex-col gap-0.5 rounded-sm p-1`,style:c,children:[d,f,p]}),t[15]=c,t[16]=d,t[17]=f,t[18]=p,t[19]=m):m=t[19];let h;return t[20]!==s||t[21]!==m?(h=(0,E.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col justify-center gap-1 p-1.5`,style:s,children:m}),t[20]=s,t[21]=m,t[22]=h):h=t[22],h}function A(e){let t=(0,S.c)(8),{scheme:n}=e,{light:r,dark:i}=O[n],a;t[0]===r?a=t[1]:(a=(0,E.jsx)(k,{...r}),t[0]=r,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,E.jsx)(`div`,{className:`w-px shrink-0 bg-black/12 dark:bg-white/12`,"aria-hidden":!0}),t[2]=o):o=t[2];let s;t[3]===i?s=t[4]:(s=(0,E.jsx)(k,{...i}),t[3]=i,t[4]=s);let c;return t[5]!==a||t[6]!==s?(c=(0,E.jsxs)(`div`,{className:`flex h-11 w-full overflow-hidden rounded-md`,children:[a,o,s]}),t[5]=a,t[6]=s,t[7]=c):c=t[7],c}var j=[{value:`default`,labelKey:`colorSchemeDefault`},{value:`porcelain`,labelKey:`colorSchemePorcelain`},{value:`dawn`,labelKey:`colorSchemeDawn`},{value:`emerald`,labelKey:`colorSchemeLightGreen`},{value:`clay`,labelKey:`colorSchemeClay`}];function M(){let e=(0,S.c)(13),t=a(F),n;e[0]===t?n=e[1]:(n=s(t),e[0]=t,e[1]=n);let r=n.appearanceSettings,i=g(P),o=g(N),c;e[2]===r.colorSchemeTitle?c=e[3]:(c=(0,E.jsx)(`div`,{className:`min-w-0`,children:(0,E.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:r.colorSchemeTitle})}),e[2]=r.colorSchemeTitle,e[3]=c);let l;e[4]!==r||e[5]!==i||e[6]!==o?(l=j.map(e=>{let{value:t,labelKey:n}=e,a=i===t;return(0,E.jsxs)(`button`,{type:`button`,"aria-pressed":a,onClick:()=>o(t),className:u(`flex flex-col gap-2 rounded-xl bg-surface-hover/25 p-2.5 text-left transition-[background-color,box-shadow,transform] duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,f.pressCard,a?`bg-surface-active shadow-surface`:`hover:bg-surface-hover/60`),children:[(0,E.jsx)(A,{scheme:t}),(0,E.jsx)(`span`,{className:u(`text-xs font-medium leading-none`,a?`text-accent-fg`:`text-fg-muted`),children:r[n]})]},t)}),e[4]=r,e[5]=i,e[6]=o,e[7]=l):l=e[7];let d;e[8]===l?d=e[9]:(d=(0,E.jsx)(`div`,{className:`grid grid-cols-2 gap-3 sm:grid-cols-3 xl:grid-cols-5`,children:l}),e[8]=l,e[9]=d);let p;return e[10]!==c||e[11]!==d?(p=(0,E.jsxs)(`div`,{className:`flex flex-col gap-3 px-4 py-3.5 sm:px-5 sm:py-4`,children:[c,d]}),e[10]=c,e[11]=d,e[12]=p):p=e[12],p}function N(e){return e.setColorScheme}function P(e){return e.colorScheme}function F(e){return e.language}function I(){let e=(0,S.c)(28),t=a(L),n;e[0]===t?n=e[1]:(n=s(t),e[0]=t,e[1]=n);let r=n.appearanceSettings,{data:i,isLoading:o}=m(!0),f=i?.payload?.config,p;e[2]===f?p=e[3]:(p=w(f),e[2]=f,e[3]=p);let h=p,[g,_]=(0,x.useState)(h),[v,y]=(0,x.useState)(!1),[b,C]=(0,x.useState)(!1),D,O;e[4]===h?(D=e[5],O=e[6]):(D=()=>_(h),O=[h],e[4]=h,e[5]=D,e[6]=O),(0,x.useEffect)(D,O);let k;e[7]===g?k=e[8]:(k=e=>{let t=g;_(e),y(!0),C(!1),T(e).catch(()=>{_(t),C(!0)}).finally(()=>y(!1))},e[7]=g,e[8]=k);let A=k,j;e[9]===r.activityDetailDefaultTitle?j=e[10]:(j=(0,E.jsx)(`div`,{className:`min-w-0 text-sm font-medium text-fg`,children:r.activityDetailDefaultTitle}),e[9]=r.activityDetailDefaultTitle,e[10]=j);let M;e[11]!==r.activityDetailLevels||e[12]!==A||e[13]!==o||e[14]!==g||e[15]!==v?(M=o?(0,E.jsx)(d,{className:`h-10 w-full rounded-lg sm:max-w-[11rem]`}):(0,E.jsxs)(c,{value:g,disabled:v,onChange:e=>A(e.target.value),triggerClassName:`w-full sm:max-w-[11rem]`,children:[(0,E.jsx)(l,{value:`off`,children:r.activityDetailLevels.off}),(0,E.jsx)(l,{value:`on`,children:r.activityDetailLevels.on}),(0,E.jsx)(l,{value:`stream`,children:r.activityDetailLevels.stream})]}),e[11]=r.activityDetailLevels,e[12]=A,e[13]=o,e[14]=g,e[15]=v,e[16]=M):M=e[16];let N;e[17]!==j||e[18]!==M?(N=(0,E.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between sm:gap-6`,children:[j,M]}),e[17]=j,e[18]=M,e[19]=N):N=e[19];let P;e[20]!==r.activityDetailSaveError||e[21]!==r.activityDetailSaving||e[22]!==b||e[23]!==v?(P=b||v?(0,E.jsx)(`p`,{className:u(`text-xs`,b?`text-red-600 dark:text-red-400`:`text-fg-subtle`),children:b?r.activityDetailSaveError:r.activityDetailSaving}):null,e[20]=r.activityDetailSaveError,e[21]=r.activityDetailSaving,e[22]=b,e[23]=v,e[24]=P):P=e[24];let F;return e[25]!==N||e[26]!==P?(F=(0,E.jsxs)(`div`,{className:`flex flex-col gap-2 px-4 py-3.5 sm:px-5 sm:py-4`,children:[N,P]}),e[25]=N,e[26]=P,e[27]=F):F=e[27],F}function L(e){return e.language}function R(){let e=(0,S.c)(17),t=a(V),n;e[0]===t?n=e[1]:(n=s(t),e[0]=t,e[1]=n);let r=n.appearanceSettings,i=_(B),o=_(z),c;e[2]===r.showRawToolDataTitle?c=e[3]:(c=(0,E.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:r.showRawToolDataTitle}),e[2]=r.showRawToolDataTitle,e[3]=c);let l;e[4]===r.showRawToolDataDescription?l=e[5]:(l=(0,E.jsx)(`p`,{className:`text-xs text-fg-muted`,children:r.showRawToolDataDescription}),e[4]=r.showRawToolDataDescription,e[5]=l);let u;e[6]!==c||e[7]!==l?(u=(0,E.jsxs)(`div`,{className:`min-w-0`,children:[c,l]}),e[6]=c,e[7]=l,e[8]=u):u=e[8];let d;e[9]===o?d=e[10]:(d=e=>o(e.target.checked),e[9]=o,e[10]=d);let f;e[11]!==i||e[12]!==d?(f=(0,E.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:i,onChange:d}),e[11]=i,e[12]=d,e[13]=f):f=e[13];let p;return e[14]!==u||e[15]!==f?(p=(0,E.jsx)(`div`,{className:`px-4 py-3.5 sm:px-5 sm:py-4`,children:(0,E.jsxs)(`label`,{className:`flex items-center justify-between gap-3`,children:[u,f]})}),e[14]=u,e[15]=f,e[16]=p):p=e[16],p}function z(e){return e.setShowRawToolData}function B(e){return e.showRawToolData}function V(e){return e.language}function H(){let e=(0,S.c)(12),t=a(U),n;e[0]===t?n=e[1]:(n=s(t),e[0]=t,e[1]=n);let r=n.appearanceSettings,i;e[2]===r.pageTitle?i=e[3]:(i=(0,E.jsx)(y,{title:r.pageTitle}),e[2]=r.pageTitle,e[3]=i);let o;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,E.jsx)(D,{children:(0,E.jsx)(h,{variant:`page`,sections:[`language`]})}),e[4]=o):o=e[4];let c;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,E.jsxs)(D,{children:[(0,E.jsx)(h,{variant:`page`,sections:[`theme`,`font`]}),(0,E.jsx)(M,{}),(0,E.jsx)(I,{})]}),e[5]=c):c=e[5];let l;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,E.jsx)(R,{}),e[6]=l):l=e[6];let u;e[7]===r.developerGroupTitle?u=e[8]:(u=(0,E.jsx)(b,{children:(0,E.jsx)(D,{title:r.developerGroupTitle,children:l})}),e[7]=r.developerGroupTitle,e[8]=u);let d;return e[9]!==i||e[10]!==u?(d=(0,E.jsxs)(v,{gap:`gap-6`,children:[i,o,c,u]}),e[9]=i,e[10]=u,e[11]=d):d=e[11],d}function U(e){return e.language}export{H as AppearanceSettingsPanel};
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{i,n as a,o}from"./locale-store-Br7IfbXK.js";import{t as s}from"./messages-ByFlEbsu.js";import{n as c,r as l}from"./popover-select-DD8fmrxH.js";import{t as u}from"./cn-0WouolD0.js";import{t as d}from"./skeleton-BI5TyibZ.js";import{n as f}from"./interaction-BdhHBbYa.js";import{n as p,r as m}from"./gateway-config-swr-BOCt_zOo.js";import{t as h}from"./preference-select-fields-Cu_ZC9Up.js";import{i as g}from"./theme-store-Dlnmgryi.js";import{t as _}from"./dev-view-store-CeZZLOc6.js";import{n as v,t as y}from"./settings-page-header-DBL0_u0Z.js";import"./settings-page-layout-IAvpbz4A.js";import{t as b}from"./settings-advanced-gate-BI4DMz4_.js";var x=e(t(),1),S=n();function C(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function w(e){let t=C(e)?e:{},n=C(t.gateway)?t.gateway:{},r=(C(n.webchat)?n.webchat:{}).activityDetailDefault;return r===`off`||r===`stream`||r===`on`?r:`on`}async function T(e){await o(i(`/api/config`),{method:`PATCH`,body:JSON.stringify({gateway:{webchat:{activityDetailDefault:e}}})}),await p()}var E=r();function D(e){let t=(0,S.c)(13),{title:n,footer:r,children:i,className:a}=e,o;t[0]===a?o=t[1]:(o=u(`min-w-0`,a),t[0]=a,t[1]=o);let s;t[2]===n?s=t[3]:(s=n?(0,E.jsx)(`h2`,{className:`mb-2 px-1 text-xs font-medium text-fg-muted`,children:n}):null,t[2]=n,t[3]=s);let c;t[4]===i?c=t[5]:(c=(0,E.jsx)(`div`,{className:`flex flex-col gap-1 overflow-hidden rounded-xl bg-surface-hover/20 p-1 [&>*]:rounded-lg [&>*]:bg-surface-base/45`,children:i}),t[4]=i,t[5]=c);let l;t[6]===r?l=t[7]:(l=r?(0,E.jsx)(`p`,{className:`mt-2 px-1 text-xs leading-5 text-fg-subtle`,children:r}):null,t[6]=r,t[7]=l);let d;return t[8]!==o||t[9]!==s||t[10]!==c||t[11]!==l?(d=(0,E.jsxs)(`section`,{className:o,children:[s,c,l]}),t[8]=o,t[9]=s,t[10]=c,t[11]=l,t[12]=d):d=t[12],d}var O={default:{light:{canvas:`#ffffff`,panel:`#fafafa`,accent:`#3a6bff`,fg:`#111111`,muted:`#ececec`},dark:{canvas:`#0a0a0a`,panel:`#121212`,accent:`#3a6bff`,fg:`#f5f5f5`,muted:`#222222`}},emerald:{light:{canvas:`#f0fdf4`,panel:`#ffffff`,accent:`#059669`,fg:`#052e16`,muted:`#86efac`},dark:{canvas:`#000000`,panel:`#0a0a0a`,accent:`#10b981`,fg:`#d1fae5`,muted:`#134e2a`}},clay:{light:{canvas:`#fffaf0`,panel:`#ffffff`,accent:`#1a3a3a`,fg:`#0a0a0a`,muted:`#e5e5e5`},dark:{canvas:`#0a1a1a`,panel:`#1a2a2a`,accent:`#ffb084`,fg:`#fffaf0`,muted:`#2a3a3a`}},porcelain:{light:{canvas:`#f6f0e7`,panel:`#fffcf7`,accent:`#985d4d`,fg:`#352e2a`,muted:`#e8d9cf`},dark:{canvas:`#211c19`,panel:`#2b2420`,accent:`#d4a08c`,fg:`#f3eae1`,muted:`#493a32`}},dawn:{light:{canvas:`#accdec`,panel:`#f8fbff`,accent:`#34363a`,fg:`#262626`,muted:`#e7ebf4`},dark:{canvas:`#172433`,panel:`#253342`,accent:`#d9dde2`,fg:`#f3f6fa`,muted:`#415264`}}};function k(e){let t=(0,S.c)(23),{canvas:n,panel:r,accent:i,fg:a,muted:o}=e,s;t[0]===n?s=t[1]:(s={backgroundColor:n},t[0]=n,t[1]=s);let c;t[2]===r?c=t[3]:(c={backgroundColor:r},t[2]=r,t[3]=c);let l;t[4]===i?l=t[5]:(l=(0,E.jsx)(`div`,{className:`size-1 shrink-0 rounded-full`,style:{backgroundColor:i}}),t[4]=i,t[5]=l);let u;t[6]===a?u=t[7]:(u=(0,E.jsx)(`div`,{className:`h-1 min-w-0 flex-1 rounded-full`,style:{backgroundColor:a,opacity:.85}}),t[6]=a,t[7]=u);let d;t[8]!==l||t[9]!==u?(d=(0,E.jsxs)(`div`,{className:`flex items-center gap-1`,children:[l,u]}),t[8]=l,t[9]=u,t[10]=d):d=t[10];let f;t[11]===o?f=t[12]:(f=(0,E.jsx)(`div`,{className:`h-1 w-2/3 max-w-[70%] rounded-full`,style:{backgroundColor:o}}),t[11]=o,t[12]=f);let p;t[13]===o?p=t[14]:(p=(0,E.jsx)(`div`,{className:`size-1/2 max-w-[55%] rounded-full`,style:{backgroundColor:o}}),t[13]=o,t[14]=p);let m;t[15]!==c||t[16]!==d||t[17]!==f||t[18]!==p?(m=(0,E.jsxs)(`div`,{className:`flex flex-col gap-0.5 rounded-sm p-1`,style:c,children:[d,f,p]}),t[15]=c,t[16]=d,t[17]=f,t[18]=p,t[19]=m):m=t[19];let h;return t[20]!==s||t[21]!==m?(h=(0,E.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col justify-center gap-1 p-1.5`,style:s,children:m}),t[20]=s,t[21]=m,t[22]=h):h=t[22],h}function A(e){let t=(0,S.c)(8),{scheme:n}=e,{light:r,dark:i}=O[n],a;t[0]===r?a=t[1]:(a=(0,E.jsx)(k,{...r}),t[0]=r,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,E.jsx)(`div`,{className:`w-px shrink-0 bg-black/12 dark:bg-white/12`,"aria-hidden":!0}),t[2]=o):o=t[2];let s;t[3]===i?s=t[4]:(s=(0,E.jsx)(k,{...i}),t[3]=i,t[4]=s);let c;return t[5]!==a||t[6]!==s?(c=(0,E.jsxs)(`div`,{className:`flex h-11 w-full overflow-hidden rounded-md`,children:[a,o,s]}),t[5]=a,t[6]=s,t[7]=c):c=t[7],c}var j=[{value:`default`,labelKey:`colorSchemeDefault`},{value:`porcelain`,labelKey:`colorSchemePorcelain`},{value:`dawn`,labelKey:`colorSchemeDawn`},{value:`emerald`,labelKey:`colorSchemeLightGreen`},{value:`clay`,labelKey:`colorSchemeClay`}];function M(){let e=(0,S.c)(13),t=a(F),n;e[0]===t?n=e[1]:(n=s(t),e[0]=t,e[1]=n);let r=n.appearanceSettings,i=g(P),o=g(N),c;e[2]===r.colorSchemeTitle?c=e[3]:(c=(0,E.jsx)(`div`,{className:`min-w-0`,children:(0,E.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:r.colorSchemeTitle})}),e[2]=r.colorSchemeTitle,e[3]=c);let l;e[4]!==r||e[5]!==i||e[6]!==o?(l=j.map(e=>{let{value:t,labelKey:n}=e,a=i===t;return(0,E.jsxs)(`button`,{type:`button`,"aria-pressed":a,onClick:()=>o(t),className:u(`flex flex-col gap-2 rounded-xl bg-surface-hover/25 p-2.5 text-left transition-[background-color,box-shadow,transform] duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,f.pressCard,a?`bg-surface-active shadow-surface`:`hover:bg-surface-hover/60`),children:[(0,E.jsx)(A,{scheme:t}),(0,E.jsx)(`span`,{className:u(`text-xs font-medium leading-none`,a?`text-accent-fg`:`text-fg-muted`),children:r[n]})]},t)}),e[4]=r,e[5]=i,e[6]=o,e[7]=l):l=e[7];let d;e[8]===l?d=e[9]:(d=(0,E.jsx)(`div`,{className:`grid grid-cols-2 gap-3 sm:grid-cols-3 xl:grid-cols-5`,children:l}),e[8]=l,e[9]=d);let p;return e[10]!==c||e[11]!==d?(p=(0,E.jsxs)(`div`,{className:`flex flex-col gap-3 px-4 py-3.5 sm:px-5 sm:py-4`,children:[c,d]}),e[10]=c,e[11]=d,e[12]=p):p=e[12],p}function N(e){return e.setColorScheme}function P(e){return e.colorScheme}function F(e){return e.language}function I(){let e=(0,S.c)(28),t=a(L),n;e[0]===t?n=e[1]:(n=s(t),e[0]=t,e[1]=n);let r=n.appearanceSettings,{data:i,isLoading:o}=m(!0),f=i?.payload?.config,p;e[2]===f?p=e[3]:(p=w(f),e[2]=f,e[3]=p);let h=p,[g,_]=(0,x.useState)(h),[v,y]=(0,x.useState)(!1),[b,C]=(0,x.useState)(!1),D,O;e[4]===h?(D=e[5],O=e[6]):(D=()=>_(h),O=[h],e[4]=h,e[5]=D,e[6]=O),(0,x.useEffect)(D,O);let k;e[7]===g?k=e[8]:(k=e=>{let t=g;_(e),y(!0),C(!1),T(e).catch(()=>{_(t),C(!0)}).finally(()=>y(!1))},e[7]=g,e[8]=k);let A=k,j;e[9]===r.activityDetailDefaultTitle?j=e[10]:(j=(0,E.jsx)(`div`,{className:`min-w-0 text-sm font-medium text-fg`,children:r.activityDetailDefaultTitle}),e[9]=r.activityDetailDefaultTitle,e[10]=j);let M;e[11]!==r.activityDetailLevels||e[12]!==A||e[13]!==o||e[14]!==g||e[15]!==v?(M=o?(0,E.jsx)(d,{className:`h-10 w-full rounded-lg sm:max-w-[11rem]`}):(0,E.jsxs)(c,{value:g,disabled:v,onChange:e=>A(e.target.value),triggerClassName:`w-full sm:max-w-[11rem]`,children:[(0,E.jsx)(l,{value:`off`,children:r.activityDetailLevels.off}),(0,E.jsx)(l,{value:`on`,children:r.activityDetailLevels.on}),(0,E.jsx)(l,{value:`stream`,children:r.activityDetailLevels.stream})]}),e[11]=r.activityDetailLevels,e[12]=A,e[13]=o,e[14]=g,e[15]=v,e[16]=M):M=e[16];let N;e[17]!==j||e[18]!==M?(N=(0,E.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between sm:gap-6`,children:[j,M]}),e[17]=j,e[18]=M,e[19]=N):N=e[19];let P;e[20]!==r.activityDetailSaveError||e[21]!==r.activityDetailSaving||e[22]!==b||e[23]!==v?(P=b||v?(0,E.jsx)(`p`,{className:u(`text-xs`,b?`text-red-600 dark:text-red-400`:`text-fg-subtle`),children:b?r.activityDetailSaveError:r.activityDetailSaving}):null,e[20]=r.activityDetailSaveError,e[21]=r.activityDetailSaving,e[22]=b,e[23]=v,e[24]=P):P=e[24];let F;return e[25]!==N||e[26]!==P?(F=(0,E.jsxs)(`div`,{className:`flex flex-col gap-2 px-4 py-3.5 sm:px-5 sm:py-4`,children:[N,P]}),e[25]=N,e[26]=P,e[27]=F):F=e[27],F}function L(e){return e.language}function R(){let e=(0,S.c)(17),t=a(V),n;e[0]===t?n=e[1]:(n=s(t),e[0]=t,e[1]=n);let r=n.appearanceSettings,i=_(B),o=_(z),c;e[2]===r.showRawToolDataTitle?c=e[3]:(c=(0,E.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:r.showRawToolDataTitle}),e[2]=r.showRawToolDataTitle,e[3]=c);let l;e[4]===r.showRawToolDataDescription?l=e[5]:(l=(0,E.jsx)(`p`,{className:`text-xs text-fg-muted`,children:r.showRawToolDataDescription}),e[4]=r.showRawToolDataDescription,e[5]=l);let u;e[6]!==c||e[7]!==l?(u=(0,E.jsxs)(`div`,{className:`min-w-0`,children:[c,l]}),e[6]=c,e[7]=l,e[8]=u):u=e[8];let d;e[9]===o?d=e[10]:(d=e=>o(e.target.checked),e[9]=o,e[10]=d);let f;e[11]!==i||e[12]!==d?(f=(0,E.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:i,onChange:d}),e[11]=i,e[12]=d,e[13]=f):f=e[13];let p;return e[14]!==u||e[15]!==f?(p=(0,E.jsx)(`div`,{className:`px-4 py-3.5 sm:px-5 sm:py-4`,children:(0,E.jsxs)(`label`,{className:`flex items-center justify-between gap-3`,children:[u,f]})}),e[14]=u,e[15]=f,e[16]=p):p=e[16],p}function z(e){return e.setShowRawToolData}function B(e){return e.showRawToolData}function V(e){return e.language}function H(){let e=(0,S.c)(12),t=a(U),n;e[0]===t?n=e[1]:(n=s(t),e[0]=t,e[1]=n);let r=n.appearanceSettings,i;e[2]===r.pageTitle?i=e[3]:(i=(0,E.jsx)(y,{title:r.pageTitle}),e[2]=r.pageTitle,e[3]=i);let o;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,E.jsx)(D,{children:(0,E.jsx)(h,{variant:`page`,sections:[`language`]})}),e[4]=o):o=e[4];let c;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,E.jsxs)(D,{children:[(0,E.jsx)(h,{variant:`page`,sections:[`theme`,`font`]}),(0,E.jsx)(M,{}),(0,E.jsx)(I,{})]}),e[5]=c):c=e[5];let l;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,E.jsx)(R,{}),e[6]=l):l=e[6];let u;e[7]===r.developerGroupTitle?u=e[8]:(u=(0,E.jsx)(b,{children:(0,E.jsx)(D,{title:r.developerGroupTitle,children:l})}),e[7]=r.developerGroupTitle,e[8]=u);let d;return e[9]!==i||e[10]!==u?(d=(0,E.jsxs)(v,{gap:`gap-6`,children:[i,o,c,u]}),e[9]=i,e[10]=u,e[11]=d):d=e[11],d}function U(e){return e.language}export{H as AppearanceSettingsPanel};
|
|
@@ -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{l as i,m as a,t as o,u as s}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{l as c,n as l}from"./locale-store-Bg_XR36n.js";import{t as u}from"./messages-DG4HLOER.js";import{t as d}from"./arrow-left-D880xG-P.js";import{t as f}from"./box-DvYoGszj.js";import{n as p,t as m}from"./extension-paths-DvuaZJuy.js";import{t as h}from"./ellipsis-0k4rZLoy.js";import{t as g}from"./external-link-DjqjBmc3.js";import{t as _}from"./loader-circle-CifKLtgG.js";import{t as v}from"./markdown-view-BUpXJUPv.js";import{t as y}from"./package-wATCyihJ.js";import{t as b}from"./plus-Q2yW6OE7.js";import{t as x}from"./settings-uiTATseT.js";import{t as S}from"./shield-check-BU58siTV.js";import{t as ee}from"./trash-2-DusmjVPV.js";import{t as C}from"./triangle-alert-2JXFNNKU.js";import{t as w}from"./x-B_N4OPjy.js";import{t as T}from"./cn-0WouolD0.js";import{t as E}from"./button-CnRSIP6m.js";import{t as D}from"./skeleton-BI5TyibZ.js";import{a as O,i as k,o as A,r as j,s as M,t as N}from"./dist-DfWfZ9iu.js";import{a as P,i as F}from"./vendor-swr-CdRzEUwF.js";import{o as I}from"./gateway-realtime-67vWg_M2.js";import{i as L,o as R,r as z,s as B}from"./extension-provider-mnRoa63o.js";import{n as V}from"./interaction-BdhHBbYa.js";import{t as H}from"./page-tabs-oeTY7z3_.js";import{t as U}from"./page-header-store-BdZnUh-D.js";import{r as W}from"./settings-form-draft-Dy10ldo8.js";import{l as G,m as te,o as K,r as q,t as ne}from"./dist-D3lWNSe7.js";import{r as re,t as ie}from"./agent-plugin-dialog-OBueuQSc.js";import{n as J,t as Y}from"./capability-links-DzQWK1Fh.js";import{t as X}from"./capability-icon-DVoZxEgW.js";import{a as Z,i as ae,n as oe,r as se,t as ce}from"./extension-marketplace-api-ow0K1Y4_.js";import{n as le,t as ue}from"./capability-header-actions-CTUCuBlW.js";import{n as de,r as fe,t as pe}from"./plugin-presentation-CO5BFDGW.js";var me=n(),he=`grid auto-rows-fr grid-cols-[repeat(auto-fill,minmax(min(100%,18rem),1fr))] items-stretch gap-4`,ge=`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`,_e=`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 ve(e){return e===`builtin`||e===`user`?e:`marketplace`}var $=r();function ye(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 be={debounced:``,detailPkg:null,quickInstallPkg:null,rowBusy:null,actionError:null,restartHint:null};function xe({className:e,query:t}){let n=s(),r=i(),a=l(e=>e.language),o=u(a).extensionsPage,d=c(e=>!!e.conversationId),f=z(),{mutate:m}=P(),[h,g]=(0,Q.useReducer)(W,be),{debounced:v,detailPkg:b,quickInstallPkg:x,rowBusy:S,actionError:C,restartHint:w}=h,E=d?`marketplace-${v}`:null;(0,Q.useEffect)(()=>{let e=window.setTimeout(()=>g({type:`patch`,patch:{debounced:t.trim()}}),300);return()=>window.clearTimeout(e)},[t]);let{data:O,isLoading:k,error:A}=F(E,()=>ce(v),{revalidateOnFocus:!1}),j=(0,Q.useCallback)(()=>{m(`gateway-extensions-list`),I()},[m]),M=(0,Q.useCallback)(async(e,t)=>{g({type:`patch`,patch:{actionError:null,restartHint:null,rowBusy:e}});try{let n=await se({name:e,overwrite:t});j(),n.requiresGatewayRestart&&g({type:`patch`,patch:{restartHint:o.marketplaceRestartHint}})}catch(e){throw g({type:`patch`,patch:{actionError:e instanceof Error?e.message:o.marketplaceInstallFailed}}),e}finally{g({type:`patch`,patch:{rowBusy:null}})}},[o.marketplaceInstallFailed,o.marketplaceRestartHint,j]),N=(0,Q.useCallback)(async e=>{g({type:`patch`,patch:{actionError:null,restartHint:null,rowBusy:e}});try{let t=await Z(e);j(),t.requiresGatewayRestart&&g({type:`patch`,patch:{restartHint:o.marketplaceRestartHint}})}catch(e){throw g({type:`patch`,patch:{actionError:e instanceof Error?e.message:o.marketplaceUninstallFailed}}),e}finally{g({type:`patch`,patch:{rowBusy:null}})}},[o.marketplaceRestartHint,o.marketplaceUninstallFailed,j]),L=O??[];return(0,$.jsxs)(`div`,{className:T(`flex flex-col gap-4`,e),children:[A?(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:A instanceof Error?A.message:o.marketplaceLoadFailed}):null,C?(0,$.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:C}):null,w?(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:w}):null,k&&!O?(0,$.jsx)(`ul`,{className:he,"aria-label":o.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)(D,{className:`size-10 shrink-0 rounded-xl`}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2`,children:[(0,$.jsx)(D,{className:`h-5 w-full`}),(0,$.jsx)(D,{className:`h-3 w-2/3`})]}),(0,$.jsx)(D,{className:`h-9 w-16 shrink-0 rounded-lg`})]}),(0,$.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,$.jsx)(D,{className:`h-4 w-full`}),(0,$.jsx)(D,{className:`h-4 w-full`}),(0,$.jsx)(D,{className:`h-4 w-2/3`})]})]},e))}):(0,$.jsx)(`ul`,{className:he,children:L.length===0?(0,$.jsx)(`li`,{className:`col-span-full text-sm text-fg-muted`,children:o.marketplaceEmpty}):L.map(e=>{let t=ye(f,e.id),i=S===e.id,s=f.find(t=>t.pluginId===e.id||t.provenance?.packageName===e.id),c=e.localizations?.[a.startsWith(`zh`)?`zh-CN`:`en`],l=c?.displayName??e.name,u=c?.description??e.description;return(0,$.jsxs)(`li`,{className:ge,children:[(0,$.jsx)(`button`,{type:`button`,"aria-label":`${l}, ${o.marketplaceDetailTitle}`,onClick:()=>s?.pluginId?n(Y(s.pluginId,`installed`,!1,r.pathname+r.search)):g({type:`patch`,patch:{detailPkg:e.id}}),className:_e}),(0,$.jsxs)(`div`,{className:`pointer-events-none relative flex items-start gap-3`,children:[(0,$.jsx)(X,{iconUrl:e.branding?.iconUrl,fallback:y}),(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:l,children:l}),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:s&&fe(s)?`text-amber-700 dark:text-amber-400`:`text-fg-muted`,children:s&&fe(s)?a.startsWith(`zh`)?`需要授权`:`Authorization required`:o.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:o.marketplaceBuiltin}):t===`user`?(0,$.jsx)($.Fragment,{children:e.packageType===`plugin`?(0,$.jsx)(`button`,{type:`button`,onClick:()=>s?.pluginId&&pe(s)?n(J(l,a.startsWith(`zh`))):s?.pluginId?n(Y(s.pluginId,`installed`,fe(s),r.pathname+r.search)):g({type:`patch`,patch:{detailPkg:e.id,quickInstallPkg:null}}),className:T(`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:s&&fe(s)?a.startsWith(`zh`)?`去授权`:`Connect account`:s&&pe(s)?a.startsWith(`zh`)?`开始使用`:`Start using`:a.startsWith(`zh`)?`管理插件`:`Manage plugin`}):(0,$.jsxs)(`button`,{type:`button`,disabled:i,onClick:()=>{window.confirm(o.marketplaceUninstallConfirm)&&N(e.id).catch(()=>{})},className:T(`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)(_,{className:`size-3.5 animate-spin`,"aria-hidden":!0}):(0,$.jsx)(ee,{className:`size-3.5`,strokeWidth:2,"aria-hidden":!0}),o.marketplaceUninstall]})}):(0,$.jsx)(`button`,{type:`button`,onClick:()=>g({type:`patch`,patch:(e.packageType,{detailPkg:e.id,quickInstallPkg:null})}),className:T(`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`?a.startsWith(`zh`)?`安装`:`Install`:o.marketplaceReview})})]}),u?(0,$.jsx)(`p`,{className:`pointer-events-none relative mt-3 line-clamp-3 text-sm leading-relaxed text-fg-muted`,children:u}):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)})}),b?(0,$.jsx)(Se,{packageName:b,autoInstall:x===b,copy:o,extensions:f,onClose:()=>g({type:`patch`,patch:{detailPkg:null,quickInstallPkg:null}}),onInstall:M,onUninstall:N}):null]})}function Se(e){let t=(0,me.c)(99),{packageName:n,autoInstall:r,copy:i,extensions:a,onClose:s,onInstall:u,onUninstall:f}=e,[p,m]=(0,Q.useState)(!1),h=l(Oe),[g,y]=(0,Q.useState)(!1),b=c(De)?`ext-mp-detail-${n}`:null,x;t[0]===n?x=t[1]:(x=async()=>oe(n),t[0]=n,t[1]=x);let E;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(E={revalidateOnFocus:!1},t[2]=E):E=t[2];let{data:k,error:P,isLoading:I}=F(b,x,E),L;t[3]!==a||t[4]!==n?(L=ye(a,n),t[3]=a,t[4]=n,t[5]=L):L=t[5];let R=L,z=R===`user`,B=k?.manifest?.permissions,V,H,U,W,G,te,K,q,ne,J,Y,X;if(t[6]!==r||t[7]!==i||t[8]!==k||t[9]!==P||t[10]!==a||t[11]!==R||t[12]!==I||t[13]!==h||t[14]!==s||t[15]!==n||t[16]!==B||t[17]!==g){te=Symbol.for(`react.early_return_sentinel`);bb0:{let e=B&&typeof B==`object`&&!Array.isArray(B)?Object.entries(B):[],o;t[30]!==i||t[31]!==k?(o=k?.readme?.trim()||(k?.description?.trim()?`### ${k.name}\n\n${k.description}`:`*${i.marketplaceNoReadme}*`),t[30]=i,t[31]=k,t[32]=o):o=t[32];let c=o;if(k?.format===`agent-plugin`){let e;if(t[33]!==k||t[34]!==a||t[35]!==n){let r;t[37]!==k||t[38]!==n?(r=e=>e.provenance?.packageName===n||e.pluginId===k.manifest?.name,t[37]=k,t[38]=n,t[39]=r):r=t[39],e=a.find(r),t[33]=k,t[34]=a,t[35]=n,t[36]=e}else e=t[36];let i=`store:${n}`,o;t[40]!==r||t[41]!==k||t[42]!==s||t[43]!==e||t[44]!==i?(o=(0,$.jsx)(ie,{extension:e,initialSource:i,marketplace:k,autoInstall:r,onClose:s}),t[40]=r,t[41]=k,t[42]=s,t[43]=e,t[44]=i,t[45]=o):o=t[45],te=o;break bb0}U=N,W=!0,t[46]===s?G=t[47]:(G=e=>!e&&s(),t[46]=s,t[47]=G),H=A,t[48]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,$.jsx)(O,{className:`xopc-dialog-overlay fixed inset-0 z-[130] bg-scrim`}),t[48]=X):X=t[48],V=j,ne=`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=Ee;let l;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,$.jsx)(d,{className:`size-5`}),t[49]=l):l=t[49];let u;t[50]!==i.detailBack||t[51]!==s?(u=(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:l}),t[50]=i.detailBack,t[51]=s,t[52]=u):u=t[52];let f;t[53]===i.marketplaceDetailTitle?f=t[54]:(f=(0,$.jsx)(M,{className:`min-w-0 flex-1 truncate text-center text-sm font-semibold text-fg`,children:i.marketplaceDetailTitle}),t[53]=i.marketplaceDetailTitle,t[54]=f);let p;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(w,{className:`size-5`}),t[55]=p):p=t[55];let m;t[56]!==i.detailClose||t[57]!==s?(m=(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:p}),t[56]=i.detailClose,t[57]=s,t[58]=m):m=t[58],t[59]!==u||t[60]!==f||t[61]!==m?(Y=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3`,children:[u,f,m]}),t[59]=u,t[60]=f,t[61]=m,t[62]=Y):Y=t[62],K=`min-h-0 flex-1 overflow-y-auto p-5`,q=I&&!k?(0,$.jsxs)(`div`,{className:`space-y-4`,"aria-label":i.marketplaceLoading,children:[(0,$.jsx)(D,{className:`h-6 w-48`}),(0,$.jsx)(D,{className:`h-4 w-28`}),(0,$.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,$.jsx)(D,{className:`h-12`}),(0,$.jsx)(D,{className:`h-12`})]}),(0,$.jsx)(D,{className:`h-28 w-full`}),(0,$.jsx)(D,{className:`h-36 w-full`})]}):P?(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:P instanceof Error?P.message:i.marketplaceLoadFailed})]}):k?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`h3`,{className:`text-lg font-semibold text-fg`,children:k.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:k.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:k.author.username})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`font-medium text-fg`,children:i.marketplaceVersion}),(0,$.jsx)(`dd`,{children:k.latestVersion.version})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`font-medium text-fg`,children:i.marketplaceDownloads}),(0,$.jsx)(`dd`,{children:k.downloads})]})]}),(0,$.jsx)(re,{data:k,zh:h===`zh`}),R===`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:[k.installability.available?(0,$.jsx)(S,{className:`mt-0.5 size-5 shrink-0 text-emerald-600 dark:text-emerald-400`,"aria-hidden":!0}):(0,$.jsx)(C,{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:k.installability.available?i.marketplaceRiskTitle:i.marketplaceUnavailableTitle}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-fg-muted`,children:k.installability.available?i.marketplaceCodeRisk:k.installability.reason??i.marketplaceUnavailableBody})]})]}),k.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:k.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(Te)}):(0,$.jsx)(`p`,{className:`mt-1`,children:i.marketplacePermissionsNone})]}),(k.packageSummary?.lifecycleScripts.length??0)>0?(0,$.jsxs)(`p`,{className:`text-xs leading-relaxed text-amber-700 dark:text-amber-300`,children:[i.marketplaceLifecycleScripts,`: `,k.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=>y(e.target.checked),className:`mt-0.5 size-4 rounded border-edge accent-[var(--color-accent)]`}),(0,$.jsx)(`span`,{children:i.marketplaceRiskConfirm})]})]}):null]}),k.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)(v,{content:c})})]}):null}t[6]=r,t[7]=i,t[8]=k,t[9]=P,t[10]=a,t[11]=R,t[12]=I,t[13]=h,t[14]=s,t[15]=n,t[16]=B,t[17]=g,t[18]=V,t[19]=H,t[20]=U,t[21]=W,t[22]=G,t[23]=te,t[24]=K,t[25]=q,t[26]=ne,t[27]=J,t[28]=Y,t[29]=X}else V=t[18],H=t[19],U=t[20],W=t[21],G=t[22],te=t[23],K=t[24],q=t[25],ne=t[26],J=t[27],Y=t[28],X=t[29];if(te!==Symbol.for(`react.early_return_sentinel`))return te;let Z;t[63]!==K||t[64]!==q?(Z=(0,$.jsx)(`div`,{className:K,children:q}),t[63]=K,t[64]=q,t[65]=Z):Z=t[65];let ae;t[66]!==p||t[67]!==i.marketplaceBuiltinGoBuiltin||t[68]!==i.marketplaceBuiltinManageHint||t[69]!==i.marketplaceInstall||t[70]!==i.marketplaceReinstall||t[71]!==i.marketplaceReinstallConfirm||t[72]!==i.marketplaceUninstall||t[73]!==i.marketplaceUninstallConfirm||t[74]!==k||t[75]!==R||t[76]!==s||t[77]!==u||t[78]!==f||t[79]!==n||t[80]!==g||t[81]!==z?(ae=k?(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:R===`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)(o,{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||!k.installability.available||!g,onClick:()=>{z&&!window.confirm(i.marketplaceReinstallConfirm)||(m(!0),u(n,z).catch(we).finally(()=>m(!1)))},className:T(`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)(_,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,z?i.marketplaceReinstall:i.marketplaceInstall]}),z?(0,$.jsxs)(`button`,{type:`button`,disabled:p,onClick:()=>{window.confirm(i.marketplaceUninstallConfirm)&&(m(!0),f(n).then(()=>s()).catch(Ce).finally(()=>m(!1)))},className:T(`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)(ee,{className:`size-4 shrink-0`,"aria-hidden":!0}),i.marketplaceUninstall]}):null]})}):null,t[66]=p,t[67]=i.marketplaceBuiltinGoBuiltin,t[68]=i.marketplaceBuiltinManageHint,t[69]=i.marketplaceInstall,t[70]=i.marketplaceReinstall,t[71]=i.marketplaceReinstallConfirm,t[72]=i.marketplaceUninstall,t[73]=i.marketplaceUninstallConfirm,t[74]=k,t[75]=R,t[76]=s,t[77]=u,t[78]=f,t[79]=n,t[80]=g,t[81]=z,t[82]=ae):ae=t[82];let se;t[83]!==V||t[84]!==Z||t[85]!==ae||t[86]!==ne||t[87]!==J||t[88]!==Y?(se=(0,$.jsxs)(V,{className:ne,onOpenAutoFocus:J,children:[Y,Z,ae]}),t[83]=V,t[84]=Z,t[85]=ae,t[86]=ne,t[87]=J,t[88]=Y,t[89]=se):se=t[89];let ce;t[90]!==H||t[91]!==se||t[92]!==X?(ce=(0,$.jsxs)(H,{children:[X,se]}),t[90]=H,t[91]=se,t[92]=X,t[93]=ce):ce=t[93];let le;return t[94]!==U||t[95]!==W||t[96]!==G||t[97]!==ce?(le=(0,$.jsx)(U,{defaultOpen:W,onOpenChange:G,children:ce}),t[94]=U,t[95]=W,t[96]=G,t[97]=ce,t[98]=le):le=t[98],le}function Ce(){}function we(){}function Te(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 Ee(e){return e.preventDefault()}function De(e){return!!e.conversationId}function Oe(e){return e.language}function ke({embedded:e=!1,onHeaderActionChange:t}){let n=s(),r=i(),c=l(e=>e.language),d=u(c),p=U(e=>e.setPageHeader),m=U(e=>e.clearPageHeader),g=z(),_=L(),[v,y]=a(),x=ve(v.get(`tab`)??(g.some(e=>e.source!==`bundled`)?`user`:null)),S=(0,Q.useRef)(!1),ee=v.get(`q`)??``,[C,w]=(0,Q.useState)(x),[D,O]=(0,Q.useState)(ee),[k,A]=(0,Q.useState)(null),[j,M]=(0,Q.useState)(!1),N=v.toString(),P=(0,Q.useRef)(N);if(P.current!==N){P.current=N;let e=ve(v.get(`tab`)),t=v.get(`q`)??``;w(t=>t===e?t:e),O(e=>e===t?e:t)}(0,Q.useEffect)(()=>{y(e=>{let t=new URLSearchParams(e),n=D.trim();return n?t.set(`q`,n):t.delete(`q`),C===`marketplace`?t.delete(`tab`):t.set(`tab`,C),t.toString()===e.toString()?e:t},{replace:!0})},[C,D,y]);let F=(0,Q.useMemo)(()=>g.filter(e=>e.source===`bundled`),[g]),I=(0,Q.useMemo)(()=>g.filter(e=>e.source!==`bundled`),[g]);(0,Q.useEffect)(()=>{_||S.current||(S.current=!0,!v.has(`tab`)&&I.length&&w(`user`))},[_,v,I.length]);let R=C===`builtin`?F:I,B=(0,Q.useMemo)(()=>{let e=D.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,c):e.hasUi?-1:1)},[R,D,c]);(0,Q.useEffect)(()=>{A(e=>{if(!e)return e;let t=g.find(t=>t.id===e.id);return t?Ae(e)===Ae(t)&&e.active===t.active&&JSON.stringify(e)===JSON.stringify(t)?e:t:null})},[g]);let W=(0,Q.useMemo)(()=>({searchLabel:C===`marketplace`?d.extensionsPage.marketplaceSearchPlaceholder:d.extensionsPage.searchPlaceholder,search:(0,$.jsx)(le,{value:D,onChange:O,placeholder:C===`marketplace`?d.extensionsPage.marketplaceSearchPlaceholder:d.extensionsPage.searchPlaceholder}),overflow:(0,$.jsxs)(G,{children:[(0,$.jsx)(te,{asChild:!0,children:(0,$.jsx)(E,{variant:`secondary`,className:`size-9 shrink-0 p-0`,"aria-label":d.capabilitiesHub.moreActions,title:d.capabilitiesHub.moreActions,children:(0,$.jsx)(h,{className:`size-4`,"aria-hidden":!0})})}),(0,$.jsx)(K,{children:(0,$.jsxs)(ne,{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)(q,{className:T(`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`,V.transition),onSelect:()=>M(!0),children:[(0,$.jsx)(b,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),c.startsWith(`zh`)?`安装插件`:`Install plugin`]}),(0,$.jsx)(q,{asChild:!0,children:(0,$.jsxs)(o,{to:`/local-apps`,className:T(`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`,V.transition),children:[(0,$.jsx)(f,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),d.extensionsPage.openLocalApps]})})]})})]}),primary:(0,$.jsx)(E,{asChild:!0,variant:`primary`,className:`h-9 shrink-0`,children:(0,$.jsxs)(o,{to:`/local-apps/new`,"aria-label":d.extensionsPage.createLocalApp,children:[(0,$.jsx)(b,{className:`size-4`,"aria-hidden":!0}),(0,$.jsx)(`span`,{className:`hidden sm:inline`,children:d.extensionsPage.createLocalApp})]})})}),[c,d.capabilitiesHub.moreActions,d.extensionsPage,C,D]);(0,Q.useLayoutEffect)(()=>e?(t?.(W),()=>t?.(null)):(p({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:d.extensionsPage.title})}),end:(0,$.jsx)(ue,{contribution:W})}),()=>m()),[m,e,W,d.extensionsPage.title,t,p]);let re=[{id:`user`,label:d.extensionsPage.tabUser,count:_?void 0:I.length},{id:`marketplace`,label:d.extensionsPage.tabMarketplace},{id:`builtin`,label:d.extensionsPage.tabBuiltin,count:_?void 0: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:T(`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:re,activeTab:C,onChange:w,ariaLabel:d.extensionsPage.extensionsNavAria,tabIdPrefix:`extensions-tab`,panelIdPrefix:`extensions-panel`,className:`flex-wrap`})}),C===`marketplace`?(0,$.jsx)(xe,{query:D}):_?(0,$.jsx)(Le,{}):C===`builtin`&&F.length===0?(0,$.jsx)(ze,{message:d.extensionsPage.emptyBuiltin}):C===`user`&&I.length===0?(0,$.jsx)(ze,{message:d.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:d.extensionsPage.noSearchResults}):(0,$.jsx)(`div`,{className:he,children:B.map(e=>(0,$.jsx)(Ne,{extension:e,copy:d.extensionsPage,onOpen:()=>e.pluginId?n(Y(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)(Fe,{extension:k,copy:d.extensionsPage,onClose:()=>A(null)},k.id):null,j?(0,$.jsx)(ie,{onClose:()=>M(!1)}):null]})}function Ae(e){return e.activationEligible??e.active}function je(e,t){return e.source===`bundled`?t.providerBundled:e.source===`global`?t.providerGlobal:e.source===`workspace`?t.providerWorkspace:t.providerOther}function Me(e,t){let n=Ae(e);return n&&e.active?t.runStateLive:n&&!e.active?t.runStatePendingOn:!n&&e.active?t.runStatePendingOff:t.runStateOff}function Ne(e){let t=(0,me.c)(56),{extension:n,copy:r,onOpen:a}=e,o=l(Pe),c,u;t[0]!==n||t[1]!==o?(u=o.startsWith(`zh`),c=de(n,u),t[0]=n,t[1]=o,t[2]=c,t[3]=u):(c=t[2],u=t[3]);let d=c,m;t[4]===n?m=t[5]:(m=fe(n),t[4]=n,t[5]=m);let h=m,g=n.localizations?.[u?`zh-CN`:`en`]?.description??n.description,_=s(),v=i(),y;t[6]===n?y=t[7]:(y=!!n.pluginId&&pe(n),t[6]=n,t[7]=y);let b=y,x=h?u?`去授权`:`Connect account`:b?u?`开始使用`:`Start using`:u?`管理插件`:`Manage plugin`,S;t[8]!==b||t[9]!==n.pluginId||t[10]!==v||t[11]!==d||t[12]!==_||t[13]!==h||t[14]!==a||t[15]!==u?(S=()=>{b?_(J(d,u)):h&&n.pluginId?_(Y(n.pluginId,`installed`,!0,v.pathname+v.search)):a()},t[8]=b,t[9]=n.pluginId,t[10]=v,t[11]=d,t[12]=_,t[13]=h,t[14]=a,t[15]=u,t[16]=S):S=t[16];let ee=S,C=`${d}, ${r.marketplaceDetailTitle}`,w;t[17]!==a||t[18]!==C?(w=(0,$.jsx)(`button`,{type:`button`,"aria-label":C,onClick:a,className:_e}),t[17]=a,t[18]=C,t[19]=w):w=t[19];let T=n.branding?.iconUrl,E;t[20]===T?E=t[21]:(E=(0,$.jsx)(X,{iconUrl:T,fallback:f}),t[20]=T,t[21]=E);let D;t[22]===d?D=t[23]:(D=(0,$.jsx)(`h2`,{className:`line-clamp-2 break-words font-semibold leading-snug text-fg`,title:d,children:d}),t[22]=d,t[23]=D);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]!==D||t[27]!==O?(k=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-start gap-1.5`,children:[D,O]}),t[26]=D,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=h?`text-amber-700 dark:text-amber-400`:`text-fg-muted`,M=h?u?`需要授权`:`Authorization required`:Ae(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 P;t[34]!==A||t[35]!==N?(P=(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]=P):P=t[36];let F;t[37]!==k||t[38]!==P?(F=(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[k,P]}),t[37]=k,t[38]=P,t[39]=F):F=t[39];let I;t[40]!==x||t[41]!==ee?(I=(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:ee,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:x})}),t[40]=x,t[41]=ee,t[42]=I):I=t[42];let L;t[43]!==F||t[44]!==I||t[45]!==E?(L=(0,$.jsxs)(`div`,{className:`pointer-events-none relative flex items-start gap-3`,children:[E,F,I]}),t[43]=F,t[44]=I,t[45]=E,t[46]=L):L=t[46];let R;t[47]!==r.cardNoDescription||t[48]!==g?(R=g?.trim()||r.cardNoDescription,t[47]=r.cardNoDescription,t[48]=g,t[49]=R):R=t[49];let z;t[50]===R?z=t[51]:(z=(0,$.jsx)(`p`,{className:`pointer-events-none relative mt-3 line-clamp-3 text-sm leading-relaxed text-fg-muted`,children:R}),t[50]=R,t[51]=z);let B;return t[52]!==L||t[53]!==z||t[54]!==w?(B=(0,$.jsxs)(`article`,{className:ge,children:[w,L,z]}),t[52]=L,t[53]=z,t[54]=w,t[55]=B):B=t[55],B}function Pe(e){return e.language}function Fe({extension:e,copy:t,onClose:n}){let{mutate:r}=P(),[i,a]=(0,Q.useState)(null),[s,c]=(0,Q.useState)(null),[l,u]=(0,Q.useState)(!1),f=e.activationEligible===!0,p=(0,Q.useCallback)(async()=>{c(null),u(!1),a(`toggle`);try{let{requiresGatewayRestart:t}=await ae({extensionId:e.id,enabled:!f});await r(`gateway-extensions-list`),I(),u(t)}catch(e){c(e instanceof Error?e.message:t.extensionToggleFailed)}finally{a(null)}},[f,t.extensionToggleFailed,e.id,r]),h=(0,Q.useCallback)(async()=>{if(!(e.source===`bundled`||!window.confirm(t.extensionUninstallConfirm))){c(null),u(!1),a(`uninstall`);try{await Z(e.id),await r(`gateway-extensions-list`),I(),n()}catch(e){c(e instanceof Error?e.message:t.marketplaceUninstallFailed),a(null)}}},[t.extensionUninstallConfirm,t.marketplaceUninstallFailed,e.id,e.source,r,n]),v=e.ui?.contributions?.pages??[],y=e.ui?.contributions?.settingsPanels??[],b=e.ui?.contributions?.chatWidgets??[],S=v.find(e=>e.showInNav)??v[0],C=y[0],D=S?m(e.id,S):null,F=C?`/settings/ext/${e.id}/${C.id}`:e.hasConfigSchema||R(e)?`/settings/ext/${e.id}`:null;return(0,$.jsx)(N,{defaultOpen:!0,onOpenChange:e=>!e&&n(),children:(0,$.jsxs)(A,{children:[(0,$.jsx)(O,{className:`xopc-dialog-overlay fixed inset-0 z-[130] bg-scrim`}),(0,$.jsxs)(j,{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)(d,{className:`size-5`})}),(0,$.jsx)(M,{className:`min-w-0 flex-1 truncate text-center text-sm font-semibold text-fg`,children:t.detailTitle}),(0,$.jsxs)(k,{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)(w,{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,` `,je(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:Me(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)(E,{type:`button`,variant:`secondary`,disabled:i!==null,onClick:()=>void p(),className:`shrink-0 py-1.5 text-xs`,children:i===`toggle`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(_,{className:`mr-1.5 size-3.5 shrink-0 animate-spin`,"aria-hidden":!0}),t.builtinToggleBusy]}):f?t.builtinToggleDisable:t.builtinToggleEnable})]}),s?(0,$.jsx)(`p`,{className:`mt-2 text-xs text-rose-600 dark:text-rose-400`,children:s}):null,l?(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)(E,{type:`button`,variant:`ghost`,disabled:i!==null,onClick:()=>void h(),className:`text-danger hover:bg-danger-soft hover:text-danger`,children:[i===`uninstall`?(0,$.jsx)(_,{className:`size-3.5 animate-spin`,"aria-hidden":!0}):(0,$.jsx)(ee,{className:`size-3.5`,"aria-hidden":!0}),t.marketplaceUninstall]})})]}),e.hasUi&&(v.length>0||y.length>0||b.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)(Ie,{template:t.badgePages,count:v.length,hidden:v.length===0}),(0,$.jsx)(Ie,{template:t.badgeSettings,count:y.length,hidden:y.length===0}),(0,$.jsx)(Ie,{template:t.badgeWidgets,count:b.length,hidden:b.length===0})]})]}):null,B(e)&&(D||F)?(0,$.jsxs)(`div`,{className:`mt-6 flex flex-wrap gap-2 border-t border-edge-subtle pt-4`,children:[D?(0,$.jsxs)(o,{to:D,onClick:n,className:T(`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.open]}):null,F?(0,$.jsxs)(o,{to:F,onClick:n,className:T(`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)(x,{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 Ie(e){let t=(0,me.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 Le(){let e=(0,me.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(`div`,{className:he,"aria-busy":`true`,children:Array.from({length:6},Re)}),e[0]=t):t=e[0],t}function Re(e,t){return(0,$.jsx)(D,{className:`h-32 rounded-xl`},t)}function ze(e){let t=(0,me.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{ke 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{l as i,m as a,t as o,u as s}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{l as c,n as l}from"./locale-store-Br7IfbXK.js";import{t as u}from"./messages-ByFlEbsu.js";import{t as d}from"./arrow-left-D880xG-P.js";import{t as f}from"./box-DvYoGszj.js";import{n as p,t as m}from"./extension-paths-DvuaZJuy.js";import{t as h}from"./ellipsis-0k4rZLoy.js";import{t as g}from"./external-link-DjqjBmc3.js";import{t as _}from"./loader-circle-CifKLtgG.js";import{t as v}from"./markdown-view-DrVAMlwc.js";import{t as y}from"./package-wATCyihJ.js";import{t as b}from"./plus-Q2yW6OE7.js";import{t as x}from"./settings-uiTATseT.js";import{t as S}from"./shield-check-BU58siTV.js";import{t as ee}from"./trash-2-DusmjVPV.js";import{t as C}from"./triangle-alert-2JXFNNKU.js";import{t as w}from"./x-B_N4OPjy.js";import{t as T}from"./cn-0WouolD0.js";import{t as E}from"./button-CnRSIP6m.js";import{t as D}from"./skeleton-BI5TyibZ.js";import{a as O,i as k,o as A,r as j,s as M,t as N}from"./dist-DfWfZ9iu.js";import{a as P,i as F}from"./vendor-swr-CdRzEUwF.js";import{o as I}from"./gateway-realtime-BL_Cf0OQ.js";import{i as L,o as R,r as z,s as B}from"./extension-provider-C_uKqJxP.js";import{n as V}from"./interaction-BdhHBbYa.js";import{t as H}from"./page-tabs-oeTY7z3_.js";import{t as U}from"./page-header-store-Du44NIEJ.js";import{r as W}from"./settings-form-draft-Dy10ldo8.js";import{l as G,m as te,o as K,r as q,t as ne}from"./dist-D3lWNSe7.js";import{r as re,t as ie}from"./agent-plugin-dialog-BoHL-b1o.js";import{n as J,t as Y}from"./capability-links-DzQWK1Fh.js";import{t as X}from"./capability-icon-DVoZxEgW.js";import{a as Z,i as ae,n as oe,r as se,t as ce}from"./extension-marketplace-api-DRBszrCR.js";import{n as le,t as ue}from"./capability-header-actions-CTUCuBlW.js";import{n as de,r as fe,t as pe}from"./plugin-presentation-CO5BFDGW.js";var me=n(),he=`grid auto-rows-fr grid-cols-[repeat(auto-fill,minmax(min(100%,18rem),1fr))] items-stretch gap-4`,ge=`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`,_e=`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 ve(e){return e===`builtin`||e===`user`?e:`marketplace`}var $=r();function ye(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 be={debounced:``,detailPkg:null,quickInstallPkg:null,rowBusy:null,actionError:null,restartHint:null};function xe({className:e,query:t}){let n=s(),r=i(),a=l(e=>e.language),o=u(a).extensionsPage,d=c(e=>!!e.conversationId),f=z(),{mutate:m}=P(),[h,g]=(0,Q.useReducer)(W,be),{debounced:v,detailPkg:b,quickInstallPkg:x,rowBusy:S,actionError:C,restartHint:w}=h,E=d?`marketplace-${v}`:null;(0,Q.useEffect)(()=>{let e=window.setTimeout(()=>g({type:`patch`,patch:{debounced:t.trim()}}),300);return()=>window.clearTimeout(e)},[t]);let{data:O,isLoading:k,error:A}=F(E,()=>ce(v),{revalidateOnFocus:!1}),j=(0,Q.useCallback)(()=>{m(`gateway-extensions-list`),I()},[m]),M=(0,Q.useCallback)(async(e,t)=>{g({type:`patch`,patch:{actionError:null,restartHint:null,rowBusy:e}});try{let n=await se({name:e,overwrite:t});j(),n.requiresGatewayRestart&&g({type:`patch`,patch:{restartHint:o.marketplaceRestartHint}})}catch(e){throw g({type:`patch`,patch:{actionError:e instanceof Error?e.message:o.marketplaceInstallFailed}}),e}finally{g({type:`patch`,patch:{rowBusy:null}})}},[o.marketplaceInstallFailed,o.marketplaceRestartHint,j]),N=(0,Q.useCallback)(async e=>{g({type:`patch`,patch:{actionError:null,restartHint:null,rowBusy:e}});try{let t=await Z(e);j(),t.requiresGatewayRestart&&g({type:`patch`,patch:{restartHint:o.marketplaceRestartHint}})}catch(e){throw g({type:`patch`,patch:{actionError:e instanceof Error?e.message:o.marketplaceUninstallFailed}}),e}finally{g({type:`patch`,patch:{rowBusy:null}})}},[o.marketplaceRestartHint,o.marketplaceUninstallFailed,j]),L=O??[];return(0,$.jsxs)(`div`,{className:T(`flex flex-col gap-4`,e),children:[A?(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:A instanceof Error?A.message:o.marketplaceLoadFailed}):null,C?(0,$.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:C}):null,w?(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:w}):null,k&&!O?(0,$.jsx)(`ul`,{className:he,"aria-label":o.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)(D,{className:`size-10 shrink-0 rounded-xl`}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2`,children:[(0,$.jsx)(D,{className:`h-5 w-full`}),(0,$.jsx)(D,{className:`h-3 w-2/3`})]}),(0,$.jsx)(D,{className:`h-9 w-16 shrink-0 rounded-lg`})]}),(0,$.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,$.jsx)(D,{className:`h-4 w-full`}),(0,$.jsx)(D,{className:`h-4 w-full`}),(0,$.jsx)(D,{className:`h-4 w-2/3`})]})]},e))}):(0,$.jsx)(`ul`,{className:he,children:L.length===0?(0,$.jsx)(`li`,{className:`col-span-full text-sm text-fg-muted`,children:o.marketplaceEmpty}):L.map(e=>{let t=ye(f,e.id),i=S===e.id,s=f.find(t=>t.pluginId===e.id||t.provenance?.packageName===e.id),c=e.localizations?.[a.startsWith(`zh`)?`zh-CN`:`en`],l=c?.displayName??e.name,u=c?.description??e.description;return(0,$.jsxs)(`li`,{className:ge,children:[(0,$.jsx)(`button`,{type:`button`,"aria-label":`${l}, ${o.marketplaceDetailTitle}`,onClick:()=>s?.pluginId?n(Y(s.pluginId,`installed`,!1,r.pathname+r.search)):g({type:`patch`,patch:{detailPkg:e.id}}),className:_e}),(0,$.jsxs)(`div`,{className:`pointer-events-none relative flex items-start gap-3`,children:[(0,$.jsx)(X,{iconUrl:e.branding?.iconUrl,fallback:y}),(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:l,children:l}),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:s&&fe(s)?`text-amber-700 dark:text-amber-400`:`text-fg-muted`,children:s&&fe(s)?a.startsWith(`zh`)?`需要授权`:`Authorization required`:o.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:o.marketplaceBuiltin}):t===`user`?(0,$.jsx)($.Fragment,{children:e.packageType===`plugin`?(0,$.jsx)(`button`,{type:`button`,onClick:()=>s?.pluginId&&pe(s)?n(J(l,a.startsWith(`zh`))):s?.pluginId?n(Y(s.pluginId,`installed`,fe(s),r.pathname+r.search)):g({type:`patch`,patch:{detailPkg:e.id,quickInstallPkg:null}}),className:T(`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:s&&fe(s)?a.startsWith(`zh`)?`去授权`:`Connect account`:s&&pe(s)?a.startsWith(`zh`)?`开始使用`:`Start using`:a.startsWith(`zh`)?`管理插件`:`Manage plugin`}):(0,$.jsxs)(`button`,{type:`button`,disabled:i,onClick:()=>{window.confirm(o.marketplaceUninstallConfirm)&&N(e.id).catch(()=>{})},className:T(`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)(_,{className:`size-3.5 animate-spin`,"aria-hidden":!0}):(0,$.jsx)(ee,{className:`size-3.5`,strokeWidth:2,"aria-hidden":!0}),o.marketplaceUninstall]})}):(0,$.jsx)(`button`,{type:`button`,onClick:()=>g({type:`patch`,patch:(e.packageType,{detailPkg:e.id,quickInstallPkg:null})}),className:T(`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`?a.startsWith(`zh`)?`安装`:`Install`:o.marketplaceReview})})]}),u?(0,$.jsx)(`p`,{className:`pointer-events-none relative mt-3 line-clamp-3 text-sm leading-relaxed text-fg-muted`,children:u}):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)})}),b?(0,$.jsx)(Se,{packageName:b,autoInstall:x===b,copy:o,extensions:f,onClose:()=>g({type:`patch`,patch:{detailPkg:null,quickInstallPkg:null}}),onInstall:M,onUninstall:N}):null]})}function Se(e){let t=(0,me.c)(99),{packageName:n,autoInstall:r,copy:i,extensions:a,onClose:s,onInstall:u,onUninstall:f}=e,[p,m]=(0,Q.useState)(!1),h=l(Oe),[g,y]=(0,Q.useState)(!1),b=c(De)?`ext-mp-detail-${n}`:null,x;t[0]===n?x=t[1]:(x=async()=>oe(n),t[0]=n,t[1]=x);let E;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(E={revalidateOnFocus:!1},t[2]=E):E=t[2];let{data:k,error:P,isLoading:I}=F(b,x,E),L;t[3]!==a||t[4]!==n?(L=ye(a,n),t[3]=a,t[4]=n,t[5]=L):L=t[5];let R=L,z=R===`user`,B=k?.manifest?.permissions,V,H,U,W,G,te,K,q,ne,J,Y,X;if(t[6]!==r||t[7]!==i||t[8]!==k||t[9]!==P||t[10]!==a||t[11]!==R||t[12]!==I||t[13]!==h||t[14]!==s||t[15]!==n||t[16]!==B||t[17]!==g){te=Symbol.for(`react.early_return_sentinel`);bb0:{let e=B&&typeof B==`object`&&!Array.isArray(B)?Object.entries(B):[],o;t[30]!==i||t[31]!==k?(o=k?.readme?.trim()||(k?.description?.trim()?`### ${k.name}\n\n${k.description}`:`*${i.marketplaceNoReadme}*`),t[30]=i,t[31]=k,t[32]=o):o=t[32];let c=o;if(k?.format===`agent-plugin`){let e;if(t[33]!==k||t[34]!==a||t[35]!==n){let r;t[37]!==k||t[38]!==n?(r=e=>e.provenance?.packageName===n||e.pluginId===k.manifest?.name,t[37]=k,t[38]=n,t[39]=r):r=t[39],e=a.find(r),t[33]=k,t[34]=a,t[35]=n,t[36]=e}else e=t[36];let i=`store:${n}`,o;t[40]!==r||t[41]!==k||t[42]!==s||t[43]!==e||t[44]!==i?(o=(0,$.jsx)(ie,{extension:e,initialSource:i,marketplace:k,autoInstall:r,onClose:s}),t[40]=r,t[41]=k,t[42]=s,t[43]=e,t[44]=i,t[45]=o):o=t[45],te=o;break bb0}U=N,W=!0,t[46]===s?G=t[47]:(G=e=>!e&&s(),t[46]=s,t[47]=G),H=A,t[48]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,$.jsx)(O,{className:`xopc-dialog-overlay fixed inset-0 z-[130] bg-scrim`}),t[48]=X):X=t[48],V=j,ne=`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=Ee;let l;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,$.jsx)(d,{className:`size-5`}),t[49]=l):l=t[49];let u;t[50]!==i.detailBack||t[51]!==s?(u=(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:l}),t[50]=i.detailBack,t[51]=s,t[52]=u):u=t[52];let f;t[53]===i.marketplaceDetailTitle?f=t[54]:(f=(0,$.jsx)(M,{className:`min-w-0 flex-1 truncate text-center text-sm font-semibold text-fg`,children:i.marketplaceDetailTitle}),t[53]=i.marketplaceDetailTitle,t[54]=f);let p;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(w,{className:`size-5`}),t[55]=p):p=t[55];let m;t[56]!==i.detailClose||t[57]!==s?(m=(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:p}),t[56]=i.detailClose,t[57]=s,t[58]=m):m=t[58],t[59]!==u||t[60]!==f||t[61]!==m?(Y=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3`,children:[u,f,m]}),t[59]=u,t[60]=f,t[61]=m,t[62]=Y):Y=t[62],K=`min-h-0 flex-1 overflow-y-auto p-5`,q=I&&!k?(0,$.jsxs)(`div`,{className:`space-y-4`,"aria-label":i.marketplaceLoading,children:[(0,$.jsx)(D,{className:`h-6 w-48`}),(0,$.jsx)(D,{className:`h-4 w-28`}),(0,$.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,$.jsx)(D,{className:`h-12`}),(0,$.jsx)(D,{className:`h-12`})]}),(0,$.jsx)(D,{className:`h-28 w-full`}),(0,$.jsx)(D,{className:`h-36 w-full`})]}):P?(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:P instanceof Error?P.message:i.marketplaceLoadFailed})]}):k?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`h3`,{className:`text-lg font-semibold text-fg`,children:k.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:k.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:k.author.username})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`font-medium text-fg`,children:i.marketplaceVersion}),(0,$.jsx)(`dd`,{children:k.latestVersion.version})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`font-medium text-fg`,children:i.marketplaceDownloads}),(0,$.jsx)(`dd`,{children:k.downloads})]})]}),(0,$.jsx)(re,{data:k,zh:h===`zh`}),R===`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:[k.installability.available?(0,$.jsx)(S,{className:`mt-0.5 size-5 shrink-0 text-emerald-600 dark:text-emerald-400`,"aria-hidden":!0}):(0,$.jsx)(C,{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:k.installability.available?i.marketplaceRiskTitle:i.marketplaceUnavailableTitle}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-fg-muted`,children:k.installability.available?i.marketplaceCodeRisk:k.installability.reason??i.marketplaceUnavailableBody})]})]}),k.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:k.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(Te)}):(0,$.jsx)(`p`,{className:`mt-1`,children:i.marketplacePermissionsNone})]}),(k.packageSummary?.lifecycleScripts.length??0)>0?(0,$.jsxs)(`p`,{className:`text-xs leading-relaxed text-amber-700 dark:text-amber-300`,children:[i.marketplaceLifecycleScripts,`: `,k.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=>y(e.target.checked),className:`mt-0.5 size-4 rounded border-edge accent-[var(--color-accent)]`}),(0,$.jsx)(`span`,{children:i.marketplaceRiskConfirm})]})]}):null]}),k.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)(v,{content:c})})]}):null}t[6]=r,t[7]=i,t[8]=k,t[9]=P,t[10]=a,t[11]=R,t[12]=I,t[13]=h,t[14]=s,t[15]=n,t[16]=B,t[17]=g,t[18]=V,t[19]=H,t[20]=U,t[21]=W,t[22]=G,t[23]=te,t[24]=K,t[25]=q,t[26]=ne,t[27]=J,t[28]=Y,t[29]=X}else V=t[18],H=t[19],U=t[20],W=t[21],G=t[22],te=t[23],K=t[24],q=t[25],ne=t[26],J=t[27],Y=t[28],X=t[29];if(te!==Symbol.for(`react.early_return_sentinel`))return te;let Z;t[63]!==K||t[64]!==q?(Z=(0,$.jsx)(`div`,{className:K,children:q}),t[63]=K,t[64]=q,t[65]=Z):Z=t[65];let ae;t[66]!==p||t[67]!==i.marketplaceBuiltinGoBuiltin||t[68]!==i.marketplaceBuiltinManageHint||t[69]!==i.marketplaceInstall||t[70]!==i.marketplaceReinstall||t[71]!==i.marketplaceReinstallConfirm||t[72]!==i.marketplaceUninstall||t[73]!==i.marketplaceUninstallConfirm||t[74]!==k||t[75]!==R||t[76]!==s||t[77]!==u||t[78]!==f||t[79]!==n||t[80]!==g||t[81]!==z?(ae=k?(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:R===`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)(o,{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||!k.installability.available||!g,onClick:()=>{z&&!window.confirm(i.marketplaceReinstallConfirm)||(m(!0),u(n,z).catch(we).finally(()=>m(!1)))},className:T(`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)(_,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,z?i.marketplaceReinstall:i.marketplaceInstall]}),z?(0,$.jsxs)(`button`,{type:`button`,disabled:p,onClick:()=>{window.confirm(i.marketplaceUninstallConfirm)&&(m(!0),f(n).then(()=>s()).catch(Ce).finally(()=>m(!1)))},className:T(`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)(ee,{className:`size-4 shrink-0`,"aria-hidden":!0}),i.marketplaceUninstall]}):null]})}):null,t[66]=p,t[67]=i.marketplaceBuiltinGoBuiltin,t[68]=i.marketplaceBuiltinManageHint,t[69]=i.marketplaceInstall,t[70]=i.marketplaceReinstall,t[71]=i.marketplaceReinstallConfirm,t[72]=i.marketplaceUninstall,t[73]=i.marketplaceUninstallConfirm,t[74]=k,t[75]=R,t[76]=s,t[77]=u,t[78]=f,t[79]=n,t[80]=g,t[81]=z,t[82]=ae):ae=t[82];let se;t[83]!==V||t[84]!==Z||t[85]!==ae||t[86]!==ne||t[87]!==J||t[88]!==Y?(se=(0,$.jsxs)(V,{className:ne,onOpenAutoFocus:J,children:[Y,Z,ae]}),t[83]=V,t[84]=Z,t[85]=ae,t[86]=ne,t[87]=J,t[88]=Y,t[89]=se):se=t[89];let ce;t[90]!==H||t[91]!==se||t[92]!==X?(ce=(0,$.jsxs)(H,{children:[X,se]}),t[90]=H,t[91]=se,t[92]=X,t[93]=ce):ce=t[93];let le;return t[94]!==U||t[95]!==W||t[96]!==G||t[97]!==ce?(le=(0,$.jsx)(U,{defaultOpen:W,onOpenChange:G,children:ce}),t[94]=U,t[95]=W,t[96]=G,t[97]=ce,t[98]=le):le=t[98],le}function Ce(){}function we(){}function Te(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 Ee(e){return e.preventDefault()}function De(e){return!!e.conversationId}function Oe(e){return e.language}function ke({embedded:e=!1,onHeaderActionChange:t}){let n=s(),r=i(),c=l(e=>e.language),d=u(c),p=U(e=>e.setPageHeader),m=U(e=>e.clearPageHeader),g=z(),_=L(),[v,y]=a(),x=ve(v.get(`tab`)??(g.some(e=>e.source!==`bundled`)?`user`:null)),S=(0,Q.useRef)(!1),ee=v.get(`q`)??``,[C,w]=(0,Q.useState)(x),[D,O]=(0,Q.useState)(ee),[k,A]=(0,Q.useState)(null),[j,M]=(0,Q.useState)(!1),N=v.toString(),P=(0,Q.useRef)(N);if(P.current!==N){P.current=N;let e=ve(v.get(`tab`)),t=v.get(`q`)??``;w(t=>t===e?t:e),O(e=>e===t?e:t)}(0,Q.useEffect)(()=>{y(e=>{let t=new URLSearchParams(e),n=D.trim();return n?t.set(`q`,n):t.delete(`q`),C===`marketplace`?t.delete(`tab`):t.set(`tab`,C),t.toString()===e.toString()?e:t},{replace:!0})},[C,D,y]);let F=(0,Q.useMemo)(()=>g.filter(e=>e.source===`bundled`),[g]),I=(0,Q.useMemo)(()=>g.filter(e=>e.source!==`bundled`),[g]);(0,Q.useEffect)(()=>{_||S.current||(S.current=!0,!v.has(`tab`)&&I.length&&w(`user`))},[_,v,I.length]);let R=C===`builtin`?F:I,B=(0,Q.useMemo)(()=>{let e=D.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,c):e.hasUi?-1:1)},[R,D,c]);(0,Q.useEffect)(()=>{A(e=>{if(!e)return e;let t=g.find(t=>t.id===e.id);return t?Ae(e)===Ae(t)&&e.active===t.active&&JSON.stringify(e)===JSON.stringify(t)?e:t:null})},[g]);let W=(0,Q.useMemo)(()=>({searchLabel:C===`marketplace`?d.extensionsPage.marketplaceSearchPlaceholder:d.extensionsPage.searchPlaceholder,search:(0,$.jsx)(le,{value:D,onChange:O,placeholder:C===`marketplace`?d.extensionsPage.marketplaceSearchPlaceholder:d.extensionsPage.searchPlaceholder}),overflow:(0,$.jsxs)(G,{children:[(0,$.jsx)(te,{asChild:!0,children:(0,$.jsx)(E,{variant:`secondary`,className:`size-9 shrink-0 p-0`,"aria-label":d.capabilitiesHub.moreActions,title:d.capabilitiesHub.moreActions,children:(0,$.jsx)(h,{className:`size-4`,"aria-hidden":!0})})}),(0,$.jsx)(K,{children:(0,$.jsxs)(ne,{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)(q,{className:T(`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`,V.transition),onSelect:()=>M(!0),children:[(0,$.jsx)(b,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),c.startsWith(`zh`)?`安装插件`:`Install plugin`]}),(0,$.jsx)(q,{asChild:!0,children:(0,$.jsxs)(o,{to:`/local-apps`,className:T(`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`,V.transition),children:[(0,$.jsx)(f,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),d.extensionsPage.openLocalApps]})})]})})]}),primary:(0,$.jsx)(E,{asChild:!0,variant:`primary`,className:`h-9 shrink-0`,children:(0,$.jsxs)(o,{to:`/local-apps/new`,"aria-label":d.extensionsPage.createLocalApp,children:[(0,$.jsx)(b,{className:`size-4`,"aria-hidden":!0}),(0,$.jsx)(`span`,{className:`hidden sm:inline`,children:d.extensionsPage.createLocalApp})]})})}),[c,d.capabilitiesHub.moreActions,d.extensionsPage,C,D]);(0,Q.useLayoutEffect)(()=>e?(t?.(W),()=>t?.(null)):(p({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:d.extensionsPage.title})}),end:(0,$.jsx)(ue,{contribution:W})}),()=>m()),[m,e,W,d.extensionsPage.title,t,p]);let re=[{id:`user`,label:d.extensionsPage.tabUser,count:_?void 0:I.length},{id:`marketplace`,label:d.extensionsPage.tabMarketplace},{id:`builtin`,label:d.extensionsPage.tabBuiltin,count:_?void 0: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:T(`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:re,activeTab:C,onChange:w,ariaLabel:d.extensionsPage.extensionsNavAria,tabIdPrefix:`extensions-tab`,panelIdPrefix:`extensions-panel`,className:`flex-wrap`})}),C===`marketplace`?(0,$.jsx)(xe,{query:D}):_?(0,$.jsx)(Le,{}):C===`builtin`&&F.length===0?(0,$.jsx)(ze,{message:d.extensionsPage.emptyBuiltin}):C===`user`&&I.length===0?(0,$.jsx)(ze,{message:d.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:d.extensionsPage.noSearchResults}):(0,$.jsx)(`div`,{className:he,children:B.map(e=>(0,$.jsx)(Ne,{extension:e,copy:d.extensionsPage,onOpen:()=>e.pluginId?n(Y(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)(Fe,{extension:k,copy:d.extensionsPage,onClose:()=>A(null)},k.id):null,j?(0,$.jsx)(ie,{onClose:()=>M(!1)}):null]})}function Ae(e){return e.activationEligible??e.active}function je(e,t){return e.source===`bundled`?t.providerBundled:e.source===`global`?t.providerGlobal:e.source===`workspace`?t.providerWorkspace:t.providerOther}function Me(e,t){let n=Ae(e);return n&&e.active?t.runStateLive:n&&!e.active?t.runStatePendingOn:!n&&e.active?t.runStatePendingOff:t.runStateOff}function Ne(e){let t=(0,me.c)(56),{extension:n,copy:r,onOpen:a}=e,o=l(Pe),c,u;t[0]!==n||t[1]!==o?(u=o.startsWith(`zh`),c=de(n,u),t[0]=n,t[1]=o,t[2]=c,t[3]=u):(c=t[2],u=t[3]);let d=c,m;t[4]===n?m=t[5]:(m=fe(n),t[4]=n,t[5]=m);let h=m,g=n.localizations?.[u?`zh-CN`:`en`]?.description??n.description,_=s(),v=i(),y;t[6]===n?y=t[7]:(y=!!n.pluginId&&pe(n),t[6]=n,t[7]=y);let b=y,x=h?u?`去授权`:`Connect account`:b?u?`开始使用`:`Start using`:u?`管理插件`:`Manage plugin`,S;t[8]!==b||t[9]!==n.pluginId||t[10]!==v||t[11]!==d||t[12]!==_||t[13]!==h||t[14]!==a||t[15]!==u?(S=()=>{b?_(J(d,u)):h&&n.pluginId?_(Y(n.pluginId,`installed`,!0,v.pathname+v.search)):a()},t[8]=b,t[9]=n.pluginId,t[10]=v,t[11]=d,t[12]=_,t[13]=h,t[14]=a,t[15]=u,t[16]=S):S=t[16];let ee=S,C=`${d}, ${r.marketplaceDetailTitle}`,w;t[17]!==a||t[18]!==C?(w=(0,$.jsx)(`button`,{type:`button`,"aria-label":C,onClick:a,className:_e}),t[17]=a,t[18]=C,t[19]=w):w=t[19];let T=n.branding?.iconUrl,E;t[20]===T?E=t[21]:(E=(0,$.jsx)(X,{iconUrl:T,fallback:f}),t[20]=T,t[21]=E);let D;t[22]===d?D=t[23]:(D=(0,$.jsx)(`h2`,{className:`line-clamp-2 break-words font-semibold leading-snug text-fg`,title:d,children:d}),t[22]=d,t[23]=D);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]!==D||t[27]!==O?(k=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-start gap-1.5`,children:[D,O]}),t[26]=D,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=h?`text-amber-700 dark:text-amber-400`:`text-fg-muted`,M=h?u?`需要授权`:`Authorization required`:Ae(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 P;t[34]!==A||t[35]!==N?(P=(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]=P):P=t[36];let F;t[37]!==k||t[38]!==P?(F=(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[k,P]}),t[37]=k,t[38]=P,t[39]=F):F=t[39];let I;t[40]!==x||t[41]!==ee?(I=(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:ee,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:x})}),t[40]=x,t[41]=ee,t[42]=I):I=t[42];let L;t[43]!==F||t[44]!==I||t[45]!==E?(L=(0,$.jsxs)(`div`,{className:`pointer-events-none relative flex items-start gap-3`,children:[E,F,I]}),t[43]=F,t[44]=I,t[45]=E,t[46]=L):L=t[46];let R;t[47]!==r.cardNoDescription||t[48]!==g?(R=g?.trim()||r.cardNoDescription,t[47]=r.cardNoDescription,t[48]=g,t[49]=R):R=t[49];let z;t[50]===R?z=t[51]:(z=(0,$.jsx)(`p`,{className:`pointer-events-none relative mt-3 line-clamp-3 text-sm leading-relaxed text-fg-muted`,children:R}),t[50]=R,t[51]=z);let B;return t[52]!==L||t[53]!==z||t[54]!==w?(B=(0,$.jsxs)(`article`,{className:ge,children:[w,L,z]}),t[52]=L,t[53]=z,t[54]=w,t[55]=B):B=t[55],B}function Pe(e){return e.language}function Fe({extension:e,copy:t,onClose:n}){let{mutate:r}=P(),[i,a]=(0,Q.useState)(null),[s,c]=(0,Q.useState)(null),[l,u]=(0,Q.useState)(!1),f=e.activationEligible===!0,p=(0,Q.useCallback)(async()=>{c(null),u(!1),a(`toggle`);try{let{requiresGatewayRestart:t}=await ae({extensionId:e.id,enabled:!f});await r(`gateway-extensions-list`),I(),u(t)}catch(e){c(e instanceof Error?e.message:t.extensionToggleFailed)}finally{a(null)}},[f,t.extensionToggleFailed,e.id,r]),h=(0,Q.useCallback)(async()=>{if(!(e.source===`bundled`||!window.confirm(t.extensionUninstallConfirm))){c(null),u(!1),a(`uninstall`);try{await Z(e.id),await r(`gateway-extensions-list`),I(),n()}catch(e){c(e instanceof Error?e.message:t.marketplaceUninstallFailed),a(null)}}},[t.extensionUninstallConfirm,t.marketplaceUninstallFailed,e.id,e.source,r,n]),v=e.ui?.contributions?.pages??[],y=e.ui?.contributions?.settingsPanels??[],b=e.ui?.contributions?.chatWidgets??[],S=v.find(e=>e.showInNav)??v[0],C=y[0],D=S?m(e.id,S):null,F=C?`/settings/ext/${e.id}/${C.id}`:e.hasConfigSchema||R(e)?`/settings/ext/${e.id}`:null;return(0,$.jsx)(N,{defaultOpen:!0,onOpenChange:e=>!e&&n(),children:(0,$.jsxs)(A,{children:[(0,$.jsx)(O,{className:`xopc-dialog-overlay fixed inset-0 z-[130] bg-scrim`}),(0,$.jsxs)(j,{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)(d,{className:`size-5`})}),(0,$.jsx)(M,{className:`min-w-0 flex-1 truncate text-center text-sm font-semibold text-fg`,children:t.detailTitle}),(0,$.jsxs)(k,{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)(w,{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,` `,je(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:Me(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)(E,{type:`button`,variant:`secondary`,disabled:i!==null,onClick:()=>void p(),className:`shrink-0 py-1.5 text-xs`,children:i===`toggle`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(_,{className:`mr-1.5 size-3.5 shrink-0 animate-spin`,"aria-hidden":!0}),t.builtinToggleBusy]}):f?t.builtinToggleDisable:t.builtinToggleEnable})]}),s?(0,$.jsx)(`p`,{className:`mt-2 text-xs text-rose-600 dark:text-rose-400`,children:s}):null,l?(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)(E,{type:`button`,variant:`ghost`,disabled:i!==null,onClick:()=>void h(),className:`text-danger hover:bg-danger-soft hover:text-danger`,children:[i===`uninstall`?(0,$.jsx)(_,{className:`size-3.5 animate-spin`,"aria-hidden":!0}):(0,$.jsx)(ee,{className:`size-3.5`,"aria-hidden":!0}),t.marketplaceUninstall]})})]}),e.hasUi&&(v.length>0||y.length>0||b.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)(Ie,{template:t.badgePages,count:v.length,hidden:v.length===0}),(0,$.jsx)(Ie,{template:t.badgeSettings,count:y.length,hidden:y.length===0}),(0,$.jsx)(Ie,{template:t.badgeWidgets,count:b.length,hidden:b.length===0})]})]}):null,B(e)&&(D||F)?(0,$.jsxs)(`div`,{className:`mt-6 flex flex-wrap gap-2 border-t border-edge-subtle pt-4`,children:[D?(0,$.jsxs)(o,{to:D,onClick:n,className:T(`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.open]}):null,F?(0,$.jsxs)(o,{to:F,onClick:n,className:T(`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)(x,{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 Ie(e){let t=(0,me.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 Le(){let e=(0,me.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(`div`,{className:he,"aria-busy":`true`,children:Array.from({length:6},Re)}),e[0]=t):t=e[0],t}function Re(e,t){return(0,$.jsx)(D,{className:`h-32 rounded-xl`},t)}function ze(e){let t=(0,me.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{ke as ExtensionsPage};
|
package/dist/gateway/static/root/assets/{archive-plugin-DjboG3kA.js → archive-plugin-BCQnOkV8.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-
|
|
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-ByFlEbsu.js";import{t as a}from"./jszip.min-Dj17eJqX.js";import{t as o}from"./preview-open-alternatives-CY_hjK4b.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};
|
package/dist/gateway/static/root/assets/{automation-api-CZqL9l_d.js → automation-api-hRsGx-qe.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,o as t}from"./locale-store-
|
|
1
|
+
import{i as e,o as t}from"./locale-store-Br7IfbXK.js";var n={get:n=>t(e(`/api/automations/${encodeURIComponent(n)}`)),configuration:n=>t(e(`/api/automations/configuration-conversations/${encodeURIComponent(n)}`)),openConfiguration:n=>t(e(`/api/automations/configuration-conversations`),{method:`POST`,body:JSON.stringify(n)}),tasks:()=>t(e(`/api/tasks?limit=200`)),list:n=>{let r=new URLSearchParams;n?.projectId&&r.set(`projectId`,n.projectId);let i=r.toString();return t(e(`/api/automations${i?`?${i}`:``}`))},metrics:()=>t(e(`/api/automations/metrics`)),draft:(n,r=crypto.randomUUID())=>t(e(`/api/automations/draft`),{method:`POST`,headers:{"Idempotency-Key":r},body:JSON.stringify(n)}),simulate:n=>t(e(`/api/automations/simulate`),{method:`POST`,body:JSON.stringify(n)}),create:n=>t(e(`/api/automations`),{method:`POST`,body:JSON.stringify(n)}),update:(n,r)=>t(e(`/api/automations/${encodeURIComponent(n)}`),{method:`PATCH`,body:JSON.stringify(r)}),remove:n=>t(e(`/api/automations/${encodeURIComponent(n)}`),{method:`DELETE`}),runNow:n=>t(e(`/api/automations/${encodeURIComponent(n)}/run`),{method:`POST`}),pause:n=>t(e(`/api/automations/${encodeURIComponent(n)}/pause`),{method:`POST`}),resume:n=>t(e(`/api/automations/${encodeURIComponent(n)}/resume`),{method:`POST`}),runs:(n=50,r,i)=>{let a=new URLSearchParams({limit:String(n)});return r&&a.set(`automationId`,r),!r&&i?.projectId&&a.set(`projectId`,i.projectId),t(e(`/api/automation-runs?${a.toString()}`))},productEventRuns:n=>{let r=new URLSearchParams({eventType:n.eventType,limit:String(n.limit??5)});return n.source&&r.set(`source`,n.source),n.payloadKey&&r.set(`payloadKey`,n.payloadKey),n.payloadValue!==void 0&&r.set(`payloadValue`,n.payloadValue),t(e(`/api/automation-runs/product-events?${r.toString()}`))},events:(n={})=>{let r=new URLSearchParams({limit:String(n.limit??50)});return n.type&&r.set(`type`,n.type),n.source&&r.set(`source`,n.source),t(e(`/api/automation-events?${r.toString()}`))},deliveries:(n={})=>{let r=new URLSearchParams({limit:String(n.limit??50)});return n.runId&&r.set(`runId`,n.runId),n.status&&r.set(`status`,n.status),t(e(`/api/automation-deliveries?${r.toString()}`))},getRun:n=>t(e(`/api/automation-runs/${encodeURIComponent(n)}`)),runEvents:n=>t(e(`/api/automation-runs/${encodeURIComponent(n)}/events`)),rerun:n=>t(e(`/api/automation-runs/${encodeURIComponent(n)}/rerun`),{method:`POST`}),repairDraft:(n,r,i=crypto.randomUUID())=>t(e(`/api/automation-runs/${encodeURIComponent(n)}/repair-draft`),{method:`POST`,headers:{"Idempotency-Key":i},body:JSON.stringify(r)}),cancelRun:n=>t(e(`/api/automation-runs/${encodeURIComponent(n)}/cancel`),{method:`POST`}),markRunRead:n=>t(e(`/api/automation-runs/${encodeURIComponent(n)}/read`),{method:`POST`}),markAllRunsRead:n=>t(e(`/api/automation-runs/read-all${n?`?projectId=${encodeURIComponent(n)}`:``}`),{method:`POST`})};export{n as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./vendor-react-BOUWij0V.js";import{i as n}from"./vendor-swr-CdRzEUwF.js";import{t as r}from"./automation-api-
|
|
1
|
+
import{n as e,t}from"./vendor-react-BOUWij0V.js";import{i as n}from"./vendor-swr-CdRzEUwF.js";import{t as r}from"./automation-api-hRsGx-qe.js";var i=e(),a=t();function o(e,t){let n=t===`zh`;return e.some(e=>e.status===`dead_letter`)?n?`结果已保存,部分通知未能送达。可通过对话排查后重新发送,无需重跑任务。`:`Your result is saved, but a notification could not be sent. Ask in chat to retry delivery without rerunning the task.`:e.some(e=>e.status===`retrying`)?n?`结果已保存,通知正在重试。`:`Your result is saved. Notification delivery is retrying.`:e.some(e=>e.status===`pending`||e.status===`delivering`)?n?`结果已保存,正在发送通知。`:`Your result is saved. Sending notifications.`:null}function s(e){let t=(0,i.c)(11),{runId:s,language:c}=e,l,u;t[0]===s?(l=t[1],u=t[2]):(l=[`automation-result-deliveries`,s],u=()=>r.deliveries({runId:s}),t[0]=s,t[1]=l,t[2]=u);let d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d={refreshInterval:5e3},t[3]=d):d=t[3];let{data:f,error:p}=n(l,u,d),m;t[4]!==f||t[5]!==c?(m=f?o(f.items,c):null,t[4]=f,t[5]=c,t[6]=m):m=t[6];let h=m,g;return t[7]!==p||t[8]!==h||t[9]!==c?(g=h?(0,a.jsx)(`p`,{role:`status`,className:`mt-2 text-xs leading-5 text-fg-muted`,children:h}):p?(0,a.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:c===`zh`?`结果已保存,暂时无法确认通知状态。`:`Your result is saved. Notification status is temporarily unavailable.`}):null,t[7]=p,t[8]=h,t[9]=c,t[10]=g):g=t[10],g}function c(e,t){let n=t===`zh`;return e.error?.includes(`The selected model is unavailable:`)?n?`所选模型不可用,请更换模型或恢复默认模型后重试。`:`The selected model is unavailable. Choose another model or use the default.`:e.error?.startsWith(`Execution assistant is unavailable:`)?n?`执行助手暂不可用,请选择其他助手后重试。`:`The execution assistant is unavailable. Choose another assistant.`:e.status===`timeout`?n?`任务超时未完成,可以通过对话调整后重试。`:`The task timed out. Adjust it in chat and try again.`:e.error??(n?`这次运行未完成,可以通过对话排查原因。`:`This run did not finish. Ask in chat to investigate.`)}function l(e,t){return t.reduce((t,n)=>n.automationId===e&&(!t||n.createdAtMs>t.createdAtMs)?n:t,void 0)}function u(e,t){let n=l(e.id,t),r=!!(e.state.lastRunAtMs&&(!n||e.state.lastRunAtMs>n.createdAtMs)),i=r?e.state.lastRunStatus:n?.status??e.state.lastRunStatus;return i!==`failed`&&i!==`timeout`?null:`${i}:${(r?e.state.lastRunAtMs:n?.createdAtMs??e.state.lastRunAtMs)??`unknown`}`}function d(e,t){return u(e,t)!==null}export{s as a,l as i,d as n,c as r,u as t};
|