@xopcai/xopc 0.0.451 → 0.0.454
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-OMq1GnqB.js → activity-store-BKH-qNPt.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-CIoE-FJR.js → agent-avatar-dicebear-DY6IWy0_.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-display-kPb6idGG.js → agent-avatar-display-tnAtQOAZ.js} +2 -2
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-vKUDGEU6.js → agent-defaults-settings-panel-BLQ2N_dY.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-x7guoCvz.js → agent-plugin-dialog-Bfsm4GOs.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-BbwFcl87.js → agents-CDNiLv0W.js} +3 -3
- package/dist/gateway/static/root/assets/{agents-admin-api-tXB8Aj5K.js → agents-admin-api-DGZsm8U4.js} +1 -1
- package/dist/gateway/static/root/assets/{api-ixudT_21.js → api-Bbj5k-7e.js} +1 -1
- package/dist/gateway/static/root/assets/api-BhipC15e.js +1 -0
- package/dist/gateway/static/root/assets/{app-link-CdD448kS.js → app-link-CCZ-LmVT.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-nuDfyfZ5.js → app-management-settings-panel-fwhXHKxt.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-D4oON26V.js → appearance-settings-BHkl-vFO.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-BM1BfXzo.js → apps-page-DtCWwdsK.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-mKjfC6Sk.js → archive-plugin-B9xaxa7V.js} +1 -1
- package/dist/gateway/static/root/assets/arrow-up-right-T72JbQ1Q.js +1 -0
- package/dist/gateway/static/root/assets/{automation-api-C9pjryrT.js → automation-api-BHMjSwcy.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-result-state-uvg7Bi2x.js → automation-result-state-BgAjEoNV.js} +1 -1
- package/dist/gateway/static/root/assets/automation-run-list-D3Eon5C0.js +1 -0
- package/dist/gateway/static/root/assets/{automation-task-card-CXGC8afU.js → automation-task-card-DJRg72t-.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-CwQg9dfM.js → automations-page-DdAzXb7s.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-DhLgFY2T.js → automations-workspace-D0nNat6N.js} +2 -2
- package/dist/gateway/static/root/assets/{binary-plugins-BNPDM14i.js → binary-plugins-CgsjdprR.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-De9UqmMT.js → block-editor-r6vj6dZO.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-B0VB5umC.js → browser-settings-page-APCGT8Yr.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-Cp-rmFMM.js → capabilities-0gYkjdax.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-BtJB4u5C.js → capabilities-BgBwcqvY.js} +1 -1
- package/dist/gateway/static/root/assets/capabilities-page-B1x3TwdV.js +2 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-CZ78ckHR.js +8 -0
- package/dist/gateway/static/root/assets/capability-navigation-QtHJxxW2.js +1 -0
- package/dist/gateway/static/root/assets/{channels-ZJORx-he.js → channels-8Y08v4Q2.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-agents-api-CtuEaDG8.js → chat-agents-api-BRQDNNI5.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-chart-block-ShPQBlNE.js → chat-chart-block-qMGhfeQZ.js} +1 -1
- package/dist/gateway/static/root/assets/chat-page-CSTyfO9c.js +71 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-CvDRfHAZ.js → chat-terminal-dock-0PJ9dURQ.js} +1 -1
- package/dist/gateway/static/root/assets/{command-palette-api-NJTvEF2b.js → command-palette-api-C4U_-rDo.js} +1 -1
- package/dist/gateway/static/root/assets/composer-model-config-control-B9Q40ptH.js +1 -0
- package/dist/gateway/static/root/assets/{composer-notifications-BkezOy9Q.js → composer-notifications-ByuA8h5Z.js} +1 -1
- package/dist/gateway/static/root/assets/{composer-payload-handoff-CEjJusbJ.js → composer-payload-handoff-zr1JDn3p.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-DG8bcw_s.js → computer-settings-page-D2F1quZR.js} +1 -1
- package/dist/gateway/static/root/assets/{confirm-dialog-D7dQJytv.js → confirm-dialog-DrA5mTQp.js} +1 -1
- package/dist/gateway/static/root/assets/connected-providers-grid-CgULhOBZ.js +1 -0
- package/dist/gateway/static/root/assets/{connection-usage-guide-f55PDAbb.js → connection-usage-guide-DkDsHm_l.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-Ca09FIBW.js → connector-service-page-1AcvESmp.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-api-dai-YAdK.js → connectors-api-C1OML7OO.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-CMIY0Zj_.js +1 -0
- package/dist/gateway/static/root/assets/{date-picker-C70ICT7u.js → date-picker-D1eFhoMI.js} +1 -1
- package/dist/gateway/static/root/assets/{date-time-picker-Czj5fnsJ.js → date-time-picker-CqplKVk6.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-Dq3OLpPg.js → desktop-pet-UmrjWSq-.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-q4mec6zt.js → desktop-pet-settings-DRRDJMu6.js} +1 -1
- package/dist/gateway/static/root/assets/{dev-view-store-lXnKsRew.js → dev-view-store-CtKJMK52.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-CbUX0iit.js → device-pairing-wizard-C4aSCbqo.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-BRnwhemd.js → directory-picker-path-field-D9U9yfnb.js} +1 -1
- package/dist/gateway/static/root/assets/{discussion-annotation-sync-BnK6Ua7v.js → discussion-annotation-sync-D-eGt1_L.js} +1 -1
- package/dist/gateway/static/root/assets/dist-CY7CS_D3.js +1 -0
- package/dist/gateway/static/root/assets/extension-authoritative-grants-8ONVOjPW.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-Bp2BrJbB.js → extension-debug-page-BTLcC8-r.js} +1 -1
- package/dist/gateway/static/root/assets/extension-iframe-host-D0-OvFV2.js +1 -0
- package/dist/gateway/static/root/assets/{extension-marketplace-api-tk93vJL_.js → extension-marketplace-api-DLRCNlej.js} +1 -1
- package/dist/gateway/static/root/assets/extension-message-router-DboLTCVp.js +1 -0
- package/dist/gateway/static/root/assets/extension-page-CdpI-Plq.js +1 -0
- package/dist/gateway/static/root/assets/extension-provider-DUDaMvQg.js +1 -0
- package/dist/gateway/static/root/assets/{extension-settings-page-BGcZIeHP.js → extension-settings-page-biWCnMGr.js} +1 -1
- package/dist/gateway/static/root/assets/{file-preview-surface-BK2_4mWy.js → file-preview-surface-CnBRiQo8.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-DsXilOaJ.js → gateway-config-swr-BV5fpBSK.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-DopPmAMl.js → gateway-realtime-CIqLQXlm.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-B6T1Xzag.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-restart-eozrXTm7.js → gateway-restart-DBkfCzT5.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-DddUli-p.js → gateway-settings-DTzXUm9f.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-DMQI0ATo.js → gateway-startup-retry-B49N_Ngm.js} +1 -1
- package/dist/gateway/static/root/assets/{global-defaults-api-D7hk1zTj.js → global-defaults-api-DVpxe45P.js} +1 -1
- package/dist/gateway/static/root/assets/{home-page-C8oVgxQg.js → home-page-DvaxBrjG.js} +2 -2
- package/dist/gateway/static/root/assets/{image-generation-api-BCbvDDH_.js → image-generation-api-CAKYslID.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-B9LF_2fO.js → imports-page-C2KmQJ2H.js} +1 -1
- package/dist/gateway/static/root/assets/index-B49yIcMR.css +1 -0
- package/dist/gateway/static/root/assets/index-BpzvsoS1.js +11 -0
- package/dist/gateway/static/root/assets/{install-connector-dialog-DT32t-66.js → install-connector-dialog-CmNvZt8M.js} +1 -1
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-DDwoBK8g.js → keyboard-shortcuts-settings-syG2KRr2.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-DGA4EHGm.js +1 -0
- package/dist/gateway/static/root/assets/local-apps-CB-MZAaL.js +1 -0
- package/dist/gateway/static/root/assets/{local-apps-page-qzxr3c8Y.js → local-apps-page-I0O2ybpp.js} +1 -1
- package/dist/gateway/static/root/assets/{local-session-drafts-BU3FXj_X.js → local-session-drafts-DsPDloiq.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-DTUQ0JiK.js → locale-store-D3c8DIm-.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-u9FTZaTh.js +2 -0
- package/dist/gateway/static/root/assets/{management-api-C6mCD0mZ.js → management-api-uxRxRX-6.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-C4BKD-_b.js → management-settings-BCbDfM7f.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-DHjn1-ML.js → markdown-view-ohhExTMC.js} +1 -1
- package/dist/gateway/static/root/assets/{mcp-conversation-setup-page-ClgMvru5.js → mcp-conversation-setup-page-382BGqQC.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-8E2KZQym.js → media-plugins-B5wtLz3Z.js} +1 -1
- package/dist/gateway/static/root/assets/messages-DPLud9GK.js +3 -0
- package/dist/gateway/static/root/assets/{model-selector-CJY9LRsl.js → model-selector-CoKcq0AZ.js} +1 -1
- package/dist/gateway/static/root/assets/{models-hub-cache-BTs8jhgq.js → models-hub-cache-CtooMAQW.js} +1 -1
- package/dist/gateway/static/root/assets/{note-detail-panel-DiCfpcZd.js → note-detail-panel-DiGQtSD0.js} +3 -3
- package/dist/gateway/static/root/assets/note-image-lightbox-Ds4M9fJJ.js +1 -0
- package/dist/gateway/static/root/assets/{notes-api-BnaeXy22.js → notes-api-Cvet94d8.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-B_vTBmyx.js → notes-page-DwlmKweX.js} +2 -2
- package/dist/gateway/static/root/assets/{oauth-api-BZ67vxsq.js → oauth-api-BHp5dVNh.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-provider-connect-CZP15znW.js → oauth-provider-connect-cvxtmf3C.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-capture-button-TpjRHhUt.js → page-context-capture-button-BwsK2uDe.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-draft-BbUpxlgV.js → page-context-draft-ieK9IN3R.js} +1 -1
- package/dist/gateway/static/root/assets/page-header-store-Xe8CP_4a.js +1 -0
- package/dist/gateway/static/root/assets/personal-avatar-BZSC0BLP.js +1 -0
- package/dist/gateway/static/root/assets/personal-page-CbiD8Wn7.js +1 -0
- package/dist/gateway/static/root/assets/personal-profile-settings-KvdNnaNv.js +1 -0
- package/dist/gateway/static/root/assets/personal-settings-panel-_cxSzWsN.js +1 -0
- package/dist/gateway/static/root/assets/phone-DdhTnt6X.js +1 -0
- package/dist/gateway/static/root/assets/{phone-dependencies-card-ChRrViSc.js → phone-dependencies-card-C2OWtG2B.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-connection-DmswEWqx.js → phone-model-connection-CqmafRhr.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-picker-CvuOhQpk.js → phone-model-picker-BwYQtl_5.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-settings-page-2hZ68I47.js → phone-settings-page-CPteZZWu.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-workspace-store-BMvxfZ3g.js → phone-workspace-store-ReUEjG9m.js} +1 -1
- package/dist/gateway/static/root/assets/{plugin-details-dialog-qvdi41L2.js → plugin-details-dialog-BlNVtbEU.js} +1 -1
- package/dist/gateway/static/root/assets/{preference-select-fields-RDatqlhG.js → preference-select-fields-BbA-g7Zq.js} +1 -1
- package/dist/gateway/static/root/assets/{product-automation-feedback-Bj9ZsasT.js → product-automation-feedback-DcPY76PG.js} +1 -1
- package/dist/gateway/static/root/assets/{product-delivery-DRyD9_Xq.js → product-delivery-2Ks17_OH.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-CzXmn2MX.js → product-open-page-BBJ7glAm.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-Beg0t4GW.js → product-preview-content-UTOSc_ii.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-modal-5ulFfVzf.js → product-preview-modal-Q1RZqeMo.js} +2 -2
- package/dist/gateway/static/root/assets/{project-detail-page-8bnYqXLJ.js → project-detail-page-BlrtsEZK.js} +2 -2
- package/dist/gateway/static/root/assets/{project-understanding-CXf7wjwt.js → project-understanding-B35f5MkG.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-CyA6fCPg.js → projects-page-CBH-sHOU.js} +1 -1
- package/dist/gateway/static/root/assets/{providers-api-DE7kdeXc.js → providers-api-BSmKlQ8K.js} +1 -1
- package/dist/gateway/static/root/assets/{recording-upload-BZvpuPZT.js → recording-upload-P1WcsdEY.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-C_8-f85U.js → registry-api-DnVlwJ6M.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-Daxdjqs9.js → remote-access-hub-CVEj3p0J.js} +1 -1
- package/dist/gateway/static/root/assets/{resource-unavailable-khPb8zb8.js → resource-unavailable-B_S1dFze.js} +1 -1
- package/dist/gateway/static/root/assets/route-preload-DGmrxJSb.js +2 -0
- package/dist/gateway/static/root/assets/runtime-health-zDkHcOZO.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-api-2YumRxOJ.js → runtime-tools-api-970sp5zI.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-DH00p-rI.js → runtime-tools-settings-panel-au6vZ0sL.js} +1 -1
- package/dist/gateway/static/root/assets/{service-recommendation-list-wXf_ZlHq.js → service-recommendation-list-XeRFtJ-Z.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-Dt7vRa-E.js → session-api-CuT7EPI0.js} +1 -1
- package/dist/gateway/static/root/assets/session-manager-CyZHiuWY.js +25 -0
- package/dist/gateway/static/root/assets/{sessions-page-CCcpMHIH.js → sessions-page-BIxDwAIX.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-Cy7xeKmH.js +1 -0
- package/dist/gateway/static/root/assets/{settings-advanced-section-DRlQdj_w.js → settings-advanced-section-nbkGHQ_4.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-mode-store-BE6t--iO.js → settings-mode-store-EQHfksdV.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-_F2d9-GZ.js → settings-page-D6RNHRHq.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-header-DG3MQwSF.js → settings-page-header-19GJ_a45.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-SuMAUhMb.js → settings-page-layout-B2WCzSel.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-interaction-page-DyDiHKjZ.js → setup-interaction-page-C5i7y_pM.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-CPNFWhrr.js → setup-status-panel-Cwp8YKdT.js} +1 -1
- package/dist/gateway/static/root/assets/{share-link-dialog-wu-minYF.js → share-link-dialog-DDsVTMZ-.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-BqbfuQBU.js → share-preview-page-C1S_gWGf.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-api-DwsEzRc6.js → shares-api-CepTFl1f.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-BxutiB6Y.js → shares-settings-Cv-tdcAN.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-api-C7wPB73H.js → skill-api-CsT-iHnl.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-list-api-C4AjzhlY.js → skill-list-api-CMJTjvSo.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-CqfS9zlG.js → skill-reload-api-S6B7P9ur.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-8VYadExR.js → skills-page-BKcsJtYx.js} +1 -1
- package/dist/gateway/static/root/assets/sliding-segmented-CgQ3BFdb.js +1 -0
- package/dist/gateway/static/root/assets/{system-settings-panel-BV4GHnns.js → system-settings-panel-DhHPM5qU.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-C9IyuxdS.js → task-detail-page-BHH2_Z9_.js} +3 -3
- package/dist/gateway/static/root/assets/{task-input-card-NtzzVc0e.js → task-input-card-D_2rNF31.js} +1 -1
- package/dist/gateway/static/root/assets/{terminal-panel-store-DWdJOGMn.js → terminal-panel-store-CcUWpqvC.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-FNf-kdMR.js → theme-store-D9pquJiM.js} +1 -1
- package/dist/gateway/static/root/assets/{tracing-settings-page-BRPJuRpc.js → tracing-settings-page-CjNrKILr.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-B7NHNrQJ.js → tunnel-api-GtLO40pc.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-activity-store-bgCeO8bb.js → understanding-activity-store-BhB5wAbq.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-refresh-store-CEhWIvsQ.js → understanding-refresh-store-BxtpXRfV.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-35YfpfVW.js → usage-page-CZa_a6_7.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-D8Qtt_Tn.js → use-autosave-BtOp6W9H.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-H-tD4Db6.js → use-composer-attachments-BTQZx8Nj.js} +1 -1
- package/dist/gateway/static/root/assets/{use-file-preview-expanded-P-0xmST2.js → use-file-preview-expanded-B7nscYS4.js} +3 -3
- package/dist/gateway/static/root/assets/{use-personal-profile-Bk2rGWSy.js → use-personal-profile-Cj7WGOfv.js} +1 -1
- package/dist/gateway/static/root/assets/use-realtime-voice-BS1rygyV.js +1 -0
- package/dist/gateway/static/root/assets/{use-workspace-tree-D0_812KH.js → use-workspace-tree-DYosm4Gz.js} +1 -1
- package/dist/gateway/static/root/assets/{user-model-page-BxHnOljT.js → user-model-page-DmmJODQ4.js} +1 -1
- package/dist/gateway/static/root/assets/voice-CDlC6XMH.js +1 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-BL56KGeq.js → voice-api-key-field-8voN8dQG.js} +1 -1
- package/dist/gateway/static/root/assets/voice-call-context-BM2A4bLz.js +1 -0
- package/dist/gateway/static/root/assets/voice-config-api-CrZd2aqw.js +1 -0
- package/dist/gateway/static/root/assets/{voice-input-shortcut-events-BK-IvchL.js → voice-input-shortcut-events-DcFp_fy4.js} +1 -1
- package/dist/gateway/static/root/assets/voice-settings-AckvhNnP.js +1 -0
- package/dist/gateway/static/root/assets/{work-discovery-overlay-DDXae8Yc.js → work-discovery-overlay-DAIk5csp.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-page-CxN0abrd.js → work-discovery-page-CJeixeWQ.js} +1 -1
- package/dist/gateway/static/root/assets/{working-directory-picker-modal-D3BUBFa0.js → working-directory-picker-modal-BW76VaD5.js} +1 -1
- package/dist/gateway/static/root/assets/workspace-api-Cu2gzmVn.js +2 -0
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-pVOYuH7u.js +1 -0
- package/dist/gateway/static/root/assets/{workspace-file-preview-dialog-BKmtih6_.js → workspace-file-preview-dialog-DyqI793w.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-open-location-menu-BdfKT4O4.js → workspace-open-location-menu-DTYkApy8.js} +1 -1
- package/dist/gateway/static/root/assets/{xopc-cloud-account-card-BS_lsURY.js → xopc-cloud-account-card-Rytp_NWV.js} +1 -1
- package/dist/gateway/static/root/index.html +102 -98
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/extension-capabilities.js +26 -4
- package/dist/packages/gateway-contract/src/index.js +3 -1
- package/dist/packages/gateway-contract/src/local-app-delegation.js +22 -0
- package/dist/packages/gateway-contract/src/local-apps.js +35 -4
- package/dist/packages/realtime-protocol/src/voice.js +5 -0
- package/dist/src/agent/agent-instance-gateway.d.ts +2 -0
- package/dist/src/agent/agent-manager.d.ts +1 -0
- package/dist/src/agent/agent-manager.js +11 -2
- package/dist/src/agent/background-review/prompts.js +2 -0
- package/dist/src/agent/background-review/run-background-review.js +13 -7
- package/dist/src/agent/context/execution-context.js +1 -1
- package/dist/src/agent/embedded/execution-tool-policy.js +1 -1
- package/dist/src/agent/embedded/run-for-session.js +66 -9
- package/dist/src/agent/embedded/run-turn.js +35 -1
- package/dist/src/agent/embedded/runs.d.ts +1 -0
- package/dist/src/agent/embedded/runs.js +13 -0
- package/dist/src/agent/embedded/types.d.ts +2 -0
- package/dist/src/agent/inbound/turn-dispatcher.d.ts +1 -0
- package/dist/src/agent/inbound/turn-dispatcher.js +1 -0
- package/dist/src/agent/prompt/system-prompt.js +7 -6
- package/dist/src/agent/prompt/types.d.ts +2 -1
- package/dist/src/agent/prompt/voice-history.d.ts +9 -0
- package/dist/src/agent/prompt/voice-history.js +35 -0
- package/dist/src/agent/prompt/voice-presentation.d.ts +1 -1
- package/dist/src/agent/prompt/voice-presentation.js +1 -0
- package/dist/src/agent/service.js +1 -1
- package/dist/src/agent/tasks/task-judge-service.js +1 -1
- package/dist/src/agent/tools/factory.js +1 -1
- package/dist/src/agent/tools/image-generate-tool.js +5 -1
- package/dist/src/agent/tools/personal-request-result-tool.js +1 -1
- package/dist/src/agent/tools/personal-task-tool.js +3 -1
- package/dist/src/agent/tools/task-collaboration-tool.js +1 -1
- package/dist/src/agent/tools/task-evidence.js +6 -15
- package/dist/src/agent/tools/task-result-tool.js +1 -1
- package/dist/src/agent/tools/user-context-tool.js +1 -1
- package/dist/src/agent/tools/xopc-use-tool.js +6 -5
- package/dist/src/agent-config/schema.d.ts +15 -0
- package/dist/src/capabilities/runtime/dispatcher.d.ts +11 -0
- package/dist/src/capabilities/runtime/dispatcher.js +22 -6
- package/dist/src/capabilities/runtime/product.js +2 -0
- package/dist/src/computer/evaluation-comparison.d.ts +4 -0
- package/dist/src/computer/evaluation-comparison.js +16 -1
- package/dist/src/computer/keyboard.js +1 -1
- package/dist/src/computer/model-adapter.js +18 -14
- package/dist/src/config/schema.d.ts +36 -2
- package/dist/src/config/schema.js +23 -5
- package/dist/src/gateway/hono/lib/safe-voice-config.js +4 -1
- package/dist/src/gateway/hono/routes/auth-registry-extensions.js +107 -12
- package/dist/src/gateway/hono/routes/imports.js +1 -1
- package/dist/src/gateway/hono/routes/lazy-bundles.js +16 -0
- package/dist/src/gateway/hono/routes/local-app-capabilities.js +16 -5
- package/dist/src/gateway/hono/routes/local-app-development.d.ts +3 -0
- package/dist/src/gateway/hono/routes/local-app-development.js +13 -0
- package/dist/src/gateway/hono/routes/local-app-previews.d.ts +3 -0
- package/dist/src/gateway/hono/routes/local-app-previews.js +86 -0
- package/dist/src/gateway/hono/routes/local-apps.js +3 -2
- package/dist/src/gateway/hono/routes/projects.js +1 -1
- package/dist/src/gateway/hono/routes/tasks.js +2 -2
- package/dist/src/gateway/hono/routes/user-model.js +2 -2
- package/dist/src/gateway/hono/routes/voice.js +4 -3
- package/dist/src/gateway/security/local-app-delegation-access.d.ts +5 -0
- package/dist/src/gateway/security/local-app-delegation-access.js +22 -0
- package/dist/src/gateway/service/config-coordinator.d.ts +7 -2
- package/dist/src/gateway/service/run-gateway-agent.js +7 -6
- package/dist/src/gateway/service/session-input-coordinator.d.ts +1 -0
- package/dist/src/gateway/service/session-input-coordinator.js +6 -2
- package/dist/src/gateway/service.js +50 -17
- package/dist/src/home-intelligence/host.js +2 -2
- package/dist/src/local-apps/access-audit.d.ts +17 -0
- package/dist/src/local-apps/access-audit.js +42 -0
- package/dist/src/local-apps/capabilities/contracts.js +2 -0
- package/dist/src/local-apps/capabilities/delegate.d.ts +3 -0
- package/dist/src/local-apps/capabilities/delegate.js +166 -0
- package/dist/src/local-apps/capabilities/projections.d.ts +265 -0
- package/dist/src/local-apps/capabilities/projections.js +53 -0
- package/dist/src/local-apps/capabilities/resource-policy.d.ts +3 -0
- package/dist/src/local-apps/capabilities/resource-policy.js +43 -0
- package/dist/src/local-apps/capabilities/runtime.d.ts +2 -1
- package/dist/src/local-apps/capabilities/runtime.js +108 -39
- package/dist/src/local-apps/fix-guidance.js +4 -1
- package/dist/src/local-apps/preview-fixtures.d.ts +20 -0
- package/dist/src/local-apps/preview-fixtures.js +52 -0
- package/dist/src/local-apps/preview-runtime-bridge.d.ts +1 -1
- package/dist/src/local-apps/preview-runtime-bridge.js +41 -18
- package/dist/src/local-apps/preview-sessions.d.ts +52 -0
- package/dist/src/local-apps/preview-sessions.js +316 -0
- package/dist/src/local-apps/preview-worker.d.ts +1 -0
- package/dist/src/local-apps/preview-worker.js +108 -0
- package/dist/src/local-apps/public-assets.d.ts +2 -0
- package/dist/src/local-apps/public-assets.js +42 -0
- package/dist/src/local-apps/scaffold.js +1 -1
- package/dist/src/local-apps/service.d.ts +48 -5
- package/dist/src/local-apps/service.js +136 -15
- package/dist/src/local-apps/store.d.ts +3 -0
- package/dist/src/local-apps/store.js +42 -16
- package/dist/src/local-apps/types.d.ts +2 -0
- package/dist/src/memory-learning/repository.js +3 -2
- package/dist/src/memory-learning/service.js +4 -13
- package/dist/src/memory-learning/transcript-source.d.ts +9 -0
- package/dist/src/memory-learning/transcript-source.js +31 -0
- package/dist/src/notes/capabilities/read.js +11 -2
- package/dist/src/notes/capabilities/write.js +10 -1
- package/dist/src/notes/types.d.ts +2 -0
- package/dist/src/personal-agent/communication.d.ts +2 -1
- package/dist/src/personal-agent/communication.js +3 -1
- package/dist/src/personal-agent/prompt-context.js +15 -23
- package/dist/src/personal-agent/prompts.js +3 -2
- package/dist/src/personal-agent/reply-composer.js +2 -2
- package/dist/src/personal-agent/request-access.js +1 -1
- package/dist/src/personal-agent/request-delivery.js +1 -1
- package/dist/src/personal-agent/request-service.js +1 -1
- package/dist/src/personal-agent/service.js +1 -0
- package/dist/src/phone/contracts.d.ts +1 -1
- package/dist/src/phone/model-adapter.d.ts +1 -1
- package/dist/src/phone/runtime.d.ts +1 -1
- package/dist/src/process/fork-worker.d.ts +2 -0
- package/dist/src/process/fork-worker.js +7 -0
- package/dist/src/realtime/broker.js +1 -1
- package/dist/src/session/client-history.js +12 -1
- package/dist/src/session/session-context-for-llm.js +10 -3
- package/dist/src/session/store.d.ts +1 -0
- package/dist/src/session/store.js +2 -1
- package/dist/src/session/stored-rows-to-file-entries.js +1 -1
- package/dist/src/session/transcript-outline.js +9 -0
- package/dist/src/session/voice-transcript.d.ts +14 -0
- package/dist/src/session/voice-transcript.js +19 -2
- package/dist/src/storage/sqlite/notes-repository.js +7 -0
- package/dist/src/storage/sqlite/resource-scope.d.ts +10 -0
- package/dist/src/storage/sqlite/resource-scope.js +31 -0
- package/dist/src/storage/sqlite/transcript-repository.d.ts +3 -0
- package/dist/src/storage/sqlite/transcript-repository.js +43 -7
- package/dist/src/tasks/capabilities/read.js +21 -3
- package/dist/src/tasks/task-allocation-service.js +1 -1
- package/dist/src/tasks/task-application-service.js +3 -3
- package/dist/src/tasks/task-context-assembler.js +1 -1
- package/dist/src/tasks/task-evidence-tools.d.ts +2 -0
- package/dist/src/tasks/task-evidence-tools.js +22 -0
- package/dist/src/tasks/task-main-update-delivery.js +2 -0
- package/dist/src/tasks/task-repository.d.ts +2 -0
- package/dist/src/tasks/task-repository.js +7 -0
- package/dist/src/tasks/task-research-result.js +8 -21
- package/dist/src/tasks/task-result-delivery-repository.d.ts +6 -0
- package/dist/src/tasks/task-result-delivery-repository.js +26 -0
- package/dist/src/tasks/task-result-delivery-service.js +3 -3
- package/dist/src/tasks/task-run-coordinator.js +1 -1
- package/dist/src/usage/scenario-registry.js +5 -0
- package/dist/src/user-model/index.js +3 -3
- package/dist/src/user-model/profile.d.ts +8 -0
- package/dist/src/user-model/profile.js +19 -1
- package/dist/src/voice/platform-settings.d.ts +5 -0
- package/dist/src/voice/platform-settings.js +15 -2
- package/dist/src/voice/platform-streams.d.ts +7 -3
- package/dist/src/voice/platform-streams.js +90 -18
- package/dist/src/voice/realtime/agentBroker.d.ts +12 -1
- package/dist/src/voice/realtime/agentBroker.js +22 -5
- package/dist/src/voice/realtime/agentEngine.js +104 -12
- package/dist/src/voice/realtime/chat-publication.d.ts +24 -0
- package/dist/src/voice/realtime/chat-publication.js +61 -0
- package/dist/src/voice/realtime/conversation-context.d.ts +7 -1
- package/dist/src/voice/realtime/conversation-context.js +54 -16
- package/dist/src/voice/realtime/engine.d.ts +2 -0
- package/dist/src/voice/realtime/identity-grounding.d.ts +8 -0
- package/dist/src/voice/realtime/identity-grounding.js +34 -0
- package/dist/src/voice/realtime/memory-context.js +48 -14
- package/dist/src/voice/realtime/naturalAgentTools.d.ts +90 -0
- package/dist/src/voice/realtime/naturalAgentTools.js +275 -0
- package/dist/src/voice/realtime/omniEngine.d.ts +8 -0
- package/dist/src/voice/realtime/omniEngine.js +239 -13
- package/dist/src/voice/realtime/omniRoute.d.ts +1 -0
- package/dist/src/voice/realtime/omniRoute.js +23 -4
- package/dist/src/voice/realtime/runtime.d.ts +1 -0
- package/dist/src/voice/realtime/runtime.js +116 -22
- package/dist/src/voice/realtime/runtime.types.d.ts +3 -1
- package/dist/src/voice/realtime/speakable-segmenter.d.ts +2 -1
- package/dist/src/voice/realtime/speakable-segmenter.js +7 -2
- package/dist/src/voice/realtime/turnPolicy.d.ts +1 -2
- package/dist/src/voice/realtime/turnPolicy.js +4 -6
- package/dist/src/voice/realtime/user-context.d.ts +14 -0
- package/dist/src/voice/realtime/user-context.js +63 -0
- package/dist/src/voice/tts/providers/xopc-cloud-speech.js +29 -23
- package/dist/src/voice/tts/speak-core.js +1 -0
- package/dist/src/voice/tts/speech-provider-types.d.ts +2 -0
- package/dist/src/work-discovery/service.js +1 -1
- package/package.json +2 -1
- package/skills/engineering/build-xopc-local-app/SKILL.md +5 -1
- package/skills/engineering/build-xopc-local-app/references/app-contract.md +43 -2
- package/dist/gateway/static/root/assets/api-DIKAjDAK.js +0 -1
- package/dist/gateway/static/root/assets/automation-run-list-J-R4-hVm.js +0 -1
- package/dist/gateway/static/root/assets/capabilities-page-KRaK8LKT.js +0 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-aJy-1o5H.js +0 -8
- package/dist/gateway/static/root/assets/chat-page-QmBfel_Z.js +0 -71
- package/dist/gateway/static/root/assets/clipboard-copy-DuJk5WD6.js +0 -1
- package/dist/gateway/static/root/assets/connected-providers-grid-BWVieU6P.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-C8M01Zxs.js +0 -1
- package/dist/gateway/static/root/assets/dist-BGTk37IG.js +0 -1
- package/dist/gateway/static/root/assets/extension-iframe-host-DjXDDmUd.js +0 -1
- package/dist/gateway/static/root/assets/extension-page-CGgneUDY.js +0 -1
- package/dist/gateway/static/root/assets/extension-provider-BktGTwH_.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-ZxMFPH4n.js +0 -1
- package/dist/gateway/static/root/assets/index-CPXKrqLj.js +0 -11
- package/dist/gateway/static/root/assets/index-Dc-3QQaz.css +0 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-CnckB-RA.js +0 -1
- package/dist/gateway/static/root/assets/local-apps-Ck6kACsY.js +0 -1
- package/dist/gateway/static/root/assets/logs-page-_nIEwZn4.js +0 -2
- package/dist/gateway/static/root/assets/messages-C7ruaWtK.js +0 -3
- package/dist/gateway/static/root/assets/note-image-lightbox-kccIXJo_.js +0 -1
- package/dist/gateway/static/root/assets/page-header-store-CFntbsPj.js +0 -1
- package/dist/gateway/static/root/assets/personal-avatar-CVocefDp.js +0 -1
- package/dist/gateway/static/root/assets/personal-page-BjnSgU89.js +0 -1
- package/dist/gateway/static/root/assets/personal-proactivity-DaRnbB1f.js +0 -1
- package/dist/gateway/static/root/assets/personal-settings-panel-CdMHSPCH.js +0 -1
- package/dist/gateway/static/root/assets/route-preload-DGMUu3pm.js +0 -2
- package/dist/gateway/static/root/assets/runtime-health-D2TDFLLq.js +0 -1
- package/dist/gateway/static/root/assets/session-manager-5qokJQ6W.js +0 -25
- package/dist/gateway/static/root/assets/settings-advanced-gate-B7-XQiJh.js +0 -1
- package/dist/gateway/static/root/assets/sliding-segmented-D346J92k.js +0 -1
- package/dist/gateway/static/root/assets/use-realtime-voice-BcokfdI0.js +0 -1
- package/dist/gateway/static/root/assets/voice-C607F0pB.js +0 -1
- package/dist/gateway/static/root/assets/voice-call-context-CJ1ZiJWR.js +0 -1
- package/dist/gateway/static/root/assets/voice-config-api-DVFTuHwH.js +0 -1
- package/dist/gateway/static/root/assets/workspace-api-ymncGc6j.js +0 -2
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-BQrMvAkL.js +0 -1
|
@@ -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{m as i}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{a,i as o,n as s,o as c}from"./locale-store-DTUQ0JiK.js";import{t as l}from"./messages-C7ruaWtK.js";import{a as u,n as d,o as f,r as p,s as m,t as h}from"./dist-BGTk37IG.js";import{t as g}from"./activity-YogQEteU.js";import{t as _}from"./chevron-left-DqFhpbvK.js";import{t as v}from"./chevron-right-BweFrslA.js";import{n as y,r as b,t as x}from"./popover-select-CLsphyzA.js";import{t as S}from"./laptop-CI3hBVrl.js";import{n as C,t as ee}from"./shield-off-2jsucUds.js";import{t as w}from"./plus-Q2yW6OE7.js";import{t as T}from"./search-DA7gz22f.js";import{t as E}from"./smartphone-DSSsQFqA.js";import{t as te}from"./x-B_N4OPjy.js";import{t as D}from"./cn-0WouolD0.js";import{t as O}from"./skeleton-DzdOeGYz.js";import{s as k}from"./session-api-Dt7vRa-E.js";import{i as A,o as j}from"./vendor-swr-CdRzEUwF.js";import{t as M}from"./button-Cc4hUNTt.js";import{i as ne,o as N}from"./settings-shell-dialog-layer-BU3UuiJr.js";import{t as P}from"./page-tabs-oeTY7z3_.js";import{t as F}from"./confirm-dialog-D7dQJytv.js";import{t as I}from"./refresh-button-DiWdGAaX.js";import{n as L}from"./index.module-Cd9ENXfk.js";import{n as R}from"./settings-loading-skeleton-CAoOV17i.js";import{a as z,i as B,n as re,o as ie,r as ae,t as oe}from"./management-api-C6mCD0mZ.js";import{n as se,t as ce}from"./settings-page-header-DG3MQwSF.js";import{t as le}from"./settings-page-layout-SuMAUhMb.js";import{t as V}from"./device-pairing-wizard-CbUX0iit.js";var H=n(),U=e(t(),1),W=r();function ue({operationId:e,zh:t}){let[n,r]=(0,U.useState)(!1),[i,a]=(0,U.useState)(``);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(M,{variant:`ghost`,className:`h-7 px-2 text-xs`,disabled:n,onClick:async()=>{r(!0);try{let n=(await c(o(`/api/endpoint-tools/provider-operations/${encodeURIComponent(e)}`))).payload.receipt?.state;a(n===`succeeded`?t?`设备报告已完成,Gateway 未收到结果。`:`Device reported completion. Gateway did not receive the result.`:n===`running`?t?`设备仍在执行。`:`Device is still running.`:t?`设备未确认结果。`:`Device has not confirmed the outcome.`)}catch{a(t?`暂时无法核对设备状态。`:`Unable to check device status.`)}finally{r(!1)}},children:n?t?`核对中…`:`Checking…`:t?`核对设备状态`:`Check device status`}),i?(0,W.jsx)(`p`,{role:`status`,className:`text-right text-xs text-fg-muted`,children:i}):null]})}async function de(e=`GET`,t,n){let r=await a(o(`/api/endpoint-tools/target-authorizations`+(n?`/`+encodeURIComponent(n):``)),{method:e,...t?{body:JSON.stringify(t)}:{}});if(!r.ok)throw Error(r.status===403?`owner`:`unavailable`);return(await r.json()).payload}function fe({devices:e,zh:t}){let n=A(`device-single-call-grants`,()=>de(),{refreshInterval:5e3,shouldRetryOnError:!1}),r=A(n.error?null:`device-grant-conversations`,()=>k({limit:100}),{shouldRetryOnError:!1}),[i,a]=(0,U.useState)(``),[o,s]=(0,U.useState)(``),[c,l]=(0,U.useState)(``),[u,d]=(0,U.useState)(`weather`),[f,p]=(0,U.useState)(`approximate`),[m,h]=(0,U.useState)(`restaurant`),[g,_]=(0,U.useState)(!1),[v,y]=(0,U.useState)(!1);if(n.error)return null;let b=e.flatMap(e=>e.endpoints.map(t=>({...t,label:e.displayName+` · `+e.platform+` · `+e.id.slice(-8)}))),S=b.find(e=>e.endpointId===c)?.tools.find(e=>e.descriptor.name.endsWith(`.device.get_location`))?.descriptor.name,C=async()=>{if(!(!S||!i||!o)){_(!0),y(!1);try{await de(`POST`,{conversationId:i,requestorPrincipalId:o,targetEndpointId:c,toolName:S,arguments:{purpose:u,precision:f,...u===`nearby`?{category:m}:{}}}),await n.mutate()}catch{y(!0)}finally{_(!1)}}};return(0,W.jsxs)(`section`,{className:`mb-5 rounded-xl border border-edge bg-surface-base p-4`,children:[(0,W.jsx)(`h3`,{className:`font-semibold text-fg`,children:t?`跨设备单次授权`:`Single-call device authorization`}),(0,W.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:t?`为指定会话和来源设备授权一次定位查询,60 秒后失效。目标设备仍需确认;授权后请在来源设备继续请求。`:`Authorize one location query for a conversation and source device. Expires in 60 seconds; target-device consent is still required. Continue the request from the source device.`}),n.isLoading||r.isLoading?(0,W.jsx)(O,{className:`mt-3 h-28`}):(0,W.jsxs)(`div`,{className:`mt-3 grid gap-3 sm:grid-cols-2`,children:[(0,W.jsx)(x,{value:i,onChange:a,placeholder:t?`选择会话`:`Conversation`,ariaLabel:t?`会话`:`Conversation`,options:(r.data?.items??[]).map(e=>({value:e.key,label:e.name||e.key}))}),(0,W.jsx)(x,{value:o,onChange:s,placeholder:t?`消息来源设备`:`Source device`,ariaLabel:t?`消息来源设备`:`Source device`,options:e.filter(e=>e.endpoints.length>0).map(e=>({value:e.id,label:e.displayName+` · `+e.platform+` · `+e.id.slice(-8)}))}),(0,W.jsx)(x,{value:c,onChange:l,placeholder:t?`使用哪台设备的位置`:`Location device`,ariaLabel:t?`目标设备`:`Target device`,options:b.filter(e=>e.tools.some(e=>e.descriptor.name.endsWith(`.device.get_location`))).map(e=>({value:e.endpointId,label:e.label}))}),(0,W.jsx)(x,{placeholder:t?`用途`:`Purpose`,value:u,onChange:e=>d(e),ariaLabel:t?`用途`:`Purpose`,options:[{value:`weather`,label:t?`查询天气`:`Weather`},{value:`nearby`,label:t?`附近地点`:`Nearby places`}],allowEmpty:!1}),(0,W.jsx)(x,{placeholder:t?`精度`:`Precision`,value:f,onChange:e=>p(e),ariaLabel:t?`精度`:`Precision`,options:[{value:`approximate`,label:t?`大致位置`:`Approximate`},{value:`precise`,label:t?`精确位置`:`Precise`}],allowEmpty:!1}),u===`nearby`?(0,W.jsx)(x,{placeholder:t?`地点类型`:`Category`,value:m,onChange:h,ariaLabel:t?`附近地点类型`:`Place category`,options:[`restaurant`,`cafe`,`pharmacy`,`park`].map((e,n)=>({value:e,label:t?[`餐厅`,`咖啡馆`,`药店`,`公园`][n]:e})),allowEmpty:!1}):null,(0,W.jsx)(M,{variant:`primary`,disabled:g||!i||!o||!S,onClick:()=>void C(),children:t?`允许一次`:`Allow once`})]}),v?(0,W.jsx)(`p`,{role:`alert`,className:`mt-2 text-sm text-fg-muted`,children:t?`授权失败,请检查设备连接后重试。`:`Authorization failed. Check the device connection.`}):null,(0,W.jsx)(`div`,{className:`mt-3 space-y-2`,children:n.data?.map(r=>(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-2 text-sm text-fg-muted`,children:[(0,W.jsxs)(`span`,{children:[e.find(e=>e.endpoints.some(e=>e.endpointId===r.targetEndpointId))?.displayName??(t?`设备`:`Device`),` · `,r.state===`running`?t?`执行中`:`Running`:t?`等待本次调用`:`Awaiting one call`]}),(0,W.jsx)(M,{disabled:g,onClick:()=>{_(!0),de(`DELETE`,void 0,r.id).then(()=>n.mutate()).catch(()=>y(!0)).finally(()=>_(!1))},children:t?`撤销`:`Revoke`})]},r.id))})]})}var pe={ready:[`可用`,`Ready`],offline:[`离线`,`Offline`],authorization_required:[`等待批准`,`Approval required`],needs_foreground:[`需要设备前台运行`,`Foreground required`],permission_missing:[`缺少设备权限`,`Device permission required`],resource_busy:[`资源占用中`,`Resource busy`],unavailable:[`暂不可用`,`Unavailable`]};function me({principalId:e,zh:t}){let n=o(`/api/endpoint-tools/providers`),{data:r,error:i,mutate:a}=A(`${n}?principalId=${encodeURIComponent(e)}`,e=>c(e),{refreshInterval:15e3}),[s,l]=(0,U.useState)(),[u,d]=(0,U.useState)(!1),f=r?.payload.filter(t=>t.principalId===e),p=async t=>{l(t.provider.localId),d(!1);try{await c(n+`/admission`,{method:`POST`,body:JSON.stringify({principalId:e,localId:t.provider.localId,expectedDigest:t.digest,allowed:!t.admitted})}),await a()}catch{d(!0),await a()}finally{l(void 0)}};return(0,W.jsxs)(`section`,{className:`space-y-2`,children:[(0,W.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:t?`设备能力`:`Device capabilities`}),!r&&!i?(0,W.jsx)(O,{className:`h-24 w-full rounded-xl`}):null,i||u?(0,W.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:t?`能力信息更新失败,请刷新后重试。`:`Unable to update capabilities. Refresh and retry.`}):null,f?.length===0?(0,W.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t?`此设备尚未上报扩展能力。`:`No additional capabilities reported.`}):null,f?.map(e=>(0,W.jsxs)(`article`,{className:`space-y-2 rounded-xl border border-edge-subtle p-3`,children:[(0,W.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,W.jsx)(`h4`,{className:`break-words text-sm font-medium text-fg`,children:e.provider.title}),(0,W.jsx)(`span`,{className:`shrink-0 text-xs text-fg-muted`,children:(pe[e.status]??pe.unavailable)[+!t]})]}),(0,W.jsx)(`p`,{className:`break-words text-xs text-fg-muted`,children:e.provider.summary}),(0,W.jsxs)(`details`,{className:`text-xs text-fg-subtle`,children:[(0,W.jsx)(`summary`,{className:`cursor-pointer`,children:t?`${e.provider.tools.length} 项能力及权限`:`${e.provider.tools.length} tools and permissions`}),(0,W.jsx)(`ul`,{className:`mt-2 space-y-2`,children:e.provider.tools.map(e=>(0,W.jsxs)(`li`,{className:`break-words`,children:[(0,W.jsx)(`p`,{className:`font-medium text-fg`,children:e.title}),(0,W.jsx)(`p`,{children:e.description}),(0,W.jsxs)(`p`,{children:[e.effect,` · `,e.sensitivity,` · `,e.confirmation===`always`?t?`每次确认`:`Confirm each call`:t?`按批准范围执行`:`Approved scope`,e.requiredPermissions.length?` · ${e.requiredPermissions.join(`, `)}`:``]})]},e.name))})]}),(0,W.jsx)(M,{variant:`secondary`,disabled:s!==void 0,onClick:()=>void p(e),children:s===e.provider.localId?t?`保存中…`:`Saving…`:e.admitted?t?`撤销能力批准`:`Revoke approval`:t?`批准这些能力`:`Approve capabilities`})]},e.provider.localId))]})}var he=720*60*60*1e3;function ge(e){let t=[e.access,e.principal].filter(e=>e!==null);return t.length>0&&t.every(e=>e.revokedAt!==void 0)}function G(e){return ge(e)?`revoked`:e.endpoints.length>0?`online`:`offline`}function _e(e){return new Set(e.endpoints.flatMap(e=>e.tools.map(({descriptor:e})=>e.name))).size}function ve(e,t=Date.now()){return G(e)===`offline`&&(e.lastSeenAt??e.createdAt)<t-he}function ye(e,t,n=Date.now()){let r=t.query.trim().toLocaleLowerCase();return e.filter(e=>{let i=G(e),a=t.status===`all`||(t.status===`active`?i!==`revoked`:t.status===`stale`?ve(e,n):i===t.status),o=!t.platform||e.platform===t.platform,s=!r||[e.displayName,e.id,e.kind,e.platform].some(e=>e.toLocaleLowerCase().includes(r));return a&&o&&s})}function be(e){return e.length>8?e.slice(-8):e}function xe(e){let t=(0,H.c)(61),{device:n,busy:r,onClose:i,onRevoke:a,onRename:o}=e,c=s(Se),g;t[0]===c?g=t[1]:(g=l(c),t[0]=c,t[1]=g);let _=g.endpointToolsSettings,v=c===`zh`?`zh-CN`:`en`,y;t[2]===v?y=t[3]:(y=new Intl.DateTimeFormat(v,{dateStyle:`medium`,timeStyle:`short`}),t[2]=v,t[3]=y);let b=y,x;t[4]===n?x=t[5]:(x=n?G(n):`offline`,t[4]=n,t[5]=x);let S=x,C=n!==null,w;t[6]===i?w=t[7]:(w=e=>!e&&i(),t[6]=i,t[7]=w);let T;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,W.jsx)(u,{className:D(`xopc-dialog-overlay fixed inset-0 bg-scrim`,N)}),t[8]=T):T=t[8];let E;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(E=D(`xopc-drawer-right fixed right-0 top-0 flex size-full max-w-lg flex-col border-l border-edge bg-surface-overlay shadow-popover outline-none`,ne),t[9]=E):E=t[9];let O=n?.displayName??_.deviceDetails,k;t[10]===O?k=t[11]:(k=(0,W.jsx)(m,{className:`truncate text-base font-semibold text-fg`,children:O}),t[10]=O,t[11]=k);let A;t[12]===n?A=t[13]:(A=n?(0,W.jsxs)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:[n.kind,` · `,n.platform,` · `,be(n.id)]}):null,t[12]=n,t[13]=A);let j;t[14]!==k||t[15]!==A?(j=(0,W.jsxs)(`div`,{className:`min-w-0`,children:[k,A]}),t[14]=k,t[15]=A,t[16]=j):j=t[16];let P;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,W.jsx)(te,{className:`size-5`,"aria-hidden":!0}),t[17]=P):P=t[17];let F;t[18]===_.close?F=t[19]:(F=(0,W.jsx)(d,{asChild:!0,children:(0,W.jsx)(M,{variant:`ghost`,className:`size-9 shrink-0 p-0`,"aria-label":_.close,children:P})}),t[18]=_.close,t[19]=F);let I;t[20]!==j||t[21]!==F?(I=(0,W.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-3 border-b border-edge px-4 py-3`,children:[j,F]}),t[20]=j,t[21]=F,t[22]=I):I=t[22];let L;t[23]!==_.accessActive||t[24]!==_.accessRevoked||t[25]!==_.accessTitle||t[26]!==_.createdAt||t[27]!==_.endpointCount||t[28]!==_.endpointsTitle||t[29]!==_.identityId||t[30]!==_.identityTitle||t[31]!==_.lastSeen||t[32]!==_.never||t[33]!==_.noAccessIdentity||t[34]!==_.noOnlineEndpoints||t[35]!==_.noPermissions||t[36]!==_.permissions||t[37]!==_.status||t[38]!==_.statusLabel||t[39]!==_.toolCount||t[40]!==n||t[41]!==b||t[42]!==c||t[43]!==o||t[44]!==S?(L=n?(0,W.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-5 overflow-y-auto p-4`,children:[n.principal&&S!==`revoked`&&o?(0,W.jsx)(Ce,{device:n,zh:c===`zh`,onRename:o},`${n.id}:${n.settingsRevision??0}`):null,(0,W.jsxs)(`dl`,{className:`grid grid-cols-2 gap-3 rounded-xl bg-surface-hover/40 p-4`,children:[(0,W.jsx)(K,{label:_.statusLabel,value:_.status[S]}),(0,W.jsx)(K,{label:_.lastSeen,value:n.lastSeenAt?b.format(n.lastSeenAt):_.never}),(0,W.jsx)(K,{label:_.endpointCount,value:String(n.endpoints.length)}),(0,W.jsx)(K,{label:_.toolCount,value:String(_e(n))})]}),(0,W.jsxs)(`section`,{children:[(0,W.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:_.accessTitle}),(0,W.jsx)(`div`,{className:`mt-2 rounded-xl border border-edge-subtle bg-surface-base p-3 text-xs text-fg-muted`,children:n.access?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`p`,{children:n.access.revokedAt?_.accessRevoked:_.accessActive}),(0,W.jsx)(`p`,{className:`mt-1`,children:n.access.requestProofVersion===1?c===`zh`?`设备请求签名已启用`:`Device request signing enabled`:c===`zh`?`请求签名未启用,设备不可用`:`Request signing is missing; device unavailable`}),(0,W.jsxs)(`p`,{className:`mt-1 break-words`,children:[_.permissions,`: `,n.access.scopes.join(`, `)||_.noPermissions]})]}):(0,W.jsx)(`p`,{children:_.noAccessIdentity})})]}),n.principal&&S!==`revoked`?(0,W.jsx)(me,{principalId:n.id,zh:c===`zh`},n.id):null,n.access&&!n.access.revokedAt&&[`ios`,`android`,`harmonyos`].includes(n.platform??``)?(0,W.jsx)(we,{device:n,zh:c===`zh`},n.id):null,(0,W.jsxs)(`section`,{children:[(0,W.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:_.endpointsTitle}),(0,W.jsxs)(`div`,{className:`mt-2 space-y-2`,children:[n.endpoints.length===0?(0,W.jsx)(`p`,{className:`text-sm text-fg-muted`,children:_.noOnlineEndpoints}):null,n.endpoints.map(e=>(0,W.jsxs)(`article`,{className:`rounded-xl border border-edge-subtle bg-surface-base p-3`,children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-2`,children:[(0,W.jsx)(`p`,{className:`min-w-0 break-all text-xs font-medium text-fg`,children:e.endpointId}),(0,W.jsxs)(`span`,{className:`text-xs text-fg-muted`,children:[_.status[e.availability],` · v`,e.appVersion]})]}),(0,W.jsx)(`div`,{className:`mt-3 space-y-2`,children:e.tools.map(e=>{let{descriptor:t}=e;return(0,W.jsxs)(`div`,{className:`rounded-lg bg-surface-hover/50 px-3 py-2`,children:[(0,W.jsx)(`p`,{className:`break-all text-xs font-medium text-fg`,children:t.title}),(0,W.jsxs)(`p`,{className:`mt-0.5 break-words text-xs text-fg-subtle`,children:[t.requiresForeground?c===`zh`?`需要设备在前台 · `:`Requires foreground · `:``,t.confirmation===`always`?c===`zh`?`每次确认`:`Confirm each time`:c===`zh`?`按已授权范围调用`:`Uses the authorized scope`]})]},t.name)})})]},e.connectionId))]})]}),(0,W.jsxs)(`section`,{children:[(0,W.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:_.identityTitle}),n.principal&&S!==`revoked`&&o?(0,W.jsx)(Ce,{device:n,zh:c===`zh`,onRename:o},`${n.id}:${n.settingsRevision??0}`):null,(0,W.jsxs)(`dl`,{className:`mt-2 rounded-xl border border-edge-subtle bg-surface-base p-3 text-xs`,children:[(0,W.jsx)(K,{label:_.identityId,value:n.id,breakAll:!0}),(0,W.jsx)(`div`,{className:`mt-3`,children:(0,W.jsx)(K,{label:_.createdAt,value:b.format(n.createdAt)})})]})]})]}):null,t[23]=_.accessActive,t[24]=_.accessRevoked,t[25]=_.accessTitle,t[26]=_.createdAt,t[27]=_.endpointCount,t[28]=_.endpointsTitle,t[29]=_.identityId,t[30]=_.identityTitle,t[31]=_.lastSeen,t[32]=_.never,t[33]=_.noAccessIdentity,t[34]=_.noOnlineEndpoints,t[35]=_.noPermissions,t[36]=_.permissions,t[37]=_.status,t[38]=_.statusLabel,t[39]=_.toolCount,t[40]=n,t[41]=b,t[42]=c,t[43]=o,t[44]=S,t[45]=L):L=t[45];let R;t[46]!==r||t[47]!==_.removeDevice||t[48]!==_.revoking||t[49]!==n||t[50]!==a||t[51]!==S?(R=n&&S!==`revoked`?(0,W.jsx)(`div`,{className:`shrink-0 border-t border-edge px-4 py-3`,children:(0,W.jsxs)(M,{variant:`secondary`,className:`w-full text-danger`,disabled:r,onClick:()=>a(n),children:[(0,W.jsx)(ee,{className:`size-4`,"aria-hidden":!0}),r?_.revoking:_.removeDevice]})}):null,t[46]=r,t[47]=_.removeDevice,t[48]=_.revoking,t[49]=n,t[50]=a,t[51]=S,t[52]=R):R=t[52];let z;t[53]!==I||t[54]!==L||t[55]!==R?(z=(0,W.jsxs)(f,{children:[T,(0,W.jsxs)(p,{className:E,"aria-describedby":void 0,children:[I,L,R]})]}),t[53]=I,t[54]=L,t[55]=R,t[56]=z):z=t[56];let B;return t[57]!==z||t[58]!==C||t[59]!==w?(B=(0,W.jsx)(h,{open:C,onOpenChange:w,children:z}),t[57]=z,t[58]=C,t[59]=w,t[60]=B):B=t[60],B}function Se(e){return e.language}function K(e){let t=(0,H.c)(10),{label:n,value:r,breakAll:i}=e,a=i!==void 0&&i,o;t[0]===n?o=t[1]:(o=(0,W.jsx)(`dt`,{className:`text-xs text-fg-subtle`,children:n}),t[0]=n,t[1]=o);let s=a&&`break-all font-mono text-xs`,c;t[2]===s?c=t[3]:(c=D(`mt-1 text-sm text-fg`,s),t[2]=s,t[3]=c);let l;t[4]!==c||t[5]!==r?(l=(0,W.jsx)(`dd`,{className:c,children:r}),t[4]=c,t[5]=r,t[6]=l):l=t[6];let u;return t[7]!==o||t[8]!==l?(u=(0,W.jsxs)(`div`,{className:`min-w-0`,children:[o,l]}),t[7]=o,t[8]=l,t[9]=u):u=t[9],u}function Ce({device:e,zh:t,onRename:n}){let[r,i]=(0,U.useState)(e.displayName),[a,o]=(0,U.useState)(!1),[s,c]=(0,U.useState)(!1);return(0,W.jsxs)(`form`,{className:`space-y-2`,onSubmit:async t=>{if(t.preventDefault(),!(a||!r.trim())){o(!0),c(!1);try{await n(e,r.trim())}catch{c(!0)}finally{o(!1)}}},children:[(0,W.jsxs)(`label`,{className:`block text-sm text-fg`,children:[t?`设备名称`:`Device name`,(0,W.jsx)(`input`,{value:r,maxLength:80,onChange:e=>i(e.target.value),className:`mt-2 h-10 w-full rounded-lg border border-edge bg-surface-inset px-3 text-fg`})]}),(0,W.jsx)(M,{type:`submit`,variant:`secondary`,disabled:a||!r.trim()||r.trim()===e.displayName,children:a?t?`保存中…`:`Saving…`:t?`保存名称`:`Save name`}),s?(0,W.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:t?`保存失败,请刷新设备信息后重试。`:`Unable to save. Refresh device information and retry.`}):null]})}function we({device:e,zh:t}){let n=e.access?.scopes.includes(`phone.control`)?`control`:e.access?.scopes.includes(`phone.view`)?`view`:`none`,[r,i]=(0,U.useState)(n),[a,s]=(0,U.useState)(!1),[l,u]=(0,U.useState)(!1);return(0,U.useEffect)(()=>i(n),[n]),(0,W.jsxs)(`section`,{className:`space-y-2`,children:[(0,W.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:t?`云手机访问`:`Cloud phone access`}),(0,W.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t?`移动端配对后默认可查看并接管。可在此关闭,或撤销整个设备的授权。`:`Mobile pairing includes viewing and control by default. Disable it here or revoke the device entirely.`}),(0,W.jsxs)(y,{value:r,disabled:a,onChange:async t=>{let n=t.target.value;s(!0),u(!1);try{await c(o(`/api/phone/device-access/${encodeURIComponent(e.id)}`),{method:`PATCH`,body:JSON.stringify({access:n})}),i(n),await j(o(`/api/endpoint-tools/devices`))}catch{u(!0)}finally{s(!1)}},children:[(0,W.jsx)(b,{value:`none`,children:t?`不允许`:`Not allowed`}),(0,W.jsx)(b,{value:`view`,children:t?`仅查看`:`View only`}),(0,W.jsx)(b,{value:`control`,children:t?`查看并接管`:`View and control`})]}),l?(0,W.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:t?`授权保存失败,请重试。`:`Unable to save phone access.`}):null]})}function Te(e){let t=(0,H.c)(19),{onPaired:n}=e,[r,a]=i(),o=s(Ee),c;t[0]===o?c=t[1]:(c=l(o),t[0]=o,t[1]=c);let u=c.endpointToolsSettings.deviceAccess,d;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(d={open:!1},t[2]=d):d=t[2];let[f,p]=(0,U.useState)(d),m,h;t[3]!==r||t[4]!==a?(m=()=>{let e=r.get(`startDevicePairing`);e!==`mobile`&&e!==`browser`||(p({open:!0,target:e}),a(q,{replace:!0}))},h=[r,a],t[3]=r,t[4]=a,t[5]=m,t[6]=h):(m=t[5],h=t[6]),(0,U.useEffect)(m,h);let g,_;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>p({open:!0}),_=(0,W.jsx)(w,{className:`size-4`,"aria-hidden":!0}),t[7]=g,t[8]=_):(g=t[7],_=t[8]);let v;t[9]===u.addDevice?v=t[10]:(v=(0,W.jsxs)(M,{variant:`primary`,onClick:g,children:[_,u.addDevice]}),t[9]=u.addDevice,t[10]=v);let y;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(y=e=>p(t=>({...t,open:e})),t[11]=y):y=t[11];let b;t[12]!==f.open||t[13]!==f.target||t[14]!==n?(b=(0,W.jsx)(V,{open:f.open,onOpenChange:y,onPaired:n,targetKind:f.target}),t[12]=f.open,t[13]=f.target,t[14]=n,t[15]=b):b=t[15];let x;return t[16]!==v||t[17]!==b?(x=(0,W.jsxs)(W.Fragment,{children:[v,b]}),t[16]=v,t[17]=b,t[18]=x):x=t[18],x}function q(e){let t=new URLSearchParams(e);return t.delete(`startDevicePairing`),t}function Ee(e){return e.language}var De=5e3,J=20,Oe=20;function Y(e){return e===`online`||e===`succeeded`?`bg-success-soft text-success`:e===`running`?`bg-accent-soft text-accent-fg`:e===`failed`||e===`revoked`?`bg-danger-soft text-danger`:`bg-surface-hover text-fg-muted`}function ke(e){let t=(0,H.c)(5),{status:n,label:r}=e,i;t[0]===n?i=t[1]:(i=D(`rounded-full px-2 py-0.5 text-xs font-medium`,Y(n)),t[0]=n,t[1]=i);let a;return t[2]!==r||t[3]!==i?(a=(0,W.jsx)(`span`,{className:i,children:r}),t[2]=r,t[3]=i,t[4]=a):a=t[4],a}function X(){let e=s(e=>e.language),t=l(e).endpointToolsSettings,[n,r]=i(),a=n.get(`view`)===`activity`?`activity`:`devices`,[o,c]=(0,U.useState)(null),[u,d]=(0,U.useState)([]),[f,p]=(0,U.useState)(!1),[m,h]=(0,U.useState)(!1),[y,b]=(0,U.useState)(``),[w,te]=(0,U.useState)(`active`),[O,k]=(0,U.useState)(``),[j,ne]=(0,U.useState)(1),[N,V]=(0,U.useState)(()=>new Set),[H,de]=(0,U.useState)(``),[pe]=L(H,250),[me,he]=(0,U.useState)(``),[ge,Se]=(0,U.useState)(``),[K,Ce]=(0,U.useState)(``),[we,q]=(0,U.useState)(1),Ee={page:we,pageSize:Oe,query:pe,principalId:me,status:ge,effect:K},Y=A(B(),ae,{refreshInterval:De}),X=A(a===`activity`?oe(Ee):null,()=>re(Ee),{refreshInterval:De,keepPreviousData:!0}),Ae=(0,U.useMemo)(()=>new Intl.DateTimeFormat(e===`zh`?`zh-CN`:`en`,{dateStyle:`medium`,timeStyle:`short`}),[e]);if(Y.isLoading&&!Y.data)return(0,W.jsx)(se,{children:(0,W.jsx)(R,{sections:2})});let Z=Y.data??[],je=X.data?.items??[],Me=Z.filter(e=>G(e)===`online`).length,Ne=Z.filter(e=>G(e)!==`revoked`).length,Pe=Z.filter(e=>ve(e)).length,Fe=[...new Set(Z.map(e=>e.platform))].toSorted(),Q=ye(Z,{query:y,status:w,platform:O}),Ie=Math.max(1,Math.ceil(Q.length/J)),$=Math.min(j,Ie),Le=Q.slice(($-1)*J,$*J),Re=Le.reduce((e,t)=>(G(t)!==`revoked`&&e.push(t.id),e),[]),ze=Re.length>0&&Re.every(e=>N.has(e)),Be=e=>{r(t=>{let n=new URLSearchParams(t);return e===`devices`?n.delete(`view`):n.set(`view`,e),n},{replace:!0})},Ve=async()=>{await Promise.all([Y.mutate(),a===`activity`?X.mutate():Promise.resolve()])},He=async()=>{if(!(u.length===0||f)){p(!0),h(!1);try{await ie(u.map(e=>e.id)),d([]),V(new Set),await Y.mutate()}catch{h(!0)}finally{p(!1)}}},Ue=e=>{e(),ne(1),V(new Set)};return(0,W.jsxs)(se,{children:[(0,W.jsx)(ce,{title:t.title,subtitle:t.subtitle,actions:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(I,{className:`size-9 shrink-0 p-0`,label:t.refresh,onClick:Ve}),(0,W.jsx)(Te,{onPaired:()=>void Y.mutate()})]})}),Y.error||X.error?(0,W.jsx)(`div`,{className:`rounded-xl bg-danger-soft px-4 py-3 text-sm text-danger`,children:t.loadError}):null,(0,W.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:[{label:t.activeDevices,value:Ne,filter:`active`},{label:t.onlineDevices,value:Me,filter:`online`},{label:t.staleDevices,value:Pe,filter:`stale`}].map(({label:e,value:t,filter:n})=>(0,W.jsxs)(`button`,{type:`button`,className:D(`touch-target rounded-xl px-4 py-3 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,w===n?`bg-surface-active`:`bg-surface-hover/20 hover:bg-surface-hover/50`),"aria-pressed":w===n,onClick:()=>{Ue(()=>te(n)),Be(`devices`)},children:[(0,W.jsx)(`span`,{className:`text-xs text-fg-muted`,children:e}),(0,W.jsx)(`span`,{className:`mt-1 block text-2xl font-semibold text-fg`,children:t})]},n))}),(0,W.jsx)(P,{items:[{id:`devices`,label:t.devicesTab,icon:C,count:Ne},{id:`activity`,label:t.activityTab,icon:g,count:X.data?.total}],activeTab:a,onChange:Be,ariaLabel:t.viewsAria,tabIdPrefix:`endpoint-management-tab`,panelIdPrefix:`endpoint-management-panel`}),(0,W.jsxs)(le,{id:`devices`,activeTab:a,tabIdPrefix:`endpoint-management-tab`,panelIdPrefix:`endpoint-management-panel`,title:t.devicesTitle,hint:t.devicesHint,children:[(0,W.jsx)(fe,{devices:Z,zh:e===`zh`}),(0,W.jsxs)(`div`,{className:`mb-4 grid gap-2 sm:grid-cols-[minmax(0,1fr)_11rem_11rem]`,children:[(0,W.jsxs)(`label`,{className:`relative block`,children:[(0,W.jsx)(`span`,{className:`sr-only`,children:t.searchDevices}),(0,W.jsx)(T,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`,"aria-hidden":!0}),(0,W.jsx)(`input`,{type:`search`,"aria-label":t.searchDevices,value:y,placeholder:t.searchDevices,className:`h-10 w-full rounded-lg border border-edge bg-surface-inset pl-9 pr-3 text-base text-fg placeholder:text-fg-subtle focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent sm:text-sm`,onChange:e=>Ue(()=>b(e.target.value))})]}),(0,W.jsx)(x,{value:w,options:[{value:`active`,label:t.filterActive},{value:`online`,label:t.status.online},{value:`offline`,label:t.status.offline},{value:`stale`,label:t.filterStale},{value:`revoked`,label:t.status.revoked},{value:`all`,label:t.filterAll}],placeholder:t.statusLabel,allowEmpty:!1,ariaLabel:t.statusLabel,onChange:e=>Ue(()=>te(e))}),(0,W.jsx)(x,{value:O,options:Fe.map(e=>({value:e,label:e})),placeholder:t.allPlatforms,emptyLabel:t.allPlatforms,ariaLabel:t.platformLabel,onChange:e=>Ue(()=>k(e))})]}),N.size>0?(0,W.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-3 rounded-xl bg-accent-soft px-3 py-2`,children:[(0,W.jsx)(`p`,{className:`text-sm font-medium text-accent-fg`,children:t.selectedCount.replace(`{{count}}`,String(N.size))}),(0,W.jsxs)(M,{variant:`secondary`,className:`text-danger`,onClick:()=>{h(!1),d(Z.filter(e=>N.has(e.id)))},children:[(0,W.jsx)(ee,{className:`size-4`,"aria-hidden":!0}),t.removeSelected]})]}):null,Z.length===0?(0,W.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.noDevices}):Q.length===0?(0,W.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.noMatchingDevices}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:`flex min-h-10 items-center gap-3 border-b border-edge-subtle px-1`,children:(0,W.jsxs)(`label`,{className:D(`touch-target flex items-center gap-2 text-xs text-fg-muted`,Re.length>0?`cursor-pointer`:`cursor-not-allowed opacity-50`),children:[(0,W.jsx)(`input`,{type:`checkbox`,"aria-label":t.selectPage,checked:ze,disabled:Re.length===0,className:`size-4 accent-accent`,onChange:e=>{V(t=>{let n=new Set(t);for(let t of Re)e.target.checked?n.add(t):n.delete(t);return n})}}),t.selectPage]})}),(0,W.jsx)(`ul`,{className:`divide-y divide-edge-subtle`,children:Le.map(e=>{let n=G(e),r=e.kind===`mobile`?E:S;return(0,W.jsxs)(`li`,{className:`flex items-center gap-3`,children:[(0,W.jsx)(`label`,{className:D(`touch-target flex size-10 shrink-0 items-center justify-center`,n===`revoked`?`cursor-not-allowed opacity-40`:`cursor-pointer`),children:(0,W.jsx)(`input`,{type:`checkbox`,checked:N.has(e.id),disabled:n===`revoked`,"aria-label":t.selectDevice.replace(`{{name}}`,e.displayName),className:`size-4 accent-accent`,onChange:t=>{V(n=>{let r=new Set(n);return t.target.checked?r.add(e.id):r.delete(e.id),r})}})}),(0,W.jsxs)(`button`,{type:`button`,className:`touch-target flex min-w-0 flex-1 items-center gap-3 py-3 text-left hover:bg-surface-hover/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,onClick:()=>c(e),children:[(0,W.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-lg bg-surface-inset text-fg-muted`,children:(0,W.jsx)(r,{className:`size-4`,"aria-hidden":!0})}),(0,W.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,W.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2`,children:[(0,W.jsx)(`span`,{className:`truncate text-sm font-medium text-fg`,children:e.displayName}),(0,W.jsx)(ke,{status:n,label:t.status[n]})]}),(0,W.jsxs)(`span`,{className:`mt-1 block text-xs text-fg-muted`,children:[e.platform,` · `,be(e.id),` · `,t.lastSeen,`: `,e.lastSeenAt?Ae.format(e.lastSeenAt):t.never]})]}),(0,W.jsx)(`span`,{className:`hidden shrink-0 text-right text-xs text-fg-muted sm:block`,children:t.endpointSummary.replace(`{{endpoints}}`,String(e.endpoints.length)).replace(`{{tools}}`,String(_e(e)))}),(0,W.jsx)(v,{className:`size-4 shrink-0 text-fg-subtle`,"aria-hidden":!0})]})]},e.id)})}),(0,W.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center justify-between gap-3 border-t border-edge-subtle pt-3`,children:[(0,W.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.paginationSummary.replace(`{{from}}`,String(($-1)*J+1)).replace(`{{to}}`,String(Math.min($*J,Q.length))).replace(`{{total}}`,String(Q.length))}),(0,W.jsxs)(`div`,{className:`flex gap-2`,children:[(0,W.jsx)(M,{variant:`ghost`,className:`size-9 p-0`,"aria-label":t.previousPage,disabled:$<=1,onClick:()=>ne(e=>Math.max(1,e-1)),children:(0,W.jsx)(_,{className:`size-4`,"aria-hidden":!0})}),(0,W.jsx)(M,{variant:`ghost`,className:`size-9 p-0`,"aria-label":t.nextPage,disabled:$>=Ie,onClick:()=>ne(e=>Math.min(Ie,e+1)),children:(0,W.jsx)(v,{className:`size-4`,"aria-hidden":!0})})]})]})]})]}),(0,W.jsxs)(le,{id:`activity`,activeTab:a,tabIdPrefix:`endpoint-management-tab`,panelIdPrefix:`endpoint-management-panel`,title:t.callsTitle,hint:t.callsHint,children:[(0,W.jsxs)(`div`,{className:`mb-4 grid gap-2 sm:grid-cols-2 lg:grid-cols-4`,children:[(0,W.jsxs)(`label`,{className:`relative block sm:col-span-2 lg:col-span-1`,children:[(0,W.jsx)(`span`,{className:`sr-only`,children:t.searchActivity}),(0,W.jsx)(T,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`,"aria-hidden":!0}),(0,W.jsx)(`input`,{type:`search`,"aria-label":t.searchActivity,value:H,placeholder:t.searchActivity,className:`h-10 w-full rounded-lg border border-edge bg-surface-inset pl-9 pr-3 text-base text-fg placeholder:text-fg-subtle focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent sm:text-sm`,onChange:e=>{de(e.target.value),q(1)}})]}),(0,W.jsx)(x,{value:me,options:Z.map(e=>({value:e.id,label:`${e.displayName} · ${be(e.id)}`})),placeholder:t.allDevices,emptyLabel:t.allDevices,ariaLabel:t.deviceLabel,onChange:e=>{he(e),q(1)}}),(0,W.jsx)(x,{value:ge,options:[{value:`running`,label:t.status.running},{value:`succeeded`,label:t.status.succeeded},{value:`failed`,label:t.status.failed}],placeholder:t.allStatuses,emptyLabel:t.allStatuses,ariaLabel:t.statusLabel,onChange:e=>{Se(e),q(1)}}),(0,W.jsx)(x,{value:K,options:[{value:`read`,label:t.effects.read},{value:`write`,label:t.effects.write},{value:`destructive`,label:t.effects.destructive}],placeholder:t.allEffects,emptyLabel:t.allEffects,ariaLabel:t.effectLabel,onChange:e=>{Ce(e),q(1)}})]}),X.isLoading&&!X.data?(0,W.jsx)(R,{sections:1}):null,je.length===0&&!X.isLoading?(0,W.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.noMatchingCalls}):null,(0,W.jsx)(`div`,{className:`space-y-2`,children:je.map(n=>(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 rounded-lg bg-surface-base/55 px-3 py-2.5`,children:[(0,W.jsxs)(`div`,{className:`min-w-0`,children:[(0,W.jsx)(`p`,{className:`break-all text-sm font-medium text-fg`,children:n.toolName}),(0,W.jsxs)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:[Ae.format(n.startedAt),` · `,t.effects[n.effect],` · `,n.endpointId]}),n.errorMessage?(0,W.jsx)(`p`,{className:`mt-1 text-xs text-danger`,children:n.errorMessage}):null]}),(0,W.jsxs)(`div`,{className:`flex max-w-xs flex-col items-end gap-1`,children:[(0,W.jsx)(ke,{status:n.status,label:n.errorCode===`OUTCOME_UNKNOWN`?e===`zh`?`结果未知`:`Outcome unknown`:t.status[n.status]}),n.operationId&&n.toolName.startsWith(`provider_`)&&n.errorCode===`OUTCOME_UNKNOWN`?(0,W.jsx)(ue,{operationId:n.operationId,zh:e===`zh`}):null]})]},n.id))}),X.data&&X.data.total>0?(0,W.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center justify-between gap-3 border-t border-edge-subtle pt-3`,children:[(0,W.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.paginationSummary.replace(`{{from}}`,String((X.data.page-1)*X.data.pageSize+1)).replace(`{{to}}`,String(Math.min(X.data.page*X.data.pageSize,X.data.total))).replace(`{{total}}`,String(X.data.total))}),(0,W.jsxs)(`div`,{className:`flex gap-2`,children:[(0,W.jsx)(M,{variant:`ghost`,className:`size-9 p-0`,"aria-label":t.previousPage,disabled:X.data.page<=1,onClick:()=>q(e=>Math.max(1,e-1)),children:(0,W.jsx)(_,{className:`size-4`,"aria-hidden":!0})}),(0,W.jsx)(M,{variant:`ghost`,className:`size-9 p-0`,"aria-label":t.nextPage,disabled:X.data.page>=X.data.totalPages,onClick:()=>q(e=>Math.min(X.data.totalPages,e+1)),children:(0,W.jsx)(v,{className:`size-4`,"aria-hidden":!0})})]})]}):null]}),(0,W.jsx)(xe,{device:o,busy:f,onRename:async(e,t)=>{await z(e.id,t,e.settingsRevision??0);let n=await Y.mutate();c(n?.find(t=>t.id===e.id)??null)},onClose:()=>c(null),onRevoke:e=>{c(null),h(!1),d([e])}}),(0,W.jsx)(F,{open:u.length>0,title:u.length>1?t.removeManyTitle:t.removeTitle,description:`${u.length>1?t.removeManyDescription.replace(`{{count}}`,String(u.length)):t.removeDescription.replace(`{{name}}`,u[0]?.displayName??``)}${m?`\n\n${t.revokeError}`:``}`,confirmLabel:f?t.revoking:t.removeDevice,cancelLabel:t.cancel,destructive:!0,onConfirm:()=>void He(),onCancel:()=>{f||d([])}})]})}export{X as EndpointToolsManagementSettings};
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{m as i}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{a,i as o,n as s,o as c}from"./locale-store-D3c8DIm-.js";import{t as l}from"./messages-DPLud9GK.js";import{a as u,n as d,o as f,r as p,s as m,t as h}from"./dist-CY7CS_D3.js";import{t as g}from"./activity-YogQEteU.js";import{t as _}from"./chevron-left-DqFhpbvK.js";import{t as v}from"./chevron-right-BweFrslA.js";import{n as y,r as b,t as x}from"./popover-select-CLsphyzA.js";import{t as S}from"./laptop-CI3hBVrl.js";import{n as C,t as ee}from"./shield-off-2jsucUds.js";import{t as w}from"./plus-Q2yW6OE7.js";import{t as T}from"./search-DA7gz22f.js";import{t as E}from"./smartphone-DSSsQFqA.js";import{t as te}from"./x-B_N4OPjy.js";import{t as D}from"./cn-0WouolD0.js";import{t as O}from"./skeleton-DzdOeGYz.js";import{s as k}from"./session-api-CuT7EPI0.js";import{i as A,o as j}from"./vendor-swr-CdRzEUwF.js";import{t as M}from"./button-Cc4hUNTt.js";import{i as ne,o as N}from"./settings-shell-dialog-layer-BU3UuiJr.js";import{t as P}from"./page-tabs-oeTY7z3_.js";import{t as F}from"./confirm-dialog-DrA5mTQp.js";import{t as I}from"./refresh-button-DiWdGAaX.js";import{n as L}from"./index.module-Cd9ENXfk.js";import{n as R}from"./settings-loading-skeleton-CAoOV17i.js";import{a as z,i as B,n as re,o as ie,r as ae,t as oe}from"./management-api-uxRxRX-6.js";import{n as se,t as ce}from"./settings-page-header-19GJ_a45.js";import{t as le}from"./settings-page-layout-B2WCzSel.js";import{t as V}from"./device-pairing-wizard-C4aSCbqo.js";var H=n(),U=e(t(),1),W=r();function ue({operationId:e,zh:t}){let[n,r]=(0,U.useState)(!1),[i,a]=(0,U.useState)(``);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(M,{variant:`ghost`,className:`h-7 px-2 text-xs`,disabled:n,onClick:async()=>{r(!0);try{let n=(await c(o(`/api/endpoint-tools/provider-operations/${encodeURIComponent(e)}`))).payload.receipt?.state;a(n===`succeeded`?t?`设备报告已完成,Gateway 未收到结果。`:`Device reported completion. Gateway did not receive the result.`:n===`running`?t?`设备仍在执行。`:`Device is still running.`:t?`设备未确认结果。`:`Device has not confirmed the outcome.`)}catch{a(t?`暂时无法核对设备状态。`:`Unable to check device status.`)}finally{r(!1)}},children:n?t?`核对中…`:`Checking…`:t?`核对设备状态`:`Check device status`}),i?(0,W.jsx)(`p`,{role:`status`,className:`text-right text-xs text-fg-muted`,children:i}):null]})}async function de(e=`GET`,t,n){let r=await a(o(`/api/endpoint-tools/target-authorizations`+(n?`/`+encodeURIComponent(n):``)),{method:e,...t?{body:JSON.stringify(t)}:{}});if(!r.ok)throw Error(r.status===403?`owner`:`unavailable`);return(await r.json()).payload}function fe({devices:e,zh:t}){let n=A(`device-single-call-grants`,()=>de(),{refreshInterval:5e3,shouldRetryOnError:!1}),r=A(n.error?null:`device-grant-conversations`,()=>k({limit:100}),{shouldRetryOnError:!1}),[i,a]=(0,U.useState)(``),[o,s]=(0,U.useState)(``),[c,l]=(0,U.useState)(``),[u,d]=(0,U.useState)(`weather`),[f,p]=(0,U.useState)(`approximate`),[m,h]=(0,U.useState)(`restaurant`),[g,_]=(0,U.useState)(!1),[v,y]=(0,U.useState)(!1);if(n.error)return null;let b=e.flatMap(e=>e.endpoints.map(t=>({...t,label:e.displayName+` · `+e.platform+` · `+e.id.slice(-8)}))),S=b.find(e=>e.endpointId===c)?.tools.find(e=>e.descriptor.name.endsWith(`.device.get_location`))?.descriptor.name,C=async()=>{if(!(!S||!i||!o)){_(!0),y(!1);try{await de(`POST`,{conversationId:i,requestorPrincipalId:o,targetEndpointId:c,toolName:S,arguments:{purpose:u,precision:f,...u===`nearby`?{category:m}:{}}}),await n.mutate()}catch{y(!0)}finally{_(!1)}}};return(0,W.jsxs)(`section`,{className:`mb-5 rounded-xl border border-edge bg-surface-base p-4`,children:[(0,W.jsx)(`h3`,{className:`font-semibold text-fg`,children:t?`跨设备单次授权`:`Single-call device authorization`}),(0,W.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:t?`为指定会话和来源设备授权一次定位查询,60 秒后失效。目标设备仍需确认;授权后请在来源设备继续请求。`:`Authorize one location query for a conversation and source device. Expires in 60 seconds; target-device consent is still required. Continue the request from the source device.`}),n.isLoading||r.isLoading?(0,W.jsx)(O,{className:`mt-3 h-28`}):(0,W.jsxs)(`div`,{className:`mt-3 grid gap-3 sm:grid-cols-2`,children:[(0,W.jsx)(x,{value:i,onChange:a,placeholder:t?`选择会话`:`Conversation`,ariaLabel:t?`会话`:`Conversation`,options:(r.data?.items??[]).map(e=>({value:e.key,label:e.name||e.key}))}),(0,W.jsx)(x,{value:o,onChange:s,placeholder:t?`消息来源设备`:`Source device`,ariaLabel:t?`消息来源设备`:`Source device`,options:e.filter(e=>e.endpoints.length>0).map(e=>({value:e.id,label:e.displayName+` · `+e.platform+` · `+e.id.slice(-8)}))}),(0,W.jsx)(x,{value:c,onChange:l,placeholder:t?`使用哪台设备的位置`:`Location device`,ariaLabel:t?`目标设备`:`Target device`,options:b.filter(e=>e.tools.some(e=>e.descriptor.name.endsWith(`.device.get_location`))).map(e=>({value:e.endpointId,label:e.label}))}),(0,W.jsx)(x,{placeholder:t?`用途`:`Purpose`,value:u,onChange:e=>d(e),ariaLabel:t?`用途`:`Purpose`,options:[{value:`weather`,label:t?`查询天气`:`Weather`},{value:`nearby`,label:t?`附近地点`:`Nearby places`}],allowEmpty:!1}),(0,W.jsx)(x,{placeholder:t?`精度`:`Precision`,value:f,onChange:e=>p(e),ariaLabel:t?`精度`:`Precision`,options:[{value:`approximate`,label:t?`大致位置`:`Approximate`},{value:`precise`,label:t?`精确位置`:`Precise`}],allowEmpty:!1}),u===`nearby`?(0,W.jsx)(x,{placeholder:t?`地点类型`:`Category`,value:m,onChange:h,ariaLabel:t?`附近地点类型`:`Place category`,options:[`restaurant`,`cafe`,`pharmacy`,`park`].map((e,n)=>({value:e,label:t?[`餐厅`,`咖啡馆`,`药店`,`公园`][n]:e})),allowEmpty:!1}):null,(0,W.jsx)(M,{variant:`primary`,disabled:g||!i||!o||!S,onClick:()=>void C(),children:t?`允许一次`:`Allow once`})]}),v?(0,W.jsx)(`p`,{role:`alert`,className:`mt-2 text-sm text-fg-muted`,children:t?`授权失败,请检查设备连接后重试。`:`Authorization failed. Check the device connection.`}):null,(0,W.jsx)(`div`,{className:`mt-3 space-y-2`,children:n.data?.map(r=>(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-2 text-sm text-fg-muted`,children:[(0,W.jsxs)(`span`,{children:[e.find(e=>e.endpoints.some(e=>e.endpointId===r.targetEndpointId))?.displayName??(t?`设备`:`Device`),` · `,r.state===`running`?t?`执行中`:`Running`:t?`等待本次调用`:`Awaiting one call`]}),(0,W.jsx)(M,{disabled:g,onClick:()=>{_(!0),de(`DELETE`,void 0,r.id).then(()=>n.mutate()).catch(()=>y(!0)).finally(()=>_(!1))},children:t?`撤销`:`Revoke`})]},r.id))})]})}var pe={ready:[`可用`,`Ready`],offline:[`离线`,`Offline`],authorization_required:[`等待批准`,`Approval required`],needs_foreground:[`需要设备前台运行`,`Foreground required`],permission_missing:[`缺少设备权限`,`Device permission required`],resource_busy:[`资源占用中`,`Resource busy`],unavailable:[`暂不可用`,`Unavailable`]};function me({principalId:e,zh:t}){let n=o(`/api/endpoint-tools/providers`),{data:r,error:i,mutate:a}=A(`${n}?principalId=${encodeURIComponent(e)}`,e=>c(e),{refreshInterval:15e3}),[s,l]=(0,U.useState)(),[u,d]=(0,U.useState)(!1),f=r?.payload.filter(t=>t.principalId===e),p=async t=>{l(t.provider.localId),d(!1);try{await c(n+`/admission`,{method:`POST`,body:JSON.stringify({principalId:e,localId:t.provider.localId,expectedDigest:t.digest,allowed:!t.admitted})}),await a()}catch{d(!0),await a()}finally{l(void 0)}};return(0,W.jsxs)(`section`,{className:`space-y-2`,children:[(0,W.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:t?`设备能力`:`Device capabilities`}),!r&&!i?(0,W.jsx)(O,{className:`h-24 w-full rounded-xl`}):null,i||u?(0,W.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:t?`能力信息更新失败,请刷新后重试。`:`Unable to update capabilities. Refresh and retry.`}):null,f?.length===0?(0,W.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t?`此设备尚未上报扩展能力。`:`No additional capabilities reported.`}):null,f?.map(e=>(0,W.jsxs)(`article`,{className:`space-y-2 rounded-xl border border-edge-subtle p-3`,children:[(0,W.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,W.jsx)(`h4`,{className:`break-words text-sm font-medium text-fg`,children:e.provider.title}),(0,W.jsx)(`span`,{className:`shrink-0 text-xs text-fg-muted`,children:(pe[e.status]??pe.unavailable)[+!t]})]}),(0,W.jsx)(`p`,{className:`break-words text-xs text-fg-muted`,children:e.provider.summary}),(0,W.jsxs)(`details`,{className:`text-xs text-fg-subtle`,children:[(0,W.jsx)(`summary`,{className:`cursor-pointer`,children:t?`${e.provider.tools.length} 项能力及权限`:`${e.provider.tools.length} tools and permissions`}),(0,W.jsx)(`ul`,{className:`mt-2 space-y-2`,children:e.provider.tools.map(e=>(0,W.jsxs)(`li`,{className:`break-words`,children:[(0,W.jsx)(`p`,{className:`font-medium text-fg`,children:e.title}),(0,W.jsx)(`p`,{children:e.description}),(0,W.jsxs)(`p`,{children:[e.effect,` · `,e.sensitivity,` · `,e.confirmation===`always`?t?`每次确认`:`Confirm each call`:t?`按批准范围执行`:`Approved scope`,e.requiredPermissions.length?` · ${e.requiredPermissions.join(`, `)}`:``]})]},e.name))})]}),(0,W.jsx)(M,{variant:`secondary`,disabled:s!==void 0,onClick:()=>void p(e),children:s===e.provider.localId?t?`保存中…`:`Saving…`:e.admitted?t?`撤销能力批准`:`Revoke approval`:t?`批准这些能力`:`Approve capabilities`})]},e.provider.localId))]})}var he=720*60*60*1e3;function ge(e){let t=[e.access,e.principal].filter(e=>e!==null);return t.length>0&&t.every(e=>e.revokedAt!==void 0)}function G(e){return ge(e)?`revoked`:e.endpoints.length>0?`online`:`offline`}function _e(e){return new Set(e.endpoints.flatMap(e=>e.tools.map(({descriptor:e})=>e.name))).size}function ve(e,t=Date.now()){return G(e)===`offline`&&(e.lastSeenAt??e.createdAt)<t-he}function ye(e,t,n=Date.now()){let r=t.query.trim().toLocaleLowerCase();return e.filter(e=>{let i=G(e),a=t.status===`all`||(t.status===`active`?i!==`revoked`:t.status===`stale`?ve(e,n):i===t.status),o=!t.platform||e.platform===t.platform,s=!r||[e.displayName,e.id,e.kind,e.platform].some(e=>e.toLocaleLowerCase().includes(r));return a&&o&&s})}function be(e){return e.length>8?e.slice(-8):e}function xe(e){let t=(0,H.c)(61),{device:n,busy:r,onClose:i,onRevoke:a,onRename:o}=e,c=s(Se),g;t[0]===c?g=t[1]:(g=l(c),t[0]=c,t[1]=g);let _=g.endpointToolsSettings,v=c===`zh`?`zh-CN`:`en`,y;t[2]===v?y=t[3]:(y=new Intl.DateTimeFormat(v,{dateStyle:`medium`,timeStyle:`short`}),t[2]=v,t[3]=y);let b=y,x;t[4]===n?x=t[5]:(x=n?G(n):`offline`,t[4]=n,t[5]=x);let S=x,C=n!==null,w;t[6]===i?w=t[7]:(w=e=>!e&&i(),t[6]=i,t[7]=w);let T;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,W.jsx)(u,{className:D(`xopc-dialog-overlay fixed inset-0 bg-scrim`,N)}),t[8]=T):T=t[8];let E;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(E=D(`xopc-drawer-right fixed right-0 top-0 flex size-full max-w-lg flex-col border-l border-edge bg-surface-overlay shadow-popover outline-none`,ne),t[9]=E):E=t[9];let O=n?.displayName??_.deviceDetails,k;t[10]===O?k=t[11]:(k=(0,W.jsx)(m,{className:`truncate text-base font-semibold text-fg`,children:O}),t[10]=O,t[11]=k);let A;t[12]===n?A=t[13]:(A=n?(0,W.jsxs)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:[n.kind,` · `,n.platform,` · `,be(n.id)]}):null,t[12]=n,t[13]=A);let j;t[14]!==k||t[15]!==A?(j=(0,W.jsxs)(`div`,{className:`min-w-0`,children:[k,A]}),t[14]=k,t[15]=A,t[16]=j):j=t[16];let P;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,W.jsx)(te,{className:`size-5`,"aria-hidden":!0}),t[17]=P):P=t[17];let F;t[18]===_.close?F=t[19]:(F=(0,W.jsx)(d,{asChild:!0,children:(0,W.jsx)(M,{variant:`ghost`,className:`size-9 shrink-0 p-0`,"aria-label":_.close,children:P})}),t[18]=_.close,t[19]=F);let I;t[20]!==j||t[21]!==F?(I=(0,W.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-3 border-b border-edge px-4 py-3`,children:[j,F]}),t[20]=j,t[21]=F,t[22]=I):I=t[22];let L;t[23]!==_.accessActive||t[24]!==_.accessRevoked||t[25]!==_.accessTitle||t[26]!==_.createdAt||t[27]!==_.endpointCount||t[28]!==_.endpointsTitle||t[29]!==_.identityId||t[30]!==_.identityTitle||t[31]!==_.lastSeen||t[32]!==_.never||t[33]!==_.noAccessIdentity||t[34]!==_.noOnlineEndpoints||t[35]!==_.noPermissions||t[36]!==_.permissions||t[37]!==_.status||t[38]!==_.statusLabel||t[39]!==_.toolCount||t[40]!==n||t[41]!==b||t[42]!==c||t[43]!==o||t[44]!==S?(L=n?(0,W.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-5 overflow-y-auto p-4`,children:[n.principal&&S!==`revoked`&&o?(0,W.jsx)(Ce,{device:n,zh:c===`zh`,onRename:o},`${n.id}:${n.settingsRevision??0}`):null,(0,W.jsxs)(`dl`,{className:`grid grid-cols-2 gap-3 rounded-xl bg-surface-hover/40 p-4`,children:[(0,W.jsx)(K,{label:_.statusLabel,value:_.status[S]}),(0,W.jsx)(K,{label:_.lastSeen,value:n.lastSeenAt?b.format(n.lastSeenAt):_.never}),(0,W.jsx)(K,{label:_.endpointCount,value:String(n.endpoints.length)}),(0,W.jsx)(K,{label:_.toolCount,value:String(_e(n))})]}),(0,W.jsxs)(`section`,{children:[(0,W.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:_.accessTitle}),(0,W.jsx)(`div`,{className:`mt-2 rounded-xl border border-edge-subtle bg-surface-base p-3 text-xs text-fg-muted`,children:n.access?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`p`,{children:n.access.revokedAt?_.accessRevoked:_.accessActive}),(0,W.jsx)(`p`,{className:`mt-1`,children:n.access.requestProofVersion===1?c===`zh`?`设备请求签名已启用`:`Device request signing enabled`:c===`zh`?`请求签名未启用,设备不可用`:`Request signing is missing; device unavailable`}),(0,W.jsxs)(`p`,{className:`mt-1 break-words`,children:[_.permissions,`: `,n.access.scopes.join(`, `)||_.noPermissions]})]}):(0,W.jsx)(`p`,{children:_.noAccessIdentity})})]}),n.principal&&S!==`revoked`?(0,W.jsx)(me,{principalId:n.id,zh:c===`zh`},n.id):null,n.access&&!n.access.revokedAt&&[`ios`,`android`,`harmonyos`].includes(n.platform??``)?(0,W.jsx)(we,{device:n,zh:c===`zh`},n.id):null,(0,W.jsxs)(`section`,{children:[(0,W.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:_.endpointsTitle}),(0,W.jsxs)(`div`,{className:`mt-2 space-y-2`,children:[n.endpoints.length===0?(0,W.jsx)(`p`,{className:`text-sm text-fg-muted`,children:_.noOnlineEndpoints}):null,n.endpoints.map(e=>(0,W.jsxs)(`article`,{className:`rounded-xl border border-edge-subtle bg-surface-base p-3`,children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-2`,children:[(0,W.jsx)(`p`,{className:`min-w-0 break-all text-xs font-medium text-fg`,children:e.endpointId}),(0,W.jsxs)(`span`,{className:`text-xs text-fg-muted`,children:[_.status[e.availability],` · v`,e.appVersion]})]}),(0,W.jsx)(`div`,{className:`mt-3 space-y-2`,children:e.tools.map(e=>{let{descriptor:t}=e;return(0,W.jsxs)(`div`,{className:`rounded-lg bg-surface-hover/50 px-3 py-2`,children:[(0,W.jsx)(`p`,{className:`break-all text-xs font-medium text-fg`,children:t.title}),(0,W.jsxs)(`p`,{className:`mt-0.5 break-words text-xs text-fg-subtle`,children:[t.requiresForeground?c===`zh`?`需要设备在前台 · `:`Requires foreground · `:``,t.confirmation===`always`?c===`zh`?`每次确认`:`Confirm each time`:c===`zh`?`按已授权范围调用`:`Uses the authorized scope`]})]},t.name)})})]},e.connectionId))]})]}),(0,W.jsxs)(`section`,{children:[(0,W.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:_.identityTitle}),n.principal&&S!==`revoked`&&o?(0,W.jsx)(Ce,{device:n,zh:c===`zh`,onRename:o},`${n.id}:${n.settingsRevision??0}`):null,(0,W.jsxs)(`dl`,{className:`mt-2 rounded-xl border border-edge-subtle bg-surface-base p-3 text-xs`,children:[(0,W.jsx)(K,{label:_.identityId,value:n.id,breakAll:!0}),(0,W.jsx)(`div`,{className:`mt-3`,children:(0,W.jsx)(K,{label:_.createdAt,value:b.format(n.createdAt)})})]})]})]}):null,t[23]=_.accessActive,t[24]=_.accessRevoked,t[25]=_.accessTitle,t[26]=_.createdAt,t[27]=_.endpointCount,t[28]=_.endpointsTitle,t[29]=_.identityId,t[30]=_.identityTitle,t[31]=_.lastSeen,t[32]=_.never,t[33]=_.noAccessIdentity,t[34]=_.noOnlineEndpoints,t[35]=_.noPermissions,t[36]=_.permissions,t[37]=_.status,t[38]=_.statusLabel,t[39]=_.toolCount,t[40]=n,t[41]=b,t[42]=c,t[43]=o,t[44]=S,t[45]=L):L=t[45];let R;t[46]!==r||t[47]!==_.removeDevice||t[48]!==_.revoking||t[49]!==n||t[50]!==a||t[51]!==S?(R=n&&S!==`revoked`?(0,W.jsx)(`div`,{className:`shrink-0 border-t border-edge px-4 py-3`,children:(0,W.jsxs)(M,{variant:`secondary`,className:`w-full text-danger`,disabled:r,onClick:()=>a(n),children:[(0,W.jsx)(ee,{className:`size-4`,"aria-hidden":!0}),r?_.revoking:_.removeDevice]})}):null,t[46]=r,t[47]=_.removeDevice,t[48]=_.revoking,t[49]=n,t[50]=a,t[51]=S,t[52]=R):R=t[52];let z;t[53]!==I||t[54]!==L||t[55]!==R?(z=(0,W.jsxs)(f,{children:[T,(0,W.jsxs)(p,{className:E,"aria-describedby":void 0,children:[I,L,R]})]}),t[53]=I,t[54]=L,t[55]=R,t[56]=z):z=t[56];let B;return t[57]!==z||t[58]!==C||t[59]!==w?(B=(0,W.jsx)(h,{open:C,onOpenChange:w,children:z}),t[57]=z,t[58]=C,t[59]=w,t[60]=B):B=t[60],B}function Se(e){return e.language}function K(e){let t=(0,H.c)(10),{label:n,value:r,breakAll:i}=e,a=i!==void 0&&i,o;t[0]===n?o=t[1]:(o=(0,W.jsx)(`dt`,{className:`text-xs text-fg-subtle`,children:n}),t[0]=n,t[1]=o);let s=a&&`break-all font-mono text-xs`,c;t[2]===s?c=t[3]:(c=D(`mt-1 text-sm text-fg`,s),t[2]=s,t[3]=c);let l;t[4]!==c||t[5]!==r?(l=(0,W.jsx)(`dd`,{className:c,children:r}),t[4]=c,t[5]=r,t[6]=l):l=t[6];let u;return t[7]!==o||t[8]!==l?(u=(0,W.jsxs)(`div`,{className:`min-w-0`,children:[o,l]}),t[7]=o,t[8]=l,t[9]=u):u=t[9],u}function Ce({device:e,zh:t,onRename:n}){let[r,i]=(0,U.useState)(e.displayName),[a,o]=(0,U.useState)(!1),[s,c]=(0,U.useState)(!1);return(0,W.jsxs)(`form`,{className:`space-y-2`,onSubmit:async t=>{if(t.preventDefault(),!(a||!r.trim())){o(!0),c(!1);try{await n(e,r.trim())}catch{c(!0)}finally{o(!1)}}},children:[(0,W.jsxs)(`label`,{className:`block text-sm text-fg`,children:[t?`设备名称`:`Device name`,(0,W.jsx)(`input`,{value:r,maxLength:80,onChange:e=>i(e.target.value),className:`mt-2 h-10 w-full rounded-lg border border-edge bg-surface-inset px-3 text-fg`})]}),(0,W.jsx)(M,{type:`submit`,variant:`secondary`,disabled:a||!r.trim()||r.trim()===e.displayName,children:a?t?`保存中…`:`Saving…`:t?`保存名称`:`Save name`}),s?(0,W.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:t?`保存失败,请刷新设备信息后重试。`:`Unable to save. Refresh device information and retry.`}):null]})}function we({device:e,zh:t}){let n=e.access?.scopes.includes(`phone.control`)?`control`:e.access?.scopes.includes(`phone.view`)?`view`:`none`,[r,i]=(0,U.useState)(n),[a,s]=(0,U.useState)(!1),[l,u]=(0,U.useState)(!1);return(0,U.useEffect)(()=>i(n),[n]),(0,W.jsxs)(`section`,{className:`space-y-2`,children:[(0,W.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:t?`云手机访问`:`Cloud phone access`}),(0,W.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t?`移动端配对后默认可查看并接管。可在此关闭,或撤销整个设备的授权。`:`Mobile pairing includes viewing and control by default. Disable it here or revoke the device entirely.`}),(0,W.jsxs)(y,{value:r,disabled:a,onChange:async t=>{let n=t.target.value;s(!0),u(!1);try{await c(o(`/api/phone/device-access/${encodeURIComponent(e.id)}`),{method:`PATCH`,body:JSON.stringify({access:n})}),i(n),await j(o(`/api/endpoint-tools/devices`))}catch{u(!0)}finally{s(!1)}},children:[(0,W.jsx)(b,{value:`none`,children:t?`不允许`:`Not allowed`}),(0,W.jsx)(b,{value:`view`,children:t?`仅查看`:`View only`}),(0,W.jsx)(b,{value:`control`,children:t?`查看并接管`:`View and control`})]}),l?(0,W.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:t?`授权保存失败,请重试。`:`Unable to save phone access.`}):null]})}function Te(e){let t=(0,H.c)(19),{onPaired:n}=e,[r,a]=i(),o=s(Ee),c;t[0]===o?c=t[1]:(c=l(o),t[0]=o,t[1]=c);let u=c.endpointToolsSettings.deviceAccess,d;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(d={open:!1},t[2]=d):d=t[2];let[f,p]=(0,U.useState)(d),m,h;t[3]!==r||t[4]!==a?(m=()=>{let e=r.get(`startDevicePairing`);e!==`mobile`&&e!==`browser`||(p({open:!0,target:e}),a(q,{replace:!0}))},h=[r,a],t[3]=r,t[4]=a,t[5]=m,t[6]=h):(m=t[5],h=t[6]),(0,U.useEffect)(m,h);let g,_;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>p({open:!0}),_=(0,W.jsx)(w,{className:`size-4`,"aria-hidden":!0}),t[7]=g,t[8]=_):(g=t[7],_=t[8]);let v;t[9]===u.addDevice?v=t[10]:(v=(0,W.jsxs)(M,{variant:`primary`,onClick:g,children:[_,u.addDevice]}),t[9]=u.addDevice,t[10]=v);let y;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(y=e=>p(t=>({...t,open:e})),t[11]=y):y=t[11];let b;t[12]!==f.open||t[13]!==f.target||t[14]!==n?(b=(0,W.jsx)(V,{open:f.open,onOpenChange:y,onPaired:n,targetKind:f.target}),t[12]=f.open,t[13]=f.target,t[14]=n,t[15]=b):b=t[15];let x;return t[16]!==v||t[17]!==b?(x=(0,W.jsxs)(W.Fragment,{children:[v,b]}),t[16]=v,t[17]=b,t[18]=x):x=t[18],x}function q(e){let t=new URLSearchParams(e);return t.delete(`startDevicePairing`),t}function Ee(e){return e.language}var De=5e3,J=20,Oe=20;function Y(e){return e===`online`||e===`succeeded`?`bg-success-soft text-success`:e===`running`?`bg-accent-soft text-accent-fg`:e===`failed`||e===`revoked`?`bg-danger-soft text-danger`:`bg-surface-hover text-fg-muted`}function ke(e){let t=(0,H.c)(5),{status:n,label:r}=e,i;t[0]===n?i=t[1]:(i=D(`rounded-full px-2 py-0.5 text-xs font-medium`,Y(n)),t[0]=n,t[1]=i);let a;return t[2]!==r||t[3]!==i?(a=(0,W.jsx)(`span`,{className:i,children:r}),t[2]=r,t[3]=i,t[4]=a):a=t[4],a}function X(){let e=s(e=>e.language),t=l(e).endpointToolsSettings,[n,r]=i(),a=n.get(`view`)===`activity`?`activity`:`devices`,[o,c]=(0,U.useState)(null),[u,d]=(0,U.useState)([]),[f,p]=(0,U.useState)(!1),[m,h]=(0,U.useState)(!1),[y,b]=(0,U.useState)(``),[w,te]=(0,U.useState)(`active`),[O,k]=(0,U.useState)(``),[j,ne]=(0,U.useState)(1),[N,V]=(0,U.useState)(()=>new Set),[H,de]=(0,U.useState)(``),[pe]=L(H,250),[me,he]=(0,U.useState)(``),[ge,Se]=(0,U.useState)(``),[K,Ce]=(0,U.useState)(``),[we,q]=(0,U.useState)(1),Ee={page:we,pageSize:Oe,query:pe,principalId:me,status:ge,effect:K},Y=A(B(),ae,{refreshInterval:De}),X=A(a===`activity`?oe(Ee):null,()=>re(Ee),{refreshInterval:De,keepPreviousData:!0}),Ae=(0,U.useMemo)(()=>new Intl.DateTimeFormat(e===`zh`?`zh-CN`:`en`,{dateStyle:`medium`,timeStyle:`short`}),[e]);if(Y.isLoading&&!Y.data)return(0,W.jsx)(se,{children:(0,W.jsx)(R,{sections:2})});let Z=Y.data??[],je=X.data?.items??[],Me=Z.filter(e=>G(e)===`online`).length,Ne=Z.filter(e=>G(e)!==`revoked`).length,Pe=Z.filter(e=>ve(e)).length,Fe=[...new Set(Z.map(e=>e.platform))].toSorted(),Q=ye(Z,{query:y,status:w,platform:O}),Ie=Math.max(1,Math.ceil(Q.length/J)),$=Math.min(j,Ie),Le=Q.slice(($-1)*J,$*J),Re=Le.reduce((e,t)=>(G(t)!==`revoked`&&e.push(t.id),e),[]),ze=Re.length>0&&Re.every(e=>N.has(e)),Be=e=>{r(t=>{let n=new URLSearchParams(t);return e===`devices`?n.delete(`view`):n.set(`view`,e),n},{replace:!0})},Ve=async()=>{await Promise.all([Y.mutate(),a===`activity`?X.mutate():Promise.resolve()])},He=async()=>{if(!(u.length===0||f)){p(!0),h(!1);try{await ie(u.map(e=>e.id)),d([]),V(new Set),await Y.mutate()}catch{h(!0)}finally{p(!1)}}},Ue=e=>{e(),ne(1),V(new Set)};return(0,W.jsxs)(se,{children:[(0,W.jsx)(ce,{title:t.title,subtitle:t.subtitle,actions:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(I,{className:`size-9 shrink-0 p-0`,label:t.refresh,onClick:Ve}),(0,W.jsx)(Te,{onPaired:()=>void Y.mutate()})]})}),Y.error||X.error?(0,W.jsx)(`div`,{className:`rounded-xl bg-danger-soft px-4 py-3 text-sm text-danger`,children:t.loadError}):null,(0,W.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:[{label:t.activeDevices,value:Ne,filter:`active`},{label:t.onlineDevices,value:Me,filter:`online`},{label:t.staleDevices,value:Pe,filter:`stale`}].map(({label:e,value:t,filter:n})=>(0,W.jsxs)(`button`,{type:`button`,className:D(`touch-target rounded-xl px-4 py-3 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,w===n?`bg-surface-active`:`bg-surface-hover/20 hover:bg-surface-hover/50`),"aria-pressed":w===n,onClick:()=>{Ue(()=>te(n)),Be(`devices`)},children:[(0,W.jsx)(`span`,{className:`text-xs text-fg-muted`,children:e}),(0,W.jsx)(`span`,{className:`mt-1 block text-2xl font-semibold text-fg`,children:t})]},n))}),(0,W.jsx)(P,{items:[{id:`devices`,label:t.devicesTab,icon:C,count:Ne},{id:`activity`,label:t.activityTab,icon:g,count:X.data?.total}],activeTab:a,onChange:Be,ariaLabel:t.viewsAria,tabIdPrefix:`endpoint-management-tab`,panelIdPrefix:`endpoint-management-panel`}),(0,W.jsxs)(le,{id:`devices`,activeTab:a,tabIdPrefix:`endpoint-management-tab`,panelIdPrefix:`endpoint-management-panel`,title:t.devicesTitle,hint:t.devicesHint,children:[(0,W.jsx)(fe,{devices:Z,zh:e===`zh`}),(0,W.jsxs)(`div`,{className:`mb-4 grid gap-2 sm:grid-cols-[minmax(0,1fr)_11rem_11rem]`,children:[(0,W.jsxs)(`label`,{className:`relative block`,children:[(0,W.jsx)(`span`,{className:`sr-only`,children:t.searchDevices}),(0,W.jsx)(T,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`,"aria-hidden":!0}),(0,W.jsx)(`input`,{type:`search`,"aria-label":t.searchDevices,value:y,placeholder:t.searchDevices,className:`h-10 w-full rounded-lg border border-edge bg-surface-inset pl-9 pr-3 text-base text-fg placeholder:text-fg-subtle focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent sm:text-sm`,onChange:e=>Ue(()=>b(e.target.value))})]}),(0,W.jsx)(x,{value:w,options:[{value:`active`,label:t.filterActive},{value:`online`,label:t.status.online},{value:`offline`,label:t.status.offline},{value:`stale`,label:t.filterStale},{value:`revoked`,label:t.status.revoked},{value:`all`,label:t.filterAll}],placeholder:t.statusLabel,allowEmpty:!1,ariaLabel:t.statusLabel,onChange:e=>Ue(()=>te(e))}),(0,W.jsx)(x,{value:O,options:Fe.map(e=>({value:e,label:e})),placeholder:t.allPlatforms,emptyLabel:t.allPlatforms,ariaLabel:t.platformLabel,onChange:e=>Ue(()=>k(e))})]}),N.size>0?(0,W.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-3 rounded-xl bg-accent-soft px-3 py-2`,children:[(0,W.jsx)(`p`,{className:`text-sm font-medium text-accent-fg`,children:t.selectedCount.replace(`{{count}}`,String(N.size))}),(0,W.jsxs)(M,{variant:`secondary`,className:`text-danger`,onClick:()=>{h(!1),d(Z.filter(e=>N.has(e.id)))},children:[(0,W.jsx)(ee,{className:`size-4`,"aria-hidden":!0}),t.removeSelected]})]}):null,Z.length===0?(0,W.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.noDevices}):Q.length===0?(0,W.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.noMatchingDevices}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:`flex min-h-10 items-center gap-3 border-b border-edge-subtle px-1`,children:(0,W.jsxs)(`label`,{className:D(`touch-target flex items-center gap-2 text-xs text-fg-muted`,Re.length>0?`cursor-pointer`:`cursor-not-allowed opacity-50`),children:[(0,W.jsx)(`input`,{type:`checkbox`,"aria-label":t.selectPage,checked:ze,disabled:Re.length===0,className:`size-4 accent-accent`,onChange:e=>{V(t=>{let n=new Set(t);for(let t of Re)e.target.checked?n.add(t):n.delete(t);return n})}}),t.selectPage]})}),(0,W.jsx)(`ul`,{className:`divide-y divide-edge-subtle`,children:Le.map(e=>{let n=G(e),r=e.kind===`mobile`?E:S;return(0,W.jsxs)(`li`,{className:`flex items-center gap-3`,children:[(0,W.jsx)(`label`,{className:D(`touch-target flex size-10 shrink-0 items-center justify-center`,n===`revoked`?`cursor-not-allowed opacity-40`:`cursor-pointer`),children:(0,W.jsx)(`input`,{type:`checkbox`,checked:N.has(e.id),disabled:n===`revoked`,"aria-label":t.selectDevice.replace(`{{name}}`,e.displayName),className:`size-4 accent-accent`,onChange:t=>{V(n=>{let r=new Set(n);return t.target.checked?r.add(e.id):r.delete(e.id),r})}})}),(0,W.jsxs)(`button`,{type:`button`,className:`touch-target flex min-w-0 flex-1 items-center gap-3 py-3 text-left hover:bg-surface-hover/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,onClick:()=>c(e),children:[(0,W.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-lg bg-surface-inset text-fg-muted`,children:(0,W.jsx)(r,{className:`size-4`,"aria-hidden":!0})}),(0,W.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,W.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2`,children:[(0,W.jsx)(`span`,{className:`truncate text-sm font-medium text-fg`,children:e.displayName}),(0,W.jsx)(ke,{status:n,label:t.status[n]})]}),(0,W.jsxs)(`span`,{className:`mt-1 block text-xs text-fg-muted`,children:[e.platform,` · `,be(e.id),` · `,t.lastSeen,`: `,e.lastSeenAt?Ae.format(e.lastSeenAt):t.never]})]}),(0,W.jsx)(`span`,{className:`hidden shrink-0 text-right text-xs text-fg-muted sm:block`,children:t.endpointSummary.replace(`{{endpoints}}`,String(e.endpoints.length)).replace(`{{tools}}`,String(_e(e)))}),(0,W.jsx)(v,{className:`size-4 shrink-0 text-fg-subtle`,"aria-hidden":!0})]})]},e.id)})}),(0,W.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center justify-between gap-3 border-t border-edge-subtle pt-3`,children:[(0,W.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.paginationSummary.replace(`{{from}}`,String(($-1)*J+1)).replace(`{{to}}`,String(Math.min($*J,Q.length))).replace(`{{total}}`,String(Q.length))}),(0,W.jsxs)(`div`,{className:`flex gap-2`,children:[(0,W.jsx)(M,{variant:`ghost`,className:`size-9 p-0`,"aria-label":t.previousPage,disabled:$<=1,onClick:()=>ne(e=>Math.max(1,e-1)),children:(0,W.jsx)(_,{className:`size-4`,"aria-hidden":!0})}),(0,W.jsx)(M,{variant:`ghost`,className:`size-9 p-0`,"aria-label":t.nextPage,disabled:$>=Ie,onClick:()=>ne(e=>Math.min(Ie,e+1)),children:(0,W.jsx)(v,{className:`size-4`,"aria-hidden":!0})})]})]})]})]}),(0,W.jsxs)(le,{id:`activity`,activeTab:a,tabIdPrefix:`endpoint-management-tab`,panelIdPrefix:`endpoint-management-panel`,title:t.callsTitle,hint:t.callsHint,children:[(0,W.jsxs)(`div`,{className:`mb-4 grid gap-2 sm:grid-cols-2 lg:grid-cols-4`,children:[(0,W.jsxs)(`label`,{className:`relative block sm:col-span-2 lg:col-span-1`,children:[(0,W.jsx)(`span`,{className:`sr-only`,children:t.searchActivity}),(0,W.jsx)(T,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`,"aria-hidden":!0}),(0,W.jsx)(`input`,{type:`search`,"aria-label":t.searchActivity,value:H,placeholder:t.searchActivity,className:`h-10 w-full rounded-lg border border-edge bg-surface-inset pl-9 pr-3 text-base text-fg placeholder:text-fg-subtle focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent sm:text-sm`,onChange:e=>{de(e.target.value),q(1)}})]}),(0,W.jsx)(x,{value:me,options:Z.map(e=>({value:e.id,label:`${e.displayName} · ${be(e.id)}`})),placeholder:t.allDevices,emptyLabel:t.allDevices,ariaLabel:t.deviceLabel,onChange:e=>{he(e),q(1)}}),(0,W.jsx)(x,{value:ge,options:[{value:`running`,label:t.status.running},{value:`succeeded`,label:t.status.succeeded},{value:`failed`,label:t.status.failed}],placeholder:t.allStatuses,emptyLabel:t.allStatuses,ariaLabel:t.statusLabel,onChange:e=>{Se(e),q(1)}}),(0,W.jsx)(x,{value:K,options:[{value:`read`,label:t.effects.read},{value:`write`,label:t.effects.write},{value:`destructive`,label:t.effects.destructive}],placeholder:t.allEffects,emptyLabel:t.allEffects,ariaLabel:t.effectLabel,onChange:e=>{Ce(e),q(1)}})]}),X.isLoading&&!X.data?(0,W.jsx)(R,{sections:1}):null,je.length===0&&!X.isLoading?(0,W.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.noMatchingCalls}):null,(0,W.jsx)(`div`,{className:`space-y-2`,children:je.map(n=>(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 rounded-lg bg-surface-base/55 px-3 py-2.5`,children:[(0,W.jsxs)(`div`,{className:`min-w-0`,children:[(0,W.jsx)(`p`,{className:`break-all text-sm font-medium text-fg`,children:n.toolName}),(0,W.jsxs)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:[Ae.format(n.startedAt),` · `,t.effects[n.effect],` · `,n.endpointId]}),n.errorMessage?(0,W.jsx)(`p`,{className:`mt-1 text-xs text-danger`,children:n.errorMessage}):null]}),(0,W.jsxs)(`div`,{className:`flex max-w-xs flex-col items-end gap-1`,children:[(0,W.jsx)(ke,{status:n.status,label:n.errorCode===`OUTCOME_UNKNOWN`?e===`zh`?`结果未知`:`Outcome unknown`:t.status[n.status]}),n.operationId&&n.toolName.startsWith(`provider_`)&&n.errorCode===`OUTCOME_UNKNOWN`?(0,W.jsx)(ue,{operationId:n.operationId,zh:e===`zh`}):null]})]},n.id))}),X.data&&X.data.total>0?(0,W.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center justify-between gap-3 border-t border-edge-subtle pt-3`,children:[(0,W.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.paginationSummary.replace(`{{from}}`,String((X.data.page-1)*X.data.pageSize+1)).replace(`{{to}}`,String(Math.min(X.data.page*X.data.pageSize,X.data.total))).replace(`{{total}}`,String(X.data.total))}),(0,W.jsxs)(`div`,{className:`flex gap-2`,children:[(0,W.jsx)(M,{variant:`ghost`,className:`size-9 p-0`,"aria-label":t.previousPage,disabled:X.data.page<=1,onClick:()=>q(e=>Math.max(1,e-1)),children:(0,W.jsx)(_,{className:`size-4`,"aria-hidden":!0})}),(0,W.jsx)(M,{variant:`ghost`,className:`size-9 p-0`,"aria-label":t.nextPage,disabled:X.data.page>=X.data.totalPages,onClick:()=>q(e=>Math.min(X.data.totalPages,e+1)),children:(0,W.jsx)(v,{className:`size-4`,"aria-hidden":!0})})]})]}):null]}),(0,W.jsx)(xe,{device:o,busy:f,onRename:async(e,t)=>{await z(e.id,t,e.settingsRevision??0);let n=await Y.mutate();c(n?.find(t=>t.id===e.id)??null)},onClose:()=>c(null),onRevoke:e=>{c(null),h(!1),d([e])}}),(0,W.jsx)(F,{open:u.length>0,title:u.length>1?t.removeManyTitle:t.removeTitle,description:`${u.length>1?t.removeManyDescription.replace(`{{count}}`,String(u.length)):t.removeDescription.replace(`{{name}}`,u[0]?.displayName??``)}${m?`\n\n${t.revokeError}`:``}`,confirmLabel:f?t.revoking:t.removeDevice,cancelLabel:t.cancel,destructive:!0,onConfirm:()=>void He(),onCancel:()=>{f||d([])}})]})}export{X as EndpointToolsManagementSettings};
|
package/dist/gateway/static/root/assets/{markdown-view-DHjn1-ML.js → markdown-view-ohhExTMC.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,i as n,n as r,t as i}from"./vendor-react-BOUWij0V.js";import{l as a,u as o}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{n as s}from"./locale-store-
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,i as n,n as r,t as i}from"./vendor-react-BOUWij0V.js";import{l as a,u as o}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{n as s}from"./locale-store-D3c8DIm-.js";import{t as c}from"./messages-DPLud9GK.js";import{a as l,n as u,o as d,r as f,s as p,t as m}from"./dist-CY7CS_D3.js";import{t as h}from"./createLucideIcon-DPHK1VkS.js";import{t as g}from"./download-Dk-ZjtO6.js";import{t as _}from"./file-image-CDUPkZvG.js";import{t as v}from"./plus-Q2yW6OE7.js";import{t as y}from"./x-B_N4OPjy.js";import{t as b}from"./cn-0WouolD0.js";import{n as x,r as S,t as C}from"./app-link-CCZ-LmVT.js";import{t as ee}from"./copy-to-clipboard-HOJ79TWv.js";import{a as te,c as ne,i as re,l as w,n as ie,o as ae,r as oe,s as se,t as ce}from"./xml-_d7dTN2Q.js";import{n as le}from"./mermaid-render-oOellPHt.js";var ue=h(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),de=h(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]);function fe(e,t){this.v=e,this.k=t}function pe(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function me(e){if(Array.isArray(e))return e}function he(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function ge(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function T(e,t){return me(e)||he(e,t)||_e(e,t)||ge()}function _e(e,t){if(e){if(typeof e==`string`)return pe(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pe(e,t):void 0}}function ve(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof fe;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`&&o.k?t:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(!!a.done,n)},function(e){r(`throw`,e)})}catch(e){i(2,e)}}function i(e,i){e===2?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}ve.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},ve.prototype.next=function(e){return this._invoke(`next`,e)},ve.prototype.throw=function(e){return this._invoke(`throw`,e)},ve.prototype.return=function(e){return this._invoke(`return`,e)};var ye=Object.entries,be=Object.setPrototypeOf,xe=Object.isFrozen,Se=Object.getPrototypeOf,Ce=Object.getOwnPropertyDescriptor,we=Object.freeze,Te=Object.seal,Ee=Object.create,De=typeof Reflect<`u`&&Reflect,Oe=De.apply,ke=De.construct;we||=function(e){return e},Te||=function(e){return e},Oe||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},ke||=function(e){return new e(...[...arguments].slice(1))};var Ae=D(Array.prototype.forEach);Array.prototype.indexOf;var je=D(Array.prototype.lastIndexOf),Me=D(Array.prototype.pop),Ne=D(Array.prototype.push),Pe=D(Array.prototype.slice),Fe=D(Array.prototype.splice),Ie=Array.isArray,Le=$e(Set),Re=D(Set.prototype.add),ze=D(Set.prototype.has),Be=D(String.prototype.toLowerCase),Ve=D(String.prototype.toString),He=D(String.prototype.match),Ue=D(String.prototype.replace),We=D(String.prototype.indexOf),Ge=D(String.prototype.trim),Ke=D(Number.prototype.toString),qe=D(Boolean.prototype.toString),E=typeof BigInt>`u`?null:D(BigInt.prototype.toString),Je=typeof Symbol>`u`?null:D(Symbol.prototype.toString),Ye=D(Object.prototype.hasOwnProperty),Xe=D(Object.prototype.toString),Ze=D(RegExp.prototype.test),Qe=$e(TypeError);function D(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return Oe(e,t,n)}}function $e(e){return function(){return ke(e,[...arguments])}}function O(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Be;if(be&&be(e,null),!Ie(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(xe(t)||(t[r]=e),i=e)}e[i]=!0}return e}function et(e){for(let t=0;t<e.length;t++)Ye(e,t)||(e[t]=null);return e}function tt(e){let t=Ee(null);for(let r of ye(e)){var n=T(r,2);let i=n[0],a=n[1];Ye(e,i)&&(Ie(a)?t[i]=et(a):a&&typeof a==`object`&&a.constructor===Object?t[i]=tt(a):t[i]=a)}return t}function nt(e){switch(typeof e){case`string`:return e;case`number`:return Ke(e);case`boolean`:return qe(e);case`bigint`:return E?E(e):`0`;case`symbol`:return Je?Je(e):`Symbol()`;case`undefined`:return Xe(e);case`function`:case`object`:{if(e===null)return Xe(e);let t=e,n=rt(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:Xe(e)}return Xe(e)}default:return Xe(e)}}function rt(e,t){for(;e!==null;){let n=Ce(e,t);if(n){if(n.get)return D(n.get);if(typeof n.value==`function`)return D(n.value)}e=Se(e)}function n(){return null}return n}function it(e,t){for(;e!==null;){let n=Ce(e,t);if(n)return n.get?D(n.get):null;e=Se(e)}return null}function at(e){try{return Ze(e,``),!0}catch{return!1}}var ot=we(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),st=we(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),ct=we([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),lt=we([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),ut=we(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),dt=we([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),ft=we([`#text`]),pt=we(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),mt=we(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),ht=we(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),gt=we([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),_t=Te(/{{[\w\W]*|^[\w\W]*}}/g),vt=Te(/<%[\w\W]*|^[\w\W]*%>/g),yt=Te(/\${[\w\W]*/g),bt=Te(/^data-[\-\w.\u00B7-\uFFFF]+$/),xt=Te(/^aria-[\-\w]+$/),St=Te(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ct=Te(/^(?:\w+script|data):/i),wt=Te(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Tt=Te(/^html$/i),Et=Te(/^[a-z][.\w]*(-[.\w]+)+$/i),Dt=Te(/<[/\w!]/g),Ot=Te(/<[/\w]/g),kt=Te(/<\/no(script|embed|frames)/i),At=Te(/\/>/i),jt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Mt=we(O({},[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`])),Nt=function(){return typeof window>`u`?null:window},Pt=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},Ft=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},It=function(e,t,n,r){return Ye(e,t)&&Ie(e[t])?O(r.base?tt(r.base):{},e[t],r.transform):n},Lt=function(e,t,n){let r=Ye(e,t)?e[t]:void 0;return r&&typeof r==`object`?tt(r):n()};function Rt(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Nt(),t=e=>Rt(e);if(t.version=`3.4.17`,t.removed=[],!e||!e.document||e.document.nodeType!==jt.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=rt(d,`cloneNode`),p=rt(d,`remove`),m=rt(d,`removeAttributeNode`),h=rt(d,`nextSibling`),g=rt(d,`childNodes`),_=rt(d,`parentNode`),v=rt(d,`shadowRoot`),y=rt(d,`attributes`),b=o&&o.prototype?rt(o.prototype,`nodeType`):null,x=o&&o.prototype?rt(o.prototype,`nodeName`):null,S=o&&o.prototype?rt(o.prototype,`ownerDocument`):null,C=function(e){return b?b(e):e.nodeType},ee=function(e){return x?x(e):e.nodeName},te=it(d,`namespaceURI`),ne=function(e){return te?te(e):e.namespaceURI};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let re,w=``,ie,ae=!1,oe=0,se=function(){if(oe>0)throw Qe(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},ce=function(e){se(),oe++;try{return re.createHTML(e)}finally{oe--}},le=function(e){se(),oe++;try{return re.createScriptURL(e)}finally{oe--}},ue=function(){return ae||=(ie=Pt(u,i),!0),ie},de=n,fe=de.implementation,pe=de.createNodeIterator,me=de.createDocumentFragment,he=de.getElementsByTagName,ge=r.importNode,T=Ft();t.isSupported=typeof ye==`function`&&typeof _==`function`&&fe&&fe.createHTMLDocument!==void 0;let _e=_t,ve=vt,be=yt,xe=bt,Se=xt,Ce=Ct,De=wt,Oe=Et,ke=St,Ke=null,qe=O({},[...ot,...st,...ct,...ut,...ft]),E=null,Je=O({},[...pt,...mt,...ht,...gt]),Xe=Object.seal(Ee(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),D=null,$e=null,et=Object.seal(Ee(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),zt=!0,Bt=!0,Vt=!1,Ht=!0,Ut=!1,k=!0,Wt=!1,Gt=!1,Kt=null,qt=null,Jt=!1,Yt=!1,Xt=!1,Zt=!1,Qt=!0,$t=!1,en=`user-content-`,tn=!0,nn=!1,rn=null,an={},on=null,sn=O({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),cn=null,ln=O({},[`audio`,`video`,`img`,`source`,`image`,`track`]),un=null,dn=O({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),fn=`http://www.w3.org/1998/Math/MathML`,pn=`http://www.w3.org/2000/svg`,mn=`http://www.w3.org/1999/xhtml`,hn=mn,gn=!1,_n=null,vn=O({},[fn,pn,mn],Ve),yn=we([`mi`,`mo`,`mn`,`ms`,`mtext`]),bn=O({},yn),xn=we([`annotation-xml`]),Sn=O({},xn),Cn=O({},[`title`,`style`,`font`,`a`,`script`]),wn=null,Tn=[`application/xhtml+xml`,`text/html`],En=null,Dn=null,On=n.createElement(`form`),A=function(e){return e instanceof RegExp||e instanceof Function},kn=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Dn&&Dn===e)return;(!e||typeof e!=`object`)&&(e={}),e=tt(e),wn=Tn.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,En=wn===`application/xhtml+xml`?Ve:Be,Ke=It(e,`ALLOWED_TAGS`,qe,{transform:En}),E=It(e,`ALLOWED_ATTR`,Je,{transform:En}),_n=It(e,`ALLOWED_NAMESPACES`,vn,{transform:Ve}),un=It(e,`ADD_URI_SAFE_ATTR`,dn,{transform:En,base:dn}),cn=It(e,`ADD_DATA_URI_TAGS`,ln,{transform:En,base:ln}),on=It(e,`FORBID_CONTENTS`,sn,{transform:En}),D=It(e,`FORBID_TAGS`,tt({}),{transform:En}),$e=It(e,`FORBID_ATTR`,tt({}),{transform:En}),an=Ye(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?tt(e.USE_PROFILES):e.USE_PROFILES:!1,zt=e.ALLOW_ARIA_ATTR!==!1,Bt=e.ALLOW_DATA_ATTR!==!1,Vt=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ht=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ut=e.SAFE_FOR_TEMPLATES||!1,k=e.SAFE_FOR_XML!==!1,Wt=e.WHOLE_DOCUMENT||!1,Yt=e.RETURN_DOM||!1,Xt=e.RETURN_DOM_FRAGMENT||!1,Zt=e.RETURN_TRUSTED_TYPE||!1,Jt=e.FORCE_BODY||!1,Qt=e.SANITIZE_DOM!==!1,$t=e.SANITIZE_NAMED_PROPS||!1,tn=e.KEEP_CONTENT!==!1,nn=e.IN_PLACE||!1,ke=at(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:St,hn=typeof e.NAMESPACE==`string`?e.NAMESPACE:mn,bn=Lt(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>O({},yn)),Sn=Lt(e,`HTML_INTEGRATION_POINTS`,()=>O({},xn));let t=Lt(e,`CUSTOM_ELEMENT_HANDLING`,()=>Ee(null));if(Xe=Ee(null),Ye(t,`tagNameCheck`)&&A(t.tagNameCheck)&&(Xe.tagNameCheck=t.tagNameCheck),Ye(t,`attributeNameCheck`)&&A(t.attributeNameCheck)&&(Xe.attributeNameCheck=t.attributeNameCheck),Ye(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(Xe.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),Te(Xe),Ut&&(Bt=!1),Xt&&(Yt=!0),an&&(Ke=O({},ft),E=Ee(null),an.html===!0&&(O(Ke,ot),O(E,pt)),an.svg===!0&&(O(Ke,st),O(E,mt),O(E,gt)),an.svgFilters===!0&&(O(Ke,ct),O(E,mt),O(E,gt)),an.mathMl===!0&&(O(Ke,ut),O(E,ht),O(E,gt))),et.tagCheck=null,et.attributeCheck=null,Ye(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?et.tagCheck=e.ADD_TAGS:Ie(e.ADD_TAGS)&&(Ke===qe&&(Ke=tt(Ke)),O(Ke,e.ADD_TAGS,En))),Ye(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?et.attributeCheck=e.ADD_ATTR:Ie(e.ADD_ATTR)&&(E===Je&&(E=tt(E)),O(E,e.ADD_ATTR,En))),Ye(e,`ADD_FORBID_CONTENTS`)&&Ie(e.ADD_FORBID_CONTENTS)&&(on===sn&&(on=tt(on)),O(on,e.ADD_FORBID_CONTENTS,En)),tn&&(Ke[`#text`]=!0),Wt&&O(Ke,[`html`,`head`,`body`]),Ke.table&&(O(Ke,[`tbody`]),delete D.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw Qe(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw Qe(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=re;re=e.TRUSTED_TYPES_POLICY;try{w=ce(``)}catch(e){throw re=t,e}}else e.TRUSTED_TYPES_POLICY===null?(re=void 0,w=``):(re===void 0&&(re=ue()),re&&typeof w==`string`&&(w=ce(``)));we&&we(e),Dn=e},An=O({},[...st,...ct,...lt]),jn=O({},[...ut,...dt]),Mn=function(e,t,n){return t.namespaceURI===mn?e===`svg`:t.namespaceURI===fn?e===`svg`&&(n===`annotation-xml`||bn[n]):!!An[e]},Nn=function(e,t,n){return t.namespaceURI===mn?e===`math`:t.namespaceURI===pn?e===`math`&&Sn[n]:!!jn[e]},Pn=function(e,t,n){return t.namespaceURI===pn&&!Sn[n]||t.namespaceURI===fn&&!bn[n]?!1:!jn[e]&&(Cn[e]||!An[e])},Fn=function(e){let t=ne(e),n=Be(ee(e)),r=_(e),i,a;return r&&C(r)===jt.element?(i={namespaceURI:ne(r)},a=Be(ee(r))):(i={namespaceURI:hn},a=`template`),_n[t]?t===pn?Mn(n,i,a):t===fn?Nn(n,i,a):t===mn?Pn(n,i,a):!!(wn===`application/xhtml+xml`&&_n[t]):!1},In=function(e){Ne(t.removed,{element:e});try{_(e).removeChild(e)}catch{if(p(e),!_(e))throw Qe(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},Ln=function(e,t,n){try{m(e,t)}catch{try{e.removeAttribute(n)}catch{}}},Rn=function(e){Hn(e);let t=g(e);t&&Ae(Pe(t),e=>{try{p(e)}catch{}});let n=C(e)===jt.element?y(e):null;if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&Ln(e,r,i)}},zn=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}Ne(t.removed,{attribute:r||null,from:n});try{r?m(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`)if(Yt||Xt)try{In(n)}catch{}else try{n.setAttribute(e,``)}catch{}},Bn=function(e){let t=y(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||E[En(i)]||Ln(e,r,i)}},Vn=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=[e];for(;r.length>0;){let e=r.pop();if(t(e)===!1)continue;if(n&&C(e)===jt.element){let t=v(e);rr(t)&&r.push(t)}let i=g(e);if(i)for(let e=i.length-1;e>=0;--e)r.push(i[e])}},Hn=function(e){Vn(e,e=>{C(e)===jt.element&&Bn(e)})},Un=function(e){let t=[];return Vn(e,e=>{t.push(e)},!0),t},Wn=function(e,t){let n=Le();Ae(Un(e),e=>{C(e)===jt.element&&Re(n,e)}),Ae(t,e=>{C(e)===jt.element&&!ze(n,e)&&Bn(e)})},Gn=function(e,n){let r=!1;return Ae(t.removed,t=>{t.element&&(r||=t.element===e,Hn(t.element))}),Wn(e,n),r},Kn=function(e,t){let n=rn,r=null,i=()=>(r||(r=Le(),Ae(t,e=>{Re(r,e)})),r);for(let t=0;;t++){let r=Un(e),a=[e],o=!1;if(Ae(r,e=>{C(e)===jt.documentFragment?Ne(a,e):!o&&!ze(n,e)&&(o=ze(i(),e))}),!o)return;if(t>=8)throw Qe(`the tree kept changing during in-place sanitization; refusing to return it`);Ae(a,(t,n)=>{qn(t,n>0,e,i())})}},qn=function(e,t,n,r){let i=Qn(e),a;for(;a=i.nextNode();)!ze(r,a)||ze(rn,a)||(t&&ar(T.uponSanitizeShadowNode,a,null),dr(a,n),vr(a,n),rr(a.content)&&yr(a.content))},Jn=function(e){rn&&Re(rn,e)},Yn=function(e,t){return k?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},Xn=function(e){k&&Vn(e,e=>{let t=C(e);if(t===jt.processingInstruction||t===jt.comment&&Ze(Ot,e.data)){try{p(e)}catch{}return!1}if(t===jt.element){let t=e,n=En(ee(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&Yn(`for`,n)&&t.removeAttribute(`for`)}catch{}}return!0})},Zn=function(e){let t=null,r=null;if(Jt)e=`<remove></remove>`+e;else{let t=He(e,/^[\r\n\t ]+/);r=t&&t[0]}wn===`application/xhtml+xml`&&hn===mn&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=re?ce(e):e;if(hn===mn)try{t=new l().parseFromString(i,wn)}catch{}if(!t||!t.documentElement){t=fe.createDocument(hn,`template`,null);try{t.documentElement.innerHTML=gn?w:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),hn===mn?he.call(t,Wt?`html`:`body`)[0]:Wt?t.documentElement:a},Qn=function(e){let t=S?S(e):e.ownerDocument;return pe.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},$n=function(e){return e=Ue(e,_e,` `),e=Ue(e,ve,` `),e=Ue(e,be,` `),e},er=function(e){tr(e);let t=e.querySelectorAll?.call(e,`template`);t&&Ae(t,e=>{rr(e.content)&&er(e.content)})},tr=function(e){e.normalize();let t=S?S(e):e.ownerDocument,n=pe.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=$n(r.data),r=n.nextNode()},nr=function(e){let t=x?x(e):null;return typeof t!=`string`||En(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==y(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==b(e)||e.childNodes!==g(e)},rr=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return b(e)===jt.documentFragment}catch{return!1}},ir=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return typeof b(e)==`number`}catch{return!1}};function ar(e,n,r){e.length!==0&&Ae(e,e=>{e.call(t,n,r,Dn)})}let or=function(e,t){return!!(k&&e.hasChildNodes()&&!ir(e.firstElementChild)&&Ze(Dt,e.textContent)&&Ze(Dt,e.innerHTML)||k&&Mt[t]&&C(e)===jt.element&&ne(e)===mn&&(ir(e.firstElementChild)||typeof e.textContent==`string`&&Ze(Dt,e.textContent))||e.nodeType===jt.processingInstruction||k&&e.nodeType===jt.comment&&Ze(Ot,e.data))},sr=function(e,t){return e instanceof RegExp?Ze(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},cr=function(e,t,n){if(!D[t]&&mr(t)&&sr(Xe.tagNameCheck,t))return!1;if(tn&&!on[t]&&!on[Be(t)]){let t=_(e),r=g(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,h(e))}}}return In(e),!0},lr=function(e,t,n,r){return e.length===0?t:t===n||t===r?tt(t):t},ur=function(e,t){return e===t||_(e)!==null?!1:(nn&&Hn(e),!0)},dr=function(e,n){if(Jn(e),ar(T.beforeSanitizeElements,e,null),ur(e,n))return!0;if(nr(e))return In(e),!0;let r=En(ee(e));if(Ke=lr(T.uponSanitizeElement,Ke,qe,Kt),ar(T.uponSanitizeElement,e,{tagName:r,allowedTags:Ke}),ur(e,n))return!0;if(or(e,r))return In(e),!0;if(D[r]||!(et.tagCheck instanceof Function&&et.tagCheck(r))&&!Ke[r]){let t=cr(e,r,n);return t===!1&&(ar(T.afterSanitizeElements,e,null),ur(e,n))?!0:t}if(C(e)===jt.element&&!Fn(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&Ze(kt,e.innerHTML))return In(e),!0;if(Ut&&e.nodeType===jt.text){let n=$n(e.textContent);e.textContent!==n&&(Ne(t.removed,{element:e.cloneNode()}),e.textContent=n)}return ar(T.afterSanitizeElements,e,null),ur(e,n)},fr=function(e,t,r){if($e[t]||Yn(t,e)||Qt&&(t===`id`||t===`name`)&&(r in n||r in On))return!1;let i=E[t]||et.attributeCheck instanceof Function&&et.attributeCheck(t,e);return Bt&&Ze(xe,t)||zt&&Ze(Se,t)?!0:i?un[t]||Ze(ke,Ue(r,De,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&We(r,`data:`)===0&&cn[e]||Vt&&!Ze(Ce,Ue(r,De,``))?!0:!r:mr(e)&&sr(Xe.tagNameCheck,e)&&sr(Xe.attributeNameCheck,t,e)||t===`is`&&Xe.allowCustomizedBuiltInElements&&sr(Xe.tagNameCheck,r)},pr=O({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),mr=function(e){return!pr[Be(e)]&&Ze(Oe,e)},hr=function(e,t,n,r){if(re&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return ce(r);case`TrustedScriptURL`:return le(r)}return r},gr=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),nr(e)?(In(e),!1):!0}catch{return zn(t,e),!1}},_r=function(e,t){return k&&Ze(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,t)?!0:Be(e)===`attributename`&&He(t,`href`)!==null},vr=function(e,n){if(ar(T.beforeSanitizeAttributes,e,null),ur(e,n))return;let r=e.attributes;if(!r||nr(e))return;E=lr(T.uponSanitizeAttribute,E,Je,qt);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:E,forceKeepAttr:void 0},a=r.length,o=En(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=En(s),d=l,f=s===`value`?d:Ge(d),p=!1;if(i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,ar(T.uponSanitizeAttribute,e,i),f=i.attrValue,$t&&(u===`id`||u===`name`)&&We(f,en)!==0&&(zn(s,e,n),f=en+f,p=!0),_r(s,f)){zn(s,e,n);continue}if(!i.forceKeepAttr){if(!i.keepAttr){zn(s,e,n);continue}if(!Ht&&Ze(At,f)){zn(s,e,n);continue}if(Ut&&(f=$n(f)),!fr(o,u,f)){zn(s,e,n);continue}f=hr(o,u,c,f),f!==d&&gr(e,s,c,f)&&p&&Me(t.removed)}}ar(T.afterSanitizeAttributes,e,null),ur(e,n)},yr=function(e){let t=null,n=Qn(e);for(ar(T.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(ar(T.uponSanitizeShadowNode,t,null),dr(t,e),vr(t,e),rr(t.content)&&yr(t.content),C(t)===jt.element){let e=v(t);rr(e)&&(br(e),yr(e))}Ut&&tr(e),ar(T.afterSanitizeShadowDOM,e,null)},br=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){yr(e.shadow);continue}let n=e.node,r=C(n)===jt.element,i=g(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=x?x(n):null;if(typeof e==`string`&&En(e)===`template`){let e=n.content;rr(e)&&t.push({node:e,shadow:null})}}if(r){let e=v(n);rr(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(gn=!e,gn&&(e=`<!-->`),typeof e!=`string`&&!ir(e)&&(e=nt(e),typeof e!=`string`))throw Qe(`dirty is not a string, aborting`);if(!t.isSupported)return e;Gt?(Ke=Kt,E=qt):kn(n),(T.uponSanitizeElement.length>0||T.uponSanitizeAttribute.length>0)&&(Ke=tt(Ke)),T.uponSanitizeAttribute.length>0&&(E=tt(E)),t.removed=[];let c=nn&&typeof e!=`string`&&ir(e),l=[],u=rn;if(c){Xn(e);let t=ee(e);if(typeof t==`string`){let n=En(t);if(!Ke[n]||D[n])throw Rn(e),Qe(`root node is forbidden and cannot be sanitized in-place`)}if(nr(e))throw Rn(e),Qe(`root node is clobbered and cannot be sanitized in-place`);l=Un(e),rn=Le()}else if(ir(e))i=Zn(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===jt.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),br(i);else{if(!Yt&&!Ut&&!Wt&&e.indexOf(`<`)===-1)return re&&Zt?ce(e):e;if(i=Zn(e),!i)return Yt?null:Zt?w:``}i&&Jt&&In(i.firstChild);let d=c?e:i;try{c&&br(e);let t=Qn(d);for(;o=t.nextNode();)dr(o,d),vr(o,d),rr(o.content)&&yr(o.content);c&&Kn(e,l)}catch(t){throw c&&(Rn(e),Gn(e,l)),t}finally{rn=u}if(c){if(Gn(e,l))throw Qe(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return Ut&&er(e),e}if(Yt){if(Ut&&er(i),Xt)for(s=me.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(E.shadowroot||E.shadowrootmode)&&(s=ge.call(r,s,!0)),s}let f=Wt?i.outerHTML:i.innerHTML;return Wt&&Ke[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&Ze(Tt,i.ownerDocument.doctype.name)&&(f=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
3
3
|
`+f),Ut&&(f=$n(f)),re&&Zt?ce(f):f},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};kn(e),Gt=!0,Kt=Ke,qt=E},t.clearConfig=function(){Dn=null,Gt=!1,Kt=null,qt=null,re=ie,w=``},t.isValidAttribute=function(e,t,n){Dn||kn({});let r=En(e),i=En(t);return typeof n==`string`&&(_r(t,n)||!Ht&&Ze(At,n))?!1:fr(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&Ye(T,e)&&Ne(T[e],t)},t.removeHook=function(e,t){if(Ye(T,e)){if(t!==void 0){let n=je(T[e],t);return n===-1?void 0:Fe(T[e],n,1)[0]}return Me(T[e])}},t.removeHooks=function(e){Ye(T,e)&&(T[e]=[])},t.removeAllHooks=function(){T=Ft()},t}var zt=Rt(),Bt=[`base`,`button`,`embed`,`form`,`iframe`,`input`,`link`,`meta`,`object`,`option`,`select`,`style`,`template`,`textarea`],Vt=[`action`,`formaction`,`id`,`name`,`srcdoc`,`style`];function Ht(e){return zt.sanitize(e,{USE_PROFILES:{html:!0},FORBID_TAGS:Bt,FORBID_ATTR:Vt})}function Ut(e){let t=e.replace(/@import\s+url\([^)]*\)\s*;?/gi,``);return zt.sanitize(t,{USE_PROFILES:{html:!0,svg:!0,svgFilters:!0},FORBID_TAGS:[`foreignObject`,`script`],FORBID_ATTR:[`href`,`xlink:href`]})}var k=e(t(),1),Wt=e(n(),1),Gt=r();function Kt(e){return e===`/personal`||e===`/automations`||e===`/chat`||e.startsWith(`/chat/`)}function qt(e,t,n){let r=e?.trim();if(!r||!r.startsWith(`/`)||r.startsWith(`//`)||r.includes(`://`)||r.includes(`\\`))return t;let i=r.split(/[?#]/,1)[0]||`/`;return n.some(e=>i===e||i.startsWith(`${e}/`))?r:t}function Jt(e,t){let n=t?.trim();if(!n)return e;let r=e.indexOf(`#`),i=r>=0?e.slice(0,r):e,a=r>=0?e.slice(r):``;return`${i}${i.includes(`?`)?`&`:`?`}returnTo=${encodeURIComponent(n)}${a}`}var Yt=[`/notes/`,`/tasks/`,`/projects/`];function Xt(e,t){let n=e.split(/[?#]/,1)[0]??``;if(!Yt.some(e=>n.startsWith(e)))return e;let r=e.slice(n.length).split(`#`,1)[0];return new URLSearchParams(r.startsWith(`?`)?r.slice(1):r).has(`returnTo`)?e:Jt(e,t)}var Zt=`note`;function Qt(e,t){let n=new URLSearchParams(t);n.delete(Zt);let r=n.toString();return r?`${e}?${r}`:e}function $t(e,t){let[n,r=``]=e.split(`?`);if(!Kt(n))return Xt(`/notes/${encodeURIComponent(t)}`,e);let i=new URLSearchParams(r);return i.delete(`task`),i.delete(`preview`),i.set(Zt,t),`${n}?${i.toString()}`}function en(e,t){let n=/^\/notes\/([^/?#]+)(?:\?.*)?$/.exec(t);if(!n)return t;let r=new URLSearchParams(t.split(`?`)[1]??``);if(r.has(`edit`)||r.has(`action`))return t;try{return $t(e,decodeURIComponent(n[1]))}catch{return $t(e,n[1])}}var tn=`task`;function nn(e){return`/chat/task/${encodeURIComponent(e)}`}function rn(e,t){let[n,r=``]=e.split(`?`),i=new URLSearchParams(r);return i.delete(`note`),i.delete(`preview`),i.set(tn,t),`${n}?${i.toString()}`}function an(e,t){return e.split(`?`)[0]?.startsWith(`/tasks/`)?`/tasks/${encodeURIComponent(t)}`:rn(e,t)}function on(e,t){let n=/^\/tasks\/([^/?#]+)/.exec(t);if(!n)return t;try{return an(e,decodeURIComponent(n[1]))}catch{return an(e,n[1])}}function sn(e,t){let n=new URLSearchParams(t);n.delete(tn);let r=n.toString();return r?`${e}?${r}`:e}var cn=`preview`;function ln(e){if(!e.startsWith(`/`)||e.startsWith(`//`)||e.includes(`\\`)||e.includes(`#`))return null;let t=new URL(e,`https://xopc.local`);if([`edit`,`copy`,`action`,`draft`,`add`,`autogenerate`].some(e=>t.searchParams.has(e)))return null;let n,r,i;if(i=/^\/projects\/([^/]+)$/.exec(t.pathname))n=`project`,r=i[1];else if(t.pathname===`/automations`&&t.searchParams.get(`automation`))n=`automation`,r=encodeURIComponent(t.searchParams.get(`automation`));else if(i=/^\/local-apps\/([^/]+)$/.exec(t.pathname))n=`local_app`,r=i[1];else if(t.pathname===`/open`&&t.searchParams.get(`kind`)===`local_app`&&t.searchParams.get(`id`))n=`local_app`,r=encodeURIComponent(t.searchParams.get(`id`));else return null;let a;try{a=decodeURIComponent(r)}catch{return null}if(!a.trim())return null;let o=t.searchParams.get(`agentId`)||t.searchParams.get(`agent`)||void 0,s=t.searchParams.get(`sourceHash`)||void 0,c=new URLSearchParams(t.searchParams);for(let e of[`def`,`agent`,`returnTo`])c.delete(e);n!==`automation`&&c.delete(`run`),o&&c.set(`agentId`,o);let l=n===`project`?`/projects/${encodeURIComponent(a)}`:n===`automation`?`/automations`:`/local-apps/${encodeURIComponent(a)}`;return n===`automation`&&c.set(`automation`,a),n===`local_app`&&(c.delete(`kind`),c.delete(`id`)),l+=c.size?`?${c.toString()}`:``,{kind:n,id:a,href:l,ownerAgentId:o,sourceHash:s,...n===`automation`&&(c.get(`view`)===`run`||c.get(`run`))?{view:`run`,runId:c.get(`run`)||void 0}:{}}}function un(e,t){let n=new URLSearchParams(t);return n.delete(cn),`${e}${n.size?`?${n.toString()}`:``}`}function dn(e,t){let[n,r=``]=e.split(`?`),i=Kt(n)?ln(t):null;if(!i)return en(e,on(e,t));let a=new URLSearchParams(r);return a.delete(`note`),a.delete(`task`),a.set(cn,i.href),`${n}?${a.toString()}`}function fn(){let e=(0,Gt.c)(4),t=a(),n=o(),r;return e[0]!==t.pathname||e[1]!==t.search||e[2]!==n?(r=async e=>{let r=S(e);if(r.kind===`internal-route`){let e=`${t.pathname}${t.search}`;return n(Xt(dn(e,r.route),e)),{ok:!0,kind:r.kind}}if(r.kind===`external-http`){let e=await x(r.url);return e.ok?{ok:!0,kind:r.kind}:e}return{ok:!1,error:`Unsupported link`}},e[0]=t.pathname,e[1]=t.search,e[2]=n,e[3]=r):r=e[3],r}function pn(e,t){let n=0;for(;t>0&&e[--t]===`\\`;)n++;return n%2==1}function mn(e,t,n,r){let i=!1;for(let a=t;a<e.length;a++){if(e[a]===`
|
|
4
4
|
`||e[a]===`\r`){if(r)return-1;i=!1}if(!i){if(e[a]===`%`&&!pn(e,a)){i=!0;continue}if(e.startsWith(n,a)&&!pn(e,a))return a}}return-1}function hn(e,t=0){if(pn(e,t))return;let n=e.startsWith(`\\(`,t);if(!n&&(e[t]!==`$`||e[t+1]===`$`||e[t-1]===`$`))return;let r=n?2:1,i=t+r;if(n&&/^xopc:\/\//i.test(e.slice(i))||!n&&(!e[i]||/\s/.test(e[i])))return;let a=mn(e,i,n?`\\)`:`$`,!0);if(a===-1){if(!n)return;let r=e.slice(i).search(/[\r\n]/),a=r<0?e.length:i+r;return{raw:e.slice(t,a),latex:e.slice(i,a),display:!1,delimiter:`paren`,state:`pending`,range:{start:t,end:a}}}let o=e.slice(i,a);if(!n&&(!o||/\s$/.test(o)||/\d/.test(e[a+1]??``)||e[a+1]===`$`||/^[\d\s.,+\-€£¥¥]+$/.test(o)))return;let s=a+r;return{raw:e.slice(t,s),latex:o,display:!1,delimiter:n?`paren`:`dollar`,state:`complete`,range:{start:t,end:s}}}function gn(e,t=0){let n=/^( {0,3})(\\\[|\$\$)/.exec(e.slice(t));if(!n)return;let r=t+n[0].length,i=n[2]===`\\[`,a=mn(e,r,i?`\\]`:`$$`,!1);if(a>=0){let n=a+2,o=e.slice(n).match(/^[^\r\n]*/)?.[0]??``;return o.trim()?void 0:{raw:e.slice(t,n+o.length),latex:e.slice(r,a),display:!0,delimiter:i?`bracket`:`double-dollar`,state:`complete`,range:{start:t,end:n+o.length}}}if(!(!i&&/^\S.*\$\$/.test(e.slice(r).split(/\r?\n/,1)[0])))return{raw:e.slice(t),latex:e.slice(r),display:!0,delimiter:i?`bracket`:`double-dollar`,state:`pending`,range:{start:t,end:e.length}}}function _n(e,t,n=!0){return{raw:e,latex:t,display:!0,delimiter:`math-fence`,state:n?`complete`:`pending`,range:{start:0,end:e.length}}}function vn(e){let t=/^ {0,3}(`{3,}|~{3,})math[^\S\r\n]*(?:\r?\n|$)/.exec(e);if(!t)return;let n=t[1],r=t[0].length;for(;r<e.length;){let i=e.indexOf(`
|
|
@@ -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{f as i,u as a}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{i as o,n as s,o as c}from"./locale-store-DTUQ0JiK.js";import{t as l}from"./messages-C7ruaWtK.js";import{a as u,i as d,o as f,r as ee,s as p,t as m}from"./dist-BGTk37IG.js";import{t as h}from"./check-DUBLcKHA.js";import{t as g}from"./secret-input-DsjfQmDn.js";import{t as te}from"./key-round-DWbpyU2U.js";import{t as _}from"./link-2-D_ZKYUW7.js";import{t as v}from"./loader-circle-CifKLtgG.js";import{t as y}from"./lock-keyhole-DEK5kH0u.js";import{t as b}from"./x-B_N4OPjy.js";import{t as x}from"./skeleton-DzdOeGYz.js";import{i as S}from"./vendor-swr-CdRzEUwF.js";import{t as C}from"./button-Cc4hUNTt.js";var w=n(),T=e(t(),1),E=r(),D={zh:{title:`连接服务`,secret:`访问密钥`,hint:`仅保存到凭据服务,不进入聊天或模型。`,invalidToken:`密钥未被接受,请核对后重新输入。`,submit:`保存并连接`,login:`继续登录`,waiting:`在服务页面完成授权,这里会自动继续。`,check:`重新检查`,checking:`正在验证连接`,cancel:`取消连接`,back:`返回对话`,close:`暂时关闭`,later:`稍后继续`,done:`完成`,failed:`暂时无法连接,请检查服务地址或权限后重试。`,expired:`请求已过期,请回到对话重新发起。`,cancelled:`此连接请求已取消。`,reload:`配置已保存。重启 Gateway 后,连接才能生效。`,details:`连接详情`,approve:`允许这次连接`,approval:`确认连接到这个服务`,shared:`连接将供此网关的助手使用,不会授予微信用户管理权限。`,identity:`来自微信私聊`,endpoint:`服务地址`,purpose:`要完成的事`,tokenDescription:`输入服务提供的访问密钥,即可继续原来的任务。`,accessDeniedToken:`服务拒绝了当前访问。若此服务需要 Token,请在这里输入;账号或服务权限也可能需要检查。`,connected:`已连接`,continuing:`正在原微信对话中继续处理,无需发送“继续”。`,delivered:`结果已发送到原微信对话。`,returnWeixin:`现在可以关闭此页,返回微信。`,closed:`返回微信即可继续对话`,reopen:`继续配置`,deliveryFailed:`连接已完成,结果暂未发送到微信。重发不会重新执行任务。`,retryDelivery:`重试发送结果`,secure:`安全连接`,loading:`正在准备连接`,checkingDescription:`正在检查服务和所需权限。`},en:{title:`Connect service`,secret:`Access key`,hint:`Saved to credential storage, never chat or the model.`,invalidToken:`This key was rejected. Check it and try again.`,submit:`Save and connect`,login:`Continue sign-in`,waiting:`Finish authorizing on the service page. This will continue automatically.`,check:`Check again`,checking:`Verifying connection`,cancel:`Cancel connection`,back:`Return to chat`,close:`Close for now`,later:`Continue later`,done:`Done`,failed:`Unable to connect. Check the service address or permissions and try again.`,expired:`This request expired. Return to chat to start again.`,cancelled:`This connection request was cancelled.`,reload:`Configuration is saved. Restart the Gateway to activate the connection.`,details:`Connection details`,approve:`Approve this connection`,approval:`Confirm this service connection`,shared:`The connection is shared with this Gateway’s assistants. It grants no administration rights to Weixin users.`,identity:`From a Weixin chat`,endpoint:`Service address`,purpose:`Your request`,tokenDescription:`Enter the access key from your service to continue your task.`,accessDeniedToken:`The service refused access. If it requires a Token, enter it here. Account or service permissions may also need attention.`,connected:`Connected`,continuing:`Continuing in the original Weixin chat. No follow-up message needed.`,delivered:`The result was sent to your original Weixin chat.`,returnWeixin:`You can close this page and return to Weixin.`,closed:`Return to Weixin to continue chatting`,reopen:`Continue setup`,deliveryFailed:`Connected, but the result could not be sent to Weixin. Resending will not run the task again.`,retryDelivery:`Retry result delivery`,secure:`Secure connection`,loading:`Preparing connection`,checkingDescription:`Checking the service and required permissions.`}};function O({setupId:e,onClose:t}){let n=s(e=>e.language),r=D[n],i=`/api/mcp/setup/${encodeURIComponent(e)}`,{data:a,error:_,mutate:w}=S(i,async e=>(await c(o(e))).payload,{refreshInterval:e=>e&&(e.returnChannel===`weixin`&&e.phase===`ready`&&![`delivered`,`failed`].includes(e.replyDelivery??``)||![`ready`,`cancelled`].includes(e.phase))?1e3:0}),[O,k]=(0,T.useState)(``),[A,j]=(0,T.useState)({}),[M,N]=(0,T.useState)(!1),[P,F]=(0,T.useState)(!1),I=(0,T.useRef)(``),L=(0,T.useRef)(null),R=async(e,t)=>{if(!(!a||M)){N(!0),F(!1);try{await c(o(i),{method:`POST`,body:JSON.stringify({action:e,expectedVersion:a.version,...t?{value:t}:{}})}),await w()}catch{F(!0),await w()}finally{N(!1)}}};(0,T.useEffect)(()=>{if(!a||M||a.expired||a.phase===`cancelled`)return;if(a.phase===`ready`&&!a.reloadRequired&&a.returnChannel!==`weixin`){t(a);return}if(P)return;let n=a.requiresRecheck||a.phase===`planned`||[`connected`,`error`,`cancelled`].includes(a.authState??``)?`advance`:a.phase===`oauth_required`?`authorize`:void 0,r=`${e}:${a.version}:${n}`;n&&I.current!==r&&(I.current=r,R(n))},[a,M,P,t,e]);let z=!!(a?.expired||a?.phase===`cancelled`),B=a?.secretFields?.length?a.secretFields:[{id:`token`,label:r.secret}],V=!!(O||Object.values(A).some(Boolean)),H=!!(a?.nextRetryAt&&a.nextRetryAt>Date.now()),U=B.every(e=>(e.id===`token`?O:A[e.id]??``).trim()),W=a?.phase===`ready`&&!a.reloadRequired&&!z,G=a?.phase===`approval_required`&&!z?a.approval:void 0,K=a?.phase===`approval_required`&&!z?a.planApproval:void 0,q=!!(G||K),J=a&&(a.phase===`token_required`||a.phase===`auth_unknown`&&a.canProvideToken||a.phase===`blocked`&&(a.canReplaceToken||a.canProvideToken))&&!a.requiresRecheck&&!z&&!a.reloadRequired,Y=a?.phase===`authorizing`&&!z&&!a.reloadRequired,X=W&&a?.returnChannel===`weixin`&&a.replyDelivery===`failed`,Z=(a?.phase===`blocked`||a?.phase===`auth_unknown`)&&!J&&!z,ne=a?.expired?r.expired:a?.phase===`cancelled`?r.cancelled:a?.reloadRequired?r.reload:W?X?r.deliveryFailed:a?.replyDelivery===`delivered`?r.delivered:r.continuing:q?r.approval:H?n===`zh`?`服务要求等待,将在 ${new Date(a.nextRetryAt).toLocaleTimeString()} 后有限重试。`:`Waiting until ${new Date(a.nextRetryAt).toLocaleTimeString()} before a bounded retry.`:a?.phase===`auth_unknown`?n===`zh`?`认证方式尚未确定。若服务提供 Token,可在此输入;如需 OAuth,请核实接入资料后重新检查。`:`Authentication is not yet determined. Enter a Token only if your service provides one; for OAuth, verify the integration guide and recheck.`:J?a.canProvideToken?r.accessDeniedToken:r.tokenDescription:Y?r.waiting:_||Z||P?r.failed:r.checkingDescription,Q=()=>{M||(k(``),j({}),t(a))},$=`min-h-12 w-full rounded-xl text-[15px]`,re=W?h:J?te:y;return(0,E.jsx)(m,{open:!0,onOpenChange:e=>{e||Q()},children:(0,E.jsxs)(f,{children:[(0,E.jsx)(u,{className:`fixed inset-0 z-[70] bg-scrim backdrop-blur-sm`}),(0,E.jsxs)(ee,{onOpenAutoFocus:e=>{e.preventDefault(),L.current?.focus()},onPointerDownOutside:e=>{(M||V)&&e.preventDefault()},onEscapeKeyDown:e=>{M&&e.preventDefault()},className:`fixed inset-x-0 bottom-0 z-[70] flex h-[min(36rem,calc(100dvh-1rem))] flex-col overflow-hidden rounded-t-3xl border border-edge bg-surface-overlay text-fg shadow-elevated sm:inset-x-auto sm:bottom-auto sm:left-1/2 sm:top-1/2 sm:h-[min(36rem,calc(100dvh-3rem))] sm:w-[28rem] sm:-translate-x-1/2 sm:-translate-y-1/2 sm:rounded-3xl`,children:[(0,E.jsxs)(`header`,{className:`relative shrink-0 px-6 pb-5 pt-8 text-center sm:px-8`,children:[(0,E.jsx)(C,{variant:`ghost`,className:`absolute right-2 top-2 size-11 rounded-full p-0`,"aria-label":r.close,disabled:M,onClick:Q,children:(0,E.jsx)(b,{className:`size-4`,"aria-hidden":!0})}),(0,E.jsx)(`div`,{className:`mx-auto mb-4 flex size-12 items-center justify-center rounded-2xl bg-surface-hover`,children:(0,E.jsx)(re,{className:`size-6 text-accent-fg`,strokeWidth:1.6,"aria-hidden":!0})}),(0,E.jsx)(p,{ref:L,tabIndex:-1,className:`break-words text-xl font-semibold tracking-tight focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:W?r.connected:a?.displayName||r.title}),a?(0,E.jsx)(`p`,{className:`mt-1 truncate text-[13px] text-fg-muted`,title:a.endpointOrigin,children:a.endpointOrigin}):null,(0,E.jsx)(d,{role:!J&&(_||P||Z||a?.expired||a?.reloadRequired)?`alert`:void 0,className:`mt-3 text-sm leading-relaxed text-fg-muted`,children:ne})]}),(0,E.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain px-6 pb-4 sm:px-8`,"aria-busy":M,children:[!a&&!_?(0,E.jsxs)(`div`,{role:`status`,"aria-label":r.loading,className:`space-y-3`,children:[(0,E.jsx)(x,{className:`h-12 w-full rounded-xl`}),(0,E.jsx)(x,{className:`h-4 w-3/4`})]}):null,G?(0,E.jsxs)(`section`,{className:`space-y-3`,children:[(0,E.jsxs)(`dl`,{className:`space-y-3 rounded-2xl bg-surface-base p-4 text-sm`,children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`dt`,{className:`mb-1 text-xs text-fg-muted`,children:r.identity}),(0,E.jsxs)(`dd`,{className:`break-all`,children:[G.accountId,` / `,G.peerId]})]}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`dt`,{className:`mb-1 text-xs text-fg-muted`,children:r.endpoint}),(0,E.jsx)(`dd`,{className:`break-all`,children:G.endpoint})]}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`dt`,{className:`mb-1 text-xs text-fg-muted`,children:r.purpose}),(0,E.jsx)(`dd`,{className:`break-words leading-relaxed`,children:G.purpose})]})]}),(0,E.jsx)(`p`,{className:`text-xs leading-relaxed text-fg-muted`,children:r.shared}),K?(0,E.jsxs)(`div`,{className:`space-y-2 rounded-xl bg-surface-base p-3 text-xs`,children:[(0,E.jsx)(`p`,{children:n===`zh`?`同时审阅本次来源与执行计划:`:`Also review this source and execution plan:`}),(0,E.jsx)(`pre`,{className:`whitespace-pre-wrap break-all`,children:JSON.stringify(K,null,2)})]}):null]}):K?(0,E.jsxs)(`section`,{className:`space-y-3 text-sm`,children:[(0,E.jsx)(`p`,{className:`break-all`,children:K.endpoint}),(0,E.jsx)(`p`,{children:K.purpose}),K.execution?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`p`,{children:n===`zh`?`将在 Gateway 主机运行以下程序,可能下载指定依赖,并按该主机的进程权限访问文件和网络。`:`This program runs on the Gateway host, may download the specified dependency and can access files and network with that process’s permissions.`}),(0,E.jsx)(`pre`,{className:`whitespace-pre-wrap break-all rounded-xl bg-surface-base p-3 text-xs`,children:JSON.stringify(K.execution,null,2)})]}):(0,E.jsx)(`p`,{children:n===`zh`?`来源归属尚未独立核实。请确认服务和以下资料来源后连接。`:`Publisher ownership has not been independently verified. Review the service and sources before connecting.`}),K.sources.map(e=>(0,E.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`block break-all text-accent-fg`,children:e.url},e.url))]}):J?(0,E.jsxs)(`form`,{id:`mcp-setup-secret-form`,className:`space-y-3`,onSubmit:e=>{e.preventDefault();let t=a.secretFields?.length?Object.fromEntries(B.map(e=>[e.id,e.id===`token`?O:A[e.id]??``])):O;k(``),j({}),R(`token`,t)},children:[B.map(e=>(0,E.jsxs)(`div`,{className:`space-y-2`,children:[(0,E.jsx)(`label`,{htmlFor:`mcp-setup-${e.id}`,className:`block text-sm font-medium`,children:e.label}),(0,E.jsx)(g,{id:`mcp-setup-${e.id}`,value:e.id===`token`?O:A[e.id]??``,onChange:t=>{e.id===`token`?k(t):j(n=>({...n,[e.id]:t})),F(!1)},disabled:M||H,autoComplete:`off`,hideCopy:!0,className:`[&_button]:size-11 [&_button]:p-3`,ariaDescribedBy:`mcp-secret-hint`,ariaInvalid:a.errorCode===`credential_rejected`||P,inputClassName:`min-h-12 rounded-xl pr-14 text-base`,labels:l(n).connectorsSettings.secretInputLabels})]},e.id)),a.helpUrl?(0,E.jsx)(`a`,{href:a.helpUrl,target:`_blank`,rel:`noopener noreferrer`,className:`text-sm text-accent-fg`,children:n===`zh`?`获取访问密钥`:`Get an access key`}):null,(0,E.jsxs)(`p`,{id:`mcp-secret-hint`,className:`flex items-start gap-1.5 text-xs leading-relaxed text-fg-muted`,children:[(0,E.jsx)(y,{className:`mt-0.5 size-3.5 shrink-0`,"aria-hidden":!0}),r.hint]}),a.errorCode===`credential_rejected`||P||a.phase===`blocked`&&!a.canProvideToken?(0,E.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:a.errorCode===`credential_rejected`?r.invalidToken:r.failed}):null]}):W&&a?.returnChannel===`weixin`?(0,E.jsx)(`p`,{role:`status`,className:`py-5 text-center text-sm text-fg-muted`,children:r.returnWeixin}):_||P||Z||a?.expired||a?.reloadRequired?null:!z&&!Y?(0,E.jsxs)(`div`,{role:`status`,"aria-label":r.checking,className:`space-y-3`,children:[(0,E.jsx)(x,{className:`h-12 w-full rounded-xl`}),(0,E.jsx)(x,{className:`h-4 w-2/3`})]}):null,a&&!z&&!W?(0,E.jsxs)(`details`,{className:`mt-5 text-sm text-fg-muted`,children:[(0,E.jsx)(`summary`,{className:`min-h-11 cursor-pointer py-3 text-xs focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:r.details}),(0,E.jsxs)(`div`,{className:`space-y-2 pb-2`,children:[G?null:(0,E.jsx)(`p`,{className:`break-all text-xs`,children:a.endpointOrigin}),a.phase===`approval_required`?null:(0,E.jsx)(C,{variant:`ghost`,className:`min-h-11 w-full justify-start text-xs`,disabled:M||H,onClick:()=>{I.current=``,R(`advance`)},children:r.check}),(0,E.jsx)(C,{variant:`ghost`,className:`min-h-11 w-full justify-start text-xs`,disabled:M,onClick:()=>void R(`cancel`),children:r.cancel})]})]}):null]}),(0,E.jsxs)(`footer`,{className:`shrink-0 space-y-2 border-t border-edge/60 px-6 pt-4 pb-[max(1.25rem,env(safe-area-inset-bottom))] sm:px-8`,children:[q?(0,E.jsxs)(C,{variant:`primary`,className:$,disabled:M,onClick:()=>void R(`approve`),children:[M?(0,E.jsx)(v,{className:`size-4 animate-spin motion-reduce:animate-none`,"aria-hidden":!0}):null,r.approve]}):J?(0,E.jsxs)(C,{variant:`primary`,className:$,form:`mcp-setup-secret-form`,type:`submit`,disabled:M||!U,children:[M?(0,E.jsx)(v,{className:`size-4 animate-spin motion-reduce:animate-none`,"aria-hidden":!0}):null,M?r.checking:r.submit]}):Y&&a?.authorizationUrl?(0,E.jsx)(C,{asChild:!0,variant:`primary`,className:$,children:(0,E.jsx)(`a`,{href:a.authorizationUrl,target:`_blank`,rel:`noopener noreferrer`,children:r.login})}):X?(0,E.jsx)(C,{variant:`primary`,className:$,disabled:M,onClick:()=>void R(`retry_delivery`),children:r.retryDelivery}):Z||a?.reloadRequired||_?(0,E.jsx)(C,{variant:`primary`,className:$,disabled:M||H,onClick:()=>{I.current=``,a?R(`advance`):w()},children:r.check}):W||z?(0,E.jsx)(C,{variant:`primary`,className:$,onClick:Q,children:a?.returnChannel===`weixin`?r.done:r.back}):null,!W&&!z?(0,E.jsx)(C,{variant:`ghost`,className:`min-h-11 w-full rounded-xl text-sm`,disabled:M,onClick:Q,children:r.later}):null]})]})]})})}function k(){let e=(0,w.c)(8),{setupId:t}=i(),n=t===void 0?``:t,r=a(),o=s(A),[c,l]=(0,T.useState)(!1),u;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>l(!1),e[0]=u):u=e[0];let d;e[1]===n?d=e[2]:(d=[n],e[1]=n,e[2]=d),(0,T.useEffect)(u,d);let f;return e[3]!==c||e[4]!==o||e[5]!==r||e[6]!==n?(f=(0,E.jsx)(`main`,{className:`flex h-full min-h-0 items-center justify-center bg-surface-base p-6`,children:c?(0,E.jsxs)(`section`,{className:`max-w-xs space-y-4 text-center`,children:[(0,E.jsx)(_,{className:`mx-auto size-6 text-fg-muted`,"aria-hidden":!0}),(0,E.jsx)(`h1`,{className:`text-lg font-medium text-fg`,children:D[o].closed}),(0,E.jsx)(C,{onClick:()=>l(!1),children:D[o].reopen})]}):(0,E.jsx)(O,{setupId:n,onClose:e=>{e?.returnChannel===`weixin`?l(!0):r(e?`/chat/${e.conversationId}`:`/chat`,{replace:!0})}})}),e[3]=c,e[4]=o,e[5]=r,e[6]=n,e[7]=f):f=e[7],f}function A(e){return e.language}export{O as McpConversationSetupDialog,k as McpConversationSetupPage};
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{f as i,u as a}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{i as o,n as s,o as c}from"./locale-store-D3c8DIm-.js";import{t as l}from"./messages-DPLud9GK.js";import{a as u,i as d,o as f,r as ee,s as p,t as m}from"./dist-CY7CS_D3.js";import{t as h}from"./check-DUBLcKHA.js";import{t as g}from"./secret-input-DsjfQmDn.js";import{t as te}from"./key-round-DWbpyU2U.js";import{t as _}from"./link-2-D_ZKYUW7.js";import{t as v}from"./loader-circle-CifKLtgG.js";import{t as y}from"./lock-keyhole-DEK5kH0u.js";import{t as b}from"./x-B_N4OPjy.js";import{t as x}from"./skeleton-DzdOeGYz.js";import{i as S}from"./vendor-swr-CdRzEUwF.js";import{t as C}from"./button-Cc4hUNTt.js";var w=n(),T=e(t(),1),E=r(),D={zh:{title:`连接服务`,secret:`访问密钥`,hint:`仅保存到凭据服务,不进入聊天或模型。`,invalidToken:`密钥未被接受,请核对后重新输入。`,submit:`保存并连接`,login:`继续登录`,waiting:`在服务页面完成授权,这里会自动继续。`,check:`重新检查`,checking:`正在验证连接`,cancel:`取消连接`,back:`返回对话`,close:`暂时关闭`,later:`稍后继续`,done:`完成`,failed:`暂时无法连接,请检查服务地址或权限后重试。`,expired:`请求已过期,请回到对话重新发起。`,cancelled:`此连接请求已取消。`,reload:`配置已保存。重启 Gateway 后,连接才能生效。`,details:`连接详情`,approve:`允许这次连接`,approval:`确认连接到这个服务`,shared:`连接将供此网关的助手使用,不会授予微信用户管理权限。`,identity:`来自微信私聊`,endpoint:`服务地址`,purpose:`要完成的事`,tokenDescription:`输入服务提供的访问密钥,即可继续原来的任务。`,accessDeniedToken:`服务拒绝了当前访问。若此服务需要 Token,请在这里输入;账号或服务权限也可能需要检查。`,connected:`已连接`,continuing:`正在原微信对话中继续处理,无需发送“继续”。`,delivered:`结果已发送到原微信对话。`,returnWeixin:`现在可以关闭此页,返回微信。`,closed:`返回微信即可继续对话`,reopen:`继续配置`,deliveryFailed:`连接已完成,结果暂未发送到微信。重发不会重新执行任务。`,retryDelivery:`重试发送结果`,secure:`安全连接`,loading:`正在准备连接`,checkingDescription:`正在检查服务和所需权限。`},en:{title:`Connect service`,secret:`Access key`,hint:`Saved to credential storage, never chat or the model.`,invalidToken:`This key was rejected. Check it and try again.`,submit:`Save and connect`,login:`Continue sign-in`,waiting:`Finish authorizing on the service page. This will continue automatically.`,check:`Check again`,checking:`Verifying connection`,cancel:`Cancel connection`,back:`Return to chat`,close:`Close for now`,later:`Continue later`,done:`Done`,failed:`Unable to connect. Check the service address or permissions and try again.`,expired:`This request expired. Return to chat to start again.`,cancelled:`This connection request was cancelled.`,reload:`Configuration is saved. Restart the Gateway to activate the connection.`,details:`Connection details`,approve:`Approve this connection`,approval:`Confirm this service connection`,shared:`The connection is shared with this Gateway’s assistants. It grants no administration rights to Weixin users.`,identity:`From a Weixin chat`,endpoint:`Service address`,purpose:`Your request`,tokenDescription:`Enter the access key from your service to continue your task.`,accessDeniedToken:`The service refused access. If it requires a Token, enter it here. Account or service permissions may also need attention.`,connected:`Connected`,continuing:`Continuing in the original Weixin chat. No follow-up message needed.`,delivered:`The result was sent to your original Weixin chat.`,returnWeixin:`You can close this page and return to Weixin.`,closed:`Return to Weixin to continue chatting`,reopen:`Continue setup`,deliveryFailed:`Connected, but the result could not be sent to Weixin. Resending will not run the task again.`,retryDelivery:`Retry result delivery`,secure:`Secure connection`,loading:`Preparing connection`,checkingDescription:`Checking the service and required permissions.`}};function O({setupId:e,onClose:t}){let n=s(e=>e.language),r=D[n],i=`/api/mcp/setup/${encodeURIComponent(e)}`,{data:a,error:_,mutate:w}=S(i,async e=>(await c(o(e))).payload,{refreshInterval:e=>e&&(e.returnChannel===`weixin`&&e.phase===`ready`&&![`delivered`,`failed`].includes(e.replyDelivery??``)||![`ready`,`cancelled`].includes(e.phase))?1e3:0}),[O,k]=(0,T.useState)(``),[A,j]=(0,T.useState)({}),[M,N]=(0,T.useState)(!1),[P,F]=(0,T.useState)(!1),I=(0,T.useRef)(``),L=(0,T.useRef)(null),R=async(e,t)=>{if(!(!a||M)){N(!0),F(!1);try{await c(o(i),{method:`POST`,body:JSON.stringify({action:e,expectedVersion:a.version,...t?{value:t}:{}})}),await w()}catch{F(!0),await w()}finally{N(!1)}}};(0,T.useEffect)(()=>{if(!a||M||a.expired||a.phase===`cancelled`)return;if(a.phase===`ready`&&!a.reloadRequired&&a.returnChannel!==`weixin`){t(a);return}if(P)return;let n=a.requiresRecheck||a.phase===`planned`||[`connected`,`error`,`cancelled`].includes(a.authState??``)?`advance`:a.phase===`oauth_required`?`authorize`:void 0,r=`${e}:${a.version}:${n}`;n&&I.current!==r&&(I.current=r,R(n))},[a,M,P,t,e]);let z=!!(a?.expired||a?.phase===`cancelled`),B=a?.secretFields?.length?a.secretFields:[{id:`token`,label:r.secret}],V=!!(O||Object.values(A).some(Boolean)),H=!!(a?.nextRetryAt&&a.nextRetryAt>Date.now()),U=B.every(e=>(e.id===`token`?O:A[e.id]??``).trim()),W=a?.phase===`ready`&&!a.reloadRequired&&!z,G=a?.phase===`approval_required`&&!z?a.approval:void 0,K=a?.phase===`approval_required`&&!z?a.planApproval:void 0,q=!!(G||K),J=a&&(a.phase===`token_required`||a.phase===`auth_unknown`&&a.canProvideToken||a.phase===`blocked`&&(a.canReplaceToken||a.canProvideToken))&&!a.requiresRecheck&&!z&&!a.reloadRequired,Y=a?.phase===`authorizing`&&!z&&!a.reloadRequired,X=W&&a?.returnChannel===`weixin`&&a.replyDelivery===`failed`,Z=(a?.phase===`blocked`||a?.phase===`auth_unknown`)&&!J&&!z,ne=a?.expired?r.expired:a?.phase===`cancelled`?r.cancelled:a?.reloadRequired?r.reload:W?X?r.deliveryFailed:a?.replyDelivery===`delivered`?r.delivered:r.continuing:q?r.approval:H?n===`zh`?`服务要求等待,将在 ${new Date(a.nextRetryAt).toLocaleTimeString()} 后有限重试。`:`Waiting until ${new Date(a.nextRetryAt).toLocaleTimeString()} before a bounded retry.`:a?.phase===`auth_unknown`?n===`zh`?`认证方式尚未确定。若服务提供 Token,可在此输入;如需 OAuth,请核实接入资料后重新检查。`:`Authentication is not yet determined. Enter a Token only if your service provides one; for OAuth, verify the integration guide and recheck.`:J?a.canProvideToken?r.accessDeniedToken:r.tokenDescription:Y?r.waiting:_||Z||P?r.failed:r.checkingDescription,Q=()=>{M||(k(``),j({}),t(a))},$=`min-h-12 w-full rounded-xl text-[15px]`,re=W?h:J?te:y;return(0,E.jsx)(m,{open:!0,onOpenChange:e=>{e||Q()},children:(0,E.jsxs)(f,{children:[(0,E.jsx)(u,{className:`fixed inset-0 z-[70] bg-scrim backdrop-blur-sm`}),(0,E.jsxs)(ee,{onOpenAutoFocus:e=>{e.preventDefault(),L.current?.focus()},onPointerDownOutside:e=>{(M||V)&&e.preventDefault()},onEscapeKeyDown:e=>{M&&e.preventDefault()},className:`fixed inset-x-0 bottom-0 z-[70] flex h-[min(36rem,calc(100dvh-1rem))] flex-col overflow-hidden rounded-t-3xl border border-edge bg-surface-overlay text-fg shadow-elevated sm:inset-x-auto sm:bottom-auto sm:left-1/2 sm:top-1/2 sm:h-[min(36rem,calc(100dvh-3rem))] sm:w-[28rem] sm:-translate-x-1/2 sm:-translate-y-1/2 sm:rounded-3xl`,children:[(0,E.jsxs)(`header`,{className:`relative shrink-0 px-6 pb-5 pt-8 text-center sm:px-8`,children:[(0,E.jsx)(C,{variant:`ghost`,className:`absolute right-2 top-2 size-11 rounded-full p-0`,"aria-label":r.close,disabled:M,onClick:Q,children:(0,E.jsx)(b,{className:`size-4`,"aria-hidden":!0})}),(0,E.jsx)(`div`,{className:`mx-auto mb-4 flex size-12 items-center justify-center rounded-2xl bg-surface-hover`,children:(0,E.jsx)(re,{className:`size-6 text-accent-fg`,strokeWidth:1.6,"aria-hidden":!0})}),(0,E.jsx)(p,{ref:L,tabIndex:-1,className:`break-words text-xl font-semibold tracking-tight focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:W?r.connected:a?.displayName||r.title}),a?(0,E.jsx)(`p`,{className:`mt-1 truncate text-[13px] text-fg-muted`,title:a.endpointOrigin,children:a.endpointOrigin}):null,(0,E.jsx)(d,{role:!J&&(_||P||Z||a?.expired||a?.reloadRequired)?`alert`:void 0,className:`mt-3 text-sm leading-relaxed text-fg-muted`,children:ne})]}),(0,E.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain px-6 pb-4 sm:px-8`,"aria-busy":M,children:[!a&&!_?(0,E.jsxs)(`div`,{role:`status`,"aria-label":r.loading,className:`space-y-3`,children:[(0,E.jsx)(x,{className:`h-12 w-full rounded-xl`}),(0,E.jsx)(x,{className:`h-4 w-3/4`})]}):null,G?(0,E.jsxs)(`section`,{className:`space-y-3`,children:[(0,E.jsxs)(`dl`,{className:`space-y-3 rounded-2xl bg-surface-base p-4 text-sm`,children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`dt`,{className:`mb-1 text-xs text-fg-muted`,children:r.identity}),(0,E.jsxs)(`dd`,{className:`break-all`,children:[G.accountId,` / `,G.peerId]})]}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`dt`,{className:`mb-1 text-xs text-fg-muted`,children:r.endpoint}),(0,E.jsx)(`dd`,{className:`break-all`,children:G.endpoint})]}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`dt`,{className:`mb-1 text-xs text-fg-muted`,children:r.purpose}),(0,E.jsx)(`dd`,{className:`break-words leading-relaxed`,children:G.purpose})]})]}),(0,E.jsx)(`p`,{className:`text-xs leading-relaxed text-fg-muted`,children:r.shared}),K?(0,E.jsxs)(`div`,{className:`space-y-2 rounded-xl bg-surface-base p-3 text-xs`,children:[(0,E.jsx)(`p`,{children:n===`zh`?`同时审阅本次来源与执行计划:`:`Also review this source and execution plan:`}),(0,E.jsx)(`pre`,{className:`whitespace-pre-wrap break-all`,children:JSON.stringify(K,null,2)})]}):null]}):K?(0,E.jsxs)(`section`,{className:`space-y-3 text-sm`,children:[(0,E.jsx)(`p`,{className:`break-all`,children:K.endpoint}),(0,E.jsx)(`p`,{children:K.purpose}),K.execution?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`p`,{children:n===`zh`?`将在 Gateway 主机运行以下程序,可能下载指定依赖,并按该主机的进程权限访问文件和网络。`:`This program runs on the Gateway host, may download the specified dependency and can access files and network with that process’s permissions.`}),(0,E.jsx)(`pre`,{className:`whitespace-pre-wrap break-all rounded-xl bg-surface-base p-3 text-xs`,children:JSON.stringify(K.execution,null,2)})]}):(0,E.jsx)(`p`,{children:n===`zh`?`来源归属尚未独立核实。请确认服务和以下资料来源后连接。`:`Publisher ownership has not been independently verified. Review the service and sources before connecting.`}),K.sources.map(e=>(0,E.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`block break-all text-accent-fg`,children:e.url},e.url))]}):J?(0,E.jsxs)(`form`,{id:`mcp-setup-secret-form`,className:`space-y-3`,onSubmit:e=>{e.preventDefault();let t=a.secretFields?.length?Object.fromEntries(B.map(e=>[e.id,e.id===`token`?O:A[e.id]??``])):O;k(``),j({}),R(`token`,t)},children:[B.map(e=>(0,E.jsxs)(`div`,{className:`space-y-2`,children:[(0,E.jsx)(`label`,{htmlFor:`mcp-setup-${e.id}`,className:`block text-sm font-medium`,children:e.label}),(0,E.jsx)(g,{id:`mcp-setup-${e.id}`,value:e.id===`token`?O:A[e.id]??``,onChange:t=>{e.id===`token`?k(t):j(n=>({...n,[e.id]:t})),F(!1)},disabled:M||H,autoComplete:`off`,hideCopy:!0,className:`[&_button]:size-11 [&_button]:p-3`,ariaDescribedBy:`mcp-secret-hint`,ariaInvalid:a.errorCode===`credential_rejected`||P,inputClassName:`min-h-12 rounded-xl pr-14 text-base`,labels:l(n).connectorsSettings.secretInputLabels})]},e.id)),a.helpUrl?(0,E.jsx)(`a`,{href:a.helpUrl,target:`_blank`,rel:`noopener noreferrer`,className:`text-sm text-accent-fg`,children:n===`zh`?`获取访问密钥`:`Get an access key`}):null,(0,E.jsxs)(`p`,{id:`mcp-secret-hint`,className:`flex items-start gap-1.5 text-xs leading-relaxed text-fg-muted`,children:[(0,E.jsx)(y,{className:`mt-0.5 size-3.5 shrink-0`,"aria-hidden":!0}),r.hint]}),a.errorCode===`credential_rejected`||P||a.phase===`blocked`&&!a.canProvideToken?(0,E.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:a.errorCode===`credential_rejected`?r.invalidToken:r.failed}):null]}):W&&a?.returnChannel===`weixin`?(0,E.jsx)(`p`,{role:`status`,className:`py-5 text-center text-sm text-fg-muted`,children:r.returnWeixin}):_||P||Z||a?.expired||a?.reloadRequired?null:!z&&!Y?(0,E.jsxs)(`div`,{role:`status`,"aria-label":r.checking,className:`space-y-3`,children:[(0,E.jsx)(x,{className:`h-12 w-full rounded-xl`}),(0,E.jsx)(x,{className:`h-4 w-2/3`})]}):null,a&&!z&&!W?(0,E.jsxs)(`details`,{className:`mt-5 text-sm text-fg-muted`,children:[(0,E.jsx)(`summary`,{className:`min-h-11 cursor-pointer py-3 text-xs focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:r.details}),(0,E.jsxs)(`div`,{className:`space-y-2 pb-2`,children:[G?null:(0,E.jsx)(`p`,{className:`break-all text-xs`,children:a.endpointOrigin}),a.phase===`approval_required`?null:(0,E.jsx)(C,{variant:`ghost`,className:`min-h-11 w-full justify-start text-xs`,disabled:M||H,onClick:()=>{I.current=``,R(`advance`)},children:r.check}),(0,E.jsx)(C,{variant:`ghost`,className:`min-h-11 w-full justify-start text-xs`,disabled:M,onClick:()=>void R(`cancel`),children:r.cancel})]})]}):null]}),(0,E.jsxs)(`footer`,{className:`shrink-0 space-y-2 border-t border-edge/60 px-6 pt-4 pb-[max(1.25rem,env(safe-area-inset-bottom))] sm:px-8`,children:[q?(0,E.jsxs)(C,{variant:`primary`,className:$,disabled:M,onClick:()=>void R(`approve`),children:[M?(0,E.jsx)(v,{className:`size-4 animate-spin motion-reduce:animate-none`,"aria-hidden":!0}):null,r.approve]}):J?(0,E.jsxs)(C,{variant:`primary`,className:$,form:`mcp-setup-secret-form`,type:`submit`,disabled:M||!U,children:[M?(0,E.jsx)(v,{className:`size-4 animate-spin motion-reduce:animate-none`,"aria-hidden":!0}):null,M?r.checking:r.submit]}):Y&&a?.authorizationUrl?(0,E.jsx)(C,{asChild:!0,variant:`primary`,className:$,children:(0,E.jsx)(`a`,{href:a.authorizationUrl,target:`_blank`,rel:`noopener noreferrer`,children:r.login})}):X?(0,E.jsx)(C,{variant:`primary`,className:$,disabled:M,onClick:()=>void R(`retry_delivery`),children:r.retryDelivery}):Z||a?.reloadRequired||_?(0,E.jsx)(C,{variant:`primary`,className:$,disabled:M||H,onClick:()=>{I.current=``,a?R(`advance`):w()},children:r.check}):W||z?(0,E.jsx)(C,{variant:`primary`,className:$,onClick:Q,children:a?.returnChannel===`weixin`?r.done:r.back}):null,!W&&!z?(0,E.jsx)(C,{variant:`ghost`,className:`min-h-11 w-full rounded-xl text-sm`,disabled:M,onClick:Q,children:r.later}):null]})]})]})})}function k(){let e=(0,w.c)(8),{setupId:t}=i(),n=t===void 0?``:t,r=a(),o=s(A),[c,l]=(0,T.useState)(!1),u;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>l(!1),e[0]=u):u=e[0];let d;e[1]===n?d=e[2]:(d=[n],e[1]=n,e[2]=d),(0,T.useEffect)(u,d);let f;return e[3]!==c||e[4]!==o||e[5]!==r||e[6]!==n?(f=(0,E.jsx)(`main`,{className:`flex h-full min-h-0 items-center justify-center bg-surface-base p-6`,children:c?(0,E.jsxs)(`section`,{className:`max-w-xs space-y-4 text-center`,children:[(0,E.jsx)(_,{className:`mx-auto size-6 text-fg-muted`,"aria-hidden":!0}),(0,E.jsx)(`h1`,{className:`text-lg font-medium text-fg`,children:D[o].closed}),(0,E.jsx)(C,{onClick:()=>l(!1),children:D[o].reopen})]}):(0,E.jsx)(O,{setupId:n,onClose:e=>{e?.returnChannel===`weixin`?l(!0):r(e?`/chat/${e.conversationId}`:`/chat`,{replace:!0})}})}),e[3]=c,e[4]=o,e[5]=r,e[6]=n,e[7]=f):f=e[7],f}function A(e){return e.language}export{O as McpConversationSetupDialog,k as McpConversationSetupPage};
|
package/dist/gateway/static/root/assets/{media-plugins-8E2KZQym.js → media-plugins-B5wtLz3Z.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-aKtaBQYM.js";import{a as e,n as t,t as n}from"./vendor-react-BOUWij0V.js";import{t as r}from"./messages-
|
|
1
|
+
import"./rolldown-runtime-aKtaBQYM.js";import{a as e,n as t,t as n}from"./vendor-react-BOUWij0V.js";import{t as r}from"./messages-DPLud9GK.js";import{a as i}from"./attachment-utils-core-BIOUBrpT.js";import{t as a}from"./preview-open-alternatives-CY_hjK4b.js";import{t as o}from"./use-blob-object-url-D4BFuzZB.js";var s=t();e();var c=n();function l(e){let t=(0,s.c)(2),n;return t[0]===e?n=t[1]:(n=(0,c.jsx)(d,{props:e,kind:`audio`}),t[0]=e,t[1]=n),n}function u(e){let t=(0,s.c)(2),n;return t[0]===e?n=t[1]:(n=(0,c.jsx)(d,{props:e,kind:`video`}),t[0]=e,t[1]=n),n}function d(e){let t=(0,s.c)(8),{props:n,kind:r}=e,a;bb0:{if(!n.binaryBuffer){a=null;break bb0}let e;if(t[0]!==r||t[1]!==n.binaryBuffer||t[2]!==n.descriptor.fileName||t[3]!==n.descriptor.mimeType){let a=i(n.descriptor.fileName)??n.descriptor.mimeType;e=new Blob([n.binaryBuffer],{type:a||`${r}/*`}),t[0]=r,t[1]=n.binaryBuffer,t[2]=n.descriptor.fileName,t[3]=n.descriptor.mimeType,t[4]=e}else e=t[4];a=e}let l=o(a);if(!l)return null;let u;return t[5]!==r||t[6]!==l?(u=(0,c.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center overflow-auto bg-surface-base p-4 dark:bg-surface-hover/20`,children:r===`audio`?(0,c.jsx)(`audio`,{src:l,controls:!0,className:`w-full max-w-2xl`}):(0,c.jsx)(`video`,{src:l,controls:!0,playsInline:!0,className:`max-h-full max-w-full rounded-md bg-black`})}),t[5]=r,t[6]=l,t[7]=u):u=t[7],u}function f(e){let t=(0,s.c)(12),n;t[0]===e.language?n=t[1]:(n=r(e.language),t[0]=e.language,t[1]=n);let i=n,o=e.descriptor.context===`workspace`,l=o?`${i.workspace.cannotPreviewType} ${i.workspace.openElsewhereHint}`:i.chat.attachmentPreviewOpenElsewhereHint,u=o?i.workspace.openSystemApp:void 0,d=o?i.workspace.chooseApp:void 0,f;return t[2]!==i.chat.attachmentPreviewDownloadFull||t[3]!==e.actions.canChooseOpenWithApp||t[4]!==e.actions.canOpenWithSystemApp||t[5]!==e.actions.onChooseOpenWithApp||t[6]!==e.actions.onDownload||t[7]!==e.actions.onOpenWithSystemApp||t[8]!==l||t[9]!==u||t[10]!==d?(f=(0,c.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 overflow-auto p-4`,children:(0,c.jsx)(a,{message:l,downloadLabel:i.chat.attachmentPreviewDownloadFull,onDownload:e.actions.onDownload,openSystemLabel:u,onOpenWithSystemApp:e.actions.onOpenWithSystemApp,canOpenWithSystemApp:e.actions.canOpenWithSystemApp,chooseAppLabel:d,onChooseOpenWithApp:e.actions.onChooseOpenWithApp,canChooseOpenWithApp:e.actions.canChooseOpenWithApp})}),t[2]=i.chat.attachmentPreviewDownloadFull,t[3]=e.actions.canChooseOpenWithApp,t[4]=e.actions.canOpenWithSystemApp,t[5]=e.actions.onChooseOpenWithApp,t[6]=e.actions.onDownload,t[7]=e.actions.onOpenWithSystemApp,t[8]=l,t[9]=u,t[10]=d,t[11]=f):f=t[11],f}export{l as AudioPreviewPluginView,f as UnsupportedPreviewPluginView,u as VideoPreviewPluginView};
|