@xopcai/xopc 0.0.425 → 0.0.426

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 (208) hide show
  1. package/dist/browser-ext/manifest.json +1 -1
  2. package/dist/extensions/telegram/xopc.extension.json +1 -1
  3. package/dist/gateway/static/root/assets/{activity-store-CMw8qBuC.js → activity-store-D_DXNHba.js} +1 -1
  4. package/dist/gateway/static/root/assets/{agent-avatar-dicebear-JI0YWOIm.js → agent-avatar-dicebear-CjaQxFQt.js} +1 -1
  5. package/dist/gateway/static/root/assets/{agent-avatar-display-YqmwzOSa.js → agent-avatar-display-6Z4m31Fz.js} +2 -2
  6. package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-DlvjxWg6.js → agent-defaults-settings-panel-Dne9A10p.js} +1 -1
  7. package/dist/gateway/static/root/assets/{agent-plugin-dialog-OBueuQSc.js → agent-plugin-dialog-BoHL-b1o.js} +1 -1
  8. package/dist/gateway/static/root/assets/{agents-Cp6_5OOQ.js → agents-CIiIlVBp.js} +3 -3
  9. package/dist/gateway/static/root/assets/{agents-admin-api-DLnmdC1h.js → agents-admin-api-u5c3GREg.js} +1 -1
  10. package/dist/gateway/static/root/assets/{api-Boc-CVh7.js → api-C3Tp9MkF.js} +1 -1
  11. package/dist/gateway/static/root/assets/{api-bL7sxjAF.js → api-CRT9ZyH0.js} +1 -1
  12. package/dist/gateway/static/root/assets/{app-management-settings-panel-jIG5i7KE.js → app-management-settings-panel-C8yc3yHG.js} +1 -1
  13. package/dist/gateway/static/root/assets/{appearance-settings-BnaQW9Xd.js → appearance-settings-BELgtR3O.js} +1 -1
  14. package/dist/gateway/static/root/assets/{apps-page-C2WKUwtN.js → apps-page-vgS1CHDj.js} +1 -1
  15. package/dist/gateway/static/root/assets/{archive-plugin-DjboG3kA.js → archive-plugin-BCQnOkV8.js} +1 -1
  16. package/dist/gateway/static/root/assets/{automation-api-CZqL9l_d.js → automation-api-hRsGx-qe.js} +1 -1
  17. package/dist/gateway/static/root/assets/{automation-result-state-DRd-X_Ai.js → automation-result-state-CMfVTv_i.js} +1 -1
  18. package/dist/gateway/static/root/assets/{automation-task-card-wbnR5i6N.js → automation-task-card-MnzgyTVA.js} +1 -1
  19. package/dist/gateway/static/root/assets/{automations-page-HyBQIfmn.js → automations-page-CdIPdwF0.js} +1 -1
  20. package/dist/gateway/static/root/assets/{automations-workspace-D6cTOKr7.js → automations-workspace-C3xZLafX.js} +2 -2
  21. package/dist/gateway/static/root/assets/{binary-plugins-Bg8ARZUH.js → binary-plugins-CIB5cbvQ.js} +1 -1
  22. package/dist/gateway/static/root/assets/{block-editor-DKohqFAW.js → block-editor-BQtTLe6Q.js} +1 -1
  23. package/dist/gateway/static/root/assets/{browser-automation-inputs-YeibTzw4.js → browser-automation-inputs-DeraGZ1y.js} +1 -1
  24. package/dist/gateway/static/root/assets/{browser-automations-page-BWNcbuz2.js → browser-automations-page-SpPzRNqU.js} +1 -1
  25. package/dist/gateway/static/root/assets/{browser-control-api-CDeuxy2x.js → browser-control-api-CbbPvhHR.js} +1 -1
  26. package/dist/gateway/static/root/assets/{browser-settings-page-L0nBjfhG.js → browser-settings-page-BD1uF_Nb.js} +1 -1
  27. package/dist/gateway/static/root/assets/{capabilities-aT-QjNTl.js → capabilities-BGE6hiUE.js} +1 -1
  28. package/dist/gateway/static/root/assets/{capabilities-BcQa8c9n.js → capabilities-DLMuj21P.js} +1 -1
  29. package/dist/gateway/static/root/assets/{capabilities-page-DlpuHdHi.js → capabilities-page-Bda4mSdf.js} +2 -2
  30. package/dist/gateway/static/root/assets/{capabilities-settings-panel-pvqkN2-2.js → capabilities-settings-panel-B2B7no22.js} +2 -2
  31. package/dist/gateway/static/root/assets/{channels-BUPtawh6.js → channels-NtsjZThx.js} +1 -1
  32. package/dist/gateway/static/root/assets/{chat-agents-api-B8JO6Tcj.js → chat-agents-api-D8YS5amE.js} +1 -1
  33. package/dist/gateway/static/root/assets/{chat-chart-block-DRtuFfF1.js → chat-chart-block-DCzUECct.js} +1 -1
  34. package/dist/gateway/static/root/assets/chat-page-BnOCCAXG.js +72 -0
  35. package/dist/gateway/static/root/assets/{chat-terminal-dock-Dkqq5FSL.js → chat-terminal-dock-Dl-OTkJI.js} +1 -1
  36. package/dist/gateway/static/root/assets/{command-palette-api-qujvNqkK.js → command-palette-api-Dijix7V6.js} +1 -1
  37. package/dist/gateway/static/root/assets/{composer-payload-handoff-CYIhcczq.js → composer-payload-handoff-CQc-VTaL.js} +1 -1
  38. package/dist/gateway/static/root/assets/{computer-settings-page-8q4hRmoo.js → computer-settings-page-B-lGMimW.js} +1 -1
  39. package/dist/gateway/static/root/assets/connected-providers-grid-CcXe9kz5.js +1 -0
  40. package/dist/gateway/static/root/assets/{connector-service-page-DQaTI21R.js → connector-service-page-C8InhrMt.js} +1 -1
  41. package/dist/gateway/static/root/assets/{connectors-api-BjypBp2g.js → connectors-api-DEJU8mgn.js} +1 -1
  42. package/dist/gateway/static/root/assets/{connectors-page-Lf1ZzaVn.js → connectors-page-Ci0L2How.js} +1 -1
  43. package/dist/gateway/static/root/assets/{date-picker-D_PSHGpe.js → date-picker-kqic8j73.js} +1 -1
  44. package/dist/gateway/static/root/assets/{dependency-picker-UqKVJ9dv.js → dependency-picker-cbC6-2Ya.js} +1 -1
  45. package/dist/gateway/static/root/assets/{desktop-pet-1Et9VqkM.js → desktop-pet-DFNehTtd.js} +1 -1
  46. package/dist/gateway/static/root/assets/{desktop-pet-narrative-rADKU0FX.js → desktop-pet-narrative-ChwjpnsG.js} +1 -1
  47. package/dist/gateway/static/root/assets/{desktop-pet-settings-0fCGgaG7.js → desktop-pet-settings-BDS7_tQ_.js} +1 -1
  48. package/dist/gateway/static/root/assets/{dev-view-store-TTj_djD8.js → dev-view-store-CeZZLOc6.js} +1 -1
  49. package/dist/gateway/static/root/assets/{device-pairing-wizard-ByEL5lvM.js → device-pairing-wizard-_3BJFWVQ.js} +1 -1
  50. package/dist/gateway/static/root/assets/{directory-picker-path-field-C07a7wYX.js → directory-picker-path-field-Di0h3ws4.js} +1 -1
  51. package/dist/gateway/static/root/assets/{discussion-annotation-sync-BFqKm9ky.js → discussion-annotation-sync-ClKEyXmN.js} +1 -1
  52. package/dist/gateway/static/root/assets/{extension-debug-page-DFaVlqas.js → extension-debug-page-DwB5KMGk.js} +1 -1
  53. package/dist/gateway/static/root/assets/{extension-iframe-host-BfzPfXBq.js → extension-iframe-host-Cqg1K70e.js} +1 -1
  54. package/dist/gateway/static/root/assets/{extension-marketplace-api-ow0K1Y4_.js → extension-marketplace-api-DRBszrCR.js} +1 -1
  55. package/dist/gateway/static/root/assets/{extension-page-CrDADV5W.js → extension-page-DyrQtG82.js} +1 -1
  56. package/dist/gateway/static/root/assets/{extension-provider-mnRoa63o.js → extension-provider-C_uKqJxP.js} +1 -1
  57. package/dist/gateway/static/root/assets/{extension-settings-page-BLl02GFY.js → extension-settings-page-BAMQHzkX.js} +1 -1
  58. package/dist/gateway/static/root/assets/{file-preview-surface-TGdKqhCf.js → file-preview-surface-DfkXvFnc.js} +1 -1
  59. package/dist/gateway/static/root/assets/{gateway-config-swr-DfPQIHOL.js → gateway-config-swr-BOCt_zOo.js} +1 -1
  60. package/dist/gateway/static/root/assets/{gateway-realtime-67vWg_M2.js → gateway-realtime-BL_Cf0OQ.js} +1 -1
  61. package/dist/gateway/static/root/assets/gateway-realtime-store-BHBOPF_q.js +1 -0
  62. package/dist/gateway/static/root/assets/{gateway-restart-CLtR2wkL.js → gateway-restart-CHf8qY7H.js} +1 -1
  63. package/dist/gateway/static/root/assets/{gateway-settings-COvC3r-l.js → gateway-settings-uAboiElC.js} +1 -1
  64. package/dist/gateway/static/root/assets/{gateway-startup-retry-9YQllbw2.js → gateway-startup-retry-CvkJYurV.js} +1 -1
  65. package/dist/gateway/static/root/assets/{global-defaults-api-DYMRjGvd.js → global-defaults-api-BWMbKu72.js} +1 -1
  66. package/dist/gateway/static/root/assets/{home-page-k9LFXcVa.js → home-page-D6pCBY1V.js} +2 -2
  67. package/dist/gateway/static/root/assets/{image-generation-api-Dzydfvy8.js → image-generation-api-CQxZSTWA.js} +1 -1
  68. package/dist/gateway/static/root/assets/{imports-page-Csd_YZXZ.js → imports-page-C90644id.js} +1 -1
  69. package/dist/gateway/static/root/assets/index-Cc41XQid.css +1 -0
  70. package/dist/gateway/static/root/assets/{index-DKW7BeT_.js → index-CnOYR6jq.js} +5 -5
  71. package/dist/gateway/static/root/assets/{install-connector-dialog-CTQAKTPv.js → install-connector-dialog-BuNXON0P.js} +1 -1
  72. package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-B201bMIa.js → keyboard-shortcuts-settings-CbeubKe1.js} +1 -1
  73. package/dist/gateway/static/root/assets/{local-app-workbench-page-CD_8_gd_.js → local-app-workbench-page-CP-BkbB6.js} +1 -1
  74. package/dist/gateway/static/root/assets/{local-apps-page-BOwqNH0L.js → local-apps-page-C6zFgwkr.js} +1 -1
  75. package/dist/gateway/static/root/assets/{local-session-drafts-DjmK-SM9.js → local-session-drafts-BJ1B1dQ7.js} +1 -1
  76. package/dist/gateway/static/root/assets/{locale-store-Bg_XR36n.js → locale-store-Br7IfbXK.js} +1 -1
  77. package/dist/gateway/static/root/assets/{logs-page-gw3E9CMQ.js → logs-page-CpVCvAWE.js} +1 -1
  78. package/dist/gateway/static/root/assets/{management-settings-t_Z2mCyw.js → management-settings-I-pXv4ML.js} +1 -1
  79. package/dist/gateway/static/root/assets/{markdown-view-BUpXJUPv.js → markdown-view-DrVAMlwc.js} +1 -1
  80. package/dist/gateway/static/root/assets/{media-plugins-_shnaEMY.js → media-plugins-Ba6vUE4J.js} +1 -1
  81. package/dist/gateway/static/root/assets/messages-ByFlEbsu.js +3 -0
  82. package/dist/gateway/static/root/assets/{model-selector-a7PIT1Lk.js → model-selector-CXcxc30J.js} +1 -1
  83. package/dist/gateway/static/root/assets/{models-hub-cache-KOJC3z6Q.js → models-hub-cache-Bd-fYUrV.js} +1 -1
  84. package/dist/gateway/static/root/assets/{note-detail-panel-BsHYUFgk.js → note-detail-panel-CbpLXAVh.js} +3 -3
  85. package/dist/gateway/static/root/assets/note-image-lightbox-cLGiF8oU.js +1 -0
  86. package/dist/gateway/static/root/assets/{notes-api-BSmikUKI.js → notes-api-CUlhTRv0.js} +1 -1
  87. package/dist/gateway/static/root/assets/{notes-page-CA0NRL8O.js → notes-page-eoKX85K5.js} +1 -1
  88. package/dist/gateway/static/root/assets/{oauth-api-D2t9HXoC.js → oauth-api-DMMdeaNd.js} +1 -1
  89. package/dist/gateway/static/root/assets/{oauth-provider-connect-DGGGGtcB.js → oauth-provider-connect-C8BXow79.js} +1 -1
  90. package/dist/gateway/static/root/assets/{page-context-capture-button-BH54VO0V.js → page-context-capture-button-CBFK41OS.js} +1 -1
  91. package/dist/gateway/static/root/assets/{page-context-draft-BS5y8Cx9.js → page-context-draft-LF33STHC.js} +1 -1
  92. package/dist/gateway/static/root/assets/page-header-store-Du44NIEJ.js +1 -0
  93. package/dist/gateway/static/root/assets/{personal-avatar-D8DtpDTa.js → personal-avatar-D6CzIIfo.js} +1 -1
  94. package/dist/gateway/static/root/assets/{personal-page-KJezmTKP.js → personal-page-CXR1Gy0x.js} +1 -1
  95. package/dist/gateway/static/root/assets/{personal-settings-panel-9uDaNJy5.js → personal-settings-panel-DnYapLo7.js} +1 -1
  96. package/dist/gateway/static/root/assets/{phone-dependencies-card-DLYrI0C4.js → phone-dependencies-card-DBiKtzwz.js} +1 -1
  97. package/dist/gateway/static/root/assets/{phone-model-picker-BbA2iI-3.js → phone-model-picker-BmSxEr7M.js} +1 -1
  98. package/dist/gateway/static/root/assets/{phone-settings-page-Cg_BPss4.js → phone-settings-page-vg65qilc.js} +1 -1
  99. package/dist/gateway/static/root/assets/{phone-workspace-store-CVDk80Bf.js → phone-workspace-store-SN7hfddU.js} +1 -1
  100. package/dist/gateway/static/root/assets/{plugin-details-dialog-DgibLkc3.js → plugin-details-dialog-B3Hn2cbx.js} +1 -1
  101. package/dist/gateway/static/root/assets/{preference-select-fields-BVoN-lAv.js → preference-select-fields-Cu_ZC9Up.js} +1 -1
  102. package/dist/gateway/static/root/assets/{product-automation-feedback-DCo90zGh.js → product-automation-feedback-Tn2dUJWM.js} +1 -1
  103. package/dist/gateway/static/root/assets/{product-open-page-OWl8IAoY.js → product-open-page-Nf-Oqf1h.js} +1 -1
  104. package/dist/gateway/static/root/assets/{product-preview-content-Cjas7UNe.js → product-preview-content-D6NwUm3A.js} +1 -1
  105. package/dist/gateway/static/root/assets/{product-preview-modal-CPWRvBI9.js → product-preview-modal-BfNcGgXA.js} +2 -2
  106. package/dist/gateway/static/root/assets/{project-detail-page-B_HlZux_.js → project-detail-page-Ch-ZMyTu.js} +1 -1
  107. package/dist/gateway/static/root/assets/{project-understanding-Ba02SFzB.js → project-understanding-B1BK7Ixi.js} +1 -1
  108. package/dist/gateway/static/root/assets/{projects-page-CdfKjp95.js → projects-page-B7cetxao.js} +1 -1
  109. package/dist/gateway/static/root/assets/{providers-api-rwQ4LWzr.js → providers-api-DOnNfkwQ.js} +1 -1
  110. package/dist/gateway/static/root/assets/{recording-upload-BSmvRrZQ.js → recording-upload-RAhaLUcQ.js} +1 -1
  111. package/dist/gateway/static/root/assets/{registry-api-Vy7LfH6E.js → registry-api-DFDvOTg4.js} +1 -1
  112. package/dist/gateway/static/root/assets/{remote-access-hub-UXrnpGev.js → remote-access-hub-DWsOWetc.js} +1 -1
  113. package/dist/gateway/static/root/assets/{resource-unavailable-f9OzSi4W.js → resource-unavailable-TQcRCpAg.js} +1 -1
  114. package/dist/gateway/static/root/assets/{route-preload-BtObM-co.js → route-preload-Zc5Z3fNv.js} +2 -2
  115. package/dist/gateway/static/root/assets/{runtime-tools-api-Bt8t37z5.js → runtime-tools-api-9o3Wfji1.js} +1 -1
  116. package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-DU4UXnBm.js → runtime-tools-settings-panel-BGiXeHF5.js} +1 -1
  117. package/dist/gateway/static/root/assets/{service-recommendation-list-CuYsRcBB.js → service-recommendation-list-BEnNx0u7.js} +1 -1
  118. package/dist/gateway/static/root/assets/{session-api-DJI9eSgw.js → session-api-Bs3r_d2_.js} +1 -1
  119. package/dist/gateway/static/root/assets/{session-manager-CtKgACGl.js → session-manager-ChUtTAoG.js} +1 -1
  120. package/dist/gateway/static/root/assets/{sessions-page-BAsKzRHt.js → sessions-page-Bt52kBvJ.js} +1 -1
  121. package/dist/gateway/static/root/assets/settings-advanced-gate-BI4DMz4_.js +1 -0
  122. package/dist/gateway/static/root/assets/{settings-advanced-section-BxUuF_yi.js → settings-advanced-section-CURRjsLK.js} +1 -1
  123. package/dist/gateway/static/root/assets/{settings-mode-store-CaoRh2gt.js → settings-mode-store-CiRpsdTJ.js} +1 -1
  124. package/dist/gateway/static/root/assets/{settings-page-qQ8-6dJ_.js → settings-page-GtsbT6as.js} +1 -1
  125. package/dist/gateway/static/root/assets/{settings-page-header-CyUHrn7c.js → settings-page-header-DBL0_u0Z.js} +1 -1
  126. package/dist/gateway/static/root/assets/{settings-page-layout-DGVqXrlp.js → settings-page-layout-IAvpbz4A.js} +1 -1
  127. package/dist/gateway/static/root/assets/{setup-status-panel-BpaPb625.js → setup-status-panel-A6uMpGRy.js} +1 -1
  128. package/dist/gateway/static/root/assets/{share-link-dialog-CQJ6Ykm2.js → share-link-dialog-D1otGSXD.js} +1 -1
  129. package/dist/gateway/static/root/assets/{share-preview-page-Cem96FbB.js → share-preview-page-L9KYu8M7.js} +1 -1
  130. package/dist/gateway/static/root/assets/{shares-api-Dowes16l.js → shares-api-D8Q-m46d.js} +1 -1
  131. package/dist/gateway/static/root/assets/{shares-settings-DZEkZDR0.js → shares-settings-Bmfadz8A.js} +1 -1
  132. package/dist/gateway/static/root/assets/{skill-api-D8ZwFEVe.js → skill-api-uKU4sRiv.js} +1 -1
  133. package/dist/gateway/static/root/assets/{skill-list-api-B4gp00-f.js → skill-list-api-BzKzG-xG.js} +1 -1
  134. package/dist/gateway/static/root/assets/{skill-reload-api-ClmaaDXo.js → skill-reload-api-DkUXekcd.js} +1 -1
  135. package/dist/gateway/static/root/assets/{skills-page-CV0X9rvG.js → skills-page-BZklXTX9.js} +1 -1
  136. package/dist/gateway/static/root/assets/{system-settings-panel-D095uacX.js → system-settings-panel-CsvcFoaJ.js} +1 -1
  137. package/dist/gateway/static/root/assets/task-detail-page-SjZGW1Dx.js +2 -0
  138. package/dist/gateway/static/root/assets/{task-result-evidence-LUrJlUhb.js → task-result-evidence-B8xUiwW3.js} +1 -1
  139. package/dist/gateway/static/root/assets/{terminal-panel-store-BqEDB1Vl.js → terminal-panel-store-DJVC7HqA.js} +1 -1
  140. package/dist/gateway/static/root/assets/{theme-store-gAcojLgP.js → theme-store-Dlnmgryi.js} +1 -1
  141. package/dist/gateway/static/root/assets/tool-friendly-title-DcCc6g7o.js +1 -0
  142. package/dist/gateway/static/root/assets/{tracing-settings-page-B1ZRh-Is.js → tracing-settings-page-MvG4SH64.js} +1 -1
  143. package/dist/gateway/static/root/assets/{tunnel-api-C9u9E3UQ.js → tunnel-api-BB7u79ID.js} +1 -1
  144. package/dist/gateway/static/root/assets/{understanding-activity-store-BTrzsR6_.js → understanding-activity-store-C4bblRnQ.js} +1 -1
  145. package/dist/gateway/static/root/assets/{understanding-refresh-store-5Qava3jh.js → understanding-refresh-store-BvCj9-Ue.js} +1 -1
  146. package/dist/gateway/static/root/assets/{usage-page-DFMLYKAc.js → usage-page-Cv4Je5XJ.js} +1 -1
  147. package/dist/gateway/static/root/assets/{use-autosave-3O-X7x15.js → use-autosave-YHxQ-UZg.js} +1 -1
  148. package/dist/gateway/static/root/assets/{use-composer-attachments-BLc4dBfe.js → use-composer-attachments-vDdxHtUb.js} +1 -1
  149. package/dist/gateway/static/root/assets/{use-file-preview-expanded-BaOmTXsT.js → use-file-preview-expanded-Ce2mgYme.js} +2 -2
  150. package/dist/gateway/static/root/assets/{use-personal-profile-MusPgljM.js → use-personal-profile-D2Un8G1L.js} +1 -1
  151. package/dist/gateway/static/root/assets/{use-workspace-tree-Ck_U2yTw.js → use-workspace-tree-BQEiJzK7.js} +1 -1
  152. package/dist/gateway/static/root/assets/{user-model-page-Den5Lg-k.js → user-model-page-DRSsn4EV.js} +1 -1
  153. package/dist/gateway/static/root/assets/{voice-api-key-field-C5zJApoa.js → voice-api-key-field-DCM69u8Y.js} +1 -1
  154. package/dist/gateway/static/root/assets/{voice-config-api-DC1bYDt1.js → voice-config-api-CrULrSKC.js} +1 -1
  155. package/dist/gateway/static/root/assets/{voice-input-shortcut-events-0SZjJdVV.js → voice-input-shortcut-events-DFMNIyy4.js} +1 -1
  156. package/dist/gateway/static/root/assets/{voice-transcribe-api-CxVeANPX.js → voice-transcribe-api-Bbyj0yGR.js} +1 -1
  157. package/dist/gateway/static/root/assets/{work-discovery-overlay-DAQ8McVe.js → work-discovery-overlay-CVe9UmFl.js} +1 -1
  158. package/dist/gateway/static/root/assets/{work-discovery-page-DUQysEyb.js → work-discovery-page-CtqkRMN5.js} +1 -1
  159. package/dist/gateway/static/root/assets/{working-directory-picker-modal-BO9qdJyZ.js → working-directory-picker-modal-CDZ1xh3o.js} +1 -1
  160. package/dist/gateway/static/root/assets/{workspace-api-ZrN6yUER.js → workspace-api-tbifz2zY.js} +2 -2
  161. package/dist/gateway/static/root/assets/workspace-editor-agent-store-4cZ26iaD.js +1 -0
  162. package/dist/gateway/static/root/assets/{workspace-file-preview-dialog-Yj_kBWSb.js → workspace-file-preview-dialog-BubQwQwU.js} +1 -1
  163. package/dist/gateway/static/root/assets/{workspace-open-location-menu-yxT7wajO.js → workspace-open-location-menu-DZk3MBSa.js} +1 -1
  164. package/dist/gateway/static/root/assets/{xopc-cloud-account-card-IcH9KDzx.js → xopc-cloud-account-card-CIavPUr3.js} +1 -1
  165. package/dist/gateway/static/root/index.html +81 -81
  166. package/dist/package.js +1 -1
  167. package/dist/src/cli/commands/backup.js +1 -1
  168. package/dist/src/config/models-json.d.ts +12 -0
  169. package/dist/src/gateway/global-defaults-admin.js +1 -1
  170. package/dist/src/gateway/hono/routes/phone-setup.js +12 -7
  171. package/dist/src/gateway/hono/routes/phone.js +2 -4
  172. package/dist/src/gateway/service.js +4 -4
  173. package/dist/src/gateway/xopc-cloud-capability-setup.js +9 -1
  174. package/dist/src/home-intelligence/host.js +2 -2
  175. package/dist/src/phone/cloud-adb-connection.js +8 -5
  176. package/dist/src/phone/contracts.d.ts +4 -0
  177. package/dist/src/phone/contracts.js +6 -1
  178. package/dist/src/phone/gui-protocol.d.ts +7 -0
  179. package/dist/src/phone/gui-protocol.js +302 -0
  180. package/dist/src/phone/model-adapter.d.ts +1 -1
  181. package/dist/src/phone/model-adapter.js +7 -4
  182. package/dist/src/phone/runtime.js +8 -2
  183. package/dist/src/phone/ui-dump-binary.d.ts +1 -1
  184. package/dist/src/phone/ui-dump-binary.js +1 -1
  185. package/dist/src/phone/ui-session.d.ts +2 -0
  186. package/dist/src/phone/ui-session.js +23 -4
  187. package/dist/src/providers/env-keys.js +2 -0
  188. package/dist/src/providers/index.js +11 -0
  189. package/dist/src/providers/model-catalog-types.d.ts +1 -1
  190. package/dist/src/providers/model-supplements.d.ts +1 -1
  191. package/dist/src/providers/model-supplements.js +6 -3
  192. package/dist/src/providers/phone-models.d.ts +3 -0
  193. package/dist/src/providers/phone-models.js +33 -0
  194. package/dist/src/providers/presentation.js +0 -1
  195. package/dist/src/tui/tui.js +1 -1
  196. package/dist/src/voice/platform-catalog.d.ts +1 -1
  197. package/package.json +1 -1
  198. package/dist/gateway/static/root/assets/chat-page-BP0huA-W.js +0 -72
  199. package/dist/gateway/static/root/assets/connected-providers-grid-CKZfhHSD.js +0 -1
  200. package/dist/gateway/static/root/assets/gateway-realtime-store-Bkt1z-xo.js +0 -1
  201. package/dist/gateway/static/root/assets/index-CpwPxKQ8.css +0 -1
  202. package/dist/gateway/static/root/assets/messages-DG4HLOER.js +0 -3
  203. package/dist/gateway/static/root/assets/note-image-lightbox-B-bEtjhj.js +0 -1
  204. package/dist/gateway/static/root/assets/page-header-store-BdZnUh-D.js +0 -1
  205. package/dist/gateway/static/root/assets/settings-advanced-gate-CjAFqg2U.js +0 -1
  206. package/dist/gateway/static/root/assets/task-detail-page-CY2C4AM2.js +0 -2
  207. package/dist/gateway/static/root/assets/tool-friendly-title-o6sxGVUu.js +0 -1
  208. package/dist/gateway/static/root/assets/workspace-editor-agent-store-Bo5dwoWP.js +0 -1
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sessions-page-BAsKzRHt.js","assets/rolldown-runtime-aKtaBQYM.js","assets/vendor-react-BOUWij0V.js","assets/chunk-KS7C4IRE-CiwuuyV8.js","assets/preload-helper-Czpn1I53.js","assets/locale-store-Bg_XR36n.js","assets/messages-DG4HLOER.js","assets/session-identity-label-B7sgG1PE.js","assets/createLucideIcon-DPHK1VkS.js","assets/session-channel-icon-SsY70Z6t.js","assets/clock-3-DnrAnuyZ.js","assets/git-branch-Dh9uxTot.js","assets/message-circle-Badhj-4D.js","assets/message-square-fVE7Ghj1.js","assets/plug-DKYPEgkR.js","assets/settings-2-D-csvaET.js","assets/terminal-oKqqZdiG.js","assets/cn-0WouolD0.js","assets/bundle-mjs-rHxsej31.js","assets/schemas-CCWMleym.js","assets/archive-Dz0hferG.js","assets/popover-select-DD8fmrxH.js","assets/check-DUBLcKHA.js","assets/skeleton-BI5TyibZ.js","assets/dist-CaUuvp8-.js","assets/dist-CxGUk8J-.js","assets/es2015-DBLcMg5B.js","assets/dist-DusecO_p.js","assets/floating-ui.dom-seOukHzT.js","assets/settings-shell-dialog-layer-BU3UuiJr.js","assets/circle-BoO4YvTx.js","assets/coins-DjP27vUx.js","assets/database-CjjeZfRG.js","assets/download-Dk-ZjtO6.js","assets/folder-open-CyzJ19I9.js","assets/layers-mJW7JJKm.js","assets/layout-grid-CEVZdVFU.js","assets/minimize-2-DtOGrlpo.js","assets/pin-off-BMRv-Kxr.js","assets/plus-Q2yW6OE7.js","assets/search-DA7gz22f.js","assets/settings-uiTATseT.js","assets/trash-2-DusmjVPV.js","assets/x-B_N4OPjy.js","assets/button-CnRSIP6m.js","assets/dist-DfWfZ9iu.js","assets/vendor-swr-CdRzEUwF.js","assets/session-api-DJI9eSgw.js","assets/gateway-startup-retry-9YQllbw2.js","assets/interaction-BdhHBbYa.js","assets/gateway-config-swr-DfPQIHOL.js","assets/registry-api-Vy7LfH6E.js","assets/form-field-width-DJw_jULe.js","assets/page-tabs-oeTY7z3_.js","assets/sliding-indicator-hwz0sx3h.js","assets/agent-avatar-display-YqmwzOSa.js","assets/loopi-CNtmi9FU.js","assets/loopi-C09I2mNj.css","assets/sliding-tab-list-DuQyViqe.js","assets/chat-agents-api-B8JO6Tcj.js","assets/settings-form-draft-Dy10ldo8.js","assets/model-selector-a7PIT1Lk.js","assets/open-capability-settings-Cvb65hQB.js","assets/segmented-styles-Cqb91xsn.js","assets/settings-advanced-section-BxUuF_yi.js","assets/settings-mode-store-CaoRh2gt.js","assets/middleware-Pd0e8Igk.js","assets/number-input-El7Szeln.js","assets/settings-page-header-CyUHrn7c.js","assets/external-link-DjqjBmc3.js","assets/sparkles-DHlfQFAF.js","assets/settings-page-layout-DGVqXrlp.js","assets/settings-form-section-num14vSv.js","assets/pencil-DmIY3Oa-.js","assets/use-autosave-3O-X7x15.js","assets/circle-alert-BEjgurr2.js","assets/loader-circle-CifKLtgG.js","assets/settings-advanced-gate-CjAFqg2U.js","assets/usage-page-DFMLYKAc.js","assets/bot-DjLkhyZL.js","assets/gauge-C78eD2BA.js","assets/refresh-cw-BRlGaq2w.js","assets/timer-rCwGHjuO.js","assets/xopc-cloud-account-card-IcH9KDzx.js","assets/cloud-C4-yfnnk.js","assets/triangle-alert-2JXFNNKU.js","assets/cloud-credits-B-nbtkqv.js","assets/automations-page-HyBQIfmn.js","assets/automations-workspace-D6cTOKr7.js","assets/activity-YogQEteU.js","assets/calendar-clock-D-quYVPe.js","assets/chevron-down-ccbiQQz_.js","assets/chevron-right-BweFrslA.js","assets/circle-check-C23XjkUj.js","assets/copy-Dv6d4Dvw.js","assets/ellipsis-0k4rZLoy.js","assets/eye-CABVeTq0.js","assets/list-filter-CIPvpfLA.js","assets/list-tree-B0OMswgM.js","assets/markdown-view-BUpXJUPv.js","assets/file-image-CDUPkZvG.js","assets/app-link-1j40sJ-z.js","assets/product-delivery-DRyD9_Xq.js","assets/local-apps-Ck6kACsY.js","assets/copy-to-clipboard-HOJ79TWv.js","assets/xml-_d7dTN2Q.js","assets/mermaid-render-oOellPHt.js","assets/markdown-view-C-DHb3Io.css","assets/pause-DuPxgSxk.js","assets/play-kxZvpBg8.js","assets/shield-check-BU58siTV.js","assets/square-pen-B8FsvqNu.js","assets/zap-dximCGjy.js","assets/session-manager-CtKgACGl.js","assets/gateway-realtime-67vWg_M2.js","assets/gateway-realtime-store-Bkt1z-xo.js","assets/constants-DBtMsXdW.js","assets/local-session-drafts-DjmK-SM9.js","assets/tool-activity-BtJkgjFf.js","assets/personal-proactivity-DaRnbB1f.js","assets/attachment-utils-core-BIOUBrpT.js","assets/agents-admin-api-DLnmdC1h.js","assets/api-Boc-CVh7.js","assets/tasks-DRmd6sWt.js","assets/specialists-xbB3xL9e.js","assets/files-BNL4kkSB.js","assets/page-header-store-BdZnUh-D.js","assets/refresh-button-bU_0NarN.js","assets/dist-D3lWNSe7.js","assets/automation-task-card-wbnR5i6N.js","assets/date-picker-D_PSHGpe.js","assets/calendar-days-hw_Y-g-s.js","assets/chevron-left-DqFhpbvK.js","assets/automation-api-CZqL9l_d.js","assets/agent-display-names-Bje7vfSn.js","assets/automation-result-state-DRd-X_Ai.js","assets/browser-automation-inputs-YeibTzw4.js","assets/browser-automations-page-BWNcbuz2.js","assets/circle-pause-CN9jYH2s.js","assets/video-B6V0GFss.js","assets/earth-BMhZtzcj.js","assets/puzzle-BptcPjKI.js","assets/square-DMK_fB-3.js","assets/browser-control-api-CDeuxy2x.js","assets/home-page-k9LFXcVa.js","assets/history-DXH_9jsE.js","assets/paperclip-f1HujQY1.js","assets/composer-payload-handoff-CYIhcczq.js","assets/use-file-preview-expanded-BaOmTXsT.js","assets/app-window-DXFNqt_0.js","assets/message-square-plus-XP0tGdlV.js","assets/rotate-cw-LIg3Am9S.js","assets/save-DRDABU--.js","assets/activity-store-CMw8qBuC.js","assets/app-chrome-BeB4KgOf.js","assets/electron-env-DHOGevH3.js","assets/use-async-resource-BHFGZCY2.js","assets/index.module-Cd9ENXfk.js","assets/workspace-api-ZrN6yUER.js","assets/mic-CuUb7zc-.js","assets/rotate-ccw-JM1TBLpp.js","assets/file-preview-surface-TGdKqhCf.js","assets/phone-workspace-store-CVDk80Bf.js","assets/shares-api-Dowes16l.js","assets/voice-transcribe-api-CxVeANPX.js","assets/workspace-editor-agent-store-Bo5dwoWP.js","assets/voice-input-shortcut-events-0SZjJdVV.js","assets/use-composer-attachments-BLc4dBfe.js","assets/file-BqMS_3DT.js","assets/share-link-dialog-CQJ6Ykm2.js","assets/globe-DSSGFWFn.js","assets/copy-text-row-CYIv7RfP.js","assets/capabilities-aT-QjNTl.js","assets/capabilities-BcQa8c9n.js","assets/skill-wire-pattern-BPpeIcCi.js","assets/date-formatters-DukWSVwc.js","assets/tab-completion-input-CxtEp0aP.js","assets/task-result-evidence-LUrJlUhb.js","assets/file-text-D12HbeVy.js","assets/task-detail-page-CY2C4AM2.js","assets/chat-page-BP0huA-W.js","assets/arrow-left-D880xG-P.js","assets/arrow-up-D5ZtR1QT.js","assets/product-automation-feedback-DCo90zGh.js","assets/notes-api-BSmikUKI.js","assets/chat-chart-block-DRtuFfF1.js","assets/volume-2-BSJhAY97.js","assets/book-open-CCGtrT3R.js","assets/working-directory-picker-modal-BO9qdJyZ.js","assets/file-archive-DanfQJNe.js","assets/send-1f1Ntw6E.js","assets/circle-x-DFsCKeya.js","assets/file-tree-utils-DJs1faGv.js","assets/folder-kanban-CpLlFI1o.js","assets/folder-CN-pC3XL.js","assets/key-round-DWbpyU2U.js","assets/laptop-CI3hBVrl.js","assets/list-checks-BbsExAoq.js","assets/list-todo-CTVRto8O.js","assets/messages-square-BckAJrEW.js","assets/monitor-Af5eAvF7.js","assets/install-connector-dialog-CTQAKTPv.js","assets/secret-input-BQvFXqzz.js","assets/is-masked-secret-DOkL5b_X.js","assets/connectors-api-BjypBp2g.js","assets/oauth-provider-connect-DGGGGtcB.js","assets/models-hub-cache-KOJC3z6Q.js","assets/oauth-api-D2t9HXoC.js","assets/smartphone-DSSsQFqA.js","assets/wrench-DFb4r8bH.js","assets/new-session-preferences-gb411vZP.js","assets/extension-provider-mnRoa63o.js","assets/theme-store-gAcojLgP.js","assets/chunk-D32TOXHM-DQIy-Baq.js","assets/tool-friendly-title-o6sxGVUu.js","assets/voice-call-context-BM2A4bLz.js","assets/use-directory-picker-C4p7AgWY.js","assets/confirm-dialog-XGclfBqe.js","assets/command-palette-api-qujvNqkK.js","assets/skill-list-api-B4gp00-f.js","assets/skill-api-utils-C7V4JVXM.js","assets/dev-view-store-TTj_djD8.js","assets/extension-iframe-host-BfzPfXBq.js","assets/api-bL7sxjAF.js","assets/runtime-health-D2TDFLLq.js","assets/terminal-panel-store-BqEDB1Vl.js","assets/agents-app-path-ciChvpCS.js","assets/use-media-query-ady-FgjK.js","assets/oauth-authorization-window-o6URRos4.js","assets/page-context-draft-BS5y8Cx9.js","assets/side-chat-shortcut-BIw-1TTD.js","assets/chat-page-zQeUaawJ.css","assets/page-context-capture-button-BH54VO0V.js","assets/dependency-picker-UqKVJ9dv.js","assets/projects-page-CdfKjp95.js","assets/arrow-right-DSSvoX71.js","assets/project-understanding-Ba02SFzB.js","assets/project-detail-page-B_HlZux_.js","assets/resource-unavailable-f9OzSi4W.js","assets/discussion-annotation-sync-BFqKm9ky.js","assets/workspace-open-location-menu-yxT7wajO.js","assets/file-tree-CFlZnV3Y.js","assets/image-Cwyalflz.js","assets/lock-keyhole-DEK5kH0u.js","assets/panel-left-C8MqSXRZ.js","assets/sticky-note-fzP7NAJq.js","assets/store-SzD1Jvgm.js","assets/upload-rrb46c3c.js","assets/user-round-C9jxPhMR.js","assets/workspace-file-preview-dialog-Yj_kBWSb.js","assets/with-selector-xonYxPoM.js","assets/directory-picker-path-field-C07a7wYX.js","assets/skill-api-D8ZwFEVe.js","assets/skill-reload-api-ClmaaDXo.js","assets/note-detail-panel-BsHYUFgk.js","assets/code-xml-DJtYhZUF.js","assets/note-image-lightbox-B-bEtjhj.js","assets/project-detail-page-DLioOiRN.css","assets/notes-page-CA0NRL8O.js","assets/recording-upload-BSmvRrZQ.js","assets/star-BUWJqJ5c.js","assets/capabilities-page-DlpuHdHi.js","assets/product-navigation-Co8pLbDP.js","assets/capability-links-DzQWK1Fh.js","assets/capability-header-actions-CTUCuBlW.js","assets/user-model-page-Den5Lg-k.js","assets/understanding-refresh-store-5Qava3jh.js","assets/briefcase-business-BsoCaI_t.js","assets/understanding-activity-store-BTrzsR6_.js","assets/sliders-horizontal-DqsYor6I.js","assets/logs-page-gw3E9CMQ.js","assets/clipboard-copy-DuJk5WD6.js","assets/settings-page-qQ8-6dJ_.js","assets/browser-settings-page-L0nBjfhG.js","assets/cpu-B247669f.js","assets/info-CDrmIZhb.js","assets/plug-zap-L8NMe3Sv.js","assets/settings-loading-skeleton-BTqvr_Fw.js","assets/phone-settings-page-Cg_BPss4.js","assets/beta-badge-BnzdzIEl.js","assets/global-defaults-api-DYMRjGvd.js","assets/providers-api-rwQ4LWzr.js","assets/mobile-pair-qr-CuIbmw5x.js","assets/browser-BLJWD7WI.js","assets/phone-model-picker-BbA2iI-3.js","assets/phone-dependencies-card-DLYrI0C4.js","assets/runtime-tools-api-Bt8t37z5.js","assets/computer-settings-page-8q4hRmoo.js","assets/mouse-pointer-2-DZ51Onvj.js","assets/extension-page-CrDADV5W.js","assets/extension-settings-page-BLl02GFY.js","assets/voice-config-api-DC1bYDt1.js","assets/voice-api-key-field-C5zJApoa.js","assets/schema-form-BKeP5G7b.js","assets/secret-input-labels-B5Jl5HqK.js","assets/extension-debug-page-DFaVlqas.js","assets/share-preview-page-Cem96FbB.js","assets/local-apps-page-BOwqNH0L.js","assets/box-DvYoGszj.js","assets/local-app-workbench-page-CD_8_gd_.js","assets/power-off-CwwQ7Gp7.js","assets/power-ZI-pBczI.js","assets/product-open-page-OWl8IAoY.js","assets/open-route-MyZ2sB9C.js","assets/work-discovery-page-DUQysEyb.js","assets/service-recommendation-list-CuYsRcBB.js","assets/package-wATCyihJ.js","assets/agent-plugin-dialog-OBueuQSc.js","assets/capability-icon-DVoZxEgW.js","assets/extension-marketplace-api-ow0K1Y4_.js","assets/work-discovery-overlay-DAQ8McVe.js","assets/brand-logo-CgT9zQfr.js","assets/setup-status-panel-BpaPb625.js","assets/stethoscope-DRqTAtjD.js","assets/appearance-settings-BnaQW9Xd.js","assets/preference-select-fields-BVoN-lAv.js","assets/keyboard-shortcuts-settings-B201bMIa.js","assets/personal-settings-panel-9uDaNJy5.js","assets/use-personal-profile-MusPgljM.js","assets/system-settings-panel-D095uacX.js","assets/browser-notification-delivery-DmE2FgGc.js","assets/shield-B1sI_cxl.js","assets/desktop-pet-settings-0fCGgaG7.js","assets/wand-sparkles-CkSL-3Fy.js","assets/desktop-pet-sprite-D5YYq2zC.js","assets/desktop-pet-sprite-BuB0g8zv.css","assets/app-management-settings-panel-jIG5i7KE.js","assets/capabilities-settings-panel-pvqkN2-2.js","assets/arrow-up-right-T72JbQ1Q.js","assets/connected-providers-grid-CKZfhHSD.js","assets/navigation-D62kPsA9.js","assets/image-generation-api-Dzydfvy8.js","assets/gateway-settings-COvC3r-l.js","assets/network-BUQLY1BV.js","assets/gateway-restart-CLtR2wkL.js","assets/runtime-tools-settings-panel-DU4UXnBm.js","assets/remote-access-hub-UXrnpGev.js","assets/server-BlHCBjiE.js","assets/tunnel-api-C9u9E3UQ.js","assets/shares-settings-DZEkZDR0.js","assets/use-workspace-tree-Ck_U2yTw.js","assets/agent-defaults-settings-panel-DlvjxWg6.js","assets/management-settings-t_Z2mCyw.js","assets/shield-off-2jsucUds.js","assets/device-pairing-wizard-ByEL5lvM.js","assets/panel-right-CFGrHTsD.js"])))=>i.map(i=>d[i]);
2
- import{t as e}from"./preload-helper-Czpn1I53.js";var t=()=>e(()=>import(`./sessions-page-BAsKzRHt.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77])),n=()=>e(()=>import(`./usage-page-DFMLYKAc.js`),__vite__mapDeps([78,1,2,3,4,5,6,79,8,21,22,17,18,23,24,25,26,27,28,29,75,31,32,80,81,82,44,46,58,54,68,69,70,71,83,84,85,86,19])),r=()=>e(()=>import(`./automations-page-HyBQIfmn.js`),__vite__mapDeps([87,2,1,88,4,3,5,6,89,8,90,22,91,92,21,17,18,23,24,25,26,27,28,29,75,93,94,95,96,11,97,98,99,33,100,39,43,45,101,102,19,103,104,105,106,107,12,108,73,109,81,40,110,70,111,42,112,44,46,113,114,115,116,47,48,117,118,119,120,51,121,50,122,123,124,125,126,58,54,59,127,128,61,15,62,49,52,129,10,130,131,132,133,134,135,136])),i=()=>e(()=>import(`./browser-automations-page-BWNcbuz2.js`),__vite__mapDeps([137,1,2,3,4,5,6,79,8,21,22,17,18,23,24,25,26,27,28,29,138,139,10,140,76,73,109,141,142,42,43,44,126,143,136])),a=()=>e(()=>import(`./home-page-k9LFXcVa.js`),__vite__mapDeps([144,1,2,4,3,5,6,90,8,91,92,75,93,10,69,145,99,33,100,39,43,17,18,45,25,26,101,102,19,103,104,105,106,107,12,146,81,15,70,44,23,24,27,28,123,124,147,22,148,149,94,95,96,34,76,150,37,73,151,152,40,116,47,48,49,153,120,154,155,156,58,54,157,158,125,128,159,160,161,162,163,164,113,114,115,117,118,119,51,121,50,46,66,62,165,166,167,132,168,169,21,29,170,171,172,173,174,126,175,176,177,178])),o=()=>e(()=>import(`./task-detail-page-CY2C4AM2.js`),__vite__mapDeps([179,1,2,3,4,5,6,180,8,149,20,181,182,183,89,79,93,138,10,69,184,99,33,100,39,43,17,18,45,25,26,101,102,19,103,104,105,106,107,185,22,94,23,76,13,108,109,160,151,70,85,186,112,44,46,133,187,91,92,188,189,49,52,60,21,24,27,28,29,75,190,191,30,192,32,140,95,168,178,193,34,194,148,96,150,37,146,73,81,152,40,116,47,48,153,120,154,155,156,58,54,157,158,125,128,11,170,145,195,196,197,198,199,159,200,201,202,203,204,50,205,84,206,51,207,15,41,110,208,142,42,169,171,209,161,162,163,113,114,115,117,118,119,121,66,123,124,122,210,211,172,212,147,164,62,165,166,167,132,173,174,213,214,215,126,56,57,55,59,216,217,218,219,220,61,221,222,129,90,12,130,131,223,224,225,226,134,227,228,229,230,231,175,177,232,233])),s=()=>e(()=>import(`./projects-page-CdfKjp95.js`),__vite__mapDeps([234,1,2,3,4,5,6,20,8,235,188,189,76,17,18,44,25,45,26,49,52,60,21,22,23,24,27,28,29,193,34,38,39,160,40,43,122,19,123,124,125,126,236,46,216,175])),c=()=>e(()=>import(`./project-detail-page-B_HlZux_.js`),__vite__mapDeps([237,1,2,3,4,5,6,238,20,8,239,91,44,17,18,25,181,235,183,89,79,93,138,10,69,184,99,33,100,39,43,45,26,101,102,19,103,104,105,106,107,185,22,94,23,76,13,108,109,160,151,70,85,186,112,46,133,90,132,92,188,189,49,52,60,21,24,27,28,29,75,190,30,192,240,34,148,149,95,96,150,37,146,73,81,152,40,116,47,48,153,120,154,155,156,58,54,157,158,125,128,241,168,178,194,11,145,242,36,197,243,159,244,38,41,110,142,245,246,42,247,248,123,124,122,167,169,170,171,161,162,163,172,117,173,174,121,50,53,126,236,217,127,249,212,66,218,219,220,130,131,134,250,74,175,251,216,252,253,88,97,98,12,111,113,114,115,118,119,51,59,61,15,62,129,135,136,232,229,254,255,205,84,206,207,256,233,257])),l=()=>e(()=>import(`./notes-page-CA0NRL8O.js`),__vite__mapDeps([258,1,2,3,4,5,6,20,8,239,91,44,17,18,25,181,235,182,183,89,79,93,138,10,69,184,99,33,100,39,43,45,26,101,102,19,103,104,105,106,107,185,22,94,23,76,13,108,109,160,151,70,85,186,112,46,133,131,21,24,27,28,29,95,178,194,259,159,146,40,260,42,247,154,126,58,54,157,217,128,254,255,96,145,12,73,81,111,142,113,114,115,116,47,48,117,118,119,120,51,121,50,212,66,163,205,84,155,206,207,229,256,232,173,172,123,124])),u=()=>e(()=>import(`./capabilities-page-DlpuHdHi.js`),__vite__mapDeps([261,1,2,4,3,5,6,262,23,17,18,126,263,264,40,8,44,25,24,26,27,28,227])),d=()=>e(()=>import(`./user-model-page-Den5Lg-k.js`),__vite__mapDeps([265,1,2,3,4,5,6,187,8,79,266,46,267,131,22,91,92,21,17,18,23,24,25,26,27,28,29,75,93,10,32,33,140,95,268,34,11,198,76,243,12,73,39,81,40,110,269,70,245,42,247,248,43,44,45,154,53,49,54,126,56,57,58,128,130,132])),f=()=>e(()=>import(`./logs-page-gw3E9CMQ.js`),__vite__mapDeps([270,1,2,3,4,5,6,91,8,21,22,17,18,23,24,25,26,27,28,29,271,33,178,194,80,97,81,40,16,43,44,45,114,19,115,47,48,104,52,54,127,63,68,69,70,71])),p=()=>e(()=>import(`./settings-page-qQ8-6dJ_.js`),__vite__mapDeps([272,1,2,3,4,5,6])),m=()=>e(()=>import(`./browser-settings-page-L0nBjfhG.js`),__vite__mapDeps([273,1,2,3,4,5,6,91,8,21,22,17,18,23,24,25,26,27,28,29,93,274,33,69,96,34,80,170,275,76,243,276,81,15,85,44,46,50,60,277,67,68,70,71,74,75,143])),h=()=>e(()=>import(`./phone-settings-page-Cg_BPss4.js`),__vite__mapDeps([278,1,2,3,4,5,6,149,8,181,91,21,22,17,18,23,24,25,26,27,28,29,279,109,39,81,40,110,208,43,44,162,45,46,62,128,280,50,281,51,48,203,206,68,69,70,282,283,284,285,93,33,209,286])),g=()=>e(()=>import(`./computer-settings-page-8q4hRmoo.js`),__vite__mapDeps([287,1,2,3,4,5,6,22,8,170,200,288,39,110,142,44,17,18,25,23,46,50,51,48,155,61,21,24,26,27,28,29,15,62,49,52,280,68,69,70,71])),_=()=>e(()=>import(`./extension-page-CrDADV5W.js`),__vite__mapDeps([289,1,2,3,4,238,5,6,211,46,113,19,114,115,116,47,48,117,118,119,120,51,121,50,172,123,124,103,153,212,66,126,222,45,25,26,60])),v=()=>e(()=>import(`./extension-settings-page-BLl02GFY.js`),__vite__mapDeps([290,1,2,3,4,5,6,238,21,8,22,17,18,23,24,25,26,27,28,29,44,46,211,113,19,114,115,116,47,48,117,118,119,120,51,121,50,172,123,124,103,153,212,66,52,222,45,60,277,68,69,70,71,74,75,76,291,292,202,93,94,96,104,49,203,293,294,67])),y=()=>e(()=>import(`./extension-debug-page-DFaVlqas.js`),__vite__mapDeps([295,1,2,5,6,211,46,113,19,114,115,116,47,48,117,118,119,120,51,4,121,50,172,123,124,103,153,212,66,68,3,69,8,70,17,18,44,25,71])),b=()=>e(()=>import(`./share-preview-page-Cem96FbB.js`),__vite__mapDeps([296,1,2,4,3,5,6,148,8,149,22,91,94,33,95,69,96,34,76,99,100,39,43,17,18,45,25,26,101,102,19,103,104,105,106,107,150,37,146,73,81,151,152,40,23,116,47,48,49,153,120,154,155,156,58,54,157,158,125,128,27,28,44,185])),x=()=>e(()=>import(`./local-apps-page-BOwqNH0L.js`),__vite__mapDeps([297,1,2,3,4,5,6,235,8,298,39,44,17,18,25,23,46,126,223])),S=()=>e(()=>import(`./local-app-workbench-page-CD_8_gd_.js`),__vite__mapDeps([299,1,2,3,4,5,6,238,181,8,22,93,191,10,69,300,193,145,76,244,301,81,160,110,70,42,85,43,44,17,18,25,23,45,26,46,103,19,122,123,124,125,126,223,224,175,176,232,178,113,114,115,116,47,48,117,118,119,120,51,121,50,173,172,229])),C=()=>e(()=>import(`./product-open-page-OWl8IAoY.js`),__vite__mapDeps([302,2,1,3,4,5,6,23,17,18,46,102,19,103,223,303])),w=()=>e(()=>import(`./work-discovery-page-DUQysEyb.js`).then(e=>e.n),__vite__mapDeps([304,1,2,3,4,5,6,8,305,91,188,189,76,17,18,44,25,45,26,49,52,60,201,21,22,23,24,27,28,29,93,69,202,94,96,104,203,43,204,50,46,155,205,84,206,51,48,207,306,39,307,181,75,30,34,110,247,263,283,308,309,131,92,10,32,268,178,11,198,199,276,70,56,57,216])),T=()=>e(()=>import(`./work-discovery-overlay-DAQ8McVe.js`),__vite__mapDeps([310,1,2,5,6,304,3,4,8,305,91,188,189,76,17,18,44,25,45,26,49,52,60,201,21,22,23,24,27,28,29,93,69,202,94,96,104,203,43,204,50,46,155,205,84,206,51,48,207,306,39,307,181,75,30,34,110,247,263,283,308,309,131,92,10,32,268,178,11,198,199,276,70,56,57,216,311])),E=()=>e(()=>import(`./setup-status-panel-BpaPb625.js`),__vite__mapDeps([312,1,2,3,4,5,6,89,8,92,93,191,30,275,76,81,313,85,17,18,44,25,23,46,49,50,115,51,48,203,155,219,220,277,281,206,68,69,70,71,72,73,77,65,66,286])),D=()=>e(()=>import(`./appearance-settings-BnaQW9Xd.js`),__vite__mapDeps([314,1,2,5,6,21,8,22,17,18,23,24,25,26,27,28,29,49,50,46,315,66,52,212,221,68,3,4,69,70,44,71,77,65])),O=()=>e(()=>import(`./keyboard-shortcuts-settings-B201bMIa.js`),__vite__mapDeps([316,1,2,5,6,17,18,155,166,66,230,68,3,4,69,8,70,44,25,71])),k=()=>e(()=>import(`./personal-settings-panel-9uDaNJy5.js`),__vite__mapDeps([317,1,2,5,6,21,8,22,17,18,23,24,25,26,27,28,29,119,19,318,46,68,3,4,69,70,44,71])),A=()=>e(()=>import(`./system-settings-panel-D095uacX.js`),__vite__mapDeps([319,1,2,5,6,320,8,155,69,81,321,17,18,49,60,68,3,4,70,44,25,71,72,73])),j=()=>e(()=>import(`./desktop-pet-settings-0fCGgaG7.js`),__vite__mapDeps([322,1,2,3,4,5,6,238,91,8,21,22,17,18,23,24,25,26,27,28,29,75,69,150,323,160,49,155,127,81,44,324,325,68,70,71])),M=()=>e(()=>import(`./app-management-settings-panel-jIG5i7KE.js`),__vite__mapDeps([326,1,2,5,6,94,8,76,306,17,18,44,25,23,45,26,29,46,104,49,155,60,277,68,3,4,69,70,71,72,73])),N=()=>e(()=>import(`./capabilities-settings-panel-pvqkN2-2.js`),__vite__mapDeps([327,1,2,4,3,5,6,235,8,328,92,21,22,17,18,23,24,25,26,27,28,29,93,329,132,202,94,96,76,104,49,52,203,170,39,40,15,43,44,45,46,50,51,48,294,58,54,206,281,205,84,155,207,69,242,195,159,73,109,14,81,110,269,142,42,85,186,209,19,164,113,114,115,116,47,117,118,119,120,121,66,62,215,330,60,217,61,226,280,277,64,65,228,67,68,70,71,72,74,75,291,292,331,83,86])),P=()=>e(()=>import(`./gateway-settings-COvC3r-l.js`),__vite__mapDeps([332,1,2,3,4,5,6,21,8,22,17,18,23,24,25,26,27,28,29,75,202,93,94,96,76,104,49,52,203,275,195,333,81,151,334,155,110,321,269,85,44,46,50,294,330,53,54,60,217,45,65,66,277,64,67,68,69,70,71,72,73,77])),F=()=>e(()=>import(`./runtime-tools-settings-panel-DU4UXnBm.js`),__vite__mapDeps([335,1,2,5,6,21,8,22,17,18,23,24,25,26,27,28,29,75,93,33,160,44,46,127,81,277,68,3,4,69,70,71,77,65,66,286,285,91,209])),I=()=>e(()=>import(`./remote-access-hub-UXrnpGev.js`),__vite__mapDeps([336,1,2,3,4,5,6,235,8,22,91,92,30,94,69,202,93,96,76,17,18,104,49,52,203,170,195,333,301,337,321,208,16,85,44,25,45,26,29,46,50,53,54,60,217,171,27,28,65,66,281,51,48,206,207,155,64,228,68,70,71,72,73,338,23,330,77])),L=()=>e(()=>import(`./shares-settings-DZEkZDR0.js`),__vite__mapDeps([339,1,2,3,4,5,6,22,8,91,21,17,18,23,24,25,26,27,28,29,192,84,94,241,92,95,189,168,100,178,34,194,49,155,145,76,13,39,81,245,42,169,69,170,43,44,45,171,104,46,50,121,52,53,54,60,217,163,340,158,125,19,165,134,277,205,93,206,51,48,207,67,68,70,71,72,73])),R=()=>e(()=>import(`./agent-defaults-settings-panel-DlvjxWg6.js`),__vite__mapDeps([341,1,2,3,4,5,6,93,8,80,197,141,40,110,269,17,18,44,25,23,46,86,19,155,58,54,219,220,65,66,280,50,64,67,68,69,70,71,74,22,75,76])),z=()=>e(()=>import(`./management-settings-t_Z2mCyw.js`),__vite__mapDeps([342,1,2,3,4,5,6,89,8,132,92,21,22,17,18,23,24,25,26,27,28,29,196,343,39,40,208,43,44,45,46,47,19,48,53,49,54,157,217,127,81,277,68,69,70,71,344,93,10,33,345,101,102,103,156,171,94,104,207,155,228,338,170,76,301,50,52,330,72,73,282,283])),B=new Set;function V(e){B.has(e)||(B.add(e),e().catch(()=>{B.delete(e)}))}function H(e){let[t]=e.split(/[?#]/,1);return t||`/`}function U(e){V(p);let t=e.slice(10);if(t===`overview`)return V(E);if(t===`appearance`)return V(D);if(t===`keyboard-shortcuts`)return V(O);if(t===`personal`)return V(k);if(t===`system`)return V(A);if(t===`desktop-pet`)return V(j);if(t===`desktop-app`)return V(M);if(t.startsWith(`capabilities/`))return V(N);if(t===`gateway`)return V(P);if(t===`runtimes`)return V(F);if(t===`devices`)return V(z);if(t===`tunnel`||t===`remote-access`)return V(I);if(t===`shares`)return V(L);if(t===`agent-defaults`)return V(R);if(t===`agent-browser`)return V(m);if(t===`phone-use`)return V(h);if(t===`computer-use`)return V(g)}function W(e){if(!e.startsWith(`/`))return;let p=H(e);if(p===`/capabilities`||p.startsWith(`/capabilities/`))return V(u);if(p===`/user-model`)return V(d);if(p===`/automations`)return V(r);if(p===`/browser-automations`)return V(i);if(p===`/`)return V(a);if(p.startsWith(`/tasks/`))return V(o);if(p===`/projects`)return V(s);if(p.startsWith(`/projects/`))return V(c);if(p===`/notes`||p.startsWith(`/notes/`))return V(l);if(p.startsWith(`/extensions/`))return V(_);if(p===`/local-apps`)return V(x);if(p.startsWith(`/local-apps/`))return V(S);if(p===`/open`)return V(C);if(p===`/onboarding/workspace`)return V(w);if(p.startsWith(`/share/`))return V(b);if(p===`/settings/sessions`)return V(t);if(p===`/settings/usage`)return V(n);if(p===`/settings/logs`)return V(f);if(p===`/settings/extensions/debug`)return V(y);if(p.startsWith(`/settings/ext/`))return V(v);if(p.startsWith(`/settings/`))return U(p)}export{E as A,C,F as D,I as E,n as F,d as I,T as L,L as M,A as N,t as O,o as P,w as R,h as S,s as T,S as _,r as a,l as b,g as c,y as d,_ as f,O as g,a as h,D as i,b as j,p as k,j as l,P as m,R as n,i as o,v as p,M as r,N as s,m as t,z as u,x as v,c as w,k as x,f as y,W as z};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sessions-page-Bt52kBvJ.js","assets/rolldown-runtime-aKtaBQYM.js","assets/vendor-react-BOUWij0V.js","assets/chunk-KS7C4IRE-CiwuuyV8.js","assets/preload-helper-Czpn1I53.js","assets/locale-store-Br7IfbXK.js","assets/messages-ByFlEbsu.js","assets/session-identity-label-B7sgG1PE.js","assets/createLucideIcon-DPHK1VkS.js","assets/session-channel-icon-SsY70Z6t.js","assets/clock-3-DnrAnuyZ.js","assets/git-branch-Dh9uxTot.js","assets/message-circle-Badhj-4D.js","assets/message-square-fVE7Ghj1.js","assets/plug-DKYPEgkR.js","assets/settings-2-D-csvaET.js","assets/terminal-oKqqZdiG.js","assets/cn-0WouolD0.js","assets/bundle-mjs-rHxsej31.js","assets/schemas-CCWMleym.js","assets/archive-Dz0hferG.js","assets/popover-select-DD8fmrxH.js","assets/check-DUBLcKHA.js","assets/skeleton-BI5TyibZ.js","assets/dist-CaUuvp8-.js","assets/dist-CxGUk8J-.js","assets/es2015-DBLcMg5B.js","assets/dist-DusecO_p.js","assets/floating-ui.dom-seOukHzT.js","assets/settings-shell-dialog-layer-BU3UuiJr.js","assets/circle-BoO4YvTx.js","assets/coins-DjP27vUx.js","assets/database-CjjeZfRG.js","assets/download-Dk-ZjtO6.js","assets/folder-open-CyzJ19I9.js","assets/layers-mJW7JJKm.js","assets/layout-grid-CEVZdVFU.js","assets/minimize-2-DtOGrlpo.js","assets/pin-off-BMRv-Kxr.js","assets/plus-Q2yW6OE7.js","assets/search-DA7gz22f.js","assets/settings-uiTATseT.js","assets/trash-2-DusmjVPV.js","assets/x-B_N4OPjy.js","assets/button-CnRSIP6m.js","assets/dist-DfWfZ9iu.js","assets/vendor-swr-CdRzEUwF.js","assets/session-api-Bs3r_d2_.js","assets/gateway-startup-retry-CvkJYurV.js","assets/interaction-BdhHBbYa.js","assets/gateway-config-swr-BOCt_zOo.js","assets/registry-api-DFDvOTg4.js","assets/form-field-width-DJw_jULe.js","assets/page-tabs-oeTY7z3_.js","assets/sliding-indicator-hwz0sx3h.js","assets/agent-avatar-display-6Z4m31Fz.js","assets/loopi-CNtmi9FU.js","assets/loopi-C09I2mNj.css","assets/sliding-tab-list-DuQyViqe.js","assets/chat-agents-api-D8YS5amE.js","assets/settings-form-draft-Dy10ldo8.js","assets/model-selector-CXcxc30J.js","assets/open-capability-settings-Cvb65hQB.js","assets/segmented-styles-Cqb91xsn.js","assets/settings-advanced-section-CURRjsLK.js","assets/settings-mode-store-CiRpsdTJ.js","assets/middleware-Pd0e8Igk.js","assets/number-input-El7Szeln.js","assets/settings-page-header-DBL0_u0Z.js","assets/external-link-DjqjBmc3.js","assets/sparkles-DHlfQFAF.js","assets/settings-page-layout-IAvpbz4A.js","assets/settings-form-section-num14vSv.js","assets/pencil-DmIY3Oa-.js","assets/use-autosave-YHxQ-UZg.js","assets/circle-alert-BEjgurr2.js","assets/loader-circle-CifKLtgG.js","assets/settings-advanced-gate-BI4DMz4_.js","assets/usage-page-Cv4Je5XJ.js","assets/bot-DjLkhyZL.js","assets/gauge-C78eD2BA.js","assets/refresh-cw-BRlGaq2w.js","assets/timer-rCwGHjuO.js","assets/xopc-cloud-account-card-CIavPUr3.js","assets/cloud-C4-yfnnk.js","assets/triangle-alert-2JXFNNKU.js","assets/cloud-credits-B-nbtkqv.js","assets/automations-page-CdIPdwF0.js","assets/automations-workspace-C3xZLafX.js","assets/activity-YogQEteU.js","assets/calendar-clock-D-quYVPe.js","assets/chevron-down-ccbiQQz_.js","assets/chevron-right-BweFrslA.js","assets/circle-check-C23XjkUj.js","assets/copy-Dv6d4Dvw.js","assets/ellipsis-0k4rZLoy.js","assets/eye-CABVeTq0.js","assets/list-filter-CIPvpfLA.js","assets/list-tree-B0OMswgM.js","assets/markdown-view-DrVAMlwc.js","assets/file-image-CDUPkZvG.js","assets/app-link-1j40sJ-z.js","assets/product-delivery-DRyD9_Xq.js","assets/local-apps-Ck6kACsY.js","assets/copy-to-clipboard-HOJ79TWv.js","assets/xml-_d7dTN2Q.js","assets/mermaid-render-oOellPHt.js","assets/markdown-view-C-DHb3Io.css","assets/pause-DuPxgSxk.js","assets/play-kxZvpBg8.js","assets/shield-check-BU58siTV.js","assets/square-pen-B8FsvqNu.js","assets/zap-dximCGjy.js","assets/session-manager-ChUtTAoG.js","assets/gateway-realtime-BL_Cf0OQ.js","assets/gateway-realtime-store-BHBOPF_q.js","assets/constants-DBtMsXdW.js","assets/local-session-drafts-BJ1B1dQ7.js","assets/tool-activity-BtJkgjFf.js","assets/personal-proactivity-DaRnbB1f.js","assets/attachment-utils-core-BIOUBrpT.js","assets/agents-admin-api-u5c3GREg.js","assets/api-C3Tp9MkF.js","assets/tasks-DRmd6sWt.js","assets/specialists-xbB3xL9e.js","assets/files-BNL4kkSB.js","assets/page-header-store-Du44NIEJ.js","assets/refresh-button-bU_0NarN.js","assets/dist-D3lWNSe7.js","assets/automation-task-card-MnzgyTVA.js","assets/date-picker-kqic8j73.js","assets/calendar-days-hw_Y-g-s.js","assets/chevron-left-DqFhpbvK.js","assets/automation-api-hRsGx-qe.js","assets/agent-display-names-Bje7vfSn.js","assets/automation-result-state-CMfVTv_i.js","assets/browser-automation-inputs-DeraGZ1y.js","assets/browser-automations-page-SpPzRNqU.js","assets/circle-pause-CN9jYH2s.js","assets/video-B6V0GFss.js","assets/earth-BMhZtzcj.js","assets/puzzle-BptcPjKI.js","assets/square-DMK_fB-3.js","assets/browser-control-api-CbbPvhHR.js","assets/home-page-D6pCBY1V.js","assets/history-DXH_9jsE.js","assets/paperclip-f1HujQY1.js","assets/composer-payload-handoff-CQc-VTaL.js","assets/use-file-preview-expanded-Ce2mgYme.js","assets/app-window-DXFNqt_0.js","assets/message-square-plus-XP0tGdlV.js","assets/rotate-cw-LIg3Am9S.js","assets/save-DRDABU--.js","assets/activity-store-D_DXNHba.js","assets/app-chrome-BeB4KgOf.js","assets/electron-env-DHOGevH3.js","assets/use-async-resource-BHFGZCY2.js","assets/index.module-Cd9ENXfk.js","assets/workspace-api-tbifz2zY.js","assets/mic-CuUb7zc-.js","assets/rotate-ccw-JM1TBLpp.js","assets/file-preview-surface-DfkXvFnc.js","assets/phone-workspace-store-SN7hfddU.js","assets/shares-api-D8Q-m46d.js","assets/voice-transcribe-api-Bbyj0yGR.js","assets/workspace-editor-agent-store-4cZ26iaD.js","assets/voice-input-shortcut-events-DFMNIyy4.js","assets/use-composer-attachments-vDdxHtUb.js","assets/file-BqMS_3DT.js","assets/share-link-dialog-D1otGSXD.js","assets/globe-DSSGFWFn.js","assets/copy-text-row-CYIv7RfP.js","assets/capabilities-BGE6hiUE.js","assets/capabilities-DLMuj21P.js","assets/skill-wire-pattern-BPpeIcCi.js","assets/date-formatters-DukWSVwc.js","assets/tab-completion-input-CxtEp0aP.js","assets/task-result-evidence-B8xUiwW3.js","assets/file-text-D12HbeVy.js","assets/task-detail-page-SjZGW1Dx.js","assets/chat-page-BnOCCAXG.js","assets/arrow-left-D880xG-P.js","assets/arrow-up-D5ZtR1QT.js","assets/product-automation-feedback-Tn2dUJWM.js","assets/notes-api-CUlhTRv0.js","assets/chat-chart-block-DCzUECct.js","assets/volume-2-BSJhAY97.js","assets/book-open-CCGtrT3R.js","assets/working-directory-picker-modal-CDZ1xh3o.js","assets/file-archive-DanfQJNe.js","assets/send-1f1Ntw6E.js","assets/circle-x-DFsCKeya.js","assets/file-tree-utils-DJs1faGv.js","assets/folder-kanban-CpLlFI1o.js","assets/folder-CN-pC3XL.js","assets/key-round-DWbpyU2U.js","assets/laptop-CI3hBVrl.js","assets/list-checks-BbsExAoq.js","assets/list-todo-CTVRto8O.js","assets/messages-square-BckAJrEW.js","assets/monitor-Af5eAvF7.js","assets/install-connector-dialog-BuNXON0P.js","assets/secret-input-BQvFXqzz.js","assets/is-masked-secret-DOkL5b_X.js","assets/connectors-api-DEJU8mgn.js","assets/oauth-provider-connect-C8BXow79.js","assets/models-hub-cache-Bd-fYUrV.js","assets/oauth-api-DMMdeaNd.js","assets/smartphone-DSSsQFqA.js","assets/wrench-DFb4r8bH.js","assets/new-session-preferences-gb411vZP.js","assets/extension-provider-C_uKqJxP.js","assets/theme-store-Dlnmgryi.js","assets/chunk-D32TOXHM-DQIy-Baq.js","assets/tool-friendly-title-DcCc6g7o.js","assets/voice-call-context-BM2A4bLz.js","assets/use-directory-picker-C4p7AgWY.js","assets/confirm-dialog-XGclfBqe.js","assets/command-palette-api-Dijix7V6.js","assets/skill-list-api-BzKzG-xG.js","assets/skill-api-utils-C7V4JVXM.js","assets/dev-view-store-CeZZLOc6.js","assets/extension-iframe-host-Cqg1K70e.js","assets/api-CRT9ZyH0.js","assets/runtime-health-D2TDFLLq.js","assets/terminal-panel-store-DJVC7HqA.js","assets/agents-app-path-ciChvpCS.js","assets/use-media-query-ady-FgjK.js","assets/oauth-authorization-window-o6URRos4.js","assets/page-context-draft-LF33STHC.js","assets/side-chat-shortcut-BIw-1TTD.js","assets/chat-page-zQeUaawJ.css","assets/page-context-capture-button-CBFK41OS.js","assets/dependency-picker-cbC6-2Ya.js","assets/projects-page-B7cetxao.js","assets/arrow-right-DSSvoX71.js","assets/project-understanding-B1BK7Ixi.js","assets/project-detail-page-Ch-ZMyTu.js","assets/resource-unavailable-TQcRCpAg.js","assets/discussion-annotation-sync-ClKEyXmN.js","assets/workspace-open-location-menu-DZk3MBSa.js","assets/file-tree-CFlZnV3Y.js","assets/image-Cwyalflz.js","assets/lock-keyhole-DEK5kH0u.js","assets/panel-left-C8MqSXRZ.js","assets/sticky-note-fzP7NAJq.js","assets/store-SzD1Jvgm.js","assets/upload-rrb46c3c.js","assets/user-round-C9jxPhMR.js","assets/workspace-file-preview-dialog-BubQwQwU.js","assets/with-selector-xonYxPoM.js","assets/directory-picker-path-field-Di0h3ws4.js","assets/skill-api-uKU4sRiv.js","assets/skill-reload-api-DkUXekcd.js","assets/note-detail-panel-CbpLXAVh.js","assets/code-xml-DJtYhZUF.js","assets/note-image-lightbox-cLGiF8oU.js","assets/project-detail-page-DLioOiRN.css","assets/notes-page-eoKX85K5.js","assets/recording-upload-RAhaLUcQ.js","assets/star-BUWJqJ5c.js","assets/capabilities-page-Bda4mSdf.js","assets/product-navigation-Co8pLbDP.js","assets/capability-links-DzQWK1Fh.js","assets/capability-header-actions-CTUCuBlW.js","assets/user-model-page-DRSsn4EV.js","assets/understanding-refresh-store-BvCj9-Ue.js","assets/briefcase-business-BsoCaI_t.js","assets/understanding-activity-store-C4bblRnQ.js","assets/sliders-horizontal-DqsYor6I.js","assets/logs-page-CpVCvAWE.js","assets/clipboard-copy-DuJk5WD6.js","assets/settings-page-GtsbT6as.js","assets/browser-settings-page-BD1uF_Nb.js","assets/cpu-B247669f.js","assets/info-CDrmIZhb.js","assets/plug-zap-L8NMe3Sv.js","assets/settings-loading-skeleton-BTqvr_Fw.js","assets/phone-settings-page-vg65qilc.js","assets/beta-badge-BnzdzIEl.js","assets/global-defaults-api-BWMbKu72.js","assets/providers-api-DOnNfkwQ.js","assets/mobile-pair-qr-CuIbmw5x.js","assets/browser-BLJWD7WI.js","assets/phone-model-picker-BmSxEr7M.js","assets/phone-dependencies-card-DBiKtzwz.js","assets/runtime-tools-api-9o3Wfji1.js","assets/computer-settings-page-B-lGMimW.js","assets/mouse-pointer-2-DZ51Onvj.js","assets/extension-page-DyrQtG82.js","assets/extension-settings-page-BAMQHzkX.js","assets/voice-config-api-CrULrSKC.js","assets/voice-api-key-field-DCM69u8Y.js","assets/schema-form-BKeP5G7b.js","assets/secret-input-labels-B5Jl5HqK.js","assets/extension-debug-page-DwB5KMGk.js","assets/share-preview-page-L9KYu8M7.js","assets/local-apps-page-C6zFgwkr.js","assets/box-DvYoGszj.js","assets/local-app-workbench-page-CP-BkbB6.js","assets/power-off-CwwQ7Gp7.js","assets/power-ZI-pBczI.js","assets/product-open-page-Nf-Oqf1h.js","assets/open-route-MyZ2sB9C.js","assets/work-discovery-page-CtqkRMN5.js","assets/service-recommendation-list-BEnNx0u7.js","assets/package-wATCyihJ.js","assets/agent-plugin-dialog-BoHL-b1o.js","assets/capability-icon-DVoZxEgW.js","assets/extension-marketplace-api-DRBszrCR.js","assets/work-discovery-overlay-CVe9UmFl.js","assets/brand-logo-CgT9zQfr.js","assets/setup-status-panel-A6uMpGRy.js","assets/stethoscope-DRqTAtjD.js","assets/appearance-settings-BELgtR3O.js","assets/preference-select-fields-Cu_ZC9Up.js","assets/keyboard-shortcuts-settings-CbeubKe1.js","assets/personal-settings-panel-DnYapLo7.js","assets/use-personal-profile-D2Un8G1L.js","assets/system-settings-panel-CsvcFoaJ.js","assets/browser-notification-delivery-DmE2FgGc.js","assets/shield-B1sI_cxl.js","assets/desktop-pet-settings-BDS7_tQ_.js","assets/wand-sparkles-CkSL-3Fy.js","assets/desktop-pet-sprite-D5YYq2zC.js","assets/desktop-pet-sprite-BuB0g8zv.css","assets/app-management-settings-panel-C8yc3yHG.js","assets/capabilities-settings-panel-B2B7no22.js","assets/arrow-up-right-T72JbQ1Q.js","assets/connected-providers-grid-CcXe9kz5.js","assets/navigation-D62kPsA9.js","assets/image-generation-api-CQxZSTWA.js","assets/gateway-settings-uAboiElC.js","assets/network-BUQLY1BV.js","assets/gateway-restart-CHf8qY7H.js","assets/runtime-tools-settings-panel-BGiXeHF5.js","assets/remote-access-hub-DWsOWetc.js","assets/server-BlHCBjiE.js","assets/tunnel-api-BB7u79ID.js","assets/shares-settings-Bmfadz8A.js","assets/use-workspace-tree-BQEiJzK7.js","assets/agent-defaults-settings-panel-Dne9A10p.js","assets/management-settings-I-pXv4ML.js","assets/shield-off-2jsucUds.js","assets/device-pairing-wizard-_3BJFWVQ.js","assets/panel-right-CFGrHTsD.js"])))=>i.map(i=>d[i]);
2
+ import{t as e}from"./preload-helper-Czpn1I53.js";var t=()=>e(()=>import(`./sessions-page-Bt52kBvJ.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77])),n=()=>e(()=>import(`./usage-page-Cv4Je5XJ.js`),__vite__mapDeps([78,1,2,3,4,5,6,79,8,21,22,17,18,23,24,25,26,27,28,29,75,31,32,80,81,82,44,46,58,54,68,69,70,71,83,84,85,86,19])),r=()=>e(()=>import(`./automations-page-CdIPdwF0.js`),__vite__mapDeps([87,2,1,88,4,3,5,6,89,8,90,22,91,92,21,17,18,23,24,25,26,27,28,29,75,93,94,95,96,11,97,98,99,33,100,39,43,45,101,102,19,103,104,105,106,107,12,108,73,109,81,40,110,70,111,42,112,44,46,113,114,115,116,47,48,117,118,119,120,51,121,50,122,123,124,125,126,58,54,59,127,128,61,15,62,49,52,129,10,130,131,132,133,134,135,136])),i=()=>e(()=>import(`./browser-automations-page-SpPzRNqU.js`),__vite__mapDeps([137,1,2,3,4,5,6,79,8,21,22,17,18,23,24,25,26,27,28,29,138,139,10,140,76,73,109,141,142,42,43,44,126,143,136])),a=()=>e(()=>import(`./home-page-D6pCBY1V.js`),__vite__mapDeps([144,1,2,4,3,5,6,90,8,91,92,75,93,10,69,145,99,33,100,39,43,17,18,45,25,26,101,102,19,103,104,105,106,107,12,146,81,15,70,44,23,24,27,28,123,124,147,22,148,149,94,95,96,34,76,150,37,73,151,152,40,116,47,48,49,153,120,154,155,156,58,54,157,158,125,128,159,160,161,162,163,164,113,114,115,117,118,119,51,121,50,46,66,62,165,166,167,132,168,169,21,29,170,171,172,173,174,126,175,176,177,178])),o=()=>e(()=>import(`./task-detail-page-SjZGW1Dx.js`),__vite__mapDeps([179,1,2,3,4,5,6,180,8,149,20,181,182,183,89,79,93,138,10,69,184,99,33,100,39,43,17,18,45,25,26,101,102,19,103,104,105,106,107,185,22,94,23,76,13,108,109,160,151,70,85,186,112,44,46,133,187,91,92,188,189,49,52,60,21,24,27,28,29,75,190,191,30,192,32,140,95,168,178,193,34,194,148,96,150,37,146,73,81,152,40,116,47,48,153,120,154,155,156,58,54,157,158,125,128,11,170,145,195,196,197,198,199,159,200,201,202,203,204,50,205,84,206,51,207,15,41,110,208,142,42,169,171,209,161,162,163,113,114,115,117,118,119,121,66,123,124,122,210,211,172,212,147,164,62,165,166,167,132,173,174,213,214,215,126,56,57,55,59,216,217,218,219,220,61,221,222,129,90,12,130,131,223,224,225,226,134,227,228,229,230,231,175,177,232,233])),s=()=>e(()=>import(`./projects-page-B7cetxao.js`),__vite__mapDeps([234,1,2,3,4,5,6,20,8,235,188,189,76,17,18,44,25,45,26,49,52,60,21,22,23,24,27,28,29,193,34,38,39,160,40,43,122,19,123,124,125,126,236,46,216,175])),c=()=>e(()=>import(`./project-detail-page-Ch-ZMyTu.js`),__vite__mapDeps([237,1,2,3,4,5,6,238,20,8,239,91,44,17,18,25,181,235,183,89,79,93,138,10,69,184,99,33,100,39,43,45,26,101,102,19,103,104,105,106,107,185,22,94,23,76,13,108,109,160,151,70,85,186,112,46,133,90,132,92,188,189,49,52,60,21,24,27,28,29,75,190,30,192,240,34,148,149,95,96,150,37,146,73,81,152,40,116,47,48,153,120,154,155,156,58,54,157,158,125,128,241,168,178,194,11,145,242,36,197,243,159,244,38,41,110,142,245,246,42,247,248,123,124,122,167,169,170,171,161,162,163,172,117,173,174,121,50,53,126,236,217,127,249,212,66,218,219,220,130,131,134,250,74,175,251,216,252,253,88,97,98,12,111,113,114,115,118,119,51,59,61,15,62,129,135,136,232,229,254,255,205,84,206,207,256,233,257])),l=()=>e(()=>import(`./notes-page-eoKX85K5.js`),__vite__mapDeps([258,1,2,3,4,5,6,20,8,239,91,44,17,18,25,181,235,182,183,89,79,93,138,10,69,184,99,33,100,39,43,45,26,101,102,19,103,104,105,106,107,185,22,94,23,76,13,108,109,160,151,70,85,186,112,46,133,131,21,24,27,28,29,95,178,194,259,159,146,40,260,42,247,154,126,58,54,157,217,128,254,255,96,145,12,73,81,111,142,113,114,115,116,47,48,117,118,119,120,51,121,50,212,66,163,205,84,155,206,207,229,256,232,173,172,123,124])),u=()=>e(()=>import(`./capabilities-page-Bda4mSdf.js`),__vite__mapDeps([261,1,2,4,3,5,6,262,23,17,18,126,263,264,40,8,44,25,24,26,27,28,227])),d=()=>e(()=>import(`./user-model-page-DRSsn4EV.js`),__vite__mapDeps([265,1,2,3,4,5,6,187,8,79,266,46,267,131,22,91,92,21,17,18,23,24,25,26,27,28,29,75,93,10,32,33,140,95,268,34,11,198,76,243,12,73,39,81,40,110,269,70,245,42,247,248,43,44,45,154,53,49,54,126,56,57,58,128,130,132])),f=()=>e(()=>import(`./logs-page-CpVCvAWE.js`),__vite__mapDeps([270,1,2,3,4,5,6,91,8,21,22,17,18,23,24,25,26,27,28,29,271,33,178,194,80,97,81,40,16,43,44,45,114,19,115,47,48,104,52,54,127,63,68,69,70,71])),p=()=>e(()=>import(`./settings-page-GtsbT6as.js`),__vite__mapDeps([272,1,2,3,4,5,6])),m=()=>e(()=>import(`./browser-settings-page-BD1uF_Nb.js`),__vite__mapDeps([273,1,2,3,4,5,6,91,8,21,22,17,18,23,24,25,26,27,28,29,93,274,33,69,96,34,80,170,275,76,243,276,81,15,85,44,46,50,60,277,67,68,70,71,74,75,143])),h=()=>e(()=>import(`./phone-settings-page-vg65qilc.js`),__vite__mapDeps([278,1,2,3,4,5,6,149,8,181,91,21,22,17,18,23,24,25,26,27,28,29,279,109,39,81,40,110,208,43,44,162,45,46,62,128,280,50,281,51,48,203,206,68,69,70,282,283,284,285,93,33,209,286])),g=()=>e(()=>import(`./computer-settings-page-B-lGMimW.js`),__vite__mapDeps([287,1,2,3,4,5,6,22,8,170,200,288,39,110,142,44,17,18,25,23,46,50,51,48,155,61,21,24,26,27,28,29,15,62,49,52,280,68,69,70,71])),_=()=>e(()=>import(`./extension-page-DyrQtG82.js`),__vite__mapDeps([289,1,2,3,4,238,5,6,211,46,113,19,114,115,116,47,48,117,118,119,120,51,121,50,172,123,124,103,153,212,66,126,222,45,25,26,60])),v=()=>e(()=>import(`./extension-settings-page-BAMQHzkX.js`),__vite__mapDeps([290,1,2,3,4,5,6,238,21,8,22,17,18,23,24,25,26,27,28,29,44,46,211,113,19,114,115,116,47,48,117,118,119,120,51,121,50,172,123,124,103,153,212,66,52,222,45,60,277,68,69,70,71,74,75,76,291,292,202,93,94,96,104,49,203,293,294,67])),y=()=>e(()=>import(`./extension-debug-page-DwB5KMGk.js`),__vite__mapDeps([295,1,2,5,6,211,46,113,19,114,115,116,47,48,117,118,119,120,51,4,121,50,172,123,124,103,153,212,66,68,3,69,8,70,17,18,44,25,71])),b=()=>e(()=>import(`./share-preview-page-L9KYu8M7.js`),__vite__mapDeps([296,1,2,4,3,5,6,148,8,149,22,91,94,33,95,69,96,34,76,99,100,39,43,17,18,45,25,26,101,102,19,103,104,105,106,107,150,37,146,73,81,151,152,40,23,116,47,48,49,153,120,154,155,156,58,54,157,158,125,128,27,28,44,185])),x=()=>e(()=>import(`./local-apps-page-C6zFgwkr.js`),__vite__mapDeps([297,1,2,3,4,5,6,235,8,298,39,44,17,18,25,23,46,126,223])),S=()=>e(()=>import(`./local-app-workbench-page-CP-BkbB6.js`),__vite__mapDeps([299,1,2,3,4,5,6,238,181,8,22,93,191,10,69,300,193,145,76,244,301,81,160,110,70,42,85,43,44,17,18,25,23,45,26,46,103,19,122,123,124,125,126,223,224,175,176,232,178,113,114,115,116,47,48,117,118,119,120,51,121,50,173,172,229])),C=()=>e(()=>import(`./product-open-page-Nf-Oqf1h.js`),__vite__mapDeps([302,2,1,3,4,5,6,23,17,18,46,102,19,103,223,303])),w=()=>e(()=>import(`./work-discovery-page-CtqkRMN5.js`).then(e=>e.n),__vite__mapDeps([304,1,2,3,4,5,6,8,305,91,188,189,76,17,18,44,25,45,26,49,52,60,201,21,22,23,24,27,28,29,93,69,202,94,96,104,203,43,204,50,46,155,205,84,206,51,48,207,306,39,307,181,75,30,34,110,247,263,283,308,309,131,92,10,32,268,178,11,198,199,276,70,56,57,216])),T=()=>e(()=>import(`./work-discovery-overlay-CVe9UmFl.js`),__vite__mapDeps([310,1,2,5,6,304,3,4,8,305,91,188,189,76,17,18,44,25,45,26,49,52,60,201,21,22,23,24,27,28,29,93,69,202,94,96,104,203,43,204,50,46,155,205,84,206,51,48,207,306,39,307,181,75,30,34,110,247,263,283,308,309,131,92,10,32,268,178,11,198,199,276,70,56,57,216,311])),E=()=>e(()=>import(`./setup-status-panel-A6uMpGRy.js`),__vite__mapDeps([312,1,2,3,4,5,6,89,8,92,93,191,30,275,76,81,313,85,17,18,44,25,23,46,49,50,115,51,48,203,155,219,220,277,281,206,68,69,70,71,72,73,77,65,66,286])),D=()=>e(()=>import(`./appearance-settings-BELgtR3O.js`),__vite__mapDeps([314,1,2,5,6,21,8,22,17,18,23,24,25,26,27,28,29,49,50,46,315,66,52,212,221,68,3,4,69,70,44,71,77,65])),O=()=>e(()=>import(`./keyboard-shortcuts-settings-CbeubKe1.js`),__vite__mapDeps([316,1,2,5,6,17,18,155,166,66,230,68,3,4,69,8,70,44,25,71])),k=()=>e(()=>import(`./personal-settings-panel-DnYapLo7.js`),__vite__mapDeps([317,1,2,5,6,21,8,22,17,18,23,24,25,26,27,28,29,119,19,318,46,68,3,4,69,70,44,71])),A=()=>e(()=>import(`./system-settings-panel-CsvcFoaJ.js`),__vite__mapDeps([319,1,2,5,6,320,8,155,69,81,321,17,18,49,60,68,3,4,70,44,25,71,72,73])),j=()=>e(()=>import(`./desktop-pet-settings-BDS7_tQ_.js`),__vite__mapDeps([322,1,2,3,4,5,6,238,91,8,21,22,17,18,23,24,25,26,27,28,29,75,69,150,323,160,49,155,127,81,44,324,325,68,70,71])),M=()=>e(()=>import(`./app-management-settings-panel-C8yc3yHG.js`),__vite__mapDeps([326,1,2,5,6,94,8,76,306,17,18,44,25,23,45,26,29,46,104,49,155,60,277,68,3,4,69,70,71,72,73])),N=()=>e(()=>import(`./capabilities-settings-panel-B2B7no22.js`),__vite__mapDeps([327,1,2,4,3,5,6,235,8,328,92,21,22,17,18,23,24,25,26,27,28,29,93,329,132,202,94,96,76,104,49,52,203,170,39,40,15,43,44,45,46,50,51,48,294,58,54,206,281,205,84,155,207,69,242,195,159,73,109,14,81,110,269,142,42,85,186,209,19,164,113,114,115,116,47,117,118,119,120,121,66,62,215,330,60,217,61,226,280,277,64,65,228,67,68,70,71,72,74,75,291,292,331,83,86])),P=()=>e(()=>import(`./gateway-settings-uAboiElC.js`),__vite__mapDeps([332,1,2,3,4,5,6,21,8,22,17,18,23,24,25,26,27,28,29,75,202,93,94,96,76,104,49,52,203,275,195,333,81,151,334,155,110,321,269,85,44,46,50,294,330,53,54,60,217,45,65,66,277,64,67,68,69,70,71,72,73,77])),F=()=>e(()=>import(`./runtime-tools-settings-panel-BGiXeHF5.js`),__vite__mapDeps([335,1,2,5,6,21,8,22,17,18,23,24,25,26,27,28,29,75,93,33,160,44,46,127,81,277,68,3,4,69,70,71,77,65,66,286,285,91,209])),I=()=>e(()=>import(`./remote-access-hub-DWsOWetc.js`),__vite__mapDeps([336,1,2,3,4,5,6,235,8,22,91,92,30,94,69,202,93,96,76,17,18,104,49,52,203,170,195,333,301,337,321,208,16,85,44,25,45,26,29,46,50,53,54,60,217,171,27,28,65,66,281,51,48,206,207,155,64,228,68,70,71,72,73,338,23,330,77])),L=()=>e(()=>import(`./shares-settings-Bmfadz8A.js`),__vite__mapDeps([339,1,2,3,4,5,6,22,8,91,21,17,18,23,24,25,26,27,28,29,192,84,94,241,92,95,189,168,100,178,34,194,49,155,145,76,13,39,81,245,42,169,69,170,43,44,45,171,104,46,50,121,52,53,54,60,217,163,340,158,125,19,165,134,277,205,93,206,51,48,207,67,68,70,71,72,73])),R=()=>e(()=>import(`./agent-defaults-settings-panel-Dne9A10p.js`),__vite__mapDeps([341,1,2,3,4,5,6,93,8,80,197,141,40,110,269,17,18,44,25,23,46,86,19,155,58,54,219,220,65,66,280,50,64,67,68,69,70,71,74,22,75,76])),z=()=>e(()=>import(`./management-settings-I-pXv4ML.js`),__vite__mapDeps([342,1,2,3,4,5,6,89,8,132,92,21,22,17,18,23,24,25,26,27,28,29,196,343,39,40,208,43,44,45,46,47,19,48,53,49,54,157,217,127,81,277,68,69,70,71,344,93,10,33,345,101,102,103,156,171,94,104,207,155,228,338,170,76,301,50,52,330,72,73,282,283])),B=new Set;function V(e){B.has(e)||(B.add(e),e().catch(()=>{B.delete(e)}))}function H(e){let[t]=e.split(/[?#]/,1);return t||`/`}function U(e){V(p);let t=e.slice(10);if(t===`overview`)return V(E);if(t===`appearance`)return V(D);if(t===`keyboard-shortcuts`)return V(O);if(t===`personal`)return V(k);if(t===`system`)return V(A);if(t===`desktop-pet`)return V(j);if(t===`desktop-app`)return V(M);if(t.startsWith(`capabilities/`))return V(N);if(t===`gateway`)return V(P);if(t===`runtimes`)return V(F);if(t===`devices`)return V(z);if(t===`tunnel`||t===`remote-access`)return V(I);if(t===`shares`)return V(L);if(t===`agent-defaults`)return V(R);if(t===`agent-browser`)return V(m);if(t===`phone-use`)return V(h);if(t===`computer-use`)return V(g)}function W(e){if(!e.startsWith(`/`))return;let p=H(e);if(p===`/capabilities`||p.startsWith(`/capabilities/`))return V(u);if(p===`/user-model`)return V(d);if(p===`/automations`)return V(r);if(p===`/browser-automations`)return V(i);if(p===`/`)return V(a);if(p.startsWith(`/tasks/`))return V(o);if(p===`/projects`)return V(s);if(p.startsWith(`/projects/`))return V(c);if(p===`/notes`||p.startsWith(`/notes/`))return V(l);if(p.startsWith(`/extensions/`))return V(_);if(p===`/local-apps`)return V(x);if(p.startsWith(`/local-apps/`))return V(S);if(p===`/open`)return V(C);if(p===`/onboarding/workspace`)return V(w);if(p.startsWith(`/share/`))return V(b);if(p===`/settings/sessions`)return V(t);if(p===`/settings/usage`)return V(n);if(p===`/settings/logs`)return V(f);if(p===`/settings/extensions/debug`)return V(y);if(p.startsWith(`/settings/ext/`))return V(v);if(p.startsWith(`/settings/`))return U(p)}export{E as A,C,F as D,I as E,n as F,d as I,T as L,L as M,A as N,t as O,o as P,w as R,h as S,s as T,S as _,r as a,l as b,g as c,y as d,_ as f,O as g,a as h,D as i,b as j,p as k,j as l,P as m,R as n,i as o,v as p,M as r,N as s,m as t,z as u,x as v,c as w,k as x,f as y,W as z};
@@ -1,4 +1,4 @@
1
- import{a as e,i as t,o as n}from"./locale-store-Bg_XR36n.js";async function r(){return n(t(`/api/runtime-tools`))}async function i(e){await n(t(`/api/runtime-tools/config`),{method:`PATCH`,body:JSON.stringify(e)})}async function a(){return(await n(t(`/api/runtime-tools/prune`),{method:`POST`})).payload}async function o(e){return s({path:`/api/runtime-tools/${e.runtime}/${e.action}/stream`,body:{version:e.version},onProgress:e.onProgress})}async function s(n){let r=await e(t(n.path),{method:`POST`,headers:{Accept:`text/event-stream`},body:JSON.stringify(n.body)});if(!r.ok||!r.body){let e=await r.json().catch(()=>({}));throw Error(e.message??`HTTP ${r.status}`)}let i=r.body.getReader(),a=new TextDecoder,o=``,s=!1;try{for(;!s;){let{done:e,value:t}=await i.read();if(e)break;o+=a.decode(t,{stream:!0}).replace(/\r\n/g,`
1
+ import{a as e,i as t,o as n}from"./locale-store-Br7IfbXK.js";async function r(){return n(t(`/api/runtime-tools`))}async function i(e){await n(t(`/api/runtime-tools/config`),{method:`PATCH`,body:JSON.stringify(e)})}async function a(){return(await n(t(`/api/runtime-tools/prune`),{method:`POST`})).payload}async function o(e){return s({path:`/api/runtime-tools/${e.runtime}/${e.action}/stream`,body:{version:e.version},onProgress:e.onProgress})}async function s(n){let r=await e(t(n.path),{method:`POST`,headers:{Accept:`text/event-stream`},body:JSON.stringify(n.body)});if(!r.ok||!r.body){let e=await r.json().catch(()=>({}));throw Error(e.message??`HTTP ${r.status}`)}let i=r.body.getReader(),a=new TextDecoder,o=``,s=!1;try{for(;!s;){let{done:e,value:t}=await i.read();if(e)break;o+=a.decode(t,{stream:!0}).replace(/\r\n/g,`
2
2
  `);let r=o.split(`
3
3
 
4
4
  `);o=r.pop()??``;for(let e of r){let t=``,r=``;for(let n of e.split(`
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,t as n}from"./vendor-react-BOUWij0V.js";import{i as r,n as i}from"./locale-store-Bg_XR36n.js";import{t as a}from"./messages-DG4HLOER.js";import{n as o,r as s}from"./popover-select-DD8fmrxH.js";import{t as c}from"./circle-alert-BEjgurr2.js";import{t as l}from"./circle-check-C23XjkUj.js";import{t as u}from"./download-Dk-ZjtO6.js";import{t as d}from"./rotate-ccw-JM1TBLpp.js";import{t as f}from"./button-CnRSIP6m.js";import{i as p}from"./vendor-swr-CdRzEUwF.js";import{t as m}from"./refresh-button-bU_0NarN.js";import{n as h}from"./settings-loading-skeleton-BTqvr_Fw.js";import{n as g,t as _}from"./settings-page-header-CyUHrn7c.js";import"./settings-page-layout-DGVqXrlp.js";import{t as v}from"./settings-advanced-gate-CjAFqg2U.js";import{i as y,n as b,r as x}from"./runtime-tools-api-Bt8t37z5.js";import{t as S}from"./phone-dependencies-card-DLYrI0C4.js";var C=e(t(),1);function w(e){return e?.trim()||void 0}function T(e,t,n){return e?.state!==`ready`||w(t)!==w(n)}var E=n(),D=[`node`,`python`,`uv`];function O(){let e=a(i(e=>e.language)).runtimeToolsSettings,{data:t,error:n,isLoading:w,mutate:O}=p(r(`/api/runtime-tools`)),[k,A]=(0,C.useState)(null),[j,M]=(0,C.useState)(!1),[N,P]=(0,C.useState)(!1),[F,I]=(0,C.useState)({}),[L,R]=(0,C.useState)({}),[z,B]=(0,C.useState)(null),V=Object.values(F).some(Boolean);if((0,C.useEffect)(()=>{t?.payload.config&&A(structuredClone(t.payload.config))},[t?.payload.config]),n)return(0,E.jsxs)(g,{children:[(0,E.jsx)(_,{title:e.title,subtitle:e.loadError}),(0,E.jsx)(f,{onClick:()=>void O(),children:e.refresh})]});if(w||!k)return(0,E.jsx)(g,{children:(0,E.jsx)(h,{sections:3})});let H=new Map(t?.payload.statuses.map(e=>[e.runtime,e])),U=(e,t)=>A(n=>n&&{...n,[e]:{...n[e],...t}}),W=async()=>{M(!0),B(null);try{await y(k),await O()}catch(e){B(e instanceof Error?e.message:String(e))}finally{M(!1)}},G=async(e,t)=>{I(t=>({...t,[e]:!0})),B(null);try{await y(k),await x({runtime:e,action:t,version:e===`uv`?k.uv.version:k[e].version,onProgress:t=>R(n=>({...n,[e]:t}))}),await O()}catch(e){B(e instanceof Error?e.message:String(e))}finally{I(t=>({...t,[e]:!1}))}},K=async()=>{P(!0),B(null);try{await b(),await O()}catch(e){B(e instanceof Error?e.message:String(e))}finally{P(!1)}};return(0,E.jsxs)(g,{gap:`gap-6`,children:[(0,E.jsx)(_,{title:e.title,actions:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(m,{className:`size-9 shrink-0 p-0`,disabled:V,label:e.refresh,onClick:async()=>{await O()}}),(0,E.jsx)(f,{onClick:()=>void K(),disabled:N||V,children:N?e.pruning:e.prune}),(0,E.jsx)(f,{variant:`primary`,onClick:()=>void W(),disabled:j||V,children:j?e.saving:e.save})]})}),z?(0,E.jsx)(`div`,{className:`rounded-xl bg-danger/10 px-4 py-3 text-sm text-danger`,children:z}):null,(0,E.jsx)(`section`,{className:`rounded-xl bg-surface-hover/20 p-4`,children:(0,E.jsxs)(`label`,{className:`flex items-center justify-between gap-4`,children:[(0,E.jsxs)(`span`,{children:[(0,E.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:e.enabled}),(0,E.jsx)(`span`,{className:`mt-1 block text-xs text-fg-muted`,children:e.enabledHint})]}),(0,E.jsx)(`input`,{type:`checkbox`,checked:k.enabled,onChange:e=>A({...k,enabled:e.target.checked}),className:`size-4 accent-accent`})]})}),(0,E.jsx)(v,{children:(0,E.jsxs)(`section`,{className:`grid gap-4 rounded-xl bg-surface-hover/20 p-4 md:grid-cols-2`,children:[(0,E.jsxs)(`label`,{className:`space-y-1.5 text-xs font-medium text-fg-muted`,children:[e.downloadSource,(0,E.jsxs)(o,{value:k.download.source,onChange:e=>A({...k,download:{...k.download,source:e.target.value}}),children:[(0,E.jsx)(s,{value:`auto`,children:e.downloadSources.auto}),(0,E.jsx)(s,{value:`website-only`,children:e.downloadSources.websiteOnly}),(0,E.jsx)(s,{value:`direct-only`,children:e.downloadSources.directOnly})]})]}),(0,E.jsxs)(`label`,{className:`space-y-1.5 text-xs font-medium text-fg-muted`,children:[e.gatewayBaseUrl,(0,E.jsx)(`input`,{value:k.download.gatewayBaseUrl,disabled:k.download.source===`direct-only`,onChange:e=>A({...k,download:{...k.download,gatewayBaseUrl:e.target.value}}),className:`h-10 w-full rounded-lg border border-edge bg-surface-panel px-3 text-sm text-fg outline-none focus:border-edge-strong disabled:opacity-50`})]}),(0,E.jsxs)(`label`,{className:`space-y-1.5 text-xs font-medium text-fg-muted`,children:[e.offlineBundle,(0,E.jsx)(`input`,{value:k.download.bundleDir??``,placeholder:e.offlineBundlePlaceholder,onChange:e=>A({...k,download:{...k.download,bundleDir:e.target.value||void 0}}),className:`h-10 w-full rounded-lg border border-edge bg-surface-panel px-3 text-sm text-fg outline-none focus:border-edge-strong`})]}),(0,E.jsxs)(`label`,{className:`space-y-1.5 text-xs font-medium text-fg-muted`,children:[e.proxy,(0,E.jsx)(`input`,{value:k.download.proxy??``,placeholder:`http://127.0.0.1:7890`,onChange:e=>A({...k,download:{...k.download,proxy:e.target.value||void 0}}),className:`h-10 w-full rounded-lg border border-edge bg-surface-panel px-3 text-sm text-fg outline-none focus:border-edge-strong`})]})]})}),(0,E.jsx)(S,{}),(0,E.jsx)(`div`,{className:`flex flex-col gap-4`,children:D.map(n=>{let r=H.get(n),i=r?.state===`ready`,a=L[n],p=n===`uv`?k.uv:k[n],m=n===`uv`?t?.payload.config.uv:t?.payload.config[n],h=F[n]===!0,g=T(r,p.version,m?.version);return(0,E.jsxs)(`section`,{className:`flex min-w-0 flex-col gap-5 rounded-xl bg-surface-base/55 p-5 sm:p-6`,children:[(0,E.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:e.runtimeNames[n]}),(0,E.jsx)(`p`,{className:`mt-1 break-words text-xs text-fg-muted`,children:r?.message??e.unknown})]}),(0,E.jsxs)(`div`,{className:`flex items-center gap-2`,children:[i?(0,E.jsx)(l,{className:`size-5 shrink-0 text-success`}):(0,E.jsx)(c,{className:`size-5 shrink-0 text-warning`}),(0,E.jsx)(`input`,{type:`checkbox`,"aria-label":`${e.runtimeNames[n]} ${e.enabled}`,checked:p.enabled,onChange:e=>{n===`uv`?A({...k,uv:{...k.uv,enabled:e.target.checked}}):U(n,{enabled:e.target.checked})},className:`size-4 accent-accent`})]})]}),(0,E.jsxs)(`div`,{className:n===`uv`?`grid gap-4 md:grid-cols-[minmax(16rem,28rem)]`:`grid gap-4 md:grid-cols-2 xl:grid-cols-3`,children:[(0,E.jsxs)(`label`,{className:`space-y-1.5 text-xs font-medium text-fg-muted`,children:[e.version,(0,E.jsx)(`input`,{value:p.version??``,placeholder:r?.requestedVersion,onChange:e=>{let t=e.target.value||void 0;n===`uv`?A({...k,uv:{...k.uv,version:t}}):U(n,{version:t})},className:`h-10 w-full rounded-lg border border-edge bg-surface-inset px-3 text-sm text-fg outline-none focus:border-edge-strong`})]}),n===`uv`?null:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`label`,{className:`space-y-1.5 text-xs font-medium text-fg-muted`,children:[e.sourcePolicy,(0,E.jsxs)(o,{value:k[n].preference,onChange:e=>U(n,{preference:e.target.value}),children:[(0,E.jsx)(s,{value:`managed-first`,children:e.preferences.managedFirst}),(0,E.jsx)(s,{value:`system-first`,children:e.preferences.systemFirst}),(0,E.jsx)(s,{value:`managed-only`,children:e.preferences.managedOnly}),(0,E.jsx)(s,{value:`system-only`,children:e.preferences.systemOnly})]})]}),(0,E.jsxs)(`label`,{className:`space-y-1.5 text-xs font-medium text-fg-muted`,children:[e.provisionPolicy,(0,E.jsxs)(o,{value:k[n].provision,onChange:e=>U(n,{provision:e.target.value}),children:[(0,E.jsx)(s,{value:`eager`,children:e.provisions.eager}),(0,E.jsx)(s,{value:`on-demand`,children:e.provisions.onDemand}),(0,E.jsx)(s,{value:`disabled`,children:e.provisions.disabled})]})]})]})]}),a&&h?(0,E.jsxs)(`div`,{className:`rounded-lg bg-accent-soft px-3 py-2 text-xs text-accent-fg`,children:[a.message,a.totalBytes&&a.downloadedBytes?` · ${Math.round(a.downloadedBytes/a.totalBytes*100)}%`:``]}):null,(0,E.jsxs)(`div`,{className:`mt-auto flex flex-wrap items-center justify-between gap-3`,children:[(0,E.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[g?(0,E.jsxs)(f,{variant:`primary`,disabled:!k.enabled||!p.enabled||h,onClick:()=>void G(n,`install`),children:[(0,E.jsx)(u,{className:`size-4`}),h?e.working:e.install]}):(0,E.jsxs)(`span`,{className:`inline-flex h-9 items-center gap-2 px-1 text-sm text-success`,children:[(0,E.jsx)(l,{className:`size-4`}),e.installed]}),r?.repairable?(0,E.jsxs)(f,{disabled:!k.enabled||!p.enabled||h,onClick:()=>void G(n,`repair`),children:[(0,E.jsx)(d,{className:`size-4`}),e.repair]}):null]}),(0,E.jsx)(v,{children:r?.resolved?.executable?(0,E.jsx)(`code`,{className:`break-all text-[11px] text-fg-subtle`,children:r.resolved.executable}):null})]})]},n)})})]})}export{O as RuntimeToolsSettingsPanel};
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,t as n}from"./vendor-react-BOUWij0V.js";import{i as r,n as i}from"./locale-store-Br7IfbXK.js";import{t as a}from"./messages-ByFlEbsu.js";import{n as o,r as s}from"./popover-select-DD8fmrxH.js";import{t as c}from"./circle-alert-BEjgurr2.js";import{t as l}from"./circle-check-C23XjkUj.js";import{t as u}from"./download-Dk-ZjtO6.js";import{t as d}from"./rotate-ccw-JM1TBLpp.js";import{t as f}from"./button-CnRSIP6m.js";import{i as p}from"./vendor-swr-CdRzEUwF.js";import{t as m}from"./refresh-button-bU_0NarN.js";import{n as h}from"./settings-loading-skeleton-BTqvr_Fw.js";import{n as g,t as _}from"./settings-page-header-DBL0_u0Z.js";import"./settings-page-layout-IAvpbz4A.js";import{t as v}from"./settings-advanced-gate-BI4DMz4_.js";import{i as y,n as b,r as x}from"./runtime-tools-api-9o3Wfji1.js";import{t as S}from"./phone-dependencies-card-DBiKtzwz.js";var C=e(t(),1);function w(e){return e?.trim()||void 0}function T(e,t,n){return e?.state!==`ready`||w(t)!==w(n)}var E=n(),D=[`node`,`python`,`uv`];function O(){let e=a(i(e=>e.language)).runtimeToolsSettings,{data:t,error:n,isLoading:w,mutate:O}=p(r(`/api/runtime-tools`)),[k,A]=(0,C.useState)(null),[j,M]=(0,C.useState)(!1),[N,P]=(0,C.useState)(!1),[F,I]=(0,C.useState)({}),[L,R]=(0,C.useState)({}),[z,B]=(0,C.useState)(null),V=Object.values(F).some(Boolean);if((0,C.useEffect)(()=>{t?.payload.config&&A(structuredClone(t.payload.config))},[t?.payload.config]),n)return(0,E.jsxs)(g,{children:[(0,E.jsx)(_,{title:e.title,subtitle:e.loadError}),(0,E.jsx)(f,{onClick:()=>void O(),children:e.refresh})]});if(w||!k)return(0,E.jsx)(g,{children:(0,E.jsx)(h,{sections:3})});let H=new Map(t?.payload.statuses.map(e=>[e.runtime,e])),U=(e,t)=>A(n=>n&&{...n,[e]:{...n[e],...t}}),W=async()=>{M(!0),B(null);try{await y(k),await O()}catch(e){B(e instanceof Error?e.message:String(e))}finally{M(!1)}},G=async(e,t)=>{I(t=>({...t,[e]:!0})),B(null);try{await y(k),await x({runtime:e,action:t,version:e===`uv`?k.uv.version:k[e].version,onProgress:t=>R(n=>({...n,[e]:t}))}),await O()}catch(e){B(e instanceof Error?e.message:String(e))}finally{I(t=>({...t,[e]:!1}))}},K=async()=>{P(!0),B(null);try{await b(),await O()}catch(e){B(e instanceof Error?e.message:String(e))}finally{P(!1)}};return(0,E.jsxs)(g,{gap:`gap-6`,children:[(0,E.jsx)(_,{title:e.title,actions:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(m,{className:`size-9 shrink-0 p-0`,disabled:V,label:e.refresh,onClick:async()=>{await O()}}),(0,E.jsx)(f,{onClick:()=>void K(),disabled:N||V,children:N?e.pruning:e.prune}),(0,E.jsx)(f,{variant:`primary`,onClick:()=>void W(),disabled:j||V,children:j?e.saving:e.save})]})}),z?(0,E.jsx)(`div`,{className:`rounded-xl bg-danger/10 px-4 py-3 text-sm text-danger`,children:z}):null,(0,E.jsx)(`section`,{className:`rounded-xl bg-surface-hover/20 p-4`,children:(0,E.jsxs)(`label`,{className:`flex items-center justify-between gap-4`,children:[(0,E.jsxs)(`span`,{children:[(0,E.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:e.enabled}),(0,E.jsx)(`span`,{className:`mt-1 block text-xs text-fg-muted`,children:e.enabledHint})]}),(0,E.jsx)(`input`,{type:`checkbox`,checked:k.enabled,onChange:e=>A({...k,enabled:e.target.checked}),className:`size-4 accent-accent`})]})}),(0,E.jsx)(v,{children:(0,E.jsxs)(`section`,{className:`grid gap-4 rounded-xl bg-surface-hover/20 p-4 md:grid-cols-2`,children:[(0,E.jsxs)(`label`,{className:`space-y-1.5 text-xs font-medium text-fg-muted`,children:[e.downloadSource,(0,E.jsxs)(o,{value:k.download.source,onChange:e=>A({...k,download:{...k.download,source:e.target.value}}),children:[(0,E.jsx)(s,{value:`auto`,children:e.downloadSources.auto}),(0,E.jsx)(s,{value:`website-only`,children:e.downloadSources.websiteOnly}),(0,E.jsx)(s,{value:`direct-only`,children:e.downloadSources.directOnly})]})]}),(0,E.jsxs)(`label`,{className:`space-y-1.5 text-xs font-medium text-fg-muted`,children:[e.gatewayBaseUrl,(0,E.jsx)(`input`,{value:k.download.gatewayBaseUrl,disabled:k.download.source===`direct-only`,onChange:e=>A({...k,download:{...k.download,gatewayBaseUrl:e.target.value}}),className:`h-10 w-full rounded-lg border border-edge bg-surface-panel px-3 text-sm text-fg outline-none focus:border-edge-strong disabled:opacity-50`})]}),(0,E.jsxs)(`label`,{className:`space-y-1.5 text-xs font-medium text-fg-muted`,children:[e.offlineBundle,(0,E.jsx)(`input`,{value:k.download.bundleDir??``,placeholder:e.offlineBundlePlaceholder,onChange:e=>A({...k,download:{...k.download,bundleDir:e.target.value||void 0}}),className:`h-10 w-full rounded-lg border border-edge bg-surface-panel px-3 text-sm text-fg outline-none focus:border-edge-strong`})]}),(0,E.jsxs)(`label`,{className:`space-y-1.5 text-xs font-medium text-fg-muted`,children:[e.proxy,(0,E.jsx)(`input`,{value:k.download.proxy??``,placeholder:`http://127.0.0.1:7890`,onChange:e=>A({...k,download:{...k.download,proxy:e.target.value||void 0}}),className:`h-10 w-full rounded-lg border border-edge bg-surface-panel px-3 text-sm text-fg outline-none focus:border-edge-strong`})]})]})}),(0,E.jsx)(S,{}),(0,E.jsx)(`div`,{className:`flex flex-col gap-4`,children:D.map(n=>{let r=H.get(n),i=r?.state===`ready`,a=L[n],p=n===`uv`?k.uv:k[n],m=n===`uv`?t?.payload.config.uv:t?.payload.config[n],h=F[n]===!0,g=T(r,p.version,m?.version);return(0,E.jsxs)(`section`,{className:`flex min-w-0 flex-col gap-5 rounded-xl bg-surface-base/55 p-5 sm:p-6`,children:[(0,E.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:e.runtimeNames[n]}),(0,E.jsx)(`p`,{className:`mt-1 break-words text-xs text-fg-muted`,children:r?.message??e.unknown})]}),(0,E.jsxs)(`div`,{className:`flex items-center gap-2`,children:[i?(0,E.jsx)(l,{className:`size-5 shrink-0 text-success`}):(0,E.jsx)(c,{className:`size-5 shrink-0 text-warning`}),(0,E.jsx)(`input`,{type:`checkbox`,"aria-label":`${e.runtimeNames[n]} ${e.enabled}`,checked:p.enabled,onChange:e=>{n===`uv`?A({...k,uv:{...k.uv,enabled:e.target.checked}}):U(n,{enabled:e.target.checked})},className:`size-4 accent-accent`})]})]}),(0,E.jsxs)(`div`,{className:n===`uv`?`grid gap-4 md:grid-cols-[minmax(16rem,28rem)]`:`grid gap-4 md:grid-cols-2 xl:grid-cols-3`,children:[(0,E.jsxs)(`label`,{className:`space-y-1.5 text-xs font-medium text-fg-muted`,children:[e.version,(0,E.jsx)(`input`,{value:p.version??``,placeholder:r?.requestedVersion,onChange:e=>{let t=e.target.value||void 0;n===`uv`?A({...k,uv:{...k.uv,version:t}}):U(n,{version:t})},className:`h-10 w-full rounded-lg border border-edge bg-surface-inset px-3 text-sm text-fg outline-none focus:border-edge-strong`})]}),n===`uv`?null:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`label`,{className:`space-y-1.5 text-xs font-medium text-fg-muted`,children:[e.sourcePolicy,(0,E.jsxs)(o,{value:k[n].preference,onChange:e=>U(n,{preference:e.target.value}),children:[(0,E.jsx)(s,{value:`managed-first`,children:e.preferences.managedFirst}),(0,E.jsx)(s,{value:`system-first`,children:e.preferences.systemFirst}),(0,E.jsx)(s,{value:`managed-only`,children:e.preferences.managedOnly}),(0,E.jsx)(s,{value:`system-only`,children:e.preferences.systemOnly})]})]}),(0,E.jsxs)(`label`,{className:`space-y-1.5 text-xs font-medium text-fg-muted`,children:[e.provisionPolicy,(0,E.jsxs)(o,{value:k[n].provision,onChange:e=>U(n,{provision:e.target.value}),children:[(0,E.jsx)(s,{value:`eager`,children:e.provisions.eager}),(0,E.jsx)(s,{value:`on-demand`,children:e.provisions.onDemand}),(0,E.jsx)(s,{value:`disabled`,children:e.provisions.disabled})]})]})]})]}),a&&h?(0,E.jsxs)(`div`,{className:`rounded-lg bg-accent-soft px-3 py-2 text-xs text-accent-fg`,children:[a.message,a.totalBytes&&a.downloadedBytes?` · ${Math.round(a.downloadedBytes/a.totalBytes*100)}%`:``]}):null,(0,E.jsxs)(`div`,{className:`mt-auto flex flex-wrap items-center justify-between gap-3`,children:[(0,E.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[g?(0,E.jsxs)(f,{variant:`primary`,disabled:!k.enabled||!p.enabled||h,onClick:()=>void G(n,`install`),children:[(0,E.jsx)(u,{className:`size-4`}),h?e.working:e.install]}):(0,E.jsxs)(`span`,{className:`inline-flex h-9 items-center gap-2 px-1 text-sm text-success`,children:[(0,E.jsx)(l,{className:`size-4`}),e.installed]}),r?.repairable?(0,E.jsxs)(f,{disabled:!k.enabled||!p.enabled||h,onClick:()=>void G(n,`repair`),children:[(0,E.jsx)(d,{className:`size-4`}),e.repair]}):null]}),(0,E.jsx)(v,{children:r?.resolved?.executable?(0,E.jsx)(`code`,{className:`break-all text-[11px] text-fg-subtle`,children:r.resolved.executable}):null})]})]},n)})})]})}export{O as RuntimeToolsSettingsPanel};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,t as n}from"./vendor-react-BOUWij0V.js";import{u as r}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{i,n as a,o}from"./locale-store-Bg_XR36n.js";import{t as s}from"./messages-DG4HLOER.js";import{t as c}from"./createLucideIcon-DPHK1VkS.js";import{t as ee}from"./chevron-down-ccbiQQz_.js";import{i as l}from"./working-directory-picker-modal-BO9qdJyZ.js";import{t as u}from"./loader-circle-CifKLtgG.js";import{s as d,t as te}from"./install-connector-dialog-CTQAKTPv.js";import{t as f}from"./package-wATCyihJ.js";import{t as p}from"./plus-Q2yW6OE7.js";import{t as m}from"./cn-0WouolD0.js";import{t as h}from"./button-CnRSIP6m.js";import{t as g}from"./skeleton-BI5TyibZ.js";import{i as _}from"./vendor-swr-CdRzEUwF.js";import{a as v,i as y,o as b,s as x}from"./connectors-api-BjypBp2g.js";import{t as S}from"./agent-plugin-dialog-OBueuQSc.js";import{t as C}from"./capability-icon-DVoZxEgW.js";import{t as w}from"./extension-marketplace-api-ow0K1Y4_.js";var T=c(`cable`,[[`path`,{d:`M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z`,key:`trhst0`}],[`path`,{d:`M17 21v-2`,key:`ds4u3f`}],[`path`,{d:`M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10`,key:`1mo9zo`}],[`path`,{d:`M21 21v-2`,key:`eo0ou`}],[`path`,{d:`M3 5V3`,key:`1k5hjh`}],[`path`,{d:`M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z`,key:`1dd30t`}],[`path`,{d:`M7 5V3`,key:`1t1388`}]]),E=e(t(),1),D={"notion-office":`notion`,"todoist-mcp":`todoist`,"amap-maps":`amap`,"feishu-workspace":`feishu`,"wecom-workspace":`wecom`,"dingtalk-workspace":`dingtalk`,"wps365-workspace":`wps365`},O=[`feishu`,`wecom`,`dingtalk`,`tencent-docs`,`wps365`,`yuque`,`dida365`,`flomo`,`tencent-meeting`,`amap`,`bailian-web-search`,`railway-12306`,`antv-chart`],k={"store-plugin":0,"builtin-connector":1,"store-connector":2,"registry-connector":3};function A(e){let t=e.toLowerCase().replace(/^composio-/,``);return D[t]??t}function j(e){if(!e)return 2**53-1;let t=O.indexOf(A(e.id));return t>=0?t:e.regions?.includes(`china`)?O.length:2**53-1}function M(e,t){let n=new Map;for(let t of e){if(!t.service)continue;let e=A(t.service.id),r=n.get(e);(!r?.service||k[t.service.source]<k[r.service.source])&&n.set(e,t)}let r=e.filter(e=>!e.service||n.get(A(e.service.id))===e);return t.startsWith(`zh`)?r.toSorted((e,t)=>j(e.service)-j(t.service)):r}function N(e,t){let n=t.trim().toLocaleLowerCase();return!n||[e.name,e.description,e.source,...e.tags].some(e=>e.toLocaleLowerCase().includes(n))}function P(e){return e?[`failed`,`unauthorized`,`degraded`,`not_configured`].includes(e.status)?`attention`:`installed`:`available`}function F(e,t,n,r=`en`){return M(e,r).filter(e=>(t===`all`||e.kind===t)&&N(e,n))}function I(e,t,n,r=`en`){let i=new Map(n.map(e=>[e.connectorId,e])),a=new Map;for(let t of e){let e=i.get(t.id);a.set(t.id,{id:t.id,service:{id:t.id,source:t.source===`builtin`?`builtin-connector`:t.source===`store`?`store-connector`:`registry-connector`},kind:`connector`,name:t.displayName,description:t.description,source:t.source,status:P(e),tags:[t.category,t.kind,...t.tags??[]],href:`/capabilities/connectors?tab=${e?`connected`:`discover`}&${e?`instance`:`connector`}=${encodeURIComponent(e?.instanceId??t.id)}`,iconUrl:t.branding?.logoUrl})}for(let e of t){let t=e.name,n=e.localizations?.[r.startsWith(`zh`)?`zh-CN`:`en`],o=i.get(t);a.set(`store:${t}`,{id:t,service:{id:t,source:`store-connector`,regions:e.regions},kind:`connector`,name:n?.displayName??e.name,description:n?.description??e.description,source:e.author.username||`XOPC Store`,status:P(o),tags:[e.name,e.category,...e.tags??[]].filter(e=>!!e),href:o?`/capabilities/connectors?tab=connected&instance=${encodeURIComponent(o.instanceId)}`:`/capabilities/connectors?tab=discover&storeConnector=${encodeURIComponent(t)}`,iconUrl:e.branding?.iconUrl})}return M([...a.values()],r)}function L(e,t,n=`en`){return e.map(e=>({id:e.id,kind:`extension`,...e.packageType===`plugin`?{service:{id:e.id,source:`store-plugin`}}:{},name:e.localizations?.[n.startsWith(`zh`)?`zh-CN`:`en`]?.displayName??e.name,description:e.localizations?.[n.startsWith(`zh`)?`zh-CN`:`en`]?.description??e.description??``,source:e.author||e.npmPackage,status:t.has(e.id)?`installed`:`available`,tags:[e.id,...e.categories??[],...e.tags??[]],href:`/capabilities/extensions?tab=marketplace&q=${encodeURIComponent(e.name)}`,iconUrl:e.branding?.iconUrl}))}async function R(e=``){let t=await b({q:e,page:1,pageSize:50,sort:`downloads`}),n=await Promise.all(Array.from({length:Math.max(0,t.meta.totalPages-1)},(t,n)=>b({q:e,page:n+2,pageSize:50,sort:`downloads`})));return[...t.items,...n.flatMap(e=>e.items)]}async function z(e){let[t,n,r]=await Promise.allSettled([w(),y(),R()]),i=[t,n,r].filter(e=>e.status===`rejected`).length;if(i===3)throw Error(`Service recommendations unavailable`);let a=n.status===`fulfilled`?n.value:[];return{items:M([...L(t.status===`fulfilled`?t.value.filter(e=>e.packageType===`plugin`):[],new Set,e),...I(a,r.status===`fulfilled`?r.value:[],[],e)],e),definitions:a,failedSources:i}}var B=n();function V({initialCount:e=3,query:t=``,layout:n=`list`,onChanged:c}){let y=r(),b=a(e=>e.language),w=b.startsWith(`zh`),D=s(b).onboarding.workDiscovery,O=s(b).connectorsSettings,{data:k,error:A,isLoading:j,mutate:M}=_([`service-recommendations`,b],()=>z(b),{revalidateOnFocus:!1}),{data:N,error:P,mutate:I}=_(`recommended-connector-instances`,v),{data:L,error:R,mutate:V}=_(`gateway-extensions-list`,()=>o(i(`/api/extensions`))),[H,U]=(0,E.useState)(!1),[W,G]=(0,E.useState)(null),[K,q]=(0,E.useState)(null),[J,Y]=(0,E.useState)(null),[X,Z]=(0,E.useState)(``),Q=F(k?.items??[],`all`,t,b);async function $(){let e=(await Promise.allSettled([I(),V(),Promise.resolve().then(()=>c?.())])).find(e=>e.status===`rejected`);e?.status===`rejected`&&Z(String(e.reason))}async function ne(e,t){if(Z(``),e.service?.source===`store-plugin`){q({id:e.id,extension:t});return}let n=N?.find(t=>t.connectorId===e.id);if(n){y(`/capabilities/connectors?tab=connected&instance=${encodeURIComponent(n.instanceId)}`);return}Y(e.id);try{if(e.service?.source===`store-connector`){let t=await x(e.id);G(d(t.definition,{packageName:t.packageName,version:t.version,reviewHash:t.reviewHash,permissions:t.permissions}))}else{let t=k?.definitions.find(t=>t.id===e.id);t&&G(d(t))}}catch(e){Z(e instanceof Error?e.message:String(e))}finally{Y(null)}}return(0,B.jsxs)(`div`,{children:[j?(0,B.jsx)(`div`,{className:n===`cards`?`grid gap-4 sm:grid-cols-2 xl:grid-cols-3`:`space-y-2`,"aria-busy":`true`,children:Array.from({length:e},(e,t)=>(0,B.jsx)(g,{className:n===`cards`?`h-[8.75rem] rounded-xl`:`h-20 rounded-xl`},t))}):null,A||k?.failedSources||P||R?(0,B.jsxs)(`p`,{className:`mb-3 text-sm text-fg-muted`,role:`status`,children:[D.connectorLoadFailed,` `,(0,B.jsx)(`button`,{type:`button`,className:`text-accent-fg hover:underline`,onClick:()=>{M(),I(),V()},children:w?`重试`:`Retry`})]}):null,!j&&!A&&Q.length===0?(0,B.jsx)(`p`,{className:`py-6 text-center text-sm text-fg-muted`,children:D.noWorkServices}):null,(0,B.jsx)(`div`,{className:n===`cards`?`grid gap-4 sm:grid-cols-2 xl:grid-cols-3`:`divide-y divide-edge-subtle rounded-xl border border-edge-subtle bg-surface-base/55`,children:(H?Q:Q.slice(0,e)).map(e=>{let t=L?.extensions.find(t=>t.format===`agent-plugin`&&t.provenance?.packageName===e.id),r=N?.find(t=>t.connectorId===e.id),i=e.service?.source===`store-plugin`,a=i?!!(t?.active&&t.readiness===`ready`&&[`connected`,`not_required`].includes(t.authorizationStatus??``)):!!(r?.enabled&&r.status===`connected`),o=i?!!t:!!r,s=(i?!L&&!R:!N&&!P)?(0,B.jsx)(g,{className:`h-8 w-16 shrink-0 rounded-lg`}):(0,B.jsxs)(h,{type:`button`,variant:`secondary`,className:`h-8 shrink-0 px-3 text-xs`,disabled:J!==null,onClick:()=>void ne(e,t),children:[J===e.id?(0,B.jsx)(u,{className:`size-3.5 animate-spin`}):o?null:(0,B.jsx)(p,{className:`size-3.5`}),a?w?`管理`:`Manage`:o?w?`继续设置`:`Set up`:O.connect]});return(0,B.jsx)(`article`,{className:m(n===`cards`?`group flex min-h-[8.75rem] min-w-0 flex-col rounded-xl border border-edge bg-surface-panel p-4 transition-colors hover:bg-surface-hover/45 focus-within:ring-2 focus-within:ring-accent/30`:`flex min-h-20 items-center gap-3 px-3 py-3 sm:px-4`),children:n===`cards`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,B.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[(0,B.jsx)(C,{iconUrl:e.iconUrl,fallback:i?f:T}),(0,B.jsx)(`h3`,{className:`min-w-0 truncate text-sm font-semibold text-fg`,children:e.name})]}),s]}),(0,B.jsx)(`p`,{className:`mt-3 line-clamp-2 text-sm leading-6 text-fg-muted`,title:e.description,children:e.description})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(C,{iconUrl:e.iconUrl,fallback:i?f:T}),(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`h3`,{className:`truncate text-sm font-semibold text-fg`,children:e.name}),(0,B.jsx)(`p`,{className:`mt-1 line-clamp-2 text-xs text-fg-muted`,children:e.description})]}),s]})},`${e.kind}:${e.id}`)})}),Q.length>e?(0,B.jsxs)(`button`,{type:`button`,className:`mx-auto mt-3 flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-accent-fg hover:underline`,onClick:()=>U(e=>!e),children:[H?(0,B.jsx)(l,{className:`size-3.5`}):(0,B.jsx)(ee,{className:`size-3.5`}),H?D.showFewerServices:D.showMoreServices]}):null,X?(0,B.jsx)(`p`,{className:`mt-3 text-xs text-danger`,role:`alert`,children:X}):null,W?(0,B.jsx)(te,{draft:W,onChange:G,onClose:()=>G(null),t:O,onInstalled:async()=>{await $(),G(null)}}):null,K?(0,B.jsx)(S,{initialSource:`store:${K.id}`,extension:K.extension,onClose:()=>{q(null),$()}}):null]})}export{T as a,M as i,z as n,A as r,V as t};
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,t as n}from"./vendor-react-BOUWij0V.js";import{u as r}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{i,n as a,o}from"./locale-store-Br7IfbXK.js";import{t as s}from"./messages-ByFlEbsu.js";import{t as c}from"./createLucideIcon-DPHK1VkS.js";import{t as ee}from"./chevron-down-ccbiQQz_.js";import{i as l}from"./working-directory-picker-modal-CDZ1xh3o.js";import{t as u}from"./loader-circle-CifKLtgG.js";import{s as d,t as te}from"./install-connector-dialog-BuNXON0P.js";import{t as f}from"./package-wATCyihJ.js";import{t as p}from"./plus-Q2yW6OE7.js";import{t as m}from"./cn-0WouolD0.js";import{t as h}from"./button-CnRSIP6m.js";import{t as g}from"./skeleton-BI5TyibZ.js";import{i as _}from"./vendor-swr-CdRzEUwF.js";import{a as v,i as y,o as b,s as x}from"./connectors-api-DEJU8mgn.js";import{t as S}from"./agent-plugin-dialog-BoHL-b1o.js";import{t as C}from"./capability-icon-DVoZxEgW.js";import{t as w}from"./extension-marketplace-api-DRBszrCR.js";var T=c(`cable`,[[`path`,{d:`M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z`,key:`trhst0`}],[`path`,{d:`M17 21v-2`,key:`ds4u3f`}],[`path`,{d:`M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10`,key:`1mo9zo`}],[`path`,{d:`M21 21v-2`,key:`eo0ou`}],[`path`,{d:`M3 5V3`,key:`1k5hjh`}],[`path`,{d:`M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z`,key:`1dd30t`}],[`path`,{d:`M7 5V3`,key:`1t1388`}]]),E=e(t(),1),D={"notion-office":`notion`,"todoist-mcp":`todoist`,"amap-maps":`amap`,"feishu-workspace":`feishu`,"wecom-workspace":`wecom`,"dingtalk-workspace":`dingtalk`,"wps365-workspace":`wps365`},O=[`feishu`,`wecom`,`dingtalk`,`tencent-docs`,`wps365`,`yuque`,`dida365`,`flomo`,`tencent-meeting`,`amap`,`bailian-web-search`,`railway-12306`,`antv-chart`],k={"store-plugin":0,"builtin-connector":1,"store-connector":2,"registry-connector":3};function A(e){let t=e.toLowerCase().replace(/^composio-/,``);return D[t]??t}function j(e){if(!e)return 2**53-1;let t=O.indexOf(A(e.id));return t>=0?t:e.regions?.includes(`china`)?O.length:2**53-1}function M(e,t){let n=new Map;for(let t of e){if(!t.service)continue;let e=A(t.service.id),r=n.get(e);(!r?.service||k[t.service.source]<k[r.service.source])&&n.set(e,t)}let r=e.filter(e=>!e.service||n.get(A(e.service.id))===e);return t.startsWith(`zh`)?r.toSorted((e,t)=>j(e.service)-j(t.service)):r}function N(e,t){let n=t.trim().toLocaleLowerCase();return!n||[e.name,e.description,e.source,...e.tags].some(e=>e.toLocaleLowerCase().includes(n))}function P(e){return e?[`failed`,`unauthorized`,`degraded`,`not_configured`].includes(e.status)?`attention`:`installed`:`available`}function F(e,t,n,r=`en`){return M(e,r).filter(e=>(t===`all`||e.kind===t)&&N(e,n))}function I(e,t,n,r=`en`){let i=new Map(n.map(e=>[e.connectorId,e])),a=new Map;for(let t of e){let e=i.get(t.id);a.set(t.id,{id:t.id,service:{id:t.id,source:t.source===`builtin`?`builtin-connector`:t.source===`store`?`store-connector`:`registry-connector`},kind:`connector`,name:t.displayName,description:t.description,source:t.source,status:P(e),tags:[t.category,t.kind,...t.tags??[]],href:`/capabilities/connectors?tab=${e?`connected`:`discover`}&${e?`instance`:`connector`}=${encodeURIComponent(e?.instanceId??t.id)}`,iconUrl:t.branding?.logoUrl})}for(let e of t){let t=e.name,n=e.localizations?.[r.startsWith(`zh`)?`zh-CN`:`en`],o=i.get(t);a.set(`store:${t}`,{id:t,service:{id:t,source:`store-connector`,regions:e.regions},kind:`connector`,name:n?.displayName??e.name,description:n?.description??e.description,source:e.author.username||`XOPC Store`,status:P(o),tags:[e.name,e.category,...e.tags??[]].filter(e=>!!e),href:o?`/capabilities/connectors?tab=connected&instance=${encodeURIComponent(o.instanceId)}`:`/capabilities/connectors?tab=discover&storeConnector=${encodeURIComponent(t)}`,iconUrl:e.branding?.iconUrl})}return M([...a.values()],r)}function L(e,t,n=`en`){return e.map(e=>({id:e.id,kind:`extension`,...e.packageType===`plugin`?{service:{id:e.id,source:`store-plugin`}}:{},name:e.localizations?.[n.startsWith(`zh`)?`zh-CN`:`en`]?.displayName??e.name,description:e.localizations?.[n.startsWith(`zh`)?`zh-CN`:`en`]?.description??e.description??``,source:e.author||e.npmPackage,status:t.has(e.id)?`installed`:`available`,tags:[e.id,...e.categories??[],...e.tags??[]],href:`/capabilities/extensions?tab=marketplace&q=${encodeURIComponent(e.name)}`,iconUrl:e.branding?.iconUrl}))}async function R(e=``){let t=await b({q:e,page:1,pageSize:50,sort:`downloads`}),n=await Promise.all(Array.from({length:Math.max(0,t.meta.totalPages-1)},(t,n)=>b({q:e,page:n+2,pageSize:50,sort:`downloads`})));return[...t.items,...n.flatMap(e=>e.items)]}async function z(e){let[t,n,r]=await Promise.allSettled([w(),y(),R()]),i=[t,n,r].filter(e=>e.status===`rejected`).length;if(i===3)throw Error(`Service recommendations unavailable`);let a=n.status===`fulfilled`?n.value:[];return{items:M([...L(t.status===`fulfilled`?t.value.filter(e=>e.packageType===`plugin`):[],new Set,e),...I(a,r.status===`fulfilled`?r.value:[],[],e)],e),definitions:a,failedSources:i}}var B=n();function V({initialCount:e=3,query:t=``,layout:n=`list`,onChanged:c}){let y=r(),b=a(e=>e.language),w=b.startsWith(`zh`),D=s(b).onboarding.workDiscovery,O=s(b).connectorsSettings,{data:k,error:A,isLoading:j,mutate:M}=_([`service-recommendations`,b],()=>z(b),{revalidateOnFocus:!1}),{data:N,error:P,mutate:I}=_(`recommended-connector-instances`,v),{data:L,error:R,mutate:V}=_(`gateway-extensions-list`,()=>o(i(`/api/extensions`))),[H,U]=(0,E.useState)(!1),[W,G]=(0,E.useState)(null),[K,q]=(0,E.useState)(null),[J,Y]=(0,E.useState)(null),[X,Z]=(0,E.useState)(``),Q=F(k?.items??[],`all`,t,b);async function $(){let e=(await Promise.allSettled([I(),V(),Promise.resolve().then(()=>c?.())])).find(e=>e.status===`rejected`);e?.status===`rejected`&&Z(String(e.reason))}async function ne(e,t){if(Z(``),e.service?.source===`store-plugin`){q({id:e.id,extension:t});return}let n=N?.find(t=>t.connectorId===e.id);if(n){y(`/capabilities/connectors?tab=connected&instance=${encodeURIComponent(n.instanceId)}`);return}Y(e.id);try{if(e.service?.source===`store-connector`){let t=await x(e.id);G(d(t.definition,{packageName:t.packageName,version:t.version,reviewHash:t.reviewHash,permissions:t.permissions}))}else{let t=k?.definitions.find(t=>t.id===e.id);t&&G(d(t))}}catch(e){Z(e instanceof Error?e.message:String(e))}finally{Y(null)}}return(0,B.jsxs)(`div`,{children:[j?(0,B.jsx)(`div`,{className:n===`cards`?`grid gap-4 sm:grid-cols-2 xl:grid-cols-3`:`space-y-2`,"aria-busy":`true`,children:Array.from({length:e},(e,t)=>(0,B.jsx)(g,{className:n===`cards`?`h-[8.75rem] rounded-xl`:`h-20 rounded-xl`},t))}):null,A||k?.failedSources||P||R?(0,B.jsxs)(`p`,{className:`mb-3 text-sm text-fg-muted`,role:`status`,children:[D.connectorLoadFailed,` `,(0,B.jsx)(`button`,{type:`button`,className:`text-accent-fg hover:underline`,onClick:()=>{M(),I(),V()},children:w?`重试`:`Retry`})]}):null,!j&&!A&&Q.length===0?(0,B.jsx)(`p`,{className:`py-6 text-center text-sm text-fg-muted`,children:D.noWorkServices}):null,(0,B.jsx)(`div`,{className:n===`cards`?`grid gap-4 sm:grid-cols-2 xl:grid-cols-3`:`divide-y divide-edge-subtle rounded-xl border border-edge-subtle bg-surface-base/55`,children:(H?Q:Q.slice(0,e)).map(e=>{let t=L?.extensions.find(t=>t.format===`agent-plugin`&&t.provenance?.packageName===e.id),r=N?.find(t=>t.connectorId===e.id),i=e.service?.source===`store-plugin`,a=i?!!(t?.active&&t.readiness===`ready`&&[`connected`,`not_required`].includes(t.authorizationStatus??``)):!!(r?.enabled&&r.status===`connected`),o=i?!!t:!!r,s=(i?!L&&!R:!N&&!P)?(0,B.jsx)(g,{className:`h-8 w-16 shrink-0 rounded-lg`}):(0,B.jsxs)(h,{type:`button`,variant:`secondary`,className:`h-8 shrink-0 px-3 text-xs`,disabled:J!==null,onClick:()=>void ne(e,t),children:[J===e.id?(0,B.jsx)(u,{className:`size-3.5 animate-spin`}):o?null:(0,B.jsx)(p,{className:`size-3.5`}),a?w?`管理`:`Manage`:o?w?`继续设置`:`Set up`:O.connect]});return(0,B.jsx)(`article`,{className:m(n===`cards`?`group flex min-h-[8.75rem] min-w-0 flex-col rounded-xl border border-edge bg-surface-panel p-4 transition-colors hover:bg-surface-hover/45 focus-within:ring-2 focus-within:ring-accent/30`:`flex min-h-20 items-center gap-3 px-3 py-3 sm:px-4`),children:n===`cards`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,B.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[(0,B.jsx)(C,{iconUrl:e.iconUrl,fallback:i?f:T}),(0,B.jsx)(`h3`,{className:`min-w-0 truncate text-sm font-semibold text-fg`,children:e.name})]}),s]}),(0,B.jsx)(`p`,{className:`mt-3 line-clamp-2 text-sm leading-6 text-fg-muted`,title:e.description,children:e.description})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(C,{iconUrl:e.iconUrl,fallback:i?f:T}),(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`h3`,{className:`truncate text-sm font-semibold text-fg`,children:e.name}),(0,B.jsx)(`p`,{className:`mt-1 line-clamp-2 text-xs text-fg-muted`,children:e.description})]}),s]})},`${e.kind}:${e.id}`)})}),Q.length>e?(0,B.jsxs)(`button`,{type:`button`,className:`mx-auto mt-3 flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-accent-fg hover:underline`,onClick:()=>U(e=>!e),children:[H?(0,B.jsx)(l,{className:`size-3.5`}):(0,B.jsx)(ee,{className:`size-3.5`}),H?D.showFewerServices:D.showMoreServices]}):null,X?(0,B.jsx)(`p`,{className:`mt-3 text-xs text-danger`,role:`alert`,children:X}):null,W?(0,B.jsx)(te,{draft:W,onChange:G,onClose:()=>G(null),t:O,onInstalled:async()=>{await $(),G(null)}}):null,K?(0,B.jsx)(S,{initialSource:`store:${K.id}`,extension:K.extension,onClose:()=>{q(null),$()}}):null]})}export{T as a,M as i,z as n,A as r,V as t};
@@ -1 +1 @@
1
- import{i as e,o as t}from"./locale-store-Bg_XR36n.js";import{_ as n,a as r,c as i,d as a,f as o,g as s,i as c,m as l,n as u,u as d,y as f}from"./schemas-CCWMleym.js";import{t as p}from"./gateway-startup-retry-9YQllbw2.js";f().transform(e=>e.toLowerCase()).brand();var m=l().trim().regex(/^[a-z0-9][a-z0-9._-]{0,127}$/i).brand(),h=u([`active`,`idle`,`archived`,`pinned`]),g=a({agentId:l().optional(),source:l().optional(),accountId:l().optional(),peerKind:l().optional(),peerId:l().optional(),threadId:l().optional(),scopeId:l().optional()}).passthrough();a({agentId:l().optional(),projectId:l().optional(),key:l(),transcriptId:m.optional(),name:l().optional(),title:l().optional(),displayName:l().optional(),messageCount:d(),updatedAt:l(),sourceChannel:l().optional(),status:h.optional(),usage:a({calls:d().int().nonnegative(),unknownCostCalls:d().int().nonnegative(),totalTokens:d().int().nonnegative(),knownCostUsd:l(),costCompleteness:u([`complete`,`partial`,`unknown`])}).optional(),routing:g.optional()}).passthrough();var _=a({items:c(n()),total:d(),limit:d(),offset:d(),hasMore:r()}),v=a({role:l(),content:n(),timestamp:s([l(),d()]).optional()}).passthrough(),y=a({key:l(),messages:c(v)}).passthrough(),b=a({session:y}),ee=a({session:a({key:l(),transcriptId:m.optional(),messages:c(v),name:l().optional(),status:h.optional(),sourceChannel:l().optional(),sourceChatId:l().optional(),projectId:l().optional(),customData:o(l(),n()).optional(),routing:g.optional()}).passthrough(),pagination:a({total:d(),limit:d(),offset:d(),hasMore:r(),before:l().optional(),nextBeforeCursor:l().optional(),revision:d().int().nonnegative().optional()}).passthrough()}).passthrough(),x=a({ok:i(!0),conversationId:f(),rowCount:d().int().nonnegative(),lastTurnId:l().min(1),session:y}).passthrough(),S=a({ok:r().optional(),payload:a({active:r(),runId:l().optional()}).passthrough().optional()}).passthrough(),C=a({ok:r().optional(),error:l().optional()}).passthrough(),w=C.extend({renamed:r().optional()}),T=C.extend({reset:r().optional(),transcriptId:m.optional(),previousTranscriptId:l().optional(),session:n().optional()}),E=a({totalSessions:d(),activeSessions:d(),archivedSessions:d(),pinnedSessions:d(),totalMessages:d(),totalTokens:d(),oldestSession:l().optional(),newestSession:l().optional(),byChannel:o(l(),d())}).passthrough();a({ok:r(),payload:a({conversationId:f(),transcriptId:m,session:n()}).passthrough().optional(),error:l().optional()}).passthrough();var D=a({ok:i(!0),projects:a({items:c(a({project:n(),sessions:c(n()),sessionTotal:d(),sessionHasMore:r()}).passthrough()),total:d(),limit:d(),offset:d(),hasMore:r()}),inbox:_,pinned:c(n()).default([]),layouts:o(l(),a({itemIds:c(l()),revision:d().int().nonnegative()})).default({}),childrenByConversationId:o(l(),a({total:d(),activeCount:d(),items:c(a({taskId:l(),title:l(),phase:l(),runStatus:l().optional(),activeConversationId:l().optional()}))})).default({})}).passthrough();function O(e){return b.parse(e)}function k(e){return ee.parse(e)}function A(e){return x.parse(e)}function j(e){return S.parse(e)}function M(e){return C.parse(e)}function N(e){return w.parse(e)}function P(e){return T.parse(e)}function F(e){return E.parse(e)}function I(e){return D.parse(e)}function L(e){let t=j(e).payload,n=typeof t?.runId==`string`?t.runId.trim():``;return!t?.active||!n?{active:!1}:{active:!0,runId:n}}function R(e){let t=new URLSearchParams;if(!e)return``;e.status&&t.set(`status`,e.status),e.search&&t.set(`search`,e.search),e.channel&&t.set(`channel`,e.channel),e.sources?.length&&t.set(`sources`,e.sources.join(`,`)),e.purposes?.length&&t.set(`purposes`,e.purposes.join(`,`)),e.activity&&t.set(`activity`,e.activity),e.agentId&&t.set(`agentId`,e.agentId),e.excludeArchived&&t.set(`excludeArchived`,`true`),e.projectId&&t.set(`projectId`,e.projectId),e.unassigned&&t.set(`unassigned`,`true`),e.updatedAfter!=null&&t.set(`updatedAfter`,String(e.updatedAfter)),e.includePinned&&t.set(`includePinned`,`true`),e.includeConversationId&&t.set(`includeConversationId`,e.includeConversationId),e.rootConversationsOnly&&t.set(`rootConversationsOnly`,`true`),e.sessionTypes?.length&&t.set(`types`,e.sessionTypes.join(`,`)),e.sortBy&&t.set(`sortBy`,e.sortBy),e.sortOrder&&t.set(`sortOrder`,e.sortOrder),e.limit!=null&&t.set(`limit`,String(e.limit)),e.offset!=null&&t.set(`offset`,String(e.offset));let n=t.toString();return n?`?${n}`:``}function z(e,t){let n=[];t?.includeTranscript&&n.push(`transcript`),t?.includeTranscriptRows&&n.push(`transcriptRows`);let r=n.length?`?include=${n.join(`,`)}`:``;return`/api/sessions/${encodeURIComponent(e)}${r}`}function B(e){return`/api/sessions/${encodeURIComponent(e)}/fork-at-turn`}function te(e,t){let n=new URLSearchParams;n.set(`limit`,String(t?.limit??50));let r=t?.before?.trim();return r?n.set(`before`,r):t?.offset!=null&&n.set(`offset`,String(t.offset)),`/api/sessions/${encodeURIComponent(e)}/history?${n.toString()}`}function V(e){return`/api/sessions/${encodeURIComponent(e)}/run`}function H(){return`/api/sessions/stats`}function U(e){let t=new URLSearchParams;e?.projectLimit!=null&&t.set(`projectLimit`,String(e.projectLimit)),e?.projectOffset!=null&&t.set(`projectOffset`,String(e.projectOffset)),e?.sessionPreviewLimit!=null&&t.set(`sessionPreviewLimit`,String(e.sessionPreviewLimit)),e?.inboxLimit!=null&&t.set(`inboxLimit`,String(e.inboxLimit)),e?.inboxOffset!=null&&t.set(`inboxOffset`,String(e.inboxOffset)),e?.staleDays!=null&&t.set(`staleDays`,String(e.staleDays)),e?.includeConversationId&&t.set(`includeConversationId`,e.includeConversationId);let n=t.toString();return`/api/sidebar/chat-list${n?`?${n}`:``}`}function W(e){return`/api/sidebar/layouts/${encodeURIComponent(e)}`}function G(e,t){let n=encodeURIComponent(e);return t===`delete`?`/api/sessions/${n}`:`/api/sessions/${n}/${t}`}function K(e){return e?JSON.stringify({status:e.status,search:e.search,channel:e.channel,sources:e.sources,purposes:e.purposes,activity:e.activity,agentId:e.agentId,excludeArchived:e.excludeArchived,projectId:e.projectId,unassigned:e.unassigned,updatedAfter:e.updatedAfter,includePinned:e.includePinned,includeConversationId:e.includeConversationId,sessionTypes:e.sessionTypes,sortBy:e.sortBy,sortOrder:e.sortOrder,limit:e.limit,offset:e.offset}):`default`}var q=new Map;async function J(t){let n=K(t),r=q.get(n);if(r)return r;let i=e(`/api/sessions${R(t)}`),a=(async()=>{let e=await p(i);if(!e.ok){let t=await e.json().catch(()=>({})),n=typeof t.error==`string`?t.error:t.error?.message;throw Error(n??`HTTP ${e.status}`)}return await e.json()})().finally(()=>{q.delete(n)});return q.set(n,a),a}async function Y(n){return I(await t(e(U(n))))}async function X(n){let r=await t(e(W(n.containerId)),{method:`PUT`,body:JSON.stringify({itemIds:n.itemIds,expectedRevision:n.expectedRevision})});if(!r.ok||!r.layout)throw Error(r.error??`Failed to save sidebar order`);return r.layout}async function Z(){return F(await t(e(H())))}async function Q(n,r){let i=O(await t(e(z(n,r))));if(!i.session)throw Error(`Session not found`);return i.session}async function ne(n){let r=await t(e(`/api/sessions/resolve`),{method:`POST`,body:JSON.stringify(n)});if(!r.ok||!r.payload)throw Error(r.error??`Session not found`);return r.payload}async function $(n){M(await t(e(G(n,`delete`)),{method:`DELETE`}))}async function re(n,r){return{renamed:N(await t(e(G(n,`rename`)),{method:`POST`,body:JSON.stringify({name:r})})).renamed===!0}}async function ie(n){M(await t(e(G(n,`archive`)),{method:`POST`}))}async function ae(n){M(await t(e(G(n,`unarchive`)),{method:`POST`}))}async function oe(n){M(await t(e(G(n,`pin`)),{method:`POST`}))}async function se(n){M(await t(e(G(n,`unpin`)),{method:`POST`}))}async function ce(n){return(await t(e(`/api/sessions/${encodeURIComponent(n)}/export?format=json`))).content}export{L as _,Q as a,P as b,oe as c,X as d,ae as f,V as g,te as h,Y as i,re as l,B as m,$ as n,Z as o,se as p,ce as r,J as s,ie as t,ne as u,A as v,k as y};
1
+ import{i as e,o as t}from"./locale-store-Br7IfbXK.js";import{_ as n,a as r,c as i,d as a,f as o,g as s,i as c,m as l,n as u,u as d,y as f}from"./schemas-CCWMleym.js";import{t as p}from"./gateway-startup-retry-CvkJYurV.js";f().transform(e=>e.toLowerCase()).brand();var m=l().trim().regex(/^[a-z0-9][a-z0-9._-]{0,127}$/i).brand(),h=u([`active`,`idle`,`archived`,`pinned`]),g=a({agentId:l().optional(),source:l().optional(),accountId:l().optional(),peerKind:l().optional(),peerId:l().optional(),threadId:l().optional(),scopeId:l().optional()}).passthrough();a({agentId:l().optional(),projectId:l().optional(),key:l(),transcriptId:m.optional(),name:l().optional(),title:l().optional(),displayName:l().optional(),messageCount:d(),updatedAt:l(),sourceChannel:l().optional(),status:h.optional(),usage:a({calls:d().int().nonnegative(),unknownCostCalls:d().int().nonnegative(),totalTokens:d().int().nonnegative(),knownCostUsd:l(),costCompleteness:u([`complete`,`partial`,`unknown`])}).optional(),routing:g.optional()}).passthrough();var _=a({items:c(n()),total:d(),limit:d(),offset:d(),hasMore:r()}),v=a({role:l(),content:n(),timestamp:s([l(),d()]).optional()}).passthrough(),y=a({key:l(),messages:c(v)}).passthrough(),b=a({session:y}),ee=a({session:a({key:l(),transcriptId:m.optional(),messages:c(v),name:l().optional(),status:h.optional(),sourceChannel:l().optional(),sourceChatId:l().optional(),projectId:l().optional(),customData:o(l(),n()).optional(),routing:g.optional()}).passthrough(),pagination:a({total:d(),limit:d(),offset:d(),hasMore:r(),before:l().optional(),nextBeforeCursor:l().optional(),revision:d().int().nonnegative().optional()}).passthrough()}).passthrough(),x=a({ok:i(!0),conversationId:f(),rowCount:d().int().nonnegative(),lastTurnId:l().min(1),session:y}).passthrough(),S=a({ok:r().optional(),payload:a({active:r(),runId:l().optional()}).passthrough().optional()}).passthrough(),C=a({ok:r().optional(),error:l().optional()}).passthrough(),w=C.extend({renamed:r().optional()}),T=C.extend({reset:r().optional(),transcriptId:m.optional(),previousTranscriptId:l().optional(),session:n().optional()}),E=a({totalSessions:d(),activeSessions:d(),archivedSessions:d(),pinnedSessions:d(),totalMessages:d(),totalTokens:d(),oldestSession:l().optional(),newestSession:l().optional(),byChannel:o(l(),d())}).passthrough();a({ok:r(),payload:a({conversationId:f(),transcriptId:m,session:n()}).passthrough().optional(),error:l().optional()}).passthrough();var D=a({ok:i(!0),projects:a({items:c(a({project:n(),sessions:c(n()),sessionTotal:d(),sessionHasMore:r()}).passthrough()),total:d(),limit:d(),offset:d(),hasMore:r()}),inbox:_,pinned:c(n()).default([]),layouts:o(l(),a({itemIds:c(l()),revision:d().int().nonnegative()})).default({}),childrenByConversationId:o(l(),a({total:d(),activeCount:d(),items:c(a({taskId:l(),title:l(),phase:l(),runStatus:l().optional(),activeConversationId:l().optional()}))})).default({})}).passthrough();function O(e){return b.parse(e)}function k(e){return ee.parse(e)}function A(e){return x.parse(e)}function j(e){return S.parse(e)}function M(e){return C.parse(e)}function N(e){return w.parse(e)}function P(e){return T.parse(e)}function F(e){return E.parse(e)}function I(e){return D.parse(e)}function L(e){let t=j(e).payload,n=typeof t?.runId==`string`?t.runId.trim():``;return!t?.active||!n?{active:!1}:{active:!0,runId:n}}function R(e){let t=new URLSearchParams;if(!e)return``;e.status&&t.set(`status`,e.status),e.search&&t.set(`search`,e.search),e.channel&&t.set(`channel`,e.channel),e.sources?.length&&t.set(`sources`,e.sources.join(`,`)),e.purposes?.length&&t.set(`purposes`,e.purposes.join(`,`)),e.activity&&t.set(`activity`,e.activity),e.agentId&&t.set(`agentId`,e.agentId),e.excludeArchived&&t.set(`excludeArchived`,`true`),e.projectId&&t.set(`projectId`,e.projectId),e.unassigned&&t.set(`unassigned`,`true`),e.updatedAfter!=null&&t.set(`updatedAfter`,String(e.updatedAfter)),e.includePinned&&t.set(`includePinned`,`true`),e.includeConversationId&&t.set(`includeConversationId`,e.includeConversationId),e.rootConversationsOnly&&t.set(`rootConversationsOnly`,`true`),e.sessionTypes?.length&&t.set(`types`,e.sessionTypes.join(`,`)),e.sortBy&&t.set(`sortBy`,e.sortBy),e.sortOrder&&t.set(`sortOrder`,e.sortOrder),e.limit!=null&&t.set(`limit`,String(e.limit)),e.offset!=null&&t.set(`offset`,String(e.offset));let n=t.toString();return n?`?${n}`:``}function z(e,t){let n=[];t?.includeTranscript&&n.push(`transcript`),t?.includeTranscriptRows&&n.push(`transcriptRows`);let r=n.length?`?include=${n.join(`,`)}`:``;return`/api/sessions/${encodeURIComponent(e)}${r}`}function B(e){return`/api/sessions/${encodeURIComponent(e)}/fork-at-turn`}function te(e,t){let n=new URLSearchParams;n.set(`limit`,String(t?.limit??50));let r=t?.before?.trim();return r?n.set(`before`,r):t?.offset!=null&&n.set(`offset`,String(t.offset)),`/api/sessions/${encodeURIComponent(e)}/history?${n.toString()}`}function V(e){return`/api/sessions/${encodeURIComponent(e)}/run`}function H(){return`/api/sessions/stats`}function U(e){let t=new URLSearchParams;e?.projectLimit!=null&&t.set(`projectLimit`,String(e.projectLimit)),e?.projectOffset!=null&&t.set(`projectOffset`,String(e.projectOffset)),e?.sessionPreviewLimit!=null&&t.set(`sessionPreviewLimit`,String(e.sessionPreviewLimit)),e?.inboxLimit!=null&&t.set(`inboxLimit`,String(e.inboxLimit)),e?.inboxOffset!=null&&t.set(`inboxOffset`,String(e.inboxOffset)),e?.staleDays!=null&&t.set(`staleDays`,String(e.staleDays)),e?.includeConversationId&&t.set(`includeConversationId`,e.includeConversationId);let n=t.toString();return`/api/sidebar/chat-list${n?`?${n}`:``}`}function W(e){return`/api/sidebar/layouts/${encodeURIComponent(e)}`}function G(e,t){let n=encodeURIComponent(e);return t===`delete`?`/api/sessions/${n}`:`/api/sessions/${n}/${t}`}function K(e){return e?JSON.stringify({status:e.status,search:e.search,channel:e.channel,sources:e.sources,purposes:e.purposes,activity:e.activity,agentId:e.agentId,excludeArchived:e.excludeArchived,projectId:e.projectId,unassigned:e.unassigned,updatedAfter:e.updatedAfter,includePinned:e.includePinned,includeConversationId:e.includeConversationId,sessionTypes:e.sessionTypes,sortBy:e.sortBy,sortOrder:e.sortOrder,limit:e.limit,offset:e.offset}):`default`}var q=new Map;async function J(t){let n=K(t),r=q.get(n);if(r)return r;let i=e(`/api/sessions${R(t)}`),a=(async()=>{let e=await p(i);if(!e.ok){let t=await e.json().catch(()=>({})),n=typeof t.error==`string`?t.error:t.error?.message;throw Error(n??`HTTP ${e.status}`)}return await e.json()})().finally(()=>{q.delete(n)});return q.set(n,a),a}async function Y(n){return I(await t(e(U(n))))}async function X(n){let r=await t(e(W(n.containerId)),{method:`PUT`,body:JSON.stringify({itemIds:n.itemIds,expectedRevision:n.expectedRevision})});if(!r.ok||!r.layout)throw Error(r.error??`Failed to save sidebar order`);return r.layout}async function Z(){return F(await t(e(H())))}async function Q(n,r){let i=O(await t(e(z(n,r))));if(!i.session)throw Error(`Session not found`);return i.session}async function ne(n){let r=await t(e(`/api/sessions/resolve`),{method:`POST`,body:JSON.stringify(n)});if(!r.ok||!r.payload)throw Error(r.error??`Session not found`);return r.payload}async function $(n){M(await t(e(G(n,`delete`)),{method:`DELETE`}))}async function re(n,r){return{renamed:N(await t(e(G(n,`rename`)),{method:`POST`,body:JSON.stringify({name:r})})).renamed===!0}}async function ie(n){M(await t(e(G(n,`archive`)),{method:`POST`}))}async function ae(n){M(await t(e(G(n,`unarchive`)),{method:`POST`}))}async function oe(n){M(await t(e(G(n,`pin`)),{method:`POST`}))}async function se(n){M(await t(e(G(n,`unpin`)),{method:`POST`}))}async function ce(n){return(await t(e(`/api/sessions/${encodeURIComponent(n)}/export?format=json`))).content}export{L as _,Q as a,P as b,oe as c,X as d,ae as f,V as g,te as h,Y as i,re as l,B as m,$ as n,Z as o,se as p,ce as r,J as s,ie as t,ne as u,A as v,k as y};
@@ -1,4 +1,4 @@
1
- import{n as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,i as n,l as r,n as i,p as a,u as o}from"./locale-store-Bg_XR36n.js";import{t as s}from"./messages-DG4HLOER.js";import{_ as c,c as l,d as u,f as d,g as f,i as p,m,n as h,u as g}from"./schemas-CCWMleym.js";import{a as _}from"./gateway-realtime-67vWg_M2.js";import{i as v,n as y}from"./constants-DBtMsXdW.js";import{_ as b,b as x,g as S,h as C,m as w,s as ee,v as T,y as E}from"./session-api-DJI9eSgw.js";import{_ as te,a as D,b as ne,c as re,d as ie,f as ae,i as oe,l as O,o as se,p as ce,r as le,s as ue,t as de,u as fe,v as pe,y as me}from"./local-session-drafts-DjmK-SM9.js";import{t as he}from"./tool-activity-BtJkgjFf.js";import{r as ge}from"./personal-proactivity-DaRnbB1f.js";import{a as _e}from"./attachment-utils-core-BIOUBrpT.js";import{t as ve}from"./gateway-startup-retry-9YQllbw2.js";import{n as ye}from"./registry-api-Vy7LfH6E.js";import{a as be}from"./agents-admin-api-DLnmdC1h.js";var xe=1e4,k,Se=new Set;function Ce(e,t){k={type:`endpoint`,endpointId:e,token:t};for(let e of Se)e(k);Se.clear()}function we(e){!k||e&&k.token!==e||(k=void 0)}function Te(e){return k?Promise.resolve(k):e?.aborted?Promise.reject(e.reason):new Promise((t,n)=>{let r=e=>{o(),t(e)},i=()=>{o(),n(e?.reason??new DOMException(`Aborted`,`AbortError`))},a=globalThis.setTimeout(()=>{o(),n(Error(`Endpoint connection is not ready`))},xe),o=()=>{globalThis.clearTimeout(a),Se.delete(r),e?.removeEventListener(`abort`,i)};Se.add(r),e?.addEventListener(`abort`,i,{once:!0})})}var Ee=[0,500,1500],De=1e4;function Oe(e){let t=[e.content,e.thinking??null,e.attachments??null,e.contextRefs??null,e.browserContexts??null];e.appContext!==void 0&&t.push(e.appContext);let n=JSON.stringify(t),r=2166136261,i=5381;for(let e=0;e<n.length;e++){let t=n.charCodeAt(e);r^=t,r=Math.imul(r,16777619),i=Math.imul(i,33)^t}return`${n.length.toString(36)}:${(r>>>0).toString(36)}:${(i>>>0).toString(36)}`}function ke(e){return e===408||e===429||e>=500}var Ae=/^\[\d{4}-\d{2}-\d{2} \d{2}:\d{2}[^\]]*\]\s*/u,je=[`user-profile`,`active-focuses`,`collaboration-contract`,`user-context`];function Me(e,t){let n=`<${t}>`;if(!e.startsWith(n))return null;let r=`</${t}>`,i=e.indexOf(r,n.length);return i<0?null:e.slice(i+r.length).trimStart()}function Ne(e){return Ae.test(e)||e.startsWith(`<source_contexts>`)||je.some(t=>e.startsWith(`<${t}>`))}function Pe(e){if(!e.includes(`<source_contexts>`))return e;let t=e.replace(/^\s*<source_contexts>[\s\S]*?<\/source_contexts>\s*/u,``).trimStart();return t.match(/^<user_message>\r?\n([\s\S]*)\r?\n<\/user_message>\s*$/u)?.[1]??t}function Fe(e){let t=e,n=Me(t.trimStart(),`xopc_task_execution`);n!==null&&Ne(n)&&(t=n),t=Pe(t);let r=t,i=!1;for(t=t.trimStart();;){let e=je.find(e=>t.startsWith(`<${e}>`));if(!e)break;let n=Me(t,e);if(n===null){t=r,i=!1;break}t=n,i=!0}return i&&!Ae.test(t)&&(t=r),t.replace(Ae,``)}function Ie(e){return!e.includes(`[media attached:`)&&!e.includes(`xopc-media-uri:`)?e:e.replace(/\s*\[media attached:[^\]]+\]\s*\r?\nxopc-media-uri:[^\r\n]+\r?\n\s*xopc-media-path:[^\r\n]+(?:\r?\n\s*Use the read_media tool[^\r\n]*)?/g,``).replace(/\s*\[media attached:[^\]]+\]\s*/g,` `).replace(/\s*xopc-media-uri:[^\r\n]+/g,``).replace(/\s*xopc-media-path:[^\r\n]+/g,``).replace(/\s*Use the read_media tool[^\r\n]*/g,``).replace(/\n{3,}/g,`
1
+ import{n as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,i as n,l as r,n as i,p as a,u as o}from"./locale-store-Br7IfbXK.js";import{t as s}from"./messages-ByFlEbsu.js";import{_ as c,c as l,d as u,f as d,g as f,i as p,m,n as h,u as g}from"./schemas-CCWMleym.js";import{a as _}from"./gateway-realtime-BL_Cf0OQ.js";import{i as v,n as y}from"./constants-DBtMsXdW.js";import{_ as b,b as x,g as S,h as C,m as w,s as ee,v as T,y as E}from"./session-api-Bs3r_d2_.js";import{_ as te,a as D,b as ne,c as re,d as ie,f as ae,i as oe,l as O,o as se,p as ce,r as le,s as ue,t as de,u as fe,v as pe,y as me}from"./local-session-drafts-BJ1B1dQ7.js";import{t as he}from"./tool-activity-BtJkgjFf.js";import{r as ge}from"./personal-proactivity-DaRnbB1f.js";import{a as _e}from"./attachment-utils-core-BIOUBrpT.js";import{t as ve}from"./gateway-startup-retry-CvkJYurV.js";import{n as ye}from"./registry-api-DFDvOTg4.js";import{a as be}from"./agents-admin-api-u5c3GREg.js";var xe=1e4,k,Se=new Set;function Ce(e,t){k={type:`endpoint`,endpointId:e,token:t};for(let e of Se)e(k);Se.clear()}function we(e){!k||e&&k.token!==e||(k=void 0)}function Te(e){return k?Promise.resolve(k):e?.aborted?Promise.reject(e.reason):new Promise((t,n)=>{let r=e=>{o(),t(e)},i=()=>{o(),n(e?.reason??new DOMException(`Aborted`,`AbortError`))},a=globalThis.setTimeout(()=>{o(),n(Error(`Endpoint connection is not ready`))},xe),o=()=>{globalThis.clearTimeout(a),Se.delete(r),e?.removeEventListener(`abort`,i)};Se.add(r),e?.addEventListener(`abort`,i,{once:!0})})}var Ee=[0,500,1500],De=1e4;function Oe(e){let t=[e.content,e.thinking??null,e.attachments??null,e.contextRefs??null,e.browserContexts??null];e.appContext!==void 0&&t.push(e.appContext);let n=JSON.stringify(t),r=2166136261,i=5381;for(let e=0;e<n.length;e++){let t=n.charCodeAt(e);r^=t,r=Math.imul(r,16777619),i=Math.imul(i,33)^t}return`${n.length.toString(36)}:${(r>>>0).toString(36)}:${(i>>>0).toString(36)}`}function ke(e){return e===408||e===429||e>=500}var Ae=/^\[\d{4}-\d{2}-\d{2} \d{2}:\d{2}[^\]]*\]\s*/u,je=[`user-profile`,`active-focuses`,`collaboration-contract`,`user-context`];function Me(e,t){let n=`<${t}>`;if(!e.startsWith(n))return null;let r=`</${t}>`,i=e.indexOf(r,n.length);return i<0?null:e.slice(i+r.length).trimStart()}function Ne(e){return Ae.test(e)||e.startsWith(`<source_contexts>`)||je.some(t=>e.startsWith(`<${t}>`))}function Pe(e){if(!e.includes(`<source_contexts>`))return e;let t=e.replace(/^\s*<source_contexts>[\s\S]*?<\/source_contexts>\s*/u,``).trimStart();return t.match(/^<user_message>\r?\n([\s\S]*)\r?\n<\/user_message>\s*$/u)?.[1]??t}function Fe(e){let t=e,n=Me(t.trimStart(),`xopc_task_execution`);n!==null&&Ne(n)&&(t=n),t=Pe(t);let r=t,i=!1;for(t=t.trimStart();;){let e=je.find(e=>t.startsWith(`<${e}>`));if(!e)break;let n=Me(t,e);if(n===null){t=r,i=!1;break}t=n,i=!0}return i&&!Ae.test(t)&&(t=r),t.replace(Ae,``)}function Ie(e){return!e.includes(`[media attached:`)&&!e.includes(`xopc-media-uri:`)?e:e.replace(/\s*\[media attached:[^\]]+\]\s*\r?\nxopc-media-uri:[^\r\n]+\r?\n\s*xopc-media-path:[^\r\n]+(?:\r?\n\s*Use the read_media tool[^\r\n]*)?/g,``).replace(/\s*\[media attached:[^\]]+\]\s*/g,` `).replace(/\s*xopc-media-uri:[^\r\n]+/g,``).replace(/\s*xopc-media-path:[^\r\n]+/g,``).replace(/\s*Use the read_media tool[^\r\n]*/g,``).replace(/\n{3,}/g,`
2
2
 
3
3
  `).trim()}var Le=`@xopc-ref:`,Re=`[A-Za-z0-9_-]{1,64}`,ze=RegExp(`${Le}(${Re})`,`g`);function Be(e){if(!RegExp(`^${Re}$`).test(e))throw Error(`Invalid context reference id`);return`${Le}${e}`}function Ve(){return new RegExp(ze.source,`g`)}function He(e){let t=[],n=Ve(),r=0,i;for(;(i=n.exec(e))!==null;)i.index>r&&t.push({type:`text`,text:e.slice(r,i.index)}),t.push({type:`context_ref`,refId:i[1]??``}),r=i.index+i[0].length;return t.length===0?null:(r<e.length&&t.push({type:`text`,text:e.slice(r)}),{version:1,parts:t})}function Ue(e){return e.parts.flatMap(e=>e.type===`context_ref`?[e.refId]:[])}function We(e,t){return e.parts.map(e=>{if(e.type===`text`)return e.text;let n=t(e.refId)?.trim();return n?`@${n}`:``}).join(``)}function Ge(e){return e.parts.map(e=>e.type===`text`?e.text:Be(e.refId)).join(``)}function Ke(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return t.version!==1||!Array.isArray(t.parts)?!1:t.parts.every(e=>{if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return t.type===`text`?typeof t.text==`string`:t.type===`context_ref`&&typeof t.refId==`string`&&RegExp(`^${Re}$`).test(t.refId)})}var qe=8e3,Je=u({schemaVersion:f([l(1),l(2)]).optional(),questions:me.optional(),interactionMode:h([`quick`,`compose`]).optional(),choiceDetails:p(u({id:m().min(1).max(160),label:m().trim().min(1).max(1e3),description:m().max(2e3).optional()}).strict()).min(2).max(10).optional(),recommendedChoiceId:m().min(1).max(160).optional(),approval:u({operation:m().min(1).max(1e3),target:m().max(2e3).optional(),impact:m().max(4e3).optional(),argumentsPreview:d(m(),c()).optional()}).strict().optional()}),Ye=u({schemaVersion:f([l(1),l(2)]).optional(),answers:pe.optional(),response:u({choiceId:m().min(1).max(160).optional(),text:m().trim().max(qe).optional()}).strict().optional(),decision:h([`approve`,`deny`]).optional()}).strict();Ye.extend({action:h([`answer`,`agent_decide`,`cancel`]),expectedVersion:g().int().positive(),idempotencyKey:m().trim().min(1).max(256)}).strict();function Xe(e){let t=Je.safeParse(e);return t.success?t.data:{}}function Ze(e,t){let n=Ye.parse(t);if(e.schemaVersion===2){if(e.kind===`approval`||n.schemaVersion!==2||n.response||n.decision||!e.questions)throw Error(`Multi-question response requires schemaVersion 2`);return{schemaVersion:2,...ne(e.questions,n.answers)}}if(n.schemaVersion===2||n.answers!==void 0)throw Error(`Unexpected multi-question response`);if(e.kind===`approval`){if(n.response||!n.decision)throw Error(`An explicit approval decision is required`);return{answer:n.decision,decision:n.decision}}if(n.decision||!n.response)throw Error(`A structured response is required`);let r=n.response.choiceId?e.choiceDetails?.find(e=>e.id===n.response.choiceId):void 0;if(n.response.choiceId&&!r)throw Error(`Unknown clarification choice`);let i=n.response.text?.trim()??``;if(!r&&!i)throw Error(`Answer is required`);return{answer:r&&i?`Choice: ${r.label}\nAdditional information: ${i}`:r?.label??i,response:{...r?{choiceId:r.id}:{},...i?{text:i}:{}}}}var Qe=u({version:l(1),deliveryId:m().min(1),taskId:m().min(1),taskRunId:m().min(1),taskTitle:m().min(1).max(500),conversationId:m().min(1),originTranscriptId:m().min(1),requestInputId:m().optional(),assignmentEpoch:g().int().nonnegative(),resultRevision:g().int().positive().optional(),previousResultId:m().optional(),contractVersion:g().int().positive().optional(),instructionSequence:g().int().nonnegative().optional(),adoption:p(u({entryId:m(),sequence:g().int(),status:h([`applied`,`partially_applied`,`not_applied`,`superseded`]),verification:h([`passed`,`failed`,`unverified`]),claimIds:p(m()),note:m()})).optional(),outcome:y,text:m().optional(),createdAt:g()});function $e(e){let t=Qe.safeParse(e);return t.success?t.data:void 0}var et=[`## Result for the originating conversation`,`For ordinary Tasks when publish_task_result is available, use it before completion to review the actual result. Connected Requests use their own structured result tool instead. When files were published, finalArtifactIds must select the exact final artifact IDs from publication receipts, including [] for a text-only result. Exclude intermediate, obsolete and failed files; publication history is not the final delivery manifest.`,`Provide a complete, evidence-grounded result for the originating conversation. The personal assistant may synthesize its final reply from your report. Match the user’s language and requested depth; preserve requested content, relevant sources, verified data cutoffs, uncertainty, and partial failures. Distinguish reported findings from verified facts. Do not invent a friendly opening or assume a new user request.`,`Keep internal planning, Agent names, tool logs, and task progress links out of the result unless the user specifically requested them or they are necessary to explain a blocker. Never substitute a progress page, a plan, or a promise for the requested result. Publish required files through the available artifact tools; do not repeat the same attachments or send the user to a Task page to collect them.`].join(`
4
4
  `),tt=`Before finishing, call personal_request_result with the verified summary and, for mail, message items and coverage. The host composes the final explanation and preserves structured items in the main chat.`;function nt(e){let t=e.replace(/\r\n/g,`
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{m as i}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{i as a,l as o,n as s,o as c}from"./locale-store-Bg_XR36n.js";import{t as l}from"./messages-DG4HLOER.js";import{n as u,r as d,t as f}from"./session-identity-label-B7sgG1PE.js";import{t as p}from"./archive-Dz0hferG.js";import{n as m,r as h}from"./popover-select-DD8fmrxH.js";import{t as g}from"./circle-BoO4YvTx.js";import{t as _}from"./coins-DjP27vUx.js";import{t as ee}from"./database-CjjeZfRG.js";import{t as v}from"./download-Dk-ZjtO6.js";import{t as y}from"./folder-open-CyzJ19I9.js";import{t as b}from"./layers-mJW7JJKm.js";import{t as x}from"./layout-grid-CEVZdVFU.js";import{t as S}from"./message-square-fVE7Ghj1.js";import{t as C}from"./minimize-2-DtOGrlpo.js";import{t as w}from"./session-channel-icon-SsY70Z6t.js";import{n as T,t as E}from"./pin-off-BMRv-Kxr.js";import{t as D}from"./plus-Q2yW6OE7.js";import{t as O}from"./search-DA7gz22f.js";import{t as k}from"./settings-uiTATseT.js";import{t as A}from"./trash-2-DusmjVPV.js";import{t as j}from"./x-B_N4OPjy.js";import{t as M}from"./cn-0WouolD0.js";import{t as N}from"./button-CnRSIP6m.js";import{t as P}from"./skeleton-BI5TyibZ.js";import{a as te,n as F,o as I,r as ne,s as re,t as ie}from"./dist-DfWfZ9iu.js";import{i as ae,o as oe}from"./settings-shell-dialog-layer-BU3UuiJr.js";import{i as L}from"./vendor-swr-CdRzEUwF.js";import{a as R,c as z,f as se,n as ce,o as le,p as ue,r as de,s as fe,t as pe}from"./session-api-DJI9eSgw.js";import{n as B,t as V}from"./interaction-BdhHBbYa.js";import{n as H,r as me}from"./gateway-config-swr-DfPQIHOL.js";import{n as U,t as he}from"./registry-api-Vy7LfH6E.js";import{s as W}from"./form-field-width-DJw_jULe.js";import{t as ge}from"./page-tabs-oeTY7z3_.js";import{t as _e}from"./agent-avatar-display-YqmwzOSa.js";import{t as ve}from"./sliding-tab-list-DuQyViqe.js";import{t as ye}from"./chat-agents-api-B8JO6Tcj.js";import{n as be,r as xe,t as G}from"./settings-form-draft-Dy10ldo8.js";import{n as Se}from"./model-selector-a7PIT1Lk.js";import{n as Ce,r as we}from"./segmented-styles-Cqb91xsn.js";import{t as K}from"./settings-advanced-section-BxUuF_yi.js";import{t as q}from"./number-input-El7Szeln.js";import{n as Te,t as Ee}from"./settings-page-header-CyUHrn7c.js";import"./settings-page-layout-DGVqXrlp.js";import{n as De,t as J}from"./settings-form-section-num14vSv.js";import{n as Oe,t as Y}from"./use-autosave-3O-X7x15.js";import{t as ke}from"./settings-advanced-gate-CjAFqg2U.js";var X=e(t(),1),Ae=n(),Z=r();function je(e){let t=new Date(e),n=Math.floor((new Date().getTime()-t.getTime())/(1e3*60*60*24));return n===0?t.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}):n===1?`Yesterday`:n<7?t.toLocaleDateString([],{weekday:`short`}):t.toLocaleDateString([],{month:`short`,day:`numeric`})}function Me(e,t){return new Intl.NumberFormat(t===`zh`?`zh-CN`:`en-US`).format(e)}function Ne(e){return`$${Number(e).toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:6})}`}function Pe(e){let t=(0,Ae.c)(124),{session:n,variant:r,labels:i,sessionAgentId:a,sessionAgentAvatar:o,onOpen:c,onAction:u}=e,m;t[0]!==i.unnamedSession||t[1]!==n.name?(m=n.name?.trim()||i.unnamedSession,t[0]=i.unnamedSession,t[1]=n.name,t[2]=m):m=t[2];let h=m,g=s(Re),y;t[3]!==g||t[4]!==n?(y=f(n,l(g).sidebar.sessionFilters),t[3]=g,t[4]=n,t[5]=y):y=t[5];let b=y,x;t[6]===n.name?x=t[7]:(x=n.name?.trim(),t[6]=n.name,t[7]=x);let C=!!x,D=n.status===`archived`,O=n.status===`pinned`,k=n.usage,j;t[8]!==i.costUnknown||t[9]!==i.noUsage||t[10]!==k?(j=k?.calls?k.costCompleteness===`unknown`?i.costUnknown:`${k.costCompleteness===`partial`?`≥ `:`≈ `}${Ne(k.knownCostUsd)}`:i.noUsage,t[8]=i.costUnknown,t[9]=i.noUsage,t[10]=k,t[11]=j):j=t[11];let N=j,P=k?.calls?k.costCompleteness===`partial`?i.costPartial:k.costCompleteness===`unknown`?i.costUnknown:i.cost:i.noUsage,te=r===`list`&&`sm:flex-row sm:items-center sm:gap-4`,F;t[12]===te?F=t[13]:(F=M(`group flex min-w-0 w-full max-w-full cursor-pointer flex-col rounded-xl bg-surface-base text-left transition-colors duration-150 ease-out`,`hover:bg-surface-hover active:scale-[0.99]`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`,te),t[12]=te,t[13]=F);let I;t[14]===c?I=t[15]:(I=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),c())},t[14]=c,t[15]=I);let ne=r===`list`&&`sm:py-3`,re;t[16]===ne?re=t[17]:(re=M(`flex min-w-0 items-start justify-between gap-2 bg-surface-hover/35 px-3 py-2 dark:bg-surface-hover/25`,ne),t[16]=ne,t[17]=re);let ie;t[18]===n?ie=t[19]:(ie=(0,Z.jsx)(w,{sourceChannel:n.sourceChannel,session:n,className:`size-3.5`}),t[18]=n,t[19]=ie);let ae;t[20]===b?ae=t[21]:(ae=(0,Z.jsx)(`span`,{className:`truncate text-[11px] font-medium uppercase tracking-wide text-fg-subtle`,children:b}),t[20]=b,t[21]=ae);let oe;t[22]!==ie||t[23]!==ae?(oe=(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[ie,ae]}),t[22]=ie,t[23]=ae,t[24]=oe):oe=t[24];let L;t[25]===O?L=t[26]:(L=O?(0,Z.jsx)(T,{className:`size-3.5 text-accent-fg`,strokeWidth:1.75,"aria-hidden":!0}):null,t[25]=O,t[26]=L);let R;t[27]===n.updatedAt?R=t[28]:(R=je(n.updatedAt),t[27]=n.updatedAt,t[28]=R);let z;t[29]===R?z=t[30]:(z=(0,Z.jsx)(`span`,{children:R}),t[29]=R,t[30]=z);let se;t[31]!==L||t[32]!==z?(se=(0,Z.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5 text-xs text-fg-muted`,children:[L,z]}),t[31]=L,t[32]=z,t[33]=se):se=t[33];let ce;t[34]!==oe||t[35]!==se||t[36]!==re?(ce=(0,Z.jsxs)(`div`,{className:re,children:[oe,se]}),t[34]=oe,t[35]=se,t[36]=re,t[37]=ce):ce=t[37];let le=r===`list`&&`sm:py-3`,ue;t[38]===le?ue=t[39]:(ue=M(`min-w-0 flex-1 px-3 py-2`,le),t[38]=le,t[39]=ue);let de=r===`list`&&`sm:items-start`,fe;t[40]===de?fe=t[41]:(fe=M(`flex gap-3`,de),t[40]=de,t[41]=fe);let pe;t[42]!==o||t[43]!==a?(pe=(0,Z.jsx)(_e,{agentId:a,avatar:o,size:40,className:`size-10 shrink-0 ring-1 ring-edge/60 dark:ring-edge`}),t[42]=o,t[43]=a,t[44]=pe):pe=t[44];let B;t[45]===h?B=t[46]:(B=(0,Z.jsx)(`div`,{className:`min-w-0 max-w-full truncate text-sm font-semibold text-fg`,title:h,children:h}),t[45]=h,t[46]=B);let H;t[47]!==n.key||t[48]!==C?(H=C?(0,Z.jsx)(`div`,{className:`mt-0.5 min-w-0 max-w-full truncate font-mono text-[11px] text-fg-subtle`,title:n.key,children:n.key}):null,t[47]=n.key,t[48]=C,t[49]=H):H=t[49];let me;t[50]!==B||t[51]!==H?(me=(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[B,H]}),t[50]=B,t[51]=H,t[52]=me):me=t[52];let U;t[53]!==fe||t[54]!==pe||t[55]!==me?(U=(0,Z.jsxs)(`div`,{className:fe,children:[pe,me]}),t[53]=fe,t[54]=pe,t[55]=me,t[56]=U):U=t[56];let he;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(he=(0,Z.jsx)(S,{className:`size-3.5`,strokeWidth:1.75,"aria-hidden":!0}),t[57]=he):he=t[57];let W;t[58]===n.messageCount?W=t[59]:(W=(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[he,n.messageCount]}),t[58]=n.messageCount,t[59]=W);let ge;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(ge=(0,Z.jsx)(ee,{className:`size-3.5`,strokeWidth:1.75,"aria-hidden":!0}),t[60]=ge):ge=t[60];let ve=k?.totalTokens??0,ye;t[61]!==g||t[62]!==ve?(ye=Me(ve,g),t[61]=g,t[62]=ve,t[63]=ye):ye=t[63];let be;t[64]!==i.tokens||t[65]!==ye?(be=(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[ge,ye,` `,i.tokens]}),t[64]=i.tokens,t[65]=ye,t[66]=be):be=t[66];let xe;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(xe=(0,Z.jsx)(_,{className:`size-3.5`,strokeWidth:1.75,"aria-hidden":!0}),t[67]=xe):xe=t[67];let G;t[68]!==N||t[69]!==P?(G=(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1`,title:P,children:[xe,N]}),t[68]=N,t[69]=P,t[70]=G):G=t[70];let Se;t[71]!==W||t[72]!==be||t[73]!==G?(Se=(0,Z.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-3 text-xs text-fg-muted`,children:[W,be,G]}),t[71]=W,t[72]=be,t[73]=G,t[74]=Se):Se=t[74];let Ce;t[75]===n.tags?Ce=t[76]:(Ce=n.tags.length>0?(0,Z.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1`,children:[n.tags.slice(0,3).map(Le),n.tags.length>3?(0,Z.jsxs)(`span`,{className:`text-[11px] text-fg-disabled`,children:[`+`,n.tags.length-3]}):null]}):null,t[75]=n.tags,t[76]=Ce);let we;t[77]!==ue||t[78]!==U||t[79]!==Se||t[80]!==Ce?(we=(0,Z.jsxs)(`div`,{className:ue,children:[U,Se,Ce]}),t[77]=ue,t[78]=U,t[79]=Se,t[80]=Ce,t[81]=we):we=t[81];let K;t[82]===u?K=t[83]:(K=()=>u(`continue`),t[82]=u,t[83]=K);let q;t[84]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,Z.jsx)(S,{className:`size-4`,strokeWidth:1.75}),t[84]=q):q=t[84];let Te;t[85]!==i.continueChat||t[86]!==K?(Te=(0,Z.jsx)(`button`,{type:`button`,className:V,title:i.continueChat,"aria-label":i.continueChat,onClick:K,children:q}),t[85]=i.continueChat,t[86]=K,t[87]=Te):Te=t[87];let Ee;t[88]!==D||t[89]!==i.archive||t[90]!==i.unarchive||t[91]!==u?(Ee=D?(0,Z.jsx)(`button`,{type:`button`,className:V,title:i.unarchive,"aria-label":i.unarchive,onClick:()=>u(`unarchive`),children:(0,Z.jsx)(d,{className:`size-4`,strokeWidth:1.75})}):(0,Z.jsx)(`button`,{type:`button`,className:V,title:i.archive,"aria-label":i.archive,onClick:()=>u(`archive`),children:(0,Z.jsx)(p,{className:`size-4`,strokeWidth:1.75})}),t[88]=D,t[89]=i.archive,t[90]=i.unarchive,t[91]=u,t[92]=Ee):Ee=t[92];let De;t[93]!==O||t[94]!==i.pin||t[95]!==i.unpin||t[96]!==u?(De=O?(0,Z.jsx)(`button`,{type:`button`,className:V,title:i.unpin,"aria-label":i.unpin,onClick:()=>u(`unpin`),children:(0,Z.jsx)(E,{className:`size-4`,strokeWidth:1.75})}):(0,Z.jsx)(`button`,{type:`button`,className:V,title:i.pin,"aria-label":i.pin,onClick:()=>u(`pin`),children:(0,Z.jsx)(T,{className:`size-4`,strokeWidth:1.75})}),t[93]=O,t[94]=i.pin,t[95]=i.unpin,t[96]=u,t[97]=De):De=t[97];let J;t[98]===u?J=t[99]:(J=()=>u(`export`),t[98]=u,t[99]=J);let Oe;t[100]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=(0,Z.jsx)(v,{className:`size-4`,strokeWidth:1.75}),t[100]=Oe):Oe=t[100];let Y;t[101]!==i.export||t[102]!==J?(Y=(0,Z.jsx)(`button`,{type:`button`,className:V,title:i.export,"aria-label":i.export,onClick:J,children:Oe}),t[101]=i.export,t[102]=J,t[103]=Y):Y=t[103];let ke;t[104]===Symbol.for(`react.memo_cache_sentinel`)?(ke=M(V,`text-red-600 hover:bg-red-50 dark:text-red-400 dark:hover:bg-red-950/40`),t[104]=ke):ke=t[104];let X;t[105]===u?X=t[106]:(X=()=>u(`delete`),t[105]=u,t[106]=X);let Pe;t[107]===Symbol.for(`react.memo_cache_sentinel`)?(Pe=(0,Z.jsx)(A,{className:`size-4`,strokeWidth:1.75}),t[107]=Pe):Pe=t[107];let ze;t[108]!==i.delete||t[109]!==X?(ze=(0,Z.jsx)(`button`,{type:`button`,className:ke,title:i.delete,"aria-label":i.delete,onClick:X,children:Pe}),t[108]=i.delete,t[109]=X,t[110]=ze):ze=t[110];let Be;t[111]!==Te||t[112]!==Ee||t[113]!==De||t[114]!==Y||t[115]!==ze?(Be=(0,Z.jsxs)(`div`,{role:`group`,className:`m-1 mt-0 flex flex-wrap items-center gap-0.5 rounded-lg bg-surface-hover/35 p-1.5`,onClick:Ie,onKeyDown:Fe,children:[Te,Ee,De,Y,ze]}),t[111]=Te,t[112]=Ee,t[113]=De,t[114]=Y,t[115]=ze,t[116]=Be):Be=t[116];let Ve;return t[117]!==c||t[118]!==ce||t[119]!==we||t[120]!==Be||t[121]!==F||t[122]!==I?(Ve=(0,Z.jsxs)(`div`,{role:`button`,tabIndex:0,className:F,onClick:c,onKeyDown:I,children:[ce,we,Be]}),t[117]=c,t[118]=ce,t[119]=we,t[120]=Be,t[121]=F,t[122]=I,t[123]=Ve):Ve=t[123],Ve}function Fe(e){return e.stopPropagation()}function Ie(e){return e.stopPropagation()}function Le(e){return(0,Z.jsx)(`span`,{className:`max-w-full break-words rounded-md bg-surface-hover px-1.5 py-0.5 text-[11px] text-fg-muted`,children:e},e)}function Re(e){return e.language}function ze(e,t){return e.routing?.agentId?.trim().toLowerCase()||t.trim().toLowerCase()||`main`}function Be(e,t){return t.find(t=>t.id===e)?.avatar}var Ve={enabled:!0,triggerThreshold:.8,reserveTokens:8192,minMessagesBeforeCompact:10,keepRecentTokens:2e4,recentTurnsPreserve:3,summaryMaxTokens:16e3,summaryChunkTokens:24e3,summaryTimeoutMs:18e4,summaryRetries:2,qualityGuard:!0,gapAudit:!0,minToolResultKeepChars:1e3,maxActiveTranscriptBytes:2e6,postCompactionSections:[`Session Startup`,`Red Lines`]};function He(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Ue(e,t,n,r=1/0){return typeof e==`number`&&Number.isFinite(e)&&e>=n&&e<=r?e:t}function Q(e,t,n,r=1/0){return Number.isInteger(e)&&e>=n&&e<=r?e:t}function We(e){let t=He(e)?e:{},n=He(t.userContext)?t.userContext:{},r=He(n.contextPlanning)?n.contextPlanning:{},i=He(r.compaction)?r.compaction:{},a=Ve,o=typeof i.model==`string`&&i.model.trim()?i.model.trim():void 0,s=Array.isArray(i.postCompactionSections)&&i.postCompactionSections.length<=12&&i.postCompactionSections.every(e=>typeof e==`string`&&e.trim())?[...new Set(i.postCompactionSections.map(e=>e.trim()))]:[...a.postCompactionSections];return{enabled:typeof i.enabled==`boolean`?i.enabled:a.enabled,triggerThreshold:Ue(i.triggerThreshold,a.triggerThreshold,.1,.98),reserveTokens:Q(i.reserveTokens,a.reserveTokens,1024),minMessagesBeforeCompact:Q(i.minMessagesBeforeCompact,a.minMessagesBeforeCompact,2),keepRecentTokens:Q(i.keepRecentTokens,a.keepRecentTokens,1e3),recentTurnsPreserve:Q(i.recentTurnsPreserve,a.recentTurnsPreserve,1,12),summaryMaxTokens:Q(i.summaryMaxTokens,a.summaryMaxTokens,256),summaryChunkTokens:Q(i.summaryChunkTokens,a.summaryChunkTokens,1e3),summaryTimeoutMs:Q(i.summaryTimeoutMs,a.summaryTimeoutMs,1e3,6e5),summaryRetries:Q(i.summaryRetries,a.summaryRetries,0,5),qualityGuard:typeof i.qualityGuard==`boolean`?i.qualityGuard:a.qualityGuard,gapAudit:typeof i.gapAudit==`boolean`?i.gapAudit:a.gapAudit,...o?{model:o}:{},minToolResultKeepChars:Q(i.minToolResultKeepChars,a.minToolResultKeepChars,200),maxActiveTranscriptBytes:Q(i.maxActiveTranscriptBytes,a.maxActiveTranscriptBytes,64e3),postCompactionSections:s}}function Ge(e){return e.triggerThreshold<.1||e.triggerThreshold>.98?`triggerThreshold`:!Number.isInteger(e.reserveTokens)||e.reserveTokens<1024?`reserveTokens`:!Number.isInteger(e.minMessagesBeforeCompact)||e.minMessagesBeforeCompact<2?`minMessagesBeforeCompact`:!Number.isInteger(e.keepRecentTokens)||e.keepRecentTokens<1e3?`keepRecentTokens`:!Number.isInteger(e.recentTurnsPreserve)||e.recentTurnsPreserve<1||e.recentTurnsPreserve>12?`recentTurnsPreserve`:!Number.isInteger(e.summaryMaxTokens)||e.summaryMaxTokens<256?`summaryMaxTokens`:!Number.isInteger(e.summaryChunkTokens)||e.summaryChunkTokens<1e3?`summaryChunkTokens`:!Number.isInteger(e.summaryTimeoutMs)||e.summaryTimeoutMs<1e3||e.summaryTimeoutMs>6e5?`summaryTimeoutMs`:!Number.isInteger(e.summaryRetries)||e.summaryRetries<0||e.summaryRetries>5?`summaryRetries`:e.model!==void 0&&!e.model.trim()?`model`:!Number.isInteger(e.minToolResultKeepChars)||e.minToolResultKeepChars<200?`minToolResultKeepChars`:!Number.isInteger(e.maxActiveTranscriptBytes)||e.maxActiveTranscriptBytes<64e3?`maxActiveTranscriptBytes`:e.postCompactionSections.length>12||e.postCompactionSections.some(e=>!e.trim())?`postCompactionSections`:null}function Ke(e){let t={...e,...e.model?.trim()?{model:e.model.trim()}:{}};return e.model?.trim()||delete t.model,{userContext:{contextPlanning:{compaction:t}}}}async function qe(e){await c(a(`/api/config`),{method:`PATCH`,body:JSON.stringify(Ke(e))}),await H()}var Je=128e3,Ye={balanced:Ve,preserve:{...Ve,triggerThreshold:.88,keepRecentTokens:32e3,recentTurnsPreserve:5,maxActiveTranscriptBytes:4e6},early:{...Ve,triggerThreshold:.65,reserveTokens:12e3,minMessagesBeforeCompact:6,keepRecentTokens:12e3,recentTurnsPreserve:2}},Xe=G();function Ze(){return M(`w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg disabled:cursor-not-allowed disabled:opacity-55`,W,`dark:border-edge`)}function Qe(e){let{enabled:t,model:n,postCompactionSections:r,...i}=e;return JSON.stringify(i)}function $e(e){let t=Qe(e);for(let[e,n]of Object.entries(Ye))if(t===Qe(n))return e;return`custom`}function et(e){return e>=1e6?`${(e/1e6).toFixed(e%1e6==0?0:1)}m`:e>=1e3?`${(e/1e3).toFixed(e%1e3==0?0:1)}k`:String(e)}function $(e){let t=(0,Ae.c)(20),{id:n,label:r,hint:i,value:a,min:o,max:s,step:c,disabled:l,onChange:u}=e,d=c===void 0?1:c,f;t[0]!==n||t[1]!==r?(f=(0,Z.jsx)(`label`,{className:`mb-1 block text-sm font-medium text-fg`,htmlFor:n,children:r}),t[0]=n,t[1]=r,t[2]=f):f=t[2];let p;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(p=Ze(),t[3]=p):p=t[3];let m;t[4]===u?m=t[5]:(m=e=>{if(!e.target.value.trim())return;let t=Number(e.target.value);Number.isFinite(t)&&u(t)},t[4]=u,t[5]=m);let h;t[6]!==l||t[7]!==n||t[8]!==s||t[9]!==o||t[10]!==d||t[11]!==m||t[12]!==a?(h=(0,Z.jsx)(q,{id:n,type:`number`,min:o,max:s,step:d,disabled:l,className:p,value:a,onChange:m}),t[6]=l,t[7]=n,t[8]=s,t[9]=o,t[10]=d,t[11]=m,t[12]=a,t[13]=h):h=t[13];let g;t[14]===i?g=t[15]:(g=i?(0,Z.jsx)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:i}):null,t[14]=i,t[15]=g);let _;return t[16]!==f||t[17]!==h||t[18]!==g?(_=(0,Z.jsxs)(`div`,{children:[f,h,g]}),t[16]=f,t[17]=h,t[18]=g,t[19]=_):_=t[19],_}function tt(e){let t=(0,Ae.c)(19),{label:n,hint:r,checked:i,disabled:a,onChange:o}=e,s=a?`cursor-not-allowed opacity-55`:`cursor-pointer`,c;t[0]===s?c=t[1]:(c=M(`flex items-start gap-2 text-sm text-fg`,s),t[0]=s,t[1]=c);let l;t[2]===o?l=t[3]:(l=e=>o(e.target.checked),t[2]=o,t[3]=l);let u;t[4]!==i||t[5]!==a||t[6]!==l?(u=(0,Z.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox mt-0.5`,checked:i,disabled:a,onChange:l}),t[4]=i,t[5]=a,t[6]=l,t[7]=u):u=t[7];let d;t[8]===n?d=t[9]:(d=(0,Z.jsx)(`span`,{className:`font-medium`,children:n}),t[8]=n,t[9]=d);let f;t[10]===r?f=t[11]:(f=(0,Z.jsx)(`span`,{className:`mt-0.5 block text-xs text-fg-subtle`,children:r}),t[10]=r,t[11]=f);let p;t[12]!==d||t[13]!==f?(p=(0,Z.jsxs)(`span`,{children:[d,f]}),t[12]=d,t[13]=f,t[14]=p):p=t[14];let m;return t[15]!==c||t[16]!==u||t[17]!==p?(m=(0,Z.jsxs)(`label`,{className:c,children:[u,p]}),t[15]=c,t[16]=u,t[17]=p,t[18]=m):m=t[18],m}function nt({hasToken:e}){let t=l(s(e=>e.language)).sessions.compaction,{data:n,isLoading:r}=me(e),{data:i=[],isLoading:a}=L(e?he:null,U,{revalidateOnFocus:!1}),o=(0,X.useMemo)(()=>n?.payload?.config===void 0?null:We(n.payload.config),[n]),[c,u]=(0,X.useReducer)(Xe,{form:null,baseline:null}),[d,f]=(0,X.useState)(``),p=(0,X.useRef)(!1),m=(0,X.useRef)(c.form);m.current=c.form;let h=(0,X.useRef)(null);be({enabled:e,parsed:o,dirty:p.current,trackedParsedRef:h,dispatch:u,onResetDirty:()=>{p.current=!1}});let g=c.form,_=c.baseline,ee=!!(g&&_&&JSON.stringify(g)!==JSON.stringify(_)),v=(0,X.useCallback)(e=>{p.current=!0,u({type:`patch`,patch:e})},[]),y=(0,X.useCallback)(e=>({enabled:t.enabled,triggerThreshold:t.triggerThreshold,reserveTokens:t.reserveTokens,minMessagesBeforeCompact:t.minMessagesBeforeCompact,keepRecentTokens:t.keepRecentTokens,recentTurnsPreserve:t.recentTurnsPreserve,summaryMaxTokens:t.summaryMaxTokens,summaryChunkTokens:t.summaryChunkTokens,summaryTimeoutMs:t.summaryTimeoutSeconds,summaryRetries:t.summaryRetries,qualityGuard:t.qualityGuard,gapAudit:t.gapAudit,model:t.summaryModel,minToolResultKeepChars:t.minToolResultKeepChars,maxActiveTranscriptBytes:t.maxActiveTranscriptMb,postCompactionSections:t.postCompactionSections})[e],[t]),b=Y({value:g,dirty:ee,onSave:(0,X.useCallback)(async e=>{try{await qe(e),u({type:`saved`,value:e}),p.current=!!(m.current&&JSON.stringify(m.current)!==JSON.stringify(e))}catch(e){throw Error(e instanceof Error?e.message:t.saveError)}},[t.saveError]),validate:e=>{let n=Ge(e);return n?t.invalidValue.replace(`{{field}}`,y(n)):null}});if(!e||!g)return r?(0,Z.jsx)(J,{children:(0,Z.jsxs)(`div`,{className:`space-y-3`,"aria-busy":!0,children:[(0,Z.jsx)(P,{className:`h-5 w-48`}),(0,Z.jsx)(P,{className:`h-20 w-full rounded-xl`}),(0,Z.jsx)(P,{className:`h-36 w-full rounded-xl`})]})}):null;let x=$e(g),S=Math.max(0,Je-g.reserveTokens),w=Math.min(Math.floor(Je*g.triggerThreshold),S),T=Math.min(100,w/Je*100),E=Math.min(100,S/Je*100),O=g.model?i.find(e=>e.id===g.model):void 0,k=O?.contextWindow&&g.summaryChunkTokens+g.summaryMaxTokens+4096>O.contextWindow,A=g.keepRecentTokens+g.reserveTokens>w,te=Math.round(g.summaryTimeoutMs*(g.summaryRetries+1)/1e3),F=e=>{let t=Ye[e];v({...t,...g.model?{model:g.model}:{model:void 0},postCompactionSections:g.postCompactionSections})},I={balanced:{title:t.presetBalanced,hint:t.presetBalancedHint},preserve:{title:t.presetPreserve,hint:t.presetPreserveHint},early:{title:t.presetEarly,hint:t.presetEarlyHint}},ne=()=>{let e=d.trim();!e||g.postCompactionSections.includes(e)||g.postCompactionSections.length>=12||(v({postCompactionSections:[...g.postCompactionSections,e]}),f(``))};return(0,Z.jsxs)(J,{onBlurCapture:b.onBlurCapture,children:[(0,Z.jsx)(De,{icon:C,title:t.title,subtitle:t.hint,trailing:(0,Z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Z.jsx)(Oe,{status:b.status,error:b.error}),(0,Z.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2 text-sm font-medium text-fg`,children:[(0,Z.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:g.enabled,onChange:e=>v({enabled:e.target.checked})}),g.enabled?t.enabled:t.disabled]})]})}),b.error?(0,Z.jsx)(`p`,{className:`mb-4 rounded-lg bg-red-50 px-3 py-2 text-sm text-red-700 dark:bg-red-950/40 dark:text-red-300`,role:`alert`,children:b.error}):null,g.enabled?null:(0,Z.jsx)(`p`,{className:`mb-4 rounded-lg bg-amber-50 px-3 py-2 text-xs text-amber-950 dark:bg-amber-950/40 dark:text-amber-100`,children:t.disabledWarning}),(0,Z.jsxs)(`fieldset`,{disabled:!g.enabled,className:`space-y-5 disabled:opacity-60`,children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-3`,children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:t.presetTitle}),(0,Z.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-subtle`,children:t.presetHint})]}),x===`custom`?(0,Z.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2 py-1 text-[11px] font-medium text-fg-muted`,children:t.presetCustom}):null]}),(0,Z.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-3`,children:[`balanced`,`preserve`,`early`].map(e=>(0,Z.jsxs)(`button`,{type:`button`,"aria-pressed":x===e,className:M(`rounded-xl bg-surface-base/55 px-3 py-3 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,B.transition,B.focusRingPanel,x===e?`bg-accent-soft text-accent-fg shadow-surface`:`text-fg hover:bg-surface-hover`),onClick:()=>F(e),children:[(0,Z.jsx)(`span`,{className:`block text-sm font-medium`,children:I[e].title}),(0,Z.jsx)(`span`,{className:`mt-1 block text-xs text-fg-muted`,children:I[e].hint})]},e))})]}),(0,Z.jsxs)(K,{title:t.advancedTitle,summary:x===`custom`?t.presetCustom:t.presetHint,children:[(0,Z.jsxs)(`div`,{className:`rounded-xl bg-surface-base/45 p-4`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:t.budgetPreview}),(0,Z.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-subtle`,children:t.budgetPreviewHint})]}),(0,Z.jsx)(`span`,{className:`rounded-full bg-surface-panel px-2.5 py-1 font-mono text-xs text-fg-muted`,children:t.previewModel128k})]}),(0,Z.jsxs)(`div`,{className:`mt-4 space-y-3`,children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsxs)(`div`,{className:`mb-1 flex justify-between gap-3 text-xs text-fg-muted`,children:[(0,Z.jsx)(`span`,{children:t.compactionTrigger}),(0,Z.jsx)(`span`,{className:`font-mono text-fg`,children:et(w)})]}),(0,Z.jsx)(`div`,{className:`h-2 overflow-hidden rounded-full bg-surface-active`,children:(0,Z.jsx)(`div`,{className:`h-full rounded-full bg-accent`,style:{width:`${T}%`}})})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsxs)(`div`,{className:`mb-1 flex justify-between gap-3 text-xs text-fg-muted`,children:[(0,Z.jsx)(`span`,{children:t.hardInputLimit}),(0,Z.jsx)(`span`,{className:`font-mono text-fg`,children:et(S)})]}),(0,Z.jsx)(`div`,{className:`h-2 overflow-hidden rounded-full bg-surface-active`,children:(0,Z.jsx)(`div`,{className:`h-full rounded-full bg-fg-subtle`,style:{width:`${E}%`}})})]})]}),(0,Z.jsx)(`p`,{className:`mt-3 text-xs text-fg-subtle`,children:t.budgetFormula})]}),(0,Z.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,Z.jsx)($,{id:`compaction-trigger-threshold`,label:t.triggerThreshold,hint:t.triggerThresholdHint,value:Number((g.triggerThreshold*100).toFixed(2)),min:10,max:98,step:.1,onChange:e=>v({triggerThreshold:e/100})}),(0,Z.jsx)($,{id:`compaction-reserve-tokens`,label:t.reserveTokens,hint:t.reserveTokensHint.replace(`{{tokens}}`,et(g.reserveTokens)),value:g.reserveTokens,min:1024,step:1024,onChange:e=>v({reserveTokens:Math.floor(e)})}),(0,Z.jsx)($,{id:`compaction-recent-turns`,label:t.recentTurnsPreserve,hint:t.recentTurnsPreserveHint,value:g.recentTurnsPreserve,min:1,max:12,onChange:e=>v({recentTurnsPreserve:Math.floor(e)})}),(0,Z.jsx)($,{id:`compaction-keep-recent-tokens`,label:t.keepRecentTokens,hint:t.keepRecentTokensHint.replace(`{{tokens}}`,et(g.keepRecentTokens)),value:g.keepRecentTokens,min:1e3,step:1e3,onChange:e=>v({keepRecentTokens:Math.floor(e)})})]}),A?(0,Z.jsx)(`p`,{className:`rounded-lg bg-amber-50 px-3 py-2 text-xs text-amber-950 dark:bg-amber-950/40 dark:text-amber-100`,children:t.retentionWarning}):null,(0,Z.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`label`,{className:`mb-1 block text-sm font-medium text-fg`,children:t.summaryModel}),(0,Z.jsxs)(`div`,{className:`flex min-w-0 gap-2`,children:[(0,Z.jsx)(Se,{value:g.model??``,disabled:!g.enabled,placeholder:t.summaryModelInherited,searchPlaceholder:t.summaryModelSearch,noMatches:t.summaryModelNoMatches,models:i,modelsLoading:a,className:`min-w-0 flex-1 justify-between`,contentAlign:`start`,showProviderSettingsFooter:!0,onChange:e=>v({model:e})}),g.model?(0,Z.jsx)(N,{type:`button`,variant:`secondary`,onClick:()=>v({model:void 0}),children:t.summaryModelUseSession}):null]}),(0,Z.jsx)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:t.summaryModelHint})]}),(0,Z.jsx)(tt,{label:t.qualityGuard,hint:t.qualityGuardHint,checked:g.qualityGuard,onChange:e=>v({qualityGuard:e})}),(0,Z.jsx)(tt,{label:t.gapAudit,hint:t.gapAuditHint,checked:g.gapAudit,onChange:e=>v({gapAudit:e})})]}),g.qualityGuard?null:(0,Z.jsx)(`p`,{className:`rounded-lg bg-amber-50 px-3 py-2 text-xs text-amber-950 dark:bg-amber-950/40 dark:text-amber-100`,children:t.qualityGuardWarning})]}),(0,Z.jsx)(ke,{children:(0,Z.jsxs)(`div`,{className:`space-y-5 rounded-xl bg-surface-base/45 p-4`,children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:t.advancedTitle}),(0,Z.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-subtle`,children:t.advancedHint})]}),(0,Z.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,Z.jsx)($,{id:`compaction-min-messages`,label:t.minMessagesBeforeCompact,hint:t.minMessagesBeforeCompactHint,value:g.minMessagesBeforeCompact,min:2,onChange:e=>v({minMessagesBeforeCompact:Math.floor(e)})}),(0,Z.jsx)($,{id:`compaction-max-transcript-mb`,label:t.maxActiveTranscriptMb,hint:t.maxActiveTranscriptMbHint,value:Number((g.maxActiveTranscriptBytes/1e6).toFixed(3)),min:.064,step:.1,onChange:e=>v({maxActiveTranscriptBytes:Math.max(64e3,Math.round(e*1e6))})}),(0,Z.jsx)($,{id:`compaction-summary-max-tokens`,label:t.summaryMaxTokens,hint:t.summaryMaxTokensHint,value:g.summaryMaxTokens,min:256,step:256,onChange:e=>v({summaryMaxTokens:Math.floor(e)})}),(0,Z.jsx)($,{id:`compaction-summary-chunk-tokens`,label:t.summaryChunkTokens,hint:t.summaryChunkTokensHint,value:g.summaryChunkTokens,min:1e3,step:1e3,onChange:e=>v({summaryChunkTokens:Math.floor(e)})}),(0,Z.jsx)($,{id:`compaction-summary-timeout`,label:t.summaryTimeoutSeconds,hint:t.summaryTimeoutSecondsHint.replace(`{{seconds}}`,String(te)),value:g.summaryTimeoutMs/1e3,min:1,max:600,onChange:e=>v({summaryTimeoutMs:Math.round(e*1e3)})}),(0,Z.jsx)($,{id:`compaction-summary-retries`,label:t.summaryRetries,hint:t.summaryRetriesHint,value:g.summaryRetries,min:0,max:5,onChange:e=>v({summaryRetries:Math.floor(e)})}),(0,Z.jsx)($,{id:`compaction-min-tool-result-chars`,label:t.minToolResultKeepChars,hint:t.minToolResultKeepCharsHint,value:g.minToolResultKeepChars,min:200,step:100,onChange:e=>v({minToolResultKeepChars:Math.floor(e)})})]}),k?(0,Z.jsx)(`p`,{className:`rounded-lg bg-amber-50 px-3 py-2 text-xs text-amber-950 dark:bg-amber-950/40 dark:text-amber-100`,children:t.summaryBudgetWarning}):null,(0,Z.jsxs)(`div`,{className:`rounded-xl bg-surface-base/45 p-4`,children:[(0,Z.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:t.postCompactionSections}),(0,Z.jsx)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:t.postCompactionSectionsHint}),g.postCompactionSections.length>0?(0,Z.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:g.postCompactionSections.map(e=>(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-lg border border-edge bg-surface-panel px-2.5 py-1.5 text-xs text-fg`,children:[e,(0,Z.jsx)(`button`,{type:`button`,className:M(`text-fg-muted hover:text-fg`,B.press),"aria-label":t.removeSection.replace(`{{section}}`,e),onClick:()=>v({postCompactionSections:g.postCompactionSections.filter(t=>t!==e)}),children:(0,Z.jsx)(j,{className:`size-3.5`,"aria-hidden":!0})})]},e))}):(0,Z.jsx)(`p`,{className:`mt-3 text-xs text-fg-muted`,children:t.postCompactionSectionsEmpty}),(0,Z.jsxs)(`div`,{className:`mt-3 flex gap-2`,children:[(0,Z.jsx)(`input`,{className:Ze(),value:d,maxLength:120,disabled:g.postCompactionSections.length>=12,placeholder:t.postCompactionSectionsPlaceholder,onChange:e=>f(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),ne())}}),(0,Z.jsxs)(N,{type:`button`,variant:`secondary`,disabled:!d.trim()||g.postCompactionSections.length>=12,onClick:ne,children:[(0,Z.jsx)(D,{className:`size-4`,"aria-hidden":!0}),t.addSection]})]})]})]})})]})]})}function rt(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function it(e){return e===`main`||e===`per-peer`||e===`per-channel-peer`||e===`per-account-channel-peer`?e:`main`}function at(e){let t=rt(e)?e:{},n=rt(t.session)?t.session:{},r=rt(n.storage)?n.storage:{},i=typeof r.pruneAfterDays==`number`&&Number.isFinite(r.pruneAfterDays)?Math.max(0,Math.floor(r.pruneAfterDays)):typeof r.pruneAfterMs==`number`&&Number.isFinite(r.pruneAfterMs)?Math.max(0,Math.round(r.pruneAfterMs/864e5)):null,a=typeof r.maxEntries==`number`&&Number.isFinite(r.maxEntries)?Math.max(1,Math.floor(r.maxEntries)):null;return{dmScope:it(n.dmScope),pruneAfterDays:i,maxEntries:a}}async function ot(e){await c(a(`/api/config`),{method:`PATCH`,body:JSON.stringify({session:{dmScope:e.dmScope,storage:{pruneAfterMs:e.pruneAfterDays===null?null:e.pruneAfterDays*864e5,maxEntries:e.maxEntries}}})}),H()}function st(){return M(`w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg`,W,`dark:border-edge`)}var ct=G();function lt({hasToken:e}){let t=l(s(e=>e.language)).sessions.config,{data:n,isLoading:r}=me(e),i=(0,X.useMemo)(()=>n?.payload?.config===void 0?null:at(n.payload.config),[n]),[a,o]=(0,X.useReducer)(ct,{form:null,baseline:null}),c=a.form,u=a.baseline,d=(0,X.useRef)(!1),f=(0,X.useRef)(c);f.current=c;let p=(0,X.useRef)(null);be({enabled:e,parsed:i,dirty:d.current,trackedParsedRef:p,dispatch:o,onResetDirty:()=>{d.current=!1}});let g=!!(c&&u&&JSON.stringify(c)!==JSON.stringify(u)),_=(0,X.useCallback)(e=>{d.current=!0,o({type:`patch`,patch:e})},[]),v=Y({value:c,dirty:g,onSave:(0,X.useCallback)(async e=>{try{await ot(e),o({type:`saved`,value:e}),d.current=!!(f.current&&JSON.stringify(f.current)!==JSON.stringify(e))}catch(e){throw Error(e instanceof Error?e.message:t.saveError)}},[t.saveError])});return!e||!c?r?(0,Z.jsx)(J,{children:(0,Z.jsxs)(`div`,{className:`space-y-3`,"aria-busy":!0,children:[(0,Z.jsx)(P,{className:`h-5 w-40`}),(0,Z.jsx)(P,{className:`h-24 w-full rounded-xl`})]})}):null:(0,Z.jsxs)(J,{onBlurCapture:v.onBlurCapture,children:[(0,Z.jsx)(De,{icon:ee,title:t.title,subtitle:t.hint,trailing:(0,Z.jsx)(Oe,{status:v.status,error:v.error})}),(0,Z.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,Z.jsx)(K,{title:t.dmScope,summary:c.dmScope,children:(0,Z.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,Z.jsx)(`label`,{className:`mb-1 block text-sm font-medium text-fg`,children:t.dmScope}),(0,Z.jsxs)(m,{className:st(),value:c.dmScope,onChange:e=>_({dmScope:e.target.value}),children:[(0,Z.jsx)(h,{value:`main`,children:t.dmScopeMain}),(0,Z.jsx)(h,{value:`per-peer`,children:t.dmScopePerPeer}),(0,Z.jsx)(h,{value:`per-channel-peer`,children:t.dmScopePerChannelPeer}),(0,Z.jsx)(h,{value:`per-account-channel-peer`,children:t.dmScopePerAccountChannelPeer})]}),(0,Z.jsx)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:t.dmScopeHint})]})}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`label`,{className:`mb-1 block text-sm font-medium text-fg`,children:t.pruneAfterDays}),(0,Z.jsx)(q,{allowEmpty:!0,type:`number`,min:0,className:st(),value:c.pruneAfterDays??``,placeholder:t.unsetPlaceholder,onChange:e=>{let t=e.target.value.trim();_({pruneAfterDays:t===``?null:Math.max(0,Math.floor(Number(t)||0))})}})]}),(0,Z.jsx)(K,{title:t.maxEntries,summary:c.maxEntries??t.unsetPlaceholder,children:(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`label`,{className:`mb-1 block text-sm font-medium text-fg`,children:t.maxEntries}),(0,Z.jsx)(q,{allowEmpty:!0,type:`number`,min:1,className:st(),value:c.maxEntries??``,placeholder:t.unsetPlaceholder,onChange:e=>{let t=e.target.value.trim();_({maxEntries:t===``?null:Math.max(1,Math.floor(Number(t)||1))})}})]})})]})]})}function ut(e){if(typeof e==`string`)return e.length>2e3?`${e.slice(0,2e3)}…`:e;try{let t=JSON.stringify(e,null,2);return t.length>2e3?`${t.slice(0,2e3)}…`:t}catch{return String(e)}}function dt(e){let t=(0,Ae.c)(60),{open:n,loading:r,session:i,sessionAgentId:a,sessionAgentAvatar:o,labels:s,onClose:c,onArchive:l,onUnarchive:u,onPin:d,onUnpin:f,onExport:p,onDelete:m}=e,h=i?.status===`archived`,g=i?.status===`pinned`,_;t[0]===c?_=t[1]:(_=e=>!e&&c(),t[0]=c,t[1]=_);let ee;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,Z.jsx)(te,{className:M(`xopc-dialog-overlay fixed inset-0 bg-scrim`,oe)}),t[2]=ee):ee=t[2];let v;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(v=M(`xopc-drawer-right fixed right-0 top-0 flex size-full max-w-lg flex-col border-l border-edge bg-surface-overlay shadow-popover outline-none`,ae,`dark:border-edge`),t[3]=v):v=t[3];let y;t[4]!==i||t[5]!==o||t[6]!==a?(y=i&&a?(0,Z.jsx)(_e,{agentId:a,avatar:o,size:40,className:`size-10 shrink-0 ring-1 ring-edge/60 dark:ring-edge`}):null,t[4]=i,t[5]=o,t[6]=a,t[7]=y):y=t[7];let b;t[8]!==s.unnamedSession||t[9]!==i?.name?(b=i?.name?.trim()||s.unnamedSession,t[8]=s.unnamedSession,t[9]=i?.name,t[10]=b):b=t[10];let x;t[11]===b?x=t[12]:(x=(0,Z.jsx)(re,{className:`min-w-0 flex-1 truncate text-base font-semibold tracking-tight text-fg`,children:b}),t[11]=b,t[12]=x);let S;t[13]!==y||t[14]!==x?(S=(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3`,children:[y,x]}),t[13]=y,t[14]=x,t[15]=S):S=t[15];let C;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Z.jsx)(j,{className:`size-5`,strokeWidth:1.75}),t[16]=C):C=t[16];let w;t[17]===s.close?w=t[18]:(w=(0,Z.jsx)(F,{asChild:!0,children:(0,Z.jsx)(N,{type:`button`,variant:`ghost`,className:`size-9 shrink-0 p-0`,"aria-label":s.close,children:C})}),t[17]=s.close,t[18]=w);let T;t[19]!==S||t[20]!==w?(T=(0,Z.jsxs)(`div`,{className:`flex min-w-0 shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3 dark:border-edge`,children:[S,w]}),t[19]=S,t[20]=w,t[21]=T):T=t[21];let E;t[22]!==s.detailLoading||t[23]!==s.detailMessages||t[24]!==r||t[25]!==i?(E=r?(0,Z.jsx)(`p`,{className:`text-sm text-fg-muted`,children:s.detailLoading}):i?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`dl`,{className:`mb-4 grid gap-2 text-xs text-fg-muted`,children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{className:`text-fg-disabled`,children:`Key`}),(0,Z.jsx)(`dd`,{className:`mt-0.5 break-all font-mono text-fg`,children:i.key})]}),(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-4`,children:(0,Z.jsxs)(`span`,{children:[i.messageCount,` msgs · `,i.estimatedTokens,` tok`]})})]}),(0,Z.jsx)(`h3`,{className:`mb-2 text-xs font-medium uppercase tracking-wide text-fg-subtle`,children:s.detailMessages}),(0,Z.jsx)(`ul`,{className:`space-y-3`,children:i.messages.map(ft)})]}):null,t[22]=s.detailLoading,t[23]=s.detailMessages,t[24]=r,t[25]=i,t[26]=E):E=t[26];let D;t[27]===E?D=t[28]:(D=(0,Z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-3`,children:E}),t[27]=E,t[28]=D);let O;t[29]!==s.detailExport||t[30]!==p?(O=(0,Z.jsx)(N,{type:`button`,variant:`secondary`,className:`text-sm`,onClick:p,children:s.detailExport}),t[29]=s.detailExport,t[30]=p,t[31]=O):O=t[31];let k;t[32]!==h||t[33]!==s.archive||t[34]!==s.unarchive||t[35]!==l||t[36]!==u?(k=h?(0,Z.jsx)(N,{type:`button`,variant:`secondary`,className:`text-sm`,onClick:u,children:s.unarchive}):(0,Z.jsx)(N,{type:`button`,variant:`secondary`,className:`text-sm`,onClick:l,children:s.archive}),t[32]=h,t[33]=s.archive,t[34]=s.unarchive,t[35]=l,t[36]=u,t[37]=k):k=t[37];let A;t[38]!==g||t[39]!==s.pin||t[40]!==s.unpin||t[41]!==d||t[42]!==f?(A=g?(0,Z.jsx)(N,{type:`button`,variant:`secondary`,className:`text-sm`,onClick:f,children:s.unpin}):(0,Z.jsx)(N,{type:`button`,variant:`secondary`,className:`text-sm`,onClick:d,children:s.pin}),t[38]=g,t[39]=s.pin,t[40]=s.unpin,t[41]=d,t[42]=f,t[43]=A):A=t[43];let P;t[44]!==s.delete||t[45]!==m?(P=(0,Z.jsx)(N,{type:`button`,variant:`secondary`,className:`text-sm text-red-600 hover:bg-red-50 dark:text-red-400 dark:hover:bg-red-950/40`,onClick:m,children:s.delete}),t[44]=s.delete,t[45]=m,t[46]=P):P=t[46];let L;t[47]!==O||t[48]!==k||t[49]!==A||t[50]!==P?(L=(0,Z.jsx)(`div`,{className:`shrink-0 border-t border-edge px-4 py-3 dark:border-edge`,children:(0,Z.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[O,k,A,P]})}),t[47]=O,t[48]=k,t[49]=A,t[50]=P,t[51]=L):L=t[51];let R;t[52]!==T||t[53]!==D||t[54]!==L?(R=(0,Z.jsxs)(I,{children:[ee,(0,Z.jsxs)(ne,{className:v,"aria-describedby":void 0,children:[T,D,L]})]}),t[52]=T,t[53]=D,t[54]=L,t[55]=R):R=t[55];let z;return t[56]!==n||t[57]!==_||t[58]!==R?(z=(0,Z.jsx)(ie,{open:n,onOpenChange:_,children:R}),t[56]=n,t[57]=_,t[58]=R,t[59]=z):z=t[59],z}function ft(e){return(0,Z.jsxs)(`li`,{className:`rounded-lg border border-edge-subtle bg-surface-hover/50 p-2 dark:border-edge`,children:[(0,Z.jsx)(`div`,{className:`mb-1 text-[10px] font-medium uppercase text-fg-subtle`,children:e.role}),(0,Z.jsx)(`pre`,{className:`max-h-40 overflow-auto whitespace-pre-wrap break-words font-mono text-[11px] leading-relaxed text-fg-muted`,children:ut(e.content)})]},`${e.timestamp??``}-${e.role}-${ut(e.content).slice(0,24)}`)}var pt=20;function mt(e,t){return e.replace(/\{\{(\w+)\}\}/g,(e,n)=>String(t[n]??``))}var ht=new Set([`all`,`active`,`pinned`,`archived`]),gt=new Set([`grid`,`list`]),_t=[`sessions`,`settings`];function vt(e){return e&&_t.includes(e)?e:`sessions`}function yt(e,t){return t===`sessions`?e.tabsSessions:e.tabsSettings}function bt(e,t){return t===`sessions`?e.tabsSessionsHint:e.tabsSettingsHint}function xt(e){let t=(0,Ae.c)(7),{s:n,activeTab:r,onChange:i}=e,a;t[0]===n?a=t[1]:(a=_t.map(e=>({id:e,label:yt(n,e),icon:e===`sessions`?b:k})),t[0]=n,t[1]=a);let o=a,s;return t[2]!==r||t[3]!==o||t[4]!==i||t[5]!==n.tabsAriaLabel?(s=(0,Z.jsx)(ge,{items:o,activeTab:r,onChange:i,ariaLabel:n.tabsAriaLabel,tabIdPrefix:`sessions-tab`,panelIdPrefix:`sessions-panel`}),t[2]=r,t[3]=o,t[4]=i,t[5]=n.tabsAriaLabel,t[6]=s):s=t[6],s}function St(e){let t=(0,Ae.c)(10),{s:n,id:r,activeTab:i,plain:a,children:o}=e,s=a!==void 0&&a;if(i!==r)return null;let c=`sessions-panel-${r}`,l=`sessions-tab-${r}`,u=s?`contents`:`rounded-xl bg-surface-hover/20 px-4 py-5 sm:px-5`,d;t[0]!==o||t[1]!==r||t[2]!==s||t[3]!==n?(d=s?o:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`mb-5`,children:[(0,Z.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:yt(n,r)}),(0,Z.jsx)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:bt(n,r)})]}),(0,Z.jsx)(`div`,{className:`space-y-4`,children:o})]}),t[0]=o,t[1]=r,t[2]=s,t[3]=n,t[4]=d):d=t[4];let f;return t[5]!==c||t[6]!==l||t[7]!==u||t[8]!==d?(f=(0,Z.jsx)(`section`,{id:c,role:`tabpanel`,"aria-labelledby":l,className:u,children:d}),t[5]=c,t[6]=l,t[7]=u,t[8]=d,t[9]=f):f=t[9],f}function Ct(e){let t=e.get(`status`),n=e.get(`view`);return{searchInput:e.get(`q`)??``,debouncedSearch:(e.get(`q`)??``).trim(),statusFilter:ht.has(t)?t:`all`,viewMode:gt.has(n)?n:`grid`,channelFilter:(e.get(`channel`)??``).trim(),sessions:[],loading:!1,error:null,hasMore:!1,stats:null,detailOpen:!1,detailLoading:!1,detailSession:null,confirmOpen:!1,confirmKey:null}}function wt(){let e=l(s(e=>e.language)),t=e.sessions,n=o(e=>e.conversationId),r=!!n,{data:a,mutate:c}=L(r?[`gateway-chat-agents`,n]:null,ye,{revalidateOnFocus:!1}),d=a?.defaultId??`main`,f=a?.items??[],[m,h]=i(),_=vt(m.get(`tab`)),ee=(0,X.useCallback)(e=>{let t=new URLSearchParams(m);e===`sessions`?t.delete(`tab`):t.set(`tab`,e),h(t,{replace:!0})},[m,h]),[v,S]=(0,X.useReducer)(xe,m,Ct),{searchInput:C,debouncedSearch:w,statusFilter:E,viewMode:D,channelFilter:k,sessions:A,loading:j,error:P,hasMore:F,stats:V,detailOpen:H,detailLoading:me,detailSession:U,confirmOpen:he,confirmKey:W}=v;(0,X.useEffect)(()=>{let e=setTimeout(()=>{let e=C.trim();w!==e&&S({type:`patch`,patch:{debouncedSearch:e}})},300);return()=>clearTimeout(e)},[C,w]);let ge=m.toString(),_e=(0,X.useRef)(ge);if(_e.current!==ge){_e.current=ge;let e=m.get(`q`)??``,t=m.get(`status`),n=m.get(`view`),r=(m.get(`channel`)??``).trim(),i=ht.has(t)?t:`all`,a=gt.has(n)?n:`grid`,o=e.trim();S({type:`patch`,patch:{...C===e?{}:{searchInput:e},...w===o?{}:{debouncedSearch:o},...E===i?{}:{statusFilter:i},...D===a?{}:{viewMode:a},...k===r?{}:{channelFilter:r}}})}(0,X.useEffect)(()=>{let e=new URLSearchParams(m),t=w.trim();t?e.set(`q`,t):e.delete(`q`),E===`all`?e.delete(`status`):e.set(`status`,E),D===`grid`?e.delete(`view`):e.set(`view`,D),k?e.set(`channel`,k):e.delete(`channel`),e.toString()!==m.toString()&&h(e,{replace:!0})},[w,m,h,E,D,k]),(0,X.useEffect)(()=>{if(!r||_!==`sessions`)return;let e=!1;return(async()=>{S({type:`patch`,patch:{loading:!0,error:null}});try{let t=await fe({limit:pt,offset:0,...w?{search:w}:{},...E===`all`?{}:{status:E},...k?{channel:k}:{}});if(e)return;S({type:`patch`,patch:{sessions:t.items,hasMore:t.hasMore}})}catch(n){e||S({type:`patch`,patch:{error:n instanceof Error?n.message:t.loadError}})}finally{e||S({type:`patch`,patch:{loading:!1}})}})(),()=>{e=!0}},[r,_,w,E,k,t.loadError]),(0,X.useEffect)(()=>{!r||_!==`sessions`||le().then(e=>S({type:`patch`,patch:{stats:e}})).catch(()=>{})},[r,_]),(0,X.useEffect)(()=>{if(!r||_!==`sessions`)return;let e=()=>void c();return window.addEventListener(`config-reload`,e),()=>window.removeEventListener(`config-reload`,e)},[r,_,c]),(0,X.useEffect)(()=>{if(!r||_!==`sessions`)return;let e=e=>{let t=e.detail;!t?.key||t.name===void 0||S({type:`patch`,patch:{sessions:A.map(e=>e.key===t.key?{...e,name:t.name}:e),detailSession:U&&U.key===t.key?{...U,name:t.name}:U}})};return window.addEventListener(`session-updated`,e),()=>{window.removeEventListener(`session-updated`,e)}},[r,_,A,U]);let be=(0,X.useCallback)(async()=>{if(!(!r||j||!F)){S({type:`patch`,patch:{loading:!0,error:null}});try{let e=await fe({limit:pt,offset:A.length,...w?{search:w}:{},...E===`all`?{}:{status:E},...k?{channel:k}:{}});S({type:`patch`,patch:{sessions:[...A,...e.items],hasMore:e.hasMore}})}catch(e){S({type:`patch`,patch:{error:e instanceof Error?e.message:t.loadError}})}finally{S({type:`patch`,patch:{loading:!1}})}}},[r,j,F,A.length,w,E,k,t.loadError]),G=(0,X.useCallback)((e,t)=>{S({type:`patch`,patch:{sessions:A.map(n=>n.key===e?{...n,status:t}:n),detailSession:U&&U.key===e?{...U,status:t}:U}})},[A,U]),Se=(0,X.useCallback)(async e=>{S({type:`patch`,patch:{detailOpen:!0,detailLoading:!0,detailSession:null}});try{let t=await R(e);S({type:`patch`,patch:{detailSession:t}})}catch{S({type:`patch`,patch:{detailOpen:!1}})}finally{S({type:`patch`,patch:{detailLoading:!1}})}},[]),K=e=>{Se(e)},q=async(e,t)=>{if(t===`continue`){window.dispatchEvent(new CustomEvent(`navigate-to-chat`,{detail:{conversationId:e},bubbles:!0}));return}if(t===`delete`){S({type:`patch`,patch:{confirmKey:e,confirmOpen:!0}});return}try{switch(t){case`archive`:await pe(e),G(e,`archived`);break;case`unarchive`:await se(e),G(e,`active`);break;case`pin`:await z(e),G(e,`pinned`);break;case`unpin`:await ue(e),G(e,`active`);break;case`export`:{let t=await de(e),n=new Blob([t],{type:`application/json`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=`session-${e.replace(/[^a-z0-9]/gi,`_`)}.json`,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(r);break}default:break}le().then(e=>S({type:`patch`,patch:{stats:e}})).catch(()=>{})}catch{}},De=async e=>{try{await ce(e),S({type:`patch`,patch:{sessions:A.filter(t=>t.key!==e),detailSession:U?.key===e?null:U,...U?.key===e?{detailOpen:!1}:{}}}),le().then(e=>S({type:`patch`,patch:{stats:e}})).catch(()=>{})}catch{}},J={continueChat:t.continueChat,archive:t.archive,unarchive:t.unarchive,pin:t.pin,unpin:t.unpin,export:t.export,delete:t.delete,tokens:t.tokens,cost:t.cost,costPartial:t.costPartial,costUnknown:t.costUnknown,noUsage:t.noUsage,unnamedSession:e.chat.newSession},Oe={close:t.close,detailLoading:t.detailLoading,detailMessages:t.detailMessages,detailExport:t.detailExport,archive:t.archive,unarchive:t.unarchive,pin:t.pin,unpin:t.unpin,delete:t.delete,unnamedSession:e.chat.newSession},Y=[{key:`all`,label:t.filterAll,icon:b},{key:`active`,label:t.filterActive,icon:g},{key:`pinned`,label:t.filterPinned,icon:T},{key:`archived`,label:t.filterArchived,icon:p}],ke=(()=>{let e=Object.entries(V?.byChannel??{}).sort((e,t)=>t[1]-e[1]).slice(0,6).map(([e])=>e),t=new Set(e);for(let n of[`telegram`,`weixin`,`feishu`])t.has(n)||(e.push(n),t.add(n));return e.slice(0,8)})();return r?(0,Z.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-x-hidden bg-surface-panel`,children:[(0,Z.jsxs)(Te,{gap:`gap-6`,children:[(0,Z.jsx)(Ee,{title:t.title}),(0,Z.jsx)(xt,{s:t,activeTab:_,onChange:ee}),(0,Z.jsx)(St,{s:t,id:`settings`,activeTab:_,plain:!0,children:(0,Z.jsxs)(`div`,{className:`space-y-4`,children:[(0,Z.jsx)(nt,{hasToken:r}),(0,Z.jsx)(lt,{hasToken:r})]})}),(0,Z.jsxs)(St,{s:t,id:`sessions`,activeTab:_,plain:!0,children:[(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between`,children:[(0,Z.jsx)(ve,{className:`flex flex-wrap gap-2`,role:`group`,"aria-label":t.tabsSessions,indicatorClassName:`rounded-xl bg-accent-soft`,children:Y.map(({key:e,label:t,icon:n})=>(0,Z.jsxs)(`button`,{type:`button`,"aria-pressed":E===e,onClick:()=>S({type:`patch`,patch:{statusFilter:e}}),className:M(`inline-flex items-center gap-1.5 rounded-xl px-3 py-2 text-sm font-medium`,B.transition,B.focusRingPanel,E===e?`bg-accent-soft text-accent-fg`:`bg-surface-base text-fg-muted hover:bg-surface-hover hover:text-fg dark:bg-surface-hover/35`),children:[(0,Z.jsx)(n,{className:`size-4`,strokeWidth:1.75,"aria-hidden":!0}),t]},e))}),(0,Z.jsxs)(`div`,{className:`flex min-h-11 w-full min-w-0 items-center gap-2 rounded-xl bg-surface-base focus-within:ring-2 focus-within:ring-accent px-3 py-2 transition-colors lg:max-w-md dark:bg-surface-hover/40`,children:[(0,Z.jsx)(O,{className:`size-4 shrink-0 text-fg-disabled`,strokeWidth:1.75,"aria-hidden":!0}),(0,Z.jsx)(`input`,{type:`search`,value:C,onChange:e=>S({type:`patch`,patch:{searchInput:e.target.value}}),placeholder:t.searchPlaceholder,"aria-label":t.searchPlaceholder,"data-debounced-query":w||void 0,className:`min-w-0 flex-1 border-0 bg-transparent text-base sm:text-sm text-fg placeholder:text-fg-disabled focus:outline-none focus:ring-0`})]})]}),(0,Z.jsxs)(ve,{className:`flex flex-wrap items-center gap-2`,role:`group`,"aria-label":t.filterChannelLabel,indicatorClassName:`rounded-xl bg-accent-soft`,children:[(0,Z.jsx)(`span`,{className:`text-xs font-medium text-fg-subtle`,children:t.filterChannelLabel}),(0,Z.jsx)(`button`,{type:`button`,"aria-pressed":!k,onClick:()=>S({type:`patch`,patch:{channelFilter:``}}),className:M(`touch-target inline-flex items-center rounded-xl px-3 py-2 text-sm font-medium`,B.transition,B.focusRingPanel,k?`bg-surface-base text-fg-muted hover:bg-surface-hover hover:text-fg dark:bg-surface-hover/35`:`bg-accent-soft text-accent-fg`),children:t.filterChannelAll}),ke.map(e=>(0,Z.jsxs)(`button`,{type:`button`,"aria-pressed":k===e,onClick:()=>S({type:`patch`,patch:{channelFilter:e}}),className:M(`touch-target inline-flex items-center rounded-xl px-3 py-2 text-sm font-medium`,B.transition,B.focusRingPanel,k===e?`bg-accent-soft text-accent-fg`:`bg-surface-base text-fg-muted hover:bg-surface-hover hover:text-fg dark:bg-surface-hover/35`),children:[e,V?.byChannel?.[e]==null?null:(0,Z.jsx)(`span`,{className:`ml-2 rounded-full bg-surface-hover px-2 py-0.5 text-[11px] text-fg-subtle`,children:V.byChannel[e]})]},e))]}),V?(0,Z.jsx)(`div`,{className:`grid grid-cols-2 gap-3 sm:grid-cols-4`,children:[[V.totalSessions,t.totalSessions],[V.activeSessions,t.activeSessions],[V.pinnedSessions,t.pinnedSessions],[V.archivedSessions,t.archivedSessions]].map(([e,t])=>(0,Z.jsxs)(`div`,{className:`rounded-xl bg-surface-base p-3 dark:bg-surface-hover/30`,children:[(0,Z.jsx)(`div`,{className:`text-lg font-semibold tabular-nums text-fg`,children:e}),(0,Z.jsx)(`div`,{className:`text-xs text-fg-muted`,children:t})]},t))}):null,P?(0,Z.jsx)(`div`,{className:`rounded-lg bg-red-50 px-3 py-2 text-sm text-red-700 dark:bg-red-950/40 dark:text-red-300`,children:P}):null,(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,Z.jsx)(`p`,{className:`text-xs text-fg-muted`,children:mt(t.sessionCount,{count:A.length})}),(0,Z.jsxs)(ve,{className:we,role:`group`,"aria-label":t.layoutToggleGroup,indicatorClassName:`rounded-pill bg-surface-panel shadow-sm dark:ring-1 dark:ring-edge-strong/40`,children:[(0,Z.jsx)(N,{type:`button`,variant:`segmented`,title:t.gridView,"aria-pressed":D===`grid`,onClick:()=>S({type:`patch`,patch:{viewMode:`grid`}}),className:M(Ce,`size-7 p-0`,D===`grid`&&`bg-surface-panel shadow-sm dark:bg-surface-panel dark:shadow-sm dark:ring-1 dark:ring-edge-strong/40`,D===`grid`&&`text-accent-fg`),children:(0,Z.jsx)(x,{className:`size-3.5`,strokeWidth:1.5})}),(0,Z.jsx)(N,{type:`button`,variant:`segmented`,title:t.listView,"aria-pressed":D===`list`,onClick:()=>S({type:`patch`,patch:{viewMode:`list`}}),className:M(Ce,`size-9 p-0`,D===`list`&&`bg-surface-panel shadow-sm dark:bg-surface-panel dark:shadow-sm dark:ring-1 dark:ring-edge-strong/40`,D===`list`&&`text-accent-fg`),children:(0,Z.jsx)(u,{className:`size-3.5`,strokeWidth:1.5})})]})]}),j&&A.length===0?(0,Z.jsx)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3`,children:Array.from({length:6}).map((e,t)=>(0,Z.jsx)(`div`,{className:`h-40 animate-pulse rounded-xl bg-surface-hover/60 dark:bg-surface-hover/40`},t))}):A.length===0?(0,Z.jsxs)(`div`,{className:`flex flex-col items-center justify-center rounded-2xl bg-surface-base py-16 text-center dark:bg-surface-hover/25`,children:[(0,Z.jsx)(y,{className:`mb-3 size-12 text-fg-disabled`,strokeWidth:1.25,"aria-hidden":!0}),(0,Z.jsx)(`p`,{className:`text-base font-semibold text-fg`,children:t.noSessions}),(0,Z.jsx)(`p`,{className:`mt-1 max-w-sm text-sm text-fg-muted`,children:t.noSessionsDescription}),(0,Z.jsx)(N,{variant:`primary`,className:`mt-6`,onClick:()=>{window.dispatchEvent(new CustomEvent(`navigate-to-chat`,{detail:{conversationId:``},bubbles:!0}))},children:t.startNewChat})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:M(`grid min-w-0 gap-3`,D===`grid`?`sm:grid-cols-2 lg:grid-cols-3`:`grid-cols-1`),"data-debounced-query":w||void 0,children:A.map(e=>{let t=ze(e,d);return(0,Z.jsx)(Pe,{session:e,variant:D,labels:J,sessionAgentId:t,sessionAgentAvatar:Be(t,f),onOpen:()=>K(e.key),onAction:t=>void q(e.key,t)},e.key)})}),F?(0,Z.jsx)(`div`,{className:`flex justify-center pt-2`,children:(0,Z.jsx)(N,{type:`button`,variant:`secondary`,disabled:j,onClick:()=>void be(),children:t.loadMore})}):null]})]})]}),(0,Z.jsx)(dt,{open:H,loading:me,session:U,sessionAgentId:U?ze(U,d):void 0,sessionAgentAvatar:U?Be(ze(U,d),f):void 0,labels:Oe,onClose:()=>{S({type:`patch`,patch:{detailOpen:!1,detailSession:null}})},onArchive:()=>U&&void q(U.key,`archive`),onUnarchive:()=>U&&void q(U.key,`unarchive`),onPin:()=>U&&void q(U.key,`pin`),onUnpin:()=>U&&void q(U.key,`unpin`),onExport:()=>U&&void q(U.key,`export`),onDelete:()=>U&&S({type:`patch`,patch:{confirmKey:U.key,confirmOpen:!0}})}),(0,Z.jsx)(ie,{open:he,onOpenChange:e=>S({type:`patch`,patch:{confirmOpen:e}}),children:(0,Z.jsxs)(I,{children:[(0,Z.jsx)(te,{className:M(`xopc-dialog-overlay fixed inset-0 bg-scrim`,oe)}),(0,Z.jsxs)(ne,{className:M(`xopc-dialog-content fixed left-1/2 top-1/2 w-[min(100%-2rem,24rem)] -translate-x-1/2 -translate-y-1/2 rounded-xl border border-edge bg-surface-overlay p-4 shadow-popover dark:border-edge`,ae),children:[(0,Z.jsx)(re,{className:`text-base font-semibold text-fg`,children:t.deleteSessionTitle}),(0,Z.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:W?mt(t.deleteSessionMessage,{name:A.find(e=>e.key===W)?.name?.trim()||e.chat.newSession}):``}),(0,Z.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[(0,Z.jsx)(N,{type:`button`,variant:`secondary`,onClick:()=>S({type:`patch`,patch:{confirmOpen:!1}}),children:t.cancel}),(0,Z.jsx)(N,{type:`button`,variant:`primary`,className:`bg-red-600 hover:bg-red-700`,onClick:()=>{W&&De(W),S({type:`patch`,patch:{confirmOpen:!1,confirmKey:null}})},children:t.delete})]})]})]})})]}):(0,Z.jsx)(`div`,{className:`w-full px-3 py-16 text-center text-sm text-fg-muted sm:px-5 xl:px-6`,children:t.needToken})}export{wt as SessionsPage};
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{m as i}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{i as a,l as o,n as s,o as c}from"./locale-store-Br7IfbXK.js";import{t as l}from"./messages-ByFlEbsu.js";import{n as u,r as d,t as f}from"./session-identity-label-B7sgG1PE.js";import{t as p}from"./archive-Dz0hferG.js";import{n as m,r as h}from"./popover-select-DD8fmrxH.js";import{t as g}from"./circle-BoO4YvTx.js";import{t as _}from"./coins-DjP27vUx.js";import{t as ee}from"./database-CjjeZfRG.js";import{t as v}from"./download-Dk-ZjtO6.js";import{t as y}from"./folder-open-CyzJ19I9.js";import{t as b}from"./layers-mJW7JJKm.js";import{t as x}from"./layout-grid-CEVZdVFU.js";import{t as S}from"./message-square-fVE7Ghj1.js";import{t as C}from"./minimize-2-DtOGrlpo.js";import{t as w}from"./session-channel-icon-SsY70Z6t.js";import{n as T,t as E}from"./pin-off-BMRv-Kxr.js";import{t as D}from"./plus-Q2yW6OE7.js";import{t as O}from"./search-DA7gz22f.js";import{t as k}from"./settings-uiTATseT.js";import{t as A}from"./trash-2-DusmjVPV.js";import{t as j}from"./x-B_N4OPjy.js";import{t as M}from"./cn-0WouolD0.js";import{t as N}from"./button-CnRSIP6m.js";import{t as P}from"./skeleton-BI5TyibZ.js";import{a as te,n as F,o as I,r as ne,s as re,t as ie}from"./dist-DfWfZ9iu.js";import{i as ae,o as oe}from"./settings-shell-dialog-layer-BU3UuiJr.js";import{i as L}from"./vendor-swr-CdRzEUwF.js";import{a as R,c as z,f as se,n as ce,o as le,p as ue,r as de,s as fe,t as pe}from"./session-api-Bs3r_d2_.js";import{n as B,t as V}from"./interaction-BdhHBbYa.js";import{n as H,r as me}from"./gateway-config-swr-BOCt_zOo.js";import{n as U,t as he}from"./registry-api-DFDvOTg4.js";import{s as W}from"./form-field-width-DJw_jULe.js";import{t as ge}from"./page-tabs-oeTY7z3_.js";import{t as _e}from"./agent-avatar-display-6Z4m31Fz.js";import{t as ve}from"./sliding-tab-list-DuQyViqe.js";import{t as ye}from"./chat-agents-api-D8YS5amE.js";import{n as be,r as xe,t as G}from"./settings-form-draft-Dy10ldo8.js";import{n as Se}from"./model-selector-CXcxc30J.js";import{n as Ce,r as we}from"./segmented-styles-Cqb91xsn.js";import{t as K}from"./settings-advanced-section-CURRjsLK.js";import{t as q}from"./number-input-El7Szeln.js";import{n as Te,t as Ee}from"./settings-page-header-DBL0_u0Z.js";import"./settings-page-layout-IAvpbz4A.js";import{n as De,t as J}from"./settings-form-section-num14vSv.js";import{n as Oe,t as Y}from"./use-autosave-YHxQ-UZg.js";import{t as ke}from"./settings-advanced-gate-BI4DMz4_.js";var X=e(t(),1),Ae=n(),Z=r();function je(e){let t=new Date(e),n=Math.floor((new Date().getTime()-t.getTime())/(1e3*60*60*24));return n===0?t.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}):n===1?`Yesterday`:n<7?t.toLocaleDateString([],{weekday:`short`}):t.toLocaleDateString([],{month:`short`,day:`numeric`})}function Me(e,t){return new Intl.NumberFormat(t===`zh`?`zh-CN`:`en-US`).format(e)}function Ne(e){return`$${Number(e).toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:6})}`}function Pe(e){let t=(0,Ae.c)(124),{session:n,variant:r,labels:i,sessionAgentId:a,sessionAgentAvatar:o,onOpen:c,onAction:u}=e,m;t[0]!==i.unnamedSession||t[1]!==n.name?(m=n.name?.trim()||i.unnamedSession,t[0]=i.unnamedSession,t[1]=n.name,t[2]=m):m=t[2];let h=m,g=s(Re),y;t[3]!==g||t[4]!==n?(y=f(n,l(g).sidebar.sessionFilters),t[3]=g,t[4]=n,t[5]=y):y=t[5];let b=y,x;t[6]===n.name?x=t[7]:(x=n.name?.trim(),t[6]=n.name,t[7]=x);let C=!!x,D=n.status===`archived`,O=n.status===`pinned`,k=n.usage,j;t[8]!==i.costUnknown||t[9]!==i.noUsage||t[10]!==k?(j=k?.calls?k.costCompleteness===`unknown`?i.costUnknown:`${k.costCompleteness===`partial`?`≥ `:`≈ `}${Ne(k.knownCostUsd)}`:i.noUsage,t[8]=i.costUnknown,t[9]=i.noUsage,t[10]=k,t[11]=j):j=t[11];let N=j,P=k?.calls?k.costCompleteness===`partial`?i.costPartial:k.costCompleteness===`unknown`?i.costUnknown:i.cost:i.noUsage,te=r===`list`&&`sm:flex-row sm:items-center sm:gap-4`,F;t[12]===te?F=t[13]:(F=M(`group flex min-w-0 w-full max-w-full cursor-pointer flex-col rounded-xl bg-surface-base text-left transition-colors duration-150 ease-out`,`hover:bg-surface-hover active:scale-[0.99]`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`,te),t[12]=te,t[13]=F);let I;t[14]===c?I=t[15]:(I=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),c())},t[14]=c,t[15]=I);let ne=r===`list`&&`sm:py-3`,re;t[16]===ne?re=t[17]:(re=M(`flex min-w-0 items-start justify-between gap-2 bg-surface-hover/35 px-3 py-2 dark:bg-surface-hover/25`,ne),t[16]=ne,t[17]=re);let ie;t[18]===n?ie=t[19]:(ie=(0,Z.jsx)(w,{sourceChannel:n.sourceChannel,session:n,className:`size-3.5`}),t[18]=n,t[19]=ie);let ae;t[20]===b?ae=t[21]:(ae=(0,Z.jsx)(`span`,{className:`truncate text-[11px] font-medium uppercase tracking-wide text-fg-subtle`,children:b}),t[20]=b,t[21]=ae);let oe;t[22]!==ie||t[23]!==ae?(oe=(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[ie,ae]}),t[22]=ie,t[23]=ae,t[24]=oe):oe=t[24];let L;t[25]===O?L=t[26]:(L=O?(0,Z.jsx)(T,{className:`size-3.5 text-accent-fg`,strokeWidth:1.75,"aria-hidden":!0}):null,t[25]=O,t[26]=L);let R;t[27]===n.updatedAt?R=t[28]:(R=je(n.updatedAt),t[27]=n.updatedAt,t[28]=R);let z;t[29]===R?z=t[30]:(z=(0,Z.jsx)(`span`,{children:R}),t[29]=R,t[30]=z);let se;t[31]!==L||t[32]!==z?(se=(0,Z.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5 text-xs text-fg-muted`,children:[L,z]}),t[31]=L,t[32]=z,t[33]=se):se=t[33];let ce;t[34]!==oe||t[35]!==se||t[36]!==re?(ce=(0,Z.jsxs)(`div`,{className:re,children:[oe,se]}),t[34]=oe,t[35]=se,t[36]=re,t[37]=ce):ce=t[37];let le=r===`list`&&`sm:py-3`,ue;t[38]===le?ue=t[39]:(ue=M(`min-w-0 flex-1 px-3 py-2`,le),t[38]=le,t[39]=ue);let de=r===`list`&&`sm:items-start`,fe;t[40]===de?fe=t[41]:(fe=M(`flex gap-3`,de),t[40]=de,t[41]=fe);let pe;t[42]!==o||t[43]!==a?(pe=(0,Z.jsx)(_e,{agentId:a,avatar:o,size:40,className:`size-10 shrink-0 ring-1 ring-edge/60 dark:ring-edge`}),t[42]=o,t[43]=a,t[44]=pe):pe=t[44];let B;t[45]===h?B=t[46]:(B=(0,Z.jsx)(`div`,{className:`min-w-0 max-w-full truncate text-sm font-semibold text-fg`,title:h,children:h}),t[45]=h,t[46]=B);let H;t[47]!==n.key||t[48]!==C?(H=C?(0,Z.jsx)(`div`,{className:`mt-0.5 min-w-0 max-w-full truncate font-mono text-[11px] text-fg-subtle`,title:n.key,children:n.key}):null,t[47]=n.key,t[48]=C,t[49]=H):H=t[49];let me;t[50]!==B||t[51]!==H?(me=(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[B,H]}),t[50]=B,t[51]=H,t[52]=me):me=t[52];let U;t[53]!==fe||t[54]!==pe||t[55]!==me?(U=(0,Z.jsxs)(`div`,{className:fe,children:[pe,me]}),t[53]=fe,t[54]=pe,t[55]=me,t[56]=U):U=t[56];let he;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(he=(0,Z.jsx)(S,{className:`size-3.5`,strokeWidth:1.75,"aria-hidden":!0}),t[57]=he):he=t[57];let W;t[58]===n.messageCount?W=t[59]:(W=(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[he,n.messageCount]}),t[58]=n.messageCount,t[59]=W);let ge;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(ge=(0,Z.jsx)(ee,{className:`size-3.5`,strokeWidth:1.75,"aria-hidden":!0}),t[60]=ge):ge=t[60];let ve=k?.totalTokens??0,ye;t[61]!==g||t[62]!==ve?(ye=Me(ve,g),t[61]=g,t[62]=ve,t[63]=ye):ye=t[63];let be;t[64]!==i.tokens||t[65]!==ye?(be=(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[ge,ye,` `,i.tokens]}),t[64]=i.tokens,t[65]=ye,t[66]=be):be=t[66];let xe;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(xe=(0,Z.jsx)(_,{className:`size-3.5`,strokeWidth:1.75,"aria-hidden":!0}),t[67]=xe):xe=t[67];let G;t[68]!==N||t[69]!==P?(G=(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1`,title:P,children:[xe,N]}),t[68]=N,t[69]=P,t[70]=G):G=t[70];let Se;t[71]!==W||t[72]!==be||t[73]!==G?(Se=(0,Z.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-3 text-xs text-fg-muted`,children:[W,be,G]}),t[71]=W,t[72]=be,t[73]=G,t[74]=Se):Se=t[74];let Ce;t[75]===n.tags?Ce=t[76]:(Ce=n.tags.length>0?(0,Z.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1`,children:[n.tags.slice(0,3).map(Le),n.tags.length>3?(0,Z.jsxs)(`span`,{className:`text-[11px] text-fg-disabled`,children:[`+`,n.tags.length-3]}):null]}):null,t[75]=n.tags,t[76]=Ce);let we;t[77]!==ue||t[78]!==U||t[79]!==Se||t[80]!==Ce?(we=(0,Z.jsxs)(`div`,{className:ue,children:[U,Se,Ce]}),t[77]=ue,t[78]=U,t[79]=Se,t[80]=Ce,t[81]=we):we=t[81];let K;t[82]===u?K=t[83]:(K=()=>u(`continue`),t[82]=u,t[83]=K);let q;t[84]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,Z.jsx)(S,{className:`size-4`,strokeWidth:1.75}),t[84]=q):q=t[84];let Te;t[85]!==i.continueChat||t[86]!==K?(Te=(0,Z.jsx)(`button`,{type:`button`,className:V,title:i.continueChat,"aria-label":i.continueChat,onClick:K,children:q}),t[85]=i.continueChat,t[86]=K,t[87]=Te):Te=t[87];let Ee;t[88]!==D||t[89]!==i.archive||t[90]!==i.unarchive||t[91]!==u?(Ee=D?(0,Z.jsx)(`button`,{type:`button`,className:V,title:i.unarchive,"aria-label":i.unarchive,onClick:()=>u(`unarchive`),children:(0,Z.jsx)(d,{className:`size-4`,strokeWidth:1.75})}):(0,Z.jsx)(`button`,{type:`button`,className:V,title:i.archive,"aria-label":i.archive,onClick:()=>u(`archive`),children:(0,Z.jsx)(p,{className:`size-4`,strokeWidth:1.75})}),t[88]=D,t[89]=i.archive,t[90]=i.unarchive,t[91]=u,t[92]=Ee):Ee=t[92];let De;t[93]!==O||t[94]!==i.pin||t[95]!==i.unpin||t[96]!==u?(De=O?(0,Z.jsx)(`button`,{type:`button`,className:V,title:i.unpin,"aria-label":i.unpin,onClick:()=>u(`unpin`),children:(0,Z.jsx)(E,{className:`size-4`,strokeWidth:1.75})}):(0,Z.jsx)(`button`,{type:`button`,className:V,title:i.pin,"aria-label":i.pin,onClick:()=>u(`pin`),children:(0,Z.jsx)(T,{className:`size-4`,strokeWidth:1.75})}),t[93]=O,t[94]=i.pin,t[95]=i.unpin,t[96]=u,t[97]=De):De=t[97];let J;t[98]===u?J=t[99]:(J=()=>u(`export`),t[98]=u,t[99]=J);let Oe;t[100]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=(0,Z.jsx)(v,{className:`size-4`,strokeWidth:1.75}),t[100]=Oe):Oe=t[100];let Y;t[101]!==i.export||t[102]!==J?(Y=(0,Z.jsx)(`button`,{type:`button`,className:V,title:i.export,"aria-label":i.export,onClick:J,children:Oe}),t[101]=i.export,t[102]=J,t[103]=Y):Y=t[103];let ke;t[104]===Symbol.for(`react.memo_cache_sentinel`)?(ke=M(V,`text-red-600 hover:bg-red-50 dark:text-red-400 dark:hover:bg-red-950/40`),t[104]=ke):ke=t[104];let X;t[105]===u?X=t[106]:(X=()=>u(`delete`),t[105]=u,t[106]=X);let Pe;t[107]===Symbol.for(`react.memo_cache_sentinel`)?(Pe=(0,Z.jsx)(A,{className:`size-4`,strokeWidth:1.75}),t[107]=Pe):Pe=t[107];let ze;t[108]!==i.delete||t[109]!==X?(ze=(0,Z.jsx)(`button`,{type:`button`,className:ke,title:i.delete,"aria-label":i.delete,onClick:X,children:Pe}),t[108]=i.delete,t[109]=X,t[110]=ze):ze=t[110];let Be;t[111]!==Te||t[112]!==Ee||t[113]!==De||t[114]!==Y||t[115]!==ze?(Be=(0,Z.jsxs)(`div`,{role:`group`,className:`m-1 mt-0 flex flex-wrap items-center gap-0.5 rounded-lg bg-surface-hover/35 p-1.5`,onClick:Ie,onKeyDown:Fe,children:[Te,Ee,De,Y,ze]}),t[111]=Te,t[112]=Ee,t[113]=De,t[114]=Y,t[115]=ze,t[116]=Be):Be=t[116];let Ve;return t[117]!==c||t[118]!==ce||t[119]!==we||t[120]!==Be||t[121]!==F||t[122]!==I?(Ve=(0,Z.jsxs)(`div`,{role:`button`,tabIndex:0,className:F,onClick:c,onKeyDown:I,children:[ce,we,Be]}),t[117]=c,t[118]=ce,t[119]=we,t[120]=Be,t[121]=F,t[122]=I,t[123]=Ve):Ve=t[123],Ve}function Fe(e){return e.stopPropagation()}function Ie(e){return e.stopPropagation()}function Le(e){return(0,Z.jsx)(`span`,{className:`max-w-full break-words rounded-md bg-surface-hover px-1.5 py-0.5 text-[11px] text-fg-muted`,children:e},e)}function Re(e){return e.language}function ze(e,t){return e.routing?.agentId?.trim().toLowerCase()||t.trim().toLowerCase()||`main`}function Be(e,t){return t.find(t=>t.id===e)?.avatar}var Ve={enabled:!0,triggerThreshold:.8,reserveTokens:8192,minMessagesBeforeCompact:10,keepRecentTokens:2e4,recentTurnsPreserve:3,summaryMaxTokens:16e3,summaryChunkTokens:24e3,summaryTimeoutMs:18e4,summaryRetries:2,qualityGuard:!0,gapAudit:!0,minToolResultKeepChars:1e3,maxActiveTranscriptBytes:2e6,postCompactionSections:[`Session Startup`,`Red Lines`]};function He(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Ue(e,t,n,r=1/0){return typeof e==`number`&&Number.isFinite(e)&&e>=n&&e<=r?e:t}function Q(e,t,n,r=1/0){return Number.isInteger(e)&&e>=n&&e<=r?e:t}function We(e){let t=He(e)?e:{},n=He(t.userContext)?t.userContext:{},r=He(n.contextPlanning)?n.contextPlanning:{},i=He(r.compaction)?r.compaction:{},a=Ve,o=typeof i.model==`string`&&i.model.trim()?i.model.trim():void 0,s=Array.isArray(i.postCompactionSections)&&i.postCompactionSections.length<=12&&i.postCompactionSections.every(e=>typeof e==`string`&&e.trim())?[...new Set(i.postCompactionSections.map(e=>e.trim()))]:[...a.postCompactionSections];return{enabled:typeof i.enabled==`boolean`?i.enabled:a.enabled,triggerThreshold:Ue(i.triggerThreshold,a.triggerThreshold,.1,.98),reserveTokens:Q(i.reserveTokens,a.reserveTokens,1024),minMessagesBeforeCompact:Q(i.minMessagesBeforeCompact,a.minMessagesBeforeCompact,2),keepRecentTokens:Q(i.keepRecentTokens,a.keepRecentTokens,1e3),recentTurnsPreserve:Q(i.recentTurnsPreserve,a.recentTurnsPreserve,1,12),summaryMaxTokens:Q(i.summaryMaxTokens,a.summaryMaxTokens,256),summaryChunkTokens:Q(i.summaryChunkTokens,a.summaryChunkTokens,1e3),summaryTimeoutMs:Q(i.summaryTimeoutMs,a.summaryTimeoutMs,1e3,6e5),summaryRetries:Q(i.summaryRetries,a.summaryRetries,0,5),qualityGuard:typeof i.qualityGuard==`boolean`?i.qualityGuard:a.qualityGuard,gapAudit:typeof i.gapAudit==`boolean`?i.gapAudit:a.gapAudit,...o?{model:o}:{},minToolResultKeepChars:Q(i.minToolResultKeepChars,a.minToolResultKeepChars,200),maxActiveTranscriptBytes:Q(i.maxActiveTranscriptBytes,a.maxActiveTranscriptBytes,64e3),postCompactionSections:s}}function Ge(e){return e.triggerThreshold<.1||e.triggerThreshold>.98?`triggerThreshold`:!Number.isInteger(e.reserveTokens)||e.reserveTokens<1024?`reserveTokens`:!Number.isInteger(e.minMessagesBeforeCompact)||e.minMessagesBeforeCompact<2?`minMessagesBeforeCompact`:!Number.isInteger(e.keepRecentTokens)||e.keepRecentTokens<1e3?`keepRecentTokens`:!Number.isInteger(e.recentTurnsPreserve)||e.recentTurnsPreserve<1||e.recentTurnsPreserve>12?`recentTurnsPreserve`:!Number.isInteger(e.summaryMaxTokens)||e.summaryMaxTokens<256?`summaryMaxTokens`:!Number.isInteger(e.summaryChunkTokens)||e.summaryChunkTokens<1e3?`summaryChunkTokens`:!Number.isInteger(e.summaryTimeoutMs)||e.summaryTimeoutMs<1e3||e.summaryTimeoutMs>6e5?`summaryTimeoutMs`:!Number.isInteger(e.summaryRetries)||e.summaryRetries<0||e.summaryRetries>5?`summaryRetries`:e.model!==void 0&&!e.model.trim()?`model`:!Number.isInteger(e.minToolResultKeepChars)||e.minToolResultKeepChars<200?`minToolResultKeepChars`:!Number.isInteger(e.maxActiveTranscriptBytes)||e.maxActiveTranscriptBytes<64e3?`maxActiveTranscriptBytes`:e.postCompactionSections.length>12||e.postCompactionSections.some(e=>!e.trim())?`postCompactionSections`:null}function Ke(e){let t={...e,...e.model?.trim()?{model:e.model.trim()}:{}};return e.model?.trim()||delete t.model,{userContext:{contextPlanning:{compaction:t}}}}async function qe(e){await c(a(`/api/config`),{method:`PATCH`,body:JSON.stringify(Ke(e))}),await H()}var Je=128e3,Ye={balanced:Ve,preserve:{...Ve,triggerThreshold:.88,keepRecentTokens:32e3,recentTurnsPreserve:5,maxActiveTranscriptBytes:4e6},early:{...Ve,triggerThreshold:.65,reserveTokens:12e3,minMessagesBeforeCompact:6,keepRecentTokens:12e3,recentTurnsPreserve:2}},Xe=G();function Ze(){return M(`w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg disabled:cursor-not-allowed disabled:opacity-55`,W,`dark:border-edge`)}function Qe(e){let{enabled:t,model:n,postCompactionSections:r,...i}=e;return JSON.stringify(i)}function $e(e){let t=Qe(e);for(let[e,n]of Object.entries(Ye))if(t===Qe(n))return e;return`custom`}function et(e){return e>=1e6?`${(e/1e6).toFixed(e%1e6==0?0:1)}m`:e>=1e3?`${(e/1e3).toFixed(e%1e3==0?0:1)}k`:String(e)}function $(e){let t=(0,Ae.c)(20),{id:n,label:r,hint:i,value:a,min:o,max:s,step:c,disabled:l,onChange:u}=e,d=c===void 0?1:c,f;t[0]!==n||t[1]!==r?(f=(0,Z.jsx)(`label`,{className:`mb-1 block text-sm font-medium text-fg`,htmlFor:n,children:r}),t[0]=n,t[1]=r,t[2]=f):f=t[2];let p;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(p=Ze(),t[3]=p):p=t[3];let m;t[4]===u?m=t[5]:(m=e=>{if(!e.target.value.trim())return;let t=Number(e.target.value);Number.isFinite(t)&&u(t)},t[4]=u,t[5]=m);let h;t[6]!==l||t[7]!==n||t[8]!==s||t[9]!==o||t[10]!==d||t[11]!==m||t[12]!==a?(h=(0,Z.jsx)(q,{id:n,type:`number`,min:o,max:s,step:d,disabled:l,className:p,value:a,onChange:m}),t[6]=l,t[7]=n,t[8]=s,t[9]=o,t[10]=d,t[11]=m,t[12]=a,t[13]=h):h=t[13];let g;t[14]===i?g=t[15]:(g=i?(0,Z.jsx)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:i}):null,t[14]=i,t[15]=g);let _;return t[16]!==f||t[17]!==h||t[18]!==g?(_=(0,Z.jsxs)(`div`,{children:[f,h,g]}),t[16]=f,t[17]=h,t[18]=g,t[19]=_):_=t[19],_}function tt(e){let t=(0,Ae.c)(19),{label:n,hint:r,checked:i,disabled:a,onChange:o}=e,s=a?`cursor-not-allowed opacity-55`:`cursor-pointer`,c;t[0]===s?c=t[1]:(c=M(`flex items-start gap-2 text-sm text-fg`,s),t[0]=s,t[1]=c);let l;t[2]===o?l=t[3]:(l=e=>o(e.target.checked),t[2]=o,t[3]=l);let u;t[4]!==i||t[5]!==a||t[6]!==l?(u=(0,Z.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox mt-0.5`,checked:i,disabled:a,onChange:l}),t[4]=i,t[5]=a,t[6]=l,t[7]=u):u=t[7];let d;t[8]===n?d=t[9]:(d=(0,Z.jsx)(`span`,{className:`font-medium`,children:n}),t[8]=n,t[9]=d);let f;t[10]===r?f=t[11]:(f=(0,Z.jsx)(`span`,{className:`mt-0.5 block text-xs text-fg-subtle`,children:r}),t[10]=r,t[11]=f);let p;t[12]!==d||t[13]!==f?(p=(0,Z.jsxs)(`span`,{children:[d,f]}),t[12]=d,t[13]=f,t[14]=p):p=t[14];let m;return t[15]!==c||t[16]!==u||t[17]!==p?(m=(0,Z.jsxs)(`label`,{className:c,children:[u,p]}),t[15]=c,t[16]=u,t[17]=p,t[18]=m):m=t[18],m}function nt({hasToken:e}){let t=l(s(e=>e.language)).sessions.compaction,{data:n,isLoading:r}=me(e),{data:i=[],isLoading:a}=L(e?he:null,U,{revalidateOnFocus:!1}),o=(0,X.useMemo)(()=>n?.payload?.config===void 0?null:We(n.payload.config),[n]),[c,u]=(0,X.useReducer)(Xe,{form:null,baseline:null}),[d,f]=(0,X.useState)(``),p=(0,X.useRef)(!1),m=(0,X.useRef)(c.form);m.current=c.form;let h=(0,X.useRef)(null);be({enabled:e,parsed:o,dirty:p.current,trackedParsedRef:h,dispatch:u,onResetDirty:()=>{p.current=!1}});let g=c.form,_=c.baseline,ee=!!(g&&_&&JSON.stringify(g)!==JSON.stringify(_)),v=(0,X.useCallback)(e=>{p.current=!0,u({type:`patch`,patch:e})},[]),y=(0,X.useCallback)(e=>({enabled:t.enabled,triggerThreshold:t.triggerThreshold,reserveTokens:t.reserveTokens,minMessagesBeforeCompact:t.minMessagesBeforeCompact,keepRecentTokens:t.keepRecentTokens,recentTurnsPreserve:t.recentTurnsPreserve,summaryMaxTokens:t.summaryMaxTokens,summaryChunkTokens:t.summaryChunkTokens,summaryTimeoutMs:t.summaryTimeoutSeconds,summaryRetries:t.summaryRetries,qualityGuard:t.qualityGuard,gapAudit:t.gapAudit,model:t.summaryModel,minToolResultKeepChars:t.minToolResultKeepChars,maxActiveTranscriptBytes:t.maxActiveTranscriptMb,postCompactionSections:t.postCompactionSections})[e],[t]),b=Y({value:g,dirty:ee,onSave:(0,X.useCallback)(async e=>{try{await qe(e),u({type:`saved`,value:e}),p.current=!!(m.current&&JSON.stringify(m.current)!==JSON.stringify(e))}catch(e){throw Error(e instanceof Error?e.message:t.saveError)}},[t.saveError]),validate:e=>{let n=Ge(e);return n?t.invalidValue.replace(`{{field}}`,y(n)):null}});if(!e||!g)return r?(0,Z.jsx)(J,{children:(0,Z.jsxs)(`div`,{className:`space-y-3`,"aria-busy":!0,children:[(0,Z.jsx)(P,{className:`h-5 w-48`}),(0,Z.jsx)(P,{className:`h-20 w-full rounded-xl`}),(0,Z.jsx)(P,{className:`h-36 w-full rounded-xl`})]})}):null;let x=$e(g),S=Math.max(0,Je-g.reserveTokens),w=Math.min(Math.floor(Je*g.triggerThreshold),S),T=Math.min(100,w/Je*100),E=Math.min(100,S/Je*100),O=g.model?i.find(e=>e.id===g.model):void 0,k=O?.contextWindow&&g.summaryChunkTokens+g.summaryMaxTokens+4096>O.contextWindow,A=g.keepRecentTokens+g.reserveTokens>w,te=Math.round(g.summaryTimeoutMs*(g.summaryRetries+1)/1e3),F=e=>{let t=Ye[e];v({...t,...g.model?{model:g.model}:{model:void 0},postCompactionSections:g.postCompactionSections})},I={balanced:{title:t.presetBalanced,hint:t.presetBalancedHint},preserve:{title:t.presetPreserve,hint:t.presetPreserveHint},early:{title:t.presetEarly,hint:t.presetEarlyHint}},ne=()=>{let e=d.trim();!e||g.postCompactionSections.includes(e)||g.postCompactionSections.length>=12||(v({postCompactionSections:[...g.postCompactionSections,e]}),f(``))};return(0,Z.jsxs)(J,{onBlurCapture:b.onBlurCapture,children:[(0,Z.jsx)(De,{icon:C,title:t.title,subtitle:t.hint,trailing:(0,Z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Z.jsx)(Oe,{status:b.status,error:b.error}),(0,Z.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2 text-sm font-medium text-fg`,children:[(0,Z.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:g.enabled,onChange:e=>v({enabled:e.target.checked})}),g.enabled?t.enabled:t.disabled]})]})}),b.error?(0,Z.jsx)(`p`,{className:`mb-4 rounded-lg bg-red-50 px-3 py-2 text-sm text-red-700 dark:bg-red-950/40 dark:text-red-300`,role:`alert`,children:b.error}):null,g.enabled?null:(0,Z.jsx)(`p`,{className:`mb-4 rounded-lg bg-amber-50 px-3 py-2 text-xs text-amber-950 dark:bg-amber-950/40 dark:text-amber-100`,children:t.disabledWarning}),(0,Z.jsxs)(`fieldset`,{disabled:!g.enabled,className:`space-y-5 disabled:opacity-60`,children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-3`,children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:t.presetTitle}),(0,Z.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-subtle`,children:t.presetHint})]}),x===`custom`?(0,Z.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2 py-1 text-[11px] font-medium text-fg-muted`,children:t.presetCustom}):null]}),(0,Z.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-3`,children:[`balanced`,`preserve`,`early`].map(e=>(0,Z.jsxs)(`button`,{type:`button`,"aria-pressed":x===e,className:M(`rounded-xl bg-surface-base/55 px-3 py-3 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,B.transition,B.focusRingPanel,x===e?`bg-accent-soft text-accent-fg shadow-surface`:`text-fg hover:bg-surface-hover`),onClick:()=>F(e),children:[(0,Z.jsx)(`span`,{className:`block text-sm font-medium`,children:I[e].title}),(0,Z.jsx)(`span`,{className:`mt-1 block text-xs text-fg-muted`,children:I[e].hint})]},e))})]}),(0,Z.jsxs)(K,{title:t.advancedTitle,summary:x===`custom`?t.presetCustom:t.presetHint,children:[(0,Z.jsxs)(`div`,{className:`rounded-xl bg-surface-base/45 p-4`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:t.budgetPreview}),(0,Z.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-subtle`,children:t.budgetPreviewHint})]}),(0,Z.jsx)(`span`,{className:`rounded-full bg-surface-panel px-2.5 py-1 font-mono text-xs text-fg-muted`,children:t.previewModel128k})]}),(0,Z.jsxs)(`div`,{className:`mt-4 space-y-3`,children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsxs)(`div`,{className:`mb-1 flex justify-between gap-3 text-xs text-fg-muted`,children:[(0,Z.jsx)(`span`,{children:t.compactionTrigger}),(0,Z.jsx)(`span`,{className:`font-mono text-fg`,children:et(w)})]}),(0,Z.jsx)(`div`,{className:`h-2 overflow-hidden rounded-full bg-surface-active`,children:(0,Z.jsx)(`div`,{className:`h-full rounded-full bg-accent`,style:{width:`${T}%`}})})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsxs)(`div`,{className:`mb-1 flex justify-between gap-3 text-xs text-fg-muted`,children:[(0,Z.jsx)(`span`,{children:t.hardInputLimit}),(0,Z.jsx)(`span`,{className:`font-mono text-fg`,children:et(S)})]}),(0,Z.jsx)(`div`,{className:`h-2 overflow-hidden rounded-full bg-surface-active`,children:(0,Z.jsx)(`div`,{className:`h-full rounded-full bg-fg-subtle`,style:{width:`${E}%`}})})]})]}),(0,Z.jsx)(`p`,{className:`mt-3 text-xs text-fg-subtle`,children:t.budgetFormula})]}),(0,Z.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,Z.jsx)($,{id:`compaction-trigger-threshold`,label:t.triggerThreshold,hint:t.triggerThresholdHint,value:Number((g.triggerThreshold*100).toFixed(2)),min:10,max:98,step:.1,onChange:e=>v({triggerThreshold:e/100})}),(0,Z.jsx)($,{id:`compaction-reserve-tokens`,label:t.reserveTokens,hint:t.reserveTokensHint.replace(`{{tokens}}`,et(g.reserveTokens)),value:g.reserveTokens,min:1024,step:1024,onChange:e=>v({reserveTokens:Math.floor(e)})}),(0,Z.jsx)($,{id:`compaction-recent-turns`,label:t.recentTurnsPreserve,hint:t.recentTurnsPreserveHint,value:g.recentTurnsPreserve,min:1,max:12,onChange:e=>v({recentTurnsPreserve:Math.floor(e)})}),(0,Z.jsx)($,{id:`compaction-keep-recent-tokens`,label:t.keepRecentTokens,hint:t.keepRecentTokensHint.replace(`{{tokens}}`,et(g.keepRecentTokens)),value:g.keepRecentTokens,min:1e3,step:1e3,onChange:e=>v({keepRecentTokens:Math.floor(e)})})]}),A?(0,Z.jsx)(`p`,{className:`rounded-lg bg-amber-50 px-3 py-2 text-xs text-amber-950 dark:bg-amber-950/40 dark:text-amber-100`,children:t.retentionWarning}):null,(0,Z.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`label`,{className:`mb-1 block text-sm font-medium text-fg`,children:t.summaryModel}),(0,Z.jsxs)(`div`,{className:`flex min-w-0 gap-2`,children:[(0,Z.jsx)(Se,{value:g.model??``,disabled:!g.enabled,placeholder:t.summaryModelInherited,searchPlaceholder:t.summaryModelSearch,noMatches:t.summaryModelNoMatches,models:i,modelsLoading:a,className:`min-w-0 flex-1 justify-between`,contentAlign:`start`,showProviderSettingsFooter:!0,onChange:e=>v({model:e})}),g.model?(0,Z.jsx)(N,{type:`button`,variant:`secondary`,onClick:()=>v({model:void 0}),children:t.summaryModelUseSession}):null]}),(0,Z.jsx)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:t.summaryModelHint})]}),(0,Z.jsx)(tt,{label:t.qualityGuard,hint:t.qualityGuardHint,checked:g.qualityGuard,onChange:e=>v({qualityGuard:e})}),(0,Z.jsx)(tt,{label:t.gapAudit,hint:t.gapAuditHint,checked:g.gapAudit,onChange:e=>v({gapAudit:e})})]}),g.qualityGuard?null:(0,Z.jsx)(`p`,{className:`rounded-lg bg-amber-50 px-3 py-2 text-xs text-amber-950 dark:bg-amber-950/40 dark:text-amber-100`,children:t.qualityGuardWarning})]}),(0,Z.jsx)(ke,{children:(0,Z.jsxs)(`div`,{className:`space-y-5 rounded-xl bg-surface-base/45 p-4`,children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:t.advancedTitle}),(0,Z.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-subtle`,children:t.advancedHint})]}),(0,Z.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,Z.jsx)($,{id:`compaction-min-messages`,label:t.minMessagesBeforeCompact,hint:t.minMessagesBeforeCompactHint,value:g.minMessagesBeforeCompact,min:2,onChange:e=>v({minMessagesBeforeCompact:Math.floor(e)})}),(0,Z.jsx)($,{id:`compaction-max-transcript-mb`,label:t.maxActiveTranscriptMb,hint:t.maxActiveTranscriptMbHint,value:Number((g.maxActiveTranscriptBytes/1e6).toFixed(3)),min:.064,step:.1,onChange:e=>v({maxActiveTranscriptBytes:Math.max(64e3,Math.round(e*1e6))})}),(0,Z.jsx)($,{id:`compaction-summary-max-tokens`,label:t.summaryMaxTokens,hint:t.summaryMaxTokensHint,value:g.summaryMaxTokens,min:256,step:256,onChange:e=>v({summaryMaxTokens:Math.floor(e)})}),(0,Z.jsx)($,{id:`compaction-summary-chunk-tokens`,label:t.summaryChunkTokens,hint:t.summaryChunkTokensHint,value:g.summaryChunkTokens,min:1e3,step:1e3,onChange:e=>v({summaryChunkTokens:Math.floor(e)})}),(0,Z.jsx)($,{id:`compaction-summary-timeout`,label:t.summaryTimeoutSeconds,hint:t.summaryTimeoutSecondsHint.replace(`{{seconds}}`,String(te)),value:g.summaryTimeoutMs/1e3,min:1,max:600,onChange:e=>v({summaryTimeoutMs:Math.round(e*1e3)})}),(0,Z.jsx)($,{id:`compaction-summary-retries`,label:t.summaryRetries,hint:t.summaryRetriesHint,value:g.summaryRetries,min:0,max:5,onChange:e=>v({summaryRetries:Math.floor(e)})}),(0,Z.jsx)($,{id:`compaction-min-tool-result-chars`,label:t.minToolResultKeepChars,hint:t.minToolResultKeepCharsHint,value:g.minToolResultKeepChars,min:200,step:100,onChange:e=>v({minToolResultKeepChars:Math.floor(e)})})]}),k?(0,Z.jsx)(`p`,{className:`rounded-lg bg-amber-50 px-3 py-2 text-xs text-amber-950 dark:bg-amber-950/40 dark:text-amber-100`,children:t.summaryBudgetWarning}):null,(0,Z.jsxs)(`div`,{className:`rounded-xl bg-surface-base/45 p-4`,children:[(0,Z.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:t.postCompactionSections}),(0,Z.jsx)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:t.postCompactionSectionsHint}),g.postCompactionSections.length>0?(0,Z.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:g.postCompactionSections.map(e=>(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-lg border border-edge bg-surface-panel px-2.5 py-1.5 text-xs text-fg`,children:[e,(0,Z.jsx)(`button`,{type:`button`,className:M(`text-fg-muted hover:text-fg`,B.press),"aria-label":t.removeSection.replace(`{{section}}`,e),onClick:()=>v({postCompactionSections:g.postCompactionSections.filter(t=>t!==e)}),children:(0,Z.jsx)(j,{className:`size-3.5`,"aria-hidden":!0})})]},e))}):(0,Z.jsx)(`p`,{className:`mt-3 text-xs text-fg-muted`,children:t.postCompactionSectionsEmpty}),(0,Z.jsxs)(`div`,{className:`mt-3 flex gap-2`,children:[(0,Z.jsx)(`input`,{className:Ze(),value:d,maxLength:120,disabled:g.postCompactionSections.length>=12,placeholder:t.postCompactionSectionsPlaceholder,onChange:e=>f(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),ne())}}),(0,Z.jsxs)(N,{type:`button`,variant:`secondary`,disabled:!d.trim()||g.postCompactionSections.length>=12,onClick:ne,children:[(0,Z.jsx)(D,{className:`size-4`,"aria-hidden":!0}),t.addSection]})]})]})]})})]})]})}function rt(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function it(e){return e===`main`||e===`per-peer`||e===`per-channel-peer`||e===`per-account-channel-peer`?e:`main`}function at(e){let t=rt(e)?e:{},n=rt(t.session)?t.session:{},r=rt(n.storage)?n.storage:{},i=typeof r.pruneAfterDays==`number`&&Number.isFinite(r.pruneAfterDays)?Math.max(0,Math.floor(r.pruneAfterDays)):typeof r.pruneAfterMs==`number`&&Number.isFinite(r.pruneAfterMs)?Math.max(0,Math.round(r.pruneAfterMs/864e5)):null,a=typeof r.maxEntries==`number`&&Number.isFinite(r.maxEntries)?Math.max(1,Math.floor(r.maxEntries)):null;return{dmScope:it(n.dmScope),pruneAfterDays:i,maxEntries:a}}async function ot(e){await c(a(`/api/config`),{method:`PATCH`,body:JSON.stringify({session:{dmScope:e.dmScope,storage:{pruneAfterMs:e.pruneAfterDays===null?null:e.pruneAfterDays*864e5,maxEntries:e.maxEntries}}})}),H()}function st(){return M(`w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg`,W,`dark:border-edge`)}var ct=G();function lt({hasToken:e}){let t=l(s(e=>e.language)).sessions.config,{data:n,isLoading:r}=me(e),i=(0,X.useMemo)(()=>n?.payload?.config===void 0?null:at(n.payload.config),[n]),[a,o]=(0,X.useReducer)(ct,{form:null,baseline:null}),c=a.form,u=a.baseline,d=(0,X.useRef)(!1),f=(0,X.useRef)(c);f.current=c;let p=(0,X.useRef)(null);be({enabled:e,parsed:i,dirty:d.current,trackedParsedRef:p,dispatch:o,onResetDirty:()=>{d.current=!1}});let g=!!(c&&u&&JSON.stringify(c)!==JSON.stringify(u)),_=(0,X.useCallback)(e=>{d.current=!0,o({type:`patch`,patch:e})},[]),v=Y({value:c,dirty:g,onSave:(0,X.useCallback)(async e=>{try{await ot(e),o({type:`saved`,value:e}),d.current=!!(f.current&&JSON.stringify(f.current)!==JSON.stringify(e))}catch(e){throw Error(e instanceof Error?e.message:t.saveError)}},[t.saveError])});return!e||!c?r?(0,Z.jsx)(J,{children:(0,Z.jsxs)(`div`,{className:`space-y-3`,"aria-busy":!0,children:[(0,Z.jsx)(P,{className:`h-5 w-40`}),(0,Z.jsx)(P,{className:`h-24 w-full rounded-xl`})]})}):null:(0,Z.jsxs)(J,{onBlurCapture:v.onBlurCapture,children:[(0,Z.jsx)(De,{icon:ee,title:t.title,subtitle:t.hint,trailing:(0,Z.jsx)(Oe,{status:v.status,error:v.error})}),(0,Z.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,Z.jsx)(K,{title:t.dmScope,summary:c.dmScope,children:(0,Z.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,Z.jsx)(`label`,{className:`mb-1 block text-sm font-medium text-fg`,children:t.dmScope}),(0,Z.jsxs)(m,{className:st(),value:c.dmScope,onChange:e=>_({dmScope:e.target.value}),children:[(0,Z.jsx)(h,{value:`main`,children:t.dmScopeMain}),(0,Z.jsx)(h,{value:`per-peer`,children:t.dmScopePerPeer}),(0,Z.jsx)(h,{value:`per-channel-peer`,children:t.dmScopePerChannelPeer}),(0,Z.jsx)(h,{value:`per-account-channel-peer`,children:t.dmScopePerAccountChannelPeer})]}),(0,Z.jsx)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:t.dmScopeHint})]})}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`label`,{className:`mb-1 block text-sm font-medium text-fg`,children:t.pruneAfterDays}),(0,Z.jsx)(q,{allowEmpty:!0,type:`number`,min:0,className:st(),value:c.pruneAfterDays??``,placeholder:t.unsetPlaceholder,onChange:e=>{let t=e.target.value.trim();_({pruneAfterDays:t===``?null:Math.max(0,Math.floor(Number(t)||0))})}})]}),(0,Z.jsx)(K,{title:t.maxEntries,summary:c.maxEntries??t.unsetPlaceholder,children:(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`label`,{className:`mb-1 block text-sm font-medium text-fg`,children:t.maxEntries}),(0,Z.jsx)(q,{allowEmpty:!0,type:`number`,min:1,className:st(),value:c.maxEntries??``,placeholder:t.unsetPlaceholder,onChange:e=>{let t=e.target.value.trim();_({maxEntries:t===``?null:Math.max(1,Math.floor(Number(t)||1))})}})]})})]})]})}function ut(e){if(typeof e==`string`)return e.length>2e3?`${e.slice(0,2e3)}…`:e;try{let t=JSON.stringify(e,null,2);return t.length>2e3?`${t.slice(0,2e3)}…`:t}catch{return String(e)}}function dt(e){let t=(0,Ae.c)(60),{open:n,loading:r,session:i,sessionAgentId:a,sessionAgentAvatar:o,labels:s,onClose:c,onArchive:l,onUnarchive:u,onPin:d,onUnpin:f,onExport:p,onDelete:m}=e,h=i?.status===`archived`,g=i?.status===`pinned`,_;t[0]===c?_=t[1]:(_=e=>!e&&c(),t[0]=c,t[1]=_);let ee;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,Z.jsx)(te,{className:M(`xopc-dialog-overlay fixed inset-0 bg-scrim`,oe)}),t[2]=ee):ee=t[2];let v;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(v=M(`xopc-drawer-right fixed right-0 top-0 flex size-full max-w-lg flex-col border-l border-edge bg-surface-overlay shadow-popover outline-none`,ae,`dark:border-edge`),t[3]=v):v=t[3];let y;t[4]!==i||t[5]!==o||t[6]!==a?(y=i&&a?(0,Z.jsx)(_e,{agentId:a,avatar:o,size:40,className:`size-10 shrink-0 ring-1 ring-edge/60 dark:ring-edge`}):null,t[4]=i,t[5]=o,t[6]=a,t[7]=y):y=t[7];let b;t[8]!==s.unnamedSession||t[9]!==i?.name?(b=i?.name?.trim()||s.unnamedSession,t[8]=s.unnamedSession,t[9]=i?.name,t[10]=b):b=t[10];let x;t[11]===b?x=t[12]:(x=(0,Z.jsx)(re,{className:`min-w-0 flex-1 truncate text-base font-semibold tracking-tight text-fg`,children:b}),t[11]=b,t[12]=x);let S;t[13]!==y||t[14]!==x?(S=(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3`,children:[y,x]}),t[13]=y,t[14]=x,t[15]=S):S=t[15];let C;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Z.jsx)(j,{className:`size-5`,strokeWidth:1.75}),t[16]=C):C=t[16];let w;t[17]===s.close?w=t[18]:(w=(0,Z.jsx)(F,{asChild:!0,children:(0,Z.jsx)(N,{type:`button`,variant:`ghost`,className:`size-9 shrink-0 p-0`,"aria-label":s.close,children:C})}),t[17]=s.close,t[18]=w);let T;t[19]!==S||t[20]!==w?(T=(0,Z.jsxs)(`div`,{className:`flex min-w-0 shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3 dark:border-edge`,children:[S,w]}),t[19]=S,t[20]=w,t[21]=T):T=t[21];let E;t[22]!==s.detailLoading||t[23]!==s.detailMessages||t[24]!==r||t[25]!==i?(E=r?(0,Z.jsx)(`p`,{className:`text-sm text-fg-muted`,children:s.detailLoading}):i?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`dl`,{className:`mb-4 grid gap-2 text-xs text-fg-muted`,children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{className:`text-fg-disabled`,children:`Key`}),(0,Z.jsx)(`dd`,{className:`mt-0.5 break-all font-mono text-fg`,children:i.key})]}),(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-4`,children:(0,Z.jsxs)(`span`,{children:[i.messageCount,` msgs · `,i.estimatedTokens,` tok`]})})]}),(0,Z.jsx)(`h3`,{className:`mb-2 text-xs font-medium uppercase tracking-wide text-fg-subtle`,children:s.detailMessages}),(0,Z.jsx)(`ul`,{className:`space-y-3`,children:i.messages.map(ft)})]}):null,t[22]=s.detailLoading,t[23]=s.detailMessages,t[24]=r,t[25]=i,t[26]=E):E=t[26];let D;t[27]===E?D=t[28]:(D=(0,Z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-3`,children:E}),t[27]=E,t[28]=D);let O;t[29]!==s.detailExport||t[30]!==p?(O=(0,Z.jsx)(N,{type:`button`,variant:`secondary`,className:`text-sm`,onClick:p,children:s.detailExport}),t[29]=s.detailExport,t[30]=p,t[31]=O):O=t[31];let k;t[32]!==h||t[33]!==s.archive||t[34]!==s.unarchive||t[35]!==l||t[36]!==u?(k=h?(0,Z.jsx)(N,{type:`button`,variant:`secondary`,className:`text-sm`,onClick:u,children:s.unarchive}):(0,Z.jsx)(N,{type:`button`,variant:`secondary`,className:`text-sm`,onClick:l,children:s.archive}),t[32]=h,t[33]=s.archive,t[34]=s.unarchive,t[35]=l,t[36]=u,t[37]=k):k=t[37];let A;t[38]!==g||t[39]!==s.pin||t[40]!==s.unpin||t[41]!==d||t[42]!==f?(A=g?(0,Z.jsx)(N,{type:`button`,variant:`secondary`,className:`text-sm`,onClick:f,children:s.unpin}):(0,Z.jsx)(N,{type:`button`,variant:`secondary`,className:`text-sm`,onClick:d,children:s.pin}),t[38]=g,t[39]=s.pin,t[40]=s.unpin,t[41]=d,t[42]=f,t[43]=A):A=t[43];let P;t[44]!==s.delete||t[45]!==m?(P=(0,Z.jsx)(N,{type:`button`,variant:`secondary`,className:`text-sm text-red-600 hover:bg-red-50 dark:text-red-400 dark:hover:bg-red-950/40`,onClick:m,children:s.delete}),t[44]=s.delete,t[45]=m,t[46]=P):P=t[46];let L;t[47]!==O||t[48]!==k||t[49]!==A||t[50]!==P?(L=(0,Z.jsx)(`div`,{className:`shrink-0 border-t border-edge px-4 py-3 dark:border-edge`,children:(0,Z.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[O,k,A,P]})}),t[47]=O,t[48]=k,t[49]=A,t[50]=P,t[51]=L):L=t[51];let R;t[52]!==T||t[53]!==D||t[54]!==L?(R=(0,Z.jsxs)(I,{children:[ee,(0,Z.jsxs)(ne,{className:v,"aria-describedby":void 0,children:[T,D,L]})]}),t[52]=T,t[53]=D,t[54]=L,t[55]=R):R=t[55];let z;return t[56]!==n||t[57]!==_||t[58]!==R?(z=(0,Z.jsx)(ie,{open:n,onOpenChange:_,children:R}),t[56]=n,t[57]=_,t[58]=R,t[59]=z):z=t[59],z}function ft(e){return(0,Z.jsxs)(`li`,{className:`rounded-lg border border-edge-subtle bg-surface-hover/50 p-2 dark:border-edge`,children:[(0,Z.jsx)(`div`,{className:`mb-1 text-[10px] font-medium uppercase text-fg-subtle`,children:e.role}),(0,Z.jsx)(`pre`,{className:`max-h-40 overflow-auto whitespace-pre-wrap break-words font-mono text-[11px] leading-relaxed text-fg-muted`,children:ut(e.content)})]},`${e.timestamp??``}-${e.role}-${ut(e.content).slice(0,24)}`)}var pt=20;function mt(e,t){return e.replace(/\{\{(\w+)\}\}/g,(e,n)=>String(t[n]??``))}var ht=new Set([`all`,`active`,`pinned`,`archived`]),gt=new Set([`grid`,`list`]),_t=[`sessions`,`settings`];function vt(e){return e&&_t.includes(e)?e:`sessions`}function yt(e,t){return t===`sessions`?e.tabsSessions:e.tabsSettings}function bt(e,t){return t===`sessions`?e.tabsSessionsHint:e.tabsSettingsHint}function xt(e){let t=(0,Ae.c)(7),{s:n,activeTab:r,onChange:i}=e,a;t[0]===n?a=t[1]:(a=_t.map(e=>({id:e,label:yt(n,e),icon:e===`sessions`?b:k})),t[0]=n,t[1]=a);let o=a,s;return t[2]!==r||t[3]!==o||t[4]!==i||t[5]!==n.tabsAriaLabel?(s=(0,Z.jsx)(ge,{items:o,activeTab:r,onChange:i,ariaLabel:n.tabsAriaLabel,tabIdPrefix:`sessions-tab`,panelIdPrefix:`sessions-panel`}),t[2]=r,t[3]=o,t[4]=i,t[5]=n.tabsAriaLabel,t[6]=s):s=t[6],s}function St(e){let t=(0,Ae.c)(10),{s:n,id:r,activeTab:i,plain:a,children:o}=e,s=a!==void 0&&a;if(i!==r)return null;let c=`sessions-panel-${r}`,l=`sessions-tab-${r}`,u=s?`contents`:`rounded-xl bg-surface-hover/20 px-4 py-5 sm:px-5`,d;t[0]!==o||t[1]!==r||t[2]!==s||t[3]!==n?(d=s?o:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`mb-5`,children:[(0,Z.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:yt(n,r)}),(0,Z.jsx)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:bt(n,r)})]}),(0,Z.jsx)(`div`,{className:`space-y-4`,children:o})]}),t[0]=o,t[1]=r,t[2]=s,t[3]=n,t[4]=d):d=t[4];let f;return t[5]!==c||t[6]!==l||t[7]!==u||t[8]!==d?(f=(0,Z.jsx)(`section`,{id:c,role:`tabpanel`,"aria-labelledby":l,className:u,children:d}),t[5]=c,t[6]=l,t[7]=u,t[8]=d,t[9]=f):f=t[9],f}function Ct(e){let t=e.get(`status`),n=e.get(`view`);return{searchInput:e.get(`q`)??``,debouncedSearch:(e.get(`q`)??``).trim(),statusFilter:ht.has(t)?t:`all`,viewMode:gt.has(n)?n:`grid`,channelFilter:(e.get(`channel`)??``).trim(),sessions:[],loading:!1,error:null,hasMore:!1,stats:null,detailOpen:!1,detailLoading:!1,detailSession:null,confirmOpen:!1,confirmKey:null}}function wt(){let e=l(s(e=>e.language)),t=e.sessions,n=o(e=>e.conversationId),r=!!n,{data:a,mutate:c}=L(r?[`gateway-chat-agents`,n]:null,ye,{revalidateOnFocus:!1}),d=a?.defaultId??`main`,f=a?.items??[],[m,h]=i(),_=vt(m.get(`tab`)),ee=(0,X.useCallback)(e=>{let t=new URLSearchParams(m);e===`sessions`?t.delete(`tab`):t.set(`tab`,e),h(t,{replace:!0})},[m,h]),[v,S]=(0,X.useReducer)(xe,m,Ct),{searchInput:C,debouncedSearch:w,statusFilter:E,viewMode:D,channelFilter:k,sessions:A,loading:j,error:P,hasMore:F,stats:V,detailOpen:H,detailLoading:me,detailSession:U,confirmOpen:he,confirmKey:W}=v;(0,X.useEffect)(()=>{let e=setTimeout(()=>{let e=C.trim();w!==e&&S({type:`patch`,patch:{debouncedSearch:e}})},300);return()=>clearTimeout(e)},[C,w]);let ge=m.toString(),_e=(0,X.useRef)(ge);if(_e.current!==ge){_e.current=ge;let e=m.get(`q`)??``,t=m.get(`status`),n=m.get(`view`),r=(m.get(`channel`)??``).trim(),i=ht.has(t)?t:`all`,a=gt.has(n)?n:`grid`,o=e.trim();S({type:`patch`,patch:{...C===e?{}:{searchInput:e},...w===o?{}:{debouncedSearch:o},...E===i?{}:{statusFilter:i},...D===a?{}:{viewMode:a},...k===r?{}:{channelFilter:r}}})}(0,X.useEffect)(()=>{let e=new URLSearchParams(m),t=w.trim();t?e.set(`q`,t):e.delete(`q`),E===`all`?e.delete(`status`):e.set(`status`,E),D===`grid`?e.delete(`view`):e.set(`view`,D),k?e.set(`channel`,k):e.delete(`channel`),e.toString()!==m.toString()&&h(e,{replace:!0})},[w,m,h,E,D,k]),(0,X.useEffect)(()=>{if(!r||_!==`sessions`)return;let e=!1;return(async()=>{S({type:`patch`,patch:{loading:!0,error:null}});try{let t=await fe({limit:pt,offset:0,...w?{search:w}:{},...E===`all`?{}:{status:E},...k?{channel:k}:{}});if(e)return;S({type:`patch`,patch:{sessions:t.items,hasMore:t.hasMore}})}catch(n){e||S({type:`patch`,patch:{error:n instanceof Error?n.message:t.loadError}})}finally{e||S({type:`patch`,patch:{loading:!1}})}})(),()=>{e=!0}},[r,_,w,E,k,t.loadError]),(0,X.useEffect)(()=>{!r||_!==`sessions`||le().then(e=>S({type:`patch`,patch:{stats:e}})).catch(()=>{})},[r,_]),(0,X.useEffect)(()=>{if(!r||_!==`sessions`)return;let e=()=>void c();return window.addEventListener(`config-reload`,e),()=>window.removeEventListener(`config-reload`,e)},[r,_,c]),(0,X.useEffect)(()=>{if(!r||_!==`sessions`)return;let e=e=>{let t=e.detail;!t?.key||t.name===void 0||S({type:`patch`,patch:{sessions:A.map(e=>e.key===t.key?{...e,name:t.name}:e),detailSession:U&&U.key===t.key?{...U,name:t.name}:U}})};return window.addEventListener(`session-updated`,e),()=>{window.removeEventListener(`session-updated`,e)}},[r,_,A,U]);let be=(0,X.useCallback)(async()=>{if(!(!r||j||!F)){S({type:`patch`,patch:{loading:!0,error:null}});try{let e=await fe({limit:pt,offset:A.length,...w?{search:w}:{},...E===`all`?{}:{status:E},...k?{channel:k}:{}});S({type:`patch`,patch:{sessions:[...A,...e.items],hasMore:e.hasMore}})}catch(e){S({type:`patch`,patch:{error:e instanceof Error?e.message:t.loadError}})}finally{S({type:`patch`,patch:{loading:!1}})}}},[r,j,F,A.length,w,E,k,t.loadError]),G=(0,X.useCallback)((e,t)=>{S({type:`patch`,patch:{sessions:A.map(n=>n.key===e?{...n,status:t}:n),detailSession:U&&U.key===e?{...U,status:t}:U}})},[A,U]),Se=(0,X.useCallback)(async e=>{S({type:`patch`,patch:{detailOpen:!0,detailLoading:!0,detailSession:null}});try{let t=await R(e);S({type:`patch`,patch:{detailSession:t}})}catch{S({type:`patch`,patch:{detailOpen:!1}})}finally{S({type:`patch`,patch:{detailLoading:!1}})}},[]),K=e=>{Se(e)},q=async(e,t)=>{if(t===`continue`){window.dispatchEvent(new CustomEvent(`navigate-to-chat`,{detail:{conversationId:e},bubbles:!0}));return}if(t===`delete`){S({type:`patch`,patch:{confirmKey:e,confirmOpen:!0}});return}try{switch(t){case`archive`:await pe(e),G(e,`archived`);break;case`unarchive`:await se(e),G(e,`active`);break;case`pin`:await z(e),G(e,`pinned`);break;case`unpin`:await ue(e),G(e,`active`);break;case`export`:{let t=await de(e),n=new Blob([t],{type:`application/json`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=`session-${e.replace(/[^a-z0-9]/gi,`_`)}.json`,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(r);break}default:break}le().then(e=>S({type:`patch`,patch:{stats:e}})).catch(()=>{})}catch{}},De=async e=>{try{await ce(e),S({type:`patch`,patch:{sessions:A.filter(t=>t.key!==e),detailSession:U?.key===e?null:U,...U?.key===e?{detailOpen:!1}:{}}}),le().then(e=>S({type:`patch`,patch:{stats:e}})).catch(()=>{})}catch{}},J={continueChat:t.continueChat,archive:t.archive,unarchive:t.unarchive,pin:t.pin,unpin:t.unpin,export:t.export,delete:t.delete,tokens:t.tokens,cost:t.cost,costPartial:t.costPartial,costUnknown:t.costUnknown,noUsage:t.noUsage,unnamedSession:e.chat.newSession},Oe={close:t.close,detailLoading:t.detailLoading,detailMessages:t.detailMessages,detailExport:t.detailExport,archive:t.archive,unarchive:t.unarchive,pin:t.pin,unpin:t.unpin,delete:t.delete,unnamedSession:e.chat.newSession},Y=[{key:`all`,label:t.filterAll,icon:b},{key:`active`,label:t.filterActive,icon:g},{key:`pinned`,label:t.filterPinned,icon:T},{key:`archived`,label:t.filterArchived,icon:p}],ke=(()=>{let e=Object.entries(V?.byChannel??{}).sort((e,t)=>t[1]-e[1]).slice(0,6).map(([e])=>e),t=new Set(e);for(let n of[`telegram`,`weixin`,`feishu`])t.has(n)||(e.push(n),t.add(n));return e.slice(0,8)})();return r?(0,Z.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-x-hidden bg-surface-panel`,children:[(0,Z.jsxs)(Te,{gap:`gap-6`,children:[(0,Z.jsx)(Ee,{title:t.title}),(0,Z.jsx)(xt,{s:t,activeTab:_,onChange:ee}),(0,Z.jsx)(St,{s:t,id:`settings`,activeTab:_,plain:!0,children:(0,Z.jsxs)(`div`,{className:`space-y-4`,children:[(0,Z.jsx)(nt,{hasToken:r}),(0,Z.jsx)(lt,{hasToken:r})]})}),(0,Z.jsxs)(St,{s:t,id:`sessions`,activeTab:_,plain:!0,children:[(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between`,children:[(0,Z.jsx)(ve,{className:`flex flex-wrap gap-2`,role:`group`,"aria-label":t.tabsSessions,indicatorClassName:`rounded-xl bg-accent-soft`,children:Y.map(({key:e,label:t,icon:n})=>(0,Z.jsxs)(`button`,{type:`button`,"aria-pressed":E===e,onClick:()=>S({type:`patch`,patch:{statusFilter:e}}),className:M(`inline-flex items-center gap-1.5 rounded-xl px-3 py-2 text-sm font-medium`,B.transition,B.focusRingPanel,E===e?`bg-accent-soft text-accent-fg`:`bg-surface-base text-fg-muted hover:bg-surface-hover hover:text-fg dark:bg-surface-hover/35`),children:[(0,Z.jsx)(n,{className:`size-4`,strokeWidth:1.75,"aria-hidden":!0}),t]},e))}),(0,Z.jsxs)(`div`,{className:`flex min-h-11 w-full min-w-0 items-center gap-2 rounded-xl bg-surface-base focus-within:ring-2 focus-within:ring-accent px-3 py-2 transition-colors lg:max-w-md dark:bg-surface-hover/40`,children:[(0,Z.jsx)(O,{className:`size-4 shrink-0 text-fg-disabled`,strokeWidth:1.75,"aria-hidden":!0}),(0,Z.jsx)(`input`,{type:`search`,value:C,onChange:e=>S({type:`patch`,patch:{searchInput:e.target.value}}),placeholder:t.searchPlaceholder,"aria-label":t.searchPlaceholder,"data-debounced-query":w||void 0,className:`min-w-0 flex-1 border-0 bg-transparent text-base sm:text-sm text-fg placeholder:text-fg-disabled focus:outline-none focus:ring-0`})]})]}),(0,Z.jsxs)(ve,{className:`flex flex-wrap items-center gap-2`,role:`group`,"aria-label":t.filterChannelLabel,indicatorClassName:`rounded-xl bg-accent-soft`,children:[(0,Z.jsx)(`span`,{className:`text-xs font-medium text-fg-subtle`,children:t.filterChannelLabel}),(0,Z.jsx)(`button`,{type:`button`,"aria-pressed":!k,onClick:()=>S({type:`patch`,patch:{channelFilter:``}}),className:M(`touch-target inline-flex items-center rounded-xl px-3 py-2 text-sm font-medium`,B.transition,B.focusRingPanel,k?`bg-surface-base text-fg-muted hover:bg-surface-hover hover:text-fg dark:bg-surface-hover/35`:`bg-accent-soft text-accent-fg`),children:t.filterChannelAll}),ke.map(e=>(0,Z.jsxs)(`button`,{type:`button`,"aria-pressed":k===e,onClick:()=>S({type:`patch`,patch:{channelFilter:e}}),className:M(`touch-target inline-flex items-center rounded-xl px-3 py-2 text-sm font-medium`,B.transition,B.focusRingPanel,k===e?`bg-accent-soft text-accent-fg`:`bg-surface-base text-fg-muted hover:bg-surface-hover hover:text-fg dark:bg-surface-hover/35`),children:[e,V?.byChannel?.[e]==null?null:(0,Z.jsx)(`span`,{className:`ml-2 rounded-full bg-surface-hover px-2 py-0.5 text-[11px] text-fg-subtle`,children:V.byChannel[e]})]},e))]}),V?(0,Z.jsx)(`div`,{className:`grid grid-cols-2 gap-3 sm:grid-cols-4`,children:[[V.totalSessions,t.totalSessions],[V.activeSessions,t.activeSessions],[V.pinnedSessions,t.pinnedSessions],[V.archivedSessions,t.archivedSessions]].map(([e,t])=>(0,Z.jsxs)(`div`,{className:`rounded-xl bg-surface-base p-3 dark:bg-surface-hover/30`,children:[(0,Z.jsx)(`div`,{className:`text-lg font-semibold tabular-nums text-fg`,children:e}),(0,Z.jsx)(`div`,{className:`text-xs text-fg-muted`,children:t})]},t))}):null,P?(0,Z.jsx)(`div`,{className:`rounded-lg bg-red-50 px-3 py-2 text-sm text-red-700 dark:bg-red-950/40 dark:text-red-300`,children:P}):null,(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,Z.jsx)(`p`,{className:`text-xs text-fg-muted`,children:mt(t.sessionCount,{count:A.length})}),(0,Z.jsxs)(ve,{className:we,role:`group`,"aria-label":t.layoutToggleGroup,indicatorClassName:`rounded-pill bg-surface-panel shadow-sm dark:ring-1 dark:ring-edge-strong/40`,children:[(0,Z.jsx)(N,{type:`button`,variant:`segmented`,title:t.gridView,"aria-pressed":D===`grid`,onClick:()=>S({type:`patch`,patch:{viewMode:`grid`}}),className:M(Ce,`size-7 p-0`,D===`grid`&&`bg-surface-panel shadow-sm dark:bg-surface-panel dark:shadow-sm dark:ring-1 dark:ring-edge-strong/40`,D===`grid`&&`text-accent-fg`),children:(0,Z.jsx)(x,{className:`size-3.5`,strokeWidth:1.5})}),(0,Z.jsx)(N,{type:`button`,variant:`segmented`,title:t.listView,"aria-pressed":D===`list`,onClick:()=>S({type:`patch`,patch:{viewMode:`list`}}),className:M(Ce,`size-9 p-0`,D===`list`&&`bg-surface-panel shadow-sm dark:bg-surface-panel dark:shadow-sm dark:ring-1 dark:ring-edge-strong/40`,D===`list`&&`text-accent-fg`),children:(0,Z.jsx)(u,{className:`size-3.5`,strokeWidth:1.5})})]})]}),j&&A.length===0?(0,Z.jsx)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3`,children:Array.from({length:6}).map((e,t)=>(0,Z.jsx)(`div`,{className:`h-40 animate-pulse rounded-xl bg-surface-hover/60 dark:bg-surface-hover/40`},t))}):A.length===0?(0,Z.jsxs)(`div`,{className:`flex flex-col items-center justify-center rounded-2xl bg-surface-base py-16 text-center dark:bg-surface-hover/25`,children:[(0,Z.jsx)(y,{className:`mb-3 size-12 text-fg-disabled`,strokeWidth:1.25,"aria-hidden":!0}),(0,Z.jsx)(`p`,{className:`text-base font-semibold text-fg`,children:t.noSessions}),(0,Z.jsx)(`p`,{className:`mt-1 max-w-sm text-sm text-fg-muted`,children:t.noSessionsDescription}),(0,Z.jsx)(N,{variant:`primary`,className:`mt-6`,onClick:()=>{window.dispatchEvent(new CustomEvent(`navigate-to-chat`,{detail:{conversationId:``},bubbles:!0}))},children:t.startNewChat})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:M(`grid min-w-0 gap-3`,D===`grid`?`sm:grid-cols-2 lg:grid-cols-3`:`grid-cols-1`),"data-debounced-query":w||void 0,children:A.map(e=>{let t=ze(e,d);return(0,Z.jsx)(Pe,{session:e,variant:D,labels:J,sessionAgentId:t,sessionAgentAvatar:Be(t,f),onOpen:()=>K(e.key),onAction:t=>void q(e.key,t)},e.key)})}),F?(0,Z.jsx)(`div`,{className:`flex justify-center pt-2`,children:(0,Z.jsx)(N,{type:`button`,variant:`secondary`,disabled:j,onClick:()=>void be(),children:t.loadMore})}):null]})]})]}),(0,Z.jsx)(dt,{open:H,loading:me,session:U,sessionAgentId:U?ze(U,d):void 0,sessionAgentAvatar:U?Be(ze(U,d),f):void 0,labels:Oe,onClose:()=>{S({type:`patch`,patch:{detailOpen:!1,detailSession:null}})},onArchive:()=>U&&void q(U.key,`archive`),onUnarchive:()=>U&&void q(U.key,`unarchive`),onPin:()=>U&&void q(U.key,`pin`),onUnpin:()=>U&&void q(U.key,`unpin`),onExport:()=>U&&void q(U.key,`export`),onDelete:()=>U&&S({type:`patch`,patch:{confirmKey:U.key,confirmOpen:!0}})}),(0,Z.jsx)(ie,{open:he,onOpenChange:e=>S({type:`patch`,patch:{confirmOpen:e}}),children:(0,Z.jsxs)(I,{children:[(0,Z.jsx)(te,{className:M(`xopc-dialog-overlay fixed inset-0 bg-scrim`,oe)}),(0,Z.jsxs)(ne,{className:M(`xopc-dialog-content fixed left-1/2 top-1/2 w-[min(100%-2rem,24rem)] -translate-x-1/2 -translate-y-1/2 rounded-xl border border-edge bg-surface-overlay p-4 shadow-popover dark:border-edge`,ae),children:[(0,Z.jsx)(re,{className:`text-base font-semibold text-fg`,children:t.deleteSessionTitle}),(0,Z.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:W?mt(t.deleteSessionMessage,{name:A.find(e=>e.key===W)?.name?.trim()||e.chat.newSession}):``}),(0,Z.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[(0,Z.jsx)(N,{type:`button`,variant:`secondary`,onClick:()=>S({type:`patch`,patch:{confirmOpen:!1}}),children:t.cancel}),(0,Z.jsx)(N,{type:`button`,variant:`primary`,className:`bg-red-600 hover:bg-red-700`,onClick:()=>{W&&De(W),S({type:`patch`,patch:{confirmOpen:!1,confirmKey:null}})},children:t.delete})]})]})]})})]}):(0,Z.jsx)(`div`,{className:`w-full px-3 py-16 text-center text-sm text-fg-muted sm:px-5 xl:px-6`,children:t.needToken})}export{wt as SessionsPage};