@readmagic/workmate 0.0.10 → 0.0.11

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 (399) hide show
  1. package/dist/chunks/{AddWorkspaceDirectory-Vmmm7p1c.js → AddWorkspaceDirectory-ag2JTpmU.js} +1 -1
  2. package/dist/chunks/App-BuKmqFPm.js +1 -0
  3. package/dist/chunks/ApproveApiKey-CIWOi_7v.js +1 -0
  4. package/dist/chunks/ApproveApiKey-M6U-NafA.js +1 -0
  5. package/dist/chunks/BackgroundTasksDialog-Pnpl3Ixx.js +2 -0
  6. package/dist/chunks/{BypassPermissionsModeDialog-CLSACUmo.js → BypassPermissionsModeDialog-B05t83wa.js} +1 -1
  7. package/dist/chunks/{ClaudeMdExternalIncludesDialog-BqNxQOXJ.js → ClaudeMdExternalIncludesDialog-CSywJdVL.js} +1 -1
  8. package/dist/chunks/ClaudeMdExternalIncludesDialog-D-w166RC.js +1 -0
  9. package/dist/chunks/ConsoleOAuthFlow-CV6PcJOP.js +1 -0
  10. package/dist/chunks/{DiffDialog-9AYwtupw.js → DiffDialog-DUbFrzKu.js} +2 -2
  11. package/dist/chunks/Doctor-BcnUfJ4I.js +1 -0
  12. package/dist/chunks/Doctor-Dz4TuYas.js +3 -0
  13. package/dist/chunks/ExitFlow-BwyAtIHx.js +2 -0
  14. package/dist/chunks/{Grove-B9-hhkZA.js → Grove-BDoVj02t.js} +2 -2
  15. package/dist/chunks/{HybridTransport-MxJ_W_np.js → HybridTransport-C_U0IJfz.js} +4 -4
  16. package/dist/chunks/InvalidConfigDialog-bih293Xt.js +1 -0
  17. package/dist/chunks/{InvalidSettingsDialog-YyQcHocx.js → InvalidSettingsDialog-Br8kQOHz.js} +1 -1
  18. package/dist/chunks/MCPConnectionManager-B9n4SXN4.js +1 -0
  19. package/dist/chunks/MCPToolListView-DJ06N1DG.js +1 -0
  20. package/dist/chunks/{McpParsingWarnings-BCpfHaBK.js → McpParsingWarnings-COa71S9q.js} +1 -1
  21. package/dist/chunks/MessageSelector-o4ULADFg.js +3 -0
  22. package/dist/chunks/Messages-qqwHuAW5.js +11 -0
  23. package/dist/chunks/{Onboarding-ClwHS5rh.js → Onboarding-BzuQjney.js} +1 -1
  24. package/dist/chunks/{PromptInputFooterSuggestions-BSA9NrZc.js → PromptInputFooterSuggestions-to5eYBvI.js} +1 -1
  25. package/dist/chunks/{PromptInputHelpMenu-Bb4KdIX_.js → PromptInputHelpMenu-CfMFx-TF.js} +1 -1
  26. package/dist/chunks/QueryEngine-Dt0BKUeF.js +1 -0
  27. package/dist/chunks/REPL-CUbEDqEl.js +133 -0
  28. package/dist/chunks/REPL-DMaKNhTa.js +1 -0
  29. package/dist/chunks/{RemoteSessionManager-CS6mywIn.js → RemoteSessionManager-Bf44A0Ol.js} +2 -2
  30. package/dist/chunks/ResumeConversation-Ctw5Q1g9.js +1 -0
  31. package/dist/chunks/{SSETransport-CoxQ8YpH.js → SSETransport-DN4tCDEh.js} +3 -3
  32. package/dist/chunks/SearchExtraToolsTool-C80OdtPZ.js +1 -0
  33. package/dist/chunks/Settings-DfdcmvOV.js +2 -0
  34. package/dist/chunks/{TeleportProgress-Doucj-50.js → TeleportProgress-C2LQVLav.js} +1 -1
  35. package/dist/chunks/TeleportRepoMismatchDialog-BZL8Zblz.js +1 -0
  36. package/dist/chunks/{TeleportResumeWrapper-D6kpr2c6.js → TeleportResumeWrapper-wPiIs8xg.js} +1 -1
  37. package/dist/chunks/{ThemePicker-DrC8tlp0.js → ThemePicker-BT_NaRQC.js} +1 -1
  38. package/dist/chunks/{TrustDialog-Fk4m_Sy4.js → TrustDialog-ACaJ_m7A.js} +1 -1
  39. package/dist/chunks/{ValidationErrorsList-D_OUa4RT.js → ValidationErrorsList-C-hWdy_8.js} +1 -1
  40. package/dist/chunks/{WelcomeV2-DvfQHnZY.js → WelcomeV2-ZQRKlcT4.js} +1 -1
  41. package/dist/chunks/add-dir-SAKTkw0S.js +1 -0
  42. package/dist/chunks/{agentDisplay-B755vMZE.js → agentDisplay-CuSHqgZc.js} +1 -1
  43. package/dist/chunks/{agents-CIvP8l0s.js → agents-CMC0iQP4.js} +1 -1
  44. package/dist/chunks/agents-ZgRKpjHv.js +103 -0
  45. package/dist/chunks/allErrors-_cOQksHC.js +1 -0
  46. package/dist/chunks/{api-nSHc_GIQ.js → api-BbJfMXRS.js} +1 -1
  47. package/dist/chunks/api-DS1MiW01.js +1 -0
  48. package/dist/chunks/{auth-5QB6tsfB.js → auth-7mJGtlZp.js} +2 -2
  49. package/dist/chunks/auth-DGZzCbU0.js +1 -0
  50. package/dist/chunks/auth-DN1MUpB8.js +1 -0
  51. package/dist/chunks/{autoMode-BnUiK9Cu.js → autoMode-CBtY7ACs.js} +6 -6
  52. package/dist/chunks/{autonomy-Src6sKCp.js → autonomy-DuQmYhq6.js} +9 -9
  53. package/dist/chunks/{autonomy-C1aSgWPQ.js → autonomy-lJV7yWUl.js} +1 -1
  54. package/dist/chunks/autonomyPanel-DAQm6lDz.js +1 -0
  55. package/dist/chunks/backgroundHousekeeping-BTy71bcY.js +1 -0
  56. package/dist/chunks/backgroundHousekeeping-Cc7Ag7JG.js +17 -0
  57. package/dist/chunks/{banner-D0P7wXdw.js → banner-1Wyeyawe.js} +1 -1
  58. package/dist/chunks/{bg-DAPORXF3.js → bg-CJ0YWFli.js} +2 -2
  59. package/dist/chunks/bg-CeUrRz_7.js +1 -0
  60. package/dist/chunks/{branch-DFWa4Oxo.js → branch-k3kirqbA.js} +2 -2
  61. package/dist/chunks/{break-cache-Chj9i9MP.js → break-cache-CAoZ9b72.js} +1 -1
  62. package/dist/chunks/bridgeConfig-CzRUPn-D.js +1 -0
  63. package/dist/chunks/{bridgeConfig-Bb6URf4Q.js → bridgeConfig-UgaUfuP6.js} +1 -1
  64. package/dist/chunks/{bridgeMessaging-C3huGcR3.js → bridgeMessaging-Ci5H68MX.js} +1 -1
  65. package/dist/chunks/{bridgePointer-DLYyvRKb.js → bridgePointer-BL8-lGvN.js} +1 -1
  66. package/dist/chunks/{bridgeStatusUtil-DFMftajD.js → bridgeStatusUtil-C36w15ge.js} +1 -1
  67. package/dist/chunks/btw-nVoVuIae.js +1 -0
  68. package/dist/chunks/caches-B8sM3Zys.js +1 -0
  69. package/dist/chunks/caches-Bp9MZ7IE.js +1 -0
  70. package/dist/chunks/{capacityWake-amzeeBz0.js → capacityWake-BOySRJUJ.js} +1 -1
  71. package/dist/chunks/ccrClient-Br4LAofR.js +1 -0
  72. package/dist/chunks/{claudeDesktop-CsJfF1b-.js → claudeDesktop-Bgds1-YT.js} +1 -1
  73. package/dist/chunks/{clear-ClFDpWVJ.js → clear-C4Vtnbye.js} +1 -1
  74. package/dist/chunks/{cliLaunch-BWcoyZDP.js → cliLaunch-BTpfAGGI.js} +1 -1
  75. package/dist/chunks/{client-DFlE4fYh.js → client-B9404qIP.js} +1 -1
  76. package/dist/chunks/client-BCAbKdNz.js +1 -0
  77. package/dist/chunks/client-CJE6gEvU.js +1 -0
  78. package/dist/chunks/commands-DL-BzoMQ.js +1 -0
  79. package/dist/chunks/compact-Cx7BPXLU.js +2 -0
  80. package/dist/chunks/config-S5OW4Xqr.js +1 -0
  81. package/dist/chunks/{config-Do1870_d.js → config-aRiTrtCv.js} +2 -2
  82. package/dist/chunks/{config-CVHMRMwd.js → config-kB2eazPX.js} +1 -1
  83. package/dist/chunks/context-BN7DEjoH.js +1 -0
  84. package/dist/chunks/{context-noninteractive-D5iQhasu.js → context-noninteractive-D91W2B8e.js} +5 -5
  85. package/dist/chunks/context-noninteractive-DPacEFJ1.js +1 -0
  86. package/dist/chunks/conversation-D5Nbu9eT.js +1 -0
  87. package/dist/chunks/conversation-hcUx9e-C.js +1 -0
  88. package/dist/chunks/{createSSHSession-CJtzNQdZ.js → createSSHSession-DecOR6M5.js} +6 -6
  89. package/dist/chunks/createSession-D27zvmOs.js +1 -0
  90. package/dist/chunks/createSession-DRqkLZWt.js +1 -0
  91. package/dist/chunks/crossProjectResume-Bw3U0Ty6.js +40 -0
  92. package/dist/chunks/{datadog-DjeJThpV.js → datadog-bm551AVV.js} +1 -1
  93. package/dist/chunks/debug-BecbSVoN.js +39 -0
  94. package/dist/chunks/{debugUtils-DX0KAXNK.js → debugUtils-CmJfIUxW.js} +1 -1
  95. package/dist/chunks/{detached-X_yjYR7x.js → detached-CIyF0M5O.js} +1 -1
  96. package/dist/chunks/detectRepository-C15umvKN.js +1 -0
  97. package/dist/chunks/detectRepository-DDfLfKcM.js +1 -0
  98. package/dist/chunks/{diff-jEJJe58I.js → diff-DeK4bwjw.js} +1 -1
  99. package/dist/chunks/{directoryCompletion-BbXR2bfy.js → directoryCompletion-BJCu19HJ.js} +1 -1
  100. package/dist/chunks/doctor-BJORBomU.js +1 -0
  101. package/dist/chunks/{entry-oIqjxIjQ.js → entry-mdegyj8z.js} +3 -3
  102. package/dist/chunks/{esm-Cf4nSRjF.js → esm-Ka3lhafK.js} +1 -1
  103. package/dist/chunks/{execFileNoThrow-Dwu6psHW.js → execFileNoThrow-DHyW8FMX.js} +2 -2
  104. package/dist/chunks/execSyncWrapper-CDzB0BM1.js +1 -0
  105. package/dist/chunks/exit-CF3KBl-S.js +1 -0
  106. package/dist/chunks/{extraUsage-Mi66JwFZ.js → extraUsage-BrKbpBK-.js} +1 -1
  107. package/dist/chunks/extractMemories-4lBn134y.js +1 -0
  108. package/dist/chunks/fast-0Vi354KI.js +1 -0
  109. package/dist/chunks/{fast-BU4iUZ8E.js → fast-DWn40OcQ.js} +1 -1
  110. package/dist/chunks/{fileSuggestions-BMfQIDdW.js → fileSuggestions-C7Pwq2yj.js} +3 -3
  111. package/dist/chunks/{firstPartyEventLogger-B3cXgR67.js → firstPartyEventLogger-BHjBQH0J.js} +2 -2
  112. package/dist/chunks/firstPartyEventLogger-BNBnLYPK.js +1 -0
  113. package/dist/chunks/{flushGate-DgSDVGKZ.js → flushGate-DdJjxCes.js} +1 -1
  114. package/dist/chunks/gemini-DHv2iVfy.js +1 -0
  115. package/dist/chunks/generateSessionName-DhS_6oHd.js +1 -0
  116. package/dist/chunks/{genericProcessUtils-CmsUPyRz.js → genericProcessUtils-B2HcDYhg.js} +1 -1
  117. package/dist/chunks/git-DBlOv64X.js +6 -0
  118. package/dist/chunks/git-DF4RFFaT.js +1 -0
  119. package/dist/chunks/githubRepoPathMapping-CK56bUDe.js +1 -0
  120. package/dist/chunks/{goal-ZmSRBx4q.js → goal-BZG4gtnb.js} +3 -3
  121. package/dist/chunks/{grok-BXMvezWb.js → grok-BS57ZhyW.js} +1 -1
  122. package/dist/chunks/{grove-CeOjTaY6.js → grove-_zlQ83yR.js} +2 -2
  123. package/dist/chunks/{help-5DNZO6_H.js → help-C_2tdXHC.js} +1 -1
  124. package/dist/chunks/{hooks-C637tFtd.js → hooks-C7Bn7MBe.js} +2 -2
  125. package/dist/chunks/hooks-DT80Arzc.js +1 -0
  126. package/dist/chunks/{initReplBridge-D1h10vQ9.js → initReplBridge-NkZRcM77.js} +1 -1
  127. package/dist/chunks/{install-C-6ItpH0.js → install-Du-DSVzj.js} +1 -1
  128. package/dist/chunks/{instrumentation-DaiPDUst.js → instrumentation-DMs3b82f.js} +5 -5
  129. package/dist/chunks/{job-BeYzQUiR.js → job-rbX1VZmp.js} +1 -1
  130. package/dist/chunks/jwtUtils-OzxN2zts.js +1 -0
  131. package/dist/chunks/keybindings-CwdC_8S0.js +2 -0
  132. package/dist/chunks/{launchLocalMemory-CE4J98xO.js → launchLocalMemory-BLRCK1_o.js} +2 -2
  133. package/dist/chunks/{launchOnboarding-BfTdC6vp.js → launchOnboarding-Al_X75Vz.js} +1 -1
  134. package/dist/chunks/{loadAgentsDir-C7lOqvfh.js → loadAgentsDir-BL93ulMm.js} +619 -619
  135. package/dist/chunks/loadAgentsDir-eVKq8efm.js +1 -0
  136. package/dist/chunks/loadPluginHooks-B0au35a4.js +1 -0
  137. package/dist/chunks/{localSearch-BKrznW5x.js → localSearch-C5ipegd9.js} +1 -1
  138. package/dist/chunks/localSearch-CZlFfR_X.js +1 -0
  139. package/dist/chunks/{log-CezCRpAN.js → log-Dauqle-Z.js} +1 -1
  140. package/dist/chunks/{logoV2Utils-BkQfyQ1-.js → logoV2Utils-CkvOihX7.js} +1 -1
  141. package/dist/chunks/{magicDocs-BpVcON9o.js → magicDocs-DLav5QK0.js} +3 -3
  142. package/dist/chunks/main-CVNWNAoh.js +513 -0
  143. package/dist/chunks/{main-CvOv59-7.js → main-LMyE3jXY.js} +2 -2
  144. package/dist/chunks/managedEnv-CYepSnm8.js +1 -0
  145. package/dist/chunks/{managedEnv-DhWRJ5DK.js → managedEnv-DJSCuqCb.js} +1 -1
  146. package/dist/chunks/{mappers-bOab8ipV.js → mappers-DQxMcezy.js} +1 -1
  147. package/dist/chunks/mcp-BAbbEaBA.js +1 -0
  148. package/dist/chunks/mcp-Ct4Sum6A.js +6 -0
  149. package/dist/chunks/{mcp-VcGPYCkW.js → mcp-D5HkCqUh.js} +2 -2
  150. package/dist/chunks/{memoize-DsqYrbeR.js → memoize-FeyE7JEh.js} +1 -1
  151. package/dist/chunks/memory-COa7aUbx.js +1 -0
  152. package/dist/chunks/{mode-DlKnUM8l.js → mode-Bl2RZC8M.js} +2 -2
  153. package/dist/chunks/model-B7rtZ7KV.js +1 -0
  154. package/dist/chunks/{model-BsZ4sP_H.js → model-Bgh_r4lg.js} +1 -1
  155. package/dist/chunks/model-DiuEAv6h.js +1 -0
  156. package/dist/chunks/{modelOptions-CxP067Qv.js → modelOptions-BtEZe5BB.js} +1 -1
  157. package/dist/chunks/nativeInstaller-BEwayifa.js +1 -0
  158. package/dist/chunks/omit--yH_T4rf.js +1 -0
  159. package/dist/chunks/onChangeAppState-ZdwI7boX.js +1 -0
  160. package/dist/chunks/{openai-B9C2XN5Q.js → openai-DWs4D-nQ.js} +3 -3
  161. package/dist/chunks/panel-CoNfXy3K.js +1 -0
  162. package/dist/chunks/{parser-BwPXQomy.js → parser-BH4u7QiV.js} +1 -1
  163. package/dist/chunks/parser-BMIaRErw.js +1 -0
  164. package/dist/chunks/{partition-D-UhsUCx.js → partition-DLcW5Oo_.js} +1 -1
  165. package/dist/chunks/permissions-CaucYK3s.js +3 -0
  166. package/dist/chunks/pidLock-DgOBc1Xo.js +3 -0
  167. package/dist/chunks/{plan-CyU2zrCK.js → plan-BNYDTnQd.js} +1 -1
  168. package/dist/chunks/{platform-BMPbglug.js → platform-B0uTQc9P.js} +1 -1
  169. package/dist/chunks/plugin-BN-of1_H.js +17 -0
  170. package/dist/chunks/pluginAutoupdate-BBU9Jn4p.js +1 -0
  171. package/dist/chunks/pluginBlocklist-DXQlbG0P.js +1 -0
  172. package/dist/chunks/pluginCliCommands-CfdVNs8D.js +1 -0
  173. package/dist/chunks/pluginFlagging-DcJ_FQuv.js +1 -0
  174. package/dist/chunks/pluginOperations-DnhzFbYI.js +2 -0
  175. package/dist/chunks/pluginStartupCheck-CKBFaMFr.js +1 -0
  176. package/dist/chunks/pluginStartupCheck-CpNB4jxG.js +1 -0
  177. package/dist/chunks/plugins-CBW7kPyp.js +4 -0
  178. package/dist/chunks/{poorMode-DEwQOAJt.js → poorMode-B_xEvuEV.js} +1 -1
  179. package/dist/chunks/poorMode-yH1o41cQ.js +1 -0
  180. package/dist/chunks/{print-eCRv_Li-.js → print-BZOx09SU.js} +16 -16
  181. package/dist/chunks/processBashCommand-dcCNCiBp.js +1 -0
  182. package/dist/chunks/processSlashCommand-YDiM63Qr.js +5 -0
  183. package/dist/chunks/prompt-CXGy0llt.js +1 -0
  184. package/dist/chunks/prompt-DovNDmcx.js +1 -0
  185. package/dist/chunks/{prompt-M2lu8_Oa.js → prompt-Dx7IWhBt.js} +2 -2
  186. package/dist/chunks/{promptEditor-DhcZY-iu.js → promptEditor-WCkmpejM.js} +2 -2
  187. package/dist/chunks/{protocolHandler-CkFaJKKo.js → protocolHandler-BiVWrpHi.js} +4 -4
  188. package/dist/chunks/{proxy-CuMaO_YV.js → proxy-CVn7o19p.js} +3 -3
  189. package/dist/chunks/reconciler-C2Nd_e4n.js +1 -0
  190. package/dist/chunks/refresh-B84H2Ezd.js +1 -0
  191. package/dist/chunks/{registerProtocol-CsNYRZKr.js → registerProtocol-E0Iu5hEx.js} +2 -2
  192. package/dist/chunks/{reload-plugins-B7JAE3b4.js → reload-plugins-D-3AUT9g.js} +1 -1
  193. package/dist/chunks/{remoteBridgeCore-CFLJhsB6.js → remoteBridgeCore-CV6we3ZA.js} +1 -1
  194. package/dist/chunks/remoteManagedSettings-D26Q09-7.js +1 -0
  195. package/dist/chunks/{rename-BCp2Vtqu.js → rename-CSavuBIE.js} +1 -1
  196. package/dist/chunks/{renderOptions-Q5oCLFIC.js → renderOptions-DDLbSMQU.js} +1 -1
  197. package/dist/chunks/resume-CROylN3J.js +2 -0
  198. package/dist/chunks/ripgrep-2M1GkXqJ.js +1 -0
  199. package/dist/chunks/{ripgrep-DvOOsDMv.js → ripgrep-C1ydIMzT.js} +5 -5
  200. package/dist/chunks/{runtimeObserver-CS_3BDNo.js → runtimeObserver-L7pSIWBT.js} +2 -2
  201. package/dist/chunks/{runtimeObserver-DYUva6g-.js → runtimeObserver-OU8KrZQG.js} +1 -1
  202. package/dist/chunks/sandbox-adapter-6UwMLh6e.js +1 -0
  203. package/dist/chunks/{sandbox-toggle--zNSKce_.js → sandbox-toggle-YrQNWGsr.js} +1 -1
  204. package/dist/chunks/searchExtraTools-Bdv5HJ74.js +1 -0
  205. package/dist/chunks/{session-CO3gEqQP.js → session-DUYsfPy_.js} +2 -2
  206. package/dist/chunks/sessionFileAccessHooks-Czen7Ejz.js +1 -0
  207. package/dist/chunks/sessionObserver-B0zucj_c.js +1 -0
  208. package/dist/chunks/{sessionObserver-YkRHC-Aa.js → sessionObserver-Dv3Ba8eA.js} +2 -2
  209. package/dist/chunks/{sessionState-Bifmu95-.js → sessionState-D-SaBzWD.js} +2 -2
  210. package/dist/chunks/sessionStorage-BM1x51Z7.js +1 -0
  211. package/dist/chunks/{sessionTitle-COBSgSXS.js → sessionTitle-uCuYaNif.js} +2 -2
  212. package/dist/chunks/{sessionTracing-BrNx1k2V.js → sessionTracing-Bqb3vJTt.js} +3 -3
  213. package/dist/chunks/settings-BG15IFYx.js +1 -0
  214. package/dist/chunks/settings-D4CpDv2y.js +20 -0
  215. package/dist/chunks/settingsSync-BSrpnyqo.js +1 -0
  216. package/dist/chunks/setup-C62oq4AZ.js +3 -0
  217. package/dist/chunks/{shadowedRuleDetection-DEaw-X5j.js → shadowedRuleDetection-BzAZ57p2.js} +1 -1
  218. package/dist/chunks/{shellQuote-BYeOv3Ip.js → shellQuote-DS6WrivY.js} +2 -2
  219. package/dist/chunks/{sideQuestion-D0OKljee.js → sideQuestion-CvMBBjI8.js} +2 -2
  220. package/dist/chunks/sinks-WJ7nzLQs.js +1 -0
  221. package/dist/chunks/sinks-f7qYjbKJ.js +2 -0
  222. package/dist/chunks/skillChangeDetector-U5kRU5nd.js +1 -0
  223. package/dist/chunks/{skillGapStore-N_kmvXML.js → skillGapStore-CqaT8c0C.js} +2 -2
  224. package/dist/chunks/{skillLifecycle-C4F5RXuh.js → skillLifecycle-CnR8IqJM.js} +2 -2
  225. package/dist/chunks/skillSearchPanel-D9qrOXpI.js +21 -0
  226. package/dist/chunks/{skills-C4CTRN9o.js → skills-BgcFh0vy.js} +1 -1
  227. package/dist/chunks/startupProfiler-B4HBBbHN.js +1 -0
  228. package/dist/chunks/{startupProfiler-L_UWZ03w.js → startupProfiler-CmH_aVy2.js} +2 -2
  229. package/dist/chunks/{stats-IzV0_vEc.js → stats-B8uQ-UDi.js} +1 -1
  230. package/dist/chunks/{status-CeVP_uDT.js → status-BekdWoIj.js} +1 -1
  231. package/dist/chunks/status-D6KlRJmR.js +2 -0
  232. package/dist/chunks/{statusNoticeHelpers-Bb9gxdSt.js → statusNoticeHelpers-BMM8_uJ1.js} +1 -1
  233. package/dist/chunks/{stringUtils-C84IJ91d.js → stringUtils-C8PaYpQF.js} +1 -1
  234. package/dist/chunks/switcher-Ck9CrXrr.js +1 -0
  235. package/dist/chunks/{switcher-CCs9xl1z.js → switcher-DnAhkyIn.js} +1 -1
  236. package/dist/chunks/syncCache-ClP9aBqK.js +1 -0
  237. package/dist/chunks/{tasks-DZDhgx0w.js → tasks-Dmh6qikm.js} +1 -1
  238. package/dist/chunks/teleport-DH3IuAUQ.js +1 -0
  239. package/dist/chunks/{templateJobs-CrNPEKkh.js → templateJobs-CxqU-s5i.js} +1 -1
  240. package/dist/chunks/{terminalSetup-CBqcwQll.js → terminalSetup-BKGcmlWp.js} +1 -1
  241. package/dist/chunks/{terminalSetup-D-N8YPiQ.js → terminalSetup-Cy19F1Js.js} +4 -4
  242. package/dist/chunks/{theme-Dazsirbw.js → theme-U7lMFHQ0.js} +1 -1
  243. package/dist/chunks/{tmux-DewYVEBm.js → tmux-D5EvHWi3.js} +1 -1
  244. package/dist/chunks/{toolEventObserver-lnHJ9fLQ.js → toolEventObserver-D9qjoVl5.js} +1 -1
  245. package/dist/chunks/toolPool-69mfSPAs.js +1 -0
  246. package/dist/chunks/trustedDevice-B6AKlsl_.js +1 -0
  247. package/dist/chunks/trustedDevice-DL0pWP4_.js +1 -0
  248. package/dist/chunks/{types-3j8PS-Du.js → types-DafcFtmb.js} +2 -2
  249. package/dist/chunks/udsClient-CWnfsgFP.js +1 -0
  250. package/dist/chunks/{updateCCB-BPe9_FW6.js → updateCCB-C6XftzIG.js} +6 -6
  251. package/dist/chunks/{upstreamproxy-DF00RzGG.js → upstreamproxy-CXmjxHpl.js} +2 -2
  252. package/dist/chunks/{useExitOnCtrlCDWithKeybindings-ChqBs9Lr.js → useExitOnCtrlCDWithKeybindings-DEEJhm_W.js} +1 -1
  253. package/dist/chunks/useMainLoopModel-6w7mhwhU.js +1 -0
  254. package/dist/chunks/useManagePlugins-CjnsO-Of.js +1 -0
  255. package/dist/chunks/{useMergedTools-Dk5cPqLc.js → useMergedTools-DbhqKk1-.js} +1 -1
  256. package/dist/chunks/{useSearchInput-C7Y1I9P9.js → useSearchInput-gUDbkLaC.js} +1 -1
  257. package/dist/chunks/{useSettingsErrors-DAEO7AyB.js → useSettingsErrors-CgPad-H0.js} +1 -1
  258. package/dist/chunks/{userAgent-CIq27vUR.js → userAgent-CU7Ndh79.js} +1 -1
  259. package/dist/chunks/util-B4oMhJKh.js +1 -0
  260. package/dist/chunks/validatePlugin-y_O_tCEL.js +1 -0
  261. package/dist/chunks/{vim-EYQn94Kx.js → vim-w37BfGZ5.js} +1 -1
  262. package/dist/chunks/{which-DzFN5TNM.js → which-BRWBO7Gu.js} +1 -1
  263. package/dist/chunks/windowsPaths-BY-IVNwQ.js +1 -0
  264. package/dist/chunks/windowsPaths-DtWHLjmE.js +1 -0
  265. package/dist/chunks/{workSecret-DUqdPy44.js → workSecret-BEhXgH2M.js} +1 -1
  266. package/dist/chunks/{workerRegistry-C07BcZIw.js → workerRegistry-Bq9bS5pw.js} +5 -5
  267. package/dist/chunks/worktree-4SUJ4dtz.js +1 -0
  268. package/dist/cli.js +1 -1
  269. package/package.json +2 -3
  270. package/dist/chunks/App-C2yQjBgY.js +0 -1
  271. package/dist/chunks/ApproveApiKey-CKbv5C1x.js +0 -1
  272. package/dist/chunks/ApproveApiKey-MscC-ssL.js +0 -1
  273. package/dist/chunks/BackgroundTasksDialog-CL5NWsFL.js +0 -2
  274. package/dist/chunks/ClaudeMdExternalIncludesDialog-C0-psohX.js +0 -1
  275. package/dist/chunks/ConsoleOAuthFlow-4mOvEer_.js +0 -1
  276. package/dist/chunks/Doctor-DmgAwce2.js +0 -1
  277. package/dist/chunks/Doctor-jEs9chPk.js +0 -3
  278. package/dist/chunks/ExitFlow-DVKxFdpX.js +0 -2
  279. package/dist/chunks/InvalidConfigDialog-o9DF1REI.js +0 -1
  280. package/dist/chunks/MCPConnectionManager-CUTuaa8T.js +0 -1
  281. package/dist/chunks/MCPToolListView-CvqB4nCw.js +0 -1
  282. package/dist/chunks/MessageSelector-BLzw172f.js +0 -3
  283. package/dist/chunks/Messages-4K5sLmNh.js +0 -11
  284. package/dist/chunks/QueryEngine-DPHLSsax.js +0 -1
  285. package/dist/chunks/REPL-Bf46iQCN.js +0 -1
  286. package/dist/chunks/REPL-DIaAo9M9.js +0 -133
  287. package/dist/chunks/ResumeConversation-Br2KsBoe.js +0 -1
  288. package/dist/chunks/SearchExtraToolsTool-i_YO3QvV.js +0 -1
  289. package/dist/chunks/Settings-BMXysXIx.js +0 -2
  290. package/dist/chunks/TeleportRepoMismatchDialog-B5I73j7Y.js +0 -1
  291. package/dist/chunks/add-dir-CZ6Clvq8.js +0 -1
  292. package/dist/chunks/agents-DHnNg4h6.js +0 -103
  293. package/dist/chunks/allErrors-CU89tF-z.js +0 -1
  294. package/dist/chunks/api-BSeE6MwB.js +0 -1
  295. package/dist/chunks/auth-BIGJth5U.js +0 -1
  296. package/dist/chunks/auth-CDQMhIZP.js +0 -1
  297. package/dist/chunks/autonomyPanel-DnHpuiy4.js +0 -1
  298. package/dist/chunks/backgroundHousekeeping-B-cw0UcS.js +0 -17
  299. package/dist/chunks/backgroundHousekeeping-BS_8z3_x.js +0 -1
  300. package/dist/chunks/bg-50rllUNh.js +0 -1
  301. package/dist/chunks/bridgeConfig-BeqChxJC.js +0 -1
  302. package/dist/chunks/btw-DSK9R2C8.js +0 -1
  303. package/dist/chunks/caches-BTQAW9zc.js +0 -1
  304. package/dist/chunks/caches-BVtSCnV1.js +0 -1
  305. package/dist/chunks/ccrClient-Bu7Tf1Z5.js +0 -1
  306. package/dist/chunks/client-BWQ4-rN7.js +0 -1
  307. package/dist/chunks/client-c-3-PW1F.js +0 -1
  308. package/dist/chunks/commands-Bi7k3Wg-.js +0 -1
  309. package/dist/chunks/compact-J-h0Yf4b.js +0 -2
  310. package/dist/chunks/config-yyFe87vW.js +0 -1
  311. package/dist/chunks/context-Tb1Ca2Q-.js +0 -1
  312. package/dist/chunks/context-noninteractive-soPYKAc9.js +0 -1
  313. package/dist/chunks/conversation-CSEtUxOY.js +0 -1
  314. package/dist/chunks/conversation-Dk1WDQuN.js +0 -1
  315. package/dist/chunks/createSession-DkT1GL8y.js +0 -1
  316. package/dist/chunks/createSession-eE8mswkv.js +0 -1
  317. package/dist/chunks/crossProjectResume-04n3Ppy9.js +0 -40
  318. package/dist/chunks/debug-RAynG_nM.js +0 -39
  319. package/dist/chunks/detectRepository-DgpNd87p.js +0 -1
  320. package/dist/chunks/detectRepository-ctF9KDbb.js +0 -1
  321. package/dist/chunks/doctor-B-Wag4C1.js +0 -1
  322. package/dist/chunks/execSyncWrapper-BTZJjCuv.js +0 -1
  323. package/dist/chunks/exit-BtW7LfRX.js +0 -1
  324. package/dist/chunks/extractMemories-CUrdiNcr.js +0 -1
  325. package/dist/chunks/fast-C60p6AqJ.js +0 -1
  326. package/dist/chunks/firstPartyEventLogger-BfCYN7lt.js +0 -1
  327. package/dist/chunks/gemini-BwvSxGgn.js +0 -1
  328. package/dist/chunks/generateSessionName-DlrdedOk.js +0 -1
  329. package/dist/chunks/git-2c7WlGDL.js +0 -6
  330. package/dist/chunks/git-XtKbtJMc.js +0 -1
  331. package/dist/chunks/githubRepoPathMapping-DbWG4hFQ.js +0 -1
  332. package/dist/chunks/hooks-DWg07LmS.js +0 -1
  333. package/dist/chunks/jwtUtils-CUPXdX3W.js +0 -1
  334. package/dist/chunks/keybindings-DgIPdBy9.js +0 -2
  335. package/dist/chunks/loadAgentsDir-zikjxLvn.js +0 -1
  336. package/dist/chunks/loadPluginHooks-Cp8MSwAc.js +0 -1
  337. package/dist/chunks/localSearch-ZFyFy5FN.js +0 -1
  338. package/dist/chunks/main-9r5gLzUW.js +0 -605
  339. package/dist/chunks/managedEnv-B61yLpwp.js +0 -1
  340. package/dist/chunks/mcp-BckPBjaM.js +0 -6
  341. package/dist/chunks/mcp-CS1DA3JL.js +0 -1
  342. package/dist/chunks/memory-C5ohwh-T.js +0 -1
  343. package/dist/chunks/model-BGu1AGq0.js +0 -1
  344. package/dist/chunks/model-D19IIcll.js +0 -1
  345. package/dist/chunks/nativeInstaller-QB8cEJ18.js +0 -1
  346. package/dist/chunks/omit-DDUIPHnl.js +0 -1
  347. package/dist/chunks/onChangeAppState-RBl6H7ho.js +0 -1
  348. package/dist/chunks/panel-KW-wmEvU.js +0 -1
  349. package/dist/chunks/parser-xSBaQRLH.js +0 -1
  350. package/dist/chunks/permissions-BoLXYN1j.js +0 -3
  351. package/dist/chunks/pidLock-nJHbufJN.js +0 -3
  352. package/dist/chunks/plugin-C6-GQke5.js +0 -17
  353. package/dist/chunks/pluginAutoupdate-SlRFJlTT.js +0 -1
  354. package/dist/chunks/pluginBlocklist-n6Imlh3y.js +0 -1
  355. package/dist/chunks/pluginCliCommands-Bd96zSOQ.js +0 -1
  356. package/dist/chunks/pluginFlagging-DZaYzecY.js +0 -1
  357. package/dist/chunks/pluginOperations-D90IRawu.js +0 -2
  358. package/dist/chunks/pluginStartupCheck-Bxkxpm4k.js +0 -1
  359. package/dist/chunks/pluginStartupCheck-CB2q2dLv.js +0 -1
  360. package/dist/chunks/plugins-B9eSjLSA.js +0 -4
  361. package/dist/chunks/poorMode-BAnubpn1.js +0 -1
  362. package/dist/chunks/processBashCommand-B5F2Cl7K.js +0 -1
  363. package/dist/chunks/processSlashCommand-BC_D3cH5.js +0 -5
  364. package/dist/chunks/prompt-C1JPqinc.js +0 -1
  365. package/dist/chunks/prompt-DZhBz_Vu.js +0 -1
  366. package/dist/chunks/reconciler-B4GDm_iC.js +0 -1
  367. package/dist/chunks/refresh-DBVizOzg.js +0 -1
  368. package/dist/chunks/remoteManagedSettings-xh_MViZH.js +0 -1
  369. package/dist/chunks/resume-DVCSzKvv.js +0 -2
  370. package/dist/chunks/ripgrep-e-iewvTf.js +0 -1
  371. package/dist/chunks/sandbox-adapter-BFZFHplu.js +0 -1
  372. package/dist/chunks/searchExtraTools-ui5y2VSE.js +0 -1
  373. package/dist/chunks/sessionFileAccessHooks-CZvCqQJ6.js +0 -1
  374. package/dist/chunks/sessionObserver-Ba7um95p.js +0 -1
  375. package/dist/chunks/sessionStorage-CedwLLQs.js +0 -1
  376. package/dist/chunks/settings-DkDH7WQT.js +0 -1
  377. package/dist/chunks/settings-DnptdP79.js +0 -20
  378. package/dist/chunks/settingsSync-PmU7SmkU.js +0 -1
  379. package/dist/chunks/setup-BEsBuzsk.js +0 -3
  380. package/dist/chunks/sinks-BJHgxz6Y.js +0 -1
  381. package/dist/chunks/sinks-D5-yhcgU.js +0 -2
  382. package/dist/chunks/skillChangeDetector-Dd0WPdkO.js +0 -1
  383. package/dist/chunks/skillSearchPanel-CftorvAM.js +0 -21
  384. package/dist/chunks/startupProfiler-D4FBdEQr.js +0 -1
  385. package/dist/chunks/status-Dzuw3hBv.js +0 -2
  386. package/dist/chunks/switcher-4KzBvuKH.js +0 -1
  387. package/dist/chunks/syncCache-CBRiRU5x.js +0 -1
  388. package/dist/chunks/teleport-Bw0jSxe9.js +0 -1
  389. package/dist/chunks/toolPool-CkXFlqsn.js +0 -1
  390. package/dist/chunks/trustedDevice-CFf5yaG-.js +0 -1
  391. package/dist/chunks/trustedDevice-CuwSv8dG.js +0 -1
  392. package/dist/chunks/udsClient-e9dIkwVA.js +0 -1
  393. package/dist/chunks/useMainLoopModel-2-eujv0n.js +0 -1
  394. package/dist/chunks/useManagePlugins-CYBIkaB1.js +0 -1
  395. package/dist/chunks/util-VO98TdOz.js +0 -1
  396. package/dist/chunks/validatePlugin-Kk6pxnO2.js +0 -1
  397. package/dist/chunks/windowsPaths-BU3yQWTB.js +0 -1
  398. package/dist/chunks/windowsPaths-DgZ3YY4a.js +0 -1
  399. package/dist/chunks/worktree-dFUkhVE_.js +0 -1
