@xopcai/xopc 0.0.422 → 0.0.424
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/dist/assets/{page-context-BKnEwsOO.js → page-context-b-rB5vJC.js} +1 -1
- package/dist/browser-ext/dist/background.js +1 -1
- package/dist/browser-ext/dist/sidepanel.html +1 -1
- package/dist/browser-ext/dist/sidepanel.js +29 -1
- 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-CvJ9rdwP.js → activity-store-AI081rxe.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-CFP6g4w7.js → agent-avatar-dicebear-DupnTbL7.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-display-BHBe88Gu.js → agent-avatar-display-CmEj6Uqy.js} +2 -2
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-IEV5yKuu.js +1 -0
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-C_Dm-u6_.js → agent-plugin-dialog-D_njOuFA.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-BdVJHOiK.js → agents-B_yg9nA3.js} +4 -4
- package/dist/gateway/static/root/assets/{agents-admin-api-Do1Pza0R.js → agents-admin-api-CUZUolwG.js} +1 -1
- package/dist/gateway/static/root/assets/{api-ONg37_fH.js → api-CWWEVThO.js} +1 -1
- package/dist/gateway/static/root/assets/{api-BQv5dLcH.js → api-bpQ7yR10.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-B4Wqhf4J.js → app-management-settings-panel-C0_hxwgg.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-Dm1kRzKL.js → appearance-settings-CLh-qnCC.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-D1MMk1P7.js → apps-page-Bjtm3Rgi.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-p_yLkyaC.js → archive-plugin-dGnstkhB.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-api-DQaWBR03.js → automation-api-MB2xCoFF.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-result-state-CO_243JM.js → automation-result-state-DJQflY78.js} +1 -1
- package/dist/gateway/static/root/assets/automation-task-card-DXgBxVE2.js +3 -0
- package/dist/gateway/static/root/assets/{automations-page-Ba64H37d.js → automations-page-D3O7M2FH.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-Dk3FVWoX.js +9 -0
- package/dist/gateway/static/root/assets/{binary-plugins-B-6kyqtt.js → binary-plugins-BrVJXmYf.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-B5ysJ96n.js → block-editor-Dok4sfT3.js} +2 -2
- package/dist/gateway/static/root/assets/{browser-automation-inputs-C2A3NIt3.js → browser-automation-inputs-PJbT3CxW.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-CnbXFw1_.js → browser-automations-page-kkpX1Q7K.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-control-api-Aj_seKE9.js → browser-control-api-Bg4wnkeA.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-C7fxPq_z.js → browser-settings-page-BrgX_Yb2.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-DOTgaSgA.js → capabilities-BMaJizw4.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-BgtCwC_E.js → capabilities-Cs6Jt5Gl.js} +1 -1
- package/dist/gateway/static/root/assets/capabilities-page-D5hvAG6D.js +2 -0
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-pYWZtPeU.js → capabilities-settings-panel-BrEvm4IH.js} +3 -3
- package/dist/gateway/static/root/assets/{channels-DGpRM6pj.js → channels-1jQgGVc9.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-agents-api-EvJ_Wvuc.js → chat-agents-api-BAOWaUJf.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-chart-block-BQDbHLcw.js → chat-chart-block-DeWrb9XR.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-page-GF9NIuZN.js → chat-page-CafkCKOj.js} +30 -30
- package/dist/gateway/static/root/assets/{chat-terminal-dock-DHFTGoEp.js → chat-terminal-dock-C544n0-R.js} +1 -1
- package/dist/gateway/static/root/assets/{command-palette-api-DPA_yEuy.js → command-palette-api-D9PXzY8b.js} +1 -1
- package/dist/gateway/static/root/assets/{composer-payload-handoff-BTjauSNp.js → composer-payload-handoff-CYXfjpem.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-BFSSQfcx.js → computer-settings-page-DJmod8-w.js} +1 -1
- package/dist/gateway/static/root/assets/connected-providers-grid-b46VH4uy.js +1 -0
- package/dist/gateway/static/root/assets/{connector-service-page-CFvg58qa.js → connector-service-page-BqDbTOTp.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-api-CbC6Yht5.js → connectors-api-CwRuUnH4.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-Mq9Bvoax.js +1 -0
- package/dist/gateway/static/root/assets/{date-picker-Dd3MbG0x.js → date-picker-DWaT0IC0.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-DcsHg2ml.js → dependency-picker-DV9XAt6F.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-DldzQT2h.js → desktop-pet-Dffq2NxL.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-CYdI4KxB.js → desktop-pet-settings-CrB1ICax.js} +1 -1
- package/dist/gateway/static/root/assets/{dev-view-store-JiJv585f.js → dev-view-store-liRgSkcT.js} +1 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-1du1hfi5.js +1 -0
- package/dist/gateway/static/root/assets/{directory-picker-path-field-8WOXv8zw.js → directory-picker-path-field-EKqQLQrE.js} +1 -1
- package/dist/gateway/static/root/assets/{discussion-annotation-sync-B-grSe0w.js → discussion-annotation-sync-D-b1X6ro.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-EEQkTNEu.js → extension-debug-page-wD97GeG0.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-iframe-host-vlZVeMCY.js → extension-iframe-host-B4Q1CjvW.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-marketplace-api-_o2In_al.js → extension-marketplace-api-ak1_K3u8.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-CPrT111s.js → extension-page-DWFI4iIh.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-B2Mf3FBu.js → extension-provider-BZwcaU5Y.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-CznJEgWV.js → extension-settings-page-cn4KS42C.js} +1 -1
- package/dist/gateway/static/root/assets/{file-preview-surface-7h8_fZul.js → file-preview-surface-c3gDD9sM.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-DbbNEOKj.js → gateway-config-swr-Dmt5JhZU.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-D20ZrAuM.js → gateway-realtime-CJtDXQCt.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-DcsZyYEa.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-restart-5ut-lhJm.js → gateway-restart-DInvvT5u.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-BCf_cibp.js → gateway-settings-BZXdv2FE.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-DlHL0DpH.js → gateway-startup-retry-s2KcWekp.js} +1 -1
- package/dist/gateway/static/root/assets/{global-defaults-api-CmODomcV.js → global-defaults-api-DtnmDd87.js} +1 -1
- package/dist/gateway/static/root/assets/{home-page-uz22TRB-.js → home-page-CAVjA5rO.js} +2 -2
- package/dist/gateway/static/root/assets/{image-generation-api-dzPnpUFu.js → image-generation-api-RQQokgE9.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-ChBoNMyE.js → imports-page-BP_4TubV.js} +1 -1
- package/dist/gateway/static/root/assets/index-BS9mjvSL.js +11 -0
- package/dist/gateway/static/root/assets/index-pT-m6l6b.css +1 -0
- package/dist/gateway/static/root/assets/{install-connector-dialog-CNcdQDX0.js → install-connector-dialog-BNzNuXJ8.js} +1 -1
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-CRbYq2_g.js → keyboard-shortcuts-settings-DNRQFepg.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-04cX5TJu.js → local-app-workbench-page-CvY5XxbX.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-fWM0FEhN.js → local-apps-page-DfwEvd8G.js} +1 -1
- package/dist/gateway/static/root/assets/local-session-drafts-CuDdIyxR.js +4 -0
- package/dist/gateway/static/root/assets/{locale-store-VNjH18Dj.js → locale-store-TQcz_Vjt.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-6GanGLrm.js → logs-page-eq49F1Rt.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-BxD_lc4E.js → management-settings-BaYXDMOJ.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-DLCBYWtx.js → markdown-view-D4nII6Zv.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-BvtNwKFb.js → media-plugins-MvlAY405.js} +1 -1
- package/dist/gateway/static/root/assets/messages-DaLmc4W1.js +3 -0
- package/dist/gateway/static/root/assets/model-selector-nsoNHqif.js +1 -0
- package/dist/gateway/static/root/assets/{models-hub-cache-_qE7L-_H.js → models-hub-cache-CFIazNIF.js} +1 -1
- package/dist/gateway/static/root/assets/note-detail-panel-KPzbHiEW.js +5 -0
- package/dist/gateway/static/root/assets/note-image-lightbox-DticJxxh.js +1 -0
- package/dist/gateway/static/root/assets/{notes-api-Bxa11X3a.js → notes-api-HVxR5bRD.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-D2QpJ3WZ.js → notes-page-yShJeR3i.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-api-DIE4UpP7.js → oauth-api-CfKjRVnb.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-provider-connect-B95tiddN.js → oauth-provider-connect-D4uqONWr.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-capture-button-C-QbbwmN.js → page-context-capture-button-B98nlKTc.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-draft-BHmOfksL.js → page-context-draft-HcuK45iu.js} +1 -1
- package/dist/gateway/static/root/assets/page-header-store-D6SzJ9Ch.js +1 -0
- package/dist/gateway/static/root/assets/{personal-avatar-nXrmMfrV.js → personal-avatar-_d72UP_d.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-page-BCwlYT3F.js → personal-page-B19h_3WQ.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-settings-panel-vkYmXK8h.js → personal-settings-panel-CfwtGyue.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-dependencies-card-CZDAxTWv.js → phone-dependencies-card-D8bqsDk_.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-picker-4Snfs8Hq.js → phone-model-picker-CL_Zn6Xd.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-settings-page-D8HperfA.js → phone-settings-page-C5Jia8eQ.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-workspace-store-Di9R9Ux5.js → phone-workspace-store-FBfrfkYq.js} +1 -1
- package/dist/gateway/static/root/assets/plugin-details-dialog-gAq2KPzK.js +1 -0
- package/dist/gateway/static/root/assets/{preference-select-fields-C6abaM3k.js → preference-select-fields-Ck8GAX_y.js} +1 -1
- package/dist/gateway/static/root/assets/{product-automation-feedback-C74s9Mjz.js → product-automation-feedback-BJ9oTnNs.js} +2 -2
- package/dist/gateway/static/root/assets/{product-open-page-AbDP5w1c.js → product-open-page-Dw9hUdxP.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-CktjvFbc.js → product-preview-content-C0iPzmSm.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-modal-CzsqLwB4.js → product-preview-modal-COFtHoh6.js} +2 -2
- package/dist/gateway/static/root/assets/{project-detail-page-Cf3tggGP.js → project-detail-page-C5Amjah-.js} +3 -3
- package/dist/gateway/static/root/assets/{project-understanding-jmhFbHch.js → project-understanding-DpL9ADQU.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-jMgZiFnO.js → projects-page-gGg9nM2t.js} +1 -1
- package/dist/gateway/static/root/assets/{providers-api-CJBYFKAK.js → providers-api-D6JJRlJb.js} +1 -1
- package/dist/gateway/static/root/assets/{recording-upload-Dl9a5yOV.js → recording-upload-DxX1xKyt.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-BwkbPUYu.js → registry-api-BfXzBR1D.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-BZA4StwC.js +1 -0
- package/dist/gateway/static/root/assets/{resource-unavailable-35wBZxmz.js → resource-unavailable-X-SIrZYI.js} +1 -1
- package/dist/gateway/static/root/assets/route-preload-CWRb0UCt.js +2 -0
- package/dist/gateway/static/root/assets/{runtime-tools-api-BF28JDAO.js → runtime-tools-api-1DjsPyQ5.js} +1 -1
- package/dist/gateway/static/root/assets/runtime-tools-settings-panel-BnCtyORj.js +1 -0
- package/dist/gateway/static/root/assets/{service-recommendation-list-CdaS4MPF.js → service-recommendation-list-ChSOfHHh.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-zJXYlRPt.js → session-api-rvY5aWw8.js} +1 -1
- package/dist/gateway/static/root/assets/session-manager-D2rbRfX3.js +23 -0
- package/dist/gateway/static/root/assets/sessions-page-DAS2IUGT.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-CYDQybNF.js +1 -0
- package/dist/gateway/static/root/assets/{settings-advanced-section-C84IghdL.js → settings-advanced-section-ZKRIuk7h.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-mode-store-CtQBJvbO.js → settings-mode-store-CtJ8pEfm.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-eEIz9InP.js → settings-page-B3pUce-_.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-header-CsPAYlqV.js → settings-page-header-DuNCn8i-.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-lPLeJQoV.js → settings-page-layout-DeNC8YHJ.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-Fc3vuz_h.js +1 -0
- package/dist/gateway/static/root/assets/{share-link-dialog-NaM6jvIz.js → share-link-dialog-B3hwjVAx.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-CHjZn27s.js → share-preview-page-D_9oFzGS.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-api-B9rVcV1y.js → shares-api-BoUpXmxq.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-Drfuvepz.js +1 -0
- package/dist/gateway/static/root/assets/{skill-api-D6zVfEuK.js → skill-api-By2HhJ9O.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-list-api-SLmTBYF5.js → skill-list-api-TaUCzS8Y.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-UQkq2orI.js → skill-reload-api-CN2fpS1n.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-Ca0pYZ4i.js → skills-page-LzGLique.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-BARWbjRN.js → system-settings-panel-Cuyg8Ml3.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-roqAsGue.js → task-detail-page-6A9337pK.js} +2 -2
- package/dist/gateway/static/root/assets/{task-result-evidence-Bb1F7nAM.js → task-result-evidence-DDubAU_5.js} +1 -1
- package/dist/gateway/static/root/assets/{terminal-panel-store-DYDeXXAg.js → terminal-panel-store-BNs75Wdr.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-DbStcH89.js → theme-store-DB1ZfBUm.js} +1 -1
- package/dist/gateway/static/root/assets/tracing-settings-page-TvtX4Goh.js +1 -0
- package/dist/gateway/static/root/assets/{tunnel-api-BK_ivyIb.js → tunnel-api-COoVEdV9.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-activity-store-p7Z7oq8z.js → understanding-activity-store-Dr_MLgYe.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-refresh-store-D-U6rcwZ.js → understanding-refresh-store-DGmLGEqw.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-URFSiswS.js → usage-page-DP6eb6ed.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-B7cbumro.js → use-autosave-itwjDYUb.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-DAtiwLsE.js → use-composer-attachments-hjIGlI_2.js} +1 -1
- package/dist/gateway/static/root/assets/{use-file-preview-expanded-B8erpWsX.js → use-file-preview-expanded-ClLa0g8D.js} +2 -2
- package/dist/gateway/static/root/assets/{use-personal-profile-DDW29nm-.js → use-personal-profile-vhWk6tTU.js} +1 -1
- package/dist/gateway/static/root/assets/{use-workspace-tree-DCoTf22f.js → use-workspace-tree-dfXXjA2-.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-D8dswPWd.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-DzYdJZN4.js → voice-api-key-field-BIfBySnN.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-wotvT6Hw.js → voice-config-api-J4o59ICE.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-input-shortcut-events-BI6PuiIB.js → voice-input-shortcut-events-B1mlpUdC.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-transcribe-api-DAK9eLRr.js → voice-transcribe-api-xxaSOOmq.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-BzmB9Rub.js → work-discovery-overlay-DqwT1E5u.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-page-CmGjxUIT.js → work-discovery-page-BzYQmPLT.js} +1 -1
- package/dist/gateway/static/root/assets/{working-directory-picker-modal-B-EHm52-.js → working-directory-picker-modal-D2Zf3GOG.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-api-uhiEMPpK.js → workspace-api-Bnx3eS2M.js} +2 -2
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-COUVwj-p.js +1 -0
- package/dist/gateway/static/root/assets/{workspace-file-preview-dialog-BDm06MZm.js → workspace-file-preview-dialog-D13qHzVr.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-open-location-menu-Bv83uoqu.js → workspace-open-location-menu-Cou-ig1H.js} +1 -1
- package/dist/gateway/static/root/assets/{xopc-cloud-account-card-Cd5GdpGL.js → xopc-cloud-account-card-DQGPKxHA.js} +1 -1
- package/dist/gateway/static/root/index.html +80 -80
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/clarification-questions.js +86 -0
- package/dist/packages/gateway-contract/src/clarifications.js +19 -0
- package/dist/packages/gateway-contract/src/index.js +1 -0
- package/dist/packages/gateway-contract/src/session-input-command.js +3 -0
- package/dist/src/agent/agent-manager.js +1 -1
- package/dist/src/agent/background-review/run-background-review.js +1 -1
- package/dist/src/agent/coding/repository-instructions.js +1 -1
- package/dist/src/agent/embedded/index.js +1 -1
- package/dist/src/agent/embedded/run-for-session.js +1 -1
- package/dist/src/agent/embedded/run-turn.js +3 -3
- package/dist/src/agent/embedded/session-tool-result-guard.js +2 -2
- package/dist/src/agent/embedded/tool-result-truncation.js +1 -1
- package/dist/src/agent/inbound/attachment-pipeline.js +1 -1
- package/dist/src/agent/memory/compaction.js +1 -1
- package/dist/src/agent/memory/context-budget.js +1 -1
- package/dist/src/agent/memory/context-recovery.js +1 -1
- package/dist/src/agent/memory/user-message-text.js +1 -1
- package/dist/src/agent/service/btw-query.js +1 -1
- package/dist/src/agent/service/direct-turn-helpers.js +1 -1
- package/dist/src/agent/service/process-direct-streaming.js +2 -2
- package/dist/src/agent/source-context/types.d.ts +1 -0
- package/dist/src/agent/tools/clarify-tool.js +43 -5
- package/dist/src/agent/tools/cli-clarify.js +1 -0
- package/dist/src/agent/tools/dataBatch.js +1 -1
- package/dist/src/agent/tools/personal-task-tool.d.ts +1 -1
- package/dist/src/agent/tools/phone-use-tool.js +2 -2
- package/dist/src/agent/tools/session-search-tool.js +1 -1
- package/dist/src/bootstrap/application-state.js +2 -2
- package/dist/src/cli/commands/gateway/run-foreground.js +2 -2
- package/dist/src/computer/diagnostics.d.ts +3 -3
- package/dist/src/computer/evaluation.d.ts +2 -2
- package/dist/src/connectors/learning-coordinator.js +1 -1
- package/dist/src/gateway/ephemeral-clarification-waiter.js +1 -0
- package/dist/src/gateway/hono/routes/composer-history.js +1 -1
- package/dist/src/gateway/hono/routes/connectors.js +1 -1
- package/dist/src/gateway/hono/routes/home.js +1 -1
- package/dist/src/gateway/hono/routes/phone.js +31 -6
- package/dist/src/gateway/hono/routes/public-gateway.js +2 -1
- package/dist/src/gateway/hono/routes/session-command-handler.js +1 -0
- package/dist/src/gateway/hono/routes/session-input-handler.d.ts +6 -0
- package/dist/src/gateway/hono/routes/tunnel.js +8 -1
- package/dist/src/gateway/hono/routes/user-model-refresh.js +1 -1
- package/dist/src/gateway/next-turn-suggestions/snapshot.js +1 -1
- package/dist/src/gateway/ports.js +6 -1
- package/dist/src/gateway/run-loop.js +0 -1
- package/dist/src/gateway/service/agent-runner.js +8 -3
- package/dist/src/gateway/service/run-gateway-agent.js +1 -1
- package/dist/src/gateway/service/session-input-coordinator.js +5 -4
- package/dist/src/phone/assistance.js +3 -0
- package/dist/src/phone/contracts.d.ts +4 -0
- package/dist/src/phone/runtime.d.ts +7 -1
- package/dist/src/phone/runtime.js +31 -24
- package/dist/src/routing/agent-session-key.js +1 -1
- package/dist/src/session/session-context-for-llm.js +1 -0
- package/dist/src/session/session-title.js +1 -1
- package/dist/src/storage/sqlite/clarification-wait-repository.js +45 -4
- package/dist/src/storage/sqlite/index.js +6 -6
- package/dist/src/storage/sqlite/session-creation-repository.js +1 -1
- package/dist/src/storage/sqlite/session-repository.js +1 -1
- package/dist/src/tasks/home-query-service.js +1 -1
- package/dist/src/tasks/task-allocation-repository.js +1 -1
- package/dist/src/tui/backends/embedded-backend.js +1 -1
- package/dist/src/tunnel/broker-client.d.ts +3 -0
- package/dist/src/tunnel/broker-client.js +14 -6
- package/dist/src/tunnel/frpc-process.js +54 -33
- package/dist/src/tunnel/tunnel-service.d.ts +5 -1
- package/dist/src/tunnel/tunnel-service.js +42 -17
- package/package.json +5 -4
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-DlGRuKMv.js +0 -1
- package/dist/gateway/static/root/assets/automation-task-card-D2p9qlYE.js +0 -3
- package/dist/gateway/static/root/assets/automations-workspace-BkzC3oIM.js +0 -9
- package/dist/gateway/static/root/assets/capabilities-page-m3b9sLFG.js +0 -2
- package/dist/gateway/static/root/assets/connected-providers-grid-DM2glQN3.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-D7pipFHA.js +0 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-D8cLc41G.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-C6sMzYDT.js +0 -1
- package/dist/gateway/static/root/assets/index-CSIg7V1A.js +0 -11
- package/dist/gateway/static/root/assets/index-Dv8mUlNN.css +0 -1
- package/dist/gateway/static/root/assets/local-session-drafts-ClrSe5mH.js +0 -1
- package/dist/gateway/static/root/assets/messages-Btr7C0hF.js +0 -3
- package/dist/gateway/static/root/assets/model-selector-DYUnp917.js +0 -1
- package/dist/gateway/static/root/assets/note-detail-panel-bjRZesmS.js +0 -5
- package/dist/gateway/static/root/assets/note-image-lightbox-D7Jqb75C.js +0 -1
- package/dist/gateway/static/root/assets/page-header-store-bPV8_tKL.js +0 -1
- package/dist/gateway/static/root/assets/plugin-details-dialog-DJsDu-_8.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-CBQ_bOy9.js +0 -1
- package/dist/gateway/static/root/assets/route-preload-BcA6SPeC.js +0 -2
- package/dist/gateway/static/root/assets/runtime-impact-DbySfhdp.js +0 -1
- package/dist/gateway/static/root/assets/runtime-tools-settings-panel-Bq2xQ2qd.js +0 -1
- package/dist/gateway/static/root/assets/session-manager-wWxpzSo0.js +0 -23
- package/dist/gateway/static/root/assets/sessions-page-BkjD_dUD.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BUMCEtA_.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-BSU5WpaE.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-5sB15V5v.js +0 -1
- package/dist/gateway/static/root/assets/tracing-settings-page-YfkNCxbP.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-DSV5NkNj.js +0 -2
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-DrPVyikA.js +0 -1
|
@@ -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{i,n as ee,o as a}from"./locale-store-VNjH18Dj.js";import{t as o}from"./popover-select-DD8fmrxH.js";import{t as te}from"./secret-input-BQvFXqzz.js";import{i as s}from"./vendor-swr-CdRzEUwF.js";import{t as c}from"./button-CnRSIP6m.js";import{t as l}from"./skeleton-BI5TyibZ.js";import{a as ne,i as re,n as ie,o as ae,r as u,s as oe,t as se}from"./dist-DfWfZ9iu.js";import{t as ce}from"./sliding-tab-list-DuQyViqe.js";import{t as d}from"./number-input-El7Szeln.js";import{n as le,t as ue}from"./settings-page-header-CsPAYlqV.js";import"./settings-page-layout-lPLeJQoV.js";import{n as f,t as de}from"./use-autosave-B7cbumro.js";var p=e(t(),1),m=n(),h=e=>i(`/api/observability/${e}`);async function g(e,t=`GET`,n){return a(h(e),{method:t,...n===void 0?{}:{body:JSON.stringify(n)}})}var _=r(),v=`w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg`,y=`space-y-4 rounded-xl border border-edge bg-surface-panel p-4`,b=(e=0)=>`${(e/1048576).toFixed(1)} MiB`;function x(){let e=(0,m.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,_.jsxs)(`div`,{"aria-busy":`true`,className:`space-y-4`,children:[(0,_.jsx)(l,{className:`h-48 rounded-xl`}),(0,_.jsx)(l,{className:`h-64 rounded-xl`})]}),e[0]=t):t=e[0],t}function fe(e,t){let n=0,r=e,i=new Set;for(;r.parentSpanId&&n<12&&!i.has(r.spanId);){i.add(r.spanId);let e=t.find(e=>e.spanId===r.parentSpanId);if(!e)break;r=e,n++}return n}function pe(e){let t=[],n=new Set;function r(i){n.has(i.spanId)||(n.add(i.spanId),t.push(i),e.filter(e=>e.parentSpanId===i.spanId).forEach(r))}return e.filter(t=>!t.parentSpanId||!e.some(e=>e.spanId===t.parentSpanId)).forEach(r),e.forEach(r),t}function S(){let e=ee(e=>e.language)===`zh`,t=(t,n)=>e?n:t,n=s(h(`tracing/settings`),()=>g(`tracing/settings`)),r=s(h(`tracing/status`),()=>g(`tracing/status`),{refreshInterval:1e4}),[i,a]=(0,p.useState)(),[m,S]=(0,p.useState)(),C=i??m??n.data?.config,[w,T]=(0,p.useState)(``),[E,D]=(0,p.useState)(``),[me,he]=(0,p.useState)(0),[O,ge]=(0,p.useState)(!1),[k,A]=(0,p.useState)(``),[_e,j]=(0,p.useState)(!1),[M,ve]=(0,p.useState)(``),[N,ye]=(0,p.useState)(`7`),[P,be]=(0,p.useState)({conversationId:``,runId:``,agentId:``}),[F,I]=(0,p.useState)(`records`),[L,xe]=(0,p.useState)(`10`),[Se,Ce]=(0,p.useState)([``]),[R,z]=(0,p.useState)(0),[we,Te]=(0,p.useState)(()=>Date.now()+1),B=Se[R],[V,H]=(0,p.useState)();function U(){Ce([``]),z(0),Te(Date.now()+1)}let[Ee,W]=(0,p.useState)(!1),G=new URLSearchParams({limit:L,from:String(we-Number(N)*864e5),to:String(we)});M&&G.set(`status`,M),B&&G.set(`cursor`,B);for(let[e,t]of Object.entries(P))t&&G.set(e,t);let De=`traces?${G}`,K=s(h(De),()=>g(De),{refreshInterval:B?0:1e4}),q=s(V?h(`traces/${V}`):null,()=>g(`traces/${V}`));function J(e){if(!C)return;let t=structuredClone(C);e(t),a(t)}async function Y(e,i=t(`Saved`,`已保存`)){ge(!0),A(``),j(!1);try{await e(),A(i),await Promise.all([n.mutate(),r.mutate(),K.mutate()])}catch(e){j(!0),A(e instanceof Error?e.message:t(`Request failed`,`操作失败`))}finally{ge(!1)}}let X=de({value:C??null,dirty:!!(i&&JSON.stringify(i)!==JSON.stringify(m??n.data?.config)),validate:e=>{if([[`retentionDays`,1,90],[`maxStoreMiB`,16,4096],[`maxTraces`,10,1e5],[`maxSpans`,100,1e6],[`maxTraceKiB`,16,4096],[`maxWriteMiBPerMinute`,1,100]].some(([t,n,r])=>!Number.isInteger(e.local[t])||e.local[t]<n||e.local[t]>r))return t(`Enter valid storage limits before continuing.`,`请填写有效的存储限额。`);try{let t=new URL(e.langfuse.baseUrl);if(![`http:`,`https:`].includes(t.protocol)||e.langfuse.baseUrl.length>2048)throw Error()}catch{return t(`Enter a valid HTTP(S) Base URL.`,`请填写有效的 HTTP(S) Base URL。`)}return null},onSave:async e=>{let t=await g(`tracing/settings`,`PATCH`,e);S(t.config),a(t=>t&&JSON.stringify(t)===JSON.stringify(e)?void 0:t),await r.mutate().catch(()=>{})}}),Z=(0,p.useMemo)(()=>({publicKey:w.trim(),secretKey:E.trim()}),[w,E]),Q=de({value:Z,dirty:!!(Z.publicKey||Z.secretKey),delayMs:1e3,validate:e=>e.publicKey.length>512||e.secretKey.length>512?t(`Credentials must be at most 512 characters.`,`凭证长度不能超过 512 个字符。`):null,onSave:async e=>{await g(`tracing/langfuse/credentials`,`PUT`,{...e.publicKey?{publicKey:e.publicKey}:{},...e.secretKey?{secretKey:e.secretKey}:{}}),T(t=>t.trim()===e.publicKey?``:t),D(t=>t.trim()===e.secretKey?``:t),he(e=>e+1),await Promise.allSettled([n.mutate(),r.mutate()])}}),$=[X.status,Q.status].some(e=>e===`dirty`||e===`saving`);async function Oe(){V&&await Y(async()=>{let e=await g(`traces/${V}/export`),t=URL.createObjectURL(new Blob([JSON.stringify(e,null,2)],{type:`application/json`})),n=document.createElement(`a`);n.href=t,n.download=`trace-${V}.json`,n.click(),URL.revokeObjectURL(t)},t(`Exported`,`已导出`))}return(0,_.jsxs)(le,{className:`space-y-6`,children:[(0,_.jsx)(ue,{title:t(`Runtime tracing`,`运行追踪`),subtitle:t(`Local diagnostics with bounded retention. Enable Langfuse to also export new traces.`,`默认保留有界本地记录;启用 Langfuse 后同时导出新采集的追踪。`),actions:F===`settings`?(0,_.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,_.jsx)(`span`,{className:`text-xs text-fg-muted`,children:t(`Changes save automatically`,`修改后自动保存`)}),(0,_.jsx)(f,{status:X.status,error:X.error})]}):(0,_.jsx)(c,{disabled:K.isValidating,onClick:U,children:t(`Refresh records`,`刷新记录`)})}),k&&(0,_.jsx)(`p`,{role:_e?`alert`:`status`,className:`text-sm text-fg-muted`,children:k}),n.error&&(0,_.jsxs)(`div`,{role:`alert`,className:y,children:[(0,_.jsx)(`p`,{children:t(`Unable to load tracing settings.`,`无法加载追踪设置。`)}),(0,_.jsx)(c,{variant:`ghost`,onClick:()=>void n.mutate(),children:t(`Retry loading settings`,`重新加载设置`)})]}),(0,_.jsxs)(ce,{as:`nav`,"aria-label":t(`Tracing sections`,`追踪页面分区`),className:`flex gap-2 border-b border-edge pb-3`,children:[(0,_.jsx)(c,{"aria-pressed":F===`records`,variant:`ghost`,onClick:()=>I(`records`),children:t(`Execution records`,`执行记录`)}),(0,_.jsx)(c,{"aria-pressed":F===`settings`,variant:`ghost`,onClick:()=>I(`settings`),children:t(`Capture settings`,`采集设置`)})]}),F===`settings`&&(C?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(`section`,{className:y,onBlurCapture:X.onBlurCapture,children:[(0,_.jsx)(`h2`,{className:`font-medium`,children:t(`Local recording`,`本地记录`)}),X.error&&(0,_.jsx)(c,{variant:`ghost`,onClick:X.retry,children:t(`Retry autosave`,`重试自动保存`)}),(0,_.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,_.jsx)(`input`,{type:`checkbox`,checked:C.enabled,onChange:e=>J(t=>{t.enabled=e.target.checked})}),t(`Record traces`,`记录运行追踪`)]}),(0,_.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-3`,children:[(0,_.jsxs)(`label`,{className:`space-y-1 text-sm`,children:[t(`Retention (days)`,`保留天数`),(0,_.jsx)(d,{className:v,type:`number`,min:1,max:90,value:C.local.retentionDays,onChange:e=>J(t=>{t.local.retentionDays=Number(e.target.value)})})]}),(0,_.jsxs)(`label`,{className:`space-y-1 text-sm`,children:[t(`Storage budget (MiB)`,`存储上限(MiB)`),(0,_.jsx)(d,{className:v,type:`number`,min:16,max:4096,value:C.local.maxStoreMiB,onChange:e=>J(t=>{t.local.maxStoreMiB=Number(e.target.value)})})]}),(0,_.jsxs)(`label`,{className:`space-y-1 text-sm`,children:[t(`Capture`,`采集内容`),(0,_.jsx)(o,{placeholder:t(`Choose`,`请选择`),allowEmpty:!1,value:C.capture,onChange:e=>J(t=>{t.capture=e}),options:[{value:`metadata`,label:t(`Metadata only`,`仅元数据`)},{value:`redacted`,label:t(`Redacted previews`,`脱敏摘要`)},{value:`detailed`,label:t(`Detailed · 30 minutes`,`详细记录 · 30 分钟`)}]})]})]}),(0,_.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t(`Previews may contain personal content. Secrets and media are filtered; large values are truncated.`,`摘要可能包含个人内容。过滤凭证和媒体,超长内容会截断。`)}),C.detailedUntil&&(0,_.jsxs)(`p`,{className:`text-sm text-fg-muted`,children:[t(`Detailed capture expires: `,`详细采集截止:`),new Date(C.detailedUntil).toLocaleString()]}),(0,_.jsxs)(`details`,{children:[(0,_.jsx)(`summary`,{className:`cursor-pointer text-sm`,children:t(`Advanced limits`,`高级限制`)}),(0,_.jsx)(`div`,{className:`mt-3 grid gap-3 sm:grid-cols-2`,children:[[`maxTraces`,t(`Trace count`,`Trace 条数`)],[`maxSpans`,t(`Span count`,`Span 条数`)],[`maxTraceKiB`,t(`Per trace (KiB)`,`单 Trace 上限(KiB)`)],[`maxWriteMiBPerMinute`,t(`Write budget (MiB/minute)`,`写入额度(MiB/分钟)`)]].map(([e,t])=>(0,_.jsxs)(`label`,{className:`space-y-1 text-sm`,children:[t,(0,_.jsx)(d,{type:`number`,min:1,className:v,value:C.local[e],onChange:t=>J(n=>{n.local[e]=Number(t.target.value)})})]},e))})]}),r.data?(0,_.jsxs)(`p`,{className:`text-sm text-fg-muted`,children:[t(`Disk / payload`,`磁盘 / 数据`),`:`,b(r.data.local.physicalBytes),` / `,b(r.data.local.bytes),` · `,r.data.local.traces??0,` traces · `,r.data.local.spans??0,` spans · `,t(`Dropped`,`丢弃`),` `,Number(r.data.local.dropped??0)+Number(r.data.local.queueDropped??0),(r.data.local.paused||r.data.local.unavailable)&&` · ${t(`Recording paused`,`存储暂停`)}`]}):(0,_.jsx)(l,{className:`h-10`}),(r.error||r.data?.local.lastError)&&(0,_.jsxs)(`div`,{className:`space-y-2 text-sm`,children:[(0,_.jsx)(`p`,{role:`alert`,children:r.data?.local.lastError?t(`Trace recording is unavailable.`,`追踪记录异常。`):t(`Unable to load recording status.`,`无法获取记录状态。`)}),(0,_.jsx)(c,{variant:`ghost`,onClick:()=>void r.mutate(),children:t(`Refresh recording status`,`刷新记录状态`)}),(0,_.jsxs)(`details`,{children:[(0,_.jsx)(`summary`,{className:`cursor-pointer text-fg-muted`,children:t(`Technical details`,`技术详情`)}),(0,_.jsx)(`p`,{className:`mt-2 break-words text-fg-muted`,children:r.data?.local.lastError||String(r.error?.message)})]})]}),(0,_.jsxs)(`div`,{className:`flex gap-2`,children:[(0,_.jsx)(c,{disabled:O||$,onClick:()=>void Y(async()=>{await g(`traces/prune`,`POST`)}),children:t(`Clean expired`,`清理过期记录`)}),(0,_.jsx)(c,{disabled:O,onClick:()=>W(!0),children:t(`Clear local traces`,`清空本地追踪`)})]})]}),(0,_.jsxs)(`section`,{className:y,children:[(0,_.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,_.jsx)(`h2`,{className:`font-medium`,children:`Langfuse`}),(0,_.jsx)(f,{status:Q.status,error:Q.error})]}),Q.error&&(0,_.jsx)(c,{variant:`ghost`,onClick:Q.retry,children:t(`Retry autosave`,`重试自动保存`)}),(0,_.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,_.jsx)(`input`,{type:`checkbox`,checked:C.langfuse.enabled,onBlur:X.onBlurCapture,onChange:e=>J(t=>{t.langfuse.enabled=e.target.checked})}),t(`Also export new traces to Langfuse`,`同时导出新采集的追踪到 Langfuse`)]}),(0,_.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,_.jsxs)(`label`,{className:`space-y-1 text-sm sm:col-span-2`,children:[`Base URL`,(0,_.jsx)(`input`,{className:v,type:`url`,value:C.langfuse.baseUrl,onBlur:X.onBlurCapture,onChange:e=>J(t=>{t.langfuse.baseUrl=e.target.value})})]}),[`publicKey`,`secretKey`].map(e=>{let r=e===`publicKey`?`Public Key`:`Secret Key`,i=e===`publicKey`?w:E,ee=n.data?.credentials[e===`publicKey`?`publicKeyConfigured`:`secretKeyConfigured`];return(0,_.jsxs)(`div`,{className:`space-y-1 text-sm`,onBlurCapture:Q.onBlurCapture,children:[(0,_.jsx)(`label`,{htmlFor:`langfuse-${e}`,children:r}),(0,_.jsx)(te,{id:`langfuse-${e}`,value:i||(ee?`••••••••••••`:``),allowUnrevealedCopy:!0,onChange:t=>(e===`publicKey`?T:D)(t.replace(/^•+/,``)),placeholder:e===`publicKey`?`pk-lf-…`:`sk-lf-…`,labels:{show:t(`Show ${r}`,`查看 ${r}`),hide:t(`Hide ${r}`,`隐藏 ${r}`),copy:t(`Copy ${r}`,`复制 ${r}`),copied:t(`Copied`,`已复制`)},reveal:()=>g(`tracing/langfuse/credentials/${e}/reveal`,`POST`).then(e=>e.key),loadFailedLabel:t(`Unable to load the configured key.`,`无法读取已配置的 Key。`),notInConfigFile:t(`No configured key is available.`,`暂无已配置的 Key。`)},me)]},e)})]}),(0,_.jsxs)(`p`,{className:`text-sm text-fg-muted`,children:[t(`Credential sources`,`凭证来源`),`:`,n.data?.credentials.publicKeySource,` / `,n.data?.credentials.secretKeySource,` · URL: `,n.data?.credentials.baseUrlSource]}),r.data&&(0,_.jsxs)(`p`,{className:`text-sm text-fg-muted`,children:[r.data.langfuse.state,` · `,t(`Pending`,`待发送`),` `,r.data.langfuse.pending,` · `,t(`Dropped`,`丢弃`),` `,r.data.langfuse.dropped,r.data.langfuse.lastSuccess?` · ${new Date(r.data.langfuse.lastSuccess).toLocaleString()}`:``]}),r.data?.langfuse.lastError&&(0,_.jsxs)(`div`,{className:`space-y-2 text-sm`,children:[(0,_.jsx)(`p`,{role:`alert`,children:t(`Unable to export traces.`,`无法导出追踪。`)}),(0,_.jsxs)(`details`,{children:[(0,_.jsx)(`summary`,{className:`cursor-pointer text-fg-muted`,children:t(`Technical details`,`技术详情`)}),(0,_.jsx)(`p`,{className:`mt-2 break-words text-fg-muted`,children:r.data.langfuse.lastError})]})]}),(0,_.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t(`Changes save automatically. Historical traces are not uploaded. Offline exports may be dropped.`,`修改后自动保存。不会上传历史记录;断网或队列满时可能丢弃远端导出。`)}),(0,_.jsxs)(`div`,{className:`flex gap-2`,children:[(0,_.jsx)(c,{disabled:O||$,onClick:()=>void Y(async()=>{if(!(await g(`tracing/langfuse/test`,`POST`)).ok)throw Error(t(`Connection test failed. Check saved configuration and credentials.`,`连接测试失败,请检查已保存的配置和凭证。`))},t(`Diagnostic trace accepted by the ingestion endpoint`,`采集端已接受诊断追踪`)),children:t(`Test connection`,`测试连接`)}),(0,_.jsx)(c,{disabled:O||$,onClick:()=>void Y(async()=>{await g(`tracing/langfuse/credentials`,`DELETE`),T(``),D(``),he(e=>e+1)}),children:t(`Remove saved credentials`,`移除已保存凭证`)})]})]})]}):(0,_.jsx)(x,{})),F===`records`&&(0,_.jsxs)(`section`,{className:y,children:[(0,_.jsx)(`h2`,{className:`font-medium`,children:t(`Recent runs`,`最近执行`)}),(0,_.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:[(0,_.jsxs)(`label`,{className:`space-y-1 text-sm`,children:[t(`Status`,`执行状态`),(0,_.jsx)(o,{placeholder:t(`All statuses`,`全部状态`),allowEmpty:!1,value:M,onChange:e=>{ve(e),U()},options:[{value:``,label:t(`All statuses`,`全部状态`)},...[`running`,`success`,`error`,`cancelled`,`suspended`,`interrupted`].map(e=>({value:e,label:t(e,{running:`运行中`,success:`成功`,error:`失败`,cancelled:`已取消`,suspended:`已暂停`,interrupted:`已中断`}[e])}))]})]}),(0,_.jsxs)(`label`,{className:`space-y-1 text-sm`,children:[t(`Time range`,`时间范围`),(0,_.jsx)(o,{placeholder:t(`Choose`,`请选择`),value:N,allowEmpty:!1,onChange:e=>{ye(e),U()},options:[`1`,`7`,`30`,`90`].map(e=>({value:e,label:`${e} ${t(`days`,`天`)}`}))})]}),(0,_.jsxs)(`label`,{className:`space-y-1 text-sm`,children:[t(`Page size`,`每页条数`),(0,_.jsx)(o,{placeholder:t(`Choose`,`请选择`),value:L,allowEmpty:!1,onChange:e=>{xe(e),U()},options:[`10`,`20`].map(e=>({value:e,label:`${e} ${t(`records`,`条`)}`}))})]})]}),(0,_.jsxs)(`details`,{children:[(0,_.jsxs)(`summary`,{className:`cursor-pointer text-sm text-fg-muted`,children:[t(`Advanced filters`,`高级筛选`),Object.values(P).some(Boolean)?` · ${t(`Active`,`已启用`)}`:``]}),(0,_.jsx)(`div`,{className:`mt-3 grid gap-3 sm:grid-cols-3`,children:[`conversationId`,`runId`,`agentId`].map(e=>(0,_.jsxs)(`label`,{className:`space-y-1 text-sm`,children:[{conversationId:t(`Conversation ID`,`会话 ID`),runId:t(`Run ID`,`执行 ID`),agentId:t(`Agent ID`,`Agent ID`)}[e],(0,_.jsx)(`input`,{"aria-label":e,placeholder:t(`Exact ID`,`输入完整 ID`),className:v,value:P[e],onChange:t=>{be({...P,[e]:t.target.value}),U()}})]},e))})]}),(0,_.jsxs)(`details`,{className:`text-xs text-fg-muted`,children:[(0,_.jsx)(`summary`,{className:`w-fit cursor-pointer rounded focus-visible:outline-accent`,children:t(`About costs`,`费用说明`)}),(0,_.jsxs)(`p`,{className:`mt-2 leading-5`,children:[t(`Amounts are shown in USD. Cloud charges use Credits receipts.`,`金额以美元显示,Cloud 扣费以 Credits 凭证为准。`),` `,(0,_.jsx)(`a`,{className:`text-accent-fg hover:underline`,href:`#/settings/usage`,children:t(`View usage`,`查看用量`)})]})]}),(0,_.jsxs)(`div`,{role:`region`,"aria-label":t(`Execution results`,`执行结果`),"aria-busy":K.isValidating,className:`h-[24rem] min-h-0 overflow-y-auto overscroll-contain rounded-lg border border-edge sm:h-[28rem]`,children:[K.error&&(0,_.jsxs)(`div`,{role:`alert`,className:`space-y-3 p-4 text-sm`,children:[(0,_.jsx)(`p`,{children:t(`Unable to load execution records.`,`无法加载执行记录。`)}),(0,_.jsx)(c,{variant:`ghost`,onClick:()=>void K.mutate(),disabled:K.isValidating,children:t(`Retry loading records`,`重新加载记录`)})]}),!K.data&&!K.error?(0,_.jsx)(`div`,{className:`space-y-3 p-3`,children:[0,1,2,3,4].map(e=>(0,_.jsx)(l,{className:`h-16`},e))}):(0,_.jsxs)(`div`,{className:`divide-y divide-edge`,children:[K.data?.traces.length===0&&(0,_.jsx)(`p`,{className:`flex h-48 items-center justify-center px-4 text-sm text-fg-muted`,children:t(`No traces in this range`,`此时间范围内暂无记录`)}),K.data?.traces.map(n=>(0,_.jsxs)(`button`,{onClick:()=>H(n.traceId),className:`flex w-full flex-col gap-2 px-3 py-3 text-left text-sm hover:bg-surface-hover sm:flex-row sm:items-center sm:justify-between`,children:[(0,_.jsxs)(`div`,{className:`min-w-0`,children:[(0,_.jsxs)(`p`,{className:`truncate font-medium`,children:[n.name,n.attributes[`xopc.agentId`]?` · ${n.attributes[`xopc.agentId`]}`:``]}),(0,_.jsxs)(`p`,{className:`truncate text-xs text-fg-muted`,children:[new Date(n.startedAt).toLocaleString(e?`zh-CN`:`en-US`),` · `,n.traceId]}),n.stats&&(0,_.jsxs)(`p`,{className:`text-xs text-fg-muted`,children:[n.stats.generations,` `,t(`model calls`,`次模型调用`),` · `,n.stats.tokens,` tokens · `,n.stats.unknownCostCalls>0?`${t(`Cost pending`,`费用待确认`)}${n.stats.knownCostUsd>0?` · ${t(`known portion`,`已知部分`)} ${n.stats.knownCostUsd.toFixed(4)}`:``}`:`$${n.stats.knownCostUsd.toFixed(4)}`]})]}),(0,_.jsxs)(`span`,{className:`shrink-0 text-xs text-fg-muted`,children:[t(n.status,{running:`运行中`,success:`成功`,error:`失败`,cancelled:`已取消`,suspended:`已暂停`,interrupted:`已中断`}[n.status]??n.status),` · `,n.endedAt?`${Math.round(n.endedAt-n.startedAt)} ms`:`—`,n.partialReason?` · ${t(`Partial`,`部分记录`)}`:``]})]},n.traceId))]})]}),(0,_.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,_.jsx)(`p`,{"aria-live":`polite`,className:`text-xs text-fg-muted`,children:t(`Page ${R+1} · ${K.data?.traces.length??0} records`,`第 ${R+1} 页 · ${K.data?.traces.length??0} 条`)}),(0,_.jsxs)(`div`,{className:`flex gap-2`,children:[(0,_.jsx)(c,{disabled:R===0||K.isValidating,onClick:()=>z(e=>Math.max(0,e-1)),children:t(`Previous page`,`上一页`)}),(0,_.jsx)(c,{disabled:!K.data?.nextCursor||K.isValidating,onClick:()=>{let e=K.data?.nextCursor;e&&(Ce(t=>[...t.slice(0,R+1),e]),z(e=>e+1))},children:t(`Next page`,`下一页`)})]})]})]}),(0,_.jsx)(se,{open:!!V,onOpenChange:e=>{e||H(void 0)},children:(0,_.jsxs)(ae,{children:[(0,_.jsx)(ne,{className:`fixed inset-0 z-[90] bg-black/40`}),(0,_.jsxs)(u,{className:`fixed left-1/2 top-1/2 z-[91] flex h-[min(44rem,calc(100vh-2rem))] w-[min(64rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay p-4`,children:[(0,_.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-3`,children:[(0,_.jsx)(oe,{className:`font-medium`,children:t(`Trace details`,`追踪详情`)}),(0,_.jsx)(ie,{asChild:!0,children:(0,_.jsx)(c,{children:t(`Close`,`关闭`)})})]}),(0,_.jsx)(re,{className:`shrink-0 truncate text-xs text-fg-muted`,children:V}),(0,_.jsx)(`div`,{className:`min-h-0 flex-1 space-y-3 overflow-y-auto py-4`,children:q.error?(0,_.jsxs)(`div`,{role:`alert`,className:`space-y-3`,children:[(0,_.jsx)(`p`,{children:t(`Unable to load this record.`,`无法加载此记录。`)}),(0,_.jsx)(c,{variant:`ghost`,onClick:()=>void q.mutate(),children:t(`Retry loading record`,`重新加载此记录`)})]}):q.data?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(`p`,{className:`text-sm`,children:[q.data.trace.status,` `,q.data.trace.partialReason&&` · ${q.data.trace.partialReason}`]}),pe(q.data.spans).map(e=>(0,_.jsxs)(`details`,{style:{marginLeft:fe(e,q.data.spans)*12},className:`rounded-lg border border-edge p-3 text-sm`,children:[(0,_.jsxs)(`summary`,{className:`cursor-pointer`,children:[e.name,` · `,e.status,` · `,e.endedAt?`${Math.round(e.endedAt-e.startedAt)} ms`:`—`]}),(0,_.jsx)(`pre`,{className:`mt-3 whitespace-pre-wrap break-all text-xs text-fg-muted`,children:JSON.stringify(e.attributes,null,2)})]},e.spanId))]}):(0,_.jsx)(x,{})}),(0,_.jsx)(`div`,{className:`shrink-0 border-t border-edge pt-3`,children:(0,_.jsx)(c,{disabled:!q.data||O,onClick:()=>void Oe(),children:t(`Export JSON`,`导出 JSON`)})})]})]})}),(0,_.jsx)(se,{open:Ee,onOpenChange:W,children:(0,_.jsxs)(ae,{children:[(0,_.jsx)(ne,{className:`fixed inset-0 z-[90] bg-black/40`}),(0,_.jsxs)(u,{className:`fixed left-1/2 top-1/2 z-[91] w-[min(28rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 space-y-4 rounded-xl border border-edge bg-surface-overlay p-5`,children:[(0,_.jsx)(oe,{children:t(`Clear local traces?`,`清空本地追踪?`)}),(0,_.jsx)(re,{className:`text-sm text-fg-muted`,children:t(`Removes retained local traces. Conversations, usage records and Langfuse data remain available.`,`删除已保留的本地追踪。会话、用量记录及 Langfuse 数据仍保留。`)}),(0,_.jsxs)(`div`,{className:`flex gap-2`,children:[(0,_.jsx)(c,{disabled:O||$,onClick:()=>void Y(async()=>{await g(`traces`,`DELETE`),W(!1),H(void 0)}),children:t(`Clear`,`清空`)}),(0,_.jsx)(ie,{asChild:!0,children:(0,_.jsx)(c,{children:t(`Cancel`,`取消`)})})]})]})]})})]})}export{S as TracingSettingsPage};
|
|
@@ -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{l as i,m as a,t as o}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{i as s,n as c,o as l}from"./locale-store-VNjH18Dj.js";import{t as u}from"./book-open-CCGtrT3R.js";import{t as d}from"./bot-DjLkhyZL.js";import{C as f,S as p,_ as m,a as h,b as g,c as _,d as v,f as y,g as b,h as x,i as S,l as C,m as w,n as T,o as E,p as D,r as O,s as k,t as A,v as j,x as M,y as N}from"./understanding-refresh-store-D-U6rcwZ.js";import{t as P}from"./briefcase-business-BsoCaI_t.js";import{t as F}from"./calendar-days-hw_Y-g-s.js";import{t as ee}from"./check-DUBLcKHA.js";import{t as I}from"./chevron-down-ccbiQQz_.js";import{t as L}from"./chevron-right-BweFrslA.js";import{n as R,r as z,t as B}from"./popover-select-DD8fmrxH.js";import{t as V}from"./circle-alert-BEjgurr2.js";import{t as H}from"./circle-check-C23XjkUj.js";import{t as U}from"./clock-3-DnrAnuyZ.js";import{t as W}from"./database-CjjeZfRG.js";import{t as te}from"./download-Dk-ZjtO6.js";import{t as ne}from"./earth-BMhZtzcj.js";import{t as G}from"./ellipsis-0k4rZLoy.js";import{m as re,p as K,t as ie}from"./understanding-activity-store-p7Z7oq8z.js";import{t as q}from"./folder-open-CyzJ19I9.js";import{t as ae}from"./git-branch-Dh9uxTot.js";import{t as oe}from"./list-todo-CTVRto8O.js";import{t as se}from"./loader-circle-CifKLtgG.js";import{t as ce}from"./lock-keyhole-DEK5kH0u.js";import{t as le}from"./message-circle-Badhj-4D.js";import{t as ue}from"./pencil-DmIY3Oa-.js";import{t as de}from"./plus-Q2yW6OE7.js";import{t as fe}from"./refresh-cw-BRlGaq2w.js";import{t as pe}from"./search-DA7gz22f.js";import{t as me}from"./shield-check-BU58siTV.js";import{t as he}from"./sliders-horizontal-DqsYor6I.js";import{t as ge}from"./sparkles-DHlfQFAF.js";import{t as _e}from"./sticky-note-fzP7NAJq.js";import{t as ve}from"./trash-2-DusmjVPV.js";import{t as ye}from"./upload-rrb46c3c.js";import{t as be}from"./user-round-C9jxPhMR.js";import{t as xe}from"./x-B_N4OPjy.js";import{t as Se}from"./cn-0WouolD0.js";import{i as Ce}from"./vendor-swr-CdRzEUwF.js";import{t as J}from"./button-CnRSIP6m.js";import{t as we}from"./skeleton-BI5TyibZ.js";import{a as Te,c as Ee,i as De,n as Oe,o as ke,r as Ae,s as je,t as Me}from"./dist-DfWfZ9iu.js";import{r as Ne}from"./app-chrome-BeB4KgOf.js";import{t as Pe}from"./page-tabs-oeTY7z3_.js";import{t as Fe}from"./page-header-store-bPV8_tKL.js";import{t as Ie}from"./loopi-CNtmi9FU.js";import{t as Le}from"./sliding-tab-list-DuQyViqe.js";import{l as Re,m as ze,o as Be,r as Ve,t as He}from"./dist-D3lWNSe7.js";import{t as Ue}from"./date-picker-Dd3MbG0x.js";var Y=e(t(),1),X=n(),Z=r();function We(e){let t=(0,X.c)(15),{sourceId:n,disabled:r}=e,i=r!==void 0&&r,a=c(Ke)===`zh`,{sources:o,starting:s,start:l}=A(),u;t[0]!==n||t[1]!==o?(u=n?o.filter(e=>e.grantId===n):o,t[0]=n,t[1]=o,t[2]=u):u=t[2];let d=u,f;t[3]===d?f=t[4]:(f=d.some(Q),t[3]=d,t[4]=f);let p=f,m=n&&d.some(Ge),h=p?a?`更新中`:`Updating`:m?a?`重试`:`Retry`:n?a?`更新理解`:`Update understanding`:a?`更新全部`:`Update all`,g=i||s||p,_;t[5]!==n||t[6]!==l?(_=()=>void l(n),t[5]=n,t[6]=l,t[7]=_):_=t[7];let v;t[8]===p?v=t[9]:(v=p?(0,Z.jsx)(se,{className:`size-3.5 animate-spin motion-reduce:animate-none`}):(0,Z.jsx)(fe,{className:`size-3.5`}),t[8]=p,t[9]=v);let y;return t[10]!==h||t[11]!==g||t[12]!==_||t[13]!==v?(y=(0,Z.jsxs)(J,{variant:`ghost`,className:`h-8 shrink-0 gap-1.5 px-2 text-xs`,disabled:g,onClick:_,children:[v,h]}),t[10]=h,t[11]=g,t[12]=_,t[13]=v,t[14]=y):y=t[14],y}function Ge(e){return e.status===`failed`||e.status===`partial`||e.status===`canceled`}function Q(e){return e.status===`queued`||e.status===`running`}function Ke(e){return e.language}function qe(e){let t=(0,X.c)(22),{sourceId:n,lastCollectedAt:r}=e,i=c(Je),a=i===`zh`,o;t[0]===n?o=t[1]:(o=e=>e.sources.find(e=>e.grantId===n),t[0]=n,t[1]=o);let s=A(o);if(!s){let e;t[2]!==i||t[3]!==r||t[4]!==a?(e=r?`${a?`上次更新:`:`Last updated: `}${new Date(r).toLocaleString(i)}`:a?`尚未分析`:`Not analyzed yet`,t[2]=i,t[3]=r,t[4]=a,t[5]=e):e=t[5];let n;return t[6]===e?n=t[7]:(n=(0,Z.jsx)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:e}),t[6]=e,t[7]=n),n}let l;t[8]===a?l=t[9]:(l=a?{queued:`等待更新`,waiting_desktop:`等待桌面端读取资料`,reading:`正在读取资料`,analyzing:`正在更新理解`}:{queued:`Queued`,waiting_desktop:`Waiting for desktop collection`,reading:`Reading source`,analyzing:`Updating understanding`},t[8]=a,t[9]=l);let u=l,d=s.status===`running`||s.status===`queued`,f=s.status===`failed`||s.status===`partial`||s.status===`canceled`,p=s.metadata.added,m=d?u[s.metadata.phase??`queued`]??u.queued:f?a?`更新未完成,可重试`:`Update incomplete; retry available`:p===0?a?`更新完成,暂无新增理解`:`Updated; no new understanding`:p===void 0?a?`更新完成`:`Updated`:a?`更新完成,新增 ${p} 条`:`Updated; ${p} added`,h;t[10]===m?h=t[11]:(h=(0,Z.jsx)(`p`,{children:m}),t[10]=m,t[11]=h);let g;t[12]!==i||t[13]!==s.completedAt?(g=s.completedAt?(0,Z.jsx)(`p`,{children:new Date(s.completedAt).toLocaleString(i)}):null,t[12]=i,t[13]=s.completedAt,t[14]=g):g=t[14];let _;t[15]!==f||t[16]!==s.errorMessage?(_=f&&s.errorMessage?(0,Z.jsx)(`p`,{className:`text-danger`,children:s.errorMessage}):null,t[15]=f,t[16]=s.errorMessage,t[17]=_):_=t[17];let v;return t[18]!==h||t[19]!==g||t[20]!==_?(v=(0,Z.jsxs)(`div`,{className:`mt-1 text-xs leading-5 text-fg-subtle`,"aria-live":`polite`,children:[h,g,_]}),t[18]=h,t[19]=g,t[20]=_,t[21]=v):v=t[21],v}function Je(e){return e.language}function Ye(e){let t=(0,X.c)(64),{language:n,busy:r,statement:i,scope:a,onEdit:o,onDelete:s,onScopeChange:c}=e,[l,u]=(0,Y.useState)(!1),[f,p]=(0,Y.useState)(!1),m=n===`zh`,h=m?`修改或删除这条内容`:`Edit or delete this item`,g;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Z.jsx)(G,{className:`size-4`,"aria-hidden":`true`}),t[0]=g):g=t[0];let _;t[1]!==r||t[2]!==h?(_=(0,Z.jsx)(ze,{asChild:!0,children:(0,Z.jsx)(J,{variant:`ghost`,className:`size-11 shrink-0 p-0`,disabled:r,"aria-label":h,children:g})}),t[1]=r,t[2]=h,t[3]=_):_=t[3];let v;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Z.jsx)(ue,{className:`size-4`,"aria-hidden":`true`}),t[4]=v):v=t[4];let y=m?`修改`:`Edit`,b;t[5]!==r||t[6]!==o||t[7]!==y?(b=(0,Z.jsxs)(Ve,{className:`flex min-h-11 cursor-pointer items-center gap-2 rounded-lg px-3 text-sm text-fg outline-none focus:bg-surface-hover data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,disabled:r,onSelect:o,children:[v,y]}),t[5]=r,t[6]=o,t[7]=y,t[8]=b):b=t[8];let x;t[9]!==r||t[10]!==c||t[11]!==a||t[12]!==m?(x=a&&c?(0,Z.jsxs)(Ve,{className:`flex min-h-11 cursor-pointer items-center gap-2 rounded-lg px-3 text-sm text-fg outline-none focus:bg-surface-hover data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,disabled:r,onSelect:()=>p(!0),children:[(0,Z.jsx)(he,{className:`size-4`,"aria-hidden":`true`}),m?`作用范围`:`Where it applies`]}):null,t[9]=r,t[10]=c,t[11]=a,t[12]=m,t[13]=x):x=t[13];let S,C;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(S=()=>u(!0),C=(0,Z.jsx)(ve,{className:`size-4`,"aria-hidden":`true`}),t[14]=S,t[15]=C):(S=t[14],C=t[15]);let w=m?`删除`:`Delete`,T;t[16]!==r||t[17]!==w?(T=(0,Z.jsxs)(Ve,{className:`flex min-h-11 cursor-pointer items-center gap-2 rounded-lg px-3 text-sm text-fg outline-none focus:bg-surface-hover data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,disabled:r,onSelect:S,children:[C,w]}),t[16]=r,t[17]=w,t[18]=T):T=t[18];let E;t[19]!==T||t[20]!==b||t[21]!==x?(E=(0,Z.jsx)(Be,{children:(0,Z.jsxs)(He,{align:`end`,sideOffset:4,className:`z-[100] min-w-36 rounded-xl border border-edge bg-surface-overlay p-1 shadow-popover`,children:[b,x,T]})}),t[19]=T,t[20]=b,t[21]=x,t[22]=E):E=t[22];let D;t[23]!==E||t[24]!==_?(D=(0,Z.jsxs)(Re,{modal:!1,children:[_,E]}),t[23]=E,t[24]=_,t[25]=D):D=t[25];let O;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Z.jsx)(Te,{className:`fixed inset-0 z-[110] bg-scrim`}),t[26]=O):O=t[26];let k=m?`删除这条内容?`:`Delete this item?`,A;t[27]===k?A=t[28]:(A=(0,Z.jsx)(je,{className:`font-semibold text-fg`,children:k}),t[27]=k,t[28]=A);let j=m?`删除后将不再使用这条记忆,原始对话和文件会保留。`:`This memory will no longer be used. Original conversations and files are kept.`,M;t[29]===j?M=t[30]:(M=(0,Z.jsx)(De,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:j}),t[29]=j,t[30]=M);let N;t[31]!==A||t[32]!==M?(N=(0,Z.jsxs)(`header`,{className:`shrink-0 border-b border-edge px-5 py-4`,children:[A,M]}),t[31]=A,t[32]=M,t[33]=N):N=t[33];let P;t[34]===i?P=t[35]:(P=(0,Z.jsx)(`p`,{className:`min-h-0 flex-1 overflow-y-auto whitespace-pre-wrap break-words px-5 py-4 text-sm leading-6 text-fg`,children:i}),t[34]=i,t[35]=P);let F=m?`取消`:`Cancel`,ee;t[36]===F?ee=t[37]:(ee=(0,Z.jsx)(Oe,{asChild:!0,children:(0,Z.jsx)(J,{variant:`ghost`,children:F})}),t[36]=F,t[37]=ee);let I;t[38]===s?I=t[39]:(I=()=>{u(!1),s()},t[38]=s,t[39]=I);let L=m?`删除`:`Delete`,R;t[40]!==r||t[41]!==I||t[42]!==L?(R=(0,Z.jsx)(J,{disabled:r,onClick:I,children:L}),t[40]=r,t[41]=I,t[42]=L,t[43]=R):R=t[43];let z;t[44]!==ee||t[45]!==R?(z=(0,Z.jsxs)(`footer`,{className:`flex shrink-0 justify-end gap-2 border-t border-edge px-5 py-3`,children:[ee,R]}),t[44]=ee,t[45]=R,t[46]=z):z=t[46];let B;t[47]!==N||t[48]!==P||t[49]!==z?(B=(0,Z.jsxs)(ke,{children:[O,(0,Z.jsxs)(Ae,{className:`fixed left-1/2 top-1/2 z-[120] flex h-[min(22rem,calc(100dvh-2rem))] w-[min(28rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay shadow-popover`,children:[N,P,z]})]}),t[47]=N,t[48]=P,t[49]=z,t[50]=B):B=t[50];let V;t[51]!==l||t[52]!==D||t[53]!==B?(V=(0,Z.jsxs)(Me,{open:l,onOpenChange:u,children:[D,B]}),t[51]=l,t[52]=D,t[53]=B,t[54]=V):V=t[54];let H;t[55]!==r||t[56]!==c||t[57]!==a||t[58]!==f||t[59]!==m?(H=a&&c?(0,Z.jsx)(Me,{open:f,onOpenChange:p,children:(0,Z.jsxs)(ke,{children:[(0,Z.jsx)(Te,{className:`fixed inset-0 z-[110] bg-scrim`}),(0,Z.jsxs)(Ae,{className:`fixed left-1/2 top-1/2 z-[120] flex h-[min(25rem,calc(100dvh-2rem))] w-[min(28rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay shadow-popover`,children:[(0,Z.jsxs)(`header`,{className:`shrink-0 border-b border-edge px-5 py-4`,children:[(0,Z.jsx)(je,{className:`font-semibold text-fg`,children:m?`这条记忆在哪里生效?`:`Where should this memory apply?`}),(0,Z.jsx)(De,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:m?`你可以让它用于所有协作,或只用于当前助手。`:`Use it across all work, or keep it only for this assistant.`})]}),(0,Z.jsx)(`div`,{className:`min-h-0 flex-1 space-y-2 overflow-y-auto p-4`,children:[{value:{type:`global`},icon:ne,title:m?`所有协作`:`All work`,detail:m?`任何助手和对话都可按需使用`:`Available when relevant in any assistant or conversation`},{value:{type:`agent`,id:a.type===`agent`?a.id??`main`:`main`},icon:d,title:m?`仅当前助手`:`This assistant only`,detail:m?`不会分享给其他助手`:`Not shared with other assistants`}].map(e=>{let{value:t,icon:n,title:i,detail:o}=e,s=a.type===t.type&&(a.id??``)===(t.id??``);return(0,Z.jsxs)(`button`,{type:`button`,className:`flex min-h-20 w-full items-center gap-3 rounded-xl px-4 py-3 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent ${s?`bg-surface-active`:`hover:bg-surface-hover`}`,disabled:r,onClick:()=>{p(!1),c(t)},children:[(0,Z.jsx)(n,{className:`size-5 shrink-0 text-fg-muted`,"aria-hidden":`true`}),(0,Z.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:i}),(0,Z.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-fg-muted`,children:o})]}),s?(0,Z.jsx)(`span`,{className:`text-xs font-medium text-accent-fg`,children:m?`当前`:`Current`}):null]},t.type)})}),(0,Z.jsx)(`footer`,{className:`flex shrink-0 justify-end border-t border-edge px-5 py-3`,children:(0,Z.jsx)(Oe,{asChild:!0,children:(0,Z.jsx)(J,{variant:`ghost`,children:m?`取消`:`Cancel`})})})]})]})}):null,t[55]=r,t[56]=c,t[57]=a,t[58]=f,t[59]=m,t[60]=H):H=t[60];let U;return t[61]!==V||t[62]!==H?(U=(0,Z.jsxs)(Z.Fragment,{children:[V,H]}),t[61]=V,t[62]=H,t[63]=U):U=t[63],U}function Xe(e,t){return e?new Intl.DateTimeFormat(t===`zh`?`zh-CN`:`en`,{dateStyle:`medium`}).format(e):null}function Ze(e,t,n=new Date){let r=new Date(n.getFullYear(),n.getMonth(),n.getDate()),i=new Date(r);i.setDate(r.getDate()-1);let a=new Map;for(let n of[...e].sort((e,t)=>t.recordedAt-e.recordedAt)){let e=n.recordedAt>=r.getTime()?t===`zh`?`今天`:`Today`:n.recordedAt>=i.getTime()?t===`zh`?`昨天`:`Yesterday`:Xe(n.recordedAt,t)??(t===`zh`?`更早`:`Earlier`),o=a.get(e)??[];o.push(n),a.set(e,o)}return[...a].map(([e,t])=>({label:e,items:t}))}function Qe(e,t){return(t===`zh`?{user_explicit:`你告诉我的`,user_observed:`从协作中观察到`,system_inferred:`我形成的判断`,external_untrusted:`来自连接的信息`}:{user_explicit:`You told me`,user_observed:`Observed while working together`,system_inferred:`My current read`,external_untrusted:`From connected information`})[e.authority]}function $e(e,t){if(e.validTo){let n=Xe(e.validTo,t);return t===`zh`?`适用至 ${n}`:`Applies until ${n}`}return(t===`zh`?{stable:`相对稳定`,slow:`会随时间复核`,dynamic:`近期状态`,event:`特定阶段`}:{stable:`Relatively stable`,slow:`Reviewed over time`,dynamic:`Current context`,event:`Specific period`})[e.volatility]}function et(e,t){return e.authority===`user_explicit`?null:e.confidence>=.85?t===`zh`?`把握较高`:`High confidence`:e.confidence>=.65?t===`zh`?`把握中等`:`Medium confidence`:t===`zh`?`证据较少`:`Limited evidence`}function tt(e,t){return(t===`zh`?{global:`所有协作`,agent:`当前智能体`,workspace:`当前工作区`,project:`当前项目`,session:`当前会话`}:{global:`All work`,agent:`This agent`,workspace:`This workspace`,project:`This project`,session:`This conversation`})[e.type]}function nt(e){let t=(0,X.c)(24),{item:n,language:r,busy:i,editing:a,draft:o,onDraftChange:s,onEdit:c,onCancel:l,onDelete:u,onCorrect:d,onScopeChange:f}=e,p=(0,Y.useId)(),m=r===`zh`,h;t[0]!==n||t[1]!==r?(h=et(n,r),t[0]=n,t[1]=r,t[2]=h):h=t[2];let g=h,_;t[3]===n.sources?_=t[4]:(_=new Set(n.sources?.map(it).filter(Boolean)),t[3]=n.sources,t[4]=_);let v;t[5]===_?v=t[6]:(v=[..._],t[5]=_,t[6]=v);let y=v,b=m?`修改`:`Edit`,x;return t[7]!==i||t[8]!==g||t[9]!==o||t[10]!==b||t[11]!==a||t[12]!==p||t[13]!==n||t[14]!==r||t[15]!==l||t[16]!==d||t[17]!==u||t[18]!==s||t[19]!==c||t[20]!==f||t[21]!==y||t[22]!==m?(x=(0,Z.jsx)(`article`,{className:`border-t border-edge-subtle px-4 py-3 first:border-t-0 sm:px-5 [content-visibility:auto] [contain-intrinsic-size:auto_100px]`,children:a?(0,Z.jsxs)(`div`,{className:`space-y-3`,children:[(0,Z.jsx)(`label`,{className:`text-sm font-medium text-fg`,htmlFor:p,children:m?`修改这条理解`:`Edit this understanding`}),(0,Z.jsx)(`textarea`,{id:p,value:o,disabled:i,onChange:e=>s(e.target.value),className:`mt-2 min-h-28 w-full resize-y rounded-xl border border-edge bg-surface-base px-3 py-2.5 text-base leading-7 text-fg outline-none focus:border-accent focus:ring-2 focus:ring-accent/20`}),(0,Z.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,Z.jsx)(J,{variant:`ghost`,disabled:i,onClick:l,children:m?`取消`:`Cancel`}),(0,Z.jsx)(J,{variant:`primary`,disabled:!o.trim()||i,onClick:d,children:i?m?`保存中…`:`Saving…`:m?`保存修改`:`Save changes`})]})]}):(0,Z.jsxs)(`div`,{className:`flex items-start gap-2 sm:gap-4`,children:[(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1 pt-1.5`,children:[(0,Z.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-base leading-7 text-fg`,children:n.statement}),(0,Z.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs leading-5 text-fg-muted`,children:[(0,Z.jsx)(`span`,{children:Qe(n,r)}),n.usable===!1?(0,Z.jsx)(`span`,{children:m?`暂不使用`:`Not in use`}):null,n.validTo?(0,Z.jsx)(`span`,{children:$e(n,r)}):null,n.authority!==`user_explicit`&&n.confidence<.65?(0,Z.jsx)(`span`,{children:g}):null,(0,Z.jsxs)(`details`,{className:`open:basis-full`,children:[(0,Z.jsx)(`summary`,{className:`w-fit cursor-pointer rounded-md py-1 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:m?`查看依据`:`View sources`}),(0,Z.jsxs)(`div`,{className:`my-2 space-y-1 border-l-2 border-edge pl-3 text-sm leading-6`,children:[(0,Z.jsx)(`p`,{children:n.usable?m?`按需用于当前协作`:`Used when relevant`:m?`暂不使用,后台继续复核`:`Not in use; reviewed automatically`}),(0,Z.jsxs)(`p`,{children:[$e(n,r),` · `,tt(n.scope,r),g?` · ${g}`:``]}),(0,Z.jsxs)(`p`,{children:[m?`最近观察:`:`Last observed: `,Xe(n.observedAt,r)]}),(0,Z.jsxs)(`p`,{children:[m?`模型层:`:`Model layer: `,m?{fact:`事实`,pattern:`模式`,interpretation:`解释`}[n.layer]:n.layer,` · `,m?`${n.independentSourceCount} 个独立来源`:`${n.independentSourceCount} independent sources`]}),y.length?y.map(rt):(0,Z.jsx)(`p`,{children:m?`暂无更详细的来源记录`:`No further source details available`}),(0,Z.jsx)(J,{variant:`ghost`,className:`-ml-2 px-2`,disabled:i,onClick:c,children:b})]})]})]})]}),(0,Z.jsx)(Ye,{language:r,busy:i,statement:n.statement,scope:n.scope,onEdit:c,onDelete:u,onScopeChange:f})]})}),t[7]=i,t[8]=g,t[9]=o,t[10]=b,t[11]=a,t[12]=p,t[13]=n,t[14]=r,t[15]=l,t[16]=d,t[17]=u,t[18]=s,t[19]=c,t[20]=f,t[21]=y,t[22]=m,t[23]=x):x=t[23],x}function rt(e){return(0,Z.jsx)(`p`,{className:`break-words`,children:e},e)}function it(e){return e.label}var at={zh:{eyebrow:`全局用户理解`,title:`xopc 如何形成对你的理解`,subtitle:`这里汇总跨项目、跨对话形成的认识,并说明它们来自哪些渠道。项目事实不会混入你的个人画像。`,channels:`理解渠道`,channelHint:`查看来源及其最近更新。`,noChannels:`尚未通过任何渠道形成可展示的全局理解。`,activeCount:`{{count}} 条已在使用`,pendingCount:`{{count}} 条暂不使用`,noUnderstanding:`暂无来自此渠道的全局理解`,pending:`最近更新`,pendingHint:`自动整理并按需使用,你可以随时修改或删除。`,nothingPending:`尚未形成全局理解。`,showAll:`查看全部 {{count}} 条`,showLess:`收起`,done:`完成`,updating:`正在从已授权渠道更新理解;你可以先查看已有内容。`,sourceKinds:{user:`你明确告诉我的`,conversation:`对话与协作`,connector:`连接的服务`,work_folder:`工作目录`,local_source:`本机来源`,inference:`综合整理`}},en:{eyebrow:`Global user understanding`,title:`How xopc forms its understanding of you`,subtitle:`This brings together understanding formed across projects and conversations, with the channel behind each item. Project facts stay out of your personal portrait.`,channels:`Understanding channels`,channelHint:`View sources and their latest updates.`,noChannels:`No channel has formed displayable global understanding yet.`,activeCount:`{{count}} in use`,pendingCount:`{{count}} not in use`,noUnderstanding:`No usable global understanding has formed from this channel yet`,pending:`Recent updates`,pendingHint:`Organized automatically and used when relevant. Edit or delete anytime.`,nothingPending:`No understanding has formed yet.`,showAll:`View all {{count}}`,showLess:`Show less`,done:`Done`,updating:`Updating from authorized channels. You can review existing understanding now.`,sourceKinds:{user:`You told me`,conversation:`Conversations and work`,connector:`Connected services`,work_folder:`Work folders`,local_source:`On-device sources`,inference:`Synthesized understanding`}}},$={"local-recent-files":{en:`Recent files`,zh:`最近文件`},"chromium-bookmarks":{en:`Recent bookmarks`,zh:`最近书签`},"apple-notes":{en:`Apple Notes`,zh:`Apple 备忘录`},"apple-mail":{en:`Apple Mail`,zh:`Apple 邮件`},"apple-calendar":{en:`Apple Calendar`,zh:`Apple 日历`},"apple-reminders":{en:`Apple Reminders`,zh:`Apple 提醒事项`},"windows-recent-documents":{en:`Recent documents`,zh:`最近文档`},"linux-recent-documents":{en:`Recent documents`,zh:`最近文档`}},ot={user:be,conversation:le,connector:W,work_folder:q,local_source:re,inference:W},st={files:q,recent_documents:re,calendar:F,tasks:oe,notes:_e,mail:K,messages:le,code_activity:ae};function ct(e){let t=e.authority===`user_explicit`?`user`:e.authority===`user_observed`?`conversation`:e.authority===`external_untrusted`?`connector`:`inference`;return{id:t,kind:t,observedAt:e.observedAt}}function lt(e,t){return e.kind===`local_source`&&e.label?$[e.label]?.[t]??e.label:e.kind===`work_folder`&&e.label?t===`zh`?`工作目录 · ${e.label}`:`Work folder · ${e.label}`:e.label?e.label:at[t].sourceKinds[e.kind]}function ut(e){return`${e.kind}:${e.adapterId}:${e.displayName}`}function dt(e){let t=(0,X.c)(91),{assertions:n,configuredSources:r,activityRunning:i,language:a,busy:o,error:s,onReviewAssertion:c,onCompleted:l}=e,u=at[a],[d,f]=(0,Y.useState)(!1),[p,m]=(0,Y.useState)(null),[h,g]=(0,Y.useState)(``),_;t[0]===n?_=t[1]:(_=n.filter(vt),t[0]=n,t[1]=_);let v=_,y;t[2]===v?y=t[3]:(y=[...v].sort(_t),t[2]=v,t[3]=y);let b=y,x;if(t[4]!==r||t[5]!==v||t[6]!==a){let e=new Map;for(let t of r){let n=t.kind===`local_source`?$[t.adapterId]?.[a]??t.displayName:t.displayName,r=ut(t);e.set(r,{key:r,grantId:t.id,kind:t.kind,category:t.category,label:t.kind===`work_folder`?a===`zh`?`工作目录 · ${n}`:`Work folder · ${n}`:n,assertions:[],lastObservedAt:t.lastCollectedAt})}for(let t of v)for(let n of t.sources?.length?t.sources:[ct(t)]){let r=lt(n,a),i=[...e.values()].find(e=>e.kind===n.kind&&e.label===r),o=i?.key??`${n.kind}:${r}`,s=i??e.get(o)??{key:o,kind:n.kind,category:n.category,label:r,assertions:[],lastObservedAt:n.observedAt};s.assertions.some(e=>e.id===t.id)||s.assertions.push(t),s.lastObservedAt=Math.max(s.lastObservedAt??0,n.observedAt),e.set(o,s)}x=[...e.values()].sort(gt),t[4]=r,t[5]=v,t[6]=a,t[7]=x}else x=t[7];let S=x,C;t[8]===c?C=t[9]:(C=async(e,t,n)=>{await c(e,t,n)&&m(null)},t[8]=c,t[9]=C);let w=C,T,E,D,O,k,A,j,M,N;if(t[10]!==i||t[11]!==o||t[12]!==h||t[13]!==p||t[14]!==a||t[15]!==b||t[16]!==w||t[17]!==d||t[18]!==u.eyebrow||t[19]!==u.nothingPending||t[20]!==u.pending||t[21]!==u.pendingHint||t[22]!==u.showAll||t[23]!==u.showLess||t[24]!==u.subtitle||t[25]!==u.title||t[26]!==u.updating){let e=d?b:b.slice(0,5);T=`mx-auto w-full max-w-[42rem] pb-2`,E=`polite`;let n;t[36]===u.eyebrow?n=t[37]:(n=(0,Z.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.18em] text-accent-fg`,children:u.eyebrow}),t[36]=u.eyebrow,t[37]=n);let r;t[38]===u.title?r=t[39]:(r=(0,Z.jsx)(`h2`,{className:`mt-3 text-2xl font-semibold tracking-tight text-fg sm:text-3xl`,children:u.title}),t[38]=u.title,t[39]=r);let s;t[40]===u.subtitle?s=t[41]:(s=(0,Z.jsx)(`p`,{className:`mx-auto mt-3 max-w-[38rem] text-sm leading-6 text-fg-muted`,children:u.subtitle}),t[40]=u.subtitle,t[41]=s),t[42]!==n||t[43]!==r||t[44]!==s?(D=(0,Z.jsxs)(`div`,{className:`text-center`,children:[n,r,s]}),t[42]=n,t[43]=r,t[44]=s,t[45]=D):D=t[45],t[46]!==i||t[47]!==u.updating?(O=i?(0,Z.jsxs)(`div`,{className:`mt-6 flex items-center gap-3 rounded-xl border border-accent/20 bg-accent-soft/55 px-4 py-3 text-sm text-accent-fg`,children:[(0,Z.jsx)(se,{className:`size-4 shrink-0 animate-spin motion-reduce:animate-none`}),(0,Z.jsx)(`p`,{children:u.updating})]}):null,t[46]=i,t[47]=u.updating,t[48]=O):O=t[48],k=`mt-8`,A=`understanding-updates-title`;let c=b.length?` · ${b.length}`:``;t[49]!==u.pending||t[50]!==c?(j=(0,Z.jsxs)(`h3`,{id:`understanding-updates-title`,className:`text-sm font-semibold text-fg`,children:[u.pending,c]}),t[49]=u.pending,t[50]=c,t[51]=j):j=t[51],t[52]===u.pendingHint?M=t[53]:(M=(0,Z.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:u.pendingHint}),t[52]=u.pendingHint,t[53]=M),N=b.length?(0,Z.jsxs)(`div`,{className:`mt-3`,children:[Ze(e,a).map(e=>{let{label:t,items:n}=e;return(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`h4`,{className:`border-b border-edge-subtle px-4 pb-2 pt-3 text-xs font-medium text-fg-muted`,children:t}),(0,Z.jsx)(`div`,{children:n.map(e=>(0,Z.jsx)(nt,{item:e,language:a,busy:o,editing:p===e.id,draft:h,onDraftChange:g,onEdit:()=>{m(e.id),g(e.statement)},onCancel:()=>m(null),onCorrect:()=>void w(e,`edited`,h.trim()),onDelete:()=>void w(e,`deleted`)},e.id))})]},t)}),b.length>5?(0,Z.jsxs)(`button`,{type:`button`,className:`mx-auto flex items-center gap-1.5 px-3 py-2 text-xs font-medium text-accent-fg hover:underline`,onClick:()=>f(ht),children:[d?u.showLess:u.showAll.replace(`{{count}}`,String(b.length)),(0,Z.jsx)(I,{className:Se(`size-3.5 transition-transform`,d&&`rotate-180`)})]}):null]}):(0,Z.jsxs)(`div`,{className:`mt-3 flex items-start gap-3 rounded-xl border border-edge bg-surface-base/55 p-4`,children:[(0,Z.jsx)(H,{className:`mt-0.5 size-5 shrink-0 text-success`}),(0,Z.jsx)(`p`,{className:`text-sm leading-6 text-fg-muted`,children:u.nothingPending})]}),t[10]=i,t[11]=o,t[12]=h,t[13]=p,t[14]=a,t[15]=b,t[16]=w,t[17]=d,t[18]=u.eyebrow,t[19]=u.nothingPending,t[20]=u.pending,t[21]=u.pendingHint,t[22]=u.showAll,t[23]=u.showLess,t[24]=u.subtitle,t[25]=u.title,t[26]=u.updating,t[27]=T,t[28]=E,t[29]=D,t[30]=O,t[31]=k,t[32]=A,t[33]=j,t[34]=M,t[35]=N}else T=t[27],E=t[28],D=t[29],O=t[30],k=t[31],A=t[32],j=t[33],M=t[34],N=t[35];let P;t[54]!==k||t[55]!==A||t[56]!==j||t[57]!==M||t[58]!==N?(P=(0,Z.jsxs)(`section`,{className:k,"aria-labelledby":A,children:[j,M,N]}),t[54]=k,t[55]=A,t[56]=j,t[57]=M,t[58]=N,t[59]=P):P=t[59];let F;t[60]!==S.length||t[61]!==u.channels?(F=(0,Z.jsxs)(`summary`,{className:`w-fit cursor-pointer rounded-md py-2 text-sm font-medium text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[u.channels,` · `,S.length]}),t[60]=S.length,t[61]=u.channels,t[62]=F):F=t[62];let L;t[63]===u.channelHint?L=t[64]:(L=(0,Z.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:u.channelHint}),t[63]=u.channelHint,t[64]=L);let R;t[65]!==S||t[66]!==u.activeCount||t[67]!==u.noChannels||t[68]!==u.noUnderstanding||t[69]!==u.pendingCount?(R=S.length?(0,Z.jsx)(`div`,{className:`mt-3 space-y-3`,children:S.map(e=>{let t=e.category?st[e.category]??ot[e.kind]:ot[e.kind],n=e.assertions.filter(mt).length,r=e.assertions.filter(pt).length;return(0,Z.jsxs)(`article`,{className:`rounded-xl border border-edge bg-surface-base/55 px-4 py-4`,children:[(0,Z.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Z.jsx)(`div`,{className:`flex size-9 shrink-0 items-center justify-center rounded-xl bg-surface-hover text-fg-muted`,children:(0,Z.jsx)(t,{className:`size-4`})}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`h4`,{className:`truncate text-sm font-medium text-fg`,children:e.label}),e.grantId?(0,Z.jsx)(qe,{sourceId:e.grantId,lastCollectedAt:e.lastObservedAt}):null,e.assertions.length?(0,Z.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:[n?u.activeCount.replace(`{{count}}`,String(n)):``,r?u.pendingCount.replace(`{{count}}`,String(r)):``].filter(Boolean).join(` · `)}):(0,Z.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:u.noUnderstanding})]}),e.grantId?(0,Z.jsx)(We,{sourceId:e.grantId}):null]}),e.assertions.length?(0,Z.jsx)(`ul`,{className:`ml-12 mt-3 space-y-2 border-t border-edge-subtle pt-3 text-xs leading-5 text-fg-muted`,children:e.assertions.slice(0,5).map(ft)}):null]},e.key)})}):(0,Z.jsx)(`p`,{className:`mt-3 rounded-xl border border-edge bg-surface-base/55 p-4 text-sm text-fg-muted`,children:u.noChannels}),t[65]=S,t[66]=u.activeCount,t[67]=u.noChannels,t[68]=u.noUnderstanding,t[69]=u.pendingCount,t[70]=R):R=t[70];let z;t[71]!==F||t[72]!==L||t[73]!==R?(z=(0,Z.jsxs)(`details`,{className:`mt-6 border-t border-edge pt-4`,children:[F,L,R]}),t[71]=F,t[72]=L,t[73]=R,t[74]=z):z=t[74];let B;t[75]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,Z.jsx)(ee,{className:`size-4`}),t[75]=B):B=t[75];let V;t[76]!==o||t[77]!==l||t[78]!==u.done?(V=(0,Z.jsx)(`div`,{className:`mt-6 flex justify-end`,children:(0,Z.jsxs)(J,{variant:`primary`,disabled:o,onClick:l,children:[B,u.done]})}),t[76]=o,t[77]=l,t[78]=u.done,t[79]=V):V=t[79];let U;t[80]===s?U=t[81]:(U=s?(0,Z.jsx)(`p`,{className:`mt-5 text-sm text-danger`,role:`alert`,children:s}):null,t[80]=s,t[81]=U);let W;return t[82]!==T||t[83]!==E||t[84]!==D||t[85]!==O||t[86]!==P||t[87]!==z||t[88]!==V||t[89]!==U?(W=(0,Z.jsxs)(`section`,{className:T,"aria-live":E,children:[D,O,P,z,V,U]}),t[82]=T,t[83]=E,t[84]=D,t[85]=O,t[86]=P,t[87]=z,t[88]=V,t[89]=U,t[90]=W):W=t[90],W}function ft(e){return(0,Z.jsxs)(`li`,{className:`flex gap-2`,children:[(0,Z.jsx)(`span`,{className:`mt-2 size-1 shrink-0 rounded-full bg-accent/60`}),(0,Z.jsx)(`span`,{children:e.statement})]},e.id)}function pt(e){return!e.usable}function mt(e){return e.usable}function ht(e){return!e}function gt(e,t){return t.assertions.length-e.assertions.length||(t.lastObservedAt??0)-(e.lastObservedAt??0)}function _t(e,t){return t.recordedAt-e.recordedAt}function vt(e){return e.scope.type===`global`&&e.status!==`archived`&&e.status!==`rejected`}function yt(){let{pathname:e,search:t}=i(),n=c(e=>e.language),r=ie(),[a,o]=(0,Y.useState)(!1),[s,l]=(0,Y.useState)(null),u=e===`/user-model`,{data:d,mutate:f}=Ce(u?`/api/user-model`:null,C),p=A(e=>e.error),m=A(e=>e.sources.some(e=>e.status===`running`||e.status===`queued`)),g=n===`zh`;if((0,Y.useEffect)(()=>{u&&new URLSearchParams(t).get(`workDiscovery`)===`review`&&ie.getState().setDrawerOpen(!0)},[u,t]),(0,Y.useEffect)(()=>{u&&r.status!==`running`&&f()},[f,u,r.directoryRun?.id,r.status]),!u)return null;let _=r.status===`running`||m,v=async(e,t,n)=>{o(!0),l(null);try{return t===`edited`&&n?await T(e.id,n):t===`deleted`&&await h(e.id),await f(),!0}catch(e){return l(e instanceof Error?e.message:String(e)),!1}finally{o(!1)}},y=e=>{if(!e&&d&&r.status!==`running`){r.finish();return}r.setDrawerOpen(e)};return(0,Z.jsxs)(Me,{open:r.drawerOpen,onOpenChange:y,children:[(0,Z.jsx)(Ee,{asChild:!0,children:(0,Z.jsx)(J,{type:`button`,variant:`ghost`,className:Se(`relative size-8 rounded-xl p-0`,Ne),title:g?`查看 xopc 对你的理解`:`Review what xopc understands`,"aria-label":g?`查看 xopc 对你的理解`:`Review what xopc understands`,children:_?(0,Z.jsx)(se,{className:`size-4 animate-spin motion-reduce:animate-none`}):(0,Z.jsx)(ge,{className:`size-4 text-accent-fg`})})}),(0,Z.jsxs)(ke,{children:[(0,Z.jsx)(Te,{className:`fixed inset-0 z-[60] bg-scrim backdrop-blur-sm data-[state=closed]:animate-out data-[state=open]:animate-in motion-reduce:backdrop-blur-none`}),(0,Z.jsx)(`div`,{className:`pointer-events-none fixed inset-0 z-[61] flex items-center justify-center p-3 sm:p-6`,children:(0,Z.jsxs)(Ae,{className:`xopc-understanding-center pointer-events-auto flex h-[min(42rem,calc(100dvh-1.5rem))] w-[min(44rem,calc(100vw-1.5rem))] flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay shadow-float outline-none sm:h-[min(42rem,calc(100dvh-3rem))] sm:w-[min(44rem,calc(100vw-3rem))]`,children:[(0,Z.jsxs)(`header`,{className:`flex h-16 shrink-0 items-center justify-between border-b border-edge-subtle px-5 sm:px-6`,children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(je,{className:`text-sm font-semibold text-fg`,children:_?g?`正在更新用户理解`:`Updating user understanding`:g?`用户理解`:`User understanding`}),(0,Z.jsx)(De,{className:`mt-0.5 text-xs text-fg-muted`,children:_?g?`关闭窗口也会在后台继续`:`You can close this window; work continues in the background`:g?`自动更新,可随时修改或删除`:`Updated automatically. Edit or delete anytime`})]}),(0,Z.jsx)(We,{disabled:!d?.sources?.length}),(0,Z.jsx)(Oe,{asChild:!0,children:(0,Z.jsx)(J,{variant:`ghost`,className:`size-8 rounded-xl p-0`,"aria-label":g?`关闭`:`Close`,children:(0,Z.jsx)(xe,{className:`size-4`})})})]}),(0,Z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-5 py-7 sm:px-9 sm:py-9`,children:d?(0,Z.jsx)(dt,{assertions:d.assertions,configuredSources:d.sources??[],activityRunning:_,language:n,busy:a,error:s??p??null,onReviewAssertion:v,onCompleted:()=>{y(!1)}}):(0,Z.jsxs)(`section`,{className:`space-y-4`,"aria-label":g?`正在加载用户理解`:`Loading user understanding`,children:[(0,Z.jsx)(we,{className:`h-8 w-2/3`}),(0,Z.jsx)(we,{className:`h-32 w-full`}),(0,Z.jsx)(we,{className:`h-32 w-full`})]})})]})})]})]})}function bt(e){let t=(0,X.c)(34),{language:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={refreshInterval:15e3},t[0]=r):r=t[0];let{data:i,error:a,isLoading:o}=Ce(`memory-learning-status`,jt,r);if(o){let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(we,{className:`h-14 w-full rounded-xl`}),t[1]=e):e=t[1],e}if(a||!i?.jobs||!i?.coverage)return null;let s;t[2]===i.jobs?s=t[3]:(s=i.jobs.filter(At).reduce(kt,0),t[2]=i.jobs,t[3]=s);let c=s,l;t[4]===i.coverage?l=t[5]:(l=i.coverage.filter(Ot).reduce(Dt,0),t[4]=i.coverage,t[5]=l);let u=l,d;t[6]===i.coverage?d=t[7]:(d=i.coverage.filter(Et).reduce(Tt,0),t[6]=i.coverage,t[7]=d);let f=d,p;t[8]===i.jobs?p=t[9]:(p=i.jobs.filter(wt).reduce(Ct,0),t[8]=i.jobs,t[9]=p);let m=p,h;t[10]===i.jobs?h=t[11]:(h=i.jobs.filter(St).reduce(xt,0),t[10]=i.jobs,t[11]=h);let g=h,_=n===`zh`?`资料 ${f} 条 · 已生效记忆 ${u} 条`:`${f} sources · ${u} active memories`,v;t[12]!==n||t[13]!==c?(v=c>0?(0,Z.jsx)(`span`,{className:`ml-2`,children:n===`zh`?`${c} 项处理中`:`${c} processing`}):null,t[12]=n,t[13]=c,t[14]=v):v=t[14];let y=n===`zh`?`计数说明`:`About these counts`,b;t[15]===y?b=t[16]:(b=(0,Z.jsx)(`summary`,{className:`w-fit cursor-pointer rounded focus-visible:outline-accent`,children:y}),t[15]=y,t[16]=b);let x=n===`zh`?`仅统计已启用且有依据的工作记忆;管理列表包含其他状态。“关于你”单独计数。`:`Work memories must be active and supported. Management lists include other states. About you is counted separately.`,S;t[17]===x?S=t[18]:(S=(0,Z.jsx)(`p`,{className:`mt-1 leading-5`,children:x}),t[17]=x,t[18]=S);let C;t[19]!==b||t[20]!==S?(C=(0,Z.jsxs)(`details`,{className:`mt-1 text-xs`,children:[b,S]}),t[19]=b,t[20]=S,t[21]=C):C=t[21];let w;t[22]!==m||t[23]!==n?(w=m>0?(0,Z.jsx)(`span`,{className:`ml-2`,children:n===`zh`?`${m} 项处理失败`:`${m} failed jobs`}):null,t[22]=m,t[23]=n,t[24]=w):w=t[24];let T;t[25]!==n||t[26]!==g?(T=g>0?(0,Z.jsx)(`span`,{className:`ml-2`,children:n===`zh`?`${g} 项等待配置本地模型`:`${g} jobs require a local model`}):null,t[25]=n,t[26]=g,t[27]=T):T=t[27];let E;return t[28]!==C||t[29]!==w||t[30]!==T||t[31]!==_||t[32]!==v?(E=(0,Z.jsxs)(`div`,{className:`rounded-xl border border-edge bg-surface-base px-4 py-3 text-sm text-fg-muted`,role:`status`,children:[_,v,C,w,T]}),t[28]=C,t[29]=w,t[30]=T,t[31]=_,t[32]=v,t[33]=E):E=t[33],E}function xt(e,t){return e+t.count}function St(e){return e.errorCode===`local_model_required`}function Ct(e,t){return e+t.count}function wt(e){return e.state===`failed`}function Tt(e,t){return e+t.count}function Et(e){return e.recordClass===`source_index`}function Dt(e,t){return e+t.count}function Ot(e){return e.recordClass===`memory`&&e.status===`active`&&e.verification===`supported`}function kt(e,t){return e+t.count}function At(e){return[`queued`,`running`,`retry_wait`].includes(e.state)}function jt(){return l(s(`/api/memory-learning/status`))}function Mt(e){let t=(0,X.c)(12),{id:n,language:r}=e,i;t[0]===n?i=t[1]:(i=()=>l(s(`/api/knowledge-memory/${encodeURIComponent(n)}/evidence`)),t[0]=n,t[1]=i);let{data:a,error:o,isLoading:c}=Ce(`knowledge-evidence:${n}`,i);if(c){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(we,{className:`mt-3 h-10 w-full rounded-lg`}),t[2]=e):e=t[2],e}if(o){let e=r===`zh`?`此条证据目前不可用于回答,请检查来源授权、有效期和读取范围。`:`Evidence is currently unavailable. Check source authorization, validity and read scope.`,n;return t[3]===e?n=t[4]:(n=(0,Z.jsx)(`p`,{className:`mt-3 text-xs text-fg-muted`,children:e}),t[3]=e,t[4]=n),n}if(!Array.isArray(a?.evidence)||!a.evidence.length)return null;let u;if(t[5]!==a.evidence||t[6]!==r){let e;t[8]===r?e=t[9]:(e=(e,t)=>(0,Z.jsxs)(`p`,{children:[r===`zh`?`证据`:`Evidence`,` · `,e.sourceType===`conversation`?r===`zh`?`对话`:`Conversation`:e.sourceType===`runtime`?r===`zh`?`执行记录`:`Execution receipt`:r===`zh`?`授权资料`:`Authorized source`,` · `,new Date(e.observedAt).toLocaleDateString(r),e.excerpt?(0,Z.jsx)(`span`,{className:`mt-1 block whitespace-pre-wrap break-words`,children:e.excerpt}):null]},t),t[8]=r,t[9]=e),u=a.evidence.map(e),t[5]=a.evidence,t[6]=r,t[7]=u}else u=t[7];let d;return t[10]===u?d=t[11]:(d=(0,Z.jsx)(`div`,{className:`mt-3 space-y-2 border-t border-edge-subtle pt-3 text-xs text-fg-muted`,children:u}),t[10]=u,t[11]=d),d}function Nt(e){let t=e.get(`tab`);return t===`understanding`||t===`privacy`?t:`overview`}var Pt={en:{pageTitle:`Me`,overview:`Overview`,understanding:`What xopc knows`,privacy:`Data & privacy`,knowledge:`Work memory`,editProfile:`Edit basics`,callName:`What should xopc call you?`,callNamePlaceholder:`For example: Alex, Joyce, or Dr. Chen`,role:`Your role`,rolePlaceholder:`For example: founder, designer, or engineer`,pronouns:`Pronouns (optional)`,pronounsPlaceholder:`For example: she/her, he/him, they/them`,timezone:`Timezone`,timezoneSearch:`Search timezones…`,timezoneNoMatch:`No matching timezone`,locale:`Language / locale`,useDeviceTimezone:`Use this device`,notProvided:`Not provided`,editProfileHint:`These are facts you provide directly. They remain separate from xopc’s observations and inferences.`,saveProfile:`Save`,saving:`Saving…`,explicit:`You told me`,explicitHint:`Facts and preferences you stated directly`,learned:`Learned together`,learnedHint:`Patterns formed from our work`,allUnderstanding:`All understanding`,understandingFilterHint:`Filter this view by how each item was formed.`,importantNow:`What matters now`,prioritySourceGoal:`From a goal you confirmed`,prioritySourceWork:`From your current work`,editPriority:`Edit focus`,addPriority:`Set current focus`,priorityTitle:`Current focus`,priorityTitlePlaceholder:`What matters most right now?`,priorityOutcome:`What a good outcome looks like`,priorityOutcomePlaceholder:`Describe the result you want…`,priorityUntil:`Focus through`,savePriority:`Save focus`,endPriority:`End focus`,endingPriority:`Ending…`,priorityHint:`This is used to keep xopc aligned with what deserves attention now.`,otherGoals:`Other active outcomes`,howWeWork:`How we work together`,noRules:`No collaboration preferences yet.`,seeAll:`See all`,workMemory:`What I remember from the work`,items:`items`,refresh:`Refresh`,refreshing:`Refreshing…`,refreshComplete:`Refreshed`,refreshFailed:`Refresh failed`,aboutYouTitle:`A view you can correct`,aboutYouHint:`xopc quietly maintains this working context from collaboration. You can edit or retire any item.`,identity:`Who you are`,preferences:`Preferences and working rhythm`,relationships:`People and relationships`,currentState:`Current context`,insights:`My current read`,emptyGroup:`No understanding has formed here yet.`,correct:`Correct`,save:`Save correction`,cancel:`Cancel`,correctionPlaceholder:`Write the accurate version…`,searchPlaceholder:`Search work memory…`,allMemory:`All work memory`,memoryFilterHint:`Filter by memory type`,memoryLibraryHint:`Only distilled facts, decisions, lessons, commitments, and open questions appear here. Source records stay with their connector.`,noKnowledge:`No work memory has formed yet.`,noKnowledgeMatch:`No work memory matches this search.`,showMore:`Show more`,expand:`Show details`,collapse:`Hide details`,disable:`Disable`,disabled:`Not in use`,enable:`Enable`,loadFailed:`Could not load your understanding.`,tryAgain:`Try again`,actionFailed:`The change could not be saved. Please try again.`},zh:{pageTitle:`我的`,overview:`总览`,understanding:`对我的了解`,privacy:`数据与隐私`,knowledge:`工作记忆`,editProfile:`编辑基本信息`,callName:`希望 xopc 如何称呼你?`,callNamePlaceholder:`例如:Mic、Joyce、张老师`,role:`你的角色`,rolePlaceholder:`例如:创业者、产品设计师、工程师`,pronouns:`代词(可选)`,pronounsPlaceholder:`例如:she/her、he/him、they/them`,timezone:`时区`,timezoneSearch:`搜索时区…`,timezoneNoMatch:`没有匹配的时区`,locale:`语言 / 地区`,useDeviceTimezone:`使用本机时区`,notProvided:`未填写`,editProfileHint:`这些是由你直接提供的事实,与 xopc 的观察和推断分开维护。`,saveProfile:`保存`,saving:`正在保存…`,explicit:`你告诉我的`,explicitHint:`你明确表达的事实与偏好`,learned:`协作中学到的`,learnedHint:`从实际协作中形成的认识`,allUnderstanding:`全部理解`,understandingFilterHint:`按内容来源筛选这份理解。`,importantNow:`此刻重要`,prioritySourceGoal:`来自你确认的当前目标`,prioritySourceWork:`来自当前工作上下文`,editPriority:`编辑`,addPriority:`设置当前关注`,priorityTitle:`当前关注`,priorityTitlePlaceholder:`现在最重要的是什么?`,priorityOutcome:`期待结果`,priorityOutcomePlaceholder:`描述你希望达成的结果…`,priorityUntil:`关注至`,savePriority:`保存关注`,endPriority:`结束关注`,endingPriority:`正在结束…`,priorityHint:`这项内容会帮助 xopc 在协作中优先关注当前最重要的事情。`,otherGoals:`其他进行中的目标`,howWeWork:`我们怎样协作`,noRules:`还没有形成协作偏好。`,seeAll:`查看全部`,workMemory:`我在工作中记住的`,items:`条`,refresh:`刷新`,refreshing:`正在刷新…`,refreshComplete:`已刷新`,refreshFailed:`刷新失败`,aboutYouTitle:`一份可以共同修正的理解`,aboutYouHint:`xopc 会在协作中安静地维护这份工作认知。你仍可随时修改或停止使用任何一条。`,identity:`关于你是谁`,preferences:`偏好与工作节奏`,relationships:`重要的人与关系`,currentState:`当前状态`,insights:`我形成的判断`,emptyGroup:`这里还没有形成理解。`,correct:`修正`,save:`保存修正`,cancel:`取消`,correctionPlaceholder:`写下更准确的说法…`,searchPlaceholder:`搜索工作记忆…`,allMemory:`全部工作记忆`,memoryFilterHint:`按记忆类型筛选`,memoryLibraryHint:`这里只显示提炼后的事实、决定、经验、承诺和待解问题;邮件、日历与文档原文保留在对应来源中。`,noKnowledge:`还没有形成工作记忆。`,noKnowledgeMatch:`没有符合搜索条件的工作记忆。`,showMore:`显示更多`,expand:`查看详情`,collapse:`收起详情`,disable:`停用`,disabled:`已停用`,enable:`启用`,loadFailed:`无法载入对你的理解。`,tryAgain:`重试`,actionFailed:`修改没有保存,请重试。`}},Ft=new Set([`identity.call_name`,`identity.role`,`identity.pronouns`,`preference.timezone`,`preference.locale`]),It=[`work_thread`,`project_fact`,`workspace_fact`,`decision`,`task_lesson`,`commitment`,`open_question`,`episode`,`note`],Lt=`UTC.Africa/Cairo.Africa/Johannesburg.America/Chicago.America/Denver.America/Los_Angeles.America/Mexico_City.America/New_York.America/Sao_Paulo.America/Toronto.America/Vancouver.Asia/Bangkok.Asia/Dubai.Asia/Hong_Kong.Asia/Jakarta.Asia/Kolkata.Asia/Seoul.Asia/Shanghai.Asia/Singapore.Asia/Taipei.Asia/Tokyo.Australia/Melbourne.Australia/Perth.Australia/Sydney.Europe/Amsterdam.Europe/Berlin.Europe/London.Europe/Madrid.Europe/Paris.Europe/Rome.Pacific/Auckland.Pacific/Honolulu`.split(`.`);function Rt(){try{let e=Intl.supportedValuesOf(`timeZone`);return[...new Set([`UTC`,...e])]}catch{return[...Lt]}}var zt=Rt();function Bt(e){return e.map(e=>({value:e,label:e.replaceAll(`_`,` `),group:e.includes(`/`)?e.split(`/`)[0]:`UTC`}))}function Vt(e,t,n=!1){return e?new Intl.DateTimeFormat(t===`zh`?`zh-CN`:`en`,{dateStyle:`medium`,...n?{timeStyle:`short`}:{}}).format(e):null}function Ht(e){return typeof e==`string`&&e.trim()?e.trim():void 0}function Ut(e){return{callName:Ht(e.profile.callName)??``,role:Ht(e.profile.role)??``,pronouns:Ht(e.profile.pronouns)??``,timezone:Ht(e.profile.timezone)??``,locale:Ht(e.profile.locale)??``}}function Wt(e,t){return{"zh-CN":{en:`Simplified Chinese`,zh:`简体中文`},"zh-TW":{en:`Traditional Chinese`,zh:`繁体中文`},"en-US":{en:`English (US)`,zh:`英语(美国)`},"en-GB":{en:`English (UK)`,zh:`英语(英国)`},"ja-JP":{en:`Japanese`,zh:`日语`}}[e]?.[t]??e}function Gt(e,t){let n=Vt(e,t);return t===`zh`?`当前安排至 ${n}`:`Current plan through ${n}`}function Kt(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)}`}function qt(e){let[t,n,r]=e.split(`-`).map(Number);return new Date(t,n-1,r,23,59,59,999).getTime()}function Jt(e,t){return(t===`zh`?{global:`所有协作`,agent:`当前智能体`,workspace:`当前工作区`,project:`当前项目`,session:`当前会话`}:{global:`All work`,agent:`This agent`,workspace:`This workspace`,project:`This project`,session:`This conversation`})[e.type]}function Yt(e,t){return(t===`zh`?{work_thread:`工作主线`,project_fact:`项目事实`,workspace_fact:`工作区事实`,decision:`已经决定`,task_lesson:`工作经验`,commitment:`承诺与约定`,open_question:`待解问题`,episode:`重要经历`,note:`其他记录`}:{work_thread:`Work threads`,project_fact:`Project facts`,workspace_fact:`Workspace facts`,decision:`Decisions`,task_lesson:`Lessons`,commitment:`Commitments`,open_question:`Open questions`,episode:`Episodes`,note:`Notes`})[e]}function Xt(e,t,n){if(e)return e.targetType===`goal`?t.find(t=>t.id===e.targetId)?.title:/^[0-9a-f]{8}-[0-9a-f-]{20,}$/i.test(e.targetId)?(n===`zh`?{project:`当前项目`,task:`当前任务`,assertion:`一项待处理的理解`,topic:`当前主题`}:{project:`Current project`,task:`Current task`,assertion:`An understanding to address`,topic:`Current topic`})[e.targetType]:e.targetId}function Zt(e){let t=(0,X.c)(16),{title:n,hint:r,action:i,children:a,className:o}=e,s=o===void 0?``:o,c;t[0]===n?c=t[1]:(c=(0,Z.jsx)(`h2`,{className:`text-base font-semibold tracking-tight text-fg`,children:n}),t[0]=n,t[1]=c);let l;t[2]===r?l=t[3]:(l=r?(0,Z.jsx)(`p`,{className:`mt-1 max-w-2xl text-sm leading-6 text-fg-muted`,children:r}):null,t[2]=r,t[3]=l);let u;t[4]!==c||t[5]!==l?(u=(0,Z.jsxs)(`div`,{children:[c,l]}),t[4]=c,t[5]=l,t[6]=u):u=t[6];let d;t[7]!==i||t[8]!==u?(d=(0,Z.jsxs)(`header`,{className:`flex items-end justify-between gap-4 px-1 pb-3`,children:[u,i]}),t[7]=i,t[8]=u,t[9]=d):d=t[9];let f;t[10]===a?f=t[11]:(f=(0,Z.jsx)(`div`,{className:`overflow-hidden rounded-2xl bg-surface-panel`,children:a}),t[10]=a,t[11]=f);let p;return t[12]!==s||t[13]!==d||t[14]!==f?(p=(0,Z.jsxs)(`section`,{className:s,children:[d,f]}),t[12]=s,t[13]=d,t[14]=f,t[15]=p):p=t[15],p}function Qt(e){let t=(0,X.c)(7),{icon:n,children:r}=e,i;t[0]===n?i=t[1]:(i=(0,Z.jsx)(`span`,{className:`text-fg-subtle`,children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=(0,Z.jsx)(`p`,{children:r}),t[2]=r,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,Z.jsxs)(`div`,{className:`flex items-center gap-3 px-5 py-5 text-sm text-fg-muted`,children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function $t({open:e,profile:t,language:n,saving:r,onOpenChange:i,onSave:a}){let o=Pt[n],[s,c]=(0,Y.useState)(t),[l,u]=(0,Y.useState)(``);(0,Y.useEffect)(()=>{e&&(c(t),u(``))},[e,t]);let d=e=>{e.preventDefault(),a({callName:s.callName.trim(),role:s.role.trim(),pronouns:s.pronouns.trim(),timezone:s.timezone.trim(),locale:s.locale.trim()})},f=(e,t,n)=>(0,Z.jsxs)(`label`,{className:`grid gap-1.5 text-sm`,children:[(0,Z.jsx)(`span`,{className:`font-medium text-fg`,children:t}),(0,Z.jsx)(`input`,{value:s[e],onChange:t=>c(n=>({...n,[e]:t.target.value})),placeholder:n,className:`h-10 w-full rounded-xl border border-edge bg-surface-base px-3 text-sm text-fg outline-none transition placeholder:text-fg-subtle focus:border-accent focus:ring-2 focus:ring-accent/20`})]}),p=[`zh-CN`,`zh-TW`,`en-US`,`en-GB`,`ja-JP`];s.locale&&!p.includes(s.locale)&&p.push(s.locale);let m=k(),h=(0,Y.useMemo)(()=>[...new Set([...zt,m,s.timezone].filter(Boolean))].sort(),[m,s.timezone]),g=l.trim().toLocaleLowerCase(),_=(0,Y.useMemo)(()=>Bt(h.filter(e=>!g||e.toLocaleLowerCase().includes(g)||e.replaceAll(`_`,` `).toLocaleLowerCase().includes(g))),[h,g]);return(0,Z.jsx)(Me,{open:e,onOpenChange:i,children:(0,Z.jsxs)(ke,{children:[(0,Z.jsx)(Te,{className:`xopc-dialog-overlay fixed inset-0 z-[80] bg-scrim backdrop-blur-[2px]`}),(0,Z.jsx)(Ae,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[90] h-[min(40rem,calc(100vh-2rem))] w-[min(42rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 rounded-2xl border border-edge bg-surface-overlay shadow-popover outline-none`,children:(0,Z.jsxs)(`form`,{className:`flex h-full min-h-0 flex-col overflow-hidden [border-radius:inherit]`,onSubmit:d,children:[(0,Z.jsxs)(`header`,{className:`flex shrink-0 items-start justify-between gap-4 border-b border-edge px-5 py-4 sm:px-6`,children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(je,{className:`font-semibold text-fg`,children:o.editProfile}),(0,Z.jsx)(De,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:o.editProfileHint})]}),(0,Z.jsx)(Oe,{asChild:!0,children:(0,Z.jsx)(J,{variant:`ghost`,className:`size-8 shrink-0 p-0`,"aria-label":o.cancel,children:(0,Z.jsx)(xe,{className:`size-4`})})})]}),(0,Z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5 sm:p-6`,children:(0,Z.jsxs)(`div`,{className:`grid gap-5 sm:grid-cols-2`,children:[f(`callName`,o.callName,o.callNamePlaceholder),f(`role`,o.role,o.rolePlaceholder),f(`pronouns`,o.pronouns,o.pronounsPlaceholder),(0,Z.jsxs)(`label`,{className:`grid gap-1.5 text-sm`,children:[(0,Z.jsx)(`span`,{className:`font-medium text-fg`,children:o.locale}),(0,Z.jsxs)(R,{value:s.locale,onChange:e=>c(t=>({...t,locale:e.target.value})),children:[(0,Z.jsx)(z,{value:``,children:o.notProvided}),p.map(e=>(0,Z.jsx)(z,{value:e,children:Wt(e,n)},e))]})]}),(0,Z.jsxs)(`label`,{className:`grid gap-1.5 text-sm sm:col-span-2`,children:[(0,Z.jsx)(`span`,{className:`font-medium text-fg`,children:o.timezone}),(0,Z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Z.jsx)(B,{value:s.timezone,options:_,placeholder:k(),emptyLabel:o.notProvided,ariaLabel:o.timezone,selectedLabel:s.timezone||o.notProvided,searchPlaceholder:o.timezoneSearch,searchValue:l,onSearchChange:u,statusMessage:_.length?void 0:o.timezoneNoMatch,triggerClassName:`min-w-0 flex-1 rounded-xl bg-surface-base`,onChange:e=>{c(t=>({...t,timezone:e})),u(``)}}),(0,Z.jsx)(J,{className:`shrink-0 whitespace-nowrap`,onClick:()=>c(e=>({...e,timezone:m})),children:o.useDeviceTimezone})]})]})]})}),(0,Z.jsxs)(`footer`,{className:`flex shrink-0 justify-end gap-2 border-t border-edge px-5 py-3 sm:px-6`,children:[(0,Z.jsx)(Oe,{asChild:!0,children:(0,Z.jsx)(J,{disabled:r,children:o.cancel})}),(0,Z.jsxs)(J,{type:`submit`,variant:`primary`,disabled:r,children:[r?(0,Z.jsx)(se,{className:`size-4 animate-spin`}):null,r?o.saving:o.saveProfile]})]})]})})]})})}function en(e){let t=(0,X.c)(94),{open:n,priority:r,title:i,outcome:a,language:o,saving:s,onOpenChange:c,onSave:l,onEnd:u}=e,d=Pt[o],[f,p]=(0,Y.useState)(i),[m,h]=(0,Y.useState)(a??``),g=r?.validTo??Date.now()+6048e5,_;t[0]===g?_=t[1]:(_=Kt(g),t[0]=g,t[1]=_);let v=_,[y,b]=(0,Y.useState)(v),x,S;t[2]!==v||t[3]!==n||t[4]!==a||t[5]!==i?(x=()=>{n&&(p(i),h(a??``),b(v))},S=[v,n,a,i],t[2]=v,t[3]=n,t[4]=a,t[5]=i,t[6]=x,t[7]=S):(x=t[6],S=t[7]),(0,Y.useEffect)(x,S);let C;t[8]!==m||t[9]!==f||t[10]!==y||t[11]!==l||t[12]!==r?.targetType?(C=e=>{e.preventDefault(),l({title:f.trim(),...r?.targetType===`goal`?{desiredOutcome:m.trim()}:{},validTo:qt(y)})},t[8]=m,t[9]=f,t[10]=y,t[11]=l,t[12]=r?.targetType,t[13]=C):C=t[13];let w=C,T;t[14]!==m||t[15]!==f||t[16]!==y||t[17]!==r?.targetType?(T=f.trim()&&y&&(r?.targetType!==`goal`||m.trim()),t[14]=m,t[15]=f,t[16]=y,t[17]=r?.targetType,t[18]=T):T=t[18];let E=!!T,D;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Z.jsx)(Te,{className:`xopc-dialog-overlay fixed inset-0 z-[80] bg-scrim backdrop-blur-[2px]`}),t[19]=D):D=t[19];let O=r?d.editPriority:d.addPriority,k;t[20]===O?k=t[21]:(k=(0,Z.jsx)(je,{className:`font-semibold text-fg`,children:O}),t[20]=O,t[21]=k);let A;t[22]===d.priorityHint?A=t[23]:(A=(0,Z.jsx)(De,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:d.priorityHint}),t[22]=d.priorityHint,t[23]=A);let j;t[24]!==A||t[25]!==k?(j=(0,Z.jsxs)(`div`,{children:[k,A]}),t[24]=A,t[25]=k,t[26]=j):j=t[26];let M;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,Z.jsx)(xe,{className:`size-4`}),t[27]=M):M=t[27];let N;t[28]===d.cancel?N=t[29]:(N=(0,Z.jsx)(Oe,{asChild:!0,children:(0,Z.jsx)(J,{variant:`ghost`,className:`size-8 shrink-0 p-0`,"aria-label":d.cancel,children:M})}),t[28]=d.cancel,t[29]=N);let P;t[30]!==j||t[31]!==N?(P=(0,Z.jsxs)(`header`,{className:`flex shrink-0 items-start justify-between gap-4 border-b border-edge px-5 py-4 sm:px-6`,children:[j,N]}),t[30]=j,t[31]=N,t[32]=P):P=t[32];let F;t[33]===d.priorityTitle?F=t[34]:(F=(0,Z.jsx)(`span`,{className:`font-medium text-fg`,children:d.priorityTitle}),t[33]=d.priorityTitle,t[34]=F);let ee;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(ee=e=>p(e.target.value),t[35]=ee):ee=t[35];let I;t[36]!==f||t[37]!==d.priorityTitlePlaceholder?(I=(0,Z.jsx)(`input`,{autoFocus:!0,value:f,onChange:ee,placeholder:d.priorityTitlePlaceholder,className:`h-10 w-full rounded-xl border border-edge bg-surface-base px-3 text-sm text-fg outline-none transition placeholder:text-fg-subtle focus:border-accent focus:ring-2 focus:ring-accent/20`}),t[36]=f,t[37]=d.priorityTitlePlaceholder,t[38]=I):I=t[38];let L;t[39]!==F||t[40]!==I?(L=(0,Z.jsxs)(`label`,{className:`grid gap-1.5 text-sm`,children:[F,I]}),t[39]=F,t[40]=I,t[41]=L):L=t[41];let R;t[42]!==m||t[43]!==r?.targetType||t[44]!==d.priorityOutcome||t[45]!==d.priorityOutcomePlaceholder?(R=r?.targetType===`goal`?(0,Z.jsxs)(`label`,{className:`grid gap-1.5 text-sm`,children:[(0,Z.jsx)(`span`,{className:`font-medium text-fg`,children:d.priorityOutcome}),(0,Z.jsx)(`textarea`,{value:m,onChange:e=>h(e.target.value),placeholder:d.priorityOutcomePlaceholder,className:`min-h-28 w-full resize-y rounded-xl border border-edge bg-surface-base px-3 py-2.5 text-sm leading-6 text-fg outline-none transition placeholder:text-fg-subtle focus:border-accent focus:ring-2 focus:ring-accent/20`})]}):null,t[42]=m,t[43]=r?.targetType,t[44]=d.priorityOutcome,t[45]=d.priorityOutcomePlaceholder,t[46]=R):R=t[46];let z;t[47]===d.priorityUntil?z=t[48]:(z=(0,Z.jsx)(`span`,{className:`font-medium text-fg`,children:d.priorityUntil}),t[47]=d.priorityUntil,t[48]=z);let B;t[49]===r?.validFrom?B=t[50]:(B=r?.validFrom??Date.now(),t[49]=r?.validFrom,t[50]=B);let V;t[51]===B?V=t[52]:(V=Kt(B),t[51]=B,t[52]=V);let H;t[53]!==y||t[54]!==d.priorityUntil||t[55]!==V?(H=(0,Z.jsx)(Ue,{min:V,value:y,onChange:b,ariaLabel:d.priorityUntil,className:`rounded-xl border border-edge bg-surface-base hover:border-edge-strong hover:bg-surface-base`}),t[53]=y,t[54]=d.priorityUntil,t[55]=V,t[56]=H):H=t[56];let U;t[57]!==z||t[58]!==H?(U=(0,Z.jsxs)(`label`,{className:`grid gap-1.5 text-sm`,children:[z,H]}),t[57]=z,t[58]=H,t[59]=U):U=t[59];let W;t[60]!==L||t[61]!==R||t[62]!==U?(W=(0,Z.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-5 overflow-y-auto p-5 sm:p-6`,children:[L,R,U]}),t[60]=L,t[61]=R,t[62]=U,t[63]=W):W=t[63];let te;t[64]!==u||t[65]!==r||t[66]!==s||t[67]!==d.endPriority||t[68]!==d.endingPriority?(te=r&&u?(0,Z.jsxs)(J,{variant:`ghost`,className:`text-danger hover:text-danger`,disabled:s,onClick:u,children:[s?(0,Z.jsx)(se,{className:`size-4 animate-spin`}):null,s?d.endingPriority:d.endPriority]}):(0,Z.jsx)(`span`,{}),t[64]=u,t[65]=r,t[66]=s,t[67]=d.endPriority,t[68]=d.endingPriority,t[69]=te):te=t[69];let ne;t[70]!==s||t[71]!==d.cancel?(ne=(0,Z.jsx)(Oe,{asChild:!0,children:(0,Z.jsx)(J,{disabled:s,children:d.cancel})}),t[70]=s,t[71]=d.cancel,t[72]=ne):ne=t[72];let G=!E||s,re;t[73]===s?re=t[74]:(re=s?(0,Z.jsx)(se,{className:`size-4 animate-spin`}):null,t[73]=s,t[74]=re);let K;t[75]!==d.savePriority||t[76]!==G||t[77]!==re?(K=(0,Z.jsxs)(J,{type:`submit`,variant:`primary`,disabled:G,children:[re,d.savePriority]}),t[75]=d.savePriority,t[76]=G,t[77]=re,t[78]=K):K=t[78];let ie;t[79]!==ne||t[80]!==K?(ie=(0,Z.jsxs)(`div`,{className:`flex gap-2`,children:[ne,K]}),t[79]=ne,t[80]=K,t[81]=ie):ie=t[81];let q;t[82]!==te||t[83]!==ie?(q=(0,Z.jsxs)(`footer`,{className:`flex shrink-0 flex-wrap items-center justify-between gap-2 border-t border-edge px-5 py-3 sm:px-6`,children:[te,ie]}),t[82]=te,t[83]=ie,t[84]=q):q=t[84];let ae;t[85]!==w||t[86]!==P||t[87]!==W||t[88]!==q?(ae=(0,Z.jsxs)(ke,{children:[D,(0,Z.jsx)(Ae,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[90] h-[min(34rem,calc(100vh-2rem))] w-[min(38rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 rounded-2xl border border-edge bg-surface-overlay shadow-popover outline-none`,children:(0,Z.jsxs)(`form`,{className:`flex h-full min-h-0 flex-col overflow-hidden [border-radius:inherit]`,onSubmit:w,children:[P,W,q]})})]}),t[85]=w,t[86]=P,t[87]=W,t[88]=q,t[89]=ae):ae=t[89];let oe;return t[90]!==c||t[91]!==n||t[92]!==ae?(oe=(0,Z.jsx)(Me,{open:n,onOpenChange:c,children:ae}),t[90]=c,t[91]=n,t[92]=ae,t[93]=oe):oe=t[93],oe}function tn(e){let t=(0,X.c)(16),{rule:n,language:r,busy:i,onToggle:a}=e,o=Pt[r],s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsx)(M,{className:`mt-0.5 size-4 shrink-0 text-fg-subtle`}),t[0]=s):s=t[0];let c;t[1]===n.statement?c=t[2]:(c=(0,Z.jsx)(`p`,{className:`min-w-0 flex-1 text-sm leading-6 text-fg`,children:n.statement}),t[1]=n.statement,t[2]=c);let l;t[3]!==n.status||t[4]!==o.disabled?(l=n.status===`disabled`?(0,Z.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:o.disabled}):null,t[3]=n.status,t[4]=o.disabled,t[5]=l):l=t[5];let u=n.status===`active`?o.disable:o.enable,d;t[6]!==i||t[7]!==a||t[8]!==u?(d=(0,Z.jsx)(J,{variant:`ghost`,className:`h-8`,disabled:i,onClick:a,children:u}),t[6]=i,t[7]=a,t[8]=u,t[9]=d):d=t[9];let f;t[10]!==l||t[11]!==d?(f=(0,Z.jsxs)(`div`,{className:`flex shrink-0 flex-col items-end gap-1`,children:[l,d]}),t[10]=l,t[11]=d,t[12]=f):f=t[12];let p;return t[13]!==c||t[14]!==f?(p=(0,Z.jsxs)(`div`,{className:`flex items-start gap-3 border-t border-edge-subtle px-5 py-3 first:border-t-0`,children:[s,c,f]}),t[13]=c,t[14]=f,t[15]=p):p=t[15],p}function nn(e){let t=(0,X.c)(15),{suggestion:n,language:r,busy:i,onConfirm:a}=e,o=r===`zh`,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsx)(ge,{className:`mt-0.5 size-4 shrink-0 text-accent-fg`}),t[0]=s):s=t[0];let c;t[1]===n.statement?c=t[2]:(c=(0,Z.jsx)(`p`,{className:`text-sm leading-6 text-fg`,children:n.statement}),t[1]=n.statement,t[2]=c);let l=o?`根据你已确认的模式生成;确认前不会生效`:`Suggested from a pattern you confirmed; inactive until you approve`,u;t[3]===l?u=t[4]:(u=(0,Z.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-subtle`,children:l}),t[3]=l,t[4]=u);let d;t[5]!==c||t[6]!==u?(d=(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[c,u]}),t[5]=c,t[6]=u,t[7]=d):d=t[7];let f=i?o?`启用中…`:`Enabling…`:o?`确认启用`:`Approve`,p;t[8]!==i||t[9]!==a||t[10]!==f?(p=(0,Z.jsx)(J,{variant:`secondary`,className:`h-8 shrink-0`,disabled:i,onClick:a,children:f}),t[8]=i,t[9]=a,t[10]=f,t[11]=p):p=t[11];let m;return t[12]!==d||t[13]!==p?(m=(0,Z.jsxs)(`div`,{className:`flex items-start gap-3 border-t border-edge-subtle px-5 py-3 first:border-t-0`,children:[s,d,p]}),t[12]=d,t[13]=p,t[14]=m):m=t[14],m}function rn(e){let t=(0,X.c)(26),{item:n,language:r,busy:i,expanded:a,onToggle:o,editing:s,draft:c,onDraftChange:l,onEdit:d,onCancel:f,onReview:p,onDelete:m}=e,h=Pt[r],g=n.updatedAt??n.createdAt,_;t[0]!==r||t[1]!==g?(_=Vt(g,r),t[0]=r,t[1]=g,t[2]=_):_=t[2];let v=_,y;t[3]!==n.claimMode||t[4]!==n.content?(y=n.content.length>96||n.content.includes(`
|
|
2
|
-
`)||!!n.claimMode,t[3]=n.claimMode,t[4]=n.content,t[5]=y):y=t[5];let b=y,x;return t[6]!==i||t[7]!==b||t[8]!==v||t[9]!==c||t[10]!==s||t[11]!==a||t[12]!==n.claimMode||t[13]!==n.content||t[14]!==n.id||t[15]!==n.scope||t[16]!==n.verification||t[17]!==r||t[18]!==f||t[19]!==m||t[20]!==l||t[21]!==d||t[22]!==p||t[23]!==o||t[24]!==h?(x=(0,Z.jsx)(`article`,{className:`group border-t border-edge-subtle px-5 py-4 first:border-t-0 sm:px-6`,children:s?(0,Z.jsxs)(`div`,{className:`space-y-3`,children:[(0,Z.jsx)(`textarea`,{"aria-label":h.correctionPlaceholder,disabled:i,value:c,onChange:e=>l(e.target.value),className:`min-h-24 w-full resize-y rounded-xl border border-edge bg-surface-base px-3 py-2.5 text-sm leading-6 text-fg outline-none transition focus:border-accent focus:ring-2 focus:ring-accent/20`}),(0,Z.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,Z.jsx)(J,{variant:`ghost`,className:`h-8`,onClick:f,children:h.cancel}),(0,Z.jsx)(J,{variant:`primary`,className:`h-8`,disabled:!c.trim()||i,onClick:()=>p(`edit_and_approve`,c.trim()),children:h.save})]})]}):(0,Z.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Z.jsx)(u,{className:`mt-1 size-4 shrink-0 text-fg-subtle`}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-base leading-7 text-fg ${a?``:`line-clamp-2`}`,children:n.content}),(0,Z.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-fg-subtle`,children:[(0,Z.jsx)(`span`,{children:Jt(n.scope,r)}),n.claimMode===`reported`?(0,Z.jsx)(`span`,{children:r===`zh`?`来源报告`:`Source report`}):null,n.verification===`tentative`?(0,Z.jsx)(`span`,{children:r===`zh`?`证据待补充`:`Evidence pending`}):null,v?(0,Z.jsx)(`span`,{children:v}):null]}),a?(0,Z.jsx)(Mt,{id:n.id,language:r}):null]}),(0,Z.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[b?(0,Z.jsx)(J,{variant:`ghost`,className:`size-11 p-0`,"aria-expanded":a,"aria-label":a?h.collapse:h.expand,onClick:o,children:(0,Z.jsx)(I,{className:`size-3.5 transition-transform ${a?`rotate-180`:``}`})}):null,(0,Z.jsx)(Ye,{language:r,busy:i,statement:n.content,onEdit:d,onDelete:m})]})]})}),t[6]=i,t[7]=b,t[8]=v,t[9]=c,t[10]=s,t[11]=a,t[12]=n.claimMode,t[13]=n.content,t[14]=n.id,t[15]=n.scope,t[16]=n.verification,t[17]=r,t[18]=f,t[19]=m,t[20]=l,t[21]=d,t[22]=p,t[23]=o,t[24]=h,t[25]=x):x=t[25],x}function an(){let e=c(e=>e.language),t=Pt[e],n=Fe(e=>e.setPageHeader),r=Fe(e=>e.clearPageHeader),[i,s]=a(),{data:l,error:u,isLoading:d,isValidating:k,mutate:A}=Ce(`/api/user-model`,C),I=Nt(i),[B,H]=(0,Y.useState)(),[ne,G]=(0,Y.useState)(),[re,K]=(0,Y.useState)(``),[ie,q]=(0,Y.useState)(),[ae,oe]=(0,Y.useState)(``),[le,he]=(0,Y.useState)(``),[_e,ve]=(0,Y.useState)(24),[Se,Te]=(0,Y.useState)(),[Ee,De]=(0,Y.useState)(!1),[Oe,ke]=(0,Y.useState)(!1),[Ae,je]=(0,Y.useState)(`all`),[Me,Ne]=(0,Y.useState)(`personal`),[Re,ze]=(0,Y.useState)(`all`),[Be,Ve]=(0,Y.useState)(`idle`),He=(0,Y.useRef)(void 0),Ue=e=>{if(e===I)return;let t=document.getElementById(`app-main-content`);typeof t?.scrollTo==`function`&&t.scrollTo({top:0,behavior:`auto`}),s(t=>{let n=new URLSearchParams(t);return e===`overview`?n.delete(`tab`):n.set(`tab`,e),n})},X=(0,Y.useCallback)(async()=>{if(!(Be===`refreshing`||k)){He.current&&window.clearTimeout(He.current),Ve(`refreshing`),G(void 0),K(t.refreshing);try{await A(),Ve(`success`),K(t.refreshComplete)}catch{Ve(`error`),K(``),G(t.refreshFailed)}finally{He.current=window.setTimeout(()=>Ve(`idle`),1600)}}},[k,A,Be,t]);(0,Y.useEffect)(()=>()=>{He.current&&window.clearTimeout(He.current)},[]);let We=k||Be===`refreshing`,Ge=We?t.refreshing:Be===`success`?t.refreshComplete:Be===`error`?t.refreshFailed:t.refresh;(0,Y.useEffect)(()=>(n({startExtra:null,main:(0,Z.jsx)(`h1`,{className:`text-base font-semibold text-fg`,children:t.pageTitle}),end:(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(yt,{}),(0,Z.jsx)(J,{variant:`secondary`,className:`size-9 p-0 ${Be===`success`?`text-success`:Be===`error`?`text-danger`:``}`,disabled:We,"aria-label":Ge,title:Ge,onClick:()=>void X(),children:We?(0,Z.jsx)(se,{className:`size-4 animate-spin motion-reduce:animate-none`,"aria-hidden":`true`}):Be===`success`?(0,Z.jsx)(ee,{className:`size-4`,"aria-hidden":`true`}):Be===`error`?(0,Z.jsx)(V,{className:`size-4`,"aria-hidden":`true`}):(0,Z.jsx)(fe,{className:`size-4`,"aria-hidden":`true`})})]})}),r),[r,We,Be,Ge,X,n,t]);let Q=async(n,r)=>{H(n),G(void 0),K(``);try{await r(),await A(),K(e===`zh`?`已更新`:`Updated`)}catch{G(t.actionFailed)}finally{H(void 0)}},Ke=e=>{Q(e.id,async()=>{await T(e.id,ae.trim()),q(void 0),oe(``)})},qe=async e=>{H(`profile`),G(void 0),K(``);try{await m(e),await A(),De(!1)}catch{G(t.actionFailed)}finally{H(void 0)}},Je=async(n,r)=>{H(`priority:${n.id}`),G(void 0),K(``);try{await b(n.id,r),await A(),ke(!1),K(e===`zh`?`当前关注已更新`:`Current focus updated`)}catch{G(t.actionFailed)}finally{H(void 0)}},Ye=async n=>{H(`priority:create`),G(void 0),K(``);try{await O(n),await A(),ke(!1),K(e===`zh`?`当前关注已设置`:`Current focus set`)}catch{G(t.actionFailed)}finally{H(void 0)}},Xe=async n=>{H(`priority:${n.id}`),G(void 0),K(``);try{await b(n.id,{status:`completed`}),await A(),ke(!1),K(e===`zh`?`当前关注已结束`:`Current focus ended`)}catch{G(t.actionFailed)}finally{H(void 0)}};if(d)return(0,Z.jsxs)(`div`,{className:`mx-auto w-full max-w-7xl space-y-5 px-4 pb-7 pt-3 sm:px-6 lg:px-8 lg:pb-9 lg:pt-4`,children:[(0,Z.jsx)(we,{className:`h-10 w-72 rounded-xl`}),(0,Z.jsx)(we,{className:`h-72 rounded-xl`}),(0,Z.jsxs)(`div`,{className:`grid gap-5 lg:grid-cols-2`,children:[(0,Z.jsx)(we,{className:`h-80 rounded-xl`}),(0,Z.jsx)(we,{className:`h-80 rounded-xl`})]})]});if(u||!l)return(0,Z.jsxs)(`div`,{className:`mx-auto flex min-h-72 max-w-xl flex-col items-center justify-center gap-3 p-6 text-center`,children:[(0,Z.jsx)(f,{className:`size-6 text-fg-subtle`}),(0,Z.jsx)(`p`,{className:`text-sm text-danger`,children:t.loadFailed}),(0,Z.jsx)(J,{onClick:()=>void A(),children:t.tryAgain})]});let Ze=l.assertions.filter(e=>e.usable&&!Ft.has(e.predicate)).sort((e,t)=>{let n=e.declaredImportance??e.inferredImportance;return(t.declaredImportance??t.inferredImportance)-n||t.recordedAt-e.recordedAt}),Qe=l.assertions.filter(e=>[`candidate`,`needs_review`,`conflicted`].includes(e.status)).sort((e,t)=>t.recordedAt-e.recordedAt),$e=Ut(l),et=$e.callName||(e===`zh`?`你`:`You`),tt=Ze.filter(e=>e.authority===`user_explicit`).length,rt=Ze.length-tt,it=Ze.filter(e=>Ae===`explicit`?e.authority===`user_explicit`:Ae!==`learned`||e.authority!==`user_explicit`),at=l.priorities.filter(e=>e.status===`active`&&e.validTo>Date.now()),$=at.find(e=>e.rank===`primary`)??at[0],ot=Xt($,l.goals,e),st=$?.targetType===`goal`?l.goals.find(e=>e.id===$.targetId):void 0,ct=l.goals.filter(e=>e.status===`active`||e.status===`paused`),lt=ct.filter(e=>$?.targetType!==`goal`||e.id!==$.targetId),ut=l.rules.filter(e=>e.status!==`archived`),dt=l.ruleSuggestions??[],ft=l.knowledge.filter(e=>e.status!==`archived`&&e.status!==`rejected`),pt=le.trim().toLocaleLowerCase(),mt=ft.filter(e=>Re===`all`||e.kind===Re),ht=mt.filter(t=>!pt||t.content.toLocaleLowerCase().includes(pt)||Yt(t.kind,e).toLocaleLowerCase().includes(pt)),gt=[{key:`identity`,title:t.identity,icon:be,items:it.filter(e=>e.kind===`identity`)},{key:`preferences`,title:t.preferences,icon:p,items:it.filter(e=>[`preference`,`value`,`routine`,`capability`].includes(e.kind))},{key:`relationships`,title:t.relationships,icon:M,items:it.filter(e=>e.kind===`relationship`)},{key:`current`,title:t.currentState,icon:U,items:it.filter(e=>e.kind===`current_state`)},{key:`insights`,title:t.insights,icon:ge,items:it.filter(e=>e.kind===`derived_insight`)}].filter(e=>e.items.length>0),_t=[{key:`about`,icon:be,label:e===`zh`?`关于我`:`About me`,hint:e===`zh`?`身份、背景与能力`:`Identity, background, and capabilities`,count:Ze.filter(e=>[`identity`,`capability`].includes(e.kind)).length},{key:`preferences`,icon:p,label:e===`zh`?`偏好与习惯`:`Preferences & habits`,hint:e===`zh`?`沟通方式与日常习惯`:`Communication and routines`,count:Ze.filter(e=>[`preference`,`value`,`routine`].includes(e.kind)).length},{key:`people`,icon:M,label:e===`zh`?`重要的人`:`Important people`,hint:e===`zh`?`与你有关的人和关系`:`People and relationships`,count:Ze.filter(e=>e.kind===`relationship`).length},{key:`goals`,icon:ge,label:e===`zh`?`目标与计划`:`Goals & plans`,hint:e===`zh`?`正在推进的长期目标`:`Long-term outcomes in progress`,count:ct.length}],vt=It.map(e=>({kind:e,count:ft.filter(t=>t.kind===e).length})).filter(e=>e.count>0),xt=vt.slice(0,4),St=xt.length===1?`grid-cols-1`:`sm:grid-cols-2`,Ct=ht.slice(0,_e),wt=It.map(e=>({kind:e,items:Ct.filter(t=>t.kind===e),totalCount:ht.filter(t=>t.kind===e).length})).filter(e=>e.items.length>0),Tt=[{id:`all`,label:t.allUnderstanding,count:Ze.length},{id:`explicit`,label:t.explicit,count:tt},{id:`learned`,label:t.learned,count:rt}],Et=e=>{je(e),Ne(`personal`),Ue(`understanding`)},Dt=e=>{ze(e),he(``),ve(24),Ne(`work`),Ue(`understanding`)},Ot=t=>(0,Z.jsx)(nt,{item:t,language:e,busy:!!B,editing:ie===t.id,draft:ie===t.id?ae:``,onDraftChange:oe,onEdit:()=>{q(t.id),oe(t.statement)},onCancel:()=>{q(void 0),oe(``)},onDelete:()=>void Q(t.id,()=>h(t.id)),onCorrect:()=>Ke(t),onScopeChange:e=>void Q(t.id,()=>y(t.id,e))},t.id);return(0,Z.jsxs)(`div`,{className:`mx-auto w-full max-w-6xl space-y-6 px-4 pb-4 pt-3 sm:space-y-8 sm:px-6 sm:pb-7 lg:px-8 lg:pb-10 lg:pt-4`,children:[(0,Z.jsx)(bt,{language:e}),(0,Z.jsx)(Pe,{items:[{id:`overview`,label:t.overview,icon:ge},{id:`understanding`,label:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`span`,{className:`sm:hidden`,children:e===`zh`?`记忆`:`Memory`}),(0,Z.jsx)(`span`,{className:`hidden sm:inline`,children:t.understanding})]}),icon:be,count:Ze.length},{id:`privacy`,label:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`span`,{className:`sm:hidden`,children:e===`zh`?`隐私`:`Privacy`}),(0,Z.jsx)(`span`,{className:`hidden sm:inline`,children:t.privacy})]}),icon:me}],activeTab:I,onChange:Ue,ariaLabel:t.pageTitle,tabIdPrefix:`understanding-tab`,panelIdPrefix:`understanding-panel`,className:`w-full max-w-full gap-1 rounded-full bg-surface-panel p-1 shadow-surface sm:w-fit`,buttonClassName:`min-w-0 flex-1 justify-center rounded-full px-2 py-2 sm:flex-none sm:px-3.5`,selectedClassName:`bg-surface-active text-fg`,unselectedClassName:`text-fg-muted hover:bg-surface-hover hover:text-fg`}),(0,Z.jsx)(`p`,{role:`status`,className:`sr-only`,children:re}),ne?(0,Z.jsxs)(`div`,{role:`alert`,className:`flex items-center justify-between gap-3 rounded-xl border border-danger bg-danger-soft px-4 py-3 text-sm text-danger`,children:[(0,Z.jsx)(`span`,{children:ne}),(0,Z.jsx)(`button`,{type:`button`,onClick:()=>G(void 0),"aria-label":t.cancel,children:(0,Z.jsx)(xe,{className:`size-4`})})]}):null,I===`overview`?(0,Z.jsxs)(`div`,{id:`understanding-panel-overview`,role:`tabpanel`,"aria-labelledby":`understanding-tab-overview`,className:`space-y-8 sm:space-y-10`,children:[(0,Z.jsxs)(`section`,{"data-testid":`overview-hero`,className:`grid gap-5 sm:gap-8 lg:grid-cols-[minmax(0,1fr)_minmax(20rem,24rem)] lg:gap-12`,children:[(0,Z.jsxs)(`div`,{className:`min-w-0 px-1 sm:py-2`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-3 sm:flex-wrap sm:gap-5`,children:[(0,Z.jsx)(Ie,{className:`size-16 sm:size-20`,mood:ne?`care`:We||B?`work`:`listen`}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`h2`,{className:`truncate text-xl font-semibold tracking-tight text-fg sm:text-3xl`,children:et}),(0,Z.jsx)(`p`,{className:`mt-1 break-words text-sm text-fg-muted`,children:$e.role||t.notProvided})]}),(0,Z.jsxs)(J,{variant:`ghost`,className:`size-11 shrink-0 px-0 sm:h-9 sm:w-auto sm:px-3`,onClick:()=>De(!0),children:[(0,Z.jsx)(j,{className:`size-4`,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`sr-only sm:not-sr-only`,children:t.editProfile})]})]}),(0,Z.jsx)(`dl`,{className:`mt-6 hidden gap-x-8 gap-y-5 sm:grid sm:grid-cols-3`,children:[{icon:g,label:t.locale,value:$e.locale?Wt($e.locale,e):t.notProvided},{icon:N,label:t.timezone,value:$e.timezone||t.notProvided},{icon:be,label:t.pronouns,value:$e.pronouns||t.notProvided}].map(({icon:e,label:t,value:n})=>(0,Z.jsxs)(`div`,{className:`min-w-0`,children:[(0,Z.jsxs)(`dt`,{className:`flex items-center gap-1.5 text-xs text-fg-subtle`,children:[(0,Z.jsx)(e,{className:`size-3.5`,"aria-hidden":`true`}),t]}),(0,Z.jsx)(`dd`,{className:`mt-1.5 truncate text-sm font-medium text-fg`,children:n})]},t))})]}),(0,Z.jsxs)(`aside`,{"data-testid":`priority-panel`,className:`flex min-h-0 flex-col rounded-[1.4rem] bg-surface-panel p-5 shadow-surface sm:min-h-64 sm:p-6`,children:[(0,Z.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`p`,{className:`text-xs font-semibold tracking-wide text-fg-subtle`,children:t.importantNow}),$?(0,Z.jsxs)(`p`,{className:`mt-1.5 flex items-center gap-1.5 text-xs text-fg-muted`,children:[(0,Z.jsx)(P,{className:`size-3.5`,"aria-hidden":`true`}),$.targetType===`goal`?t.prioritySourceGoal:t.prioritySourceWork]}):null]}),$&&ot?(0,Z.jsxs)(J,{variant:`ghost`,className:`h-8 shrink-0 px-2.5`,onClick:()=>ke(!0),children:[(0,Z.jsx)(ue,{className:`size-3.5`,"aria-hidden":`true`}),t.editPriority]}):null]}),ot?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`p`,{className:`mt-3 text-lg font-semibold leading-7 tracking-tight text-fg`,children:ot}),st?.desiredOutcome?(0,Z.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:st.desiredOutcome}):null,$?(0,Z.jsxs)(`p`,{className:`mt-auto flex items-center gap-1.5 pt-4 text-xs text-fg-subtle`,children:[(0,Z.jsx)(F,{className:`size-3.5`,"aria-hidden":`true`}),Gt($.validTo,e)]}):null]}):(0,Z.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 py-6 text-center text-sm text-fg-muted`,children:[(0,Z.jsx)(P,{className:`size-5 text-fg-subtle`}),(0,Z.jsxs)(J,{variant:`primary`,onClick:()=>ke(!0),children:[(0,Z.jsx)(de,{className:`size-4`,"aria-hidden":`true`}),t.addPriority]})]}),lt.length?(0,Z.jsxs)(`div`,{className:`mt-5 hidden border-t border-edge-subtle pt-4 sm:block`,children:[(0,Z.jsx)(`p`,{className:`text-xs text-fg-subtle`,children:t.otherGoals}),(0,Z.jsx)(`div`,{className:`mt-2 space-y-2`,children:lt.slice(0,3).map(e=>(0,Z.jsx)(`p`,{className:`text-sm text-fg`,children:e.title},e.id))})]}):null]})]}),Qe.length?(0,Z.jsxs)(`section`,{className:`overflow-hidden rounded-2xl bg-accent-soft/70 shadow-surface`,"aria-label":e===`zh`?`需要你确认`:`Needs your review`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-4 px-5 py-4 sm:px-6`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,Z.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-full bg-surface-panel text-accent-fg`,children:(0,Z.jsx)(ge,{className:`size-4`,"aria-hidden":`true`})}),(0,Z.jsx)(`div`,{className:`min-w-0`,children:(0,Z.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:e===`zh`?`需要你确认`:`Needs your review`})})]}),(0,Z.jsx)(`span`,{className:`rounded-full bg-surface-panel px-2.5 py-1 text-xs font-medium tabular-nums text-accent-fg`,children:Qe.length})]}),(0,Z.jsxs)(`div`,{className:`border-t border-accent/10 bg-surface-panel px-5 py-4 sm:flex sm:items-center sm:gap-4 sm:px-6`,children:[(0,Z.jsx)(`p`,{className:`min-w-0 flex-1 text-sm leading-6 text-fg`,children:Qe[0].statement}),(0,Z.jsxs)(`div`,{className:`mt-3 flex shrink-0 gap-2 sm:mt-0`,children:[(0,Z.jsx)(J,{variant:`ghost`,className:`min-h-11 flex-1 sm:flex-none`,disabled:B===Qe[0].id,onClick:()=>void Q(Qe[0].id,()=>D(Qe[0].id,`rejected`)),children:e===`zh`?`不是`:`No`}),(0,Z.jsx)(J,{variant:`primary`,className:`min-h-11 flex-1 sm:flex-none`,disabled:B===Qe[0].id,onClick:()=>void Q(Qe[0].id,()=>D(Qe[0].id,`active`)),children:e===`zh`?`是的`:`That’s right`})]})]})]}):null,(0,Z.jsx)(Zt,{title:e===`zh`?`xopc 对我的了解`:`What xopc knows about me`,action:(0,Z.jsx)(J,{variant:`ghost`,className:`h-8 shrink-0`,onClick:()=>Ue(`understanding`),children:t.seeAll}),children:(0,Z.jsx)(`div`,{className:`grid sm:grid-cols-2`,children:_t.map(({key:e,icon:t,label:n,hint:r,count:i})=>(0,Z.jsxs)(`button`,{type:`button`,className:`group flex min-h-24 w-full items-center gap-4 border-t border-edge-subtle px-5 py-4 text-left first:border-t-0 hover:bg-surface-hover focus-visible:z-10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent sm:[&:nth-child(-n+2)]:border-t-0 sm:[&:nth-child(even)]:border-l`,onClick:()=>Et(`all`),"aria-label":`${n}: ${i}`,children:[(0,Z.jsx)(`span`,{className:`flex size-10 shrink-0 items-center justify-center rounded-xl bg-surface-base text-fg-muted`,children:(0,Z.jsx)(t,{className:`size-4.5`,"aria-hidden":`true`})}),(0,Z.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:n}),(0,Z.jsx)(`span`,{className:`mt-0.5 block truncate text-xs text-fg-subtle`,children:r})]}),(0,Z.jsx)(`span`,{className:`text-sm tabular-nums text-fg-muted`,children:i}),(0,Z.jsx)(L,{className:`size-4 shrink-0 text-fg-subtle transition-transform group-hover:translate-x-0.5`,"aria-hidden":`true`})]},e))})}),(0,Z.jsxs)(`div`,{className:`grid items-start gap-8 lg:grid-cols-2`,children:[(0,Z.jsx)(Zt,{title:t.howWeWork,className:`min-w-0`,children:ut.length||dt.length?(0,Z.jsxs)(Z.Fragment,{children:[ut.slice(0,3).map(t=>(0,Z.jsx)(tn,{rule:t,language:e,busy:B===t.id,onToggle:()=>void Q(t.id,()=>w(t.id,t.status===`active`?`disabled`:`active`))},t.id)),dt.slice(0,2).map(t=>(0,Z.jsx)(nn,{suggestion:t,language:e,busy:B===t.id,onConfirm:()=>void Q(t.id,()=>S(t))},t.id))]}):(0,Z.jsx)(Qt,{icon:(0,Z.jsx)(M,{className:`size-5`}),children:t.noRules})}),(0,Z.jsx)(Zt,{title:t.workMemory,className:`min-w-0`,action:(0,Z.jsx)(J,{variant:`ghost`,className:`h-8 shrink-0`,onClick:()=>Dt(`all`),children:t.seeAll}),children:vt.length?(0,Z.jsx)(`div`,{"data-testid":`memory-summary-grid`,className:`grid gap-3 bg-surface-base ${St}`,children:xt.map(({kind:t,count:n})=>(0,Z.jsxs)(`button`,{type:`button`,className:`group flex min-h-28 cursor-pointer items-start justify-between rounded-2xl bg-surface-panel px-5 py-5 text-left transition-colors hover:bg-surface-hover focus-visible:z-10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,onClick:()=>Dt(t),"aria-label":`${Yt(t,e)}: ${n}`,children:[(0,Z.jsxs)(`span`,{children:[(0,Z.jsx)(`span`,{className:`block text-2xl font-semibold tabular-nums text-fg`,children:n}),(0,Z.jsx)(`span`,{className:`mt-1 block text-sm text-fg-muted`,children:Yt(t,e)})]}),(0,Z.jsx)(L,{className:`mt-1 size-4 shrink-0 text-fg-subtle transition-transform group-hover:translate-x-0.5 group-hover:text-fg-muted motion-reduce:transform-none`,"aria-hidden":`true`})]},t))}):(0,Z.jsx)(Qt,{icon:(0,Z.jsx)(W,{className:`size-5`}),children:t.noKnowledge})})]})]}):null,I===`understanding`?(0,Z.jsxs)(`div`,{id:`understanding-panel-understanding`,role:`tabpanel`,"aria-labelledby":`understanding-tab-understanding`,className:`space-y-10`,children:[(0,Z.jsx)(Le,{className:`flex w-full gap-1 rounded-xl bg-surface-panel p-1 sm:w-fit`,role:`group`,"aria-label":e===`zh`?`记忆分类`:`Memory category`,children:[{id:`personal`,label:e===`zh`?`关于我`:`About me`,icon:be,count:Ze.length},{id:`work`,label:e===`zh`?`工作记忆`:`Work memory`,icon:P,count:ft.length}].map(({id:e,label:t,icon:n,count:r})=>(0,Z.jsxs)(`button`,{type:`button`,"aria-pressed":Me===e,className:`touch-target flex min-h-10 flex-1 items-center justify-center gap-2 rounded-lg px-3 text-sm font-medium transition-colors sm:flex-none ${Me===e?`bg-surface-active text-fg`:`text-fg-muted hover:bg-surface-hover hover:text-fg`}`,onClick:()=>Ne(e),children:[(0,Z.jsx)(n,{className:`size-4`,"aria-hidden":`true`}),t,(0,Z.jsx)(`span`,{className:`text-xs tabular-nums text-fg-subtle`,children:r})]},e))}),Me===`personal`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`px-1 pt-1`,children:[(0,Z.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Z.jsx)(f,{className:`mt-0.5 size-5 shrink-0 text-accent-fg`,"aria-hidden":`true`}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`h2`,{className:`font-semibold text-fg`,children:t.aboutYouTitle}),(0,Z.jsx)(`p`,{className:`mt-1 max-w-3xl text-sm leading-6 text-fg-muted`,children:t.aboutYouHint})]})]}),(0,Z.jsx)(Le,{className:`mt-4 flex flex-wrap gap-2`,role:`group`,"aria-label":t.understandingFilterHint,indicatorClassName:`rounded-full bg-surface-active`,children:Tt.map(e=>(0,Z.jsxs)(`button`,{type:`button`,"aria-pressed":Ae===e.id,className:`touch-target inline-flex min-h-9 cursor-pointer items-center gap-1.5 rounded-full px-3 py-1.5 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent ${Ae===e.id?`bg-surface-active text-fg`:`text-fg-muted hover:bg-surface-hover hover:text-fg`}`,onClick:()=>je(e.id),children:[e.label,(0,Z.jsx)(`span`,{className:`tabular-nums text-fg-subtle`,children:e.count})]},e.id))})]}),gt.length?gt.map(({key:e,title:t,icon:n,items:r})=>(0,Z.jsx)(Zt,{title:t,action:(0,Z.jsx)(n,{className:`size-4 text-fg-subtle`,"aria-hidden":`true`}),children:(0,Z.jsx)(`div`,{children:r.map(Ot)})},e)):(0,Z.jsx)(`div`,{className:`rounded-2xl bg-surface-panel`,children:(0,Z.jsx)(Qt,{icon:(0,Z.jsx)(f,{className:`size-5`}),children:t.emptyGroup})})]}):(0,Z.jsxs)(`div`,{className:`space-y-8`,children:[(0,Z.jsxs)(`div`,{className:`px-1 pt-1`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,Z.jsxs)(`div`,{className:`max-w-2xl`,children:[(0,Z.jsx)(`h2`,{className:`font-semibold text-fg`,children:Re===`all`?t.allMemory:Yt(Re,e)}),(0,Z.jsxs)(`p`,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:[mt.length,` `,t.items,` · `,e===`zh`?`当前筛选的工作资料记录数,包含未启用或待核验项;不同于顶部已启用且有依据的记忆数。`:`Work records matching this filter, including inactive or unverified items; separate from active, supported memories above.`,` · `,t.memoryLibraryHint]})]}),(0,Z.jsxs)(`label`,{className:`relative block sm:w-80`,children:[(0,Z.jsx)(pe,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`}),(0,Z.jsx)(`span`,{className:`sr-only`,children:t.searchPlaceholder}),(0,Z.jsx)(`input`,{type:`search`,value:le,onChange:e=>{he(e.target.value),ve(24)},placeholder:t.searchPlaceholder,className:`h-10 w-full rounded-xl border border-edge bg-surface-base pl-9 pr-3 text-sm text-fg outline-none transition placeholder:text-fg-subtle focus:border-accent focus:ring-2 focus:ring-accent/20`})]})]}),(0,Z.jsxs)(Le,{className:`mt-4 flex flex-wrap gap-2`,role:`group`,"aria-label":t.memoryFilterHint,indicatorClassName:`rounded-full bg-surface-active`,children:[(0,Z.jsxs)(`button`,{type:`button`,"aria-pressed":Re===`all`,className:`touch-target inline-flex min-h-9 cursor-pointer items-center gap-1.5 rounded-full px-3 py-1.5 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent ${Re===`all`?`bg-surface-active text-fg`:`text-fg-muted hover:bg-surface-hover hover:text-fg`}`,onClick:()=>ze(`all`),children:[t.allMemory,(0,Z.jsx)(`span`,{className:`tabular-nums text-fg-subtle`,children:ft.length})]}),vt.map(({kind:t,count:n})=>(0,Z.jsxs)(`button`,{type:`button`,"aria-pressed":Re===t,className:`touch-target inline-flex min-h-9 cursor-pointer items-center gap-1.5 rounded-full px-3 py-1.5 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent ${Re===t?`bg-surface-active text-fg`:`text-fg-muted hover:bg-surface-hover hover:text-fg`}`,onClick:()=>ze(t),children:[Yt(t,e),(0,Z.jsx)(`span`,{className:`tabular-nums text-fg-subtle`,children:n})]},t))]})]}),ht.length?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`space-y-8`,children:wt.map(({kind:t,items:n,totalCount:r})=>(0,Z.jsxs)(`section`,{className:`overflow-hidden rounded-2xl bg-surface-panel`,children:[(0,Z.jsxs)(`header`,{className:`flex items-center justify-between px-5 pb-1 pt-4 sm:px-6`,children:[(0,Z.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:Yt(t,e)}),(0,Z.jsx)(`span`,{className:`text-xs tabular-nums text-fg-subtle`,children:r})]}),(0,Z.jsx)(`div`,{children:n.map(t=>(0,Z.jsx)(rn,{item:t,language:e,busy:!!B,expanded:Se===t.id,onToggle:()=>Te(e=>e===t.id?void 0:t.id),editing:ie===`knowledge:${t.id}`,draft:ae,onDraftChange:oe,onEdit:()=>{q(`knowledge:${t.id}`),oe(t.content)},onCancel:()=>{q(void 0),oe(``)},onDelete:()=>void Q(t.id,()=>E(t.id)),onReview:(e,n)=>void Q(t.id,async()=>{await v(t,e,n),q(void 0),oe(``)})},t.id))})]},t))}),ht.length>_e?(0,Z.jsx)(`div`,{className:`flex justify-center pt-2`,children:(0,Z.jsx)(J,{onClick:()=>ve(e=>e+24),children:t.showMore})}):null]}):(0,Z.jsx)(`div`,{className:`rounded-2xl bg-surface-panel`,children:(0,Z.jsx)(Qt,{icon:(0,Z.jsx)(pe,{className:`size-5`}),children:le.trim()?t.noKnowledgeMatch:t.noKnowledge})})]})]}):null,I===`privacy`?(0,Z.jsxs)(`div`,{id:`understanding-panel-privacy`,role:`tabpanel`,"aria-labelledby":`understanding-tab-privacy`,className:`space-y-8`,children:[(0,Z.jsx)(`div`,{className:`px-1 pt-1`,children:(0,Z.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Z.jsx)(me,{className:`mt-0.5 size-5 shrink-0 text-accent-fg`,"aria-hidden":`true`}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`h2`,{className:`font-semibold text-fg`,children:e===`zh`?`你的信息,由你掌控`:`Your information, under your control`}),(0,Z.jsx)(`p`,{className:`mt-1 max-w-3xl text-sm leading-6 text-fg-muted`,children:e===`zh`?`决定 xopc 可以记住什么、从哪里了解你,以及如何迁移你的数据。`:`Decide what xopc can remember, where it learns from, and how your data moves.`})]})]})}),(0,Z.jsx)(Zt,{title:e===`zh`?`记忆与使用`:`Memory & use`,children:(0,Z.jsxs)(`div`,{className:`divide-y divide-edge-subtle`,children:[[{key:`memory`,icon:f,title:e===`zh`?`长期记忆`:`Long-term memory`,detail:e===`zh`?`记住长期有用的信息,减少重复说明。`:`Remember useful information so you do not have to repeat yourself.`,enabled:l.settings.memoryEnabled},{key:`references`,icon:ge,title:e===`zh`?`回答中的记忆引用`:`Memory references in answers`,detail:e===`zh`?`当个人信息影响回答时,显示本次参考内容。`:`Show what personal context was referenced when it shapes an answer.`,enabled:l.settings.showMemoryReferences}].map(({key:e,icon:t,title:n,detail:r,enabled:i})=>(0,Z.jsxs)(`button`,{type:`button`,role:`switch`,"aria-checked":i,disabled:!!B,className:`flex min-h-20 w-full items-center gap-4 px-5 py-4 text-left hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent disabled:opacity-60 sm:px-6`,onClick:()=>void Q(`setting:${e}`,()=>x(e===`memory`?{memoryEnabled:!i}:{showMemoryReferences:!i})),children:[(0,Z.jsx)(`span`,{className:`flex size-10 shrink-0 items-center justify-center rounded-xl bg-surface-base text-fg-muted`,children:(0,Z.jsx)(t,{className:`size-4.5`,"aria-hidden":`true`})}),(0,Z.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:n}),(0,Z.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-fg-muted`,children:r})]}),(0,Z.jsx)(`span`,{className:`relative h-6 w-11 shrink-0 rounded-full transition-colors ${i?`bg-accent`:`bg-surface-active`}`,"aria-hidden":`true`,children:(0,Z.jsx)(`span`,{className:`absolute top-0.5 size-5 rounded-full bg-white shadow-sm transition-transform ${i?`translate-x-5`:`translate-x-0.5`}`})})]},e)),(0,Z.jsxs)(`div`,{className:`flex min-h-20 items-center gap-4 px-5 py-4 sm:px-6`,children:[(0,Z.jsx)(`span`,{className:`flex size-10 shrink-0 items-center justify-center rounded-xl bg-surface-base text-fg-muted`,children:(0,Z.jsx)(ce,{className:`size-4.5`,"aria-hidden":`true`})}),(0,Z.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:e===`zh`?`敏感信息`:`Sensitive information`}),(0,Z.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-fg-muted`,children:e===`zh`?`控制健康、财务等信息是否可以保存。`:`Control whether health, financial, and similar information can be saved.`})]}),(0,Z.jsxs)(R,{"aria-label":e===`zh`?`敏感信息策略`:`Sensitive information policy`,value:l.settings.sensitiveWritePolicy,disabled:!!B,onChange:e=>void Q(`setting:sensitive`,()=>x({sensitiveWritePolicy:e.target.value})),children:[(0,Z.jsx)(z,{value:`confirm`,children:e===`zh`?`先询问`:`Ask first`}),(0,Z.jsx)(z,{value:`deny`,children:e===`zh`?`不保存`:`Never save`}),(0,Z.jsx)(z,{value:`allow`,children:e===`zh`?`允许`:`Allow`})]})]})]})}),(0,Z.jsx)(Zt,{title:e===`zh`?`数据管理`:`Data management`,children:(0,Z.jsxs)(`div`,{className:`divide-y divide-edge-subtle`,children:[(0,Z.jsxs)(o,{to:`/settings/imports`,className:`flex min-h-20 items-center gap-4 px-5 py-4 hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent sm:px-6`,children:[(0,Z.jsx)(`span`,{className:`flex size-10 shrink-0 items-center justify-center rounded-xl bg-surface-base text-fg-muted`,children:(0,Z.jsx)(ye,{className:`size-4.5`,"aria-hidden":`true`})}),(0,Z.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:e===`zh`?`从其他 AI 导入`:`Import from another AI`}),(0,Z.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-fg-muted`,children:e===`zh`?`导入前预览新增、重复和冲突内容。`:`Preview new, duplicate, and conflicting items before import.`})]}),(0,Z.jsx)(L,{className:`size-4 shrink-0 text-fg-subtle`,"aria-hidden":`true`})]}),(0,Z.jsxs)(`button`,{type:`button`,disabled:!!B,className:`flex min-h-20 w-full items-center gap-4 px-5 py-4 text-left hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent disabled:opacity-60 sm:px-6`,onClick:()=>void Q(`export`,_),children:[(0,Z.jsx)(`span`,{className:`flex size-10 shrink-0 items-center justify-center rounded-xl bg-surface-base text-fg-muted`,children:(0,Z.jsx)(te,{className:`size-4.5`,"aria-hidden":`true`})}),(0,Z.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:e===`zh`?`下载我的记忆`:`Download my memory`}),(0,Z.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-fg-muted`,children:e===`zh`?`导出为可阅读、可迁移的数据包。`:`Export a readable, portable archive.`})]}),(0,Z.jsx)(L,{className:`size-4 shrink-0 text-fg-subtle`,"aria-hidden":`true`})]})]})}),(0,Z.jsxs)(`section`,{className:`rounded-2xl bg-surface-panel px-5 py-5 sm:px-6`,children:[(0,Z.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:e===`zh`?`纠正与忘记`:`Correct and forget`}),(0,Z.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:e===`zh`?`在“记忆”中打开任意一条内容的菜单,即可修改、调整作用范围或彻底删除。`:`Open any item in Memory to edit it, change where it applies, or delete it permanently.`}),(0,Z.jsx)(J,{variant:`ghost`,className:`mt-3`,onClick:()=>{Ne(`personal`),Ue(`understanding`)},children:e===`zh`?`管理记忆`:`Manage memory`})]})]}):null,(0,Z.jsx)($t,{open:Ee,profile:$e,language:e,saving:B===`profile`,onOpenChange:De,onSave:e=>void qe(e)}),(0,Z.jsx)(en,{open:Oe,priority:$,title:ot??``,outcome:st?.desiredOutcome,language:e,saving:B===($?`priority:${$.id}`:`priority:create`),onOpenChange:ke,onSave:e=>$?void Je($,e):void Ye(e),onEnd:$?()=>void Xe($):void 0})]})}export{an as UserModelPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p as e}from"./locale-store-VNjH18Dj.js";var t=e(e=>({agentId:``,setAgentId:t=>e({agentId:t})}));export{t};
|