@xopcai/xopc 0.0.435 → 0.0.437

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 (201) 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-Cwn_CNwl.js → activity-store-CXhhy7_9.js} +1 -1
  4. package/dist/gateway/static/root/assets/{agent-avatar-dicebear-Cd23LnJJ.js → agent-avatar-dicebear-_h4GxzUK.js} +1 -1
  5. package/dist/gateway/static/root/assets/{agent-avatar-display-ByzM7u9S.js → agent-avatar-display-B_QEDfMT.js} +2 -2
  6. package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-B0i37diS.js → agent-defaults-settings-panel-DWIluCZB.js} +1 -1
  7. package/dist/gateway/static/root/assets/{agent-plugin-dialog-XN-tZ-Ox.js → agent-plugin-dialog-lCWIS06R.js} +1 -1
  8. package/dist/gateway/static/root/assets/{agents-ZDA1OaLv.js → agents-C-tIn72l.js} +3 -3
  9. package/dist/gateway/static/root/assets/{agents-admin-api-B5lKH_ps.js → agents-admin-api-DIStX2e1.js} +1 -1
  10. package/dist/gateway/static/root/assets/{api-B9fZL-V8.js → api-C4xrqOKi.js} +1 -1
  11. package/dist/gateway/static/root/assets/{api-Djju8qIR.js → api-bT-kA268.js} +1 -1
  12. package/dist/gateway/static/root/assets/{app-management-settings-panel-IlyzDPJu.js → app-management-settings-panel-Dk75Bmi2.js} +1 -1
  13. package/dist/gateway/static/root/assets/{appearance-settings-BxdFGob3.js → appearance-settings-DTj1XI4v.js} +1 -1
  14. package/dist/gateway/static/root/assets/{apps-page-CxEKiOTA.js → apps-page-7iAULaEl.js} +1 -1
  15. package/dist/gateway/static/root/assets/{archive-plugin-4gEvotPr.js → archive-plugin-BADrW4yR.js} +1 -1
  16. package/dist/gateway/static/root/assets/{automation-api-4fVKv9PJ.js → automation-api-CRz5EE_c.js} +1 -1
  17. package/dist/gateway/static/root/assets/{automation-result-state-m7PeK2kl.js → automation-result-state-D0EHDk4V.js} +1 -1
  18. package/dist/gateway/static/root/assets/{automation-run-list-CJOdy_R2.js → automation-run-list-CnaV2j9R.js} +1 -1
  19. package/dist/gateway/static/root/assets/automation-task-card-DD4yjrI6.js +3 -0
  20. package/dist/gateway/static/root/assets/{automations-page-BjbM15eY.js → automations-page-DDNx4Gn3.js} +1 -1
  21. package/dist/gateway/static/root/assets/{automations-workspace-CqurzLYX.js → automations-workspace-CtidgXTX.js} +2 -2
  22. package/dist/gateway/static/root/assets/{binary-plugins-69WyJLNW.js → binary-plugins-hpeH8g5V.js} +1 -1
  23. package/dist/gateway/static/root/assets/{block-editor-DUONDIZR.js → block-editor-P_RGb2rE.js} +1 -1
  24. package/dist/gateway/static/root/assets/{browser-automation-inputs-DL4YPCuN.js → browser-automation-inputs-C3gQlgox.js} +1 -1
  25. package/dist/gateway/static/root/assets/{browser-automations-page-1Aq6XmRs.js → browser-automations-page-CsdyL6q5.js} +1 -1
  26. package/dist/gateway/static/root/assets/{browser-control-api-yjru8E7R.js → browser-control-api-Btwz8koK.js} +1 -1
  27. package/dist/gateway/static/root/assets/{browser-settings-page-CvwpT8Um.js → browser-settings-page-B-ks3b8r.js} +1 -1
  28. package/dist/gateway/static/root/assets/{capabilities-C7lnwKKm.js → capabilities-C4F2D1gH.js} +1 -1
  29. package/dist/gateway/static/root/assets/{capabilities-DaeQXJT4.js → capabilities-f0YyWX04.js} +1 -1
  30. package/dist/gateway/static/root/assets/{capabilities-page-B5avAOUM.js → capabilities-page-CJm5gNu8.js} +2 -2
  31. package/dist/gateway/static/root/assets/{capabilities-settings-panel-_9yCS78i.js → capabilities-settings-panel-BMg8DBa0.js} +1 -1
  32. package/dist/gateway/static/root/assets/{channels-CoQb4HOF.js → channels-DYgvP8sO.js} +1 -1
  33. package/dist/gateway/static/root/assets/{chat-agents-api-BUi_7GRo.js → chat-agents-api-BrsUEl3u.js} +1 -1
  34. package/dist/gateway/static/root/assets/{chat-chart-block-CcVcKsDZ.js → chat-chart-block-Cq3aoRzV.js} +1 -1
  35. package/dist/gateway/static/root/assets/{chat-page--wcFhTjW.js → chat-page-dh7ImvX8.js} +9 -9
  36. package/dist/gateway/static/root/assets/{chat-terminal-dock-BMXJpPuH.js → chat-terminal-dock-2eGZ5qZ7.js} +1 -1
  37. package/dist/gateway/static/root/assets/{command-palette-api-luUjQPsh.js → command-palette-api-BEqdX7Q-.js} +1 -1
  38. package/dist/gateway/static/root/assets/{composer-payload-handoff-B5XNxNCb.js → composer-payload-handoff-BBm3ypBb.js} +1 -1
  39. package/dist/gateway/static/root/assets/{computer-settings-page-CWtdyEJH.js → computer-settings-page-DUhsxs4l.js} +1 -1
  40. package/dist/gateway/static/root/assets/{connected-providers-grid-2idMtk65.js → connected-providers-grid-BsCLGLnw.js} +1 -1
  41. package/dist/gateway/static/root/assets/{connection-usage-guide-Ddh0bfkj.js → connection-usage-guide-BgvvHMc4.js} +1 -1
  42. package/dist/gateway/static/root/assets/{connector-service-page-C3msXaBk.js → connector-service-page-C3SmPK1c.js} +1 -1
  43. package/dist/gateway/static/root/assets/{connectors-api-NcWECWKg.js → connectors-api-Now9xXuA.js} +1 -1
  44. package/dist/gateway/static/root/assets/{connectors-page-Crb6DILX.js → connectors-page-CTMeC7Pt.js} +1 -1
  45. package/dist/gateway/static/root/assets/{date-picker-Cfjq1hD_.js → date-picker-CBoc2ETg.js} +1 -1
  46. package/dist/gateway/static/root/assets/{desktop-pet-ChFn9v-3.js → desktop-pet-DS2dJydK.js} +1 -1
  47. package/dist/gateway/static/root/assets/{desktop-pet-settings-DvnVIv25.js → desktop-pet-settings-CzGc9byI.js} +1 -1
  48. package/dist/gateway/static/root/assets/{dev-view-store-DQJ61P5L.js → dev-view-store-BXMp1Npf.js} +1 -1
  49. package/dist/gateway/static/root/assets/{device-pairing-wizard-KxaIL-OX.js → device-pairing-wizard--SCayxiS.js} +1 -1
  50. package/dist/gateway/static/root/assets/{directory-picker-path-field-Drv864uE.js → directory-picker-path-field-P_-tLtwi.js} +1 -1
  51. package/dist/gateway/static/root/assets/{discussion-annotation-sync-DfBRkWtw.js → discussion-annotation-sync-D_NJLur2.js} +1 -1
  52. package/dist/gateway/static/root/assets/{extension-debug-page-DAlBIt_R.js → extension-debug-page-CE9KJpjL.js} +1 -1
  53. package/dist/gateway/static/root/assets/{extension-iframe-host-Bds-5kY_.js → extension-iframe-host-ClbrQvGF.js} +1 -1
  54. package/dist/gateway/static/root/assets/{extension-marketplace-api-CZg8nBwW.js → extension-marketplace-api-BNNQYLeu.js} +1 -1
  55. package/dist/gateway/static/root/assets/{extension-page-ZTw-oucT.js → extension-page-C6qZ9pGs.js} +1 -1
  56. package/dist/gateway/static/root/assets/{extension-provider-NKWfjpdP.js → extension-provider-KmpUveDY.js} +1 -1
  57. package/dist/gateway/static/root/assets/{extension-settings-page-CT7PPt_q.js → extension-settings-page-DWKB4ETv.js} +1 -1
  58. package/dist/gateway/static/root/assets/{file-preview-surface-BcLeaSNe.js → file-preview-surface-CEDfehx5.js} +1 -1
  59. package/dist/gateway/static/root/assets/{gateway-config-swr-Cq-ByXL4.js → gateway-config-swr-CtEdaxOS.js} +1 -1
  60. package/dist/gateway/static/root/assets/{gateway-realtime-DwMd2PCt.js → gateway-realtime-SunJUMP3.js} +1 -1
  61. package/dist/gateway/static/root/assets/gateway-realtime-store-BywiC4CK.js +1 -0
  62. package/dist/gateway/static/root/assets/{gateway-restart-DdiVzbkL.js → gateway-restart-srJ9TMC5.js} +1 -1
  63. package/dist/gateway/static/root/assets/{gateway-settings-1QUdNwrZ.js → gateway-settings-DWVxjM9y.js} +1 -1
  64. package/dist/gateway/static/root/assets/{gateway-startup-retry-PMJi5mX4.js → gateway-startup-retry-xpHdw5uq.js} +1 -1
  65. package/dist/gateway/static/root/assets/{global-defaults-api-DgzZh3wX.js → global-defaults-api-C-ogBDn1.js} +1 -1
  66. package/dist/gateway/static/root/assets/{home-page-Chn7YTiD.js → home-page-2Uj--v_o.js} +2 -2
  67. package/dist/gateway/static/root/assets/{image-generation-api-CjVpsckq.js → image-generation-api-DFGE3Ait.js} +1 -1
  68. package/dist/gateway/static/root/assets/{imports-page-CJCvZFaQ.js → imports-page-BkslHrr5.js} +1 -1
  69. package/dist/gateway/static/root/assets/{index-8xLWo0Tt.js → index-BxHzmTJV.js} +5 -5
  70. package/dist/gateway/static/root/assets/index-CIYNPxDl.css +1 -0
  71. package/dist/gateway/static/root/assets/{install-connector-dialog-Bo06Ry3H.js → install-connector-dialog-Fctw32Lx.js} +1 -1
  72. package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BylFJeGu.js → keyboard-shortcuts-settings-DFBpeaA_.js} +1 -1
  73. package/dist/gateway/static/root/assets/{local-app-workbench-page-B3MSSFsr.js → local-app-workbench-page-hJzkUVoK.js} +1 -1
  74. package/dist/gateway/static/root/assets/{local-apps-page-BeV86rMJ.js → local-apps-page-Bj-nywIv.js} +1 -1
  75. package/dist/gateway/static/root/assets/{local-session-drafts-jgw8UGsO.js → local-session-drafts-hodTdtvj.js} +1 -1
  76. package/dist/gateway/static/root/assets/{locale-store-CAZaC05J.js → locale-store-LhhHA2sK.js} +1 -1
  77. package/dist/gateway/static/root/assets/{logs-page-BMmSsUP5.js → logs-page-CcM2foZi.js} +1 -1
  78. package/dist/gateway/static/root/assets/{management-settings-Bu7T8ewk.js → management-settings-gwDIT7mY.js} +1 -1
  79. package/dist/gateway/static/root/assets/{markdown-view-BatP4qeK.js → markdown-view-usF9EoMp.js} +1 -1
  80. package/dist/gateway/static/root/assets/{mcp-conversation-setup-page-rROtr0UN.js → mcp-conversation-setup-page-CfHcS8aO.js} +1 -1
  81. package/dist/gateway/static/root/assets/{media-plugins-88OV72YE.js → media-plugins-Kpj3pQ3i.js} +1 -1
  82. package/dist/gateway/static/root/assets/messages-C3xqMM9W.js +3 -0
  83. package/dist/gateway/static/root/assets/{model-selector-raBRBkN_.js → model-selector-VVkCmNdS.js} +1 -1
  84. package/dist/gateway/static/root/assets/{models-hub-cache-CzC9y3D0.js → models-hub-cache-BfrcizHv.js} +1 -1
  85. package/dist/gateway/static/root/assets/{note-detail-panel-BvA8Vkbm.js → note-detail-panel-vvlPKLHz.js} +3 -3
  86. package/dist/gateway/static/root/assets/note-image-lightbox-BDZGHYaZ.js +1 -0
  87. package/dist/gateway/static/root/assets/{notes-api-zXpV6UXu.js → notes-api-DflS6I2c.js} +1 -1
  88. package/dist/gateway/static/root/assets/{notes-page-CjYH9Kle.js → notes-page-DKPHaszO.js} +1 -1
  89. package/dist/gateway/static/root/assets/{oauth-api-DmxSaxM1.js → oauth-api-CZiot_FY.js} +1 -1
  90. package/dist/gateway/static/root/assets/{oauth-provider-connect-D4Gfs-Ba.js → oauth-provider-connect-BjLEJ4az.js} +1 -1
  91. package/dist/gateway/static/root/assets/{page-context-capture-button-Mig3d0UX.js → page-context-capture-button-C3okR3ap.js} +1 -1
  92. package/dist/gateway/static/root/assets/{page-context-draft-C4IIZaKd.js → page-context-draft-DRE6i2wO.js} +1 -1
  93. package/dist/gateway/static/root/assets/page-header-store-BVj8nDdi.js +1 -0
  94. package/dist/gateway/static/root/assets/{personal-avatar-DLa-CpaK.js → personal-avatar-TZzkeDZK.js} +1 -1
  95. package/dist/gateway/static/root/assets/{personal-page-BhuT79Wd.js → personal-page-Cz-KnXHT.js} +1 -1
  96. package/dist/gateway/static/root/assets/{personal-settings-panel-XSUkgcr2.js → personal-settings-panel-BilBWHZ1.js} +1 -1
  97. package/dist/gateway/static/root/assets/{phone-dependencies-card-DYwnuVh3.js → phone-dependencies-card-B_l_JCRy.js} +1 -1
  98. package/dist/gateway/static/root/assets/{phone-model-connection-2F32QTHA.js → phone-model-connection-DmYRqxCF.js} +1 -1
  99. package/dist/gateway/static/root/assets/{phone-model-picker-DCVzIr0s.js → phone-model-picker-wK2tRuj0.js} +1 -1
  100. package/dist/gateway/static/root/assets/{phone-settings-page-DJttE4id.js → phone-settings-page-DWUZuu3k.js} +1 -1
  101. package/dist/gateway/static/root/assets/{phone-workspace-store-Dxp-KhFP.js → phone-workspace-store-CpH233TG.js} +1 -1
  102. package/dist/gateway/static/root/assets/{plugin-details-dialog-tyjAjFjA.js → plugin-details-dialog-DIQH12Ki.js} +1 -1
  103. package/dist/gateway/static/root/assets/{preference-select-fields-BVP3MhGK.js → preference-select-fields-DPXt3YyQ.js} +1 -1
  104. package/dist/gateway/static/root/assets/{product-automation-feedback-DbJvv92z.js → product-automation-feedback-BVkkAJkY.js} +1 -1
  105. package/dist/gateway/static/root/assets/{product-open-page-RImqlhCD.js → product-open-page-D-fwzOTB.js} +1 -1
  106. package/dist/gateway/static/root/assets/{product-preview-content-DxSqrKsg.js → product-preview-content-DLnOxTnn.js} +1 -1
  107. package/dist/gateway/static/root/assets/{product-preview-modal-Cw8Q8Uom.js → product-preview-modal-AeEtUDZQ.js} +2 -2
  108. package/dist/gateway/static/root/assets/{project-detail-page-CuugOYfe.js → project-detail-page-B7L3Kvhc.js} +1 -1
  109. package/dist/gateway/static/root/assets/{project-understanding-BMKcoUW5.js → project-understanding-tqZ0etEw.js} +1 -1
  110. package/dist/gateway/static/root/assets/{projects-page-CFsABLvs.js → projects-page-D65pw44g.js} +1 -1
  111. package/dist/gateway/static/root/assets/{providers-api-CAeXbJNF.js → providers-api-DzeStdCu.js} +1 -1
  112. package/dist/gateway/static/root/assets/{recording-upload-CfpllTe5.js → recording-upload-Id3p5Vyv.js} +1 -1
  113. package/dist/gateway/static/root/assets/{registry-api-fLOqFyrz.js → registry-api-B3YqZBhQ.js} +1 -1
  114. package/dist/gateway/static/root/assets/{remote-access-hub-BvKOxy0L.js → remote-access-hub-DxAInmWy.js} +1 -1
  115. package/dist/gateway/static/root/assets/{resource-unavailable-D15jzjV_.js → resource-unavailable-DH-GGLSM.js} +1 -1
  116. package/dist/gateway/static/root/assets/{route-preload-BQapekpy.js → route-preload-C22MIvup.js} +2 -2
  117. package/dist/gateway/static/root/assets/{runtime-tools-api-D0Nrvuqv.js → runtime-tools-api-8mXDTzc2.js} +1 -1
  118. package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-CA27XgL2.js → runtime-tools-settings-panel-S2HxRVlT.js} +1 -1
  119. package/dist/gateway/static/root/assets/{service-recommendation-list-B0RoYLVT.js → service-recommendation-list-DFqBz8S6.js} +1 -1
  120. package/dist/gateway/static/root/assets/{session-api-CHRP5Lwf.js → session-api-DZ2Ov33K.js} +1 -1
  121. package/dist/gateway/static/root/assets/{session-manager-DRRWwKE4.js → session-manager-DSaoWM1F.js} +1 -1
  122. package/dist/gateway/static/root/assets/{sessions-page-uJHS3-6F.js → sessions-page-BpUbNplq.js} +1 -1
  123. package/dist/gateway/static/root/assets/settings-advanced-gate-CGgt1myW.js +1 -0
  124. package/dist/gateway/static/root/assets/{settings-advanced-section-D-llwfSj.js → settings-advanced-section-TJ8MAroB.js} +1 -1
  125. package/dist/gateway/static/root/assets/{settings-mode-store-BspMKc9N.js → settings-mode-store-xhm6JIs-.js} +1 -1
  126. package/dist/gateway/static/root/assets/{settings-page-CedwaHM0.js → settings-page-B_XKKvWr.js} +1 -1
  127. package/dist/gateway/static/root/assets/{settings-page-header-LuOJvqNa.js → settings-page-header-BEDxq_lT.js} +1 -1
  128. package/dist/gateway/static/root/assets/{settings-page-layout-CduQ8w4a.js → settings-page-layout-BftgkTYo.js} +1 -1
  129. package/dist/gateway/static/root/assets/{setup-interaction-page-ujpPGl84.js → setup-interaction-page-BtihoIoz.js} +1 -1
  130. package/dist/gateway/static/root/assets/{setup-status-panel-BN2aCJUN.js → setup-status-panel-DehYof2V.js} +1 -1
  131. package/dist/gateway/static/root/assets/{share-link-dialog-CTATUaa4.js → share-link-dialog-C-mhzvLF.js} +1 -1
  132. package/dist/gateway/static/root/assets/{share-preview-page-Dq0J3VgS.js → share-preview-page-Cnxfv66F.js} +1 -1
  133. package/dist/gateway/static/root/assets/{shares-api-zegE8pSE.js → shares-api-D2HTaQZH.js} +1 -1
  134. package/dist/gateway/static/root/assets/{shares-settings-DXpvsRXq.js → shares-settings-BLcnCGon.js} +1 -1
  135. package/dist/gateway/static/root/assets/{skill-api-DCL1EN7f.js → skill-api-DOISy5q8.js} +1 -1
  136. package/dist/gateway/static/root/assets/{skill-list-api-Bv0mmHbu.js → skill-list-api-LoIlcCDf.js} +1 -1
  137. package/dist/gateway/static/root/assets/{skill-reload-api-DPZbadiO.js → skill-reload-api-qSwB_mAH.js} +1 -1
  138. package/dist/gateway/static/root/assets/{skills-page-DMC7Gaku.js → skills-page-CJXLVK0U.js} +1 -1
  139. package/dist/gateway/static/root/assets/{system-settings-panel-BYFUhlqG.js → system-settings-panel-BT6_yFco.js} +1 -1
  140. package/dist/gateway/static/root/assets/{task-detail-page-_Og3plZL.js → task-detail-page-1AFyRTia.js} +1 -1
  141. package/dist/gateway/static/root/assets/{task-result-evidence-Bxm8-H0B.js → task-result-evidence-CkwEM0In.js} +1 -1
  142. package/dist/gateway/static/root/assets/{terminal-panel-store-Djf9l2qZ.js → terminal-panel-store-BP3dN3md.js} +1 -1
  143. package/dist/gateway/static/root/assets/{theme-store-8GFVtotZ.js → theme-store-BZ8YC33M.js} +1 -1
  144. package/dist/gateway/static/root/assets/{tracing-settings-page-oWW3SBZ4.js → tracing-settings-page-9YvEnES_.js} +1 -1
  145. package/dist/gateway/static/root/assets/{tunnel-api-D-mEsSGF.js → tunnel-api-CnPOg1pg.js} +1 -1
  146. package/dist/gateway/static/root/assets/{understanding-activity-store-CvDjsd0I.js → understanding-activity-store-3sOhoxX4.js} +1 -1
  147. package/dist/gateway/static/root/assets/{understanding-refresh-store-DzOZJm7A.js → understanding-refresh-store-BBXlbRLa.js} +1 -1
  148. package/dist/gateway/static/root/assets/{usage-page-z-o6Uuev.js → usage-page-6LW4yLy1.js} +1 -1
  149. package/dist/gateway/static/root/assets/{use-autosave-BVYS8UoK.js → use-autosave-CDy9yziL.js} +1 -1
  150. package/dist/gateway/static/root/assets/{use-composer-attachments-lecOV2q5.js → use-composer-attachments-C4eSyX-C.js} +1 -1
  151. package/dist/gateway/static/root/assets/{use-file-preview-expanded-nd_CuFsd.js → use-file-preview-expanded-SFqd8k7K.js} +2 -2
  152. package/dist/gateway/static/root/assets/{use-personal-profile-CQi2ZCxV.js → use-personal-profile-sQzaa6Dy.js} +1 -1
  153. package/dist/gateway/static/root/assets/{use-workspace-tree-BiaddkzX.js → use-workspace-tree-DKPvcyw1.js} +1 -1
  154. package/dist/gateway/static/root/assets/{user-model-page-Bks1n0Nj.js → user-model-page-DYVp7nA6.js} +1 -1
  155. package/dist/gateway/static/root/assets/{voice-api-key-field-BbW8NFeZ.js → voice-api-key-field-BKXWXCit.js} +1 -1
  156. package/dist/gateway/static/root/assets/{voice-config-api-jSMzZWWy.js → voice-config-api-DNxzs-eF.js} +1 -1
  157. package/dist/gateway/static/root/assets/{voice-input-shortcut-events-_SgYmx7X.js → voice-input-shortcut-events-3kcfHPrY.js} +1 -1
  158. package/dist/gateway/static/root/assets/{voice-transcribe-api-BJCfiRFU.js → voice-transcribe-api-CVVa_x99.js} +1 -1
  159. package/dist/gateway/static/root/assets/{work-discovery-overlay-DSTSNyU7.js → work-discovery-overlay-B4F3MACu.js} +1 -1
  160. package/dist/gateway/static/root/assets/{work-discovery-page-Dd_QJJvb.js → work-discovery-page-BuKTCGSR.js} +1 -1
  161. package/dist/gateway/static/root/assets/{working-directory-picker-modal-q39BUcJ6.js → working-directory-picker-modal-BiDK93J_.js} +1 -1
  162. package/dist/gateway/static/root/assets/{workspace-api-Di2OmCvz.js → workspace-api-S2aJOX7w.js} +2 -2
  163. package/dist/gateway/static/root/assets/workspace-editor-agent-store-oZKoWMdV.js +1 -0
  164. package/dist/gateway/static/root/assets/{workspace-file-preview-dialog-BUGNT765.js → workspace-file-preview-dialog-B9f3GN7l.js} +1 -1
  165. package/dist/gateway/static/root/assets/{workspace-open-location-menu-bMSvmQW7.js → workspace-open-location-menu-BNjipenH.js} +1 -1
  166. package/dist/gateway/static/root/assets/{xopc-cloud-account-card-Bbe19Del.js → xopc-cloud-account-card-Csye7zKU.js} +1 -1
  167. package/dist/gateway/static/root/index.html +81 -81
  168. package/dist/package.js +1 -1
  169. package/dist/src/agent/client-error-format.d.ts +1 -1
  170. package/dist/src/agent/client-error-format.js +3 -2
  171. package/dist/src/agent/orchestration/llm-turn-retry.js +8 -1
  172. package/dist/src/agent/tool-manuals/computer.d.ts +1 -1
  173. package/dist/src/agent/tool-manuals/computer.js +2 -2
  174. package/dist/src/cli/commands/platform.js +2 -2
  175. package/dist/src/computer/broker.d.ts +5 -1
  176. package/dist/src/computer/broker.js +34 -9
  177. package/dist/src/computer/diagnostics.d.ts +340 -0
  178. package/dist/src/computer/diagnostics.js +4 -0
  179. package/dist/src/computer/errors.d.ts +340 -0
  180. package/dist/src/computer/errors.js +122 -5
  181. package/dist/src/computer/evaluation.d.ts +186 -0
  182. package/dist/src/computer/model-adapter.js +47 -20
  183. package/dist/src/computer/runtime.d.ts +170 -0
  184. package/dist/src/computer/runtime.js +36 -8
  185. package/dist/src/computer/stability-diagnostics.d.ts +23 -0
  186. package/dist/src/computer/stability-diagnostics.js +71 -0
  187. package/dist/src/computer/validation-diagnostics.d.ts +9 -0
  188. package/dist/src/computer/validation-diagnostics.js +54 -0
  189. package/dist/src/providers/model-response.js +1 -0
  190. package/dist/src/realtime/runtime.js +13 -5
  191. package/dist/src/realtime/writer.d.ts +7 -0
  192. package/dist/src/realtime/writer.js +96 -30
  193. package/package.json +1 -1
  194. package/dist/gateway/static/root/assets/automation-task-card-DZWhCWJa.js +0 -3
  195. package/dist/gateway/static/root/assets/gateway-realtime-store-CHrf6-nR.js +0 -1
  196. package/dist/gateway/static/root/assets/index-iukJWzxG.css +0 -1
  197. package/dist/gateway/static/root/assets/messages-C7fckbyG.js +0 -3
  198. package/dist/gateway/static/root/assets/note-image-lightbox-D6kUDDd5.js +0 -1
  199. package/dist/gateway/static/root/assets/page-header-store-D7G5utVi.js +0 -1
  200. package/dist/gateway/static/root/assets/settings-advanced-gate-CZ4J3Kuy.js +0 -1
  201. package/dist/gateway/static/root/assets/workspace-editor-agent-store-B2r9wlix.js +0 -1
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sessions-page-uJHS3-6F.js","assets/rolldown-runtime-aKtaBQYM.js","assets/vendor-react-BOUWij0V.js","assets/chunk-KS7C4IRE-CiwuuyV8.js","assets/preload-helper-Czpn1I53.js","assets/locale-store-CAZaC05J.js","assets/messages-C7fckbyG.js","assets/dist-BGTk37IG.js","assets/es2015-DBLcMg5B.js","assets/dist-CxGUk8J-.js","assets/session-identity-label-BP7OIYth.js","assets/createLucideIcon-DPHK1VkS.js","assets/session-channel-icon-D1ktvt1P.js","assets/clock-3-DnrAnuyZ.js","assets/git-branch-Dh9uxTot.js","assets/message-circle-Badhj-4D.js","assets/message-square-fVE7Ghj1.js","assets/plug-DKYPEgkR.js","assets/settings-2-D-csvaET.js","assets/terminal-oKqqZdiG.js","assets/zap-dximCGjy.js","assets/cn-0WouolD0.js","assets/bundle-mjs-rHxsej31.js","assets/schemas-CCWMleym.js","assets/archive-Dz0hferG.js","assets/popover-select-CEMWIrtY.js","assets/check-DUBLcKHA.js","assets/skeleton-BI5TyibZ.js","assets/dist-GJ8-1PAx.js","assets/dist-BuHnPloF.js","assets/floating-ui.dom-seOukHzT.js","assets/settings-shell-dialog-layer-BU3UuiJr.js","assets/circle-BoO4YvTx.js","assets/coins-DjP27vUx.js","assets/database-CjjeZfRG.js","assets/download-Dk-ZjtO6.js","assets/folder-open-CyzJ19I9.js","assets/layers-mJW7JJKm.js","assets/layout-grid-CEVZdVFU.js","assets/minimize-2-DtOGrlpo.js","assets/pin-off-BMRv-Kxr.js","assets/plus-Q2yW6OE7.js","assets/search-DA7gz22f.js","assets/settings-uiTATseT.js","assets/trash-2-DusmjVPV.js","assets/x-B_N4OPjy.js","assets/session-api-CHRP5Lwf.js","assets/gateway-startup-retry-PMJi5mX4.js","assets/vendor-swr-CdRzEUwF.js","assets/gateway-config-swr-Cq-ByXL4.js","assets/chat-agents-api-BUi_7GRo.js","assets/registry-api-fLOqFyrz.js","assets/button-Cc4hUNTt.js","assets/interaction-BdhHBbYa.js","assets/form-field-width-DJw_jULe.js","assets/page-tabs-oeTY7z3_.js","assets/sliding-indicator-hwz0sx3h.js","assets/agent-avatar-display-ByzM7u9S.js","assets/loopi-CNtmi9FU.js","assets/loopi-C09I2mNj.css","assets/sliding-tab-list-DuQyViqe.js","assets/settings-form-draft-Dy10ldo8.js","assets/model-selector-raBRBkN_.js","assets/open-capability-settings-Cvb65hQB.js","assets/segmented-styles-Cqb91xsn.js","assets/settings-advanced-section-D-llwfSj.js","assets/settings-mode-store-BspMKc9N.js","assets/middleware-Pd0e8Igk.js","assets/number-input-El7Szeln.js","assets/settings-page-header-LuOJvqNa.js","assets/external-link-DjqjBmc3.js","assets/sparkles-DHlfQFAF.js","assets/settings-page-layout-CduQ8w4a.js","assets/settings-form-section-num14vSv.js","assets/pencil-DmIY3Oa-.js","assets/use-autosave-BVYS8UoK.js","assets/circle-alert-BEjgurr2.js","assets/loader-circle-CifKLtgG.js","assets/settings-advanced-gate-CZ4J3Kuy.js","assets/usage-page-z-o6Uuev.js","assets/bot-DjLkhyZL.js","assets/gauge-C78eD2BA.js","assets/refresh-cw-BRlGaq2w.js","assets/timer-rCwGHjuO.js","assets/xopc-cloud-account-card-Bbe19Del.js","assets/cloud-C4-yfnnk.js","assets/triangle-alert-2JXFNNKU.js","assets/cloud-credits-B-nbtkqv.js","assets/automations-page-BjbM15eY.js","assets/automations-workspace-CqurzLYX.js","assets/activity-YogQEteU.js","assets/arrow-left-D880xG-P.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/automation-run-list-CJOdy_R2.js","assets/automation-api-4fVKv9PJ.js","assets/markdown-view-BatP4qeK.js","assets/file-image-CDUPkZvG.js","assets/app-link-DRy3-k7j.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/api-B9fZL-V8.js","assets/tasks-DRmd6sWt.js","assets/specialists-xbB3xL9e.js","assets/files-BNL4kkSB.js","assets/session-manager-DRRWwKE4.js","assets/constants-DBtMsXdW.js","assets/local-session-drafts-jgw8UGsO.js","assets/tool-activity-BtJkgjFf.js","assets/personal-proactivity-DaRnbB1f.js","assets/attachment-utils-core-BIOUBrpT.js","assets/gateway-realtime-DwMd2PCt.js","assets/gateway-realtime-store-CHrf6-nR.js","assets/agents-admin-api-B5lKH_ps.js","assets/page-header-store-D7G5utVi.js","assets/refresh-button-DiWdGAaX.js","assets/dist-ZrL34Ps4.js","assets/automation-task-card-DZWhCWJa.js","assets/date-picker-Cfjq1hD_.js","assets/calendar-days-hw_Y-g-s.js","assets/chevron-left-DqFhpbvK.js","assets/agent-display-names-Bje7vfSn.js","assets/automation-result-state-m7PeK2kl.js","assets/browser-automation-inputs-DL4YPCuN.js","assets/browser-automations-page-1Aq6XmRs.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-yjru8E7R.js","assets/home-page-Chn7YTiD.js","assets/history-DXH_9jsE.js","assets/paperclip-f1HujQY1.js","assets/use-composer-attachments-lecOV2q5.js","assets/file-BqMS_3DT.js","assets/use-file-preview-expanded-nd_CuFsd.js","assets/app-window-DXFNqt_0.js","assets/link-2-D_ZKYUW7.js","assets/message-square-plus-XP0tGdlV.js","assets/rotate-cw-LIg3Am9S.js","assets/save-DRDABU--.js","assets/activity-store-Cwn_CNwl.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-Di2OmCvz.js","assets/mic-CuUb7zc-.js","assets/share-link-dialog-CTATUaa4.js","assets/globe-DSSGFWFn.js","assets/copy-text-row-CpiRzq4G.js","assets/capabilities-C7lnwKKm.js","assets/capabilities-DaeQXJT4.js","assets/file-preview-surface-BcLeaSNe.js","assets/phone-workspace-store-Dxp-KhFP.js","assets/shares-api-zegE8pSE.js","assets/skill-wire-pattern-BPpeIcCi.js","assets/composer-payload-handoff-B5XNxNCb.js","assets/rotate-ccw-JM1TBLpp.js","assets/voice-transcribe-api-BJCfiRFU.js","assets/workspace-editor-agent-store-B2r9wlix.js","assets/voice-input-shortcut-events-_SgYmx7X.js","assets/date-formatters-DukWSVwc.js","assets/tab-completion-input-CxtEp0aP.js","assets/task-result-evidence-Bxm8-H0B.js","assets/file-text-D12HbeVy.js","assets/task-detail-page-_Og3plZL.js","assets/chat-page--wcFhTjW.js","assets/arrow-up-D5ZtR1QT.js","assets/product-automation-feedback-DbJvv92z.js","assets/notes-api-zXpV6UXu.js","assets/chat-chart-block-CcVcKsDZ.js","assets/volume-2-BSJhAY97.js","assets/book-open-CCGtrT3R.js","assets/working-directory-picker-modal-q39BUcJ6.js","assets/file-archive-DanfQJNe.js","assets/new-chat-navigation-B6NPQ4h4.js","assets/circle-x-DFsCKeya.js","assets/file-tree-utils-DJs1faGv.js","assets/folder-kanban-CpLlFI1o.js","assets/folder-CN-pC3XL.js","assets/key-round-DWbpyU2U.js","assets/laptop-CI3hBVrl.js","assets/list-checks-BbsExAoq.js","assets/list-todo-CTVRto8O.js","assets/messages-square-BckAJrEW.js","assets/monitor-Af5eAvF7.js","assets/install-connector-dialog-Bo06Ry3H.js","assets/secret-input-Dryrns2s.js","assets/is-masked-secret-DOkL5b_X.js","assets/connectors-api-NcWECWKg.js","assets/oauth-provider-connect-D4Gfs-Ba.js","assets/models-hub-cache-CzC9y3D0.js","assets/oauth-api-DmxSaxM1.js","assets/connection-usage-guide-Ddh0bfkj.js","assets/arrow-up-right-T72JbQ1Q.js","assets/connection-usage-Cm_McddI.js","assets/smartphone-DSSsQFqA.js","assets/wrench-DFb4r8bH.js","assets/new-session-preferences-gb411vZP.js","assets/extension-provider-NKWfjpdP.js","assets/theme-store-8GFVtotZ.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-D7dQJytv.js","assets/command-palette-api-luUjQPsh.js","assets/skill-list-api-Bv0mmHbu.js","assets/skill-api-utils-C7V4JVXM.js","assets/dev-view-store-DQJ61P5L.js","assets/extension-iframe-host-Bds-5kY_.js","assets/api-Djju8qIR.js","assets/runtime-health-D2TDFLLq.js","assets/terminal-panel-store-Djf9l2qZ.js","assets/agents-app-path-ciChvpCS.js","assets/use-media-query-ady-FgjK.js","assets/oauth-authorization-window-o6URRos4.js","assets/page-context-draft-C4IIZaKd.js","assets/side-chat-shortcut-BIw-1TTD.js","assets/chat-page-zQeUaawJ.css","assets/page-context-capture-button-Mig3d0UX.js","assets/dependency-picker-XjPB8FJS.js","assets/projects-page-CFsABLvs.js","assets/arrow-right-DSSvoX71.js","assets/project-understanding-BMKcoUW5.js","assets/project-detail-page-CuugOYfe.js","assets/resource-unavailable-D15jzjV_.js","assets/discussion-annotation-sync-DfBRkWtw.js","assets/workspace-open-location-menu-bMSvmQW7.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-BUGNT765.js","assets/with-selector-xonYxPoM.js","assets/directory-picker-path-field-Drv864uE.js","assets/skill-api-DCL1EN7f.js","assets/skill-reload-api-DPZbadiO.js","assets/note-detail-panel-BvA8Vkbm.js","assets/code-xml-DJtYhZUF.js","assets/note-image-lightbox-D6kUDDd5.js","assets/project-detail-page-DLioOiRN.css","assets/notes-page-CjYH9Kle.js","assets/recording-upload-CfpllTe5.js","assets/star-BUWJqJ5c.js","assets/capabilities-page-B5avAOUM.js","assets/product-navigation-Co8pLbDP.js","assets/capability-links-DeO34GIF.js","assets/capability-header-actions-BxMYfQ8y.js","assets/user-model-page-Bks1n0Nj.js","assets/understanding-refresh-store-DzOZJm7A.js","assets/briefcase-business-BsoCaI_t.js","assets/understanding-activity-store-CvDjsd0I.js","assets/sliders-horizontal-DqsYor6I.js","assets/logs-page-BMmSsUP5.js","assets/clipboard-copy-DuJk5WD6.js","assets/settings-page-CedwaHM0.js","assets/browser-settings-page-CvwpT8Um.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-DJttE4id.js","assets/beta-badge-BnzdzIEl.js","assets/global-defaults-api-DgzZh3wX.js","assets/phone-model-picker-DCVzIr0s.js","assets/phone-dependencies-card-DYwnuVh3.js","assets/runtime-tools-api-D0Nrvuqv.js","assets/phone-model-connection-2F32QTHA.js","assets/providers-api-CAeXbJNF.js","assets/mobile-pair-qr-CuIbmw5x.js","assets/browser-BLJWD7WI.js","assets/computer-settings-page-CWtdyEJH.js","assets/mouse-pointer-2-DZ51Onvj.js","assets/extension-page-ZTw-oucT.js","assets/extension-settings-page-CT7PPt_q.js","assets/voice-config-api-jSMzZWWy.js","assets/voice-api-key-field-BbW8NFeZ.js","assets/schema-form-C-jw6Hid.js","assets/secret-input-labels-B5Jl5HqK.js","assets/extension-debug-page-DAlBIt_R.js","assets/share-preview-page-Dq0J3VgS.js","assets/local-apps-page-BeV86rMJ.js","assets/box-DvYoGszj.js","assets/local-app-workbench-page-B3MSSFsr.js","assets/power-off-CwwQ7Gp7.js","assets/power-ZI-pBczI.js","assets/product-open-page-RImqlhCD.js","assets/open-route-MyZ2sB9C.js","assets/work-discovery-page-Dd_QJJvb.js","assets/service-recommendation-list-B0RoYLVT.js","assets/package-wATCyihJ.js","assets/agent-plugin-dialog-XN-tZ-Ox.js","assets/capability-icon-DVoZxEgW.js","assets/extension-marketplace-api-CZg8nBwW.js","assets/work-discovery-overlay-DSTSNyU7.js","assets/brand-logo-CgT9zQfr.js","assets/setup-status-panel-BN2aCJUN.js","assets/stethoscope-DRqTAtjD.js","assets/appearance-settings-BxdFGob3.js","assets/preference-select-fields-BVP3MhGK.js","assets/keyboard-shortcuts-settings-BylFJeGu.js","assets/personal-settings-panel-XSUkgcr2.js","assets/use-personal-profile-CQi2ZCxV.js","assets/system-settings-panel-BYFUhlqG.js","assets/browser-notification-delivery-DmE2FgGc.js","assets/shield-B1sI_cxl.js","assets/desktop-pet-settings-DvnVIv25.js","assets/wand-sparkles-CkSL-3Fy.js","assets/desktop-pet-sprite-D5YYq2zC.js","assets/desktop-pet-sprite-BuB0g8zv.css","assets/app-management-settings-panel-IlyzDPJu.js","assets/capabilities-settings-panel-_9yCS78i.js","assets/connected-providers-grid-2idMtk65.js","assets/navigation-D62kPsA9.js","assets/image-generation-api-CjVpsckq.js","assets/gateway-settings-1QUdNwrZ.js","assets/network-BUQLY1BV.js","assets/gateway-restart-DdiVzbkL.js","assets/runtime-tools-settings-panel-CA27XgL2.js","assets/remote-access-hub-BvKOxy0L.js","assets/server-BlHCBjiE.js","assets/tunnel-api-D-mEsSGF.js","assets/shares-settings-DXpvsRXq.js","assets/use-workspace-tree-BiaddkzX.js","assets/agent-defaults-settings-panel-B0i37diS.js","assets/management-settings-Bu7T8ewk.js","assets/shield-off-2jsucUds.js","assets/device-pairing-wizard-KxaIL-OX.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-uJHS3-6F.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78])),n=()=>e(()=>import(`./usage-page-z-o6Uuev.js`),__vite__mapDeps([79,1,2,3,4,5,6,80,11,25,26,21,22,27,28,8,9,29,30,31,76,33,34,81,82,83,48,52,60,56,69,70,71,72,84,85,86,87,23])),r=()=>e(()=>import(`./automations-page-BjbM15eY.js`),__vite__mapDeps([88,2,1,89,4,3,5,6,7,8,9,90,11,91,92,26,93,94,25,21,22,27,28,29,30,31,76,95,96,97,98,14,99,100,48,101,102,35,103,41,45,104,105,23,106,107,108,109,110,15,111,74,112,82,42,113,71,114,44,20,115,116,117,118,46,47,119,120,121,122,123,124,125,126,51,127,49,50,52,128,60,56,129,130,62,18,63,53,54,131,13,132,133,134,135,136,137])),i=()=>e(()=>import(`./browser-automations-page-1Aq6XmRs.js`),__vite__mapDeps([138,1,2,3,4,5,6,80,11,25,26,21,22,27,28,8,9,29,30,31,139,140,13,141,77,74,112,142,143,44,45,52,128,144,137])),a=()=>e(()=>import(`./home-page-Chn7YTiD.js`),__vite__mapDeps([145,1,2,4,3,5,6,7,8,9,92,11,93,94,76,95,13,70,146,102,35,103,41,45,21,22,104,105,23,106,107,108,109,110,15,147,82,18,71,27,116,117,148,134,149,150,151,26,96,97,98,36,152,77,153,39,74,154,155,42,120,46,47,124,53,156,157,158,159,60,56,160,161,118,130,29,30,162,163,25,28,31,164,52,165,166,121,167,168,169,170,171,172,173,174,119,122,123,125,126,51,127,49,48,67,63,175,176,128,177,178,179,180])),o=()=>e(()=>import(`./task-detail-page-_Og3plZL.js`),__vite__mapDeps([181,1,2,3,4,5,6,7,8,9,182,11,151,24,91,183,184,90,80,95,139,13,70,185,102,35,103,41,45,21,22,104,105,23,106,107,108,109,110,186,26,96,27,77,16,111,112,173,154,71,86,187,20,48,52,101,188,93,94,189,190,53,54,61,25,28,29,30,31,76,191,192,32,193,34,141,97,149,180,194,36,195,150,98,152,153,39,147,74,82,155,42,120,46,47,124,156,157,158,159,60,56,160,161,118,130,14,164,146,196,197,198,199,200,162,201,202,203,204,205,49,206,85,207,51,208,209,210,211,18,43,113,212,143,44,163,165,213,116,117,115,119,121,122,123,125,126,127,214,215,166,216,67,148,134,167,168,169,170,171,50,172,174,63,175,176,217,218,219,128,58,59,57,220,221,222,223,224,62,225,226,131,92,15,132,133,227,228,229,230,135,231,232,233,234,235,177,179,236,237])),s=()=>e(()=>import(`./projects-page-CFsABLvs.js`),__vite__mapDeps([238,1,2,3,4,5,6,7,8,9,24,11,239,189,190,77,21,22,52,53,54,61,25,26,27,28,29,30,31,194,36,40,41,173,42,45,115,23,116,117,118,128,240,48,220,177])),c=()=>e(()=>import(`./project-detail-page-CuugOYfe.js`),__vite__mapDeps([241,1,2,3,4,5,6,242,7,8,9,24,11,243,93,52,21,22,91,239,184,90,80,95,139,13,70,185,102,35,103,41,45,104,105,23,106,107,108,109,110,186,26,96,27,77,16,111,112,173,154,71,86,187,20,48,101,92,134,94,189,190,53,54,61,25,28,29,30,31,76,191,32,193,244,36,150,151,97,98,152,153,39,147,74,82,155,42,120,46,47,124,156,157,158,159,60,56,160,161,118,130,245,149,180,195,14,146,246,38,198,247,162,248,40,43,113,143,249,250,44,251,252,116,117,115,148,163,164,165,166,121,167,168,169,170,171,127,49,55,128,240,221,129,253,216,67,222,223,224,132,133,135,254,75,177,255,220,256,257,89,99,100,15,114,119,122,123,125,126,51,50,62,18,63,131,136,137,236,233,258,259,206,85,207,208,260,237,261])),l=()=>e(()=>import(`./notes-page-CjYH9Kle.js`),__vite__mapDeps([262,1,2,3,4,5,6,24,11,243,93,52,9,21,22,91,239,183,184,90,80,95,139,13,70,185,7,8,102,35,103,41,45,104,105,23,106,107,108,109,110,186,26,96,27,77,16,111,112,173,154,71,86,187,20,48,101,133,25,28,29,30,31,97,180,195,263,162,147,42,264,44,251,157,128,60,56,160,221,130,258,259,98,146,15,74,82,114,143,119,120,46,47,121,122,123,124,125,126,51,127,49,216,67,170,206,85,158,207,208,233,260,236,167,166,116,117])),u=()=>e(()=>import(`./capabilities-page-B5avAOUM.js`),__vite__mapDeps([265,1,2,4,3,5,6,27,21,22,266,128,267,211,268,42,11,52,9,28,8,29,30,231])),d=()=>e(()=>import(`./user-model-page-Bks1n0Nj.js`),__vite__mapDeps([269,1,2,3,4,5,6,7,8,9,188,11,80,270,48,271,133,26,93,94,25,21,22,27,28,29,30,31,76,95,13,34,35,141,97,272,36,14,199,77,247,15,74,41,82,42,113,273,71,249,44,251,252,45,52,157,55,53,56,128,58,59,60,130,132,134])),f=()=>e(()=>import(`./logs-page-BMmSsUP5.js`),__vite__mapDeps([274,1,2,3,4,5,6,7,8,9,93,11,25,26,21,22,27,28,29,30,31,275,35,180,195,81,99,82,42,19,45,46,23,47,125,126,52,107,54,56,129,64,69,70,71,72])),p=()=>e(()=>import(`./settings-page-CedwaHM0.js`),__vite__mapDeps([276,1,2,3,4,5,6])),m=()=>e(()=>import(`./browser-settings-page-CvwpT8Um.js`),__vite__mapDeps([277,1,2,3,4,5,6,93,11,25,26,21,22,27,28,8,9,29,30,31,95,278,35,70,98,36,81,164,279,77,247,280,82,18,86,48,49,52,61,281,68,69,71,72,75,76,144])),h=()=>e(()=>import(`./phone-settings-page-DJttE4id.js`),__vite__mapDeps([282,1,2,3,4,5,6,7,8,9,151,11,93,25,26,21,22,27,28,29,30,31,283,112,41,82,42,113,212,45,48,52,169,130,284,49,69,70,71,285,286,95,35,213,287,288,91,63,289,51,47,204,207,290,291])),g=()=>e(()=>import(`./computer-settings-page-CWtdyEJH.js`),__vite__mapDeps([292,1,2,3,4,5,6,26,11,164,201,293,41,113,143,27,21,22,48,49,51,47,52,9,158,62,25,28,8,29,30,31,18,63,53,54,284,69,70,71,72])),_=()=>e(()=>import(`./extension-page-ZTw-oucT.js`),__vite__mapDeps([294,1,2,3,4,242,5,6,215,23,119,120,46,47,121,122,123,124,125,126,51,127,49,48,166,116,117,106,156,216,67,128,226,7,8,9,61])),v=()=>e(()=>import(`./extension-settings-page-CT7PPt_q.js`),__vite__mapDeps([295,1,2,3,4,5,6,242,25,11,26,21,22,27,28,8,9,29,30,31,215,23,119,120,46,47,121,122,123,124,125,126,51,127,49,48,166,116,117,106,156,216,67,52,54,226,7,61,281,69,70,71,72,75,76,77,296,297,203,95,96,98,107,53,204,298,299,68])),y=()=>e(()=>import(`./extension-debug-page-DAlBIt_R.js`),__vite__mapDeps([300,1,2,5,6,215,23,119,120,46,47,121,122,123,124,125,126,51,4,127,49,48,166,116,117,106,156,216,67,69,3,70,11,71,21,22,52,9,72])),b=()=>e(()=>import(`./share-preview-page-Dq0J3VgS.js`),__vite__mapDeps([301,1,2,4,3,5,6,150,11,151,26,93,96,35,97,70,98,36,152,77,102,7,8,9,103,41,45,21,22,104,105,23,106,107,108,109,110,153,39,147,74,82,154,155,42,27,120,46,47,124,53,156,157,158,159,60,56,160,161,118,130,29,30,52,186])),x=()=>e(()=>import(`./local-apps-page-BeV86rMJ.js`),__vite__mapDeps([302,1,2,3,4,5,6,239,11,303,41,27,21,22,48,52,9,128,227])),S=()=>e(()=>import(`./local-app-workbench-page-B3MSSFsr.js`),__vite__mapDeps([304,1,2,3,4,5,6,242,7,8,9,91,11,26,95,192,13,70,305,194,146,77,248,306,82,173,113,71,44,86,45,27,21,22,106,23,115,116,117,118,48,52,128,227,228,177,178,236,180,119,120,46,47,121,122,123,124,125,126,51,127,49,167,166,233])),C=()=>e(()=>import(`./product-open-page-RImqlhCD.js`),__vite__mapDeps([307,2,1,3,4,5,6,27,21,22,105,23,106,48,227,308])),w=()=>e(()=>import(`./work-discovery-page-Dd_QJJvb.js`).then(e=>e.n),__vite__mapDeps([309,1,2,3,4,5,6,11,310,93,189,7,8,9,190,77,21,22,52,53,54,61,202,25,26,27,28,29,30,31,95,70,203,96,98,107,204,45,205,49,48,158,206,85,207,51,47,208,209,210,71,211,311,41,312,91,76,32,36,113,251,267,291,313,314,133,94,13,34,272,180,14,199,200,280,58,59,220])),T=()=>e(()=>import(`./work-discovery-overlay-DSTSNyU7.js`),__vite__mapDeps([315,1,2,5,6,7,8,9,309,3,4,11,310,93,189,190,77,21,22,52,53,54,61,202,25,26,27,28,29,30,31,95,70,203,96,98,107,204,45,205,49,48,158,206,85,207,51,47,208,209,210,71,211,311,41,312,91,76,32,36,113,251,267,291,313,314,133,94,13,34,272,180,14,199,200,280,58,59,220,316])),E=()=>e(()=>import(`./setup-status-panel-BN2aCJUN.js`),__vite__mapDeps([317,1,2,3,4,5,6,90,11,94,95,192,32,279,77,82,318,86,21,22,27,48,49,126,51,47,52,9,53,204,158,223,224,281,289,207,69,70,71,72,73,74,78,66,67,287])),D=()=>e(()=>import(`./appearance-settings-BxdFGob3.js`),__vite__mapDeps([319,1,2,5,6,25,11,26,21,22,27,28,8,9,29,30,31,49,48,53,320,67,54,216,225,69,3,4,70,71,52,72,78,66])),O=()=>e(()=>import(`./keyboard-shortcuts-settings-BylFJeGu.js`),__vite__mapDeps([321,1,2,5,6,21,22,158,176,67,234,69,3,4,70,11,71,52,9,72])),k=()=>e(()=>import(`./personal-settings-panel-XSUkgcr2.js`),__vite__mapDeps([322,1,2,5,6,25,11,26,21,22,27,28,8,9,29,30,31,123,23,323,48,69,3,4,70,71,52,72])),A=()=>e(()=>import(`./system-settings-panel-BYFUhlqG.js`),__vite__mapDeps([324,1,2,5,6,325,11,158,70,82,326,21,22,53,61,69,3,4,71,52,9,72,73,74])),j=()=>e(()=>import(`./desktop-pet-settings-DvnVIv25.js`),__vite__mapDeps([327,1,2,3,4,5,6,242,93,11,25,26,21,22,27,28,8,9,29,30,31,76,70,153,328,173,53,158,129,82,52,329,330,69,71,72])),M=()=>e(()=>import(`./app-management-settings-panel-IlyzDPJu.js`),__vite__mapDeps([331,1,2,5,6,7,8,9,96,11,77,311,21,22,27,48,52,31,107,53,158,61,281,69,3,4,70,71,72,73,74])),N=()=>e(()=>import(`./capabilities-settings-panel-_9yCS78i.js`),__vite__mapDeps([332,1,2,4,3,5,6,7,8,9,239,11,210,94,25,26,21,22,27,28,29,30,31,95,333,134,203,96,98,77,107,53,54,204,164,41,42,18,45,48,49,51,47,52,299,60,56,207,289,206,85,158,208,70,246,196,162,74,112,17,82,113,273,143,44,86,187,213,23,174,119,120,46,121,122,123,124,125,126,127,67,63,219,334,61,221,62,230,284,281,65,66,232,68,69,71,72,73,75,76,296,297,335,84,87])),P=()=>e(()=>import(`./gateway-settings-1QUdNwrZ.js`),__vite__mapDeps([336,1,2,3,4,5,6,25,11,26,21,22,27,28,8,9,29,30,31,76,203,95,96,98,77,107,53,54,204,279,196,337,82,154,338,158,113,326,273,86,48,49,52,299,334,55,56,61,221,7,66,67,281,65,68,69,70,71,72,73,74,78])),F=()=>e(()=>import(`./runtime-tools-settings-panel-CA27XgL2.js`),__vite__mapDeps([339,1,2,5,6,25,11,26,21,22,27,28,8,9,29,30,31,76,95,35,173,48,52,129,82,281,69,3,4,70,71,72,78,66,67,287,286,93,213])),I=()=>e(()=>import(`./remote-access-hub-BvKOxy0L.js`),__vite__mapDeps([340,1,2,3,4,5,6,7,8,9,239,11,26,93,94,32,96,70,203,95,98,77,21,22,107,53,54,204,164,196,337,306,341,326,212,19,86,48,49,52,31,55,56,61,221,165,29,30,66,67,289,51,47,207,208,158,65,232,69,71,72,73,74,342,27,334,78])),L=()=>e(()=>import(`./shares-settings-DXpvsRXq.js`),__vite__mapDeps([343,1,2,3,4,5,6,7,8,9,26,11,93,25,21,22,27,28,29,30,31,193,85,96,245,94,97,190,149,103,180,36,195,53,158,146,77,16,41,82,249,44,163,70,164,45,52,165,107,48,49,127,54,55,56,61,221,170,344,161,118,23,175,135,281,206,95,207,51,47,208,68,69,71,72,73,74])),R=()=>e(()=>import(`./agent-defaults-settings-panel-B0i37diS.js`),__vite__mapDeps([345,1,2,3,4,5,6,95,11,81,198,142,42,113,273,21,22,27,87,23,48,52,9,158,60,56,223,224,66,67,284,49,65,68,69,70,71,72,75,26,76,77])),z=()=>e(()=>import(`./management-settings-Bu7T8ewk.js`),__vite__mapDeps([346,1,2,3,4,5,6,7,8,9,90,11,134,94,25,26,21,22,27,28,29,30,31,197,347,41,42,212,45,46,23,47,48,52,55,53,56,160,221,129,82,281,69,70,71,72,348,95,13,35,349,104,105,106,159,165,96,107,208,158,232,342,164,77,306,49,54,334,73,74,290,291])),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-BpUbNplq.js","assets/rolldown-runtime-aKtaBQYM.js","assets/vendor-react-BOUWij0V.js","assets/chunk-KS7C4IRE-CiwuuyV8.js","assets/preload-helper-Czpn1I53.js","assets/locale-store-LhhHA2sK.js","assets/messages-C3xqMM9W.js","assets/dist-BGTk37IG.js","assets/es2015-DBLcMg5B.js","assets/dist-CxGUk8J-.js","assets/session-identity-label-BP7OIYth.js","assets/createLucideIcon-DPHK1VkS.js","assets/session-channel-icon-D1ktvt1P.js","assets/clock-3-DnrAnuyZ.js","assets/git-branch-Dh9uxTot.js","assets/message-circle-Badhj-4D.js","assets/message-square-fVE7Ghj1.js","assets/plug-DKYPEgkR.js","assets/settings-2-D-csvaET.js","assets/terminal-oKqqZdiG.js","assets/zap-dximCGjy.js","assets/cn-0WouolD0.js","assets/bundle-mjs-rHxsej31.js","assets/schemas-CCWMleym.js","assets/archive-Dz0hferG.js","assets/popover-select-CEMWIrtY.js","assets/check-DUBLcKHA.js","assets/skeleton-BI5TyibZ.js","assets/dist-GJ8-1PAx.js","assets/dist-BuHnPloF.js","assets/floating-ui.dom-seOukHzT.js","assets/settings-shell-dialog-layer-BU3UuiJr.js","assets/circle-BoO4YvTx.js","assets/coins-DjP27vUx.js","assets/database-CjjeZfRG.js","assets/download-Dk-ZjtO6.js","assets/folder-open-CyzJ19I9.js","assets/layers-mJW7JJKm.js","assets/layout-grid-CEVZdVFU.js","assets/minimize-2-DtOGrlpo.js","assets/pin-off-BMRv-Kxr.js","assets/plus-Q2yW6OE7.js","assets/search-DA7gz22f.js","assets/settings-uiTATseT.js","assets/trash-2-DusmjVPV.js","assets/x-B_N4OPjy.js","assets/session-api-DZ2Ov33K.js","assets/gateway-startup-retry-xpHdw5uq.js","assets/vendor-swr-CdRzEUwF.js","assets/gateway-config-swr-CtEdaxOS.js","assets/chat-agents-api-BrsUEl3u.js","assets/registry-api-B3YqZBhQ.js","assets/button-Cc4hUNTt.js","assets/interaction-BdhHBbYa.js","assets/form-field-width-DJw_jULe.js","assets/page-tabs-oeTY7z3_.js","assets/sliding-indicator-hwz0sx3h.js","assets/agent-avatar-display-B_QEDfMT.js","assets/loopi-CNtmi9FU.js","assets/loopi-C09I2mNj.css","assets/sliding-tab-list-DuQyViqe.js","assets/settings-form-draft-Dy10ldo8.js","assets/model-selector-VVkCmNdS.js","assets/open-capability-settings-Cvb65hQB.js","assets/segmented-styles-Cqb91xsn.js","assets/settings-advanced-section-TJ8MAroB.js","assets/settings-mode-store-xhm6JIs-.js","assets/middleware-Pd0e8Igk.js","assets/number-input-El7Szeln.js","assets/settings-page-header-BEDxq_lT.js","assets/external-link-DjqjBmc3.js","assets/sparkles-DHlfQFAF.js","assets/settings-page-layout-BftgkTYo.js","assets/settings-form-section-num14vSv.js","assets/pencil-DmIY3Oa-.js","assets/use-autosave-CDy9yziL.js","assets/circle-alert-BEjgurr2.js","assets/loader-circle-CifKLtgG.js","assets/settings-advanced-gate-CGgt1myW.js","assets/usage-page-6LW4yLy1.js","assets/bot-DjLkhyZL.js","assets/gauge-C78eD2BA.js","assets/refresh-cw-BRlGaq2w.js","assets/timer-rCwGHjuO.js","assets/xopc-cloud-account-card-Csye7zKU.js","assets/cloud-C4-yfnnk.js","assets/triangle-alert-2JXFNNKU.js","assets/cloud-credits-B-nbtkqv.js","assets/automations-page-DDNx4Gn3.js","assets/automations-workspace-CtidgXTX.js","assets/activity-YogQEteU.js","assets/arrow-left-D880xG-P.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/automation-run-list-CnaV2j9R.js","assets/automation-api-CRz5EE_c.js","assets/markdown-view-usF9EoMp.js","assets/file-image-CDUPkZvG.js","assets/app-link-DRy3-k7j.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/api-C4xrqOKi.js","assets/tasks-DRmd6sWt.js","assets/specialists-xbB3xL9e.js","assets/files-BNL4kkSB.js","assets/session-manager-DSaoWM1F.js","assets/constants-DBtMsXdW.js","assets/local-session-drafts-hodTdtvj.js","assets/tool-activity-BtJkgjFf.js","assets/personal-proactivity-DaRnbB1f.js","assets/attachment-utils-core-BIOUBrpT.js","assets/gateway-realtime-SunJUMP3.js","assets/gateway-realtime-store-BywiC4CK.js","assets/agents-admin-api-DIStX2e1.js","assets/page-header-store-BVj8nDdi.js","assets/refresh-button-DiWdGAaX.js","assets/dist-ZrL34Ps4.js","assets/automation-task-card-DD4yjrI6.js","assets/date-picker-CBoc2ETg.js","assets/calendar-days-hw_Y-g-s.js","assets/chevron-left-DqFhpbvK.js","assets/agent-display-names-Bje7vfSn.js","assets/automation-result-state-D0EHDk4V.js","assets/browser-automation-inputs-C3gQlgox.js","assets/browser-automations-page-CsdyL6q5.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-Btwz8koK.js","assets/home-page-2Uj--v_o.js","assets/history-DXH_9jsE.js","assets/paperclip-f1HujQY1.js","assets/use-composer-attachments-C4eSyX-C.js","assets/file-BqMS_3DT.js","assets/use-file-preview-expanded-SFqd8k7K.js","assets/app-window-DXFNqt_0.js","assets/link-2-D_ZKYUW7.js","assets/message-square-plus-XP0tGdlV.js","assets/rotate-cw-LIg3Am9S.js","assets/save-DRDABU--.js","assets/activity-store-CXhhy7_9.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-S2aJOX7w.js","assets/mic-CuUb7zc-.js","assets/share-link-dialog-C-mhzvLF.js","assets/globe-DSSGFWFn.js","assets/copy-text-row-CpiRzq4G.js","assets/capabilities-C4F2D1gH.js","assets/capabilities-f0YyWX04.js","assets/file-preview-surface-CEDfehx5.js","assets/phone-workspace-store-CpH233TG.js","assets/shares-api-D2HTaQZH.js","assets/skill-wire-pattern-BPpeIcCi.js","assets/composer-payload-handoff-BBm3ypBb.js","assets/rotate-ccw-JM1TBLpp.js","assets/voice-transcribe-api-CVVa_x99.js","assets/workspace-editor-agent-store-oZKoWMdV.js","assets/voice-input-shortcut-events-3kcfHPrY.js","assets/date-formatters-DukWSVwc.js","assets/tab-completion-input-CxtEp0aP.js","assets/task-result-evidence-CkwEM0In.js","assets/file-text-D12HbeVy.js","assets/task-detail-page-1AFyRTia.js","assets/chat-page-dh7ImvX8.js","assets/arrow-up-D5ZtR1QT.js","assets/product-automation-feedback-BVkkAJkY.js","assets/notes-api-DflS6I2c.js","assets/chat-chart-block-Cq3aoRzV.js","assets/volume-2-BSJhAY97.js","assets/book-open-CCGtrT3R.js","assets/working-directory-picker-modal-BiDK93J_.js","assets/file-archive-DanfQJNe.js","assets/new-chat-navigation-B6NPQ4h4.js","assets/circle-x-DFsCKeya.js","assets/file-tree-utils-DJs1faGv.js","assets/folder-kanban-CpLlFI1o.js","assets/folder-CN-pC3XL.js","assets/key-round-DWbpyU2U.js","assets/laptop-CI3hBVrl.js","assets/list-checks-BbsExAoq.js","assets/list-todo-CTVRto8O.js","assets/messages-square-BckAJrEW.js","assets/monitor-Af5eAvF7.js","assets/install-connector-dialog-Fctw32Lx.js","assets/secret-input-Dryrns2s.js","assets/is-masked-secret-DOkL5b_X.js","assets/connectors-api-Now9xXuA.js","assets/oauth-provider-connect-BjLEJ4az.js","assets/models-hub-cache-BfrcizHv.js","assets/oauth-api-CZiot_FY.js","assets/connection-usage-guide-BgvvHMc4.js","assets/arrow-up-right-T72JbQ1Q.js","assets/connection-usage-Cm_McddI.js","assets/smartphone-DSSsQFqA.js","assets/wrench-DFb4r8bH.js","assets/new-session-preferences-gb411vZP.js","assets/extension-provider-KmpUveDY.js","assets/theme-store-BZ8YC33M.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-D7dQJytv.js","assets/command-palette-api-BEqdX7Q-.js","assets/skill-list-api-LoIlcCDf.js","assets/skill-api-utils-C7V4JVXM.js","assets/dev-view-store-BXMp1Npf.js","assets/extension-iframe-host-ClbrQvGF.js","assets/api-bT-kA268.js","assets/runtime-health-D2TDFLLq.js","assets/terminal-panel-store-BP3dN3md.js","assets/agents-app-path-ciChvpCS.js","assets/use-media-query-ady-FgjK.js","assets/oauth-authorization-window-o6URRos4.js","assets/page-context-draft-DRE6i2wO.js","assets/side-chat-shortcut-BIw-1TTD.js","assets/chat-page-zQeUaawJ.css","assets/page-context-capture-button-C3okR3ap.js","assets/dependency-picker-XjPB8FJS.js","assets/projects-page-D65pw44g.js","assets/arrow-right-DSSvoX71.js","assets/project-understanding-tqZ0etEw.js","assets/project-detail-page-B7L3Kvhc.js","assets/resource-unavailable-DH-GGLSM.js","assets/discussion-annotation-sync-D_NJLur2.js","assets/workspace-open-location-menu-BNjipenH.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-B9f3GN7l.js","assets/with-selector-xonYxPoM.js","assets/directory-picker-path-field-P_-tLtwi.js","assets/skill-api-DOISy5q8.js","assets/skill-reload-api-qSwB_mAH.js","assets/note-detail-panel-vvlPKLHz.js","assets/code-xml-DJtYhZUF.js","assets/note-image-lightbox-BDZGHYaZ.js","assets/project-detail-page-DLioOiRN.css","assets/notes-page-DKPHaszO.js","assets/recording-upload-Id3p5Vyv.js","assets/star-BUWJqJ5c.js","assets/capabilities-page-CJm5gNu8.js","assets/product-navigation-Co8pLbDP.js","assets/capability-links-DeO34GIF.js","assets/capability-header-actions-BxMYfQ8y.js","assets/user-model-page-DYVp7nA6.js","assets/understanding-refresh-store-BBXlbRLa.js","assets/briefcase-business-BsoCaI_t.js","assets/understanding-activity-store-3sOhoxX4.js","assets/sliders-horizontal-DqsYor6I.js","assets/logs-page-CcM2foZi.js","assets/clipboard-copy-DuJk5WD6.js","assets/settings-page-B_XKKvWr.js","assets/browser-settings-page-B-ks3b8r.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-DWUZuu3k.js","assets/beta-badge-BnzdzIEl.js","assets/global-defaults-api-C-ogBDn1.js","assets/phone-model-picker-wK2tRuj0.js","assets/phone-dependencies-card-B_l_JCRy.js","assets/runtime-tools-api-8mXDTzc2.js","assets/phone-model-connection-DmYRqxCF.js","assets/providers-api-DzeStdCu.js","assets/mobile-pair-qr-CuIbmw5x.js","assets/browser-BLJWD7WI.js","assets/computer-settings-page-DUhsxs4l.js","assets/mouse-pointer-2-DZ51Onvj.js","assets/extension-page-C6qZ9pGs.js","assets/extension-settings-page-DWKB4ETv.js","assets/voice-config-api-DNxzs-eF.js","assets/voice-api-key-field-BKXWXCit.js","assets/schema-form-C-jw6Hid.js","assets/secret-input-labels-B5Jl5HqK.js","assets/extension-debug-page-CE9KJpjL.js","assets/share-preview-page-Cnxfv66F.js","assets/local-apps-page-Bj-nywIv.js","assets/box-DvYoGszj.js","assets/local-app-workbench-page-hJzkUVoK.js","assets/power-off-CwwQ7Gp7.js","assets/power-ZI-pBczI.js","assets/product-open-page-D-fwzOTB.js","assets/open-route-MyZ2sB9C.js","assets/work-discovery-page-BuKTCGSR.js","assets/service-recommendation-list-DFqBz8S6.js","assets/package-wATCyihJ.js","assets/agent-plugin-dialog-lCWIS06R.js","assets/capability-icon-DVoZxEgW.js","assets/extension-marketplace-api-BNNQYLeu.js","assets/work-discovery-overlay-B4F3MACu.js","assets/brand-logo-CgT9zQfr.js","assets/setup-status-panel-DehYof2V.js","assets/stethoscope-DRqTAtjD.js","assets/appearance-settings-DTj1XI4v.js","assets/preference-select-fields-DPXt3YyQ.js","assets/keyboard-shortcuts-settings-DFBpeaA_.js","assets/personal-settings-panel-BilBWHZ1.js","assets/use-personal-profile-sQzaa6Dy.js","assets/system-settings-panel-BT6_yFco.js","assets/browser-notification-delivery-DmE2FgGc.js","assets/shield-B1sI_cxl.js","assets/desktop-pet-settings-CzGc9byI.js","assets/wand-sparkles-CkSL-3Fy.js","assets/desktop-pet-sprite-D5YYq2zC.js","assets/desktop-pet-sprite-BuB0g8zv.css","assets/app-management-settings-panel-Dk75Bmi2.js","assets/capabilities-settings-panel-BMg8DBa0.js","assets/connected-providers-grid-BsCLGLnw.js","assets/navigation-D62kPsA9.js","assets/image-generation-api-DFGE3Ait.js","assets/gateway-settings-DWVxjM9y.js","assets/network-BUQLY1BV.js","assets/gateway-restart-srJ9TMC5.js","assets/runtime-tools-settings-panel-S2HxRVlT.js","assets/remote-access-hub-DxAInmWy.js","assets/server-BlHCBjiE.js","assets/tunnel-api-CnPOg1pg.js","assets/shares-settings-BLcnCGon.js","assets/use-workspace-tree-DKPvcyw1.js","assets/agent-defaults-settings-panel-DWIluCZB.js","assets/management-settings-gwDIT7mY.js","assets/shield-off-2jsucUds.js","assets/device-pairing-wizard--SCayxiS.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-BpUbNplq.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78])),n=()=>e(()=>import(`./usage-page-6LW4yLy1.js`),__vite__mapDeps([79,1,2,3,4,5,6,80,11,25,26,21,22,27,28,8,9,29,30,31,76,33,34,81,82,83,48,52,60,56,69,70,71,72,84,85,86,87,23])),r=()=>e(()=>import(`./automations-page-DDNx4Gn3.js`),__vite__mapDeps([88,2,1,89,4,3,5,6,7,8,9,90,11,91,92,26,93,94,25,21,22,27,28,29,30,31,76,95,96,97,98,14,99,100,48,101,102,35,103,41,45,104,105,23,106,107,108,109,110,15,111,74,112,82,42,113,71,114,44,20,115,116,117,118,46,47,119,120,121,122,123,124,125,126,51,127,49,50,52,128,60,56,129,130,62,18,63,53,54,131,13,132,133,134,135,136,137])),i=()=>e(()=>import(`./browser-automations-page-CsdyL6q5.js`),__vite__mapDeps([138,1,2,3,4,5,6,80,11,25,26,21,22,27,28,8,9,29,30,31,139,140,13,141,77,74,112,142,143,44,45,52,128,144,137])),a=()=>e(()=>import(`./home-page-2Uj--v_o.js`),__vite__mapDeps([145,1,2,4,3,5,6,7,8,9,92,11,93,94,76,95,13,70,146,102,35,103,41,45,21,22,104,105,23,106,107,108,109,110,15,147,82,18,71,27,116,117,148,134,149,150,151,26,96,97,98,36,152,77,153,39,74,154,155,42,120,46,47,124,53,156,157,158,159,60,56,160,161,118,130,29,30,162,163,25,28,31,164,52,165,166,121,167,168,169,170,171,172,173,174,119,122,123,125,126,51,127,49,48,67,63,175,176,128,177,178,179,180])),o=()=>e(()=>import(`./task-detail-page-1AFyRTia.js`),__vite__mapDeps([181,1,2,3,4,5,6,7,8,9,182,11,151,24,91,183,184,90,80,95,139,13,70,185,102,35,103,41,45,21,22,104,105,23,106,107,108,109,110,186,26,96,27,77,16,111,112,173,154,71,86,187,20,48,52,101,188,93,94,189,190,53,54,61,25,28,29,30,31,76,191,192,32,193,34,141,97,149,180,194,36,195,150,98,152,153,39,147,74,82,155,42,120,46,47,124,156,157,158,159,60,56,160,161,118,130,14,164,146,196,197,198,199,200,162,201,202,203,204,205,49,206,85,207,51,208,209,210,211,18,43,113,212,143,44,163,165,213,116,117,115,119,121,122,123,125,126,127,214,215,166,216,67,148,134,167,168,169,170,171,50,172,174,63,175,176,217,218,219,128,58,59,57,220,221,222,223,224,62,225,226,131,92,15,132,133,227,228,229,230,135,231,232,233,234,235,177,179,236,237])),s=()=>e(()=>import(`./projects-page-D65pw44g.js`),__vite__mapDeps([238,1,2,3,4,5,6,7,8,9,24,11,239,189,190,77,21,22,52,53,54,61,25,26,27,28,29,30,31,194,36,40,41,173,42,45,115,23,116,117,118,128,240,48,220,177])),c=()=>e(()=>import(`./project-detail-page-B7L3Kvhc.js`),__vite__mapDeps([241,1,2,3,4,5,6,242,7,8,9,24,11,243,93,52,21,22,91,239,184,90,80,95,139,13,70,185,102,35,103,41,45,104,105,23,106,107,108,109,110,186,26,96,27,77,16,111,112,173,154,71,86,187,20,48,101,92,134,94,189,190,53,54,61,25,28,29,30,31,76,191,32,193,244,36,150,151,97,98,152,153,39,147,74,82,155,42,120,46,47,124,156,157,158,159,60,56,160,161,118,130,245,149,180,195,14,146,246,38,198,247,162,248,40,43,113,143,249,250,44,251,252,116,117,115,148,163,164,165,166,121,167,168,169,170,171,127,49,55,128,240,221,129,253,216,67,222,223,224,132,133,135,254,75,177,255,220,256,257,89,99,100,15,114,119,122,123,125,126,51,50,62,18,63,131,136,137,236,233,258,259,206,85,207,208,260,237,261])),l=()=>e(()=>import(`./notes-page-DKPHaszO.js`),__vite__mapDeps([262,1,2,3,4,5,6,24,11,243,93,52,9,21,22,91,239,183,184,90,80,95,139,13,70,185,7,8,102,35,103,41,45,104,105,23,106,107,108,109,110,186,26,96,27,77,16,111,112,173,154,71,86,187,20,48,101,133,25,28,29,30,31,97,180,195,263,162,147,42,264,44,251,157,128,60,56,160,221,130,258,259,98,146,15,74,82,114,143,119,120,46,47,121,122,123,124,125,126,51,127,49,216,67,170,206,85,158,207,208,233,260,236,167,166,116,117])),u=()=>e(()=>import(`./capabilities-page-CJm5gNu8.js`),__vite__mapDeps([265,1,2,4,3,5,6,27,21,22,266,128,267,211,268,42,11,52,9,28,8,29,30,231])),d=()=>e(()=>import(`./user-model-page-DYVp7nA6.js`),__vite__mapDeps([269,1,2,3,4,5,6,7,8,9,188,11,80,270,48,271,133,26,93,94,25,21,22,27,28,29,30,31,76,95,13,34,35,141,97,272,36,14,199,77,247,15,74,41,82,42,113,273,71,249,44,251,252,45,52,157,55,53,56,128,58,59,60,130,132,134])),f=()=>e(()=>import(`./logs-page-CcM2foZi.js`),__vite__mapDeps([274,1,2,3,4,5,6,7,8,9,93,11,25,26,21,22,27,28,29,30,31,275,35,180,195,81,99,82,42,19,45,46,23,47,125,126,52,107,54,56,129,64,69,70,71,72])),p=()=>e(()=>import(`./settings-page-B_XKKvWr.js`),__vite__mapDeps([276,1,2,3,4,5,6])),m=()=>e(()=>import(`./browser-settings-page-B-ks3b8r.js`),__vite__mapDeps([277,1,2,3,4,5,6,93,11,25,26,21,22,27,28,8,9,29,30,31,95,278,35,70,98,36,81,164,279,77,247,280,82,18,86,48,49,52,61,281,68,69,71,72,75,76,144])),h=()=>e(()=>import(`./phone-settings-page-DWUZuu3k.js`),__vite__mapDeps([282,1,2,3,4,5,6,7,8,9,151,11,93,25,26,21,22,27,28,29,30,31,283,112,41,82,42,113,212,45,48,52,169,130,284,49,69,70,71,285,286,95,35,213,287,288,91,63,289,51,47,204,207,290,291])),g=()=>e(()=>import(`./computer-settings-page-DUhsxs4l.js`),__vite__mapDeps([292,1,2,3,4,5,6,26,11,164,201,293,41,113,143,27,21,22,48,49,51,47,52,9,158,62,25,28,8,29,30,31,18,63,53,54,284,69,70,71,72])),_=()=>e(()=>import(`./extension-page-C6qZ9pGs.js`),__vite__mapDeps([294,1,2,3,4,242,5,6,215,23,119,120,46,47,121,122,123,124,125,126,51,127,49,48,166,116,117,106,156,216,67,128,226,7,8,9,61])),v=()=>e(()=>import(`./extension-settings-page-DWKB4ETv.js`),__vite__mapDeps([295,1,2,3,4,5,6,242,25,11,26,21,22,27,28,8,9,29,30,31,215,23,119,120,46,47,121,122,123,124,125,126,51,127,49,48,166,116,117,106,156,216,67,52,54,226,7,61,281,69,70,71,72,75,76,77,296,297,203,95,96,98,107,53,204,298,299,68])),y=()=>e(()=>import(`./extension-debug-page-CE9KJpjL.js`),__vite__mapDeps([300,1,2,5,6,215,23,119,120,46,47,121,122,123,124,125,126,51,4,127,49,48,166,116,117,106,156,216,67,69,3,70,11,71,21,22,52,9,72])),b=()=>e(()=>import(`./share-preview-page-Cnxfv66F.js`),__vite__mapDeps([301,1,2,4,3,5,6,150,11,151,26,93,96,35,97,70,98,36,152,77,102,7,8,9,103,41,45,21,22,104,105,23,106,107,108,109,110,153,39,147,74,82,154,155,42,27,120,46,47,124,53,156,157,158,159,60,56,160,161,118,130,29,30,52,186])),x=()=>e(()=>import(`./local-apps-page-Bj-nywIv.js`),__vite__mapDeps([302,1,2,3,4,5,6,239,11,303,41,27,21,22,48,52,9,128,227])),S=()=>e(()=>import(`./local-app-workbench-page-hJzkUVoK.js`),__vite__mapDeps([304,1,2,3,4,5,6,242,7,8,9,91,11,26,95,192,13,70,305,194,146,77,248,306,82,173,113,71,44,86,45,27,21,22,106,23,115,116,117,118,48,52,128,227,228,177,178,236,180,119,120,46,47,121,122,123,124,125,126,51,127,49,167,166,233])),C=()=>e(()=>import(`./product-open-page-D-fwzOTB.js`),__vite__mapDeps([307,2,1,3,4,5,6,27,21,22,105,23,106,48,227,308])),w=()=>e(()=>import(`./work-discovery-page-BuKTCGSR.js`).then(e=>e.n),__vite__mapDeps([309,1,2,3,4,5,6,11,310,93,189,7,8,9,190,77,21,22,52,53,54,61,202,25,26,27,28,29,30,31,95,70,203,96,98,107,204,45,205,49,48,158,206,85,207,51,47,208,209,210,71,211,311,41,312,91,76,32,36,113,251,267,291,313,314,133,94,13,34,272,180,14,199,200,280,58,59,220])),T=()=>e(()=>import(`./work-discovery-overlay-B4F3MACu.js`),__vite__mapDeps([315,1,2,5,6,7,8,9,309,3,4,11,310,93,189,190,77,21,22,52,53,54,61,202,25,26,27,28,29,30,31,95,70,203,96,98,107,204,45,205,49,48,158,206,85,207,51,47,208,209,210,71,211,311,41,312,91,76,32,36,113,251,267,291,313,314,133,94,13,34,272,180,14,199,200,280,58,59,220,316])),E=()=>e(()=>import(`./setup-status-panel-DehYof2V.js`),__vite__mapDeps([317,1,2,3,4,5,6,90,11,94,95,192,32,279,77,82,318,86,21,22,27,48,49,126,51,47,52,9,53,204,158,223,224,281,289,207,69,70,71,72,73,74,78,66,67,287])),D=()=>e(()=>import(`./appearance-settings-DTj1XI4v.js`),__vite__mapDeps([319,1,2,5,6,25,11,26,21,22,27,28,8,9,29,30,31,49,48,53,320,67,54,216,225,69,3,4,70,71,52,72,78,66])),O=()=>e(()=>import(`./keyboard-shortcuts-settings-DFBpeaA_.js`),__vite__mapDeps([321,1,2,5,6,21,22,158,176,67,234,69,3,4,70,11,71,52,9,72])),k=()=>e(()=>import(`./personal-settings-panel-BilBWHZ1.js`),__vite__mapDeps([322,1,2,5,6,25,11,26,21,22,27,28,8,9,29,30,31,123,23,323,48,69,3,4,70,71,52,72])),A=()=>e(()=>import(`./system-settings-panel-BT6_yFco.js`),__vite__mapDeps([324,1,2,5,6,325,11,158,70,82,326,21,22,53,61,69,3,4,71,52,9,72,73,74])),j=()=>e(()=>import(`./desktop-pet-settings-CzGc9byI.js`),__vite__mapDeps([327,1,2,3,4,5,6,242,93,11,25,26,21,22,27,28,8,9,29,30,31,76,70,153,328,173,53,158,129,82,52,329,330,69,71,72])),M=()=>e(()=>import(`./app-management-settings-panel-Dk75Bmi2.js`),__vite__mapDeps([331,1,2,5,6,7,8,9,96,11,77,311,21,22,27,48,52,31,107,53,158,61,281,69,3,4,70,71,72,73,74])),N=()=>e(()=>import(`./capabilities-settings-panel-BMg8DBa0.js`),__vite__mapDeps([332,1,2,4,3,5,6,7,8,9,239,11,210,94,25,26,21,22,27,28,29,30,31,95,333,134,203,96,98,77,107,53,54,204,164,41,42,18,45,48,49,51,47,52,299,60,56,207,289,206,85,158,208,70,246,196,162,74,112,17,82,113,273,143,44,86,187,213,23,174,119,120,46,121,122,123,124,125,126,127,67,63,219,334,61,221,62,230,284,281,65,66,232,68,69,71,72,73,75,76,296,297,335,84,87])),P=()=>e(()=>import(`./gateway-settings-DWVxjM9y.js`),__vite__mapDeps([336,1,2,3,4,5,6,25,11,26,21,22,27,28,8,9,29,30,31,76,203,95,96,98,77,107,53,54,204,279,196,337,82,154,338,158,113,326,273,86,48,49,52,299,334,55,56,61,221,7,66,67,281,65,68,69,70,71,72,73,74,78])),F=()=>e(()=>import(`./runtime-tools-settings-panel-S2HxRVlT.js`),__vite__mapDeps([339,1,2,5,6,25,11,26,21,22,27,28,8,9,29,30,31,76,95,35,173,48,52,129,82,281,69,3,4,70,71,72,78,66,67,287,286,93,213])),I=()=>e(()=>import(`./remote-access-hub-DxAInmWy.js`),__vite__mapDeps([340,1,2,3,4,5,6,7,8,9,239,11,26,93,94,32,96,70,203,95,98,77,21,22,107,53,54,204,164,196,337,306,341,326,212,19,86,48,49,52,31,55,56,61,221,165,29,30,66,67,289,51,47,207,208,158,65,232,69,71,72,73,74,342,27,334,78])),L=()=>e(()=>import(`./shares-settings-BLcnCGon.js`),__vite__mapDeps([343,1,2,3,4,5,6,7,8,9,26,11,93,25,21,22,27,28,29,30,31,193,85,96,245,94,97,190,149,103,180,36,195,53,158,146,77,16,41,82,249,44,163,70,164,45,52,165,107,48,49,127,54,55,56,61,221,170,344,161,118,23,175,135,281,206,95,207,51,47,208,68,69,71,72,73,74])),R=()=>e(()=>import(`./agent-defaults-settings-panel-DWIluCZB.js`),__vite__mapDeps([345,1,2,3,4,5,6,95,11,81,198,142,42,113,273,21,22,27,87,23,48,52,9,158,60,56,223,224,66,67,284,49,65,68,69,70,71,72,75,26,76,77])),z=()=>e(()=>import(`./management-settings-gwDIT7mY.js`),__vite__mapDeps([346,1,2,3,4,5,6,7,8,9,90,11,134,94,25,26,21,22,27,28,29,30,31,197,347,41,42,212,45,46,23,47,48,52,55,53,56,160,221,129,82,281,69,70,71,72,348,95,13,35,349,104,105,106,159,165,96,107,208,158,232,342,164,77,306,49,54,334,73,74,290,291])),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-CAZaC05J.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-LhhHA2sK.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-CAZaC05J.js";import{t as a}from"./messages-C7fckbyG.js";import{n as o,r as s}from"./popover-select-CEMWIrtY.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{i as f}from"./vendor-swr-CdRzEUwF.js";import{t as p}from"./button-Cc4hUNTt.js";import{t as m}from"./refresh-button-DiWdGAaX.js";import{n as h}from"./settings-loading-skeleton-BTqvr_Fw.js";import{n as g,t as _}from"./settings-page-header-LuOJvqNa.js";import"./settings-page-layout-CduQ8w4a.js";import{t as v}from"./settings-advanced-gate-CZ4J3Kuy.js";import{i as y,n as b,r as x}from"./runtime-tools-api-D0Nrvuqv.js";import{t as S}from"./phone-dependencies-card-DYwnuVh3.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}=f(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)(p,{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)(p,{onClick:()=>void K(),disabled:N||V,children:N?e.pruning:e.prune}),(0,E.jsx)(p,{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],f=n===`uv`?k.uv:k[n],m=n===`uv`?t?.payload.config.uv:t?.payload.config[n],h=F[n]===!0,g=T(r,f.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:f.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:f.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)(p,{variant:`primary`,disabled:!k.enabled||!f.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)(p,{disabled:!k.enabled||!f.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-LhhHA2sK.js";import{t as a}from"./messages-C3xqMM9W.js";import{n as o,r as s}from"./popover-select-CEMWIrtY.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{i as f}from"./vendor-swr-CdRzEUwF.js";import{t as p}from"./button-Cc4hUNTt.js";import{t as m}from"./refresh-button-DiWdGAaX.js";import{n as h}from"./settings-loading-skeleton-BTqvr_Fw.js";import{n as g,t as _}from"./settings-page-header-BEDxq_lT.js";import"./settings-page-layout-BftgkTYo.js";import{t as v}from"./settings-advanced-gate-CGgt1myW.js";import{i as y,n as b,r as x}from"./runtime-tools-api-8mXDTzc2.js";import{t as S}from"./phone-dependencies-card-B_l_JCRy.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}=f(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)(p,{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)(p,{onClick:()=>void K(),disabled:N||V,children:N?e.pruning:e.prune}),(0,E.jsx)(p,{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],f=n===`uv`?k.uv:k[n],m=n===`uv`?t?.payload.config.uv:t?.payload.config[n],h=F[n]===!0,g=T(r,f.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:f.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:f.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)(p,{variant:`primary`,disabled:!k.enabled||!f.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)(p,{disabled:!k.enabled||!f.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-CAZaC05J.js";import{t as s}from"./messages-C7fckbyG.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-q39BUcJ6.js";import{t as u}from"./loader-circle-CifKLtgG.js";import{s as d,t as f}from"./install-connector-dialog-Bo06Ry3H.js";import{t as p}from"./package-wATCyihJ.js";import{t as m}from"./plus-Q2yW6OE7.js";import{t as h}from"./cn-0WouolD0.js";import{t as g}from"./skeleton-BI5TyibZ.js";import{i as _}from"./vendor-swr-CdRzEUwF.js";import{t as te}from"./button-Cc4hUNTt.js";import{a as v,i as y,o as b,s as x}from"./connectors-api-NcWECWKg.js";import{t as S}from"./agent-plugin-dialog-XN-tZ-Ox.js";import{t as C}from"./capability-icon-DVoZxEgW.js";import{t as w}from"./extension-marketplace-api-CZg8nBwW.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)(te,{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)(m,{className:`size-3.5`}),a?w?`管理`:`Manage`:o?w?`继续设置`:`Set up`:O.connect]});return(0,B.jsx)(`article`,{className:h(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?p: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?p: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)(f,{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-LhhHA2sK.js";import{t as s}from"./messages-C3xqMM9W.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-BiDK93J_.js";import{t as u}from"./loader-circle-CifKLtgG.js";import{s as d,t as f}from"./install-connector-dialog-Fctw32Lx.js";import{t as p}from"./package-wATCyihJ.js";import{t as m}from"./plus-Q2yW6OE7.js";import{t as h}from"./cn-0WouolD0.js";import{t as g}from"./skeleton-BI5TyibZ.js";import{i as _}from"./vendor-swr-CdRzEUwF.js";import{t as te}from"./button-Cc4hUNTt.js";import{a as v,i as y,o as b,s as x}from"./connectors-api-Now9xXuA.js";import{t as S}from"./agent-plugin-dialog-lCWIS06R.js";import{t as C}from"./capability-icon-DVoZxEgW.js";import{t as w}from"./extension-marketplace-api-BNNQYLeu.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)(te,{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)(m,{className:`size-3.5`}),a?w?`管理`:`Manage`:o?w?`继续设置`:`Set up`:O.connect]});return(0,B.jsx)(`article`,{className:h(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?p: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?p: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)(f,{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-CAZaC05J.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-PMJi5mX4.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.excludeAutomationRuns&&t.set(`excludeAutomationRuns`,`true`),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,excludeAutomationRuns:e.excludeAutomationRuns,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-LhhHA2sK.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-xpHdw5uq.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.excludeAutomationRuns&&t.set(`excludeAutomationRuns`,`true`),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,excludeAutomationRuns:e.excludeAutomationRuns,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-CAZaC05J.js";import{t as s}from"./messages-C7fckbyG.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{i as _,n as v}from"./constants-DBtMsXdW.js";import{_ as ee,b as y,g as b,h as x,m as S,s as C,v as w,y as T}from"./session-api-CHRP5Lwf.js";import{_ as E,a as D,b as O,c as te,d as ne,f as re,i as ie,l as k,o as ae,p as oe,r as se,s as ce,t as le,u as ue,v as de,y as fe}from"./local-session-drafts-jgw8UGsO.js";import{t as A}from"./tool-activity-BtJkgjFf.js";import{r as pe}from"./personal-proactivity-DaRnbB1f.js";import{t as me}from"./gateway-startup-retry-PMJi5mX4.js";import{a as he}from"./attachment-utils-core-BIOUBrpT.js";import{a as ge}from"./gateway-realtime-DwMd2PCt.js";import{n as _e}from"./registry-api-fLOqFyrz.js";import{a as ve}from"./agents-admin-api-B5lKH_ps.js";var ye=[0,500,1500],be=1e4;function xe(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 Se(e){return e===408||e===429||e>=500}var Ce=/^\[\d{4}-\d{2}-\d{2} \d{2}:\d{2}[^\]]*\]\s*/u,we=[`user-profile`,`active-focuses`,`collaboration-contract`,`user-context`];function Te(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 Ee(e){return Ce.test(e)||e.startsWith(`<source_contexts>`)||we.some(t=>e.startsWith(`<${t}>`))}function De(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 Oe(e){let t=e,n=Te(t.trimStart(),`xopc_task_execution`);n!==null&&Ee(n)&&(t=n),t=De(t);let r=t,i=!1;for(t=t.trimStart();;){let e=we.find(e=>t.startsWith(`<${e}>`));if(!e)break;let n=Te(t,e);if(n===null){t=r,i=!1;break}t=n,i=!0}return i&&!Ce.test(t)&&(t=r),t.replace(Ce,``)}function ke(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-LhhHA2sK.js";import{t as s}from"./messages-C3xqMM9W.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{i as _,n as v}from"./constants-DBtMsXdW.js";import{_ as ee,b as y,g as b,h as x,m as S,s as C,v as w,y as T}from"./session-api-DZ2Ov33K.js";import{_ as E,a as D,b as O,c as te,d as ne,f as re,i as ie,l as k,o as ae,p as oe,r as se,s as ce,t as le,u as ue,v as de,y as fe}from"./local-session-drafts-hodTdtvj.js";import{t as A}from"./tool-activity-BtJkgjFf.js";import{r as pe}from"./personal-proactivity-DaRnbB1f.js";import{t as me}from"./gateway-startup-retry-xpHdw5uq.js";import{a as he}from"./attachment-utils-core-BIOUBrpT.js";import{a as ge}from"./gateway-realtime-SunJUMP3.js";import{n as _e}from"./registry-api-B3YqZBhQ.js";import{a as ve}from"./agents-admin-api-DIStX2e1.js";var ye=[0,500,1500],be=1e4;function xe(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 Se(e){return e===408||e===429||e>=500}var Ce=/^\[\d{4}-\d{2}-\d{2} \d{2}:\d{2}[^\]]*\]\s*/u,we=[`user-profile`,`active-focuses`,`collaboration-contract`,`user-context`];function Te(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 Ee(e){return Ce.test(e)||e.startsWith(`<source_contexts>`)||we.some(t=>e.startsWith(`<${t}>`))}function De(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 Oe(e){let t=e,n=Te(t.trimStart(),`xopc_task_execution`);n!==null&&Ee(n)&&(t=n),t=De(t);let r=t,i=!1;for(t=t.trimStart();;){let e=we.find(e=>t.startsWith(`<${e}>`));if(!e)break;let n=Te(t,e);if(n===null){t=r,i=!1;break}t=n,i=!0}return i&&!Ce.test(t)&&(t=r),t.replace(Ce,``)}function ke(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 Ae=`@xopc-ref:`,je=`[A-Za-z0-9_-]{1,64}`,Me=RegExp(`${Ae}(${je})`,`g`);function Ne(e){if(!RegExp(`^${je}$`).test(e))throw Error(`Invalid context reference id`);return`${Ae}${e}`}function Pe(){return new RegExp(Me.source,`g`)}function Fe(e){let t=[],n=Pe(),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 Ie(e){return e.parts.flatMap(e=>e.type===`context_ref`?[e.refId]:[])}function Le(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 Re(e){return e.parts.map(e=>e.type===`text`?e.text:Ne(e.refId)).join(``)}function ze(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(`^${je}$`).test(t.refId)})}var Be=8e3,Ve=u({schemaVersion:f([l(1),l(2)]).optional(),questions:fe.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()}),He=u({schemaVersion:f([l(1),l(2)]).optional(),answers:de.optional(),response:u({choiceId:m().min(1).max(160).optional(),text:m().trim().max(Be).optional()}).strict().optional(),decision:h([`approve`,`deny`]).optional()}).strict();He.extend({action:h([`answer`,`agent_decide`,`cancel`]),expectedVersion:g().int().positive(),idempotencyKey:m().trim().min(1).max(256)}).strict();function Ue(e){let t=Ve.safeParse(e);return t.success?t.data:{}}function We(e,t){let n=He.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,...O(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 Ge=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:v,text:m().optional(),createdAt:g()});function Ke(e){let t=Ge.safeParse(e);return t.success?t.data:void 0}var qe=[`## 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
  `),Je=`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 Ye(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-CAZaC05J.js";import{t as l}from"./messages-C7fckbyG.js";import{a as u,n as d,o as f,r as p,s as m,t as h}from"./dist-BGTk37IG.js";import{n as g,r as _,t as v}from"./session-identity-label-BP7OIYth.js";import{t as y}from"./archive-Dz0hferG.js";import{n as b,r as x}from"./popover-select-CEMWIrtY.js";import{t as S}from"./circle-BoO4YvTx.js";import{t as C}from"./coins-DjP27vUx.js";import{t as ee}from"./database-CjjeZfRG.js";import{t as w}from"./download-Dk-ZjtO6.js";import{t as T}from"./folder-open-CyzJ19I9.js";import{t as E}from"./layers-mJW7JJKm.js";import{t as D}from"./layout-grid-CEVZdVFU.js";import{t as O}from"./message-square-fVE7Ghj1.js";import{t as k}from"./minimize-2-DtOGrlpo.js";import{t as A}from"./session-channel-icon-D1ktvt1P.js";import{n as j,t as M}from"./pin-off-BMRv-Kxr.js";import{t as N}from"./plus-Q2yW6OE7.js";import{t as P}from"./search-DA7gz22f.js";import{t as F}from"./settings-uiTATseT.js";import{t as I}from"./trash-2-DusmjVPV.js";import{t as te}from"./x-B_N4OPjy.js";import{t as L}from"./cn-0WouolD0.js";import{t as R}from"./skeleton-BI5TyibZ.js";import{a as z,c as B,f as V,n as ne,o as re,p as ie,r as ae,s as oe,t as se}from"./session-api-CHRP5Lwf.js";import{i as ce}from"./vendor-swr-CdRzEUwF.js";import{n as H,r as le}from"./gateway-config-swr-Cq-ByXL4.js";import{t as ue}from"./chat-agents-api-BUi_7GRo.js";import{n as de,t as U}from"./registry-api-fLOqFyrz.js";import{t as W}from"./button-Cc4hUNTt.js";import{i as fe,o as pe}from"./settings-shell-dialog-layer-BU3UuiJr.js";import{n as G,t as me}from"./interaction-BdhHBbYa.js";import{s as K}from"./form-field-width-DJw_jULe.js";import{t as he}from"./page-tabs-oeTY7z3_.js";import{t as ge}from"./agent-avatar-display-ByzM7u9S.js";import{t as _e}from"./sliding-tab-list-DuQyViqe.js";import{n as ve,r as ye,t as q}from"./settings-form-draft-Dy10ldo8.js";import{n as be}from"./model-selector-raBRBkN_.js";import{n as xe,r as Se}from"./segmented-styles-Cqb91xsn.js";import{t as J}from"./settings-advanced-section-D-llwfSj.js";import{t as Y}from"./number-input-El7Szeln.js";import{n as Ce,t as we}from"./settings-page-header-LuOJvqNa.js";import"./settings-page-layout-CduQ8w4a.js";import{n as Te,t as X}from"./settings-form-section-num14vSv.js";import{n as Ee,t as De}from"./use-autosave-BVYS8UoK.js";import{t as Oe}from"./settings-advanced-gate-CZ4J3Kuy.js";var Z=e(t(),1),ke=n(),Q=r();function Ae(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 je(e,t){return new Intl.NumberFormat(t===`zh`?`zh-CN`:`en-US`).format(e)}function Me(e){return`$${Number(e).toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:6})}`}function Ne(e){let t=(0,ke.c)(124),{session:n,variant:r,labels:i,sessionAgentId:a,sessionAgentAvatar:o,onOpen:c,onAction:u}=e,d;t[0]!==i.unnamedSession||t[1]!==n.name?(d=n.name?.trim()||i.unnamedSession,t[0]=i.unnamedSession,t[1]=n.name,t[2]=d):d=t[2];let f=d,p=s(Le),m;t[3]!==p||t[4]!==n?(m=v(n,l(p).sidebar.sessionFilters),t[3]=p,t[4]=n,t[5]=m):m=t[5];let h=m,g;t[6]===n.name?g=t[7]:(g=n.name?.trim(),t[6]=n.name,t[7]=g);let b=!!g,x=n.status===`archived`,S=n.status===`pinned`,T=n.usage,E;t[8]!==i.costUnknown||t[9]!==i.noUsage||t[10]!==T?(E=T?.calls?T.costCompleteness===`unknown`?i.costUnknown:`${T.costCompleteness===`partial`?`≥ `:`≈ `}${Me(T.knownCostUsd)}`:i.noUsage,t[8]=i.costUnknown,t[9]=i.noUsage,t[10]=T,t[11]=E):E=t[11];let D=E,k=T?.calls?T.costCompleteness===`partial`?i.costPartial:T.costCompleteness===`unknown`?i.costUnknown:i.cost:i.noUsage,N=r===`list`&&`sm:flex-row sm:items-center sm:gap-4`,P;t[12]===N?P=t[13]:(P=L(`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`,N),t[12]=N,t[13]=P);let F;t[14]===c?F=t[15]:(F=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),c())},t[14]=c,t[15]=F);let te=r===`list`&&`sm:py-3`,R;t[16]===te?R=t[17]:(R=L(`flex min-w-0 items-start justify-between gap-2 bg-surface-hover/35 px-3 py-2 dark:bg-surface-hover/25`,te),t[16]=te,t[17]=R);let z;t[18]===n?z=t[19]:(z=(0,Q.jsx)(A,{sourceChannel:n.sourceChannel,session:n,className:`size-3.5`}),t[18]=n,t[19]=z);let B;t[20]===h?B=t[21]:(B=(0,Q.jsx)(`span`,{className:`truncate text-[11px] font-medium uppercase tracking-wide text-fg-subtle`,children:h}),t[20]=h,t[21]=B);let V;t[22]!==z||t[23]!==B?(V=(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[z,B]}),t[22]=z,t[23]=B,t[24]=V):V=t[24];let ne;t[25]===S?ne=t[26]:(ne=S?(0,Q.jsx)(j,{className:`size-3.5 text-accent-fg`,strokeWidth:1.75,"aria-hidden":!0}):null,t[25]=S,t[26]=ne);let re;t[27]===n.updatedAt?re=t[28]:(re=Ae(n.updatedAt),t[27]=n.updatedAt,t[28]=re);let ie;t[29]===re?ie=t[30]:(ie=(0,Q.jsx)(`span`,{children:re}),t[29]=re,t[30]=ie);let ae;t[31]!==ne||t[32]!==ie?(ae=(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5 text-xs text-fg-muted`,children:[ne,ie]}),t[31]=ne,t[32]=ie,t[33]=ae):ae=t[33];let oe;t[34]!==V||t[35]!==ae||t[36]!==R?(oe=(0,Q.jsxs)(`div`,{className:R,children:[V,ae]}),t[34]=V,t[35]=ae,t[36]=R,t[37]=oe):oe=t[37];let se=r===`list`&&`sm:py-3`,ce;t[38]===se?ce=t[39]:(ce=L(`min-w-0 flex-1 px-3 py-2`,se),t[38]=se,t[39]=ce);let H=r===`list`&&`sm:items-start`,le;t[40]===H?le=t[41]:(le=L(`flex gap-3`,H),t[40]=H,t[41]=le);let ue;t[42]!==o||t[43]!==a?(ue=(0,Q.jsx)(ge,{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]=ue):ue=t[44];let de;t[45]===f?de=t[46]:(de=(0,Q.jsx)(`div`,{className:`min-w-0 max-w-full truncate text-sm font-semibold text-fg`,title:f,children:f}),t[45]=f,t[46]=de);let U;t[47]!==n.key||t[48]!==b?(U=b?(0,Q.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]=b,t[49]=U):U=t[49];let W;t[50]!==de||t[51]!==U?(W=(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[de,U]}),t[50]=de,t[51]=U,t[52]=W):W=t[52];let fe;t[53]!==le||t[54]!==ue||t[55]!==W?(fe=(0,Q.jsxs)(`div`,{className:le,children:[ue,W]}),t[53]=le,t[54]=ue,t[55]=W,t[56]=fe):fe=t[56];let pe;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(pe=(0,Q.jsx)(O,{className:`size-3.5`,strokeWidth:1.75,"aria-hidden":!0}),t[57]=pe):pe=t[57];let G;t[58]===n.messageCount?G=t[59]:(G=(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[pe,n.messageCount]}),t[58]=n.messageCount,t[59]=G);let K;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,Q.jsx)(ee,{className:`size-3.5`,strokeWidth:1.75,"aria-hidden":!0}),t[60]=K):K=t[60];let he=T?.totalTokens??0,_e;t[61]!==p||t[62]!==he?(_e=je(he,p),t[61]=p,t[62]=he,t[63]=_e):_e=t[63];let ve;t[64]!==i.tokens||t[65]!==_e?(ve=(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[K,_e,` `,i.tokens]}),t[64]=i.tokens,t[65]=_e,t[66]=ve):ve=t[66];let ye;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(ye=(0,Q.jsx)(C,{className:`size-3.5`,strokeWidth:1.75,"aria-hidden":!0}),t[67]=ye):ye=t[67];let q;t[68]!==D||t[69]!==k?(q=(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1`,title:k,children:[ye,D]}),t[68]=D,t[69]=k,t[70]=q):q=t[70];let be;t[71]!==G||t[72]!==ve||t[73]!==q?(be=(0,Q.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-3 text-xs text-fg-muted`,children:[G,ve,q]}),t[71]=G,t[72]=ve,t[73]=q,t[74]=be):be=t[74];let xe;t[75]===n.tags?xe=t[76]:(xe=n.tags.length>0?(0,Q.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1`,children:[n.tags.slice(0,3).map(Ie),n.tags.length>3?(0,Q.jsxs)(`span`,{className:`text-[11px] text-fg-disabled`,children:[`+`,n.tags.length-3]}):null]}):null,t[75]=n.tags,t[76]=xe);let Se;t[77]!==ce||t[78]!==fe||t[79]!==be||t[80]!==xe?(Se=(0,Q.jsxs)(`div`,{className:ce,children:[fe,be,xe]}),t[77]=ce,t[78]=fe,t[79]=be,t[80]=xe,t[81]=Se):Se=t[81];let J;t[82]===u?J=t[83]:(J=()=>u(`continue`),t[82]=u,t[83]=J);let Y;t[84]===Symbol.for(`react.memo_cache_sentinel`)?(Y=(0,Q.jsx)(O,{className:`size-4`,strokeWidth:1.75}),t[84]=Y):Y=t[84];let Ce;t[85]!==i.continueChat||t[86]!==J?(Ce=(0,Q.jsx)(`button`,{type:`button`,className:me,title:i.continueChat,"aria-label":i.continueChat,onClick:J,children:Y}),t[85]=i.continueChat,t[86]=J,t[87]=Ce):Ce=t[87];let we;t[88]!==x||t[89]!==i.archive||t[90]!==i.unarchive||t[91]!==u?(we=x?(0,Q.jsx)(`button`,{type:`button`,className:me,title:i.unarchive,"aria-label":i.unarchive,onClick:()=>u(`unarchive`),children:(0,Q.jsx)(_,{className:`size-4`,strokeWidth:1.75})}):(0,Q.jsx)(`button`,{type:`button`,className:me,title:i.archive,"aria-label":i.archive,onClick:()=>u(`archive`),children:(0,Q.jsx)(y,{className:`size-4`,strokeWidth:1.75})}),t[88]=x,t[89]=i.archive,t[90]=i.unarchive,t[91]=u,t[92]=we):we=t[92];let Te;t[93]!==S||t[94]!==i.pin||t[95]!==i.unpin||t[96]!==u?(Te=S?(0,Q.jsx)(`button`,{type:`button`,className:me,title:i.unpin,"aria-label":i.unpin,onClick:()=>u(`unpin`),children:(0,Q.jsx)(M,{className:`size-4`,strokeWidth:1.75})}):(0,Q.jsx)(`button`,{type:`button`,className:me,title:i.pin,"aria-label":i.pin,onClick:()=>u(`pin`),children:(0,Q.jsx)(j,{className:`size-4`,strokeWidth:1.75})}),t[93]=S,t[94]=i.pin,t[95]=i.unpin,t[96]=u,t[97]=Te):Te=t[97];let X;t[98]===u?X=t[99]:(X=()=>u(`export`),t[98]=u,t[99]=X);let Ee;t[100]===Symbol.for(`react.memo_cache_sentinel`)?(Ee=(0,Q.jsx)(w,{className:`size-4`,strokeWidth:1.75}),t[100]=Ee):Ee=t[100];let De;t[101]!==i.export||t[102]!==X?(De=(0,Q.jsx)(`button`,{type:`button`,className:me,title:i.export,"aria-label":i.export,onClick:X,children:Ee}),t[101]=i.export,t[102]=X,t[103]=De):De=t[103];let Oe;t[104]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=L(me,`text-red-600 hover:bg-red-50 dark:text-red-400 dark:hover:bg-red-950/40`),t[104]=Oe):Oe=t[104];let Z;t[105]===u?Z=t[106]:(Z=()=>u(`delete`),t[105]=u,t[106]=Z);let Ne;t[107]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=(0,Q.jsx)(I,{className:`size-4`,strokeWidth:1.75}),t[107]=Ne):Ne=t[107];let Re;t[108]!==i.delete||t[109]!==Z?(Re=(0,Q.jsx)(`button`,{type:`button`,className:Oe,title:i.delete,"aria-label":i.delete,onClick:Z,children:Ne}),t[108]=i.delete,t[109]=Z,t[110]=Re):Re=t[110];let ze;t[111]!==Ce||t[112]!==we||t[113]!==Te||t[114]!==De||t[115]!==Re?(ze=(0,Q.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:Fe,onKeyDown:Pe,children:[Ce,we,Te,De,Re]}),t[111]=Ce,t[112]=we,t[113]=Te,t[114]=De,t[115]=Re,t[116]=ze):ze=t[116];let Be;return t[117]!==c||t[118]!==oe||t[119]!==Se||t[120]!==ze||t[121]!==P||t[122]!==F?(Be=(0,Q.jsxs)(`div`,{role:`button`,tabIndex:0,className:P,onClick:c,onKeyDown:F,children:[oe,Se,ze]}),t[117]=c,t[118]=oe,t[119]=Se,t[120]=ze,t[121]=P,t[122]=F,t[123]=Be):Be=t[123],Be}function Pe(e){return e.stopPropagation()}function Fe(e){return e.stopPropagation()}function Ie(e){return(0,Q.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 Le(e){return e.language}function Re(e,t){return e.routing?.agentId?.trim().toLowerCase()||t.trim().toLowerCase()||`main`}function ze(e,t){return t.find(t=>t.id===e)?.avatar}var Be={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 Ve(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function He(e,t,n,r=1/0){return typeof e==`number`&&Number.isFinite(e)&&e>=n&&e<=r?e:t}function Ue(e,t,n,r=1/0){return Number.isInteger(e)&&e>=n&&e<=r?e:t}function We(e){let t=Ve(e)?e:{},n=Ve(t.userContext)?t.userContext:{},r=Ve(n.contextPlanning)?n.contextPlanning:{},i=Ve(r.compaction)?r.compaction:{},a=Be,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:He(i.triggerThreshold,a.triggerThreshold,.1,.98),reserveTokens:Ue(i.reserveTokens,a.reserveTokens,1024),minMessagesBeforeCompact:Ue(i.minMessagesBeforeCompact,a.minMessagesBeforeCompact,2),keepRecentTokens:Ue(i.keepRecentTokens,a.keepRecentTokens,1e3),recentTurnsPreserve:Ue(i.recentTurnsPreserve,a.recentTurnsPreserve,1,12),summaryMaxTokens:Ue(i.summaryMaxTokens,a.summaryMaxTokens,256),summaryChunkTokens:Ue(i.summaryChunkTokens,a.summaryChunkTokens,1e3),summaryTimeoutMs:Ue(i.summaryTimeoutMs,a.summaryTimeoutMs,1e3,6e5),summaryRetries:Ue(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:Ue(i.minToolResultKeepChars,a.minToolResultKeepChars,200),maxActiveTranscriptBytes:Ue(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:Be,preserve:{...Be,triggerThreshold:.88,keepRecentTokens:32e3,recentTurnsPreserve:5,maxActiveTranscriptBytes:4e6},early:{...Be,triggerThreshold:.65,reserveTokens:12e3,minMessagesBeforeCompact:6,keepRecentTokens:12e3,recentTurnsPreserve:2}},Xe=q();function Ze(){return L(`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`,K,`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,ke.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,Q.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,Q.jsx)(Y,{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,Q.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,Q.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,ke.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=L(`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,Q.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,Q.jsx)(`span`,{className:`font-medium`,children:n}),t[8]=n,t[9]=d);let f;t[10]===r?f=t[11]:(f=(0,Q.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,Q.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,Q.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}=le(e),{data:i=[],isLoading:a}=ce(e?U:null,de,{revalidateOnFocus:!1}),o=(0,Z.useMemo)(()=>n?.payload?.config===void 0?null:We(n.payload.config),[n]),[c,u]=(0,Z.useReducer)(Xe,{form:null,baseline:null}),[d,f]=(0,Z.useState)(``),p=(0,Z.useRef)(!1),m=(0,Z.useRef)(c.form);m.current=c.form;let h=(0,Z.useRef)(null);ve({enabled:e,parsed:o,dirty:p.current,trackedParsedRef:h,dispatch:u,onResetDirty:()=>{p.current=!1}});let g=c.form,_=c.baseline,v=!!(g&&_&&JSON.stringify(g)!==JSON.stringify(_)),y=(0,Z.useCallback)(e=>{p.current=!0,u({type:`patch`,patch:e})},[]),b=(0,Z.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]),x=De({value:g,dirty:v,onSave:(0,Z.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}}`,b(n)):null}});if(!e||!g)return r?(0,Q.jsx)(X,{children:(0,Q.jsxs)(`div`,{className:`space-y-3`,"aria-busy":!0,children:[(0,Q.jsx)(R,{className:`h-5 w-48`}),(0,Q.jsx)(R,{className:`h-20 w-full rounded-xl`}),(0,Q.jsx)(R,{className:`h-36 w-full rounded-xl`})]})}):null;let S=$e(g),C=Math.max(0,Je-g.reserveTokens),ee=Math.min(Math.floor(Je*g.triggerThreshold),C),w=Math.min(100,ee/Je*100),T=Math.min(100,C/Je*100),E=g.model?i.find(e=>e.id===g.model):void 0,D=E?.contextWindow&&g.summaryChunkTokens+g.summaryMaxTokens+4096>E.contextWindow,O=g.keepRecentTokens+g.reserveTokens>ee,A=Math.round(g.summaryTimeoutMs*(g.summaryRetries+1)/1e3),j=e=>{let t=Ye[e];y({...t,...g.model?{model:g.model}:{model:void 0},postCompactionSections:g.postCompactionSections})},M={balanced:{title:t.presetBalanced,hint:t.presetBalancedHint},preserve:{title:t.presetPreserve,hint:t.presetPreserveHint},early:{title:t.presetEarly,hint:t.presetEarlyHint}},P=()=>{let e=d.trim();!e||g.postCompactionSections.includes(e)||g.postCompactionSections.length>=12||(y({postCompactionSections:[...g.postCompactionSections,e]}),f(``))};return(0,Q.jsxs)(X,{onBlurCapture:x.onBlurCapture,children:[(0,Q.jsx)(Te,{icon:k,title:t.title,subtitle:t.hint,trailing:(0,Q.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Q.jsx)(Ee,{status:x.status,error:x.error}),(0,Q.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2 text-sm font-medium text-fg`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:g.enabled,onChange:e=>y({enabled:e.target.checked})}),g.enabled?t.enabled:t.disabled]})]})}),x.error?(0,Q.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:x.error}):null,g.enabled?null:(0,Q.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,Q.jsxs)(`fieldset`,{disabled:!g.enabled,className:`space-y-5 disabled:opacity-60`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:t.presetTitle}),(0,Q.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-subtle`,children:t.presetHint})]}),S===`custom`?(0,Q.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2 py-1 text-[11px] font-medium text-fg-muted`,children:t.presetCustom}):null]}),(0,Q.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-3`,children:[`balanced`,`preserve`,`early`].map(e=>(0,Q.jsxs)(`button`,{type:`button`,"aria-pressed":S===e,className:L(`rounded-xl bg-surface-base/55 px-3 py-3 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,G.transition,G.focusRingPanel,S===e?`bg-accent-soft text-accent-fg shadow-surface`:`text-fg hover:bg-surface-hover`),onClick:()=>j(e),children:[(0,Q.jsx)(`span`,{className:`block text-sm font-medium`,children:M[e].title}),(0,Q.jsx)(`span`,{className:`mt-1 block text-xs text-fg-muted`,children:M[e].hint})]},e))})]}),(0,Q.jsxs)(J,{title:t.advancedTitle,summary:S===`custom`?t.presetCustom:t.presetHint,children:[(0,Q.jsxs)(`div`,{className:`rounded-xl bg-surface-base/45 p-4`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:t.budgetPreview}),(0,Q.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-subtle`,children:t.budgetPreviewHint})]}),(0,Q.jsx)(`span`,{className:`rounded-full bg-surface-panel px-2.5 py-1 font-mono text-xs text-fg-muted`,children:t.previewModel128k})]}),(0,Q.jsxs)(`div`,{className:`mt-4 space-y-3`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`div`,{className:`mb-1 flex justify-between gap-3 text-xs text-fg-muted`,children:[(0,Q.jsx)(`span`,{children:t.compactionTrigger}),(0,Q.jsx)(`span`,{className:`font-mono text-fg`,children:et(ee)})]}),(0,Q.jsx)(`div`,{className:`h-2 overflow-hidden rounded-full bg-surface-active`,children:(0,Q.jsx)(`div`,{className:`h-full rounded-full bg-accent`,style:{width:`${w}%`}})})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`div`,{className:`mb-1 flex justify-between gap-3 text-xs text-fg-muted`,children:[(0,Q.jsx)(`span`,{children:t.hardInputLimit}),(0,Q.jsx)(`span`,{className:`font-mono text-fg`,children:et(C)})]}),(0,Q.jsx)(`div`,{className:`h-2 overflow-hidden rounded-full bg-surface-active`,children:(0,Q.jsx)(`div`,{className:`h-full rounded-full bg-fg-subtle`,style:{width:`${T}%`}})})]})]}),(0,Q.jsx)(`p`,{className:`mt-3 text-xs text-fg-subtle`,children:t.budgetFormula})]}),(0,Q.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,Q.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=>y({triggerThreshold:e/100})}),(0,Q.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=>y({reserveTokens:Math.floor(e)})}),(0,Q.jsx)($,{id:`compaction-recent-turns`,label:t.recentTurnsPreserve,hint:t.recentTurnsPreserveHint,value:g.recentTurnsPreserve,min:1,max:12,onChange:e=>y({recentTurnsPreserve:Math.floor(e)})}),(0,Q.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=>y({keepRecentTokens:Math.floor(e)})})]}),O?(0,Q.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,Q.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`label`,{className:`mb-1 block text-sm font-medium text-fg`,children:t.summaryModel}),(0,Q.jsxs)(`div`,{className:`flex min-w-0 gap-2`,children:[(0,Q.jsx)(be,{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=>y({model:e})}),g.model?(0,Q.jsx)(W,{type:`button`,variant:`secondary`,onClick:()=>y({model:void 0}),children:t.summaryModelUseSession}):null]}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:t.summaryModelHint})]}),(0,Q.jsx)(tt,{label:t.qualityGuard,hint:t.qualityGuardHint,checked:g.qualityGuard,onChange:e=>y({qualityGuard:e})}),(0,Q.jsx)(tt,{label:t.gapAudit,hint:t.gapAuditHint,checked:g.gapAudit,onChange:e=>y({gapAudit:e})})]}),g.qualityGuard?null:(0,Q.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,Q.jsx)(Oe,{children:(0,Q.jsxs)(`div`,{className:`space-y-5 rounded-xl bg-surface-base/45 p-4`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:t.advancedTitle}),(0,Q.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-subtle`,children:t.advancedHint})]}),(0,Q.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,Q.jsx)($,{id:`compaction-min-messages`,label:t.minMessagesBeforeCompact,hint:t.minMessagesBeforeCompactHint,value:g.minMessagesBeforeCompact,min:2,onChange:e=>y({minMessagesBeforeCompact:Math.floor(e)})}),(0,Q.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=>y({maxActiveTranscriptBytes:Math.max(64e3,Math.round(e*1e6))})}),(0,Q.jsx)($,{id:`compaction-summary-max-tokens`,label:t.summaryMaxTokens,hint:t.summaryMaxTokensHint,value:g.summaryMaxTokens,min:256,step:256,onChange:e=>y({summaryMaxTokens:Math.floor(e)})}),(0,Q.jsx)($,{id:`compaction-summary-chunk-tokens`,label:t.summaryChunkTokens,hint:t.summaryChunkTokensHint,value:g.summaryChunkTokens,min:1e3,step:1e3,onChange:e=>y({summaryChunkTokens:Math.floor(e)})}),(0,Q.jsx)($,{id:`compaction-summary-timeout`,label:t.summaryTimeoutSeconds,hint:t.summaryTimeoutSecondsHint.replace(`{{seconds}}`,String(A)),value:g.summaryTimeoutMs/1e3,min:1,max:600,onChange:e=>y({summaryTimeoutMs:Math.round(e*1e3)})}),(0,Q.jsx)($,{id:`compaction-summary-retries`,label:t.summaryRetries,hint:t.summaryRetriesHint,value:g.summaryRetries,min:0,max:5,onChange:e=>y({summaryRetries:Math.floor(e)})}),(0,Q.jsx)($,{id:`compaction-min-tool-result-chars`,label:t.minToolResultKeepChars,hint:t.minToolResultKeepCharsHint,value:g.minToolResultKeepChars,min:200,step:100,onChange:e=>y({minToolResultKeepChars:Math.floor(e)})})]}),D?(0,Q.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,Q.jsxs)(`div`,{className:`rounded-xl bg-surface-base/45 p-4`,children:[(0,Q.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:t.postCompactionSections}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:t.postCompactionSectionsHint}),g.postCompactionSections.length>0?(0,Q.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:g.postCompactionSections.map(e=>(0,Q.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,Q.jsx)(`button`,{type:`button`,className:L(`text-fg-muted hover:text-fg`,G.press),"aria-label":t.removeSection.replace(`{{section}}`,e),onClick:()=>y({postCompactionSections:g.postCompactionSections.filter(t=>t!==e)}),children:(0,Q.jsx)(te,{className:`size-3.5`,"aria-hidden":!0})})]},e))}):(0,Q.jsx)(`p`,{className:`mt-3 text-xs text-fg-muted`,children:t.postCompactionSectionsEmpty}),(0,Q.jsxs)(`div`,{className:`mt-3 flex gap-2`,children:[(0,Q.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(),P())}}),(0,Q.jsxs)(W,{type:`button`,variant:`secondary`,disabled:!d.trim()||g.postCompactionSections.length>=12,onClick:P,children:[(0,Q.jsx)(N,{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 L(`w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg`,K,`dark:border-edge`)}var ct=q();function lt({hasToken:e}){let t=l(s(e=>e.language)).sessions.config,{data:n,isLoading:r}=le(e),i=(0,Z.useMemo)(()=>n?.payload?.config===void 0?null:at(n.payload.config),[n]),[a,o]=(0,Z.useReducer)(ct,{form:null,baseline:null}),c=a.form,u=a.baseline,d=(0,Z.useRef)(!1),f=(0,Z.useRef)(c);f.current=c;let p=(0,Z.useRef)(null);ve({enabled:e,parsed:i,dirty:d.current,trackedParsedRef:p,dispatch:o,onResetDirty:()=>{d.current=!1}});let m=!!(c&&u&&JSON.stringify(c)!==JSON.stringify(u)),h=(0,Z.useCallback)(e=>{d.current=!0,o({type:`patch`,patch:e})},[]),g=De({value:c,dirty:m,onSave:(0,Z.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,Q.jsx)(X,{children:(0,Q.jsxs)(`div`,{className:`space-y-3`,"aria-busy":!0,children:[(0,Q.jsx)(R,{className:`h-5 w-40`}),(0,Q.jsx)(R,{className:`h-24 w-full rounded-xl`})]})}):null:(0,Q.jsxs)(X,{onBlurCapture:g.onBlurCapture,children:[(0,Q.jsx)(Te,{icon:ee,title:t.title,subtitle:t.hint,trailing:(0,Q.jsx)(Ee,{status:g.status,error:g.error})}),(0,Q.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,Q.jsx)(J,{title:t.dmScope,summary:c.dmScope,children:(0,Q.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,Q.jsx)(`label`,{className:`mb-1 block text-sm font-medium text-fg`,children:t.dmScope}),(0,Q.jsxs)(b,{className:st(),value:c.dmScope,onChange:e=>h({dmScope:e.target.value}),children:[(0,Q.jsx)(x,{value:`main`,children:t.dmScopeMain}),(0,Q.jsx)(x,{value:`per-peer`,children:t.dmScopePerPeer}),(0,Q.jsx)(x,{value:`per-channel-peer`,children:t.dmScopePerChannelPeer}),(0,Q.jsx)(x,{value:`per-account-channel-peer`,children:t.dmScopePerAccountChannelPeer})]}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:t.dmScopeHint})]})}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`label`,{className:`mb-1 block text-sm font-medium text-fg`,children:t.pruneAfterDays}),(0,Q.jsx)(Y,{allowEmpty:!0,type:`number`,min:0,className:st(),value:c.pruneAfterDays??``,placeholder:t.unsetPlaceholder,onChange:e=>{let t=e.target.value.trim();h({pruneAfterDays:t===``?null:Math.max(0,Math.floor(Number(t)||0))})}})]}),(0,Q.jsx)(J,{title:t.maxEntries,summary:c.maxEntries??t.unsetPlaceholder,children:(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`label`,{className:`mb-1 block text-sm font-medium text-fg`,children:t.maxEntries}),(0,Q.jsx)(Y,{allowEmpty:!0,type:`number`,min:1,className:st(),value:c.maxEntries??``,placeholder:t.unsetPlaceholder,onChange:e=>{let t=e.target.value.trim();h({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,ke.c)(60),{open:n,loading:r,session:i,sessionAgentId:a,sessionAgentAvatar:o,labels:s,onClose:c,onArchive:l,onUnarchive:g,onPin:_,onUnpin:v,onExport:y,onDelete:b}=e,x=i?.status===`archived`,S=i?.status===`pinned`,C;t[0]===c?C=t[1]:(C=e=>!e&&c(),t[0]=c,t[1]=C);let ee;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,Q.jsx)(u,{className:L(`xopc-dialog-overlay fixed inset-0 bg-scrim`,pe)}),t[2]=ee):ee=t[2];let w;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(w=L(`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`,fe,`dark:border-edge`),t[3]=w):w=t[3];let T;t[4]!==i||t[5]!==o||t[6]!==a?(T=i&&a?(0,Q.jsx)(ge,{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]=T):T=t[7];let E;t[8]!==s.unnamedSession||t[9]!==i?.name?(E=i?.name?.trim()||s.unnamedSession,t[8]=s.unnamedSession,t[9]=i?.name,t[10]=E):E=t[10];let D;t[11]===E?D=t[12]:(D=(0,Q.jsx)(m,{className:`min-w-0 flex-1 truncate text-base font-semibold tracking-tight text-fg`,children:E}),t[11]=E,t[12]=D);let O;t[13]!==T||t[14]!==D?(O=(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3`,children:[T,D]}),t[13]=T,t[14]=D,t[15]=O):O=t[15];let k;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,Q.jsx)(te,{className:`size-5`,strokeWidth:1.75}),t[16]=k):k=t[16];let A;t[17]===s.close?A=t[18]:(A=(0,Q.jsx)(d,{asChild:!0,children:(0,Q.jsx)(W,{type:`button`,variant:`ghost`,className:`size-9 shrink-0 p-0`,"aria-label":s.close,children:k})}),t[17]=s.close,t[18]=A);let j;t[19]!==O||t[20]!==A?(j=(0,Q.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:[O,A]}),t[19]=O,t[20]=A,t[21]=j):j=t[21];let M;t[22]!==s.detailLoading||t[23]!==s.detailMessages||t[24]!==r||t[25]!==i?(M=r?(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:s.detailLoading}):i?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`dl`,{className:`mb-4 grid gap-2 text-xs text-fg-muted`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`dt`,{className:`text-fg-disabled`,children:`Key`}),(0,Q.jsx)(`dd`,{className:`mt-0.5 break-all font-mono text-fg`,children:i.key})]}),(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-4`,children:(0,Q.jsxs)(`span`,{children:[i.messageCount,` msgs · `,i.estimatedTokens,` tok`]})})]}),(0,Q.jsx)(`h3`,{className:`mb-2 text-xs font-medium uppercase tracking-wide text-fg-subtle`,children:s.detailMessages}),(0,Q.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]=M):M=t[26];let N;t[27]===M?N=t[28]:(N=(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-3`,children:M}),t[27]=M,t[28]=N);let P;t[29]!==s.detailExport||t[30]!==y?(P=(0,Q.jsx)(W,{type:`button`,variant:`secondary`,className:`text-sm`,onClick:y,children:s.detailExport}),t[29]=s.detailExport,t[30]=y,t[31]=P):P=t[31];let F;t[32]!==x||t[33]!==s.archive||t[34]!==s.unarchive||t[35]!==l||t[36]!==g?(F=x?(0,Q.jsx)(W,{type:`button`,variant:`secondary`,className:`text-sm`,onClick:g,children:s.unarchive}):(0,Q.jsx)(W,{type:`button`,variant:`secondary`,className:`text-sm`,onClick:l,children:s.archive}),t[32]=x,t[33]=s.archive,t[34]=s.unarchive,t[35]=l,t[36]=g,t[37]=F):F=t[37];let I;t[38]!==S||t[39]!==s.pin||t[40]!==s.unpin||t[41]!==_||t[42]!==v?(I=S?(0,Q.jsx)(W,{type:`button`,variant:`secondary`,className:`text-sm`,onClick:v,children:s.unpin}):(0,Q.jsx)(W,{type:`button`,variant:`secondary`,className:`text-sm`,onClick:_,children:s.pin}),t[38]=S,t[39]=s.pin,t[40]=s.unpin,t[41]=_,t[42]=v,t[43]=I):I=t[43];let R;t[44]!==s.delete||t[45]!==b?(R=(0,Q.jsx)(W,{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:b,children:s.delete}),t[44]=s.delete,t[45]=b,t[46]=R):R=t[46];let z;t[47]!==P||t[48]!==F||t[49]!==I||t[50]!==R?(z=(0,Q.jsx)(`div`,{className:`shrink-0 border-t border-edge px-4 py-3 dark:border-edge`,children:(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[P,F,I,R]})}),t[47]=P,t[48]=F,t[49]=I,t[50]=R,t[51]=z):z=t[51];let B;t[52]!==j||t[53]!==N||t[54]!==z?(B=(0,Q.jsxs)(f,{children:[ee,(0,Q.jsxs)(p,{className:w,"aria-describedby":void 0,children:[j,N,z]})]}),t[52]=j,t[53]=N,t[54]=z,t[55]=B):B=t[55];let V;return t[56]!==n||t[57]!==C||t[58]!==B?(V=(0,Q.jsx)(h,{open:n,onOpenChange:C,children:B}),t[56]=n,t[57]=C,t[58]=B,t[59]=V):V=t[59],V}function ft(e){return(0,Q.jsxs)(`li`,{className:`rounded-lg border border-edge-subtle bg-surface-hover/50 p-2 dark:border-edge`,children:[(0,Q.jsx)(`div`,{className:`mb-1 text-[10px] font-medium uppercase text-fg-subtle`,children:e.role}),(0,Q.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,ke.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`?E:F})),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,Q.jsx)(he,{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,ke.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,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`mb-5`,children:[(0,Q.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:yt(n,r)}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:bt(n,r)})]}),(0,Q.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,Q.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}=ce(r?[`gateway-chat-agents`,n]:null,ue,{revalidateOnFocus:!1}),d=a?.defaultId??`main`,_=a?.items??[],[v,b]=i(),x=vt(v.get(`tab`)),C=(0,Z.useCallback)(e=>{let t=new URLSearchParams(v);e===`sessions`?t.delete(`tab`):t.set(`tab`,e),b(t,{replace:!0})},[v,b]),[ee,w]=(0,Z.useReducer)(ye,v,Ct),{searchInput:O,debouncedSearch:k,statusFilter:A,viewMode:M,channelFilter:N,sessions:F,loading:I,error:te,hasMore:R,stats:H,detailOpen:le,detailLoading:de,detailSession:U,confirmOpen:me,confirmKey:K}=ee;(0,Z.useEffect)(()=>{let e=setTimeout(()=>{let e=O.trim();k!==e&&w({type:`patch`,patch:{debouncedSearch:e}})},300);return()=>clearTimeout(e)},[O,k]);let he=v.toString(),ge=(0,Z.useRef)(he);if(ge.current!==he){ge.current=he;let e=v.get(`q`)??``,t=v.get(`status`),n=v.get(`view`),r=(v.get(`channel`)??``).trim(),i=ht.has(t)?t:`all`,a=gt.has(n)?n:`grid`,o=e.trim();w({type:`patch`,patch:{...O===e?{}:{searchInput:e},...k===o?{}:{debouncedSearch:o},...A===i?{}:{statusFilter:i},...M===a?{}:{viewMode:a},...N===r?{}:{channelFilter:r}}})}(0,Z.useEffect)(()=>{let e=new URLSearchParams(v),t=k.trim();t?e.set(`q`,t):e.delete(`q`),A===`all`?e.delete(`status`):e.set(`status`,A),M===`grid`?e.delete(`view`):e.set(`view`,M),N?e.set(`channel`,N):e.delete(`channel`),e.toString()!==v.toString()&&b(e,{replace:!0})},[k,v,b,A,M,N]),(0,Z.useEffect)(()=>{if(!r||x!==`sessions`)return;let e=!1;return(async()=>{w({type:`patch`,patch:{loading:!0,error:null}});try{let t=await oe({limit:pt,offset:0,...k?{search:k}:{},...A===`all`?{}:{status:A},...N?{channel:N}:{}});if(e)return;w({type:`patch`,patch:{sessions:t.items,hasMore:t.hasMore}})}catch(n){e||w({type:`patch`,patch:{error:n instanceof Error?n.message:t.loadError}})}finally{e||w({type:`patch`,patch:{loading:!1}})}})(),()=>{e=!0}},[r,x,k,A,N,t.loadError]),(0,Z.useEffect)(()=>{!r||x!==`sessions`||re().then(e=>w({type:`patch`,patch:{stats:e}})).catch(()=>{})},[r,x]),(0,Z.useEffect)(()=>{if(!r||x!==`sessions`)return;let e=()=>void c();return window.addEventListener(`config-reload`,e),()=>window.removeEventListener(`config-reload`,e)},[r,x,c]),(0,Z.useEffect)(()=>{if(!r||x!==`sessions`)return;let e=e=>{let t=e.detail;!t?.key||t.name===void 0||w({type:`patch`,patch:{sessions:F.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,x,F,U]);let ve=(0,Z.useCallback)(async()=>{if(!(!r||I||!R)){w({type:`patch`,patch:{loading:!0,error:null}});try{let e=await oe({limit:pt,offset:F.length,...k?{search:k}:{},...A===`all`?{}:{status:A},...N?{channel:N}:{}});w({type:`patch`,patch:{sessions:[...F,...e.items],hasMore:e.hasMore}})}catch(e){w({type:`patch`,patch:{error:e instanceof Error?e.message:t.loadError}})}finally{w({type:`patch`,patch:{loading:!1}})}}},[r,I,R,F.length,k,A,N,t.loadError]),q=(0,Z.useCallback)((e,t)=>{w({type:`patch`,patch:{sessions:F.map(n=>n.key===e?{...n,status:t}:n),detailSession:U&&U.key===e?{...U,status:t}:U}})},[F,U]),be=(0,Z.useCallback)(async e=>{w({type:`patch`,patch:{detailOpen:!0,detailLoading:!0,detailSession:null}});try{let t=await z(e);w({type:`patch`,patch:{detailSession:t}})}catch{w({type:`patch`,patch:{detailOpen:!1}})}finally{w({type:`patch`,patch:{detailLoading:!1}})}},[]),J=e=>{be(e)},Y=async(e,t)=>{if(t===`continue`){window.dispatchEvent(new CustomEvent(`navigate-to-chat`,{detail:{conversationId:e},bubbles:!0}));return}if(t===`delete`){w({type:`patch`,patch:{confirmKey:e,confirmOpen:!0}});return}try{switch(t){case`archive`:await se(e),q(e,`archived`);break;case`unarchive`:await V(e),q(e,`active`);break;case`pin`:await B(e),q(e,`pinned`);break;case`unpin`:await ie(e),q(e,`active`);break;case`export`:{let t=await ae(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}re().then(e=>w({type:`patch`,patch:{stats:e}})).catch(()=>{})}catch{}},Te=async e=>{try{await ne(e),w({type:`patch`,patch:{sessions:F.filter(t=>t.key!==e),detailSession:U?.key===e?null:U,...U?.key===e?{detailOpen:!1}:{}}}),re().then(e=>w({type:`patch`,patch:{stats:e}})).catch(()=>{})}catch{}},X={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},Ee={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},De=[{key:`all`,label:t.filterAll,icon:E},{key:`active`,label:t.filterActive,icon:S},{key:`pinned`,label:t.filterPinned,icon:j},{key:`archived`,label:t.filterArchived,icon:y}],Oe=(()=>{let e=Object.entries(H?.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,Q.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-x-hidden bg-surface-panel`,children:[(0,Q.jsxs)(Ce,{gap:`gap-6`,children:[(0,Q.jsx)(we,{title:t.title}),(0,Q.jsx)(xt,{s:t,activeTab:x,onChange:C}),(0,Q.jsx)(St,{s:t,id:`settings`,activeTab:x,plain:!0,children:(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsx)(nt,{hasToken:r}),(0,Q.jsx)(lt,{hasToken:r})]})}),(0,Q.jsxs)(St,{s:t,id:`sessions`,activeTab:x,plain:!0,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between`,children:[(0,Q.jsx)(_e,{className:`flex flex-wrap gap-2`,role:`group`,"aria-label":t.tabsSessions,indicatorClassName:`rounded-xl bg-accent-soft`,children:De.map(({key:e,label:t,icon:n})=>(0,Q.jsxs)(`button`,{type:`button`,"aria-pressed":A===e,onClick:()=>w({type:`patch`,patch:{statusFilter:e}}),className:L(`inline-flex items-center gap-1.5 rounded-xl px-3 py-2 text-sm font-medium`,G.transition,G.focusRingPanel,A===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,Q.jsx)(n,{className:`size-4`,strokeWidth:1.75,"aria-hidden":!0}),t]},e))}),(0,Q.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,Q.jsx)(P,{className:`size-4 shrink-0 text-fg-disabled`,strokeWidth:1.75,"aria-hidden":!0}),(0,Q.jsx)(`input`,{type:`search`,value:O,onChange:e=>w({type:`patch`,patch:{searchInput:e.target.value}}),placeholder:t.searchPlaceholder,"aria-label":t.searchPlaceholder,"data-debounced-query":k||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,Q.jsxs)(_e,{className:`flex flex-wrap items-center gap-2`,role:`group`,"aria-label":t.filterChannelLabel,indicatorClassName:`rounded-xl bg-accent-soft`,children:[(0,Q.jsx)(`span`,{className:`text-xs font-medium text-fg-subtle`,children:t.filterChannelLabel}),(0,Q.jsx)(`button`,{type:`button`,"aria-pressed":!N,onClick:()=>w({type:`patch`,patch:{channelFilter:``}}),className:L(`touch-target inline-flex items-center rounded-xl px-3 py-2 text-sm font-medium`,G.transition,G.focusRingPanel,N?`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}),Oe.map(e=>(0,Q.jsxs)(`button`,{type:`button`,"aria-pressed":N===e,onClick:()=>w({type:`patch`,patch:{channelFilter:e}}),className:L(`touch-target inline-flex items-center rounded-xl px-3 py-2 text-sm font-medium`,G.transition,G.focusRingPanel,N===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,H?.byChannel?.[e]==null?null:(0,Q.jsx)(`span`,{className:`ml-2 rounded-full bg-surface-hover px-2 py-0.5 text-[11px] text-fg-subtle`,children:H.byChannel[e]})]},e))]}),H?(0,Q.jsx)(`div`,{className:`grid grid-cols-2 gap-3 sm:grid-cols-4`,children:[[H.totalSessions,t.totalSessions],[H.activeSessions,t.activeSessions],[H.pinnedSessions,t.pinnedSessions],[H.archivedSessions,t.archivedSessions]].map(([e,t])=>(0,Q.jsxs)(`div`,{className:`rounded-xl bg-surface-base p-3 dark:bg-surface-hover/30`,children:[(0,Q.jsx)(`div`,{className:`text-lg font-semibold tabular-nums text-fg`,children:e}),(0,Q.jsx)(`div`,{className:`text-xs text-fg-muted`,children:t})]},t))}):null,te?(0,Q.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:te}):null,(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:mt(t.sessionCount,{count:F.length})}),(0,Q.jsxs)(_e,{className:Se,role:`group`,"aria-label":t.layoutToggleGroup,indicatorClassName:`rounded-pill bg-surface-panel shadow-sm dark:ring-1 dark:ring-edge-strong/40`,children:[(0,Q.jsx)(W,{type:`button`,variant:`segmented`,title:t.gridView,"aria-pressed":M===`grid`,onClick:()=>w({type:`patch`,patch:{viewMode:`grid`}}),className:L(xe,`size-7 p-0`,M===`grid`&&`bg-surface-panel shadow-sm dark:bg-surface-panel dark:shadow-sm dark:ring-1 dark:ring-edge-strong/40`,M===`grid`&&`text-accent-fg`),children:(0,Q.jsx)(D,{className:`size-3.5`,strokeWidth:1.5})}),(0,Q.jsx)(W,{type:`button`,variant:`segmented`,title:t.listView,"aria-pressed":M===`list`,onClick:()=>w({type:`patch`,patch:{viewMode:`list`}}),className:L(xe,`size-9 p-0`,M===`list`&&`bg-surface-panel shadow-sm dark:bg-surface-panel dark:shadow-sm dark:ring-1 dark:ring-edge-strong/40`,M===`list`&&`text-accent-fg`),children:(0,Q.jsx)(g,{className:`size-3.5`,strokeWidth:1.5})})]})]}),I&&F.length===0?(0,Q.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,Q.jsx)(`div`,{className:`h-40 animate-pulse rounded-xl bg-surface-hover/60 dark:bg-surface-hover/40`},t))}):F.length===0?(0,Q.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,Q.jsx)(T,{className:`mb-3 size-12 text-fg-disabled`,strokeWidth:1.25,"aria-hidden":!0}),(0,Q.jsx)(`p`,{className:`text-base font-semibold text-fg`,children:t.noSessions}),(0,Q.jsx)(`p`,{className:`mt-1 max-w-sm text-sm text-fg-muted`,children:t.noSessionsDescription}),(0,Q.jsx)(W,{variant:`primary`,className:`mt-6`,onClick:()=>{window.dispatchEvent(new CustomEvent(`navigate-to-chat`,{detail:{conversationId:``},bubbles:!0}))},children:t.startNewChat})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:L(`grid min-w-0 gap-3`,M===`grid`?`sm:grid-cols-2 lg:grid-cols-3`:`grid-cols-1`),"data-debounced-query":k||void 0,children:F.map(e=>{let t=Re(e,d);return(0,Q.jsx)(Ne,{session:e,variant:M,labels:X,sessionAgentId:t,sessionAgentAvatar:ze(t,_),onOpen:()=>J(e.key),onAction:t=>void Y(e.key,t)},e.key)})}),R?(0,Q.jsx)(`div`,{className:`flex justify-center pt-2`,children:(0,Q.jsx)(W,{type:`button`,variant:`secondary`,disabled:I,onClick:()=>void ve(),children:t.loadMore})}):null]})]})]}),(0,Q.jsx)(dt,{open:le,loading:de,session:U,sessionAgentId:U?Re(U,d):void 0,sessionAgentAvatar:U?ze(Re(U,d),_):void 0,labels:Ee,onClose:()=>{w({type:`patch`,patch:{detailOpen:!1,detailSession:null}})},onArchive:()=>U&&void Y(U.key,`archive`),onUnarchive:()=>U&&void Y(U.key,`unarchive`),onPin:()=>U&&void Y(U.key,`pin`),onUnpin:()=>U&&void Y(U.key,`unpin`),onExport:()=>U&&void Y(U.key,`export`),onDelete:()=>U&&w({type:`patch`,patch:{confirmKey:U.key,confirmOpen:!0}})}),(0,Q.jsx)(h,{open:me,onOpenChange:e=>w({type:`patch`,patch:{confirmOpen:e}}),children:(0,Q.jsxs)(f,{children:[(0,Q.jsx)(u,{className:L(`xopc-dialog-overlay fixed inset-0 bg-scrim`,pe)}),(0,Q.jsxs)(p,{className:L(`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`,fe),children:[(0,Q.jsx)(m,{className:`text-base font-semibold text-fg`,children:t.deleteSessionTitle}),(0,Q.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:K?mt(t.deleteSessionMessage,{name:F.find(e=>e.key===K)?.name?.trim()||e.chat.newSession}):``}),(0,Q.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[(0,Q.jsx)(W,{type:`button`,variant:`secondary`,onClick:()=>w({type:`patch`,patch:{confirmOpen:!1}}),children:t.cancel}),(0,Q.jsx)(W,{type:`button`,variant:`primary`,className:`bg-red-600 hover:bg-red-700`,onClick:()=>{K&&Te(K),w({type:`patch`,patch:{confirmOpen:!1,confirmKey:null}})},children:t.delete})]})]})]})})]}):(0,Q.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-LhhHA2sK.js";import{t as l}from"./messages-C3xqMM9W.js";import{a as u,n as d,o as f,r as p,s as m,t as h}from"./dist-BGTk37IG.js";import{n as g,r as _,t as v}from"./session-identity-label-BP7OIYth.js";import{t as y}from"./archive-Dz0hferG.js";import{n as b,r as x}from"./popover-select-CEMWIrtY.js";import{t as S}from"./circle-BoO4YvTx.js";import{t as C}from"./coins-DjP27vUx.js";import{t as ee}from"./database-CjjeZfRG.js";import{t as w}from"./download-Dk-ZjtO6.js";import{t as T}from"./folder-open-CyzJ19I9.js";import{t as E}from"./layers-mJW7JJKm.js";import{t as D}from"./layout-grid-CEVZdVFU.js";import{t as O}from"./message-square-fVE7Ghj1.js";import{t as k}from"./minimize-2-DtOGrlpo.js";import{t as A}from"./session-channel-icon-D1ktvt1P.js";import{n as j,t as M}from"./pin-off-BMRv-Kxr.js";import{t as N}from"./plus-Q2yW6OE7.js";import{t as P}from"./search-DA7gz22f.js";import{t as F}from"./settings-uiTATseT.js";import{t as I}from"./trash-2-DusmjVPV.js";import{t as te}from"./x-B_N4OPjy.js";import{t as L}from"./cn-0WouolD0.js";import{t as R}from"./skeleton-BI5TyibZ.js";import{a as z,c as B,f as V,n as ne,o as re,p as ie,r as ae,s as oe,t as se}from"./session-api-DZ2Ov33K.js";import{i as ce}from"./vendor-swr-CdRzEUwF.js";import{n as H,r as le}from"./gateway-config-swr-CtEdaxOS.js";import{t as ue}from"./chat-agents-api-BrsUEl3u.js";import{n as de,t as U}from"./registry-api-B3YqZBhQ.js";import{t as W}from"./button-Cc4hUNTt.js";import{i as fe,o as pe}from"./settings-shell-dialog-layer-BU3UuiJr.js";import{n as G,t as me}from"./interaction-BdhHBbYa.js";import{s as K}from"./form-field-width-DJw_jULe.js";import{t as he}from"./page-tabs-oeTY7z3_.js";import{t as ge}from"./agent-avatar-display-B_QEDfMT.js";import{t as _e}from"./sliding-tab-list-DuQyViqe.js";import{n as ve,r as ye,t as q}from"./settings-form-draft-Dy10ldo8.js";import{n as be}from"./model-selector-VVkCmNdS.js";import{n as xe,r as Se}from"./segmented-styles-Cqb91xsn.js";import{t as J}from"./settings-advanced-section-TJ8MAroB.js";import{t as Y}from"./number-input-El7Szeln.js";import{n as Ce,t as we}from"./settings-page-header-BEDxq_lT.js";import"./settings-page-layout-BftgkTYo.js";import{n as Te,t as X}from"./settings-form-section-num14vSv.js";import{n as Ee,t as De}from"./use-autosave-CDy9yziL.js";import{t as Oe}from"./settings-advanced-gate-CGgt1myW.js";var Z=e(t(),1),ke=n(),Q=r();function Ae(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 je(e,t){return new Intl.NumberFormat(t===`zh`?`zh-CN`:`en-US`).format(e)}function Me(e){return`$${Number(e).toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:6})}`}function Ne(e){let t=(0,ke.c)(124),{session:n,variant:r,labels:i,sessionAgentId:a,sessionAgentAvatar:o,onOpen:c,onAction:u}=e,d;t[0]!==i.unnamedSession||t[1]!==n.name?(d=n.name?.trim()||i.unnamedSession,t[0]=i.unnamedSession,t[1]=n.name,t[2]=d):d=t[2];let f=d,p=s(Le),m;t[3]!==p||t[4]!==n?(m=v(n,l(p).sidebar.sessionFilters),t[3]=p,t[4]=n,t[5]=m):m=t[5];let h=m,g;t[6]===n.name?g=t[7]:(g=n.name?.trim(),t[6]=n.name,t[7]=g);let b=!!g,x=n.status===`archived`,S=n.status===`pinned`,T=n.usage,E;t[8]!==i.costUnknown||t[9]!==i.noUsage||t[10]!==T?(E=T?.calls?T.costCompleteness===`unknown`?i.costUnknown:`${T.costCompleteness===`partial`?`≥ `:`≈ `}${Me(T.knownCostUsd)}`:i.noUsage,t[8]=i.costUnknown,t[9]=i.noUsage,t[10]=T,t[11]=E):E=t[11];let D=E,k=T?.calls?T.costCompleteness===`partial`?i.costPartial:T.costCompleteness===`unknown`?i.costUnknown:i.cost:i.noUsage,N=r===`list`&&`sm:flex-row sm:items-center sm:gap-4`,P;t[12]===N?P=t[13]:(P=L(`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`,N),t[12]=N,t[13]=P);let F;t[14]===c?F=t[15]:(F=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),c())},t[14]=c,t[15]=F);let te=r===`list`&&`sm:py-3`,R;t[16]===te?R=t[17]:(R=L(`flex min-w-0 items-start justify-between gap-2 bg-surface-hover/35 px-3 py-2 dark:bg-surface-hover/25`,te),t[16]=te,t[17]=R);let z;t[18]===n?z=t[19]:(z=(0,Q.jsx)(A,{sourceChannel:n.sourceChannel,session:n,className:`size-3.5`}),t[18]=n,t[19]=z);let B;t[20]===h?B=t[21]:(B=(0,Q.jsx)(`span`,{className:`truncate text-[11px] font-medium uppercase tracking-wide text-fg-subtle`,children:h}),t[20]=h,t[21]=B);let V;t[22]!==z||t[23]!==B?(V=(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[z,B]}),t[22]=z,t[23]=B,t[24]=V):V=t[24];let ne;t[25]===S?ne=t[26]:(ne=S?(0,Q.jsx)(j,{className:`size-3.5 text-accent-fg`,strokeWidth:1.75,"aria-hidden":!0}):null,t[25]=S,t[26]=ne);let re;t[27]===n.updatedAt?re=t[28]:(re=Ae(n.updatedAt),t[27]=n.updatedAt,t[28]=re);let ie;t[29]===re?ie=t[30]:(ie=(0,Q.jsx)(`span`,{children:re}),t[29]=re,t[30]=ie);let ae;t[31]!==ne||t[32]!==ie?(ae=(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5 text-xs text-fg-muted`,children:[ne,ie]}),t[31]=ne,t[32]=ie,t[33]=ae):ae=t[33];let oe;t[34]!==V||t[35]!==ae||t[36]!==R?(oe=(0,Q.jsxs)(`div`,{className:R,children:[V,ae]}),t[34]=V,t[35]=ae,t[36]=R,t[37]=oe):oe=t[37];let se=r===`list`&&`sm:py-3`,ce;t[38]===se?ce=t[39]:(ce=L(`min-w-0 flex-1 px-3 py-2`,se),t[38]=se,t[39]=ce);let H=r===`list`&&`sm:items-start`,le;t[40]===H?le=t[41]:(le=L(`flex gap-3`,H),t[40]=H,t[41]=le);let ue;t[42]!==o||t[43]!==a?(ue=(0,Q.jsx)(ge,{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]=ue):ue=t[44];let de;t[45]===f?de=t[46]:(de=(0,Q.jsx)(`div`,{className:`min-w-0 max-w-full truncate text-sm font-semibold text-fg`,title:f,children:f}),t[45]=f,t[46]=de);let U;t[47]!==n.key||t[48]!==b?(U=b?(0,Q.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]=b,t[49]=U):U=t[49];let W;t[50]!==de||t[51]!==U?(W=(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[de,U]}),t[50]=de,t[51]=U,t[52]=W):W=t[52];let fe;t[53]!==le||t[54]!==ue||t[55]!==W?(fe=(0,Q.jsxs)(`div`,{className:le,children:[ue,W]}),t[53]=le,t[54]=ue,t[55]=W,t[56]=fe):fe=t[56];let pe;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(pe=(0,Q.jsx)(O,{className:`size-3.5`,strokeWidth:1.75,"aria-hidden":!0}),t[57]=pe):pe=t[57];let G;t[58]===n.messageCount?G=t[59]:(G=(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[pe,n.messageCount]}),t[58]=n.messageCount,t[59]=G);let K;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,Q.jsx)(ee,{className:`size-3.5`,strokeWidth:1.75,"aria-hidden":!0}),t[60]=K):K=t[60];let he=T?.totalTokens??0,_e;t[61]!==p||t[62]!==he?(_e=je(he,p),t[61]=p,t[62]=he,t[63]=_e):_e=t[63];let ve;t[64]!==i.tokens||t[65]!==_e?(ve=(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[K,_e,` `,i.tokens]}),t[64]=i.tokens,t[65]=_e,t[66]=ve):ve=t[66];let ye;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(ye=(0,Q.jsx)(C,{className:`size-3.5`,strokeWidth:1.75,"aria-hidden":!0}),t[67]=ye):ye=t[67];let q;t[68]!==D||t[69]!==k?(q=(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1`,title:k,children:[ye,D]}),t[68]=D,t[69]=k,t[70]=q):q=t[70];let be;t[71]!==G||t[72]!==ve||t[73]!==q?(be=(0,Q.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-3 text-xs text-fg-muted`,children:[G,ve,q]}),t[71]=G,t[72]=ve,t[73]=q,t[74]=be):be=t[74];let xe;t[75]===n.tags?xe=t[76]:(xe=n.tags.length>0?(0,Q.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1`,children:[n.tags.slice(0,3).map(Ie),n.tags.length>3?(0,Q.jsxs)(`span`,{className:`text-[11px] text-fg-disabled`,children:[`+`,n.tags.length-3]}):null]}):null,t[75]=n.tags,t[76]=xe);let Se;t[77]!==ce||t[78]!==fe||t[79]!==be||t[80]!==xe?(Se=(0,Q.jsxs)(`div`,{className:ce,children:[fe,be,xe]}),t[77]=ce,t[78]=fe,t[79]=be,t[80]=xe,t[81]=Se):Se=t[81];let J;t[82]===u?J=t[83]:(J=()=>u(`continue`),t[82]=u,t[83]=J);let Y;t[84]===Symbol.for(`react.memo_cache_sentinel`)?(Y=(0,Q.jsx)(O,{className:`size-4`,strokeWidth:1.75}),t[84]=Y):Y=t[84];let Ce;t[85]!==i.continueChat||t[86]!==J?(Ce=(0,Q.jsx)(`button`,{type:`button`,className:me,title:i.continueChat,"aria-label":i.continueChat,onClick:J,children:Y}),t[85]=i.continueChat,t[86]=J,t[87]=Ce):Ce=t[87];let we;t[88]!==x||t[89]!==i.archive||t[90]!==i.unarchive||t[91]!==u?(we=x?(0,Q.jsx)(`button`,{type:`button`,className:me,title:i.unarchive,"aria-label":i.unarchive,onClick:()=>u(`unarchive`),children:(0,Q.jsx)(_,{className:`size-4`,strokeWidth:1.75})}):(0,Q.jsx)(`button`,{type:`button`,className:me,title:i.archive,"aria-label":i.archive,onClick:()=>u(`archive`),children:(0,Q.jsx)(y,{className:`size-4`,strokeWidth:1.75})}),t[88]=x,t[89]=i.archive,t[90]=i.unarchive,t[91]=u,t[92]=we):we=t[92];let Te;t[93]!==S||t[94]!==i.pin||t[95]!==i.unpin||t[96]!==u?(Te=S?(0,Q.jsx)(`button`,{type:`button`,className:me,title:i.unpin,"aria-label":i.unpin,onClick:()=>u(`unpin`),children:(0,Q.jsx)(M,{className:`size-4`,strokeWidth:1.75})}):(0,Q.jsx)(`button`,{type:`button`,className:me,title:i.pin,"aria-label":i.pin,onClick:()=>u(`pin`),children:(0,Q.jsx)(j,{className:`size-4`,strokeWidth:1.75})}),t[93]=S,t[94]=i.pin,t[95]=i.unpin,t[96]=u,t[97]=Te):Te=t[97];let X;t[98]===u?X=t[99]:(X=()=>u(`export`),t[98]=u,t[99]=X);let Ee;t[100]===Symbol.for(`react.memo_cache_sentinel`)?(Ee=(0,Q.jsx)(w,{className:`size-4`,strokeWidth:1.75}),t[100]=Ee):Ee=t[100];let De;t[101]!==i.export||t[102]!==X?(De=(0,Q.jsx)(`button`,{type:`button`,className:me,title:i.export,"aria-label":i.export,onClick:X,children:Ee}),t[101]=i.export,t[102]=X,t[103]=De):De=t[103];let Oe;t[104]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=L(me,`text-red-600 hover:bg-red-50 dark:text-red-400 dark:hover:bg-red-950/40`),t[104]=Oe):Oe=t[104];let Z;t[105]===u?Z=t[106]:(Z=()=>u(`delete`),t[105]=u,t[106]=Z);let Ne;t[107]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=(0,Q.jsx)(I,{className:`size-4`,strokeWidth:1.75}),t[107]=Ne):Ne=t[107];let Re;t[108]!==i.delete||t[109]!==Z?(Re=(0,Q.jsx)(`button`,{type:`button`,className:Oe,title:i.delete,"aria-label":i.delete,onClick:Z,children:Ne}),t[108]=i.delete,t[109]=Z,t[110]=Re):Re=t[110];let ze;t[111]!==Ce||t[112]!==we||t[113]!==Te||t[114]!==De||t[115]!==Re?(ze=(0,Q.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:Fe,onKeyDown:Pe,children:[Ce,we,Te,De,Re]}),t[111]=Ce,t[112]=we,t[113]=Te,t[114]=De,t[115]=Re,t[116]=ze):ze=t[116];let Be;return t[117]!==c||t[118]!==oe||t[119]!==Se||t[120]!==ze||t[121]!==P||t[122]!==F?(Be=(0,Q.jsxs)(`div`,{role:`button`,tabIndex:0,className:P,onClick:c,onKeyDown:F,children:[oe,Se,ze]}),t[117]=c,t[118]=oe,t[119]=Se,t[120]=ze,t[121]=P,t[122]=F,t[123]=Be):Be=t[123],Be}function Pe(e){return e.stopPropagation()}function Fe(e){return e.stopPropagation()}function Ie(e){return(0,Q.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 Le(e){return e.language}function Re(e,t){return e.routing?.agentId?.trim().toLowerCase()||t.trim().toLowerCase()||`main`}function ze(e,t){return t.find(t=>t.id===e)?.avatar}var Be={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 Ve(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function He(e,t,n,r=1/0){return typeof e==`number`&&Number.isFinite(e)&&e>=n&&e<=r?e:t}function Ue(e,t,n,r=1/0){return Number.isInteger(e)&&e>=n&&e<=r?e:t}function We(e){let t=Ve(e)?e:{},n=Ve(t.userContext)?t.userContext:{},r=Ve(n.contextPlanning)?n.contextPlanning:{},i=Ve(r.compaction)?r.compaction:{},a=Be,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:He(i.triggerThreshold,a.triggerThreshold,.1,.98),reserveTokens:Ue(i.reserveTokens,a.reserveTokens,1024),minMessagesBeforeCompact:Ue(i.minMessagesBeforeCompact,a.minMessagesBeforeCompact,2),keepRecentTokens:Ue(i.keepRecentTokens,a.keepRecentTokens,1e3),recentTurnsPreserve:Ue(i.recentTurnsPreserve,a.recentTurnsPreserve,1,12),summaryMaxTokens:Ue(i.summaryMaxTokens,a.summaryMaxTokens,256),summaryChunkTokens:Ue(i.summaryChunkTokens,a.summaryChunkTokens,1e3),summaryTimeoutMs:Ue(i.summaryTimeoutMs,a.summaryTimeoutMs,1e3,6e5),summaryRetries:Ue(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:Ue(i.minToolResultKeepChars,a.minToolResultKeepChars,200),maxActiveTranscriptBytes:Ue(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:Be,preserve:{...Be,triggerThreshold:.88,keepRecentTokens:32e3,recentTurnsPreserve:5,maxActiveTranscriptBytes:4e6},early:{...Be,triggerThreshold:.65,reserveTokens:12e3,minMessagesBeforeCompact:6,keepRecentTokens:12e3,recentTurnsPreserve:2}},Xe=q();function Ze(){return L(`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`,K,`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,ke.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,Q.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,Q.jsx)(Y,{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,Q.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,Q.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,ke.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=L(`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,Q.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,Q.jsx)(`span`,{className:`font-medium`,children:n}),t[8]=n,t[9]=d);let f;t[10]===r?f=t[11]:(f=(0,Q.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,Q.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,Q.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}=le(e),{data:i=[],isLoading:a}=ce(e?U:null,de,{revalidateOnFocus:!1}),o=(0,Z.useMemo)(()=>n?.payload?.config===void 0?null:We(n.payload.config),[n]),[c,u]=(0,Z.useReducer)(Xe,{form:null,baseline:null}),[d,f]=(0,Z.useState)(``),p=(0,Z.useRef)(!1),m=(0,Z.useRef)(c.form);m.current=c.form;let h=(0,Z.useRef)(null);ve({enabled:e,parsed:o,dirty:p.current,trackedParsedRef:h,dispatch:u,onResetDirty:()=>{p.current=!1}});let g=c.form,_=c.baseline,v=!!(g&&_&&JSON.stringify(g)!==JSON.stringify(_)),y=(0,Z.useCallback)(e=>{p.current=!0,u({type:`patch`,patch:e})},[]),b=(0,Z.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]),x=De({value:g,dirty:v,onSave:(0,Z.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}}`,b(n)):null}});if(!e||!g)return r?(0,Q.jsx)(X,{children:(0,Q.jsxs)(`div`,{className:`space-y-3`,"aria-busy":!0,children:[(0,Q.jsx)(R,{className:`h-5 w-48`}),(0,Q.jsx)(R,{className:`h-20 w-full rounded-xl`}),(0,Q.jsx)(R,{className:`h-36 w-full rounded-xl`})]})}):null;let S=$e(g),C=Math.max(0,Je-g.reserveTokens),ee=Math.min(Math.floor(Je*g.triggerThreshold),C),w=Math.min(100,ee/Je*100),T=Math.min(100,C/Je*100),E=g.model?i.find(e=>e.id===g.model):void 0,D=E?.contextWindow&&g.summaryChunkTokens+g.summaryMaxTokens+4096>E.contextWindow,O=g.keepRecentTokens+g.reserveTokens>ee,A=Math.round(g.summaryTimeoutMs*(g.summaryRetries+1)/1e3),j=e=>{let t=Ye[e];y({...t,...g.model?{model:g.model}:{model:void 0},postCompactionSections:g.postCompactionSections})},M={balanced:{title:t.presetBalanced,hint:t.presetBalancedHint},preserve:{title:t.presetPreserve,hint:t.presetPreserveHint},early:{title:t.presetEarly,hint:t.presetEarlyHint}},P=()=>{let e=d.trim();!e||g.postCompactionSections.includes(e)||g.postCompactionSections.length>=12||(y({postCompactionSections:[...g.postCompactionSections,e]}),f(``))};return(0,Q.jsxs)(X,{onBlurCapture:x.onBlurCapture,children:[(0,Q.jsx)(Te,{icon:k,title:t.title,subtitle:t.hint,trailing:(0,Q.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Q.jsx)(Ee,{status:x.status,error:x.error}),(0,Q.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2 text-sm font-medium text-fg`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:g.enabled,onChange:e=>y({enabled:e.target.checked})}),g.enabled?t.enabled:t.disabled]})]})}),x.error?(0,Q.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:x.error}):null,g.enabled?null:(0,Q.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,Q.jsxs)(`fieldset`,{disabled:!g.enabled,className:`space-y-5 disabled:opacity-60`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:t.presetTitle}),(0,Q.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-subtle`,children:t.presetHint})]}),S===`custom`?(0,Q.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2 py-1 text-[11px] font-medium text-fg-muted`,children:t.presetCustom}):null]}),(0,Q.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-3`,children:[`balanced`,`preserve`,`early`].map(e=>(0,Q.jsxs)(`button`,{type:`button`,"aria-pressed":S===e,className:L(`rounded-xl bg-surface-base/55 px-3 py-3 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,G.transition,G.focusRingPanel,S===e?`bg-accent-soft text-accent-fg shadow-surface`:`text-fg hover:bg-surface-hover`),onClick:()=>j(e),children:[(0,Q.jsx)(`span`,{className:`block text-sm font-medium`,children:M[e].title}),(0,Q.jsx)(`span`,{className:`mt-1 block text-xs text-fg-muted`,children:M[e].hint})]},e))})]}),(0,Q.jsxs)(J,{title:t.advancedTitle,summary:S===`custom`?t.presetCustom:t.presetHint,children:[(0,Q.jsxs)(`div`,{className:`rounded-xl bg-surface-base/45 p-4`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:t.budgetPreview}),(0,Q.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-subtle`,children:t.budgetPreviewHint})]}),(0,Q.jsx)(`span`,{className:`rounded-full bg-surface-panel px-2.5 py-1 font-mono text-xs text-fg-muted`,children:t.previewModel128k})]}),(0,Q.jsxs)(`div`,{className:`mt-4 space-y-3`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`div`,{className:`mb-1 flex justify-between gap-3 text-xs text-fg-muted`,children:[(0,Q.jsx)(`span`,{children:t.compactionTrigger}),(0,Q.jsx)(`span`,{className:`font-mono text-fg`,children:et(ee)})]}),(0,Q.jsx)(`div`,{className:`h-2 overflow-hidden rounded-full bg-surface-active`,children:(0,Q.jsx)(`div`,{className:`h-full rounded-full bg-accent`,style:{width:`${w}%`}})})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`div`,{className:`mb-1 flex justify-between gap-3 text-xs text-fg-muted`,children:[(0,Q.jsx)(`span`,{children:t.hardInputLimit}),(0,Q.jsx)(`span`,{className:`font-mono text-fg`,children:et(C)})]}),(0,Q.jsx)(`div`,{className:`h-2 overflow-hidden rounded-full bg-surface-active`,children:(0,Q.jsx)(`div`,{className:`h-full rounded-full bg-fg-subtle`,style:{width:`${T}%`}})})]})]}),(0,Q.jsx)(`p`,{className:`mt-3 text-xs text-fg-subtle`,children:t.budgetFormula})]}),(0,Q.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,Q.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=>y({triggerThreshold:e/100})}),(0,Q.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=>y({reserveTokens:Math.floor(e)})}),(0,Q.jsx)($,{id:`compaction-recent-turns`,label:t.recentTurnsPreserve,hint:t.recentTurnsPreserveHint,value:g.recentTurnsPreserve,min:1,max:12,onChange:e=>y({recentTurnsPreserve:Math.floor(e)})}),(0,Q.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=>y({keepRecentTokens:Math.floor(e)})})]}),O?(0,Q.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,Q.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`label`,{className:`mb-1 block text-sm font-medium text-fg`,children:t.summaryModel}),(0,Q.jsxs)(`div`,{className:`flex min-w-0 gap-2`,children:[(0,Q.jsx)(be,{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=>y({model:e})}),g.model?(0,Q.jsx)(W,{type:`button`,variant:`secondary`,onClick:()=>y({model:void 0}),children:t.summaryModelUseSession}):null]}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:t.summaryModelHint})]}),(0,Q.jsx)(tt,{label:t.qualityGuard,hint:t.qualityGuardHint,checked:g.qualityGuard,onChange:e=>y({qualityGuard:e})}),(0,Q.jsx)(tt,{label:t.gapAudit,hint:t.gapAuditHint,checked:g.gapAudit,onChange:e=>y({gapAudit:e})})]}),g.qualityGuard?null:(0,Q.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,Q.jsx)(Oe,{children:(0,Q.jsxs)(`div`,{className:`space-y-5 rounded-xl bg-surface-base/45 p-4`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:t.advancedTitle}),(0,Q.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-subtle`,children:t.advancedHint})]}),(0,Q.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,Q.jsx)($,{id:`compaction-min-messages`,label:t.minMessagesBeforeCompact,hint:t.minMessagesBeforeCompactHint,value:g.minMessagesBeforeCompact,min:2,onChange:e=>y({minMessagesBeforeCompact:Math.floor(e)})}),(0,Q.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=>y({maxActiveTranscriptBytes:Math.max(64e3,Math.round(e*1e6))})}),(0,Q.jsx)($,{id:`compaction-summary-max-tokens`,label:t.summaryMaxTokens,hint:t.summaryMaxTokensHint,value:g.summaryMaxTokens,min:256,step:256,onChange:e=>y({summaryMaxTokens:Math.floor(e)})}),(0,Q.jsx)($,{id:`compaction-summary-chunk-tokens`,label:t.summaryChunkTokens,hint:t.summaryChunkTokensHint,value:g.summaryChunkTokens,min:1e3,step:1e3,onChange:e=>y({summaryChunkTokens:Math.floor(e)})}),(0,Q.jsx)($,{id:`compaction-summary-timeout`,label:t.summaryTimeoutSeconds,hint:t.summaryTimeoutSecondsHint.replace(`{{seconds}}`,String(A)),value:g.summaryTimeoutMs/1e3,min:1,max:600,onChange:e=>y({summaryTimeoutMs:Math.round(e*1e3)})}),(0,Q.jsx)($,{id:`compaction-summary-retries`,label:t.summaryRetries,hint:t.summaryRetriesHint,value:g.summaryRetries,min:0,max:5,onChange:e=>y({summaryRetries:Math.floor(e)})}),(0,Q.jsx)($,{id:`compaction-min-tool-result-chars`,label:t.minToolResultKeepChars,hint:t.minToolResultKeepCharsHint,value:g.minToolResultKeepChars,min:200,step:100,onChange:e=>y({minToolResultKeepChars:Math.floor(e)})})]}),D?(0,Q.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,Q.jsxs)(`div`,{className:`rounded-xl bg-surface-base/45 p-4`,children:[(0,Q.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:t.postCompactionSections}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:t.postCompactionSectionsHint}),g.postCompactionSections.length>0?(0,Q.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:g.postCompactionSections.map(e=>(0,Q.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,Q.jsx)(`button`,{type:`button`,className:L(`text-fg-muted hover:text-fg`,G.press),"aria-label":t.removeSection.replace(`{{section}}`,e),onClick:()=>y({postCompactionSections:g.postCompactionSections.filter(t=>t!==e)}),children:(0,Q.jsx)(te,{className:`size-3.5`,"aria-hidden":!0})})]},e))}):(0,Q.jsx)(`p`,{className:`mt-3 text-xs text-fg-muted`,children:t.postCompactionSectionsEmpty}),(0,Q.jsxs)(`div`,{className:`mt-3 flex gap-2`,children:[(0,Q.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(),P())}}),(0,Q.jsxs)(W,{type:`button`,variant:`secondary`,disabled:!d.trim()||g.postCompactionSections.length>=12,onClick:P,children:[(0,Q.jsx)(N,{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 L(`w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg`,K,`dark:border-edge`)}var ct=q();function lt({hasToken:e}){let t=l(s(e=>e.language)).sessions.config,{data:n,isLoading:r}=le(e),i=(0,Z.useMemo)(()=>n?.payload?.config===void 0?null:at(n.payload.config),[n]),[a,o]=(0,Z.useReducer)(ct,{form:null,baseline:null}),c=a.form,u=a.baseline,d=(0,Z.useRef)(!1),f=(0,Z.useRef)(c);f.current=c;let p=(0,Z.useRef)(null);ve({enabled:e,parsed:i,dirty:d.current,trackedParsedRef:p,dispatch:o,onResetDirty:()=>{d.current=!1}});let m=!!(c&&u&&JSON.stringify(c)!==JSON.stringify(u)),h=(0,Z.useCallback)(e=>{d.current=!0,o({type:`patch`,patch:e})},[]),g=De({value:c,dirty:m,onSave:(0,Z.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,Q.jsx)(X,{children:(0,Q.jsxs)(`div`,{className:`space-y-3`,"aria-busy":!0,children:[(0,Q.jsx)(R,{className:`h-5 w-40`}),(0,Q.jsx)(R,{className:`h-24 w-full rounded-xl`})]})}):null:(0,Q.jsxs)(X,{onBlurCapture:g.onBlurCapture,children:[(0,Q.jsx)(Te,{icon:ee,title:t.title,subtitle:t.hint,trailing:(0,Q.jsx)(Ee,{status:g.status,error:g.error})}),(0,Q.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,Q.jsx)(J,{title:t.dmScope,summary:c.dmScope,children:(0,Q.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,Q.jsx)(`label`,{className:`mb-1 block text-sm font-medium text-fg`,children:t.dmScope}),(0,Q.jsxs)(b,{className:st(),value:c.dmScope,onChange:e=>h({dmScope:e.target.value}),children:[(0,Q.jsx)(x,{value:`main`,children:t.dmScopeMain}),(0,Q.jsx)(x,{value:`per-peer`,children:t.dmScopePerPeer}),(0,Q.jsx)(x,{value:`per-channel-peer`,children:t.dmScopePerChannelPeer}),(0,Q.jsx)(x,{value:`per-account-channel-peer`,children:t.dmScopePerAccountChannelPeer})]}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:t.dmScopeHint})]})}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`label`,{className:`mb-1 block text-sm font-medium text-fg`,children:t.pruneAfterDays}),(0,Q.jsx)(Y,{allowEmpty:!0,type:`number`,min:0,className:st(),value:c.pruneAfterDays??``,placeholder:t.unsetPlaceholder,onChange:e=>{let t=e.target.value.trim();h({pruneAfterDays:t===``?null:Math.max(0,Math.floor(Number(t)||0))})}})]}),(0,Q.jsx)(J,{title:t.maxEntries,summary:c.maxEntries??t.unsetPlaceholder,children:(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`label`,{className:`mb-1 block text-sm font-medium text-fg`,children:t.maxEntries}),(0,Q.jsx)(Y,{allowEmpty:!0,type:`number`,min:1,className:st(),value:c.maxEntries??``,placeholder:t.unsetPlaceholder,onChange:e=>{let t=e.target.value.trim();h({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,ke.c)(60),{open:n,loading:r,session:i,sessionAgentId:a,sessionAgentAvatar:o,labels:s,onClose:c,onArchive:l,onUnarchive:g,onPin:_,onUnpin:v,onExport:y,onDelete:b}=e,x=i?.status===`archived`,S=i?.status===`pinned`,C;t[0]===c?C=t[1]:(C=e=>!e&&c(),t[0]=c,t[1]=C);let ee;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,Q.jsx)(u,{className:L(`xopc-dialog-overlay fixed inset-0 bg-scrim`,pe)}),t[2]=ee):ee=t[2];let w;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(w=L(`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`,fe,`dark:border-edge`),t[3]=w):w=t[3];let T;t[4]!==i||t[5]!==o||t[6]!==a?(T=i&&a?(0,Q.jsx)(ge,{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]=T):T=t[7];let E;t[8]!==s.unnamedSession||t[9]!==i?.name?(E=i?.name?.trim()||s.unnamedSession,t[8]=s.unnamedSession,t[9]=i?.name,t[10]=E):E=t[10];let D;t[11]===E?D=t[12]:(D=(0,Q.jsx)(m,{className:`min-w-0 flex-1 truncate text-base font-semibold tracking-tight text-fg`,children:E}),t[11]=E,t[12]=D);let O;t[13]!==T||t[14]!==D?(O=(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3`,children:[T,D]}),t[13]=T,t[14]=D,t[15]=O):O=t[15];let k;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,Q.jsx)(te,{className:`size-5`,strokeWidth:1.75}),t[16]=k):k=t[16];let A;t[17]===s.close?A=t[18]:(A=(0,Q.jsx)(d,{asChild:!0,children:(0,Q.jsx)(W,{type:`button`,variant:`ghost`,className:`size-9 shrink-0 p-0`,"aria-label":s.close,children:k})}),t[17]=s.close,t[18]=A);let j;t[19]!==O||t[20]!==A?(j=(0,Q.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:[O,A]}),t[19]=O,t[20]=A,t[21]=j):j=t[21];let M;t[22]!==s.detailLoading||t[23]!==s.detailMessages||t[24]!==r||t[25]!==i?(M=r?(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:s.detailLoading}):i?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`dl`,{className:`mb-4 grid gap-2 text-xs text-fg-muted`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`dt`,{className:`text-fg-disabled`,children:`Key`}),(0,Q.jsx)(`dd`,{className:`mt-0.5 break-all font-mono text-fg`,children:i.key})]}),(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-4`,children:(0,Q.jsxs)(`span`,{children:[i.messageCount,` msgs · `,i.estimatedTokens,` tok`]})})]}),(0,Q.jsx)(`h3`,{className:`mb-2 text-xs font-medium uppercase tracking-wide text-fg-subtle`,children:s.detailMessages}),(0,Q.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]=M):M=t[26];let N;t[27]===M?N=t[28]:(N=(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-3`,children:M}),t[27]=M,t[28]=N);let P;t[29]!==s.detailExport||t[30]!==y?(P=(0,Q.jsx)(W,{type:`button`,variant:`secondary`,className:`text-sm`,onClick:y,children:s.detailExport}),t[29]=s.detailExport,t[30]=y,t[31]=P):P=t[31];let F;t[32]!==x||t[33]!==s.archive||t[34]!==s.unarchive||t[35]!==l||t[36]!==g?(F=x?(0,Q.jsx)(W,{type:`button`,variant:`secondary`,className:`text-sm`,onClick:g,children:s.unarchive}):(0,Q.jsx)(W,{type:`button`,variant:`secondary`,className:`text-sm`,onClick:l,children:s.archive}),t[32]=x,t[33]=s.archive,t[34]=s.unarchive,t[35]=l,t[36]=g,t[37]=F):F=t[37];let I;t[38]!==S||t[39]!==s.pin||t[40]!==s.unpin||t[41]!==_||t[42]!==v?(I=S?(0,Q.jsx)(W,{type:`button`,variant:`secondary`,className:`text-sm`,onClick:v,children:s.unpin}):(0,Q.jsx)(W,{type:`button`,variant:`secondary`,className:`text-sm`,onClick:_,children:s.pin}),t[38]=S,t[39]=s.pin,t[40]=s.unpin,t[41]=_,t[42]=v,t[43]=I):I=t[43];let R;t[44]!==s.delete||t[45]!==b?(R=(0,Q.jsx)(W,{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:b,children:s.delete}),t[44]=s.delete,t[45]=b,t[46]=R):R=t[46];let z;t[47]!==P||t[48]!==F||t[49]!==I||t[50]!==R?(z=(0,Q.jsx)(`div`,{className:`shrink-0 border-t border-edge px-4 py-3 dark:border-edge`,children:(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[P,F,I,R]})}),t[47]=P,t[48]=F,t[49]=I,t[50]=R,t[51]=z):z=t[51];let B;t[52]!==j||t[53]!==N||t[54]!==z?(B=(0,Q.jsxs)(f,{children:[ee,(0,Q.jsxs)(p,{className:w,"aria-describedby":void 0,children:[j,N,z]})]}),t[52]=j,t[53]=N,t[54]=z,t[55]=B):B=t[55];let V;return t[56]!==n||t[57]!==C||t[58]!==B?(V=(0,Q.jsx)(h,{open:n,onOpenChange:C,children:B}),t[56]=n,t[57]=C,t[58]=B,t[59]=V):V=t[59],V}function ft(e){return(0,Q.jsxs)(`li`,{className:`rounded-lg border border-edge-subtle bg-surface-hover/50 p-2 dark:border-edge`,children:[(0,Q.jsx)(`div`,{className:`mb-1 text-[10px] font-medium uppercase text-fg-subtle`,children:e.role}),(0,Q.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,ke.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`?E:F})),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,Q.jsx)(he,{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,ke.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,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`mb-5`,children:[(0,Q.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:yt(n,r)}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:bt(n,r)})]}),(0,Q.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,Q.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}=ce(r?[`gateway-chat-agents`,n]:null,ue,{revalidateOnFocus:!1}),d=a?.defaultId??`main`,_=a?.items??[],[v,b]=i(),x=vt(v.get(`tab`)),C=(0,Z.useCallback)(e=>{let t=new URLSearchParams(v);e===`sessions`?t.delete(`tab`):t.set(`tab`,e),b(t,{replace:!0})},[v,b]),[ee,w]=(0,Z.useReducer)(ye,v,Ct),{searchInput:O,debouncedSearch:k,statusFilter:A,viewMode:M,channelFilter:N,sessions:F,loading:I,error:te,hasMore:R,stats:H,detailOpen:le,detailLoading:de,detailSession:U,confirmOpen:me,confirmKey:K}=ee;(0,Z.useEffect)(()=>{let e=setTimeout(()=>{let e=O.trim();k!==e&&w({type:`patch`,patch:{debouncedSearch:e}})},300);return()=>clearTimeout(e)},[O,k]);let he=v.toString(),ge=(0,Z.useRef)(he);if(ge.current!==he){ge.current=he;let e=v.get(`q`)??``,t=v.get(`status`),n=v.get(`view`),r=(v.get(`channel`)??``).trim(),i=ht.has(t)?t:`all`,a=gt.has(n)?n:`grid`,o=e.trim();w({type:`patch`,patch:{...O===e?{}:{searchInput:e},...k===o?{}:{debouncedSearch:o},...A===i?{}:{statusFilter:i},...M===a?{}:{viewMode:a},...N===r?{}:{channelFilter:r}}})}(0,Z.useEffect)(()=>{let e=new URLSearchParams(v),t=k.trim();t?e.set(`q`,t):e.delete(`q`),A===`all`?e.delete(`status`):e.set(`status`,A),M===`grid`?e.delete(`view`):e.set(`view`,M),N?e.set(`channel`,N):e.delete(`channel`),e.toString()!==v.toString()&&b(e,{replace:!0})},[k,v,b,A,M,N]),(0,Z.useEffect)(()=>{if(!r||x!==`sessions`)return;let e=!1;return(async()=>{w({type:`patch`,patch:{loading:!0,error:null}});try{let t=await oe({limit:pt,offset:0,...k?{search:k}:{},...A===`all`?{}:{status:A},...N?{channel:N}:{}});if(e)return;w({type:`patch`,patch:{sessions:t.items,hasMore:t.hasMore}})}catch(n){e||w({type:`patch`,patch:{error:n instanceof Error?n.message:t.loadError}})}finally{e||w({type:`patch`,patch:{loading:!1}})}})(),()=>{e=!0}},[r,x,k,A,N,t.loadError]),(0,Z.useEffect)(()=>{!r||x!==`sessions`||re().then(e=>w({type:`patch`,patch:{stats:e}})).catch(()=>{})},[r,x]),(0,Z.useEffect)(()=>{if(!r||x!==`sessions`)return;let e=()=>void c();return window.addEventListener(`config-reload`,e),()=>window.removeEventListener(`config-reload`,e)},[r,x,c]),(0,Z.useEffect)(()=>{if(!r||x!==`sessions`)return;let e=e=>{let t=e.detail;!t?.key||t.name===void 0||w({type:`patch`,patch:{sessions:F.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,x,F,U]);let ve=(0,Z.useCallback)(async()=>{if(!(!r||I||!R)){w({type:`patch`,patch:{loading:!0,error:null}});try{let e=await oe({limit:pt,offset:F.length,...k?{search:k}:{},...A===`all`?{}:{status:A},...N?{channel:N}:{}});w({type:`patch`,patch:{sessions:[...F,...e.items],hasMore:e.hasMore}})}catch(e){w({type:`patch`,patch:{error:e instanceof Error?e.message:t.loadError}})}finally{w({type:`patch`,patch:{loading:!1}})}}},[r,I,R,F.length,k,A,N,t.loadError]),q=(0,Z.useCallback)((e,t)=>{w({type:`patch`,patch:{sessions:F.map(n=>n.key===e?{...n,status:t}:n),detailSession:U&&U.key===e?{...U,status:t}:U}})},[F,U]),be=(0,Z.useCallback)(async e=>{w({type:`patch`,patch:{detailOpen:!0,detailLoading:!0,detailSession:null}});try{let t=await z(e);w({type:`patch`,patch:{detailSession:t}})}catch{w({type:`patch`,patch:{detailOpen:!1}})}finally{w({type:`patch`,patch:{detailLoading:!1}})}},[]),J=e=>{be(e)},Y=async(e,t)=>{if(t===`continue`){window.dispatchEvent(new CustomEvent(`navigate-to-chat`,{detail:{conversationId:e},bubbles:!0}));return}if(t===`delete`){w({type:`patch`,patch:{confirmKey:e,confirmOpen:!0}});return}try{switch(t){case`archive`:await se(e),q(e,`archived`);break;case`unarchive`:await V(e),q(e,`active`);break;case`pin`:await B(e),q(e,`pinned`);break;case`unpin`:await ie(e),q(e,`active`);break;case`export`:{let t=await ae(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}re().then(e=>w({type:`patch`,patch:{stats:e}})).catch(()=>{})}catch{}},Te=async e=>{try{await ne(e),w({type:`patch`,patch:{sessions:F.filter(t=>t.key!==e),detailSession:U?.key===e?null:U,...U?.key===e?{detailOpen:!1}:{}}}),re().then(e=>w({type:`patch`,patch:{stats:e}})).catch(()=>{})}catch{}},X={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},Ee={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},De=[{key:`all`,label:t.filterAll,icon:E},{key:`active`,label:t.filterActive,icon:S},{key:`pinned`,label:t.filterPinned,icon:j},{key:`archived`,label:t.filterArchived,icon:y}],Oe=(()=>{let e=Object.entries(H?.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,Q.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-x-hidden bg-surface-panel`,children:[(0,Q.jsxs)(Ce,{gap:`gap-6`,children:[(0,Q.jsx)(we,{title:t.title}),(0,Q.jsx)(xt,{s:t,activeTab:x,onChange:C}),(0,Q.jsx)(St,{s:t,id:`settings`,activeTab:x,plain:!0,children:(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsx)(nt,{hasToken:r}),(0,Q.jsx)(lt,{hasToken:r})]})}),(0,Q.jsxs)(St,{s:t,id:`sessions`,activeTab:x,plain:!0,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between`,children:[(0,Q.jsx)(_e,{className:`flex flex-wrap gap-2`,role:`group`,"aria-label":t.tabsSessions,indicatorClassName:`rounded-xl bg-accent-soft`,children:De.map(({key:e,label:t,icon:n})=>(0,Q.jsxs)(`button`,{type:`button`,"aria-pressed":A===e,onClick:()=>w({type:`patch`,patch:{statusFilter:e}}),className:L(`inline-flex items-center gap-1.5 rounded-xl px-3 py-2 text-sm font-medium`,G.transition,G.focusRingPanel,A===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,Q.jsx)(n,{className:`size-4`,strokeWidth:1.75,"aria-hidden":!0}),t]},e))}),(0,Q.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,Q.jsx)(P,{className:`size-4 shrink-0 text-fg-disabled`,strokeWidth:1.75,"aria-hidden":!0}),(0,Q.jsx)(`input`,{type:`search`,value:O,onChange:e=>w({type:`patch`,patch:{searchInput:e.target.value}}),placeholder:t.searchPlaceholder,"aria-label":t.searchPlaceholder,"data-debounced-query":k||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,Q.jsxs)(_e,{className:`flex flex-wrap items-center gap-2`,role:`group`,"aria-label":t.filterChannelLabel,indicatorClassName:`rounded-xl bg-accent-soft`,children:[(0,Q.jsx)(`span`,{className:`text-xs font-medium text-fg-subtle`,children:t.filterChannelLabel}),(0,Q.jsx)(`button`,{type:`button`,"aria-pressed":!N,onClick:()=>w({type:`patch`,patch:{channelFilter:``}}),className:L(`touch-target inline-flex items-center rounded-xl px-3 py-2 text-sm font-medium`,G.transition,G.focusRingPanel,N?`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}),Oe.map(e=>(0,Q.jsxs)(`button`,{type:`button`,"aria-pressed":N===e,onClick:()=>w({type:`patch`,patch:{channelFilter:e}}),className:L(`touch-target inline-flex items-center rounded-xl px-3 py-2 text-sm font-medium`,G.transition,G.focusRingPanel,N===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,H?.byChannel?.[e]==null?null:(0,Q.jsx)(`span`,{className:`ml-2 rounded-full bg-surface-hover px-2 py-0.5 text-[11px] text-fg-subtle`,children:H.byChannel[e]})]},e))]}),H?(0,Q.jsx)(`div`,{className:`grid grid-cols-2 gap-3 sm:grid-cols-4`,children:[[H.totalSessions,t.totalSessions],[H.activeSessions,t.activeSessions],[H.pinnedSessions,t.pinnedSessions],[H.archivedSessions,t.archivedSessions]].map(([e,t])=>(0,Q.jsxs)(`div`,{className:`rounded-xl bg-surface-base p-3 dark:bg-surface-hover/30`,children:[(0,Q.jsx)(`div`,{className:`text-lg font-semibold tabular-nums text-fg`,children:e}),(0,Q.jsx)(`div`,{className:`text-xs text-fg-muted`,children:t})]},t))}):null,te?(0,Q.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:te}):null,(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:mt(t.sessionCount,{count:F.length})}),(0,Q.jsxs)(_e,{className:Se,role:`group`,"aria-label":t.layoutToggleGroup,indicatorClassName:`rounded-pill bg-surface-panel shadow-sm dark:ring-1 dark:ring-edge-strong/40`,children:[(0,Q.jsx)(W,{type:`button`,variant:`segmented`,title:t.gridView,"aria-pressed":M===`grid`,onClick:()=>w({type:`patch`,patch:{viewMode:`grid`}}),className:L(xe,`size-7 p-0`,M===`grid`&&`bg-surface-panel shadow-sm dark:bg-surface-panel dark:shadow-sm dark:ring-1 dark:ring-edge-strong/40`,M===`grid`&&`text-accent-fg`),children:(0,Q.jsx)(D,{className:`size-3.5`,strokeWidth:1.5})}),(0,Q.jsx)(W,{type:`button`,variant:`segmented`,title:t.listView,"aria-pressed":M===`list`,onClick:()=>w({type:`patch`,patch:{viewMode:`list`}}),className:L(xe,`size-9 p-0`,M===`list`&&`bg-surface-panel shadow-sm dark:bg-surface-panel dark:shadow-sm dark:ring-1 dark:ring-edge-strong/40`,M===`list`&&`text-accent-fg`),children:(0,Q.jsx)(g,{className:`size-3.5`,strokeWidth:1.5})})]})]}),I&&F.length===0?(0,Q.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,Q.jsx)(`div`,{className:`h-40 animate-pulse rounded-xl bg-surface-hover/60 dark:bg-surface-hover/40`},t))}):F.length===0?(0,Q.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,Q.jsx)(T,{className:`mb-3 size-12 text-fg-disabled`,strokeWidth:1.25,"aria-hidden":!0}),(0,Q.jsx)(`p`,{className:`text-base font-semibold text-fg`,children:t.noSessions}),(0,Q.jsx)(`p`,{className:`mt-1 max-w-sm text-sm text-fg-muted`,children:t.noSessionsDescription}),(0,Q.jsx)(W,{variant:`primary`,className:`mt-6`,onClick:()=>{window.dispatchEvent(new CustomEvent(`navigate-to-chat`,{detail:{conversationId:``},bubbles:!0}))},children:t.startNewChat})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:L(`grid min-w-0 gap-3`,M===`grid`?`sm:grid-cols-2 lg:grid-cols-3`:`grid-cols-1`),"data-debounced-query":k||void 0,children:F.map(e=>{let t=Re(e,d);return(0,Q.jsx)(Ne,{session:e,variant:M,labels:X,sessionAgentId:t,sessionAgentAvatar:ze(t,_),onOpen:()=>J(e.key),onAction:t=>void Y(e.key,t)},e.key)})}),R?(0,Q.jsx)(`div`,{className:`flex justify-center pt-2`,children:(0,Q.jsx)(W,{type:`button`,variant:`secondary`,disabled:I,onClick:()=>void ve(),children:t.loadMore})}):null]})]})]}),(0,Q.jsx)(dt,{open:le,loading:de,session:U,sessionAgentId:U?Re(U,d):void 0,sessionAgentAvatar:U?ze(Re(U,d),_):void 0,labels:Ee,onClose:()=>{w({type:`patch`,patch:{detailOpen:!1,detailSession:null}})},onArchive:()=>U&&void Y(U.key,`archive`),onUnarchive:()=>U&&void Y(U.key,`unarchive`),onPin:()=>U&&void Y(U.key,`pin`),onUnpin:()=>U&&void Y(U.key,`unpin`),onExport:()=>U&&void Y(U.key,`export`),onDelete:()=>U&&w({type:`patch`,patch:{confirmKey:U.key,confirmOpen:!0}})}),(0,Q.jsx)(h,{open:me,onOpenChange:e=>w({type:`patch`,patch:{confirmOpen:e}}),children:(0,Q.jsxs)(f,{children:[(0,Q.jsx)(u,{className:L(`xopc-dialog-overlay fixed inset-0 bg-scrim`,pe)}),(0,Q.jsxs)(p,{className:L(`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`,fe),children:[(0,Q.jsx)(m,{className:`text-base font-semibold text-fg`,children:t.deleteSessionTitle}),(0,Q.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:K?mt(t.deleteSessionMessage,{name:F.find(e=>e.key===K)?.name?.trim()||e.chat.newSession}):``}),(0,Q.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[(0,Q.jsx)(W,{type:`button`,variant:`secondary`,onClick:()=>w({type:`patch`,patch:{confirmOpen:!1}}),children:t.cancel}),(0,Q.jsx)(W,{type:`button`,variant:`primary`,className:`bg-red-600 hover:bg-red-700`,onClick:()=>{K&&Te(K),w({type:`patch`,patch:{confirmOpen:!1,confirmKey:null}})},children:t.delete})]})]})]})})]}):(0,Q.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};