@xopcai/xopc 0.0.457 → 0.0.460

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.
Files changed (47) hide show
  1. package/dist/browser-ext/manifest.json +1 -1
  2. package/dist/extensions/telegram/xopc.extension.json +1 -1
  3. package/dist/gateway/static/root/assets/automation-display-DaVDNZz8.js +2 -0
  4. package/dist/gateway/static/root/assets/automation-task-card-CiJmJ7_h.js +2 -0
  5. package/dist/gateway/static/root/assets/{automations-page-BSnPWyYd.js → automations-page-CVjgENMO.js} +1 -1
  6. package/dist/gateway/static/root/assets/automations-workspace-CGPWyL0P.js +9 -0
  7. package/dist/gateway/static/root/assets/capabilities-page-D2hq4cgE.js +2 -0
  8. package/dist/gateway/static/root/assets/{chat-page-Bx_A__qB.js → chat-page-BhPw56Vc.js} +5 -5
  9. package/dist/gateway/static/root/assets/connectors-page-DyzDVVfz.js +1 -0
  10. package/dist/gateway/static/root/assets/home-page-BPPe4JXB.js +7 -0
  11. package/dist/gateway/static/root/assets/index-DjzrnmBA.js +11 -0
  12. package/dist/gateway/static/root/assets/index-YQxumvaS.css +1 -0
  13. package/dist/gateway/static/root/assets/note-detail-panel-BbHlfAju.js +7 -0
  14. package/dist/gateway/static/root/assets/{notes-page-Do0l5Ddr.js → notes-page-8w2Stfak.js} +1 -1
  15. package/dist/gateway/static/root/assets/personal-page-BwfyW7Hx.js +1 -0
  16. package/dist/gateway/static/root/assets/personal-profile-settings-CQhZjoK6.js +1 -0
  17. package/dist/gateway/static/root/assets/{personal-settings-panel-BppxtWBl.js → personal-settings-panel-peD05ktj.js} +1 -1
  18. package/dist/gateway/static/root/assets/product-preview-content-WkF2j_c-.js +1 -0
  19. package/dist/gateway/static/root/assets/{product-preview-modal-BUeyRD5W.js → product-preview-modal-DMHOKocl.js} +2 -2
  20. package/dist/gateway/static/root/assets/{project-detail-page-D3k1NzXQ.js → project-detail-page-CNFuzmRr.js} +1 -1
  21. package/dist/gateway/static/root/assets/route-preload-CuxNu-LB.js +2 -0
  22. package/dist/gateway/static/root/assets/routine-panel-CXs4PjW0.js +2 -0
  23. package/dist/gateway/static/root/assets/service-recommendation-list-DDlMyPvC.js +1 -0
  24. package/dist/gateway/static/root/assets/{settings-page-CGiZCF8z.js → settings-page-BHImcF1q.js} +1 -1
  25. package/dist/gateway/static/root/assets/task-detail-page-_5TEldtl.js +3 -0
  26. package/dist/gateway/static/root/assets/{work-discovery-overlay-BNZK4hQ4.js → work-discovery-overlay-UvWbDUXi.js} +1 -1
  27. package/dist/gateway/static/root/assets/{work-discovery-page-KwSPhukU.js → work-discovery-page-BM1HsYz6.js} +1 -1
  28. package/dist/gateway/static/root/index.html +10 -10
  29. package/dist/package.js +1 -1
  30. package/dist/src/storage/sqlite/conversation-repository.js +4 -1
  31. package/package.json +1 -1
  32. package/dist/gateway/static/root/assets/automation-task-card-BjqxvYqc.js +0 -3
  33. package/dist/gateway/static/root/assets/automations-workspace-DIaCdxtX.js +0 -9
  34. package/dist/gateway/static/root/assets/calendar-clock-D-quYVPe.js +0 -1
  35. package/dist/gateway/static/root/assets/capabilities-page-dXDa0i5o.js +0 -2
  36. package/dist/gateway/static/root/assets/connectors-page-BwJHhyRb.js +0 -1
  37. package/dist/gateway/static/root/assets/home-page-D1sTZYAY.js +0 -3
  38. package/dist/gateway/static/root/assets/index-CHAVhyVb.js +0 -11
  39. package/dist/gateway/static/root/assets/index-CQABygtM.css +0 -1
  40. package/dist/gateway/static/root/assets/note-detail-panel-B1cq9sU2.js +0 -7
  41. package/dist/gateway/static/root/assets/personal-page-DrYh0NPE.js +0 -1
  42. package/dist/gateway/static/root/assets/personal-profile-settings-HMQY9lz9.js +0 -1
  43. package/dist/gateway/static/root/assets/product-preview-content-CUaHxyiE.js +0 -1
  44. package/dist/gateway/static/root/assets/route-preload-CTuS4GFj.js +0 -2
  45. package/dist/gateway/static/root/assets/routine-panel-9UC3NU5V.js +0 -2
  46. package/dist/gateway/static/root/assets/service-recommendation-list-8mVIWB38.js +0 -1
  47. package/dist/gateway/static/root/assets/task-detail-page-CWwwumsy.js +0 -3
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sessions-page-DQEq_VJS.js","assets/rolldown-runtime-aKtaBQYM.js","assets/vendor-react-BOUWij0V.js","assets/chunk-KS7C4IRE-CiwuuyV8.js","assets/preload-helper-Czpn1I53.js","assets/locale-store-Dy1EByeG.js","assets/messages-BAnhwALN.js","assets/dist-CY7CS_D3.js","assets/es2015-DBLcMg5B.js","assets/dist-CxGUk8J-.js","assets/session-identity-label-D5SAi0Uh.js","assets/createLucideIcon-DPHK1VkS.js","assets/session-channel-icon-BzkFo-Ci.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/zap-dximCGjy.js","assets/cn-0WouolD0.js","assets/bundle-mjs-rHxsej31.js","assets/schemas-CCWMleym.js","assets/archive-Dz0hferG.js","assets/popover-select-CLsphyzA.js","assets/check-DUBLcKHA.js","assets/skeleton-DzdOeGYz.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-BFiIYodK.js","assets/gateway-startup-retry-D6WPS0RW.js","assets/vendor-swr-CdRzEUwF.js","assets/gateway-config-swr-1Rk0LeEM.js","assets/chat-agents-api-CjlzCSmC.js","assets/registry-api-DuDIthjL.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-loBdGw_i.js","assets/loopi-CNtmi9FU.js","assets/loopi-C09I2mNj.css","assets/segmented-styles-Cqb91xsn.js","assets/settings-form-draft-Dy10ldo8.js","assets/sliding-tab-list-CmcrqRzN.js","assets/model-selector-C-CqPBao.js","assets/open-capability-settings-DQsmJxI7.js","assets/model-sort-_Tz8s_4N.js","assets/settings-advanced-section-B-H1gYOs.js","assets/settings-mode-store-YH60sibB.js","assets/middleware-Pd0e8Igk.js","assets/number-input-El7Szeln.js","assets/settings-page-header-DEZZ8D0S.js","assets/external-link-DjqjBmc3.js","assets/sparkles-DHlfQFAF.js","assets/settings-page-layout-De2j64Lo.js","assets/settings-form-section-num14vSv.js","assets/pencil-DmIY3Oa-.js","assets/use-autosave-N_SjHXTw.js","assets/circle-alert-BEjgurr2.js","assets/loader-circle-CifKLtgG.js","assets/settings-advanced-gate-Cvx7DnU8.js","assets/usage-page-DL2fmeOh.js","assets/bot-DjLkhyZL.js","assets/gauge-C78eD2BA.js","assets/refresh-cw-BRlGaq2w.js","assets/timer-rCwGHjuO.js","assets/xopc-cloud-account-card-Q_jezTUy.js","assets/cloud-C4-yfnnk.js","assets/triangle-alert-2JXFNNKU.js","assets/cloud-credits-B-nbtkqv.js","assets/automations-page-CVjgENMO.js","assets/automations-workspace-CGPWyL0P.js","assets/activity-YogQEteU.js","assets/arrow-left-D880xG-P.js","assets/automation-display-DaVDNZz8.js","assets/automation-run-list-BmYeWB_N.js","assets/automation-api-DxBmyzp0.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/markdown-view-BlxIaCCQ.js","assets/file-image-CDUPkZvG.js","assets/app-link-DImAfVs5.js","assets/product-delivery-BFfqdKLe.js","assets/local-apps-DeqzkJiF.js","assets/copy-to-clipboard-HOJ79TWv.js","assets/xml-_d7dTN2Q.js","assets/mermaid-render-oOellPHt.js","assets/markdown-view-DG8DDkEA.css","assets/pause-DuPxgSxk.js","assets/play-kxZvpBg8.js","assets/shield-check-BU58siTV.js","assets/square-pen-B8FsvqNu.js","assets/api-B4FJ51EC.js","assets/tasks-BTLabOMp.js","assets/specialists-xbB3xL9e.js","assets/files-BNL4kkSB.js","assets/session-manager-D2LaQymu.js","assets/constants-DpkUgykJ.js","assets/local-session-drafts-BIBHRkpM.js","assets/tool-activity-BtJkgjFf.js","assets/attachment-utils-core-BIOUBrpT.js","assets/gateway-realtime-DIs1pjkQ.js","assets/gateway-realtime-store-sx7B8kdC.js","assets/agents-admin-api-D0N09mqJ.js","assets/page-header-store-Bm8oxpFR.js","assets/refresh-button-DiWdGAaX.js","assets/dist-ZrL34Ps4.js","assets/automation-task-card-CiJmJ7_h.js","assets/date-picker-XnE3iFhG.js","assets/calendar-days-hw_Y-g-s.js","assets/chevron-left-DqFhpbvK.js","assets/time-picker-C1PXAXZF.js","assets/agent-display-names-Bje7vfSn.js","assets/automation-result-state-CAsqgMNR.js","assets/date-time-picker-VGKm0HVn.js","assets/routine-panel-CXs4PjW0.js","assets/capabilities-DB713nRi.js","assets/workspace-preview-store-Do31QQH5.js","assets/capabilities-DDqDvCBs.js","assets/right-workspace-store-HPw7Gw0n.js","assets/phone-workspace-store-Ltrevdsx.js","assets/workspace-editor-agent-store-DVPJcbuE.js","assets/task-result-evidence-CSJeB9AH.js","assets/file-text-D12HbeVy.js","assets/activity-store-CQHh48Zf.js","assets/shares-api-Dm07CnXw.js","assets/home-page-BPPe4JXB.js","assets/circle-pause-CN9jYH2s.js","assets/history-DXH_9jsE.js","assets/paperclip-f1HujQY1.js","assets/composer-payload-handoff-Dc43dgSg.js","assets/mic-CuUb7zc-.js","assets/rotate-ccw-JM1TBLpp.js","assets/voice-input-shortcut-events-CEeFBhp3.js","assets/use-realtime-voice-C7iWQuUv.js","assets/voice-CDlC6XMH.js","assets/composer-notifications-CqV6Xj-H.js","assets/use-composer-attachments-CO7XLI4x.js","assets/file-BqMS_3DT.js","assets/use-file-preview-expanded-BXXeXnT0.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/app-chrome-BeB4KgOf.js","assets/electron-env-DHOGevH3.js","assets/use-async-resource-BHFGZCY2.js","assets/workspace-api-LghfbP5g.js","assets/index.module-Cd9ENXfk.js","assets/share-link-dialog-C1t_HB6f.js","assets/globe-DSSGFWFn.js","assets/copy-text-row-CpiRzq4G.js","assets/skill-wire-pattern-BPpeIcCi.js","assets/file-preview-surface-i5UOFnQF.js","assets/date-formatters-DukWSVwc.js","assets/tab-completion-input-CxtEp0aP.js","assets/task-detail-page-_5TEldtl.js","assets/chat-page-BhPw56Vc.js","assets/arrow-up-right-T72JbQ1Q.js","assets/arrow-up-D5ZtR1QT.js","assets/product-automation-feedback-D51I7Lg3.js","assets/notes-api-CdXA-g9r.js","assets/chat-chart-block-stPJEZ90.js","assets/volume-2-BSJhAY97.js","assets/earth-C9Z4bTTG.js","assets/working-directory-picker-modal-BGZduAXV.js","assets/file-archive-DanfQJNe.js","assets/new-chat-navigation-B6NPQ4h4.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-DxSv1wS2.js","assets/secret-input-DsjfQmDn.js","assets/is-masked-secret-DOkL5b_X.js","assets/connectors-api-CTuVWwBf.js","assets/oauth-provider-connect-D63M8Iv7.js","assets/models-hub-cache-Bgh3Gfgl.js","assets/oauth-api-B560CHeD.js","assets/connection-usage-guide-Cibh2lrV.js","assets/connection-usage-BhdQRWgQ.js","assets/smartphone-DSSsQFqA.js","assets/square-DMK_fB-3.js","assets/wrench-DFb4r8bH.js","assets/new-session-preferences-gb411vZP.js","assets/composer-model-config-control-DAagrRx_.js","assets/chunk-D32TOXHM-DQIy-Baq.js","assets/linkify-it-BkqEorO0.js","assets/tool-friendly-title-CP35P4VA.js","assets/voice-call-context-BM2A4bLz.js","assets/extension-provider-BPIoHw4r.js","assets/theme-store-BaWep_o7.js","assets/extension-message-router-C9JDpo_7.js","assets/use-directory-picker-C4p7AgWY.js","assets/confirm-dialog-DrA5mTQp.js","assets/command-palette-api-CP0F6sIm.js","assets/skill-list-api-1o_YRCu9.js","assets/skill-api-utils-C7V4JVXM.js","assets/dev-view-store-B8fGILny.js","assets/extension-iframe-host-DIH4TcdH.js","assets/extension-authoritative-grants-BfL8dMBf.js","assets/runtime-health-zDkHcOZO.js","assets/api-B1J5ajiP.js","assets/terminal-panel-store-Du53Upr2.js","assets/agents-app-path-ciChvpCS.js","assets/use-media-query-ady-FgjK.js","assets/oauth-authorization-window-o6URRos4.js","assets/page-context-draft-Cr5GqS2D.js","assets/management-api-B5w5DdXH.js","assets/side-chat-shortcut-BIw-1TTD.js","assets/chat-page-zQeUaawJ.css","assets/page-context-capture-button-Dibmspef.js","assets/dependency-picker-XjPB8FJS.js","assets/projects-page-C6Pt6OdT.js","assets/arrow-right-DSSvoX71.js","assets/project-understanding-Cg8WbBNB.js","assets/project-detail-page-CNFuzmRr.js","assets/resource-unavailable-BRKhKJA0.js","assets/discussion-annotation-sync-fwPPMPv9.js","assets/workspace-open-location-menu-CvZxU9de.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-NffP-UXC.js","assets/with-selector-xonYxPoM.js","assets/project-overview-model-DrLXaO-t.js","assets/directory-picker-path-field-ByDqf5fE.js","assets/skill-api-BV8oFqeE.js","assets/skill-reload-api-fGsO9Y86.js","assets/note-detail-panel-BbHlfAju.js","assets/code-xml-DJtYhZUF.js","assets/sliders-horizontal-DqsYor6I.js","assets/note-image-lightbox-CqK_uJ6Y.js","assets/project-detail-page-DLioOiRN.css","assets/notes-page-8w2Stfak.js","assets/recording-upload-CyZSl2DJ.js","assets/capabilities-page-D2hq4cgE.js","assets/product-navigation-Dp-adLY_.js","assets/capability-links-MZdYfPKx.js","assets/capability-header-actions-BxMYfQ8y.js","assets/user-model-page-D2FHjLi7.js","assets/understanding-refresh-store-CdEfR40A.js","assets/briefcase-business-BsoCaI_t.js","assets/understanding-activity-store-BFc8PamJ.js","assets/logs-page-CMW34T31.js","assets/sliding-segmented-CgQ3BFdb.js","assets/settings-page-BHImcF1q.js","assets/browser-settings-page-CGcgZOWh.js","assets/cpu-B247669f.js","assets/info-CDrmIZhb.js","assets/plug-zap-L8NMe3Sv.js","assets/settings-loading-skeleton-CAoOV17i.js","assets/phone-settings-page-vD0bTcHj.js","assets/beta-badge-BnzdzIEl.js","assets/global-defaults-api-BpDMnJe7.js","assets/phone-model-picker-BOv3mb_F.js","assets/phone-dependencies-card-flTci8mm.js","assets/runtime-tools-api-Dd8a07eo.js","assets/phone-model-connection-Vi_Swyv6.js","assets/providers-api-Nytkkop9.js","assets/mobile-pair-qr-CuIbmw5x.js","assets/browser-BLJWD7WI.js","assets/computer-settings-page-f-vcEpeF.js","assets/mouse-pointer-2-DZ51Onvj.js","assets/extension-page-CLDoL5N8.js","assets/extension-settings-page-BO_UKeG8.js","assets/voice-config-api-DhJ3l8fk.js","assets/voice-api-key-field-B_GApUQP.js","assets/schema-form-C9TYGa0_.js","assets/secret-input-labels-B5Jl5HqK.js","assets/extension-debug-page-BPwRrP3L.js","assets/share-preview-page-fV5USZb1.js","assets/local-apps-page-BI3Be5qo.js","assets/box-DvYoGszj.js","assets/local-app-workbench-page-D8oqDDAn.js","assets/power-off-CwwQ7Gp7.js","assets/power-ZI-pBczI.js","assets/product-open-page-BO8lUvw3.js","assets/open-route-MyZ2sB9C.js","assets/work-discovery-page-BM1HsYz6.js","assets/service-recommendation-list-DDlMyPvC.js","assets/package-wATCyihJ.js","assets/server-BlHCBjiE.js","assets/agent-plugin-dialog-CikzCYAG.js","assets/capability-icon-CmvCZOJX.js","assets/extension-marketplace-api-BIzkukYp.js","assets/work-discovery-overlay-UvWbDUXi.js","assets/brand-logo-CgT9zQfr.js","assets/setup-status-panel-DGAAczL-.js","assets/stethoscope-DRqTAtjD.js","assets/appearance-settings-Du5JLyV1.js","assets/preference-select-fields-D1pZekPs.js","assets/keyboard-shortcuts-settings-CnAV96nr.js","assets/personal-settings-panel-peD05ktj.js","assets/voice-settings-BiqJ0tlf.js","assets/capability-navigation-QtHJxxW2.js","assets/use-personal-profile-C1vqD9yV.js","assets/personal-profile-settings-CQhZjoK6.js","assets/personal-avatar-BMRVyTrE.js","assets/personal-avatar-BUCb7OiW.css","assets/system-settings-panel-CUI6QHEP.js","assets/browser-notification-delivery-DmE2FgGc.js","assets/shield-B1sI_cxl.js","assets/desktop-pet-settings-6O77QXGo.js","assets/wand-sparkles-CkSL-3Fy.js","assets/desktop-pet-sprite-D5YYq2zC.js","assets/desktop-pet-sprite-BuB0g8zv.css","assets/app-management-settings-panel-BHlUDZOG.js","assets/capabilities-settings-panel-CvF8VRTv.js","assets/connected-providers-grid-CZ-FXxaW.js","assets/navigation-ByOzYT0t.js","assets/image-generation-api-sbtx4NiC.js","assets/gateway-settings-ClcCloqQ.js","assets/network-BUQLY1BV.js","assets/gateway-restart-DTmlcJps.js","assets/runtime-tools-settings-panel-CvHQoqHu.js","assets/remote-access-hub-DePwafOK.js","assets/tunnel-api-Iz7JCBt3.js","assets/shares-settings-sl40lqND.js","assets/use-workspace-tree-D27u-eoX.js","assets/agent-defaults-settings-panel-By2Q-6JS.js","assets/puzzle-BptcPjKI.js","assets/management-settings-DfcMIqbQ.js","assets/shield-off-2jsucUds.js","assets/device-pairing-wizard-qtUvtdDT.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-DQEq_VJS.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,78,79])),n=()=>e(()=>import(`./usage-page-DL2fmeOh.js`),__vite__mapDeps([80,1,2,3,4,5,6,81,11,25,26,21,22,27,28,8,9,29,30,31,77,33,34,82,83,84,48,52,62,56,70,71,72,73,85,86,87,88,23])),r=()=>e(()=>import(`./automations-page-CVjgENMO.js`),__vite__mapDeps([89,2,1,90,4,3,5,6,7,8,9,91,11,92,93,94,21,22,27,48,95,26,96,97,25,28,29,30,31,77,98,99,100,101,14,102,78,103,35,104,41,45,105,106,23,107,108,109,110,111,15,112,75,113,83,42,114,72,115,44,20,116,117,118,119,46,47,120,121,122,123,124,125,126,51,127,49,50,52,128,62,56,129,130,63,18,64,53,54,65,131,132,133,134,135,13,136,137,138,139,140,141,142,143,144,145,146,71,147,148,149])),i=()=>e(()=>import(`./home-page-BPPe4JXB.js`),__vite__mapDeps([150,1,2,4,3,5,6,7,8,9,93,11,26,96,97,77,98,151,13,71,152,103,35,104,41,45,21,22,105,106,23,107,108,109,110,111,15,153,83,42,18,72,27,140,117,118,122,48,141,142,143,144,145,52,28,29,30,154,155,156,64,53,157,68,158,159,120,121,46,47,123,124,125,126,51,127,49,160,148,128,95,161,134,162,163,164,99,100,101,36,165,78,166,39,75,167,168,169,170,171,62,56,172,119,173,130,174,25,31,175,176,177,178,149,179,139,146,147,180])),a=()=>e(()=>import(`./task-detail-page-_5TEldtl.js`),__vite__mapDeps([181,1,2,3,4,5,6,7,8,9,182,11,164,24,92,183,184,185,91,81,98,151,13,71,186,35,103,104,41,45,21,22,105,106,23,107,108,109,110,111,187,26,99,27,78,16,112,113,156,167,72,87,188,20,48,52,95,189,96,97,190,191,53,54,61,25,28,29,30,31,77,192,193,32,194,34,100,162,147,195,36,196,163,101,165,166,39,153,75,83,168,42,121,46,47,124,160,148,169,170,171,62,56,172,119,173,130,14,175,152,197,198,199,200,201,155,202,203,204,205,206,49,207,86,208,51,209,210,211,18,43,114,212,213,44,174,176,214,117,118,116,120,122,123,125,126,127,215,216,63,64,65,141,140,142,143,144,145,50,68,154,157,217,218,219,158,159,220,128,58,59,221,222,223,57,177,161,134,178,149,224,225,226,227,228,131,93,15,132,133,135,229,230,231,232,233,234,235,136,236,237,238,239,240,241,179,138,146,242,243])),o=()=>e(()=>import(`./projects-page-C6Pt6OdT.js`),__vite__mapDeps([244,1,2,3,4,5,6,7,8,9,24,11,245,190,191,78,21,22,52,53,54,61,25,26,27,28,29,30,31,195,36,40,41,156,42,45,116,23,117,118,119,128,246,48,224,179])),s=()=>e(()=>import(`./project-detail-page-CNFuzmRr.js`),__vite__mapDeps([247,1,2,3,4,5,6,248,7,8,9,24,11,249,96,52,21,22,92,245,185,91,81,98,151,13,71,186,35,103,104,41,45,105,106,23,107,108,109,110,111,187,26,99,27,78,16,112,113,156,167,72,87,188,20,48,95,93,134,97,190,191,53,54,61,25,28,29,30,31,77,192,32,194,250,36,160,148,170,251,100,162,147,196,163,164,101,165,166,39,153,75,83,168,42,121,46,47,124,169,171,62,56,172,119,173,130,14,152,252,38,199,253,155,254,40,43,114,213,255,256,44,257,258,117,118,116,141,140,122,142,143,144,145,127,49,55,128,246,161,174,175,176,177,178,149,225,129,259,222,68,226,227,228,132,133,136,260,261,76,179,262,224,263,264,90,94,102,15,115,120,123,125,126,51,50,63,18,64,65,131,135,137,138,139,146,242,238,265,266,267,207,86,208,209,268,243,269])),c=()=>e(()=>import(`./notes-page-8w2Stfak.js`),__vite__mapDeps([270,1,2,3,4,5,6,24,11,249,96,52,9,21,22,92,245,184,185,91,81,98,151,13,71,186,7,8,35,103,104,41,45,105,106,23,107,108,109,110,111,187,26,99,27,78,16,112,113,156,167,72,87,188,20,48,95,133,25,28,29,30,31,100,147,196,271,155,153,42,44,257,169,128,62,56,225,173,130,265,266,101,152,15,75,83,267,115,213,120,121,46,47,122,123,124,125,126,51,127,49,222,68,149,207,86,170,208,209,238,268,242,142,140,117,118])),l=()=>e(()=>import(`./capabilities-page-D2hq4cgE.js`),__vite__mapDeps([272,1,2,4,3,5,6,27,21,22,273,128,274,211,275,42,11,52,9,28,8,29,30,236])),u=()=>e(()=>import(`./user-model-page-D2FHjLi7.js`),__vite__mapDeps([276,1,2,3,4,5,6,7,8,9,189,11,81,277,48,278,133,26,96,97,25,21,22,27,28,29,30,31,77,98,13,34,35,100,279,36,14,200,78,253,15,75,41,83,42,114,267,72,255,44,257,258,45,52,169,55,53,56,128,58,59,62,130,132,134])),d=()=>e(()=>import(`./logs-page-CMW34T31.js`),__vite__mapDeps([280,1,2,3,4,5,6,7,8,9,96,11,25,26,21,22,27,28,29,30,31,281,56,60,35,147,196,82,102,83,42,19,45,46,23,47,125,126,52,108,54,129,70,71,72,73,138,132,133,134,97,135,13])),f=()=>e(()=>import(`./settings-page-BHImcF1q.js`),__vite__mapDeps([282,1,2,3,4,5,6])),p=()=>e(()=>import(`./browser-settings-page-CGcgZOWh.js`),__vite__mapDeps([283,1,2,3,4,5,6,96,11,25,26,21,22,27,28,8,9,29,30,31,98,284,35,71,101,36,82,175,285,78,253,286,83,18,87,48,49,52,61,287,69,70,72,73,76,77])),m=()=>e(()=>import(`./phone-settings-page-vD0bTcHj.js`),__vite__mapDeps([288,1,2,3,4,5,6,7,8,9,164,11,96,25,26,21,22,27,28,29,30,31,289,113,41,83,42,114,212,45,48,52,144,130,290,49,70,71,72,291,65,292,98,35,214,293,294,92,64,295,51,47,205,208,296,297])),h=()=>e(()=>import(`./computer-settings-page-f-vcEpeF.js`),__vite__mapDeps([298,1,2,3,4,5,6,26,11,175,202,299,41,114,213,27,21,22,48,49,51,47,52,9,170,63,25,28,8,29,30,31,18,64,53,54,65,290,70,71,72,73])),g=()=>e(()=>import(`./extension-page-CLDoL5N8.js`),__vite__mapDeps([300,1,2,3,4,248,5,6,128,221,48,125,23,126,222,68,223,107,120,121,46,47,122,123,124,51,127,49,140,117,118,148,230,7,8,9,27,21,22,61,231,25,11,26,28,29,30,31])),_=()=>e(()=>import(`./extension-settings-page-BO_UKeG8.js`),__vite__mapDeps([301,1,2,3,4,5,6,248,25,11,26,21,22,27,28,8,9,29,30,31,48,52,54,221,125,23,126,222,68,223,107,120,121,46,47,122,123,124,51,127,49,140,117,118,148,65,230,7,61,231,287,70,71,72,73,76,77,78,302,159,303,204,98,99,101,108,53,205,304,305,69])),v=()=>e(()=>import(`./extension-debug-page-BPwRrP3L.js`),__vite__mapDeps([306,1,2,5,6,221,48,125,23,126,222,68,223,107,120,121,46,47,122,123,124,51,4,127,49,140,117,118,148,70,3,71,11,72,21,22,52,9,73])),y=()=>e(()=>import(`./share-preview-page-fV5USZb1.js`),__vite__mapDeps([307,1,2,4,3,5,6,163,11,164,26,96,99,35,100,71,101,36,165,78,103,7,8,9,104,41,45,21,22,105,106,23,107,108,109,110,111,166,39,153,75,83,167,168,42,27,121,46,47,124,53,160,148,169,170,171,62,56,172,119,173,130,29,30,52,187])),b=()=>e(()=>import(`./local-apps-page-BI3Be5qo.js`),__vite__mapDeps([308,1,2,3,4,5,6,245,11,309,41,27,21,22,48,52,9,128,233])),x=()=>e(()=>import(`./local-app-workbench-page-D8oqDDAn.js`),__vite__mapDeps([310,1,2,3,4,5,6,248,7,8,9,92,11,26,25,21,22,27,28,29,30,31,98,193,13,71,311,195,152,78,254,312,83,156,114,72,44,87,45,107,23,48,52,222,68,128,223,120,121,46,47,122,123,124,125,126,51,127,49,140,117,118,148,231,232,233,179,180,242,147,142,130,238])),S=()=>e(()=>import(`./product-open-page-BO8lUvw3.js`),__vite__mapDeps([313,2,1,3,4,5,6,27,21,22,106,23,107,48,233,314])),C=()=>e(()=>import(`./work-discovery-page-BM1HsYz6.js`).then(e=>e.n),__vite__mapDeps([315,1,2,3,4,5,6,11,316,7,8,9,96,190,191,78,21,22,52,53,54,61,98,197,203,25,26,27,28,29,30,31,71,204,99,101,108,205,45,206,49,48,170,207,86,208,51,47,209,210,72,211,317,41,318,319,92,77,32,36,114,257,274,297,320,321,133,97,13,34,279,147,14,200,201,286,58,59,224])),w=()=>e(()=>import(`./work-discovery-overlay-UvWbDUXi.js`),__vite__mapDeps([322,1,2,5,6,7,8,9,315,3,4,11,316,96,190,191,78,21,22,52,53,54,61,98,197,203,25,26,27,28,29,30,31,71,204,99,101,108,205,45,206,49,48,170,207,86,208,51,47,209,210,72,211,317,41,318,319,92,77,32,36,114,257,274,297,320,321,133,97,13,34,279,147,14,200,201,286,58,59,224,323])),T=()=>e(()=>import(`./setup-status-panel-DGAAczL-.js`),__vite__mapDeps([324,1,2,3,4,5,6,91,11,97,98,193,32,285,78,83,325,87,21,22,27,48,49,126,51,47,52,9,53,205,170,227,228,287,295,208,70,71,72,73,74,75,79,67,68,293])),E=()=>e(()=>import(`./appearance-settings-Du5JLyV1.js`),__vite__mapDeps([326,1,2,5,6,25,11,26,21,22,27,28,8,9,29,30,31,49,48,53,327,68,54,222,229,70,3,4,71,72,52,73,79,67])),D=()=>e(()=>import(`./keyboard-shortcuts-settings-CnAV96nr.js`),__vite__mapDeps([328,1,2,5,6,21,22,170,157,68,240,70,3,4,71,11,72,52,9,73])),O=()=>e(()=>import(`./personal-settings-panel-peD05ktj.js`),__vite__mapDeps([329,1,2,5,6,25,11,26,21,22,27,28,8,9,29,30,31,120,23,121,46,47,122,123,124,125,126,51,4,127,49,48,330,3,204,98,99,101,78,108,53,54,205,155,113,213,188,159,52,64,158,68,160,148,220,305,65,63,18,287,331,69,76,77,302,303,332,70,71,72,73,333,257,216,92,96,97,156,57,58,59,334,335])),k=()=>e(()=>import(`./system-settings-panel-CUI6QHEP.js`),__vite__mapDeps([336,1,2,5,6,337,11,170,71,83,338,21,22,53,61,70,3,4,72,52,9,73,74,75])),A=()=>e(()=>import(`./desktop-pet-settings-6O77QXGo.js`),__vite__mapDeps([339,1,2,3,4,5,6,248,96,11,25,26,21,22,27,28,8,9,29,30,31,77,71,166,340,156,53,170,129,83,52,341,342,70,72,73])),j=()=>e(()=>import(`./app-management-settings-panel-BHlUDZOG.js`),__vite__mapDeps([343,1,2,5,6,7,8,9,99,11,78,317,21,22,27,48,52,31,108,53,170,61,287,70,3,4,71,72,73,74,75])),M=()=>e(()=>import(`./capabilities-settings-panel-CvF8VRTv.js`),__vite__mapDeps([344,1,2,4,3,5,6,7,8,9,245,11,183,97,25,26,21,22,27,28,29,30,31,98,345,134,204,99,101,78,108,53,54,205,175,41,42,18,45,48,49,51,47,52,305,62,56,65,331,208,295,207,86,170,209,71,252,197,75,17,83,114,267,44,87,214,159,23,64,330,155,113,213,188,158,120,121,46,122,123,124,125,126,127,68,160,148,220,63,287,69,76,77,302,303,346,61,225,235,290,66,67,237,70,72,73,74,347,85,88])),N=()=>e(()=>import(`./gateway-settings-ClcCloqQ.js`),__vite__mapDeps([348,1,2,3,4,5,6,25,11,26,21,22,27,28,8,9,29,30,31,77,204,98,99,101,78,108,53,54,205,285,197,349,83,167,350,86,202,75,114,48,52,170,338,267,87,49,305,346,55,56,61,225,7,67,68,287,66,69,70,71,72,73,74,79])),P=()=>e(()=>import(`./runtime-tools-settings-panel-CvHQoqHu.js`),__vite__mapDeps([351,1,2,5,6,25,11,26,21,22,27,28,8,9,29,30,31,77,98,35,156,48,52,129,83,287,70,3,4,71,72,73,79,67,68,293,292,96,214])),F=()=>e(()=>import(`./remote-access-hub-DePwafOK.js`),__vite__mapDeps([352,1,2,3,4,5,6,7,8,9,245,11,26,96,97,32,99,71,204,98,101,78,21,22,108,53,54,205,175,197,349,312,318,338,212,19,87,48,49,52,31,55,56,61,225,176,29,30,67,68,295,51,47,208,209,170,66,237,70,72,73,74,75,353,27,346,79])),I=()=>e(()=>import(`./shares-settings-sl40lqND.js`),__vite__mapDeps([354,1,2,3,4,5,6,7,8,9,26,11,96,25,21,22,27,28,29,30,31,194,86,99,251,97,100,191,162,104,147,36,196,53,170,152,78,16,41,83,255,44,174,71,175,45,52,176,108,48,49,127,54,55,56,61,225,149,355,172,119,23,145,136,287,207,98,208,51,47,209,69,70,72,73,74,75])),L=()=>e(()=>import(`./agent-defaults-settings-panel-By2Q-6JS.js`),__vite__mapDeps([356,1,2,3,4,5,6,98,11,82,199,357,42,114,267,21,22,27,88,23,48,52,9,170,62,56,227,228,67,68,290,49,66,69,70,71,72,73,76,26,77,78])),R=()=>e(()=>import(`./management-settings-DfcMIqbQ.js`),__vite__mapDeps([358,1,2,3,4,5,6,7,8,9,91,11,134,97,25,26,21,22,27,28,29,30,31,198,359,41,42,212,45,46,23,47,48,52,55,53,56,225,129,83,173,287,239,70,71,72,73,360,98,13,35,361,105,106,107,171,176,99,108,209,170,237,353,175,78,312,49,54,346,74,75,296,297])),z=new Set;function B(e){z.has(e)||(z.add(e),e().catch(()=>{z.delete(e)}))}function V(e){let[t]=e.split(/[?#]/,1);return t||`/`}function H(e){B(f);let t=e.slice(10);if(t===`overview`)return B(T);if(t===`appearance`)return B(E);if(t===`keyboard-shortcuts`)return B(D);if(t===`personal`)return B(O);if(t===`system`)return B(k);if(t===`desktop-pet`)return B(A);if(t===`desktop-app`)return B(j);if(t.startsWith(`capabilities/`))return B(M);if(t===`gateway`)return B(N);if(t===`runtimes`)return B(P);if(t===`devices`)return B(R);if(t===`tunnel`||t===`remote-access`)return B(F);if(t===`shares`)return B(I);if(t===`agent-defaults`)return B(L);if(t===`agent-browser`)return B(p);if(t===`phone-use`)return B(m);if(t===`computer-use`)return B(h)}function U(e){if(!e.startsWith(`/`))return;let f=V(e);if(f===`/capabilities`||f.startsWith(`/capabilities/`))return B(l);if(f===`/user-model`)return B(u);if(f===`/automations`)return B(r);if(f===`/`)return B(i);if(f.startsWith(`/tasks/`))return B(a);if(f===`/projects`)return B(o);if(f.startsWith(`/projects/`))return B(s);if(f===`/notes`||f.startsWith(`/notes/`))return B(c);if(f.startsWith(`/extensions/`))return B(g);if(f===`/local-apps`)return B(b);if(f.startsWith(`/local-apps/`))return B(x);if(f===`/open`)return B(S);if(f===`/onboarding/workspace`)return B(C);if(f.startsWith(`/share/`))return B(y);if(f===`/settings/sessions`)return B(t);if(f===`/settings/usage`)return B(n);if(f===`/settings/logs`)return B(d);if(f===`/settings/extensions/debug`)return B(v);if(f.startsWith(`/settings/ext/`))return B(_);if(f.startsWith(`/settings/`))return H(f)}export{y as A,s as C,t as D,P as E,u as F,w as I,C as L,k as M,a as N,f as O,n as P,U as R,S,F as T,b as _,r as a,O as b,A as c,g as d,_ as f,x as g,D as h,E as i,I as j,T as k,R as l,i as m,L as n,M as o,N as p,j as r,h as s,p as t,v as u,d as v,o as w,m as x,c as y};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/workspace-file-preview-dialog-NffP-UXC.js","assets/rolldown-runtime-aKtaBQYM.js","assets/vendor-react-BOUWij0V.js","assets/locale-store-Dy1EByeG.js","assets/messages-BAnhwALN.js","assets/use-file-preview-expanded-BXXeXnT0.js","assets/preload-helper-Czpn1I53.js","assets/chunk-KS7C4IRE-CiwuuyV8.js","assets/createLucideIcon-DPHK1VkS.js","assets/app-window-DXFNqt_0.js","assets/check-DUBLcKHA.js","assets/chevron-down-ccbiQQz_.js","assets/copy-Dv6d4Dvw.js","assets/download-Dk-ZjtO6.js","assets/ellipsis-0k4rZLoy.js","assets/external-link-DjqjBmc3.js","assets/eye-CABVeTq0.js","assets/folder-open-CyzJ19I9.js","assets/link-2-D_ZKYUW7.js","assets/loader-circle-CifKLtgG.js","assets/markdown-view-BlxIaCCQ.js","assets/dist-CY7CS_D3.js","assets/es2015-DBLcMg5B.js","assets/dist-CxGUk8J-.js","assets/file-image-CDUPkZvG.js","assets/plus-Q2yW6OE7.js","assets/x-B_N4OPjy.js","assets/cn-0WouolD0.js","assets/bundle-mjs-rHxsej31.js","assets/app-link-DImAfVs5.js","assets/product-delivery-BFfqdKLe.js","assets/schemas-CCWMleym.js","assets/local-apps-DeqzkJiF.js","assets/copy-to-clipboard-HOJ79TWv.js","assets/xml-_d7dTN2Q.js","assets/mermaid-render-oOellPHt.js","assets/markdown-view-DG8DDkEA.css","assets/message-square-plus-XP0tGdlV.js","assets/minimize-2-DtOGrlpo.js","assets/paperclip-f1HujQY1.js","assets/pencil-DmIY3Oa-.js","assets/refresh-cw-BRlGaq2w.js","assets/rotate-cw-LIg3Am9S.js","assets/save-DRDABU--.js","assets/search-DA7gz22f.js","assets/skeleton-DzdOeGYz.js","assets/constants-DpkUgykJ.js","assets/session-api-BFiIYodK.js","assets/gateway-startup-retry-D6WPS0RW.js","assets/attachment-utils-core-BIOUBrpT.js","assets/interaction-BdhHBbYa.js","assets/composer-notifications-CqV6Xj-H.js","assets/activity-store-CQHh48Zf.js","assets/app-chrome-BeB4KgOf.js","assets/electron-env-DHOGevH3.js","assets/use-async-resource-BHFGZCY2.js","assets/sliding-tab-list-CmcrqRzN.js","assets/sliding-indicator-hwz0sx3h.js","assets/workspace-api-LghfbP5g.js","assets/files-BNL4kkSB.js","assets/index.module-Cd9ENXfk.js","assets/dist-ZrL34Ps4.js","assets/dist-BuHnPloF.js","assets/floating-ui.dom-seOukHzT.js","assets/share-link-dialog-C1t_HB6f.js","assets/popover-select-CLsphyzA.js","assets/dist-GJ8-1PAx.js","assets/settings-shell-dialog-layer-BU3UuiJr.js","assets/globe-DSSGFWFn.js","assets/button-Cc4hUNTt.js","assets/copy-text-row-CpiRzq4G.js","assets/right-workspace-store-HPw7Gw0n.js","assets/phone-workspace-store-Ltrevdsx.js","assets/theme-store-BaWep_o7.js","assets/middleware-Pd0e8Igk.js","assets/file-preview-surface-i5UOFnQF.js","assets/shares-api-Dm07CnXw.js"])))=>i.map(i=>d[i]);
2
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./preload-helper-Czpn1I53.js";import{l as a,t as o}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{i as s,o as c}from"./locale-store-Dy1EByeG.js";import{t as l}from"./messages-BAnhwALN.js";import{a as u,o as d,r as f,s as p,t as m}from"./dist-CY7CS_D3.js";import{i as h}from"./automation-display-DaVDNZz8.js";import{F as g}from"./markdown-view-BlxIaCCQ.js";import{t as _}from"./skeleton-DzdOeGYz.js";import{s as v}from"./tasks-BTLabOMp.js";import{c as y}from"./capabilities-DB713nRi.js";import{i as b}from"./vendor-swr-CdRzEUwF.js";import{a as x,g as S,u as C,x as w}from"./workspace-preview-store-Do31QQH5.js";import{t as T}from"./button-Cc4hUNTt.js";import{n as E,r as D,t as O}from"./task-result-evidence-CSJeB9AH.js";var k=e(t(),1),A=n();async function j(e,t=`en`){let n=await S(e),r=n.runs.filter(e=>!e.parentRunId).sort((e,t)=>t.queuedAt-e.queuedAt)[0];if(!n.allowedCommands.includes(`start`)||r?.status!==`failed`)throw Error(t===`zh`?`任务状态已变化,暂时无法重试。请刷新并查看当前状态。`:`Task is no longer available for retry. Refresh and review its current state.`);await C(e,{type:`start`,executor:v.parse({...r.executorRef,kind:r.executorKind})},n.task.version)}function M(e){let t=e.runs.filter(e=>!e.parentRunId).sort((e,t)=>t.queuedAt-e.queuedAt)[0],n=e.conversation?.currentExecutorAgentId??e.task.delegateAgentId,r=n?{kind:`agent`,agentId:n}:t?{...t.executorRef,kind:t.executorKind}:void 0,i=v.safeParse(r);return i.success?i.data:void 0}var N=r(),P=(0,k.lazy)(()=>i(()=>import(`./workspace-file-preview-dialog-NffP-UXC.js`).then(e=>e.n).then(e=>({default:e.WorkspaceFilePreviewPanel})),__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])));function F({taskId:e,language:t,onComplete:n,onUpdated:r}){let i=t===`zh`,s=a(),c=`${s.pathname}${s.search}`,[l,h]=(0,k.useState)(),[v,y]=(0,k.useState)(),[b,A]=(0,k.useState)(null),[j,F]=(0,k.useState)(),[I,L]=(0,k.useState)(!1),R=(0,k.useRef)(!1),z=(0,k.useRef)(0),[B,V]=(0,k.useState)(0);(0,k.useEffect)(()=>{h(void 0),F(void 0)},[e]),(0,k.useEffect)(()=>{let t=!0,n=++z.current;return y(void 0),S(e).then(e=>{t&&n===z.current&&!R.current&&h(e)}).catch(e=>{t&&n===z.current&&y(e instanceof Error?e.message:String(e))}),()=>{t=!1}},[e,B]),(0,k.useEffect)(()=>{let t=()=>{R.current||V(e=>e+1)},n=n=>{n.detail?.taskId===e&&t()};return window.addEventListener(`task-changed-v2`,n),window.addEventListener(`focus`,t),window.addEventListener(`realtime-gap`,t),window.addEventListener(`gateway-realtime-connected`,t),()=>{window.removeEventListener(`task-changed-v2`,n),window.removeEventListener(`focus`,t),window.removeEventListener(`realtime-gap`,t),window.removeEventListener(`gateway-realtime-connected`,t)}},[e]);let H=l?x(l):[],U=l?.task.phase===`review`&&l.allowedCommands.includes(`close`)&&l.waits.length===0&&H.length>0&&H.every(e=>e.status===`passed`),W=l?M(l):void 0,G=l?.allowedCommands.includes(`start`)&&l.waits.length===0&&W,K=e=>{z.current++,h(e),r?.(e)};async function q(e,t,r=!1){if(!R.current){R.current=!0,z.current++,L(!0),y(void 0);try{let a=await e();K(a);let o=r||l?.task.phase!==`closed`&&a.task.phase===`closed`&&a.task.resolution===`done`;F(o?i?`任务已验收完成。`:`Task accepted.`:t),o&&n()}catch(e){y(e instanceof Error?e.message:String(e))}finally{R.current=!1,L(!1)}}}let J=l?.receipts.filter(e=>l.runs.some(t=>t.id===e.runId&&t.contractVersion===l.task.latestContractVersion)).sort((e,t)=>t.finalizedAt-e.finalizedAt)[0],Y=H.filter(e=>e.status===`passed`).length,X=H.filter(e=>e.status===`failed`).length,Z=H.length-Y-X,Q=l?.task.contract?.acceptancePolicy===`verified_auto`,$=g(c,e);return(0,N.jsxs)(`section`,{className:`mt-4 space-y-4 rounded-xl border border-edge bg-surface-panel p-4`,"aria-label":i?`任务结果与处理`:`Task result and actions`,"aria-busy":I,children:[(0,N.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,N.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:i?`执行结果`:`Result`}),(0,N.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,N.jsx)(T,{variant:`ghost`,disabled:I,onClick:()=>V(e=>e+1),children:i?`刷新状态`:`Refresh status`}),(0,N.jsx)(o,{to:$,className:`inline-flex min-h-9 items-center text-xs font-medium text-accent-fg hover:underline`,children:i?`查看任务详情`:`Task details`})]})]}),v?(0,N.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:v}):null,I?(0,N.jsx)(`p`,{role:`status`,className:`text-xs text-fg-muted`,children:i?`正在处理…`:`Processing…`}):null,j?(0,N.jsx)(`p`,{role:`status`,className:`text-sm text-success`,children:j}):null,!l&&!v?(0,N.jsxs)(`div`,{className:`space-y-3`,"aria-busy":!0,children:[(0,N.jsx)(_,{className:`h-5 w-1/3`}),(0,N.jsx)(_,{className:`h-24 w-full`})]}):null,l?(0,N.jsxs)(N.Fragment,{children:[J?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`p`,{className:`text-xs text-fg-muted`,children:J.completionVerdict===`achieved`?i?`执行报告已达成目标,请结合依据逐项验收。`:`The run reports the goal achieved. Review the evidence before accepting.`:i?`当前为阶段性结果,尚有工作需要推进。`:`This is a partial result. More work is needed.`}),(0,N.jsx)(D,{content:J.summary,contentKey:`home:${e}:result:${J.runId}`,language:t,previewHeight:180}),J.remainingWork.length>0?(0,N.jsxs)(`div`,{className:`text-sm text-fg-muted`,children:[(0,N.jsx)(`p`,{className:`font-medium text-fg`,children:i?`尚待完成`:`Remaining work`}),(0,N.jsx)(`ul`,{className:`mt-1 list-disc space-y-1 pl-5`,children:J.remainingWork.map((e,t)=>(0,N.jsx)(`li`,{children:e},t))})]}):null,J.nextAction?(0,N.jsxs)(`p`,{className:`whitespace-pre-wrap text-sm text-fg-muted`,children:[(0,N.jsx)(`span`,{className:`font-medium text-fg`,children:i?`下一步:`:`Next step: `}),J.nextAction]}):null,J.judgment?(0,N.jsxs)(`div`,{className:`space-y-1 text-sm text-fg-muted`,children:[(0,N.jsx)(`p`,{className:`font-medium text-fg`,children:i?`判断依据`:`Assessment`}),(0,N.jsx)(`p`,{children:J.judgment.recommendation}),(0,N.jsx)(`ul`,{className:`list-disc space-y-1 pl-5`,children:J.judgment.reasons.map((e,t)=>(0,N.jsx)(`li`,{children:e},t))}),J.judgment.uncertainty?(0,N.jsxs)(`p`,{children:[i?`待确认:`:`Uncertainty: `,J.judgment.uncertainty]}):null]}):null,(0,N.jsx)(O,{evidence:J.evidence,projectId:l.task.projectId,conversationId:l.conversation?.activeConversationId,language:t,onOpenFile:A})]}):(0,N.jsx)(`p`,{className:`text-sm text-fg-muted`,children:i?`当前任务版本暂无执行结果,可先处理等待事项或查看执行进度。`:`No result for the current task version. Resolve pending items or view progress.`}),H.length>0?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(`h3`,{className:`text-sm font-semibold text-fg`,children:[i?`验收条件`:`Acceptance criteria`,` `,(0,N.jsxs)(`span`,{className:`font-normal text-fg-muted`,children:[Y,`/`,H.length]})]}),H.map((n,r)=>(0,N.jsxs)(`div`,{className:`space-y-2 border-t border-edge-subtle pt-3`,children:[(0,N.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-2`,children:[(0,N.jsxs)(`div`,{className:`min-w-0 flex-1 text-sm text-fg`,children:[(0,N.jsx)(`p`,{className:`break-words`,children:n.text}),(0,N.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:i?{passed:`已通过`,failed:`未通过`,unverified:`待判定`}[n.status]:{passed:`Passed`,failed:`Failed`,unverified:`Not reviewed`}[n.status]})]}),l.task.phase===`review`&&!Q?(0,N.jsx)(`div`,{className:`flex gap-2`,children:[`passed`,`failed`].map(t=>(0,N.jsx)(T,{variant:`secondary`,disabled:I||n.status===t,onClick:()=>void q(()=>w(e,r,t,l.task.version,l.task.latestContractVersion),i?`判定已保存。`:`Review saved.`),children:i?t===`passed`?`确认通过`:`未通过`:t===`passed`?`Mark passed`:`Mark failed`},t))}):null]}),n.note?(0,N.jsx)(`p`,{className:`whitespace-pre-wrap text-xs leading-5 text-fg-muted`,children:n.note}):null,n.review?.note?(0,N.jsx)(`p`,{className:`text-xs text-fg-muted`,children:n.review.note}):null,(0,N.jsx)(O,{evidence:n.evidence,projectId:l.task.projectId,conversationId:l.conversation?.activeConversationId,language:t,onOpenFile:A})]},r))]}):null,l.waits.length>0?(0,N.jsxs)(`div`,{className:`space-y-3`,children:[(0,N.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:i?`等待处理`:`Pending items`}),l.waits.map(t=>(0,N.jsx)(`div`,{children:l.allowedCommands.includes(`resolve_wait`)&&(t.kind===`user_input`||t.kind===`approval`&&typeof t.condition.capability==`string`)&&t.condition.type!==`connection`?(0,N.jsx)(E,{wait:t,detail:l,zh:i,onUpdated:K}):(0,N.jsxs)(`div`,{className:`rounded-lg bg-surface-hover p-3 text-sm text-fg-muted`,children:[(0,N.jsx)(`p`,{children:t.reason}),t.kind===`paused`&&l.allowedCommands.includes(`resolve_wait`)?(0,N.jsx)(T,{className:`mt-2`,disabled:I,onClick:()=>void q(()=>C(e,{type:`resolve_wait`,waitId:t.id},l.task.version),i?`已解除暂停,任务状态已更新。`:`Pause resolved. Task status updated.`),children:i?`恢复任务`:`Resume task`}):(0,N.jsx)(o,{to:typeof t.condition.dependsOnTaskId==`string`?g(c,t.condition.dependsOnTaskId):$,className:`mt-2 inline-flex min-h-9 items-center text-accent-fg hover:underline`,children:i?`查看并处理`:`View and resolve`})]})},t.id))]}):null,l.task.phase===`review`&&!U?(0,N.jsx)(`p`,{className:`text-xs leading-5 text-fg-muted`,children:i?`尚有 ${Z} 项待判定、${X} 项未通过、${l.waits.length} 项等待处理。${Q?`此任务需要执行验证;请继续执行以补齐依据和未完成项。`:`查看依据后逐项判定;未通过时可继续执行修正。`}`:`${Z} unreviewed, ${X} failed, ${l.waits.length} pending items. ${Q?`This task requires execution verification. Continue execution to supply missing evidence.`:`Review the evidence and mark each criterion; continue execution to fix failures.`}`}):null,(0,N.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[l.task.phase===`review`?(0,N.jsx)(T,{variant:`primary`,disabled:I||!U,onClick:()=>void q(()=>C(e,{type:`close`,resolution:`done`},l.task.version),i?`任务已验收完成。`:`Task accepted.`,!0),children:i?`验收完成`:`Accept task`}):null,G?(0,N.jsx)(T,{variant:U?`secondary`:`primary`,disabled:I,onClick:()=>void q(()=>C(e,{type:`start`,executor:W},l.task.version),i?`已开始执行,结果将自动更新。`:`Execution started. Results will update automatically.`),children:i?J?`继续执行并验证`:`开始执行`:J?`Continue and verify`:`Start execution`}):null]})]}):null,l&&b?(0,N.jsx)(m,{open:!0,onOpenChange:e=>{e||A(null)},children:(0,N.jsxs)(d,{children:[(0,N.jsx)(u,{className:`fixed inset-0 z-[80] bg-scrim`}),(0,N.jsxs)(f,{className:`app-main-surface fixed left-1/2 top-1/2 z-[90] flex h-[min(54rem,calc(100dvh-2rem))] w-[min(72rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-panel outline-none`,"aria-describedby":void 0,children:[(0,N.jsxs)(p,{className:`sr-only`,children:[i?`交付物预览`:`Artifact preview`,` · `,b]}),(0,N.jsx)(k.Suspense,{fallback:(0,N.jsxs)(`div`,{className:`flex-1 space-y-3 p-4`,"aria-busy":!0,children:[(0,N.jsx)(_,{className:`h-9 w-full`}),(0,N.jsx)(_,{className:`h-64 w-full`})]}),children:(0,N.jsx)(P,{filePath:b,projectId:l.task.projectId,conversationId:l.conversation?.activeConversationId,onClose:()=>A(null)})})]})]})}):null]})}function I(e){let t=(0,A.c)(37),{time:n,setTime:r,day:i,setDay:a,zone:o,setZone:s,until:c,setUntil:l,zh:u}=e,d=u?`执行日`:`Run day`,f;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(f=[1,2,3,4,5,6,0],t[0]=f):f=t[0];let p;t[1]!==i||t[2]!==a||t[3]!==u?(p=f.map(e=>(0,N.jsx)(T,{type:`button`,variant:i===e?`secondary`:`ghost`,"aria-pressed":i===e,onClick:()=>a(e),children:u?`周${[`日`,`一`,`二`,`三`,`四`,`五`,`六`][e]}`:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`][e]},e)),t[1]=i,t[2]=a,t[3]=u,t[4]=p):p=t[4];let m;t[5]!==d||t[6]!==p?(m=(0,N.jsx)(`div`,{className:`flex flex-wrap gap-1`,role:`group`,"aria-label":d,children:p}),t[5]=d,t[6]=p,t[7]=m):m=t[7];let h=u?`执行时间`:`Run time`,g;t[8]===r?g=t[9]:(g=e=>r(e.target.value),t[8]=r,t[9]=g);let _;t[10]!==g||t[11]!==n?(_=(0,N.jsx)(`input`,{className:`mt-1 w-full rounded border border-edge bg-surface-inset p-2 text-sm text-fg`,type:`time`,required:!0,value:n,onChange:g}),t[10]=g,t[11]=n,t[12]=_):_=t[12];let v;t[13]!==h||t[14]!==_?(v=(0,N.jsxs)(`label`,{className:`block text-xs text-fg-muted`,children:[h,_]}),t[13]=h,t[14]=_,t[15]=v):v=t[15];let y=u?`时区`:`Timezone`,b;t[16]===s?b=t[17]:(b=e=>s(e.target.value),t[16]=s,t[17]=b);let x;t[18]!==b||t[19]!==o?(x=(0,N.jsx)(`input`,{className:`mt-1 w-full rounded border border-edge bg-surface-inset p-2 text-sm text-fg`,required:!0,value:o,onChange:b}),t[18]=b,t[19]=o,t[20]=x):x=t[20];let S;t[21]!==x||t[22]!==y?(S=(0,N.jsxs)(`label`,{className:`block text-xs text-fg-muted`,children:[y,x]}),t[21]=x,t[22]=y,t[23]=S):S=t[23];let C=u?`先安排到这一天(UTC)`:`Continue through this date (UTC)`,w;t[24]===l?w=t[25]:(w=e=>l(e.target.value),t[24]=l,t[25]=w);let E;t[26]!==w||t[27]!==c?(E=(0,N.jsx)(`input`,{className:`mt-1 w-full rounded border border-edge bg-surface-inset p-2 text-sm text-fg`,type:`date`,required:!0,value:c,onChange:w}),t[26]=w,t[27]=c,t[28]=E):E=t[28];let D;t[29]!==C||t[30]!==E?(D=(0,N.jsxs)(`label`,{className:`block text-xs text-fg-muted`,children:[C,E]}),t[29]=C,t[30]=E,t[31]=D):D=t[31];let O;return t[32]!==S||t[33]!==D||t[34]!==m||t[35]!==v?(O=(0,N.jsxs)(`div`,{className:`space-y-3`,children:[m,v,S,D]}),t[32]=S,t[33]=D,t[34]=m,t[35]=v,t[36]=O):O=t[36],O}function L(e,t,n){let[r,i]=e.split(`:`);return{kind:`cron`,expr:`${i} ${r} * * ${t}`,tz:n}}function R(e){let t=(0,A.c)(24),{topicId:n,trial:r,onUpdated:i,language:a}=e,o=a===`zh`,[l,u]=(0,k.useState)(!1),[d,f]=(0,k.useState)(!1),[p,m]=(0,k.useState)(``),[h,g]=(0,k.useState)(`17:00`),[_,v]=(0,k.useState)(5),b;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(b=Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`,t[0]=b):b=t[0];let[x,S]=(0,k.useState)(b),C;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(C=new Date(Date.now()+7776e6).toISOString().slice(0,10),t[1]=C):C=t[1];let[w,E]=(0,k.useState)(C);if(!r.taskVersion)return null;let D;t[2]===l?D=t[3]:(D=()=>u(!l),t[2]=l,t[3]=D);let O=o?`以后也交给我`:`Make this recurring`,j;t[4]!==l||t[5]!==D||t[6]!==O?(j=(0,N.jsx)(T,{variant:`secondary`,"aria-expanded":l,onClick:D,children:O}),t[4]=l,t[5]=D,t[6]=O,t[7]=j):j=t[7];let M;t[8]!==d||t[9]!==_||t[10]!==p||t[11]!==i||t[12]!==l||t[13]!==h||t[14]!==n||t[15]!==r.taskId||t[16]!==r.taskVersion||t[17]!==w||t[18]!==o||t[19]!==x?(M=l?(0,N.jsxs)(`form`,{className:`mt-3 space-y-3 rounded-lg border border-edge p-3`,onSubmit:e=>{e.preventDefault(),f(!0),m(``),c(s(`/api/home/routines/adopt`),{method:`POST`,body:JSON.stringify({topicId:n,trialTaskId:r.taskId,expectedTaskVersion:r.taskVersion,idempotencyKey:crypto.randomUUID(),schedule:L(h,_,x),validUntil:Date.parse(`${w}T23:59:59Z`)})}).then(e=>{y.parse(e),u(!1),i()}).catch(e=>{m(e instanceof Error?e.message:String(e)),i()}).finally(()=>f(!1))},children:[(0,N.jsx)(`p`,{className:`text-sm text-fg`,children:o?`按这次确认的做法,定期给你一份私人草稿,不自动发送或发布。仅这一次的要求不会沿用;请先确认这次结果已通过检查。`:`Get a private draft on a recurring schedule using the approach you reviewed. Nothing is sent or published automatically. One-off requests will not carry over; the trial must pass its checks first.`}),(0,N.jsx)(I,{time:h,setTime:g,day:_,setDay:v,zone:x,setZone:S,until:w,setUntil:E,zh:o}),p?(0,N.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:p}):null,(0,N.jsx)(T,{type:`submit`,disabled:d,children:o?`确认,按这个安排开始`:`Confirm and start`})]}):null,t[8]=d,t[9]=_,t[10]=p,t[11]=i,t[12]=l,t[13]=h,t[14]=n,t[15]=r.taskId,t[16]=r.taskVersion,t[17]=w,t[18]=o,t[19]=x,t[20]=M):M=t[20];let P;return t[21]!==j||t[22]!==M?(P=(0,N.jsxs)(`div`,{className:`mt-2`,children:[j,M]}),t[21]=j,t[22]=M,t[23]=P):P=t[23],P}function z({routine:e,language:t,onUpdated:n}){let r=t===`zh`,[i,a]=(0,k.useState)(),[o,u]=(0,k.useState)(!1),[d,f]=(0,k.useState)(``),[p,m]=(0,k.useState)(),[g,_]=(0,k.useState)(!1),[v,b]=(0,k.useState)(!1),x=e.schedule?.kind===`cron`?e.schedule.expr.split(/\s+/):[],[S,C]=(0,k.useState)(x.length===5?`${x[1].padStart(2,`0`)}:${x[0].padStart(2,`0`)}`:`17:00`),[w,E]=(0,k.useState)(x.length===5?Number(x[4]):5),[D,O]=(0,k.useState)(e.schedule?.kind===`cron`&&e.schedule.tz||`UTC`),[A,j]=(0,k.useState)(new Date(e.validUntil).toISOString().slice(0,10)),M=i&&i.revision>e.revision?i:e,P=e=>{o||(u(!0),f(``),c(s(`/api/home/routines/${encodeURIComponent(M.id)}/command`),{method:`POST`,body:JSON.stringify({expectedRevision:M.revision,idempotencyKey:crypto.randomUUID(),command:e})}).then(e=>{a(y.parse(e)),n()}).catch(e=>{f(e instanceof Error?e.message:String(e)),n()}).finally(()=>u(!1)))},R=M.status===`active`?r?`按计划进行`:`Scheduled`:M.status===`paused`?r?`已暂停`:`Paused`:r?`已结束`:`Ended`,z=l(t),B=M.schedule?h({kind:`schedule`,schedule:M.schedule},z.automations,z.cron,t):r?`执行时间待确认`:`Schedule needs review`,V=M.executions[0],H=M.status===`ended`?void 0:M.methods.find(e=>e.baseVersion===M.adoptedVersion&&[`candidate`,`validating`].includes(e.status)),U=(e,t)=>[`queued`,`running`,`waiting`].includes(e)?r?`正在准备这次结果`:`Preparing this result`:e===`succeeded`&&t===`achieved`?r?`结果已完成,可以查看`:`The result is ready to review`:[`failed`,`timeout`].includes(e)?r?`这次没能完成,看看哪里需要调整`:`This attempt needs attention`:e===`cancelled`?r?`这次执行已取消`:`This run was cancelled`:r?`结果还需要确认`:`The result needs review`,W=e=>({candidate:r?`待尝试`:`Ready to try`,validating:r?`检查改进效果`:`Checking the improvement`,validated:r?`已检查`:`Checked`,approved:r?`已采用`:`Adopted`,rejected:r?`未采用`:`Not adopted`})[e]??(r?`待确认`:`Needs review`);return(0,N.jsxs)(`section`,{className:`mt-3 space-y-3 rounded-lg border border-edge p-3`,"aria-label":r?`托管与方法改进`:`Routine and method improvements`,children:[(0,N.jsx)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:(0,N.jsxs)(`h3`,{className:`text-sm font-semibold text-fg`,children:[M.title,` · `,R]})}),(0,N.jsxs)(`p`,{className:`text-sm text-fg-muted`,children:[B,` · `,r?`安排至`:`Until`,` `,new Date(M.validUntil).toLocaleDateString(r?`zh-CN`:`en-US`)]}),V?(0,N.jsxs)(`div`,{className:`space-y-2`,children:[(0,N.jsx)(`p`,{className:`text-sm text-fg`,children:U(V.status,V.verdict)}),(0,N.jsx)(T,{variant:`primary`,onClick:()=>m(V.taskId),children:r?`查看这次结果`:`Review this result`})]}):(0,N.jsx)(`p`,{className:`text-sm text-fg-muted`,children:M.status===`active`?r?`到约定时间就开始,结果会显示在这里。`:`I will start at the agreed time and show the result here.`:r?`已有结果会保留,恢复后再按计划继续。`:`Past results are kept. Resume to continue the schedule.`}),(0,N.jsx)(`p`,{className:`text-xs text-fg-muted`,children:r?`每次先给你一份私人草稿。`:`Each run produces a private draft for you.`}),H?(0,N.jsxs)(`div`,{className:`space-y-2 rounded-lg bg-surface-inset p-3`,children:[(0,N.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:r?`根据你的反馈,我准备这样改进`:`An improvement based on your feedback`}),H.additions.map((e,t)=>(0,N.jsx)(`p`,{className:`text-sm text-fg-muted`,children:e},t)),(0,N.jsx)(`p`,{className:`text-xs text-fg-muted`,children:H.validation===`failed`?r?`这次改进没通过检查,继续沿用原来的做法。`:`The improvement did not pass its checks. The current approach stays in use.`:r?`先检查效果,你确认后再用于之后的任务。`:`Check the result first. Future runs change only after you confirm.`}),H.status===`candidate`?(0,N.jsx)(T,{disabled:o,onClick:()=>P({kind:`validate`,version:H.version}),children:r?`先试试这个改进`:`Try this improvement`}):H.validation===`passed`?(0,N.jsx)(T,{disabled:o,onClick:()=>P({kind:`adopt_method`,version:H.version}),children:r?`以后这样做`:`Use this approach going forward`}):H.validationTaskId?(0,N.jsx)(T,{disabled:o,onClick:()=>m(H.validationTaskId),children:r?`查看改进结果`:`Review the improvement`}):null,(0,N.jsx)(T,{variant:`ghost`,disabled:o,onClick:()=>P({kind:`reject_method`,version:H.version}),children:r?`先保持原样`:`Keep the current approach`})]}):null,d?(0,N.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:d}):null,M.status===`ended`?null:(0,N.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,N.jsx)(T,{variant:`secondary`,disabled:o,onClick:()=>P({kind:M.status===`active`?`pause`:`resume`}),children:M.status===`active`?r?`暂停托管`:`Pause`:r?`恢复托管`:`Resume`}),(0,N.jsx)(T,{variant:`ghost`,onClick:()=>b(!v),children:r?`调整时间`:`Change schedule`}),(0,N.jsxs)(`details`,{children:[(0,N.jsx)(`summary`,{className:`cursor-pointer px-3 py-2 text-sm text-fg-muted`,children:r?`更多安排`:`More options`}),(0,N.jsx)(T,{variant:`ghost`,onClick:()=>_(!0),children:r?`结束托管`:`End routine`})]})]}),g?(0,N.jsxs)(`div`,{className:`space-y-2`,children:[(0,N.jsx)(`p`,{className:`text-sm text-fg`,children:r?`结束后停止未来执行,并请求取消正在运行的本项任务。历史结果保留。`:`Stop future occurrences and request cancellation of the current routine task. Keep past results.`}),(0,N.jsx)(T,{disabled:o,onClick:()=>{P({kind:`end`}),_(!1)},children:r?`确认结束`:`Confirm end`}),(0,N.jsx)(T,{variant:`ghost`,onClick:()=>_(!1),children:r?`取消`:`Cancel`})]}):null,v&&M.status!==`ended`?(0,N.jsxs)(`form`,{className:`space-y-3`,onSubmit:e=>{e.preventDefault(),P({kind:`configure`,schedule:L(S,w,D),validUntil:Date.parse(`${A}T23:59:59Z`)}),b(!1)},children:[(0,N.jsx)(I,{time:S,setTime:C,day:w,setDay:E,zone:D,setZone:O,until:A,setUntil:j,zh:r}),(0,N.jsx)(T,{type:`submit`,disabled:o,children:r?`确认调整`:`Confirm changes`})]}):null,(0,N.jsxs)(`details`,{children:[(0,N.jsx)(`summary`,{className:`text-xs text-accent-fg`,children:r?`做法与改进记录`:`Approach and improvement history`}),(0,N.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:r?`保留你确认过的做法,随时可以切回。暂停寻找新建议不会停止这项安排。`:`Keep the approaches you approved and restore one when needed. Pausing new suggestions does not stop this arrangement.`}),M.methods.map(e=>(0,N.jsxs)(`div`,{className:`mt-3 space-y-2 border-l border-edge pl-3`,children:[(0,N.jsxs)(`p`,{className:`text-sm text-fg`,children:[`v`,e.version,e.version===M.adoptedVersion?r?` · 使用中`:` · Current`:``,` · `,W(e.status)]}),e.additions.map((e,t)=>(0,N.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-xs text-fg-muted`,children:e},t)),e.validationTaskId?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(T,{variant:`ghost`,onClick:()=>m(e.validationTaskId),children:r?`查看验证任务`:`Review validation`}),(0,N.jsx)(`span`,{className:`text-xs text-fg-muted`,children:e.validation===`passed`?r?`本次验证通过`:`This validation passed`:e.validation===`failed`?r?`验证未通过`:`Validation did not pass`:r?`等待验证结果`:`Awaiting verification`})]}):null,M.status!==`ended`&&e.version!==H?.version&&e.status===`candidate`?(0,N.jsx)(T,{disabled:o,onClick:()=>P({kind:`validate`,version:e.version}),children:r?`先试试这个改进`:`Try this improvement`}):null,M.status!==`ended`&&e.version!==H?.version&&e.validation===`passed`&&e.status===`validating`?(0,N.jsx)(T,{disabled:o,onClick:()=>P({kind:`adopt_method`,version:e.version}),children:r?`以后这样做`:`Use this approach going forward`}):null,M.status!==`ended`&&e.version!==H?.version&&[`candidate`,`validating`].includes(e.status)?(0,N.jsx)(T,{variant:`ghost`,disabled:o,onClick:()=>P({kind:`reject_method`,version:e.version}),children:r?`保留原方法`:`Keep original method`}):null,M.status!==`ended`&&e.status===`approved`&&e.version!==M.adoptedVersion?(0,N.jsx)(T,{variant:`ghost`,disabled:o,onClick:()=>P({kind:`rollback`,version:e.version}),children:r?`切回这个做法`:`Restore this approach`}):null]},e.version))]}),M.executions.length?(0,N.jsxs)(`details`,{children:[(0,N.jsx)(`summary`,{className:`text-xs text-accent-fg`,children:r?`以往结果`:`Past results`}),M.executions.map(e=>(0,N.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2 text-xs text-fg-muted`,children:[(0,N.jsxs)(`span`,{children:[U(e.status,e.verdict),` · v`,e.version]}),(0,N.jsx)(T,{variant:`ghost`,onClick:()=>m(e.taskId),children:r?`查看结果与验收`:`Review result`})]},e.runId))]}):null,p?(0,N.jsx)(F,{taskId:p,language:t,onComplete:n}):null,(0,N.jsxs)(`a`,{className:`inline-block text-xs text-accent-fg`,href:`#/automations?automation=${encodeURIComponent(M.automationId)}`,children:[r?`在自动化中管理`:`Manage in automations`,` ›`]})]})}function B(e){let t=(0,A.c)(11),{routineId:n,language:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={refreshInterval:5e3},t[0]=i):i=t[0];let a=b(`/api/home/routines`,V,i);if(a.isLoading){let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,N.jsx)(_,{className:`h-48 w-full`}),t[1]=e):e=t[1],e}if(a.error){let e=String(a.error),n;return t[2]===e?n=t[3]:(n=(0,N.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:e}),t[2]=e,t[3]=n),n}let o;t[4]!==n||t[5]!==a.data?.items?(o=a.data?.items.find(e=>e.id===n),t[4]=n,t[5]=a.data?.items,t[6]=o):o=t[6];let s=o,c;return t[7]!==r||t[8]!==s||t[9]!==a?(c=s?(0,N.jsx)(z,{routine:s,language:r,onUpdated:()=>void a.mutate()}):null,t[7]=r,t[8]=s,t[9]=a,t[10]=c):c=t[10],c}function V(e){return c(s(e))}export{j as a,F as i,B as n,z as r,R as t};
@@ -0,0 +1 @@
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{u as i}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{i as a,n as o,o as s}from"./locale-store-Dy1EByeG.js";import{t as c}from"./messages-BAnhwALN.js";import{a as ee,i as te,n as l,o as ne,r as re,s as ie,t as ae}from"./dist-CY7CS_D3.js";import{t as u}from"./createLucideIcon-DPHK1VkS.js";import{t as d}from"./chevron-down-ccbiQQz_.js";import{i as f}from"./working-directory-picker-modal-BGZduAXV.js";import{t as oe}from"./circle-check-C23XjkUj.js";import{t as p}from"./key-round-DWbpyU2U.js";import{t as m}from"./loader-circle-CifKLtgG.js";import{a as h,c as g,i as _,n as v,s as y,t as b}from"./install-connector-dialog-DxSv1wS2.js";import{t as x}from"./package-wATCyihJ.js";import{t as S}from"./plus-Q2yW6OE7.js";import{t as C}from"./server-BlHCBjiE.js";import{t as se}from"./x-B_N4OPjy.js";import{t as w}from"./cn-0WouolD0.js";import{t as T}from"./skeleton-DzdOeGYz.js";import{i as E}from"./vendor-swr-CdRzEUwF.js";import{t as D}from"./button-Cc4hUNTt.js";import{n as ce}from"./interaction-BdhHBbYa.js";import{a as O,i as k,o as A,s as j}from"./connectors-api-CTuVWwBf.js";import{r as M,t as N}from"./agent-plugin-dialog-CikzCYAG.js";import{t as P}from"./capability-icon-CmvCZOJX.js";import{n as F,t as I}from"./extension-marketplace-api-BIzkukYp.js";var L=u(`cable`,[[`path`,{d:`M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z`,key:`trhst0`}],[`path`,{d:`M17 21v-2`,key:`ds4u3f`}],[`path`,{d:`M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10`,key:`1mo9zo`}],[`path`,{d:`M21 21v-2`,key:`eo0ou`}],[`path`,{d:`M3 5V3`,key:`1k5hjh`}],[`path`,{d:`M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z`,key:`1dd30t`}],[`path`,{d:`M7 5V3`,key:`1t1388`}]]),R=e(t(),1),z={"notion-office":`notion`,"todoist-mcp":`todoist`,"amap-maps":`amap`,"feishu-workspace":`feishu`,"wecom-workspace":`wecom`,"dingtalk-workspace":`dingtalk`,"wps365-workspace":`wps365`},B=[`feishu`,`wecom`,`dingtalk`,`tencent-docs`,`wps365`,`yuque`,`dida365`,`flomo`,`tencent-meeting`,`amap`,`bailian-web-search`,`railway-12306`,`antv-chart`],V={"store-plugin":0,"builtin-connector":1,"store-connector":2,"registry-connector":3};function H(e){let t=e.toLowerCase().replace(/^composio-/,``);return z[t]??t}function U(e){if(!e)return 2**53-1;let t=B.indexOf(H(e.id));return t>=0?t:e.regions?.includes(`china`)?B.length:2**53-1}function W(e,t){let n=new Map;for(let t of e){if(!t.service)continue;let e=H(t.service.id),r=n.get(e);(!r?.service||V[t.service.source]<V[r.service.source])&&n.set(e,t)}let r=e.filter(e=>!e.service||n.get(H(e.service.id))===e);return t.startsWith(`zh`)?r.toSorted((e,t)=>U(e.service)-U(t.service)):r}function G(e,t){let n=t.trim().toLocaleLowerCase();return!n||[e.name,e.description,e.source,...e.tags].some(e=>e.toLocaleLowerCase().includes(n))}function K(e){return e?[`failed`,`unauthorized`,`degraded`,`not_configured`].includes(e.status)?`attention`:`installed`:`available`}function q(e,t,n,r=`en`){return W(e,r).filter(e=>(t===`all`||e.kind===t)&&G(e,n))}function J(e,t,n,r=`en`){let i=new Map(n.map(e=>[e.connectorId,e])),a=new Map;for(let t of e){let e=i.get(t.id);a.set(t.id,{id:t.id,service:{id:t.id,source:t.source===`builtin`?`builtin-connector`:t.source===`store`?`store-connector`:`registry-connector`},kind:`connector`,name:t.displayName,description:t.description,source:t.source,status:K(e),tags:[t.category,t.kind,...t.tags??[]],href:`/capabilities/connectors?tab=${e?`connected`:`discover`}&${e?`instance`:`connector`}=${encodeURIComponent(e?.instanceId??t.id)}`,iconUrl:t.branding?.logoUrl})}for(let e of t){let t=e.name,n=e.localizations?.[r.startsWith(`zh`)?`zh-CN`:`en`],o=i.get(t);a.set(`store:${t}`,{id:t,service:{id:t,source:`store-connector`,regions:e.regions},kind:`connector`,name:n?.displayName??e.name,description:n?.description??e.description,source:e.author.username||`XOPC Store`,status:K(o),tags:[e.name,e.category,...e.tags??[]].filter(e=>!!e),href:o?`/capabilities/connectors?tab=connected&instance=${encodeURIComponent(o.instanceId)}`:`/capabilities/connectors?tab=discover&storeConnector=${encodeURIComponent(t)}`,iconUrl:e.branding?.iconUrl})}return W([...a.values()],r)}function Y(e,t,n=`en`){return e.map(e=>({id:e.id,kind:`extension`,...e.packageType===`plugin`?{service:{id:e.id,source:`store-plugin`}}:{},name:e.localizations?.[n.startsWith(`zh`)?`zh-CN`:`en`]?.displayName??e.name,description:e.localizations?.[n.startsWith(`zh`)?`zh-CN`:`en`]?.description??e.description??``,source:e.author||e.npmPackage,status:t.has(e.id)?`installed`:`available`,tags:[e.id,...e.categories??[],...e.tags??[]],href:`/capabilities/extensions?tab=marketplace&q=${encodeURIComponent(e.name)}`,iconUrl:e.branding?.iconUrl}))}async function X(e=``){let t=await A({q:e,page:1,pageSize:50,sort:`downloads`}),n=await Promise.all(Array.from({length:Math.max(0,t.meta.totalPages-1)},(t,n)=>A({q:e,page:n+2,pageSize:50,sort:`downloads`})));return[...t.items,...n.flatMap(e=>e.items)]}async function Z(e){let[t,n,r]=await Promise.allSettled([I(),k(),X()]),i=[t,n,r].filter(e=>e.status===`rejected`).length;if(i===3)throw Error(`Service recommendations unavailable`);let a=n.status===`fulfilled`?n.value:[];return{items:W([...Y(t.status===`fulfilled`?t.value.filter(e=>e.packageType===`plugin`):[],new Set,e),...J(a,r.status===`fulfilled`?r.value:[],[],e)],e),definitions:a,failedSources:i}}var Q=n(),le=[`understand`,`act`,`reach`];function ue(e){if(e.benefits?.length)return[...new Set(e.benefits)];let t=new Set(e.capabilities),n=[e.id,e.displayName,...e.tags??[]].join(` `).toLowerCase(),r=[];return(t.has(`context`)||t.has(`memory_source`)||t.has(`resources`)||e.category===`docs`||e.category===`data`||/notion|drive|document|confluence|airtable|database|knowledge|wiki/.test(n))&&r.push(`understand`),t.has(`tools`)&&r.push(`act`),(t.has(`channel`)||/slack|telegram|discord|teams|mail|message|wechat|weixin/.test(n))&&r.push(`reach`),r.length?[...new Set(r)]:[`act`]}function de(e){return ue(e)[0]??`act`}function fe(e,t){let n=t?de(t):`act`,r=e.connectionStatus===`connected`||e.status===`connected`||e.usage.lastHealthStatus===`ok`,i=e.status===`not_configured`||e.status===`failed`||e.status===`degraded`||e.status===`unauthorized`||e.connectionStatus===`unauthorized`||e.connectionStatus===`error`,a=n===`understand`?e.usage.lastResourceCount:n===`act`?e.usage.lastToolCount:void 0;return{benefit:n,state:r?`ready`:i?`needs_setup`:`checking`,availableCount:a}}var $=r();function pe(e,t){return t.connectorCapabilityLabels[e]??e}function me(e,t){if(e.runtime.type===`mcp`)return h(t.connectorRuntimeMcp,{serverId:e.runtime.serverId});let n=e.runtime.type===`composio`?e.runtime.toolkit:e.runtime.type===`cli`?e.runtime.adapterId:e.runtime.sourceKind;return h(t.connectorRuntimeGeneric,{runtime:e.runtime.type,id:n??e.runtime.type})}function he(e,t){return e.auth.mode===`cli`?t.connectorAuthCli:e.auth.mode===`oauth`?t.connectorAuthOAuth:e.auth.mode===`apiKey`?t.connectorAuthApiKey:t.connectorAuthNone}function ge(e){let t=(0,Q.c)(133),{connector:n,installed:r,onClose:i,onInstall:a,t:o}=e,s;t[0]!==n||t[1]!==o?(s=_(n,o),t[0]=n,t[1]=o,t[2]=s):s=t[2];let c=s,u,d,f,m,y,b,x,S,T,E,O,k,A,j,M,N;if(t[3]!==n||t[4]!==c||t[5]!==r||t[6]!==i||t[7]!==o){let e=ue(n),a;t[24]!==n.setup.config||t[25]!==n.setup.secrets?(a=[...(n.setup.secrets??[]).filter(ye),...(n.setup.config??[]).filter(ve)],t[24]=n.setup.config,t[25]=n.setup.secrets,t[26]=a):a=t[26];let s=a,g=n.capabilities.filter(_e);f=ae,x=!0,t[27]===i?S=t[28]:(S=e=>{e||i()},t[27]=i,t[28]=S),d=ne,t[29]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,$.jsx)(ee,{className:`xopc-dialog-overlay fixed inset-0 z-[60] bg-scrim`}),t[29]=b):b=t[29],u=re,t[30]===Symbol.for(`react.memo_cache_sentinel`)?(m=w(`xopc-dialog-content fixed left-1/2 top-1/2 z-[60] flex h-[min(100vh-2rem,42rem)] w-[min(100%-2rem,min(92vw,44rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden`,`rounded-2xl border border-edge bg-surface-overlay shadow-float outline-none dark:border-edge`),t[30]=m):m=t[30];let _;t[31]===n?_=t[32]:(_=(0,$.jsx)(v,{connector:n,size:`lg`}),t[31]=n,t[32]=_);let D;t[33]===n.displayName?D=t[34]:(D=(0,$.jsx)(ie,{className:`text-base font-semibold text-fg`,children:n.displayName}),t[33]=n.displayName,t[34]=D);let P;t[35]!==r||t[36]!==o.connectedBadge?(P=r?(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-emerald-500/10 px-2 py-0.5 text-[11px] font-medium text-emerald-700 dark:text-emerald-300`,children:[(0,$.jsx)(oe,{className:`size-3`,"aria-hidden":!0}),o.connectedBadge]}):null,t[35]=r,t[36]=o.connectedBadge,t[37]=P):P=t[37];let F;t[38]!==D||t[39]!==P?(F=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[D,P]}),t[38]=D,t[39]=P,t[40]=F):F=t[40];let I;t[41]===c?I=t[42]:(I=(0,$.jsx)(te,{className:`mt-1 line-clamp-3 text-sm leading-6 text-fg-muted`,children:c}),t[41]=c,t[42]=I);let L;t[43]!==F||t[44]!==I?(L=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[F,I]}),t[43]=F,t[44]=I,t[45]=L):L=t[45];let R;t[46]!==_||t[47]!==L?(R=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[_,L]}),t[46]=_,t[47]=L,t[48]=R):R=t[48];let z;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(z=w(`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover hover:text-fg`,ce.focusRingPanel),t[49]=z):z=t[49];let B;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,$.jsx)(se,{className:`size-5`,strokeWidth:1.75,"aria-hidden":!0}),t[50]=B):B=t[50];let V;t[51]===o.modalClose?V=t[52]:(V=(0,$.jsx)(l,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,className:z,"aria-label":o.modalClose,children:B})}),t[51]=o.modalClose,t[52]=V),t[53]!==R||t[54]!==V?(y=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-start justify-between gap-3 border-b border-edge-subtle px-5 py-5 sm:px-6`,children:[R,V]}),t[53]=R,t[54]=V,t[55]=y):y=t[55],j=`min-h-0 flex-1 space-y-5 overflow-y-auto px-5 py-5 sm:px-6`,M=e.length?(0,$.jsxs)(`section`,{children:[(0,$.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:o.connectorWhyConnect}),(0,$.jsx)(`div`,{className:`mt-3 divide-y divide-edge-subtle overflow-hidden rounded-xl border border-edge bg-surface-base`,children:e.map(e=>(0,$.jsxs)(`div`,{className:`px-4 py-3`,children:[(0,$.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:o.connectorBenefitHeadings[e]}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:o.connectorBenefitHints[e]})]},e))})]}):null;let H;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,$.jsx)(p,{className:`mt-0.5 size-4 shrink-0 text-fg-muted`,"aria-hidden":!0}),t[56]=H):H=t[56];let U;t[57]===o.detailPermissions?U=t[58]:(U=(0,$.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:o.detailPermissions}),t[57]=o.detailPermissions,t[58]=U);let W;t[59]!==n||t[60]!==o?(W=he(n,o),t[59]=n,t[60]=o,t[61]=W):W=t[61];let G;t[62]===W?G=t[63]:(G=(0,$.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:W}),t[62]=W,t[63]=G);let K;t[64]!==U||t[65]!==G?(K=(0,$.jsxs)(`div`,{className:`flex items-start gap-3 border-b border-edge-subtle px-4 py-3`,children:[H,(0,$.jsxs)(`div`,{children:[U,G]})]}),t[64]=U,t[65]=G,t[66]=K):K=t[66];let q;t[67]===o.connectorSetupTitle?q=t[68]:(q=(0,$.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:o.connectorSetupTitle}),t[67]=o.connectorSetupTitle,t[68]=q);let J;t[69]!==s.length||t[70]!==o.connectorRequiredInputsCount||t[71]!==o.connectorSetupNone?(J=s.length?h(o.connectorRequiredInputsCount,{count:String(s.length)}):o.connectorSetupNone,t[69]=s.length,t[70]=o.connectorRequiredInputsCount,t[71]=o.connectorSetupNone,t[72]=J):J=t[72];let Y;t[73]===J?Y=t[74]:(Y=(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:J}),t[73]=J,t[74]=Y);let X;t[75]!==q||t[76]!==Y?(X=(0,$.jsxs)(`div`,{className:`px-4 py-3`,children:[q,Y]}),t[75]=q,t[76]=Y,t[77]=X):X=t[77],t[78]!==K||t[79]!==X?(N=(0,$.jsxs)(`section`,{className:`overflow-hidden rounded-xl border border-edge bg-surface-base`,children:[K,X]}),t[78]=K,t[79]=X,t[80]=N):N=t[80],k=`rounded-xl border border-edge bg-surface-base`,t[81]===o.connectorTechnicalDetails?A=t[82]:(A=(0,$.jsx)(`summary`,{className:`cursor-pointer px-4 py-3 text-sm font-medium text-fg-muted hover:text-fg`,children:o.connectorTechnicalDetails}),t[81]=o.connectorTechnicalDetails,t[82]=A),T=`space-y-5 border-t border-edge-subtle px-4 py-4`;let Z;t[83]===Symbol.for(`react.memo_cache_sentinel`)?(Z=(0,$.jsx)(C,{className:`size-3.5`,"aria-hidden":!0}),t[83]=Z):Z=t[83];let Q;t[84]===o.connectorRuntimeTitle?Q=t[85]:(Q=(0,$.jsxs)(`p`,{className:`flex items-center gap-2 text-xs font-medium text-fg-muted`,children:[Z,o.connectorRuntimeTitle]}),t[84]=o.connectorRuntimeTitle,t[85]=Q);let le;t[86]!==n||t[87]!==o?(le=me(n,o),t[86]=n,t[87]=o,t[88]=le):le=t[88];let de;t[89]===le?de=t[90]:(de=(0,$.jsx)(`p`,{className:`mt-1 break-words text-xs text-fg-subtle`,children:le}),t[89]=le,t[90]=de),t[91]!==Q||t[92]!==de?(E=(0,$.jsxs)(`div`,{children:[Q,de]}),t[91]=Q,t[92]=de,t[93]=E):E=t[93],O=g.length?(0,$.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:g.map(e=>(0,$.jsx)(`span`,{className:`rounded-md bg-surface-panel px-2 py-1 text-xs text-fg-muted`,children:pe(e,o)},e))}):null,t[3]=n,t[4]=c,t[5]=r,t[6]=i,t[7]=o,t[8]=u,t[9]=d,t[10]=f,t[11]=m,t[12]=y,t[13]=b,t[14]=x,t[15]=S,t[16]=T,t[17]=E,t[18]=O,t[19]=k,t[20]=A,t[21]=j,t[22]=M,t[23]=N}else u=t[8],d=t[9],f=t[10],m=t[11],y=t[12],b=t[13],x=t[14],S=t[15],T=t[16],E=t[17],O=t[18],k=t[19],A=t[20],j=t[21],M=t[22],N=t[23];let P;t[94]!==T||t[95]!==E||t[96]!==O?(P=(0,$.jsxs)(`div`,{className:T,children:[E,O]}),t[94]=T,t[95]=E,t[96]=O,t[97]=P):P=t[97];let F;t[98]!==P||t[99]!==k||t[100]!==A?(F=(0,$.jsxs)(`details`,{className:k,children:[A,P]}),t[98]=P,t[99]=k,t[100]=A,t[101]=F):F=t[101];let I;t[102]!==F||t[103]!==j||t[104]!==M||t[105]!==N?(I=(0,$.jsxs)(`div`,{className:j,children:[M,N,F]}),t[102]=F,t[103]=j,t[104]=M,t[105]=N,t[106]=I):I=t[106];let L;t[107]===o.modalClose?L=t[108]:(L=(0,$.jsx)(l,{asChild:!0,children:(0,$.jsx)(D,{variant:`secondary`,children:o.modalClose})}),t[107]=o.modalClose,t[108]=L);let R;t[109]!==n||t[110]!==r||t[111]!==i||t[112]!==a||t[113]!==o.connect?(R=r?null:(0,$.jsxs)(D,{variant:`primary`,onClick:()=>{a(n),i()},children:[(0,$.jsx)(g,{className:`size-4`}),o.connect]}),t[109]=n,t[110]=r,t[111]=i,t[112]=a,t[113]=o.connect,t[114]=R):R=t[114];let z;t[115]!==L||t[116]!==R?(z=(0,$.jsxs)(`div`,{className:`flex shrink-0 justify-end gap-2 border-t border-edge-subtle px-5 py-4 sm:px-6`,children:[L,R]}),t[115]=L,t[116]=R,t[117]=z):z=t[117];let B;t[118]!==u||t[119]!==m||t[120]!==y||t[121]!==I||t[122]!==z?(B=(0,$.jsxs)(u,{className:m,children:[y,I,z]}),t[118]=u,t[119]=m,t[120]=y,t[121]=I,t[122]=z,t[123]=B):B=t[123];let V;t[124]!==d||t[125]!==b||t[126]!==B?(V=(0,$.jsxs)(d,{children:[b,B]}),t[124]=d,t[125]=b,t[126]=B,t[127]=V):V=t[127];let H;return t[128]!==f||t[129]!==x||t[130]!==S||t[131]!==V?(H=(0,$.jsx)(f,{open:x,onOpenChange:S,children:V}),t[128]=f,t[129]=x,t[130]=S,t[131]=V,t[132]=H):H=t[132],H}function _e(e){return!e.startsWith(`runtime.`)&&!e.startsWith(`auth.`)}function ve(e){return e.required}function ye(e){return e.required}function be(e){let t=(0,Q.c)(68),{item:n,definition:r,busy:i,onClose:a,onConnect:s}=e,u=o(xe),d;t[0]===u?d=t[1]:(d=u.startsWith(`zh`),t[0]=u,t[1]=d);let f=d,oe;t[2]===u?oe=t[3]:(oe=c(u),t[2]=u,t[3]=oe);let p=oe.connectorsSettings,m=n.service?.source===`store-plugin`,h;t[4]!==m||t[5]!==n.id?(h=m?[`recommended-service-detail`,n.id]:null,t[4]=m,t[5]=n.id,t[6]=h):h=t[6];let g;t[7]===n.id?g=t[8]:(g=()=>F(n.id),t[7]=n.id,t[8]=g);let _;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(_={revalidateOnFocus:!1},t[9]=_):_=t[9];let{data:v,error:y,isLoading:b,mutate:S}=E(h,g,_);if(r&&!m){let e;return t[10]!==r||t[11]!==a||t[12]!==s||t[13]!==p?(e=(0,$.jsx)(ge,{connector:r,installed:!1,onClose:a,onInstall:s,t:p}),t[10]=r,t[11]=a,t[12]=s,t[13]=p,t[14]=e):e=t[14],e}let C;t[15]===a?C=t[16]:(C=e=>{e||a()},t[15]=a,t[16]=C);let w;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,$.jsx)(ee,{className:`xopc-dialog-overlay fixed inset-0 z-[60] bg-scrim`}),t[17]=w):w=t[17];let ce=m?x:L,O;t[18]!==n.iconUrl||t[19]!==ce?(O=(0,$.jsx)(P,{iconUrl:n.iconUrl,fallback:ce}),t[18]=n.iconUrl,t[19]=ce,t[20]=O):O=t[20];let k;t[21]===n.name?k=t[22]:(k=(0,$.jsx)(ie,{className:`min-w-0 break-words text-base font-semibold text-fg`,children:n.name}),t[21]=n.name,t[22]=k);let A;t[23]!==k||t[24]!==O?(A=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[O,k]}),t[23]=k,t[24]=O,t[25]=A):A=t[25];let j;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,$.jsx)(se,{className:`size-5`,"aria-hidden":!0}),t[26]=j):j=t[26];let N;t[27]===p.modalClose?N=t[28]:(N=(0,$.jsx)(l,{asChild:!0,children:(0,$.jsx)(D,{variant:`ghost`,className:`size-9 shrink-0 p-0`,"aria-label":p.modalClose,children:j})}),t[27]=p.modalClose,t[28]=N);let I;t[29]!==A||t[30]!==N?(I=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-3 border-b border-edge-subtle p-5`,children:[A,N]}),t[29]=A,t[30]=N,t[31]=I):I=t[31];let R=v?.localizations?.[f?`zh-CN`:`en`]?.description||v?.description||n.description,z;t[32]===R?z=t[33]:(z=(0,$.jsx)(te,{className:`whitespace-pre-wrap break-words text-sm leading-7 text-fg-muted`,children:R}),t[32]=R,t[33]=z);let B=f?`来源:`:`Source: `,V=v?.author.username||n.source,H;t[34]!==B||t[35]!==V?(H=(0,$.jsxs)(`p`,{className:`break-words text-xs text-fg-subtle`,children:[B,V]}),t[34]=B,t[35]=V,t[36]=H):H=t[36];let U;t[37]===b?U=t[38]:(U=b?(0,$.jsxs)(`div`,{className:`space-y-3`,"aria-busy":`true`,children:[(0,$.jsx)(T,{className:`h-5 w-32`}),(0,$.jsx)(T,{className:`h-28 w-full rounded-lg`})]}):null,t[37]=b,t[38]=U);let W;t[39]!==v||t[40]!==f?(W=v?(0,$.jsx)(M,{data:v,zh:f}):null,t[39]=v,t[40]=f,t[41]=W):W=t[41];let G;t[42]!==y||t[43]!==S||t[44]!==f?(G=y?(0,$.jsxs)(`p`,{role:`status`,className:`text-sm text-fg-muted`,children:[f?`详细信息加载失败。`:`Could not load additional details.`,` `,(0,$.jsx)(`button`,{type:`button`,className:`text-accent-fg hover:underline`,onClick:()=>void S(),children:f?`重试`:`Retry`})]}):null,t[42]=y,t[43]=S,t[44]=f,t[45]=G):G=t[45];let K;t[46]!==z||t[47]!==H||t[48]!==U||t[49]!==W||t[50]!==G?(K=(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-5 overflow-y-auto p-5`,children:[z,H,U,W,G]}),t[46]=z,t[47]=H,t[48]=U,t[49]=W,t[50]=G,t[51]=K):K=t[51];let q;t[52]===p.modalClose?q=t[53]:(q=(0,$.jsx)(l,{asChild:!0,children:(0,$.jsx)(D,{variant:`secondary`,children:p.modalClose})}),t[52]=p.modalClose,t[53]=q);let J;t[54]!==i||t[55]!==s||t[56]!==p.connect?(J=(0,$.jsx)(D,{disabled:i,onClick:s,children:p.connect}),t[54]=i,t[55]=s,t[56]=p.connect,t[57]=J):J=t[57];let Y;t[58]!==q||t[59]!==J?(Y=(0,$.jsxs)(`div`,{className:`flex shrink-0 justify-end gap-2 border-t border-edge-subtle p-4`,children:[q,J]}),t[58]=q,t[59]=J,t[60]=Y):Y=t[60];let X;t[61]!==I||t[62]!==K||t[63]!==Y?(X=(0,$.jsxs)(ne,{children:[w,(0,$.jsxs)(re,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[60] flex h-[min(42rem,calc(100dvh-2rem))] w-[min(44rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay shadow-float`,children:[I,K,Y]})]}),t[61]=I,t[62]=K,t[63]=Y,t[64]=X):X=t[64];let Z;return t[65]!==X||t[66]!==C?(Z=(0,$.jsx)(ae,{open:!0,onOpenChange:C,children:X}),t[65]=X,t[66]=C,t[67]=Z):Z=t[67],Z}function xe(e){return e.language}function Se({initialCount:e=3,showAll:t=!1,query:n=``,layout:r=`list`,onChanged:ee}){let te=i(),l=o(e=>e.language),ne=l.startsWith(`zh`),re=c(l).onboarding.workDiscovery,ie=c(l).connectorsSettings,{data:ae,error:u,isLoading:oe,mutate:p}=E([`service-recommendations`,l],()=>Z(l),{revalidateOnFocus:!1}),{data:h,error:g,mutate:_}=E(`recommended-connector-instances`,O),{data:v,error:C,mutate:se}=E(`gateway-extensions-list`,()=>s(a(`/api/extensions`))),[ce,k]=(0,R.useState)(!1),[A,M]=(0,R.useState)(null),[F,I]=(0,R.useState)(null),[z,B]=(0,R.useState)(null),[V,H]=(0,R.useState)(``),[U,W]=(0,R.useState)(null),G=q(ae?.items??[],`all`,n,l);async function K(){let e=(await Promise.allSettled([_(),se(),Promise.resolve().then(()=>ee?.())])).find(e=>e.status===`rejected`);e?.status===`rejected`&&H(String(e.reason))}async function J(e,t){if(H(``),e.service?.source===`store-plugin`){I({id:e.id,extension:t});return}let n=h?.find(t=>t.connectorId===e.id);if(n){te(`/capabilities/connectors?tab=connected&instance=${encodeURIComponent(n.instanceId)}`);return}B(e.id);try{if(e.service?.source===`store-connector`){let t=await j(e.id);M(y(t.definition,{packageName:t.packageName,version:t.version,reviewHash:t.reviewHash,permissions:t.permissions}))}else{let t=ae?.definitions.find(t=>t.id===e.id);t&&M(y(t))}}catch(e){H(e instanceof Error?e.message:String(e))}finally{B(null)}}return(0,$.jsxs)(`div`,{children:[oe?(0,$.jsx)(`div`,{className:r===`cards`?`grid gap-4 sm:grid-cols-2 xl:grid-cols-3`:`space-y-2`,"aria-busy":`true`,children:Array.from({length:e},(e,t)=>(0,$.jsx)(T,{className:r===`cards`?`h-[8.75rem] rounded-xl`:`h-20 rounded-xl`},t))}):null,u||ae?.failedSources||g||C?(0,$.jsxs)(`p`,{className:`mb-3 text-sm text-fg-muted`,role:`status`,children:[re.connectorLoadFailed,` `,(0,$.jsx)(`button`,{type:`button`,className:`text-accent-fg hover:underline`,onClick:()=>{p(),_(),se()},children:ne?`重试`:`Retry`})]}):null,!oe&&!u&&G.length===0?(0,$.jsx)(`p`,{className:`py-6 text-center text-sm text-fg-muted`,children:re.noWorkServices}):null,(0,$.jsx)(`div`,{className:r===`cards`?`grid gap-4 sm:grid-cols-2 xl:grid-cols-3`:`divide-y divide-edge-subtle rounded-xl border border-edge-subtle bg-surface-base/55`,children:(t||ce?G:G.slice(0,e)).map(e=>{let t=v?.extensions.find(t=>t.format===`agent-plugin`&&t.provenance?.packageName===e.id),n=h?.find(t=>t.connectorId===e.id),i=e.service?.source===`store-plugin`,a=i?!!(t?.active&&t.readiness===`ready`&&[`connected`,`not_required`].includes(t.authorizationStatus??``)):!!(n?.enabled&&n.status===`connected`),o=i?!!t:!!n,s=(i?!v&&!C:!h&&!g)?(0,$.jsx)(T,{className:`h-8 w-16 shrink-0 rounded-lg`}):(0,$.jsxs)(D,{type:`button`,variant:`secondary`,className:`relative z-10 h-8 shrink-0 px-3 text-xs`,disabled:z!==null,onClick:()=>void J(e,t),children:[z===e.id?(0,$.jsx)(m,{className:`size-3.5 animate-spin`}):o?null:(0,$.jsx)(S,{className:`size-3.5`}),a?ne?`管理`:`Manage`:o?ne?`继续设置`:`Set up`:ie.connect]});return(0,$.jsx)(`article`,{className:w(r===`cards`?`group relative flex min-h-[8.75rem] min-w-0 flex-col rounded-xl border border-edge bg-surface-panel p-4 transition-colors hover:bg-surface-hover/45 focus-within:ring-2 focus-within:ring-accent/30 [content-visibility:auto] [contain-intrinsic-size:auto_8.75rem]`:`flex min-h-20 items-center gap-3 px-3 py-3 sm:px-4`),children:r===`cards`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[(0,$.jsx)(P,{iconUrl:e.iconUrl,fallback:i?x:L}),(0,$.jsx)(`h3`,{className:`min-w-0 truncate text-sm font-semibold text-fg`,children:(0,$.jsx)(`button`,{type:`button`,className:`cursor-pointer text-left after:absolute after:inset-0 after:rounded-xl focus-visible:outline-none focus-visible:after:ring-2 focus-visible:after:ring-accent`,"aria-label":ne?`查看${e.name}详情`:`View ${e.name} details`,"aria-haspopup":`dialog`,onClick:()=>W(e),children:e.name})})]}),s]}),(0,$.jsx)(`p`,{className:`mt-3 line-clamp-2 text-sm leading-6 text-fg-muted`,title:e.description,children:e.description})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(P,{iconUrl:e.iconUrl,fallback:i?x:L}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`h3`,{className:`truncate text-sm font-semibold text-fg`,children:e.name}),(0,$.jsx)(`p`,{className:`mt-1 line-clamp-2 text-xs text-fg-muted`,children:e.description})]}),s]})},`${e.kind}:${e.id}`)})}),!t&&G.length>e?(0,$.jsxs)(`button`,{type:`button`,className:`mx-auto mt-3 flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-accent-fg hover:underline`,onClick:()=>k(e=>!e),children:[ce?(0,$.jsx)(f,{className:`size-3.5`}):(0,$.jsx)(d,{className:`size-3.5`}),ce?re.showFewerServices:re.showMoreServices]}):null,V?(0,$.jsx)(`p`,{className:`mt-3 text-xs text-danger`,role:`alert`,children:V}):null,U?(0,$.jsx)(be,{item:U,definition:ae?.definitions.find(e=>e.id===U.id),busy:z!==null,onClose:()=>W(null),onConnect:()=>{W(null),J(U,v?.extensions.find(e=>e.format===`agent-plugin`&&e.provenance?.packageName===U.id))}}):null,A?(0,$.jsx)(b,{draft:A,onChange:M,onClose:()=>M(null),t:ie,onInstalled:async()=>{await K(),M(null)}}):null,F?(0,$.jsx)(N,{initialSource:`store:${F.id}`,extension:F.extension,onClose:()=>{I(null),K()}}):null]})}export{fe as a,W as c,ue as i,L as l,ge as n,Z as o,le as r,H as s,Se as t};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{f as i,r as a}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{n as o}from"./locale-store-Dy1EByeG.js";import{t as s}from"./messages-BAnhwALN.js";import{E as c,M as l,T as u,b as d,c as f,h as p,i as m,j as h,k as g,l as _,n as v,p as y,r as b}from"./route-preload-CTuS4GFj.js";var x=n(),S=e(t(),1),C=r(),w=[`overview`,`appearance`,`keyboard-shortcuts`,`personal`,`system`,`desktop-pet`,`desktop-app`,`agent-defaults`,`gateway`,`runtimes`,`devices`,`remote-access`,`shares`],T=(0,S.lazy)(()=>g().then(e=>({default:e.SetupStatusPanel}))),E=(0,S.lazy)(()=>m().then(e=>({default:e.AppearanceSettingsPanel}))),D=(0,S.lazy)(()=>p().then(e=>({default:e.KeyboardShortcutsSettingsPanel}))),O=(0,S.lazy)(()=>d().then(e=>({default:e.PersonalSettingsPanel}))),k=(0,S.lazy)(()=>l().then(e=>({default:e.SystemSettingsPanel}))),A=(0,S.lazy)(()=>f().then(e=>({default:e.DesktopPetSettings}))),j=(0,S.lazy)(()=>b().then(e=>({default:e.AppManagementSettingsPanel}))),M=(0,S.lazy)(()=>y().then(e=>({default:e.GatewaySettingsPanel}))),N=(0,S.lazy)(()=>c().then(e=>({default:e.RuntimeToolsSettingsPanel}))),P=(0,S.lazy)(()=>u().then(e=>({default:e.RemoteAccessHub}))),F=(0,S.lazy)(()=>h().then(e=>({default:e.SharesSettingsPanel}))),I=(0,S.lazy)(()=>v().then(e=>({default:e.AgentDefaultsSettingsPanel}))),L=(0,S.lazy)(()=>_().then(e=>({default:e.EndpointToolsManagementSettings})));function R(){let e=(0,x.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,C.jsxs)(`div`,{className:`w-full flex-1 px-3 py-8 sm:px-5 xl:px-6`,"aria-busy":!0,children:[(0,C.jsx)(`div`,{className:`h-8 w-48 max-w-full animate-pulse rounded-md bg-surface-hover`}),(0,C.jsx)(`div`,{className:`mt-6 h-36 animate-pulse rounded-xl bg-surface-hover`}),(0,C.jsx)(`div`,{className:`mt-4 h-24 animate-pulse rounded-xl bg-surface-hover`})]}),e[0]=t):t=e[0],t}function z(e){return(0,C.jsx)(S.Suspense,{fallback:(0,C.jsx)(R,{}),children:(0,C.jsx)(e,{})})}function B(){let e=(0,x.c)(28),{section:t}=i(),n=o(V),r,c,l,u,d;if(e[0]!==n||e[1]!==t){d=Symbol.for(`react.early_return_sentinel`);bb0:{let i=s(n);if(!t||!w.includes(t)){let t;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,C.jsx)(a,{to:`/settings/overview`,replace:!0}),e[7]=t):t=e[7],d=t;break bb0}let o=t;if(o===`overview`){let t;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(t=z(T),e[8]=t):t=e[8],d=t;break bb0}let f=i.settingsSections[o];if(o===`appearance`){let t;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(t=z(E),e[9]=t):t=e[9],d=t;break bb0}if(o===`keyboard-shortcuts`){let t;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(t=z(D),e[10]=t):t=e[10],d=t;break bb0}if(o===`personal`){let t;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(t=z(O),e[11]=t):t=e[11],d=t;break bb0}if(o===`system`){let t;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(t=z(k),e[12]=t):t=e[12],d=t;break bb0}if(o===`desktop-pet`){let t;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(t=z(A),e[13]=t):t=e[13],d=t;break bb0}if(o===`desktop-app`){let t;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(t=z(j),e[14]=t):t=e[14],d=t;break bb0}if(o===`agent-defaults`){let t;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(t=z(I),e[15]=t):t=e[15],d=t;break bb0}if(o===`gateway`){let t;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(t=z(M),e[16]=t):t=e[16],d=t;break bb0}if(o===`runtimes`){let t;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(t=z(N),e[17]=t):t=e[17],d=t;break bb0}if(o===`devices`){let t;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(t=z(L),e[18]=t):t=e[18],d=t;break bb0}if(o===`remote-access`){let t;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(t=z(P),e[19]=t):t=e[19],d=t;break bb0}if(o===`shares`){let t;e[20]===Symbol.for(`react.memo_cache_sentinel`)?(t=z(F),e[20]=t):t=e[20],d=t;break bb0}l=`flex w-full flex-col gap-3 px-3 py-8 sm:px-5 xl:px-6`,u=(0,C.jsx)(`h1`,{className:`text-lg font-semibold text-fg`,children:f}),r=`text-sm text-fg-muted`,c=i.settingsPage.comingSoon.replace(`{{title}}`,f)}e[0]=n,e[1]=t,e[2]=r,e[3]=c,e[4]=l,e[5]=u,e[6]=d}else r=e[2],c=e[3],l=e[4],u=e[5],d=e[6];if(d!==Symbol.for(`react.early_return_sentinel`))return d;let f;e[21]!==r||e[22]!==c?(f=(0,C.jsx)(`p`,{className:r,children:c}),e[21]=r,e[22]=c,e[23]=f):f=e[23];let p;return e[24]!==l||e[25]!==u||e[26]!==f?(p=(0,C.jsxs)(`div`,{className:l,children:[u,f]}),e[24]=l,e[25]=u,e[26]=f,e[27]=p):p=e[27],p}function V(e){return e.language}export{B as SettingsPage};
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,r as a}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{n as o}from"./locale-store-Dy1EByeG.js";import{t as s}from"./messages-BAnhwALN.js";import{E as c,M as l,T as u,b as d,c as f,h as p,i as m,j as h,k as g,l as _,n as v,p as y,r as b}from"./route-preload-CuxNu-LB.js";var x=n(),S=e(t(),1),C=r(),w=[`overview`,`appearance`,`keyboard-shortcuts`,`personal`,`system`,`desktop-pet`,`desktop-app`,`agent-defaults`,`gateway`,`runtimes`,`devices`,`remote-access`,`shares`],T=(0,S.lazy)(()=>g().then(e=>({default:e.SetupStatusPanel}))),E=(0,S.lazy)(()=>m().then(e=>({default:e.AppearanceSettingsPanel}))),D=(0,S.lazy)(()=>p().then(e=>({default:e.KeyboardShortcutsSettingsPanel}))),O=(0,S.lazy)(()=>d().then(e=>({default:e.PersonalSettingsPanel}))),k=(0,S.lazy)(()=>l().then(e=>({default:e.SystemSettingsPanel}))),A=(0,S.lazy)(()=>f().then(e=>({default:e.DesktopPetSettings}))),j=(0,S.lazy)(()=>b().then(e=>({default:e.AppManagementSettingsPanel}))),M=(0,S.lazy)(()=>y().then(e=>({default:e.GatewaySettingsPanel}))),N=(0,S.lazy)(()=>c().then(e=>({default:e.RuntimeToolsSettingsPanel}))),P=(0,S.lazy)(()=>u().then(e=>({default:e.RemoteAccessHub}))),F=(0,S.lazy)(()=>h().then(e=>({default:e.SharesSettingsPanel}))),I=(0,S.lazy)(()=>v().then(e=>({default:e.AgentDefaultsSettingsPanel}))),L=(0,S.lazy)(()=>_().then(e=>({default:e.EndpointToolsManagementSettings})));function R(){let e=(0,x.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,C.jsxs)(`div`,{className:`w-full flex-1 px-3 py-8 sm:px-5 xl:px-6`,"aria-busy":!0,children:[(0,C.jsx)(`div`,{className:`h-8 w-48 max-w-full animate-pulse rounded-md bg-surface-hover`}),(0,C.jsx)(`div`,{className:`mt-6 h-36 animate-pulse rounded-xl bg-surface-hover`}),(0,C.jsx)(`div`,{className:`mt-4 h-24 animate-pulse rounded-xl bg-surface-hover`})]}),e[0]=t):t=e[0],t}function z(e){return(0,C.jsx)(S.Suspense,{fallback:(0,C.jsx)(R,{}),children:(0,C.jsx)(e,{})})}function B(){let e=(0,x.c)(28),{section:t}=i(),n=o(V),r,c,l,u,d;if(e[0]!==n||e[1]!==t){d=Symbol.for(`react.early_return_sentinel`);bb0:{let i=s(n);if(!t||!w.includes(t)){let t;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,C.jsx)(a,{to:`/settings/overview`,replace:!0}),e[7]=t):t=e[7],d=t;break bb0}let o=t;if(o===`overview`){let t;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(t=z(T),e[8]=t):t=e[8],d=t;break bb0}let f=i.settingsSections[o];if(o===`appearance`){let t;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(t=z(E),e[9]=t):t=e[9],d=t;break bb0}if(o===`keyboard-shortcuts`){let t;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(t=z(D),e[10]=t):t=e[10],d=t;break bb0}if(o===`personal`){let t;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(t=z(O),e[11]=t):t=e[11],d=t;break bb0}if(o===`system`){let t;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(t=z(k),e[12]=t):t=e[12],d=t;break bb0}if(o===`desktop-pet`){let t;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(t=z(A),e[13]=t):t=e[13],d=t;break bb0}if(o===`desktop-app`){let t;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(t=z(j),e[14]=t):t=e[14],d=t;break bb0}if(o===`agent-defaults`){let t;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(t=z(I),e[15]=t):t=e[15],d=t;break bb0}if(o===`gateway`){let t;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(t=z(M),e[16]=t):t=e[16],d=t;break bb0}if(o===`runtimes`){let t;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(t=z(N),e[17]=t):t=e[17],d=t;break bb0}if(o===`devices`){let t;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(t=z(L),e[18]=t):t=e[18],d=t;break bb0}if(o===`remote-access`){let t;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(t=z(P),e[19]=t):t=e[19],d=t;break bb0}if(o===`shares`){let t;e[20]===Symbol.for(`react.memo_cache_sentinel`)?(t=z(F),e[20]=t):t=e[20],d=t;break bb0}l=`flex w-full flex-col gap-3 px-3 py-8 sm:px-5 xl:px-6`,u=(0,C.jsx)(`h1`,{className:`text-lg font-semibold text-fg`,children:f}),r=`text-sm text-fg-muted`,c=i.settingsPage.comingSoon.replace(`{{title}}`,f)}e[0]=n,e[1]=t,e[2]=r,e[3]=c,e[4]=l,e[5]=u,e[6]=d}else r=e[2],c=e[3],l=e[4],u=e[5],d=e[6];if(d!==Symbol.for(`react.early_return_sentinel`))return d;let f;e[21]!==r||e[22]!==c?(f=(0,C.jsx)(`p`,{className:r,children:c}),e[21]=r,e[22]=c,e[23]=f):f=e[23];let p;return e[24]!==l||e[25]!==u||e[26]!==f?(p=(0,C.jsxs)(`div`,{className:l,children:[u,f]}),e[24]=l,e[25]=u,e[26]=f,e[27]=p):p=e[27],p}function V(e){return e.language}export{B as SettingsPage};
@@ -0,0 +1,3 @@
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-Dy1EByeG.js";import{t as f}from"./messages-BAnhwALN.js";import{a as p,i as m,n as h,o as g,r as _,s as v,t as y}from"./dist-CY7CS_D3.js";import{C as b,U as x,V as S,nt as C,t as w}from"./chat-page-BhPw56Vc.js";import{t as T}from"./arrow-left-D880xG-P.js";import{f as E,i as D,u as O}from"./automation-display-DaVDNZz8.js";import{t as k}from"./check-DUBLcKHA.js";import{t as A}from"./chevron-right-BweFrslA.js";import{n as j,r as M}from"./popover-select-CLsphyzA.js";import{t as N}from"./circle-BoO4YvTx.js";import{t as P}from"./ellipsis-0k4rZLoy.js";import{t as F}from"./external-link-DjqjBmc3.js";import{t as I}from"./folder-kanban-CpLlFI1o.js";import{t as L}from"./folder-open-CyzJ19I9.js";import{F as R,N as z,V as ee,z as te}from"./markdown-view-BlxIaCCQ.js";import{t as ne}from"./message-square-fVE7Ghj1.js";import{t as re}from"./pause-DuPxgSxk.js";import{t as ie}from"./play-kxZvpBg8.js";import{t as ae}from"./x-B_N4OPjy.js";import{t as B}from"./cn-0WouolD0.js";import{t as oe}from"./skeleton-DzdOeGYz.js";import{c as se}from"./api-B4FJ51EC.js";import{dt as ce,ft as le}from"./session-manager-D2LaQymu.js";import{i as ue}from"./vendor-swr-CdRzEUwF.js";import{C as V,D as de,T as fe,_ as pe,a as me,f as he,i as ge,l as _e,n as ve,r as ye,t as be,u as xe,x as Se}from"./workspace-preview-store-Do31QQH5.js";import{t as Ce}from"./chat-agents-api-CjlzCSmC.js";import{t as H}from"./button-Cc4hUNTt.js";import{n as we}from"./right-workspace-store-HPw7Gw0n.js";import{s as Te}from"./composer-payload-handoff-Dc43dgSg.js";import{t as Ee}from"./page-header-store-Bm8oxpFR.js";import{t as De}from"./agent-avatar-display-loBdGw_i.js";import{t as Oe}from"./automation-api-DxBmyzp0.js";import{t as ke}from"./sliding-tab-list-CmcrqRzN.js";import{t as Ae}from"./confirm-dialog-DrA5mTQp.js";import{l as je,m as Me,o as Ne,r as Pe,t as Fe,u as Ie}from"./dist-ZrL34Ps4.js";import{a as U,c as Le,d as Re,l as ze,u as Be}from"./automation-task-card-CiJmJ7_h.js";import{t as Ve}from"./date-picker-XnE3iFhG.js";import{t as He}from"./time-picker-C1PXAXZF.js";import{n as Ue}from"./date-formatters-DukWSVwc.js";import{t as We}from"./date-time-picker-VGKm0HVn.js";import{n as Ge,r as W,t as Ke}from"./task-result-evidence-CSJeB9AH.js";import{t as qe}from"./page-context-capture-button-Dibmspef.js";import{t as Je}from"./dependency-picker-XjPB8FJS.js";var G=e(t(),1),K=n(),q=r();function Ye(e,t,n){let r=new URLSearchParams(e),i=r.getAll(`taskPanel`).filter(e=>e!==t&&e!==`${t}:closed`);r.delete(`taskPanel`);for(let e of i)r.append(`taskPanel`,e);return r.append(`taskPanel`,n?t:`${t}:closed`),r}function Xe(e){let t=(0,K.c)(32),n,r,i,o,s,c,l;t[0]===e?(n=t[1],r=t[2],i=t[3],o=t[4],s=t[5],c=t[6],l=t[7]):({panelId:r,title:l,defaultOpen:s,children:n,summaryClassName:o,chevron:c,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=s,t[6]=c,t[7]=l);let u=s!==void 0&&s,d=c!==void 0&&c,[f,p]=a(),m;if(t[8]!==u||t[9]!==r||t[10]!==f){let e=f.getAll(`taskPanel`);m=e.includes(r)||u&&!e.includes(`${r}:closed`),t[8]=u,t[9]=r,t[10]=f,t[11]=m}else m=t[11];let h=m,g=o??`cursor-pointer py-2 text-xs text-fg-muted hover:text-fg`,_=d&&`flex list-none items-center justify-between gap-3 [&::-webkit-details-marker]:hidden`,v;t[12]!==g||t[13]!==_?(v=B(g,_),t[12]=g,t[13]=_,t[14]=v):v=t[14];let y;t[15]!==h||t[16]!==r||t[17]!==p?(y=e=>{e.preventDefault(),p(e=>Ye(e,r,!h),{preventScrollReset:!0})},t[15]=h,t[16]=r,t[17]=p,t[18]=y):y=t[18];let b;t[19]!==d||t[20]!==h||t[21]!==l?(b=d?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{className:`min-w-0 flex-1`,children:l}),(0,q.jsx)(A,{"aria-hidden":!0,className:B(`size-4 shrink-0 text-fg-subtle motion-safe:transition-transform motion-safe:duration-150`,h&&`rotate-90`)})]}):l,t[19]=d,t[20]=h,t[21]=l,t[22]=b):b=t[22];let x;t[23]!==v||t[24]!==y||t[25]!==b?(x=(0,q.jsx)(`summary`,{className:v,onClick:y,children:b}),t[23]=v,t[24]=y,t[25]=b,t[26]=x):x=t[26];let S;return t[27]!==n||t[28]!==h||t[29]!==i||t[30]!==x?(S=(0,q.jsxs)(`details`,{...i,open:h,children:[x,n]}),t[27]=n,t[28]=h,t[29]=i,t[30]=x,t[31]=S):S=t[31],S}function Ze(e){let t=e;for(;t&&!/(auto|scroll)/.test(getComputedStyle(t).overflowY);)t=t.parentElement;return t}function Qe(e,t){let n=e?.closest(`.task-detail-scroll`),r=Array.from(n?.querySelectorAll(`[data-task-section]`)??[]).find(e=>e.dataset.taskSection===t);if(!r||!n)return;r instanceof HTMLDetailsElement&&(r.open=!0);let i=Ze(n),a=window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;if(!i){r.scrollIntoView({block:`start`,behavior:a?`instant`:`smooth`});return}let o=(e?.parentElement?.getBoundingClientRect().height??0)+16,s=Math.max(0,Math.min(i.scrollHeight-i.clientHeight,i.scrollTop+r.getBoundingClientRect().top-i.getBoundingClientRect().top-i.clientTop-o));i.scrollTo({top:s,behavior:a?`instant`:`smooth`});let c=i;return{cancel:()=>c.scrollTo({top:c.scrollTop,behavior:`instant`}),isComplete:()=>Math.abs(c.scrollTop-s)<1}}function $e(e){let t=(0,K.c)(28),{language:n,hasSchedule:r}=e,[i,o]=a(),s;t[0]===i?s=t[1]:(s=i.get(`taskSection`),t[0]=i,t[1]=s);let c=s,l=(0,G.useRef)(null),u=(0,G.useRef)(null),d=(0,G.useRef)(null),f=(0,G.useRef)(void 0),p=(0,G.useRef)(o),m=(0,G.useRef)(c),h,g;t[2]!==c||t[3]!==o?(h=()=>{p.current=o,m.current=c},g=[o,c],t[2]=c,t[3]=o,t[4]=h,t[5]=g):(h=t[4],g=t[5]),(0,G.useEffect)(h,g);let _=(0,G.useRef)(void 0),v=(0,G.useRef)(!1),y;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(y=()=>{let e=d.current;d.current=null,_.current=void 0,!(!e||!v.current)&&(v.current=!1,p.current(t=>{let n=Ye(t,e,!0);return n.set(`taskSection`,e),n},{preventScrollReset:!0}))},t[6]=y):y=t[6];let b=y,x;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(x=(e,t)=>{let n=t!==void 0&&t;clearTimeout(f.current),d.current=e,v.current=n,f.current=setTimeout(b,800),_.current=Qe(l.current,e)},t[7]=x):x=t[7];let S=x,[C,w]=(0,G.useState)(c??`results`),T;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(T=[],t[8]=T):T=t[8];let[E,D]=(0,G.useState)(T),O;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(O=()=>{let e=l.current,t=e?.closest(`.task-detail-scroll`),n=e?.parentElement;if(!t||!n)return;let r=Array.from(t.querySelectorAll(`[data-task-section]`));D(r.map(et));let i=0,a=()=>{if(d.current)return;let e=Ze(t),i=n.getBoundingClientRect().bottom+24,a=r[0];for(let e of r)e.getBoundingClientRect().top<=i&&(a=e);if(e&&e.scrollHeight>e.clientHeight&&e.scrollTop+e.clientHeight>=e.scrollHeight-2&&(a=r.at(-1)),!a)return;let o=a.dataset.taskSection;w(o),m.current!==o&&(u.current=o,clearTimeout(f.current),f.current=setTimeout(()=>{p.current(e=>{let t=new URLSearchParams(e);return t.set(`taskSection`,o),t},{replace:!0,preventScrollReset:!0})},160))},o=e=>{if(!(!(e.target instanceof Element)||!e.target.contains(t))){if(d.current){clearTimeout(f.current),f.current=setTimeout(b,160);return}clearTimeout(f.current),i||=requestAnimationFrame(()=>{i=0,a()})}},s=n=>{!(n.target instanceof Node)||!t.contains(n.target)||e.contains(n.target)||n instanceof KeyboardEvent&&![`ArrowUp`,`ArrowDown`,`PageUp`,`PageDown`,`Home`,`End`,` `].includes(n.key)||(_.current?.cancel(),_.current=void 0,d.current=null,v.current=!1,clearTimeout(f.current))},c=e=>{e.target instanceof Element&&e.target.contains(t)&&d.current&&(!_.current||_.current.isComplete())&&(clearTimeout(f.current),b())},h=()=>{let e=n.getBoundingClientRect().height;for(let t of r)t.style.scrollMarginTop=`${e+16}px`};h();let g=typeof ResizeObserver>`u`?null:new ResizeObserver(h);return g?.observe(n),window.addEventListener(`resize`,h),document.addEventListener(`scroll`,o,!0),document.addEventListener(`scrollend`,c,!0),document.addEventListener(`wheel`,s,{capture:!0,passive:!0}),document.addEventListener(`touchstart`,s,{capture:!0,passive:!0}),document.addEventListener(`pointerdown`,s,{capture:!0,passive:!0}),document.addEventListener(`keydown`,s,!0),()=>{cancelAnimationFrame(i),g?.disconnect(),window.removeEventListener(`resize`,h),document.removeEventListener(`scroll`,o,!0),document.removeEventListener(`scrollend`,c,!0),document.removeEventListener(`wheel`,s,!0),document.removeEventListener(`touchstart`,s,!0),document.removeEventListener(`pointerdown`,s,!0),document.removeEventListener(`keydown`,s,!0)}},t[9]=O):O=t[9];let k;t[10]!==r||t[11]!==n?(k=[n,r,b],t[10]=r,t[11]=n,t[12]=k):k=t[12],(0,G.useEffect)(O,k);let A,j;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(j=()=>()=>{clearTimeout(f.current),_.current?.cancel()},A=[],t[13]=A,t[14]=j):(A=t[13],j=t[14]),(0,G.useEffect)(j,A);let M,N;t[15]===c?(M=t[16],N=t[17]):(M=()=>{!c||u.current===c||(u.current=c,w(c),S(c))},N=[c,S],t[15]=c,t[16]=M,t[17]=N),(0,G.useEffect)(M,N);let P;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(P=()=>{let e=l.current,t=e?.querySelector(`[aria-current="location"]`);if(!e||!t)return;let n=t.offsetLeft<e.scrollLeft?t.offsetLeft:t.offsetLeft+t.offsetWidth>e.scrollLeft+e.clientWidth?t.offsetLeft+t.offsetWidth-e.clientWidth:e.scrollLeft;n!==e.scrollLeft&&e.scrollTo({left:n,behavior:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches?`instant`:`smooth`})},t[18]=P):P=t[18];let F;t[19]!==C||t[20]!==E?(F=[C,E],t[19]=C,t[20]=E,t[21]=F):F=t[21],(0,G.useEffect)(P,F);let I=n===`zh`?`任务详情分区`:`Task detail sections`,L;t[22]!==C||t[23]!==E?(L=E.map(e=>(0,q.jsx)(`button`,{type:`button`,"aria-current":C===e.id?`location`:void 0,"aria-pressed":C===e.id,"data-sliding-active":C===e.id,className:B(`relative z-10 min-h-9 min-w-max flex-1 touch-manipulation rounded-lg px-3 text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,C===e.id?`text-fg`:`text-fg-muted hover:text-fg`),onClick:()=>{u.current=e.id,w(e.id),S(e.id,!0)},children:e.label},e.id)),t[22]=C,t[23]=E,t[24]=L):L=t[24];let R;return t[25]!==I||t[26]!==L?(R=(0,q.jsx)(ke,{scrollFocusedItemIntoView:!1,as:`nav`,ref:l,"aria-label":I,className:`flex w-full gap-0.5 overflow-x-auto rounded-xl bg-surface-inset p-1`,indicatorClassName:`rounded-lg bg-surface-panel ring-1 ring-edge-subtle duration-300 [transition-timing-function:cubic-bezier(0.22,1,0.36,1)]`,children:L}),t[25]=I,t[26]=L,t[27]=R):R=t[27],R}function et(e){return{id:e.dataset.taskSection,label:e.dataset.taskSectionLabel}}var tt=`Default criteria were not expanded into concrete acceptance items; broad completion cannot certify item coverage.`;function nt(e){let t=(0,K.c)(64),{criterion:n,index:r,language:i,closed:a,pending:o,onReview:s,projectId:c,conversationId:l}=e,u=i===`zh`,d=(0,G.useId)(),f=n.status===`passed`,p=n.evidence.length>0||n.method||n.review||n.note,m=n.verificationStatus===`passed`?u?`通过`:`Passed`:n.verificationStatus===`failed`?u?`未通过`:`Failed`:u?`未核验`:`Unverified`,h=n.review?.status===`passed`?u?`已验收`:`Accepted`:n.review?.status===`failed`?u?`未通过`:`Failed`:u?`已撤销验收`:`Acceptance cleared`,g=!a&&!o&&`cursor-pointer`,_;t[0]===g?_=t[1]:(_=B(`relative grid size-11 shrink-0 place-items-center rounded-full`,g),t[0]=g,t[1]=_);let v=o||void 0,y;t[2]!==r||t[3]!==s||t[4]!==o?(y=e=>{o||s(r,e.target.checked?`passed`:`unverified`)},t[2]=r,t[3]=s,t[4]=o,t[5]=y):y=t[5];let b;t[6]!==f||t[7]!==a||t[8]!==v||t[9]!==y||t[10]!==d?(b=(0,q.jsx)(`input`,{type:`checkbox`,"aria-labelledby":d,className:`peer sr-only`,checked:f,disabled:a,"aria-disabled":v,onChange:y}),t[6]=f,t[7]=a,t[8]=v,t[9]=y,t[10]=d,t[11]=b):b=t[11];let x=f?`border-edge bg-surface-inset text-fg`:`border-fg-subtle/70`,S=!a&&!o&&`hover:bg-surface-hover`,C;t[12]!==x||t[13]!==S?(C=B(`grid size-5 place-items-center rounded-full border motion-safe:transition-colors motion-safe:duration-150 peer-focus-visible:ring-2 peer-focus-visible:ring-accent peer-focus-visible:ring-offset-2 peer-focus-visible:ring-offset-surface-panel`,x,S),t[12]=x,t[13]=S,t[14]=C):C=t[14];let w;t[15]===f?w=t[16]:(w=f?(0,q.jsx)(k,{className:`size-3.5`,strokeWidth:2.8}):null,t[15]=f,t[16]=w);let T;t[17]!==C||t[18]!==w?(T=(0,q.jsx)(`span`,{"aria-hidden":!0,className:C,children:w}),t[17]=C,t[18]=w,t[19]=T):T=t[19];let E;t[20]!==T||t[21]!==_||t[22]!==b?(E=(0,q.jsxs)(`label`,{className:_,children:[b,T]}),t[20]=T,t[21]=_,t[22]=b,t[23]=E):E=t[23];let D=`criterion:${r}:evidence`,O;t[24]!==n.text||t[25]!==d?(O=(0,q.jsx)(`span`,{id:d,className:`block whitespace-pre-wrap break-words text-sm leading-5 text-fg [overflow-wrap:anywhere]`,children:n.text}),t[24]=n.text,t[25]=d,t[26]=O):O=t[26];let A=u?`验收依据`:`Acceptance evidence`,j;t[27]===A?j=t[28]:(j=(0,q.jsx)(`p`,{className:`font-medium text-fg`,children:A}),t[27]=A,t[28]=j);let M;t[29]!==n.method||t[30]!==m||t[31]!==u?(M=n.method?(0,q.jsxs)(`p`,{children:[u?`自动核验`:`Automatic verification`,` · `,m,n.method===`model_reviewed`?u?` · 模型审阅`:` · Model review`:``]}):null,t[29]=n.method,t[30]=m,t[31]=u,t[32]=M):M=t[32];let N;t[33]!==n.review||t[34]!==i||t[35]!==h||t[36]!==u?(N=n.review?(0,q.jsxs)(`p`,{children:[u?`人工验收`:`User review`,` · `,h,` · `,Ue(n.review.reviewedAt,i)]}):null,t[33]=n.review,t[34]=i,t[35]=h,t[36]=u,t[37]=N):N=t[37];let P;t[38]!==n.note||t[39]!==r||t[40]!==i?(P=n.note&&n.note!==tt?(0,q.jsx)(W,{content:n.note,contentKey:`criterion:${r}:note`,language:i,markdown:!1}):null,t[38]=n.note,t[39]=r,t[40]=i,t[41]=P):P=t[41];let F;t[42]!==l||t[43]!==n.evidence||t[44]!==i||t[45]!==c?(F=(0,q.jsx)(Ke,{evidence:n.evidence,projectId:c,conversationId:l,language:i}),t[42]=l,t[43]=n.evidence,t[44]=i,t[45]=c,t[46]=F):F=t[46];let I;t[47]!==p||t[48]!==u?(I=p?null:(0,q.jsx)(`p`,{children:u?`暂无验收依据`:`No evidence yet`}),t[47]=p,t[48]=u,t[49]=I):I=t[49];let L;t[50]!==j||t[51]!==M||t[52]!==N||t[53]!==P||t[54]!==F||t[55]!==I?(L=(0,q.jsxs)(`div`,{className:`mb-3 space-y-2 rounded-lg bg-surface-inset px-3 py-2.5 text-xs leading-5 text-fg-muted`,children:[j,M,N,P,F,I]}),t[50]=j,t[51]=M,t[52]=N,t[53]=P,t[54]=F,t[55]=I,t[56]=L):L=t[56];let R;t[57]!==D||t[58]!==O||t[59]!==L?(R=(0,q.jsx)(Xe,{panelId:D,chevron:!0,className:`min-w-0 flex-1`,summaryClassName:`-ms-1 min-h-11 cursor-pointer rounded-lg py-3 pe-2 ps-1 outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent`,title:O,children:L}),t[57]=D,t[58]=O,t[59]=L,t[60]=R):R=t[60];let z;return t[61]!==E||t[62]!==R?(z=(0,q.jsxs)(`li`,{className:`relative flex min-w-0 items-start px-2 before:absolute before:end-0 before:start-13 before:top-0 before:border-t before:border-edge-subtle first:before:hidden sm:px-3`,children:[E,R]}),t[61]=E,t[62]=R,t[63]=z):z=t[63],z}function rt(e){let t=(0,K.c)(39),{criteria:n,language:r,closed:i,pending:a,blockedReason:o,error:s,onReview:c,projectId:l,conversationId:u}=e,d=r===`zh`,f;t[0]===n?f=t[1]:(f=n.some(at),t[0]=n,t[1]=f);let p=f,m;t[2]!==p||t[3]!==d?(m=p?(0,q.jsx)(Xe,{panelId:`acceptance:diagnostic`,title:d?`自动核验未完成:验收标准过于宽泛`:`Automatic verification incomplete: criteria are too broad`,className:`mx-4 mb-2 text-xs leading-5 text-fg-muted`,children:(0,q.jsx)(`p`,{className:`mt-2 break-words`,children:tt})}):null,t[2]=p,t[3]=d,t[4]=m):m=t[4];let h=a||void 0,g;if(t[5]!==i||t[6]!==u||t[7]!==n||t[8]!==r||t[9]!==c||t[10]!==a||t[11]!==l){let e;t[13]!==i||t[14]!==u||t[15]!==r||t[16]!==c||t[17]!==a||t[18]!==l?(e=(e,t)=>(0,q.jsx)(nt,{criterion:e,index:t,language:r,closed:i,pending:a,onReview:c,projectId:l,conversationId:u},`${t}:${e.text}`),t[13]=i,t[14]=u,t[15]=r,t[16]=c,t[17]=a,t[18]=l,t[19]=e):e=t[19],g=n.map(e),t[5]=i,t[6]=u,t[7]=n,t[8]=r,t[9]=c,t[10]=a,t[11]=l,t[12]=g}else g=t[12];let _;t[20]!==h||t[21]!==g?(_=(0,q.jsx)(`ul`,{"aria-busy":h,className:`border-t border-edge-subtle`,children:g}),t[20]=h,t[21]=g,t[22]=_):_=t[22];let v;t[23]!==n.length||t[24]!==d?(v=n.length===0?(0,q.jsx)(`p`,{className:`px-4 py-4 text-sm text-fg-muted`,children:d?`尚未定义验收标准`:`No acceptance criteria defined`}):null,t[23]=n.length,t[24]=d,t[25]=v):v=t[25];let y;t[26]===s?y=t[27]:(y=s?(0,q.jsx)(`p`,{role:`alert`,className:`mx-4 my-2 text-sm text-danger`,children:s}):null,t[26]=s,t[27]=y);let b;t[28]!==o||t[29]!==i||t[30]!==n||t[31]!==d?(b=!i&&n.length>0&&(o||n.some(it))?(0,q.jsx)(`p`,{className:`border-t border-edge-subtle px-4 py-2.5 text-xs text-fg-muted`,children:o??(d?`勾选全部验收项后,任务自动完成。`:`Checking all criteria completes the task.`)}):null,t[28]=o,t[29]=i,t[30]=n,t[31]=d,t[32]=b):b=t[32];let x;return t[33]!==m||t[34]!==_||t[35]!==v||t[36]!==y||t[37]!==b?(x=(0,q.jsxs)(q.Fragment,{children:[m,_,v,y,b]}),t[33]=m,t[34]=_,t[35]=v,t[36]=y,t[37]=b,t[38]=x):x=t[38],x}function it(e){return e.status!==`passed`}function at(e){return e.note===tt}function ot(e){let t=(0,K.c)(22),{detail:n,language:r}=e,i=r===`zh`,a;if(t[0]!==n||t[1]!==r||t[2]!==i){let e=ve(n),s;if(t[4]!==n.runs||t[5]!==n.task){let e;t[7]===n.task?e=t[8]:(e=e=>e.contractVersion===n.task.latestContractVersion,t[7]=n.task,t[8]=e),s=new Set(n.runs.filter(e).map(ft)),t[4]=n.runs,t[5]=n.task,t[6]=s}else s=t[6];let c=s,l;if(t[9]!==n.context||t[10]!==n.receipts||t[11]!==c){l=n.context.filter(dt).map(ut);let e=new Set(l.map(lt).filter(Boolean)),r;t[13]===c?r=t[14]:(r=e=>c.has(e.runId),t[13]=c,t[14]=r);for(let t of n.receipts.filter(r))for(let n of t.evidence.filter(ct))n.uri&&e.has(n.uri)||(n.uri&&e.add(n.uri),l.push(n));t[9]=n.context,t[10]=n.receipts,t[11]=c,t[12]=l}else l=t[12];let u=e?.summary.trim(),d=u&&u.length<=160&&!u.includes(`
2
+ `)&&!/\b(?:Claim|Criterion|Research claim)\b|c-ac\d|Default criteria were not/i.test(u)?u:void 0,f=i?`交付结果`:`Deliverables`,p;t[15]===f?p=t[16]:(p=(0,q.jsx)(`h2`,{id:`task-results-heading`,className:`text-sm font-semibold text-fg`,children:f}),t[15]=f,t[16]=p);let m;t[17]!==n||t[18]!==l||t[19]!==r||t[20]!==i?(m=l.length>0?(0,q.jsx)(Ke,{evidence:l,language:r,projectId:n.task.projectId,conversationId:n.conversation.activeConversationId??void 0,compact:!0}):(0,q.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:i?`尚无可查看的交付物`:`No deliverables available yet`}),t[17]=n,t[18]=l,t[19]=r,t[20]=i,t[21]=m):m=t[21],a=(0,q.jsxs)(`section`,{"aria-label":i?`交付结果`:`Deliverables`,className:`rounded-xl border border-edge-subtle bg-surface-panel p-4`,children:[p,d?(0,q.jsx)(`p`,{className:`mt-2 break-words text-sm leading-6 text-fg-muted [overflow-wrap:anywhere]`,children:d}):null,e&&e.completionVerdict!==`achieved`?(0,q.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:i?`本次执行尚未报告目标全部达成。`:`This run has not reported the full goal achieved.`}):null,m,e?null:(0,q.jsx)(`p`,{className:`mt-2 text-xs text-fg-subtle`,children:i?`尚无本版任务的执行结果`:`No run result for this task version`}),e&&(e.needsUser||e.remainingWork.length>0||e.nextAction||e.failure)?(0,q.jsxs)(`div`,{className:`mt-4 space-y-2 border-t border-edge-subtle pt-3`,"aria-label":i?`执行待办`:`Run follow-up`,children:[(0,q.jsx)(`h3`,{className:`text-xs font-medium text-fg-muted`,children:e.needsUser?i?`需要你决定`:`Your decision needed`:i?`待处理事项`:`Remaining work`}),e.remainingWork.length>0?(0,q.jsx)(`ul`,{className:`space-y-2 text-sm leading-6 text-fg`,children:[...new Set(e.remainingWork)].map(st)}):null,e.nextAction?(0,q.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-sm leading-6 text-fg [overflow-wrap:anywhere]`,children:e.nextAction}):null,e.failure?(0,q.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-sm leading-6 text-danger [overflow-wrap:anywhere]`,children:e.failure.recoveryAction}):null,e.needsUser?(0,q.jsx)(o,{className:`inline-flex min-h-9 items-center rounded-sm text-xs font-medium text-accent-fg hover:underline focus-visible:ring-2 focus-visible:ring-accent/40`,to:z(n.task.id),children:i?`查看并决定`:`Review and decide`}):null]}):null]}),t[0]=n,t[1]=r,t[2]=i,t[3]=a}else a=t[3];return a}function st(e){return(0,q.jsx)(`li`,{className:`whitespace-pre-wrap break-words [overflow-wrap:anywhere]`,children:e},e)}function ct(e){return e.kind===`artifact`}function lt(e){return e.uri}function ut(e){return{kind:[`file`,`url`].includes(e.targetKind)?`artifact`:`source`,title:e.title??e.targetId,summary:``,...[`file`,`url`].includes(e.targetKind)?{uri:e.targetId}:{},provenance:`user`,strength:`observed`,observedAt:0}}function dt(e){return e.role===`deliverable`}function ft(e){return e.id}function pt(e){let t=(0,K.c)(13),{detail:n,language:r}=e,i=r===`zh`,a=Te(r),o;t[0]===n?o=t[1]:(o=ve(n),t[0]=n,t[1]=o);let s=o,c;t[2]===s?.runId?c=t[3]:(c=e=>e.runId!==s?.runId,t[2]=s?.runId,t[3]=c);let l=n.receipts.filter(c),[u,d]=(0,G.useState)(`idle`),f;t[4]===s?f=t[5]:(f=async function(e){if(s){d(`pending`);try{await V(s.runId,e),d(`saved`)}catch{d(`failed`)}}},t[4]=s,t[5]=f);let p=f,m;t[6]!==n||t[7]!==r?(m=(0,q.jsx)(x,{detail:n,language:r}),t[6]=n,t[7]=r,t[8]=m):m=t[8];let h=s?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,q.jsx)(`h3`,{className:`text-sm font-medium text-fg`,children:a.latestResult}),(0,q.jsxs)(`span`,{className:`text-xs text-fg-muted`,children:[a.receiptStatuses[s.status],` · `,a.verificationStatuses[s.verification.status]]})]}),(0,q.jsx)(W,{content:s.summary,contentKey:`${n.task.id}:result:${s.runId}`,language:r}),s.evidence.length>0?(0,q.jsxs)(`details`,{children:[(0,q.jsxs)(`summary`,{className:`cursor-pointer py-2 text-xs text-fg-muted`,children:[i?`验证依据与执行产物`:`Evidence and artifacts`,` · `,s.evidence.length]}),(0,q.jsx)(Ke,{evidence:s.evidence,projectId:n.task.projectId,conversationId:n.conversation.activeConversationId??void 0,language:r})]}):null,(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-t border-edge-subtle pt-3`,children:[(0,q.jsx)(H,{variant:`ghost`,className:`min-h-9 px-2 text-xs`,disabled:u===`pending`,onClick:()=>void p(`helpful`),children:a.doneWell}),(0,q.jsx)(H,{variant:`ghost`,className:`min-h-9 px-2 text-xs`,disabled:u===`pending`,onClick:()=>void p(`not_helpful`),children:a.needsFix}),u===`saved`?(0,q.jsx)(`span`,{role:`status`,className:`text-xs text-fg-muted`,children:i?`反馈已记录`:`Feedback saved`}):null,u===`failed`?(0,q.jsx)(`span`,{role:`alert`,className:`text-xs text-danger`,children:a.actionFailed}):null]})]}):null,g=l.length>0?(0,q.jsxs)(`details`,{className:`border-t border-edge-subtle pt-3`,children:[(0,q.jsx)(`summary`,{className:`cursor-pointer py-2 text-xs text-fg-muted`,children:a.executionHistory.replace(`{{count}}`,String(l.length))}),(0,q.jsx)(`div`,{className:`mt-3 space-y-4`,children:l.map(e=>(0,q.jsxs)(`article`,{className:`space-y-2 rounded-lg bg-surface-hover p-3`,children:[(0,q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:a.receiptStatuses[e.status]}),(0,q.jsx)(W,{content:e.summary,contentKey:`${n.task.id}:result:${e.runId}`,language:r})]},e.runId))})]}):null,_;return t[9]!==m||t[10]!==h||t[11]!==g?(_=(0,q.jsxs)(`div`,{className:`space-y-4`,children:[m,h,g]}),t[9]=m,t[10]=h,t[11]=g,t[12]=_):_=t[12],_}function mt(e){let t=(0,K.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,q.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,q.jsxs)(`li`,{className:`text-sm text-fg`,children:[(0,q.jsxs)(`div`,{children:[o[e.fromPhase],e.fromResolution?` · ${u[e.fromResolution]}`:``,` → `,o[e.toPhase],e.toResolution?` · ${u[e.toResolution]}`:``]}),(0,q.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,q.jsx)(`time`,{dateTime:new Date(e.createdAt).toISOString(),children:Ue(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,q.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,q.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,q.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}function ht({schedules:e,language:t,onEdit:n,onUpdated:r}){let i=t===`zh`,a=f(t),[s,c]=(0,G.useState)(null),l=(0,G.useRef)(!1),[u,d]=(0,G.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 Oe.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,q.jsxs)(`section`,{"aria-label":i?`执行时间`:`Execution schedule`,className:`rounded-xl border border-edge bg-surface-panel p-4`,children:[(0,q.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:i?`执行时间`:`Execution schedule`}),(0,q.jsx)(`div`,{className:`mt-3 space-y-4`,children:e.map(e=>{let r=e.trigger.kind===`schedule`?e.trigger.schedule:null,c=O(e),l=!e.management||e.management.editable.includes(`trigger`),u=!e.management||e.management.editable.includes(`enabled`);return(0,q.jsxs)(`article`,{className:`space-y-2 text-sm text-fg`,children:[(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,q.jsx)(`span`,{className:`break-words font-medium`,children:e.name}),(0,q.jsx)(`span`,{className:`text-xs text-fg-muted`,children:c?i?`已执行`:`Completed`:e.enabled?i?`已启用`:`Enabled`:i?`已取消定时执行`:`Scheduling disabled`})]}),(0,q.jsx)(`p`,{children:r?.kind===`once`?`${i?`单次执行:`:`Run once: `}${p(Date.parse(r.at))}`:D(e.trigger,a.automations,a.cron,t)}),r?.kind===`cron`?(0,q.jsxs)(`p`,{className:`text-xs text-fg-muted`,children:[i?`执行时区:`:`Schedule timezone: `,r.tz||(i?`服务所在电脑时区`:`Server timezone`)]}):null,(0,q.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,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[l?(0,q.jsx)(H,{variant:`secondary`,disabled:s!==null,onClick:()=>n(e),children:i?`修改时间`:`Edit schedule`}):null,e.enabled&&u?(0,q.jsx)(H,{variant:`ghost`,disabled:s!==null,onClick:()=>void m(e),children:s===e.id?i?`正在取消…`:`Cancelling…`:i?`取消定时执行`:`Cancel schedule`}):null,(0,q.jsx)(H,{asChild:!0,variant:`ghost`,children:(0,q.jsx)(o,{to:`/automations?automation=${encodeURIComponent(e.id)}`,children:i?`查看自动化`:`View automation`})})]})]},e.id)})}),u?(0,q.jsx)(`p`,{role:`alert`,className:`mt-3 text-sm text-danger`,children:u}):null]})}var gt=`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 _t({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,G.useState)(()=>c?Be(c):{...Re,name:t,projectId:n??``,actionMode:`task_command`,taskId:e,agentId:r??``,triggerMode:`once`,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`}),[x,S]=(0,G.useState)(null),[C,w]=(0,G.useState)(!1),T=(0,G.useRef)(!1),[E,D]=(0,G.useState)(null),O=e=>b(t=>({...t,...e}));async function k(e){if(e.preventDefault(),!(T.current||x)&&(D(null),!(!d.name.trim()||!c&&!r))){if(d.triggerMode===`once`&&(!Number.isFinite(new Date(d.onceAt).getTime())||new Date(d.onceAt).getTime()<=Date.now())){D(u.experience.futureTime);return}T.current=!0,w(!0);try{let e=c?Le(c,d).trigger:ze(d).trigger,{automation:t}=c?await Oe.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 Oe.create({...ze(d),enabled:!0});S(t),s(t)}catch(e){D(e instanceof Error?e.message:u.feedback.actionFailed)}finally{T.current=!1,w(!1)}}}return(0,q.jsx)(y,{open:!0,onOpenChange:e=>{!e&&!T.current&&a()},children:(0,q.jsxs)(g,{children:[(0,q.jsx)(p,{className:`fixed inset-0 z-[110] bg-black/45`}),(0,q.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,q.jsxs)(`header`,{className:`flex shrink-0 items-center justify-between gap-3 border-b border-edge-subtle px-5 py-4`,children:[(0,q.jsx)(v,{className:`text-base font-semibold text-fg`,children:c?l?`修改执行时间`:`Edit execution schedule`:l?`设置执行时间`:`Set execution time`}),(0,q.jsx)(h,{asChild:!0,children:(0,q.jsx)(H,{variant:`ghost`,className:`size-9 p-0`,disabled:C,"aria-label":l?`关闭`:`Close`,children:(0,q.jsx)(ae,{className:`size-4`})})})]}),(0,q.jsx)(m,{className:`sr-only`,children:l?`为当前任务创建定时或周期自动化。`:`Create a scheduled or recurring automation for this task.`}),x?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto p-5`,children:[(0,q.jsx)(`p`,{role:`status`,className:`text-sm font-medium text-fg`,children:c?l?`执行时间已更新`:`Schedule updated`:l?`执行时间已设置`:`Schedule created`}),(0,q.jsx)(`p`,{className:`break-words text-sm text-fg-muted`,children:x.name}),(0,q.jsx)(H,{asChild:!0,variant:`primary`,children:(0,q.jsx)(o,{to:`/automations?automation=${encodeURIComponent(x.id)}`,children:l?`查看自动化`:`View automation`})})]}),(0,q.jsx)(`footer`,{className:`shrink-0 border-t border-edge-subtle p-4`,children:(0,q.jsx)(H,{onClick:a,children:l?`完成`:`Done`})})]}):(0,q.jsxs)(`form`,{onSubmit:e=>void k(e),className:`flex min-h-0 flex-1 flex-col`,children:[(0,q.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto p-5`,children:[(0,q.jsxs)(`p`,{className:`break-words text-sm text-fg-muted`,children:[l?`执行任务:`:`Task: `,t]}),(0,q.jsxs)(`fieldset`,{disabled:C,className:`space-y-4`,children:[(0,q.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[u.form.name,(0,q.jsx)(`input`,{required:!0,readOnly:!!c?.management,className:gt,value:d.name,onChange:e=>O({name:e.target.value})})]}),(0,q.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[u.form.trigger,(0,q.jsxs)(j,{value:d.triggerMode,onChange:e=>O({triggerMode:e.target.value}),children:[c?.trigger.kind===`schedule`&&c.trigger.schedule.kind===`interval`?(0,q.jsx)(M,{value:`interval`,children:l?`固定间隔`:`Fixed interval`}):null,c?.trigger.kind===`schedule`&&c.trigger.schedule.kind===`cron`?(0,q.jsx)(M,{value:`cron`,children:l?`自定义规则`:`Custom schedule`}):null,(0,q.jsx)(M,{value:`once`,children:u.trigger.once}),(0,q.jsx)(M,{value:`daily`,children:u.trigger.daily}),(0,q.jsx)(M,{value:`weekly`,children:u.trigger.weekly})]})]}),d.triggerMode===`once`?(0,q.jsx)(We,{label:u.form.onceAt,disabled:C,value:d.onceAt,defaultTime:d.time,onChange:e=>O({onceAt:e})}):[`daily`,`weekly`].includes(d.triggerMode)?(0,q.jsxs)(`div`,{className:`grid gap-2 text-sm text-fg`,children:[(0,q.jsx)(`span`,{children:u.form.time}),(0,q.jsx)(He,{disabled:C,value:d.time,onChange:e=>O({time:e}),ariaLabel:u.form.time})]}):null,d.triggerMode===`weekly`?(0,q.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[u.form.day,(0,q.jsx)(j,{value:d.weekday,onChange:e=>O({weekday:e.target.value}),children:[`sunday`,`monday`,`tuesday`,`wednesday`,`thursday`,`friday`,`saturday`].map((e,t)=>(0,q.jsx)(M,{value:String(t),children:u.weekdays[e]},e))})]}):null,d.triggerMode===`cron`?(0,q.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[l?`定时规则`:`Cron expression`,(0,q.jsx)(`input`,{required:!0,className:gt,value:d.cronExpr,onChange:e=>O({cronExpr:e.target.value})})]}):null,d.triggerMode===`interval`?(0,q.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,q.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[l?`执行间隔`:`Interval`,(0,q.jsx)(`input`,{required:!0,type:`number`,min:`1`,className:gt,value:d.intervalValue,onChange:e=>O({intervalValue:e.target.value})})]}),(0,q.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[l?`单位`:`Unit`,(0,q.jsxs)(j,{value:d.intervalUnit,onChange:e=>O({intervalUnit:e.target.value}),children:[(0,q.jsx)(M,{value:`minute`,children:l?`分钟`:`Minutes`}),(0,q.jsx)(M,{value:`hour`,children:l?`小时`:`Hours`}),(0,q.jsx)(M,{value:`day`,children:l?`天`:`Days`}),(0,q.jsx)(M,{value:`week`,children:l?`周`:`Weeks`})]})]})]}):null,(0,q.jsx)(U,{form:d,onChange:O,language:i}),(0,q.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[u.draft.notifications,(0,q.jsxs)(j,{disabled:!!c?.management,value:d.notificationPolicy,onChange:e=>O({notificationPolicy:e.target.value}),children:[(0,q.jsx)(M,{value:`attention`,children:u.draft.notifyAttention}),(0,q.jsx)(M,{value:`all`,children:u.draft.notifyAll}),(0,q.jsx)(M,{value:`none`,children:u.draft.notifyNone})]})]})]}),!c&&!r?(0,q.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:l?`请先为任务指定执行 Agent。`:`Assign an executor agent to the task first.`}):null,E?(0,q.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:E}):null]}),(0,q.jsxs)(`footer`,{className:`flex shrink-0 justify-end gap-2 border-t border-edge-subtle p-4`,children:[(0,q.jsx)(H,{type:`button`,variant:`ghost`,disabled:C,onClick:a,children:l?`取消`:`Cancel`}),(0,q.jsx)(H,{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 vt(e){let t=(0,K.c)(36),{detail:n,language:r,onUpdated:i}=e,a=r===`zh`,s;t[0]===n.waits?s=t[1]:(s=n.waits.find(St),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(xt):[];let e=l.length>0||n.attention.some(bt),s;t[14]===n?s=t[15]:(s=ve(n),t[14]=n,t[15]=s);let g=s,_=n.runs.some(yt);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 check the criteria that pass.`:_?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,q.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,q.jsxs)(`li`,{className:`text-sm leading-6 text-fg-muted`,children:[(0,q.jsx)(W,{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,q.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:z(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,q.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,q.jsx)(Ge,{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,q.jsxs)(`details`,{className:`mt-3`,children:[(0,q.jsx)(`summary`,{className:`cursor-pointer text-xs text-fg-muted`,children:a?`等待详情`:`Waiting details`}),u]}):null:u??(0,q.jsx)(W,{content:d,contentKey:`${n.task.id}:current-progress`,language:r,previewHeight:72,className:`mt-2 text-sm leading-6 text-fg-muted`,children:(0,q.jsx)(S,{content:le(d),compact:!0})}),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,q.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 yt(e){return!e.parentRunId&&[`queued`,`running`,`waiting`,`verifying`].includes(e.status)}function bt(e){return e.kind===`input_required`||e.kind===`approval_required`}function xt(e){return(e.kind===`user_input`||e.kind===`approval`&&typeof e.condition.capability==`string`)&&e.condition.type!==`connection`}function St(e){return e.kind===`paused`}function Ct(e){let t=(0,K.c)(16),{label:n,title:r,compact:i}=e,a=i&&!!r,o=a&&`-translate-y-2 opacity-0`,s;t[0]===o?s=t[1]:(s=B(`truncate [grid-area:1/1] motion-safe:transition-[opacity,translate] motion-safe:duration-200 motion-safe:ease-out`,o),t[0]=o,t[1]=s);let c;t[2]!==n||t[3]!==a||t[4]!==s?(c=(0,q.jsx)(`span`,{"aria-hidden":a,className:s,children:n}),t[2]=n,t[3]=a,t[4]=s,t[5]=c):c=t[5];let l=!a,u=!a&&`translate-y-2 opacity-0`,d;t[6]===u?d=t[7]:(d=B(`truncate [grid-area:1/1] motion-safe:transition-[opacity,translate] motion-safe:duration-200 motion-safe:ease-out`,u),t[6]=u,t[7]=d);let f;t[8]!==l||t[9]!==d||t[10]!==r?(f=(0,q.jsx)(`span`,{"aria-hidden":l,className:d,children:r}),t[8]=l,t[9]=d,t[10]=r,t[11]=f):f=t[11];let p;return t[12]!==a||t[13]!==c||t[14]!==f?(p=(0,q.jsxs)(`span`,{className:`grid min-w-0 overflow-hidden leading-6`,"data-task-header-compact":a,children:[c,f]}),t[12]=a,t[13]=c,t[14]=f,t[15]=p):p=t[15],p}function wt(e){let t=(0,K.c)(17),{children:n,contentKey:r,language:i,className:o}=e,s=(0,G.useId)(),c=G.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,q.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,q.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,q.jsxs)(`div`,{className:o,children:[m,h]}),t[13]=o,t[14]=m,t[15]=h,t[16]=g):g=t[16],g}function Tt({taskId:e}){let t=l(e=>e.conversationId),n=u(e=>e.language),[r,i]=(0,G.useState)(``),[a,o]=(0,G.useState)(null),[s,f]=(0,G.useState)(!1),[p,m]=(0,G.useState)(!1),[h,g]=(0,G.useState)([]),[_,v]=(0,G.useState)(null),y=c(`/api/tasks/${encodeURIComponent(e)}/collaboration`),{data:b,error:x,mutate:S}=ue([`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,G.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,q.jsxs)(`section`,{className:`rounded-xl border border-edge bg-surface-panel p-4`,children:[(0,q.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:n===`zh`?`任务留言`:`Task updates`}),(0,q.jsxs)(`div`,{className:`mt-3 max-h-64 space-y-2 overflow-y-auto`,children:[!b&&!x?(0,q.jsxs)(`div`,{"aria-busy":`true`,className:`space-y-2`,children:[(0,q.jsx)(oe,{className:`h-14 w-full`}),(0,q.jsx)(oe,{className:`h-14 w-4/5`})]}):null,x?(0,q.jsx)(`p`,{role:`status`,className:`text-xs text-fg-muted`,children:n===`zh`?`暂时无法读取留言`:`Updates unavailable`}):null,C[0]&&C[0].sequence>1?(0,q.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,q.jsxs)(`div`,{className:`rounded-lg bg-surface-base px-3 py-2 text-sm`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-fg-subtle`,children:[(0,q.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,q.jsxs)(`span`,{children:[`· `,t.kind]}),t.deliveryStatus?(0,q.jsxs)(`span`,{children:[`· `,t.deliveryStatus]}):null]}),(0,q.jsx)(`div`,{className:`mt-1 min-w-0 text-fg`,"data-task-collaboration-body":!0,children:(0,q.jsx)(W,{content:t.body,contentKey:`${e}:update:${t.id}`,language:n,breaks:!0,previewHeight:120})}),t.kind===`question`&&t.authorKind===`worker_agent`?(0,q.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,q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:n===`zh`?`暂无进展留言`:`No updates yet`}):null]}),a?(0,q.jsxs)(`p`,{className:`mt-3 text-xs text-accent`,children:[n===`zh`?`正在回复执行 Agent 的问题`:`Replying to the worker`,(0,q.jsx)(`button`,{type:`button`,className:`ml-2 underline`,onClick:()=>o(null),children:n===`zh`?`取消`:`Cancel`})]}):null,(0,q.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,q.jsx)(`p`,{role:`alert`,className:`mt-1 text-xs text-danger`,children:_}):null,(0,q.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 Et(e,t,n,r){return!!(e&&t!==e.version&&n!==e.value&&r!==n)}function Dt(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 Ot(e,t){return(t===`zh`?{backlog:`待规划`,ready:`就绪`,active:`进行中`,review:`待验收`,closed:`已关闭`}:{backlog:`Backlog`,ready:`Ready`,active:`Active`,review:`Review`,closed:`Closed`})[e]}function kt(){let e=(0,K.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,q.jsxs)(`div`,{className:`space-y-4`,"aria-busy":!0,children:[(0,q.jsx)(oe,{className:`h-32 rounded-2xl`}),(0,q.jsx)(oe,{className:`h-52 rounded-2xl`}),(0,q.jsx)(oe,{className:`h-40 rounded-2xl`})]}),e[0]=t):t=e[0],t}function At(e){if(e===void 0)return``;let t=new Date(e);return new Date(t.getTime()-t.getTimezoneOffset()*6e4).toISOString().slice(0,10)}function jt(e){return e?new Date(`${e}T23:59:59.999`).getTime():null}var Mt=[`backlog`,`ready`,`active`,`review`,`closed`],Nt=[`low`,`normal`,`high`,`critical`],Pt=(0,G.memo)(function(e){let t=(0,K.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,q.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=Mt.map(e=>(0,q.jsx)(M,{value:e,disabled:d(e),children:Ot(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,q.jsx)(j,{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,q.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}),Ft=(0,G.memo)(function(e){let t=(0,K.c)(14),{value:n,disabled:r,label:i,labels:a,onChange:o}=e,s;t[0]===i?s=t[1]:(s=(0,q.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=Nt.map(e=>(0,q.jsx)(M,{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,q.jsx)(j,{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,q.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}),It=(0,G.memo)(function(e){let t=(0,K.c)(10),{value:n,disabled:r,label:i,onChange:a}=e,o;t[0]===i?o=t[1]:(o=(0,q.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,q.jsx)(Ve,{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,q.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}),Lt=(0,G.memo)(function(e){let t=(0,K.c)(17),{value:n,disabled:r,label:i,unassignedLabel:a,agents:o,onChange:s}=e,c;t[0]===i?c=t[1]:(c=(0,q.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,q.jsx)(M,{value:``,disabled:!0,children:a}),t[4]=a,t[5]=u);let d;t[6]===o?d=t[7]:(d=o.map(Zt),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,q.jsxs)(j,{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,q.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}),Rt=(0,G.memo)(function(e){let t=(0,K.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(Qt),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,q.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)),zt=`xopc.taskDetail.chatPanelPercent`,Bt=42;function Vt(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?Bt:Math.min(r,Math.max(n,e))}function Ht(){try{let e=Number(window.localStorage.getItem(zt));return Number.isFinite(e)&&e>=30&&e<=60?e:Bt}catch{return Bt}}function Ut(e){let t=(0,K.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,q.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(`
3
+ `),t[2]=n,t[3]=o);let s;t[4]===n?s=t[5]:(s=n.map(J),t[4]=n,t[5]=s);let c;t[6]===s?c=t[7]:(c=(0,q.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,q.jsx)(W,{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 J(e){return(0,q.jsxs)(`li`,{className:`flex gap-2 text-sm leading-6 text-fg`,children:[(0,q.jsx)(N,{className:`mt-1 size-4 shrink-0 text-fg-subtle`}),(0,q.jsx)(`span`,{className:`min-w-0 whitespace-pre-wrap break-words [overflow-wrap:anywhere]`,children:e})]},e)}function Wt(e){return e.language}function Y({taskId:e,presentation:t,backgroundPath:n,onDeleted:r,onHeaderChange:i}){let[c,d]=a(),f=s(),p=u(e=>e.language),m=l(e=>e.conversationId),h=(0,G.useMemo)(()=>Te(p),[p]),g=Ee(e=>e.setPageHeader),_=Ee(e=>e.clearPageHeader),v=we(e=>e.panes),y=b(e=>e.openForSession),{data:x,error:S,mutate:D,lastChange:O,conversationLoading:k,conversationError:A}=C(e),{data:j,error:M,mutate:N}=ue(e?[`task-detail-automations`,m]:null,()=>Oe.list(),{refreshInterval:3e4}),[ae,V]=(0,G.useState)(null),[be,ke]=(0,G.useState)(null),[U,Le]=(0,G.useState)(()=>new Set),[Re,ze]=(0,G.useState)([]),[Be,Ve]=(0,G.useState)(null),[He,We]=(0,G.useState)([]),[Ge,Ke]=(0,G.useState)(!1),[Je,K]=(0,G.useState)(``),[Qe,et]=(0,G.useState)(!1),[tt,nt]=(0,G.useState)(``),[it,at]=(0,G.useState)(Ht),[st,ct]=(0,G.useState)(!1),lt=(0,G.useRef)(null),ut=(0,G.useRef)(null),dt=(0,G.useRef)(null),ft=(0,G.useRef)(null),[gt,yt]=(0,G.useState)(!1),bt=(0,G.useRef)(!1),xt=(0,G.useRef)(!1),St=(0,G.useRef)(``),Ot=(0,G.useRef)(null),Mt=(0,G.useRef)(null),Nt=(0,G.useRef)(null),J=(0,G.useRef)(x),[Wt,Y]=(0,G.useState)(null),[Gt,Kt]=(0,G.useState)(null),[qt,Jt]=(0,G.useState)(!1),[Yt,Xt]=(0,G.useState)(!1),[Zt,Qt]=(0,G.useState)(null),$t=(0,G.useRef)(null),en=(0,G.useMemo)(()=>({link:h.linkDependencies,linked:h.linkedDependencies,searchPlaceholder:h.dependencySearchPlaceholder,noMatches:h.noDependencyMatches,noCandidates:h.noDependencyCandidates,remove:h.removeDependency}),[h.dependencySearchPlaceholder,h.linkDependencies,h.linkedDependencies,h.noDependencyCandidates,h.noDependencyMatches,h.removeDependency]),tn=x?.dependencies.map(e=>`${e.id}:${e.title}`).join(`\0`)??``,nn=(0,G.useMemo)(()=>te(c.get(`returnTo`),`/`,[`/projects`,`/chat`,`/notes`,`/tasks`]),[c]),rn=(0,G.useCallback)(e=>t===`modal`&&n?R(n,e):ee(`/tasks/${encodeURIComponent(e)}`,nn),[n,t,nn]);J.current=x;let X=(0,G.useCallback)((e,t)=>{Le(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r})},[]);(0,G.useEffect)(()=>{V(null),ke(null),Y(null),Ke(!1),Ot.current=null,et(!1),Kt(null),Jt(!1),Xt(!1),Qt(null)},[e]),(0,G.useEffect)(()=>{let e=!0;return Ce().then(t=>{e&&We(t.items)}).catch(()=>void 0),()=>{e=!1}},[m]),(0,G.useEffect)(()=>{if(!O||O.source===`user`)return;Kt(O);let e=window.setTimeout(()=>Kt(null),3500);return()=>window.clearTimeout(e)},[O]),(0,G.useEffect)(()=>{let t=x?.task.projectId,n=x?.dependencies??[];if(!t){Nt.current=null,Ve(null),ze(n);return}Nt.current!==t&&(Nt.current=t,Ve(null));let r=!0;return se(t).then(t=>{if(!r)return;Ve(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});ze([...i.values()])}).catch(()=>{r&&ze(n)}),()=>{r=!1}},[tn,x?.task.projectId,e]);let Z=(0,G.useCallback)(async(t,n=`command`)=>{let r=J.current;if(r){X(n,!0),V(null),t.type===`close`&&t.resolution===`done`&&ke(null);try{await D(await xe(e,t,r.task.version),{revalidate:!1})}catch{V(h.actionFailed),t.type===`close`&&t.resolution===`done`&&ke(h.actionFailed)}finally{X(n,!1)}}},[h.actionFailed,D,X,e]),an=(0,G.useCallback)(async(t,n)=>{let r=J.current;if(!r)return!1;n&&X(n,!0),V(null);try{let n=fe(e,t,r.task.version);return await D(n,{optimisticData:Dt(r,t),populateCache:!0,revalidate:!1,rollbackOnError:!0}),!0}catch{return V(h.actionFailed),!1}finally{n&&X(n,!1)}},[h.actionFailed,D,X,e]),on=()=>{x&&(Ot.current={value:x.task.title,version:x.task.version},Y(null),K(x.task.title),Ke(!0))},sn=()=>{bt.current=!0,K(J.current?.task.title??``),Ot.current=null,Y(null),Ke(!1),queueMicrotask(()=>{bt.current=!1})},cn=async(e=!1)=>{if(bt.current){bt.current=!1;return}let t=J.current;if(!t||U.has(`title`))return;let n=Je.trim();if(!n){sn();return}let r=Ot.current;if(!e&&Et(r,t.task.version,t.task.title,n)){Y(`title`);return}if(n===t.task.title){sn();return}await an({title:n},`title`)&&(Ot.current=null,Y(null),Ke(!1))},ln=async()=>{if(!x)return;if(xt.current){xt.current=!1;return}let e=tt.trim(),t=Mt.current;if(Et(t,x.task.version,x.task.body??``,e)){Y(`description`);return}if(tt===St.current||e===(x.task.body??``).trim()){et(!1);return}await an({body:ce(x.task.body??``,e)||null})&&(Y(null),et(!1))},un=(0,G.useCallback)(async e=>{let t=J.current;!t||e===t.task.phase||await Z({type:`move`,phase:e},`phase`)},[Z]),dn=(0,G.useCallback)(e=>{an({priority:e},`priority`)},[an]),fn=(0,G.useCallback)(e=>{an({dueAt:jt(e)},`dueAt`)},[an]),pn=(0,G.useCallback)(e=>{at(e);try{window.localStorage.setItem(zt,String(e))}catch{}},[]),mn=(0,G.useCallback)(e=>{if(e.key!==`ArrowLeft`&&e.key!==`ArrowRight`&&e.key!==`Home`)return;e.preventDefault();let t=dt.current?.clientWidth??0,n=e.key===`Home`?Bt:it+(e.key===`ArrowLeft`?2:-2);pn(Vt(n,t))},[it,pn]),hn=(0,G.useCallback)(e=>{if(!window.matchMedia(`(min-width: 1024px)`).matches)return;let t=dt.current;if(!t)return;e.preventDefault();let n=e.currentTarget,r=e.pointerId;n.setPointerCapture(r),ct(!0);let i=it,a=0,o=()=>{a=0,t.style.setProperty(`--task-chat-panel-width`,`${i}%`)},s=e=>{let n=t.getBoundingClientRect();i=Vt((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{}ct(!1),pn(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)},[it,pn]),gn=(0,G.useCallback)(async t=>{let n=J.current;if(n){X(`dependencies`,!0),V(null);try{await D(await de(e,t,n.task.version),{revalidate:!1})}catch{V(h.dependencyUpdateFailed)}finally{X(`dependencies`,!1)}}},[h.dependencyUpdateFailed,D,X,e]),_n=(0,G.useCallback)(async t=>{let n=J.current;if(!(!n||!t||t===n.conversation.currentExecutorAgentId)){X(`delegateAgentId`,!0),V(null);try{await D(await pe(e,t,n.task.version),{revalidate:!1})}catch{V(h.actionFailed)}finally{X(`delegateAgentId`,!1)}}},[h.actionFailed,D,X,e]),vn=(0,G.useCallback)(async()=>{X(`delete`,!0),V(null);try{await he(e),r?r():f(nn,{replace:!0})}catch(e){V(e instanceof Error?e.message:h.actionFailed)}finally{X(`delete`,!1)}},[h.actionFailed,f,r,nn,X,e]),yn=(0,G.useCallback)(async(t,n)=>{let r=J.current;if(!r)return!1;X(`acceptance`,!0),ke(null),V(null);try{return await D(await Se(e,t,n,r.task.version,r.task.latestContractVersion),{revalidate:!1}),!0}catch{return ke(h.actionFailed),V(h.actionFailed),D().catch(()=>void 0),!1}finally{X(`acceptance`,!1)}},[h.actionFailed,D,X,e]),bn=x?.task.title,xn=bn!==void 0;if((0,G.useLayoutEffect)(()=>{let e=ft.current,t=e?.parentElement;if(!xn||!e||!t||typeof IntersectionObserver>`u`)return;let n=new IntersectionObserver(([e])=>{let n=Ze(t),r=n?n.getBoundingClientRect().top+n.clientTop:0;yt(!e.isIntersecting&&e.boundingClientRect.bottom<=r)});return n.observe(e),()=>n.disconnect()},[xn,e]),(0,G.useLayoutEffect)(()=>{i?.({taskId:e,title:bn,compact:gt})},[gt,i,e,bn]),(0,G.useLayoutEffect)(()=>{if(t!==`modal`)return g({startExtra:(0,q.jsx)(o,{to:nn,className:`flex size-9 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover`,"aria-label":h.backToWork,children:(0,q.jsx)(T,{className:`size-4`})}),main:xn?(0,q.jsx)(`div`,{className:`min-w-0 text-sm font-semibold text-fg`,children:(0,q.jsx)(Ct,{label:Be?`${Be} / ${h.taskLabel}`:h.taskLabel,title:bn,compact:gt})}):null,end:null}),_},[_,gt,h.backToWork,h.taskLabel,xn,t,Be,nn,g,bn]),S&&!x)return(0,q.jsx)(`div`,{className:t===`modal`?`p-5 text-sm text-danger`:`mx-auto max-w-3xl p-6 text-sm text-danger`,children:h.taskNotFound});if(!x)return(0,q.jsx)(`div`,{className:t===`modal`?`p-5`:`mx-auto max-w-4xl p-4 sm:p-6`,children:(0,q.jsx)(kt,{})});let Sn=x.waits[0],Cn=x.runs.find(e=>!e.parentRunId&&[`queued`,`running`,`waiting`,`verifying`].includes(e.status)),wn=me(x),Tn=wn.length>0&&wn.every(e=>e.status===`passed`),En=x.waits.find(e=>e.kind===`paused`),Dn=ve(x),On=ye(x),kn=h.detailStatuses[On],An=le(x.task.body?.trim()||x.task.contract?.objective.trim()||``),jn=x.allowedCommands.includes(`mark_ready`),Mn=x.allowedCommands.includes(`start`),Nn=x.allowedCommands.includes(`add_wait`),Pn=!Sn&&!Cn&&Tn&&x.task.phase===`review`&&x.allowedCommands.includes(`close`),Fn=x.allowedCommands.includes(`reopen`),Q=x.conversation.activeConversationId,In=x.conversation.currentExecutorAgentId??x.task.delegateAgentId??x.task.ownerId,Ln=He.find(e=>e.id===In),Rn=!!(Q&&v[Q]?.open),zn=x.context.filter(e=>e.role!==`deliverable`),Bn=j?.automations.filter(t=>t.action.kind===`task_command`&&t.action.taskId===e)??[],$=Bn.filter(e=>e.trigger.kind===`schedule`&&e.action.kind===`task_command`&&e.action.command.type===`start`),Vn=$.filter(e=>e.enabled&&e.state.nextRunAtMs!==void 0).map(e=>e.state.nextRunAtMs).sort((e,t)=>e-t)[0],Hn=e=>{N(t=>({automations:[e,...(t?.automations??[]).filter(t=>t.id!==e.id)]}),{revalidate:!1})},Un=e=>{Qt(e),Xt(!0)},Wn=()=>{j&&($.length===1?Un($[0]):$.length>1?($t.current&&($t.current.open=!0),d(e=>Ye(e,`schedule`,!0),{preventScrollReset:!0}),$t.current?.scrollIntoView({block:`start`,behavior:`smooth`}),$t.current?.focus({preventScroll:!0})):(Qt(null),Xt(!0)))},Gn=x.sessions.filter((e,t,n)=>n.findIndex(t=>t.conversationId===e.conversationId)===t),Kn=x.task.contract?.expectedOutputs??[],qn=x.task.contract?.constraints??[],Jn=x.task.contract?.approvalRequired??[],Yn=x.task.contract?.assumptions??[],Xn=x.task.contract?.risks??[],Zn=qn.length>0||Jn.length>0||Yn.length>0||Xn.length>0,Qn=(...e)=>!!Gt?.changedFields.some(t=>e.includes(t)),$n=x.allowedCommands.includes(`move`),er=U.has(`command`),tr=U.has(`delete`),nr=Cn!==void 0,rr=()=>{let e=lt.current;e&&(e.open=!0,d(e=>Ye(e,`acceptance`,!0),{preventScrollReset:!0}),e.scrollIntoView({block:`start`,behavior:`smooth`}),e.focus({preventScroll:!0}))},ir=(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[jn&&!Mn&&!Sn&&x.task.phase!==`review`?(0,q.jsxs)(H,{className:`min-h-9 px-3 py-1.5 text-xs`,variant:`primary`,disabled:er,onClick:()=>void Z({type:`mark_ready`}),children:[(0,q.jsx)(ie,{className:`size-4`}),h.scheduleTask]}):null,En&&x.allowedCommands.includes(`resolve_wait`)?(0,q.jsxs)(H,{className:`min-h-9 px-3 py-1.5 text-xs`,variant:`primary`,disabled:er,onClick:()=>void Z({type:`resolve_wait`,waitId:En.id}),children:[(0,q.jsx)(ie,{className:`size-4`}),h.resumeTask]}):null,!Sn&&Mn&&x.task.phase!==`review`&&In?(0,q.jsxs)(H,{className:`min-h-9 px-3 py-1.5 text-xs`,variant:`primary`,disabled:er,onClick:()=>void Z({type:`start`,executor:{kind:`agent`,agentId:In}}),children:[(0,q.jsx)(ie,{className:`size-4`}),h.runTask]}):null,Fn?(0,q.jsxs)(H,{className:`min-h-9 px-3 py-1.5 text-xs`,variant:`ghost`,disabled:er,onClick:()=>void Z({type:`reopen`,phase:`ready`}),children:[(0,q.jsx)(ie,{className:`size-4`}),h.reopenTask]}):null,x.task.phase!==`review`&&!En&&Nn?(0,q.jsxs)(H,{variant:`ghost`,className:`min-h-9 px-3 py-1.5 text-xs`,disabled:er,onClick:()=>void Z({type:`add_wait`,wait:{kind:`paused`,reason:`Paused by user`,condition:{}}}),children:[(0,q.jsx)(re,{className:`size-4`}),h.pauseTask]}):null,x.task.phase===`closed`?(0,q.jsx)(H,{variant:`primary`,className:`min-h-9 px-3 py-1.5 text-xs`,onClick:()=>{ut.current?.scrollIntoView({block:`start`,behavior:`smooth`}),ut.current?.focus({preventScroll:!0})},children:p===`zh`?`查看结果`:`View results`}):null,!Sn&&!Cn&&x.task.phase!==`closed`&&x.task.phase!==`review`?(0,q.jsxs)(H,{variant:`ghost`,className:`min-h-9 px-3 py-1.5 text-xs`,disabled:!j,onClick:Wn,children:[(0,q.jsx)(E,{className:`size-4`}),$.length>0?p===`zh`?`管理执行时间`:`Manage schedule`:p===`zh`?`设置执行时间`:`Set execution time`]}):null,x.task.phase===`review`?(0,q.jsx)(H,{variant:`primary`,className:`min-h-9 px-3 py-1.5 text-xs`,onClick:rr,children:p===`zh`?`去验收`:`Review results`}):null,(0,q.jsxs)(je,{children:[(0,q.jsx)(Me,{asChild:!0,children:(0,q.jsx)(H,{type:`button`,variant:`ghost`,className:`size-9 p-0`,disabled:er||tr,"aria-label":h.moreActions,children:(0,q.jsx)(P,{className:`size-4`,"aria-hidden":!0})})}),(0,q.jsx)(Ne,{children:(0,q.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:[x.task.phase===`review`&&!En&&Nn?(0,q.jsx)(Pe,{className:`cursor-pointer rounded-md px-3 py-2 text-sm text-fg outline-none focus:bg-surface-hover`,onSelect:()=>void Z({type:`add_wait`,wait:{kind:`paused`,reason:`Paused by user`,condition:{}}}),children:h.pauseTask}):null,x.task.phase===`review`&&!Sn&&!Cn?(0,q.jsx)(Pe,{disabled:!j,className:`cursor-pointer rounded-md px-3 py-2 text-sm text-fg outline-none focus:bg-surface-hover data-[disabled]:opacity-50`,onSelect:Wn,children:$.length>0?p===`zh`?`管理执行时间`:`Manage schedule`:p===`zh`?`设置执行时间`:`Set execution time`}):null,x.task.phase===`review`&&!Sn&&Mn&&In?(0,q.jsx)(Pe,{className:`cursor-pointer rounded-md px-3 py-2 text-sm text-fg outline-none focus:bg-surface-hover`,onSelect:()=>void Z({type:`start`,executor:{kind:`agent`,agentId:In}}),children:h.runTask}):null,jn&&(Mn||Sn||x.task.phase===`review`)?(0,q.jsx)(Pe,{className:`cursor-pointer rounded-md px-3 py-2 text-sm text-fg outline-none focus:bg-surface-hover`,onSelect:()=>void Z({type:`mark_ready`}),children:h.scheduleTask}):null,Cn?(0,q.jsx)(Pe,{className:`cursor-pointer rounded-md px-3 py-2 text-sm text-danger outline-none hover:bg-surface-hover focus:bg-surface-hover`,onSelect:()=>{X(`command`,!0),V(null),D(_e(e,Cn.id,Cn.version),{revalidate:!1}).catch(()=>V(h.actionFailed)).finally(()=>X(`command`,!1))},children:h.cancelActiveRun}):null,Cn?(0,q.jsx)(Ie,{className:`my-1 h-px bg-edge`}):null,x.task.phase===`closed`?null:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(Pe,{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 Z({type:`close`,resolution:`cancelled`}),children:h.cancelTask}),(0,q.jsx)(Ie,{className:`my-1 h-px bg-edge`})]}),(0,q.jsx)(Pe,{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(nr){V(h.deleteActiveTaskBlocked);return}Jt(!0)},children:h.deleteTask})]})})]})]});return(0,q.jsxs)(`div`,{ref:dt,className:`flex h-full min-h-0 flex-col overflow-hidden ${st?`lg:cursor-col-resize lg:select-none`:``}`,style:{"--task-chat-panel-width":`${it}%`},children:[(0,q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto lg:flex-row lg:overflow-hidden`,children:[(0,q.jsxs)(`div`,{className:`task-detail-scroll flex min-w-0 shrink-0 flex-col bg-surface-panel lg:min-h-0 lg:flex-1 lg:shrink lg:overflow-y-auto lg:overscroll-contain`,children:[(0,q.jsxs)(`header`,{ref:ft,className:B(`shrink-0 px-4 py-5 sm:px-6 sm:py-6`,Qn(`title`)&&`task-detail-live-update`),children:[(0,q.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-x-6 gap-y-3`,children:[(0,q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs text-fg-muted`,children:[Be?(0,q.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,q.jsx)(I,{className:`size-3.5`,"aria-hidden":!0}),Be]}):null,Be?(0,q.jsx)(`span`,{"aria-hidden":`true`,children:`/`}):null,(0,q.jsx)(`span`,{children:h.taskLabel}),Gt?(0,q.jsx)(`span`,{className:`rounded-full bg-accent-soft px-2 py-0.5 text-[11px] font-medium text-accent-fg`,role:`status`,children:Gt.source===`agent`?p===`zh`?`Agent 刚刚更新`:`Updated by Agent`:p===`zh`?`执行结果已同步`:`Execution result synced`}):null]}),Ge?(0,q.jsx)(`textarea`,{autoFocus:!0,"data-task-inline-editor":!0,"aria-label":p===`zh`?`任务标题`:`Task title`,rows:2,value:Je,onFocus:e=>{Ot.current?.value===Je&&(e.currentTarget.setSelectionRange(0,0),e.currentTarget.scrollTop=0)},onChange:e=>K(e.target.value),onBlur:()=>void cn(),onKeyDown:e=>{e.nativeEvent.isComposing||(e.key===`Escape`?(e.preventDefault(),e.stopPropagation(),sn()):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 tracking-tight text-fg sm:text-2xl outline-none [field-sizing:content]`}):(0,q.jsx)(W,{content:x.task.title,contentKey:`${e}:title`,language:p,previewHeight:56,className:`mt-2 max-w-3xl`,children:(0,q.jsx)(`h1`,{className:`break-words text-xl font-semibold leading-7 tracking-tight text-fg sm:text-2xl`,children:(0,q.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:x.task.title,onClick:on,children:x.task.title})})}),Wt===`title`?(0,q.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2 text-xs text-warning`,role:`alert`,children:[(0,q.jsx)(`span`,{children:p===`zh`?`Agent 在你编辑期间更新了标题。`:`The Agent updated the title while you were editing.`}),(0,q.jsx)(`button`,{type:`button`,className:`rounded-md bg-surface-hover px-2 py-1 text-fg`,onClick:sn,children:p===`zh`?`使用 Agent 版本`:`Use Agent version`}),(0,q.jsx)(`button`,{type:`button`,className:`rounded-md bg-accent-soft px-2 py-1 text-accent-fg`,disabled:U.has(`title`),onClick:()=>void cn(!0),children:p===`zh`?`保留我的修改`:`Keep my changes`})]}):null]}),(0,q.jsx)(`span`,{className:B(`shrink-0 rounded-full px-2.5 py-1 text-xs font-medium`,ge(On)),children:kn})]}),(0,q.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-x-4 gap-y-2 text-xs text-fg-muted`,children:[(0,q.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-2`,children:[In?(0,q.jsx)(De,{agentId:In,avatar:Ln?.avatar,size:20,className:`shrink-0`}):null,(0,q.jsxs)(`span`,{className:`min-w-0 break-words [overflow-wrap:anywhere]`,children:[h.executorLabel,` · `,Ln?.name??In??h.unassigned]})]}),(0,q.jsx)(`span`,{className:`text-fg-subtle`,children:h.updatedAt.replace(`{{date}}`,Ue(x.task.updatedAt,p))})]})]}),(0,q.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":p===`zh`?`任务操作`:`Task actions`,children:[(0,q.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-fg-muted`,children:kn}),ir,ae?(0,q.jsx)(`p`,{role:`alert`,className:`basis-full text-sm text-danger`,children:ae}):null,(0,q.jsx)($e,{language:p,hasSchedule:$.length>0},e)]}),(0,q.jsxs)(`section`,{className:`min-w-0 space-y-4 p-4 sm:p-5`,children:[x.task.phase===`review`?null:(0,q.jsx)(vt,{detail:x,language:p,onUpdated:e=>{D(e,{revalidate:!1})}}),(0,q.jsxs)(`section`,{"data-task-section":`results`,"data-task-section-label":p===`zh`?`交付结果`:`Results`,ref:ut,tabIndex:-1,"aria-labelledby":`task-results-heading`,className:`scroll-mt-24 space-y-4`,children:[(0,q.jsx)(ot,{detail:x,language:p}),x.task.phase===`review`&&(x.waits.length>0||x.attention.some(e=>e.kind===`input_required`||e.kind===`approval_required`))?(0,q.jsx)(vt,{detail:x,language:p,onUpdated:e=>{D(e,{revalidate:!1})}}):null,(0,q.jsx)(Xe,{panelId:`acceptance`,chevron:!0,"data-task-section":`acceptance`,"data-task-section-label":p===`zh`?`验收`:`Acceptance`,defaultOpen:!0,ref:lt,tabIndex:-1,"aria-label":h.successDefinition,className:`scroll-mt-24 overflow-hidden rounded-2xl border border-edge-subtle bg-surface-panel`,summaryClassName:`min-h-12 cursor-pointer px-4 py-2 text-sm font-semibold text-fg outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent`,title:(0,q.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[p===`zh`?`验收`:`Acceptance`,(0,q.jsxs)(`span`,{"aria-live":`polite`,className:`rounded-full bg-surface-inset px-2 py-0.5 text-xs font-medium tabular-nums text-fg-muted`,children:[wn.filter(e=>e.status===`passed`).length,`/`,wn.length]})]}),children:(0,q.jsx)(rt,{criteria:wn,language:p,closed:x.task.phase===`closed`,pending:U.has(`acceptance`),error:be,blockedReason:Sn?p===`zh`?`请先处理待办事项`:`Resolve the pending request first`:Cn?p===`zh`?`请等待当前执行结束`:`Wait for the current run to finish`:void 0,onReview:yn,projectId:x.task.projectId,conversationId:Q??void 0},`${e}:${x.task.latestContractVersion}`)})]}),(0,q.jsx)(Xe,{panelId:`report`,chevron:!0,defaultOpen:!0,"data-task-section":`report`,"data-task-section-label":p===`zh`?`执行报告`:`Report`,className:`rounded-2xl border border-edge-subtle bg-surface-panel p-4`,summaryClassName:`cursor-pointer rounded-sm text-sm font-medium text-fg`,title:p===`zh`?`完整执行报告`:`Full execution report`,children:(0,q.jsx)(pt,{detail:x,language:p},Dn?.runId??e)}),!j&&!M?(0,q.jsx)(oe,{className:`h-9 rounded-lg`}):null,M?(0,q.jsxs)(`div`,{role:`alert`,className:`flex flex-wrap items-center gap-2 text-sm text-danger`,children:[(0,q.jsx)(`span`,{children:p===`zh`?`无法读取执行计划,请重试后再设置时间。`:`Could not load schedules. Retry before setting a time.`}),(0,q.jsx)(H,{variant:`ghost`,onClick:()=>void N(),children:p===`zh`?`重试`:`Retry`})]}):null,$.length>0?(0,q.jsx)(Xe,{panelId:`schedule`,chevron:!0,defaultOpen:!0,"data-task-section":`schedule`,"data-task-section-label":p===`zh`?`执行时间`:`Schedule`,ref:$t,tabIndex:-1,className:`scroll-mt-24 rounded-2xl border border-edge-subtle bg-surface-panel p-4`,summaryClassName:`cursor-pointer rounded-sm text-sm text-fg-muted`,title:(0,q.jsxs)(q.Fragment,{children:[p===`zh`?`执行时间`:`Execution schedule`,` · `,$.length,Vn===void 0?``:` · ${p===`zh`?`下次执行:`:`Next run: `}${Ue(Vn,p)}`]}),children:(0,q.jsx)(`div`,{className:`mt-3`,children:(0,q.jsx)(ht,{schedules:$,language:p,onEdit:Un,onUpdated:Hn})})}):null,(0,q.jsx)(Xe,{panelId:`goal`,chevron:!0,defaultOpen:!0,"data-task-section":`goal`,"data-task-section-label":p===`zh`?`目标说明`:`Goal`,className:`rounded-2xl border border-edge-subtle bg-surface-panel p-4`,summaryClassName:`cursor-pointer rounded-sm text-sm font-medium text-fg`,title:p===`zh`?`任务目标与说明`:`Task goal and description`,children:(0,q.jsx)(`div`,{className:`mt-3`,children:(0,q.jsxs)(`section`,{className:`overflow-hidden rounded-xl border border-edge-subtle bg-surface-panel divide-y divide-edge-subtle`,children:[(0,q.jsxs)(`div`,{className:`border-b border-edge-subtle p-5`,children:[(0,q.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:p===`zh`?`任务目标`:`Task goal`}),(0,q.jsx)(W,{content:x.task.contract?.objective||x.task.title,contentKey:`${e}:goal`,language:p,markdown:!1,previewHeight:72,className:`mt-3 text-sm leading-6 text-fg`}),(0,q.jsxs)(H,{variant:`ghost`,className:`mt-2 min-h-9 px-2 text-xs`,onClick:rr,children:[h.successDefinition,` · `,wn.length]})]}),Kn.length>0?(0,q.jsxs)(`div`,{className:`p-5`,children:[(0,q.jsx)(`h3`,{className:`text-xs font-medium text-fg-muted`,children:h.expectedOutputs}),(0,q.jsx)(`div`,{className:`mt-2`,children:(0,q.jsx)(Ut,{contentKey:`${e}:expectedOutputs`,items:Kn,empty:h.noDefinition})})]}):null,(0,q.jsxs)(`details`,{className:B(`p-5`,Qn(`body`)&&`task-detail-live-update`),children:[(0,q.jsx)(`summary`,{className:`cursor-pointer text-sm font-semibold text-fg`,children:h.taskDescription}),Qe?(0,q.jsx)(`textarea`,{autoFocus:!0,"data-task-inline-editor":!0,rows:6,value:tt,onChange:e=>nt(e.target.value),onBlur:()=>void ln(),onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),xt.current=!0,nt(le(x.task.body??x.task.contract?.objective??``)),et(!1),queueMicrotask(()=>{xt.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,q.jsxs)(`div`,{className:`mt-2`,children:[An&&An!==x.task.title?(0,q.jsx)(W,{content:An,contentKey:`${e}:description`,language:p}):(0,q.jsx)(`p`,{className:`text-sm leading-6 text-fg-muted`,children:h.noTaskDescription}),(0,q.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=le(x.task.body??x.task.contract?.objective??``);St.current=e,Mt.current={value:x.task.body??``,version:x.task.version},Y(null),nt(e),et(!0)},children:p===`zh`?`编辑说明`:`Edit description`})]}),Wt===`description`?(0,q.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2 text-xs text-warning`,role:`alert`,children:[(0,q.jsx)(`span`,{children:p===`zh`?`Agent 在你编辑期间更新了描述。`:`The Agent updated the description while you were editing.`}),(0,q.jsx)(`button`,{type:`button`,className:`rounded-md bg-surface-hover px-2 py-1 text-fg`,onClick:()=>{nt(le(x.task.body??``)),Y(null),et(!1)},children:p===`zh`?`使用 Agent 版本`:`Use Agent version`}),(0,q.jsx)(`button`,{type:`button`,className:`rounded-md bg-accent-soft px-2 py-1 text-accent-fg`,onClick:()=>void an({body:ce(x.task.body??``,tt.trim())||null}).then(e=>{e&&(Y(null),et(!1))}),children:p===`zh`?`保留我的修改`:`Keep my changes`})]}):null]}),Zn?(0,q.jsxs)(`section`,{className:B(`p-5`,Qn(`contract`)&&`task-detail-live-update`),children:[(0,q.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:h.taskDefinition}),(0,q.jsx)(`p`,{className:`mt-2 text-xs leading-5 text-fg-muted`,children:p===`zh`?`执行边界及补充背景`:`Execution boundaries and supporting context`}),qn.length>0?(0,q.jsxs)(`details`,{className:`mt-4 border-t border-edge-subtle pt-4`,children:[(0,q.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg-muted hover:text-fg`,children:h.constraints}),(0,q.jsx)(`div`,{className:`mt-3`,children:(0,q.jsx)(Ut,{contentKey:`${e}:constraints`,items:qn,empty:h.noDefinition})})]}):null,Jn.length>0?(0,q.jsxs)(`details`,{className:`mt-4 border-t border-edge-subtle pt-4`,children:[(0,q.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg-muted hover:text-fg`,children:h.approvalRequired}),(0,q.jsx)(`div`,{className:`mt-3`,children:(0,q.jsx)(Ut,{contentKey:`${e}:approvalRequired`,items:Jn,empty:h.noDefinition})})]}):null,Yn.length>0?(0,q.jsxs)(`details`,{className:`mt-4 border-t border-edge-subtle pt-4`,children:[(0,q.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg-muted hover:text-fg`,children:h.contextAssumptions}),(0,q.jsx)(`div`,{className:`mt-3`,children:(0,q.jsx)(Ut,{contentKey:`${e}:assumptions`,items:Yn,empty:h.noDefinition})})]}):null,Xn.length>0?(0,q.jsxs)(`details`,{className:`mt-4 border-t border-edge-subtle pt-4`,children:[(0,q.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg-muted hover:text-fg`,children:h.contextRisks}),(0,q.jsx)(`div`,{className:`mt-3`,children:(0,q.jsx)(Ut,{contentKey:`${e}:risks`,items:Xn,empty:h.noDefinition})})]}):null]}):null]})})}),(0,q.jsxs)(Xe,{panelId:`management`,chevron:!0,defaultOpen:!0,"data-task-section":`management`,"data-task-section-label":p===`zh`?`任务管理`:`Management`,"aria-label":p===`zh`?`任务管理`:`Task management`,className:`rounded-2xl border border-edge-subtle bg-surface-panel p-4`,summaryClassName:`cursor-pointer rounded-sm text-sm font-medium text-fg`,title:p===`zh`?`任务管理`:`Task management`,children:[(0,q.jsxs)(`aside`,{className:`min-w-0 overflow-hidden rounded-xl bg-surface-panel shadow-surface divide-y divide-edge-subtle`,children:[(0,q.jsxs)(`section`,{className:B(`p-5`,Qn(`phase`,`resolution`,`priority`,`dueAt`,`delegateAgentId`)&&`task-detail-live-update`),children:[(0,q.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:h.taskProperties}),(0,q.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-2`,children:[(0,q.jsx)(Pt,{value:x.task.phase,disabled:U.has(`phase`),canMove:$n,canApprove:Pn,canReopen:Fn,language:p,label:h.taskPhase,onChange:un}),(0,q.jsx)(Ft,{value:x.task.priority,disabled:U.has(`priority`),label:h.priority,labels:h.priorityLabels,onChange:dn}),(0,q.jsx)(It,{value:At(x.task.dueAt),disabled:U.has(`dueAt`),label:h.dueDate,onChange:fn}),(0,q.jsx)(Lt,{value:x.conversation.currentExecutorAgentId??``,disabled:U.has(`delegateAgentId`),label:h.executorLabel,unassignedLabel:h.unassigned,agents:He,onChange:_n})]})]}),(0,q.jsxs)(`details`,{className:B(`p-5`,Qn(`dependencies`)&&`task-detail-live-update`),children:[(0,q.jsxs)(`summary`,{className:`cursor-pointer text-sm font-semibold text-fg`,children:[h.taskRelations,` · `,x.dependencies.length,` / `,x.dependents.length]}),(0,q.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`p`,{className:`mb-2 text-xs text-fg-muted`,children:h.dependencies}),(0,q.jsx)(Rt,{candidates:Re,selected:x.dependencies,disabled:U.has(`dependencies`),labels:en,getTaskHref:rn,onChange:gn})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`p`,{className:`mb-2 text-xs text-fg-muted`,children:h.dependents}),x.dependents.length>0?(0,q.jsx)(`div`,{className:`space-y-1.5`,children:x.dependents.map(t=>(0,q.jsx)(W,{content:t.title,contentKey:`${e}:dependent:${t.id}`,language:p,previewHeight:72,className:`rounded-lg bg-surface-hover p-2.5`,children:(0,q.jsx)(o,{to:rn(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,q.jsx)(`p`,{className:`text-sm text-fg-subtle`,children:h.noDependents})]})]})]})]}),x.task.phase===`closed`?null:(0,q.jsxs)(H,{variant:`ghost`,className:`my-3`,disabled:!j,onClick:Wn,children:[(0,q.jsx)(E,{className:`size-4`}),$.length>0?p===`zh`?`管理执行时间`:`Manage schedule`:h.scheduleRecurringTask]}),(0,q.jsxs)(`details`,{className:`mb-4 rounded-xl border border-edge-subtle bg-surface-panel p-5 shadow-surface`,children:[(0,q.jsx)(`summary`,{className:`cursor-pointer text-sm font-semibold text-fg`,children:p===`zh`?`关联内容`:`Related work`}),Gn.length>0||x.runs.length>0||Bn.length>0||x.dependencies.length>0||x.dependents.length>0?(0,q.jsxs)(`div`,{className:`mt-3 grid gap-3 sm:grid-cols-2`,children:[Gn.length>0?(0,q.jsxs)(`div`,{className:`rounded-lg bg-surface-hover p-3`,children:[(0,q.jsx)(`h3`,{className:`text-xs font-medium text-fg-muted`,children:p===`zh`?`对话 · ${Gn.length}`:`Conversations · ${Gn.length}`}),(0,q.jsx)(wt,{contentKey:`${e}:sessions`,language:p,className:`mt-2`,children:Gn.map(t=>(0,q.jsx)(`li`,{children:(0,q.jsx)(o,{className:`block break-words [overflow-wrap:anywhere] text-sm text-accent hover:underline`,to:t.conversationId===Q?z(e):`/chat/${encodeURIComponent(t.conversationId)}`,children:t.conversationId===Q?p===`zh`?`当前执行对话`:`Current execution chat`:t.role===`discussion`?p===`zh`?`关联讨论`:`Linked discussion`:p===`zh`?`历史执行对话`:`Earlier execution chat`})},t.id))})]}):null,Bn.length>0?(0,q.jsxs)(`div`,{className:`rounded-lg bg-surface-hover p-3`,children:[(0,q.jsx)(`h3`,{className:`text-xs font-medium text-fg-muted`,children:p===`zh`?`自动化 · ${Bn.length}`:`Automations · ${Bn.length}`}),(0,q.jsx)(wt,{contentKey:`${e}:automations`,language:p,className:`mt-2`,children:Bn.map(e=>(0,q.jsx)(`li`,{children:(0,q.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,x.dependencies.length>0||x.dependents.length>0?(0,q.jsxs)(`div`,{className:`rounded-lg bg-surface-hover p-3`,children:[(0,q.jsx)(`h3`,{className:`text-xs font-medium text-fg-muted`,children:h.taskRelations}),(0,q.jsx)(`p`,{className:`mt-2 text-sm text-fg`,children:p===`zh`?`${x.dependencies.length} 个前置任务 · ${x.dependents.length} 个后续任务`:`${x.dependencies.length} prerequisites · ${x.dependents.length} dependents`})]}):null]}):(0,q.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:p===`zh`?`还没有关联内容`:`No related work yet`}),(0,q.jsx)(`div`,{className:`mt-4 border-t border-edge-subtle pt-3`,children:(0,q.jsx)(qe,{resource:{kind:`task`,id:x.task.id,revision:String(x.task.version)},disabled:Ge||Qe||U.size>0})})]}),zn.length>0?(0,q.jsxs)(`section`,{className:B(`p-5`,Qn(`context`)&&`task-detail-live-update`),children:[(0,q.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:h.contextUsed}),(0,q.jsx)(`ul`,{className:`mt-4 grid gap-2 sm:grid-cols-2`,children:zn.map(e=>(0,q.jsxs)(`li`,{className:`min-w-0 rounded-lg bg-surface-hover p-2.5`,children:[(0,q.jsxs)(`span`,{className:`text-[11px] text-fg-subtle`,children:[h.contextRoleLabels[e.role],` · `,h.contextKindLabels[e.targetKind]]}),e.targetKind===`url`&&/^https?:\/\//.test(e.targetId)?(0,q.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,q.jsx)(`p`,{className:`mt-1 break-words text-sm text-fg`,children:e.title??e.targetId})]},e.id))})]}):null]}),(0,q.jsx)(Xe,{panelId:`activity`,chevron:!0,defaultOpen:!0,"data-task-section":`activity`,"data-task-section-label":p===`zh`?`活动留言`:`Activity`,className:`rounded-2xl border border-edge-subtle bg-surface-panel p-4`,summaryClassName:`cursor-pointer rounded-sm text-sm font-semibold text-fg`,title:p===`zh`?`活动记录与留言`:`Activity and updates`,children:(0,q.jsxs)(`div`,{className:`mt-3 space-y-4`,children:[(0,q.jsx)(Tt,{taskId:e},e),(0,q.jsx)(mt,{changes:x.phaseChanges,language:p})]})})]})]}),(0,q.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":p===`zh`?`调整任务信息和 Agent 对话的宽度`:`Resize task details and Agent chat`,"aria-valuemin":30,"aria-valuemax":60,"aria-valuenow":Math.round(it),tabIndex:0,onPointerDown:hn,onKeyDown:mn,onDoubleClick:()=>pn(Bt),className:`hidden w-2 shrink-0 cursor-col-resize touch-none bg-surface-panel outline-none focus-visible:bg-accent-soft lg:block`}),(0,q.jsxs)(`aside`,{className:`flex min-h-[34rem] min-w-0 shrink-0 flex-col bg-surface-panel lg:min-h-0 lg:w-[var(--task-chat-panel-width)]`,children:[(0,q.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge-subtle px-4 py-3`,children:[(0,q.jsx)(`h2`,{className:`text-sm font-medium text-fg-muted`,children:p===`zh`?`执行对话`:`Execution chat`}),(0,q.jsxs)(`div`,{className:`flex items-center gap-1`,children:[Gn.length>1?(0,q.jsxs)(je,{children:[(0,q.jsx)(Me,{asChild:!0,children:(0,q.jsx)(H,{type:`button`,variant:`ghost`,className:`h-8 px-2 text-xs`,children:p===`zh`?`${Gn.length} 段对话`:`${Gn.length} conversations`})}),(0,q.jsx)(Ne,{children:(0,q.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:Gn.map(t=>(0,q.jsx)(Pe,{asChild:!0,children:(0,q.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===Q?z(e):`/chat/${encodeURIComponent(t.conversationId)}`,children:t.conversationId===Q?p===`zh`?`当前执行对话`:`Current execution chat`:t.role===`discussion`?p===`zh`?`关联讨论`:`Linked discussion`:p===`zh`?`历史执行对话`:`Earlier execution chat`})},t.id))})})]}):null,Q?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(H,{type:`button`,variant:`ghost`,className:B(`size-8 p-0`,Rn&&`bg-surface-hover text-fg`),"aria-label":p===`zh`?`项目文件`:`Project files`,"aria-pressed":Rn,onClick:()=>{we.getState().openFiles(Q),y(Q)},children:(0,q.jsx)(L,{className:`size-4`,"aria-hidden":!0})}),(0,q.jsx)(H,{asChild:!0,variant:`ghost`,className:`size-8 p-0`,children:(0,q.jsx)(o,{to:z(e),"aria-label":p===`zh`?`全屏打开对话`:`Open chat full screen`,children:(0,q.jsx)(F,{className:`size-4`,"aria-hidden":!0})})})]}):null]})]}),Q?(0,q.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,q.jsx)(w,{embedded:!0,conversationId:Q,taskId:e})}):k?(0,q.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center p-8 text-center`,children:(0,q.jsxs)(`div`,{className:`max-w-xs`,children:[(0,q.jsx)(ne,{className:`mx-auto size-8 animate-pulse text-fg-subtle`}),(0,q.jsx)(`p`,{className:`mt-3 text-sm font-medium text-fg`,children:p===`zh`?`正在创建任务会话`:`Creating task conversation`})]})}):A?(0,q.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center p-8 text-center`,children:(0,q.jsxs)(`div`,{className:`max-w-xs`,children:[(0,q.jsx)(ne,{className:`mx-auto size-8 text-danger`}),(0,q.jsx)(`p`,{className:`mt-3 text-sm font-medium text-fg`,children:p===`zh`?`任务会话创建失败`:`Could not create task conversation`}),(0,q.jsx)(`p`,{className:`mt-2 text-xs leading-5 text-fg-muted`,children:A instanceof Error?A.message:String(A)})]})}):(0,q.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center p-8 text-center`,children:(0,q.jsxs)(`div`,{className:`max-w-xs`,children:[(0,q.jsx)(ne,{className:`mx-auto size-8 text-fg-subtle`}),(0,q.jsx)(`p`,{className:`mt-3 text-sm font-medium text-fg`,children:p===`zh`?`等待任务会话`:`Waiting for a task conversation`}),(0,q.jsx)(`p`,{className:`mt-2 text-xs leading-5 text-fg-muted`,children:p===`zh`?`安排或开始任务后,Agent 的执行过程和持续对话会显示在这里。`:`Schedule or start the task to see the agent run and continue the conversation here.`})]})})]})]}),Yt?(0,q.jsx)(_t,{automation:Zt??void 0,taskId:e,taskTitle:x.task.title,projectId:x.task.projectId,executorAgentId:In,language:p,onClose:()=>Xt(!1),onCreated:Hn},`${e}:${Zt?.id??`new`}`):null,(0,q.jsx)(Ae,{open:qt,title:h.deleteTaskTitle,description:h.deleteTaskDescription.replace(`{{title}}`,x.task.title),confirmLabel:h.confirmDeleteTask,cancelLabel:h.keepTask,destructive:!0,onConfirm:()=>{Jt(!1),vn()},onCancel:()=>Jt(!1)})]})}function Gt(){let e=(0,K.c)(2),{taskId:t}=i(),n=t===void 0?``:t,r;return e[0]===n?r=e[1]:(r=(0,q.jsx)(Y,{taskId:n,presentation:`page`}),e[0]=n,e[1]=r),r}function Kt(e){let t=(0,K.c)(43),{taskId:n,backgroundPath:r,workspacePanelWidth:i,onClose:a}=e,o=i===void 0?0:i,s=u(Xt),c=be(Yt),l=o>0,[d,f]=(0,G.useState)(),p=d?.taskId===n?d:void 0,b;t[0]!==a||t[1]!==c?(b=e=>{e||(c(null),a())},t[0]=a,t[1]=c,t[2]=b):b=t[2];let x=s===`zh`?`关闭任务详情`:`Close task details`,S;t[3]!==a||t[4]!==c?(S=()=>{c(null),a()},t[3]=a,t[4]=c,t[5]=S):S=t[5];let C;t[6]!==x||t[7]!==S?(C=(0,q.jsx)(`button`,{type:`button`,tabIndex:-1,"data-task-modal-backdrop":!0,className:`fixed inset-0 z-[80] bg-black/45`,"aria-label":x,onClick:S}),t[6]=x,t[7]=S,t[8]=C):C=t[8];let w=l?`true`:`false`,T=`${o/2}px`,E=`${o}px`,D;t[9]!==T||t[10]!==E?(D={"--task-detail-workspace-offset":T,"--task-detail-workspace-width":E},t[9]=T,t[10]=E,t[11]=D):D=t[11];let O=D,k=s===`zh`?`任务详情`:`Task details`,A=p?.title,j=p?.compact??!1,M;t[12]!==k||t[13]!==A||t[14]!==j?(M=(0,q.jsx)(v,{className:`min-w-0 flex-1 font-medium text-fg`,children:(0,q.jsx)(Ct,{label:k,title:A,compact:j})}),t[12]=k,t[13]=A,t[14]=j,t[15]=M):M=t[15];let N=s===`zh`?`查看并操作任务详情`:`View and manage task details`,P;t[16]===N?P=t[17]:(P=(0,q.jsx)(m,{className:`sr-only`,children:N}),t[16]=N,t[17]=P);let F=s===`zh`?`关闭任务详情`:`Close task details`,I;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,q.jsx)(ae,{className:`size-4`,"aria-hidden":!0}),t[18]=I):I=t[18];let L;t[19]===F?L=t[20]:(L=(0,q.jsx)(`div`,{className:`flex shrink-0 items-center gap-1`,children:(0,q.jsx)(h,{className:`flex size-8 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg`,"aria-label":F,children:I})}),t[19]=F,t[20]=L);let R;t[21]!==M||t[22]!==P||t[23]!==L?(R=(0,q.jsxs)(`header`,{className:`flex shrink-0 items-center justify-between gap-3 bg-surface-panel px-5 py-3.5`,children:[M,P,L]}),t[21]=M,t[22]=P,t[23]=L,t[24]=R):R=t[24];let z;t[25]!==a||t[26]!==c?(z=()=>{c(null),a()},t[25]=a,t[26]=c,t[27]=z):z=t[27];let ee;t[28]!==r||t[29]!==z||t[30]!==n?(ee=(0,q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:(0,q.jsx)(Y,{taskId:n,presentation:`modal`,backgroundPath:r,onHeaderChange:f,onDeleted:z},n)}),t[28]=r,t[29]=z,t[30]=n,t[31]=ee):ee=t[31];let te;t[32]!==O||t[33]!==R||t[34]!==ee||t[35]!==w?(te=(0,q.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":w,style:O,onEscapeKeyDown:Jt,onInteractOutside:qt,children:[R,ee]}),t[32]=O,t[33]=R,t[34]=ee,t[35]=w,t[36]=te):te=t[36];let ne;t[37]!==te||t[38]!==C?(ne=(0,q.jsxs)(g,{children:[C,te]}),t[37]=te,t[38]=C,t[39]=ne):ne=t[39];let re;return t[40]!==b||t[41]!==ne?(re=(0,q.jsx)(y,{modal:!1,open:!0,onOpenChange:b,children:ne}),t[40]=b,t[41]=ne,t[42]=re):re=t[42],re}function qt(e){let t=e.detail.originalEvent.target;t instanceof Element&&t.closest(`#app-workspace-panel, [data-task-modal-backdrop]`)&&e.preventDefault()}function Jt(e){let t=e.target;t instanceof HTMLElement&&t.closest(`[data-task-inline-editor]`)&&e.preventDefault()}function Yt(e){return e.setPath}function Xt(e){return e.language}function Zt(e){return(0,q.jsx)(M,{value:e.id,children:e.name||e.id},e.id)}function Qt(e){return e.id}export{Kt as TaskDetailModal,Gt as TaskDetailPage};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{n as i}from"./locale-store-Dy1EByeG.js";import{t as a}from"./messages-BAnhwALN.js";import{a as o,i as s,o as c,r as l,s as u,t as d}from"./dist-CY7CS_D3.js";import{t as f}from"./work-discovery-page-KwSPhukU.js";import{t as p}from"./understanding-activity-store-BFc8PamJ.js";import{t as m}from"./x-B_N4OPjy.js";import{t as h}from"./button-Cc4hUNTt.js";import{t as g}from"./brand-logo-CgT9zQfr.js";var _=n(),v=e(t(),1),y=r(),b=180;function x(e){let t=(0,_.c)(40),{requestedOpen:n,onExited:r}=e,x=i(C),w=p(S),[T,E]=(0,v.useState)(!0),D=(0,v.useRef)(!1),O=(0,v.useRef)(null),k;t[0]===x?k=t[1]:(k=a(x),t[0]=x,t[1]=k);let A=k.onboarding.workDiscovery,j=w?x===`zh`?`在后台继续`:`Continue in background`:x===`zh`?`稍后再说`:`Maybe later`,M;t[2]===r?M=t[3]:(M=()=>{if(D.current)return;D.current=!0,E(!1);let e=window.matchMedia(`(prefers-reduced-motion: reduce)`).matches?0:b;O.current=window.setTimeout(r,e)},t[2]=r,t[3]=M);let N=M,P,F;t[4]!==N||t[5]!==n?(P=()=>{n||N()},F=[N,n],t[4]=N,t[5]=n,t[6]=P,t[7]=F):(P=t[6],F=t[7]),(0,v.useEffect)(P,F);let I,L;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(I=()=>()=>{O.current!==null&&window.clearTimeout(O.current)},L=[],t[8]=I,t[9]=L):(I=t[8],L=t[9]),(0,v.useEffect)(I,L);let R;t[10]===N?R=t[11]:(R=e=>{e||N()},t[10]=N,t[11]=R);let z;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,y.jsx)(o,{className:`xopc-dialog-overlay fixed inset-0 z-[75] bg-scrim backdrop-blur-[1px]`}),t[12]=z):z=t[12];let B;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,y.jsx)(g,{className:`size-7 shrink-0`,"aria-hidden":!0}),t[13]=B):B=t[13];let V;t[14]===A.title?V=t[15]:(V=(0,y.jsx)(u,{className:`truncate text-sm font-semibold text-fg`,children:A.title}),t[14]=A.title,t[15]=V);let H;t[16]===A.subtitle?H=t[17]:(H=(0,y.jsx)(s,{className:`sr-only`,children:A.subtitle}),t[16]=A.subtitle,t[17]=H);let U;t[18]!==V||t[19]!==H?(U=(0,y.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2.5`,children:[B,V,H]}),t[18]=V,t[19]=H,t[20]=U):U=t[20];let W;t[21]===j?W=t[22]:(W=(0,y.jsx)(`span`,{className:`hidden text-xs sm:inline`,children:j}),t[21]=j,t[22]=W);let G;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,y.jsx)(m,{className:`size-4`,"aria-hidden":!0}),t[23]=G):G=t[23];let K;t[24]!==j||t[25]!==N||t[26]!==W?(K=(0,y.jsxs)(h,{type:`button`,variant:`ghost`,className:`h-9 shrink-0 gap-1.5 px-2.5 text-fg-muted`,title:j,"aria-label":j,onClick:N,children:[W,G]}),t[24]=j,t[25]=N,t[26]=W,t[27]=K):K=t[27];let q;t[28]!==U||t[29]!==K?(q=(0,y.jsxs)(`header`,{className:`flex h-14 shrink-0 items-center justify-between gap-4 border-b border-edge bg-surface-panel px-4 sm:px-5`,children:[U,K]}),t[28]=U,t[29]=K,t[30]=q):q=t[30];let J;t[31]===N?J=t[32]:(J=(0,y.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:(0,y.jsx)(f,{embedded:!0,onRequestClose:N})}),t[31]=N,t[32]=J);let Y;t[33]!==q||t[34]!==J?(Y=(0,y.jsxs)(c,{children:[z,(0,y.jsx)(l,{className:`xopc-work-discovery-dialog pointer-events-none fixed inset-0 z-[76] flex items-center justify-center p-3 outline-none sm:p-6`,children:(0,y.jsxs)(`section`,{className:`xopc-work-discovery-panel pointer-events-auto flex h-[min(47.5rem,calc(100dvh-1.5rem))] w-[min(45rem,calc(100vw-1.5rem))] flex-col overflow-hidden rounded-xl border border-edge bg-surface-base shadow-float sm:h-[min(47.5rem,calc(100dvh-3rem))] sm:w-[min(45rem,calc(100vw-3rem))]`,children:[q,J]})})]}),t[33]=q,t[34]=J,t[35]=Y):Y=t[35];let X;return t[36]!==T||t[37]!==Y||t[38]!==R?(X=(0,y.jsx)(d,{open:T,onOpenChange:R,children:Y}),t[36]=T,t[37]=Y,t[38]=R,t[39]=X):X=t[39],X}function S(e){return e.status===`running`}function C(e){return e.language}export{x as WorkDiscoveryOverlay};
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{n as i}from"./locale-store-Dy1EByeG.js";import{t as a}from"./messages-BAnhwALN.js";import{a as o,i as s,o as c,r as l,s as u,t as d}from"./dist-CY7CS_D3.js";import{t as f}from"./work-discovery-page-BM1HsYz6.js";import{t as p}from"./understanding-activity-store-BFc8PamJ.js";import{t as m}from"./x-B_N4OPjy.js";import{t as h}from"./button-Cc4hUNTt.js";import{t as g}from"./brand-logo-CgT9zQfr.js";var _=n(),v=e(t(),1),y=r(),b=180;function x(e){let t=(0,_.c)(40),{requestedOpen:n,onExited:r}=e,x=i(C),w=p(S),[T,E]=(0,v.useState)(!0),D=(0,v.useRef)(!1),O=(0,v.useRef)(null),k;t[0]===x?k=t[1]:(k=a(x),t[0]=x,t[1]=k);let A=k.onboarding.workDiscovery,j=w?x===`zh`?`在后台继续`:`Continue in background`:x===`zh`?`稍后再说`:`Maybe later`,M;t[2]===r?M=t[3]:(M=()=>{if(D.current)return;D.current=!0,E(!1);let e=window.matchMedia(`(prefers-reduced-motion: reduce)`).matches?0:b;O.current=window.setTimeout(r,e)},t[2]=r,t[3]=M);let N=M,P,F;t[4]!==N||t[5]!==n?(P=()=>{n||N()},F=[N,n],t[4]=N,t[5]=n,t[6]=P,t[7]=F):(P=t[6],F=t[7]),(0,v.useEffect)(P,F);let I,L;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(I=()=>()=>{O.current!==null&&window.clearTimeout(O.current)},L=[],t[8]=I,t[9]=L):(I=t[8],L=t[9]),(0,v.useEffect)(I,L);let R;t[10]===N?R=t[11]:(R=e=>{e||N()},t[10]=N,t[11]=R);let z;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,y.jsx)(o,{className:`xopc-dialog-overlay fixed inset-0 z-[75] bg-scrim backdrop-blur-[1px]`}),t[12]=z):z=t[12];let B;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,y.jsx)(g,{className:`size-7 shrink-0`,"aria-hidden":!0}),t[13]=B):B=t[13];let V;t[14]===A.title?V=t[15]:(V=(0,y.jsx)(u,{className:`truncate text-sm font-semibold text-fg`,children:A.title}),t[14]=A.title,t[15]=V);let H;t[16]===A.subtitle?H=t[17]:(H=(0,y.jsx)(s,{className:`sr-only`,children:A.subtitle}),t[16]=A.subtitle,t[17]=H);let U;t[18]!==V||t[19]!==H?(U=(0,y.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2.5`,children:[B,V,H]}),t[18]=V,t[19]=H,t[20]=U):U=t[20];let W;t[21]===j?W=t[22]:(W=(0,y.jsx)(`span`,{className:`hidden text-xs sm:inline`,children:j}),t[21]=j,t[22]=W);let G;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,y.jsx)(m,{className:`size-4`,"aria-hidden":!0}),t[23]=G):G=t[23];let K;t[24]!==j||t[25]!==N||t[26]!==W?(K=(0,y.jsxs)(h,{type:`button`,variant:`ghost`,className:`h-9 shrink-0 gap-1.5 px-2.5 text-fg-muted`,title:j,"aria-label":j,onClick:N,children:[W,G]}),t[24]=j,t[25]=N,t[26]=W,t[27]=K):K=t[27];let q;t[28]!==U||t[29]!==K?(q=(0,y.jsxs)(`header`,{className:`flex h-14 shrink-0 items-center justify-between gap-4 border-b border-edge bg-surface-panel px-4 sm:px-5`,children:[U,K]}),t[28]=U,t[29]=K,t[30]=q):q=t[30];let J;t[31]===N?J=t[32]:(J=(0,y.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:(0,y.jsx)(f,{embedded:!0,onRequestClose:N})}),t[31]=N,t[32]=J);let Y;t[33]!==q||t[34]!==J?(Y=(0,y.jsxs)(c,{children:[z,(0,y.jsx)(l,{className:`xopc-work-discovery-dialog pointer-events-none fixed inset-0 z-[76] flex items-center justify-center p-3 outline-none sm:p-6`,children:(0,y.jsxs)(`section`,{className:`xopc-work-discovery-panel pointer-events-auto flex h-[min(47.5rem,calc(100dvh-1.5rem))] w-[min(45rem,calc(100vw-1.5rem))] flex-col overflow-hidden rounded-xl border border-edge bg-surface-base shadow-float sm:h-[min(47.5rem,calc(100dvh-3rem))] sm:w-[min(45rem,calc(100vw-3rem))]`,children:[q,J]})})]}),t[33]=q,t[34]=J,t[35]=Y):Y=t[35];let X;return t[36]!==T||t[37]!==Y||t[38]!==R?(X=(0,y.jsx)(d,{open:T,onOpenChange:R,children:Y}),t[36]=T,t[37]=Y,t[38]=R,t[39]=X):X=t[39],X}function S(e){return e.status===`running`}function C(e){return e.language}export{x as WorkDiscoveryOverlay};