@xopcai/xopc 0.0.480 → 0.0.481

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (543) hide show
  1. package/dist/browser-ext/manifest.json +1 -1
  2. package/dist/extensions/feishu/src/outbound/media-load.js +1 -1
  3. package/dist/extensions/feishu/src/transport/client/install-sdk.js +1 -1
  4. package/dist/extensions/telegram/xopc.extension.json +1 -1
  5. package/dist/extensions/weixin/src/api/api.js +2 -2
  6. package/dist/extensions/weixin/src/auth/accounts.js +1 -1
  7. package/dist/extensions/weixin/src/cdn/upload.js +1 -1
  8. package/dist/extensions/weixin/src/media/data-url.js +1 -1
  9. package/dist/extensions/weixin/src/messaging/debug-mode.js +1 -1
  10. package/dist/extensions/weixin/src/messaging/inbound.js +1 -1
  11. package/dist/extensions/weixin/src/messaging/process-message.js +1 -1
  12. package/dist/gateway/server/chunks.bin +583 -583
  13. package/dist/gateway/server/chunks.json +1 -1
  14. package/dist/gateway/static/root/assets/{activity-store-9wMoZ4Ok.js → activity-store-zMwJQbPV.js} +1 -1
  15. package/dist/gateway/static/root/assets/{agent-avatar-dicebear-TrALdAg_.js → agent-avatar-dicebear-VUJHrVXo.js} +1 -1
  16. package/dist/gateway/static/root/assets/{agent-avatar-display-BiHRFRo2.js → agent-avatar-display-umdw-BQZ.js} +2 -2
  17. package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-DLopBKfN.js → agent-defaults-settings-panel-2JEkjXQB.js} +1 -1
  18. package/dist/gateway/static/root/assets/{agent-plugin-dialog-wisFd2cR.js → agent-plugin-dialog-Cz08StU4.js} +1 -1
  19. package/dist/gateway/static/root/assets/{agents-CzgZX_E9.js → agents-BXVjWw0p.js} +3 -3
  20. package/dist/gateway/static/root/assets/{agents-admin-api-Crvl6IB4.js → agents-admin-api-C1Ab97Mn.js} +1 -1
  21. package/dist/gateway/static/root/assets/{api-CJvZsRen.js → api-5GGJYrzC.js} +1 -1
  22. package/dist/gateway/static/root/assets/{api-DQVcF1zq.js → api-B2QJSgN6.js} +1 -1
  23. package/dist/gateway/static/root/assets/{app-management-settings-panel-CYwY9a8P.js → app-management-settings-panel-IaAONzFg.js} +1 -1
  24. package/dist/gateway/static/root/assets/{appearance-settings-8clf9SDY.js → appearance-settings-BFo0Yk57.js} +1 -1
  25. package/dist/gateway/static/root/assets/{apps-page-B2qv9gWd.js → apps-page-aVZLDS59.js} +1 -1
  26. package/dist/gateway/static/root/assets/{archive-plugin-Bu1nF6Lg.js → archive-plugin-BgX_1X6q.js} +1 -1
  27. package/dist/gateway/static/root/assets/{automation-api-HQmKv0Sm.js → automation-api-DtFbVh6a.js} +1 -1
  28. package/dist/gateway/static/root/assets/{automation-result-state-CMjfyY6p.js → automation-result-state-CBfGJb7v.js} +1 -1
  29. package/dist/gateway/static/root/assets/{automation-run-list-wlGMBYYv.js → automation-run-list-C-nOpY2_.js} +1 -1
  30. package/dist/gateway/static/root/assets/{automation-task-card-2EsZ1jBs.js → automation-task-card-BgS9JQeL.js} +1 -1
  31. package/dist/gateway/static/root/assets/{automations-page-BUtoiUiH.js → automations-page-C6dw7Nqb.js} +1 -1
  32. package/dist/gateway/static/root/assets/{automations-workspace-CW_8-0Cb.js → automations-workspace-CKCsL5wQ.js} +2 -2
  33. package/dist/gateway/static/root/assets/{binary-plugins-Dz62GXI_.js → binary-plugins-DX9lDAWC.js} +1 -1
  34. package/dist/gateway/static/root/assets/{block-editor-CA66tdm3.js → block-editor-DRNtaARK.js} +1 -1
  35. package/dist/gateway/static/root/assets/{browser-settings-page-hAttQ9qS.js → browser-settings-page-Btf2a-_0.js} +1 -1
  36. package/dist/gateway/static/root/assets/{capabilities-BNmDs-Ca.js → capabilities-C5MLP2Rx.js} +1 -1
  37. package/dist/gateway/static/root/assets/{capabilities-BcgSEYc5.js → capabilities-SIty9Vcz.js} +1 -1
  38. package/dist/gateway/static/root/assets/{capabilities-page-CT6qMkqA.js → capabilities-page-BnTgeZB3.js} +2 -2
  39. package/dist/gateway/static/root/assets/capabilities-settings-panel-7MsgsVvQ.js +8 -0
  40. package/dist/gateway/static/root/assets/capability-presentation-DlJQUUlM.js +1 -0
  41. package/dist/gateway/static/root/assets/{channels-CFmGXibE.js → channels-CLpOmzO5.js} +1 -1
  42. package/dist/gateway/static/root/assets/{chat-agents-api-LVSL686y.js → chat-agents-api-JoSvbwve.js} +1 -1
  43. package/dist/gateway/static/root/assets/{chat-chart-block-Drmp5p0m.js → chat-chart-block-D1XpCNA5.js} +1 -1
  44. package/dist/gateway/static/root/assets/{chat-page-qrdWReZ2.js → chat-page-sPNbEboB.js} +31 -31
  45. package/dist/gateway/static/root/assets/{chat-terminal-dock-twWNRsuW.js → chat-terminal-dock-BDHq9kj3.js} +1 -1
  46. package/dist/gateway/static/root/assets/{command-palette-api-B27c_GTI.js → command-palette-api-C2IaBEe4.js} +1 -1
  47. package/dist/gateway/static/root/assets/{composer-model-config-control-DdxZ-1U4.js → composer-model-config-control-C5hjuJQc.js} +1 -1
  48. package/dist/gateway/static/root/assets/{composer-notifications-Dd64p5ZI.js → composer-notifications-BSboNnS6.js} +1 -1
  49. package/dist/gateway/static/root/assets/{composer-payload-handoff-Cbkv-F26.js → composer-payload-handoff-D5CvsQWj.js} +1 -1
  50. package/dist/gateway/static/root/assets/{computer-settings-page-B8UkO-mU.js → computer-settings-page-CwB7HgUb.js} +1 -1
  51. package/dist/gateway/static/root/assets/connected-providers-grid-DPJ_E0_Y.js +1 -0
  52. package/dist/gateway/static/root/assets/{connection-usage-guide-CNB9P9jg.js → connection-usage-guide-DWj6jcFA.js} +1 -1
  53. package/dist/gateway/static/root/assets/{connector-service-page-DkifsBTl.js → connector-service-page-DEnQE7bH.js} +1 -1
  54. package/dist/gateway/static/root/assets/{connectors-api-DjIpuBCy.js → connectors-api-BRGeDfyP.js} +1 -1
  55. package/dist/gateway/static/root/assets/{connectors-page-oGveGlkI.js → connectors-page--3zYHSCM.js} +1 -1
  56. package/dist/gateway/static/root/assets/{date-picker-_G6tIiGk.js → date-picker-jqmqOuOL.js} +1 -1
  57. package/dist/gateway/static/root/assets/{date-time-picker-B3lS-ZGW.js → date-time-picker-B3n_gScw.js} +1 -1
  58. package/dist/gateway/static/root/assets/{desktop-pet-BAKyq-sn.js → desktop-pet-D8Tz4lEu.js} +1 -1
  59. package/dist/gateway/static/root/assets/{desktop-pet-settings-DGpu4hH_.js → desktop-pet-settings-24N6UYdz.js} +1 -1
  60. package/dist/gateway/static/root/assets/{dev-view-store-DqYjZFu1.js → dev-view-store-DMaKk2H5.js} +1 -1
  61. package/dist/gateway/static/root/assets/{device-pairing-wizard-CIvmpDvo.js → device-pairing-wizard-CUMh0ui_.js} +1 -1
  62. package/dist/gateway/static/root/assets/{directory-picker-path-field-BAsEQvG4.js → directory-picker-path-field-DqknuyWo.js} +1 -1
  63. package/dist/gateway/static/root/assets/{extension-authoritative-grants-BmlRcbhA.js → extension-authoritative-grants-Choc5BaY.js} +1 -1
  64. package/dist/gateway/static/root/assets/{extension-debug-page--EU_kb8E.js → extension-debug-page-8tHOJM-0.js} +1 -1
  65. package/dist/gateway/static/root/assets/{extension-iframe-host-CcspWP4N.js → extension-iframe-host-crHrHgry.js} +1 -1
  66. package/dist/gateway/static/root/assets/{extension-marketplace-api-BQIfGFSy.js → extension-marketplace-api-3vDR-EC4.js} +1 -1
  67. package/dist/gateway/static/root/assets/{extension-message-router-f7v82b69.js → extension-message-router-CBdW5Mi0.js} +1 -1
  68. package/dist/gateway/static/root/assets/{extension-page-CJxtbXQj.js → extension-page-ouZIIOwR.js} +1 -1
  69. package/dist/gateway/static/root/assets/{extension-provider-htRLPCBf.js → extension-provider-CJJRG7Gq.js} +1 -1
  70. package/dist/gateway/static/root/assets/{extension-settings-page-CKui11ZQ.js → extension-settings-page-BO8VsTJF.js} +1 -1
  71. package/dist/gateway/static/root/assets/{file-preview-surface-Cwy9Cgaq.js → file-preview-surface-zEJDQWOT.js} +1 -1
  72. package/dist/gateway/static/root/assets/{gateway-config-swr-abWJ0Q_y.js → gateway-config-swr-CNzw8MWj.js} +1 -1
  73. package/dist/gateway/static/root/assets/{gateway-realtime-PYDAppcy.js → gateway-realtime-BCghEC3U.js} +1 -1
  74. package/dist/gateway/static/root/assets/gateway-realtime-store-CQygYU9S.js +1 -0
  75. package/dist/gateway/static/root/assets/{gateway-restart-BtAJNIO-.js → gateway-restart-DaKNDKV9.js} +1 -1
  76. package/dist/gateway/static/root/assets/{gateway-settings-BvD8fcB2.js → gateway-settings-BxBJ1zGZ.js} +1 -1
  77. package/dist/gateway/static/root/assets/{gateway-startup-retry-Cza1BaL8.js → gateway-startup-retry-CSY11ude.js} +1 -1
  78. package/dist/gateway/static/root/assets/{global-defaults-api-BIa73mvy.js → global-defaults-api-C0qPO4zT.js} +1 -1
  79. package/dist/gateway/static/root/assets/home-page-DzSLTEJf.js +8 -0
  80. package/dist/gateway/static/root/assets/{image-generation-api-BCU7Uxyy.js → image-generation-api-CD1tNChr.js} +1 -1
  81. package/dist/gateway/static/root/assets/{imports-page-Clh0polM.js → imports-page-DHWKf1n3.js} +1 -1
  82. package/dist/gateway/static/root/assets/index-B9_yImuQ.css +1 -0
  83. package/dist/gateway/static/root/assets/index-BrXVoLVe.js +11 -0
  84. package/dist/gateway/static/root/assets/{install-connector-dialog-DSkXYsng.js → install-connector-dialog-B3A7BKlp.js} +1 -1
  85. package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-Crf76ecq.js → keyboard-shortcuts-settings-BZaTvMnH.js} +1 -1
  86. package/dist/gateway/static/root/assets/{local-app-workbench-page-WudNXl41.js → local-app-workbench-page-DH1zWMav.js} +1 -1
  87. package/dist/gateway/static/root/assets/{local-apps-page-Br9ZO7Ad.js → local-apps-page-CSnxRVm2.js} +1 -1
  88. package/dist/gateway/static/root/assets/{local-session-drafts-BHrHLZJJ.js → local-session-drafts-CfgBHtlt.js} +1 -1
  89. package/dist/gateway/static/root/assets/{locale-store-5DzxIIeq.js → locale-store-CeEXxDaP.js} +1 -1
  90. package/dist/gateway/static/root/assets/{logs-page-BqUeqzPB.js → logs-page-fF3rKMVM.js} +1 -1
  91. package/dist/gateway/static/root/assets/{management-api-DHCpR1ma.js → management-api-iUbR1cSS.js} +1 -1
  92. package/dist/gateway/static/root/assets/{management-settings-BccKy8tW.js → management-settings-BWJ-4D2j.js} +1 -1
  93. package/dist/gateway/static/root/assets/{markdown-view-BwbjZnQ6.js → markdown-view-BQw7H2MV.js} +1 -1
  94. package/dist/gateway/static/root/assets/{mcp-conversation-setup-page-DxZ-KH6B.js → mcp-conversation-setup-page-CJdg6fgZ.js} +1 -1
  95. package/dist/gateway/static/root/assets/{media-plugins-DissTT0S.js → media-plugins-B_0Q_dY0.js} +1 -1
  96. package/dist/gateway/static/root/assets/{messages-CGGOcV9B.js → messages-L7tv_OPK.js} +2 -2
  97. package/dist/gateway/static/root/assets/{model-selector-DsCLjn_X.js → model-selector-CMsLur91.js} +1 -1
  98. package/dist/gateway/static/root/assets/{models-hub-cache-B0Y9Frop.js → models-hub-cache-DI9vvuFx.js} +1 -1
  99. package/dist/gateway/static/root/assets/{note-detail-panel-DEz8I-eN.js → note-detail-panel-BhJM-EYy.js} +3 -3
  100. package/dist/gateway/static/root/assets/note-image-lightbox-y9OBo4Kv.js +1 -0
  101. package/dist/gateway/static/root/assets/{notes-api-CdC4jVPP.js → notes-api-Ck4Yvy_j.js} +1 -1
  102. package/dist/gateway/static/root/assets/{notes-page-CC5-BWmA.js → notes-page-qellAl3o.js} +1 -1
  103. package/dist/gateway/static/root/assets/{oauth-api-CAPuqZdT.js → oauth-api-3nGo5FdC.js} +1 -1
  104. package/dist/gateway/static/root/assets/{oauth-provider-connect-7i3NoKo4.js → oauth-provider-connect-wtw_Oup3.js} +1 -1
  105. package/dist/gateway/static/root/assets/{page-context-capture-button-BcSfcOme.js → page-context-capture-button-Bm8TI2e0.js} +1 -1
  106. package/dist/gateway/static/root/assets/{page-context-draft-BJ2cY1Us.js → page-context-draft-D7Wh_S2e.js} +1 -1
  107. package/dist/gateway/static/root/assets/{page-header-store-xgXJVGDC.js → page-header-store-hCKJckdJ.js} +1 -1
  108. package/dist/gateway/static/root/assets/{personal-avatar-CidTaDAv.js → personal-avatar-CW6MOp9q.js} +1 -1
  109. package/dist/gateway/static/root/assets/{personal-page-BlxApjBh.js → personal-page-YTJfXUqr.js} +1 -1
  110. package/dist/gateway/static/root/assets/{personal-profile-settings-D1TpPIVg.js → personal-profile-settings-Qn6MR0gu.js} +1 -1
  111. package/dist/gateway/static/root/assets/{personal-settings-panel-BXKSkUoc.js → personal-settings-panel-DgGTnduT.js} +1 -1
  112. package/dist/gateway/static/root/assets/{phone-dependencies-card-_7leySaj.js → phone-dependencies-card-CiLziQ8R.js} +1 -1
  113. package/dist/gateway/static/root/assets/{phone-model-connection-CVI6GGMF.js → phone-model-connection-DjQJIS33.js} +1 -1
  114. package/dist/gateway/static/root/assets/{phone-model-picker-qP1Sh-eA.js → phone-model-picker-BaHl_-yf.js} +1 -1
  115. package/dist/gateway/static/root/assets/{phone-settings-page-BAKOJllx.js → phone-settings-page-DEvyfoAt.js} +1 -1
  116. package/dist/gateway/static/root/assets/{phone-workspace-store-CDtfKAUX.js → phone-workspace-store-9hDVXN9z.js} +1 -1
  117. package/dist/gateway/static/root/assets/{plugin-details-dialog-BpPMZLLz.js → plugin-details-dialog-BI--oe7J.js} +1 -1
  118. package/dist/gateway/static/root/assets/{preference-select-fields-BS-XMhb4.js → preference-select-fields-DAhA9Z56.js} +1 -1
  119. package/dist/gateway/static/root/assets/{preview-runtime-D8kxmrLV.js → preview-runtime-DNxSgx2a.js} +3 -3
  120. package/dist/gateway/static/root/assets/{product-automation-feedback-CDjJlwol.js → product-automation-feedback-ChMWhk-X.js} +1 -1
  121. package/dist/gateway/static/root/assets/{product-open-page-BUqA67HG.js → product-open-page-KyiYh48g.js} +1 -1
  122. package/dist/gateway/static/root/assets/{product-preview-content-CowHxHNk.js → product-preview-content-BSj9eoc8.js} +1 -1
  123. package/dist/gateway/static/root/assets/{product-preview-modal-BJDwL7x3.js → product-preview-modal-DhONFWvj.js} +2 -2
  124. package/dist/gateway/static/root/assets/{project-detail-page-CJQuslC9.js → project-detail-page-DA11E8Iz.js} +1 -1
  125. package/dist/gateway/static/root/assets/{project-understanding-eH4uN6k8.js → project-understanding-DjOdtNHh.js} +1 -1
  126. package/dist/gateway/static/root/assets/{projects-page-DFo_ESE9.js → projects-page-3Y7Bj3vP.js} +1 -1
  127. package/dist/gateway/static/root/assets/{providers-api-Df4w723e.js → providers-api-BKDzcCQr.js} +1 -1
  128. package/dist/gateway/static/root/assets/{recording-upload-DnRi2KQ5.js → recording-upload-Bg_HBFTj.js} +1 -1
  129. package/dist/gateway/static/root/assets/{registry-api-Dw8Ou9VV.js → registry-api-C91pIb6J.js} +1 -1
  130. package/dist/gateway/static/root/assets/{remote-access-hub-B7jGK_WY.js → remote-access-hub-DZjxntjM.js} +1 -1
  131. package/dist/gateway/static/root/assets/{resource-unavailable-CZV8cItD.js → resource-unavailable-D8FrMGjx.js} +1 -1
  132. package/dist/gateway/static/root/assets/{right-workspace-store-DOyKalyG.js → right-workspace-store-D3nQJkDG.js} +1 -1
  133. package/dist/gateway/static/root/assets/route-preload-B_CMsS70.js +2 -0
  134. package/dist/gateway/static/root/assets/routine-panel-BTuii051.js +2 -0
  135. package/dist/gateway/static/root/assets/{runtime-tools-api-2sksjMtE.js → runtime-tools-api-CbVocuF5.js} +1 -1
  136. package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-DPX5htrV.js → runtime-tools-settings-panel-BVcSYWWj.js} +1 -1
  137. package/dist/gateway/static/root/assets/{service-recommendation-list-BnJcjQuF.js → service-recommendation-list-DEIaJSOU.js} +1 -1
  138. package/dist/gateway/static/root/assets/{session-api-CUkWJyfm.js → session-api-M4P3knYu.js} +1 -1
  139. package/dist/gateway/static/root/assets/{session-manager-BRzFtnn4.js → session-manager-DQ0fiEo9.js} +2 -2
  140. package/dist/gateway/static/root/assets/{sessions-page-PjTnKj7l.js → sessions-page-UTEjz3V0.js} +1 -1
  141. package/dist/gateway/static/root/assets/settings-advanced-gate-Cnkvm_q6.js +1 -0
  142. package/dist/gateway/static/root/assets/{settings-advanced-section-Bponzv_k.js → settings-advanced-section-BRNFkPxE.js} +1 -1
  143. package/dist/gateway/static/root/assets/{settings-mode-store-BtgmaA-P.js → settings-mode-store-va_oX_Q8.js} +1 -1
  144. package/dist/gateway/static/root/assets/{settings-page-C1USPFgf.js → settings-page-BVFv8SOp.js} +1 -1
  145. package/dist/gateway/static/root/assets/{settings-page-header-B8nLRdnY.js → settings-page-header-Wx54i9EL.js} +1 -1
  146. package/dist/gateway/static/root/assets/{settings-page-layout-DhOLVJYv.js → settings-page-layout-DDTKMXIb.js} +1 -1
  147. package/dist/gateway/static/root/assets/{setup-interaction-page-CyEO6jAM.js → setup-interaction-page-CaHdjPKk.js} +1 -1
  148. package/dist/gateway/static/root/assets/{setup-status-panel-CNpRqxnq.js → setup-status-panel-D1XJedVC.js} +1 -1
  149. package/dist/gateway/static/root/assets/{share-link-dialog-kZSUpbBN.js → share-link-dialog-C8bVavnr.js} +1 -1
  150. package/dist/gateway/static/root/assets/{share-preview-page-9-aTa7_a.js → share-preview-page-3QEwX9TP.js} +1 -1
  151. package/dist/gateway/static/root/assets/{shares-api-BxQqmxkq.js → shares-api-Dp6g-bfj.js} +1 -1
  152. package/dist/gateway/static/root/assets/{shares-settings-DoMMw8Ud.js → shares-settings-BbxnfBhc.js} +1 -1
  153. package/dist/gateway/static/root/assets/{skill-api-V3Y6pTog.js → skill-api-BTiymSB8.js} +1 -1
  154. package/dist/gateway/static/root/assets/{skill-list-api-BSHfM0qb.js → skill-list-api-BM8u0Bs_.js} +1 -1
  155. package/dist/gateway/static/root/assets/{skill-reload-api-Dq3F9pqP.js → skill-reload-api-BP2ecrz2.js} +1 -1
  156. package/dist/gateway/static/root/assets/{skills-page-DGWy1Jns.js → skills-page-DTrONo3c.js} +1 -1
  157. package/dist/gateway/static/root/assets/{space-api-BkXqM2MT.js → space-api-Ix7mfZDi.js} +1 -1
  158. package/dist/gateway/static/root/assets/space-page-Dpy0BPbT.js +2 -0
  159. package/dist/gateway/static/root/assets/{space-workbook-7S_FfalA.js → space-workbook-CxV64kNP.js} +1 -1
  160. package/dist/gateway/static/root/assets/{system-settings-panel-DSmwwU8o.js → system-settings-panel-C2BWOeNW.js} +1 -1
  161. package/dist/gateway/static/root/assets/task-detail-page-DqgGOX0M.js +3 -0
  162. package/dist/gateway/static/root/assets/{task-header-title-DAwu5vni.js → task-header-title-Di5TvRaj.js} +1 -1
  163. package/dist/gateway/static/root/assets/task-run-issue-notice-FMMn1lE6.js +1 -0
  164. package/dist/gateway/static/root/assets/{terminal-panel-store-IpKmyQVN.js → terminal-panel-store-mDqqa0EW.js} +1 -1
  165. package/dist/gateway/static/root/assets/{theme-store-B75oCec7.js → theme-store-kQ-dt8qP.js} +1 -1
  166. package/dist/gateway/static/root/assets/{tracing-settings-page-CVj7aLAl.js → tracing-settings-page-BYAYhuS8.js} +1 -1
  167. package/dist/gateway/static/root/assets/{tunnel-api-TWW8dGwO.js → tunnel-api-XScou7Y8.js} +1 -1
  168. package/dist/gateway/static/root/assets/{understanding-activity-store-NgjWPD55.js → understanding-activity-store-NVT8M3Rv.js} +1 -1
  169. package/dist/gateway/static/root/assets/{understanding-refresh-store-CN-7T5G5.js → understanding-refresh-store-D5pgGLiW.js} +1 -1
  170. package/dist/gateway/static/root/assets/{usage-page-D6mzQviK.js → usage-page-CWMg8m0Q.js} +1 -1
  171. package/dist/gateway/static/root/assets/{use-autosave-BYtW_pgF.js → use-autosave-Iy9pO3fa.js} +1 -1
  172. package/dist/gateway/static/root/assets/{use-composer-attachments-Dn6X6xAP.js → use-composer-attachments-DfSh4D1i.js} +1 -1
  173. package/dist/gateway/static/root/assets/{use-file-preview-expanded-BT0pss9g.js → use-file-preview-expanded-BFw8CA51.js} +1 -1
  174. package/dist/gateway/static/root/assets/{use-generated-media-CuhMqXFp.js → use-generated-media-MuDDqdB3.js} +1 -1
  175. package/dist/gateway/static/root/assets/{use-personal-profile-DxE21oPS.js → use-personal-profile-Csm85ZFS.js} +1 -1
  176. package/dist/gateway/static/root/assets/{use-personal-work-j8AH0g9w.js → use-personal-work-CVmHKsJn.js} +1 -1
  177. package/dist/gateway/static/root/assets/{use-realtime-voice-CNG2yeaO.js → use-realtime-voice-D1zQbDnk.js} +1 -1
  178. package/dist/gateway/static/root/assets/{use-workspace-tree-BohZkOOW.js → use-workspace-tree-B_do34-j.js} +1 -1
  179. package/dist/gateway/static/root/assets/{user-model-page-Dlm-Mmo4.js → user-model-page-BlBvDtwt.js} +1 -1
  180. package/dist/gateway/static/root/assets/{voice-api-key-field-D_o-xx9v.js → voice-api-key-field-DRlguUPt.js} +1 -1
  181. package/dist/gateway/static/root/assets/{voice-config-api-BX2Q9Cgb.js → voice-config-api-B2AO_uL_.js} +1 -1
  182. package/dist/gateway/static/root/assets/{voice-input-shortcut-events-qbqLMfW_.js → voice-input-shortcut-events-jLnl_86X.js} +1 -1
  183. package/dist/gateway/static/root/assets/{voice-player-store-z-upb7lD.js → voice-player-store-C8BTMBVX.js} +1 -1
  184. package/dist/gateway/static/root/assets/{voice-settings-BEhihzNq.js → voice-settings-D8Snr-5R.js} +1 -1
  185. package/dist/gateway/static/root/assets/{work-discovery-overlay-ClPiLw1F.js → work-discovery-overlay-C0oaToAM.js} +1 -1
  186. package/dist/gateway/static/root/assets/{work-discovery-page-BohjMx1A.js → work-discovery-page-IEKvSp0W.js} +1 -1
  187. package/dist/gateway/static/root/assets/{working-directory-picker-modal-CcD0smT0.js → working-directory-picker-modal-ppDpY-AP.js} +1 -1
  188. package/dist/gateway/static/root/assets/{workspace-api-Bpq_rBZM.js → workspace-api-C85sEgvX.js} +2 -2
  189. package/dist/gateway/static/root/assets/workspace-editor-agent-store-CNPlB8xY.js +1 -0
  190. package/dist/gateway/static/root/assets/{workspace-file-preview-dialog-BjJEOajj.js → workspace-file-preview-dialog-DGsFnZh-.js} +1 -1
  191. package/dist/gateway/static/root/assets/{workspace-open-location-menu-Bc8qK8WA.js → workspace-open-location-menu-CGe_tu1_.js} +1 -1
  192. package/dist/gateway/static/root/assets/{workspace-preview-store-QUX-jyAL.js → workspace-preview-store-D8eGmciG.js} +1 -1
  193. package/dist/gateway/static/root/assets/{xopc-cloud-account-card-BWdmU4iy.js → xopc-cloud-account-card-L-HD-Zf7.js} +1 -1
  194. package/dist/gateway/static/root/index.html +95 -94
  195. package/dist/package.js +1 -1
  196. package/dist/src/activity/emitter.js +1 -1
  197. package/dist/src/activity/index.js +1 -1
  198. package/dist/src/agent/agent-manager.js +6 -6
  199. package/dist/src/agent/agent-scope.js +1 -1
  200. package/dist/src/agent/background-review/run-background-review.js +1 -1
  201. package/dist/src/agent/bootstrap/load-bootstrap-files.js +1 -1
  202. package/dist/src/agent/coding/repository-instructions.js +1 -1
  203. package/dist/src/agent/coding/workspace-revision.js +2 -2
  204. package/dist/src/agent/commands/command-registry.js +3 -3
  205. package/dist/src/agent/commands/commandMounts.js +1 -1
  206. package/dist/src/agent/context/workspace-seed.js +2 -2
  207. package/dist/src/agent/context/workspace-state.js +1 -1
  208. package/dist/src/agent/data-acquisition/service.js +1 -1
  209. package/dist/src/agent/embedded/codemode-output.js +4 -4
  210. package/dist/src/agent/embedded/run-for-session.js +2 -2
  211. package/dist/src/agent/embedded/run-turn.js +1 -1
  212. package/dist/src/agent/embedded/session-runner.js +1 -1
  213. package/dist/src/agent/external-tools/cliProvider.js +2 -2
  214. package/dist/src/agent/external-tools/composio-provider.js +1 -1
  215. package/dist/src/agent/image/load-image-media.js +2 -2
  216. package/dist/src/agent/mcp/connection-drafts.d.ts +1 -1
  217. package/dist/src/agent/mcp/connection-drafts.js +15 -2
  218. package/dist/src/agent/mcp/native-mcp.js +1 -1
  219. package/dist/src/agent/memory/compaction.js +1 -1
  220. package/dist/src/agent/memory/plugin-discovery.js +1 -1
  221. package/dist/src/agent/prompt/response-language.js +1 -1
  222. package/dist/src/agent/reply/post-compaction-context.js +1 -1
  223. package/dist/src/agent/reply/workspace-boundary-read.js +1 -1
  224. package/dist/src/agent/sandbox/fileAccess.js +1 -1
  225. package/dist/src/agent/sandbox/native-command.js +1 -1
  226. package/dist/src/agent/sandbox/path-policy.js +2 -2
  227. package/dist/src/agent/service/process-direct-streaming.js +2 -2
  228. package/dist/src/agent/service.js +1 -1
  229. package/dist/src/agent/skills/config.js +1 -1
  230. package/dist/src/agent/skills/hub-hash.js +2 -2
  231. package/dist/src/agent/skills/hub-pull.js +4 -4
  232. package/dist/src/agent/skills/managed-store.js +1 -1
  233. package/dist/src/agent/skills/skill-sources.js +2 -2
  234. package/dist/src/agent/starter-agents.js +1 -1
  235. package/dist/src/agent/tasks/task-judge-service.js +1 -1
  236. package/dist/src/agent/tools/create-share-tool.js +1 -1
  237. package/dist/src/agent/tools/factory.js +1 -1
  238. package/dist/src/agent/tools/image-generate-tool.js +1 -1
  239. package/dist/src/agent/tools/personal-memory-tool.js +1 -1
  240. package/dist/src/agent/tools/review-workspace.js +1 -1
  241. package/dist/src/agent/tools/scoped-workspace-tools.js +2 -2
  242. package/dist/src/agent/tools/task-collaboration-tool.js +1 -1
  243. package/dist/src/agent/tools/tool-media.js +1 -1
  244. package/dist/src/agent/tools/xopc-use-tool.js +3 -3
  245. package/dist/src/agent-catalog/repository.js +1 -1
  246. package/dist/src/agent-catalog/service.js +1 -1
  247. package/dist/src/auth/credentials.js +1 -1
  248. package/dist/src/auth/oauth/openai.js +1 -1
  249. package/dist/src/auth/oauth/xopc-cloud.js +1 -1
  250. package/dist/src/auth/oauth-provider-lock.js +2 -2
  251. package/dist/src/auth/profiles/store.js +1 -1
  252. package/dist/src/automations/service/action-executor.js +1 -1
  253. package/dist/src/automations/service/automation-service.js +1 -1
  254. package/dist/src/backup/archive.js +5 -5
  255. package/dist/src/browser/cache-dir-policy.js +1 -1
  256. package/dist/src/browser/native-messaging-host.js +1 -1
  257. package/dist/src/browser/providers/browser-ext-install.js +7 -7
  258. package/dist/src/browser/providers/playwright-doctor.js +2 -2
  259. package/dist/src/browser/runtime/browser-runtime.js +1 -1
  260. package/dist/src/capabilities/capability-catalog.js +1 -1
  261. package/dist/src/channels/catalog/channel-catalog-service.js +1 -1
  262. package/dist/src/channels/pairing/allow-from-file.js +1 -1
  263. package/dist/src/channels/pairing/pairing-store.js +2 -2
  264. package/dist/src/cli/commands/doctor/checks/config-health.js +1 -1
  265. package/dist/src/cli/commands/doctor/checks/database-schema.js +2 -2
  266. package/dist/src/cli/commands/doctor/checks/state-integrity.js +1 -1
  267. package/dist/src/cli/commands/doctor/checks/workspace-status.js +1 -1
  268. package/dist/src/cli/commands/extension-agent-plugin.js +1 -1
  269. package/dist/src/cli/commands/extension-create.js +1 -1
  270. package/dist/src/cli/commands/extension-dev.js +1 -1
  271. package/dist/src/cli/commands/extension-marketplace.js +2 -2
  272. package/dist/src/cli/commands/extension-pack.js +3 -3
  273. package/dist/src/cli/commands/extension.js +1 -1
  274. package/dist/src/cli/commands/gateway/logs.js +1 -1
  275. package/dist/src/cli/commands/gateway/shared.js +1 -1
  276. package/dist/src/cli/commands/mcp.js +1 -1
  277. package/dist/src/cli/utils/init-workspace-core.js +2 -2
  278. package/dist/src/config/config-file.js +1 -1
  279. package/dist/src/config/loader.js +1 -1
  280. package/dist/src/config/models-json.js +1 -1
  281. package/dist/src/config/paths-state.js +1 -1
  282. package/dist/src/config/workspace-path.js +1 -1
  283. package/dist/src/connectors/cli/assets.js +1 -1
  284. package/dist/src/connectors/cli/installer.js +3 -3
  285. package/dist/src/connectors/connected-source-ingestion.js +1 -1
  286. package/dist/src/connectors/content-enrichment.js +2 -2
  287. package/dist/src/connectors/plugin-connection.js +1 -1
  288. package/dist/src/daemon/constants.js +1 -1
  289. package/dist/src/daemon/install-plan.js +2 -2
  290. package/dist/src/daemon/launchd.js +3 -3
  291. package/dist/src/daemon/schtasks.js +2 -2
  292. package/dist/src/daemon/systemd.js +3 -3
  293. package/dist/src/discussions/action-tasks.js +1 -1
  294. package/dist/src/discussions/live-worker.js +1 -1
  295. package/dist/src/discussions/recording.js +3 -3
  296. package/dist/src/discussions/repository.js +1 -1
  297. package/dist/src/discussions/sealer.js +2 -2
  298. package/dist/src/discussions/service.js +1 -1
  299. package/dist/src/endpoint-tools/bridge-host.js +1 -1
  300. package/dist/src/endpoint-tools/delegation.js +1 -1
  301. package/dist/src/endpoint-tools/provider-operation-journal.js +1 -1
  302. package/dist/src/endpoint-tools/runtime.js +1 -1
  303. package/dist/src/endpoint-tools/upload-service.js +2 -2
  304. package/dist/src/execution-environments/local-worktree-manager.js +3 -3
  305. package/dist/src/execution-environments/store.js +1 -1
  306. package/dist/src/execution-environments/worktree-safety.js +1 -1
  307. package/dist/src/extensions/agent-plugins/auth.js +2 -2
  308. package/dist/src/extensions/agent-plugins/branding.js +2 -2
  309. package/dist/src/extensions/agent-plugins/capability-access.js +1 -1
  310. package/dist/src/extensions/agent-plugins/cli-authorization.js +3 -3
  311. package/dist/src/extensions/agent-plugins/contained-path.js +1 -1
  312. package/dist/src/extensions/agent-plugins/credentials.js +1 -1
  313. package/dist/src/extensions/agent-plugins/formats.js +1 -1
  314. package/dist/src/extensions/agent-plugins/inventory.js +1 -1
  315. package/dist/src/extensions/agent-plugins/mcp-adapter.js +3 -3
  316. package/dist/src/extensions/agent-plugins/resources.js +2 -2
  317. package/dist/src/extensions/agent-plugins/setup.js +4 -4
  318. package/dist/src/extensions/agent-plugins/skill-catalog.js +1 -1
  319. package/dist/src/extensions/agent-plugins/source-catalog.js +3 -3
  320. package/dist/src/extensions/agent-plugins/sources.js +2 -2
  321. package/dist/src/extensions/agent-plugins/store.js +5 -5
  322. package/dist/src/extensions/agent-plugins/user-config.js +2 -2
  323. package/dist/src/extensions/agent-plugins/validation.js +2 -2
  324. package/dist/src/extensions/connector-dependencies.js +1 -1
  325. package/dist/src/extensions/install-transaction.js +1 -1
  326. package/dist/src/extensions/install.js +1 -1
  327. package/dist/src/extensions/loader.js +1 -1
  328. package/dist/src/extensions/lockfile.js +1 -1
  329. package/dist/src/extensions/update.js +2 -2
  330. package/dist/src/files/file-service.js +4 -4
  331. package/dist/src/files/file-versions.js +1 -1
  332. package/dist/src/gateway/file-path-classifier.js +1 -1
  333. package/dist/src/gateway/hono/lib/static-ui.js +2 -2
  334. package/dist/src/gateway/hono/routes/auth-registry-extensions.js +1 -1
  335. package/dist/src/gateway/hono/routes/browser.js +1 -1
  336. package/dist/src/gateway/hono/routes/connectors.js +1 -1
  337. package/dist/src/gateway/hono/routes/extension-ui-assets.js +1 -1
  338. package/dist/src/gateway/hono/routes/host-fs.js +1 -1
  339. package/dist/src/gateway/hono/routes/local-apps.js +2 -2
  340. package/dist/src/gateway/hono/routes/location-sharing.js +1 -1
  341. package/dist/src/gateway/hono/routes/memory-learning.js +1 -1
  342. package/dist/src/gateway/hono/routes/mobile-capability-panels.d.ts +3 -1
  343. package/dist/src/gateway/hono/routes/mobile-capability-panels.js +121 -44
  344. package/dist/src/gateway/hono/routes/notes.js +1 -1
  345. package/dist/src/gateway/hono/routes/personal-agent.js +1 -1
  346. package/dist/src/gateway/hono/routes/phone-setup.js +1 -1
  347. package/dist/src/gateway/hono/routes/phone.js +1 -1
  348. package/dist/src/gateway/hono/routes/projects.js +2 -2
  349. package/dist/src/gateway/hono/routes/provider-setup.js +1 -1
  350. package/dist/src/gateway/hono/routes/sessions.js +1 -1
  351. package/dist/src/gateway/hono/routes/shares.js +2 -2
  352. package/dist/src/gateway/hono/routes/tasks.js +1 -1
  353. package/dist/src/gateway/hono/routes/video-generation.js +1 -1
  354. package/dist/src/gateway/lock.js +2 -2
  355. package/dist/src/gateway/next-turn-suggestions/snapshot.js +1 -1
  356. package/dist/src/gateway/security/device-request-proof.js +1 -1
  357. package/dist/src/gateway/security/phone-access.js +1 -1
  358. package/dist/src/gateway/service/agent-runner.js +1 -1
  359. package/dist/src/gateway/service/session-input-coordinator.js +1 -1
  360. package/dist/src/gateway/service.js +4 -4
  361. package/dist/src/gateway/session-context-summary.js +1 -1
  362. package/dist/src/gateway/workspace-editor-path.js +1 -1
  363. package/dist/src/gateway/xopc-cloud-capability-setup.js +1 -1
  364. package/dist/src/home-intelligence/follow-ups.js +1 -1
  365. package/dist/src/home-intelligence/host.js +1 -1
  366. package/dist/src/home-intelligence/repository.js +1 -1
  367. package/dist/src/home-intelligence/routines.js +1 -1
  368. package/dist/src/imports/files.js +3 -3
  369. package/dist/src/imports/importService.js +3 -3
  370. package/dist/src/imports/inventory.js +2 -2
  371. package/dist/src/imports/planner.js +2 -2
  372. package/dist/src/imports/productImport.js +1 -1
  373. package/dist/src/imports/scanner.js +2 -2
  374. package/dist/src/imports/sources.js +2 -2
  375. package/dist/src/infra/brew.js +1 -1
  376. package/dist/src/infra/package-runtime-check.js +2 -2
  377. package/dist/src/infra/path-env.js +2 -2
  378. package/dist/src/infra/process-diagnostics.js +1 -1
  379. package/dist/src/infra/restart.js +1 -1
  380. package/dist/src/infra/update-check.js +1 -1
  381. package/dist/src/infra/update-global.js +1 -1
  382. package/dist/src/infra/update-lock.js +1 -1
  383. package/dist/src/infra/update-startup.js +1 -1
  384. package/dist/src/infra/write-file-atomic.js +2 -2
  385. package/dist/src/knowledge/local-folder-adapter.js +1 -1
  386. package/dist/src/local-apps/acceptance.js +1 -1
  387. package/dist/src/local-apps/artifact-files.js +2 -2
  388. package/dist/src/local-apps/execution-authority.js +1 -1
  389. package/dist/src/local-apps/p1-services.js +3 -3
  390. package/dist/src/local-apps/preview-fixtures.js +1 -1
  391. package/dist/src/local-apps/preview-sessions.js +2 -2
  392. package/dist/src/local-apps/preview-worker.js +2 -2
  393. package/dist/src/local-apps/public-assets.js +2 -2
  394. package/dist/src/local-apps/scaffold.js +1 -1
  395. package/dist/src/local-apps/service.js +5 -5
  396. package/dist/src/local-apps/snapshot-store.js +1 -1
  397. package/dist/src/local-apps/store.js +1 -1
  398. package/dist/src/media/session-references.js +1 -1
  399. package/dist/src/media/store.js +1 -1
  400. package/dist/src/memory-learning/source-learning.js +1 -1
  401. package/dist/src/memory-learning/task-receipts.js +1 -1
  402. package/dist/src/migrations/runner.js +1 -1
  403. package/dist/src/music-generation/artifact.js +2 -2
  404. package/dist/src/notes/capabilities/write.js +1 -1
  405. package/dist/src/notes/service.js +2 -2
  406. package/dist/src/notes/store.js +2 -2
  407. package/dist/src/notifications/harmony-push.js +1 -1
  408. package/dist/src/notifications/store.js +1 -1
  409. package/dist/src/observability/store.js +1 -1
  410. package/dist/src/personal-agent/proactivity/repository.js +1 -1
  411. package/dist/src/personal-agent/proactivity/service.js +2 -2
  412. package/dist/src/personal-agent/reply-composer.js +3 -3
  413. package/dist/src/personal-agent/request-delivery.js +1 -1
  414. package/dist/src/personal-agent/request-service.js +1 -1
  415. package/dist/src/personal-agent/result-reader.js +3 -3
  416. package/dist/src/personal-agent/unread.js +1 -1
  417. package/dist/src/pets/factory.js +1 -1
  418. package/dist/src/pets/validator.js +1 -1
  419. package/dist/src/phone/adb-driver.js +3 -3
  420. package/dist/src/phone/assistance-service.js +1 -1
  421. package/dist/src/phone/assistance.js +1 -1
  422. package/dist/src/phone/cloud-adb-connection.js +1 -1
  423. package/dist/src/phone/execution-trace.js +1 -1
  424. package/dist/src/phone/hdc-driver.js +3 -3
  425. package/dist/src/phone/hdc-video-tools.js +2 -2
  426. package/dist/src/phone/location-baseline-store.js +1 -1
  427. package/dist/src/phone/location-environment.js +1 -1
  428. package/dist/src/phone/repository.js +1 -1
  429. package/dist/src/phone/ui-session.js +2 -2
  430. package/dist/src/project-trust/trust-store.js +2 -2
  431. package/dist/src/projects/project-kind.js +1 -1
  432. package/dist/src/projects/project-service.js +1 -1
  433. package/dist/src/projects/project-skill-service.js +1 -1
  434. package/dist/src/projects/workspace-project.js +2 -2
  435. package/dist/src/providers/auth-runtime/auth-profile-store.js +1 -1
  436. package/dist/src/providers/model-catalog-persistence.js +1 -1
  437. package/dist/src/providers/xopc-cloud-credit-budget.js +1 -1
  438. package/dist/src/runtime-tools/archive.js +2 -2
  439. package/dist/src/runtime-tools/downloader.js +2 -2
  440. package/dist/src/runtime-tools/harmony-dependencies.js +1 -1
  441. package/dist/src/runtime-tools/manager.js +1 -1
  442. package/dist/src/runtime-tools/manifest-store.js +1 -1
  443. package/dist/src/runtime-tools/phone-dependencies.js +1 -1
  444. package/dist/src/session/init-session-turn.js +1 -1
  445. package/dist/src/session/resolve-session.js +1 -1
  446. package/dist/src/share/hosted-note-publication.js +1 -1
  447. package/dist/src/share/hosted-session-share.js +2 -2
  448. package/dist/src/share/hosted-static-site-publication.js +2 -2
  449. package/dist/src/share/note-share-service.js +1 -1
  450. package/dist/src/share/session-share-service.js +2 -2
  451. package/dist/src/share/share-auto.js +2 -2
  452. package/dist/src/share/share-store.js +2 -2
  453. package/dist/src/share/share-zip.js +1 -1
  454. package/dist/src/share/site-share-store.js +1 -1
  455. package/dist/src/share/site-static-serve.js +1 -1
  456. package/dist/src/space/budget-workbook.js +1 -1
  457. package/dist/src/space/ingest.js +1 -1
  458. package/dist/src/space/repository.js +3 -3
  459. package/dist/src/space/workbook-turn.js +1 -1
  460. package/dist/src/space/worker.js +1 -1
  461. package/dist/src/storage/sqlite/ai-usage-repository.js +1 -1
  462. package/dist/src/storage/sqlite/clarification-wait-repository.js +2 -2
  463. package/dist/src/storage/sqlite/connection.js +3 -3
  464. package/dist/src/storage/sqlite/conversation-repository.js +2 -2
  465. package/dist/src/storage/sqlite/desktop-execution-repository.js +1 -1
  466. package/dist/src/storage/sqlite/desktop-execution-stop-repository.js +1 -1
  467. package/dist/src/storage/sqlite/device-access-repository.js +1 -1
  468. package/dist/src/storage/sqlite/device-pairing-approval.js +1 -1
  469. package/dist/src/storage/sqlite/index.js +1 -1
  470. package/dist/src/storage/sqlite/offline-access.js +1 -1
  471. package/dist/src/storage/sqlite/schema-upgrade.js +3 -3
  472. package/dist/src/storage/sqlite/session-creation-repository.js +1 -1
  473. package/dist/src/storage/sqlite/session-input-control-repository.js +1 -1
  474. package/dist/src/storage/sqlite/session-repository.js +1 -1
  475. package/dist/src/storage/sqlite/sql-assets.js +1 -1
  476. package/dist/src/storage/sqlite/windows-database-owners.js +1 -1
  477. package/dist/src/tasks/capabilities/management.js +1 -1
  478. package/dist/src/tasks/capabilities/relations.js +1 -1
  479. package/dist/src/tasks/task-allocation-service.js +2 -2
  480. package/dist/src/tasks/task-application-service.js +1 -1
  481. package/dist/src/tasks/task-context-assembler.js +2 -2
  482. package/dist/src/tasks/task-criterion-review-repository.js +1 -1
  483. package/dist/src/tasks/task-deliverables.js +1 -1
  484. package/dist/src/tasks/task-handoff-service.js +1 -1
  485. package/dist/src/tasks/task-handoff.js +8 -8
  486. package/dist/src/tasks/task-json-acceptance.js +2 -2
  487. package/dist/src/tasks/task-research-repair.js +2 -2
  488. package/dist/src/tasks/task-research-result.js +2 -2
  489. package/dist/src/tasks/task-result-delivery-repository.js +1 -1
  490. package/dist/src/tasks/task-result-delivery-service.js +2 -2
  491. package/dist/src/tasks/task-run-coordinator.js +2 -2
  492. package/dist/src/tasks/task-run-repository.js +1 -1
  493. package/dist/src/tasks/task-signal-service.js +1 -1
  494. package/dist/src/tasks/task-workspace-verification.js +3 -3
  495. package/dist/src/tui/backends/embedded-backend.js +5 -5
  496. package/dist/src/tui/backends/embedded-drafts.js +2 -2
  497. package/dist/src/tui/backends/gateway-realtime-backend.js +1 -1
  498. package/dist/src/tui/clipboard-image.js +3 -3
  499. package/dist/src/tui/theme-manager.js +1 -1
  500. package/dist/src/tui/tui-command-formatters.js +1 -1
  501. package/dist/src/tui/tui-commands.js +1 -1
  502. package/dist/src/tui/tui-keybindings-file.js +1 -1
  503. package/dist/src/tui/tui-scoped-models.js +1 -1
  504. package/dist/src/tui/tui-settings.js +1 -1
  505. package/dist/src/tui/tui.js +3 -3
  506. package/dist/src/tunnel/frpc-binary.js +2 -2
  507. package/dist/src/tunnel/frpc-config.js +1 -1
  508. package/dist/src/tunnel/frpc-extract.js +2 -2
  509. package/dist/src/tunnel/tunnel-state.js +1 -1
  510. package/dist/src/user-context/access-policy.js +1 -1
  511. package/dist/src/user-context/changes.d.ts +1 -1
  512. package/dist/src/user-model/repository.js +1 -1
  513. package/dist/src/utils/index.js +1 -1
  514. package/dist/src/utils/logger/index.js +1 -1
  515. package/dist/src/utils/logger.js +1 -1
  516. package/dist/src/video-generation/artifact.js +2 -2
  517. package/dist/src/video-generation/repository.js +1 -1
  518. package/dist/src/voice/audio/normalize.js +2 -2
  519. package/dist/src/voice/realtime/memory-context.d.ts +1 -1
  520. package/dist/src/voice/realtime/memory-context.js +12 -10
  521. package/dist/src/voice/realtime/omniEngine.js +32 -12
  522. package/dist/src/voice/realtime/omniRoute.js +1 -1
  523. package/dist/src/voice/realtime/persona-context.js +1 -1
  524. package/dist/src/voice/realtime/runtime.js +16 -12
  525. package/dist/src/voice/tts/providers/edge-speech.js +2 -2
  526. package/dist/src/work-discovery/candidate-discovery.js +3 -3
  527. package/dist/src/work-discovery/probe.js +4 -4
  528. package/dist/src/work-discovery/service.js +2 -2
  529. package/package.json +2 -2
  530. package/dist/gateway/static/root/assets/capabilities-settings-panel-9lLzGQ-F.js +0 -8
  531. package/dist/gateway/static/root/assets/connected-providers-grid-ds0J-7Qc.js +0 -1
  532. package/dist/gateway/static/root/assets/gateway-realtime-store-DTcS5Hqk.js +0 -1
  533. package/dist/gateway/static/root/assets/home-page-CwUc6499.js +0 -8
  534. package/dist/gateway/static/root/assets/index-BWJ0tePz.js +0 -11
  535. package/dist/gateway/static/root/assets/index-C-4H3NhI.css +0 -1
  536. package/dist/gateway/static/root/assets/note-image-lightbox-D-7a_BCN.js +0 -1
  537. package/dist/gateway/static/root/assets/route-preload-N7Ieq1wB.js +0 -2
  538. package/dist/gateway/static/root/assets/routine-panel-BvBR3khG.js +0 -2
  539. package/dist/gateway/static/root/assets/settings-advanced-gate-JrndQtAT.js +0 -1
  540. package/dist/gateway/static/root/assets/space-page-BAp28k1I.js +0 -2
  541. package/dist/gateway/static/root/assets/task-detail-page-15Qm8kNq.js +0 -3
  542. package/dist/gateway/static/root/assets/task-result-evidence-BqAt23uk.js +0 -1
  543. package/dist/gateway/static/root/assets/workspace-editor-agent-store-BkCt8mdN.js +0 -1
