@xopcai/xopc 0.0.466 → 0.0.467
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{automations-page-_apIsCPT.js → automations-page-3WGWLdiW.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-WmcQUi9O.js → automations-workspace-CH9gYqIK.js} +2 -2
- package/dist/gateway/static/root/assets/{binary-plugins-C7i5pqkO.js → binary-plugins-MFVtTdvy.js} +1 -1
- package/dist/gateway/static/root/assets/capabilities-settings-panel-BjaLTd6i.js +8 -0
- package/dist/gateway/static/root/assets/chat-page-BtMkdtxJ.js +71 -0
- package/dist/gateway/static/root/assets/{home-page-Dgopm60U.js → home-page-BBTtXpDD.js} +3 -3
- package/dist/gateway/static/root/assets/index-BJj-uZNl.js +11 -0
- package/dist/gateway/static/root/assets/index-DiWUK4sJ.css +1 -0
- package/dist/gateway/static/root/assets/{media-plugins-DlMEwcS8.js → media-plugins-CW5UoTx6.js} +1 -1
- package/dist/gateway/static/root/assets/{note-detail-panel-yAPC_cZU.js → note-detail-panel-D5BtgBxy.js} +2 -2
- package/dist/gateway/static/root/assets/{notes-page-CUMhjKKd.js → notes-page-DyM-3O_9.js} +1 -1
- package/dist/gateway/static/root/assets/personal-page-BB4Sv68K.js +1 -0
- package/dist/gateway/static/root/assets/{project-detail-page-BjOzJyw1.js → project-detail-page-BG2nDt98.js} +1 -1
- package/dist/gateway/static/root/assets/route-preload-BYqg1BYz.js +2 -0
- package/dist/gateway/static/root/assets/{routine-panel-DSNsdpy8.js → routine-panel-Coh2B0j7.js} +2 -2
- package/dist/gateway/static/root/assets/{settings-page-u-U9D9qT.js → settings-page-D9A2DdJ_.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-BYPdlPIb.js → share-preview-page-CyCv69rh.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-BPHt6S1V.js → task-detail-page-DgsLOz6h.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-UhypPQH_.js → use-composer-attachments-C9GpCJQR.js} +1 -1
- package/dist/gateway/static/root/assets/{use-file-preview-expanded-BvEF3yHL.js → use-file-preview-expanded-Daf-LmiF.js} +2 -2
- package/dist/gateway/static/root/assets/video-generation-D08uZbsu.js +1 -0
- package/dist/gateway/static/root/assets/{workspace-file-preview-dialog-BRQIf4sc.js → workspace-file-preview-dialog-JSGIA79T.js} +1 -1
- package/dist/gateway/static/root/index.html +9 -10
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/index.js +2 -0
- package/dist/packages/gateway-contract/src/music-generation.js +6 -0
- package/dist/src/agent/inbound/attachment-pipeline.d.ts +1 -0
- package/dist/src/agent/inbound/attachment-pipeline.js +5 -1
- package/dist/src/agent/prompt/sections/tooling.js +4 -0
- package/dist/src/agent/tools/factory.js +14 -1
- package/dist/src/agent/tools/music-generation-tool.d.ts +11 -0
- package/dist/src/agent/tools/music-generation-tool.js +70 -0
- package/dist/src/agent/tools/toolExposure.js +2 -0
- package/dist/src/agent/tools/video-draft-tool.d.ts +12 -0
- package/dist/src/agent/tools/video-draft-tool.js +75 -0
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/gateway/hono/routes/lazy-bundles.js +9 -1
- package/dist/src/gateway/hono/routes/media.js +1 -20
- package/dist/src/gateway/hono/routes/music-generation.d.ts +3 -0
- package/dist/src/gateway/hono/routes/music-generation.js +59 -0
- package/dist/src/gateway/hono/routes/video-generation.js +51 -26
- package/dist/src/gateway/service.d.ts +1 -0
- package/dist/src/gateway/service.js +4 -1
- package/dist/src/media-shared/http/byte-range.d.ts +6 -0
- package/dist/src/media-shared/http/byte-range.js +23 -0
- package/dist/src/music-generation/artifact.d.ts +5 -0
- package/dist/src/music-generation/artifact.js +105 -0
- package/dist/src/music-generation/mureka.d.ts +3 -0
- package/dist/src/music-generation/mureka.js +96 -0
- package/dist/src/music-generation/provider.d.ts +31 -0
- package/dist/src/music-generation/provider.js +4 -0
- package/dist/src/music-generation/providers.d.ts +26 -0
- package/dist/src/music-generation/providers.js +56 -0
- package/dist/src/music-generation/repository.d.ts +50 -0
- package/dist/src/music-generation/repository.js +104 -0
- package/dist/src/music-generation/settings.d.ts +7 -0
- package/dist/src/music-generation/settings.js +24 -0
- package/dist/src/music-generation/worker.d.ts +8 -0
- package/dist/src/music-generation/worker.js +115 -0
- package/dist/src/personal-agent/policy.d.ts +1 -1
- package/dist/src/personal-agent/policy.js +3 -1
- package/dist/src/personal-agent/prompts.js +2 -0
- package/dist/src/session/store.js +8 -2
- package/dist/src/storage/sqlite/schema.d.ts +2 -2
- package/dist/src/storage/sqlite/schema.js +7 -7
- package/dist/src/storage/sqlite/schema.sql +31 -0
- package/dist/src/storage/sqlite/transcript-repository.d.ts +1 -0
- package/dist/src/storage/sqlite/transcript-repository.js +8 -1
- package/dist/src/storage/sqlite/upgrades/277_music_generation.sql +30 -0
- package/dist/src/video-generation/drafts.d.ts +17 -0
- package/dist/src/video-generation/drafts.js +89 -0
- package/dist/src/video-generation/worker.js +1 -1
- package/package.json +1 -1
- package/dist/gateway/static/root/assets/api-CG-SjNfw.js +0 -1
- package/dist/gateway/static/root/assets/capabilities-settings-panel-DuQGhgAl.js +0 -8
- package/dist/gateway/static/root/assets/chat-page-BMZwIVXH.js +0 -71
- package/dist/gateway/static/root/assets/index-BE3XMuQI.js +0 -11
- package/dist/gateway/static/root/assets/index-CY5vdQcc.css +0 -1
- package/dist/gateway/static/root/assets/personal-page-POCG1_kK.js +0 -1
- package/dist/gateway/static/root/assets/route-preload-DjYsRhY1.js +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sessions-page-dEupc-3A.js","assets/rolldown-runtime-aKtaBQYM.js","assets/vendor-react-BOUWij0V.js","assets/chunk-KS7C4IRE-CiwuuyV8.js","assets/preload-helper-Czpn1I53.js","assets/locale-store-DIBIYLnI.js","assets/messages-BDBGlBKh.js","assets/dist-CY7CS_D3.js","assets/es2015-DBLcMg5B.js","assets/dist-CxGUk8J-.js","assets/session-identity-label-DCIZvqbN.js","assets/createLucideIcon-DPHK1VkS.js","assets/session-channel-icon-COynhpeK.js","assets/clock-3-DnrAnuyZ.js","assets/git-branch-Dh9uxTot.js","assets/message-circle-Badhj-4D.js","assets/message-square-fVE7Ghj1.js","assets/panels-top-left-BKvp2Dag.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-a6wb0_Gf.js","assets/gateway-startup-retry-yZn7ShiP.js","assets/vendor-swr-CdRzEUwF.js","assets/gateway-config-swr-Dk3FtNv1.js","assets/chat-agents-api-BksS0CNy.js","assets/registry-api-pQ0eInzG.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-BO1bqKlR.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-COGICRIG.js","assets/open-capability-settings-DQsmJxI7.js","assets/model-sort-_Tz8s_4N.js","assets/settings-advanced-section-CnGJr2xp.js","assets/settings-mode-store-DWRhupcY.js","assets/middleware-Pd0e8Igk.js","assets/number-input-El7Szeln.js","assets/settings-page-header-wL2jvs-y.js","assets/external-link-DjqjBmc3.js","assets/sparkles-DHlfQFAF.js","assets/settings-page-layout-BkUQVmyY.js","assets/settings-form-section-num14vSv.js","assets/pencil-DmIY3Oa-.js","assets/use-autosave-xX2KrbXw.js","assets/circle-alert-BEjgurr2.js","assets/loader-circle-CifKLtgG.js","assets/settings-advanced-gate-DjyibJZ1.js","assets/usage-page-DPUjEj39.js","assets/bot-DjLkhyZL.js","assets/gauge-C78eD2BA.js","assets/refresh-cw-BRlGaq2w.js","assets/timer-rCwGHjuO.js","assets/xopc-cloud-account-card-Cm0Saa8B.js","assets/cloud-C4-yfnnk.js","assets/triangle-alert-2JXFNNKU.js","assets/cloud-credits-B-nbtkqv.js","assets/automations-page-3WGWLdiW.js","assets/automations-workspace-CH9gYqIK.js","assets/activity-YogQEteU.js","assets/arrow-left-D880xG-P.js","assets/automation-display-DaVDNZz8.js","assets/automation-run-list-BShRirWV.js","assets/automation-api-24NjW7qG.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-C30KvTaE.js","assets/diagnostics-Bo0Z42P_.js","assets/file-image-CDUPkZvG.js","assets/app-link-BkEO3eBe.js","assets/product-delivery-CnvCn9L-.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-DDWYNF7I.js","assets/tasks-BTLabOMp.js","assets/specialists-xbB3xL9e.js","assets/files-BNL4kkSB.js","assets/session-manager-D5g6LOU-.js","assets/constants-Bg1wM2nv.js","assets/local-session-drafts-CZ19DRRK.js","assets/tool-activity-BtJkgjFf.js","assets/attachment-utils-core-BIOUBrpT.js","assets/gateway-realtime-DMvo4pAc.js","assets/gateway-realtime-store-CJf-qaHZ.js","assets/agents-admin-api-DZ1lLnrj.js","assets/page-header-store-C2ydtnXa.js","assets/agent-display-names-Bje7vfSn.js","assets/refresh-button-DiWdGAaX.js","assets/dist-ZrL34Ps4.js","assets/automation-task-card-Bgq5Plux.js","assets/date-picker-UEh3JM7r.js","assets/calendar-days-hw_Y-g-s.js","assets/chevron-left-DqFhpbvK.js","assets/time-picker-C1PXAXZF.js","assets/automation-result-state-C94Q3OEL.js","assets/date-time-picker-Dci0LfAU.js","assets/routine-panel-Coh2B0j7.js","assets/capabilities-CFWTer_v.js","assets/workspace-preview-store-DNLnuHlf.js","assets/capabilities-Dyw8xW90.js","assets/right-workspace-store-DHHyicqQ.js","assets/phone-workspace-store-BwilERgv.js","assets/workspace-editor-agent-store-CyPjTDSx.js","assets/task-result-evidence-C-zIBpzi.js","assets/file-text-D12HbeVy.js","assets/activity-store-CdEua6PR.js","assets/shares-api-CfFiW03g.js","assets/home-page-BBTtXpDD.js","assets/arrow-right-DSSvoX71.js","assets/circle-pause-CN9jYH2s.js","assets/grip-horizontal-CqVA8V1e.js","assets/history-DXH_9jsE.js","assets/list-todo-CTVRto8O.js","assets/lock-keyhole-DEK5kH0u.js","assets/paperclip-f1HujQY1.js","assets/undo-2-6IMTwK4M.js","assets/composer-payload-handoff-xEFHDnLo.js","assets/mic-CuUb7zc-.js","assets/rotate-ccw-JM1TBLpp.js","assets/voice-input-shortcut-events-CKn6X3qL.js","assets/use-realtime-voice-RQW5KnIN.js","assets/voice-CDlC6XMH.js","assets/composer-notifications-nT-U6jcc.js","assets/composer-handoff-params-DBpzHuNo.js","assets/skill-wire-pattern-BPpeIcCi.js","assets/use-composer-attachments-C9GpCJQR.js","assets/file-BqMS_3DT.js","assets/use-file-preview-expanded-Daf-LmiF.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-CscTRODe.js","assets/index.module-Cd9ENXfk.js","assets/share-link-dialog-DFDJyl3N.js","assets/globe-DSSGFWFn.js","assets/copy-text-row-CpiRzq4G.js","assets/file-preview-surface-B7B9qXm9.js","assets/date-formatters-DukWSVwc.js","assets/tab-completion-input-CxtEp0aP.js","assets/task-detail-page-DgsLOz6h.js","assets/chat-page-BtMkdtxJ.js","assets/video-generation-D08uZbsu.js","assets/arrow-up-D5ZtR1QT.js","assets/product-automation-feedback-BlwtlUY7.js","assets/notes-api-BXevQivV.js","assets/chat-chart-block-aZIklMNN.js","assets/volume-2-BSJhAY97.js","assets/earth-C9Z4bTTG.js","assets/working-directory-picker-modal-DStgfCzQ.js","assets/file-archive-DanfQJNe.js","assets/send-1f1Ntw6E.js","assets/circle-x-DFsCKeya.js","assets/file-tree-utils-DJs1faGv.js","assets/folder-kanban-CpLlFI1o.js","assets/folder-CN-pC3XL.js","assets/key-round-DWbpyU2U.js","assets/laptop-CI3hBVrl.js","assets/list-checks-BbsExAoq.js","assets/messages-square-BckAJrEW.js","assets/monitor-Af5eAvF7.js","assets/install-connector-dialog-QkJMw_uW.js","assets/secret-input-DsjfQmDn.js","assets/is-masked-secret-DOkL5b_X.js","assets/connectors-api-so2a7xrD.js","assets/oauth-provider-connect-C2pfvPOI.js","assets/models-hub-cache-aRYHi2dh.js","assets/oauth-api-enDU_32p.js","assets/connection-usage-guide-C8jPm7QO.js","assets/connection-usage-BhdQRWgQ.js","assets/smartphone-DSSsQFqA.js","assets/square-DMK_fB-3.js","assets/user-round-C9jxPhMR.js","assets/wrench-DFb4r8bH.js","assets/new-session-preferences-gb411vZP.js","assets/composer-model-config-control-BhRAbdPW.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/new-chat-navigation-DXYDldT_.js","assets/extension-provider-lqJ1zIkA.js","assets/theme-store-DxF7S6I2.js","assets/extension-message-router-DZahH1Hd.js","assets/use-directory-picker-C4p7AgWY.js","assets/confirm-dialog-DrA5mTQp.js","assets/command-palette-api-VhBEUFmw.js","assets/skill-list-api-CmPp2czp.js","assets/skill-api-utils-C7V4JVXM.js","assets/dev-view-store-C7v4CIlF.js","assets/extension-iframe-host-CjfRKtQ4.js","assets/extension-authoritative-grants-DIeg1mg8.js","assets/runtime-health-zDkHcOZO.js","assets/api-DVXcGKP-.js","assets/terminal-panel-store-CgPqgrm7.js","assets/agents-app-path-ciChvpCS.js","assets/use-media-query-ady-FgjK.js","assets/oauth-authorization-window-o6URRos4.js","assets/page-context-draft-4-3RtO0q.js","assets/management-api-EG5duPec.js","assets/side-chat-shortcut-BIw-1TTD.js","assets/chat-page-zQeUaawJ.css","assets/page-context-capture-button-BaSooYGv.js","assets/dependency-picker-XjPB8FJS.js","assets/projects-page-B3aGdPHy.js","assets/project-understanding-lOJ5Tz2V.js","assets/project-detail-page-BG2nDt98.js","assets/resource-unavailable-Y9WRHOnz.js","assets/recording-upload-BJkXktA-.js","assets/workspace-open-location-menu-CBHFZ2iQ.js","assets/file-tree-CFlZnV3Y.js","assets/image-Cwyalflz.js","assets/panel-left-C8MqSXRZ.js","assets/sticky-note-fzP7NAJq.js","assets/store-SzD1Jvgm.js","assets/upload-rrb46c3c.js","assets/workspace-file-preview-dialog-JSGIA79T.js","assets/with-selector-xonYxPoM.js","assets/project-overview-model-DrLXaO-t.js","assets/directory-picker-path-field-DmRZY8kg.js","assets/skill-api-CWRhFSkA.js","assets/skill-reload-api-BGsSq3dj.js","assets/note-detail-panel-D5BtgBxy.js","assets/code-xml-DJtYhZUF.js","assets/sliders-horizontal-DqsYor6I.js","assets/note-image-lightbox-CxXu_Tkh.js","assets/project-detail-page-DLioOiRN.css","assets/notes-page-DyM-3O_9.js","assets/star-CnYNmpLd.js","assets/capabilities-page-C2RB9fzC.js","assets/product-navigation-Dp-adLY_.js","assets/capability-links-MZdYfPKx.js","assets/capability-header-actions-BxMYfQ8y.js","assets/user-model-page-hKnsTcMk.js","assets/understanding-refresh-store-CPeQIXS_.js","assets/understanding-activity-store-C2RHmRo8.js","assets/logs-page-CukseY3k.js","assets/sliding-segmented-DagP0myu.js","assets/settings-page-D9A2DdJ_.js","assets/browser-settings-page-DI2PYAPC.js","assets/cpu-B247669f.js","assets/info-CDrmIZhb.js","assets/plug-zap-L8NMe3Sv.js","assets/settings-loading-skeleton-CAoOV17i.js","assets/phone-settings-page-BUZ1dh7s.js","assets/beta-badge-BnzdzIEl.js","assets/global-defaults-api-gsAa0Kj9.js","assets/phone-model-picker-CD97E6C5.js","assets/phone-dependencies-card-DUT-qRLZ.js","assets/runtime-tools-api-BoJQ3u5o.js","assets/phone-model-connection-pvOciDNo.js","assets/providers-api-C26HgxZY.js","assets/mobile-pair-qr-CuIbmw5x.js","assets/browser-BLJWD7WI.js","assets/computer-settings-page-DXlH96m6.js","assets/mouse-pointer-2-DZ51Onvj.js","assets/extension-page-DMuHBIHa.js","assets/extension-settings-page-D5IfKVff.js","assets/schema-form-DXHzZPMr.js","assets/secret-input-labels-B5Jl5HqK.js","assets/voice-config-api-vbBoKnqd.js","assets/voice-api-key-field-BeEF7Thh.js","assets/extension-debug-page-D8TAJgZ_.js","assets/share-preview-page-CyCv69rh.js","assets/local-apps-page-D-bRvlZY.js","assets/box-DvYoGszj.js","assets/local-app-workbench-page-wekatwet.js","assets/power-off-CwwQ7Gp7.js","assets/power-ZI-pBczI.js","assets/product-open-page-Dy6D5exJ.js","assets/open-route-MyZ2sB9C.js","assets/work-discovery-page-BdBpri6P.js","assets/service-recommendation-list-_rFmwIwY.js","assets/package-wATCyihJ.js","assets/server-BlHCBjiE.js","assets/agent-plugin-dialog-BQA2brAU.js","assets/capability-icon-CmvCZOJX.js","assets/extension-marketplace-api-V1oFBxVi.js","assets/work-discovery-overlay-Ddvqu02U.js","assets/brand-logo-CgT9zQfr.js","assets/setup-status-panel-DXvYjIu3.js","assets/stethoscope-DRqTAtjD.js","assets/appearance-settings-E_BcjEDM.js","assets/preference-select-fields-BSUgcO7-.js","assets/keyboard-shortcuts-settings-BZXqXuI4.js","assets/personal-settings-panel-DiNpP_g3.js","assets/voice-settings-BUrk4mwV.js","assets/capability-navigation-CZbCI5C2.js","assets/use-personal-profile-BJgaheR4.js","assets/personal-profile-settings-DwMdjQ6H.js","assets/personal-avatar-BPQpvC34.js","assets/personal-avatar-BUCb7OiW.css","assets/system-settings-panel-aw9C86I8.js","assets/browser-notification-delivery-DmE2FgGc.js","assets/shield-B1sI_cxl.js","assets/desktop-pet-settings-CYE2eTTf.js","assets/wand-sparkles-CkSL-3Fy.js","assets/desktop-pet-sprite-D5YYq2zC.js","assets/desktop-pet-sprite-BuB0g8zv.css","assets/app-management-settings-panel-B5-7E03Z.js","assets/capabilities-settings-panel-BjaLTd6i.js","assets/connected-providers-grid-D8vBFsbY.js","assets/navigation-ByOzYT0t.js","assets/image-generation-api-DPn1SBMH.js","assets/gateway-settings-DGPaikv5.js","assets/network-BUQLY1BV.js","assets/gateway-restart-C2h5R1eP.js","assets/runtime-tools-settings-panel-DB7cfLrX.js","assets/remote-access-hub-CjWrYzjf.js","assets/tunnel-api-CIte6n0U.js","assets/shares-settings-B85XIDFv.js","assets/use-workspace-tree-B6QFV5gR.js","assets/agent-defaults-settings-panel-Dj_H2kDD.js","assets/puzzle-BptcPjKI.js","assets/management-settings-B7RWHrwo.js","assets/shield-off-2jsucUds.js","assets/device-pairing-wizard-7NDkYmiZ.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-dEupc-3A.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,80])),n=()=>e(()=>import(`./usage-page-DPUjEj39.js`),__vite__mapDeps([81,1,2,3,4,5,6,82,11,26,27,22,23,28,29,8,9,30,31,32,78,34,35,83,84,85,49,53,63,57,71,72,73,74,86,87,88,89,24])),r=()=>e(()=>import(`./automations-page-3WGWLdiW.js`),__vite__mapDeps([90,2,1,91,4,3,5,6,7,8,9,92,11,93,94,95,22,23,28,49,96,27,97,98,26,29,30,31,32,78,99,100,101,102,14,103,79,104,105,36,106,42,46,107,108,24,109,110,111,112,113,15,114,76,115,84,43,116,73,117,45,21,118,119,120,121,47,48,122,123,124,125,126,127,128,52,129,50,51,53,130,131,63,57,132,133,64,19,65,54,55,66,134,58,59,60,135,136,137,138,13,139,140,141,142,143,144,145,146,147,148,72,149,150,151])),i=()=>e(()=>import(`./home-page-BBTtXpDD.js`),__vite__mapDeps([152,1,2,4,3,5,6,7,8,9,153,11,94,27,97,98,78,99,154,13,72,149,155,156,157,158,104,105,36,106,42,46,22,23,107,108,24,109,110,111,112,113,15,16,17,159,84,43,19,73,160,28,123,142,119,120,124,49,143,144,145,146,147,53,29,30,31,161,162,163,65,54,164,69,165,166,122,47,48,125,126,127,128,52,129,50,167,150,130,96,168,169,63,57,170,137,171,172,173,100,101,102,37,174,79,175,40,76,176,177,178,179,180,181,121,182,133,183,26,32,184,185,186,151,187,141,148,188])),a=()=>e(()=>import(`./task-detail-page-DgsLOz6h.js`),__vite__mapDeps([189,1,2,3,4,5,6,7,8,9,190,105,11,173,25,93,191,192,193,92,82,99,154,13,72,194,36,104,106,42,46,22,23,107,108,24,109,110,111,112,113,195,27,100,28,79,16,114,115,163,176,73,88,196,21,49,53,96,197,97,98,198,199,54,55,62,26,29,30,31,32,78,200,201,33,202,35,101,171,149,203,37,204,172,102,174,175,40,159,76,84,177,43,123,47,48,126,167,150,178,179,180,63,57,181,121,182,133,14,184,156,205,206,207,157,208,162,209,210,211,212,213,50,214,87,215,52,216,217,218,19,44,116,219,220,45,221,183,185,222,119,120,118,122,124,125,127,128,129,223,224,64,65,66,143,142,144,145,146,147,51,69,161,164,225,226,227,165,166,228,130,229,59,60,230,231,232,58,169,168,131,233,234,151,170,137,186,235,236,237,134,94,15,135,136,138,238,239,240,241,242,243,244,245,246,247,248,249,250,187,140,148,251,252])),o=()=>e(()=>import(`./projects-page-B3aGdPHy.js`),__vite__mapDeps([253,1,2,3,4,5,6,7,8,9,25,11,153,198,199,79,22,23,53,54,55,62,26,27,28,29,30,31,32,203,37,41,42,163,43,46,118,24,119,120,121,130,254,49,233,187])),s=()=>e(()=>import(`./project-detail-page-BG2nDt98.js`),__vite__mapDeps([255,1,2,3,4,5,6,256,7,8,9,25,11,257,97,53,22,23,93,153,193,92,82,99,154,13,72,194,36,104,105,106,42,46,107,108,24,109,110,111,112,113,195,27,100,28,79,16,114,115,163,176,73,88,196,21,49,96,94,137,98,198,199,54,55,62,26,29,30,31,32,78,200,33,202,258,37,167,150,179,259,101,171,149,204,172,173,102,174,175,40,159,76,84,177,43,123,47,48,126,178,180,63,57,181,121,182,133,14,156,260,39,207,158,162,261,41,44,116,220,262,263,45,264,221,119,120,118,143,142,124,144,145,146,147,129,50,56,130,229,168,169,131,254,234,132,265,183,184,185,231,69,186,151,170,235,236,237,135,136,266,267,77,187,268,233,269,270,91,95,103,15,117,122,125,127,128,52,51,64,19,65,66,134,58,59,60,138,139,140,141,148,251,247,271,272,273,214,87,215,216,274,252,275])),c=()=>e(()=>import(`./notes-page-DyM-3O_9.js`),__vite__mapDeps([276,1,2,3,4,5,6,25,11,257,97,53,9,22,23,93,153,192,193,92,82,99,154,13,72,194,7,8,36,104,105,106,42,46,107,108,24,109,110,111,112,113,195,27,100,28,79,16,114,115,163,176,73,88,196,21,49,96,136,26,29,30,31,32,101,149,204,277,162,159,43,45,178,130,63,57,234,182,133,271,272,102,156,15,76,84,273,117,220,264,122,123,47,48,124,125,126,127,128,52,129,50,231,69,151,214,87,179,215,216,247,274,251,144,142,119,120])),l=()=>e(()=>import(`./capabilities-page-C2RB9fzC.js`),__vite__mapDeps([278,1,2,4,3,5,6,28,22,23,279,130,280,218,281,43,11,53,9,29,8,30,31,245])),u=()=>e(()=>import(`./user-model-page-hKnsTcMk.js`),__vite__mapDeps([282,1,2,3,4,5,6,7,8,9,93,11,197,82,283,49,136,27,97,98,26,22,23,28,29,30,31,32,78,99,13,35,36,101,284,37,14,157,79,158,15,76,42,84,43,116,273,73,262,45,264,221,46,53,178,130,59,60,63,57,182,133,135,137])),d=()=>e(()=>import(`./logs-page-CukseY3k.js`),__vite__mapDeps([285,1,2,3,4,5,6,7,8,9,97,11,26,27,22,23,28,29,30,31,32,286,57,61,36,149,204,83,103,84,43,20,46,47,24,48,127,128,53,110,55,132,71,72,73,74,140,135,136,137,98,138,13])),f=()=>e(()=>import(`./settings-page-D9A2DdJ_.js`),__vite__mapDeps([287,1,2,3,4,5,6])),p=()=>e(()=>import(`./browser-settings-page-DI2PYAPC.js`),__vite__mapDeps([288,1,2,3,4,5,6,97,11,26,27,22,23,28,29,8,9,30,31,32,99,289,36,72,102,37,83,184,290,79,158,291,84,19,88,49,50,53,62,292,70,71,73,74,77,78])),m=()=>e(()=>import(`./phone-settings-page-BUZ1dh7s.js`),__vite__mapDeps([293,1,2,3,4,5,6,7,8,9,173,11,97,26,27,22,23,28,29,30,31,32,294,115,42,84,43,116,219,46,49,53,146,133,295,50,71,72,73,296,66,297,99,36,222,298,299,93,65,300,52,48,212,215,301,302])),h=()=>e(()=>import(`./computer-settings-page-DXlH96m6.js`),__vite__mapDeps([303,1,2,3,4,5,6,27,11,184,209,304,42,116,220,28,22,23,49,50,52,48,53,9,179,64,26,29,8,30,31,32,19,65,54,55,66,295,71,72,73,74])),g=()=>e(()=>import(`./extension-page-DMuHBIHa.js`),__vite__mapDeps([305,1,2,3,4,256,5,6,130,230,49,127,24,128,231,69,232,109,122,105,123,47,48,124,125,126,52,129,50,142,119,120,150,239,7,8,9,28,22,23,62,240,26,11,27,29,30,31,32])),_=()=>e(()=>import(`./extension-settings-page-D5IfKVff.js`),__vite__mapDeps([306,1,2,3,4,5,6,256,26,11,27,22,23,28,29,8,9,30,31,32,49,53,55,230,127,24,128,231,69,232,109,122,105,123,47,48,124,125,126,52,129,50,142,119,120,150,66,239,7,62,240,292,71,72,73,74,77,78,79,307,211,99,100,102,110,54,212,308,70,309,166,310])),v=()=>e(()=>import(`./extension-debug-page-D8TAJgZ_.js`),__vite__mapDeps([311,1,2,5,6,230,49,127,24,128,231,69,232,109,122,105,123,47,48,124,125,126,52,4,129,50,142,119,120,150,71,3,72,11,73,22,23,53,9,74])),y=()=>e(()=>import(`./share-preview-page-CyCv69rh.js`),__vite__mapDeps([312,1,2,4,3,5,6,172,11,173,27,97,100,36,101,72,102,37,174,79,104,105,7,8,9,106,42,46,22,23,107,108,24,109,110,111,112,113,175,40,159,76,84,176,177,43,28,123,47,48,126,54,167,150,178,179,180,63,57,181,121,182,133,30,31,53,195])),b=()=>e(()=>import(`./local-apps-page-D-bRvlZY.js`),__vite__mapDeps([313,1,2,3,4,5,6,153,11,314,42,28,22,23,49,53,9,130,242])),x=()=>e(()=>import(`./local-app-workbench-page-wekatwet.js`),__vite__mapDeps([315,1,2,3,4,5,6,256,7,8,9,93,11,27,26,22,23,28,29,30,31,32,99,201,13,72,316,203,156,79,261,317,84,163,116,73,45,88,46,109,24,49,53,231,69,130,232,122,105,123,47,48,124,125,126,127,128,52,129,50,142,119,120,150,240,241,242,187,188,251,149,144,133,247])),S=()=>e(()=>import(`./product-open-page-Dy6D5exJ.js`),__vite__mapDeps([318,2,1,3,4,5,6,28,22,23,108,24,109,49,242,319])),C=()=>e(()=>import(`./work-discovery-page-BdBpri6P.js`).then(e=>e.n),__vite__mapDeps([320,1,2,3,4,5,6,11,321,7,8,9,97,198,199,79,22,23,53,54,55,62,99,205,210,26,27,28,29,30,31,32,72,211,100,102,110,212,46,213,50,49,179,214,87,215,52,48,216,217,73,218,322,42,323,324,93,78,33,37,116,264,280,302,325,326,136,98,13,35,284,149,14,157,208,291,59,60,233])),w=()=>e(()=>import(`./work-discovery-overlay-Ddvqu02U.js`),__vite__mapDeps([327,1,2,5,6,7,8,9,320,3,4,11,321,97,198,199,79,22,23,53,54,55,62,99,205,210,26,27,28,29,30,31,32,72,211,100,102,110,212,46,213,50,49,179,214,87,215,52,48,216,217,73,218,322,42,323,324,93,78,33,37,116,264,280,302,325,326,136,98,13,35,284,149,14,157,208,291,59,60,233,328])),T=()=>e(()=>import(`./setup-status-panel-DXvYjIu3.js`),__vite__mapDeps([329,1,2,3,4,5,6,92,11,98,99,201,33,290,79,84,330,88,22,23,28,49,50,128,52,48,53,9,54,212,179,236,237,292,300,215,71,72,73,74,75,76,80,68,69,298])),E=()=>e(()=>import(`./appearance-settings-E_BcjEDM.js`),__vite__mapDeps([331,1,2,5,6,26,11,27,22,23,28,29,8,9,30,31,32,50,49,54,332,69,55,231,238,71,3,4,72,73,53,74,80,68])),D=()=>e(()=>import(`./keyboard-shortcuts-settings-BZXqXuI4.js`),__vite__mapDeps([333,1,2,5,6,22,23,179,164,69,249,71,3,4,72,11,73,53,9,74])),O=()=>e(()=>import(`./personal-settings-panel-DiNpP_g3.js`),__vite__mapDeps([334,1,2,5,6,26,11,27,22,23,28,29,8,9,30,31,32,122,105,24,123,47,48,124,125,126,127,128,52,4,129,50,49,335,3,211,99,100,102,79,110,54,55,212,162,115,220,196,166,53,65,165,69,167,150,228,308,66,64,19,292,336,70,77,78,309,310,337,71,72,73,74,338,264,224,93,97,98,163,58,59,60,339,340])),k=()=>e(()=>import(`./system-settings-panel-aw9C86I8.js`),__vite__mapDeps([341,1,2,5,6,342,11,179,72,84,343,22,23,54,62,71,3,4,73,53,9,74,75,76])),A=()=>e(()=>import(`./desktop-pet-settings-CYE2eTTf.js`),__vite__mapDeps([344,1,2,3,4,5,6,256,97,11,26,27,22,23,28,29,8,9,30,31,32,78,72,175,345,163,54,179,132,84,53,346,347,71,73,74])),j=()=>e(()=>import(`./app-management-settings-panel-B5-7E03Z.js`),__vite__mapDeps([348,1,2,5,6,7,8,9,100,11,79,322,22,23,28,49,53,32,110,54,179,62,292,71,3,4,72,73,74,75,76])),M=()=>e(()=>import(`./capabilities-settings-panel-BjaLTd6i.js`),__vite__mapDeps([349,1,2,4,3,5,6,7,8,9,153,11,191,98,26,27,22,23,28,29,30,31,32,99,350,137,211,100,102,79,110,54,55,212,184,42,43,19,46,49,50,52,48,53,308,63,57,66,336,215,300,214,87,179,216,72,260,205,76,18,84,116,273,45,88,222,166,24,65,335,162,115,220,196,165,122,105,123,47,124,125,126,127,128,129,69,167,150,228,64,292,70,77,78,309,310,351,62,234,244,295,67,68,246,71,73,74,75,352,86,89])),N=()=>e(()=>import(`./gateway-settings-DGPaikv5.js`),__vite__mapDeps([353,1,2,3,4,5,6,26,11,27,22,23,28,29,8,9,30,31,32,78,211,99,100,102,79,110,54,55,212,290,205,354,84,176,355,87,209,76,116,49,53,179,343,273,88,50,308,351,56,57,62,234,7,68,69,292,67,70,71,72,73,74,75,80])),P=()=>e(()=>import(`./runtime-tools-settings-panel-DB7cfLrX.js`),__vite__mapDeps([356,1,2,5,6,26,11,27,22,23,28,29,8,9,30,31,32,78,99,36,163,49,53,132,84,292,71,3,4,72,73,74,80,68,69,298,297,97,222])),F=()=>e(()=>import(`./remote-access-hub-CjWrYzjf.js`),__vite__mapDeps([357,1,2,3,4,5,6,7,8,9,153,11,27,97,98,33,100,72,211,99,102,79,22,23,110,54,55,212,184,205,354,317,323,343,219,20,88,49,50,53,32,56,57,62,234,185,30,31,68,69,300,52,48,215,216,179,67,246,71,73,74,75,76,358,28,351,80])),I=()=>e(()=>import(`./shares-settings-B85XIDFv.js`),__vite__mapDeps([359,1,2,3,4,5,6,7,8,9,27,11,97,26,22,23,28,29,30,31,32,202,87,100,259,98,101,199,171,106,149,37,204,54,179,156,79,16,42,84,262,45,183,72,184,46,53,185,110,49,50,129,55,56,57,131,62,234,151,360,181,121,24,147,292,214,99,215,52,48,216,70,71,73,74,75,76])),L=()=>e(()=>import(`./agent-defaults-settings-panel-Dj_H2kDD.js`),__vite__mapDeps([361,1,2,3,4,5,6,99,11,83,207,362,43,116,273,22,23,28,89,24,49,53,9,179,63,57,236,237,68,69,295,50,67,70,71,72,73,74,77,27,78,79])),R=()=>e(()=>import(`./management-settings-B7RWHrwo.js`),__vite__mapDeps([363,1,2,3,4,5,6,7,8,9,92,11,137,98,26,27,22,23,28,29,30,31,32,206,364,42,43,219,46,47,24,48,49,53,56,54,57,234,132,84,182,292,248,71,72,73,74,365,99,13,36,366,107,108,109,180,185,100,110,216,179,246,358,184,79,317,50,55,351,75,76,301,302])),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};
|
package/dist/gateway/static/root/assets/{routine-panel-DSNsdpy8.js → routine-panel-Coh2B0j7.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/workspace-file-preview-dialog-
|
|
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-DIBIYLnI.js";import{t as l}from"./messages-BDBGlBKh.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{I as g}from"./markdown-view-C30KvTaE.js";import{t as _}from"./skeleton-DzdOeGYz.js";import{s as v}from"./tasks-BTLabOMp.js";import{c as y}from"./capabilities-CFWTer_v.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-DNLnuHlf.js";import{t as T}from"./button-Cc4hUNTt.js";import{n as E,r as D,t as O}from"./task-result-evidence-C-zIBpzi.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-BRQIf4sc.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,77])));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};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/workspace-file-preview-dialog-JSGIA79T.js","assets/rolldown-runtime-aKtaBQYM.js","assets/vendor-react-BOUWij0V.js","assets/locale-store-DIBIYLnI.js","assets/messages-BDBGlBKh.js","assets/use-file-preview-expanded-Daf-LmiF.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-C30KvTaE.js","assets/diagnostics-Bo0Z42P_.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-BkEO3eBe.js","assets/product-delivery-CnvCn9L-.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-Bg1wM2nv.js","assets/session-api-a6wb0_Gf.js","assets/gateway-startup-retry-yZn7ShiP.js","assets/attachment-utils-core-BIOUBrpT.js","assets/interaction-BdhHBbYa.js","assets/composer-notifications-nT-U6jcc.js","assets/activity-store-CdEua6PR.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-CscTRODe.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-DFDJyl3N.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-DHHyicqQ.js","assets/phone-workspace-store-BwilERgv.js","assets/theme-store-DxF7S6I2.js","assets/middleware-Pd0e8Igk.js","assets/file-preview-surface-B7B9qXm9.js","assets/shares-api-CfFiW03g.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-DIBIYLnI.js";import{t as l}from"./messages-BDBGlBKh.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{I as g}from"./markdown-view-C30KvTaE.js";import{t as _}from"./skeleton-DzdOeGYz.js";import{s as v}from"./tasks-BTLabOMp.js";import{c as y}from"./capabilities-CFWTer_v.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-DNLnuHlf.js";import{t as T}from"./button-Cc4hUNTt.js";import{n as E,r as D,t as O}from"./task-result-evidence-C-zIBpzi.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-JSGIA79T.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,77])));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};
|
package/dist/gateway/static/root/assets/{settings-page-u-U9D9qT.js → settings-page-D9A2DdJ_.js}
RENAMED
|
@@ -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-DIBIYLnI.js";import{t as s}from"./messages-BDBGlBKh.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-
|
|
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-DIBIYLnI.js";import{t as s}from"./messages-BDBGlBKh.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-BYqg1BYz.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,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/attachment-process-heavy-DGZZ-M85.js","assets/rolldown-runtime-aKtaBQYM.js","assets/preload-helper-Czpn1I53.js","assets/pdf-runtime-JnUAvfIa.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{f as a}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{i as o,n as s}from"./locale-store-DIBIYLnI.js";import{t as c}from"./messages-BDBGlBKh.js";import{g as l,h as u,n as d,p as f,t as p}from"./use-file-preview-expanded-BvEF3yHL.js";import{t as m}from"./markdown-view-C30KvTaE.js";import{t as h}from"./cn-0WouolD0.js";import{t as g}from"./skeleton-DzdOeGYz.js";import{t as _}from"./attachment-utils-core-BIOUBrpT.js";import{t as v}from"./button-Cc4hUNTt.js";import{t as y}from"./copy-to-clipboard-HOJ79TWv.js";import{r as b,t as x}from"./chat-chart-block-aZIklMNN.js";import{t as S}from"./composer-notifications-nT-U6jcc.js";var C=e(t(),1),w=n(),T=/^ {0,3}\[([^\]]+)\]:\s*<?(https?:\/\/[^\s>]+)>?(?:\s+.*)?$/gim,E=/!\[([^\]]*)\]\(\s*<?(https?:\/\/[^\s)>]+)>?(?:\s+(?:"[^"]*"|'[^']*'|\([^)]*\)))?\s*\)/gi,D=/!\[([^\]]*)\]\[([^\]]+)\]/g;function O(e,t){let n=new Map;for(let t of e.matchAll(T))n.set(k(t[1]??``),t[2]??``);return e.replace(E,(e,n,r)=>`[${n.trim()||t}](${r})`).replace(D,(e,r,i)=>{let a=n.get(k(i));return a?`[${r.trim()||t}](${a})`:e})}function k(e){return e.trim().replace(/\s+/g,` `).toLowerCase()}var A=r();function j(e){return(0,A.jsx)(x,{source:e.source,incomplete:!e.closed,streaming:!1,copy:!0})}function M(){return{textContent:null,binaryBuffer:null,extractedText:null,extractedTextTruncated:!1}}function N(e){let t=(0,w.c)(30),{subtitle:n,openInlineUrl:r,landingUrl:i,...a}=e,{expanded:o,setExpanded:s}=p(),l=c(a.language),u;t[0]===l?u=t[1]:(u=async()=>{let e=await y(window.location.href);S(e?`success`:`warning`,e?l.sharesSettings.copied:l.clipboard.copyFailed)},t[0]=l,t[1]=u);let f=u,m=o&&`fixed inset-0 z-[65] h-[100dvh] max-w-none`,g;t[2]===m?g=t[3]:(g=h(`mx-auto flex h-full min-h-0 w-full max-w-[var(--max-width-app-main)] flex-col bg-surface-panel`,m),t[2]=m,t[3]=g);let _;t[4]!==s||t[5]!==a.loadError||t[6]!==a.loading?(_=!a.loading&&!a.loadError?()=>s(P):void 0,t[4]=s,t[5]=a.loadError,t[6]=a.loading,t[7]=_):_=t[7];let v;t[8]===i?v=t[9]:(v=()=>window.location.assign(i),t[8]=i,t[9]=v);let b;t[10]===f?b=t[11]:(b=()=>void f(),t[10]=f,t[11]=b);let x=a.loading||!!a.loadError,C;t[12]!==b||t[13]!==x?(C={onClick:b,disabled:x},t[12]=b,t[13]=x,t[14]=C):C=t[14];let T;t[15]===r?T=t[16]:(T={href:r},t[15]=r,t[16]=T);let E;t[17]!==o||t[18]!==n||t[19]!==_||t[20]!==v||t[21]!==C||t[22]!==T?(E={subtitle:n,expanded:o,onToggleExpanded:_,onClose:v,share:C,openInBrowser:T},t[17]=o,t[18]=n,t[19]=_,t[20]=v,t[21]=C,t[22]=T,t[23]=E):E=t[23];let D;t[24]!==a||t[25]!==E?(D=(0,A.jsx)(d,{...a,header:E}),t[24]=a,t[25]=E,t[26]=D):D=t[26];let O;return t[27]!==D||t[28]!==g?(O=(0,A.jsx)(`div`,{className:g,children:D}),t[27]=D,t[28]=g,t[29]=O):O=t[29],O}function P(e){return!e}function F(){let{token:e}=a(),t=s(e=>e.language),n=t===`zh`?R:z,[r,c]=(0,C.useState)(null),[d,p]=(0,C.useState)(M),[h,y]=(0,C.useState)(!0),[x,S]=(0,C.useState)(0),[w,T]=(0,C.useState)(null),[E,D]=(0,C.useState)(null),[k,P]=(0,C.useState)(null),F=(0,C.useMemo)(()=>{if(!r||!e||r.kind!==`file`)return null;let t=u(r.fileName,r.mimeType);return{id:`share:${e}:${r.fileName}`,context:`share`,fileName:r.fileName,mimeType:t,size:r.fileSize,type:f(r.fileName,t),source:{kind:`share`,token:e}}},[r,e]);(0,C.useEffect)(()=>{if(!e){T(n.invalidLink),y(!1);return}let t=!1;return(async()=>{try{y(!0),T(null),c(null),p(M()),D(null),P(null);let r=await fetch(o(`/s/${encodeURIComponent(e)}/meta`));if(!r.ok){t||T(r.status===404?n.notFound:r.status===410?n.expired:n.unavailable);return}let a=await r.json();if(t)return;if(!a||![`file`,`directory`,`note`,`session`].includes(a.kind)||typeof a.valid!=`boolean`)throw Error(`Invalid share metadata`);if(c(a),!a.valid){T(n.expired);return}if(a.kind===`note`||a.kind===`session`){let r=await fetch(o(`/s/${encodeURIComponent(e)}/view`),{method:`POST`});if(!r.ok){T(r.status===404?n.notFound:r.status===410?n.expired:n.unavailable);return}let i=await r.json();if(i.payload?.kind!==a.kind)throw Error(`Invalid share content`);!t&&i.payload?.kind===`note`&&D(i.payload),!t&&i.payload?.kind===`session`&&P(i.payload);return}if(a.kind!==`file`)return;let s=u(a.fileName,a.mimeType),d=f(a.fileName,s),m=l(d),h=o(`/s/${encodeURIComponent(e)}?inline=1`);if(m===`text`){if(a.fileSize>5242880){T(n.tooLarge);return}let e=await fetch(h);if(!e.ok){T(e.status===404?n.notFound:e.status===410?n.expired:n.unavailable);return}let r=await e.text();t||p({...M(),textContent:r});return}if(m===`binary`){if(a.fileSize>33554432){T(n.tooLarge);return}let e=await fetch(h);if(!e.ok){T(e.status===404?n.notFound:e.status===410?n.expired:n.unavailable);return}let r=await e.arrayBuffer();if(t)return;if(d===`pptx`){let{processPptx:e}=await i(async()=>{let{processPptx:e}=await import(`./attachment-process-heavy-DGZZ-M85.js`);return{processPptx:e}},__vite__mapDeps([0,1,2,3])),{extractedText:t}=await e(r,a.fileName),n=t.length>_;p({textContent:null,binaryBuffer:r,extractedText:n?t.slice(0,_):t,extractedTextTruncated:n});return}p({...M(),binaryBuffer:r})}}catch{t||T(n.unavailable)}finally{t||y(!1)}})(),()=>{t=!0}},[e,x,n.expired,n.invalidLink,n.notFound,n.tooLarge,n.unavailable]);let B=e?o(`/s/${encodeURIComponent(e)}?dl=1`):`#`,V=e?o(`/s/${encodeURIComponent(e)}?inline=1`):`#`;return F&&r&&e&&!w?(0,A.jsx)(N,{language:t,descriptor:F,loading:h,loadError:w,textContent:d.textContent,binaryBuffer:d.binaryBuffer,extractedText:d.extractedText,extractedTextTruncated:d.extractedTextTruncated,subtitle:(0,A.jsxs)(`span`,{className:`truncate`,children:[L(r.fileSize),` · `,n.expiresAt,` `,new Date(r.expiresAt).toLocaleString(t===`zh`?`zh-CN`:`en-US`)]}),openInlineUrl:V,landingUrl:o(`/s/${encodeURIComponent(e)}`),actions:{onDownload:()=>{window.location.href=B},canDownload:!h&&!w}}):(0,A.jsx)(b,{children:(0,A.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col overflow-hidden bg-surface-base`,children:[(0,A.jsxs)(`header`,{className:`flex h-12 shrink-0 items-center gap-3 border-b border-edge px-4`,children:[(0,A.jsx)(`span`,{className:`text-lg`,"aria-hidden":!0,children:`#`}),(0,A.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[r?(0,A.jsx)(`div`,{className:`truncate text-sm font-semibold text-fg`,title:r.fileName,children:r.fileName}):h?(0,A.jsx)(g,{className:`h-4 w-48 max-w-full`}):(0,A.jsx)(`div`,{className:`truncate text-sm font-semibold text-fg`,children:n.error}),r?(0,A.jsxs)(`div`,{className:`truncate text-xs text-fg-muted`,children:[L(r.fileSize),` · `,n.expiresAt,` `,new Date(r.expiresAt).toLocaleString(t===`zh`?`zh-CN`:`en-US`)]}):null]})]}),(0,A.jsx)(`main`,{className:`flex min-h-0 w-full flex-1 flex-col overflow-y-auto overscroll-contain px-3 py-6 sm:px-5 xl:px-6`,children:h?(0,A.jsxs)(`div`,{className:`flex min-h-[70vh] flex-1 flex-col overflow-hidden rounded-lg bg-surface-panel p-4 shadow-surface`,"aria-busy":`true`,children:[(0,A.jsx)(g,{className:`h-5 w-56 max-w-full`}),(0,A.jsxs)(`div`,{className:`mt-5 grid gap-3`,children:[(0,A.jsx)(g,{className:`h-4 w-full`}),(0,A.jsx)(g,{className:`h-4 w-11/12`}),(0,A.jsx)(g,{className:`h-4 w-10/12`}),(0,A.jsx)(g,{className:`h-4 w-3/4`})]}),(0,A.jsx)(g,{className:`mt-6 min-h-0 flex-1 rounded-lg`})]}):w?(0,A.jsxs)(`div`,{role:`alert`,className:`rounded-lg bg-surface-panel p-6 shadow-surface text-sm text-fg`,children:[(0,A.jsx)(`p`,{className:`font-medium`,children:n.error}),(0,A.jsx)(`p`,{className:`mt-1 text-fg-muted`,children:w}),(0,A.jsx)(`p`,{className:`mt-2 text-fg-muted`,children:n.recovery}),(0,A.jsx)(v,{className:`mt-4`,onClick:()=>S(e=>e+1),children:n.retry}),r?.kind===`file`&&w===n.tooLarge?(0,A.jsx)(`a`,{className:`ml-4 text-accent hover:underline`,href:B,children:n.download}):null]}):r?.kind===`directory`?(0,A.jsx)(`div`,{className:`rounded-lg bg-surface-panel p-6 shadow-surface text-sm text-fg-muted`,children:n.directoryHint}):r?.kind===`note`&&E?(0,A.jsxs)(`article`,{className:`mx-auto w-full max-w-3xl rounded-xl border border-edge-subtle bg-surface-panel px-6 py-8 shadow-surface sm:px-10 sm:py-10`,children:[(0,A.jsx)(`h1`,{className:`text-3xl font-bold tracking-tight text-fg`,children:E.title}),(0,A.jsxs)(`div`,{className:`mt-2 text-xs text-fg-muted`,children:[n.sharedAt,` `,new Date(E.snapshotAt).toLocaleString(t===`zh`?`zh-CN`:`en-US`),` · `,n.expiresAt,` `,new Date(E.expiresAt).toLocaleString(t===`zh`?`zh-CN`:`en-US`)]}),E.description?(0,A.jsx)(`p`,{className:`mt-5 rounded-lg bg-surface-inset px-4 py-3 text-sm leading-6 text-fg-muted`,children:E.description}):null,(0,A.jsx)(m,{content:O(E.markdown,n.remoteImageBlocked),className:`mt-8`,renderChart:j}),(0,A.jsx)(`footer`,{className:`mt-10 border-t border-edge-subtle pt-4 text-center text-xs text-fg-subtle`,children:n.sharedVia})]}):r?.kind===`session`&&k?(0,A.jsxs)(`article`,{className:`mx-auto w-full max-w-4xl rounded-xl border border-edge-subtle bg-surface-panel px-4 py-7 shadow-surface sm:px-8 sm:py-9`,children:[(0,A.jsxs)(`header`,{className:`mx-auto max-w-3xl border-b border-edge-subtle pb-5`,children:[(0,A.jsx)(`h1`,{className:`text-2xl font-bold tracking-tight text-fg sm:text-3xl`,children:k.title}),(0,A.jsxs)(`div`,{className:`mt-2 text-xs text-fg-muted`,children:[n.sharedAt,` `,new Date(k.snapshotAt).toLocaleString(t===`zh`?`zh-CN`:`en-US`),` · `,n.expiresAt,` `,new Date(k.expiresAt).toLocaleString(t===`zh`?`zh-CN`:`en-US`)]}),k.description?(0,A.jsx)(`p`,{className:`mt-4 text-sm leading-6 text-fg-muted`,children:k.description}):null]}),(0,A.jsxs)(`div`,{className:`mx-auto mt-6 max-w-3xl space-y-5`,children:[k.messages.map(e=>(0,A.jsxs)(`section`,{className:e.role===`user`?`ml-auto max-w-[85%]`:`mr-auto max-w-full`,children:[(0,A.jsx)(`div`,{className:`mb-1 text-xs font-medium text-fg-subtle`,children:e.role===`user`?n.you:n.assistant}),(0,A.jsxs)(`div`,{className:e.role===`user`?`rounded-2xl bg-surface-inset px-4 py-3`:`px-1 py-1`,children:[(0,A.jsx)(m,{content:O(e.markdown,n.remoteImageBlocked),renderChart:j}),k.attachments.filter(t=>e.attachmentIds.includes(t.id)).map(e=>(0,A.jsx)(I,{attachment:e},e.id)),k.toolActivities.filter(t=>t.messageId===e.id).map(e=>(0,A.jsxs)(`div`,{className:`mt-2 inline-flex items-center gap-1.5 rounded-md border border-edge-subtle px-2 py-1 text-xs text-fg-muted`,children:[(0,A.jsx)(`span`,{children:e.toolName}),(0,A.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,A.jsx)(`span`,{children:e.status===`completed`?n.toolCompleted:n.toolFailed})]},e.id))]})]},e.id)),k.toolActivities.filter(e=>!e.messageId).map(e=>(0,A.jsxs)(`div`,{className:`text-center text-xs text-fg-muted`,children:[e.toolName,` · `,e.status===`completed`?n.toolCompleted:n.toolFailed]},e.id))]}),(0,A.jsx)(`footer`,{className:`mx-auto mt-10 max-w-3xl border-t border-edge-subtle pt-4 text-center text-xs text-fg-subtle`,children:n.sharedVia})]}):null})]})})}function I(e){let t=(0,w.c)(15),{attachment:n}=e;if(n.mimeType.startsWith(`image/`)){let e;return t[0]!==n.fileName||t[1]!==n.url?(e=(0,A.jsx)(`img`,{src:n.url,alt:n.fileName,loading:`lazy`,className:`mt-3 max-h-[28rem] max-w-full rounded-lg border border-edge-subtle object-contain`}),t[0]=n.fileName,t[1]=n.url,t[2]=e):e=t[2],e}if(n.mimeType.startsWith(`audio/`)){let e;return t[3]===n.url?e=t[4]:(e=(0,A.jsx)(`audio`,{src:n.url,controls:!0,preload:`none`,className:`mt-3 max-w-full`}),t[3]=n.url,t[4]=e),e}let r=n.url,i;t[5]===n.fileName?i=t[6]:(i=(0,A.jsx)(`span`,{className:`min-w-0 truncate`,children:n.fileName}),t[5]=n.fileName,t[6]=i);let a;t[7]===n.size?a=t[8]:(a=L(n.size),t[7]=n.size,t[8]=a);let o;t[9]===a?o=t[10]:(o=(0,A.jsx)(`span`,{className:`shrink-0 text-xs text-fg-subtle`,children:a}),t[9]=a,t[10]=o);let s;return t[11]!==n.url||t[12]!==i||t[13]!==o?(s=(0,A.jsxs)(`a`,{href:r,target:`_blank`,rel:`noreferrer`,className:`mt-3 flex items-center justify-between gap-3 rounded-lg border border-edge-subtle px-3 py-2 text-sm text-accent hover:bg-surface-hover`,children:[i,o]}),t[11]=n.url,t[12]=i,t[13]=o,t[14]=s):s=t[14],s}function L(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:e<1073741824?`${(e/1048576).toFixed(1)} MB`:`${(e/1073741824).toFixed(1)} GB`}var R={error:`暂时无法打开分享`,unavailable:`分享服务暂时不可用,请稍后重试。`,recovery:`如果链接已失效或仍无法打开,请向分享者索取新链接。`,retry:`重试`,download:`下载文件`,expired:`链接已失效`,notFound:`链接不存在`,invalidLink:`链接无效`,expiresAt:`有效期至`,directoryHint:`目录分享请使用主页面浏览。`,tooLarge:`文件过大,无法在线预览,请下载查看。`,sharedAt:`分享于`,sharedVia:`通过 xopc 分享`,you:`你`,assistant:`助手`,toolCompleted:`已完成`,toolFailed:`失败`,remoteImageBlocked:`远程图片(点击打开)`},z={error:`Unable to open this share`,unavailable:`The sharing service is temporarily unavailable. Please try again.`,recovery:`If the link has expired or still cannot be opened, ask the sender for a new link.`,retry:`Try again`,download:`Download file`,expired:`Link no longer valid`,notFound:`Link not found`,invalidLink:`Invalid link`,expiresAt:`Expires`,directoryHint:`Directory shares are browsed from the main page.`,tooLarge:`This file is too large to preview here. Please download it instead.`,sharedAt:`Shared`,sharedVia:`Shared via xopc`,you:`You`,assistant:`Assistant`,toolCompleted:`completed`,toolFailed:`failed`,remoteImageBlocked:`Remote image (open manually)`};export{F as SharePreviewPage};
|
|
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{f as a}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{i as o,n as s}from"./locale-store-DIBIYLnI.js";import{t as c}from"./messages-BDBGlBKh.js";import{g as l,h as u,n as d,p as f,t as p}from"./use-file-preview-expanded-Daf-LmiF.js";import{t as m}from"./markdown-view-C30KvTaE.js";import{t as h}from"./cn-0WouolD0.js";import{t as g}from"./skeleton-DzdOeGYz.js";import{t as _}from"./attachment-utils-core-BIOUBrpT.js";import{t as v}from"./button-Cc4hUNTt.js";import{t as y}from"./copy-to-clipboard-HOJ79TWv.js";import{r as b,t as x}from"./chat-chart-block-aZIklMNN.js";import{t as S}from"./composer-notifications-nT-U6jcc.js";var C=e(t(),1),w=n(),T=/^ {0,3}\[([^\]]+)\]:\s*<?(https?:\/\/[^\s>]+)>?(?:\s+.*)?$/gim,E=/!\[([^\]]*)\]\(\s*<?(https?:\/\/[^\s)>]+)>?(?:\s+(?:"[^"]*"|'[^']*'|\([^)]*\)))?\s*\)/gi,D=/!\[([^\]]*)\]\[([^\]]+)\]/g;function O(e,t){let n=new Map;for(let t of e.matchAll(T))n.set(k(t[1]??``),t[2]??``);return e.replace(E,(e,n,r)=>`[${n.trim()||t}](${r})`).replace(D,(e,r,i)=>{let a=n.get(k(i));return a?`[${r.trim()||t}](${a})`:e})}function k(e){return e.trim().replace(/\s+/g,` `).toLowerCase()}var A=r();function j(e){return(0,A.jsx)(x,{source:e.source,incomplete:!e.closed,streaming:!1,copy:!0})}function M(){return{textContent:null,binaryBuffer:null,extractedText:null,extractedTextTruncated:!1}}function N(e){let t=(0,w.c)(30),{subtitle:n,openInlineUrl:r,landingUrl:i,...a}=e,{expanded:o,setExpanded:s}=p(),l=c(a.language),u;t[0]===l?u=t[1]:(u=async()=>{let e=await y(window.location.href);S(e?`success`:`warning`,e?l.sharesSettings.copied:l.clipboard.copyFailed)},t[0]=l,t[1]=u);let f=u,m=o&&`fixed inset-0 z-[65] h-[100dvh] max-w-none`,g;t[2]===m?g=t[3]:(g=h(`mx-auto flex h-full min-h-0 w-full max-w-[var(--max-width-app-main)] flex-col bg-surface-panel`,m),t[2]=m,t[3]=g);let _;t[4]!==s||t[5]!==a.loadError||t[6]!==a.loading?(_=!a.loading&&!a.loadError?()=>s(P):void 0,t[4]=s,t[5]=a.loadError,t[6]=a.loading,t[7]=_):_=t[7];let v;t[8]===i?v=t[9]:(v=()=>window.location.assign(i),t[8]=i,t[9]=v);let b;t[10]===f?b=t[11]:(b=()=>void f(),t[10]=f,t[11]=b);let x=a.loading||!!a.loadError,C;t[12]!==b||t[13]!==x?(C={onClick:b,disabled:x},t[12]=b,t[13]=x,t[14]=C):C=t[14];let T;t[15]===r?T=t[16]:(T={href:r},t[15]=r,t[16]=T);let E;t[17]!==o||t[18]!==n||t[19]!==_||t[20]!==v||t[21]!==C||t[22]!==T?(E={subtitle:n,expanded:o,onToggleExpanded:_,onClose:v,share:C,openInBrowser:T},t[17]=o,t[18]=n,t[19]=_,t[20]=v,t[21]=C,t[22]=T,t[23]=E):E=t[23];let D;t[24]!==a||t[25]!==E?(D=(0,A.jsx)(d,{...a,header:E}),t[24]=a,t[25]=E,t[26]=D):D=t[26];let O;return t[27]!==D||t[28]!==g?(O=(0,A.jsx)(`div`,{className:g,children:D}),t[27]=D,t[28]=g,t[29]=O):O=t[29],O}function P(e){return!e}function F(){let{token:e}=a(),t=s(e=>e.language),n=t===`zh`?R:z,[r,c]=(0,C.useState)(null),[d,p]=(0,C.useState)(M),[h,y]=(0,C.useState)(!0),[x,S]=(0,C.useState)(0),[w,T]=(0,C.useState)(null),[E,D]=(0,C.useState)(null),[k,P]=(0,C.useState)(null),F=(0,C.useMemo)(()=>{if(!r||!e||r.kind!==`file`)return null;let t=u(r.fileName,r.mimeType);return{id:`share:${e}:${r.fileName}`,context:`share`,fileName:r.fileName,mimeType:t,size:r.fileSize,type:f(r.fileName,t),source:{kind:`share`,token:e}}},[r,e]);(0,C.useEffect)(()=>{if(!e){T(n.invalidLink),y(!1);return}let t=!1;return(async()=>{try{y(!0),T(null),c(null),p(M()),D(null),P(null);let r=await fetch(o(`/s/${encodeURIComponent(e)}/meta`));if(!r.ok){t||T(r.status===404?n.notFound:r.status===410?n.expired:n.unavailable);return}let a=await r.json();if(t)return;if(!a||![`file`,`directory`,`note`,`session`].includes(a.kind)||typeof a.valid!=`boolean`)throw Error(`Invalid share metadata`);if(c(a),!a.valid){T(n.expired);return}if(a.kind===`note`||a.kind===`session`){let r=await fetch(o(`/s/${encodeURIComponent(e)}/view`),{method:`POST`});if(!r.ok){T(r.status===404?n.notFound:r.status===410?n.expired:n.unavailable);return}let i=await r.json();if(i.payload?.kind!==a.kind)throw Error(`Invalid share content`);!t&&i.payload?.kind===`note`&&D(i.payload),!t&&i.payload?.kind===`session`&&P(i.payload);return}if(a.kind!==`file`)return;let s=u(a.fileName,a.mimeType),d=f(a.fileName,s),m=l(d),h=o(`/s/${encodeURIComponent(e)}?inline=1`);if(m===`text`){if(a.fileSize>5242880){T(n.tooLarge);return}let e=await fetch(h);if(!e.ok){T(e.status===404?n.notFound:e.status===410?n.expired:n.unavailable);return}let r=await e.text();t||p({...M(),textContent:r});return}if(m===`binary`){if(a.fileSize>33554432){T(n.tooLarge);return}let e=await fetch(h);if(!e.ok){T(e.status===404?n.notFound:e.status===410?n.expired:n.unavailable);return}let r=await e.arrayBuffer();if(t)return;if(d===`pptx`){let{processPptx:e}=await i(async()=>{let{processPptx:e}=await import(`./attachment-process-heavy-DGZZ-M85.js`);return{processPptx:e}},__vite__mapDeps([0,1,2,3])),{extractedText:t}=await e(r,a.fileName),n=t.length>_;p({textContent:null,binaryBuffer:r,extractedText:n?t.slice(0,_):t,extractedTextTruncated:n});return}p({...M(),binaryBuffer:r})}}catch{t||T(n.unavailable)}finally{t||y(!1)}})(),()=>{t=!0}},[e,x,n.expired,n.invalidLink,n.notFound,n.tooLarge,n.unavailable]);let B=e?o(`/s/${encodeURIComponent(e)}?dl=1`):`#`,V=e?o(`/s/${encodeURIComponent(e)}?inline=1`):`#`;return F&&r&&e&&!w?(0,A.jsx)(N,{language:t,descriptor:F,loading:h,loadError:w,textContent:d.textContent,binaryBuffer:d.binaryBuffer,extractedText:d.extractedText,extractedTextTruncated:d.extractedTextTruncated,subtitle:(0,A.jsxs)(`span`,{className:`truncate`,children:[L(r.fileSize),` · `,n.expiresAt,` `,new Date(r.expiresAt).toLocaleString(t===`zh`?`zh-CN`:`en-US`)]}),openInlineUrl:V,landingUrl:o(`/s/${encodeURIComponent(e)}`),actions:{onDownload:()=>{window.location.href=B},canDownload:!h&&!w}}):(0,A.jsx)(b,{children:(0,A.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col overflow-hidden bg-surface-base`,children:[(0,A.jsxs)(`header`,{className:`flex h-12 shrink-0 items-center gap-3 border-b border-edge px-4`,children:[(0,A.jsx)(`span`,{className:`text-lg`,"aria-hidden":!0,children:`#`}),(0,A.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[r?(0,A.jsx)(`div`,{className:`truncate text-sm font-semibold text-fg`,title:r.fileName,children:r.fileName}):h?(0,A.jsx)(g,{className:`h-4 w-48 max-w-full`}):(0,A.jsx)(`div`,{className:`truncate text-sm font-semibold text-fg`,children:n.error}),r?(0,A.jsxs)(`div`,{className:`truncate text-xs text-fg-muted`,children:[L(r.fileSize),` · `,n.expiresAt,` `,new Date(r.expiresAt).toLocaleString(t===`zh`?`zh-CN`:`en-US`)]}):null]})]}),(0,A.jsx)(`main`,{className:`flex min-h-0 w-full flex-1 flex-col overflow-y-auto overscroll-contain px-3 py-6 sm:px-5 xl:px-6`,children:h?(0,A.jsxs)(`div`,{className:`flex min-h-[70vh] flex-1 flex-col overflow-hidden rounded-lg bg-surface-panel p-4 shadow-surface`,"aria-busy":`true`,children:[(0,A.jsx)(g,{className:`h-5 w-56 max-w-full`}),(0,A.jsxs)(`div`,{className:`mt-5 grid gap-3`,children:[(0,A.jsx)(g,{className:`h-4 w-full`}),(0,A.jsx)(g,{className:`h-4 w-11/12`}),(0,A.jsx)(g,{className:`h-4 w-10/12`}),(0,A.jsx)(g,{className:`h-4 w-3/4`})]}),(0,A.jsx)(g,{className:`mt-6 min-h-0 flex-1 rounded-lg`})]}):w?(0,A.jsxs)(`div`,{role:`alert`,className:`rounded-lg bg-surface-panel p-6 shadow-surface text-sm text-fg`,children:[(0,A.jsx)(`p`,{className:`font-medium`,children:n.error}),(0,A.jsx)(`p`,{className:`mt-1 text-fg-muted`,children:w}),(0,A.jsx)(`p`,{className:`mt-2 text-fg-muted`,children:n.recovery}),(0,A.jsx)(v,{className:`mt-4`,onClick:()=>S(e=>e+1),children:n.retry}),r?.kind===`file`&&w===n.tooLarge?(0,A.jsx)(`a`,{className:`ml-4 text-accent hover:underline`,href:B,children:n.download}):null]}):r?.kind===`directory`?(0,A.jsx)(`div`,{className:`rounded-lg bg-surface-panel p-6 shadow-surface text-sm text-fg-muted`,children:n.directoryHint}):r?.kind===`note`&&E?(0,A.jsxs)(`article`,{className:`mx-auto w-full max-w-3xl rounded-xl border border-edge-subtle bg-surface-panel px-6 py-8 shadow-surface sm:px-10 sm:py-10`,children:[(0,A.jsx)(`h1`,{className:`text-3xl font-bold tracking-tight text-fg`,children:E.title}),(0,A.jsxs)(`div`,{className:`mt-2 text-xs text-fg-muted`,children:[n.sharedAt,` `,new Date(E.snapshotAt).toLocaleString(t===`zh`?`zh-CN`:`en-US`),` · `,n.expiresAt,` `,new Date(E.expiresAt).toLocaleString(t===`zh`?`zh-CN`:`en-US`)]}),E.description?(0,A.jsx)(`p`,{className:`mt-5 rounded-lg bg-surface-inset px-4 py-3 text-sm leading-6 text-fg-muted`,children:E.description}):null,(0,A.jsx)(m,{content:O(E.markdown,n.remoteImageBlocked),className:`mt-8`,renderChart:j}),(0,A.jsx)(`footer`,{className:`mt-10 border-t border-edge-subtle pt-4 text-center text-xs text-fg-subtle`,children:n.sharedVia})]}):r?.kind===`session`&&k?(0,A.jsxs)(`article`,{className:`mx-auto w-full max-w-4xl rounded-xl border border-edge-subtle bg-surface-panel px-4 py-7 shadow-surface sm:px-8 sm:py-9`,children:[(0,A.jsxs)(`header`,{className:`mx-auto max-w-3xl border-b border-edge-subtle pb-5`,children:[(0,A.jsx)(`h1`,{className:`text-2xl font-bold tracking-tight text-fg sm:text-3xl`,children:k.title}),(0,A.jsxs)(`div`,{className:`mt-2 text-xs text-fg-muted`,children:[n.sharedAt,` `,new Date(k.snapshotAt).toLocaleString(t===`zh`?`zh-CN`:`en-US`),` · `,n.expiresAt,` `,new Date(k.expiresAt).toLocaleString(t===`zh`?`zh-CN`:`en-US`)]}),k.description?(0,A.jsx)(`p`,{className:`mt-4 text-sm leading-6 text-fg-muted`,children:k.description}):null]}),(0,A.jsxs)(`div`,{className:`mx-auto mt-6 max-w-3xl space-y-5`,children:[k.messages.map(e=>(0,A.jsxs)(`section`,{className:e.role===`user`?`ml-auto max-w-[85%]`:`mr-auto max-w-full`,children:[(0,A.jsx)(`div`,{className:`mb-1 text-xs font-medium text-fg-subtle`,children:e.role===`user`?n.you:n.assistant}),(0,A.jsxs)(`div`,{className:e.role===`user`?`rounded-2xl bg-surface-inset px-4 py-3`:`px-1 py-1`,children:[(0,A.jsx)(m,{content:O(e.markdown,n.remoteImageBlocked),renderChart:j}),k.attachments.filter(t=>e.attachmentIds.includes(t.id)).map(e=>(0,A.jsx)(I,{attachment:e},e.id)),k.toolActivities.filter(t=>t.messageId===e.id).map(e=>(0,A.jsxs)(`div`,{className:`mt-2 inline-flex items-center gap-1.5 rounded-md border border-edge-subtle px-2 py-1 text-xs text-fg-muted`,children:[(0,A.jsx)(`span`,{children:e.toolName}),(0,A.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,A.jsx)(`span`,{children:e.status===`completed`?n.toolCompleted:n.toolFailed})]},e.id))]})]},e.id)),k.toolActivities.filter(e=>!e.messageId).map(e=>(0,A.jsxs)(`div`,{className:`text-center text-xs text-fg-muted`,children:[e.toolName,` · `,e.status===`completed`?n.toolCompleted:n.toolFailed]},e.id))]}),(0,A.jsx)(`footer`,{className:`mx-auto mt-10 max-w-3xl border-t border-edge-subtle pt-4 text-center text-xs text-fg-subtle`,children:n.sharedVia})]}):null})]})})}function I(e){let t=(0,w.c)(15),{attachment:n}=e;if(n.mimeType.startsWith(`image/`)){let e;return t[0]!==n.fileName||t[1]!==n.url?(e=(0,A.jsx)(`img`,{src:n.url,alt:n.fileName,loading:`lazy`,className:`mt-3 max-h-[28rem] max-w-full rounded-lg border border-edge-subtle object-contain`}),t[0]=n.fileName,t[1]=n.url,t[2]=e):e=t[2],e}if(n.mimeType.startsWith(`audio/`)){let e;return t[3]===n.url?e=t[4]:(e=(0,A.jsx)(`audio`,{src:n.url,controls:!0,preload:`none`,className:`mt-3 max-w-full`}),t[3]=n.url,t[4]=e),e}let r=n.url,i;t[5]===n.fileName?i=t[6]:(i=(0,A.jsx)(`span`,{className:`min-w-0 truncate`,children:n.fileName}),t[5]=n.fileName,t[6]=i);let a;t[7]===n.size?a=t[8]:(a=L(n.size),t[7]=n.size,t[8]=a);let o;t[9]===a?o=t[10]:(o=(0,A.jsx)(`span`,{className:`shrink-0 text-xs text-fg-subtle`,children:a}),t[9]=a,t[10]=o);let s;return t[11]!==n.url||t[12]!==i||t[13]!==o?(s=(0,A.jsxs)(`a`,{href:r,target:`_blank`,rel:`noreferrer`,className:`mt-3 flex items-center justify-between gap-3 rounded-lg border border-edge-subtle px-3 py-2 text-sm text-accent hover:bg-surface-hover`,children:[i,o]}),t[11]=n.url,t[12]=i,t[13]=o,t[14]=s):s=t[14],s}function L(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:e<1073741824?`${(e/1048576).toFixed(1)} MB`:`${(e/1073741824).toFixed(1)} GB`}var R={error:`暂时无法打开分享`,unavailable:`分享服务暂时不可用,请稍后重试。`,recovery:`如果链接已失效或仍无法打开,请向分享者索取新链接。`,retry:`重试`,download:`下载文件`,expired:`链接已失效`,notFound:`链接不存在`,invalidLink:`链接无效`,expiresAt:`有效期至`,directoryHint:`目录分享请使用主页面浏览。`,tooLarge:`文件过大,无法在线预览,请下载查看。`,sharedAt:`分享于`,sharedVia:`通过 xopc 分享`,you:`你`,assistant:`助手`,toolCompleted:`已完成`,toolFailed:`失败`,remoteImageBlocked:`远程图片(点击打开)`},z={error:`Unable to open this share`,unavailable:`The sharing service is temporarily unavailable. Please try again.`,recovery:`If the link has expired or still cannot be opened, ask the sender for a new link.`,retry:`Try again`,download:`Download file`,expired:`Link no longer valid`,notFound:`Link not found`,invalidLink:`Invalid link`,expiresAt:`Expires`,directoryHint:`Directory shares are browsed from the main page.`,tooLarge:`This file is too large to preview here. Please download it instead.`,sharedAt:`Shared`,sharedVia:`Shared via xopc`,you:`You`,assistant:`Assistant`,toolCompleted:`completed`,toolFailed:`failed`,remoteImageBlocked:`Remote image (open manually)`};export{F as SharePreviewPage};
|
|
@@ -1,3 +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-DIBIYLnI.js";import{t as f}from"./messages-BDBGlBKh.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,G as x,U as S,it as C,t as w}from"./chat-page-BMZwIVXH.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{B as R,H as z,I as ee,P as B}from"./markdown-view-C30KvTaE.js";import{t as te}from"./message-square-fVE7Ghj1.js";import{t as ne}from"./pause-DuPxgSxk.js";import{t as re}from"./play-kxZvpBg8.js";import{t as ie}from"./x-B_N4OPjy.js";import{t as V}from"./cn-0WouolD0.js";import{t as ae}from"./skeleton-DzdOeGYz.js";import{c as oe}from"./api-DDWYNF7I.js";import{ht as se,mt as ce}from"./session-manager-D5g6LOU-.js";import{i as le}from"./vendor-swr-CdRzEUwF.js";import{C as ue,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 H,u as be,x as xe}from"./workspace-preview-store-DNLnuHlf.js";import{t as Se}from"./chat-agents-api-BksS0CNy.js";import{t as U}from"./button-Cc4hUNTt.js";import{n as Ce}from"./right-workspace-store-DHHyicqQ.js";import{c as we}from"./composer-payload-handoff-xEFHDnLo.js";import{t as Te}from"./page-header-store-C2ydtnXa.js";import{t as Ee}from"./agent-avatar-display-BO1bqKlR.js";import{t as De}from"./automation-api-24NjW7qG.js";import{n as Oe}from"./agent-display-names-Bje7vfSn.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{d as Le,f as W,l as Re,o as ze,u as Be}from"./automation-task-card-Bgq5Plux.js";import{t as Ve}from"./date-picker-UEh3JM7r.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-Dci0LfAU.js";import{n as Ge,r as G,t as Ke}from"./task-result-evidence-C-zIBpzi.js";import{t as qe}from"./page-context-capture-button-BaSooYGv.js";import{t as Je}from"./dependency-picker-XjPB8FJS.js";var K=e(t(),1),q=n(),J=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,q.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=V(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,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`span`,{className:`min-w-0 flex-1`,children:l}),(0,J.jsx)(A,{"aria-hidden":!0,className:V(`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,J.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,J.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,q.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,K.useRef)(null),u=(0,K.useRef)(null),d=(0,K.useRef)(null),f=(0,K.useRef)(void 0),p=(0,K.useRef)(o),m=(0,K.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,K.useEffect)(h,g);let _=(0,K.useRef)(void 0),v=(0,K.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,K.useState)(c??`results`),T;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(T=[],t[8]=T):T=t[8];let[E,D]=(0,K.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,K.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,K.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,K.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,K.useEffect)(P,F);let I=n===`zh`?`任务详情分区`:`Task detail sections`,L;t[22]!==C||t[23]!==E?(L=E.map(e=>(0,J.jsx)(`button`,{type:`button`,"aria-current":C===e.id?`location`:void 0,"aria-pressed":C===e.id,"data-sliding-active":C===e.id,className:V(`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,J.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,q.c)(64),{criterion:n,index:r,language:i,closed:a,pending:o,onReview:s,projectId:c,conversationId:l}=e,u=i===`zh`,d=(0,K.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]:(_=V(`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,J.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=V(`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,J.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,J.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,J.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,J.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,J.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,J.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,J.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,J.jsx)(G,{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,J.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,J.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,J.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,J.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,J.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,q.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,J.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,J.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,J.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,J.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,J.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,J.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,J.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,J.jsxs)(J.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,q.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(`
|
|
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-DIBIYLnI.js";import{t as f}from"./messages-BDBGlBKh.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,G as x,U as S,it as C,t as w}from"./chat-page-BtMkdtxJ.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{B as R,H as z,I as ee,P as B}from"./markdown-view-C30KvTaE.js";import{t as te}from"./message-square-fVE7Ghj1.js";import{t as ne}from"./pause-DuPxgSxk.js";import{t as re}from"./play-kxZvpBg8.js";import{t as ie}from"./x-B_N4OPjy.js";import{t as V}from"./cn-0WouolD0.js";import{t as ae}from"./skeleton-DzdOeGYz.js";import{c as oe}from"./api-DDWYNF7I.js";import{ht as se,mt as ce}from"./session-manager-D5g6LOU-.js";import{i as le}from"./vendor-swr-CdRzEUwF.js";import{C as ue,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 H,u as be,x as xe}from"./workspace-preview-store-DNLnuHlf.js";import{t as Se}from"./chat-agents-api-BksS0CNy.js";import{t as U}from"./button-Cc4hUNTt.js";import{n as Ce}from"./right-workspace-store-DHHyicqQ.js";import{c as we}from"./composer-payload-handoff-xEFHDnLo.js";import{t as Te}from"./page-header-store-C2ydtnXa.js";import{t as Ee}from"./agent-avatar-display-BO1bqKlR.js";import{t as De}from"./automation-api-24NjW7qG.js";import{n as Oe}from"./agent-display-names-Bje7vfSn.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{d as Le,f as W,l as Re,o as ze,u as Be}from"./automation-task-card-Bgq5Plux.js";import{t as Ve}from"./date-picker-UEh3JM7r.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-Dci0LfAU.js";import{n as Ge,r as G,t as Ke}from"./task-result-evidence-C-zIBpzi.js";import{t as qe}from"./page-context-capture-button-BaSooYGv.js";import{t as Je}from"./dependency-picker-XjPB8FJS.js";var K=e(t(),1),q=n(),J=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,q.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=V(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,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`span`,{className:`min-w-0 flex-1`,children:l}),(0,J.jsx)(A,{"aria-hidden":!0,className:V(`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,J.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,J.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,q.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,K.useRef)(null),u=(0,K.useRef)(null),d=(0,K.useRef)(null),f=(0,K.useRef)(void 0),p=(0,K.useRef)(o),m=(0,K.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,K.useEffect)(h,g);let _=(0,K.useRef)(void 0),v=(0,K.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,K.useState)(c??`results`),T;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(T=[],t[8]=T):T=t[8];let[E,D]=(0,K.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,K.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,K.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,K.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,K.useEffect)(P,F);let I=n===`zh`?`任务详情分区`:`Task detail sections`,L;t[22]!==C||t[23]!==E?(L=E.map(e=>(0,J.jsx)(`button`,{type:`button`,"aria-current":C===e.id?`location`:void 0,"aria-pressed":C===e.id,"data-sliding-active":C===e.id,className:V(`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,J.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,q.c)(64),{criterion:n,index:r,language:i,closed:a,pending:o,onReview:s,projectId:c,conversationId:l}=e,u=i===`zh`,d=(0,K.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]:(_=V(`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,J.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=V(`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,J.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,J.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,J.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,J.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,J.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,J.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,J.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,J.jsx)(G,{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,J.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,J.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,J.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,J.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,J.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,q.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,J.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,J.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,J.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,J.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,J.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,J.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,J.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,J.jsxs)(J.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,q.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
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,J.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,J.jsx)(Ke,{evidence:l,language:r,projectId:n.task.projectId,conversationId:n.conversation.activeConversationId??void 0,compact:!0}):(0,J.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,J.jsxs)(`section`,{"aria-label":i?`交付结果`:`Deliverables`,className:`rounded-xl border border-edge-subtle bg-surface-panel p-4`,children:[p,d?(0,J.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,J.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,J.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,J.jsxs)(`div`,{className:`mt-4 space-y-2 border-t border-edge-subtle pt-3`,"aria-label":i?`执行待办`:`Run follow-up`,children:[(0,J.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,J.jsx)(`ul`,{className:`space-y-2 text-sm leading-6 text-fg`,children:[...new Set(e.remainingWork)].map(st)}):null,e.nextAction?(0,J.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-sm leading-6 text-fg [overflow-wrap:anywhere]`,children:e.nextAction}):null,e.failure?(0,J.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,J.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:B(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,J.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,q.c)(13),{detail:n,language:r}=e,i=r===`zh`,a=we(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,K.useState)(`idle`),f;t[4]===s?f=t[5]:(f=async function(e){if(s){d(`pending`);try{await ue(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,J.jsx)(x,{detail:n,language:r}),t[6]=n,t[7]=r,t[8]=m):m=t[8];let h=s?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,J.jsx)(`h3`,{className:`text-sm font-medium text-fg`,children:a.latestResult}),(0,J.jsxs)(`span`,{className:`text-xs text-fg-muted`,children:[a.receiptStatuses[s.status],` · `,a.verificationStatuses[s.verification.status]]})]}),(0,J.jsx)(G,{content:s.summary,contentKey:`${n.task.id}:result:${s.runId}`,language:r}),s.evidence.length>0?(0,J.jsxs)(`details`,{children:[(0,J.jsxs)(`summary`,{className:`cursor-pointer py-2 text-xs text-fg-muted`,children:[i?`验证依据与执行产物`:`Evidence and artifacts`,` · `,s.evidence.length]}),(0,J.jsx)(Ke,{evidence:s.evidence,projectId:n.task.projectId,conversationId:n.conversation.activeConversationId??void 0,language:r})]}):null,(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-t border-edge-subtle pt-3`,children:[(0,J.jsx)(U,{variant:`ghost`,className:`min-h-9 px-2 text-xs`,disabled:u===`pending`,onClick:()=>void p(`helpful`),children:a.doneWell}),(0,J.jsx)(U,{variant:`ghost`,className:`min-h-9 px-2 text-xs`,disabled:u===`pending`,onClick:()=>void p(`not_helpful`),children:a.needsFix}),u===`saved`?(0,J.jsx)(`span`,{role:`status`,className:`text-xs text-fg-muted`,children:i?`反馈已记录`:`Feedback saved`}):null,u===`failed`?(0,J.jsx)(`span`,{role:`alert`,className:`text-xs text-danger`,children:a.actionFailed}):null]})]}):null,g=l.length>0?(0,J.jsxs)(`details`,{className:`border-t border-edge-subtle pt-3`,children:[(0,J.jsx)(`summary`,{className:`cursor-pointer py-2 text-xs text-fg-muted`,children:a.executionHistory.replace(`{{count}}`,String(l.length))}),(0,J.jsx)(`div`,{className:`mt-3 space-y-4`,children:l.map(e=>(0,J.jsxs)(`article`,{className:`space-y-2 rounded-lg bg-surface-hover p-3`,children:[(0,J.jsx)(`p`,{className:`text-xs text-fg-muted`,children:a.receiptStatuses[e.status]}),(0,J.jsx)(G,{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,J.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,q.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,J.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,J.jsxs)(`li`,{className:`text-sm text-fg`,children:[(0,J.jsxs)(`div`,{children:[o[e.fromPhase],e.fromResolution?` · ${u[e.fromResolution]}`:``,` → `,o[e.toPhase],e.toResolution?` · ${u[e.toResolution]}`:``]}),(0,J.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,J.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,J.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,J.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,J.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,K.useState)(null),l=(0,K.useRef)(!1),[u,d]=(0,K.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 De.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,J.jsxs)(`section`,{"aria-label":i?`执行时间`:`Execution schedule`,className:`rounded-xl border border-edge bg-surface-panel p-4`,children:[(0,J.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:i?`执行时间`:`Execution schedule`}),(0,J.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,J.jsxs)(`article`,{className:`space-y-2 text-sm text-fg`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,J.jsx)(`span`,{className:`break-words font-medium`,children:e.name}),(0,J.jsx)(`span`,{className:`text-xs text-fg-muted`,children:c?i?`已执行`:`Completed`:e.enabled?i?`已启用`:`Enabled`:i?`已取消定时执行`:`Scheduling disabled`})]}),(0,J.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,J.jsxs)(`p`,{className:`text-xs text-fg-muted`,children:[i?`执行时区:`:`Schedule timezone: `,r.tz||(i?`服务所在电脑时区`:`Server timezone`)]}):null,(0,J.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,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[l?(0,J.jsx)(U,{variant:`secondary`,disabled:s!==null,onClick:()=>n(e),children:i?`修改时间`:`Edit schedule`}):null,e.enabled&&u?(0,J.jsx)(U,{variant:`ghost`,disabled:s!==null,onClick:()=>void m(e),children:s===e.id?i?`正在取消…`:`Cancelling…`:i?`取消定时执行`:`Cancel schedule`}):null,(0,J.jsx)(U,{asChild:!0,variant:`ghost`,children:(0,J.jsx)(o,{to:`/automations?automation=${encodeURIComponent(e.id)}`,children:i?`查看自动化`:`View automation`})})]})]},e.id)})}),u?(0,J.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,K.useState)(()=>c?Le(c):{...W,name:t,projectId:n??``,actionMode:`task_command`,taskId:e,agentId:r??``,triggerMode:`once`,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`}),[x,S]=(0,K.useState)(null),[C,w]=(0,K.useState)(!1),T=(0,K.useRef)(!1),[E,D]=(0,K.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?Re(c,d).trigger:Be(d).trigger,{automation:t}=c?await De.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 De.create({...Be(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,J.jsx)(y,{open:!0,onOpenChange:e=>{!e&&!T.current&&a()},children:(0,J.jsxs)(g,{children:[(0,J.jsx)(p,{className:`fixed inset-0 z-[110] bg-black/45`}),(0,J.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,J.jsxs)(`header`,{className:`flex shrink-0 items-center justify-between gap-3 border-b border-edge-subtle px-5 py-4`,children:[(0,J.jsx)(v,{className:`text-base font-semibold text-fg`,children:c?l?`修改执行时间`:`Edit execution schedule`:l?`设置执行时间`:`Set execution time`}),(0,J.jsx)(h,{asChild:!0,children:(0,J.jsx)(U,{variant:`ghost`,className:`size-9 p-0`,disabled:C,"aria-label":l?`关闭`:`Close`,children:(0,J.jsx)(ie,{className:`size-4`})})})]}),(0,J.jsx)(m,{className:`sr-only`,children:l?`为当前任务创建定时或周期自动化。`:`Create a scheduled or recurring automation for this task.`}),x?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto p-5`,children:[(0,J.jsx)(`p`,{role:`status`,className:`text-sm font-medium text-fg`,children:c?l?`执行时间已更新`:`Schedule updated`:l?`执行时间已设置`:`Schedule created`}),(0,J.jsx)(`p`,{className:`break-words text-sm text-fg-muted`,children:x.name}),(0,J.jsx)(U,{asChild:!0,variant:`primary`,children:(0,J.jsx)(o,{to:`/automations?automation=${encodeURIComponent(x.id)}`,children:l?`查看自动化`:`View automation`})})]}),(0,J.jsx)(`footer`,{className:`shrink-0 border-t border-edge-subtle p-4`,children:(0,J.jsx)(U,{onClick:a,children:l?`完成`:`Done`})})]}):(0,J.jsxs)(`form`,{onSubmit:e=>void k(e),className:`flex min-h-0 flex-1 flex-col`,children:[(0,J.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto p-5`,children:[(0,J.jsxs)(`p`,{className:`break-words text-sm text-fg-muted`,children:[l?`执行任务:`:`Task: `,t]}),(0,J.jsxs)(`fieldset`,{disabled:C,className:`space-y-4`,children:[(0,J.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[u.form.name,(0,J.jsx)(`input`,{required:!0,readOnly:!!c?.management,className:gt,value:d.name,onChange:e=>O({name:e.target.value})})]}),(0,J.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[u.form.trigger,(0,J.jsxs)(j,{value:d.triggerMode,onChange:e=>O({triggerMode:e.target.value}),children:[c?.trigger.kind===`schedule`&&c.trigger.schedule.kind===`interval`?(0,J.jsx)(M,{value:`interval`,children:l?`固定间隔`:`Fixed interval`}):null,c?.trigger.kind===`schedule`&&c.trigger.schedule.kind===`cron`?(0,J.jsx)(M,{value:`cron`,children:l?`自定义规则`:`Custom schedule`}):null,(0,J.jsx)(M,{value:`once`,children:u.trigger.once}),(0,J.jsx)(M,{value:`daily`,children:u.trigger.daily}),(0,J.jsx)(M,{value:`weekly`,children:u.trigger.weekly})]})]}),d.triggerMode===`once`?(0,J.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,J.jsxs)(`div`,{className:`grid gap-2 text-sm text-fg`,children:[(0,J.jsx)(`span`,{children:u.form.time}),(0,J.jsx)(He,{disabled:C,value:d.time,onChange:e=>O({time:e}),ariaLabel:u.form.time})]}):null,d.triggerMode===`weekly`?(0,J.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[u.form.day,(0,J.jsx)(j,{value:d.weekday,onChange:e=>O({weekday:e.target.value}),children:[`sunday`,`monday`,`tuesday`,`wednesday`,`thursday`,`friday`,`saturday`].map((e,t)=>(0,J.jsx)(M,{value:String(t),children:u.weekdays[e]},e))})]}):null,d.triggerMode===`cron`?(0,J.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[l?`定时规则`:`Cron expression`,(0,J.jsx)(`input`,{required:!0,className:gt,value:d.cronExpr,onChange:e=>O({cronExpr:e.target.value})})]}):null,d.triggerMode===`interval`?(0,J.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,J.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[l?`执行间隔`:`Interval`,(0,J.jsx)(`input`,{required:!0,type:`number`,min:`1`,className:gt,value:d.intervalValue,onChange:e=>O({intervalValue:e.target.value})})]}),(0,J.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[l?`单位`:`Unit`,(0,J.jsxs)(j,{value:d.intervalUnit,onChange:e=>O({intervalUnit:e.target.value}),children:[(0,J.jsx)(M,{value:`minute`,children:l?`分钟`:`Minutes`}),(0,J.jsx)(M,{value:`hour`,children:l?`小时`:`Hours`}),(0,J.jsx)(M,{value:`day`,children:l?`天`:`Days`}),(0,J.jsx)(M,{value:`week`,children:l?`周`:`Weeks`})]})]})]}):null,(0,J.jsx)(ze,{form:d,onChange:O,language:i}),(0,J.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[u.draft.notifications,(0,J.jsxs)(j,{disabled:!!c?.management,value:d.notificationPolicy,onChange:e=>O({notificationPolicy:e.target.value}),children:[(0,J.jsx)(M,{value:`attention`,children:u.draft.notifyAttention}),(0,J.jsx)(M,{value:`all`,children:u.draft.notifyAll}),(0,J.jsx)(M,{value:`none`,children:u.draft.notifyNone})]})]})]}),!c&&!r?(0,J.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:l?`请先为任务指定执行 Agent。`:`Assign an executor agent to the task first.`}):null,E?(0,J.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:E}):null]}),(0,J.jsxs)(`footer`,{className:`flex shrink-0 justify-end gap-2 border-t border-edge-subtle p-4`,children:[(0,J.jsx)(U,{type:`button`,variant:`ghost`,disabled:C,onClick:a,children:l?`取消`:`Cancel`}),(0,J.jsx)(U,{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,q.c)(44),{detail:n,executorName:r,language:i,onUpdated:a}=e,s=i===`zh`,c;t[0]===n.waits?c=t[1]:(c=n.waits.find(St),t[0]=n.waits,t[1]=c);let l=c,u,d,f,p,m,h,g;if(t[2]!==n||t[3]!==r||t[4]!==i||t[5]!==a||t[6]!==l||t[7]!==s){u=n.allowedCommands.includes(`resolve_wait`)&&!l?n.waits.filter(xt):[];let e=u.length>0||n.attention.some(bt),c;t[15]===n?c=t[16]:(c=ve(n),t[15]=n,t[16]=c);let _=c,v;t[17]===n.runs?v=t[18]:(v=n.runs.find(yt),t[17]=n.runs,t[18]=v);let y=v,b=s?`等待开始执行。`:`Waiting to start.`,x=r?s?`${r} 正在处理任务。`:`${r} is working on the task.`:s?`任务处理中。`:`The task is in progress.`,S=s?`任务正在等待继续。`:`The task is waiting to resume.`,C=s?`正在检查执行结果。`:`Checking the result.`,w;t[19]!==S||t[20]!==C||t[21]!==b||t[22]!==x?(w={queued:b,running:x,waiting:S,verifying:C},t[19]=S,t[20]=C,t[21]=b,t[22]=x,t[23]=w):w=t[23];let T=w;f=l?.reason??n.waits[0]?.reason??(n.task.phase===`closed`?_?.summary??(s?`任务已关闭,可查看交付物与执行结果。`:`The task is closed. Review its deliverables and results.`):n.task.phase===`review`?s?`请检查交付物并勾选通过的验收项。`:`Review the deliverables and check the criteria that pass.`:(y&&T[y.status])??_?.summary??(s?`任务尚未开始,可开始执行或设置执行时间。`:`Start the task or set an execution time.`)),d=n.attention.length>0?(0,J.jsx)(`ul`,{className:`mt-3 space-y-3`,children:n.attention.map((e,t)=>{let r=u.some(t=>e.kind===`input_required`&&t.kind===`user_input`||e.kind===`approval_required`&&t.kind===`approval`);return(0,J.jsxs)(`li`,{className:`text-sm leading-6 text-fg-muted`,children:[(0,J.jsx)(G,{content:e.summary,contentKey:`${n.task.id}:attention:${e.kind}:${t}`,language:i,markdown:!1,previewHeight:72}),!r&&(e.kind===`input_required`||e.kind===`approval_required`)?(0,J.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:B(n.task.id),children:s?e.kind===`approval_required`?`查看并决定`:`补充信息`:e.kind===`approval_required`?`Review decision`:`Provide information`}):null]},`${e.kind}-${t}`)})}):null,p=s?`当前需要处理`:`Current action`,m=`rounded-xl border border-edge bg-surface-panel p-4`;let E=e?s?`需要你处理`:`Your action needed`:s?`当前进展`:`Current progress`,D=u.length>1?` · ${u.length}`:``;t[24]!==E||t[25]!==D?(h=(0,J.jsxs)(`h2`,{className:`text-sm font-semibold text-fg`,children:[E,D]}),t[24]=E,t[25]=D,t[26]=h):h=t[26];let O;t[27]!==n||t[28]!==a||t[29]!==s?(O=e=>(0,J.jsx)(Ge,{wait:e,detail:n,zh:s,onUpdated:a},e.id),t[27]=n,t[28]=a,t[29]=s,t[30]=O):O=t[30],g=u.map(O),t[2]=n,t[3]=r,t[4]=i,t[5]=a,t[6]=l,t[7]=s,t[8]=u,t[9]=d,t[10]=f,t[11]=p,t[12]=m,t[13]=h,t[14]=g}else u=t[8],d=t[9],f=t[10],p=t[11],m=t[12],h=t[13],g=t[14];let _;t[31]!==u.length||t[32]!==d||t[33]!==n.task||t[34]!==i||t[35]!==f||t[36]!==s?(_=u.length>0?d?(0,J.jsxs)(`details`,{className:`mt-3`,children:[(0,J.jsx)(`summary`,{className:`cursor-pointer text-xs text-fg-muted`,children:s?`等待详情`:`Waiting details`}),d]}):null:d??(0,J.jsx)(G,{content:f,contentKey:`${n.task.id}:current-progress`,language:i,previewHeight:72,className:`mt-2 text-sm leading-6 text-fg-muted`,children:(0,J.jsx)(S,{content:se(f),compact:!0})}),t[31]=u.length,t[32]=d,t[33]=n.task,t[34]=i,t[35]=f,t[36]=s,t[37]=_):_=t[37];let v;return t[38]!==p||t[39]!==m||t[40]!==h||t[41]!==g||t[42]!==_?(v=(0,J.jsxs)(`section`,{"aria-label":p,className:m,children:[h,g,_]}),t[38]=p,t[39]=m,t[40]=h,t[41]=g,t[42]=_,t[43]=v):v=t[43],v}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,q.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=V(`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,J.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=V(`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,J.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,J.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,q.c)(17),{children:n,contentKey:r,language:i,className:o}=e,s=(0,K.useId)(),c=K.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,J.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,J.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,J.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,K.useState)(``),[a,o]=(0,K.useState)(null),[s,f]=(0,K.useState)(!1),[p,m]=(0,K.useState)(!1),[h,g]=(0,K.useState)([]),[_,v]=(0,K.useState)(null),y=c(`/api/tasks/${encodeURIComponent(e)}/collaboration`),{data:b,error:x,mutate:S}=le([`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,K.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,J.jsxs)(`section`,{className:`rounded-xl border border-edge bg-surface-panel p-4`,children:[(0,J.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:n===`zh`?`任务留言`:`Task updates`}),(0,J.jsxs)(`div`,{className:`mt-3 max-h-64 space-y-2 overflow-y-auto`,children:[!b&&!x?(0,J.jsxs)(`div`,{"aria-busy":`true`,className:`space-y-2`,children:[(0,J.jsx)(ae,{className:`h-14 w-full`}),(0,J.jsx)(ae,{className:`h-14 w-4/5`})]}):null,x?(0,J.jsx)(`p`,{role:`status`,className:`text-xs text-fg-muted`,children:n===`zh`?`暂时无法读取留言`:`Updates unavailable`}):null,C[0]&&C[0].sequence>1?(0,J.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,J.jsxs)(`div`,{className:`rounded-lg bg-surface-base px-3 py-2 text-sm`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-fg-subtle`,children:[(0,J.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,J.jsxs)(`span`,{children:[`· `,t.kind]}),t.deliveryStatus?(0,J.jsxs)(`span`,{children:[`· `,t.deliveryStatus]}):null]}),(0,J.jsx)(`div`,{className:`mt-1 min-w-0 text-fg`,"data-task-collaboration-body":!0,children:(0,J.jsx)(G,{content:t.body,contentKey:`${e}:update:${t.id}`,language:n,breaks:!0,previewHeight:120})}),t.kind===`question`&&t.authorKind===`worker_agent`?(0,J.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,J.jsx)(`p`,{className:`text-xs text-fg-muted`,children:n===`zh`?`暂无进展留言`:`No updates yet`}):null]}),a?(0,J.jsxs)(`p`,{className:`mt-3 text-xs text-accent`,children:[n===`zh`?`正在回复执行 Agent 的问题`:`Replying to the worker`,(0,J.jsx)(`button`,{type:`button`,className:`ml-2 underline`,onClick:()=>o(null),children:n===`zh`?`取消`:`Cancel`})]}):null,(0,J.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,J.jsx)(`p`,{role:`alert`,className:`mt-1 text-xs text-danger`,children:_}):null,(0,J.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,q.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,J.jsxs)(`div`,{className:`space-y-4`,"aria-busy":!0,children:[(0,J.jsx)(ae,{className:`h-32 rounded-2xl`}),(0,J.jsx)(ae,{className:`h-52 rounded-2xl`}),(0,J.jsx)(ae,{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,K.memo)(function(e){let t=(0,q.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,J.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,J.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,J.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,J.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,K.memo)(function(e){let t=(0,q.c)(14),{value:n,disabled:r,label:i,labels:a,onChange:o}=e,s;t[0]===i?s=t[1]:(s=(0,J.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,J.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,J.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,J.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,K.memo)(function(e){let t=(0,q.c)(10),{value:n,disabled:r,label:i,onChange:a}=e,o;t[0]===i?o=t[1]:(o=(0,J.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,J.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,J.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,K.memo)(function(e){let t=(0,q.c)(36),{value:n,disabled:r,label:i,unassignedLabel:a,agents:o,language:s,onChange:c}=e,l,u,d,p,m,h,g,_,v,y;if(t[0]!==o||t[1]!==r||t[2]!==i||t[3]!==s||t[4]!==c||t[5]!==a||t[6]!==n){let{agentsSettings:e}=f(s);v=`grid gap-1.5 text-xs text-fg-muted`,t[17]===i?y=t[18]:(y=(0,J.jsx)(`span`,{children:i}),t[17]=i,t[18]=y),l=j,u=`border-0 bg-surface-hover shadow-none focus-visible:ring-2 focus-visible:ring-accent/30`,d=`border-0`,p=n,m=r,t[19]===c?h=t[20]:(h=e=>c(e.target.value),t[19]=c,t[20]=h),t[21]===a?g=t[22]:(g=(0,J.jsx)(M,{value:``,disabled:!0,children:a}),t[21]=a,t[22]=g),_=o.map(t=>(0,J.jsx)(M,{value:t.id,children:Oe(t,e)},t.id)),t[0]=o,t[1]=r,t[2]=i,t[3]=s,t[4]=c,t[5]=a,t[6]=n,t[7]=l,t[8]=u,t[9]=d,t[10]=p,t[11]=m,t[12]=h,t[13]=g,t[14]=_,t[15]=v,t[16]=y}else l=t[7],u=t[8],d=t[9],p=t[10],m=t[11],h=t[12],g=t[13],_=t[14],v=t[15],y=t[16];let b;t[23]!==l||t[24]!==u||t[25]!==d||t[26]!==p||t[27]!==m||t[28]!==h||t[29]!==g||t[30]!==_?(b=(0,J.jsxs)(l,{triggerClassName:u,contentClassName:d,value:p,disabled:m,onChange:h,children:[g,_]}),t[23]=l,t[24]=u,t[25]=d,t[26]=p,t[27]=m,t[28]=h,t[29]=g,t[30]=_,t[31]=b):b=t[31];let x;return t[32]!==b||t[33]!==v||t[34]!==y?(x=(0,J.jsxs)(`label`,{className:v,children:[y,b]}),t[32]=b,t[33]=v,t[34]=y,t[35]=x):x=t[35],x}),Rt=(0,K.memo)(function(e){let t=(0,q.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,J.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,q.c)(13),{items:n,empty:r,contentKey:i}=e,a=u(Gt);if(n.length===0){let e;return t[0]===r?e=t[1]:(e=(0,J.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
3
|
`),t[2]=n,t[3]=o);let s;t[4]===n?s=t[5]:(s=n.map(Wt),t[4]=n,t[5]=s);let c;t[6]===s?c=t[7]:(c=(0,J.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,J.jsx)(G,{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 Wt(e){return(0,J.jsxs)(`li`,{className:`flex gap-2 text-sm leading-6 text-fg`,children:[(0,J.jsx)(N,{className:`mt-1 size-4 shrink-0 text-fg-subtle`}),(0,J.jsx)(`span`,{className:`min-w-0 whitespace-pre-wrap break-words [overflow-wrap:anywhere]`,children:e})]},e)}function Gt(e){return e.language}function Kt({taskId:e,presentation:t,backgroundPath:n,onDeleted:r,onHeaderChange:i}){let[c,d]=a(),p=s(),m=u(e=>e.language),h=l(e=>e.conversationId),g=(0,K.useMemo)(()=>we(m),[m]),_=Te(e=>e.setPageHeader),v=Te(e=>e.clearPageHeader),y=Ce(e=>e.panes),x=b(e=>e.openForSession),{data:S,error:D,mutate:O,lastChange:k,conversationLoading:A,conversationError:j}=C(e),{data:M,error:N,mutate:ie}=le(e?[`task-detail-automations`,h]:null,()=>De.list(),{refreshInterval:3e4}),[ue,H]=(0,K.useState)(null),[ke,Le]=(0,K.useState)(null),[W,Re]=(0,K.useState)(()=>new Set),[ze,Be]=(0,K.useState)([]),[Ve,He]=(0,K.useState)(null),[We,Ge]=(0,K.useState)([]),[Ke,Je]=(0,K.useState)(!1),[q,Qe]=(0,K.useState)(``),[et,tt]=(0,K.useState)(!1),[nt,it]=(0,K.useState)(``),[at,st]=(0,K.useState)(Ht),[ct,lt]=(0,K.useState)(!1),ut=(0,K.useRef)(null),dt=(0,K.useRef)(null),ft=(0,K.useRef)(null),gt=(0,K.useRef)(null),[yt,bt]=(0,K.useState)(!1),xt=(0,K.useRef)(!1),St=(0,K.useRef)(!1),Ot=(0,K.useRef)(``),Mt=(0,K.useRef)(null),Nt=(0,K.useRef)(null),Wt=(0,K.useRef)(null),Gt=(0,K.useRef)(S),[Kt,Y]=(0,K.useState)(null),[qt,Jt]=(0,K.useState)(null),[Yt,Xt]=(0,K.useState)(!1),[Zt,Qt]=(0,K.useState)(!1),[$t,en]=(0,K.useState)(null),tn=(0,K.useRef)(null),nn=(0,K.useMemo)(()=>({link:g.linkDependencies,linked:g.linkedDependencies,searchPlaceholder:g.dependencySearchPlaceholder,noMatches:g.noDependencyMatches,noCandidates:g.noDependencyCandidates,remove:g.removeDependency}),[g.dependencySearchPlaceholder,g.linkDependencies,g.linkedDependencies,g.noDependencyCandidates,g.noDependencyMatches,g.removeDependency]),rn=S?.dependencies.map(e=>`${e.id}:${e.title}`).join(`\0`)??``,an=(0,K.useMemo)(()=>R(c.get(`returnTo`),`/`,[`/projects`,`/chat`,`/notes`,`/tasks`]),[c]),on=(0,K.useCallback)(e=>t===`modal`&&n?ee(n,e):z(`/tasks/${encodeURIComponent(e)}`,an),[n,t,an]);Gt.current=S;let X=(0,K.useCallback)((e,t)=>{Re(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r})},[]);(0,K.useEffect)(()=>{H(null),Le(null),Y(null),Je(!1),Mt.current=null,tt(!1),Jt(null),Xt(!1),Qt(!1),en(null)},[e]),(0,K.useEffect)(()=>{let e=!0;return Se().then(t=>{e&&Ge(t.items)}).catch(()=>void 0),()=>{e=!1}},[h]),(0,K.useEffect)(()=>{if(!k||k.source===`user`)return;Jt(k);let e=window.setTimeout(()=>Jt(null),3500);return()=>window.clearTimeout(e)},[k]),(0,K.useEffect)(()=>{let t=S?.task.projectId,n=S?.dependencies??[];if(!t){Wt.current=null,He(null),Be(n);return}Wt.current!==t&&(Wt.current=t,He(null));let r=!0;return oe(t).then(t=>{if(!r)return;He(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});Be([...i.values()])}).catch(()=>{r&&Be(n)}),()=>{r=!1}},[rn,S?.task.projectId,e]);let Z=(0,K.useCallback)(async(t,n=`command`)=>{let r=Gt.current;if(r){X(n,!0),H(null),t.type===`close`&&t.resolution===`done`&&Le(null);try{await O(await be(e,t,r.task.version),{revalidate:!1})}catch{H(g.actionFailed),t.type===`close`&&t.resolution===`done`&&Le(g.actionFailed)}finally{X(n,!1)}}},[g.actionFailed,O,X,e]),sn=(0,K.useCallback)(async(t,n)=>{let r=Gt.current;if(!r)return!1;n&&X(n,!0),H(null);try{let n=fe(e,t,r.task.version);return await O(n,{optimisticData:Dt(r,t),populateCache:!0,revalidate:!1,rollbackOnError:!0}),!0}catch{return H(g.actionFailed),!1}finally{n&&X(n,!1)}},[g.actionFailed,O,X,e]),cn=()=>{S&&(Mt.current={value:S.task.title,version:S.task.version},Y(null),Qe(S.task.title),Je(!0))},ln=()=>{xt.current=!0,Qe(Gt.current?.task.title??``),Mt.current=null,Y(null),Je(!1),queueMicrotask(()=>{xt.current=!1})},un=async(e=!1)=>{if(xt.current){xt.current=!1;return}let t=Gt.current;if(!t||W.has(`title`))return;let n=q.trim();if(!n){ln();return}let r=Mt.current;if(!e&&Et(r,t.task.version,t.task.title,n)){Y(`title`);return}if(n===t.task.title){ln();return}await sn({title:n},`title`)&&(Mt.current=null,Y(null),Je(!1))},dn=async()=>{if(!S)return;if(St.current){St.current=!1;return}let e=nt.trim(),t=Nt.current;if(Et(t,S.task.version,S.task.body??``,e)){Y(`description`);return}if(nt===Ot.current||e===(S.task.body??``).trim()){tt(!1);return}await sn({body:ce(S.task.body??``,e)||null})&&(Y(null),tt(!1))},fn=(0,K.useCallback)(async e=>{let t=Gt.current;!t||e===t.task.phase||await Z({type:`move`,phase:e},`phase`)},[Z]),pn=(0,K.useCallback)(e=>{sn({priority:e},`priority`)},[sn]),mn=(0,K.useCallback)(e=>{sn({dueAt:jt(e)},`dueAt`)},[sn]),hn=(0,K.useCallback)(e=>{st(e);try{window.localStorage.setItem(zt,String(e))}catch{}},[]),gn=(0,K.useCallback)(e=>{if(e.key!==`ArrowLeft`&&e.key!==`ArrowRight`&&e.key!==`Home`)return;e.preventDefault();let t=ft.current?.clientWidth??0,n=e.key===`Home`?Bt:at+(e.key===`ArrowLeft`?2:-2);hn(Vt(n,t))},[at,hn]),_n=(0,K.useCallback)(e=>{if(!window.matchMedia(`(min-width: 1024px)`).matches)return;let t=ft.current;if(!t)return;e.preventDefault();let n=e.currentTarget,r=e.pointerId;n.setPointerCapture(r),lt(!0);let i=at,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{}lt(!1),hn(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)},[at,hn]),vn=(0,K.useCallback)(async t=>{let n=Gt.current;if(n){X(`dependencies`,!0),H(null);try{await O(await de(e,t,n.task.version),{revalidate:!1})}catch{H(g.dependencyUpdateFailed)}finally{X(`dependencies`,!1)}}},[g.dependencyUpdateFailed,O,X,e]),yn=(0,K.useCallback)(async t=>{let n=Gt.current;if(!(!n||!t||t===n.conversation.currentExecutorAgentId)){X(`delegateAgentId`,!0),H(null);try{await O(await pe(e,t,n.task.version),{revalidate:!1})}catch{H(g.actionFailed)}finally{X(`delegateAgentId`,!1)}}},[g.actionFailed,O,X,e]),bn=(0,K.useCallback)(async()=>{X(`delete`,!0),H(null);try{await he(e),r?r():p(an,{replace:!0})}catch(e){H(e instanceof Error?e.message:g.actionFailed)}finally{X(`delete`,!1)}},[g.actionFailed,p,r,an,X,e]),xn=(0,K.useCallback)(async(t,n)=>{let r=Gt.current;if(!r)return!1;X(`acceptance`,!0),Le(null),H(null);try{return await O(await xe(e,t,n,r.task.version,r.task.latestContractVersion),{revalidate:!1}),!0}catch{return Le(g.actionFailed),H(g.actionFailed),O().catch(()=>void 0),!1}finally{X(`acceptance`,!1)}},[g.actionFailed,O,X,e]),Sn=S?.task.title,Cn=Sn!==void 0;if((0,K.useLayoutEffect)(()=>{let e=gt.current,t=e?.parentElement;if(!Cn||!e||!t||typeof IntersectionObserver>`u`)return;let n=new IntersectionObserver(([e])=>{let n=Ze(t),r=n?n.getBoundingClientRect().top+n.clientTop:0;bt(!e.isIntersecting&&e.boundingClientRect.bottom<=r)});return n.observe(e),()=>n.disconnect()},[Cn,e]),(0,K.useLayoutEffect)(()=>{i?.({taskId:e,title:Sn,compact:yt})},[yt,i,e,Sn]),(0,K.useLayoutEffect)(()=>{if(t!==`modal`)return _({startExtra:(0,J.jsx)(o,{to:an,className:`flex size-9 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover`,"aria-label":g.backToWork,children:(0,J.jsx)(T,{className:`size-4`})}),main:Cn?(0,J.jsx)(`div`,{className:`min-w-0 text-sm font-semibold text-fg`,children:(0,J.jsx)(Ct,{label:Ve?`${Ve} / ${g.taskLabel}`:g.taskLabel,title:Sn,compact:yt})}):null,end:null}),v},[v,yt,g.backToWork,g.taskLabel,Cn,t,Ve,an,_,Sn]),D&&!S)return(0,J.jsx)(`div`,{className:t===`modal`?`p-5 text-sm text-danger`:`mx-auto max-w-3xl p-6 text-sm text-danger`,children:g.taskNotFound});if(!S)return(0,J.jsx)(`div`,{className:t===`modal`?`p-5`:`mx-auto max-w-4xl p-4 sm:p-6`,children:(0,J.jsx)(kt,{})});let wn=S.waits[0],Q=S.runs.find(e=>!e.parentRunId&&[`queued`,`running`,`waiting`,`verifying`].includes(e.status)),Tn=me(S),En=Tn.length>0&&Tn.every(e=>e.status===`passed`),Dn=S.waits.find(e=>e.kind===`paused`),On=ve(S),kn=ye(S),An=g.detailStatuses[kn],jn=se(S.task.body?.trim()||S.task.contract?.objective.trim()||``),Mn=S.allowedCommands.includes(`mark_ready`),Nn=S.allowedCommands.includes(`start`),Pn=S.allowedCommands.includes(`add_wait`),Fn=!wn&&!Q&&En&&S.task.phase===`review`&&S.allowedCommands.includes(`close`),In=S.allowedCommands.includes(`reopen`),$=S.conversation.activeConversationId,Ln=S.conversation.currentExecutorAgentId??S.task.delegateAgentId??S.task.ownerId,Rn=We.find(e=>e.id===Ln),zn=f(m).agentsSettings,Bn=Rn?Oe(Rn,zn):void 0,Vn=Q?.executorKind===`agent`?We.find(e=>e.id===(Q.executorRef.agentId??S.conversation.currentExecutorAgentId)):void 0,Hn=Vn?Oe(Vn,zn):void 0,Un=!!($&&y[$]?.open),Wn=S.context.filter(e=>e.role!==`deliverable`),Gn=M?.automations.filter(t=>t.action.kind===`task_command`&&t.action.taskId===e)??[],Kn=Gn.filter(e=>e.trigger.kind===`schedule`&&e.action.kind===`task_command`&&e.action.command.type===`start`),qn=Kn.filter(e=>e.enabled&&e.state.nextRunAtMs!==void 0).map(e=>e.state.nextRunAtMs).sort((e,t)=>e-t)[0],Jn=e=>{ie(t=>({automations:[e,...(t?.automations??[]).filter(t=>t.id!==e.id)]}),{revalidate:!1})},Yn=e=>{en(e),Qt(!0)},Xn=()=>{M&&(Kn.length===1?Yn(Kn[0]):Kn.length>1?(tn.current&&(tn.current.open=!0),d(e=>Ye(e,`schedule`,!0),{preventScrollReset:!0}),tn.current?.scrollIntoView({block:`start`,behavior:`smooth`}),tn.current?.focus({preventScroll:!0})):(en(null),Qt(!0)))},Zn=S.sessions.filter((e,t,n)=>n.findIndex(t=>t.conversationId===e.conversationId)===t),Qn=S.task.contract?.expectedOutputs??[],$n=S.task.contract?.constraints??[],er=S.task.contract?.approvalRequired??[],tr=S.task.contract?.assumptions??[],nr=S.task.contract?.risks??[],rr=$n.length>0||er.length>0||tr.length>0||nr.length>0,ir=(...e)=>!!qt?.changedFields.some(t=>e.includes(t)),ar=S.allowedCommands.includes(`move`),or=W.has(`command`),sr=W.has(`delete`),cr=Q!==void 0,lr=()=>{let e=ut.current;e&&(e.open=!0,d(e=>Ye(e,`acceptance`,!0),{preventScrollReset:!0}),e.scrollIntoView({block:`start`,behavior:`smooth`}),e.focus({preventScroll:!0}))},ur=(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[Mn&&!Nn&&!wn&&S.task.phase!==`review`?(0,J.jsxs)(U,{className:`min-h-9 px-3 py-1.5 text-xs`,variant:`primary`,disabled:or,onClick:()=>void Z({type:`mark_ready`}),children:[(0,J.jsx)(re,{className:`size-4`}),g.scheduleTask]}):null,Dn&&S.allowedCommands.includes(`resolve_wait`)?(0,J.jsxs)(U,{className:`min-h-9 px-3 py-1.5 text-xs`,variant:`primary`,disabled:or,onClick:()=>void Z({type:`resolve_wait`,waitId:Dn.id}),children:[(0,J.jsx)(re,{className:`size-4`}),g.resumeTask]}):null,!wn&&Nn&&S.task.phase!==`review`&&Ln?(0,J.jsxs)(U,{className:`min-h-9 px-3 py-1.5 text-xs`,variant:`primary`,disabled:or,onClick:()=>void Z({type:`start`,executor:{kind:`agent`,agentId:Ln}}),children:[(0,J.jsx)(re,{className:`size-4`}),g.runTask]}):null,In?(0,J.jsxs)(U,{className:`min-h-9 px-3 py-1.5 text-xs`,variant:`ghost`,disabled:or,onClick:()=>void Z({type:`reopen`,phase:`ready`}),children:[(0,J.jsx)(re,{className:`size-4`}),g.reopenTask]}):null,S.task.phase!==`review`&&!Dn&&Pn?(0,J.jsxs)(U,{variant:`ghost`,className:`min-h-9 px-3 py-1.5 text-xs`,disabled:or,onClick:()=>void Z({type:`add_wait`,wait:{kind:`paused`,reason:`Paused by user`,condition:{}}}),children:[(0,J.jsx)(ne,{className:`size-4`}),g.pauseTask]}):null,S.task.phase===`closed`?(0,J.jsx)(U,{variant:`primary`,className:`min-h-9 px-3 py-1.5 text-xs`,onClick:()=>{dt.current?.scrollIntoView({block:`start`,behavior:`smooth`}),dt.current?.focus({preventScroll:!0})},children:m===`zh`?`查看结果`:`View results`}):null,!wn&&!Q&&S.task.phase!==`closed`&&S.task.phase!==`review`?(0,J.jsxs)(U,{variant:`ghost`,className:`min-h-9 px-3 py-1.5 text-xs`,disabled:!M,onClick:Xn,children:[(0,J.jsx)(E,{className:`size-4`}),Kn.length>0?m===`zh`?`管理执行时间`:`Manage schedule`:m===`zh`?`设置执行时间`:`Set execution time`]}):null,S.task.phase===`review`?(0,J.jsx)(U,{variant:`primary`,className:`min-h-9 px-3 py-1.5 text-xs`,onClick:lr,children:m===`zh`?`去验收`:`Review results`}):null,(0,J.jsxs)(je,{children:[(0,J.jsx)(Me,{asChild:!0,children:(0,J.jsx)(U,{type:`button`,variant:`ghost`,className:`size-9 p-0`,disabled:or||sr,"aria-label":g.moreActions,children:(0,J.jsx)(P,{className:`size-4`,"aria-hidden":!0})})}),(0,J.jsx)(Ne,{children:(0,J.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:[S.task.phase===`review`&&!Dn&&Pn?(0,J.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:g.pauseTask}):null,S.task.phase===`review`&&!wn&&!Q?(0,J.jsx)(Pe,{disabled:!M,className:`cursor-pointer rounded-md px-3 py-2 text-sm text-fg outline-none focus:bg-surface-hover data-[disabled]:opacity-50`,onSelect:Xn,children:Kn.length>0?m===`zh`?`管理执行时间`:`Manage schedule`:m===`zh`?`设置执行时间`:`Set execution time`}):null,S.task.phase===`review`&&!wn&&Nn&&Ln?(0,J.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:Ln}}),children:g.runTask}):null,Mn&&(Nn||wn||S.task.phase===`review`)?(0,J.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:g.scheduleTask}):null,Q?(0,J.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),H(null),O(_e(e,Q.id,Q.version),{revalidate:!1}).catch(()=>H(g.actionFailed)).finally(()=>X(`command`,!1))},children:g.cancelActiveRun}):null,Q?(0,J.jsx)(Ie,{className:`my-1 h-px bg-edge`}):null,S.task.phase===`closed`?null:(0,J.jsxs)(J.Fragment,{children:[(0,J.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:g.cancelTask}),(0,J.jsx)(Ie,{className:`my-1 h-px bg-edge`})]}),(0,J.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(cr){H(g.deleteActiveTaskBlocked);return}Xt(!0)},children:g.deleteTask})]})})]})]});return(0,J.jsxs)(`div`,{ref:ft,className:`flex h-full min-h-0 flex-col overflow-hidden ${ct?`lg:cursor-col-resize lg:select-none`:``}`,style:{"--task-chat-panel-width":`${at}%`},children:[(0,J.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto lg:flex-row lg:overflow-hidden`,children:[(0,J.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,J.jsxs)(`header`,{ref:gt,className:V(`shrink-0 px-4 py-5 sm:px-6 sm:py-6`,ir(`title`)&&`task-detail-live-update`),children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-x-6 gap-y-3`,children:[(0,J.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs text-fg-muted`,children:[Ve?(0,J.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,J.jsx)(I,{className:`size-3.5`,"aria-hidden":!0}),Ve]}):null,Ve?(0,J.jsx)(`span`,{"aria-hidden":`true`,children:`/`}):null,(0,J.jsx)(`span`,{children:g.taskLabel}),qt?(0,J.jsx)(`span`,{className:`rounded-full bg-accent-soft px-2 py-0.5 text-[11px] font-medium text-accent-fg`,role:`status`,children:qt.source===`agent`?m===`zh`?`Agent 刚刚更新`:`Updated by Agent`:m===`zh`?`执行结果已同步`:`Execution result synced`}):null]}),Ke?(0,J.jsx)(`textarea`,{autoFocus:!0,"data-task-inline-editor":!0,"aria-label":m===`zh`?`任务标题`:`Task title`,rows:2,value:q,onFocus:e=>{Mt.current?.value===q&&(e.currentTarget.setSelectionRange(0,0),e.currentTarget.scrollTop=0)},onChange:e=>Qe(e.target.value),onBlur:()=>void un(),onKeyDown:e=>{e.nativeEvent.isComposing||(e.key===`Escape`?(e.preventDefault(),e.stopPropagation(),ln()):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,J.jsx)(G,{content:S.task.title,contentKey:`${e}:title`,language:m,previewHeight:56,className:`mt-2 max-w-3xl`,children:(0,J.jsx)(`h1`,{className:`break-words text-xl font-semibold leading-7 tracking-tight text-fg sm:text-2xl`,children:(0,J.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:S.task.title,onClick:cn,children:S.task.title})})}),Kt===`title`?(0,J.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2 text-xs text-warning`,role:`alert`,children:[(0,J.jsx)(`span`,{children:m===`zh`?`Agent 在你编辑期间更新了标题。`:`The Agent updated the title while you were editing.`}),(0,J.jsx)(`button`,{type:`button`,className:`rounded-md bg-surface-hover px-2 py-1 text-fg`,onClick:ln,children:m===`zh`?`使用 Agent 版本`:`Use Agent version`}),(0,J.jsx)(`button`,{type:`button`,className:`rounded-md bg-accent-soft px-2 py-1 text-accent-fg`,disabled:W.has(`title`),onClick:()=>void un(!0),children:m===`zh`?`保留我的修改`:`Keep my changes`})]}):null]}),(0,J.jsx)(`span`,{className:V(`shrink-0 rounded-full px-2.5 py-1 text-xs font-medium`,ge(kn)),children:An})]}),(0,J.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-x-4 gap-y-2 text-xs text-fg-muted`,children:[(0,J.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-2`,children:[Ln?(0,J.jsx)(Ee,{agentId:Ln,avatar:Rn?.avatar,size:20,className:`shrink-0`}):null,(0,J.jsxs)(`span`,{className:`min-w-0 break-words [overflow-wrap:anywhere]`,children:[g.executorLabel,` · `,Bn??Ln??g.unassigned]})]}),(0,J.jsx)(`span`,{className:`text-fg-subtle`,children:g.updatedAt.replace(`{{date}}`,Ue(S.task.updatedAt,m))})]})]}),(0,J.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":m===`zh`?`任务操作`:`Task actions`,children:[(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-fg-muted`,children:An}),ur,ue?(0,J.jsx)(`p`,{role:`alert`,className:`basis-full text-sm text-danger`,children:ue}):null,(0,J.jsx)($e,{language:m,hasSchedule:Kn.length>0},e)]}),(0,J.jsxs)(`section`,{className:`min-w-0 space-y-4 p-4 sm:p-5`,children:[S.task.phase===`review`?null:(0,J.jsx)(vt,{detail:S,executorName:Hn,language:m,onUpdated:e=>{O(e,{revalidate:!1})}}),(0,J.jsxs)(`section`,{"data-task-section":`results`,"data-task-section-label":m===`zh`?`交付结果`:`Results`,ref:dt,tabIndex:-1,"aria-labelledby":`task-results-heading`,className:`scroll-mt-24 space-y-4`,children:[(0,J.jsx)(ot,{detail:S,language:m}),S.task.phase===`review`&&(S.waits.length>0||S.attention.some(e=>e.kind===`input_required`||e.kind===`approval_required`))?(0,J.jsx)(vt,{detail:S,language:m,onUpdated:e=>{O(e,{revalidate:!1})}}):null,(0,J.jsx)(Xe,{panelId:`acceptance`,chevron:!0,"data-task-section":`acceptance`,"data-task-section-label":m===`zh`?`验收`:`Acceptance`,defaultOpen:!0,ref:ut,tabIndex:-1,"aria-label":g.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,J.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[m===`zh`?`验收`:`Acceptance`,(0,J.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:[Tn.filter(e=>e.status===`passed`).length,`/`,Tn.length]})]}),children:(0,J.jsx)(rt,{criteria:Tn,language:m,closed:S.task.phase===`closed`,pending:W.has(`acceptance`),error:ke,blockedReason:wn?m===`zh`?`请先处理待办事项`:`Resolve the pending request first`:Q?m===`zh`?`请等待当前执行结束`:`Wait for the current run to finish`:void 0,onReview:xn,projectId:S.task.projectId,conversationId:$??void 0},`${e}:${S.task.latestContractVersion}`)})]}),(0,J.jsx)(Xe,{panelId:`report`,chevron:!0,defaultOpen:!0,"data-task-section":`report`,"data-task-section-label":m===`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:m===`zh`?`完整执行报告`:`Full execution report`,children:(0,J.jsx)(pt,{detail:S,language:m},On?.runId??e)}),!M&&!N?(0,J.jsx)(ae,{className:`h-9 rounded-lg`}):null,N?(0,J.jsxs)(`div`,{role:`alert`,className:`flex flex-wrap items-center gap-2 text-sm text-danger`,children:[(0,J.jsx)(`span`,{children:m===`zh`?`无法读取执行计划,请重试后再设置时间。`:`Could not load schedules. Retry before setting a time.`}),(0,J.jsx)(U,{variant:`ghost`,onClick:()=>void ie(),children:m===`zh`?`重试`:`Retry`})]}):null,Kn.length>0?(0,J.jsx)(Xe,{panelId:`schedule`,chevron:!0,defaultOpen:!0,"data-task-section":`schedule`,"data-task-section-label":m===`zh`?`执行时间`:`Schedule`,ref:tn,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,J.jsxs)(J.Fragment,{children:[m===`zh`?`执行时间`:`Execution schedule`,` · `,Kn.length,qn===void 0?``:` · ${m===`zh`?`下次执行:`:`Next run: `}${Ue(qn,m)}`]}),children:(0,J.jsx)(`div`,{className:`mt-3`,children:(0,J.jsx)(ht,{schedules:Kn,language:m,onEdit:Yn,onUpdated:Jn})})}):null,(0,J.jsx)(Xe,{panelId:`goal`,chevron:!0,defaultOpen:!0,"data-task-section":`goal`,"data-task-section-label":m===`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:m===`zh`?`任务目标与说明`:`Task goal and description`,children:(0,J.jsx)(`div`,{className:`mt-3`,children:(0,J.jsxs)(`section`,{className:`overflow-hidden rounded-xl border border-edge-subtle bg-surface-panel divide-y divide-edge-subtle`,children:[(0,J.jsxs)(`div`,{className:`border-b border-edge-subtle p-5`,children:[(0,J.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:m===`zh`?`任务目标`:`Task goal`}),(0,J.jsx)(G,{content:S.task.contract?.objective||S.task.title,contentKey:`${e}:goal`,language:m,markdown:!1,previewHeight:72,className:`mt-3 text-sm leading-6 text-fg`}),(0,J.jsxs)(U,{variant:`ghost`,className:`mt-2 min-h-9 px-2 text-xs`,onClick:lr,children:[g.successDefinition,` · `,Tn.length]})]}),Qn.length>0?(0,J.jsxs)(`div`,{className:`p-5`,children:[(0,J.jsx)(`h3`,{className:`text-xs font-medium text-fg-muted`,children:g.expectedOutputs}),(0,J.jsx)(`div`,{className:`mt-2`,children:(0,J.jsx)(Ut,{contentKey:`${e}:expectedOutputs`,items:Qn,empty:g.noDefinition})})]}):null,(0,J.jsxs)(`details`,{className:V(`p-5`,ir(`body`)&&`task-detail-live-update`),children:[(0,J.jsx)(`summary`,{className:`cursor-pointer text-sm font-semibold text-fg`,children:g.taskDescription}),et?(0,J.jsx)(`textarea`,{autoFocus:!0,"data-task-inline-editor":!0,rows:6,value:nt,onChange:e=>it(e.target.value),onBlur:()=>void dn(),onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),St.current=!0,it(se(S.task.body??S.task.contract?.objective??``)),tt(!1),queueMicrotask(()=>{St.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,J.jsxs)(`div`,{className:`mt-2`,children:[jn&&jn!==S.task.title?(0,J.jsx)(G,{content:jn,contentKey:`${e}:description`,language:m}):(0,J.jsx)(`p`,{className:`text-sm leading-6 text-fg-muted`,children:g.noTaskDescription}),(0,J.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=se(S.task.body??S.task.contract?.objective??``);Ot.current=e,Nt.current={value:S.task.body??``,version:S.task.version},Y(null),it(e),tt(!0)},children:m===`zh`?`编辑说明`:`Edit description`})]}),Kt===`description`?(0,J.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2 text-xs text-warning`,role:`alert`,children:[(0,J.jsx)(`span`,{children:m===`zh`?`Agent 在你编辑期间更新了描述。`:`The Agent updated the description while you were editing.`}),(0,J.jsx)(`button`,{type:`button`,className:`rounded-md bg-surface-hover px-2 py-1 text-fg`,onClick:()=>{it(se(S.task.body??``)),Y(null),tt(!1)},children:m===`zh`?`使用 Agent 版本`:`Use Agent version`}),(0,J.jsx)(`button`,{type:`button`,className:`rounded-md bg-accent-soft px-2 py-1 text-accent-fg`,onClick:()=>void sn({body:ce(S.task.body??``,nt.trim())||null}).then(e=>{e&&(Y(null),tt(!1))}),children:m===`zh`?`保留我的修改`:`Keep my changes`})]}):null]}),rr?(0,J.jsxs)(`section`,{className:V(`p-5`,ir(`contract`)&&`task-detail-live-update`),children:[(0,J.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:g.taskDefinition}),(0,J.jsx)(`p`,{className:`mt-2 text-xs leading-5 text-fg-muted`,children:m===`zh`?`执行边界及补充背景`:`Execution boundaries and supporting context`}),$n.length>0?(0,J.jsxs)(`details`,{className:`mt-4 border-t border-edge-subtle pt-4`,children:[(0,J.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg-muted hover:text-fg`,children:g.constraints}),(0,J.jsx)(`div`,{className:`mt-3`,children:(0,J.jsx)(Ut,{contentKey:`${e}:constraints`,items:$n,empty:g.noDefinition})})]}):null,er.length>0?(0,J.jsxs)(`details`,{className:`mt-4 border-t border-edge-subtle pt-4`,children:[(0,J.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg-muted hover:text-fg`,children:g.approvalRequired}),(0,J.jsx)(`div`,{className:`mt-3`,children:(0,J.jsx)(Ut,{contentKey:`${e}:approvalRequired`,items:er,empty:g.noDefinition})})]}):null,tr.length>0?(0,J.jsxs)(`details`,{className:`mt-4 border-t border-edge-subtle pt-4`,children:[(0,J.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg-muted hover:text-fg`,children:g.contextAssumptions}),(0,J.jsx)(`div`,{className:`mt-3`,children:(0,J.jsx)(Ut,{contentKey:`${e}:assumptions`,items:tr,empty:g.noDefinition})})]}):null,nr.length>0?(0,J.jsxs)(`details`,{className:`mt-4 border-t border-edge-subtle pt-4`,children:[(0,J.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg-muted hover:text-fg`,children:g.contextRisks}),(0,J.jsx)(`div`,{className:`mt-3`,children:(0,J.jsx)(Ut,{contentKey:`${e}:risks`,items:nr,empty:g.noDefinition})})]}):null]}):null]})})}),(0,J.jsxs)(Xe,{panelId:`management`,chevron:!0,defaultOpen:!0,"data-task-section":`management`,"data-task-section-label":m===`zh`?`任务管理`:`Management`,"aria-label":m===`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:m===`zh`?`任务管理`:`Task management`,children:[(0,J.jsxs)(`aside`,{className:`min-w-0 overflow-hidden rounded-xl bg-surface-panel shadow-surface divide-y divide-edge-subtle`,children:[(0,J.jsxs)(`section`,{className:V(`p-5`,ir(`phase`,`resolution`,`priority`,`dueAt`,`delegateAgentId`)&&`task-detail-live-update`),children:[(0,J.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:g.taskProperties}),(0,J.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-2`,children:[(0,J.jsx)(Pt,{value:S.task.phase,disabled:W.has(`phase`),canMove:ar,canApprove:Fn,canReopen:In,language:m,label:g.taskPhase,onChange:fn}),(0,J.jsx)(Ft,{value:S.task.priority,disabled:W.has(`priority`),label:g.priority,labels:g.priorityLabels,onChange:pn}),(0,J.jsx)(It,{value:At(S.task.dueAt),disabled:W.has(`dueAt`),label:g.dueDate,onChange:mn}),(0,J.jsx)(Lt,{value:S.conversation.currentExecutorAgentId??``,disabled:W.has(`delegateAgentId`),label:g.executorLabel,unassignedLabel:g.unassigned,agents:We,language:m,onChange:yn})]})]}),(0,J.jsxs)(`details`,{className:V(`p-5`,ir(`dependencies`)&&`task-detail-live-update`),children:[(0,J.jsxs)(`summary`,{className:`cursor-pointer text-sm font-semibold text-fg`,children:[g.taskRelations,` · `,S.dependencies.length,` / `,S.dependents.length]}),(0,J.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`p`,{className:`mb-2 text-xs text-fg-muted`,children:g.dependencies}),(0,J.jsx)(Rt,{candidates:ze,selected:S.dependencies,disabled:W.has(`dependencies`),labels:nn,getTaskHref:on,onChange:vn})]}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`p`,{className:`mb-2 text-xs text-fg-muted`,children:g.dependents}),S.dependents.length>0?(0,J.jsx)(`div`,{className:`space-y-1.5`,children:S.dependents.map(t=>(0,J.jsx)(G,{content:t.title,contentKey:`${e}:dependent:${t.id}`,language:m,previewHeight:72,className:`rounded-lg bg-surface-hover p-2.5`,children:(0,J.jsx)(o,{to:on(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,J.jsx)(`p`,{className:`text-sm text-fg-subtle`,children:g.noDependents})]})]})]})]}),S.task.phase===`closed`?null:(0,J.jsxs)(U,{variant:`ghost`,className:`my-3`,disabled:!M,onClick:Xn,children:[(0,J.jsx)(E,{className:`size-4`}),Kn.length>0?m===`zh`?`管理执行时间`:`Manage schedule`:g.scheduleRecurringTask]}),(0,J.jsxs)(`details`,{className:`mb-4 rounded-xl border border-edge-subtle bg-surface-panel p-5 shadow-surface`,children:[(0,J.jsx)(`summary`,{className:`cursor-pointer text-sm font-semibold text-fg`,children:m===`zh`?`关联内容`:`Related work`}),Zn.length>0||S.runs.length>0||Gn.length>0||S.dependencies.length>0||S.dependents.length>0?(0,J.jsxs)(`div`,{className:`mt-3 grid gap-3 sm:grid-cols-2`,children:[Zn.length>0?(0,J.jsxs)(`div`,{className:`rounded-lg bg-surface-hover p-3`,children:[(0,J.jsx)(`h3`,{className:`text-xs font-medium text-fg-muted`,children:m===`zh`?`对话 · ${Zn.length}`:`Conversations · ${Zn.length}`}),(0,J.jsx)(wt,{contentKey:`${e}:sessions`,language:m,className:`mt-2`,children:Zn.map(t=>(0,J.jsx)(`li`,{children:(0,J.jsx)(o,{className:`block break-words [overflow-wrap:anywhere] text-sm text-accent hover:underline`,to:t.conversationId===$?B(e):`/chat/${encodeURIComponent(t.conversationId)}`,children:t.conversationId===$?m===`zh`?`当前执行对话`:`Current execution chat`:t.role===`discussion`?m===`zh`?`关联讨论`:`Linked discussion`:m===`zh`?`历史执行对话`:`Earlier execution chat`})},t.id))})]}):null,Gn.length>0?(0,J.jsxs)(`div`,{className:`rounded-lg bg-surface-hover p-3`,children:[(0,J.jsx)(`h3`,{className:`text-xs font-medium text-fg-muted`,children:m===`zh`?`自动化 · ${Gn.length}`:`Automations · ${Gn.length}`}),(0,J.jsx)(wt,{contentKey:`${e}:automations`,language:m,className:`mt-2`,children:Gn.map(e=>(0,J.jsx)(`li`,{children:(0,J.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,S.dependencies.length>0||S.dependents.length>0?(0,J.jsxs)(`div`,{className:`rounded-lg bg-surface-hover p-3`,children:[(0,J.jsx)(`h3`,{className:`text-xs font-medium text-fg-muted`,children:g.taskRelations}),(0,J.jsx)(`p`,{className:`mt-2 text-sm text-fg`,children:m===`zh`?`${S.dependencies.length} 个前置任务 · ${S.dependents.length} 个后续任务`:`${S.dependencies.length} prerequisites · ${S.dependents.length} dependents`})]}):null]}):(0,J.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:m===`zh`?`还没有关联内容`:`No related work yet`}),(0,J.jsx)(`div`,{className:`mt-4 border-t border-edge-subtle pt-3`,children:(0,J.jsx)(qe,{resource:{kind:`task`,id:S.task.id,revision:String(S.task.version)},disabled:Ke||et||W.size>0})})]}),Wn.length>0?(0,J.jsxs)(`section`,{className:V(`p-5`,ir(`context`)&&`task-detail-live-update`),children:[(0,J.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:g.contextUsed}),(0,J.jsx)(`ul`,{className:`mt-4 grid gap-2 sm:grid-cols-2`,children:Wn.map(e=>(0,J.jsxs)(`li`,{className:`min-w-0 rounded-lg bg-surface-hover p-2.5`,children:[(0,J.jsxs)(`span`,{className:`text-[11px] text-fg-subtle`,children:[g.contextRoleLabels[e.role],` · `,g.contextKindLabels[e.targetKind]]}),e.targetKind===`url`&&/^https?:\/\//.test(e.targetId)?(0,J.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,J.jsx)(`p`,{className:`mt-1 break-words text-sm text-fg`,children:e.title??e.targetId})]},e.id))})]}):null]}),(0,J.jsx)(Xe,{panelId:`activity`,chevron:!0,defaultOpen:!0,"data-task-section":`activity`,"data-task-section-label":m===`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:m===`zh`?`活动记录与留言`:`Activity and updates`,children:(0,J.jsxs)(`div`,{className:`mt-3 space-y-4`,children:[(0,J.jsx)(Tt,{taskId:e},e),(0,J.jsx)(mt,{changes:S.phaseChanges,language:m})]})})]})]}),(0,J.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":m===`zh`?`调整任务信息和 Agent 对话的宽度`:`Resize task details and Agent chat`,"aria-valuemin":30,"aria-valuemax":60,"aria-valuenow":Math.round(at),tabIndex:0,onPointerDown:_n,onKeyDown:gn,onDoubleClick:()=>hn(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,J.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,J.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge-subtle px-4 py-3`,children:[(0,J.jsx)(`h2`,{className:`text-sm font-medium text-fg-muted`,children:m===`zh`?`执行对话`:`Execution chat`}),(0,J.jsxs)(`div`,{className:`flex items-center gap-1`,children:[Zn.length>1?(0,J.jsxs)(je,{children:[(0,J.jsx)(Me,{asChild:!0,children:(0,J.jsx)(U,{type:`button`,variant:`ghost`,className:`h-8 px-2 text-xs`,children:m===`zh`?`${Zn.length} 段对话`:`${Zn.length} conversations`})}),(0,J.jsx)(Ne,{children:(0,J.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:Zn.map(t=>(0,J.jsx)(Pe,{asChild:!0,children:(0,J.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===$?B(e):`/chat/${encodeURIComponent(t.conversationId)}`,children:t.conversationId===$?m===`zh`?`当前执行对话`:`Current execution chat`:t.role===`discussion`?m===`zh`?`关联讨论`:`Linked discussion`:m===`zh`?`历史执行对话`:`Earlier execution chat`})},t.id))})})]}):null,$?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(U,{type:`button`,variant:`ghost`,className:V(`size-8 p-0`,Un&&`bg-surface-hover text-fg`),"aria-label":m===`zh`?`项目文件`:`Project files`,"aria-pressed":Un,onClick:()=>{Ce.getState().openFiles($),x($)},children:(0,J.jsx)(L,{className:`size-4`,"aria-hidden":!0})}),(0,J.jsx)(U,{asChild:!0,variant:`ghost`,className:`size-8 p-0`,children:(0,J.jsx)(o,{to:B(e),"aria-label":m===`zh`?`全屏打开对话`:`Open chat full screen`,children:(0,J.jsx)(F,{className:`size-4`,"aria-hidden":!0})})})]}):null]})]}),$?(0,J.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,J.jsx)(w,{embedded:!0,conversationId:$,taskId:e})}):A?(0,J.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center p-8 text-center`,children:(0,J.jsxs)(`div`,{className:`max-w-xs`,children:[(0,J.jsx)(te,{className:`mx-auto size-8 animate-pulse text-fg-subtle`}),(0,J.jsx)(`p`,{className:`mt-3 text-sm font-medium text-fg`,children:m===`zh`?`正在创建任务会话`:`Creating task conversation`})]})}):j?(0,J.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center p-8 text-center`,children:(0,J.jsxs)(`div`,{className:`max-w-xs`,children:[(0,J.jsx)(te,{className:`mx-auto size-8 text-danger`}),(0,J.jsx)(`p`,{className:`mt-3 text-sm font-medium text-fg`,children:m===`zh`?`任务会话创建失败`:`Could not create task conversation`}),(0,J.jsx)(`p`,{className:`mt-2 text-xs leading-5 text-fg-muted`,children:j instanceof Error?j.message:String(j)})]})}):(0,J.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center p-8 text-center`,children:(0,J.jsxs)(`div`,{className:`max-w-xs`,children:[(0,J.jsx)(te,{className:`mx-auto size-8 text-fg-subtle`}),(0,J.jsx)(`p`,{className:`mt-3 text-sm font-medium text-fg`,children:m===`zh`?`等待任务会话`:`Waiting for a task conversation`}),(0,J.jsx)(`p`,{className:`mt-2 text-xs leading-5 text-fg-muted`,children:m===`zh`?`安排或开始任务后,Agent 的执行过程和持续对话会显示在这里。`:`Schedule or start the task to see the agent run and continue the conversation here.`})]})})]})]}),Zt?(0,J.jsx)(_t,{automation:$t??void 0,taskId:e,taskTitle:S.task.title,projectId:S.task.projectId,executorAgentId:Ln,language:m,onClose:()=>Qt(!1),onCreated:Jn},`${e}:${$t?.id??`new`}`):null,(0,J.jsx)(Ae,{open:Yt,title:g.deleteTaskTitle,description:g.deleteTaskDescription.replace(`{{title}}`,S.task.title),confirmLabel:g.confirmDeleteTask,cancelLabel:g.keepTask,destructive:!0,onConfirm:()=>{Xt(!1),bn()},onCancel:()=>Xt(!1)})]})}function Y(){let e=(0,q.c)(2),{taskId:t}=i(),n=t===void 0?``:t,r;return e[0]===n?r=e[1]:(r=(0,J.jsx)(Kt,{taskId:n,presentation:`page`}),e[0]=n,e[1]=r),r}function qt(e){let t=(0,q.c)(43),{taskId:n,backgroundPath:r,workspacePanelWidth:i,onClose:a}=e,o=i===void 0?0:i,s=u(Zt),c=H(Xt),l=o>0,[d,f]=(0,K.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,J.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,J.jsx)(v,{className:`min-w-0 flex-1 font-medium text-fg`,children:(0,J.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,J.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,J.jsx)(ie,{className:`size-4`,"aria-hidden":!0}),t[18]=I):I=t[18];let L;t[19]===F?L=t[20]:(L=(0,J.jsx)(`div`,{className:`flex shrink-0 items-center gap-1`,children:(0,J.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,J.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,J.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:(0,J.jsx)(Kt,{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 B;t[32]!==O||t[33]!==R||t[34]!==ee||t[35]!==w?(B=(0,J.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:Yt,onInteractOutside:Jt,children:[R,ee]}),t[32]=O,t[33]=R,t[34]=ee,t[35]=w,t[36]=B):B=t[36];let te;t[37]!==B||t[38]!==C?(te=(0,J.jsxs)(g,{children:[C,B]}),t[37]=B,t[38]=C,t[39]=te):te=t[39];let ne;return t[40]!==b||t[41]!==te?(ne=(0,J.jsx)(y,{modal:!1,open:!0,onOpenChange:b,children:te}),t[40]=b,t[41]=te,t[42]=ne):ne=t[42],ne}function Jt(e){let t=e.detail.originalEvent.target;t instanceof Element&&t.closest(`#app-workspace-panel, [data-task-modal-backdrop]`)&&e.preventDefault()}function Yt(e){let t=e.target;t instanceof HTMLElement&&t.closest(`[data-task-inline-editor]`)&&e.preventDefault()}function Xt(e){return e.setPath}function Zt(e){return e.language}function Qt(e){return e.id}export{qt as TaskDetailModal,Y as TaskDetailPage};
|