@yuriai/web 0.3.8-beta.15 → 0.3.8-beta.16

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 (200) hide show
  1. package/dist/assets/{AgentAvatar-C4XFt_M4.js → AgentAvatar-DrZGU5TL.js} +1 -1
  2. package/dist/assets/{AgentSelector-DFqp1Q2Q.js → AgentSelector-D6x-93xO.js} +1 -1
  3. package/dist/assets/ArchivedSessionsDialog-C-Q7IKD0.js +1 -0
  4. package/dist/assets/AssistantConversationSurface-C9S2c33z.css +1 -0
  5. package/dist/assets/AssistantConversationSurface-DNOnoTTE.js +3 -0
  6. package/dist/assets/{AssistantSessionCard-wXwTXd6g.js → AssistantSessionCard-B2nmiy2w.js} +2 -2
  7. package/dist/assets/{AssistantUnreadBadge-CRZj3x7N.js → AssistantUnreadBadge-CAgjtCiJ.js} +1 -1
  8. package/dist/assets/{AssistantView-8q0gHHJe.js → AssistantView-yJTsJbIU.js} +1 -1
  9. package/dist/assets/{AssistantWorkingAvatar-CThUPwlO.js → AssistantWorkingAvatar-C5PFB26I.js} +1 -1
  10. package/dist/assets/{AssistantsSettingsPage-CmXi5ewY.js → AssistantsSettingsPage-Cw2GK4ku.js} +1 -1
  11. package/dist/assets/{BinaryFileFallback-Bn0tjFbw.js → BinaryFileFallback-BGku68Il.js} +1 -1
  12. package/dist/assets/{BtwPanel-CCv9Gg5U.js → BtwPanel-CM97m0W-.js} +1 -1
  13. package/dist/assets/{BusyDots-5AETCd_5.js → BusyDots-BfwpONQS.js} +1 -1
  14. package/dist/assets/{ChatContainer-DMSRIrld.js → ChatContainer-uZMwglI2.js} +4 -4
  15. package/dist/assets/{ChatView-C3Vy8API.js → ChatView-CMjNZnr2.js} +1 -1
  16. package/dist/assets/{DiagramView-D45FAF9q.js → DiagramView-B8KyrEfz.js} +1 -1
  17. package/dist/assets/{DiffView-DuzaQqt9.js → DiffView-DpmXkaMB.js} +1 -1
  18. package/dist/assets/{DiffViewToggle-BtXeYhd3.js → DiffViewToggle-C2OUNYuF.js} +1 -1
  19. package/dist/assets/{ErrorBoundary-CxfZ99MU.js → ErrorBoundary-DPRw2Hb8.js} +1 -1
  20. package/dist/assets/{FadeInOnReveal-DexeWpfu.js → FadeInOnReveal-CbsnPxv2.js} +1 -1
  21. package/dist/assets/{GuiPluginMount-CI9pNDXR.js → GuiPluginMount-a0GlByhj.js} +1 -1
  22. package/dist/assets/{GuiPluginPage-VUfpOHJt.js → GuiPluginPage-CWIqxrTF.js} +1 -1
  23. package/dist/assets/{GuiPluginSurface-CJd_xOQi.js → GuiPluginSurface-CEJE7Jej.js} +1 -1
  24. package/dist/assets/{GuiPluginTitlebarItems-DtTmeb9T.js → GuiPluginTitlebarItems-DzUKXkjc.js} +1 -1
  25. package/dist/assets/{GuiPluginWindow-CxQ9iXB5.js → GuiPluginWindow-D-YAzycZ.js} +1 -1
  26. package/dist/assets/{Icon-DzOoxSwi.js → Icon-BUHzyKnj.js} +1 -1
  27. package/dist/assets/{ImageLoadingPlaceholder-1vl5daoR.js → ImageLoadingPlaceholder-C-g4U5hR.js} +1 -1
  28. package/dist/assets/{LoadingImage-DZ7p5FPK.js → LoadingImage-B0wwLqli.js} +1 -1
  29. package/dist/assets/{MarkdownRenderer-CSJiFWD9.js → MarkdownRenderer-Cr-3HunB.js} +2 -2
  30. package/dist/assets/{MarkdownRendererImpl-C9G_bN4T.js → MarkdownRendererImpl-DnWMM_aX.js} +1 -1
  31. package/dist/assets/{MarkstreamRendererImpl-DxYYBHex.js → MarkstreamRendererImpl-DpY69J2T.js} +1 -1
  32. package/dist/assets/{MobileAssistantSettingsPage-Dni0M0yT.js → MobileAssistantSettingsPage-BDvEr-7Z.js} +1 -1
  33. package/dist/assets/{MobileAssistantTab-D-nQUU4Z.js → MobileAssistantTab-Cko8n9EA.js} +1 -1
  34. package/dist/assets/{MobileBtwPage-_TyqZN04.js → MobileBtwPage-DvXj1534.js} +1 -1
  35. package/dist/assets/{MobileChangesSurface-WG9TeDgt.js → MobileChangesSurface-Bs91NGZz.js} +1 -1
  36. package/dist/assets/{MobileChatScreen-DxJS1Q7i.js → MobileChatScreen-BCwCAJoA.js} +1 -1
  37. package/dist/assets/{MobileDetailNavigation-MpDIB9fS.js → MobileDetailNavigation-Bgns21JD.js} +1 -1
  38. package/dist/assets/{MobileFilesSurface-j9wqAq5D.js → MobileFilesSurface-CKnb4sMb.js} +2 -2
  39. package/dist/assets/{MobileHtmlNetworkBoundary-Cn1oaJPw.js → MobileHtmlNetworkBoundary-uqjb6Mla.js} +2 -2
  40. package/dist/assets/{MobileOverlayPanel-DargINqb.js → MobileOverlayPanel-DiSPQ_Ds.js} +1 -1
  41. package/dist/assets/{MobileResizableSheet-BP5f0TbE.js → MobileResizableSheet-CTVXT44f.js} +1 -1
  42. package/dist/assets/{MobileSettingsTab-Cyw95F7x.js → MobileSettingsTab-BX9NpdML.js} +1 -1
  43. package/dist/assets/{MobileShareBridge-CrtV4RjV.js → MobileShareBridge-XOWIghHm.js} +1 -1
  44. package/dist/assets/{MobileSurface-wpS174pv.js → MobileSurface-CSgwDfWV.js} +1 -1
  45. package/dist/assets/{MobileTabPageHeader-E8ZU0uzl.js → MobileTabPageHeader-BhCUjFE_.js} +1 -1
  46. package/dist/assets/{ModelLogo-sKWRbEu8.js → ModelLogo-NNl7OHLT.js} +1 -1
  47. package/dist/assets/{ModelSelector-COspP6ja.js → ModelSelector-DQdCn2b7.js} +1 -1
  48. package/dist/assets/{MultiRunWindow-DjBcR8V9.js → MultiRunWindow-D4LkgbX5.js} +1 -1
  49. package/dist/assets/{OnboardingScreen-BdWTejcj.js → OnboardingScreen-DvRHPlCp.js} +1 -1
  50. package/dist/assets/{OverlayScrollbar-CEyrhwmJ.js → OverlayScrollbar-DhCgiS2Z.js} +1 -1
  51. package/dist/assets/{PierreDiffViewer-2p6Xc-67.js → PierreDiffViewer-D41Qra1m.js} +1 -1
  52. package/dist/assets/ProjectSettingsPanel-BCB8uMLe.js +2 -0
  53. package/dist/assets/{ProviderLogo-Bwh6N-2k.js → ProviderLogo-oCOoqwHl.js} +1 -1
  54. package/dist/assets/{RemoteAssistantSessionCard-DbmTHbYg.js → RemoteAssistantSessionCard-xNxKMyYj.js} +1 -1
  55. package/dist/assets/{RemoteDesktopPanel-nvSFjW3s.js → RemoteDesktopPanel-epeXSiEK.js} +1 -1
  56. package/dist/assets/ScheduledTasksDialog-CjD_d4Mg.js +3 -0
  57. package/dist/assets/{ScrollableOverlay-BzBFaJRG.js → ScrollableOverlay-BqOsMuIW.js} +1 -1
  58. package/dist/assets/{SettingsGroup--aqcChkc.js → SettingsGroup-DOaDdTNM.js} +1 -1
  59. package/dist/assets/{SettingsView-BfZPLtx7.js → SettingsView-BXBFTsek.js} +12 -12
  60. package/dist/assets/{SettingsWindow-Dlt582rY.js → SettingsWindow-CRSH_XPR.js} +1 -1
  61. package/dist/assets/{SetupTourDialog-NbVOePTS.js → SetupTourDialog-DaYKYPQf.js} +1 -1
  62. package/dist/assets/{SyncActions-Cq3jpqup.js → SyncActions-C1oPXB4Y.js} +1 -1
  63. package/dist/assets/{TerminalView-DOhD-9Ui.js → TerminalView-DlWCt09v.js} +1 -1
  64. package/dist/assets/{TextSelectionMenu-Dj5vva1V.js → TextSelectionMenu-Dt5sL7-Z.js} +1 -1
  65. package/dist/assets/{ToolOutputDialog-CNkcl4wm.js → ToolOutputDialog-C0nc9IV3.js} +1 -1
  66. package/dist/assets/{YuriLogo-CcVNX93s.js → YuriLogo-JAwGFlRv.js} +1 -1
  67. package/dist/assets/{assistantMessagePreview-HDXaIDvw.js → assistantMessagePreview-DWC6UVyn.js} +1 -1
  68. package/dist/assets/{assistantQueries-9d7JqkNy.js → assistantQueries-Bgxhg5pZ.js} +1 -1
  69. package/dist/assets/{auto-read-context-BCeaaC2w.js → auto-read-context-Bk1mCpDV.js} +1 -1
  70. package/dist/assets/{capgoAdapter-C40Xnm3I.js → capgoAdapter-BoD0Rn9k.js} +1 -1
  71. package/dist/assets/{card-Cm-b3g3Y.js → card-CnJNUKRc.js} +1 -1
  72. package/dist/assets/{chatUpwardIntent-CcI1_g74.js → chatUpwardIntent-VIpGQNvT.js} +1 -1
  73. package/dist/assets/{checkbox-B4BCOaCa.js → checkbox-Bk8-0KZQ.js} +1 -1
  74. package/dist/assets/{collapsible-DBj-0rzi.js → collapsible-C5tnXbXB.js} +1 -1
  75. package/dist/assets/{connection-hint-Cw59zLLF.js → connection-hint-C48bNniv.js} +1 -1
  76. package/dist/assets/{context-menu-CKocvm4c.js → context-menu-CFyL4DQd.js} +1 -1
  77. package/dist/assets/{diagram-CJNTqeCv.js → diagram-CiQzMXnl.js} +1 -1
  78. package/dist/assets/{dialog-DHqhT2Ls.js → dialog-C1xZ7qi4.js} +1 -1
  79. package/dist/assets/{dropdown-menu-Ct4M8mhX.js → dropdown-menu-9VcdFkMY.js} +1 -1
  80. package/dist/assets/es-BEjOp002.js +15 -0
  81. package/dist/assets/{fileMentionAutocompleteState-B9411b4o.js → fileMentionAutocompleteState-CEwRZk1h.js} +1 -1
  82. package/dist/assets/{fileMentionTouchSelection-BpHcgqhk.js → fileMentionTouchSelection-CzP2ohnN.js} +1 -1
  83. package/dist/assets/{fr-BoFSg4oh.js → fr-DpO_m9TK.js} +2 -2
  84. package/dist/assets/{gitApi-Byxc9j2j.js → gitApi-DjtVUPlT.js} +1 -1
  85. package/dist/assets/{i18n-BZ_vx76q.js → i18n-CJn52oz0.js} +1 -1
  86. package/dist/assets/{icons-BNKKEGWN.js → icons-Dy_xbx4O.js} +1 -1
  87. package/dist/assets/{input-DV8YJCiB.js → input-DXdhngzo.js} +1 -1
  88. package/dist/assets/{insertionBoundaries-FonHeXo1.js → insertionBoundaries-BRqBLgMY.js} +1 -1
  89. package/dist/assets/{ja-DmxgfcWg.js → ja-0nVMWVFA.js} +2 -2
  90. package/dist/assets/{kbd-5hstL3ii.js → kbd-C_ERslx0.js} +1 -1
  91. package/dist/assets/{ko-DH3El5QZ.js → ko-B17Bm_ms.js} +2 -2
  92. package/dist/assets/{main-Cdbm9kl9.js → main--h-KJbB4.js} +21 -21
  93. package/dist/assets/main-DIHvURq9.js +2 -0
  94. package/dist/assets/{markdownHeightCache-BCEqrVq-.js → markdownHeightCache-DwMwTsag.js} +1 -1
  95. package/dist/assets/{mcpQueries-r-nQNiC3.js → mcpQueries-B5a60zt5.js} +1 -1
  96. package/dist/assets/miniChat-ByVMduTe.js +2 -0
  97. package/dist/assets/mobile-B_lhvL6h.js +2 -0
  98. package/dist/assets/{mobileBackNavigation-PIgfuhcI.js → mobileBackNavigation-Br4xDLTP.js} +1 -1
  99. package/dist/assets/{mobileConnections-D_rJ4JYb.js → mobileConnections-CHYr70nO.js} +2 -2
  100. package/dist/assets/{multirun-BdWi45Ka.js → multirun-DHceRpGb.js} +1 -1
  101. package/dist/assets/{native-config-IL7xEhd_.js → native-config-CUl4EJwt.js} +1 -1
  102. package/dist/assets/{nativeComposerCover-XcebzoJ9.js → nativeComposerCover-sATsn8i9.js} +1 -1
  103. package/dist/assets/{navigation-DndnEFOd.js → navigation-ihRiR3Ol.js} +1 -1
  104. package/dist/assets/{openRemoteProjectSession-DjHewPaN.js → openRemoteProjectSession-4G0Mp1ns.js} +1 -1
  105. package/dist/assets/{openSessionFromDeepLink-CGzd-psR.js → openSessionFromDeepLink-B3BzCo20.js} +2 -2
  106. package/dist/assets/{pl-CD38psJG.js → pl-CDqj2zfd.js} +2 -2
  107. package/dist/assets/{pluginPresentation-DcwFbDAx.js → pluginPresentation-Cw-C09Hc.js} +1 -1
  108. package/dist/assets/{pt-BR-DBB59YTx.js → pt-BR-BXJe1xYL.js} +2 -2
  109. package/dist/assets/{pwa-CO5ex7Bx.js → pwa-Djnoay3N.js} +1 -1
  110. package/dist/assets/{queue-abort-optimistic-CWrExk4N.js → queue-abort-optimistic-CpPpvdxn.js} +1 -1
  111. package/dist/assets/{quota-BFl8FaMm.js → quota-W4rU9QuH.js} +1 -1
  112. package/dist/assets/{reference-history-TM8GmEOq.js → reference-history-qVIiJFY6.js} +1 -1
  113. package/dist/assets/{remoteSessionReference-COvISyp6.js → remoteSessionReference-9anx54fV.js} +1 -1
  114. package/dist/assets/{renderElectronMiniChatApp-2UYR3CvZ.js → renderElectronMiniChatApp-EDpvGixT.js} +2 -2
  115. package/dist/assets/{renderMobileApp-BKYNa8m6.js → renderMobileApp-CRTFdfsV.js} +5 -5
  116. package/dist/assets/{runtimeConfig-h5JOCoZq.js → runtimeConfig-D1vp1jXa.js} +1 -1
  117. package/dist/assets/runtimeEndpointReset-D3PK9OY3.js +4 -0
  118. package/dist/assets/{select-BrXKIkdf.js → select-ByWzzgfq.js} +1 -1
  119. package/dist/assets/{sessionLookup-C8hJwtOI.js → sessionLookup-BCD7xQ0s.js} +1 -1
  120. package/dist/assets/shortcuts-BIwHgZl-.js +1 -0
  121. package/dist/assets/{sortable-tabs-strip-CtQXM6Q_.js → sortable-tabs-strip-BTww8YS1.js} +1 -1
  122. package/dist/assets/spacedFileMention-DfI79AYT.js +1 -0
  123. package/dist/assets/{speechSettingsQueries-BfULrDJ4.js → speechSettingsQueries-BaFoYcSY.js} +1 -1
  124. package/dist/assets/{store-1zpYqZEm.js → store-BUNov-dS.js} +4 -4
  125. package/dist/assets/{switch-BzyEGzPy.js → switch-nBnRBAW3.js} +1 -1
  126. package/dist/assets/{textarea-D8ayHQtF.js → textarea-DbKqSgXl.js} +1 -1
  127. package/dist/assets/{timeFormat-ZGJSZlGk.js → timeFormat-jyRFc3TA.js} +1 -1
  128. package/dist/assets/{tooltip-ByNu3vY2.js → tooltip-KqYXHoiE.js} +1 -1
  129. package/dist/assets/{truncated-path-Bxr15UVi.js → truncated-path-BVONNNs1.js} +1 -1
  130. package/dist/assets/{types-BTZ1c0Jb.js → types-CuAxZ5HG.js} +1 -1
  131. package/dist/assets/ui-gH75_gWj.js +13 -0
  132. package/dist/assets/{uk-Cvg8_R2n.js → uk-B5z71t0I.js} +2 -2
  133. package/dist/assets/useAppFontEffects-TjnIqwlI.js +7 -0
  134. package/dist/assets/{useDesktopWindowControlsLayout-2ypf2FpC.js → useDesktopWindowControlsLayout-pEDvGCAI.js} +1 -1
  135. package/dist/assets/{useDictation-dqmYhgvS.js → useDictation-CtI9i0nb.js} +1 -1
  136. package/dist/assets/{useEffectiveDirectory-COpJ0ZIO.js → useEffectiveDirectory-DO47kx8J.js} +1 -1
  137. package/dist/assets/{useGitStore-Bx2PuaQ8.js → useGitStore-DdWKLUCb.js} +1 -1
  138. package/dist/assets/{useInlineCommentDraftStore-D6ouJiNs.js → useInlineCommentDraftStore-BhYBTBtT.js} +1 -1
  139. package/dist/assets/useMcpConfigStore-DeBLHEln.js +1 -0
  140. package/dist/assets/{useMobileSwipeActions-DDLR3cXV.js → useMobileSwipeActions-Ksa_CkbQ.js} +1 -1
  141. package/dist/assets/{useMobileTranscriptSyncHint-DVrgKfOa.js → useMobileTranscriptSyncHint-i3zhVIUh.js} +1 -1
  142. package/dist/assets/{useModelLists-DuvU2YJn.js → useModelLists-7_E2T5ev.js} +1 -1
  143. package/dist/assets/{useOpenCodeReadiness-CuBypQqR.js → useOpenCodeReadiness-JFbJk0Mg.js} +1 -1
  144. package/dist/assets/{usePluginsStore-Da1EfCvm.js → usePluginsStore-DP3gcI-s.js} +1 -1
  145. package/dist/assets/{useProjectGitActions-BboNQAuM.js → useProjectGitActions-C25uO6_j.js} +1 -1
  146. package/dist/assets/{useProjectGitStore-Bn2qZLge.js → useProjectGitStore-BYfY7A74.js} +1 -1
  147. package/dist/assets/{useProjectRuntimeAPIs-CN4OxfbZ.js → useProjectRuntimeAPIs-DGVmHgCx.js} +1 -1
  148. package/dist/assets/{useQuotaStore-BXsKZAl0.js → useQuotaStore-CYSImtuE.js} +1 -1
  149. package/dist/assets/{useSessionBtwStore-_zUbR6v1.js → useSessionBtwStore-kbteXiWK.js} +1 -1
  150. package/dist/assets/{useStreamingTextThrottle-C0rP4Zp3.js → useStreamingTextThrottle-Cv2XQjeg.js} +1 -1
  151. package/dist/assets/{worktreeManager-C7sfZBxc.js → worktreeManager-DDEk6-Rl.js} +1 -1
  152. package/dist/assets/{worktreeSourceBranchPreference-CNb-gxQ2.js → worktreeSourceBranchPreference-DLhyD194.js} +1 -1
  153. package/dist/assets/{zh-CN-B6Gc3wZh.js → zh-CN-D4vLeHqe.js} +2 -2
  154. package/dist/assets/zh-TW-DPqnNQKu.js +15 -0
  155. package/dist/index.html +5 -5
  156. package/dist/mini-chat.html +5 -5
  157. package/dist/mobile.html +1 -1
  158. package/package.json +1 -1
  159. package/server/index.js +1 -0
  160. package/server/lib/assistants/DOCUMENTATION.md +10 -2
  161. package/server/lib/assistants/builtin-skills.js +4 -4
  162. package/server/lib/assistants/builtin-skills.test.js +7 -4
  163. package/server/lib/assistants/harness.js +2 -1
  164. package/server/lib/assistants/remote-execution.test.js +60 -1
  165. package/server/lib/assistants/service.js +1 -0
  166. package/server/lib/assistants/yuri-tools.js +42 -6
  167. package/server/lib/gui-customization/DOCUMENTATION.md +13 -6
  168. package/server/lib/gui-customization/projects-client.mjs +5 -3
  169. package/server/lib/gui-customization/projects.js +16 -4
  170. package/server/lib/gui-customization/projects.test.js +38 -2
  171. package/server/lib/gui-customization/session-skill.js +3 -3
  172. package/server/lib/gui-customization/session-skill.test.js +9 -7
  173. package/server/lib/gui-customization/skill/SKILL.md +22 -13
  174. package/server/lib/gui-customization/skill/references/projects.md +16 -2
  175. package/server/lib/opencode/feature-routes-runtime.js +6 -2
  176. package/server/lib/opencode/session-directory-runtime.js +5 -1
  177. package/server/lib/opencode/session-directory-runtime.test.js +39 -0
  178. package/server/lib/projects/DOCUMENTATION.md +4 -3
  179. package/server/lib/projects/registry.js +12 -1
  180. package/server/lib/remote-hosts/gateway.js +21 -0
  181. package/server/lib/remote-hosts/routes.test.js +19 -0
  182. package/server/lib/scheduled-tasks/session-skill.test.js +9 -3
  183. package/server/lib/session-index/DOCUMENTATION.md +6 -2
  184. package/server/lib/session-index/sync-runtime.js +117 -89
  185. package/dist/assets/ArchivedSessionsDialog-g54oWqpZ.js +0 -1
  186. package/dist/assets/AssistantConversationSurface-B59k-lXE.css +0 -1
  187. package/dist/assets/AssistantConversationSurface-D1hYq8Qv.js +0 -3
  188. package/dist/assets/ScheduledTasksDialog-CJQfZGg7.js +0 -3
  189. package/dist/assets/es-Dl_f-VoR.js +0 -15
  190. package/dist/assets/main-C7gMH-j6.js +0 -2
  191. package/dist/assets/miniChat-BjjPtcy_.js +0 -2
  192. package/dist/assets/mobile-qvd0Mmzl.js +0 -2
  193. package/dist/assets/runtimeEndpointReset-ehGqR2xT.js +0 -4
  194. package/dist/assets/sessionOwnership-Be4lp__z.js +0 -2
  195. package/dist/assets/shortcuts-fTrZjAfF.js +0 -1
  196. package/dist/assets/spacedFileMention-Ds4GtgiF.js +0 -1
  197. package/dist/assets/ui-CuL4d44b.js +0 -13
  198. package/dist/assets/useAppFontEffects-y-bsvPnx.js +0 -7
  199. package/dist/assets/useMcpConfigStore-DWigA_d-.js +0 -1
  200. package/dist/assets/zh-TW-C2bT0lOZ.js +0 -15