@@ -1,4 +1,4 @@
1
- import{i as e,t}from"./rolldown-runtime-aKtaBQYM.js";import{a as n,i as r,r as i,t as a}from"./vendor-react-BOUWij0V.js";import{t as o}from"./preload-helper-Czpn1I53.js";import{l as s}from"./chunk-KS7C4IRE-DIIvxCDx.js";import{S as c,a as l,c as u,d,i as f,l as p,n as m,o as h,r as g,s as _,t as v,u as y,y as b}from"./es2015-CFqg57eW.js";import{i as x}from"./dist-CDSvxjOh.js";import{a as S,o as C,r as w,t as T}from"./dist-DlirbHVs.js";import{t as E}from"./copy-Dv6d4Dvw.js";import{r as D}from"./bundle-mjs-rHxsej31.js";import{t as O}from"./skeleton-DzdOeGYz.js";import{c as ee,h as te,s as ne,t as re}from"./space-api-BkXqM2MT.js";import{f as ie,g as ae,h as oe,m as se,p as ce,r as le}from"./floating-ui.dom-CiMnRY5O.js";import{a as ue,c as de,i as fe,n as pe,o as me,r as he,s as ge,t as _e}from"./floating-ui.react-dom-Gx6CM22l.js";import{i as ve}from"./theme-store-B75oCec7.js";function ye(e){return typeof e==`function`}function be(e){var t=e(function(e){Error.call(e),e.stack=Error().stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var xe=be(function(e){return function(t){e(this),this.message=t?t.length+` errors occurred during unsubscription:
1
+ import{i as e,t}from"./rolldown-runtime-aKtaBQYM.js";import{a as n,i as r,r as i,t as a}from"./vendor-react-BOUWij0V.js";import{t as o}from"./preload-helper-Czpn1I53.js";import{l as s}from"./chunk-KS7C4IRE-DIIvxCDx.js";import{S as c,a as l,c as u,d,i as f,l as p,n as m,o as h,r as g,s as _,t as v,u as y,y as b}from"./es2015-CFqg57eW.js";import{i as x}from"./dist-CDSvxjOh.js";import{a as S,o as C,r as w,t as T}from"./dist-DlirbHVs.js";import{t as E}from"./copy-Dv6d4Dvw.js";import{r as D}from"./bundle-mjs-rHxsej31.js";import{t as O}from"./skeleton-DzdOeGYz.js";import{c as ee,h as te,s as ne,t as re}from"./space-api-Ix7mfZDi.js";import{f as ie,g as ae,h as oe,m as se,p as ce,r as le}from"./floating-ui.dom-CiMnRY5O.js";import{a as ue,c as de,i as fe,n as pe,o as me,r as he,s as ge,t as _e}from"./floating-ui.react-dom-Gx6CM22l.js";import{i as ve}from"./theme-store-kQ-dt8qP.js";function ye(e){return typeof e==`function`}function be(e){var t=e(function(e){Error.call(e),e.stack=Error().stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var xe=be(function(e){return function(t){e(this),this.message=t?t.length+` errors occurred during unsubscription:
2
2
  `+t.map(function(e,t){return t+1+`) `+e.toString()}).join(`
3
3
  `):``,this.name=`UnsubscriptionError`,this.errors=t}});function Se(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var Ce=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var e,t,n,r,i;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var o=d(a),s=o.next();!s.done;s=o.next())s.value.remove(this)}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}else a.remove(this);var c=this.initialTeardown;if(ye(c))try{c()}catch(e){i=e instanceof xe?e.errors:[e]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var u=d(l),f=u.next();!f.done;f=u.next()){var m=f.value;try{Ee(m)}catch(e){i??=[],e instanceof xe?i=y(y([],p(i)),p(e.errors)):i.push(e)}}}catch(e){n={error:e}}finally{try{f&&!f.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}if(i)throw new xe(i)}},e.prototype.add=function(t){if(t&&t!==this)if(this.closed)Ee(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=this._finalizers??[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&Se(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&Se(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e}(),we=Ce.EMPTY;function Te(e){return e instanceof Ce||e&&`closed`in e&&ye(e.remove)&&ye(e.add)&&ye(e.unsubscribe)}function Ee(e){ye(e)?e():e.unsubscribe()}var De={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Oe={setTimeout:function(e,t){var n=[...arguments].slice(2),r=Oe.delegate;return r?.setTimeout?r.setTimeout.apply(r,y([e,t],p(n))):setTimeout.apply(void 0,y([e,t],p(n)))},clearTimeout:function(e){return(Oe.delegate?.clearTimeout||clearTimeout)(e)},delegate:void 0};function ke(e){Oe.setTimeout(function(){var t=De.onUnhandledError;if(t)t(e);else throw e})}function Ae(){}var je=(function(){return Pe(`C`,void 0,void 0)})();function Me(e){return Pe(`E`,void 0,e)}function Ne(e){return Pe(`N`,e,void 0)}function Pe(e,t,n){return{kind:e,value:t,error:n}}var Fe=null;function Ie(e){if(De.useDeprecatedSynchronousErrorHandling){var t=!Fe;if(t&&(Fe={errorThrown:!1,error:null}),e(),t){var n=Fe,r=n.errorThrown,i=n.error;if(Fe=null,r)throw i}}else e()}function Le(e){De.useDeprecatedSynchronousErrorHandling&&Fe&&(Fe.errorThrown=!0,Fe.error=e)}var Re=function(e){_(t,e);function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,Te(t)&&t.add(n)):n.destination=Ke,n}return t.create=function(e,t,n){return new He(e,t,n)},t.prototype.next=function(e){this.isStopped?Ge(Ne(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?Ge(Me(e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?Ge(je,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(Ce),ze=Function.prototype.bind;function Be(e,t){return ze.call(e,t)}var Ve=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){Ue(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){Ue(e)}else Ue(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){Ue(e)}},e}(),He=function(e){_(t,e);function t(t,n,r){var i=e.call(this)||this,a;if(ye(t)||!t)a={next:t??void 0,error:n??void 0,complete:r??void 0};else{var o;i&&De.useDeprecatedNextContext?(o=Object.create(t),o.unsubscribe=function(){return i.unsubscribe()},a={next:t.next&&Be(t.next,o),error:t.error&&Be(t.error,o),complete:t.complete&&Be(t.complete,o)}):a=t}return i.destination=new Ve(a),i}return t}(Re);function Ue(e){De.useDeprecatedSynchronousErrorHandling?Le(e):ke(e)}function We(e){throw e}function Ge(e,t){var n=De.onStoppedNotification;n&&Oe.setTimeout(function(){return n(e,t)})}var Ke={closed:!0,next:Ae,error:We,complete:Ae},qe=(function(){return typeof Symbol==`function`&&Symbol.observable||`@@observable`})();function Je(e){return e}function Ye(){return Xe([...arguments])}function Xe(e){return e.length===0?Je:e.length===1?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)}}var Ze=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r=this,i=eee(e)?e:new He(e,t,n);return Ie(function(){var e=r,t=e.operator,n=e.source;i.add(t?t.call(i,n):n?r._subscribe(i):r._trySubscribe(i))}),i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return t=Qe(t),new t(function(t,r){var i=new He({next:function(t){try{e(t)}catch(e){r(e),i.unsubscribe()}},error:r,complete:t});n.subscribe(i)})},e.prototype._subscribe=function(e){return this.source?.subscribe(e)},e.prototype[qe]=function(){return this},e.prototype.pipe=function(){return Xe([...arguments])(this)},e.prototype.toPromise=function(e){var t=this;return e=Qe(e),new e(function(e,n){var r;t.subscribe(function(e){return r=e},function(e){return n(e)},function(){return e(r)})})},e.create=function(t){return new e(t)},e}();function Qe(e){return e??De.Promise??Promise}function $e(e){return e&&ye(e.next)&&ye(e.error)&&ye(e.complete)}function eee(e){return e&&e instanceof Re||$e(e)&&Te(e)}function tee(e){return ye(e?.lift)}function et(e){return function(t){if(tee(t))return t.lift(function(t){try{return e(t,this)}catch(e){this.error(e)}});throw TypeError(`Unable to lift unknown Observable type`)}}function tt(e,t,n,r,i){return new nee(e,t,n,r,i)}var nee=function(e){_(t,e);function t(t,n,r,i,a,o){var s=e.call(this,t)||this;return s.onFinalize=a,s.shouldUnsubscribe=o,s._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,s._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,s._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,s}return t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((t=this.onFinalize)==null||t.call(this))}},t}(Re),nt={schedule:function(e){var t=requestAnimationFrame,n=cancelAnimationFrame,r=nt.delegate;r&&(t=r.requestAnimationFrame,n=r.cancelAnimationFrame);var i=t(function(t){n=void 0,e(t)});return new Ce(function(){return n?.(i)})},requestAnimationFrame:function(){var e=[...arguments];return(nt.delegate?.requestAnimationFrame||requestAnimationFrame).apply(void 0,y([],p(e)))},cancelAnimationFrame:function(){var e=[...arguments];return(nt.delegate?.cancelAnimationFrame||cancelAnimationFrame).apply(void 0,y([],p(e)))},delegate:void 0},ree=be(function(e){return function(){e(this),this.name=`ObjectUnsubscribedError`,this.message=`object unsubscribed`}}),rt=function(e){_(t,e);function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return t.prototype.lift=function(e){var t=new it(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new ree},t.prototype.next=function(e){var t=this;Ie(function(){var n,r;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||=Array.from(t.observers);try{for(var i=d(t.currentObservers),a=i.next();!a.done;a=i.next())a.value.next(e)}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}})},t.prototype.error=function(e){var t=this;Ie(function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}})},t.prototype.complete=function(){var e=this;Ie(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){return this.observers?.length>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=this,r=n.hasError,i=n.isStopped,a=n.observers;return r||i?we:(this.currentObservers=null,a.push(e),new Ce(function(){t.currentObservers=null,Se(a,e)}))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,i=t.isStopped;n?e.error(r):i&&e.complete()},t.prototype.asObservable=function(){var e=new Ze;return e.source=this,e},t.create=function(e,t){return new it(e,t)},t}(Ze),it=function(e){_(t,e);function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return t.prototype.next=function(e){var t,n;(n=(t=this.destination)?.next)==null||n.call(t,e)},t.prototype.error=function(e){var t,n;(n=(t=this.destination)?.error)==null||n.call(t,e)},t.prototype.complete=function(){var e,t;(t=(e=this.destination)?.complete)==null||t.call(e)},t.prototype._subscribe=function(e){return this.source?.subscribe(e)??we},t}(rt),at=function(e){_(t,e);function t(t){var n=e.call(this)||this;return n._value=t,n}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return!n.closed&&t.next(this._value),n},t.prototype.getValue=function(){var e=this,t=e.hasError,n=e.thrownError,r=e._value;if(t)throw n;return this._throwIfClosed(),r},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(rt),ot={now:function(){return(ot.delegate||Date).now()},delegate:void 0},iee=function(e){_(t,e);function t(t,n,r){t===void 0&&(t=1/0),n===void 0&&(n=1/0),r===void 0&&(r=ot);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,n),i}return t.prototype.next=function(t){var n=this,r=n.isStopped,i=n._buffer,a=n._infiniteTimeWindow,o=n._timestampProvider,s=n._windowTime;r||(i.push(t),!a&&i.push(o.now()+s)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),n=this,r=n._infiniteTimeWindow,i=n._buffer.slice(),a=0;a<i.length&&!e.closed;a+=r?1:2)e.next(i[a]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this,t=e._bufferSize,n=e._timestampProvider,r=e._buffer,i=e._infiniteTimeWindow,a=(i?1:2)*t;if(t<1/0&&a<r.length&&r.splice(0,r.length-a),!i){for(var o=n.now(),s=0,c=1;c<r.length&&r[c]<=o;c+=2)s=c;s&&r.splice(0,s+1)}},t}(rt),aee=function(e){_(t,e);function t(t,n){return e.call(this)||this}return t.prototype.schedule=function(e,t){return t===void 0&&(t=0),this},t}(Ce),st={setInterval:function(e,t){var n=[...arguments].slice(2),r=st.delegate;return r?.setInterval?r.setInterval.apply(r,y([e,t],p(n))):setInterval.apply(void 0,y([e,t],p(n)))},clearInterval:function(e){return(st.delegate?.clearInterval||clearInterval)(e)},delegate:void 0},oee=function(e){_(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return t.prototype.schedule=function(e,t){if(t===void 0&&(t=0),this.closed)return this;this.state=e;var n=this.id,r=this.scheduler;return n!=null&&(this.id=this.recycleAsyncId(r,n,t)),this.pending=!0,this.delay=t,this.id=this.id??this.requestAsyncId(r,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return n===void 0&&(n=0),st.setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,t,n){if(n===void 0&&(n=0),n!=null&&this.delay===n&&this.pending===!1)return t;t!=null&&st.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return Error(`executing a cancelled action`);this.pending=!1;var n=this._execute(e,t);if(n)return n;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var n=!1,r;try{this.work(e)}catch(e){n=!0,r=e||Error(`Scheduled action threw falsy error`)}if(n)return this.unsubscribe(),r},t.prototype.unsubscribe=function(){if(!this.closed){var t=this,n=t.id,r=t.scheduler,i=r.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Se(i,this),n!=null&&(this.id=this.recycleAsyncId(r,n,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(aee),see=function(){function e(t,n){n===void 0&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(e,t,n){return t===void 0&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},e.now=ot.now,e}(),ct=function(e){_(t,e);function t(t,n){n===void 0&&(n=see.now);var r=e.call(this,t,n)||this;return r.actions=[],r._active=!1,r}return t.prototype.flush=function(e){var t=this.actions;if(this._active){t.push(e);return}var n;this._active=!0;do if(n=e.execute(e.state,e.delay))break;while(e=t.shift());if(this._active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}},t}(see),lt=new ct(oee),cee=lt,lee=function(e){_(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return t.prototype.requestAsyncId=function(t,n,r){return r===void 0&&(r=0),r!==null&&r>0?e.prototype.requestAsyncId.call(this,t,n,r):(t.actions.push(this),t._scheduled||=nt.requestAnimationFrame(function(){return t.flush(void 0)}))},t.prototype.recycleAsyncId=function(t,n,r){if(r===void 0&&(r=0),r==null?this.delay>0:r>0)return e.prototype.recycleAsyncId.call(this,t,n,r);var i=t.actions;n!=null&&n===t._scheduled&&i[i.length-1]?.id!==n&&(nt.cancelAnimationFrame(n),t._scheduled=void 0)},t}(oee),ut=new(function(e){_(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.flush=function(e){this._active=!0;var t;e?t=e.id:(t=this._scheduled,this._scheduled=void 0);var n=this.actions,r;e||=n.shift();do if(r=e.execute(e.state,e.delay))break;while((e=n[0])&&e.id===t&&n.shift());if(this._active=!1,r){for(;(e=n[0])&&e.id===t&&n.shift();)e.unsubscribe();throw r}},t}(ct))(lee),dt=new Ze(function(e){return e.complete()});function uee(e){return e&&ye(e.schedule)}function ft(e){return e[e.length-1]}function pt(e){return ye(ft(e))?e.pop():void 0}function mt(e){return uee(ft(e))?e.pop():void 0}function dee(e,t){return typeof ft(e)==`number`?e.pop():t}var ht=(function(e){return e&&typeof e.length==`number`&&typeof e!=`function`});function gt(e){return ye(e?.then)}function _t(e){return ye(e[qe])}function vt(e){return Symbol.asyncIterator&&ye(e?.[Symbol.asyncIterator])}function yt(e){return TypeError(`You provided `+(typeof e==`object`&&e?`an invalid object`:`'`+e+`'`)+` where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}function fee(){return typeof Symbol!=`function`||!Symbol.iterator?`@@iterator`:Symbol.iterator}var pee=fee();function mee(e){return ye(e?.[pee])}function hee(e){return g(this,arguments,function(){var t,n,r,i;return u(this,function(a){switch(a.label){case 0:t=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,l(t.read())];case 3:return n=a.sent(),r=n.value,i=n.done,i?[4,l(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,l(r)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function gee(e){return ye(e?.getReader)}function bt(e){if(e instanceof Ze)return e;if(e!=null){if(_t(e))return _ee(e);if(ht(e))return vee(e);if(gt(e))return yee(e);if(vt(e))return xee(e);if(mee(e))return bee(e);if(gee(e))return See(e)}throw yt(e)}function _ee(e){return new Ze(function(t){var n=e[qe]();if(ye(n.subscribe))return n.subscribe(t);throw TypeError(`Provided object does not correctly implement Symbol.observable`)})}function vee(e){return new Ze(function(t){for(var n=0;n<e.length&&!t.closed;n++)t.next(e[n]);t.complete()})}function yee(e){return new Ze(function(t){e.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,ke)})}function bee(e){return new Ze(function(t){var n,r;try{for(var i=d(e),a=i.next();!a.done;a=i.next()){var o=a.value;if(t.next(o),t.closed)return}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}t.complete()})}function xee(e){return new Ze(function(t){Cee(e,t).catch(function(e){return t.error(e)})})}function See(e){return xee(hee(e))}function Cee(e,t){var n,r,i,a;return h(this,void 0,void 0,function(){var o,s;return u(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),n=f(e),c.label=1;case 1:return[4,n.next()];case 2:if(r=c.sent(),r.done)return[3,4];if(o=r.value,t.next(o),t.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=c.sent(),i={error:s},[3,11];case 6:return c.trys.push([6,,9,10]),r&&!r.done&&(a=n.return)?[4,a.call(n)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function xt(e,t,n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var a=t.schedule(function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()},r);if(e.add(a),!i)return a}function St(e,t){return t===void 0&&(t=0),et(function(n,r){n.subscribe(tt(r,function(n){return xt(r,e,function(){return r.next(n)},t)},function(){return xt(r,e,function(){return r.complete()},t)},function(n){return xt(r,e,function(){return r.error(n)},t)}))})}function wee(e,t){return t===void 0&&(t=0),et(function(n,r){r.add(e.schedule(function(){return n.subscribe(r)},t))})}function Tee(e,t){return bt(e).pipe(wee(t),St(t))}function Eee(e,t){return bt(e).pipe(wee(t),St(t))}function Dee(e,t){return new Ze(function(n){var r=0;return t.schedule(function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())})})}function Oee(e,t){return new Ze(function(n){var r;return xt(n,t,function(){r=e[pee](),xt(n,t,function(){var e,t,i;try{e=r.next(),t=e.value,i=e.done}catch(e){n.error(e);return}i?n.complete():n.next(t)},0,!0)}),function(){return ye(r?.return)&&r.return()}})}function kee(e,t){if(!e)throw Error(`Iterable cannot be null`);return new Ze(function(n){xt(n,t,function(){var r=e[Symbol.asyncIterator]();xt(n,t,function(){r.next().then(function(e){e.done?n.complete():n.next(e.value)})},0,!0)})})}function Aee(e,t){return kee(hee(e),t)}function jee(e,t){if(e!=null){if(_t(e))return Tee(e,t);if(ht(e))return Dee(e,t);if(gt(e))return Eee(e,t);if(vt(e))return kee(e,t);if(mee(e))return Oee(e,t);if(gee(e))return Aee(e,t)}throw yt(e)}function Ct(e,t){return t?jee(e,t):bt(e)}function wt(){var e=[...arguments];return Ct(e,mt(e))}function Tt(e){return!!e&&(e instanceof Ze||ye(e.lift)&&ye(e.subscribe))}var Et=be(function(e){return function(){e(this),this.name=`EmptyError`,this.message=`no elements in sequence`}});function Dt(e,t){var n=typeof t==`object`;return new Promise(function(r,i){var a=new He({next:function(e){r(e),a.unsubscribe()},error:i,complete:function(){n?r(t.defaultValue):i(new Et)}});e.subscribe(a)})}function Mee(e){return e instanceof Date&&!isNaN(e)}function Ot(e,t){return et(function(n,r){var i=0;n.subscribe(tt(r,function(n){r.next(e.call(t,n,i++))}))})}var Nee=Array.isArray;function Pee(e,t){return Nee(t)?e.apply(void 0,y([],p(t))):e(t)}function kt(e){return Ot(function(t){return Pee(e,t)})}var Fee=Array.isArray,Iee=Object.getPrototypeOf,Lee=Object.prototype,Ree=Object.keys;function zee(e){if(e.length===1){var t=e[0];if(Fee(t))return{args:t,keys:null};if(Bee(t)){var n=Ree(t);return{args:n.map(function(e){return t[e]}),keys:n}}}return{args:e,keys:null}}function Bee(e){return e&&typeof e==`object`&&Iee(e)===Lee}function Vee(e,t){return e.reduce(function(e,n,r){return e[n]=t[r],e},{})}function At(){var e=[...arguments],t=mt(e),n=pt(e),r=zee(e),i=r.args,a=r.keys;if(i.length===0)return Ct([],t);var o=new Ze(Hee(i,t,a?function(e){return Vee(a,e)}:Je));return n?o.pipe(kt(n)):o}function Hee(e,t,n){return n===void 0&&(n=Je),function(r){Uee(t,function(){for(var i=e.length,a=Array(i),o=i,s=i,c=function(i){Uee(t,function(){var c=Ct(e[i],t),l=!1;c.subscribe(tt(r,function(e){a[i]=e,l||(l=!0,s--),s||r.next(n(a.slice()))},function(){--o||r.complete()}))},r)},l=0;l<i;l++)c(l)},r)}}function Uee(e,t,n){e?xt(n,e,t):t()}function Wee(e,t,n,r,i,a,o,s){var c=[],l=0,u=0,d=!1,f=function(){d&&!c.length&&!l&&t.complete()},p=function(e){return l<r?m(e):c.push(e)},m=function(e){a&&t.next(e),l++;var s=!1;bt(n(e,u++)).subscribe(tt(t,function(e){i?.(e),a?p(e):t.next(e)},function(){s=!0},void 0,function(){if(s)try{l--;for(var e=function(){var e=c.shift();o?xt(t,o,function(){return m(e)}):m(e)};c.length&&l<r;)e();f()}catch(e){t.error(e)}}))};return e.subscribe(tt(t,p,function(){d=!0,f()})),function(){s?.()}}function jt(e,t,n){return n===void 0&&(n=1/0),ye(t)?jt(function(n,r){return Ot(function(e,i){return t(n,e,r,i)})(bt(e(n,r)))},n):(typeof t==`number`&&(n=t),et(function(t,r){return Wee(t,r,e,n)}))}function Gee(e){return e===void 0&&(e=1/0),jt(Je,e)}function Kee(){return Gee(1)}function qee(){var e=[...arguments];return Kee()(Ct(e,mt(e)))}function Jee(e){return new Ze(function(t){bt(e()).subscribe(t)})}var Yee=[`addListener`,`removeListener`],Xee=[`addEventListener`,`removeEventListener`],Zee=[`on`,`off`];function Mt(e,t,n,r){if(ye(n)&&(r=n,n=void 0),r)return Mt(e,t,n).pipe(kt(r));var i=p(ete(e)?Xee.map(function(r){return function(i){return e[r](t,i,n)}}):Qee(e)?Yee.map(Nt(e,t)):$ee(e)?Zee.map(Nt(e,t)):[],2),a=i[0],o=i[1];if(!a&&ht(e))return jt(function(e){return Mt(e,t,n)})(bt(e));if(!a)throw TypeError(`Invalid event target`);return new Ze(function(e){var t=function(){var t=[...arguments];return e.next(1<t.length?t:t[0])};return a(t),function(){return o(t)}})}function Nt(e,t){return function(n){return function(r){return e[n](t,r)}}}function Qee(e){return ye(e.addListener)&&ye(e.removeListener)}function $ee(e){return ye(e.on)&&ye(e.off)}function ete(e){return ye(e.addEventListener)&&ye(e.removeEventListener)}function Pt(e,t,n){e===void 0&&(e=0),n===void 0&&(n=cee);var r=-1;return t!=null&&(uee(t)?n=t:r=t),new Ze(function(t){var i=Mee(e)?+e-n.now():e;i<0&&(i=0);var a=0;return n.schedule(function(){t.closed||(t.next(a++),0<=r?this.schedule(void 0,r):t.complete())},i)})}function Ft(){var e=[...arguments],t=mt(e),n=dee(e,1/0),r=e;return r.length?r.length===1?bt(r[0]):Gee(n)(Ct(r,t)):dt}var tte=Array.isArray;function nte(e){return e.length===1&&tte(e[0])?e[0]:e}function It(e,t){return et(function(n,r){var i=0;n.subscribe(tt(r,function(n){return e.call(t,n,i++)&&r.next(n)}))})}function rte(e){return et(function(t,n){var r=!1,i=null,a=null,o=!1,s=function(){if(a?.unsubscribe(),a=null,r){r=!1;var e=i;i=null,n.next(e)}o&&n.complete()},c=function(){a=null,o&&n.complete()};t.subscribe(tt(n,function(t){r=!0,i=t,a||bt(e(t)).subscribe(a=tt(n,s,c))},function(){o=!0,(!r||!a||a.closed)&&n.complete()}))})}function ite(e,t){return t===void 0&&(t=lt),rte(function(){return Pt(e,t)})}function ate(e){var t=[...arguments].slice(1),n=mt(t)??lt,r=t[0]??null,i=t[1]||1/0;return et(function(t,a){var o=[],s=!1,c=function(e){var t=e.buffer;e.subs.unsubscribe(),Se(o,e),a.next(t),s&&l()},l=function(){if(o){var t=new Ce;a.add(t);var r={buffer:[],subs:t};o.push(r),xt(t,n,function(){return c(r)},e)}};r!==null&&r>=0?xt(a,n,l,r,!0):s=!0,l();var u=tt(a,function(e){var t,n,r=o.slice();try{for(var a=d(r),s=a.next();!s.done;s=a.next()){var l=s.value,u=l.buffer;u.push(e),i<=u.length&&c(l)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}},function(){for(;o?.length;)a.next(o.shift().buffer);u?.unsubscribe(),a.complete(),a.unsubscribe()},void 0,function(){return o=null});t.subscribe(u)})}function ote(e,t,n,r,i){return function(a,o){var s=n,c=t,l=0;a.subscribe(tt(o,function(t){var n=l++;c=s?e(c,t,n):(s=!0,t),r&&o.next(c)},i&&(function(){s&&o.next(c),o.complete()})))}}function Lt(){var e=[...arguments],t=pt(e);return t?Ye(Lt.apply(void 0,y([],p(e))),kt(t)):et(function(t,n){Hee(y([t],p(nte(e))))(n)})}function Rt(){var e=[...arguments];return Lt.apply(void 0,y([],p(e)))}function zt(e,t){return ye(t)?jt(e,t,1):jt(e,1)}function Bt(e,t){return t===void 0&&(t=lt),et(function(n,r){var i=null,a=null,o=null,s=function(){if(i){i.unsubscribe(),i=null;var e=a;a=null,r.next(e)}};function c(){var n=o+e,a=t.now();if(a<n){i=this.schedule(void 0,n-a),r.add(i);return}s()}n.subscribe(tt(r,function(n){a=n,o=t.now(),i||(i=t.schedule(c,e),r.add(i))},function(){s(),r.complete()},void 0,function(){a=i=null}))})}function ste(e){return et(function(t,n){var r=!1;t.subscribe(tt(n,function(e){r=!0,n.next(e)},function(){r||n.next(e),n.complete()}))})}function Vt(e){return e<=0?function(){return dt}:et(function(t,n){var r=0;t.subscribe(tt(n,function(t){++r<=e&&(n.next(t),e<=r&&n.complete())}))})}function Ht(e,t){return t===void 0&&(t=Je),e??=cte,et(function(n,r){var i,a=!0;n.subscribe(tt(r,function(n){var o=t(n);(a||!e(i,o))&&(a=!1,i=o,r.next(n))}))})}function cte(e,t){return e===t}function lte(e){return e===void 0&&(e=ute),et(function(t,n){var r=!1;t.subscribe(tt(n,function(e){r=!0,n.next(e)},function(){return r?n.complete():n.error(e())}))})}function ute(){return new Et}function dte(e,t){var n=arguments.length>=2;return function(r){return r.pipe(e?It(function(t,n){return e(t,n,r)}):Je,Vt(1),n?ste(t):lte(function(){return new Et}))}}function Ut(e,t){return et(ote(e,t,arguments.length>=2,!0))}function Wt(e){e===void 0&&(e={});var t=e.connector,n=t===void 0?function(){return new rt}:t,r=e.resetOnError,i=r===void 0||r,a=e.resetOnComplete,o=a===void 0||a,s=e.resetOnRefCountZero,c=s===void 0||s;return function(e){var t,r,a,s=0,l=!1,u=!1,d=function(){r?.unsubscribe(),r=void 0},f=function(){d(),t=a=void 0,l=u=!1},p=function(){var e=t;f(),e?.unsubscribe()};return et(function(e,m){s++,!u&&!l&&d();var h=a??=n();m.add(function(){s--,s===0&&!u&&!l&&(r=Gt(p,c))}),h.subscribe(m),!t&&s>0&&(t=new He({next:function(e){return h.next(e)},error:function(e){u=!0,d(),r=Gt(f,i,e),h.error(e)},complete:function(){l=!0,d(),r=Gt(f,o),h.complete()}}),bt(e).subscribe(t))})(e)}}function Gt(e,t){var n=[...arguments].slice(2);if(t===!0){e();return}if(t!==!1){var r=new He({next:function(){r.unsubscribe(),e()}});return bt(t.apply(void 0,y([],p(n)))).subscribe(r)}}function Kt(e,t,n){var r,i,a,o,s=!1;return e&&typeof e==`object`?(r=e.bufferSize,o=r===void 0?1/0:r,i=e.windowTime,t=i===void 0?1/0:i,a=e.refCount,s=a!==void 0&&a,n=e.scheduler):o=e??1/0,Wt({connector:function(){return new iee(o,t,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:s})}function qt(e){return It(function(t,n){return e<=n})}function Jt(){var e=[...arguments],t=mt(e);return et(function(n,r){(t?qee(e,n,t):qee(e,n)).subscribe(r)})}function Yt(e,t){return et(function(n,r){var i=null,a=0,o=!1,s=function(){return o&&!i&&r.complete()};n.subscribe(tt(r,function(n){i?.unsubscribe();var o=0,c=a++;bt(e(n,c)).subscribe(i=tt(r,function(e){return r.next(t?t(n,e,c,o++):e)},function(){i=null,s()}))},function(){o=!0,s()}))})}function Xt(e){return et(function(t,n){bt(e).subscribe(tt(n,function(){return n.complete()},Ae)),!n.closed&&t.subscribe(n)})}function fte(e,t){return t===void 0&&(t=!1),et(function(n,r){var i=0;n.subscribe(tt(r,function(n){var a=e(n,i++);(a||t)&&r.next(n),!a&&r.complete()}))})}function Zt(e,t,n){var r=ye(e)||t||n?{next:e,error:t,complete:n}:e;return r?et(function(e,t){var n;(n=r.subscribe)==null||n.call(r);var i=!0;e.subscribe(tt(t,function(e){var n;(n=r.next)==null||n.call(r,e),t.next(e)},function(){var e;i=!1,(e=r.complete)==null||e.call(r),t.complete()},function(e){var n;i=!1,(n=r.error)==null||n.call(r,e),t.error(e)},function(){var e,t;i&&((e=r.unsubscribe)==null||e.call(r)),(t=r.finalize)==null||t.call(r)}))}):Je}function pte(e,t){return et(function(n,r){var i=t??{},a=i.leading,o=a===void 0||a,s=i.trailing,c=s!==void 0&&s,l=!1,u=null,d=null,f=!1,p=function(){d?.unsubscribe(),d=null,c&&(g(),f&&r.complete())},m=function(){d=null,f&&r.complete()},h=function(t){return d=bt(e(t)).subscribe(tt(r,p,m))},g=function(){if(l){l=!1;var e=u;u=null,r.next(e),!f&&h(e)}};n.subscribe(tt(r,function(e){l=!0,u=e,!(d&&!d.closed)&&(o?g():h(e))},function(){f=!0,!(c&&l&&d&&!d.closed)&&r.complete()}))})}function Qt(e,t,n){t===void 0&&(t=lt);var r=Pt(e,t);return pte(function(){return r},n)}function mte(){var e=[...arguments],t=pt(e);return et(function(n,r){for(var i=e.length,a=Array(i),o=e.map(function(){return!1}),s=!1,c=function(t){bt(e[t]).subscribe(tt(r,function(e){a[t]=e,!s&&!o[t]&&(o[t]=!0,(s=o.every(Je))&&(o=null))},Ae))},l=0;l<i;l++)c(l);n.subscribe(tt(r,function(e){if(s){var n=y([e],p(a));r.next(t?t.apply(void 0,y([],p(n))):n)}}))})}var k=e(n(),1),A=function(e){return e[e.UNIVER_UNKNOWN=0]=`UNIVER_UNKNOWN`,e[e.UNIVER_DOC=1]=`UNIVER_DOC`,e[e.UNIVER_SHEET=2]=`UNIVER_SHEET`,e[e.UNIVER_SLIDE=3]=`UNIVER_SLIDE`,e[e.UNIVER_PROJECT=4]=`UNIVER_PROJECT`,e[e.UNIVER_BASE=5]=`UNIVER_BASE`,e[e.UNIVER_BOARD=6]=`UNIVER_BOARD`,e[e.UNIVER_PDF=7]=`UNIVER_PDF`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e}({}),j=function(e){return e[e.View=0]=`View`,e[e.Edit=1]=`Edit`,e[e.ManageCollaborator=2]=`ManageCollaborator`,e[e.Print=3]=`Print`,e[e.Duplicate=4]=`Duplicate`,e[e.Comment=5]=`Comment`,e[e.Copy=6]=`Copy`,e[e.Share=7]=`Share`,e[e.Export=8]=`Export`,e[e.MoveWorksheet=9]=`MoveWorksheet`,e[e.DeleteWorksheet=10]=`DeleteWorksheet`,e[e.HideWorksheet=11]=`HideWorksheet`,e[e.RenameWorksheet=12]=`RenameWorksheet`,e[e.CreateWorksheet=13]=`CreateWorksheet`,e[e.SetWorksheetStyle=14]=`SetWorksheetStyle`,e[e.EditWorksheetCell=15]=`EditWorksheetCell`,e[e.InsertHyperlink=16]=`InsertHyperlink`,e[e.Sort=17]=`Sort`,e[e.Filter=18]=`Filter`,e[e.PivotTable=19]=`PivotTable`,e[e.FloatImg=20]=`FloatImg`,e[e.IHistory=21]=`IHistory`,e[e.RwHgtClWdt=22]=`RwHgtClWdt`,e[e.ViemRwHgtClWdt=23]=`ViemRwHgtClWdt`,e[e.ViewFilter=24]=`ViewFilter`,e[e.MoveSheet=25]=`MoveSheet`,e[e.DeleteSheet=26]=`DeleteSheet`,e[e.HideSheet=27]=`HideSheet`,e[e.CopySheet=28]=`CopySheet`,e[e.RenameSheet=29]=`RenameSheet`,e[e.CreateSheet=30]=`CreateSheet`,e[e.SelectProtectedCells=31]=`SelectProtectedCells`,e[e.SelectUnProtectedCells=32]=`SelectUnProtectedCells`,e[e.SetCellStyle=33]=`SetCellStyle`,e[e.SetCellValue=34]=`SetCellValue`,e[e.SetRowStyle=35]=`SetRowStyle`,e[e.SetColumnStyle=36]=`SetColumnStyle`,e[e.InsertRow=37]=`InsertRow`,e[e.InsertColumn=38]=`InsertColumn`,e[e.DeleteRow=39]=`DeleteRow`,e[e.DeleteColumn=40]=`DeleteColumn`,e[e.EditExtraObject=41]=`EditExtraObject`,e[e.Delete=42]=`Delete`,e[e.RecoverHistory=43]=`RecoverHistory`,e[e.ViewHistory=44]=`ViewHistory`,e[e.CreatePermissionObject=45]=`CreatePermissionObject`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e}({}),$t=function(e){return e[e.Reader=0]=`Reader`,e[e.Editor=1]=`Editor`,e[e.Owner=2]=`Owner`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e}({}),en=function(e){return e[e.Unkonwn=0]=`Unkonwn`,e[e.Workbook=1]=`Workbook`,e[e.Worksheet=2]=`Worksheet`,e[e.SelectRange=3]=`SelectRange`,e[e.Document=4]=`Document`,e[e.Slide=5]=`Slide`,e[e.Base=6]=`Base`,e[e.Board=7]=`Board`,e[e.Pdf=8]=`Pdf`,e[e.DocumentSection=9]=`DocumentSection`,e[e.DocumentParagraph=10]=`DocumentParagraph`,e[e.DocumentEntity=11]=`DocumentEntity`,e[e.SlidePage=12]=`SlidePage`,e[e.SlideElement=13]=`SlideElement`,e[e.SlideMaster=14]=`SlideMaster`,e[e.BaseTable=15]=`BaseTable`,e[e.BaseField=16]=`BaseField`,e[e.BaseRecord=17]=`BaseRecord`,e[e.BaseView=18]=`BaseView`,e[e.BaseDashboard=19]=`BaseDashboard`,e[e.BoardElement=20]=`BoardElement`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e}({}),tn=function(e){return e[e.SomeCollaborator=0]=`SomeCollaborator`,e[e.AllCollaborator=1]=`AllCollaborator`,e[e.OneSelf=2]=`OneSelf`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e}({});function hte(){return{globalObject:typeof globalThis<`u`&&globalThis||typeof window<`u`&&window||typeof global<`u`&&global,isNode:typeof process<`u`&&process.versions!=null&&process.versions.node!=null,warn:e=>console.error(e)}}function gte(e,t,n=hte()){return n.globalObject[e]?(n.isNode||n.warn(t),!1):(n.globalObject[e]=!0,!0)}var nn=Symbol(`$$IDENTIFIER_DECORATOR`);function _te(e){return e&&e[nn]===!0}function rn(e){return typeof e==`function`}function an(e){return!!(e&&e.useClass!==void 0)}function vte(e){return!!(e&&e.useFactory!==void 0)}function yte(e){return!!(e&&e.useValue!==void 0)}function bte(e){return!!(e&&e.useExisting!==void 0)}function xte(e){return!!(e&&e.useAsync!==void 0)}var Ste=Symbol(`AsyncHook`);function on(e){return!!(e&&e.__symbol===Ste)}function Cte(e){return an(e)||vte(e)||yte(e)||bte(e)||xte(e)}function sn(e){return rn(e)&&!e[nn]?e.name:e.toString()}var cn=class extends Error{constructor(e){super(`[redi]: ${e}`)}},ln=function(e){return e.MANY=`many`,e.OPTIONAL=`optional`,e.REQUIRED=`required`,e}({}),un=function(e){return e.SELF=`self`,e.SKIP_SELF=`skipSelf`,e}({}),dn=Symbol(`$$TARGET`),fn=Symbol(`$$DEPENDENCIES`),wte=class extends cn{constructor(e,t){let n=`Could not find dependency registered on the ${e} (indexed) parameter of the constructor of "${sn(t)}".`;super(n)}},Tte=class extends cn{constructor(e,t){let n=`It seems that you forgot to provide a parameter to @Required() on the ${t}th parameter of "${sn(e)}"`;super(n)}},Ete=class extends cn{constructor(e,t){let n=`It seems that you register "undefined" as dependency on the ${t}th parameter of "${sn(e)}". Please make sure that there is not cyclic dependency among your TypeScript files, or consider using "forwardRef". For more info please visit our website https://redi.wzhu.dev/docs/faq#could-not-find-dependency-registered-on`;super(n)}};function pn(e){return e[fn]||[]}function Dte(e,t){let n=pn(e).find(e=>e.paramIndex===t);if(!n)throw new wte(t,e);return n}function Ote(e,t,n,r=ln.REQUIRED,i){let a={paramIndex:n,identifier:t,quantity:r,lookUp:i,withNew:!1};if(t===void 0)throw new Ete(e,n);let o=e;o[dn]===o?o[fn].push(a):(o[fn]=[a],o[dn]=o)}var kte=new Set,Ate=new Map;function mn(e){if(kte.has(e))return console.error(`Identifier "${e}" already exists. Returning the cached identifier decorator.`),Ate.get(e);let t=function(e,n,r){Ote(e,t,r)};return t.decoratorName=e,t.toString=()=>t.decoratorName,t[nn]=!0,kte.add(e),Ate.set(e,t),t}function jte(e,t,n){let r=Dte(e,t);r.lookUp=n}function Mte(e){return function t(){return this instanceof t?this:function(t,n,r){jte(t,r,e)}}}var Nte=Mte(un.SKIP_SELF),Pte=Mte(un.SELF);function Fte(e){return e===ln.OPTIONAL?`0 or 1`:`1`}var hn=class extends cn{constructor(e,t,n){let r=`Expect ${Fte(t)} dependency item(s) for id "${sn(e)}" but get ${n}.`;n===0&&(r+=` Did you forget to register it?`),n>1&&(r+=` You register it more than once.`),super(r),this.quantity=t,this.actual=n}};function Ite(e,t,n){if(t===ln.OPTIONAL&&n>1||t===ln.REQUIRED&&n!==1)throw new hn(e,t,n)}function Lte(e,t){return e===ln.MANY?t:t[0]}function Rte(e,t,n){let r=Dte(e,t);r.quantity=n}function gn(e){return function t(n){return this instanceof t?this:function(t,r,i){if(n)Ote(t,n,i,e);else{if(e===ln.REQUIRED)throw new Tte(t,i);Rte(t,i,e)}}}}var zte=gn(ln.MANY),_n=gn(ln.OPTIONAL),M=gn(ln.REQUIRED);function Bte(e,t=0){return e?e.map((e,n)=>{if(n+=t,!Array.isArray(e))return{paramIndex:n,identifier:e,quantity:ln.REQUIRED,withNew:!1};let r=e.slice(0,e.length-1),i=e[e.length-1],a,o=ln.REQUIRED,s=!1;return r.forEach(e=>{e instanceof Pte?a=un.SELF:e instanceof Nte?a=un.SKIP_SELF:e instanceof _n?o=ln.OPTIONAL:e instanceof zte?o=ln.MANY:s=!0}),{paramIndex:n,identifier:i,quantity:o,lookUp:a,withNew:s}}):[]}function Vte(e){return!!e&&typeof e.unwrap==`function`}function Hte(e){return Vte(e)?e.unwrap():e}function Ute(e){return!!e&&typeof e.dispose==`function`}function Wte(e){return e.length===1}var vn=[];function Gte(e){vn.push(e)}function Kte(){vn.pop()}function qte(){vn.length=0}var Jte=class extends cn{constructor(e,t,n){let r=`Cannot find "${sn(t)}" registered by any injector. It is the ${n}th param of "${_te(e)?sn(e):e.name}".`;super(r)}},yn=class extends cn{constructor(e){let t=`Cannot find "${sn(e)}" registered by any injector. The stack of dependencies is: "${vn.map(e=>sn(e)).join(` -> `)}".`;super(t),qte()}},Yte=class{dependencyMap=new Map;constructor(e){this.normalizeDependencies(e).map(e=>this.add(e[0],e[1]))}add(e,t){t===void 0&&(t={useClass:e,lazy:!1});let n=this.dependencyMap.get(e);n===void 0&&(n=[],this.dependencyMap.set(e,n)),n.push(t)}delete(e){this.dependencyMap.delete(e)}get(e,t){let n=this.dependencyMap.get(e);return Ite(e,t,n.length),Lte(t,n)}has(e){return this.dependencyMap.has(e)}dispose(){this.dependencyMap.clear()}normalizeDependencies(e){return e.map(e=>{let t=e[0],n;return n=Wte(e)?{useClass:e[0],lazy:!1}:e[1],[t,n]})}},Xte=class{resolvedDependencies=new Map;add(e,t){let n=this.resolvedDependencies.get(e);n===void 0&&(n=[],this.resolvedDependencies.set(e,n)),n.push(t)}has(e){return this.resolvedDependencies.has(e)}get(e,t){let n=this.resolvedDependencies.get(e);if(!n)throw new yn(e);return Ite(e,t,n.length),t===ln.MANY?n:n[0]}dispose(){Array.from(this.resolvedDependencies.values()).forEach(e=>{e.forEach(e=>Ute(e)?e.dispose():void 0)}),this.resolvedDependencies.clear()}};function Zte(e){let{requestIdleCallback:t,cancelIdleCallback:n}=e;if(t&&n)return(e,r)=>{let i=t(e,typeof r==`number`?{timeout:r}:void 0),a=!1;return()=>{a||(a=!0,n(i))}};let r=Object.freeze({didTimeout:!0,timeRemaining(){return 15}});return e=>{let t=setTimeout(()=>e(r)),n=!1;return()=>{n||(n=!0,clearTimeout(t))}}}var Qte=Zte(globalThis),$te=class{executor;disposeIdleCallback;didRun=!1;value;error;constructor(e){this.executor=()=>{try{this.value=e()}catch(e){this.error=e}finally{this.didRun=!0}},this.disposeIdleCallback=Qte(()=>this.executor())}hasRun(){return this.didRun}dispose(){this.disposeIdleCallback()}getValue(){if(this.didRun||(this.disposeIdleCallback(),this.executor()),this.error)throw this.error;return this.value}},ene=300,bn=Symbol(`$$NOT_INSTANTIATED_SYMBOL`),tne=class extends cn{constructor(e){super(`Detecting cyclic dependency. The last identifier is "${sn(e)}".`)}},nne=class extends cn{constructor(){super(`Injector cannot be accessed after it was disposed.`)}},rne=class extends cn{constructor(e){super(`Async item "${sn(e)}" returns another async item.`)}},ine=class extends cn{constructor(e){super(`Cannot get async item "${sn(e)}" from sync api.`)}},xn=class extends cn{constructor(e){super(`Cannot add dependency "${sn(e)}" after it is already resolved.`)}},ane=class extends cn{constructor(e){super(`Cannot delete dependency "${sn(e)}" when it is already resolved.`)}},Sn=class e{dependencyCollection;resolvedDependencyCollection;children=[];resolutionOngoing=0;disposingCallbacks=new Set;disposed=!1;constructor(e,t=null){this.parent=t,this.dependencyCollection=new Yte(e||[]),this.resolvedDependencyCollection=new Xte,t&&t.children.push(this)}onDispose(e){return this.disposingCallbacks.add(e),{dispose:()=>this.disposingCallbacks.delete(e)}}createChild(t){return this._ensureInjectorNotDisposed(),new e(t,this)}dispose(){this.children.forEach(e=>e.dispose()),this.children.length=0,this.dependencyCollection.dispose(),this.resolvedDependencyCollection.dispose(),this.deleteSelfFromParent(),this.disposed=!0,this.disposingCallbacks.forEach(e=>e()),this.disposingCallbacks.clear()}deleteSelfFromParent(){if(this.parent){let e=this.parent.children.indexOf(this);this.parent.children.splice(e,1)}}add(e){this._ensureInjectorNotDisposed();let t=e[0],n=e[1];if(this.resolvedDependencyCollection.has(t))throw new xn(t);n===void 0?this.dependencyCollection.add(t):Cte(n)?this.dependencyCollection.add(t,n):this.resolvedDependencyCollection.add(t,n)}replace(e){this._ensureInjectorNotDisposed();let t=e[0];if(this.resolvedDependencyCollection.has(t))throw new xn(t);this.dependencyCollection.delete(t),this.dependencyCollection.add(t,e[1])}delete(e){if(this._ensureInjectorNotDisposed(),this.resolvedDependencyCollection.has(e))throw new ane(e);this.dependencyCollection.delete(e)}invoke(e,...t){return this._ensureInjectorNotDisposed(),e({get:(e,t,n)=>this._get(e,t,n),has:e=>this.has(e)},...t)}has(e){return this.dependencyCollection.has(e)||this.parent?.has(e)||!1}get(e,t,n){this._ensureInjectorNotDisposed();let r=this._get(e,t,n);if(Array.isArray(r)&&r.some(e=>on(e))||on(r))throw new ine(e);return r}_get(e,t,n,r){let i=ln.REQUIRED;if(t===ln.REQUIRED||t===ln.OPTIONAL||t===ln.MANY?i=t:n=t,!r){let t=this.getValue(e,i,n);if(t!==bn)return t}let a=!r;return this.createDependency(e,i,n,a)}getAsync(e){this._ensureInjectorNotDisposed();let t=this.getValue(e,ln.REQUIRED);if(t!==bn)return Promise.resolve(t);let n=this.createDependency(e,ln.REQUIRED);return on(n)?n.whenReady():Promise.resolve(n)}createInstance(e,...t){return this._ensureInjectorNotDisposed(),this._resolveClassImpl({useClass:e},...t)}_resolveDependency(e,t,n=!0){let r;Gte(e);try{r=yte(t)?this._resolveValueDependency(e,t):vte(t)?this._resolveFactory(e,t,n):an(t)?this._resolveClass(e,t,n):bte(t)?this._resolveExisting(e,t):this._resolveAsync(e,t),Kte()}catch(e){throw Kte(),e}return r}_resolveExisting(e,t){let n=this.get(t.useExisting);return this.resolvedDependencyCollection.add(e,n),n}_resolveValueDependency(e,t){let n=t.useValue;return this.resolvedDependencyCollection.add(e,n),n}_resolveClass(e,t,n){let r;if(t.lazy){let e=new $te(()=>(this._ensureInjectorNotDisposed(),this._resolveClassImpl(t)));r=new Proxy(Object.create(null),{get(t,n){if(n in t)return t[n];if(n===`dispose`&&!e.hasRun())return()=>e.dispose();let r=e.getValue(),i=r[n];return typeof i==`function`?(i=i.bind(r),t[n]=i,i):i},set(t,n,r){return e.getValue()[n]=r,!0}})}else r=this._resolveClassImpl(t);return e&&n&&this.resolvedDependencyCollection.add(e,r),r}_resolveClassImpl(e,...t){let n=e.useClass;this.markNewResolution(n);let r=pn(n).sort((e,t)=>e.paramIndex-t.paramIndex).map(e=>({...e,identifier:Hte(e.identifier)})),i=[];for(let e of r)try{let t=this._get(e.identifier,e.quantity,e.lookUp,e.withNew);i.push(t)}catch(t){throw t instanceof yn||t instanceof hn&&t.actual===0?new Jte(n,e.identifier,e.paramIndex):t}let a=[...t],o=r.length>0?r[0].paramIndex:a.length;if(a.length!==o){console.warn(`[redi]: Expect ${o} custom parameter(s) of ${sn(n)} but get ${a.length}.`);let e=o-a.length;a=e>0?[...a,...Array.from({length:e}).fill(void 0)]:a.slice(0,o)}let s=new n(...a,...i);return e?.onInstantiation?.(s),this.markResolutionCompleted(),s}_resolveFactory(e,t,n){this.markNewResolution(e);let r=Bte(t.deps),i=[];for(let t of r)try{let e=this._get(t.identifier,t.quantity,t.lookUp,t.withNew);i.push(e)}catch(n){throw n instanceof yn||n instanceof hn&&n.actual===0?new Jte(e,t.identifier,t.paramIndex):n}let a=t.useFactory.apply(null,i);return n&&this.resolvedDependencyCollection.add(e,a),this.markResolutionCompleted(),t?.onInstantiation?.(a),a}_resolveAsync(e,t){return{__symbol:Ste,whenReady:()=>this._resolveAsyncImpl(e,t)}}_resolveAsyncImpl(e,t){return t.useAsync().then(n=>{let r=this.getValue(e);if(r!==bn)return r;let i;if(Array.isArray(n)){let t=n[1];if(xte(t))throw new rne(e);i=this._resolveDependency(e,t)}else i=rn(n)?this._resolveClassImpl({useClass:n,onInstantiation:t.onInstantiation}):n;return this.resolvedDependencyCollection.add(e,i),i})}getValue(t,n=ln.REQUIRED,r){let i=()=>this.dependencyCollection.has(t)&&!this.resolvedDependencyCollection.has(t)?bn:this.resolvedDependencyCollection.get(t,n),a=()=>{if(this.parent)return this.parent.getValue(t,n);if(n===ln.OPTIONAL)return null;if(n===ln.MANY)return[];throw new hn(t,ln.REQUIRED,0)};return r===un.SKIP_SELF?a():t===e?this:r===un.SELF||this.resolvedDependencyCollection.has(t)||this.dependencyCollection.has(t)?i():a()}createDependency(e,t,n,r=!0){let i=()=>{let n=this.dependencyCollection.get(e,t),i=null;return i=Array.isArray(n)?n.map(t=>this._resolveDependency(e,t,r)):this._resolveDependency(e,n,r),i},a=()=>{if(this.parent)return this.parent.createDependency(e,t,void 0,r);if(t===ln.OPTIONAL)return null;if(t===ln.MANY)return[];throw Gte(e),new yn(e)};return n===un.SKIP_SELF?a():this.dependencyCollection.has(e)?i():a()}markNewResolution(e){if(this.resolutionOngoing+=1,this.resolutionOngoing>=ene)throw new tne(e)}markResolutionCompleted(){--this.resolutionOngoing}_ensureInjectorNotDisposed(){if(this.disposed)throw new nne}};gte(`REDI_GLOBAL_LOCK`,`[redi]: You are loading scripts of redi more than once! This may cause undesired behavior in your application.
4
4
  Maybe your dependencies added redi as its dependency and bundled redi to its dist files. Or you import different versions of redi.
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,t as n}from"./vendor-react-BOUWij0V.js";import{n as r}from"./locale-store-5DzxIIeq.js";import{t as i}from"./messages-CGGOcV9B.js";import{d as a,l as o,n as s,r as c,u as l}from"./browser-notification-delivery-DmE2FgGc.js";import{t as u}from"./external-link-DjqjBmc3.js";import{t as d}from"./refresh-cw-BRlGaq2w.js";import{t as f}from"./shield-B1sI_cxl.js";import{t as p}from"./cn-0WouolD0.js";import{n as m}from"./interaction-BdhHBbYa.js";import{n as h}from"./electron-env-DHOGevH3.js";import{r as g}from"./settings-form-draft-Dy10ldo8.js";import{n as _,t as v}from"./settings-page-header-B8nLRdnY.js";import"./settings-page-layout-DhOLVJYv.js";import{r as y,t as b}from"./settings-form-section-num14vSv.js";var x=e(t(),1);async function S(e,t){let n=window.electronAPI?.system;if(!h()||!n?.requestNotifications)return`unsupported`;let r=await n.requestNotifications();if(r.status!==`granted`)return r.outcome===`opened-settings`||r.status===`denied`?`denied`:`default`;await n.setBehavior({notifyEnabled:!0});let i=await n.showEndpointNotification({title:e,body:t});return i.ok||await n.setBehavior({notifyEnabled:!1}),i.ok?`enabled`:`default`}var C=n();function w(){let e=i(r(e=>e.language)).systemSettings.browserNotify,[t,n]=(0,x.useState)(o),[u,d]=(0,x.useState)(null),[f,p]=(0,x.useState)(!1),m=async t=>{if(!t){n(l({enabled:!1})),d(null);return}p(!0);try{let t=await s();if(t!==`granted`){d(t===`unsupported`?e.unsupported:e.denied);return}let r=l({enabled:!0});n(r),d(await c(e.testTitle,e.testBody)?e.testShown:e.failed)}finally{p(!1)}},h=e=>{n(l(e))};return(0,C.jsxs)(_,{gap:`gap-6`,children:[(0,C.jsx)(v,{title:e.pageTitle}),(0,C.jsxs)(b,{children:[(0,C.jsxs)(`div`,{className:`mb-4 flex items-center gap-2 text-sm font-semibold text-fg`,children:[(0,C.jsx)(a,{className:`size-4 text-accent`,strokeWidth:1.75}),e.title]}),(0,C.jsx)(`p`,{className:`mb-4 text-sm text-fg-muted`,children:e.description}),(0,C.jsx)(`div`,{className:`space-y-2`,children:[[`enabled`,e.enabled,e.enabledDesc],[`completed`,e.completed,e.completedDesc],[`failed`,e.failedRuns,e.failedRunsDesc],[`needsInput`,e.needsInput,e.needsInputDesc]].map(([e,n,r])=>(0,C.jsxs)(`label`,{className:`flex items-center justify-between gap-3 rounded-xl bg-surface-hover/50 px-3 py-2.5 dark:bg-surface-hover/35`,children:[(0,C.jsxs)(`span`,{children:[(0,C.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:n}),(0,C.jsx)(`span`,{className:`block text-xs text-fg-muted`,children:r})]}),(0,C.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,disabled:f||e!==`enabled`&&!t.enabled,checked:t[e],onChange:t=>{e===`enabled`?m(t.target.checked):h({[e]:t.target.checked})}})]},e))}),u?(0,C.jsx)(`p`,{className:`mt-3 text-sm text-fg-muted`,role:`status`,children:u}):null,(0,C.jsx)(`p`,{className:`mt-4 text-xs text-fg-muted`,children:e.limitation})]})]})}async function T(){if(typeof navigator>`u`||!navigator.mediaDevices?.getUserMedia)return!1;try{let e=await navigator.mediaDevices.getUserMedia({audio:!0});for(let t of e.getTracks())t.stop();return!0}catch{return!1}}function E(e,t,n){return e.outcome===`opened-settings`?n.openedSettings:e.status===`granted`&&t?e.outcome===`already-granted`?n.alreadyGranted:n.granted:t?e.status===`denied`?n.denied:n.prompted:n.rendererDenied}function D(e,t){return e.outcome===`opened-settings`?t.openedSettings:e.status===`granted`?e.outcome===`already-granted`?t.alreadyGranted:t.granted:t.denied}function O(e,t){return e.outcome===`opened-settings`?t.openedSettings:e.status===`granted`?e.outcome===`already-granted`?t.alreadyGranted:t.granted:e.status===`denied`?t.denied:t.prompted}function k(e,t){return e.outcome===`opened-settings`?t.openedSettings:e.status===`granted`?e.outcome===`already-granted`?t.alreadyGranted:t.granted:e.status===`denied`?t.denied:t.prompted}var A=new Set([`microphone`,`accessibility`,`notifications`,`screen`]);function j(e,t,n){return t===`granted`?!1:e===`accessibility`&&(n===`darwin`||n===`win32`||n===`linux`)||e===`screen`&&(n===`darwin`||n===`win32`)||A.has(e)?t===`unknown`:!1}function M(e,t,n){return e===`accessibility`?!1:e===`screen`&&n===`linux`||!A.has(e)||t===`denied`}var N=[{key:`fullDisk`,pane:`fullDisk`,platforms:[`darwin`]},{key:`screen`,pane:`screen`},{key:`microphone`,pane:`microphone`},{key:`accessibility`,pane:`accessibility`},{key:`automation`,pane:`automation`},{key:`notifications`,pane:`notifications`},{key:`location`,pane:`location`}];function P(e){return e===`linux`?N:N.filter(t=>!t.platforms||t.platforms.includes(e))}function F(e,t){let n=i(e).systemSettings.status;return t===`granted`?{label:n.granted,className:`text-emerald-600 dark:text-emerald-400`}:t===`denied`?{label:n.denied,className:`text-amber-600 dark:text-amber-400`}:{label:n.unknown,className:`text-fg-muted`}}function I(e,t,n){let r=i(e).systemSettings.permUnknown?.[t];return r?n===`darwin`&&r.darwin?r.darwin:n===`win32`&&r.win32?r.win32:n===`linux`&&r.linux?r.linux:null:null}var L={behavior:null,perms:null,loadError:null,permFeedback:null,permBusy:!1,refreshing:!1};function R(){let e=r(e=>e.language),t=i(e),n=t.systemSettings,[a,o]=(0,x.useReducer)(g,L),{behavior:s,perms:c,loadError:l,permFeedback:A,permBusy:N,refreshing:R}=a,z=typeof window<`u`?window.electronAPI?.system:void 0,B=(0,x.useCallback)(async e=>{if(z){o({type:`patch`,patch:{loadError:null}});try{let t=await z.getBehavior(),r=await z.getPermissions({probe:e?.showRefreshFeedback});o({type:`patch`,patch:{behavior:t,perms:r,...e?.showRefreshFeedback?{permFeedback:n.refreshDone}:{}}})}catch(t){o({type:`patch`,patch:{loadError:t instanceof Error?t.message:String(t),...e?.showRefreshFeedback?{permFeedback:null}:{}}})}}},[z,n.refreshDone]),V=(0,x.useCallback)(async()=>{if(!(R||N)){o({type:`patch`,patch:{refreshing:!0}});try{await B({showRefreshFeedback:!0})}finally{o({type:`patch`,patch:{refreshing:!1}})}}},[B,N,R]);if((0,x.useEffect)(()=>{let e=new Set([n.refreshDone,n.openSettingsDone,n.openSettingsFailed,n.desktopNotify.testShown]);if(!A||!e.has(A))return;let t=window.setTimeout(()=>{o({type:`patch`,patch:{permFeedback:null}})},3e3);return()=>window.clearTimeout(t)},[A,n.openSettingsDone,n.openSettingsFailed,n.refreshDone,n.desktopNotify.testShown]),(0,x.useEffect)(()=>{h()&&z&&B()},[z,B]),!h()||!z)return(0,C.jsx)(w,{});let H=async e=>{try{let{behavior:t}=await z.setBehavior(e);o({type:`patch`,patch:{behavior:t}})}catch(e){o({type:`patch`,patch:{loadError:e instanceof Error?e.message:String(e)}})}},U=async e=>{if(!e){await H({notifyEnabled:!1});return}o({type:`patch`,patch:{permBusy:!0,permFeedback:null}});try{let e=await S(n.desktopNotify.testTitle,n.desktopNotify.testBody);if(e===`unsupported`){o({type:`patch`,patch:{permFeedback:n.notificationsFeedback.unsupported}});return}if(e===`denied`){o({type:`patch`,patch:{permFeedback:n.desktopNotify.denied}});return}if(e==="default"){o({type:`patch`,patch:{permFeedback:n.notificationsFeedback.default}});return}await H({notifyEnabled:!0}),o({type:`patch`,patch:{perms:await z.getPermissions()}}),o({type:`patch`,patch:{permFeedback:n.desktopNotify.testShown}})}catch(e){o({type:`patch`,patch:{loadError:e instanceof Error?e.message:String(e)}})}finally{o({type:`patch`,patch:{permBusy:!1}})}},W=async e=>{o({type:`patch`,patch:{permFeedback:null}}),o({type:`patch`,patch:{loadError:null}});try{(await z.openPrivacy(e)).ok?o({type:`patch`,patch:{permFeedback:n.openSettingsDone}}):o({type:`patch`,patch:{permFeedback:n.openSettingsFailed}})}catch(e){o({type:`patch`,patch:{loadError:e instanceof Error?e.message:String(e)}})}},G=async()=>{o({type:`patch`,patch:{permBusy:!0,permFeedback:null}}),o({type:`patch`,patch:{loadError:null}});try{let e=await z.requestMicrophone(),t=e.outcome===`opened-settings`||e.status===`denied`?!1:await T();o({type:`patch`,patch:{perms:await z.getPermissions()}}),o({type:`patch`,patch:{permFeedback:E(e,t,n.permFeedback)}})}catch(e){o({type:`patch`,patch:{loadError:e instanceof Error?e.message:String(e)}})}finally{o({type:`patch`,patch:{permBusy:!1}})}},K=async()=>{if(z.requestAccessibility){o({type:`patch`,patch:{permBusy:!0,permFeedback:null}}),o({type:`patch`,patch:{loadError:null}});try{let e=await z.requestAccessibility();o({type:`patch`,patch:{perms:await z.getPermissions()}}),o({type:`patch`,patch:{permFeedback:D(e,n.accessibilityFeedback)}})}catch(e){o({type:`patch`,patch:{loadError:e instanceof Error?e.message:String(e)}})}finally{o({type:`patch`,patch:{permBusy:!1}})}}},q=async()=>{if(z.requestNotifications){o({type:`patch`,patch:{permBusy:!0,permFeedback:null}}),o({type:`patch`,patch:{loadError:null}});try{let e=await z.requestNotifications();o({type:`patch`,patch:{perms:await z.getPermissions()}}),o({type:`patch`,patch:{permFeedback:O(e,n.notificationsFeedback)}})}catch(e){o({type:`patch`,patch:{loadError:e instanceof Error?e.message:String(e)}})}finally{o({type:`patch`,patch:{permBusy:!1}})}}},J=async()=>{if(z.requestScreen){o({type:`patch`,patch:{permBusy:!0,permFeedback:null}}),o({type:`patch`,patch:{loadError:null}});try{let e=await z.requestScreen();o({type:`patch`,patch:{perms:await z.getPermissions()}}),o({type:`patch`,patch:{permFeedback:k(e,n.screenFeedback)}})}catch(e){o({type:`patch`,patch:{loadError:e instanceof Error?e.message:String(e)}})}finally{o({type:`patch`,patch:{permBusy:!1}})}}},Y=s?s.platform===`win32`?n.permissionsHintWin:s.platform===`linux`?n.permissionsHintLinux:s.platform===`darwin`?n.permissionsHintDarwin:n.permissionsHint:n.permissionsHint;return(0,C.jsxs)(_,{gap:`gap-6`,children:[(0,C.jsx)(v,{title:n.title}),l?(0,C.jsx)(`p`,{className:`text-sm text-amber-600 dark:text-amber-400`,role:`alert`,children:l}):null,A?(0,C.jsx)(`p`,{className:p(`text-sm`,A===n.refreshDone||A===n.openSettingsDone||A===n.permFeedback.granted||A===n.permFeedback.alreadyGranted||A===n.accessibilityFeedback.granted||A===n.accessibilityFeedback.alreadyGranted||A===n.notificationsFeedback.granted||A===n.notificationsFeedback.alreadyGranted||A===n.screenFeedback.granted||A===n.screenFeedback.alreadyGranted||A===n.desktopNotify.testShown?`text-emerald-600 dark:text-emerald-400`:`text-fg-muted`),role:`status`,"aria-live":`polite`,children:A}):null,(0,C.jsxs)(b,{children:[(0,C.jsxs)(`div`,{className:`mb-4 flex items-center gap-2 text-sm font-semibold text-fg`,children:[(0,C.jsx)(f,{className:`size-4 text-accent`,strokeWidth:1.75}),n.behaviorGroup]}),(0,C.jsxs)(`div`,{className:`space-y-2`,children:[(0,C.jsxs)(`label`,{className:`flex items-center justify-between gap-3 rounded-xl bg-surface-hover/50 px-3 py-2.5`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:t.endpointToolsSettings.deviceAccess.background}),(0,C.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.endpointToolsSettings.deviceAccess.sleep})]}),(0,C.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,disabled:!s?.backgroundSupported,checked:!!s?.runInBackground,onChange:e=>void H({runInBackground:e.target.checked})})]}),(0,C.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-xl bg-surface-hover/50 px-3 py-2.5 dark:bg-surface-hover/35`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:n.toggles.openAtLogin}),(0,C.jsx)(`p`,{className:`text-xs text-fg-muted`,children:n.toggles.openAtLoginDesc})]}),(0,C.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,disabled:!s,checked:!!s?.openAtLogin,onChange:e=>{H({openAtLogin:e.target.checked})}})]}),(0,C.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-xl bg-surface-hover/50 px-3 py-2.5 dark:bg-surface-hover/35`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:n.toggles.keepAwake}),(0,C.jsx)(`p`,{className:`text-xs text-fg-muted`,children:n.toggles.keepAwakeDesc})]}),(0,C.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,disabled:!s,checked:!!s?.keepAwakePreferred,onChange:e=>{H({keepAwakePreferred:e.target.checked})}})]}),(0,C.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-xl bg-surface-hover/50 px-3 py-2.5 dark:bg-surface-hover/35`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:n.toggles.notifyDesktop}),(0,C.jsx)(`p`,{className:`text-xs text-fg-muted`,children:n.toggles.notifyDesktopDesc})]}),(0,C.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,disabled:!s||N,checked:!!s?.notifyEnabled,onChange:e=>{U(e.target.checked)}})]}),(0,C.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-xl bg-surface-hover/50 px-3 py-2.5 dark:bg-surface-hover/35`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:n.toggles.notifySound}),(0,C.jsx)(`p`,{className:`text-xs text-fg-muted`,children:n.toggles.notifySoundDesc})]}),(0,C.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,disabled:!s,checked:!!s?.notifySoundEnabled,onChange:e=>{H({notifySoundEnabled:e.target.checked})}})]})]})]}),s&&c?(0,C.jsxs)(`section`,{className:y(),children:[(0,C.jsxs)(`div`,{className:`mb-4 flex flex-col gap-1 sm:flex-row sm:items-center sm:justify-between`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:n.permissionsTitle}),(0,C.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:Y}),s.platform===`darwin`&&!s.packaged?(0,C.jsx)(`p`,{className:`mt-1 text-xs text-amber-600 dark:text-amber-400`,children:n.permissionsHintDevDarwin}):null]}),(0,C.jsxs)(`button`,{type:`button`,disabled:R||N,"aria-busy":R,className:p(`mt-2 inline-flex max-w-full items-center justify-center gap-1.5 rounded-lg border border-edge bg-surface-panel px-3 py-1.5 text-sm font-medium text-fg transition-colors hover:bg-surface-hover disabled:opacity-50 sm:mt-0`,m.press),onClick:()=>void V(),children:[(0,C.jsx)(d,{className:p(`size-3.5`,R&&`animate-spin`),strokeWidth:1.75,"aria-hidden":!0}),R?n.refreshing:n.refresh]})]}),(0,C.jsx)(`ul`,{className:`space-y-3`,children:P(s.platform).map(({key:t,pane:r})=>{let i=F(e,c[t]),a=n.perm[t],o=c[t]===`unknown`?I(e,t,s.platform):null;return a?(0,C.jsxs)(`li`,{className:`flex flex-col gap-2 rounded-xl bg-surface-panel/70 p-3 shadow-surface sm:flex-row sm:items-center sm:justify-between`,children:[(0,C.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,C.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:a.title}),(0,C.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:a.desc}),(0,C.jsx)(`p`,{className:`mt-1 text-xs font-medium ${i.className}`,children:i.label}),o?(0,C.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:o}):null]}),(0,C.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2`,children:[t===`notifications`&&j(t,c[t],s.platform)?(0,C.jsx)(`button`,{type:`button`,disabled:N,className:p(`inline-flex items-center gap-1 rounded-lg border border-edge bg-surface-base px-2.5 py-1.5 text-xs font-medium text-fg hover:bg-surface-hover disabled:opacity-50`,m.press),onClick:()=>void q(),children:n.requestAccess}):null,t===`microphone`&&j(t,c[t],s.platform)?(0,C.jsx)(`button`,{type:`button`,disabled:N,className:p(`inline-flex items-center gap-1 rounded-lg border border-edge bg-surface-base px-2.5 py-1.5 text-xs font-medium text-fg hover:bg-surface-hover disabled:opacity-50`,m.press),onClick:()=>void G(),children:n.requestAccess}):null,t===`accessibility`&&j(t,c[t],s.platform)?(0,C.jsx)(`button`,{type:`button`,disabled:N,className:p(`inline-flex items-center gap-1 rounded-lg border border-edge bg-surface-base px-2.5 py-1.5 text-xs font-medium text-fg hover:bg-surface-hover disabled:opacity-50`,m.press),onClick:()=>void K(),children:n.requestAccess}):null,t===`screen`&&j(t,c[t],s.platform)?(0,C.jsx)(`button`,{type:`button`,disabled:N,className:p(`inline-flex items-center gap-1 rounded-lg border border-edge bg-surface-base px-2.5 py-1.5 text-xs font-medium text-fg hover:bg-surface-hover disabled:opacity-50`,m.press),onClick:()=>void J(),children:n.requestAccess}):null,M(t,c[t],s.platform)?(0,C.jsxs)(`button`,{type:`button`,className:p(`inline-flex items-center gap-1.5 rounded-lg border border-edge bg-surface-base px-2.5 py-1.5 text-xs font-medium text-fg hover:bg-surface-hover`,m.press),onClick:()=>void W(r),children:[n.openSettings,(0,C.jsx)(u,{className:`size-3.5`,strokeWidth:1.75,"aria-hidden":!0})]}):null]})]},t):null})})]}):null]})}export{R as SystemSettingsPanel};
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,t as n}from"./vendor-react-BOUWij0V.js";import{n as r}from"./locale-store-CeEXxDaP.js";import{t as i}from"./messages-L7tv_OPK.js";import{d as a,l as o,n as s,r as c,u as l}from"./browser-notification-delivery-DmE2FgGc.js";import{t as u}from"./external-link-DjqjBmc3.js";import{t as d}from"./refresh-cw-BRlGaq2w.js";import{t as f}from"./shield-B1sI_cxl.js";import{t as p}from"./cn-0WouolD0.js";import{n as m}from"./interaction-BdhHBbYa.js";import{n as h}from"./electron-env-DHOGevH3.js";import{r as g}from"./settings-form-draft-Dy10ldo8.js";import{n as _,t as v}from"./settings-page-header-Wx54i9EL.js";import"./settings-page-layout-DDTKMXIb.js";import{r as y,t as b}from"./settings-form-section-num14vSv.js";var x=e(t(),1);async function S(e,t){let n=window.electronAPI?.system;if(!h()||!n?.requestNotifications)return`unsupported`;let r=await n.requestNotifications();if(r.status!==`granted`)return r.outcome===`opened-settings`||r.status===`denied`?`denied`:`default`;await n.setBehavior({notifyEnabled:!0});let i=await n.showEndpointNotification({title:e,body:t});return i.ok||await n.setBehavior({notifyEnabled:!1}),i.ok?`enabled`:`default`}var C=n();function w(){let e=i(r(e=>e.language)).systemSettings.browserNotify,[t,n]=(0,x.useState)(o),[u,d]=(0,x.useState)(null),[f,p]=(0,x.useState)(!1),m=async t=>{if(!t){n(l({enabled:!1})),d(null);return}p(!0);try{let t=await s();if(t!==`granted`){d(t===`unsupported`?e.unsupported:e.denied);return}let r=l({enabled:!0});n(r),d(await c(e.testTitle,e.testBody)?e.testShown:e.failed)}finally{p(!1)}},h=e=>{n(l(e))};return(0,C.jsxs)(_,{gap:`gap-6`,children:[(0,C.jsx)(v,{title:e.pageTitle}),(0,C.jsxs)(b,{children:[(0,C.jsxs)(`div`,{className:`mb-4 flex items-center gap-2 text-sm font-semibold text-fg`,children:[(0,C.jsx)(a,{className:`size-4 text-accent`,strokeWidth:1.75}),e.title]}),(0,C.jsx)(`p`,{className:`mb-4 text-sm text-fg-muted`,children:e.description}),(0,C.jsx)(`div`,{className:`space-y-2`,children:[[`enabled`,e.enabled,e.enabledDesc],[`completed`,e.completed,e.completedDesc],[`failed`,e.failedRuns,e.failedRunsDesc],[`needsInput`,e.needsInput,e.needsInputDesc]].map(([e,n,r])=>(0,C.jsxs)(`label`,{className:`flex items-center justify-between gap-3 rounded-xl bg-surface-hover/50 px-3 py-2.5 dark:bg-surface-hover/35`,children:[(0,C.jsxs)(`span`,{children:[(0,C.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:n}),(0,C.jsx)(`span`,{className:`block text-xs text-fg-muted`,children:r})]}),(0,C.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,disabled:f||e!==`enabled`&&!t.enabled,checked:t[e],onChange:t=>{e===`enabled`?m(t.target.checked):h({[e]:t.target.checked})}})]},e))}),u?(0,C.jsx)(`p`,{className:`mt-3 text-sm text-fg-muted`,role:`status`,children:u}):null,(0,C.jsx)(`p`,{className:`mt-4 text-xs text-fg-muted`,children:e.limitation})]})]})}async function T(){if(typeof navigator>`u`||!navigator.mediaDevices?.getUserMedia)return!1;try{let e=await navigator.mediaDevices.getUserMedia({audio:!0});for(let t of e.getTracks())t.stop();return!0}catch{return!1}}function E(e,t,n){return e.outcome===`opened-settings`?n.openedSettings:e.status===`granted`&&t?e.outcome===`already-granted`?n.alreadyGranted:n.granted:t?e.status===`denied`?n.denied:n.prompted:n.rendererDenied}function D(e,t){return e.outcome===`opened-settings`?t.openedSettings:e.status===`granted`?e.outcome===`already-granted`?t.alreadyGranted:t.granted:t.denied}function O(e,t){return e.outcome===`opened-settings`?t.openedSettings:e.status===`granted`?e.outcome===`already-granted`?t.alreadyGranted:t.granted:e.status===`denied`?t.denied:t.prompted}function k(e,t){return e.outcome===`opened-settings`?t.openedSettings:e.status===`granted`?e.outcome===`already-granted`?t.alreadyGranted:t.granted:e.status===`denied`?t.denied:t.prompted}var A=new Set([`microphone`,`accessibility`,`notifications`,`screen`]);function j(e,t,n){return t===`granted`?!1:e===`accessibility`&&(n===`darwin`||n===`win32`||n===`linux`)||e===`screen`&&(n===`darwin`||n===`win32`)||A.has(e)?t===`unknown`:!1}function M(e,t,n){return e===`accessibility`?!1:e===`screen`&&n===`linux`||!A.has(e)||t===`denied`}var N=[{key:`fullDisk`,pane:`fullDisk`,platforms:[`darwin`]},{key:`screen`,pane:`screen`},{key:`microphone`,pane:`microphone`},{key:`accessibility`,pane:`accessibility`},{key:`automation`,pane:`automation`},{key:`notifications`,pane:`notifications`},{key:`location`,pane:`location`}];function P(e){return e===`linux`?N:N.filter(t=>!t.platforms||t.platforms.includes(e))}function F(e,t){let n=i(e).systemSettings.status;return t===`granted`?{label:n.granted,className:`text-emerald-600 dark:text-emerald-400`}:t===`denied`?{label:n.denied,className:`text-amber-600 dark:text-amber-400`}:{label:n.unknown,className:`text-fg-muted`}}function I(e,t,n){let r=i(e).systemSettings.permUnknown?.[t];return r?n===`darwin`&&r.darwin?r.darwin:n===`win32`&&r.win32?r.win32:n===`linux`&&r.linux?r.linux:null:null}var L={behavior:null,perms:null,loadError:null,permFeedback:null,permBusy:!1,refreshing:!1};function R(){let e=r(e=>e.language),t=i(e),n=t.systemSettings,[a,o]=(0,x.useReducer)(g,L),{behavior:s,perms:c,loadError:l,permFeedback:A,permBusy:N,refreshing:R}=a,z=typeof window<`u`?window.electronAPI?.system:void 0,B=(0,x.useCallback)(async e=>{if(z){o({type:`patch`,patch:{loadError:null}});try{let t=await z.getBehavior(),r=await z.getPermissions({probe:e?.showRefreshFeedback});o({type:`patch`,patch:{behavior:t,perms:r,...e?.showRefreshFeedback?{permFeedback:n.refreshDone}:{}}})}catch(t){o({type:`patch`,patch:{loadError:t instanceof Error?t.message:String(t),...e?.showRefreshFeedback?{permFeedback:null}:{}}})}}},[z,n.refreshDone]),V=(0,x.useCallback)(async()=>{if(!(R||N)){o({type:`patch`,patch:{refreshing:!0}});try{await B({showRefreshFeedback:!0})}finally{o({type:`patch`,patch:{refreshing:!1}})}}},[B,N,R]);if((0,x.useEffect)(()=>{let e=new Set([n.refreshDone,n.openSettingsDone,n.openSettingsFailed,n.desktopNotify.testShown]);if(!A||!e.has(A))return;let t=window.setTimeout(()=>{o({type:`patch`,patch:{permFeedback:null}})},3e3);return()=>window.clearTimeout(t)},[A,n.openSettingsDone,n.openSettingsFailed,n.refreshDone,n.desktopNotify.testShown]),(0,x.useEffect)(()=>{h()&&z&&B()},[z,B]),!h()||!z)return(0,C.jsx)(w,{});let H=async e=>{try{let{behavior:t}=await z.setBehavior(e);o({type:`patch`,patch:{behavior:t}})}catch(e){o({type:`patch`,patch:{loadError:e instanceof Error?e.message:String(e)}})}},U=async e=>{if(!e){await H({notifyEnabled:!1});return}o({type:`patch`,patch:{permBusy:!0,permFeedback:null}});try{let e=await S(n.desktopNotify.testTitle,n.desktopNotify.testBody);if(e===`unsupported`){o({type:`patch`,patch:{permFeedback:n.notificationsFeedback.unsupported}});return}if(e===`denied`){o({type:`patch`,patch:{permFeedback:n.desktopNotify.denied}});return}if(e==="default"){o({type:`patch`,patch:{permFeedback:n.notificationsFeedback.default}});return}await H({notifyEnabled:!0}),o({type:`patch`,patch:{perms:await z.getPermissions()}}),o({type:`patch`,patch:{permFeedback:n.desktopNotify.testShown}})}catch(e){o({type:`patch`,patch:{loadError:e instanceof Error?e.message:String(e)}})}finally{o({type:`patch`,patch:{permBusy:!1}})}},W=async e=>{o({type:`patch`,patch:{permFeedback:null}}),o({type:`patch`,patch:{loadError:null}});try{(await z.openPrivacy(e)).ok?o({type:`patch`,patch:{permFeedback:n.openSettingsDone}}):o({type:`patch`,patch:{permFeedback:n.openSettingsFailed}})}catch(e){o({type:`patch`,patch:{loadError:e instanceof Error?e.message:String(e)}})}},G=async()=>{o({type:`patch`,patch:{permBusy:!0,permFeedback:null}}),o({type:`patch`,patch:{loadError:null}});try{let e=await z.requestMicrophone(),t=e.outcome===`opened-settings`||e.status===`denied`?!1:await T();o({type:`patch`,patch:{perms:await z.getPermissions()}}),o({type:`patch`,patch:{permFeedback:E(e,t,n.permFeedback)}})}catch(e){o({type:`patch`,patch:{loadError:e instanceof Error?e.message:String(e)}})}finally{o({type:`patch`,patch:{permBusy:!1}})}},K=async()=>{if(z.requestAccessibility){o({type:`patch`,patch:{permBusy:!0,permFeedback:null}}),o({type:`patch`,patch:{loadError:null}});try{let e=await z.requestAccessibility();o({type:`patch`,patch:{perms:await z.getPermissions()}}),o({type:`patch`,patch:{permFeedback:D(e,n.accessibilityFeedback)}})}catch(e){o({type:`patch`,patch:{loadError:e instanceof Error?e.message:String(e)}})}finally{o({type:`patch`,patch:{permBusy:!1}})}}},q=async()=>{if(z.requestNotifications){o({type:`patch`,patch:{permBusy:!0,permFeedback:null}}),o({type:`patch`,patch:{loadError:null}});try{let e=await z.requestNotifications();o({type:`patch`,patch:{perms:await z.getPermissions()}}),o({type:`patch`,patch:{permFeedback:O(e,n.notificationsFeedback)}})}catch(e){o({type:`patch`,patch:{loadError:e instanceof Error?e.message:String(e)}})}finally{o({type:`patch`,patch:{permBusy:!1}})}}},J=async()=>{if(z.requestScreen){o({type:`patch`,patch:{permBusy:!0,permFeedback:null}}),o({type:`patch`,patch:{loadError:null}});try{let e=await z.requestScreen();o({type:`patch`,patch:{perms:await z.getPermissions()}}),o({type:`patch`,patch:{permFeedback:k(e,n.screenFeedback)}})}catch(e){o({type:`patch`,patch:{loadError:e instanceof Error?e.message:String(e)}})}finally{o({type:`patch`,patch:{permBusy:!1}})}}},Y=s?s.platform===`win32`?n.permissionsHintWin:s.platform===`linux`?n.permissionsHintLinux:s.platform===`darwin`?n.permissionsHintDarwin:n.permissionsHint:n.permissionsHint;return(0,C.jsxs)(_,{gap:`gap-6`,children:[(0,C.jsx)(v,{title:n.title}),l?(0,C.jsx)(`p`,{className:`text-sm text-amber-600 dark:text-amber-400`,role:`alert`,children:l}):null,A?(0,C.jsx)(`p`,{className:p(`text-sm`,A===n.refreshDone||A===n.openSettingsDone||A===n.permFeedback.granted||A===n.permFeedback.alreadyGranted||A===n.accessibilityFeedback.granted||A===n.accessibilityFeedback.alreadyGranted||A===n.notificationsFeedback.granted||A===n.notificationsFeedback.alreadyGranted||A===n.screenFeedback.granted||A===n.screenFeedback.alreadyGranted||A===n.desktopNotify.testShown?`text-emerald-600 dark:text-emerald-400`:`text-fg-muted`),role:`status`,"aria-live":`polite`,children:A}):null,(0,C.jsxs)(b,{children:[(0,C.jsxs)(`div`,{className:`mb-4 flex items-center gap-2 text-sm font-semibold text-fg`,children:[(0,C.jsx)(f,{className:`size-4 text-accent`,strokeWidth:1.75}),n.behaviorGroup]}),(0,C.jsxs)(`div`,{className:`space-y-2`,children:[(0,C.jsxs)(`label`,{className:`flex items-center justify-between gap-3 rounded-xl bg-surface-hover/50 px-3 py-2.5`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:t.endpointToolsSettings.deviceAccess.background}),(0,C.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.endpointToolsSettings.deviceAccess.sleep})]}),(0,C.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,disabled:!s?.backgroundSupported,checked:!!s?.runInBackground,onChange:e=>void H({runInBackground:e.target.checked})})]}),(0,C.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-xl bg-surface-hover/50 px-3 py-2.5 dark:bg-surface-hover/35`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:n.toggles.openAtLogin}),(0,C.jsx)(`p`,{className:`text-xs text-fg-muted`,children:n.toggles.openAtLoginDesc})]}),(0,C.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,disabled:!s,checked:!!s?.openAtLogin,onChange:e=>{H({openAtLogin:e.target.checked})}})]}),(0,C.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-xl bg-surface-hover/50 px-3 py-2.5 dark:bg-surface-hover/35`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:n.toggles.keepAwake}),(0,C.jsx)(`p`,{className:`text-xs text-fg-muted`,children:n.toggles.keepAwakeDesc})]}),(0,C.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,disabled:!s,checked:!!s?.keepAwakePreferred,onChange:e=>{H({keepAwakePreferred:e.target.checked})}})]}),(0,C.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-xl bg-surface-hover/50 px-3 py-2.5 dark:bg-surface-hover/35`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:n.toggles.notifyDesktop}),(0,C.jsx)(`p`,{className:`text-xs text-fg-muted`,children:n.toggles.notifyDesktopDesc})]}),(0,C.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,disabled:!s||N,checked:!!s?.notifyEnabled,onChange:e=>{U(e.target.checked)}})]}),(0,C.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-xl bg-surface-hover/50 px-3 py-2.5 dark:bg-surface-hover/35`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:n.toggles.notifySound}),(0,C.jsx)(`p`,{className:`text-xs text-fg-muted`,children:n.toggles.notifySoundDesc})]}),(0,C.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,disabled:!s,checked:!!s?.notifySoundEnabled,onChange:e=>{H({notifySoundEnabled:e.target.checked})}})]})]})]}),s&&c?(0,C.jsxs)(`section`,{className:y(),children:[(0,C.jsxs)(`div`,{className:`mb-4 flex flex-col gap-1 sm:flex-row sm:items-center sm:justify-between`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:n.permissionsTitle}),(0,C.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:Y}),s.platform===`darwin`&&!s.packaged?(0,C.jsx)(`p`,{className:`mt-1 text-xs text-amber-600 dark:text-amber-400`,children:n.permissionsHintDevDarwin}):null]}),(0,C.jsxs)(`button`,{type:`button`,disabled:R||N,"aria-busy":R,className:p(`mt-2 inline-flex max-w-full items-center justify-center gap-1.5 rounded-lg border border-edge bg-surface-panel px-3 py-1.5 text-sm font-medium text-fg transition-colors hover:bg-surface-hover disabled:opacity-50 sm:mt-0`,m.press),onClick:()=>void V(),children:[(0,C.jsx)(d,{className:p(`size-3.5`,R&&`animate-spin`),strokeWidth:1.75,"aria-hidden":!0}),R?n.refreshing:n.refresh]})]}),(0,C.jsx)(`ul`,{className:`space-y-3`,children:P(s.platform).map(({key:t,pane:r})=>{let i=F(e,c[t]),a=n.perm[t],o=c[t]===`unknown`?I(e,t,s.platform):null;return a?(0,C.jsxs)(`li`,{className:`flex flex-col gap-2 rounded-xl bg-surface-panel/70 p-3 shadow-surface sm:flex-row sm:items-center sm:justify-between`,children:[(0,C.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,C.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:a.title}),(0,C.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:a.desc}),(0,C.jsx)(`p`,{className:`mt-1 text-xs font-medium ${i.className}`,children:i.label}),o?(0,C.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:o}):null]}),(0,C.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2`,children:[t===`notifications`&&j(t,c[t],s.platform)?(0,C.jsx)(`button`,{type:`button`,disabled:N,className:p(`inline-flex items-center gap-1 rounded-lg border border-edge bg-surface-base px-2.5 py-1.5 text-xs font-medium text-fg hover:bg-surface-hover disabled:opacity-50`,m.press),onClick:()=>void q(),children:n.requestAccess}):null,t===`microphone`&&j(t,c[t],s.platform)?(0,C.jsx)(`button`,{type:`button`,disabled:N,className:p(`inline-flex items-center gap-1 rounded-lg border border-edge bg-surface-base px-2.5 py-1.5 text-xs font-medium text-fg hover:bg-surface-hover disabled:opacity-50`,m.press),onClick:()=>void G(),children:n.requestAccess}):null,t===`accessibility`&&j(t,c[t],s.platform)?(0,C.jsx)(`button`,{type:`button`,disabled:N,className:p(`inline-flex items-center gap-1 rounded-lg border border-edge bg-surface-base px-2.5 py-1.5 text-xs font-medium text-fg hover:bg-surface-hover disabled:opacity-50`,m.press),onClick:()=>void K(),children:n.requestAccess}):null,t===`screen`&&j(t,c[t],s.platform)?(0,C.jsx)(`button`,{type:`button`,disabled:N,className:p(`inline-flex items-center gap-1 rounded-lg border border-edge bg-surface-base px-2.5 py-1.5 text-xs font-medium text-fg hover:bg-surface-hover disabled:opacity-50`,m.press),onClick:()=>void J(),children:n.requestAccess}):null,M(t,c[t],s.platform)?(0,C.jsxs)(`button`,{type:`button`,className:p(`inline-flex items-center gap-1.5 rounded-lg border border-edge bg-surface-base px-2.5 py-1.5 text-xs font-medium text-fg hover:bg-surface-hover`,m.press),onClick:()=>void W(r),children:[n.openSettings,(0,C.jsx)(u,{className:`size-3.5`,strokeWidth:1.75,"aria-hidden":!0})]}):null]})]},t):null})})]}):null]})}export{R as SystemSettingsPanel};
@@ -0,0 +1,3 @@
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{_ as i,d as a,f as o,h as s,t as c}from"./chunk-KS7C4IRE-DIIvxCDx.js";import{i as l,l as u,n as d,o as f}from"./locale-store-CeEXxDaP.js";import{t as p}from"./messages-L7tv_OPK.js";import{a as m,i as h,n as g,o as _,r as v,s as y,t as b}from"./dist-DlirbHVs.js";import{J as x,K as S,T as C,g as w,st as T,t as E}from"./chat-page-sPNbEboB.js";import{t as ee}from"./arrow-left-D880xG-P.js";import{f as D,i as O,u as k}from"./automation-display-DaVDNZz8.js";import{t as te}from"./check-DUBLcKHA.js";import{t as A}from"./chevron-right-BweFrslA.js";import{n as j,r as M}from"./popover-select-hRG1EzAY.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"./file-icon-N6WjUhq_.js";import{t as ne}from"./folder-kanban-CpLlFI1o.js";import{t as re}from"./folder-open-CyzJ19I9.js";import{B as ie,H as ae,I as oe,P as se}from"./markdown-view-BQw7H2MV.js";import{t as ce}from"./message-square-fVE7Ghj1.js";import{t as le}from"./pause-DuPxgSxk.js";import{t as ue}from"./play-kxZvpBg8.js";import{t as L}from"./x-B_N4OPjy.js";import{t as R}from"./cn-0WouolD0.js";import{t as de}from"./skeleton-DzdOeGYz.js";import{d as fe}from"./tasks-BIehlq7k.js";import{c as pe}from"./api-5GGJYrzC.js";import{gt as me}from"./session-manager-DQ0fiEo9.js";import{i as he}from"./vendor-swr-CdRzEUwF.js";import{C as ge,D as _e,T as ve,_ as ye,a as be,f as xe,i as Se,l as Ce,n as we,r as Te,u as Ee,x as De}from"./workspace-preview-store-D8eGmciG.js";import{t as Oe}from"./chat-agents-api-JoSvbwve.js";import{t as z}from"./button-C5tRaJxt.js";import{r as ke}from"./right-workspace-store-D3nQJkDG.js";import{c as Ae}from"./composer-payload-handoff-D5CvsQWj.js";import{t as je}from"./page-header-store-hCKJckdJ.js";import{t as Me}from"./agent-avatar-display-umdw-BQZ.js";import{t as Ne}from"./automation-api-DtFbVh6a.js";import{n as Pe}from"./agent-display-names-Bje7vfSn.js";import{t as B}from"./sliding-tab-list-CmcrqRzN.js";import{t as Fe}from"./confirm-dialog-MHCmEEUZ.js";import{l as Ie,m as Le,o as Re,r as ze,t as Be,u as Ve}from"./dist-DaFr5KMw.js";import{d as He,f as Ue,l as We,o as Ge,u as Ke}from"./automation-task-card-BgS9JQeL.js";import{t as qe}from"./date-picker-jqmqOuOL.js";import{t as Je}from"./time-picker-otHjbob1.js";import{n as Ye}from"./date-formatters-DukWSVwc.js";import{n as Xe,r as Ze,t as Qe}from"./task-header-title-Di5TvRaj.js";import{t as $e}from"./date-time-picker-B3n_gScw.js";import{a as et,i as tt,n as nt,o as V,r as H,t as rt}from"./task-run-issue-notice-FMMn1lE6.js";import{t as it}from"./page-context-capture-button-Bm8TI2e0.js";import{t as at}from"./dependency-picker-DEPr5_Wk.js";var U=e(t(),1),W=n(),G=r();function ot(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 st(e){let t=(0,W.c)(32),n,r,a,o,s,c,l;t[0]===e?(n=t[1],r=t[2],a=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,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=a,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]=i(),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=R(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=>ot(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,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`min-w-0 flex-1`,children:l}),(0,G.jsx)(A,{"aria-hidden":!0,className:R(`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,G.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]!==a||t[30]!==x?(S=(0,G.jsxs)(`details`,{...a,open:h,children:[x,n]}),t[27]=n,t[28]=h,t[29]=a,t[30]=x,t[31]=S):S=t[31],S}function ct(e){let t=e;for(;t&&!/(auto|scroll)/.test(getComputedStyle(t).overflowY);)t=t.parentElement;return t}function lt(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=ct(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 ut(e){let t=(0,W.c)(28),{language:n,hasSchedule:r}=e,[a,o]=i(),s;t[0]===a?s=t[1]:(s=a.get(`taskSection`),t[0]=a,t[1]=s);let c=s,l=(0,U.useRef)(null),u=(0,U.useRef)(null),d=(0,U.useRef)(null),f=(0,U.useRef)(void 0),p=(0,U.useRef)(o),m=(0,U.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,U.useEffect)(h,g);let _=(0,U.useRef)(void 0),v=(0,U.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=ot(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=lt(l.current,e)},t[7]=x):x=t[7];let S=x,[C,w]=(0,U.useState)(c??`results`),T;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(T=[],t[8]=T):T=t[8];let[E,ee]=(0,U.useState)(T),D;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(D=()=>{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]`));ee(r.map(dt));let i=0,a=()=>{if(d.current)return;let e=ct(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]=D):D=t[9];let O;t[10]!==r||t[11]!==n?(O=[n,r,b],t[10]=r,t[11]=n,t[12]=O):O=t[12],(0,U.useEffect)(D,O);let k,te;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(te=()=>()=>{clearTimeout(f.current),_.current?.cancel()},k=[],t[13]=k,t[14]=te):(k=t[13],te=t[14]),(0,U.useEffect)(te,k);let A,j;t[15]===c?(A=t[16],j=t[17]):(A=()=>{!c||u.current===c||(u.current=c,w(c),S(c))},j=[c,S],t[15]=c,t[16]=A,t[17]=j),(0,U.useEffect)(A,j);let M;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(M=()=>{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]=M):M=t[18];let N;t[19]!==C||t[20]!==E?(N=[C,E],t[19]=C,t[20]=E,t[21]=N):N=t[21],(0,U.useEffect)(M,N);let P=n===`zh`?`任务详情分区`:`Task detail sections`,F;t[22]!==C||t[23]!==E?(F=E.map(e=>(0,G.jsx)(`button`,{type:`button`,"aria-current":C===e.id?`location`:void 0,"aria-pressed":C===e.id,"data-sliding-active":C===e.id,className:R(`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]=F):F=t[24];let I;return t[25]!==P||t[26]!==F?(I=(0,G.jsx)(B,{scrollFocusedItemIntoView:!1,as:`nav`,ref:l,"aria-label":P,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:F}),t[25]=P,t[26]=F,t[27]=I):I=t[27],I}function dt(e){return{id:e.dataset.taskSection,label:e.dataset.taskSectionLabel}}var ft=`Default criteria were not expanded into concrete acceptance items; broad completion cannot certify item coverage.`;function pt(e){let t=(0,W.c)(64),{criterion:n,index:r,language:i,closed:a,pending:o,onReview:s,projectId:c,conversationId:l}=e,u=i===`zh`,d=(0,U.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]:(_=R(`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,G.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=R(`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,G.jsx)(te,{className:`size-3.5`,strokeWidth:2.8}):null,t[15]=f,t[16]=w);let T;t[17]!==C||t[18]!==w?(T=(0,G.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,G.jsxs)(`label`,{className:_,children:[b,T]}),t[20]=T,t[21]=_,t[22]=b,t[23]=E):E=t[23];let ee=`criterion:${r}:evidence`,D;t[24]!==n.text||t[25]!==d?(D=(0,G.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]=D):D=t[26];let O=u?`验收依据`:`Acceptance evidence`,k;t[27]===O?k=t[28]:(k=(0,G.jsx)(`p`,{className:`font-medium text-fg`,children:O}),t[27]=O,t[28]=k);let A;t[29]!==n.method||t[30]!==m||t[31]!==u?(A=n.method?(0,G.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]=A):A=t[32];let j;t[33]!==n.review||t[34]!==i||t[35]!==h||t[36]!==u?(j=n.review?(0,G.jsxs)(`p`,{children:[u?`人工验收`:`User review`,` · `,h,` · `,Ye(n.review.reviewedAt,i)]}):null,t[33]=n.review,t[34]=i,t[35]=h,t[36]=u,t[37]=j):j=t[37];let M;t[38]!==n.note||t[39]!==r||t[40]!==i?(M=n.note&&n.note!==ft?(0,G.jsx)(V,{content:tt(n.note,i),contentKey:`criterion:${r}:note`,language:i,markdown:!1}):null,t[38]=n.note,t[39]=r,t[40]=i,t[41]=M):M=t[41];let N;t[42]!==l||t[43]!==n.evidence||t[44]!==i||t[45]!==c?(N=(0,G.jsx)(nt,{evidence:n.evidence,projectId:c,conversationId:l,language:i}),t[42]=l,t[43]=n.evidence,t[44]=i,t[45]=c,t[46]=N):N=t[46];let P;t[47]!==p||t[48]!==u?(P=p?null:(0,G.jsx)(`p`,{children:u?`暂无验收依据`:`No evidence yet`}),t[47]=p,t[48]=u,t[49]=P):P=t[49];let F;t[50]!==k||t[51]!==A||t[52]!==j||t[53]!==M||t[54]!==N||t[55]!==P?(F=(0,G.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:[k,A,j,M,N,P]}),t[50]=k,t[51]=A,t[52]=j,t[53]=M,t[54]=N,t[55]=P,t[56]=F):F=t[56];let I;t[57]!==ee||t[58]!==D||t[59]!==F?(I=(0,G.jsx)(st,{panelId:ee,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:D,children:F}),t[57]=ee,t[58]=D,t[59]=F,t[60]=I):I=t[60];let ne;return t[61]!==E||t[62]!==I?(ne=(0,G.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,I]}),t[61]=E,t[62]=I,t[63]=ne):ne=t[63],ne}function mt(e){let t=(0,W.c)(40),{criteria:n,language:r,closed:i,pending:a,blockedReason:o,error:s,onReview:c,projectId:l,conversationId:u,reviewDisabled:d}=e,f=r===`zh`,p;t[0]===n?p=t[1]:(p=n.some(ht),t[0]=n,t[1]=p);let m=p,h;t[2]!==m||t[3]!==r||t[4]!==f?(h=m?(0,G.jsx)(st,{panelId:`acceptance:diagnostic`,title:f?`验收标准需要细化`:`The criteria need more detail`,className:`mx-4 mb-2 text-xs leading-5 text-fg-muted`,children:(0,G.jsx)(`p`,{className:`mt-2 break-words`,children:tt(ft,r)})}):null,t[2]=m,t[3]=r,t[4]=f,t[5]=h):h=t[5];let g=a||void 0,_;if(t[6]!==i||t[7]!==u||t[8]!==n||t[9]!==r||t[10]!==c||t[11]!==a||t[12]!==l||t[13]!==d){let e;t[15]!==i||t[16]!==u||t[17]!==r||t[18]!==c||t[19]!==a||t[20]!==l||t[21]!==d?(e=(e,t)=>(0,G.jsx)(pt,{criterion:e,index:t,language:r,closed:i||!!d,pending:a,onReview:c,projectId:l,conversationId:u},`${t}:${e.text}`),t[15]=i,t[16]=u,t[17]=r,t[18]=c,t[19]=a,t[20]=l,t[21]=d,t[22]=e):e=t[22],_=n.map(e),t[6]=i,t[7]=u,t[8]=n,t[9]=r,t[10]=c,t[11]=a,t[12]=l,t[13]=d,t[14]=_}else _=t[14];let v;t[23]!==g||t[24]!==_?(v=(0,G.jsx)(`ul`,{"aria-busy":g,className:`border-t border-edge-subtle`,children:_}),t[23]=g,t[24]=_,t[25]=v):v=t[25];let y;t[26]!==n.length||t[27]!==f?(y=n.length===0?(0,G.jsx)(`p`,{className:`px-4 py-4 text-sm text-fg-muted`,children:f?`尚未定义验收标准`:`No acceptance criteria defined`}):null,t[26]=n.length,t[27]=f,t[28]=y):y=t[28];let b;t[29]===s?b=t[30]:(b=s?(0,G.jsx)(`p`,{role:`alert`,className:`mx-4 my-2 text-sm text-danger`,children:s}):null,t[29]=s,t[30]=b);let x;t[31]!==o||t[32]!==i?(x=!i&&o?(0,G.jsx)(`p`,{className:`border-t border-edge-subtle px-4 py-2.5 text-xs text-fg-muted`,children:o}):null,t[31]=o,t[32]=i,t[33]=x):x=t[33];let S;return t[34]!==h||t[35]!==v||t[36]!==y||t[37]!==b||t[38]!==x?(S=(0,G.jsxs)(G.Fragment,{children:[h,v,y,b,x]}),t[34]=h,t[35]=v,t[36]=y,t[37]=b,t[38]=x,t[39]=S):S=t[39],S}function ht(e){return e.note===ft}function gt(e){let t=(0,W.c)(27),{detail:n,language:r}=e,i=r===`zh`,o=a(),s;if(t[0]!==n||t[1]!==r||t[2]!==o||t[3]!==i){let e=n.deliverables??[],a=we(n),l=a&&H(a,r),u;if(t[5]!==n.runs||t[6]!==n.task){let e;t[8]===n.task?e=t[9]:(e=e=>e.contractVersion===n.task.latestContractVersion,t[8]=n.task,t[9]=e),u=new Set(n.runs.filter(e).map(Ct)),t[5]=n.runs,t[6]=n.task,t[7]=u}else u=t[7];let d=u,f=n.context.filter(St).map(xt),p=new Set(e.flatMap(bt).filter(Boolean)),m=new Set([...f.map(yt),...p].filter(Boolean)),h;t[10]===d?h=t[11]:(h=e=>d.has(e.runId),t[10]=d,t[11]=h);for(let e of n.receipts.filter(h))for(let t of e.evidence.filter(vt))t.uri&&m.has(t.uri)||(t.uri&&m.add(t.uri),f.push(t));let g=l?.summary,_=g&&g.length<=160&&!g.includes(`
2
+ `)&&!/\b(?:Claim|Criterion|Research claim)\b|c-ac\d|Default criteria were not/i.test(g)?g:void 0,v=f.filter(e=>!p.has(e.uri)),y=i?`交付结果`:`Deliverables`,b;t[12]===y?b=t[13]:(b=(0,G.jsx)(`h2`,{id:`task-results-heading`,className:`text-sm font-semibold text-fg`,children:y}),t[12]=y,t[13]=b);let x;t[14]!==e||t[15]!==n||t[16]!==o||t[17]!==i?(x=e.length?(0,G.jsx)(`ul`,{className:`mt-3 grid gap-2 sm:grid-cols-2`,children:e.map(e=>{let t=e.artifact?.title??e.reference?.title??e.id;return(0,G.jsxs)(`li`,{className:`min-w-0`,children:[(0,G.jsxs)(Ze,{item:e,conversationId:e.task?.conversationId??n.conversation.activeConversationId,backgroundPath:`${o.pathname}${o.search}`,zh:i,className:`flex min-h-11 w-full min-w-0 items-center gap-2 rounded-lg bg-surface-inset px-3 py-2 text-left text-sm text-fg hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,G.jsx)(I,{name:t}),(0,G.jsx)(`span`,{className:`min-w-0 break-words [overflow-wrap:anywhere]`,children:t})]}),e.artifact?.availability===`available`&&e.artifact.uri?.startsWith(`media://outbound/`)?(0,G.jsx)(w,{file:e.artifact,zh:i}):null]},e.id)})}):null,t[14]=e,t[15]=n,t[16]=o,t[17]=i,t[18]=x):x=t[18];let S;t[19]!==n||t[20]!==r||t[21]!==v?(S=v.length?(0,G.jsx)(nt,{evidence:v,language:r,projectId:n.task.projectId,conversationId:n.conversation.activeConversationId??void 0,compact:!0}):null,t[19]=n,t[20]=r,t[21]=v,t[22]=S):S=t[22];let C;t[23]!==e||t[24]!==v.length||t[25]!==i?(C=!e.length&&!v.length?(0,G.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:i?`尚无可查看的交付物`:`No deliverables available yet`}):null,t[23]=e,t[24]=v.length,t[25]=i,t[26]=C):C=t[26],s=(0,G.jsxs)(`section`,{"aria-label":i?`交付结果`:`Deliverables`,className:`rounded-xl bg-surface-panel p-4`,children:[b,_?(0,G.jsx)(`p`,{className:`mt-2 break-words text-sm leading-6 text-fg-muted [overflow-wrap:anywhere]`,children:_}):null,a&&a.completionVerdict!==`achieved`?(0,G.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:i?`本次执行尚未报告目标全部达成。`:`This run has not reported the full goal achieved.`}):null,x,S,C,a?null:(0,G.jsx)(`p`,{className:`mt-2 text-xs text-fg-subtle`,children:i?`尚无本版任务的执行结果`:`No run result for this task version`}),a&&l&&(a.needsUser||l.remainingWork.length>0||l.nextAction)?(0,G.jsxs)(`div`,{className:`mt-4 space-y-2 border-t border-edge-subtle pt-3`,"aria-label":i?`执行待办`:`Run follow-up`,children:[(0,G.jsx)(`h3`,{className:`text-xs font-medium text-fg-muted`,children:a.needsUser?i?`需要你决定`:`Your decision needed`:i?`待处理事项`:`Remaining work`}),l.remainingWork.length>0?(0,G.jsx)(`ul`,{className:`space-y-2 text-sm leading-6 text-fg`,children:l.remainingWork.map(_t)}):null,l.nextAction?(0,G.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-sm leading-6 text-fg [overflow-wrap:anywhere]`,children:l.nextAction}):null,a.needsUser?(0,G.jsx)(c,{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:se(n.task.id),children:i?`查看并决定`:`Review and decide`}):null]}):null]}),t[0]=n,t[1]=r,t[2]=o,t[3]=i,t[4]=s}else s=t[4];return s}function _t(e){return(0,G.jsx)(`li`,{className:`whitespace-pre-wrap break-words [overflow-wrap:anywhere]`,children:e},e)}function vt(e){return e.kind===`artifact`}function yt(e){return e.uri}function bt(e){return[e.artifact?.uri,e.artifact?.shareUrl,e.artifact?.workspaceRelativePath]}function xt(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 St(e){return e.role===`deliverable`}function Ct(e){return e.id}function wt(e){let t=(0,W.c)(14),{detail:n,receipt:r,language:i}=e,a;t[0]!==n.runs||t[1]!==i||t[2]!==r?(a=H(r,i,n.runs.find(e=>e.id===r.runId)?.terminalMessage),t[0]=n.runs,t[1]=i,t[2]=r,t[3]=a):a=t[3];let o=a,s;t[4]===o.issue?s=t[5]:(s=o.issue?(0,G.jsx)(rt,{issue:o.issue}):null,t[4]=o.issue,t[5]=s);let c;t[6]!==n.task||t[7]!==i||t[8]!==r||t[9]!==o.summary?(c=o.summary?(0,G.jsx)(V,{content:o.summary,contentKey:`${n.task.id}:result:${r.runId}`,language:i}):null,t[6]=n.task,t[7]=i,t[8]=r,t[9]=o.summary,t[10]=c):c=t[10];let l;return t[11]!==s||t[12]!==c?(l=(0,G.jsxs)(G.Fragment,{children:[s,c]}),t[11]=s,t[12]=c,t[13]=l):l=t[13],l}function Tt(e){let t=(0,W.c)(19),{detail:n,language:r}=e,i=r===`zh`,a=Ae(r),o;t[0]===n?o=t[1]:(o=we(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,U.useState)(`idle`),f;t[4]===s?f=t[5]:(f=async function(e){if(s){d(`pending`);try{await ge(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,G.jsx)(x,{detail:n,language:r}),t[6]=n,t[7]=r,t[8]=m):m=t[8];let h=s?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,G.jsx)(`h3`,{className:`text-sm font-medium text-fg`,children:a.latestResult}),(0,G.jsxs)(`span`,{className:`text-xs text-fg-muted`,children:[a.receiptStatuses[s.status],` · `,a.verificationStatuses[s.verification.status]]})]}),(0,G.jsx)(wt,{detail:n,receipt:s,language:r}),s.evidence.length>0?(0,G.jsxs)(`details`,{children:[(0,G.jsxs)(`summary`,{className:`cursor-pointer py-2 text-xs text-fg-muted`,children:[i?`验证依据与执行产物`:`Evidence and artifacts`,` · `,s.evidence.length]}),(0,G.jsx)(nt,{evidence:s.evidence,projectId:n.task.projectId,conversationId:n.conversation.activeConversationId??void 0,language:r})]}):null,(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-t border-edge-subtle pt-3`,children:[(0,G.jsx)(z,{variant:`ghost`,className:`min-h-9 px-2 text-xs`,disabled:u===`pending`,onClick:()=>void p(`helpful`),children:a.doneWell}),(0,G.jsx)(z,{variant:`ghost`,className:`min-h-9 px-2 text-xs`,disabled:u===`pending`,onClick:()=>void p(`not_helpful`),children:a.needsFix}),u===`saved`?(0,G.jsx)(`span`,{role:`status`,className:`text-xs text-fg-muted`,children:i?`反馈已记录`:`Feedback saved`}):null,u===`failed`?(0,G.jsx)(`span`,{role:`alert`,className:`text-xs text-danger`,children:a.actionFailed}):null]})]}):null,g=l.length>0?(0,G.jsxs)(`details`,{className:`border-t border-edge-subtle pt-3`,children:[(0,G.jsx)(`summary`,{className:`cursor-pointer py-2 text-xs text-fg-muted`,children:a.executionHistory.replace(`{{count}}`,String(l.length))}),(0,G.jsx)(`div`,{className:`mt-3 space-y-4`,children:l.map(e=>(0,G.jsxs)(`article`,{className:`space-y-2 rounded-lg bg-surface-hover p-3`,children:[(0,G.jsx)(`p`,{className:`text-xs text-fg-muted`,children:a.receiptStatuses[e.status]}),(0,G.jsx)(wt,{detail:n,receipt:e,language:r})]},e.runId))})]}):null,_;t[9]!==a||t[10]!==n.criterionReviewHistory||t[11]!==r||t[12]!==i?(_=n.criterionReviewHistory?.length?(0,G.jsxs)(`details`,{className:`border-t border-edge-subtle pt-3`,children:[(0,G.jsx)(`summary`,{className:`cursor-pointer py-2 text-xs text-fg-muted`,children:i?`历史验收判定`:`Past criterion reviews`}),(0,G.jsx)(`ul`,{className:`mt-2 space-y-2 text-sm`,children:n.criterionReviewHistory.map(e=>(0,G.jsxs)(`li`,{className:`rounded-lg bg-surface-hover p-3`,children:[(0,G.jsx)(`p`,{children:e.criterionText}),(0,G.jsxs)(`p`,{className:`text-xs text-fg-muted`,children:[a.verificationStatuses[e.status],` · `,Ye(e.reviewedAt,r)]}),e.note?(0,G.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:tt(e.note,r)}):null]},`${e.contractVersion}:${e.resultId??``}:${e.criterionIndex}`))})]}):null,t[9]=a,t[10]=n.criterionReviewHistory,t[11]=r,t[12]=i,t[13]=_):_=t[13];let v;return t[14]!==m||t[15]!==h||t[16]!==g||t[17]!==_?(v=(0,G.jsxs)(`div`,{className:`space-y-4`,children:[m,h,g,_]}),t[14]=m,t[15]=h,t[16]=g,t[17]=_,t[18]=v):v=t[18],v}function Et(e){let t=(0,W.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,G.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,G.jsxs)(`li`,{className:`text-sm text-fg`,children:[(0,G.jsxs)(`div`,{children:[o[e.fromPhase],e.fromResolution?` · ${u[e.fromResolution]}`:``,` → `,o[e.toPhase],e.toResolution?` · ${u[e.toResolution]}`:``]}),(0,G.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,G.jsx)(`time`,{dateTime:new Date(e.createdAt).toISOString(),children:Ye(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,G.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,G.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,G.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 Dt({schedules:e,language:t,onEdit:n,onUpdated:r}){let i=t===`zh`,a=p(t),[o,s]=(0,U.useState)(null),l=(0,U.useRef)(!1),[u,d]=(0,U.useState)(null),f=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,s(e.id),d(null);try{r((await Ne.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,s(null)}}}return(0,G.jsxs)(`section`,{"aria-label":i?`执行时间`:`Execution schedule`,className:`rounded-xl bg-surface-inset p-4`,children:[(0,G.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:i?`执行时间`:`Execution schedule`}),(0,G.jsx)(`div`,{className:`mt-3 space-y-4`,children:e.map(e=>{let r=e.trigger.kind===`schedule`?e.trigger.schedule:null,s=k(e),l=!e.management||e.management.editable.includes(`trigger`),u=!e.management||e.management.editable.includes(`enabled`);return(0,G.jsxs)(`article`,{className:`space-y-2 text-sm text-fg`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,G.jsx)(`span`,{className:`break-words font-medium`,children:e.name}),(0,G.jsx)(`span`,{className:`text-xs text-fg-muted`,children:s?i?`已执行`:`Completed`:e.enabled?i?`已启用`:`Enabled`:i?`已取消定时执行`:`Scheduling disabled`})]}),(0,G.jsx)(`p`,{children:r?.kind===`once`?`${i?`单次执行:`:`Run once: `}${f(Date.parse(r.at))}`:O(e.trigger,a.automations,a.cron,t)}),r?.kind===`cron`?(0,G.jsxs)(`p`,{className:`text-xs text-fg-muted`,children:[i?`执行时区:`:`Schedule timezone: `,r.tz||(i?`服务所在电脑时区`:`Server timezone`)]}):null,(0,G.jsxs)(`p`,{className:`text-fg-muted`,children:[i?`下次执行:`:`Next run: `,s?i?`已执行,无后续计划`:`Completed; no upcoming run`:e.enabled?e.state.nextRunAtMs===void 0?i?`暂无后续执行`:`No upcoming run`:f(e.state.nextRunAtMs):i?`已取消,不再自动执行`:`Disabled; no automatic runs`]}),(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[l?(0,G.jsx)(z,{variant:`secondary`,disabled:o!==null,onClick:()=>n(e),children:i?`修改时间`:`Edit schedule`}):null,e.enabled&&u?(0,G.jsx)(z,{variant:`ghost`,disabled:o!==null,onClick:()=>void m(e),children:o===e.id?i?`正在取消…`:`Cancelling…`:i?`取消定时执行`:`Cancel schedule`}):null,(0,G.jsx)(z,{asChild:!0,variant:`ghost`,children:(0,G.jsx)(c,{to:`/automations?automation=${encodeURIComponent(e.id)}`,children:i?`查看自动化`:`View automation`})})]})]},e.id)})}),u?(0,G.jsx)(`p`,{role:`alert`,className:`mt-3 text-sm text-danger`,children:u}):null]})}var Ot=`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 kt({taskId:e,taskTitle:t,projectId:n,executorAgentId:r,language:i,onClose:a,onCreated:o,automation:s}){let l=i===`zh`,u=p(i).automations,[d,f]=(0,U.useState)(()=>s?He(s):{...Ue,name:t,projectId:n??``,actionMode:`task_command`,taskId:e,agentId:r??``,triggerMode:`once`,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`}),[x,S]=(0,U.useState)(null),[C,w]=(0,U.useState)(!1),T=(0,U.useRef)(!1),[E,ee]=(0,U.useState)(null),D=e=>f(t=>({...t,...e}));async function O(e){if(e.preventDefault(),!(T.current||x)&&(ee(null),!(!d.name.trim()||!s&&!r))){if(d.triggerMode===`once`&&(!Number.isFinite(new Date(d.onceAt).getTime())||new Date(d.onceAt).getTime()<=Date.now())){ee(u.experience.futureTime);return}T.current=!0,w(!0);try{let e=s?We(s,d).trigger:Ke(d).trigger,{automation:t}=s?await Ne.update(s.id,{trigger:e,...s.management?{}:{name:d.name.trim(),delivery:{...s.delivery,notificationPolicy:d.notificationPolicy}},...!s.management||s.management.editable.includes(`enabled`)?{enabled:!0}:{},expectedRevision:s.updatedAtMs}):await Ne.create({...Ke(d),enabled:!0});S(t),o(t)}catch(e){ee(e instanceof Error?e.message:u.feedback.actionFailed)}finally{T.current=!1,w(!1)}}}return(0,G.jsx)(b,{open:!0,onOpenChange:e=>{!e&&!T.current&&a()},children:(0,G.jsxs)(_,{children:[(0,G.jsx)(m,{className:`fixed inset-0 z-[110] bg-black/45`}),(0,G.jsxs)(v,{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,G.jsxs)(`header`,{className:`flex shrink-0 items-center justify-between gap-3 border-b border-edge-subtle px-5 py-4`,children:[(0,G.jsx)(y,{className:`text-base font-semibold text-fg`,children:s?l?`修改执行时间`:`Edit execution schedule`:l?`设置执行时间`:`Set execution time`}),(0,G.jsx)(g,{asChild:!0,children:(0,G.jsx)(z,{variant:`ghost`,className:`size-9 p-0`,disabled:C,"aria-label":l?`关闭`:`Close`,children:(0,G.jsx)(L,{className:`size-4`})})})]}),(0,G.jsx)(h,{className:`sr-only`,children:l?`为当前任务创建定时或周期自动化。`:`Create a scheduled or recurring automation for this task.`}),x?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto p-5`,children:[(0,G.jsx)(`p`,{role:`status`,className:`text-sm font-medium text-fg`,children:s?l?`执行时间已更新`:`Schedule updated`:l?`执行时间已设置`:`Schedule created`}),(0,G.jsx)(`p`,{className:`break-words text-sm text-fg-muted`,children:x.name}),(0,G.jsx)(z,{asChild:!0,variant:`primary`,children:(0,G.jsx)(c,{to:`/automations?automation=${encodeURIComponent(x.id)}`,children:l?`查看自动化`:`View automation`})})]}),(0,G.jsx)(`footer`,{className:`shrink-0 border-t border-edge-subtle p-4`,children:(0,G.jsx)(z,{onClick:a,children:l?`完成`:`Done`})})]}):(0,G.jsxs)(`form`,{onSubmit:e=>void O(e),className:`flex min-h-0 flex-1 flex-col`,children:[(0,G.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto p-5`,children:[(0,G.jsxs)(`p`,{className:`break-words text-sm text-fg-muted`,children:[l?`执行任务:`:`Task: `,t]}),(0,G.jsxs)(`fieldset`,{disabled:C,className:`space-y-4`,children:[(0,G.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[u.form.name,(0,G.jsx)(`input`,{required:!0,readOnly:!!s?.management,className:Ot,value:d.name,onChange:e=>D({name:e.target.value})})]}),(0,G.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[u.form.trigger,(0,G.jsxs)(j,{value:d.triggerMode,onChange:e=>D({triggerMode:e.target.value}),children:[s?.trigger.kind===`schedule`&&s.trigger.schedule.kind===`interval`?(0,G.jsx)(M,{value:`interval`,children:l?`固定间隔`:`Fixed interval`}):null,s?.trigger.kind===`schedule`&&s.trigger.schedule.kind===`cron`?(0,G.jsx)(M,{value:`cron`,children:l?`自定义规则`:`Custom schedule`}):null,(0,G.jsx)(M,{value:`once`,children:u.trigger.once}),(0,G.jsx)(M,{value:`daily`,children:u.trigger.daily}),(0,G.jsx)(M,{value:`weekly`,children:u.trigger.weekly})]})]}),d.triggerMode===`once`?(0,G.jsx)($e,{label:u.form.onceAt,disabled:C,value:d.onceAt,defaultTime:d.time,onChange:e=>D({onceAt:e})}):[`daily`,`weekly`].includes(d.triggerMode)?(0,G.jsxs)(`div`,{className:`grid gap-2 text-sm text-fg`,children:[(0,G.jsx)(`span`,{children:u.form.time}),(0,G.jsx)(Je,{disabled:C,value:d.time,onChange:e=>D({time:e}),ariaLabel:u.form.time})]}):null,d.triggerMode===`weekly`?(0,G.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[u.form.day,(0,G.jsx)(j,{value:d.weekday,onChange:e=>D({weekday:e.target.value}),children:[`sunday`,`monday`,`tuesday`,`wednesday`,`thursday`,`friday`,`saturday`].map((e,t)=>(0,G.jsx)(M,{value:String(t),children:u.weekdays[e]},e))})]}):null,d.triggerMode===`cron`?(0,G.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[l?`定时规则`:`Cron expression`,(0,G.jsx)(`input`,{required:!0,className:Ot,value:d.cronExpr,onChange:e=>D({cronExpr:e.target.value})})]}):null,d.triggerMode===`interval`?(0,G.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,G.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[l?`执行间隔`:`Interval`,(0,G.jsx)(`input`,{required:!0,type:`number`,min:`1`,className:Ot,value:d.intervalValue,onChange:e=>D({intervalValue:e.target.value})})]}),(0,G.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[l?`单位`:`Unit`,(0,G.jsxs)(j,{value:d.intervalUnit,onChange:e=>D({intervalUnit:e.target.value}),children:[(0,G.jsx)(M,{value:`minute`,children:l?`分钟`:`Minutes`}),(0,G.jsx)(M,{value:`hour`,children:l?`小时`:`Hours`}),(0,G.jsx)(M,{value:`day`,children:l?`天`:`Days`}),(0,G.jsx)(M,{value:`week`,children:l?`周`:`Weeks`})]})]})]}):null,(0,G.jsx)(Ge,{form:d,onChange:D,language:i}),(0,G.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[u.draft.notifications,(0,G.jsxs)(j,{disabled:!!s?.management,value:d.notificationPolicy,onChange:e=>D({notificationPolicy:e.target.value}),children:[(0,G.jsx)(M,{value:`attention`,children:u.draft.notifyAttention}),(0,G.jsx)(M,{value:`all`,children:u.draft.notifyAll}),(0,G.jsx)(M,{value:`none`,children:u.draft.notifyNone})]})]})]}),!s&&!r?(0,G.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:l?`请先为任务指定执行 Agent。`:`Assign an executor agent to the task first.`}):null,E?(0,G.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:E}):null]}),(0,G.jsxs)(`footer`,{className:`flex shrink-0 justify-end gap-2 border-t border-edge-subtle p-4`,children:[(0,G.jsx)(z,{type:`button`,variant:`ghost`,disabled:C,onClick:a,children:l?`取消`:`Cancel`}),(0,G.jsx)(z,{type:`submit`,variant:`primary`,disabled:C||!s&&!r||!d.name.trim()||d.triggerMode===`once`&&!d.onceAt,children:C?l?`正在保存…`:`Saving…`:s?s.enabled?l?`保存修改`:`Save changes`:l?`保存并启用`:`Save and enable`:l?`创建自动化`:`Create automation`})]})]})]})]})})}function At(e){let t=(0,W.c)(14),{detail:n,executorName:r,language:i,onUpdated:a,ref:o}=e,s=i===`zh`,l;if(t[0]!==n||t[1]!==r||t[2]!==i||t[3]!==a||t[4]!==o||t[5]!==s){let e=n.waits.find(Nt),u=n.allowedCommands.includes(`resolve_wait`)&&!e?n.waits.filter(Mt):[],d=n.presentation.status===`needsUser`,f=we(n),p=n.runs.find(jt),m={queued:s?`等待开始执行。`:`Waiting to start.`,running:r?s?`${r} 正在处理任务。`:`${r} is working on the task.`:s?`任务处理中。`:`The task is in progress.`,waiting:s?`任务正在等待继续。`:`The task is waiting to resume.`,verifying:s?`正在检查执行结果。`:`Checking the result.`},h=tt(n.presentation.reason??e?.reason??n.waits[0]?.reason??(n.task.phase===`closed`?f?.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.`:(p&&m[p.status])??f?.summary??(s?`任务尚未开始,可开始执行或设置执行时间。`:`Start the task or set an execution time.`)),i),g=n.attention.length>0?(0,G.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`),a=tt(e.summary,i);return(0,G.jsxs)(`li`,{className:`text-sm leading-6 text-fg-muted`,children:[(0,G.jsx)(V,{content:a,contentKey:`${n.task.id}:attention:${e.kind}:${t}`,language:i,previewHeight:72,children:(0,G.jsx)(S,{content:me(a),compact:!0,breaks:!0})}),!r&&(e.kind===`input_required`||e.kind===`approval_required`)?(0,G.jsx)(c,{className:`mt-2 inline-flex min-h-11 items-center rounded-lg bg-accent-soft px-3 font-medium text-accent-fg`,to:se(n.task.id),children:s?e.kind===`approval_required`?`查看并决定`:`补充信息`:e.kind===`approval_required`?`Review decision`:`Provide information`}):null]},`${e.kind}-${t}`)})}):null,_=d?s?`需要你处理`:`Your action needed`:s?`当前进展`:`Current progress`,v=u.length>1?` · ${u.length}`:``,y;t[7]!==_||t[8]!==v?(y=(0,G.jsxs)(`h2`,{className:`text-sm font-semibold text-fg`,children:[_,v]}),t[7]=_,t[8]=v,t[9]=y):y=t[9];let b;t[10]!==n||t[11]!==a||t[12]!==s?(b=e=>(0,G.jsx)(et,{wait:e,detail:n,zh:s,onUpdated:a},e.id),t[10]=n,t[11]=a,t[12]=s,t[13]=b):b=t[13],l=(0,G.jsxs)(`section`,{ref:o,tabIndex:-1,"aria-label":s?`当前需要处理`:`Current action`,className:`rounded-xl bg-surface-panel p-4`,children:[y,u.map(b),u.length>0?g?(0,G.jsxs)(`details`,{className:`mt-3`,children:[(0,G.jsx)(`summary`,{className:`cursor-pointer text-xs text-fg-muted`,children:s?`等待详情`:`Waiting details`}),g]}):null:g??(0,G.jsx)(V,{content:h,contentKey:`${n.task.id}:current-progress`,language:i,previewHeight:72,className:`mt-2 text-sm leading-6 text-fg-muted`,children:(0,G.jsx)(S,{content:me(h),compact:!0})})]}),t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=s,t[6]=l}else l=t[6];return l}function jt(e){return!e.parentRunId&&[`queued`,`running`,`waiting`,`verifying`].includes(e.status)}function Mt(e){return(e.kind===`user_input`||e.kind===`approval`&&typeof e.condition.capability==`string`)&&e.condition.type!==`connection`}function Nt(e){return e.kind===`paused`}function Pt(e){let t=(0,W.c)(17),{children:n,contentKey:r,language:a,className:o}=e,s=(0,U.useId)(),c=U.Children.toArray(n),[l,u]=i(),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,G.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]!==a||t[11]!==u?(h=c.length>3?(0,G.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:a===`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]=a,t[11]=u,t[12]=h):h=t[12];let g;return t[13]!==o||t[14]!==m||t[15]!==h?(g=(0,G.jsxs)(`div`,{className:o,children:[m,h]}),t[13]=o,t[14]=m,t[15]=h,t[16]=g):g=t[16],g}function Ft({taskId:e}){let t=u(e=>e.conversationId),n=d(e=>e.language),[r,i]=(0,U.useState)(``),[a,o]=(0,U.useState)(null),[s,c]=(0,U.useState)(!1),[p,m]=(0,U.useState)(!1),[h,g]=(0,U.useState)([]),[_,v]=(0,U.useState)(null),y=l(`/api/tasks/${encodeURIComponent(e)}/collaboration`),{data:b,error:x,mutate:S}=he([`task-collaboration`,e,t],()=>f(`${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 f(`${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,U.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)){c(!0),v(null);try{await f(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{c(!1)}}};return(0,G.jsxs)(`section`,{className:`rounded-xl bg-surface-inset p-4`,children:[(0,G.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:n===`zh`?`任务留言`:`Task updates`}),(0,G.jsxs)(`div`,{className:`mt-3 max-h-64 space-y-2 overflow-y-auto`,children:[!b&&!x?(0,G.jsxs)(`div`,{"aria-busy":`true`,className:`space-y-2`,children:[(0,G.jsx)(de,{className:`h-14 w-full`}),(0,G.jsx)(de,{className:`h-14 w-4/5`})]}):null,x?(0,G.jsx)(`p`,{role:`status`,className:`text-xs text-fg-muted`,children:n===`zh`?`暂时无法读取留言`:`Updates unavailable`}):null,C[0]&&C[0].sequence>1?(0,G.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,G.jsxs)(`div`,{className:`rounded-lg bg-surface-base px-3 py-2 text-sm`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-fg-subtle`,children:[(0,G.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,G.jsxs)(`span`,{children:[`· `,t.kind]}),t.deliveryStatus?(0,G.jsxs)(`span`,{children:[`· `,t.deliveryStatus]}):null]}),(0,G.jsx)(`div`,{className:`mt-1 min-w-0 text-fg`,"data-task-collaboration-body":!0,children:(0,G.jsx)(V,{content:t.body,contentKey:`${e}:update:${t.id}`,language:n,breaks:!0,previewHeight:120})}),t.kind===`question`&&t.authorKind===`worker_agent`?(0,G.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,G.jsx)(`p`,{className:`text-xs text-fg-muted`,children:n===`zh`?`暂无进展留言`:`No updates yet`}):null]}),a?(0,G.jsxs)(`p`,{className:`mt-3 text-xs text-accent`,children:[n===`zh`?`正在回复执行 Agent 的问题`:`Replying to the worker`,(0,G.jsx)(`button`,{type:`button`,className:`ml-2 underline`,onClick:()=>o(null),children:n===`zh`?`取消`:`Cancel`})]}):null,(0,G.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,G.jsx)(`p`,{role:`alert`,className:`mt-1 text-xs text-danger`,children:_}):null,(0,G.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 It(e,t,n,r){return!!(e&&t!==e.version&&n!==e.value&&r!==n)}function Lt(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 Rt(e,t){return(t===`zh`?{backlog:`待规划`,ready:`就绪`,active:`进行中`,review:`待验收`,closed:`已关闭`}:{backlog:`Backlog`,ready:`Ready`,active:`Active`,review:`Review`,closed:`Closed`})[e]}function zt(e){if(e===void 0)return``;let t=new Date(e);return new Date(t.getTime()-t.getTimezoneOffset()*6e4).toISOString().slice(0,10)}function Bt(e){return e?new Date(`${e}T23:59:59.999`).getTime():null}var Vt=[`backlog`,`ready`,`active`,`review`,`closed`],Ht=[`low`,`normal`,`high`,`critical`],Ut=(0,U.memo)(function(e){let t=(0,W.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,G.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=Vt.map(e=>(0,G.jsx)(M,{value:e,disabled:d(e),children:Rt(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,G.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,G.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}),Wt=(0,U.memo)(function(e){let t=(0,W.c)(14),{value:n,disabled:r,label:i,labels:a,onChange:o}=e,s;t[0]===i?s=t[1]:(s=(0,G.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=Ht.map(e=>(0,G.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,G.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,G.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}),Gt=(0,U.memo)(function(e){let t=(0,W.c)(10),{value:n,disabled:r,label:i,onChange:a}=e,o;t[0]===i?o=t[1]:(o=(0,G.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,G.jsx)(qe,{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,G.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}),Kt=(0,U.memo)(function(e){let t=(0,W.c)(36),{value:n,disabled:r,label:i,unassignedLabel:a,agents:o,language:s,onChange:c}=e,l,u,d,f,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}=p(s);v=`grid gap-1.5 text-xs text-fg-muted`,t[17]===i?y=t[18]:(y=(0,G.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`,f=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,G.jsx)(M,{value:``,disabled:!0,children:a}),t[21]=a,t[22]=g),_=o.map(t=>(0,G.jsx)(M,{value:t.id,children:Pe(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]=f,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],f=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]!==f||t[27]!==m||t[28]!==h||t[29]!==g||t[30]!==_?(b=(0,G.jsxs)(l,{triggerClassName:u,contentClassName:d,value:f,disabled:m,onChange:h,children:[g,_]}),t[23]=l,t[24]=u,t[25]=d,t[26]=f,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,G.jsxs)(`label`,{className:v,children:[y,b]}),t[32]=b,t[33]=v,t[34]=y,t[35]=x):x=t[35],x}),qt=(0,U.memo)(function(e){let t=(0,W.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(tn),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,G.jsx)(at,{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)),Jt=`xopc.taskDetail.chatPanelPercent`,Yt=42;function Xt(e,t){let n=Math.max(30,352/Math.max(t,1)*100),r=Math.min(60,(t-480)/Math.max(t,1)*100);return r<n?Yt:Math.min(r,Math.max(n,e))}function Zt(){try{let e=Number(window.localStorage.getItem(Jt));return Number.isFinite(e)&&e>=30&&e<=60?e:Yt}catch{return Yt}}function Qt(e){let t=(0,W.c)(13),{items:n,empty:r,contentKey:i}=e,a=d($t);if(n.length===0){let e;return t[0]===r?e=t[1]:(e=(0,G.jsx)(`p`,{className:`text-sm leading-6 text-fg-muted`,children:r}),t[0]=r,t[1]=e),e}let o;t[2]===n?o=t[3]:(o=n.join(`
3
+ `),t[2]=n,t[3]=o);let s;t[4]===n?s=t[5]:(s=n.map(K),t[4]=n,t[5]=s);let c;t[6]===s?c=t[7]:(c=(0,G.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,G.jsx)(V,{content:o,contentKey:i,language:a,previewHeight:144,children:c}),t[8]=i,t[9]=a,t[10]=o,t[11]=c,t[12]=l):l=t[12],l}function K(e){return(0,G.jsxs)(`li`,{className:`flex gap-2 text-sm leading-6 text-fg`,children:[(0,G.jsx)(N,{className:`mt-1 size-4 shrink-0 text-fg-subtle`}),(0,G.jsx)(`span`,{className:`min-w-0 whitespace-pre-wrap break-words [overflow-wrap:anywhere]`,children:e})]},e)}function $t(e){return e.language}function q({taskId:e,presentation:t,backgroundPath:n,onDeleted:r,onHeaderChange:s}){let[l,f]=i(),m=o(),h=d(e=>e.language),g=u(e=>e.conversationId),_=(0,U.useMemo)(()=>Ae(h),[h]),v=je(e=>e.setPageHeader),y=je(e=>e.clearPageHeader),b=ke(e=>e.panes),x=C(e=>e.openForSession),{data:S,error:w,mutate:O,lastChange:k,conversationLoading:te,conversationError:A}=T(e),{data:j,error:M,mutate:N}=he(e?[`task-detail-automations`,g]:null,()=>Ne.list(),{refreshInterval:3e4}),[I,L]=(0,U.useState)(null),[me,ge]=(0,U.useState)(null),[B,He]=(0,U.useState)(()=>new Set),[Ue,We]=(0,U.useState)([]),[Ge,Ke]=(0,U.useState)(null),[qe,Je]=(0,U.useState)([]),[Ze,$e]=(0,U.useState)(!1),[et,tt]=(0,U.useState)(``),[nt,H]=(0,U.useState)(!1),[rt,at]=(0,U.useState)(``),[W,lt]=(0,U.useState)(Zt),[dt,ft]=(0,U.useState)(!1),pt=(0,U.useRef)(null),ht=(0,U.useRef)(null),_t=(0,U.useRef)(null),{key:vt,state:yt}=a(),bt=yt?.focusTaskResults,xt=!!S;(0,U.useEffect)(()=>{if(!xt||bt!==e)return;let t=requestAnimationFrame(()=>{ht.current?.scrollIntoView?.({block:`start`}),ht.current?.focus({preventScroll:!0})});return()=>cancelAnimationFrame(t)},[bt,vt,xt,e]);let St=(0,U.useRef)(null),Ct=(0,U.useRef)(null),[wt,Ot]=(0,U.useState)(!1),jt=(0,U.useRef)(!1),Mt=(0,U.useRef)(!1),Nt=(0,U.useRef)(``),Rt=(0,U.useRef)(null),Vt=(0,U.useRef)(null),Ht=(0,U.useRef)(null),K=(0,U.useRef)(S),[$t,q]=(0,U.useState)(null),[en,tn]=(0,U.useState)(null),[nn,rn]=(0,U.useState)(!1),[an,on]=(0,U.useState)(!1),[sn,cn]=(0,U.useState)(null),ln=(0,U.useRef)(null),un=(0,U.useMemo)(()=>({link:_.linkDependencies,linked:_.linkedDependencies,searchPlaceholder:_.dependencySearchPlaceholder,noMatches:_.noDependencyMatches,noCandidates:_.noDependencyCandidates,remove:_.removeDependency}),[_.dependencySearchPlaceholder,_.linkDependencies,_.linkedDependencies,_.noDependencyCandidates,_.noDependencyMatches,_.removeDependency]),dn=S?.dependencies.map(e=>`${e.id}:${e.title}`).join(`\0`)??``,fn=(0,U.useMemo)(()=>ie(l.get(`returnTo`),`/`,[`/projects`,`/chat`,`/notes`,`/tasks`]),[l]),pn=(0,U.useCallback)(e=>t===`modal`&&n?oe(n,e):ae(`/tasks/${encodeURIComponent(e)}`,fn),[n,t,fn]);K.current=S;let J=(0,U.useCallback)((e,t)=>{He(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r})},[]);(0,U.useEffect)(()=>{L(null),ge(null),q(null),$e(!1),Rt.current=null,H(!1),tn(null),rn(!1),on(!1),cn(null)},[e]),(0,U.useEffect)(()=>{let e=!0;return Oe().then(t=>{e&&Je(t.items)}).catch(()=>void 0),()=>{e=!1}},[g]),(0,U.useEffect)(()=>{if(!k||k.source===`user`)return;tn(k);let e=window.setTimeout(()=>tn(null),3500);return()=>window.clearTimeout(e)},[k]),(0,U.useEffect)(()=>{let t=S?.task.projectId,n=S?.dependencies??[];if(!t){Ht.current=null,Ke(null),We(n);return}Ht.current!==t&&(Ht.current=t,Ke(null));let r=!0;return pe(t).then(t=>{if(!r)return;Ke(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});We([...i.values()])}).catch(()=>{r&&We(n)}),()=>{r=!1}},[dn,S?.task.projectId,e]);let Y=(0,U.useCallback)(async(t,n=`command`)=>{let r=K.current;if(r){J(n,!0),L(null),t.type===`signoff`&&ge(null);try{await O(await Ee(e,t,r.task.version),{revalidate:!1})}catch{L(_.actionFailed),t.type===`signoff`&&ge(_.actionFailed)}finally{J(n,!1)}}},[_.actionFailed,O,J,e]),mn=(0,U.useCallback)(async(t,n)=>{let r=K.current;if(!r)return!1;n&&J(n,!0),L(null);try{let n=ve(e,t,r.task.version);return await O(n,{optimisticData:Lt(r,t),populateCache:!0,revalidate:!1,rollbackOnError:!0}),!0}catch{return L(_.actionFailed),!1}finally{n&&J(n,!1)}},[_.actionFailed,O,J,e]),hn=()=>{S&&(Rt.current={value:S.task.title,version:S.task.version},q(null),tt(S.task.title),$e(!0))},gn=()=>{jt.current=!0,tt(K.current?.task.title??``),Rt.current=null,q(null),$e(!1),queueMicrotask(()=>{jt.current=!1})},_n=async(e=!1)=>{if(jt.current){jt.current=!1;return}let t=K.current;if(!t||B.has(`title`))return;let n=et.trim();if(!n){gn();return}let r=Rt.current;if(!e&&It(r,t.task.version,t.task.title,n)){q(`title`);return}if(n===t.task.title){gn();return}await mn({title:n},`title`)&&(Rt.current=null,q(null),$e(!1))},vn=async()=>{if(!S)return;if(Mt.current){Mt.current=!1;return}let e=rt.trim(),t=Vt.current;if(It(t,S.task.version,S.task.body??``,e)){q(`description`);return}if(rt===Nt.current||e===(S.task.body??``).trim()){H(!1);return}await mn({body:e||null})&&(q(null),H(!1))},yn=(0,U.useCallback)(async e=>{let t=K.current;!t||e===t.task.phase||await Y({type:`move`,phase:e},`phase`)},[Y]),bn=(0,U.useCallback)(e=>{mn({priority:e},`priority`)},[mn]),xn=(0,U.useCallback)(e=>{mn({dueAt:Bt(e)},`dueAt`)},[mn]),Sn=(0,U.useCallback)(e=>{lt(e);try{window.localStorage.setItem(Jt,String(e))}catch{}},[]),Cn=(0,U.useCallback)(e=>{if(e.key!==`ArrowLeft`&&e.key!==`ArrowRight`&&e.key!==`Home`)return;e.preventDefault();let t=St.current?.clientWidth??0,n=e.key===`Home`?Yt:W+(e.key===`ArrowLeft`?2:-2);Sn(Xt(n,t))},[W,Sn]),wn=(0,U.useCallback)(e=>{if(!window.matchMedia(`(min-width: 1024px)`).matches)return;let t=St.current;if(!t)return;e.preventDefault();let n=e.currentTarget,r=e.pointerId;n.setPointerCapture(r),ft(!0);let i=W,a=0,o=()=>{a=0,t.style.setProperty(`--task-chat-panel-width`,`${i}%`)},s=e=>{let n=t.getBoundingClientRect();i=Xt((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{}ft(!1),Sn(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)},[W,Sn]),Tn=(0,U.useCallback)(async t=>{let n=K.current;if(n){J(`dependencies`,!0),L(null);try{await O(await _e(e,t,n.task.version),{revalidate:!1})}catch{L(_.dependencyUpdateFailed)}finally{J(`dependencies`,!1)}}},[_.dependencyUpdateFailed,O,J,e]),En=(0,U.useCallback)(async t=>{let n=K.current;if(!(!n||!t||t===n.conversation.currentExecutorAgentId)){J(`delegateAgentId`,!0),L(null);try{await O(await ye(e,t,n.task.version),{revalidate:!1})}catch{L(_.actionFailed)}finally{J(`delegateAgentId`,!1)}}},[_.actionFailed,O,J,e]),Dn=(0,U.useCallback)(async()=>{J(`delete`,!0),L(null);try{await xe(e),r?r():m(fn,{replace:!0})}catch(e){L(e instanceof Error?e.message:_.actionFailed)}finally{J(`delete`,!1)}},[_.actionFailed,m,r,fn,J,e]),On=(0,U.useCallback)(async(t,n,r)=>{if(!t.acceptanceTarget)return!1;J(`acceptance`,!0),ge(null),L(null);try{return await O(await De(e,fe(e,t.task.latestContractVersion,n),r,t.task.version,t.task.latestContractVersion,t.acceptanceTarget.id),{revalidate:!1}),!0}catch{return ge(_.actionFailed),L(_.actionFailed),O().catch(()=>void 0),!1}finally{J(`acceptance`,!1)}},[_.actionFailed,O,J,e]),kn=S?.task.title,An=kn!==void 0;if((0,U.useLayoutEffect)(()=>{let e=Ct.current,t=e?.parentElement;if(!An||!e||!t||typeof IntersectionObserver>`u`)return;let n=new IntersectionObserver(([e])=>{let n=ct(t),r=n?n.getBoundingClientRect().top+n.clientTop:0;Ot(!e.isIntersecting&&e.boundingClientRect.bottom<=r)});return n.observe(e),()=>n.disconnect()},[An,e]),(0,U.useLayoutEffect)(()=>{s?.({taskId:e,title:kn,compact:wt})},[wt,s,e,kn]),(0,U.useLayoutEffect)(()=>{if(t!==`modal`)return v({startExtra:(0,G.jsx)(c,{to:fn,className:`flex size-9 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover`,"aria-label":_.backToWork,children:(0,G.jsx)(ee,{className:`size-4`})}),main:An?(0,G.jsx)(`div`,{className:`min-w-0 text-sm font-semibold text-fg`,children:(0,G.jsx)(Qe,{label:Ge?`${Ge} / ${_.taskLabel}`:_.taskLabel,title:kn,compact:wt})}):null,end:e?(0,G.jsx)(c,{to:`/space?taskId=${encodeURIComponent(e)}`,className:`rounded-lg px-2.5 py-2 text-sm text-fg-muted hover:bg-surface-hover`,children:h===`zh`?`成果`:`Results`}):null}),y},[y,wt,_.backToWork,_.taskLabel,An,h,t,Ge,fn,v,e,kn]),w&&!S)return(0,G.jsx)(`div`,{className:t===`modal`?`p-5 text-sm text-danger`:`mx-auto max-w-3xl p-6 text-sm text-danger`,children:_.taskNotFound});if(!S)return(0,G.jsx)(`div`,{className:t===`modal`?`p-5`:`mx-auto max-w-4xl p-4 sm:p-6`,children:(0,G.jsx)(Xe,{})});let jn=S.waits[0],X=S.runs.find(e=>!e.parentRunId&&[`queued`,`running`,`waiting`,`verifying`].includes(e.status)),Mn=be(S),Nn=Mn.length>0&&Mn.every(e=>e.status===`passed`),Pn=S.waits.find(e=>e.kind===`paused`),Fn=we(S),In=Te(S),Ln=_.detailStatuses[In],Rn=S.task.body?.trim()||S.task.contract?.objective.trim()||``,zn=S.allowedCommands.includes(`mark_ready`),Bn=S.allowedCommands.includes(`start`),Vn=S.allowedCommands.includes(`add_wait`),Hn=!jn&&!X&&Nn&&S.presentation.primaryAction?.type===`review`&&S.allowedCommands.includes(`close`),Un=S.allowedCommands.includes(`reopen`),Z=S.conversation.activeConversationId,Q=S.conversation.currentExecutorAgentId??S.task.delegateAgentId??S.task.ownerId,Wn=qe.find(e=>e.id===Q),Gn=p(h).agentsSettings,Kn=Wn?Pe(Wn,Gn):void 0,qn=X?.executorKind===`agent`?qe.find(e=>e.id===(X.executorRef.agentId??S.conversation.currentExecutorAgentId)):void 0,Jn=qn?Pe(qn,Gn):void 0,Yn=!!(Z&&b[Z]?.open),Xn=S.context.filter(e=>e.role!==`deliverable`),Zn=j?.automations.filter(t=>t.action.kind===`task_command`&&t.action.taskId===e)??[],$=Zn.filter(e=>e.trigger.kind===`schedule`&&e.action.kind===`task_command`&&e.action.command.type===`start`),Qn=$.filter(e=>e.enabled&&e.state.nextRunAtMs!==void 0).map(e=>e.state.nextRunAtMs).sort((e,t)=>e-t)[0],$n=e=>{N(t=>({automations:[e,...(t?.automations??[]).filter(t=>t.id!==e.id)]}),{revalidate:!1})},er=e=>{cn(e),on(!0)},tr=()=>{j&&($.length===1?er($[0]):$.length>1?(ln.current&&(ln.current.open=!0),f(e=>ot(e,`schedule`,!0),{preventScrollReset:!0}),ln.current?.scrollIntoView({block:`start`,behavior:`smooth`}),ln.current?.focus({preventScroll:!0})):(cn(null),on(!0)))},nr=S.sessions.filter((e,t,n)=>n.findIndex(t=>t.conversationId===e.conversationId)===t),rr=S.task.contract?.expectedOutputs??[],ir=S.task.contract?.constraints??[],ar=S.task.contract?.approvalRequired??[],or=S.task.contract?.assumptions??[],sr=S.task.contract?.risks??[],cr=ir.length>0||ar.length>0||or.length>0||sr.length>0,lr=(...e)=>!!en?.changedFields.some(t=>e.includes(t)),ur=S.allowedCommands.includes(`move`),dr=B.has(`command`),fr=B.has(`delete`),pr=X!==void 0,mr=()=>{let e=pt.current;e&&(e.open=!0,f(e=>ot(e,`acceptance`,!0),{preventScrollReset:!0}),e.scrollIntoView({block:`start`,behavior:`smooth`}),e.focus({preventScroll:!0}))},hr=S.presentation.primaryAction,gr=()=>{Q&&Y({type:`start`,executor:{kind:`agent`,agentId:Q}})},_r=()=>{ht.current?.scrollIntoView({block:`start`,behavior:`smooth`}),ht.current?.focus({preventScroll:!0})},vr=(()=>{switch(hr?.type){case`mark_ready`:return{label:_.scheduleTask,activate:()=>void Y({type:`mark_ready`})};case`resume`:return{label:_.resumeTask,activate:()=>void Y({type:`resolve_wait`,waitId:hr.waitId})};case`resolve_wait`:{let t=S.waits.find(e=>e.id===hr.waitId),n=t&&t.condition.type!==`connection`&&(t.kind===`user_input`||t.kind===`approval`&&typeof t.condition.capability==`string`);return{label:h===`zh`?`处理待办`:`Resolve pending item`,activate:()=>n?_t.current?.focus():m(se(e))}}case`inspect_run`:return{label:h===`zh`?`查看待处理事项`:`View pending issue`,activate:()=>_t.current?.focus()};case`review`:return{label:h===`zh`?`去验收`:`Review results`,activate:mr};case`signoff`:return{label:h===`zh`?`确认验收`:`Accept result`,activate:()=>void Y({type:`signoff`,resultId:hr.resultId})};case`view_results`:return{label:h===`zh`?`查看结果`:`View results`,activate:_r};case`retry_allocation`:return{label:h===`zh`?`重新分配`:`Retry assignment`,activate:()=>void Y({type:`retry_allocation`})};case`retry_run`:{let e=S.runs.find(e=>e.id===hr.runId),t=e?.executorKind===`agent`&&typeof e.executorRef.agentId==`string`?e.executorRef.agentId:void 0;return{label:h===`zh`?`重试任务`:`Retry task`,disabled:!t,activate:()=>{t&&Y({type:`start`,executor:{kind:`agent`,agentId:t}})}}}case`start`:return{label:_.runTask,activate:gr,disabled:!Q}}})(),yr=(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[vr?(0,G.jsx)(z,{className:`min-h-9 px-3 py-1.5 text-xs`,variant:`primary`,disabled:dr||vr.disabled,onClick:vr.activate,children:vr.label}):null,Un?(0,G.jsxs)(z,{className:`min-h-9 px-3 py-1.5 text-xs`,variant:`ghost`,disabled:dr,onClick:()=>void Y({type:`reopen`,phase:`ready`}),children:[(0,G.jsx)(ue,{className:`size-4`}),_.reopenTask]}):null,S.task.phase!==`review`&&!Pn&&Vn?(0,G.jsxs)(z,{variant:`ghost`,className:`min-h-9 px-3 py-1.5 text-xs`,disabled:dr,onClick:()=>void Y({type:`add_wait`,wait:{kind:`paused`,reason:`Paused by user`,condition:{}}}),children:[(0,G.jsx)(le,{className:`size-4`}),_.pauseTask]}):null,!jn&&!X&&S.task.phase!==`closed`&&S.task.phase!==`review`?(0,G.jsxs)(z,{variant:`ghost`,className:`min-h-9 px-3 py-1.5 text-xs`,disabled:!j,onClick:tr,children:[(0,G.jsx)(D,{className:`size-4`}),$.length>0?h===`zh`?`管理执行时间`:`Manage schedule`:h===`zh`?`设置执行时间`:`Set execution time`]}):null,(0,G.jsxs)(Ie,{children:[(0,G.jsx)(Le,{asChild:!0,children:(0,G.jsx)(z,{type:`button`,variant:`ghost`,className:`size-9 p-0`,disabled:dr||fr,"aria-label":_.moreActions,children:(0,G.jsx)(P,{className:`size-4`,"aria-hidden":!0})})}),(0,G.jsx)(Re,{children:(0,G.jsxs)(Be,{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`&&!Pn&&Vn?(0,G.jsx)(ze,{className:`cursor-pointer rounded-md px-3 py-2 text-sm text-fg outline-none focus:bg-surface-hover`,onSelect:()=>void Y({type:`add_wait`,wait:{kind:`paused`,reason:`Paused by user`,condition:{}}}),children:_.pauseTask}):null,S.task.phase===`review`&&!jn&&!X?(0,G.jsx)(ze,{disabled:!j,className:`cursor-pointer rounded-md px-3 py-2 text-sm text-fg outline-none focus:bg-surface-hover data-[disabled]:opacity-50`,onSelect:tr,children:$.length>0?h===`zh`?`管理执行时间`:`Manage schedule`:h===`zh`?`设置执行时间`:`Set execution time`}):null,S.task.phase===`review`&&!jn&&Bn&&Q?(0,G.jsx)(ze,{className:`cursor-pointer rounded-md px-3 py-2 text-sm text-fg outline-none focus:bg-surface-hover`,onSelect:()=>void Y({type:`start`,executor:{kind:`agent`,agentId:Q}}),children:_.runTask}):null,zn&&(Bn||jn||S.task.phase===`review`)?(0,G.jsx)(ze,{className:`cursor-pointer rounded-md px-3 py-2 text-sm text-fg outline-none focus:bg-surface-hover`,onSelect:()=>void Y({type:`mark_ready`}),children:_.scheduleTask}):null,X?(0,G.jsx)(ze,{className:`cursor-pointer rounded-md px-3 py-2 text-sm text-danger outline-none hover:bg-surface-hover focus:bg-surface-hover`,onSelect:()=>{J(`command`,!0),L(null),O(Ce(e,X.id,X.version),{revalidate:!1}).catch(()=>L(_.actionFailed)).finally(()=>J(`command`,!1))},children:_.cancelActiveRun}):null,X?(0,G.jsx)(Ve,{className:`my-1 h-px bg-edge`}):null,S.task.phase===`closed`?null:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(ze,{className:`cursor-pointer rounded-md px-3 py-2 text-sm text-danger outline-none hover:bg-surface-hover focus:bg-surface-hover`,onSelect:()=>void Y({type:`close`,resolution:`cancelled`}),children:_.cancelTask}),(0,G.jsx)(Ve,{className:`my-1 h-px bg-edge`})]}),(0,G.jsx)(ze,{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(pr){L(_.deleteActiveTaskBlocked);return}rn(!0)},children:_.deleteTask})]})})]})]});return(0,G.jsxs)(`div`,{ref:St,className:`flex h-full min-h-0 flex-col overflow-hidden ${dt?`lg:cursor-col-resize lg:select-none`:``}`,style:{"--task-chat-panel-width":`${W}%`},children:[(0,G.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto lg:flex-row lg:overflow-hidden`,children:[(0,G.jsxs)(`div`,{className:`task-detail-scroll flex min-w-0 shrink-0 flex-col bg-surface-base lg:min-h-0 lg:flex-1 lg:shrink lg:overflow-y-auto lg:overscroll-contain`,children:[(0,G.jsxs)(`header`,{ref:Ct,className:R(`shrink-0 px-4 py-5 sm:px-6 sm:py-6`,lr(`title`)&&`task-detail-live-update`),children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-x-6 gap-y-3`,children:[(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs text-fg-muted`,children:[Ge?(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,G.jsx)(ne,{className:`size-3.5`,"aria-hidden":!0}),Ge]}):null,Ge?(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`/`}):null,(0,G.jsx)(`span`,{children:_.taskLabel}),en?(0,G.jsx)(`span`,{className:`rounded-full bg-accent-soft px-2 py-0.5 text-[11px] font-medium text-accent-fg`,role:`status`,children:en.source===`agent`?h===`zh`?`Agent 刚刚更新`:`Updated by Agent`:h===`zh`?`执行结果已同步`:`Execution result synced`}):null]}),Ze?(0,G.jsx)(`textarea`,{autoFocus:!0,"data-task-inline-editor":!0,"aria-label":h===`zh`?`任务标题`:`Task title`,rows:2,value:et,onFocus:e=>{Rt.current?.value===et&&(e.currentTarget.setSelectionRange(0,0),e.currentTarget.scrollTop=0)},onChange:e=>tt(e.target.value),onBlur:()=>void _n(),onKeyDown:e=>{e.nativeEvent.isComposing||(e.key===`Escape`?(e.preventDefault(),e.stopPropagation(),gn()):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,G.jsx)(V,{content:S.task.title,contentKey:`${e}:title`,language:h,previewHeight:56,className:`mt-2 max-w-3xl`,children:(0,G.jsx)(`h1`,{className:`break-words text-xl font-semibold leading-7 tracking-tight text-fg sm:text-2xl`,children:(0,G.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:hn,children:S.task.title})})}),$t===`title`?(0,G.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2 text-xs text-warning`,role:`alert`,children:[(0,G.jsx)(`span`,{children:h===`zh`?`Agent 在你编辑期间更新了标题。`:`The Agent updated the title while you were editing.`}),(0,G.jsx)(`button`,{type:`button`,className:`rounded-md bg-surface-hover px-2 py-1 text-fg`,onClick:gn,children:h===`zh`?`使用 Agent 版本`:`Use Agent version`}),(0,G.jsx)(`button`,{type:`button`,className:`rounded-md bg-accent-soft px-2 py-1 text-accent-fg`,disabled:B.has(`title`),onClick:()=>void _n(!0),children:h===`zh`?`保留我的修改`:`Keep my changes`})]}):null]}),(0,G.jsx)(`span`,{className:R(`shrink-0 rounded-full px-2.5 py-1 text-xs font-medium`,Se(In)),children:Ln})]}),(0,G.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-x-4 gap-y-2 text-xs text-fg-muted`,children:[(0,G.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-2`,children:[Q?(0,G.jsx)(Me,{agentId:Q,avatar:Wn?.avatar,size:20,className:`shrink-0`}):null,(0,G.jsxs)(`span`,{className:`min-w-0 break-words [overflow-wrap:anywhere]`,children:[_.executorLabel,` · `,Kn??Q??_.unassigned]})]}),(0,G.jsx)(`span`,{className:`text-fg-subtle`,children:_.updatedAt.replace(`{{date}}`,Ye(S.task.updatedAt,h))})]})]}),(0,G.jsxs)(`div`,{className:`sticky top-0 z-10 flex shrink-0 flex-wrap items-center justify-end gap-2 border-b border-edge-subtle bg-surface-panel px-4 py-2 sm:px-5`,"aria-label":h===`zh`?`任务操作`:`Task actions`,children:[yr,I?(0,G.jsx)(`p`,{role:`alert`,className:`basis-full text-sm text-danger`,children:I}):null,(0,G.jsx)(ut,{language:h,hasSchedule:$.length>0},e)]}),(0,G.jsxs)(`section`,{className:`min-w-0 space-y-4 p-4 sm:p-5`,children:[In===`review`?null:(0,G.jsx)(At,{ref:_t,detail:S,executorName:Jn,language:h,onUpdated:e=>{O(e,{revalidate:!1})}}),(0,G.jsxs)(`section`,{"data-task-section":`results`,"data-task-section-label":h===`zh`?`交付结果`:`Results`,ref:ht,tabIndex:-1,"aria-labelledby":`task-results-heading`,className:`scroll-mt-24 space-y-4`,children:[(0,G.jsx)(gt,{detail:S,language:h}),(0,G.jsx)(st,{panelId:`acceptance`,chevron:!0,"data-task-section":`acceptance`,"data-task-section-label":h===`zh`?`验收`:`Acceptance`,defaultOpen:!0,ref:pt,tabIndex:-1,"aria-label":_.successDefinition,className:`scroll-mt-24 overflow-hidden rounded-2xl 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,G.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[h===`zh`?`验收`:`Acceptance`,(0,G.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:[Mn.filter(e=>e.status===`passed`).length,`/`,Mn.length]})]}),children:(0,G.jsx)(mt,{criteria:Mn,language:h,closed:S.task.phase===`closed`,pending:B.has(`acceptance`),error:me,reviewDisabled:!S.acceptanceTarget||S.presentation.primaryAction?.type===`inspect_run`,blockedReason:jn?h===`zh`?`请先处理待办事项`:`Resolve the pending request first`:X?h===`zh`?`请等待当前执行结束`:`Wait for the current run to finish`:void 0,onReview:(e,t)=>On(S,e,t),projectId:S.task.projectId,conversationId:Z??void 0},`${e}:${S.task.latestContractVersion}:${S.acceptanceTarget?.id??``}`)})]}),(0,G.jsx)(st,{panelId:`report`,chevron:!0,defaultOpen:!0,"data-task-section":`report`,"data-task-section-label":h===`zh`?`执行报告`:`Report`,className:`rounded-2xl bg-surface-panel p-4`,summaryClassName:`cursor-pointer rounded-sm text-sm font-medium text-fg`,title:h===`zh`?`完整执行报告`:`Full execution report`,children:(0,G.jsx)(Tt,{detail:S,language:h},Fn?.runId??e)}),!j&&!M?(0,G.jsx)(de,{className:`h-9 rounded-lg`}):null,M?(0,G.jsxs)(`div`,{role:`alert`,className:`flex flex-wrap items-center gap-2 text-sm text-danger`,children:[(0,G.jsx)(`span`,{children:h===`zh`?`无法读取执行计划,请重试后再设置时间。`:`Could not load schedules. Retry before setting a time.`}),(0,G.jsx)(z,{variant:`ghost`,onClick:()=>void N(),children:h===`zh`?`重试`:`Retry`})]}):null,$.length>0?(0,G.jsx)(st,{panelId:`schedule`,chevron:!0,defaultOpen:!0,"data-task-section":`schedule`,"data-task-section-label":h===`zh`?`执行时间`:`Schedule`,ref:ln,tabIndex:-1,className:`scroll-mt-24 rounded-2xl bg-surface-panel p-4`,summaryClassName:`cursor-pointer rounded-sm text-sm text-fg-muted`,title:(0,G.jsxs)(G.Fragment,{children:[h===`zh`?`执行时间`:`Execution schedule`,` · `,$.length,Qn===void 0?``:` · ${h===`zh`?`下次执行:`:`Next run: `}${Ye(Qn,h)}`]}),children:(0,G.jsx)(`div`,{className:`mt-3`,children:(0,G.jsx)(Dt,{schedules:$,language:h,onEdit:er,onUpdated:$n})})}):null,(0,G.jsx)(st,{panelId:`goal`,chevron:!0,defaultOpen:!0,"data-task-section":`goal`,"data-task-section-label":h===`zh`?`目标说明`:`Goal`,className:`rounded-2xl bg-surface-panel p-4`,summaryClassName:`cursor-pointer rounded-sm text-sm font-medium text-fg`,title:h===`zh`?`任务目标与说明`:`Task goal and description`,children:(0,G.jsx)(`div`,{className:`mt-3`,children:(0,G.jsxs)(`section`,{className:`overflow-hidden rounded-xl bg-surface-inset divide-y divide-edge-subtle`,children:[(0,G.jsxs)(`div`,{className:`border-b border-edge-subtle p-5`,children:[(0,G.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:h===`zh`?`任务目标`:`Task goal`}),(0,G.jsx)(V,{content:S.task.contract?.objective||S.task.title,contentKey:`${e}:goal`,language:h,markdown:!1,previewHeight:72,className:`mt-3 text-sm leading-6 text-fg`}),(0,G.jsxs)(z,{variant:`ghost`,className:`mt-2 min-h-9 px-2 text-xs`,onClick:mr,children:[_.successDefinition,` · `,Mn.length]})]}),rr.length>0?(0,G.jsxs)(`div`,{className:`p-5`,children:[(0,G.jsx)(`h3`,{className:`text-xs font-medium text-fg-muted`,children:_.expectedOutputs}),(0,G.jsx)(`div`,{className:`mt-2`,children:(0,G.jsx)(Qt,{contentKey:`${e}:expectedOutputs`,items:rr,empty:_.noDefinition})})]}):null,(0,G.jsxs)(`details`,{className:R(`p-5`,lr(`body`)&&`task-detail-live-update`),children:[(0,G.jsx)(`summary`,{className:`cursor-pointer text-sm font-semibold text-fg`,children:_.taskDescription}),nt?(0,G.jsx)(`textarea`,{autoFocus:!0,"data-task-inline-editor":!0,rows:6,value:rt,onChange:e=>at(e.target.value),onBlur:()=>void vn(),onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),Mt.current=!0,at(S.task.body??S.task.contract?.objective??``),H(!1),queueMicrotask(()=>{Mt.current=!1}))},className:`mt-3 w-full resize-y rounded-lg bg-surface-hover px-3 py-2 text-sm leading-6 text-fg outline-none ring-2 ring-accent/20 focus:ring-accent/50`}):(0,G.jsxs)(`div`,{className:`mt-2`,children:[Rn&&Rn!==S.task.title?(0,G.jsx)(V,{content:Rn,contentKey:`${e}:description`,language:h}):(0,G.jsx)(`p`,{className:`text-sm leading-6 text-fg-muted`,children:_.noTaskDescription}),(0,G.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=S.task.body??S.task.contract?.objective??``;Nt.current=e,Vt.current={value:S.task.body??``,version:S.task.version},q(null),at(e),H(!0)},children:h===`zh`?`编辑说明`:`Edit description`})]}),$t===`description`?(0,G.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2 text-xs text-warning`,role:`alert`,children:[(0,G.jsx)(`span`,{children:h===`zh`?`Agent 在你编辑期间更新了描述。`:`The Agent updated the description while you were editing.`}),(0,G.jsx)(`button`,{type:`button`,className:`rounded-md bg-surface-hover px-2 py-1 text-fg`,onClick:()=>{at(S.task.body??``),q(null),H(!1)},children:h===`zh`?`使用 Agent 版本`:`Use Agent version`}),(0,G.jsx)(`button`,{type:`button`,className:`rounded-md bg-accent-soft px-2 py-1 text-accent-fg`,onClick:()=>void mn({body:rt.trim()||null}).then(e=>{e&&(q(null),H(!1))}),children:h===`zh`?`保留我的修改`:`Keep my changes`})]}):null]}),cr?(0,G.jsxs)(`section`,{className:R(`p-5`,lr(`contract`)&&`task-detail-live-update`),children:[(0,G.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:_.taskDefinition}),(0,G.jsx)(`p`,{className:`mt-2 text-xs leading-5 text-fg-muted`,children:h===`zh`?`执行边界及补充背景`:`Execution boundaries and supporting context`}),ir.length>0?(0,G.jsxs)(`details`,{className:`mt-4 border-t border-edge-subtle pt-4`,children:[(0,G.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg-muted hover:text-fg`,children:_.constraints}),(0,G.jsx)(`div`,{className:`mt-3`,children:(0,G.jsx)(Qt,{contentKey:`${e}:constraints`,items:ir,empty:_.noDefinition})})]}):null,ar.length>0?(0,G.jsxs)(`details`,{className:`mt-4 border-t border-edge-subtle pt-4`,children:[(0,G.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg-muted hover:text-fg`,children:_.approvalRequired}),(0,G.jsx)(`div`,{className:`mt-3`,children:(0,G.jsx)(Qt,{contentKey:`${e}:approvalRequired`,items:ar,empty:_.noDefinition})})]}):null,or.length>0?(0,G.jsxs)(`details`,{className:`mt-4 border-t border-edge-subtle pt-4`,children:[(0,G.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg-muted hover:text-fg`,children:_.contextAssumptions}),(0,G.jsx)(`div`,{className:`mt-3`,children:(0,G.jsx)(Qt,{contentKey:`${e}:assumptions`,items:or,empty:_.noDefinition})})]}):null,sr.length>0?(0,G.jsxs)(`details`,{className:`mt-4 border-t border-edge-subtle pt-4`,children:[(0,G.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg-muted hover:text-fg`,children:_.contextRisks}),(0,G.jsx)(`div`,{className:`mt-3`,children:(0,G.jsx)(Qt,{contentKey:`${e}:risks`,items:sr,empty:_.noDefinition})})]}):null]}):null]})})}),(0,G.jsxs)(st,{panelId:`management`,chevron:!0,defaultOpen:!0,"data-task-section":`management`,"data-task-section-label":h===`zh`?`任务管理`:`Management`,"aria-label":h===`zh`?`任务管理`:`Task management`,className:`rounded-2xl bg-surface-panel p-4`,summaryClassName:`cursor-pointer rounded-sm text-sm font-medium text-fg`,title:h===`zh`?`任务管理`:`Task management`,children:[(0,G.jsxs)(`aside`,{className:`min-w-0 overflow-hidden rounded-xl bg-surface-inset divide-y divide-edge-subtle`,children:[(0,G.jsxs)(`section`,{className:R(`p-5`,lr(`phase`,`resolution`,`priority`,`dueAt`,`delegateAgentId`)&&`task-detail-live-update`),children:[(0,G.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:_.taskProperties}),(0,G.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-2`,children:[(0,G.jsx)(Ut,{value:S.task.phase,disabled:B.has(`phase`),canMove:ur,canApprove:Hn,canReopen:Un,language:h,label:_.taskPhase,onChange:yn}),(0,G.jsx)(Wt,{value:S.task.priority,disabled:B.has(`priority`),label:_.priority,labels:_.priorityLabels,onChange:bn}),(0,G.jsx)(Gt,{value:zt(S.task.dueAt),disabled:B.has(`dueAt`),label:_.dueDate,onChange:xn}),(0,G.jsx)(Kt,{value:S.conversation.currentExecutorAgentId??``,disabled:B.has(`delegateAgentId`),label:_.executorLabel,unassignedLabel:_.unassigned,agents:qe,language:h,onChange:En})]})]}),(0,G.jsxs)(`details`,{className:R(`p-5`,lr(`dependencies`)&&`task-detail-live-update`),children:[(0,G.jsxs)(`summary`,{className:`cursor-pointer text-sm font-semibold text-fg`,children:[_.taskRelations,` · `,S.dependencies.length,` / `,S.dependents.length]}),(0,G.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{className:`mb-2 text-xs text-fg-muted`,children:_.dependencies}),(0,G.jsx)(qt,{candidates:Ue,selected:S.dependencies,disabled:B.has(`dependencies`),labels:un,getTaskHref:pn,onChange:Tn})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{className:`mb-2 text-xs text-fg-muted`,children:_.dependents}),S.dependents.length>0?(0,G.jsx)(`div`,{className:`space-y-1.5`,children:S.dependents.map(t=>(0,G.jsx)(V,{content:t.title,contentKey:`${e}:dependent:${t.id}`,language:h,previewHeight:72,className:`rounded-lg bg-surface-hover p-2.5`,children:(0,G.jsx)(c,{to:pn(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,G.jsx)(`p`,{className:`text-sm text-fg-subtle`,children:_.noDependents})]})]})]})]}),S.task.phase===`closed`?null:(0,G.jsxs)(z,{variant:`ghost`,className:`my-3`,disabled:!j,onClick:tr,children:[(0,G.jsx)(D,{className:`size-4`}),$.length>0?h===`zh`?`管理执行时间`:`Manage schedule`:_.scheduleRecurringTask]}),(0,G.jsxs)(`details`,{className:`mb-4 rounded-xl bg-surface-inset p-5`,children:[(0,G.jsx)(`summary`,{className:`cursor-pointer text-sm font-semibold text-fg`,children:h===`zh`?`关联内容`:`Related work`}),nr.length>0||S.runs.length>0||Zn.length>0||S.dependencies.length>0||S.dependents.length>0?(0,G.jsxs)(`div`,{className:`mt-3 grid gap-3 sm:grid-cols-2`,children:[nr.length>0?(0,G.jsxs)(`div`,{className:`rounded-lg bg-surface-hover p-3`,children:[(0,G.jsx)(`h3`,{className:`text-xs font-medium text-fg-muted`,children:h===`zh`?`对话 · ${nr.length}`:`Conversations · ${nr.length}`}),(0,G.jsx)(Pt,{contentKey:`${e}:sessions`,language:h,className:`mt-2`,children:nr.map(t=>(0,G.jsx)(`li`,{children:(0,G.jsx)(c,{className:`block break-words [overflow-wrap:anywhere] text-sm text-accent hover:underline`,to:t.conversationId===Z?se(e):`/chat/${encodeURIComponent(t.conversationId)}`,children:t.conversationId===Z?h===`zh`?`当前执行对话`:`Current execution chat`:t.role===`discussion`?h===`zh`?`关联讨论`:`Linked discussion`:h===`zh`?`历史执行对话`:`Earlier execution chat`})},t.id))})]}):null,Zn.length>0?(0,G.jsxs)(`div`,{className:`rounded-lg bg-surface-hover p-3`,children:[(0,G.jsx)(`h3`,{className:`text-xs font-medium text-fg-muted`,children:h===`zh`?`自动化 · ${Zn.length}`:`Automations · ${Zn.length}`}),(0,G.jsx)(Pt,{contentKey:`${e}:automations`,language:h,className:`mt-2`,children:Zn.map(e=>(0,G.jsx)(`li`,{children:(0,G.jsx)(c,{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,G.jsxs)(`div`,{className:`rounded-lg bg-surface-hover p-3`,children:[(0,G.jsx)(`h3`,{className:`text-xs font-medium text-fg-muted`,children:_.taskRelations}),(0,G.jsx)(`p`,{className:`mt-2 text-sm text-fg`,children:h===`zh`?`${S.dependencies.length} 个前置任务 · ${S.dependents.length} 个后续任务`:`${S.dependencies.length} prerequisites · ${S.dependents.length} dependents`})]}):null]}):(0,G.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:h===`zh`?`还没有关联内容`:`No related work yet`}),(0,G.jsx)(`div`,{className:`mt-4 border-t border-edge-subtle pt-3`,children:(0,G.jsx)(it,{resource:{kind:`task`,id:S.task.id,revision:String(S.task.version)},disabled:Ze||nt||B.size>0})})]}),Xn.length>0?(0,G.jsxs)(`section`,{className:R(`p-5`,lr(`context`)&&`task-detail-live-update`),children:[(0,G.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:_.contextUsed}),(0,G.jsx)(`ul`,{className:`mt-4 grid gap-2 sm:grid-cols-2`,children:Xn.map(e=>(0,G.jsxs)(`li`,{className:`min-w-0 rounded-lg bg-surface-hover p-2.5`,children:[(0,G.jsxs)(`span`,{className:`text-[11px] text-fg-subtle`,children:[_.contextRoleLabels[e.role],` · `,_.contextKindLabels[e.targetKind]]}),e.targetKind===`url`&&/^https?:\/\//.test(e.targetId)?(0,G.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,G.jsx)(`p`,{className:`mt-1 break-words text-sm text-fg`,children:e.title??e.targetId})]},e.id))})]}):null]}),(0,G.jsx)(st,{panelId:`activity`,chevron:!0,defaultOpen:!0,"data-task-section":`activity`,"data-task-section-label":h===`zh`?`活动留言`:`Activity`,className:`rounded-2xl bg-surface-panel p-4`,summaryClassName:`cursor-pointer rounded-sm text-sm font-semibold text-fg`,title:h===`zh`?`活动记录与留言`:`Activity and updates`,children:(0,G.jsxs)(`div`,{className:`mt-3 space-y-4`,children:[(0,G.jsx)(Ft,{taskId:e},e),(0,G.jsx)(Et,{changes:S.phaseChanges,language:h})]})})]})]}),(0,G.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":h===`zh`?`调整任务信息和 Agent 对话的宽度`:`Resize task details and Agent chat`,"aria-valuemin":30,"aria-valuemax":60,"aria-valuenow":Math.round(W),tabIndex:0,onPointerDown:wn,onKeyDown:Cn,onDoubleClick:()=>Sn(Yt),className:`hidden w-2 shrink-0 cursor-col-resize touch-none bg-surface-panel outline-none focus-visible:bg-accent-soft lg:block`}),(0,G.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,G.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge-subtle px-4 py-3`,children:[(0,G.jsx)(`h2`,{className:`text-sm font-medium text-fg-muted`,children:h===`zh`?`执行对话`:`Execution chat`}),(0,G.jsxs)(`div`,{className:`flex items-center gap-1`,children:[nr.length>1?(0,G.jsxs)(Ie,{children:[(0,G.jsx)(Le,{asChild:!0,children:(0,G.jsx)(z,{type:`button`,variant:`ghost`,className:`h-8 px-2 text-xs`,children:h===`zh`?`${nr.length} 段对话`:`${nr.length} conversations`})}),(0,G.jsx)(Re,{children:(0,G.jsx)(Be,{align:`end`,sideOffset:6,className:`z-[100] min-w-52 rounded-lg border border-edge bg-surface-overlay p-1 shadow-popover`,children:nr.map(t=>(0,G.jsx)(ze,{asChild:!0,children:(0,G.jsx)(c,{className:`block rounded-md px-3 py-2 text-sm text-fg outline-none hover:bg-surface-hover focus:bg-surface-hover`,to:t.conversationId===Z?se(e):`/chat/${encodeURIComponent(t.conversationId)}`,children:t.conversationId===Z?h===`zh`?`当前执行对话`:`Current execution chat`:t.role===`discussion`?h===`zh`?`关联讨论`:`Linked discussion`:h===`zh`?`历史执行对话`:`Earlier execution chat`})},t.id))})})]}):null,Z?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(z,{type:`button`,variant:`ghost`,className:R(`size-8 p-0`,Yn&&`bg-surface-hover text-fg`),"aria-label":h===`zh`?`项目文件`:`Project files`,"aria-pressed":Yn,onClick:()=>{ke.getState().openFiles(Z),x(Z)},children:(0,G.jsx)(re,{className:`size-4`,"aria-hidden":!0})}),(0,G.jsx)(z,{asChild:!0,variant:`ghost`,className:`size-8 p-0`,children:(0,G.jsx)(c,{to:se(e),"aria-label":h===`zh`?`全屏打开对话`:`Open chat full screen`,children:(0,G.jsx)(F,{className:`size-4`,"aria-hidden":!0})})})]}):null]})]}),Z?(0,G.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,G.jsx)(E,{embedded:!0,conversationId:Z,taskId:e})}):te?(0,G.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center p-8 text-center`,children:(0,G.jsxs)(`div`,{className:`max-w-xs`,children:[(0,G.jsx)(ce,{className:`mx-auto size-8 animate-pulse text-fg-subtle`}),(0,G.jsx)(`p`,{className:`mt-3 text-sm font-medium text-fg`,children:h===`zh`?`正在创建任务会话`:`Creating task conversation`})]})}):A?(0,G.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center p-8 text-center`,children:(0,G.jsxs)(`div`,{className:`max-w-xs`,children:[(0,G.jsx)(ce,{className:`mx-auto size-8 text-danger`}),(0,G.jsx)(`p`,{className:`mt-3 text-sm font-medium text-fg`,children:h===`zh`?`任务会话创建失败`:`Could not create task conversation`}),(0,G.jsx)(`p`,{className:`mt-2 text-xs leading-5 text-fg-muted`,children:A instanceof Error?A.message:String(A)})]})}):(0,G.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center p-8 text-center`,children:(0,G.jsxs)(`div`,{className:`max-w-xs`,children:[(0,G.jsx)(ce,{className:`mx-auto size-8 text-fg-subtle`}),(0,G.jsx)(`p`,{className:`mt-3 text-sm font-medium text-fg`,children:h===`zh`?`等待任务会话`:`Waiting for a task conversation`}),(0,G.jsx)(`p`,{className:`mt-2 text-xs leading-5 text-fg-muted`,children:h===`zh`?`安排或开始任务后,Agent 的执行过程和持续对话会显示在这里。`:`Schedule or start the task to see the agent run and continue the conversation here.`})]})})]})]}),an?(0,G.jsx)(kt,{automation:sn??void 0,taskId:e,taskTitle:S.task.title,projectId:S.task.projectId,executorAgentId:Q,language:h,onClose:()=>on(!1),onCreated:$n},`${e}:${sn?.id??`new`}`):null,(0,G.jsx)(Fe,{open:nn,title:_.deleteTaskTitle,description:_.deleteTaskDescription.replace(`{{title}}`,S.task.title),confirmLabel:_.confirmDeleteTask,cancelLabel:_.keepTask,destructive:!0,onConfirm:()=>{rn(!1),Dn()},onCancel:()=>rn(!1)})]})}function en(){let e=(0,W.c)(2),{taskId:t}=s(),n=t===void 0?``:t,r;return e[0]===n?r=e[1]:(r=(0,G.jsx)(q,{taskId:n,presentation:`page`}),e[0]=n,e[1]=r),r}function tn(e){return e.id}export{en as TaskDetailPage,q as TaskDetailView};
@@ -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{t as i}from"./chunk-KS7C4IRE-DIIvxCDx.js";import{a,c as o,i as s,n as c,o as l,r as u,s as d,t as f}from"./dist-DlirbHVs.js";import{h as p}from"./chat-page-qrdWReZ2.js";import{O as m}from"./markdown-view-BwbjZnQ6.js";import{t as h}from"./x-B_N4OPjy.js";import{t as g}from"./cn-0WouolD0.js";import{t as _}from"./skeleton-DzdOeGYz.js";import{r as v}from"./turn-outcome-BSbEJx8h.js";import{o as y}from"./product-delivery-4gEqUIsK.js";import{n as b}from"./attachment-utils-core-BPYdUI6y.js";import{r as x}from"./right-workspace-store-DOyKalyG.js";var S=n(),C=e(t(),1),w=r();function T(e){if(!e)return;let t=URL.parse(e,window.location.origin);return t&&[`http:`,`https:`].includes(t.protocol)&&/^(?:https?:\/\/|\/(?!\/))/i.test(e)?t.href:void 0}function E(e){let t=(0,S.c)(30),{item:n,workspaceScope:r,conversationId:g,backgroundPath:_,zh:E,className:O,children:k}=e,{artifact:A,reference:j,task:M}=n,[N,P]=(0,C.useState)(!1),F=A?.title??j?.title??n.id,I;t[0]===j?I=t[1]:(I=j&&y(j),t[0]=j,t[1]=I);let L=I,R=j?.kind===`chat_preview`?j.revision:void 0,z;t[2]!==A?.shareUrl||t[3]!==A?.uri?(z=T(A?.uri)??T(A?.shareUrl),t[2]=A?.shareUrl,t[3]=A?.uri,t[4]=z):z=t[4];let B=z,V=A?.uri,H;t[5]!==V||t[6]!==B?(H=V&&/^\/api\/(?:music-generation\/sessions\/[^/]+\/jobs\/[a-f0-9]{64}\/audio|video-generation\/sessions\/[^/]+\/jobs\/[a-fA-F0-9-]+\/video)$/.test(V)?B:void 0,t[5]=V,t[6]=B,t[7]=H):H=t[7];let U=H,W;t[8]!==A?.workspaceRelativePath||t[9]!==V?(W=V?.startsWith(`media://`)||V&&v(V)||A?.workspaceRelativePath,t[8]=A?.workspaceRelativePath,t[9]=V,t[10]=W):W=t[10];let G=!!W,K=!!(B&&window.electronAPI?.browser),q;return t[11]!==A||t[12]!==_||t[13]!==k||t[14]!==O||t[15]!==g||t[16]!==K||t[17]!==G||t[18]!==U||t[19]!==n.id||t[20]!==N||t[21]!==L||t[22]!==j||t[23]!==R||t[24]!==M?.id||t[25]!==F||t[26]!==B||t[27]!==r||t[28]!==E?(q=L?(0,w.jsx)(i,{to:m(_,L),className:O,children:k}):U||j&&R?(0,w.jsxs)(f,{open:N,onOpenChange:P,children:[(0,w.jsx)(o,{className:O,children:k}),N?(0,w.jsxs)(l,{children:[(0,w.jsx)(a,{className:`xopc-dialog-overlay fixed inset-0 z-[90] bg-black/45`}),(0,w.jsxs)(u,{onKeyDown:D,className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[91] flex h-[min(42rem,calc(100dvh-2rem))] w-[min(56rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge`,children:[(0,w.jsxs)(`header`,{className:`flex items-center justify-between gap-3 border-b border-edge px-4 py-3`,children:[(0,w.jsx)(d,{className:`truncate font-medium text-fg`,children:F}),(0,w.jsx)(s,{className:`sr-only`,children:E?`预览交付物`:`Preview deliverable`}),(0,w.jsx)(c,{"aria-label":E?`关闭预览`:`Close preview`,className:`grid size-8 shrink-0 place-items-center rounded-lg hover:bg-surface-hover`,children:(0,w.jsx)(h,{className:`size-4`})})]}),(0,w.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 pb-4`,children:U?(0,w.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-4 py-4`,children:[A?.kind===`audio`?(0,w.jsx)(`audio`,{controls:!0,preload:`metadata`,src:U,"aria-label":F,className:`w-full max-w-xl`}):(0,w.jsx)(`video`,{controls:!0,playsInline:!0,preload:`metadata`,src:U,"aria-label":F,className:`min-h-0 max-w-full rounded-lg bg-black`}),(0,w.jsx)(`a`,{href:`${U}?download=1`,download:!0,className:`shrink-0 text-sm text-accent-fg hover:underline`,children:E?`下载`:`Download`})]}):j&&R?(0,w.jsx)(p,{leaseId:`personal-deliverable:${n.id}`,reference:j,sourceHash:R,preferredHeight:480,language:E?`zh`:`en`}):null})]})]}):null]}):G||K?(0,w.jsx)(`button`,{type:`button`,className:O,onClick:()=>{let e=x.getState();G&&A?e.openFile({attachment:{...b(A),taskId:M?.id},conversationId:g},r):e.openBrowser(B,r)},children:k}):B?(0,w.jsx)(`a`,{href:B,target:`_blank`,rel:`noopener noreferrer`,className:O,children:k}):(0,w.jsx)(`div`,{className:O,children:k}),t[11]=A,t[12]=_,t[13]=k,t[14]=O,t[15]=g,t[16]=K,t[17]=G,t[18]=U,t[19]=n.id,t[20]=N,t[21]=L,t[22]=j,t[23]=R,t[24]=M?.id,t[25]=F,t[26]=B,t[27]=r,t[28]=E,t[29]=q):q=t[29],q}function D(e){return e.stopPropagation()}function O(){let e=(0,S.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,w.jsxs)(`div`,{className:`space-y-4`,"aria-busy":!0,children:[(0,w.jsx)(_,{className:`h-32 rounded-2xl`}),(0,w.jsx)(_,{className:`h-52 rounded-2xl`}),(0,w.jsx)(_,{className:`h-40 rounded-2xl`})]}),e[0]=t):t=e[0],t}function k(e){let t=(0,S.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=g(`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,w.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=g(`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,w.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,w.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}export{O as n,E as r,k as t};
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./chunk-KS7C4IRE-DIIvxCDx.js";import{a,c as o,i as s,n as c,o as l,r as u,s as d,t as f}from"./dist-DlirbHVs.js";import{h as p}from"./chat-page-sPNbEboB.js";import{O as m}from"./markdown-view-BQw7H2MV.js";import{t as h}from"./x-B_N4OPjy.js";import{t as g}from"./cn-0WouolD0.js";import{t as _}from"./skeleton-DzdOeGYz.js";import{r as v}from"./turn-outcome-BSbEJx8h.js";import{o as y}from"./product-delivery-4gEqUIsK.js";import{n as b}from"./attachment-utils-core-BPYdUI6y.js";import{r as x}from"./right-workspace-store-D3nQJkDG.js";var S=n(),C=e(t(),1),w=r();function T(e){if(!e)return;let t=URL.parse(e,window.location.origin);return t&&[`http:`,`https:`].includes(t.protocol)&&/^(?:https?:\/\/|\/(?!\/))/i.test(e)?t.href:void 0}function E(e){let t=(0,S.c)(30),{item:n,workspaceScope:r,conversationId:g,backgroundPath:_,zh:E,className:O,children:k}=e,{artifact:A,reference:j,task:M}=n,[N,P]=(0,C.useState)(!1),F=A?.title??j?.title??n.id,I;t[0]===j?I=t[1]:(I=j&&y(j),t[0]=j,t[1]=I);let L=I,R=j?.kind===`chat_preview`?j.revision:void 0,z;t[2]!==A?.shareUrl||t[3]!==A?.uri?(z=T(A?.uri)??T(A?.shareUrl),t[2]=A?.shareUrl,t[3]=A?.uri,t[4]=z):z=t[4];let B=z,V=A?.uri,H;t[5]!==V||t[6]!==B?(H=V&&/^\/api\/(?:music-generation\/sessions\/[^/]+\/jobs\/[a-f0-9]{64}\/audio|video-generation\/sessions\/[^/]+\/jobs\/[a-fA-F0-9-]+\/video)$/.test(V)?B:void 0,t[5]=V,t[6]=B,t[7]=H):H=t[7];let U=H,W;t[8]!==A?.workspaceRelativePath||t[9]!==V?(W=V?.startsWith(`media://`)||V&&v(V)||A?.workspaceRelativePath,t[8]=A?.workspaceRelativePath,t[9]=V,t[10]=W):W=t[10];let G=!!W,K=!!(B&&window.electronAPI?.browser),q;return t[11]!==A||t[12]!==_||t[13]!==k||t[14]!==O||t[15]!==g||t[16]!==K||t[17]!==G||t[18]!==U||t[19]!==n.id||t[20]!==N||t[21]!==L||t[22]!==j||t[23]!==R||t[24]!==M?.id||t[25]!==F||t[26]!==B||t[27]!==r||t[28]!==E?(q=L?(0,w.jsx)(i,{to:m(_,L),className:O,children:k}):U||j&&R?(0,w.jsxs)(f,{open:N,onOpenChange:P,children:[(0,w.jsx)(o,{className:O,children:k}),N?(0,w.jsxs)(l,{children:[(0,w.jsx)(a,{className:`xopc-dialog-overlay fixed inset-0 z-[90] bg-black/45`}),(0,w.jsxs)(u,{onKeyDown:D,className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[91] flex h-[min(42rem,calc(100dvh-2rem))] w-[min(56rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge`,children:[(0,w.jsxs)(`header`,{className:`flex items-center justify-between gap-3 border-b border-edge px-4 py-3`,children:[(0,w.jsx)(d,{className:`truncate font-medium text-fg`,children:F}),(0,w.jsx)(s,{className:`sr-only`,children:E?`预览交付物`:`Preview deliverable`}),(0,w.jsx)(c,{"aria-label":E?`关闭预览`:`Close preview`,className:`grid size-8 shrink-0 place-items-center rounded-lg hover:bg-surface-hover`,children:(0,w.jsx)(h,{className:`size-4`})})]}),(0,w.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 pb-4`,children:U?(0,w.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-4 py-4`,children:[A?.kind===`audio`?(0,w.jsx)(`audio`,{controls:!0,preload:`metadata`,src:U,"aria-label":F,className:`w-full max-w-xl`}):(0,w.jsx)(`video`,{controls:!0,playsInline:!0,preload:`metadata`,src:U,"aria-label":F,className:`min-h-0 max-w-full rounded-lg bg-black`}),(0,w.jsx)(`a`,{href:`${U}?download=1`,download:!0,className:`shrink-0 text-sm text-accent-fg hover:underline`,children:E?`下载`:`Download`})]}):j&&R?(0,w.jsx)(p,{leaseId:`personal-deliverable:${n.id}`,reference:j,sourceHash:R,preferredHeight:480,language:E?`zh`:`en`}):null})]})]}):null]}):G||K?(0,w.jsx)(`button`,{type:`button`,className:O,onClick:()=>{let e=x.getState();G&&A?e.openFile({attachment:{...b(A),taskId:M?.id},conversationId:g},r):e.openBrowser(B,r)},children:k}):B?(0,w.jsx)(`a`,{href:B,target:`_blank`,rel:`noopener noreferrer`,className:O,children:k}):(0,w.jsx)(`div`,{className:O,children:k}),t[11]=A,t[12]=_,t[13]=k,t[14]=O,t[15]=g,t[16]=K,t[17]=G,t[18]=U,t[19]=n.id,t[20]=N,t[21]=L,t[22]=j,t[23]=R,t[24]=M?.id,t[25]=F,t[26]=B,t[27]=r,t[28]=E,t[29]=q):q=t[29],q}function D(e){return e.stopPropagation()}function O(){let e=(0,S.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,w.jsxs)(`div`,{className:`space-y-4`,"aria-busy":!0,children:[(0,w.jsx)(_,{className:`h-32 rounded-2xl`}),(0,w.jsx)(_,{className:`h-52 rounded-2xl`}),(0,w.jsx)(_,{className:`h-40 rounded-2xl`})]}),e[0]=t):t=e[0],t}function k(e){let t=(0,S.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=g(`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,w.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=g(`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,w.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,w.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}export{O as n,E as r,k as t};
@@ -0,0 +1 @@
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{_ as i,t as a}from"./chunk-KS7C4IRE-DIIvxCDx.js";import{t as o}from"./messages-L7tv_OPK.js";import{t as s}from"./external-link-DjqjBmc3.js";import{t as c}from"./file-text-D12HbeVy.js";import{t as l}from"./markdown-view-BQw7H2MV.js";import{t as u}from"./cn-0WouolD0.js";import{b as d,gt as f,y as p}from"./session-manager-DQ0fiEo9.js";import{t as m,u as h}from"./workspace-preview-store-D8eGmciG.js";import{t as g}from"./button-C5tRaJxt.js";import{t as _}from"./activity-store-zMwJQbPV.js";import{m as v,o as y}from"./shares-api-Dp6g-bfj.js";import{n as b}from"./capability-presentation-DlJQUUlM.js";var x=n(),S=e(t(),1),C=r();function w(e){let t=(0,x.c)(38),{content:n,contentKey:r,language:a,markdown:o,breaks:s,previewHeight:c,className:d,children:p}=e,m=o===void 0||o,h=s!==void 0&&s,g=c===void 0?240:c,_;t[0]===n?_=t[1]:(_=f(n),t[0]=n,t[1]=_),n=_;let v=(0,S.useId)(),y=(0,S.useRef)(null),[b,w]=(0,S.useState)(!1),[T,E]=i(),D;t[2]!==r||t[3]!==T?(D=T.getAll(`taskExpanded`).includes(r),t[2]=r,t[3]=T,t[4]=D):D=t[4];let O=D,k;t[5]===g?k=t[6]:(k=()=>{let e=y.current;if(!e)return;let t=()=>w(e.scrollHeight>g);if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},t[5]=g,t[6]=k);let A;t[7]!==n||t[8]!==g?(A=[n,g],t[7]=n,t[8]=g,t[9]=A):A=t[9],(0,S.useLayoutEffect)(k,A);let j=b&&!O,M;t[10]===d?M=t[11]:(M=u(`min-w-0`,d),t[10]=d,t[11]=M);let N;t[12]!==j||t[13]!==g?(N=j?{maxHeight:g,overflow:`hidden`,maskImage:`linear-gradient(to bottom, black calc(100% - ${Math.min(24,g/3)}px), transparent)`}:void 0,t[12]=j,t[13]=g,t[14]=N):N=t[14];let P;t[15]!==h||t[16]!==p||t[17]!==n||t[18]!==m?(P=p??(m?(0,C.jsx)(l,{content:n,compact:!0,breaks:h,className:`text-sm leading-6 text-fg`}):(0,C.jsx)(`p`,{className:`whitespace-pre-wrap break-words [overflow-wrap:anywhere]`,children:n})),t[15]=h,t[16]=p,t[17]=n,t[18]=m,t[19]=P):P=t[19];let F;t[20]!==j||t[21]!==P?(F=(0,C.jsx)(`div`,{ref:y,inert:j,children:P}),t[20]=j,t[21]=P,t[22]=F):F=t[22];let I;t[23]!==v||t[24]!==F||t[25]!==N?(I=(0,C.jsx)(`div`,{id:v,style:N,children:F}),t[23]=v,t[24]=F,t[25]=N,t[26]=I):I=t[26];let L;t[27]!==r||t[28]!==O||t[29]!==v||t[30]!==a||t[31]!==b||t[32]!==E?(L=b?(0,C.jsx)(`button`,{type:`button`,"aria-expanded":O,"aria-controls":v,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:()=>E(e=>{let t=new URLSearchParams(e),n=t.getAll(`taskExpanded`).filter(e=>e!==r);t.delete(`taskExpanded`);for(let e of n)t.append(`taskExpanded`,e);return O||t.append(`taskExpanded`,r),t},{preventScrollReset:!0}),children:a===`zh`?O?`收起`:`查看更多`:O?`Show less`:`Show more`}):null,t[27]=r,t[28]=O,t[29]=v,t[30]=a,t[31]=b,t[32]=E,t[33]=L):L=t[33];let R;return t[34]!==I||t[35]!==L||t[36]!==M?(R=(0,C.jsxs)(`div`,{className:M,children:[I,L]}),t[34]=I,t[35]=L,t[36]=M,t[37]=R):R=t[37],R}function T({wait:e,detail:t,zh:n,onUpdated:r}){let[i,a]=(0,S.useState)(``),[o,s]=(0,S.useState)(!1),[c,l]=(0,S.useState)(``),[u,d]=(0,S.useState)(!1),f=(0,S.useRef)(null),p=e.kind===`approval`,m=Array.isArray(e.condition.choices)?e.condition.choices.filter(e=>typeof e==`string`):[];async function v(a){if(!p&&!i.trim()||p&&!a||o)return;let c=JSON.stringify([t.task.version,i.trim(),a]);f.current?.signature!==c&&(f.current={signature:c,key:crypto.randomUUID()}),s(!0),l(``);try{let o=await h(t.task.id,{type:`resolve_wait`,waitId:e.id,resolution:p?{kind:`task_approval`,decision:a}:{kind:`user_answer`,answer:i.trim()}},t.task.version,f.current.key);d(!0),r(o),_({tone:`success`,title:p?n?`决定已保存`:`Decision saved`:n?`补充信息已保存`:`Answer saved`,message:o.waits.length?n?`仍有其他等待条件,任务尚未恢复执行。`:`Other waiting conditions remain.`:n?`等待已解除,请在任务状态中查看后续执行进展。`:`The wait is resolved. Follow progress in the task status.`,source:n?`任务`:`Task`})}catch{l(n?`提交未确认,内容已保留。可重试;若问题已变化,请刷新。`:`Submission not confirmed. Your answer is saved here; retry or refresh if the question changed.`)}finally{s(!1)}}return(0,C.jsxs)(`form`,{className:`mt-3 space-y-3 rounded-lg border border-edge p-3`,onSubmit:e=>{e.preventDefault(),v()},children:[p?(0,C.jsxs)(`div`,{className:`text-sm text-fg`,children:[(0,C.jsx)(`p`,{children:e.reason}),(0,C.jsxs)(`p`,{className:`mt-2`,children:[n?`授权范围:`:`Permission: `,String(e.condition.capability)]}),(0,C.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,C.jsx)(g,{type:`button`,variant:`primary`,disabled:o||u,onClick:()=>void v(`approve`),children:n?`批准`:`Approve`}),(0,C.jsx)(g,{type:`button`,disabled:o||u,onClick:()=>void v(`deny`),children:n?`拒绝并暂停`:`Deny and pause`})]})]}):(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(`label`,{className:`block text-sm text-fg`,children:[typeof e.condition.question==`string`?e.condition.question:e.reason,(0,C.jsx)(`textarea`,{className:`mt-2 w-full rounded-lg border border-edge bg-surface-panel p-3`,rows:3,maxLength:12e3,value:i,disabled:o||u,onChange:e=>a(e.target.value)})]}),m.length>0&&(0,C.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:m.map(e=>(0,C.jsx)(g,{type:`button`,disabled:o||u,variant:`secondary`,"aria-pressed":i===e,onClick:()=>a(e),children:e},e))}),(0,C.jsx)(g,{type:`submit`,variant:`primary`,disabled:o||u||!i.trim(),children:o?n?`正在提交`:`Submitting`:n?`提交补充信息`:`Submit answer`})]}),(0,C.jsx)(`p`,{className:`text-xs text-fg-muted`,children:n?`保存到任务上下文;其他等待条件满足后继续执行。`:`Saved to task context. Work continues once all waiting conditions are met.`}),c&&(0,C.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:c})]})}function E(e,t){let n;try{n=new URL(e)}catch{return}return t.find(e=>[e.shareUrl,e.lanUrl].some(e=>{if(!e)return!1;try{let t=new URL(e);return t.origin===n.origin&&t.pathname.replace(/\/$/,``)===n.pathname.replace(/\/$/,``)}catch{return!1}}))}function D({uri:e,zh:t}){let[n,r]=(0,S.useState)(),[i,o]=(0,S.useState)(!1),[s,c]=(0,S.useState)(!1),[l,u]=(0,S.useState)(``),[d,f]=(0,S.useState)(``);async function p(){o(!0),u(``);try{let n=E(e,(await v()).payload.shares);r(n),c(!0),n?n.kind!==`file`&&n.kind!==`directory`?u(t?`这是文档快照,请从原笔记或对话的分享面板重新发布。`:`This is a document snapshot. Republish it from the original note or conversation.`):n.revoked?u(t?`分享已被撤销,不能自动恢复。请从原任务重新生成并分享。`:`This share was revoked. Generate and share a new artifact from the task.`):n.maxViews!==null&&n.downloadCount>=n.maxViews?u(t?`已达到访问次数上限,请在分享设置中调整后重试。`:`The access limit was reached. Adjust it in share settings.`):n.expired||(f(n.shareUrl),u(t?`链接仍在有效期内;若打不开,请检查网关连接。`:`The link has not expired. If it cannot open, check gateway connectivity.`)):u(t?`未找到本机管理的分享记录。外部链接或已清理的记录无法在这里续期,请从原任务重新生成产物。`:`No locally managed share matches this link. Regenerate the artifact from its task.`)}catch{u(t?`检查失败,请重试。`:`Check failed. Please retry.`)}finally{o(!1)}}async function m(){if(!(!n||i)){o(!0),u(``);try{let e=await y(n.id,864e5);f(e.payload.shareUrl),r({...n,expired:!1,expiresAt:e.payload.expiresAt}),u(t?`已续期 24 小时,访问范围与次数限制保持不变。`:`Renewed for 24 hours. Access scope and view limits are unchanged.`)}catch(e){u(`${t?`恢复失败:`:`Recovery failed: `}${e instanceof Error?e.message:String(e)}`)}finally{o(!1)}}}return(0,C.jsxs)(`details`,{className:`mt-2 text-xs text-fg-muted`,children:[(0,C.jsx)(`summary`,{className:`cursor-pointer py-2`,children:t?`链接打不开?`:`Trouble opening the link?`}),(0,C.jsxs)(`div`,{className:`space-y-2`,children:[(0,C.jsx)(g,{type:`button`,variant:`ghost`,disabled:i,onClick:()=>void p(),children:t?`检查链接状态`:`Check link`}),s&&n?.expired&&(n.kind===`file`||n.kind===`directory`)&&!n.revoked&&(n.maxViews===null||n.downloadCount<n.maxViews)&&(0,C.jsx)(g,{type:`button`,disabled:i,onClick:()=>void m(),children:t?`恢复链接 · 续期 24 小时`:`Restore link for 24 hours`}),l&&(0,C.jsx)(`p`,{role:`status`,className:`break-words leading-5`,children:l}),d&&(0,C.jsx)(`a`,{className:`block py-2 text-accent`,href:d,target:`_blank`,rel:`noopener noreferrer`,children:t?`打开产物`:`Open artifact`}),s&&(0,C.jsx)(a,{className:`block py-2 text-accent`,to:`/settings/shares`,children:t?`管理分享记录`:`Manage shares`})]})]})}var O=`/settings/capabilities/models`,k=new Set([`provider_setup_required`,`provider_auth_invalid`,`rate_limit`,`timeout`,`provider_connection_error`,`billing`,`model_quota_exhausted`,`platform_token_limit_exceeded`,`credit_budget_exhausted`,`xopc_quota_exhausted`,`xopc_platform_limit`,`xopc_credit_budget_exhausted`,`unknown`,`format`]),A=/^(?:No API key found for |OAuth refresh failed for |[a-z]*Error:|HTTP [45]\d{2}\b|[45]\d{2}(?::| (?:Unauthorized|Forbidden|Too Many Requests|Bad Request|Internal Server Error|Bad Gateway|Service Unavailable|Gateway Timeout)\b)|invalid_api_key\b|insufficient_quota\b)/i,j=/^(?:(?:fetch|connection) failed\b|Connection error[.!]?\s*$|(?:Request|Agent run) timed out\b|Assistant turn failed\b)/i;function M(e){let t=e.trim().replace(/^Error:\s+/,``);if(t.startsWith(`{`)){let e=d(t);if(e&&(k.has(e.code)||k.has(e.kind)||/(?:error|failed)$/.test(e.kind)))return e;let n=/^\{\s*"(?:kind|code)"\s*:\s*"([^"]+)"/.exec(t)?.[1];if(!e&&n&&k.has(n))return{code:n,kind:n,provider:void 0}}return A.test(e.trim())||j.test(t)||/\n[ \t]+at\s+(?:async\s+)?\S+/.test(t)?p(t):null}function N(e,t,n){let r=e?M(e):null,i=r?k.has(r.code)?r.code:r.kind:n,a=t===`zh`,s=o(t).chat,c=r?.provider,l=c&&/^[a-z0-9][a-z0-9._-]{0,79}$/i.test(c)&&!/^sk-/i.test(c)?b(c,c===`qwen-token-plan-cn`?`Alibaba Bailian Subscription (China)`:c,a):a?`当前任务使用的模型服务商`:`the model provider used by this task`,u={label:a?`打开模型设置`:`Open model settings`,href:O};switch(i){case`provider_setup_required`:return{title:s.providerSetupRequiredTitle,description:a?`本次任务缺少 ${l} 的连接凭证。请在模型设置中完成配置,再回到工作台重试。`:`Credentials for ${l} are missing. Set them up in model settings, then return to the workbench and retry.`,action:u};case`provider_auth_invalid`:return{title:a?`模型服务商认证失败`:`Model provider authentication failed`,description:a?`${l} 拒绝了当前凭证。请重新登录或更新 API 密钥,再重试。`:`${l} rejected the current credentials. Sign in again or update the API key, then retry.`,action:u};case`provider_connection_error`:return{title:s.agentRunErrorConnectionTitle,description:a?`本次执行中断。请稍后重试;如果已经执行过外部操作,先核对实际结果。`:`The run was interrupted. Try again later. If it already took an external action, check the outcome first.`};case`rate_limit`:return{title:s.agentRunErrorRateLimitTitle,description:s.agentRunErrorRateLimitBody};case`timeout`:return{title:s.agentRunErrorTimeoutTitle,description:s.agentRunErrorTimeoutBody};case`billing`:return{title:s.agentRunErrorBillingTitle,description:s.agentRunErrorBillingBody};case`xopc_quota_exhausted`:case`model_quota_exhausted`:return{title:s.xopcQuotaExhaustedTitle,description:s.xopcQuotaExhaustedBody,action:u};case`xopc_platform_limit`:case`platform_token_limit_exceeded`:return{title:s.xopcPlatformLimitTitle,description:s.xopcPlatformLimitBody,action:u};case`xopc_credit_budget_exhausted`:case`credit_budget_exhausted`:return{title:s.creditBudgetExhaustedTitle,description:s.creditBudgetExhaustedBody,action:{label:s.creditBudgetSettingsCta,href:`/settings/agent-defaults?panel=runtime`}};case`tool_outcome_unconfirmed`:case`execution_interrupted`:return{title:a?`需要确认上次操作结果`:`Confirm the outcome of the previous run`,description:a?`重试前请确认上次执行是否已产生外部变更。`:`Before retrying, check whether the previous run made any external changes.`};case`acceptance_incomplete`:return{title:a?`结果尚未达到验收要求`:`The result does not yet meet the requirements`,description:a?`请查看尚待完成的事项和已有依据,确认还需要补做什么。`:`Review the remaining work and available evidence to see what still needs attention.`};case`empty_agent_run`:return{title:a?`本次执行没有生成可查看的结果`:`This run did not produce a result to review`};case`dispatch_failed`:return{title:a?`任务未能开始执行`:`The task could not start`};default:return r?{title:a?`本次执行未完成`:`This run did not complete`}:void 0}}var P={"The required evidence-linked research result is missing.":[`缺少可核对的来源和结论,暂时无法核验结果。`,`There are no source-backed findings to verify yet.`],"The requested chat reply is missing.":[`还没有生成可在对话中查看的答复。`,`The reply for the conversation is still missing.`],"Requirements changed after review.":[`验收后任务要求有更新,需要按最新要求重新核验。`,`The requirements changed after review. The result needs to be checked against the latest requirements.`],"Review every current acceptance criterion;":[`还有验收条件尚未核验。`,`Some acceptance criteria have not been checked.`],"No evidence-linked verification result was submitted.":[`暂时缺少可核对的依据。`,`There is no evidence to check this criterion yet.`],"Criterion omitted by reviewer.":[`本次核验未覆盖此项。`,`This criterion was not checked.`],"Instruction omitted by reviewer.":[`本次核验未覆盖这项补充要求。`,`This additional requirement was not checked.`],"Review unavailable.":[`本次未能完成核验。`,`Verification could not be completed.`],"Directions added during execution still need verification.":[`执行期间补充的要求还有待核验。`,`Requirements added during the run still need verification.`],"Default criteria were not expanded into concrete acceptance items;":[`验收条件还不够具体,暂时无法逐项确认完成情况。`,`The criteria are too broad to confirm which requirements are met.`],"Evidence is insufficient.":[`现有依据不足。`,`The available evidence is insufficient.`]};function F(e,t){let n=/^(Published file missing|Publication changed after review):\s*(.+?)\. (?:Republish from the existing workspace output|Review the final version)\.$/.exec(e);if(n){let[,e,r]=n,i=/^Selected artifact\s+/.test(r)?void 0:r;return e===`Published file missing`?t===`zh`?i?`暂时无法打开交付文件「${i}」,需要重新发布。`:`有交付文件缺失,需要重新发布。`:i?`“${i}” is unavailable and needs to be published again.`:`A deliverable is missing and needs to be published again.`:t===`zh`?`交付文件「${r}」有更新,需要核验最新版本。`:`“${r}” changed after review. Check the latest version.`}let r=e.replace(/^(?:Criterion \d+|Instruction \d+|Claim [\w.-]+):\s*/,``),i=Object.entries(P).find(([e])=>r.startsWith(e));return i?i[1][t===`zh`?0:1]:t===`zh`&&r.endsWith(` Evidence is insufficient.`)?`${r.slice(0,-26).replace(/([。!?])\.$/,`$1`)} 现有依据不足。`:r.replace(/([。!?])\.(?=\s|$)/g,`$1`)}function I(e,t){return e?.trim()?N(e,t)?.title??F(e.trim(),t):``}function L(e,t,n){let r=t===`zh`,i=e.status===`failed`?e.failure?.code:void 0,a=N(e.summary,t),o=i===`tool_outcome_unconfirmed`||i===`execution_interrupted`?N(void 0,t,i):a??N(e.status===`failed`?n:void 0,t,i);return{issue:o,summary:a||i===`empty_agent_run`?``:F(e.summary.trim(),t),remainingWork:[...new Set(e.remainingWork.map(e=>I(e,t)).filter(Boolean))],nextAction:I(e.nextAction,t)||(o?.description?``:I(e.failure?.recoveryAction,t)),status:e.status===`cancelled`?r?`本次执行已取消。`:`This run was canceled.`:e.status===`failed`||e.completionVerdict===`not_achieved`?r?`本次执行未完成。`:`This run did not complete.`:e.completionVerdict===`achieved`?r?`执行报告已达成目标,请结合依据验收。`:`The run reports that it met the goal. Review the evidence before accepting.`:e.completionVerdict===`partial`?r?`已有阶段性结果,仍有事项需要确认或完成。`:`A partial result is available. Some work still needs review or completion.`:r?`本次执行已结束,请查看结果和依据。`:`The run ended. Review the result and supporting evidence.`}}function R(e){let t=(0,x.c)(18),{evidence:n,projectId:r,conversationId:i,language:a,onOpenFile:o,compact:l}=e,u=l!==void 0&&l,d=m(z);if(!n.length)return null;let f=a===`zh`?`交付物与验证依据`:`Deliverables and evidence`,p;if(t[0]!==u||t[1]!==i||t[2]!==n||t[3]!==a||t[4]!==o||t[5]!==r||t[6]!==d){let e;t[8]!==u||t[9]!==i||t[10]!==a||t[11]!==o||t[12]!==r||t[13]!==d?(e=(e,t)=>{let n=e.uri?.trim(),l=n&&/^https?:\/\//i.test(n),f=n&&!l&&e.kind===`artifact`&&!/^[a-z][a-z0-9+.-]*:/i.test(n)&&!n.startsWith(`//`),p=a===`zh`,m=e.kind===`source`&&e.provenance===`judge`&&e.title.startsWith(`Research claim: `),h=l?URL.parse(n)?.hostname:void 0,g=m?h?p?`查看来源 · ${h}`:`Open source · ${h}`:p?`结论依据`:`Evidence for this finding`:e.title||(p?`查看交付物`:`Open artifact`),_=I(e.summary,a);return(0,C.jsxs)(`div`,{className:`min-w-0 rounded-lg border border-edge-subtle p-3`,children:[(0,C.jsx)(w,{content:g,contentKey:`${i??r}:evidence-title:${t}:${e.title}`,language:a,previewHeight:60,children:l?(0,C.jsxs)(`a`,{className:`inline-flex min-h-11 items-center gap-2 text-sm font-medium text-accent hover:underline [overflow-wrap:anywhere]`,href:n,target:`_blank`,rel:`noopener noreferrer`,children:[(0,C.jsx)(s,{className:`size-4 shrink-0`}),(0,C.jsx)(`span`,{className:`min-w-0 break-words`,children:g})]}):f&&(r||i)?(0,C.jsxs)(`button`,{type:`button`,className:`inline-flex min-h-11 items-center gap-2 text-sm font-medium text-accent hover:underline [overflow-wrap:anywhere]`,onClick:()=>o?o(n):d(n,null,r,i),children:[(0,C.jsx)(c,{className:`size-4 shrink-0`}),g]}):(0,C.jsx)(`p`,{className:`break-words [overflow-wrap:anywhere] text-sm font-medium text-fg`,children:g})}),l&&e.kind===`artifact`&&(0,C.jsx)(D,{uri:n,zh:a===`zh`},n),u&&!l&&!(f&&(r||i))?(0,C.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:a===`zh`?`位置待确认`:`Location needs confirmation`}):null,!u&&_?(0,C.jsx)(w,{content:_,contentKey:`${i??r}:evidence:${t}:${e.title}`,language:a,markdown:!1,previewHeight:80,className:`mt-1 text-xs leading-5 text-fg-muted`}):null,u?null:(0,C.jsx)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:e.provenance===`judge`?e.strength===`verified`?a===`zh`?`模型审阅通过`:`Model reviewed`:a===`zh`?`模型未确认,待核验`:`Not confirmed by review`:e.strength===`verified`?a===`zh`?`已验证`:`Verified`:a===`zh`?`已记录,待验证`:`Observed, not verified`})]},`${e.title}-${t}`)},t[8]=u,t[9]=i,t[10]=a,t[11]=o,t[12]=r,t[13]=d,t[14]=e):e=t[14],p=n.map(e),t[0]=u,t[1]=i,t[2]=n,t[3]=a,t[4]=o,t[5]=r,t[6]=d,t[7]=p}else p=t[7];let h;return t[15]!==f||t[16]!==p?(h=(0,C.jsx)(`div`,{className:`mt-4 grid gap-2 sm:grid-cols-2`,"aria-label":f,children:p}),t[15]=f,t[16]=p,t[17]=h):h=t[17],h}function z(e){return e.setPath}function B(e){let t=(0,x.c)(10),{issue:n}=e,r;t[0]===n.title?r=t[1]:(r=(0,C.jsx)(`p`,{className:`text-sm font-semibold text-fg`,children:n.title}),t[0]=n.title,t[1]=r);let i;t[2]===n.description?i=t[3]:(i=n.description?(0,C.jsx)(`p`,{className:`text-sm leading-6 text-fg-muted`,children:n.description}):null,t[2]=n.description,t[3]=i);let o;t[4]===n.action?o=t[5]:(o=n.action?(0,C.jsx)(g,{asChild:!0,variant:`secondary`,children:(0,C.jsx)(a,{to:n.action.href,children:n.action.label})}):null,t[4]=n.action,t[5]=o);let s;return t[6]!==r||t[7]!==i||t[8]!==o?(s=(0,C.jsxs)(`div`,{className:`space-y-2 rounded-lg border border-edge bg-surface-inset p-3`,children:[r,i,o]}),t[6]=r,t[7]=i,t[8]=o,t[9]=s):s=t[9],s}export{T as a,I as i,R as n,w as o,L as r,B as t};
@@ -1 +1 @@
1
- import{p as e}from"./locale-store-5DzxIIeq.js";var t=[];function n(e,n){return e[n]??t}var r=0;function i(){return globalThis.crypto?.randomUUID?.()??`terminal-${Date.now()}-${++r}`}function a(e){let t=typeof window>`u`?640:Math.max(180,Math.floor(window.innerHeight*.65));return Math.min(640,t,Math.max(180,Math.round(e)))}var o=e((e,t)=>({openByConversationId:{},tabsByConversationId:{},activeTabKeyByConversationId:{},height:300,open:n=>{let r=t();if(r.tabsByConversationId[n]?.length){e({openByConversationId:{...r.openByConversationId,[n]:!0}});return}let a=i();e({openByConversationId:{...r.openByConversationId,[n]:!0},tabsByConversationId:{...r.tabsByConversationId,[n]:[{key:a}]},activeTabKeyByConversationId:{...r.activeTabKeyByConversationId,[n]:a}})},toggle:n=>{let r=t(),i=!r.openByConversationId[n];if(!i||r.tabsByConversationId[n]?.length){e({openByConversationId:{...r.openByConversationId,[n]:i}});return}r.open(n)},close:t=>e(e=>({openByConversationId:{...e.openByConversationId,[t]:!1}})),addTerminal:n=>{let r=t(),a=r.tabsByConversationId[n]??[];if(a.length>=8)return r.activeTabKeyByConversationId[n]??a[0].key;let o=i();return e({tabsByConversationId:{...r.tabsByConversationId,[n]:[...a,{key:o}]},activeTabKeyByConversationId:{...r.activeTabKeyByConversationId,[n]:o}}),o},closeTerminal:(t,n)=>e(e=>{let r=e.tabsByConversationId[t]??[],i=r.findIndex(e=>e.key===n);if(i<0)return e;let a=r.filter(e=>e.key!==n),o=e.activeTabKeyByConversationId[t],s=o===n?a[Math.min(i,a.length-1)]?.key:o;return{tabsByConversationId:{...e.tabsByConversationId,[t]:a},activeTabKeyByConversationId:{...e.activeTabKeyByConversationId,[t]:s}}}),setActiveTerminal:(t,n)=>e(e=>(e.tabsByConversationId[t]??[]).some(e=>e.key===n)?{activeTabKeyByConversationId:{...e.activeTabKeyByConversationId,[t]:n}}:e),setHeight:t=>e({height:a(t)})}));export{n,o as r,a as t};
1
+ import{p as e}from"./locale-store-CeEXxDaP.js";var t=[];function n(e,n){return e[n]??t}var r=0;function i(){return globalThis.crypto?.randomUUID?.()??`terminal-${Date.now()}-${++r}`}function a(e){let t=typeof window>`u`?640:Math.max(180,Math.floor(window.innerHeight*.65));return Math.min(640,t,Math.max(180,Math.round(e)))}var o=e((e,t)=>({openByConversationId:{},tabsByConversationId:{},activeTabKeyByConversationId:{},height:300,open:n=>{let r=t();if(r.tabsByConversationId[n]?.length){e({openByConversationId:{...r.openByConversationId,[n]:!0}});return}let a=i();e({openByConversationId:{...r.openByConversationId,[n]:!0},tabsByConversationId:{...r.tabsByConversationId,[n]:[{key:a}]},activeTabKeyByConversationId:{...r.activeTabKeyByConversationId,[n]:a}})},toggle:n=>{let r=t(),i=!r.openByConversationId[n];if(!i||r.tabsByConversationId[n]?.length){e({openByConversationId:{...r.openByConversationId,[n]:i}});return}r.open(n)},close:t=>e(e=>({openByConversationId:{...e.openByConversationId,[t]:!1}})),addTerminal:n=>{let r=t(),a=r.tabsByConversationId[n]??[];if(a.length>=8)return r.activeTabKeyByConversationId[n]??a[0].key;let o=i();return e({tabsByConversationId:{...r.tabsByConversationId,[n]:[...a,{key:o}]},activeTabKeyByConversationId:{...r.activeTabKeyByConversationId,[n]:o}}),o},closeTerminal:(t,n)=>e(e=>{let r=e.tabsByConversationId[t]??[],i=r.findIndex(e=>e.key===n);if(i<0)return e;let a=r.filter(e=>e.key!==n),o=e.activeTabKeyByConversationId[t],s=o===n?a[Math.min(i,a.length-1)]?.key:o;return{tabsByConversationId:{...e.tabsByConversationId,[t]:a},activeTabKeyByConversationId:{...e.activeTabKeyByConversationId,[t]:s}}}),setActiveTerminal:(t,n)=>e(e=>(e.tabsByConversationId[t]??[]).some(e=>e.key===n)?{activeTabKeyByConversationId:{...e.activeTabKeyByConversationId,[t]:n}}:e),setHeight:t=>e({height:a(t)})}));export{n,o as r,a as t};
@@ -1 +1 @@
1
- import{p as e}from"./locale-store-5DzxIIeq.js";import{t}from"./middleware-Pd0e8Igk.js";var n=`default`,r={light:{default:`#f7f8fa`,emerald:`#f0fdf4`,clay:`#fffaf0`,dawn:`#accdec`,porcelain:`#f6f0e7`},dark:{default:`#14171c`,emerald:`#000000`,clay:`#0a1a1a`,dawn:`#172433`,porcelain:`#211c19`}};function i(e,t){let n=document.head;if(!n)return;let i=n.querySelector(`meta[name="theme-color"][data-xopc-theme-color="true"]`);i||(i=document.createElement(`meta`),i.setAttribute(`name`,`theme-color`),i.setAttribute(`data-xopc-theme-color`,`true`),n.appendChild(i)),i.setAttribute(`content`,r[e][t])}function a(){return globalThis.matchMedia?.(`(prefers-color-scheme: dark)`).matches??!1}function o(e){return e===`system`?a()?`dark`:`light`:e}function s(){return globalThis.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches??!1}function c(e){return e==="default"||e===`emerald`||e===`clay`||e===`dawn`||e===`porcelain`?e:n}function l(e){window.electronAPI?.theme?.setPreference(e).catch(()=>{})}function u(e,t,n){let r=document.documentElement,a=()=>{r.classList.toggle(`dark`,e===`dark`),r.dataset.theme=e,r.dataset.colorScheme=t,i(e,t)},o=document;n&&!s()&&typeof o.startViewTransition==`function`?o.startViewTransition(a):a()}function d(){try{let e=localStorage.getItem(`xopc-web-theme`),t=`system`,r=n;if(e){let n=JSON.parse(e);n.state?.preference&&(t=n.state.preference),n.state&&`colorScheme`in n.state&&(r=c(n.state.colorScheme))}u(o(t),r,!1),l(t)}catch{u(o(`system`),`default`,!1)}}var f=e(t((e,t)=>({preference:`system`,colorScheme:n,resolved:o(`system`),setPreference:n=>{let r=o(n),{resolved:i,colorScheme:a}=t();u(r,a,r!==i),e({preference:n,resolved:r}),l(n)},setColorScheme:n=>{let{resolved:r}=t();u(r,n,!0),e({colorScheme:n})}}),{name:`xopc-web-theme`,merge:(e,t)=>{let n=e??{};return{...t,...n,colorScheme:c(n.colorScheme)}}}));function p(){let{preference:e,colorScheme:t}=f.getState(),n=o(e);u(n,t,!1),f.setState({resolved:n}),l(e)}function m(){let e=globalThis.matchMedia?.(`(prefers-color-scheme: dark)`);if(!e)return()=>{};let t=()=>{let{preference:e,colorScheme:t}=f.getState();if(e!==`system`)return;let n=o(`system`),r=f.getState().resolved;u(n,t,n!==r),f.setState({resolved:n})};return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)}export{f as i,m as n,p as r,d as t};
1
+ import{p as e}from"./locale-store-CeEXxDaP.js";import{t}from"./middleware-Pd0e8Igk.js";var n=`default`,r={light:{default:`#f7f8fa`,emerald:`#f0fdf4`,clay:`#fffaf0`,dawn:`#accdec`,porcelain:`#f6f0e7`},dark:{default:`#14171c`,emerald:`#000000`,clay:`#0a1a1a`,dawn:`#172433`,porcelain:`#211c19`}};function i(e,t){let n=document.head;if(!n)return;let i=n.querySelector(`meta[name="theme-color"][data-xopc-theme-color="true"]`);i||(i=document.createElement(`meta`),i.setAttribute(`name`,`theme-color`),i.setAttribute(`data-xopc-theme-color`,`true`),n.appendChild(i)),i.setAttribute(`content`,r[e][t])}function a(){return globalThis.matchMedia?.(`(prefers-color-scheme: dark)`).matches??!1}function o(e){return e===`system`?a()?`dark`:`light`:e}function s(){return globalThis.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches??!1}function c(e){return e==="default"||e===`emerald`||e===`clay`||e===`dawn`||e===`porcelain`?e:n}function l(e){window.electronAPI?.theme?.setPreference(e).catch(()=>{})}function u(e,t,n){let r=document.documentElement,a=()=>{r.classList.toggle(`dark`,e===`dark`),r.dataset.theme=e,r.dataset.colorScheme=t,i(e,t)},o=document;n&&!s()&&typeof o.startViewTransition==`function`?o.startViewTransition(a):a()}function d(){try{let e=localStorage.getItem(`xopc-web-theme`),t=`system`,r=n;if(e){let n=JSON.parse(e);n.state?.preference&&(t=n.state.preference),n.state&&`colorScheme`in n.state&&(r=c(n.state.colorScheme))}u(o(t),r,!1),l(t)}catch{u(o(`system`),`default`,!1)}}var f=e(t((e,t)=>({preference:`system`,colorScheme:n,resolved:o(`system`),setPreference:n=>{let r=o(n),{resolved:i,colorScheme:a}=t();u(r,a,r!==i),e({preference:n,resolved:r}),l(n)},setColorScheme:n=>{let{resolved:r}=t();u(r,n,!0),e({colorScheme:n})}}),{name:`xopc-web-theme`,merge:(e,t)=>{let n=e??{};return{...t,...n,colorScheme:c(n.colorScheme)}}}));function p(){let{preference:e,colorScheme:t}=f.getState(),n=o(e);u(n,t,!1),f.setState({resolved:n}),l(e)}function m(){let e=globalThis.matchMedia?.(`(prefers-color-scheme: dark)`);if(!e)return()=>{};let t=()=>{let{preference:e,colorScheme:t}=f.getState();if(e!==`system`)return;let n=o(`system`),r=f.getState().resolved;u(n,t,n!==r),f.setState({resolved:n})};return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)}export{f as i,m as n,p as r,d as t};