@xopcai/xopc 0.0.427 → 0.0.428
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-D_DXNHba.js → activity-store-WqnVruhY.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-CjaQxFQt.js → agent-avatar-dicebear-CSiO9c2F.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-display-6Z4m31Fz.js → agent-avatar-display-D-yds6wG.js} +2 -2
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-D4ClP_DJ.js → agent-defaults-settings-panel-_UT9C7bg.js} +1 -1
- package/dist/gateway/static/root/assets/agent-plugin-dialog-DVzYXsAy.js +1 -0
- package/dist/gateway/static/root/assets/{agents-admin-api-u5c3GREg.js → agents-admin-api-Bgv4lJ9Y.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-B9slUA_1.js → agents-yTsbcxRi.js} +3 -3
- package/dist/gateway/static/root/assets/{api-C3Tp9MkF.js → api-C-9J9ghT.js} +1 -1
- package/dist/gateway/static/root/assets/{api-CRT9ZyH0.js → api-Dv6Cn-Rs.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-XqoIBF2H.js → app-management-settings-panel-BXJrrjH5.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-9ZtqCASo.js → appearance-settings-oYjAVulT.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-DUeu_7iC.js → apps-page-D95yzj-f.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-BCQnOkV8.js → archive-plugin-DBPu3xCJ.js} +1 -1
- package/dist/gateway/static/root/assets/automation-api-DAou8Kji.js +1 -0
- package/dist/gateway/static/root/assets/{automation-result-state-CMfVTv_i.js → automation-result-state-CA7LV098.js} +1 -1
- package/dist/gateway/static/root/assets/automation-task-card-w6cKxfaP.js +3 -0
- package/dist/gateway/static/root/assets/{automations-page-DMIyWsP0.js → automations-page-D4LyOLzY.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-BGyvZZj5.js +9 -0
- package/dist/gateway/static/root/assets/{binary-plugins-CIB5cbvQ.js → binary-plugins-D25P9ZxQ.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-CXdlNAmZ.js → block-editor-BI105p1U.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automation-inputs-Fxo7HbK6.js → browser-automation-inputs-DhDRvWQE.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-Dn3LN5wo.js → browser-automations-page-CCPi1Bvy.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-control-api-CbbPvhHR.js → browser-control-api-BN4F-bM1.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-Cpm9fEPV.js → browser-settings-page-BZXUZpjp.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-BEvywfF9.js → capabilities-LC-yEQYo.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-page-BCzsIzvC.js → capabilities-page-DHJLl4RD.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-FJ3Vo7Wa.js +8 -0
- package/dist/gateway/static/root/assets/capabilities-u2z_KFRt.js +1 -0
- package/dist/gateway/static/root/assets/{channels-CA5z5dGY.js → channels-9Uaa-IN0.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-agents-api-D8YS5amE.js → chat-agents-api-Cffxfzi1.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-chart-block-B39npsXj.js → chat-chart-block-Bbk0b3TV.js} +1 -1
- package/dist/gateway/static/root/assets/chat-page--dKUIg5W.js +72 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-DjFnElAM.js → chat-terminal-dock-CQMuG-Bz.js} +1 -1
- package/dist/gateway/static/root/assets/{command-palette-api-Dijix7V6.js → command-palette-api-BRxfFgGA.js} +1 -1
- package/dist/gateway/static/root/assets/composer-payload-handoff-_9L2A5AZ.js +1 -0
- package/dist/gateway/static/root/assets/{computer-settings-page-MkqyKyf3.js → computer-settings-page-Bm70SIjD.js} +1 -1
- package/dist/gateway/static/root/assets/{connected-providers-grid-BSvKP2u-.js → connected-providers-grid-B7ktDgqt.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-DlIl9bLx.js → connector-service-page-BVMEg8n-.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-api-DEJU8mgn.js → connectors-api-B07yoCzk.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-hPKaJUWY.js +1 -0
- package/dist/gateway/static/root/assets/{date-picker-BIfjfOTM.js → date-picker-BvEnSGZK.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-DFNehTtd.js → desktop-pet-C1z9YDEg.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-BDjsFown.js → desktop-pet-settings-CbbVb8GY.js} +1 -1
- package/dist/gateway/static/root/assets/{dev-view-store-CeZZLOc6.js → dev-view-store-38EmUIEC.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-DH_uJ698.js → device-pairing-wizard-Wb1EKiXA.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-DiZXY7jF.js → directory-picker-path-field-BvKDrKc4.js} +1 -1
- package/dist/gateway/static/root/assets/{discussion-annotation-sync-BXqNuZnx.js → discussion-annotation-sync-BfVzIwe2.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-myQqsol2.js → extension-debug-page-CB9Lu3Sq.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-iframe-host-DaL-OcTw.js → extension-iframe-host-BzjrVAUR.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-marketplace-api-DRBszrCR.js → extension-marketplace-api-DigziAgd.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-DvlGhZLa.js → extension-page-DUa9MeaZ.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-fOi6V6Cr.js → extension-provider-301x0rh-.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-DOGlQpkx.js → extension-settings-page-CP9ciZUI.js} +1 -1
- package/dist/gateway/static/root/assets/{file-preview-surface-DfkXvFnc.js → file-preview-surface-BaMGmCbw.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-BOCt_zOo.js → gateway-config-swr-BD4Bf8uu.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-BL_Cf0OQ.js → gateway-realtime-CSd9VB7Z.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-Bxkv62qs.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-restart-CHf8qY7H.js → gateway-restart-CIUCTKYR.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-Di41peSM.js → gateway-settings-CCqF1uZv.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-CvkJYurV.js → gateway-startup-retry-BsU5k8oi.js} +1 -1
- package/dist/gateway/static/root/assets/{global-defaults-api-BWMbKu72.js → global-defaults-api-asOZQeM8.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-Bb_RC1O9.js +2 -0
- package/dist/gateway/static/root/assets/{image-generation-api-Ce-IY7Ug.js → image-generation-api-BbEnKsK1.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-W7_cDbxy.js → imports-page-CVnoGUyp.js} +1 -1
- package/dist/gateway/static/root/assets/index-ClPeYgQk.js +11 -0
- package/dist/gateway/static/root/assets/index-Cz-VjTNd.css +1 -0
- package/dist/gateway/static/root/assets/{install-connector-dialog-DWVl9ekV.js → install-connector-dialog-DXVOHMhS.js} +1 -1
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-Doyu0Q9e.js → keyboard-shortcuts-settings-BCl90SrD.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-B3h3P6aI.js → local-app-workbench-page-CcJc9xLJ.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-D6D2bZGW.js → local-apps-page-CdAKoWfg.js} +1 -1
- package/dist/gateway/static/root/assets/{local-session-drafts-BJ1B1dQ7.js → local-session-drafts-nRGeybku.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-Br7IfbXK.js → locale-store-B7y-RVe8.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-qiXos_12.js → logs-page-McbSQwJI.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-C0WcSdK7.js → management-settings-BIR0BwNV.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-Ck5s16p9.js → markdown-view-DFHa8rUg.js} +1 -1
- package/dist/gateway/static/root/assets/mcp-conversation-setup-page-Dwx4TuIr.js +1 -0
- package/dist/gateway/static/root/assets/{media-plugins-Ba6vUE4J.js → media-plugins-BzzLV7wW.js} +1 -1
- package/dist/gateway/static/root/assets/messages-DYDkJvXj.js +3 -0
- package/dist/gateway/static/root/assets/{model-selector-DCBmsHzj.js → model-selector-DJSVr3LM.js} +1 -1
- package/dist/gateway/static/root/assets/{models-hub-cache-Bd-fYUrV.js → models-hub-cache-BUapaPTN.js} +1 -1
- package/dist/gateway/static/root/assets/new-chat-navigation-B6NPQ4h4.js +1 -0
- package/dist/gateway/static/root/assets/{note-detail-panel-CnuxqWMd.js → note-detail-panel-CJ-dPovd.js} +3 -3
- package/dist/gateway/static/root/assets/note-image-lightbox-ClPkeHe5.js +1 -0
- package/dist/gateway/static/root/assets/{notes-api-8kp0X1x6.js → notes-api-ulup1oFS.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-XMdy-H3H.js → notes-page-BaFNplIr.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-api-DMMdeaNd.js → oauth-api-DINa08-z.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-provider-connect-CfOK8mPM.js → oauth-provider-connect-C0PVEHC2.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-capture-button-CKlKWSJ7.js → page-context-capture-button-CGfR0dsc.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-draft-LF33STHC.js → page-context-draft-DhRNxc0v.js} +1 -1
- package/dist/gateway/static/root/assets/page-header-store-CoKMiYoi.js +1 -0
- package/dist/gateway/static/root/assets/{personal-avatar-D6CzIIfo.js → personal-avatar-DiVFO2Aw.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-page-CIMMSI25.js → personal-page-CiKdXLeR.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-settings-panel-wKdlrfPq.js → personal-settings-panel-Ds4ntiqu.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-dependencies-card-CDhk5277.js → phone-dependencies-card-B3R6L5Qu.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-connection-DZ-ZunPz.js → phone-model-connection-ucX3Tvl8.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-picker-DuZc5jYO.js → phone-model-picker-CU37sziM.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-settings-page-0u0GQl_R.js → phone-settings-page-BSdB2pnW.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-workspace-store-SN7hfddU.js → phone-workspace-store-Cmes9gQ4.js} +1 -1
- package/dist/gateway/static/root/assets/{plugin-details-dialog-Bfc-Wmrd.js → plugin-details-dialog-DblFhnuC.js} +1 -1
- package/dist/gateway/static/root/assets/{preference-select-fields-BKeHZLXZ.js → preference-select-fields-D2-QfMN5.js} +1 -1
- package/dist/gateway/static/root/assets/{product-automation-feedback-BPur0vyo.js → product-automation-feedback-BzY3z8zu.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-Bfd7R483.js → product-open-page-BKw6H0Mn.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-Bnq68oVw.js → product-preview-content-CNaJb6Bj.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-modal-BPmTeweh.js → product-preview-modal-DgwrrpqJ.js} +2 -2
- package/dist/gateway/static/root/assets/project-detail-page-FReFYUv0.js +7 -0
- package/dist/gateway/static/root/assets/{project-understanding-DLvxAoTT.js → project-understanding-CrSkrJnM.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-BGy1pw9a.js → projects-page-Cp91_KzA.js} +1 -1
- package/dist/gateway/static/root/assets/{providers-api-DOnNfkwQ.js → providers-api-CBSC3jdu.js} +1 -1
- package/dist/gateway/static/root/assets/{recording-upload-CHFJbqW1.js → recording-upload-DBHAGKZj.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-DFDvOTg4.js → registry-api-QZEjziDq.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-BVqwnOqO.js → remote-access-hub-BdXxFQfH.js} +1 -1
- package/dist/gateway/static/root/assets/{resource-unavailable-TQcRCpAg.js → resource-unavailable-BTNhcOHF.js} +1 -1
- package/dist/gateway/static/root/assets/route-preload-DS4fVFbc.js +2 -0
- package/dist/gateway/static/root/assets/{runtime-tools-api-9o3Wfji1.js → runtime-tools-api-BDTUD8Rj.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-ccVBG-bZ.js → runtime-tools-settings-panel-CYEzIrDf.js} +1 -1
- package/dist/gateway/static/root/assets/{service-recommendation-list-CNghOavt.js → service-recommendation-list-CfeYH6lK.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-Bs3r_d2_.js → session-api-DVXLCZX2.js} +1 -1
- package/dist/gateway/static/root/assets/{session-manager-Bnq3qpqy.js → session-manager-DjRWxXJG.js} +1 -1
- package/dist/gateway/static/root/assets/{sessions-page-CyBj1Xw2.js → sessions-page-C8gwrFHR.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BMHe9uwy.js +1 -0
- package/dist/gateway/static/root/assets/{settings-advanced-section-DwpPPxT0.js → settings-advanced-section-BmrbHgQa.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-mode-store-CiRpsdTJ.js → settings-mode-store-Bk_hzwPK.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-Cd8Ermnn.js → settings-page-DCQnHCNN.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-header-BZl4AMiN.js → settings-page-header-BLKI3_9N.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-onhEgq-K.js → settings-page-layout-BqBVrkC9.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-interaction-page-Cvvj6JyV.js → setup-interaction-page-B9ACeAvO.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-D4qgE7QM.js → setup-status-panel-DEefuWo3.js} +1 -1
- package/dist/gateway/static/root/assets/{share-link-dialog-DA0QuFOD.js → share-link-dialog-C2LyeNzj.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-YDpIY4dC.js → share-preview-page-BFwEr7Ws.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-api-D8Q-m46d.js → shares-api-CTFkLQxq.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-DUvjOMmA.js → shares-settings-CpK3yhtc.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-api-uKU4sRiv.js → skill-api-DpicfA6o.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-list-api-BzKzG-xG.js → skill-list-api-B8fegRLZ.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-DkUXekcd.js → skill-reload-api-VmC8ySUy.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-ClyNSh-7.js → skills-page-BIWXS6Ki.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-BN6sUX0H.js → system-settings-panel-BmoA92oX.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-L5RIelv0.js +3 -0
- package/dist/gateway/static/root/assets/{task-result-evidence-DKygspo2.js → task-result-evidence-BV-6hBVU.js} +1 -1
- package/dist/gateway/static/root/assets/{terminal-panel-store-DJVC7HqA.js → terminal-panel-store-BGdKE9hU.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-Dlnmgryi.js → theme-store-Dvv79Wb2.js} +1 -1
- package/dist/gateway/static/root/assets/{tracing-settings-page-Bs76WeoF.js → tracing-settings-page-B4uA4Pnz.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-B7nx0NQJ.js → tunnel-api-BurZtvqx.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-activity-store-C4bblRnQ.js → understanding-activity-store-C1cLL8zq.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-refresh-store-BvCj9-Ue.js → understanding-refresh-store-C3Lr_pjY.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-anU5gslJ.js → usage-page-C91ZzLm9.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-YHxQ-UZg.js → use-autosave-zkzRuUtx.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-DYY3Yz4a.js → use-composer-attachments-CoiQAgjo.js} +1 -1
- package/dist/gateway/static/root/assets/{use-file-preview-expanded-CYgWzDnv.js → use-file-preview-expanded-DFzy6iVy.js} +2 -2
- package/dist/gateway/static/root/assets/{use-personal-profile-D2Un8G1L.js → use-personal-profile-BB10h9ED.js} +1 -1
- package/dist/gateway/static/root/assets/{use-workspace-tree-Dkg9tUr4.js → use-workspace-tree-sF5DcONt.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-WFnD5utO.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-BUes-Jlp.js → voice-api-key-field-Bqa4PeZx.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-CrULrSKC.js → voice-config-api-LNO2xXHk.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-input-shortcut-events-DFMNIyy4.js → voice-input-shortcut-events-AzfhxBX7.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-transcribe-api-Dy4hfftb.js → voice-transcribe-api-Cb8i6dLb.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-CFF4cRFl.js → work-discovery-overlay-CdQUiV-a.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-page-BnYaVH3V.js → work-discovery-page-HcUloXxf.js} +1 -1
- package/dist/gateway/static/root/assets/{working-directory-picker-modal-GFwVefVA.js → working-directory-picker-modal-Dv1HUipe.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-api-BdB4NEOh.js → workspace-api-Am2ee4R6.js} +2 -2
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-CqHcVFhS.js +1 -0
- package/dist/gateway/static/root/assets/{workspace-file-preview-dialog-NRL3YRjg.js → workspace-file-preview-dialog-z5Q00v92.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-open-location-menu-Dcij7wvJ.js → workspace-open-location-menu-4ONYaGy0.js} +1 -1
- package/dist/gateway/static/root/assets/xopc-cloud-account-card-DimGN59n.js +1 -0
- package/dist/gateway/static/root/index.html +80 -80
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/automations.js +1 -0
- package/dist/packages/gateway-contract/src/capabilities.js +6 -2
- package/dist/packages/gateway-contract/src/home.js +12 -2
- package/dist/src/agent/background-review/prompts.js +11 -6
- package/dist/src/agent/background-review/run-background-review.js +12 -3
- package/dist/src/agent/context/execution-context.js +3 -1
- package/dist/src/agent/embedded/configuration-capability-correction.js +1 -1
- package/dist/src/agent/embedded/run-turn.js +12 -1
- package/dist/src/agent/embedded/session-runner.js +4 -0
- package/dist/src/agent/mcp/connection-drafts.d.ts +2 -1
- package/dist/src/agent/mcp/connection-drafts.js +3 -2
- package/dist/src/agent/mcp/connection-setup.d.ts +15 -1
- package/dist/src/agent/mcp/connection-setup.js +219 -106
- package/dist/src/agent/mcp/continuation-guard.d.ts +3 -0
- package/dist/src/agent/mcp/continuation-guard.js +54 -0
- package/dist/src/agent/mcp/continuation-input.d.ts +4 -0
- package/dist/src/agent/mcp/continuation-input.js +13 -0
- package/dist/src/agent/mcp/conversation-setup.d.ts +121 -2
- package/dist/src/agent/mcp/conversation-setup.js +274 -39
- package/dist/src/agent/mcp/discovery.d.ts +102 -0
- package/dist/src/agent/mcp/discovery.js +219 -0
- package/dist/src/agent/mcp/native-mcp.js +8 -1
- package/dist/src/agent/mcp/setup-plan.d.ts +76 -0
- package/dist/src/agent/mcp/setup-plan.js +93 -0
- package/dist/src/agent/mcp/tool-catalog.d.ts +2 -0
- package/dist/src/agent/mcp/tool-catalog.js +7 -1
- package/dist/src/agent/mcp/transport.d.ts +20 -0
- package/dist/src/agent/mcp/transport.js +188 -0
- package/dist/src/agent/orchestration/delegation-scope.d.ts +2 -1
- package/dist/src/agent/prompt/conversational-configuration-guide.js +1 -1
- package/dist/src/agent/service/direct-turn-helpers.js +2 -1
- package/dist/src/agent/service/process-direct-streaming.js +2 -1
- package/dist/src/agent/service.js +5 -1
- package/dist/src/agent/tool-manuals/xopc-configuration.d.ts +2 -2
- package/dist/src/agent/tool-manuals/xopc-configuration.js +37 -4
- package/dist/src/agent/tools/factory.js +1 -1
- package/dist/src/agent/tools/mcp-setup-tool.js +6 -2
- package/dist/src/agent/tools/xopc-use-tool.d.ts +1 -0
- package/dist/src/agent/tools/xopc-use-tool.js +21 -0
- package/dist/src/automations/api/routes.js +13 -5
- package/dist/src/automations/capabilities/read.js +31 -3
- package/dist/src/automations/domain/types.d.ts +2 -0
- package/dist/src/automations/service/automation-service.d.ts +7 -0
- package/dist/src/automations/service/automation-service.js +9 -2
- package/dist/src/automations/storage/automation-run-repository.d.ts +11 -2
- package/dist/src/automations/storage/automation-run-repository.js +28 -24
- package/dist/src/automations/storage/index.js +2 -2
- package/dist/src/config/schema.d.ts +3 -0
- package/dist/src/config/schema.js +3 -2
- package/dist/src/extensions/agent-plugins/setup.d.ts +1 -0
- package/dist/src/extensions/agent-plugins/setup.js +1 -0
- package/dist/src/gateway/hono/routes/mcp.js +1 -1
- package/dist/src/gateway/hono/routes/tasks.js +0 -4
- package/dist/src/gateway/service/config-coordinator.d.ts +1 -1
- package/dist/src/gateway/service.js +9 -8
- package/dist/src/home-intelligence/evidence-presentation.d.ts +3 -0
- package/dist/src/home-intelligence/evidence-presentation.js +30 -0
- package/dist/src/home-intelligence/generator.d.ts +8 -0
- package/dist/src/home-intelligence/generator.js +15 -4
- package/dist/src/home-intelligence/policy.js +3 -0
- package/dist/src/memory-learning/repository.d.ts +6 -1
- package/dist/src/memory-learning/repository.js +10 -5
- package/dist/src/memory-learning/service.js +23 -1
- package/dist/src/process/mcp-stdio-supervisor.d.ts +1 -0
- package/dist/src/process/mcp-stdio-supervisor.js +14 -0
- package/dist/src/tasks/task-criterion-review-repository.js +1 -1
- package/dist/src/tui/tui.js +1 -1
- package/dist/src/user-context/extraction/registry.js +2 -2
- package/dist/src/user-model/capture/executor.d.ts +1 -0
- package/dist/src/user-model/capture/executor.js +6 -6
- package/dist/src/user-model/capture/semantic.d.ts +3 -0
- package/dist/src/user-model/capture/semantic.js +14 -4
- package/package.json +1 -1
- package/dist/gateway/static/root/assets/agent-plugin-dialog-m1A8wF9p.js +0 -1
- package/dist/gateway/static/root/assets/automation-api-hRsGx-qe.js +0 -1
- package/dist/gateway/static/root/assets/automation-task-card-Bur78p68.js +0 -3
- package/dist/gateway/static/root/assets/automations-workspace-DEkDjxeU.js +0 -9
- package/dist/gateway/static/root/assets/capabilities-Bo2qEJhH.js +0 -1
- package/dist/gateway/static/root/assets/capabilities-settings-panel-Cr67ziwX.js +0 -8
- package/dist/gateway/static/root/assets/chat-page-D92AWJbh.js +0 -72
- package/dist/gateway/static/root/assets/composer-payload-handoff-BQXlFKf4.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-Vx8-MY0Y.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-BHBOPF_q.js +0 -1
- package/dist/gateway/static/root/assets/home-page-B3sgqrl3.js +0 -2
- package/dist/gateway/static/root/assets/index-D4B6O8B3.js +0 -11
- package/dist/gateway/static/root/assets/index-DGWBJDAM.css +0 -1
- package/dist/gateway/static/root/assets/mcp-conversation-setup-page-CENs3hGU.js +0 -1
- package/dist/gateway/static/root/assets/messages-ByFlEbsu.js +0 -3
- package/dist/gateway/static/root/assets/note-image-lightbox-BFKZ7qJr.js +0 -1
- package/dist/gateway/static/root/assets/page-header-store-Du44NIEJ.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-D9nnyvrI.js +0 -7
- package/dist/gateway/static/root/assets/route-preload-DI43HQV_.js +0 -2
- package/dist/gateway/static/root/assets/send-1f1Ntw6E.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BI4DMz4_.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-CS9m7Ipo.js +0 -2
- package/dist/gateway/static/root/assets/user-model-page-DIgPL3tN.js +0 -2
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-4cZ26iaD.js +0 -1
- package/dist/gateway/static/root/assets/xopc-cloud-account-card-DC9aG7Pl.js +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sessions-page-CyBj1Xw2.js","assets/rolldown-runtime-aKtaBQYM.js","assets/vendor-react-BOUWij0V.js","assets/chunk-KS7C4IRE-CiwuuyV8.js","assets/preload-helper-Czpn1I53.js","assets/locale-store-Br7IfbXK.js","assets/messages-ByFlEbsu.js","assets/dist-BGTk37IG.js","assets/es2015-DBLcMg5B.js","assets/dist-CxGUk8J-.js","assets/session-identity-label-B7sgG1PE.js","assets/createLucideIcon-DPHK1VkS.js","assets/session-channel-icon-SsY70Z6t.js","assets/clock-3-DnrAnuyZ.js","assets/git-branch-Dh9uxTot.js","assets/message-circle-Badhj-4D.js","assets/message-square-fVE7Ghj1.js","assets/plug-DKYPEgkR.js","assets/settings-2-D-csvaET.js","assets/terminal-oKqqZdiG.js","assets/cn-0WouolD0.js","assets/bundle-mjs-rHxsej31.js","assets/schemas-CCWMleym.js","assets/archive-Dz0hferG.js","assets/popover-select-CEMWIrtY.js","assets/check-DUBLcKHA.js","assets/skeleton-BI5TyibZ.js","assets/dist-GJ8-1PAx.js","assets/dist-BuHnPloF.js","assets/floating-ui.dom-seOukHzT.js","assets/settings-shell-dialog-layer-BU3UuiJr.js","assets/circle-BoO4YvTx.js","assets/coins-DjP27vUx.js","assets/database-CjjeZfRG.js","assets/download-Dk-ZjtO6.js","assets/folder-open-CyzJ19I9.js","assets/layers-mJW7JJKm.js","assets/layout-grid-CEVZdVFU.js","assets/minimize-2-DtOGrlpo.js","assets/pin-off-BMRv-Kxr.js","assets/plus-Q2yW6OE7.js","assets/search-DA7gz22f.js","assets/settings-uiTATseT.js","assets/trash-2-DusmjVPV.js","assets/x-B_N4OPjy.js","assets/session-api-Bs3r_d2_.js","assets/gateway-startup-retry-CvkJYurV.js","assets/vendor-swr-CdRzEUwF.js","assets/gateway-config-swr-BOCt_zOo.js","assets/chat-agents-api-D8YS5amE.js","assets/registry-api-DFDvOTg4.js","assets/button-Cc4hUNTt.js","assets/interaction-BdhHBbYa.js","assets/form-field-width-DJw_jULe.js","assets/page-tabs-oeTY7z3_.js","assets/sliding-indicator-hwz0sx3h.js","assets/agent-avatar-display-6Z4m31Fz.js","assets/loopi-CNtmi9FU.js","assets/loopi-C09I2mNj.css","assets/sliding-tab-list-DuQyViqe.js","assets/settings-form-draft-Dy10ldo8.js","assets/model-selector-DCBmsHzj.js","assets/open-capability-settings-Cvb65hQB.js","assets/segmented-styles-Cqb91xsn.js","assets/settings-advanced-section-DwpPPxT0.js","assets/settings-mode-store-CiRpsdTJ.js","assets/middleware-Pd0e8Igk.js","assets/number-input-El7Szeln.js","assets/settings-page-header-BZl4AMiN.js","assets/external-link-DjqjBmc3.js","assets/sparkles-DHlfQFAF.js","assets/settings-page-layout-onhEgq-K.js","assets/settings-form-section-num14vSv.js","assets/pencil-DmIY3Oa-.js","assets/use-autosave-YHxQ-UZg.js","assets/circle-alert-BEjgurr2.js","assets/loader-circle-CifKLtgG.js","assets/settings-advanced-gate-BI4DMz4_.js","assets/usage-page-anU5gslJ.js","assets/bot-DjLkhyZL.js","assets/gauge-C78eD2BA.js","assets/refresh-cw-BRlGaq2w.js","assets/timer-rCwGHjuO.js","assets/xopc-cloud-account-card-DC9aG7Pl.js","assets/cloud-C4-yfnnk.js","assets/triangle-alert-2JXFNNKU.js","assets/cloud-credits-B-nbtkqv.js","assets/automations-page-DMIyWsP0.js","assets/automations-workspace-DEkDjxeU.js","assets/activity-YogQEteU.js","assets/calendar-clock-D-quYVPe.js","assets/chevron-down-ccbiQQz_.js","assets/chevron-right-BweFrslA.js","assets/circle-check-C23XjkUj.js","assets/copy-Dv6d4Dvw.js","assets/ellipsis-0k4rZLoy.js","assets/eye-CABVeTq0.js","assets/list-filter-CIPvpfLA.js","assets/list-tree-B0OMswgM.js","assets/markdown-view-Ck5s16p9.js","assets/file-image-CDUPkZvG.js","assets/app-link-DRy3-k7j.js","assets/product-delivery-DRyD9_Xq.js","assets/local-apps-Ck6kACsY.js","assets/copy-to-clipboard-HOJ79TWv.js","assets/xml-_d7dTN2Q.js","assets/mermaid-render-oOellPHt.js","assets/markdown-view-C-DHb3Io.css","assets/pause-DuPxgSxk.js","assets/play-kxZvpBg8.js","assets/shield-check-BU58siTV.js","assets/square-pen-B8FsvqNu.js","assets/zap-dximCGjy.js","assets/api-C3Tp9MkF.js","assets/tasks-DRmd6sWt.js","assets/specialists-xbB3xL9e.js","assets/files-BNL4kkSB.js","assets/session-manager-Bnq3qpqy.js","assets/constants-DBtMsXdW.js","assets/local-session-drafts-BJ1B1dQ7.js","assets/tool-activity-BtJkgjFf.js","assets/personal-proactivity-DaRnbB1f.js","assets/attachment-utils-core-BIOUBrpT.js","assets/gateway-realtime-BL_Cf0OQ.js","assets/gateway-realtime-store-BHBOPF_q.js","assets/agents-admin-api-u5c3GREg.js","assets/page-header-store-Du44NIEJ.js","assets/refresh-button-DiWdGAaX.js","assets/dist-ZrL34Ps4.js","assets/automation-task-card-Bur78p68.js","assets/date-picker-BIfjfOTM.js","assets/calendar-days-hw_Y-g-s.js","assets/chevron-left-DqFhpbvK.js","assets/automation-api-hRsGx-qe.js","assets/agent-display-names-Bje7vfSn.js","assets/automation-result-state-CMfVTv_i.js","assets/browser-automation-inputs-Fxo7HbK6.js","assets/browser-automations-page-Dn3LN5wo.js","assets/circle-pause-CN9jYH2s.js","assets/video-B6V0GFss.js","assets/earth-BMhZtzcj.js","assets/puzzle-BptcPjKI.js","assets/square-DMK_fB-3.js","assets/browser-control-api-CbbPvhHR.js","assets/home-page-B3sgqrl3.js","assets/history-DXH_9jsE.js","assets/paperclip-f1HujQY1.js","assets/use-composer-attachments-DYY3Yz4a.js","assets/file-BqMS_3DT.js","assets/use-file-preview-expanded-CYgWzDnv.js","assets/app-window-DXFNqt_0.js","assets/link-2-D_ZKYUW7.js","assets/message-square-plus-XP0tGdlV.js","assets/rotate-cw-LIg3Am9S.js","assets/save-DRDABU--.js","assets/activity-store-D_DXNHba.js","assets/app-chrome-BeB4KgOf.js","assets/electron-env-DHOGevH3.js","assets/use-async-resource-BHFGZCY2.js","assets/index.module-Cd9ENXfk.js","assets/workspace-api-BdB4NEOh.js","assets/mic-CuUb7zc-.js","assets/share-link-dialog-DA0QuFOD.js","assets/globe-DSSGFWFn.js","assets/copy-text-row-CpiRzq4G.js","assets/capabilities-Bo2qEJhH.js","assets/capabilities-BEvywfF9.js","assets/file-preview-surface-DfkXvFnc.js","assets/phone-workspace-store-SN7hfddU.js","assets/shares-api-D8Q-m46d.js","assets/skill-wire-pattern-BPpeIcCi.js","assets/composer-payload-handoff-BQXlFKf4.js","assets/rotate-ccw-JM1TBLpp.js","assets/voice-transcribe-api-Dy4hfftb.js","assets/workspace-editor-agent-store-4cZ26iaD.js","assets/voice-input-shortcut-events-DFMNIyy4.js","assets/date-formatters-DukWSVwc.js","assets/tab-completion-input-CxtEp0aP.js","assets/task-result-evidence-DKygspo2.js","assets/file-text-D12HbeVy.js","assets/task-detail-page-CS9m7Ipo.js","assets/chat-page-D92AWJbh.js","assets/arrow-left-D880xG-P.js","assets/arrow-up-D5ZtR1QT.js","assets/product-automation-feedback-BPur0vyo.js","assets/notes-api-8kp0X1x6.js","assets/chat-chart-block-B39npsXj.js","assets/volume-2-BSJhAY97.js","assets/book-open-CCGtrT3R.js","assets/working-directory-picker-modal-GFwVefVA.js","assets/file-archive-DanfQJNe.js","assets/send-1f1Ntw6E.js","assets/circle-x-DFsCKeya.js","assets/file-tree-utils-DJs1faGv.js","assets/folder-kanban-CpLlFI1o.js","assets/folder-CN-pC3XL.js","assets/key-round-DWbpyU2U.js","assets/laptop-CI3hBVrl.js","assets/list-checks-BbsExAoq.js","assets/list-todo-CTVRto8O.js","assets/messages-square-BckAJrEW.js","assets/monitor-Af5eAvF7.js","assets/install-connector-dialog-DWVl9ekV.js","assets/secret-input-Dryrns2s.js","assets/is-masked-secret-DOkL5b_X.js","assets/connectors-api-DEJU8mgn.js","assets/oauth-provider-connect-CfOK8mPM.js","assets/models-hub-cache-Bd-fYUrV.js","assets/oauth-api-DMMdeaNd.js","assets/smartphone-DSSsQFqA.js","assets/wrench-DFb4r8bH.js","assets/new-session-preferences-gb411vZP.js","assets/extension-provider-fOi6V6Cr.js","assets/theme-store-Dlnmgryi.js","assets/chunk-D32TOXHM-DQIy-Baq.js","assets/tool-friendly-title-DcCc6g7o.js","assets/voice-call-context-BM2A4bLz.js","assets/use-directory-picker-C4p7AgWY.js","assets/confirm-dialog-D7dQJytv.js","assets/command-palette-api-Dijix7V6.js","assets/skill-list-api-BzKzG-xG.js","assets/skill-api-utils-C7V4JVXM.js","assets/dev-view-store-CeZZLOc6.js","assets/extension-iframe-host-DaL-OcTw.js","assets/api-CRT9ZyH0.js","assets/runtime-health-D2TDFLLq.js","assets/terminal-panel-store-DJVC7HqA.js","assets/agents-app-path-ciChvpCS.js","assets/use-media-query-ady-FgjK.js","assets/oauth-authorization-window-o6URRos4.js","assets/page-context-draft-LF33STHC.js","assets/side-chat-shortcut-BIw-1TTD.js","assets/chat-page-zQeUaawJ.css","assets/page-context-capture-button-CKlKWSJ7.js","assets/dependency-picker-XjPB8FJS.js","assets/projects-page-BGy1pw9a.js","assets/arrow-right-DSSvoX71.js","assets/project-understanding-DLvxAoTT.js","assets/project-detail-page-D9nnyvrI.js","assets/resource-unavailable-TQcRCpAg.js","assets/discussion-annotation-sync-BXqNuZnx.js","assets/workspace-open-location-menu-Dcij7wvJ.js","assets/file-tree-CFlZnV3Y.js","assets/image-Cwyalflz.js","assets/lock-keyhole-DEK5kH0u.js","assets/panel-left-C8MqSXRZ.js","assets/sticky-note-fzP7NAJq.js","assets/store-SzD1Jvgm.js","assets/upload-rrb46c3c.js","assets/user-round-C9jxPhMR.js","assets/workspace-file-preview-dialog-NRL3YRjg.js","assets/with-selector-xonYxPoM.js","assets/directory-picker-path-field-DiZXY7jF.js","assets/skill-api-uKU4sRiv.js","assets/skill-reload-api-DkUXekcd.js","assets/note-detail-panel-CnuxqWMd.js","assets/code-xml-DJtYhZUF.js","assets/note-image-lightbox-BFKZ7qJr.js","assets/project-detail-page-DLioOiRN.css","assets/notes-page-XMdy-H3H.js","assets/recording-upload-CHFJbqW1.js","assets/star-BUWJqJ5c.js","assets/capabilities-page-BCzsIzvC.js","assets/product-navigation-Co8pLbDP.js","assets/capability-links-DzQWK1Fh.js","assets/capability-header-actions-BxMYfQ8y.js","assets/user-model-page-DIgPL3tN.js","assets/understanding-refresh-store-BvCj9-Ue.js","assets/briefcase-business-BsoCaI_t.js","assets/understanding-activity-store-C4bblRnQ.js","assets/sliders-horizontal-DqsYor6I.js","assets/logs-page-qiXos_12.js","assets/clipboard-copy-DuJk5WD6.js","assets/settings-page-Cd8Ermnn.js","assets/browser-settings-page-Cpm9fEPV.js","assets/cpu-B247669f.js","assets/info-CDrmIZhb.js","assets/plug-zap-L8NMe3Sv.js","assets/settings-loading-skeleton-BTqvr_Fw.js","assets/phone-settings-page-0u0GQl_R.js","assets/beta-badge-BnzdzIEl.js","assets/global-defaults-api-BWMbKu72.js","assets/phone-model-picker-DuZc5jYO.js","assets/phone-dependencies-card-CDhk5277.js","assets/runtime-tools-api-9o3Wfji1.js","assets/phone-model-connection-DZ-ZunPz.js","assets/providers-api-DOnNfkwQ.js","assets/mobile-pair-qr-CuIbmw5x.js","assets/browser-BLJWD7WI.js","assets/computer-settings-page-MkqyKyf3.js","assets/mouse-pointer-2-DZ51Onvj.js","assets/extension-page-DvlGhZLa.js","assets/extension-settings-page-DOGlQpkx.js","assets/voice-config-api-CrULrSKC.js","assets/voice-api-key-field-BUes-Jlp.js","assets/schema-form-C-jw6Hid.js","assets/secret-input-labels-B5Jl5HqK.js","assets/extension-debug-page-myQqsol2.js","assets/share-preview-page-YDpIY4dC.js","assets/local-apps-page-D6D2bZGW.js","assets/box-DvYoGszj.js","assets/local-app-workbench-page-B3h3P6aI.js","assets/power-off-CwwQ7Gp7.js","assets/power-ZI-pBczI.js","assets/product-open-page-Bfd7R483.js","assets/open-route-MyZ2sB9C.js","assets/work-discovery-page-BnYaVH3V.js","assets/service-recommendation-list-CNghOavt.js","assets/package-wATCyihJ.js","assets/agent-plugin-dialog-m1A8wF9p.js","assets/capability-icon-DVoZxEgW.js","assets/extension-marketplace-api-DRBszrCR.js","assets/work-discovery-overlay-CFF4cRFl.js","assets/brand-logo-CgT9zQfr.js","assets/setup-status-panel-D4qgE7QM.js","assets/stethoscope-DRqTAtjD.js","assets/appearance-settings-9ZtqCASo.js","assets/preference-select-fields-BKeHZLXZ.js","assets/keyboard-shortcuts-settings-Doyu0Q9e.js","assets/personal-settings-panel-wKdlrfPq.js","assets/use-personal-profile-D2Un8G1L.js","assets/system-settings-panel-BN6sUX0H.js","assets/browser-notification-delivery-DmE2FgGc.js","assets/shield-B1sI_cxl.js","assets/desktop-pet-settings-BDjsFown.js","assets/wand-sparkles-CkSL-3Fy.js","assets/desktop-pet-sprite-D5YYq2zC.js","assets/desktop-pet-sprite-BuB0g8zv.css","assets/app-management-settings-panel-XqoIBF2H.js","assets/capabilities-settings-panel-Cr67ziwX.js","assets/arrow-up-right-T72JbQ1Q.js","assets/connected-providers-grid-BSvKP2u-.js","assets/navigation-D62kPsA9.js","assets/image-generation-api-Ce-IY7Ug.js","assets/gateway-settings-Di41peSM.js","assets/network-BUQLY1BV.js","assets/gateway-restart-CHf8qY7H.js","assets/runtime-tools-settings-panel-ccVBG-bZ.js","assets/remote-access-hub-BVqwnOqO.js","assets/server-BlHCBjiE.js","assets/tunnel-api-B7nx0NQJ.js","assets/shares-settings-DUvjOMmA.js","assets/use-workspace-tree-Dkg9tUr4.js","assets/agent-defaults-settings-panel-D4ClP_DJ.js","assets/management-settings-C0WcSdK7.js","assets/shield-off-2jsucUds.js","assets/device-pairing-wizard-DH_uJ698.js","assets/panel-right-CFGrHTsD.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{t as e}from"./preload-helper-Czpn1I53.js";var t=()=>e(()=>import(`./sessions-page-CyBj1Xw2.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77])),n=()=>e(()=>import(`./usage-page-anU5gslJ.js`),__vite__mapDeps([78,1,2,3,4,5,6,79,11,24,25,20,21,26,27,8,9,28,29,30,75,32,33,80,81,82,47,51,59,55,68,69,70,71,83,84,85,86,22])),r=()=>e(()=>import(`./automations-page-DMIyWsP0.js`),__vite__mapDeps([87,2,1,88,4,3,5,6,7,8,9,89,11,90,25,91,92,24,20,21,26,27,28,29,30,75,93,94,95,96,14,97,98,99,34,100,40,44,101,102,22,103,104,105,106,107,15,108,73,109,81,41,110,70,111,43,112,113,114,115,116,117,118,45,46,119,120,121,122,123,124,50,125,48,47,49,51,126,59,55,127,128,61,18,62,52,53,129,13,130,131,132,133,134,135,136])),i=()=>e(()=>import(`./browser-automations-page-Dn3LN5wo.js`),__vite__mapDeps([137,1,2,3,4,5,6,79,11,24,25,20,21,26,27,8,9,28,29,30,138,139,13,140,76,73,109,141,142,43,44,51,126,143,136])),a=()=>e(()=>import(`./home-page-B3sgqrl3.js`),__vite__mapDeps([144,1,2,4,3,5,6,7,8,9,90,11,91,92,75,93,13,69,145,99,34,100,40,44,20,21,101,102,22,103,104,105,106,107,15,146,81,18,70,26,114,115,147,132,148,149,150,25,94,95,96,35,151,76,152,38,73,153,154,41,118,45,46,122,52,155,156,157,158,59,55,159,160,116,128,28,29,161,162,24,27,30,163,51,164,165,119,166,167,168,169,170,171,172,173,117,120,121,123,124,50,125,48,47,66,62,174,175,126,176,177,178,179])),o=()=>e(()=>import(`./task-detail-page-CS9m7Ipo.js`),__vite__mapDeps([180,1,2,3,4,5,6,7,8,9,181,11,150,23,182,183,184,89,79,93,138,13,69,185,99,34,100,40,44,20,21,101,102,22,103,104,105,106,107,186,25,94,26,76,16,108,109,172,153,70,85,187,112,47,51,133,188,91,92,189,190,52,53,60,24,27,28,29,30,75,191,192,31,193,33,140,95,148,179,194,35,195,149,96,151,152,38,146,73,81,154,41,118,45,46,122,155,156,157,158,59,55,159,160,116,128,14,163,145,196,197,198,199,200,161,201,202,203,204,205,48,206,84,207,50,208,18,42,110,209,142,43,162,164,210,114,115,113,117,119,120,121,123,124,125,211,212,165,213,66,147,132,166,167,168,169,170,49,171,173,62,174,175,214,215,216,126,57,58,56,217,218,219,220,221,61,222,223,129,90,15,130,131,224,225,226,227,134,228,229,230,231,232,176,178,233,234])),s=()=>e(()=>import(`./projects-page-BGy1pw9a.js`),__vite__mapDeps([235,1,2,3,4,5,6,7,8,9,23,11,236,189,190,76,20,21,51,52,53,60,24,25,26,27,28,29,30,194,35,39,40,172,41,44,113,22,114,115,116,126,237,47,217,176])),c=()=>e(()=>import(`./project-detail-page-D9nnyvrI.js`),__vite__mapDeps([238,1,2,3,4,5,6,239,7,8,9,23,11,240,91,51,20,21,182,236,184,89,79,93,138,13,69,185,99,34,100,40,44,101,102,22,103,104,105,106,107,186,25,94,26,76,16,108,109,172,153,70,85,187,112,47,133,90,132,92,189,190,52,53,60,24,27,28,29,30,75,191,31,193,241,35,149,150,95,96,151,152,38,146,73,81,154,41,118,45,46,122,155,156,157,158,59,55,159,160,116,128,242,148,179,195,14,145,243,37,198,244,161,245,39,42,110,142,246,247,43,248,249,114,115,113,147,162,163,164,165,119,166,167,168,169,170,125,48,54,126,237,218,127,250,213,66,219,220,221,130,131,134,251,74,176,252,217,253,254,88,97,98,15,111,117,120,121,123,124,50,49,61,18,62,129,135,136,233,230,255,256,206,84,207,208,257,234,258])),l=()=>e(()=>import(`./notes-page-XMdy-H3H.js`),__vite__mapDeps([259,1,2,3,4,5,6,23,11,240,91,51,9,20,21,182,236,183,184,89,79,93,138,13,69,185,7,8,99,34,100,40,44,101,102,22,103,104,105,106,107,186,25,94,26,76,16,108,109,172,153,70,85,187,112,47,133,131,24,27,28,29,30,95,179,195,260,161,146,41,261,43,248,156,126,59,55,159,218,128,255,256,96,145,15,73,81,111,142,117,118,45,46,119,120,121,122,123,124,50,125,48,213,66,169,206,84,157,207,208,230,257,233,166,165,114,115])),u=()=>e(()=>import(`./capabilities-page-BCzsIzvC.js`),__vite__mapDeps([262,1,2,4,3,5,6,26,20,21,263,126,264,265,41,11,51,9,27,8,28,29,228])),d=()=>e(()=>import(`./user-model-page-DIgPL3tN.js`),__vite__mapDeps([266,1,2,3,4,5,6,7,8,9,188,11,79,267,47,268,131,25,91,92,24,20,21,26,27,28,29,30,75,93,13,33,34,140,95,269,35,14,199,76,244,15,73,40,81,41,110,270,70,246,43,248,249,44,51,156,54,52,55,126,57,58,59,128,130,132])),f=()=>e(()=>import(`./logs-page-qiXos_12.js`),__vite__mapDeps([271,1,2,3,4,5,6,7,8,9,91,11,24,25,20,21,26,27,28,29,30,272,34,179,195,80,97,81,41,19,44,45,22,46,123,124,51,104,53,55,127,63,68,69,70,71])),p=()=>e(()=>import(`./settings-page-Cd8Ermnn.js`),__vite__mapDeps([273,1,2,3,4,5,6])),m=()=>e(()=>import(`./browser-settings-page-Cpm9fEPV.js`),__vite__mapDeps([274,1,2,3,4,5,6,91,11,24,25,20,21,26,27,8,9,28,29,30,93,275,34,69,96,35,80,163,276,76,244,277,81,18,85,47,48,51,60,278,67,68,70,71,74,75,143])),h=()=>e(()=>import(`./phone-settings-page-0u0GQl_R.js`),__vite__mapDeps([279,1,2,3,4,5,6,7,8,9,150,11,91,24,25,20,21,26,27,28,29,30,280,109,40,81,41,110,209,44,47,51,168,128,281,48,68,69,70,282,283,93,34,210,284,285,182,62,286,50,46,204,207,287,288])),g=()=>e(()=>import(`./computer-settings-page-MkqyKyf3.js`),__vite__mapDeps([289,1,2,3,4,5,6,25,11,163,201,290,40,110,142,26,20,21,47,48,50,46,51,9,157,61,24,27,8,28,29,30,18,62,52,53,281,68,69,70,71])),_=()=>e(()=>import(`./extension-page-DvlGhZLa.js`),__vite__mapDeps([291,1,2,3,4,239,5,6,212,22,117,118,45,46,119,120,121,122,123,124,50,125,48,47,165,114,115,103,155,213,66,126,223,7,8,9,60])),v=()=>e(()=>import(`./extension-settings-page-DOGlQpkx.js`),__vite__mapDeps([292,1,2,3,4,5,6,239,24,11,25,20,21,26,27,8,9,28,29,30,212,22,117,118,45,46,119,120,121,122,123,124,50,125,48,47,165,114,115,103,155,213,66,51,53,223,7,60,278,68,69,70,71,74,75,76,293,294,203,93,94,96,104,52,204,295,296,67])),y=()=>e(()=>import(`./extension-debug-page-myQqsol2.js`),__vite__mapDeps([297,1,2,5,6,212,22,117,118,45,46,119,120,121,122,123,124,50,4,125,48,47,165,114,115,103,155,213,66,68,3,69,11,70,20,21,51,9,71])),b=()=>e(()=>import(`./share-preview-page-YDpIY4dC.js`),__vite__mapDeps([298,1,2,4,3,5,6,149,11,150,25,91,94,34,95,69,96,35,151,76,99,7,8,9,100,40,44,20,21,101,102,22,103,104,105,106,107,152,38,146,73,81,153,154,41,26,118,45,46,122,52,155,156,157,158,59,55,159,160,116,128,28,29,51,186])),x=()=>e(()=>import(`./local-apps-page-D6D2bZGW.js`),__vite__mapDeps([299,1,2,3,4,5,6,236,11,300,40,26,20,21,47,51,9,126,224])),S=()=>e(()=>import(`./local-app-workbench-page-B3h3P6aI.js`),__vite__mapDeps([301,1,2,3,4,5,6,239,7,8,9,182,11,25,93,192,13,69,302,194,145,76,245,303,81,172,110,70,43,85,44,26,20,21,103,22,113,114,115,116,47,51,126,224,225,176,177,233,179,117,118,45,46,119,120,121,122,123,124,50,125,48,166,165,230])),C=()=>e(()=>import(`./product-open-page-Bfd7R483.js`),__vite__mapDeps([304,2,1,3,4,5,6,26,20,21,102,22,103,47,224,305])),w=()=>e(()=>import(`./work-discovery-page-BnYaVH3V.js`).then(e=>e.n),__vite__mapDeps([306,1,2,3,4,5,6,11,307,91,189,7,8,9,190,76,20,21,51,52,53,60,202,24,25,26,27,28,29,30,93,69,203,94,96,104,204,44,205,48,47,157,206,84,207,50,46,208,308,40,309,182,75,31,35,110,248,264,288,310,311,131,92,13,33,269,179,14,199,200,277,70,57,58,217])),T=()=>e(()=>import(`./work-discovery-overlay-CFF4cRFl.js`),__vite__mapDeps([312,1,2,5,6,7,8,9,306,3,4,11,307,91,189,190,76,20,21,51,52,53,60,202,24,25,26,27,28,29,30,93,69,203,94,96,104,204,44,205,48,47,157,206,84,207,50,46,208,308,40,309,182,75,31,35,110,248,264,288,310,311,131,92,13,33,269,179,14,199,200,277,70,57,58,217,313])),E=()=>e(()=>import(`./setup-status-panel-D4qgE7QM.js`),__vite__mapDeps([314,1,2,3,4,5,6,89,11,92,93,192,31,276,76,81,315,85,20,21,26,47,48,124,50,46,51,9,52,204,157,220,221,278,286,207,68,69,70,71,72,73,77,65,66,284])),D=()=>e(()=>import(`./appearance-settings-9ZtqCASo.js`),__vite__mapDeps([316,1,2,5,6,24,11,25,20,21,26,27,8,9,28,29,30,48,47,52,317,66,53,213,222,68,3,4,69,70,51,71,77,65])),O=()=>e(()=>import(`./keyboard-shortcuts-settings-Doyu0Q9e.js`),__vite__mapDeps([318,1,2,5,6,20,21,157,175,66,231,68,3,4,69,11,70,51,9,71])),k=()=>e(()=>import(`./personal-settings-panel-wKdlrfPq.js`),__vite__mapDeps([319,1,2,5,6,24,11,25,20,21,26,27,8,9,28,29,30,121,22,320,47,68,3,4,69,70,51,71])),A=()=>e(()=>import(`./system-settings-panel-BN6sUX0H.js`),__vite__mapDeps([321,1,2,5,6,322,11,157,69,81,323,20,21,52,60,68,3,4,70,51,9,71,72,73])),j=()=>e(()=>import(`./desktop-pet-settings-BDjsFown.js`),__vite__mapDeps([324,1,2,3,4,5,6,239,91,11,24,25,20,21,26,27,8,9,28,29,30,75,69,152,325,172,52,157,127,81,51,326,327,68,70,71])),M=()=>e(()=>import(`./app-management-settings-panel-XqoIBF2H.js`),__vite__mapDeps([328,1,2,5,6,7,8,9,94,11,76,308,20,21,26,47,51,30,104,52,157,60,278,68,3,4,69,70,71,72,73])),N=()=>e(()=>import(`./capabilities-settings-panel-Cr67ziwX.js`),__vite__mapDeps([329,1,2,4,3,5,6,7,8,9,236,11,330,92,24,25,20,21,26,27,28,29,30,93,331,132,203,94,96,76,104,52,53,204,163,40,41,18,44,47,48,50,46,51,296,59,55,207,286,206,84,157,208,69,243,196,161,73,109,17,81,110,270,142,43,85,187,210,22,173,117,118,45,119,120,121,122,123,124,125,66,62,216,332,60,218,61,227,281,278,64,65,229,67,68,70,71,72,74,75,293,294,333,83,86])),P=()=>e(()=>import(`./gateway-settings-Di41peSM.js`),__vite__mapDeps([334,1,2,3,4,5,6,24,11,25,20,21,26,27,8,9,28,29,30,75,203,93,94,96,76,104,52,53,204,276,196,335,81,153,336,157,110,323,270,85,47,48,51,296,332,54,55,60,218,7,65,66,278,64,67,68,69,70,71,72,73,77])),F=()=>e(()=>import(`./runtime-tools-settings-panel-ccVBG-bZ.js`),__vite__mapDeps([337,1,2,5,6,24,11,25,20,21,26,27,8,9,28,29,30,75,93,34,172,47,51,127,81,278,68,3,4,69,70,71,77,65,66,284,283,91,210])),I=()=>e(()=>import(`./remote-access-hub-BVqwnOqO.js`),__vite__mapDeps([338,1,2,3,4,5,6,7,8,9,236,11,25,91,92,31,94,69,203,93,96,76,20,21,104,52,53,204,163,196,335,303,339,323,209,19,85,47,48,51,30,54,55,60,218,164,28,29,65,66,286,50,46,207,208,157,64,229,68,70,71,72,73,340,26,332,77])),L=()=>e(()=>import(`./shares-settings-DUvjOMmA.js`),__vite__mapDeps([341,1,2,3,4,5,6,7,8,9,25,11,91,24,20,21,26,27,28,29,30,193,84,94,242,92,95,190,148,100,179,35,195,52,157,145,76,16,40,81,246,43,162,69,163,44,51,164,104,47,48,125,53,54,55,60,218,169,342,160,116,22,174,134,278,206,93,207,50,46,208,67,68,70,71,72,73])),R=()=>e(()=>import(`./agent-defaults-settings-panel-D4ClP_DJ.js`),__vite__mapDeps([343,1,2,3,4,5,6,93,11,80,198,141,41,110,270,20,21,26,86,22,47,51,9,157,59,55,220,221,65,66,281,48,64,67,68,69,70,71,74,25,75,76])),z=()=>e(()=>import(`./management-settings-C0WcSdK7.js`),__vite__mapDeps([344,1,2,3,4,5,6,7,8,9,89,11,132,92,24,25,20,21,26,27,28,29,30,197,345,40,41,209,44,45,22,46,47,51,54,52,55,159,218,127,81,278,68,69,70,71,346,93,13,34,347,101,102,103,158,164,94,104,208,157,229,340,163,76,303,48,53,332,72,73,287,288])),B=new Set;function V(e){B.has(e)||(B.add(e),e().catch(()=>{B.delete(e)}))}function H(e){let[t]=e.split(/[?#]/,1);return t||`/`}function U(e){V(p);let t=e.slice(10);if(t===`overview`)return V(E);if(t===`appearance`)return V(D);if(t===`keyboard-shortcuts`)return V(O);if(t===`personal`)return V(k);if(t===`system`)return V(A);if(t===`desktop-pet`)return V(j);if(t===`desktop-app`)return V(M);if(t.startsWith(`capabilities/`))return V(N);if(t===`gateway`)return V(P);if(t===`runtimes`)return V(F);if(t===`devices`)return V(z);if(t===`tunnel`||t===`remote-access`)return V(I);if(t===`shares`)return V(L);if(t===`agent-defaults`)return V(R);if(t===`agent-browser`)return V(m);if(t===`phone-use`)return V(h);if(t===`computer-use`)return V(g)}function W(e){if(!e.startsWith(`/`))return;let p=H(e);if(p===`/capabilities`||p.startsWith(`/capabilities/`))return V(u);if(p===`/user-model`)return V(d);if(p===`/automations`)return V(r);if(p===`/browser-automations`)return V(i);if(p===`/`)return V(a);if(p.startsWith(`/tasks/`))return V(o);if(p===`/projects`)return V(s);if(p.startsWith(`/projects/`))return V(c);if(p===`/notes`||p.startsWith(`/notes/`))return V(l);if(p.startsWith(`/extensions/`))return V(_);if(p===`/local-apps`)return V(x);if(p.startsWith(`/local-apps/`))return V(S);if(p===`/open`)return V(C);if(p===`/onboarding/workspace`)return V(w);if(p.startsWith(`/share/`))return V(b);if(p===`/settings/sessions`)return V(t);if(p===`/settings/usage`)return V(n);if(p===`/settings/logs`)return V(f);if(p===`/settings/extensions/debug`)return V(y);if(p.startsWith(`/settings/ext/`))return V(v);if(p.startsWith(`/settings/`))return U(p)}export{E as A,C,F as D,I as E,n as F,d as I,T as L,L as M,A as N,t as O,o as P,w as R,h as S,s as T,S as _,r as a,l as b,g as c,y as d,_ as f,O as g,a as h,D as i,b as j,p as k,j as l,P as m,R as n,i as o,v as p,M as r,N as s,m as t,z as u,x as v,c as w,k as x,f as y,W as z};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./createLucideIcon-DPHK1VkS.js";var t=e(`circle-dot`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}]]),n=e(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]);export{t as n,n as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./settings-mode-store-CiRpsdTJ.js";function t(t){let{children:n,fallback:r}=t,i=r===void 0?null:r;return e()?n:i}export{t};
|
|
@@ -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{f as i,m as a,t as o,u as s}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{i as c,l,n as u,o as d}from"./locale-store-Br7IfbXK.js";import{t as f}from"./messages-ByFlEbsu.js";import{a as p,i as m,n as h,o as g,r as _,s as v,t as y}from"./dist-BGTk37IG.js";import{U as b,nt as x,t as S,w as C}from"./chat-page-D92AWJbh.js";import{t as w}from"./arrow-left-D880xG-P.js";import{t as T}from"./calendar-clock-D-quYVPe.js";import{n as E,r as D}from"./popover-select-CEMWIrtY.js";import{t as O}from"./circle-check-C23XjkUj.js";import{t as k}from"./circle-x-DFsCKeya.js";import{t as A}from"./circle-BoO4YvTx.js";import{t as ee}from"./ellipsis-0k4rZLoy.js";import{t as te}from"./external-link-DjqjBmc3.js";import{t as ne}from"./folder-kanban-CpLlFI1o.js";import{t as j}from"./folder-open-CyzJ19I9.js";import{F as M,N,V as P,z as re}from"./markdown-view-Ck5s16p9.js";import{t as ie}from"./message-square-fVE7Ghj1.js";import{t as ae}from"./pause-DuPxgSxk.js";import{t as oe}from"./play-kxZvpBg8.js";import{t as se}from"./x-B_N4OPjy.js";import{t as F}from"./cn-0WouolD0.js";import{t as ce}from"./skeleton-BI5TyibZ.js";import{c as le}from"./api-C3Tp9MkF.js";import{ct as ue,lt as de}from"./session-manager-Bnq3qpqy.js";import{i as fe}from"./vendor-swr-CdRzEUwF.js";import{C as pe,D as me,T as he,d as ge,f as _e,k as ve,m as ye,y as be}from"./use-composer-attachments-DYY3Yz4a.js";import{t as xe}from"./chat-agents-api-D8YS5amE.js";import{t as I}from"./button-Cc4hUNTt.js";import{s as Se}from"./file-preview-surface-DfkXvFnc.js";import{d as Ce,f as we,h as Te,m as Ee,p as De,s as Oe}from"./composer-payload-handoff-BQXlFKf4.js";import{t as ke}from"./page-header-store-Du44NIEJ.js";import{t as Ae}from"./agent-avatar-display-6Z4m31Fz.js";import{t as je}from"./confirm-dialog-D7dQJytv.js";import{l as Me,m as Ne,o as Pe,r as L,t as Fe,u as Ie}from"./dist-ZrL34Ps4.js";import{C as Le,_ as Re,a as ze,c as Be,d as R,l as z,u as Ve,w as He}from"./automation-task-card-Bur78p68.js";import{t as Ue}from"./date-picker-BIfjfOTM.js";import{t as We}from"./automation-api-hRsGx-qe.js";import{n as Ge}from"./date-formatters-DukWSVwc.js";import{n as B,r as V,t as Ke}from"./task-result-evidence-DKygspo2.js";import{t as qe}from"./page-context-capture-button-CKlKWSJ7.js";import{t as Je}from"./dependency-picker-XjPB8FJS.js";var H=n(),U=r();function Ye(e){let t=(0,H.c)(33),{changes:n,language:r}=e,i=r===`zh`,a;t[0]===i?a=t[1]:(a=i?{backlog:`待办池`,ready:`就绪`,active:`进行中`,review:`待验收`,closed:`已关闭`}:{backlog:`Backlog`,ready:`Ready`,active:`Active`,review:`Review`,closed:`Closed`},t[0]=i,t[1]=a);let o=a,s;t[2]===i?s=t[3]:(s=i?{board:`看板`,mobile:`移动端`,api:`手动操作`,runtime:`自动流转`,undo:`撤销`}:{board:`Board`,mobile:`Mobile`,api:`Manual update`,runtime:`Automatic`,undo:`Undo`},t[2]=i,t[3]=s);let c=s,l;t[4]===i?l=t[5]:(l=i?{done:`完成`,cancelled:`取消`,duplicate:`重复`,wont_do:`不做`}:{done:`Done`,cancelled:`Cancelled`,duplicate:`Duplicate`,wont_do:`Won’t do`},t[4]=i,t[5]=l);let u=l,d;t[6]===i?d=t[7]:(d=i?{user:`用户`,agent:`Agent`,system:`系统`,integration:`外部服务`}:{user:`User`,agent:`Agent`,system:`System`,integration:`Integration`},t[6]=i,t[7]=d);let f=d,p=i?`变更记录`:`Change log`,m;t[8]!==n.length||t[9]!==p?(m=(0,U.jsxs)(`summary`,{className:`cursor-pointer text-sm font-semibold text-fg`,children:[p,` (`,n.length,`)`]}),t[8]=n.length,t[9]=p,t[10]=m):m=t[10];let h;if(t[11]!==f||t[12]!==n||t[13]!==r||t[14]!==o||t[15]!==u||t[16]!==c){let e;t[18]!==f||t[19]!==r||t[20]!==o||t[21]!==u||t[22]!==c?(e=e=>(0,U.jsxs)(`li`,{className:`text-sm text-fg`,children:[(0,U.jsxs)(`div`,{children:[o[e.fromPhase],e.fromResolution?` · ${u[e.fromResolution]}`:``,` → `,o[e.toPhase],e.toResolution?` · ${u[e.toResolution]}`:``]}),(0,U.jsxs)(`div`,{className:`mt-1 text-xs text-fg-muted`,children:[f[e.actor.kind],e.actor.id?` (${e.actor.id})`:``,` · `,c[e.source],` · `,(0,U.jsx)(`time`,{dateTime:new Date(e.createdAt).toISOString(),children:Ge(e.createdAt,r)})]})]},e.id),t[18]=f,t[19]=r,t[20]=o,t[21]=u,t[22]=c,t[23]=e):e=t[23],h=[...n].reverse().map(e),t[11]=f,t[12]=n,t[13]=r,t[14]=o,t[15]=u,t[16]=c,t[17]=h}else h=t[17];let g;t[24]===h?g=t[25]:(g=(0,U.jsx)(`ol`,{className:`mt-3 max-h-80 space-y-3 overflow-y-auto`,children:h}),t[24]=h,t[25]=g);let _;t[26]!==n.length||t[27]!==i?(_=n.length?null:(0,U.jsx)(`p`,{className:`mt-3 text-xs text-fg-muted`,children:i?`暂无阶段变更记录`:`No phase changes yet`}),t[26]=n.length,t[27]=i,t[28]=_):_=t[28];let v;return t[29]!==m||t[30]!==g||t[31]!==_?(v=(0,U.jsxs)(`details`,{className:`rounded-xl border border-edge bg-surface-panel p-4`,children:[m,g,_]}),t[29]=m,t[30]=g,t[31]=_,t[32]=v):v=t[32],v}var W=e(t(),1);function Xe({schedules:e,language:t,onEdit:n,onUpdated:r}){let i=t===`zh`,a=f(t),[s,c]=(0,W.useState)(null),l=(0,W.useRef)(!1),[u,d]=(0,W.useState)(null),p=e=>new Date(e).toLocaleString(i?`zh-CN`:`en-US`,{year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,timeZoneName:`short`});async function m(e){if(!l.current){l.current=!0,c(e.id),d(null);try{r((await We.update(e.id,{enabled:!1,expectedRevision:e.updatedAtMs})).automation)}catch(e){d(e instanceof Error?e.message:a.automations.feedback.actionFailed)}finally{l.current=!1,c(null)}}}return(0,U.jsxs)(`section`,{"aria-label":i?`执行时间`:`Execution schedule`,className:`rounded-xl border border-edge bg-surface-panel p-4`,children:[(0,U.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:i?`执行时间`:`Execution schedule`}),(0,U.jsx)(`div`,{className:`mt-3 space-y-4`,children:e.map(e=>{let r=e.trigger.kind===`schedule`?e.trigger.schedule:null,c=Le(e),l=!e.management||e.management.editable.includes(`trigger`),u=!e.management||e.management.editable.includes(`enabled`);return(0,U.jsxs)(`article`,{className:`space-y-2 text-sm text-fg`,children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,U.jsx)(`span`,{className:`break-words font-medium`,children:e.name}),(0,U.jsx)(`span`,{className:`text-xs text-fg-muted`,children:c?i?`已执行`:`Completed`:e.enabled?i?`已启用`:`Enabled`:i?`已取消定时执行`:`Scheduling disabled`})]}),(0,U.jsx)(`p`,{children:r?.kind===`once`?`${i?`单次执行:`:`Run once: `}${p(Date.parse(r.at))}`:Re(e.trigger,a.automations,a.cron,t)}),r?.kind===`cron`?(0,U.jsxs)(`p`,{className:`text-xs text-fg-muted`,children:[i?`执行时区:`:`Schedule timezone: `,r.tz||(i?`服务所在电脑时区`:`Server timezone`)]}):null,(0,U.jsxs)(`p`,{className:`text-fg-muted`,children:[i?`下次执行:`:`Next run: `,c?i?`已执行,无后续计划`:`Completed; no upcoming run`:e.enabled?e.state.nextRunAtMs===void 0?i?`暂无后续执行`:`No upcoming run`:p(e.state.nextRunAtMs):i?`已取消,不再自动执行`:`Disabled; no automatic runs`]}),(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[l?(0,U.jsx)(I,{variant:`secondary`,disabled:s!==null,onClick:()=>n(e),children:i?`修改时间`:`Edit schedule`}):null,e.enabled&&u?(0,U.jsx)(I,{variant:`ghost`,disabled:s!==null,onClick:()=>void m(e),children:s===e.id?i?`正在取消…`:`Cancelling…`:i?`取消定时执行`:`Cancel schedule`}):null,(0,U.jsx)(I,{asChild:!0,variant:`ghost`,children:(0,U.jsx)(o,{to:`/automations?automation=${encodeURIComponent(e.id)}`,children:i?`查看自动化`:`View automation`})})]})]},e.id)})}),u?(0,U.jsx)(`p`,{role:`alert`,className:`mt-3 text-sm text-danger`,children:u}):null]})}var Ze=`w-full rounded-lg border border-edge bg-surface-base px-3 py-2 text-sm text-fg focus-visible:outline-2 focus-visible:outline-accent`;function Qe({taskId:e,taskTitle:t,projectId:n,executorAgentId:r,language:i,onClose:a,onCreated:s,automation:c}){let l=i===`zh`,u=f(i).automations,[d,b]=(0,W.useState)(()=>c?Ve(c):{...R,name:t,projectId:n??``,actionMode:`task_command`,taskId:e,agentId:r??``,triggerMode:`once`,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`}),[x,S]=(0,W.useState)(null),[C,w]=(0,W.useState)(!1),T=(0,W.useRef)(!1),[O,k]=(0,W.useState)(null),A=e=>b(t=>({...t,...e}));async function ee(e){if(e.preventDefault(),!(T.current||x)&&(k(null),!(!d.name.trim()||!c&&!r))){if(d.triggerMode===`once`&&(!Number.isFinite(new Date(d.onceAt).getTime())||new Date(d.onceAt).getTime()<=Date.now())){k(u.experience.futureTime);return}T.current=!0,w(!0);try{let e=c?Be(c,d).trigger:z(d).trigger,{automation:t}=c?await We.update(c.id,{trigger:e,...c.management?{}:{name:d.name.trim(),delivery:{...c.delivery,notificationPolicy:d.notificationPolicy}},...!c.management||c.management.editable.includes(`enabled`)?{enabled:!0}:{},expectedRevision:c.updatedAtMs}):await We.create({...z(d),enabled:!0});S(t),s(t)}catch(e){k(e instanceof Error?e.message:u.feedback.actionFailed)}finally{T.current=!1,w(!1)}}}return(0,U.jsx)(y,{open:!0,onOpenChange:e=>{!e&&!T.current&&a()},children:(0,U.jsxs)(g,{children:[(0,U.jsx)(p,{className:`fixed inset-0 z-[110] bg-black/45`}),(0,U.jsxs)(_,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[111] flex h-[min(38rem,calc(100dvh-2rem))] w-[min(32rem,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 outline-none`,children:[(0,U.jsxs)(`header`,{className:`flex shrink-0 items-center justify-between gap-3 border-b border-edge-subtle px-5 py-4`,children:[(0,U.jsx)(v,{className:`text-base font-semibold text-fg`,children:c?l?`修改执行时间`:`Edit execution schedule`:l?`设置执行时间`:`Set execution time`}),(0,U.jsx)(h,{asChild:!0,children:(0,U.jsx)(I,{variant:`ghost`,className:`size-9 p-0`,disabled:C,"aria-label":l?`关闭`:`Close`,children:(0,U.jsx)(se,{className:`size-4`})})})]}),(0,U.jsx)(m,{className:`sr-only`,children:l?`为当前任务创建定时或周期自动化。`:`Create a scheduled or recurring automation for this task.`}),x?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto p-5`,children:[(0,U.jsx)(`p`,{role:`status`,className:`text-sm font-medium text-fg`,children:c?l?`执行时间已更新`:`Schedule updated`:l?`执行时间已设置`:`Schedule created`}),(0,U.jsx)(`p`,{className:`break-words text-sm text-fg-muted`,children:x.name}),(0,U.jsx)(I,{asChild:!0,variant:`primary`,children:(0,U.jsx)(o,{to:`/automations?automation=${encodeURIComponent(x.id)}`,children:l?`查看自动化`:`View automation`})})]}),(0,U.jsx)(`footer`,{className:`shrink-0 border-t border-edge-subtle p-4`,children:(0,U.jsx)(I,{onClick:a,children:l?`完成`:`Done`})})]}):(0,U.jsxs)(`form`,{onSubmit:e=>void ee(e),className:`flex min-h-0 flex-1 flex-col`,children:[(0,U.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto p-5`,children:[(0,U.jsxs)(`p`,{className:`break-words text-sm text-fg-muted`,children:[l?`执行任务:`:`Task: `,t]}),(0,U.jsxs)(`fieldset`,{disabled:C,className:`space-y-4`,children:[(0,U.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[u.form.name,(0,U.jsx)(`input`,{required:!0,readOnly:!!c?.management,className:Ze,value:d.name,onChange:e=>A({name:e.target.value})})]}),(0,U.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[u.form.trigger,(0,U.jsxs)(E,{value:d.triggerMode,onChange:e=>A({triggerMode:e.target.value}),children:[c?.trigger.kind===`schedule`&&c.trigger.schedule.kind===`interval`?(0,U.jsx)(D,{value:`interval`,children:l?`固定间隔`:`Fixed interval`}):null,c?.trigger.kind===`schedule`&&c.trigger.schedule.kind===`cron`?(0,U.jsx)(D,{value:`cron`,children:l?`自定义规则`:`Custom schedule`}):null,(0,U.jsx)(D,{value:`once`,children:u.trigger.once}),(0,U.jsx)(D,{value:`daily`,children:u.trigger.daily}),(0,U.jsx)(D,{value:`weekly`,children:u.trigger.weekly})]})]}),d.triggerMode===`once`?(0,U.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[u.form.onceAt,(0,U.jsx)(`input`,{required:!0,type:`datetime-local`,className:Ze,value:d.onceAt,onChange:e=>A({onceAt:e.target.value})})]}):[`daily`,`weekly`].includes(d.triggerMode)?(0,U.jsxs)(`div`,{className:`grid gap-2 text-sm text-fg`,children:[(0,U.jsx)(`span`,{children:u.form.time}),(0,U.jsx)(He,{disabled:C,value:d.time,onChange:e=>A({time:e}),ariaLabel:u.form.time})]}):null,d.triggerMode===`weekly`?(0,U.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[u.form.day,(0,U.jsx)(E,{value:d.weekday,onChange:e=>A({weekday:e.target.value}),children:[`sunday`,`monday`,`tuesday`,`wednesday`,`thursday`,`friday`,`saturday`].map((e,t)=>(0,U.jsx)(D,{value:String(t),children:u.weekdays[e]},e))})]}):null,d.triggerMode===`cron`?(0,U.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[l?`定时规则`:`Cron expression`,(0,U.jsx)(`input`,{required:!0,className:Ze,value:d.cronExpr,onChange:e=>A({cronExpr:e.target.value})})]}):null,d.triggerMode===`interval`?(0,U.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,U.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[l?`执行间隔`:`Interval`,(0,U.jsx)(`input`,{required:!0,type:`number`,min:`1`,className:Ze,value:d.intervalValue,onChange:e=>A({intervalValue:e.target.value})})]}),(0,U.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[l?`单位`:`Unit`,(0,U.jsxs)(E,{value:d.intervalUnit,onChange:e=>A({intervalUnit:e.target.value}),children:[(0,U.jsx)(D,{value:`minute`,children:l?`分钟`:`Minutes`}),(0,U.jsx)(D,{value:`hour`,children:l?`小时`:`Hours`}),(0,U.jsx)(D,{value:`day`,children:l?`天`:`Days`}),(0,U.jsx)(D,{value:`week`,children:l?`周`:`Weeks`})]})]})]}):null,(0,U.jsx)(ze,{form:d,onChange:A,language:i}),(0,U.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[u.draft.notifications,(0,U.jsxs)(E,{disabled:!!c?.management,value:d.notificationPolicy,onChange:e=>A({notificationPolicy:e.target.value}),children:[(0,U.jsx)(D,{value:`attention`,children:u.draft.notifyAttention}),(0,U.jsx)(D,{value:`all`,children:u.draft.notifyAll}),(0,U.jsx)(D,{value:`none`,children:u.draft.notifyNone})]})]})]}),!c&&!r?(0,U.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:l?`请先为任务指定执行 Agent。`:`Assign an executor agent to the task first.`}):null,O?(0,U.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:O}):null]}),(0,U.jsxs)(`footer`,{className:`flex shrink-0 justify-end gap-2 border-t border-edge-subtle p-4`,children:[(0,U.jsx)(I,{type:`button`,variant:`ghost`,disabled:C,onClick:a,children:l?`取消`:`Cancel`}),(0,U.jsx)(I,{type:`submit`,variant:`primary`,disabled:C||!c&&!r||!d.name.trim()||d.triggerMode===`once`&&!d.onceAt,children:C?l?`正在保存…`:`Saving…`:c?c.enabled?l?`保存修改`:`Save changes`:l?`保存并启用`:`Save and enable`:l?`创建自动化`:`Create automation`})]})]})]})]})})}function $e(e){let t=(0,H.c)(36),{detail:n,language:r,onUpdated:i}=e,a=r===`zh`,s;t[0]===n.waits?s=t[1]:(s=n.waits.find(rt),t[0]=n.waits,t[1]=s);let c=s,l,u,d,f,p,m,h;if(t[2]!==n||t[3]!==r||t[4]!==i||t[5]!==c||t[6]!==a){l=n.allowedCommands.includes(`resolve_wait`)&&!c?n.waits.filter(nt):[];let e=l.length>0||n.attention.some(tt),s;t[14]===n?s=t[15]:(s=we(n),t[14]=n,t[15]=s);let g=s,_=n.runs.some(et);d=c?.reason??n.waits[0]?.reason??(n.task.phase===`closed`?a?`任务已关闭,可查看交付物与执行结果。`:`The task is closed. Review its deliverables and results.`:n.task.phase===`review`?a?`请检查交付物与验收项,通过后确认完成。`:`Review the deliverables and acceptance criteria before completing the task.`:_?a?`Agent 正在执行任务,无需你操作。`:`The agent is working. No action is needed from you.`:g?.summary??(a?`任务尚未开始,可开始执行或设置执行时间。`:`Start the task or set an execution time.`)),u=n.attention.length>0?(0,U.jsx)(`ul`,{className:`mt-3 space-y-3`,children:n.attention.map((e,t)=>{let i=l.some(t=>e.kind===`input_required`&&t.kind===`user_input`||e.kind===`approval_required`&&t.kind===`approval`);return(0,U.jsxs)(`li`,{className:`text-sm leading-6 text-fg-muted`,children:[(0,U.jsx)(V,{content:e.summary,contentKey:`${n.task.id}:attention:${e.kind}:${t}`,language:r,markdown:!1,previewHeight:72}),!i&&(e.kind===`input_required`||e.kind===`approval_required`)?(0,U.jsx)(o,{className:`mt-2 inline-flex min-h-11 items-center rounded-lg bg-accent-soft px-3 font-medium text-accent-fg`,to:N(n.task.id),children:a?e.kind===`approval_required`?`查看并决定`:`补充信息`:e.kind===`approval_required`?`Review decision`:`Provide information`}):null]},`${e.kind}-${t}`)})}):null,f=a?`当前需要处理`:`Current action`,p=`rounded-xl border border-edge bg-surface-panel p-4`;let v=e?a?`需要你处理`:`Your action needed`:a?`当前进展`:`Current progress`,y=l.length>1?` · ${l.length}`:``;t[16]!==v||t[17]!==y?(m=(0,U.jsxs)(`h2`,{className:`text-sm font-semibold text-fg`,children:[v,y]}),t[16]=v,t[17]=y,t[18]=m):m=t[18];let b;t[19]!==n||t[20]!==i||t[21]!==a?(b=e=>(0,U.jsx)(B,{wait:e,detail:n,zh:a,onUpdated:i},e.id),t[19]=n,t[20]=i,t[21]=a,t[22]=b):b=t[22],h=l.map(b),t[2]=n,t[3]=r,t[4]=i,t[5]=c,t[6]=a,t[7]=l,t[8]=u,t[9]=d,t[10]=f,t[11]=p,t[12]=m,t[13]=h}else l=t[7],u=t[8],d=t[9],f=t[10],p=t[11],m=t[12],h=t[13];let g;t[23]!==l.length||t[24]!==u||t[25]!==n.task||t[26]!==r||t[27]!==d||t[28]!==a?(g=l.length>0?u?(0,U.jsxs)(`details`,{className:`mt-3`,children:[(0,U.jsx)(`summary`,{className:`cursor-pointer text-xs text-fg-muted`,children:a?`等待详情`:`Waiting details`}),u]}):null:u??(0,U.jsx)(V,{content:d,contentKey:`${n.task.id}:current-progress`,language:r,markdown:!1,previewHeight:72,className:`mt-2 text-sm leading-6 text-fg-muted`}),t[23]=l.length,t[24]=u,t[25]=n.task,t[26]=r,t[27]=d,t[28]=a,t[29]=g):g=t[29];let _;return t[30]!==f||t[31]!==p||t[32]!==m||t[33]!==h||t[34]!==g?(_=(0,U.jsxs)(`section`,{"aria-label":f,className:p,children:[m,h,g]}),t[30]=f,t[31]=p,t[32]=m,t[33]=h,t[34]=g,t[35]=_):_=t[35],_}function et(e){return!e.parentRunId&&[`queued`,`running`,`waiting`,`verifying`].includes(e.status)}function tt(e){return e.kind===`input_required`||e.kind===`approval_required`}function nt(e){return(e.kind===`user_input`||e.kind===`approval`&&typeof e.condition.capability==`string`)&&e.condition.type!==`connection`}function rt(e){return e.kind===`paused`}function it(e){let t=(0,H.c)(17),{children:n,contentKey:r,language:i,className:o}=e,s=(0,W.useId)(),c=W.Children.toArray(n),[l,u]=a(),d;t[0]!==r||t[1]!==l?(d=l.getAll(`taskExpanded`).includes(r),t[0]=r,t[1]=l,t[2]=d):d=t[2];let f=d,p=f?c:c.slice(0,3),m;t[3]!==s||t[4]!==p?(m=(0,U.jsx)(`ul`,{id:s,className:`space-y-1.5`,children:p}),t[3]=s,t[4]=p,t[5]=m):m=t[5];let h;t[6]!==r||t[7]!==f||t[8]!==s||t[9]!==c.length||t[10]!==i||t[11]!==u?(h=c.length>3?(0,U.jsx)(`button`,{type:`button`,"aria-expanded":f,"aria-controls":s,className:`mt-2 min-h-9 rounded-sm text-xs font-medium text-accent hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/40`,onClick:()=>u(e=>{let t=new URLSearchParams(e),n=t.getAll(`taskExpanded`).filter(e=>e!==r);return t.delete(`taskExpanded`),n.forEach(e=>t.append(`taskExpanded`,e)),f||t.append(`taskExpanded`,r),t},{preventScrollReset:!0}),children:i===`zh`?f?`收起`:`查看全部(${c.length})`:f?`Show less`:`Show all (${c.length})`}):null,t[6]=r,t[7]=f,t[8]=s,t[9]=c.length,t[10]=i,t[11]=u,t[12]=h):h=t[12];let g;return t[13]!==o||t[14]!==m||t[15]!==h?(g=(0,U.jsxs)(`div`,{className:o,children:[m,h]}),t[13]=o,t[14]=m,t[15]=h,t[16]=g):g=t[16],g}function at({taskId:e}){let t=l(e=>e.conversationId),n=u(e=>e.language),[r,i]=(0,W.useState)(``),[a,o]=(0,W.useState)(null),[s,f]=(0,W.useState)(!1),[p,m]=(0,W.useState)(!1),[h,g]=(0,W.useState)([]),[_,v]=(0,W.useState)(null),y=c(`/api/tasks/${encodeURIComponent(e)}/collaboration`),{data:b,error:x,mutate:S}=fe([`task-collaboration`,e,t],()=>d(`${y}?recent=1`),{revalidateOnFocus:!0}),C=[...new Map([...h,...b?.items??[]].map(e=>[e.id,e])).values()].sort((e,t)=>e.sequence-t.sequence),w=async()=>{let e=C[0];if(!(!e||p)){m(!0);try{let t=await d(`${y}?recent=1&beforeSequence=${e.sequence}`);g(e=>[...t.items,...e])}catch(e){v(e instanceof Error?e.message:String(e))}finally{m(!1)}}};(0,W.useEffect)(()=>{let t=t=>{let n=t.detail;(!n?.taskId||n.taskId===e)&&S()};return window.addEventListener(`task-collaboration-entry-added`,t),window.addEventListener(`gateway-realtime-connected`,t),()=>{window.removeEventListener(`task-collaboration-entry-added`,t),window.removeEventListener(`gateway-realtime-connected`,t)}},[S,e]);let T=async()=>{if(!(!r.trim()||s)){f(!0),v(null);try{await d(y,{method:`POST`,headers:{"idempotency-key":crypto.randomUUID()},body:JSON.stringify({kind:a?`answer`:`instruction`,body:r.trim(),...a?{causationId:a}:{}})}),i(``),o(null),await S()}catch(e){v(e instanceof Error?e.message:String(e))}finally{f(!1)}}};return(0,U.jsxs)(`section`,{className:`rounded-xl border border-edge bg-surface-panel p-4`,children:[(0,U.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:n===`zh`?`任务留言`:`Task updates`}),(0,U.jsxs)(`div`,{className:`mt-3 max-h-64 space-y-2 overflow-y-auto`,children:[!b&&!x?(0,U.jsxs)(`div`,{"aria-busy":`true`,className:`space-y-2`,children:[(0,U.jsx)(ce,{className:`h-14 w-full`}),(0,U.jsx)(ce,{className:`h-14 w-4/5`})]}):null,x?(0,U.jsx)(`p`,{role:`status`,className:`text-xs text-fg-muted`,children:n===`zh`?`暂时无法读取留言`:`Updates unavailable`}):null,C[0]&&C[0].sequence>1?(0,U.jsx)(`button`,{type:`button`,disabled:p,onClick:()=>void w(),className:`text-xs text-accent hover:underline disabled:opacity-50`,children:n===`zh`?`查看更早留言`:`Earlier updates`}):null,C.map(t=>(0,U.jsxs)(`div`,{className:`rounded-lg bg-surface-base px-3 py-2 text-sm`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-fg-subtle`,children:[(0,U.jsx)(`span`,{children:t.authorKind===`worker_agent`?n===`zh`?`执行 Agent`:`Worker`:t.authorKind===`main_agent`?n===`zh`?`主 Agent`:`Main Agent`:t.authorKind===`system`?n===`zh`?`系统`:`System`:n===`zh`?`用户`:`You`}),(0,U.jsxs)(`span`,{children:[`· `,t.kind]}),t.deliveryStatus?(0,U.jsxs)(`span`,{children:[`· `,t.deliveryStatus]}):null]}),(0,U.jsx)(`div`,{className:`mt-1 min-w-0 text-fg`,"data-task-collaboration-body":!0,children:(0,U.jsx)(V,{content:t.body,contentKey:`${e}:update:${t.id}`,language:n,breaks:!0,previewHeight:120})}),t.kind===`question`&&t.authorKind===`worker_agent`?(0,U.jsx)(`button`,{type:`button`,className:`mt-2 text-xs text-accent hover:underline`,onClick:()=>o(t.id),children:n===`zh`?`回复问题`:`Reply`}):null]},t.id)),b&&!C.length?(0,U.jsx)(`p`,{className:`text-xs text-fg-muted`,children:n===`zh`?`暂无进展留言`:`No updates yet`}):null]}),a?(0,U.jsxs)(`p`,{className:`mt-3 text-xs text-accent`,children:[n===`zh`?`正在回复执行 Agent 的问题`:`Replying to the worker`,(0,U.jsx)(`button`,{type:`button`,className:`ml-2 underline`,onClick:()=>o(null),children:n===`zh`?`取消`:`Cancel`})]}):null,(0,U.jsx)(`textarea`,{value:r,onChange:e=>i(e.target.value),rows:2,"aria-label":n===`zh`?`任务留言`:`Task message`,placeholder:n===`zh`?`给执行 Agent 留言`:`Message the worker`,className:`mt-3 w-full resize-y rounded-lg border border-edge bg-surface-base px-3 py-2 text-sm text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`}),_?(0,U.jsx)(`p`,{role:`alert`,className:`mt-1 text-xs text-danger`,children:_}):null,(0,U.jsx)(`button`,{type:`button`,disabled:!r.trim()||s,onClick:()=>void T(),className:`mt-2 rounded-lg bg-accent px-3 py-2 text-xs font-medium text-white disabled:opacity-50`,children:s?n===`zh`?`发送中`:`Sending`:n===`zh`?`发送`:`Send`})]})}function ot(e,t,n,r){return!!(e&&t!==e.version&&n!==e.value&&r!==n)}function st(e,t){let n={...e.task};t.title!==void 0&&(n.title=t.title),t.priority!==void 0&&(n.priority=t.priority);for(let e of[`body`,`projectId`,`milestoneId`,`parentTaskId`,`dueAt`,`ownerId`]){let r=t[e];r!==void 0&&(r===null?delete n[e]:Object.assign(n,{[e]:r}))}return n.version+=1,n.updatedAt=Date.now(),{...e,task:n}}function ct(e,t){return(t===`zh`?{backlog:`待规划`,ready:`就绪`,active:`进行中`,review:`待验收`,closed:`已关闭`}:{backlog:`Backlog`,ready:`Ready`,active:`Active`,review:`Review`,closed:`Closed`})[e]}function lt(){let e=(0,H.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,U.jsxs)(`div`,{className:`space-y-4`,"aria-busy":!0,children:[(0,U.jsx)(ce,{className:`h-32 rounded-2xl`}),(0,U.jsx)(ce,{className:`h-52 rounded-2xl`}),(0,U.jsx)(ce,{className:`h-40 rounded-2xl`})]}),e[0]=t):t=e[0],t}function ut(e){if(e===void 0)return``;let t=new Date(e);return new Date(t.getTime()-t.getTimezoneOffset()*6e4).toISOString().slice(0,10)}function dt(e){return e?new Date(`${e}T23:59:59.999`).getTime():null}var G=[`backlog`,`ready`,`active`,`review`,`closed`],ft=[`low`,`normal`,`high`,`critical`],pt=(0,W.memo)(function(e){let t=(0,H.c)(20),{value:n,disabled:r,canMove:i,canApprove:a,canReopen:o,language:s,label:c,onChange:l}=e,u;t[0]!==a||t[1]!==i||t[2]!==o||t[3]!==n?(u=e=>e!==n&&!i&&!(e===`closed`?a:n===`closed`&&o),t[0]=a,t[1]=i,t[2]=o,t[3]=n,t[4]=u):u=t[4];let d=u,f;t[5]===c?f=t[6]:(f=(0,U.jsx)(`span`,{children:c}),t[5]=c,t[6]=f);let p;t[7]===l?p=t[8]:(p=e=>l(e.target.value),t[7]=l,t[8]=p);let m;t[9]!==s||t[10]!==d?(m=G.map(e=>(0,U.jsx)(D,{value:e,disabled:d(e),children:ct(e,s)},e)),t[9]=s,t[10]=d,t[11]=m):m=t[11];let h;t[12]!==r||t[13]!==p||t[14]!==m||t[15]!==n?(h=(0,U.jsx)(E,{triggerClassName:`border-0 bg-surface-hover shadow-none focus-visible:ring-2 focus-visible:ring-accent/30`,contentClassName:`border-0`,value:n,disabled:r,onChange:p,children:m}),t[12]=r,t[13]=p,t[14]=m,t[15]=n,t[16]=h):h=t[16];let g;return t[17]!==f||t[18]!==h?(g=(0,U.jsxs)(`label`,{className:`grid gap-1.5 text-xs text-fg-muted`,children:[f,h]}),t[17]=f,t[18]=h,t[19]=g):g=t[19],g}),mt=(0,W.memo)(function(e){let t=(0,H.c)(14),{value:n,disabled:r,label:i,labels:a,onChange:o}=e,s;t[0]===i?s=t[1]:(s=(0,U.jsx)(`span`,{children:i}),t[0]=i,t[1]=s);let c;t[2]===o?c=t[3]:(c=e=>o(e.target.value),t[2]=o,t[3]=c);let l;t[4]===a?l=t[5]:(l=ft.map(e=>(0,U.jsx)(D,{value:e,children:a[e]},e)),t[4]=a,t[5]=l);let u;t[6]!==r||t[7]!==c||t[8]!==l||t[9]!==n?(u=(0,U.jsx)(E,{triggerClassName:`border-0 bg-surface-hover shadow-none focus-visible:ring-2 focus-visible:ring-accent/30`,contentClassName:`border-0`,value:n,disabled:r,onChange:c,children:l}),t[6]=r,t[7]=c,t[8]=l,t[9]=n,t[10]=u):u=t[10];let d;return t[11]!==s||t[12]!==u?(d=(0,U.jsxs)(`label`,{className:`grid gap-1.5 text-xs text-fg-muted`,children:[s,u]}),t[11]=s,t[12]=u,t[13]=d):d=t[13],d}),ht=(0,W.memo)(function(e){let t=(0,H.c)(10),{value:n,disabled:r,label:i,onChange:a}=e,o;t[0]===i?o=t[1]:(o=(0,U.jsx)(`span`,{children:i}),t[0]=i,t[1]=o);let s;t[2]!==r||t[3]!==i||t[4]!==a||t[5]!==n?(s=(0,U.jsx)(Ue,{disabled:r,value:n,onChange:a,ariaLabel:i}),t[2]=r,t[3]=i,t[4]=a,t[5]=n,t[6]=s):s=t[6];let c;return t[7]!==o||t[8]!==s?(c=(0,U.jsxs)(`label`,{className:`grid gap-1.5 text-xs text-fg-muted`,children:[o,s]}),t[7]=o,t[8]=s,t[9]=c):c=t[9],c}),gt=(0,W.memo)(function(e){let t=(0,H.c)(17),{value:n,disabled:r,label:i,unassignedLabel:a,agents:o,onChange:s}=e,c;t[0]===i?c=t[1]:(c=(0,U.jsx)(`span`,{children:i}),t[0]=i,t[1]=c);let l;t[2]===s?l=t[3]:(l=e=>s(e.target.value),t[2]=s,t[3]=l);let u;t[4]===a?u=t[5]:(u=(0,U.jsx)(D,{value:``,disabled:!0,children:a}),t[4]=a,t[5]=u);let d;t[6]===o?d=t[7]:(d=o.map(Mt),t[6]=o,t[7]=d);let f;t[8]!==r||t[9]!==l||t[10]!==u||t[11]!==d||t[12]!==n?(f=(0,U.jsxs)(E,{triggerClassName:`border-0 bg-surface-hover shadow-none focus-visible:ring-2 focus-visible:ring-accent/30`,contentClassName:`border-0`,value:n,disabled:r,onChange:l,children:[u,d]}),t[8]=r,t[9]=l,t[10]=u,t[11]=d,t[12]=n,t[13]=f):f=t[13];let p;return t[14]!==c||t[15]!==f?(p=(0,U.jsxs)(`label`,{className:`grid gap-1.5 text-xs text-fg-muted`,children:[c,f]}),t[14]=c,t[15]=f,t[16]=p):p=t[16],p}),_t=(0,W.memo)(function(e){let t=(0,H.c)(9),{candidates:n,selected:r,disabled:i,labels:a,getTaskHref:o,onChange:s}=e,c;t[0]===r?c=t[1]:(c=r.map(Nt),t[0]=r,t[1]=c);let l;return t[2]!==n||t[3]!==i||t[4]!==o||t[5]!==a||t[6]!==s||t[7]!==c?(l=(0,U.jsx)(Je,{borderless:!0,candidates:n,selectedIds:c,disabled:i,getTaskHref:o,onChange:s,labels:a}),t[2]=n,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=c,t[8]=l):l=t[8],l},(e,t)=>e.disabled===t.disabled&&e.labels===t.labels&&e.getTaskHref===t.getTaskHref&&e.onChange===t.onChange&&e.candidates.length===t.candidates.length&&e.candidates.every((e,n)=>e.id===t.candidates[n]?.id&&e.title===t.candidates[n]?.title)&&e.selected.length===t.selected.length&&e.selected.every((e,n)=>e.id===t.selected[n]?.id&&e.title===t.selected[n]?.title)),vt=`xopc.taskDetail.chatPanelPercent`,yt=42;function bt(e,t){let n=Math.max(30,352/Math.max(t,1)*100),r=Math.min(60,(t-480)/Math.max(t,1)*100);return r<n?yt:Math.min(r,Math.max(n,e))}function xt(){try{let e=Number(window.localStorage.getItem(vt));return Number.isFinite(e)&&e>=30&&e<=60?e:yt}catch{return yt}}function St(e){let t=(0,H.c)(13),{items:n,empty:r,contentKey:i}=e,a=u(wt);if(n.length===0){let e;return t[0]===r?e=t[1]:(e=(0,U.jsx)(`p`,{className:`text-sm leading-6 text-fg-muted`,children:r}),t[0]=r,t[1]=e),e}let o;t[2]===n?o=t[3]:(o=n.join(`
|
|
2
|
-
`),t[2]=n,t[3]=o);let s;t[4]===n?s=t[5]:(s=n.map(Ct),t[4]=n,t[5]=s);let c;t[6]===s?c=t[7]:(c=(0,U.jsx)(`ul`,{className:`space-y-2`,children:s}),t[6]=s,t[7]=c);let l;return t[8]!==i||t[9]!==a||t[10]!==o||t[11]!==c?(l=(0,U.jsx)(V,{content:o,contentKey:i,language:a,previewHeight:144,children:c}),t[8]=i,t[9]=a,t[10]=o,t[11]=c,t[12]=l):l=t[12],l}function Ct(e){return(0,U.jsxs)(`li`,{className:`flex gap-2 text-sm leading-6 text-fg`,children:[(0,U.jsx)(A,{className:`mt-1 size-4 shrink-0 text-fg-subtle`}),(0,U.jsx)(`span`,{className:`min-w-0 whitespace-pre-wrap break-words [overflow-wrap:anywhere]`,children:e})]},e)}function wt(e){return e.language}function Tt({taskId:e,presentation:t,backgroundPath:n,onDeleted:r}){let[i]=a(),c=s(),d=u(e=>e.language),f=l(e=>e.conversationId),p=(0,W.useMemo)(()=>Ce(d),[d]),m=ke(e=>e.setPageHeader),h=ke(e=>e.clearPageHeader),g=Se(e=>e.panes),_=C(e=>e.openForSession),{data:v,error:y,mutate:E,lastChange:D,conversationLoading:se,conversationError:Oe}=x(e),{data:Le,error:Re,mutate:ze}=fe(e?[`task-detail-automations`,f]:null,()=>We.list(),{refreshInterval:3e4}),[Be,R]=(0,W.useState)(null),[z,Ve]=(0,W.useState)(()=>new Set),[He,Ue]=(0,W.useState)([]),[B,Je]=(0,W.useState)(null),[H,Ze]=(0,W.useState)([]),[et,tt]=(0,W.useState)(!1),[nt,rt]=(0,W.useState)(``),[ct,G]=(0,W.useState)(!1),[ft,Ct]=(0,W.useState)(``),[wt,Tt]=(0,W.useState)(xt),[Et,Dt]=(0,W.useState)(!1),Ot=(0,W.useRef)(null),kt=(0,W.useRef)(null),At=(0,W.useRef)(null),jt=(0,W.useRef)(!1),Mt=(0,W.useRef)(!1),Nt=(0,W.useRef)(``),Pt=(0,W.useRef)(null),Ft=(0,W.useRef)(null),It=(0,W.useRef)(null),K=(0,W.useRef)(v),[Lt,q]=(0,W.useState)(null),[Rt,zt]=(0,W.useState)(null),[Bt,Vt]=(0,W.useState)(!1),[Ht,Ut]=(0,W.useState)(!1),[Wt,Gt]=(0,W.useState)(null),Kt=(0,W.useRef)(null),qt=(0,W.useMemo)(()=>({link:p.linkDependencies,linked:p.linkedDependencies,searchPlaceholder:p.dependencySearchPlaceholder,noMatches:p.noDependencyMatches,noCandidates:p.noDependencyCandidates,remove:p.removeDependency}),[p.dependencySearchPlaceholder,p.linkDependencies,p.linkedDependencies,p.noDependencyCandidates,p.noDependencyMatches,p.removeDependency]),Jt=v?.dependencies.map(e=>`${e.id}:${e.title}`).join(`\0`)??``,Yt=(0,W.useMemo)(()=>re(i.get(`returnTo`),`/`,[`/projects`,`/chat`,`/notes`,`/tasks`]),[i]),Xt=(0,W.useCallback)(e=>t===`modal`&&n?M(n,e):P(`/tasks/${encodeURIComponent(e)}`,Yt),[n,t,Yt]);K.current=v;let J=(0,W.useCallback)((e,t)=>{Ve(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r})},[]);(0,W.useEffect)(()=>{R(null),q(null),tt(!1),Pt.current=null,G(!1),zt(null),Vt(!1),Ut(!1),Gt(null)},[e]),(0,W.useEffect)(()=>{let e=!0;return xe().then(t=>{e&&Ze(t.items)}).catch(()=>void 0),()=>{e=!1}},[f]),(0,W.useEffect)(()=>{if(!D||D.source===`user`)return;zt(D);let e=window.setTimeout(()=>zt(null),3500);return()=>window.clearTimeout(e)},[D]),(0,W.useEffect)(()=>{let t=v?.task.projectId,n=v?.dependencies??[];if(!t){It.current=null,Je(null),Ue(n);return}It.current!==t&&(It.current=t,Je(null));let r=!0;return le(t).then(t=>{if(!r)return;Je(t.project.name);let i=new Map;for(let r of[...t.tasks,...n])r.id!==e&&i.set(r.id,{id:r.id,title:r.title});Ue([...i.values()])}).catch(()=>{r&&Ue(n)}),()=>{r=!1}},[Jt,v?.task.projectId,e]);let Y=(0,W.useCallback)(async(t,n=`command`)=>{let r=K.current;if(r){J(n,!0),R(null);try{await E(await _e(e,t,r.task.version),{revalidate:!1})}catch{R(p.actionFailed)}finally{J(n,!1)}}},[p.actionFailed,E,J,e]),Zt=(0,W.useCallback)(async(t,n)=>{let r=K.current;if(!r)return!1;n&&J(n,!0),R(null);try{let n=me(e,t,r.task.version);return await E(n,{optimisticData:st(r,t),populateCache:!0,revalidate:!1,rollbackOnError:!0}),!0}catch{return R(p.actionFailed),!1}finally{n&&J(n,!1)}},[p.actionFailed,E,J,e]),Qt=()=>{v&&(Pt.current={value:v.task.title,version:v.task.version},q(null),rt(v.task.title),tt(!0))},$t=()=>{jt.current=!0,rt(K.current?.task.title??``),Pt.current=null,q(null),tt(!1),queueMicrotask(()=>{jt.current=!1})},en=async(e=!1)=>{if(jt.current){jt.current=!1;return}let t=K.current;if(!t||z.has(`title`))return;let n=nt.trim();if(!n){$t();return}let r=Pt.current;if(!e&&ot(r,t.task.version,t.task.title,n)){q(`title`);return}if(n===t.task.title){$t();return}await Zt({title:n},`title`)&&(Pt.current=null,q(null),tt(!1))},tn=async()=>{if(!v)return;if(Mt.current){Mt.current=!1;return}let e=ft.trim(),t=Ft.current;if(ot(t,v.task.version,v.task.body??``,e)){q(`description`);return}if(ft===Nt.current||e===(v.task.body??``).trim()){G(!1);return}await Zt({body:ue(v.task.body??``,e)||null})&&(q(null),G(!1))},nn=(0,W.useCallback)(async e=>{let t=K.current;!t||e===t.task.phase||await Y({type:`move`,phase:e},`phase`)},[Y]),rn=(0,W.useCallback)(e=>{Zt({priority:e},`priority`)},[Zt]),an=(0,W.useCallback)(e=>{Zt({dueAt:dt(e)},`dueAt`)},[Zt]),on=(0,W.useCallback)(e=>{Tt(e);try{window.localStorage.setItem(vt,String(e))}catch{}},[]),sn=(0,W.useCallback)(e=>{if(e.key!==`ArrowLeft`&&e.key!==`ArrowRight`&&e.key!==`Home`)return;e.preventDefault();let t=At.current?.clientWidth??0,n=e.key===`Home`?yt:wt+(e.key===`ArrowLeft`?2:-2);on(bt(n,t))},[wt,on]),cn=(0,W.useCallback)(e=>{if(!window.matchMedia(`(min-width: 1024px)`).matches)return;let t=At.current;if(!t)return;e.preventDefault();let n=e.currentTarget,r=e.pointerId;n.setPointerCapture(r),Dt(!0);let i=wt,a=0,o=()=>{a=0,t.style.setProperty(`--task-chat-panel-width`,`${i}%`)},s=e=>{let n=t.getBoundingClientRect();i=bt((n.right-e.clientX)/n.width*100,n.width),a===0&&(a=window.requestAnimationFrame(o))},c=()=>{a!==0&&(window.cancelAnimationFrame(a),o());try{n.releasePointerCapture(r)}catch{}Dt(!1),on(i),window.removeEventListener(`pointermove`,s),window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c)};window.addEventListener(`pointermove`,s),window.addEventListener(`pointerup`,c),window.addEventListener(`pointercancel`,c)},[wt,on]),ln=(0,W.useCallback)(async t=>{let n=K.current;if(n){J(`dependencies`,!0),R(null);try{await E(await ve(e,t,n.task.version),{revalidate:!1})}catch{R(p.dependencyUpdateFailed)}finally{J(`dependencies`,!1)}}},[p.dependencyUpdateFailed,E,J,e]),un=(0,W.useCallback)(async t=>{let n=K.current;if(!(!n||!t||t===n.conversation.currentExecutorAgentId)){J(`delegateAgentId`,!0),R(null);try{await E(await be(e,t,n.task.version),{revalidate:!1})}catch{R(p.actionFailed)}finally{J(`delegateAgentId`,!1)}}},[p.actionFailed,E,J,e]),dn=(0,W.useCallback)(async()=>{J(`delete`,!0),R(null);try{await ye(e),r?r():c(Yt,{replace:!0})}catch(e){R(e instanceof Error?e.message:p.actionFailed)}finally{J(`delete`,!1)}},[p.actionFailed,c,r,Yt,J,e]),fn=(0,W.useCallback)(async(t,n)=>{let r=K.current;if(r){J(`acceptance`,!0),R(null);try{await E(await pe(e,t,n,r.task.version,r.task.latestContractVersion),{revalidate:!1})}catch{R(p.actionFailed),await E()}finally{J(`acceptance`,!1)}}},[p.actionFailed,E,J,e]);if((0,W.useLayoutEffect)(()=>{if(t!==`modal`)return m({startExtra:(0,U.jsx)(o,{to:Yt,className:`flex size-9 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover`,"aria-label":p.backToWork,children:(0,U.jsx)(w,{className:`size-4`})}),main:v?(0,U.jsx)(`p`,{className:`truncate text-sm font-semibold text-fg`,children:B?`${B} / ${p.taskLabel}`:p.taskLabel}):null,end:null}),h},[h,p.backToWork,p.taskLabel,v,t,B,Yt,m]),y&&!v)return(0,U.jsx)(`div`,{className:t===`modal`?`p-5 text-sm text-danger`:`mx-auto max-w-3xl p-6 text-sm text-danger`,children:p.taskNotFound});if(!v)return(0,U.jsx)(`div`,{className:t===`modal`?`p-5`:`mx-auto max-w-4xl p-4 sm:p-6`,children:(0,U.jsx)(lt,{})});let pn=v.waits[0],mn=Te(v),hn=mn.length>0&&mn.every(e=>e.status===`passed`),gn=v.waits.find(e=>e.kind===`paused`),X=we(v),_n=De(v),vn=p.detailStatuses[_n],yn=de(v.task.body?.trim()||v.task.contract?.objective.trim()||``),bn=v.allowedCommands.includes(`mark_ready`),xn=v.allowedCommands.includes(`start`),Sn=v.allowedCommands.includes(`add_wait`),Cn=!pn&&hn&&v.task.phase===`review`&&v.allowedCommands.includes(`close`),wn=v.allowedCommands.includes(`reopen`),Z=v.conversation.activeConversationId,Q=v.conversation.currentExecutorAgentId??v.task.delegateAgentId??v.task.ownerId,Tn=H.find(e=>e.id===Q),En=!!(Z&&g[Z]?.open),Dn=v.context.filter(e=>e.role===`deliverable`),On=new Set(v.runs.filter(e=>e.contractVersion===v.task.latestContractVersion).map(e=>e.id)),kn=[...new Map(v.receipts.filter(e=>On.has(e.runId)).flatMap(e=>e.evidence.filter(e=>e.kind===`artifact`)).map(e=>[e.uri??e.title,e])).values()],An=v.context.filter(e=>e.role!==`deliverable`),jn=Le?.automations.filter(t=>t.action.kind===`task_command`&&t.action.taskId===e)??[],Mn=jn.filter(e=>e.trigger.kind===`schedule`&&e.action.kind===`task_command`&&e.action.command.type===`start`),Nn=e=>{ze(t=>({automations:[e,...(t?.automations??[]).filter(t=>t.id!==e.id)]}),{revalidate:!1})},Pn=e=>{Gt(e),Ut(!0)},Fn=()=>{Le&&(Mn.length===1?Pn(Mn[0]):Mn.length>1?(Kt.current?.scrollIntoView({block:`start`,behavior:`smooth`}),Kt.current?.focus({preventScroll:!0})):(Gt(null),Ut(!0)))},$=v.sessions.filter((e,t,n)=>n.findIndex(t=>t.conversationId===e.conversationId)===t),In=v.task.contract?.expectedOutputs??[],Ln=v.task.contract?.constraints??[],Rn=v.task.contract?.approvalRequired??[],zn=v.task.contract?.assumptions??[],Bn=v.task.contract?.risks??[],Vn=Ln.length>0||Rn.length>0||zn.length>0||Bn.length>0,Hn=(...e)=>!!Rt?.changedFields.some(t=>e.includes(t)),Un=v.allowedCommands.includes(`move`),Wn=z.has(`command`),Gn=z.has(`delete`),Kn=v.runs.find(e=>!e.parentRunId&&[`queued`,`running`,`waiting`,`verifying`].includes(e.status)),qn=Kn!==void 0,Jn=()=>{let e=Ot.current;e&&(e.open=!0,e.scrollIntoView({block:`start`,behavior:`smooth`}),e.focus({preventScroll:!0}))},Yn=(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[bn&&!xn&&!pn&&v.task.phase!==`review`?(0,U.jsxs)(I,{className:`min-h-9 px-3 py-1.5 text-xs`,variant:`primary`,disabled:Wn,onClick:()=>void Y({type:`mark_ready`}),children:[(0,U.jsx)(oe,{className:`size-4`}),p.scheduleTask]}):null,gn&&v.allowedCommands.includes(`resolve_wait`)?(0,U.jsxs)(I,{className:`min-h-9 px-3 py-1.5 text-xs`,variant:`primary`,disabled:Wn,onClick:()=>void Y({type:`resolve_wait`,waitId:gn.id}),children:[(0,U.jsx)(oe,{className:`size-4`}),p.resumeTask]}):null,!pn&&xn&&v.task.phase!==`review`&&Q?(0,U.jsxs)(I,{className:`min-h-9 px-3 py-1.5 text-xs`,variant:`primary`,disabled:Wn,onClick:()=>void Y({type:`start`,executor:{kind:`agent`,agentId:Q}}),children:[(0,U.jsx)(oe,{className:`size-4`}),p.runTask]}):null,Cn?(0,U.jsxs)(I,{className:`min-h-9 px-3 py-1.5 text-xs`,variant:`primary`,disabled:Wn,onClick:()=>void Y({type:`close`,resolution:`done`}),children:[(0,U.jsx)(O,{className:`size-4`}),p.approveTask]}):null,wn?(0,U.jsxs)(I,{className:`min-h-9 px-3 py-1.5 text-xs`,variant:`ghost`,disabled:Wn,onClick:()=>void Y({type:`reopen`,phase:`ready`}),children:[(0,U.jsx)(oe,{className:`size-4`}),p.reopenTask]}):null,!gn&&Sn?(0,U.jsxs)(I,{variant:`ghost`,className:`min-h-9 px-3 py-1.5 text-xs`,disabled:Wn,onClick:()=>void Y({type:`add_wait`,wait:{kind:`paused`,reason:`Paused by user`,condition:{}}}),children:[(0,U.jsx)(ae,{className:`size-4`}),p.pauseTask]}):null,v.task.phase===`closed`?(0,U.jsx)(I,{variant:`primary`,className:`min-h-9 px-3 py-1.5 text-xs`,onClick:()=>{kt.current?.scrollIntoView({block:`start`,behavior:`smooth`}),kt.current?.focus({preventScroll:!0})},children:d===`zh`?`查看结果`:`View results`}):null,!pn&&!Kn&&v.task.phase!==`closed`?(0,U.jsxs)(I,{variant:`ghost`,className:`min-h-9 px-3 py-1.5 text-xs`,disabled:!Le,onClick:Fn,children:[(0,U.jsx)(T,{className:`size-4`}),Mn.length>0?d===`zh`?`管理执行时间`:`Manage schedule`:d===`zh`?`设置执行时间`:`Set execution time`]}):null,v.task.phase===`review`&&!Cn&&!pn?(0,U.jsx)(I,{variant:`primary`,className:`min-h-9 px-3 py-1.5 text-xs`,onClick:Jn,children:d===`zh`?`去验收`:`Review results`}):null,(0,U.jsxs)(Me,{children:[(0,U.jsx)(Ne,{asChild:!0,children:(0,U.jsx)(I,{type:`button`,variant:`ghost`,className:`size-9 p-0`,disabled:Wn||Gn,"aria-label":p.moreActions,children:(0,U.jsx)(ee,{className:`size-4`,"aria-hidden":!0})})}),(0,U.jsx)(Pe,{children:(0,U.jsxs)(Fe,{align:`end`,sideOffset:6,className:`z-[100] min-w-44 rounded-lg border border-edge bg-surface-overlay p-1 shadow-popover`,children:[v.task.phase===`review`&&!pn&&xn&&Q?(0,U.jsx)(L,{className:`cursor-pointer rounded-md px-3 py-2 text-sm text-fg outline-none focus:bg-surface-hover`,onSelect:()=>void Y({type:`start`,executor:{kind:`agent`,agentId:Q}}),children:p.runTask}):null,bn&&(xn||pn||v.task.phase===`review`)?(0,U.jsx)(L,{className:`cursor-pointer rounded-md px-3 py-2 text-sm text-fg outline-none focus:bg-surface-hover`,onSelect:()=>void Y({type:`mark_ready`}),children:p.scheduleTask}):null,Kn?(0,U.jsx)(L,{className:`cursor-pointer rounded-md px-3 py-2 text-sm text-danger outline-none hover:bg-surface-hover focus:bg-surface-hover`,onSelect:()=>{J(`command`,!0),R(null),E(ge(e,Kn.id,Kn.version),{revalidate:!1}).catch(()=>R(p.actionFailed)).finally(()=>J(`command`,!1))},children:p.cancelActiveRun}):null,Kn?(0,U.jsx)(Ie,{className:`my-1 h-px bg-edge`}):null,v.task.phase===`closed`?null:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(L,{className:`cursor-pointer rounded-md px-3 py-2 text-sm text-danger outline-none hover:bg-surface-hover focus:bg-surface-hover`,onSelect:()=>void Y({type:`close`,resolution:`cancelled`}),children:p.cancelTask}),(0,U.jsx)(Ie,{className:`my-1 h-px bg-edge`})]}),(0,U.jsx)(L,{className:`cursor-pointer rounded-md px-3 py-2 text-sm text-danger outline-none hover:bg-surface-hover focus:bg-surface-hover`,onSelect:()=>{if(qn){R(p.deleteActiveTaskBlocked);return}Vt(!0)},children:p.deleteTask})]})})]})]});return(0,U.jsxs)(`div`,{ref:At,className:`flex h-full min-h-0 flex-col overflow-hidden ${Et?`lg:cursor-col-resize lg:select-none`:``}`,style:{"--task-chat-panel-width":`${wt}%`},children:[(0,U.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto lg:flex-row lg:overflow-hidden`,children:[(0,U.jsxs)(`div`,{className:`task-detail-scroll flex min-w-0 shrink-0 flex-col lg:min-h-0 lg:flex-1 lg:shrink lg:overflow-y-auto lg:overscroll-contain`,children:[(0,U.jsxs)(`header`,{className:F(`shrink-0 border-b border-edge-subtle bg-surface-panel px-5 py-4 sm:px-6`,Hn(`title`)&&`task-detail-live-update`),children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-x-6 gap-y-3`,children:[(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs text-fg-muted`,children:[B?(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,U.jsx)(ne,{className:`size-3.5`,"aria-hidden":!0}),B]}):null,B?(0,U.jsx)(`span`,{"aria-hidden":`true`,children:`/`}):null,(0,U.jsx)(`span`,{children:p.taskLabel}),Rt?(0,U.jsx)(`span`,{className:`rounded-full bg-accent-soft px-2 py-0.5 text-[11px] font-medium text-accent-fg`,role:`status`,children:Rt.source===`agent`?d===`zh`?`Agent 刚刚更新`:`Updated by Agent`:d===`zh`?`执行结果已同步`:`Execution result synced`}):null]}),et?(0,U.jsx)(`textarea`,{autoFocus:!0,"data-task-inline-editor":!0,"aria-label":d===`zh`?`任务标题`:`Task title`,rows:2,value:nt,onFocus:e=>{Pt.current?.value===nt&&(e.currentTarget.setSelectionRange(0,0),e.currentTarget.scrollTop=0)},onChange:e=>rt(e.target.value),onBlur:()=>void en(),onKeyDown:e=>{e.nativeEvent.isComposing||(e.key===`Escape`?(e.preventDefault(),e.stopPropagation(),$t()):e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),e.currentTarget.blur()))},className:`mt-2 block max-h-56 min-h-14 w-full max-w-3xl resize-none overflow-y-auto bg-transparent p-0 text-xl font-semibold leading-7 text-fg outline-none [field-sizing:content]`}):(0,U.jsx)(V,{content:v.task.title,contentKey:`${e}:title`,language:d,previewHeight:56,className:`mt-2 max-w-3xl`,children:(0,U.jsx)(`h1`,{className:`break-words text-xl font-semibold leading-7 text-fg`,children:(0,U.jsx)(`button`,{type:`button`,className:`max-w-full whitespace-pre-wrap break-words [overflow-wrap:anywhere] rounded-sm text-left outline-none hover:bg-surface-hover/60 focus-visible:ring-2 focus-visible:ring-accent/40`,title:v.task.title,onClick:Qt,children:v.task.title})})}),Lt===`title`?(0,U.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2 text-xs text-warning`,role:`alert`,children:[(0,U.jsx)(`span`,{children:d===`zh`?`Agent 在你编辑期间更新了标题。`:`The Agent updated the title while you were editing.`}),(0,U.jsx)(`button`,{type:`button`,className:`rounded-md bg-surface-hover px-2 py-1 text-fg`,onClick:$t,children:d===`zh`?`使用 Agent 版本`:`Use Agent version`}),(0,U.jsx)(`button`,{type:`button`,className:`rounded-md bg-accent-soft px-2 py-1 text-accent-fg`,disabled:z.has(`title`),onClick:()=>void en(!0),children:d===`zh`?`保留我的修改`:`Keep my changes`})]}):null]}),(0,U.jsx)(`span`,{className:F(`shrink-0 rounded-full px-2.5 py-1 text-xs font-medium`,Ee(_n)),children:vn})]}),(0,U.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-x-4 gap-y-2 text-xs text-fg-muted`,children:[(0,U.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-2`,children:[Q?(0,U.jsx)(Ae,{agentId:Q,avatar:Tn?.avatar,size:20,className:`shrink-0`}):null,(0,U.jsxs)(`span`,{className:`min-w-0 break-words [overflow-wrap:anywhere]`,children:[p.executorLabel,` · `,Tn?.name??Q??p.unassigned]})]}),(0,U.jsx)(`span`,{className:`text-fg-subtle`,children:p.updatedAt.replace(`{{date}}`,Ge(v.task.updatedAt,d))})]})]}),(0,U.jsxs)(`div`,{className:`sticky top-0 z-10 flex shrink-0 flex-wrap items-center justify-between gap-2 border-b border-edge-subtle bg-surface-panel px-4 py-2 sm:px-5`,"aria-label":d===`zh`?`任务操作`:`Task actions`,children:[(0,U.jsxs)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-fg-muted`,children:[v.task.title,` · `,vn]}),Yn,Be?(0,U.jsx)(`p`,{role:`alert`,className:`basis-full text-sm text-danger`,children:Be}):null]}),(0,U.jsxs)(`section`,{className:`min-w-0 space-y-4 p-4 sm:p-5`,children:[(0,U.jsx)($e,{detail:v,language:d,onUpdated:e=>{E(e,{revalidate:!1})}}),!Le&&!Re?(0,U.jsx)(ce,{className:`h-24 rounded-xl`}):null,Re?(0,U.jsxs)(`div`,{role:`alert`,className:`flex flex-wrap items-center gap-2 text-sm text-danger`,children:[(0,U.jsx)(`span`,{children:d===`zh`?`无法读取执行计划,请重试后再设置时间。`:`Could not load schedules. Retry before setting a time.`}),(0,U.jsx)(I,{variant:`ghost`,onClick:()=>void ze(),children:d===`zh`?`重试`:`Retry`})]}):null,Mn.length>0?(0,U.jsx)(`div`,{ref:Kt,tabIndex:-1,className:`scroll-mt-24`,children:(0,U.jsx)(Xe,{schedules:Mn,language:d,onEdit:Pn,onUpdated:Nn})}):null,(0,U.jsxs)(`section`,{ref:kt,tabIndex:-1,"aria-labelledby":`task-results-heading`,className:`scroll-mt-24`,children:[(0,U.jsx)(`h2`,{id:`task-results-heading`,className:`mb-3 text-sm font-semibold text-fg`,children:d===`zh`?`结果与交付`:`Results and deliverables`}),Dn.length>0||kn.length>0?(0,U.jsxs)(`section`,{className:`mb-4 rounded-xl border border-edge-subtle bg-surface-panel p-5 shadow-surface`,children:[(0,U.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:d===`zh`?`交付物`:`Deliverables`}),Dn.length>0||kn.length>0?(0,U.jsxs)(`ul`,{className:`mt-3 space-y-2`,children:[Dn.map(t=>(0,U.jsxs)(`li`,{className:`rounded-lg bg-surface-hover p-3 text-sm`,children:[(0,U.jsx)(`span`,{className:`block text-xs text-fg-muted`,children:p.contextKindLabels[t.targetKind]}),t.targetKind===`url`&&/^https?:\/\//.test(t.targetId)?(0,U.jsx)(V,{content:t.title??t.targetId,contentKey:`${e}:deliverable:${t.id}`,language:d,previewHeight:60,className:`mt-1`,children:(0,U.jsx)(`a`,{className:`block break-all text-accent hover:underline`,href:t.targetId,target:`_blank`,rel:`noreferrer`,children:t.title??t.targetId})}):(0,U.jsx)(V,{content:t.title??t.targetId,contentKey:`${e}:deliverable:${t.id}`,language:d,markdown:!1,previewHeight:60,className:`mt-1 text-fg`})]},t.id)),kn.map(t=>(0,U.jsxs)(`li`,{className:`rounded-lg bg-surface-hover p-3 text-sm`,children:[(0,U.jsx)(`span`,{className:`block text-xs text-fg-muted`,children:d===`zh`?`执行产物(待检查)`:`Run artifact (review needed)`}),t.uri&&/^https?:\/\//.test(t.uri)?(0,U.jsx)(V,{content:t.title,contentKey:`${e}:artifact:${t.uri??t.title}`,language:d,previewHeight:60,className:`mt-1`,children:(0,U.jsx)(`a`,{className:`block break-all text-accent hover:underline`,href:t.uri,target:`_blank`,rel:`noreferrer`,children:t.title})}):(0,U.jsx)(V,{content:t.title,contentKey:`${e}:artifact:${t.uri??t.title}`,language:d,markdown:!1,previewHeight:60,className:`mt-1 text-fg`})]},t.uri??t.title))]}):(0,U.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:d===`zh`?`尚未关联交付物`:`No deliverables linked yet`})]}):null,X?(0,U.jsxs)(`section`,{className:F(`mb-4 rounded-xl border border-edge-subtle bg-surface-panel p-5`,Hn(`runs`,`receipts`)&&`task-detail-live-update`),children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:p.latestResult}),(0,U.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:d===`zh`?X.completionVerdict===`achieved`?`本次执行报告目标已达成,请结合下方验证依据验收。`:`这是阶段性结果,尚不能代表任务全部完成。`:X.completionVerdict===`achieved`?`The run reports the goal achieved. Review the evidence below.`:`This is a partial result; the task is not yet fully complete.`})]}),(0,U.jsxs)(`span`,{className:`rounded-full bg-surface-hover px-2.5 py-1 text-xs text-fg-muted`,children:[p.receiptStatuses[X.status],` · `,p.verificationStatuses[X.verification.status]]})]}),(0,U.jsx)(V,{content:X.summary,contentKey:`${e}:result:${X.runId}`,language:d,className:`mt-3`}),X.remainingWork.length>0?(0,U.jsxs)(`div`,{className:`mt-4`,children:[(0,U.jsx)(`h3`,{className:`text-xs font-medium text-fg-muted`,children:p.remainingWork}),(0,U.jsx)(`div`,{className:`mt-2`,children:(0,U.jsx)(St,{contentKey:`${e}:remaining:${X.runId}`,items:X.remainingWork,empty:p.noRemainingWork})})]}):null,X.nextAction?(0,U.jsxs)(`div`,{className:`mt-4 rounded-lg bg-surface-hover p-3`,children:[(0,U.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,children:p.nextAction}),(0,U.jsx)(V,{content:X.nextAction,contentKey:`${e}:next:${X.runId}`,language:d,markdown:!1,previewHeight:72,className:`mt-1 text-sm text-fg`})]}):null,(0,U.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center gap-2`,children:[(0,U.jsx)(I,{className:`border-0 bg-surface-hover px-2 py-1 text-xs shadow-none`,variant:`secondary`,onClick:()=>void he(X.runId,`helpful`),children:p.doneWell}),(0,U.jsx)(I,{className:`px-2 py-1 text-xs`,variant:`ghost`,onClick:()=>void he(X.runId,`not_helpful`),children:p.needsFix})]}),X.evidence.length>0?(0,U.jsxs)(`details`,{className:`mt-4`,children:[(0,U.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg-muted`,children:d===`zh`?`验证依据与执行产物`:`Evidence and run artifacts`}),(0,U.jsx)(Ke,{evidence:X.evidence,projectId:v.task.projectId,conversationId:Z??void 0,language:d})]}):null,v.receipts.length>1?(0,U.jsxs)(`details`,{className:`mt-4 border-t border-edge-subtle pt-4`,children:[(0,U.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg-muted hover:text-fg`,children:p.executionHistory.replace(`{{count}}`,String(v.receipts.length-1))}),(0,U.jsx)(`div`,{className:`mt-3 space-y-3`,children:v.receipts.slice(1).map(t=>(0,U.jsx)(`article`,{className:`rounded-lg bg-surface-hover p-3`,children:(0,U.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,U.jsx)(V,{content:t.summary,contentKey:`${e}:result:${t.runId}`,language:d,className:`min-w-0 flex-1`}),(0,U.jsx)(`span`,{className:`shrink-0 text-xs text-fg-subtle`,children:p.receiptStatuses[t.status]})]})},t.runId))})]}):null]}):null,(0,U.jsxs)(`details`,{open:v.task.phase===`review`||!!X,ref:Ot,tabIndex:-1,"aria-label":p.successDefinition,className:`scroll-mt-24 mb-4 overflow-hidden rounded-xl border border-edge-subtle bg-surface-panel shadow-surface`,children:[(0,U.jsxs)(`summary`,{className:`cursor-pointer p-4 text-sm font-medium text-fg`,children:[p.successDefinition,` · `,mn.filter(e=>e.status===`passed`).length,`/`,mn.length]}),(0,U.jsx)(`div`,{className:`px-5 pb-5`,children:mn.length>0?(0,U.jsx)(`ul`,{className:`mt-3 space-y-3`,children:mn.map((t,n)=>(0,U.jsxs)(`li`,{className:`flex items-start gap-2.5 text-sm leading-5 text-fg`,children:[(0,U.jsx)(t.status===`passed`?O:t.status===`failed`?k:A,{className:F(`mt-0.5 size-4 shrink-0`,t.status===`passed`?`text-success`:t.status===`failed`?`text-danger`:`text-fg-subtle`),"aria-hidden":!0}),(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(V,{content:t.text,contentKey:`${e}:criterion:${n}`,language:d,markdown:!1,previewHeight:60}),t.evidence.length>0?(0,U.jsxs)(`div`,{className:`mt-1 flex flex-wrap gap-x-2 text-xs leading-5 text-fg-muted`,children:[(0,U.jsx)(`span`,{children:d===`zh`?`依据:`:`Evidence:`}),t.evidence.map(e=>e.uri&&/^https?:\/\//.test(e.uri)?(0,U.jsx)(`a`,{className:`text-accent hover:underline`,href:e.uri,target:`_blank`,rel:`noreferrer`,children:e.title},e.title):(0,U.jsx)(`span`,{children:e.title},e.title))]}):null,t.review?(0,U.jsxs)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:[d===`zh`?`人工判定`:`Reviewed by user`,` · `,Ge(t.review.reviewedAt,d)]}):null,t.method===`model_reviewed`?(0,U.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:d===`zh`?`模型审阅:${t.verificationStatus===`passed`?`通过`:t.verificationStatus===`failed`?`未通过`:`未核验`}`:`Model review: ${t.verificationStatus===`passed`?`passed`:t.verificationStatus===`failed`?`failed`:`unverified`}`}):null,t.note?(0,U.jsx)(V,{content:t.note,contentKey:`${e}:criterion-note:${n}`,language:d,markdown:!1,previewHeight:60,className:`mt-1 text-xs text-fg-muted`}):null]}),v.task.phase!==`closed`&&v.task.contract?.acceptancePolicy!==`verified_auto`?(0,U.jsxs)(Me,{children:[(0,U.jsx)(Ne,{asChild:!0,children:(0,U.jsx)(I,{type:`button`,variant:`ghost`,className:`h-7 shrink-0 px-2 text-xs`,disabled:z.has(`acceptance`),children:d===`zh`?`判定`:`Review`})}),(0,U.jsx)(Pe,{children:(0,U.jsxs)(Fe,{align:`end`,sideOffset:4,className:`z-[100] min-w-32 rounded-lg border border-edge bg-surface-overlay p-1 shadow-popover`,children:[(0,U.jsx)(L,{className:`cursor-pointer rounded-md px-3 py-2 text-sm text-fg outline-none hover:bg-surface-hover focus:bg-surface-hover`,onSelect:()=>void fn(n,`passed`),children:d===`zh`?`确认通过`:`Mark passed`}),(0,U.jsx)(L,{className:`cursor-pointer rounded-md px-3 py-2 text-sm text-fg outline-none hover:bg-surface-hover focus:bg-surface-hover`,onSelect:()=>void fn(n,`failed`),children:d===`zh`?`标记未通过`:`Mark failed`})]})})]}):null]},`${n}-${t.text}`))}):(0,U.jsx)(`p`,{className:`mt-3 text-sm text-fg-muted`,children:p.noDefinition})})]}),!X&&Dn.length===0&&kn.length===0?(0,U.jsx)(`p`,{className:`mb-3 text-sm text-fg-muted`,children:d===`zh`?`尚无执行结果`:`No execution results yet`}):null,(0,U.jsxs)(`details`,{className:`rounded-xl border border-edge-subtle bg-surface-panel p-4`,children:[(0,U.jsx)(`summary`,{className:`cursor-pointer text-sm text-fg-muted`,children:d===`zh`?`执行与交付概览`:`Execution and delivery overview`}),(0,U.jsx)(b,{detail:v,language:d})]})]}),(0,U.jsxs)(`section`,{className:`overflow-hidden rounded-xl border border-edge-subtle bg-surface-panel divide-y divide-edge-subtle`,children:[(0,U.jsxs)(`div`,{className:`border-b border-edge-subtle p-5`,children:[(0,U.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:d===`zh`?`任务目标`:`Task goal`}),(0,U.jsx)(V,{content:v.task.contract?.objective||v.task.title,contentKey:`${e}:goal`,language:d,markdown:!1,previewHeight:72,className:`mt-3 text-sm leading-6 text-fg`}),(0,U.jsxs)(I,{variant:`ghost`,className:`mt-2 min-h-9 px-2 text-xs`,onClick:Jn,children:[p.successDefinition,` · `,mn.length]})]}),In.length>0?(0,U.jsxs)(`div`,{className:`p-5`,children:[(0,U.jsx)(`h3`,{className:`text-xs font-medium text-fg-muted`,children:p.expectedOutputs}),(0,U.jsx)(`div`,{className:`mt-2`,children:(0,U.jsx)(St,{contentKey:`${e}:expectedOutputs`,items:In,empty:p.noDefinition})})]}):null,(0,U.jsxs)(`details`,{className:F(`p-5`,Hn(`body`)&&`task-detail-live-update`),children:[(0,U.jsx)(`summary`,{className:`cursor-pointer text-sm font-semibold text-fg`,children:p.taskDescription}),ct?(0,U.jsx)(`textarea`,{autoFocus:!0,"data-task-inline-editor":!0,rows:6,value:ft,onChange:e=>Ct(e.target.value),onBlur:()=>void tn(),onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),Mt.current=!0,Ct(de(v.task.body??v.task.contract?.objective??``)),G(!1),queueMicrotask(()=>{Mt.current=!1}))},className:`mt-3 w-full resize-y rounded-lg bg-surface-hover px-3 py-2 text-sm leading-6 text-fg outline-none ring-2 ring-accent/20 focus:ring-accent/50`}):(0,U.jsxs)(`div`,{className:`mt-2`,children:[yn&&yn!==v.task.title?(0,U.jsx)(V,{content:yn,contentKey:`${e}:description`,language:d}):(0,U.jsx)(`p`,{className:`text-sm leading-6 text-fg-muted`,children:p.noTaskDescription}),(0,U.jsx)(`button`,{type:`button`,className:`mt-2 rounded-md px-2 py-1 text-xs text-accent hover:bg-surface-hover focus-visible:bg-surface-hover`,onClick:()=>{let e=de(v.task.body??v.task.contract?.objective??``);Nt.current=e,Ft.current={value:v.task.body??``,version:v.task.version},q(null),Ct(e),G(!0)},children:d===`zh`?`编辑说明`:`Edit description`})]}),Lt===`description`?(0,U.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2 text-xs text-warning`,role:`alert`,children:[(0,U.jsx)(`span`,{children:d===`zh`?`Agent 在你编辑期间更新了描述。`:`The Agent updated the description while you were editing.`}),(0,U.jsx)(`button`,{type:`button`,className:`rounded-md bg-surface-hover px-2 py-1 text-fg`,onClick:()=>{Ct(de(v.task.body??``)),q(null),G(!1)},children:d===`zh`?`使用 Agent 版本`:`Use Agent version`}),(0,U.jsx)(`button`,{type:`button`,className:`rounded-md bg-accent-soft px-2 py-1 text-accent-fg`,onClick:()=>void Zt({body:ue(v.task.body??``,ft.trim())||null}).then(e=>{e&&(q(null),G(!1))}),children:d===`zh`?`保留我的修改`:`Keep my changes`})]}):null]}),Vn?(0,U.jsxs)(`section`,{className:F(`p-5`,Hn(`contract`)&&`task-detail-live-update`),children:[(0,U.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:p.taskDefinition}),(0,U.jsx)(`p`,{className:`mt-2 text-xs leading-5 text-fg-muted`,children:d===`zh`?`执行边界及补充背景`:`Execution boundaries and supporting context`}),Ln.length>0?(0,U.jsxs)(`details`,{className:`mt-4 border-t border-edge-subtle pt-4`,children:[(0,U.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg-muted hover:text-fg`,children:p.constraints}),(0,U.jsx)(`div`,{className:`mt-3`,children:(0,U.jsx)(St,{contentKey:`${e}:constraints`,items:Ln,empty:p.noDefinition})})]}):null,Rn.length>0?(0,U.jsxs)(`details`,{className:`mt-4 border-t border-edge-subtle pt-4`,children:[(0,U.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg-muted hover:text-fg`,children:p.approvalRequired}),(0,U.jsx)(`div`,{className:`mt-3`,children:(0,U.jsx)(St,{contentKey:`${e}:approvalRequired`,items:Rn,empty:p.noDefinition})})]}):null,zn.length>0?(0,U.jsxs)(`details`,{className:`mt-4 border-t border-edge-subtle pt-4`,children:[(0,U.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg-muted hover:text-fg`,children:p.contextAssumptions}),(0,U.jsx)(`div`,{className:`mt-3`,children:(0,U.jsx)(St,{contentKey:`${e}:assumptions`,items:zn,empty:p.noDefinition})})]}):null,Bn.length>0?(0,U.jsxs)(`details`,{className:`mt-4 border-t border-edge-subtle pt-4`,children:[(0,U.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg-muted hover:text-fg`,children:p.contextRisks}),(0,U.jsx)(`div`,{className:`mt-3`,children:(0,U.jsx)(St,{contentKey:`${e}:risks`,items:Bn,empty:p.noDefinition})})]}):null]}):null]}),(0,U.jsxs)(`section`,{"aria-labelledby":`task-management-heading`,children:[(0,U.jsx)(`h2`,{id:`task-management-heading`,className:`mb-3 text-sm font-semibold text-fg`,children:d===`zh`?`任务管理`:`Task management`}),(0,U.jsxs)(`aside`,{className:`min-w-0 overflow-hidden rounded-xl bg-surface-panel shadow-surface divide-y divide-edge-subtle`,children:[(0,U.jsxs)(`section`,{className:F(`p-5`,Hn(`phase`,`resolution`,`priority`,`dueAt`,`delegateAgentId`)&&`task-detail-live-update`),children:[(0,U.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:p.taskProperties}),(0,U.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-2`,children:[(0,U.jsx)(pt,{value:v.task.phase,disabled:z.has(`phase`),canMove:Un,canApprove:Cn,canReopen:wn,language:d,label:p.taskPhase,onChange:nn}),(0,U.jsx)(mt,{value:v.task.priority,disabled:z.has(`priority`),label:p.priority,labels:p.priorityLabels,onChange:rn}),(0,U.jsx)(ht,{value:ut(v.task.dueAt),disabled:z.has(`dueAt`),label:p.dueDate,onChange:an}),(0,U.jsx)(gt,{value:v.conversation.currentExecutorAgentId??``,disabled:z.has(`delegateAgentId`),label:p.executorLabel,unassignedLabel:p.unassigned,agents:H,onChange:un})]})]}),(0,U.jsxs)(`details`,{className:F(`p-5`,Hn(`dependencies`)&&`task-detail-live-update`),children:[(0,U.jsxs)(`summary`,{className:`cursor-pointer text-sm font-semibold text-fg`,children:[p.taskRelations,` · `,v.dependencies.length,` / `,v.dependents.length]}),(0,U.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`p`,{className:`mb-2 text-xs text-fg-muted`,children:p.dependencies}),(0,U.jsx)(_t,{candidates:He,selected:v.dependencies,disabled:z.has(`dependencies`),labels:qt,getTaskHref:Xt,onChange:ln})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`p`,{className:`mb-2 text-xs text-fg-muted`,children:p.dependents}),v.dependents.length>0?(0,U.jsx)(`div`,{className:`space-y-1.5`,children:v.dependents.map(t=>(0,U.jsx)(V,{content:t.title,contentKey:`${e}:dependent:${t.id}`,language:d,previewHeight:72,className:`rounded-lg bg-surface-hover p-2.5`,children:(0,U.jsx)(o,{to:Xt(t.id),className:`block break-words [overflow-wrap:anywhere] text-sm text-fg-muted transition-colors hover:text-fg`,children:t.title})},t.id))}):(0,U.jsx)(`p`,{className:`text-sm text-fg-subtle`,children:p.noDependents})]})]})]})]}),v.task.phase===`closed`?null:(0,U.jsxs)(I,{variant:`ghost`,className:`my-3`,disabled:!Le,onClick:Fn,children:[(0,U.jsx)(T,{className:`size-4`}),Mn.length>0?d===`zh`?`管理执行时间`:`Manage schedule`:p.scheduleRecurringTask]}),(0,U.jsxs)(`details`,{className:`mb-4 rounded-xl border border-edge-subtle bg-surface-panel p-5 shadow-surface`,children:[(0,U.jsx)(`summary`,{className:`cursor-pointer text-sm font-semibold text-fg`,children:d===`zh`?`关联内容`:`Related work`}),$.length>0||v.runs.length>0||jn.length>0||v.dependencies.length>0||v.dependents.length>0?(0,U.jsxs)(`div`,{className:`mt-3 grid gap-3 sm:grid-cols-2`,children:[$.length>0?(0,U.jsxs)(`div`,{className:`rounded-lg bg-surface-hover p-3`,children:[(0,U.jsx)(`h3`,{className:`text-xs font-medium text-fg-muted`,children:d===`zh`?`对话 · ${$.length}`:`Conversations · ${$.length}`}),(0,U.jsx)(it,{contentKey:`${e}:sessions`,language:d,className:`mt-2`,children:$.map(t=>(0,U.jsx)(`li`,{children:(0,U.jsx)(o,{className:`block break-words [overflow-wrap:anywhere] text-sm text-accent hover:underline`,to:t.conversationId===Z?N(e):`/chat/${encodeURIComponent(t.conversationId)}`,children:t.conversationId===Z?d===`zh`?`当前执行对话`:`Current execution chat`:t.role===`discussion`?d===`zh`?`关联讨论`:`Linked discussion`:d===`zh`?`历史执行对话`:`Earlier execution chat`})},t.id))})]}):null,jn.length>0?(0,U.jsxs)(`div`,{className:`rounded-lg bg-surface-hover p-3`,children:[(0,U.jsx)(`h3`,{className:`text-xs font-medium text-fg-muted`,children:d===`zh`?`自动化 · ${jn.length}`:`Automations · ${jn.length}`}),(0,U.jsx)(it,{contentKey:`${e}:automations`,language:d,className:`mt-2`,children:jn.map(e=>(0,U.jsx)(`li`,{children:(0,U.jsx)(o,{className:`block break-words [overflow-wrap:anywhere] text-sm text-accent hover:underline`,to:`/automations?automation=${encodeURIComponent(e.id)}`,children:e.name})},e.id))})]}):null,v.dependencies.length>0||v.dependents.length>0?(0,U.jsxs)(`div`,{className:`rounded-lg bg-surface-hover p-3`,children:[(0,U.jsx)(`h3`,{className:`text-xs font-medium text-fg-muted`,children:p.taskRelations}),(0,U.jsx)(`p`,{className:`mt-2 text-sm text-fg`,children:d===`zh`?`${v.dependencies.length} 个前置任务 · ${v.dependents.length} 个后续任务`:`${v.dependencies.length} prerequisites · ${v.dependents.length} dependents`})]}):null]}):(0,U.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:d===`zh`?`还没有关联内容`:`No related work yet`}),(0,U.jsx)(`div`,{className:`mt-4 border-t border-edge-subtle pt-3`,children:(0,U.jsx)(qe,{resource:{kind:`task`,id:v.task.id,revision:String(v.task.version)},disabled:et||ct||z.size>0})})]}),An.length>0?(0,U.jsxs)(`section`,{className:F(`p-5`,Hn(`context`)&&`task-detail-live-update`),children:[(0,U.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:p.contextUsed}),(0,U.jsx)(`ul`,{className:`mt-4 grid gap-2 sm:grid-cols-2`,children:An.map(e=>(0,U.jsxs)(`li`,{className:`min-w-0 rounded-lg bg-surface-hover p-2.5`,children:[(0,U.jsxs)(`span`,{className:`text-[11px] text-fg-subtle`,children:[p.contextRoleLabels[e.role],` · `,p.contextKindLabels[e.targetKind]]}),e.targetKind===`url`&&/^https?:\/\//.test(e.targetId)?(0,U.jsx)(`a`,{className:`mt-1 block break-all text-sm text-accent hover:underline`,href:e.targetId,target:`_blank`,rel:`noreferrer`,children:e.title??e.targetId}):(0,U.jsx)(`p`,{className:`mt-1 break-words text-sm text-fg`,children:e.title??e.targetId})]},e.id))})]}):null]}),(0,U.jsxs)(`details`,{className:`rounded-xl border border-edge-subtle bg-surface-panel p-4`,children:[(0,U.jsx)(`summary`,{className:`cursor-pointer text-sm font-semibold text-fg`,children:d===`zh`?`活动记录与留言`:`Activity and updates`}),(0,U.jsxs)(`div`,{className:`mt-3 space-y-4`,children:[(0,U.jsx)(at,{taskId:e},e),(0,U.jsx)(Ye,{changes:v.phaseChanges,language:d})]})]})]})]}),(0,U.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":d===`zh`?`调整任务信息和 Agent 对话的宽度`:`Resize task details and Agent chat`,"aria-valuemin":30,"aria-valuemax":60,"aria-valuenow":Math.round(wt),tabIndex:0,onPointerDown:cn,onKeyDown:sn,onDoubleClick:()=>on(yt),className:`group hidden w-2 shrink-0 cursor-col-resize touch-none items-stretch justify-center bg-surface-panel outline-none transition-colors hover:bg-surface-hover focus-visible:bg-surface-hover lg:flex ${Et?`bg-surface-hover`:``}`,children:(0,U.jsx)(`div`,{className:`w-px bg-edge-strong/70 transition-colors group-hover:bg-accent group-focus-visible:bg-accent`})}),(0,U.jsxs)(`aside`,{className:`flex min-h-[34rem] min-w-0 shrink-0 flex-col border-t border-edge-subtle bg-surface-panel lg:min-h-0 lg:w-[var(--task-chat-panel-width)] lg:border-t-0`,children:[(0,U.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge-subtle px-4 py-3`,children:[(0,U.jsx)(`h2`,{className:`text-sm font-medium text-fg-muted`,children:d===`zh`?`执行对话`:`Execution chat`}),(0,U.jsxs)(`div`,{className:`flex items-center gap-1`,children:[$.length>1?(0,U.jsxs)(Me,{children:[(0,U.jsx)(Ne,{asChild:!0,children:(0,U.jsx)(I,{type:`button`,variant:`ghost`,className:`h-8 px-2 text-xs`,children:d===`zh`?`${$.length} 段对话`:`${$.length} conversations`})}),(0,U.jsx)(Pe,{children:(0,U.jsx)(Fe,{align:`end`,sideOffset:6,className:`z-[100] min-w-52 rounded-lg border border-edge bg-surface-overlay p-1 shadow-popover`,children:$.map(t=>(0,U.jsx)(L,{asChild:!0,children:(0,U.jsx)(o,{className:`block rounded-md px-3 py-2 text-sm text-fg outline-none hover:bg-surface-hover focus:bg-surface-hover`,to:t.conversationId===Z?N(e):`/chat/${encodeURIComponent(t.conversationId)}`,children:t.conversationId===Z?d===`zh`?`当前执行对话`:`Current execution chat`:t.role===`discussion`?d===`zh`?`关联讨论`:`Linked discussion`:d===`zh`?`历史执行对话`:`Earlier execution chat`})},t.id))})})]}):null,Z?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(I,{type:`button`,variant:`ghost`,className:F(`size-8 p-0`,En&&`bg-surface-hover text-fg`),"aria-label":d===`zh`?`项目文件`:`Project files`,"aria-pressed":En,onClick:()=>{Se.getState().openFiles(Z),_(Z)},children:(0,U.jsx)(j,{className:`size-4`,"aria-hidden":!0})}),(0,U.jsx)(I,{asChild:!0,variant:`ghost`,className:`size-8 p-0`,children:(0,U.jsx)(o,{to:N(e),"aria-label":d===`zh`?`全屏打开对话`:`Open chat full screen`,children:(0,U.jsx)(te,{className:`size-4`,"aria-hidden":!0})})})]}):null]})]}),Z?(0,U.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,U.jsx)(S,{embedded:!0,conversationId:Z,taskId:e})}):se?(0,U.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center p-8 text-center`,children:(0,U.jsxs)(`div`,{className:`max-w-xs`,children:[(0,U.jsx)(ie,{className:`mx-auto size-8 animate-pulse text-fg-subtle`}),(0,U.jsx)(`p`,{className:`mt-3 text-sm font-medium text-fg`,children:d===`zh`?`正在创建任务会话`:`Creating task conversation`})]})}):Oe?(0,U.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center p-8 text-center`,children:(0,U.jsxs)(`div`,{className:`max-w-xs`,children:[(0,U.jsx)(ie,{className:`mx-auto size-8 text-danger`}),(0,U.jsx)(`p`,{className:`mt-3 text-sm font-medium text-fg`,children:d===`zh`?`任务会话创建失败`:`Could not create task conversation`}),(0,U.jsx)(`p`,{className:`mt-2 text-xs leading-5 text-fg-muted`,children:Oe instanceof Error?Oe.message:String(Oe)})]})}):(0,U.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center p-8 text-center`,children:(0,U.jsxs)(`div`,{className:`max-w-xs`,children:[(0,U.jsx)(ie,{className:`mx-auto size-8 text-fg-subtle`}),(0,U.jsx)(`p`,{className:`mt-3 text-sm font-medium text-fg`,children:d===`zh`?`等待任务会话`:`Waiting for a task conversation`}),(0,U.jsx)(`p`,{className:`mt-2 text-xs leading-5 text-fg-muted`,children:d===`zh`?`安排或开始任务后,Agent 的执行过程和持续对话会显示在这里。`:`Schedule or start the task to see the agent run and continue the conversation here.`})]})})]})]}),Ht?(0,U.jsx)(Qe,{automation:Wt??void 0,taskId:e,taskTitle:v.task.title,projectId:v.task.projectId,executorAgentId:Q,language:d,onClose:()=>Ut(!1),onCreated:Nn},`${e}:${Wt?.id??`new`}`):null,(0,U.jsx)(je,{open:Bt,title:p.deleteTaskTitle,description:p.deleteTaskDescription.replace(`{{title}}`,v.task.title),confirmLabel:p.confirmDeleteTask,cancelLabel:p.keepTask,destructive:!0,onConfirm:()=>{Vt(!1),dn()},onCancel:()=>Vt(!1)})]})}function Et(){let e=(0,H.c)(2),{taskId:t}=i(),n=t===void 0?``:t,r;return e[0]===n?r=e[1]:(r=(0,U.jsx)(Tt,{taskId:n,presentation:`page`}),e[0]=n,e[1]=r),r}function Dt(e){let t=(0,H.c)(41),{taskId:n,backgroundPath:r,workspacePanelWidth:i,onClose:a}=e,o=i===void 0?0:i,s=u(jt),c=Oe(At),l=o>0,d;t[0]!==a||t[1]!==c?(d=e=>{e||(c(null),a())},t[0]=a,t[1]=c,t[2]=d):d=t[2];let f=s===`zh`?`关闭任务详情`:`Close task details`,p;t[3]!==a||t[4]!==c?(p=()=>{c(null),a()},t[3]=a,t[4]=c,t[5]=p):p=t[5];let b;t[6]!==f||t[7]!==p?(b=(0,U.jsx)(`button`,{type:`button`,tabIndex:-1,"data-task-modal-backdrop":!0,className:`fixed inset-0 z-[80] bg-black/45`,"aria-label":f,onClick:p}),t[6]=f,t[7]=p,t[8]=b):b=t[8];let x=l?`true`:`false`,S=`${o/2}px`,C=`${o}px`,w;t[9]!==S||t[10]!==C?(w={"--task-detail-workspace-offset":S,"--task-detail-workspace-width":C},t[9]=S,t[10]=C,t[11]=w):w=t[11];let T=w,E=s===`zh`?`任务详情`:`Task details`,D;t[12]===E?D=t[13]:(D=(0,U.jsx)(v,{className:`font-medium text-fg`,children:E}),t[12]=E,t[13]=D);let O=s===`zh`?`查看并操作任务详情`:`View and manage task details`,k;t[14]===O?k=t[15]:(k=(0,U.jsx)(m,{className:`sr-only`,children:O}),t[14]=O,t[15]=k);let A=s===`zh`?`关闭任务详情`:`Close task details`,ee;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,U.jsx)(se,{className:`size-4`,"aria-hidden":!0}),t[16]=ee):ee=t[16];let te;t[17]===A?te=t[18]:(te=(0,U.jsx)(`div`,{className:`flex shrink-0 items-center gap-1`,children:(0,U.jsx)(h,{className:`flex size-8 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg`,"aria-label":A,children:ee})}),t[17]=A,t[18]=te);let ne;t[19]!==D||t[20]!==k||t[21]!==te?(ne=(0,U.jsxs)(`header`,{className:`flex shrink-0 items-center justify-between gap-3 bg-surface-panel px-5 py-3.5`,children:[D,k,te]}),t[19]=D,t[20]=k,t[21]=te,t[22]=ne):ne=t[22];let j;t[23]!==a||t[24]!==c?(j=()=>{c(null),a()},t[23]=a,t[24]=c,t[25]=j):j=t[25];let M;t[26]!==r||t[27]!==j||t[28]!==n?(M=(0,U.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:(0,U.jsx)(Tt,{taskId:n,presentation:`modal`,backgroundPath:r,onDeleted:j})}),t[26]=r,t[27]=j,t[28]=n,t[29]=M):M=t[29];let N;t[30]!==T||t[31]!==ne||t[32]!==M||t[33]!==x?(N=(0,U.jsxs)(_,{className:`xopc-dialog-content task-detail-modal-content fixed top-1/2 z-[90] flex h-[min(54rem,calc(100dvh-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay focus:outline-none`,"data-workspace-panel-open":x,style:T,onEscapeKeyDown:kt,onInteractOutside:Ot,children:[ne,M]}),t[30]=T,t[31]=ne,t[32]=M,t[33]=x,t[34]=N):N=t[34];let P;t[35]!==N||t[36]!==b?(P=(0,U.jsxs)(g,{children:[b,N]}),t[35]=N,t[36]=b,t[37]=P):P=t[37];let re;return t[38]!==d||t[39]!==P?(re=(0,U.jsx)(y,{modal:!1,open:!0,onOpenChange:d,children:P}),t[38]=d,t[39]=P,t[40]=re):re=t[40],re}function Ot(e){let t=e.detail.originalEvent.target;t instanceof Element&&t.closest(`#app-workspace-panel, [data-task-modal-backdrop]`)&&e.preventDefault()}function kt(e){let t=e.target;t instanceof HTMLElement&&t.closest(`[data-task-inline-editor]`)&&e.preventDefault()}function At(e){return e.setPath}function jt(e){return e.language}function Mt(e){return(0,U.jsx)(D,{value:e.id,children:e.name||e.id},e.id)}function Nt(e){return e.id}export{Dt as TaskDetailModal,Et as TaskDetailPage};
|
|
@@ -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-Br7IfbXK.js";import{a as u,c as d,i as f,n as p,o as m,r as h,s as g,t as _}from"./dist-BGTk37IG.js";import{t as v}from"./book-open-CCGtrT3R.js";import{t as y}from"./bot-DjLkhyZL.js";import{C as b,S as x,_ as S,a as C,b as w,c as T,d as E,f as D,g as O,h as k,i as A,l as j,m as M,n as N,o as P,p as F,r as I,s as L,t as R,v as z,x as B,y as V}from"./understanding-refresh-store-BvCj9-Ue.js";import{t as H}from"./briefcase-business-BsoCaI_t.js";import{t as ee}from"./calendar-days-hw_Y-g-s.js";import{t as te}from"./check-DUBLcKHA.js";import{t as U}from"./chevron-down-ccbiQQz_.js";import{t as W}from"./chevron-right-BweFrslA.js";import{n as G,r as K,t as q}from"./popover-select-CEMWIrtY.js";import{t as ne}from"./circle-alert-BEjgurr2.js";import{t as J}from"./circle-check-C23XjkUj.js";import{t as re}from"./clock-3-DnrAnuyZ.js";import{t as ie}from"./database-CjjeZfRG.js";import{t as ae}from"./download-Dk-ZjtO6.js";import{t as oe}from"./earth-BMhZtzcj.js";import{t as se}from"./ellipsis-0k4rZLoy.js";import{m as ce,p as le,t as ue}from"./understanding-activity-store-C4bblRnQ.js";import{t as de}from"./folder-open-CyzJ19I9.js";import{t as fe}from"./git-branch-Dh9uxTot.js";import{t as pe}from"./list-todo-CTVRto8O.js";import{t as me}from"./loader-circle-CifKLtgG.js";import{t as he}from"./lock-keyhole-DEK5kH0u.js";import{t as ge}from"./message-circle-Badhj-4D.js";import{t as _e}from"./pencil-DmIY3Oa-.js";import{t as ve}from"./plus-Q2yW6OE7.js";import{t as ye}from"./refresh-cw-BRlGaq2w.js";import{t as be}from"./search-DA7gz22f.js";import{t as xe}from"./shield-check-BU58siTV.js";import{t as Se}from"./sliders-horizontal-DqsYor6I.js";import{t as Ce}from"./sparkles-DHlfQFAF.js";import{t as we}from"./sticky-note-fzP7NAJq.js";import{t as Te}from"./trash-2-DusmjVPV.js";import{t as Ee}from"./upload-rrb46c3c.js";import{t as De}from"./user-round-C9jxPhMR.js";import{t as Oe}from"./x-B_N4OPjy.js";import{t as ke}from"./cn-0WouolD0.js";import{t as Ae}from"./skeleton-BI5TyibZ.js";import{i as je}from"./vendor-swr-CdRzEUwF.js";import{t as Y}from"./button-Cc4hUNTt.js";import{r as Me}from"./app-chrome-BeB4KgOf.js";import{t as Ne}from"./page-tabs-oeTY7z3_.js";import{t as Pe}from"./page-header-store-Du44NIEJ.js";import{t as Fe}from"./loopi-CNtmi9FU.js";import{t as Ie}from"./sliding-tab-list-DuQyViqe.js";import{l as Le,m as Re,o as ze,r as Be,t as Ve}from"./dist-ZrL34Ps4.js";import{t as He}from"./date-picker-BIfjfOTM.js";var X=e(t(),1),Z=n(),Q=r();function Ue(e){let t=(0,Z.c)(15),{sourceId:n,disabled:r}=e,i=r!==void 0&&r,a=c(Ke)===`zh`,{sources:o,starting:s,start:l}=R(),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(Ge),t[3]=d,t[4]=f);let p=f,m=n&&d.some(We),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,Q.jsx)(me,{className:`size-3.5 animate-spin motion-reduce:animate-none`}):(0,Q.jsx)(ye,{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,Q.jsxs)(Y,{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 We(e){return e.status===`failed`||e.status===`partial`||e.status===`canceled`}function Ge(e){return e.status===`queued`||e.status===`running`}function Ke(e){return e.language}function qe(e){let t=(0,Z.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=R(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,Q.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,Q.jsx)(`p`,{children:m}),t[10]=m,t[11]=h);let g;t[12]!==i||t[13]!==s.completedAt?(g=s.completedAt?(0,Q.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,Q.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,Q.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,Z.c)(64),{language:n,busy:r,statement:i,scope:a,onEdit:o,onDelete:s,onScopeChange:c}=e,[l,d]=(0,X.useState)(!1),[v,b]=(0,X.useState)(!1),x=n===`zh`,S=x?`修改或删除这条内容`:`Edit or delete this item`,C;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Q.jsx)(se,{className:`size-4`,"aria-hidden":`true`}),t[0]=C):C=t[0];let w;t[1]!==r||t[2]!==S?(w=(0,Q.jsx)(Re,{asChild:!0,children:(0,Q.jsx)(Y,{variant:`ghost`,className:`size-11 shrink-0 p-0`,disabled:r,"aria-label":S,children:C})}),t[1]=r,t[2]=S,t[3]=w):w=t[3];let T;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,Q.jsx)(_e,{className:`size-4`,"aria-hidden":`true`}),t[4]=T):T=t[4];let E=x?`修改`:`Edit`,D;t[5]!==r||t[6]!==o||t[7]!==E?(D=(0,Q.jsxs)(Be,{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:[T,E]}),t[5]=r,t[6]=o,t[7]=E,t[8]=D):D=t[8];let O;t[9]!==r||t[10]!==c||t[11]!==a||t[12]!==x?(O=a&&c?(0,Q.jsxs)(Be,{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:()=>b(!0),children:[(0,Q.jsx)(Se,{className:`size-4`,"aria-hidden":`true`}),x?`作用范围`:`Where it applies`]}):null,t[9]=r,t[10]=c,t[11]=a,t[12]=x,t[13]=O):O=t[13];let k,A;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(k=()=>d(!0),A=(0,Q.jsx)(Te,{className:`size-4`,"aria-hidden":`true`}),t[14]=k,t[15]=A):(k=t[14],A=t[15]);let j=x?`删除`:`Delete`,M;t[16]!==r||t[17]!==j?(M=(0,Q.jsxs)(Be,{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:k,children:[A,j]}),t[16]=r,t[17]=j,t[18]=M):M=t[18];let N;t[19]!==M||t[20]!==D||t[21]!==O?(N=(0,Q.jsx)(ze,{children:(0,Q.jsxs)(Ve,{align:`end`,sideOffset:4,className:`z-[100] min-w-36 rounded-xl border border-edge bg-surface-overlay p-1 shadow-popover`,children:[D,O,M]})}),t[19]=M,t[20]=D,t[21]=O,t[22]=N):N=t[22];let P;t[23]!==N||t[24]!==w?(P=(0,Q.jsxs)(Le,{modal:!1,children:[w,N]}),t[23]=N,t[24]=w,t[25]=P):P=t[25];let F;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,Q.jsx)(u,{className:`fixed inset-0 z-[110] bg-scrim`}),t[26]=F):F=t[26];let I=x?`删除这条内容?`:`Delete this item?`,L;t[27]===I?L=t[28]:(L=(0,Q.jsx)(g,{className:`font-semibold text-fg`,children:I}),t[27]=I,t[28]=L);let R=x?`删除后将不再使用这条记忆,原始对话和文件会保留。`:`This memory will no longer be used. Original conversations and files are kept.`,z;t[29]===R?z=t[30]:(z=(0,Q.jsx)(f,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:R}),t[29]=R,t[30]=z);let B;t[31]!==L||t[32]!==z?(B=(0,Q.jsxs)(`header`,{className:`shrink-0 border-b border-edge px-5 py-4`,children:[L,z]}),t[31]=L,t[32]=z,t[33]=B):B=t[33];let V;t[34]===i?V=t[35]:(V=(0,Q.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]=V);let H=x?`取消`:`Cancel`,ee;t[36]===H?ee=t[37]:(ee=(0,Q.jsx)(p,{asChild:!0,children:(0,Q.jsx)(Y,{variant:`ghost`,children:H})}),t[36]=H,t[37]=ee);let te;t[38]===s?te=t[39]:(te=()=>{d(!1),s()},t[38]=s,t[39]=te);let U=x?`删除`:`Delete`,W;t[40]!==r||t[41]!==te||t[42]!==U?(W=(0,Q.jsx)(Y,{disabled:r,onClick:te,children:U}),t[40]=r,t[41]=te,t[42]=U,t[43]=W):W=t[43];let G;t[44]!==ee||t[45]!==W?(G=(0,Q.jsxs)(`footer`,{className:`flex shrink-0 justify-end gap-2 border-t border-edge px-5 py-3`,children:[ee,W]}),t[44]=ee,t[45]=W,t[46]=G):G=t[46];let K;t[47]!==B||t[48]!==V||t[49]!==G?(K=(0,Q.jsxs)(m,{children:[F,(0,Q.jsxs)(h,{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:[B,V,G]})]}),t[47]=B,t[48]=V,t[49]=G,t[50]=K):K=t[50];let q;t[51]!==l||t[52]!==P||t[53]!==K?(q=(0,Q.jsxs)(_,{open:l,onOpenChange:d,children:[P,K]}),t[51]=l,t[52]=P,t[53]=K,t[54]=q):q=t[54];let ne;t[55]!==r||t[56]!==c||t[57]!==a||t[58]!==v||t[59]!==x?(ne=a&&c?(0,Q.jsx)(_,{open:v,onOpenChange:b,children:(0,Q.jsxs)(m,{children:[(0,Q.jsx)(u,{className:`fixed inset-0 z-[110] bg-scrim`}),(0,Q.jsxs)(h,{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,Q.jsxs)(`header`,{className:`shrink-0 border-b border-edge px-5 py-4`,children:[(0,Q.jsx)(g,{className:`font-semibold text-fg`,children:x?`这条记忆在哪里生效?`:`Where should this memory apply?`}),(0,Q.jsx)(f,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:x?`你可以让它用于所有协作,或只用于当前助手。`:`Use it across all work, or keep it only for this assistant.`})]}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 space-y-2 overflow-y-auto p-4`,children:[{value:{type:`global`},icon:oe,title:x?`所有协作`:`All work`,detail:x?`任何助手和对话都可按需使用`:`Available when relevant in any assistant or conversation`},{value:{type:`agent`,id:a.type===`agent`?a.id??`main`:`main`},icon:y,title:x?`仅当前助手`:`This assistant only`,detail:x?`不会分享给其他助手`:`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,Q.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:()=>{b(!1),c(t)},children:[(0,Q.jsx)(n,{className:`size-5 shrink-0 text-fg-muted`,"aria-hidden":`true`}),(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:i}),(0,Q.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-fg-muted`,children:o})]}),s?(0,Q.jsx)(`span`,{className:`text-xs font-medium text-accent-fg`,children:x?`当前`:`Current`}):null]},t.type)})}),(0,Q.jsx)(`footer`,{className:`flex shrink-0 justify-end border-t border-edge px-5 py-3`,children:(0,Q.jsx)(p,{asChild:!0,children:(0,Q.jsx)(Y,{variant:`ghost`,children:x?`取消`:`Cancel`})})})]})]})}):null,t[55]=r,t[56]=c,t[57]=a,t[58]=v,t[59]=x,t[60]=ne):ne=t[60];let J;return t[61]!==q||t[62]!==ne?(J=(0,Q.jsxs)(Q.Fragment,{children:[q,ne]}),t[61]=q,t[62]=ne,t[63]=J):J=t[63],J}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,Z.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,X.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,Q.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,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsx)(`label`,{className:`text-sm font-medium text-fg`,htmlFor:p,children:m?`修改这条理解`:`Edit this understanding`}),(0,Q.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,Q.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,Q.jsx)(Y,{variant:`ghost`,disabled:i,onClick:l,children:m?`取消`:`Cancel`}),(0,Q.jsx)(Y,{variant:`primary`,disabled:!o.trim()||i,onClick:d,children:i?m?`保存中…`:`Saving…`:m?`保存修改`:`Save changes`})]})]}):(0,Q.jsxs)(`div`,{className:`flex items-start gap-2 sm:gap-4`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1 pt-1.5`,children:[(0,Q.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-base leading-7 text-fg`,children:n.statement}),(0,Q.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,Q.jsx)(`span`,{children:Qe(n,r)}),n.usable===!1?(0,Q.jsx)(`span`,{children:m?`暂不使用`:`Not in use`}):null,n.validTo?(0,Q.jsx)(`span`,{children:$e(n,r)}):null,n.authority!==`user_explicit`&&n.confidence<.65?(0,Q.jsx)(`span`,{children:g}):null,(0,Q.jsxs)(`details`,{className:`open:basis-full`,children:[(0,Q.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,Q.jsxs)(`div`,{className:`my-2 space-y-1 border-l-2 border-edge pl-3 text-sm leading-6`,children:[(0,Q.jsx)(`p`,{children:n.usable?m?`按需用于当前协作`:`Used when relevant`:m?`暂不使用,后台继续复核`:`Not in use; reviewed automatically`}),(0,Q.jsxs)(`p`,{children:[$e(n,r),` · `,tt(n.scope,r),g?` · ${g}`:``]}),(0,Q.jsxs)(`p`,{children:[m?`最近观察:`:`Last observed: `,Xe(n.observedAt,r)]}),(0,Q.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,Q.jsx)(`p`,{children:m?`暂无更详细的来源记录`:`No further source details available`}),(0,Q.jsx)(Y,{variant:`ghost`,className:`-ml-2 px-2`,disabled:i,onClick:c,children:b})]})]})]})]}),(0,Q.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,Q.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:De,conversation:ge,connector:ie,work_folder:de,local_source:ce,inference:ie},st={files:de,recent_documents:ce,calendar:ee,tasks:pe,notes:we,mail:le,messages:ge,code_activity:fe};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,Z.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,X.useState)(!1),[p,m]=(0,X.useState)(null),[h,g]=(0,X.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,Q.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,Q.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,Q.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,Q.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,Q.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,Q.jsx)(me,{className:`size-4 shrink-0 animate-spin motion-reduce:animate-none`}),(0,Q.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,Q.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,Q.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,Q.jsxs)(`div`,{className:`mt-3`,children:[Ze(e,a).map(e=>{let{label:t,items:n}=e;return(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`border-b border-edge-subtle px-4 pb-2 pt-3 text-xs font-medium text-fg-muted`,children:t}),(0,Q.jsx)(`div`,{children:n.map(e=>(0,Q.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,Q.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,Q.jsx)(U,{className:ke(`size-3.5 transition-transform`,d&&`rotate-180`)})]}):null]}):(0,Q.jsxs)(`div`,{className:`mt-3 flex items-start gap-3 rounded-xl border border-edge bg-surface-base/55 p-4`,children:[(0,Q.jsx)(J,{className:`mt-0.5 size-5 shrink-0 text-success`}),(0,Q.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,Q.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,Q.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 I;t[63]===u.channelHint?I=t[64]:(I=(0,Q.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:u.channelHint}),t[63]=u.channelHint,t[64]=I);let L;t[65]!==S||t[66]!==u.activeCount||t[67]!==u.noChannels||t[68]!==u.noUnderstanding||t[69]!==u.pendingCount?(L=S.length?(0,Q.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,Q.jsxs)(`article`,{className:`rounded-xl border border-edge bg-surface-base/55 px-4 py-4`,children:[(0,Q.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Q.jsx)(`div`,{className:`flex size-9 shrink-0 items-center justify-center rounded-xl bg-surface-hover text-fg-muted`,children:(0,Q.jsx)(t,{className:`size-4`})}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`h4`,{className:`truncate text-sm font-medium text-fg`,children:e.label}),e.grantId?(0,Q.jsx)(qe,{sourceId:e.grantId,lastCollectedAt:e.lastObservedAt}):null,e.assertions.length?(0,Q.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,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:u.noUnderstanding})]}),e.grantId?(0,Q.jsx)(Ue,{sourceId:e.grantId}):null]}),e.assertions.length?(0,Q.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,Q.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]=L):L=t[70];let R;t[71]!==F||t[72]!==I||t[73]!==L?(R=(0,Q.jsxs)(`details`,{className:`mt-6 border-t border-edge pt-4`,children:[F,I,L]}),t[71]=F,t[72]=I,t[73]=L,t[74]=R):R=t[74];let z;t[75]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,Q.jsx)(te,{className:`size-4`}),t[75]=z):z=t[75];let B;t[76]!==o||t[77]!==l||t[78]!==u.done?(B=(0,Q.jsx)(`div`,{className:`mt-6 flex justify-end`,children:(0,Q.jsxs)(Y,{variant:`primary`,disabled:o,onClick:l,children:[z,u.done]})}),t[76]=o,t[77]=l,t[78]=u.done,t[79]=B):B=t[79];let V;t[80]===s?V=t[81]:(V=s?(0,Q.jsx)(`p`,{className:`mt-5 text-sm text-danger`,role:`alert`,children:s}):null,t[80]=s,t[81]=V);let H;return t[82]!==T||t[83]!==E||t[84]!==D||t[85]!==O||t[86]!==P||t[87]!==R||t[88]!==B||t[89]!==V?(H=(0,Q.jsxs)(`section`,{className:T,"aria-live":E,children:[D,O,P,R,B,V]}),t[82]=T,t[83]=E,t[84]=D,t[85]=O,t[86]=P,t[87]=R,t[88]=B,t[89]=V,t[90]=H):H=t[90],H}function ft(e){return(0,Q.jsxs)(`li`,{className:`flex gap-2`,children:[(0,Q.jsx)(`span`,{className:`mt-2 size-1 shrink-0 rounded-full bg-accent/60`}),(0,Q.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=ue(),[a,o]=(0,X.useState)(!1),[s,l]=(0,X.useState)(null),v=e===`/user-model`,{data:y,mutate:b}=je(v?`/api/user-model`:null,j),x=R(e=>e.error),S=R(e=>e.sources.some(e=>e.status===`running`||e.status===`queued`)),w=n===`zh`;if((0,X.useEffect)(()=>{v&&new URLSearchParams(t).get(`workDiscovery`)===`review`&&ue.getState().setDrawerOpen(!0)},[v,t]),(0,X.useEffect)(()=>{v&&r.status!==`running`&&b()},[b,v,r.directoryRun?.id,r.status]),!v)return null;let T=r.status===`running`||S,E=async(e,t,n)=>{o(!0),l(null);try{return t===`edited`&&n?await N(e.id,n):t===`deleted`&&await C(e.id),await b(),!0}catch(e){return l(e instanceof Error?e.message:String(e)),!1}finally{o(!1)}},D=e=>{if(!e&&y&&r.status!==`running`){r.finish();return}r.setDrawerOpen(e)};return(0,Q.jsxs)(_,{open:r.drawerOpen,onOpenChange:D,children:[(0,Q.jsx)(d,{asChild:!0,children:(0,Q.jsx)(Y,{type:`button`,variant:`ghost`,className:ke(`relative size-8 rounded-xl p-0`,Me),title:w?`查看 xopc 对你的理解`:`Review what xopc understands`,"aria-label":w?`查看 xopc 对你的理解`:`Review what xopc understands`,children:T?(0,Q.jsx)(me,{className:`size-4 animate-spin motion-reduce:animate-none`}):(0,Q.jsx)(Ce,{className:`size-4 text-accent-fg`})})}),(0,Q.jsxs)(m,{children:[(0,Q.jsx)(u,{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,Q.jsx)(`div`,{className:`pointer-events-none fixed inset-0 z-[61] flex items-center justify-center p-3 sm:p-6`,children:(0,Q.jsxs)(h,{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,Q.jsxs)(`header`,{className:`flex h-16 shrink-0 items-center justify-between border-b border-edge-subtle px-5 sm:px-6`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(g,{className:`text-sm font-semibold text-fg`,children:T?w?`正在更新用户理解`:`Updating user understanding`:w?`用户理解`:`User understanding`}),(0,Q.jsx)(f,{className:`mt-0.5 text-xs text-fg-muted`,children:T?w?`关闭窗口也会在后台继续`:`You can close this window; work continues in the background`:w?`自动更新,可随时修改或删除`:`Updated automatically. Edit or delete anytime`})]}),(0,Q.jsx)(Ue,{disabled:!y?.sources?.length}),(0,Q.jsx)(p,{asChild:!0,children:(0,Q.jsx)(Y,{variant:`ghost`,className:`size-8 rounded-xl p-0`,"aria-label":w?`关闭`:`Close`,children:(0,Q.jsx)(Oe,{className:`size-4`})})})]}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-5 py-7 sm:px-9 sm:py-9`,children:y?(0,Q.jsx)(dt,{assertions:y.assertions,configuredSources:y.sources??[],activityRunning:T,language:n,busy:a,error:s??x??null,onReviewAssertion:E,onCompleted:()=>{D(!1)}}):(0,Q.jsxs)(`section`,{className:`space-y-4`,"aria-label":w?`正在加载用户理解`:`Loading user understanding`,children:[(0,Q.jsx)(Ae,{className:`h-8 w-2/3`}),(0,Q.jsx)(Ae,{className:`h-32 w-full`}),(0,Q.jsx)(Ae,{className:`h-32 w-full`})]})})]})})]})]})}function bt(e){let t=(0,Z.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}=je(`memory-learning-status`,jt,r);if(o){let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(Ae,{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,Q.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,Q.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,Q.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,Q.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,Q.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,Q.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,Q.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,Z.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}=je(`knowledge-evidence:${n}`,i);if(c){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(Ae,{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,Q.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,Q.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,Q.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,Q.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,Z.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,Q.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,Q.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,Q.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,Q.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,Q.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,Q.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,Z.c)(7),{icon:n,children:r}=e,i;t[0]===n?i=t[1]:(i=(0,Q.jsx)(`span`,{className:`text-fg-subtle`,children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=(0,Q.jsx)(`p`,{children:r}),t[2]=r,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,Q.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,X.useState)(t),[l,d]=(0,X.useState)(``);(0,X.useEffect)(()=>{e&&(c(t),d(``))},[e,t]);let v=e=>{e.preventDefault(),a({callName:s.callName.trim(),role:s.role.trim(),pronouns:s.pronouns.trim(),timezone:s.timezone.trim(),locale:s.locale.trim()})},y=(e,t,n)=>(0,Q.jsxs)(`label`,{className:`grid gap-1.5 text-sm`,children:[(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:t}),(0,Q.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`})]}),b=[`zh-CN`,`zh-TW`,`en-US`,`en-GB`,`ja-JP`];s.locale&&!b.includes(s.locale)&&b.push(s.locale);let x=L(),S=(0,X.useMemo)(()=>[...new Set([...zt,x,s.timezone].filter(Boolean))].sort(),[x,s.timezone]),C=l.trim().toLocaleLowerCase(),w=(0,X.useMemo)(()=>Bt(S.filter(e=>!C||e.toLocaleLowerCase().includes(C)||e.replaceAll(`_`,` `).toLocaleLowerCase().includes(C))),[S,C]);return(0,Q.jsx)(_,{open:e,onOpenChange:i,children:(0,Q.jsxs)(m,{children:[(0,Q.jsx)(u,{className:`xopc-dialog-overlay fixed inset-0 z-[80] bg-scrim backdrop-blur-[2px]`}),(0,Q.jsx)(h,{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,Q.jsxs)(`form`,{className:`flex h-full min-h-0 flex-col overflow-hidden [border-radius:inherit]`,onSubmit:v,children:[(0,Q.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,Q.jsxs)(`div`,{children:[(0,Q.jsx)(g,{className:`font-semibold text-fg`,children:o.editProfile}),(0,Q.jsx)(f,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:o.editProfileHint})]}),(0,Q.jsx)(p,{asChild:!0,children:(0,Q.jsx)(Y,{variant:`ghost`,className:`size-8 shrink-0 p-0`,"aria-label":o.cancel,children:(0,Q.jsx)(Oe,{className:`size-4`})})})]}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5 sm:p-6`,children:(0,Q.jsxs)(`div`,{className:`grid gap-5 sm:grid-cols-2`,children:[y(`callName`,o.callName,o.callNamePlaceholder),y(`role`,o.role,o.rolePlaceholder),y(`pronouns`,o.pronouns,o.pronounsPlaceholder),(0,Q.jsxs)(`label`,{className:`grid gap-1.5 text-sm`,children:[(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:o.locale}),(0,Q.jsxs)(G,{value:s.locale,onChange:e=>c(t=>({...t,locale:e.target.value})),children:[(0,Q.jsx)(K,{value:``,children:o.notProvided}),b.map(e=>(0,Q.jsx)(K,{value:e,children:Wt(e,n)},e))]})]}),(0,Q.jsxs)(`label`,{className:`grid gap-1.5 text-sm sm:col-span-2`,children:[(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:o.timezone}),(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Q.jsx)(q,{value:s.timezone,options:w,placeholder:L(),emptyLabel:o.notProvided,ariaLabel:o.timezone,selectedLabel:s.timezone||o.notProvided,searchPlaceholder:o.timezoneSearch,searchValue:l,onSearchChange:d,statusMessage:w.length?void 0:o.timezoneNoMatch,triggerClassName:`min-w-0 flex-1 rounded-xl bg-surface-base`,onChange:e=>{c(t=>({...t,timezone:e})),d(``)}}),(0,Q.jsx)(Y,{className:`shrink-0 whitespace-nowrap`,onClick:()=>c(e=>({...e,timezone:x})),children:o.useDeviceTimezone})]})]})]})}),(0,Q.jsxs)(`footer`,{className:`flex shrink-0 justify-end gap-2 border-t border-edge px-5 py-3 sm:px-6`,children:[(0,Q.jsx)(p,{asChild:!0,children:(0,Q.jsx)(Y,{disabled:r,children:o.cancel})}),(0,Q.jsxs)(Y,{type:`submit`,variant:`primary`,disabled:r,children:[r?(0,Q.jsx)(me,{className:`size-4 animate-spin`}):null,r?o.saving:o.saveProfile]})]})]})})]})})}function en(e){let t=(0,Z.c)(94),{open:n,priority:r,title:i,outcome:a,language:o,saving:s,onOpenChange:c,onSave:l,onEnd:d}=e,v=Pt[o],[y,b]=(0,X.useState)(i),[x,S]=(0,X.useState)(a??``),C=r?.validTo??Date.now()+6048e5,w;t[0]===C?w=t[1]:(w=Kt(C),t[0]=C,t[1]=w);let T=w,[E,D]=(0,X.useState)(T),O,k;t[2]!==T||t[3]!==n||t[4]!==a||t[5]!==i?(O=()=>{n&&(b(i),S(a??``),D(T))},k=[T,n,a,i],t[2]=T,t[3]=n,t[4]=a,t[5]=i,t[6]=O,t[7]=k):(O=t[6],k=t[7]),(0,X.useEffect)(O,k);let A;t[8]!==x||t[9]!==y||t[10]!==E||t[11]!==l||t[12]!==r?.targetType?(A=e=>{e.preventDefault(),l({title:y.trim(),...r?.targetType===`goal`?{desiredOutcome:x.trim()}:{},validTo:qt(E)})},t[8]=x,t[9]=y,t[10]=E,t[11]=l,t[12]=r?.targetType,t[13]=A):A=t[13];let j=A,M;t[14]!==x||t[15]!==y||t[16]!==E||t[17]!==r?.targetType?(M=y.trim()&&E&&(r?.targetType!==`goal`||x.trim()),t[14]=x,t[15]=y,t[16]=E,t[17]=r?.targetType,t[18]=M):M=t[18];let N=!!M,P;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,Q.jsx)(u,{className:`xopc-dialog-overlay fixed inset-0 z-[80] bg-scrim backdrop-blur-[2px]`}),t[19]=P):P=t[19];let F=r?v.editPriority:v.addPriority,I;t[20]===F?I=t[21]:(I=(0,Q.jsx)(g,{className:`font-semibold text-fg`,children:F}),t[20]=F,t[21]=I);let L;t[22]===v.priorityHint?L=t[23]:(L=(0,Q.jsx)(f,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:v.priorityHint}),t[22]=v.priorityHint,t[23]=L);let R;t[24]!==L||t[25]!==I?(R=(0,Q.jsxs)(`div`,{children:[I,L]}),t[24]=L,t[25]=I,t[26]=R):R=t[26];let z;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,Q.jsx)(Oe,{className:`size-4`}),t[27]=z):z=t[27];let B;t[28]===v.cancel?B=t[29]:(B=(0,Q.jsx)(p,{asChild:!0,children:(0,Q.jsx)(Y,{variant:`ghost`,className:`size-8 shrink-0 p-0`,"aria-label":v.cancel,children:z})}),t[28]=v.cancel,t[29]=B);let V;t[30]!==R||t[31]!==B?(V=(0,Q.jsxs)(`header`,{className:`flex shrink-0 items-start justify-between gap-4 border-b border-edge px-5 py-4 sm:px-6`,children:[R,B]}),t[30]=R,t[31]=B,t[32]=V):V=t[32];let H;t[33]===v.priorityTitle?H=t[34]:(H=(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:v.priorityTitle}),t[33]=v.priorityTitle,t[34]=H);let ee;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(ee=e=>b(e.target.value),t[35]=ee):ee=t[35];let te;t[36]!==y||t[37]!==v.priorityTitlePlaceholder?(te=(0,Q.jsx)(`input`,{autoFocus:!0,value:y,onChange:ee,placeholder:v.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]=y,t[37]=v.priorityTitlePlaceholder,t[38]=te):te=t[38];let U;t[39]!==H||t[40]!==te?(U=(0,Q.jsxs)(`label`,{className:`grid gap-1.5 text-sm`,children:[H,te]}),t[39]=H,t[40]=te,t[41]=U):U=t[41];let W;t[42]!==x||t[43]!==r?.targetType||t[44]!==v.priorityOutcome||t[45]!==v.priorityOutcomePlaceholder?(W=r?.targetType===`goal`?(0,Q.jsxs)(`label`,{className:`grid gap-1.5 text-sm`,children:[(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:v.priorityOutcome}),(0,Q.jsx)(`textarea`,{value:x,onChange:e=>S(e.target.value),placeholder:v.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]=x,t[43]=r?.targetType,t[44]=v.priorityOutcome,t[45]=v.priorityOutcomePlaceholder,t[46]=W):W=t[46];let G;t[47]===v.priorityUntil?G=t[48]:(G=(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:v.priorityUntil}),t[47]=v.priorityUntil,t[48]=G);let K;t[49]===r?.validFrom?K=t[50]:(K=r?.validFrom??Date.now(),t[49]=r?.validFrom,t[50]=K);let q;t[51]===K?q=t[52]:(q=Kt(K),t[51]=K,t[52]=q);let ne;t[53]!==E||t[54]!==v.priorityUntil||t[55]!==q?(ne=(0,Q.jsx)(He,{min:q,value:E,onChange:D,ariaLabel:v.priorityUntil,className:`rounded-xl border border-edge bg-surface-base hover:border-edge-strong hover:bg-surface-base`}),t[53]=E,t[54]=v.priorityUntil,t[55]=q,t[56]=ne):ne=t[56];let J;t[57]!==G||t[58]!==ne?(J=(0,Q.jsxs)(`label`,{className:`grid gap-1.5 text-sm`,children:[G,ne]}),t[57]=G,t[58]=ne,t[59]=J):J=t[59];let re;t[60]!==U||t[61]!==W||t[62]!==J?(re=(0,Q.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-5 overflow-y-auto p-5 sm:p-6`,children:[U,W,J]}),t[60]=U,t[61]=W,t[62]=J,t[63]=re):re=t[63];let ie;t[64]!==d||t[65]!==r||t[66]!==s||t[67]!==v.endPriority||t[68]!==v.endingPriority?(ie=r&&d?(0,Q.jsxs)(Y,{variant:`ghost`,className:`text-danger hover:text-danger`,disabled:s,onClick:d,children:[s?(0,Q.jsx)(me,{className:`size-4 animate-spin`}):null,s?v.endingPriority:v.endPriority]}):(0,Q.jsx)(`span`,{}),t[64]=d,t[65]=r,t[66]=s,t[67]=v.endPriority,t[68]=v.endingPriority,t[69]=ie):ie=t[69];let ae;t[70]!==s||t[71]!==v.cancel?(ae=(0,Q.jsx)(p,{asChild:!0,children:(0,Q.jsx)(Y,{disabled:s,children:v.cancel})}),t[70]=s,t[71]=v.cancel,t[72]=ae):ae=t[72];let oe=!N||s,se;t[73]===s?se=t[74]:(se=s?(0,Q.jsx)(me,{className:`size-4 animate-spin`}):null,t[73]=s,t[74]=se);let ce;t[75]!==v.savePriority||t[76]!==oe||t[77]!==se?(ce=(0,Q.jsxs)(Y,{type:`submit`,variant:`primary`,disabled:oe,children:[se,v.savePriority]}),t[75]=v.savePriority,t[76]=oe,t[77]=se,t[78]=ce):ce=t[78];let le;t[79]!==ae||t[80]!==ce?(le=(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[ae,ce]}),t[79]=ae,t[80]=ce,t[81]=le):le=t[81];let ue;t[82]!==ie||t[83]!==le?(ue=(0,Q.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:[ie,le]}),t[82]=ie,t[83]=le,t[84]=ue):ue=t[84];let de;t[85]!==j||t[86]!==V||t[87]!==re||t[88]!==ue?(de=(0,Q.jsxs)(m,{children:[P,(0,Q.jsx)(h,{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,Q.jsxs)(`form`,{className:`flex h-full min-h-0 flex-col overflow-hidden [border-radius:inherit]`,onSubmit:j,children:[V,re,ue]})})]}),t[85]=j,t[86]=V,t[87]=re,t[88]=ue,t[89]=de):de=t[89];let fe;return t[90]!==c||t[91]!==n||t[92]!==de?(fe=(0,Q.jsx)(_,{open:n,onOpenChange:c,children:de}),t[90]=c,t[91]=n,t[92]=de,t[93]=fe):fe=t[93],fe}function tn(e){let t=(0,Z.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,Q.jsx)(B,{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,Q.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,Q.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,Q.jsx)(Y,{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,Q.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,Q.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,Z.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,Q.jsx)(Ce,{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,Q.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,Q.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,Q.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,Q.jsx)(Y,{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,Q.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,Z.c)(26),{item:n,language:r,busy:i,expanded:a,onToggle:o,editing:s,draft:c,onDraftChange:l,onEdit:u,onCancel:d,onReview:f,onDelete:p}=e,m=Pt[r],h=n.updatedAt??n.createdAt,g;t[0]!==r||t[1]!==h?(g=Vt(h,r),t[0]=r,t[1]=h,t[2]=g):g=t[2];let _=g,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]!==_||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]!==d||t[19]!==p||t[20]!==l||t[21]!==u||t[22]!==f||t[23]!==o||t[24]!==m?(x=(0,Q.jsx)(`article`,{className:`group border-t border-edge-subtle px-5 py-4 first:border-t-0 sm:px-6`,children:s?(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsx)(`textarea`,{"aria-label":m.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,Q.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,Q.jsx)(Y,{variant:`ghost`,className:`h-8`,onClick:d,children:m.cancel}),(0,Q.jsx)(Y,{variant:`primary`,className:`h-8`,disabled:!c.trim()||i,onClick:()=>f(`edit_and_approve`,c.trim()),children:m.save})]})]}):(0,Q.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Q.jsx)(v,{className:`mt-1 size-4 shrink-0 text-fg-subtle`}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-base leading-7 text-fg ${a?``:`line-clamp-2`}`,children:n.content}),(0,Q.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-fg-subtle`,children:[(0,Q.jsx)(`span`,{children:Jt(n.scope,r)}),n.claimMode===`reported`?(0,Q.jsx)(`span`,{children:r===`zh`?`来源报告`:`Source report`}):null,n.verification===`tentative`?(0,Q.jsx)(`span`,{children:r===`zh`?`证据待补充`:`Evidence pending`}):null,_?(0,Q.jsx)(`span`,{children:_}):null]}),a?(0,Q.jsx)(Mt,{id:n.id,language:r}):null]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[b?(0,Q.jsx)(Y,{variant:`ghost`,className:`size-11 p-0`,"aria-expanded":a,"aria-label":a?m.collapse:m.expand,onClick:o,children:(0,Q.jsx)(U,{className:`size-3.5 transition-transform ${a?`rotate-180`:``}`})}):null,(0,Q.jsx)(Ye,{language:r,busy:i,statement:n.content,onEdit:u,onDelete:p})]})]})}),t[6]=i,t[7]=b,t[8]=_,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]=d,t[19]=p,t[20]=l,t[21]=u,t[22]=f,t[23]=o,t[24]=m,t[25]=x):x=t[25],x}function an(){let e=c(e=>e.language),t=Pt[e],n=Pe(e=>e.setPageHeader),r=Pe(e=>e.clearPageHeader),[i,s]=a(),{data:l,error:u,isLoading:d,isValidating:f,mutate:p}=je(`/api/user-model`,j),m=Nt(i),[h,g]=(0,X.useState)(),[_,v]=(0,X.useState)(),[y,L]=(0,X.useState)(``),[R,U]=(0,X.useState)(),[q,J]=(0,X.useState)(``),[oe,se]=(0,X.useState)(``),[ce,le]=(0,X.useState)(24),[ue,de]=(0,X.useState)(),[fe,pe]=(0,X.useState)(!1),[ge,Se]=(0,X.useState)(!1),[we,Te]=(0,X.useState)(`all`),[ke,Me]=(0,X.useState)(`personal`),[Le,Re]=(0,X.useState)(`all`),[ze,Be]=(0,X.useState)(`idle`),Ve=(0,X.useRef)(void 0),He=e=>{if(e===m)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})},Z=(0,X.useCallback)(async()=>{if(!(ze===`refreshing`||f)){Ve.current&&window.clearTimeout(Ve.current),Be(`refreshing`),v(void 0),L(t.refreshing);try{await p(),Be(`success`),L(t.refreshComplete)}catch{Be(`error`),L(``),v(t.refreshFailed)}finally{Ve.current=window.setTimeout(()=>Be(`idle`),1600)}}},[f,p,ze,t]);(0,X.useEffect)(()=>()=>{Ve.current&&window.clearTimeout(Ve.current)},[]);let Ue=f||ze===`refreshing`,We=Ue?t.refreshing:ze===`success`?t.refreshComplete:ze===`error`?t.refreshFailed:t.refresh;(0,X.useEffect)(()=>(n({startExtra:null,main:(0,Q.jsx)(`h1`,{className:`text-base font-semibold text-fg`,children:t.pageTitle}),end:(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(yt,{}),(0,Q.jsx)(Y,{variant:`secondary`,className:`size-9 p-0 ${ze===`success`?`text-success`:ze===`error`?`text-danger`:``}`,disabled:Ue,"aria-label":We,title:We,onClick:()=>void Z(),children:Ue?(0,Q.jsx)(me,{className:`size-4 animate-spin motion-reduce:animate-none`,"aria-hidden":`true`}):ze===`success`?(0,Q.jsx)(te,{className:`size-4`,"aria-hidden":`true`}):ze===`error`?(0,Q.jsx)(ne,{className:`size-4`,"aria-hidden":`true`}):(0,Q.jsx)(ye,{className:`size-4`,"aria-hidden":`true`})})]})}),r),[r,Ue,ze,We,Z,n,t]);let Ge=async(n,r)=>{g(n),v(void 0),L(``);try{await r(),await p(),L(e===`zh`?`已更新`:`Updated`)}catch{v(t.actionFailed)}finally{g(void 0)}},Ke=e=>{Ge(e.id,async()=>{await N(e.id,q.trim()),U(void 0),J(``)})},qe=async e=>{g(`profile`),v(void 0),L(``);try{await S(e),await p(),pe(!1)}catch{v(t.actionFailed)}finally{g(void 0)}},Je=async(n,r)=>{g(`priority:${n.id}`),v(void 0),L(``);try{await O(n.id,r),await p(),Se(!1),L(e===`zh`?`当前关注已更新`:`Current focus updated`)}catch{v(t.actionFailed)}finally{g(void 0)}},Ye=async n=>{g(`priority:create`),v(void 0),L(``);try{await I(n),await p(),Se(!1),L(e===`zh`?`当前关注已设置`:`Current focus set`)}catch{v(t.actionFailed)}finally{g(void 0)}},Xe=async n=>{g(`priority:${n.id}`),v(void 0),L(``);try{await O(n.id,{status:`completed`}),await p(),Se(!1),L(e===`zh`?`当前关注已结束`:`Current focus ended`)}catch{v(t.actionFailed)}finally{g(void 0)}};if(d)return(0,Q.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,Q.jsx)(Ae,{className:`h-10 w-72 rounded-xl`}),(0,Q.jsx)(Ae,{className:`h-72 rounded-xl`}),(0,Q.jsxs)(`div`,{className:`grid gap-5 lg:grid-cols-2`,children:[(0,Q.jsx)(Ae,{className:`h-80 rounded-xl`}),(0,Q.jsx)(Ae,{className:`h-80 rounded-xl`})]})]});if(u||!l)return(0,Q.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,Q.jsx)(b,{className:`size-6 text-fg-subtle`}),(0,Q.jsx)(`p`,{className:`text-sm text-danger`,children:t.loadFailed}),(0,Q.jsx)(Y,{onClick:()=>void p(),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=>we===`explicit`?e.authority===`user_explicit`:we!==`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=oe.trim().toLocaleLowerCase(),mt=ft.filter(e=>Le===`all`||e.kind===Le),ht=mt.filter(t=>!pt||t.content.toLocaleLowerCase().includes(pt)||Yt(t.kind,e).toLocaleLowerCase().includes(pt)),gt=[{key:`identity`,title:t.identity,icon:De,items:it.filter(e=>e.kind===`identity`)},{key:`preferences`,title:t.preferences,icon:x,items:it.filter(e=>[`preference`,`value`,`routine`,`capability`].includes(e.kind))},{key:`relationships`,title:t.relationships,icon:B,items:it.filter(e=>e.kind===`relationship`)},{key:`current`,title:t.currentState,icon:re,items:it.filter(e=>e.kind===`current_state`)},{key:`insights`,title:t.insights,icon:Ce,items:it.filter(e=>e.kind===`derived_insight`)}].filter(e=>e.items.length>0),_t=[{key:`about`,icon:De,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:x,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:B,label:e===`zh`?`重要的人`:`Important people`,hint:e===`zh`?`与你有关的人和关系`:`People and relationships`,count:Ze.filter(e=>e.kind===`relationship`).length},{key:`goals`,icon:Ce,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,ce),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=>{Te(e),Me(`personal`),He(`understanding`)},Dt=e=>{Re(e),se(``),le(24),Me(`work`),He(`understanding`)},Ot=t=>(0,Q.jsx)(nt,{item:t,language:e,busy:!!h,editing:R===t.id,draft:R===t.id?q:``,onDraftChange:J,onEdit:()=>{U(t.id),J(t.statement)},onCancel:()=>{U(void 0),J(``)},onDelete:()=>void Ge(t.id,()=>C(t.id)),onCorrect:()=>Ke(t),onScopeChange:e=>void Ge(t.id,()=>D(t.id,e))},t.id);return(0,Q.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,Q.jsx)(bt,{language:e}),(0,Q.jsx)(Ne,{items:[{id:`overview`,label:t.overview,icon:Ce},{id:`understanding`,label:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`sm:hidden`,children:e===`zh`?`记忆`:`Memory`}),(0,Q.jsx)(`span`,{className:`hidden sm:inline`,children:t.understanding})]}),icon:De,count:Ze.length},{id:`privacy`,label:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`sm:hidden`,children:e===`zh`?`隐私`:`Privacy`}),(0,Q.jsx)(`span`,{className:`hidden sm:inline`,children:t.privacy})]}),icon:xe}],activeTab:m,onChange:He,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,Q.jsx)(`p`,{role:`status`,className:`sr-only`,children:y}),_?(0,Q.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,Q.jsx)(`span`,{children:_}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>v(void 0),"aria-label":t.cancel,children:(0,Q.jsx)(Oe,{className:`size-4`})})]}):null,m===`overview`?(0,Q.jsxs)(`div`,{id:`understanding-panel-overview`,role:`tabpanel`,"aria-labelledby":`understanding-tab-overview`,className:`space-y-8 sm:space-y-10`,children:[(0,Q.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,Q.jsxs)(`div`,{className:`min-w-0 px-1 sm:py-2`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-3 sm:flex-wrap sm:gap-5`,children:[(0,Q.jsx)(Fe,{className:`size-16 sm:size-20`,mood:_?`care`:Ue||h?`work`:`listen`}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`h2`,{className:`truncate text-xl font-semibold tracking-tight text-fg sm:text-3xl`,children:et}),(0,Q.jsx)(`p`,{className:`mt-1 break-words text-sm text-fg-muted`,children:$e.role||t.notProvided})]}),(0,Q.jsxs)(Y,{variant:`ghost`,className:`size-11 shrink-0 px-0 sm:h-9 sm:w-auto sm:px-3`,onClick:()=>pe(!0),children:[(0,Q.jsx)(z,{className:`size-4`,"aria-hidden":`true`}),(0,Q.jsx)(`span`,{className:`sr-only sm:not-sr-only`,children:t.editProfile})]})]}),(0,Q.jsx)(`dl`,{className:`mt-6 hidden gap-x-8 gap-y-5 sm:grid sm:grid-cols-3`,children:[{icon:w,label:t.locale,value:$e.locale?Wt($e.locale,e):t.notProvided},{icon:V,label:t.timezone,value:$e.timezone||t.notProvided},{icon:De,label:t.pronouns,value:$e.pronouns||t.notProvided}].map(({icon:e,label:t,value:n})=>(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsxs)(`dt`,{className:`flex items-center gap-1.5 text-xs text-fg-subtle`,children:[(0,Q.jsx)(e,{className:`size-3.5`,"aria-hidden":`true`}),t]}),(0,Q.jsx)(`dd`,{className:`mt-1.5 truncate text-sm font-medium text-fg`,children:n})]},t))})]}),(0,Q.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,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{className:`text-xs font-semibold tracking-wide text-fg-subtle`,children:t.importantNow}),$?(0,Q.jsxs)(`p`,{className:`mt-1.5 flex items-center gap-1.5 text-xs text-fg-muted`,children:[(0,Q.jsx)(H,{className:`size-3.5`,"aria-hidden":`true`}),$.targetType===`goal`?t.prioritySourceGoal:t.prioritySourceWork]}):null]}),$&&ot?(0,Q.jsxs)(Y,{variant:`ghost`,className:`h-8 shrink-0 px-2.5`,onClick:()=>Se(!0),children:[(0,Q.jsx)(_e,{className:`size-3.5`,"aria-hidden":`true`}),t.editPriority]}):null]}),ot?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`p`,{className:`mt-3 text-lg font-semibold leading-7 tracking-tight text-fg`,children:ot}),st?.desiredOutcome?(0,Q.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:st.desiredOutcome}):null,$?(0,Q.jsxs)(`p`,{className:`mt-auto flex items-center gap-1.5 pt-4 text-xs text-fg-subtle`,children:[(0,Q.jsx)(ee,{className:`size-3.5`,"aria-hidden":`true`}),Gt($.validTo,e)]}):null]}):(0,Q.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,Q.jsx)(H,{className:`size-5 text-fg-subtle`}),(0,Q.jsxs)(Y,{variant:`primary`,onClick:()=>Se(!0),children:[(0,Q.jsx)(ve,{className:`size-4`,"aria-hidden":`true`}),t.addPriority]})]}),lt.length?(0,Q.jsxs)(`div`,{className:`mt-5 hidden border-t border-edge-subtle pt-4 sm:block`,children:[(0,Q.jsx)(`p`,{className:`text-xs text-fg-subtle`,children:t.otherGoals}),(0,Q.jsx)(`div`,{className:`mt-2 space-y-2`,children:lt.slice(0,3).map(e=>(0,Q.jsx)(`p`,{className:`text-sm text-fg`,children:e.title},e.id))})]}):null]})]}),Qe.length?(0,Q.jsxs)(`section`,{className:`overflow-hidden rounded-2xl bg-accent-soft/70 shadow-surface`,"aria-label":e===`zh`?`需要你确认`:`Needs your review`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-4 px-5 py-4 sm:px-6`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,Q.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-full bg-surface-panel text-accent-fg`,children:(0,Q.jsx)(Ce,{className:`size-4`,"aria-hidden":`true`})}),(0,Q.jsx)(`div`,{className:`min-w-0`,children:(0,Q.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:e===`zh`?`需要你确认`:`Needs your review`})})]}),(0,Q.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,Q.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,Q.jsx)(`p`,{className:`min-w-0 flex-1 text-sm leading-6 text-fg`,children:Qe[0].statement}),(0,Q.jsxs)(`div`,{className:`mt-3 flex shrink-0 gap-2 sm:mt-0`,children:[(0,Q.jsx)(Y,{variant:`ghost`,className:`min-h-11 flex-1 sm:flex-none`,disabled:h===Qe[0].id,onClick:()=>void Ge(Qe[0].id,()=>F(Qe[0].id,`rejected`)),children:e===`zh`?`不是`:`No`}),(0,Q.jsx)(Y,{variant:`primary`,className:`min-h-11 flex-1 sm:flex-none`,disabled:h===Qe[0].id,onClick:()=>void Ge(Qe[0].id,()=>F(Qe[0].id,`active`)),children:e===`zh`?`是的`:`That’s right`})]})]})]}):null,(0,Q.jsx)(Zt,{title:e===`zh`?`xopc 对我的了解`:`What xopc knows about me`,action:(0,Q.jsx)(Y,{variant:`ghost`,className:`h-8 shrink-0`,onClick:()=>He(`understanding`),children:t.seeAll}),children:(0,Q.jsx)(`div`,{className:`grid sm:grid-cols-2`,children:_t.map(({key:e,icon:t,label:n,hint:r,count:i})=>(0,Q.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,Q.jsx)(`span`,{className:`flex size-10 shrink-0 items-center justify-center rounded-xl bg-surface-base text-fg-muted`,children:(0,Q.jsx)(t,{className:`size-4.5`,"aria-hidden":`true`})}),(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:n}),(0,Q.jsx)(`span`,{className:`mt-0.5 block truncate text-xs text-fg-subtle`,children:r})]}),(0,Q.jsx)(`span`,{className:`text-sm tabular-nums text-fg-muted`,children:i}),(0,Q.jsx)(W,{className:`size-4 shrink-0 text-fg-subtle transition-transform group-hover:translate-x-0.5`,"aria-hidden":`true`})]},e))})}),(0,Q.jsxs)(`div`,{className:`grid items-start gap-8 lg:grid-cols-2`,children:[(0,Q.jsx)(Zt,{title:t.howWeWork,className:`min-w-0`,children:ut.length||dt.length?(0,Q.jsxs)(Q.Fragment,{children:[ut.slice(0,3).map(t=>(0,Q.jsx)(tn,{rule:t,language:e,busy:h===t.id,onToggle:()=>void Ge(t.id,()=>M(t.id,t.status===`active`?`disabled`:`active`))},t.id)),dt.slice(0,2).map(t=>(0,Q.jsx)(nn,{suggestion:t,language:e,busy:h===t.id,onConfirm:()=>void Ge(t.id,()=>A(t))},t.id))]}):(0,Q.jsx)(Qt,{icon:(0,Q.jsx)(B,{className:`size-5`}),children:t.noRules})}),(0,Q.jsx)(Zt,{title:t.workMemory,className:`min-w-0`,action:(0,Q.jsx)(Y,{variant:`ghost`,className:`h-8 shrink-0`,onClick:()=>Dt(`all`),children:t.seeAll}),children:vt.length?(0,Q.jsx)(`div`,{"data-testid":`memory-summary-grid`,className:`grid gap-3 bg-surface-base ${St}`,children:xt.map(({kind:t,count:n})=>(0,Q.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,Q.jsxs)(`span`,{children:[(0,Q.jsx)(`span`,{className:`block text-2xl font-semibold tabular-nums text-fg`,children:n}),(0,Q.jsx)(`span`,{className:`mt-1 block text-sm text-fg-muted`,children:Yt(t,e)})]}),(0,Q.jsx)(W,{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,Q.jsx)(Qt,{icon:(0,Q.jsx)(ie,{className:`size-5`}),children:t.noKnowledge})})]})]}):null,m===`understanding`?(0,Q.jsxs)(`div`,{id:`understanding-panel-understanding`,role:`tabpanel`,"aria-labelledby":`understanding-tab-understanding`,className:`space-y-10`,children:[(0,Q.jsx)(Ie,{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:De,count:Ze.length},{id:`work`,label:e===`zh`?`工作记忆`:`Work memory`,icon:H,count:ft.length}].map(({id:e,label:t,icon:n,count:r})=>(0,Q.jsxs)(`button`,{type:`button`,"aria-pressed":ke===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 ${ke===e?`bg-surface-active text-fg`:`text-fg-muted hover:bg-surface-hover hover:text-fg`}`,onClick:()=>Me(e),children:[(0,Q.jsx)(n,{className:`size-4`,"aria-hidden":`true`}),t,(0,Q.jsx)(`span`,{className:`text-xs tabular-nums text-fg-subtle`,children:r})]},e))}),ke===`personal`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`px-1 pt-1`,children:[(0,Q.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Q.jsx)(b,{className:`mt-0.5 size-5 shrink-0 text-accent-fg`,"aria-hidden":`true`}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h2`,{className:`font-semibold text-fg`,children:t.aboutYouTitle}),(0,Q.jsx)(`p`,{className:`mt-1 max-w-3xl text-sm leading-6 text-fg-muted`,children:t.aboutYouHint})]})]}),(0,Q.jsx)(Ie,{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,Q.jsxs)(`button`,{type:`button`,"aria-pressed":we===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 ${we===e.id?`bg-surface-active text-fg`:`text-fg-muted hover:bg-surface-hover hover:text-fg`}`,onClick:()=>Te(e.id),children:[e.label,(0,Q.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,Q.jsx)(Zt,{title:t,action:(0,Q.jsx)(n,{className:`size-4 text-fg-subtle`,"aria-hidden":`true`}),children:(0,Q.jsx)(`div`,{children:r.map(Ot)})},e)):(0,Q.jsx)(`div`,{className:`rounded-2xl bg-surface-panel`,children:(0,Q.jsx)(Qt,{icon:(0,Q.jsx)(b,{className:`size-5`}),children:t.emptyGroup})})]}):(0,Q.jsxs)(`div`,{className:`space-y-8`,children:[(0,Q.jsxs)(`div`,{className:`px-1 pt-1`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,Q.jsxs)(`div`,{className:`max-w-2xl`,children:[(0,Q.jsx)(`h2`,{className:`font-semibold text-fg`,children:Le===`all`?t.allMemory:Yt(Le,e)}),(0,Q.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,Q.jsxs)(`label`,{className:`relative block sm:w-80`,children:[(0,Q.jsx)(be,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`}),(0,Q.jsx)(`span`,{className:`sr-only`,children:t.searchPlaceholder}),(0,Q.jsx)(`input`,{type:`search`,value:oe,onChange:e=>{se(e.target.value),le(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,Q.jsxs)(Ie,{className:`mt-4 flex flex-wrap gap-2`,role:`group`,"aria-label":t.memoryFilterHint,indicatorClassName:`rounded-full bg-surface-active`,children:[(0,Q.jsxs)(`button`,{type:`button`,"aria-pressed":Le===`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 ${Le===`all`?`bg-surface-active text-fg`:`text-fg-muted hover:bg-surface-hover hover:text-fg`}`,onClick:()=>Re(`all`),children:[t.allMemory,(0,Q.jsx)(`span`,{className:`tabular-nums text-fg-subtle`,children:ft.length})]}),vt.map(({kind:t,count:n})=>(0,Q.jsxs)(`button`,{type:`button`,"aria-pressed":Le===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 ${Le===t?`bg-surface-active text-fg`:`text-fg-muted hover:bg-surface-hover hover:text-fg`}`,onClick:()=>Re(t),children:[Yt(t,e),(0,Q.jsx)(`span`,{className:`tabular-nums text-fg-subtle`,children:n})]},t))]})]}),ht.length?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`space-y-8`,children:wt.map(({kind:t,items:n,totalCount:r})=>(0,Q.jsxs)(`section`,{className:`overflow-hidden rounded-2xl bg-surface-panel`,children:[(0,Q.jsxs)(`header`,{className:`flex items-center justify-between px-5 pb-1 pt-4 sm:px-6`,children:[(0,Q.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:Yt(t,e)}),(0,Q.jsx)(`span`,{className:`text-xs tabular-nums text-fg-subtle`,children:r})]}),(0,Q.jsx)(`div`,{children:n.map(t=>(0,Q.jsx)(rn,{item:t,language:e,busy:!!h,expanded:ue===t.id,onToggle:()=>de(e=>e===t.id?void 0:t.id),editing:R===`knowledge:${t.id}`,draft:q,onDraftChange:J,onEdit:()=>{U(`knowledge:${t.id}`),J(t.content)},onCancel:()=>{U(void 0),J(``)},onDelete:()=>void Ge(t.id,()=>P(t.id)),onReview:(e,n)=>void Ge(t.id,async()=>{await E(t,e,n),U(void 0),J(``)})},t.id))})]},t))}),ht.length>ce?(0,Q.jsx)(`div`,{className:`flex justify-center pt-2`,children:(0,Q.jsx)(Y,{onClick:()=>le(e=>e+24),children:t.showMore})}):null]}):(0,Q.jsx)(`div`,{className:`rounded-2xl bg-surface-panel`,children:(0,Q.jsx)(Qt,{icon:(0,Q.jsx)(be,{className:`size-5`}),children:oe.trim()?t.noKnowledgeMatch:t.noKnowledge})})]})]}):null,m===`privacy`?(0,Q.jsxs)(`div`,{id:`understanding-panel-privacy`,role:`tabpanel`,"aria-labelledby":`understanding-tab-privacy`,className:`space-y-8`,children:[(0,Q.jsx)(`div`,{className:`px-1 pt-1`,children:(0,Q.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Q.jsx)(xe,{className:`mt-0.5 size-5 shrink-0 text-accent-fg`,"aria-hidden":`true`}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h2`,{className:`font-semibold text-fg`,children:e===`zh`?`你的信息,由你掌控`:`Your information, under your control`}),(0,Q.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,Q.jsx)(Zt,{title:e===`zh`?`记忆与使用`:`Memory & use`,children:(0,Q.jsxs)(`div`,{className:`divide-y divide-edge-subtle`,children:[[{key:`memory`,icon:b,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:Ce,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,Q.jsxs)(`button`,{type:`button`,role:`switch`,"aria-checked":i,disabled:!!h,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 Ge(`setting:${e}`,()=>k(e===`memory`?{memoryEnabled:!i}:{showMemoryReferences:!i})),children:[(0,Q.jsx)(`span`,{className:`flex size-10 shrink-0 items-center justify-center rounded-xl bg-surface-base text-fg-muted`,children:(0,Q.jsx)(t,{className:`size-4.5`,"aria-hidden":`true`})}),(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:n}),(0,Q.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-fg-muted`,children:r})]}),(0,Q.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,Q.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,Q.jsxs)(`div`,{className:`flex min-h-20 items-center gap-4 px-5 py-4 sm:px-6`,children:[(0,Q.jsx)(`span`,{className:`flex size-10 shrink-0 items-center justify-center rounded-xl bg-surface-base text-fg-muted`,children:(0,Q.jsx)(he,{className:`size-4.5`,"aria-hidden":`true`})}),(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:e===`zh`?`敏感信息`:`Sensitive information`}),(0,Q.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,Q.jsxs)(G,{"aria-label":e===`zh`?`敏感信息策略`:`Sensitive information policy`,value:l.settings.sensitiveWritePolicy,disabled:!!h,onChange:e=>void Ge(`setting:sensitive`,()=>k({sensitiveWritePolicy:e.target.value})),children:[(0,Q.jsx)(K,{value:`confirm`,children:e===`zh`?`先询问`:`Ask first`}),(0,Q.jsx)(K,{value:`deny`,children:e===`zh`?`不保存`:`Never save`}),(0,Q.jsx)(K,{value:`allow`,children:e===`zh`?`允许`:`Allow`})]})]})]})}),(0,Q.jsx)(Zt,{title:e===`zh`?`数据管理`:`Data management`,children:(0,Q.jsxs)(`div`,{className:`divide-y divide-edge-subtle`,children:[(0,Q.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,Q.jsx)(`span`,{className:`flex size-10 shrink-0 items-center justify-center rounded-xl bg-surface-base text-fg-muted`,children:(0,Q.jsx)(Ee,{className:`size-4.5`,"aria-hidden":`true`})}),(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:e===`zh`?`从其他 AI 导入`:`Import from another AI`}),(0,Q.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,Q.jsx)(W,{className:`size-4 shrink-0 text-fg-subtle`,"aria-hidden":`true`})]}),(0,Q.jsxs)(`button`,{type:`button`,disabled:!!h,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 Ge(`export`,T),children:[(0,Q.jsx)(`span`,{className:`flex size-10 shrink-0 items-center justify-center rounded-xl bg-surface-base text-fg-muted`,children:(0,Q.jsx)(ae,{className:`size-4.5`,"aria-hidden":`true`})}),(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:e===`zh`?`下载我的记忆`:`Download my memory`}),(0,Q.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-fg-muted`,children:e===`zh`?`导出为可阅读、可迁移的数据包。`:`Export a readable, portable archive.`})]}),(0,Q.jsx)(W,{className:`size-4 shrink-0 text-fg-subtle`,"aria-hidden":`true`})]})]})}),(0,Q.jsxs)(`section`,{className:`rounded-2xl bg-surface-panel px-5 py-5 sm:px-6`,children:[(0,Q.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:e===`zh`?`纠正与忘记`:`Correct and forget`}),(0,Q.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,Q.jsx)(Y,{variant:`ghost`,className:`mt-3`,onClick:()=>{Me(`personal`),He(`understanding`)},children:e===`zh`?`管理记忆`:`Manage memory`})]})]}):null,(0,Q.jsx)($t,{open:fe,profile:$e,language:e,saving:h===`profile`,onOpenChange:pe,onSave:e=>void qe(e)}),(0,Q.jsx)(en,{open:ge,priority:$,title:ot??``,outcome:st?.desiredOutcome,language:e,saving:h===($?`priority:${$.id}`:`priority:create`),onOpenChange:Se,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-Br7IfbXK.js";var t=e(e=>({agentId:``,setAgentId:t=>e({agentId:t})}));export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./vendor-react-BOUWij0V.js";import{i as n,n as r,o as i}from"./locale-store-Br7IfbXK.js";import{t as a}from"./cloud-C4-yfnnk.js";import{t as o}from"./external-link-DjqjBmc3.js";import{t as s}from"./refresh-cw-BRlGaq2w.js";import{t as c}from"./triangle-alert-2JXFNNKU.js";import{t as l}from"./skeleton-BI5TyibZ.js";import{n as u,t as d}from"./cloud-credits-B-nbtkqv.js";import{i as f}from"./vendor-swr-CdRzEUwF.js";import{t as p}from"./button-Cc4hUNTt.js";var m=e(),h=t();function g(e){let t=(BigInt(e)+500n)/1000n*1000n;return u(String(t))}async function _(){let e=await i(n(`/api/models/xopc-cloud/account-summary`));return d.parse(e.payload)}function v(e){let t=(0,m.c)(148),{labels:n}=e,i=r(y)===`zh`?`zh-CN`:`en-US`,u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u={refreshInterval:6e4,revalidateOnFocus:!0},t[0]=u):u=t[0];let{data:d,error:v,isLoading:b,isValidating:x,mutate:S}=f(`/api/models/xopc-cloud/account-summary`,_,u);if(b){let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,h.jsx)(l,{className:`h-40 w-full rounded-xl`}),t[1]=e):e=t[1],e}if(v||!d){let e;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,h.jsx)(c,{className:`mt-0.5 size-4 shrink-0 text-amber-500`,"aria-hidden":!0}),t[2]=e):e=t[2];let r;t[3]===n.title?r=t[4]:(r=(0,h.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:n.title}),t[3]=n.title,t[4]=r);let i;t[5]===n.unavailable?i=t[6]:(i=(0,h.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:n.unavailable}),t[5]=n.unavailable,t[6]=i);let a;t[7]!==r||t[8]!==i?(a=(0,h.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[e,(0,h.jsxs)(`div`,{children:[r,i]})]}),t[7]=r,t[8]=i,t[9]=a):a=t[9];let o;t[10]===S?o=t[11]:(o=()=>void S(),t[10]=S,t[11]=o);let l=x?`size-4 animate-spin`:`size-4`,u;t[12]===l?u=t[13]:(u=(0,h.jsx)(s,{className:l,"aria-hidden":!0}),t[12]=l,t[13]=u);let d;t[14]!==x||t[15]!==n.retry||t[16]!==o||t[17]!==u?(d=(0,h.jsxs)(p,{type:`button`,variant:`secondary`,disabled:x,onClick:o,children:[u,n.retry]}),t[14]=x,t[15]=n.retry,t[16]=o,t[17]=u,t[18]=d):d=t[18];let f;return t[19]!==a||t[20]!==d?(f=(0,h.jsx)(`section`,{className:`rounded-xl bg-surface-hover/25 p-4`,children:(0,h.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[a,d]})}),t[19]=a,t[20]=d,t[21]=f):f=t[21],f}let C,w,T,E,D,O,k,A,j,M;if(t[22]!==d.balance.availableCreditMicro||t[23]!==d.balance.expiring[0]||t[24]!==d.balance.grantedCreditMicro||t[25]!==d.balance.purchasedCreditMicro||t[26]!==d.balance.refundReservedCreditMicro||t[27]!==d.balance.usageReservedCreditMicro||t[28]!==d.links.details||t[29]!==d.links.purchase||t[30]!==d.usage.chargedCreditMicro||t[31]!==d.usage.requests||t[32]!==d.usage.totalTokens||t[33]!==n.availableCredits||t[34]!==n.connected||t[35]!==n.details||t[36]!==n.expiring||t[37]!==n.granted||t[38]!==n.purchase||t[39]!==n.purchased||t[40]!==n.recentUsage||t[41]!==n.reserved||t[42]!==n.title||t[43]!==n.tokenUsage||t[44]!==n.usageSummary||t[45]!==n.zeroBalance||t[46]!==i){let e=new Intl.NumberFormat(i),r=n.usageSummary.replace(`{{credits}}`,g(d.usage.chargedCreditMicro)).replace(`{{requests}}`,e.format(d.usage.requests));C=`rounded-xl bg-surface-hover/40 p-4 sm:p-5`;let s;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,h.jsx)(a,{className:`size-4 text-accent-fg`,"aria-hidden":!0}),t[57]=s):s=t[57];let c;t[58]===n.title?c=t[59]:(c=(0,h.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:n.title}),t[58]=n.title,t[59]=c);let l;t[60]===n.connected?l=t[61]:(l=(0,h.jsx)(`span`,{className:`rounded-full bg-emerald-500/10 px-2 py-0.5 text-xs font-medium text-emerald-700 dark:text-emerald-300`,children:n.connected}),t[60]=n.connected,t[61]=l);let u;t[62]!==c||t[63]!==l?(u=(0,h.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[s,c,l]}),t[62]=c,t[63]=l,t[64]=u):u=t[64];let f;t[65]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,h.jsx)(o,{className:`size-3.5`,"aria-hidden":!0}),t[65]=f):f=t[65];let m;t[66]!==d.links.purchase||t[67]!==n.purchase?(m=(0,h.jsx)(p,{asChild:!0,variant:`primary`,children:(0,h.jsxs)(`a`,{href:d.links.purchase,target:`_blank`,rel:`noreferrer`,children:[n.purchase,f]})}),t[66]=d.links.purchase,t[67]=n.purchase,t[68]=m):m=t[68];let _;t[69]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,h.jsx)(o,{className:`size-3.5`,"aria-hidden":!0}),t[69]=_):_=t[69];let v;t[70]!==d.links.details||t[71]!==n.details?(v=(0,h.jsx)(p,{asChild:!0,variant:`secondary`,children:(0,h.jsxs)(`a`,{href:d.links.details,target:`_blank`,rel:`noreferrer`,children:[n.details,_]})}),t[70]=d.links.details,t[71]=n.details,t[72]=v):v=t[72];let y;t[73]!==m||t[74]!==v?(y=(0,h.jsxs)(`div`,{className:`flex shrink-0 flex-wrap gap-2`,children:[m,v]}),t[73]=m,t[74]=v,t[75]=y):y=t[75],t[76]!==u||t[77]!==y?(w=(0,h.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[u,y]}),t[76]=u,t[77]=y,t[78]=w):w=t[78],j=`mt-4 grid gap-4 rounded-lg bg-surface-base/45 p-3 sm:grid-cols-[minmax(12rem,0.7fr)_minmax(0,1.3fr)] sm:gap-6`;let b;t[79]===n.availableCredits?b=t[80]:(b=(0,h.jsx)(`p`,{className:`text-xs font-medium text-fg-subtle`,children:n.availableCredits}),t[79]=n.availableCredits,t[80]=b);let x;t[81]===d.balance.availableCreditMicro?x=t[82]:(x=g(d.balance.availableCreditMicro),t[81]=d.balance.availableCreditMicro,t[82]=x);let S;t[83]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,h.jsx)(`span`,{className:`ml-2 text-sm font-medium text-fg-muted`,children:`Credits`}),t[83]=S):S=t[83];let N;t[84]===x?N=t[85]:(N=(0,h.jsxs)(`p`,{className:`mt-1 text-2xl font-semibold tracking-tight text-fg`,children:[x,S]}),t[84]=x,t[85]=N);let P;t[86]!==d.balance.availableCreditMicro||t[87]!==n.zeroBalance?(P=d.balance.availableCreditMicro===`0`?(0,h.jsx)(`p`,{className:`mt-1 text-sm font-medium text-danger`,children:n.zeroBalance}):null,t[86]=d.balance.availableCreditMicro,t[87]=n.zeroBalance,t[88]=P):P=t[88];let F=n.purchased,I;t[89]===d.balance.purchasedCreditMicro?I=t[90]:(I=g(d.balance.purchasedCreditMicro),t[89]=d.balance.purchasedCreditMicro,t[90]=I);let L;t[91]!==n.purchased||t[92]!==I?(L=(0,h.jsxs)(`div`,{children:[F,`: `,I,` Credits`]}),t[91]=n.purchased,t[92]=I,t[93]=L):L=t[93];let R=n.granted,z;t[94]===d.balance.grantedCreditMicro?z=t[95]:(z=g(d.balance.grantedCreditMicro),t[94]=d.balance.grantedCreditMicro,t[95]=z);let B;t[96]!==n.granted||t[97]!==z?(B=(0,h.jsxs)(`div`,{children:[R,`: `,z,` Credits`]}),t[96]=n.granted,t[97]=z,t[98]=B):B=t[98];let V=n.reserved,H=String(BigInt(d.balance.usageReservedCreditMicro)+BigInt(d.balance.refundReservedCreditMicro)),U;t[99]===H?U=t[100]:(U=g(H),t[99]=H,t[100]=U);let W;t[101]!==n.reserved||t[102]!==U?(W=(0,h.jsxs)(`div`,{children:[V,`: `,U,` Credits`]}),t[101]=n.reserved,t[102]=U,t[103]=W):W=t[103];let G;t[104]!==L||t[105]!==B||t[106]!==W?(G=(0,h.jsxs)(`div`,{className:`mt-2 space-y-1 text-xs text-fg-muted`,children:[L,B,W]}),t[104]=L,t[105]=B,t[106]=W,t[107]=G):G=t[107];let K;t[108]!==d.balance.expiring[0]||t[109]!==n.expiring||t[110]!==i?(K=d.balance.expiring[0]?(0,h.jsx)(`p`,{className:`mt-2 text-xs text-amber-600 dark:text-amber-400`,children:n.expiring.replace(`{{credits}}`,g(d.balance.expiring[0].creditMicro)).replace(`{{date}}`,new Date(d.balance.expiring[0].expiresAt).toLocaleDateString(i))}):null,t[108]=d.balance.expiring[0],t[109]=n.expiring,t[110]=i,t[111]=K):K=t[111],t[112]!==b||t[113]!==N||t[114]!==P||t[115]!==G||t[116]!==K?(M=(0,h.jsxs)(`div`,{children:[b,N,P,G,K]}),t[112]=b,t[113]=N,t[114]=P,t[115]=G,t[116]=K,t[117]=M):M=t[117],t[118]===n.recentUsage?k=t[119]:(k=(0,h.jsx)(`p`,{className:`text-xs font-medium text-fg-subtle`,children:n.recentUsage}),t[118]=n.recentUsage,t[119]=k),A=(0,h.jsx)(`p`,{className:`mt-1 text-sm leading-relaxed text-fg-muted`,children:r}),D=`mt-2 text-xs text-fg-subtle`,t[120]===n.tokenUsage?O=t[121]:(O=(0,h.jsx)(`summary`,{className:`cursor-pointer`,children:n.tokenUsage}),t[120]=n.tokenUsage,t[121]=O),T=`mt-1`,E=e.format(d.usage.totalTokens),t[22]=d.balance.availableCreditMicro,t[23]=d.balance.expiring[0],t[24]=d.balance.grantedCreditMicro,t[25]=d.balance.purchasedCreditMicro,t[26]=d.balance.refundReservedCreditMicro,t[27]=d.balance.usageReservedCreditMicro,t[28]=d.links.details,t[29]=d.links.purchase,t[30]=d.usage.chargedCreditMicro,t[31]=d.usage.requests,t[32]=d.usage.totalTokens,t[33]=n.availableCredits,t[34]=n.connected,t[35]=n.details,t[36]=n.expiring,t[37]=n.granted,t[38]=n.purchase,t[39]=n.purchased,t[40]=n.recentUsage,t[41]=n.reserved,t[42]=n.title,t[43]=n.tokenUsage,t[44]=n.usageSummary,t[45]=n.zeroBalance,t[46]=i,t[47]=C,t[48]=w,t[49]=T,t[50]=E,t[51]=D,t[52]=O,t[53]=k,t[54]=A,t[55]=j,t[56]=M}else C=t[47],w=t[48],T=t[49],E=t[50],D=t[51],O=t[52],k=t[53],A=t[54],j=t[55],M=t[56];let N;t[122]!==T||t[123]!==E?(N=(0,h.jsxs)(`p`,{className:T,children:[E,` tokens`]}),t[122]=T,t[123]=E,t[124]=N):N=t[124];let P;t[125]!==N||t[126]!==D||t[127]!==O?(P=(0,h.jsxs)(`details`,{className:D,children:[O,N]}),t[125]=N,t[126]=D,t[127]=O,t[128]=P):P=t[128];let F;t[129]!==d.balance.updatedAt||t[130]!==n.updatedAt||t[131]!==i?(F=n.updatedAt.replace(`{{time}}`,new Date(d.balance.updatedAt).toLocaleString(i)),t[129]=d.balance.updatedAt,t[130]=n.updatedAt,t[131]=i,t[132]=F):F=t[132];let I;t[133]===F?I=t[134]:(I=(0,h.jsx)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:F}),t[133]=F,t[134]=I);let L;t[135]!==P||t[136]!==I||t[137]!==k||t[138]!==A?(L=(0,h.jsxs)(`div`,{children:[k,A,P,I]}),t[135]=P,t[136]=I,t[137]=k,t[138]=A,t[139]=L):L=t[139];let R;t[140]!==L||t[141]!==j||t[142]!==M?(R=(0,h.jsxs)(`div`,{className:j,children:[M,L]}),t[140]=L,t[141]=j,t[142]=M,t[143]=R):R=t[143];let z;return t[144]!==C||t[145]!==w||t[146]!==R?(z=(0,h.jsxs)(`section`,{className:C,children:[w,R]}),t[144]=C,t[145]=w,t[146]=R,t[147]=z):z=t[147],z}function y(e){return e.language}export{v as t};
|