pisper 0.6.27 → 0.6.28

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 (169) hide show
  1. package/package.json +6 -6
  2. package/web/.vite/manifest.json +825 -665
  3. package/web/assets/{AppDialog-BSwETcOe.js → AppDialog-Cjnspn8J.js} +1 -1
  4. package/web/assets/{AppOverlays-_EStnaiK.js → AppOverlays-ielr5J2J.js} +1 -1
  5. package/web/assets/AssetsPage-BC1mYvQw.js +1 -0
  6. package/web/assets/BoardPage-BS3oBeRU.js +3 -0
  7. package/web/assets/{ChannelsPage-BlTQXqjl.js → ChannelsPage-DOysYIcY.js} +1 -1
  8. package/web/assets/{ChatAppearancePage-DzAq4wj8.js → ChatAppearancePage-DqNJD2hC.js} +1 -1
  9. package/web/assets/{ChatHistoryPage-B4v3MEb8.js → ChatHistoryPage-DcTFMdWO.js} +1 -1
  10. package/web/assets/ChatPage-DaKslieG.js +553 -0
  11. package/web/assets/ConfigPage-Cg93xSDY.js +7 -0
  12. package/web/assets/{DesktopWindowControls-gaFTmZN5.js → DesktopWindowControls-Zz88RwFF.js} +1 -1
  13. package/web/assets/{FeaturePage-IWVjXcVp.js → FeaturePage-bqByIxYg.js} +1 -1
  14. package/web/assets/{FileAttachmentPreview-DxwMjwfS.js → FileAttachmentPreview-Dc92kq62.js} +1 -1
  15. package/web/assets/{FloatingWidgets-D8VLtEFT.js → FloatingWidgets-CwJuWUMz.js} +1 -1
  16. package/web/assets/FocusRuntimeControls-huHLWDdy.js +1 -0
  17. package/web/assets/{GitDiffViewer-CEMK-4P4.js → GitDiffViewer-b4QqrnGx.js} +1 -1
  18. package/web/assets/{ManageProjectsDialog-BxB9J7IY.js → ManageProjectsDialog-DpwUwosB.js} +1 -1
  19. package/web/assets/{MarkdownMessage-gnw-y810.js → MarkdownMessage-BEmTlPSn.js} +1 -1
  20. package/web/assets/McpPage-COTq4Jjj.js +1 -0
  21. package/web/assets/{MemoryEvolution-DG9gtC6n.js → MemoryEvolution-CNi44VEB.js} +1 -1
  22. package/web/assets/MemoryPage-fUDrPE_v.js +2 -0
  23. package/web/assets/{MobileNavigation-Chysgboq.js → MobileNavigation-BvCRGO5c.js} +1 -1
  24. package/web/assets/MorePage-BuKQ5rBF.js +1 -0
  25. package/web/assets/NewFolderDialog-Btk5x-Ar.js +1 -0
  26. package/web/assets/{PageHeader-DK5D_R5_.js → PageHeader-BjhZ50ed.js} +1 -1
  27. package/web/assets/{PhoneDrawer-BbjnEawt.js → PhoneDrawer-Cs-ka4ZZ.js} +1 -1
  28. package/web/assets/{PhoneMenuButton-mlilY9bo.js → PhoneMenuButton-CTlyYTpl.js} +1 -1
  29. package/web/assets/{PhoneTopBar-CEnUC7MQ.js → PhoneTopBar-Cx2DM1ne.js} +1 -1
  30. package/web/assets/PluginsPage-B9Xlbo-c.js +1 -0
  31. package/web/assets/{SafeModePrompt-CalnTUf0.js → SafeModePrompt-BCrBZdI6.js} +1 -1
  32. package/web/assets/{SchedulesPage-CgHGU15C.js → SchedulesPage-Eh7MyRAr.js} +1 -1
  33. package/web/assets/SessionBrowserPane-Zeec5cZP.js +2 -0
  34. package/web/assets/SessionContextPanel-CVKmX-do.js +2 -0
  35. package/web/assets/{SessionHome-DVWSDkiq.js → SessionHome-CJR_Ufgl.js} +1 -1
  36. package/web/assets/SessionInspector-D5tmy63H.js +1 -0
  37. package/web/assets/{SessionShell-McHYcUMD.js → SessionShell-w3sKK33I.js} +1 -1
  38. package/web/assets/{SettingsSidebar-B6B_0bT6.js → SettingsSidebar-CseRAdbZ.js} +1 -1
  39. package/web/assets/{ShortcutHelpDialog-BuPN71vl.js → ShortcutHelpDialog-R4Gx-9DQ.js} +1 -1
  40. package/web/assets/{ShortcutKeys-DNpsGYcw.js → ShortcutKeys-DksC1OkE.js} +1 -1
  41. package/web/assets/{SidebarUpdateStatus-B9E-HRrS.js → SidebarUpdateStatus-BCd1eq_6.js} +1 -1
  42. package/web/assets/{SkillsPage-Ffz15Nmx.js → SkillsPage-Bn2y_EfT.js} +1 -1
  43. package/web/assets/{TaskProcessesPane-ML4UTyA9.js → TaskProcessesPane-FwGhuWob.js} +1 -1
  44. package/web/assets/{TaskTerminalView-CEWghfPZ.js → TaskTerminalView-Cd4PIsW7.js} +1 -1
  45. package/web/assets/{TerminalPanel-Dq1eeEaE.js → TerminalPanel-48zgvDnP.js} +1 -1
  46. package/web/assets/{WebDesktopPet-C5oPRBKd.js → WebDesktopPet-gSDBRZ3C.js} +1 -1
  47. package/web/assets/WorkflowsPage-Cs8PPuKK.js +1 -0
  48. package/web/assets/{WorkspacePicker-CZP9fnUA.js → WorkspacePicker-93gmdtjf.js} +1 -1
  49. package/web/assets/{alert-firawb0H.js → alert-DRIrgNI4.js} +1 -1
  50. package/web/assets/api-AeFmYDtL.js +1 -0
  51. package/web/assets/{app-update-HRbiPDT4.js → app-update-Cf9JJ7WK.js} +1 -1
  52. package/web/assets/{approval-confirm-C0RA-dqX.js → approval-confirm-D-cfu-xY.js} +1 -1
  53. package/web/assets/board-messages-D6AWGHuF.js +1 -0
  54. package/web/assets/board-projects-CjfuDvHx.js +1 -0
  55. package/web/assets/bots-store-vErH7x9u.js +1 -0
  56. package/web/assets/chat-api-CSAs7Y6E.js +1 -0
  57. package/web/assets/{client-store-DvE_NEoR.js → client-store-B5wZ2IWH.js} +1 -1
  58. package/web/assets/{config-search-Cr0TsTRS.js → config-search-eh2zQyZD.js} +1 -1
  59. package/web/assets/desktop-hosts-BNXtrr7R.js +191 -0
  60. package/web/assets/{dialog-9LXtFD-0.js → dialog-BDNbY1pW.js} +1 -1
  61. package/web/assets/event-stream-Dh7h5sXJ.js +2 -0
  62. package/web/assets/{events-oPlZB-qC.js → events-CuVwhRWu.js} +1 -1
  63. package/web/assets/{focus-session-composer-bits-VRvsf-4b.js → focus-session-composer-bits-Dkc0qSzm.js} +1 -1
  64. package/web/assets/folder-paths-BKS24lJ6.js +1 -0
  65. package/web/assets/{hosts-5EeWX76B.js → hosts-B_02vF1S.js} +1 -1
  66. package/web/assets/http-Bp65Kb4t.js +2 -0
  67. package/web/assets/http-response-PZN5QIRk.js +1 -0
  68. package/web/assets/i18n-D80GstlU.js +1 -0
  69. package/web/assets/index-BnQCk-QI.css +2 -0
  70. package/web/assets/{index-rOrQSojS.js → index-CiRnxTh1.js} +2 -2
  71. package/web/assets/machine-messages-Y3INM-Uy.js +1 -0
  72. package/web/assets/machines-api-08M8wQiu.js +1 -0
  73. package/web/assets/{memory-api-sER80Rta.js → memory-api-DSpQSQ5N.js} +1 -1
  74. package/web/assets/mount-app-DRohHSG7.js +9 -0
  75. package/web/assets/{mutation-CEbxdVYy.js → mutation-b4pPvB7p.js} +1 -1
  76. package/web/assets/{palette-navigation-HbVGltCo.js → palette-navigation-C8WTTMd3.js} +1 -1
  77. package/web/assets/permission-rules-api-D931wxo9.js +1 -0
  78. package/web/assets/{pick-system-directory-CWhZCX6d.js → pick-system-directory-CaiscVfr.js} +1 -1
  79. package/web/assets/placements-BERPVxJD.js +2 -0
  80. package/web/assets/{popover-DlJP3VbH.js → popover-BKgOyW2Z.js} +1 -1
  81. package/web/assets/public-CEKKZh7R.js +2 -0
  82. package/web/assets/{public-D4ziZ0_l.js → public-CwI1S0by.js} +1 -1
  83. package/web/assets/{public-Pwc0VWsG.js → public-D9GopZqN.js} +2 -2
  84. package/web/assets/{web-preview-DIo7zGil.js → public-DrlrVRdl.js} +1 -1
  85. package/web/assets/{public-components-DzeaQBwj.js → public-components-BX9oxLC6.js} +1 -1
  86. package/web/assets/public-diff-DpNMZ8NJ.js +1 -0
  87. package/web/assets/public-events-CLCgth5h.js +1 -0
  88. package/web/assets/public-flags-DaG3PoAy.js +1 -0
  89. package/web/assets/public-folder-dialog-_QoxpOd4.js +1 -0
  90. package/web/assets/{public-greeting-BTftKeXA.js → public-greeting-hvhJuZMw.js} +1 -1
  91. package/web/assets/{public-session-BQEMyJz3.js → public-session-DUzugr9Y.js} +1 -1
  92. package/web/assets/{public-sidebar-TnRh2L95.js → public-sidebar-QGIKY-SE.js} +1 -1
  93. package/web/assets/query-DFQayLF5.js +1 -0
  94. package/web/assets/runtime-capabilities-B7qveLBm.js +1 -0
  95. package/web/assets/{runtime-capabilities-store-SnV1V9_K.js → runtime-capabilities-store-Bd3gWIM7.js} +1 -1
  96. package/web/assets/{safe-mode-instance-D5jkqqdG.js → safe-mode-instance-B7_JMLGQ.js} +1 -1
  97. package/web/assets/safe-mode-sentinel-B_NPQ0qy.js +1 -0
  98. package/web/assets/{session-change-summary-api-orjhsMHB.js → session-change-summary-api-BHpd8dcW.js} +1 -1
  99. package/web/assets/{session-home-CwRaSks0.js → session-home-BmAnhROp.js} +1 -1
  100. package/web/assets/session-inspector-store-DHEIlh_X.js +1 -0
  101. package/web/assets/{session-organization-api-BbD_xU9l.js → session-organization-api-D9hTSIh7.js} +1 -1
  102. package/web/assets/session-scope-yI3Hi_8F.js +1 -0
  103. package/web/assets/{session-tree-actions-wrMgK5VF.js → session-tree-actions-BhCOaiTd.js} +1 -1
  104. package/web/assets/{session-tree-summary-BO-Oz0d-.js → session-tree-summary-BLv-bkYC.js} +1 -1
  105. package/web/assets/session-web-preview-guvsmkWE.js +1 -0
  106. package/web/assets/session-workspaces-Brm-8lHh.js +1 -0
  107. package/web/assets/{settings-navigation-DiP_AM1C.js → settings-navigation-C6_RpGgI.js} +1 -1
  108. package/web/assets/{shortcuts-BmJZiLby.js → shortcuts-Dsd4mjfP.js} +1 -1
  109. package/web/assets/side-chat-context-scyCH7W7.js +7 -0
  110. package/web/assets/{sidebar-COyrGoC_.js → sidebar-BKgF_JcM.js} +1 -1
  111. package/web/assets/{sidebar-store-CRsJYE3n.js → sidebar-store-DHwAOBnN.js} +1 -1
  112. package/web/assets/{speech-session-BUTlvobj.js → speech-session-B7DFYRtL.js} +1 -1
  113. package/web/assets/{startup-queries-Cz_Djz3X.js → startup-queries-BlA4Hayt.js} +1 -1
  114. package/web/assets/tool-labels-D-3gybP7.js +1 -0
  115. package/web/assets/{use-i18n-CaxKosZm.js → use-i18n-BVRhlQ1v.js} +1 -1
  116. package/web/assets/{use-open-bot-BcuoHEet.js → use-open-bot-DyXtOatN.js} +1 -1
  117. package/web/assets/{use-studio-actions-D0_lMh6m.js → use-studio-actions-DEeR_rS9.js} +1 -1
  118. package/web/assets/{useCatalogProjects-B10EehnV.js → useCatalogProjects-BD5GyCxg.js} +1 -1
  119. package/web/assets/useMachines-CwX7YqNe.js +1 -0
  120. package/web/assets/useNativeBrowser-C0j3zafh.js +1 -0
  121. package/web/assets/useNewProjectPicker-COxPJj6n.js +2 -0
  122. package/web/assets/{useNow-BZ7RxPrw.js → useNow-CfPk0uIz.js} +1 -1
  123. package/web/assets/{usePhoneShell-0IX6-LbH.js → usePhoneShell-BpuKJgci.js} +1 -1
  124. package/web/assets/{useQuery-DdcpUQhO.js → useQuery-DfOU-27z.js} +1 -1
  125. package/web/assets/useSessionListQuery-CURESPBn.js +2 -0
  126. package/web/assets/{useSessionRowActions-DCeaGwuL.js → useSessionRowActions-DoCwFh8w.js} +1 -1
  127. package/web/assets/{useSidebarModel-DNcSN-4f.js → useSidebarModel-CY79-mYl.js} +1 -1
  128. package/web/assets/web-preview-C7DdG9JP.js +1 -0
  129. package/web/assets/{web-preview-events-BvZrLClr.js → web-preview-events-D7F0Z-Hy.js} +1 -1
  130. package/web/assets/{workspace-order-store-BYpf9Z59.js → workspace-order-store-C-jYrC0l.js} +1 -1
  131. package/web/index.html +2 -2
  132. package/web/assets/AssetsPage-V8CwPJ-g.js +0 -1
  133. package/web/assets/BoardPage-CeCxAAr2.js +0 -3
  134. package/web/assets/ChatPage-D8Etebyo.js +0 -553
  135. package/web/assets/ConfigPage-Dgp9JPFH.js +0 -5
  136. package/web/assets/FocusRuntimeControls-DLdIWv0j.js +0 -1
  137. package/web/assets/McpPage-C0czFuy7.js +0 -1
  138. package/web/assets/MemoryPage-CGpPJtAj.js +0 -2
  139. package/web/assets/MorePage-CxS1EaML.js +0 -1
  140. package/web/assets/NewFolderDialog-Dgo2ZRmr.js +0 -1
  141. package/web/assets/PluginsPage-CcrK4yJY.js +0 -1
  142. package/web/assets/SessionBrowserPane-BISoBe8t.js +0 -2
  143. package/web/assets/SessionContextPanel-C9F4h-Qa.js +0 -2
  144. package/web/assets/SessionInspector-BUBN0O36.js +0 -1
  145. package/web/assets/WorkflowsPage-BSlpEhf2.js +0 -1
  146. package/web/assets/api-MVoWVwmh.js +0 -3
  147. package/web/assets/board-messages-BptuVfY-.js +0 -1
  148. package/web/assets/board-projects-DF-0RkuW.js +0 -1
  149. package/web/assets/bots-store-BmFj9w2F.js +0 -1
  150. package/web/assets/chat-api-D9RzUTQi.js +0 -1
  151. package/web/assets/folder-paths-DlIGURu0.js +0 -1
  152. package/web/assets/i18n-Cl3sIF9G.js +0 -1
  153. package/web/assets/index-l96Dl6z6.css +0 -2
  154. package/web/assets/mount-app-COPez7JX.js +0 -9
  155. package/web/assets/permission-rules-api-M-EIynsN.js +0 -1
  156. package/web/assets/placements-BDYSXHzl.js +0 -2
  157. package/web/assets/public-BDWkdvCh.js +0 -1
  158. package/web/assets/public-diff-C6x0INNk.js +0 -1
  159. package/web/assets/public-events-BXREjvNl.js +0 -1
  160. package/web/assets/public-flags-Dvf3q-4D.js +0 -1
  161. package/web/assets/query-Bj-DUNYq.js +0 -1
  162. package/web/assets/runtime-capabilities-CHYOF_hE.js +0 -1
  163. package/web/assets/safe-mode-sentinel-B3v6JZTG.js +0 -1
  164. package/web/assets/session-scope-CFKKqbrz.js +0 -1
  165. package/web/assets/session-workspaces-Csgpuzxd.js +0 -1
  166. package/web/assets/side-chat-context-DhztplBz.js +0 -7
  167. package/web/assets/tool-labels-Bexnwp5q.js +0 -1
  168. package/web/assets/useNewProjectPicker-CD-xwRhH.js +0 -2
  169. package/web/assets/useSessionListQuery-DXeYJTOA.js +0 -2
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{t as r}from"./use-i18n-CaxKosZm.js";import{t as i}from"./button-CCcCN8tE.js";import{a,i as o,l as s,o as c,s as l,t as u}from"./dialog-9LXtFD-0.js";import{t as d}from"./safe-mode-instance-D5jkqqdG.js";var f=e(t(),1),p=n();function m({notify:e,disableAll:t}){let{t:n}=r(),m=d(),h=(0,f.useSyncExternalStore)(m.subscribe,m.mode,m.mode),[g,_]=(0,f.useState)(!1);if(h!==`pending`)return null;let v=async()=>{_(!0);try{await t()||e(n(`custom-ui:safeMode.disableFailed`)),m.resolve(`normal`)}catch{e(n(`custom-ui:safeMode.disableFailed`))}finally{_(!1)}};return(0,p.jsx)(u,{open:!0,onOpenChange:e=>{!e&&!g&&m.resolve(`safe`)},children:(0,p.jsxs)(o,{"data-components-safe-mode-prompt":!0,children:[(0,p.jsxs)(l,{children:[(0,p.jsx)(s,{children:n(`custom-ui:safeMode.promptTitle`)}),(0,p.jsx)(a,{children:n(`custom-ui:safeMode.promptHint`)})]}),(0,p.jsxs)(c,{children:[(0,p.jsx)(i,{variant:`outline`,disabled:g,onClick:()=>void v(),children:n(`custom-ui:safeMode.disableAll`)}),(0,p.jsx)(i,{variant:`outline`,disabled:g,onClick:()=>m.resolve(`normal`),children:n(`custom-ui:safeMode.loadNormally`)}),(0,p.jsx)(i,{disabled:g,onClick:()=>m.resolve(`safe`),children:n(`custom-ui:safeMode.keepSafe`)})]})]})})}export{m as SafeModePrompt};
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{t as r}from"./use-i18n-BVRhlQ1v.js";import{t as i}from"./button-CCcCN8tE.js";import{a,i as o,l as s,o as c,s as l,t as u}from"./dialog-BDNbY1pW.js";import{t as d}from"./safe-mode-instance-B7_JMLGQ.js";var f=e(t(),1),p=n();function m({notify:e,disableAll:t}){let{t:n}=r(),m=d(),h=(0,f.useSyncExternalStore)(m.subscribe,m.mode,m.mode),[g,_]=(0,f.useState)(!1);if(h!==`pending`)return null;let v=async()=>{_(!0);try{await t()||e(n(`custom-ui:safeMode.disableFailed`)),m.resolve(`normal`)}catch{e(n(`custom-ui:safeMode.disableFailed`))}finally{_(!1)}};return(0,p.jsx)(u,{open:!0,onOpenChange:e=>{!e&&!g&&m.resolve(`safe`)},children:(0,p.jsxs)(o,{"data-components-safe-mode-prompt":!0,children:[(0,p.jsxs)(l,{children:[(0,p.jsx)(s,{children:n(`custom-ui:safeMode.promptTitle`)}),(0,p.jsx)(a,{children:n(`custom-ui:safeMode.promptHint`)})]}),(0,p.jsxs)(c,{children:[(0,p.jsx)(i,{variant:`outline`,disabled:g,onClick:()=>void v(),children:n(`custom-ui:safeMode.disableAll`)}),(0,p.jsx)(i,{variant:`outline`,disabled:g,onClick:()=>m.resolve(`normal`),children:n(`custom-ui:safeMode.loadNormally`)}),(0,p.jsx)(i,{disabled:g,onClick:()=>m.resolve(`safe`),children:n(`custom-ui:safeMode.keepSafe`)})]})]})})}export{m as SafeModePrompt};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{u as t}from"./vendor-router-CSN_DGvx.js";import{i as n,r}from"./vendor-react-DwNgTV1j.js";import{t as i}from"./use-i18n-CaxKosZm.js";import{t as a}from"./api-MVoWVwmh.js";import{t as o}from"./bell-BjONAtgH.js";import{t as s}from"./bot-B3TaBp_T.js";import{t as c}from"./calendar-clock-VIxTaqqy.js";import{t as l}from"./circle-check-iEdCm3Pw.js";import{t as u}from"./WorkspacePicker-CZP9fnUA.js";import{t as d}from"./folder-open-FIShC5Qk.js";import{t as f}from"./message-circle-D-XrK6Ft.js";import{t as p}from"./play-DNDjDNGn.js";import{t as m}from"./plus-fQbSqB1n.js";import{t as h}from"./send-Cj-W03w_.js";import{t as g}from"./trash-2-CNrPOoPR.js";import{t as _}from"./triangle-alert-CE1q54ci.js";import{t as v}from"./more-pages-D_PnxLN0.js";import{t as y}from"./switch-D_G8wFhs.js";import{t as b}from"./utils-C8uzG5AZ.js";import{n as x,t as S}from"./button-CCcCN8tE.js";import{s as C}from"./shortcuts-BmJZiLby.js";import{a as w}from"./format-DMJQzoZ7.js";import{t as T}from"./StatusGlyph-1KgitlUg.js";import{a as E,i as D,l as O,s as ee,t as k}from"./dialog-9LXtFD-0.js";import{t as A}from"./input-CPw-zkYh.js";import{t as j}from"./textarea-DmATpOqT.js";import{t as M}from"./pick-system-directory-CWhZCX6d.js";import{n as N,t as P}from"./PageState-Cz6vFMXv.js";import{a as te,i as ne,n as re,o as ie,r as ae,s as oe,t as se}from"./FeaturePage-IWVjXcVp.js";import{n as F}from"./field-DoLEb0np.js";import{t as I}from"./AppSelect-DQYKUW5E.js";import{i as L,s as R}from"./app-primitives-Drz_SjnR.js";var z=e(n(),1),B=r(),V={browser:{name:`通知`,Icon:o},feishu:{name:`飞书`,Icon:s},weixin:{name:`微信`,Icon:f},qq:{name:`QQ`,Icon:f},telegram:{name:`Telegram`,Icon:h}},H={once:`一次`,interval:`每隔一段时间`,daily:`每天`,weekly:`每周`,monthly:`每月`},U={minutes:`分钟`,hours:`小时`,days:`天`},W=[...new Set([`Asia/Hong_Kong`,`UTC`,...typeof Intl.supportedValuesOf==`function`?Intl.supportedValuesOf(`timeZone`):[]])],G=[`full-access`],K=`mt-4 border-t border-stroke-soft pt-1`,q=`form-grid grid gap-x-3 sm:grid-cols-3`,J=`schedule-interval-input grid grid-cols-[minmax(0,1fr)_minmax(84px,auto)] gap-1.5`,Y=`inline-grid h-8 grid-cols-2 rounded-md border border-stroke bg-chrome p-[3px] max-[650px]:h-auto max-[650px]:w-full pointer-coarse:h-auto`,ce=`inline-flex min-w-0 items-center justify-center rounded-sm border border-transparent px-3 text-sm text-content-secondary transition-colors duration-(--d-fast) hover:text-content aria-pressed:border-key-border aria-pressed:bg-key aria-pressed:font-medium aria-pressed:text-content aria-pressed:shadow-key max-[650px]:h-11 pointer-coarse:h-11`;function le({status:e}){return(0,B.jsx)(`span`,{"aria-hidden":`true`,className:`mt-px grid size-[18px] flex-none place-items-center`,children:(0,B.jsx)(T,{status:e===`running`?`run`:e===`completed`?`done`:`failed`,className:`size-3.5`})})}function ue(e){return e(`schedules:schedulesPage.fullAccessHelp`)}function de(e,t){return t(e===`once`?`schedules:schedulesPage.once`:e===`daily`?`schedules:schedulesPage.daily`:e===`weekly`?`schedules:schedulesPage.weekly`:e===`monthly`?`schedules:schedulesPage.monthly`:`schedules:schedulesPage.atIntervals`)}function fe(e,t){return t(e===`hours`?`schedules:schedulesPage.hours`:e===`days`?`schedules:schedulesPage.days`:`schedules:schedulesPage.minutes`)}function pe(e,t){return t(e===`feishu`?`schedules:schedulesPage.feishu`:e===`weixin`?`schedules:schedulesPage.weChat`:e===`qq`?`schedules:schedulesPage.qq`:e===`telegram`?`schedules:schedulesPage.telegram`:`schedules:schedulesPage.browserNotification`)}function X({value:e,onChange:t}){let{t:n}=i();return(0,B.jsxs)(F,{variant:`control`,children:[n(`schedules:schedulesPage.executionMode`),(0,B.jsx)(I,{value:e,onChange:e=>t(e.target.value),children:G.map(e=>(0,B.jsx)(`option`,{value:e,children:n(`schedules:schedulesPage.fullAccess`)},e))}),(0,B.jsx)(`small`,{children:ue(n)})]})}function Z(e){return Object.fromEntries((e?.inputs||[]).map(e=>[e.name,e.defaultValue??``]))}function Q(e,t,n,r,i){if(e===`prompt`)return!!t.trim();let a=i.find(e=>e.id===n);return a?a.inputs.every(e=>{let t=Object.hasOwn(r,e.name)?r[e.name]:e.defaultValue;return!e.required||t!=null&&t!==``}):!1}function $({targetType:e,prompt:t,workflowId:n,workflowInputs:r,workflows:a,onChange:o}){let{t:s}=i(),c=a.find(e=>e.id===n);return(0,B.jsxs)(`div`,{className:`grid`,children:[(0,B.jsxs)(F,{variant:`control`,children:[s(`schedules:schedulesPage.executionTarget`),(0,B.jsxs)(I,{value:e,onChange:e=>{let t=e.target.value,i=a[0];o(t===`workflow`?{targetType:t,workflowId:n||i?.id||``,workflowInputs:n?r:Z(i)}:{targetType:t})},children:[(0,B.jsx)(`option`,{value:`prompt`,children:`Prompt`}),(0,B.jsx)(`option`,{value:`workflow`,children:s(`schedules:schedulesPage.workflow`)})]})]}),e===`prompt`?(0,B.jsxs)(F,{variant:`control`,children:[`Prompt`,(0,B.jsx)(j,{value:t,onChange:e=>o({prompt:e.target.value}),placeholder:s(`schedules:schedulesPage.describeTheWorkTheAgentShouldCompleteEachTime`)})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(F,{variant:`control`,children:[s(`schedules:schedulesPage.workflow`),(0,B.jsxs)(I,{value:n,onChange:e=>{let t=a.find(t=>t.id===e.target.value);o({workflowId:e.target.value,workflowInputs:Z(t)})},children:[(0,B.jsx)(`option`,{value:``,children:s(`schedules:schedulesPage.selectPublishedWorkflow`)}),a.map(e=>(0,B.jsxs)(`option`,{value:e.id,children:[e.name,` · v`,e.revision]},e.id))]}),(0,B.jsx)(`small`,{children:c?.description||(a.length?s(`schedules:schedulesPage.workflowUsesItsOwnRuntimeSettings`):s(`schedules:schedulesPage.noPublishedWorkflows`))})]}),c?.inputs.length?(0,B.jsxs)(`div`,{className:`grid`,children:[(0,B.jsxs)(`div`,{className:`schedule-workflow-inputs-heading mt-3 flex items-baseline justify-between gap-3 max-[650px]:flex-col max-[650px]:items-start max-[650px]:gap-0.5 [&_small]:text-xs [&_small]:text-content-muted [&_strong]:text-xs [&_strong]:font-medium [&_strong]:text-content-secondary`,children:[(0,B.jsx)(`strong`,{children:s(`schedules:schedulesPage.workflowInputs`)}),(0,B.jsx)(`small`,{children:s(`schedules:schedulesPage.workflowInputsHelp`)})]}),(0,B.jsx)(`div`,{className:`schedule-workflow-inputs grid gap-x-3 sm:grid-cols-2 [&_input[type=checkbox]]:size-4 [&_input[type=checkbox]]:justify-self-end [&_input[type=checkbox]]:accent-star`,children:c.inputs.map(e=>(0,B.jsxs)(F,{variant:`control`,className:e.type===`boolean`?`grid grid-cols-[minmax(0,1fr)_auto] items-center`:void 0,children:[e.label,e.required?` *`:``,e.type===`boolean`?(0,B.jsx)(y,{checked:!!r[e.name],onCheckedChange:t=>o({workflowInputs:{...r,[e.name]:t}})}):(0,B.jsx)(A,{type:e.type===`number`?`number`:`text`,required:e.required,value:String(r[e.name]??``),onChange:t=>o({workflowInputs:{...r,[e.name]:t.target.value}})}),e.description&&(0,B.jsx)(`small`,{children:e.description})]},e.id))})]}):null]})]})}function me({value:e,onChange:t}){let{t:n}=i(),[r,a]=(0,z.useState)(``),[o,s]=(0,z.useState)(!1),c=async()=>{a(``);try{let r=await M(e,n(`common:workspacePicker.selectWorkspaceForSchedule`));r.status===`picked`?t(r.path):r.status===`unavailable`&&s(!0)}catch(e){a(e instanceof Error?e.message:String(e))}};return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(F,{variant:`control`,children:[n(`schedules:schedulesPage.workingDirectory`),(0,B.jsxs)(`span`,{className:`schedule-workspace-input grid grid-cols-[minmax(0,1fr)_auto] gap-1.5 [&_input]:min-w-0 [&_input]:font-mono`,children:[(0,B.jsx)(A,{value:e,onChange:e=>t(e.target.value),placeholder:n(`schedules:schedulesPage.enterTheProjectSAbsolutePath`)}),(0,B.jsxs)(S,{type:`button`,variant:`secondary`,className:`h-auto min-h-8`,onClick:()=>void c(),children:[(0,B.jsx)(d,{}),n(`schedules:schedulesPage.browseDirectories`)]})]}),(0,B.jsx)(`small`,{children:n(`schedules:schedulesPage.theScheduledAgentWillRunInThisDirectory`)})]}),r&&(0,B.jsxs)(L,{children:[(0,B.jsx)(_,{size:13}),r]}),(0,B.jsx)(u,{open:o,initialPath:e,description:n(`common:workspacePicker.selectWorkspaceForSchedule`),onOpenChange:s,onSelect:e=>t(e)})]})}function he(e){return{id:e.id,name:e.name,targetType:e.targetType||`prompt`,prompt:e.prompt,workflowId:e.workflowId||``,workflowInputs:e.workflowInputs||{},enabled:e.enabled,frequency:e.frequency,intervalValue:e.intervalValue||1,intervalUnit:e.intervalUnit||`hours`,time:e.time,date:e.date||``,timezone:e.timezone,dayOfWeek:e.dayOfWeek,dayOfMonth:e.dayOfMonth,cwd:e.cwd,executionMode:e.executionMode||`full-access`,model:e.model,notifications:e.notifications||[],notifyOn:e.notifyOn||`always`}}function ge(e,t=`zh-CN`){return!e.enabled||!e.nextRunAt?t===`en-US`?`Paused`:`已暂停`:new Intl.DateTimeFormat(t,{timeZone:e.timezone,dateStyle:`medium`,timeStyle:`short`}).format(new Date(e.nextRunAt))}function _e({notify:e,onBack:n,openNotificationSettings:r,requestConfirm:o}){let{t:s,language:l}=i(),u=t(),d=C(`focusSearch`),[f,p]=(0,z.useState)({tasks:[],runs:[],notificationTargets:{browser:{enabled:!1},feishu:{enabled:!1},weixin:{enabled:!1},qq:{enabled:!1},telegram:{enabled:!1}},workflows:[],defaultCwd:``}),[h,g]=(0,z.useState)(``),[_,y]=(0,z.useState)({}),[b,x]=(0,z.useState)(!0),[w,E]=(0,z.useState)(!1),[D,O]=(0,z.useState)(``),[ee,k]=(0,z.useState)(!1),[A,j]=(0,z.useState)(``),[M,F]=(0,z.useState)(!1),[I,L]=(0,z.useState)(``),R=(0,z.useCallback)(async()=>{try{let e=await a(`/api/schedules`);p(e),E(!0),O(``),g(t=>e.tasks.some(e=>e.id===t)?t:``),y(t=>{let n=Object.entries(t).filter(([t])=>e.tasks.some(e=>e.id===t));return n.length===Object.keys(t).length?t:Object.fromEntries(n)})}catch(e){O(e instanceof Error?e.message:String(e))}finally{x(!1)}},[]);(0,z.useEffect)(()=>{R()},[R]),(0,z.useEffect)(()=>{let e=window.setInterval(R,f.tasks.some(e=>e.lastStatus===`running`)?2e3:1e4);return()=>window.clearInterval(e)},[f.tasks,R]);let V=f.tasks.find(e=>e.id===h),H=f.workflows||[],U=V?_[V.id]??he(V):null,W=(0,z.useMemo)(()=>f.runs.filter(e=>e.taskId===h).sort((e,t)=>new Date(t.startedAt).getTime()-new Date(e.startedAt).getTime()).slice(0,20),[f.runs,h]),G=e=>H.find(t=>t.id===e.workflowId)?.name||s(`schedules:schedulesPage.workflowUnavailable`),K=I.trim().toLocaleLowerCase(),q=K?f.tasks.filter(e=>`${e.name} ${e.targetType===`workflow`?G(e):e.targetType===`bot`?e.botMessage||``:e.prompt}`.toLocaleLowerCase().includes(K)):f.tasks,J=f.tasks.filter(e=>e.enabled).length,Y=e=>{if(!V)return;let t=he(V);y(n=>({...n,[t.id]:{...n[t.id]??t,...e}}))},ce=e=>{U&&Y({notifications:U.notifications.includes(e)?U.notifications.filter(t=>t!==e):[...U.notifications,e]})},le=async()=>{if(!(!V||!U)){k(!0),j(``);try{let t=await a(`/api/schedules/${encodeURIComponent(V.id)}`,{method:`PATCH`,body:JSON.stringify(U)});p(t.state),y(e=>Object.fromEntries(Object.entries(e).filter(([e])=>e!==t.task.id))),e(s(`schedules:schedulesPage.scheduledTaskSaved`))}catch(e){j(e instanceof Error?e.message:String(e))}finally{k(!1)}}},ue=async()=>{if(V){k(!0),j(``);try{await a(`/api/schedules/${encodeURIComponent(V.id)}/run`,{method:`POST`,body:`{}`}),await R(),e(s(`schedules:schedulesPage.scheduledTaskStarted`))}catch(e){j(e instanceof Error?e.message:String(e))}finally{k(!1)}}},pe=async()=>{if(V&&await o({title:s(`schedules:schedulesPage.deleteScheduledTask`),message:s(`schedules:schedulesPage.deleteScheduledTaskNameAndItsRunHistory`,{name:V.name}),confirmLabel:s(`schedules:schedulesPage.delete`)}))try{await a(`/api/schedules/${encodeURIComponent(V.id)}`,{method:`DELETE`}),await R(),e(s(`schedules:schedulesPage.scheduledTaskDeleted`))}catch(e){j(e instanceof Error?e.message:String(e))}},X=t=>{p(t.state),g(t.task.id),e(s(`schedules:schedulesPage.scheduledTaskCreated`))},Z=e=>(0,B.jsxs)(`span`,{className:`flex min-w-0 flex-col items-end gap-0.5 max-[650px]:flex-row max-[650px]:items-center max-[650px]:gap-2`,children:[e.lastStatus===`running`?(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-content-secondary`,children:[(0,B.jsx)(T,{status:`run`,className:`size-3.5`}),s(`schedules:schedulesPage.running`)]}):(0,B.jsx)(`span`,{className:`whitespace-nowrap`,children:e.enabled?s(`schedules:schedulesPage.nextRunTime`,{time:ge(e,l)}):e.lastStatus===`missed`?s(`schedules:schedulesPage.missed`):e.frequency===`once`&&e.lastRunAt?s(`schedules:schedulesPage.onceDone`):s(`schedules:schedulesPage.pause`)}),e.lastStatus===`failed`&&(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-content-secondary`,children:[(0,B.jsx)(T,{status:`failed`,className:`size-3.5`}),s(`schedules:schedulesPage.lastRunFailed`)]})]}),Q=s(`navigation:navigation.schedules`);return(0,B.jsxs)(ae,{title:Q,description:s(`schedules:schedulesPage.lede`),back:n&&{label:s(`navigation:sidebar.features`),ariaLabel:s(`navigation:shell.backToFeaturesLabel`),onBack:n},toolbar:(0,B.jsx)(oe,{search:(0,B.jsx)(te,{id:v,value:I,onValueChange:L,placeholder:s(`navigation:pageHeader.searchPage`,{page:Q}),shortcut:d,clearLabel:s(`navigation:more.clearSearch`)}),actions:(0,B.jsxs)(S,{type:`button`,className:`h-9`,disabled:!w,onClick:()=>F(!0),children:[(0,B.jsx)(m,{}),s(`schedules:schedulesPage.newTask`)]})}),children:[b?(0,B.jsx)(N,{kind:`loading`,title:s(`schedules:schedulesPage.loadingScheduledTasks`)}):D&&!w?(0,B.jsx)(N,{kind:`error`,title:s(`schedules:schedulesPage.loadFailed`),description:D,action:(0,B.jsx)(S,{variant:`secondary`,className:`max-[650px]:h-11`,onClick:()=>{x(!0),R()},children:s(`common:pageTemplate.retry`)})}):(0,B.jsxs)(B.Fragment,{children:[(A||D)&&(0,B.jsx)(se,{children:A||D}),(0,B.jsx)(ie,{title:s(`schedules:schedulesPage.tasks`),count:f.tasks.length,meta:f.tasks.length?s(`schedules:schedulesPage.enabledCount`,{count:J}):void 0,children:q.length?(0,B.jsx)(re,{children:q.map(e=>{let t=h===e.id;return(0,B.jsx)(ne,{"data-schedule-task":e.id,className:`schedule-list-item`,icon:(0,B.jsx)(c,{}),name:e.name,description:e.targetType===`workflow`?(0,B.jsx)(`span`,{className:`font-mono`,children:G(e)}):e.targetType===`bot`?s(`schedules:schedulesPage.botTarget`,{message:e.botMessage||``}):e.prompt,meta:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{children:de(e.frequency,s)}),(0,B.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,B.jsx)(`span`,{className:`tabular-nums`,children:e.frequency===`interval`?`${e.intervalValue} ${fe(e.intervalUnit,s)}`:e.frequency===`once`?`${e.date} ${e.time}`:e.time}),(0,B.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,B.jsx)(`span`,{className:`truncate`,children:e.timezone}),e.createdBy?.kind===`agent`&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,B.jsx)(`span`,{"data-schedule-created-by":`agent`,children:s(`schedules:schedulesPage.createdByAgent`)})]})]}),status:Z(e),expanded:t,onExpandedChange:t=>g(t?e.id:``),toggleLabel:s(`schedules:schedulesPage.toggleTaskDetails`,{name:e.name}),detail:t&&e.targetType===`bot`?(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm text-content-secondary`,children:[(0,B.jsx)(`span`,{className:`min-w-0 flex-1`,children:s(`schedules:schedulesPage.botManagedThere`)}),(0,B.jsx)(S,{size:`sm`,variant:`outline`,onClick:()=>u(`/bots/${encodeURIComponent(e.botId||``)}`),children:s(`schedules:schedulesPage.openBot`)})]}):t&&U&&V?(0,B.jsx)(ve,{task:V,draft:U,runs:W,saving:ee,workflows:H,notificationTargets:f.notificationTargets,language:l,onUpdate:Y,onToggleNotification:ce,onRun:ue,onRemove:pe,onSave:le,onEditTemplates:r}):null},e.id)})}):(0,B.jsx)(P,{title:f.tasks.length?s(`schedules:schedulesPage.noMatchingTasks`):s(`schedules:schedulesPage.theTimelineIsStillUnlit`),description:f.tasks.length?void 0:s(`schedules:schedulesPage.createATaskAndLetItSetOutAutomaticallyAtTheAppointedTime`)})})]}),M&&(0,B.jsx)(ye,{notificationTargets:f.notificationTargets,workflows:H,defaultCwd:f.defaultCwd,onClose:()=>F(!1),onCreated:e=>{F(!1),X(e)}})]})}function ve({task:e,draft:t,runs:n,saving:r,workflows:a,notificationTargets:o,language:s,onUpdate:c,onToggleNotification:u,onRun:d,onRemove:f,onSave:m,onEditTemplates:h}){let{t:_}=i(),v=e.lastStatus===`running`;return(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-4`,children:[(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,B.jsxs)(`label`,{className:`mr-auto inline-flex min-h-8 items-center gap-2.5 text-sm text-content max-[650px]:min-h-11`,children:[(0,B.jsx)(R,{value:t.enabled,onChange:e=>c({enabled:e}),ariaLabel:_(`schedules:schedulesPage.enableTaskName`,{name:t.name})}),t.enabled?_(`schedules:schedulesPage.enabled`):_(`schedules:schedulesPage.pause`)]}),(0,B.jsxs)(S,{variant:`secondary`,size:`sm`,className:`max-[650px]:h-11`,disabled:r||v,onClick:d,children:[v?(0,B.jsx)(x,{}):(0,B.jsx)(p,{}),_(v?`schedules:schedulesPage.running`:`schedules:schedulesPage.runNow`)]}),(0,B.jsx)(S,{variant:`ghost`,size:`icon-sm`,className:`hover:bg-danger-soft hover:text-danger max-[650px]:size-11`,title:_(`schedules:schedulesPage.deleteTask`),"aria-label":_(`schedules:schedulesPage.deleteTask`),onClick:f,children:(0,B.jsx)(g,{})})]}),(0,B.jsx)($,{targetType:t.targetType,prompt:t.prompt,workflowId:t.workflowId,workflowInputs:t.workflowInputs,workflows:a,onChange:c}),t.targetType===`prompt`&&(0,B.jsx)(me,{value:t.cwd,onChange:e=>c({cwd:e})}),(0,B.jsx)(`div`,{className:K,children:(0,B.jsxs)(`div`,{className:q,children:[(0,B.jsxs)(F,{variant:`control`,children:[_(`schedules:schedulesPage.frequency`),(0,B.jsx)(I,{value:t.frequency,onChange:e=>c({frequency:e.target.value}),children:Object.keys(H).map(e=>(0,B.jsx)(`option`,{value:e,children:de(e,_)},e))})]}),t.frequency===`interval`?(0,B.jsxs)(F,{variant:`control`,children:[_(`schedules:schedulesPage.runInterval`),(0,B.jsxs)(`span`,{className:J,children:[(0,B.jsx)(A,{type:`number`,min:`1`,value:t.intervalValue,onChange:e=>c({intervalValue:Number(e.target.value)})}),(0,B.jsx)(I,{value:t.intervalUnit,onChange:e=>c({intervalUnit:e.target.value}),children:Object.keys(U).map(e=>(0,B.jsx)(`option`,{value:e,children:fe(e,_)},e))})]})]}):(0,B.jsxs)(B.Fragment,{children:[t.frequency===`once`&&(0,B.jsxs)(F,{variant:`control`,children:[_(`schedules:schedulesPage.date`),(0,B.jsx)(A,{type:`date`,className:`tabular-nums`,value:t.date,onChange:e=>c({date:e.target.value})})]}),(0,B.jsxs)(F,{variant:`control`,children:[_(`schedules:schedulesPage.time`),(0,B.jsx)(A,{type:`time`,className:`tabular-nums`,value:t.time,onChange:e=>c({time:e.target.value})})]})]}),(0,B.jsxs)(F,{variant:`control`,children:[_(`schedules:schedulesPage.timeZone`),(0,B.jsx)(I,{value:t.timezone,onChange:e=>c({timezone:e.target.value}),children:W.map(e=>(0,B.jsx)(`option`,{value:e,children:e},e))})]}),t.targetType===`prompt`&&(0,B.jsx)(X,{value:t.executionMode,onChange:e=>c({executionMode:e})})]})}),(0,B.jsxs)(`div`,{className:b(`schedule-notification-section pt-3`,K),children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,B.jsx)(`strong`,{className:`text-sm font-medium`,children:_(`schedules:schedulesPage.notificationChannels`)}),(0,B.jsx)(`button`,{type:`button`,className:`text-button text-xs font-medium text-content-secondary underline underline-offset-2 hover:text-content max-[650px]:min-h-11`,onClick:h,children:_(`schedules:schedulesPage.editTemplates`)})]}),(0,B.jsx)(`p`,{className:`mt-0.5 text-xs text-content-muted`,children:_(`schedules:schedulesPage.notificationChannelsHelp`)}),(0,B.jsx)(`div`,{className:`schedule-notification-targets mt-2.5 grid grid-cols-[repeat(auto-fill,minmax(132px,1fr))] gap-2`,children:Object.entries(V).map(([e,n])=>{let r=n.Icon,i=t.notifications.includes(e);return(0,B.jsxs)(`button`,{type:`button`,"aria-pressed":i,className:b(`grid min-h-[52px] grid-cols-[16px_minmax(0,1fr)_16px] items-center gap-2 rounded-md border px-2.5 py-2 text-left transition-colors duration-(--d-fast)`,i?`selected border-star-border bg-star-soft text-star-strong`:`border-stroke bg-panel text-content hover:bg-surface-subtle`),onClick:()=>u(e),children:[(0,B.jsx)(r,{className:`size-4`}),(0,B.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,B.jsx)(`strong`,{className:`truncate text-sm font-medium`,children:pe(e,_)}),(0,B.jsx)(`small`,{className:`truncate text-xs text-content-muted`,children:o[e].enabled?_(`schedules:schedulesPage.configured`):_(`schedules:schedulesPage.notConfigured`)})]}),(0,B.jsx)(l,{className:b(`size-4`,i?`text-star-strong`:`text-content-faint`)})]},e)})}),(0,B.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-x-3 gap-y-1.5`,children:[(0,B.jsx)(`span`,{id:`schedule-notify-on-${e.id}`,className:`text-xs text-content-muted`,children:_(`schedules:schedulesPage.notifyWhen`)}),(0,B.jsx)(`div`,{role:`group`,"aria-labelledby":`schedule-notify-on-${e.id}`,className:b(`schedule-notification-chip`,Y),children:[`always`,`failure`].map(e=>(0,B.jsx)(`button`,{type:`button`,"aria-pressed":t.notifyOn===e,className:ce,onClick:()=>c({notifyOn:e}),children:_(e===`failure`?`schedules:schedulesPage.failuresOnly`:`schedules:schedulesPage.completionAndFailure`)},e))})]})]}),(0,B.jsxs)(`div`,{className:`form-footer mt-4 flex items-center justify-between gap-2.5 border-t border-stroke-soft pt-3 max-[650px]:flex-wrap`,children:[(0,B.jsx)(`span`,{className:`text-xs text-content-muted tabular-nums`,children:e.lastRunAt?_(`schedules:schedulesPage.lastRunTime`,{time:w(e.lastRunAt,s)}):_(`schedules:schedulesPage.nextRunTime`,{time:ge(e,s)})}),(0,B.jsxs)(S,{className:`max-[650px]:h-11 max-[650px]:w-full`,disabled:r||!Q(t.targetType,t.prompt,t.workflowId,t.workflowInputs,a),onClick:m,children:[r?(0,B.jsx)(x,{className:`text-current`}):null,_(r?`schedules:schedulesPage.saving`:`schedules:schedulesPage.saveTask`)]})]})]}),(0,B.jsxs)(`section`,{"aria-labelledby":`schedule-runs-${e.id}`,className:`min-w-0`,children:[(0,B.jsxs)(`h3`,{id:`schedule-runs-${e.id}`,className:`mb-1.5 text-[13px] font-medium text-content-muted tabular-nums`,children:[_(`schedules:schedulesPage.recentRuns`),` · `,n.length]}),n.length?(0,B.jsx)(`ul`,{className:`divide-y divide-stroke-soft overflow-hidden rounded-[var(--r-md)] border border-stroke`,children:n.map(e=>(0,B.jsxs)(`li`,{className:`schedule-run-row grid min-h-11 grid-cols-[18px_minmax(0,1fr)_auto] items-start gap-2.5 px-3 py-2.5 ${e.status}`,children:[(0,B.jsx)(le,{status:e.status}),(0,B.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,B.jsx)(`strong`,{className:`line-clamp-2 text-sm leading-5 font-medium text-content`,children:e.status===`running`?_(`schedules:schedulesPage.running2`):e.status===`completed`?e.summary||_(`schedules:schedulesPage.taskCompleted`):e.status===`interrupted`?_(`schedules:schedulesPage.taskInterrupted`):e.error||_(`schedules:schedulesPage.taskFailed`)}),(0,B.jsxs)(`small`,{className:`text-xs text-content-muted tabular-nums`,children:[w(e.startedAt,s),` ·`,` `,e.trigger===`manual`?_(`schedules:schedulesPage.manualRun`):_(`schedules:schedulesPage.scheduledTrigger`),e.durationMs?` · ${_(`schedules:schedulesPage.countSec`,{count:Math.round(e.durationMs/1e3)})}`:``]})]}),(0,B.jsx)(`em`,{className:`font-mono text-xs leading-5 text-content-secondary not-italic tabular-nums`,children:new Intl.DateTimeFormat(s,{hour:`2-digit`,minute:`2-digit`}).format(new Date(e.startedAt))})]},e.id))}):(0,B.jsx)(P,{compact:!0,title:_(`schedules:schedulesPage.noRunHistory`)})]})]})}function ye({notificationTargets:e,workflows:t,defaultCwd:n,onClose:r,onCreated:o}){let{t:s}=i(),[c,l]=(0,z.useState)(``),[u,d]=(0,z.useState)(`prompt`),[f,p]=(0,z.useState)(``),[h,g]=(0,z.useState)(``),[v,y]=(0,z.useState)({}),[b,C]=(0,z.useState)(n||``),[w,T]=(0,z.useState)(`full-access`),[j,M]=(0,z.useState)(!1),[N,P]=(0,z.useState)(``);return(0,B.jsx)(k,{open:!0,onOpenChange:e=>!e&&r(),children:(0,B.jsx)(D,{size:`compact`,children:(0,B.jsxs)(`form`,{className:`grid min-w-0`,onSubmit:async t=>{t.preventDefault(),M(!0),P(``);try{let t=Object.entries(e).filter(([,e])=>e.enabled).map(([e])=>e);o(await a(`/api/schedules`,{method:`POST`,body:JSON.stringify({name:c,targetType:u,prompt:f,workflowId:h,workflowInputs:v,cwd:b,enabled:!0,frequency:`daily`,time:`09:00`,timezone:`Asia/Hong_Kong`,executionMode:w,notifications:t,notifyOn:`always`})}))}catch(e){P(e instanceof Error?e.message:String(e))}finally{M(!1)}},children:[(0,B.jsxs)(ee,{children:[(0,B.jsx)(O,{children:s(`schedules:schedulesPage.newScheduledTask`)}),(0,B.jsx)(E,{children:s(`schedules:schedulesPage.youCanContinueSettingTheRunTimeAndNotificationChannelsAfterCreation`)})]}),(0,B.jsxs)(F,{variant:`control`,children:[s(`schedules:schedulesPage.taskName`),(0,B.jsx)(A,{value:c,onChange:e=>l(e.target.value),placeholder:s(`schedules:schedulesPage.forExampleDailyCodeReview`)})]}),(0,B.jsx)($,{targetType:u,prompt:f,workflowId:h,workflowInputs:v,workflows:t,onChange:e=>{e.targetType&&d(e.targetType),e.prompt!==void 0&&p(e.prompt),e.workflowId!==void 0&&g(e.workflowId),e.workflowInputs!==void 0&&y(e.workflowInputs)}}),u===`prompt`&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(me,{value:b,onChange:C}),(0,B.jsx)(X,{value:w,onChange:T})]}),N&&(0,B.jsxs)(L,{children:[(0,B.jsx)(_,{size:13}),N]}),(0,B.jsxs)(`div`,{className:`mt-5 flex justify-end gap-2 max-[650px]:[&>button]:h-11 max-[650px]:[&>button]:flex-1`,children:[(0,B.jsx)(S,{type:`button`,variant:`secondary`,onClick:r,children:s(`schedules:schedulesPage.cancel`)}),(0,B.jsxs)(S,{type:`submit`,disabled:j||!c.trim()||!Q(u,f,h,v,t),children:[j?(0,B.jsx)(x,{className:`text-current`}):(0,B.jsx)(m,{}),s(j?`schedules:schedulesPage.creating`:`schedules:schedulesPage.createTask`)]})]})]})})})}export{_e as SchedulesPage};
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{u as t}from"./vendor-router-CSN_DGvx.js";import{i as n,r}from"./vendor-react-DwNgTV1j.js";import{t as i}from"./use-i18n-BVRhlQ1v.js";import{t as a}from"./api-AeFmYDtL.js";import{t as o}from"./bell-BjONAtgH.js";import{t as s}from"./bot-B3TaBp_T.js";import{t as c}from"./calendar-clock-VIxTaqqy.js";import{t as l}from"./circle-check-iEdCm3Pw.js";import{t as u}from"./WorkspacePicker-93gmdtjf.js";import{t as d}from"./folder-open-FIShC5Qk.js";import{t as f}from"./message-circle-D-XrK6Ft.js";import{t as p}from"./play-DNDjDNGn.js";import{t as m}from"./plus-fQbSqB1n.js";import{t as h}from"./send-Cj-W03w_.js";import{t as g}from"./trash-2-CNrPOoPR.js";import{t as _}from"./triangle-alert-CE1q54ci.js";import{t as v}from"./more-pages-D_PnxLN0.js";import{t as y}from"./switch-D_G8wFhs.js";import{t as b}from"./utils-C8uzG5AZ.js";import{n as x,t as S}from"./button-CCcCN8tE.js";import{s as C}from"./shortcuts-Dsd4mjfP.js";import{a as w}from"./format-DMJQzoZ7.js";import{t as T}from"./StatusGlyph-1KgitlUg.js";import{a as E,i as D,l as O,s as ee,t as k}from"./dialog-BDNbY1pW.js";import{t as A}from"./input-CPw-zkYh.js";import{t as j}from"./textarea-DmATpOqT.js";import{t as M}from"./pick-system-directory-CaiscVfr.js";import{n as N,t as P}from"./PageState-Cz6vFMXv.js";import{a as te,i as ne,n as re,o as ie,r as ae,s as oe,t as se}from"./FeaturePage-bqByIxYg.js";import{n as F}from"./field-DoLEb0np.js";import{t as I}from"./AppSelect-DQYKUW5E.js";import{i as L,s as R}from"./app-primitives-Drz_SjnR.js";var z=e(n(),1),B=r(),V={browser:{name:`通知`,Icon:o},feishu:{name:`飞书`,Icon:s},weixin:{name:`微信`,Icon:f},qq:{name:`QQ`,Icon:f},telegram:{name:`Telegram`,Icon:h}},H={once:`一次`,interval:`每隔一段时间`,daily:`每天`,weekly:`每周`,monthly:`每月`},U={minutes:`分钟`,hours:`小时`,days:`天`},W=[...new Set([`Asia/Hong_Kong`,`UTC`,...typeof Intl.supportedValuesOf==`function`?Intl.supportedValuesOf(`timeZone`):[]])],G=[`full-access`],K=`mt-4 border-t border-stroke-soft pt-1`,q=`form-grid grid gap-x-3 sm:grid-cols-3`,J=`schedule-interval-input grid grid-cols-[minmax(0,1fr)_minmax(84px,auto)] gap-1.5`,Y=`inline-grid h-8 grid-cols-2 rounded-md border border-stroke bg-chrome p-[3px] max-[650px]:h-auto max-[650px]:w-full pointer-coarse:h-auto`,ce=`inline-flex min-w-0 items-center justify-center rounded-sm border border-transparent px-3 text-sm text-content-secondary transition-colors duration-(--d-fast) hover:text-content aria-pressed:border-key-border aria-pressed:bg-key aria-pressed:font-medium aria-pressed:text-content aria-pressed:shadow-key max-[650px]:h-11 pointer-coarse:h-11`;function le({status:e}){return(0,B.jsx)(`span`,{"aria-hidden":`true`,className:`mt-px grid size-[18px] flex-none place-items-center`,children:(0,B.jsx)(T,{status:e===`running`?`run`:e===`completed`?`done`:`failed`,className:`size-3.5`})})}function ue(e){return e(`schedules:schedulesPage.fullAccessHelp`)}function de(e,t){return t(e===`once`?`schedules:schedulesPage.once`:e===`daily`?`schedules:schedulesPage.daily`:e===`weekly`?`schedules:schedulesPage.weekly`:e===`monthly`?`schedules:schedulesPage.monthly`:`schedules:schedulesPage.atIntervals`)}function fe(e,t){return t(e===`hours`?`schedules:schedulesPage.hours`:e===`days`?`schedules:schedulesPage.days`:`schedules:schedulesPage.minutes`)}function pe(e,t){return t(e===`feishu`?`schedules:schedulesPage.feishu`:e===`weixin`?`schedules:schedulesPage.weChat`:e===`qq`?`schedules:schedulesPage.qq`:e===`telegram`?`schedules:schedulesPage.telegram`:`schedules:schedulesPage.browserNotification`)}function X({value:e,onChange:t}){let{t:n}=i();return(0,B.jsxs)(F,{variant:`control`,children:[n(`schedules:schedulesPage.executionMode`),(0,B.jsx)(I,{value:e,onChange:e=>t(e.target.value),children:G.map(e=>(0,B.jsx)(`option`,{value:e,children:n(`schedules:schedulesPage.fullAccess`)},e))}),(0,B.jsx)(`small`,{children:ue(n)})]})}function Z(e){return Object.fromEntries((e?.inputs||[]).map(e=>[e.name,e.defaultValue??``]))}function Q(e,t,n,r,i){if(e===`prompt`)return!!t.trim();let a=i.find(e=>e.id===n);return a?a.inputs.every(e=>{let t=Object.hasOwn(r,e.name)?r[e.name]:e.defaultValue;return!e.required||t!=null&&t!==``}):!1}function $({targetType:e,prompt:t,workflowId:n,workflowInputs:r,workflows:a,onChange:o}){let{t:s}=i(),c=a.find(e=>e.id===n);return(0,B.jsxs)(`div`,{className:`grid`,children:[(0,B.jsxs)(F,{variant:`control`,children:[s(`schedules:schedulesPage.executionTarget`),(0,B.jsxs)(I,{value:e,onChange:e=>{let t=e.target.value,i=a[0];o(t===`workflow`?{targetType:t,workflowId:n||i?.id||``,workflowInputs:n?r:Z(i)}:{targetType:t})},children:[(0,B.jsx)(`option`,{value:`prompt`,children:`Prompt`}),(0,B.jsx)(`option`,{value:`workflow`,children:s(`schedules:schedulesPage.workflow`)})]})]}),e===`prompt`?(0,B.jsxs)(F,{variant:`control`,children:[`Prompt`,(0,B.jsx)(j,{value:t,onChange:e=>o({prompt:e.target.value}),placeholder:s(`schedules:schedulesPage.describeTheWorkTheAgentShouldCompleteEachTime`)})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(F,{variant:`control`,children:[s(`schedules:schedulesPage.workflow`),(0,B.jsxs)(I,{value:n,onChange:e=>{let t=a.find(t=>t.id===e.target.value);o({workflowId:e.target.value,workflowInputs:Z(t)})},children:[(0,B.jsx)(`option`,{value:``,children:s(`schedules:schedulesPage.selectPublishedWorkflow`)}),a.map(e=>(0,B.jsxs)(`option`,{value:e.id,children:[e.name,` · v`,e.revision]},e.id))]}),(0,B.jsx)(`small`,{children:c?.description||(a.length?s(`schedules:schedulesPage.workflowUsesItsOwnRuntimeSettings`):s(`schedules:schedulesPage.noPublishedWorkflows`))})]}),c?.inputs.length?(0,B.jsxs)(`div`,{className:`grid`,children:[(0,B.jsxs)(`div`,{className:`schedule-workflow-inputs-heading mt-3 flex items-baseline justify-between gap-3 max-[650px]:flex-col max-[650px]:items-start max-[650px]:gap-0.5 [&_small]:text-xs [&_small]:text-content-muted [&_strong]:text-xs [&_strong]:font-medium [&_strong]:text-content-secondary`,children:[(0,B.jsx)(`strong`,{children:s(`schedules:schedulesPage.workflowInputs`)}),(0,B.jsx)(`small`,{children:s(`schedules:schedulesPage.workflowInputsHelp`)})]}),(0,B.jsx)(`div`,{className:`schedule-workflow-inputs grid gap-x-3 sm:grid-cols-2 [&_input[type=checkbox]]:size-4 [&_input[type=checkbox]]:justify-self-end [&_input[type=checkbox]]:accent-star`,children:c.inputs.map(e=>(0,B.jsxs)(F,{variant:`control`,className:e.type===`boolean`?`grid grid-cols-[minmax(0,1fr)_auto] items-center`:void 0,children:[e.label,e.required?` *`:``,e.type===`boolean`?(0,B.jsx)(y,{checked:!!r[e.name],onCheckedChange:t=>o({workflowInputs:{...r,[e.name]:t}})}):(0,B.jsx)(A,{type:e.type===`number`?`number`:`text`,required:e.required,value:String(r[e.name]??``),onChange:t=>o({workflowInputs:{...r,[e.name]:t.target.value}})}),e.description&&(0,B.jsx)(`small`,{children:e.description})]},e.id))})]}):null]})]})}function me({value:e,onChange:t}){let{t:n}=i(),[r,a]=(0,z.useState)(``),[o,s]=(0,z.useState)(!1),c=async()=>{a(``);try{let r=await M(e,n(`common:workspacePicker.selectWorkspaceForSchedule`));r.status===`picked`?t(r.path):r.status===`unavailable`&&s(!0)}catch(e){a(e instanceof Error?e.message:String(e))}};return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(F,{variant:`control`,children:[n(`schedules:schedulesPage.workingDirectory`),(0,B.jsxs)(`span`,{className:`schedule-workspace-input grid grid-cols-[minmax(0,1fr)_auto] gap-1.5 [&_input]:min-w-0 [&_input]:font-mono`,children:[(0,B.jsx)(A,{value:e,onChange:e=>t(e.target.value),placeholder:n(`schedules:schedulesPage.enterTheProjectSAbsolutePath`)}),(0,B.jsxs)(S,{type:`button`,variant:`secondary`,className:`h-auto min-h-8`,onClick:()=>void c(),children:[(0,B.jsx)(d,{}),n(`schedules:schedulesPage.browseDirectories`)]})]}),(0,B.jsx)(`small`,{children:n(`schedules:schedulesPage.theScheduledAgentWillRunInThisDirectory`)})]}),r&&(0,B.jsxs)(L,{children:[(0,B.jsx)(_,{size:13}),r]}),(0,B.jsx)(u,{open:o,initialPath:e,description:n(`common:workspacePicker.selectWorkspaceForSchedule`),onOpenChange:s,onSelect:e=>t(e)})]})}function he(e){return{id:e.id,name:e.name,targetType:e.targetType||`prompt`,prompt:e.prompt,workflowId:e.workflowId||``,workflowInputs:e.workflowInputs||{},enabled:e.enabled,frequency:e.frequency,intervalValue:e.intervalValue||1,intervalUnit:e.intervalUnit||`hours`,time:e.time,date:e.date||``,timezone:e.timezone,dayOfWeek:e.dayOfWeek,dayOfMonth:e.dayOfMonth,cwd:e.cwd,executionMode:e.executionMode||`full-access`,model:e.model,notifications:e.notifications||[],notifyOn:e.notifyOn||`always`}}function ge(e,t=`zh-CN`){return!e.enabled||!e.nextRunAt?t===`en-US`?`Paused`:`已暂停`:new Intl.DateTimeFormat(t,{timeZone:e.timezone,dateStyle:`medium`,timeStyle:`short`}).format(new Date(e.nextRunAt))}function _e({notify:e,onBack:n,openNotificationSettings:r,requestConfirm:o}){let{t:s,language:l}=i(),u=t(),d=C(`focusSearch`),[f,p]=(0,z.useState)({tasks:[],runs:[],notificationTargets:{browser:{enabled:!1},feishu:{enabled:!1},weixin:{enabled:!1},qq:{enabled:!1},telegram:{enabled:!1}},workflows:[],defaultCwd:``}),[h,g]=(0,z.useState)(``),[_,y]=(0,z.useState)({}),[b,x]=(0,z.useState)(!0),[w,E]=(0,z.useState)(!1),[D,O]=(0,z.useState)(``),[ee,k]=(0,z.useState)(!1),[A,j]=(0,z.useState)(``),[M,F]=(0,z.useState)(!1),[I,L]=(0,z.useState)(``),R=(0,z.useCallback)(async()=>{try{let e=await a(`/api/schedules`);p(e),E(!0),O(``),g(t=>e.tasks.some(e=>e.id===t)?t:``),y(t=>{let n=Object.entries(t).filter(([t])=>e.tasks.some(e=>e.id===t));return n.length===Object.keys(t).length?t:Object.fromEntries(n)})}catch(e){O(e instanceof Error?e.message:String(e))}finally{x(!1)}},[]);(0,z.useEffect)(()=>{R()},[R]),(0,z.useEffect)(()=>{let e=window.setInterval(R,f.tasks.some(e=>e.lastStatus===`running`)?2e3:1e4);return()=>window.clearInterval(e)},[f.tasks,R]);let V=f.tasks.find(e=>e.id===h),H=f.workflows||[],U=V?_[V.id]??he(V):null,W=(0,z.useMemo)(()=>f.runs.filter(e=>e.taskId===h).sort((e,t)=>new Date(t.startedAt).getTime()-new Date(e.startedAt).getTime()).slice(0,20),[f.runs,h]),G=e=>H.find(t=>t.id===e.workflowId)?.name||s(`schedules:schedulesPage.workflowUnavailable`),K=I.trim().toLocaleLowerCase(),q=K?f.tasks.filter(e=>`${e.name} ${e.targetType===`workflow`?G(e):e.targetType===`bot`?e.botMessage||``:e.prompt}`.toLocaleLowerCase().includes(K)):f.tasks,J=f.tasks.filter(e=>e.enabled).length,Y=e=>{if(!V)return;let t=he(V);y(n=>({...n,[t.id]:{...n[t.id]??t,...e}}))},ce=e=>{U&&Y({notifications:U.notifications.includes(e)?U.notifications.filter(t=>t!==e):[...U.notifications,e]})},le=async()=>{if(!(!V||!U)){k(!0),j(``);try{let t=await a(`/api/schedules/${encodeURIComponent(V.id)}`,{method:`PATCH`,body:JSON.stringify(U)});p(t.state),y(e=>Object.fromEntries(Object.entries(e).filter(([e])=>e!==t.task.id))),e(s(`schedules:schedulesPage.scheduledTaskSaved`))}catch(e){j(e instanceof Error?e.message:String(e))}finally{k(!1)}}},ue=async()=>{if(V){k(!0),j(``);try{await a(`/api/schedules/${encodeURIComponent(V.id)}/run`,{method:`POST`,body:`{}`}),await R(),e(s(`schedules:schedulesPage.scheduledTaskStarted`))}catch(e){j(e instanceof Error?e.message:String(e))}finally{k(!1)}}},pe=async()=>{if(V&&await o({title:s(`schedules:schedulesPage.deleteScheduledTask`),message:s(`schedules:schedulesPage.deleteScheduledTaskNameAndItsRunHistory`,{name:V.name}),confirmLabel:s(`schedules:schedulesPage.delete`)}))try{await a(`/api/schedules/${encodeURIComponent(V.id)}`,{method:`DELETE`}),await R(),e(s(`schedules:schedulesPage.scheduledTaskDeleted`))}catch(e){j(e instanceof Error?e.message:String(e))}},X=t=>{p(t.state),g(t.task.id),e(s(`schedules:schedulesPage.scheduledTaskCreated`))},Z=e=>(0,B.jsxs)(`span`,{className:`flex min-w-0 flex-col items-end gap-0.5 max-[650px]:flex-row max-[650px]:items-center max-[650px]:gap-2`,children:[e.lastStatus===`running`?(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-content-secondary`,children:[(0,B.jsx)(T,{status:`run`,className:`size-3.5`}),s(`schedules:schedulesPage.running`)]}):(0,B.jsx)(`span`,{className:`whitespace-nowrap`,children:e.enabled?s(`schedules:schedulesPage.nextRunTime`,{time:ge(e,l)}):e.lastStatus===`missed`?s(`schedules:schedulesPage.missed`):e.frequency===`once`&&e.lastRunAt?s(`schedules:schedulesPage.onceDone`):s(`schedules:schedulesPage.pause`)}),e.lastStatus===`failed`&&(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-content-secondary`,children:[(0,B.jsx)(T,{status:`failed`,className:`size-3.5`}),s(`schedules:schedulesPage.lastRunFailed`)]})]}),Q=s(`navigation:navigation.schedules`);return(0,B.jsxs)(ae,{title:Q,description:s(`schedules:schedulesPage.lede`),back:n&&{label:s(`navigation:sidebar.features`),ariaLabel:s(`navigation:shell.backToFeaturesLabel`),onBack:n},toolbar:(0,B.jsx)(oe,{search:(0,B.jsx)(te,{id:v,value:I,onValueChange:L,placeholder:s(`navigation:pageHeader.searchPage`,{page:Q}),shortcut:d,clearLabel:s(`navigation:more.clearSearch`)}),actions:(0,B.jsxs)(S,{type:`button`,className:`h-9`,disabled:!w,onClick:()=>F(!0),children:[(0,B.jsx)(m,{}),s(`schedules:schedulesPage.newTask`)]})}),children:[b?(0,B.jsx)(N,{kind:`loading`,title:s(`schedules:schedulesPage.loadingScheduledTasks`)}):D&&!w?(0,B.jsx)(N,{kind:`error`,title:s(`schedules:schedulesPage.loadFailed`),description:D,action:(0,B.jsx)(S,{variant:`secondary`,className:`max-[650px]:h-11`,onClick:()=>{x(!0),R()},children:s(`common:pageTemplate.retry`)})}):(0,B.jsxs)(B.Fragment,{children:[(A||D)&&(0,B.jsx)(se,{children:A||D}),(0,B.jsx)(ie,{title:s(`schedules:schedulesPage.tasks`),count:f.tasks.length,meta:f.tasks.length?s(`schedules:schedulesPage.enabledCount`,{count:J}):void 0,children:q.length?(0,B.jsx)(re,{children:q.map(e=>{let t=h===e.id;return(0,B.jsx)(ne,{"data-schedule-task":e.id,className:`schedule-list-item`,icon:(0,B.jsx)(c,{}),name:e.name,description:e.targetType===`workflow`?(0,B.jsx)(`span`,{className:`font-mono`,children:G(e)}):e.targetType===`bot`?s(`schedules:schedulesPage.botTarget`,{message:e.botMessage||``}):e.prompt,meta:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{children:de(e.frequency,s)}),(0,B.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,B.jsx)(`span`,{className:`tabular-nums`,children:e.frequency===`interval`?`${e.intervalValue} ${fe(e.intervalUnit,s)}`:e.frequency===`once`?`${e.date} ${e.time}`:e.time}),(0,B.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,B.jsx)(`span`,{className:`truncate`,children:e.timezone}),e.createdBy?.kind===`agent`&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,B.jsx)(`span`,{"data-schedule-created-by":`agent`,children:s(`schedules:schedulesPage.createdByAgent`)})]})]}),status:Z(e),expanded:t,onExpandedChange:t=>g(t?e.id:``),toggleLabel:s(`schedules:schedulesPage.toggleTaskDetails`,{name:e.name}),detail:t&&e.targetType===`bot`?(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm text-content-secondary`,children:[(0,B.jsx)(`span`,{className:`min-w-0 flex-1`,children:s(`schedules:schedulesPage.botManagedThere`)}),(0,B.jsx)(S,{size:`sm`,variant:`outline`,onClick:()=>u(`/bots/${encodeURIComponent(e.botId||``)}`),children:s(`schedules:schedulesPage.openBot`)})]}):t&&U&&V?(0,B.jsx)(ve,{task:V,draft:U,runs:W,saving:ee,workflows:H,notificationTargets:f.notificationTargets,language:l,onUpdate:Y,onToggleNotification:ce,onRun:ue,onRemove:pe,onSave:le,onEditTemplates:r}):null},e.id)})}):(0,B.jsx)(P,{title:f.tasks.length?s(`schedules:schedulesPage.noMatchingTasks`):s(`schedules:schedulesPage.theTimelineIsStillUnlit`),description:f.tasks.length?void 0:s(`schedules:schedulesPage.createATaskAndLetItSetOutAutomaticallyAtTheAppointedTime`)})})]}),M&&(0,B.jsx)(ye,{notificationTargets:f.notificationTargets,workflows:H,defaultCwd:f.defaultCwd,onClose:()=>F(!1),onCreated:e=>{F(!1),X(e)}})]})}function ve({task:e,draft:t,runs:n,saving:r,workflows:a,notificationTargets:o,language:s,onUpdate:c,onToggleNotification:u,onRun:d,onRemove:f,onSave:m,onEditTemplates:h}){let{t:_}=i(),v=e.lastStatus===`running`;return(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-4`,children:[(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,B.jsxs)(`label`,{className:`mr-auto inline-flex min-h-8 items-center gap-2.5 text-sm text-content max-[650px]:min-h-11`,children:[(0,B.jsx)(R,{value:t.enabled,onChange:e=>c({enabled:e}),ariaLabel:_(`schedules:schedulesPage.enableTaskName`,{name:t.name})}),t.enabled?_(`schedules:schedulesPage.enabled`):_(`schedules:schedulesPage.pause`)]}),(0,B.jsxs)(S,{variant:`secondary`,size:`sm`,className:`max-[650px]:h-11`,disabled:r||v,onClick:d,children:[v?(0,B.jsx)(x,{}):(0,B.jsx)(p,{}),_(v?`schedules:schedulesPage.running`:`schedules:schedulesPage.runNow`)]}),(0,B.jsx)(S,{variant:`ghost`,size:`icon-sm`,className:`hover:bg-danger-soft hover:text-danger max-[650px]:size-11`,title:_(`schedules:schedulesPage.deleteTask`),"aria-label":_(`schedules:schedulesPage.deleteTask`),onClick:f,children:(0,B.jsx)(g,{})})]}),(0,B.jsx)($,{targetType:t.targetType,prompt:t.prompt,workflowId:t.workflowId,workflowInputs:t.workflowInputs,workflows:a,onChange:c}),t.targetType===`prompt`&&(0,B.jsx)(me,{value:t.cwd,onChange:e=>c({cwd:e})}),(0,B.jsx)(`div`,{className:K,children:(0,B.jsxs)(`div`,{className:q,children:[(0,B.jsxs)(F,{variant:`control`,children:[_(`schedules:schedulesPage.frequency`),(0,B.jsx)(I,{value:t.frequency,onChange:e=>c({frequency:e.target.value}),children:Object.keys(H).map(e=>(0,B.jsx)(`option`,{value:e,children:de(e,_)},e))})]}),t.frequency===`interval`?(0,B.jsxs)(F,{variant:`control`,children:[_(`schedules:schedulesPage.runInterval`),(0,B.jsxs)(`span`,{className:J,children:[(0,B.jsx)(A,{type:`number`,min:`1`,value:t.intervalValue,onChange:e=>c({intervalValue:Number(e.target.value)})}),(0,B.jsx)(I,{value:t.intervalUnit,onChange:e=>c({intervalUnit:e.target.value}),children:Object.keys(U).map(e=>(0,B.jsx)(`option`,{value:e,children:fe(e,_)},e))})]})]}):(0,B.jsxs)(B.Fragment,{children:[t.frequency===`once`&&(0,B.jsxs)(F,{variant:`control`,children:[_(`schedules:schedulesPage.date`),(0,B.jsx)(A,{type:`date`,className:`tabular-nums`,value:t.date,onChange:e=>c({date:e.target.value})})]}),(0,B.jsxs)(F,{variant:`control`,children:[_(`schedules:schedulesPage.time`),(0,B.jsx)(A,{type:`time`,className:`tabular-nums`,value:t.time,onChange:e=>c({time:e.target.value})})]})]}),(0,B.jsxs)(F,{variant:`control`,children:[_(`schedules:schedulesPage.timeZone`),(0,B.jsx)(I,{value:t.timezone,onChange:e=>c({timezone:e.target.value}),children:W.map(e=>(0,B.jsx)(`option`,{value:e,children:e},e))})]}),t.targetType===`prompt`&&(0,B.jsx)(X,{value:t.executionMode,onChange:e=>c({executionMode:e})})]})}),(0,B.jsxs)(`div`,{className:b(`schedule-notification-section pt-3`,K),children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,B.jsx)(`strong`,{className:`text-sm font-medium`,children:_(`schedules:schedulesPage.notificationChannels`)}),(0,B.jsx)(`button`,{type:`button`,className:`text-button text-xs font-medium text-content-secondary underline underline-offset-2 hover:text-content max-[650px]:min-h-11`,onClick:h,children:_(`schedules:schedulesPage.editTemplates`)})]}),(0,B.jsx)(`p`,{className:`mt-0.5 text-xs text-content-muted`,children:_(`schedules:schedulesPage.notificationChannelsHelp`)}),(0,B.jsx)(`div`,{className:`schedule-notification-targets mt-2.5 grid grid-cols-[repeat(auto-fill,minmax(132px,1fr))] gap-2`,children:Object.entries(V).map(([e,n])=>{let r=n.Icon,i=t.notifications.includes(e);return(0,B.jsxs)(`button`,{type:`button`,"aria-pressed":i,className:b(`grid min-h-[52px] grid-cols-[16px_minmax(0,1fr)_16px] items-center gap-2 rounded-md border px-2.5 py-2 text-left transition-colors duration-(--d-fast)`,i?`selected border-star-border bg-star-soft text-star-strong`:`border-stroke bg-panel text-content hover:bg-surface-subtle`),onClick:()=>u(e),children:[(0,B.jsx)(r,{className:`size-4`}),(0,B.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,B.jsx)(`strong`,{className:`truncate text-sm font-medium`,children:pe(e,_)}),(0,B.jsx)(`small`,{className:`truncate text-xs text-content-muted`,children:o[e].enabled?_(`schedules:schedulesPage.configured`):_(`schedules:schedulesPage.notConfigured`)})]}),(0,B.jsx)(l,{className:b(`size-4`,i?`text-star-strong`:`text-content-faint`)})]},e)})}),(0,B.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-x-3 gap-y-1.5`,children:[(0,B.jsx)(`span`,{id:`schedule-notify-on-${e.id}`,className:`text-xs text-content-muted`,children:_(`schedules:schedulesPage.notifyWhen`)}),(0,B.jsx)(`div`,{role:`group`,"aria-labelledby":`schedule-notify-on-${e.id}`,className:b(`schedule-notification-chip`,Y),children:[`always`,`failure`].map(e=>(0,B.jsx)(`button`,{type:`button`,"aria-pressed":t.notifyOn===e,className:ce,onClick:()=>c({notifyOn:e}),children:_(e===`failure`?`schedules:schedulesPage.failuresOnly`:`schedules:schedulesPage.completionAndFailure`)},e))})]})]}),(0,B.jsxs)(`div`,{className:`form-footer mt-4 flex items-center justify-between gap-2.5 border-t border-stroke-soft pt-3 max-[650px]:flex-wrap`,children:[(0,B.jsx)(`span`,{className:`text-xs text-content-muted tabular-nums`,children:e.lastRunAt?_(`schedules:schedulesPage.lastRunTime`,{time:w(e.lastRunAt,s)}):_(`schedules:schedulesPage.nextRunTime`,{time:ge(e,s)})}),(0,B.jsxs)(S,{className:`max-[650px]:h-11 max-[650px]:w-full`,disabled:r||!Q(t.targetType,t.prompt,t.workflowId,t.workflowInputs,a),onClick:m,children:[r?(0,B.jsx)(x,{className:`text-current`}):null,_(r?`schedules:schedulesPage.saving`:`schedules:schedulesPage.saveTask`)]})]})]}),(0,B.jsxs)(`section`,{"aria-labelledby":`schedule-runs-${e.id}`,className:`min-w-0`,children:[(0,B.jsxs)(`h3`,{id:`schedule-runs-${e.id}`,className:`mb-1.5 text-[13px] font-medium text-content-muted tabular-nums`,children:[_(`schedules:schedulesPage.recentRuns`),` · `,n.length]}),n.length?(0,B.jsx)(`ul`,{className:`divide-y divide-stroke-soft overflow-hidden rounded-[var(--r-md)] border border-stroke`,children:n.map(e=>(0,B.jsxs)(`li`,{className:`schedule-run-row grid min-h-11 grid-cols-[18px_minmax(0,1fr)_auto] items-start gap-2.5 px-3 py-2.5 ${e.status}`,children:[(0,B.jsx)(le,{status:e.status}),(0,B.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,B.jsx)(`strong`,{className:`line-clamp-2 text-sm leading-5 font-medium text-content`,children:e.status===`running`?_(`schedules:schedulesPage.running2`):e.status===`completed`?e.summary||_(`schedules:schedulesPage.taskCompleted`):e.status===`interrupted`?_(`schedules:schedulesPage.taskInterrupted`):e.error||_(`schedules:schedulesPage.taskFailed`)}),(0,B.jsxs)(`small`,{className:`text-xs text-content-muted tabular-nums`,children:[w(e.startedAt,s),` ·`,` `,e.trigger===`manual`?_(`schedules:schedulesPage.manualRun`):_(`schedules:schedulesPage.scheduledTrigger`),e.durationMs?` · ${_(`schedules:schedulesPage.countSec`,{count:Math.round(e.durationMs/1e3)})}`:``]})]}),(0,B.jsx)(`em`,{className:`font-mono text-xs leading-5 text-content-secondary not-italic tabular-nums`,children:new Intl.DateTimeFormat(s,{hour:`2-digit`,minute:`2-digit`}).format(new Date(e.startedAt))})]},e.id))}):(0,B.jsx)(P,{compact:!0,title:_(`schedules:schedulesPage.noRunHistory`)})]})]})}function ye({notificationTargets:e,workflows:t,defaultCwd:n,onClose:r,onCreated:o}){let{t:s}=i(),[c,l]=(0,z.useState)(``),[u,d]=(0,z.useState)(`prompt`),[f,p]=(0,z.useState)(``),[h,g]=(0,z.useState)(``),[v,y]=(0,z.useState)({}),[b,C]=(0,z.useState)(n||``),[w,T]=(0,z.useState)(`full-access`),[j,M]=(0,z.useState)(!1),[N,P]=(0,z.useState)(``);return(0,B.jsx)(k,{open:!0,onOpenChange:e=>!e&&r(),children:(0,B.jsx)(D,{size:`compact`,children:(0,B.jsxs)(`form`,{className:`grid min-w-0`,onSubmit:async t=>{t.preventDefault(),M(!0),P(``);try{let t=Object.entries(e).filter(([,e])=>e.enabled).map(([e])=>e);o(await a(`/api/schedules`,{method:`POST`,body:JSON.stringify({name:c,targetType:u,prompt:f,workflowId:h,workflowInputs:v,cwd:b,enabled:!0,frequency:`daily`,time:`09:00`,timezone:`Asia/Hong_Kong`,executionMode:w,notifications:t,notifyOn:`always`})}))}catch(e){P(e instanceof Error?e.message:String(e))}finally{M(!1)}},children:[(0,B.jsxs)(ee,{children:[(0,B.jsx)(O,{children:s(`schedules:schedulesPage.newScheduledTask`)}),(0,B.jsx)(E,{children:s(`schedules:schedulesPage.youCanContinueSettingTheRunTimeAndNotificationChannelsAfterCreation`)})]}),(0,B.jsxs)(F,{variant:`control`,children:[s(`schedules:schedulesPage.taskName`),(0,B.jsx)(A,{value:c,onChange:e=>l(e.target.value),placeholder:s(`schedules:schedulesPage.forExampleDailyCodeReview`)})]}),(0,B.jsx)($,{targetType:u,prompt:f,workflowId:h,workflowInputs:v,workflows:t,onChange:e=>{e.targetType&&d(e.targetType),e.prompt!==void 0&&p(e.prompt),e.workflowId!==void 0&&g(e.workflowId),e.workflowInputs!==void 0&&y(e.workflowInputs)}}),u===`prompt`&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(me,{value:b,onChange:C}),(0,B.jsx)(X,{value:w,onChange:T})]}),N&&(0,B.jsxs)(L,{children:[(0,B.jsx)(_,{size:13}),N]}),(0,B.jsxs)(`div`,{className:`mt-5 flex justify-end gap-2 max-[650px]:[&>button]:h-11 max-[650px]:[&>button]:flex-1`,children:[(0,B.jsx)(S,{type:`button`,variant:`secondary`,onClick:r,children:s(`schedules:schedulesPage.cancel`)}),(0,B.jsxs)(S,{type:`submit`,disabled:j||!c.trim()||!Q(u,f,h,v,t),children:[j?(0,B.jsx)(x,{className:`text-current`}):(0,B.jsx)(m,{}),s(j?`schedules:schedulesPage.creating`:`schedules:schedulesPage.createTask`)]})]})]})})})}export{_e as SchedulesPage};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/GitDiffViewer-b4QqrnGx.js","assets/rolldown-runtime-B0Z9INg1.js","assets/vendor-react-DwNgTV1j.js","assets/use-i18n-BVRhlQ1v.js","assets/i18n-D80GstlU.js","assets/vendor-router-CSN_DGvx.js","assets/index-CiRnxTh1.js","assets/index-BnQCk-QI.css","assets/storage-DtvZ_lEu.js","assets/vendor-state-GkUciC5H.js","assets/createLucideIcon-Cd-3GVxJ.js","assets/x-07u4-129.js","assets/utils-C8uzG5AZ.js","assets/vendor-ui-DvrYggeS.js","assets/button-CCcCN8tE.js","assets/dist-41X0pdUs.js","assets/events-CuVwhRWu.js","assets/esm-DCV8yILT.js","assets/TaskTerminalView-Cd4PIsW7.js","assets/square-terminal-BVG6cUT1.js","assets/square-bHHVTT3G.js","assets/PageState-Cz6vFMXv.js","assets/AppSelect-DQYKUW5E.js","assets/use-mobile-C2tPBAza.js","assets/select-Bbk9bmXO.js","assets/check-2vYc6QaP.js","assets/chevron-down-CxtxIjiP.js","assets/chevron-up-D_ZcXjqr.js","assets/chevrons-up-down-C2sEPdAh.js","assets/dist-BsRXXcSL.js","assets/dist-BiRPwy4W.js","assets/dist-DzGQ7sLi.js","assets/es2015-DTZdOI9P.js","assets/dist-BRjj4UeB.js","assets/dist-OB2r6Xsr.js","assets/dist-BS3ekNDj.js","assets/terminal-context-aIsIJPn8.js","assets/TaskTerminalView-BrP-ENHg.css","assets/TaskProcessesPane-FwGhuWob.js","assets/chevron-right-C3t2Rckj.js","assets/checkbox-BrEHgFV0.js","assets/FileAttachmentPreview-Dc92kq62.js","assets/api-AeFmYDtL.js","assets/abort-signal-f4JsiYKX.js","assets/http-response-PZN5QIRk.js","assets/event-stream-Dh7h5sXJ.js","assets/http-Bp65Kb4t.js","assets/download-BCfIiuaL.js","assets/file-Bllajneu.js","assets/refresh-cw-TbWxTY4K.js","assets/tabs-DsgBuvJv.js","assets/dist-BaBySQmo.js","assets/format-DMJQzoZ7.js","assets/dialog-BDNbY1pW.js","assets/dist-BHkR6BLP.js","assets/MarkdownMessage-BEmTlPSn.js","assets/vendor-markdown-plugins-CT5L3KA9.js","assets/vendor-shiki-runtime-DM7fm4Bl.js","assets/vendor-markdown-plugins-DEcVZfaU.css","assets/vendor-markdown-CT6Z4fh8.js","assets/copy-DHmIFc52.js","assets/route-context-DvWDul4T.js"])))=>i.map(i=>d[i]);
2
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{h as t}from"./vendor-router-CSN_DGvx.js";import{i as n,r}from"./vendor-react-DwNgTV1j.js";import{t as i}from"./use-i18n-BVRhlQ1v.js";import{t as a}from"./useQuery-DfOU-27z.js";import{t as o}from"./createLucideIcon-Cd-3GVxJ.js";import{t as s}from"./arrow-left-B8oVrQ2S.js";import{t as c}from"./arrow-right-DqLOhpA2.js";import{t as l}from"./arrow-up-DST6-qVQ.js";import{t as u}from"./check-2vYc6QaP.js";import{t as d}from"./chevron-down-CxtxIjiP.js";import{t as f}from"./chevron-right-C3t2Rckj.js";import{t as p}from"./earth-Ddy13fHh.js";import{t as m}from"./external-link-CEQqPcqc.js";import{i as h}from"./GitDiffViewer-b4QqrnGx.js";import{t as g}from"./file-Bllajneu.js";import{E as _,a as v,h as y,i as b,m as x,o as S,r as C,u as w}from"./side-chat-context-scyCH7W7.js";import{t as T}from"./git-branch-N7LGjtzt.js";import{t as E}from"./image-BY_c3FYU.js";import{t as D}from"./link-2-mgasYn21.js";import{t as O}from"./loader-circle-BOwQzHB-.js";import{t as k}from"./message-square-SKjZyY3v.js";import{t as A}from"./pause-CYWpPg1R.js";import{t as j}from"./refresh-cw-TbWxTY4K.js";import{t as ee}from"./square-bHHVTT3G.js";import"./tooltip-D4MFbqcG.js";import{t as M}from"./utils-C8uzG5AZ.js";import{n as N,t as P}from"./button-CCcCN8tE.js";import{c as te,r as F}from"./shortcuts-Dsd4mjfP.js";import{t as I}from"./chat-api-CSAs7Y6E.js";import{t as L}from"./input-CPw-zkYh.js";import{n as R}from"./session-change-summary-api-BHpd8dcW.js";import{n as ne,t as z}from"./PageState-Cz6vFMXv.js";import{t as re}from"./AppSelect-DQYKUW5E.js";import{t as ie}from"./session-web-preview-guvsmkWE.js";import"./collapsible-Dcoy-qnz.js";import{o as B}from"./session-tree-summary-BLv-bkYC.js";import{n as ae,r as V,t as H}from"./web-preview-C7DdG9JP.js";import{n as U}from"./useNativeBrowser-C0j3zafh.js";var W=o(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),G=o(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),K=o(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),q=o(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),J=e(n(),1),Y=r(),oe={completed:`completed`,in_progress:`running`,paused:`pending`,blocked:`blocked`,pending:`pending`};function se(e){let t=new Map(e.map(e=>[String(e.id||``),e])),n=e=>e?.status===`completed`;return e.map(e=>{let r=String(e.id||``),i=(Array.isArray(e.dependsOn)?e.dependsOn:[]).map(e=>t.get(String(e))).filter(e=>!!e&&!n(e)),a=e.status!==`completed`&&(e.status===`blocked`||i.length>0);return{...e,id:r,blocked:a,blockedBy:i}})}function ce({status:e,t}){let n=t(e===`completed`?`chat:planBoard.completed`:e===`in_progress`?`chat:planBoard.inProgress`:e===`paused`?`chat:planBoard.paused`:e===`blocked`?`chat:planBoard.blocked`:`chat:planBoard.pending`);return(0,Y.jsxs)(`span`,{className:`plan-board-status grid size-[18px] flex-none place-items-center rounded-xs text-content-muted [&.completed]:bg-success-soft [&.completed]:text-success [&.running]:text-accent-fg [&.blocked]:bg-danger-soft [&.blocked]:text-danger ${oe[String(e)]||`pending`}`,title:n,children:[e===`completed`?(0,Y.jsx)(u,{size:12,strokeWidth:2.25}):e===`in_progress`?(0,Y.jsx)(N,{className:`size-3.5`}):e===`paused`?(0,Y.jsx)(A,{size:11,strokeWidth:2}):e===`blocked`?(0,Y.jsx)(K,{size:11,strokeWidth:2}):(0,Y.jsx)(W,{size:11,strokeWidth:2}),(0,Y.jsx)(`span`,{className:`sr-only`,children:n})]})}function le({item:e,current:t,running:n,t:r}){return(0,Y.jsxs)(`li`,{className:`plan-board-row flex min-w-0 flex-col gap-[2px] rounded-sm px-[6px] py-[6px] aria-[current=step]:bg-surface-subtle ${e.blocked?`blocked`:``}`,"aria-current":t?`step`:void 0,"data-pisper-plan-current":t?`true`:void 0,"data-pisper-plan-id":e.id,children:[(0,Y.jsxs)(`div`,{className:`flex min-w-0 items-center gap-[10px]`,children:[(0,Y.jsx)(ce,{status:e.blocked?`blocked`:e.status===`in_progress`&&!n?`paused`:e.status,t:r}),(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px] ${e.status===`completed`?`text-content-muted`:`text-foreground`}`,title:e.title,children:e.title}),e.assignee?(0,Y.jsxs)(`span`,{className:`inline-flex max-w-[40%] flex-none items-center gap-[4px] truncate rounded-xs border border-stroke px-[6px] font-mono text-[12px] leading-[18px] text-content-secondary`,title:r(`chat:planBoard.assignedTo`,{name:e.assignee}),children:[(0,Y.jsx)(_,{size:11,className:`flex-none`}),e.assignee]}):e.status!==`completed`&&(0,Y.jsx)(`span`,{className:`flex-none text-[12px] text-content-muted`,children:r(`chat:planBoard.unassigned`)})]}),e.blockedBy.length>0&&(0,Y.jsxs)(`div`,{className:`inline-flex min-w-0 items-center gap-[5px] pl-[28px] text-[12px] text-content-muted`,children:[(0,Y.jsx)(K,{size:11,className:`flex-none`}),(0,Y.jsx)(`span`,{className:`truncate`,children:r(`chat:planBoard.waitingFor`,{tasks:e.blockedBy.map(e=>e.title||e.id).join(` · `)})})]})]})}function ue({plan:e,running:t,header:n,collapsible:r=!1}){let{t:a}=i(),o=(0,J.useRef)(null),[s,c]=(0,J.useState)(!0),l=e?.items||[],u=se(l),f=u.filter(e=>e.status===`completed`).length,p=u.filter(e=>e.status===`in_progress`&&!e.blocked).length,m=u.filter(e=>e.blocked).length,h=u.find(e=>e.status===`in_progress`&&!e.blocked)?.id??u.find(e=>e.blocked)?.id??u.find(e=>e.status===`pending`)?.id??u.at(-1)?.id;if((0,J.useLayoutEffect)(()=>{if(r&&!s)return;let e=o.current,t=e?.querySelector(`[data-pisper-plan-current="true"]`);if(!e||!t)return;let n=e.getBoundingClientRect(),i=t.getBoundingClientRect();i.top<n.top?e.scrollTop-=n.top-i.top:i.bottom>n.bottom&&(e.scrollTop+=i.bottom-n.bottom)},[r,h,s,u.length]),!l.length)return null;let g=u.find(e=>e.id===h),_=(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(G,{className:`flex-none text-content-muted`,size:15}),(0,Y.jsx)(`strong`,{className:`tabular-nums`,children:a(`chat:planBoard.progress`,{completed:f,total:l.length})}),g?(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-content-secondary`,title:g.title,children:g.title}):null,(0,Y.jsxs)(`span`,{className:`plan-board-counts inline-flex flex-none items-center gap-[8px] text-content-muted tabular-nums @max-[470px]:hidden`,children:[p>0&&(0,Y.jsx)(`span`,{children:a(t?`chat:planBoard.countInProgress`:`chat:planBoard.countPaused`,{count:p})}),m>0&&(0,Y.jsx)(`span`,{className:`blocked text-danger`,children:a(`chat:planBoard.countBlocked`,{count:m})})]}),n,r?(0,Y.jsx)(d,{className:`plan-board-chevron flex-none text-content-muted transition-transform duration-(--d-fast) ease-precise [.plan-board-collapsible[open]_&]:rotate-180`,size:15}):null]}),v=(0,Y.jsx)(`ul`,{ref:o,className:`plan-board-list [.plan-board-collapsible_>_&]:border-t [.plan-board-collapsible_>_&]:border-stroke-soft [.plan-board-collapsible_>_&]:p-[6px_8px_8px] m-0 flex list-none flex-col gap-[1px] pt-[6px]${u.length>4?` is-scrollable [.session-plan-popover_.plan-board-list&]:[block-size:min(250px,38dvh)] [.plan-board-list&]:[block-size:min(220px,34dvh)] [.plan-board-list&]:overflow-y-auto [.plan-board-list&]:[overscroll-behavior:contain] [.plan-board-list&]:pr-[4px] [.plan-board-list&]:[scrollbar-gutter:stable] [.plan-board-list&:focus-visible]:outline-2 [.plan-board-list&:focus-visible]:outline-focus [.plan-board-list&:focus-visible]:outline-offset-2`:``}`,tabIndex:u.length>4?0:void 0,children:u.map(e=>(0,Y.jsx)(le,{running:t,item:e,current:e.id===h,t:a},e.id))});return r?(0,Y.jsxs)(`details`,{className:`plan-board plan-board-collapsible m-[0_auto] flex w-[min(900px,100%)] flex-col overflow-hidden rounded-md border border-stroke bg-panel !p-0 [.session-plan-popover_&]:w-full [.session-plan-popover_&]:border-0 [.session-plan-popover_&]:bg-transparent`,open:s,onToggle:e=>c(e.currentTarget.open),children:[(0,Y.jsx)(`summary`,{className:`plan-board-summary flex min-w-0 items-center gap-[8px] border-b border-stroke-soft pb-[8px] text-[13px] text-content-secondary [&_strong]:flex-none [&_strong]:font-medium [&_strong]:text-foreground [.plan-board-collapsible_>_&]:min-h-[34px] [.plan-board-collapsible_>_&]:cursor-pointer [.plan-board-collapsible_>_&]:list-none [.plan-board-collapsible_>_&]:border-0 [.plan-board-collapsible_>_&]:p-[6px_12px] max-[650px]:[.plan-board-collapsible_>_&]:min-h-11 [.plan-board-collapsible_>_&::-webkit-details-marker]:hidden [.plan-board-collapsible_>_&:hover]:bg-surface-subtle [.plan-board-collapsible_>_&:focus-visible]:outline-2 [.plan-board-collapsible_>_&:focus-visible]:-outline-offset-2 [.plan-board-collapsible_>_&:focus-visible]:outline-focus`,"aria-label":a(`chat:planBoard.toggleAriaLabel`),children:_}),v]}):(0,Y.jsxs)(`section`,{className:`plan-board m-[0_auto] flex w-[min(900px,100%)] flex-col rounded-md border border-stroke bg-panel p-[10px_12px] [.session-plan-popover_&]:w-full [.session-plan-popover_&]:border-0 [.session-plan-popover_&]:bg-transparent [.session-plan-popover_&]:p-0`,"aria-label":a(`chat:planBoard.ariaLabel`),children:[(0,Y.jsx)(`div`,{className:`plan-board-summary flex min-w-0 items-center gap-[8px] border-b border-stroke-soft pb-[8px] text-[13px] text-content-secondary [&_strong]:flex-none [&_strong]:font-medium [&_strong]:text-foreground [.plan-board-collapsible_>_&]:min-h-[34px] [.plan-board-collapsible_>_&]:cursor-pointer [.plan-board-collapsible_>_&]:list-none [.plan-board-collapsible_>_&]:border-0 [.plan-board-collapsible_>_&]:p-[6px_12px] max-[650px]:[.plan-board-collapsible_>_&]:min-h-11 [.plan-board-collapsible_>_&::-webkit-details-marker]:hidden [.plan-board-collapsible_>_&:hover]:bg-surface-subtle [.plan-board-collapsible_>_&:focus-visible]:outline-2 [.plan-board-collapsible_>_&:focus-visible]:-outline-offset-2 [.plan-board-collapsible_>_&:focus-visible]:outline-focus`,children:_}),v]})}var de=(0,J.memo)(ue),fe=(0,J.lazy)(()=>t(()=>import(`./GitDiffViewer-b4QqrnGx.js`).then(e=>e.n).then(e=>({default:e.InlineGitDiff})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17])));function X({sessionId:e,path:t,scope:n,revision:r=0,position:o,onReading:s,mode:c,fill:l=!1}){let{t:u}=i(),d=a({queryKey:[`task-file-diff`,e,n,t,r],queryFn:({signal:r})=>n===`project`?I.getFileDiff(e,t,{signal:r}):I.getSessionFileChangeDiff(e,t,{signal:r})});return d.isPending?(0,Y.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 px-3 py-2.5 text-xs text-content-muted`,children:[(0,Y.jsx)(N,{className:`size-3.5`}),u(`chat:focusSession.gitLoading`)]}):d.isError?(0,Y.jsxs)(`div`,{className:`px-3 py-2.5`,children:[(0,Y.jsx)(`p`,{role:`alert`,className:`text-xs text-danger`,children:d.error.message}),(0,Y.jsx)(P,{variant:`ghost`,size:`sm`,onClick:()=>void d.refetch(),children:u(`chat:chatMessage.filePreviewRetry`)})]}):(0,Y.jsx)(J.Suspense,{fallback:null,children:(0,Y.jsx)(fe,{position:o,onReading:s,diff:d.data.diff,truncated:d.data.diffTruncated,mode:c,fill:l})})}function pe({sessionId:e,cwd:t,streaming:n,view:r,onViewChange:o}){let{t:s}=i(),c=a({queryKey:[`task-project-changes`,e,t,n],queryFn:({signal:t})=>I.getVcsChanges(e,{signal:t})}),l=h(r.reading?.list,e=>o({reading:{...r.reading,list:e}})),u=(0,J.useMemo)(()=>x(c.data?.diff||``,c.data?.files.map(e=>e.path)||[],c.data?.diffTruncated),[c.data]),d=r.expandedFiles.filter(e=>c.data&&!c.data.files.some(t=>t.path===e)),p=c.error?.message||c.data?.error,m=c.data?.files||[];return(0,Y.jsxs)(`section`,{"aria-label":s(`chat:workbench.projectChanges`),className:`flex min-h-0 flex-1 flex-col`,children:[(0,Y.jsxs)(`header`,{className:`flex min-h-10 min-w-0 shrink-0 items-center gap-2 border-b border-stroke-soft pr-1.5 pl-3`,children:[(0,Y.jsx)(`h2`,{className:`min-w-0 flex-1 truncate text-xs font-medium tracking-[.02em] text-content-muted`,children:s(`chat:workbench.projectChanges`)}),c.data?.isRepo&&!p&&(0,Y.jsxs)(`span`,{className:`shrink-0 font-mono text-xs tabular-nums`,children:[(0,Y.jsxs)(`span`,{className:`text-success`,children:[`+`,u.added]}),` `,(0,Y.jsxs)(`span`,{className:`text-danger`,children:[`−`,u.removed]})]}),(0,Y.jsx)(P,{variant:`ghost`,size:`icon`,className:`max-[650px]:size-11`,"aria-label":s(`chat:focusSession.gitRefresh`),disabled:c.isFetching,onClick:()=>void c.refetch(),children:(0,Y.jsx)(j,{size:15,className:c.isFetching?`animate-spin`:void 0})})]}),(0,Y.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-2 border-b border-stroke-soft px-3 py-2.5`,children:[(0,Y.jsx)(`p`,{className:`text-xs leading-relaxed text-content-muted`,children:s(`chat:workbench.projectScope`)}),(0,Y.jsxs)(`p`,{className:`flex min-w-0 items-center gap-1.5 text-xs`,title:t,children:[c.data?.branch&&(0,Y.jsxs)(`span`,{className:`inline-flex h-5.5 max-w-[45%] shrink-0 items-center gap-1 rounded-xs border border-stroke px-1.5 font-mono text-content-secondary`,children:[(0,Y.jsx)(T,{size:12,className:`shrink-0`,"aria-hidden":`true`}),(0,Y.jsx)(`span`,{className:`truncate`,children:c.data.branch})]}),(0,Y.jsx)(`span`,{className:`min-w-0 truncate font-mono text-content-muted`,children:t})]}),(0,Y.jsxs)(`div`,{className:`flex gap-1`,children:[(0,Y.jsx)(P,{variant:`ghost`,size:`sm`,disabled:!m.length||!!p,onClick:()=>o({expandedFiles:m.map(e=>e.path)}),children:s(`chat:workbench.expandAll`)}),(0,Y.jsx)(P,{variant:`ghost`,size:`sm`,onClick:()=>o({expandedFiles:[]}),children:s(`chat:workbench.collapseAll`)})]})]}),!c.isFetching&&!p&&d.map(e=>(0,Y.jsx)(`p`,{role:`status`,className:`break-all px-3 pt-2 text-xs text-content-muted`,children:s(`chat:workbench.fileNoLongerChanged`,{path:e})},e)),c.isPending?(0,Y.jsx)(ne,{kind:`loading`,title:s(`chat:focusSession.gitLoading`)}):p?(0,Y.jsx)(`p`,{role:`alert`,className:`p-3 text-sm text-danger`,children:p}):c.data?.isRepo?m.length?(0,Y.jsx)(`div`,{ref:l.ref,className:`min-h-0 flex-1 overflow-y-auto`,children:m.map(t=>{let n=r.expandedFiles.includes(t.path);return(0,Y.jsxs)(`article`,{className:`border-b border-stroke-soft`,children:[(0,Y.jsxs)(`button`,{"aria-expanded":n,title:t.path,className:`flex min-h-9 w-full min-w-0 items-center gap-2 pr-3 pl-2 text-left text-sm hover:bg-surface-subtle focus-visible:-outline-offset-2 max-[650px]:min-h-11 pointer-coarse:min-h-11 ${n?`bg-surface-subtle`:``}`,onClick:()=>o({expandedFiles:n?r.expandedFiles.filter(e=>e!==t.path):[...r.expandedFiles,t.path]}),children:[(0,Y.jsx)(f,{size:14,className:`shrink-0 text-content-muted transition-transform duration-(--d-fast) ${n?`rotate-90`:``}`}),(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs`,children:t.path}),(0,Y.jsx)(`span`,{className:`min-w-4 shrink-0 text-center font-mono text-xs font-medium text-content-secondary`,children:t.status}),Object.hasOwn(u.files,t.path)&&(0,Y.jsxs)(`span`,{className:`shrink-0 font-mono text-xs tabular-nums`,children:[(0,Y.jsxs)(`span`,{className:`text-success`,children:[`+`,u.files[t.path].added]}),` `,(0,Y.jsxs)(`span`,{className:`text-danger`,children:[`−`,u.files[t.path].removed]})]})]}),n&&(0,Y.jsx)(`p`,{className:`break-all px-3 py-1.5 font-mono text-xs text-content-muted`,children:t.path}),n&&(0,Y.jsx)(X,{sessionId:e,path:t.path,scope:`project`,position:r.reading?.[t.path],onReading:e=>o({reading:{...r.reading,[t.path]:e}}),revision:c.dataUpdatedAt})]},t.path)})}):(0,Y.jsx)(z,{compact:!0,title:s(`chat:focusSession.fileChangesEmpty`)}):(0,Y.jsx)(z,{compact:!0,title:s(`chat:workbench.notRepository`)})]})}function Z(e){return e instanceof Error?e.message:String(e)}function me({sessionId:e,streaming:t,requestConfirm:n}){let{t:r}=i(),[a,o]=(0,J.useState)(0),[s,c]=(0,J.useState)(0),[l,u]=(0,J.useState)(null),[d,f]=(0,J.useState)(!0),[p,m]=(0,J.useState)(``),[h,g]=(0,J.useState)(``),[_,v]=(0,J.useState)(``),[y,b]=(0,J.useState)(null),[x,S]=(0,J.useState)(null),[C,w]=(0,J.useState)(null),T=(0,J.useRef)(!1),E=(0,J.useRef)(0),D=(0,J.useRef)(0),O=(0,J.useRef)(!0),k=(0,J.useRef)(!1),A=(0,J.useRef)(t);return(0,J.useLayoutEffect)(()=>{A.current=t},[t]),(0,J.useLayoutEffect)(()=>(T.current=!0,()=>{T.current=!1,E.current+=1,D.current+=1}),[]),(0,J.useEffect)(()=>{let t=++E.current;return D.current+=1,S(null),w(null),O.current=!0,f(!0),m(``),I.getSessionFileChanges(e).then(e=>{T.current&&t===E.current&&(u(e),c(e=>e+1))},e=>{T.current&&t===E.current&&m(Z(e))}).finally(()=>{T.current&&t===E.current&&(O.current=!1,f(!1))}),()=>{E.current+=1}},[a,e,t]),{changes:l,loading:d,error:p,actionError:h,notice:_,running:y,diff:x,setDiff:S,diffLoading:C,snapshotRevision:s,writesDisabled:d||t||!!y||!!p||!l,pendingCount:l?.summary.pending||0,reversibleCount:l?.files.filter(e=>e.canRevert&&!e.reverted).length||0,displayedError:h||p,viewDiff:async t=>{if(k.current||O.current)return;let n=++D.current;w(t),g(``);try{let i=await I.getSessionFileChangeDiff(e,t);if(!T.current||n!==D.current)return;if(!i.diff?.trim()){g(r(`chat:focusSession.fileChangesNoSnapshot`));return}S({diff:i.diff,truncated:!!i.diffTruncated})}catch(e){T.current&&n===D.current&&g(Z(e))}finally{T.current&&n===D.current&&w(null)}},runAction:async t=>{if(!T.current||k.current||O.current||A.current||!l||p||!l.files.filter(e=>t.kind===`approve`?e.pending&&!e.approved&&!e.reverted:e.canRevert&&!e.reverted).some(e=>t.path===void 0||e.path===t.path))return;k.current=!0,b(t),g(``),v(``);let i=++E.current;D.current+=1,S(null),w(null);let a=!1;try{if(t.kind===`revert`&&!await n({title:t.path?r(`chat:focusSession.fileChangesRevertFile`):r(`chat:focusSession.fileChangesRevertAll`),message:t.path?r(`chat:focusSession.fileChangesRevertFileDescription`,{path:t.path}):r(`chat:focusSession.fileChangesRevertAllDescription`),confirmLabel:r(`chat:focusSession.fileChangesConfirmRevert`),tone:`danger`})||!T.current||A.current||O.current||i!==E.current)return;a=!0;let o=t.kind===`approve`?await I.approveSessionFileChanges(e,t.path):await I.revertSessionFileChanges(e,t.path);if(R(e),!T.current||i!==E.current)return;u(o),t.kind===`approve`?v(t.path?r(`chat:focusSession.fileChangesApproved`):r(`chat:focusSession.fileChangesApproveDone`)):o.reverted?t.path===void 0&&o.files.some(e=>e.pending)?v(r(`chat:focusSession.fileChangesRevertPartial`,{count:o.reverted})):v(r(`chat:focusSession.fileChangesRevertDone`)):v(r(`chat:focusSession.fileChangesRevertUnavailable`))}catch(e){T.current&&i===E.current&&g(Z(e))}finally{k.current=!1,T.current&&(b(null),a&&(O.current=!0,f(!0),o(e=>e+1)))}},refresh:()=>{O.current=!0,f(!0),g(``),o(e=>e+1)}}}var he=(0,J.lazy)(()=>t(()=>import(`./TaskTerminalView-Cd4PIsW7.js`).then(e=>({default:e.TaskTerminalView})),__vite__mapDeps([18,1,2,3,4,5,6,7,8,9,19,10,20,14,13,15,12,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37]))),ge=(0,J.lazy)(()=>t(()=>import(`./TaskProcessesPane-FwGhuWob.js`).then(e=>({default:e.TaskProcessesPane})),__vite__mapDeps([38,1,2,3,4,5,6,7,8,9,39,10,19,20,40,25,15,29,34,12,13,14,21,22,23,24,26,27,28,30,31,32,33,35,36]))),_e=(0,J.lazy)(()=>t(()=>import(`./FileAttachmentPreview-Dc92kq62.js`).then(e=>e.n).then(e=>({default:e.FileAttachmentPreview})),__vite__mapDeps([41,1,2,3,4,5,6,7,8,9,42,43,44,45,46,47,10,48,49,11,50,13,29,15,31,51,12,14,52,53,54,32,55,56,57,58,59,25,60,61])));function Q({sources:e,view:t,onViewChange:n}){let{t:r}=i(),a=h(t.reading?.list,e=>n({reading:{...t.reading,list:e}})),o=(0,J.useContext)(y),[s,c]=(0,J.useState)(``),l=(0,J.useRef)(null),u=e.find(e=>e.id===s),d=e.filter(e=>(!t.filter||e.kind===t.filter)&&e.name.toLocaleLowerCase().includes(t.query.toLocaleLowerCase()));return(0,Y.jsxs)(`section`,{className:`flex min-h-0 flex-1 flex-col`,"aria-label":r(`chat:workbench.sources`),children:[(0,Y.jsxs)(`header`,{className:`flex min-h-10 min-w-0 shrink-0 items-center gap-2 border-b border-stroke-soft pr-1.5 pl-3`,children:[(0,Y.jsxs)(`h2`,{className:`min-w-0 flex-1 truncate text-xs font-medium tracking-[.02em] text-content-muted`,children:[r(`chat:workbench.sources`),(0,Y.jsx)(`span`,{className:`ml-1.5 tabular-nums`,children:e.length})]}),(0,Y.jsx)(`span`,{className:`shrink-0 text-xs text-content-muted`,children:r(`chat:workbench.addSource`)}),(0,Y.jsx)(`div`,{ref:o?.setSourceActionHost,className:`grid min-h-7 min-w-7 place-items-center`})]}),(0,Y.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-2 border-b border-stroke-soft px-3 py-2.5`,children:[(0,Y.jsx)(`p`,{className:`text-xs leading-relaxed text-content-muted`,children:r(`chat:workbench.sourcesScope`)}),(0,Y.jsxs)(`div`,{className:`flex min-w-0 gap-2`,children:[(0,Y.jsx)(L,{className:`min-w-0 flex-1`,"aria-label":r(`chat:workbench.searchSources`),placeholder:r(`chat:workbench.searchSources`),value:t.query,onChange:e=>n({query:e.target.value})}),(0,Y.jsxs)(re,{"aria-label":r(`chat:workbench.sourceType`),className:`w-auto max-w-[45%] shrink-0`,value:t.filter,onChange:e=>n({filter:e.target.value}),children:[(0,Y.jsx)(`option`,{value:``,children:r(`chat:workbench.allTypes`)}),(0,Y.jsx)(`option`,{value:`image`,children:r(`chat:workbench.images`)}),(0,Y.jsx)(`option`,{value:`text`,children:r(`chat:workbench.text`)}),(0,Y.jsx)(`option`,{value:`file`,children:r(`chat:workbench.files`)})]})]})]}),(0,Y.jsxs)(`div`,{ref:a.ref,className:`min-h-0 flex-1 overflow-y-auto`,children:[!d.length&&(0,Y.jsx)(z,{compact:!0,title:e.length?r(`chat:workbench.noMatches`):r(`chat:workbench.noSources`)}),d.map(e=>{let i=t.selectedSourceId===e.id,a=e.kind===`image`?E:e.method===`path`?D:g;return(0,Y.jsxs)(`article`,{className:`border-b border-stroke-soft`,children:[(0,Y.jsxs)(`button`,{className:`flex min-h-9 w-full min-w-0 items-center gap-2 px-2 text-left hover:bg-surface-subtle focus-visible:-outline-offset-2 max-[650px]:min-h-11 pointer-coarse:min-h-11 ${i?`bg-surface-subtle`:``}`,"aria-expanded":i,onClick:()=>n({selectedSourceId:i?``:e.id}),children:[(0,Y.jsx)(f,{size:14,className:`shrink-0 text-content-muted transition-transform duration-(--d-fast) ${i?`rotate-90`:``}`}),(0,Y.jsx)(a,{className:`size-3.5 shrink-0 text-content-muted`}),(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs`,children:e.name||r(`chat:chatMessage.fileAttachment`)})]}),i&&(0,Y.jsxs)(`div`,{className:`space-y-1.5 border-t border-stroke-soft bg-code py-2.5 pr-3 pl-8 text-xs text-content-muted`,children:[(0,Y.jsx)(`p`,{className:`break-all font-mono text-content-secondary`,children:e.attachment.path||e.attachment.id||r(`chat:workbench.unavailable`)}),(0,Y.jsx)(`p`,{className:`font-mono`,children:e.attachment.mimeType||`application/octet-stream`}),(0,Y.jsx)(`p`,{children:e.method===`asset`?r(`chat:workbench.registeredAsset`):e.method===`path`?r(`chat:workbench.pathReference`):r(`chat:workbench.invalidReference`)}),(0,Y.jsx)(P,{variant:`secondary`,size:`sm`,className:`mt-1`,disabled:!e.available,onClick:t=>{l.current=t.currentTarget,c(e.id)},children:r(`chat:chatMessage.fileActionPreview`)})]})]},e.id)})]}),u&&(0,Y.jsx)(J.Suspense,{fallback:null,children:(0,Y.jsx)(_e,{attachment:u.attachment,onClose:()=>c(``),onRestoreFocus:()=>l.current?.focus(),onDownload:()=>{typeof u.attachment.downloadUrl==`string`&&window.open(u.attachment.downloadUrl,`_blank`,`noopener,noreferrer`)}})})]})}function ve({parentId:e,active:t}){let{t:n}=i(),{entry:r,runtime:a,load:o,setDraft:s}=C(e),c=r.session?.id??``,u=(0,J.useMemo)(()=>e=>a.subscribeSessionState(c,e),[a,c]),d=(0,J.useMemo)(()=>()=>a.getSessionState(c),[a,c]),f=(0,J.useSyncExternalStore)(u,d),[p,m]=(0,J.useState)(!1),[h,g]=(0,J.useState)(!1),[_,y]=(0,J.useState)(``),x=(0,J.useRef)(!1),T=(0,J.useRef)(!1),E=(0,J.useRef)(r.draft);E.current=r.draft;let D=(0,J.useRef)(null),O=te(e=>e.bindings),A=b(f,r.session);(0,J.useEffect)(()=>{t&&o(e)},[t,o,e]);let j=async t=>{t.preventDefault();let n=E.current.trim();if(!(!n||x.current||A||r.expired)){x.current=!0,m(!0),y(``);try{let t=await o(e,!r.session);if(!t?.session)return;let i=t.session.id;if(a.getSessionState(i).streaming)return;E.current.trim()===n&&s(e,``),m(!1),await a.send(i,n),await o(e)}catch(e){y(B(e))}finally{x.current=!1,m(!1)}}},M=(0,J.useCallback)(async()=>{if(!(!c||a.getSessionState(c).streaming)){y(``);try{await a.retry(c),await o(e)}catch(e){y(B(e))}}},[o,e,a,c]),I=async()=>{if(!(!c||h)){g(!0);try{y(``),await a.abort(c)}catch(e){y(B(e))}finally{g(!1)}}},L=(0,Y.jsxs)(`div`,{className:`grid h-full min-h-36 place-content-center justify-items-center gap-2 px-3 text-center text-xs text-content-muted`,children:[(0,Y.jsx)(`span`,{className:`mb-1 grid size-8 place-items-center rounded-md bg-key text-content-secondary shadow-key ring-1 ring-key-border`,children:(0,Y.jsx)(k,{className:`size-4`,"aria-hidden":`true`})}),(0,Y.jsx)(`p`,{className:`max-w-64 leading-relaxed`,children:r.expired?n(`chat:sideChat.expired`):n(`chat:sideChat.empty`)}),r.expired&&(0,Y.jsxs)(P,{variant:`secondary`,size:`sm`,className:`mt-1`,disabled:r.loading,onClick:async()=>{(await o(e,!0))?.session&&D.current?.focus()},children:[r.loading&&(0,Y.jsx)(N,{className:`size-3.5 text-current`}),n(`chat:sideChat.restart`)]})]}),R=_||r.error||f.error;return(0,Y.jsxs)(`section`,{"data-side-chat-parent":e,"aria-label":n(`chat:sideChat.title`),className:`flex h-full min-h-0 min-w-0 flex-1 flex-col [container-type:inline-size]`,children:[(0,Y.jsx)(`p`,{className:`shrink-0 border-b border-stroke-soft px-3 py-2 text-xs leading-relaxed text-content-muted`,children:n(`chat:sideChat.retention`)}),c?(0,Y.jsx)(S,{sessionId:c,messages:f.messages,transcriptLoadState:f.loaded?`ready`:f.error?`error`:`loading`,emptyState:L,messageStart:f.messageStart,hasOlder:f.hasOlder,loadingOlder:f.loadingOlder,olderError:f.olderError,activityFeed:f.activityFeed,tools:f.tools,thinkingText:f.thinkingText,currentActivity:f.currentActivity,compaction:f.compaction,streaming:A,runStartedAt:f.runStartedAt,lastActivityAt:f.lastActivityAt,runFinishedAt:f.runFinishedAt,runStopped:f.runStopped,runNotice:f.runNotice,error:f.error,cwd:r.session?.cwd,onLoadOlder:()=>a.loadOlderMessages(c),onRetryLastTurn:M}):(0,Y.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:L}),(0,Y.jsxs)(`form`,{className:`flex shrink-0 flex-col gap-2 border-t border-stroke-soft p-3`,onSubmit:j,children:[R&&(0,Y.jsx)(w,{error:R,onRetry:r.error||!f.loaded?async()=>{await o(e)}:M}),(0,Y.jsx)(v,{approvals:f.approvals,onResolve:async(e,t)=>{try{await a.approve(c,e,t)}catch{}}}),(0,Y.jsxs)(`div`,{className:`flex min-w-0 items-end gap-2 rounded-[var(--composer-radius,22px)] border border-control bg-panel py-2 pr-2 pl-3 shadow-composer transition-[border-color,box-shadow] duration-(--d-fast) focus-within:border-focus focus-within:ring-3 focus-within:ring-focus-ring`,children:[(0,Y.jsx)(`textarea`,{ref:D,rows:2,value:r.draft,"aria-label":n(`chat:sideChat.message`),placeholder:n(`chat:sideChat.placeholder`),className:`max-h-40 min-h-14 min-w-0 flex-1 resize-y border-0 bg-transparent px-1 py-1 text-sm leading-relaxed text-content caret-focus outline-none placeholder:text-content-muted`,onChange:t=>s(e,t.target.value),onCompositionStart:()=>{T.current=!0},onCompositionEnd:()=>{T.current=!1},onKeyDown:e=>{!T.current&&!e.nativeEvent.isComposing&&e.nativeEvent.keyCode!==229&&F(e.nativeEvent,O.sendMessage)&&(e.preventDefault(),e.currentTarget.form?.requestSubmit())}}),(0,Y.jsx)(P,{type:A?`button`:`submit`,size:`icon`,className:`size-8 shrink-0 rounded-full max-[650px]:size-11 pointer-coarse:size-11`,"aria-label":n(A?`chat:sideChat.stop`:`chat:sideChat.send`),disabled:A?h:p||r.loading||r.expired||!r.draft.trim(),onClick:A?()=>void I():void 0,children:p||h?(0,Y.jsx)(N,{className:`size-4 text-current`}):A?(0,Y.jsx)(ee,{size:13,fill:`currentColor`}):(0,Y.jsx)(l,{size:17})})]})]})]})}var $=(0,J.createContext)(null),ye=()=>{let e=(0,J.useContext)($);if(!e)throw Error(`WebPreview components must be used within a WebPreview`);return e},be=({className:e,children:t,defaultUrl:n=``,onUrlChange:r,...i})=>{let[a,o]=(0,J.useState)(n),[s,c]=(0,J.useState)(!1),l=(0,J.useCallback)(e=>{o(e),r?.(e)},[r]),u=(0,J.useMemo)(()=>({consoleOpen:s,setConsoleOpen:c,setUrl:l,url:a}),[s,l,a]);return(0,Y.jsx)($.Provider,{value:u,children:(0,Y.jsx)(`div`,{className:M(`flex size-full min-h-0 flex-col rounded-lg border bg-card`,e),...i,children:t})})},xe=({className:e,loading:t,src:n,...r})=>{let{url:i}=ye();return(0,Y.jsxs)(`div`,{className:`relative min-h-0 flex-1 overflow-hidden bg-background`,children:[(0,Y.jsx)(`iframe`,{className:M(`block size-full border-0 bg-background`,e),loading:`lazy`,sandbox:`allow-scripts allow-same-origin allow-forms allow-popups allow-presentation`,src:(n??i)||void 0,title:`Preview`,...r}),t]})};function Se({sessionId:e,page:t,onChange:n,onClosed:r}){let{t:a}=i(),{draft:o,url:l}=t,[u,d]=(0,J.useState)(!1),f=U({enabled:!!window.pisperDesktop?.browser,url:l,popupId:t.resourceId,keepAlive:t.agent,onNavigated:e=>{e!==l&&n(o===l?{url:e,draft:e}:{url:e})},onTitle:e=>n({title:e}),onNewWindow:(t,n)=>ie(e,t,n),onClosed:r});return(0,Y.jsxs)(`section`,{className:`flex min-h-0 flex-1 flex-col gap-2 p-3`,"aria-label":a(`common:webPreview.title`),children:[(0,Y.jsxs)(`form`,{className:`flex gap-2`,onSubmit:e=>{e.preventDefault();let t=V(o,window.location.href);d(!t),t&&n({url:t})},children:[f.active&&(0,Y.jsxs)(`div`,{className:`flex shrink-0 items-center`,children:[(0,Y.jsx)(P,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":a(`common:webPreview.back`),title:a(`common:webPreview.back`),onClick:()=>f.act(`back`),children:(0,Y.jsx)(s,{size:14})}),(0,Y.jsx)(P,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":a(`common:webPreview.forward`),title:a(`common:webPreview.forward`),onClick:()=>f.act(`forward`),children:(0,Y.jsx)(c,{size:14})}),(0,Y.jsx)(P,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":a(`common:webPreview.reload`),title:a(`common:webPreview.reload`),"aria-busy":f.loading,onClick:()=>f.act(`reload`),children:f.loading?(0,Y.jsx)(O,{size:14,className:`animate-spin`}):(0,Y.jsx)(q,{size:14})})]}),(0,Y.jsx)(L,{"aria-label":a(`common:webPreview.url`),className:`flex-1 font-mono`,value:o,onChange:e=>n({draft:e.target.value}),placeholder:a(`common:webPreview.urlPlaceholder`),maxLength:2048}),(0,Y.jsx)(P,{type:`submit`,variant:`secondary`,children:a(`chat:sessionContext.openUrl`)})]}),u&&(0,Y.jsx)(`p`,{role:`alert`,className:`text-xs text-danger`,children:a(`chat:sessionContext.invalidUrl`)}),f.active?(0,Y.jsx)(`div`,{ref:f.slotRef,role:`group`,"aria-label":a(`common:webPreview.title`),"aria-busy":f.loading,"data-native-browser-slot":!0,className:`min-h-0 flex-1 overflow-hidden rounded-md border border-stroke bg-background`}):l?(0,Y.jsx)(be,{className:`min-h-0 flex-1 overflow-hidden rounded-md border-stroke`,defaultUrl:l,children:(0,Y.jsx)(xe,{src:l,title:a(`common:webPreview.title`),...ae(l)?{sandbox:H}:{}})},l):(0,Y.jsx)(z,{icon:p,className:`min-h-0 flex-1`,title:a(`chat:sessionContext.browserEmpty`)}),l&&(0,Y.jsxs)(P,{type:`button`,variant:`ghost`,size:`sm`,className:`self-start`,onClick:()=>window.open(l,`_blank`,`noopener,noreferrer`),children:[(0,Y.jsx)(m,{size:14}),a(`common:webPreview.openExternal`)]}),!f.active&&(0,Y.jsx)(`p`,{className:`text-xs text-content-muted`,children:a(`common:webPreview.embedNotice`)})]})}export{he as a,X as c,ge as i,de as l,ve as n,me as o,Q as r,pe as s,Se as t};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/GitDiffViewer-b4QqrnGx.js","assets/rolldown-runtime-B0Z9INg1.js","assets/vendor-react-DwNgTV1j.js","assets/use-i18n-BVRhlQ1v.js","assets/i18n-D80GstlU.js","assets/vendor-router-CSN_DGvx.js","assets/index-CiRnxTh1.js","assets/index-BnQCk-QI.css","assets/storage-DtvZ_lEu.js","assets/vendor-state-GkUciC5H.js","assets/createLucideIcon-Cd-3GVxJ.js","assets/x-07u4-129.js","assets/utils-C8uzG5AZ.js","assets/vendor-ui-DvrYggeS.js","assets/button-CCcCN8tE.js","assets/dist-41X0pdUs.js","assets/events-CuVwhRWu.js","assets/esm-DCV8yILT.js"])))=>i.map(i=>d[i]);
2
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{h as t}from"./vendor-router-CSN_DGvx.js";import{i as n,r}from"./vendor-react-DwNgTV1j.js";import{t as i}from"./use-i18n-BVRhlQ1v.js";import{i as a}from"./runtime-capabilities-B7qveLBm.js";import{t as o}from"./runtime-capabilities-store-Bd3gWIM7.js";import{r as s}from"./permission-rules-api-D931wxo9.js";import{t as c}from"./arrow-left-B8oVrQ2S.js";import{t as l}from"./check-2vYc6QaP.js";import{t as u}from"./chevron-right-C3t2Rckj.js";import{a as d,c as f,i as p,l as m,n as h,o as g,r as _,s as v,t as y}from"./SessionBrowserPane-Zeec5cZP.js";import{t as b}from"./earth-Ddy13fHh.js";import{i as x,o as S}from"./GitDiffViewer-b4QqrnGx.js";import{k as C}from"./side-chat-context-scyCH7W7.js";import{n as w,t as T}from"./undo-2-C-xQ0UVT.js";import{t as E}from"./link-2-mgasYn21.js";import{t as D}from"./message-square-SKjZyY3v.js";import{t as O}from"./plus-fQbSqB1n.js";import{t as k}from"./refresh-cw-TbWxTY4K.js";import{t as A}from"./square-terminal-BVG6cUT1.js";import{t as j}from"./x-07u4-129.js";import{n as M,t as N}from"./button-CCcCN8tE.js";import{s as P}from"./events-CuVwhRWu.js";import{a as F,n as I,o as L,t as ee}from"./sheet-BTaIEX4w.js";import{t as R}from"./input-CPw-zkYh.js";import{n as z,t as B}from"./PageState-Cz6vFMXv.js";import{a as te,o as ne,r as V}from"./session-web-preview-guvsmkWE.js";import"./public-DrlrVRdl.js";import{n as re}from"./terminal-context-aIsIJPn8.js";import{r as H}from"./web-preview-C7DdG9JP.js";var U=e(n(),1),W=r(),G=(0,U.lazy)(()=>t(()=>import(`./GitDiffViewer-b4QqrnGx.js`).then(e=>e.n).then(e=>({default:e.GitDiffDialog})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]))),K=100;function ie({sessionId:e,streaming:t,requestConfirm:n,view:r,onViewChange:a}){let{t:o}=i(),s=x(r?.reading?.list,e=>a?.({reading:{...r?.reading,list:e}})),[c,d]=(0,U.useState)([]),p=r?.expandedFiles||c,m=e=>a?a({expandedFiles:e}):d(e),{changes:h,loading:_,running:v,diff:y,setDiff:b,diffLoading:C,snapshotRevision:w,writesDisabled:E,pendingCount:D,reversibleCount:O,displayedError:A,notice:j,viewDiff:P,runAction:F,refresh:I}=g({sessionId:e,streaming:t,requestConfirm:n}),L=`max-[650px]:size-11 pointer-coarse:size-11`;return(0,W.jsxs)(`section`,{className:`flex min-h-0 flex-1 flex-col`,"aria-label":o(`chat:focusSession.fileChanges`),"aria-busy":_||!!v,children:[(0,W.jsxs)(`header`,{className:`flex min-h-10 min-w-0 shrink-0 items-center gap-2 border-b border-stroke-soft pr-1.5 pl-3`,children:[(0,W.jsx)(`h2`,{className:`min-w-0 flex-1 truncate text-xs font-medium tracking-[.02em] text-content-muted`,children:o(`chat:focusSession.fileChanges`)}),h&&(0,W.jsxs)(`span`,{className:`shrink-0 font-mono text-xs tabular-nums`,children:[(0,W.jsxs)(`span`,{className:`text-success`,children:[`+`,h.summary.added]}),` `,(0,W.jsxs)(`span`,{className:`text-danger`,children:[`−`,h.summary.removed]})]}),(0,W.jsx)(N,{type:`button`,variant:`ghost`,size:`icon`,className:L,"aria-label":o(`chat:focusSession.gitRefresh`),title:o(`chat:focusSession.gitRefresh`),disabled:_||!!v,onClick:I,children:(0,W.jsx)(k,{className:_?`animate-spin`:``,size:15})})]}),(0,W.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-2 border-b border-stroke-soft px-3 py-2.5`,children:[h&&(0,W.jsxs)(`p`,{className:`text-xs text-content-secondary tabular-nums`,children:[o(`chat:focusSession.fileChangesCount`,{count:h.summary.files}),D>0&&` · ${o(`chat:focusSession.fileChangesPending`,{count:D})}`]}),(0,W.jsx)(`p`,{className:`text-xs leading-relaxed text-content-muted`,children:o(`chat:workbench.taskSnapshotScope`)}),(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-1`,children:[(0,W.jsxs)(`div`,{className:`flex gap-1`,children:[(0,W.jsxs)(N,{type:`button`,variant:`secondary`,size:`sm`,disabled:E||D===0,title:t?o(`chat:focusSession.gitWaitForRunToFinish`):void 0,onClick:()=>void F({kind:`approve`}),children:[v?.kind===`approve`&&!v.path?(0,W.jsx)(k,{className:`animate-spin`,size:14}):(0,W.jsx)(l,{size:14}),o(`chat:focusSession.fileChangesApproveAll`)]}),(0,W.jsxs)(N,{type:`button`,variant:`secondary`,size:`sm`,disabled:E||O===0,title:o(t?`chat:focusSession.gitWaitForRunToFinish`:`chat:focusSession.fileChangesRevertAllDescription`),onClick:()=>void F({kind:`revert`}),children:[v?.kind===`revert`&&!v.path?(0,W.jsx)(k,{className:`animate-spin`,size:14}):(0,W.jsx)(T,{size:14}),o(`chat:focusSession.fileChangesRevertAll`)]})]}),(0,W.jsxs)(`div`,{className:`flex gap-1`,children:[(0,W.jsx)(N,{variant:`ghost`,size:`sm`,disabled:_||!h?.files.length,onClick:()=>m(h?.files.slice(0,K).map(e=>e.path)||[]),children:o(`chat:workbench.expandAll`)}),(0,W.jsx)(N,{variant:`ghost`,size:`sm`,onClick:()=>m([]),children:o(`chat:workbench.collapseAll`)})]})]})]}),A&&(0,W.jsx)(`p`,{role:`alert`,className:`px-3 pt-2.5 text-xs text-danger`,children:A}),j&&!A&&(0,W.jsx)(`p`,{role:`status`,className:`px-3 pt-2.5 text-xs text-content-secondary`,children:j}),_&&!h?(0,W.jsx)(z,{kind:`loading`,title:o(`chat:focusSession.gitLoading`)}):h?.files.length?(0,W.jsxs)(`ul`,{ref:s.ref,className:`min-h-0 flex-1 overflow-y-auto`,"aria-label":o(`chat:focusSession.fileChanges`),children:[h.files.slice(0,K).map(t=>{let n=p.includes(t.path);return(0,W.jsxs)(`li`,{className:`min-w-0 border-b border-stroke-soft`,children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 items-center gap-0.5 pr-1.5 hover:bg-surface-subtle ${n?`bg-surface-subtle`:``}`,children:[(0,W.jsxs)(`button`,{type:`button`,className:`flex min-h-9 min-w-0 flex-1 items-center gap-2 pl-2 text-left text-xs focus-visible:-outline-offset-2 disabled:opacity-60 max-[650px]:min-h-11 pointer-coarse:min-h-11`,title:t.path,disabled:_||!!v,"aria-busy":C===t.path,"aria-expanded":n,onClick:()=>m(n?p.filter(e=>e!==t.path):[...p,t.path]),children:[(0,W.jsx)(u,{size:14,className:`shrink-0 text-content-muted transition-transform duration-(--d-fast) ${n?`rotate-90`:``}`}),C===t.path?(0,W.jsx)(M,{className:`size-3.5`}):(0,W.jsx)(S,{size:14,className:`flex-none text-content-muted`}),(0,W.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono`,children:t.path}),(t.reverted||t.approved)&&(0,W.jsx)(`span`,{className:`shrink-0 text-content-muted`,children:t.reverted?o(`chat:focusSession.fileChangesReverted`):o(`chat:focusSession.fileChangesApproved`)}),(0,W.jsxs)(`span`,{className:`shrink-0 font-mono tabular-nums`,children:[(0,W.jsxs)(`span`,{className:`text-success`,children:[`+`,t.added]}),` `,(0,W.jsxs)(`span`,{className:`text-danger`,children:[`−`,t.removed]})]})]}),(0,W.jsx)(N,{type:`button`,variant:`ghost`,size:`icon`,className:L,title:o(`chat:focusSession.fileChangesApproveFile`),"aria-label":`${o(`chat:focusSession.fileChangesApproveFile`)} ${t.path}`,disabled:E||!t.pending||t.approved||t.reverted,onClick:()=>void F({kind:`approve`,path:t.path}),children:(0,W.jsx)(l,{size:14})}),(0,W.jsx)(N,{type:`button`,variant:`ghost`,size:`icon`,className:L,title:o(`chat:focusSession.fileChangesRevertFile`),"aria-label":`${o(`chat:focusSession.fileChangesRevertFile`)} ${t.path}`,disabled:E||t.reverted||!t.canRevert,onClick:()=>void F({kind:`revert`,path:t.path}),children:(0,W.jsx)(T,{size:14})})]}),n&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(f,{sessionId:e,path:t.path,scope:`task`,position:r?.reading?.[t.path],onReading:e=>a?.({reading:{...r?.reading,[t.path]:e}}),revision:w}),(0,W.jsx)(N,{variant:`ghost`,size:`sm`,className:`m-1.5`,onClick:()=>void P(t.path),children:o(`chat:workbench.fullDiff`)})]})]},t.path)}),h.files.length>K&&(0,W.jsx)(`li`,{className:`px-3 py-2 text-xs text-content-muted tabular-nums`,children:o(`chat:focusSession.gitMoreFiles`,{count:h.files.length-K})})]}):!A&&(0,W.jsx)(B,{compact:!0,title:o(`chat:focusSession.fileChangesEmpty`)}),y&&(0,W.jsx)(U.Suspense,{fallback:null,children:(0,W.jsx)(G,{diff:y.diff,truncated:y.truncated,onClose:()=>b(null)})})]})}function ae({tools:e,onSelect:t,onOpenUrl:n}){let{t:r}=i(),[a,o]=(0,U.useState)(``),[s,c]=(0,U.useState)(!1);return(0,W.jsxs)(`section`,{className:`@container/new-tab flex min-h-0 flex-1 flex-col overflow-y-auto bg-panel p-4`,children:[(0,W.jsx)(`h2`,{className:`mb-3 text-sm font-medium text-content`,children:r(`chat:workbench.newTab`)}),(0,W.jsxs)(`form`,{className:`mb-4 flex gap-2`,onSubmit:e=>{e.preventDefault();let t=H(a,window.location.href);c(!t),t&&n(t)},children:[(0,W.jsx)(R,{className:`font-mono`,"aria-label":r(`common:webPreview.url`),placeholder:r(`common:webPreview.urlPlaceholder`),value:a,maxLength:2048,onChange:e=>o(e.target.value)}),(0,W.jsx)(N,{type:`submit`,variant:`secondary`,children:r(`chat:sessionContext.openUrl`)})]}),s&&(0,W.jsx)(`p`,{role:`alert`,className:`mb-3 text-xs text-danger`,children:r(`chat:sessionContext.invalidUrl`)}),(0,W.jsx)(`div`,{className:`grid grid-cols-1 gap-1.5 @min-[420px]/new-tab:grid-cols-2`,children:e.map(({id:e,label:n,icon:r,disabled:i})=>(0,W.jsxs)(N,{disabled:i,variant:`ghost`,className:`h-10 min-w-0 justify-start gap-2.5 border-stroke bg-panel px-3 font-normal text-content max-[650px]:h-11 pointer-coarse:h-11 [&_svg]:text-content-muted`,onClick:()=>t(e),children:[(0,W.jsx)(r,{className:`size-4 shrink-0`}),(0,W.jsx)(`span`,{className:`truncate`,children:n})]},e))})]})}function q({panelId:e,compact:t,embedded:n=!1,active:r=!0,sessionId:l,cwd:u=``,sources:f=[],tab:g,plan:x,streaming:T,plansAvailable:k,requestConfirm:M,onTabChange:R,onClose:z,onBack:H}){let{t:G}=i(),K=re(),q=o(e=>e.capabilities),J=[{id:`terminal`,icon:A,label:G(`terminal:workspace.terminal`)},{id:`processes`,icon:s,label:G(`terminal:workspace.processes`)},{id:`changes`,icon:S,label:G(`chat:workbench.projectChanges`)},{id:`sources`,icon:E,label:G(`chat:workbench.sources`)},{id:`files`,icon:C,label:G(`chat:workbench.taskSnapshots`)},...k?[{id:`plan`,icon:w,label:G(`chat:sessionContext.plan`)}]:[],{id:`browser`,icon:b,label:G(`common:webPreview.title`)},{id:`side-chat`,icon:D,label:G(`chat:sideChat.title`)}],oe=(0,U.useMemo)(()=>te(g),[g]),Y=V(e=>Object.prototype.hasOwnProperty.call(e.sessions,l)?e.sessions[l]:void 0)??oe,se=(0,U.useRef)(null),X=Y.pages.find(e=>e.id===Y.activeId)??Y.pages[0],Z=e=>e.kind===`new`?{id:`new`,icon:O,label:G(`chat:workbench.newTab`)}:J.find(t=>t.id===e.kind)??J[0],ce=t=>requestAnimationFrame(()=>document.getElementById(`${e}-${t}-tab`)?.focus()),le=(0,U.useEffectEvent)(()=>{r&&document.getElementById(`${e}-${Y.activeId}-tab`)?.focus()});(0,U.useEffect)(()=>{let e=requestAnimationFrame(()=>le());return()=>cancelAnimationFrame(e)},[e,Y.activeId]);let Q=e=>{if(e.type===`view`&&!V.getState().sessions[l])return;[`add`,`open`,`select`,`close`,`kind`].includes(e.type)&&window.dispatchEvent(new Event(P));let t=ne(Y,e);V.getState().update(l,g,e);let n=t.pages.find(e=>e.id===t.activeId);n&&R(n.kind),(e.type===`add`||e.type===`select`||e.type===`close`)&&ce(t.activeId),e.type===`close`&&Y.pages.length===1&&z()},$=G(`chat:sessionContext.addPage`),ue=G(`chat:sessionContext.pageLimit`),de=(0,W.jsx)(N,{variant:`ghost`,size:`icon`,className:`max-[650px]:size-11`,disabled:Y.pages.length>=12,"aria-label":$,title:Y.pages.length>=12?ue:$,onClick:()=>Q({type:`add`,kind:`new`}),children:(0,W.jsx)(O,{size:16})}),fe=(0,W.jsxs)(`div`,{"data-session-context-panel":!0,className:`flex h-full min-h-0 min-w-0 flex-col bg-panel text-content`,children:[(0,W.jsxs)(`header`,{"data-window-drag-region":!0,className:`auxiliary-page-header flex h-12 shrink-0 items-center gap-1 border-b border-stroke-soft px-2`,children:[H&&(0,W.jsx)(N,{variant:`ghost`,size:`icon`,className:`max-[650px]:size-11`,"aria-label":G(`chat:workbench.backToConversation`),title:G(`chat:workbench.backToConversation`),onClick:H,children:(0,W.jsx)(c,{size:16})}),(0,W.jsx)(`div`,{ref:se,className:`flex min-w-0 flex-1 items-center gap-0.5 overflow-x-auto px-px py-1 [scrollbar-width:none]`,role:`tablist`,"aria-label":G(`chat:sessionContext.title`),onKeyDown:e=>{if(!(e.target instanceof HTMLElement)||e.target.getAttribute(`role`)!==`tab`)return;if(e.key===`Delete`){e.preventDefault(),Q({type:`close`,id:X.id});return}if(![`ArrowLeft`,`ArrowRight`,`Home`,`End`].includes(e.key))return;e.preventDefault();let t=Y.pages.findIndex(e=>e.id===X.id),n=e.key===`Home`?0:e.key===`End`?Y.pages.length-1:(t+(e.key===`ArrowRight`?1:-1)+Y.pages.length)%Y.pages.length;Q({type:`select`,id:Y.pages[n].id})},children:Y.pages.map(t=>{let{icon:n,label:r}=Z(t);return(0,W.jsxs)(`div`,{className:`relative flex max-w-40 min-w-20 shrink-0 items-center rounded-sm transition-colors duration-(--d-fast) ${t.id===X.id?`bg-key font-medium text-content shadow-key ring-1 ring-key-border after:absolute after:inset-x-2 after:bottom-0 after:h-0.5 after:rounded-full after:bg-star`:`text-content-muted hover:bg-surface-hover hover:text-content`}`,children:[(0,W.jsxs)(`button`,{id:`${e}-${t.id}-tab`,type:`button`,role:`tab`,"aria-selected":t.id===X.id,"aria-controls":`${e}-${t.id}-content`,tabIndex:t.id===X.id?0:-1,className:`flex h-7 min-w-0 flex-1 items-center gap-1.5 rounded-sm pl-2 text-sm focus-visible:outline-offset-0 max-[650px]:h-11`,onClick:()=>Q({type:`select`,id:t.id}),children:[(0,W.jsx)(n,{size:14,className:`shrink-0`}),(0,W.jsx)(`span`,{className:`truncate`,children:r})]}),(0,W.jsx)(`button`,{type:`button`,className:`mx-0.5 grid size-5 shrink-0 place-items-center rounded-xs text-content-muted hover:bg-surface-hover hover:text-content focus-visible:outline-offset-0 max-[650px]:size-11`,"aria-label":`${G(`chat:sessionContext.closePage`)} · ${r}`,onClick:()=>Q({type:`close`,id:t.id}),children:(0,W.jsx)(j,{size:12})})]},t.id)})}),de]}),Y.pages.map(t=>{let n=Z(t),r=X.id===t.id;return(0,W.jsx)(`div`,{id:`${e}-${t.id}-content`,role:`tabpanel`,"aria-labelledby":`${e}-${t.id}-tab`,className:r?`flex min-h-0 flex-1 flex-col`:`hidden`,hidden:!r,children:n.id===`new`?r&&(0,W.jsx)(ae,{tools:J.map(e=>({...e,disabled:e.id===`terminal`||e.id===`processes`?!K||!a(q,`terminal`):e.id===`changes`&&!a(q,`vcs`)})),onOpenUrl:e=>{Q({type:`open`,kind:`browser`,replaceId:t.id}),V.getState().update(l,`browser`,{type:`browser`,id:t.id,url:e,draft:e})},onSelect:e=>Q({type:`open`,kind:e,replaceId:t.id})}):n.id===`changes`?r&&(0,W.jsx)(v,{sessionId:l,cwd:u,streaming:T,view:t.view,onViewChange:e=>Q({type:`view`,id:t.id,patch:e})}):n.id===`sources`?r&&(0,W.jsx)(_,{sources:f,view:t.view,onViewChange:e=>Q({type:`view`,id:t.id,patch:e})}):n.id===`terminal`?r&&(0,W.jsx)(d,{sessionId:l,cwd:u,terminalId:t.resourceId||void 0,onCreated:e=>V.getState().update(l,g,{type:`resource`,id:t.id,resourceId:e})}):n.id===`processes`?r&&(0,W.jsx)(p,{view:t.view,onViewChange:e=>Q({type:`view`,id:t.id,patch:e}),sessionId:l,onOpenTerminal:e=>Q({type:`open`,kind:`terminal`,resourceId:e})}):n.id===`side-chat`?(0,W.jsx)(h,{parentId:l,active:r}):n.id===`browser`?(0,W.jsx)(y,{sessionId:l,page:t,onChange:e=>Q({type:`browser`,id:t.id,...e}),onClosed:()=>Q({type:`close`,id:t.id})}):r&&(n.id===`files`?(0,W.jsx)(ie,{view:t.view,onViewChange:e=>Q({type:`view`,id:t.id,patch:e}),sessionId:l,streaming:T,requestConfirm:M}):(0,W.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-3`,children:x?.items?.length?(0,W.jsx)(m,{plan:x,running:T}):(0,W.jsx)(B,{compact:!0,title:G(`chat:sessionContext.planEmpty`)})}))},t.id)})]});return t?(0,W.jsx)(ee,{open:!0,onOpenChange:e=>!e&&z(),children:(0,W.jsxs)(I,{id:e,side:`right`,showCloseButton:!1,className:`gap-0 overflow-hidden p-0`,style:{top:`var(--pisper-safe-area-top)`,right:`var(--pisper-safe-area-right)`,bottom:`var(--pisper-safe-area-bottom)`,height:`auto`,width:`min(calc(100vw - var(--pisper-safe-area-left) - var(--pisper-safe-area-right)), 420px)`,maxWidth:`none`},children:[(0,W.jsx)(F,{className:`sr-only`,children:(0,W.jsx)(L,{children:G(`chat:sessionContext.title`)})}),fe]})}):(0,W.jsx)(`aside`,{id:e,tabIndex:n?-1:void 0,className:`h-full min-h-0 w-full overflow-hidden border-l border-stroke bg-panel`,"aria-label":G(`chat:sessionContext.title`),children:fe})}export{q as SessionContextPanel};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{u as t}from"./vendor-router-CSN_DGvx.js";import{i as n,r}from"./vendor-react-DwNgTV1j.js";import{f as i,t as a}from"./routes-DIeaqWVc.js";import{t as o}from"./use-i18n-CaxKosZm.js";import{n as s,t as c}from"./usePhoneShell-0IX6-LbH.js";import{t as l}from"./PhoneMenuButton-mlilY9bo.js";import{t as u}from"./button-CCcCN8tE.js";import{t as d}from"./useSessionListQuery-DXeYJTOA.js";import"./public-BDWkdvCh.js";import{n as f}from"./PageState-Cz6vFMXv.js";import{n as p,r as m}from"./session-home-CwRaSks0.js";var h=e(n(),1),g=r();function _(e){let{t:n}=o(),r=t(),_=c(),v=s(),y=!_||v,[b]=(0,h.useState)(m),x=d(),S=p({lastId:b,data:x.data,failed:x.isError&&!x.isFetching}),C=S.kind===`session`?i(S.id):S.kind===`draft`?i():``;(0,h.useEffect)(()=>{C&&r(C,{replace:!0,state:a})},[r,C]);let w=(0,g.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col bg-panel`,children:[!y&&(0,g.jsx)(`header`,{className:`flex h-14 shrink-0 items-center bg-panel px-1`,children:(0,g.jsx)(l,{})}),(0,g.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center`,children:S.kind===`error`?(0,g.jsx)(f,{kind:`error`,title:n(`board:home.loadFailed`),description:n(`board:home.loadFailedHint`),action:(0,g.jsxs)(`div`,{className:`flex flex-wrap justify-center gap-2`,children:[(0,g.jsx)(u,{variant:`secondary`,className:`pointer-coarse:min-h-11`,onClick:()=>void x.refetch(),children:n(`navigation:more.retry`)}),(0,g.jsx)(u,{variant:`ghost`,className:`pointer-coarse:min-h-11`,onClick:()=>r(i(),{state:a}),children:n(`board:home.startDraft`)})]})}):(0,g.jsx)(f,{kind:`loading`,title:n(`board:home.loading`)})})]});return(0,g.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,"data-session-shell":y?`desktop`:`phone`,"data-session-home":S.kind,children:(0,g.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1`,children:w})})}export{_ as SessionHome};
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{u as t}from"./vendor-router-CSN_DGvx.js";import{i as n,r}from"./vendor-react-DwNgTV1j.js";import{f as i,t as a}from"./routes-DIeaqWVc.js";import{t as o}from"./use-i18n-BVRhlQ1v.js";import{n as s,t as c}from"./usePhoneShell-BpuKJgci.js";import{t as l}from"./PhoneMenuButton-CTlyYTpl.js";import{t as u}from"./button-CCcCN8tE.js";import{t as d}from"./useSessionListQuery-CURESPBn.js";import"./public-CEKKZh7R.js";import{n as f}from"./PageState-Cz6vFMXv.js";import{n as p,r as m}from"./session-home-BmAnhROp.js";var h=e(n(),1),g=r();function _(e){let{t:n}=o(),r=t(),_=c(),v=s(),y=!_||v,[b]=(0,h.useState)(m),x=d(),S=p({lastId:b,data:x.data,failed:x.isError&&!x.isFetching}),C=S.kind===`session`?i(S.id):S.kind===`draft`?i():``;(0,h.useEffect)(()=>{C&&r(C,{replace:!0,state:a})},[r,C]);let w=(0,g.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col bg-panel`,children:[!y&&(0,g.jsx)(`header`,{className:`flex h-14 shrink-0 items-center bg-panel px-1`,children:(0,g.jsx)(l,{})}),(0,g.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center`,children:S.kind===`error`?(0,g.jsx)(f,{kind:`error`,title:n(`board:home.loadFailed`),description:n(`board:home.loadFailedHint`),action:(0,g.jsxs)(`div`,{className:`flex flex-wrap justify-center gap-2`,children:[(0,g.jsx)(u,{variant:`secondary`,className:`pointer-coarse:min-h-11`,onClick:()=>void x.refetch(),children:n(`navigation:more.retry`)}),(0,g.jsx)(u,{variant:`ghost`,className:`pointer-coarse:min-h-11`,onClick:()=>r(i(),{state:a}),children:n(`board:home.startDraft`)})]})}):(0,g.jsx)(f,{kind:`loading`,title:n(`board:home.loading`)})})]});return(0,g.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,"data-session-shell":y?`desktop`:`phone`,"data-session-home":S.kind,children:(0,g.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1`,children:w})})}export{_ as SessionHome};
@@ -0,0 +1 @@
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{t as r}from"./use-i18n-BVRhlQ1v.js";import{t as i}from"./useQuery-DfOU-27z.js";import{i as a}from"./runtime-capabilities-B7qveLBm.js";import{t as o}from"./runtime-capabilities-store-Bd3gWIM7.js";import{t as s}from"./createLucideIcon-Cd-3GVxJ.js";import{r as c}from"./permission-rules-api-D931wxo9.js";import{t as l}from"./bot-B3TaBp_T.js";import{t as u}from"./check-2vYc6QaP.js";import{a as d,c as f,i as p,l as m,n as h,o as g,r as _,t as v}from"./SessionBrowserPane-Zeec5cZP.js";import{c as y}from"./focus-session-composer-bits-Dkc0qSzm.js";import{t as b}from"./earth-Ddy13fHh.js";import{t as ee}from"./ellipsis-CfGKfbq6.js";import{o as x}from"./GitDiffViewer-b4QqrnGx.js";import{k as te,m as S}from"./side-chat-context-scyCH7W7.js";import{t as ne}from"./git-branch-N7LGjtzt.js";import{n as re,t as C}from"./undo-2-C-xQ0UVT.js";import{t as w}from"./message-square-SKjZyY3v.js";import{t as ie}from"./plus-fQbSqB1n.js";import{t as T}from"./refresh-cw-TbWxTY4K.js";import{t as ae}from"./square-terminal-BVG6cUT1.js";import{t as E}from"./wrench-6pg6_bqI.js";import{t as oe}from"./x-07u4-129.js";import{c as D,i as O,p as se,r as ce,t as k}from"./dropdown-menu-Ds0gD8S8.js";import{i as le,n as ue,t as de}from"./popover-BKgOyW2Z.js";import{t as fe}from"./segmented-control-xkrEOP_d.js";import{t as A}from"./utils-C8uzG5AZ.js";import{t as j}from"./button-CCcCN8tE.js";import{t as pe}from"./chat-api-CSAs7Y6E.js";import{a as M,r as N}from"./format-DMJQzoZ7.js";import{t as me}from"./StatusGlyph-1KgitlUg.js";import{s as he}from"./run-activity-CwfO0cui.js";import{t as ge}from"./session-change-summary-api-BHpd8dcW.js";import{n as P,t as F}from"./PageState-Cz6vFMXv.js";import{i as _e,n as I,r as ve}from"./MarkdownMessage-BEmTlPSn.js";import{t as ye}from"./route-context-DvWDul4T.js";import{i as L,r as R}from"./session-web-preview-guvsmkWE.js";import"./public-DrlrVRdl.js";import{n as be,r as z}from"./terminal-context-aIsIJPn8.js";import{r as B}from"./session-inspector-store-DHEIlh_X.js";import{o as V}from"./web-preview-C7DdG9JP.js";var H=s(`folder-search`,[[`path`,{d:`M10.7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v4.1`,key:`1bw5m7`}],[`path`,{d:`m21 21-1.9-1.9`,key:`1g2n9r`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}]]),xe=s(`panel-right-close`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m8 9 3 3-3 3`,key:`12hl5m`}]]),U=e(t(),1),W=n(),G=new Set([`queued`,`starting`,`running`]),K=new Set([`starting`,`running`,`stopping`]);function q(e){return typeof e==`string`?e.trim():``}function J(e,t,n){let r=new Map;for(let i of e){if(i?.type!==t)continue;let e=n(i);e&&r.set(String(e.id||r.size),e)}return[...r.values()]}function Y({startedAt:e}){let[t,n]=(0,U.useState)(()=>Date.now());(0,U.useEffect)(()=>{let e=window.setInterval(()=>n(Date.now()),1e3);return()=>window.clearInterval(e)},[]);let r=he(e,null,t);return r?(0,W.jsx)(`span`,{className:`flex-none font-mono text-xs text-content-muted tabular-nums`,children:y(r)}):null}function Se(e,t){let n=t?J(e,`tool`,e=>e).filter(e=>e.status===`running`):[],r=J(e,`agent`,e=>e.agent&&typeof e.agent==`object`?e.agent:null).filter(e=>G.has(String(e.status)));return n.length+r.length}function Ce({sessionId:e,streaming:t,activity:n}){let{t:i}=r(),a=z(e),o=[...t?J(n,`tool`,e=>e).filter(e=>e.status===`running`).map(e=>{let t=e.args||{};return{key:`tool:${String(e.id)}`,icon:(0,W.jsx)(E,{size:14,"aria-hidden":`true`}),name:q(e.name)||i(`board:inspector.runningTool`),detail:q(t.command)||q(t.path)||q(t.file_path),startedAt:q(e.startedAt),status:i(`board:inspector.runningStatus`)}}):[],...J(n,`agent`,e=>e.agent&&typeof e.agent==`object`?e.agent:null).filter(e=>G.has(String(e.status))).map(e=>({key:`agent:${String(e.id)}`,icon:(0,W.jsx)(l,{size:14,"aria-hidden":`true`}),name:q(e.title)||q(e.taskName)||i(`board:inspector.runningAgent`),detail:q(e.message),startedAt:q(e.startedAt),status:e.status===`queued`?i(`board:inspector.runningQueued`):i(`board:inspector.runningStatus`)})),...a.filter(e=>K.has(e.status)).map(e=>({key:`terminal:${e.id}`,icon:(0,W.jsx)(ae,{size:14,"aria-hidden":`true`}),name:e.profileId||i(`board:inspector.terminal`),detail:e.cwd||``,status:e.status===`stopping`?i(`terminal:workspace.stopping`):i(`board:inspector.runningStatus`)}))];return(0,W.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto p-3`,"data-inspector-running":!0,children:[o.length?(0,W.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-px p-0`,children:o.map(e=>(0,W.jsxs)(`li`,{className:`grid min-w-0 grid-cols-[14px_minmax(0,1fr)_auto] items-start gap-2 py-1.5 text-xs`,"data-running-item":e.key.split(`:`)[0],children:[(0,W.jsx)(`span`,{className:`mt-0.5 text-content-secondary`,children:e.icon}),(0,W.jsxs)(`span`,{className:`grid min-w-0 gap-0.5`,children:[(0,W.jsx)(`strong`,{className:`truncate text-[13px] font-medium text-content`,children:e.name}),e.detail&&(0,W.jsx)(`span`,{className:`min-w-0 truncate font-mono text-content-muted`,title:e.detail,children:e.detail})]}),(0,W.jsxs)(`span`,{className:`flex flex-none items-center gap-2`,children:[(0,W.jsx)(`span`,{className:`text-content-muted`,children:e.status}),(0,W.jsx)(Y,{startedAt:e.startedAt})]})]},e.key))}):(0,W.jsx)(F,{compact:!0,title:i(`board:inspector.runningEmpty`)}),(0,W.jsx)(`p`,{className:`mt-3 text-xs leading-relaxed text-content-faint`,children:i(`board:inspector.runningHint`)})]})}var we={running:{kind:`run`,color:`text-st-run`},starting:{kind:`run`,color:`text-st-run`},queued:{kind:`queued`,color:`text-st-queue`},completed:{kind:`done`,color:`text-st-done`},failed:{kind:`failed`,color:`text-st-fail`},interrupted:{kind:`stopped`,color:`text-st-queue`},blocked:{kind:`queued`,color:`text-st-queue`}};function Te(e,t){return t(e===`queued`?`chat:agentRunActivity.teamTaskQueued`:e===`starting`?`chat:agentRunActivity.teamTaskStarting`:e===`running`?`chat:agentRunActivity.teamTaskRunning`:e===`completed`?`chat:agentRunActivity.teamTaskCompleted`:e===`failed`?`chat:agentRunActivity.teamTaskFailed`:e===`interrupted`?`chat:agentRunActivity.teamTaskInterrupted`:e===`blocked`?`chat:agentRunActivity.teamTaskBlocked`:`chat:agentRunActivity.teamTaskStatusUpdated`)}function Ee(e,t){return e.status===`active`?e.mode===`team`?t(`chat:focusSession.runningAsTeam`):t(`chat:focusSession.runningAutonomously`):e.status===`paused`?t(`chat:focusSession.goalPaused`):e.status===`complete`?t(`chat:focusSession.goalComplete`):e.status===`budget_limited`?t(`chat:focusSession.goalReachedItsBudget`):``}function X({title:e,children:t}){return(0,W.jsxs)(`section`,{className:`grid min-w-0 gap-2`,"aria-label":e,children:[(0,W.jsx)(`h3`,{className:`text-xs font-semibold text-content-secondary`,children:e}),t]})}function De({status:e,name:t,detail:n,t:r}){let i=we[String(e)]??{kind:`queued`,color:`text-st-queue`};return(0,W.jsxs)(`li`,{className:`flex min-w-0 items-start gap-2 py-1.5 text-xs`,children:[(0,W.jsx)(me,{status:i.kind,className:`mt-px size-3.5 ${i.color}`}),(0,W.jsxs)(`span`,{className:`grid min-w-0 flex-1 gap-0.5`,children:[(0,W.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,W.jsx)(`strong`,{className:`min-w-0 truncate font-medium text-content`,children:t}),(0,W.jsx)(`span`,{className:`flex-none text-content-muted`,children:Te(e,r)})]}),n&&(0,W.jsx)(`span`,{className:`min-w-0 break-words text-content-muted`,children:n})]})]})}function Oe(e){let t=new Map;for(let n of e){if(n?.type!==`agent`||!n.agent||typeof n.agent!=`object`)continue;let e=n.agent,r=String(e.id||e.taskName||t.size);t.set(r,e)}return[...t.values()]}function ke({plan:e,streaming:t,goal:n,team:i,activity:a}){let{t:o}=r(),s=Array.isArray(i?.tasks)?i.tasks:[],c=Oe(a),l=!!(n?.id&&String(n.objective||``).trim()),u=!!e?.items?.length;if(!l&&!u&&!s.length&&!c.length)return(0,W.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-3`,children:(0,W.jsx)(F,{compact:!0,icon:re,title:o(`chat:sessionContext.planEmpty`)})});let d=Number(n?.mode===`team`?n?.teamTokenBudget:n?.tokenBudget)||0;return(0,W.jsxs)(`div`,{className:`grid min-h-0 flex-1 content-start gap-5 overflow-y-auto p-3`,"data-inspector-plan":!0,children:[l&&n&&(0,W.jsx)(X,{title:o(`board:inspector.goal`),children:(0,W.jsxs)(`div`,{className:`grid gap-1.5 rounded-md border border-stroke-soft bg-surface-subtle p-3 text-xs`,children:[(0,W.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-content`,children:String(n.objective)}),(0,W.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-2 text-content-muted tabular-nums`,children:[(0,W.jsx)(`span`,{children:Ee(n,o)}),(0,W.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,W.jsx)(`span`,{children:d>0?o(`chat:focusSession.usedBudgetTokensUsed`,{used:N(n.tokensUsed),budget:N(d)}):o(`chat:focusSession.usedUnlimitedGoalTokens`,{used:N(n.tokensUsed)})})]})]})}),u&&(0,W.jsx)(X,{title:o(`board:inspector.plan`),children:(0,W.jsx)(m,{plan:e,running:t})}),s.length>0&&(0,W.jsx)(X,{title:o(`board:inspector.team`),children:(0,W.jsx)(`ul`,{className:`divide-y divide-stroke-soft`,children:s.map((e,t)=>(0,W.jsx)(De,{status:e.status,name:e.taskName||o(`chat:agentRunActivity.subagent`),detail:e.error||e.output||``,t:o},e.id||`${e.taskName}-${t}`))})}),c.length>0&&(0,W.jsx)(X,{title:o(`board:inspector.subAgents`),children:(0,W.jsx)(`ul`,{className:`divide-y divide-stroke-soft`,children:c.map((e,t)=>(0,W.jsx)(De,{status:e.status,name:String(e.taskName||``).trim()||o(`chat:agentRunActivity.subagent`),detail:String(e.error||e.message||``).trim(),t:o},String(e.id||t)))})})]})}function Ae({panelId:e,sessionId:t}){let{t:n}=r(),i=R(e=>e.sessions[t]),a=i?.pages,o=a?.filter(e=>e.kind===`browser`)??[],s=(i&&L(i))?.id??``,c=(a?.length??0)>=12,u=(0,U.useRef)(null),[d,f]=(0,U.useState)([]);s&&!d.includes(s)&&f([...d,s]),(0,U.useEffect)(()=>{u.current?.querySelector(`[role="tab"][aria-selected="true"]`)?.closest(`[data-browser-tab]`)?.scrollIntoView?.({block:`nearest`,inline:`nearest`})},[s]);let p=t=>`${e}-browser-${t}-tab`,m=t=>`${e}-browser-${t}-panel`,h=e=>R.getState().update(t,`browser`,{type:`browser-tab`,id:e}),g=(e,t,n=``)=>requestAnimationFrame(()=>document.querySelector(`[id="${e(t)}"] ${n}`.trim())?.focus()),_=()=>{let e=R.getState(),n=e.sessions[t]?.contentOpen??!1;if(e.update(t,`browser`,{type:`add`,kind:`browser`})===`limit`)return;n||e.update(t,`browser`,{type:`workspace`,contentOpen:!1});let r=R.getState().sessions[t],i=r&&L(r);i&&g(m,i.id,`input`)},y=e=>{let n=R.getState();if(o.length===1){n.update(t,`browser`,{type:`browser`,id:e,url:``,draft:``,agent:!1}),n.update(t,`browser`,{type:`resource`,id:e,resourceId:``});return}n.update(t,`browser`,{type:`close`,id:e});let r=R.getState().sessions[t],i=r&&L(r);i&&g(p,i.id)};return(0,W.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,W.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 border-b border-stroke-soft px-3 py-1.5`,children:[(0,W.jsx)(`div`,{ref:u,role:`tablist`,"aria-label":n(`common:webPreview.tabs`),className:`flex min-w-0 items-center gap-0.5 overflow-x-auto [scrollbar-width:none]`,onKeyDown:e=>{if(!(e.target instanceof HTMLElement)||e.target.getAttribute(`role`)!==`tab`)return;if(e.key===`Delete`){e.preventDefault(),s&&y(s);return}if(![`ArrowLeft`,`ArrowRight`,`Home`,`End`].includes(e.key))return;e.preventDefault();let t=o.findIndex(e=>e.id===s),n=e.key===`Home`?0:e.key===`End`?o.length-1:(t+(e.key===`ArrowRight`?1:-1)+o.length)%o.length,r=o[n];r&&(h(r.id),g(p,r.id))},children:o.map(e=>{let t=e.id===s,r=e.title||(e.url?V(e.url):n(`common:webPreview.newTab`)),i=o.length>1||!!(e.url||e.resourceId);return(0,W.jsxs)(`div`,{"data-browser-tab":e.id,className:A(`flex min-w-20 flex-[0_1_10rem] items-center rounded-sm text-[13px] transition-colors duration-(--d-fast)`,t?`bg-solid font-medium text-content shadow-edge ring-1 ring-stroke-strong ring-inset`:`text-content-secondary hover:bg-surface-hover hover:text-content`),onAuxClick:t=>{t.button===1&&i&&y(e.id)},children:[(0,W.jsxs)(`button`,{id:p(e.id),type:`button`,role:`tab`,"aria-selected":t,"aria-controls":m(e.id),tabIndex:t?0:-1,title:e.url||r,className:A(`flex h-7 min-w-0 flex-1 items-center rounded-sm pl-2 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus pointer-coarse:h-11`,!i&&`pr-2`),onClick:()=>h(e.id),children:[e.agent&&(0,W.jsx)(l,{size:12,className:`mr-1 flex-none text-focus`,role:`img`,"aria-label":n(`common:webPreview.agentTab`)}),(0,W.jsx)(`span`,{className:`truncate`,children:r})]}),i&&(0,W.jsx)(`button`,{type:`button`,tabIndex:t?0:-1,"aria-label":`${n(`common:webPreview.closeTab`)} · ${r}`,className:`mx-0.5 grid size-5 flex-none place-items-center rounded-xs text-content-muted hover:bg-surface-hover hover:text-content focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus pointer-coarse:size-11`,onClick:()=>y(e.id),children:(0,W.jsx)(oe,{size:12,"aria-hidden":`true`})})]},e.id)})}),(0,W.jsx)(j,{type:`button`,variant:`ghost`,size:`icon-sm`,className:`flex-none pointer-coarse:size-11`,disabled:c,"aria-label":n(`common:webPreview.newTab`),title:n(c?`chat:sessionContext.pageLimit`:`common:webPreview.newTab`),onClick:_,children:(0,W.jsx)(ie,{"aria-hidden":`true`})})]}),o.filter(e=>d.includes(e.id)).map(e=>{let n=e.id===s;return(0,W.jsx)(`div`,{id:m(e.id),role:`tabpanel`,"aria-labelledby":p(e.id),hidden:!n,className:n?`flex min-h-0 flex-1 flex-col`:`hidden`,children:(0,W.jsx)(v,{sessionId:t,page:e,onChange:n=>R.getState().update(t,`browser`,{type:`browser`,id:e.id,...n}),onClosed:()=>y(e.id)})},e.id)})]})}var Z=100;function je(e){let t=e.trim().toUpperCase();return t===`??`||t.includes(`A`)?`created`:t.includes(`D`)?`deleted`:t.includes(`R`)?`renamed`:t.includes(`M`)?`modified`:`other`}var Q={modified:`M`,created:`A`,deleted:`D`,renamed:`R`,other:`·`},Me={modified:`text-content-secondary`,created:`text-st-done`,deleted:`text-st-fail`,renamed:`text-content-secondary`,other:`text-content-muted`};function Ne(e){let t=e.replace(/\\/g,`/`),n=t.lastIndexOf(`/`);return n<0?{directory:``,name:t}:{directory:t.slice(0,n+1),name:t.slice(n+1)}}function $(e,t){return/^(?:[a-zA-Z]:[\\/]|\/|\\\\)/.test(t)?t:`${e.replace(/[\\/]+$/,``)}/${t}`}function Pe(e,t){window.dispatchEvent(new CustomEvent(ye,{detail:{message:e,tone:t}}))}function Fe({added:e,removed:t}){return e===null||t===null?null:(0,W.jsxs)(`span`,{className:`flex-none font-mono text-xs tabular-nums`,children:[(0,W.jsxs)(`span`,{className:`text-success`,children:[`+`,e]}),` `,(0,W.jsxs)(`span`,{className:`text-danger`,children:[`−`,t]})]})}function Ie({status:e,children:t}){let{t:n}=r();return(0,W.jsxs)(`footer`,{className:`mt-auto flex h-10 shrink-0 items-center gap-2 border-t border-stroke-soft pr-1.5 pl-3 text-xs text-content-muted`,"data-changes-footer":!0,children:[(0,W.jsx)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1.5 truncate`,children:e}),(0,W.jsxs)(k,{children:[(0,W.jsx)(se,{asChild:!0,children:(0,W.jsx)(j,{type:`button`,variant:`ghost`,size:`icon-sm`,className:`pointer-coarse:size-11`,"aria-label":n(`board:changes.more`),title:n(`board:changes.more`),"data-changes-more":!0,children:(0,W.jsx)(ee,{"aria-hidden":`true`})})}),(0,W.jsx)(ce,{align:`end`,side:`top`,className:`min-w-48`,children:t})]})]})}function Le({status:e}){let{t}=r(),n=t(e===`created`?`board:changes.statusCreated`:e===`deleted`?`board:changes.statusDeleted`:e===`renamed`?`board:changes.statusRenamed`:`board:changes.statusModified`);return(0,W.jsxs)(`span`,{className:A(`w-3.5 flex-none text-center font-mono text-xs font-semibold`,Me[e]),title:n,children:[(0,W.jsx)(`span`,{"aria-hidden":`true`,children:Q[e]}),(0,W.jsx)(`span`,{className:`sr-only`,children:n})]})}function Re({files:e,selected:t,label:n,onSelect:r}){let i=(0,U.useRef)(null);return(0,W.jsxs)(`ul`,{ref:i,"aria-label":n,className:`max-h-[34%] min-h-11 shrink-0 overflow-y-auto border-b border-stroke-soft py-1`,onKeyDown:e=>{if(![`ArrowDown`,`ArrowUp`,`Home`,`End`].includes(e.key))return;let t=[...i.current?.querySelectorAll(`[data-change-file]`)??[]],n=t.findIndex(e=>e===document.activeElement),a=t[e.key===`Home`?0:e.key===`End`?t.length-1:Math.min(t.length-1,Math.max(0,n+(e.key===`ArrowDown`?1:-1)))];a&&(e.preventDefault(),a.focus(),r(a.dataset.changeFile||``))},"data-change-list":!0,children:[e.slice(0,Z).map(e=>{let n=e.path===t,{directory:i,name:a}=Ne(e.path);return(0,W.jsx)(`li`,{className:`px-1`,children:(0,W.jsxs)(`button`,{type:`button`,title:e.path,"aria-label":[e.path,Q[e.status],e.added!==null&&e.removed!==null?`+${e.added} −${e.removed}`:``,e.note||``].filter(Boolean).join(` `),"aria-current":n?`true`:void 0,"data-change-file":e.path,className:A(`flex h-8 w-full min-w-0 items-center gap-2 rounded-sm px-2 text-left text-xs transition-colors duration-(--d-fast) focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus max-[650px]:h-11 pointer-coarse:h-11`,n?`bg-solid shadow-[inset_0_0_0_1px_var(--stroke-strong)]`:`hover:bg-surface-hover`),onClick:()=>r(e.path),children:[(0,W.jsx)(Le,{status:e.status}),(0,W.jsxs)(`span`,{className:`flex min-w-0 flex-1 font-mono`,children:[(0,W.jsx)(`span`,{className:`min-w-0 truncate text-content-muted`,children:i}),(0,W.jsx)(`span`,{className:`flex-none text-content`,children:a})]}),e.note&&(0,W.jsx)(`span`,{className:`flex-none text-content-muted`,children:e.note}),(0,W.jsx)(Fe,{added:e.added,removed:e.removed})]})},e.path)}),e.length>Z&&(0,W.jsx)(`li`,{className:`px-3 py-1.5 text-xs text-content-muted tabular-nums`,children:(0,W.jsx)(ze,{count:e.length-Z})})]})}function ze({count:e}){let{t}=r();return(0,W.jsx)(W.Fragment,{children:t(`chat:focusSession.gitMoreFiles`,{count:e})})}var Be=600;function Ve({sessionId:e,file:t,scope:n,revision:i,view:a,onViewChange:o,footer:s}){let{t:c}=r(),l=B(e=>e.diffMode),u=B(e=>e.setDiffMode),d=(0,U.useRef)(null),[p,m]=(0,U.useState)(0);(0,U.useLayoutEffect)(()=>{let e=d.current;if(!e)return;let t=()=>m(e.clientWidth);t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);let h=p===0||p>=Be,g=h?l:`unified`,_=h?void 0:c(`board:changes.splitTooNarrow`);return(0,W.jsxs)(`section`,{ref:d,className:`flex min-h-0 flex-1 flex-col`,"aria-label":t.path,"data-change-detail":t.path,children:[(0,W.jsxs)(`header`,{className:`flex min-h-10 shrink-0 items-center gap-2 border-b border-stroke-soft py-1.5 pr-2 pl-3`,children:[(0,W.jsx)(Le,{status:t.status}),(0,W.jsx)(`strong`,{className:`min-w-0 flex-1 truncate font-mono text-xs font-semibold text-content`,title:t.path,children:t.path}),(0,W.jsx)(Fe,{added:t.added,removed:t.removed}),(0,W.jsx)(fe,{size:`sm`,"aria-label":c(`board:changes.diffView`),title:_,"aria-description":_,value:g,onValueChange:u,options:[{value:`unified`,label:c(`board:changes.unified`)},{value:`split`,label:c(`board:changes.split`),disabled:!h}]})]}),(0,W.jsx)(f,{sessionId:e,path:t.path,scope:n,revision:i,mode:g,fill:!0,position:a?.reading?.[t.path],onReading:e=>o?.({reading:{...a?.reading,[t.path]:e}})},`${n}:${t.path}`),(0,W.jsx)(`footer`,{className:`flex min-h-10 shrink-0 flex-wrap items-center gap-1 border-t border-stroke-soft py-1 pr-1.5 pl-3 text-xs`,children:s})]})}function He({cwd:e,path:t}){let{t:n}=r();if(!window.pisperDesktop||!e)return null;let i=$(e,t);return(0,W.jsxs)(j,{type:`button`,variant:`ghost`,size:`sm`,className:`max-[650px]:h-11`,onClick:async()=>{try{await ve(i,_e),Pe(n(`common:markdownMessage.revealLocalPathOk`,{path:t}),`info`)}catch(e){Pe(e instanceof I&&e.reason===`unavailable`?n(`common:markdownMessage.revealLocalPathUnavailable`):e instanceof I&&e.reason===`timeout`?n(`common:markdownMessage.revealLocalPathTimeout`):n(`common:markdownMessage.revealLocalPathFailed`,{path:t}),`error`)}},children:[(0,W.jsx)(H,{"aria-hidden":`true`}),n(`chat:chatMessage.fileActionReveal`)]})}function Ue(e){return{path:e.path,status:e.status===`created`?`created`:e.status===`deleted`?`deleted`:`modified`,added:e.added,removed:e.removed}}function We(e,t){if(!e)return;let n=[];return e.lineEnding&&n.push(t(`chat:focusSession.fileChangesLineEnding`,{from:e.lineEnding[0].toUpperCase(),to:e.lineEnding[1].toUpperCase()})),e.bom?.[1]?n.push(t(`chat:focusSession.fileChangesBomAdded`)):e.bom&&n.push(t(`chat:focusSession.fileChangesBomRemoved`)),t(`chat:focusSession.fileChangesFormatOnly`,{detail:n.join(` · `)})}function Ge({sessionId:e,cwd:t,streaming:n,view:i,onViewChange:a,requestConfirm:o}){let{t:s,language:c}=r(),{changes:l,loading:d,running:f,snapshotRevision:p,writesDisabled:m,pendingCount:h,reversibleCount:_,displayedError:v,notice:y,runAction:b,refresh:ee}=g({sessionId:e,streaming:n,requestConfirm:o}),x=l?.files??[],te=i?.expandedFiles?.[0],S=x.find(e=>e.path===te)??x[0],ne=e=>a?.({expandedFiles:[e]}),re=(e,t)=>f?.kind===e&&f.path===t,w=n?s(`chat:focusSession.gitWaitForRunToFinish`):void 0;return(0,W.jsxs)(`section`,{className:`flex min-h-0 flex-1 flex-col`,"aria-label":s(`chat:focusSession.fileChanges`),"aria-busy":d||!!f,"data-changes-scope":`session`,children:[(0,W.jsx)(`header`,{className:`flex min-h-10 shrink-0 items-center gap-1.5 border-b border-stroke-soft py-1 pr-1.5 pl-3`,children:(0,W.jsxs)(`p`,{className:`flex min-w-0 flex-1 items-center gap-2 text-xs text-content-secondary`,children:[(0,W.jsx)(`span`,{className:`min-w-0 truncate`,children:s(`board:changes.sessionSummary`,{count:l?.summary.files??0})}),l&&l.summary.files>0&&(0,W.jsx)(Fe,{added:l.summary.added,removed:l.summary.removed})]})}),v&&(0,W.jsx)(`p`,{role:`alert`,className:`shrink-0 px-3 pt-2 text-xs text-st-fail`,children:v}),y&&!v&&(0,W.jsx)(`p`,{role:`status`,className:`shrink-0 px-3 pt-2 text-xs text-content-secondary`,children:y}),d&&!l?(0,W.jsx)(P,{kind:`loading`,title:s(`chat:focusSession.gitLoading`)}):x.length?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Re,{files:x.map(e=>({...Ue(e),note:e.reverted?s(`chat:focusSession.fileChangesReverted`):e.approved?s(`chat:focusSession.fileChangesApproved`):We(e.formatChange,s)})),selected:S?.path??``,label:s(`board:changes.files`),onSelect:ne}),S&&(0,W.jsx)(Ve,{sessionId:e,file:Ue(S),scope:`task`,revision:p,view:i,onViewChange:a,footer:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`span`,{className:A(`mr-auto flex min-w-0 items-center gap-1.5 truncate`,S.approved?`text-st-done`:`text-content-muted`),"data-change-state":S.reverted?`reverted`:S.approved?`approved`:`pending`,children:[S.approved&&!S.reverted&&(0,W.jsx)(u,{className:`size-3.5 flex-none`,"aria-hidden":`true`}),S.reverted?s(`board:changes.revertedAt`,{time:M(S.changedAt,c)}):S.approved?s(`board:changes.approvedAt`,{time:M(S.changedAt,c)}):s(`board:changes.pendingAt`,{time:M(S.changedAt,c)})]}),S.pending&&!S.approved&&!S.reverted&&(0,W.jsxs)(j,{type:`button`,variant:`ghost`,size:`sm`,disabled:m,title:w,onClick:()=>void b({kind:`approve`,path:S.path}),children:[re(`approve`,S.path)?(0,W.jsx)(T,{className:`animate-spin`}):(0,W.jsx)(u,{}),s(`chat:focusSession.fileChangesApproveFile`)]}),(0,W.jsxs)(j,{type:`button`,variant:`ghost`,size:`sm`,disabled:m||S.reverted||!S.canRevert,title:w,onClick:()=>void b({kind:`revert`,path:S.path}),children:[re(`revert`,S.path)?(0,W.jsx)(T,{className:`animate-spin`}):(0,W.jsx)(C,{}),s(`board:changes.revertFile`)]}),(0,W.jsx)(He,{cwd:t,path:S.path})]})})]}):!v&&(0,W.jsx)(F,{compact:!0,title:s(`chat:focusSession.fileChangesEmpty`)}),(0,W.jsxs)(Ie,{status:f?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(T,{className:`size-3.5 flex-none animate-spin`,"aria-hidden":`true`}),f.kind===`approve`?s(`chat:focusSession.fileChangesApproveAll`):s(`board:changes.revertAll`)]}):h>0?s(`board:changes.pending`,{count:h}):null,children:[h>0&&(0,W.jsxs)(O,{disabled:m,title:w,onSelect:()=>void b({kind:`approve`}),children:[(0,W.jsx)(u,{}),s(`chat:focusSession.fileChangesApproveAll`)]}),(l?.summary.files??0)>0&&(0,W.jsxs)(O,{disabled:m||_===0,title:w??s(`chat:focusSession.fileChangesRevertAllDescription`),onSelect:()=>void b({kind:`revert`}),children:[(0,W.jsx)(C,{}),s(`board:changes.revertAll`)]}),(h>0||(l?.summary.files??0)>0)&&(0,W.jsx)(D,{}),(0,W.jsxs)(O,{disabled:d||!!f,onSelect:ee,children:[(0,W.jsx)(T,{}),s(`chat:focusSession.gitRefresh`)]})]})]})}function Ke({sessionId:e,cwd:t,streaming:n,view:a,onViewChange:o}){let{t:s}=r(),c=i({queryKey:[`task-project-changes`,e,t,n],queryFn:({signal:t})=>pe.getVcsChanges(e,{signal:t})}),l=(0,U.useMemo)(()=>S(c.data?.diff||``,c.data?.files.map(e=>e.path)||[],c.data?.diffTruncated),[c.data]),u=c.error?.message||c.data?.error,d=(c.data?.files||[]).map(e=>({path:e.path,status:je(e.status),added:Object.hasOwn(l.files,e.path)?l.files[e.path].added:null,removed:Object.hasOwn(l.files,e.path)?l.files[e.path].removed:null})),f=a?.expandedFiles?.[0],p=d.find(e=>e.path===f)??d[0];return(0,W.jsxs)(`section`,{className:`flex min-h-0 flex-1 flex-col`,"aria-label":s(`chat:workbench.projectChanges`),"aria-busy":c.isFetching,"data-changes-scope":`workspace`,children:[(0,W.jsxs)(`header`,{className:`flex min-h-10 shrink-0 items-center gap-1.5 border-b border-stroke-soft py-1 pr-1.5 pl-3`,children:[(0,W.jsxs)(`p`,{className:`flex min-w-0 flex-1 items-center gap-2 text-xs text-content-secondary`,children:[(0,W.jsx)(`span`,{className:`min-w-0 truncate`,children:s(`board:changes.workspaceSummary`,{count:d.length})}),c.data?.isRepo&&!u&&d.length>0&&(0,W.jsx)(Fe,{added:l.added,removed:l.removed})]}),c.data?.branch&&(0,W.jsxs)(`span`,{className:`inline-flex h-5.5 max-w-[40%] min-w-0 flex-none items-center gap-1 rounded-xs border border-stroke px-1.5 font-mono text-xs text-content-secondary`,title:t,children:[(0,W.jsx)(ne,{size:12,className:`flex-none`,"aria-hidden":`true`}),(0,W.jsx)(`span`,{className:`truncate`,children:c.data.branch})]})]}),c.isPending?(0,W.jsx)(P,{kind:`loading`,title:s(`chat:focusSession.gitLoading`)}):u?(0,W.jsx)(`p`,{role:`alert`,className:`p-3 text-xs text-st-fail`,children:u}):c.data?.isRepo?d.length?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Re,{files:d,selected:p?.path??``,label:s(`board:changes.files`),onSelect:e=>o?.({expandedFiles:[e]})}),p&&(0,W.jsx)(Ve,{sessionId:e,file:p,scope:`project`,revision:c.dataUpdatedAt,view:a,onViewChange:o,footer:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:`mr-auto min-w-0 truncate font-mono text-content-muted`,title:t,children:t}),(0,W.jsx)(He,{cwd:t,path:p.path})]})})]}):(0,W.jsx)(F,{compact:!0,title:s(`chat:focusSession.fileChangesEmpty`)}):(0,W.jsx)(F,{compact:!0,title:s(`chat:workbench.notRepository`)}),(0,W.jsx)(Ie,{status:c.isFetching?(0,W.jsx)(T,{className:`size-3.5 flex-none animate-spin`,"aria-hidden":`true`}):null,children:(0,W.jsxs)(O,{disabled:c.isFetching,onSelect:()=>void c.refetch(),children:[(0,W.jsx)(T,{}),s(`chat:focusSession.gitRefresh`)]})})]})}function qe({sessionId:e,cwd:t,streaming:n,scope:i,onScopeChange:a,vcsAvailable:o,view:s,onViewChange:c,requestConfirm:l}){let{t:u}=r();return(0,W.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,"data-inspector-changes":i,children:[(0,W.jsx)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-stroke-soft px-3 py-2`,children:(0,W.jsx)(fe,{size:`sm`,"aria-label":u(`board:inspector.changesScope`),value:i,onValueChange:a,options:[{value:`session`,label:u(`board:inspector.scopeSession`)},{value:`workspace`,label:u(`board:inspector.scopeWorkspace`),disabled:!o}]})}),s?i===`workspace`?(0,W.jsx)(Ke,{sessionId:e,cwd:t,streaming:n,view:s,onViewChange:c}):(0,W.jsx)(Ge,{sessionId:e,cwd:t,streaming:n,view:s,onViewChange:c,requestConfirm:l}):(0,W.jsx)(`p`,{role:`status`,className:`p-4 text-sm text-content-muted`,children:u(`chat:focusSession.gitLoading`)})]})}var Je=new Set([`changes`,`terminal`,`files`]),Ye=[];function Xe(e,t,n){return e===`changes`?n===`workspace`?`changes`:`files`:e===`terminal`?t:e===`files`?`sources`:e===`preview`?`browser`:e===`side-chat`?`side-chat`:null}function Ze({panelId:e,sessionId:t,cwd:n,streaming:s,plan:l,goal:u,team:f,activity:m,planTab:g,sources:v,mode:y,requestConfirm:ee,onClose:S,onOpenComponents:ne,componentTabs:C,autoFocus:T=!1,remoteMachine:E=!1}){let{t:D}=r(),O=y===`sheet`,se=be(),ce=o(e=>e.capabilities),k=!!se&&a(ce,`terminal`),pe=a(ce,`vcs`),M=B(e=>e.tab),N=B(e=>e.setTab),me=B(e=>e.terminalView),he=B(e=>e.setTerminalView),P=B(e=>e.changesView),_e=B(e=>e.setChangesView),I=R(e=>e.sessions[t]?.pages)??Ye,ve=I.some(e=>e.kind===`side-chat`),ye=E?`running`:`changes`,L=M===`side-chat`&&!ve||M===`plan`&&!g||E&&Je.has(M)?ye:M,z=Xe(L,me,P),V=z?I.find(e=>e.kind===z):void 0,H=!O&&C?C.tabs(n):[],[G,K]=(0,U.useState)(null),[q,J]=(0,U.useState)(!1),Y=H.some(e=>e.id===G)?G:null;(0,U.useEffect)(()=>K(null),[M]);let we=(0,U.useRef)(null);(0,U.useEffect)(()=>{we.current?.querySelector(`[role="tab"][aria-selected="true"]`)?.scrollIntoView?.({block:`nearest`,inline:`nearest`})},[L,Y]);let Te=(0,U.useRef)(T);(0,U.useEffect)(()=>{if(!Te.current)return;let e=requestAnimationFrame(()=>we.current?.querySelector(`[role="tab"][aria-selected="true"]`)?.focus({preventScroll:!0}));return()=>cancelAnimationFrame(e)},[]),(0,U.useEffect)(()=>{if(!z||V||(z===`terminal`||z===`processes`)&&!k)return;let e=R.getState(),n=e.sessions[t]?.contentOpen??!1;e.update(t,z,{type:`add`,kind:z}),n||e.update(t,z,{type:`workspace`,contentOpen:!1})},[z,V,t,k]);let Ee=i({queryKey:[`session-change-summary`,t,s],queryFn:()=>ge(t),staleTime:1e4}),X=Ee.data?.status===`known`?Ee.data.changedFiles??0:0,De=Se(m,s),Oe=[...E?[]:[{id:`changes`,icon:x,label:X>0?D(`board:inspector.changesCount`,{count:X}):D(`board:inspector.changes`)},{id:`terminal`,icon:ae,label:D(`board:inspector.terminal`)}],{id:`running`,icon:c,label:De?D(`board:inspector.runningCount`,{count:De}):D(`board:inspector.running`)},...E?[]:[{id:`files`,icon:te,label:D(`board:inspector.files`)}],{id:`preview`,icon:b,label:D(`board:inspector.preview`)},...g?[{id:`plan`,icon:re,label:D(`board:inspector.plan`)}]:[],...ve?[{id:`side-chat`,icon:w,label:D(`board:inspector.sideChat`)}]:[]],Z=e=>{V&&R.getState().update(t,V.kind,{type:`view`,id:V.id,patch:e})},je=()=>{let n=I.find(e=>e.kind===`side-chat`);if(n&&R.getState().update(t,`side-chat`,{type:`close`,id:n.id}),N(`changes`),O){S();return}requestAnimationFrame(()=>document.getElementById(`${e}-changes-tab`)?.focus())},Q=t=>`${e}-component-${t}-tab`,Me=e=>{K(null),N(e)},Ne=t=>{if(![`ArrowLeft`,`ArrowRight`,`Home`,`End`].includes(t.key))return;t.preventDefault();let n=[...Oe.map(t=>({fixed:t.id,id:`${e}-${t.id}-tab`})),...H.map(e=>({component:e.id,id:Q(e.id)}))],r=n.findIndex(e=>Y?e.component===Y:e.fixed===L),i=n[t.key===`Home`?0:t.key===`End`?n.length-1:(r+(t.key===`ArrowRight`?1:-1)+n.length)%n.length];i.component?K(i.component):i.fixed&&Me(i.fixed),requestAnimationFrame(()=>document.getElementById(i.id)?.focus())},$=(0,W.jsx)(`p`,{role:`status`,className:`p-4 text-sm text-content-muted`,children:D(`chat:focusSession.gitLoading`)}),Pe;return Pe=Y&&C?C.render(Y,{sessionId:t,cwd:n}):L===`changes`?(0,W.jsx)(qe,{sessionId:t,cwd:n,streaming:s,scope:P,onScopeChange:_e,vcsAvailable:pe,view:V?.view,onViewChange:V?Z:void 0,requestConfirm:ee}):L===`terminal`?k?(0,W.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,W.jsx)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-stroke-soft px-3 py-2`,children:(0,W.jsx)(fe,{size:`sm`,"aria-label":D(`board:inspector.terminalScope`),value:me,onValueChange:he,options:[{value:`terminal`,label:D(`board:inspector.terminal`)},{value:`processes`,label:D(`board:inspector.processes`)}]})}),(0,W.jsx)(U.Suspense,{fallback:$,children:V?me===`processes`?(0,W.jsx)(p,{sessionId:t,view:V.view,onViewChange:Z,onOpenTerminal:e=>{let n=R.getState(),r=n.sessions[t]?.pages.find(e=>e.kind===`terminal`);r?n.update(t,`terminal`,{type:`resource`,id:r.id,resourceId:e}):n.update(t,`terminal`,{type:`open`,kind:`terminal`,resourceId:e}),he(`terminal`)}}):(0,W.jsx)(d,{sessionId:t,cwd:n,terminalId:V.resourceId||void 0,onCreated:e=>R.getState().update(t,`terminal`,{type:`resource`,id:V.id,resourceId:e})},V.id):$})]}):(0,W.jsx)(F,{compact:!0,icon:ae,title:D(`board:inspector.terminalUnavailable`)}):L===`files`?V?(0,W.jsx)(_,{sources:v,view:V.view,onViewChange:Z}):$:L===`preview`?V?(0,W.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,"data-inspector-preview":!0,children:(0,W.jsx)(Ae,{panelId:e,sessionId:t},t)}):$:L===`plan`?(0,W.jsx)(ke,{plan:l,streaming:s,goal:u,team:f,activity:m}):L===`running`?(0,W.jsx)(Ce,{sessionId:t,streaming:s,activity:m}):(0,W.jsx)(h,{parentId:t,active:!0}),(0,W.jsxs)(`section`,{id:e,"aria-label":D(`board:inspector.label`),"data-session-inspector":y,"data-inspector-tab":L,"data-inspector-component":Y??void 0,className:`flex h-full min-h-0 w-full min-w-0 flex-col bg-panel text-content`,children:[(0,W.jsxs)(`header`,{className:A(`flex shrink-0 items-center gap-1 border-b border-stroke-soft pr-1.5 pl-2`,O?`h-[52px]`:y===`aside`?`h-[52px] [[data-custom-titlebar]_&]:h-11 [[data-custom-titlebar]_&]:pointer-coarse:h-[52px]`:`h-11 pointer-coarse:h-[52px]`),children:[(0,W.jsxs)(`div`,{ref:we,role:`tablist`,"aria-label":D(`board:inspector.tabs`),className:`flex min-w-0 flex-1 items-center gap-0.5 overflow-x-auto [scrollbar-width:none]`,onKeyDown:Ne,children:[Oe.map(({id:t,icon:n,label:r})=>{let i=!Y&&t===L;return(0,W.jsxs)(`button`,{id:`${e}-${t}-tab`,type:`button`,role:`tab`,"aria-selected":i,"aria-controls":`${e}-body`,tabIndex:i?0:-1,"data-inspector-tab-id":t,className:A(`flex flex-none items-center gap-1.5 rounded-sm px-2 text-[13px] whitespace-nowrap transition-colors duration-(--d-fast) focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus`,O?`h-11 min-w-11 justify-center px-2.5`:`h-8 pointer-coarse:h-11 pointer-coarse:min-w-11`,i?`bg-solid font-medium text-content shadow-edge ring-1 ring-stroke-strong ring-inset`:`text-content-secondary hover:bg-surface-hover hover:text-content`),onClick:()=>Me(t),children:[!O&&(0,W.jsx)(n,{className:`size-3.5`,"aria-hidden":`true`}),r]},t)}),!Y&&L===`side-chat`&&(0,W.jsx)(j,{type:`button`,variant:`ghost`,size:`icon-sm`,className:A(O&&`size-11`),"aria-label":D(`board:inspector.closeTab`,{tab:D(`board:inspector.sideChat`)}),onClick:je,children:(0,W.jsx)(oe,{"aria-hidden":`true`})}),!O&&(0,W.jsx)(`span`,{"aria-hidden":`true`,className:`mx-1 h-4 w-px flex-none bg-stroke`}),H.map(({id:t,label:n})=>{let r=t===Y;return(0,W.jsx)(`button`,{id:Q(t),type:`button`,role:`tab`,"aria-selected":r,"aria-controls":`${e}-body`,tabIndex:r?0:-1,"data-inspector-component-tab":t,className:A(`flex h-8 max-w-40 flex-none items-center rounded-sm px-2 text-[13px] whitespace-nowrap transition-colors duration-(--d-fast) focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus pointer-coarse:h-11 pointer-coarse:min-w-11`,r?`bg-solid font-medium text-content shadow-edge ring-1 ring-stroke-strong ring-inset`:`text-content-secondary hover:bg-surface-hover hover:text-content`),onClick:()=>K(t),children:(0,W.jsx)(`span`,{className:`truncate`,children:n})},t)})]}),!O&&(0,W.jsxs)(de,{open:q,onOpenChange:J,children:[(0,W.jsx)(le,{asChild:!0,children:(0,W.jsx)(j,{type:`button`,variant:`ghost`,size:`icon-sm`,className:`flex-none`,"aria-label":D(`board:inspector.add`),title:D(`board:inspector.add`),"data-inspector-component-add":!0,children:(0,W.jsx)(ie,{"aria-hidden":`true`})})}),(0,W.jsxs)(ue,{align:`end`,className:`w-64 text-xs`,children:[C?.addMenu?C.addMenu({cwd:n,onAdded:e=>{K(e),J(!1)}}):(0,W.jsx)(`p`,{className:`text-content-secondary`,children:D(`board:inspector.addHint`)}),ne&&(0,W.jsx)(j,{type:`button`,variant:`secondary`,size:`sm`,className:`self-start`,onClick:ne,children:D(`board:inspector.openComponents`)})]})]}),(0,W.jsx)(j,{type:`button`,variant:`ghost`,size:`icon-sm`,className:A(`flex-none`,O&&`size-11`),"aria-label":D(`board:inspector.close`),title:D(`board:inspector.close`),"aria-controls":e,onClick:S,children:y===`aside`?(0,W.jsx)(xe,{"aria-hidden":`true`}):(0,W.jsx)(oe,{"aria-hidden":`true`})})]}),(0,W.jsx)(`div`,{id:`${e}-body`,role:`tabpanel`,"aria-labelledby":Y?Q(Y):`${e}-${L}-tab`,className:`flex min-h-0 flex-1 flex-col overflow-hidden`,children:Pe})]})}export{Ze as SessionInspector};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{f as t,l as n,u as r}from"./vendor-router-CSN_DGvx.js";import{i,r as a}from"./vendor-react-DwNgTV1j.js";import{f as o,r as s}from"./routes-DIeaqWVc.js";import{t as c}from"./use-i18n-CaxKosZm.js";import{a as l,o as u,s as d,u as f}from"./placements-BDYSXHzl.js";import{t as p}from"./client-store-DvE_NEoR.js";import{t as m}from"./usePhoneShell-0IX6-LbH.js";import{t as h}from"./PhoneMenuButton-mlilY9bo.js";import{t as g}from"./useSessionListQuery-DXeYJTOA.js";import{t as _}from"./public-BDWkdvCh.js";import{i as v,t as y}from"./session-home-CwRaSks0.js";var b=e(i(),1),x=a(),S=`(max-width: 1279px), (max-height: 760px)`,C=`(min-width: 960px) and (min-height: 640px)`;function w(e){let[t,n]=(0,b.useState)(()=>window.matchMedia(e).matches);return(0,b.useEffect)(()=>{let t=window.matchMedia(e),r=()=>n(t.matches);return r(),t.addEventListener(`change`,r),()=>t.removeEventListener(`change`,r)},[e]),t}function T({context:e,ChatPage:i}){let a=r(),c=n(),{sessionId:l=``}=t(),u=m(),d=p(e=>e.client===`mobile-app`),f=w(`(min-width: 960px) and (min-height: 640px)`)&&d,C=w(S),T=!u||f,D=(0,b.useRef)(l);D.current=l;let O=(0,b.useRef)(c.state);O.current=c.state;let k=(0,b.useCallback)(e=>{if(!e||e===D.current)return;let t=D.current===`new`;a(o(e),{replace:t,state:t?O.current:void 0})},[a]),A=g(),j=!!(l&&l!==`new`&&A.data?.sessions.some(e=>e.id===l));(0,b.useEffect)(()=>{j&&v(l)},[j,l]);let M=E(e.notify,k),N=e.startNewTask,P=l===`new`,F=e.notify,I=_({onError:e=>F(e,`error`)}),L=P?I:void 0,R=(0,b.useMemo)(()=>({compact:C,overlayOnly:d,onOpenComponents:()=>a(s.components),componentTabs:M,onArchived:e=>{y(e),a(`/`,{replace:!0})},onHome:()=>a(`/`),onNewTask:N,newTaskDraft:L}),[C,d,a,M,N,L]),z=(0,b.useMemo)(()=>({...R,phone:{onNewTask:N}}),[R,N]);return(0,x.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,"data-session-shell":T?`desktop`:`phone`,children:(0,x.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1`,children:(0,x.jsx)(i,{notify:e.notify,navigate:e.navigate,browserNotify:e.browserNotify,pendingAsset:e.pendingAsset,onAssetConsumed:e.onAssetConsumed,requestText:e.requestText,requestConfirm:e.requestConfirm,routeSessionId:l,onRouteSessionChange:k,routeLeading:T?void 0:(0,x.jsx)(h,{}),pageChrome:T?R:z})})})}function E(e,t){let{language:n}=c(),{available:r,placed:i}=f(`session-panel`);return(0,b.useMemo)(()=>{if(r)return{tabs:e=>d(i,e,n),render:(n,{sessionId:r,cwd:a})=>{let o=i.find(e=>e.instance.instanceId===n);return o?(0,x.jsx)(b.Suspense,{fallback:null,children:(0,x.jsx)(u,{placed:o,sessionId:r,cwd:a,notify:e,onOpenSession:t})}):null},addMenu:({cwd:t,onAdded:n})=>(0,x.jsx)(b.Suspense,{fallback:null,children:(0,x.jsx)(l,{cwd:t,notify:e,onAdded:n})})}},[r,n,e,t,i])}export{S as SESSION_COMPACT_QUERY,C as SESSION_TABLET_QUERY,T as SessionShell};
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{f as t,l as n,u as r}from"./vendor-router-CSN_DGvx.js";import{i,r as a}from"./vendor-react-DwNgTV1j.js";import{f as o,r as s}from"./routes-DIeaqWVc.js";import{t as c}from"./use-i18n-BVRhlQ1v.js";import{a as l,o as u,s as d,u as f}from"./placements-BERPVxJD.js";import{t as p}from"./client-store-B5wZ2IWH.js";import{t as m}from"./usePhoneShell-BpuKJgci.js";import{t as h}from"./PhoneMenuButton-CTlyYTpl.js";import{t as g}from"./useSessionListQuery-CURESPBn.js";import{t as _}from"./public-CEKKZh7R.js";import{i as v,t as y}from"./session-home-BmAnhROp.js";var b=e(i(),1),x=a(),S=`(max-width: 1279px), (max-height: 760px)`,C=`(min-width: 960px) and (min-height: 640px)`;function w(e){let[t,n]=(0,b.useState)(()=>window.matchMedia(e).matches);return(0,b.useEffect)(()=>{let t=window.matchMedia(e),r=()=>n(t.matches);return r(),t.addEventListener(`change`,r),()=>t.removeEventListener(`change`,r)},[e]),t}function T({context:e,ChatPage:i}){let a=r(),c=n(),{sessionId:l=``}=t(),u=m(),d=p(e=>e.client===`mobile-app`),f=w(`(min-width: 960px) and (min-height: 640px)`)&&d,C=w(S),T=!u||f,D=(0,b.useRef)(l);D.current=l;let O=(0,b.useRef)(c.state);O.current=c.state;let k=(0,b.useCallback)(e=>{if(!e||e===D.current)return;let t=D.current===`new`;a(o(e),{replace:t,state:t?O.current:void 0})},[a]),A=g(),j=!!(l&&l!==`new`&&A.data?.sessions.some(e=>e.id===l));(0,b.useEffect)(()=>{j&&v(l)},[j,l]);let M=E(e.notify,k),N=e.startNewTask,P=l===`new`,F=e.notify,I=_({onError:e=>F(e,`error`)}),L=P?I:void 0,R=(0,b.useMemo)(()=>({compact:C,overlayOnly:d,onOpenComponents:()=>a(s.components),componentTabs:M,onArchived:e=>{y(e),a(`/`,{replace:!0})},onHome:()=>a(`/`),onNewTask:N,newTaskDraft:L}),[C,d,a,M,N,L]),z=(0,b.useMemo)(()=>({...R,phone:{onNewTask:N}}),[R,N]);return(0,x.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,"data-session-shell":T?`desktop`:`phone`,children:(0,x.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1`,children:(0,x.jsx)(i,{notify:e.notify,navigate:e.navigate,browserNotify:e.browserNotify,pendingAsset:e.pendingAsset,onAssetConsumed:e.onAssetConsumed,requestText:e.requestText,requestConfirm:e.requestConfirm,routeSessionId:l,onRouteSessionChange:k,routeLeading:T?void 0:(0,x.jsx)(h,{}),pageChrome:T?R:z})})})}function E(e,t){let{language:n}=c(),{available:r,placed:i}=f(`session-panel`);return(0,b.useMemo)(()=>{if(r)return{tabs:e=>d(i,e,n),render:(n,{sessionId:r,cwd:a})=>{let o=i.find(e=>e.instance.instanceId===n);return o?(0,x.jsx)(b.Suspense,{fallback:null,children:(0,x.jsx)(u,{placed:o,sessionId:r,cwd:a,notify:e,onOpenSession:t})}):null},addMenu:({cwd:t,onAdded:n})=>(0,x.jsx)(b.Suspense,{fallback:null,children:(0,x.jsx)(l,{cwd:t,notify:e,onAdded:n})})}},[r,n,e,t,i])}export{S as SESSION_COMPACT_QUERY,C as SESSION_TABLET_QUERY,T as SessionShell};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{t as r}from"./use-i18n-CaxKosZm.js";import{t as i}from"./runtime-capabilities-store-SnV1V9_K.js";import{t as a}from"./arrow-left-B8oVrQ2S.js";import{t as o}from"./arrow-right-DqLOhpA2.js";import{r as s}from"./settings-navigation-DiP_AM1C.js";import{t as c}from"./utils-C8uzG5AZ.js";import{t as l}from"./kbd-CAufZTkl.js";import{n as u}from"./shortcuts-BmJZiLby.js";import{n as d,r as f}from"./back-navigation-CK7X_5Bc.js";var p=e(t(),1);function m(e,t=!0){let n=(0,p.useRef)(e);n.current=e,(0,p.useEffect)(()=>{if(!t)return;let e=new WeakSet,r=t=>{t.key===`Escape`&&d()&&e.add(t)},i=t=>{t.key!==`Escape`||t.defaultPrevented||t.isComposing||t.altKey||t.ctrlKey||t.metaKey||t.shiftKey||e.has(t)||u(t.target)&&!f(t)||(t.preventDefault(),n.current())};return window.addEventListener(`keydown`,r,!0),window.addEventListener(`keydown`,i),()=>{window.removeEventListener(`keydown`,r,!0),window.removeEventListener(`keydown`,i)}},[t])}var h=n(),g=`flex h-8 w-full min-w-0 items-center gap-2.5 rounded-[var(--r-md)] px-2.5 text-left text-[length:var(--app-font-size)] text-content transition-colors duration-(--d-fast) hover:bg-surface-hover focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus pointer-coarse:h-11`;function _({configSection:e,onSelectSection:t,onBack:n,onOpenFeatures:u,search:d,version:f,footer:p}){let{t:_}=r(),v=i(e=>e.capabilities),y=s(_,{capabilities:v});m(n);let b=_(`config:settingsShell.back`);return(0,h.jsxs)(`nav`,{"aria-label":_(`config:settingsShell.settingsNavigation`),"data-settings-sidebar":!0,className:`flex min-h-0 flex-1 flex-col animate-in fade-in duration-(--d-fast) motion-reduce:animate-none`,children:[(0,h.jsxs)(`div`,{"data-window-drag-region":!0,className:`flex h-[52px] flex-none items-center gap-2 pr-3.5 pl-2`,children:[(0,h.jsxs)(`button`,{type:`button`,"data-settings-back":!0,"aria-keyshortcuts":`Escape`,className:`flex h-8 items-center gap-2 rounded-[var(--r-md)] pr-2.5 pl-1.5 text-sm text-content-secondary transition-colors duration-(--d-fast) hover:bg-surface-hover hover:text-content focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus pointer-coarse:h-11`,onClick:n,children:[(0,h.jsx)(a,{className:`size-[18px]`,strokeWidth:1.75,"aria-hidden":`true`}),b]}),(0,h.jsx)(`span`,{className:`flex-1`}),(0,h.jsx)(l,{"aria-hidden":`true`,className:`border-transparent bg-transparent text-content-faint shadow-none pointer-coarse:hidden`,children:`Esc`})]}),(0,h.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain px-2 pb-2`,children:[(0,h.jsx)(`h2`,{className:`m-0 px-2.5 pt-2.5 pb-3 text-xl leading-7 font-semibold tracking-[-.01em] text-content`,children:_(`navigation:navigation.settings`)}),d&&(0,h.jsx)(`div`,{className:`relative z-20 mb-2 px-0.5`,children:d}),(0,h.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-px p-0`,children:y.map(n=>{let r=n.section===e;return(0,h.jsx)(`li`,{children:(0,h.jsxs)(`button`,{type:`button`,"data-settings-section":n.section,"aria-current":r?`page`:void 0,className:c(g,r&&`bg-surface-active font-medium hover:bg-surface-active`),onClick:()=>t(n.section),children:[(0,h.jsx)(n.icon,{className:`size-4 flex-none text-content-secondary`,strokeWidth:1.75,"aria-hidden":`true`}),(0,h.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:n.label}),n.section===`about`&&f&&(0,h.jsxs)(`small`,{className:`font-mono text-xs font-normal text-content-muted tabular-nums`,children:[`v`,f]})]})},n.section)})}),(0,h.jsxs)(`button`,{type:`button`,"data-settings-features-link":!0,className:`mt-4 flex min-h-8 w-full items-center gap-1 rounded-[var(--r-md)] px-2.5 py-1 text-left text-xs leading-5 text-content-muted transition-colors duration-(--d-fast) hover:bg-surface-hover hover:text-content-secondary focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus pointer-coarse:min-h-11`,onClick:u,children:[(0,h.jsx)(`span`,{className:`min-w-0 flex-1`,children:_(`config:settingsShell.featuresHint`)}),(0,h.jsx)(o,{className:`size-3.5 flex-none`,"aria-hidden":`true`})]})]}),p&&(0,h.jsx)(`div`,{className:`flex-none p-2`,children:p})]})}export{_ as SettingsSidebar};
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{t as r}from"./use-i18n-BVRhlQ1v.js";import{t as i}from"./runtime-capabilities-store-Bd3gWIM7.js";import{t as a}from"./arrow-left-B8oVrQ2S.js";import{t as o}from"./arrow-right-DqLOhpA2.js";import{r as s}from"./settings-navigation-C6_RpGgI.js";import{t as c}from"./utils-C8uzG5AZ.js";import{t as l}from"./kbd-CAufZTkl.js";import{n as u}from"./shortcuts-Dsd4mjfP.js";import{n as d,r as f}from"./back-navigation-CK7X_5Bc.js";var p=e(t(),1);function m(e,t=!0){let n=(0,p.useRef)(e);n.current=e,(0,p.useEffect)(()=>{if(!t)return;let e=new WeakSet,r=t=>{t.key===`Escape`&&d()&&e.add(t)},i=t=>{t.key!==`Escape`||t.defaultPrevented||t.isComposing||t.altKey||t.ctrlKey||t.metaKey||t.shiftKey||e.has(t)||u(t.target)&&!f(t)||(t.preventDefault(),n.current())};return window.addEventListener(`keydown`,r,!0),window.addEventListener(`keydown`,i),()=>{window.removeEventListener(`keydown`,r,!0),window.removeEventListener(`keydown`,i)}},[t])}var h=n(),g=`flex h-8 w-full min-w-0 items-center gap-2.5 rounded-[var(--r-md)] px-2.5 text-left text-[length:var(--app-font-size)] text-content transition-colors duration-(--d-fast) hover:bg-surface-hover focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus pointer-coarse:h-11`;function _({configSection:e,onSelectSection:t,onBack:n,onOpenFeatures:u,search:d,version:f,footer:p}){let{t:_}=r(),v=i(e=>e.capabilities),y=s(_,{capabilities:v});m(n);let b=_(`config:settingsShell.back`);return(0,h.jsxs)(`nav`,{"aria-label":_(`config:settingsShell.settingsNavigation`),"data-settings-sidebar":!0,className:`flex min-h-0 flex-1 flex-col animate-in fade-in duration-(--d-fast) motion-reduce:animate-none`,children:[(0,h.jsxs)(`div`,{"data-window-drag-region":!0,className:`flex h-[52px] flex-none items-center gap-2 pr-3.5 pl-2`,children:[(0,h.jsxs)(`button`,{type:`button`,"data-settings-back":!0,"aria-keyshortcuts":`Escape`,className:`flex h-8 items-center gap-2 rounded-[var(--r-md)] pr-2.5 pl-1.5 text-sm text-content-secondary transition-colors duration-(--d-fast) hover:bg-surface-hover hover:text-content focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus pointer-coarse:h-11`,onClick:n,children:[(0,h.jsx)(a,{className:`size-[18px]`,strokeWidth:1.75,"aria-hidden":`true`}),b]}),(0,h.jsx)(`span`,{className:`flex-1`}),(0,h.jsx)(l,{"aria-hidden":`true`,className:`border-transparent bg-transparent text-content-faint shadow-none pointer-coarse:hidden`,children:`Esc`})]}),(0,h.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain px-2 pb-2`,children:[(0,h.jsx)(`h2`,{className:`m-0 px-2.5 pt-2.5 pb-3 text-xl leading-7 font-semibold tracking-[-.01em] text-content`,children:_(`navigation:navigation.settings`)}),d&&(0,h.jsx)(`div`,{className:`relative z-20 mb-2 px-0.5`,children:d}),(0,h.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-px p-0`,children:y.map(n=>{let r=n.section===e;return(0,h.jsx)(`li`,{children:(0,h.jsxs)(`button`,{type:`button`,"data-settings-section":n.section,"aria-current":r?`page`:void 0,className:c(g,r&&`bg-surface-active font-medium hover:bg-surface-active`),onClick:()=>t(n.section),children:[(0,h.jsx)(n.icon,{className:`size-4 flex-none text-content-secondary`,strokeWidth:1.75,"aria-hidden":`true`}),(0,h.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:n.label}),n.section===`about`&&f&&(0,h.jsxs)(`small`,{className:`font-mono text-xs font-normal text-content-muted tabular-nums`,children:[`v`,f]})]})},n.section)})}),(0,h.jsxs)(`button`,{type:`button`,"data-settings-features-link":!0,className:`mt-4 flex min-h-8 w-full items-center gap-1 rounded-[var(--r-md)] px-2.5 py-1 text-left text-xs leading-5 text-content-muted transition-colors duration-(--d-fast) hover:bg-surface-hover hover:text-content-secondary focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus pointer-coarse:min-h-11`,onClick:u,children:[(0,h.jsx)(`span`,{className:`min-w-0 flex-1`,children:_(`config:settingsShell.featuresHint`)}),(0,h.jsx)(o,{className:`size-3.5 flex-none`,"aria-hidden":`true`})]})]}),p&&(0,h.jsx)(`div`,{className:`flex-none p-2`,children:p})]})}export{_ as SettingsSidebar};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{t as r}from"./use-i18n-CaxKosZm.js";import{t as i}from"./settings-QX0oWnVK.js";import{t as a}from"./button-CCcCN8tE.js";import{c as o}from"./shortcuts-BmJZiLby.js";import{a as s,i as c,l,n as u,o as d,s as f,t as p}from"./dialog-9LXtFD-0.js";import{a as m,i as h,n as g,r as _,t as v}from"./ShortcutKeys-DNpsGYcw.js";var y=e(t(),1),b=n();function x({open:e,onOpenChange:t,onCustomize:n}){let{t:x}=r(),S=m(),C=o(e=>e.bindings),w=o(e=>e.boardBindings),[T]=(0,y.useState)(()=>document.activeElement instanceof HTMLElement?document.activeElement:null),E=(0,y.useRef)(null),[D,O]=(0,y.useState)(!0);return(0,b.jsx)(p,{open:e,onOpenChange:t,children:(0,b.jsxs)(c,{size:`wide`,scrollMode:`body`,className:`max-w-[min(92vw,760px)]`,"data-shortcut-help":!0,onOpenAutoFocus:e=>{E.current&&(e.preventDefault(),E.current.focus({preventScroll:!0}))},onCloseAutoFocus:e=>{T?.isConnected&&(e.preventDefault(),T.focus({preventScroll:!0}))},children:[(0,b.jsxs)(f,{className:`pr-8`,children:[(0,b.jsx)(l,{children:x(`board:shortcuts.shortcutHelp`)}),(0,b.jsx)(s,{children:x(`board:shortcuts.helpDescription`)})]}),(0,b.jsx)(u,{ref:E,tabIndex:0,role:`region`,"aria-label":x(`board:shortcuts.shortcutHelp`),"data-quiet-focus":D||void 0,onKeyDown:e=>{let{key:t,metaKey:n,ctrlKey:r,altKey:i}=e;t===`Escape`||t===`Shift`||n||r||i||O(!1)},onBlur:()=>O(!1),className:`-mx-4 px-4 py-2 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus data-quiet-focus:focus-visible:outline-none`,children:(0,b.jsx)(`div`,{className:`grid gap-x-8 gap-y-5 min-[720px]:grid-cols-2`,children:g.map(e=>(0,b.jsxs)(`section`,{"aria-labelledby":`shortcut-help-${e.id}`,"data-shortcut-help-group":e.id,className:e.id===`board`?`min-[720px]:row-span-2`:void 0,children:[(0,b.jsx)(`h3`,{id:`shortcut-help-${e.id}`,className:`text-[13px] leading-5 font-semibold text-content`,children:S.groups[e.id].title}),(0,b.jsx)(`p`,{className:`mb-1 text-xs text-content-muted`,children:S.groups[e.id].hint}),(0,b.jsx)(`dl`,{className:`divide-y divide-stroke-soft`,children:e.entries.map(e=>(0,b.jsxs)(`div`,{className:`flex min-h-7 min-w-0 items-center justify-between gap-3 py-0.5`,"data-shortcut-help-entry":_(e),children:[(0,b.jsx)(`dt`,{className:`min-w-0 text-[13px] text-content`,children:S.label(e)}),(0,b.jsx)(`dd`,{className:`flex-none`,children:(0,b.jsx)(v,{keys:h(e,C,w),className:`justify-end`})})]},_(e)))})]},e.id))})}),n&&(0,b.jsx)(d,{children:(0,b.jsxs)(a,{variant:`outline`,size:`dialogAction`,onClick:()=>{t(!1),n()},children:[(0,b.jsx)(i,{"aria-hidden":`true`}),x(`board:shortcuts.helpCustomize`)]})})]})})}export{x as ShortcutHelpDialog};
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{t as r}from"./use-i18n-BVRhlQ1v.js";import{t as i}from"./settings-QX0oWnVK.js";import{t as a}from"./button-CCcCN8tE.js";import{c as o}from"./shortcuts-Dsd4mjfP.js";import{a as s,i as c,l,n as u,o as d,s as f,t as p}from"./dialog-BDNbY1pW.js";import{a as m,i as h,n as g,r as _,t as v}from"./ShortcutKeys-DksC1OkE.js";var y=e(t(),1),b=n();function x({open:e,onOpenChange:t,onCustomize:n}){let{t:x}=r(),S=m(),C=o(e=>e.bindings),w=o(e=>e.boardBindings),[T]=(0,y.useState)(()=>document.activeElement instanceof HTMLElement?document.activeElement:null),E=(0,y.useRef)(null),[D,O]=(0,y.useState)(!0);return(0,b.jsx)(p,{open:e,onOpenChange:t,children:(0,b.jsxs)(c,{size:`wide`,scrollMode:`body`,className:`max-w-[min(92vw,760px)]`,"data-shortcut-help":!0,onOpenAutoFocus:e=>{E.current&&(e.preventDefault(),E.current.focus({preventScroll:!0}))},onCloseAutoFocus:e=>{T?.isConnected&&(e.preventDefault(),T.focus({preventScroll:!0}))},children:[(0,b.jsxs)(f,{className:`pr-8`,children:[(0,b.jsx)(l,{children:x(`board:shortcuts.shortcutHelp`)}),(0,b.jsx)(s,{children:x(`board:shortcuts.helpDescription`)})]}),(0,b.jsx)(u,{ref:E,tabIndex:0,role:`region`,"aria-label":x(`board:shortcuts.shortcutHelp`),"data-quiet-focus":D||void 0,onKeyDown:e=>{let{key:t,metaKey:n,ctrlKey:r,altKey:i}=e;t===`Escape`||t===`Shift`||n||r||i||O(!1)},onBlur:()=>O(!1),className:`-mx-4 px-4 py-2 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus data-quiet-focus:focus-visible:outline-none`,children:(0,b.jsx)(`div`,{className:`grid gap-x-8 gap-y-5 min-[720px]:grid-cols-2`,children:g.map(e=>(0,b.jsxs)(`section`,{"aria-labelledby":`shortcut-help-${e.id}`,"data-shortcut-help-group":e.id,className:e.id===`board`?`min-[720px]:row-span-2`:void 0,children:[(0,b.jsx)(`h3`,{id:`shortcut-help-${e.id}`,className:`text-[13px] leading-5 font-semibold text-content`,children:S.groups[e.id].title}),(0,b.jsx)(`p`,{className:`mb-1 text-xs text-content-muted`,children:S.groups[e.id].hint}),(0,b.jsx)(`dl`,{className:`divide-y divide-stroke-soft`,children:e.entries.map(e=>(0,b.jsxs)(`div`,{className:`flex min-h-7 min-w-0 items-center justify-between gap-3 py-0.5`,"data-shortcut-help-entry":_(e),children:[(0,b.jsx)(`dt`,{className:`min-w-0 text-[13px] text-content`,children:S.label(e)}),(0,b.jsx)(`dd`,{className:`flex-none`,children:(0,b.jsx)(v,{keys:h(e,C,w),className:`justify-end`})})]},_(e)))})]},e.id))})}),n&&(0,b.jsx)(d,{children:(0,b.jsxs)(a,{variant:`outline`,size:`dialogAction`,onClick:()=>{t(!1),n()},children:[(0,b.jsx)(i,{"aria-hidden":`true`}),x(`board:shortcuts.helpCustomize`)]})})]})})}export{x as ShortcutHelpDialog};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{t as r}from"./use-i18n-CaxKosZm.js";import{t as i}from"./utils-C8uzG5AZ.js";import{n as a,t as o}from"./kbd-CAufZTkl.js";import{t as s}from"./shortcuts-BmJZiLby.js";var c=e=>({kind:`app`,action:e}),l=e=>({kind:`board`,action:e}),u=(e,...t)=>({kind:`fixed`,id:e,keys:t}),d=[{id:`global`,entries:[c(`commandPalette`),c(`primaryAction`),c(`toggleSidebar`),c(`agentPanel`),c(`openBoard`),c(`openMore`),c(`openSettings`),c(`jumpToAttention`),c(`previousAgent`),c(`nextAgent`),c(`cycleFocusRegion`),c(`toggleTerminal`),c(`shortcutHelp`),c(`focusComposer`),c(`voiceInput`),c(`openSession`),c(`openComponents`)]},{id:`sidebar`,entries:[u(`sidebarMove`,[`↑`],[`↓`]),u(`sidebarOpen`,[`Enter`])]},{id:`board`,entries:[c(`focusSearch`),l(`boardNext`),l(`boardPrevious`),u(`boardMove`,[`↑`],[`↓`]),u(`boardOpen`,[`Enter`]),l(`boardApprove`),l(`boardDeny`),l(`boardRetry`),l(`boardTriage`),u(`boardExitTriage`,[`Esc`]),l(`boardToggleGrouping`)]},{id:`session`,entries:[c(`toggleInspector`),c(`sessionTree`),c(`sideChat`),c(`sendMessage`),c(`steerMessage`),u(`newline`,[`Shift`,`Enter`]),u(`cycleRunMode`,[`Shift`,`Tab`]),u(`stopRun`,[`Esc`])]}];function f(e){return e.kind===`fixed`?`fixed:${e.id}`:e.action}function p(e,t,n){if(e.kind===`fixed`)return e.keys;let r=s(e.kind===`app`?t[e.action]:n[e.action]);return r?[r.split(` + `)]:null}function m(){let{t:e}=r(),t={commandPalette:e(`config:shortcuts.commandPalette`),primaryAction:e(`config:shortcuts.primaryAction`),focusSearch:e(`board:shortcuts.focusSearch`),toggleSidebar:e(`config:shortcuts.toggleSidebar`),toggleTerminal:e(`config:shortcuts.toggleTerminal`),openSettings:e(`config:shortcuts.openSettings`),focusComposer:e(`config:shortcuts.focusComposer`),sendMessage:e(`board:shortcuts.sendMessage`),voiceInput:e(`config:shortcuts.voiceInput`),openBoard:e(`config:shortcuts.openBoard`),openComponents:e(`config:shortcuts.openComponents`),openMore:e(`config:shortcuts.openMore`),jumpToAttention:e(`config:shortcuts.jumpToAttention`),agentPanel:e(`board:shortcuts.agentPanel`),toggleInspector:e(`board:shortcuts.toggleInspector`),previousAgent:e(`board:shortcuts.previousAgent`),nextAgent:e(`board:shortcuts.nextAgent`),steerMessage:e(`board:shortcuts.steerMessage`),shortcutHelp:e(`board:shortcuts.shortcutHelp`),openSession:e(`board:shortcuts.openSession`),sessionTree:e(`board:shortcuts.sessionTree`),sideChat:e(`board:shortcuts.sideChat`),cycleFocusRegion:e(`board:shortcuts.cycleFocusRegion`)},n={boardNext:e(`config:shortcuts.boardNext`),boardPrevious:e(`config:shortcuts.boardPrevious`),boardApprove:e(`config:shortcuts.boardApprove`),boardDeny:e(`config:shortcuts.boardDeny`),boardRetry:e(`config:shortcuts.boardRetry`),boardTriage:e(`config:shortcuts.boardTriage`),boardToggleGrouping:e(`config:shortcuts.boardToggleGrouping`)},i={sidebarMove:e(`board:shortcuts.sidebarMove`),sidebarOpen:e(`board:shortcuts.sidebarOpen`),boardMove:e(`board:shortcuts.boardMove`),boardOpen:e(`board:shortcuts.boardOpen`),boardExitTriage:e(`board:shortcuts.boardExitTriage`),newline:e(`board:shortcuts.newline`),cycleRunMode:e(`board:shortcuts.cycleRunMode`),stopRun:e(`board:shortcuts.stopRun`)};return{actions:t,boardActions:n,groups:{global:{title:e(`board:shortcuts.groupGlobal`),hint:e(`board:shortcuts.globalHint`)},sidebar:{title:e(`board:shortcuts.groupSidebar`),hint:e(`board:shortcuts.sidebarHint`)},board:{title:e(`board:shortcuts.groupBoard`),hint:e(`board:shortcuts.boardHint`)},session:{title:e(`board:shortcuts.groupSession`),hint:e(`board:shortcuts.sessionHint`)}},label:e=>e.kind===`app`?t[e.action]:e.kind===`board`?n[e.action]:i[e.id]}}var h=e(t(),1),g=n();function _({keys:e,className:t}){let{t:n}=r();return e?.length?(0,g.jsx)(`span`,{className:i(`inline-flex min-w-0 flex-wrap items-center gap-1`,t),children:e.map((e,t)=>(0,g.jsxs)(h.Fragment,{children:[t>0&&(0,g.jsx)(`span`,{"aria-hidden":`true`,className:`text-xs text-content-muted`,children:`/`}),(0,g.jsx)(a,{children:e.map(e=>(0,g.jsx)(o,{className:`text-content-secondary`,children:e},e))})]},e.join(`+`)))}):(0,g.jsx)(`span`,{className:i(`text-xs text-content-muted`,t),children:n(`config:shortcuts.disabled`)})}export{m as a,p as i,d as n,f as r,_ as t};
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{t as r}from"./use-i18n-BVRhlQ1v.js";import{t as i}from"./utils-C8uzG5AZ.js";import{n as a,t as o}from"./kbd-CAufZTkl.js";import{t as s}from"./shortcuts-Dsd4mjfP.js";var c=e=>({kind:`app`,action:e}),l=e=>({kind:`board`,action:e}),u=(e,...t)=>({kind:`fixed`,id:e,keys:t}),d=[{id:`global`,entries:[c(`commandPalette`),c(`primaryAction`),c(`toggleSidebar`),c(`agentPanel`),c(`openBoard`),c(`openMore`),c(`openSettings`),c(`jumpToAttention`),c(`previousAgent`),c(`nextAgent`),c(`cycleFocusRegion`),c(`toggleTerminal`),c(`shortcutHelp`),c(`focusComposer`),c(`voiceInput`),c(`openSession`),c(`openComponents`)]},{id:`sidebar`,entries:[u(`sidebarMove`,[`↑`],[`↓`]),u(`sidebarOpen`,[`Enter`])]},{id:`board`,entries:[c(`focusSearch`),l(`boardNext`),l(`boardPrevious`),u(`boardMove`,[`↑`],[`↓`]),u(`boardOpen`,[`Enter`]),l(`boardApprove`),l(`boardDeny`),l(`boardRetry`),l(`boardTriage`),u(`boardExitTriage`,[`Esc`]),l(`boardToggleGrouping`)]},{id:`session`,entries:[c(`toggleInspector`),c(`sessionTree`),c(`sideChat`),c(`sendMessage`),c(`steerMessage`),u(`newline`,[`Shift`,`Enter`]),u(`cycleRunMode`,[`Shift`,`Tab`]),u(`stopRun`,[`Esc`])]}];function f(e){return e.kind===`fixed`?`fixed:${e.id}`:e.action}function p(e,t,n){if(e.kind===`fixed`)return e.keys;let r=s(e.kind===`app`?t[e.action]:n[e.action]);return r?[r.split(` + `)]:null}function m(){let{t:e}=r(),t={commandPalette:e(`config:shortcuts.commandPalette`),primaryAction:e(`config:shortcuts.primaryAction`),focusSearch:e(`board:shortcuts.focusSearch`),toggleSidebar:e(`config:shortcuts.toggleSidebar`),toggleTerminal:e(`config:shortcuts.toggleTerminal`),openSettings:e(`config:shortcuts.openSettings`),focusComposer:e(`config:shortcuts.focusComposer`),sendMessage:e(`board:shortcuts.sendMessage`),voiceInput:e(`config:shortcuts.voiceInput`),openBoard:e(`config:shortcuts.openBoard`),openComponents:e(`config:shortcuts.openComponents`),openMore:e(`config:shortcuts.openMore`),jumpToAttention:e(`config:shortcuts.jumpToAttention`),agentPanel:e(`board:shortcuts.agentPanel`),toggleInspector:e(`board:shortcuts.toggleInspector`),previousAgent:e(`board:shortcuts.previousAgent`),nextAgent:e(`board:shortcuts.nextAgent`),steerMessage:e(`board:shortcuts.steerMessage`),shortcutHelp:e(`board:shortcuts.shortcutHelp`),openSession:e(`board:shortcuts.openSession`),sessionTree:e(`board:shortcuts.sessionTree`),sideChat:e(`board:shortcuts.sideChat`),cycleFocusRegion:e(`board:shortcuts.cycleFocusRegion`)},n={boardNext:e(`config:shortcuts.boardNext`),boardPrevious:e(`config:shortcuts.boardPrevious`),boardApprove:e(`config:shortcuts.boardApprove`),boardDeny:e(`config:shortcuts.boardDeny`),boardRetry:e(`config:shortcuts.boardRetry`),boardTriage:e(`config:shortcuts.boardTriage`),boardToggleGrouping:e(`config:shortcuts.boardToggleGrouping`)},i={sidebarMove:e(`board:shortcuts.sidebarMove`),sidebarOpen:e(`board:shortcuts.sidebarOpen`),boardMove:e(`board:shortcuts.boardMove`),boardOpen:e(`board:shortcuts.boardOpen`),boardExitTriage:e(`board:shortcuts.boardExitTriage`),newline:e(`board:shortcuts.newline`),cycleRunMode:e(`board:shortcuts.cycleRunMode`),stopRun:e(`board:shortcuts.stopRun`)};return{actions:t,boardActions:n,groups:{global:{title:e(`board:shortcuts.groupGlobal`),hint:e(`board:shortcuts.globalHint`)},sidebar:{title:e(`board:shortcuts.groupSidebar`),hint:e(`board:shortcuts.sidebarHint`)},board:{title:e(`board:shortcuts.groupBoard`),hint:e(`board:shortcuts.boardHint`)},session:{title:e(`board:shortcuts.groupSession`),hint:e(`board:shortcuts.sessionHint`)}},label:e=>e.kind===`app`?t[e.action]:e.kind===`board`?n[e.action]:i[e.id]}}var h=e(t(),1),g=n();function _({keys:e,className:t}){let{t:n}=r();return e?.length?(0,g.jsx)(`span`,{className:i(`inline-flex min-w-0 flex-wrap items-center gap-1`,t),children:e.map((e,t)=>(0,g.jsxs)(h.Fragment,{children:[t>0&&(0,g.jsx)(`span`,{"aria-hidden":`true`,className:`text-xs text-content-muted`,children:`/`}),(0,g.jsx)(a,{children:e.map(e=>(0,g.jsx)(o,{className:`text-content-secondary`,children:e},e))})]},e.join(`+`)))}):(0,g.jsx)(`span`,{className:i(`text-xs text-content-muted`,t),children:n(`config:shortcuts.disabled`)})}export{m as a,p as i,d as n,f as r,_ as t};
@@ -1 +1 @@
1
- import{r as e}from"./vendor-react-DwNgTV1j.js";import{t}from"./use-i18n-CaxKosZm.js";import{t as n}from"./download-BCfIiuaL.js";import{t as r}from"./external-link-CEQqPcqc.js";import{t as i}from"./refresh-cw-TbWxTY4K.js";import{t as a}from"./rocket-BgLSjoHY.js";var o=e();function s({update:e,collapsed:s,onOpen:c}){let{t:l}=t(),u=e?.status||{state:`idle`},d=!!(e?.info?.desktop||e?.info?.mobile);if(![`available`,`downloading`,`downloaded`].includes(u.state))return null;let f=u.state===`downloading`,p=u.state===`downloaded`,m=l(p?`navigation:appSidebar.readyToRestart`:f?`navigation:appSidebar.downloading`:d?`navigation:appSidebar.updateAvailable`:`navigation:appSidebar.sourceUpdatesAvailable`),h=f?`${Math.round(u.percent||0)}%`:d&&u.availableVersion?`v${u.availableVersion}`:u.behindBy?l(`navigation:appSidebar.countCommitsBehindBranch`,{branch:u.branch||`main`,count:u.behindBy}):u.availableCommit?u.availableCommit.slice(0,7):l(`navigation:appSidebar.viewUpdateDetails`),g=p?a:f?i:d?n:r;return(0,o.jsxs)(`button`,{type:`button`,className:`flex min-h-11 w-full items-center rounded-sm border border-star-border bg-star-soft text-content transition-colors duration-[var(--d-fast)] hover:bg-surface-hover ${s?`justify-center px-0`:`gap-2.5 px-3 text-left`}`,title:`${m} · ${h}`,"aria-label":`${m} · ${h}`,onClick:c,children:[(0,o.jsx)(g,{className:`shrink-0 text-accent-fg ${f?`animate-spin`:``}`,size:16}),!s&&(0,o.jsxs)(`span`,{className:`min-w-0`,children:[(0,o.jsx)(`strong`,{className:`block truncate text-xs font-medium`,children:m}),(0,o.jsx)(`small`,{className:`mt-0.5 block truncate text-xs text-content-muted tabular-nums`,children:h})]})]})}export{s as default};
1
+ import{r as e}from"./vendor-react-DwNgTV1j.js";import{t}from"./use-i18n-BVRhlQ1v.js";import{t as n}from"./download-BCfIiuaL.js";import{t as r}from"./external-link-CEQqPcqc.js";import{t as i}from"./refresh-cw-TbWxTY4K.js";import{t as a}from"./rocket-BgLSjoHY.js";var o=e();function s({update:e,collapsed:s,onOpen:c}){let{t:l}=t(),u=e?.status||{state:`idle`},d=!!(e?.info?.desktop||e?.info?.mobile);if(![`available`,`downloading`,`downloaded`].includes(u.state))return null;let f=u.state===`downloading`,p=u.state===`downloaded`,m=l(p?`navigation:appSidebar.readyToRestart`:f?`navigation:appSidebar.downloading`:d?`navigation:appSidebar.updateAvailable`:`navigation:appSidebar.sourceUpdatesAvailable`),h=f?`${Math.round(u.percent||0)}%`:d&&u.availableVersion?`v${u.availableVersion}`:u.behindBy?l(`navigation:appSidebar.countCommitsBehindBranch`,{branch:u.branch||`main`,count:u.behindBy}):u.availableCommit?u.availableCommit.slice(0,7):l(`navigation:appSidebar.viewUpdateDetails`),g=p?a:f?i:d?n:r;return(0,o.jsxs)(`button`,{type:`button`,className:`flex min-h-11 w-full items-center rounded-sm border border-star-border bg-star-soft text-content transition-colors duration-[var(--d-fast)] hover:bg-surface-hover ${s?`justify-center px-0`:`gap-2.5 px-3 text-left`}`,title:`${m} · ${h}`,"aria-label":`${m} · ${h}`,onClick:c,children:[(0,o.jsx)(g,{className:`shrink-0 text-accent-fg ${f?`animate-spin`:``}`,size:16}),!s&&(0,o.jsxs)(`span`,{className:`min-w-0`,children:[(0,o.jsx)(`strong`,{className:`block truncate text-xs font-medium`,children:m}),(0,o.jsx)(`small`,{className:`mt-0.5 block truncate text-xs text-content-muted tabular-nums`,children:h})]})]})}export{s as default};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{t as r}from"./use-i18n-CaxKosZm.js";import{t as i}from"./api-MVoWVwmh.js";import{t as a}from"./file-code-corner-BnE1ljT0.js";import{t as o}from"./image-BY_c3FYU.js";import{t as s}from"./package-BOmkLaKS.js";import{t as c}from"./plus-fQbSqB1n.js";import{t as l}from"./save-CHBB52P8.js";import{t as u}from"./sparkles-S_eeuqn9.js";import{t as d}from"./trash-2-CNrPOoPR.js";import{t as f}from"./wrench-6pg6_bqI.js";import{t as p}from"./more-pages-D_PnxLN0.js";import{t as ee}from"./checkbox-BrEHgFV0.js";import{t as m}from"./button-CCcCN8tE.js";import{s as h}from"./shortcuts-BmJZiLby.js";import{n as g,t as _}from"./PageState-Cz6vFMXv.js";import{a as v,i as y,n as b,o as x,r as S,s as te,t as ne}from"./FeaturePage-IWVjXcVp.js";import{c as C,s as w}from"./app-primitives-Drz_SjnR.js";var T=e(t(),1),E=n(),D=[`all`,`global`,`project`,`design`,`code`,`docs`,`privileged`],O=`grid grid-cols-[88px_minmax(0,1fr)] gap-x-3 gap-y-1.5 text-xs [&_dd]:min-w-0 [&_dd]:[overflow-wrap:anywhere] [&_dd]:text-content-soft [&_dt]:text-content-muted [&>div]:contents`;function k(e,t=``){return t?`${e}${e.includes(`?`)?`&`:`?`}sessionId=${encodeURIComponent(t)}`:e}function A(e,t){return t(e===`global`?`skills:skillsPage.global`:e===`project`?`skills:skillsPage.project`:e===`design`?`skills:skillsPage.design`:e===`code`?`skills:skillsPage.code`:e===`docs`?`skills:skillsPage.documents`:e===`privileged`?`skills:skillsPage.highPrivilege`:`skills:skillsPage.all`)}function j(e){let t=`${e?.name||``} ${e?.description||``}`.toLowerCase();return/image|visual|design|figma|svg|图片|视觉|设计/.test(t)?o:/doc|pdf|文档|说明/.test(t)?a:/install|package|market|安装|包/.test(t)?s:/code|test|plugin|skill|代码|测试|插件|技能/.test(t)?f:u}function re(e,t){if(t===`all`)return!0;if(t===`global`)return e.sourceInfo?.scope!==`project`;if(t===`project`)return e.sourceInfo?.scope===`project`;let n=`${e.name} ${e.description} ${(e.allowedTools||[]).join(` `)}`.toLowerCase();return t===`design`?/image|visual|design|figma|svg|图片|视觉|设计/.test(n):t===`code`?/code|test|plugin|代码|测试|插件/.test(n):t===`docs`?/doc|pdf|文档|说明/.test(n):t!==`privileged`||(e.allowedTools||[]).some(e=>[`bash`,`write`,`edit`].includes(e))}function M({notify:e,activeSessionId:t=``,onBack:n,requestText:a,requestConfirm:o}){let{t:u}=r(),f=h(`focusSearch`),[M,ie]=(0,T.useState)(``),[N,P]=(0,T.useState)(null),[F,I]=(0,T.useState)(``),[L,R]=(0,T.useState)(`all`),[z,B]=(0,T.useState)(!1),[V,H]=(0,T.useState)(!0),[U,W]=(0,T.useState)(``),G=(0,T.useCallback)(async()=>{W(``);try{let e=await i(k(`/api/skills`,t));return P(e),I(t=>e.skills.some(e=>e.id===t)?t:``),e}catch(e){return W(e instanceof Error?e.message:String(e)),null}finally{H(!1)}},[t]);(0,T.useEffect)(()=>{G()},[G]);let K=(0,T.useCallback)(async()=>{let n=await a?.({title:u(`skills:skillsPage.importGlobalSkill`),message:u(`skills:skillsPage.globalSkillSourceHelp`),inputLabel:u(`skills:skillsPage.skillSource`),placeholder:`E:\\path\\to\\skill, npm:@scope/package, or https://github.com/...`,maxLength:2e3,confirmLabel:u(`skills:skillsPage.continue`)});if(n?.trim()&&await o?.({title:u(`skills:skillsPage.importGlobalSkill`),message:u(`skills:skillsPage.skillsProvideInstructionsToTheAgentAndMayIncludeExecutableScriptsConfirmThatYouTrustTheSource`),confirmLabel:u(`skills:skillsPage.import`),tone:`danger`})!==!1){B(!0),W(``);try{let r=await i(k(`/api/skills/install`,t),{method:`POST`,body:JSON.stringify({source:n})});P(r),I(r.installed?.[0]?.id||``),e(u(`skills:skillsPage.skillInstalledAndLoadedIntoTheAgentRuntime`),`success`)}catch(t){let n=t instanceof Error?t.message:String(t);W(n),e(n,`error`)}finally{B(!1)}}},[t,e,o,a,u]),q=N?.skills||[],J=M.trim().toLowerCase(),Y=q.filter(e=>re(e,L)&&`${e.name} ${e.description}`.toLowerCase().includes(J)),ae=q.filter(e=>e.sourceInfo?.scope!==`project`),oe=q.filter(e=>e.sourceInfo?.scope===`project`),se=Y.filter(e=>e.sourceInfo?.scope!==`project`),ce=Y.filter(e=>e.sourceInfo?.scope===`project`),X=(N?.packages||[]).map(e=>({source:e.source,description:e.scope===`project`?u(`skills:skillsPage.projectScopedConfiguration`):u(`skills:skillsPage.userScopedConfiguration`),status:e.installed?u(`skills:skillsPage.locallyReady`):u(`skills:skillsPage.notMaterialized`)})).filter(e=>`${e.source} ${e.description}`.toLowerCase().includes(J)),Z=async(e,n)=>{if(e){B(!0),W(``);try{let r=await i(k(`/api/skills/${encodeURIComponent(e.id)}`,t),{method:`PATCH`,body:JSON.stringify(n)});P(e=>{if(!e)return e;let t=e.skills.map(e=>e.id===r.id?r:e);return{...e,skills:t,counts:{...e.counts,enabled:t.filter(e=>e.enabled).length,modelInvocable:t.filter(e=>e.enabled&&e.modelInvocationEnabled).length}}})}catch(e){W(e instanceof Error?e.message:String(e))}finally{B(!1)}}},le=async()=>{B(!0),W(``);try{P(await i(k(`/api/skills/reload`,t),{method:`POST`,body:`{}`})),e(u(`skills:skillsPage.skillSettingsSavedAndReloaded`),`success`)}catch(e){W(e instanceof Error?e.message:String(e))}finally{B(!1)}},ue=async n=>{if(n.removable&&await o?.({title:u(`skills:skillsPage.uninstallSkill`),message:u(`skills:skillsPage.thisRemovesTheSkillDirectoryInstalledByPisperItDoesNotUninstallTheOriginalNpmOrGitPackage`),confirmLabel:u(`skills:skillsPage.uninstall`),tone:`danger`})!==!1){B(!0),W(``);try{await i(k(`/api/skills/${encodeURIComponent(n.id)}`,t),{method:`DELETE`}),await G(),I(``),e(u(`skills:skillsPage.skillUninstalled`),`success`)}catch(t){let n=t instanceof Error?t.message:String(t);W(n),e(n,`error`)}finally{B(!1)}}},de=e=>(0,E.jsxs)(`div`,{className:`skill-detail grid gap-3`,children:[(0,E.jsx)(`p`,{className:`text-sm leading-relaxed whitespace-pre-line text-content-soft`,children:e.description||u(`skills:skillsPage.addGlobalOrProjectSkill`)}),(0,E.jsx)(`dl`,{className:O,children:[[u(`skills:skillsPage.triggerMode`),e.modelInvocationEnabled?u(`skills:skillsPage.automaticManual`):u(`skills:skillsPage.manualOnly`),!1],[u(`skills:skillsPage.permissions`),e.allowedTools?.length?e.allowedTools.join(`, `):u(`skills:skillsPage.usesChatToolPermissions`),!!e.allowedTools?.length],[u(`skills:skillsPage.scope`),e.sourceInfo?.scope===`project`?u(`skills:skillsPage.project`):u(`skills:skillsPage.global`),!1],[u(`skills:skillsPage.version`),e.version||`latest`,!0],[u(`skills:skillsPage.source`),e.source||`—`,!0]].map(([e,t,n])=>(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`dt`,{children:e}),(0,E.jsx)(`dd`,{className:n?`font-mono`:void 0,children:t})]},e))}),(0,E.jsxs)(`fieldset`,{className:`grid min-w-0 gap-0.5`,children:[(0,E.jsx)(`legend`,{className:`mb-1 text-xs font-medium text-content-muted`,children:u(`skills:skillsPage.triggerConditions`)}),[[u(`skills:skillsPage.allowAutomaticModelInvocation`),!!e.modelInvocationEnabled,!1,t=>void Z(e,{modelInvocationEnabled:t})],[u(`skills:skillsPage.supportManualSkillCommand`),!!e.command,!0],[u(`skills:skillsPage.projectScopedSkill`),e.sourceInfo?.scope===`project`,!0],[u(`skills:skillsPage.declaresRequiredTools`),!!e.allowedTools?.length,!0]].map(([e,t,n,r])=>(0,E.jsxs)(`label`,{className:`check-row flex min-h-8 items-center gap-2.5 text-sm text-content has-disabled:text-content-muted max-[650px]:min-h-11`,children:[(0,E.jsx)(ee,{checked:t,disabled:z||n,onCheckedChange:e=>r?.(e===!0)}),(0,E.jsx)(`span`,{children:e})]},e))]}),(0,E.jsx)(`div`,{className:`flex justify-end`,children:e.removable?(0,E.jsxs)(m,{variant:`ghost`,className:`text-danger hover:bg-danger-soft hover:text-danger max-[650px]:h-11`,disabled:z,onClick:()=>void ue(e),children:[(0,E.jsx)(d,{}),u(`skills:skillsPage.uninstallSkill`)]}):(0,E.jsxs)(m,{variant:`secondary`,className:`max-[650px]:h-11`,loading:z,disabled:z,onClick:le,children:[(0,E.jsx)(l,{}),u(`skills:skillsPage.saveSettings`)]})})]}),Q=(e,t,n,r,i=``)=>(0,E.jsx)(x,{className:`skill-scope`,title:e,count:t.length,description:i&&(0,E.jsx)(`span`,{className:`font-mono`,children:i}),children:t.length?(0,E.jsx)(b,{children:t.map(e=>{let t=j(e);return(0,E.jsx)(y,{className:`skill-row`,"data-skill-row":e.id,icon:(0,E.jsx)(t,{}),name:(0,E.jsx)(`span`,{className:`font-mono`,children:e.name}),description:e.description,actions:(0,E.jsx)(w,{value:e.enabled,disabled:z,ariaLabel:u(`skills:skillsPage.toggleSkillName`,{name:e.name}),onChange:t=>void Z(e,{enabled:t})}),expanded:F===e.id,onExpandedChange:t=>I(t?e.id:``),toggleLabel:u(`skills:skillsPage.toggleSkillDetails`,{name:e.name}),detail:de(e)},e.id)})}):(0,E.jsx)(`p`,{className:`skills-empty-copy border-t border-stroke py-3 text-xs leading-normal text-content-muted`,children:n.length?u(`skills:skillsPage.noSkillsMatchTheCurrentFilter`):r})}),$=u(`navigation:navigation.skills`);return(0,E.jsx)(S,{title:$,description:u(`skills:skillsPage.lede`),back:n&&{label:u(`navigation:sidebar.features`),ariaLabel:u(`navigation:shell.backToFeaturesLabel`),onBack:n},toolbar:(0,E.jsx)(te,{search:(0,E.jsx)(v,{id:p,value:M,onValueChange:ie,placeholder:u(`navigation:pageHeader.searchPage`,{page:$}),shortcut:f,clearLabel:u(`navigation:more.clearSearch`)}),actions:(0,E.jsxs)(m,{type:`button`,className:`h-9`,"data-skills-install":!0,disabled:z||!N,onClick:()=>void K(),children:[(0,E.jsx)(c,{}),u(`navigation:pageHeader.installSkill`)]}),filters:(0,E.jsx)(C,{options:D.map(e=>A(e,u)),value:A(L,u),onChange:e=>R(D.find(t=>A(t,u)===e)||`all`)})}),children:V&&!N?(0,E.jsx)(g,{kind:`loading`,title:u(`skills:skillsPage.loadingSkills`),description:u(`skills:skillsPage.scanningSkillDirectoriesAndConfiguredPackages`)}):N?(0,E.jsxs)(E.Fragment,{children:[U&&(0,E.jsx)(ne,{children:U}),L!==`project`&&Q(u(`skills:skillsPage.globalSkills`),se,ae,u(`skills:skillsPage.noGlobalSkills`),N.locations?.global||`~/.pisper/agent/skills`),L!==`global`&&Q(u(`skills:skillsPage.projectSkills`),ce,oe,u(`skills:skillsPage.noProjectSkills`),N.locations?.project||(N.cwd?`${N.cwd.replace(/[\\/]$/,``)}/.pisper/skills`:``)),(0,E.jsx)(x,{className:`skill-packages`,title:u(`skills:skillsPage.configuredSkillPackages`),count:X.length,children:X.length?(0,E.jsx)(b,{children:X.map(e=>(0,E.jsx)(y,{className:`market-row`,icon:(0,E.jsx)(s,{}),name:(0,E.jsx)(`span`,{className:`font-mono`,title:e.source,children:e.source}),description:e.description,status:e.status},e.source))}):(0,E.jsx)(_,{compact:!0,icon:s,title:u(`skills:skillsPage.noSkillPackagesAreConfiguredYetAfterYouInstallASkillItsSourceWillAppearHere`)})})]}):(0,E.jsx)(g,{kind:`error`,title:u(`skills:skillsPage.loadFailed`),description:U,action:(0,E.jsx)(m,{variant:`secondary`,className:`max-[650px]:h-11`,loading:V,disabled:V,onClick:()=>{H(!0),G()},children:u(`common:pageTemplate.retry`)})})})}export{M as SkillsPage};
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{t as r}from"./use-i18n-BVRhlQ1v.js";import{t as i}from"./api-AeFmYDtL.js";import{t as a}from"./file-code-corner-BnE1ljT0.js";import{t as o}from"./image-BY_c3FYU.js";import{t as s}from"./package-BOmkLaKS.js";import{t as c}from"./plus-fQbSqB1n.js";import{t as l}from"./save-CHBB52P8.js";import{t as u}from"./sparkles-S_eeuqn9.js";import{t as d}from"./trash-2-CNrPOoPR.js";import{t as f}from"./wrench-6pg6_bqI.js";import{t as p}from"./more-pages-D_PnxLN0.js";import{t as ee}from"./checkbox-BrEHgFV0.js";import{t as m}from"./button-CCcCN8tE.js";import{s as h}from"./shortcuts-Dsd4mjfP.js";import{n as g,t as _}from"./PageState-Cz6vFMXv.js";import{a as v,i as y,n as b,o as x,r as S,s as te,t as ne}from"./FeaturePage-bqByIxYg.js";import{c as C,s as w}from"./app-primitives-Drz_SjnR.js";var T=e(t(),1),E=n(),D=[`all`,`global`,`project`,`design`,`code`,`docs`,`privileged`],O=`grid grid-cols-[88px_minmax(0,1fr)] gap-x-3 gap-y-1.5 text-xs [&_dd]:min-w-0 [&_dd]:[overflow-wrap:anywhere] [&_dd]:text-content-soft [&_dt]:text-content-muted [&>div]:contents`;function k(e,t=``){return t?`${e}${e.includes(`?`)?`&`:`?`}sessionId=${encodeURIComponent(t)}`:e}function A(e,t){return t(e===`global`?`skills:skillsPage.global`:e===`project`?`skills:skillsPage.project`:e===`design`?`skills:skillsPage.design`:e===`code`?`skills:skillsPage.code`:e===`docs`?`skills:skillsPage.documents`:e===`privileged`?`skills:skillsPage.highPrivilege`:`skills:skillsPage.all`)}function j(e){let t=`${e?.name||``} ${e?.description||``}`.toLowerCase();return/image|visual|design|figma|svg|图片|视觉|设计/.test(t)?o:/doc|pdf|文档|说明/.test(t)?a:/install|package|market|安装|包/.test(t)?s:/code|test|plugin|skill|代码|测试|插件|技能/.test(t)?f:u}function re(e,t){if(t===`all`)return!0;if(t===`global`)return e.sourceInfo?.scope!==`project`;if(t===`project`)return e.sourceInfo?.scope===`project`;let n=`${e.name} ${e.description} ${(e.allowedTools||[]).join(` `)}`.toLowerCase();return t===`design`?/image|visual|design|figma|svg|图片|视觉|设计/.test(n):t===`code`?/code|test|plugin|代码|测试|插件/.test(n):t===`docs`?/doc|pdf|文档|说明/.test(n):t!==`privileged`||(e.allowedTools||[]).some(e=>[`bash`,`write`,`edit`].includes(e))}function M({notify:e,activeSessionId:t=``,onBack:n,requestText:a,requestConfirm:o}){let{t:u}=r(),f=h(`focusSearch`),[M,ie]=(0,T.useState)(``),[N,P]=(0,T.useState)(null),[F,I]=(0,T.useState)(``),[L,R]=(0,T.useState)(`all`),[z,B]=(0,T.useState)(!1),[V,H]=(0,T.useState)(!0),[U,W]=(0,T.useState)(``),G=(0,T.useCallback)(async()=>{W(``);try{let e=await i(k(`/api/skills`,t));return P(e),I(t=>e.skills.some(e=>e.id===t)?t:``),e}catch(e){return W(e instanceof Error?e.message:String(e)),null}finally{H(!1)}},[t]);(0,T.useEffect)(()=>{G()},[G]);let K=(0,T.useCallback)(async()=>{let n=await a?.({title:u(`skills:skillsPage.importGlobalSkill`),message:u(`skills:skillsPage.globalSkillSourceHelp`),inputLabel:u(`skills:skillsPage.skillSource`),placeholder:`E:\\path\\to\\skill, npm:@scope/package, or https://github.com/...`,maxLength:2e3,confirmLabel:u(`skills:skillsPage.continue`)});if(n?.trim()&&await o?.({title:u(`skills:skillsPage.importGlobalSkill`),message:u(`skills:skillsPage.skillsProvideInstructionsToTheAgentAndMayIncludeExecutableScriptsConfirmThatYouTrustTheSource`),confirmLabel:u(`skills:skillsPage.import`),tone:`danger`})!==!1){B(!0),W(``);try{let r=await i(k(`/api/skills/install`,t),{method:`POST`,body:JSON.stringify({source:n})});P(r),I(r.installed?.[0]?.id||``),e(u(`skills:skillsPage.skillInstalledAndLoadedIntoTheAgentRuntime`),`success`)}catch(t){let n=t instanceof Error?t.message:String(t);W(n),e(n,`error`)}finally{B(!1)}}},[t,e,o,a,u]),q=N?.skills||[],J=M.trim().toLowerCase(),Y=q.filter(e=>re(e,L)&&`${e.name} ${e.description}`.toLowerCase().includes(J)),ae=q.filter(e=>e.sourceInfo?.scope!==`project`),oe=q.filter(e=>e.sourceInfo?.scope===`project`),se=Y.filter(e=>e.sourceInfo?.scope!==`project`),ce=Y.filter(e=>e.sourceInfo?.scope===`project`),X=(N?.packages||[]).map(e=>({source:e.source,description:e.scope===`project`?u(`skills:skillsPage.projectScopedConfiguration`):u(`skills:skillsPage.userScopedConfiguration`),status:e.installed?u(`skills:skillsPage.locallyReady`):u(`skills:skillsPage.notMaterialized`)})).filter(e=>`${e.source} ${e.description}`.toLowerCase().includes(J)),Z=async(e,n)=>{if(e){B(!0),W(``);try{let r=await i(k(`/api/skills/${encodeURIComponent(e.id)}`,t),{method:`PATCH`,body:JSON.stringify(n)});P(e=>{if(!e)return e;let t=e.skills.map(e=>e.id===r.id?r:e);return{...e,skills:t,counts:{...e.counts,enabled:t.filter(e=>e.enabled).length,modelInvocable:t.filter(e=>e.enabled&&e.modelInvocationEnabled).length}}})}catch(e){W(e instanceof Error?e.message:String(e))}finally{B(!1)}}},le=async()=>{B(!0),W(``);try{P(await i(k(`/api/skills/reload`,t),{method:`POST`,body:`{}`})),e(u(`skills:skillsPage.skillSettingsSavedAndReloaded`),`success`)}catch(e){W(e instanceof Error?e.message:String(e))}finally{B(!1)}},ue=async n=>{if(n.removable&&await o?.({title:u(`skills:skillsPage.uninstallSkill`),message:u(`skills:skillsPage.thisRemovesTheSkillDirectoryInstalledByPisperItDoesNotUninstallTheOriginalNpmOrGitPackage`),confirmLabel:u(`skills:skillsPage.uninstall`),tone:`danger`})!==!1){B(!0),W(``);try{await i(k(`/api/skills/${encodeURIComponent(n.id)}`,t),{method:`DELETE`}),await G(),I(``),e(u(`skills:skillsPage.skillUninstalled`),`success`)}catch(t){let n=t instanceof Error?t.message:String(t);W(n),e(n,`error`)}finally{B(!1)}}},de=e=>(0,E.jsxs)(`div`,{className:`skill-detail grid gap-3`,children:[(0,E.jsx)(`p`,{className:`text-sm leading-relaxed whitespace-pre-line text-content-soft`,children:e.description||u(`skills:skillsPage.addGlobalOrProjectSkill`)}),(0,E.jsx)(`dl`,{className:O,children:[[u(`skills:skillsPage.triggerMode`),e.modelInvocationEnabled?u(`skills:skillsPage.automaticManual`):u(`skills:skillsPage.manualOnly`),!1],[u(`skills:skillsPage.permissions`),e.allowedTools?.length?e.allowedTools.join(`, `):u(`skills:skillsPage.usesChatToolPermissions`),!!e.allowedTools?.length],[u(`skills:skillsPage.scope`),e.sourceInfo?.scope===`project`?u(`skills:skillsPage.project`):u(`skills:skillsPage.global`),!1],[u(`skills:skillsPage.version`),e.version||`latest`,!0],[u(`skills:skillsPage.source`),e.source||`—`,!0]].map(([e,t,n])=>(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`dt`,{children:e}),(0,E.jsx)(`dd`,{className:n?`font-mono`:void 0,children:t})]},e))}),(0,E.jsxs)(`fieldset`,{className:`grid min-w-0 gap-0.5`,children:[(0,E.jsx)(`legend`,{className:`mb-1 text-xs font-medium text-content-muted`,children:u(`skills:skillsPage.triggerConditions`)}),[[u(`skills:skillsPage.allowAutomaticModelInvocation`),!!e.modelInvocationEnabled,!1,t=>void Z(e,{modelInvocationEnabled:t})],[u(`skills:skillsPage.supportManualSkillCommand`),!!e.command,!0],[u(`skills:skillsPage.projectScopedSkill`),e.sourceInfo?.scope===`project`,!0],[u(`skills:skillsPage.declaresRequiredTools`),!!e.allowedTools?.length,!0]].map(([e,t,n,r])=>(0,E.jsxs)(`label`,{className:`check-row flex min-h-8 items-center gap-2.5 text-sm text-content has-disabled:text-content-muted max-[650px]:min-h-11`,children:[(0,E.jsx)(ee,{checked:t,disabled:z||n,onCheckedChange:e=>r?.(e===!0)}),(0,E.jsx)(`span`,{children:e})]},e))]}),(0,E.jsx)(`div`,{className:`flex justify-end`,children:e.removable?(0,E.jsxs)(m,{variant:`ghost`,className:`text-danger hover:bg-danger-soft hover:text-danger max-[650px]:h-11`,disabled:z,onClick:()=>void ue(e),children:[(0,E.jsx)(d,{}),u(`skills:skillsPage.uninstallSkill`)]}):(0,E.jsxs)(m,{variant:`secondary`,className:`max-[650px]:h-11`,loading:z,disabled:z,onClick:le,children:[(0,E.jsx)(l,{}),u(`skills:skillsPage.saveSettings`)]})})]}),Q=(e,t,n,r,i=``)=>(0,E.jsx)(x,{className:`skill-scope`,title:e,count:t.length,description:i&&(0,E.jsx)(`span`,{className:`font-mono`,children:i}),children:t.length?(0,E.jsx)(b,{children:t.map(e=>{let t=j(e);return(0,E.jsx)(y,{className:`skill-row`,"data-skill-row":e.id,icon:(0,E.jsx)(t,{}),name:(0,E.jsx)(`span`,{className:`font-mono`,children:e.name}),description:e.description,actions:(0,E.jsx)(w,{value:e.enabled,disabled:z,ariaLabel:u(`skills:skillsPage.toggleSkillName`,{name:e.name}),onChange:t=>void Z(e,{enabled:t})}),expanded:F===e.id,onExpandedChange:t=>I(t?e.id:``),toggleLabel:u(`skills:skillsPage.toggleSkillDetails`,{name:e.name}),detail:de(e)},e.id)})}):(0,E.jsx)(`p`,{className:`skills-empty-copy border-t border-stroke py-3 text-xs leading-normal text-content-muted`,children:n.length?u(`skills:skillsPage.noSkillsMatchTheCurrentFilter`):r})}),$=u(`navigation:navigation.skills`);return(0,E.jsx)(S,{title:$,description:u(`skills:skillsPage.lede`),back:n&&{label:u(`navigation:sidebar.features`),ariaLabel:u(`navigation:shell.backToFeaturesLabel`),onBack:n},toolbar:(0,E.jsx)(te,{search:(0,E.jsx)(v,{id:p,value:M,onValueChange:ie,placeholder:u(`navigation:pageHeader.searchPage`,{page:$}),shortcut:f,clearLabel:u(`navigation:more.clearSearch`)}),actions:(0,E.jsxs)(m,{type:`button`,className:`h-9`,"data-skills-install":!0,disabled:z||!N,onClick:()=>void K(),children:[(0,E.jsx)(c,{}),u(`navigation:pageHeader.installSkill`)]}),filters:(0,E.jsx)(C,{options:D.map(e=>A(e,u)),value:A(L,u),onChange:e=>R(D.find(t=>A(t,u)===e)||`all`)})}),children:V&&!N?(0,E.jsx)(g,{kind:`loading`,title:u(`skills:skillsPage.loadingSkills`),description:u(`skills:skillsPage.scanningSkillDirectoriesAndConfiguredPackages`)}):N?(0,E.jsxs)(E.Fragment,{children:[U&&(0,E.jsx)(ne,{children:U}),L!==`project`&&Q(u(`skills:skillsPage.globalSkills`),se,ae,u(`skills:skillsPage.noGlobalSkills`),N.locations?.global||`~/.pisper/agent/skills`),L!==`global`&&Q(u(`skills:skillsPage.projectSkills`),ce,oe,u(`skills:skillsPage.noProjectSkills`),N.locations?.project||(N.cwd?`${N.cwd.replace(/[\\/]$/,``)}/.pisper/skills`:``)),(0,E.jsx)(x,{className:`skill-packages`,title:u(`skills:skillsPage.configuredSkillPackages`),count:X.length,children:X.length?(0,E.jsx)(b,{children:X.map(e=>(0,E.jsx)(y,{className:`market-row`,icon:(0,E.jsx)(s,{}),name:(0,E.jsx)(`span`,{className:`font-mono`,title:e.source,children:e.source}),description:e.description,status:e.status},e.source))}):(0,E.jsx)(_,{compact:!0,icon:s,title:u(`skills:skillsPage.noSkillPackagesAreConfiguredYetAfterYouInstallASkillItsSourceWillAppearHere`)})})]}):(0,E.jsx)(g,{kind:`error`,title:u(`skills:skillsPage.loadFailed`),description:U,action:(0,E.jsx)(m,{variant:`secondary`,className:`max-[650px]:h-11`,loading:V,disabled:V,onClick:()=>{H(!0),G()},children:u(`common:pageTemplate.retry`)})})})}export{M as SkillsPage};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{t as r}from"./use-i18n-CaxKosZm.js";import{t as i}from"./chevron-right-C3t2Rckj.js";import{t as a}from"./square-terminal-BVG6cUT1.js";import{t as o}from"./square-bHHVTT3G.js";import{t as s}from"./checkbox-BrEHgFV0.js";import{n as c,t as l}from"./button-CCcCN8tE.js";import{n as u}from"./PageState-Cz6vFMXv.js";import{t as d}from"./AppSelect-DQYKUW5E.js";import{n as f,r as p}from"./terminal-context-aIsIJPn8.js";var m=e(t(),1),h=n();function g({record:e,follow:t,initialTop:n,onFollow:i,onScroll:a}){let{t:o}=r(),c=(0,m.useRef)(null),l=(0,m.useRef)(n);return(0,m.useLayoutEffect)(()=>{c.current&&(c.current.scrollTop=l.current)},[]),(0,m.useLayoutEffect)(()=>{t&&c.current&&(c.current.scrollTop=c.current.scrollHeight)},[e.output,t]),(0,h.jsxs)(`div`,{className:`border-t border-stroke-soft bg-code px-3 py-2.5`,children:[(0,h.jsxs)(`label`,{className:`mb-2 flex min-h-6 cursor-pointer items-center gap-2 text-xs text-content-muted pointer-coarse:min-h-11`,children:[(0,h.jsx)(s,{checked:t,onCheckedChange:e=>i(e===!0)}),o(`terminal:workspace.follow`)]}),e.truncated&&(0,h.jsx)(`p`,{className:`mb-2 text-xs text-content-muted`,children:o(`terminal:workspace.truncated`)}),(0,h.jsx)(`pre`,{ref:c,tabIndex:0,onWheel:e=>{e.deltaY<0&&i(!1)},onScroll:e=>{let t=e.currentTarget;t.scrollTop+t.clientHeight<t.scrollHeight-4&&i(!1),a(t.scrollTop)},className:`max-h-80 overflow-auto whitespace-pre-wrap break-all font-mono text-xs leading-relaxed text-content-soft focus-visible:-outline-offset-2`,children:e.output||o(`terminal:workspace.noOutput`)})]})}function _({sessionId:e,onOpenTerminal:t,view:n,onViewChange:s}){let{t:_}=r(),v=f(),y=p(e),b=n.filter||`all`,x=new Set(n.expandedProcesses),[S,C]=(0,m.useState)(``);if(!v)return(0,h.jsx)(u,{kind:`empty`,title:_(`terminal:workspace.unavailable`),description:_(`terminal:workspace.nativeOnly`)});let w={starting:_(`terminal:workspace.starting`),running:_(`terminal:workspace.running`),stopping:_(`terminal:workspace.stopping`),exited:_(`terminal:workspace.exited`),error:_(`terminal:workspace.error`)},T=y.filter(e=>b===`all`||e.status===b),E=`max-[650px]:size-11`;return(0,h.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col`,children:[(0,h.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2 border-b border-stroke-soft px-3 py-2`,children:[(0,h.jsx)(`span`,{className:`min-w-0 flex-1 text-xs text-content-muted`,children:_(`terminal:workspace.ownedProcesses`)}),(0,h.jsxs)(d,{"aria-label":_(`terminal:workspace.filter`),value:b,onChange:e=>s({filter:e.target.value}),className:`w-auto`,children:[(0,h.jsx)(`option`,{value:`all`,children:_(`terminal:workspace.all`)}),Object.entries(w).map(([e,t])=>(0,h.jsx)(`option`,{value:e,children:t},e))]})]}),S&&(0,h.jsx)(`p`,{role:`alert`,className:`p-3 text-sm text-danger`,children:S}),(0,h.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:T.length?T.map(e=>(0,h.jsxs)(`article`,{className:`border-b border-stroke-soft`,children:[(0,h.jsxs)(`div`,{className:`flex min-h-11 min-w-0 items-center gap-2 py-1 pr-1.5 pl-1.5 ${x.has(e.id)?`bg-surface-subtle`:``}`,children:[(0,h.jsx)(l,{variant:`ghost`,size:`icon`,className:E,"aria-expanded":x.has(e.id),"aria-label":_(`terminal:workspace.logs`),onClick:()=>s({expandedProcesses:x.has(e.id)?n.expandedProcesses.filter(t=>t!==e.id):[...n.expandedProcesses,e.id]}),children:(0,h.jsx)(i,{className:`text-content-muted transition-transform duration-(--d-fast) ${x.has(e.id)?`rotate-90`:``}`})}),e.status===`running`||e.status===`starting`?(0,h.jsx)(c,{className:`size-3.5`}):(0,h.jsx)(`span`,{"aria-hidden":`true`,className:`size-2 shrink-0 rounded-[2px] ${e.status===`error`?`bg-danger`:`bg-content-faint`}`}),(0,h.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,h.jsx)(`strong`,{className:`block truncate font-mono text-sm font-medium`,children:e.profileId}),(0,h.jsx)(`span`,{className:`block truncate font-mono text-xs text-content-muted`,title:e.cwd,children:e.cwd})]}),(0,h.jsx)(`span`,{className:`shrink-0 text-xs ${e.status===`error`?`text-danger`:`text-content-muted`}`,children:w[e.status]||_(`terminal:workspace.unknown`)}),(0,h.jsx)(l,{variant:`ghost`,size:`icon`,className:E,"aria-label":_(`terminal:workspace.open`),onClick:()=>t(e.id),children:(0,h.jsx)(a,{})}),e.status!==`exited`&&(0,h.jsx)(l,{variant:`ghost`,size:`icon`,className:`${E} hover:text-danger`,disabled:e.status===`stopping`,"aria-label":_(`terminal:workspace.stop`),onClick:()=>{C(``),v.registry.stop(e.id).catch(e=>C(String(e)))},children:(0,h.jsx)(o,{className:`size-3.5`})})]}),e.error&&(0,h.jsx)(`p`,{className:`px-3 pb-2 text-xs text-danger`,children:e.error}),x.has(e.id)&&(0,h.jsx)(g,{record:e,follow:n.processFollow[e.id]!==!1,initialTop:n.processScroll[e.id]||0,onFollow:t=>s({processFollow:{...n.processFollow,[e.id]:t}}),onScroll:t=>s({processScroll:{...n.processScroll,[e.id]:t}})})]},e.id)):(0,h.jsx)(u,{kind:`empty`,title:y.length?_(`terminal:workspace.noMatch`):_(`terminal:workspace.noProcesses`)})})]})}export{_ as TaskProcessesPane};
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{t as r}from"./use-i18n-BVRhlQ1v.js";import{t as i}from"./chevron-right-C3t2Rckj.js";import{t as a}from"./square-terminal-BVG6cUT1.js";import{t as o}from"./square-bHHVTT3G.js";import{t as s}from"./checkbox-BrEHgFV0.js";import{n as c,t as l}from"./button-CCcCN8tE.js";import{n as u}from"./PageState-Cz6vFMXv.js";import{t as d}from"./AppSelect-DQYKUW5E.js";import{n as f,r as p}from"./terminal-context-aIsIJPn8.js";var m=e(t(),1),h=n();function g({record:e,follow:t,initialTop:n,onFollow:i,onScroll:a}){let{t:o}=r(),c=(0,m.useRef)(null),l=(0,m.useRef)(n);return(0,m.useLayoutEffect)(()=>{c.current&&(c.current.scrollTop=l.current)},[]),(0,m.useLayoutEffect)(()=>{t&&c.current&&(c.current.scrollTop=c.current.scrollHeight)},[e.output,t]),(0,h.jsxs)(`div`,{className:`border-t border-stroke-soft bg-code px-3 py-2.5`,children:[(0,h.jsxs)(`label`,{className:`mb-2 flex min-h-6 cursor-pointer items-center gap-2 text-xs text-content-muted pointer-coarse:min-h-11`,children:[(0,h.jsx)(s,{checked:t,onCheckedChange:e=>i(e===!0)}),o(`terminal:workspace.follow`)]}),e.truncated&&(0,h.jsx)(`p`,{className:`mb-2 text-xs text-content-muted`,children:o(`terminal:workspace.truncated`)}),(0,h.jsx)(`pre`,{ref:c,tabIndex:0,onWheel:e=>{e.deltaY<0&&i(!1)},onScroll:e=>{let t=e.currentTarget;t.scrollTop+t.clientHeight<t.scrollHeight-4&&i(!1),a(t.scrollTop)},className:`max-h-80 overflow-auto whitespace-pre-wrap break-all font-mono text-xs leading-relaxed text-content-soft focus-visible:-outline-offset-2`,children:e.output||o(`terminal:workspace.noOutput`)})]})}function _({sessionId:e,onOpenTerminal:t,view:n,onViewChange:s}){let{t:_}=r(),v=f(),y=p(e),b=n.filter||`all`,x=new Set(n.expandedProcesses),[S,C]=(0,m.useState)(``);if(!v)return(0,h.jsx)(u,{kind:`empty`,title:_(`terminal:workspace.unavailable`),description:_(`terminal:workspace.nativeOnly`)});let w={starting:_(`terminal:workspace.starting`),running:_(`terminal:workspace.running`),stopping:_(`terminal:workspace.stopping`),exited:_(`terminal:workspace.exited`),error:_(`terminal:workspace.error`)},T=y.filter(e=>b===`all`||e.status===b),E=`max-[650px]:size-11`;return(0,h.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col`,children:[(0,h.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2 border-b border-stroke-soft px-3 py-2`,children:[(0,h.jsx)(`span`,{className:`min-w-0 flex-1 text-xs text-content-muted`,children:_(`terminal:workspace.ownedProcesses`)}),(0,h.jsxs)(d,{"aria-label":_(`terminal:workspace.filter`),value:b,onChange:e=>s({filter:e.target.value}),className:`w-auto`,children:[(0,h.jsx)(`option`,{value:`all`,children:_(`terminal:workspace.all`)}),Object.entries(w).map(([e,t])=>(0,h.jsx)(`option`,{value:e,children:t},e))]})]}),S&&(0,h.jsx)(`p`,{role:`alert`,className:`p-3 text-sm text-danger`,children:S}),(0,h.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:T.length?T.map(e=>(0,h.jsxs)(`article`,{className:`border-b border-stroke-soft`,children:[(0,h.jsxs)(`div`,{className:`flex min-h-11 min-w-0 items-center gap-2 py-1 pr-1.5 pl-1.5 ${x.has(e.id)?`bg-surface-subtle`:``}`,children:[(0,h.jsx)(l,{variant:`ghost`,size:`icon`,className:E,"aria-expanded":x.has(e.id),"aria-label":_(`terminal:workspace.logs`),onClick:()=>s({expandedProcesses:x.has(e.id)?n.expandedProcesses.filter(t=>t!==e.id):[...n.expandedProcesses,e.id]}),children:(0,h.jsx)(i,{className:`text-content-muted transition-transform duration-(--d-fast) ${x.has(e.id)?`rotate-90`:``}`})}),e.status===`running`||e.status===`starting`?(0,h.jsx)(c,{className:`size-3.5`}):(0,h.jsx)(`span`,{"aria-hidden":`true`,className:`size-2 shrink-0 rounded-[2px] ${e.status===`error`?`bg-danger`:`bg-content-faint`}`}),(0,h.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,h.jsx)(`strong`,{className:`block truncate font-mono text-sm font-medium`,children:e.profileId}),(0,h.jsx)(`span`,{className:`block truncate font-mono text-xs text-content-muted`,title:e.cwd,children:e.cwd})]}),(0,h.jsx)(`span`,{className:`shrink-0 text-xs ${e.status===`error`?`text-danger`:`text-content-muted`}`,children:w[e.status]||_(`terminal:workspace.unknown`)}),(0,h.jsx)(l,{variant:`ghost`,size:`icon`,className:E,"aria-label":_(`terminal:workspace.open`),onClick:()=>t(e.id),children:(0,h.jsx)(a,{})}),e.status!==`exited`&&(0,h.jsx)(l,{variant:`ghost`,size:`icon`,className:`${E} hover:text-danger`,disabled:e.status===`stopping`,"aria-label":_(`terminal:workspace.stop`),onClick:()=>{C(``),v.registry.stop(e.id).catch(e=>C(String(e)))},children:(0,h.jsx)(o,{className:`size-3.5`})})]}),e.error&&(0,h.jsx)(`p`,{className:`px-3 pb-2 text-xs text-danger`,children:e.error}),x.has(e.id)&&(0,h.jsx)(g,{record:e,follow:n.processFollow[e.id]!==!1,initialTop:n.processScroll[e.id]||0,onFollow:t=>s({processFollow:{...n.processFollow,[e.id]:t}}),onScroll:t=>s({processScroll:{...n.processScroll,[e.id]:t}})})]},e.id)):(0,h.jsx)(u,{kind:`empty`,title:y.length?_(`terminal:workspace.noMatch`):_(`terminal:workspace.noProcesses`)})})]})}export{_ as TaskProcessesPane};