@xopcai/xopc 0.0.450 → 0.0.451
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-Tn5McYcg.js → activity-store-OMq1GnqB.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-BX5HhrTI.js → agent-avatar-dicebear-CIoE-FJR.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-display-C7Dx9nt1.js → agent-avatar-display-kPb6idGG.js} +2 -2
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-AAJsxEjB.js → agent-defaults-settings-panel-vKUDGEU6.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-BhtzU8qr.js → agent-plugin-dialog-x7guoCvz.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-CbGYb9WI.js → agents-BbwFcl87.js} +3 -3
- package/dist/gateway/static/root/assets/{agents-admin-api-CShyoj9I.js → agents-admin-api-tXB8Aj5K.js} +1 -1
- package/dist/gateway/static/root/assets/{api-B3M6ifoo.js → api-DIKAjDAK.js} +1 -1
- package/dist/gateway/static/root/assets/{api-BET9vZ1l.js → api-ixudT_21.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-BxOShFPO.js → app-management-settings-panel-nuDfyfZ5.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-L450QlMW.js → appearance-settings-D4oON26V.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-Bz6_fyMs.js → apps-page-BM1BfXzo.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-BCXEOal7.js → archive-plugin-mKjfC6Sk.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-api-B3Jnoa2G.js → automation-api-C9pjryrT.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-result-state-BHAKc5QI.js → automation-result-state-uvg7Bi2x.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-run-list-De7gini_.js → automation-run-list-J-R4-hVm.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-task-card-Clf0fe_n.js → automation-task-card-CXGC8afU.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-BEG5xLew.js → automations-page-CwQg9dfM.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-Cfq1C6XB.js → automations-workspace-DhLgFY2T.js} +2 -2
- package/dist/gateway/static/root/assets/{binary-plugins-B7tuUWzS.js → binary-plugins-BNPDM14i.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-D-YHASZr.js → block-editor-De9UqmMT.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-DdMMia7Y.js → browser-settings-page-B0VB5umC.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-Cxh3nYa6.js → capabilities-BtJB4u5C.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-YfkMBZCb.js → capabilities-Cp-rmFMM.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-page-CSBeVda0.js → capabilities-page-KRaK8LKT.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-aJy-1o5H.js +8 -0
- package/dist/gateway/static/root/assets/{channels-DdSEH-R2.js → channels-ZJORx-he.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-agents-api-CgasFAm4.js → chat-agents-api-CtuEaDG8.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-chart-block-Cgks7rH3.js → chat-chart-block-ShPQBlNE.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-page-BKLyj4IP.js → chat-page-QmBfel_Z.js} +22 -22
- package/dist/gateway/static/root/assets/{chat-terminal-dock-aCu4X5Jo.js → chat-terminal-dock-CvDRfHAZ.js} +1 -1
- package/dist/gateway/static/root/assets/{command-palette-api-Bku_h283.js → command-palette-api-NJTvEF2b.js} +1 -1
- package/dist/gateway/static/root/assets/composer-notifications-BkezOy9Q.js +1 -0
- package/dist/gateway/static/root/assets/composer-payload-handoff-CEjJusbJ.js +1 -0
- package/dist/gateway/static/root/assets/{computer-settings-page-zvWUPPAr.js → computer-settings-page-DG8bcw_s.js} +1 -1
- package/dist/gateway/static/root/assets/{connected-providers-grid-w3htbAyh.js → connected-providers-grid-BWVieU6P.js} +1 -1
- package/dist/gateway/static/root/assets/{connection-usage-guide-DL2T6cSN.js → connection-usage-guide-f55PDAbb.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-a0gQC-nc.js → connector-service-page-Ca09FIBW.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-api-DNVUmf9M.js → connectors-api-dai-YAdK.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-D1VzTxON.js → connectors-page-C8M01Zxs.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-E0cqnNlR.js → date-picker-C70ICT7u.js} +1 -1
- package/dist/gateway/static/root/assets/{date-time-picker-CrC_VKpw.js → date-time-picker-Czj5fnsJ.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-D1MkNl5F.js → desktop-pet-Dq3OLpPg.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-BA6u5Md-.js → desktop-pet-settings-q4mec6zt.js} +1 -1
- package/dist/gateway/static/root/assets/{dev-view-store-DnqJb6NS.js → dev-view-store-lXnKsRew.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-Ba3d606o.js → device-pairing-wizard-CbUX0iit.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-lcps-hsZ.js → directory-picker-path-field-BRnwhemd.js} +1 -1
- package/dist/gateway/static/root/assets/{discussion-annotation-sync-BmvCn1Xn.js → discussion-annotation-sync-BnK6Ua7v.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-BOJbNj9D.js → extension-debug-page-Bp2BrJbB.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-iframe-host-pbU7DAfE.js → extension-iframe-host-DjXDDmUd.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-marketplace-api-BrLsjJLA.js → extension-marketplace-api-tk93vJL_.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-BrX4Hy9P.js → extension-page-CGgneUDY.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-DUzhV5_a.js → extension-provider-BktGTwH_.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-BuV-Vuvb.js → extension-settings-page-BGcZIeHP.js} +1 -1
- package/dist/gateway/static/root/assets/{file-preview-surface-B3nLuoQO.js → file-preview-surface-BK2_4mWy.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-CtZy1Qw0.js → gateway-config-swr-DsXilOaJ.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-CG65gHUY.js → gateway-realtime-DopPmAMl.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-ZxMFPH4n.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-restart-Cr5xtfZU.js → gateway-restart-eozrXTm7.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-BwMwdwXh.js → gateway-settings-DddUli-p.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-DztAHGru.js → gateway-startup-retry-DMQI0ATo.js} +1 -1
- package/dist/gateway/static/root/assets/{global-defaults-api-yHc-ZfjU.js → global-defaults-api-D7hk1zTj.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-C8oVgxQg.js +3 -0
- package/dist/gateway/static/root/assets/{image-generation-api-D5eo_stq.js → image-generation-api-BCbvDDH_.js} +1 -1
- package/dist/gateway/static/root/assets/imports-page-B9LF_2fO.js +1 -0
- package/dist/gateway/static/root/assets/index-CPXKrqLj.js +11 -0
- package/dist/gateway/static/root/assets/index-Dc-3QQaz.css +1 -0
- package/dist/gateway/static/root/assets/{install-connector-dialog-B-v1FT3P.js → install-connector-dialog-DT32t-66.js} +1 -1
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BLBASsCP.js → keyboard-shortcuts-settings-DDwoBK8g.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-3J9ABnCu.js → local-app-workbench-page-CnckB-RA.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-Db93n4Zy.js → local-apps-page-qzxr3c8Y.js} +1 -1
- package/dist/gateway/static/root/assets/{local-session-drafts-C6oPrCYY.js → local-session-drafts-BU3FXj_X.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-CQcW9_qA.js → locale-store-DTUQ0JiK.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-_nIEwZn4.js +2 -0
- package/dist/gateway/static/root/assets/{management-api-Dh2r5GrQ.js → management-api-C6mCD0mZ.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-Fj25fafb.js → management-settings-C4BKD-_b.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-CkihBz06.js → markdown-view-DHjn1-ML.js} +1 -1
- package/dist/gateway/static/root/assets/{mcp-conversation-setup-page-jh3dwNfg.js → mcp-conversation-setup-page-ClgMvru5.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-BUapXtQZ.js → media-plugins-8E2KZQym.js} +1 -1
- package/dist/gateway/static/root/assets/{messages-orB1BMgI.js → messages-C7ruaWtK.js} +3 -3
- package/dist/gateway/static/root/assets/{model-selector-DYxgKUju.js → model-selector-CJY9LRsl.js} +1 -1
- package/dist/gateway/static/root/assets/{models-hub-cache-D2cdb8nZ.js → models-hub-cache-BTs8jhgq.js} +1 -1
- package/dist/gateway/static/root/assets/{note-detail-panel-BMtKrv-J.js → note-detail-panel-DiCfpcZd.js} +3 -3
- package/dist/gateway/static/root/assets/note-image-lightbox-kccIXJo_.js +1 -0
- package/dist/gateway/static/root/assets/{notes-api-BhRyWe3S.js → notes-api-BnaeXy22.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-DcmRJJbt.js → notes-page-B_vTBmyx.js} +2 -2
- package/dist/gateway/static/root/assets/{oauth-api-D5iBtOid.js → oauth-api-BZ67vxsq.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-provider-connect-CmHsHynu.js → oauth-provider-connect-CZP15znW.js} +1 -1
- package/dist/gateway/static/root/assets/{open-capability-settings-Cvb65hQB.js → open-capability-settings-DQsmJxI7.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-capture-button-CTHQWfG6.js → page-context-capture-button-TpjRHhUt.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-draft-aApa5ApP.js → page-context-draft-BbUpxlgV.js} +1 -1
- package/dist/gateway/static/root/assets/page-header-store-CFntbsPj.js +1 -0
- package/dist/gateway/static/root/assets/{personal-avatar-Dp5LHjk3.js → personal-avatar-CVocefDp.js} +1 -1
- package/dist/gateway/static/root/assets/personal-page-BjnSgU89.js +1 -0
- package/dist/gateway/static/root/assets/{personal-settings-panel-CtJL6qIN.js → personal-settings-panel-CdMHSPCH.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-dependencies-card-BBk6k0t0.js → phone-dependencies-card-ChRrViSc.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-connection-QJt8SAb7.js → phone-model-connection-DmswEWqx.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-picker-CRxUxJNZ.js → phone-model-picker-CvuOhQpk.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-settings-page-Df64khPY.js → phone-settings-page-2hZ68I47.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-workspace-store-DAuPd2ie.js → phone-workspace-store-BMvxfZ3g.js} +1 -1
- package/dist/gateway/static/root/assets/{plugin-details-dialog-Bcer4RC3.js → plugin-details-dialog-qvdi41L2.js} +1 -1
- package/dist/gateway/static/root/assets/{preference-select-fields-DdV7q9Bd.js → preference-select-fields-RDatqlhG.js} +1 -1
- package/dist/gateway/static/root/assets/{product-automation-feedback-uKndNxpU.js → product-automation-feedback-Bj9ZsasT.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-A7lyoXVv.js → product-open-page-CzXmn2MX.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-BrdvkWOg.js → product-preview-content-Beg0t4GW.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-modal-BxHKejcX.js → product-preview-modal-5ulFfVzf.js} +2 -2
- package/dist/gateway/static/root/assets/project-detail-page-8bnYqXLJ.js +7 -0
- package/dist/gateway/static/root/assets/{project-understanding-BVhSoQHu.js → project-understanding-CXf7wjwt.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-DSPoyFda.js → projects-page-CyA6fCPg.js} +1 -1
- package/dist/gateway/static/root/assets/{providers-api-B47s6_9Q.js → providers-api-DE7kdeXc.js} +1 -1
- package/dist/gateway/static/root/assets/{recording-upload-B-IHTsVC.js → recording-upload-BZvpuPZT.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-Bo8YiUE0.js → registry-api-C_8-f85U.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-BRf9znLV.js → remote-access-hub-Daxdjqs9.js} +1 -1
- package/dist/gateway/static/root/assets/{resource-unavailable-CAljzZx8.js → resource-unavailable-khPb8zb8.js} +1 -1
- package/dist/gateway/static/root/assets/route-preload-DGMUu3pm.js +2 -0
- package/dist/gateway/static/root/assets/{runtime-tools-api-C28pB9__.js → runtime-tools-api-2YumRxOJ.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-XYeadnhL.js → runtime-tools-settings-panel-DH00p-rI.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-CtRM41Re.js → schema-form-C9TYGa0_.js} +1 -1
- package/dist/gateway/static/root/assets/secret-input-DsjfQmDn.js +1 -0
- package/dist/gateway/static/root/assets/{service-recommendation-list-C6ydoBSU.js → service-recommendation-list-wXf_ZlHq.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-D7FWdG43.js → session-api-Dt7vRa-E.js} +1 -1
- package/dist/gateway/static/root/assets/session-channel-icon-BzkFo-Ci.js +1 -0
- package/dist/gateway/static/root/assets/{session-identity-label-BP7OIYth.js → session-identity-label-D5SAi0Uh.js} +1 -1
- package/dist/gateway/static/root/assets/{session-manager-C1T7WiP7.js → session-manager-5qokJQ6W.js} +1 -1
- package/dist/gateway/static/root/assets/{sessions-page-CyYkCsfy.js → sessions-page-CCcpMHIH.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-B7-XQiJh.js +1 -0
- package/dist/gateway/static/root/assets/{settings-advanced-section-3HwfHbqz.js → settings-advanced-section-DRlQdj_w.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-mode-store-BVvIXZlg.js → settings-mode-store-BE6t--iO.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-C6ypo-jn.js → settings-page-_F2d9-GZ.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-header-CheboxIM.js → settings-page-header-DG3MQwSF.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-CPFMZaLF.js → settings-page-layout-SuMAUhMb.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-interaction-page-BbCzYq9S.js → setup-interaction-page-DyDiHKjZ.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-DUNgVqtz.js → setup-status-panel-CPNFWhrr.js} +1 -1
- package/dist/gateway/static/root/assets/{share-link-dialog-0P9ghttc.js → share-link-dialog-wu-minYF.js} +1 -1
- package/dist/gateway/static/root/assets/share-preview-page-BqbfuQBU.js +2 -0
- package/dist/gateway/static/root/assets/{shares-api-iiw4F-ra.js → shares-api-DwsEzRc6.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-BQ1qXAJn.js → shares-settings-BxutiB6Y.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-api-CLtIjE8K.js → skill-api-C7wPB73H.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-list-api-DY0rRlUk.js → skill-list-api-C4AjzhlY.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-DJC8uWLu.js → skill-reload-api-CqfS9zlG.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-CQYf7s9f.js → skills-page-8VYadExR.js} +1 -1
- package/dist/gateway/static/root/assets/sliding-segmented-D346J92k.js +1 -0
- package/dist/gateway/static/root/assets/{system-settings-panel-DdBmyc93.js → system-settings-panel-BV4GHnns.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-Bb1R4QsJ.js → task-detail-page-C9IyuxdS.js} +3 -3
- package/dist/gateway/static/root/assets/{task-input-card-Xl4xFjCn.js → task-input-card-NtzzVc0e.js} +1 -1
- package/dist/gateway/static/root/assets/{terminal-panel-store-B1EVdx4L.js → terminal-panel-store-DWdJOGMn.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-BTkYFJOE.js → theme-store-FNf-kdMR.js} +1 -1
- package/dist/gateway/static/root/assets/{tracing-settings-page-h-gbBAtl.js → tracing-settings-page-BRPJuRpc.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-BDoegsWD.js → tunnel-api-B7NHNrQJ.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-activity-store-DyFJDqHy.js → understanding-activity-store-bgCeO8bb.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-refresh-store-C0SRcgyd.js → understanding-refresh-store-CEhWIvsQ.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-CbJsT3zT.js → usage-page-35YfpfVW.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-CB2B4NMO.js → use-autosave-D8Qtt_Tn.js} +1 -1
- package/dist/gateway/static/root/assets/use-composer-attachments-H-tD4Db6.js +2 -0
- package/dist/gateway/static/root/assets/use-file-preview-expanded-P-0xmST2.js +15 -0
- package/dist/gateway/static/root/assets/{use-personal-profile-r0OuOlBJ.js → use-personal-profile-Bk2rGWSy.js} +1 -1
- package/dist/gateway/static/root/assets/use-realtime-voice-BcokfdI0.js +1 -0
- package/dist/gateway/static/root/assets/{use-workspace-tree-B9Bmg8LV.js → use-workspace-tree-D0_812KH.js} +1 -1
- package/dist/gateway/static/root/assets/{user-model-page-BudrJ73l.js → user-model-page-BxHnOljT.js} +1 -1
- package/dist/gateway/static/root/assets/voice-C607F0pB.js +1 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-C8wd8ijq.js → voice-api-key-field-BL56KGeq.js} +1 -1
- package/dist/gateway/static/root/assets/voice-config-api-DVFTuHwH.js +1 -0
- package/dist/gateway/static/root/assets/{voice-input-shortcut-events-TAmJNcsN.js → voice-input-shortcut-events-BK-IvchL.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-DsyYo1p0.js → work-discovery-overlay-DDXae8Yc.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-page-BJ9VN5Zd.js → work-discovery-page-CxN0abrd.js} +1 -1
- package/dist/gateway/static/root/assets/{working-directory-picker-modal-CFj-ZOJE.js → working-directory-picker-modal-D3BUBFa0.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-api-DYFy9__S.js → workspace-api-ymncGc6j.js} +2 -2
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-BQrMvAkL.js +1 -0
- package/dist/gateway/static/root/assets/workspace-file-preview-dialog-BKmtih6_.js +1 -0
- package/dist/gateway/static/root/assets/workspace-open-location-menu-BdfKT4O4.js +1 -0
- package/dist/gateway/static/root/assets/{xopc-cloud-account-card-DN4DdOWZ.js → xopc-cloud-account-card-BS_lsURY.js} +1 -1
- package/dist/gateway/static/root/index.html +91 -88
- package/dist/package.js +1 -1
- package/dist/packages/realtime-protocol/src/voice.js +32 -3
- package/dist/src/agent-config/schema.d.ts +30 -0
- package/dist/src/agent-config/schema.js +3 -1
- package/dist/src/cli/commands/gateway/lifecycle.js +1 -1
- package/dist/src/config/schema.d.ts +16 -0
- package/dist/src/config/schema.js +6 -0
- package/dist/src/gateway/hono/lib/safe-voice-config.d.ts +1 -0
- package/dist/src/gateway/hono/lib/safe-voice-config.js +7 -2
- package/dist/src/gateway/hono/routes/connectors.js +1 -1
- package/dist/src/gateway/hono/routes/models.js +4 -0
- package/dist/src/gateway/hono/routes/personal-agent.js +9 -1
- package/dist/src/gateway/hono/routes/voice.js +105 -12
- package/dist/src/gateway/security/gateway-scopes.js +1 -1
- package/dist/src/gateway/service/config-coordinator.d.ts +4 -0
- package/dist/src/gateway/service.js +4 -4
- package/dist/src/gateway/xopc-cloud-capability-setup.js +2 -2
- package/dist/src/imports/inventory.js +11 -3
- package/dist/src/infra/update-restart.js +1 -1
- package/dist/src/personal-agent/repository.d.ts +2 -3
- package/dist/src/personal-agent/service.d.ts +3 -6
- package/dist/src/personal-agent/service.js +11 -1
- package/dist/src/providers/model-catalog-persistence.js +2 -2
- package/dist/src/providers/setup/voice.js +9 -4
- package/dist/src/providers/xopc-cloud-model-source.js +2 -2
- package/dist/src/voice/platform-settings.js +1 -1
- package/dist/src/voice/realtime/omniEngine.d.ts +1 -0
- package/dist/src/voice/realtime/omniEngine.js +188 -43
- package/dist/src/voice/realtime/omniRoute.d.ts +5 -2
- package/dist/src/voice/realtime/omniRoute.js +29 -3
- package/dist/src/voice/realtime/runtime.js +46 -35
- package/dist/src/voice/realtime/runtime.types.d.ts +1 -1
- package/package.json +1 -1
- package/dist/gateway/static/root/assets/capabilities-settings-panel-C56aelvp.js +0 -8
- package/dist/gateway/static/root/assets/composer-payload-handoff-D1xUYD5M.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-Vl3uKAHV.js +0 -1
- package/dist/gateway/static/root/assets/home-page-DYkEc3Qb.js +0 -3
- package/dist/gateway/static/root/assets/imports-page-CLbpRE5i.js +0 -1
- package/dist/gateway/static/root/assets/index-CIeY0yyg.js +0 -11
- package/dist/gateway/static/root/assets/index-D1EDrkUo.css +0 -1
- package/dist/gateway/static/root/assets/logs-page-Dtoheh2t.js +0 -2
- package/dist/gateway/static/root/assets/note-image-lightbox-C6aTUp-c.js +0 -1
- package/dist/gateway/static/root/assets/page-header-store-B2Ahfm0W.js +0 -1
- package/dist/gateway/static/root/assets/personal-page-CpKBzGIk.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-CobfHZo0.js +0 -7
- package/dist/gateway/static/root/assets/route-preload-C0oV8og1.js +0 -2
- package/dist/gateway/static/root/assets/secret-input-Dryrns2s.js +0 -1
- package/dist/gateway/static/root/assets/session-channel-icon-D1ktvt1P.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-B3rOBkm_.js +0 -1
- package/dist/gateway/static/root/assets/share-preview-page-BoLq3kSO.js +0 -2
- package/dist/gateway/static/root/assets/use-composer-attachments-BPMn8eY_.js +0 -2
- package/dist/gateway/static/root/assets/use-file-preview-expanded-4SKLb9Fh.js +0 -15
- package/dist/gateway/static/root/assets/voice-config-api-yBcUSvvn.js +0 -1
- package/dist/gateway/static/root/assets/voice-transcribe-api-D4eyeSdG.js +0 -1
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-2Lt7rQfw.js +0 -1
- package/dist/gateway/static/root/assets/workspace-file-preview-dialog-DhqlVzSI.js +0 -1
- package/dist/gateway/static/root/assets/workspace-open-location-menu-C-ItyXwL.js +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{m as i}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{i as a,l as o,n as s,o as c}from"./locale-store-CQcW9_qA.js";import{t as l}from"./messages-orB1BMgI.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"./chevron-down-ccbiQQz_.js";import{n as _,r as v}from"./popover-select-CLsphyzA.js";import{t as y}from"./clipboard-copy-DuJk5WD6.js";import{t as b}from"./download-Dk-ZjtO6.js";import{t as x}from"./file-text-D12HbeVy.js";import{t as S}from"./folder-CN-pC3XL.js";import{t as C}from"./gauge-C78eD2BA.js";import{t as w}from"./list-filter-CIPvpfLA.js";import{t as T}from"./refresh-cw-BRlGaq2w.js";import{t as E}from"./search-DA7gz22f.js";import{t as D}from"./terminal-oKqqZdiG.js";import{t as O}from"./x-B_N4OPjy.js";import{t as k}from"./cn-0WouolD0.js";import{t as A}from"./skeleton-DzdOeGYz.js";import{u as j}from"./session-api-D7FWdG43.js";import{a as M}from"./gateway-realtime-CG65gHUY.js";import{t as N}from"./button-Cc4hUNTt.js";import{a as P,i as F,o as I,s as L}from"./dist-GJ8-1PAx.js";import{i as R,o as z,s as B}from"./settings-shell-dialog-layer-BU3UuiJr.js";import{t as V}from"./copy-to-clipboard-HOJ79TWv.js";import{o as ee,t as te}from"./form-field-width-DJw_jULe.js";import{n as H,t as U}from"./sliding-indicator-hwz0sx3h.js";import{t as W}from"./refresh-button-DiWdGAaX.js";import{r as G}from"./segmented-styles-Cqb91xsn.js";import{n as ne}from"./settings-page-header-CheboxIM.js";import"./settings-page-layout-CPFMZaLF.js";import{t as K}from"./date-time-picker-CrC_VKpw.js";var q=e(t(),1),J=n();function Y(e){let t=new URLSearchParams;if(!e)return``;e.level?.length&&t.set(`level`,e.level.join(`,`)),e.from&&t.set(`from`,e.from),e.to&&t.set(`to`,e.to),e.q&&t.set(`q`,e.q),e.module&&t.set(`module`,e.module),e.requestId&&t.set(`requestId`,e.requestId),e.conversationId&&t.set(`conversationId`,e.conversationId),e.transcriptId&&t.set(`transcriptId`,e.transcriptId),e.limit!=null&&t.set(`limit`,String(e.limit)),e.offset!=null&&t.set(`offset`,String(e.offset));let n=t.toString();return n?`?${n}`:``}async function X(e){return c(a(`/api/logs${Y(e)}`))}async function Z(){return(await c(a(`/api/logs/files`))).files??[]}async function re(){return(await c(a(`/api/logs/modules`))).modules??[]}async function ie(){let e=await c(a(`/api/logs/stats`));return{byLevel:e.byLevel??{},runtime:e.runtime}}async function ae(){return(await c(a(`/api/logs/dir`))).dir??``}async function oe(){return(await c(a(`/api/logs/level`))).level??`info`}async function se(e,t){return c(a(`/api/logs/level`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({level:e,...t==null?{}:{duration:String(t)}})})}async function ce(e){let t=new URLSearchParams;e?.from&&t.set(`from`,e.from),e?.to&&t.set(`to`,e.to),e?.limit!=null&&t.set(`limit`,String(e.limit));let n=t.toString();return(await c(a(`/api/logs/errors/summary${n?`?${n}`:``}`))).items??[]}var le=500,ue=class{_callbacks;_cleanup;constructor(e){this._callbacks=e}connect(e,t){this.disconnect();let n=new Set(e?.length?e:[`trace`,`debug`,`info`,`warn`,`error`,`fatal`]);this._cleanup=M(`logs`,{onEvent:e=>{if(e.event!==`log.entry`||!e.data||typeof e.data!=`object`)return;let r=e.data;!n.has(r.level)||t&&r.module!==t||this._callbacks.onEntry(r)},onGap:()=>this._callbacks.onError(`Live log replay gap; refresh the log query`)}),this._callbacks.onConnected()}disconnect(){this._cleanup?.(),this._cleanup=void 0}};function de(e,t){let n=`${t.timestamp}-${t.requestId??``}-${t.message}`;return[t,...e.filter(e=>`${e.timestamp}-${e.requestId??``}-${e.message}`!==n)].slice(0,le)}var Q=[`trace`,`debug`,`info`,`warn`,`error`,`fatal`];function fe(e){let t=new Date(String(e.timestamp)).getTime();return Number.isFinite(t)?t:0}function pe(e){return e.toSorted((e,t)=>fe(t)-fe(e))}var me=new Set(Q),he=[`error`,`fatal`],ge=[`warn`,`error`,`fatal`],_e=[`info`,`warn`,`error`,`fatal`];function ve(e){if(!e)return new Set;let t=new Set;for(let n of e.split(`,`)){let e=n.trim();me.has(e)&&t.add(e)}return t}function ye(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function be(e,t){return e.size===t.length&&t.every(t=>e.has(t))}function xe(e){return e.size===0?`all`:be(e,he)?`errors`:be(e,ge)?`warnPlus`:be(e,_e)?`infoPlus`:e.size===Q.length&&Q.every(t=>e.has(t))?`verbose`:`custom`}function Se(e){let t=xe(e);return t===`custom`?`other`:t}function Ce(e){switch(e){case`all`:return new Set;case`errors`:return new Set(he);case`warnPlus`:return new Set(ge);case`infoPlus`:return new Set(_e);case`verbose`:return new Set(Q)}}function we(e,t){return e.replace(/\{\{(\w+)\}\}/g,(e,n)=>String(t[n]??``))}function Te(e){return String(e.module||e.service||e.extension||`—`)}function Ee(e){if(typeof e.message==`string`&&e.message)return e.message;try{return JSON.stringify(e)}catch{return``}}function De(e){try{return new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1})}catch{return e}}function Oe(e){try{return new Date(e).toLocaleString()}catch{return e}}function ke(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Ae(e){let t=e.trim();return t.length<=10?t:`${t.slice(0,8)}…`}function je(e){return String(e).toLowerCase()}function Me(e){let t=e.phase??e.meta?.phase;return typeof t==`string`&&t.trim()?t:`—`}function Ne(e){return`${e.timestamp}-${e.requestId??``}-${e.message}`}function Pe(e){let t=e.err??e.meta?.err;if(!t||typeof t!=`object`)return null;let n=t;return{name:typeof n.name==`string`?n.name:void 0,message:typeof n.message==`string`?n.message:void 0,stack:typeof n.stack==`string`?n.stack:void 0}}function Fe(e,t){if(t.selectedLevels.size>0&&!t.selectedLevels.has(e.level)||t.moduleFilter&&Te(e)!==t.moduleFilter||t.requestIdFilter&&e.requestId!==t.requestIdFilter||t.transcriptIdFilter&&e.transcriptId!==t.transcriptIdFilter&&e.conversationId!==t.transcriptIdFilter)return!1;if(t.dateFrom){let n=new Date(t.dateFrom).getTime(),r=new Date(String(e.timestamp)).getTime();if(Number.isFinite(n)&&Number.isFinite(r)&&r<n)return!1}if(t.dateTo){let n=new Date(t.dateTo).getTime(),r=new Date(String(e.timestamp)).getTime();if(Number.isFinite(n)&&Number.isFinite(r)&&r>n)return!1}if(t.debouncedSearch){let n=t.debouncedSearch.toLowerCase();if(![e.message,Te(e),Me(e),e.requestId,e.conversationId,e.transcriptId,Pe(e)?.message,Pe(e)?.stack].filter(Boolean).map(String).join(` `).toLowerCase().includes(n))return!1}return!0}function Ie(e,t){let n=[];for(let r of Q){let i=e[r]??0;i>0&&n.push(`${t[r]} ${i}`)}return n.join(` · `)}function Le(e,t){switch(t.type){case`setSearchInput`:return e.searchInput===t.value?e:{...e,searchInput:t.value};case`setDebouncedSearch`:return e.debouncedSearch===t.value?e:{...e,debouncedSearch:t.value};case`setLevels`:return ye(e.selectedLevels,t.value)?e:{...e,selectedLevels:t.value};case`toggleLevel`:{let n=new Set(e.selectedLevels);return n.has(t.level)?n.delete(t.level):n.add(t.level),{...e,selectedLevels:n}}case`setModule`:return e.moduleFilter===t.value?e:{...e,moduleFilter:t.value};case`setRequestIdFilter`:return e.requestIdFilter===t.value?e:{...e,requestIdFilter:t.value};case`setTranscriptIdFilter`:return e.transcriptIdFilter===t.value?e:{...e,transcriptIdFilter:t.value};case`setDateFrom`:return e.dateFrom===t.value?e:{...e,dateFrom:t.value};case`setDateTo`:return e.dateTo===t.value?e:{...e,dateTo:t.value};case`setAutoRefresh`:return e.autoRefresh===t.value?e:{...e,autoRefresh:t.value};case`syncFromUrl`:{let n=t.payload;return e.searchInput===n.searchInput&&e.debouncedSearch===n.debouncedSearch&&ye(e.selectedLevels,n.selectedLevels)&&e.moduleFilter===n.moduleFilter&&e.requestIdFilter===n.requestIdFilter&&e.transcriptIdFilter===n.transcriptIdFilter&&e.dateFrom===n.dateFrom&&e.dateTo===n.dateTo&&e.autoRefresh===n.autoRefresh?e:{...e,...n}}case`clearAll`:return{searchInput:``,debouncedSearch:``,selectedLevels:new Set,moduleFilter:``,requestIdFilter:``,transcriptIdFilter:``,dateFrom:``,dateTo:``,autoRefresh:e.autoRefresh}}}var Re={logs:[],loading:!1,error:null,hasMore:!1,modules:[],files:[],stats:null,logDir:null};function ze(e,t){switch(t.type){case`queryStart`:return{...e,loading:!0,error:null,logs:[]};case`querySuccess`:return{...e,loading:!1,logs:pe(t.logs),hasMore:t.hasMore};case`queryError`:return t.resetLogs?{...e,loading:!1,error:t.message,logs:[],hasMore:!1}:{...e,loading:!1,error:t.message};case`appendSuccess`:return{...e,loading:!1,logs:pe([...e.logs,...t.logs]),hasMore:t.hasMore};case`metaSuccess`:return{...e,modules:t.modules,stats:t.stats,files:t.files};case`filesSuccess`:return{...e,files:t.files,logDir:t.logDir};case`filesClear`:return{...e,files:[]};case`liveTick`:return{...e,logs:pe(t.logs),hasMore:t.hasMore,stats:t.stats};case`appendLiveEntry`:return{...e,logs:pe(de(e.logs,t.entry))};case`updateStats`:return{...e,stats:t.stats};case`refreshAllSuccess`:return{...e,loading:!1,logs:pe(t.logs),hasMore:t.hasMore,stats:t.stats,files:t.files}}}function Be(e){let t=l(e).logs,n=o(e=>e.conversationId),r=!!n,[a,s]=i(),c=(0,q.useRef)(a),[u,d]=(0,q.useReducer)(Le,void 0,()=>{let e=c.current,t=e.get(`q`)??``;return{searchInput:t,debouncedSearch:t.trim(),selectedLevels:ve(e.get(`level`)),moduleFilter:e.get(`module`)??``,requestIdFilter:e.get(`requestId`)??``,transcriptIdFilter:e.get(`transcriptId`)??``,dateFrom:e.get(`from`)??``,dateTo:e.get(`to`)??``,autoRefresh:e.get(`live`)===`1`}}),[f,p]=(0,q.useReducer)(ze,Re),[m,h]=(0,q.useState)(null),[g,_]=(0,q.useState)(!1),[v,y]=(0,q.useState)(!1),[b,x]=(0,q.useState)(null),[S,C]=(0,q.useState)([]),[w,T]=(0,q.useState)(!1),{searchInput:E,debouncedSearch:D,selectedLevels:O,moduleFilter:k,requestIdFilter:A,transcriptIdFilter:M,dateFrom:N,dateTo:P,autoRefresh:F}=u,{logs:I,loading:L,error:R,hasMore:z,modules:B,files:V,stats:ee,logDir:te}=f,H=(0,q.useCallback)(e=>d({type:`setSearchInput`,value:e}),[]),U=(0,q.useCallback)(e=>d({type:`setLevels`,value:e}),[]),W=(0,q.useCallback)(e=>d({type:`setModule`,value:e}),[]),G=(0,q.useCallback)(e=>d({type:`setRequestIdFilter`,value:e}),[]),ne=(0,q.useCallback)(e=>d({type:`setTranscriptIdFilter`,value:e}),[]),K=(0,q.useCallback)(e=>d({type:`setDateFrom`,value:e}),[]),J=(0,q.useCallback)(e=>d({type:`setDateTo`,value:e}),[]),Y=(0,q.useCallback)(e=>d({type:`setAutoRefresh`,value:e}),[]),oe=(0,q.useMemo)(()=>Se(O),[O]),se=e=>{if(e===`other`){y(!0);return}d({type:`setLevels`,value:Ce(e)})},le=D.length>0||O.size>0||!!k||!!A||!!M||!!N||!!P,de=+(D.length>0)+ +(O.size>0)+ +!!k+ +!!A+ +!!M+(N||P?1:0);(0,q.useEffect)(()=>{let e=setTimeout(()=>d({type:`setDebouncedSearch`,value:E.trim()}),300);return()=>clearTimeout(e)},[E]),(0,q.useEffect)(()=>{let e=a.get(`q`)??``;d({type:`syncFromUrl`,payload:{searchInput:e,debouncedSearch:e.trim(),selectedLevels:ve(a.get(`level`)),moduleFilter:a.get(`module`)??``,requestIdFilter:a.get(`requestId`)??``,transcriptIdFilter:a.get(`transcriptId`)??``,dateFrom:a.get(`from`)??``,dateTo:a.get(`to`)??``,autoRefresh:a.get(`live`)===`1`}})},[a]),(0,q.useEffect)(()=>{let e=new URLSearchParams(a),t=D.trim();t?e.set(`q`,t):e.delete(`q`),O.size>0?e.set(`level`,Array.from(O).sort().join(`,`)):e.delete(`level`),k?e.set(`module`,k):e.delete(`module`),A?e.set(`requestId`,A):e.delete(`requestId`),M?e.set(`transcriptId`,M):e.delete(`transcriptId`),N?e.set(`from`,N):e.delete(`from`),P?e.set(`to`,P):e.delete(`to`),F?e.set(`live`,`1`):e.delete(`live`),e.toString()!==a.toString()&&s(e,{replace:!0})},[F,N,P,D,k,A,M,a,O,s]);let Q=(0,q.useMemo)(()=>({q:D||void 0,level:O.size>0?Array.from(O):void 0,module:k||void 0,requestId:A||void 0,transcriptId:M||void 0,from:N||void 0,to:P||void 0,limit:50}),[D,O,k,A,M,N,P]),fe=(0,q.useMemo)(()=>({debouncedSearch:D,selectedLevels:O,moduleFilter:k,requestIdFilter:A,transcriptIdFilter:M,dateFrom:N,dateTo:P}),[D,O,k,A,M,N,P]),pe=(0,q.useRef)(fe);return pe.current=fe,(0,q.useEffect)(()=>{if(!r)return;let e=!1;return T(!0),ce({from:N||void 0,to:P||void 0,limit:12}).then(t=>{e||C(t)}).catch(()=>{e||C([])}).finally(()=>{e||T(!1)}),()=>{e=!0}},[r,N,P]),(0,q.useEffect)(()=>{if(!r)return;let e=!1;return p({type:`queryStart`}),(async()=>{try{let t=await X({...Q,offset:0});if(e)return;p({type:`querySuccess`,logs:t.logs,hasMore:t.logs.length===50})}catch(n){e||p({type:`queryError`,message:n instanceof Error?n.message:t.loadError,resetLogs:!0})}})(),()=>{e=!0}},[r,Q,t.loadError]),(0,q.useEffect)(()=>{if(!r)return;let e=!1;return(async()=>{try{let[t,n,r]=await Promise.all([re(),ie(),Z()]);e||p({type:`metaSuccess`,modules:t,stats:n,files:r})}catch{}})(),()=>{e=!0}},[r]),(0,q.useEffect)(()=>{if(!r||!g)return;let e=!1;return(async()=>{try{let[t,n]=await Promise.all([Z(),ae()]);e||p({type:`filesSuccess`,files:t,logDir:n})}catch{e||p({type:`filesClear`})}})(),()=>{e=!0}},[r,g]),(0,q.useEffect)(()=>{if(!F||!r)return;let e=new ue({onConnected:()=>{},onEntry:e=>{Fe(e,pe.current)&&p({type:`appendLiveEntry`,entry:e})},onError:()=>{}});e.connect(O.size>0?Array.from(O):void 0,k||void 0);let t=window.setInterval(()=>{ie().then(e=>{p({type:`updateStats`,stats:e})}).catch(()=>{})},3e4);return()=>{e.disconnect(),clearInterval(t)}},[F,r,n,O,k]),(0,q.useEffect)(()=>{if(!b)return;let e=window.setTimeout(()=>x(null),2e3);return()=>clearTimeout(e)},[b]),{L:t,hasToken:r,logs:I,loading:L,error:R,hasMore:z,searchInput:E,setSearchInput:H,selectedLevels:O,setSelectedLevels:U,moduleFilter:k,setModuleFilter:W,requestIdFilter:A,transcriptIdFilter:M,dateFrom:N,setDateFrom:K,dateTo:P,setDateTo:J,modules:B,files:V,stats:ee,selectedLog:m,setSelectedLog:h,filesOpen:g,setFilesOpen:_,filtersOpen:v,setFiltersOpen:y,logDir:te,autoRefresh:F,setAutoRefresh:Y,copiedDetail:b,setCopiedDetail:x,hasActiveFilters:le,activeFilterCount:de,clearFilters:()=>d({type:`clearAll`}),toggleDialogLevel:e=>d({type:`toggleLevel`,level:e}),handleLoadMore:()=>{L||!z||(async()=>{p({type:`queryStart`});try{let e=await X({...Q,offset:I.length});p({type:`appendSuccess`,logs:e.logs,hasMore:e.logs.length===50})}catch(e){p({type:`queryError`,message:e instanceof Error?e.message:t.loadError})}})()},refreshAll:()=>{(async()=>{p({type:`queryStart`});try{let e=await X({...Q,offset:0}),[t,n]=await Promise.all([ie(),Z()]);p({type:`refreshAllSuccess`,logs:e.logs,hasMore:e.logs.length===50,stats:t,files:n})}catch(e){p({type:`queryError`,message:e instanceof Error?e.message:t.loadError})}})()},levelSegment:oe,handleLevelSegment:se,filterByRequestId:(0,q.useCallback)(e=>{h(null),G(e)},[G]),filterByTranscriptId:(0,q.useCallback)(e=>{h(null),ne(e)},[ne]),filterByErrorSummary:(0,q.useCallback)(e=>{d({type:`setSearchInput`,value:e.errName}),d({type:`setDebouncedSearch`,value:e.errName}),e.module&&d({type:`setModule`,value:e.module}),d({type:`setLevels`,value:Ce(`errors`)})},[]),openChatForSession:(0,q.useCallback)(e=>{let t=e.conversationId?.trim();if(t){window.dispatchEvent(new CustomEvent(`navigate-to-chat`,{detail:{conversationId:t}}));return}let n=e.transcriptId?.trim();n&&j({transcriptId:n}).then(e=>{window.dispatchEvent(new CustomEvent(`navigate-to-chat`,{detail:{conversationId:e.conversationId}}))}).catch(()=>{})},[]),errorSummary:S,errorSummaryLoading:w}}var $=r();function Ve(e){let t=(0,J.c)(36),{L:n,items:r,loading:i,onSelectItem:a}=e,[o,s]=(0,q.useState)(!1);if(!i&&r.length===0)return null;let c;t[0]===r?c=t[1]:(c=r.reduce(Ue,0),t[0]=r,t[1]=c);let l=c,u;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>s(He),t[2]=u):u=t[2];let d;t[3]===n.errorSummaryTitle?d=t[4]:(d=(0,$.jsx)(`h2`,{className:`text-sm font-semibold tracking-tight text-fg`,children:n.errorSummaryTitle}),t[3]=n.errorSummaryTitle,t[4]=d);let f;t[5]===n.errorSummaryHint?f=t[6]:(f=(0,$.jsx)(`p`,{className:`mt-0.5 text-xs leading-5 text-fg-muted`,children:n.errorSummaryHint}),t[5]=n.errorSummaryHint,t[6]=f);let p;t[7]!==d||t[8]!==f?(p=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[d,f]}),t[7]=d,t[8]=f,t[9]=p):p=t[9];let m;t[10]!==r.length||t[11]!==i||t[12]!==l?(m=i?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(A,{className:`h-5 w-8 rounded-md`}),(0,$.jsx)(A,{className:`h-5 w-10 rounded-md`})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`rounded-md bg-red-500/10 px-2 py-0.5 text-xs tabular-nums text-red-600 dark:text-red-400`,children:r.length}),(0,$.jsxs)(`span`,{className:`rounded-md bg-surface-hover px-2 py-0.5 text-xs tabular-nums text-fg-muted`,children:[`×`,l]})]}),t[10]=r.length,t[11]=i,t[12]=l,t[13]=m):m=t[13];let h=o&&`rotate-180`,_;t[14]===h?_=t[15]:(_=k(`size-4 text-fg-muted transition-transform duration-150 ease-out motion-reduce:transition-none`,h),t[14]=h,t[15]=_);let v;t[16]===_?v=t[17]:(v=(0,$.jsx)(g,{className:_,strokeWidth:1.75,"aria-hidden":!0}),t[16]=_,t[17]=v);let y;t[18]!==m||t[19]!==v?(y=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 pt-0.5`,children:[m,v]}),t[18]=m,t[19]=v,t[20]=y):y=t[20];let b;t[21]!==o||t[22]!==y||t[23]!==p?(b=(0,$.jsxs)(`button`,{type:`button`,onClick:u,"aria-expanded":o,className:`flex w-full items-start justify-between gap-3 px-4 py-4 text-left transition-colors hover:bg-surface-hover/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-inset sm:px-5`,children:[p,y]}),t[21]=o,t[22]=y,t[23]=p,t[24]=b):b=t[24];let x;t[25]!==n.module||t[26]!==n.phase||t[27]!==n.time||t[28]!==o||t[29]!==r||t[30]!==i||t[31]!==a?(x=o&&!i&&r.length>0?(0,$.jsx)(`ul`,{className:`mx-1 mb-1 flex flex-col gap-1 rounded-lg bg-surface-base/45 p-1 [&>li]:rounded-lg`,children:r.map(e=>(0,$.jsx)(`li`,{children:(0,$.jsxs)(`button`,{type:`button`,onClick:()=>a?.(e),className:k(`flex w-full flex-col gap-1 px-4 py-2.5 text-left transition-colors hover:bg-surface-hover`,a&&`cursor-pointer`),children:[(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,$.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium text-fg`,children:e.errName}),(0,$.jsxs)(`span`,{className:`shrink-0 rounded-md bg-red-500/10 px-2 py-0.5 text-xs tabular-nums text-red-600 dark:text-red-400`,children:[`×`,e.count]})]}),(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-x-3 gap-y-1 text-xs text-fg-muted`,children:[e.phase?(0,$.jsxs)(`span`,{children:[n.phase,`: `,e.phase]}):null,e.module?(0,$.jsxs)(`span`,{children:[n.module,`: `,e.module]}):null,(0,$.jsxs)(`span`,{children:[n.time,`: `,De(e.lastSeen)]})]}),(0,$.jsx)(`p`,{className:`truncate text-xs text-fg-subtle`,children:e.sampleMessage})]})},e.key))}):null,t[25]=n.module,t[26]=n.phase,t[27]=n.time,t[28]=o,t[29]=r,t[30]=i,t[31]=a,t[32]=x):x=t[32];let S;return t[33]!==b||t[34]!==x?(S=(0,$.jsxs)(`section`,{className:`overflow-hidden rounded-xl bg-surface-hover/20`,children:[b,x]}),t[33]=b,t[34]=x,t[35]=S):S=t[35],S}function He(e){return!e}function Ue(e,t){return e+t.count}function We(e){let t=(0,J.c)(75),{log:n,labels:r,onFilterByRequestId:i,onFilterByTranscriptId:a,onOpenChat:o}=e,s=n.level??`info`,c=typeof n.requestId==`string`?n.requestId:``,l=typeof n.conversationId==`string`?n.conversationId:``,u=typeof n.transcriptId==`string`?n.transcriptId:``,d;t[0]===n?d=t[1]:(d=Me(n),t[0]=n,t[1]=d);let f=d,p;t[2]===n?p=t[3]:(p=Pe(n),t[2]=n,t[3]=p);let m=p,h=s===`error`||s===`fatal`,g;t[4]===r.message?g=t[5]:(g=(0,$.jsx)(`span`,{className:`text-xs font-sans font-medium text-fg-muted`,children:r.message}),t[4]=r.message,t[5]=g);let _=h&&`border-red-500/40`,v;t[6]===_?v=t[7]:(v=k(`mt-2 whitespace-pre-wrap break-words border border-edge bg-surface-base p-3 text-xs leading-relaxed text-fg dark:border-edge`,_),t[6]=_,t[7]=v);let y=n.message||`—`,b;t[8]!==v||t[9]!==y?(b=(0,$.jsx)(`pre`,{className:v,children:y}),t[8]=v,t[9]=y,t[10]=b):b=t[10];let x;t[11]!==g||t[12]!==b?(x=(0,$.jsxs)(`div`,{children:[g,b]}),t[11]=g,t[12]=b,t[13]=x):x=t[13];let S;t[14]!==m||t[15]!==r.stackTrace?(S=m?.stack?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`span`,{className:`text-xs font-sans font-medium text-fg-muted`,children:r.stackTrace}),m.name?(0,$.jsx)(`p`,{className:`mt-1 text-xs text-red-600 dark:text-red-400`,children:m.name}):null,(0,$.jsx)(`pre`,{className:`mt-2 overflow-x-auto whitespace-pre-wrap break-words border border-red-500/30 bg-surface-base p-3 text-xs leading-relaxed text-fg dark:border-red-500/30`,children:m.stack})]}):null,t[14]=m,t[15]=r.stackTrace,t[16]=S):S=t[16];let C;t[17]===r.time?C=t[18]:(C=(0,$.jsx)(`span`,{className:`font-sans text-fg-muted`,children:r.time}),t[17]=r.time,t[18]=C);let w;t[19]===n.timestamp?w=t[20]:(w=(0,$.jsx)(`code`,{className:`break-all text-fg`,children:n.timestamp}),t[19]=n.timestamp,t[20]=w);let T;t[21]===r.level?T=t[22]:(T=(0,$.jsx)(`span`,{className:`font-sans text-fg-muted`,children:r.level}),t[21]=r.level,t[22]=T);let E=h&&`font-medium text-red-600 dark:text-red-400`,D;t[23]===E?D=t[24]:(D=k(`text-fg`,E),t[23]=E,t[24]=D);let O;t[25]===s?O=t[26]:(O=je(s),t[25]=s,t[26]=O);let A;t[27]!==D||t[28]!==O?(A=(0,$.jsx)(`span`,{className:D,children:O}),t[27]=D,t[28]=O,t[29]=A):A=t[29];let j;t[30]===r.module?j=t[31]:(j=(0,$.jsx)(`span`,{className:`font-sans text-fg-muted`,children:r.module}),t[30]=r.module,t[31]=j);let M;t[32]===n?M=t[33]:(M=Te(n),t[32]=n,t[33]=M);let P;t[34]===M?P=t[35]:(P=(0,$.jsx)(`code`,{className:`break-all text-fg`,children:M}),t[34]=M,t[35]=P);let F;t[36]!==r.phase||t[37]!==f?(F=f===`—`?null:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`font-sans text-fg-muted`,children:r.phase}),(0,$.jsx)(`code`,{className:`break-all text-fg`,children:f})]}),t[36]=r.phase,t[37]=f,t[38]=F):F=t[38];let I;t[39]!==r.filterByRequestId||t[40]!==r.requestId||t[41]!==i||t[42]!==c?(I=c?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`font-sans text-fg-muted`,children:r.requestId}),(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,$.jsx)(`code`,{className:`break-all text-fg`,children:c}),i?(0,$.jsx)(N,{type:`button`,variant:`secondary`,className:`h-7 px-2 text-[11px]`,onClick:()=>i(c),children:r.filterByRequestId}):null]})]}):null,t[39]=r.filterByRequestId,t[40]=r.requestId,t[41]=i,t[42]=c,t[43]=I):I=t[43];let L;t[44]!==r.conversationId||t[45]!==r.openChat||t[46]!==o||t[47]!==l?(L=l?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`font-sans text-fg-muted`,children:r.conversationId}),(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,$.jsx)(`code`,{className:`break-all text-fg`,children:l}),o?(0,$.jsx)(N,{type:`button`,variant:`secondary`,className:`h-7 px-2 text-[11px]`,onClick:()=>o({conversationId:l}),children:r.openChat}):null]})]}):null,t[44]=r.conversationId,t[45]=r.openChat,t[46]=o,t[47]=l,t[48]=L):L=t[48];let R;t[49]!==r.filterByTranscriptId||t[50]!==r.openChat||t[51]!==r.transcriptId||t[52]!==a||t[53]!==o||t[54]!==u?(R=u?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`font-sans text-fg-muted`,children:r.transcriptId}),(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,$.jsx)(`code`,{className:`break-all text-fg`,children:u}),a?(0,$.jsx)(N,{type:`button`,variant:`secondary`,className:`h-7 px-2 text-[11px]`,onClick:()=>a(u),children:r.filterByTranscriptId}):null,o?(0,$.jsx)(N,{type:`button`,variant:`secondary`,className:`h-7 px-2 text-[11px]`,onClick:()=>o({transcriptId:u}),children:r.openChat}):null]})]}):null,t[49]=r.filterByTranscriptId,t[50]=r.openChat,t[51]=r.transcriptId,t[52]=a,t[53]=o,t[54]=u,t[55]=R):R=t[55];let z;t[56]!==C||t[57]!==w||t[58]!==T||t[59]!==A||t[60]!==j||t[61]!==P||t[62]!==F||t[63]!==I||t[64]!==L||t[65]!==R?(z=(0,$.jsxs)(`div`,{className:`grid grid-cols-[5.5rem_1fr] gap-x-3 gap-y-2 text-xs`,children:[C,w,T,A,j,P,F,I,L,R]}),t[56]=C,t[57]=w,t[58]=T,t[59]=A,t[60]=j,t[61]=P,t[62]=F,t[63]=I,t[64]=L,t[65]=R,t[66]=z):z=t[66];let B;t[67]!==r.metadata||t[68]!==n.meta?(B=n.meta&&Object.keys(n.meta).length>0?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`span`,{className:`text-xs font-sans font-medium text-fg-muted`,children:r.metadata}),(0,$.jsx)(`pre`,{className:`mt-2 overflow-x-auto whitespace-pre-wrap break-words border border-edge bg-surface-base p-3 text-xs leading-relaxed text-fg dark:border-edge`,children:JSON.stringify(n.meta,null,2)})]}):null,t[67]=r.metadata,t[68]=n.meta,t[69]=B):B=t[69];let V;return t[70]!==z||t[71]!==B||t[72]!==x||t[73]!==S?(V=(0,$.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[x,S,z,B]}),t[70]=z,t[71]=B,t[72]=x,t[73]=S,t[74]=V):V=t[74],V}function Ge(e){let t=(0,J.c)(50),{L:n,log:r,onClose:i,copiedDetail:a,onCopiedMessage:o,onCopiedJson:s,onFilterByRequestId:c,onFilterByTranscriptId:l,onOpenChat:g}=e,_=r!==null,v;t[0]===i?v=t[1]:(v=e=>!e&&i(),t[0]=i,t[1]=v);let b;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,$.jsx)(u,{className:k(`xopc-dialog-overlay fixed inset-0 bg-scrim`,z)}),t[2]=b):b=t[2];let x;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(x=k(`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`,R,`dark:border-edge`),t[3]=x):x=t[3];let S;t[4]===n.details?S=t[5]:(S=(0,$.jsx)(m,{className:`text-base font-semibold tracking-tight text-fg`,children:n.details}),t[4]=n.details,t[5]=S);let C;t[6]!==n.copied||t[7]!==n.copyJson||t[8]!==n.copyMessage||t[9]!==a||t[10]!==r||t[11]!==s||t[12]!==o?(C=r?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(N,{type:`button`,variant:`ghost`,className:`h-9 shrink-0 gap-1 px-2 text-xs`,onClick:()=>{V(typeof r.message==`string`?r.message:``).then(e=>{e&&o()})},children:[(0,$.jsx)(y,{className:`size-3.5 shrink-0`,strokeWidth:1.75}),(0,$.jsx)(`span`,{className:`hidden sm:inline`,children:a===`message`?n.copied:n.copyMessage})]}),(0,$.jsxs)(N,{type:`button`,variant:`ghost`,className:`h-9 shrink-0 gap-1 px-2 text-xs`,onClick:()=>{V(JSON.stringify(r,null,2)).then(e=>{e&&s()})},children:[(0,$.jsx)(y,{className:`size-3.5 shrink-0`,strokeWidth:1.75}),(0,$.jsx)(`span`,{className:`hidden sm:inline`,children:a===`json`?n.copied:n.copyJson})]})]}):null,t[6]=n.copied,t[7]=n.copyJson,t[8]=n.copyMessage,t[9]=a,t[10]=r,t[11]=s,t[12]=o,t[13]=C):C=t[13];let w;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,$.jsx)(O,{className:`size-5`,strokeWidth:1.75}),t[14]=w):w=t[14];let T;t[15]===n.close?T=t[16]:(T=(0,$.jsx)(d,{asChild:!0,children:(0,$.jsx)(N,{type:`button`,variant:`ghost`,className:`size-9 shrink-0 p-0`,"aria-label":n.close,children:w})}),t[15]=n.close,t[16]=T);let E;t[17]!==C||t[18]!==T?(E=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[C,T]}),t[17]=C,t[18]=T,t[19]=E):E=t[19];let D;t[20]!==S||t[21]!==E?(D=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3 dark:border-edge`,children:[S,E]}),t[20]=S,t[21]=E,t[22]=D):D=t[22];let A;t[23]!==n.conversationId||t[24]!==n.filterByRequestId||t[25]!==n.filterByTranscriptId||t[26]!==n.level||t[27]!==n.message||t[28]!==n.metadata||t[29]!==n.module||t[30]!==n.openChat||t[31]!==n.phase||t[32]!==n.requestId||t[33]!==n.stackTrace||t[34]!==n.time||t[35]!==n.transcriptId||t[36]!==r||t[37]!==c||t[38]!==l||t[39]!==g?(A=r?(0,$.jsx)(We,{log:r,labels:{time:n.time,level:n.level,module:n.module,message:n.message,metadata:n.metadata,requestId:n.requestId,conversationId:n.conversationId,transcriptId:n.transcriptId,phase:n.phase,stackTrace:n.stackTrace,filterByRequestId:n.filterByRequestId,filterByTranscriptId:n.filterByTranscriptId,openChat:n.openChat},onFilterByRequestId:c,onFilterByTranscriptId:l,onOpenChat:g}):null,t[23]=n.conversationId,t[24]=n.filterByRequestId,t[25]=n.filterByTranscriptId,t[26]=n.level,t[27]=n.message,t[28]=n.metadata,t[29]=n.module,t[30]=n.openChat,t[31]=n.phase,t[32]=n.requestId,t[33]=n.stackTrace,t[34]=n.time,t[35]=n.transcriptId,t[36]=r,t[37]=c,t[38]=l,t[39]=g,t[40]=A):A=t[40];let j;t[41]===A?j=t[42]:(j=(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-4 font-mono text-sm leading-relaxed`,children:A}),t[41]=A,t[42]=j);let M;t[43]!==D||t[44]!==j?(M=(0,$.jsxs)(f,{children:[b,(0,$.jsxs)(p,{className:x,"aria-describedby":void 0,children:[D,j]})]}),t[43]=D,t[44]=j,t[45]=M):M=t[45];let P;return t[46]!==_||t[47]!==M||t[48]!==v?(P=(0,$.jsx)(h,{open:_,onOpenChange:v,children:M}),t[46]=_,t[47]=M,t[48]=v,t[49]=P):P=t[49],P}function Ke(e){let t=(0,J.c)(25),{L:n,open:r,onOpenChange:i,files:a,logDir:o}=e,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(u,{className:k(`xopc-dialog-overlay fixed inset-0 bg-scrim`,z)}),t[0]=s):s=t[0];let c;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(c=k(`xopc-dialog-content fixed left-1/2 top-1/2 flex max-h-[min(32rem,85vh)] w-[min(100%-2rem,24rem)] -translate-x-1/2 -translate-y-1/2 flex-col rounded-xl border border-edge bg-surface-overlay shadow-popover outline-none`,R,`dark:border-edge`),t[1]=c):c=t[1];let l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,$.jsx)(S,{className:`size-4 text-fg-muted`,strokeWidth:1.75}),t[2]=l):l=t[2];let g;t[3]===n.logFiles?g=t[4]:(g=(0,$.jsxs)(m,{className:`flex items-center gap-2 text-base font-semibold tracking-tight text-fg`,children:[l,n.logFiles]}),t[3]=n.logFiles,t[4]=g);let _;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,$.jsx)(O,{className:`size-5`,strokeWidth:1.75}),t[5]=_):_=t[5];let v;t[6]===n.close?v=t[7]:(v=(0,$.jsx)(d,{asChild:!0,children:(0,$.jsx)(N,{type:`button`,variant:`ghost`,className:`size-9 shrink-0 p-0`,"aria-label":n.close,children:_})}),t[6]=n.close,t[7]=v);let y;t[8]!==g||t[9]!==v?(y=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3 dark:border-edge`,children:[g,v]}),t[8]=g,t[9]=v,t[10]=y):y=t[10];let b;t[11]!==n.filesEmpty||t[12]!==a?(b=(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-3`,children:a.length===0?(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n.filesEmpty}):(0,$.jsx)(`ul`,{className:`flex flex-col gap-2`,children:a.map(qe)})}),t[11]=n.filesEmpty,t[12]=a,t[13]=b):b=t[13];let x;t[14]!==n.logDir||t[15]!==o?(x=o?(0,$.jsxs)(`div`,{className:`shrink-0 border-t border-edge-subtle px-4 py-2 text-xs text-fg-subtle dark:border-edge`,children:[(0,$.jsxs)(`span`,{className:`font-medium text-fg-muted`,children:[n.logDir,`: `]}),(0,$.jsx)(`code`,{className:`break-all text-fg-subtle`,children:o})]}):null,t[14]=n.logDir,t[15]=o,t[16]=x):x=t[16];let C;t[17]!==y||t[18]!==b||t[19]!==x?(C=(0,$.jsxs)(f,{children:[s,(0,$.jsxs)(p,{className:c,children:[y,b,x]})]}),t[17]=y,t[18]=b,t[19]=x,t[20]=C):C=t[20];let w;return t[21]!==i||t[22]!==r||t[23]!==C?(w=(0,$.jsx)(h,{open:r,onOpenChange:i,children:C}),t[21]=i,t[22]=r,t[23]=C,t[24]=w):w=t[24],w}function qe(e){return(0,$.jsxs)(`li`,{className:`flex flex-col gap-1 rounded-lg border border-edge-subtle bg-surface-base px-3 py-2 dark:border-edge`,children:[(0,$.jsx)(`span`,{className:`break-all font-mono text-xs text-fg`,children:e.name}),(0,$.jsxs)(`span`,{className:`flex flex-wrap gap-x-2 text-xs text-fg-subtle`,children:[(0,$.jsx)(`span`,{children:ke(e.size)}),(0,$.jsx)(`span`,{children:Oe(e.modified)})]})]},e.name)}function Je(e){let t=(0,J.c)(56),{L:n,open:r,onOpenChange:i,dateFrom:a,onDateFromChange:o,dateTo:s,onDateToChange:c,selectedLevels:l,onToggleLevel:g}=e,_;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,$.jsx)(u,{className:k(`xopc-dialog-overlay fixed inset-0 bg-scrim`,z)}),t[0]=_):_=t[0];let v;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(v=k(`xopc-dialog-content fixed left-1/2 top-1/2 flex max-h-[min(32rem,90vh)] w-[min(100%-2rem,22rem)] -translate-x-1/2 -translate-y-1/2 flex-col rounded-xl border border-edge bg-surface-overlay shadow-popover outline-none`,R,`dark:border-edge`),t[1]=v):v=t[1];let y;t[2]===n.filtersDialogTitle?y=t[3]:(y=(0,$.jsx)(m,{className:`text-base font-semibold tracking-tight text-fg`,children:n.filtersDialogTitle}),t[2]=n.filtersDialogTitle,t[3]=y);let b;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,$.jsx)(O,{className:`size-5`,strokeWidth:1.75}),t[4]=b):b=t[4];let x;t[5]===n.close?x=t[6]:(x=(0,$.jsx)(d,{asChild:!0,children:(0,$.jsx)(N,{type:`button`,variant:`ghost`,className:`size-9 shrink-0 p-0`,"aria-label":n.close,children:b})}),t[5]=n.close,t[6]=x);let S;t[7]!==y||t[8]!==x?(S=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3 dark:border-edge`,children:[y,x]}),t[7]=y,t[8]=x,t[9]=S):S=t[9];let C;t[10]===n.filtersDialogDesc?C=t[11]:(C=(0,$.jsx)(`div`,{id:`log-filters-desc`,className:`sr-only`,children:n.filtersDialogDesc}),t[10]=n.filtersDialogDesc,t[11]=C);let w;t[12]===n.timeRange?w=t[13]:(w=(0,$.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,children:n.timeRange}),t[12]=n.timeRange,t[13]=w);let T;t[14]!==n.from||t[15]!==a||t[16]!==o?(T=(0,$.jsx)(K,{label:n.from,value:a,defaultTime:`00:00`,onChange:o,className:`text-xs text-fg-muted`}),t[14]=n.from,t[15]=a,t[16]=o,t[17]=T):T=t[17];let E;t[18]!==n.to||t[19]!==s||t[20]!==c?(E=(0,$.jsx)(K,{label:n.to,value:s,defaultTime:`23:59`,onChange:c,className:`text-xs text-fg-muted`}),t[18]=n.to,t[19]=s,t[20]=c,t[21]=E):E=t[21];let D;t[22]!==E||t[23]!==T?(D=(0,$.jsxs)(`div`,{className:`mt-2 flex flex-col gap-3`,children:[T,E]}),t[22]=E,t[23]=T,t[24]=D):D=t[24];let A;t[25]===n.levelCustom?A=t[26]:(A=(0,$.jsx)(`p`,{className:`mt-6 text-xs font-medium text-fg-muted`,children:n.levelCustom}),t[25]=n.levelCustom,t[26]=A);let j;t[27]===n.levelCustomHint?j=t[28]:(j=(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-subtle`,children:n.levelCustomHint}),t[27]=n.levelCustomHint,t[28]=j);let M=n.level,P;t[29]!==n.levelNames||t[30]!==g||t[31]!==l?(P=Q.map(e=>(0,$.jsx)(`button`,{type:`button`,className:k(`rounded-full border px-3 py-1.5 text-xs font-medium capitalize transition-[color,background-color,border-color] duration-150 ease-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`,l.has(e)?`border-edge bg-surface-active text-fg dark:border-edge`:`border-edge-subtle bg-surface-base text-fg-muted hover:bg-surface-hover dark:border-edge`),onClick:()=>g(e),children:n.levelNames[e]},e)),t[29]=n.levelNames,t[30]=g,t[31]=l,t[32]=P):P=t[32];let F;t[33]!==n.level||t[34]!==P?(F=(0,$.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2`,role:`group`,"aria-label":M,children:P}),t[33]=n.level,t[34]=P,t[35]=F):F=t[35];let I;t[36]!==D||t[37]!==A||t[38]!==j||t[39]!==F||t[40]!==w?(I=(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-4`,children:[w,D,A,j,F]}),t[36]=D,t[37]=A,t[38]=j,t[39]=F,t[40]=w,t[41]=I):I=t[41];let L;t[42]===i?L=t[43]:(L=()=>i(!1),t[42]=i,t[43]=L);let B;t[44]!==n.filtersDone||t[45]!==L?(B=(0,$.jsx)(`div`,{className:`shrink-0 border-t border-edge-subtle px-4 py-3 dark:border-edge`,children:(0,$.jsx)(N,{type:`button`,className:`w-full rounded-xl`,onClick:L,children:n.filtersDone})}),t[44]=n.filtersDone,t[45]=L,t[46]=B):B=t[46];let V;t[47]!==I||t[48]!==B||t[49]!==S||t[50]!==C?(V=(0,$.jsxs)(f,{children:[_,(0,$.jsxs)(p,{className:v,"aria-describedby":`log-filters-desc`,children:[S,C,I,B]})]}),t[47]=I,t[48]=B,t[49]=S,t[50]=C,t[51]=V):V=t[51];let ee;return t[52]!==i||t[53]!==r||t[54]!==V?(ee=(0,$.jsx)(h,{open:r,onOpenChange:i,children:V}),t[52]=i,t[53]=r,t[54]=V,t[55]=ee):ee=t[55],ee}var Ye=`touch-target relative z-[2] box-border flex h-6 flex-1 cursor-pointer items-center justify-center gap-1 rounded-pill border-0 bg-transparent px-2 py-0 text-center text-xs font-medium leading-none outline-none transition-[color,background-color,box-shadow] duration-150 ease-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel active:scale-100 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`;function Xe(e){let t=(0,J.c)(18),{value:n,onChange:r,options:i,"aria-label":a,className:o,buttonClassName:s}=e,c=(0,q.useRef)(null),l=H(c,`button`,`button[aria-pressed="true"]`,1),u;t[0]===o?u=t[1]:(u=k(G,`relative isolate flex w-full max-w-full flex-row items-center`,o),t[0]=o,t[1]=u);let d;t[2]===l?d=t[3]:(d=(0,$.jsx)(U,{bounds:l,className:`rounded-pill bg-surface-panel shadow-sm dark:ring-1 dark:ring-edge-strong/40`}),t[2]=l,t[3]=d);let f;if(t[4]!==s||t[5]!==r||t[6]!==i||t[7]!==n){let e;t[9]!==s||t[10]!==r||t[11]!==n?(e=e=>{let t=e.icon,i=n===e.value;return(0,$.jsxs)(`button`,{type:`button`,"aria-pressed":i,title:e.title??e.label,onClick:()=>r(e.value),className:k(Ye,i?`text-fg`:`text-fg-subtle`,s),children:[t?(0,$.jsx)(t,{className:`block size-3 shrink-0 opacity-80`,strokeWidth:1.75,"aria-hidden":!0}):null,(0,$.jsx)(`span`,{className:`min-w-0 shrink truncate leading-none`,children:e.label})]},e.value)},t[9]=s,t[10]=r,t[11]=n,t[12]=e):e=t[12],f=i.map(e),t[4]=s,t[5]=r,t[6]=i,t[7]=n,t[8]=f}else f=t[8];let p;return t[13]!==a||t[14]!==u||t[15]!==d||t[16]!==f?(p=(0,$.jsxs)(`div`,{ref:c,className:u,role:`group`,"aria-label":a,children:[d,f]}),t[13]=a,t[14]=u,t[15]=d,t[16]=f,t[17]=p):p=t[17],p}function Ze(e){let t=(0,J.c)(76),{L:n,levelSegment:r,onLevelSegment:i,searchInput:a,onSearchInputChange:o,moduleFilter:s,onModuleFilterChange:c,modules:l,onOpenFilters:u,activeFilterCount:d,hasActiveFilters:f,onClearFilters:p,autoRefresh:m}=e,h=n.filters,g;t[0]===n.presetAll?g=t[1]:(g={value:`all`,label:n.presetAll},t[0]=n.presetAll,t[1]=g);let y;t[2]===n.presetErrors?y=t[3]:(y={value:`errors`,label:n.presetErrors},t[2]=n.presetErrors,t[3]=y);let b;t[4]===n.presetWarnPlus?b=t[5]:(b={value:`warnPlus`,label:n.presetWarnPlus},t[4]=n.presetWarnPlus,t[5]=b);let x;t[6]===n.presetInfoPlus?x=t[7]:(x={value:`infoPlus`,label:n.presetInfoPlus},t[6]=n.presetInfoPlus,t[7]=x);let S;t[8]===n.presetVerbose?S=t[9]:(S={value:`verbose`,label:n.presetVerbose},t[8]=n.presetVerbose,t[9]=S);let C;t[10]===n.presetOther?C=t[11]:(C={value:`other`,label:n.presetOther},t[10]=n.presetOther,t[11]=C);let T;t[12]!==g||t[13]!==y||t[14]!==b||t[15]!==x||t[16]!==S||t[17]!==C?(T=[g,y,b,x,S,C],t[12]=g,t[13]=y,t[14]=b,t[15]=x,t[16]=S,t[17]=C,t[18]=T):T=t[18];let D;t[19]!==n.levelPresetAria||t[20]!==r||t[21]!==i||t[22]!==T?(D=(0,$.jsx)(`div`,{className:`overflow-x-auto pb-1 [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden`,children:(0,$.jsx)(`div`,{className:`min-w-[min(100%,36rem)]`,children:(0,$.jsx)(Xe,{"aria-label":n.levelPresetAria,value:r,onChange:i,options:T,buttonClassName:`h-8 px-1.5 text-[11px] sm:px-2 sm:text-xs`})})}),t[19]=n.levelPresetAria,t[20]=r,t[21]=i,t[22]=T,t[23]=D):D=t[23];let A;t[24]===n.searchPlaceholder?A=t[25]:(A=(0,$.jsx)(`span`,{className:`sr-only`,children:n.searchPlaceholder}),t[24]=n.searchPlaceholder,t[25]=A);let j;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,$.jsx)(E,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`,strokeWidth:1.75,"aria-hidden":!0}),t[26]=j):j=t[26];let M;t[27]===o?M=t[28]:(M=e=>o(e.target.value),t[27]=o,t[28]=M);let P=n.searchPlaceholder,F;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(F=k(`h-10 w-full rounded-md border border-edge bg-surface-panel py-0 pl-10 pr-3 text-sm leading-5 text-fg placeholder:text-fg-subtle dark:border-edge`,te),t[29]=F):F=t[29];let I;t[30]!==n.searchPlaceholder||t[31]!==a||t[32]!==M?(I=(0,$.jsx)(`input`,{type:`search`,value:a,onChange:M,placeholder:P,autoComplete:`off`,spellCheck:!1,className:F}),t[30]=n.searchPlaceholder,t[31]=a,t[32]=M,t[33]=I):I=t[33];let L;t[34]!==A||t[35]!==I?(L=(0,$.jsxs)(`label`,{className:`relative min-w-0 flex-1 sm:min-w-[12rem]`,children:[A,j,I]}),t[34]=A,t[35]=I,t[36]=L):L=t[36];let R;t[37]===c?R=t[38]:(R=e=>c(e.target.value),t[37]=c,t[38]=R);let z=n.module,B=n.module,V;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(V=k(ee,`h-10 w-full min-w-0 rounded-md py-0`),t[39]=V):V=t[39];let H;t[40]===n.allModules?H=t[41]:(H=(0,$.jsx)(v,{value:``,children:n.allModules}),t[40]=n.allModules,t[41]=H);let U;t[42]===l?U=t[43]:(U=l.map(Qe),t[42]=l,t[43]=U);let W;t[44]!==n.module||t[45]!==s||t[46]!==R||t[47]!==H||t[48]!==U?(W=(0,$.jsxs)(_,{id:`log-module`,value:s,onChange:R,"aria-label":z,title:B,className:V,children:[H,U]}),t[44]=n.module,t[45]=s,t[46]=R,t[47]=H,t[48]=U,t[49]=W):W=t[49];let G;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,$.jsx)(w,{className:`size-4`,strokeWidth:1.75}),t[50]=G):G=t[50];let ne;t[51]===d?ne=t[52]:(ne=d>0?(0,$.jsx)(`span`,{className:`rounded-md bg-surface-hover px-1.5 text-xs tabular-nums text-fg-muted`,children:d}):null,t[51]=d,t[52]=ne);let K;t[53]!==n.filtersMore||t[54]!==u||t[55]!==ne?(K=(0,$.jsxs)(N,{type:`button`,variant:`secondary`,className:`h-10 min-h-[44px] gap-2 rounded-md sm:min-h-10`,onClick:u,children:[G,n.filtersMore,ne]}),t[53]=n.filtersMore,t[54]=u,t[55]=ne,t[56]=K):K=t[56];let q;t[57]!==n.clear||t[58]!==f||t[59]!==p?(q=f?(0,$.jsxs)(N,{type:`button`,variant:`ghost`,className:`h-10 min-h-[44px] gap-1 sm:min-h-10`,onClick:p,children:[(0,$.jsx)(O,{className:`size-4`,strokeWidth:1.75}),n.clear]}):null,t[57]=n.clear,t[58]=f,t[59]=p,t[60]=q):q=t[60];let Y;t[61]!==K||t[62]!==q?(Y=(0,$.jsxs)(`div`,{className:`flex min-w-0 shrink-0 items-center justify-end gap-2`,children:[K,q]}),t[61]=K,t[62]=q,t[63]=Y):Y=t[63];let X;t[64]!==L||t[65]!==W||t[66]!==Y?(X=(0,$.jsxs)(`div`,{className:`grid gap-2 lg:grid-cols-[minmax(16rem,1fr)_minmax(12rem,16rem)_auto] lg:items-center`,children:[L,W,Y]}),t[64]=L,t[65]=W,t[66]=Y,t[67]=X):X=t[67];let Z;t[68]!==n.liveHint||t[69]!==m?(Z=m?(0,$.jsx)(`p`,{className:`text-xs leading-5 text-fg-subtle`,children:n.liveHint}):null,t[68]=n.liveHint,t[69]=m,t[70]=Z):Z=t[70];let re;return t[71]!==n.filters||t[72]!==X||t[73]!==Z||t[74]!==D?(re=(0,$.jsxs)(`section`,{className:`flex flex-col gap-4 rounded-xl bg-surface-hover/20 p-4 sm:p-5`,"aria-label":h,children:[D,X,Z]}),t[71]=n.filters,t[72]=X,t[73]=Z,t[74]=D,t[75]=re):re=t[75],re}function Qe(e){return(0,$.jsx)(v,{value:e,children:e},e)}function $e(e){let t=(0,J.c)(20),{L:n,logs:r,loading:i,hasMore:a,onSelectLog:o,onLoadMore:s,onRefreshAll:c,onFilterByRequestId:l}=e,u;t[0]!==i||t[1]!==r.length?(u=i&&r.length===0?(0,$.jsx)(`div`,{className:`overflow-hidden rounded-xl bg-surface-hover/20`,"aria-busy":`true`,children:Array.from({length:8}).map(et)}):null,t[0]=i,t[1]=r.length,t[2]=u):u=t[2];let d;t[3]!==n||t[4]!==i||t[5]!==r.length||t[6]!==c?(d=!i&&r.length===0?(0,$.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 rounded-xl bg-surface-hover/20 py-16 text-center`,children:[(0,$.jsx)(x,{className:`size-12 text-fg-subtle`,strokeWidth:1.5,"aria-hidden":!0}),(0,$.jsx)(`h2`,{className:`text-base font-semibold tracking-tight text-fg`,children:n.noLogs}),(0,$.jsx)(`p`,{className:`max-w-sm text-sm leading-relaxed text-fg-muted`,children:n.noLogsDescription}),(0,$.jsxs)(N,{type:`button`,variant:`secondary`,className:`mt-4 gap-2`,onClick:c,children:[(0,$.jsx)(T,{className:`size-4`,strokeWidth:1.75}),n.refresh]})]}):null,t[3]=n,t[4]=i,t[5]=r.length,t[6]=c,t[7]=d):d=t[7];let f;t[8]!==n||t[9]!==a||t[10]!==i||t[11]!==r||t[12]!==l||t[13]!==s||t[14]!==o?(f=r.length>0?(0,$.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,$.jsxs)(`p`,{className:`text-xs leading-5 text-fg-muted`,children:[we(n.showingCount,{count:String(r.length)}),a?(0,$.jsxs)(`span`,{className:`text-fg-subtle`,children:[` · `,n.moreAvailable]}):null]}),(0,$.jsxs)(`div`,{className:`overflow-hidden rounded-xl bg-surface-hover/20 p-1 text-sm leading-6`,children:[(0,$.jsxs)(`div`,{className:`hidden items-center gap-3 px-3 py-2 text-xs font-medium text-fg-subtle md:flex`,"aria-hidden":!0,children:[(0,$.jsx)(`span`,{className:`w-[5.25rem] shrink-0`,children:n.time}),(0,$.jsx)(`span`,{className:`w-[4.5rem] shrink-0`,children:n.level}),(0,$.jsx)(`span`,{className:`w-[4.5rem] shrink-0 sm:w-[5.25rem]`,children:n.requestId}),(0,$.jsx)(`span`,{className:`hidden max-w-[6rem] shrink-0 xl:block`,children:n.phase}),(0,$.jsx)(`span`,{className:`hidden max-w-[7rem] shrink-0 lg:block`,children:n.module}),(0,$.jsx)(`span`,{className:`min-w-0 flex-1`,children:n.message})]}),(0,$.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:r.map(e=>{let t=e.level??`info`,r=typeof e.requestId==`string`?e.requestId.trim():``,i=Me(e),a=t===`error`||t===`fatal`;return(0,$.jsx)(`li`,{className:`rounded-lg bg-surface-base/45`,children:(0,$.jsxs)(`button`,{type:`button`,onClick:()=>o(e),className:k(`flex w-full min-w-0 items-center gap-3 px-3 py-2.5 text-left transition-colors duration-150 ease-out`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`,a&&`bg-red-500/5`),children:[(0,$.jsx)(`span`,{className:`w-[4.75rem] shrink-0 font-mono text-xs tabular-nums text-fg-subtle sm:w-[5.25rem] sm:text-sm`,children:De(e.timestamp)}),(0,$.jsx)(`span`,{className:k(`w-[4.5rem] shrink-0 truncate`,a?`font-medium text-red-600 dark:text-red-400`:`text-fg-muted`),title:t,children:je(t)}),(0,$.jsx)(`span`,{className:`hidden w-[4.5rem] shrink-0 truncate font-mono sm:block sm:w-[5.25rem]`,children:r?l?(0,$.jsx)(`span`,{role:`link`,tabIndex:0,className:`cursor-pointer text-accent hover:underline`,title:`${n.requestId}: ${r}`,onClick:e=>{e.stopPropagation(),l(r)},onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),l(r))},children:Ae(r)}):(0,$.jsx)(`span`,{className:`text-fg-subtle`,title:`${n.requestId}: ${r}`,children:Ae(r)}):(0,$.jsx)(`span`,{className:`text-fg-subtle`,children:`—`})}),(0,$.jsx)(`span`,{className:`hidden max-w-[6rem] shrink-0 truncate text-fg-subtle xl:inline`,title:i===`—`?void 0:i,children:i===`—`?`—`:i}),(0,$.jsx)(`span`,{className:`hidden max-w-[7rem] shrink-0 truncate text-fg-muted lg:inline`,title:Te(e),children:Te(e)}),(0,$.jsx)(`span`,{className:k(`min-w-0 flex-1 truncate`,`text-fg`),children:Ee(e)})]})},Ne(e))})})]}),a?(0,$.jsx)(`div`,{className:`flex justify-center pt-1`,children:(0,$.jsxs)(N,{type:`button`,variant:`secondary`,className:`gap-2`,disabled:i,onClick:s,children:[i?(0,$.jsx)(T,{className:`size-4 animate-spin motion-reduce:animate-none`,strokeWidth:1.75}):(0,$.jsx)(g,{className:`size-4`,strokeWidth:1.75}),n.loadMore]})}):null]}):null,t[8]=n,t[9]=a,t[10]=i,t[11]=r,t[12]=l,t[13]=s,t[14]=o,t[15]=f):f=t[15];let p;return t[16]!==u||t[17]!==d||t[18]!==f?(p=(0,$.jsxs)($.Fragment,{children:[u,d,f]}),t[16]=u,t[17]=d,t[18]=f,t[19]=p):p=t[19],p}function et(e,t){return(0,$.jsxs)(`div`,{className:`flex gap-3 px-3 py-2.5`,children:[(0,$.jsx)(`div`,{className:`h-4 w-16 shrink-0 bg-surface-hover motion-reduce:animate-none animate-pulse`}),(0,$.jsx)(`div`,{className:`h-4 w-12 shrink-0 bg-surface-hover motion-reduce:animate-none animate-pulse`}),(0,$.jsx)(`div`,{className:`h-4 w-20 shrink-0 bg-surface-hover motion-reduce:animate-none animate-pulse`}),(0,$.jsx)(`div`,{className:`h-4 min-w-0 flex-1 bg-surface-hover motion-reduce:animate-none animate-pulse`})]},t)}function tt(e){let t=(0,J.c)(8),{L:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(D,{className:`mt-0.5 size-5 shrink-0 text-fg-subtle`,strokeWidth:1.75,"aria-hidden":!0}),t[0]=r):r=t[0];let i;t[1]===n.title?i=t[2]:(i=(0,$.jsx)(`h1`,{className:`text-base font-semibold tracking-tight text-fg`,children:n.title}),t[1]=n.title,t[2]=i);let a;t[3]===n.needToken?a=t[4]:(a=(0,$.jsx)(`p`,{className:`mt-1 text-sm leading-relaxed text-fg-muted`,children:n.needToken}),t[3]=n.needToken,t[4]=a);let o;return t[5]!==i||t[6]!==a?(o=(0,$.jsx)(`div`,{className:`flex w-full flex-col gap-3 px-3 py-10 sm:px-5 xl:px-6`,children:(0,$.jsxs)(`div`,{className:`flex items-start gap-3 rounded-2xl bg-surface-base p-6`,children:[r,(0,$.jsxs)(`div`,{children:[i,a]})]})}),t[5]=i,t[6]=a,t[7]=o):o=t[7],o}function nt(e){return/[",\n\r]/.test(e)?`"${e.replace(/"/g,`""`)}"`:e}function rt(e){let t=[`timestamp`,`level`,`module`,`phase`,`requestId`,`transcriptId`,`message`],n=e.map(e=>{let t=String(e.module||``),n=String(e.phase??e.meta?.phase??``);return[e.timestamp,e.level,t,n,e.requestId??``,e.transcriptId??``,e.message??``].map(e=>nt(String(e))).join(`,`)});return[t.join(`,`),...n].join(`
|
|
2
|
-
`)}function it(e,t,n){let r=new Blob([e],{type:n}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=t,a.click(),URL.revokeObjectURL(i)}function at(e,t){let n=new Date().toISOString().replace(/[:.]/g,`-`);if(t===`json`){it(JSON.stringify(e,null,2),`xopc-logs-${n}.json`,`application/json`);return}it(rt(e),`xopc-logs-${n}.csv`,`text/csv;charset=utf-8`)}function ot(e){let t=(0,J.c)(32),{L:n,logs:r,disabled:i}=e,a=i||r.length===0,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(b,{className:`size-4`,strokeWidth:1.75}),t[0]=o):o=t[0];let s;t[1]===n.exportLogs?s=t[2]:(s=(0,$.jsx)(`span`,{className:`hidden sm:inline`,children:n.exportLogs}),t[1]=n.exportLogs,t[2]=s);let c;t[3]!==n.exportLogs||t[4]!==a||t[5]!==s?(c=(0,$.jsx)(L,{asChild:!0,children:(0,$.jsxs)(N,{type:`button`,variant:`secondary`,className:`h-9 gap-2 whitespace-nowrap px-3 text-xs`,disabled:a,title:n.exportLogs,children:[o,s]})}),t[3]=n.exportLogs,t[4]=a,t[5]=s,t[6]=c):c=t[6];let l;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(l=k(`w-52 rounded-xl border border-edge bg-surface-overlay p-2 shadow-popover outline-none`,B,`dark:border-edge`),t[7]=l):l=t[7];let u;t[8]===n.exportLogs?u=t[9]:(u=(0,$.jsx)(`p`,{className:`px-2 py-1 text-xs font-medium text-fg`,children:n.exportLogs}),t[8]=n.exportLogs,t[9]=u);let d;t[10]===n.exportHint?d=t[11]:(d=(0,$.jsx)(`p`,{className:`px-2 pb-2 text-xs leading-5 text-fg-muted`,children:n.exportHint}),t[10]=n.exportHint,t[11]=d);let f;t[12]===r?f=t[13]:(f=()=>at(r,`json`),t[12]=r,t[13]=f);let p;t[14]!==n.exportJson||t[15]!==f?(p=(0,$.jsx)(N,{type:`button`,variant:`ghost`,className:`h-8 justify-start px-2 text-xs`,onClick:f,children:n.exportJson}),t[14]=n.exportJson,t[15]=f,t[16]=p):p=t[16];let m;t[17]===r?m=t[18]:(m=()=>at(r,`csv`),t[17]=r,t[18]=m);let h;t[19]!==n.exportCsv||t[20]!==m?(h=(0,$.jsx)(N,{type:`button`,variant:`ghost`,className:`h-8 justify-start px-2 text-xs`,onClick:m,children:n.exportCsv}),t[19]=n.exportCsv,t[20]=m,t[21]=h):h=t[21];let g;t[22]!==h||t[23]!==p?(g=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[p,h]}),t[22]=h,t[23]=p,t[24]=g):g=t[24];let _;t[25]!==g||t[26]!==u||t[27]!==d?(_=(0,$.jsx)(P,{children:(0,$.jsxs)(F,{side:`bottom`,align:`end`,sideOffset:6,className:l,children:[u,d,g]})}),t[25]=g,t[26]=u,t[27]=d,t[28]=_):_=t[28];let v;return t[29]!==_||t[30]!==c?(v=(0,$.jsxs)(I,{children:[c,_]}),t[29]=_,t[30]=c,t[31]=v):v=t[31],v}function st(e){let t=(0,J.c)(38),{L:n}=e,[r,i]=(0,q.useState)(!1),[a,o]=(0,q.useState)(`info`),[s,c]=(0,q.useState)(!1),[l,u]=(0,q.useState)(null),d,f;t[0]!==n.logLevelLoadError||t[1]!==r?(d=()=>{if(!r)return;let e=!1;return oe().then(t=>{e||o(t)}).catch(t=>{e||u(t instanceof Error?t.message:n.logLevelLoadError)}),()=>{e=!0}},f=[r,n.logLevelLoadError],t[0]=n.logLevelLoadError,t[1]=r,t[2]=d,t[3]=f):(d=t[2],f=t[3]),(0,q.useEffect)(d,f);let p;t[4]===n.logLevelSaveError?p=t[5]:(p=e=>{c(!0),u(null),se(e).then(e=>{o(e.current),i(!1)}).catch(e=>{u(e instanceof Error?e.message:n.logLevelSaveError)}).finally(()=>c(!1))},t[4]=n.logLevelSaveError,t[5]=p);let m=p,h;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsx)(C,{className:`size-4`,strokeWidth:1.75}),t[6]=h):h=t[6];let g;t[7]===n.logLevelTitle?g=t[8]:(g=(0,$.jsx)(`span`,{className:`hidden sm:inline`,children:n.logLevelTitle}),t[7]=n.logLevelTitle,t[8]=g);let _;t[9]===a?_=t[10]:(_=(0,$.jsx)(`span`,{className:`tabular-nums text-fg-muted`,children:a}),t[9]=a,t[10]=_);let v;t[11]!==n.logLevelTitle||t[12]!==g||t[13]!==_?(v=(0,$.jsx)(L,{asChild:!0,children:(0,$.jsxs)(N,{type:`button`,variant:`secondary`,className:`h-9 gap-2 whitespace-nowrap px-3 text-xs`,title:n.logLevelTitle,children:[h,g,_]})}),t[11]=n.logLevelTitle,t[12]=g,t[13]=_,t[14]=v):v=t[14];let y;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(y=k(`w-56 rounded-xl border border-edge bg-surface-overlay p-3 shadow-popover outline-none`,B,`dark:border-edge`),t[15]=y):y=t[15];let b;t[16]===n.logLevelTitle?b=t[17]:(b=(0,$.jsx)(`p`,{className:`text-xs font-medium text-fg`,children:n.logLevelTitle}),t[16]=n.logLevelTitle,t[17]=b);let x;t[18]===n.logLevelHint?x=t[19]:(x=(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:n.logLevelHint}),t[18]=n.logLevelHint,t[19]=x);let S;t[20]!==n.levelNames||t[21]!==m||t[22]!==a||t[23]!==s?(S=Q.map(e=>(0,$.jsx)(`li`,{children:(0,$.jsxs)(`button`,{type:`button`,disabled:s,onClick:()=>m(e),className:k(`flex w-full items-center justify-between rounded-md px-2 py-1.5 text-left text-xs transition-colors`,a===e?`bg-accent/10 font-medium text-accent`:`text-fg hover:bg-surface-hover`),children:[(0,$.jsx)(`span`,{children:n.levelNames[e]}),(0,$.jsx)(`span`,{className:`font-mono text-[10px] uppercase text-fg-subtle`,children:e})]})},e)),t[20]=n.levelNames,t[21]=m,t[22]=a,t[23]=s,t[24]=S):S=t[24];let w;t[25]===S?w=t[26]:(w=(0,$.jsx)(`ul`,{className:`mt-3 flex flex-col gap-1`,children:S}),t[25]=S,t[26]=w);let T;t[27]===l?T=t[28]:(T=l?(0,$.jsx)(`p`,{className:`mt-2 text-xs text-red-600 dark:text-red-400`,children:l}):null,t[27]=l,t[28]=T);let E;t[29]!==x||t[30]!==w||t[31]!==T||t[32]!==b?(E=(0,$.jsx)(P,{children:(0,$.jsxs)(F,{side:`bottom`,align:`end`,sideOffset:6,className:y,children:[b,x,w,T]})}),t[29]=x,t[30]=w,t[31]=T,t[32]=b,t[33]=E):E=t[33];let D;return t[34]!==r||t[35]!==E||t[36]!==v?(D=(0,$.jsxs)(I,{open:r,onOpenChange:i,children:[v,E]}),t[34]=r,t[35]=E,t[36]=v,t[37]=D):D=t[37],D}function ct(e){let t=(0,J.c)(49),{L:n,autoRefresh:r,onAutoRefreshChange:i,fileCount:a,onOpenFiles:o,loading:s,onRefreshAll:c,logs:l}=e,u;t[0]===n.title?u=t[1]:(u=(0,$.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight text-fg sm:text-lg`,children:n.title}),t[0]=n.title,t[1]=u);let d;t[2]===n.subtitle?d=t[3]:(d=(0,$.jsx)(`p`,{className:`mt-2 text-sm leading-relaxed text-fg-muted sm:mt-1`,children:n.subtitle}),t[2]=n.subtitle,t[3]=d);let f;t[4]!==u||t[5]!==d?(f=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[u,d]}),t[4]=u,t[5]=d,t[6]=f):f=t[6];let p=r?`live`:`paused`,m;t[7]===i?m=t[8]:(m=e=>i(e===`live`),t[7]=i,t[8]=m);let h;t[9]===n.refreshManual?h=t[10]:(h={value:`paused`,label:n.refreshManual},t[9]=n.refreshManual,t[10]=h);let g;t[11]===n.refreshLive?g=t[12]:(g={value:`live`,label:n.refreshLive},t[11]=n.refreshLive,t[12]=g);let _;t[13]!==h||t[14]!==g?(_=[h,g],t[13]=h,t[14]=g,t[15]=_):_=t[15];let v;t[16]!==n.refreshModeAria||t[17]!==p||t[18]!==m||t[19]!==_?(v=(0,$.jsx)(`div`,{className:`w-full sm:w-52`,children:(0,$.jsx)(Xe,{"aria-label":n.refreshModeAria,value:p,onChange:m,options:_,buttonClassName:`h-8`})}),t[16]=n.refreshModeAria,t[17]=p,t[18]=m,t[19]=_,t[20]=v):v=t[20];let y;t[21]===n?y=t[22]:(y=(0,$.jsx)(st,{L:n}),t[21]=n,t[22]=y);let b;t[23]!==n||t[24]!==s||t[25]!==l?(b=(0,$.jsx)(ot,{L:n,logs:l,disabled:s}),t[23]=n,t[24]=s,t[25]=l,t[26]=b):b=t[26];let x;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsx)(S,{className:`size-4`,strokeWidth:1.75}),t[27]=x):x=t[27];let C;t[28]===a?C=t[29]:(C=a>0?(0,$.jsx)(`span`,{className:`rounded-full bg-surface-hover px-1.5 text-xs text-fg-muted`,children:a}):null,t[28]=a,t[29]=C);let w;t[30]!==n.logFiles||t[31]!==o||t[32]!==C?(w=(0,$.jsxs)(N,{type:`button`,variant:`ghost`,className:`h-9 min-h-[44px] min-w-[44px] px-2 sm:min-h-9 sm:min-w-0`,title:n.logFiles,"aria-label":n.logFiles,onClick:o,children:[x,C]}),t[30]=n.logFiles,t[31]=o,t[32]=C,t[33]=w):w=t[33];let T;t[34]!==n.refresh||t[35]!==s||t[36]!==c?(T=(0,$.jsx)(W,{className:`h-9 min-h-[44px] min-w-[44px] px-2 sm:min-h-9 sm:min-w-0`,loading:s,label:n.refresh,onClick:c}),t[34]=n.refresh,t[35]=s,t[36]=c,t[37]=T):T=t[37];let E;t[38]!==y||t[39]!==b||t[40]!==w||t[41]!==T?(E=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center justify-end gap-1 sm:self-center`,children:[y,b,w,T]}),t[38]=y,t[39]=b,t[40]=w,t[41]=T,t[42]=E):E=t[42];let D;t[43]!==E||t[44]!==v?(D=(0,$.jsxs)(`div`,{className:`flex w-full shrink-0 flex-col gap-2 rounded-xl bg-surface-hover/20 p-2 sm:flex-row sm:items-center sm:justify-between`,children:[v,E]}),t[43]=E,t[44]=v,t[45]=D):D=t[45];let O;return t[46]!==D||t[47]!==f?(O=(0,$.jsxs)(`header`,{className:`flex flex-col gap-4`,children:[f,D]}),t[46]=D,t[47]=f,t[48]=O):O=t[48],O}function lt(e){let t=(0,J.c)(33),{L:n,stats:r}=e,i;t[0]===r.byLevel?i=t[1]:(i=r.byLevel??{},t[0]=r.byLevel,t[1]=i);let a;t[2]!==n.levelNames||t[3]!==i?(a=Ie(i,n.levelNames),t[2]=n.levelNames,t[3]=i,t[4]=a):a=t[4];let o=a,s=r.runtime?.errorsLast24h;if(!o&&s==null)return null;let c;t[5]===n.statsRegion?c=t[6]:(c=(0,$.jsx)(`span`,{className:`font-medium text-fg-muted`,children:n.statsRegion}),t[5]=n.statsRegion,t[6]=c);let l;t[7]===o?l=t[8]:(l=o?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`mx-1.5 text-fg-subtle`,children:`·`}),(0,$.jsx)(`span`,{className:`tabular-nums`,children:o})]}):null,t[7]=o,t[8]=l);let u;t[9]!==n.runtimeErrors||t[10]!==s?(u=s!=null&&s>0?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`mx-1.5 text-fg-subtle`,children:`·`}),(0,$.jsxs)(`span`,{className:`tabular-nums text-red-600 dark:text-red-400`,children:[n.runtimeErrors,` `,s]})]}):null,t[9]=n.runtimeErrors,t[10]=s,t[11]=u):u=t[11];let d;t[12]!==c||t[13]!==l||t[14]!==u?(d=(0,$.jsx)(L,{asChild:!0,children:(0,$.jsxs)(`button`,{type:`button`,className:`max-w-full truncate rounded-lg border border-transparent px-1 py-0.5 text-left text-xs leading-5 text-fg-subtle transition-colors duration-150 ease-out hover:border-edge-subtle hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel dark:hover:border-edge`,children:[c,l,u]})}),t[12]=c,t[13]=l,t[14]=u,t[15]=d):d=t[15];let f;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(f=k(`w-[min(calc(100vw-2rem),20rem)] rounded-xl border border-edge bg-surface-overlay p-3 shadow-popover outline-none`,B,`dark:border-edge`),t[16]=f):f=t[16];let p;t[17]===n.statsDetailTitle?p=t[18]:(p=(0,$.jsx)(`p`,{className:`text-xs font-medium text-fg`,children:n.statsDetailTitle}),t[17]=n.statsDetailTitle,t[18]=p);let m;t[19]===n.statsHint?m=t[20]:(m=(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:n.statsHint}),t[19]=n.statsHint,t[20]=m);let h;t[21]!==n.levelNames||t[22]!==r.byLevel?(h=Q.map(e=>{let t=r.byLevel?.[e]??0;return t===0?null:(0,$.jsxs)(`li`,{className:`flex items-center justify-between gap-2 rounded-md border border-edge-subtle bg-surface-base px-2 py-1 text-xs dark:border-edge`,children:[(0,$.jsx)(`span`,{className:`font-medium capitalize text-fg`,children:n.levelNames[e]}),(0,$.jsx)(`span`,{className:`tabular-nums text-fg-muted`,children:t})]},e)}),t[21]=n.levelNames,t[22]=r.byLevel,t[23]=h):h=t[23];let g;t[24]===h?g=t[25]:(g=(0,$.jsx)(`ul`,{className:`mt-3 flex flex-col gap-1.5`,children:h}),t[24]=h,t[25]=g);let _;t[26]!==g||t[27]!==p||t[28]!==m?(_=(0,$.jsx)(P,{children:(0,$.jsxs)(F,{side:`bottom`,align:`start`,sideOffset:6,className:f,children:[p,m,g]})}),t[26]=g,t[27]=p,t[28]=m,t[29]=_):_=t[29];let v;return t[30]!==_||t[31]!==d?(v=(0,$.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:(0,$.jsxs)(I,{children:[d,_]})}),t[30]=_,t[31]=d,t[32]=v):v=t[32],v}function ut(){let e=(0,J.c)(89),{L:t,hasToken:n,logs:r,loading:i,error:a,hasMore:o,searchInput:c,setSearchInput:l,selectedLevels:u,moduleFilter:d,setModuleFilter:f,dateFrom:p,setDateFrom:m,dateTo:h,setDateTo:g,modules:_,files:v,stats:y,selectedLog:b,setSelectedLog:x,filesOpen:S,setFilesOpen:C,filtersOpen:w,setFiltersOpen:T,logDir:E,autoRefresh:D,setAutoRefresh:O,copiedDetail:k,setCopiedDetail:A,hasActiveFilters:j,activeFilterCount:M,clearFilters:N,toggleDialogLevel:P,handleLoadMore:F,refreshAll:I,levelSegment:L,handleLevelSegment:R,filterByRequestId:z,filterByTranscriptId:B,filterByErrorSummary:V,openChatForSession:ee,errorSummary:te,errorSummaryLoading:H}=Be(s(dt));if(!n){let n;return e[0]===t?n=e[1]:(n=(0,$.jsx)(tt,{L:t}),e[0]=t,e[1]=n),n}let U;e[2]===C?U=e[3]:(U=()=>C(!0),e[2]=C,e[3]=U);let W;e[4]!==t||e[5]!==D||e[6]!==v.length||e[7]!==i||e[8]!==r||e[9]!==I||e[10]!==O||e[11]!==U?(W=(0,$.jsx)(ct,{L:t,autoRefresh:D,onAutoRefreshChange:O,fileCount:v.length,onOpenFiles:U,loading:i,onRefreshAll:I,logs:r}),e[4]=t,e[5]=D,e[6]=v.length,e[7]=i,e[8]=r,e[9]=I,e[10]=O,e[11]=U,e[12]=W):W=e[12];let G;e[13]===a?G=e[14]:(G=a?(0,$.jsx)(`div`,{className:`rounded-xl bg-danger-soft px-3 py-2 text-sm text-danger`,role:`alert`,children:a}):null,e[13]=a,e[14]=G);let K;e[15]!==t||e[16]!==y?(K=y?(0,$.jsx)(lt,{L:t,stats:y}):null,e[15]=t,e[16]=y,e[17]=K):K=e[17];let q;e[18]!==t||e[19]!==te||e[20]!==H||e[21]!==V?(q=(0,$.jsx)(Ve,{L:t,items:te,loading:H,onSelectItem:V}),e[18]=t,e[19]=te,e[20]=H,e[21]=V,e[22]=q):q=e[22];let Y;e[23]===T?Y=e[24]:(Y=()=>T(!0),e[23]=T,e[24]=Y);let X;e[25]!==t||e[26]!==M||e[27]!==D||e[28]!==N||e[29]!==R||e[30]!==j||e[31]!==L||e[32]!==d||e[33]!==_||e[34]!==c||e[35]!==f||e[36]!==l||e[37]!==Y?(X=(0,$.jsx)(Ze,{L:t,levelSegment:L,onLevelSegment:R,searchInput:c,onSearchInputChange:l,moduleFilter:d,onModuleFilterChange:f,modules:_,onOpenFilters:Y,activeFilterCount:M,hasActiveFilters:j,onClearFilters:N,autoRefresh:D}),e[25]=t,e[26]=M,e[27]=D,e[28]=N,e[29]=R,e[30]=j,e[31]=L,e[32]=d,e[33]=_,e[34]=c,e[35]=f,e[36]=l,e[37]=Y,e[38]=X):X=e[38];let Z;e[39]!==t||e[40]!==z||e[41]!==F||e[42]!==o||e[43]!==i||e[44]!==r||e[45]!==I||e[46]!==x?(Z=(0,$.jsx)($e,{L:t,logs:r,loading:i,hasMore:o,onSelectLog:x,onLoadMore:F,onRefreshAll:I,onFilterByRequestId:z}),e[39]=t,e[40]=z,e[41]=F,e[42]=o,e[43]=i,e[44]=r,e[45]=I,e[46]=x,e[47]=Z):Z=e[47];let re;e[48]!==t||e[49]!==p||e[50]!==h||e[51]!==w||e[52]!==u||e[53]!==m||e[54]!==g||e[55]!==T||e[56]!==P?(re=(0,$.jsx)(Je,{L:t,open:w,onOpenChange:T,dateFrom:p,onDateFromChange:m,dateTo:h,onDateToChange:g,selectedLevels:u,onToggleLevel:P}),e[48]=t,e[49]=p,e[50]=h,e[51]=w,e[52]=u,e[53]=m,e[54]=g,e[55]=T,e[56]=P,e[57]=re):re=e[57];let ie;e[58]===x?ie=e[59]:(ie=()=>x(null),e[58]=x,e[59]=ie);let ae,oe;e[60]===A?(ae=e[61],oe=e[62]):(ae=()=>A(`message`),oe=()=>A(`json`),e[60]=A,e[61]=ae,e[62]=oe);let se;e[63]!==t||e[64]!==k||e[65]!==z||e[66]!==B||e[67]!==ee||e[68]!==b||e[69]!==ae||e[70]!==oe||e[71]!==ie?(se=(0,$.jsx)(Ge,{L:t,log:b,onClose:ie,copiedDetail:k,onCopiedMessage:ae,onCopiedJson:oe,onFilterByRequestId:z,onFilterByTranscriptId:B,onOpenChat:ee}),e[63]=t,e[64]=k,e[65]=z,e[66]=B,e[67]=ee,e[68]=b,e[69]=ae,e[70]=oe,e[71]=ie,e[72]=se):se=e[72];let ce;e[73]!==t||e[74]!==v||e[75]!==S||e[76]!==E||e[77]!==C?(ce=(0,$.jsx)(Ke,{L:t,open:S,onOpenChange:C,files:v,logDir:E}),e[73]=t,e[74]=v,e[75]=S,e[76]=E,e[77]=C,e[78]=ce):ce=e[78];let le;return e[79]!==W||e[80]!==se||e[81]!==ce||e[82]!==G||e[83]!==K||e[84]!==q||e[85]!==X||e[86]!==Z||e[87]!==re?(le=(0,$.jsxs)(ne,{gap:`gap-6`,children:[W,G,K,q,X,Z,re,se,ce]}),e[79]=W,e[80]=se,e[81]=ce,e[82]=G,e[83]=K,e[84]=q,e[85]=X,e[86]=Z,e[87]=re,e[88]=le):le=e[88],le}function dt(e){return e.language}export{ut as LogsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./notes-api-BhRyWe3S.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p as e}from"./locale-store-CQcW9_qA.js";var t={startExtra:null,main:null,end:null},n=e(e=>({...t,setPageHeader:t=>e(t),clearPageHeader:()=>e(t)}));export{n as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{i as a,n as o,o as s}from"./locale-store-CQcW9_qA.js";import{t as c}from"./messages-orB1BMgI.js";import{t as l,v as u}from"./chat-page-BKLyj4IP.js";import{t as d}from"./arrow-left-D880xG-P.js";import{t as f}from"./arrow-right-DSSvoX71.js";import{n as p,r as m}from"./voice-call-context-CJ1ZiJWR.js";import{t as h}from"./check-DUBLcKHA.js";import{t as g}from"./popover-select-CLsphyzA.js";import{t as _}from"./list-todo-CTVRto8O.js";import{F as v}from"./markdown-view-CkihBz06.js";import{n as y,s as b,t as x}from"./install-connector-dialog-B-v1FT3P.js";import{n as S,t as C}from"./personal-avatar-Dp5LHjk3.js";import{t as w}from"./play-kxZvpBg8.js";import{t as T}from"./settings-2-D-csvaET.js";import{t as E}from"./square-DMK_fB-3.js";import{t as D}from"./upload-rrb46c3c.js";import{t as O}from"./x-B_N4OPjy.js";import{t as k}from"./skeleton-DzdOeGYz.js";import{l as ee}from"./voice-transcribe-api-D4eyeSdG.js";import{T as A,d as j,t as M}from"./session-manager-C1T7WiP7.js";import{a as N,i as P,o as F,r as I,s as te,t as ne}from"./dist-GJ8-1PAx.js";import{a as re,r as ie}from"./connectors-api-DNVUmf9M.js";import{t as ae}from"./page-header-store-B2Ahfm0W.js";import{s as L}from"./agent-avatar-display-C7Dx9nt1.js";import{l as R,n as oe,t as se}from"./voice-config-api-yBcUSvvn.js";import{t as z}from"./date-formatters-DukWSVwc.js";var B=n(),V=e(t(),1),H=r(),U=[`intro`,`identity`,`voice`,`connections`],ce=[{id:`loopi`,zh:`Loopi`,en:`Loopi`},{id:`loopi-curious`,zh:`好奇`,en:`Curious`},{id:`loopi-care`,zh:`温和`,en:`Gentle`}];function W(e){return!!(e?.enabled&&(e.status===`connected`||e.connectionStatus===`connected`||e.authStatus===`connected`))}async function G(e,t){let n=await new Promise((e,n)=>{let r=new FileReader;r.onload=()=>e(String(r.result)),r.onerror=()=>n(r.error),r.readAsDataURL(t)});await s(a(`/api/agents/${encodeURIComponent(e)}/avatar`),{method:`PUT`,body:JSON.stringify({base64:n.slice(n.indexOf(`,`)+1),mimeType:t.type})}),L(e)}function le({modelsAvailable:e,onCreated:t}){let n=o(e=>e.language)===`zh`,r=o(e=>e.language),[l,u]=(0,V.useState)(`intro`),[p,m]=(0,V.useState)({displayName:`Ada`,appearance:`loopi`,voice:null}),[g,_]=(0,V.useState)(!1),[v,S]=(0,V.useState)(!1),[T,E]=(0,V.useState)(null),[O,A]=(0,V.useState)(null),[j,M]=(0,V.useState)(null),[N,P]=(0,V.useState)(null),[F,I]=(0,V.useState)(!0),[te,ne]=(0,V.useState)([]),[ae,L]=(0,V.useState)(null),z=(0,V.useRef)(null),B=(0,V.useRef)(null),[le,ue]=(0,V.useState)([]),[K,de]=(0,V.useState)(!0),[fe,q]=(0,V.useState)([]),[J,pe]=(0,V.useState)(null);(0,V.useEffect)(()=>{let e=!1;return s(a(`/api/personal-agent/onboarding`)).then(t=>{e||(u(t.payload.step),m(t.payload.draft))}).catch(t=>{e||E(t instanceof Error?t.message:String(t))}).finally(()=>{e||_(!0)}),()=>{e=!0}},[]),(0,V.useEffect)(()=>{if(!g)return;let e=window.setTimeout(()=>{s(a(`/api/personal-agent/onboarding`),{method:`PUT`,body:JSON.stringify({step:l,draft:p})}).catch(()=>{})},350);return()=>window.clearTimeout(e)},[p,g,l]),(0,V.useEffect)(()=>{let e=!1;return se().then(t=>{e||(t.tts&&t.enabled?P({provider:t.tts.provider,model:t.tts.model,enabled:!0}):I(!1))}).catch(()=>{e||I(!1)}),()=>{e=!0}},[]),(0,V.useEffect)(()=>{if(!N?.enabled)return;let e=!1;return oe(N.provider,N.model,`realtime`).then(t=>{e||ne(t.slice(0,12))}).catch(()=>{}).finally(()=>{e||I(!1)}),()=>{e=!0}},[N]),(0,V.useEffect)(()=>{if(l!==`connections`)return;let e=!1;return de(!0),Promise.allSettled([ie({page:1,pageSize:24,verification:`verified`}),re()]).then(([t,n])=>{if(!e){if(t.status===`fulfilled`){let e=[`gmail`,`googlecalendar`,`googledrive`,`github`,`linear`];ue(t.value.connectors.filter(t=>t.runtime.type===`composio`&&e.includes(t.runtime.toolkit)).sort((t,n)=>e.indexOf(t.runtime.type===`composio`?t.runtime.toolkit:``)-e.indexOf(n.runtime.type===`composio`?n.runtime.toolkit:``)))}n.status===`fulfilled`&&q(n.value),de(!1)}}),()=>{e=!0}},[l]),(0,V.useEffect)(()=>()=>{B.current?.abort(),z.current?.close()},[]),(0,V.useEffect)(()=>()=>{j&&URL.revokeObjectURL(j)},[j]);let me=async(e,t=p)=>{await s(a(`/api/personal-agent/onboarding`),{method:`PUT`,body:JSON.stringify({step:e,draft:t})}),u(e)},Y=async e=>{E(null);let t=U[Math.max(0,Math.min(U.length-1,U.indexOf(l)+e))];try{await me(t)}catch(e){E(e instanceof Error?e.message:String(e))}},he=async(n=!1)=>{if(!(!e||v)){S(!0),E(null);try{let e=n?{displayName:`Ada`,appearance:`loopi`,voice:null}:p,r=e.voice&&N?.enabled&&te.some(t=>t.id===e.voice)?{provider:N.provider,model:N.model,voice:e.voice}:void 0,i=(await s(a(`/api/personal-agent`),{method:`POST`,body:JSON.stringify({displayName:e.displayName.trim()||`Ada`,appearance:e.appearance,...r?{voicePreference:r}:{}})})).payload,o=!1;if(!n&&O)try{await G(i.agentId,O),i=(await s(a(`/api/personal-agent/profile`),{method:`PATCH`,body:JSON.stringify({revision:i.revision,displayName:i.displayName,appearance:`custom`})})).payload}catch{o=!0}t(i,o)}catch(e){E(e instanceof Error?e.message:String(e))}finally{S(!1)}}},X=(0,V.useCallback)(async e=>{B.current?.abort(),z.current?.close();let t=new AbortController;B.current=t,L(e),E(null);try{let n=new ee;z.current=n,await n.start();let r=await R(t.signal,e);if(t.signal.aborted)return;n.enqueue(r,()=>L(null))}catch(e){t.signal.aborted||E(e instanceof Error?e.message:String(e)),L(null)}},[]);if(!g)return(0,H.jsxs)(`div`,{className:`mx-auto w-full max-w-xl space-y-4 px-6 py-14`,children:[(0,H.jsx)(k,{className:`h-10 w-2/3`}),(0,H.jsx)(k,{className:`h-64 w-full rounded-2xl`}),(0,H.jsx)(k,{className:`h-12 w-full rounded-xl`})]});let Z=U.indexOf(l),ge={intro:n?`创建一个和你一起做事的助手`:`Create an assistant to work with you`,identity:n?`先给它一个形象和名字`:`Choose a look and a name`,voice:n?`想让我用什么声音回应?`:`How should your assistant sound?`,connections:n?`要让我了解哪些信息?`:`What information can your assistant use?`}[l];return(0,H.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col bg-surface-base`,children:[(0,H.jsx)(`header`,{className:`shrink-0 px-5 pt-5 sm:px-8 sm:pt-7`,children:(0,H.jsxs)(`div`,{className:`mx-auto w-full max-w-2xl`,children:[(0,H.jsxs)(`div`,{className:`flex min-h-10 items-center justify-between gap-4`,children:[Z>0?(0,H.jsxs)(`button`,{type:`button`,disabled:v,onClick:()=>void Y(-1),className:`-ml-2 inline-flex min-h-10 items-center gap-1.5 rounded-lg px-2 text-sm text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:opacity-40`,children:[(0,H.jsx)(d,{className:`size-4`}),n?`上一步`:`Back`]}):(0,H.jsx)(`span`,{className:`text-sm font-medium text-fg-muted`,children:n?`设置我的助手`:`Set up my assistant`}),(0,H.jsx)(i,{to:`/chat`,className:`-mr-2 inline-flex min-h-10 items-center rounded-lg px-2 text-sm text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:n?`稍后继续`:`Finish later`})]}),(0,H.jsx)(`div`,{className:`mt-4 grid grid-cols-4 gap-1.5`,role:`progressbar`,"aria-label":n?`设置进度`:`Setup progress`,"aria-valuenow":Z+1,"aria-valuemin":1,"aria-valuemax":U.length,children:U.map((e,t)=>(0,H.jsx)(`span`,{className:`h-1 rounded-full transition-colors duration-200 ${t<=Z?`bg-accent`:`bg-surface-active`}`},e))})]})}),(0,H.jsx)(`main`,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto px-5 py-8 sm:px-8`,children:(0,H.jsxs)(`div`,{className:`mx-auto my-auto w-full max-w-2xl py-6 motion-safe:animate-[page-enter_220ms_ease-out]`,children:[(0,H.jsxs)(`div`,{className:`mb-8 flex items-center gap-4`,children:[(0,H.jsx)(`span`,{className:`flex size-16 shrink-0 items-center justify-center rounded-2xl bg-surface-hover`,children:j?(0,H.jsx)(`img`,{src:j,alt:``,className:`size-14 rounded-xl object-cover`}):(0,H.jsx)(C,{appearance:p.appearance,className:`size-14`})}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`p`,{className:`text-xs text-fg-muted`,children:n?`我的助手`:`My assistant`}),(0,H.jsx)(`p`,{className:`mt-1 text-lg font-semibold text-fg`,children:p.displayName||`Ada`})]})]}),(0,H.jsx)(`p`,{className:`mb-3 text-xs font-medium tracking-wide text-fg-subtle`,children:n?`第 ${Z+1} 步 · 共 ${U.length} 步`:`Step ${Z+1} of ${U.length}`}),(0,H.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight text-fg sm:text-3xl`,children:ge}),l===`intro`&&(0,H.jsxs)(`div`,{className:`mt-6 max-w-xl space-y-3 text-base leading-8 text-fg-muted`,children:[(0,H.jsx)(`p`,{children:n?`你可以找它讨论问题,也可以交给它一件要推进的事。`:`Talk through a question or give it something to move forward.`}),(0,H.jsx)(`p`,{children:n?`需要深入处理时,它会找合适的 Agent,并把进展带回对话。`:`It can ask a suitable Agent for deeper work and bring the progress back.`}),(0,H.jsx)(`p`,{children:n?`它能使用哪些数据和设备,由你决定。`:`You choose which data and devices it can use.`})]}),l===`identity`&&(0,H.jsxs)(`div`,{className:`mt-7 space-y-7`,children:[(0,H.jsxs)(`label`,{className:`block text-sm font-medium text-fg`,children:[n?`助手名字`:`Assistant name`,(0,H.jsx)(`input`,{value:p.displayName,maxLength:60,onChange:e=>m(t=>({...t,displayName:e.target.value})),onBlur:()=>m(e=>({...e,displayName:e.displayName.trim()||`Ada`})),className:`mt-2 block w-full rounded-xl border border-edge bg-surface-panel px-4 py-3 text-fg outline-none focus-visible:ring-2 focus-visible:ring-accent`})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`p`,{className:`mb-3 text-sm font-medium text-fg`,children:n?`选择头像`:`Choose an avatar`}),(0,H.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 sm:grid-cols-4`,children:[ce.map(e=>(0,H.jsxs)(`button`,{type:`button`,"aria-pressed":!O&&p.appearance===e.id,onClick:()=>{A(null),M(null),m(t=>({...t,appearance:e.id}))},className:`flex min-h-28 flex-col items-center justify-center gap-2 rounded-2xl p-3 text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent ${!O&&p.appearance===e.id?`bg-accent/10 text-fg ring-1 ring-accent/40`:`bg-surface-panel text-fg-muted hover:bg-surface-hover`}`,children:[(0,H.jsx)(C,{appearance:e.id,className:`size-14`}),n?e.zh:e.en]},e.id)),(0,H.jsxs)(`label`,{className:`flex min-h-28 cursor-pointer flex-col items-center justify-center gap-2 rounded-2xl p-3 text-sm transition-colors focus-within:ring-2 focus-within:ring-accent ${O?`bg-accent/10 text-fg ring-1 ring-accent/40`:`bg-surface-panel text-fg-muted hover:bg-surface-hover`}`,children:[(0,H.jsx)(D,{className:`size-6`}),n?`上传图片`:`Upload image`,(0,H.jsx)(`input`,{className:`sr-only`,type:`file`,accept:`image/png,image/jpeg,image/webp`,onChange:e=>{let t=e.target.files?.[0];if(t){if(t.size>512*1024||![`image/png`,`image/jpeg`,`image/webp`].includes(t.type)){E(n?`请选择不超过 512 KB 的 PNG、JPEG 或 WebP 图片。`:`Choose a PNG, JPEG, or WebP image under 512 KB.`);return}A(t),M(URL.createObjectURL(t))}}})]})]}),(0,H.jsx)(`p`,{className:`mt-2 text-xs text-fg-subtle`,children:n?`自定义图片在创建助手时上传;刷新后需要重新选择。`:`Custom images upload when you create the assistant; select again after a refresh.`})]})]}),l===`voice`&&(0,H.jsxs)(`div`,{className:`mt-5`,children:[(0,H.jsx)(`p`,{className:`text-sm leading-6 text-fg-muted`,children:n?`用于这个助手的语音通话;文字回答不受影响。试听不会使用麦克风。`:`This affects calls with this assistant. Text stays the same. Preview does not use your microphone.`}),F?(0,H.jsxs)(`div`,{className:`mt-5 grid gap-3 sm:grid-cols-2`,children:[(0,H.jsx)(k,{className:`h-20 rounded-xl`}),(0,H.jsx)(k,{className:`h-20 rounded-xl`})]}):N?.enabled&&te.length>0?(0,H.jsxs)(`div`,{className:`mt-5 grid gap-3 sm:grid-cols-2`,children:[(0,H.jsx)(`button`,{type:`button`,"aria-pressed":!p.voice,onClick:()=>m(e=>({...e,voice:null})),className:`rounded-xl p-4 text-left text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent ${p.voice?`bg-surface-panel text-fg-muted hover:bg-surface-hover`:`bg-accent/10 text-fg ring-1 ring-accent/40`}`,children:n?`使用默认声音`:`Use the default voice`}),te.map(e=>(0,H.jsxs)(`div`,{className:`flex items-center gap-2 rounded-xl p-3 transition-colors ${p.voice===e.id?`bg-accent/10 ring-1 ring-accent/40`:`bg-surface-panel hover:bg-surface-hover`}`,children:[(0,H.jsxs)(`button`,{type:`button`,className:`min-w-0 flex-1 rounded-lg text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-pressed":p.voice===e.id,onClick:()=>m(t=>({...t,voice:e.id})),children:[(0,H.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:e.name}),(0,H.jsx)(`span`,{className:`mt-1 block text-xs text-fg-muted`,children:e.description||e.style||(n?`点击选择`:`Select this voice`)})]}),(0,H.jsx)(`button`,{type:`button`,onClick:()=>void X(e.id),className:`flex size-9 shrink-0 items-center justify-center rounded-full bg-surface-hover text-fg hover:bg-surface-active focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":n?`试听${e.name}`:`Preview ${e.name}`,children:(0,H.jsx)(w,{className:`size-4 ${ae===e.id?`text-accent`:``}`})})]},e.id))]}):(0,H.jsxs)(`div`,{className:`mt-5 rounded-xl bg-surface-panel p-5 text-sm text-fg-muted`,children:[(0,H.jsx)(`p`,{children:n?`当前没有可试听的语音。你可以先用文字对话,稍后再设置。`:`No voice is ready to preview. You can start with text and set it up later.`}),(0,H.jsx)(i,{to:`/settings/capabilities/models?configure=speech&returnTo=%2Fpersonal`,className:`mt-3 inline-block text-accent hover:underline`,children:n?`设置语音服务`:`Set up voice`})]})]}),l===`connections`&&(0,H.jsxs)(`div`,{className:`mt-5`,children:[(0,H.jsx)(`p`,{className:`text-sm leading-6 text-fg-muted`,children:n?`现在连接,或进入对话后再添加。连接不会自动读取历史数据或创建持续关注。`:`Connect now or add sources later. Connecting does not automatically scan history or create ongoing monitoring.`}),K?(0,H.jsxs)(`div`,{className:`mt-5 space-y-2`,children:[(0,H.jsx)(k,{className:`h-18 rounded-xl`}),(0,H.jsx)(k,{className:`h-18 rounded-xl`})]}):(0,H.jsx)(`div`,{className:`mt-5 space-y-2`,children:le.length?le.map(e=>{let t=W(fe.find(t=>t.connectorId===e.id));return(0,H.jsxs)(`div`,{className:`flex items-center gap-3 rounded-xl bg-surface-panel p-4`,children:[(0,H.jsx)(y,{connector:e,size:`sm`}),(0,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,H.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:e.displayName}),(0,H.jsx)(`p`,{className:`line-clamp-2 text-xs text-fg-muted`,children:e.description})]}),t?(0,H.jsxs)(`span`,{className:`flex items-center gap-1 text-xs text-success`,children:[(0,H.jsx)(h,{className:`size-4`}),n?`已连接`:`Connected`]}):(0,H.jsx)(`button`,{type:`button`,onClick:()=>pe(b(e)),className:`rounded-lg bg-surface-hover px-3 py-2 text-xs text-fg transition-colors hover:bg-surface-active focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:n?`连接`:`Connect`})]},e.id)}):(0,H.jsx)(`p`,{className:`rounded-xl bg-surface-panel p-5 text-sm text-fg-muted`,children:n?`暂无可用的推荐服务;你仍可直接进入对话。`:`No suggested services are available. You can continue to chat.`})})]}),!e&&(0,H.jsxs)(`p`,{className:`mt-5 rounded-xl bg-warning/5 p-4 text-sm text-fg-muted`,children:[n?`开始前需要一个可用模型。`:`A compatible model is required before you start.`,` `,(0,H.jsx)(i,{to:`/settings/capabilities/models`,className:`text-accent underline`,children:n?`配置模型`:`Set up a model`})]}),T&&(0,H.jsx)(`p`,{role:`alert`,className:`mt-5 text-sm text-danger`,children:T})]},l)}),(0,H.jsx)(`footer`,{className:`shrink-0 px-5 pb-6 pt-3 sm:px-8 sm:pb-9`,children:(0,H.jsxs)(`div`,{className:`mx-auto flex w-full max-w-2xl flex-col-reverse gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,H.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:n?`这些选择以后都能调整`:`You can change these choices later`}),(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[l===`intro`&&(0,H.jsx)(`button`,{type:`button`,disabled:!e||v,onClick:()=>void he(!0),className:`min-h-11 rounded-lg px-3 text-sm text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:opacity-40`,children:n?`用默认设置开始`:`Use defaults`}),l===`voice`&&(0,H.jsx)(`button`,{type:`button`,onClick:()=>{let e={...p,voice:null};m(e),E(null),me(`connections`,e).catch(e=>E(e instanceof Error?e.message:String(e)))},className:`min-h-11 rounded-lg px-3 text-sm text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:n?`跳过`:`Skip`}),(0,H.jsxs)(`button`,{type:`button`,disabled:v||l===`connections`&&!e,onClick:()=>l===`connections`?void he():void Y(1),className:`flex min-h-11 items-center gap-2 rounded-xl bg-accent px-5 text-sm font-medium text-on-accent transition-colors hover:bg-accent-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 disabled:opacity-40`,children:[v?n?`正在创建…`:`Creating…`:l===`connections`?n?`进入对话`:`Start chatting`:n?`继续`:`Continue`,` `,!v&&(0,H.jsx)(f,{className:`size-4`})]})]})]})}),J&&(0,H.jsx)(x,{draft:J,onChange:pe,onClose:()=>pe(null),t:c(r).connectorsSettings,onInstalled:async()=>{q(await re()),pe(null)}})]})}function ue({record:e,zh:t,onSelectVoice:n,onGreetingChange:r}){let[a,o]=(0,V.useState)(!1),[s,c]=(0,V.useState)(!0),[l,u]=(0,V.useState)(``),[d,f]=(0,V.useState)(null),[p,m]=(0,V.useState)([]),[h,_]=(0,V.useState)(e.voicePreference?.voice??``),[v,y]=(0,V.useState)(!1),[b,x]=(0,V.useState)(null),[S,C]=(0,V.useState)(null),T=(0,V.useRef)(null),D=(0,V.useRef)(null);(0,V.useEffect)(()=>{let e=!1;return(async()=>{try{let t=await se();if(e||(o(t.openingGreeting===!0),!t.enabled||!t.tts))return;let n={provider:t.tts.provider,model:t.tts.model};f(n);let r=await oe(n.provider,n.model,`realtime`);e||m(r)}catch(t){e||x(t instanceof Error?t.message:String(t))}finally{e||c(!1)}})(),()=>{e=!0}},[]),(0,V.useEffect)(()=>()=>{D.current?.abort(),T.current?.close()},[]);let O=()=>{D.current?.abort(),D.current=null,T.current?.close(),T.current=null,C(null)},A=async e=>{if(S!==null){O();return}O(),x(null);let n=new AbortController;D.current=n,C(e);try{let t=new ee;T.current=t,await t.start();let r=await R(n.signal,e);n.signal.aborted||t.enqueue(r,()=>{D.current===n&&(C(null),D.current=null,T.current=null,t.close())})}catch(e){if(!n.signal.aborted){let n=e?.body?.error?.code;x(t&&n===`unsupported_voice`?`当前音色暂不可用,请刷新语音目录或选择其他音色。`:e instanceof Error?e.message:String(e))}D.current===n&&O()}},j=async e=>{if(v||e===h)return;O();let t=h;_(e),u(``),y(!0),x(null);try{await n(e&&d?{provider:d.provider,model:d.model,voice:e}:null)||_(t)}catch(e){_(t),x(e instanceof Error?e.message:String(e))}finally{y(!1)}},M=p.find(e=>e.id===h),N=t?`默认声音`:`Default voice`,P=M?.name||(h?t?`当前音色不可用`:`Current voice unavailable`:N),F=l.trim().toLocaleLowerCase(),I=p.filter(e=>!F||`${e.name} ${e.description??``} ${e.style??``}`.toLocaleLowerCase().includes(F)).map(e=>({value:e.id,label:e.name}));return(0,H.jsxs)(`section`,{className:`border-t border-edge pt-5`,children:[(0,H.jsx)(`h3`,{className:`text-sm font-medium text-fg`,children:t?`通话声音`:`Call voice`}),s?(0,H.jsx)(`div`,{className:`mt-3`,"aria-busy":`true`,children:(0,H.jsx)(k,{className:`h-10 w-full`})}):d&&p.length?(0,H.jsxs)(`div`,{className:`mt-3 space-y-2`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,H.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,H.jsx)(g,{value:h,selectedLabel:P,options:I,placeholder:N,emptyLabel:N,ariaLabel:t?`选择通话音色`:`Choose call voice`,disabled:v,onChange:e=>void j(e),searchPlaceholder:p.length>8?t?`搜索音色`:`Search voices`:void 0,searchValue:l,onSearchChange:u,statusMessage:F&&!I.length?t?`没有匹配的音色`:`No matching voices`:void 0})}),(0,H.jsxs)(`button`,{type:`button`,disabled:v||!!(h&&!M),onClick:()=>void A(h),className:`touch-target flex h-10 shrink-0 items-center justify-center gap-1.5 rounded-lg border border-edge px-3 text-sm text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:opacity-50`,title:S===null?t?`试听${P}`:`Preview ${P}`:t?`停止试听`:`Stop preview`,"aria-label":S===null?t?`试听${P}`:`Preview ${P}`:t?`停止试听`:`Stop preview`,children:[S===null?(0,H.jsx)(w,{className:`size-4`,"aria-hidden":!0}):(0,H.jsx)(E,{className:`size-4 text-accent`,"aria-hidden":!0}),S===null?t?`试听`:`Preview`:t?`停止`:`Stop`]})]}),(0,H.jsx)(`p`,{className:`text-xs leading-relaxed text-fg-muted`,children:M?.description||M?.style||(h?t?`选择后自动保存,用于之后的语音通话。`:`Saved automatically for future voice calls.`:t?`跟随语音服务的默认音色。`:`Uses the voice service’s default voice.`)})]}):(0,H.jsxs)(`p`,{className:`mt-3 text-sm text-fg-muted`,children:[t?`当前没有可用音色。`:`No voice is ready.`,` `,(0,H.jsx)(i,{to:`/settings/capabilities/models?configure=speech&returnTo=%2Fpersonal`,className:`text-accent underline`,children:t?`设置语音服务`:`Set up voice`})]}),r&&a&&(0,H.jsxs)(`label`,{className:`mt-4 flex items-center justify-between gap-3 text-sm text-fg`,children:[t?`连接时打招呼`:`Greet me when connected`,(0,H.jsx)(`input`,{type:`checkbox`,checked:e.voiceCallPreferences?.openingGreetingEnabled??!0,disabled:v,onChange:e=>{let t=e.target.checked;y(!0),r(t).catch(e=>x(String(e))).finally(()=>y(!1))}})]}),b&&(0,H.jsx)(`p`,{role:`alert`,className:`mt-3 text-xs text-danger`,children:b})]})}var K=new M;function de({conversationId:e,zh:t,onSaved:n}){let r=A(t=>t.sessions[e]),[i,a]=(0,V.useState)(!0),[o,s]=(0,V.useState)(``);(0,V.useEffect)(()=>{let t=!0;return K.loadSessionAgentConfig(e).then(n=>{t&&j(e,n)}).catch(e=>{t&&s(String(e))}).finally(()=>{t&&a(!1)}),()=>{t=!1}},[e]);let l=!!r?.modelConfigSaving;async function d(t,i){A.getState().patchSessionMeta(e,{modelConfigSaving:!0});try{j(e,await K.patchSessionAgentConfig(e,{model:t,thinkingLevel:i,configVersion:r?.configVersion})),await n()}catch(t){let n=await K.loadSessionAgentConfig(e).catch(()=>null);throw n&&j(e,n),t}finally{A.getState().patchSessionMeta(e,{modelConfigSaving:!1})}}return(0,H.jsxs)(`section`,{children:[(0,H.jsx)(`h3`,{className:`mb-3 text-sm font-medium text-fg`,children:t?`对话模型与思考强度`:`Conversation model and thinking`}),i?(0,H.jsx)(k,{className:`h-9 w-full`}):(0,H.jsx)(u,{chat:c(t?`zh`:`en`).chat,sessionModel:r?.model??``,thinkingLevel:r?.thinkingLevel??`off`,modelDisabled:l,thinkingDisabled:l,onModelChange:d,onThinkingChange:e=>d(r?.model??``,e)}),o&&(0,H.jsx)(`p`,{role:`alert`,className:`mt-2 text-sm text-danger`,children:o})]})}var fe=5;function q(e){let t=e.replace(/\s+/g,` `).trim();if(t.length<=58)return t;let n=t.replace(/([^)]{1,80})|\([^)]{1,80}\)/g,``).replace(/([A-Za-z0-9])(?=[\u4e00-\u9fff])/g,`$1 `).replace(/\s+/g,` `).trim(),r=n.split(/[。!?;;,]/,1)[0]?.trim()||n;return r.length>58?`${r.slice(0,57).trimEnd()}…`:r}function J(e,t){if(e.phase===`closed`)return{label:t?`已结束`:`Finished`,tone:`bg-fg-subtle`};let n=e.operationalState??e.runStatus;return n===`running`?{label:t?`正在执行`:`Working`,tone:`bg-accent`}:n===`queued`?{label:t?`等待开始`:`Queued`,tone:`bg-fg-subtle`}:n===`failed`?{label:t?`执行失败`:`Failed`,tone:`bg-danger`}:n===`waiting`?{label:t?`等待继续`:`Waiting`,tone:`bg-warning`}:n===`blocked`?{label:t?`已阻塞`:`Blocked`,tone:`bg-warning`}:n===`verifying`?{label:t?`正在验证`:`Verifying`,tone:`bg-accent`}:n===`cancelled`?{label:t?`执行已取消`:`Cancelled`,tone:`bg-fg-subtle`}:e.phase===`review`?{label:t?`等待验收`:`In review`,tone:`bg-warning`}:e.phase===`active`?{label:t?`正在推进`:`In progress`,tone:`bg-accent`}:e.phase===`ready`?{label:t?`准备开始`:`Ready`,tone:`bg-fg-subtle`}:{label:t?`待处理`:`Planned`,tone:`bg-fg-subtle`}}function pe(e){let t=(0,B.c)(30),{item:n,zh:r}=e,a;t[0]!==n||t[1]!==r?(a=J(n,r),t[0]=n,t[1]=r,t[2]=a):a=t[2];let o=a,s;t[3]===n.id?s=t[4]:(s=v(`/personal`,n.id),t[3]=n.id,t[4]=s);let c=`mt-2 size-1.5 shrink-0 rounded-full ${o.tone}`,l;t[5]===c?l=t[6]:(l=(0,H.jsx)(`span`,{className:c,"aria-hidden":!0}),t[5]=c,t[6]=l);let u;t[7]===n.title?u=t[8]:(u=q(n.title),t[7]=n.title,t[8]=u);let d;t[9]===u?d=t[10]:(d=(0,H.jsx)(`span`,{className:`line-clamp-2 break-words text-sm font-medium leading-5 text-fg`,children:u}),t[9]=u,t[10]=d);let f;t[11]===o.label?f=t[12]:(f=(0,H.jsx)(`span`,{children:o.label}),t[11]=o.label,t[12]=f);let p;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,H.jsx)(`span`,{className:`text-fg-subtle`,"aria-hidden":!0,children:`·`}),t[13]=p):p=t[13];let h=r?`zh`:`en`,g;t[14]!==n.updatedAt||t[15]!==h?(g=z(n.updatedAt,h),t[14]=n.updatedAt,t[15]=h,t[16]=g):g=t[16];let _;t[17]===g?_=t[18]:(_=(0,H.jsx)(`span`,{children:g}),t[17]=g,t[18]=_);let y;t[19]!==_||t[20]!==f?(y=(0,H.jsxs)(`span`,{className:`mt-1.5 flex items-center gap-2 text-xs text-fg-muted`,children:[f,p,_]}),t[19]=_,t[20]=f,t[21]=y):y=t[21];let b;t[22]!==y||t[23]!==d?(b=(0,H.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[d,y]}),t[22]=y,t[23]=d,t[24]=b):b=t[24];let x;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,H.jsx)(m,{className:`mt-0.5 size-4 shrink-0 text-fg-subtle opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-visible:opacity-100`,"aria-hidden":!0}),t[25]=x):x=t[25];let S;return t[26]!==b||t[27]!==s||t[28]!==l?(S=(0,H.jsxs)(i,{to:s,className:`group flex min-w-0 items-start gap-3 rounded-2xl bg-surface-panel px-4 py-4 transition-colors duration-150 hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[l,b,x]}),t[26]=b,t[27]=s,t[28]=l,t[29]=S):S=t[29],S}var me=[{id:`loopi`,zh:`Loopi`,en:`Loopi`,color:`bg-slate-100/50 dark:bg-slate-400/10`},{id:`loopi-curious`,zh:`好奇`,en:`Curious`,color:`bg-blue-100/50 dark:bg-blue-400/10`},{id:`loopi-care`,zh:`温和`,en:`Gentle`,color:`bg-violet-100/50 dark:bg-violet-400/10`}];function Y(){let e=p(),t=(0,V.useRef)(e);t.current=e;let n=o(e=>e.language)===`zh`,r=ae(e=>e.setPageHeader),i=ae(e=>e.clearPageHeader),[c,u]=(0,V.useState)(null),d=(0,V.useRef)(null),f=(0,V.useRef)(Promise.resolve()),[m,h]=(0,V.useState)([]),[g,v]=(0,V.useState)(!0),[y,b]=(0,V.useState)(0),[x,w]=(0,V.useState)(null),[E,ee]=(0,V.useState)(!1),[A,j]=(0,V.useState)(`loopi`),[M,re]=(0,V.useState)(!1),ie=(0,V.useRef)(null),R=(0,V.useRef)(null),oe=(0,V.useRef)(null),[se,z]=(0,V.useState)(``),[B,U]=(0,V.useState)(!1),[ce,W]=(0,V.useState)(!1),[G,K]=(0,V.useState)(!1),[q,J]=(0,V.useState)(null),[Y,he]=(0,V.useState)(!1),[X,Z]=(0,V.useState)(!1),[ge,_e]=(0,V.useState)(!1),[Q,ve]=(0,V.useState)(0),$=(0,V.useRef)(0),ye=(0,V.useCallback)(()=>{K(!1),W(!1),U(!0)},[]),be=(0,V.useCallback)(()=>{K(!1),W(!1),U(e=>!e)},[]),xe=(0,V.useCallback)(async()=>{try{let[e,t]=await Promise.all([s(a(`/api/personal-agent`)),s(a(`/api/personal-agent/models`))]);d.current=e.payload,u(e.payload),window.dispatchEvent(new CustomEvent(`personal-agent-updated`,{detail:e.payload})),e.payload&&window.dispatchEvent(new Event(`session-updated`)),h(t.payload),e.payload&&(z(e.payload.displayName),j(e.payload.appearance))}catch(e){w(e instanceof Error?e.message:String(e))}finally{v(!1)}},[]);(0,V.useEffect)(()=>{xe()},[xe]);let Se=(0,V.useCallback)(e=>{b(e=>e+1),w(null);let t=f.current.then(async()=>{let t=d.current;if(!t)return!1;let n=e.displayName?.trim()||t.displayName,r=e.appearance??t.appearance,i=e.voicePreference===void 0?t.voicePreference:e.voicePreference;if(n===t.displayName&&r===t.appearance&&JSON.stringify(i)===JSON.stringify(t.voicePreference)&&(!e.voiceCallPreferences||JSON.stringify(e.voiceCallPreferences)===JSON.stringify(t.voiceCallPreferences)))return!0;try{let o=await s(a(`/api/personal-agent/profile`),{method:`PATCH`,body:JSON.stringify({revision:t.revision,displayName:n,appearance:r,...e.voicePreference===void 0?{}:{voicePreference:i},...e.voiceCallPreferences?{voiceCallPreferences:e.voiceCallPreferences}:{}})});return d.current=o.payload,u(o.payload),window.dispatchEvent(new CustomEvent(`personal-agent-updated`,{detail:o.payload})),!0}catch(e){return w(e instanceof Error?e.message:String(e)),!1}}).finally(()=>b(e=>e-1));return f.current=t,t},[]),Ce=(0,V.useCallback)(async()=>{let e=++$.current;K(!0),J(null),he(!1),Z(!1),_e(!1),ve(0);try{let t=await s(a(`/api/personal-agent/activity?limit=${fe}&offset=0`));if(e!==$.current)return;J(t.payload),ve(t.payload.items.length)}catch{e===$.current&&he(!0)}},[]),we=(0,V.useCallback)(async()=>{if(!q||X||Q>=q.total)return;let e=$.current;Z(!0),_e(!1);try{let t=await s(a(`/api/personal-agent/activity?limit=${fe}&offset=${Q}`));if(e!==$.current)return;J(e=>e?{total:t.payload.total,items:[...e.items,...t.payload.items.filter(t=>!e.items.some(e=>e.id===t.id))]}:t.payload),ve(e=>e+t.payload.items.length)}catch{e===$.current&&_e(!0)}finally{e===$.current&&Z(!1)}},[q,Q,X]);(0,V.useEffect)(()=>{if(!G||!q||X)return;let e,t=()=>{window.clearTimeout(e),e=window.setTimeout(async()=>{let e=$.current;try{let t=await s(a(`/api/personal-agent/activity?limit=${Math.max(fe,Math.min(100,Q))}&offset=0`));if(e!==$.current)return;J(t.payload),ve(t.payload.items.length)}catch{}},120)},n=window.setInterval(t,5e3);return window.addEventListener(`task-changed-v2`,t),window.addEventListener(`gateway-realtime-connected`,t),()=>{window.clearTimeout(e),window.clearInterval(n),window.removeEventListener(`task-changed-v2`,t),window.removeEventListener(`gateway-realtime-connected`,t)}},[q,Q,X,G]);let Te=async e=>{if(!c||![`image/png`,`image/jpeg`,`image/webp`].includes(e.type)){w(n?`请选择 PNG、JPEG 或 WebP 图片。`:`Choose a PNG, JPEG, or WebP image.`);return}if(e.size===0||e.size>512*1024){w(n?`图片大小不能超过 512 KB。`:`Image must be 512 KB or smaller.`);return}re(!0),w(null);try{let t=await new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(String(r.result)),r.onerror=()=>n(r.error),r.readAsDataURL(e)});await s(a(`/api/agents/${encodeURIComponent(c.agentId)}/avatar`),{method:`PUT`,body:JSON.stringify({base64:t.slice(t.indexOf(`,`)+1),mimeType:e.type})}),L(c.agentId),j(`custom`),W(!1),await Se({appearance:`custom`})}catch(e){w(e instanceof Error?e.message:String(e))}finally{re(!1)}};(0,V.useLayoutEffect)(()=>{let a=c?.state===`ready`,o=a?c.appearance:A,s=a?c.displayName:`Ada`;return r({startExtra:null,main:(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2.5`,children:[a?(0,H.jsx)(`button`,{ref:oe,type:`button`,onClick:be,"aria-expanded":B,className:`touch-target -m-1 shrink-0 rounded-full p-1 transition-opacity hover:opacity-80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":n?`编辑${s}的资料`:`Edit ${s}'s profile`,title:n?`资料`:`Profile`,children:(0,H.jsx)(`span`,{className:`flex size-8 items-center justify-center`,children:(0,H.jsx)(C,{appearance:o,agentId:c?.agentId,className:`size-8`})})}):(0,H.jsx)(`span`,{className:`flex size-8 shrink-0 items-center justify-center`,children:(0,H.jsx)(C,{appearance:o,agentId:c?.agentId,className:`size-8`})}),(0,H.jsx)(`h1`,{className:`min-w-0 truncate text-sm font-semibold text-fg sm:text-base`,children:s})]}),end:a?(0,H.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,H.jsx)(`button`,{type:`button`,disabled:e.active,onClick:()=>{c?.state===`ready`&&t.current.open({conversationId:c.conversationId,name:c.displayName,mode:`assistant`})},className:`touch-target rounded-lg p-2 text-fg-muted hover:bg-surface-hover hover:text-fg disabled:opacity-50`,"aria-label":n?`语音通话`:`Voice call`,title:n?`语音通话`:`Voice call`,children:(0,H.jsx)(S,{className:`size-5`})}),(0,H.jsxs)(F,{open:G,onOpenChange:e=>{e?Ce():K(!1)},children:[(0,H.jsx)(te,{asChild:!0,children:(0,H.jsx)(`button`,{type:`button`,"aria-pressed":G,className:`touch-target rounded-lg p-2 text-fg-muted hover:bg-surface-hover hover:text-fg`,"aria-label":n?`正在做的事`:`Activity`,children:(0,H.jsx)(_,{className:`size-5`})})}),(0,H.jsx)(N,{children:(0,H.jsxs)(P,{side:`bottom`,align:`end`,sideOffset:8,collisionPadding:8,"aria-label":n?`派发的任务`:`Delegated tasks`,className:`z-50 flex h-[min(34rem,calc(100dvh-6rem))] w-[min(22rem,calc(100vw-1rem))] min-h-0 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay shadow-xl focus:outline-none`,children:[(0,H.jsxs)(`div`,{className:`flex shrink-0 items-start justify-between gap-3 px-6 pb-3 pt-6`,children:[(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`h2`,{className:`text-base font-semibold tracking-tight text-fg`,children:n?`交给我推进的事`:`Delegated work`}),(0,H.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:q?n?`最近更新 · 共 ${q.total} 项`:`Recently updated · ${q.total} total`:n?`查看任务进展与结果`:`Follow progress and results`})]}),(0,H.jsx)(I,{className:`touch-target -mr-2 -mt-1 rounded-lg p-2 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":n?`关闭活动`:`Close activity`,children:(0,H.jsx)(O,{className:`size-4`})})]}),(0,H.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-3 pb-5 pt-3`,children:[!q&&!Y&&(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(k,{className:`h-18 rounded-2xl`}),(0,H.jsx)(k,{className:`h-18 rounded-2xl`}),(0,H.jsx)(k,{className:`h-18 rounded-2xl`})]}),Y&&(0,H.jsxs)(`div`,{className:`px-5 py-12 text-center`,children:[(0,H.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n?`暂时无法读取任务`:`Could not load tasks`}),(0,H.jsx)(`button`,{type:`button`,onClick:()=>void Ce(),className:`mt-3 rounded-lg px-3 py-2 text-sm text-accent hover:bg-surface-hover`,children:n?`重试`:`Try again`})]}),q?.items.length===0&&(0,H.jsxs)(`div`,{className:`px-5 py-16 text-center`,children:[(0,H.jsx)(_,{className:`mx-auto size-7 text-fg-subtle`,"aria-hidden":!0}),(0,H.jsx)(`p`,{className:`mt-4 text-sm font-medium text-fg`,children:n?`还没有派发的任务`:`No delegated work yet`}),(0,H.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:n?`你可以在对话里直接告诉我想推进的事。`:`Tell me what you would like to move forward in chat.`})]}),q&&q.items.length>0&&(0,H.jsx)(`div`,{className:`space-y-2`,children:q.items.map(e=>(0,H.jsx)(pe,{item:e,zh:n},e.id))}),q&&Q<q.total&&(0,H.jsxs)(`div`,{className:`pt-4 text-center`,children:[(0,H.jsx)(`button`,{type:`button`,onClick:()=>void we(),disabled:X,className:`min-h-10 rounded-xl bg-surface-panel px-5 text-sm font-medium text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg disabled:opacity-50`,children:X?n?`正在加载…`:`Loading…`:n?`加载更多`:`Load more`}),ge&&(0,H.jsx)(`p`,{role:`alert`,className:`mt-2 text-xs text-danger`,children:n?`加载失败,请重试`:`Could not load more. Try again.`})]})]})]})})]}),(0,H.jsx)(`button`,{ref:R,type:`button`,onClick:be,"aria-expanded":B,className:`touch-target rounded-lg p-2 text-fg-muted hover:bg-surface-hover hover:text-fg`,"aria-label":n?`编辑资料`:`Edit profile`,children:(0,H.jsx)(T,{className:`size-5`})})]}):null}),()=>i()},[q,Y,Q,X,ge,A,i,we,Ce,c,r,G,B,be,e.active,n]);function Ee(){return c?(0,H.jsxs)(F,{open:B,onOpenChange:e=>{U(e),e||W(!1)},children:[(0,H.jsx)(ne,{virtualRef:R}),(0,H.jsx)(N,{children:(0,H.jsxs)(P,{side:`bottom`,align:`end`,sideOffset:8,collisionPadding:8,"aria-label":n?`编辑 Personal AI`:`Edit Personal AI`,onInteractOutside:e=>{e.target instanceof Node&&(R.current?.contains(e.target)||oe.current?.contains(e.target))&&e.preventDefault()},className:`z-50 flex w-[min(22rem,calc(100vw-1rem))] flex-col rounded-2xl border border-edge bg-surface-overlay shadow-xl outline-none`,children:[(0,H.jsxs)(`div`,{className:`relative flex shrink-0 flex-col items-center px-4 pt-4 text-center`,children:[(0,H.jsx)(`button`,{type:`button`,disabled:M,onClick:()=>W(e=>!e),"aria-expanded":ce,"aria-controls":`personal-appearance-options`,"aria-label":n?`选择头像`:`Choose avatar`,className:`rounded-full transition-opacity hover:opacity-80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:opacity-50`,children:(0,H.jsx)(C,{appearance:A,agentId:c.agentId,className:`size-16`})}),(0,H.jsx)(`input`,{id:`personal-name`,"aria-label":n?`助手名称`:`Assistant name`,value:se,onChange:e=>z(e.target.value),onBlur:e=>{let t=e.currentTarget.value.trim();t?(z(t),Se({displayName:t})):z(d.current?.displayName??``)},onKeyDown:e=>{e.key===`Enter`&&e.currentTarget.blur(),e.key===`Escape`&&(e.currentTarget.value=d.current?.displayName??``,z(e.currentTarget.value),e.currentTarget.blur())},maxLength:60,placeholder:`Ada`,className:`mt-2 w-full min-w-0 rounded-lg border border-transparent bg-transparent px-2 py-1 text-center text-lg font-semibold text-fg outline-none transition-colors hover:border-edge focus:border-edge focus:bg-surface-base focus-visible:ring-2 focus-visible:ring-accent`}),y>0&&(0,H.jsx)(`span`,{className:`absolute right-4 top-4 text-xs text-fg-muted`,children:n?`正在保存…`:`Saving…`})]}),(0,H.jsxs)(`div`,{className:`space-y-4 px-4 py-4`,children:[x&&(0,H.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:x}),ce&&(0,H.jsxs)(`section`,{id:`personal-appearance-options`,children:[(0,H.jsx)(`h3`,{className:`mb-3 text-sm font-medium text-fg`,children:n?`形象`:`Appearance`}),(0,H.jsxs)(`div`,{className:`grid grid-cols-4 gap-2`,children:[me.map(e=>(0,H.jsxs)(`button`,{type:`button`,onClick:()=>{j(e.id),W(!1),Se({appearance:e.id})},"aria-pressed":A===e.id,className:`flex min-w-0 flex-col items-center gap-1.5 rounded-xl px-1 py-2 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent ${A===e.id?`bg-accent/10 ring-1 ring-accent/40`:`bg-surface-panel hover:bg-surface-hover`}`,children:[(0,H.jsx)(`span`,{className:`flex size-8 items-center justify-center rounded-full ${e.color}`,children:(0,H.jsx)(C,{appearance:e.id,className:`size-8`})}),(0,H.jsx)(`span`,{className:`truncate text-xs text-fg-muted`,children:n?e.zh:e.en})]},e.id)),(0,H.jsx)(`input`,{ref:ie,type:`file`,accept:`image/png,image/jpeg,image/webp`,className:`sr-only`,"aria-label":n?`上传头像`:`Upload avatar`,onChange:e=>{let t=e.currentTarget.files?.[0];t&&Te(t),e.currentTarget.value=``}}),(0,H.jsxs)(`button`,{type:`button`,disabled:M,onClick:()=>ie.current?.click(),"aria-pressed":A===`custom`,className:`flex min-w-0 flex-col items-center gap-1.5 rounded-xl px-1 py-2 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:opacity-50 ${A===`custom`?`bg-accent/10 ring-1 ring-accent/40`:`bg-surface-panel hover:bg-surface-hover`}`,children:[(0,H.jsx)(`span`,{className:`flex size-8 items-center justify-center rounded-full bg-surface-panel`,children:A===`custom`?(0,H.jsx)(C,{appearance:`custom`,agentId:c.agentId,className:`size-8`}):(0,H.jsx)(D,{className:`size-4 text-fg-muted`,"aria-hidden":!0})}),(0,H.jsx)(`span`,{className:`truncate text-xs text-fg-muted`,children:M?n?`上传中…`:`Uploading…`:n?`上传`:`Upload`})]})]})]}),(0,H.jsx)(ue,{onGreetingChange:e=>Se({voiceCallPreferences:{openingGreetingEnabled:e}}),record:c,zh:n,onSelectVoice:e=>Se({voicePreference:e})}),(0,H.jsx)(`div`,{className:`border-t border-edge pt-4`,children:(0,H.jsx)(de,{conversationId:c.conversationId,zh:n,onSaved:async()=>{let e=await s(a(`/api/personal-agent`));e.ok&&e.payload&&(d.current=e.payload,u(e.payload))}})})]})]})})]}):null}return g?(0,H.jsxs)(`div`,{className:`mx-auto w-full max-w-2xl space-y-5 px-6 py-12`,children:[(0,H.jsx)(k,{className:`h-20 w-20 rounded-full`}),(0,H.jsx)(k,{className:`h-9 w-72`}),(0,H.jsx)(k,{className:`h-44 w-full rounded-2xl`})]}):c?.state===`ready`?(0,H.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col bg-surface-panel`,children:[E&&(0,H.jsxs)(`div`,{role:`alert`,className:`flex shrink-0 items-center justify-between gap-3 border-b border-warning/30 bg-warning/5 px-5 py-3 text-sm text-fg-muted`,children:[(0,H.jsx)(`span`,{children:n?`助手已创建,头像上传未完成。可在资料设置中重新上传。`:`Your assistant is ready. Upload the avatar again in profile settings.`}),(0,H.jsx)(`button`,{type:`button`,onClick:()=>{ee(!1),ye()},className:`shrink-0 text-accent hover:underline`,children:n?`打开设置`:`Open settings`})]}),(0,H.jsx)(`div`,{className:`flex min-h-0 flex-1`,children:(0,H.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,H.jsx)(l,{embedded:!0,personal:!0,personalWelcome:{name:c.displayName,addressAs:c.userCallName??void 0,avatar:(0,H.jsx)(C,{appearance:c.appearance,agentId:c.agentId,className:`size-14`}),opening:n?`有什么想讨论或推进的事?直接告诉我就好。`:`What would you like to discuss or move forward? Just tell me what is on your mind.`},conversationId:c.conversationId})})}),Ee()]}):(0,H.jsx)(le,{modelsAvailable:m.length>0,onCreated:(e,t)=>{d.current=e,u(e),z(e.displayName),ee(t),window.dispatchEvent(new CustomEvent(`personal-agent-updated`,{detail:e})),window.dispatchEvent(new Event(`session-updated`))}})}export{Y as PersonalPage};
|