@@ -1,4 +1,4 @@
1
- import{n as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,n}from"./runtime-switch-CSXCC6XM.js";import{n as r}from"./runtime-fetch-ykYB0sSi.js";import{t as i}from"./runtimeAPIRegistry-C2VogTny.js";import{n as a}from"./client-DfhjGjVo.js";import{$ as o,A as s,B as c,D as l,E as u,F as d,G as f,H as p,I as ee,J as m,K as te,L as ne,M as re,N as ie,O as ae,P as oe,Q as se,R as ce,S as le,T as ue,U as de,V as fe,W as h,X as pe,Y as me,Z as he,_ as ge,_t as _e,a as ve,at as ye,b as be,bt as xe,c as Se,ct as Ce,d as we,dt as Te,et as Ee,f as De,ft as Oe,g as ke,gt as Ae,h as je,ht as Me,i as Ne,it as Pe,j as g,k as Fe,l as Ie,lt as Le,m as Re,mt as ze,n as Be,nt as Ve,o as He,ot as Ue,p as We,pt as Ge,q as Ke,r as qe,rt as Je,s as Ye,st as Xe,t as Ze,tt as Qe,u as $e,ut as et,v as tt,vt as nt,x as rt,y as it,yt as at,z as ot}from"./gitApiHttp-CStyHJBc.js";import{Zi as _,f as v,l as st}from"./ui-CuL4d44b.js";var y=`/api/magic-prompts`,ct=new Map([{id:`git.commit.generate.visible`,title:`Commit Generation Visible Prompt`,group:`Git`,description:`Visible user message for commit message generation.`,template:`You are generating a Conventional Commits subject line from the diffs of the selected files.`},{id:`git.commit.generate.instructions`,title:`Commit Generation Instructions`,group:`Git`,description:`Hidden instructions for commit message generation.`,placeholders:[{key:`selected_files`,description:`Bullet list of currently selected file paths.`}],template:`Return exactly one JSON object and nothing else. Do not include prose, markdown, explanations, or code fences.
1
+ import{n as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,n}from"./runtime-switch-CSXCC6XM.js";import{n as r}from"./runtime-fetch-ykYB0sSi.js";import{t as i}from"./runtimeAPIRegistry-C2VogTny.js";import{n as a}from"./client-DfhjGjVo.js";import{$ as o,A as s,B as c,D as l,E as u,F as d,G as f,H as p,I as ee,J as m,K as te,L as ne,M as re,N as ie,O as ae,P as oe,Q as se,R as ce,S as le,T as ue,U as de,V as fe,W as h,X as pe,Y as me,Z as he,_ as ge,_t as _e,a as ve,at as ye,b as be,bt as xe,c as Se,ct as Ce,d as we,dt as Te,et as Ee,f as De,ft as Oe,g as ke,gt as Ae,h as je,ht as Me,i as Ne,it as Pe,j as g,k as Fe,l as Ie,lt as Le,m as Re,mt as ze,n as Be,nt as Ve,o as He,ot as Ue,p as We,pt as Ge,q as Ke,r as qe,rt as Je,s as Ye,st as Xe,t as Ze,tt as Qe,u as $e,ut as et,v as tt,vt as nt,x as rt,y as it,yt as at,z as ot}from"./gitApiHttp-CStyHJBc.js";import{Zi as _,f as v,l as st}from"./ui-gH75_gWj.js";var y=`/api/magic-prompts`,ct=new Map([{id:`git.commit.generate.visible`,title:`Commit Generation Visible Prompt`,group:`Git`,description:`Visible user message for commit message generation.`,template:`You are generating a Conventional Commits subject line from the diffs of the selected files.`},{id:`git.commit.generate.instructions`,title:`Commit Generation Instructions`,group:`Git`,description:`Hidden instructions for commit message generation.`,placeholders:[{key:`selected_files`,description:`Bullet list of currently selected file paths.`}],template:`Return exactly one JSON object and nothing else. Do not include prose, markdown, explanations, or code fences.
2
2
 
3
3
  The JSON object must have exactly this shape:
4
4
  {"subject": string, "highlights": string[]}
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{A as t,I as n,j as r}from"./platform-BQipzOYw.js";import{ot as i,st as a}from"./vendor-base-ui-wXsskyKm.js";import{n as o}from"./vendor-react-BkccXcWz.js";import{n as s,t as c}from"./runtime-ead7P81A.js";import"./bootstrap-eLlfzqAI.js";import{i as l,t as u}from"./store-1zpYqZEm.js";var d=e(a(),1),f=o(),p=async(e,n)=>{if(!t())throw Error(`Desktop runtime is not available`);return r(e,n)},m=async()=>{if(n())try{await p(`desktop_start_window_drag`)}catch{}},h=async e=>{if(n())try{await p(`desktop_set_window_title`,{title:e})}catch{}},g=async(e,t)=>{if(n())try{await p(`desktop_set_window_theme`,{themeMode:e,themeVariant:t})}catch{}},_=async e=>{if(n())try{await p(`desktop_set_menu_locale`,{locale:e})}catch{}},v=async()=>{if(!n())return null;try{let e=await p(`desktop_get_app_version`);return typeof e==`string`&&e.trim().length>0?e:null}catch{return null}},y=d.createContext(null),b=i(),x=e=>{let t=(0,f.c)(19),{children:n}=e,r=l(S),i=l(C),a=l(w),o=l(T),p,m;t[0]===r?(p=t[1],m=t[2]):(p=()=>{typeof document>`u`||(document.documentElement.lang=r)},m=[r],t[0]=r,t[1]=p,t[2]=m),d.useEffect(p,m);let h,g;t[3]!==a||t[4]!==r?(h=()=>{a===null&&_(r)},g=[r,a],t[3]=a,t[4]=r,t[5]=h,t[6]=g):(h=t[5],g=t[6]),d.useEffect(h,g);let v;t[7]===i?v=t[8]:(v=(e,t)=>u(i,e,t),t[7]=i,t[8]=v);let x=v,E;t[9]===x?E=t[10]:(E=e=>x(s[e]),t[9]=x,t[10]=E);let D;t[11]!==r||t[12]!==o||t[13]!==x||t[14]!==E?(D={locale:r,locales:c,setLocale:o,label:E,t:x},t[11]=r,t[12]=o,t[13]=x,t[14]=E,t[15]=D):D=t[15];let O=D,k;return t[16]!==n||t[17]!==O?(k=(0,b.jsx)(y.Provider,{value:O,children:n}),t[16]=n,t[17]=O,t[18]=k):k=t[18],k};function S(e){return e.locale}function C(e){return e.dictionary}function w(e){return e.loadingLocale}function T(e){return e.setLocale}var E={en:`en-US`,fr:`fr-FR`,"zh-CN":`zh-CN`,"zh-TW":`zh-TW`,uk:`uk-UA`,es:`es-ES`,"pt-BR":`pt-BR`,ko:`ko-KR`,pl:`pl-PL`,ja:`ja-JP`},D=e=>E[e]??`en-US`,O=()=>D(l.getState().locale);function k(){let e=d.useContext(y);if(!e)throw Error(`useI18n must be used within I18nProvider`);return e}export{p as a,m as c,v as i,O as n,g as o,x as r,h as s,k as t};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{A as t,I as n,j as r}from"./platform-BQipzOYw.js";import{ot as i,st as a}from"./vendor-base-ui-wXsskyKm.js";import{n as o}from"./vendor-react-BkccXcWz.js";import{n as s,t as c}from"./runtime-ead7P81A.js";import"./bootstrap-eLlfzqAI.js";import{i as l,t as u}from"./store-BUNov-dS.js";var d=e(a(),1),f=o(),p=async(e,n)=>{if(!t())throw Error(`Desktop runtime is not available`);return r(e,n)},m=async()=>{if(n())try{await p(`desktop_start_window_drag`)}catch{}},h=async e=>{if(n())try{await p(`desktop_set_window_title`,{title:e})}catch{}},g=async(e,t)=>{if(n())try{await p(`desktop_set_window_theme`,{themeMode:e,themeVariant:t})}catch{}},_=async e=>{if(n())try{await p(`desktop_set_menu_locale`,{locale:e})}catch{}},v=async()=>{if(!n())return null;try{let e=await p(`desktop_get_app_version`);return typeof e==`string`&&e.trim().length>0?e:null}catch{return null}},y=d.createContext(null),b=i(),x=e=>{let t=(0,f.c)(19),{children:n}=e,r=l(S),i=l(C),a=l(w),o=l(T),p,m;t[0]===r?(p=t[1],m=t[2]):(p=()=>{typeof document>`u`||(document.documentElement.lang=r)},m=[r],t[0]=r,t[1]=p,t[2]=m),d.useEffect(p,m);let h,g;t[3]!==a||t[4]!==r?(h=()=>{a===null&&_(r)},g=[r,a],t[3]=a,t[4]=r,t[5]=h,t[6]=g):(h=t[5],g=t[6]),d.useEffect(h,g);let v;t[7]===i?v=t[8]:(v=(e,t)=>u(i,e,t),t[7]=i,t[8]=v);let x=v,E;t[9]===x?E=t[10]:(E=e=>x(s[e]),t[9]=x,t[10]=E);let D;t[11]!==r||t[12]!==o||t[13]!==x||t[14]!==E?(D={locale:r,locales:c,setLocale:o,label:E,t:x},t[11]=r,t[12]=o,t[13]=x,t[14]=E,t[15]=D):D=t[15];let O=D,k;return t[16]!==n||t[17]!==O?(k=(0,b.jsx)(y.Provider,{value:O,children:n}),t[16]=n,t[17]=O,t[18]=k):k=t[18],k};function S(e){return e.locale}function C(e){return e.dictionary}function w(e){return e.loadingLocale}function T(e){return e.setLocale}var E={en:`en-US`,fr:`fr-FR`,"zh-CN":`zh-CN`,"zh-TW":`zh-TW`,uk:`uk-UA`,es:`es-ES`,"pt-BR":`pt-BR`,ko:`ko-KR`,pl:`pl-PL`,ja:`ja-JP`},D=e=>E[e]??`en-US`,O=()=>D(l.getState().locale);function k(){let e=d.useContext(y);if(!e)throw Error(`useI18n must be used within I18nProvider`);return e}export{p as a,m as c,v as i,O as n,g as o,x as r,h as s,k as t};
@@ -1,2 +1,2 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{ot as t,st as n}from"./vendor-base-ui-wXsskyKm.js";import{n as r}from"./vendor-react-BkccXcWz.js";import{r as i}from"./vendor-reactuses-core-DjKFMfz7.js";import{io as a}from"./ui-CuL4d44b.js";import{n as o,r as s}from"./Icon-DzOoxSwi.js";import{t as c}from"./i18n-BZ_vx76q.js";import{_ as l,c as u,l as d,o as f,t as p,v as m,y as h}from"./vendor-dnd-kit-core-qy5stxu5.js";import{n as g,o as _,s as v,t as y}from"./vendor-dnd-kit-sortable-CiTIuX4o.js";import{t as b}from"./ProviderLogo-Bwh6N-2k.js";import{r as x}from"./useQuotaStore-BXsKZAl0.js";import{i as S,l as C,n as w,o as T,r as E,s as D}from"./quota-BFl8FaMm.js";var O=e(n(),1),k=r(),A=(e,t)=>{if(!t||t.length<2)return e;let n=t.map(e=>e.name).filter(Boolean).sort((e,t)=>t.length-e.length);return e.map(([e,t])=>{let r=n.find(t=>e.startsWith(`${t} · `));return r?[e,{...t,accountName:r}]:[e,t]})},j=(e,t)=>{let n=e[t]?.accountName;return!n||t>0&&e[t-1].accountName===n?null:new Set(e.map(e=>e.accountName).filter(Boolean)).size>1?n:null},M=t(),N=34,P=3,F=31/2,I=2*Math.PI*F,L=90,R=(e,t)=>E(t===`remaining`?e.remainingPercent:e.usedPercent),z=e=>{let t=e.map(e=>e.window),n=[];return e.forEach((e,r)=>{let i=j(t,r);if(i||n.length===0){n.push({heading:i,items:[e]});return}n[n.length-1].items.push(e)}),n},B={minute:`m`,hour:`h`,day:`d`,week:`w`,month:`mo`},V=e=>{let t=/^(\d+)\s*(minute|hour|day|week|month)s?$/i.exec(e);return t?`${t[1]}${B[t[2].toLowerCase()]}`:/^\d+(m|h|d|w|mo)$/i.test(e)?e:null},H=e=>{let[t,n]=e.split(/[ &]+/);return/^\d/.test(n??``)?`${t} ${n}`:t},U=e=>{if(e.fullLabel)return e.label;let t=(e.window.label??e.paceKey??``).split(` · `).pop()??``,n=V(t);return e.window.pool?`${H(e.window.pool)} ${n??t}`.trim():n??e.label},W=/\b(total|overall)\b|总计|合计|总量|整体/i,G=e=>W.test(e.window.label??e.paceKey??e.label),K=e=>[...e.filter(({item:e})=>G(e)),...e.filter(({item:e})=>!G(e))],q=3,J=e=>{let t=(0,k.c)(43),{item:n,percent:r,timeFormatPreference:i}=e,{t:o}=c(),{window:s}=n,l=n.fullLabel??n.label,u;t[0]===n?u=t[1]:(u=U(n),t[0]=n,t[1]=u);let d=u,f;t[2]!==r||t[3]!==s.valueLabel?(f=T(s.valueLabel,r),t[2]=r,t[3]=s.valueLabel,t[4]=f):f=t[4];let p=f,m,h;if(t[5]!==l||t[6]!==p||t[7]!==r||t[8]!==o||t[9]!==i||t[10]!==s.resetAt){let e=s.resetAt?S(s.resetAt,i):``;m=`${l} · ${p===`-`?`${r}%`:p}`,h=e?o(`header.services.resetsAt`,{when:e}):``,t[5]=l,t[6]=p,t[7]=r,t[8]=o,t[9]=i,t[10]=s.resetAt,t[11]=m,t[12]=h}else m=t[11],h=t[12];let g;t[13]!==m||t[14]!==h?(g=[m,h].filter(Boolean),t[13]=m,t[14]=h,t[15]=g):g=t[15];let _=g.join(`
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{ot as t,st as n}from"./vendor-base-ui-wXsskyKm.js";import{n as r}from"./vendor-react-BkccXcWz.js";import{r as i}from"./vendor-reactuses-core-DjKFMfz7.js";import{io as a}from"./ui-gH75_gWj.js";import{n as o,r as s}from"./Icon-BUHzyKnj.js";import{t as c}from"./i18n-CJn52oz0.js";import{_ as l,c as u,l as d,o as f,t as p,v as m,y as h}from"./vendor-dnd-kit-core-qy5stxu5.js";import{n as g,o as _,s as v,t as y}from"./vendor-dnd-kit-sortable-CiTIuX4o.js";import{t as b}from"./ProviderLogo-oCOoqwHl.js";import{r as x}from"./useQuotaStore-CYSImtuE.js";import{i as S,l as C,n as w,o as T,r as E,s as D}from"./quota-W4rU9QuH.js";var O=e(n(),1),k=r(),A=(e,t)=>{if(!t||t.length<2)return e;let n=t.map(e=>e.name).filter(Boolean).sort((e,t)=>t.length-e.length);return e.map(([e,t])=>{let r=n.find(t=>e.startsWith(`${t} · `));return r?[e,{...t,accountName:r}]:[e,t]})},j=(e,t)=>{let n=e[t]?.accountName;return!n||t>0&&e[t-1].accountName===n?null:new Set(e.map(e=>e.accountName).filter(Boolean)).size>1?n:null},M=t(),N=34,P=3,F=31/2,I=2*Math.PI*F,L=90,R=(e,t)=>E(t===`remaining`?e.remainingPercent:e.usedPercent),z=e=>{let t=e.map(e=>e.window),n=[];return e.forEach((e,r)=>{let i=j(t,r);if(i||n.length===0){n.push({heading:i,items:[e]});return}n[n.length-1].items.push(e)}),n},B={minute:`m`,hour:`h`,day:`d`,week:`w`,month:`mo`},V=e=>{let t=/^(\d+)\s*(minute|hour|day|week|month)s?$/i.exec(e);return t?`${t[1]}${B[t[2].toLowerCase()]}`:/^\d+(m|h|d|w|mo)$/i.test(e)?e:null},H=e=>{let[t,n]=e.split(/[ &]+/);return/^\d/.test(n??``)?`${t} ${n}`:t},U=e=>{if(e.fullLabel)return e.label;let t=(e.window.label??e.paceKey??``).split(` · `).pop()??``,n=V(t);return e.window.pool?`${H(e.window.pool)} ${n??t}`.trim():n??e.label},W=/\b(total|overall)\b|总计|合计|总量|整体/i,G=e=>W.test(e.window.label??e.paceKey??e.label),K=e=>[...e.filter(({item:e})=>G(e)),...e.filter(({item:e})=>!G(e))],q=3,J=e=>{let t=(0,k.c)(43),{item:n,percent:r,timeFormatPreference:i}=e,{t:o}=c(),{window:s}=n,l=n.fullLabel??n.label,u;t[0]===n?u=t[1]:(u=U(n),t[0]=n,t[1]=u);let d=u,f;t[2]!==r||t[3]!==s.valueLabel?(f=T(s.valueLabel,r),t[2]=r,t[3]=s.valueLabel,t[4]=f):f=t[4];let p=f,m,h;if(t[5]!==l||t[6]!==p||t[7]!==r||t[8]!==o||t[9]!==i||t[10]!==s.resetAt){let e=s.resetAt?S(s.resetAt,i):``;m=`${l} · ${p===`-`?`${r}%`:p}`,h=e?o(`header.services.resetsAt`,{when:e}):``,t[5]=l,t[6]=p,t[7]=r,t[8]=o,t[9]=i,t[10]=s.resetAt,t[11]=m,t[12]=h}else m=t[11],h=t[12];let g;t[13]!==m||t[14]!==h?(g=[m,h].filter(Boolean),t[13]=m,t[14]=h,t[15]=g):g=t[15];let _=g.join(`
2
2
  `),v=(s.usedPercent??0)>=L,y=v?`var(--status-warning)`:`currentColor`,b=I*r/100,x=N/2,C;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(C={width:N,height:N},t[16]=C):C=t[16];let w=v?`var(--status-warning)`:`var(--interactive-border)`,E=v?.18:1,D;t[17]!==w||t[18]!==E?(D=(0,M.jsx)(`circle`,{cx:x,cy:x,r:F,fill:`none`,stroke:w,strokeOpacity:E,strokeWidth:P}),t[17]=w,t[18]=E,t[19]=D):D=t[19];let O;t[20]!==y||t[21]!==b||t[22]!==r?(O=r>0?(0,M.jsx)(`circle`,{cx:x,cy:x,r:F,fill:`none`,stroke:y,strokeWidth:P,strokeDasharray:`${b} ${I}`,className:`transition-[stroke-dasharray] duration-300`}):null,t[20]=y,t[21]=b,t[22]=r,t[23]=O):O=t[23];let A;t[24]!==O||t[25]!==D?(A=(0,M.jsxs)(`svg`,{viewBox:`0 0 ${N} ${N}`,className:`size-full -rotate-90 text-foreground/60`,"aria-hidden":`true`,children:[D,O]}),t[24]=O,t[25]=D,t[26]=A):A=t[26];let j=v?`text-foreground`:`text-foreground/70`,R;t[27]===j?R=t[28]:(R=a(`absolute inset-0 flex items-center justify-center text-[0.52rem] font-semibold tabular-nums`,j),t[27]=j,t[28]=R);let z;t[29]!==r||t[30]!==R?(z=(0,M.jsxs)(`span`,{className:R,children:[r,`%`]}),t[29]=r,t[30]=R,t[31]=z):z=t[31];let B;t[32]!==l||t[33]!==r||t[34]!==A||t[35]!==z?(B=(0,M.jsxs)(`div`,{className:`relative`,style:C,role:`progressbar`,"aria-label":l,"aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,children:[A,z]}),t[32]=l,t[33]=r,t[34]=A,t[35]=z,t[36]=B):B=t[36];let V;t[37]===d?V=t[38]:(V=(0,M.jsx)(`span`,{className:`line-clamp-2 w-full break-words text-center text-[0.6rem] leading-tight text-muted-foreground`,children:d}),t[37]=d,t[38]=V);let H;return t[39]!==B||t[40]!==V||t[41]!==_?(H=(0,M.jsxs)(`div`,{className:`flex w-12 min-w-0 flex-col items-center gap-[3px]`,title:_,children:[B,V]}),t[39]=B,t[40]=V,t[41]=_,t[42]=H):H=t[42],H},Y=(e,t,n)=>{let r=e.filter(({item:e})=>(e.window.usedPercent??0)>0&&(e.window.resetAt??0)>Date.now()).map(({item:e})=>({label:U(e),when:S(e.window.resetAt,t)})).filter((e,t,n)=>e.when&&n.findIndex(t=>t.when===e.when)===t).slice(0,2);return r.length===0?``:[n(r[0].when),...r.slice(1).map(e=>`${e.label} ${e.when}`)].join(` · `)},X=e=>{let t=(0,k.c)(20),{items:n,displayMode:r,timeFormatPreference:i,showPace:o,className:s}=e,l=o!==void 0&&o,{t:u}=c(),d,f;if(t[0]!==s||t[1]!==r||t[2]!==n||t[3]!==l||t[4]!==u||t[5]!==i){let e=z(n),o;t[8]===u?o=t[9]:(o=e=>u(`header.services.resetsAt`,{when:e}),t[8]=u,t[9]=o);let c=o;t[10]===s?d=t[11]:(d=a(`space-y-3`,s),t[10]=s,t[11]=d);let p;t[12]!==r||t[13]!==c||t[14]!==l||t[15]!==i?(p=(e,t)=>{let n=[],o=[];for(let t of e.items){let e=R(t.window,r);e===null?o.push(t):n.push({item:t,percent:e})}let s=K(n),u=s.slice(0,q),d=[...s.slice(u.length),...o.map(ee)],f=Y(u,i,c),p=l?u.map(te).find(ne)??null:null;return(0,M.jsxs)(`div`,{className:a(`grid grid-cols-[minmax(0,1fr)_auto] items-center gap-x-3 gap-y-2`,e.heading&&t>0&&`border-t border-[var(--surface-subtle)] pt-3`),children:[(0,M.jsxs)(`div`,{className:`min-w-0 space-y-1.5`,children:[e.heading?(0,M.jsx)(`div`,{className:`truncate text-xs text-foreground`,title:e.heading,children:e.heading}):null,f||p?(0,M.jsxs)(`div`,{className:`text-[0.7rem] leading-snug tabular-nums text-muted-foreground`,children:[f,p?(0,M.jsxs)(`span`,{style:{color:C(p.status)},children:[f?` · `:``,p.isExhausted?D(p.remainingSeconds):p.predictText]}):null]}):null]}),u.length>0?(0,M.jsx)(`div`,{className:a(`flex max-w-[15rem] flex-wrap items-start justify-end gap-y-2.5`,u.length>4?`gap-x-[7px]`:`gap-x-3`),children:u.map(e=>{let{item:t,percent:n}=e;return(0,M.jsx)(J,{item:t,percent:n,timeFormatPreference:i},t.key)})}):null,d.map(re)]},e.items[0]?.key??t)},t[12]=r,t[13]=c,t[14]=l,t[15]=i,t[16]=p):p=t[16],f=e.map(p),t[0]=s,t[1]=r,t[2]=n,t[3]=l,t[4]=u,t[5]=i,t[6]=d,t[7]=f}else d=t[6],f=t[7];let p;return t[17]!==d||t[18]!==f?(p=(0,M.jsx)(`div`,{className:d,children:f}),t[17]=d,t[18]=f,t[19]=p):p=t[19],p};function ee(e){return{item:e,percent:null}}function te(e){let{item:t}=e;return t.window.disablePace?null:w(t.window.usedPercent,t.window.resetAt,t.window.windowSeconds,t.paceKey)}function ne(e){return e!==null}function re(e){let{item:t,percent:n}=e,r=T(t.window.valueLabel,n);return(0,M.jsxs)(`div`,{className:`col-span-full flex min-w-0 items-baseline justify-between gap-3`,children:[(0,M.jsx)(`span`,{className:`truncate text-[0.7rem] text-muted-foreground`,title:t.fullLabel??t.label,children:t.fullLabel??t.label}),(0,M.jsx)(`span`,{className:`min-w-0 max-w-[55%] shrink-0 truncate text-[0.7rem] font-medium tabular-nums text-foreground/80`,children:r===`-`?``:r})]},t.key)}var Z=O.createContext(null),Q=O.createContext(null),ie=e=>{let t=(0,k.c)(25),{ids:n,onReorder:r,disabled:a,children:o}=e,s=a!==void 0&&a,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c={activationConstraint:{distance:6}},t[0]=c):c=t[0];let h;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(h={activationConstraint:{delay:200,tolerance:6}},t[1]=h):h=t[1];let _=m(l(f,c),l(u,h)),b;t[2]===r?b=t[3]:(b=e=>{(r??x.getState().reorderProviders)(e)},t[2]=r,t[3]=b);let S=i(b),C;t[4]!==S||t[5]!==n?(C=e=>{let{active:t,over:r}=e;if(!r||t.id===r.id)return;let i=n.indexOf(String(t.id)),a=n.indexOf(String(r.id));i<0||a<0||S(g(n,i,a))},t[4]=S,t[5]=n,t[6]=C):C=t[6];let w=i(C),T;t[7]!==S||t[8]!==n?(T=(e,t)=>{let r=n.indexOf(e),i=Math.max(0,Math.min(n.length-1,r+t));r<0||i===r||S(g(n,r,i))},t[7]=S,t[8]=n,t[9]=T):T=t[9];let E=i(T),D;t[10]!==n||t[11]!==E?(D={ids:n,move:E},t[10]=n,t[11]=E,t[12]=D):D=t[12];let O=D;if(s||n.length<2){let e;return t[13]===o?e=t[14]:(e=(0,M.jsx)(M.Fragment,{children:o}),t[13]=o,t[14]=e),e}let A;t[15]!==O||t[16]!==o?(A=(0,M.jsx)(Z.Provider,{value:O,children:o}),t[15]=O,t[16]=o,t[17]=A):A=t[17];let j;t[18]!==n||t[19]!==A?(j=(0,M.jsx)(y,{items:n,strategy:v,children:A}),t[18]=n,t[19]=A,t[20]=j):j=t[20];let N;return t[21]!==w||t[22]!==_||t[23]!==j?(N=(0,M.jsx)(p,{sensors:_,collisionDetection:d,onDragEnd:w,children:j}),t[21]=w,t[22]=_,t[23]=j,t[24]=N):N=t[24],N},ae=e=>{let t=(0,k.c)(25),{id:n,list:r,className:i,children:o}=e,s;t[0]===n?s=t[1]:(s={id:n},t[0]=n,t[1]=s);let{attributes:c,listeners:l,setNodeRef:u,setActivatorNodeRef:d,transform:f,transition:p,isDragging:m}=_(s),g;t[2]!==c||t[3]!==n||t[4]!==r.move||t[5]!==l||t[6]!==d?(g={id:n,move:r.move,setActivatorNodeRef:d,attributes:c,listeners:l},t[2]=c,t[3]=n,t[4]=r.move,t[5]=l,t[6]=d,t[7]=g):g=t[7];let v=g,y;t[8]===f?y=t[9]:(y=h.Translate.toString(f),t[8]=f,t[9]=y);let b=m?20:void 0,x;t[10]!==y||t[11]!==b||t[12]!==p?(x={transform:y,transition:p,zIndex:b},t[10]=y,t[11]=b,t[12]=p,t[13]=x):x=t[13];let S=m&&`opacity-70`,C;t[14]!==i||t[15]!==S?(C=a(`group/usage relative`,S,i),t[14]=i,t[15]=S,t[16]=C):C=t[16];let w;t[17]!==o||t[18]!==v?(w=(0,M.jsx)(Q.Provider,{value:v,children:o}),t[17]=o,t[18]=v,t[19]=w):w=t[19];let T;return t[20]!==u||t[21]!==x||t[22]!==C||t[23]!==w?(T=(0,M.jsx)(`div`,{ref:u,style:x,className:C,children:w}),t[20]=u,t[21]=x,t[22]=C,t[23]=w,t[24]=T):T=t[24],T},oe=e=>{let t=(0,k.c)(8),{id:n,className:r,children:i}=e,a=O.useContext(Z);if(!a){let e;return t[0]!==i||t[1]!==r?(e=(0,M.jsx)(`div`,{className:r,children:i}),t[0]=i,t[1]=r,t[2]=e):e=t[2],e}let o;return t[3]!==i||t[4]!==r||t[5]!==n||t[6]!==a?(o=(0,M.jsx)(ae,{id:n,list:a,className:r,children:i}),t[3]=i,t[4]=r,t[5]=n,t[6]=a,t[7]=o):o=t[7],o},se=({providerId:e,name:t,className:n})=>{let{t:r}=c(),i=O.useContext(Q),a=(0,M.jsx)(b,{providerId:e,className:n});if(!i)return a;let s=r(`header.services.arrangeProvider`,{name:t}),l=e=>e===`ArrowUp`||e===`ArrowLeft`?-1:+(e===`ArrowDown`||e===`ArrowRight`);return(0,M.jsxs)(`button`,{type:`button`,...i.attributes,...i.listeners,ref:i.setActivatorNodeRef,"aria-label":s,title:s,onKeyDown:e=>{let t=e.altKey?l(e.key):0;if(!t)return;e.preventDefault(),e.stopPropagation();let n=e.currentTarget;i.move(i.id,t),requestAnimationFrame(()=>n.focus({preventScroll:!0}))},className:`relative -m-1 inline-flex shrink-0 !cursor-grab touch-none select-none items-center justify-center rounded-sm p-1 outline-none hover:bg-[var(--interactive-hover)] focus-visible:ring-2 focus-visible:ring-primary active:!cursor-grabbing`,children:[(0,M.jsx)(`span`,{className:`pointer-events-none inline-flex`,children:a}),(0,M.jsx)(o,{name:`drag-move-2`,className:`pointer-events-none absolute right-[calc(100%-3px)] top-1/2 size-2.5 -translate-y-1/2 text-muted-foreground opacity-0 transition-opacity group-hover/usage:opacity-100 group-focus-within/usage:opacity-100`})]})},$={globe:`global`,server:`server`,"circle-check":`checkbox-circle`,"circle-x":`close-circle`,"window-analytics":`bar-chart-box`};function ce(e){return e?Object.hasOwn($,e)?$[e]:Object.hasOwn(s,e)?e:void 0:void 0}export{X as a,se as i,oe as n,A as o,ie as r,ce as t};
@@ -1 +1 @@
1
- import"./rolldown-runtime-hePW80VL.js";import{ot as e,st as t}from"./vendor-base-ui-wXsskyKm.js";import{n}from"./vendor-react-BkccXcWz.js";import{io as r}from"./ui-CuL4d44b.js";var i=n();t();var a=e();function o(e){let t=(0,i.c)(23),n,o,s,c,l,u;t[0]===e?(n=t[1],o=t[2],s=t[3],c=t[4],l=t[5],u=t[6]):({className:o,type:u,bordered:n,placeholder:c,endAdornment:s,...l}=e,t[0]=e,t[1]=n,t[2]=o,t[3]=s,t[4]=c,t[5]=l,t[6]=u);let d=c||` `,f=n!==void 0&&`border border-transparent ring-0 focus:ring-0 aria-invalid:ring-1 aria-invalid:focus:ring-1`,p=n&&`border-[var(--form-surface-border)]`,m=s&&`pe-11`,h;t[7]!==o||t[8]!==f||t[9]!==p||t[10]!==m?(h=r(`text-foreground file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground bg-[var(--surface-elevated)] appearance-none flex h-9 w-full min-w-0 rounded-lg px-3 py-1 typography-markdown outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:typography-ui-label file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:typography-ui-label`,`ring-1 ring-inset ring-border/60 transition duration-200 ease-out`,`hover:[&:not(:focus)]:bg-[var(--surface-subtle)] hover:[&:not(:focus)]:ring-transparent`,`focus:ring-2 focus:ring-[var(--interactive-focus-ring)] focus-visible:outline-none`,`aria-invalid:ring-[var(--status-error)] aria-invalid:focus:ring-[var(--status-error)]`,f,p,o,m),t[7]=o,t[8]=f,t[9]=p,t[10]=m,t[11]=h):h=t[11];let g;t[12]!==n||t[13]!==l||t[14]!==d||t[15]!==h||t[16]!==u?(g=(0,a.jsx)(`input`,{type:u,"data-slot":`input`,"data-bordered":n,placeholder:d,className:h,spellCheck:!1,autoComplete:`off`,autoCorrect:`off`,autoCapitalize:`off`,...l}),t[12]=n,t[13]=l,t[14]=d,t[15]=h,t[16]=u,t[17]=g):g=t[17];let _=g;if(!s)return _;let v;t[18]===s?v=t[19]:(v=(0,a.jsx)(`div`,{"data-slot":`input-end-adornment`,className:`absolute inset-y-0 end-0 flex items-center`,children:s}),t[18]=s,t[19]=v);let y;return t[20]!==_||t[21]!==v?(y=(0,a.jsxs)(`div`,{"data-slot":`input-wrapper`,className:`relative min-w-0 w-full flex-1`,children:[_,v]}),t[20]=_,t[21]=v,t[22]=y):y=t[22],y}export{o as t};
1
+ import"./rolldown-runtime-hePW80VL.js";import{ot as e,st as t}from"./vendor-base-ui-wXsskyKm.js";import{n}from"./vendor-react-BkccXcWz.js";import{io as r}from"./ui-gH75_gWj.js";var i=n();t();var a=e();function o(e){let t=(0,i.c)(23),n,o,s,c,l,u;t[0]===e?(n=t[1],o=t[2],s=t[3],c=t[4],l=t[5],u=t[6]):({className:o,type:u,bordered:n,placeholder:c,endAdornment:s,...l}=e,t[0]=e,t[1]=n,t[2]=o,t[3]=s,t[4]=c,t[5]=l,t[6]=u);let d=c||` `,f=n!==void 0&&`border border-transparent ring-0 focus:ring-0 aria-invalid:ring-1 aria-invalid:focus:ring-1`,p=n&&`border-[var(--form-surface-border)]`,m=s&&`pe-11`,h;t[7]!==o||t[8]!==f||t[9]!==p||t[10]!==m?(h=r(`text-foreground file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground bg-[var(--surface-elevated)] appearance-none flex h-9 w-full min-w-0 rounded-lg px-3 py-1 typography-markdown outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:typography-ui-label file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:typography-ui-label`,`ring-1 ring-inset ring-border/60 transition duration-200 ease-out`,`hover:[&:not(:focus)]:bg-[var(--surface-subtle)] hover:[&:not(:focus)]:ring-transparent`,`focus:ring-2 focus:ring-[var(--interactive-focus-ring)] focus-visible:outline-none`,`aria-invalid:ring-[var(--status-error)] aria-invalid:focus:ring-[var(--status-error)]`,f,p,o,m),t[7]=o,t[8]=f,t[9]=p,t[10]=m,t[11]=h):h=t[11];let g;t[12]!==n||t[13]!==l||t[14]!==d||t[15]!==h||t[16]!==u?(g=(0,a.jsx)(`input`,{type:u,"data-slot":`input`,"data-bordered":n,placeholder:d,className:h,spellCheck:!1,autoComplete:`off`,autoCorrect:`off`,autoCapitalize:`off`,...l}),t[12]=n,t[13]=l,t[14]=d,t[15]=h,t[16]=u,t[17]=g):g=t[17];let _=g;if(!s)return _;let v;t[18]===s?v=t[19]:(v=(0,a.jsx)(`div`,{"data-slot":`input-end-adornment`,className:`absolute inset-y-0 end-0 flex items-center`,children:s}),t[18]=s,t[19]=v);let y;return t[20]!==_||t[21]!==v?(y=(0,a.jsxs)(`div`,{"data-slot":`input-wrapper`,className:`relative min-w-0 w-full flex-1`,children:[_,v]}),t[20]=_,t[21]=v,t[22]=y):y=t[22],y}export{o as t};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{l as t,u as n,z as r}from"./platform-BQipzOYw.js";import{a as i,i as a,r as o}from"./vendor-zustand-CTekDqaS.js";import{ot as s,st as c}from"./vendor-base-ui-wXsskyKm.js";import{St as l,an as u,jt as d,on as f}from"./gitApiHttp-CStyHJBc.js";import{t as p}from"./safeStorage-DTOhKN0V.js";import{i as m,t as h}from"./vendor-pathe-vBmvQE8f.js";import{n as g}from"./vendor-react-BkccXcWz.js";import{s as _,u as v}from"./vendor-tanstack-react-query-DIb_ItL-.js";import{E as y}from"./runtime-file-resource-DDGMqGyv.js";import{o as b}from"./path-utils-jGozTg9d.js";import{r as x}from"./vendor-reactuses-core-DjKFMfz7.js";import{r as S}from"./useUIStore-1DE4XJOx.js";import{o as C,s as w}from"./spacedFileMention-Ds4GtgiF.js";import{Ca as T,Ha as E,Ia as D,Ii as O,R as k,Va as ee,Zi as A,_ as j,b as M,do as te,dt as N,f as P,fa as ne,io as F,ki as I,xt as L}from"./ui-CuL4d44b.js";import{n as R}from"./Icon-DzOoxSwi.js";import{s as re}from"./remoteProjectQueries-CopzDHZe.js";import{t as ie}from"./i18n-BZ_vx76q.js";import{t as ae}from"./ScrollableOverlay-BzBFaJRG.js";import{t as oe}from"./useDebouncedValue-BHlMPqY8.js";import{t as se}from"./AgentAvatar-C4XFt_M4.js";import{c as ce,d as le,l as ue,n as de,r as fe,t as pe}from"./fileMentionTouchSelection-BpHcgqhk.js";import{a as me,o as he,s as ge}from"./fileMentionAutocompleteState-B9411b4o.js";var _e=(e,t)=>{let n=t.trim();if(!n)return[...e].sort((e,t)=>e.isBuiltIn===t.isBuiltIn?e.name.localeCompare(t.name):e.isBuiltIn?-1:1);let r=w([...e],n,e=>[e.name,e.description??``]);return r.sort((e,t)=>e.score===t.score?e.item.isBuiltIn===t.item.isBuiltIn?e.item.name.localeCompare(t.item.name):e.item.isBuiltIn?-1:1:e.score-t.score),r.map(e=>e.item)},ve=(e,t)=>e===t||e.length===t.length&&e.every((e,n)=>{let r=t[n];return r!=null&&e.id===r.id&&e.title===r.title&&(e.subtitle??``)===(r.subtitle??``)&&(e.badge??``)===(r.badge??``)&&e.iconName===r.iconName&&e.agentName===r.agentName}),ye=(e,t)=>e.highlightedIndex===t.highlightedIndex&&ve(e.rows,t.rows),be=(e,t)=>ve(e,t)?e:t.slice(),xe=(e,t,n)=>{e&&(t.current&&ye(t.current,n)||(t.current=n,e(n)))},Se=(e,t)=>{t.current=null,e?.({rows:[],highlightedIndex:0})},z=e(c(),1),B=g(),Ce=e=>e.directories.flatMap(e=>e.sessions),V=(e,t)=>({...re(e,t.location.hostId),select:Ce}),we=async(e,t,n)=>{n.sdk();let r=await e.fetchQuery(V(t,n));return n.sdk(),Ce(r)},H=(e,t,n,r)=>{n.sdk();let i=e.getQueryData(V(t,n).queryKey);for(let e of i?.directories??[]){let t=e.sessions.find(e=>e.id===r);if(t)return t.title||r}return r},U=(e,t,n,r={})=>({queryKey:[...e.queryScope,`composer-files`,t,n,r],staleTime:3e4,gcTime:3e4,queryFn:async({signal:i})=>{let a=await e.sdk().file.find({query:t,location:{directory:e.location.directory},limit:n,type:r.type},{signal:i});if(e.sdk(),i.throwIfAborted(),!Array.isArray(a.data))throw Error(`File search returned no data`);return a.data.map(t=>{let n=m(t.path),r=h(n);return{name:r,path:b(e.location.directory,n),relativePath:n,extension:r.includes(`.`)?r.split(`.`).pop()?.toLowerCase():void 0,isDirectory:t.type===`directory`}})}}),W=e=>{if(!e)return``;let t=e.replace(/\\/g,`/`),n=t.startsWith(`//`),r=t.replace(/\/+/g,`/`);n&&!r.startsWith(`//`)&&(r=`/${r}`);let i=r===`/`,a=/^[A-Za-z]:\/$/.test(r);return!i&&!a&&(r=r.replace(/\/+$/,``)),r},G=e=>/^[A-Za-z]:\//.test(e)?e.toLowerCase():e,K=e=>e.startsWith(`yuri-remote-location:`)?t(e):W(e),q=(e,t)=>{let r=W(n(t,`local`).directory),i=W(e);if(!r||!i)return!1;let a=G(r),o=G(i);return o===a||o.startsWith(a.endsWith(`/`)?a:`${a}/`)},J=e=>{if(!e||typeof e!=`object`)return{};let t=e,n={};for(let[e,r]of Object.entries(t)){let t;try{t=K(e)}catch{continue}if(!t||!r||typeof r!=`object`)continue;let i=r,a=Array.isArray(i.openPaths)?Array.from(new Set(i.openPaths.filter(e=>typeof e==`string`).map(e=>W(e)).filter(e=>q(e,t)))):[],o=Array.isArray(i.expandedPaths)?Array.from(new Set(i.expandedPaths.filter(e=>typeof e==`string`).map(e=>W(e)).filter(e=>q(e,t)))):[],s=typeof i.selectedPath==`string`?W(i.selectedPath):null,c=s&&q(s,t)?s:a[0]??null,l=typeof i.touchedAt==`number`&&Number.isFinite(i.touchedAt)?i.touchedAt:Date.now(),u=n[t];if(u){let e=Array.from(new Set([...u.openPaths,...a])),r=Array.from(new Set([...u.expandedPaths,...o])),i=u.selectedPath??c??e[0]??null;n[t]={openPaths:e,selectedPath:i,expandedPaths:r,touchedAt:Math.max(u.touchedAt,l)};continue}n[t]={openPaths:a,selectedPath:c,expandedPaths:o,touchedAt:l}}return n},Y=(e,t)=>{let n=Object.entries(e);if(n.length<=t)return e;n.sort((e,t)=>(t[1]?.touchedAt??0)-(e[1]?.touchedAt??0));let r={};for(let[e,i]of n.slice(0,t))r[e]=i;return r},X=e=>e?{...e,touchedAt:Date.now()}:{openPaths:[],selectedPath:null,expandedPaths:[],touchedAt:Date.now()},Z=i()(o(a((e,t)=>({byRoot:{},addOpenPath:(t,n,r)=>{let i=K((t||``).trim()),a=W((n||``).trim());!i||!a||!r?.allowOutsideRoot&&!q(a,i)||e(e=>{let t=e.byRoot[i],n=X(t),r=n.openPaths.includes(a),o=r?n.openPaths:[...n.openPaths,a],s=n.selectedPath??a;return t&&r&&t.selectedPath===s?e:{byRoot:Y({...e.byRoot,[i]:{...n,openPaths:o,selectedPath:s}},20)}})},removeOpenPath:(t,n)=>{let r=K((t||``).trim()),i=W((n||``).trim());!r||!i||e(e=>{let t=e.byRoot[r];if(!t)return e;let n=G(i),a=e=>G(e)===n,o=t.selectedPath?a(t.selectedPath):!1;if(!t.openPaths.some(a)&&!o)return e;let s=t.openPaths.filter(e=>!a(e)),c=o?s[0]??null:t.selectedPath;return{byRoot:Y({...e.byRoot,[r]:{...t,openPaths:s,selectedPath:c,touchedAt:Date.now()}},20)}})},removeOpenPathsByPrefix:(t,n)=>{let r=K((t||``).trim()),i=W((n||``).trim());!r||!i||e(e=>{let t=e.byRoot[r];if(!t)return e;let n=G(i),a=n.endsWith(`/`)?n:`${n}/`,o=e=>{let t=G(e);return t===n||t.startsWith(a)},s=t.openPaths.filter(e=>!o(e));if(s.length===t.openPaths.length)return e;let c=t.selectedPath&&o(t.selectedPath)?s[0]??null:t.selectedPath;return{byRoot:Y({...e.byRoot,[r]:{...t,openPaths:s,selectedPath:c,touchedAt:Date.now()}},20)}})},removeExpandedPathsByPrefix:(t,n)=>{let r=K((t||``).trim()),i=W((n||``).trim());!r||!i||e(e=>{let t=e.byRoot[r];if(!t)return e;let n=G(i),a=n.endsWith(`/`)?n:`${n}/`,o=t.expandedPaths.filter(e=>{let t=G(e);return t!==n&&!t.startsWith(a)});return o.length===t.expandedPaths.length?e:{byRoot:Y({...e.byRoot,[r]:{...t,expandedPaths:o,touchedAt:Date.now()}},20)}})},setSelectedPath:(t,n,r)=>{let i=K((t||``).trim()),a=n?W(n.trim()):null;!i||a&&!r?.allowOutsideRoot&&!q(a,i)||e(e=>{let t=e.byRoot[i],n=X(t),r=a&&!n.openPaths.includes(a)?[...n.openPaths,a]:n.openPaths;return t&&t.selectedPath===a&&r===t.openPaths?e:{byRoot:Y({...e.byRoot,[i]:{...n,openPaths:r,selectedPath:a}},20)}})},ensureSelectedPath:e=>{let n=K((e||``).trim());if(!n)return;let r=t().byRoot[n];if(!r||r.selectedPath)return;let i=r.openPaths[0]??null;i&&t().setSelectedPath(n,i)},toggleExpandedPath:(t,n)=>{let r=K((t||``).trim()),i=W((n||``).trim());!r||!i||!q(i,r)||e(e=>{let t=e.byRoot[r],n=X(t),a=n.expandedPaths.includes(i)?n.expandedPaths.filter(e=>e!==i):[...n.expandedPaths,i];return t&&t.expandedPaths===a&&t.selectedPath===n.selectedPath&&t.openPaths===n.openPaths?e:{byRoot:Y({...e.byRoot,[r]:{...n,expandedPaths:a}},20)}})},expandPath:(t,n)=>{let r=K((t||``).trim()),i=W((n||``).trim());!r||!i||!q(i,r)||e(e=>{let t=e.byRoot[r],n=X(t);return n.expandedPaths.includes(i)&&t?e:{byRoot:Y({...e.byRoot,[r]:{...n,expandedPaths:[...n.expandedPaths,i]}},20)}})},expandPaths:(t,n)=>{let r=K((t||``).trim());if(!r||!n||n.length===0)return;let i=n.map(e=>W((e||``).trim())).filter(e=>e&&q(e,r));i.length!==0&&e(e=>{let t=e.byRoot[r],n=X(t),a=new Set(n.expandedPaths),o=i.filter(e=>!a.has(e));return o.length===0?e:{byRoot:Y({...e.byRoot,[r]:{...n,expandedPaths:[...n.expandedPaths,...o]}},20)}})}}),{name:`files-view-tabs-store`,version:2,storage:p(),migrate:e=>{if(!e||typeof e!=`object`)return{byRoot:{}};let t=e.byRoot;return{byRoot:J(t)}},merge:(e,t)=>({...t,byRoot:J(e&&typeof e==`object`?e.byRoot:void 0)}),partialize:e=>({byRoot:J(e.byRoot)})}),{name:`files-view-tabs-store`})),Q=()=>{let e=(0,B.c)(17),t=P(Te),n=L(),r;e[0]===t?r=e[1]:(r=e=>t?e.getAttachment(t):void 0,e[0]=t,e[1]=r);let i=M(r),a=P(Ee),o=P(De),s=E(Oe),c=E(ke),u=l(Ae);if(t){let r;e[2]===i?r=e[3]:(r=j(i),e[2]=i,e[3]=r);let o=r;if(o)return o;let s;e[4]!==t||e[5]!==a?(s=a.get(t),e[4]=t,e[5]=a,e[6]=s):s=e[6];let c=s;if(c?.path)return c.path;let l;if(e[7]!==t||e[8]!==n){let r;e[10]===t?r=e[11]:(r=e=>e.id===t,e[10]=t,e[11]=r),l=n.find(r),e[7]=t,e[8]=n,e[9]=l}else l=e[9];let u=l;if(u?.directory)return u.directory}if(o?.open&&(o.bootstrapPendingDirectory||o.directoryOverride))return(o.bootstrapPendingDirectory||o.directoryOverride)??void 0;if(s){let t;if(e[12]!==s||e[13]!==c){let n;e[15]===s?n=e[16]:(n=e=>e.id===s,e[15]=s,e[16]=n),t=c.find(n),e[12]=s,e[13]=c,e[14]=t}else t=e[14];let n=t;if(n?.path)return n.path}return u??void 0};function Te(e){return e.currentSessionId}function Ee(e){return e.worktreeMetadata}function De(e){return e.newSessionDraft}function Oe(e){return e.activeProjectId}function ke(e){return e.projects}function Ae(e){return e.currentDirectory}var $=s(),je=`bg-transparent font-[inherit] text-[var(--primary-base)]`,Me=(e,t)=>{let n=t.trim().toLowerCase();if(!n)return e;let r=e.toLowerCase();if(!r.includes(n))return e;let i=[],a=0,o=r.indexOf(n);for(;o!==-1;)o>a&&i.push(e.slice(a,o)),i.push((0,$.jsx)(`mark`,{className:je,children:e.slice(o,o+n.length)},`${o}-${n}`)),a=o+n.length,o=r.indexOf(n,a);return a<e.length&&i.push(e.slice(a)),i},Ne=z.forwardRef((e,t)=>{let n=(0,B.c)(4),r=y(),i;return n[0]!==r||n[1]!==e||n[2]!==t?(i=r?.entry.location.hostId?(0,$.jsx)(Le,{...e,ref:t,entry:r.entry,registry:r.registry},JSON.stringify(r.entry.queryScope)):(0,$.jsx)(Pe,{...e,ref:t}),n[0]=r,n[1]=e,n[2]=t,n[3]=i):i=n[3],i}),Pe=z.forwardRef((e,t)=>{let n=(0,B.c)(22),r=Q()??``,i=P(ze),a=O(Be),o=!!e.onSessionSelect,s;n[0]===o?s=n[1]:(s={enabled:o},n[0]=o,n[1]=s);let c=k(s),l=E(Ve),u=E(He),f;if(n[2]!==l||n[3]!==r||n[4]!==u){let e=u.find(e=>e.id===l)?.path||r;f=e?e.replace(/\\/g,`/`).replace(/\/+$/,``):null,n[2]=l,n[3]=r,n[4]=u,n[5]=f}else f=n[5];let p=f,m;n[6]===p?m=n[7]:(m=e=>p?e.byRoot[p]:void 0,n[6]=p,n[7]=m);let h=Z(m),g=A(Ue),_=d(We),v;n[8]!==a||n[9]!==c||n[10]!==e.onSessionSelect?(v=e.onSessionSelect?I(a,c):[],n[8]=a,n[9]=c,n[10]=e.onSessionSelect,n[11]=v):v=n[11];let y=v,b=e.currentSessionId??i,x;return n[12]!==g||n[13]!==r||n[14]!==p||n[15]!==h||n[16]!==e||n[17]!==t||n[18]!==_||n[19]!==y||n[20]!==b?(x=(0,$.jsx)(Re,{...e,ref:t,currentDirectory:r,currentSessionId:b,projectRoot:p,projectTabs:h,agentCatalog:g,sessions:y,searchFiles:_}),n[12]=g,n[13]=r,n[14]=p,n[15]=h,n[16]=e,n[17]=t,n[18]=_,n[19]=y,n[20]=b,n[21]=x):x=n[21],x}),Fe=[],Ie=[],Le=z.forwardRef((e,t)=>{let n=(0,B.c)(32),{entry:r,registry:i}=e,a=v(),o;n[0]===r?o=n[1]:(o=D(r.location.directory,void 0,r),n[0]=r,n[1]=o);let s=!!e.onAgentSelect,c;n[2]!==o||n[3]!==s?(c={...o,enabled:s},n[2]=o,n[3]=s,n[4]=c):c=n[4];let l=_(c),u;n[5]!==r||n[6]!==i?(u=V(i,r),n[5]=r,n[6]=i,n[7]=u):u=n[7];let d=!!e.onSessionSelect,f;n[8]!==u||n[9]!==d?(f={...u,enabled:d},n[8]=u,n[9]=d,n[10]=f):f=n[10];let p=_(f),m;n[11]===r.key?m=n[12]:(m=e=>e.byRoot[r.key],n[11]=r.key,n[12]=m);let h=Z(m),g;n[13]!==a||n[14]!==r?(g=(e,t,n,i)=>{let o=n===void 0?60:n;return a.fetchQuery(U(r,t,o,i))},n[13]=a,n[14]=r,n[15]=g):g=n[15];let y=x(g),b=r.location.directory,S;if(n[16]!==r.location.directory){let e;n[18]===Symbol.for(`react.memo_cache_sentinel`)?(e=/\/+$/,n[18]=e):e=n[18],S=r.location.directory.replace(/\\/g,`/`).replace(e,``),n[16]=r.location.directory,n[17]=S}else S=n[17];let C=l.data??Ie,w=p.data??Fe,T=l.error??p.error,E;n[19]===r?E=n[20]:(E=()=>{r.sdk()},n[19]=r,n[20]=E);let O;return n[21]!==r.location.directory||n[22]!==h||n[23]!==e||n[24]!==t||n[25]!==y||n[26]!==C||n[27]!==w||n[28]!==T||n[29]!==E||n[30]!==S?(O=(0,$.jsx)(Re,{...e,ref:t,currentDirectory:b,projectRoot:S,projectTabs:h,agentCatalog:C,sessions:w,searchFiles:y,catalogError:T,assertCurrent:E}),n[21]=r.location.directory,n[22]=h,n[23]=e,n[24]=t,n[25]=y,n[26]=C,n[27]=w,n[28]=T,n[29]=E,n[30]=S,n[31]=O):O=n[31],O}),Re=z.forwardRef(({searchQuery:e,onFileSelect:t,onAgentSelect:n,onSkillSelect:r,onSessionSelect:i,onClose:a,style:o,onRowsChange:s,currentDirectory:c,currentSessionId:l,projectRoot:d,projectTabs:p,agentCatalog:m,sessions:h,searchFiles:g,catalogError:_,assertCurrent:v},y)=>{let{t:b}=ie(),w=oe(e,180),E=f(),D=u(),[O,k]=z.useState([]),[ee,A]=z.useState(!1),[j,M]=z.useState(null),[N,P]=z.useState(0),I=z.useRef(0),L=z.useRef({query:e,directory:c,ids:[]}),[re,le]=z.useState(360),[ue,_e]=z.useState({}),[ve,ye]=z.useState({}),be=z.useRef([]),B=z.useRef([]),Ce=z.useRef([]),V=z.useRef(null),we=z.useRef(null),H=z.useRef(null);H.current||=pe();let U=S(e=>e.isMobile),W=(e??``).trim(),G=T({directory:c||null}),K=z.useMemo(()=>r?G.data??[]:[],[r,G.data]),q=z.useMemo(()=>{if(!d||!p)return[];let e=[p.selectedPath,...p.openPaths.slice().reverse()].filter(e=>typeof e==`string`&&e.length>0),t=new Set,n=[];for(let r of e){if(t.has(r))continue;t.add(r);let e=r.replace(/\\/g,`/`),i=e.split(`/`).filter(Boolean).pop()||e,a=e.startsWith(`${d}/`)?e.slice(d.length+1):e;n.push({name:i,path:e,relativePath:a,extension:i.includes(`.`)?i.split(`.`).pop()?.toLowerCase():void 0})}return ge(n,W,{limit:6})},[W,d,p]),J=z.useMemo(()=>n?ne(m).filter(e=>e.mode!==`primary`):[],[m,n]),Y=z.useMemo(()=>i?me({sessions:h,currentSessionId:l??null,searchQuery:W}):[],[h,l,W,i]),X=q,Z=O,Q=z.useMemo(()=>ce({skills:K,agents:J,sessions:Y,recentFiles:X,pathHits:Z,searchQuery:W,untitledSession:b(`chat.fileMentionAutocomplete.untitledSession`),sessionBadge:b(`chat.fileMentionAutocomplete.sessionType`),skillBadge:b(`chat.commandAutocomplete.badge.skill`)}),[K,J,Y,X,Z,W,b]);z.useEffect(()=>{let e=e=>{let t=e.target;!t||!V.current||V.current.contains(t)||a()};return document.addEventListener(`pointerdown`,e,!0),()=>{document.removeEventListener(`pointerdown`,e,!0)}},[a]),z.useEffect(()=>{if(!c){k([]),A(!1),M(null);return}let e=(w??``).trim(),t=C(e);if(!t){k([]),A(!1),M(null);return}let n=!1;A(!0),M(null);let r={includeHidden:E,respectGitignore:!D};return Promise.all([g(c,t,80,{...r,type:`file`}),g(c,t,40,{...r,type:`directory`})]).then(([t,r])=>{if(n)return;let i=new Set(q.map(e=>e.path));k(he({files:t,directories:r,query:e,excludePaths:i,limit:20}))}).catch(e=>{n||M(e instanceof Error?e:Error(String(e)))}).finally(()=>{n||A(!1)}),()=>{n=!0}},[c,w,q,g,E,D]),z.useLayoutEffect(()=>{let t=L.current,n=t.ids[I.current],r=t.query===e&&t.directory===c?Math.max(0,Q.findIndex(e=>e.id===n)):0;L.current={query:e,directory:c,ids:Q.map(e=>e.id)},I.current=r,P(r)},[Q,e,c]),z.useEffect(()=>{_e({}),ye({})},[Q]),z.useEffect(()=>{be.current[N]?.scrollIntoView({block:`nearest`})},[N]),z.useEffect(()=>{let e=null,t=()=>{e!==null&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{let e={},t={};B.current.forEach((n,r)=>{if(!n)return;let i=Ce.current[r]?.offsetWidth??n.scrollWidth,a=Math.max(0,i-n.clientWidth),o=a>8;if(e[r]=o,o){let e=Math.max(.6,a/110);t[r]=e}}),_e(e),ye(t)})};return t(),window.addEventListener(`resize`,t),()=>{e!==null&&cancelAnimationFrame(e),window.removeEventListener(`resize`,t)}},[Q]),z.useEffect(()=>{let e=B.current[N];if(!e)return;let t=()=>{let t=e.clientWidth;t>0&&le(t)};if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect()}},[N]);let Te=x(e=>{t(e)}),Ee=x(e=>{n?.(e)}),De=x(e=>{i?.(e)}),Oe=x(e=>{r?.(e)}),ke=(e,t)=>({onMouseDown:e=>e.preventDefault(),onPointerDown:e=>{e.pointerType===`touch`&&H.current?.pointerDown(e.clientX,e.clientY)},onPointerMove:e=>{e.pointerType===`touch`&&H.current?.pointerMove(e.clientX,e.clientY)},onPointerUp:e=>{e.pointerType===`touch`&&(H.current?.pointerUp(t)??!1)&&(e.preventDefault(),e.stopPropagation())},onPointerCancel:()=>H.current?.pointerCancel(),onClick:()=>{H.current?.click(t)},onMouseMove:()=>{I.current=e,P(e)}}),Ae=e=>{try{v?.()}catch(e){M(e instanceof Error?e:Error(String(e)));return}let t=Q.length;if(t===0)return;let n=(e%t+t)%t,r=Q[n];if(r.agentName!==void 0){Ee(r.agentName);return}if(r.id.startsWith(`skill:`)){let e=K.find(e=>r.id===`skill:${e.name}-${e.scope}`);e&&Oe(e);return}if(r.id.startsWith(`session:`)){let e=Y.find(e=>r.id===`session:${e.id}`);e&&De(e);return}let i=r.id.startsWith(`recent:`)?X.find(e=>r.id===`recent:${e.path}`):Z.find(e=>r.id===`file:${e.path}`);i&&Te(i)};z.useEffect(()=>{xe(s,we,{rows:Q,highlightedIndex:N})},[s,N,Q]);let je=z.useRef(s);return je.current=s,z.useEffect(()=>()=>{Se(je.current,we)},[]),z.useImperativeHandle(y,()=>({acceptIndex:e=>{Ae(e)},handleKeyDown:e=>{if(e===`Escape`){a();return}let t=Q.length;if(t!==0){if(e===`ArrowDown`){I.current=(I.current+1)%t,P(I.current);return}if(e===`ArrowUp`){I.current=(I.current-1+t)%t,P(I.current);return}(e===`Enter`||e===`Tab`)&&Ae(I.current)}}})),(0,$.jsxs)(de,{ref:V,isMobile:U,className:`max-w-[640px] max-h-64`,style:o,children:[(0,$.jsx)(ae,{preventOverscroll:!0,outerClassName:`flex-1 min-h-0`,className:`px-0`,children:(0,$.jsxs)(`div`,{className:`py-1`,children:[_||G.error||j?(0,$.jsx)(`div`,{role:`alert`,className:`px-3 py-2 typography-ui-label text-muted-foreground`,children:(_??G.error??j)?.message}):null,Q.map((e,t)=>{let n=e.id.startsWith(`file:`)||e.id.startsWith(`recent:`),r=n?te(e.title,{maxLength:60}):e.title,i=N===t,a=ue[t]??!1,o=ve[t]??2.6;return(0,$.jsxs)(`div`,{"data-mention-id":e.id,ref:e=>{be.current[t]=e},className:F(`flex items-center gap-2 px-3 py-1.5 cursor-pointer typography-ui-label rounded-lg`,U&&`min-h-11`,fe(U,i),!U&&i&&`text-interactive-selection-foreground`),...ke(t,()=>Ae(t)),children:[(0,$.jsx)(`span`,{className:`flex size-5 shrink-0 items-center justify-center`,children:e.agentName===void 0?(0,$.jsx)(R,{name:e.iconName,className:`size-3.5 text-current`}):(0,$.jsx)(se,{name:e.agentName,size:20})}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,$.jsxs)(`span`,{ref:e=>{B.current[t]=e},className:F(`relative block min-w-0 overflow-hidden`,n&&a&&i&&`file-mention-marquee-container`),style:i?{"--file-mention-marquee-width":`${re}px`,"--file-mention-marquee-duration":`${o}s`}:void 0,title:e.title,children:[(0,$.jsx)(`span`,{ref:e=>{Ce.current[t]=e},className:`absolute invisible whitespace-nowrap pointer-events-none`,"aria-hidden":!0,children:e.title}),n&&a&&i?(0,$.jsx)(`span`,{className:`inline-block whitespace-nowrap file-mention-marquee`,children:Me(e.title,W)}):(0,$.jsx)(`span`,{className:`block truncate`,children:Me(r,W)})]}),e.trailingLabel?(0,$.jsx)(`span`,{className:F(`max-w-[40%] shrink-0 truncate text-muted-foreground`,U?`typography-micro`:`typography-meta`),children:e.trailingLabel}):null]}),e.subtitle?(0,$.jsx)(`div`,{className:F(`truncate text-muted-foreground`,U?`typography-micro`:`typography-meta`),children:Me(e.subtitle,W)}):null]})]},e.id)}),ee&&Z.length===0?(0,$.jsx)(`div`,{className:`flex items-center justify-center py-3`,children:(0,$.jsx)(R,{name:`refresh`,className:`h-4 w-4 animate-spin text-muted-foreground`})}):null,!ee&&Q.length===0&&(0,$.jsx)(`div`,{className:`px-3 py-2 typography-ui-label text-muted-foreground`,children:b(`chat.fileMentionAutocomplete.empty`)})]})}),!U&&(0,$.jsx)(`div`,{className:`px-3 pt-1 pb-1.5 border-t typography-meta text-muted-foreground`,children:b(`chat.autocomplete.keyboardHint`)})]})});function ze(e){return e.currentSessionId}function Be(e){return e.activeSessions}function Ve(e){return e.activeProjectId}function He(e){return e.projects}function Ue(e){return e.agents}function We(e){return e.searchFiles}var Ge=new Set([`new`,`fork`,`compact`,`reload`,`undo`,`redo`,`model`,`btw`]),Ke=(e,t)=>{if(!t||e.isSkill)return!1;let n=e.name?.trim().toLowerCase();return!!(n&&Ge.has(n))},qe=(e,t)=>!e||t({name:e}),Je=` `,Ye=(e,t)=>{let n=Math.max(0,Math.min(t,e.length)),r=n;for(;r>0&&!/\s/.test(e[r-1]);)--r;return r>=2&&e[r-1]===Je&&e[r-2]===`/`&&(r-=2),e[r]===`/`?{start:r,end:n}:null},Xe=`text-[10px] leading-none uppercase font-bold tracking-tight px-1.5 py-1 rounded border flex-shrink-0`,Ze=F(Xe,`bg-[color-mix(in_srgb,var(--primary-base)_12%,transparent)] text-[color-mix(in_srgb,var(--primary-base)_70%,transparent)] border-[color-mix(in_srgb,var(--primary-base)_24%,transparent)]`),Qe=F(Xe,`bg-[color-mix(in_srgb,var(--status-success)_12%,transparent)] text-[color-mix(in_srgb,var(--status-success)_70%,transparent)] border-[color-mix(in_srgb,var(--status-success)_24%,transparent)]`),$e=F(Xe,`bg-[color-mix(in_srgb,var(--status-info)_12%,transparent)] text-[color-mix(in_srgb,var(--status-info)_70%,transparent)] border-[color-mix(in_srgb,var(--status-info)_24%,transparent)]`),et=F(Xe,`bg-[var(--surface-muted)] text-muted-foreground border-[var(--interactive-border)]/60`),tt=(e,t)=>e.length===t.length&&e.every((e,n)=>e.id===t[n]?.id&&e.description===t[n]?.description),nt=e=>{let t=!!e.sessionID;return{hasSession:t,canStartSessionCommand:t||e.hasNewDraft}},rt=z.forwardRef(({searchQuery:e,onCommandSelect:t,onClose:n,directory:i,style:a,commandPolicy:o,commandContext:s,onRowsChange:c},l)=>{let{t:u}=ie(),d=S(e=>e.isMobile),f=P(e=>e.currentSessionId),p=P(e=>!!e.newSessionDraft?.open),m=P(z.useCallback(e=>f?e.getDirectoryForSession(f):void 0,[f])),h=N(f??``,m??void 0),g=z.useMemo(()=>s??{sessionID:f??null,hasMessages:h.length>0,hasNewDraft:p},[s,f,h.length,p]),{hasSession:_,canStartSessionCommand:v}=z.useMemo(()=>nt(g),[g]),y=g.hasMessages,[b,x]=z.useState([]),[C,w]=z.useState(!1),T=ee({directory:i}),E=z.useMemo(()=>T.data??[],[T.data]),D=T.isFetching,[O,k]=z.useState(0),A=z.useRef(0),j=z.useRef(!1),M=z.useRef([]),te=z.useRef(null),ne=z.useRef(!1),I=z.useRef(null),L=z.useRef(!1),re=z.useRef(null);z.useEffect(()=>{let e=e=>{let t=e.target;!t||!te.current||te.current.contains(t)||n()};return document.addEventListener(`pointerdown`,e,!0),()=>{document.removeEventListener(`pointerdown`,e,!0)}},[n]),z.useEffect(()=>{(async()=>{w(D);try{let t=E.flatMap((e,t)=>e.source===`skill`?[]:[{id:`opencode:${e.scope??`global`}:${e.name}:${e.agent??``}:${e.model??``}:${t}`,name:e.name,source:`opencode`,description:e.description,agent:e.agent??void 0,model:e.model??void 0,isBuiltIn:e.isBuiltIn,scope:e.scope,reference:e.reference}]),n=[{id:`yuri:new`,name:`new`,source:`yuri`,description:u(`chat.commandAutocomplete.command.newDescription`),isBuiltIn:!0},..._&&!y?[{id:`yuri:init`,name:`init`,source:`yuri`,description:u(`chat.commandAutocomplete.command.initDescription`),isBuiltIn:!0}]:[],..._?[{id:`yuri:btw`,name:`btw`,source:`yuri`,description:u(`chat.btw.description`),isBuiltIn:!0},{id:`yuri:undo`,name:`undo`,source:`yuri`,description:u(`chat.commandAutocomplete.command.undoDescription`),isBuiltIn:!0},{id:`yuri:redo`,name:`redo`,source:`yuri`,description:u(`chat.commandAutocomplete.command.redoDescription`),isBuiltIn:!0},{id:`yuri:fork`,name:`fork`,source:`yuri`,description:u(`chat.commandAutocomplete.command.forkDescription`),isBuiltIn:!0},{id:`yuri:timeline`,name:`timeline`,source:`yuri`,description:u(`chat.commandAutocomplete.command.timelineDescription`),isBuiltIn:!0}]:[],{id:`yuri:model`,name:`model`,source:`yuri`,description:u(`chat.commandAutocomplete.command.modelDescription`),isBuiltIn:!0},{id:`yuri:compact`,name:`compact`,source:`yuri`,description:u(`chat.commandAutocomplete.command.compactDescription`),isBuiltIn:!0},...r()?[{id:`yuri:reload`,name:`reload`,source:`yuri`,description:u(`chat.commandAutocomplete.command.reloadDescription`),isBuiltIn:!0}]:[],..._?[{id:`yuri:summary`,name:`summary`,source:`yuri`,description:u(`chat.commandAutocomplete.command.summaryDescription`),isYuri:!0}]:[],...v?[{id:`yuri:workspace-review`,name:`workspace-review`,source:`yuri`,description:u(`chat.commandAutocomplete.command.workspaceReviewDescription`),isYuri:!0}]:[],...v?[{id:`yuri:craft-goal`,name:`craft-goal`,source:`yuri`,description:u(`chat.commandAutocomplete.command.craftGoalDescription`),isYuri:!0}]:[],...v?[{id:`yuri:catch-up`,name:`catch-up`,source:`yuri`,description:u(`chat.commandAutocomplete.command.catchUpDescription`),isYuri:!0}]:[],...v?[{id:`yuri:debug`,name:`debug`,source:`yuri`,description:u(`chat.commandAutocomplete.command.debugDescription`),isYuri:!0}]:[],...v?[{id:`yuri:weigh`,name:`weigh`,source:`yuri`,description:u(`chat.commandAutocomplete.command.weighDescription`),isYuri:!0}]:[],...v?[{id:`yuri:explore`,name:`explore`,source:`yuri`,description:u(`chat.commandAutocomplete.command.exploreDescription`),isYuri:!0}]:[],...t],i=!y,a=_e(n.filter(e=>(i||e.name!==`init`)&&(o?.(e)??!0)),e);x(e=>tt(e,a)?e:a)}catch{let t=!y,n=_e([{id:`yuri:new`,name:`new`,source:`yuri`,description:u(`chat.commandAutocomplete.command.newDescription`),isBuiltIn:!0},..._&&!y?[{id:`yuri:init`,name:`init`,source:`yuri`,description:u(`chat.commandAutocomplete.command.initDescription`),isBuiltIn:!0}]:[],..._?[{id:`yuri:btw`,name:`btw`,source:`yuri`,description:u(`chat.btw.description`),isBuiltIn:!0},{id:`yuri:undo`,name:`undo`,source:`yuri`,description:u(`chat.commandAutocomplete.command.undoDescription`),isBuiltIn:!0},{id:`yuri:redo`,name:`redo`,source:`yuri`,description:u(`chat.commandAutocomplete.command.redoDescription`),isBuiltIn:!0},{id:`yuri:fork`,name:`fork`,source:`yuri`,description:u(`chat.commandAutocomplete.command.forkDescription`),isBuiltIn:!0},{id:`yuri:timeline`,name:`timeline`,source:`yuri`,description:u(`chat.commandAutocomplete.command.timelineDescription`),isBuiltIn:!0}]:[],{id:`yuri:model`,name:`model`,source:`yuri`,description:u(`chat.commandAutocomplete.command.modelDescription`),isBuiltIn:!0},{id:`yuri:compact`,name:`compact`,source:`yuri`,description:u(`chat.commandAutocomplete.command.compactDescription`),isBuiltIn:!0},...r()?[{id:`yuri:reload`,name:`reload`,source:`yuri`,description:u(`chat.commandAutocomplete.command.reloadDescription`),isBuiltIn:!0}]:[],..._?[{id:`yuri:summary`,name:`summary`,source:`yuri`,description:u(`chat.commandAutocomplete.command.summaryDescription`),isYuri:!0}]:[],...v?[{id:`yuri:workspace-review`,name:`workspace-review`,source:`yuri`,description:u(`chat.commandAutocomplete.command.workspaceReviewDescription`),isYuri:!0}]:[],...v?[{id:`yuri:craft-goal`,name:`craft-goal`,source:`yuri`,description:u(`chat.commandAutocomplete.command.craftGoalDescription`),isYuri:!0}]:[],...v?[{id:`yuri:catch-up`,name:`catch-up`,source:`yuri`,description:u(`chat.commandAutocomplete.command.catchUpDescription`),isYuri:!0}]:[],...v?[{id:`yuri:debug`,name:`debug`,source:`yuri`,description:u(`chat.commandAutocomplete.command.debugDescription`),isYuri:!0}]:[],...v?[{id:`yuri:weigh`,name:`weigh`,source:`yuri`,description:u(`chat.commandAutocomplete.command.weighDescription`),isYuri:!0}]:[],...v?[{id:`yuri:explore`,name:`explore`,source:`yuri`,description:u(`chat.commandAutocomplete.command.exploreDescription`),isYuri:!0}]:[]].filter(e=>(t||e.name!==`init`)&&(o?.(e)??!0)),e);x(e=>tt(e,n)?e:n)}finally{w(!1)}})()},[e,y,_,v,E,D,u,o]),z.useEffect(()=>{k(0)},[b]),z.useEffect(()=>{A.current=O},[O]),z.useEffect(()=>{M.current[O]?.scrollIntoView({block:`nearest`})},[O]),z.useEffect(()=>{xe(c,re,{rows:ue(b,{skill:u(`chat.commandAutocomplete.badge.skill`),command:u(`chat.commandAutocomplete.badge.command`),system:u(`chat.commandAutocomplete.badge.system`)}),highlightedIndex:O})},[b,c,O,u]);let oe=z.useRef(c);oe.current=c,z.useEffect(()=>()=>{Se(oe.current,re)},[]),z.useImperativeHandle(l,()=>({acceptIndex:(e,n=!0)=>{let r=b[e];r&&t(r,Ke(r,n))},handleKeyDown:e=>{let r=b.length;if(e===`Escape`){n();return}if(r!==0){if(e===`ArrowDown`){j.current=!0,k(e=>(e+1)%r);return}if(e===`ArrowUp`){j.current=!0,k(e=>(e-1+r)%r);return}if(e===`Enter`||e===`Tab`){let n=(A.current%r+r)%r,i=b[n];i&&t(i,Ke(i,e===`Enter`))}}}}),[b,n,t]);let se=e=>{let t=le(e);switch(e.name){case`new`:return(0,$.jsx)(R,{name:t,className:`h-3.5 w-3.5`});case`init`:return(0,$.jsx)(R,{name:t,className:`h-3.5 w-3.5 text-green-500`});case`undo`:return(0,$.jsx)(R,{name:t,className:`h-3.5 w-3.5 text-orange-500`});case`redo`:return(0,$.jsx)(R,{name:t,className:`h-3.5 w-3.5 text-orange-500`});case`timeline`:case`reload`:return(0,$.jsx)(R,{name:t,className:`h-3.5 w-3.5`});case`compact`:return(0,$.jsx)(R,{name:t,className:`h-3.5 w-3.5 text-purple-500`});case`goal`:return(0,$.jsx)(R,{name:t,className:`h-3.5 w-3.5`});case`review`:return(0,$.jsx)(R,{name:t,className:`h-3.5 w-3.5 text-blue-500`});case`test`:case`build`:case`run`:return(0,$.jsx)(R,{name:t,className:`h-3.5 w-3.5 text-cyan-500`});default:return e.isBuiltIn?(0,$.jsx)(R,{name:t,className:`h-3.5 w-3.5 text-yellow-500`}):(0,$.jsx)(R,{name:t,className:`h-3.5 w-3.5 text-muted-foreground`})}};return(0,$.jsxs)(de,{ref:te,isMobile:d,className:`max-w-[450px] max-h-64`,style:a,children:[(0,$.jsx)(ae,{preventOverscroll:!0,outerClassName:`flex-1 min-h-0`,className:`px-0 py-1.5`,children:C?(0,$.jsx)(`div`,{className:`flex items-center justify-center py-4`,children:(0,$.jsx)(R,{name:`refresh`,className:`h-4 w-4 animate-spin text-muted-foreground`})}):(0,$.jsxs)(`div`,{children:[b.map((n,r)=>{let i=n.isBuiltIn,a=n.isYuri;return(0,$.jsxs)(`div`,{ref:e=>{M.current[r]=e},className:F(`flex gap-2 px-2 py-2 cursor-pointer rounded-lg`,d?`items-center`:`items-start`,fe(d,r===O),!d&&r===O&&`bg-interactive-selection/35`),onMouseDown:e=>e.preventDefault(),onPointerDown:e=>{e.pointerType===`touch`&&(I.current={x:e.clientX,y:e.clientY},L.current=!1)},onPointerMove:e=>{if(e.pointerType!==`touch`||!I.current)return;let t=e.clientX-I.current.x,n=e.clientY-I.current.y;Math.hypot(t,n)>6&&(L.current=!0)},onPointerUp:e=>{if(e.pointerType!==`touch`)return;let r=L.current;I.current=null,L.current=!1,!r&&(e.preventDefault(),e.stopPropagation(),ne.current=!0,t(n,Ke(n,d)))},onPointerCancel:()=>{I.current=null,L.current=!1},onClick:()=>{if(ne.current){ne.current=!1;return}t(n,Ke(n,d))},onMouseMove:()=>{j.current=!1,k(r)},children:[(0,$.jsx)(`div`,{className:F(!d&&`mt-0.5`),children:se(n)}),(0,$.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsxs)(`span`,{className:`typography-ui-label font-medium`,children:[`/`,Me(n.name,e)]}),n.isSkill?(0,$.jsx)(`span`,{className:Ze,children:u(`chat.commandAutocomplete.badge.skill`)}):(0,$.jsx)(`span`,{className:Ze,children:u(`chat.commandAutocomplete.badge.command`)}),a?(0,$.jsx)(`span`,{className:et,children:`Yuri`}):i?(0,$.jsx)(`span`,{className:et,children:u(`chat.commandAutocomplete.badge.system`)}):n.scope?(0,$.jsx)(`span`,{className:n.scope===`project`?$e:Qe,children:n.scope}):null,n.agent&&(0,$.jsx)(`span`,{className:et,children:n.agent})]}),n.description&&!d&&(0,$.jsx)(`div`,{className:`typography-meta text-muted-foreground mt-0.5 truncate`,children:Me(n.description,e)})]})]},n.id)}),b.length===0&&(0,$.jsx)(`div`,{className:`px-3 py-2 typography-ui-label text-muted-foreground`,children:u(`chat.commandAutocomplete.empty`)})]})}),!d&&(0,$.jsx)(`div`,{className:`px-3 pt-1 pb-1.5 border-t typography-meta text-muted-foreground`,children:u(`chat.autocomplete.keyboardHint`)})]})});rt.displayName=`CommandAutocomplete`;var it=(e,t,n)=>{if(!e)return e;let r=t.length>0&&!/\s$/.test(t)&&!/^\s/.test(e)&&!/[([{]$/.test(t),i=n.length>0&&!/\s$/.test(e)&&!/^\s/.test(n)&&!/^[\])}.,;:!?]/.test(n);return`${r?` `:``}${e}${i?` `:``}`},at=(e,t,n)=>{let r=it(e,t,n);return`${t.length===0&&!/^\s/.test(r)?` `:``}${r}${n.length===0&&!/\s$/.test(r)?` `:``}`},ot=(e,t,n,r)=>{let i=e.slice(0,t),a=e.slice(n),o=at(r,i,a),s=Math.max(0,o.indexOf(r)),c=i.length+s;return{text:`${i}${o}${a}`,caret:i.length+o.length,start:c,end:c+r.length}},st=(e,t)=>{let n=e=>`${e.kind}:${e.value}:${e.range.start}:${e.range.end}`;return new Set(e.map(n)).has(n(t))||e.some(e=>e.range.start<t.range.end&&t.range.start<e.range.end)?[...e]:[...e,t]},ct=(e,t)=>t<e.length&&e[t]===` `?t+1:t;export{rt as a,Ne as c,we as d,H as f,at as i,Q as l,st as n,Ye as o,be as p,ot as r,qe as s,ct as t,Z as u};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{l as t,u as n,z as r}from"./platform-BQipzOYw.js";import{a as i,i as a,r as o}from"./vendor-zustand-CTekDqaS.js";import{ot as s,st as c}from"./vendor-base-ui-wXsskyKm.js";import{St as l,an as u,jt as d,on as f}from"./gitApiHttp-CStyHJBc.js";import{t as p}from"./safeStorage-DTOhKN0V.js";import{i as m,t as h}from"./vendor-pathe-vBmvQE8f.js";import{n as g}from"./vendor-react-BkccXcWz.js";import{s as _,u as v}from"./vendor-tanstack-react-query-DIb_ItL-.js";import{E as y}from"./runtime-file-resource-DDGMqGyv.js";import{o as b}from"./path-utils-jGozTg9d.js";import{r as x}from"./vendor-reactuses-core-DjKFMfz7.js";import{r as S}from"./useUIStore-1DE4XJOx.js";import{c as C,o as w}from"./spacedFileMention-DfI79AYT.js";import{Ca as T,Ha as E,Ia as D,Ii as O,R as k,Va as ee,Zi as A,_ as j,b as M,do as te,dt as N,f as P,fa as ne,io as F,ki as I,xt as L}from"./ui-gH75_gWj.js";import{n as R}from"./Icon-BUHzyKnj.js";import{s as re}from"./remoteProjectQueries-CopzDHZe.js";import{t as ie}from"./i18n-CJn52oz0.js";import{t as ae}from"./ScrollableOverlay-BqOsMuIW.js";import{t as oe}from"./useDebouncedValue-BHlMPqY8.js";import{t as se}from"./AgentAvatar-DrZGU5TL.js";import{c as ce,d as le,l as ue,n as de,r as fe,t as pe}from"./fileMentionTouchSelection-CzP2ohnN.js";import{a as me,o as he,s as ge}from"./fileMentionAutocompleteState-CEwRZk1h.js";var _e=(e,t)=>{let n=t.trim();if(!n)return[...e].sort((e,t)=>e.isBuiltIn===t.isBuiltIn?e.name.localeCompare(t.name):e.isBuiltIn?-1:1);let r=C([...e],n,e=>[e.name,e.description??``]);return r.sort((e,t)=>e.score===t.score?e.item.isBuiltIn===t.item.isBuiltIn?e.item.name.localeCompare(t.item.name):e.item.isBuiltIn?-1:1:e.score-t.score),r.map(e=>e.item)},ve=(e,t)=>e===t||e.length===t.length&&e.every((e,n)=>{let r=t[n];return r!=null&&e.id===r.id&&e.title===r.title&&(e.subtitle??``)===(r.subtitle??``)&&(e.badge??``)===(r.badge??``)&&e.iconName===r.iconName&&e.agentName===r.agentName}),ye=(e,t)=>e.highlightedIndex===t.highlightedIndex&&ve(e.rows,t.rows),be=(e,t)=>ve(e,t)?e:t.slice(),xe=(e,t,n)=>{e&&(t.current&&ye(t.current,n)||(t.current=n,e(n)))},Se=(e,t)=>{t.current=null,e?.({rows:[],highlightedIndex:0})},z=e(c(),1),B=g(),Ce=e=>e.directories.flatMap(e=>e.sessions),V=(e,t)=>({...re(e,t.location.hostId),select:Ce}),we=async(e,t,n)=>{n.sdk();let r=await e.fetchQuery(V(t,n));return n.sdk(),Ce(r)},H=(e,t,n,r)=>{n.sdk();let i=e.getQueryData(V(t,n).queryKey);for(let e of i?.directories??[]){let t=e.sessions.find(e=>e.id===r);if(t)return t.title||r}return r},U=(e,t,n,r={})=>({queryKey:[...e.queryScope,`composer-files`,t,n,r],staleTime:3e4,gcTime:3e4,queryFn:async({signal:i})=>{let a=await e.sdk().file.find({query:t,location:{directory:e.location.directory},limit:n,type:r.type},{signal:i});if(e.sdk(),i.throwIfAborted(),!Array.isArray(a.data))throw Error(`File search returned no data`);return a.data.map(t=>{let n=m(t.path),r=h(n);return{name:r,path:b(e.location.directory,n),relativePath:n,extension:r.includes(`.`)?r.split(`.`).pop()?.toLowerCase():void 0,isDirectory:t.type===`directory`}})}}),W=e=>{if(!e)return``;let t=e.replace(/\\/g,`/`),n=t.startsWith(`//`),r=t.replace(/\/+/g,`/`);n&&!r.startsWith(`//`)&&(r=`/${r}`);let i=r===`/`,a=/^[A-Za-z]:\/$/.test(r);return!i&&!a&&(r=r.replace(/\/+$/,``)),r},G=e=>/^[A-Za-z]:\//.test(e)?e.toLowerCase():e,K=e=>e.startsWith(`yuri-remote-location:`)?t(e):W(e),q=(e,t)=>{let r=W(n(t,`local`).directory),i=W(e);if(!r||!i)return!1;let a=G(r),o=G(i);return o===a||o.startsWith(a.endsWith(`/`)?a:`${a}/`)},J=e=>{if(!e||typeof e!=`object`)return{};let t=e,n={};for(let[e,r]of Object.entries(t)){let t;try{t=K(e)}catch{continue}if(!t||!r||typeof r!=`object`)continue;let i=r,a=Array.isArray(i.openPaths)?Array.from(new Set(i.openPaths.filter(e=>typeof e==`string`).map(e=>W(e)).filter(e=>q(e,t)))):[],o=Array.isArray(i.expandedPaths)?Array.from(new Set(i.expandedPaths.filter(e=>typeof e==`string`).map(e=>W(e)).filter(e=>q(e,t)))):[],s=typeof i.selectedPath==`string`?W(i.selectedPath):null,c=s&&q(s,t)?s:a[0]??null,l=typeof i.touchedAt==`number`&&Number.isFinite(i.touchedAt)?i.touchedAt:Date.now(),u=n[t];if(u){let e=Array.from(new Set([...u.openPaths,...a])),r=Array.from(new Set([...u.expandedPaths,...o])),i=u.selectedPath??c??e[0]??null;n[t]={openPaths:e,selectedPath:i,expandedPaths:r,touchedAt:Math.max(u.touchedAt,l)};continue}n[t]={openPaths:a,selectedPath:c,expandedPaths:o,touchedAt:l}}return n},Y=(e,t)=>{let n=Object.entries(e);if(n.length<=t)return e;n.sort((e,t)=>(t[1]?.touchedAt??0)-(e[1]?.touchedAt??0));let r={};for(let[e,i]of n.slice(0,t))r[e]=i;return r},X=e=>e?{...e,touchedAt:Date.now()}:{openPaths:[],selectedPath:null,expandedPaths:[],touchedAt:Date.now()},Z=i()(o(a((e,t)=>({byRoot:{},addOpenPath:(t,n,r)=>{let i=K((t||``).trim()),a=W((n||``).trim());!i||!a||!r?.allowOutsideRoot&&!q(a,i)||e(e=>{let t=e.byRoot[i],n=X(t),r=n.openPaths.includes(a),o=r?n.openPaths:[...n.openPaths,a],s=n.selectedPath??a;return t&&r&&t.selectedPath===s?e:{byRoot:Y({...e.byRoot,[i]:{...n,openPaths:o,selectedPath:s}},20)}})},removeOpenPath:(t,n)=>{let r=K((t||``).trim()),i=W((n||``).trim());!r||!i||e(e=>{let t=e.byRoot[r];if(!t)return e;let n=G(i),a=e=>G(e)===n,o=t.selectedPath?a(t.selectedPath):!1;if(!t.openPaths.some(a)&&!o)return e;let s=t.openPaths.filter(e=>!a(e)),c=o?s[0]??null:t.selectedPath;return{byRoot:Y({...e.byRoot,[r]:{...t,openPaths:s,selectedPath:c,touchedAt:Date.now()}},20)}})},removeOpenPathsByPrefix:(t,n)=>{let r=K((t||``).trim()),i=W((n||``).trim());!r||!i||e(e=>{let t=e.byRoot[r];if(!t)return e;let n=G(i),a=n.endsWith(`/`)?n:`${n}/`,o=e=>{let t=G(e);return t===n||t.startsWith(a)},s=t.openPaths.filter(e=>!o(e));if(s.length===t.openPaths.length)return e;let c=t.selectedPath&&o(t.selectedPath)?s[0]??null:t.selectedPath;return{byRoot:Y({...e.byRoot,[r]:{...t,openPaths:s,selectedPath:c,touchedAt:Date.now()}},20)}})},removeExpandedPathsByPrefix:(t,n)=>{let r=K((t||``).trim()),i=W((n||``).trim());!r||!i||e(e=>{let t=e.byRoot[r];if(!t)return e;let n=G(i),a=n.endsWith(`/`)?n:`${n}/`,o=t.expandedPaths.filter(e=>{let t=G(e);return t!==n&&!t.startsWith(a)});return o.length===t.expandedPaths.length?e:{byRoot:Y({...e.byRoot,[r]:{...t,expandedPaths:o,touchedAt:Date.now()}},20)}})},setSelectedPath:(t,n,r)=>{let i=K((t||``).trim()),a=n?W(n.trim()):null;!i||a&&!r?.allowOutsideRoot&&!q(a,i)||e(e=>{let t=e.byRoot[i],n=X(t),r=a&&!n.openPaths.includes(a)?[...n.openPaths,a]:n.openPaths;return t&&t.selectedPath===a&&r===t.openPaths?e:{byRoot:Y({...e.byRoot,[i]:{...n,openPaths:r,selectedPath:a}},20)}})},ensureSelectedPath:e=>{let n=K((e||``).trim());if(!n)return;let r=t().byRoot[n];if(!r||r.selectedPath)return;let i=r.openPaths[0]??null;i&&t().setSelectedPath(n,i)},toggleExpandedPath:(t,n)=>{let r=K((t||``).trim()),i=W((n||``).trim());!r||!i||!q(i,r)||e(e=>{let t=e.byRoot[r],n=X(t),a=n.expandedPaths.includes(i)?n.expandedPaths.filter(e=>e!==i):[...n.expandedPaths,i];return t&&t.expandedPaths===a&&t.selectedPath===n.selectedPath&&t.openPaths===n.openPaths?e:{byRoot:Y({...e.byRoot,[r]:{...n,expandedPaths:a}},20)}})},expandPath:(t,n)=>{let r=K((t||``).trim()),i=W((n||``).trim());!r||!i||!q(i,r)||e(e=>{let t=e.byRoot[r],n=X(t);return n.expandedPaths.includes(i)&&t?e:{byRoot:Y({...e.byRoot,[r]:{...n,expandedPaths:[...n.expandedPaths,i]}},20)}})},expandPaths:(t,n)=>{let r=K((t||``).trim());if(!r||!n||n.length===0)return;let i=n.map(e=>W((e||``).trim())).filter(e=>e&&q(e,r));i.length!==0&&e(e=>{let t=e.byRoot[r],n=X(t),a=new Set(n.expandedPaths),o=i.filter(e=>!a.has(e));return o.length===0?e:{byRoot:Y({...e.byRoot,[r]:{...n,expandedPaths:[...n.expandedPaths,...o]}},20)}})}}),{name:`files-view-tabs-store`,version:2,storage:p(),migrate:e=>{if(!e||typeof e!=`object`)return{byRoot:{}};let t=e.byRoot;return{byRoot:J(t)}},merge:(e,t)=>({...t,byRoot:J(e&&typeof e==`object`?e.byRoot:void 0)}),partialize:e=>({byRoot:J(e.byRoot)})}),{name:`files-view-tabs-store`})),Q=()=>{let e=(0,B.c)(17),t=P(Te),n=L(),r;e[0]===t?r=e[1]:(r=e=>t?e.getAttachment(t):void 0,e[0]=t,e[1]=r);let i=M(r),a=P(Ee),o=P(De),s=E(Oe),c=E(ke),u=l(Ae);if(t){let r;e[2]===i?r=e[3]:(r=j(i),e[2]=i,e[3]=r);let o=r;if(o)return o;let s;e[4]!==t||e[5]!==a?(s=a.get(t),e[4]=t,e[5]=a,e[6]=s):s=e[6];let c=s;if(c?.path)return c.path;let l;if(e[7]!==t||e[8]!==n){let r;e[10]===t?r=e[11]:(r=e=>e.id===t,e[10]=t,e[11]=r),l=n.find(r),e[7]=t,e[8]=n,e[9]=l}else l=e[9];let u=l;if(u?.directory)return u.directory}if(o?.open&&(o.bootstrapPendingDirectory||o.directoryOverride))return(o.bootstrapPendingDirectory||o.directoryOverride)??void 0;if(s){let t;if(e[12]!==s||e[13]!==c){let n;e[15]===s?n=e[16]:(n=e=>e.id===s,e[15]=s,e[16]=n),t=c.find(n),e[12]=s,e[13]=c,e[14]=t}else t=e[14];let n=t;if(n?.path)return n.path}return u??void 0};function Te(e){return e.currentSessionId}function Ee(e){return e.worktreeMetadata}function De(e){return e.newSessionDraft}function Oe(e){return e.activeProjectId}function ke(e){return e.projects}function Ae(e){return e.currentDirectory}var $=s(),je=`bg-transparent font-[inherit] text-[var(--primary-base)]`,Me=(e,t)=>{let n=t.trim().toLowerCase();if(!n)return e;let r=e.toLowerCase();if(!r.includes(n))return e;let i=[],a=0,o=r.indexOf(n);for(;o!==-1;)o>a&&i.push(e.slice(a,o)),i.push((0,$.jsx)(`mark`,{className:je,children:e.slice(o,o+n.length)},`${o}-${n}`)),a=o+n.length,o=r.indexOf(n,a);return a<e.length&&i.push(e.slice(a)),i},Ne=z.forwardRef((e,t)=>{let n=(0,B.c)(4),r=y(),i;return n[0]!==r||n[1]!==e||n[2]!==t?(i=r?.entry.location.hostId?(0,$.jsx)(Le,{...e,ref:t,entry:r.entry,registry:r.registry},JSON.stringify(r.entry.queryScope)):(0,$.jsx)(Pe,{...e,ref:t}),n[0]=r,n[1]=e,n[2]=t,n[3]=i):i=n[3],i}),Pe=z.forwardRef((e,t)=>{let n=(0,B.c)(22),r=Q()??``,i=P(ze),a=O(Be),o=!!e.onSessionSelect,s;n[0]===o?s=n[1]:(s={enabled:o},n[0]=o,n[1]=s);let c=k(s),l=E(Ve),u=E(He),f;if(n[2]!==l||n[3]!==r||n[4]!==u){let e=u.find(e=>e.id===l)?.path||r;f=e?e.replace(/\\/g,`/`).replace(/\/+$/,``):null,n[2]=l,n[3]=r,n[4]=u,n[5]=f}else f=n[5];let p=f,m;n[6]===p?m=n[7]:(m=e=>p?e.byRoot[p]:void 0,n[6]=p,n[7]=m);let h=Z(m),g=A(Ue),_=d(We),v;n[8]!==a||n[9]!==c||n[10]!==e.onSessionSelect?(v=e.onSessionSelect?I(a,c):[],n[8]=a,n[9]=c,n[10]=e.onSessionSelect,n[11]=v):v=n[11];let y=v,b=e.currentSessionId??i,x;return n[12]!==g||n[13]!==r||n[14]!==p||n[15]!==h||n[16]!==e||n[17]!==t||n[18]!==_||n[19]!==y||n[20]!==b?(x=(0,$.jsx)(Re,{...e,ref:t,currentDirectory:r,currentSessionId:b,projectRoot:p,projectTabs:h,agentCatalog:g,sessions:y,searchFiles:_}),n[12]=g,n[13]=r,n[14]=p,n[15]=h,n[16]=e,n[17]=t,n[18]=_,n[19]=y,n[20]=b,n[21]=x):x=n[21],x}),Fe=[],Ie=[],Le=z.forwardRef((e,t)=>{let n=(0,B.c)(32),{entry:r,registry:i}=e,a=v(),o;n[0]===r?o=n[1]:(o=D(r.location.directory,void 0,r),n[0]=r,n[1]=o);let s=!!e.onAgentSelect,c;n[2]!==o||n[3]!==s?(c={...o,enabled:s},n[2]=o,n[3]=s,n[4]=c):c=n[4];let l=_(c),u;n[5]!==r||n[6]!==i?(u=V(i,r),n[5]=r,n[6]=i,n[7]=u):u=n[7];let d=!!e.onSessionSelect,f;n[8]!==u||n[9]!==d?(f={...u,enabled:d},n[8]=u,n[9]=d,n[10]=f):f=n[10];let p=_(f),m;n[11]===r.key?m=n[12]:(m=e=>e.byRoot[r.key],n[11]=r.key,n[12]=m);let h=Z(m),g;n[13]!==a||n[14]!==r?(g=(e,t,n,i)=>{let o=n===void 0?60:n;return a.fetchQuery(U(r,t,o,i))},n[13]=a,n[14]=r,n[15]=g):g=n[15];let y=x(g),b=r.location.directory,S;if(n[16]!==r.location.directory){let e;n[18]===Symbol.for(`react.memo_cache_sentinel`)?(e=/\/+$/,n[18]=e):e=n[18],S=r.location.directory.replace(/\\/g,`/`).replace(e,``),n[16]=r.location.directory,n[17]=S}else S=n[17];let C=l.data??Ie,w=p.data??Fe,T=l.error??p.error,E;n[19]===r?E=n[20]:(E=()=>{r.sdk()},n[19]=r,n[20]=E);let O;return n[21]!==r.location.directory||n[22]!==h||n[23]!==e||n[24]!==t||n[25]!==y||n[26]!==C||n[27]!==w||n[28]!==T||n[29]!==E||n[30]!==S?(O=(0,$.jsx)(Re,{...e,ref:t,currentDirectory:b,projectRoot:S,projectTabs:h,agentCatalog:C,sessions:w,searchFiles:y,catalogError:T,assertCurrent:E}),n[21]=r.location.directory,n[22]=h,n[23]=e,n[24]=t,n[25]=y,n[26]=C,n[27]=w,n[28]=T,n[29]=E,n[30]=S,n[31]=O):O=n[31],O}),Re=z.forwardRef(({searchQuery:e,onFileSelect:t,onAgentSelect:n,onSkillSelect:r,onSessionSelect:i,onClose:a,style:o,onRowsChange:s,currentDirectory:c,currentSessionId:l,projectRoot:d,projectTabs:p,agentCatalog:m,sessions:h,searchFiles:g,catalogError:_,assertCurrent:v},y)=>{let{t:b}=ie(),C=oe(e,180),E=f(),D=u(),[O,k]=z.useState([]),[ee,A]=z.useState(!1),[j,M]=z.useState(null),[N,P]=z.useState(0),I=z.useRef(0),L=z.useRef({query:e,directory:c,ids:[]}),[re,le]=z.useState(360),[ue,_e]=z.useState({}),[ve,ye]=z.useState({}),be=z.useRef([]),B=z.useRef([]),Ce=z.useRef([]),V=z.useRef(null),we=z.useRef(null),H=z.useRef(null);H.current||=pe();let U=S(e=>e.isMobile),W=(e??``).trim(),G=T({directory:c||null}),K=z.useMemo(()=>r?G.data??[]:[],[r,G.data]),q=z.useMemo(()=>{if(!d||!p)return[];let e=[p.selectedPath,...p.openPaths.slice().reverse()].filter(e=>typeof e==`string`&&e.length>0),t=new Set,n=[];for(let r of e){if(t.has(r))continue;t.add(r);let e=r.replace(/\\/g,`/`),i=e.split(`/`).filter(Boolean).pop()||e,a=e.startsWith(`${d}/`)?e.slice(d.length+1):e;n.push({name:i,path:e,relativePath:a,extension:i.includes(`.`)?i.split(`.`).pop()?.toLowerCase():void 0})}return ge(n,W,{limit:6})},[W,d,p]),J=z.useMemo(()=>n?ne(m).filter(e=>e.mode!==`primary`):[],[m,n]),Y=z.useMemo(()=>i?me({sessions:h,currentSessionId:l??null,searchQuery:W}):[],[h,l,W,i]),X=q,Z=O,Q=z.useMemo(()=>ce({skills:K,agents:J,sessions:Y,recentFiles:X,pathHits:Z,searchQuery:W,untitledSession:b(`chat.fileMentionAutocomplete.untitledSession`),sessionBadge:b(`chat.fileMentionAutocomplete.sessionType`),skillBadge:b(`chat.commandAutocomplete.badge.skill`)}),[K,J,Y,X,Z,W,b]);z.useEffect(()=>{let e=e=>{let t=e.target;!t||!V.current||V.current.contains(t)||a()};return document.addEventListener(`pointerdown`,e,!0),()=>{document.removeEventListener(`pointerdown`,e,!0)}},[a]),z.useEffect(()=>{if(!c){k([]),A(!1),M(null);return}let e=(C??``).trim(),t=w(e);if(!t){k([]),A(!1),M(null);return}let n=!1;A(!0),M(null);let r={includeHidden:E,respectGitignore:!D};return Promise.all([g(c,t,80,{...r,type:`file`}),g(c,t,40,{...r,type:`directory`})]).then(([t,r])=>{if(n)return;let i=new Set(q.map(e=>e.path));k(he({files:t,directories:r,query:e,excludePaths:i,limit:20}))}).catch(e=>{n||M(e instanceof Error?e:Error(String(e)))}).finally(()=>{n||A(!1)}),()=>{n=!0}},[c,C,q,g,E,D]),z.useLayoutEffect(()=>{let t=L.current,n=t.ids[I.current],r=t.query===e&&t.directory===c?Math.max(0,Q.findIndex(e=>e.id===n)):0;L.current={query:e,directory:c,ids:Q.map(e=>e.id)},I.current=r,P(r)},[Q,e,c]),z.useEffect(()=>{_e({}),ye({})},[Q]),z.useEffect(()=>{be.current[N]?.scrollIntoView({block:`nearest`})},[N]),z.useEffect(()=>{let e=null,t=()=>{e!==null&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{let e={},t={};B.current.forEach((n,r)=>{if(!n)return;let i=Ce.current[r]?.offsetWidth??n.scrollWidth,a=Math.max(0,i-n.clientWidth),o=a>8;if(e[r]=o,o){let e=Math.max(.6,a/110);t[r]=e}}),_e(e),ye(t)})};return t(),window.addEventListener(`resize`,t),()=>{e!==null&&cancelAnimationFrame(e),window.removeEventListener(`resize`,t)}},[Q]),z.useEffect(()=>{let e=B.current[N];if(!e)return;let t=()=>{let t=e.clientWidth;t>0&&le(t)};if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect()}},[N]);let Te=x(e=>{t(e)}),Ee=x(e=>{n?.(e)}),De=x(e=>{i?.(e)}),Oe=x(e=>{r?.(e)}),ke=(e,t)=>({onMouseDown:e=>e.preventDefault(),onPointerDown:e=>{e.pointerType===`touch`&&H.current?.pointerDown(e.clientX,e.clientY)},onPointerMove:e=>{e.pointerType===`touch`&&H.current?.pointerMove(e.clientX,e.clientY)},onPointerUp:e=>{e.pointerType===`touch`&&(H.current?.pointerUp(t)??!1)&&(e.preventDefault(),e.stopPropagation())},onPointerCancel:()=>H.current?.pointerCancel(),onClick:()=>{H.current?.click(t)},onMouseMove:()=>{I.current=e,P(e)}}),Ae=e=>{try{v?.()}catch(e){M(e instanceof Error?e:Error(String(e)));return}let t=Q.length;if(t===0)return;let n=(e%t+t)%t,r=Q[n];if(r.agentName!==void 0){Ee(r.agentName);return}if(r.id.startsWith(`skill:`)){let e=K.find(e=>r.id===`skill:${e.name}-${e.scope}`);e&&Oe(e);return}if(r.id.startsWith(`session:`)){let e=Y.find(e=>r.id===`session:${e.id}`);e&&De(e);return}let i=r.id.startsWith(`recent:`)?X.find(e=>r.id===`recent:${e.path}`):Z.find(e=>r.id===`file:${e.path}`);i&&Te(i)};z.useEffect(()=>{xe(s,we,{rows:Q,highlightedIndex:N})},[s,N,Q]);let je=z.useRef(s);return je.current=s,z.useEffect(()=>()=>{Se(je.current,we)},[]),z.useImperativeHandle(y,()=>({acceptIndex:e=>{Ae(e)},handleKeyDown:e=>{if(e===`Escape`){a();return}let t=Q.length;if(t!==0){if(e===`ArrowDown`){I.current=(I.current+1)%t,P(I.current);return}if(e===`ArrowUp`){I.current=(I.current-1+t)%t,P(I.current);return}(e===`Enter`||e===`Tab`)&&Ae(I.current)}}})),(0,$.jsxs)(de,{ref:V,isMobile:U,className:`max-w-[640px] max-h-64`,style:o,children:[(0,$.jsx)(ae,{preventOverscroll:!0,outerClassName:`flex-1 min-h-0`,className:`px-0`,children:(0,$.jsxs)(`div`,{className:`py-1`,children:[_||G.error||j?(0,$.jsx)(`div`,{role:`alert`,className:`px-3 py-2 typography-ui-label text-muted-foreground`,children:(_??G.error??j)?.message}):null,Q.map((e,t)=>{let n=e.id.startsWith(`file:`)||e.id.startsWith(`recent:`),r=n?te(e.title,{maxLength:60}):e.title,i=N===t,a=ue[t]??!1,o=ve[t]??2.6;return(0,$.jsxs)(`div`,{"data-mention-id":e.id,ref:e=>{be.current[t]=e},className:F(`flex items-center gap-2 px-3 py-1.5 cursor-pointer typography-ui-label rounded-lg`,U&&`min-h-11`,fe(U,i),!U&&i&&`text-interactive-selection-foreground`),...ke(t,()=>Ae(t)),children:[(0,$.jsx)(`span`,{className:`flex size-5 shrink-0 items-center justify-center`,children:e.agentName===void 0?(0,$.jsx)(R,{name:e.iconName,className:`size-3.5 text-current`}):(0,$.jsx)(se,{name:e.agentName,size:20})}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,$.jsxs)(`span`,{ref:e=>{B.current[t]=e},className:F(`relative block min-w-0 overflow-hidden`,n&&a&&i&&`file-mention-marquee-container`),style:i?{"--file-mention-marquee-width":`${re}px`,"--file-mention-marquee-duration":`${o}s`}:void 0,title:e.title,children:[(0,$.jsx)(`span`,{ref:e=>{Ce.current[t]=e},className:`absolute invisible whitespace-nowrap pointer-events-none`,"aria-hidden":!0,children:e.title}),n&&a&&i?(0,$.jsx)(`span`,{className:`inline-block whitespace-nowrap file-mention-marquee`,children:Me(e.title,W)}):(0,$.jsx)(`span`,{className:`block truncate`,children:Me(r,W)})]}),e.trailingLabel?(0,$.jsx)(`span`,{className:F(`max-w-[40%] shrink-0 truncate text-muted-foreground`,U?`typography-micro`:`typography-meta`),children:e.trailingLabel}):null]}),e.subtitle?(0,$.jsx)(`div`,{className:F(`truncate text-muted-foreground`,U?`typography-micro`:`typography-meta`),children:Me(e.subtitle,W)}):null]})]},e.id)}),ee&&Z.length===0?(0,$.jsx)(`div`,{className:`flex items-center justify-center py-3`,children:(0,$.jsx)(R,{name:`refresh`,className:`h-4 w-4 animate-spin text-muted-foreground`})}):null,!ee&&Q.length===0&&(0,$.jsx)(`div`,{className:`px-3 py-2 typography-ui-label text-muted-foreground`,children:b(`chat.fileMentionAutocomplete.empty`)})]})}),!U&&(0,$.jsx)(`div`,{className:`px-3 pt-1 pb-1.5 border-t typography-meta text-muted-foreground`,children:b(`chat.autocomplete.keyboardHint`)})]})});function ze(e){return e.currentSessionId}function Be(e){return e.activeSessions}function Ve(e){return e.activeProjectId}function He(e){return e.projects}function Ue(e){return e.agents}function We(e){return e.searchFiles}var Ge=new Set([`new`,`fork`,`compact`,`reload`,`undo`,`redo`,`model`,`btw`]),Ke=(e,t)=>{if(!t||e.isSkill)return!1;let n=e.name?.trim().toLowerCase();return!!(n&&Ge.has(n))},qe=(e,t)=>!e||t({name:e}),Je=` `,Ye=(e,t)=>{let n=Math.max(0,Math.min(t,e.length)),r=n;for(;r>0&&!/\s/.test(e[r-1]);)--r;return r>=2&&e[r-1]===Je&&e[r-2]===`/`&&(r-=2),e[r]===`/`?{start:r,end:n}:null},Xe=`text-[10px] leading-none uppercase font-bold tracking-tight px-1.5 py-1 rounded border flex-shrink-0`,Ze=F(Xe,`bg-[color-mix(in_srgb,var(--primary-base)_12%,transparent)] text-[color-mix(in_srgb,var(--primary-base)_70%,transparent)] border-[color-mix(in_srgb,var(--primary-base)_24%,transparent)]`),Qe=F(Xe,`bg-[color-mix(in_srgb,var(--status-success)_12%,transparent)] text-[color-mix(in_srgb,var(--status-success)_70%,transparent)] border-[color-mix(in_srgb,var(--status-success)_24%,transparent)]`),$e=F(Xe,`bg-[color-mix(in_srgb,var(--status-info)_12%,transparent)] text-[color-mix(in_srgb,var(--status-info)_70%,transparent)] border-[color-mix(in_srgb,var(--status-info)_24%,transparent)]`),et=F(Xe,`bg-[var(--surface-muted)] text-muted-foreground border-[var(--interactive-border)]/60`),tt=(e,t)=>e.length===t.length&&e.every((e,n)=>e.id===t[n]?.id&&e.description===t[n]?.description),nt=e=>{let t=!!e.sessionID;return{hasSession:t,canStartSessionCommand:t||e.hasNewDraft}},rt=z.forwardRef(({searchQuery:e,onCommandSelect:t,onClose:n,directory:i,style:a,commandPolicy:o,commandContext:s,onRowsChange:c},l)=>{let{t:u}=ie(),d=S(e=>e.isMobile),f=P(e=>e.currentSessionId),p=P(e=>!!e.newSessionDraft?.open),m=P(z.useCallback(e=>f?e.getDirectoryForSession(f):void 0,[f])),h=N(f??``,m??void 0),g=z.useMemo(()=>s??{sessionID:f??null,hasMessages:h.length>0,hasNewDraft:p},[s,f,h.length,p]),{hasSession:_,canStartSessionCommand:v}=z.useMemo(()=>nt(g),[g]),y=g.hasMessages,[b,x]=z.useState([]),[C,w]=z.useState(!1),T=ee({directory:i}),E=z.useMemo(()=>T.data??[],[T.data]),D=T.isFetching,[O,k]=z.useState(0),A=z.useRef(0),j=z.useRef(!1),M=z.useRef([]),te=z.useRef(null),ne=z.useRef(!1),I=z.useRef(null),L=z.useRef(!1),re=z.useRef(null);z.useEffect(()=>{let e=e=>{let t=e.target;!t||!te.current||te.current.contains(t)||n()};return document.addEventListener(`pointerdown`,e,!0),()=>{document.removeEventListener(`pointerdown`,e,!0)}},[n]),z.useEffect(()=>{(async()=>{w(D);try{let t=E.flatMap((e,t)=>e.source===`skill`?[]:[{id:`opencode:${e.scope??`global`}:${e.name}:${e.agent??``}:${e.model??``}:${t}`,name:e.name,source:`opencode`,description:e.description,agent:e.agent??void 0,model:e.model??void 0,isBuiltIn:e.isBuiltIn,scope:e.scope,reference:e.reference}]),n=[{id:`yuri:new`,name:`new`,source:`yuri`,description:u(`chat.commandAutocomplete.command.newDescription`),isBuiltIn:!0},..._&&!y?[{id:`yuri:init`,name:`init`,source:`yuri`,description:u(`chat.commandAutocomplete.command.initDescription`),isBuiltIn:!0}]:[],..._?[{id:`yuri:btw`,name:`btw`,source:`yuri`,description:u(`chat.btw.description`),isBuiltIn:!0},{id:`yuri:undo`,name:`undo`,source:`yuri`,description:u(`chat.commandAutocomplete.command.undoDescription`),isBuiltIn:!0},{id:`yuri:redo`,name:`redo`,source:`yuri`,description:u(`chat.commandAutocomplete.command.redoDescription`),isBuiltIn:!0},{id:`yuri:fork`,name:`fork`,source:`yuri`,description:u(`chat.commandAutocomplete.command.forkDescription`),isBuiltIn:!0},{id:`yuri:timeline`,name:`timeline`,source:`yuri`,description:u(`chat.commandAutocomplete.command.timelineDescription`),isBuiltIn:!0}]:[],{id:`yuri:model`,name:`model`,source:`yuri`,description:u(`chat.commandAutocomplete.command.modelDescription`),isBuiltIn:!0},{id:`yuri:compact`,name:`compact`,source:`yuri`,description:u(`chat.commandAutocomplete.command.compactDescription`),isBuiltIn:!0},...r()?[{id:`yuri:reload`,name:`reload`,source:`yuri`,description:u(`chat.commandAutocomplete.command.reloadDescription`),isBuiltIn:!0}]:[],..._?[{id:`yuri:summary`,name:`summary`,source:`yuri`,description:u(`chat.commandAutocomplete.command.summaryDescription`),isYuri:!0}]:[],...v?[{id:`yuri:workspace-review`,name:`workspace-review`,source:`yuri`,description:u(`chat.commandAutocomplete.command.workspaceReviewDescription`),isYuri:!0}]:[],...v?[{id:`yuri:craft-goal`,name:`craft-goal`,source:`yuri`,description:u(`chat.commandAutocomplete.command.craftGoalDescription`),isYuri:!0}]:[],...v?[{id:`yuri:catch-up`,name:`catch-up`,source:`yuri`,description:u(`chat.commandAutocomplete.command.catchUpDescription`),isYuri:!0}]:[],...v?[{id:`yuri:debug`,name:`debug`,source:`yuri`,description:u(`chat.commandAutocomplete.command.debugDescription`),isYuri:!0}]:[],...v?[{id:`yuri:weigh`,name:`weigh`,source:`yuri`,description:u(`chat.commandAutocomplete.command.weighDescription`),isYuri:!0}]:[],...v?[{id:`yuri:explore`,name:`explore`,source:`yuri`,description:u(`chat.commandAutocomplete.command.exploreDescription`),isYuri:!0}]:[],...t],i=!y,a=_e(n.filter(e=>(i||e.name!==`init`)&&(o?.(e)??!0)),e);x(e=>tt(e,a)?e:a)}catch{let t=!y,n=_e([{id:`yuri:new`,name:`new`,source:`yuri`,description:u(`chat.commandAutocomplete.command.newDescription`),isBuiltIn:!0},..._&&!y?[{id:`yuri:init`,name:`init`,source:`yuri`,description:u(`chat.commandAutocomplete.command.initDescription`),isBuiltIn:!0}]:[],..._?[{id:`yuri:btw`,name:`btw`,source:`yuri`,description:u(`chat.btw.description`),isBuiltIn:!0},{id:`yuri:undo`,name:`undo`,source:`yuri`,description:u(`chat.commandAutocomplete.command.undoDescription`),isBuiltIn:!0},{id:`yuri:redo`,name:`redo`,source:`yuri`,description:u(`chat.commandAutocomplete.command.redoDescription`),isBuiltIn:!0},{id:`yuri:fork`,name:`fork`,source:`yuri`,description:u(`chat.commandAutocomplete.command.forkDescription`),isBuiltIn:!0},{id:`yuri:timeline`,name:`timeline`,source:`yuri`,description:u(`chat.commandAutocomplete.command.timelineDescription`),isBuiltIn:!0}]:[],{id:`yuri:model`,name:`model`,source:`yuri`,description:u(`chat.commandAutocomplete.command.modelDescription`),isBuiltIn:!0},{id:`yuri:compact`,name:`compact`,source:`yuri`,description:u(`chat.commandAutocomplete.command.compactDescription`),isBuiltIn:!0},...r()?[{id:`yuri:reload`,name:`reload`,source:`yuri`,description:u(`chat.commandAutocomplete.command.reloadDescription`),isBuiltIn:!0}]:[],..._?[{id:`yuri:summary`,name:`summary`,source:`yuri`,description:u(`chat.commandAutocomplete.command.summaryDescription`),isYuri:!0}]:[],...v?[{id:`yuri:workspace-review`,name:`workspace-review`,source:`yuri`,description:u(`chat.commandAutocomplete.command.workspaceReviewDescription`),isYuri:!0}]:[],...v?[{id:`yuri:craft-goal`,name:`craft-goal`,source:`yuri`,description:u(`chat.commandAutocomplete.command.craftGoalDescription`),isYuri:!0}]:[],...v?[{id:`yuri:catch-up`,name:`catch-up`,source:`yuri`,description:u(`chat.commandAutocomplete.command.catchUpDescription`),isYuri:!0}]:[],...v?[{id:`yuri:debug`,name:`debug`,source:`yuri`,description:u(`chat.commandAutocomplete.command.debugDescription`),isYuri:!0}]:[],...v?[{id:`yuri:weigh`,name:`weigh`,source:`yuri`,description:u(`chat.commandAutocomplete.command.weighDescription`),isYuri:!0}]:[],...v?[{id:`yuri:explore`,name:`explore`,source:`yuri`,description:u(`chat.commandAutocomplete.command.exploreDescription`),isYuri:!0}]:[]].filter(e=>(t||e.name!==`init`)&&(o?.(e)??!0)),e);x(e=>tt(e,n)?e:n)}finally{w(!1)}})()},[e,y,_,v,E,D,u,o]),z.useEffect(()=>{k(0)},[b]),z.useEffect(()=>{A.current=O},[O]),z.useEffect(()=>{M.current[O]?.scrollIntoView({block:`nearest`})},[O]),z.useEffect(()=>{xe(c,re,{rows:ue(b,{skill:u(`chat.commandAutocomplete.badge.skill`),command:u(`chat.commandAutocomplete.badge.command`),system:u(`chat.commandAutocomplete.badge.system`)}),highlightedIndex:O})},[b,c,O,u]);let oe=z.useRef(c);oe.current=c,z.useEffect(()=>()=>{Se(oe.current,re)},[]),z.useImperativeHandle(l,()=>({acceptIndex:(e,n=!0)=>{let r=b[e];r&&t(r,Ke(r,n))},handleKeyDown:e=>{let r=b.length;if(e===`Escape`){n();return}if(r!==0){if(e===`ArrowDown`){j.current=!0,k(e=>(e+1)%r);return}if(e===`ArrowUp`){j.current=!0,k(e=>(e-1+r)%r);return}if(e===`Enter`||e===`Tab`){let n=(A.current%r+r)%r,i=b[n];i&&t(i,Ke(i,e===`Enter`))}}}}),[b,n,t]);let se=e=>{let t=le(e);switch(e.name){case`new`:return(0,$.jsx)(R,{name:t,className:`h-3.5 w-3.5`});case`init`:return(0,$.jsx)(R,{name:t,className:`h-3.5 w-3.5 text-green-500`});case`undo`:return(0,$.jsx)(R,{name:t,className:`h-3.5 w-3.5 text-orange-500`});case`redo`:return(0,$.jsx)(R,{name:t,className:`h-3.5 w-3.5 text-orange-500`});case`timeline`:case`reload`:return(0,$.jsx)(R,{name:t,className:`h-3.5 w-3.5`});case`compact`:return(0,$.jsx)(R,{name:t,className:`h-3.5 w-3.5 text-purple-500`});case`goal`:return(0,$.jsx)(R,{name:t,className:`h-3.5 w-3.5`});case`review`:return(0,$.jsx)(R,{name:t,className:`h-3.5 w-3.5 text-blue-500`});case`test`:case`build`:case`run`:return(0,$.jsx)(R,{name:t,className:`h-3.5 w-3.5 text-cyan-500`});default:return e.isBuiltIn?(0,$.jsx)(R,{name:t,className:`h-3.5 w-3.5 text-yellow-500`}):(0,$.jsx)(R,{name:t,className:`h-3.5 w-3.5 text-muted-foreground`})}};return(0,$.jsxs)(de,{ref:te,isMobile:d,className:`max-w-[450px] max-h-64`,style:a,children:[(0,$.jsx)(ae,{preventOverscroll:!0,outerClassName:`flex-1 min-h-0`,className:`px-0 py-1.5`,children:C?(0,$.jsx)(`div`,{className:`flex items-center justify-center py-4`,children:(0,$.jsx)(R,{name:`refresh`,className:`h-4 w-4 animate-spin text-muted-foreground`})}):(0,$.jsxs)(`div`,{children:[b.map((n,r)=>{let i=n.isBuiltIn,a=n.isYuri;return(0,$.jsxs)(`div`,{ref:e=>{M.current[r]=e},className:F(`flex gap-2 px-2 py-2 cursor-pointer rounded-lg`,d?`items-center`:`items-start`,fe(d,r===O),!d&&r===O&&`bg-interactive-selection/35`),onMouseDown:e=>e.preventDefault(),onPointerDown:e=>{e.pointerType===`touch`&&(I.current={x:e.clientX,y:e.clientY},L.current=!1)},onPointerMove:e=>{if(e.pointerType!==`touch`||!I.current)return;let t=e.clientX-I.current.x,n=e.clientY-I.current.y;Math.hypot(t,n)>6&&(L.current=!0)},onPointerUp:e=>{if(e.pointerType!==`touch`)return;let r=L.current;I.current=null,L.current=!1,!r&&(e.preventDefault(),e.stopPropagation(),ne.current=!0,t(n,Ke(n,d)))},onPointerCancel:()=>{I.current=null,L.current=!1},onClick:()=>{if(ne.current){ne.current=!1;return}t(n,Ke(n,d))},onMouseMove:()=>{j.current=!1,k(r)},children:[(0,$.jsx)(`div`,{className:F(!d&&`mt-0.5`),children:se(n)}),(0,$.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsxs)(`span`,{className:`typography-ui-label font-medium`,children:[`/`,Me(n.name,e)]}),n.isSkill?(0,$.jsx)(`span`,{className:Ze,children:u(`chat.commandAutocomplete.badge.skill`)}):(0,$.jsx)(`span`,{className:Ze,children:u(`chat.commandAutocomplete.badge.command`)}),a?(0,$.jsx)(`span`,{className:et,children:`Yuri`}):i?(0,$.jsx)(`span`,{className:et,children:u(`chat.commandAutocomplete.badge.system`)}):n.scope?(0,$.jsx)(`span`,{className:n.scope===`project`?$e:Qe,children:n.scope}):null,n.agent&&(0,$.jsx)(`span`,{className:et,children:n.agent})]}),n.description&&!d&&(0,$.jsx)(`div`,{className:`typography-meta text-muted-foreground mt-0.5 truncate`,children:Me(n.description,e)})]})]},n.id)}),b.length===0&&(0,$.jsx)(`div`,{className:`px-3 py-2 typography-ui-label text-muted-foreground`,children:u(`chat.commandAutocomplete.empty`)})]})}),!d&&(0,$.jsx)(`div`,{className:`px-3 pt-1 pb-1.5 border-t typography-meta text-muted-foreground`,children:u(`chat.autocomplete.keyboardHint`)})]})});rt.displayName=`CommandAutocomplete`;var it=(e,t,n)=>{if(!e)return e;let r=t.length>0&&!/\s$/.test(t)&&!/^\s/.test(e)&&!/[([{]$/.test(t),i=n.length>0&&!/\s$/.test(e)&&!/^\s/.test(n)&&!/^[\])}.,;:!?]/.test(n);return`${r?` `:``}${e}${i?` `:``}`},at=(e,t,n)=>{let r=it(e,t,n);return`${t.length===0&&!/^\s/.test(r)?` `:``}${r}${n.length===0&&!/\s$/.test(r)?` `:``}`},ot=(e,t,n,r)=>{let i=e.slice(0,t),a=e.slice(n),o=at(r,i,a),s=Math.max(0,o.indexOf(r)),c=i.length+s;return{text:`${i}${o}${a}`,caret:i.length+o.length,start:c,end:c+r.length}},st=(e,t)=>{let n=e=>`${e.kind}:${e.value}:${e.range.start}:${e.range.end}`;return new Set(e.map(n)).has(n(t))||e.some(e=>e.range.start<t.range.end&&t.range.start<e.range.end)?[...e]:[...e,t]},ct=(e,t)=>t<e.length&&e[t]===` `?t+1:t;export{rt as a,Ne as c,we as d,H as f,at as i,Q as l,st as n,Ye as o,be as p,ot as r,qe as s,ct as t,Z as u};