@@ -0,0 +1 @@
1
+ import{t as e}from"./REPL-CUbEDqEl.js";export{e as REPL};
@@ -1,2 +1,2 @@
1
- import{n as e,t}from"./memoize-BK3gG5ob.js";import{n,t as r}from"./defineProperty-C-QyHrDq.js";import{Ao as i,Cr as a,Eo as o,Fb as s,Gb as c,Jb as ee,Kb as l,Ob as u,QC as d,QT as f,Tr as te,Ub as ne,Uo as re,Vb as p,Vg as m,Vo as h,ZC as g,ZT as _,aT as v,jb as y,qb as b,qg as x,sT as ie,zb as ae}from"./loadAgentsDir-C7lOqvfh.js";import{di as oe,j as S,t as se,ui as ce}from"./src-P_wYS_NJ2.js";import{n as le,t as C}from"./cwd-Cfdf7z7s.js";import{C as ue,F as de,S as fe,a as w,l as T,w as E,z as D}from"./debug-RAynG_nM.js";import{Gt as O,Jt as k,f as A,g as j,n as M}from"./settings-DnptdP79.js";import{c as N,h as P,o as F,v as I,y as L}from"./config-Do1870_d.js";import{f as R,l as z,m as B,p as V}from"./git-2c7WlGDL.js";import{n as H,r as pe}from"./execFileNoThrow-Dwu6psHW.js";import{o as U,s as W}from"./log-CezCRpAN.js";import{i as G,o as me}from"./platform-BMPbglug.js";import{l as he,u as ge}from"./oauth-C9VBDB0Y.js";import{Bt as _e,Vt as ve,_ as ye,ai as be,g as xe,si as Se}from"./model-BsZ4sP_H.js";import{c as Ce,h as we,l as Te,m as K,s as Ee}from"./proxy-CuMaO_YV.js";import{c as De,i as Oe}from"./terminalSetup-D-N8YPiQ.js";import{l as ke,o as Ae}from"./api-nSHc_GIQ.js";import{c as je,u as Me}from"./firstPartyEventLogger-B3cXgR67.js";import{randomUUID as Ne}from"crypto";t(),_(),le(),P(),k(),pe(),B(),U(),Me();var Pe=[/(?:^|\/)(?:package-lock\.json|yarn\.lock|bun\.lock|bun\.lockb|pnpm-lock\.yaml|Pipfile\.lock|poetry\.lock|Cargo\.lock|Gemfile\.lock|go\.sum|composer\.lock|uv\.lock)$/,/\.generated\./,/(?:^|\/)(?:dist|build|out|target|node_modules|\.next|__pycache__)\//,/\.(?:min\.js|min\.css|map|pyc|pyo)$/,/\.(?:json|ya?ml|toml|xml|ini|cfg|conf|env|lock|txt|md|mdx|rst|csv|log|svg)$/i,/(?:^|\/)\.?(?:eslintrc|prettierrc|babelrc|editorconfig|gitignore|gitattributes|dockerignore|npmrc)/,/(?:^|\/)(?:tsconfig|jsconfig|biome|vitest\.config|jest\.config|webpack\.config|vite\.config|rollup\.config)\.[a-z]+$/,/(?:^|\/)\.(?:github|vscode|idea|claude)\//,/(?:^|\/)(?:CHANGELOG|LICENSE|CONTRIBUTING|CODEOWNERS|README)(?:\.[a-z]+)?$/i];function Fe(e){return!Pe.some(t=>t.test(e))}function Ie(e,t){let n=[],r=new Set,i=new Map;for(let a=1;n.length<t&&a<=t;a++)for(let o of e){if(n.length>=t)break;if(!Fe(o))continue;let e=Math.max(o.lastIndexOf(`/`),o.lastIndexOf(`\\`)),s=e>=0?o.slice(e+1):o;if(!s||r.has(s))continue;let c=e>=0?o.slice(0,e):`.`;(i.get(c)??0)>=a||(n.push(s),r.add(s),i.set(c,(i.get(c)??0)+1))}return n.length>=t?n:[]}async function Le(){if(O.platform===`win32`||!await z())return[];try{let e=await je(),t=[`log`,`-n`,`1000`,`--pretty=format:`,`--name-only`,`--diff-filter=M`],n=new Map,r=e=>{for(let t of e.split(`
2
- `)){let e=t.trim();e&&n.set(e,(n.get(e)??0)+1)}};if(e){let{stdout:n}=await H(`git`,[...t,`--author=${e}`],{cwd:C()});r(n)}if(n.size<10){let{stdout:e}=await H(V(),t,{cwd:C()});r(e)}return Ie(Array.from(n.entries()).sort((e,t)=>t[1]-e[1]).map(([e])=>e),5)}catch(e){return W(e),[]}}var Re=10080*60*1e3,ze=e(()=>{let e=F(),t=e.exampleFiles?.length?f(e.exampleFiles):`<filepath>`;return`Try "${f([`fix lint errors`,`fix typecheck errors`,`how does ${t} work?`,`refactor ${t}`,`how do I log an error?`,`edit ${t} to...`,`write a test for ${t}`,`create a util logging.py that...`])}"`}),Be=e(async()=>{let e=F();Date.now()-(e.exampleFilesGeneratedAt??0)>Re&&(e.exampleFiles=[]),e.exampleFiles?.length||Le().then(e=>{e.length&&I(t=>({...t,exampleFiles:e,exampleFilesGeneratedAt:Date.now()}))})});Se();var Ve={"claude-3-opus":{modelName:`Claude 3 Opus`,retirementDates:{firstParty:`January 5, 2026`,bedrock:`January 15, 2026`,vertex:`January 5, 2026`,foundry:`January 5, 2026`}},"claude-3-7-sonnet":{modelName:`Claude 3.7 Sonnet`,retirementDates:{firstParty:`February 19, 2026`,bedrock:`April 28, 2026`,vertex:`May 11, 2026`,foundry:`February 19, 2026`}},"claude-3-5-haiku":{modelName:`Claude 3.5 Haiku`,retirementDates:{firstParty:`February 19, 2026`,bedrock:null,vertex:null,foundry:null}}};function He(e){let t=e.toLowerCase(),n=be();for(let[e,r]of Object.entries(Ve)){let i=r.retirementDates[n];if(!(!t.includes(e)||!i))return{isDeprecated:!0,modelName:r.modelName,retirementDate:i}}return{isDeprecated:!1}}function Ue(e){if(!e)return null;let t=He(e);return t.isDeprecated?`⚠ ${t.modelName} will be retired on ${t.retirementDate}. Consider switching to a newer model.`:null}n(),oe(),se(),D(),fe(),w(),me(),ge(),j(),_e(),ye(),ie(),d(),p(),y(),x(),Oe(),h(),o(),a(),P();function We(e){let t=N().numStartups;L(n=>{let r=n.tipsHistory??{};return r[e]===t?n:{...n,tipsHistory:{...r,[e]:t}}})}function q(e){let t=N(),n=t.tipsHistory?.[e];return n?t.numStartups-n:1/0}P(),k(),B();var J;async function Ge(){return J===void 0&&(J=v in await re()),J}async function Y(e,t,n){if(!await Ge()||i(`${e}@claude-plugins-official`))return!1;let{bashTools:r}=t??{};return!!(n.cli&&r?.size&&n.cli.some(e=>r.has(e))||n.filePath&&t?.readFileState&&u(t.readFileState).some(e=>n.filePath.test(e)))}var Ke=[{id:`new-user-warmup`,content:async()=>`Start with small features or bug fixes, tell Claude to propose a plan, and verify its suggested edits`,cooldownSessions:3,async isRelevant(){return N().numStartups<10}},{id:`plan-mode-for-complex-tasks`,content:async()=>`Use Plan Mode to prepare for a complex request before making changes. Press ${g(`chat:cycleMode`,`Chat`,`shift+tab`)} twice to enable.`,cooldownSessions:5,isRelevant:async()=>{let e=N();return(e.lastPlanModeUse?(Date.now()-e.lastPlanModeUse)/(1e3*60*60*24):1/0)>7}},{id:`default-permission-mode-config`,content:async()=>`Use /config to change your default permission mode (including Plan Mode)`,cooldownSessions:10,isRelevant:async()=>{try{let e=N(),t=A(),n=!!e.lastPlanModeUse,r=!!t?.permissions?.defaultMode;return n&&!r}catch(e){return T(`Failed to check default-permission-mode-config tip relevance: ${e}`,{level:`warn`}),!1}}},{id:`git-worktrees`,content:async()=>`Use git worktrees to run multiple Claude sessions in parallel.`,cooldownSessions:10,isRelevant:async()=>{try{let e=N();return await R()<=1&&e.numStartups>50}catch{return!1}}},{id:`terminal-setup`,content:async()=>O.terminal===`Apple_Terminal`?`Run /terminal-setup to enable convenient terminal integration like Option + Enter for new line and more`:`Run /terminal-setup to enable convenient terminal integration like Shift + Enter for new line and more`,cooldownSessions:10,async isRelevant(){let e=N();return O.terminal===`Apple_Terminal`?!e.optionAsMetaKeyInstalled:!e.shiftEnterKeyBindingInstalled}},{id:`shift-enter`,content:async()=>O.terminal===`Apple_Terminal`?`Press Option+Enter to send a multi-line message`:`Press Shift+Enter to send a multi-line message`,cooldownSessions:10,async isRelevant(){let e=N();return!!((O.terminal===`Apple_Terminal`?e.optionAsMetaKeyInstalled:e.shiftEnterKeyBindingInstalled)&&e.numStartups>3)}},{id:`shift-enter-setup`,content:async()=>O.terminal===`Apple_Terminal`?`Run /terminal-setup to enable Option+Enter for new lines`:`Run /terminal-setup to enable Shift+Enter for new lines`,cooldownSessions:10,async isRelevant(){if(!De())return!1;let e=N();return!(O.terminal===`Apple_Terminal`?e.optionAsMetaKeyInstalled:e.shiftEnterKeyBindingInstalled)}},{id:`memory-command`,content:async()=>`Use /memory to view and manage Claude memory`,cooldownSessions:15,async isRelevant(){return N().memoryUsageCount<=0}},{id:`theme-command`,content:async()=>`Use /theme to change the color theme`,cooldownSessions:20,isRelevant:async()=>!0},{id:`colorterm-truecolor`,content:async()=>`Try setting environment variable COLORTERM=truecolor for richer colors`,cooldownSessions:30,isRelevant:async()=>!process.env.COLORTERM&&ce.level<3},{id:`powershell-tool-env`,content:async()=>`Set CLAUDE_CODE_USE_POWERSHELL_TOOL=1 to enable the PowerShell tool (preview)`,cooldownSessions:10,isRelevant:async()=>G()===`windows`&&process.env.CLAUDE_CODE_USE_POWERSHELL_TOOL===void 0},{id:`status-line`,content:async()=>`Use /statusline to set up a custom status line that will display beneath the input box`,cooldownSessions:25,isRelevant:async()=>A().statusLine===void 0},{id:`prompt-queue`,content:async()=>`Hit Enter to queue up additional messages while Claude is working.`,cooldownSessions:5,async isRelevant(){return N().promptQueueUseCount<=3}},{id:`enter-to-steer-in-relatime`,content:async()=>`Send messages to Claude while it works to steer Claude in real-time`,cooldownSessions:20,isRelevant:async()=>!0},{id:`todo-list`,content:async()=>`Ask Claude to create a todo list when working on complex tasks to track progress and remain on track`,cooldownSessions:20,isRelevant:async()=>!0},{id:`vscode-command-install`,content:async()=>`Open the Command Palette (Cmd+Shift+P) and run "Shell Command: Install '${O.terminal===`vscode`?`code`:O.terminal}' command in PATH" to enable IDE integration`,cooldownSessions:0,async isRelevant(){if(!l()||G()!==`macos`)return!1;switch(O.terminal){case`vscode`:return!await b();case`cursor`:return!await ne();case`windsurf`:return!await ee();default:return!1}}},{id:`ide-upsell-external-terminal`,content:async()=>`Connect Claude to your IDE · /ide`,cooldownSessions:4,async isRelevant(){return c()||(await ae()).length!==0?!1:(await s()).length>0}},{id:`permissions`,content:async()=>`Use /permissions to pre-approve and pre-deny bash, edit, and MCP tools`,cooldownSessions:10,async isRelevant(){return N().numStartups>10}},{id:`drag-and-drop-images`,content:async()=>`Did you know you can drag and drop image files into your terminal?`,cooldownSessions:10,isRelevant:async()=>!O.isSSH()},{id:`paste-images-mac`,content:async()=>`Paste images into Work Mate using control+v (not cmd+v!)`,cooldownSessions:10,isRelevant:async()=>G()===`macos`},{id:`double-esc`,content:async()=>`Double-tap esc to rewind the conversation to a previous point in time`,cooldownSessions:10,isRelevant:async()=>!m()},{id:`double-esc-code-restore`,content:async()=>`Double-tap esc to rewind the code and/or conversation to a previous point in time`,cooldownSessions:10,isRelevant:async()=>m()},{id:`continue`,content:async()=>`Run claude --continue or claude --resume to resume a conversation`,cooldownSessions:10,isRelevant:async()=>!0},{id:`rename-conversation`,content:async()=>`Name your conversations with /rename to find them easily in /resume later`,cooldownSessions:15,isRelevant:async()=>te()&&N().numStartups>10},{id:`custom-commands`,content:async()=>`Create skills by adding .md files to .claude/skills/ in your project or ~/.claude/skills/ for skills that work in any project`,cooldownSessions:15,async isRelevant(){return N().numStartups>10}},{id:`shift-tab`,content:async()=>`Hit ${g(`chat:cycleMode`,`Chat`,`shift+tab`)} to cycle between default, accept edits, plan, auto, and bypass modes`,cooldownSessions:10,isRelevant:async()=>!0},{id:`image-paste`,content:async()=>`Use ${g(`chat:imagePaste`,`Chat`,`ctrl+v`)} to paste images from your clipboard`,cooldownSessions:20,isRelevant:async()=>!0},{id:`custom-agents`,content:async()=>`Use /agents to optimize specific tasks. Eg. Software Architect, Code Writer, Code Reviewer`,cooldownSessions:15,async isRelevant(){return N().numStartups>5}},{id:`agent-flag`,content:async()=>`Use --agent <agent_name> to directly start a conversation with a subagent`,cooldownSessions:15,async isRelevant(){return N().numStartups>5}},{id:`web-app`,content:async()=>`Run tasks in the cloud while you keep coding locally · clau.de/web`,cooldownSessions:15,isRelevant:async()=>!0},{id:`opusplan-mode-reminder`,content:async()=>`Your default model setting is Opus Plan Mode. Press ${g(`chat:cycleMode`,`Chat`,`shift+tab`)} twice to activate Plan Mode and plan with Claude Opus.`,cooldownSessions:2,async isRelevant(){let e=N(),t=xe()===`opusplan`,n=e.lastPlanModeUse?(Date.now()-e.lastPlanModeUse)/(1e3*60*60*24):1/0;return t&&n>3}},{id:`frontend-design-plugin`,content:async e=>`Working with HTML/CSS? Install the frontend-design plugin:\n${S(`suggestion`,e?.theme??`dark`)(`/plugin install frontend-design@${v}`)}`,cooldownSessions:3,isRelevant:async e=>Y(`frontend-design`,e,{filePath:/\.(html|css|htm)$/i})},{id:`vercel-plugin`,content:async e=>`Working with Vercel? Install the vercel plugin:\n${S(`suggestion`,e?.theme??`dark`)(`/plugin install vercel@${v}`)}`,cooldownSessions:3,isRelevant:async e=>Y(`vercel`,e,{filePath:/(?:^|[/\\])vercel\.json$/i,cli:[`vercel`]})},{id:`subagent-fanout-nudge`,content:async e=>`Say ${S(`suggestion`,e?.theme??`dark`)(`"fan out subagents"`)} and Claude sends a team. Each one digs deep so nothing gets missed.`,cooldownSessions:3,isRelevant:async()=>(ve(),!1)}],qe=[];function X(){let e=M().spinnerTipsOverride;return e?.tips?.length?e.tips.map((e,t)=>({id:`custom-tip-${t}`,content:async()=>e,cooldownSessions:0,isRelevant:async()=>!0})):[]}async function Je(e){let t=M().spinnerTipsOverride,n=X();if(t?.excludeDefault&&n.length>0)return n;let r=[...Ke,...qe],i=await Promise.all(r.map(t=>t.isRelevant?.(e)??Promise.resolve(!0)));return[...r.filter((e,t)=>i[t]).filter(e=>q(e.id)>=e.cooldownSessions),...n]}Ae(),w(),U(),we(),Te();var Z=2e3,Q=5,Ye=3e4,$=3,Xe=new Set([4003]);function Ze(e){return typeof e!=`object`||!e||!(`type`in e)?!1:typeof e.type==`string`}var Qe=class{constructor(e,t,n,i){r(this,`sessionId`,void 0),r(this,`orgUuid`,void 0),r(this,`getAccessToken`,void 0),r(this,`callbacks`,void 0),r(this,`ws`,null),r(this,`state`,`closed`),r(this,`reconnectAttempts`,0),r(this,`sessionNotFoundRetries`,0),r(this,`pingInterval`,null),r(this,`reconnectTimer`,null),this.sessionId=e,this.orgUuid=t,this.getAccessToken=n,this.callbacks=i}async connect(){if(this.state===`connecting`){T(`[SessionsWebSocket] Already connecting`);return}this.state=`connecting`;let e=`${he().BASE_API_URL.replace(`http`,`ws`)}/v1/sessions/ws/${this.sessionId}/subscribe?organization_uuid=${this.orgUuid}`;T(`[SessionsWebSocket] Connecting to ${e}`);let t={Authorization:`Bearer ${this.getAccessToken()}`,"anthropic-version":`2023-06-01`};if(typeof Bun<`u`){let n=new globalThis.WebSocket(e,{headers:t,proxy:Ce(e),tls:K()||void 0});this.ws=n,n.addEventListener(`open`,()=>{T(`[SessionsWebSocket] Connection opened, authenticated via headers`),this.state=`connected`,this.reconnectAttempts=0,this.sessionNotFoundRetries=0,this.startPingInterval(),this.callbacks.onConnected?.()}),n.addEventListener(`message`,e=>{let t=typeof e.data==`string`?e.data:String(e.data);this.handleMessage(t)}),n.addEventListener(`error`,()=>{let e=Error(`[SessionsWebSocket] WebSocket error`);W(e),this.callbacks.onError?.(e)}),n.addEventListener(`close`,e=>{T(`[SessionsWebSocket] Closed: code=${e.code} reason=${e.reason}`),this.handleClose(e.code)}),n.addEventListener(`pong`,()=>{T(`[SessionsWebSocket] Pong received`)})}else{let{default:n}=await import(`./wrapper-K8ZapJVu.js`),r=new n(e,{headers:t,agent:Ee(e),...K()});this.ws=r,r.on(`open`,()=>{T(`[SessionsWebSocket] Connection opened, authenticated via headers`),this.state=`connected`,this.reconnectAttempts=0,this.sessionNotFoundRetries=0,this.startPingInterval(),this.callbacks.onConnected?.()}),r.on(`message`,e=>{this.handleMessage(e.toString())}),r.on(`error`,e=>{W(Error(`[SessionsWebSocket] Error: ${e.message}`)),this.callbacks.onError?.(e)}),r.on(`close`,(e,t)=>{T(`[SessionsWebSocket] Closed: code=${e} reason=${t.toString()}`),this.handleClose(e)}),r.on(`pong`,()=>{T(`[SessionsWebSocket] Pong received`)})}}handleMessage(e){try{let t=ue(e);Ze(t)?this.callbacks.onMessage(t):T(`[SessionsWebSocket] Ignoring message type: ${typeof t==`object`&&t&&`type`in t?String(t.type):`unknown`}`)}catch(e){W(Error(`[SessionsWebSocket] Failed to parse message: ${de(e)}`))}}handleClose(e){if(this.stopPingInterval(),this.state===`closed`)return;this.ws=null;let t=this.state;if(this.state=`closed`,Xe.has(e)){T(`[SessionsWebSocket] Permanent close code ${e}, not reconnecting`),this.callbacks.onClose?.();return}if(e===4001){if(this.sessionNotFoundRetries++,this.sessionNotFoundRetries>$){T(`[SessionsWebSocket] 4001 retry budget exhausted (${$}), not reconnecting`),this.callbacks.onClose?.();return}this.scheduleReconnect(Z*this.sessionNotFoundRetries,`4001 attempt ${this.sessionNotFoundRetries}/${$}`);return}t===`connected`&&this.reconnectAttempts<Q?(this.reconnectAttempts++,this.scheduleReconnect(Z,`attempt ${this.reconnectAttempts}/${Q}`)):(T(`[SessionsWebSocket] Not reconnecting`),this.callbacks.onClose?.())}scheduleReconnect(e,t){this.callbacks.onReconnecting?.(),T(`[SessionsWebSocket] Scheduling reconnect (${t}) in ${e}ms`),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},e)}startPingInterval(){this.stopPingInterval(),this.pingInterval=setInterval(()=>{if(this.ws&&this.state===`connected`)try{this.ws.ping?.()}catch{}},Ye)}stopPingInterval(){this.pingInterval&&(clearInterval(this.pingInterval),this.pingInterval=null)}sendControlResponse(e){if(!this.ws||this.state!==`connected`){W(Error(`[SessionsWebSocket] Cannot send: not connected`));return}T(`[SessionsWebSocket] Sending control response`),this.ws.send(E(e))}sendControlRequest(e){if(!this.ws||this.state!==`connected`){W(Error(`[SessionsWebSocket] Cannot send: not connected`));return}let t={type:`control_request`,request_id:Ne(),request:e};T(`[SessionsWebSocket] Sending control request: ${e.subtype}`),this.ws.send(E(t))}isConnected(){return this.state===`connected`}close(){T(`[SessionsWebSocket] Closing connection`),this.state=`closed`,this.stopPingInterval(),this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.ws&&(this.ws.close(),this.ws=null)}reconnect(){T(`[SessionsWebSocket] Force reconnecting`),this.reconnectAttempts=0,this.sessionNotFoundRetries=0,this.close(),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},500)}};w(),U(),n();function $e(e){return e.type!==`control_request`&&e.type!==`control_response`&&e.type!==`control_cancel_request`}var et=class{constructor(e,t){r(this,`config`,void 0),r(this,`callbacks`,void 0),r(this,`websocket`,null),r(this,`pendingPermissionRequests`,new Map),this.config=e,this.callbacks=t}connect(){T(`[RemoteSessionManager] Connecting to session ${this.config.sessionId}`);let e={onMessage:e=>this.handleMessage(e),onConnected:()=>{T(`[RemoteSessionManager] Connected`),this.callbacks.onConnected?.()},onClose:()=>{T(`[RemoteSessionManager] Disconnected`),this.callbacks.onDisconnected?.()},onReconnecting:()=>{T(`[RemoteSessionManager] Reconnecting`),this.callbacks.onReconnecting?.()},onError:e=>{W(e),this.callbacks.onError?.(e)}};this.websocket=new Qe(this.config.sessionId,this.config.orgUuid,this.config.getAccessToken,e),this.websocket.connect()}handleMessage(e){if(e.type===`control_request`){this.handleControlRequest(e);return}if(e.type===`control_cancel_request`){let{request_id:t}=e,n=this.pendingPermissionRequests.get(t);T(`[RemoteSessionManager] Permission request cancelled: ${t}`),this.pendingPermissionRequests.delete(t),this.callbacks.onPermissionCancelled?.(t,n?.tool_use_id);return}if(e.type===`control_response`){T(`[RemoteSessionManager] Received control response`);return}$e(e)&&this.callbacks.onMessage(e)}handleControlRequest(e){let t=e.request_id,n=e.request;if(n.subtype===`can_use_tool`)T(`[RemoteSessionManager] Permission request for tool: ${n.tool_name}`),this.pendingPermissionRequests.set(t,n),this.callbacks.onPermissionRequest(n,t);else{T(`[RemoteSessionManager] Unsupported control request subtype: ${n.subtype}`);let e={type:`control_response`,response:{subtype:`error`,request_id:t,error:`Unsupported control request subtype: ${n.subtype}`}};this.websocket?.sendControlResponse(e)}}async sendMessage(e,t){T(`[RemoteSessionManager] Sending message to session ${this.config.sessionId}`);let n=await ke(this.config.sessionId,e,t);return n||W(Error(`[RemoteSessionManager] Failed to send message to session ${this.config.sessionId}`)),n}respondToPermissionRequest(e,t){if(!this.pendingPermissionRequests.get(e)){W(Error(`[RemoteSessionManager] No pending permission request with ID: ${e}`));return}this.pendingPermissionRequests.delete(e);let n={type:`control_response`,response:{subtype:`success`,request_id:e,response:{behavior:t.behavior,...t.behavior===`allow`?{updatedInput:t.updatedInput}:{message:t.message}}}};T(`[RemoteSessionManager] Sending permission response: ${t.behavior}`),this.websocket?.sendControlResponse(n)}isConnected(){return this.websocket?.isConnected()??!1}cancelSession(){T(`[RemoteSessionManager] Sending interrupt signal`),this.websocket?.sendControlRequest({subtype:`interrupt`})}getSessionId(){return this.config.sessionId}disconnect(){T(`[RemoteSessionManager] Disconnecting`),this.websocket?.close(),this.websocket=null,this.pendingPermissionRequests.clear()}reconnect(){T(`[RemoteSessionManager] Reconnecting WebSocket`),this.websocket?.reconnect()}};function tt(e,t,n,r=!1,i=!1){return{sessionId:e,getAccessToken:t,orgUuid:n,hasInitialPrompt:r,viewerOnly:i}}export{We as a,Be as c,q as i,tt as n,Ue as o,Je as r,ze as s,et as t};
1
+ import{n as e,t}from"./memoize-BK3gG5ob.js";import{n,t as r}from"./defineProperty-C-QyHrDq.js";import{Cr as i,Eb as a,Gb as o,Gg as s,Kb as c,Lb as l,Nb as u,Oo as d,Tr as ee,Ub as te,Vb as ne,Vo as re,Wb as ie,XC as f,XT as p,YC as m,YT as h,aT as g,kb as _,rT as v,wo as y,zb as b,zg as x,zo as ae}from"./loadAgentsDir-BL93ulMm.js";import{di as oe,j as S,t as se,ui as ce}from"./src-P_wYS_NJ2.js";import{n as le,t as C}from"./cwd-Cfdf7z7s.js";import{C as w,P as ue,R as de,S as fe,c as T,i as E,x as D}from"./debug-BecbSVoN.js";import{Kt as O,Yt as k,f as A,g as j,n as M}from"./settings-D4CpDv2y.js";import{c as N,h as P,o as F,v as I,y as L}from"./config-aRiTrtCv.js";import{f as R,l as z,m as B,p as V}from"./git-DBlOv64X.js";import{n as H,r as pe}from"./execFileNoThrow-DHyW8FMX.js";import{o as U,s as W}from"./log-Dauqle-Z.js";import{i as G,o as me}from"./platform-B0uTQc9P.js";import{l as he,u as ge}from"./oauth-C9VBDB0Y.js";import{Bt as _e,Vt as ve,_ as ye,ai as be,g as xe,si as Se}from"./model-Bgh_r4lg.js";import{c as Ce,h as we,l as Te,m as K,s as Ee}from"./proxy-CVn7o19p.js";import{c as De,i as Oe}from"./terminalSetup-Cy19F1Js.js";import{l as ke,o as Ae}from"./api-BbJfMXRS.js";import{c as je,u as Me}from"./firstPartyEventLogger-BHjBQH0J.js";import{randomUUID as Ne}from"crypto";t(),h(),le(),P(),k(),pe(),B(),U(),Me();var Pe=[/(?:^|\/)(?:package-lock\.json|yarn\.lock|bun\.lock|bun\.lockb|pnpm-lock\.yaml|Pipfile\.lock|poetry\.lock|Cargo\.lock|Gemfile\.lock|go\.sum|composer\.lock|uv\.lock)$/,/\.generated\./,/(?:^|\/)(?:dist|build|out|target|node_modules|\.next|__pycache__)\//,/\.(?:min\.js|min\.css|map|pyc|pyo)$/,/\.(?:json|ya?ml|toml|xml|ini|cfg|conf|env|lock|txt|md|mdx|rst|csv|log|svg)$/i,/(?:^|\/)\.?(?:eslintrc|prettierrc|babelrc|editorconfig|gitignore|gitattributes|dockerignore|npmrc)/,/(?:^|\/)(?:tsconfig|jsconfig|biome|vitest\.config|jest\.config|webpack\.config|vite\.config|rollup\.config)\.[a-z]+$/,/(?:^|\/)\.(?:github|vscode|idea|claude)\//,/(?:^|\/)(?:CHANGELOG|LICENSE|CONTRIBUTING|CODEOWNERS|README)(?:\.[a-z]+)?$/i];function Fe(e){return!Pe.some(t=>t.test(e))}function Ie(e,t){let n=[],r=new Set,i=new Map;for(let a=1;n.length<t&&a<=t;a++)for(let o of e){if(n.length>=t)break;if(!Fe(o))continue;let e=Math.max(o.lastIndexOf(`/`),o.lastIndexOf(`\\`)),s=e>=0?o.slice(e+1):o;if(!s||r.has(s))continue;let c=e>=0?o.slice(0,e):`.`;(i.get(c)??0)>=a||(n.push(s),r.add(s),i.set(c,(i.get(c)??0)+1))}return n.length>=t?n:[]}async function Le(){if(O.platform===`win32`||!await z())return[];try{let e=await je(),t=[`log`,`-n`,`1000`,`--pretty=format:`,`--name-only`,`--diff-filter=M`],n=new Map,r=e=>{for(let t of e.split(`
2
+ `)){let e=t.trim();e&&n.set(e,(n.get(e)??0)+1)}};if(e){let{stdout:n}=await H(`git`,[...t,`--author=${e}`],{cwd:C()});r(n)}if(n.size<10){let{stdout:e}=await H(V(),t,{cwd:C()});r(e)}return Ie(Array.from(n.entries()).sort((e,t)=>t[1]-e[1]).map(([e])=>e),5)}catch(e){return W(e),[]}}var Re=10080*60*1e3,ze=e(()=>{let e=F(),t=e.exampleFiles?.length?p(e.exampleFiles):`<filepath>`;return`Try "${p([`fix lint errors`,`fix typecheck errors`,`how does ${t} work?`,`refactor ${t}`,`how do I log an error?`,`edit ${t} to...`,`write a test for ${t}`,`create a util logging.py that...`])}"`}),Be=e(async()=>{let e=F();Date.now()-(e.exampleFilesGeneratedAt??0)>Re&&(e.exampleFiles=[]),e.exampleFiles?.length||Le().then(e=>{e.length&&I(t=>({...t,exampleFiles:e,exampleFilesGeneratedAt:Date.now()}))})});Se();var Ve={"claude-3-opus":{modelName:`Claude 3 Opus`,retirementDates:{firstParty:`January 5, 2026`,bedrock:`January 15, 2026`,vertex:`January 5, 2026`,foundry:`January 5, 2026`}},"claude-3-7-sonnet":{modelName:`Claude 3.7 Sonnet`,retirementDates:{firstParty:`February 19, 2026`,bedrock:`April 28, 2026`,vertex:`May 11, 2026`,foundry:`February 19, 2026`}},"claude-3-5-haiku":{modelName:`Claude 3.5 Haiku`,retirementDates:{firstParty:`February 19, 2026`,bedrock:null,vertex:null,foundry:null}}};function He(e){let t=e.toLowerCase(),n=be();for(let[e,r]of Object.entries(Ve)){let i=r.retirementDates[n];if(!(!t.includes(e)||!i))return{isDeprecated:!0,modelName:r.modelName,retirementDate:i}}return{isDeprecated:!1}}function Ue(e){if(!e)return null;let t=He(e);return t.isDeprecated?`⚠ ${t.modelName} will be retired on ${t.retirementDate}. Consider switching to a newer model.`:null}n(),oe(),se(),de(),D(),E(),me(),ge(),j(),_e(),ye(),g(),f(),b(),_(),s(),Oe(),ae(),y(),i(),P();function We(e){let t=N().numStartups;L(n=>{let r=n.tipsHistory??{};return r[e]===t?n:{...n,tipsHistory:{...r,[e]:t}}})}function q(e){let t=N(),n=t.tipsHistory?.[e];return n?t.numStartups-n:1/0}P(),k(),B();var J;async function Ge(){return J===void 0&&(J=v in await re()),J}async function Y(e,t,n){if(!await Ge()||d(`${e}@claude-plugins-official`))return!1;let{bashTools:r}=t??{};return!!(n.cli&&r?.size&&n.cli.some(e=>r.has(e))||n.filePath&&t?.readFileState&&a(t.readFileState).some(e=>n.filePath.test(e)))}var Ke=[{id:`new-user-warmup`,content:async()=>`Start with small features or bug fixes, tell Claude to propose a plan, and verify its suggested edits`,cooldownSessions:3,async isRelevant(){return N().numStartups<10}},{id:`plan-mode-for-complex-tasks`,content:async()=>`Use Plan Mode to prepare for a complex request before making changes. Press ${m(`chat:cycleMode`,`Chat`,`shift+tab`)} twice to enable.`,cooldownSessions:5,isRelevant:async()=>{let e=N();return(e.lastPlanModeUse?(Date.now()-e.lastPlanModeUse)/(1e3*60*60*24):1/0)>7}},{id:`default-permission-mode-config`,content:async()=>`Use /config to change your default permission mode (including Plan Mode)`,cooldownSessions:10,isRelevant:async()=>{try{let e=N(),t=A(),n=!!e.lastPlanModeUse,r=!!t?.permissions?.defaultMode;return n&&!r}catch(e){return T(`Failed to check default-permission-mode-config tip relevance: ${e}`,{level:`warn`}),!1}}},{id:`git-worktrees`,content:async()=>`Use git worktrees to run multiple Claude sessions in parallel.`,cooldownSessions:10,isRelevant:async()=>{try{let e=N();return await R()<=1&&e.numStartups>50}catch{return!1}}},{id:`terminal-setup`,content:async()=>O.terminal===`Apple_Terminal`?`Run /terminal-setup to enable convenient terminal integration like Option + Enter for new line and more`:`Run /terminal-setup to enable convenient terminal integration like Shift + Enter for new line and more`,cooldownSessions:10,async isRelevant(){let e=N();return O.terminal===`Apple_Terminal`?!e.optionAsMetaKeyInstalled:!e.shiftEnterKeyBindingInstalled}},{id:`shift-enter`,content:async()=>O.terminal===`Apple_Terminal`?`Press Option+Enter to send a multi-line message`:`Press Shift+Enter to send a multi-line message`,cooldownSessions:10,async isRelevant(){let e=N();return!!((O.terminal===`Apple_Terminal`?e.optionAsMetaKeyInstalled:e.shiftEnterKeyBindingInstalled)&&e.numStartups>3)}},{id:`shift-enter-setup`,content:async()=>O.terminal===`Apple_Terminal`?`Run /terminal-setup to enable Option+Enter for new lines`:`Run /terminal-setup to enable Shift+Enter for new lines`,cooldownSessions:10,async isRelevant(){if(!De())return!1;let e=N();return!(O.terminal===`Apple_Terminal`?e.optionAsMetaKeyInstalled:e.shiftEnterKeyBindingInstalled)}},{id:`memory-command`,content:async()=>`Use /memory to view and manage Claude memory`,cooldownSessions:15,async isRelevant(){return N().memoryUsageCount<=0}},{id:`theme-command`,content:async()=>`Use /theme to change the color theme`,cooldownSessions:20,isRelevant:async()=>!0},{id:`colorterm-truecolor`,content:async()=>`Try setting environment variable COLORTERM=truecolor for richer colors`,cooldownSessions:30,isRelevant:async()=>!process.env.COLORTERM&&ce.level<3},{id:`powershell-tool-env`,content:async()=>`Set CLAUDE_CODE_USE_POWERSHELL_TOOL=1 to enable the PowerShell tool (preview)`,cooldownSessions:10,isRelevant:async()=>G()===`windows`&&process.env.CLAUDE_CODE_USE_POWERSHELL_TOOL===void 0},{id:`status-line`,content:async()=>`Use /statusline to set up a custom status line that will display beneath the input box`,cooldownSessions:25,isRelevant:async()=>A().statusLine===void 0},{id:`prompt-queue`,content:async()=>`Hit Enter to queue up additional messages while Claude is working.`,cooldownSessions:5,async isRelevant(){return N().promptQueueUseCount<=3}},{id:`enter-to-steer-in-relatime`,content:async()=>`Send messages to Claude while it works to steer Claude in real-time`,cooldownSessions:20,isRelevant:async()=>!0},{id:`todo-list`,content:async()=>`Ask Claude to create a todo list when working on complex tasks to track progress and remain on track`,cooldownSessions:20,isRelevant:async()=>!0},{id:`vscode-command-install`,content:async()=>`Open the Command Palette (Cmd+Shift+P) and run "Shell Command: Install '${O.terminal===`vscode`?`code`:O.terminal}' command in PATH" to enable IDE integration`,cooldownSessions:0,async isRelevant(){if(!ie()||G()!==`macos`)return!1;switch(O.terminal){case`vscode`:return!await o();case`cursor`:return!await ne();case`windsurf`:return!await c();default:return!1}}},{id:`ide-upsell-external-terminal`,content:async()=>`Connect Claude to your IDE · /ide`,cooldownSessions:4,async isRelevant(){return te()||(await l()).length!==0?!1:(await u()).length>0}},{id:`permissions`,content:async()=>`Use /permissions to pre-approve and pre-deny bash, edit, and MCP tools`,cooldownSessions:10,async isRelevant(){return N().numStartups>10}},{id:`drag-and-drop-images`,content:async()=>`Did you know you can drag and drop image files into your terminal?`,cooldownSessions:10,isRelevant:async()=>!O.isSSH()},{id:`paste-images-mac`,content:async()=>`Paste images into Work Mate using control+v (not cmd+v!)`,cooldownSessions:10,isRelevant:async()=>G()===`macos`},{id:`double-esc`,content:async()=>`Double-tap esc to rewind the conversation to a previous point in time`,cooldownSessions:10,isRelevant:async()=>!x()},{id:`double-esc-code-restore`,content:async()=>`Double-tap esc to rewind the code and/or conversation to a previous point in time`,cooldownSessions:10,isRelevant:async()=>x()},{id:`continue`,content:async()=>`Run claude --continue or claude --resume to resume a conversation`,cooldownSessions:10,isRelevant:async()=>!0},{id:`rename-conversation`,content:async()=>`Name your conversations with /rename to find them easily in /resume later`,cooldownSessions:15,isRelevant:async()=>ee()&&N().numStartups>10},{id:`custom-commands`,content:async()=>`Create skills by adding .md files to .claude/skills/ in your project or ~/.claude/skills/ for skills that work in any project`,cooldownSessions:15,async isRelevant(){return N().numStartups>10}},{id:`shift-tab`,content:async()=>`Hit ${m(`chat:cycleMode`,`Chat`,`shift+tab`)} to cycle between default, accept edits, plan, auto, and bypass modes`,cooldownSessions:10,isRelevant:async()=>!0},{id:`image-paste`,content:async()=>`Use ${m(`chat:imagePaste`,`Chat`,`ctrl+v`)} to paste images from your clipboard`,cooldownSessions:20,isRelevant:async()=>!0},{id:`custom-agents`,content:async()=>`Use /agents to optimize specific tasks. Eg. Software Architect, Code Writer, Code Reviewer`,cooldownSessions:15,async isRelevant(){return N().numStartups>5}},{id:`agent-flag`,content:async()=>`Use --agent <agent_name> to directly start a conversation with a subagent`,cooldownSessions:15,async isRelevant(){return N().numStartups>5}},{id:`web-app`,content:async()=>`Run tasks in the cloud while you keep coding locally · clau.de/web`,cooldownSessions:15,isRelevant:async()=>!0},{id:`opusplan-mode-reminder`,content:async()=>`Your default model setting is Opus Plan Mode. Press ${m(`chat:cycleMode`,`Chat`,`shift+tab`)} twice to activate Plan Mode and plan with Claude Opus.`,cooldownSessions:2,async isRelevant(){let e=N(),t=xe()===`opusplan`,n=e.lastPlanModeUse?(Date.now()-e.lastPlanModeUse)/(1e3*60*60*24):1/0;return t&&n>3}},{id:`frontend-design-plugin`,content:async e=>`Working with HTML/CSS? Install the frontend-design plugin:\n${S(`suggestion`,e?.theme??`dark`)(`/plugin install frontend-design@${v}`)}`,cooldownSessions:3,isRelevant:async e=>Y(`frontend-design`,e,{filePath:/\.(html|css|htm)$/i})},{id:`vercel-plugin`,content:async e=>`Working with Vercel? Install the vercel plugin:\n${S(`suggestion`,e?.theme??`dark`)(`/plugin install vercel@${v}`)}`,cooldownSessions:3,isRelevant:async e=>Y(`vercel`,e,{filePath:/(?:^|[/\\])vercel\.json$/i,cli:[`vercel`]})},{id:`subagent-fanout-nudge`,content:async e=>`Say ${S(`suggestion`,e?.theme??`dark`)(`"fan out subagents"`)} and Claude sends a team. Each one digs deep so nothing gets missed.`,cooldownSessions:3,isRelevant:async()=>(ve(),!1)}],qe=[];function X(){let e=M().spinnerTipsOverride;return e?.tips?.length?e.tips.map((e,t)=>({id:`custom-tip-${t}`,content:async()=>e,cooldownSessions:0,isRelevant:async()=>!0})):[]}async function Je(e){let t=M().spinnerTipsOverride,n=X();if(t?.excludeDefault&&n.length>0)return n;let r=[...Ke,...qe],i=await Promise.all(r.map(t=>t.isRelevant?.(e)??Promise.resolve(!0)));return[...r.filter((e,t)=>i[t]).filter(e=>q(e.id)>=e.cooldownSessions),...n]}Ae(),E(),U(),we(),Te();var Z=2e3,Q=5,Ye=3e4,$=3,Xe=new Set([4003]);function Ze(e){return typeof e!=`object`||!e||!(`type`in e)?!1:typeof e.type==`string`}var Qe=class{constructor(e,t,n,i){r(this,`sessionId`,void 0),r(this,`orgUuid`,void 0),r(this,`getAccessToken`,void 0),r(this,`callbacks`,void 0),r(this,`ws`,null),r(this,`state`,`closed`),r(this,`reconnectAttempts`,0),r(this,`sessionNotFoundRetries`,0),r(this,`pingInterval`,null),r(this,`reconnectTimer`,null),this.sessionId=e,this.orgUuid=t,this.getAccessToken=n,this.callbacks=i}async connect(){if(this.state===`connecting`){T(`[SessionsWebSocket] Already connecting`);return}this.state=`connecting`;let e=`${he().BASE_API_URL.replace(`http`,`ws`)}/v1/sessions/ws/${this.sessionId}/subscribe?organization_uuid=${this.orgUuid}`;T(`[SessionsWebSocket] Connecting to ${e}`);let t={Authorization:`Bearer ${this.getAccessToken()}`,"anthropic-version":`2023-06-01`};if(typeof Bun<`u`){let n=new globalThis.WebSocket(e,{headers:t,proxy:Ce(e),tls:K()||void 0});this.ws=n,n.addEventListener(`open`,()=>{T(`[SessionsWebSocket] Connection opened, authenticated via headers`),this.state=`connected`,this.reconnectAttempts=0,this.sessionNotFoundRetries=0,this.startPingInterval(),this.callbacks.onConnected?.()}),n.addEventListener(`message`,e=>{let t=typeof e.data==`string`?e.data:String(e.data);this.handleMessage(t)}),n.addEventListener(`error`,()=>{let e=Error(`[SessionsWebSocket] WebSocket error`);W(e),this.callbacks.onError?.(e)}),n.addEventListener(`close`,e=>{T(`[SessionsWebSocket] Closed: code=${e.code} reason=${e.reason}`),this.handleClose(e.code)}),n.addEventListener(`pong`,()=>{T(`[SessionsWebSocket] Pong received`)})}else{let{default:n}=await import(`./wrapper-K8ZapJVu.js`),r=new n(e,{headers:t,agent:Ee(e),...K()});this.ws=r,r.on(`open`,()=>{T(`[SessionsWebSocket] Connection opened, authenticated via headers`),this.state=`connected`,this.reconnectAttempts=0,this.sessionNotFoundRetries=0,this.startPingInterval(),this.callbacks.onConnected?.()}),r.on(`message`,e=>{this.handleMessage(e.toString())}),r.on(`error`,e=>{W(Error(`[SessionsWebSocket] Error: ${e.message}`)),this.callbacks.onError?.(e)}),r.on(`close`,(e,t)=>{T(`[SessionsWebSocket] Closed: code=${e} reason=${t.toString()}`),this.handleClose(e)}),r.on(`pong`,()=>{T(`[SessionsWebSocket] Pong received`)})}}handleMessage(e){try{let t=fe(e);Ze(t)?this.callbacks.onMessage(t):T(`[SessionsWebSocket] Ignoring message type: ${typeof t==`object`&&t&&`type`in t?String(t.type):`unknown`}`)}catch(e){W(Error(`[SessionsWebSocket] Failed to parse message: ${ue(e)}`))}}handleClose(e){if(this.stopPingInterval(),this.state===`closed`)return;this.ws=null;let t=this.state;if(this.state=`closed`,Xe.has(e)){T(`[SessionsWebSocket] Permanent close code ${e}, not reconnecting`),this.callbacks.onClose?.();return}if(e===4001){if(this.sessionNotFoundRetries++,this.sessionNotFoundRetries>$){T(`[SessionsWebSocket] 4001 retry budget exhausted (${$}), not reconnecting`),this.callbacks.onClose?.();return}this.scheduleReconnect(Z*this.sessionNotFoundRetries,`4001 attempt ${this.sessionNotFoundRetries}/${$}`);return}t===`connected`&&this.reconnectAttempts<Q?(this.reconnectAttempts++,this.scheduleReconnect(Z,`attempt ${this.reconnectAttempts}/${Q}`)):(T(`[SessionsWebSocket] Not reconnecting`),this.callbacks.onClose?.())}scheduleReconnect(e,t){this.callbacks.onReconnecting?.(),T(`[SessionsWebSocket] Scheduling reconnect (${t}) in ${e}ms`),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},e)}startPingInterval(){this.stopPingInterval(),this.pingInterval=setInterval(()=>{if(this.ws&&this.state===`connected`)try{this.ws.ping?.()}catch{}},Ye)}stopPingInterval(){this.pingInterval&&(clearInterval(this.pingInterval),this.pingInterval=null)}sendControlResponse(e){if(!this.ws||this.state!==`connected`){W(Error(`[SessionsWebSocket] Cannot send: not connected`));return}T(`[SessionsWebSocket] Sending control response`),this.ws.send(w(e))}sendControlRequest(e){if(!this.ws||this.state!==`connected`){W(Error(`[SessionsWebSocket] Cannot send: not connected`));return}let t={type:`control_request`,request_id:Ne(),request:e};T(`[SessionsWebSocket] Sending control request: ${e.subtype}`),this.ws.send(w(t))}isConnected(){return this.state===`connected`}close(){T(`[SessionsWebSocket] Closing connection`),this.state=`closed`,this.stopPingInterval(),this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.ws&&(this.ws.close(),this.ws=null)}reconnect(){T(`[SessionsWebSocket] Force reconnecting`),this.reconnectAttempts=0,this.sessionNotFoundRetries=0,this.close(),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},500)}};E(),U(),n();function $e(e){return e.type!==`control_request`&&e.type!==`control_response`&&e.type!==`control_cancel_request`}var et=class{constructor(e,t){r(this,`config`,void 0),r(this,`callbacks`,void 0),r(this,`websocket`,null),r(this,`pendingPermissionRequests`,new Map),this.config=e,this.callbacks=t}connect(){T(`[RemoteSessionManager] Connecting to session ${this.config.sessionId}`);let e={onMessage:e=>this.handleMessage(e),onConnected:()=>{T(`[RemoteSessionManager] Connected`),this.callbacks.onConnected?.()},onClose:()=>{T(`[RemoteSessionManager] Disconnected`),this.callbacks.onDisconnected?.()},onReconnecting:()=>{T(`[RemoteSessionManager] Reconnecting`),this.callbacks.onReconnecting?.()},onError:e=>{W(e),this.callbacks.onError?.(e)}};this.websocket=new Qe(this.config.sessionId,this.config.orgUuid,this.config.getAccessToken,e),this.websocket.connect()}handleMessage(e){if(e.type===`control_request`){this.handleControlRequest(e);return}if(e.type===`control_cancel_request`){let{request_id:t}=e,n=this.pendingPermissionRequests.get(t);T(`[RemoteSessionManager] Permission request cancelled: ${t}`),this.pendingPermissionRequests.delete(t),this.callbacks.onPermissionCancelled?.(t,n?.tool_use_id);return}if(e.type===`control_response`){T(`[RemoteSessionManager] Received control response`);return}$e(e)&&this.callbacks.onMessage(e)}handleControlRequest(e){let t=e.request_id,n=e.request;if(n.subtype===`can_use_tool`)T(`[RemoteSessionManager] Permission request for tool: ${n.tool_name}`),this.pendingPermissionRequests.set(t,n),this.callbacks.onPermissionRequest(n,t);else{T(`[RemoteSessionManager] Unsupported control request subtype: ${n.subtype}`);let e={type:`control_response`,response:{subtype:`error`,request_id:t,error:`Unsupported control request subtype: ${n.subtype}`}};this.websocket?.sendControlResponse(e)}}async sendMessage(e,t){T(`[RemoteSessionManager] Sending message to session ${this.config.sessionId}`);let n=await ke(this.config.sessionId,e,t);return n||W(Error(`[RemoteSessionManager] Failed to send message to session ${this.config.sessionId}`)),n}respondToPermissionRequest(e,t){if(!this.pendingPermissionRequests.get(e)){W(Error(`[RemoteSessionManager] No pending permission request with ID: ${e}`));return}this.pendingPermissionRequests.delete(e);let n={type:`control_response`,response:{subtype:`success`,request_id:e,response:{behavior:t.behavior,...t.behavior===`allow`?{updatedInput:t.updatedInput}:{message:t.message}}}};T(`[RemoteSessionManager] Sending permission response: ${t.behavior}`),this.websocket?.sendControlResponse(n)}isConnected(){return this.websocket?.isConnected()??!1}cancelSession(){T(`[RemoteSessionManager] Sending interrupt signal`),this.websocket?.sendControlRequest({subtype:`interrupt`})}getSessionId(){return this.config.sessionId}disconnect(){T(`[RemoteSessionManager] Disconnecting`),this.websocket?.close(),this.websocket=null,this.pendingPermissionRequests.clear()}reconnect(){T(`[RemoteSessionManager] Reconnecting WebSocket`),this.websocket?.reconnect()}};function tt(e,t,n,r=!1,i=!1){return{sessionId:e,getAccessToken:t,orgUuid:n,hasInitialPrompt:r,viewerOnly:i}}export{We as a,Be as c,q as i,tt as n,Ue as o,Je as r,ze as s,et as t};
@@ -0,0 +1 @@
1
+ import{a as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Cc as n,Cr as r,Du as ee,Eu as i,GC as a,Iu as o,Pr as s,Pu as c,Qn as te,Sg as ne,Tr as re,Vn as l,Xy as u,ZC as d,Zy as ie,_l as ae,ai as oe,c_ as f,gl as se,ii as ce,qr as le,s_ as p,vc as m,wg as h,xg as g,zr as _}from"./loadAgentsDir-BL93ulMm.js";import{I as v,P as y,Wt as b,dr as x,fi as S,ot as C,t as w}from"./src-P_wYS_NJ2.js";import{t as T}from"./jsx-runtime-Bb4Xn-E0.js";import{Wt as E,or as ue}from"./state-BemZdQIl.js";import{o as D,s as O}from"./log-Dauqle-Z.js";import{n as k,r as A}from"./analytics-DJobLaWP.js";import{a as de,n as fe,s as j}from"./skillChangeDetector-U5kRU5nd.js";import{t as M}from"./REPL-CUbEDqEl.js";import{a as N,i as P,n as F,o as I,r as L,t as R}from"./crossProjectResume-Bw3U0Ty6.js";import{dirname as z}from"path";var B=t(S(),1);d(),E(),I(),o(),u(),w(),a(),k(),g(),f(),P(),m(),i(),F(),D(),r();var V=T();function pe(e){let t=parseInt(e,10);if(!isNaN(t)&&t>0)return t;let n=e.match(/github\.com\/[^/]+\/[^/]+\/pull\/(\d+)/);return n?.[1]?parseInt(n[1],10):null}function H({commands:t,worktreePaths:r,initialTools:i,mcpClients:a,dynamicMcpConfig:o,debug:u,mainThreadAgentDefinition:d,autoConnectIdeFlag:f,strictMcpConfig:m=!1,systemPrompt:g,appendSystemPrompt:b,initialSearchQuery:S,disableSlashCommands:w=!1,forkSession:T,taskListId:E,filterByPr:D,thinkingConfig:k,onTurnComplete:P}){let{rows:F}=C(),I=ne(e=>e.agentDefinitions),H=h(),[U,W]=B.useState([]),[ge,G]=B.useState(!0),[_e,ve]=B.useState(!1),[K,ye]=B.useState(!1),[q,be]=B.useState(null),[J,xe]=B.useState(null),Y=B.useRef(null),X=B.useRef(0),Z=B.useMemo(()=>{let e=U.filter(e=>!e.isSidechain);if(D!==void 0){if(D===!0)e=e.filter(e=>e.prNumber!==void 0);else if(typeof D==`number`)e=e.filter(e=>e.prNumber===D);else if(typeof D==`string`){let t=pe(D);t!==null&&(e=e.filter(e=>e.prNumber===t))}}return e},[U,D]),Se=re();B.useEffect(()=>{_(r).then(e=>{Y.current=e,X.current=e.logs.length,W(e.logs),G(!1)}).catch(e=>{O(e),G(!1)})},[r]);let Q=B.useCallback(e=>{let t=Y.current;!t||t.nextIndex>=t.allStatLogs.length||te(t.allStatLogs,t.nextIndex,e).then(n=>{if(t.nextIndex=n.nextIndex,n.logs.length>0){let e=X.current;n.logs.forEach((t,n)=>{t.value=e+n}),W(e=>e.concat(n.logs)),X.current+=n.logs.length}else t.nextIndex<t.allStatLogs.length&&Q(e)})},[]),$=B.useCallback(e=>{G(!0),(e?s():_(r)).then(e=>{Y.current=e,X.current=e.logs.length,W(e.logs)}).catch(e=>{O(e)}).finally(()=>{G(!1)})},[r]),Ce=B.useCallback(()=>{let e=!K;ye(e),$(e)},[K,$]);function we(){process.exit(1)}async function Te(t){ve(!0);let r=performance.now(),i=R(t,K);if(i.isCrossProject&&!i.isSameRepoWorktree){let e=i.command,t=await x(e);t&&process.stdout.write(t),xe(e);return}try{let i=await ee(t,void 0);if(!i)throw Error(`Failed to load conversation`);i.sessionId&&!T?(ue(p(i.sessionId),t.fullPath?z(t.fullPath):null),await ce(),ie(i.sessionId)):T&&i.contentReplacements?.length&&await le(i.contentReplacements);let{agentDefinition:a}=de(i.agentSetting,d,I);H(e=>({...e,agent:a?.agentType}));let o=fe(i.agentName,i.agentColor);if(o&&H(e=>({...e,standaloneAgentContext:o})),n(i.agentName),oe(T?{...i,worktreeSession:void 0}:i),T||(j(i.worktreeSession),i.sessionId&&l()),i.goal&&i.sessionId){let{hydrateGoalFromTranscript:t}=(ae(),e(se)),n=new Map;n.set(i.sessionId,i.goal),t(n,i.sessionId)}A(`tengu_session_resumed`,{entrypoint:`picker`,success:!0,resume_duration_ms:Math.round(performance.now()-r)}),W([]),be({messages:i.messages,fileHistorySnapshots:i.fileHistorySnapshots,contentReplacements:i.contentReplacements,agentName:i.agentName,agentColor:i.agentColor==="default"?void 0:i.agentColor,mainThreadAgentDefinition:a})}catch(e){throw A(`tengu_session_resumed`,{entrypoint:`picker`,success:!1}),O(e),e}}return J?(0,V.jsx)(he,{command:J}):q?(0,V.jsx)(M,{debug:u,commands:t,initialTools:i,initialMessages:q.messages,initialFileHistorySnapshots:q.fileHistorySnapshots,initialContentReplacements:q.contentReplacements,initialAgentName:q.agentName,initialAgentColor:q.agentColor,mcpClients:a,dynamicMcpConfig:o,strictMcpConfig:m,systemPrompt:g,appendSystemPrompt:b,mainThreadAgentDefinition:q.mainThreadAgentDefinition,autoConnectIdeFlag:f,disableSlashCommands:w,taskListId:E,thinkingConfig:k,onTurnComplete:P}):ge?(0,V.jsxs)(v,{children:[(0,V.jsx)(c,{}),(0,V.jsx)(y,{children:` Loading conversations…`})]}):_e?(0,V.jsxs)(v,{children:[(0,V.jsx)(c,{}),(0,V.jsx)(y,{children:` Resuming conversation…`})]}):Z.length===0?(0,V.jsx)(me,{}):(0,V.jsx)(N,{logs:Z,maxHeight:F,onCancel:we,onSelect:Te,onLogsChanged:Se?()=>$(K):void 0,onLoadMore:Q,initialSearchQuery:S,showAllProjects:K,onToggleAllProjects:Ce,onAgenticSearch:L})}function me(){return b(`app:interrupt`,()=>{process.exit(1)},{context:`Global`}),(0,V.jsxs)(v,{flexDirection:`column`,children:[(0,V.jsx)(y,{children:`No conversations found to resume.`}),(0,V.jsx)(y,{dimColor:!0,children:`Press Ctrl+C to exit and start a new conversation.`})]})}function he({command:e}){return B.useEffect(()=>{let e=setTimeout(()=>{process.exit(0)},100);return()=>clearTimeout(e)},[]),(0,V.jsxs)(v,{flexDirection:`column`,gap:1,children:[(0,V.jsx)(y,{children:`This conversation is from a different directory.`}),(0,V.jsxs)(v,{flexDirection:`column`,children:[(0,V.jsx)(y,{children:`To resume, run:`}),(0,V.jsxs)(y,{children:[` `,e]})]}),(0,V.jsx)(y,{dimColor:!0,children:`(Command copied to clipboard)`})]})}export{H as ResumeConversation};
@@ -1,4 +1,4 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./defineProperty-C-QyHrDq.js";import{n as r,t as i}from"./axios-DaWTGg7G.js";import{C as a,F as o,S as s,a as c,l,w as u,z as d}from"./debug-RAynG_nM.js";import{O as f,k as p}from"./git-2c7WlGDL.js";import{_n as m,vn as h}from"./model-BsZ4sP_H.js";import{n as g,t as _}from"./userAgent-CIq27vUR.js";import{A as v,O as y}from"./sessionState-Bifmu95-.js";import{n as b,t as x}from"./rcDebugLog-CARUIORE.js";function S(){return!0}function C(e){let t=[],n=0,r=/\r?\n\r?\n/g;r.lastIndex=n;let i;for(;(i=r.exec(e))!==null;){let r=i.index,a=e.slice(n,r);if(n=r+i[0].length,!a.trim())continue;let o={},s=!1;for(let e of a.split(`
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./defineProperty-C-QyHrDq.js";import{n as r,t as i}from"./axios-DaWTGg7G.js";import{C as a,P as o,R as s,S as c,c as l,i as u,x as d}from"./debug-BecbSVoN.js";import{O as f,k as p}from"./git-DBlOv64X.js";import{_n as m,vn as h}from"./model-Bgh_r4lg.js";import{n as g,t as _}from"./userAgent-CU7Ndh79.js";import{A as v,O as y}from"./sessionState-D-SaBzWD.js";import{n as b,t as x}from"./rcDebugLog-CARUIORE.js";function S(){return!0}function C(e){let t=[],n=0,r=/\r?\n\r?\n/g;r.lastIndex=n;let i;for(;(i=r.exec(e))!==null;){let r=i.index,a=e.slice(n,r);if(n=r+i[0].length,!a.trim())continue;let o={},s=!1;for(let e of a.split(`
2
2
  `)){let t=e[e.length-1]===`\r`?e.slice(0,-1):e;if(t.startsWith(`:`)){s=!0;continue}let n=t.indexOf(`:`);if(n===-1)continue;let r=t.slice(0,n),i=t[n+1]===` `?t.slice(n+2):t.slice(n+1);switch(r){case`event`:o.event=i;break;case`id`:o.id=i;break;case`data`:o.data=o.data?o.data+`
3
- `+i:i;break}}(o.data||s)&&t.push(o)}return{frames:t,remaining:e.slice(n)}}function w(e){let t=e.pathname;return t.endsWith(`/stream`)&&(t=t.slice(0,-7)),`${e.protocol}//${e.host}${t}`}var T,E,D,O,k,A,j,M,N,P,F=e((()=>{i(),c(),x(),f(),d(),v(),m(),s(),g(),t(),T=1e3,E=3e4,D=6e5,O=45e3,k=new Set([401,403,404]),A=10,j=500,M=8e3,N={stream:!0},P=class{constructor(e,t={},r,i,a,o){n(this,`url`,void 0),n(this,`state`,`idle`),n(this,`onData`,void 0),n(this,`onCloseCallback`,void 0),n(this,`onEventCallback`,void 0),n(this,`headers`,void 0),n(this,`sessionId`,void 0),n(this,`refreshHeaders`,void 0),n(this,`getAuthHeaders`,void 0),n(this,`abortController`,null),n(this,`lastSequenceNum`,0),n(this,`seenSequenceNums`,new Set),n(this,`reconnectAttempts`,0),n(this,`reconnectStartTime`,null),n(this,`reconnectTimer`,null),n(this,`livenessTimer`,null),n(this,`lastActivityTime`,0),n(this,`postUrl`,void 0),n(this,`onLivenessTimeout`,()=>{this.livenessTimer=null,b(`SSE liveness timeout (${O}ms) lastSeqNum=${this.getLastSequenceNum()} state=${this.state}`),l(`SSETransport: Liveness timeout, reconnecting`,{level:`error`}),p(`error`,`cli_sse_liveness_timeout`),this.abortController?.abort(),this.handleConnectionError()}),this.url=e,this.headers=t,this.sessionId=r,this.refreshHeaders=i,this.getAuthHeaders=o??y,this.postUrl=w(e),a!==void 0&&a>0&&(this.lastSequenceNum=a),l(`SSETransport: SSE URL = ${e.href}`),l(`SSETransport: POST URL = ${this.postUrl}`),p(`info`,`cli_sse_transport_initialized`)}getLastSequenceNum(){return this.lastSequenceNum}async connect(){if(this.state!==`idle`&&this.state!==`reconnecting`){l(`SSETransport: Cannot connect, current state is ${this.state}`,{level:`error`}),p(`error`,`cli_sse_connect_failed`);return}this.state=`reconnecting`;let e=Date.now(),t=new URL(this.url.href);this.lastSequenceNum>0&&t.searchParams.set(`from_sequence_num`,String(this.lastSequenceNum));let n=this.getAuthHeaders(),r={...this.headers,...n,Accept:`text/event-stream`,"anthropic-version":`2023-06-01`,"User-Agent":_()};n.Cookie&&delete r.Authorization,this.lastSequenceNum>0&&(r[`Last-Event-ID`]=String(this.lastSequenceNum)),l(`SSETransport: Opening ${t.href}`),p(`info`,`cli_sse_connect_opening`),this.abortController=new AbortController;try{let n=await fetch(t.href,{headers:r,signal:this.abortController.signal});if(!n.ok){let e=k.has(n.status);if(l(`SSETransport: HTTP ${n.status}${e?` (permanent)`:``}`,{level:`error`}),p(`error`,`cli_sse_connect_http_error`,{status:n.status}),e){this.state=`closed`,this.onCloseCallback?.(n.status);return}this.handleConnectionError();return}if(!n.body){l(`SSETransport: No response body`),this.handleConnectionError();return}let i=Date.now()-e;l(`SSETransport: Connected`),p(`info`,`cli_sse_connect_connected`,{duration_ms:i}),this.state=`connected`,this.reconnectAttempts=0,this.reconnectStartTime=null,this.resetLivenessTimer(),await this.readStream(n.body)}catch(e){if(this.abortController?.signal.aborted)return;l(`SSETransport: Connection error: ${o(e)}`,{level:`error`}),p(`error`,`cli_sse_connect_error`),this.handleConnectionError()}}async readStream(e){let t=e.getReader(),n=new TextDecoder,r=``,i=1024*1024;try{for(;;){let{done:e,value:a}=await t.read();if(e)break;if(r+=n.decode(a,N),r.length>i){l(`SSETransport: Buffer exceeded ${i} bytes — dropping connection`,{level:`error`}),p(`error`,`cli_sse_buffer_overflow`);break}let{frames:o,remaining:s}=C(r);r=s;for(let e of o){if(this.resetLivenessTimer(),e.id){let t=parseInt(e.id,10);if(!isNaN(t)){if(this.seenSequenceNums.has(t))l(`SSETransport: DUPLICATE frame seq=${t} (lastSequenceNum=${this.lastSequenceNum}, seenCount=${this.seenSequenceNums.size})`,{level:`warn`}),p(`warn`,`cli_sse_duplicate_sequence`);else if(this.seenSequenceNums.add(t),this.seenSequenceNums.size>1e3){let e=this.lastSequenceNum-200;for(let t of this.seenSequenceNums)t<e&&this.seenSequenceNums.delete(t)}t>this.lastSequenceNum&&(this.lastSequenceNum=t)}}e.event&&e.data?this.handleSSEFrame(e.event,e.data):e.data&&(l(`SSETransport: Frame has data: but no event: field — dropped`,{level:`warn`}),p(`warn`,`cli_sse_frame_missing_event_field`))}}}catch(e){if(this.abortController?.signal.aborted)return;l(`SSETransport: Stream read error: ${o(e)}`,{level:`error`}),p(`error`,`cli_sse_stream_read_error`)}finally{t.releaseLock()}this.state!==`closing`&&this.state!==`closed`&&(l(`SSETransport: Stream ended, reconnecting`),this.handleConnectionError())}handleSSEFrame(e,t){if(e!==`client_event`){l(`SSETransport: Unexpected SSE event type '${e}' on worker stream`,{level:`warn`}),p(`warn`,`cli_sse_unexpected_event_type`,{event_type:e});return}let n;try{n=a(t)}catch(e){l(`SSETransport: Failed to parse client_event data: ${o(e)}`,{level:`error`});return}let r=n.payload;if(r&&typeof r==`object`&&`type`in r){let e=this.sessionId?` session=${this.sessionId}`:``;l(`SSETransport: Event seq=${n.sequence_num} event_id=${n.event_id} event_type=${n.event_type} payload_type=${String(r.type)}${e}`),p(`info`,`cli_sse_message_received`),this.onData?.(u(r)+`
4
- `)}else l(`SSETransport: Ignoring client_event with no type in payload: event_id=${n.event_id}`);this.onEventCallback?.(n)}handleConnectionError(){if(b(`SSE handleConnectionError: state=${this.state} lastSeqNum=${this.getLastSequenceNum()} reconnectAttempts=${this.reconnectAttempts} msSinceLastActivity=${this.lastActivityTime>0?Date.now()-this.lastActivityTime:-1}`),this.clearLivenessTimer(),this.state===`closing`||this.state===`closed`)return;this.abortController?.abort(),this.abortController=null;let e=Date.now();this.reconnectStartTime||(this.reconnectStartTime=e);let t=e-this.reconnectStartTime;if(t<D){if(this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.refreshHeaders){let e=this.refreshHeaders();Object.assign(this.headers,e),l(`SSETransport: Refreshed headers for reconnect`)}this.state=`reconnecting`,this.reconnectAttempts++;let e=Math.min(T*2**(this.reconnectAttempts-1),E),n=Math.max(0,e+e*.25*(2*Math.random()-1));l(`SSETransport: Reconnecting in ${Math.round(n)}ms (attempt ${this.reconnectAttempts}, ${Math.round(t/1e3)}s elapsed)`),p(`error`,`cli_sse_reconnect_attempt`,{reconnectAttempts:this.reconnectAttempts}),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},n)}else l(`SSETransport: Reconnection time budget exhausted after ${Math.round(t/1e3)}s`,{level:`error`}),p(`error`,`cli_sse_reconnect_exhausted`,{reconnectAttempts:this.reconnectAttempts,elapsedMs:t}),this.state=`closed`,this.onCloseCallback?.()}resetLivenessTimer(){this.clearLivenessTimer(),this.livenessTimer=setTimeout(this.onLivenessTimeout,O)}clearLivenessTimer(){this.livenessTimer&&(clearTimeout(this.livenessTimer),this.livenessTimer=null)}async write(e){let t=this.getAuthHeaders();if(Object.keys(t).length===0){l(`SSETransport: No session token available for POST`),p(`warn`,`cli_sse_post_no_token`);return}let n={...t,"Content-Type":`application/json`,"anthropic-version":`2023-06-01`,"User-Agent":_()};l(`SSETransport: POST body keys=${Object.keys(e).join(`,`)}`);for(let t=1;t<=A;t++){try{let i=await r.post(this.postUrl,e,{headers:n,validateStatus:S});if(i.status===200||i.status===201){l(`SSETransport: POST success type=${e.type}`);return}if(l(`SSETransport: POST ${i.status} body=${u(i.data).slice(0,200)}`),i.status>=400&&i.status<500&&i.status!==429){l(`SSETransport: POST returned ${i.status} (client error), not retrying`),p(`warn`,`cli_sse_post_client_error`,{status:i.status});return}l(`SSETransport: POST returned ${i.status}, attempt ${t}/${A}`),p(`warn`,`cli_sse_post_retryable_error`,{status:i.status,attempt:t})}catch(e){l(`SSETransport: POST error: ${e.message}, attempt ${t}/${A}`),p(`warn`,`cli_sse_post_network_error`,{attempt:t})}if(t===A){l(`SSETransport: POST failed after ${A} attempts, continuing`),p(`warn`,`cli_sse_post_retries_exhausted`);return}await h(Math.min(j*2**(t-1),M))}}isConnectedStatus(){return this.state===`connected`}isClosedStatus(){return this.state===`closed`}setOnData(e){this.onData=e}setOnClose(e){this.onCloseCallback=e}setOnEvent(e){this.onEventCallback=e}close(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.clearLivenessTimer(),this.state=`closing`,this.abortController?.abort(),this.abortController=null}}}));export{F as n,C as r,P as t};
3
+ `+i:i;break}}(o.data||s)&&t.push(o)}return{frames:t,remaining:e.slice(n)}}function w(e){let t=e.pathname;return t.endsWith(`/stream`)&&(t=t.slice(0,-7)),`${e.protocol}//${e.host}${t}`}var T,E,D,O,k,A,j,M,N,P,F=e((()=>{i(),u(),x(),f(),s(),v(),m(),d(),g(),t(),T=1e3,E=3e4,D=6e5,O=45e3,k=new Set([401,403,404]),A=10,j=500,M=8e3,N={stream:!0},P=class{constructor(e,t={},r,i,a,o){n(this,`url`,void 0),n(this,`state`,`idle`),n(this,`onData`,void 0),n(this,`onCloseCallback`,void 0),n(this,`onEventCallback`,void 0),n(this,`headers`,void 0),n(this,`sessionId`,void 0),n(this,`refreshHeaders`,void 0),n(this,`getAuthHeaders`,void 0),n(this,`abortController`,null),n(this,`lastSequenceNum`,0),n(this,`seenSequenceNums`,new Set),n(this,`reconnectAttempts`,0),n(this,`reconnectStartTime`,null),n(this,`reconnectTimer`,null),n(this,`livenessTimer`,null),n(this,`lastActivityTime`,0),n(this,`postUrl`,void 0),n(this,`onLivenessTimeout`,()=>{this.livenessTimer=null,b(`SSE liveness timeout (${O}ms) lastSeqNum=${this.getLastSequenceNum()} state=${this.state}`),l(`SSETransport: Liveness timeout, reconnecting`,{level:`error`}),p(`error`,`cli_sse_liveness_timeout`),this.abortController?.abort(),this.handleConnectionError()}),this.url=e,this.headers=t,this.sessionId=r,this.refreshHeaders=i,this.getAuthHeaders=o??y,this.postUrl=w(e),a!==void 0&&a>0&&(this.lastSequenceNum=a),l(`SSETransport: SSE URL = ${e.href}`),l(`SSETransport: POST URL = ${this.postUrl}`),p(`info`,`cli_sse_transport_initialized`)}getLastSequenceNum(){return this.lastSequenceNum}async connect(){if(this.state!==`idle`&&this.state!==`reconnecting`){l(`SSETransport: Cannot connect, current state is ${this.state}`,{level:`error`}),p(`error`,`cli_sse_connect_failed`);return}this.state=`reconnecting`;let e=Date.now(),t=new URL(this.url.href);this.lastSequenceNum>0&&t.searchParams.set(`from_sequence_num`,String(this.lastSequenceNum));let n=this.getAuthHeaders(),r={...this.headers,...n,Accept:`text/event-stream`,"anthropic-version":`2023-06-01`,"User-Agent":_()};n.Cookie&&delete r.Authorization,this.lastSequenceNum>0&&(r[`Last-Event-ID`]=String(this.lastSequenceNum)),l(`SSETransport: Opening ${t.href}`),p(`info`,`cli_sse_connect_opening`),this.abortController=new AbortController;try{let n=await fetch(t.href,{headers:r,signal:this.abortController.signal});if(!n.ok){let e=k.has(n.status);if(l(`SSETransport: HTTP ${n.status}${e?` (permanent)`:``}`,{level:`error`}),p(`error`,`cli_sse_connect_http_error`,{status:n.status}),e){this.state=`closed`,this.onCloseCallback?.(n.status);return}this.handleConnectionError();return}if(!n.body){l(`SSETransport: No response body`),this.handleConnectionError();return}let i=Date.now()-e;l(`SSETransport: Connected`),p(`info`,`cli_sse_connect_connected`,{duration_ms:i}),this.state=`connected`,this.reconnectAttempts=0,this.reconnectStartTime=null,this.resetLivenessTimer(),await this.readStream(n.body)}catch(e){if(this.abortController?.signal.aborted)return;l(`SSETransport: Connection error: ${o(e)}`,{level:`error`}),p(`error`,`cli_sse_connect_error`),this.handleConnectionError()}}async readStream(e){let t=e.getReader(),n=new TextDecoder,r=``,i=1024*1024;try{for(;;){let{done:e,value:a}=await t.read();if(e)break;if(r+=n.decode(a,N),r.length>i){l(`SSETransport: Buffer exceeded ${i} bytes — dropping connection`,{level:`error`}),p(`error`,`cli_sse_buffer_overflow`);break}let{frames:o,remaining:s}=C(r);r=s;for(let e of o){if(this.resetLivenessTimer(),e.id){let t=parseInt(e.id,10);if(!isNaN(t)){if(this.seenSequenceNums.has(t))l(`SSETransport: DUPLICATE frame seq=${t} (lastSequenceNum=${this.lastSequenceNum}, seenCount=${this.seenSequenceNums.size})`,{level:`warn`}),p(`warn`,`cli_sse_duplicate_sequence`);else if(this.seenSequenceNums.add(t),this.seenSequenceNums.size>1e3){let e=this.lastSequenceNum-200;for(let t of this.seenSequenceNums)t<e&&this.seenSequenceNums.delete(t)}t>this.lastSequenceNum&&(this.lastSequenceNum=t)}}e.event&&e.data?this.handleSSEFrame(e.event,e.data):e.data&&(l(`SSETransport: Frame has data: but no event: field — dropped`,{level:`warn`}),p(`warn`,`cli_sse_frame_missing_event_field`))}}}catch(e){if(this.abortController?.signal.aborted)return;l(`SSETransport: Stream read error: ${o(e)}`,{level:`error`}),p(`error`,`cli_sse_stream_read_error`)}finally{t.releaseLock()}this.state!==`closing`&&this.state!==`closed`&&(l(`SSETransport: Stream ended, reconnecting`),this.handleConnectionError())}handleSSEFrame(e,t){if(e!==`client_event`){l(`SSETransport: Unexpected SSE event type '${e}' on worker stream`,{level:`warn`}),p(`warn`,`cli_sse_unexpected_event_type`,{event_type:e});return}let n;try{n=c(t)}catch(e){l(`SSETransport: Failed to parse client_event data: ${o(e)}`,{level:`error`});return}let r=n.payload;if(r&&typeof r==`object`&&`type`in r){let e=this.sessionId?` session=${this.sessionId}`:``;l(`SSETransport: Event seq=${n.sequence_num} event_id=${n.event_id} event_type=${n.event_type} payload_type=${String(r.type)}${e}`),p(`info`,`cli_sse_message_received`),this.onData?.(a(r)+`
4
+ `)}else l(`SSETransport: Ignoring client_event with no type in payload: event_id=${n.event_id}`);this.onEventCallback?.(n)}handleConnectionError(){if(b(`SSE handleConnectionError: state=${this.state} lastSeqNum=${this.getLastSequenceNum()} reconnectAttempts=${this.reconnectAttempts} msSinceLastActivity=${this.lastActivityTime>0?Date.now()-this.lastActivityTime:-1}`),this.clearLivenessTimer(),this.state===`closing`||this.state===`closed`)return;this.abortController?.abort(),this.abortController=null;let e=Date.now();this.reconnectStartTime||(this.reconnectStartTime=e);let t=e-this.reconnectStartTime;if(t<D){if(this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.refreshHeaders){let e=this.refreshHeaders();Object.assign(this.headers,e),l(`SSETransport: Refreshed headers for reconnect`)}this.state=`reconnecting`,this.reconnectAttempts++;let e=Math.min(T*2**(this.reconnectAttempts-1),E),n=Math.max(0,e+e*.25*(2*Math.random()-1));l(`SSETransport: Reconnecting in ${Math.round(n)}ms (attempt ${this.reconnectAttempts}, ${Math.round(t/1e3)}s elapsed)`),p(`error`,`cli_sse_reconnect_attempt`,{reconnectAttempts:this.reconnectAttempts}),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},n)}else l(`SSETransport: Reconnection time budget exhausted after ${Math.round(t/1e3)}s`,{level:`error`}),p(`error`,`cli_sse_reconnect_exhausted`,{reconnectAttempts:this.reconnectAttempts,elapsedMs:t}),this.state=`closed`,this.onCloseCallback?.()}resetLivenessTimer(){this.clearLivenessTimer(),this.livenessTimer=setTimeout(this.onLivenessTimeout,O)}clearLivenessTimer(){this.livenessTimer&&(clearTimeout(this.livenessTimer),this.livenessTimer=null)}async write(e){let t=this.getAuthHeaders();if(Object.keys(t).length===0){l(`SSETransport: No session token available for POST`),p(`warn`,`cli_sse_post_no_token`);return}let n={...t,"Content-Type":`application/json`,"anthropic-version":`2023-06-01`,"User-Agent":_()};l(`SSETransport: POST body keys=${Object.keys(e).join(`,`)}`);for(let t=1;t<=A;t++){try{let i=await r.post(this.postUrl,e,{headers:n,validateStatus:S});if(i.status===200||i.status===201){l(`SSETransport: POST success type=${e.type}`);return}if(l(`SSETransport: POST ${i.status} body=${a(i.data).slice(0,200)}`),i.status>=400&&i.status<500&&i.status!==429){l(`SSETransport: POST returned ${i.status} (client error), not retrying`),p(`warn`,`cli_sse_post_client_error`,{status:i.status});return}l(`SSETransport: POST returned ${i.status}, attempt ${t}/${A}`),p(`warn`,`cli_sse_post_retryable_error`,{status:i.status,attempt:t})}catch(e){l(`SSETransport: POST error: ${e.message}, attempt ${t}/${A}`),p(`warn`,`cli_sse_post_network_error`,{attempt:t})}if(t===A){l(`SSETransport: POST failed after ${A} attempts, continuing`),p(`warn`,`cli_sse_post_retries_exhausted`);return}await h(Math.min(j*2**(t-1),M))}}isConnectedStatus(){return this.state===`connected`}isClosedStatus(){return this.state===`closed`}setOnData(e){this.onData=e}setOnClose(e){this.onCloseCallback=e}setOnEvent(e){this.onEventCallback=e}close(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.clearLivenessTimer(),this.state=`closing`,this.abortController?.abort(),this.abortController=null}}}));export{F as n,C as r,P as t};
@@ -0,0 +1 @@
1
+ import{X_ as e,Z_ as t}from"./loadAgentsDir-BL93ulMm.js";t();export{e as clearSearchExtraToolsDescriptionCache};
@@ -0,0 +1,2 @@
1
+ import{a as e,n as t,o as n}from"./rolldown-runtime-DaDcL9Zw.js";import{d as r,l as i,o as a}from"./envUtils-BDhHQY0-.js";import{n as o,t as s}from"./figures-5ThXQEtq.js";import{$u as c,C as l,Cg as ee,Cr as te,Fp as ne,GC as u,P as re,Pp as d,Rb as ie,S as ae,Sb as f,Sg as p,Ub as oe,ZC as m,ao as h,bb as se,dd as g,ed as ce,hg as le,io as _,mg as v,or as ue,ro as y,td as de,ud as fe,v as pe,vb as me,wg as he,xb as ge,xg as b,zb as _e}from"./loadAgentsDir-BL93ulMm.js";import{D as x,Gt as ve,H as ye,I as S,P as C,T as w,U as be,Wt as xe,Xn as Se,a as Ce,di as we,fi as T,k as Te,n as Ee,ot as De,r as E,t as D,ui as O,x as k,y as Oe}from"./src-P_wYS_NJ2.js";import{t as A}from"./jsx-runtime-Bb4Xn-E0.js";import{Wt as ke,pt as Ae}from"./state-BemZdQIl.js";import{n as je,t as j}from"./cwd-Cfdf7z7s.js";import{Bt as Me,Ft as Ne,It as Pe,Mt as M,Pt as Fe,c as Ie,g as Le,n as Re,x as N,zt as ze}from"./settings-D4CpDv2y.js";import{a as Be,c as P,h as Ve,i as He,o as Ue,y as F}from"./config-aRiTrtCv.js";import{o as We,s as Ge}from"./log-Dauqle-Z.js";import{n as Ke,r as I}from"./analytics-DJobLaWP.js";import{G as qe,K as Je,Sr as Ye,_ as Xe,b as Ze,et as L,it as Qe,q as $e,rt as et,tt,x as nt,xr as rt}from"./model-Bgh_r4lg.js";import{r as it,t as at}from"./poorMode-B_xEvuEV.js";import{a as R,c as ot,d as st,i as ct,l as lt,n as ut,o as dt,r as z,s as ft,t as pt,u as B}from"./status-D6KlRJmR.js";import{n as V,t as H}from"./useExitOnCtrlCDWithKeybindings-DEEJhm_W.js";import{i as mt,n as ht,r as gt}from"./modalContext-CUThy6Ph.js";import{n as _t,t as vt}from"./ThemePicker-BT_NaRQC.js";import{i as yt,n as bt,r as xt,t as St}from"./extraUsage-BrKbpBK-.js";import{n as Ct,t as wt}from"./ClaudeMdExternalIncludesDialog-CSywJdVL.js";import{t as Tt}from"./SearchBox-C9vUA4IM.js";import{n as Et,t as U}from"./useSearchInput-gUDbkLaC.js";function Dt(){let e=Ae();return[{label:`Version`,value:`0.0.11`},{label:`Session name`,value:ue(e)??(0,K.jsx)(C,{dimColor:!0,children:`/rename to add a name`})},{label:`Session ID`,value:e},{label:`cwd`,value:j()},...ut(),...pt()]}function Ot({mainLoopModel:e,mcp:t,theme:n,context:r}){return[{label:`Model`,value:B(e)},...z(t.clients,r.options.ideInstallationStatus,n),...dt(t.clients,n),...ot(),...lt()]}async function kt(){return[...await ct(),...await R(),...await ft()]}function W({value:e}){return Array.isArray(e)?(0,K.jsx)(S,{flexWrap:`wrap`,columnGap:1,flexShrink:99,children:e.map((t,n)=>(0,K.jsxs)(C,{children:[t,n<e.length-1?`,`:``]},n))}):typeof e==`string`?(0,K.jsx)(C,{children:e}):e}function At({context:e,diagnosticsPromise:t}){let n=p(e=>e.mainLoopModel),r=p(e=>e.mcp),[i]=ye(),a=Mt.useMemo(()=>[Dt(),Ot({mainLoopModel:n,mcp:r,theme:i,context:e})],[n,r,i,e]),o=gt()?1:void 0;return(0,K.jsxs)(S,{flexDirection:`column`,flexGrow:o,children:[(0,K.jsxs)(S,{flexDirection:`column`,gap:1,flexGrow:o,children:[a.map((e,t)=>e.length>0&&(0,K.jsx)(S,{flexDirection:`column`,children:e.map(({label:e,value:t},n)=>(0,K.jsxs)(S,{flexDirection:`row`,gap:1,flexShrink:0,children:[e!==void 0&&(0,K.jsxs)(C,{bold:!0,children:[e,`:`]}),(0,K.jsx)(W,{value:t})]},n))},t)),(0,K.jsx)(G.Suspense,{fallback:null,children:(0,K.jsx)(jt,{promise:t})})]}),(0,K.jsx)(C,{dimColor:!0,children:(0,K.jsx)(d,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})})]})}function jt({promise:e}){let t=(0,G.use)(e);return t.length===0?null:(0,K.jsxs)(S,{flexDirection:`column`,paddingBottom:1,children:[(0,K.jsx)(C,{bold:!0,children:`System Diagnostics`}),t.map((e,t)=>(0,K.jsxs)(S,{flexDirection:`row`,gap:1,paddingX:1,children:[(0,K.jsx)(C,{color:`error`,children:s.warning}),typeof e==`string`?(0,K.jsx)(C,{wrap:`wrap`,children:e}):e]},t))]})}var Mt,G,K,Nt=t((()=>{o(),Mt=n(T(),1),G=n(T(),1),ke(),ht(),D(),b(),je(),te(),st(),ne(),K=A()}));function Pt({currentVersion:e,onChoice:t}){function n(e){t(e)}function r(){t(`cancel`)}return(0,Ft.jsxs)(Oe,{title:`Switch to Stable Channel`,onCancel:r,color:`permission`,hideBorder:!0,hideInputGuide:!0,children:[(0,Ft.jsxs)(C,{children:[`The stable channel may have an older version than what you're currently running (`,e,`).`]}),(0,Ft.jsx)(C,{dimColor:!0,children:`How would you like to handle this?`}),(0,Ft.jsx)(ce,{options:[{label:`Allow possible downgrade to stable version`,value:`downgrade`},{label:`Stay on current version (${e}) until stable catches up`,value:`stay`}],onChange:n})]})}var Ft,It=t((()=>{T(),D(),c(),Ft=A()}));function Lt(e){return Object.entries(e).map(([e,t])=>({label:t?.name??Bt,value:e,description:t?.description??Vt}))}function Rt({initialStyle:e,onComplete:t,onCancel:n,isStandaloneCommand:r}){let[i,a]=(0,zt.useState)([]),[o,s]=(0,zt.useState)(!0);(0,zt.useEffect)(()=>{_(j()).then(e=>{let t=Lt(e);a(t),s(!1)}).catch(()=>{let e=Lt(y);a(e),s(!1)})},[]);let c=(0,zt.useCallback)(e=>{t(e)},[t]);return(0,q.jsx)(Oe,{title:`Preferred output style`,onCancel:n,hideInputGuide:!r,hideBorder:!r,children:(0,q.jsxs)(S,{flexDirection:`column`,gap:1,children:[(0,q.jsx)(S,{marginTop:1,children:(0,q.jsx)(C,{dimColor:!0,children:`This changes how Claude Code communicates with you`})}),o?(0,q.jsx)(C,{dimColor:!0,children:`Loading output styles…`}):(0,q.jsx)(ce,{options:i,onChange:c,visibleOptionCount:10,defaultValue:e})]})})}var zt,q,Bt,Vt,Ht=t((()=>{T(),zt=n(T(),1),h(),D(),je(),de(),q=A(),Bt=`Default`,Vt=`Claude completes coding tasks efficiently and provides concise responses`}));function Ut({initialLanguage:e,onComplete:t,onCancel:n}){let[r,i]=(0,Wt.useState)(e),[a,o]=(0,Wt.useState)((e??``).length);xe(`confirm:no`,n,{context:`Settings`});function c(){let e=r?.trim();t(e||void 0)}return(0,J.jsxs)(S,{flexDirection:`column`,gap:1,children:[(0,J.jsx)(C,{children:`Enter your preferred response and voice language:`}),(0,J.jsxs)(S,{flexDirection:`row`,gap:1,children:[(0,J.jsx)(C,{children:s.pointer}),(0,J.jsx)(fe,{value:r??``,onChange:i,onSubmit:c,focus:!0,showCursor:!0,placeholder:`e.g., Japanese, 日本語, Español${s.ellipsis}`,columns:60,cursorOffset:a,onChangeCursorOffset:o})]}),(0,J.jsx)(C,{dimColor:!0,children:`Leave empty for default (English)`})]})}var Wt,J,Gt=t((()=>{o(),Wt=n(T(),1),D(),u(),g(),J=A()}));function Kt({onClose:t,context:n,setTabsHidden:a,onIsSearchModeChange:o,contentHeight:c}){let{headerFocused:l,focusHeader:te}=Ce(),ne=gt(),[,u]=ye(),f=be(),[m,h]=(0,X.useState)(P()),g=Y.useRef(P()),[_,v]=(0,X.useState)(Re()),ue=Y.useRef(Re()),[y,de]=(0,X.useState)(_?.outputStyle||`default`),fe=Y.useRef(y),[b,_e]=(0,X.useState)(_?.language),we=Y.useRef(b),[T,Ee]=(0,X.useState)(0),[E,D]=(0,X.useState)(0),[k,A]=(0,X.useState)(!1),ke=Se(),{rows:Ae}=De(),je=c??Math.min(Math.floor(Ae*.8),30),j=Math.max(5,je-10),M=p(e=>e.mainLoopModel),Le=p(e=>e.verbose),Ve=p(e=>e.thinkingEnabled),We=p(e=>et()?e.fastMode:!1);p(e=>e.promptSuggestionEnabled);let Ke=Ne(_?.permissions?.defaultMode??`default`),Xe=ae()||pe()===`enabled`,L=he(),[rt,R]=(0,X.useState)({}),ot=Y.useRef(Ve),[st]=(0,X.useState)(()=>Ie(`localSettings`)),[ct]=(0,X.useState)(()=>Ie(`userSettings`)),lt=Y.useRef(f),ut=ee(),[dt]=(0,X.useState)(()=>{let e=ut.getState();return{mainLoopModel:e.mainLoopModel,mainLoopModelForSession:e.mainLoopModelForSession,verbose:e.verbose,thinkingEnabled:e.thinkingEnabled,fastMode:e.fastMode,promptSuggestionEnabled:e.promptSuggestionEnabled,replBridgeEnabled:e.replBridgeEnabled,replBridgeOutboundOnly:e.replBridgeOutboundOnly,settings:e.settings}}),z=Y.useRef(!1),[ft,pt]=(0,X.useState)(!1),[B,V]=(0,X.useState)(null),{query:H,setQuery:mt,cursorOffset:ht}=Et({isActive:k&&B===null&&!l,onExit:()=>A(!1),onExitUp:te,passthroughCtrlKeys:[`c`,`d`]}),_t=k&&!l;Y.useEffect(()=>{o?.(_t)},[_t,o]);let yt=ie(n.options.mcpClients),St=!i(process.env.CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING),Ct=Y.use(se(!0)),Tt=ge(Ct),U=Be();function Dt(e){I(`tengu_config_model_changed`,{from_model:M,to_model:e}),L(t=>({...t,mainLoopModel:e,mainLoopModelForSession:null})),R(t=>{let n=nt(e)+(bt(e,!1,Ze())?` · Billed as extra usage`:``);if(`model`in t){let{model:e,...r}=t;return{...r,model:n}}return{...t,model:n}})}function Ot(e){F(t=>({...t,verbose:e})),h({...P(),verbose:e}),L(t=>({...t,verbose:e})),R(t=>{if(`verbose`in t){let{verbose:e,...n}=t;return n}return{...t,verbose:e}})}let kt=[{id:`autoCompactEnabled`,label:`Auto-compact`,value:m.autoCompactEnabled,type:`boolean`,onChange(e){F(t=>({...t,autoCompactEnabled:e})),h({...P(),autoCompactEnabled:e}),I(`tengu_auto_compact_setting_changed`,{enabled:e})}},{id:`spinnerTipsEnabled`,label:`Show tips`,value:_?.spinnerTipsEnabled??!0,type:`boolean`,onChange(e){N(`localSettings`,{spinnerTipsEnabled:e}),v(t=>({...t,spinnerTipsEnabled:e})),I(`tengu_tips_setting_changed`,{enabled:e})}},{id:`cacheWarningEnabled`,label:`Cache warnings`,value:_?.cacheWarningEnabled??!0,type:`boolean`,onChange(e){N(`localSettings`,{cacheWarningEnabled:e}),v(t=>({...t,cacheWarningEnabled:e})),I(`tengu_cache_warning_setting_changed`,{enabled:e})}},{id:`prefersReducedMotion`,label:`Reduce motion`,value:_?.prefersReducedMotion??!1,type:`boolean`,onChange(e){N(`localSettings`,{prefersReducedMotion:e}),v(t=>({...t,prefersReducedMotion:e})),L(t=>({...t,settings:{...t.settings,prefersReducedMotion:e}})),I(`tengu_reduce_motion_setting_changed`,{enabled:e})}},{id:`thinkingEnabled`,label:`Thinking mode`,value:Ve??!0,type:`boolean`,onChange(e){L(t=>({...t,thinkingEnabled:e})),N(`userSettings`,{alwaysThinkingEnabled:e?void 0:!1}),I(`tengu_thinking_toggled`,{enabled:e})}},...et()&&tt()?[{id:`fastMode`,label:`Fast mode (${qe} only)`,value:!!We,type:`boolean`,onChange(e){Je(),N(`userSettings`,{fastMode:e?!0:void 0}),e?(L(e=>({...e,mainLoopModel:$e(),mainLoopModelForSession:null,fastMode:!0})),R(e=>({...e,model:$e(),"Fast mode":`ON`}))):(L(e=>({...e,fastMode:!1})),R(e=>({...e,"Fast mode":`OFF`})))}}]:[],{id:`poorMode`,label:`Poor mode (save tokens)`,value:(at(),e(it)).isPoorModeActive(),type:`boolean`,onChange(t){(at(),e(it)).setPoorMode(t),L(e=>({...e,promptSuggestionEnabled:!t}))}},...St?[{id:`fileCheckpointingEnabled`,label:`Rewind code (checkpoints)`,value:m.fileCheckpointingEnabled,type:`boolean`,onChange(e){F(t=>({...t,fileCheckpointingEnabled:e})),h({...P(),fileCheckpointingEnabled:e}),I(`tengu_file_history_snapshots_setting_changed`,{enabled:e})}}]:[],{id:`verbose`,label:`Verbose output`,value:Le,type:`boolean`,onChange:Ot},{id:`terminalProgressBarEnabled`,label:`Terminal progress bar`,value:m.terminalProgressBarEnabled,type:`boolean`,onChange(e){F(t=>({...t,terminalProgressBarEnabled:e})),h({...P(),terminalProgressBarEnabled:e}),I(`tengu_terminal_progress_bar_setting_changed`,{enabled:e})}},{id:`showTurnDuration`,label:`Show turn duration`,value:m.showTurnDuration,type:`boolean`,onChange(e){F(t=>({...t,showTurnDuration:e})),h({...P(),showTurnDuration:e}),I(`tengu_show_turn_duration_setting_changed`,{enabled:e})}},{id:`defaultPermissionMode`,label:`Default permission mode`,value:Ke,options:(()=>{let e=[`default`,`plan`];return[...e,...Me.filter(t=>!e.includes(t))]})(),type:`enum`,onChange(e){let t=Ne(e),n=t===`auto`?t:Fe(t)?ze(t):t,r=N(`userSettings`,{permissions:{..._?.permissions,defaultMode:n}});if(r.error){Ge(r.error);return}v(e=>({...e,permissions:{...e?.permissions,defaultMode:n}})),R(t=>({...t,defaultPermissionMode:e})),I(`tengu_config_changed`,{setting:`defaultPermissionMode`,value:e})}},...Xe?[{id:`useAutoModeDuringPlan`,label:`Use auto mode during plan`,value:_?.useAutoModeDuringPlan??!0,type:`boolean`,onChange(e){N(`userSettings`,{useAutoModeDuringPlan:e}),v(t=>({...t,useAutoModeDuringPlan:e})),L(e=>{let t=re(e.toolPermissionContext);return t===e.toolPermissionContext?e:{...e,toolPermissionContext:t}}),R(t=>({...t,"Use auto mode during plan":e}))}}]:[],{id:`respectGitignore`,label:`Respect .gitignore in file picker`,value:m.respectGitignore,type:`boolean`,onChange(e){F(t=>({...t,respectGitignore:e})),h({...P(),respectGitignore:e}),I(`tengu_respect_gitignore_setting_changed`,{enabled:e})}},...le()?[{id:`copyOnSelect`,label:`Copy on select`,value:m.copyOnSelect??!0,type:`boolean`,onChange(e){F(t=>({...t,copyOnSelect:e})),h({...P(),copyOnSelect:e}),I(`tengu_config_changed`,{setting:`copyOnSelect`,value:String(e)})}}]:[],U?{id:`autoUpdatesChannel`,label:`Auto-update channel`,value:`disabled`,type:`managedEnum`,onChange(){}}:{id:`autoUpdatesChannel`,label:`Auto-update channel`,value:_?.autoUpdatesChannel??`latest`,type:`managedEnum`,onChange(){}},{id:`theme`,label:`Theme`,value:f,type:`managedEnum`,onChange:u},{id:`notifChannel`,label:`Notifications`,value:m.preferredNotifChannel,options:[`auto`,`iterm2`,`terminal_bell`,`iterm2_with_bell`,`kitty`,`ghostty`,`notifications_disabled`],type:`enum`,onChange(e){F(t=>({...t,preferredNotifChannel:e})),h({...P(),preferredNotifChannel:e})}},{id:`outputStyle`,label:`Output style`,value:y,type:`managedEnum`,onChange:()=>{}},{id:`language`,label:`Language`,value:b??`Default (English)`,type:`managedEnum`,onChange:()=>{}},{id:`editorMode`,label:`Editor mode`,value:m.editorMode===`emacs`?`normal`:m.editorMode||`normal`,options:[`normal`,`vim`],type:`enum`,onChange(e){F(t=>({...t,editorMode:e})),h({...P(),editorMode:e}),I(`tengu_editor_mode_changed`,{mode:e,source:`config_panel`})}},{id:`prStatusFooterEnabled`,label:`Show PR status footer`,value:m.prStatusFooterEnabled??!0,type:`boolean`,onChange(e){F(t=>t.prStatusFooterEnabled===e?t:{...t,prStatusFooterEnabled:e}),h({...P(),prStatusFooterEnabled:e}),I(`tengu_pr_status_footer_setting_changed`,{enabled:e})}},{id:`model`,label:`Model`,value:M===null?`Default (recommended)`:M,type:`managedEnum`,onChange:Dt},...yt?[{id:`diffTool`,label:`Diff tool`,value:m.diffTool??`auto`,options:[`terminal`,`auto`],type:`enum`,onChange(e){F(t=>({...t,diffTool:e})),h({...P(),diffTool:e}),I(`tengu_diff_tool_changed`,{tool:e,source:`config_panel`})}}]:[],...oe()?[]:[{id:`autoConnectIde`,label:`Auto-connect to IDE (external terminal)`,value:m.autoConnectIde??!1,type:`boolean`,onChange(e){F(t=>({...t,autoConnectIde:e})),h({...P(),autoConnectIde:e}),I(`tengu_auto_connect_ide_changed`,{enabled:e,source:`config_panel`})}}],...oe()?[{id:`autoInstallIdeExtension`,label:`Auto-install IDE extension`,value:m.autoInstallIdeExtension??!0,type:`boolean`,onChange(e){F(t=>({...t,autoInstallIdeExtension:e})),h({...P(),autoInstallIdeExtension:e}),I(`tengu_auto_install_ide_extension_changed`,{enabled:e,source:`config_panel`})}}]:[],...Tt?[{id:`showExternalIncludesDialog`,label:`External CLAUDE.md includes`,value:Ue().hasClaudeMdExternalIncludesApproved?`true`:`false`,type:`managedEnum`,onChange(){}}]:[],...process.env.ANTHROPIC_API_KEY&&!r()?[{id:`apiKey`,label:(0,Z.jsxs)(C,{children:[`Use custom API key: `,(0,Z.jsx)(C,{bold:!0,children:Ye(process.env.ANTHROPIC_API_KEY)})]}),searchText:`Use custom API key`,value:!!(process.env.ANTHROPIC_API_KEY&&m.customApiKeyResponses?.approved?.includes(Ye(process.env.ANTHROPIC_API_KEY))),type:`boolean`,onChange(e){F(t=>{let n={...t};if(n.customApiKeyResponses||(n.customApiKeyResponses={approved:[],rejected:[]}),n.customApiKeyResponses.approved||(n.customApiKeyResponses={...n.customApiKeyResponses,approved:[]}),n.customApiKeyResponses.rejected||(n.customApiKeyResponses={...n.customApiKeyResponses,rejected:[]}),process.env.ANTHROPIC_API_KEY){let t=Ye(process.env.ANTHROPIC_API_KEY);e?n.customApiKeyResponses={...n.customApiKeyResponses,approved:[...(n.customApiKeyResponses.approved??[]).filter(e=>e!==t),t],rejected:(n.customApiKeyResponses.rejected??[]).filter(e=>e!==t)}:n.customApiKeyResponses={...n.customApiKeyResponses,approved:(n.customApiKeyResponses.approved??[]).filter(e=>e!==t),rejected:[...(n.customApiKeyResponses.rejected??[]).filter(e=>e!==t),t]}}return n}),h(P())}}]:[]],W=Y.useMemo(()=>{if(!H)return kt;let e=H.toLowerCase();return kt.filter(t=>t.id.toLowerCase().includes(e)?!0:(`searchText`in t?t.searchText:t.label).toLowerCase().includes(e))},[kt,H]);Y.useEffect(()=>{if(T>=W.length){let e=Math.max(0,W.length-1);Ee(e),D(Math.max(0,e-j+1));return}D(e=>T<e?T:T>=e+j?T-j+1:e)},[W.length,T,j]);let At=(0,X.useCallback)(e=>{D(t=>e<t?e:e>=t+j?e-j+1:t)},[j]),jt=(0,X.useCallback)(()=>{if(B!==null)return;let e=Object.entries(rt).map(([e,t])=>(I(`tengu_config_changed`,{key:e,value:t}),`Set ${e} to ${O.bold(t)}`)),n=r()?void 0:process.env.ANTHROPIC_API_KEY,i=!!(n&&g.current.customApiKeyResponses?.approved?.includes(Ye(n))),a=!!(n&&m.customApiKeyResponses?.approved?.includes(Ye(n)));if(i!==a&&(e.push(`${a?`Enabled`:`Disabled`} custom API key`),I(`tengu_config_changed`,{key:`env.ANTHROPIC_API_KEY`,value:a})),m.theme!==g.current.theme&&e.push(`Set theme to ${O.bold(m.theme)}`),m.preferredNotifChannel!==g.current.preferredNotifChannel&&e.push(`Set notifications to ${O.bold(m.preferredNotifChannel)}`),y!==fe.current&&e.push(`Set output style to ${O.bold(y)}`),b!==we.current&&e.push(`Set response language to ${O.bold(b??`Default (English)`)}`),m.editorMode!==g.current.editorMode&&e.push(`Set editor mode to ${O.bold(m.editorMode||`emacs`)}`),m.diffTool!==g.current.diffTool&&e.push(`Set diff tool to ${O.bold(m.diffTool)}`),m.autoConnectIde!==g.current.autoConnectIde&&e.push(`${m.autoConnectIde?`Enabled`:`Disabled`} auto-connect to IDE`),m.autoInstallIdeExtension!==g.current.autoInstallIdeExtension&&e.push(`${m.autoInstallIdeExtension?`Enabled`:`Disabled`} auto-install IDE extension`),m.autoCompactEnabled!==g.current.autoCompactEnabled&&e.push(`${m.autoCompactEnabled?`Enabled`:`Disabled`} auto-compact`),m.respectGitignore!==g.current.respectGitignore&&e.push(`${m.respectGitignore?`Enabled`:`Disabled`} respect .gitignore in file picker`),m.copyOnSelect!==g.current.copyOnSelect&&e.push(`${m.copyOnSelect?`Enabled`:`Disabled`} copy on select`),m.terminalProgressBarEnabled!==g.current.terminalProgressBarEnabled&&e.push(`${m.terminalProgressBarEnabled?`Enabled`:`Disabled`} terminal progress bar`),m.showStatusInTerminalTab!==g.current.showStatusInTerminalTab&&e.push(`${m.showStatusInTerminalTab?`Enabled`:`Disabled`} terminal tab status`),m.showTurnDuration!==g.current.showTurnDuration&&e.push(`${m.showTurnDuration?`Enabled`:`Disabled`} turn duration`),m.remoteControlAtStartup!==g.current.remoteControlAtStartup){let t=m.remoteControlAtStartup===void 0?`Reset Remote Control to default`:`${m.remoteControlAtStartup?`Enabled`:`Disabled`} Remote Control for all sessions`;e.push(t)}_?.autoUpdatesChannel!==ue.current?.autoUpdatesChannel&&e.push(`Set auto-update channel to ${O.bold(_?.autoUpdatesChannel??`latest`)}`),e.length>0?t(e.join(`
2
+ `)):t(`Config dialog dismissed`,{display:`system`})},[B,rt,m,M,y,b,_?.autoUpdatesChannel,et()?_?.fastMode:void 0,t]),Mt=(0,X.useCallback)(()=>{f!==lt.current&&u(lt.current),F(()=>g.current);let e=st;N(`localSettings`,{spinnerTipsEnabled:e?.spinnerTipsEnabled,prefersReducedMotion:e?.prefersReducedMotion,defaultView:e?.defaultView,outputStyle:e?.outputStyle});let t=ct;N(`userSettings`,{alwaysThinkingEnabled:t?.alwaysThinkingEnabled,fastMode:t?.fastMode,promptSuggestionEnabled:t?.promptSuggestionEnabled,autoUpdatesChannel:t?.autoUpdatesChannel,minimumVersion:t?.minimumVersion,language:t?.language,useAutoModeDuringPlan:t?.useAutoModeDuringPlan,syntaxHighlightingDisabled:t?.syntaxHighlightingDisabled,permissions:t?.permissions===void 0?void 0:{...t.permissions,defaultMode:t.permissions.defaultMode}});let n=dt;L(e=>({...e,mainLoopModel:n.mainLoopModel,mainLoopModelForSession:n.mainLoopModelForSession,verbose:n.verbose,thinkingEnabled:n.thinkingEnabled,fastMode:n.fastMode,promptSuggestionEnabled:n.promptSuggestionEnabled,replBridgeEnabled:n.replBridgeEnabled,replBridgeOutboundOnly:n.replBridgeOutboundOnly,settings:n.settings,toolPermissionContext:re(e.toolPermissionContext)}))},[f,u,st,ct,dt,L]);xe(`confirm:no`,(0,X.useCallback)(()=>{B===null&&(z.current&&Mt(),t(`Config dialog dismissed`,{display:`system`}))},[B,Mt,t]),{context:`Settings`,isActive:B===null&&!k&&!l}),xe(`settings:close`,jt,{context:`Settings`,isActive:B===null&&!k&&!l});let G=(0,X.useCallback)(()=>{let e=W[T];if(!(!e||!e.onChange)){if(e.type===`boolean`){z.current=!0,e.onChange(!e.value),e.id===`thinkingEnabled`&&(!e.value===ot.current?pt(!1):n.messages.some(e=>e.type===`assistant`)&&pt(!0));return}if(e.id===`theme`||e.id===`model`||e.id===`showExternalIncludesDialog`||e.id===`outputStyle`||e.id===`language`)switch(e.id){case`theme`:V(`Theme`),a(!0);return;case`model`:V(`Model`),a(!0);return;case`showExternalIncludesDialog`:V(`ExternalIncludes`),a(!0);return;case`outputStyle`:V(`OutputStyle`),a(!0);return;case`language`:V(`Language`),a(!0);return}if(e.id===`autoUpdatesChannel`){if(U){V(`EnableAutoUpdates`),a(!0);return}(_?.autoUpdatesChannel??`latest`)===`latest`?(V(`ChannelDowngrade`),a(!0)):(z.current=!0,N(`userSettings`,{autoUpdatesChannel:`latest`,minimumVersion:void 0}),v(e=>({...e,autoUpdatesChannel:`latest`,minimumVersion:void 0})),I(`tengu_autoupdate_channel_changed`,{channel:`latest`}));return}if(e.type===`enum`){z.current=!0;let t=(e.options.indexOf(e.value)+1)%e.options.length;e.onChange(e.options[t]);return}}},[U,W,T,_?.autoUpdatesChannel,a]),K=e=>{pt(!1);let t=Math.max(0,Math.min(W.length-1,T+e));Ee(t),At(t)};return ve({"select:previous":()=>{T===0?(pt(!1),A(!0),D(0)):K(-1)},"select:next":()=>K(1),"scroll:lineUp":()=>K(-1),"scroll:lineDown":()=>K(1),"select:accept":G,"select:previousValue":()=>G(),"select:nextValue":()=>G(),"settings:search":()=>{A(!0),mt(``)}},{context:`Settings`,isActive:B===null&&!k&&!l}),(0,Z.jsx)(S,{flexDirection:`column`,width:`100%`,tabIndex:0,autoFocus:!0,onKeyDown:(0,X.useCallback)(e=>{if(B===null&&!l){if(k){if(e.key===`escape`){e.preventDefault(),H.length>0?mt(``):A(!1);return}(e.key===`return`||e.key===`down`||e.key===`wheeldown`)&&(e.preventDefault(),A(!1),Ee(0),D(0));return}if(e.key===`left`||e.key===`right`||e.key===`tab`){e.preventDefault(),G();return}e.ctrl||e.meta||e.key===`j`||e.key===`k`||e.key===`/`||e.key.length===1&&e.key!==` `&&(e.preventDefault(),A(!0),mt(e.key))}},[B,l,k,H,mt,G]),children:B===`Theme`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(vt,{onThemeSelect:e=>{z.current=!0,u(e),V(null),a(!1)},onCancel:()=>{V(null),a(!1)},hideEscToCancel:!0,skipExitHandling:!0}),(0,Z.jsx)(S,{children:(0,Z.jsx)(C,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(w,{children:[(0,Z.jsx)(x,{shortcut:`Enter`,action:`select`}),(0,Z.jsx)(d,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})})]}):B===`Model`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(xt,{initial:M,onSelect:e=>{z.current=!0,Dt(e),V(null),a(!1)},onCancel:()=>{V(null),a(!1)},showFastModeNotice:et()?We&&Qe(M)&&tt():!1}),(0,Z.jsx)(C,{dimColor:!0,children:(0,Z.jsxs)(w,{children:[(0,Z.jsx)(x,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(d,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]}):B===`ExternalIncludes`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(wt,{onDone:()=>{V(null),a(!1)},externalIncludes:me(Ct)}),(0,Z.jsx)(C,{dimColor:!0,children:(0,Z.jsxs)(w,{children:[(0,Z.jsx)(x,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(d,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`disable external includes`})]})})]}):B===`OutputStyle`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Rt,{initialStyle:y,onComplete:e=>{z.current=!0,de(e??`default`),V(null),a(!1),N(`localSettings`,{outputStyle:e}),I(`tengu_output_style_changed`,{style:e??`default`,source:`config_panel`,settings_source:`localSettings`})},onCancel:()=>{V(null),a(!1)}}),(0,Z.jsx)(C,{dimColor:!0,children:(0,Z.jsxs)(w,{children:[(0,Z.jsx)(x,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(d,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]}):B===`Language`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Ut,{initialLanguage:b,onComplete:e=>{z.current=!0,_e(e),V(null),a(!1),N(`userSettings`,{language:e}),I(`tengu_language_changed`,{language:e??`default`,source:`config_panel`})},onCancel:()=>{V(null),a(!1)}}),(0,Z.jsx)(C,{dimColor:!0,children:(0,Z.jsxs)(w,{children:[(0,Z.jsx)(x,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(d,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]})})]}):B===`EnableAutoUpdates`?(0,Z.jsx)(Oe,{title:`Enable Auto-Updates`,onCancel:()=>{V(null),a(!1)},hideBorder:!0,hideInputGuide:!0,children:U?.type===`config`?(0,Z.jsx)(ce,{options:[{label:`Enable with latest channel`,value:`latest`},{label:`Enable with stable channel`,value:`stable`}],onChange:e=>{z.current=!0,V(null),a(!1),F(e=>({...e,autoUpdates:!0})),h({...P(),autoUpdates:!0}),N(`userSettings`,{autoUpdatesChannel:e,minimumVersion:void 0}),v(t=>({...t,autoUpdatesChannel:e,minimumVersion:void 0})),I(`tengu_autoupdate_enabled`,{channel:e})}}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(C,{children:U?.type===`env`?`Auto-updates are controlled by an environment variable and cannot be changed here.`:`Auto-updates are disabled in development builds.`}),U?.type===`env`&&(0,Z.jsxs)(C,{dimColor:!0,children:[`Unset `,U.envVar,` to re-enable auto-updates.`]})]})}):B===`ChannelDowngrade`?(0,Z.jsx)(Pt,{currentVersion:`0.0.11`,onChoice:e=>{if(V(null),a(!1),e===`cancel`)return;z.current=!0;let t={autoUpdatesChannel:`stable`};e===`stay`&&(t.minimumVersion=`0.0.11`),N(`userSettings`,t),v(e=>({...e,...t})),I(`tengu_autoupdate_channel_changed`,{channel:`stable`,minimum_version_set:e===`stay`})}}):(0,Z.jsxs)(S,{flexDirection:`column`,gap:1,marginY:ne?void 0:1,children:[(0,Z.jsx)(Te,{query:H,isFocused:k&&!l,isTerminalFocused:ke,cursorOffset:ht,placeholder:`Search settings…`}),(0,Z.jsx)(S,{flexDirection:`column`,children:W.length===0?(0,Z.jsxs)(C,{dimColor:!0,italic:!0,children:[`No settings match "`,H,`"`]}):(0,Z.jsxs)(Z.Fragment,{children:[E>0&&(0,Z.jsxs)(C,{dimColor:!0,children:[s.arrowUp,` `,E,` more above`]}),W.slice(E,E+j).map((e,t)=>{let n=E+t===T&&!l&&!k;return(0,Z.jsx)(Y.Fragment,{children:(0,Z.jsxs)(S,{width:`100%`,children:[(0,Z.jsx)(S,{width:44,children:(0,Z.jsxs)(C,{color:n?`suggestion`:void 0,children:[n?s.pointer:` `,` `,e.label]})}),(0,Z.jsx)(S,{flexGrow:1,children:e.type===`boolean`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(C,{color:n?`suggestion`:void 0,children:e.value.toString()}),ft&&e.id===`thinkingEnabled`&&(0,Z.jsxs)(C,{color:`warning`,children:[` `,`Changing thinking mode mid-conversation will increase latency and may reduce quality.`]})]}):e.id===`theme`?(0,Z.jsx)(C,{color:n?`suggestion`:void 0,children:Jt[e.value.toString()]??e.value.toString()}):e.id===`notifChannel`?(0,Z.jsx)(C,{color:n?`suggestion`:void 0,children:(0,Z.jsx)(qt,{value:e.value.toString()})}):e.id===`defaultPermissionMode`?(0,Z.jsx)(C,{color:n?`suggestion`:void 0,children:Pe(e.value)}):e.id===`autoUpdatesChannel`&&U?(0,Z.jsxs)(S,{flexDirection:`column`,children:[(0,Z.jsx)(C,{color:n?`suggestion`:void 0,children:`disabled`}),(0,Z.jsxs)(C,{dimColor:!0,children:[`(`,He(U),`)`]})]}):(0,Z.jsx)(C,{color:n?`suggestion`:void 0,children:e.value.toString()})})]})},e.id)}),E+j<W.length&&(0,Z.jsxs)(C,{dimColor:!0,children:[s.arrowDown,` `,W.length-E-j,` more below`]})]})}),l?(0,Z.jsx)(C,{dimColor:!0,children:(0,Z.jsxs)(w,{children:[(0,Z.jsx)(x,{shortcut:`←/→ tab`,action:`switch`}),(0,Z.jsx)(x,{shortcut:`↓`,action:`return`}),(0,Z.jsx)(d,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`close`})]})}):k?(0,Z.jsx)(C,{dimColor:!0,children:(0,Z.jsxs)(w,{children:[(0,Z.jsx)(C,{children:`Type to filter`}),(0,Z.jsx)(x,{shortcut:`Enter/↓`,action:`select`}),(0,Z.jsx)(x,{shortcut:`↑`,action:`tabs`}),(0,Z.jsx)(d,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`clear`})]})}):(0,Z.jsx)(C,{dimColor:!0,children:(0,Z.jsxs)(w,{children:[(0,Z.jsx)(d,{action:`select:accept`,context:`Settings`,fallback:`Space`,description:`change`}),(0,Z.jsx)(d,{action:`settings:close`,context:`Settings`,fallback:`Enter`,description:`save`}),(0,Z.jsx)(d,{action:`settings:search`,context:`Settings`,fallback:`/`,description:`search`}),(0,Z.jsx)(d,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]})})]})})}function qt({value:e}){switch(e){case`auto`:return`Auto`;case`iterm2`:return(0,Z.jsxs)(C,{children:[`iTerm2 `,(0,Z.jsx)(C,{dimColor:!0,children:`(OSC 9)`})]});case`terminal_bell`:return(0,Z.jsxs)(C,{children:[`Terminal Bell `,(0,Z.jsx)(C,{dimColor:!0,children:`(\\a)`})]});case`kitty`:return(0,Z.jsxs)(C,{children:[`Kitty `,(0,Z.jsx)(C,{dimColor:!0,children:`(OSC 99)`})]});case`ghostty`:return(0,Z.jsxs)(C,{children:[`Ghostty `,(0,Z.jsx)(C,{dimColor:!0,children:`(OSC 777)`})]});case`iterm2_with_bell`:return`iTerm2 w/ Bell`;case`notifications_disabled`:return`Disabled`;default:return e}}var Y,X,Z,Jt,Yt=t((()=>{D(),Y=n(T(),1),X=n(T(),1),u(),o(),Ve(),rt(),we(),M(),l(),We(),Ke(),_t(),b(),yt(),Xe(),St(),Ct(),It(),c(),Ht(),Gt(),f(),ne(),ht(),Tt(),_e(),Le(),h(),a(),U(),m(),L(),v(),Z=A(),Jt={auto:`Auto (match terminal)`,dark:`Dark mode`,light:`Light mode`,"dark-daltonized":`Dark mode (colorblind-friendly)`,"light-daltonized":`Light mode (colorblind-friendly)`,"dark-ansi":`Dark mode (ANSI colors only)`,"light-ansi":`Light mode (ANSI colors only)`}}));function Xt({onClose:e,context:t,defaultTab:n}){let[r,i]=(0,Q.useState)(n),[a,o]=(0,Q.useState)(!1),[s,c]=(0,Q.useState)(!1),l=gt(),{rows:ee}=mt(De()),te=l?ee+1:Math.max(15,Math.min(Math.floor(ee*.8),30)),[ne]=(0,Q.useState)(()=>kt().catch(()=>[]));return V(),xe(`confirm:no`,()=>{a||e(`Status dialog dismissed`,{display:`system`})},{context:`Settings`,isActive:!a&&!(r===`Config`&&s)}),(0,$.jsx)(k,{color:`permission`,children:(0,$.jsx)(E,{color:`permission`,selectedTab:r,onTabChange:i,hidden:a,initialHeaderFocused:n!==`Config`,contentHeight:a||l?void 0:te,children:[(0,$.jsx)(Ee,{title:`Status`,children:(0,$.jsx)(At,{context:t,diagnosticsPromise:ne})},`status`),(0,$.jsx)(Ee,{title:`Config`,children:(0,$.jsx)(Q.Suspense,{fallback:null,children:(0,$.jsx)(Kt,{context:t,onClose:e,setTabsHidden:o,onIsSearchModeChange:c,contentHeight:te})})},`config`)]})})}var Q,$,Zt=t((()=>{T(),Q=n(T(),1),u(),H(),m(),ht(),D(),Nt(),Yt(),$=A()}));export{Zt as n,Xt as t};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./figures-5ThXQEtq.js";import{Cg as r,Sg as i,_u as a,fu as o,hu as s,pu as c}from"./loadAgentsDir-C7lOqvfh.js";import{I as l,P as u,fi as d,mt as f,t as p}from"./src-P_wYS_NJ2.js";import{t as m}from"./jsx-runtime-Bb4Xn-E0.js";t();var h=e(d(),1);p(),r(),c();var g=m(),_=[`◐`,`◓`,`◑`,`◒`],v=[{key:`validating`,label:`Validating session`},{key:`fetching_logs`,label:`Fetching session logs`},{key:`fetching_branch`,label:`Getting branch info`},{key:`checking_out`,label:`Checking out branch`}];function y({currentStep:e,sessionId:t}){let[r,i]=f(100),a=Math.floor(i/100)%_.length,o=v.findIndex(t=>t.key===e);return(0,g.jsxs)(l,{ref:r,flexDirection:`column`,paddingX:1,paddingY:1,children:[(0,g.jsx)(l,{marginBottom:1,children:(0,g.jsxs)(u,{bold:!0,color:`claude`,children:[_[a],` Teleporting session…`]})}),t&&(0,g.jsx)(l,{marginBottom:1,children:(0,g.jsx)(u,{dimColor:!0,children:t})}),(0,g.jsx)(l,{flexDirection:`column`,marginLeft:2,children:v.map((e,t)=>{let r=t<o,i=t===o,s=t>o,c,d;return r?(c=n.tick,d=`green`):i?(c=_[a],d=`claude`):(c=n.circle,d=void 0),(0,g.jsxs)(l,{flexDirection:`row`,children:[(0,g.jsx)(l,{width:2,children:(0,g.jsx)(u,{color:d,dimColor:s,children:c})}),(0,g.jsx)(u,{dimColor:s,bold:i,children:e.label})]},e.key)})})]})}async function b(e,t){let n=()=>{};function r(){let[e,r]=(0,h.useState)(`validating`);return n=r,(0,g.jsx)(y,{currentStep:e,sessionId:t})}e.render((0,g.jsx)(i,{children:(0,g.jsx)(r,{})}));let c=await a(t,n);n(`checking_out`);let{branchName:l,branchError:u}=await o(c.branch);return{messages:s(c.log,u),branchName:l}}export{b as teleportWithProgress};
1
+ import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./figures-5ThXQEtq.js";import{bg as r,du as i,hu as a,pu as o,uu as s,xg as c}from"./loadAgentsDir-BL93ulMm.js";import{I as l,P as u,fi as d,mt as f,t as p}from"./src-P_wYS_NJ2.js";import{t as m}from"./jsx-runtime-Bb4Xn-E0.js";t();var h=e(d(),1);p(),c(),i();var g=m(),_=[`◐`,`◓`,`◑`,`◒`],v=[{key:`validating`,label:`Validating session`},{key:`fetching_logs`,label:`Fetching session logs`},{key:`fetching_branch`,label:`Getting branch info`},{key:`checking_out`,label:`Checking out branch`}];function y({currentStep:e,sessionId:t}){let[r,i]=f(100),a=Math.floor(i/100)%_.length,o=v.findIndex(t=>t.key===e);return(0,g.jsxs)(l,{ref:r,flexDirection:`column`,paddingX:1,paddingY:1,children:[(0,g.jsx)(l,{marginBottom:1,children:(0,g.jsxs)(u,{bold:!0,color:`claude`,children:[_[a],` Teleporting session…`]})}),t&&(0,g.jsx)(l,{marginBottom:1,children:(0,g.jsx)(u,{dimColor:!0,children:t})}),(0,g.jsx)(l,{flexDirection:`column`,marginLeft:2,children:v.map((e,t)=>{let r=t<o,i=t===o,s=t>o,c,d;return r?(c=n.tick,d=`green`):i?(c=_[a],d=`claude`):(c=n.circle,d=void 0),(0,g.jsxs)(l,{flexDirection:`row`,children:[(0,g.jsx)(l,{width:2,children:(0,g.jsx)(u,{color:d,dimColor:s,children:c})}),(0,g.jsx)(u,{dimColor:s,bold:i,children:e.label})]},e.key)})})]})}async function b(e,t){let n=()=>{};function i(){let[e,r]=(0,h.useState)(`validating`);return n=r,(0,g.jsx)(y,{currentStep:e,sessionId:t})}e.render((0,g.jsx)(r,{children:(0,g.jsx)(i,{})}));let c=await a(t,n);n(`checking_out`);let{branchName:l,branchError:u}=await s(c.branch);return{messages:o(c.log,u),branchName:l}}export{b as teleportWithProgress};
@@ -0,0 +1 @@
1
+ import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{$u as t,Iu as n,Pu as r,ed as i}from"./loadAgentsDir-BL93ulMm.js";import{I as a,P as o,fi as s,t as c,y as l}from"./src-P_wYS_NJ2.js";import{t as u}from"./jsx-runtime-Bb4Xn-E0.js";import{wn as d,xn as f}from"./settings-D4CpDv2y.js";import{a as p,r as m}from"./githubRepoPathMapping-CK56bUDe.js";var h=e(s(),1);c(),d(),t(),n();var g=u();function _({targetRepo:e,initialPaths:t,onSelectPath:n,onCancel:s}){let[c,u]=(0,h.useState)(t),[d,_]=(0,h.useState)(null),[v,y]=(0,h.useState)(!1),b=(0,h.useCallback)(async t=>{if(t===`cancel`){s();return}if(y(!0),_(null),await p(t,e)){n(t);return}m(e,t);let r=c.filter(e=>e!==t);u(r),y(!1),_(`${f(t)} no longer contains the correct repository. Select another path.`)},[e,c,n,s]),x=[...c.map(e=>({label:(0,g.jsxs)(o,{children:[`Use `,(0,g.jsx)(o,{bold:!0,children:f(e)})]}),value:e})),{label:`Cancel`,value:`cancel`}];return(0,g.jsx)(l,{title:`Teleport to Repo`,onCancel:s,color:`background`,children:c.length>0?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(a,{flexDirection:`column`,gap:1,children:[d&&(0,g.jsx)(o,{color:`error`,children:d}),(0,g.jsxs)(o,{children:[`Open Claude Code in `,(0,g.jsx)(o,{bold:!0,children:e}),`:`]})]}),v?(0,g.jsxs)(a,{children:[(0,g.jsx)(r,{}),(0,g.jsx)(o,{children:` Validating repository…`})]}):(0,g.jsx)(i,{options:x,onChange:e=>void b(e)})]}):(0,g.jsxs)(a,{flexDirection:`column`,gap:1,children:[d&&(0,g.jsx)(o,{color:`error`,children:d}),(0,g.jsxs)(o,{dimColor:!0,children:[`Run claude --teleport from a checkout of `,e]})]})})}export{_ as TeleportRepoMismatchDialog};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{$C as t,Fu as n,Ip as r,Iu as i,JC as a,Lp as o,Pu as s,Ru as c,YC as l,_u as u,nd as d,pu as f,qC as p,td as m}from"./loadAgentsDir-C7lOqvfh.js";import{D as h,I as g,P as _,T as v,Wt as y,fi as b,hn as x,ot as S,t as C}from"./src-P_wYS_NJ2.js";import{t as w}from"./jsx-runtime-Bb4Xn-E0.js";import{Wt as T,nr as E}from"./state-BemZdQIl.js";import{F as D,N as O,a as k,l as A,z as j}from"./debug-RAynG_nM.js";import{n as M,r as N}from"./analytics-DJobLaWP.js";import{p as P,v as F}from"./startupProfiler-L_UWZ03w.js";import{i as I,n as L}from"./detectRepository-DgpNd87p.js";import{n as R,o as z}from"./api-nSHc_GIQ.js";var B=e(b(),1);T(),M(),j(),f();function V(e){let[t,n]=(0,B.useState)(!1),[r,i]=(0,B.useState)(null),[a,o]=(0,B.useState)(null);return{resumeSession:(0,B.useCallback)(async t=>{n(!0),i(null),o(t),N(`tengu_teleport_resume_session`,{source:e,session_id:t.id});try{let e=await u(t.id);return E({sessionId:t.id}),n(!1),e}catch(e){let t={message:e instanceof O?e.message:D(e),formattedMessage:e instanceof O?e.formattedMessage:void 0,isOperationError:e instanceof O};return i(t),n(!1),null}},[e]),isResuming:t,error:r,selectedSession:a,clearError:(0,B.useCallback)(()=>{i(null)},[])}}t(),z(),C(),p(),a(),k(),I(),F(),o(),m(),c(),n();var H=w(),U=`Updated`,W=` `;function G({onSelect:e,onCancel:t,isEmbedded:n=!1}){let{rows:a}=S(),[o,c]=(0,B.useState)([]),[u,f]=(0,B.useState)(null),[p,m]=(0,B.useState)(!0),[b,C]=(0,B.useState)(null),[w,T]=(0,B.useState)(!1),[E,D]=(0,B.useState)(!1),[O,k]=(0,B.useState)(1),j=l(`confirm:no`,`Confirmation`,`Esc`),M=(0,B.useCallback)(async()=>{try{m(!0),C(null);let e=await L();f(e),A(`Current repository: ${e||`not detected`}`);let t=await R(),n=t;e&&(n=t.filter(t=>t.repo?`${t.repo.owner.login}/${t.repo.name}`===e:!1),A(`Filtered ${n.length} sessions for repo ${e} from ${t.length} total`));let r=[...n].sort((e,t)=>{let n=new Date(e.updated_at);return new Date(t.updated_at).getTime()-n.getTime()});c(r)}catch(e){let t=e instanceof Error?e.message:String(e);A(`Error loading code sessions: ${t}`),C(K(t))}finally{m(!1),T(!1)}},[]),N=()=>{T(!0),M()};y(`confirm:no`,t,{context:`Confirmation`}),x((e,n)=>{if(n.ctrl&&e===`c`){t();return}if(n.ctrl&&e===`r`&&b){N();return}if(b!==null&&n.return){t();return}});let F=(0,B.useCallback)(()=>{D(!0),M()},[D,M]);if(!E)return(0,H.jsx)(s,{onComplete:F});if(p)return(0,H.jsxs)(g,{flexDirection:`column`,padding:1,children:[(0,H.jsxs)(g,{flexDirection:`row`,children:[(0,H.jsx)(i,{}),(0,H.jsx)(_,{bold:!0,children:`Loading Claude Code sessions…`})]}),(0,H.jsx)(_,{dimColor:!0,children:w?`Retrying…`:`Fetching your Claude Code sessions…`})]});if(b)return(0,H.jsxs)(g,{flexDirection:`column`,padding:1,children:[(0,H.jsx)(_,{bold:!0,color:`error`,children:`Error loading Claude Code sessions`}),q(b),(0,H.jsxs)(_,{dimColor:!0,children:[`Press `,(0,H.jsx)(_,{bold:!0,children:`Ctrl+R`}),` to retry · Press `,(0,H.jsx)(_,{bold:!0,children:j}),` to cancel`]})]});if(o.length===0)return(0,H.jsxs)(g,{flexDirection:`column`,padding:1,children:[(0,H.jsxs)(_,{bold:!0,children:[`No Claude Code sessions found`,u&&(0,H.jsxs)(_,{children:[` for `,u]})]}),(0,H.jsx)(g,{marginTop:1,children:(0,H.jsxs)(_,{dimColor:!0,children:[`Press `,(0,H.jsx)(_,{bold:!0,children:j}),` to cancel`]})})]});let I=o.map(e=>({...e,timeString:P(new Date(e.updated_at))})),z=Math.max(7,...I.map(e=>e.timeString.length)),V=I.map(({timeString:e,title:t,id:n})=>({label:`${e.padEnd(z,` `)} ${t}`,value:n})),G=Math.max(1,n?Math.min(o.length,5,a-6-7):Math.min(o.length,a-1-7));return(0,H.jsxs)(g,{flexDirection:`column`,padding:1,height:G+7,children:[(0,H.jsxs)(_,{bold:!0,children:[`Select a session to resume`,o.length>G&&(0,H.jsxs)(_,{dimColor:!0,children:[` `,`(`,O,` of `,o.length,`)`]}),u&&(0,H.jsxs)(_,{dimColor:!0,children:[` (`,u,`)`]}),`:`]}),(0,H.jsxs)(g,{flexDirection:`column`,marginTop:1,flexGrow:1,children:[(0,H.jsx)(g,{marginLeft:2,children:(0,H.jsxs)(_,{bold:!0,children:[U.padEnd(z,` `),W,`Session Title`]})}),(0,H.jsx)(d,{visibleOptionCount:G,options:V,onChange:t=>{let n=o.find(e=>e.id===t);n&&e(n)},onFocus:e=>{let t=V.findIndex(t=>t.value===e);t>=0&&k(t+1)}})]}),(0,H.jsx)(g,{flexDirection:`row`,children:(0,H.jsx)(_,{dimColor:!0,children:(0,H.jsxs)(v,{children:[(0,H.jsx)(h,{shortcut:`↑/↓`,action:`select`}),(0,H.jsx)(h,{shortcut:`Enter`,action:`confirm`}),(0,H.jsx)(r,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})})]})}function K(e){let t=e.toLowerCase();return t.includes(`fetch`)||t.includes(`network`)||t.includes(`timeout`)?`network`:t.includes(`auth`)||t.includes(`token`)||t.includes(`permission`)||t.includes(`oauth`)||t.includes(`not authenticated`)||t.includes(`/login`)||t.includes(`console account`)||t.includes(`403`)?`auth`:t.includes(`api`)||t.includes(`rate limit`)||t.includes(`500`)||t.includes(`529`)?`api`:`other`}function q(e){switch(e){case`network`:return(0,H.jsx)(g,{marginY:1,flexDirection:`column`,children:(0,H.jsx)(_,{dimColor:!0,children:`Check your internet connection`})});case`auth`:return(0,H.jsx)(g,{marginY:1,flexDirection:`column`,children:(0,H.jsx)(_,{dimColor:!0,children:`Teleport requires a Claude account`})});case`api`:return(0,H.jsx)(g,{marginY:1,flexDirection:`column`,children:(0,H.jsx)(_,{dimColor:!0,children:`Sorry, Claude encountered an error`})});case`other`:return(0,H.jsx)(g,{marginY:1,flexDirection:`row`,children:(0,H.jsx)(_,{dimColor:!0,children:`Sorry, Claude Code encountered an error`})})}}M(),C(),p(),c();function J({onComplete:e,onCancel:t,onError:n,isEmbedded:r=!1,source:a}){let{resumeSession:o,isResuming:s,error:c,selectedSession:l}=V(a);(0,B.useEffect)(()=>{N(`tengu_teleport_started`,{source:a})},[a]);let u=async t=>{let r=await o(t);r?e(r):c&&n&&n(c.message,c.formattedMessage)},d=()=>{N(`tengu_teleport_cancelled`,{}),t()};return y(`app:interrupt`,d,{context:`Global`,isActive:!!c&&!n}),s&&l?(0,H.jsxs)(g,{flexDirection:`column`,padding:1,children:[(0,H.jsxs)(g,{flexDirection:`row`,children:[(0,H.jsx)(i,{}),(0,H.jsx)(_,{bold:!0,children:`Resuming session…`})]}),(0,H.jsxs)(_,{dimColor:!0,children:[`Loading "`,l.title,`"…`]})]}):c&&!n?(0,H.jsxs)(g,{flexDirection:`column`,padding:1,children:[(0,H.jsx)(_,{bold:!0,color:`error`,children:`Failed to resume session`}),(0,H.jsx)(_,{dimColor:!0,children:c.message}),(0,H.jsx)(g,{marginTop:1,children:(0,H.jsxs)(_,{dimColor:!0,children:[`Press `,(0,H.jsx)(_,{bold:!0,children:`Esc`}),` to cancel`]})})]}):(0,H.jsx)(G,{onSelect:u,onCancel:d,isEmbedded:r})}export{J as TeleportResumeWrapper};
1
+ import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{$u as t,Fp as n,GC as r,Iu as i,KC as a,Mu as o,Nu as s,Pp as c,Pu as l,ZC as u,du as d,ed as f,hu as p,qC as m}from"./loadAgentsDir-BL93ulMm.js";import{D as h,I as g,P as _,T as v,Wt as y,fi as b,hn as x,ot as S,t as C}from"./src-P_wYS_NJ2.js";import{t as w}from"./jsx-runtime-Bb4Xn-E0.js";import{Wt as T,nr as E}from"./state-BemZdQIl.js";import{M as D,P as O,R as k,c as A,i as j}from"./debug-BecbSVoN.js";import{n as M,r as N}from"./analytics-DJobLaWP.js";import{p as P,v as F}from"./startupProfiler-CmH_aVy2.js";import{i as I,n as L}from"./detectRepository-C15umvKN.js";import{n as R,o as z}from"./api-BbJfMXRS.js";var B=e(b(),1);T(),M(),k(),d();function V(e){let[t,n]=(0,B.useState)(!1),[r,i]=(0,B.useState)(null),[a,o]=(0,B.useState)(null);return{resumeSession:(0,B.useCallback)(async t=>{n(!0),i(null),o(t),N(`tengu_teleport_resume_session`,{source:e,session_id:t.id});try{let e=await p(t.id);return E({sessionId:t.id}),n(!1),e}catch(e){let t={message:e instanceof D?e.message:O(e),formattedMessage:e instanceof D?e.formattedMessage:void 0,isOperationError:e instanceof D};return i(t),n(!1),null}},[e]),isResuming:t,error:r,selectedSession:a,clearError:(0,B.useCallback)(()=>{i(null)},[])}}u(),z(),C(),r(),a(),j(),I(),F(),n(),t(),i(),s();var H=w(),U=`Updated`,W=` `;function G({onSelect:e,onCancel:t,isEmbedded:n=!1}){let{rows:r}=S(),[i,a]=(0,B.useState)([]),[s,u]=(0,B.useState)(null),[d,p]=(0,B.useState)(!0),[b,C]=(0,B.useState)(null),[w,T]=(0,B.useState)(!1),[E,D]=(0,B.useState)(!1),[O,k]=(0,B.useState)(1),j=m(`confirm:no`,`Confirmation`,`Esc`),M=(0,B.useCallback)(async()=>{try{p(!0),C(null);let e=await L();u(e),A(`Current repository: ${e||`not detected`}`);let t=await R(),n=t;e&&(n=t.filter(t=>t.repo?`${t.repo.owner.login}/${t.repo.name}`===e:!1),A(`Filtered ${n.length} sessions for repo ${e} from ${t.length} total`));let r=[...n].sort((e,t)=>{let n=new Date(e.updated_at);return new Date(t.updated_at).getTime()-n.getTime()});a(r)}catch(e){let t=e instanceof Error?e.message:String(e);A(`Error loading code sessions: ${t}`),C(K(t))}finally{p(!1),T(!1)}},[]),N=()=>{T(!0),M()};y(`confirm:no`,t,{context:`Confirmation`}),x((e,n)=>{if(n.ctrl&&e===`c`){t();return}if(n.ctrl&&e===`r`&&b){N();return}if(b!==null&&n.return){t();return}});let F=(0,B.useCallback)(()=>{D(!0),M()},[D,M]);if(!E)return(0,H.jsx)(o,{onComplete:F});if(d)return(0,H.jsxs)(g,{flexDirection:`column`,padding:1,children:[(0,H.jsxs)(g,{flexDirection:`row`,children:[(0,H.jsx)(l,{}),(0,H.jsx)(_,{bold:!0,children:`Loading Claude Code sessions…`})]}),(0,H.jsx)(_,{dimColor:!0,children:w?`Retrying…`:`Fetching your Claude Code sessions…`})]});if(b)return(0,H.jsxs)(g,{flexDirection:`column`,padding:1,children:[(0,H.jsx)(_,{bold:!0,color:`error`,children:`Error loading Claude Code sessions`}),q(b),(0,H.jsxs)(_,{dimColor:!0,children:[`Press `,(0,H.jsx)(_,{bold:!0,children:`Ctrl+R`}),` to retry · Press `,(0,H.jsx)(_,{bold:!0,children:j}),` to cancel`]})]});if(i.length===0)return(0,H.jsxs)(g,{flexDirection:`column`,padding:1,children:[(0,H.jsxs)(_,{bold:!0,children:[`No Claude Code sessions found`,s&&(0,H.jsxs)(_,{children:[` for `,s]})]}),(0,H.jsx)(g,{marginTop:1,children:(0,H.jsxs)(_,{dimColor:!0,children:[`Press `,(0,H.jsx)(_,{bold:!0,children:j}),` to cancel`]})})]});let I=i.map(e=>({...e,timeString:P(new Date(e.updated_at))})),z=Math.max(7,...I.map(e=>e.timeString.length)),V=I.map(({timeString:e,title:t,id:n})=>({label:`${e.padEnd(z,` `)} ${t}`,value:n})),G=Math.max(1,n?Math.min(i.length,5,r-6-7):Math.min(i.length,r-1-7));return(0,H.jsxs)(g,{flexDirection:`column`,padding:1,height:G+7,children:[(0,H.jsxs)(_,{bold:!0,children:[`Select a session to resume`,i.length>G&&(0,H.jsxs)(_,{dimColor:!0,children:[` `,`(`,O,` of `,i.length,`)`]}),s&&(0,H.jsxs)(_,{dimColor:!0,children:[` (`,s,`)`]}),`:`]}),(0,H.jsxs)(g,{flexDirection:`column`,marginTop:1,flexGrow:1,children:[(0,H.jsx)(g,{marginLeft:2,children:(0,H.jsxs)(_,{bold:!0,children:[U.padEnd(z,` `),W,`Session Title`]})}),(0,H.jsx)(f,{visibleOptionCount:G,options:V,onChange:t=>{let n=i.find(e=>e.id===t);n&&e(n)},onFocus:e=>{let t=V.findIndex(t=>t.value===e);t>=0&&k(t+1)}})]}),(0,H.jsx)(g,{flexDirection:`row`,children:(0,H.jsx)(_,{dimColor:!0,children:(0,H.jsxs)(v,{children:[(0,H.jsx)(h,{shortcut:`↑/↓`,action:`select`}),(0,H.jsx)(h,{shortcut:`Enter`,action:`confirm`}),(0,H.jsx)(c,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})})]})}function K(e){let t=e.toLowerCase();return t.includes(`fetch`)||t.includes(`network`)||t.includes(`timeout`)?`network`:t.includes(`auth`)||t.includes(`token`)||t.includes(`permission`)||t.includes(`oauth`)||t.includes(`not authenticated`)||t.includes(`/login`)||t.includes(`console account`)||t.includes(`403`)?`auth`:t.includes(`api`)||t.includes(`rate limit`)||t.includes(`500`)||t.includes(`529`)?`api`:`other`}function q(e){switch(e){case`network`:return(0,H.jsx)(g,{marginY:1,flexDirection:`column`,children:(0,H.jsx)(_,{dimColor:!0,children:`Check your internet connection`})});case`auth`:return(0,H.jsx)(g,{marginY:1,flexDirection:`column`,children:(0,H.jsx)(_,{dimColor:!0,children:`Teleport requires a Claude account`})});case`api`:return(0,H.jsx)(g,{marginY:1,flexDirection:`column`,children:(0,H.jsx)(_,{dimColor:!0,children:`Sorry, Claude encountered an error`})});case`other`:return(0,H.jsx)(g,{marginY:1,flexDirection:`row`,children:(0,H.jsx)(_,{dimColor:!0,children:`Sorry, Claude Code encountered an error`})})}}M(),C(),r(),i();function J({onComplete:e,onCancel:t,onError:n,isEmbedded:r=!1,source:i}){let{resumeSession:a,isResuming:o,error:s,selectedSession:c}=V(i);(0,B.useEffect)(()=>{N(`tengu_teleport_started`,{source:i})},[i]);let u=async t=>{let r=await a(t);r?e(r):s&&n&&n(s.message,s.formattedMessage)},d=()=>{N(`tengu_teleport_cancelled`,{}),t()};return y(`app:interrupt`,d,{context:`Global`,isActive:!!s&&!n}),o&&c?(0,H.jsxs)(g,{flexDirection:`column`,padding:1,children:[(0,H.jsxs)(g,{flexDirection:`row`,children:[(0,H.jsx)(l,{}),(0,H.jsx)(_,{bold:!0,children:`Resuming session…`})]}),(0,H.jsxs)(_,{dimColor:!0,children:[`Loading "`,c.title,`"…`]})]}):s&&!n?(0,H.jsxs)(g,{flexDirection:`column`,padding:1,children:[(0,H.jsx)(_,{bold:!0,color:`error`,children:`Failed to resume session`}),(0,H.jsx)(_,{dimColor:!0,children:s.message}),(0,H.jsx)(g,{marginTop:1,children:(0,H.jsxs)(_,{dimColor:!0,children:[`Press `,(0,H.jsx)(_,{bold:!0,children:`Esc`}),` to cancel`]})})]}):(0,H.jsx)(G,{onSelect:u,onCancel:d,isEmbedded:r})}export{J as TeleportResumeWrapper};
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{$C as t,Cg as n,Eg as r,JC as i,XC as a,YC as o,dg as s,fg as c,nd as l,og as u,qC as d,rf as f,sg as p,td as m,tf as h,ug as g,wg as _}from"./loadAgentsDir-C7lOqvfh.js";import{D as v,H as y,I as b,P as x,T as S,U as C,V as w,Wt as T,Xt as E,fi as D,ot as O,t as k}from"./src-P_wYS_NJ2.js";import{t as A}from"./jsx-runtime-Bb4Xn-E0.js";import{g as j,x as M}from"./settings-DnptdP79.js";import{n as N,t as P}from"./useExitOnCtrlCDWithKeybindings-ChqBs9Lr.js";function F({onThemeSelect:e,showIntroText:t=!1,helpText:n=``,showHelpTextBelow:i=!1,hideEscToCancel:a=!1,skipExitHandling:c=!1,onCancel:d}){let[f]=y(),p=C(),{columns:m}=O(),D=g(),k=D===null?s(f):null,{setPreviewTheme:A,savePreview:j,cancelPreview:P}=w(),F=_(e=>e.settings.syntaxHighlightingDisabled)??!1,L=r();E(`ThemePicker`);let R=o(`theme:toggleSyntaxHighlighting`,`ThemePicker`,`ctrl+t`);T(`theme:toggleSyntaxHighlighting`,()=>{if(D===null){let e=!F;M(`userSettings`,{syntaxHighlightingDisabled:e}),L(t=>({...t,settings:{...t.settings,syntaxHighlightingDisabled:e}}))}},{context:`ThemePicker`});let z=N(c?()=>{}:void 0),B=[{label:`Dark mode`,value:`dark`},{label:`Light mode`,value:`light`},{label:`Dark mode (colorblind-friendly)`,value:`dark-daltonized`},{label:`Light mode (colorblind-friendly)`,value:`light-daltonized`},{label:`Dark mode (ANSI colors only)`,value:`dark-ansi`},{label:`Light mode (ANSI colors only)`,value:`light-ansi`}],V=(0,I.jsxs)(b,{flexDirection:`column`,gap:1,children:[(0,I.jsxs)(b,{flexDirection:`column`,gap:1,children:[t?(0,I.jsx)(x,{children:`Let's get started.`}):(0,I.jsx)(x,{bold:!0,color:`permission`,children:`Theme`}),(0,I.jsxs)(b,{flexDirection:`column`,children:[(0,I.jsx)(x,{bold:!0,children:`Choose the text style that looks best with your terminal`}),n&&!i&&(0,I.jsx)(x,{dimColor:!0,children:n})]}),(0,I.jsx)(l,{options:B,onFocus:e=>{A(e)},onChange:t=>{j(),e(t)},onCancel:c?()=>{P(),d?.()}:async()=>{P(),await h(0)},visibleOptionCount:B.length,defaultValue:p,defaultFocusValue:p})]}),(0,I.jsxs)(b,{flexDirection:`column`,width:`100%`,children:[(0,I.jsx)(b,{flexDirection:`column`,borderTop:!0,borderBottom:!0,borderLeft:!1,borderRight:!1,borderStyle:`dashed`,borderColor:`subtle`,children:(0,I.jsx)(u,{patch:{oldStart:1,newStart:1,oldLines:3,newLines:3,lines:[` function greet() {`,`- console.log("Hello, World!");`,`+ console.log("Hello, Claude!");`,` }`]},dim:!1,filePath:`demo.js`,firstLine:null,width:m})}),(0,I.jsxs)(x,{dimColor:!0,children:[` `,D===`env`?`Syntax highlighting disabled (via CLAUDE_CODE_SYNTAX_HIGHLIGHT=${process.env.CLAUDE_CODE_SYNTAX_HIGHLIGHT})`:F?`Syntax highlighting disabled (${R} to enable)`:k?`Syntax theme: ${k.theme}${k.source?` (from ${k.source})`:``} (${R} to disable)`:`Syntax highlighting enabled (${R} to disable)`]})]})]});return t?V:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(b,{flexDirection:`column`,children:V}),(0,I.jsxs)(b,{marginTop:1,children:[i&&n&&(0,I.jsx)(b,{marginLeft:3,children:(0,I.jsx)(x,{dimColor:!0,children:n})}),!a&&(0,I.jsx)(b,{children:(0,I.jsx)(x,{dimColor:!0,italic:!0,children:z.pending?(0,I.jsxs)(I.Fragment,{children:[`Press `,z.keyName,` again to exit`]}):(0,I.jsxs)(S,{children:[(0,I.jsx)(v,{shortcut:`Enter`,action:`select`}),(0,I.jsx)(v,{shortcut:`Esc`,action:`cancel`})]})})})]})]})}var I,L=e((()=>{D(),P(),t(),k(),a(),d(),i(),n(),f(),j(),m(),c(),p(),I=A()}));export{L as n,F as t};
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{$d as t,$u as n,GC as r,JC as i,KC as a,Sg as o,ZC as s,ag as c,cg as l,ed as u,ig as d,lg as f,qC as p,tf as m,ug as h,wg as g,xg as _}from"./loadAgentsDir-BL93ulMm.js";import{D as v,H as y,I as b,P as x,T as S,U as C,V as w,Wt as T,Xt as E,fi as D,ot as O,t as k}from"./src-P_wYS_NJ2.js";import{t as A}from"./jsx-runtime-Bb4Xn-E0.js";import{g as j,x as M}from"./settings-D4CpDv2y.js";import{n as N,t as P}from"./useExitOnCtrlCDWithKeybindings-DEEJhm_W.js";function F({onThemeSelect:e,showIntroText:n=!1,helpText:r=``,showHelpTextBelow:i=!1,hideEscToCancel:a=!1,skipExitHandling:s=!1,onCancel:c}){let[m]=y(),h=C(),{columns:_}=O(),D=l(),k=D===null?f(m):null,{setPreviewTheme:A,savePreview:j,cancelPreview:P}=w(),F=o(e=>e.settings.syntaxHighlightingDisabled)??!1,L=g();E(`ThemePicker`);let R=p(`theme:toggleSyntaxHighlighting`,`ThemePicker`,`ctrl+t`);T(`theme:toggleSyntaxHighlighting`,()=>{if(D===null){let e=!F;M(`userSettings`,{syntaxHighlightingDisabled:e}),L(t=>({...t,settings:{...t.settings,syntaxHighlightingDisabled:e}}))}},{context:`ThemePicker`});let z=N(s?()=>{}:void 0),B=[{label:`Dark mode`,value:`dark`},{label:`Light mode`,value:`light`},{label:`Dark mode (colorblind-friendly)`,value:`dark-daltonized`},{label:`Light mode (colorblind-friendly)`,value:`light-daltonized`},{label:`Dark mode (ANSI colors only)`,value:`dark-ansi`},{label:`Light mode (ANSI colors only)`,value:`light-ansi`}],V=(0,I.jsxs)(b,{flexDirection:`column`,gap:1,children:[(0,I.jsxs)(b,{flexDirection:`column`,gap:1,children:[n?(0,I.jsx)(x,{children:`Let's get started.`}):(0,I.jsx)(x,{bold:!0,color:`permission`,children:`Theme`}),(0,I.jsxs)(b,{flexDirection:`column`,children:[(0,I.jsx)(x,{bold:!0,children:`Choose the text style that looks best with your terminal`}),r&&!i&&(0,I.jsx)(x,{dimColor:!0,children:r})]}),(0,I.jsx)(u,{options:B,onFocus:e=>{A(e)},onChange:t=>{j(),e(t)},onCancel:s?()=>{P(),c?.()}:async()=>{P(),await t(0)},visibleOptionCount:B.length,defaultValue:h,defaultFocusValue:h})]}),(0,I.jsxs)(b,{flexDirection:`column`,width:`100%`,children:[(0,I.jsx)(b,{flexDirection:`column`,borderTop:!0,borderBottom:!0,borderLeft:!1,borderRight:!1,borderStyle:`dashed`,borderColor:`subtle`,children:(0,I.jsx)(d,{patch:{oldStart:1,newStart:1,oldLines:3,newLines:3,lines:[` function greet() {`,`- console.log("Hello, World!");`,`+ console.log("Hello, Claude!");`,` }`]},dim:!1,filePath:`demo.js`,firstLine:null,width:_})}),(0,I.jsxs)(x,{dimColor:!0,children:[` `,D===`env`?`Syntax highlighting disabled (via CLAUDE_CODE_SYNTAX_HIGHLIGHT=${process.env.CLAUDE_CODE_SYNTAX_HIGHLIGHT})`:F?`Syntax highlighting disabled (${R} to enable)`:k?`Syntax theme: ${k.theme}${k.source?` (from ${k.source})`:``} (${R} to disable)`:`Syntax highlighting enabled (${R} to disable)`]})]})]});return n?V:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(b,{flexDirection:`column`,children:V}),(0,I.jsxs)(b,{marginTop:1,children:[i&&r&&(0,I.jsx)(b,{marginLeft:3,children:(0,I.jsx)(x,{dimColor:!0,children:r})}),!a&&(0,I.jsx)(b,{children:(0,I.jsx)(x,{dimColor:!0,italic:!0,children:z.pending?(0,I.jsxs)(I.Fragment,{children:[`Press `,z.keyName,` again to exit`]}):(0,I.jsxs)(S,{children:[(0,I.jsx)(v,{shortcut:`Enter`,action:`select`}),(0,I.jsx)(v,{shortcut:`Esc`,action:`cancel`})]})})})]})]})}var I,L=e((()=>{D(),P(),s(),k(),i(),r(),a(),_(),m(),j(),n(),h(),c(),I=A()}));export{L as n,F as t};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{C_ as t,S_ as n,fS as r,mS as i,nd as a,nf as o,qC as s,rf as c,td as l}from"./loadAgentsDir-C7lOqvfh.js";import{I as u,P as d,Wt as f,fi as p,t as m}from"./src-P_wYS_NJ2.js";import{t as h}from"./jsx-runtime-Bb4Xn-E0.js";import{$n as g,Wt as _}from"./state-BemZdQIl.js";import{n as v,t as y}from"./cwd-Cfdf7z7s.js";import{d as b,p as x}from"./debug-RAynG_nM.js";import{c as S,g as C}from"./settings-DnptdP79.js";import{h as w,n as T,v as E}from"./config-Do1870_d.js";import{n as D,r as O}from"./analytics-DJobLaWP.js";import{on as k}from"./prompt-M2lu8_Oa.js";import{n as A,t as j}from"./managedEnvConstants-BPwL2aWI.js";import{n as M,t as N}from"./useExitOnCtrlCDWithKeybindings-ChqBs9Lr.js";import{n as P,t as F}from"./PermissionDialog-Cb3z8OUP.js";import{homedir as I}from"os";var L=e(p(),1),R=h();m(),_(),v(),x(),D(),w(),s(),i(),c(),l(),N(),P(),C(),k(),A(),t();function z(e){if(e===null||e.disableAllHooks)return!1;if(e.statusLine||e.fileSuggestion)return!0;if(!e.hooks)return!1;for(let t of Object.values(e.hooks))if(t.length>0)return!0;return!1}function B(){let e=[];return z(S(`projectSettings`))&&e.push(`.claude/settings.json`),z(S(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function V(e){return e.some(e=>e.ruleBehavior===`allow`&&(e.ruleValue.toolName===`Bash`||e.ruleValue.toolName.startsWith(`Bash(`)))}function H(){let e=[];return V(n(`projectSettings`))&&e.push(`.claude/settings.json`),V(n(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function U(e){return!!e?.otelHeadersHelper}function W(){let e=[];return U(S(`projectSettings`))&&e.push(`.claude/settings.json`),U(S(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function G(e){return!!e?.apiKeyHelper}function K(){let e=[];return G(S(`projectSettings`))&&e.push(`.claude/settings.json`),G(S(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function q(e){return!!(e?.awsAuthRefresh||e?.awsCredentialExport)}function J(){let e=[];return q(S(`projectSettings`))&&e.push(`.claude/settings.json`),q(S(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function Y(e){return!!e?.gcpAuthRefresh}function X(){let e=[];return Y(S(`projectSettings`))&&e.push(`.claude/settings.json`),Y(S(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function Z(e){return e?.env?Object.keys(e.env).some(e=>!j.has(e.toUpperCase())):!1}function Q(){let e=[];return Z(S(`projectSettings`))&&e.push(`.claude/settings.json`),Z(S(`localSettings`))&&e.push(`.claude/settings.local.json`),e}k();function $({onDone:e,commands:t}){let{servers:n}=r(`project`),i=Object.keys(n).length>0,s=B().length>0,c=H(),l=K().length>0,p=J().length>0,m=X().length>0,h=W().length>0,_=Q().length>0,v=t?.some(e=>e.type===`prompt`&&e.loadedFrom===`commands_DEPRECATED`&&(e.source===`projectSettings`||e.source===`localSettings`)&&e.allowedTools?.some(e=>e===`Bash`||e.startsWith(`Bash(`)))??!1,x=t?.some(e=>e.type===`prompt`&&(e.loadedFrom===`skills`||e.loadedFrom===`plugin`)&&(e.source===`projectSettings`||e.source===`localSettings`||e.source===`plugin`)&&e.allowedTools?.some(e=>e===`Bash`||e.startsWith(`Bash(`)))??!1,S=c.length>0||v||x,C=T(),[w,D]=L.useState(null);L.useEffect(()=>{if(w!==null){let e=w,t=setTimeout(()=>o(e));return()=>clearTimeout(t)}},[w]),L.useEffect(()=>{O(`tengu_trust_dialog_shown`,{isHomeDir:I()===y(),hasMcpServers:i,hasHooks:s,hasBashExecution:S,hasApiKeyHelper:l,hasAwsCommands:p,hasGcpCommands:m,hasOtelHeadersHelper:h,hasDangerousEnvVars:_})},[i,s,S,l,p,m,h,_]);function k(t){if(t===`exit`){D(1);return}let n=I()===y();O(`tengu_trust_dialog_accept`,{isHomeDir:n,hasMcpServers:i,hasHooks:s,hasBashExecution:S,hasApiKeyHelper:l,hasAwsCommands:p,hasGcpCommands:m,hasOtelHeadersHelper:h,hasDangerousEnvVars:_}),n?g(!0):E(e=>({...e,hasTrustDialogAccepted:!0})),e()}let A=M(()=>D(1));return f(`confirm:no`,()=>{D(0)},{context:`Confirmation`}),w===null?C?(setTimeout(e),null):(0,R.jsx)(F,{color:`warning`,titleColor:`warning`,title:`Accessing workspace:`,children:(0,R.jsxs)(u,{flexDirection:`column`,gap:1,paddingTop:1,children:[(0,R.jsx)(d,{bold:!0,children:b().cwd()}),(0,R.jsx)(d,{children:`Is this a project you trust? (Your own code, a well-known open source project, or work from your team).`}),(0,R.jsx)(d,{children:`Once trusted, Work Mate can read, edit, and run commands in this folder.`}),(0,R.jsx)(a,{options:[{label:`Yes, I trust this folder`,value:`enable_all`},{label:`No, exit`,value:`exit`}],onChange:e=>k(e),onCancel:()=>k(`exit`)}),(0,R.jsx)(d,{dimColor:!0,children:A.pending?(0,R.jsxs)(R.Fragment,{children:[`Press `,A.keyName,` again to exit`]}):(0,R.jsx)(R.Fragment,{children:`Enter to confirm · Esc to cancel`})})]})}):null}export{$ as TrustDialog};
1
+ import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{$u as t,GC as n,b_ as r,ed as i,ef as a,fS as o,tf as s,uS as c,x_ as l}from"./loadAgentsDir-BL93ulMm.js";import{I as u,P as d,Wt as f,fi as p,t as m}from"./src-P_wYS_NJ2.js";import{t as h}from"./jsx-runtime-Bb4Xn-E0.js";import{$n as g,Wt as _}from"./state-BemZdQIl.js";import{n as v,t as y}from"./cwd-Cfdf7z7s.js";import{f as b,u as x}from"./debug-BecbSVoN.js";import{c as S,g as C}from"./settings-D4CpDv2y.js";import{h as w,n as T,v as E}from"./config-aRiTrtCv.js";import{n as D,r as O}from"./analytics-DJobLaWP.js";import{on as k}from"./prompt-Dx7IWhBt.js";import{n as A,t as j}from"./managedEnvConstants-BPwL2aWI.js";import{n as M,t as N}from"./useExitOnCtrlCDWithKeybindings-DEEJhm_W.js";import{n as P,t as F}from"./PermissionDialog-Cb3z8OUP.js";import{homedir as I}from"os";var L=e(p(),1),R=h();m(),_(),v(),b(),D(),w(),n(),o(),s(),t(),N(),P(),C(),k(),A(),l();function z(e){if(e===null||e.disableAllHooks)return!1;if(e.statusLine||e.fileSuggestion)return!0;if(!e.hooks)return!1;for(let t of Object.values(e.hooks))if(t.length>0)return!0;return!1}function B(){let e=[];return z(S(`projectSettings`))&&e.push(`.claude/settings.json`),z(S(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function V(e){return e.some(e=>e.ruleBehavior===`allow`&&(e.ruleValue.toolName===`Bash`||e.ruleValue.toolName.startsWith(`Bash(`)))}function H(){let e=[];return V(r(`projectSettings`))&&e.push(`.claude/settings.json`),V(r(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function U(e){return!!e?.otelHeadersHelper}function W(){let e=[];return U(S(`projectSettings`))&&e.push(`.claude/settings.json`),U(S(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function G(e){return!!e?.apiKeyHelper}function K(){let e=[];return G(S(`projectSettings`))&&e.push(`.claude/settings.json`),G(S(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function q(e){return!!(e?.awsAuthRefresh||e?.awsCredentialExport)}function J(){let e=[];return q(S(`projectSettings`))&&e.push(`.claude/settings.json`),q(S(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function Y(e){return!!e?.gcpAuthRefresh}function X(){let e=[];return Y(S(`projectSettings`))&&e.push(`.claude/settings.json`),Y(S(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function Z(e){return e?.env?Object.keys(e.env).some(e=>!j.has(e.toUpperCase())):!1}function Q(){let e=[];return Z(S(`projectSettings`))&&e.push(`.claude/settings.json`),Z(S(`localSettings`))&&e.push(`.claude/settings.local.json`),e}k();function $({onDone:e,commands:t}){let{servers:n}=c(`project`),r=Object.keys(n).length>0,o=B().length>0,s=H(),l=K().length>0,p=J().length>0,m=X().length>0,h=W().length>0,_=Q().length>0,v=t?.some(e=>e.type===`prompt`&&e.loadedFrom===`commands_DEPRECATED`&&(e.source===`projectSettings`||e.source===`localSettings`)&&e.allowedTools?.some(e=>e===`Bash`||e.startsWith(`Bash(`)))??!1,b=t?.some(e=>e.type===`prompt`&&(e.loadedFrom===`skills`||e.loadedFrom===`plugin`)&&(e.source===`projectSettings`||e.source===`localSettings`||e.source===`plugin`)&&e.allowedTools?.some(e=>e===`Bash`||e.startsWith(`Bash(`)))??!1,S=s.length>0||v||b,C=T(),[w,D]=L.useState(null);L.useEffect(()=>{if(w!==null){let e=w,t=setTimeout(()=>a(e));return()=>clearTimeout(t)}},[w]),L.useEffect(()=>{O(`tengu_trust_dialog_shown`,{isHomeDir:I()===y(),hasMcpServers:r,hasHooks:o,hasBashExecution:S,hasApiKeyHelper:l,hasAwsCommands:p,hasGcpCommands:m,hasOtelHeadersHelper:h,hasDangerousEnvVars:_})},[r,o,S,l,p,m,h,_]);function k(t){if(t===`exit`){D(1);return}let n=I()===y();O(`tengu_trust_dialog_accept`,{isHomeDir:n,hasMcpServers:r,hasHooks:o,hasBashExecution:S,hasApiKeyHelper:l,hasAwsCommands:p,hasGcpCommands:m,hasOtelHeadersHelper:h,hasDangerousEnvVars:_}),n?g(!0):E(e=>({...e,hasTrustDialogAccepted:!0})),e()}let A=M(()=>D(1));return f(`confirm:no`,()=>{D(0)},{context:`Confirmation`}),w===null?C?(setTimeout(e),null):(0,R.jsx)(F,{color:`warning`,titleColor:`warning`,title:`Accessing workspace:`,children:(0,R.jsxs)(u,{flexDirection:`column`,gap:1,paddingTop:1,children:[(0,R.jsx)(d,{bold:!0,children:x().cwd()}),(0,R.jsx)(d,{children:`Is this a project you trust? (Your own code, a well-known open source project, or work from your team).`}),(0,R.jsx)(d,{children:`Once trusted, Work Mate can read, edit, and run commands in this folder.`}),(0,R.jsx)(i,{options:[{label:`Yes, I trust this folder`,value:`enable_all`},{label:`No, exit`,value:`exit`}],onChange:e=>k(e),onCancel:()=>k(`exit`)}),(0,R.jsx)(d,{dimColor:!0,children:A.pending?(0,R.jsxs)(R.Fragment,{children:[`Press `,A.keyName,` again to exit`]}):(0,R.jsx)(R.Fragment,{children:`Enter to confirm · Esc to cancel`})})]})}):null}export{$ as TrustDialog};
@@ -1,2 +1,2 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./figures-5ThXQEtq.js";import{H as r,I as i,P as a,fi as o,j as s,t as c}from"./src-P_wYS_NJ2.js";import{t as l}from"./jsx-runtime-Bb4Xn-E0.js";import{D as u,E as d}from"./config-Do1870_d.js";function f(e,t,n,r){return r=typeof r==`function`?r:void 0,e==null?e:d(e,t,n,r)}var p=e((()=>{u()}));function m(e,t={}){let{showValues:n=!0,hideFunctions:r=!1,themeName:i=`dark`,treeCharColors:a={}}=t,o=[],c=new WeakSet;function l(e,t){return t?s(t,i)(e):e}function u(e,t,i,s=0){if(typeof e==`string`){o.push(t+l(e,a.value));return}if(typeof e!=`object`||!e){if(n){let n=String(e);o.push(t+l(n,a.value))}return}if(c.has(e)){o.push(t+l(`[Circular]`,a.value));return}c.add(e);let d=Object.keys(e).filter(t=>{let n=e[t];return!(r&&typeof n==`function`)});d.forEach((r,i)=>{let f=e[r],p=i===d.length-1,m=s===0&&i===0?``:t,g=l(p?h.lastBranch:h.branch,a.treeChar),_=r.trim()===``?``:l(r,a.key),v=m+g+(_?` `+_:``),y=r.trim()!==``;if(f&&typeof f==`object`&&c.has(f)){let e=l(`[Circular]`,a.value);o.push(v+(y?`: `:v?` `:``)+e)}else if(f&&typeof f==`object`&&!Array.isArray(f))o.push(v),u(f,m+l(p?h.empty:h.line,a.treeChar)+` `,p,s+1);else if(Array.isArray(f))o.push(v+(y?`: `:v?` `:``)+`[Array(`+f.length+`)]`);else if(n){let e=l(typeof f==`function`?`[Function]`:String(f),a.value);v+=(y?`: `:v?` `:``)+e,o.push(v)}else o.push(v)})}let d=Object.keys(e);if(d.length===0)return l(`(empty)`,a.value);if(d.length===1&&d[0]!==void 0&&d[0].trim()===``&&typeof e[d[0]]==`string`){let t=d[0],n=l(h.lastBranch,a.treeChar),r=l(e[t],a.value);return n+` `+r}return u(e,``,!0),o.join(`
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./figures-5ThXQEtq.js";import{H as r,I as i,P as a,fi as o,j as s,t as c}from"./src-P_wYS_NJ2.js";import{t as l}from"./jsx-runtime-Bb4Xn-E0.js";import{D as u,E as d}from"./config-aRiTrtCv.js";function f(e,t,n,r){return r=typeof r==`function`?r:void 0,e==null?e:d(e,t,n,r)}var p=e((()=>{u()}));function m(e,t={}){let{showValues:n=!0,hideFunctions:r=!1,themeName:i=`dark`,treeCharColors:a={}}=t,o=[],c=new WeakSet;function l(e,t){return t?s(t,i)(e):e}function u(e,t,i,s=0){if(typeof e==`string`){o.push(t+l(e,a.value));return}if(typeof e!=`object`||!e){if(n){let n=String(e);o.push(t+l(n,a.value))}return}if(c.has(e)){o.push(t+l(`[Circular]`,a.value));return}c.add(e);let d=Object.keys(e).filter(t=>{let n=e[t];return!(r&&typeof n==`function`)});d.forEach((r,i)=>{let f=e[r],p=i===d.length-1,m=s===0&&i===0?``:t,g=l(p?h.lastBranch:h.branch,a.treeChar),_=r.trim()===``?``:l(r,a.key),v=m+g+(_?` `+_:``),y=r.trim()!==``;if(f&&typeof f==`object`&&c.has(f)){let e=l(`[Circular]`,a.value);o.push(v+(y?`: `:v?` `:``)+e)}else if(f&&typeof f==`object`&&!Array.isArray(f))o.push(v),u(f,m+l(p?h.empty:h.line,a.treeChar)+` `,p,s+1);else if(Array.isArray(f))o.push(v+(y?`: `:v?` `:``)+`[Array(`+f.length+`)]`);else if(n){let e=l(typeof f==`function`?`[Function]`:String(f),a.value);v+=(y?`: `:v?` `:``)+e,o.push(v)}else o.push(v)})}let d=Object.keys(e);if(d.length===0)return l(`(empty)`,a.value);if(d.length===1&&d[0]!==void 0&&d[0].trim()===``&&typeof e[d[0]]==`string`){let t=d[0],n=l(h.lastBranch,a.treeChar),r=l(e[t],a.value);return n+` `+r}return u(e,``,!0),o.join(`
2
2
  `)}var h,g=e((()=>{t(),c(),h={branch:n.lineUpDownRight,lastBranch:n.lineUpRight,line:n.lineVertical,empty:` `}}));function _(e){let t={};return e.forEach(e=>{if(!e.path){t[``]=e.message;return}let n=e.path.split(`.`),r=e.path;if(e.invalidValue!==null&&e.invalidValue!==void 0&&n.length>0){let t=[];for(let r=0;r<n.length;r++){let i=n[r];if(i)if(!isNaN(parseInt(i,10))&&r===n.length-1){let n;n=typeof e.invalidValue==`string`?`"${e.invalidValue}"`:e.invalidValue===null?`null`:e.invalidValue===void 0?`undefined`:String(e.invalidValue),t.push(n)}else t.push(i)}r=t.join(`.`)}f(t,r,e.message,Object)}),t}function v({errors:e}){let[t]=r();if(e.length===0)return null;let n=e.reduce((e,t)=>{let n=t.file||`(file not specified)`;return e[n]||(e[n]=[]),e[n].push(t),e},{});return(0,y.jsx)(i,{flexDirection:`column`,children:Object.keys(n).sort().map(e=>{let r=n[e]||[];r.sort((e,t)=>!e.path&&t.path?-1:e.path&&!t.path?1:(e.path||``).localeCompare(t.path||``));let o=_(r),s=new Map;r.forEach(e=>{if(e.suggestion||e.docLink){let t=`${e.suggestion||``}|${e.docLink||``}`;s.has(t)||s.set(t,{suggestion:e.suggestion,docLink:e.docLink})}});let c=m(o,{showValues:!0,themeName:t,treeCharColors:{treeChar:`inactive`,key:`text`,value:`inactive`}});return(0,y.jsxs)(i,{flexDirection:`column`,children:[(0,y.jsx)(a,{children:e}),(0,y.jsx)(i,{marginLeft:1,children:(0,y.jsx)(a,{dimColor:!0,children:c})}),s.size>0&&(0,y.jsx)(i,{flexDirection:`column`,marginTop:1,children:Array.from(s.values()).map((e,t)=>(0,y.jsxs)(i,{flexDirection:`column`,marginBottom:1,children:[e.suggestion&&(0,y.jsx)(a,{dimColor:!0,wrap:`wrap`,children:e.suggestion}),e.docLink&&(0,y.jsxs)(a,{dimColor:!0,wrap:`wrap`,children:[`Learn more: `,e.docLink]})]},`suggestion-pair-${t}`))})]},e)})})}var y,b=e((()=>{p(),o(),c(),g(),y=l()}));export{b as n,v as t};
@@ -1 +1 @@
1
- import"./rolldown-runtime-DaDcL9Zw.js";import{H as e,I as t,P as n,fi as r,t as i}from"./src-P_wYS_NJ2.js";import{t as a}from"./jsx-runtime-Bb4Xn-E0.js";import{Gt as o,Jt as s}from"./settings-DnptdP79.js";r(),i(),s();var c=a(),l=58;function u(){let[r]=e(),i=`Welcome to Work Mate`;return o.terminal===`Apple_Terminal`?(0,c.jsx)(d,{theme:r,welcomeMessage:i}):[`light`,`light-daltonized`,`light-ansi`].includes(r)?(0,c.jsxs)(t,{width:l,flexDirection:`column`,children:[(0,c.jsxs)(n,{children:[(0,c.jsxs)(n,{color:`claudeBlue_FOR_SYSTEM_SPINNER`,children:[i,` `]}),(0,c.jsxs)(n,{dimColor:!0,children:[`v`,`0.0.10`,` `]})]}),(0,c.jsx)(n,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,c.jsx)(n,{children:` ░░░░░░ `}),(0,c.jsx)(n,{children:` ░░░ ░░░░░░░░░░ `}),(0,c.jsx)(n,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,c.jsx)(n,{children:` `})]}):(0,c.jsxs)(t,{width:l,flexDirection:`column`,children:[(0,c.jsxs)(n,{children:[(0,c.jsxs)(n,{color:`claudeBlue_FOR_SYSTEM_SPINNER`,children:[i,` `]}),(0,c.jsxs)(n,{dimColor:!0,children:[`v`,`0.0.10`,` `]})]}),(0,c.jsx)(n,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,c.jsx)(n,{children:` * █████▓▓░ `}),(0,c.jsx)(n,{children:` * ███▓░ ░░ `}),(0,c.jsx)(n,{children:` ░░░░░░ ███▓░ `}),(0,c.jsx)(n,{children:` ░░░ ░░░░░░░░░░ ███▓░ `}),(0,c.jsxs)(n,{children:[(0,c.jsx)(n,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,c.jsx)(n,{bold:!0,children:`*`}),(0,c.jsx)(n,{children:` ██▓░░ ▓ `})]}),(0,c.jsx)(n,{children:` ░▓▓███▓▓░ `}),(0,c.jsx)(n,{dimColor:!0,children:` * ░░░░ `}),(0,c.jsx)(n,{dimColor:!0,children:` ░░░░░░░░ `}),(0,c.jsx)(n,{dimColor:!0,children:` * ░░░░░░░░░░░░░░░░ `}),(0,c.jsx)(n,{dimColor:!0,children:` * `})]})}function d({theme:e,welcomeMessage:r}){return[`light`,`light-daltonized`,`light-ansi`].includes(e)?(0,c.jsxs)(t,{width:l,flexDirection:`column`,children:[(0,c.jsxs)(n,{children:[(0,c.jsxs)(n,{color:`claudeBlue_FOR_SYSTEM_SPINNER`,children:[r,` `]}),(0,c.jsxs)(n,{dimColor:!0,children:[`v`,`0.0.10`,` `]})]}),(0,c.jsx)(n,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,c.jsx)(n,{children:` ░░░░░░ `}),(0,c.jsx)(n,{children:` ░░░ ░░░░░░░░░░ `}),(0,c.jsx)(n,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,c.jsx)(n,{children:` `})]}):(0,c.jsxs)(t,{width:l,flexDirection:`column`,children:[(0,c.jsxs)(n,{children:[(0,c.jsxs)(n,{color:`claudeBlue_FOR_SYSTEM_SPINNER`,children:[r,` `]}),(0,c.jsxs)(n,{dimColor:!0,children:[`v`,`0.0.10`,` `]})]}),(0,c.jsx)(n,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,c.jsx)(n,{children:` * █████▓▓░ `}),(0,c.jsx)(n,{children:` * ███▓░ ░░ `}),(0,c.jsx)(n,{children:` ░░░░░░ ███▓░ `}),(0,c.jsx)(n,{children:` ░░░ ░░░░░░░░░░ ███▓░ `}),(0,c.jsxs)(n,{children:[(0,c.jsx)(n,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,c.jsx)(n,{bold:!0,children:`*`}),(0,c.jsx)(n,{children:` ██▓░░ ▓ `})]}),(0,c.jsx)(n,{children:` ░▓▓███▓▓░ `}),(0,c.jsx)(n,{dimColor:!0,children:` * ░░░░ `}),(0,c.jsx)(n,{dimColor:!0,children:` ░░░░░░░░ `}),(0,c.jsx)(n,{dimColor:!0,children:` ░░░░░░░░░░░░░░░░ `})]})}export{u as t};
1
+ import"./rolldown-runtime-DaDcL9Zw.js";import{H as e,I as t,P as n,fi as r,t as i}from"./src-P_wYS_NJ2.js";import{t as a}from"./jsx-runtime-Bb4Xn-E0.js";import{Kt as o,Yt as s}from"./settings-D4CpDv2y.js";r(),i(),s();var c=a(),l=58;function u(){let[r]=e(),i=`Welcome to Work Mate`;return o.terminal===`Apple_Terminal`?(0,c.jsx)(d,{theme:r,welcomeMessage:i}):[`light`,`light-daltonized`,`light-ansi`].includes(r)?(0,c.jsxs)(t,{width:l,flexDirection:`column`,children:[(0,c.jsxs)(n,{children:[(0,c.jsxs)(n,{color:`claudeBlue_FOR_SYSTEM_SPINNER`,children:[i,` `]}),(0,c.jsxs)(n,{dimColor:!0,children:[`v`,`0.0.11`,` `]})]}),(0,c.jsx)(n,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,c.jsx)(n,{children:` ░░░░░░ `}),(0,c.jsx)(n,{children:` ░░░ ░░░░░░░░░░ `}),(0,c.jsx)(n,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,c.jsx)(n,{children:` `})]}):(0,c.jsxs)(t,{width:l,flexDirection:`column`,children:[(0,c.jsxs)(n,{children:[(0,c.jsxs)(n,{color:`claudeBlue_FOR_SYSTEM_SPINNER`,children:[i,` `]}),(0,c.jsxs)(n,{dimColor:!0,children:[`v`,`0.0.11`,` `]})]}),(0,c.jsx)(n,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,c.jsx)(n,{children:` * █████▓▓░ `}),(0,c.jsx)(n,{children:` * ███▓░ ░░ `}),(0,c.jsx)(n,{children:` ░░░░░░ ███▓░ `}),(0,c.jsx)(n,{children:` ░░░ ░░░░░░░░░░ ███▓░ `}),(0,c.jsxs)(n,{children:[(0,c.jsx)(n,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,c.jsx)(n,{bold:!0,children:`*`}),(0,c.jsx)(n,{children:` ██▓░░ ▓ `})]}),(0,c.jsx)(n,{children:` ░▓▓███▓▓░ `}),(0,c.jsx)(n,{dimColor:!0,children:` * ░░░░ `}),(0,c.jsx)(n,{dimColor:!0,children:` ░░░░░░░░ `}),(0,c.jsx)(n,{dimColor:!0,children:` * ░░░░░░░░░░░░░░░░ `}),(0,c.jsx)(n,{dimColor:!0,children:` * `})]})}function d({theme:e,welcomeMessage:r}){return[`light`,`light-daltonized`,`light-ansi`].includes(e)?(0,c.jsxs)(t,{width:l,flexDirection:`column`,children:[(0,c.jsxs)(n,{children:[(0,c.jsxs)(n,{color:`claudeBlue_FOR_SYSTEM_SPINNER`,children:[r,` `]}),(0,c.jsxs)(n,{dimColor:!0,children:[`v`,`0.0.11`,` `]})]}),(0,c.jsx)(n,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,c.jsx)(n,{children:` ░░░░░░ `}),(0,c.jsx)(n,{children:` ░░░ ░░░░░░░░░░ `}),(0,c.jsx)(n,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,c.jsx)(n,{children:` `})]}):(0,c.jsxs)(t,{width:l,flexDirection:`column`,children:[(0,c.jsxs)(n,{children:[(0,c.jsxs)(n,{color:`claudeBlue_FOR_SYSTEM_SPINNER`,children:[r,` `]}),(0,c.jsxs)(n,{dimColor:!0,children:[`v`,`0.0.11`,` `]})]}),(0,c.jsx)(n,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,c.jsx)(n,{children:` * █████▓▓░ `}),(0,c.jsx)(n,{children:` * ███▓░ ░░ `}),(0,c.jsx)(n,{children:` ░░░░░░ ███▓░ `}),(0,c.jsx)(n,{children:` ░░░ ░░░░░░░░░░ ███▓░ `}),(0,c.jsxs)(n,{children:[(0,c.jsx)(n,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,c.jsx)(n,{bold:!0,children:`*`}),(0,c.jsx)(n,{children:` ██▓░░ ▓ `})]}),(0,c.jsx)(n,{children:` ░▓▓███▓▓░ `}),(0,c.jsx)(n,{dimColor:!0,children:` * ░░░░ `}),(0,c.jsx)(n,{dimColor:!0,children:` ░░░░░░░░ `}),(0,c.jsx)(n,{dimColor:!0,children:` ░░░░░░░░░░░░░░░░ `})]})}export{u as t};
@@ -0,0 +1 @@
1
+ import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./figures-5ThXQEtq.js";import{FT as i,I as a,L as o,NC as s,PC as c,R as l,RT as u,__ as d,g_ as f,p_ as p}from"./loadAgentsDir-BL93ulMm.js";import{I as m,P as h,di as g,fi as _,t as v,ui as y}from"./src-P_wYS_NJ2.js";import{t as b}from"./jsx-runtime-Bb4Xn-E0.js";import{Wt as x,h as S,in as C}from"./state-BemZdQIl.js";import{n as w,t as T}from"./AddWorkspaceDirectory-ag2JTpmU.js";function E({message:e,args:t,onDone:n}){return(0,O.useEffect)(()=>{let e=setTimeout(n,0);return()=>clearTimeout(e)},[n]),(0,k.jsxs)(m,{flexDirection:`column`,children:[(0,k.jsxs)(h,{dimColor:!0,children:[r.pointer,` /add-dir `,t]}),(0,k.jsx)(s,{children:(0,k.jsx)(h,{children:e})})]})}async function D(e,t,n){let r=(n??``).trim(),o=t.getAppState(),s=async(n,r=!1)=>{let a={type:`addDirectories`,directories:[n],destination:r?`localSettings`:`session`},o=p(t.getAppState().toolPermissionContext,a);t.setAppState(e=>({...e,toolPermissionContext:o}));let s=S();s.includes(n)||C([...s,n]),i.refreshConfig();let c;if(r)try{d(a),c=`Added ${y.bold(n)} as a working directory and saved to local settings`}catch(e){c=`Added ${y.bold(n)} as a working directory. Failed to save to local settings: ${e instanceof Error?e.message:`Unknown error`}`}else c=`Added ${y.bold(n)} as a working directory for this session`;e(`${c} ${y.dim(`· /permissions to manage`)}`)};if(!r)return(0,k.jsx)(T,{permissionContext:o.toolPermissionContext,onAddDirectory:s,onCancel:()=>{e(`Did not add a working directory.`)}});let c=await l(r,o.toolPermissionContext);if(c.resultType!==`success`){let t=a(c);return(0,k.jsx)(E,{message:t,args:n??``,onDone:()=>e(t)})}return(0,k.jsx)(T,{directoryPath:c.absolutePath,permissionContext:o.toolPermissionContext,onAddDirectory:s,onCancel:()=>{e(`Did not add ${y.bold(c.absolutePath)} as a working directory.`)}})}var O,k;e((()=>{g(),n(),O=t(_(),1),x(),c(),w(),v(),f(),u(),o(),k=b()}))();export{D as call};
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{fm as t,pm as n}from"./loadAgentsDir-C7lOqvfh.js";import{cn as r,sn as i}from"./settings-DnptdP79.js";function a(e,t){let n=new Map;for(let e of t)n.set(e.agentType,e);let r=new Set,i=[];for(let t of e){let e=`${t.agentType}:${t.source}`;if(r.has(e))continue;r.add(e);let a=n.get(t.agentType),o=a&&a.source!==t.source?a.source:void 0;i.push({...t,overriddenBy:o})}return i}function o(e){let n=e.model||t();if(n)return n===`inherit`?`inherit`:n}function s(e){return i(e).toLowerCase()}function c(e,t){return e.agentType.localeCompare(t.agentType,void 0,{sensitivity:`base`})}var l,u=e((()=>{n(),r(),l=[{label:`User agents`,source:`userSettings`},{label:`Project agents`,source:`projectSettings`},{label:`Local agents`,source:`localSettings`},{label:`Managed agents`,source:`policySettings`},{label:`Plugin agents`,source:`plugin`},{label:`CLI arg agents`,source:`flagSettings`},{label:`Built-in agents`,source:`built-in`}]}));export{o as a,u as i,c as n,a as o,s as r,l as t};
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{dm as t,um as n}from"./loadAgentsDir-BL93ulMm.js";import{cn as r,ln as i}from"./settings-D4CpDv2y.js";function a(e,t){let n=new Map;for(let e of t)n.set(e.agentType,e);let r=new Set,i=[];for(let t of e){let e=`${t.agentType}:${t.source}`;if(r.has(e))continue;r.add(e);let a=n.get(t.agentType),o=a&&a.source!==t.source?a.source:void 0;i.push({...t,overriddenBy:o})}return i}function o(e){let t=e.model||n();if(t)return t===`inherit`?`inherit`:t}function s(e){return r(e).toLowerCase()}function c(e,t){return e.agentType.localeCompare(t.agentType,void 0,{sensitivity:`base`})}var l,u=e((()=>{t(),i(),l=[{label:`User agents`,source:`userSettings`},{label:`Project agents`,source:`projectSettings`},{label:`Local agents`,source:`localSettings`},{label:`Managed agents`,source:`policySettings`},{label:`Plugin agents`,source:`plugin`},{label:`CLI arg agents`,source:`flagSettings`},{label:`Built-in agents`,source:`built-in`}]}));export{o as a,u as i,c as n,a as o,s as r,l as t};
@@ -1,2 +1,2 @@
1
- import{i as e,o as t,r as n}from"./loadAgentsDir-C7lOqvfh.js";import{n as r,t as i}from"./cwd-Cfdf7z7s.js";import{a,i as o,n as s,o as c,r as l,t as u}from"./agentDisplay-B755vMZE.js";o(),t(),r();function d(e){let t=a(e),n=[e.agentType];return t&&n.push(t),e.memory&&n.push(`${e.memory} memory`),n.join(` · `)}async function f(){let{allAgents:t}=await e(i()),r=c(t,n(t)),a=[],o=0;for(let{label:e,source:t}of u){let n=r.filter(e=>e.source===t).sort(s);if(n.length!==0){a.push(`${e}:`);for(let e of n)if(e.overriddenBy){let t=l(e.overriddenBy);a.push(` (shadowed by ${t}) ${d(e)}`)}else a.push(` ${d(e)}`),o++;a.push(``)}}a.length===0?console.log(`No agents found.`):(console.log(`${o} active agents\n`),console.log(a.join(`
1
+ import{i as e,o as t,r as n}from"./loadAgentsDir-BL93ulMm.js";import{n as r,t as i}from"./cwd-Cfdf7z7s.js";import{a,i as o,n as s,o as c,r as l,t as u}from"./agentDisplay-CuSHqgZc.js";o(),t(),r();function d(e){let t=a(e),n=[e.agentType];return t&&n.push(t),e.memory&&n.push(`${e.memory} memory`),n.join(` · `)}async function f(){let{allAgents:t}=await e(i()),r=c(t,n(t)),a=[],o=0;for(let{label:e,source:t}of u){let n=r.filter(e=>e.source===t).sort(s);if(n.length!==0){a.push(`${e}:`);for(let e of n)if(e.overriddenBy){let t=l(e.overriddenBy);a.push(` (shadowed by ${t}) ${d(e)}`)}else a.push(` ${d(e)}`),o++;a.push(``)}}a.length===0?console.log(`No agents found.`):(console.log(`${o} active agents\n`),console.log(a.join(`
2
2
  `).trimEnd()))}export{f as agentsHandler};