@yuriai/web 0.3.6 → 0.3.7-beta.2
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.
- package/dist/assets/{AgentAvatar-BOvjZ-DI.js → AgentAvatar-tB1klLEu.js} +1 -1
- package/dist/assets/{AgentSelector-Dl_zIOMk.js → AgentSelector-DOJcQ1fS.js} +1 -1
- package/dist/assets/{ArchivedSessionsDialog-Cr9Ji-RY.js → ArchivedSessionsDialog-Be-G3Bor.js} +1 -1
- package/dist/assets/{AssistantConversationSurface-CLdjNFeJ.js → AssistantConversationSurface-CDQRtRm1.js} +3 -3
- package/dist/assets/{AssistantSessionCard-BufyrOfo.js → AssistantSessionCard-LeXloPe_.js} +2 -2
- package/dist/assets/{AssistantUnreadBadge-Dn9HAEDr.js → AssistantUnreadBadge-Dz9e_tQ-.js} +1 -1
- package/dist/assets/{AssistantView-Cg0wPomu.js → AssistantView-CD8Lw7Wt.js} +1 -1
- package/dist/assets/{AssistantWorkingAvatar-1KNjr2A2.js → AssistantWorkingAvatar-BcP47cyC.js} +1 -1
- package/dist/assets/{AssistantsSettingsPage-DeYfZAYH.js → AssistantsSettingsPage-Bm6OLLVR.js} +1 -1
- package/dist/assets/{BinaryFileFallback-DfD02fS_.js → BinaryFileFallback-I9K6_JrA.js} +1 -1
- package/dist/assets/{BtwPanel-B_2w8P0X.js → BtwPanel-8x7EBxyV.js} +1 -1
- package/dist/assets/{BusyDots-CAv4ygIO.js → BusyDots-D9XbBhQY.js} +1 -1
- package/dist/assets/{ChatContainer-Dgv075jT.js → ChatContainer-CwOWGlfa.js} +4 -4
- package/dist/assets/{ChatView-Cr71C0ZB.js → ChatView-CQF1Urvr.js} +1 -1
- package/dist/assets/{DiagramView-CTnpBsWU.js → DiagramView-DZES1YrW.js} +1 -1
- package/dist/assets/{DiffView-j_yWF1Mz.js → DiffView-BR6PnKaA.js} +1 -1
- package/dist/assets/{DiffViewToggle-CYusbmY5.js → DiffViewToggle-JgwYT5PH.js} +1 -1
- package/dist/assets/{ErrorBoundary-yr_JeVdx.js → ErrorBoundary-u6b8to7M.js} +1 -1
- package/dist/assets/{FadeInOnReveal-C56koblQ.js → FadeInOnReveal-_PrKnAzJ.js} +1 -1
- package/dist/assets/{GuiPluginMount-CBJiLdzR.js → GuiPluginMount-Ic0Wnga-.js} +1 -1
- package/dist/assets/{GuiPluginPage-DJa8gFLk.js → GuiPluginPage-D7ipzH33.js} +1 -1
- package/dist/assets/{GuiPluginSurface-Cc7q80jp.js → GuiPluginSurface-Cf-PJ5U8.js} +1 -1
- package/dist/assets/{GuiPluginTitlebarItems-rbK3leaL.js → GuiPluginTitlebarItems-D5coGxD7.js} +1 -1
- package/dist/assets/{GuiPluginWindow-Cpg2HYWe.js → GuiPluginWindow-BLiRWtv9.js} +1 -1
- package/dist/assets/{Icon-C1rjS64C.js → Icon-C8DOeE74.js} +1 -1
- package/dist/assets/{ImageLoadingPlaceholder-2hMqBtYh.js → ImageLoadingPlaceholder-xQsmHffh.js} +1 -1
- package/dist/assets/{LoadingImage-Bs-621ZL.js → LoadingImage-Cq1mdmes.js} +1 -1
- package/dist/assets/MarkdownRenderer-D0wOr1FD.js +2 -0
- package/dist/assets/{MarkdownRendererImpl-DiCCNjDr.js → MarkdownRendererImpl-BcZ2pmTj.js} +1 -1
- package/dist/assets/{MarkstreamRendererImpl-Bzz3OZlX.js → MarkstreamRendererImpl-DXz-3qS5.js} +1 -1
- package/dist/assets/{MobileAssistantSettingsPage-pBhJR2t6.js → MobileAssistantSettingsPage-Df5pjQKf.js} +1 -1
- package/dist/assets/{MobileAssistantTab-Ceo442NF.js → MobileAssistantTab-DCi8TWF8.js} +1 -1
- package/dist/assets/{MobileBtwPage-DPPmDMA6.js → MobileBtwPage-BVKkyYgo.js} +1 -1
- package/dist/assets/{MobileChangesSurface-DfDoSkTS.js → MobileChangesSurface-xglyMNk-.js} +1 -1
- package/dist/assets/{MobileChatScreen-DHTbrnAr.js → MobileChatScreen-DpGvSBih.js} +1 -1
- package/dist/assets/{MobileDetailNavigation-e1u1y59T.js → MobileDetailNavigation-DuNpv9x5.js} +1 -1
- package/dist/assets/{MobileFilesSurface-CJoqR3By.js → MobileFilesSurface-ic4RHVBu.js} +2 -2
- package/dist/assets/{MobileHtmlNetworkBoundary-GBhYVYvu.js → MobileHtmlNetworkBoundary-CBdR_liA.js} +2 -2
- package/dist/assets/{MobileOverlayPanel-DzKTKeZX.js → MobileOverlayPanel-DBFioo71.js} +1 -1
- package/dist/assets/{MobileResizableSheet-CkA7qhco.js → MobileResizableSheet-D2RhJ_Dw.js} +1 -1
- package/dist/assets/{MobileSettingsTab-Bv0HsXFH.js → MobileSettingsTab-KFT5FInQ.js} +1 -1
- package/dist/assets/{MobileShareBridge-B-co2UPE.js → MobileShareBridge-oP8m4ROY.js} +1 -1
- package/dist/assets/{MobileSurface-D63k27t5.js → MobileSurface-Dd-HX7PU.js} +1 -1
- package/dist/assets/{MobileTabPageHeader-FmtbGhwq.js → MobileTabPageHeader-CwlbPMRT.js} +1 -1
- package/dist/assets/{ModelLogo-CMnp5fyy.js → ModelLogo-BM0-YvYg.js} +1 -1
- package/dist/assets/{ModelSelector-BF4wYwaz.js → ModelSelector-DH3YY4MO.js} +1 -1
- package/dist/assets/{MultiRunWindow-D0OU63re.js → MultiRunWindow-DLx-ykri.js} +1 -1
- package/dist/assets/{OnboardingScreen-CDHtDQ0k.js → OnboardingScreen-DPq88MNB.js} +1 -1
- package/dist/assets/{OverlayScrollbar-m1EAqRES.js → OverlayScrollbar-DghfdyOj.js} +1 -1
- package/dist/assets/{PierreDiffViewer-CZk1tZ3K.js → PierreDiffViewer-CMWji23q.js} +1 -1
- package/dist/assets/{ProviderLogo-BqQTME35.js → ProviderLogo-DLQgT50F.js} +1 -1
- package/dist/assets/{RemoteAssistantSessionCard-CrbCVhqD.js → RemoteAssistantSessionCard-Cn8iC0bf.js} +1 -1
- package/dist/assets/{RemoteDesktopPanel-BzLmzmjb.js → RemoteDesktopPanel-nVm5cZi5.js} +1 -1
- package/dist/assets/{ScheduledTasksDialog-DmtcDZHc.js → ScheduledTasksDialog-aOojFJck.js} +1 -1
- package/dist/assets/{ScrollableOverlay-CEglrXfm.js → ScrollableOverlay-nib07nAV.js} +1 -1
- package/dist/assets/SettingsGroup-BZjaoNB3.js +1 -0
- package/dist/assets/{SettingsView-CYEjDYWC.js → SettingsView-BKb62Xf4.js} +5 -5
- package/dist/assets/{SettingsWindow-CvJsxUyu.js → SettingsWindow-BaQ-r52i.js} +1 -1
- package/dist/assets/{SetupTourDialog-DWaVtkY0.js → SetupTourDialog-DgP0ftT4.js} +1 -1
- package/dist/assets/{SyncActions-C0gph0P8.js → SyncActions-Bnr6hmC3.js} +1 -1
- package/dist/assets/{TerminalView-Cm8Ts51w.js → TerminalView-DBedAEwq.js} +1 -1
- package/dist/assets/{TextSelectionMenu-Dcv_PdES.js → TextSelectionMenu-DSjG0v4v.js} +1 -1
- package/dist/assets/{ToolOutputDialog-QJpQjmqK.js → ToolOutputDialog-WAgIy70O.js} +1 -1
- package/dist/assets/{YuriLogo-BbS_Wj4g.js → YuriLogo-1yVZFnVN.js} +1 -1
- package/dist/assets/{assistantMessagePreview-wmP-d_oa.js → assistantMessagePreview-Bsfy_0tR.js} +1 -1
- package/dist/assets/{assistantQueries-Dpxq78yP.js → assistantQueries-BrysCPho.js} +1 -1
- package/dist/assets/{auto-read-context-aRn5yhDb.js → auto-read-context-CqyV7-Il.js} +1 -1
- package/dist/assets/{capgoAdapter-BSnmtwX8.js → capgoAdapter-CE2tG1-G.js} +1 -1
- package/dist/assets/{card-aoveY4I3.js → card-DVsK1bg4.js} +1 -1
- package/dist/assets/{chatUpwardIntent-WxxmOppY.js → chatUpwardIntent-0bZdNDP3.js} +1 -1
- package/dist/assets/{checkbox-CljLXON1.js → checkbox-p14OGtt6.js} +1 -1
- package/dist/assets/{collapsible-DkeWKEAb.js → collapsible-YyH7spLA.js} +1 -1
- package/dist/assets/{connection-hint-DsKyICgn.js → connection-hint-DjLiXeds.js} +1 -1
- package/dist/assets/{context-menu-XuMa5TsA.js → context-menu-CaquuQPG.js} +1 -1
- package/dist/assets/{diagram-DFv7Lh0h.js → diagram-CK9c-FX4.js} +1 -1
- package/dist/assets/{dialog-Cx20I73q.js → dialog-DHjQmYCZ.js} +1 -1
- package/dist/assets/{dropdown-menu-XdfySbu2.js → dropdown-menu-wHGfotqg.js} +1 -1
- package/dist/assets/{es-CLAEdHpc.js → es-C1spVk4O.js} +1 -1
- package/dist/assets/{fileMentionTouchSelection-pXNTKHAc.js → fileMentionTouchSelection-BmSRExKi.js} +1 -1
- package/dist/assets/{fr-BOB0gfdQ.js → fr-yyP7Hlty.js} +1 -1
- package/dist/assets/{gitApi-LXGRaDt8.js → gitApi-BrV9unI3.js} +1 -1
- package/dist/assets/{i18n-iu4pzqPi.js → i18n-Sh2Qk9nD.js} +1 -1
- package/dist/assets/{icons-BWijARKS.js → icons-54PVn3Nr.js} +1 -1
- package/dist/assets/{input-BMYgp87Q.js → input-C2I_T3cU.js} +1 -1
- package/dist/assets/{insertionBoundaries-bmxIeFzH.js → insertionBoundaries-Bk3zjnUJ.js} +1 -1
- package/dist/assets/{ja-CfM9jZ6u.js → ja-ChftrfCh.js} +1 -1
- package/dist/assets/{kbd-6RW-BxuR.js → kbd-BvxwoK5B.js} +1 -1
- package/dist/assets/{ko-DZOSVPHB.js → ko-BrLgX_6B.js} +1 -1
- package/dist/assets/{main-BLBAaohb.js → main-BuqJ3O2H.js} +2 -2
- package/dist/assets/{main-B-Wdp6An.js → main-Ded4HLay.js} +4 -4
- package/dist/assets/{markdownHeightCache-ojT5txMS.js → markdownHeightCache-DOk_2vb2.js} +1 -1
- package/dist/assets/{mcpQueries-BRuytwhB.js → mcpQueries-CRMVNbiD.js} +1 -1
- package/dist/assets/{miniChat-BsrHy2rU.js → miniChat-C_keuh7x.js} +2 -2
- package/dist/assets/{mobile-B8SHiXyq.js → mobile-C-Xb-xCI.js} +2 -2
- package/dist/assets/{mobileBackNavigation-CVrR_jtn.js → mobileBackNavigation-DNAhdcTU.js} +1 -1
- package/dist/assets/{mobileConnections-iSUwFNqu.js → mobileConnections-B20qC6CR.js} +2 -2
- package/dist/assets/{multirun-Y3K5yS-8.js → multirun-BXD-vbh9.js} +1 -1
- package/dist/assets/{native-config-tvqKHwCC.js → native-config-sbQqtLZx.js} +1 -1
- package/dist/assets/{nativeComposerCover-5rYz1E3W.js → nativeComposerCover-Js1b6_JZ.js} +1 -1
- package/dist/assets/{navigation-DFmCAq2g.js → navigation-C3z94oXZ.js} +1 -1
- package/dist/assets/{openRemoteProjectSession-CeSahDtQ.js → openRemoteProjectSession-Do_U0Wjg.js} +1 -1
- package/dist/assets/{openSessionFromDeepLink-DsZnNy4W.js → openSessionFromDeepLink-9v_-3Wec.js} +2 -2
- package/dist/assets/{pl-CaT81Sz8.js → pl-DlKDQDhl.js} +1 -1
- package/dist/assets/{pluginPresentation-rls1AMJN.js → pluginPresentation-CoA2suJt.js} +1 -1
- package/dist/assets/{pt-BR-9p1IKCEF.js → pt-BR-BldJPFQ5.js} +1 -1
- package/dist/assets/{pwa-BrLPfcLk.js → pwa-bZZTVtSz.js} +1 -1
- package/dist/assets/{queue-abort-optimistic-CXKdQu_T.js → queue-abort-optimistic-CRtH_pdQ.js} +1 -1
- package/dist/assets/{quota-BhdKv_Wc.js → quota-jMPnmJTS.js} +1 -1
- package/dist/assets/{reference-history-Bzn-aPYg.js → reference-history-BXab-rhp.js} +1 -1
- package/dist/assets/{remoteSessionReference-DORvqUYQ.js → remoteSessionReference-BxtqP_LB.js} +1 -1
- package/dist/assets/{renderElectronMiniChatApp-DXKgwBat.js → renderElectronMiniChatApp-BID4sjRN.js} +2 -2
- package/dist/assets/{renderMobileApp-CKN6rWxR.js → renderMobileApp-DIfIlnMb.js} +4 -4
- package/dist/assets/{runtimeConfig-BqUZF6Wt.js → runtimeConfig-Cgj64Llx.js} +1 -1
- package/dist/assets/{runtimeEndpointReset-Bu02gAs3.js → runtimeEndpointReset-C_jJz__z.js} +2 -2
- package/dist/assets/{select-BPIsJWhM.js → select-4PL3Ynr3.js} +1 -1
- package/dist/assets/{sessionLookup-DZhrkKRI.js → sessionLookup-BYsOsr9J.js} +1 -1
- package/dist/assets/{sessionOwnership-LoUNVeuJ.js → sessionOwnership-h393kE5w.js} +1 -1
- package/dist/assets/{shortcuts-DMupfl7l.js → shortcuts-wDaVtfuQ.js} +1 -1
- package/dist/assets/{sortable-tabs-strip-1bKw81VO.js → sortable-tabs-strip-_B4FGd1y.js} +1 -1
- package/dist/assets/{speechSettingsQueries-C3JgzCqy.js → speechSettingsQueries-CuGvtDnZ.js} +1 -1
- package/dist/assets/src-B7qham90.css +2 -0
- package/dist/assets/{store-BgsgBTwJ.js → store-BGuutgkJ.js} +3 -3
- package/dist/assets/{switch-B4-v9kvg.js → switch-Hzwmw5nt.js} +1 -1
- package/dist/assets/{textarea-DExmj0ZR.js → textarea-BqD15FDV.js} +1 -1
- package/dist/assets/{timeFormat-BlSO2-ws.js → timeFormat-BaiPCZgf.js} +1 -1
- package/dist/assets/{tooltip-Di-WRJUZ.js → tooltip-C4aKqJvN.js} +1 -1
- package/dist/assets/{truncated-path-nKzykV5p.js → truncated-path-BT64k7CU.js} +1 -1
- package/dist/assets/types-B8AS1Brf.js +2 -0
- package/dist/assets/{ui-BCYkB585.js → ui-By-75f8l.js} +6 -6
- package/dist/assets/{uk-BUSl_Y_1.js → uk-Cw2L_unr.js} +1 -1
- package/dist/assets/{useAppFontEffects-BCJPQstm.js → useAppFontEffects-QkfQ00lp.js} +2 -2
- package/dist/assets/{useDesktopWindowControlsLayout-BtpyMlOS.js → useDesktopWindowControlsLayout-DrBkTYrX.js} +1 -1
- package/dist/assets/{useDictation-4HBMkISY.js → useDictation-83-qDgkn.js} +1 -1
- package/dist/assets/{useEffectiveDirectory-BYswRwIv.js → useEffectiveDirectory-CrsINMiX.js} +1 -1
- package/dist/assets/{useGitStore-DqBPgmf-.js → useGitStore-Dx9gq2Eh.js} +1 -1
- package/dist/assets/{useInlineCommentDraftStore-CGJ6dM8d.js → useInlineCommentDraftStore-De-6mDMI.js} +1 -1
- package/dist/assets/{useMcpConfigStore-DEcxFuzW.js → useMcpConfigStore-gKHepAcH.js} +1 -1
- package/dist/assets/{useMobileSwipeActions-DqlR4X-T.js → useMobileSwipeActions-GD9WaonR.js} +1 -1
- package/dist/assets/{useMobileTranscriptSyncHint-BDKcqtq_.js → useMobileTranscriptSyncHint-hJZIsqRQ.js} +1 -1
- package/dist/assets/{useModelLists-DsFTBlMr.js → useModelLists-DJPjgwUx.js} +1 -1
- package/dist/assets/{useOpenCodeReadiness-CHybAoBh.js → useOpenCodeReadiness-Cn4yc2Bm.js} +1 -1
- package/dist/assets/{usePluginsStore-BIBHPK4A.js → usePluginsStore-Dg2vCCgh.js} +1 -1
- package/dist/assets/{useProjectGitActions-DeFcqi_O.js → useProjectGitActions-Ul9GEWII.js} +1 -1
- package/dist/assets/{useProjectGitStore-JGZk-NCk.js → useProjectGitStore-votrXA4y.js} +1 -1
- package/dist/assets/{useProjectRuntimeAPIs-BMBBtJB-.js → useProjectRuntimeAPIs-IIGjzxCs.js} +1 -1
- package/dist/assets/{useQuotaStore-C3qJTiD7.js → useQuotaStore-CHxR2ZkD.js} +1 -1
- package/dist/assets/{useSessionBtwStore-D7P-pknd.js → useSessionBtwStore-CQb-pbBw.js} +1 -1
- package/dist/assets/{useStreamingTextThrottle-CjWAE0oQ.js → useStreamingTextThrottle-DsYHMrpn.js} +1 -1
- package/dist/assets/{worktreeManager-pRvX5dQT.js → worktreeManager-Svy4mfp-.js} +1 -1
- package/dist/assets/{worktreeSourceBranchPreference-B7d3RYcc.js → worktreeSourceBranchPreference-Bt_e3_MW.js} +1 -1
- package/dist/assets/{zh-CN-BGKgQtWd.js → zh-CN-BQXjCmNe.js} +1 -1
- package/dist/assets/{zh-TW-jM5lIKfe.js → zh-TW-Y0lErpEY.js} +1 -1
- package/dist/index.html +6 -6
- package/dist/mini-chat.html +6 -6
- package/dist/mobile.html +2 -2
- package/package.json +1 -1
- package/server/lib/relay/DOCUMENTATION.md +1 -1
- package/server/lib/relay/relay-server.e2e.test.ts +12 -0
- package/server/lib/ui-auth/DOCUMENTATION.md +1 -1
- package/server/lib/ui-auth/ui-auth.js +2 -0
- package/server/lib/ui-auth/ui-auth.test.js +20 -1
- package/dist/assets/MarkdownRenderer-BZl_T1ng.js +0 -2
- package/dist/assets/SettingsGroup-Bm-l3IIs.js +0 -1
- package/dist/assets/src-BacdFOCS.css +0 -2
- package/dist/assets/types-4xeqxklF.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,n}from"./runtime-switch-DEPKHgdL.js";import{n as r}from"./runtime-fetch-V-iMWR8t.js";import{t as i}from"./runtimeAPIRegistry-C2VogTny.js";import{$ as a,A as o,B as s,D as c,E as l,F as u,G as d,H as f,I as p,J as m,K as ee,L as te,M as ne,N as re,O as ie,P as ae,Q as oe,R as se,S as ce,T as le,U as ue,V as de,W as h,X as fe,Y as pe,Z as me,_ as he,_t as ge,a as _e,at as ve,b as ye,bt as be,c as xe,ct as Se,d as Ce,dt as we,et as Te,f as Ee,ft as De,g as Oe,gt as ke,h as Ae,ht as je,i as Me,it as Ne,j as g,k as Pe,l as Fe,lt as Ie,m as Le,mt as Re,n as ze,nt as Be,o as Ve,ot as He,p as Ue,pt as We,q as Ge,r as Ke,rt as qe,s as Je,st as Ye,t as Xe,tt as Ze,u as Qe,ut as $e,v as et,vt as tt,x as nt,y as rt,yt as it,z as at}from"./gitApiHttp-ZjM4HkSo.js";import{n as ot}from"./client-CmtAKi5B.js";import{Zi as _,f as v,l as st}from"./ui-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,n}from"./runtime-switch-DEPKHgdL.js";import{n as r}from"./runtime-fetch-V-iMWR8t.js";import{t as i}from"./runtimeAPIRegistry-C2VogTny.js";import{$ as a,A as o,B as s,D as c,E as l,F as u,G as d,H as f,I as p,J as m,K as ee,L as te,M as ne,N as re,O as ie,P as ae,Q as oe,R as se,S as ce,T as le,U as ue,V as de,W as h,X as fe,Y as pe,Z as me,_ as he,_t as ge,a as _e,at as ve,b as ye,bt as be,c as xe,ct as Se,d as Ce,dt as we,et as Te,f as Ee,ft as De,g as Oe,gt as ke,h as Ae,ht as je,i as Me,it as Ne,j as g,k as Pe,l as Fe,lt as Ie,m as Le,mt as Re,n as ze,nt as Be,o as Ve,ot as He,p as Ue,pt as We,q as Ge,r as Ke,rt as qe,s as Je,st as Ye,t as Xe,tt as Ze,u as Qe,ut as $e,v as et,vt as tt,x as nt,y as rt,yt as it,z as at}from"./gitApiHttp-ZjM4HkSo.js";import{n as ot}from"./client-CmtAKi5B.js";import{Zi as _,f as v,l as st}from"./ui-By-75f8l.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-B2ylz14u.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-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{A as t,I as n,j as r}from"./platform-B2ylz14u.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-BGuutgkJ.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 +1 @@
|
|
|
1
|
-
import{r as e}from"./Icon-
|
|
1
|
+
import{r as e}from"./Icon-C8DOeE74.js";var t=(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]})},n=(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},r=(e,t)=>n(e.map(([,e])=>e),t),i={globe:`global`,server:`server`,"circle-check":`checkbox-circle`,"circle-x":`close-circle`,"window-analytics":`bar-chart-box`};function a(t){return t?Object.hasOwn(i,t)?i[t]:Object.hasOwn(e,t)?t:void 0:void 0}export{t as i,r as n,n as r,a 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-
|
|
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-By-75f8l.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-B2ylz14u.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-ZjM4HkSo.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-BGZ4tGr5.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-68ZPpgYA.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-BCYkB585.js";import{n as R}from"./Icon-C1rjS64C.js";import{s as re}from"./remoteProjectQueries-BQzoY_Y9.js";import{t as ie}from"./i18n-iu4pzqPi.js";import{t as ae}from"./ScrollableOverlay-CEglrXfm.js";import{t as oe}from"./useDebouncedValue-BHlMPqY8.js";import{t as se}from"./AgentAvatar-BOvjZ-DI.js";import{c as ce,d as le,l as ue,n as de,r as fe,t as pe}from"./fileMentionTouchSelection-pXNTKHAc.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-B2ylz14u.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-ZjM4HkSo.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-BGZ4tGr5.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-68ZPpgYA.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-By-75f8l.js";import{n as R}from"./Icon-C8DOeE74.js";import{s as re}from"./remoteProjectQueries-BQzoY_Y9.js";import{t as ie}from"./i18n-Sh2Qk9nD.js";import{t as ae}from"./ScrollableOverlay-nib07nAV.js";import{t as oe}from"./useDebouncedValue-BHlMPqY8.js";import{t as se}from"./AgentAvatar-tB1klLEu.js";import{c as ce,d as le,l as ue,n as de,r as fe,t as pe}from"./fileMentionTouchSelection-BmSRExKi.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};
|