@xopcai/xopc 0.0.426 → 0.0.427

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 (360) hide show
  1. package/dist/browser-ext/manifest.json +1 -1
  2. package/dist/extensions/telegram/src/adapters/security-adapter.js +1 -1
  3. package/dist/extensions/telegram/src/pairing-config-resolver.js +1 -1
  4. package/dist/extensions/telegram/src/plugin.js +2 -2
  5. package/dist/extensions/telegram/xopc.extension.json +1 -1
  6. package/dist/extensions/weixin/src/api/api.js +1 -1
  7. package/dist/extensions/weixin/src/auth/accounts.js +2 -2
  8. package/dist/extensions/weixin/src/auth/pairing.js +1 -1
  9. package/dist/extensions/weixin/src/cdn/upload.js +1 -1
  10. package/dist/extensions/weixin/src/cli/gateway-qr-login.js +1 -1
  11. package/dist/extensions/weixin/src/cli/qr-login.js +1 -1
  12. package/dist/extensions/weixin/src/messaging/debug-mode.js +1 -1
  13. package/dist/extensions/weixin/src/messaging/inbound.js +2 -2
  14. package/dist/extensions/weixin/src/messaging/process-message.js +3 -3
  15. package/dist/extensions/weixin/src/messaging/send.js +12 -3
  16. package/dist/extensions/weixin/src/monitor/monitor.js +1 -1
  17. package/dist/extensions/weixin/src/outbound-send.js +12 -3
  18. package/dist/extensions/weixin/src/pairing-config-resolver.js +1 -1
  19. package/dist/extensions/weixin/src/plugin.js +1 -1
  20. package/dist/gateway/static/root/assets/agent-defaults-settings-panel-D4ClP_DJ.js +1 -0
  21. package/dist/gateway/static/root/assets/agent-plugin-dialog-m1A8wF9p.js +1 -0
  22. package/dist/gateway/static/root/assets/agents-B9slUA_1.js +77 -0
  23. package/dist/gateway/static/root/assets/app-link-DRy3-k7j.js +1 -0
  24. package/dist/gateway/static/root/assets/{app-management-settings-panel-C8yc3yHG.js → app-management-settings-panel-XqoIBF2H.js} +1 -1
  25. package/dist/gateway/static/root/assets/{appearance-settings-BELgtR3O.js → appearance-settings-9ZtqCASo.js} +1 -1
  26. package/dist/gateway/static/root/assets/apps-page-DUeu_7iC.js +1 -0
  27. package/dist/gateway/static/root/assets/attachment-load-DrVGNxJm.js +1 -0
  28. package/dist/gateway/static/root/assets/automation-task-card-Bur78p68.js +3 -0
  29. package/dist/gateway/static/root/assets/{automations-page-CdIPdwF0.js → automations-page-DMIyWsP0.js} +1 -1
  30. package/dist/gateway/static/root/assets/automations-workspace-DEkDjxeU.js +9 -0
  31. package/dist/gateway/static/root/assets/{block-editor-BQtTLe6Q.js → block-editor-CXdlNAmZ.js} +2 -2
  32. package/dist/gateway/static/root/assets/{browser-automation-inputs-DeraGZ1y.js → browser-automation-inputs-Fxo7HbK6.js} +1 -1
  33. package/dist/gateway/static/root/assets/{browser-automations-page-SpPzRNqU.js → browser-automations-page-Dn3LN5wo.js} +2 -2
  34. package/dist/gateway/static/root/assets/browser-settings-page-Cpm9fEPV.js +3 -0
  35. package/dist/gateway/static/root/assets/{button-CnRSIP6m.js → button-Cc4hUNTt.js} +1 -1
  36. package/dist/gateway/static/root/assets/{capabilities-DLMuj21P.js → capabilities-BEvywfF9.js} +1 -1
  37. package/dist/gateway/static/root/assets/capabilities-Bo2qEJhH.js +1 -0
  38. package/dist/gateway/static/root/assets/capabilities-page-BCzsIzvC.js +2 -0
  39. package/dist/gateway/static/root/assets/capabilities-settings-panel-Cr67ziwX.js +8 -0
  40. package/dist/gateway/static/root/assets/{capability-header-actions-CTUCuBlW.js → capability-header-actions-BxMYfQ8y.js} +1 -1
  41. package/dist/gateway/static/root/assets/channels-CA5z5dGY.js +1 -0
  42. package/dist/gateway/static/root/assets/{chat-chart-block-DCzUECct.js → chat-chart-block-B39npsXj.js} +1 -1
  43. package/dist/gateway/static/root/assets/chat-page-D92AWJbh.js +72 -0
  44. package/dist/gateway/static/root/assets/{chat-terminal-dock-Dl-OTkJI.js → chat-terminal-dock-DjFnElAM.js} +2 -2
  45. package/dist/gateway/static/root/assets/composer-payload-handoff-BQXlFKf4.js +1 -0
  46. package/dist/gateway/static/root/assets/{computer-settings-page-B-lGMimW.js → computer-settings-page-MkqyKyf3.js} +1 -1
  47. package/dist/gateway/static/root/assets/confirm-dialog-D7dQJytv.js +1 -0
  48. package/dist/gateway/static/root/assets/connected-providers-grid-BSvKP2u-.js +1 -0
  49. package/dist/gateway/static/root/assets/{connector-service-page-C8InhrMt.js → connector-service-page-DlIl9bLx.js} +1 -1
  50. package/dist/gateway/static/root/assets/connectors-page-Vx8-MY0Y.js +1 -0
  51. package/dist/gateway/static/root/assets/{copy-text-row-CYIv7RfP.js → copy-text-row-CpiRzq4G.js} +1 -1
  52. package/dist/gateway/static/root/assets/{date-picker-kqic8j73.js → date-picker-BIfjfOTM.js} +1 -1
  53. package/dist/gateway/static/root/assets/dependency-picker-XjPB8FJS.js +1 -0
  54. package/dist/gateway/static/root/assets/{desktop-pet-settings-BDS7_tQ_.js → desktop-pet-settings-BDjsFown.js} +1 -1
  55. package/dist/gateway/static/root/assets/device-pairing-wizard-DH_uJ698.js +1 -0
  56. package/dist/gateway/static/root/assets/{directory-picker-path-field-Di0h3ws4.js → directory-picker-path-field-DiZXY7jF.js} +1 -1
  57. package/dist/gateway/static/root/assets/{discussion-annotation-sync-ClKEyXmN.js → discussion-annotation-sync-BXqNuZnx.js} +1 -1
  58. package/dist/gateway/static/root/assets/dist-BGTk37IG.js +1 -0
  59. package/dist/gateway/static/root/assets/dist-BuHnPloF.js +1 -0
  60. package/dist/gateway/static/root/assets/dist-GJ8-1PAx.js +1 -0
  61. package/dist/gateway/static/root/assets/dist-ZrL34Ps4.js +1 -0
  62. package/dist/gateway/static/root/assets/{extension-debug-page-DwB5KMGk.js → extension-debug-page-myQqsol2.js} +1 -1
  63. package/dist/gateway/static/root/assets/{extension-iframe-host-Cqg1K70e.js → extension-iframe-host-DaL-OcTw.js} +1 -1
  64. package/dist/gateway/static/root/assets/{extension-page-DyrQtG82.js → extension-page-DvlGhZLa.js} +1 -1
  65. package/dist/gateway/static/root/assets/{extension-provider-C_uKqJxP.js → extension-provider-fOi6V6Cr.js} +1 -1
  66. package/dist/gateway/static/root/assets/{extension-settings-page-BAMQHzkX.js → extension-settings-page-DOGlQpkx.js} +1 -1
  67. package/dist/gateway/static/root/assets/{gateway-settings-uAboiElC.js → gateway-settings-Di41peSM.js} +1 -1
  68. package/dist/gateway/static/root/assets/home-page-B3sgqrl3.js +2 -0
  69. package/dist/gateway/static/root/assets/{image-generation-api-CQxZSTWA.js → image-generation-api-Ce-IY7Ug.js} +1 -1
  70. package/dist/gateway/static/root/assets/{imports-page-C90644id.js → imports-page-W7_cDbxy.js} +1 -1
  71. package/dist/gateway/static/root/assets/index-D4B6O8B3.js +11 -0
  72. package/dist/gateway/static/root/assets/index-DGWBJDAM.css +1 -0
  73. package/dist/gateway/static/root/assets/install-connector-dialog-DWVl9ekV.js +1 -0
  74. package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-CbeubKe1.js → keyboard-shortcuts-settings-Doyu0Q9e.js} +1 -1
  75. package/dist/gateway/static/root/assets/link-2-D_ZKYUW7.js +1 -0
  76. package/dist/gateway/static/root/assets/local-app-workbench-page-B3h3P6aI.js +1 -0
  77. package/dist/gateway/static/root/assets/{local-apps-page-C6zFgwkr.js → local-apps-page-D6D2bZGW.js} +1 -1
  78. package/dist/gateway/static/root/assets/{logs-page-CpVCvAWE.js → logs-page-qiXos_12.js} +2 -2
  79. package/dist/gateway/static/root/assets/management-settings-C0WcSdK7.js +1 -0
  80. package/dist/gateway/static/root/assets/{markdown-view-DrVAMlwc.js → markdown-view-Ck5s16p9.js} +2 -2
  81. package/dist/gateway/static/root/assets/mcp-conversation-setup-page-CENs3hGU.js +1 -0
  82. package/dist/gateway/static/root/assets/model-selector-DCBmsHzj.js +1 -0
  83. package/dist/gateway/static/root/assets/note-detail-panel-CnuxqWMd.js +5 -0
  84. package/dist/gateway/static/root/assets/note-image-lightbox-BFKZ7qJr.js +1 -0
  85. package/dist/gateway/static/root/assets/{notes-api-CUlhTRv0.js → notes-api-8kp0X1x6.js} +1 -1
  86. package/dist/gateway/static/root/assets/{notes-page-eoKX85K5.js → notes-page-XMdy-H3H.js} +1 -1
  87. package/dist/gateway/static/root/assets/{oauth-provider-connect-C8BXow79.js → oauth-provider-connect-CfOK8mPM.js} +1 -1
  88. package/dist/gateway/static/root/assets/{page-context-capture-button-CBFK41OS.js → page-context-capture-button-CKlKWSJ7.js} +1 -1
  89. package/dist/gateway/static/root/assets/personal-page-CIMMSI25.js +1 -0
  90. package/dist/gateway/static/root/assets/{personal-settings-panel-DnYapLo7.js → personal-settings-panel-wKdlrfPq.js} +1 -1
  91. package/dist/gateway/static/root/assets/{phone-dependencies-card-DBiKtzwz.js → phone-dependencies-card-CDhk5277.js} +1 -1
  92. package/dist/gateway/static/root/assets/phone-model-connection-DZ-ZunPz.js +1 -0
  93. package/dist/gateway/static/root/assets/{phone-model-picker-BmSxEr7M.js → phone-model-picker-DuZc5jYO.js} +1 -1
  94. package/dist/gateway/static/root/assets/phone-settings-page-0u0GQl_R.js +1 -0
  95. package/dist/gateway/static/root/assets/plugin-details-dialog-Bfc-Wmrd.js +1 -0
  96. package/dist/gateway/static/root/assets/{popover-select-DD8fmrxH.js → popover-select-CEMWIrtY.js} +1 -1
  97. package/dist/gateway/static/root/assets/{preference-select-fields-Cu_ZC9Up.js → preference-select-fields-BKeHZLXZ.js} +1 -1
  98. package/dist/gateway/static/root/assets/{product-automation-feedback-Tn2dUJWM.js → product-automation-feedback-BPur0vyo.js} +2 -2
  99. package/dist/gateway/static/root/assets/{product-open-page-Nf-Oqf1h.js → product-open-page-Bfd7R483.js} +1 -1
  100. package/dist/gateway/static/root/assets/{product-preview-content-D6NwUm3A.js → product-preview-content-Bnq68oVw.js} +1 -1
  101. package/dist/gateway/static/root/assets/{product-preview-modal-BfNcGgXA.js → product-preview-modal-BPmTeweh.js} +2 -2
  102. package/dist/gateway/static/root/assets/project-detail-page-D9nnyvrI.js +7 -0
  103. package/dist/gateway/static/root/assets/{project-understanding-B1BK7Ixi.js → project-understanding-DLvxAoTT.js} +1 -1
  104. package/dist/gateway/static/root/assets/projects-page-BGy1pw9a.js +1 -0
  105. package/dist/gateway/static/root/assets/{recording-upload-RAhaLUcQ.js → recording-upload-CHFJbqW1.js} +1 -1
  106. package/dist/gateway/static/root/assets/{refresh-button-bU_0NarN.js → refresh-button-DiWdGAaX.js} +1 -1
  107. package/dist/gateway/static/root/assets/{remote-access-hub-DWsOWetc.js → remote-access-hub-BVqwnOqO.js} +1 -1
  108. package/dist/gateway/static/root/assets/route-preload-DI43HQV_.js +2 -0
  109. package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-BGiXeHF5.js → runtime-tools-settings-panel-ccVBG-bZ.js} +1 -1
  110. package/dist/gateway/static/root/assets/{schema-form-BKeP5G7b.js → schema-form-C-jw6Hid.js} +1 -1
  111. package/dist/gateway/static/root/assets/{secret-input-BQvFXqzz.js → secret-input-Dryrns2s.js} +1 -1
  112. package/dist/gateway/static/root/assets/{service-recommendation-list-BEnNx0u7.js → service-recommendation-list-CNghOavt.js} +1 -1
  113. package/dist/gateway/static/root/assets/session-manager-Bnq3qpqy.js +23 -0
  114. package/dist/gateway/static/root/assets/sessions-page-CyBj1Xw2.js +1 -0
  115. package/dist/gateway/static/root/assets/{settings-advanced-section-CURRjsLK.js → settings-advanced-section-DwpPPxT0.js} +1 -1
  116. package/dist/gateway/static/root/assets/{settings-page-GtsbT6as.js → settings-page-Cd8Ermnn.js} +1 -1
  117. package/dist/gateway/static/root/assets/{settings-page-header-DBL0_u0Z.js → settings-page-header-BZl4AMiN.js} +1 -1
  118. package/dist/gateway/static/root/assets/{settings-page-layout-IAvpbz4A.js → settings-page-layout-onhEgq-K.js} +1 -1
  119. package/dist/gateway/static/root/assets/setup-interaction-page-Cvvj6JyV.js +1 -0
  120. package/dist/gateway/static/root/assets/setup-status-panel-D4qgE7QM.js +1 -0
  121. package/dist/gateway/static/root/assets/share-link-dialog-DA0QuFOD.js +1 -0
  122. package/dist/gateway/static/root/assets/{share-preview-page-L9KYu8M7.js → share-preview-page-YDpIY4dC.js} +1 -1
  123. package/dist/gateway/static/root/assets/shares-settings-DUvjOMmA.js +1 -0
  124. package/dist/gateway/static/root/assets/skills-page-ClyNSh-7.js +2 -0
  125. package/dist/gateway/static/root/assets/{system-settings-panel-CsvcFoaJ.js → system-settings-panel-BN6sUX0H.js} +1 -1
  126. package/dist/gateway/static/root/assets/task-detail-page-CS9m7Ipo.js +2 -0
  127. package/dist/gateway/static/root/assets/{task-result-evidence-B8xUiwW3.js → task-result-evidence-DKygspo2.js} +1 -1
  128. package/dist/gateway/static/root/assets/tracing-settings-page-Bs76WeoF.js +1 -0
  129. package/dist/gateway/static/root/assets/{tunnel-api-BB7u79ID.js → tunnel-api-B7nx0NQJ.js} +1 -1
  130. package/dist/gateway/static/root/assets/{usage-page-Cv4Je5XJ.js → usage-page-anU5gslJ.js} +1 -1
  131. package/dist/gateway/static/root/assets/use-composer-attachments-DYY3Yz4a.js +2 -0
  132. package/dist/gateway/static/root/assets/use-file-preview-expanded-CYgWzDnv.js +2 -0
  133. package/dist/gateway/static/root/assets/{use-workspace-tree-BQEiJzK7.js → use-workspace-tree-Dkg9tUr4.js} +1 -1
  134. package/dist/gateway/static/root/assets/user-model-page-DIgPL3tN.js +2 -0
  135. package/dist/gateway/static/root/assets/{voice-api-key-field-DCM69u8Y.js → voice-api-key-field-BUes-Jlp.js} +1 -1
  136. package/dist/gateway/static/root/assets/voice-transcribe-api-Dy4hfftb.js +1 -0
  137. package/dist/gateway/static/root/assets/{work-discovery-overlay-CVe9UmFl.js → work-discovery-overlay-CFF4cRFl.js} +1 -1
  138. package/dist/gateway/static/root/assets/{work-discovery-page-CtqkRMN5.js → work-discovery-page-BnYaVH3V.js} +1 -1
  139. package/dist/gateway/static/root/assets/working-directory-picker-modal-GFwVefVA.js +1 -0
  140. package/dist/gateway/static/root/assets/{workspace-api-tbifz2zY.js → workspace-api-BdB4NEOh.js} +2 -2
  141. package/dist/gateway/static/root/assets/{workspace-file-preview-dialog-BubQwQwU.js → workspace-file-preview-dialog-NRL3YRjg.js} +1 -1
  142. package/dist/gateway/static/root/assets/{workspace-open-location-menu-DZk3MBSa.js → workspace-open-location-menu-Dcij7wvJ.js} +1 -1
  143. package/dist/gateway/static/root/assets/{xopc-cloud-account-card-CIavPUr3.js → xopc-cloud-account-card-DC9aG7Pl.js} +1 -1
  144. package/dist/gateway/static/root/index.html +66 -64
  145. package/dist/package.js +1 -1
  146. package/dist/packages/gateway-contract/src/automations.js +7 -0
  147. package/dist/packages/gateway-contract/src/capabilities.js +1 -1
  148. package/dist/src/agent/agent-manager.d.ts +1 -0
  149. package/dist/src/agent/agent-manager.js +1 -0
  150. package/dist/src/agent/child-agent-factory.js +1 -1
  151. package/dist/src/agent/data-acquisition/service.js +1 -1
  152. package/dist/src/agent/embedded/configuration-capability-correction.d.ts +3 -0
  153. package/dist/src/agent/embedded/configuration-capability-correction.js +14 -0
  154. package/dist/src/agent/embedded/run-for-session.js +20 -5
  155. package/dist/src/agent/embedded/run-turn.js +13 -1
  156. package/dist/src/agent/embedded/session-runner.js +6 -3
  157. package/dist/src/agent/image/generation/openai-images-provider.js +1 -1
  158. package/dist/src/agent/image/load-image-media.js +1 -1
  159. package/dist/src/agent/inbound/inbound-loop.js +4 -1
  160. package/dist/src/agent/independent-execution.js +1 -1
  161. package/dist/src/agent/mcp/config.js +1 -1
  162. package/dist/src/agent/mcp/connection-drafts.d.ts +3 -1
  163. package/dist/src/agent/mcp/connection-drafts.js +3 -2
  164. package/dist/src/agent/mcp/connection-setup.js +34 -2
  165. package/dist/src/agent/mcp/conversation-setup.d.ts +163 -0
  166. package/dist/src/agent/mcp/conversation-setup.js +621 -0
  167. package/dist/src/agent/mcp/native-mcp.d.ts +1 -0
  168. package/dist/src/agent/mcp/tool-catalog.d.ts +5 -0
  169. package/dist/src/agent/mcp/tool-catalog.js +19 -2
  170. package/dist/src/agent/mcp/weixin-setup-scope.d.ts +12 -0
  171. package/dist/src/agent/mcp/weixin-setup-scope.js +43 -0
  172. package/dist/src/agent/prompt/conversational-configuration-guide.js +2 -1
  173. package/dist/src/agent/prompt/sections/tooling.js +3 -2
  174. package/dist/src/agent/prompt/service-prompt-builder.js +1 -1
  175. package/dist/src/agent/service/direct-turn-helpers.js +1 -1
  176. package/dist/src/agent/service/process-direct-streaming.js +2 -2
  177. package/dist/src/agent/service.d.ts +2 -0
  178. package/dist/src/agent/service.js +11 -1
  179. package/dist/src/agent/service.types.d.ts +1 -0
  180. package/dist/src/agent/tasks/task-judge-service.js +2 -2
  181. package/dist/src/agent/tool-manuals/xopc-configuration.d.ts +6 -4
  182. package/dist/src/agent/tool-manuals/xopc-configuration.js +92 -8
  183. package/dist/src/agent/tools/automation-tool.d.ts +9 -1
  184. package/dist/src/agent/tools/automation-tool.js +34 -5
  185. package/dist/src/agent/tools/create-share-tool.js +1 -1
  186. package/dist/src/agent/tools/factory.d.ts +3 -0
  187. package/dist/src/agent/tools/factory.js +34 -23
  188. package/dist/src/agent/tools/image-generate-tool.js +3 -3
  189. package/dist/src/agent/tools/index.d.ts +1 -0
  190. package/dist/src/agent/tools/index.js +5 -4
  191. package/dist/src/agent/tools/mcp-setup-tool.d.ts +9 -0
  192. package/dist/src/agent/tools/mcp-setup-tool.js +32 -0
  193. package/dist/src/agent/tools/personal-task-tool.js +2 -2
  194. package/dist/src/agent/tools/publish-artifacts.js +1 -1
  195. package/dist/src/agent/tools/read.js +1 -1
  196. package/dist/src/agent/tools/skill-install-tool.js +56 -1
  197. package/dist/src/agent/tools/skill-manage-tool.d.ts +4 -0
  198. package/dist/src/agent/tools/skill-manage-tool.js +74 -2
  199. package/dist/src/agent/tools/skills-tools.js +1 -1
  200. package/dist/src/agent/tools/task-collaboration-tool.js +1 -1
  201. package/dist/src/agent/tools/tool-manual-tool.d.ts +1 -1
  202. package/dist/src/agent/tools/tool-manual-tool.js +3 -1
  203. package/dist/src/agent/tools/toolExposure.js +2 -0
  204. package/dist/src/agent/tools/write.js +1 -1
  205. package/dist/src/agent/tools/xopc-use-tool.d.ts +4 -2
  206. package/dist/src/agent/tools/xopc-use-tool.js +60 -10
  207. package/dist/src/agent-catalog/service.d.ts +1 -1
  208. package/dist/src/agent-catalog/service.js +2 -1
  209. package/dist/src/automations/capabilities/drafts.js +5 -2
  210. package/dist/src/automations/capabilities/read.js +18 -7
  211. package/dist/src/automations/capabilities/write.d.ts +111 -52
  212. package/dist/src/automations/capabilities/write.js +44 -10
  213. package/dist/src/automations/delivery/delivery-router.d.ts +1 -0
  214. package/dist/src/automations/delivery/delivery-router.js +7 -1
  215. package/dist/src/automations/domain/types.d.ts +8 -0
  216. package/dist/src/automations/domain/validation.d.ts +24 -0
  217. package/dist/src/automations/domain/validation.js +7 -0
  218. package/dist/src/automations/draft/automation-draft-validator.d.ts +6 -0
  219. package/dist/src/automations/index.js +2 -2
  220. package/dist/src/automations/mcp-source.d.ts +60 -0
  221. package/dist/src/automations/mcp-source.js +173 -0
  222. package/dist/src/automations/service/action-executor.js +15 -1
  223. package/dist/src/automations/service/automation-service.d.ts +5 -0
  224. package/dist/src/automations/service/automation-service.js +52 -2
  225. package/dist/src/automations/service/index.js +2 -2
  226. package/dist/src/browser/setup/repository.d.ts +1 -0
  227. package/dist/src/browser/setup/repository.js +7 -1
  228. package/dist/src/browser/setup/service.d.ts +3 -0
  229. package/dist/src/browser/setup/service.js +41 -18
  230. package/dist/src/browser/setup/types.d.ts +1 -0
  231. package/dist/src/channels/attachments/voice-stt-webchat.js +1 -1
  232. package/dist/src/channels/index.js +1 -1
  233. package/dist/src/channels/manager.d.ts +1 -0
  234. package/dist/src/channels/outbound-sender.d.ts +1 -0
  235. package/dist/src/channels/outbound-sender.js +3 -0
  236. package/dist/src/channels/pairing/pairing-service.js +1 -1
  237. package/dist/src/channels/weixin/account-identity.d.ts +2 -0
  238. package/dist/src/channels/weixin/account-identity.js +15 -0
  239. package/dist/src/chat-commands/builtins/config.js +1 -1
  240. package/dist/src/cli/commands/channels.js +2 -2
  241. package/dist/src/cli/commands/doctor/checks/channel-pairing-pending.js +1 -1
  242. package/dist/src/cli/commands/mcp.js +1 -1
  243. package/dist/src/extensions/agent-plugins/credentials.js +1 -1
  244. package/dist/src/extensions/agent-plugins/setup.d.ts +1 -1
  245. package/dist/src/extensions/agent-plugins/setup.js +3 -3
  246. package/dist/src/extensions/api.js +1 -1
  247. package/dist/src/gateway/agent-builtin-tools.d.ts +1 -1
  248. package/dist/src/gateway/agents-admin.js +1 -1
  249. package/dist/src/gateway/device-routes.js +1 -1
  250. package/dist/src/gateway/hono/app.js +1 -1
  251. package/dist/src/gateway/hono/lib/config-payload.js +1 -1
  252. package/dist/src/gateway/hono/oauth-async.js +1 -1
  253. package/dist/src/gateway/hono/routes/channels.js +1 -1
  254. package/dist/src/gateway/hono/routes/config.js +1 -1
  255. package/dist/src/gateway/hono/routes/lazy-bundles.js +1 -1
  256. package/dist/src/gateway/hono/routes/mcp.js +39 -2
  257. package/dist/src/gateway/hono/routes/notes.js +2 -2
  258. package/dist/src/gateway/hono/routes/phone-setup.js +33 -9
  259. package/dist/src/gateway/hono/routes/projects.js +1 -1
  260. package/dist/src/gateway/hono/routes/provider-setup.js +1 -1
  261. package/dist/src/gateway/hono/routes/public-gateway.js +22 -0
  262. package/dist/src/gateway/hono/routes/session-input-handler.js +1 -1
  263. package/dist/src/gateway/hono/routes/shares.js +1 -1
  264. package/dist/src/gateway/hono/routes/site-shares.js +1 -1
  265. package/dist/src/gateway/hono/routes/tasks.js +1 -1
  266. package/dist/src/gateway/media-access.js +1 -1
  267. package/dist/src/gateway/service/agent-runner.d.ts +1 -0
  268. package/dist/src/gateway/service/agent-runner.js +3 -1
  269. package/dist/src/gateway/service/config-coordinator.d.ts +1 -1
  270. package/dist/src/gateway/service/config-coordinator.js +2 -1
  271. package/dist/src/gateway/service/run-gateway-agent.js +1 -1
  272. package/dist/src/gateway/service/sessions-api.js +2 -1
  273. package/dist/src/gateway/service.d.ts +5 -1
  274. package/dist/src/gateway/service.js +90 -16
  275. package/dist/src/gateway/session-context-summary.js +1 -1
  276. package/dist/src/gateway/session-reset-service.d.ts +1 -0
  277. package/dist/src/gateway/session-reset-service.js +15 -2
  278. package/dist/src/home-intelligence/host.js +2 -2
  279. package/dist/src/notes/service.js +1 -1
  280. package/dist/src/personal-agent/prompts.js +1 -1
  281. package/dist/src/personal-agent/reply-composer.js +2 -2
  282. package/dist/src/personal-agent/request-service.js +3 -3
  283. package/dist/src/personal-agent/service.js +1 -1
  284. package/dist/src/personal-agent/task-cancel.js +1 -1
  285. package/dist/src/phone/setup/service.d.ts +14 -4
  286. package/dist/src/phone/setup/service.js +106 -28
  287. package/dist/src/projects/index.js +1 -1
  288. package/dist/src/projects/project-service.js +1 -1
  289. package/dist/src/runtime-tools/phone-dependencies.d.ts +2 -0
  290. package/dist/src/runtime-tools/phone-dependencies.js +10 -0
  291. package/dist/src/share/note-share-service.js +1 -1
  292. package/dist/src/share/site-proxy.js +1 -1
  293. package/dist/src/tasks/capabilities/write.js +1 -1
  294. package/dist/src/tasks/index.js +1 -1
  295. package/dist/src/tasks/task-allocation-service.js +3 -3
  296. package/dist/src/tasks/task-application-service.js +2 -2
  297. package/dist/src/tasks/task-context-assembler.js +1 -1
  298. package/dist/src/tasks/task-contract-planner.js +1 -1
  299. package/dist/src/tasks/task-handoff.js +1 -1
  300. package/dist/src/tasks/task-research-result.js +1 -1
  301. package/dist/src/tasks/task-run-coordinator.js +2 -2
  302. package/dist/src/tui/backends/embedded-backend.js +1 -1
  303. package/package.json +3 -1
  304. package/skills/tools/configure-xopc/SKILL.md +10 -3
  305. package/skills/tools/configure-xopc/references/browser/chrome-extension.md +4 -1
  306. package/skills/tools/configure-xopc/references/browser/overview.md +2 -2
  307. package/skills/tools/configure-xopc/references/phone/aliyun.md +3 -2
  308. package/skills/tools/configure-xopc/references/phone/overview.md +2 -2
  309. package/dist/gateway/static/root/assets/agent-defaults-settings-panel-Dne9A10p.js +0 -1
  310. package/dist/gateway/static/root/assets/agent-plugin-dialog-BoHL-b1o.js +0 -1
  311. package/dist/gateway/static/root/assets/agents-CIiIlVBp.js +0 -77
  312. package/dist/gateway/static/root/assets/app-link-1j40sJ-z.js +0 -1
  313. package/dist/gateway/static/root/assets/apps-page-vgS1CHDj.js +0 -1
  314. package/dist/gateway/static/root/assets/attachment-load-qjPpQzYY.js +0 -1
  315. package/dist/gateway/static/root/assets/automation-task-card-MnzgyTVA.js +0 -3
  316. package/dist/gateway/static/root/assets/automations-workspace-C3xZLafX.js +0 -9
  317. package/dist/gateway/static/root/assets/browser-settings-page-BD1uF_Nb.js +0 -3
  318. package/dist/gateway/static/root/assets/capabilities-BGE6hiUE.js +0 -1
  319. package/dist/gateway/static/root/assets/capabilities-page-Bda4mSdf.js +0 -2
  320. package/dist/gateway/static/root/assets/capabilities-settings-panel-B2B7no22.js +0 -8
  321. package/dist/gateway/static/root/assets/channels-NtsjZThx.js +0 -1
  322. package/dist/gateway/static/root/assets/chat-page-BnOCCAXG.js +0 -72
  323. package/dist/gateway/static/root/assets/composer-payload-handoff-CQc-VTaL.js +0 -1
  324. package/dist/gateway/static/root/assets/confirm-dialog-XGclfBqe.js +0 -1
  325. package/dist/gateway/static/root/assets/connected-providers-grid-CcXe9kz5.js +0 -1
  326. package/dist/gateway/static/root/assets/connectors-page-Ci0L2How.js +0 -1
  327. package/dist/gateway/static/root/assets/dependency-picker-cbC6-2Ya.js +0 -1
  328. package/dist/gateway/static/root/assets/device-pairing-wizard-_3BJFWVQ.js +0 -1
  329. package/dist/gateway/static/root/assets/dist-CaUuvp8-.js +0 -1
  330. package/dist/gateway/static/root/assets/dist-D3lWNSe7.js +0 -1
  331. package/dist/gateway/static/root/assets/dist-DfWfZ9iu.js +0 -1
  332. package/dist/gateway/static/root/assets/dist-DusecO_p.js +0 -1
  333. package/dist/gateway/static/root/assets/home-page-D6pCBY1V.js +0 -2
  334. package/dist/gateway/static/root/assets/index-Cc41XQid.css +0 -1
  335. package/dist/gateway/static/root/assets/index-CnOYR6jq.js +0 -11
  336. package/dist/gateway/static/root/assets/install-connector-dialog-BuNXON0P.js +0 -1
  337. package/dist/gateway/static/root/assets/local-app-workbench-page-CP-BkbB6.js +0 -1
  338. package/dist/gateway/static/root/assets/management-settings-I-pXv4ML.js +0 -1
  339. package/dist/gateway/static/root/assets/model-selector-CXcxc30J.js +0 -1
  340. package/dist/gateway/static/root/assets/note-detail-panel-CbpLXAVh.js +0 -5
  341. package/dist/gateway/static/root/assets/note-image-lightbox-cLGiF8oU.js +0 -1
  342. package/dist/gateway/static/root/assets/personal-page-CXR1Gy0x.js +0 -1
  343. package/dist/gateway/static/root/assets/phone-settings-page-vg65qilc.js +0 -1
  344. package/dist/gateway/static/root/assets/plugin-details-dialog-B3Hn2cbx.js +0 -1
  345. package/dist/gateway/static/root/assets/project-detail-page-Ch-ZMyTu.js +0 -7
  346. package/dist/gateway/static/root/assets/projects-page-B7cetxao.js +0 -1
  347. package/dist/gateway/static/root/assets/route-preload-Zc5Z3fNv.js +0 -2
  348. package/dist/gateway/static/root/assets/session-manager-ChUtTAoG.js +0 -23
  349. package/dist/gateway/static/root/assets/sessions-page-Bt52kBvJ.js +0 -1
  350. package/dist/gateway/static/root/assets/setup-status-panel-A6uMpGRy.js +0 -1
  351. package/dist/gateway/static/root/assets/share-link-dialog-D1otGSXD.js +0 -1
  352. package/dist/gateway/static/root/assets/shares-settings-Bmfadz8A.js +0 -1
  353. package/dist/gateway/static/root/assets/skills-page-BZklXTX9.js +0 -2
  354. package/dist/gateway/static/root/assets/task-detail-page-SjZGW1Dx.js +0 -2
  355. package/dist/gateway/static/root/assets/tracing-settings-page-MvG4SH64.js +0 -1
  356. package/dist/gateway/static/root/assets/use-composer-attachments-vDdxHtUb.js +0 -2
  357. package/dist/gateway/static/root/assets/use-file-preview-expanded-Ce2mgYme.js +0 -2
  358. package/dist/gateway/static/root/assets/user-model-page-DRSsn4EV.js +0 -2
  359. package/dist/gateway/static/root/assets/voice-transcribe-api-Bbyj0yGR.js +0 -1
  360. package/dist/gateway/static/root/assets/working-directory-picker-modal-CDZ1xh3o.js +0 -1
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/workspace-file-preview-dialog-BubQwQwU.js","assets/rolldown-runtime-aKtaBQYM.js","assets/vendor-react-BOUWij0V.js","assets/locale-store-Br7IfbXK.js","assets/messages-ByFlEbsu.js","assets/use-file-preview-expanded-Ce2mgYme.js","assets/preload-helper-Czpn1I53.js","assets/chunk-KS7C4IRE-CiwuuyV8.js","assets/createLucideIcon-DPHK1VkS.js","assets/app-window-DXFNqt_0.js","assets/check-DUBLcKHA.js","assets/chevron-down-ccbiQQz_.js","assets/copy-Dv6d4Dvw.js","assets/download-Dk-ZjtO6.js","assets/ellipsis-0k4rZLoy.js","assets/external-link-DjqjBmc3.js","assets/eye-CABVeTq0.js","assets/folder-open-CyzJ19I9.js","assets/loader-circle-CifKLtgG.js","assets/markdown-view-DrVAMlwc.js","assets/file-image-CDUPkZvG.js","assets/plus-Q2yW6OE7.js","assets/x-B_N4OPjy.js","assets/cn-0WouolD0.js","assets/bundle-mjs-rHxsej31.js","assets/dist-DfWfZ9iu.js","assets/dist-CxGUk8J-.js","assets/es2015-DBLcMg5B.js","assets/app-link-1j40sJ-z.js","assets/product-delivery-DRyD9_Xq.js","assets/schemas-CCWMleym.js","assets/local-apps-Ck6kACsY.js","assets/copy-to-clipboard-HOJ79TWv.js","assets/xml-_d7dTN2Q.js","assets/mermaid-render-oOellPHt.js","assets/markdown-view-C-DHb3Io.css","assets/message-square-plus-XP0tGdlV.js","assets/minimize-2-DtOGrlpo.js","assets/paperclip-f1HujQY1.js","assets/pencil-DmIY3Oa-.js","assets/refresh-cw-BRlGaq2w.js","assets/rotate-cw-LIg3Am9S.js","assets/save-DRDABU--.js","assets/search-DA7gz22f.js","assets/skeleton-BI5TyibZ.js","assets/constants-DBtMsXdW.js","assets/session-api-Bs3r_d2_.js","assets/gateway-startup-retry-CvkJYurV.js","assets/interaction-BdhHBbYa.js","assets/activity-store-D_DXNHba.js","assets/attachment-utils-core-BIOUBrpT.js","assets/app-chrome-BeB4KgOf.js","assets/electron-env-DHOGevH3.js","assets/use-async-resource-BHFGZCY2.js","assets/sliding-tab-list-DuQyViqe.js","assets/sliding-indicator-hwz0sx3h.js","assets/index.module-Cd9ENXfk.js","assets/workspace-api-tbifz2zY.js","assets/files-BNL4kkSB.js","assets/dist-D3lWNSe7.js","assets/dist-DusecO_p.js","assets/floating-ui.dom-seOukHzT.js","assets/share-link-dialog-D1otGSXD.js","assets/popover-select-DD8fmrxH.js","assets/dist-CaUuvp8-.js","assets/settings-shell-dialog-layer-BU3UuiJr.js","assets/globe-DSSGFWFn.js","assets/button-CnRSIP6m.js","assets/copy-text-row-CYIv7RfP.js","assets/file-preview-surface-DfkXvFnc.js","assets/phone-workspace-store-SN7hfddU.js","assets/shares-api-D8Q-m46d.js","assets/theme-store-Dlnmgryi.js","assets/middleware-Pd0e8Igk.js"])))=>i.map(i=>d[i]);
2
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./preload-helper-Czpn1I53.js";import{l as a,m as o,t as s,u as c}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{n as l}from"./locale-store-Br7IfbXK.js";import{t as u}from"./messages-ByFlEbsu.js";import{t as d}from"./calendar-clock-D-quYVPe.js";import{t as f}from"./chevron-down-ccbiQQz_.js";import{t as p}from"./chevron-right-BweFrslA.js";import{t as m}from"./circle-alert-BEjgurr2.js";import{t as h}from"./circle-check-C23XjkUj.js";import{t as g}from"./clock-3-DnrAnuyZ.js";import{t as _}from"./external-link-DjqjBmc3.js";import{t as v}from"./history-DXH_9jsE.js";import{F as y,M as b}from"./markdown-view-DrVAMlwc.js";import{t as x}from"./message-circle-Badhj-4D.js";import{t as S}from"./paperclip-f1HujQY1.js";import{t as C}from"./plus-Q2yW6OE7.js";import{t as w}from"./refresh-cw-BRlGaq2w.js";import{t as T}from"./settings-2-D-csvaET.js";import{t as E}from"./sparkles-DHlfQFAF.js";import{t as D}from"./x-B_N4OPjy.js";import{t as O}from"./cn-0WouolD0.js";import{t as k}from"./button-CnRSIP6m.js";import{t as A}from"./skeleton-BI5TyibZ.js";import{a as j,i as M,n as N,o as P,r as F,s as I,t as L}from"./dist-DfWfZ9iu.js";import{a as R,i as z,o as B,s as V}from"./dist-CaUuvp8-.js";import{s as H}from"./tasks-DRmd6sWt.js";import{a as U,c as W,d as G,h as K,i as q,o as J,r as ee,t as te}from"./composer-payload-handoff-CQc-VTaL.js";import{C as ne,E as re,S as ie,_ as ae,a as oe,b as se,f as Y,g as ce,l as le,n as ue,t as de,u as fe,v as pe,w as me,x as he}from"./use-composer-attachments-vDdxHtUb.js";import{t as ge}from"./page-header-store-Du44NIEJ.js";import{t as _e}from"./sliding-tab-list-DuQyViqe.js";import{n as ve,r as ye}from"./voice-input-shortcut-events-DFMNIyy4.js";import{n as be}from"./date-formatters-DukWSVwc.js";import{n as xe}from"./tab-completion-input-CxtEp0aP.js";import{n as Se,r as X,t as Ce}from"./task-result-evidence-B8xUiwW3.js";var Z=n(),Q=e(t(),1);function we(e,t,n=!1){let[r,i]=(0,Q.useState)(null),[a,o]=(0,Q.useState)(!0),[s,c]=(0,Q.useState)(null),l=(0,Q.useRef)(0),u=(0,Q.useCallback)(async()=>{let t=++l.current;c(null);try{let r=await(n?ce(e,!0):ce(e));t===l.current&&i(r)}catch(e){t===l.current&&c(e instanceof Error?e.message:String(e))}finally{t===l.current&&o(!1)}},[e,n]);return(0,Q.useEffect)(()=>(u(),()=>{l.current++}),[u,t]),(0,Q.useEffect)(()=>{let e,t=1/0,n=n=>{let r=Date.now()+n;r>=t||(window.clearTimeout(e),t=r,e=window.setTimeout(()=>{e=void 0,t=1/0,u()},n))},r=()=>n(100),i=()=>n(750),a=()=>{document.visibilityState===`visible`&&r()},o=[`task-changed-v2`,`task-updated`,`session-created`,`agent-run-started`,`agent-run-ended`,`automation-run-completed`,`home-advisor-updated`,`gateway-realtime-connected`,`realtime-gap`,`focus`],s=[`session-updated`,`session-transcript-updated`];return o.forEach(e=>window.addEventListener(e,r)),s.forEach(e=>window.addEventListener(e,i)),document.addEventListener(`visibilitychange`,a),()=>{o.forEach(e=>window.removeEventListener(e,r)),s.forEach(e=>window.removeEventListener(e,i)),document.removeEventListener(`visibilitychange`,a),window.clearTimeout(e)}},[u]),{home:r,loading:a,loadError:s,setLoadError:c,load:u}}var $=r(),Te=12e3;function Ee(e){let t=(0,Z.c)(107),{variant:n,inputId:r,inputRef:i,intent:a,labels:o,attachments:s,isDragging:c,attachmentBusy:l,attachmentsFull:u,voice:d,chat:f,cancelAction:p,onIntentChange:m,onPickFiles:h,onRemoveAttachment:g,onPaste:_,onDragOver:v,onDragLeave:y,onDrop:b,onSubmit:x}=e,C=n===`inline`,w;t[0]!==s||t[1]!==a?(w=!!a.trim()||s.length>0,t[0]=s,t[1]=a,t[2]=w):w=t[2];let T=w,D=d.voiceActive&&d.phase!==`error`,A;t[3]!==x||t[4]!==d.voiceActive?(A=e=>{if(d.voiceActive){e.preventDefault();return}x(e)},t[3]=x,t[4]=d.voiceActive,t[5]=A):A=t[5];let j=C?`mx-auto mt-6 w-full overflow-hidden rounded-xl border border-edge bg-surface-base p-2 text-left shadow-surface transition-colors focus-within:border-accent focus-within:ring-2 focus-within:ring-accent/15 sm:mt-8`:`flex min-h-0 flex-1 flex-col`,M;t[6]===j?M=t[7]:(M=O(`relative`,j),t[6]=j,t[7]=M);let N;t[8]!==C||t[9]!==c||t[10]!==o.dropFiles?(N=c?(0,$.jsx)(`div`,{className:O(`pointer-events-none absolute inset-0 z-10 flex items-center justify-center bg-accent-soft/90 text-sm font-medium text-accent-fg backdrop-blur-[1px]`,C&&`rounded-2xl`),children:o.dropFiles}):null,t[8]=C,t[9]=c,t[10]=o.dropFiles,t[11]=N):N=t[11];let P=!C&&`flex min-h-0 flex-1 flex-col overflow-y-auto px-5 py-4`,F;t[12]===P?F=t[13]:(F=O(P),t[12]=P,t[13]=F);let I=C?`sr-only`:`mb-2 shrink-0 text-sm font-medium text-fg`,L;t[14]!==r||t[15]!==o.intentLabel||t[16]!==I?(L=(0,$.jsx)(`label`,{htmlFor:r,className:I,children:o.intentLabel}),t[14]=r,t[15]=o.intentLabel,t[16]=I,t[17]=L):L=t[17];let R;t[18]!==l||t[19]!==f||t[20]!==d.audioLevel||t[21]!==d.cancelVoiceInput||t[22]!==d.confirmVoiceInput||t[23]!==d.elapsedLabel||t[24]!==d.error||t[25]!==d.finalTranscript||t[26]!==d.partialTranscript||t[27]!==d.phase||t[28]!==d.recordedDictation||t[29]!==d.retryVoiceInput||t[30]!==d.settingsRequired||t[31]!==d.voiceActive?(R=d.voiceActive?(0,$.jsx)(ee,{phase:d.phase,elapsedLabel:d.elapsedLabel,recordedDictation:d.recordedDictation,audioLevel:d.audioLevel,partialTranscript:d.partialTranscript,finalTranscript:d.finalTranscript,error:d.error,settingsRequired:d.settingsRequired,disabled:l,chat:f,onCancel:d.cancelVoiceInput,onConfirm:d.confirmVoiceInput,onRetry:d.retryVoiceInput}):null,t[18]=l,t[19]=f,t[20]=d.audioLevel,t[21]=d.cancelVoiceInput,t[22]=d.confirmVoiceInput,t[23]=d.elapsedLabel,t[24]=d.error,t[25]=d.finalTranscript,t[26]=d.partialTranscript,t[27]=d.phase,t[28]=d.recordedDictation,t[29]=d.retryVoiceInput,t[30]=d.settingsRequired,t[31]=d.voiceActive,t[32]=R):R=t[32];let z=D&&`hidden`,B=C?`min-h-24 bg-transparent px-3 py-2`:`min-h-32 flex-1 rounded-xl border border-edge bg-surface-base p-3 focus:border-accent focus:ring-2 focus:ring-accent/20`,V;t[33]!==z||t[34]!==B?(V=O(`w-full resize-none text-sm font-normal leading-6 text-fg outline-none placeholder:text-fg-subtle`,z,B),t[33]=z,t[34]=B,t[35]=V):V=t[35];let H;t[36]===m?H=t[37]:(H=e=>m(e.target.value),t[36]=m,t[37]=H);let W=!C,G;t[38]!==r||t[39]!==i||t[40]!==a||t[41]!==o.intentPlaceholder||t[42]!==o.intentSuggestion||t[43]!==m||t[44]!==_||t[45]!==V||t[46]!==H||t[47]!==W?(G=(0,$.jsx)(xe,{ref:i,id:r,className:V,value:a,onChange:H,onPaste:_,suggestion:o.intentSuggestion,onAcceptSuggestion:m,onKeyDown:De,placeholder:o.intentPlaceholder,maxLength:Te,autoFocus:W}),t[38]=r,t[39]=i,t[40]=a,t[41]=o.intentPlaceholder,t[42]=o.intentSuggestion,t[43]=m,t[44]=_,t[45]=V,t[46]=H,t[47]=W,t[48]=G):G=t[48];let K=C?`border-b-0 bg-transparent px-3 pb-2 pt-0`:`mt-3 border-b-0 bg-transparent px-0 pb-0`,q;t[49]!==s||t[50]!==g||t[51]!==K?(q=(0,$.jsx)(ue,{attachments:s,topPadded:!1,onRemove:g,className:K}),t[49]=s,t[50]=g,t[51]=K,t[52]=q):q=t[52];let J;t[53]!==C||t[54]!==a.length||t[55]!==o.shortcut?(J=C?null:(0,$.jsxs)(`div`,{className:`mt-2 flex shrink-0 items-center justify-between gap-3 text-[11px] text-fg-subtle`,children:[(0,$.jsx)(`span`,{children:o.shortcut}),(0,$.jsxs)(`span`,{className:`tabular-nums`,children:[a.length.toLocaleString(),` / `,Te.toLocaleString()]})]}),t[53]=C,t[54]=a.length,t[55]=o.shortcut,t[56]=J):J=t[56];let te;t[57]!==R||t[58]!==G||t[59]!==q||t[60]!==J||t[61]!==F||t[62]!==L?(te=(0,$.jsxs)(`div`,{className:F,children:[L,R,G,q,J]}),t[57]=R,t[58]=G,t[59]=q,t[60]=J,t[61]=F,t[62]=L,t[63]=te):te=t[63];let ne=C?`border-edge-subtle px-1 pt-2`:`border-edge px-5 py-4`,re;t[64]===ne?re=t[65]:(re=O(`flex shrink-0 items-center gap-2 border-t`,ne),t[64]=ne,t[65]=re);let ie=!C&&`mr-auto`,ae;t[66]===ie?ae=t[67]:(ae=O(`flex items-center gap-1`,ie),t[66]=ie,t[67]=ae);let oe=l||u,se;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(se=(0,$.jsx)(S,{className:`size-4`,"aria-hidden":!0}),t[68]=se):se=t[68];let Y;t[69]!==o.attachTitle||t[70]!==h||t[71]!==oe?(Y=(0,$.jsx)(k,{type:`button`,variant:`ghost`,className:`size-9 rounded-lg p-0`,disabled:oe,title:o.attachTitle,"aria-label":o.attachTitle,onClick:h,children:se}),t[69]=o.attachTitle,t[70]=h,t[71]=oe,t[72]=Y):Y=t[72];let ce;t[73]!==l||t[74]!==f||t[75]!==d.startVoiceInput||t[76]!==d.voiceActive?(ce=d.voiceActive?null:(0,$.jsx)(U,{disabled:l,chat:f,onStart:d.startVoiceInput}),t[73]=l,t[74]=f,t[75]=d.startVoiceInput,t[76]=d.voiceActive,t[77]=ce):ce=t[77];let le;t[78]!==ae||t[79]!==Y||t[80]!==ce?(le=(0,$.jsxs)(`div`,{className:ae,children:[Y,ce]}),t[78]=ae,t[79]=Y,t[80]=ce,t[81]=le):le=t[81];let de;t[82]!==p||t[83]!==C||t[84]!==o.shortcut?(de=C?(0,$.jsx)(`span`,{className:`hidden text-[11px] text-fg-subtle sm:inline`,children:o.shortcut}):p,t[82]=p,t[83]=C,t[84]=o.shortcut,t[85]=de):de=t[85];let fe=C?`ml-auto h-9 rounded-lg px-3.5 text-xs`:`min-w-32`,pe=!T||l||d.voiceActive,me=C?`size-3.5`:`size-4`,he;t[86]===me?he=t[87]:(he=(0,$.jsx)(E,{className:me,"aria-hidden":!0}),t[86]=me,t[87]=he);let ge;t[88]!==o.submit||t[89]!==fe||t[90]!==pe||t[91]!==he?(ge=(0,$.jsxs)(k,{type:`submit`,variant:`primary`,className:fe,disabled:pe,children:[he,o.submit]}),t[88]=o.submit,t[89]=fe,t[90]=pe,t[91]=he,t[92]=ge):ge=t[92];let _e;t[93]!==re||t[94]!==le||t[95]!==de||t[96]!==ge?(_e=(0,$.jsxs)(`div`,{className:re,children:[le,de,ge]}),t[93]=re,t[94]=le,t[95]=de,t[96]=ge,t[97]=_e):_e=t[97];let ve;return t[98]!==y||t[99]!==v||t[100]!==b||t[101]!==A||t[102]!==te||t[103]!==_e||t[104]!==M||t[105]!==N?(ve=(0,$.jsxs)(`form`,{onSubmit:A,onDragOver:v,onDragLeave:y,onDrop:b,className:M,children:[N,te,_e]}),t[98]=y,t[99]=v,t[100]=b,t[101]=A,t[102]=te,t[103]=_e,t[104]=M,t[105]=N,t[106]=ve):ve=t[106],ve}function De(e){e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),e.currentTarget.form?.requestSubmit())}function Oe(e){let t=(0,Z.c)(12),{href:n,children:r,onOpen:i}=e,o=a();if(n&&/^https?:\/\//i.test(n)){let e;return t[0]!==r||t[1]!==n?(e=(0,$.jsx)(`a`,{href:n,target:`_blank`,rel:`noopener noreferrer`,className:`rounded-sm text-accent-fg hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:r}),t[0]=r,t[1]=n,t[2]=e):e=t[2],e}if(n?.startsWith(`/`)&&!n.startsWith(`//`)){let e=`${o.pathname}${o.search}`,a;t[3]!==n||t[4]!==e?(a=b(e,n),t[3]=n,t[4]=e,t[5]=a):a=t[5];let c;return t[6]!==r||t[7]!==i||t[8]!==a?(c=(0,$.jsx)(s,{to:a,className:`rounded-sm text-accent-fg hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,onClick:i,children:r}),t[6]=r,t[7]=i,t[8]=a,t[9]=c):c=t[9],c}let c;return t[10]===r?c=t[11]:(c=(0,$.jsx)(`span`,{children:r}),t[10]=r,t[11]=c),c}function ke(e){let t=(0,Z.c)(4),{label:n,onClick:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(v,{className:`size-3.5`,"aria-hidden":!0}),t[0]=i):i=t[0];let a;return t[1]!==n||t[2]!==r?(a=(0,$.jsxs)(`button`,{type:`button`,className:`inline-flex min-h-9 items-center gap-1.5 rounded-lg px-2 text-xs font-medium text-fg-muted transition-colors duration-150 hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,onClick:r,children:[i,n]}),t[1]=n,t[2]=r,t[3]=a):a=t[3],a}function Ae(e){let t=(0,Z.c)(65),{opportunity:n,copy:r,onOpenHistory:i}=e,a,o,s,c,l,u;if(t[0]!==r.aiLabel||t[1]!==r.automationAction||t[2]!==r.automationHint||t[3]!==r.history||t[4]!==r.minutes||t[5]!==r.needsSetup||t[6]!==r.why||t[7]!==i||t[8]!==n.capabilities||t[9]!==n.continuation||t[10]!==n.estimatedMinutes||t[11]!==n.outcome||t[12]!==n.rationale||t[13]!==n.title){let e=n.capabilities.filter(Me),d;t[20]===r.aiLabel?d=t[21]:(d=(0,$.jsx)(`span`,{children:r.aiLabel}),t[20]=r.aiLabel,t[21]=d);let f;t[22]!==r.minutes||t[23]!==n.estimatedMinutes?(f=n.estimatedMinutes?(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,$.jsx)(g,{className:`size-3.5`,"aria-hidden":!0}),n.estimatedMinutes,` `,r.minutes]}):null,t[22]=r.minutes,t[23]=n.estimatedMinutes,t[24]=f):f=t[24];let p;t[25]!==d||t[26]!==f?(p=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs text-fg-subtle`,children:[d,f]}),t[25]=d,t[26]=f,t[27]=p):p=t[27];let m;t[28]!==r.history||t[29]!==i?(m=(0,$.jsx)(ke,{label:r.history,onClick:i}),t[28]=r.history,t[29]=i,t[30]=m):m=t[30],t[31]!==m||t[32]!==p?(a=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[p,m]}),t[31]=m,t[32]=p,t[33]=a):a=t[33],t[34]===n.title?o=t[35]:(o=(0,$.jsx)(`h3`,{className:`mt-3 text-xl font-semibold leading-7 tracking-tight text-fg`,children:n.title}),t[34]=n.title,t[35]=o),t[36]===n.outcome?s=t[37]:(s=(0,$.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:n.outcome}),t[36]=n.outcome,t[37]=s);let h;t[38]===r.why?h=t[39]:(h=(0,$.jsxs)(`span`,{className:`font-medium text-fg`,children:[r.why,`:`]}),t[38]=r.why,t[39]=h),t[40]!==n.rationale||t[41]!==h?(c=(0,$.jsxs)(`p`,{className:`mt-4 text-sm leading-6 text-fg-muted`,children:[h,n.rationale]}),t[40]=n.rationale,t[41]=h,t[42]=c):c=t[42],t[43]!==r.automationAction||t[44]!==r.automationHint||t[45]!==n.continuation?(l=n.continuation?.kind===`automation`?(0,$.jsxs)(`div`,{className:`mt-4 flex flex-col gap-3 rounded-xl border border-edge bg-surface-subtle p-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,$.jsx)(`p`,{className:`text-xs leading-5 text-fg-muted`,children:r.automationHint}),(0,$.jsx)(`a`,{href:`#${n.continuation.href}`,className:`inline-flex min-h-11 shrink-0 items-center rounded-lg px-3 text-xs font-medium text-accent hover:bg-accent-soft focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:r.automationAction})]}):null,t[43]=r.automationAction,t[44]=r.automationHint,t[45]=n.continuation,t[46]=l):l=t[46],u=e.length>0?(0,$.jsx)(`div`,{className:`mt-4 flex flex-wrap gap-2`,"aria-label":r.needsSetup,children:e.map(e=>(0,$.jsxs)(`a`,{href:`#${e.recoveryPath??`/settings`}`,className:`rounded-full border border-accent/25 bg-accent-soft px-2.5 py-1 text-xs text-accent hover:border-accent/50`,children:[r.needsSetup,` · `,e.capability]},`${e.kind}:${e.capability}`))}):null,t[0]=r.aiLabel,t[1]=r.automationAction,t[2]=r.automationHint,t[3]=r.history,t[4]=r.minutes,t[5]=r.needsSetup,t[6]=r.why,t[7]=i,t[8]=n.capabilities,t[9]=n.continuation,t[10]=n.estimatedMinutes,t[11]=n.outcome,t[12]=n.rationale,t[13]=n.title,t[14]=a,t[15]=o,t[16]=s,t[17]=c,t[18]=l,t[19]=u}else a=t[14],o=t[15],s=t[16],c=t[17],l=t[18],u=t[19];let d;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,$.jsx)(f,{className:`size-3.5 transition-transform group-open:rotate-180`,"aria-hidden":!0}),t[47]=d):d=t[47];let p;t[48]===r.evidence?p=t[49]:(p=(0,$.jsxs)(`summary`,{className:`flex min-h-9 cursor-pointer list-none items-center gap-1.5 text-xs font-medium text-fg-muted hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[r.evidence,d]}),t[48]=r.evidence,t[49]=p);let m;t[50]===n.evidence?m=t[51]:(m=n.evidence.map(je),t[50]=n.evidence,t[51]=m);let h;t[52]===m?h=t[53]:(h=(0,$.jsx)(`ul`,{className:`mt-2 space-y-2 border-l border-edge pl-3 text-xs leading-5 text-fg-muted`,children:m}),t[52]=m,t[53]=h);let _;t[54]!==h||t[55]!==p?(_=(0,$.jsxs)(`details`,{open:!0,className:`mt-4 group`,children:[p,h]}),t[54]=h,t[55]=p,t[56]=_):_=t[56];let v;return t[57]!==a||t[58]!==_||t[59]!==o||t[60]!==s||t[61]!==c||t[62]!==l||t[63]!==u?(v=(0,$.jsxs)($.Fragment,{children:[a,o,s,c,l,u,_]}),t[57]=a,t[58]=_,t[59]=o,t[60]=s,t[61]=c,t[62]=l,t[63]=u,t[64]=v):v=t[64],v}function je(e){return(0,$.jsx)(`li`,{children:(0,$.jsx)(Oe,{href:e.href,children:e.observation})},e.id)}function Me(e){return e.readiness!==`ready`}function Ne(e){let t=(0,Z.c)(134),{advisor:n,copy:r,busy:i,onRefresh:a,onAction:o,onFeedback:s,onClarification:c,onOpenHistory:l,preflight:u,receipt:d}=e,[f,p]=(0,Q.useState)(),m;t[0]!==n.alternatives||t[1]!==n.primary||t[2]!==n.state?(m=n.state===`ready`?[n.primary,...n.alternatives]:[],t[0]=n.alternatives,t[1]=n.primary,t[2]=n.state,t[3]=m):m=t[3];let g=m,_;t[4]!==g||t[5]!==f?(_=g.find(e=>e.id===f)??g[0],t[4]=g,t[5]=f,t[6]=_):_=t[6];let v=_,y;t[7]===g[0]?.id?y=t[8]:(y=()=>p(g[0]?.id),t[7]=g[0]?.id,t[8]=y);let b=g[0]?.id,S;if(t[9]!==n.state||t[10]!==b?(S=[n.state,b],t[9]=n.state,t[10]=b,t[11]=S):S=t[11],(0,Q.useEffect)(y,S),n.state===`disabled`)return null;if(d){let e;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(h,{className:`size-5 shrink-0 text-success`,"aria-hidden":!0}),t[12]=e):e=t[12];let n;t[13]===d.title?n=t[14]:(n=(0,$.jsx)(`p`,{className:`text-sm font-semibold text-fg`,children:d.title}),t[13]=d.title,t[14]=n);let i;t[15]===d.detail?i=t[16]:(i=(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:d.detail}),t[15]=d.detail,t[16]=i);let a;t[17]!==n||t[18]!==i?(a=(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[n,i]}),t[17]=n,t[18]=i,t[19]=a):a=t[19];let o;t[20]!==r.history||t[21]!==l?(o=(0,$.jsx)(ke,{label:r.history,onClick:l}),t[20]=r.history,t[21]=l,t[22]=o):o=t[22];let s=`#${d.href}`,c;t[23]!==r.viewProgress||t[24]!==s?(c=(0,$.jsx)(k,{asChild:!0,variant:`secondary`,className:`min-h-10 text-xs`,children:(0,$.jsx)(`a`,{href:s,children:r.viewProgress})}),t[23]=r.viewProgress,t[24]=s,t[25]=c):c=t[25];let u;t[26]!==o||t[27]!==c?(u=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[o,c]}),t[26]=o,t[27]=c,t[28]=u):u=t[28];let f;return t[29]!==u||t[30]!==a?(f=(0,$.jsx)(`section`,{className:`mt-7 rounded-2xl border border-success/25 bg-success-soft px-5 py-4`,role:`status`,children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center`,children:[e,a,u]})}),t[29]=u,t[30]=a,t[31]=f):f=t[31],f}if(n.state===`quiet`||n.state===`refreshing`)return null;if(n.state===`clarification`){let e;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(E,{className:`size-4`,"aria-hidden":!0}),t[32]=e):e=t[32];let a;t[33]===r.aiLabel?a=t[34]:(a=(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-medium text-accent`,children:[e,r.aiLabel]}),t[33]=r.aiLabel,t[34]=a);let o;t[35]!==r.history||t[36]!==l?(o=(0,$.jsx)(ke,{label:r.history,onClick:l}),t[35]=r.history,t[36]=l,t[37]=o):o=t[37];let s;t[38]!==a||t[39]!==o?(s=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[a,o]}),t[38]=a,t[39]=o,t[40]=s):s=t[40];let u;t[41]===n.question.question?u=t[42]:(u=(0,$.jsx)(`h3`,{id:`home-advisor-question`,className:`mt-3 text-lg font-semibold text-fg`,children:n.question.question}),t[41]=n.question.question,t[42]=u);let d;if(t[43]!==n.question.options||t[44]!==n.question.question||t[45]!==i||t[46]!==c){let e;t[48]!==n.question.question||t[49]!==i||t[50]!==c?(e=e=>(0,$.jsx)(k,{type:`button`,variant:`secondary`,className:`min-h-11`,disabled:i,onClick:()=>c(n.question.question,e.label),children:e.label},e.id),t[48]=n.question.question,t[49]=i,t[50]=c,t[51]=e):e=t[51],d=n.question.options.map(e),t[43]=n.question.options,t[44]=n.question.question,t[45]=i,t[46]=c,t[47]=d}else d=t[47];let f;t[52]===d?f=t[53]:(f=(0,$.jsx)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:d}),t[52]=d,t[53]=f);let p;return t[54]!==u||t[55]!==f||t[56]!==s?(p=(0,$.jsxs)(`section`,{className:`mt-7 rounded-2xl border border-accent/25 bg-surface-base px-5 py-5`,"aria-labelledby":`home-advisor-question`,children:[s,u,f]}),t[54]=u,t[55]=f,t[56]=s,t[57]=p):p=t[57],p}if(!v)return null;let C=u?.opportunityId===v.id?u.value:void 0,D;t[58]!==n.stale||t[59]!==r.refreshing?(D=n.stale?(0,$.jsxs)(`p`,{className:`mb-3 inline-flex items-center gap-2 text-xs text-accent`,children:[(0,$.jsx)(w,{className:`size-3.5 animate-spin`,"aria-hidden":!0}),r.refreshing]}):null,t[58]=n.stale,t[59]=r.refreshing,t[60]=D):D=t[60];let O;t[61]!==r||t[62]!==l||t[63]!==v?(O=(0,$.jsx)(Ae,{opportunity:v,copy:r,onOpenHistory:l}),t[61]=r,t[62]=l,t[63]=v,t[64]=O):O=t[64];let A;t[65]!==i||t[66]!==r.configure||t[67]!==r.degradedStart||t[68]!==r.setupHint||t[69]!==r.setupTitle||t[70]!==o||t[71]!==v||t[72]!==C?(A=C?.state===`needs_setup`?(0,$.jsx)(`div`,{className:`mt-5 rounded-xl border border-accent/25 bg-accent-soft/40 p-4`,role:`alert`,"aria-live":`polite`,children:(0,$.jsxs)(`div`,{className:`flex gap-3`,children:[(0,$.jsx)(T,{className:`mt-0.5 size-4 shrink-0 text-accent`,"aria-hidden":!0}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`p`,{className:`text-sm font-semibold text-fg`,children:r.setupTitle}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:r.setupHint}),(0,$.jsx)(`ul`,{className:`mt-2 space-y-1 text-xs leading-5 text-fg-muted`,children:C.blockers.map(Pe)}),(0,$.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[C.recoveryActions.map(e=>(0,$.jsxs)(`a`,{href:`#${e.href}`,className:`inline-flex min-h-11 items-center rounded-lg border border-accent/30 px-3 text-xs font-medium text-accent hover:bg-accent-soft focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[r.configure,` · `,e.capability]},e.capability)),C.degradedAction?(0,$.jsx)(k,{type:`button`,variant:`secondary`,className:`min-h-11`,disabled:i,onClick:()=>o(v,`degraded_start`),children:r.degradedStart}):null]})]})]})}):null,t[65]=i,t[66]=r.configure,t[67]=r.degradedStart,t[68]=r.setupHint,t[69]=r.setupTitle,t[70]=o,t[71]=v,t[72]=C,t[73]=A):A=t[73];let j;t[74]!==i||t[75]!==r.start||t[76]!==o||t[77]!==v?(j=v.actions.canStart?(0,$.jsxs)(k,{type:`button`,variant:`primary`,className:`min-h-11`,disabled:i,onClick:()=>o(v,`start`),children:[(0,$.jsx)(E,{className:`size-4`,"aria-hidden":!0}),r.start]}):null,t[74]=i,t[75]=r.start,t[76]=o,t[77]=v,t[78]=j):j=t[78];let M;t[79]!==i||t[80]!==r.discuss||t[81]!==o||t[82]!==v?(M=v.actions.canDiscuss?(0,$.jsxs)(k,{type:`button`,variant:`secondary`,className:`min-h-11`,disabled:i,onClick:()=>o(v,`discuss`),children:[(0,$.jsx)(x,{className:`size-4`,"aria-hidden":!0}),r.discuss]}):null,t[79]=i,t[80]=r.discuss,t[81]=o,t[82]=v,t[83]=M):M=t[83];let N;t[84]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,$.jsx)(w,{className:`size-4`,"aria-hidden":!0}),t[84]=N):N=t[84];let P;t[85]!==i||t[86]!==r.refresh||t[87]!==a?(P=(0,$.jsxs)(k,{type:`button`,variant:`ghost`,className:`min-h-11`,disabled:i,onClick:a,title:r.refresh,children:[N,r.refresh]}),t[85]=i,t[86]=r.refresh,t[87]=a,t[88]=P):P=t[88];let F;t[89]===r.feedback?F=t[90]:(F=(0,$.jsx)(`summary`,{className:`flex min-h-11 cursor-pointer list-none items-center rounded-lg px-3 text-xs text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:r.feedback}),t[89]=r.feedback,t[90]=F);let I;t[91]===r.alreadyDone?I=t[92]:(I=[`already_done`,r.alreadyDone],t[91]=r.alreadyDone,t[92]=I);let L;t[93]===r.irrelevant?L=t[94]:(L=[`irrelevant`,r.irrelevant],t[93]=r.irrelevant,t[94]=L);let R;t[95]===r.later?R=t[96]:(R=[`too_early`,r.later],t[95]=r.later,t[96]=R);let z;t[97]===r.sourceIncorrect?z=t[98]:(z=[`source_incorrect`,r.sourceIncorrect],t[97]=r.sourceIncorrect,t[98]=z);let B;t[99]===r.lessLikeThis?B=t[100]:(B=[`less_like_this`,r.lessLikeThis],t[99]=r.lessLikeThis,t[100]=B);let V;t[101]!==I||t[102]!==L||t[103]!==R||t[104]!==z||t[105]!==B?(V=[I,L,R,z,B],t[101]=I,t[102]=L,t[103]=R,t[104]=z,t[105]=B,t[106]=V):V=t[106];let H=V,U;t[107]!==i||t[108]!==s||t[109]!==v||t[110]!==H?(U=(0,$.jsx)(`div`,{className:`absolute right-0 z-20 mt-1 w-44 rounded-xl border border-edge bg-surface-overlay p-1 shadow-float`,children:H.map(e=>{let[t,n]=e;return(0,$.jsx)(`button`,{type:`button`,disabled:i,className:`min-h-10 w-full rounded-lg px-3 text-left text-sm text-fg-muted hover:bg-surface-hover hover:text-fg`,onClick:()=>s(v,t),children:n},t)})}),t[107]=i,t[108]=s,t[109]=v,t[110]=H,t[111]=U):U=t[111];let W;t[112]!==F||t[113]!==U?(W=(0,$.jsxs)(`details`,{className:`relative ml-auto`,children:[F,U]}),t[112]=F,t[113]=U,t[114]=W):W=t[114];let G;t[115]!==M||t[116]!==P||t[117]!==W||t[118]!==j?(G=(0,$.jsxs)(`div`,{className:`mt-5 flex flex-wrap items-center gap-2`,children:[j,M,P,W]}),t[115]=M,t[116]=P,t[117]=W,t[118]=j,t[119]=G):G=t[119];let K;t[120]!==G||t[121]!==D||t[122]!==O||t[123]!==A?(K=(0,$.jsxs)(`div`,{className:`px-5 py-5 sm:px-6`,children:[D,O,A,G]}),t[120]=G,t[121]=D,t[122]=O,t[123]=A,t[124]=K):K=t[124];let q;t[125]!==i||t[126]!==r.alternatives||t[127]!==g||t[128]!==v.id?(q=g.length>1?(0,$.jsxs)(`div`,{className:`border-t border-edge-subtle px-5 py-4 sm:px-6`,children:[(0,$.jsx)(`p`,{className:`text-xs font-medium text-fg-subtle`,children:r.alternatives}),(0,$.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:g.filter(e=>e.id!==v.id).map(e=>(0,$.jsx)(`button`,{type:`button`,disabled:i,className:`min-h-10 rounded-lg border border-edge px-3 text-left text-sm text-fg-muted hover:bg-surface-hover hover:text-fg`,onClick:()=>p(e.id),children:e.title},e.id))})]}):null,t[125]=i,t[126]=r.alternatives,t[127]=g,t[128]=v.id,t[129]=q):q=t[129];let J;return t[130]!==r.aiLabel||t[131]!==K||t[132]!==q?(J=(0,$.jsxs)(`section`,{className:`mt-7 rounded-2xl border border-accent/25 bg-surface-base`,"aria-label":r.aiLabel,children:[K,q]}),t[130]=r.aiLabel,t[131]=K,t[132]=q,t[133]=J):J=t[133],J}function Pe(e){return(0,$.jsx)(`li`,{children:e.message},`${e.kind}:${e.capability}`)}var Fe=new Set([`started`,`discussing`,`completed`]);function Ie(){let e=(0,Z.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(`div`,{className:`space-y-4`,"aria-busy":!0,children:[0,1,2].map(Le)}),e[0]=t):t=e[0],t}function Le(e){return(0,$.jsxs)(`div`,{className:`space-y-2 rounded-xl border border-edge-subtle p-4`,children:[(0,$.jsx)(A,{className:`h-4 w-24 rounded`}),(0,$.jsx)(A,{className:`h-5 w-4/5 rounded`}),(0,$.jsx)(A,{className:`h-4 w-3/5 rounded`})]},e)}function Re(e){let t=(0,Z.c)(11),{open:n,refreshKey:r,onOpenChange:i,onReevaluate:a}=e,o=l(ze),s=u(o).projectsPage.home,d=c(),[p,m]=(0,Q.useState)(`all`),h;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(h=[],t[0]=h):h=t[0];let[y,x]=(0,Q.useState)(h),[S,C]=(0,Q.useState)(!1),[T,E]=(0,Q.useState)(),O;t[1]===n?O=t[2]:(O=()=>{if(!n)return;let e=!0;return C(!0),E(void 0),ae().then(t=>{e&&x(t.items)}).catch(t=>{e&&E(t instanceof Error?t.message:String(t))}).finally(()=>{e&&C(!1)}),()=>{e=!1}},t[1]=n,t[2]=O);let A;t[3]!==n||t[4]!==r?(A=[n,r],t[3]=n,t[4]=r,t[5]=A):A=t[5],(0,Q.useEffect)(O,A);let R=y.filter(e=>p===`all`||(p===`adopted`?Fe.has(e.status):!Fe.has(e.status))),z=new Intl.DateTimeFormat(o===`zh`?`zh-CN`:`en`,{dateStyle:`medium`}),B=new Intl.DateTimeFormat(o===`zh`?`zh-CN`:`en`,{dateStyle:`medium`,timeStyle:`short`}),V=new Map;for(let e of R){let t=z.format(new Date(e.updatedAt));V.set(t,[...V.get(t)??[],e])}let H=[...V.entries()],U=e=>e.feedbackKind===`already_done`?s.advisorHistoryStatusCompleted:e.feedbackKind===`irrelevant`?s.advisorHistoryStatusIrrelevant:e.feedbackKind===`source_incorrect`?s.advisorHistoryStatusSourceIncorrect:e.feedbackKind===`less_like_this`?s.advisorHistoryStatusLessLikeThis:{available:s.advisorHistoryStatusAvailable,started:s.advisorHistoryStatusStarted,discussing:s.advisorHistoryStatusDiscussing,completed:s.advisorHistoryStatusCompleted,snoozed:s.advisorHistoryStatusSnoozed,dismissed:s.advisorHistoryStatusDismissed,expired:s.advisorHistoryStatusExpired,superseded:s.advisorHistoryStatusSuperseded}[e.status],W=e=>{if(e.href){i(!1),d(b(`/`,e.href));return}e.status===`discussing`&&(i(!1),d(`/chat/new?${new URLSearchParams({draft:e.opportunity.actionPrompt}).toString()}`))},G;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,$.jsx)(j,{className:`xopc-dialog-overlay fixed inset-0 z-[80] bg-scrim`}),t[6]=G):G=t[6];let K;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,$.jsx)(v,{className:`mt-0.5 size-5 shrink-0 text-accent`,"aria-hidden":!0}),t[7]=K):K=t[7];let q;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,$.jsx)(D,{className:`size-4`,"aria-hidden":!0}),t[8]=q):q=t[8];let J=S?(0,$.jsx)(Ie,{}):T?(0,$.jsxs)(`div`,{className:`rounded-xl border border-danger/25 bg-danger-soft p-4 text-sm text-danger`,children:[(0,$.jsx)(`p`,{children:s.advisorHistoryLoadFailed}),(0,$.jsx)(k,{type:`button`,variant:`ghost`,className:`mt-2`,onClick:()=>i(!1),children:s.advisorHistoryClose})]}):H.length===0?(0,$.jsxs)(`div`,{className:`py-16 text-center`,children:[(0,$.jsx)(v,{className:`mx-auto size-6 text-fg-subtle`,"aria-hidden":!0}),(0,$.jsx)(`p`,{className:`mt-3 text-sm font-medium text-fg`,children:s.advisorHistoryEmpty}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:s.advisorHistoryEmptyHint})]}):(0,$.jsx)(`div`,{className:`space-y-6`,children:H.map(e=>{let[t,n]=e;return(0,$.jsxs)(`section`,{"aria-label":t,children:[(0,$.jsx)(`h3`,{className:`mb-2 text-xs font-medium text-fg-subtle`,children:t}),(0,$.jsx)(`div`,{className:`space-y-2`,children:n.map(e=>{let t=!!e.href||e.status===`discussing`,n=[`snoozed`,`dismissed`,`expired`,`superseded`].includes(e.status);return(0,$.jsxs)(`article`,{className:`rounded-xl border border-edge-subtle bg-surface-base p-4`,children:[(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`p`,{className:`text-xs font-medium text-accent`,children:U(e)}),(0,$.jsx)(`h4`,{className:`mt-1.5 text-sm font-semibold leading-5 text-fg`,children:e.opportunity.title}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:e.opportunity.outcome})]}),(0,$.jsx)(`time`,{className:`shrink-0 text-[11px] text-fg-subtle`,dateTime:new Date(e.updatedAt).toISOString(),children:B.format(new Date(e.updatedAt))})]}),e.snoozedUntil?(0,$.jsxs)(`p`,{className:`mt-2 inline-flex items-center gap-1 text-xs text-fg-muted`,children:[(0,$.jsx)(g,{className:`size-3.5`,"aria-hidden":!0}),s.advisorHistoryReturnsAt,` `,B.format(new Date(e.snoozedUntil))]}):null,(0,$.jsxs)(`details`,{className:`group mt-3`,children:[(0,$.jsxs)(`summary`,{className:`flex min-h-8 cursor-pointer list-none items-center gap-1 text-xs font-medium text-fg-muted hover:text-fg`,children:[s.advisorHistoryEvidence,(0,$.jsx)(f,{className:`size-3.5 transition-transform duration-200 group-open:rotate-180 motion-reduce:transition-none`,"aria-hidden":!0})]}),(0,$.jsx)(`ul`,{className:`mt-2 space-y-1.5 border-l border-edge pl-3 text-xs leading-5 text-fg-muted`,children:e.opportunity.evidence.map(e=>(0,$.jsx)(`li`,{children:(0,$.jsx)(Oe,{href:e.href,onOpen:()=>i(!1),children:e.observation})},e.id))})]}),t||n?(0,$.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[t?(0,$.jsxs)(k,{type:`button`,variant:`secondary`,className:`min-h-9 text-xs`,onClick:()=>W(e),children:[(0,$.jsx)(_,{className:`size-3.5`,"aria-hidden":!0}),e.status===`discussing`?s.advisorHistoryContinueDiscussion:s.advisorHistoryViewProgress]}):null,n?(0,$.jsxs)(k,{type:`button`,variant:`ghost`,className:`min-h-9 text-xs`,onClick:()=>{i(!1),a()},children:[(0,$.jsx)(w,{className:`size-3.5`,"aria-hidden":!0}),s.advisorHistoryReevaluate]}):null]}):null]},e.opportunity.id)})})]},t)})}),ee;return t[9]===J?ee=t[10]:(ee=(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-5 py-4`,children:J}),t[9]=J,t[10]=ee),(0,$.jsx)(L,{open:n,onOpenChange:i,children:(0,$.jsxs)(P,{children:[G,(0,$.jsxs)(F,{className:`xopc-drawer-right fixed right-0 top-0 z-[90] flex size-full max-w-lg flex-col overflow-hidden border-l border-edge bg-surface-overlay shadow-popover outline-none`,"aria-describedby":`home-advisor-history-description`,children:[(0,$.jsxs)(`div`,{className:`flex shrink-0 items-start gap-3 border-b border-edge px-5 py-4`,children:[K,(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(I,{className:`text-base font-semibold text-fg`,children:s.advisorHistoryTitle}),(0,$.jsx)(M,{id:`home-advisor-history-description`,className:`mt-1 text-xs leading-5 text-fg-muted`,children:s.advisorHistoryDescription})]}),(0,$.jsx)(N,{asChild:!0,children:(0,$.jsx)(k,{type:`button`,variant:`ghost`,className:`-mr-2 size-9 shrink-0 p-0`,"aria-label":s.advisorHistoryClose,children:q})})]}),(0,$.jsx)(`div`,{className:`shrink-0 border-b border-edge-subtle px-5 py-3`,children:(0,$.jsx)(_e,{className:`inline-flex rounded-lg bg-surface-inset p-1`,role:`group`,"aria-label":s.advisorHistoryFilterLabel,indicatorClassName:`rounded-md bg-surface-panel shadow-surface`,children:[[`all`,s.advisorHistoryFilterAll],[`adopted`,s.advisorHistoryFilterAdopted],[`other`,s.advisorHistoryFilterOther]].map(e=>{let[t,n]=e;return(0,$.jsx)(`button`,{type:`button`,className:`min-h-9 rounded-md px-3 text-xs font-medium transition-colors duration-150 ${p===t?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted hover:text-fg`}`,"aria-pressed":p===t,onClick:()=>m(t),children:n},t)})})}),ee]})]})})}function ze(e){return e.language}function Be(e,t){return e.replace(`{{count}}`,String(t))}function Ve(e,t){if(e.state===`disabled`)return null;if(e.state===`ready`){let n=1+e.alternatives.length;return{label:Be(t.ready,n),detail:e.primary.title,tone:`accent`,refreshing:!!e.stale}}return e.state===`clarification`?{label:t.clarification,detail:e.question.question,tone:`accent`,refreshing:!1}:e.state===`refreshing`?{label:t.refreshing,detail:e.previous?.title??t.refreshingDetail,tone:`accent`,refreshing:!0}:e.reason===`generation_failed`?{label:t.generationFailed,detail:t.generationFailedDetail,tone:`danger`,refreshing:!1}:e.reason===`budget_exhausted`?{label:t.budgetExhausted,detail:t.budgetExhaustedDetail,tone:`warning`,refreshing:!1}:e.reason===`model_unavailable`?{label:t.modelUnavailable,detail:t.modelUnavailableDetail,tone:`warning`,refreshing:!1}:{label:t.idle,detail:t.idleDetail,tone:`neutral`,refreshing:!1}}var He={accent:`bg-accent`,danger:`bg-danger`,neutral:`bg-fg-subtle`,warning:`bg-warning`};function Ue(e){let t=(0,Z.c)(50),{advisor:n,busy:r,copy:i,onOpenHistory:a,onRefresh:o}=e,[s,c]=(0,Q.useState)(!1),l;t[0]!==n||t[1]!==i?(l=Ve(n,i),t[0]=n,t[1]=i,t[2]=l):l=t[2];let u=l;if(!u)return null;let d=n.state!==`refreshing`,f=n.state===`ready`?i.findAnother:i.retry,p=`${i.label}:${u.label}`,m;t[3]===u.refreshing?m=t[4]:(m=u.refreshing?(0,$.jsx)(w,{className:`size-3.5 shrink-0 animate-spin motion-reduce:animate-none`,"aria-hidden":!0}):(0,$.jsx)(E,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),t[3]=u.refreshing,t[4]=m);let h=He[u.tone],g;t[5]===h?g=t[6]:(g=O(`size-1.5 shrink-0 rounded-full`,h),t[5]=h,t[6]=g);let _;t[7]===g?_=t[8]:(_=(0,$.jsx)(`span`,{className:g,"aria-hidden":!0}),t[7]=g,t[8]=_);let y;t[9]!==i.label||t[10]!==u.label?(y=(0,$.jsxs)(`span`,{className:`truncate`,children:[i.label,` · `,u.label]}),t[9]=i.label,t[10]=u.label,t[11]=y):y=t[11];let b;t[12]!==p||t[13]!==m||t[14]!==_||t[15]!==y?(b=(0,$.jsx)(V,{asChild:!0,children:(0,$.jsxs)(k,{type:`button`,variant:`ghost`,className:`h-9 max-w-56 rounded-lg px-2.5`,"aria-label":p,children:[m,_,y]})}),t[12]=p,t[13]=m,t[14]=_,t[15]=y,t[16]=b):b=t[16];let x;t[17]===u.refreshing?x=t[18]:(x=(0,$.jsx)(`span`,{className:`mt-1 flex size-7 shrink-0 items-center justify-center rounded-lg bg-accent-soft text-accent`,children:u.refreshing?(0,$.jsx)(w,{className:`size-4 animate-spin motion-reduce:animate-none`,"aria-hidden":!0}):(0,$.jsx)(E,{className:`size-4`,"aria-hidden":!0})}),t[17]=u.refreshing,t[18]=x);let S;t[19]===u.label?S=t[20]:(S=(0,$.jsx)(`p`,{className:`font-semibold text-fg`,children:u.label}),t[19]=u.label,t[20]=S);let C;t[21]===u.detail?C=t[22]:(C=(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:u.detail}),t[21]=u.detail,t[22]=C);let T;t[23]!==S||t[24]!==C?(T=(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[S,C]}),t[23]=S,t[24]=C,t[25]=T):T=t[25];let D;t[26]!==T||t[27]!==x?(D=(0,$.jsxs)(`div`,{className:`flex items-start gap-3`,children:[x,T]}),t[26]=T,t[27]=x,t[28]=D):D=t[28];let A;t[29]===a?A=t[30]:(A=()=>{c(!1),a()},t[29]=a,t[30]=A);let j;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,$.jsx)(v,{className:`size-3.5`,"aria-hidden":!0}),t[31]=j):j=t[31];let M;t[32]!==i.history||t[33]!==A?(M=(0,$.jsxs)(k,{type:`button`,variant:`ghost`,className:`h-9 rounded-lg text-xs`,onClick:A,children:[j,i.history]}),t[32]=i.history,t[33]=A,t[34]=M):M=t[34];let N;t[35]!==r||t[36]!==d||t[37]!==o||t[38]!==f?(N=d?(0,$.jsxs)(k,{type:`button`,variant:`secondary`,className:`h-9 rounded-lg text-xs`,disabled:r,onClick:()=>{c(!1),o()},children:[(0,$.jsx)(w,{className:`size-3.5`,"aria-hidden":!0}),f]}):null,t[35]=r,t[36]=d,t[37]=o,t[38]=f,t[39]=N):N=t[39];let P;t[40]!==M||t[41]!==N?(P=(0,$.jsxs)(`div`,{className:`mt-4 flex items-center justify-end gap-1 border-t border-edge-subtle pt-3`,children:[M,N]}),t[40]=M,t[41]=N,t[42]=P):P=t[42];let F;t[43]!==D||t[44]!==P?(F=(0,$.jsx)(R,{children:(0,$.jsxs)(z,{side:`bottom`,align:`end`,sideOffset:6,className:`z-[70] w-[min(21rem,calc(100vw-1.5rem))] rounded-xl border border-edge bg-surface-overlay p-4 text-sm text-fg shadow-popover outline-none`,onOpenAutoFocus:We,children:[D,P]})}),t[43]=D,t[44]=P,t[45]=F):F=t[45];let I;return t[46]!==s||t[47]!==F||t[48]!==b?(I=(0,$.jsxs)(B,{open:s,onOpenChange:c,children:[b,F]}),t[46]=s,t[47]=F,t[48]=b,t[49]=I):I=t[49],I}function We(e){return e.preventDefault()}async function Ge(e,t=`en`){let n=await pe(e),r=n.runs.filter(e=>!e.parentRunId).sort((e,t)=>t.queuedAt-e.queuedAt)[0];if(!n.allowedCommands.includes(`start`)||r?.status!==`failed`)throw Error(t===`zh`?`任务状态已变化,暂时无法重试。请刷新并查看当前状态。`:`Task is no longer available for retry. Refresh and review its current state.`);await Y(e,{type:`start`,executor:H.parse({...r.executorRef,kind:r.executorKind})},n.task.version)}function Ke(e){let t=e.runs.filter(e=>!e.parentRunId).sort((e,t)=>t.queuedAt-e.queuedAt)[0],n=e.conversation?.currentExecutorAgentId??e.task.delegateAgentId,r=n?{kind:`agent`,agentId:n}:t?{...t.executorRef,kind:t.executorKind}:void 0,i=H.safeParse(r);return i.success?i.data:void 0}var qe=(0,Q.lazy)(()=>i(()=>import(`./workspace-file-preview-dialog-BubQwQwU.js`).then(e=>e.n).then(e=>({default:e.WorkspaceFilePreviewPanel})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73])));function Je({taskId:e,language:t,onComplete:n,onUpdated:r}){let i=t===`zh`,o=a(),c=`${o.pathname}${o.search}`,[l,u]=(0,Q.useState)(),[d,f]=(0,Q.useState)(),[p,m]=(0,Q.useState)(null),[h,g]=(0,Q.useState)(),[_,v]=(0,Q.useState)(!1),b=(0,Q.useRef)(!1),x=(0,Q.useRef)(0),[S,C]=(0,Q.useState)(0);(0,Q.useEffect)(()=>{u(void 0),g(void 0)},[e]),(0,Q.useEffect)(()=>{let t=!0,n=++x.current;return f(void 0),pe(e).then(e=>{t&&n===x.current&&!b.current&&u(e)}).catch(e=>{t&&n===x.current&&f(e instanceof Error?e.message:String(e))}),()=>{t=!1}},[e,S]),(0,Q.useEffect)(()=>{let t=()=>{b.current||C(e=>e+1)},n=n=>{n.detail?.taskId===e&&t()};return window.addEventListener(`task-changed-v2`,n),window.addEventListener(`focus`,t),window.addEventListener(`realtime-gap`,t),window.addEventListener(`gateway-realtime-connected`,t),()=>{window.removeEventListener(`task-changed-v2`,n),window.removeEventListener(`focus`,t),window.removeEventListener(`realtime-gap`,t),window.removeEventListener(`gateway-realtime-connected`,t)}},[e]);let w=l?K(l):[],T=l?.task.phase===`review`&&l.allowedCommands.includes(`close`)&&l.waits.length===0&&w.length>0&&w.every(e=>e.status===`passed`),E=l?Ke(l):void 0,D=l?.allowedCommands.includes(`start`)&&l.waits.length===0&&E,O=e=>{x.current++,u(e),r?.(e)};async function M(e,t,r=!1){if(!b.current){b.current=!0,x.current++,v(!0),f(void 0);try{O(await e()),g(t),r&&n()}catch(e){f(e instanceof Error?e.message:String(e))}finally{b.current=!1,v(!1)}}}let N=l?.receipts.filter(e=>l.runs.some(t=>t.id===e.runId&&t.contractVersion===l.task.latestContractVersion)).sort((e,t)=>t.finalizedAt-e.finalizedAt)[0],R=w.filter(e=>e.status===`passed`).length,z=w.filter(e=>e.status===`failed`).length,B=w.length-R-z,V=l?.task.contract?.acceptancePolicy===`verified_auto`,H=y(c,e);return(0,$.jsxs)(`section`,{className:`mt-4 space-y-4 rounded-xl border border-edge bg-surface-panel p-4`,"aria-label":i?`任务结果与处理`:`Task result and actions`,"aria-busy":_,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,$.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:i?`执行结果`:`Result`}),(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(k,{variant:`ghost`,disabled:_,onClick:()=>C(e=>e+1),children:i?`刷新状态`:`Refresh status`}),(0,$.jsx)(s,{to:H,className:`inline-flex min-h-9 items-center text-xs font-medium text-accent-fg hover:underline`,children:i?`查看任务详情`:`Task details`})]})]}),d?(0,$.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:d}):null,_?(0,$.jsx)(`p`,{role:`status`,className:`text-xs text-fg-muted`,children:i?`正在处理…`:`Processing…`}):null,h?(0,$.jsx)(`p`,{role:`status`,className:`text-sm text-success`,children:h}):null,!l&&!d?(0,$.jsxs)(`div`,{className:`space-y-3`,"aria-busy":!0,children:[(0,$.jsx)(A,{className:`h-5 w-1/3`}),(0,$.jsx)(A,{className:`h-24 w-full`})]}):null,l?(0,$.jsxs)($.Fragment,{children:[N?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`p`,{className:`text-xs text-fg-muted`,children:N.completionVerdict===`achieved`?i?`执行报告已达成目标,请结合依据逐项验收。`:`The run reports the goal achieved. Review the evidence before accepting.`:i?`当前为阶段性结果,尚有工作需要推进。`:`This is a partial result. More work is needed.`}),(0,$.jsx)(X,{content:N.summary,contentKey:`home:${e}:result:${N.runId}`,language:t,previewHeight:180}),N.remainingWork.length>0?(0,$.jsxs)(`div`,{className:`text-sm text-fg-muted`,children:[(0,$.jsx)(`p`,{className:`font-medium text-fg`,children:i?`尚待完成`:`Remaining work`}),(0,$.jsx)(`ul`,{className:`mt-1 list-disc space-y-1 pl-5`,children:N.remainingWork.map((e,t)=>(0,$.jsx)(`li`,{children:e},t))})]}):null,N.nextAction?(0,$.jsxs)(`p`,{className:`whitespace-pre-wrap text-sm text-fg-muted`,children:[(0,$.jsx)(`span`,{className:`font-medium text-fg`,children:i?`下一步:`:`Next step: `}),N.nextAction]}):null,N.judgment?(0,$.jsxs)(`div`,{className:`space-y-1 text-sm text-fg-muted`,children:[(0,$.jsx)(`p`,{className:`font-medium text-fg`,children:i?`判断依据`:`Assessment`}),(0,$.jsx)(`p`,{children:N.judgment.recommendation}),(0,$.jsx)(`ul`,{className:`list-disc space-y-1 pl-5`,children:N.judgment.reasons.map((e,t)=>(0,$.jsx)(`li`,{children:e},t))}),N.judgment.uncertainty?(0,$.jsxs)(`p`,{children:[i?`待确认:`:`Uncertainty: `,N.judgment.uncertainty]}):null]}):null,(0,$.jsx)(Ce,{evidence:N.evidence,projectId:l.task.projectId,conversationId:l.conversation?.activeConversationId,language:t,onOpenFile:m})]}):(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:i?`当前任务版本暂无执行结果,可先处理等待事项或查看执行进度。`:`No result for the current task version. Resolve pending items or view progress.`}),w.length>0?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`h3`,{className:`text-sm font-semibold text-fg`,children:[i?`验收条件`:`Acceptance criteria`,` `,(0,$.jsxs)(`span`,{className:`font-normal text-fg-muted`,children:[R,`/`,w.length]})]}),w.map((n,r)=>(0,$.jsxs)(`div`,{className:`space-y-2 border-t border-edge-subtle pt-3`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-2`,children:[(0,$.jsxs)(`div`,{className:`min-w-0 flex-1 text-sm text-fg`,children:[(0,$.jsx)(`p`,{className:`break-words`,children:n.text}),(0,$.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:i?{passed:`已通过`,failed:`未通过`,unverified:`待判定`}[n.status]:{passed:`Passed`,failed:`Failed`,unverified:`Not reviewed`}[n.status]})]}),l.task.phase===`review`&&!V?(0,$.jsx)(`div`,{className:`flex gap-2`,children:[`passed`,`failed`].map(t=>(0,$.jsx)(k,{variant:`secondary`,disabled:_||n.status===t,onClick:()=>void M(()=>ne(e,r,t,l.task.version,l.task.latestContractVersion),i?`判定已保存。`:`Review saved.`),children:i?t===`passed`?`确认通过`:`未通过`:t===`passed`?`Mark passed`:`Mark failed`},t))}):null]}),n.note?(0,$.jsx)(`p`,{className:`whitespace-pre-wrap text-xs leading-5 text-fg-muted`,children:n.note}):null,n.review?.note?(0,$.jsx)(`p`,{className:`text-xs text-fg-muted`,children:n.review.note}):null,(0,$.jsx)(Ce,{evidence:n.evidence,projectId:l.task.projectId,conversationId:l.conversation?.activeConversationId,language:t,onOpenFile:m})]},r))]}):null,l.waits.length>0?(0,$.jsxs)(`div`,{className:`space-y-3`,children:[(0,$.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:i?`等待处理`:`Pending items`}),l.waits.map(t=>(0,$.jsx)(`div`,{children:l.allowedCommands.includes(`resolve_wait`)&&(t.kind===`user_input`||t.kind===`approval`&&typeof t.condition.capability==`string`)&&t.condition.type!==`connection`?(0,$.jsx)(Se,{wait:t,detail:l,zh:i,onUpdated:O}):(0,$.jsxs)(`div`,{className:`rounded-lg bg-surface-hover p-3 text-sm text-fg-muted`,children:[(0,$.jsx)(`p`,{children:t.reason}),t.kind===`paused`&&l.allowedCommands.includes(`resolve_wait`)?(0,$.jsx)(k,{className:`mt-2`,disabled:_,onClick:()=>void M(()=>Y(e,{type:`resolve_wait`,waitId:t.id},l.task.version),i?`已解除暂停,任务状态已更新。`:`Pause resolved. Task status updated.`),children:i?`恢复任务`:`Resume task`}):(0,$.jsx)(s,{to:typeof t.condition.dependsOnTaskId==`string`?y(c,t.condition.dependsOnTaskId):H,className:`mt-2 inline-flex min-h-9 items-center text-accent-fg hover:underline`,children:i?`查看并处理`:`View and resolve`})]})},t.id))]}):null,l.task.phase===`review`&&!T?(0,$.jsx)(`p`,{className:`text-xs leading-5 text-fg-muted`,children:i?`尚有 ${B} 项待判定、${z} 项未通过、${l.waits.length} 项等待处理。${V?`此任务需要执行验证;请继续执行以补齐依据和未完成项。`:`查看依据后逐项判定;未通过时可继续执行修正。`}`:`${B} unreviewed, ${z} failed, ${l.waits.length} pending items. ${V?`This task requires execution verification. Continue execution to supply missing evidence.`:`Review the evidence and mark each criterion; continue execution to fix failures.`}`}):null,(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[l.task.phase===`review`?(0,$.jsx)(k,{variant:`primary`,disabled:_||!T,onClick:()=>void M(()=>Y(e,{type:`close`,resolution:`done`},l.task.version),i?`任务已验收完成。`:`Task accepted.`,!0),children:i?`验收完成`:`Accept task`}):null,D?(0,$.jsx)(k,{variant:T?`secondary`:`primary`,disabled:_,onClick:()=>void M(()=>Y(e,{type:`start`,executor:E},l.task.version),i?`已开始执行,结果将自动更新。`:`Execution started. Results will update automatically.`),children:i?N?`继续执行并验证`:`开始执行`:N?`Continue and verify`:`Start execution`}):null]})]}):null,l&&p?(0,$.jsx)(L,{open:!0,onOpenChange:e=>{e||m(null)},children:(0,$.jsxs)(P,{children:[(0,$.jsx)(j,{className:`fixed inset-0 z-[80] bg-scrim`}),(0,$.jsxs)(F,{className:`app-main-surface fixed left-1/2 top-1/2 z-[90] flex h-[min(54rem,calc(100dvh-2rem))] w-[min(72rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-panel outline-none`,"aria-describedby":void 0,children:[(0,$.jsxs)(I,{className:`sr-only`,children:[i?`交付物预览`:`Artifact preview`,` · `,p]}),(0,$.jsx)(Q.Suspense,{fallback:(0,$.jsxs)(`div`,{className:`flex-1 space-y-3 p-4`,"aria-busy":!0,children:[(0,$.jsx)(A,{className:`h-9 w-full`}),(0,$.jsx)(A,{className:`h-64 w-full`})]}),children:(0,$.jsx)(qe,{filePath:p,projectId:l.task.projectId,conversationId:l.conversation?.activeConversationId,onClose:()=>m(null)})})]})]})}):null]})}function Ye(e,t){return e.replace(/\{\{(\w+)\}\}/g,(e,n)=>String(t[n]??``))}function Xe(){let e=(0,Z.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(`div`,{className:`space-y-8`,"aria-busy":!0,children:[(0,$.jsxs)(`div`,{className:`space-y-3`,children:[(0,$.jsx)(A,{className:`h-10 w-3/5 rounded-xl`}),(0,$.jsx)(A,{className:`h-5 w-4/5 rounded-lg`})]}),(0,$.jsx)(A,{className:`h-64 rounded-2xl`}),(0,$.jsx)(A,{className:`h-32 rounded-xl`})]}),e[0]=t):t=e[0],t}function Ze(e){let t=(0,Z.c)(61),{item:n,busy:r,recommendationLabel:i,dueLabel:a,failureLabel:s,locale:c,onAction:l,onComplete:u,onUpdated:d}=e,[f,p]=o(),m;t[0]===n.openAction?m=t[1]:(m=n.openAction?.type===`open`?/^\/tasks\/([^/?#]+)/.exec(n.openAction.href):null,t[0]=n.openAction,t[1]=m);let h=m,g=n.primaryAction?.type===`task_review`?n.primaryAction.taskId:h?decodeURIComponent(h[1]):void 0,_;t[2]!==g||t[3]!==f?(_=g&&f.get(`reviewTask`)===g,t[2]=g,t[3]=f,t[4]=_):_=t[4];let v=!!_,y;t[5]!==g||t[6]!==f||t[7]!==p?(y=e=>{let t=new URLSearchParams(f);e&&g?t.set(`reviewTask`,g):t.delete(`reviewTask`),p(t)},t[5]=g,t[6]=f,t[7]=p,t[8]=y):y=t[8];let b=y,x;t[9]!==a||t[10]!==n.dueAt||t[11]!==c?(x=n.dueAt?`${a} ${be(new Date(n.dueAt),c)}`:null,t[9]=a,t[10]=n.dueAt,t[11]=c,t[12]=x):x=t[12];let S=x,C=n.kind===`failure`?s:S,w;t[13]===C?w=t[14]:(w=C?(0,$.jsxs)(`div`,{className:`mb-2 flex items-center gap-2 text-xs font-medium text-warning`,children:[(0,$.jsx)(`span`,{className:`size-1.5 rounded-full bg-warning`,"aria-hidden":!0}),(0,$.jsx)(`span`,{children:C})]}):null,t[13]=C,t[14]=w);let T=!n.openAction,E;t[15]!==n.id||t[16]!==n.openAction||t[17]!==l?(E=()=>n.openAction&&l(n.openAction,n.id),t[15]=n.id,t[16]=n.openAction,t[17]=l,t[18]=E):E=t[18];let D;t[19]===n.title?D=t[20]:(D=(0,$.jsx)(`span`,{className:`block text-lg font-semibold leading-7 tracking-tight text-fg`,children:n.title}),t[19]=n.title,t[20]=D);let O;t[21]===n.summary?O=t[22]:(O=(0,$.jsx)(`span`,{className:`mt-1.5 block text-sm leading-6 text-fg-muted`,children:n.summary}),t[21]=n.summary,t[22]=O);let A;t[23]!==T||t[24]!==E||t[25]!==D||t[26]!==O?(A=(0,$.jsxs)(`button`,{type:`button`,className:`block w-full text-left outline-none focus-visible:rounded-md focus-visible:ring-2 focus-visible:ring-accent`,disabled:T,onClick:E,children:[D,O]}),t[23]=T,t[24]=E,t[25]=D,t[26]=O,t[27]=A):A=t[27];let j;t[28]!==n.recommendation||t[29]!==i?(j=n.recommendation?(0,$.jsxs)(`p`,{className:`mt-3 text-sm leading-6 text-fg-muted`,children:[(0,$.jsxs)(`span`,{className:`font-semibold text-fg`,children:[i,`:`]}),n.recommendation]}):null,t[28]=n.recommendation,t[29]=i,t[30]=j):j=t[30];let M;t[31]!==r||t[32]!==n.id||t[33]!==n.primaryAction||t[34]!==n.secondaryActions||t[35]!==l||t[36]!==v||t[37]!==g||t[38]!==b?(M=n.primaryAction||n.secondaryActions.length>0?(0,$.jsxs)(`div`,{className:`mt-5 flex flex-wrap gap-2`,children:[n.primaryAction?(0,$.jsx)(k,{type:`button`,variant:`primary`,className:`h-9 rounded-lg px-3.5 text-xs`,disabled:r,"aria-expanded":g&&[`task_review`,`open`].includes(n.primaryAction.type)?v:void 0,onClick:()=>g&&[`task_review`,`open`].includes(n.primaryAction.type)?b(!v):l(n.primaryAction,n.id),children:n.primaryAction.label}):null,n.secondaryActions.map(e=>(0,$.jsx)(k,{type:`button`,variant:`secondary`,className:`h-9 rounded-lg px-3.5 text-xs shadow-none`,disabled:r,onClick:()=>l(e,n.id),children:e.label},`${e.type}:${e.label}`))]}):null,t[31]=r,t[32]=n.id,t[33]=n.primaryAction,t[34]=n.secondaryActions,t[35]=l,t[36]=v,t[37]=g,t[38]=b,t[39]=M):M=t[39];let N;t[40]!==n.primaryAction?.type||t[41]!==c||t[42]!==v||t[43]!==g||t[44]!==b?(N=g&&n.primaryAction?.type===`retry_task`?(0,$.jsx)(k,{variant:`ghost`,className:`mt-2`,"aria-expanded":v,onClick:()=>b(!v),children:c===`zh`?`查看结果与依据`:`View result and evidence`}):null,t[40]=n.primaryAction?.type,t[41]=c,t[42]=v,t[43]=g,t[44]=b,t[45]=N):N=t[45];let P;t[46]!==c||t[47]!==u||t[48]!==d||t[49]!==v||t[50]!==g||t[51]!==b?(P=v&&g?(0,$.jsx)(Je,{taskId:g,language:c,onUpdated:d,onComplete:()=>{b(!1),u()}},g):null,t[46]=c,t[47]=u,t[48]=d,t[49]=v,t[50]=g,t[51]=b,t[52]=P):P=t[52];let F;return t[53]!==r||t[54]!==A||t[55]!==j||t[56]!==M||t[57]!==N||t[58]!==P||t[59]!==w?(F=(0,$.jsxs)(`article`,{className:`px-5 py-5 sm:px-6 sm:py-6`,"aria-busy":r,children:[w,A,j,M,N,P]}),t[53]=r,t[54]=A,t[55]=j,t[56]=M,t[57]=N,t[58]=P,t[59]=w,t[60]=F):F=t[60],F}function Qe(e){let t=(0,Z.c)(38),{item:n,onAction:r,language:i,onUpdated:a}=e,[o,s]=(0,Q.useState)(!1),c;t[0]===n.openAction?c=t[1]:(c=n.openAction?.type===`open`?/^\/tasks\/([^/?#]+)/.exec(n.openAction.href):null,t[0]=n.openAction,t[1]=c);let l=c,u=l?decodeURIComponent(l[1]):void 0,f;t[2]===n.kind?f=t[3]:(f=n.kind===`scheduled`?(0,$.jsx)(d,{className:`size-4`,"aria-hidden":!0}):(0,$.jsx)(`span`,{className:`size-1.5 rounded-full bg-fg-subtle`,"aria-hidden":!0}),t[2]=n.kind,t[3]=f);let m=f,h=!n.openAction,g=u?o:void 0,_;t[4]!==n.id||t[5]!==n.openAction||t[6]!==r||t[7]!==u?(_=()=>u?s($e):n.openAction&&r(n.openAction,n.id),t[4]=n.id,t[5]=n.openAction,t[6]=r,t[7]=u,t[8]=_):_=t[8];let v;t[9]===m?v=t[10]:(v=(0,$.jsx)(`span`,{className:`flex size-7 shrink-0 items-center justify-center text-fg-subtle`,children:m}),t[9]=m,t[10]=v);let y;t[11]===n.title?y=t[12]:(y=(0,$.jsx)(`span`,{className:`block truncate text-sm font-medium text-fg`,children:n.title}),t[11]=n.title,t[12]=y);let b;t[13]===n.summary?b=t[14]:(b=(0,$.jsx)(`span`,{className:`mt-0.5 block truncate text-xs text-fg-muted`,children:n.summary}),t[13]=n.summary,t[14]=b);let x;t[15]!==y||t[16]!==b?(x=(0,$.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[y,b]}),t[15]=y,t[16]=b,t[17]=x):x=t[17];let S;t[18]===n.statusLabel?S=t[19]:(S=n.statusLabel?(0,$.jsx)(`span`,{className:`shrink-0 text-xs text-fg-subtle`,children:n.statusLabel}):null,t[18]=n.statusLabel,t[19]=S);let C;t[20]===n.openAction?C=t[21]:(C=n.openAction?(0,$.jsx)(p,{className:`size-4 shrink-0 text-fg-subtle`,"aria-hidden":!0}):null,t[20]=n.openAction,t[21]=C);let w;t[22]!==S||t[23]!==C||t[24]!==h||t[25]!==g||t[26]!==_||t[27]!==v||t[28]!==x?(w=(0,$.jsxs)(`button`,{type:`button`,className:`flex min-h-16 w-full items-center gap-3 py-3 text-left outline-none hover:text-fg focus-visible:rounded-md focus-visible:ring-2 focus-visible:ring-accent`,disabled:h,"aria-expanded":g,onClick:_,children:[v,x,S,C]}),t[22]=S,t[23]=C,t[24]=h,t[25]=g,t[26]=_,t[27]=v,t[28]=x,t[29]=w):w=t[29];let T;t[30]!==o||t[31]!==i||t[32]!==a||t[33]!==u?(T=u&&o?(0,$.jsx)(Je,{taskId:u,language:i,onUpdated:a,onComplete:()=>s(!1)}):null,t[30]=o,t[31]=i,t[32]=a,t[33]=u,t[34]=T):T=t[34];let E;return t[35]!==w||t[36]!==T?(E=(0,$.jsxs)(`div`,{children:[w,T]}),t[35]=w,t[36]=T,t[37]=E):E=t[37],E}function $e(e){return!e}function et(){let e=l(e=>e.language),t=u(e),n=t.projectsPage,r=G(e),i=c(),o=a(),s=ge(e=>e.setPageHeader),d=ge(e=>e.clearPageHeader),[f,p]=(0,Q.useState)(!1),{home:h,loading:g,loadError:_,setLoadError:v,load:y}=we(e,o.key,f),[x,S]=(0,Q.useState)(!1),[w,T]=(0,Q.useState)(``),E=(0,Q.useRef)(!1),[O,A]=(0,Q.useState)(),[R,z]=(0,Q.useState)(!1),[B,V]=(0,Q.useState)(null),[H,U]=(0,Q.useState)(!1),[K,ee]=(0,Q.useState)(),[ne,ae]=(0,Q.useState)(!1),[Y,ce]=(0,Q.useState)(0),[ue,pe]=(0,Q.useState)(),[_e,be]=(0,Q.useState)(),[xe,Se]=(0,Q.useState)(!1),X=de({chat:t.chat}),Ce=(0,Q.useRef)(null),Z=W({disabled:xe,chat:t.chat,onTranscript:e=>{T(t=>q(t,e)),window.setTimeout(()=>Ce.current?.focus(),0)}}),{phase:Te,voiceActive:De,startVoiceInput:Oe,cancelVoiceInput:ke,confirmVoiceInput:Ae,retryVoiceInput:je}=Z;(0,Q.useEffect)(()=>{if(!ue)return;let e=window.setTimeout(()=>pe(void 0),8e3);return()=>window.clearTimeout(e)},[ue]);let Me=(0,Q.useCallback)(async e=>{if(!(e.length===0||xe)){Se(!0);try{await X.processFiles(e)}finally{Se(!1)}}},[xe,X.processFiles]),Pe=(0,Q.useCallback)(async e=>{let t=J(e.clipboardData);t.length!==0&&(e.preventDefault(),await Me(t))},[Me]),Fe=(0,Q.useCallback)(e=>{e.dataTransfer.types.includes(`Files`)&&(e.preventDefault(),e.dataTransfer.dropEffect=`copy`,X.setIsDragging(!0))},[X.setIsDragging]),Ie=(0,Q.useCallback)(e=>{let t=e.relatedTarget;(!(t instanceof Node)||!e.currentTarget.contains(t))&&X.setIsDragging(!1)},[X.setIsDragging]),Le=(0,Q.useCallback)(async e=>{e.preventDefault(),X.setIsDragging(!1),await Me(Array.from(e.dataTransfer.files))},[X.setIsDragging,Me]),ze=(0,Q.useCallback)(e=>{e.preventDefault();let t=X.wireAttachmentsPayload(),n=t.length>0?te(t):void 0,r=oe(w,n,{projectScope:`none`});r&&(S(!1),T(``),X.clearAttachments(),i(r))},[X.clearAttachments,X.wireAttachmentsPayload,w,i]),Be=X.attachments.length>=10,Ve={attachTitle:Be?Ye(t.chat.maxAttachmentsReached,{max:10}):`${t.chat.attachFile} (${X.attachments.length}/10)`,dropFiles:t.chat.dropFiles,intentLabel:r.intentLabel,intentPlaceholder:r.intentPlaceholder,intentSuggestion:r.intentSuggestion,shortcut:n.home.submitShortcut,submit:r.newWork},He=(0,Q.useMemo)(()=>({label:n.home.advisorStatusLabel,ready:n.home.advisorStatusReady,clarification:n.home.advisorStatusClarification,refreshing:n.home.advisorStatusRefreshing,refreshingDetail:n.home.advisorRefreshing,idle:n.home.advisorStatusIdle,idleDetail:n.home.advisorUnavailableTitle,generationFailed:n.home.advisorStatusGenerationFailed,budgetExhausted:n.home.advisorStatusBudgetExhausted,modelUnavailable:n.home.advisorStatusModelUnavailable,generationFailedDetail:n.home.advisorGenerationFailed,budgetExhaustedDetail:n.home.advisorBudgetExhausted,modelUnavailableDetail:n.home.advisorModelUnavailable,history:n.home.advisorHistory,retry:n.home.retry,findAnother:n.home.advisorRefresh}),[n.home]),We=!!(h&&h.needsUser.length===0&&h.backgroundCount===0),Ke=!!(h&&h.needsUser.length===0),qe=Ke||x;(0,Q.useEffect)(()=>{!qe&&De&&ke()},[ke,qe,De]),(0,Q.useEffect)(()=>{let e=e=>{let t=e.detail?.target;t&&t!==`chat`||!qe||xe||(e.preventDefault(),Te===`recording`?Ae():Te===`idle`?(Ce.current?.focus(),Oe()):Te===`error`&&je())},t=e=>{let t=e.detail?.target;t&&t!==`chat`||!qe||!De||(e.preventDefault(),ke(),Ce.current?.focus())};return window.addEventListener(ye,e),window.addEventListener(ve,t),()=>{window.removeEventListener(ye,e),window.removeEventListener(ve,t)}},[xe,ke,qe,Ae,je,Oe,De,Te]);let Je=(0,Q.useCallback)(e=>{e||ke(),S(e)},[ke]),$e=(0,Q.useCallback)((t,n)=>{if(t.type===`open`){i(b(`/`,t.href));return}t.type===`task_review`||E.current||(E.current=!0,V(n),A(void 0),v(null),(async()=>{try{if(t.type===`retry_task`)await Ge(t.taskId,e),A({message:e===`zh`?`任务已重新开始,可查看执行进度。`:`Task restarted. View progress.`,href:b(`/`,`/tasks/${encodeURIComponent(t.taskId)}`)});else if(t.type===`connector_decision`)await he({kind:`connector_approval`,approvalId:t.approvalId},t.decision),A({message:e===`zh`?t.decision===`approve`?`已批准授权,任务状态将自动更新。`:`已拒绝授权。`:t.decision===`approve`?`Permission approved. Task status will update.`:`Permission denied.`});else if(t.type===`retry_run`){let n=await ie({kind:t.subjectKind,runId:t.runId});A({message:e===`zh`?`已发起重试,可查看新的执行结果。`:`Retry started. Follow the new execution.`,href:n.conversationId?`/chat/${encodeURIComponent(n.conversationId)}`:`/automations?run=${encodeURIComponent(n.runId)}`})}else t.type===`acknowledge_run`&&(await le({kind:t.subjectKind,runId:t.runId}),A({message:e===`zh`?`已确认此异常,已从待处理事项移除。`:`Issue acknowledged and removed from pending items.`}));await y()}catch(e){v(e instanceof Error?e.message:String(e))}finally{E.current=!1,V(null)}})())},[e,y,i]),et=(0,Q.useCallback)(t=>{A({message:e===`zh`?t.task.phase===`closed`?`任务已验收完成。`:`操作已保存,任务状态已更新。`:t.task.phase===`closed`?`Task accepted.`:`Action saved. Task status updated.`,href:b(`/`,`/tasks/${encodeURIComponent(t.task.id)}`)}),y()},[e,y]),tt=(0,Q.useCallback)(()=>{U(!0),ee(void 0),be(void 0),v(null),se(e).then(()=>y()).catch(e=>v(e instanceof Error?e.message:String(e))).finally(()=>U(!1))},[e,y]),nt=(0,Q.useCallback)((e,t)=>{U(!0),v(null),fe(e,t).then(async t=>{if(t.outcome===`needs_setup`){be({opportunityId:e.id,value:t.preflight});return}if(be(void 0),ce(e=>e+1),t.outcome===`task`){ee({title:n.home.advisorStartedTitle,detail:Ye(n.home.advisorStartedDetail,{title:e.title}),href:b(`/`,t.href)}),await y();return}i(t.href)}).catch(e=>v(e instanceof Error?e.message:String(e))).finally(()=>U(!1))},[y,i,n.home.advisorStartedDetail,n.home.advisorStartedTitle]),rt=(0,Q.useCallback)((e,t)=>{U(!0),ee(void 0),be(void 0),v(null),me(e,{kind:t,snoozedUntil:t===`too_early`?Date.now()+4320*6e4:void 0}).then(({idempotencyKey:t})=>(pe({opportunityId:e.id,idempotencyKey:t}),ce(e=>e+1),y())).catch(e=>v(e instanceof Error?e.message:String(e))).finally(()=>U(!1))},[y]),it=(0,Q.useCallback)(()=>{if(!ue)return;let e=ue;pe(void 0),U(!0),v(null),re(e.opportunityId,e.idempotencyKey).then(()=>(ce(e=>e+1),y())).catch(t=>{pe(e),v(t instanceof Error?t.message:String(t))}).finally(()=>U(!1))},[ue,y]),at=(0,Q.useCallback)((e,t)=>{i(`/chat/new?${new URLSearchParams({draft:`${e}\n\n${t}`}).toString()}`)},[i]),ot=(0,Q.useMemo)(()=>(0,$.jsxs)(`div`,{className:`flex items-center gap-1`,children:[h?(0,$.jsx)(Ue,{advisor:h.advisor,busy:H,copy:He,onOpenHistory:()=>ae(!0),onRefresh:tt}):null,Ke?null:(0,$.jsxs)(k,{type:`button`,variant:`primary`,className:`h-9 rounded-lg`,onClick:()=>S(!0),children:[(0,$.jsx)(C,{className:`size-4`,"aria-hidden":!0}),r.newWork]})]}),[H,He,r.newWork,h,tt,Ke]);(0,Q.useLayoutEffect)(()=>(s({startExtra:null,main:(0,$.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:n.title}),end:ot}),()=>d()),[d,ot,s,n.title]);let st=h?.needsUser.length??0,ct=h?.backgroundCount??0,lt=st>0?Ye(n.home.attentionTitle,{count:st}):ct>0?n.home.clearTitle:n.home.idleTitle,ut=st>0?ct>0?Ye(n.home.attentionIntroWithBackground,{count:ct}):n.home.attentionIntro:ct>0?Ye(n.home.clearIntro,{count:ct}):n.home.idleIntro;return(0,$.jsxs)(`main`,{className:`mx-auto flex w-full max-w-[920px] flex-1 flex-col px-4 pb-8 pt-3 sm:px-6 lg:px-8 lg:pb-12 lg:pt-4`,children:[(0,$.jsx)(`input`,{ref:X.fileInputRef,type:`file`,multiple:!0,className:`hidden`,onChange:e=>{let t=e.target.files;t&&Me(Array.from(t)),e.target.value=``}}),(0,$.jsx)(L,{open:x,onOpenChange:Je,children:(0,$.jsxs)(P,{children:[(0,$.jsx)(j,{className:`xopc-dialog-overlay fixed inset-0 z-[80] bg-scrim backdrop-blur-[2px]`}),(0,$.jsxs)(F,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[90] flex h-[min(31rem,calc(100dvh-1.5rem))] w-[min(36rem,calc(100vw-1.5rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay shadow-float focus:outline-none`,children:[(0,$.jsxs)(`div`,{className:`flex shrink-0 items-start gap-4 border-b border-edge px-5 py-4`,children:[(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(I,{className:`text-base font-semibold text-fg`,children:r.dialogTitle}),(0,$.jsx)(M,{className:`mt-1 text-sm leading-5 text-fg-muted`,children:r.dialogDescription})]}),(0,$.jsx)(N,{asChild:!0,children:(0,$.jsx)(k,{type:`button`,variant:`ghost`,className:`-mr-2 -mt-1 size-8 shrink-0 rounded-lg p-0`,title:n.cancel,"aria-label":n.cancel,children:(0,$.jsx)(D,{className:`size-4`,"aria-hidden":!0})})})]}),(0,$.jsx)(Ee,{variant:`dialog`,inputId:`new-conversation-intent`,inputRef:Ce,intent:w,labels:{...Ve,submit:r.submit},attachments:X.attachments,isDragging:X.isDragging,attachmentBusy:xe,attachmentsFull:Be,voice:Z,chat:t.chat,cancelAction:(0,$.jsx)(N,{asChild:!0,children:(0,$.jsx)(k,{type:`button`,variant:`ghost`,children:n.cancel})}),onIntentChange:T,onPickFiles:()=>X.fileInputRef.current?.click(),onRemoveAttachment:X.removeAttachment,onPaste:e=>void Pe(e),onDragOver:Fe,onDragLeave:Ie,onDrop:e=>void Le(e),onSubmit:ze})]})]})}),(0,$.jsx)(Re,{open:ne,refreshKey:Y,onOpenChange:ae,onReevaluate:tt}),_?(0,$.jsxs)(`div`,{role:`alert`,className:`mb-6 flex items-center justify-between gap-3 rounded-xl border border-danger/25 bg-danger-soft px-4 py-3 text-sm text-danger`,children:[(0,$.jsx)(`span`,{children:_}),(0,$.jsx)(k,{type:`button`,variant:`ghost`,className:`h-8 px-2`,onClick:()=>void y(),children:n.home.retry})]}):null,O?(0,$.jsxs)(`div`,{role:`status`,className:`mb-5 flex flex-wrap items-center justify-between gap-3 rounded-xl border border-success/25 bg-success-soft px-4 py-3 text-sm text-fg`,children:[(0,$.jsx)(`span`,{children:O.message}),O.href?(0,$.jsx)(k,{variant:`ghost`,onClick:()=>i(O.href),children:e===`zh`?`查看进展与结果`:`View progress and result`}):null]}):null,g?(0,$.jsx)(Xe,{}):h?(0,$.jsxs)(`div`,{className:We?`mx-auto my-auto w-full max-w-[640px]`:`w-full`,children:[(0,$.jsxs)(`section`,{className:We?`w-full text-center`:`max-w-3xl`,children:[(0,$.jsx)(`h2`,{className:`text-3xl font-semibold leading-tight tracking-[-0.035em] text-fg sm:text-4xl`,children:lt}),(0,$.jsx)(`p`,{className:We?`mx-auto mt-3 max-w-xl text-sm leading-6 text-fg-muted sm:text-base sm:leading-7`:`mt-3 max-w-2xl text-sm leading-6 text-fg-muted sm:text-base sm:leading-7`,children:ut})]}),Ke?(0,$.jsx)(Ee,{variant:`inline`,inputId:`home-conversation-intent`,inputRef:Ce,intent:w,labels:Ve,attachments:X.attachments,isDragging:X.isDragging,attachmentBusy:xe,attachmentsFull:Be,voice:Z,chat:t.chat,onIntentChange:T,onPickFiles:()=>X.fileInputRef.current?.click(),onRemoveAttachment:X.removeAttachment,onPaste:e=>void Pe(e),onDragOver:Fe,onDragLeave:Ie,onDrop:e=>void Le(e),onSubmit:ze}):null,(0,$.jsx)(Ne,{advisor:h.advisor,busy:H,copy:{aiLabel:n.home.advisorAiLabel,why:n.home.advisorWhy,evidence:n.home.advisorEvidence,needsSetup:n.home.advisorNeedsSetup,start:n.home.advisorStart,discuss:n.home.advisorDiscuss,refresh:n.home.advisorRefresh,refreshing:n.home.advisorRefreshing,history:n.home.advisorHistory,viewProgress:n.home.advisorViewProgress,alternatives:n.home.advisorAlternatives,feedback:n.home.advisorFeedback,alreadyDone:n.home.advisorAlreadyDone,irrelevant:n.home.advisorIrrelevant,later:n.home.advisorLater,lessLikeThis:n.home.advisorLessLikeThis,sourceIncorrect:n.home.advisorSourceIncorrect,minutes:n.home.advisorMinutes,setupTitle:n.home.advisorSetupTitle,setupHint:n.home.advisorSetupHint,configure:n.home.advisorConfigure,degradedStart:n.home.advisorDegradedStart,automationHint:n.home.advisorAutomationHint,automationAction:n.home.advisorAutomationAction},onRefresh:tt,onAction:nt,onFeedback:rt,onClarification:at,onOpenHistory:()=>ae(!0),preflight:_e,receipt:K}),h.needsUser.length>0?(0,$.jsxs)(`section`,{className:`mt-10`,"aria-labelledby":`home-needs-user-title`,children:[(0,$.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 px-1`,children:[(0,$.jsx)(m,{className:`size-4 text-warning`,"aria-hidden":!0}),(0,$.jsx)(`h2`,{id:`home-needs-user-title`,className:`text-sm font-semibold text-fg`,children:n.home.needsUserTitle})]}),(0,$.jsx)(`div`,{className:`divide-y divide-edge-subtle overflow-hidden rounded-2xl border border-edge-subtle bg-surface-base`,children:h.needsUser.map(t=>(0,$.jsx)(Ze,{item:t,busy:B!==null,recommendationLabel:n.home.recommendationLabel,dueLabel:n.home.dueLabel,failureLabel:r.runAttention,locale:e,onAction:$e,onComplete:()=>void y(),onUpdated:et},t.id))}),f||(h.attentionPolicy?.suppressedDecisionCount??0)+(h.attentionPolicy?.suppressedAttentionCount??0)>0?(0,$.jsx)(k,{variant:`ghost`,className:`mt-2`,"aria-expanded":f,onClick:()=>p(e=>!e),children:e===`zh`?f?`收起待处理事项`:`查看其余 ${(h.attentionPolicy?.suppressedDecisionCount??0)+(h.attentionPolicy?.suppressedAttentionCount??0)} 项待处理事项`:f?`Show fewer pending items`:`View ${(h.attentionPolicy?.suppressedDecisionCount??0)+(h.attentionPolicy?.suppressedAttentionCount??0)} more pending items`}):null]}):null,h.background.length>0?(0,$.jsxs)(`section`,{className:`mt-10`,"aria-labelledby":`home-background-title`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-1`,children:[(0,$.jsx)(`h2`,{id:`home-background-title`,className:`text-sm font-semibold text-fg`,children:n.home.backgroundTitle}),(0,$.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:Ye(n.home.backgroundCount,{count:h.backgroundCount})})]}),(0,$.jsx)(`div`,{className:`mt-2 divide-y divide-edge-subtle border-y border-edge-subtle`,children:(R?h.background:h.background.slice(0,3)).map(t=>(0,$.jsx)(Qe,{item:t,language:e,onAction:$e,onUpdated:et},t.id))}),h.background.length>3?(0,$.jsx)(k,{variant:`ghost`,className:`mt-2`,"aria-expanded":R,onClick:()=>z(e=>!e),children:e===`zh`?R?`收起`:`查看全部 ${h.backgroundCount} 项`:R?`Show less`:`View all ${h.backgroundCount} items`}):null]}):null]}):null,ue?(0,$.jsxs)(`div`,{role:`status`,className:`fixed bottom-5 left-1/2 z-[100] flex -translate-x-1/2 items-center gap-4 rounded-lg border border-edge bg-surface-overlay px-4 py-3 text-sm text-fg shadow-float`,children:[(0,$.jsx)(`span`,{children:n.home.advisorFeedbackSaved}),(0,$.jsx)(`button`,{type:`button`,className:`font-medium text-accent-fg hover:underline`,onClick:it,children:n.home.advisorUndo})]}):null]})}export{et as HomePage};