@bryanhu/codexly 0.23.0 → 0.24.0

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 (222) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +21 -14
  3. package/README.zh-CN.md +26 -19
  4. package/dist/{chunk-HGSPZCBB.js → chunk-MDJUQPOL.js} +16 -4
  5. package/dist/{chunk-PRIMEL2G.js → chunk-YG3QMLCD.js} +432 -43
  6. package/dist/cli.js +7 -7
  7. package/dist/providers/codex/index.js +1 -1
  8. package/dist/server/index.js +2 -2
  9. package/dist/web/.vite/manifest.json +111 -111
  10. package/dist/web/.vite/manifest.json.br +0 -0
  11. package/dist/web/.vite/manifest.json.gz +0 -0
  12. package/dist/web/assets/{agent-settings-panel-Ci9mJOS-.js → agent-settings-panel-STxloEc6.js} +1 -1
  13. package/dist/web/assets/agent-settings-panel-STxloEc6.js.br +0 -0
  14. package/dist/web/assets/agent-settings-panel-STxloEc6.js.gz +0 -0
  15. package/dist/web/assets/{attachments-uWbRsPJj.js → attachments-CSV8KBYa.js} +1 -1
  16. package/dist/web/assets/attachments-CSV8KBYa.js.br +0 -0
  17. package/dist/web/assets/attachments-CSV8KBYa.js.gz +0 -0
  18. package/dist/web/assets/{background-image-picker-qGpdQPQi.js → background-image-picker-JDrclQ6O.js} +1 -1
  19. package/dist/web/assets/background-image-picker-JDrclQ6O.js.br +0 -0
  20. package/dist/web/assets/background-image-picker-JDrclQ6O.js.gz +0 -0
  21. package/dist/web/assets/{bing-wallpaper-queries-uesKD16x.js → bing-wallpaper-queries-BqjgHv5k.js} +1 -1
  22. package/dist/web/assets/bing-wallpaper-queries-BqjgHv5k.js.br +0 -0
  23. package/dist/web/assets/bing-wallpaper-queries-BqjgHv5k.js.gz +0 -0
  24. package/dist/web/assets/{button-group-075rCj_f.js → button-group-mjeW2BTr.js} +1 -1
  25. package/dist/web/assets/button-group-mjeW2BTr.js.br +0 -0
  26. package/dist/web/assets/button-group-mjeW2BTr.js.gz +0 -0
  27. package/dist/web/assets/{code-block-C9eTeWWd.js → code-block-CmzWecTa.js} +1 -1
  28. package/dist/web/assets/code-block-CmzWecTa.js.br +0 -0
  29. package/dist/web/assets/code-block-CmzWecTa.js.gz +0 -0
  30. package/dist/web/assets/{commit-settings-panel-CaMMU0oA.js → commit-settings-panel-BQRIgAaq.js} +1 -1
  31. package/dist/web/assets/commit-settings-panel-BQRIgAaq.js.br +0 -0
  32. package/dist/web/assets/commit-settings-panel-BQRIgAaq.js.gz +0 -0
  33. package/dist/web/assets/{context-menu-Dj3lnor1.js → context-menu-Dfbnk16V.js} +1 -1
  34. package/dist/web/assets/context-menu-Dfbnk16V.js.br +0 -0
  35. package/dist/web/assets/context-menu-Dfbnk16V.js.gz +0 -0
  36. package/dist/web/assets/{file-review-dialog-D8XVZ21M.js → file-review-dialog-Bv3Hor8O.js} +1 -1
  37. package/dist/web/assets/file-review-dialog-Bv3Hor8O.js.br +0 -0
  38. package/dist/web/assets/file-review-dialog-Bv3Hor8O.js.gz +0 -0
  39. package/dist/web/assets/{git-history-panel-D2fKSR66.js → git-history-panel-CofR8yva.js} +1 -1
  40. package/dist/web/assets/git-history-panel-CofR8yva.js.br +0 -0
  41. package/dist/web/assets/git-history-panel-CofR8yva.js.gz +0 -0
  42. package/dist/web/assets/{global-search-dialog-BxT-UjpZ.js → global-search-dialog-m_blFw9z.js} +2 -2
  43. package/dist/web/assets/global-search-dialog-m_blFw9z.js.br +0 -0
  44. package/dist/web/assets/global-search-dialog-m_blFw9z.js.gz +0 -0
  45. package/dist/web/assets/{global-settings-about-DiblprcD.js → global-settings-about-CJkWRRdz.js} +1 -1
  46. package/dist/web/assets/global-settings-about-CJkWRRdz.js.br +0 -0
  47. package/dist/web/assets/global-settings-about-CJkWRRdz.js.gz +0 -0
  48. package/dist/web/assets/{global-settings-fields-D5T5SPXY.js → global-settings-fields-DqWp3WpN.js} +1 -1
  49. package/dist/web/assets/global-settings-fields-DqWp3WpN.js.br +0 -0
  50. package/dist/web/assets/global-settings-fields-DqWp3WpN.js.gz +0 -0
  51. package/dist/web/assets/{global-settings-model-COz331Sr.js → global-settings-model-CqgHQlxF.js} +1 -1
  52. package/dist/web/assets/global-settings-model-CqgHQlxF.js.br +0 -0
  53. package/dist/web/assets/global-settings-model-CqgHQlxF.js.gz +0 -0
  54. package/dist/web/assets/{global-settings-page-DEBGBxSg.js → global-settings-page-BiVZofyf.js} +2 -2
  55. package/dist/web/assets/global-settings-page-BiVZofyf.js.br +0 -0
  56. package/dist/web/assets/global-settings-page-BiVZofyf.js.gz +0 -0
  57. package/dist/web/assets/{global-settings-pets-DwJnj_6N.js → global-settings-pets-DkdiEzFY.js} +1 -1
  58. package/dist/web/assets/global-settings-pets-DkdiEzFY.js.br +0 -0
  59. package/dist/web/assets/global-settings-pets-DkdiEzFY.js.gz +0 -0
  60. package/dist/web/assets/{history-task-timeline-oQRRdMbY.js → history-task-timeline-BrLtwo5_.js} +1 -1
  61. package/dist/web/assets/history-task-timeline-BrLtwo5_.js.br +0 -0
  62. package/dist/web/assets/history-task-timeline-BrLtwo5_.js.gz +0 -0
  63. package/dist/web/assets/{index-DRfXjZ2a.js → index-D9lOU2_n.js} +3 -3
  64. package/dist/web/assets/index-D9lOU2_n.js.br +0 -0
  65. package/dist/web/assets/index-D9lOU2_n.js.gz +0 -0
  66. package/dist/web/assets/{installed-skills-pane-v1IcvRKL.js → installed-skills-pane-BRcMSvrv.js} +1 -1
  67. package/dist/web/assets/installed-skills-pane-BRcMSvrv.js.br +0 -0
  68. package/dist/web/assets/installed-skills-pane-BRcMSvrv.js.gz +0 -0
  69. package/dist/web/assets/{lazy-message-response-B6dT9kbf.js → lazy-message-response-C3PwDwxE.js} +2 -2
  70. package/dist/web/assets/lazy-message-response-C3PwDwxE.js.br +0 -0
  71. package/dist/web/assets/lazy-message-response-C3PwDwxE.js.gz +0 -0
  72. package/dist/web/assets/{mcp-management-pane-DiPUaZAO.js → mcp-management-pane-CIXkOpXu.js} +1 -1
  73. package/dist/web/assets/mcp-management-pane-CIXkOpXu.js.br +0 -0
  74. package/dist/web/assets/mcp-management-pane-CIXkOpXu.js.gz +0 -0
  75. package/dist/web/assets/message-response-AwJefMK2.js +7 -0
  76. package/dist/web/assets/message-response-AwJefMK2.js.br +0 -0
  77. package/dist/web/assets/message-response-AwJefMK2.js.gz +0 -0
  78. package/dist/web/assets/{official-plugins-pane-Cis1hRgm.js → official-plugins-pane-C4i4LhS5.js} +1 -1
  79. package/dist/web/assets/official-plugins-pane-C4i4LhS5.js.br +0 -0
  80. package/dist/web/assets/official-plugins-pane-C4i4LhS5.js.gz +0 -0
  81. package/dist/web/assets/{personalization-settings-panel-BB5nguhA.js → personalization-settings-panel-BVty2pDz.js} +1 -1
  82. package/dist/web/assets/personalization-settings-panel-BVty2pDz.js.br +0 -0
  83. package/dist/web/assets/personalization-settings-panel-BVty2pDz.js.gz +0 -0
  84. package/dist/web/assets/{project-file-popup-page-CAcF7DIa.js → project-file-popup-page-hTRv5v3H.js} +1 -1
  85. package/dist/web/assets/project-file-popup-page-hTRv5v3H.js.br +0 -0
  86. package/dist/web/assets/project-file-popup-page-hTRv5v3H.js.gz +0 -0
  87. package/dist/web/assets/{project-source-dialog-DbOmvJBS.js → project-source-dialog-wuXJolJb.js} +1 -1
  88. package/dist/web/assets/project-source-dialog-wuXJolJb.js.br +0 -0
  89. package/dist/web/assets/project-source-dialog-wuXJolJb.js.gz +0 -0
  90. package/dist/web/assets/{project-source-panel-DGafRUDi.js → project-source-panel-PKAa_dbo.js} +1 -1
  91. package/dist/web/assets/project-source-panel-PKAa_dbo.js.br +0 -0
  92. package/dist/web/assets/project-source-panel-PKAa_dbo.js.gz +0 -0
  93. package/dist/web/assets/{prompt-input-DwT-XwSc.js → prompt-input-BHn4OExn.js} +1 -1
  94. package/dist/web/assets/prompt-input-BHn4OExn.js.br +0 -0
  95. package/dist/web/assets/prompt-input-BHn4OExn.js.gz +0 -0
  96. package/dist/web/assets/{prompt-input-controls-CLasQrSj.js → prompt-input-controls-D4wqb_zQ.js} +1 -1
  97. package/dist/web/assets/prompt-input-controls-D4wqb_zQ.js.br +0 -0
  98. package/dist/web/assets/prompt-input-controls-D4wqb_zQ.js.gz +0 -0
  99. package/dist/web/assets/{scheduled-task-date-time-picker-CnSPVHna.js → scheduled-task-date-time-picker-jo6dkC-Z.js} +1 -1
  100. package/dist/web/assets/scheduled-task-date-time-picker-jo6dkC-Z.js.br +0 -0
  101. package/dist/web/assets/scheduled-task-date-time-picker-jo6dkC-Z.js.gz +0 -0
  102. package/dist/web/assets/{scheduled-task-schedule-BnMdRADi.js → scheduled-task-schedule-DD3Zt60h.js} +1 -1
  103. package/dist/web/assets/scheduled-task-schedule-DD3Zt60h.js.br +0 -0
  104. package/dist/web/assets/{scheduled-task-schedule-BnMdRADi.js.gz → scheduled-task-schedule-DD3Zt60h.js.gz} +0 -0
  105. package/dist/web/assets/{scheduled-tasks-container-CNCzsjiP.js → scheduled-tasks-container-CDsipwUR.js} +2 -2
  106. package/dist/web/assets/scheduled-tasks-container-CDsipwUR.js.br +0 -0
  107. package/dist/web/assets/scheduled-tasks-container-CDsipwUR.js.gz +0 -0
  108. package/dist/web/assets/{settings-personalization-CB_nnUys.js → settings-personalization-BbAIVND-.js} +1 -1
  109. package/dist/web/assets/settings-personalization-BbAIVND-.js.br +0 -0
  110. package/dist/web/assets/settings-personalization-BbAIVND-.js.gz +0 -0
  111. package/dist/web/assets/{sheet-JpH2S7eZ.js → sheet-C6eLtEHx.js} +1 -1
  112. package/dist/web/assets/sheet-C6eLtEHx.js.br +0 -0
  113. package/dist/web/assets/sheet-C6eLtEHx.js.gz +0 -0
  114. package/dist/web/assets/{skills-market-container-BgtnwdI7.js → skills-market-container-DFzLg008.js} +2 -2
  115. package/dist/web/assets/skills-market-container-DFzLg008.js.br +0 -0
  116. package/dist/web/assets/skills-market-container-DFzLg008.js.gz +0 -0
  117. package/dist/web/assets/{task-timeline-store-BN41mX3t.js → task-timeline-store-Cj_Bcaqi.js} +1 -1
  118. package/dist/web/assets/task-timeline-store-Cj_Bcaqi.js.br +0 -0
  119. package/dist/web/assets/task-timeline-store-Cj_Bcaqi.js.gz +0 -0
  120. package/dist/web/assets/{third-party-marketplace-pane-CAI6XIWR.js → third-party-marketplace-pane-CoP9DTWX.js} +1 -1
  121. package/dist/web/assets/third-party-marketplace-pane-CoP9DTWX.js.br +0 -0
  122. package/dist/web/assets/third-party-marketplace-pane-CoP9DTWX.js.gz +0 -0
  123. package/dist/web/assets/workbench-composer-C6Sv8xDL.js +8 -0
  124. package/dist/web/assets/workbench-composer-C6Sv8xDL.js.br +0 -0
  125. package/dist/web/assets/workbench-composer-C6Sv8xDL.js.gz +0 -0
  126. package/dist/web/assets/{workbench-inspector-changes-Bl5nS-_2.js → workbench-inspector-changes-7z5diDTC.js} +1 -1
  127. package/dist/web/assets/workbench-inspector-changes-7z5diDTC.js.br +0 -0
  128. package/dist/web/assets/workbench-inspector-changes-7z5diDTC.js.gz +0 -0
  129. package/dist/web/assets/{workbench-pet-canvas-CnwZR5HG.js → workbench-pet-canvas-dWliFlKE.js} +1 -1
  130. package/dist/web/assets/workbench-pet-canvas-dWliFlKE.js.br +0 -0
  131. package/dist/web/assets/workbench-pet-canvas-dWliFlKE.js.gz +0 -0
  132. package/dist/web/assets/workbench-shell-fA7tfnac.js +3 -0
  133. package/dist/web/assets/workbench-shell-fA7tfnac.js.br +0 -0
  134. package/dist/web/assets/workbench-shell-fA7tfnac.js.gz +0 -0
  135. package/dist/web/index.html +1 -1
  136. package/dist/web/index.html.br +0 -0
  137. package/dist/web/index.html.gz +0 -0
  138. package/package.json +2 -2
  139. package/dist/web/assets/agent-settings-panel-Ci9mJOS-.js.br +0 -0
  140. package/dist/web/assets/agent-settings-panel-Ci9mJOS-.js.gz +0 -0
  141. package/dist/web/assets/attachments-uWbRsPJj.js.br +0 -0
  142. package/dist/web/assets/attachments-uWbRsPJj.js.gz +0 -0
  143. package/dist/web/assets/background-image-picker-qGpdQPQi.js.br +0 -0
  144. package/dist/web/assets/background-image-picker-qGpdQPQi.js.gz +0 -0
  145. package/dist/web/assets/bing-wallpaper-queries-uesKD16x.js.br +0 -0
  146. package/dist/web/assets/bing-wallpaper-queries-uesKD16x.js.gz +0 -0
  147. package/dist/web/assets/button-group-075rCj_f.js.br +0 -0
  148. package/dist/web/assets/button-group-075rCj_f.js.gz +0 -0
  149. package/dist/web/assets/code-block-C9eTeWWd.js.br +0 -0
  150. package/dist/web/assets/code-block-C9eTeWWd.js.gz +0 -0
  151. package/dist/web/assets/commit-settings-panel-CaMMU0oA.js.br +0 -0
  152. package/dist/web/assets/commit-settings-panel-CaMMU0oA.js.gz +0 -0
  153. package/dist/web/assets/context-menu-Dj3lnor1.js.br +0 -0
  154. package/dist/web/assets/context-menu-Dj3lnor1.js.gz +0 -0
  155. package/dist/web/assets/file-review-dialog-D8XVZ21M.js.br +0 -0
  156. package/dist/web/assets/file-review-dialog-D8XVZ21M.js.gz +0 -0
  157. package/dist/web/assets/git-history-panel-D2fKSR66.js.br +0 -0
  158. package/dist/web/assets/git-history-panel-D2fKSR66.js.gz +0 -0
  159. package/dist/web/assets/global-search-dialog-BxT-UjpZ.js.br +0 -0
  160. package/dist/web/assets/global-search-dialog-BxT-UjpZ.js.gz +0 -0
  161. package/dist/web/assets/global-settings-about-DiblprcD.js.br +0 -0
  162. package/dist/web/assets/global-settings-about-DiblprcD.js.gz +0 -0
  163. package/dist/web/assets/global-settings-fields-D5T5SPXY.js.br +0 -0
  164. package/dist/web/assets/global-settings-fields-D5T5SPXY.js.gz +0 -0
  165. package/dist/web/assets/global-settings-model-COz331Sr.js.br +0 -0
  166. package/dist/web/assets/global-settings-model-COz331Sr.js.gz +0 -0
  167. package/dist/web/assets/global-settings-page-DEBGBxSg.js.br +0 -0
  168. package/dist/web/assets/global-settings-page-DEBGBxSg.js.gz +0 -0
  169. package/dist/web/assets/global-settings-pets-DwJnj_6N.js.br +0 -0
  170. package/dist/web/assets/global-settings-pets-DwJnj_6N.js.gz +0 -0
  171. package/dist/web/assets/history-task-timeline-oQRRdMbY.js.br +0 -0
  172. package/dist/web/assets/history-task-timeline-oQRRdMbY.js.gz +0 -0
  173. package/dist/web/assets/index-DRfXjZ2a.js.br +0 -0
  174. package/dist/web/assets/index-DRfXjZ2a.js.gz +0 -0
  175. package/dist/web/assets/installed-skills-pane-v1IcvRKL.js.br +0 -0
  176. package/dist/web/assets/installed-skills-pane-v1IcvRKL.js.gz +0 -0
  177. package/dist/web/assets/lazy-message-response-B6dT9kbf.js.br +0 -0
  178. package/dist/web/assets/lazy-message-response-B6dT9kbf.js.gz +0 -0
  179. package/dist/web/assets/mcp-management-pane-DiPUaZAO.js.br +0 -0
  180. package/dist/web/assets/mcp-management-pane-DiPUaZAO.js.gz +0 -0
  181. package/dist/web/assets/message-response-BZZGbaVm.js +0 -7
  182. package/dist/web/assets/message-response-BZZGbaVm.js.br +0 -0
  183. package/dist/web/assets/message-response-BZZGbaVm.js.gz +0 -0
  184. package/dist/web/assets/official-plugins-pane-Cis1hRgm.js.br +0 -0
  185. package/dist/web/assets/official-plugins-pane-Cis1hRgm.js.gz +0 -0
  186. package/dist/web/assets/personalization-settings-panel-BB5nguhA.js.br +0 -0
  187. package/dist/web/assets/personalization-settings-panel-BB5nguhA.js.gz +0 -0
  188. package/dist/web/assets/project-file-popup-page-CAcF7DIa.js.br +0 -0
  189. package/dist/web/assets/project-file-popup-page-CAcF7DIa.js.gz +0 -0
  190. package/dist/web/assets/project-source-dialog-DbOmvJBS.js.br +0 -0
  191. package/dist/web/assets/project-source-dialog-DbOmvJBS.js.gz +0 -0
  192. package/dist/web/assets/project-source-panel-DGafRUDi.js.br +0 -0
  193. package/dist/web/assets/project-source-panel-DGafRUDi.js.gz +0 -0
  194. package/dist/web/assets/prompt-input-DwT-XwSc.js.br +0 -0
  195. package/dist/web/assets/prompt-input-DwT-XwSc.js.gz +0 -0
  196. package/dist/web/assets/prompt-input-controls-CLasQrSj.js.br +0 -0
  197. package/dist/web/assets/prompt-input-controls-CLasQrSj.js.gz +0 -0
  198. package/dist/web/assets/scheduled-task-date-time-picker-CnSPVHna.js.br +0 -0
  199. package/dist/web/assets/scheduled-task-date-time-picker-CnSPVHna.js.gz +0 -0
  200. package/dist/web/assets/scheduled-task-schedule-BnMdRADi.js.br +0 -0
  201. package/dist/web/assets/scheduled-tasks-container-CNCzsjiP.js.br +0 -0
  202. package/dist/web/assets/scheduled-tasks-container-CNCzsjiP.js.gz +0 -0
  203. package/dist/web/assets/settings-personalization-CB_nnUys.js.br +0 -0
  204. package/dist/web/assets/settings-personalization-CB_nnUys.js.gz +0 -0
  205. package/dist/web/assets/sheet-JpH2S7eZ.js.br +0 -0
  206. package/dist/web/assets/sheet-JpH2S7eZ.js.gz +0 -0
  207. package/dist/web/assets/skills-market-container-BgtnwdI7.js.br +0 -0
  208. package/dist/web/assets/skills-market-container-BgtnwdI7.js.gz +0 -0
  209. package/dist/web/assets/task-timeline-store-BN41mX3t.js.br +0 -0
  210. package/dist/web/assets/task-timeline-store-BN41mX3t.js.gz +0 -0
  211. package/dist/web/assets/third-party-marketplace-pane-CAI6XIWR.js.br +0 -0
  212. package/dist/web/assets/third-party-marketplace-pane-CAI6XIWR.js.gz +0 -0
  213. package/dist/web/assets/workbench-composer-dKix0zGK.js +0 -8
  214. package/dist/web/assets/workbench-composer-dKix0zGK.js.br +0 -0
  215. package/dist/web/assets/workbench-composer-dKix0zGK.js.gz +0 -0
  216. package/dist/web/assets/workbench-inspector-changes-Bl5nS-_2.js.br +0 -0
  217. package/dist/web/assets/workbench-inspector-changes-Bl5nS-_2.js.gz +0 -0
  218. package/dist/web/assets/workbench-pet-canvas-CnwZR5HG.js.br +0 -0
  219. package/dist/web/assets/workbench-pet-canvas-CnwZR5HG.js.gz +0 -0
  220. package/dist/web/assets/workbench-shell-B8lBrj2O.js +0 -3
  221. package/dist/web/assets/workbench-shell-B8lBrj2O.js.br +0 -0
  222. package/dist/web/assets/workbench-shell-B8lBrj2O.js.gz +0 -0
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-CNC7AqOf.js";import{i as t,t as n}from"./react-runtime-DaCTDC27.js";import{l as r,o as i,r as a}from"./initial-deps-CB2J2rjl.js";import{A as o,J as s,_ as c,it as l}from"./initial-deps-E80pA8LY.js";import{n as u,t as d}from"./dist-BpzI75g4.js";import{Lt as f,vt as p}from"./index-DRfXjZ2a.js";var m=e(t(),1),h=n();function g({onOpen:e,onToggle:t,pending:n,skill:r}){let{t:i}=l(`workbench`);return(0,h.jsxs)(`li`,{className:`skills-installed-row`,children:[(0,h.jsxs)(`button`,{"aria-label":i(`skillsMarket.openSkill`,{name:r.displayName}),className:`skills-installed-row__open`,onClick:()=>{e(r)},type:`button`,children:[(0,h.jsx)(`span`,{"aria-hidden":`true`,className:`skills-market-glyph`,"data-tone":`skills`,children:(0,h.jsx)(s,{})}),(0,h.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,h.jsx)(`strong`,{className:`block truncate text-body-small`,children:r.displayName}),(0,h.jsx)(`span`,{className:`block truncate text-label text-muted-foreground`,title:r.path,children:r.description||r.path})]}),(0,h.jsx)(o,{"aria-hidden":`true`,className:`skills-installed-row__folder`})]}),(0,h.jsx)(d,{"aria-label":i(`skillsMarket.toggle`,{name:r.displayName}),checked:r.enabled,className:`skills-switch`,disabled:n,onCheckedChange:()=>{t(r)},children:(0,h.jsx)(u,{className:`skills-switch__thumb`})})]})}function _(){let{t:e}=l(`workbench`),{client:t,projects:n}=f(),o=r(),s=i({queryFn:()=>t.listInstalledSkills(),queryKey:[`extensions`,`skills`]}),u=a({mutationFn:e=>t.setSkillEnabled(e.path,!e.enabled),onSuccess:e=>o.setQueryData([`extensions`,`skills`],e.installedSkills)}),d=a({meta:{actionNotification:{successMessage:!1}},mutationFn:e=>t.openSkillDirectory(e)}),_=(0,m.useMemo)(()=>{let t=new Map;t.set(`system`,{id:`system`,skills:[],title:e(`skillsMarket.scope.system`)}),t.set(`user`,{id:`user`,skills:[],title:e(`skillsMarket.scope.user`)});for(let e of n)t.set(e.id,{id:e.id,skills:[],title:e.name});t.set(`repo`,{id:`repo`,skills:[],title:e(`skillsMarket.scope.repo`)});for(let e of s.data?.data??[])e.scope===`system`||e.scope===`admin`?t.get(`system`)?.skills.push(e):e.scope===`user`?t.get(`user`)?.skills.push(e):t.get(e.projectId??`repo`)?.skills.push(e);return[...t.values()].filter(e=>e.skills.length>0)},[s.data,n,e]);return(0,h.jsxs)(`div`,{className:`skills-market-pane`,role:`tabpanel`,children:[(0,h.jsxs)(`div`,{className:`skills-market-toolbar`,children:[(0,h.jsx)(`span`,{className:`text-body-small text-muted-foreground`,children:e(`skillsMarket.installedCount`,{count:s.data?.data.length??0})}),(0,h.jsx)(p,{"aria-label":e(`skillsMarket.refresh`),disabled:s.isFetching,onClick:()=>void s.refetch(),size:`icon-sm`,title:e(`skillsMarket.refresh`),type:`button`,variant:`ghost`,children:(0,h.jsx)(c,{"aria-hidden":`true`,className:s.isFetching?`animate-spin`:``})})]}),s.isPending?(0,h.jsx)(`div`,{className:`skills-market-state`,role:`status`,children:e(`skillsMarket.loading`)}):s.error===null?_.length===0?(0,h.jsx)(`div`,{className:`skills-market-state`,children:e(`skillsMarket.emptyInstalled`)}):(0,h.jsx)(`div`,{className:`skills-installed-groups`,children:_.map(e=>(0,h.jsxs)(`section`,{className:`skills-installed-group`,children:[(0,h.jsxs)(`header`,{children:[(0,h.jsx)(`h3`,{children:e.title}),(0,h.jsx)(`span`,{children:e.skills.length})]}),(0,h.jsx)(`ul`,{children:e.skills.map(e=>(0,h.jsx)(g,{onOpen:e=>{d.mutate(e.path)},onToggle:e=>{u.mutate(e)},pending:u.isPending&&u.variables.id===e.id,skill:e},e.id))})]},e.id))}):(0,h.jsx)(`div`,{className:`skills-market-state`,role:`alert`,children:e(`skillsMarket.loadError`)})]})}export{_ as InstalledSkillsPane};
1
+ import{a as e}from"./rolldown-runtime-CNC7AqOf.js";import{i as t,t as n}from"./react-runtime-DaCTDC27.js";import{l as r,o as i,r as a}from"./initial-deps-CB2J2rjl.js";import{A as o,J as s,_ as c,it as l}from"./initial-deps-E80pA8LY.js";import{n as u,t as d}from"./dist-BpzI75g4.js";import{Lt as f,vt as p}from"./index-D9lOU2_n.js";var m=e(t(),1),h=n();function g({onOpen:e,onToggle:t,pending:n,skill:r}){let{t:i}=l(`workbench`);return(0,h.jsxs)(`li`,{className:`skills-installed-row`,children:[(0,h.jsxs)(`button`,{"aria-label":i(`skillsMarket.openSkill`,{name:r.displayName}),className:`skills-installed-row__open`,onClick:()=>{e(r)},type:`button`,children:[(0,h.jsx)(`span`,{"aria-hidden":`true`,className:`skills-market-glyph`,"data-tone":`skills`,children:(0,h.jsx)(s,{})}),(0,h.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,h.jsx)(`strong`,{className:`block truncate text-body-small`,children:r.displayName}),(0,h.jsx)(`span`,{className:`block truncate text-label text-muted-foreground`,title:r.path,children:r.description||r.path})]}),(0,h.jsx)(o,{"aria-hidden":`true`,className:`skills-installed-row__folder`})]}),(0,h.jsx)(d,{"aria-label":i(`skillsMarket.toggle`,{name:r.displayName}),checked:r.enabled,className:`skills-switch`,disabled:n,onCheckedChange:()=>{t(r)},children:(0,h.jsx)(u,{className:`skills-switch__thumb`})})]})}function _(){let{t:e}=l(`workbench`),{client:t,projects:n}=f(),o=r(),s=i({queryFn:()=>t.listInstalledSkills(),queryKey:[`extensions`,`skills`]}),u=a({mutationFn:e=>t.setSkillEnabled(e.path,!e.enabled),onSuccess:e=>o.setQueryData([`extensions`,`skills`],e.installedSkills)}),d=a({meta:{actionNotification:{successMessage:!1}},mutationFn:e=>t.openSkillDirectory(e)}),_=(0,m.useMemo)(()=>{let t=new Map;t.set(`system`,{id:`system`,skills:[],title:e(`skillsMarket.scope.system`)}),t.set(`user`,{id:`user`,skills:[],title:e(`skillsMarket.scope.user`)});for(let e of n)t.set(e.id,{id:e.id,skills:[],title:e.name});t.set(`repo`,{id:`repo`,skills:[],title:e(`skillsMarket.scope.repo`)});for(let e of s.data?.data??[])e.scope===`system`||e.scope===`admin`?t.get(`system`)?.skills.push(e):e.scope===`user`?t.get(`user`)?.skills.push(e):t.get(e.projectId??`repo`)?.skills.push(e);return[...t.values()].filter(e=>e.skills.length>0)},[s.data,n,e]);return(0,h.jsxs)(`div`,{className:`skills-market-pane`,role:`tabpanel`,children:[(0,h.jsxs)(`div`,{className:`skills-market-toolbar`,children:[(0,h.jsx)(`span`,{className:`text-body-small text-muted-foreground`,children:e(`skillsMarket.installedCount`,{count:s.data?.data.length??0})}),(0,h.jsx)(p,{"aria-label":e(`skillsMarket.refresh`),disabled:s.isFetching,onClick:()=>void s.refetch(),size:`icon-sm`,title:e(`skillsMarket.refresh`),type:`button`,variant:`ghost`,children:(0,h.jsx)(c,{"aria-hidden":`true`,className:s.isFetching?`animate-spin`:``})})]}),s.isPending?(0,h.jsx)(`div`,{className:`skills-market-state`,role:`status`,children:e(`skillsMarket.loading`)}):s.error===null?_.length===0?(0,h.jsx)(`div`,{className:`skills-market-state`,children:e(`skillsMarket.emptyInstalled`)}):(0,h.jsx)(`div`,{className:`skills-installed-groups`,children:_.map(e=>(0,h.jsxs)(`section`,{className:`skills-installed-group`,children:[(0,h.jsxs)(`header`,{children:[(0,h.jsx)(`h3`,{children:e.title}),(0,h.jsx)(`span`,{children:e.skills.length})]}),(0,h.jsx)(`ul`,{children:e.skills.map(e=>(0,h.jsx)(g,{onOpen:e=>{d.mutate(e.path)},onToggle:e=>{u.mutate(e)},pending:u.isPending&&u.variables.id===e.id,skill:e},e.id))})]},e.id))}):(0,h.jsx)(`div`,{className:`skills-market-state`,role:`alert`,children:e(`skillsMarket.loadError`)})]})}export{_ as InstalledSkillsPane};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/message-response-BZZGbaVm.js","assets/rolldown-runtime-CNC7AqOf.js","assets/react-runtime-DaCTDC27.js","assets/initial-deps-E80pA8LY.js","assets/initial-deps-BM3gt1hz.js","assets/external-link-DcCR8cO8.js","assets/context-menu-Dj3lnor1.js","assets/initial-deps-BYSU0u1N.js","assets/scheduled-task-floating-ui~index~workbench-shell~workbench-inspector-changes~project-file-p~m6x4vffh-DAfditVv.js","assets/index-DRfXjZ2a.js","assets/initial-deps-Bx4af_YG.js","assets/initial-deps-CB2J2rjl.js","assets/initial-deps-CNK9MBOP.js","assets/initial-deps-Cq4pSOi-.js","assets/initial-deps-DipJkDUX.js","assets/index-Cm5l38kF.css","assets/chunk-BO2N2NFS-D6bbuE0-.js","assets/lib-DE0ZEvGM.js","assets/prompt-reference-token-Cxx6C-IR.js"])))=>i.map(i=>d[i]);
2
- import{a as e}from"./rolldown-runtime-CNC7AqOf.js";import{t}from"./initial-deps-Bx4af_YG.js";import{i as n,t as r}from"./react-runtime-DaCTDC27.js";var i=e(n(),1),a=r();function o(){return t(()=>import(`./message-response-BZZGbaVm.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]))}var s=(0,i.lazy)(o);function c({children:e=``,className:t=``,...n}){return(0,a.jsx)(i.Suspense,{fallback:(0,a.jsx)(`div`,{className:`size-full whitespace-pre-wrap break-words ${t}`,children:(0,a.jsx)(`p`,{children:e})}),children:(0,a.jsx)(s,{className:t,...n,children:e})})}export{c as t};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/message-response-AwJefMK2.js","assets/rolldown-runtime-CNC7AqOf.js","assets/react-runtime-DaCTDC27.js","assets/initial-deps-E80pA8LY.js","assets/initial-deps-BM3gt1hz.js","assets/external-link-DcCR8cO8.js","assets/context-menu-Dfbnk16V.js","assets/initial-deps-BYSU0u1N.js","assets/scheduled-task-floating-ui~index~workbench-shell~workbench-inspector-changes~project-file-p~m6x4vffh-DAfditVv.js","assets/index-D9lOU2_n.js","assets/initial-deps-Bx4af_YG.js","assets/initial-deps-CB2J2rjl.js","assets/initial-deps-CNK9MBOP.js","assets/initial-deps-Cq4pSOi-.js","assets/initial-deps-DipJkDUX.js","assets/index-Cm5l38kF.css","assets/chunk-BO2N2NFS-D6bbuE0-.js","assets/lib-DE0ZEvGM.js","assets/prompt-reference-token-Cxx6C-IR.js"])))=>i.map(i=>d[i]);
2
+ import{a as e}from"./rolldown-runtime-CNC7AqOf.js";import{t}from"./initial-deps-Bx4af_YG.js";import{i as n,t as r}from"./react-runtime-DaCTDC27.js";var i=e(n(),1),a=r();function o(){return t(()=>import(`./message-response-AwJefMK2.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]))}var s=(0,i.lazy)(o);function c({children:e=``,className:t=``,...n}){return(0,a.jsx)(i.Suspense,{fallback:(0,a.jsx)(`div`,{className:`size-full whitespace-pre-wrap break-words ${t}`,children:(0,a.jsx)(`p`,{children:e})}),children:(0,a.jsx)(s,{className:t,...n,children:e})})}export{c as t};
@@ -1 +1 @@
1
- import{t as e}from"./react-runtime-DaCTDC27.js";import{l as t,o as n,r}from"./initial-deps-CB2J2rjl.js";import{_ as i,f as a,it as o}from"./initial-deps-E80pA8LY.js";import{n as s,t as c}from"./dist-BpzI75g4.js";import{Lt as l,vt as u}from"./index-DRfXjZ2a.js";var d=e();function f(){let{t:e}=o(`workbench`),{client:f}=l(),p=t(),m=n({queryFn:()=>f.listConfiguredMcpServers(),queryKey:[`extensions`,`mcp`]}),h=r({mutationFn:e=>f.setMcpServerEnabled(e.name,!e.enabled),onSuccess:e=>p.setQueryData([`extensions`,`mcp`],e.servers)});return(0,d.jsxs)(`div`,{className:`skills-market-pane`,role:`tabpanel`,children:[(0,d.jsxs)(`div`,{className:`skills-market-toolbar`,children:[(0,d.jsx)(`span`,{className:`text-body-small text-muted-foreground`,children:e(`skillsMarket.mcpCount`,{count:m.data?.data.length??0})}),(0,d.jsx)(u,{"aria-label":e(`skillsMarket.refreshMcp`),disabled:m.isFetching,onClick:()=>void m.refetch(),size:`icon-sm`,title:e(`skillsMarket.refreshMcp`),type:`button`,variant:`ghost`,children:(0,d.jsx)(i,{"aria-hidden":`true`,className:m.isFetching?`animate-spin`:``})})]}),m.isPending?(0,d.jsx)(`div`,{className:`skills-market-state`,role:`status`,children:e(`skillsMarket.loadingMcp`)}):m.error===null?m.data.data.length===0?(0,d.jsx)(`div`,{className:`skills-market-state`,children:e(`skillsMarket.emptyMcp`)}):(0,d.jsxs)(`section`,{className:`skills-installed-group`,children:[(0,d.jsxs)(`header`,{children:[(0,d.jsx)(`h3`,{children:`MCP`}),(0,d.jsx)(`span`,{children:m.data.data.length})]}),(0,d.jsx)(`ul`,{children:m.data.data.map(t=>(0,d.jsxs)(`li`,{className:`skills-installed-row`,children:[(0,d.jsxs)(`span`,{className:`skills-mcp-row__content`,children:[(0,d.jsx)(`span`,{"aria-hidden":`true`,className:`skills-market-glyph`,"data-tone":`mcp`,children:(0,d.jsx)(a,{})}),(0,d.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,d.jsx)(`strong`,{className:`block truncate text-body-small`,children:t.name}),(0,d.jsx)(`span`,{className:`skills-mcp-status`,"data-enabled":t.enabled,children:e(t.enabled?`skillsMarket.mcpEnabled`:`skillsMarket.mcpStopped`)})]})]}),(0,d.jsx)(c,{"aria-label":e(`skillsMarket.toggleMcp`,{name:t.name}),checked:t.enabled,className:`skills-switch`,disabled:h.isPending&&h.variables.name===t.name,onCheckedChange:()=>{h.mutate(t)},children:(0,d.jsx)(s,{className:`skills-switch__thumb`})})]},t.name))})]}):(0,d.jsx)(`div`,{className:`skills-market-state`,role:`alert`,children:e(`skillsMarket.mcpError`)})]})}export{f as McpManagementPane};
1
+ import{t as e}from"./react-runtime-DaCTDC27.js";import{l as t,o as n,r}from"./initial-deps-CB2J2rjl.js";import{_ as i,f as a,it as o}from"./initial-deps-E80pA8LY.js";import{n as s,t as c}from"./dist-BpzI75g4.js";import{Lt as l,vt as u}from"./index-D9lOU2_n.js";var d=e();function f(){let{t:e}=o(`workbench`),{client:f}=l(),p=t(),m=n({queryFn:()=>f.listConfiguredMcpServers(),queryKey:[`extensions`,`mcp`]}),h=r({mutationFn:e=>f.setMcpServerEnabled(e.name,!e.enabled),onSuccess:e=>p.setQueryData([`extensions`,`mcp`],e.servers)});return(0,d.jsxs)(`div`,{className:`skills-market-pane`,role:`tabpanel`,children:[(0,d.jsxs)(`div`,{className:`skills-market-toolbar`,children:[(0,d.jsx)(`span`,{className:`text-body-small text-muted-foreground`,children:e(`skillsMarket.mcpCount`,{count:m.data?.data.length??0})}),(0,d.jsx)(u,{"aria-label":e(`skillsMarket.refreshMcp`),disabled:m.isFetching,onClick:()=>void m.refetch(),size:`icon-sm`,title:e(`skillsMarket.refreshMcp`),type:`button`,variant:`ghost`,children:(0,d.jsx)(i,{"aria-hidden":`true`,className:m.isFetching?`animate-spin`:``})})]}),m.isPending?(0,d.jsx)(`div`,{className:`skills-market-state`,role:`status`,children:e(`skillsMarket.loadingMcp`)}):m.error===null?m.data.data.length===0?(0,d.jsx)(`div`,{className:`skills-market-state`,children:e(`skillsMarket.emptyMcp`)}):(0,d.jsxs)(`section`,{className:`skills-installed-group`,children:[(0,d.jsxs)(`header`,{children:[(0,d.jsx)(`h3`,{children:`MCP`}),(0,d.jsx)(`span`,{children:m.data.data.length})]}),(0,d.jsx)(`ul`,{children:m.data.data.map(t=>(0,d.jsxs)(`li`,{className:`skills-installed-row`,children:[(0,d.jsxs)(`span`,{className:`skills-mcp-row__content`,children:[(0,d.jsx)(`span`,{"aria-hidden":`true`,className:`skills-market-glyph`,"data-tone":`mcp`,children:(0,d.jsx)(a,{})}),(0,d.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,d.jsx)(`strong`,{className:`block truncate text-body-small`,children:t.name}),(0,d.jsx)(`span`,{className:`skills-mcp-status`,"data-enabled":t.enabled,children:e(t.enabled?`skillsMarket.mcpEnabled`:`skillsMarket.mcpStopped`)})]})]}),(0,d.jsx)(c,{"aria-label":e(`skillsMarket.toggleMcp`,{name:t.name}),checked:t.enabled,className:`skills-switch`,disabled:h.isPending&&h.variables.name===t.name,onCheckedChange:()=>{h.mutate(t)},children:(0,d.jsx)(s,{className:`skills-switch__thumb`})})]},t.name))})]}):(0,d.jsx)(`div`,{className:`skills-market-state`,role:`alert`,children:e(`skillsMarket.mcpError`)})]})}export{f as McpManagementPane};
@@ -0,0 +1,7 @@
1
+ import{a as e}from"./rolldown-runtime-CNC7AqOf.js";import{i as t,r as n,t as r}from"./react-runtime-DaCTDC27.js";import{C as i,it as a,j as o}from"./initial-deps-E80pA8LY.js";import{t as s}from"./external-link-DcCR8cO8.js";import{c,n as l,r as u,t as d}from"./context-menu-Dfbnk16V.js";import{vt as f}from"./index-D9lOU2_n.js";import{a as p,i as m,n as h,o as g,s as ee}from"./chunk-BO2N2NFS-D6bbuE0-.js";import{t as te}from"./prompt-reference-token-Cxx6C-IR.js";var _=e(t(),1),v=e(n(),1),y=r(),ne=/^::code-comment\{(.*)\}\s*$/,b=/([a-z]+)=(?:"((?:\\.|[^"\\])*)"|(\d+))/g,x=[`/apps/`,`/packages/`,`/src/`,`/tests/`,`/.superwork/`],S=8,C=12;function re(e){try{return JSON.parse(`"${e}"`)}catch{return e}}function ie(e){let t=new Map;for(let n of e.matchAll(b)){let e=n[1],r=n[2],i=n[3];e!==void 0&&t.set(e,r===void 0?i??``:re(r))}let n=t.get(`body`),r=t.get(`file`),i=t.get(`title`);if(n===void 0||r===void 0||i===void 0)return null;let a=e=>{let n=t.get(e);return n===void 0?null:Number.parseInt(n,10)};return{body:n,end:a(`end`),file:r,priority:a(`priority`),start:a(`start`),title:i}}function ae(e){let t=ne.exec(e)?.[1];return t===void 0?null:ie(t)}function w(e){for(let t of x){let n=e.indexOf(t);if(n>=0)return e.slice(n+1)}return e.split(/[\\/]/).at(-1)??e}function T(e){let t=w(e.file);return e.start===null?t:`${t}:${e.end===null||e.end===e.start?String(e.start):`${String(e.start)}-${String(e.end)}`}`}function E(e){return e.replace(/^\[P\d+\]\s*/,``)}function D({comment:e,commentIndex:t}){let n=(0,_.useRef)(null),r=(0,_.useRef)(null),i=(0,_.useId)(),[a,o]=(0,_.useState)(!1),[s,c]=(0,_.useState)(),l=E(e.title),u=T(e),d=(0,_.useCallback)(()=>{let e=n.current,t=r.current;if(e===null||t===null)return;let i=e.getBoundingClientRect(),a=t.getBoundingClientRect(),o=Math.max(C,window.innerWidth-a.width-C),s=Math.min(Math.max(i.left,C),o),l=i.bottom+S+a.height<=window.innerHeight-C?i.bottom+S:i.top-a.height-S,u=Math.max(C,window.innerHeight-a.height-C);c({left:s,top:Math.min(Math.max(l,C),u)})},[]);return(0,_.useLayoutEffect)(()=>{if(!a){c(void 0);return}return d(),window.addEventListener(`resize`,d),window.addEventListener(`scroll`,d,!0),()=>{window.removeEventListener(`resize`,d),window.removeEventListener(`scroll`,d,!0)}},[a,d]),(0,y.jsxs)(`li`,{"aria-describedby":a?i:void 0,className:`flex min-w-0 cursor-pointer items-center gap-3 rounded-control px-1 py-2 text-body-small transition-colors hover:bg-control-hover focus-visible:bg-control-hover`,onBlur:()=>{o(!1)},onFocus:()=>{o(!0)},onMouseEnter:()=>{o(!0)},onMouseLeave:()=>{o(!1)},ref:n,tabIndex:0,children:[(0,y.jsx)(`span`,{className:`shrink-0 rounded-control border border-separator-strong px-1.5 py-0.5 text-label text-muted-foreground`,children:e.priority===null?`--`:`P${String(e.priority)}`}),(0,y.jsx)(`span`,{className:`min-w-0 shrink font-semibold text-foreground`,children:l}),(0,y.jsx)(`span`,{className:`min-w-0 truncate text-muted-foreground`,children:u}),a&&typeof document<`u`?(0,v.createPortal)((0,y.jsxs)(`div`,{className:`pointer-events-none fixed z-50 w-[min(28rem,calc(100vw-1.5rem))] rounded-surface border border-separator-strong bg-raised p-3 text-left shadow-floating`,"data-floating-surface":!0,id:i,ref:r,role:`tooltip`,style:s===void 0?{left:0,top:0,visibility:`hidden`}:{left:s.left,top:s.top},children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,y.jsx)(`span`,{className:`rounded-control border border-separator-strong px-1.5 py-0.5 text-label text-muted-foreground`,children:e.priority===null?`--`:`P${String(e.priority)}`}),(0,y.jsx)(`p`,{className:`font-semibold text-foreground`,children:l})]}),(0,y.jsx)(`p`,{className:`mt-2 break-all font-mono text-meta text-muted-foreground`,children:u}),(0,y.jsx)(m,{className:`mt-2 text-body-small leading-5 text-foreground [&_a]:text-brand [&_a]:underline [&_a]:underline-offset-2 [&_code]:font-mono [&_code]:text-body-small [&>*:first-child]:mt-0 [&>*:last-child]:mb-0`,controls:!1,children:e.body})]}),document.body):null]},`${e.file}:${String(e.start)}:${String(t)}`)}function O({comments:e}){let{t}=a(`conversation`);return e.length===0?null:(0,y.jsxs)(`section`,{"aria-label":t(`agentComponents.codeComments`,{count:e.length}),className:`my-4 overflow-hidden rounded-surface border border-separator-strong bg-raised`,"data-code-comments":`true`,children:[(0,y.jsxs)(`header`,{className:`flex min-h-12 items-center gap-3 border-b border-separator px-4 text-body font-semibold`,children:[(0,y.jsx)(`span`,{className:`grid size-8 place-items-center rounded-control bg-control`,children:(0,y.jsx)(i,{className:`size-4 text-muted-foreground`,"aria-hidden":`true`})}),(0,y.jsx)(`span`,{children:t(`agentComponents.codeComments`,{count:e.length})})]}),(0,y.jsx)(`ol`,{className:`divide-y divide-separator px-4 py-1`,children:e.map((e,t)=>(0,y.jsx)(D,{comment:e,commentIndex:t},`${e.file}:${String(e.start)}:${String(t)}`))})]})}var k=/(?<=\]\()(?:[a-z]:[\\/]|\\\\)[^)\r\n]+?\.[a-z0-9]+(?::\d+(?::\d+)?)?(?=\))/gi,A=/(?<=\]\()(?![a-z][a-z0-9+.-]*:|\/|#)[^)\r\n]+?\.[a-z0-9]+(?::\d+(?::\d+)?)?(?=\))/gi,j=/(?<=\]\()\/(?!\/)[^)\r\n]+?\.[a-z0-9]+(?::\d+(?::\d+)?)?(?=\))/gi,M=/\s+|\S+/gu,N=/^\s+$/u,P=/\n{3,}/g,F=/\[\^[\w-]{1,200}\](?!:)/,I=/\[\^[\w-]{1,200}\]:/,L=/^(?: {0,3})(`{3,}|~{3,})/u,R=/^(?: {4}|\t)/u,z=/(`+)[\s\S]*?\1/gu,B=/(?<![\p{L}\p{N}\\])(\*\*|__)(\S(?:(?!\1).)*?)(\p{P})\1(?=[\p{L}\p{N}])/gu,V=`/__codexly_unc__/`,H=`/__codexly_relative__/`;function U(e){return e.replace(B,(e,t,n,r)=>`${t}${n}${t}${r}`)}var W=class e{fence;constructor(e=null){this.fence=e}normalizeLine(e){let t=L.exec(e);if(this.fence!==null)return t?.[1]?.startsWith(this.fence.character)===!0&&t[1].length>=this.fence.length&&(this.fence=null),e;if(t?.[1]!==void 0)return this.fence={character:t[1][0],length:t[1].length},e;if(R.test(e))return e;let n=0,r=``;for(let t of e.matchAll(z))r+=U(e.slice(n,t.index)),r+=t[0],n=t.index+t[0].length;return r+U(e.slice(n))}clone(){return new e(this.fence)}};function G(e){return e.replace(k,e=>{let t=e.replaceAll(`\\`,`/`);return/^[a-z]:/i.test(t)?`/${t}`:`${V}${t.slice(2)}`}).replace(A,e=>`${H}${e}`).replace(j,e=>e.replaceAll(` `,`%20`).replaceAll(` `,`%09`))}var K=class e{output;trailingWhitespace;constructor(e=``,t=``){this.output=e,this.trailingWhitespace=t}append(e){let t=[],n=this.output.length>0;for(let r of e.matchAll(M)){let e=r[0];if(N.test(e)){this.trailingWhitespace+=e;continue}n&&this.trailingWhitespace.length>0&&t.push(this.trailingWhitespace.replace(P,`
2
+
3
+ `)),this.trailingWhitespace=``,t.push(e),n=!0}t.length>0&&(this.output+=t.join(``))}clone(){return new e(this.output,this.trailingWhitespace)}materialize(){return this.output}};function q(e,t,n){let r=ae(e);if(r!==null)return n.comments.push(r),t&&n.whitespace.append(`
4
+ `),!0;if(n.discardBlankLines&&e.trim().length===0)return!0;let i=n.emphasisNormalizer.normalizeLine(G(e));return n.whitespace.append(`${i}${t?`
5
+ `:``}`),!1}var J=class{cachedResult={comments:[],markdown:``};committedComments=[];discardBlankLines=!1;emphasisNormalizer=new W;pendingLine=``;previousSource=``;whitespace=new K;process(e){if(e===this.previousSource)return this.cachedResult;e.startsWith(this.previousSource)||this.reset(),this.pendingLine+=e.slice(this.previousSource.length),this.previousSource=e;let t=this.pendingLine.indexOf(`
6
+ `);for(;t>=0;){let e=this.pendingLine.slice(0,t);this.pendingLine=this.pendingLine.slice(t+1),this.discardBlankLines=q(e,!0,{comments:this.committedComments,discardBlankLines:this.discardBlankLines,emphasisNormalizer:this.emphasisNormalizer,whitespace:this.whitespace}),t=this.pendingLine.indexOf(`
7
+ `)}let n=[...this.committedComments],r=this.emphasisNormalizer.clone(),i=this.whitespace.clone();return this.pendingLine.length>0&&q(this.pendingLine,!1,{comments:n,discardBlankLines:this.discardBlankLines,emphasisNormalizer:r,whitespace:i}),this.cachedResult={comments:n,markdown:i.materialize()},this.cachedResult}reset(){this.cachedResult={comments:[],markdown:``},this.committedComments=[],this.discardBlankLines=!1,this.emphasisNormalizer=new W,this.pendingLine=``,this.previousSource=``,this.whitespace=new K}};function oe(e=ee){let t=[],n=``;return r=>{if(r===n)return t;let i=0,a=Math.min(n.length,r.length);for(;i<a&&n.charCodeAt(i)===r.charCodeAt(i);)i+=1;let o=0,s=0;for(;o<t.length&&s+(t[o]?.length??0)<=i;)s+=t[o]?.length??0,o+=1;o>0&&(--o,s-=t[o]?.length??0);let c=r.slice(s);return t=F.test(c)||I.test(c)?[r]:[...t.slice(0,o),...e(c)],n=r,t}}var Y=(0,_.createContext)(null);function X({children:e,onOpen:t,reference:n}){let{t:r}=a(`workbench`);return(0,y.jsxs)(d,{modal:!1,children:[(0,y.jsx)(c,{asChild:!0,children:e}),(0,y.jsx)(l,{"aria-label":r(`openMenu.targetLabel`,{path:n.path}),children:(0,y.jsxs)(u,{onSelect:()=>{t(n,`popup`)},children:[(0,y.jsx)(s,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`}),(0,y.jsx)(`span`,{children:r(`openMenu.openInNewWindow`)})]})})]})}var se=/^(?<path>(?:\/|[a-z]:[\\/]|\\\\).+?\.[a-z0-9]+?)(?::(?<line>\d+)(?::\d+)?)?$/i,Z=`/__codexly_prompt_reference__/`,ce=/(^|\s)@(?<path>[^\s,!?;:,。!?;:、()[\]{}"'`]+)(?=$|\s|[,!?;:,。!?;:、()[\]{}"'`])/gu,le={code:{copy:!0,download:!1},mermaid:!1,table:!1};function ue(e){try{return decodeURIComponent(e)}catch{return e}}function Q(e){if(e===void 0)return null;let t=ue(e);if(t.startsWith(Z))return{lineNumber:null,path:t.slice(30),prompt:!0};let n=se.exec(t)?.groups;if(n===void 0)return null;let r=n.path,i=r?.startsWith(`/__codexly_unc__/`)?`//${r.slice(V.length)}`:r?.startsWith(`/__codexly_relative__/`)?r.slice(H.length):r?.match(/^\/[a-z]:[\\/]/i)?r.slice(1):r;return i===void 0?null:{lineNumber:n.line??null,path:i,prompt:!1}}function de(e){let t=[],n=0;for(let r of e.matchAll(ce)){let i=r.groups?.path;if(i===void 0)continue;let a=r.index+(r[1]?.length??0);a>n&&t.push({type:`text`,value:e.slice(n,a)}),t.push({children:[{type:`text`,value:i.split(`/`).at(-1)??i}],type:`link`,url:`${Z}${encodeURIComponent(i)}`}),n=a+i.length+1}return n<e.length&&t.push({type:`text`,value:e.slice(n)}),t}function fe(){return e=>{let t=e=>{e.type===`link`||e.type===`linkReference`||e.children===void 0||(e.children=e.children.flatMap(e=>e.type===`text`&&e.value!==void 0?de(e.value):(t(e),e)))};t(e)}}function pe(){return e=>{let t=(e,n)=>{if(e.type===`html`){e.type=n===`paragraph`?`inlineCode`:`code`,e.type===`code`&&(e.lang=`xml`);return}for(let n of e.children??[])t(n,e.type)};t(e)}}function me({children:e,className:t=``,href:n,node:r,...i}){let a=Q(n),s=(0,_.useContext)(Y);if(a!==null){if(a.prompt){let n=`${te} relative top-0.5 select-none ${t}`,r=(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(o,{"aria-hidden":`true`,className:`size-4 shrink-0`}),(0,y.jsx)(`span`,{className:`truncate`,children:e})]});if(s!==null){let e={lineNumber:null,path:a.path};return(0,y.jsx)(X,{onOpen:s,reference:e,children:(0,y.jsx)(f,{variant:`embedded`,"aria-label":`@${a.path}`,className:`${n} cursor-pointer hover:bg-control-hover`,"data-prompt-file-reference":a.path,onClick:()=>{s(e)},size:`embedded`,title:a.path,type:`button`,children:r})})}return(0,y.jsx)(`span`,{className:n,"data-prompt-file-reference":a.path,title:a.path,children:r})}let n=(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`span`,{children:e}),a.lineNumber===null?null:(0,y.jsx)(`span`,{className:`markdown-file-reference__line`,children:`(line ${a.lineNumber})`})]});if(s!==null){let e={lineNumber:a.lineNumber===null?null:Number(a.lineNumber),path:a.path};return(0,y.jsx)(X,{onOpen:s,reference:e,children:(0,y.jsx)(f,{variant:`ghost`,className:`markdown-file-reference cursor-pointer text-brand underline decoration-transparent underline-offset-2 transition-colors hover:text-brand-strong hover:decoration-current ${t}`,"data-file-reference":`true`,onClick:()=>{s(e)},title:a.path,type:`button`,children:n})})}return(0,y.jsx)(`span`,{className:`markdown-file-reference text-brand ${t}`,"data-file-reference":`true`,title:a.path,children:n})}return(0,y.jsx)(`a`,{className:`font-medium text-brand underline decoration-current/35 underline-offset-2 transition-colors hover:text-brand-strong ${t}`,href:n,rel:`noopener noreferrer`,target:`_blank`,...i,children:e})}function he(e){let t=(0,_.useContext)(p),n=(0,_.useMemo)(()=>({...t,isAnimating:!1}),[t]);return(0,y.jsx)(p.Provider,{value:n,children:(0,y.jsx)(g,{...e})})}function ge({children:e,className:t=``,components:n,onOpenFileReference:r,parseMarkdownIntoBlocksFn:i,promptFileReferences:a=!1,remarkPlugins:o,...s}){let c=(0,_.useMemo)(()=>new J,[]),l=(0,_.useMemo)(()=>oe(),[]),u=c.process(e??``),d=(0,_.useMemo)(()=>({...n,a:me}),[n]),f=(0,_.useMemo)(()=>[...Object.values(h),pe,...a?[fe]:[],...o??[]],[a,o]);return(0,y.jsxs)(Y.Provider,{value:r??null,children:[(0,y.jsx)(m,{className:`size-full break-words [&_blockquote]:border-l-2 [&_blockquote]:border-separator [&_blockquote]:pl-3 [&_code]:font-mono [&_code]:text-body-small [&_h1]:text-xl [&_h1]:font-semibold [&_h2]:text-lg [&_h2]:font-semibold [&_h3]:font-semibold [&_img]:block [&_img]:h-auto [&_img]:max-w-full [&_img]:object-contain [&_pre]:overflow-x-auto [&>*:first-child]:mt-0 [&>*:last-child]:mb-0 ${t}`,controls:le,...s,BlockComponent:he,components:d,parseMarkdownIntoBlocksFn:i??l,remarkPlugins:f,children:u.markdown}),(0,y.jsx)(O,{comments:u.comments})]})}var $=(0,_.memo)(ge,(e,t)=>e.children===t.children&&e.isAnimating===t.isAnimating&&e.mode===t.mode&&e.onOpenFileReference===t.onOpenFileReference&&e.promptFileReferences===t.promptFileReferences);$.displayName=`MessageResponse`;export{$ as MessageResponse,$ as default};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-CNC7AqOf.js";import{i as t,t as n}from"./react-runtime-DaCTDC27.js";import{l as r,o as i,r as a}from"./initial-deps-CB2J2rjl.js";import{E as o,_ as s,et as c,it as l,m as u,z as d}from"./initial-deps-E80pA8LY.js";import{t as f}from"./external-link-DcCR8cO8.js";import{t as p}from"./info-BbsecYYN.js";import{Lt as m,Z as h,vt as g}from"./index-DRfXjZ2a.js";import{a as _,i as v,n as y,o as b,r as x,t as S}from"./sheet-JpH2S7eZ.js";var C=c(`boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),w=c(`package-check`,[[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`path`,{d:`m16 17 2 2 4-4`,key:`uh5qu3`}],[`path`,{d:`M21 11.127V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.729l7 4a2 2 0 0 0 2 .001l1.32-.753`,key:`kpkbpo`}],[`path`,{d:`M3.29 7 12 12l8.71-5`,key:`19ckod`}],[`path`,{d:`m7.5 4.27 8.997 5.148`,key:`9yrvtv`}]]),T=c(`plug-zap`,[[`path`,{d:`M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z`,key:`goz73y`}],[`path`,{d:`m2 22 3-3`,key:`19mgm9`}],[`path`,{d:`M7.5 13.5 10 11`,key:`7xgeeb`}],[`path`,{d:`M10.5 16.5 13 14`,key:`10btkg`}],[`path`,{d:`m18 3-4 4h6l-4 4`,key:`16psg9`}]]),E=c(`workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]),D=e(t(),1),O=n();function k(e){try{let t=new URL(e);t.protocol===`https:`&&window.open(t.href,`_blank`,`noopener,noreferrer`)}catch{}}function A({client:e,installResult:t,installing:n,onInstall:r,onOpenChange:a,onUninstall:s,plugin:c,uninstalling:u}){let{t:d}=l(`workbench`),m=i({queryFn:()=>e.getOfficialPlugin(c.marketplaceName,c.marketplacePath,c.pluginName),queryKey:[`extensions`,`plugins`,`detail`,c.marketplaceName,c.marketplacePath,c.pluginName],staleTime:5*6e4}),h=m.data,D=t?.appsNeedingAuth??h?.apps??[];return(0,O.jsx)(S,{onOpenChange:a,open:!0,children:(0,O.jsxs)(y,{className:`official-plugin-sheet`,closeLabel:d(`skillsMarket.closeDetails`),children:[(0,O.jsxs)(_,{className:`official-plugin-sheet__header`,children:[(0,O.jsx)(`div`,{className:`skills-market-glyph`,"data-tone":`plugins`,"aria-hidden":`true`,children:(0,O.jsx)(w,{})}),(0,O.jsxs)(`div`,{className:`min-w-0`,children:[(0,O.jsx)(b,{children:c.displayName}),(0,O.jsx)(x,{children:c.developerName??d(`skillsMarket.officialPublisher`)})]})]}),(0,O.jsx)(`div`,{className:`official-plugin-sheet__body`,children:m.isPending?(0,O.jsx)(`div`,{className:`skills-market-state`,role:`status`,children:d(`skillsMarket.loadingDetail`)}):m.error===null?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`p`,{className:`text-body-small leading-6 text-muted-foreground`,children:h?.description??c.description}),t===null?null:(0,O.jsxs)(`p`,{className:`official-plugin-session-note`,role:`status`,children:[(0,O.jsx)(p,{"aria-hidden":`true`}),d(`skillsMarket.newSessionRequired`)]}),(0,O.jsxs)(`div`,{className:`official-plugin-assets`,children:[(0,O.jsxs)(`section`,{children:[(0,O.jsxs)(`h4`,{children:[(0,O.jsx)(C,{"aria-hidden":`true`}),`Skills `,(0,O.jsx)(`span`,{children:h?.skills.length??0})]}),h?.skills.map(e=>(0,O.jsxs)(`div`,{className:`official-plugin-asset`,children:[(0,O.jsx)(`strong`,{children:e.name}),(0,O.jsx)(`p`,{children:e.description})]},e.name))]}),(0,O.jsxs)(`section`,{children:[(0,O.jsxs)(`h4`,{children:[(0,O.jsx)(T,{"aria-hidden":`true`}),`MCP `,(0,O.jsx)(`span`,{children:h?.mcpServers.length??0})]}),h?.mcpServers.map(e=>(0,O.jsx)(`div`,{className:`official-plugin-asset`,children:(0,O.jsx)(`strong`,{children:e})},e))]}),(0,O.jsxs)(`section`,{children:[(0,O.jsxs)(`h4`,{children:[(0,O.jsx)(E,{"aria-hidden":`true`}),`Apps `,(0,O.jsx)(`span`,{children:D.length})]}),D.map(e=>(0,O.jsxs)(`div`,{className:`official-plugin-asset`,children:[(0,O.jsx)(`strong`,{children:e.name}),(0,O.jsx)(`p`,{children:e.description}),e.installUrl===null?null:(0,O.jsxs)(g,{onClick:()=>{k(e.installUrl??``)},size:`compact`,type:`button`,variant:`outline`,children:[(0,O.jsx)(f,{"aria-hidden":`true`}),d(`skillsMarket.authorize`)]})]},e.id))]}),h?.hooks.length===0?null:(0,O.jsxs)(`section`,{children:[(0,O.jsxs)(`h4`,{children:[(0,O.jsx)(E,{"aria-hidden":`true`}),`Hooks `,(0,O.jsx)(`span`,{children:h?.hooks.length??0})]}),h?.hooks.map(e=>(0,O.jsx)(`div`,{className:`official-plugin-asset`,children:(0,O.jsx)(`strong`,{children:e})},e))]})]})]}):(0,O.jsx)(`div`,{className:`skills-market-state`,role:`alert`,children:d(`skillsMarket.pluginError`)})}),(0,O.jsx)(v,{className:`official-plugin-sheet__footer`,children:c.installed?(0,O.jsxs)(g,{disabled:u,onClick:s,type:`button`,variant:`destructive`,children:[u?(0,O.jsx)(o,{"aria-hidden":`true`,className:`animate-spin`}):null,d(`skillsMarket.uninstallPlugin`)]}):(0,O.jsxs)(g,{disabled:n||c.installPolicy===`NOT_AVAILABLE`||c.availability!==`AVAILABLE`,onClick:r,type:`button`,children:[n?(0,O.jsx)(o,{"aria-hidden":`true`,className:`animate-spin`,"data-icon":`loading`}):null,d(`skillsMarket.installPlugin`)]})})]})})}var j=[`extensions`,`plugins`];function M({onOpen:e,plugin:t}){let{t:n}=l(`workbench`);return(0,O.jsxs)(`button`,{className:`skills-market-card official-plugin-card`,onClick:()=>{e(t)},type:`button`,children:[(0,O.jsxs)(`span`,{className:`skills-market-card__topline`,children:[t.logoUrl===null?(0,O.jsx)(`span`,{className:`skills-market-glyph`,"data-tone":`plugins`,"aria-hidden":`true`,children:(0,O.jsx)(T,{})}):(0,O.jsx)(`img`,{className:`official-plugin-card__logo`,src:t.logoUrl,alt:``}),(0,O.jsxs)(`span`,{className:`min-w-0 flex-1 text-left`,children:[(0,O.jsx)(`strong`,{className:`block truncate text-body-small`,children:t.displayName}),(0,O.jsx)(`span`,{className:`block truncate text-label text-muted-foreground`,children:t.developerName??n(`skillsMarket.officialPublisher`)})]}),t.installed?(0,O.jsxs)(`span`,{className:`official-plugin-card__installed`,children:[(0,O.jsx)(d,{"aria-hidden":`true`}),n(`skillsMarket.installed`)]}):null]}),(0,O.jsx)(`span`,{className:`skills-market-card__summary`,children:t.description}),(0,O.jsx)(`span`,{className:`skills-market-card__footer`,children:(0,O.jsx)(`span`,{children:t.version===null?t.name:`v${t.version}`})})]})}function N({emptyLabel:e,onOpen:t,plugins:n,title:r}){return(0,O.jsxs)(`section`,{className:`official-plugin-group`,children:[(0,O.jsxs)(`header`,{children:[(0,O.jsx)(`h3`,{children:r}),(0,O.jsx)(`span`,{children:n.length})]}),n.length===0?(0,O.jsx)(`p`,{className:`official-plugin-group__empty`,children:e}):(0,O.jsx)(`div`,{className:`skills-market-grid official-plugin-grid`,children:n.map(e=>(0,O.jsx)(M,{onOpen:t,plugin:e},e.id))})]})}function P(){let{t:e}=l(`workbench`),{client:t}=m(),n=r(),[o,c]=(0,D.useState)(``),[d,f]=(0,D.useState)(null),[p,_]=(0,D.useState)(null),v=i({queryFn:()=>t.listOfficialPlugins(!1),queryKey:j,staleTime:6e4}),y=(0,D.useMemo)(()=>{let e=[],t=[],n=o.trim().toLocaleLowerCase();for(let r of v.data?.data??[]){let i=[r.displayName,r.name,r.description,r.developerName].filter(Boolean).join(` `).toLocaleLowerCase();n!==``&&!i.includes(n)||(r.installed?e:t).push(r)}return{available:t,installed:e}},[v.data?.data,o]),b=a({mutationFn:e=>t.installOfficialPlugin(e.marketplaceName,e.marketplacePath,e.pluginName,globalThis.crypto.randomUUID()),onSuccess:e=>{_(e),n.setQueryData(j,e.plugins)}}),x=a({mutationFn:e=>t.uninstallOfficialPlugin(e.marketplaceName,e.pluginName,e.id),onSuccess:e=>{_(null),n.setQueryData(j,e.plugins),f(null)}}),S=v.data?.data.find(e=>e.id===d)??null,C=()=>n.fetchQuery({queryFn:()=>t.listOfficialPlugins(!0),queryKey:j,staleTime:0}),w=e=>{_(null),f(e.id)};return(0,O.jsxs)(`div`,{className:`skills-market-pane`,role:`tabpanel`,children:[(0,O.jsxs)(`div`,{className:`skills-market-toolbar`,children:[(0,O.jsxs)(`div`,{className:`skills-market-search`,children:[(0,O.jsx)(u,{"aria-hidden":`true`}),(0,O.jsx)(h,{"aria-label":e(`skillsMarket.searchPlugins`),onChange:e=>{c(e.currentTarget.value)},placeholder:e(`skillsMarket.searchPlugins`),value:o})]}),(0,O.jsxs)(g,{disabled:v.isFetching,onClick:()=>void C(),type:`button`,variant:`outline`,children:[(0,O.jsx)(s,{"aria-hidden":`true`,className:v.isFetching?`animate-spin`:``}),e(`skillsMarket.refreshPlugins`)]})]}),v.isPending?(0,O.jsx)(`div`,{className:`skills-market-state`,role:`status`,children:e(`skillsMarket.loadingPlugins`)}):v.error===null?(0,O.jsxs)(`div`,{className:`official-plugin-groups`,children:[(0,O.jsx)(N,{emptyLabel:e(`skillsMarket.emptyInstalledPlugins`),onOpen:w,plugins:y.installed,title:e(`skillsMarket.installedPlugins`)}),(0,O.jsx)(N,{emptyLabel:e(`skillsMarket.emptyAvailablePlugins`),onOpen:w,plugins:y.available,title:e(`skillsMarket.availablePlugins`)})]}):(0,O.jsx)(`div`,{className:`skills-market-state`,role:`alert`,children:e(`skillsMarket.pluginError`)}),S===null?null:(0,O.jsx)(A,{client:t,installResult:p,installing:b.isPending,onInstall:()=>{b.mutate(S)},onOpenChange:e=>{e||f(null)},onUninstall:()=>{x.mutate(S)},plugin:S,uninstalling:x.isPending})]})}export{P as OfficialPluginsPane};
1
+ import{a as e}from"./rolldown-runtime-CNC7AqOf.js";import{i as t,t as n}from"./react-runtime-DaCTDC27.js";import{l as r,o as i,r as a}from"./initial-deps-CB2J2rjl.js";import{E as o,_ as s,et as c,it as l,m as u,z as d}from"./initial-deps-E80pA8LY.js";import{t as f}from"./external-link-DcCR8cO8.js";import{t as p}from"./info-BbsecYYN.js";import{Lt as m,Z as h,vt as g}from"./index-D9lOU2_n.js";import{a as _,i as v,n as y,o as b,r as x,t as S}from"./sheet-C6eLtEHx.js";var C=c(`boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),w=c(`package-check`,[[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`path`,{d:`m16 17 2 2 4-4`,key:`uh5qu3`}],[`path`,{d:`M21 11.127V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.729l7 4a2 2 0 0 0 2 .001l1.32-.753`,key:`kpkbpo`}],[`path`,{d:`M3.29 7 12 12l8.71-5`,key:`19ckod`}],[`path`,{d:`m7.5 4.27 8.997 5.148`,key:`9yrvtv`}]]),T=c(`plug-zap`,[[`path`,{d:`M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z`,key:`goz73y`}],[`path`,{d:`m2 22 3-3`,key:`19mgm9`}],[`path`,{d:`M7.5 13.5 10 11`,key:`7xgeeb`}],[`path`,{d:`M10.5 16.5 13 14`,key:`10btkg`}],[`path`,{d:`m18 3-4 4h6l-4 4`,key:`16psg9`}]]),E=c(`workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]),D=e(t(),1),O=n();function k(e){try{let t=new URL(e);t.protocol===`https:`&&window.open(t.href,`_blank`,`noopener,noreferrer`)}catch{}}function A({client:e,installResult:t,installing:n,onInstall:r,onOpenChange:a,onUninstall:s,plugin:c,uninstalling:u}){let{t:d}=l(`workbench`),m=i({queryFn:()=>e.getOfficialPlugin(c.marketplaceName,c.marketplacePath,c.pluginName),queryKey:[`extensions`,`plugins`,`detail`,c.marketplaceName,c.marketplacePath,c.pluginName],staleTime:5*6e4}),h=m.data,D=t?.appsNeedingAuth??h?.apps??[];return(0,O.jsx)(S,{onOpenChange:a,open:!0,children:(0,O.jsxs)(y,{className:`official-plugin-sheet`,closeLabel:d(`skillsMarket.closeDetails`),children:[(0,O.jsxs)(_,{className:`official-plugin-sheet__header`,children:[(0,O.jsx)(`div`,{className:`skills-market-glyph`,"data-tone":`plugins`,"aria-hidden":`true`,children:(0,O.jsx)(w,{})}),(0,O.jsxs)(`div`,{className:`min-w-0`,children:[(0,O.jsx)(b,{children:c.displayName}),(0,O.jsx)(x,{children:c.developerName??d(`skillsMarket.officialPublisher`)})]})]}),(0,O.jsx)(`div`,{className:`official-plugin-sheet__body`,children:m.isPending?(0,O.jsx)(`div`,{className:`skills-market-state`,role:`status`,children:d(`skillsMarket.loadingDetail`)}):m.error===null?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`p`,{className:`text-body-small leading-6 text-muted-foreground`,children:h?.description??c.description}),t===null?null:(0,O.jsxs)(`p`,{className:`official-plugin-session-note`,role:`status`,children:[(0,O.jsx)(p,{"aria-hidden":`true`}),d(`skillsMarket.newSessionRequired`)]}),(0,O.jsxs)(`div`,{className:`official-plugin-assets`,children:[(0,O.jsxs)(`section`,{children:[(0,O.jsxs)(`h4`,{children:[(0,O.jsx)(C,{"aria-hidden":`true`}),`Skills `,(0,O.jsx)(`span`,{children:h?.skills.length??0})]}),h?.skills.map(e=>(0,O.jsxs)(`div`,{className:`official-plugin-asset`,children:[(0,O.jsx)(`strong`,{children:e.name}),(0,O.jsx)(`p`,{children:e.description})]},e.name))]}),(0,O.jsxs)(`section`,{children:[(0,O.jsxs)(`h4`,{children:[(0,O.jsx)(T,{"aria-hidden":`true`}),`MCP `,(0,O.jsx)(`span`,{children:h?.mcpServers.length??0})]}),h?.mcpServers.map(e=>(0,O.jsx)(`div`,{className:`official-plugin-asset`,children:(0,O.jsx)(`strong`,{children:e})},e))]}),(0,O.jsxs)(`section`,{children:[(0,O.jsxs)(`h4`,{children:[(0,O.jsx)(E,{"aria-hidden":`true`}),`Apps `,(0,O.jsx)(`span`,{children:D.length})]}),D.map(e=>(0,O.jsxs)(`div`,{className:`official-plugin-asset`,children:[(0,O.jsx)(`strong`,{children:e.name}),(0,O.jsx)(`p`,{children:e.description}),e.installUrl===null?null:(0,O.jsxs)(g,{onClick:()=>{k(e.installUrl??``)},size:`compact`,type:`button`,variant:`outline`,children:[(0,O.jsx)(f,{"aria-hidden":`true`}),d(`skillsMarket.authorize`)]})]},e.id))]}),h?.hooks.length===0?null:(0,O.jsxs)(`section`,{children:[(0,O.jsxs)(`h4`,{children:[(0,O.jsx)(E,{"aria-hidden":`true`}),`Hooks `,(0,O.jsx)(`span`,{children:h?.hooks.length??0})]}),h?.hooks.map(e=>(0,O.jsx)(`div`,{className:`official-plugin-asset`,children:(0,O.jsx)(`strong`,{children:e})},e))]})]})]}):(0,O.jsx)(`div`,{className:`skills-market-state`,role:`alert`,children:d(`skillsMarket.pluginError`)})}),(0,O.jsx)(v,{className:`official-plugin-sheet__footer`,children:c.installed?(0,O.jsxs)(g,{disabled:u,onClick:s,type:`button`,variant:`destructive`,children:[u?(0,O.jsx)(o,{"aria-hidden":`true`,className:`animate-spin`}):null,d(`skillsMarket.uninstallPlugin`)]}):(0,O.jsxs)(g,{disabled:n||c.installPolicy===`NOT_AVAILABLE`||c.availability!==`AVAILABLE`,onClick:r,type:`button`,children:[n?(0,O.jsx)(o,{"aria-hidden":`true`,className:`animate-spin`,"data-icon":`loading`}):null,d(`skillsMarket.installPlugin`)]})})]})})}var j=[`extensions`,`plugins`];function M({onOpen:e,plugin:t}){let{t:n}=l(`workbench`);return(0,O.jsxs)(`button`,{className:`skills-market-card official-plugin-card`,onClick:()=>{e(t)},type:`button`,children:[(0,O.jsxs)(`span`,{className:`skills-market-card__topline`,children:[t.logoUrl===null?(0,O.jsx)(`span`,{className:`skills-market-glyph`,"data-tone":`plugins`,"aria-hidden":`true`,children:(0,O.jsx)(T,{})}):(0,O.jsx)(`img`,{className:`official-plugin-card__logo`,src:t.logoUrl,alt:``}),(0,O.jsxs)(`span`,{className:`min-w-0 flex-1 text-left`,children:[(0,O.jsx)(`strong`,{className:`block truncate text-body-small`,children:t.displayName}),(0,O.jsx)(`span`,{className:`block truncate text-label text-muted-foreground`,children:t.developerName??n(`skillsMarket.officialPublisher`)})]}),t.installed?(0,O.jsxs)(`span`,{className:`official-plugin-card__installed`,children:[(0,O.jsx)(d,{"aria-hidden":`true`}),n(`skillsMarket.installed`)]}):null]}),(0,O.jsx)(`span`,{className:`skills-market-card__summary`,children:t.description}),(0,O.jsx)(`span`,{className:`skills-market-card__footer`,children:(0,O.jsx)(`span`,{children:t.version===null?t.name:`v${t.version}`})})]})}function N({emptyLabel:e,onOpen:t,plugins:n,title:r}){return(0,O.jsxs)(`section`,{className:`official-plugin-group`,children:[(0,O.jsxs)(`header`,{children:[(0,O.jsx)(`h3`,{children:r}),(0,O.jsx)(`span`,{children:n.length})]}),n.length===0?(0,O.jsx)(`p`,{className:`official-plugin-group__empty`,children:e}):(0,O.jsx)(`div`,{className:`skills-market-grid official-plugin-grid`,children:n.map(e=>(0,O.jsx)(M,{onOpen:t,plugin:e},e.id))})]})}function P(){let{t:e}=l(`workbench`),{client:t}=m(),n=r(),[o,c]=(0,D.useState)(``),[d,f]=(0,D.useState)(null),[p,_]=(0,D.useState)(null),v=i({queryFn:()=>t.listOfficialPlugins(!1),queryKey:j,staleTime:6e4}),y=(0,D.useMemo)(()=>{let e=[],t=[],n=o.trim().toLocaleLowerCase();for(let r of v.data?.data??[]){let i=[r.displayName,r.name,r.description,r.developerName].filter(Boolean).join(` `).toLocaleLowerCase();n!==``&&!i.includes(n)||(r.installed?e:t).push(r)}return{available:t,installed:e}},[v.data?.data,o]),b=a({mutationFn:e=>t.installOfficialPlugin(e.marketplaceName,e.marketplacePath,e.pluginName,globalThis.crypto.randomUUID()),onSuccess:e=>{_(e),n.setQueryData(j,e.plugins)}}),x=a({mutationFn:e=>t.uninstallOfficialPlugin(e.marketplaceName,e.pluginName,e.id),onSuccess:e=>{_(null),n.setQueryData(j,e.plugins),f(null)}}),S=v.data?.data.find(e=>e.id===d)??null,C=()=>n.fetchQuery({queryFn:()=>t.listOfficialPlugins(!0),queryKey:j,staleTime:0}),w=e=>{_(null),f(e.id)};return(0,O.jsxs)(`div`,{className:`skills-market-pane`,role:`tabpanel`,children:[(0,O.jsxs)(`div`,{className:`skills-market-toolbar`,children:[(0,O.jsxs)(`div`,{className:`skills-market-search`,children:[(0,O.jsx)(u,{"aria-hidden":`true`}),(0,O.jsx)(h,{"aria-label":e(`skillsMarket.searchPlugins`),onChange:e=>{c(e.currentTarget.value)},placeholder:e(`skillsMarket.searchPlugins`),value:o})]}),(0,O.jsxs)(g,{disabled:v.isFetching,onClick:()=>void C(),type:`button`,variant:`outline`,children:[(0,O.jsx)(s,{"aria-hidden":`true`,className:v.isFetching?`animate-spin`:``}),e(`skillsMarket.refreshPlugins`)]})]}),v.isPending?(0,O.jsx)(`div`,{className:`skills-market-state`,role:`status`,children:e(`skillsMarket.loadingPlugins`)}):v.error===null?(0,O.jsxs)(`div`,{className:`official-plugin-groups`,children:[(0,O.jsx)(N,{emptyLabel:e(`skillsMarket.emptyInstalledPlugins`),onOpen:w,plugins:y.installed,title:e(`skillsMarket.installedPlugins`)}),(0,O.jsx)(N,{emptyLabel:e(`skillsMarket.emptyAvailablePlugins`),onOpen:w,plugins:y.available,title:e(`skillsMarket.availablePlugins`)})]}):(0,O.jsx)(`div`,{className:`skills-market-state`,role:`alert`,children:e(`skillsMarket.pluginError`)}),S===null?null:(0,O.jsx)(A,{client:t,installResult:p,installing:b.isPending,onInstall:()=>{b.mutate(S)},onOpenChange:e=>{e||f(null)},onUninstall:()=>{x.mutate(S)},plugin:S,uninstalling:x.isPending})]})}export{P as OfficialPluginsPane};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-CNC7AqOf.js";import{i as t,t as n}from"./react-runtime-DaCTDC27.js";import{l as r,o as i,r as a}from"./initial-deps-CB2J2rjl.js";import{it as o}from"./initial-deps-E80pA8LY.js";import{a as s,i as c}from"./global-settings-fields-D5T5SPXY.js";import{$ as l,Q as u,Tt as d,et as f,rt as p,tt as m,vt as h}from"./index-DRfXjZ2a.js";import"./settings-personalization-CB_nnUys.js";var g=e(t(),1),_=n(),v=[`personalization`,`memories`],y={id:`personalization-memories`};function b({field:e,client:t,settings:n}){let{t:i}=o(`settings`),s=r(),l=a({scope:y,mutationFn:n=>t.updateMemorySettings({[e]:n}),onSuccess:e=>s.setQueryData(v,e),meta:{actionNotification:{successMessage:!1}}}),u=i(e===`enabled`?`personalization.enabled`:`personalization.external`),d=(l.isPending?l.variables:n?.[e])??!1;return(0,_.jsx)(c,{label:u,description:i(e===`enabled`?`personalization.enabledDescription`:`personalization.externalDescription`),children:(0,_.jsx)(h,{role:`switch`,"aria-label":u,"aria-checked":d,disabled:!n||l.isPending,className:`h-6 w-10 rounded-pill p-0.5 ${d?`bg-brand hover:bg-brand`:`bg-control-hover`}`,variant:`ghost`,type:`button`,onClick:()=>{l.mutate(!d)},children:(0,_.jsx)(`span`,{className:`block size-5 rounded-full bg-white transition-transform motion-reduce:transition-none ${d?`translate-x-2`:`-translate-x-2`}`})})})}var x=[`personalization`,`instructions`];function S({client:e,commitSettings:t}){let{t:n}=o(`settings`),S=r(),[C,w]=(0,g.useState)(null),[T,E]=(0,g.useState)(!1),D=i({queryKey:x,queryFn:()=>e.getGlobalInstructions(),refetchOnWindowFocus:!1}),O=i({queryKey:v,queryFn:()=>e.getMemorySettings()}),k=a({mutationFn:({content:t,expectedContent:n})=>e.saveGlobalInstructions(t,n),onSuccess:e=>{S.setQueryData(x,e),w(null),d(n(`personalization.saved`))},meta:{actionNotification:!1}}),A=a({scope:y,mutationFn:()=>e.resetMemories(),onSuccess:()=>{E(!1),d(n(`personalization.deleted`))},meta:{actionNotification:!1}}),j=C??D.data?.content??``,M=k.error!==null&&`code`in k.error&&k.error.code===`GLOBAL_INSTRUCTIONS_CHANGED`;return(0,_.jsxs)(`section`,{id:`settings-panel-personalization`,className:`space-y-8`,children:[(0,_.jsx)(`h1`,{className:`text-xl font-semibold`,children:n(`sections.personalization`)}),(0,_.jsxs)(`div`,{className:`space-y-3`,children:[(0,_.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,_.jsxs)(`div`,{className:`min-w-0`,children:[(0,_.jsx)(`label`,{className:`text-body font-semibold`,htmlFor:`codex-global-instructions`,children:n(`personalization.instructions`)}),(0,_.jsxs)(`p`,{className:`mt-1 text-body-small text-muted-foreground`,children:[n(`personalization.description`),D.data?(0,_.jsx)(`span`,{className:`block break-all`,children:n(`personalization.fileLocation`,{path:D.data.path})}):null]})]}),(0,_.jsx)(h,{type:`button`,variant:`secondary`,className:`shrink-0`,disabled:D.data===void 0||D.isFetching||k.isPending||j===D.data.content,onClick:()=>{D.data&&k.mutate({content:j,expectedContent:D.data.content})},children:n(k.isPending?`personalization.saving`:`personalization.save`)})]}),D.isError?(0,_.jsx)(`p`,{role:`alert`,className:`text-body-small text-danger`,children:n(`personalization.loadError`)}):null,D.isPending?(0,_.jsx)(`p`,{role:`status`,children:n(`loading`)}):null,(0,_.jsx)(`textarea`,{id:`codex-global-instructions`,className:`min-h-56 w-full resize-y rounded-control border border-separator bg-panel p-3 text-body-small focus:shadow-focus focus:outline-none`,spellCheck:!1,disabled:D.data===void 0||k.isPending||D.isFetching,value:j,onChange:e=>{w(e.currentTarget.value),k.reset()}}),D.data?.overrideActive?(0,_.jsx)(`p`,{className:`text-body-small text-muted-foreground`,children:n(`personalization.override`)}):null,k.isError?(0,_.jsx)(`p`,{role:`alert`,className:`text-body-small text-danger`,children:n(M?`personalization.conflict`:`personalization.saveError`)}):null,D.isError||M?(0,_.jsx)(h,{type:`button`,variant:`ghost`,disabled:D.isFetching,onClick:()=>{D.refetch().then(e=>{e.isSuccess&&(w(null),k.reset())})},children:n(`personalization.reload`)}):null]}),t,(0,_.jsxs)(`div`,{className:`space-y-3`,children:[(0,_.jsxs)(s,{title:n(`personalization.memories`),description:n(`personalization.memoryDescription`),children:[[`enabled`,`allowExternalContext`].map(t=>(0,_.jsx)(b,{field:t,client:e,settings:O.data},t)),(0,_.jsx)(c,{label:n(`personalization.remove`),description:n(`personalization.removeDescription`),children:(0,_.jsx)(h,{"aria-label":n(`personalization.remove`),className:`text-danger`,type:`button`,variant:`ghost`,disabled:A.isPending||!O.data,onClick:()=>{A.reset(),E(!0)},children:n(`personalization.remove`)})})]}),O.isError?(0,_.jsxs)(`div`,{role:`alert`,children:[(0,_.jsx)(`p`,{children:n(`personalization.loadError`)}),(0,_.jsx)(h,{variant:`ghost`,onClick:()=>void O.refetch(),children:n(`common:actions.retry`)})]}):null]}),(0,_.jsx)(u,{open:T,onOpenChange:e=>{A.isPending||E(e)},children:(0,_.jsxs)(l,{children:[(0,_.jsx)(p,{children:n(`personalization.remove`)}),(0,_.jsx)(f,{children:n(`personalization.confirmDescription`)}),A.isError?(0,_.jsx)(`p`,{role:`alert`,className:`text-danger`,children:n(`personalization.memoryError`)}):null,(0,_.jsxs)(m,{children:[(0,_.jsx)(h,{variant:`ghost`,disabled:A.isPending,onClick:()=>{E(!1)},children:n(`personalization.cancel`)}),(0,_.jsx)(h,{className:`text-danger`,variant:`secondary`,disabled:A.isPending,onClick:()=>{A.mutate()},children:n(A.isPending?`personalization.deleting`:`personalization.confirm`)})]})]})})]})}export{S as PersonalizationSettingsPanel};
1
+ import{a as e}from"./rolldown-runtime-CNC7AqOf.js";import{i as t,t as n}from"./react-runtime-DaCTDC27.js";import{l as r,o as i,r as a}from"./initial-deps-CB2J2rjl.js";import{it as o}from"./initial-deps-E80pA8LY.js";import{a as s,i as c}from"./global-settings-fields-DqWp3WpN.js";import{$ as l,Q as u,Tt as d,et as f,rt as p,tt as m,vt as h}from"./index-D9lOU2_n.js";import"./settings-personalization-BbAIVND-.js";var g=e(t(),1),_=n(),v=[`personalization`,`memories`],y={id:`personalization-memories`};function b({field:e,client:t,settings:n}){let{t:i}=o(`settings`),s=r(),l=a({scope:y,mutationFn:n=>t.updateMemorySettings({[e]:n}),onSuccess:e=>s.setQueryData(v,e),meta:{actionNotification:{successMessage:!1}}}),u=i(e===`enabled`?`personalization.enabled`:`personalization.external`),d=(l.isPending?l.variables:n?.[e])??!1;return(0,_.jsx)(c,{label:u,description:i(e===`enabled`?`personalization.enabledDescription`:`personalization.externalDescription`),children:(0,_.jsx)(h,{role:`switch`,"aria-label":u,"aria-checked":d,disabled:!n||l.isPending,className:`h-6 w-10 rounded-pill p-0.5 ${d?`bg-brand hover:bg-brand`:`bg-control-hover`}`,variant:`ghost`,type:`button`,onClick:()=>{l.mutate(!d)},children:(0,_.jsx)(`span`,{className:`block size-5 rounded-full bg-white transition-transform motion-reduce:transition-none ${d?`translate-x-2`:`-translate-x-2`}`})})})}var x=[`personalization`,`instructions`];function S({client:e,commitSettings:t}){let{t:n}=o(`settings`),S=r(),[C,w]=(0,g.useState)(null),[T,E]=(0,g.useState)(!1),D=i({queryKey:x,queryFn:()=>e.getGlobalInstructions(),refetchOnWindowFocus:!1}),O=i({queryKey:v,queryFn:()=>e.getMemorySettings()}),k=a({mutationFn:({content:t,expectedContent:n})=>e.saveGlobalInstructions(t,n),onSuccess:e=>{S.setQueryData(x,e),w(null),d(n(`personalization.saved`))},meta:{actionNotification:!1}}),A=a({scope:y,mutationFn:()=>e.resetMemories(),onSuccess:()=>{E(!1),d(n(`personalization.deleted`))},meta:{actionNotification:!1}}),j=C??D.data?.content??``,M=k.error!==null&&`code`in k.error&&k.error.code===`GLOBAL_INSTRUCTIONS_CHANGED`;return(0,_.jsxs)(`section`,{id:`settings-panel-personalization`,className:`space-y-8`,children:[(0,_.jsx)(`h1`,{className:`text-xl font-semibold`,children:n(`sections.personalization`)}),(0,_.jsxs)(`div`,{className:`space-y-3`,children:[(0,_.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,_.jsxs)(`div`,{className:`min-w-0`,children:[(0,_.jsx)(`label`,{className:`text-body font-semibold`,htmlFor:`codex-global-instructions`,children:n(`personalization.instructions`)}),(0,_.jsxs)(`p`,{className:`mt-1 text-body-small text-muted-foreground`,children:[n(`personalization.description`),D.data?(0,_.jsx)(`span`,{className:`block break-all`,children:n(`personalization.fileLocation`,{path:D.data.path})}):null]})]}),(0,_.jsx)(h,{type:`button`,variant:`secondary`,className:`shrink-0`,disabled:D.data===void 0||D.isFetching||k.isPending||j===D.data.content,onClick:()=>{D.data&&k.mutate({content:j,expectedContent:D.data.content})},children:n(k.isPending?`personalization.saving`:`personalization.save`)})]}),D.isError?(0,_.jsx)(`p`,{role:`alert`,className:`text-body-small text-danger`,children:n(`personalization.loadError`)}):null,D.isPending?(0,_.jsx)(`p`,{role:`status`,children:n(`loading`)}):null,(0,_.jsx)(`textarea`,{id:`codex-global-instructions`,className:`min-h-56 w-full resize-y rounded-control border border-separator bg-panel p-3 text-body-small focus:shadow-focus focus:outline-none`,spellCheck:!1,disabled:D.data===void 0||k.isPending||D.isFetching,value:j,onChange:e=>{w(e.currentTarget.value),k.reset()}}),D.data?.overrideActive?(0,_.jsx)(`p`,{className:`text-body-small text-muted-foreground`,children:n(`personalization.override`)}):null,k.isError?(0,_.jsx)(`p`,{role:`alert`,className:`text-body-small text-danger`,children:n(M?`personalization.conflict`:`personalization.saveError`)}):null,D.isError||M?(0,_.jsx)(h,{type:`button`,variant:`ghost`,disabled:D.isFetching,onClick:()=>{D.refetch().then(e=>{e.isSuccess&&(w(null),k.reset())})},children:n(`personalization.reload`)}):null]}),t,(0,_.jsxs)(`div`,{className:`space-y-3`,children:[(0,_.jsxs)(s,{title:n(`personalization.memories`),description:n(`personalization.memoryDescription`),children:[[`enabled`,`allowExternalContext`].map(t=>(0,_.jsx)(b,{field:t,client:e,settings:O.data},t)),(0,_.jsx)(c,{label:n(`personalization.remove`),description:n(`personalization.removeDescription`),children:(0,_.jsx)(h,{"aria-label":n(`personalization.remove`),className:`text-danger`,type:`button`,variant:`ghost`,disabled:A.isPending||!O.data,onClick:()=>{A.reset(),E(!0)},children:n(`personalization.remove`)})})]}),O.isError?(0,_.jsxs)(`div`,{role:`alert`,children:[(0,_.jsx)(`p`,{children:n(`personalization.loadError`)}),(0,_.jsx)(h,{variant:`ghost`,onClick:()=>void O.refetch(),children:n(`common:actions.retry`)})]}):null]}),(0,_.jsx)(u,{open:T,onOpenChange:e=>{A.isPending||E(e)},children:(0,_.jsxs)(l,{children:[(0,_.jsx)(p,{children:n(`personalization.remove`)}),(0,_.jsx)(f,{children:n(`personalization.confirmDescription`)}),A.isError?(0,_.jsx)(`p`,{role:`alert`,className:`text-danger`,children:n(`personalization.memoryError`)}):null,(0,_.jsxs)(m,{children:[(0,_.jsx)(h,{variant:`ghost`,disabled:A.isPending,onClick:()=>{E(!1)},children:n(`personalization.cancel`)}),(0,_.jsx)(h,{className:`text-danger`,variant:`secondary`,disabled:A.isPending,onClick:()=>{A.mutate()},children:n(A.isPending?`personalization.deleting`:`personalization.confirm`)})]})]})})]})}export{S as PersonalizationSettingsPanel};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-CNC7AqOf.js";import{i as t,t as n}from"./react-runtime-DaCTDC27.js";import{t as r}from"./project-source-panel-DGafRUDi.js";import{Lt as i}from"./index-DRfXjZ2a.js";var a=e(t(),1),o=n();function s({projectId:e,search:t}){let{client:n}=i(),s=t.path.split(/[\\/]/u).at(-1)??t.path;return(0,a.useEffect)(()=>{document.title=s},[s]),(0,o.jsx)(`main`,{className:`h-full min-h-0 bg-raised`,children:(0,o.jsx)(r,{client:n,onClose:()=>{window.close()},previewKind:t.previewKind,projectId:e,reference:{lineNumber:t.lineNumber,path:t.path},...t.rootPath===void 0?{}:{rootPath:t.rootPath}})})}export{s as ProjectFilePopupPage};
1
+ import{a as e}from"./rolldown-runtime-CNC7AqOf.js";import{i as t,t as n}from"./react-runtime-DaCTDC27.js";import{t as r}from"./project-source-panel-PKAa_dbo.js";import{Lt as i}from"./index-D9lOU2_n.js";var a=e(t(),1),o=n();function s({projectId:e,search:t}){let{client:n}=i(),s=t.path.split(/[\\/]/u).at(-1)??t.path;return(0,a.useEffect)(()=>{document.title=s},[s]),(0,o.jsx)(`main`,{className:`h-full min-h-0 bg-raised`,children:(0,o.jsx)(r,{client:n,onClose:()=>{window.close()},previewKind:t.previewKind,projectId:e,reference:{lineNumber:t.lineNumber,path:t.path},...t.rootPath===void 0?{}:{rootPath:t.rootPath}})})}export{s as ProjectFilePopupPage};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-CNC7AqOf.js";import{t}from"./react-runtime-DaCTDC27.js";import{t as n}from"./project-source-panel-DGafRUDi.js";import{$ as r,Q as i,rt as a}from"./index-DRfXjZ2a.js";var o=e({ProjectSourceDialog:()=>l}),s=t();function c(e){return e.split(/[\\/]/u).at(-1)??e}function l({client:e,onClose:t,onOpenDiff:o,previewKind:l,projectId:u,reference:d,rootPath:f}){let p=`project-source-dialog-title`;return(0,s.jsx)(i,{onOpenChange:e=>{e||t()},open:!0,children:(0,s.jsxs)(r,{"aria-labelledby":p,className:`h-[min(82dvh,54rem)] max-w-[72rem] overflow-hidden p-0`,children:[(0,s.jsx)(a,{className:`sr-only`,id:p,children:c(d.path)}),(0,s.jsx)(n,{client:e,onClose:t,...o===void 0?{}:{onOpenDiff:o},previewKind:l,projectId:u,reference:d,...f===void 0?{}:{rootPath:f}})]})})}export{o as n,l as t};
1
+ import{r as e}from"./rolldown-runtime-CNC7AqOf.js";import{t}from"./react-runtime-DaCTDC27.js";import{t as n}from"./project-source-panel-PKAa_dbo.js";import{$ as r,Q as i,rt as a}from"./index-D9lOU2_n.js";var o=e({ProjectSourceDialog:()=>l}),s=t();function c(e){return e.split(/[\\/]/u).at(-1)??e}function l({client:e,onClose:t,onOpenDiff:o,previewKind:l,projectId:u,reference:d,rootPath:f}){let p=`project-source-dialog-title`;return(0,s.jsx)(i,{onOpenChange:e=>{e||t()},open:!0,children:(0,s.jsxs)(r,{"aria-labelledby":p,className:`h-[min(82dvh,54rem)] max-w-[72rem] overflow-hidden p-0`,children:[(0,s.jsx)(a,{className:`sr-only`,id:p,children:c(d.path)}),(0,s.jsx)(n,{client:e,onClose:t,...o===void 0?{}:{onOpenDiff:o},previewKind:l,projectId:u,reference:d,...f===void 0?{}:{rootPath:f}})]})})}export{o as n,l as t};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-CNC7AqOf.js";import{i as t,t as n}from"./react-runtime-DaCTDC27.js";import{t as r}from"./initial-deps-CB2J2rjl.js";import{r as i}from"./initial-deps-DipJkDUX.js";import{M as a,et as o,it as s,s as c}from"./initial-deps-E80pA8LY.js";import{t as l}from"./file-code-corner-DrXDbEPu.js";import{H as u,U as d,W as f,vt as p}from"./index-DRfXjZ2a.js";import{t as m}from"./code-languages-DVcuYjhn.js";import{t as h}from"./lazy-message-response-B6dT9kbf.js";import{a as g,i as _,n as v,o as y,r as b,t as x}from"./code-block-C9eTeWWd.js";var S=o(`code-xml`,[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]]),C=o(`git-compare-arrows`,[[`circle`,{cx:`5`,cy:`6`,r:`3`,key:`1qnov2`}],[`path`,{d:`M12 6h5a2 2 0 0 1 2 2v7`,key:`1yj91y`}],[`path`,{d:`m15 9-3-3 3-3`,key:`1lwv8l`}],[`circle`,{cx:`19`,cy:`18`,r:`3`,key:`1qljk2`}],[`path`,{d:`M12 18H7a2 2 0 0 1-2-2V9`,key:`16sdep`}],[`path`,{d:`m9 15 3 3-3 3`,key:`1m3kbl`}]]),w=o(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),T=e(t(),1),E=`codexly:workbench:markdown-preview:v1`;function D(){try{return typeof window>`u`?void 0:window.localStorage}catch{return}}function O(e){if(e===void 0)return!1;try{let t=JSON.parse(e.getItem(E)??`null`);return A(t)?t.preview:!1}catch{return!1}}function k(e,t){if(t===void 0)return;let n={preview:e,version:1};try{t.setItem(E,JSON.stringify(n))}catch{}}function A(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.version===1&&typeof t.preview==`boolean`}var j=n();function M(e){return e.split(/[\\/]/u).at(-1)??e}function N({actions:e,lineNumber:t,onClose:n,onOpenDiff:r,previewKind:i,sourcePath:a,sourceStatus:o}){let{t:m}=s(`workbench`);return(0,j.jsxs)(g,{className:`min-h-toolbar gap-3 overflow-hidden bg-raised px-3 shadow-toolbar sm:px-4`,children:[(0,j.jsxs)(y,{className:`w-0 flex-1 overflow-hidden`,children:[i===`image`?(0,j.jsx)(w,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":`true`}):(0,j.jsx)(l,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,j.jsxs)(u,{children:[(0,j.jsx)(f,{asChild:!0,children:(0,j.jsxs)(`div`,{className:`w-0 flex-1 overflow-hidden`,children:[(0,j.jsx)(`h2`,{className:`truncate text-body-small font-semibold`,children:(0,j.jsxs)(_,{children:[M(a),t===null?null:` (line ${String(t)})`]})}),(0,j.jsx)(`p`,{className:`truncate text-caption text-muted-foreground`,children:a})]})}),(0,j.jsx)(d,{className:`break-all`,children:a})]})]}),o===null?null:(0,j.jsx)(`span`,{className:`shrink-0 text-label ${o===`error`?`text-danger`:`text-warning`}`,role:o===`error`?`alert`:`status`,children:m(o===`loading`?`projectDialog.loadingMoreSource`:o===`error`?`projectDialog.loadMoreSourceError`:`projectDialog.sourcePartial`)}),(0,j.jsxs)(v,{children:[r===void 0?null:(0,j.jsxs)(u,{children:[(0,j.jsx)(f,{asChild:!0,children:(0,j.jsx)(p,{"aria-label":m(`projectDialog.showDiff`),onClick:r,size:`icon-sm`,type:`button`,variant:`ghost`,children:(0,j.jsx)(C,{className:`size-3.5`,"aria-hidden":`true`})})}),(0,j.jsx)(d,{children:m(`projectDialog.showDiff`)})]}),e,n===void 0?null:(0,j.jsxs)(u,{children:[(0,j.jsx)(f,{asChild:!0,children:(0,j.jsx)(p,{"aria-label":m(i===`image`?`projectDialog.closeImagePreview`:`projectDialog.closeSource`),onClick:n,size:`icon-sm`,type:`button`,variant:`ghost`,children:(0,j.jsx)(c,{className:`size-3.5`,"aria-hidden":`true`})})}),(0,j.jsx)(d,{children:m(i===`image`?`projectDialog.closeImagePreview`:`projectDialog.closeSource`)})]})]})]})}var P=400;function F(e){return e.scrollHeight-e.scrollTop-e.clientHeight<=P}function I(e,t){return e.nextCursor===null||e.nextCursor===t?void 0:e.nextCursor}function L(e){let t=e[0],n=e.at(-1);if(!(t===void 0||n===void 0))return{content:e.map(e=>e.content).join(``),nextCursor:n.nextCursor,path:t.path}}function R({client:e,onClose:t,onOpenDiff:n,previewKind:o,projectId:c,reference:l,rootPath:g}){let{t:_}=s(`workbench`),v=(0,T.useRef)(null),[y,C]=(0,T.useState)(()=>O(D())),[w,E]=(0,T.useState)(!1),A=r({enabled:o===`source`,getNextPageParam:(e,t,n)=>I(e,n),initialPageParam:void 0,queryFn:async({pageParam:t,signal:n})=>e.readProjectSourceFile(c,g,l.path,t,{signal:n}),queryKey:[`projects`,c,g??null,`source-file`,l.path],staleTime:3e4}),P=A.data?.pages,R=A.fetchNextPage,z=A.hasNextPage,B=A.isFetchingNextPage,V=(0,T.useMemo)(()=>P===void 0?void 0:L(P),[P]),H=V?.path??l.path,U=V?.content??``,W=M(H),G=i(``,c,l.path,g),K=m(H),q=(K===`markdown`||K===`mdx`)&&V?.nextCursor===null,J=q&&y;(0,T.useEffect)(()=>{E(!1)},[o,l.path]),(0,T.useEffect)(()=>{let e=l.lineNumber;if(V===void 0||e===null||J)return;let t=v.current?.querySelector(`[data-code-line="${String(e)}"]`);if(t!=null){t.scrollIntoView({block:`center`});return}z&&!B&&R()},[R,z,B,l.lineNumber,V,J]);let Y=V===void 0?null:B?`loading`:A.isFetchNextPageError?`error`:z?`partial`:null,X={lineNumber:l.lineNumber,...t===void 0?{}:{onClose:t},...n===void 0?{}:{onOpenDiff:n},previewKind:o,sourcePath:H,sourceStatus:Y},Z=e=>{if(o!==`source`||!z||B)return;let t=e.target;!(t instanceof HTMLElement)||!F(t)||R()},Q=e=>{C(e),k(e,D())};return(0,j.jsx)(`section`,{"aria-label":H,className:`h-full min-h-0 bg-raised`,onScrollCapture:Z,ref:v,children:o===`image`?(0,j.jsxs)(`div`,{className:`grid h-full min-h-0 grid-rows-[auto_minmax(0,1fr)] bg-content`,children:[(0,j.jsx)(N,{...X}),(0,j.jsx)(`div`,{className:`grid min-h-0 place-items-center overflow-hidden p-4 sm:p-6`,children:w?(0,j.jsx)(`div`,{className:`text-body-small text-danger`,role:`alert`,children:_(`projectDialog.loadImageError`)}):(0,j.jsx)(`img`,{alt:W,className:`block size-full object-contain`,decoding:`async`,onError:()=>{E(!0)},src:G})})]}):V===void 0&&A.isPending?(0,j.jsxs)(`div`,{className:`grid h-full min-h-0 grid-rows-[auto_minmax(0,1fr)]`,children:[(0,j.jsx)(N,{...X}),(0,j.jsx)(`div`,{className:`grid min-h-48 place-items-center text-body-small text-muted-foreground`,role:`status`,children:_(`projectDialog.loadingSource`)})]}):V===void 0&&A.error!==null?(0,j.jsxs)(`div`,{className:`grid h-full min-h-0 grid-rows-[auto_minmax(0,1fr)]`,children:[(0,j.jsx)(N,{...X}),(0,j.jsx)(`div`,{className:`grid min-h-48 place-items-center text-body-small text-danger`,role:`alert`,children:_(`projectDialog.loadSourceError`)})]}):J?(0,j.jsxs)(`div`,{className:`grid h-full min-h-0 grid-rows-[auto_minmax(0,1fr)] bg-content`,children:[(0,j.jsx)(N,{...X,actions:(0,j.jsxs)(u,{children:[(0,j.jsx)(f,{asChild:!0,children:(0,j.jsx)(p,{"aria-label":_(`projectDialog.showRawContent`),onClick:()=>{Q(!1)},size:`icon-sm`,type:`button`,variant:`ghost`,children:(0,j.jsx)(S,{className:`size-3.5`,"aria-hidden":`true`})})}),(0,j.jsx)(d,{children:_(`projectDialog.showRawContent`)})]})}),(0,j.jsx)(`div`,{className:`min-h-0 overflow-auto px-5 py-4 sm:px-8 sm:py-6`,children:(0,j.jsx)(h,{className:`mx-auto max-w-4xl`,children:U})})]}):(0,j.jsx)(x,{className:`grid h-full min-h-0 grid-rows-[auto_minmax(0,1fr)] rounded-none bg-content shadow-none`,code:U,highlightedLine:l.lineNumber,language:K,showLineNumbers:!0,children:(0,j.jsx)(N,{...X,actions:(0,j.jsxs)(j.Fragment,{children:[q?(0,j.jsxs)(u,{children:[(0,j.jsx)(f,{asChild:!0,children:(0,j.jsx)(p,{"aria-label":_(`projectDialog.previewMarkdown`),onClick:()=>{Q(!0)},size:`icon-sm`,type:`button`,variant:`ghost`,children:(0,j.jsx)(a,{className:`size-3.5`,"aria-hidden":`true`})})}),(0,j.jsx)(d,{children:_(`projectDialog.previewMarkdown`)})]}):null,(0,j.jsx)(b,{})]})})})})}export{S as n,R as t};
1
+ import{a as e}from"./rolldown-runtime-CNC7AqOf.js";import{i as t,t as n}from"./react-runtime-DaCTDC27.js";import{t as r}from"./initial-deps-CB2J2rjl.js";import{r as i}from"./initial-deps-DipJkDUX.js";import{M as a,et as o,it as s,s as c}from"./initial-deps-E80pA8LY.js";import{t as l}from"./file-code-corner-DrXDbEPu.js";import{H as u,U as d,W as f,vt as p}from"./index-D9lOU2_n.js";import{t as m}from"./code-languages-DVcuYjhn.js";import{t as h}from"./lazy-message-response-C3PwDwxE.js";import{a as g,i as _,n as v,o as y,r as b,t as x}from"./code-block-CmzWecTa.js";var S=o(`code-xml`,[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]]),C=o(`git-compare-arrows`,[[`circle`,{cx:`5`,cy:`6`,r:`3`,key:`1qnov2`}],[`path`,{d:`M12 6h5a2 2 0 0 1 2 2v7`,key:`1yj91y`}],[`path`,{d:`m15 9-3-3 3-3`,key:`1lwv8l`}],[`circle`,{cx:`19`,cy:`18`,r:`3`,key:`1qljk2`}],[`path`,{d:`M12 18H7a2 2 0 0 1-2-2V9`,key:`16sdep`}],[`path`,{d:`m9 15 3 3-3 3`,key:`1m3kbl`}]]),w=o(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),T=e(t(),1),E=`codexly:workbench:markdown-preview:v1`;function D(){try{return typeof window>`u`?void 0:window.localStorage}catch{return}}function O(e){if(e===void 0)return!1;try{let t=JSON.parse(e.getItem(E)??`null`);return A(t)?t.preview:!1}catch{return!1}}function k(e,t){if(t===void 0)return;let n={preview:e,version:1};try{t.setItem(E,JSON.stringify(n))}catch{}}function A(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.version===1&&typeof t.preview==`boolean`}var j=n();function M(e){return e.split(/[\\/]/u).at(-1)??e}function N({actions:e,lineNumber:t,onClose:n,onOpenDiff:r,previewKind:i,sourcePath:a,sourceStatus:o}){let{t:m}=s(`workbench`);return(0,j.jsxs)(g,{className:`min-h-toolbar gap-3 overflow-hidden bg-raised px-3 shadow-toolbar sm:px-4`,children:[(0,j.jsxs)(y,{className:`w-0 flex-1 overflow-hidden`,children:[i===`image`?(0,j.jsx)(w,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":`true`}):(0,j.jsx)(l,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,j.jsxs)(u,{children:[(0,j.jsx)(f,{asChild:!0,children:(0,j.jsxs)(`div`,{className:`w-0 flex-1 overflow-hidden`,children:[(0,j.jsx)(`h2`,{className:`truncate text-body-small font-semibold`,children:(0,j.jsxs)(_,{children:[M(a),t===null?null:` (line ${String(t)})`]})}),(0,j.jsx)(`p`,{className:`truncate text-caption text-muted-foreground`,children:a})]})}),(0,j.jsx)(d,{className:`break-all`,children:a})]})]}),o===null?null:(0,j.jsx)(`span`,{className:`shrink-0 text-label ${o===`error`?`text-danger`:`text-warning`}`,role:o===`error`?`alert`:`status`,children:m(o===`loading`?`projectDialog.loadingMoreSource`:o===`error`?`projectDialog.loadMoreSourceError`:`projectDialog.sourcePartial`)}),(0,j.jsxs)(v,{children:[r===void 0?null:(0,j.jsxs)(u,{children:[(0,j.jsx)(f,{asChild:!0,children:(0,j.jsx)(p,{"aria-label":m(`projectDialog.showDiff`),onClick:r,size:`icon-sm`,type:`button`,variant:`ghost`,children:(0,j.jsx)(C,{className:`size-3.5`,"aria-hidden":`true`})})}),(0,j.jsx)(d,{children:m(`projectDialog.showDiff`)})]}),e,n===void 0?null:(0,j.jsxs)(u,{children:[(0,j.jsx)(f,{asChild:!0,children:(0,j.jsx)(p,{"aria-label":m(i===`image`?`projectDialog.closeImagePreview`:`projectDialog.closeSource`),onClick:n,size:`icon-sm`,type:`button`,variant:`ghost`,children:(0,j.jsx)(c,{className:`size-3.5`,"aria-hidden":`true`})})}),(0,j.jsx)(d,{children:m(i===`image`?`projectDialog.closeImagePreview`:`projectDialog.closeSource`)})]})]})]})}var P=400;function F(e){return e.scrollHeight-e.scrollTop-e.clientHeight<=P}function I(e,t){return e.nextCursor===null||e.nextCursor===t?void 0:e.nextCursor}function L(e){let t=e[0],n=e.at(-1);if(!(t===void 0||n===void 0))return{content:e.map(e=>e.content).join(``),nextCursor:n.nextCursor,path:t.path}}function R({client:e,onClose:t,onOpenDiff:n,previewKind:o,projectId:c,reference:l,rootPath:g}){let{t:_}=s(`workbench`),v=(0,T.useRef)(null),[y,C]=(0,T.useState)(()=>O(D())),[w,E]=(0,T.useState)(!1),A=r({enabled:o===`source`,getNextPageParam:(e,t,n)=>I(e,n),initialPageParam:void 0,queryFn:async({pageParam:t,signal:n})=>e.readProjectSourceFile(c,g,l.path,t,{signal:n}),queryKey:[`projects`,c,g??null,`source-file`,l.path],staleTime:3e4}),P=A.data?.pages,R=A.fetchNextPage,z=A.hasNextPage,B=A.isFetchingNextPage,V=(0,T.useMemo)(()=>P===void 0?void 0:L(P),[P]),H=V?.path??l.path,U=V?.content??``,W=M(H),G=i(``,c,l.path,g),K=m(H),q=(K===`markdown`||K===`mdx`)&&V?.nextCursor===null,J=q&&y;(0,T.useEffect)(()=>{E(!1)},[o,l.path]),(0,T.useEffect)(()=>{let e=l.lineNumber;if(V===void 0||e===null||J)return;let t=v.current?.querySelector(`[data-code-line="${String(e)}"]`);if(t!=null){t.scrollIntoView({block:`center`});return}z&&!B&&R()},[R,z,B,l.lineNumber,V,J]);let Y=V===void 0?null:B?`loading`:A.isFetchNextPageError?`error`:z?`partial`:null,X={lineNumber:l.lineNumber,...t===void 0?{}:{onClose:t},...n===void 0?{}:{onOpenDiff:n},previewKind:o,sourcePath:H,sourceStatus:Y},Z=e=>{if(o!==`source`||!z||B)return;let t=e.target;!(t instanceof HTMLElement)||!F(t)||R()},Q=e=>{C(e),k(e,D())};return(0,j.jsx)(`section`,{"aria-label":H,className:`h-full min-h-0 bg-raised`,onScrollCapture:Z,ref:v,children:o===`image`?(0,j.jsxs)(`div`,{className:`grid h-full min-h-0 grid-rows-[auto_minmax(0,1fr)] bg-content`,children:[(0,j.jsx)(N,{...X}),(0,j.jsx)(`div`,{className:`grid min-h-0 place-items-center overflow-hidden p-4 sm:p-6`,children:w?(0,j.jsx)(`div`,{className:`text-body-small text-danger`,role:`alert`,children:_(`projectDialog.loadImageError`)}):(0,j.jsx)(`img`,{alt:W,className:`block size-full object-contain`,decoding:`async`,onError:()=>{E(!0)},src:G})})]}):V===void 0&&A.isPending?(0,j.jsxs)(`div`,{className:`grid h-full min-h-0 grid-rows-[auto_minmax(0,1fr)]`,children:[(0,j.jsx)(N,{...X}),(0,j.jsx)(`div`,{className:`grid min-h-48 place-items-center text-body-small text-muted-foreground`,role:`status`,children:_(`projectDialog.loadingSource`)})]}):V===void 0&&A.error!==null?(0,j.jsxs)(`div`,{className:`grid h-full min-h-0 grid-rows-[auto_minmax(0,1fr)]`,children:[(0,j.jsx)(N,{...X}),(0,j.jsx)(`div`,{className:`grid min-h-48 place-items-center text-body-small text-danger`,role:`alert`,children:_(`projectDialog.loadSourceError`)})]}):J?(0,j.jsxs)(`div`,{className:`grid h-full min-h-0 grid-rows-[auto_minmax(0,1fr)] bg-content`,children:[(0,j.jsx)(N,{...X,actions:(0,j.jsxs)(u,{children:[(0,j.jsx)(f,{asChild:!0,children:(0,j.jsx)(p,{"aria-label":_(`projectDialog.showRawContent`),onClick:()=>{Q(!1)},size:`icon-sm`,type:`button`,variant:`ghost`,children:(0,j.jsx)(S,{className:`size-3.5`,"aria-hidden":`true`})})}),(0,j.jsx)(d,{children:_(`projectDialog.showRawContent`)})]})}),(0,j.jsx)(`div`,{className:`min-h-0 overflow-auto px-5 py-4 sm:px-8 sm:py-6`,children:(0,j.jsx)(h,{className:`mx-auto max-w-4xl`,children:U})})]}):(0,j.jsx)(x,{className:`grid h-full min-h-0 grid-rows-[auto_minmax(0,1fr)] rounded-none bg-content shadow-none`,code:U,highlightedLine:l.lineNumber,language:K,showLineNumbers:!0,children:(0,j.jsx)(N,{...X,actions:(0,j.jsxs)(j.Fragment,{children:[q?(0,j.jsxs)(u,{children:[(0,j.jsx)(f,{asChild:!0,children:(0,j.jsx)(p,{"aria-label":_(`projectDialog.previewMarkdown`),onClick:()=>{Q(!0)},size:`icon-sm`,type:`button`,variant:`ghost`,children:(0,j.jsx)(a,{className:`size-3.5`,"aria-hidden":`true`})})}),(0,j.jsx)(d,{children:_(`projectDialog.previewMarkdown`)})]}):null,(0,j.jsx)(b,{})]})})})})}export{S as n,R as t};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-CNC7AqOf.js";import{i as t,t as n}from"./react-runtime-DaCTDC27.js";import{u as r}from"./initial-deps-BM3gt1hz.js";import{it as i}from"./initial-deps-E80pA8LY.js";import{m as a}from"./prompt-input-controls-CLasQrSj.js";import"./index-DRfXjZ2a.js";var o=e(t(),1),s=n();function c(e,t,n){let r=0;for(let i=0;i<e.length;){let a=e.codePointAt(i);if(a===void 0)break;if(i+=a>65535?2:1,r+=1,r>t)return new File([e],n,{type:`text/plain`})}}function l(e,t){return t===void 0||t.trim()===``||t.split(`,`).some(t=>{let n=t.trim();return n.startsWith(`.`)?e.name.toLowerCase().endsWith(n.toLowerCase()):n.endsWith(`/*`)?e.type.startsWith(n.slice(0,-1)):e.type===n})}function u(e){e.previewUrl.startsWith(`blob:`)&&URL.revokeObjectURL(e.previewUrl)}function d({attachments:e,children:t,className:n=``,disabled:d=!1,fileAccept:f,globalDrop:p=!1,imageAccept:m,largePasteCharacterThreshold:h=1/0,maxFileTotalSize:g=1/0,maxFileSize:_=1/0,maxImageSize:v=1/0,maxImages:y=1/0,maxImageTotalSize:b=1/0,multiple:x=!1,onAttachmentsChange:S,onError:C,onPaste:w,onPasteCapture:T,onSubmit:E,pastedTextFileName:D=`Pasted text.txt`,resetKey:O,...k}){let{t:A}=i(`conversation`),[j,M]=(0,o.useState)([]),N=e??j,P=(0,o.useRef)(N),F=(0,o.useRef)(null),I=(0,o.useRef)(null),L=(0,o.useRef)(e!==void 0),R=(0,o.useRef)(O);P.current=N,L.current=e!==void 0;let z=(0,o.useCallback)(t=>{if(e!==void 0){S?.(t(e));return}M(e=>[...t(e)])},[e,S]),B=(0,o.useCallback)((e,t=!1)=>{z(n=>{if(d)return n;let i=[],a=n.filter(e=>e.kind===`image`).length,o=n.reduce((e,t)=>e+(t.kind===`image`?t.size:0),0),s=n.reduce((e,t)=>e+(t.kind===`image`?0:t.size),0);for(let n of e){let e=t?`text`:l(n,m)?`image`:`file`;if(!(e===`text`||(e===`image`?l(n,m):l(n,f)))){C?.({code:`invalid_file_type`,message:A(`agentComponents.invalidFileType`,{name:n.name})});continue}if(e!==`image`&&n.size>_){C?.({code:`file_too_large`,message:A(`agentComponents.fileTooLarge`,{name:n.name})});continue}if(e===`image`&&n.size>v){C?.({code:`file_too_large`,message:A(`agentComponents.fileTooLarge`,{name:n.name})});continue}if(e===`image`&&a>=y){C?.({code:`too_many_images`,message:A(`agentComponents.tooManyImages`,{count:y})});continue}if(e===`image`&&o+n.size>b){C?.({code:`total_size_exceeded`,message:A(`agentComponents.totalImageSizeExceeded`)});continue}if(e!==`image`&&s+n.size>g){C?.({code:`total_size_exceeded`,message:A(`agentComponents.totalAttachmentSizeExceeded`)});continue}if(i.push({file:n,id:r(),kind:e,mediaType:n.type,name:n.name,previewUrl:URL.createObjectURL(n),size:n.size,source:`browser`}),e===`image`?(a+=1,o+=n.size):s+=n.size,!x)break}return[...n,...i]})},[d,f,m,_,g,v,y,b,x,C,A,z]),V=(0,o.useCallback)(()=>{z(e=>(e.forEach(u),[]))},[z]),H=(0,o.useCallback)(e=>{(e===`image`?I:F).current?.click()},[]);(0,o.useLayoutEffect)(()=>{R.current!==O&&(R.current=O,e===void 0&&V())},[e,V,O]);let U=(0,o.useCallback)(e=>{z(t=>{let n=t.find(t=>t.id===e);return n!==void 0&&u(n),t.filter(t=>t.id!==e)})},[z]);(0,o.useEffect)(()=>()=>{L.current||P.current.forEach(u)},[]),(0,o.useEffect)(()=>{e===void 0&&S?.(j)},[e,j,S]),(0,o.useEffect)(()=>{if(!p||d)return;let e=e=>{e.dataTransfer?.types.includes(`Files`)===!0&&e.preventDefault()},t=e=>{e.dataTransfer?.files.length&&(e.preventDefault(),B([...e.dataTransfer.files]))};return document.addEventListener(`dragover`,e),document.addEventListener(`drop`,t),()=>{document.removeEventListener(`dragover`,e),document.removeEventListener(`drop`,t)}},[B,d,p]);let W=(0,o.useMemo)(()=>({clear:V,disabled:d,files:N,openFilePicker:H,remove:U}),[V,d,N,H,U]),G=e=>{let t=e.files;t!==null&&t.length>0&&B([...t]),e.value=``};return(0,s.jsx)(a.Provider,{value:W,children:(0,s.jsxs)(`form`,{...k,className:`overflow-visible rounded-surface border border-transparent bg-raised shadow-floating transition-[border-color,box-shadow] focus-within:border-brand focus-within:shadow-focus ${n}`,"data-prompt-input":``,onPasteCapture:e=>{if(T?.(e),d||e.defaultPrevented||e.clipboardData.files.length>0)return;let t=c(e.clipboardData.getData(`text/plain`),h,D);t!==void 0&&(e.preventDefault(),B([t],!0))},onPaste:e=>{if(w?.(e),d||e.defaultPrevented)return;let t=[...e.clipboardData.files];t.length>0&&(e.preventDefault(),B(t))},onSubmit:e=>{e.preventDefault();let t=new FormData(e.currentTarget).get(`message`);E?.({files:N,text:typeof t==`string`?t:``},e)},children:[(0,s.jsx)(`input`,{...f===void 0?{}:{accept:f},"data-prompt-input-picker":`file`,disabled:d,hidden:!0,multiple:x,onChange:e=>{G(e.currentTarget)},ref:F,type:`file`}),(0,s.jsx)(`input`,{...m===void 0?{}:{accept:m},"data-prompt-input-picker":`image`,disabled:d,hidden:!0,multiple:x,onChange:e=>{G(e.currentTarget)},ref:I,type:`file`}),t]})})}export{d as t};
1
+ import{a as e}from"./rolldown-runtime-CNC7AqOf.js";import{i as t,t as n}from"./react-runtime-DaCTDC27.js";import{u as r}from"./initial-deps-BM3gt1hz.js";import{it as i}from"./initial-deps-E80pA8LY.js";import{m as a}from"./prompt-input-controls-D4wqb_zQ.js";import"./index-D9lOU2_n.js";var o=e(t(),1),s=n();function c(e,t,n){let r=0;for(let i=0;i<e.length;){let a=e.codePointAt(i);if(a===void 0)break;if(i+=a>65535?2:1,r+=1,r>t)return new File([e],n,{type:`text/plain`})}}function l(e,t){return t===void 0||t.trim()===``||t.split(`,`).some(t=>{let n=t.trim();return n.startsWith(`.`)?e.name.toLowerCase().endsWith(n.toLowerCase()):n.endsWith(`/*`)?e.type.startsWith(n.slice(0,-1)):e.type===n})}function u(e){e.previewUrl.startsWith(`blob:`)&&URL.revokeObjectURL(e.previewUrl)}function d({attachments:e,children:t,className:n=``,disabled:d=!1,fileAccept:f,globalDrop:p=!1,imageAccept:m,largePasteCharacterThreshold:h=1/0,maxFileTotalSize:g=1/0,maxFileSize:_=1/0,maxImageSize:v=1/0,maxImages:y=1/0,maxImageTotalSize:b=1/0,multiple:x=!1,onAttachmentsChange:S,onError:C,onPaste:w,onPasteCapture:T,onSubmit:E,pastedTextFileName:D=`Pasted text.txt`,resetKey:O,...k}){let{t:A}=i(`conversation`),[j,M]=(0,o.useState)([]),N=e??j,P=(0,o.useRef)(N),F=(0,o.useRef)(null),I=(0,o.useRef)(null),L=(0,o.useRef)(e!==void 0),R=(0,o.useRef)(O);P.current=N,L.current=e!==void 0;let z=(0,o.useCallback)(t=>{if(e!==void 0){S?.(t(e));return}M(e=>[...t(e)])},[e,S]),B=(0,o.useCallback)((e,t=!1)=>{z(n=>{if(d)return n;let i=[],a=n.filter(e=>e.kind===`image`).length,o=n.reduce((e,t)=>e+(t.kind===`image`?t.size:0),0),s=n.reduce((e,t)=>e+(t.kind===`image`?0:t.size),0);for(let n of e){let e=t?`text`:l(n,m)?`image`:`file`;if(!(e===`text`||(e===`image`?l(n,m):l(n,f)))){C?.({code:`invalid_file_type`,message:A(`agentComponents.invalidFileType`,{name:n.name})});continue}if(e!==`image`&&n.size>_){C?.({code:`file_too_large`,message:A(`agentComponents.fileTooLarge`,{name:n.name})});continue}if(e===`image`&&n.size>v){C?.({code:`file_too_large`,message:A(`agentComponents.fileTooLarge`,{name:n.name})});continue}if(e===`image`&&a>=y){C?.({code:`too_many_images`,message:A(`agentComponents.tooManyImages`,{count:y})});continue}if(e===`image`&&o+n.size>b){C?.({code:`total_size_exceeded`,message:A(`agentComponents.totalImageSizeExceeded`)});continue}if(e!==`image`&&s+n.size>g){C?.({code:`total_size_exceeded`,message:A(`agentComponents.totalAttachmentSizeExceeded`)});continue}if(i.push({file:n,id:r(),kind:e,mediaType:n.type,name:n.name,previewUrl:URL.createObjectURL(n),size:n.size,source:`browser`}),e===`image`?(a+=1,o+=n.size):s+=n.size,!x)break}return[...n,...i]})},[d,f,m,_,g,v,y,b,x,C,A,z]),V=(0,o.useCallback)(()=>{z(e=>(e.forEach(u),[]))},[z]),H=(0,o.useCallback)(e=>{(e===`image`?I:F).current?.click()},[]);(0,o.useLayoutEffect)(()=>{R.current!==O&&(R.current=O,e===void 0&&V())},[e,V,O]);let U=(0,o.useCallback)(e=>{z(t=>{let n=t.find(t=>t.id===e);return n!==void 0&&u(n),t.filter(t=>t.id!==e)})},[z]);(0,o.useEffect)(()=>()=>{L.current||P.current.forEach(u)},[]),(0,o.useEffect)(()=>{e===void 0&&S?.(j)},[e,j,S]),(0,o.useEffect)(()=>{if(!p||d)return;let e=e=>{e.dataTransfer?.types.includes(`Files`)===!0&&e.preventDefault()},t=e=>{e.dataTransfer?.files.length&&(e.preventDefault(),B([...e.dataTransfer.files]))};return document.addEventListener(`dragover`,e),document.addEventListener(`drop`,t),()=>{document.removeEventListener(`dragover`,e),document.removeEventListener(`drop`,t)}},[B,d,p]);let W=(0,o.useMemo)(()=>({clear:V,disabled:d,files:N,openFilePicker:H,remove:U}),[V,d,N,H,U]),G=e=>{let t=e.files;t!==null&&t.length>0&&B([...t]),e.value=``};return(0,s.jsx)(a.Provider,{value:W,children:(0,s.jsxs)(`form`,{...k,className:`overflow-visible rounded-surface border border-transparent bg-raised shadow-floating transition-[border-color,box-shadow] focus-within:border-brand focus-within:shadow-focus ${n}`,"data-prompt-input":``,onPasteCapture:e=>{if(T?.(e),d||e.defaultPrevented||e.clipboardData.files.length>0)return;let t=c(e.clipboardData.getData(`text/plain`),h,D);t!==void 0&&(e.preventDefault(),B([t],!0))},onPaste:e=>{if(w?.(e),d||e.defaultPrevented)return;let t=[...e.clipboardData.files];t.length>0&&(e.preventDefault(),B(t))},onSubmit:e=>{e.preventDefault();let t=new FormData(e.currentTarget).get(`message`);E?.({files:N,text:typeof t==`string`?t:``},e)},children:[(0,s.jsx)(`input`,{...f===void 0?{}:{accept:f},"data-prompt-input-picker":`file`,disabled:d,hidden:!0,multiple:x,onChange:e=>{G(e.currentTarget)},ref:F,type:`file`}),(0,s.jsx)(`input`,{...m===void 0?{}:{accept:m},"data-prompt-input-picker":`image`,disabled:d,hidden:!0,multiple:x,onChange:e=>{G(e.currentTarget)},ref:I,type:`file`}),t]})})}export{d as t};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-CNC7AqOf.js";import{i as t,t as n}from"./react-runtime-DaCTDC27.js";import{E as r,Y as i,et as a,it as o,v as s}from"./initial-deps-E80pA8LY.js";import{vt as c}from"./index-DRfXjZ2a.js";var l=a(`file-plus-corner`,[[`path`,{d:`M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35`,key:`17jvcc`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M14 19h6`,key:`bvotb8`}],[`path`,{d:`M17 16v6`,key:`18yu1i`}]]),u=a(`image-plus`,[[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5`,key:`1ue2ih`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]),d=a(`paperclip`,[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]),f=a(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),p=e(t(),1);function m(e){return e.isComposing||e.keyCode===229}function h(e){return e.key===`Enter`&&(e.shiftKey||e.metaKey||e.ctrlKey)}var g=(0,p.createContext)(void 0);function _(){let e=(0,p.useContext)(g);if(e===void 0)throw Error(`usePromptInputAttachments must be used inside PromptInput`);return e}var v=n();function y({className:e=``,...t}){return(0,v.jsx)(`div`,{className:`overflow-hidden rounded-surface border border-separator-strong bg-raised shadow-floating ${e}`,"data-prompt-input-command":``,role:`listbox`,...t})}function b({className:e=``,...t}){return(0,v.jsx)(`div`,{className:`max-h-96 overflow-y-auto p-1 ${e}`,"data-prompt-input-command-list":``,...t})}function x({children:e,className:t=``,label:n,...r}){return(0,v.jsxs)(`div`,{"aria-label":n,className:t,role:`group`,...r,children:[(0,v.jsx)(`div`,{className:`px-2 py-1.5 text-caption font-medium text-muted-foreground`,children:n}),e]})}function S({active:e=!1,className:t=``,onMouseDown:n,selected:r=!1,type:i=`button`,...a}){let o=(0,p.useRef)(null);return(0,p.useEffect)(()=>{e&&o.current?.scrollIntoView({block:`nearest`})},[e]),(0,v.jsx)(c,{variant:`ghost`,"aria-selected":r,className:`flex h-auto min-h-8 w-full items-center gap-2 whitespace-normal rounded-control px-2 py-2 text-left text-body-small text-foreground transition-colors hover:bg-control-hover disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent ${e?`bg-control-active`:``} ${t}`,"data-active":e||void 0,onMouseDown:e=>{e.preventDefault(),n?.(e)},ref:o,role:`option`,type:i,...a})}function C({className:e=``,...t}){return(0,v.jsx)(`div`,{className:`px-3 py-5 text-center text-body-small text-muted-foreground ${e}`,role:`status`,...t})}function w({className:e=``,...t}){return(0,v.jsx)(`div`,{className:`px-3 pt-2 ${e}`,...t})}function T({className:e=``,...t}){return(0,v.jsx)(`div`,{className:`px-3 pt-2 ${e}`,...t})}function E({className:e=``,...t}){return(0,v.jsx)(`div`,{className:`flex min-h-10 items-center justify-between gap-2 px-2 pb-2 ${e}`,...t})}function D({className:e=``,...t}){return(0,v.jsx)(`div`,{className:`flex min-w-0 items-center gap-1 ${e}`,...t})}(0,p.forwardRef)(function({className:e=``,name:t=`message`,onKeyDown:n,rows:r=2,...i},a){return(0,v.jsx)(`textarea`,{className:`max-h-40 min-h-12 w-full resize-none bg-transparent px-1 py-1 text-sm leading-5 text-foreground outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed ${e}`,name:t,onKeyDown:e=>{n?.(e),!e.defaultPrevented&&e.key===`Enter`&&!h(e)&&!m(e.nativeEvent)&&(e.preventDefault(),e.currentTarget.form?.requestSubmit())},ref:a,rows:r,...i})});function O({label:e,onSelect:t,separated:n=!1,showHeading:r=!0}){let{t:i}=o(`conversation`);return(0,v.jsxs)(`div`,{"aria-label":e,className:n?`mt-1 border-t border-separator pt-1`:void 0,role:`group`,children:[r?(0,v.jsx)(`p`,{className:`px-2 pb-1 pt-1 text-caption text-muted-foreground`,children:e}):null,(0,v.jsxs)(c,{variant:`ghost`,className:`flex h-8 w-full items-center gap-2 rounded-control px-2 text-label text-foreground hover:bg-control-hover`,contentAlign:`start`,onClick:()=>{t(`image`)},role:`menuitem`,type:`button`,children:[(0,v.jsx)(u,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`}),i(`agentComponents.addImage`)]}),(0,v.jsxs)(c,{variant:`ghost`,className:`flex h-8 w-full items-center gap-2 rounded-control px-2 text-label text-foreground hover:bg-control-hover`,contentAlign:`start`,onClick:()=>{t(`file`)},role:`menuitem`,type:`button`,children:[(0,v.jsx)(l,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`}),i(`agentComponents.addFile`)]})]})}function k({children:e,label:t,onClick:n,onSelectKind:r,showDeploymentHost:i=!1,...a}){let s=_(),{t:c}=o(`conversation`),[l,u]=(0,p.useState)(!1),f=(0,p.useRef)(null),m=a.disabled===!0||s.disabled,h=t??c(`agentComponents.addImageOrFile`);return(0,p.useEffect)(()=>{if(!l)return;let e=e=>{f.current?.contains(e.target)||u(!1)},t=e=>{e.key===`Escape`&&u(!1)};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[l]),(0,v.jsxs)(`div`,{className:`relative`,ref:f,children:[(0,v.jsx)(A,{...a,"aria-expanded":l,"aria-haspopup":`menu`,"aria-label":h,disabled:m,onClick:e=>{n?.(e),e.defaultPrevented||u(e=>!e)},title:h,children:e??(0,v.jsx)(d,{"aria-hidden":`true`,className:`size-3.5`})}),(0,v.jsxs)(`div`,{className:`absolute bottom-9 left-0 z-50 min-w-40 rounded-control border border-separator-strong bg-raised p-1 shadow-floating`,"data-floating-surface":!0,hidden:!l,role:`menu`,children:[(0,v.jsx)(O,{label:c(`agentComponents.currentDevice`),onSelect:e=>{u(!1),s.openFilePicker(e)},showHeading:i}),i?(0,v.jsx)(O,{label:c(`agentComponents.deploymentHost`),onSelect:e=>{u(!1),r(e)},separated:!0}):null]})]})}function A({children:e,className:t=``,type:n=`button`,...r}){return(0,v.jsx)(c,{className:`max-workbench:min-w-11 ${t}`,size:`sm`,type:n,variant:`ghost`,...r,children:e??(0,v.jsx)(s,{className:`size-3.5`,"aria-hidden":`true`})})}function j({className:e=``,...t}){return(0,v.jsx)(`select`,{className:`h-7 w-auto max-w-40 appearance-none rounded-control border-0 bg-transparent px-1.5 text-label text-muted-foreground outline-none [field-sizing:content] hover:bg-control-hover disabled:cursor-not-allowed disabled:opacity-45 max-workbench:h-11 ${e}`,...t})}function M({children:e,className:t=``,status:n,type:a=`submit`,...o}){let s=n===`reconnecting`||n===`submitting`;return(0,v.jsx)(c,{className:t,size:`icon-compact`,type:a,variant:`inverse`,...o,children:e??(n===`running`?(0,v.jsx)(f,{className:`size-3.5 fill-current`,"aria-hidden":`true`}):s?(0,v.jsx)(r,{className:`size-4 animate-spin`,"aria-hidden":`true`}):(0,v.jsx)(i,{className:`size-4`,"aria-hidden":`true`}))})}export{_,C as a,u as b,b as c,j as d,M as f,h as g,m as h,y as i,E as l,g as m,w as n,x as o,D as p,A as r,S as s,k as t,T as u,f as v,l as x,d as y};
1
+ import{a as e}from"./rolldown-runtime-CNC7AqOf.js";import{i as t,t as n}from"./react-runtime-DaCTDC27.js";import{E as r,Y as i,et as a,it as o,v as s}from"./initial-deps-E80pA8LY.js";import{vt as c}from"./index-D9lOU2_n.js";var l=a(`file-plus-corner`,[[`path`,{d:`M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35`,key:`17jvcc`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M14 19h6`,key:`bvotb8`}],[`path`,{d:`M17 16v6`,key:`18yu1i`}]]),u=a(`image-plus`,[[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5`,key:`1ue2ih`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]),d=a(`paperclip`,[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]),f=a(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),p=e(t(),1);function m(e){return e.isComposing||e.keyCode===229}function h(e){return e.key===`Enter`&&(e.shiftKey||e.metaKey||e.ctrlKey)}var g=(0,p.createContext)(void 0);function _(){let e=(0,p.useContext)(g);if(e===void 0)throw Error(`usePromptInputAttachments must be used inside PromptInput`);return e}var v=n();function y({className:e=``,...t}){return(0,v.jsx)(`div`,{className:`overflow-hidden rounded-surface border border-separator-strong bg-raised shadow-floating ${e}`,"data-prompt-input-command":``,role:`listbox`,...t})}function b({className:e=``,...t}){return(0,v.jsx)(`div`,{className:`max-h-96 overflow-y-auto p-1 ${e}`,"data-prompt-input-command-list":``,...t})}function x({children:e,className:t=``,label:n,...r}){return(0,v.jsxs)(`div`,{"aria-label":n,className:t,role:`group`,...r,children:[(0,v.jsx)(`div`,{className:`px-2 py-1.5 text-caption font-medium text-muted-foreground`,children:n}),e]})}function S({active:e=!1,className:t=``,onMouseDown:n,selected:r=!1,type:i=`button`,...a}){let o=(0,p.useRef)(null);return(0,p.useEffect)(()=>{e&&o.current?.scrollIntoView({block:`nearest`})},[e]),(0,v.jsx)(c,{variant:`ghost`,"aria-selected":r,className:`flex h-auto min-h-8 w-full items-center gap-2 whitespace-normal rounded-control px-2 py-2 text-left text-body-small text-foreground transition-colors hover:bg-control-hover disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent ${e?`bg-control-active`:``} ${t}`,"data-active":e||void 0,onMouseDown:e=>{e.preventDefault(),n?.(e)},ref:o,role:`option`,type:i,...a})}function C({className:e=``,...t}){return(0,v.jsx)(`div`,{className:`px-3 py-5 text-center text-body-small text-muted-foreground ${e}`,role:`status`,...t})}function w({className:e=``,...t}){return(0,v.jsx)(`div`,{className:`px-3 pt-2 ${e}`,...t})}function T({className:e=``,...t}){return(0,v.jsx)(`div`,{className:`px-3 pt-2 ${e}`,...t})}function E({className:e=``,...t}){return(0,v.jsx)(`div`,{className:`flex min-h-10 items-center justify-between gap-2 px-2 pb-2 ${e}`,...t})}function D({className:e=``,...t}){return(0,v.jsx)(`div`,{className:`flex min-w-0 items-center gap-1 ${e}`,...t})}(0,p.forwardRef)(function({className:e=``,name:t=`message`,onKeyDown:n,rows:r=2,...i},a){return(0,v.jsx)(`textarea`,{className:`max-h-40 min-h-12 w-full resize-none bg-transparent px-1 py-1 text-sm leading-5 text-foreground outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed ${e}`,name:t,onKeyDown:e=>{n?.(e),!e.defaultPrevented&&e.key===`Enter`&&!h(e)&&!m(e.nativeEvent)&&(e.preventDefault(),e.currentTarget.form?.requestSubmit())},ref:a,rows:r,...i})});function O({label:e,onSelect:t,separated:n=!1,showHeading:r=!0}){let{t:i}=o(`conversation`);return(0,v.jsxs)(`div`,{"aria-label":e,className:n?`mt-1 border-t border-separator pt-1`:void 0,role:`group`,children:[r?(0,v.jsx)(`p`,{className:`px-2 pb-1 pt-1 text-caption text-muted-foreground`,children:e}):null,(0,v.jsxs)(c,{variant:`ghost`,className:`flex h-8 w-full items-center gap-2 rounded-control px-2 text-label text-foreground hover:bg-control-hover`,contentAlign:`start`,onClick:()=>{t(`image`)},role:`menuitem`,type:`button`,children:[(0,v.jsx)(u,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`}),i(`agentComponents.addImage`)]}),(0,v.jsxs)(c,{variant:`ghost`,className:`flex h-8 w-full items-center gap-2 rounded-control px-2 text-label text-foreground hover:bg-control-hover`,contentAlign:`start`,onClick:()=>{t(`file`)},role:`menuitem`,type:`button`,children:[(0,v.jsx)(l,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`}),i(`agentComponents.addFile`)]})]})}function k({children:e,label:t,onClick:n,onSelectKind:r,showDeploymentHost:i=!1,...a}){let s=_(),{t:c}=o(`conversation`),[l,u]=(0,p.useState)(!1),f=(0,p.useRef)(null),m=a.disabled===!0||s.disabled,h=t??c(`agentComponents.addImageOrFile`);return(0,p.useEffect)(()=>{if(!l)return;let e=e=>{f.current?.contains(e.target)||u(!1)},t=e=>{e.key===`Escape`&&u(!1)};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[l]),(0,v.jsxs)(`div`,{className:`relative`,ref:f,children:[(0,v.jsx)(A,{...a,"aria-expanded":l,"aria-haspopup":`menu`,"aria-label":h,disabled:m,onClick:e=>{n?.(e),e.defaultPrevented||u(e=>!e)},title:h,children:e??(0,v.jsx)(d,{"aria-hidden":`true`,className:`size-3.5`})}),(0,v.jsxs)(`div`,{className:`absolute bottom-9 left-0 z-50 min-w-40 rounded-control border border-separator-strong bg-raised p-1 shadow-floating`,"data-floating-surface":!0,hidden:!l,role:`menu`,children:[(0,v.jsx)(O,{label:c(`agentComponents.currentDevice`),onSelect:e=>{u(!1),s.openFilePicker(e)},showHeading:i}),i?(0,v.jsx)(O,{label:c(`agentComponents.deploymentHost`),onSelect:e=>{u(!1),r(e)},separated:!0}):null]})]})}function A({children:e,className:t=``,type:n=`button`,...r}){return(0,v.jsx)(c,{className:`max-workbench:min-w-11 ${t}`,size:`sm`,type:n,variant:`ghost`,...r,children:e??(0,v.jsx)(s,{className:`size-3.5`,"aria-hidden":`true`})})}function j({className:e=``,...t}){return(0,v.jsx)(`select`,{className:`h-7 w-auto max-w-40 appearance-none rounded-control border-0 bg-transparent px-1.5 text-label text-muted-foreground outline-none [field-sizing:content] hover:bg-control-hover disabled:cursor-not-allowed disabled:opacity-45 max-workbench:h-11 ${e}`,...t})}function M({children:e,className:t=``,status:n,type:a=`submit`,...o}){let s=n===`reconnecting`||n===`submitting`;return(0,v.jsx)(c,{className:t,size:`icon-compact`,type:a,variant:`inverse`,...o,children:e??(n===`running`?(0,v.jsx)(f,{className:`size-3.5 fill-current`,"aria-hidden":`true`}):s?(0,v.jsx)(r,{className:`size-4 animate-spin`,"aria-hidden":`true`}):(0,v.jsx)(i,{className:`size-4`,"aria-hidden":`true`}))})}export{_,C as a,u as b,b as c,j as d,M as f,h as g,m as h,y as i,E as l,g as m,w as n,x as o,D as p,A as r,S as s,k as t,T as u,f as v,l as x,d as y};