@readmagic/workmate 0.0.7 → 0.0.8

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 (558) hide show
  1. package/dist/chunks/AddWorkspaceDirectory-CwLtQld4.js +1 -0
  2. package/dist/chunks/App-Ba52HvYC.js +1 -0
  3. package/dist/chunks/{ApproveApiKey-B2HJUD7h.js → ApproveApiKey-CEIfuUh0.js} +1 -1
  4. package/dist/chunks/ApproveApiKey-D2MLQu2P.js +1 -0
  5. package/dist/chunks/BackgroundTasksDialog-IGDrkbWl.js +2 -0
  6. package/dist/chunks/{BypassPermissionsModeDialog-DllL8dxU.js → BypassPermissionsModeDialog-GYhq--JR.js} +1 -1
  7. package/dist/chunks/{ClaudeMdExternalIncludesDialog-BZSyRqeq.js → ClaudeMdExternalIncludesDialog-C-CTa-95.js} +1 -1
  8. package/dist/chunks/ClaudeMdExternalIncludesDialog-Catv6BCJ.js +1 -0
  9. package/dist/chunks/ConsoleOAuthFlow-BeQXqUtX.js +1 -0
  10. package/dist/chunks/{DiffDialog-B7hx8i_Y.js → DiffDialog-AC5DSJrq.js} +6 -6
  11. package/dist/chunks/Doctor-B9Rxsoy0.js +1 -0
  12. package/dist/chunks/Doctor-lhUBhEy5.js +3 -0
  13. package/dist/chunks/ExitFlow-Cu8SoQHs.js +2 -0
  14. package/dist/chunks/Grove-Bc4CofEj.js +11 -0
  15. package/dist/chunks/{HybridTransport-rK83Qijz.js → HybridTransport-BJPOG2wl.js} +3 -3
  16. package/dist/chunks/{InvalidConfigDialog-DdO0AxyF.js → InvalidConfigDialog-BI13il58.js} +1 -1
  17. package/dist/chunks/{InvalidSettingsDialog-s1G0DwXF.js → InvalidSettingsDialog-CtOheV1K.js} +1 -1
  18. package/dist/chunks/MCPConnectionManager-ao-P3xSA.js +1 -0
  19. package/dist/chunks/MCPToolListView-dkofcJs4.js +1 -0
  20. package/dist/chunks/{McpParsingWarnings-Du5IxZos.js → McpParsingWarnings-BS4JoR5l.js} +1 -1
  21. package/dist/chunks/MessageSelector-B88b2ypw.js +3 -0
  22. package/dist/chunks/Messages-BPeI7lLV.js +11 -0
  23. package/dist/chunks/Onboarding-c2fQ8Io_.js +1 -0
  24. package/dist/chunks/{PromptInputFooterSuggestions-BmsFdOu9.js → PromptInputFooterSuggestions-D1cH9sDX.js} +1 -1
  25. package/dist/chunks/{PromptInputHelpMenu-DX-0wEDo.js → PromptInputHelpMenu-DDD5WuK0.js} +1 -1
  26. package/dist/chunks/QueryEngine-Cv_meCam.js +1 -0
  27. package/dist/chunks/REPL-BXhAQOXb.js +139 -0
  28. package/dist/chunks/REPL-YqjLnr3A.js +1 -0
  29. package/dist/chunks/RemoteSessionManager-CT7T8BaR.js +2 -0
  30. package/dist/chunks/ResumeConversation-CIZCjms9.js +1 -0
  31. package/dist/chunks/{SSETransport-5VK5okFv.js → SSETransport-CrwbKuVt.js} +3 -3
  32. package/dist/chunks/SearchExtraToolsTool-Dx6093yw.js +1 -0
  33. package/dist/chunks/Settings-CyUm0AtU.js +2 -0
  34. package/dist/chunks/{TeleportProgress-DxN0bQL2.js → TeleportProgress-C3qyp5zy.js} +1 -1
  35. package/dist/chunks/TeleportRepoMismatchDialog-BV--nyYn.js +1 -0
  36. package/dist/chunks/TeleportResumeWrapper-Blo2cZg-.js +1 -0
  37. package/dist/chunks/ThemePicker-EQ6hPUeI.js +1 -0
  38. package/dist/chunks/TrustDialog-BukWGvHZ.js +1 -0
  39. package/dist/chunks/{ValidationErrorsList-BYsDtAvX.js → ValidationErrorsList-DokTJQwi.js} +1 -1
  40. package/dist/chunks/{WelcomeV2-C1BfrqC5.js → WelcomeV2-Ci9VwPYh.js} +1 -1
  41. package/dist/chunks/{add-dir-DfLYgwox.js → add-dir-DPQV0qml.js} +1 -1
  42. package/dist/chunks/{agentDisplay-CMmHIl86.js → agentDisplay-DBQYOaOh.js} +1 -1
  43. package/dist/chunks/agents-DmybpgDN.js +103 -0
  44. package/dist/chunks/{agents-DE_4mAHG.js → agents-HlKk68Qc.js} +1 -1
  45. package/dist/chunks/allErrors-BPn_2TrB.js +1 -0
  46. package/dist/chunks/analytics-CkYUHW_U.js +1 -0
  47. package/dist/chunks/ant-DjdvlLOo.js +1 -0
  48. package/dist/chunks/api-AMgj1zf_.js +1 -0
  49. package/dist/chunks/api-CF5IVtj0.js +1 -0
  50. package/dist/chunks/{asciicast-CbAjUHT_.js → asciicast-BJNYO5sh.js} +1 -1
  51. package/dist/chunks/asciicast-CH6hdK0a.js +1 -0
  52. package/dist/chunks/auth-CNjDn1VY.js +15 -0
  53. package/dist/chunks/auth-CZzP483s.js +1 -0
  54. package/dist/chunks/auth-DDSBm_Yj.js +1 -0
  55. package/dist/chunks/{autoMode-ZW70mpr0.js → autoMode-Cr0AhS1G.js} +5 -5
  56. package/dist/chunks/{autonomy-CwbWsCnv.js → autonomy-ARUQt-Lu.js} +1 -1
  57. package/dist/chunks/{autonomy-Oui8yK8G.js → autonomy-D4xZLOdJ.js} +7 -7
  58. package/dist/chunks/{autonomyPanel-Mq50H7iM.js → autonomyPanel-BQK9MoeB.js} +1 -1
  59. package/dist/chunks/backgroundHousekeeping--eBgphcg.js +17 -0
  60. package/dist/chunks/backgroundHousekeeping-VV1V_Y2Z.js +1 -0
  61. package/dist/chunks/{banner-CWkrK10u.js → banner-Ca7rki2V.js} +2 -2
  62. package/dist/chunks/bg-BK_9J6F6.js +1 -0
  63. package/dist/chunks/{bg-WnYN5ifx.js → bg-DxRHF1yn.js} +2 -2
  64. package/dist/chunks/{branch-DU5O9KZ0.js → branch-BYq0zpzT.js} +1 -1
  65. package/dist/chunks/{break-cache-C_p7Kmx2.js → break-cache-BKvoMOZx.js} +2 -2
  66. package/dist/chunks/bridgeConfig-C82un7rJ.js +1 -0
  67. package/dist/chunks/{bridgeConfig-CE6dMsiJ.js → bridgeConfig-jDEva6Eh.js} +1 -1
  68. package/dist/chunks/bridgeMessaging-YqYdl6ej.js +1 -0
  69. package/dist/chunks/bridgePointer-DIM0sj0x.js +1 -0
  70. package/dist/chunks/btw-CUV3nRrE.js +1 -0
  71. package/dist/chunks/caches-BZ59_En6.js +1 -0
  72. package/dist/chunks/caches-Cg-HtWKG.js +1 -0
  73. package/dist/chunks/capacityWake-CKOiRELo.js +3 -0
  74. package/dist/chunks/ccrClient-BC2q3k44.js +1 -0
  75. package/dist/chunks/{claudeDesktop-Fe-QL-sN.js → claudeDesktop-DQXL5bGm.js} +1 -1
  76. package/dist/chunks/{clear-D8m2utXW.js → clear-1etSJhdg.js} +1 -1
  77. package/dist/chunks/{cliLaunch-BkPAatcs.js → cliLaunch-CQjLYRzM.js} +1 -1
  78. package/dist/chunks/client-DQXvVKND.js +1 -0
  79. package/dist/chunks/{client-C6MbjvOB.js → client-DQwf_b9o.js} +1 -1
  80. package/dist/chunks/client-DkgC-mFB.js +1 -0
  81. package/dist/chunks/{color-DWhgZH7A.js → color-CBsNbt1s.js} +1 -1
  82. package/dist/chunks/commands-qM5z_Uld.js +1 -0
  83. package/dist/chunks/compact-BclJiRJe.js +2 -0
  84. package/dist/chunks/completionCache-BMHAktkM.js +1 -0
  85. package/dist/chunks/config-CE058cvr.js +3 -0
  86. package/dist/chunks/config-D81avYye.js +1 -0
  87. package/dist/chunks/config-DpOOllGk.js +1 -0
  88. package/dist/chunks/context-noninteractive-Ct_ttQfP.js +29 -0
  89. package/dist/chunks/context-noninteractive-DJb8H_hN.js +1 -0
  90. package/dist/chunks/context-sR9fJmXE.js +1 -0
  91. package/dist/chunks/conversation-D48Kt3ar.js +1 -0
  92. package/dist/chunks/conversation-fOFTa7k5.js +1 -0
  93. package/dist/chunks/{createSSHSession-BOdTAX3N.js → createSSHSession-BmHXA2me.js} +1 -1
  94. package/dist/chunks/createSession-C4rukWkv.js +1 -0
  95. package/dist/chunks/createSession-CSwlW2T2.js +1 -0
  96. package/dist/chunks/crossProjectResume-lDFB2ZcY.js +40 -0
  97. package/dist/chunks/cwd-5Xr-Qka6.js +1 -0
  98. package/dist/chunks/cwd-C5ce-7WB.js +1 -0
  99. package/dist/chunks/{daemon-YtZbMQtn.js → daemon-ZtpTZWgQ.js} +1 -1
  100. package/dist/chunks/{datadog-DqHxqiwY.js → datadog-BJn5ECIu.js} +1 -1
  101. package/dist/chunks/{debug-BrXObCdR.js → debug-RZ4NuXyS.js} +1 -1
  102. package/dist/chunks/debugUtils-D30M1cbN.js +1 -0
  103. package/dist/chunks/{detached-TYk4hMFj.js → detached-jrVP11oU.js} +1 -1
  104. package/dist/chunks/{detectRepository-BPr0VWNO.js → detectRepository-CFiHe6Rv.js} +1 -1
  105. package/dist/chunks/detectRepository-DqQvyj_a.js +1 -0
  106. package/dist/chunks/{diff-CJEKvOA5.js → diff-BKiK3xHv.js} +1 -1
  107. package/dist/chunks/directoryCompletion-BagQcynj.js +1 -0
  108. package/dist/chunks/doctor-BEHYm34V.js +1 -0
  109. package/dist/chunks/{entry-DE0uMIf0.js → entry-BzL1MFQG.js} +4 -4
  110. package/dist/chunks/esm-BLPbfHQd.js +1 -0
  111. package/dist/chunks/{execFileNoThrow-D244NytW.js → execFileNoThrow-CCX-JY8h.js} +1 -1
  112. package/dist/chunks/{execSyncWrapper-CCMQShK-.js → execSyncWrapper-dhRSYGFW.js} +1 -1
  113. package/dist/chunks/exit-DE2YiAhQ.js +1 -0
  114. package/dist/chunks/{lazySchema-DULtBUCI.js → external-CEp-aPkt.js} +1 -1
  115. package/dist/chunks/extraUsage-Dw7AXiH7.js +1 -0
  116. package/dist/chunks/extractMemories-DxTUMiv3.js +1 -0
  117. package/dist/chunks/fast-CHmMkIpE.js +1 -0
  118. package/dist/chunks/fast-uQASHWqR.js +1 -0
  119. package/dist/chunks/fileSuggestions-Dyu2kQtE.js +3 -0
  120. package/dist/chunks/firstPartyEventLogger-D5ohKbIe.js +5 -0
  121. package/dist/chunks/firstPartyEventLogger-LsNY6yOt.js +1 -0
  122. package/dist/chunks/flushGate-Cnsu4HET.js +1 -0
  123. package/dist/chunks/gemini-Cudre91e.js +1 -0
  124. package/dist/chunks/generateRecap-CiFxXlmH.js +1 -0
  125. package/dist/chunks/generateSessionName-DitoBxJT.js +1 -0
  126. package/dist/chunks/{genericProcessUtils-CdQTApYX.js → genericProcessUtils-DVfMHhfy.js} +1 -1
  127. package/dist/chunks/git-BerW9bId.js +6 -0
  128. package/dist/chunks/git-D6dOU2mT.js +1 -0
  129. package/dist/chunks/githubRepoPathMapping-DGr0kJ8D.js +1 -0
  130. package/dist/chunks/{goal-B4GsR54_.js → goal-DuUayfDg.js} +3 -3
  131. package/dist/chunks/grok-tRbmZzEh.js +1 -0
  132. package/dist/chunks/grove-Cv19v6Sv.js +7 -0
  133. package/dist/chunks/help-DkqxbFDM.js +1 -0
  134. package/dist/chunks/{hooks-CkA9bhHl.js → hooks-BZJTWD07.js} +2 -2
  135. package/dist/chunks/hooks-CsP42iOp.js +1 -0
  136. package/dist/chunks/initReplBridge-DdsSWVqN.js +1 -0
  137. package/dist/chunks/{install-Dzlm4u58.js → install-BI---dv0.js} +1 -1
  138. package/dist/chunks/{instrumentation-Yt31gxWN.js → instrumentation-CcWzhGfE.js} +4 -4
  139. package/dist/chunks/{job-BXujwZNa.js → job-B0ftcqPF.js} +1 -1
  140. package/dist/chunks/{jwtUtils-DE2GPUcx.js → jwtUtils-C0cE-1Ey.js} +1 -1
  141. package/dist/chunks/keybindings-DZU3vwo3.js +2 -0
  142. package/dist/chunks/language-DHhXLb_Y.js +1 -0
  143. package/dist/chunks/{language-Ca4B018X.js → language-s-dLbdVz.js} +1 -1
  144. package/dist/chunks/launchLocalMemory-twLxpPvg.js +3 -0
  145. package/dist/chunks/{launchOnboarding-gOVAFEFp.js → launchOnboarding-BWz2XSb9.js} +1 -1
  146. package/dist/chunks/lazySchema-B4D4qJVE.js +1 -0
  147. package/dist/chunks/{loadAgentsDir-x3rlgED4.js → loadAgentsDir-ByO8eJqU.js} +1710 -1977
  148. package/dist/chunks/loadAgentsDir-CMNFLt7R.js +1 -0
  149. package/dist/chunks/loadPluginHooks-BPnxcgrL.js +1 -0
  150. package/dist/chunks/{localSearch-DtplGF-l.js → localSearch-CHHCH16D.js} +1 -1
  151. package/dist/chunks/localSearch-DzQODFap.js +1 -0
  152. package/dist/chunks/log-CZ0zYP_c.js +1 -0
  153. package/dist/chunks/logoV2Utils-CGUJ-5gY.js +1 -0
  154. package/dist/chunks/{magicDocs-qdDB_mKb.js → magicDocs-C5i5ruuU.js} +3 -3
  155. package/dist/chunks/{main-D862LI_d.js → main-BLD4QAQg.js} +2 -2
  156. package/dist/chunks/{main-OWFSddRx.js → main-D4Uk-WUs.js} +87 -84
  157. package/dist/chunks/{managedEnv-Aq5BXfY7.js → managedEnv-C-9XSN14.js} +1 -1
  158. package/dist/chunks/managedEnv-DLVRBaA9.js +1 -0
  159. package/dist/chunks/{mappers-04gNXJ3w.js → mappers-CHRFic5q.js} +1 -1
  160. package/dist/chunks/mcp-BMVdGknC.js +1 -0
  161. package/dist/chunks/mcp-COS5RJFS.js +6 -0
  162. package/dist/chunks/mcp-tGsOW1GN.js +2 -0
  163. package/dist/chunks/memoize-B8hfb1JN.js +1 -0
  164. package/dist/chunks/memory-DR6poqeH.js +1 -0
  165. package/dist/chunks/{mode-DY087x_x.js → mode-QV-NW1Wd.js} +2 -2
  166. package/dist/chunks/model-BF_4ebyl.js +1 -0
  167. package/dist/chunks/{model-D0EfJBuw.js → model-BNU_ulDJ.js} +1 -1
  168. package/dist/chunks/model-CwO-g1RW.js +1 -0
  169. package/dist/chunks/nativeInstaller-B-lNJjM-.js +1 -0
  170. package/dist/chunks/observationStore-BpjlK0pG.js +3 -0
  171. package/dist/chunks/omit-DZCEXri5.js +1 -0
  172. package/dist/chunks/onChangeAppState-BmfM5g-D.js +1 -0
  173. package/dist/chunks/{openai-EYRnUsco.js → openai-DPH6rXOZ.js} +3 -3
  174. package/dist/chunks/{panel-BSZGX6jN.js → panel-mD094ALT.js} +1 -1
  175. package/dist/chunks/{panelCall-dMvRPAGE.js → panelCall-SbffM7G4.js} +1 -1
  176. package/dist/chunks/parser-DrBC8nWp.js +1 -0
  177. package/dist/chunks/{parser-DFwaTGf7.js → parser-dbHRgXb8.js} +1 -1
  178. package/dist/chunks/partition-DKuAFJkc.js +1 -0
  179. package/dist/chunks/{path-D5U-tm91.js → path-Cv9QMBAX.js} +1 -1
  180. package/dist/chunks/permissions-ey-bfanE.js +3 -0
  181. package/dist/chunks/{pidLock-CbC_il6r.js → pidLock-DJnS_38v.js} +2 -2
  182. package/dist/chunks/{pipeTransport-CqCnc-Ys.js → pipeTransport-DVOKR4c_.js} +1 -1
  183. package/dist/chunks/{plan-rsb_83Fo.js → plan-Brg9XnRr.js} +1 -1
  184. package/dist/chunks/{platform-BrYefG_2.js → platform-DCXXznJg.js} +1 -1
  185. package/dist/chunks/plugin-CRwa39Y1.js +17 -0
  186. package/dist/chunks/{pluginAutoupdate-0k03PVff.js → pluginAutoupdate-D0LIP7cy.js} +1 -1
  187. package/dist/chunks/pluginBlocklist-PwHHD3nj.js +1 -0
  188. package/dist/chunks/pluginCliCommands-BJM5Bdpf.js +1 -0
  189. package/dist/chunks/pluginFlagging-pBxSselw.js +1 -0
  190. package/dist/chunks/pluginOperations-C7p_Qr2r.js +2 -0
  191. package/dist/chunks/pluginStartupCheck-C0HqhG6D.js +1 -0
  192. package/dist/chunks/pluginStartupCheck-Di4LjHXf.js +1 -0
  193. package/dist/chunks/{plugins-CQNKZmjP.js → plugins-DUKNjLq6.js} +4 -4
  194. package/dist/chunks/pollConfig-BgpfHQPJ.js +1 -0
  195. package/dist/chunks/{poorMode-CBOtooa0.js → poorMode-CYXmr_mU.js} +1 -1
  196. package/dist/chunks/poorMode-CejPNCp-.js +1 -0
  197. package/dist/chunks/print-gyTOCJzk.js +23 -0
  198. package/dist/chunks/processBashCommand-Cze9vCm6.js +1 -0
  199. package/dist/chunks/processSlashCommand-BRajh1v7.js +5 -0
  200. package/dist/chunks/prompt-B7joRiqj.js +139 -0
  201. package/dist/chunks/prompt-DqSMh2x9.js +1 -0
  202. package/dist/chunks/prompt-Eysh8Et_.js +1 -0
  203. package/dist/chunks/{promptEditor-CyTzyjwG.js → promptEditor-R_acDAgI.js} +2 -2
  204. package/dist/chunks/{protocolHandler-JR8pASdH.js → protocolHandler-RNKkhq91.js} +1 -1
  205. package/dist/chunks/{proxy-CRN7jYIi.js → proxy-BmtEnJ02.js} +1 -1
  206. package/dist/chunks/rcDebugLog-CARUIORE.js +1 -0
  207. package/dist/chunks/reconciler-BfkO6X2X.js +4 -0
  208. package/dist/chunks/refresh-C1X3sptR.js +1 -0
  209. package/dist/chunks/registerProtocol-DoKqmqu2.js +36 -0
  210. package/dist/chunks/{reload-plugins-B9ApSp2m.js → reload-plugins-C0osFcNh.js} +1 -1
  211. package/dist/chunks/remoteBridgeCore-Cddqv2WW.js +1 -0
  212. package/dist/chunks/remoteManagedSettings-B1mnRDmA.js +1 -0
  213. package/dist/chunks/rename-B3tf-YiD.js +1 -0
  214. package/dist/chunks/{renderOptions-BUJB9nAm.js → renderOptions-ChLwxtVu.js} +1 -1
  215. package/dist/chunks/replBridgeHandle-CNwNIijW.js +1 -0
  216. package/dist/chunks/{resume-BicEjsPd.js → resume-Be1G_GBL.js} +2 -2
  217. package/dist/chunks/ripgrep-C2PhTJDh.js +1 -0
  218. package/dist/chunks/{ripgrep-BXmXjAzA.js → ripgrep-gaT9Njwi.js} +1 -1
  219. package/dist/chunks/{runtimeObserver-CiwnPFjK.js → runtimeObserver-CsIwinzh.js} +1 -1
  220. package/dist/chunks/runtimeObserver-Dbxxw4ls.js +10 -0
  221. package/dist/chunks/sandbox-adapter-C6GBuJPB.js +1 -0
  222. package/dist/chunks/sandbox-toggle-jEySONTW.js +1 -0
  223. package/dist/chunks/searchExtraTools-C_UTryh_.js +1 -0
  224. package/dist/chunks/session-DDI1Eb2x.js +2 -0
  225. package/dist/chunks/sessionFileAccessHooks-DfJ7Htfl.js +1 -0
  226. package/dist/chunks/sessionIdCompat-DMayYBrf.js +1 -0
  227. package/dist/chunks/sessionMemory-CQBxPkTQ.js +1 -0
  228. package/dist/chunks/sessionMemory-s0ALUHvc.js +1 -0
  229. package/dist/chunks/sessionMemoryUtils-xt7dTHGC.js +1 -0
  230. package/dist/chunks/sessionObserver-C2sYqWL3.js +1 -0
  231. package/dist/chunks/sessionObserver-DoYc0ZOP.js +20 -0
  232. package/dist/chunks/sessionState-CjNY991n.js +11 -0
  233. package/dist/chunks/sessionStorage-DqsY-7pi.js +1 -0
  234. package/dist/chunks/{sessionTitle-DAnM73S0.js → sessionTitle-B0OYf5nM.js} +3 -3
  235. package/dist/chunks/sessionTracing-CwsXt_uA.js +11 -0
  236. package/dist/chunks/settings-BWtOA9A7.js +1 -0
  237. package/dist/chunks/settings-hQDLwPVj.js +20 -0
  238. package/dist/chunks/settingsSync-DdFagwHV.js +1 -0
  239. package/dist/chunks/setup-DzC22EkN.js +3 -0
  240. package/dist/chunks/{shadowedRuleDetection-C6R5zOUe.js → shadowedRuleDetection-C86PTj1m.js} +1 -1
  241. package/dist/chunks/{shellQuote-DkSy9MYE.js → shellQuote-BUVKMu_P.js} +1 -1
  242. package/dist/chunks/{sideQuestion-hUhxls9r.js → sideQuestion-C780iYwd.js} +3 -3
  243. package/dist/chunks/sinks-5G_xhc1Q.js +1 -0
  244. package/dist/chunks/{sinks-BuE17DeZ.js → sinks-Cftq7Es0.js} +2 -2
  245. package/dist/chunks/skillChangeDetector-plLveEbf.js +1 -0
  246. package/dist/chunks/skillGapStore-Dc1arohs.js +5 -0
  247. package/dist/chunks/skillLifecycle-DP6mY1Kp.js +8 -0
  248. package/dist/chunks/{skillSearchPanel-Cll9ccA5.js → skillSearchPanel-CpLTImaL.js} +4 -4
  249. package/dist/chunks/{skills-BPPeYBy7.js → skills-zGYaYfFV.js} +1 -1
  250. package/dist/chunks/{src-D06Xyj4g.js → src-BN7QRYLl.js} +1 -1
  251. package/dist/chunks/startupProfiler-DCn_NxMH.js +3 -0
  252. package/dist/chunks/startupProfiler-JbpAkfNE.js +1 -0
  253. package/dist/chunks/{state-ix0xIunV.js → state-C2OSZkV1.js} +1 -1
  254. package/dist/chunks/state-DU9lRJ9x.js +1 -0
  255. package/dist/chunks/{stats-CqfF4Axp.js → stats-Duk7_xjQ.js} +1 -1
  256. package/dist/chunks/{status-D4IQpsNK.js → status-CFw-FpZM.js} +2 -2
  257. package/dist/chunks/{status-CC9Q-2Yn.js → status-peiVB_2j.js} +1 -1
  258. package/dist/chunks/statusNoticeHelpers-B5U5c9PE.js +1 -0
  259. package/dist/chunks/{stringUtils-DGLPkqJ4.js → stringUtils-B6FudhoZ.js} +1 -1
  260. package/dist/chunks/switcher-BAMqSX7Z.js +1 -0
  261. package/dist/chunks/switcher-hgBgVzLb.js +1 -0
  262. package/dist/chunks/syncCache-Zl9kZRRl.js +1 -0
  263. package/dist/chunks/{tasks-CZvWJYGr.js → tasks-BxpyRhmD.js} +1 -1
  264. package/dist/chunks/teleport-CwxeD5vL.js +1 -0
  265. package/dist/chunks/{templateJobs-D1BdhZsv.js → templateJobs-DR5fKFiO.js} +1 -1
  266. package/dist/chunks/{terminalSetup-Cn6jeYw1.js → terminalSetup-DgRBt-JJ.js} +1 -1
  267. package/dist/chunks/terminalSetup-DlaFWI81.js +33 -0
  268. package/dist/chunks/{theme-Cg4GNOoQ.js → theme-Bz6esfST.js} +1 -1
  269. package/dist/chunks/{tmux-BY7IdQ1f.js → tmux-DSU9tYIo.js} +1 -1
  270. package/dist/chunks/{toolEventObserver-SFwURL5F.js → toolEventObserver-BSekCkM2.js} +1 -1
  271. package/dist/chunks/toolPool-B7SIoDw5.js +1 -0
  272. package/dist/chunks/{trustedDevice-CKedohmT.js → trustedDevice-B0x9X0fb.js} +1 -1
  273. package/dist/chunks/trustedDevice-CjHQtVkO.js +1 -0
  274. package/dist/chunks/{types-Dut4311z.js → types-D7_37tP2.js} +2 -2
  275. package/dist/chunks/{udsClient-BuCtv7dN.js → udsClient-CHoMMH28.js} +1 -1
  276. package/dist/chunks/{up-BHkC97_C.js → up-B8wBSpLg.js} +1 -1
  277. package/dist/chunks/{updateCCB-C2G-U-qA.js → updateCCB-D_kGQKPT.js} +1 -1
  278. package/dist/chunks/{upstreamproxy-DyR_eXO8.js → upstreamproxy-Hmq-n8fw.js} +1 -1
  279. package/dist/chunks/useExitOnCtrlCDWithKeybindings-Cce612uS.js +1 -0
  280. package/dist/chunks/useMainLoopModel-BICP6_Fi.js +1 -0
  281. package/dist/chunks/useManagePlugins-DtbY_vPL.js +1 -0
  282. package/dist/chunks/useMergedTools-Ckx2IEhF.js +1 -0
  283. package/dist/chunks/{useSearchInput-C5OzQnX6.js → useSearchInput-BAgljZUl.js} +1 -1
  284. package/dist/chunks/useSettingsErrors-CAJR_wpd.js +1 -0
  285. package/dist/chunks/userAgent-BxTG7IMk.js +1 -0
  286. package/dist/chunks/{util-8EHwfg4A.js → util-DDtmyq_r.js} +1 -1
  287. package/dist/chunks/validatePlugin-AHl-g4ct.js +1 -0
  288. package/dist/chunks/{vim-CNDzwoTd.js → vim-kg-mRVbu.js} +1 -1
  289. package/dist/chunks/{which-CKQnSouy.js → which-CHLNJmtJ.js} +1 -1
  290. package/dist/chunks/windowsPaths-Pmx8LDR6.js +1 -0
  291. package/dist/chunks/{windowsPaths-DtapVxOo.js → windowsPaths-o62uq6LF.js} +1 -1
  292. package/dist/chunks/{workSecret-CNWiR2uQ.js → workSecret-DG9shvG0.js} +1 -1
  293. package/dist/chunks/workerRegistry-C7H_lsQX.js +6 -0
  294. package/dist/chunks/worktree-O2p-mJdF.js +1 -0
  295. package/dist/cli.js +1 -1
  296. package/package.json +1 -1
  297. package/dist/chunks/AddWorkspaceDirectory-CFrrXnt9.js +0 -1
  298. package/dist/chunks/App-Buad9Llp.js +0 -1
  299. package/dist/chunks/ApproveApiKey-BQbHdvc3.js +0 -1
  300. package/dist/chunks/AssistantSessionChooser-4lm4eXQ8.js +0 -1
  301. package/dist/chunks/BackgroundTasksDialog-D4qA0M5O.js +0 -2
  302. package/dist/chunks/ClaudeMdExternalIncludesDialog--ywODh81.js +0 -1
  303. package/dist/chunks/ConsoleOAuthFlow-Wkfw7Ts-.js +0 -1
  304. package/dist/chunks/DesktopHandoff-DaP4Riar.js +0 -1
  305. package/dist/chunks/Dialog-vfLXEPed.js +0 -1
  306. package/dist/chunks/Doctor-89OgoAUA.js +0 -1
  307. package/dist/chunks/Doctor-CuKJ-nGt.js +0 -3
  308. package/dist/chunks/ExitFlow-DnPydE17.js +0 -2
  309. package/dist/chunks/Feedback-SmGiR3mf.js +0 -2
  310. package/dist/chunks/Grove-CjN9DO47.js +0 -11
  311. package/dist/chunks/Grove-Cq88VBmM.js +0 -1
  312. package/dist/chunks/ListItem-vfLXEPed.js +0 -1
  313. package/dist/chunks/MCPConnectionManager-NRfIjdlj.js +0 -1
  314. package/dist/chunks/MessageSelector-iIroHvXo.js +0 -3
  315. package/dist/chunks/Messages-D4Hm4gaY.js +0 -11
  316. package/dist/chunks/Onboarding-BiZByBK-.js +0 -1
  317. package/dist/chunks/OverageCreditUpsell-BM7szLgm.js +0 -1
  318. package/dist/chunks/PluginSettings-uY5KTCtK.js +0 -17
  319. package/dist/chunks/QueryEngine-CGYaShXD.js +0 -1
  320. package/dist/chunks/REPL-CRJB2t2z.js +0 -142
  321. package/dist/chunks/REPL-u4Yq29Du.js +0 -1
  322. package/dist/chunks/RemoteCallout-B-tyvQOe.js +0 -1
  323. package/dist/chunks/RemoteSessionManager-DCd0O5_l.js +0 -2
  324. package/dist/chunks/ResumeConversation-DAAXlOCd.js +0 -1
  325. package/dist/chunks/SearchExtraToolsTool-B-7Bworf.js +0 -1
  326. package/dist/chunks/Settings-CUjWlncb.js +0 -2
  327. package/dist/chunks/TeleportRepoMismatchDialog-A5Ss0kuk.js +0 -1
  328. package/dist/chunks/TeleportResumeWrapper-Bz14mUqR.js +0 -1
  329. package/dist/chunks/ThemePicker-CVSRqTzW.js +0 -1
  330. package/dist/chunks/TrustDialog-CY8an_Tg.js +0 -1
  331. package/dist/chunks/TungstenTool-Cb7gJvq4.js +0 -1
  332. package/dist/chunks/TungstenTool-CxMQVCuF.js +0 -1
  333. package/dist/chunks/agents-DJtPfvnL.js +0 -103
  334. package/dist/chunks/allErrors-CQE2k0zO.js +0 -1
  335. package/dist/chunks/analytics-BotDBGh0.js +0 -1
  336. package/dist/chunks/ant-ClQkuQjZ.js +0 -1
  337. package/dist/chunks/api-2cdIPaeq.js +0 -1
  338. package/dist/chunks/api-CG-lhKe-.js +0 -1
  339. package/dist/chunks/asciicast-BsWpcxrc.js +0 -1
  340. package/dist/chunks/assistant-Bje16tQx.js +0 -1
  341. package/dist/chunks/assistant-C83quuNj.js +0 -1
  342. package/dist/chunks/assistant-z2o4-UJe.js +0 -1
  343. package/dist/chunks/auth-DMfEiQrC.js +0 -1
  344. package/dist/chunks/auth-D_cGl8WD.js +0 -1
  345. package/dist/chunks/auth-DqcKPbw8.js +0 -15
  346. package/dist/chunks/backgroundHousekeeping-BpLtI45r.js +0 -1
  347. package/dist/chunks/backgroundHousekeeping-DtJNx4Ja.js +0 -17
  348. package/dist/chunks/bg-B0iMGM9C.js +0 -1
  349. package/dist/chunks/bridge-DNNxtPlz.js +0 -2
  350. package/dist/chunks/bridgeConfig-DP9dD1Cv.js +0 -1
  351. package/dist/chunks/bridgeEnabled-Cc0mGlTb.js +0 -1
  352. package/dist/chunks/bridgeEnabled-D8wP3DWQ.js +0 -1
  353. package/dist/chunks/bridgeMain-CwxMa_pd.js +0 -1
  354. package/dist/chunks/bridgeMain-D11t1BYQ.js +0 -68
  355. package/dist/chunks/bridgeMessaging-DdvApEqW.js +0 -1
  356. package/dist/chunks/bridgePointer-DqHMHa2B.js +0 -1
  357. package/dist/chunks/browser-BmZuQom6.js +0 -1
  358. package/dist/chunks/btw-CejSEdNl.js +0 -1
  359. package/dist/chunks/caches-5HVQSevy.js +0 -3
  360. package/dist/chunks/caches-B-nJoHLM.js +0 -1
  361. package/dist/chunks/capacityWake-CV_x9H8j.js +0 -1
  362. package/dist/chunks/ccrClient-BFyfO67b.js +0 -1
  363. package/dist/chunks/client-DKXCfdde.js +0 -1
  364. package/dist/chunks/client-xxikkAoZ.js +0 -1
  365. package/dist/chunks/commands-CxJpmEKF.js +0 -1
  366. package/dist/chunks/commitAttribution-DM6SBMwl.js +0 -1
  367. package/dist/chunks/commitAttribution-DPnHHKSA.js +0 -2
  368. package/dist/chunks/compact-CblM7306.js +0 -2
  369. package/dist/chunks/completionCache-MN3_MqK8.js +0 -4
  370. package/dist/chunks/completionCache-c4aiyZ_f.js +0 -1
  371. package/dist/chunks/config-BLVBFi5v.js +0 -1
  372. package/dist/chunks/config-CMnqm6Se.js +0 -1
  373. package/dist/chunks/config-DRDuVyzE.js +0 -3
  374. package/dist/chunks/context-CdSMMM-0.js +0 -1
  375. package/dist/chunks/context-noninteractive-CPkf2vB9.js +0 -1
  376. package/dist/chunks/context-noninteractive-DNury4JI.js +0 -54
  377. package/dist/chunks/conversation-DCMw_rsE.js +0 -1
  378. package/dist/chunks/conversation-pUtvc-cE.js +0 -1
  379. package/dist/chunks/createSession-8Ei-Lj7V.js +0 -1
  380. package/dist/chunks/createSession-CjqxVh_Q.js +0 -1
  381. package/dist/chunks/cron-3LntnnhJ.js +0 -1
  382. package/dist/chunks/crossProjectResume-Bj_Pe8oe.js +0 -40
  383. package/dist/chunks/cwd--nvsx73T.js +0 -1
  384. package/dist/chunks/cwd-CYmmnQVS.js +0 -1
  385. package/dist/chunks/debugUtils-NO5KtXqi.js +0 -1
  386. package/dist/chunks/desktop-Z5FAfunZ.js +0 -1
  387. package/dist/chunks/detectRepository-BTPgN89l.js +0 -1
  388. package/dist/chunks/directoryCompletion-CW2ckkQg.js +0 -1
  389. package/dist/chunks/doctor-BA2ZLDTl.js +0 -1
  390. package/dist/chunks/envLessBridgeConfig-B-LKYNvv.js +0 -1
  391. package/dist/chunks/envLessBridgeConfig-DyD9XCda.js +0 -1
  392. package/dist/chunks/esm-5w3xFBnt.js +0 -1
  393. package/dist/chunks/exit-Dt9kHtJO.js +0 -1
  394. package/dist/chunks/extra-usage-C7E2Z1p1.js +0 -1
  395. package/dist/chunks/extra-usage-D0Kkjp-2.js +0 -1
  396. package/dist/chunks/extra-usage-core-DjdaD1qO.js +0 -1
  397. package/dist/chunks/extra-usage-noninteractive-BnD1RhKK.js +0 -1
  398. package/dist/chunks/extraUsage-CpgRTcMk.js +0 -1
  399. package/dist/chunks/extractMemories-DhUprYa7.js +0 -1
  400. package/dist/chunks/fast-C4ZevUNL.js +0 -1
  401. package/dist/chunks/fast-CChxlAAF.js +0 -1
  402. package/dist/chunks/feedback-BIhBhV6n.js +0 -1
  403. package/dist/chunks/file-DcZWPH2V.js +0 -12
  404. package/dist/chunks/fileStateCache-DDW5toIs.js +0 -1
  405. package/dist/chunks/files-Cz1-PK3r.js +0 -2
  406. package/dist/chunks/firstPartyEventLogger-BXY1IJ2D.js +0 -5
  407. package/dist/chunks/firstPartyEventLogger-CnkGSojw.js +0 -1
  408. package/dist/chunks/flushGate-CgHq81Gw.js +0 -1
  409. package/dist/chunks/gemini-C1J-x1g7.js +0 -1
  410. package/dist/chunks/generateRecap-C0jjCg0Z.js +0 -1
  411. package/dist/chunks/generateSessionName-w0BMtwS7.js +0 -1
  412. package/dist/chunks/git-CbcnOf0E.js +0 -1
  413. package/dist/chunks/git-Do0wJvux.js +0 -6
  414. package/dist/chunks/githubRepoPathMapping-8D0kpsif.js +0 -1
  415. package/dist/chunks/grok-ffNyU3Lt.js +0 -1
  416. package/dist/chunks/grove-BQisE2JM.js +0 -7
  417. package/dist/chunks/heapdump-DiCjAPR3.js +0 -5
  418. package/dist/chunks/help-2hn8VK2-.js +0 -1
  419. package/dist/chunks/hooks-CBmrBO-J.js +0 -1
  420. package/dist/chunks/hostGuard-BHI6Q8Mt.js +0 -1
  421. package/dist/chunks/inboundAttachments-C5K3XPTC.js +0 -1
  422. package/dist/chunks/inboundAttachments-IH-g95jo.js +0 -1
  423. package/dist/chunks/index.min-D75yiGLN.js +0 -1
  424. package/dist/chunks/initReplBridge-C-P4dgAG.js +0 -1
  425. package/dist/chunks/keybindings-D8FXoO89.js +0 -2
  426. package/dist/chunks/language-Baosud0X.js +0 -1
  427. package/dist/chunks/launchAgentsPlatform-D6DmNuDt.js +0 -1
  428. package/dist/chunks/launchCommand-1qkTCKpf.js +0 -1
  429. package/dist/chunks/launchLocalMemory-C0FzUq7x.js +0 -3
  430. package/dist/chunks/launchLocalVault-DkYAre4O.js +0 -3
  431. package/dist/chunks/launchMemoryStores-D2rKWAPs.js +0 -1
  432. package/dist/chunks/launchSchedule-IZdFstT_.js +0 -1
  433. package/dist/chunks/launchSkillStore-B7LamM1d.js +0 -1
  434. package/dist/chunks/launchTeleport-C2BQMfYP.js +0 -3
  435. package/dist/chunks/launchVault-C60WUcCI.js +0 -1
  436. package/dist/chunks/loadAgentsDir-B9c3Emvg.js +0 -1
  437. package/dist/chunks/loadPluginHooks-BhNdAjeY.js +0 -1
  438. package/dist/chunks/localSearch-BLCGsdyM.js +0 -1
  439. package/dist/chunks/log-BMCygSzM.js +0 -1
  440. package/dist/chunks/logoV2Utils-gGK9gErT.js +0 -1
  441. package/dist/chunks/managedEnv-BHoeDjpS.js +0 -1
  442. package/dist/chunks/mcp-BSNdwbxR.js +0 -1
  443. package/dist/chunks/mcp-CMnDNI-4.js +0 -6
  444. package/dist/chunks/mcp-D1yA9E56.js +0 -2
  445. package/dist/chunks/memoize-B0zhbT8Z.js +0 -1
  446. package/dist/chunks/memory-D1zbyjxN.js +0 -1
  447. package/dist/chunks/model-CZViyZnE.js +0 -1
  448. package/dist/chunks/model-DLLkVV6S.js +0 -1
  449. package/dist/chunks/nativeInstaller-yj81F75v.js +0 -1
  450. package/dist/chunks/observationStore-DzCdXq8U.js +0 -4
  451. package/dist/chunks/onChangeAppState-DhGKPG9g.js +0 -1
  452. package/dist/chunks/output-style-BM3qAHLA.js +0 -1
  453. package/dist/chunks/overageCreditGrant-Du3dOYVu.js +0 -1
  454. package/dist/chunks/panel-Be-OxtqL.js +0 -1
  455. package/dist/chunks/parser-Bf6iasPV.js +0 -1
  456. package/dist/chunks/partition-C4FWzYVm.js +0 -1
  457. package/dist/chunks/passes-Daz-ARWD.js +0 -1
  458. package/dist/chunks/permissions-CeYKbtSC.js +0 -1
  459. package/dist/chunks/permissions-Cn_6f8CB.js +0 -1
  460. package/dist/chunks/permissions-DF8tAmDF.js +0 -3
  461. package/dist/chunks/plugin-Cm31-nej.js +0 -1
  462. package/dist/chunks/pluginBlocklist-wPFCUPdm.js +0 -1
  463. package/dist/chunks/pluginCliCommands-DhL9LbH0.js +0 -1
  464. package/dist/chunks/pluginFlagging-CAdaFV_D.js +0 -1
  465. package/dist/chunks/pluginOperations-Cs_Z4C6O.js +0 -2
  466. package/dist/chunks/pluginStartupCheck-BRXGKGjG.js +0 -1
  467. package/dist/chunks/pluginStartupCheck-KeU0efTj.js +0 -1
  468. package/dist/chunks/policyLimits-D2s8M8P2.js +0 -1
  469. package/dist/chunks/pollConfig-2nFzv6Hy.js +0 -1
  470. package/dist/chunks/poor-DXumVTR4.js +0 -1
  471. package/dist/chunks/poorMode-yNZL5uYf.js +0 -1
  472. package/dist/chunks/print-uxCF5ka5.js +0 -23
  473. package/dist/chunks/privacy-settings-BncbJCV0.js +0 -1
  474. package/dist/chunks/processBashCommand-CGdwvPmD.js +0 -1
  475. package/dist/chunks/processSlashCommand-DQarepEb.js +0 -5
  476. package/dist/chunks/prompt-BgOdcHkd.js +0 -1
  477. package/dist/chunks/prompt-CE3sFmZV.js +0 -139
  478. package/dist/chunks/prompt-CLJKFebn.js +0 -1
  479. package/dist/chunks/rate-limit-options-C-EqWjeI.js +0 -1
  480. package/dist/chunks/rcDebugLog-DBB9r8aw.js +0 -11
  481. package/dist/chunks/reconciler-CYD_XpG4.js +0 -4
  482. package/dist/chunks/referral-CKmHHxj_.js +0 -1
  483. package/dist/chunks/refresh-ZqZdmLK5.js +0 -1
  484. package/dist/chunks/registerProtocol-wZv2uiW_.js +0 -36
  485. package/dist/chunks/release-notes-B5K7wVqZ.js +0 -4
  486. package/dist/chunks/releaseNotes-B8gbyFFJ.js +0 -2
  487. package/dist/chunks/remote-env-CAt1dHIS.js +0 -1
  488. package/dist/chunks/remoteBridgeCore-Bk3UdSLJ.js +0 -1
  489. package/dist/chunks/remoteManagedSettings-bswzAB6W.js +0 -1
  490. package/dist/chunks/rename-CE_U6KE6.js +0 -1
  491. package/dist/chunks/ripgrep-BfIpz5uC.js +0 -1
  492. package/dist/chunks/runtimeObserver-BrGF5QWX.js +0 -10
  493. package/dist/chunks/sandbox-adapter-BtMiHImm.js +0 -1
  494. package/dist/chunks/sandbox-toggle-D8eebdyI.js +0 -1
  495. package/dist/chunks/sanitization-DV-94a9Z.js +0 -1
  496. package/dist/chunks/searchExtraTools-hLLPuh7c.js +0 -1
  497. package/dist/chunks/semver-BMRJYn3q.js +0 -1
  498. package/dist/chunks/session-BZIlR9Gc.js +0 -2
  499. package/dist/chunks/sessionDiscovery-DfDqTrF1.js +0 -1
  500. package/dist/chunks/sessionFileAccessHooks-Bm8wiqwe.js +0 -1
  501. package/dist/chunks/sessionMemory-D37S0-jX.js +0 -1
  502. package/dist/chunks/sessionMemory-DmlAG3jq.js +0 -1
  503. package/dist/chunks/sessionMemoryUtils-6EWDHSGU.js +0 -1
  504. package/dist/chunks/sessionObserver-BUw2rzKl.js +0 -1
  505. package/dist/chunks/sessionObserver-KgquhGWw.js +0 -20
  506. package/dist/chunks/sessionStorage-CucBSK5Q.js +0 -1
  507. package/dist/chunks/sessionTracing-_Hh5VXxt.js +0 -11
  508. package/dist/chunks/settings-BeLFUeie.js +0 -19
  509. package/dist/chunks/settings-Cl16Haug.js +0 -1
  510. package/dist/chunks/settingsSync-BNvFYH3c.js +0 -1
  511. package/dist/chunks/setup-D8kXv3ts.js +0 -3
  512. package/dist/chunks/sinks-FevoYQqP.js +0 -1
  513. package/dist/chunks/skill-learning-CMdxGtxr.js +0 -5
  514. package/dist/chunks/skillChangeDetector-C65ZLSYV.js +0 -1
  515. package/dist/chunks/skillGapStore-D18LRJAM.js +0 -5
  516. package/dist/chunks/skillGapStore-Ep62R-2_.js +0 -1
  517. package/dist/chunks/skillGenerator-Bc7WwNT8.js +0 -8
  518. package/dist/chunks/skillLearning-Cs9fJgkV.js +0 -1
  519. package/dist/chunks/skillLearning-duPZl69A.js +0 -1
  520. package/dist/chunks/skillPanel-Cyzby746.js +0 -28
  521. package/dist/chunks/slashCommandParsing-RQb_7Xzt.js +0 -1
  522. package/dist/chunks/startupProfiler-DIWVcO4e.js +0 -1
  523. package/dist/chunks/startupProfiler-xa3NmN7Z.js +0 -3
  524. package/dist/chunks/state-BOa-3Av3.js +0 -1
  525. package/dist/chunks/statusNoticeHelpers-CEGvdm5d.js +0 -1
  526. package/dist/chunks/stickers-D5teCKMN.js +0 -1
  527. package/dist/chunks/syncCache-CANQZ9mQ.js +0 -1
  528. package/dist/chunks/systemPromptSections-CR_AoPIX.js +0 -1
  529. package/dist/chunks/systemPromptSections-DN0HGVye.js +0 -1
  530. package/dist/chunks/tag-DDbNqBMu.js +0 -11
  531. package/dist/chunks/teleport-Dk5j03Ix.js +0 -1
  532. package/dist/chunks/terminalSetup-3JNy6i_J.js +0 -33
  533. package/dist/chunks/thinkback-p-vKIRW_.js +0 -1
  534. package/dist/chunks/thinkback-play-DnPTDE8B.js +0 -1
  535. package/dist/chunks/thinkback-rFA1do6F.js +0 -1
  536. package/dist/chunks/toolEventObserver-CzsCuUMc.js +0 -1
  537. package/dist/chunks/toolPool-BR27AMJO.js +0 -1
  538. package/dist/chunks/trustedDevice-BYt39fui.js +0 -1
  539. package/dist/chunks/tui-C2yuCuOU.js +0 -6
  540. package/dist/chunks/types-Bh9S_JG5.js +0 -3
  541. package/dist/chunks/types-DHkZVzJe.js +0 -1
  542. package/dist/chunks/ultrareviewCommand-C_4OSBTW.js +0 -3
  543. package/dist/chunks/undercover-D30rKimg.js +0 -31
  544. package/dist/chunks/undercover-DRSwLozU.js +0 -1
  545. package/dist/chunks/upgrade-Bi-bIz7R.js +0 -1
  546. package/dist/chunks/upgrade-Chs-OQFd.js +0 -1
  547. package/dist/chunks/upload-D8FWMSQx.js +0 -1
  548. package/dist/chunks/usage-BxVeUt60.js +0 -1
  549. package/dist/chunks/usage-DUO7Yy1f.js +0 -1
  550. package/dist/chunks/useExitOnCtrlCDWithKeybindings-BwsZ5f0s.js +0 -1
  551. package/dist/chunks/useMainLoopModel-Gy1Vv4Qr.js +0 -1
  552. package/dist/chunks/useManagePlugins-B11_87VN.js +0 -1
  553. package/dist/chunks/useMergedTools-CR56my9t.js +0 -1
  554. package/dist/chunks/useSettingsErrors-B9vOZL41.js +0 -1
  555. package/dist/chunks/validatePlugin-6q1qmnAC.js +0 -1
  556. package/dist/chunks/windowsPaths-9pEkw0oV.js +0 -1
  557. package/dist/chunks/workerRegistry-CvyHvwx-.js +0 -1
  558. package/dist/chunks/worktree-ogmNCIpz.js +0 -1
@@ -1 +0,0 @@
1
- import{t as e}from"./REPL-CRJB2t2z.js";export{e as REPL};
@@ -1 +0,0 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,P as r,fi as i,t as a}from"./src-CDCSSo0U2.js";import{t as o}from"./jsx-runtime-Bb4Xn-E0.js";import{ax as s,ix as c}from"./loadAgentsDir-x3rlgED4.js";import{b as l,c as u,g as d}from"./config-DRDuVyzE.js";import{Bt as f,Ot as p}from"./model-CZViyZnE.js";import{i as m,r as h}from"./bridgeEnabled-Cc0mGlTb.js";import{n as g,t as _}from"./PermissionDialog-0ya1CU5k.js";function v({onDone:e}){let t=(0,b.useRef)(e);t.current=e;let i=(0,b.useCallback)(()=>{t.current(`dismiss`)},[]);(0,b.useEffect)(()=>{l(e=>e.remoteDialogSeen?e:{...e,remoteDialogSeen:!0})},[]);let a=(0,b.useCallback)(e=>{t.current(e)},[]);return(0,x.jsx)(_,{title:`Remote Control`,children:(0,x.jsxs)(n,{flexDirection:`column`,paddingX:2,paddingY:1,children:[(0,x.jsxs)(n,{marginBottom:1,flexDirection:`column`,children:[(0,x.jsx)(r,{children:`Remote Control lets you access this CLI session from the web (claude.ai/code) or the Claude app, so you can pick up where you left off on any device.`}),(0,x.jsx)(r,{children:` `}),(0,x.jsx)(r,{children:`You can disconnect remote access anytime by running /remote-control again.`})]}),(0,x.jsx)(n,{children:(0,x.jsx)(c,{options:[{label:`Enable Remote Control for this session`,description:`Opens a secure connection to claude.ai.`,value:`enable`},{label:`Never mind`,description:`You can always enable it later with /remote-control.`,value:`dismiss`}],onChange:a,onCancel:i})})]})})}function y(){return!(u().remoteDialogSeen||!m()||!p()?.accessToken)}var b,x,S=e((()=>{b=t(i(),1),h(),a(),f(),d(),s(),g(),x=o()}));export{S as n,y as r,v as t};
@@ -1,2 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{n as r,t as i}from"./defineProperty-C-QyHrDq.js";import{I as a,P as o,di as s,fi as c,j as l,t as u,ui as ee}from"./src-CDCSSo0U2.js";import{t as d}from"./jsx-runtime-Bb4Xn-E0.js";import{Cg as f,Cs as p,DD as m,ED as te,Is as ne,KD as re,Nr as ie,Ol as ae,Ps as oe,Sg as se,Tg as ce,WD as h,_S as g,ax as le,bg as ue,fg as de,fr as _,gb as v,gg as y,ix as b,jr as x,kl as fe,ub as S,vS as pe,vg as me,wg as he,ys as ge}from"./loadAgentsDir-x3rlgED4.js";import{n as _e,t as C}from"./cwd-CYmmnQVS.js";import{C as ve,F as ye,S as w,a as T,l as E,w as D,z as O}from"./debug-BrXObCdR.js";import{$t as k,Xt as A,f as j,g as M,n as N}from"./settings-BeLFUeie.js";import{b as P,c as F,g as I,o as L,y as be}from"./config-DRDuVyzE.js";import{_ as R,d as xe,g as Se,h as Ce}from"./git-Do0wJvux.js";import{n as z,r as we}from"./execFileNoThrow-D244NytW.js";import{o as B,s as V}from"./log-BMCygSzM.js";import{i as H,o as Te}from"./platform-BrYefG_2.js";import{n as Ee,r as De}from"./analytics-BotDBGh0.js";import{l as Oe,u as ke}from"./oauth-BqJqV-2M.js";import{Bt as Ae,Si as je,Vt as Me,_ as Ne,g as Pe,wi as Fe}from"./model-CZViyZnE.js";import{c as Ie,h as Le,l as Re,m as U,s as ze}from"./proxy-CRN7jYIi.js";import{n as Be,o as W}from"./fileStateCache-DDW5toIs.js";import{d as Ve,o as He}from"./api-2cdIPaeq.js";import{c as Ue,u as We}from"./firstPartyEventLogger-BXY1IJ2D.js";import{a as Ge,r as Ke,s as qe,t as Je}from"./referral-CKmHHxj_.js";import{c as Ye,i as Xe}from"./terminalSetup-3JNy6i_J.js";import{n as Ze,t as Qe}from"./PermissionDialog-0ya1CU5k.js";import{n as $e,r as et,t as tt}from"./overageCreditGrant-Du3dOYVu.js";import{i as nt,o as rt}from"./OverageCreditUpsell-BM7szLgm.js";import{n as it,t as at}from"./DesktopHandoff-DaP4Riar.js";import{randomUUID as ot}from"crypto";n(),te(),_e(),I(),k(),we(),R(),B(),We();var st=[/(?:^|\/)(?: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 ct(e){return!st.some(t=>t.test(e))}function lt(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(!ct(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 ut(){if(A.platform===`win32`||!await xe())return[];try{let e=await Ue(),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 z(`git`,[...t,`--author=${e}`],{cwd:C()});r(n)}if(n.size<10){let{stdout:e}=await z(Se(),t,{cwd:C()});r(e)}return lt(Array.from(n.entries()).sort((e,t)=>t[1]-e[1]).map(([e])=>e),5)}catch(e){return V(e),[]}}var dt=10080*60*1e3,ft=t(()=>{let e=L(),t=e.exampleFiles?.length?m(e.exampleFiles):`<filepath>`;return`Try "${m([`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...`])}"`}),pt=t(async()=>{let e=L();Date.now()-(e.exampleFilesGeneratedAt??0)>dt&&(e.exampleFiles=[]),e.exampleFiles?.length||ut().then(e=>{e.length&&be(t=>({...t,exampleFiles:e,exampleFilesGeneratedAt:Date.now()}))})});Fe();var mt={"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 ht(e){let t=e.toLowerCase(),n=je();for(let[e,r]of Object.entries(mt)){let i=r.retirementDates[n];if(!(!t.includes(e)||!i))return{isDeprecated:!0,modelName:r.modelName,retirementDate:i}}return{isDeprecated:!1}}function gt(e){if(!e)return null;let t=ht(e);return t.isDeprecated?`⚠ ${t.modelName} will be retired on ${t.retirementDate}. Consider switching to a newer model.`:null}r(),s(),O(),w(),T(),Te(),ke(),M(),Ae(),Xe(),v(),fe(),x();var G=e(c(),1);u(),Ee(),I(),le(),it(),Ze();var K=d(),_t={enable_shortcut_tip:!1,enable_startup_dialog:!1};function q(){return _t}function vt(){return process.platform===`darwin`||process.platform===`win32`&&process.arch===`x64`}function yt(){if(!vt()||!q().enable_startup_dialog)return!1;let e=F();return!(e.desktopUpsellDismissed||(e.desktopUpsellSeenCount??0)>=3)}function bt({onDone:e}){let[t,n]=(0,G.useState)(!1);if((0,G.useEffect)(()=>{let e=(F().desktopUpsellSeenCount??0)+1;P(t=>(t.desktopUpsellSeenCount??0)>=e?t:{...t,desktopUpsellSeenCount:e}),De(`tengu_desktop_upsell_shown`,{seen_count:e})},[]),t)return(0,K.jsx)(at,{onDone:()=>e()});function r(t){switch(t){case`try`:n(!0);return;case`never`:P(e=>e.desktopUpsellDismissed?e:{...e,desktopUpsellDismissed:!0}),e();return;case`not-now`:e();return}}return(0,K.jsx)(Qe,{title:`Try Claude Code Desktop`,children:(0,K.jsxs)(a,{flexDirection:`column`,paddingX:2,paddingY:1,children:[(0,K.jsx)(a,{marginBottom:1,children:(0,K.jsx)(o,{children:`Same Claude Code with visual diffs, live app preview, parallel sessions, and more.`})}),(0,K.jsx)(b,{options:[{label:`Open in Claude Code Desktop`,value:`try`},{label:`Not now`,value:`not-now`},{label:`Don't ask again`,value:`never`}],onChange:r,onCancel:()=>r(`not-now`)})]})})}Ne(),re(),W(),He(),pe(),me(),oe(),ge(),qe(),et(),nt(),I();function xt(e){let t=F().numStartups;P(n=>{let r=n.tipsHistory??{};return r[e]===t?n:{...n,tipsHistory:{...r,[e]:t}}})}function J(e){let t=F(),n=t.tipsHistory?.[e];return n?t.numStartups-n:1/0}u(),I(),k(),R();var Y;async function St(){return Y===void 0&&(Y=h in await ne()),Y}async function X(e,t,n){if(!await St()||p(`${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&&Be(t.readFileState).some(e=>n.filePath.test(e)))}var Ct=[{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 F().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=F();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=F(),t=j(),n=!!e.lastPlanModeUse,r=!!t?.permissions?.defaultMode;return n&&!r}catch(e){return E(`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=F();return await Ce()<=1&&e.numStartups>50}catch{return!1}}},{id:`color-when-multi-clauding`,content:async()=>`Running multiple Claude sessions? Use /color and /rename to tell them apart at a glance.`,cooldownSessions:10,isRelevant:async()=>!_()&&await ae()>=2},{id:`terminal-setup`,content:async()=>A.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=F();return A.terminal===`Apple_Terminal`?!e.optionAsMetaKeyInstalled:!e.shiftEnterKeyBindingInstalled}},{id:`shift-enter`,content:async()=>A.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=F();return!!((A.terminal===`Apple_Terminal`?e.optionAsMetaKeyInstalled:e.shiftEnterKeyBindingInstalled)&&e.numStartups>3)}},{id:`shift-enter-setup`,content:async()=>A.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(!Ye())return!1;let e=F();return!(A.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 F().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&&ee.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()=>H()===`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()=>j().statusLine===void 0},{id:`prompt-queue`,content:async()=>`Hit Enter to queue up additional messages while Claude is working.`,cooldownSessions:5,async isRelevant(){return F().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 '${A.terminal===`vscode`?`code`:A.terminal}' command in PATH" to enable IDE integration`,cooldownSessions:0,async isRelevant(){if(!f()||H()!==`macos`)return!1;switch(A.terminal){case`vscode`:return!await he();case`cursor`:return!await ue();case`windsurf`:return!await ce();default:return!1}}},{id:`ide-upsell-external-terminal`,content:async()=>`Connect Claude to your IDE · /ide`,cooldownSessions:4,async isRelevant(){return se()||(await y()).length!==0?!1:(await de()).length>0}},{id:`permissions`,content:async()=>`Use /permissions to pre-approve and pre-deny bash, edit, and MCP tools`,cooldownSessions:10,async isRelevant(){return F().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()=>!A.isSSH()},{id:`paste-images-mac`,content:async()=>`Paste images into Work Mate using control+v (not cmd+v!)`,cooldownSessions:10,isRelevant:async()=>H()===`macos`},{id:`double-esc`,content:async()=>`Double-tap esc to rewind the conversation to a previous point in time`,cooldownSessions:10,isRelevant:async()=>!S()},{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()=>S()},{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()=>ie()&&F().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 F().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 F().numStartups>5}},{id:`agent-flag`,content:async()=>`Use --agent <agent_name> to directly start a conversation with a subagent`,cooldownSessions:15,async isRelevant(){return F().numStartups>5}},{id:`desktop-app`,content:async()=>`Run Work Mate locally or remotely using the Claude desktop app: clau.de/desktop`,cooldownSessions:15,isRelevant:async()=>H()!==`linux`},{id:`desktop-shortcut`,content:async e=>`Continue your session in Work Mate Desktop with ${l(`suggestion`,e?.theme??`dark`)(`/desktop`)}`,cooldownSessions:15,isRelevant:async()=>q().enable_shortcut_tip?process.platform===`darwin`||process.platform===`win32`&&process.arch===`x64`:!1},{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(){if(process.env.USER_TYPE===`ant`)return!1;let e=F(),t=Pe()===`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${l(`suggestion`,e?.theme??`dark`)(`/plugin install frontend-design@${h}`)}`,cooldownSessions:3,isRelevant:async e=>X(`frontend-design`,e,{filePath:/\.(html|css|htm)$/i})},{id:`vercel-plugin`,content:async e=>`Working with Vercel? Install the vercel plugin:\n${l(`suggestion`,e?.theme??`dark`)(`/plugin install vercel@${h}`)}`,cooldownSessions:3,isRelevant:async e=>X(`vercel`,e,{filePath:/(?:^|[/\\])vercel\.json$/i,cli:[`vercel`]})},{id:`subagent-fanout-nudge`,content:async e=>`Say ${l(`suggestion`,e?.theme??`dark`)(`"fan out subagents"`)} and Claude sends a team. Each one digs deep so nothing gets missed.`,cooldownSessions:3,isRelevant:async()=>(Me(),!1)},{id:`guest-passes`,content:async e=>{let t=l(`claude`,e?.theme??`dark`),n=Ge();return n?`Share Work Mate and earn ${t(Ke(n))} of extra usage · ${t(`/passes`)}`:`You have free guest passes to share · ${t(`/passes`)}`},cooldownSessions:3,isRelevant:async()=>{if(F().hasVisitedPasses)return!1;let{eligible:e}=Je();return e}},{id:`overage-credit`,content:async e=>{let t=l(`claude`,e?.theme??`dark`),n=$e(),r=n?tt(n):null;return r?`${t(`${r} in extra usage, on us`)} · third-party apps · ${t(`/extra-usage`)}`:``},cooldownSessions:3,isRelevant:async()=>rt()},{id:`feedback-command`,content:async()=>`Use /feedback to help us improve!`,cooldownSessions:15,async isRelevant(){return process.env.USER_TYPE!==`ant`&&F().numStartups>5}}],wt=process.env.USER_TYPE===`ant`?[{id:`important-claudemd`,content:async()=>`[ANT-ONLY] Use "IMPORTANT:" prefix for must-follow CLAUDE.md rules`,cooldownSessions:30,isRelevant:async()=>!0},{id:`skillify`,content:async()=>`[ANT-ONLY] Use /skillify at the end of a workflow to turn it into a reusable skill`,cooldownSessions:15,isRelevant:async()=>!0}]:[];function Tt(){let e=N().spinnerTipsOverride;return e?.tips?.length?e.tips.map((e,t)=>({id:`custom-tip-${t}`,content:async()=>e,cooldownSessions:0,isRelevant:async()=>!0})):[]}async function Et(e){let t=N().spinnerTipsOverride,n=Tt();if(t?.excludeDefault&&n.length>0)return n;let r=[...Ct,...wt],i=await Promise.all(r.map(t=>t.isRelevant?.(e)??Promise.resolve(!0)));return[...r.filter((e,t)=>i[t]).filter(e=>J(e.id)>=e.cooldownSessions),...n]}T(),B(),Le(),Re();var Z=2e3,Q=5,Dt=3e4,$=3,Ot=new Set([4003]);function kt(e){return typeof e!=`object`||!e||!(`type`in e)?!1:typeof e.type==`string`}var At=class{constructor(e,t,n,r){i(this,`sessionId`,void 0),i(this,`orgUuid`,void 0),i(this,`getAccessToken`,void 0),i(this,`callbacks`,void 0),i(this,`ws`,null),i(this,`state`,`closed`),i(this,`reconnectAttempts`,0),i(this,`sessionNotFoundRetries`,0),i(this,`pingInterval`,null),i(this,`reconnectTimer`,null),this.sessionId=e,this.orgUuid=t,this.getAccessToken=n,this.callbacks=r}async connect(){if(this.state===`connecting`){E(`[SessionsWebSocket] Already connecting`);return}this.state=`connecting`;let e=`${Oe().BASE_API_URL.replace(`http`,`ws`)}/v1/sessions/ws/${this.sessionId}/subscribe?organization_uuid=${this.orgUuid}`;E(`[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:Ie(e),tls:U()||void 0});this.ws=n,n.addEventListener(`open`,()=>{E(`[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`);V(e),this.callbacks.onError?.(e)}),n.addEventListener(`close`,e=>{E(`[SessionsWebSocket] Closed: code=${e.code} reason=${e.reason}`),this.handleClose(e.code)}),n.addEventListener(`pong`,()=>{E(`[SessionsWebSocket] Pong received`)})}else{let{default:n}=await import(`./wrapper-K8ZapJVu.js`),r=new n(e,{headers:t,agent:ze(e),...U()});this.ws=r,r.on(`open`,()=>{E(`[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=>{V(Error(`[SessionsWebSocket] Error: ${e.message}`)),this.callbacks.onError?.(e)}),r.on(`close`,(e,t)=>{E(`[SessionsWebSocket] Closed: code=${e} reason=${t.toString()}`),this.handleClose(e)}),r.on(`pong`,()=>{E(`[SessionsWebSocket] Pong received`)})}}handleMessage(e){try{let t=ve(e);kt(t)?this.callbacks.onMessage(t):E(`[SessionsWebSocket] Ignoring message type: ${typeof t==`object`&&t&&`type`in t?String(t.type):`unknown`}`)}catch(e){V(Error(`[SessionsWebSocket] Failed to parse message: ${ye(e)}`))}}handleClose(e){if(this.stopPingInterval(),this.state===`closed`)return;this.ws=null;let t=this.state;if(this.state=`closed`,Ot.has(e)){E(`[SessionsWebSocket] Permanent close code ${e}, not reconnecting`),this.callbacks.onClose?.();return}if(e===4001){if(this.sessionNotFoundRetries++,this.sessionNotFoundRetries>$){E(`[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}`)):(E(`[SessionsWebSocket] Not reconnecting`),this.callbacks.onClose?.())}scheduleReconnect(e,t){this.callbacks.onReconnecting?.(),E(`[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{}},Dt)}stopPingInterval(){this.pingInterval&&(clearInterval(this.pingInterval),this.pingInterval=null)}sendControlResponse(e){if(!this.ws||this.state!==`connected`){V(Error(`[SessionsWebSocket] Cannot send: not connected`));return}E(`[SessionsWebSocket] Sending control response`),this.ws.send(D(e))}sendControlRequest(e){if(!this.ws||this.state!==`connected`){V(Error(`[SessionsWebSocket] Cannot send: not connected`));return}let t={type:`control_request`,request_id:ot(),request:e};E(`[SessionsWebSocket] Sending control request: ${e.subtype}`),this.ws.send(D(t))}isConnected(){return this.state===`connected`}close(){E(`[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(){E(`[SessionsWebSocket] Force reconnecting`),this.reconnectAttempts=0,this.sessionNotFoundRetries=0,this.close(),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},500)}};T(),B(),r();function jt(e){return e.type!==`control_request`&&e.type!==`control_response`&&e.type!==`control_cancel_request`}var Mt=class{constructor(e,t){i(this,`config`,void 0),i(this,`callbacks`,void 0),i(this,`websocket`,null),i(this,`pendingPermissionRequests`,new Map),this.config=e,this.callbacks=t}connect(){E(`[RemoteSessionManager] Connecting to session ${this.config.sessionId}`);let e={onMessage:e=>this.handleMessage(e),onConnected:()=>{E(`[RemoteSessionManager] Connected`),this.callbacks.onConnected?.()},onClose:()=>{E(`[RemoteSessionManager] Disconnected`),this.callbacks.onDisconnected?.()},onReconnecting:()=>{E(`[RemoteSessionManager] Reconnecting`),this.callbacks.onReconnecting?.()},onError:e=>{V(e),this.callbacks.onError?.(e)}};this.websocket=new At(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);E(`[RemoteSessionManager] Permission request cancelled: ${t}`),this.pendingPermissionRequests.delete(t),this.callbacks.onPermissionCancelled?.(t,n?.tool_use_id);return}if(e.type===`control_response`){E(`[RemoteSessionManager] Received control response`);return}jt(e)&&this.callbacks.onMessage(e)}handleControlRequest(e){let t=e.request_id,n=e.request;if(n.subtype===`can_use_tool`)E(`[RemoteSessionManager] Permission request for tool: ${n.tool_name}`),this.pendingPermissionRequests.set(t,n),this.callbacks.onPermissionRequest(n,t);else{E(`[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){E(`[RemoteSessionManager] Sending message to session ${this.config.sessionId}`);let n=await Ve(this.config.sessionId,e,t);return n||V(Error(`[RemoteSessionManager] Failed to send message to session ${this.config.sessionId}`)),n}respondToPermissionRequest(e,t){if(!this.pendingPermissionRequests.get(e)){V(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}}}};E(`[RemoteSessionManager] Sending permission response: ${t.behavior}`),this.websocket?.sendControlResponse(n)}isConnected(){return this.websocket?.isConnected()??!1}cancelSession(){E(`[RemoteSessionManager] Sending interrupt signal`),this.websocket?.sendControlRequest({subtype:`interrupt`})}getSessionId(){return this.config.sessionId}disconnect(){E(`[RemoteSessionManager] Disconnecting`),this.websocket?.close(),this.websocket=null,this.pendingPermissionRequests.clear()}reconnect(){E(`[RemoteSessionManager] Reconnecting WebSocket`),this.websocket?.reconnect()}};function Nt(e,t,n,r=!1,i=!1){return{sessionId:e,getAccessToken:t,orgUuid:n,hasInitialPrompt:r,viewerOnly:i}}export{xt as a,gt as c,J as i,ft as l,Nt as n,bt as o,Et as r,yt as s,Mt as t,pt as u};
@@ -1 +0,0 @@
1
- import{a as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,P as r,Wt as i,dr as a,fi as o,ot as ee,t as s}from"./src-CDCSSo0U2.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{en as l,vr as te}from"./state-ix0xIunV.js";import{$f as u,AC as d,Eb as f,FS as ne,Hr as re,Jn as ie,LS as ae,Nr as oe,Ny as p,PS as m,Pl as h,Py as se,XS as g,Xu as _,Yu as ce,ar as le,ep as ue,fi as de,jr as v,kC as y,kl as b,pi as x,qr as S,ti as fe,wb as C}from"./loadAgentsDir-x3rlgED4.js";import{o as w,s as T}from"./log-BMCygSzM.js";import{n as E,r as D}from"./analytics-BotDBGh0.js";import{u as O}from"./referral-CKmHHxj_.js";import{r as pe}from"./asciicast-CbAjUHT_.js";import{a as me,n as k,s as A}from"./skillChangeDetector-C65ZLSYV.js";import{a as j,i as M,n as N,o as P,r as F,t as I}from"./crossProjectResume-Bj_Pe8oe.js";import{t as L}from"./REPL-CRJB2t2z.js";import{dirname as R}from"path";var z=t(o(),1);g(),l(),P(),f(),u(),s(),O(),E(),m(),d(),M(),b(),p(),N(),w(),v();var B=c();function he(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 V({commands:t,worktreePaths:i,initialTools:o,mcpClients:s,dynamicMcpConfig:c,debug:l,mainThreadAgentDefinition:u,autoConnectIdeFlag:d,strictMcpConfig:f=!1,systemPrompt:p,appendSystemPrompt:m,initialSearchQuery:g,disableSlashCommands:v=!1,forkSession:b,taskListId:w,filterByPr:E,thinkingConfig:O,onTurnComplete:M}){let{rows:N}=ee(),P=ne(e=>e.agentDefinitions),V=ae(),[U,W]=z.useState([]),[_e,G]=z.useState(!0),[ve,ye]=z.useState(!1),[K,be]=z.useState(!1),[q,xe]=z.useState(null),[J,Se]=z.useState(null),Y=z.useRef(null),X=z.useRef(0),Z=z.useMemo(()=>{let e=U.filter(e=>!e.isSidechain);if(E!==void 0){if(E===!0)e=e.filter(e=>e.prNumber!==void 0);else if(typeof E==`number`)e=e.filter(e=>e.prNumber===E);else if(typeof E==`string`){let t=he(E);t!==null&&(e=e.filter(e=>e.prNumber===t))}}return e},[U,E]),Ce=oe();z.useEffect(()=>{S(i).then(e=>{Y.current=e,X.current=e.logs.length,W(e.logs),G(!1)}).catch(e=>{T(e),G(!1)})},[i]);let Q=z.useCallback(e=>{let t=Y.current;!t||t.nextIndex>=t.allStatLogs.length||le(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)})},[]),$=z.useCallback(e=>{G(!0),(e?re():S(i)).then(e=>{Y.current=e,X.current=e.logs.length,W(e.logs)}).catch(e=>{T(e)}).finally(()=>{G(!1)})},[i]),we=z.useCallback(()=>{let e=!K;be(e),$(e)},[K,$]);function Te(){process.exit(1)}async function Ee(t){ye(!0);let n=performance.now(),r=I(t,K,i);if(r.isCrossProject&&!r.isSameRepoWorktree){let e=r.command,t=await a(e);t&&process.stdout.write(t),Se(e);return}try{let r=await se(t,void 0);if(!r)throw Error(`Failed to load conversation`);r.sessionId&&!b?(te(y(r.sessionId),t.fullPath?R(t.fullPath):null),await pe(),await de(),ue(r.sessionId)):b&&r.contentReplacements?.length&&await fe(r.contentReplacements);let{agentDefinition:i}=me(r.agentSetting,u,P);V(e=>({...e,agent:i?.agentType}));let a=k(r.agentName,r.agentColor);if(a&&V(e=>({...e,standaloneAgentContext:a})),h(r.agentName),x(b?{...r,worktreeSession:void 0}:r),b||(A(r.worktreeSession),r.sessionId&&ie()),r.goal&&r.sessionId){let{hydrateGoalFromTranscript:t}=(_(),e(ce)),n=new Map;n.set(r.sessionId,r.goal),t(n,r.sessionId)}D(`tengu_session_resumed`,{entrypoint:`picker`,success:!0,resume_duration_ms:Math.round(performance.now()-n)}),W([]),xe({messages:r.messages,fileHistorySnapshots:r.fileHistorySnapshots,contentReplacements:r.contentReplacements,agentName:r.agentName,agentColor:r.agentColor==="default"?void 0:r.agentColor,mainThreadAgentDefinition:i})}catch(e){throw D(`tengu_session_resumed`,{entrypoint:`picker`,success:!1}),T(e),e}}return J?(0,B.jsx)(ge,{command:J}):q?(0,B.jsx)(L,{debug:l,commands:t,initialTools:o,initialMessages:q.messages,initialFileHistorySnapshots:q.fileHistorySnapshots,initialContentReplacements:q.contentReplacements,initialAgentName:q.agentName,initialAgentColor:q.agentColor,mcpClients:s,dynamicMcpConfig:c,strictMcpConfig:f,systemPrompt:p,appendSystemPrompt:m,mainThreadAgentDefinition:q.mainThreadAgentDefinition,autoConnectIdeFlag:d,disableSlashCommands:v,taskListId:w,thinkingConfig:O,onTurnComplete:M}):_e?(0,B.jsxs)(n,{children:[(0,B.jsx)(C,{}),(0,B.jsx)(r,{children:` Loading conversations…`})]}):ve?(0,B.jsxs)(n,{children:[(0,B.jsx)(C,{}),(0,B.jsx)(r,{children:` Resuming conversation…`})]}):Z.length===0?(0,B.jsx)(H,{}):(0,B.jsx)(j,{logs:Z,maxHeight:N,onCancel:Te,onSelect:Ee,onLogsChanged:Ce?()=>$(K):void 0,onLoadMore:Q,initialSearchQuery:g,showAllProjects:K,onToggleAllProjects:we,onAgenticSearch:F})}function H(){return i(`app:interrupt`,()=>{process.exit(1)},{context:`Global`}),(0,B.jsxs)(n,{flexDirection:`column`,children:[(0,B.jsx)(r,{children:`No conversations found to resume.`}),(0,B.jsx)(r,{dimColor:!0,children:`Press Ctrl+C to exit and start a new conversation.`})]})}function ge({command:e}){return z.useEffect(()=>{let e=setTimeout(()=>{process.exit(0)},100);return()=>clearTimeout(e)},[]),(0,B.jsxs)(n,{flexDirection:`column`,gap:1,children:[(0,B.jsx)(r,{children:`This conversation is from a different directory.`}),(0,B.jsxs)(n,{flexDirection:`column`,children:[(0,B.jsx)(r,{children:`To resume, run:`}),(0,B.jsxs)(r,{children:[` `,e]})]}),(0,B.jsx)(r,{dimColor:!0,children:`(Command copied to clipboard)`})]})}export{V as ResumeConversation};
@@ -1 +0,0 @@
1
- import{JT as e,YT as t}from"./loadAgentsDir-x3rlgED4.js";t();export{e as clearSearchExtraToolsDescriptionCache};
@@ -1,2 +0,0 @@
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-DSxRz_kt.js";import{n as o,t as s}from"./figures-5ThXQEtq.js";import{D as c,Gt as l,H as u,I as d,P as f,T as p,U as ee,Wt as te,Xn as ne,a as re,d as ie,di as m,fi as h,k as ae,n as oe,ot as se,r as ce,t as g,ui as _,x as v,y as le}from"./src-CDCSSo0U2.js";import{t as y}from"./jsx-runtime-Bb4Xn-E0.js";import{en as b,gr as ue,ht as x,qt as de}from"./state-ix0xIunV.js";import{$f as S,$m as fe,$o as C,AE as pe,C as me,Ex as he,F as ge,FS as w,IS as _e,LS as ve,ME as T,Nx as ye,OE as be,PS as xe,Px as Se,Qd as Ce,Qm as E,Qo as we,S as Te,Sg as Ee,Tx as D,XS as O,Xf as k,Zd as De,Zo as A,_g as Oe,ax as ke,fx as j,ix as Ae,jE as je,jr as Me,mr as Ne,px as M,rx as N,v as Pe,vg as Fe}from"./loadAgentsDir-x3rlgED4.js";import{n as Ie,t as Le}from"./cwd-CYmmnQVS.js";import{S as Re,w as ze}from"./debug-BrXObCdR.js";import{Bt as Be,Lt as Ve,Vt as He,Wt as Ue,c as We,g as P,n as Ge,x as F,zt as Ke}from"./settings-BeLFUeie.js";import{a as qe,b as I,c as L,g as Je,i as Ye,m as Xe,o as Ze}from"./config-DRDuVyzE.js";import{o as R,s as Qe}from"./log-BMCygSzM.js";import{n as $e,r as z}from"./analytics-BotDBGh0.js";import{b as et,g as tt}from"./startupProfiler-xa3NmN7Z.js";import{r as nt}from"./permissions-Cn_6f8CB.js";import{Bt as rt,Ft as it,G as at,K as ot,Tr as st,_ as ct,b as lt,et as ut,it as dt,q as ft,rt as pt,tt as mt,wr as B,x as ht}from"./model-CZViyZnE.js";import{r as gt,t as _t}from"./poorMode-CBOtooa0.js";import{u as vt}from"./referral-CKmHHxj_.js";import{i as yt,r as bt}from"./bridgeEnabled-Cc0mGlTb.js";import{a as V,c as H,d as U,i as xt,l as St,n as Ct,o as wt,r as Tt,s as Et,t as Dt,u as W}from"./status-D4IQpsNK.js";import{n as Ot,t as kt}from"./useExitOnCtrlCDWithKeybindings-BwsZ5f0s.js";import{i as At,n as G,r as jt}from"./modalContext-DFjKLCB6.js";import{n as Mt,t as Nt}from"./ThemePicker-CVSRqTzW.js";import{i as Pt,n as Ft,r as It,t as Lt}from"./extraUsage-CpgRTcMk.js";import{n as Rt,t as zt}from"./ClaudeMdExternalIncludesDialog-BZSyRqeq.js";import{t as Bt}from"./SearchBox-vfLXEPed.js";import{n as Vt,t as Ht}from"./useSearchInput-C5OzQnX6.js";import{n as Ut,t as Wt}from"./usage-BxVeUt60.js";import{a as Gt,i as Kt,t as qt}from"./OverageCreditUpsell-BM7szLgm.js";function Jt(){let e=x();return[{label:`Version`,value:`0.0.7`},{label:`Session name`,value:Ne(e)??(0,K.jsx)(f,{dimColor:!0,children:`/rename to add a name`})},{label:`Session ID`,value:e},{label:`cwd`,value:Le()},...Ct(),...Dt()]}function Yt({mainLoopModel:e,mcp:t,theme:n,context:r}){return[{label:`Model`,value:W(e)},...Tt(t.clients,r.options.ideInstallationStatus,n),...wt(t.clients,n),...H(),...St()]}async function Xt(){return[...await xt(),...await V(),...await Et()]}function Zt({value:e}){return Array.isArray(e)?(0,K.jsx)(d,{flexWrap:`wrap`,columnGap:1,flexShrink:99,children:e.map((t,n)=>(0,K.jsxs)(f,{children:[t,n<e.length-1?`,`:``]},n))}):typeof e==`string`?(0,K.jsx)(f,{children:e}):e}function Qt({context:e,diagnosticsPromise:t}){let n=w(e=>e.mainLoopModel),r=w(e=>e.mcp),[i]=u(),a=en.useMemo(()=>[Jt(),Yt({mainLoopModel:n,mcp:r,theme:i,context:e})],[n,r,i,e]),o=jt()?1:void 0;return(0,K.jsxs)(d,{flexDirection:`column`,flexGrow:o,children:[(0,K.jsxs)(d,{flexDirection:`column`,gap:1,flexGrow:o,children:[a.map((e,t)=>e.length>0&&(0,K.jsx)(d,{flexDirection:`column`,children:e.map(({label:e,value:t},n)=>(0,K.jsxs)(d,{flexDirection:`row`,gap:1,flexShrink:0,children:[e!==void 0&&(0,K.jsxs)(f,{bold:!0,children:[e,`:`]}),(0,K.jsx)(Zt,{value:t})]},n))},t)),(0,K.jsx)(tn.Suspense,{fallback:null,children:(0,K.jsx)($t,{promise:t})})]}),(0,K.jsx)(f,{dimColor:!0,children:(0,K.jsx)(j,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})})]})}function $t({promise:e}){let t=(0,tn.use)(e);return t.length===0?null:(0,K.jsxs)(d,{flexDirection:`column`,paddingBottom:1,children:[(0,K.jsx)(f,{bold:!0,children:`System Diagnostics`}),t.map((e,t)=>(0,K.jsxs)(d,{flexDirection:`row`,gap:1,paddingX:1,children:[(0,K.jsx)(f,{color:`error`,children:s.warning}),typeof e==`string`?(0,K.jsx)(f,{wrap:`wrap`,children:e}):e]},t))]})}var en,tn,K,nn=t((()=>{o(),en=n(h(),1),tn=n(h(),1),b(),G(),g(),xe(),Ie(),Me(),U(),M(),K=y()}));function rn({currentVersion:e,onChoice:t}){function n(e){t(e)}function r(){t(`cancel`)}return(0,an.jsxs)(le,{title:`Switch to Stable Channel`,onCancel:r,color:`permission`,hideBorder:!0,hideInputGuide:!0,children:[(0,an.jsxs)(f,{children:[`The stable channel may have an older version than what you're currently running (`,e,`).`]}),(0,an.jsx)(f,{dimColor:!0,children:`How would you like to handle this?`}),(0,an.jsx)(Ae,{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 an,on=t((()=>{h(),g(),N(),an=y()}));function sn(e){return Object.entries(e).map(([e,t])=>({label:t?.name??un,value:e,description:t?.description??dn}))}function cn({initialStyle:e,onComplete:t,onCancel:n,isStandaloneCommand:r}){let[i,a]=(0,ln.useState)([]),[o,s]=(0,ln.useState)(!0);(0,ln.useEffect)(()=>{we(Le()).then(e=>{let t=sn(e);a(t),s(!1)}).catch(()=>{let e=sn(A);a(e),s(!1)})},[]);let c=(0,ln.useCallback)(e=>{t(e)},[t]);return(0,q.jsx)(le,{title:`Preferred output style`,onCancel:n,hideInputGuide:!r,hideBorder:!r,children:(0,q.jsxs)(d,{flexDirection:`column`,gap:1,children:[(0,q.jsx)(d,{marginTop:1,children:(0,q.jsx)(f,{dimColor:!0,children:`This changes how Claude Code communicates with you`})}),o?(0,q.jsx)(f,{dimColor:!0,children:`Loading output styles…`}):(0,q.jsx)(Ae,{options:i,onChange:c,visibleOptionCount:10,defaultValue:e})]})})}var ln,q,un,dn,fn=t((()=>{h(),ln=n(h(),1),C(),g(),Ie(),ke(),q=y(),un=`Default`,dn=`Claude completes coding tasks efficiently and provides concise responses`}));function pn({initialLanguage:e,onComplete:t,onCancel:n}){let[r,i]=(0,mn.useState)(e),[a,o]=(0,mn.useState)((e??``).length);te(`confirm:no`,n,{context:`Settings`});function c(){let e=r?.trim();t(e||void 0)}return(0,J.jsxs)(d,{flexDirection:`column`,gap:1,children:[(0,J.jsx)(f,{children:`Enter your preferred response and voice language:`}),(0,J.jsxs)(d,{flexDirection:`row`,gap:1,children:[(0,J.jsx)(f,{children:s.pointer}),(0,J.jsx)(D,{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)(f,{dimColor:!0,children:`Leave empty for default (English)`})]})}var mn,J,hn=t((()=>{o(),mn=n(h(),1),g(),vt(),he(),J=y()}));function gn({onClose:t,context:n,setTabsHidden:a,onIsSearchModeChange:o,contentHeight:ie}){let{headerFocused:m,focusHeader:h}=re(),oe=jt(),[,ce]=u(),g=ee(),[v,y]=(0,X.useState)(L()),b=Y.useRef(L()),[x,S]=(0,X.useState)(Ge()),fe=Y.useRef(Ge()),[C,me]=(0,X.useState)(x?.outputStyle||`default`),he=Y.useRef(C),[T,ye]=(0,X.useState)(x?.language),xe=Y.useRef(T),[E,we]=(0,X.useState)(0),[D,O]=(0,X.useState)(0),[k,A]=(0,X.useState)(!1),ke=ne(),{rows:Me}=se(),Ne=ie??Math.min(Math.floor(Me*.8),30),M=Math.max(5,Ne-10),N=w(e=>e.mainLoopModel),Fe=w(e=>e.verbose),Ie=w(e=>e.thinkingEnabled),Le=w(e=>pt()?e.fastMode:!1);w(e=>e.promptSuggestionEnabled);let Re=Be(x?.permissions?.defaultMode??`default`),ze=Te()||Pe()===`enabled`,Ve=(Ce(),e(De)).isBriefEntitled(),P=ve(),[Je,R]=(0,X.useState)({}),$e=Y.useRef(Ie),[et]=(0,X.useState)(()=>We(`localSettings`)),[tt]=(0,X.useState)(()=>We(`userSettings`)),rt=Y.useRef(g),it=_e(),[ct]=(0,X.useState)(()=>{let e=it.getState();return{mainLoopModel:e.mainLoopModel,mainLoopModelForSession:e.mainLoopModelForSession,verbose:e.verbose,thinkingEnabled:e.thinkingEnabled,fastMode:e.fastMode,promptSuggestionEnabled:e.promptSuggestionEnabled,isBriefOnly:e.isBriefOnly,replBridgeEnabled:e.replBridgeEnabled,replBridgeOutboundOnly:e.replBridgeOutboundOnly,settings:e.settings}}),[ut]=(0,X.useState)(()=>de()),B=Y.useRef(!1),[vt,bt]=(0,X.useState)(!1),[V,H]=(0,X.useState)(null),{query:U,setQuery:xt,cursorOffset:St}=Vt({isActive:k&&V===null&&!m,onExit:()=>A(!1),onExitUp:h,passthroughCtrlKeys:[`c`,`d`]}),Ct=k&&!m;Y.useEffect(()=>{o?.(Ct)},[Ct,o]);let wt=Oe(n.options.mcpClients),Tt=!i(process.env.CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING),Et=Y.use(pe(!0)),Dt=je(Et),W=qe();function Ot(e){z(`tengu_config_model_changed`,{from_model:N,to_model:e}),P(t=>({...t,mainLoopModel:e,mainLoopModelForSession:null})),R(t=>{let n=ht(e)+(Ft(e,!1,lt())?` · Billed as extra usage`:``);if(`model`in t){let{model:e,...r}=t;return{...r,model:n}}return{...t,model:n}})}function kt(e){I(t=>({...t,verbose:e})),y({...L(),verbose:e}),P(t=>({...t,verbose:e})),R(t=>{if(`verbose`in t){let{verbose:e,...n}=t;return n}return{...t,verbose:e}})}let At=[{id:`autoCompactEnabled`,label:`Auto-compact`,value:v.autoCompactEnabled,type:`boolean`,onChange(e){I(t=>({...t,autoCompactEnabled:e})),y({...L(),autoCompactEnabled:e}),z(`tengu_auto_compact_setting_changed`,{enabled:e})}},{id:`spinnerTipsEnabled`,label:`Show tips`,value:x?.spinnerTipsEnabled??!0,type:`boolean`,onChange(e){F(`localSettings`,{spinnerTipsEnabled:e}),S(t=>({...t,spinnerTipsEnabled:e})),z(`tengu_tips_setting_changed`,{enabled:e})}},{id:`cacheWarningEnabled`,label:`Cache warnings`,value:x?.cacheWarningEnabled??!0,type:`boolean`,onChange(e){F(`localSettings`,{cacheWarningEnabled:e}),S(t=>({...t,cacheWarningEnabled:e})),z(`tengu_cache_warning_setting_changed`,{enabled:e})}},{id:`prefersReducedMotion`,label:`Reduce motion`,value:x?.prefersReducedMotion??!1,type:`boolean`,onChange(e){F(`localSettings`,{prefersReducedMotion:e}),S(t=>({...t,prefersReducedMotion:e})),P(t=>({...t,settings:{...t.settings,prefersReducedMotion:e}})),z(`tengu_reduce_motion_setting_changed`,{enabled:e})}},{id:`thinkingEnabled`,label:`Thinking mode`,value:Ie??!0,type:`boolean`,onChange(e){P(t=>({...t,thinkingEnabled:e})),F(`userSettings`,{alwaysThinkingEnabled:e?void 0:!1}),z(`tengu_thinking_toggled`,{enabled:e})}},...pt()&&mt()?[{id:`fastMode`,label:`Fast mode (${at} only)`,value:!!Le,type:`boolean`,onChange(e){ot(),F(`userSettings`,{fastMode:e?!0:void 0}),e?(P(e=>({...e,mainLoopModel:ft(),mainLoopModelForSession:null,fastMode:!0})),R(e=>({...e,model:ft(),"Fast mode":`ON`}))):(P(e=>({...e,fastMode:!1})),R(e=>({...e,"Fast mode":`OFF`})))}}]:[],{id:`poorMode`,label:`Poor mode (save tokens)`,value:(_t(),e(gt)).isPoorModeActive(),type:`boolean`,onChange(t){(_t(),e(gt)).setPoorMode(t),P(e=>({...e,promptSuggestionEnabled:!t}))}},...process.env.USER_TYPE===`ant`?[{id:`speculationEnabled`,label:`Speculative execution`,value:v.speculationEnabled??!0,type:`boolean`,onChange(e){I(t=>t.speculationEnabled===e?t:{...t,speculationEnabled:e}),y({...L(),speculationEnabled:e}),z(`tengu_speculation_setting_changed`,{enabled:e})}}]:[],...Tt?[{id:`fileCheckpointingEnabled`,label:`Rewind code (checkpoints)`,value:v.fileCheckpointingEnabled,type:`boolean`,onChange(e){I(t=>({...t,fileCheckpointingEnabled:e})),y({...L(),fileCheckpointingEnabled:e}),z(`tengu_file_history_snapshots_setting_changed`,{enabled:e})}}]:[],{id:`verbose`,label:`Verbose output`,value:Fe,type:`boolean`,onChange:kt},{id:`terminalProgressBarEnabled`,label:`Terminal progress bar`,value:v.terminalProgressBarEnabled,type:`boolean`,onChange(e){I(t=>({...t,terminalProgressBarEnabled:e})),y({...L(),terminalProgressBarEnabled:e}),z(`tengu_terminal_progress_bar_setting_changed`,{enabled:e})}},{id:`showTurnDuration`,label:`Show turn duration`,value:v.showTurnDuration,type:`boolean`,onChange(e){I(t=>({...t,showTurnDuration:e})),y({...L(),showTurnDuration:e}),z(`tengu_show_turn_duration_setting_changed`,{enabled:e})}},{id:`defaultPermissionMode`,label:`Default permission mode`,value:Re,options:(()=>{let e=[`default`,`plan`];return[...e,...nt.filter(t=>!e.includes(t))]})(),type:`enum`,onChange(e){let t=Be(e),n=t===`auto`?t:Ke(t)?Ue(t):t,r=F(`userSettings`,{permissions:{...x?.permissions,defaultMode:n}});if(r.error){Qe(r.error);return}S(e=>({...e,permissions:{...e?.permissions,defaultMode:n}})),R(t=>({...t,defaultPermissionMode:e})),z(`tengu_config_changed`,{setting:`defaultPermissionMode`,value:e})}},...ze?[{id:`useAutoModeDuringPlan`,label:`Use auto mode during plan`,value:x?.useAutoModeDuringPlan??!0,type:`boolean`,onChange(e){F(`userSettings`,{useAutoModeDuringPlan:e}),S(t=>({...t,useAutoModeDuringPlan:e})),P(e=>{let t=ge(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:v.respectGitignore,type:`boolean`,onChange(e){I(t=>({...t,respectGitignore:e})),y({...L(),respectGitignore:e}),z(`tengu_respect_gitignore_setting_changed`,{enabled:e})}},...Se()?[{id:`copyOnSelect`,label:`Copy on select`,value:v.copyOnSelect??!0,type:`boolean`,onChange(e){I(t=>({...t,copyOnSelect:e})),y({...L(),copyOnSelect:e}),z(`tengu_config_changed`,{setting:`copyOnSelect`,value:String(e)})}}]:[],W?{id:`autoUpdatesChannel`,label:`Auto-update channel`,value:`disabled`,type:`managedEnum`,onChange(){}}:{id:`autoUpdatesChannel`,label:`Auto-update channel`,value:x?.autoUpdatesChannel??`latest`,type:`managedEnum`,onChange(){}},{id:`theme`,label:`Theme`,value:g,type:`managedEnum`,onChange:ce},{id:`notifChannel`,label:`Local notifications`,value:v.preferredNotifChannel,options:[`auto`,`iterm2`,`terminal_bell`,`iterm2_with_bell`,`kitty`,`ghostty`,`notifications_disabled`],type:`enum`,onChange(e){I(t=>({...t,preferredNotifChannel:e})),y({...L(),preferredNotifChannel:e})}},{id:`taskCompleteNotifEnabled`,label:`Push when idle`,value:v.taskCompleteNotifEnabled??!1,type:`boolean`,onChange(e){I(t=>({...t,taskCompleteNotifEnabled:e})),y({...L(),taskCompleteNotifEnabled:e})}},{id:`inputNeededNotifEnabled`,label:`Push when input needed`,value:v.inputNeededNotifEnabled??!1,type:`boolean`,onChange(e){I(t=>({...t,inputNeededNotifEnabled:e})),y({...L(),inputNeededNotifEnabled:e})}},{id:`agentPushNotifEnabled`,label:`Push when Claude decides`,value:v.agentPushNotifEnabled??!1,type:`boolean`,onChange(e){I(t=>({...t,agentPushNotifEnabled:e})),y({...L(),agentPushNotifEnabled:e})}},{id:`outputStyle`,label:`Output style`,value:C,type:`managedEnum`,onChange:()=>{}},...Ve?[{id:`defaultView`,label:`What you see by default`,value:x?.defaultView===void 0?`default`:String(x.defaultView),options:[`transcript`,`chat`,`default`],type:`enum`,onChange(e){let t=e==="default"?void 0:e;F(`localSettings`,{defaultView:t}),S(e=>({...e,defaultView:t}));let n=t===`chat`;P(e=>e.isBriefOnly===n?e:{...e,isBriefOnly:n}),ue(n),R(t=>({...t,"Default view":e})),z(`tengu_default_view_setting_changed`,{value:t??`unset`})}}]:[],{id:`language`,label:`Language`,value:T??`Default (English)`,type:`managedEnum`,onChange:()=>{}},{id:`editorMode`,label:`Editor mode`,value:v.editorMode===`emacs`?`normal`:v.editorMode||`normal`,options:[`normal`,`vim`],type:`enum`,onChange(e){I(t=>({...t,editorMode:e})),y({...L(),editorMode:e}),z(`tengu_editor_mode_changed`,{mode:e,source:`config_panel`})}},{id:`prStatusFooterEnabled`,label:`Show PR status footer`,value:v.prStatusFooterEnabled??!0,type:`boolean`,onChange(e){I(t=>t.prStatusFooterEnabled===e?t:{...t,prStatusFooterEnabled:e}),y({...L(),prStatusFooterEnabled:e}),z(`tengu_pr_status_footer_setting_changed`,{enabled:e})}},{id:`model`,label:`Model`,value:N===null?`Default (recommended)`:N,type:`managedEnum`,onChange:Ot},...wt?[{id:`diffTool`,label:`Diff tool`,value:v.diffTool??`auto`,options:[`terminal`,`auto`],type:`enum`,onChange(e){I(t=>({...t,diffTool:e})),y({...L(),diffTool:e}),z(`tengu_diff_tool_changed`,{tool:e,source:`config_panel`})}}]:[],...Ee()?[]:[{id:`autoConnectIde`,label:`Auto-connect to IDE (external terminal)`,value:v.autoConnectIde??!1,type:`boolean`,onChange(e){I(t=>({...t,autoConnectIde:e})),y({...L(),autoConnectIde:e}),z(`tengu_auto_connect_ide_changed`,{enabled:e,source:`config_panel`})}}],...Ee()?[{id:`autoInstallIdeExtension`,label:`Auto-install IDE extension`,value:v.autoInstallIdeExtension??!0,type:`boolean`,onChange(e){I(t=>({...t,autoInstallIdeExtension:e})),y({...L(),autoInstallIdeExtension:e}),z(`tengu_auto_install_ide_extension_changed`,{enabled:e,source:`config_panel`})}}]:[],...yt()?[{id:`remoteControlAtStartup`,label:`Enable Remote Control for all sessions`,value:v.remoteControlAtStartup===void 0?`default`:String(v.remoteControlAtStartup),options:[`true`,`false`,`default`],type:`enum`,onChange(e){if(e==="default")I(e=>{if(e.remoteControlAtStartup===void 0)return e;let t={...e};return delete t.remoteControlAtStartup,t}),y({...L(),remoteControlAtStartup:void 0});else{let t=e===`true`;I(e=>e.remoteControlAtStartup===t?e:{...e,remoteControlAtStartup:t}),y({...L(),remoteControlAtStartup:t})}let t=Xe();P(e=>e.replBridgeEnabled===t&&!e.replBridgeOutboundOnly?e:{...e,replBridgeEnabled:t,replBridgeOutboundOnly:!1})}}]:[],...Dt?[{id:`showExternalIncludesDialog`,label:`External CLAUDE.md includes`,value:Ze().hasClaudeMdExternalIncludesApproved?`true`:`false`,type:`managedEnum`,onChange(){}}]:[],...process.env.ANTHROPIC_API_KEY&&!r()?[{id:`apiKey`,label:(0,Z.jsxs)(f,{children:[`Use custom API key: `,(0,Z.jsx)(f,{bold:!0,children:st(process.env.ANTHROPIC_API_KEY)})]}),searchText:`Use custom API key`,value:!!(process.env.ANTHROPIC_API_KEY&&v.customApiKeyResponses?.approved?.includes(st(process.env.ANTHROPIC_API_KEY))),type:`boolean`,onChange(e){I(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=st(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}),y(L())}}]:[]],G=Y.useMemo(()=>{if(!U)return At;let e=U.toLowerCase();return At.filter(t=>t.id.toLowerCase().includes(e)?!0:(`searchText`in t?t.searchText:t.label).toLowerCase().includes(e))},[At,U]);Y.useEffect(()=>{if(E>=G.length){let e=Math.max(0,G.length-1);we(e),O(Math.max(0,e-M+1));return}O(e=>E<e?E:E>=e+M?E-M+1:e)},[G.length,E,M]);let Mt=(0,X.useCallback)(e=>{O(t=>e<t?e:e>=t+M?e-M+1:t)},[M]),Pt=(0,X.useCallback)(()=>{if(V!==null)return;let e=Object.entries(Je).map(([e,t])=>(z(`tengu_config_changed`,{key:e,value:t}),`Set ${e} to ${_.bold(t)}`)),n=r()?void 0:process.env.ANTHROPIC_API_KEY,i=!!(n&&b.current.customApiKeyResponses?.approved?.includes(st(n))),a=!!(n&&v.customApiKeyResponses?.approved?.includes(st(n)));if(i!==a&&(e.push(`${a?`Enabled`:`Disabled`} custom API key`),z(`tengu_config_changed`,{key:`env.ANTHROPIC_API_KEY`,value:a})),v.theme!==b.current.theme&&e.push(`Set theme to ${_.bold(v.theme)}`),v.preferredNotifChannel!==b.current.preferredNotifChannel&&e.push(`Set notifications to ${_.bold(v.preferredNotifChannel)}`),C!==he.current&&e.push(`Set output style to ${_.bold(C)}`),T!==xe.current&&e.push(`Set response language to ${_.bold(T??`Default (English)`)}`),v.editorMode!==b.current.editorMode&&e.push(`Set editor mode to ${_.bold(v.editorMode||`emacs`)}`),v.diffTool!==b.current.diffTool&&e.push(`Set diff tool to ${_.bold(v.diffTool)}`),v.autoConnectIde!==b.current.autoConnectIde&&e.push(`${v.autoConnectIde?`Enabled`:`Disabled`} auto-connect to IDE`),v.autoInstallIdeExtension!==b.current.autoInstallIdeExtension&&e.push(`${v.autoInstallIdeExtension?`Enabled`:`Disabled`} auto-install IDE extension`),v.autoCompactEnabled!==b.current.autoCompactEnabled&&e.push(`${v.autoCompactEnabled?`Enabled`:`Disabled`} auto-compact`),v.respectGitignore!==b.current.respectGitignore&&e.push(`${v.respectGitignore?`Enabled`:`Disabled`} respect .gitignore in file picker`),v.copyOnSelect!==b.current.copyOnSelect&&e.push(`${v.copyOnSelect?`Enabled`:`Disabled`} copy on select`),v.terminalProgressBarEnabled!==b.current.terminalProgressBarEnabled&&e.push(`${v.terminalProgressBarEnabled?`Enabled`:`Disabled`} terminal progress bar`),v.showStatusInTerminalTab!==b.current.showStatusInTerminalTab&&e.push(`${v.showStatusInTerminalTab?`Enabled`:`Disabled`} terminal tab status`),v.showTurnDuration!==b.current.showTurnDuration&&e.push(`${v.showTurnDuration?`Enabled`:`Disabled`} turn duration`),v.remoteControlAtStartup!==b.current.remoteControlAtStartup){let t=v.remoteControlAtStartup===void 0?`Reset Remote Control to default`:`${v.remoteControlAtStartup?`Enabled`:`Disabled`} Remote Control for all sessions`;e.push(t)}x?.autoUpdatesChannel!==fe.current?.autoUpdatesChannel&&e.push(`Set auto-update channel to ${_.bold(x?.autoUpdatesChannel??`latest`)}`),e.length>0?t(e.join(`
2
- `)):t(`Config dialog dismissed`,{display:`system`})},[V,Je,v,N,C,T,x?.autoUpdatesChannel,pt()?x?.fastMode:void 0,t]),Lt=(0,X.useCallback)(()=>{g!==rt.current&&ce(rt.current),I(()=>b.current);let e=et;F(`localSettings`,{spinnerTipsEnabled:e?.spinnerTipsEnabled,prefersReducedMotion:e?.prefersReducedMotion,defaultView:e?.defaultView,outputStyle:e?.outputStyle});let t=tt;F(`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=ct;P(e=>({...e,mainLoopModel:n.mainLoopModel,mainLoopModelForSession:n.mainLoopModelForSession,verbose:n.verbose,thinkingEnabled:n.thinkingEnabled,fastMode:n.fastMode,promptSuggestionEnabled:n.promptSuggestionEnabled,isBriefOnly:n.isBriefOnly,replBridgeEnabled:n.replBridgeEnabled,replBridgeOutboundOnly:n.replBridgeOutboundOnly,settings:n.settings,toolPermissionContext:ge(e.toolPermissionContext)})),de()!==ut&&ue(ut)},[g,ce,et,tt,ct,ut,P]);te(`confirm:no`,(0,X.useCallback)(()=>{V===null&&(B.current&&Lt(),t(`Config dialog dismissed`,{display:`system`}))},[V,Lt,t]),{context:`Settings`,isActive:V===null&&!k&&!m}),te(`settings:close`,Pt,{context:`Settings`,isActive:V===null&&!k&&!m});let Rt=(0,X.useCallback)(()=>{let e=G[E];if(!(!e||!e.onChange)){if(e.type===`boolean`){B.current=!0,e.onChange(!e.value),e.id===`thinkingEnabled`&&(!e.value===$e.current?bt(!1):n.messages.some(e=>e.type===`assistant`)&&bt(!0));return}if(e.id===`theme`||e.id===`model`||e.id===`showExternalIncludesDialog`||e.id===`outputStyle`||e.id===`language`)switch(e.id){case`theme`:H(`Theme`),a(!0);return;case`model`:H(`Model`),a(!0);return;case`showExternalIncludesDialog`:H(`ExternalIncludes`),a(!0);return;case`outputStyle`:H(`OutputStyle`),a(!0);return;case`language`:H(`Language`),a(!0);return}if(e.id===`autoUpdatesChannel`){if(W){H(`EnableAutoUpdates`),a(!0);return}(x?.autoUpdatesChannel??`latest`)===`latest`?(H(`ChannelDowngrade`),a(!0)):(B.current=!0,F(`userSettings`,{autoUpdatesChannel:`latest`,minimumVersion:void 0}),S(e=>({...e,autoUpdatesChannel:`latest`,minimumVersion:void 0})),z(`tengu_autoupdate_channel_changed`,{channel:`latest`}));return}if(e.type===`enum`){B.current=!0;let t=(e.options.indexOf(e.value)+1)%e.options.length;e.onChange(e.options[t]);return}}},[W,G,E,x?.autoUpdatesChannel,a]),Bt=e=>{bt(!1);let t=Math.max(0,Math.min(G.length-1,E+e));we(t),Mt(t)};return l({"select:previous":()=>{E===0?(bt(!1),A(!0),O(0)):Bt(-1)},"select:next":()=>Bt(1),"scroll:lineUp":()=>Bt(-1),"scroll:lineDown":()=>Bt(1),"select:accept":Rt,"select:previousValue":()=>Rt(),"select:nextValue":()=>Rt(),"settings:search":()=>{A(!0),xt(``)}},{context:`Settings`,isActive:V===null&&!k&&!m}),(0,Z.jsx)(d,{flexDirection:`column`,width:`100%`,tabIndex:0,autoFocus:!0,onKeyDown:(0,X.useCallback)(e=>{if(V===null&&!m){if(k){if(e.key===`escape`){e.preventDefault(),U.length>0?xt(``):A(!1);return}(e.key===`return`||e.key===`down`||e.key===`wheeldown`)&&(e.preventDefault(),A(!1),we(0),O(0));return}if(e.key===`left`||e.key===`right`||e.key===`tab`){e.preventDefault(),Rt();return}e.ctrl||e.meta||e.key===`j`||e.key===`k`||e.key===`/`||e.key.length===1&&e.key!==` `&&(e.preventDefault(),A(!0),xt(e.key))}},[V,m,k,U,xt,Rt]),children:V===`Theme`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Nt,{onThemeSelect:e=>{B.current=!0,ce(e),H(null),a(!1)},onCancel:()=>{H(null),a(!1)},hideEscToCancel:!0,skipExitHandling:!0}),(0,Z.jsx)(d,{children:(0,Z.jsx)(f,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(p,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`select`}),(0,Z.jsx)(j,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})})]}):V===`Model`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(It,{initial:N,onSelect:e=>{B.current=!0,Ot(e),H(null),a(!1)},onCancel:()=>{H(null),a(!1)},showFastModeNotice:pt()?Le&&dt(N)&&mt():!1}),(0,Z.jsx)(f,{dimColor:!0,children:(0,Z.jsxs)(p,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(j,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]}):V===`ExternalIncludes`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(zt,{onDone:()=>{H(null),a(!1)},externalIncludes:be(Et)}),(0,Z.jsx)(f,{dimColor:!0,children:(0,Z.jsxs)(p,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(j,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`disable external includes`})]})})]}):V===`OutputStyle`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(cn,{initialStyle:C,onComplete:e=>{B.current=!0,me(e??`default`),H(null),a(!1),F(`localSettings`,{outputStyle:e}),z(`tengu_output_style_changed`,{style:e??`default`,source:`config_panel`,settings_source:`localSettings`})},onCancel:()=>{H(null),a(!1)}}),(0,Z.jsx)(f,{dimColor:!0,children:(0,Z.jsxs)(p,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(j,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]}):V===`Language`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(pn,{initialLanguage:T,onComplete:e=>{B.current=!0,ye(e),H(null),a(!1),F(`userSettings`,{language:e}),z(`tengu_language_changed`,{language:e??`default`,source:`config_panel`})},onCancel:()=>{H(null),a(!1)}}),(0,Z.jsx)(f,{dimColor:!0,children:(0,Z.jsxs)(p,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(j,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]})})]}):V===`EnableAutoUpdates`?(0,Z.jsx)(le,{title:`Enable Auto-Updates`,onCancel:()=>{H(null),a(!1)},hideBorder:!0,hideInputGuide:!0,children:W?.type===`config`?(0,Z.jsx)(Ae,{options:[{label:`Enable with latest channel`,value:`latest`},{label:`Enable with stable channel`,value:`stable`}],onChange:e=>{B.current=!0,H(null),a(!1),I(e=>({...e,autoUpdates:!0})),y({...L(),autoUpdates:!0}),F(`userSettings`,{autoUpdatesChannel:e,minimumVersion:void 0}),S(t=>({...t,autoUpdatesChannel:e,minimumVersion:void 0})),z(`tengu_autoupdate_enabled`,{channel:e})}}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(f,{children:W?.type===`env`?`Auto-updates are controlled by an environment variable and cannot be changed here.`:`Auto-updates are disabled in development builds.`}),W?.type===`env`&&(0,Z.jsxs)(f,{dimColor:!0,children:[`Unset `,W.envVar,` to re-enable auto-updates.`]})]})}):V===`ChannelDowngrade`?(0,Z.jsx)(rn,{currentVersion:`0.0.7`,onChoice:e=>{if(H(null),a(!1),e===`cancel`)return;B.current=!0;let t={autoUpdatesChannel:`stable`};e===`stay`&&(t.minimumVersion=`0.0.7`),F(`userSettings`,t),S(e=>({...e,...t})),z(`tengu_autoupdate_channel_changed`,{channel:`stable`,minimum_version_set:e===`stay`})}}):(0,Z.jsxs)(d,{flexDirection:`column`,gap:1,marginY:oe?void 0:1,children:[(0,Z.jsx)(ae,{query:U,isFocused:k&&!m,isTerminalFocused:ke,cursorOffset:St,placeholder:`Search settings…`}),(0,Z.jsx)(d,{flexDirection:`column`,children:G.length===0?(0,Z.jsxs)(f,{dimColor:!0,italic:!0,children:[`No settings match "`,U,`"`]}):(0,Z.jsxs)(Z.Fragment,{children:[D>0&&(0,Z.jsxs)(f,{dimColor:!0,children:[s.arrowUp,` `,D,` more above`]}),G.slice(D,D+M).map((e,t)=>{let n=D+t===E&&!m&&!k;return(0,Z.jsx)(Y.Fragment,{children:(0,Z.jsxs)(d,{width:`100%`,children:[(0,Z.jsx)(d,{width:44,children:(0,Z.jsxs)(f,{color:n?`suggestion`:void 0,children:[n?s.pointer:` `,` `,e.label]})}),(0,Z.jsx)(d,{flexGrow:1,children:e.type===`boolean`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(f,{color:n?`suggestion`:void 0,children:e.value.toString()}),vt&&e.id===`thinkingEnabled`&&(0,Z.jsxs)(f,{color:`warning`,children:[` `,`Changing thinking mode mid-conversation will increase latency and may reduce quality.`]})]}):e.id===`theme`?(0,Z.jsx)(f,{color:n?`suggestion`:void 0,children:vn[e.value.toString()]??e.value.toString()}):e.id===`notifChannel`?(0,Z.jsx)(f,{color:n?`suggestion`:void 0,children:(0,Z.jsx)(_n,{value:e.value.toString()})}):e.id===`defaultPermissionMode`?(0,Z.jsx)(f,{color:n?`suggestion`:void 0,children:He(e.value)}):e.id===`autoUpdatesChannel`&&W?(0,Z.jsxs)(d,{flexDirection:`column`,children:[(0,Z.jsx)(f,{color:n?`suggestion`:void 0,children:`disabled`}),(0,Z.jsxs)(f,{dimColor:!0,children:[`(`,Ye(W),`)`]})]}):(0,Z.jsx)(f,{color:n?`suggestion`:void 0,children:e.value.toString()})})]})},e.id)}),D+M<G.length&&(0,Z.jsxs)(f,{dimColor:!0,children:[s.arrowDown,` `,G.length-D-M,` more below`]})]})}),m?(0,Z.jsx)(f,{dimColor:!0,children:(0,Z.jsxs)(p,{children:[(0,Z.jsx)(c,{shortcut:`←/→ tab`,action:`switch`}),(0,Z.jsx)(c,{shortcut:`↓`,action:`return`}),(0,Z.jsx)(j,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`close`})]})}):k?(0,Z.jsx)(f,{dimColor:!0,children:(0,Z.jsxs)(p,{children:[(0,Z.jsx)(f,{children:`Type to filter`}),(0,Z.jsx)(c,{shortcut:`Enter/↓`,action:`select`}),(0,Z.jsx)(c,{shortcut:`↑`,action:`tabs`}),(0,Z.jsx)(j,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`clear`})]})}):(0,Z.jsx)(f,{dimColor:!0,children:(0,Z.jsxs)(p,{children:[(0,Z.jsx)(j,{action:`select:accept`,context:`Settings`,fallback:`Space`,description:`change`}),(0,Z.jsx)(j,{action:`settings:close`,context:`Settings`,fallback:`Enter`,description:`save`}),(0,Z.jsx)(j,{action:`settings:search`,context:`Settings`,fallback:`/`,description:`search`}),(0,Z.jsx)(j,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]})})]})})}function _n({value:e}){switch(e){case`auto`:return`Auto`;case`iterm2`:return(0,Z.jsxs)(f,{children:[`iTerm2 `,(0,Z.jsx)(f,{dimColor:!0,children:`(OSC 9)`})]});case`terminal_bell`:return(0,Z.jsxs)(f,{children:[`Terminal Bell `,(0,Z.jsx)(f,{dimColor:!0,children:`(\\a)`})]});case`kitty`:return(0,Z.jsxs)(f,{children:[`Kitty `,(0,Z.jsx)(f,{dimColor:!0,children:`(OSC 99)`})]});case`ghostty`:return(0,Z.jsxs)(f,{children:[`Ghostty `,(0,Z.jsx)(f,{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,vn,yn=t((()=>{g(),Y=n(h(),1),X=n(h(),1),vt(),o(),Je(),B(),m(),Ve(),me(),R(),$e(),bt(),Mt(),xe(),Pt(),ct(),Lt(),Rt(),on(),N(),fn(),hn(),T(),M(),G(),Bt(),Fe(),P(),b(),C(),a(),Ht(),O(),ut(),ye(),Z=y(),vn={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 bn({title:e,limit:t,maxWidth:n,showTimeInReset:r=!0,extraSubtext:i}){let{utilization:a,resets_at:o}=t;if(a===null)return null;let s=`${Math.floor(a)}% used`,c;return o&&(c=`Resets ${tt(o,!0,r)}`),i&&(c=c?`${i} · ${c}`:i),n>=62?(0,Q.jsxs)(d,{flexDirection:`column`,children:[(0,Q.jsx)(f,{bold:!0,children:e}),(0,Q.jsxs)(d,{flexDirection:`row`,gap:1,children:[(0,Q.jsx)(ie,{ratio:a/100,width:50,fillColor:`rate_limit_fill`,emptyColor:`rate_limit_empty`}),(0,Q.jsx)(f,{children:s})]}),c&&(0,Q.jsx)(f,{dimColor:!0,children:c})]}):(0,Q.jsxs)(d,{flexDirection:`column`,children:[(0,Q.jsxs)(f,{children:[(0,Q.jsx)(f,{bold:!0,children:e}),c&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(f,{children:` `}),(0,Q.jsxs)(f,{dimColor:!0,children:[`· `,c]})]})]}),(0,Q.jsx)(ie,{ratio:a/100,width:n,fillColor:`rate_limit_fill`,emptyColor:`rate_limit_empty`}),(0,Q.jsx)(f,{children:s})]})}function xn(){let[e,t]=(0,wn.useState)(null),[n,r]=(0,wn.useState)(null),[i,a]=(0,wn.useState)(!0),{columns:o}=se(),s=o-2,c=Math.min(s,80),l=Cn.useCallback(async()=>{a(!0),r(null);try{let e=await Wt();t(e)}catch(e){Qe(e);let t=e,n=t.response?.data?ze(t.response.data):void 0;r(n?`Failed to load usage data: ${n}`:`Failed to load usage data`)}finally{a(!1)}},[]);if((0,wn.useEffect)(()=>{l()},[l]),te(`settings:retry`,()=>{l()},{context:`Settings`,isActive:!!n&&!i}),n)return(0,Q.jsxs)(d,{flexDirection:`column`,gap:1,children:[(0,Q.jsxs)(f,{color:`error`,children:[`Error: `,n]}),(0,Q.jsx)(f,{dimColor:!0,children:(0,Q.jsxs)(p,{children:[(0,Q.jsx)(j,{action:`settings:retry`,context:`Settings`,fallback:`r`,description:`retry`}),(0,Q.jsx)(j,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]})})]});if(!e)return(0,Q.jsxs)(d,{flexDirection:`column`,gap:1,children:[(0,Q.jsx)(f,{dimColor:!0,children:`Loading usage data…`}),(0,Q.jsx)(f,{dimColor:!0,children:(0,Q.jsx)(j,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})})]});let u=it(),ee=u===`max`||u===`team`||u===null,ne=[{title:`Current session`,limit:e.five_hour},{title:`Current week (all models)`,limit:e.seven_day},...ee?[{title:`Current week (Sonnet only)`,limit:e.seven_day_sonnet}]:[]];return(0,Q.jsxs)(d,{flexDirection:`column`,gap:1,width:`100%`,children:[ne.some(({limit:e})=>e)||(0,Q.jsx)(f,{dimColor:!0,children:`/usage is only available for subscription plans.`}),ne.map(({title:e,limit:t})=>t&&(0,Q.jsx)(bn,{title:e,limit:t,maxWidth:c},e)),e.extra_usage&&(0,Q.jsx)(Sn,{extraUsage:e.extra_usage,maxWidth:c}),Gt()&&(0,Q.jsx)(qt,{maxWidth:c}),(0,Q.jsx)(f,{dimColor:!0,children:(0,Q.jsx)(j,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})})]})}function Sn({extraUsage:e,maxWidth:t}){let n=it();if(!(n===`pro`||n===`max`))return!1;if(!e.is_enabled)return E.isEnabled()?(0,Q.jsxs)(d,{flexDirection:`column`,children:[(0,Q.jsx)(f,{bold:!0,children:Tn}),(0,Q.jsx)(f,{dimColor:!0,children:`Extra usage not enabled · /extra-usage to enable`})]}):null;if(e.monthly_limit===null)return(0,Q.jsxs)(d,{flexDirection:`column`,children:[(0,Q.jsx)(f,{bold:!0,children:Tn}),(0,Q.jsx)(f,{dimColor:!0,children:`Unlimited`})]});if(typeof e.used_credits!=`number`||typeof e.utilization!=`number`)return null;let r=k(e.used_credits/100,2),i=k(e.monthly_limit/100,2),a=new Date,o=new Date(a.getFullYear(),a.getMonth()+1,1);return(0,Q.jsx)(bn,{title:Tn,limit:{utilization:e.utilization,resets_at:o.toISOString()},showTimeInReset:!1,extraSubtext:`${r} / ${i} spent`,maxWidth:t})}var Cn,wn,Q,Tn,En=t((()=>{Cn=n(h(),1),wn=n(h(),1),fe(),S(),rt(),O(),g(),vt(),Ut(),et(),R(),Re(),M(),Kt(),Q=y(),Tn=`Extra usage`}));function Dn({onClose:e,context:t,defaultTab:n}){let[r,i]=(0,On.useState)(n),[a,o]=(0,On.useState)(!1),[s,c]=(0,On.useState)(!1),l=jt(),{rows:u}=At(se()),d=l?u+1:Math.max(15,Math.min(Math.floor(u*.8),30)),[f]=(0,On.useState)(()=>Xt().catch(()=>[]));return Ot(),te(`confirm:no`,()=>{a||e(`Status dialog dismissed`,{display:`system`})},{context:`Settings`,isActive:!a&&!(r===`Config`&&s)}),(0,$.jsx)(v,{color:`permission`,children:(0,$.jsx)(ce,{color:`permission`,selectedTab:r,onTabChange:i,hidden:a,initialHeaderFocused:n!==`Config`,contentHeight:a||l?void 0:d,children:[(0,$.jsx)(oe,{title:`Status`,children:(0,$.jsx)(Qt,{context:t,diagnosticsPromise:f})},`status`),(0,$.jsx)(oe,{title:`Config`,children:(0,$.jsx)(On.Suspense,{fallback:null,children:(0,$.jsx)(gn,{context:t,onClose:e,setTabsHidden:o,onIsSearchModeChange:c,contentHeight:d})})},`config`),(0,$.jsx)(oe,{title:`Usage`,children:(0,$.jsx)(xn,{})},`usage`)]})})}var On,$,kn=t((()=>{h(),On=n(h(),1),vt(),kt(),O(),G(),g(),nn(),yn(),En(),$=y()}));export{kn as n,Dn as t};
@@ -1 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{I as t,P as n,fi as r,t as i,y as a}from"./src-CDCSSo0U2.js";import{t as o}from"./jsx-runtime-Bb4Xn-E0.js";import{Eb as s,ix as c,rx as l,wb as u}from"./loadAgentsDir-x3rlgED4.js";import{f as d,l as f}from"./file-DcZWPH2V.js";import{a as p,r as m}from"./githubRepoPathMapping-8D0kpsif.js";var h=e(r(),1);i(),d(),l(),s();var g=o();function _({targetRepo:e,initialPaths:r,onSelectPath:i,onCancel:o}){let[s,l]=(0,h.useState)(r),[d,_]=(0,h.useState)(null),[v,y]=(0,h.useState)(!1),b=(0,h.useCallback)(async t=>{if(t===`cancel`){o();return}if(y(!0),_(null),await p(t,e)){i(t);return}m(e,t);let n=s.filter(e=>e!==t);l(n),y(!1),_(`${f(t)} no longer contains the correct repository. Select another path.`)},[e,s,i,o]),x=[...s.map(e=>({label:(0,g.jsxs)(n,{children:[`Use `,(0,g.jsx)(n,{bold:!0,children:f(e)})]}),value:e})),{label:`Cancel`,value:`cancel`}];return(0,g.jsx)(a,{title:`Teleport to Repo`,onCancel:o,color:`background`,children:s.length>0?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(t,{flexDirection:`column`,gap:1,children:[d&&(0,g.jsx)(n,{color:`error`,children:d}),(0,g.jsxs)(n,{children:[`Open Claude Code in `,(0,g.jsx)(n,{bold:!0,children:e}),`:`]})]}),v?(0,g.jsxs)(t,{children:[(0,g.jsx)(u,{}),(0,g.jsx)(n,{children:` Validating repository…`})]}):(0,g.jsx)(c,{options:x,onChange:e=>void b(e)})]}):(0,g.jsxs)(t,{flexDirection:`column`,gap:1,children:[d&&(0,g.jsx)(n,{color:`error`,children:d}),(0,g.jsxs)(n,{dimColor:!0,children:[`Run claude --teleport from a checkout of `,e]})]})})}export{_ as TeleportRepoMismatchDialog};
@@ -1 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{D as t,I as n,P as r,T as i,Wt as a,fi as o,hn as s,ot as c,t as l}from"./src-CDCSSo0U2.js";import{t as u}from"./jsx-runtime-Bb4Xn-E0.js";import{en as d,pr as f}from"./state-ix0xIunV.js";import{Eb as p,Sb as m,Sy as h,XS as g,fx as _,hx as v,ix as y,mx as b,px as x,rx as S,vy as C,wb as w,xb as T}from"./loadAgentsDir-x3rlgED4.js";import{F as E,N as D,a as O,l as k,z as A}from"./debug-BrXObCdR.js";import{n as j,r as M}from"./analytics-BotDBGh0.js";import{b as N,m as P}from"./startupProfiler-xa3NmN7Z.js";import{i as F,n as I}from"./detectRepository-BPr0VWNO.js";import{n as L,o as R}from"./api-2cdIPaeq.js";import{u as z}from"./referral-CKmHHxj_.js";var B=e(o(),1);d(),j(),A(),C();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),M(`tengu_teleport_resume_session`,{source:e,session_id:t.id});try{let e=await h(t.id);return f({sessionId:t.id}),n(!1),e}catch(e){let t={message:e instanceof D?e.message:E(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)},[])}}g(),R(),l(),z(),b(),O(),F(),N(),x(),S(),p(),m();var H=u(),U=`Updated`,W=` `;function G({onSelect:e,onCancel:o,isEmbedded:l=!1}){let{rows:u}=c(),[d,f]=(0,B.useState)([]),[p,m]=(0,B.useState)(null),[h,g]=(0,B.useState)(!0),[b,x]=(0,B.useState)(null),[S,C]=(0,B.useState)(!1),[E,D]=(0,B.useState)(!1),[O,A]=(0,B.useState)(1),j=v(`confirm:no`,`Confirmation`,`Esc`),M=(0,B.useCallback)(async()=>{try{g(!0),x(null);let e=await I();m(e),k(`Current repository: ${e||`not detected`}`);let t=await L(),n=t;e&&(n=t.filter(t=>t.repo?`${t.repo.owner.login}/${t.repo.name}`===e:!1),k(`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()});f(r)}catch(e){let t=e instanceof Error?e.message:String(e);k(`Error loading code sessions: ${t}`),x(K(t))}finally{g(!1),C(!1)}},[]),N=()=>{C(!0),M()};a(`confirm:no`,o,{context:`Confirmation`}),s((e,t)=>{if(t.ctrl&&e===`c`){o();return}if(t.ctrl&&e===`r`&&b){N();return}if(b!==null&&t.return){o();return}});let F=(0,B.useCallback)(()=>{D(!0),M()},[D,M]);if(!E)return(0,H.jsx)(T,{onComplete:F});if(h)return(0,H.jsxs)(n,{flexDirection:`column`,padding:1,children:[(0,H.jsxs)(n,{flexDirection:`row`,children:[(0,H.jsx)(w,{}),(0,H.jsx)(r,{bold:!0,children:`Loading Claude Code sessions…`})]}),(0,H.jsx)(r,{dimColor:!0,children:S?`Retrying…`:`Fetching your Claude Code sessions…`})]});if(b)return(0,H.jsxs)(n,{flexDirection:`column`,padding:1,children:[(0,H.jsx)(r,{bold:!0,color:`error`,children:`Error loading Claude Code sessions`}),q(b),(0,H.jsxs)(r,{dimColor:!0,children:[`Press `,(0,H.jsx)(r,{bold:!0,children:`Ctrl+R`}),` to retry · Press `,(0,H.jsx)(r,{bold:!0,children:j}),` to cancel`]})]});if(d.length===0)return(0,H.jsxs)(n,{flexDirection:`column`,padding:1,children:[(0,H.jsxs)(r,{bold:!0,children:[`No Claude Code sessions found`,p&&(0,H.jsxs)(r,{children:[` for `,p]})]}),(0,H.jsx)(n,{marginTop:1,children:(0,H.jsxs)(r,{dimColor:!0,children:[`Press `,(0,H.jsx)(r,{bold:!0,children:j}),` to cancel`]})})]});let R=d.map(e=>({...e,timeString:P(new Date(e.updated_at))})),z=Math.max(7,...R.map(e=>e.timeString.length)),V=R.map(({timeString:e,title:t,id:n})=>({label:`${e.padEnd(z,` `)} ${t}`,value:n})),G=Math.max(1,l?Math.min(d.length,5,u-6-7):Math.min(d.length,u-1-7));return(0,H.jsxs)(n,{flexDirection:`column`,padding:1,height:G+7,children:[(0,H.jsxs)(r,{bold:!0,children:[`Select a session to resume`,d.length>G&&(0,H.jsxs)(r,{dimColor:!0,children:[` `,`(`,O,` of `,d.length,`)`]}),p&&(0,H.jsxs)(r,{dimColor:!0,children:[` (`,p,`)`]}),`:`]}),(0,H.jsxs)(n,{flexDirection:`column`,marginTop:1,flexGrow:1,children:[(0,H.jsx)(n,{marginLeft:2,children:(0,H.jsxs)(r,{bold:!0,children:[U.padEnd(z,` `),W,`Session Title`]})}),(0,H.jsx)(y,{visibleOptionCount:G,options:V,onChange:t=>{let n=d.find(e=>e.id===t);n&&e(n)},onFocus:e=>{let t=V.findIndex(t=>t.value===e);t>=0&&A(t+1)}})]}),(0,H.jsx)(n,{flexDirection:`row`,children:(0,H.jsx)(r,{dimColor:!0,children:(0,H.jsxs)(i,{children:[(0,H.jsx)(t,{shortcut:`↑/↓`,action:`select`}),(0,H.jsx)(t,{shortcut:`Enter`,action:`confirm`}),(0,H.jsx)(_,{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)(n,{marginY:1,flexDirection:`column`,children:(0,H.jsx)(r,{dimColor:!0,children:`Check your internet connection`})});case`auth`:return(0,H.jsx)(n,{marginY:1,flexDirection:`column`,children:(0,H.jsx)(r,{dimColor:!0,children:`Teleport requires a Claude account`})});case`api`:return(0,H.jsx)(n,{marginY:1,flexDirection:`column`,children:(0,H.jsx)(r,{dimColor:!0,children:`Sorry, Claude encountered an error`})});case`other`:return(0,H.jsx)(n,{marginY:1,flexDirection:`row`,children:(0,H.jsx)(r,{dimColor:!0,children:`Sorry, Claude Code encountered an error`})})}}j(),l(),z(),p();function J({onComplete:e,onCancel:t,onError:i,isEmbedded:o=!1,source:s}){let{resumeSession:c,isResuming:l,error:u,selectedSession:d}=V(s);(0,B.useEffect)(()=>{M(`tengu_teleport_started`,{source:s})},[s]);let f=async t=>{let n=await c(t);n?e(n):u&&i&&i(u.message,u.formattedMessage)},p=()=>{M(`tengu_teleport_cancelled`,{}),t()};return a(`app:interrupt`,p,{context:`Global`,isActive:!!u&&!i}),l&&d?(0,H.jsxs)(n,{flexDirection:`column`,padding:1,children:[(0,H.jsxs)(n,{flexDirection:`row`,children:[(0,H.jsx)(w,{}),(0,H.jsx)(r,{bold:!0,children:`Resuming session…`})]}),(0,H.jsxs)(r,{dimColor:!0,children:[`Loading "`,d.title,`"…`]})]}):u&&!i?(0,H.jsxs)(n,{flexDirection:`column`,padding:1,children:[(0,H.jsx)(r,{bold:!0,color:`error`,children:`Failed to resume session`}),(0,H.jsx)(r,{dimColor:!0,children:u.message}),(0,H.jsx)(n,{marginTop:1,children:(0,H.jsxs)(r,{dimColor:!0,children:[`Press `,(0,H.jsx)(r,{bold:!0,children:`Esc`}),` to cancel`]})})]}):(0,H.jsx)(G,{onSelect:f,onCancel:p,isEmbedded:o})}export{J as TeleportResumeWrapper};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{D as t,H as n,I as r,P as i,T as a,U as o,V as s,Wt as c,Xt as l,fi as u,ot as d,t as f}from"./src-CDCSSo0U2.js";import{t as p}from"./jsx-runtime-Bb4Xn-E0.js";import{$S as m,FS as h,Hf as g,LS as _,PS as v,Rf as y,Uf as b,Wf as x,XS as S,ZS as C,gx as w,hx as T,ix as E,mx as D,rx as O,zf as k}from"./loadAgentsDir-x3rlgED4.js";import{g as A,x as j}from"./settings-BeLFUeie.js";import{u as M}from"./referral-CKmHHxj_.js";import{n as N,t as P}from"./useExitOnCtrlCDWithKeybindings-BwsZ5f0s.js";function F({onThemeSelect:e,showIntroText:u=!1,helpText:f=``,showHelpTextBelow:p=!1,hideEscToCancel:m=!1,skipExitHandling:v=!1,onCancel:x}){let[S]=n(),w=o(),{columns:D}=d(),O=g(),k=O===null?b(S):null,{setPreviewTheme:A,savePreview:M,cancelPreview:P}=s(),F=h(e=>e.settings.syntaxHighlightingDisabled)??!1,L=_();l(`ThemePicker`);let R=T(`theme:toggleSyntaxHighlighting`,`ThemePicker`,`ctrl+t`);c(`theme:toggleSyntaxHighlighting`,()=>{if(O===null){let e=!F;j(`userSettings`,{syntaxHighlightingDisabled:e}),L(t=>({...t,settings:{...t.settings,syntaxHighlightingDisabled:e}}))}},{context:`ThemePicker`});let z=N(v?()=>{}: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)(r,{flexDirection:`column`,gap:1,children:[(0,I.jsxs)(r,{flexDirection:`column`,gap:1,children:[u?(0,I.jsx)(i,{children:`Let's get started.`}):(0,I.jsx)(i,{bold:!0,color:`permission`,children:`Theme`}),(0,I.jsxs)(r,{flexDirection:`column`,children:[(0,I.jsx)(i,{bold:!0,children:`Choose the text style that looks best with your terminal`}),f&&!p&&(0,I.jsx)(i,{dimColor:!0,children:f})]}),(0,I.jsx)(E,{options:B,onFocus:e=>{A(e)},onChange:t=>{M(),e(t)},onCancel:v?()=>{P(),x?.()}:async()=>{P(),await C(0)},visibleOptionCount:B.length,defaultValue:w,defaultFocusValue:w})]}),(0,I.jsxs)(r,{flexDirection:`column`,width:`100%`,children:[(0,I.jsx)(r,{flexDirection:`column`,borderTop:!0,borderBottom:!0,borderLeft:!1,borderRight:!1,borderStyle:`dashed`,borderColor:`subtle`,children:(0,I.jsx)(y,{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:D})}),(0,I.jsxs)(i,{dimColor:!0,children:[` `,O===`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 u?V:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(r,{flexDirection:`column`,children:V}),(0,I.jsxs)(r,{marginTop:1,children:[p&&f&&(0,I.jsx)(r,{marginLeft:3,children:(0,I.jsx)(i,{dimColor:!0,children:f})}),!m&&(0,I.jsx)(r,{children:(0,I.jsx)(i,{dimColor:!0,italic:!0,children:z.pending?(0,I.jsxs)(I.Fragment,{children:[`Press `,z.keyName,` again to exit`]}):(0,I.jsxs)(a,{children:[(0,I.jsx)(t,{shortcut:`Enter`,action:`select`}),(0,I.jsx)(t,{shortcut:`Esc`,action:`cancel`})]})})})]})]})}var I,L=e((()=>{u(),P(),S(),f(),w(),M(),D(),v(),m(),A(),O(),x(),k(),I=p()}));export{L as n,F as t};
@@ -1 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{I as t,P as n,Wt as r,fi as i,t as a}from"./src-CDCSSo0U2.js";import{t as o}from"./jsx-runtime-Bb4Xn-E0.js";import{en as s,ur as c}from"./state-ix0xIunV.js";import{$S as l,A_ as u,M_ as d,QS as f,Sw as p,ix as m,rx as h,xw as g}from"./loadAgentsDir-x3rlgED4.js";import{n as _,t as v}from"./cwd-CYmmnQVS.js";import{d as y,p as b}from"./debug-BrXObCdR.js";import{c as x,g as S}from"./settings-BeLFUeie.js";import{g as C,n as w,y as T}from"./config-DRDuVyzE.js";import{n as E,r as D}from"./analytics-BotDBGh0.js";import{bn as O}from"./prompt-CE3sFmZV.js";import{u as k}from"./referral-CKmHHxj_.js";import{n as A,t as j}from"./managedEnvConstants-BPwL2aWI.js";import{n as M,t as N}from"./useExitOnCtrlCDWithKeybindings-BwsZ5f0s.js";import{n as P,t as F}from"./PermissionDialog-0ya1CU5k.js";import{homedir as I}from"os";var L=e(i(),1),R=o();a(),s(),_(),b(),E(),C(),l(),k(),h(),d(),N(),P(),S(),O(),A(),p();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(x(`projectSettings`))&&e.push(`.claude/settings.json`),z(x(`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(g(`projectSettings`))&&e.push(`.claude/settings.json`),V(g(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function U(e){return!!e?.otelHeadersHelper}function W(){let e=[];return U(x(`projectSettings`))&&e.push(`.claude/settings.json`),U(x(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function G(e){return!!e?.apiKeyHelper}function K(){let e=[];return G(x(`projectSettings`))&&e.push(`.claude/settings.json`),G(x(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function q(e){return!!(e?.awsAuthRefresh||e?.awsCredentialExport)}function J(){let e=[];return q(x(`projectSettings`))&&e.push(`.claude/settings.json`),q(x(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function Y(e){return!!e?.gcpAuthRefresh}function X(){let e=[];return Y(x(`projectSettings`))&&e.push(`.claude/settings.json`),Y(x(`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(x(`projectSettings`))&&e.push(`.claude/settings.json`),Z(x(`localSettings`))&&e.push(`.claude/settings.local.json`),e}O();function $({onDone:e,commands:i}){let{servers:a}=u(`project`),o=Object.keys(a).length>0,s=B().length>0,l=H(),d=K().length>0,p=J().length>0,h=X().length>0,g=W().length>0,_=Q().length>0,b=i?.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=i?.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=l.length>0||b||x,C=w(),[E,O]=L.useState(null);L.useEffect(()=>{if(E!==null){let e=E,t=setTimeout(()=>f(e));return()=>clearTimeout(t)}},[E]),L.useEffect(()=>{D(`tengu_trust_dialog_shown`,{isHomeDir:I()===v(),hasMcpServers:o,hasHooks:s,hasBashExecution:S,hasApiKeyHelper:d,hasAwsCommands:p,hasGcpCommands:h,hasOtelHeadersHelper:g,hasDangerousEnvVars:_})},[o,s,S,d,p,h,g,_]);function k(t){if(t===`exit`){O(1);return}let n=I()===v();D(`tengu_trust_dialog_accept`,{isHomeDir:n,hasMcpServers:o,hasHooks:s,hasBashExecution:S,hasApiKeyHelper:d,hasAwsCommands:p,hasGcpCommands:h,hasOtelHeadersHelper:g,hasDangerousEnvVars:_}),n?c(!0):T(e=>({...e,hasTrustDialogAccepted:!0})),e()}let A=M(()=>O(1));return r(`confirm:no`,()=>{O(0)},{context:`Confirmation`}),E===null?C?(setTimeout(e),null):(0,R.jsx)(F,{color:`warning`,titleColor:`warning`,title:`Accessing workspace:`,children:(0,R.jsxs)(t,{flexDirection:`column`,gap:1,paddingTop:1,children:[(0,R.jsx)(n,{bold:!0,children:y().cwd()}),(0,R.jsx)(n,{children:`Is this a project you trust? (Your own code, a well-known open source project, or work from your team).`}),(0,R.jsx)(n,{children:`Once trusted, Work Mate can read, edit, and run commands in this folder.`}),(0,R.jsx)(m,{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)(n,{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 +0,0 @@
1
- import{i as e,n as t,r as n}from"./TungstenTool-CxMQVCuF.js";n();export{t as clearSessionsWithTungstenUsage,e as resetInitializationState};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";var t,n,r,i=e((()=>{t={name:`TungstenTool`,isEnabled:()=>!1},n=()=>{},r=()=>{}}));export{r as i,n,i as r,t};
@@ -1,103 +0,0 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,o as r}from"./envUtils-DSxRz_kt.js";import{n as i,t as a}from"./figures-5ThXQEtq.js";import{C as o,D as s,I as c,P as l,T as u,Wt as d,di as f,fi as p,t as m,ui as h,y as g}from"./src-CDCSSo0U2.js";import{t as _}from"./jsx-runtime-Bb4Xn-E0.js";import{$d as v,Bd as y,CE as b,Cf as ee,Ch as x,Eb as te,Ef as S,Ex as C,FD as ne,FS as re,Fd as ie,Fw as ae,Gd as oe,HT as se,Hn as ce,Hu as le,Id as ue,Iw as de,Kd as fe,LS as pe,Mg as me,Mh as he,Mo as ge,Nc as _e,PD as ve,PS as ye,Pc as be,Ph as xe,Sh as Se,Tf as Ce,Tx as we,Ud as Te,Un as Ee,Uu as De,Vo as Oe,Wd as ke,Wn as Ae,_f as je,at as Me,ax as Ne,b_ as Pe,c as Fe,cC as Ie,du as Le,ef as Re,eh as ze,et as Be,ff as Ve,fx as w,gf as He,ho as Ue,ix as We,jg as Ge,jh as Ke,l as qe,nh as Je,nt as Ye,nv as Xe,o as Ze,pf as Qe,px as T,qd as $e,r as et,s as tt,sC as nt,st as rt,t as it,tv as at,uu as ot,vf as st,wE as ct,wb as lt,wf as ut,xh as dt,y_ as ft,yf as pt,zd as mt}from"./loadAgentsDir-x3rlgED4.js";import{n as ht,t as gt}from"./cwd-CYmmnQVS.js";import{C as _t,G as vt,I as yt,Q as bt,S as xt,W as St,z as Ct}from"./debug-BrXObCdR.js";import{dn as wt,dt as Tt,en as Et,et as Dt,it as Ot,nn as kt,pn as At,ut as jt,vn as Mt,yn as Nt}from"./settings-BeLFUeie.js";import{I as Pt,P as Ft}from"./config-DRDuVyzE.js";import{o as It,s as Lt}from"./log-BMCygSzM.js";import{n as Rt,r as zt}from"./analytics-BotDBGh0.js";import{T as Bt,b as Vt}from"./startupProfiler-xa3NmN7Z.js";import{l as Ht,n as Ut,o as Wt}from"./stringUtils-DGLPkqJ4.js";import{Tn as Gt,wn as Kt}from"./prompt-CE3sFmZV.js";import{st as qt}from"./rcDebugLog-DBB9r8aw.js";import{u as E}from"./referral-CKmHHxj_.js";import{r as Jt,t as Yt}from"./TungstenTool-CxMQVCuF.js";import{a as Xt,i as Zt,n as Qt,o as $t,r as en,t as tn}from"./agentDisplay-CMmHIl86.js";import{n as nn,t as rn}from"./useExitOnCtrlCDWithKeybindings-BwsZ5f0s.js";import{n as an,t as on}from"./useMergedTools-CR56my9t.js";import{n as sn,r as cn,t as ln}from"./promptEditor-CyTzyjwG.js";import{n as un,t as dn}from"./useMainLoopModel-Gy1Vv4Qr.js";import{join as D}from"path";import{mkdir as fn,open as pn,unlink as mn}from"fs/promises";var O,hn=e((()=>{O={FOLDER_NAME:`.claude`,AGENTS_DIR:`agents`}}));function gn(e,t,n,r,i,a,o){return`---
2
- name: ${e}
3
- description: "${t.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`).replace(/\n/g,`\\\\n`)}"${n===void 0||n.length===1&&n[0]===`*`?``:`\ntools: ${n.join(`, `)}`}${a?`\nmodel: ${a}`:``}${i?`\ncolor: ${i}`:``}${o?`\nmemory: ${o}`:``}
4
- ---
5
-
6
- ${r}
7
- `}function _n(e){switch(e){case`flagSettings`:throw Error(`Cannot get directory path for ${e} agents`);case`userSettings`:return D(n(),O.AGENTS_DIR);case`projectSettings`:return D(gt(),O.FOLDER_NAME,O.AGENTS_DIR);case`policySettings`:return D(Et(),O.FOLDER_NAME,O.AGENTS_DIR);case`localSettings`:return D(gt(),O.FOLDER_NAME,O.AGENTS_DIR)}}function vn(e){switch(e){case`projectSettings`:return D(`.`,O.FOLDER_NAME,O.AGENTS_DIR);default:return _n(e)}}function yn(e){return D(_n(e.source),`${e.agentType}.md`)}function bn(e){if(e.source===`built-in`)return`Built-in`;if(e.source===`plugin`)throw Error(`Cannot get file path for plugin agents`);return D(_n(e.source),`${e.filename||e.agentType}.md`)}function xn(e){return e.source===`built-in`?`Built-in`:D(vn(e.source),`${e.agentType}.md`)}function Sn(e){return tt(e)?`Built-in`:qe(e)?`Plugin: ${e.plugin||`Unknown`}`:e.source===`flagSettings`?`CLI argument`:D(vn(e.source),`${e.filename||e.agentType}.md`)}async function Cn(e){let t=_n(e);return await fn(t,{recursive:!0}),t}async function wn(e,t,n,r,i,a=!0,o,s,c){if(e===`built-in`)throw Error(`Cannot save built-in agents`);await Cn(e);let l=yn({source:e,agentType:t}),u=gn(t,n,r,i,o,s,c);try{await Dn(l,u,a?`wx`:`w`)}catch(e){throw yt(e)===`EEXIST`?Error(`Agent file already exists: ${l}`):e}}async function Tn(e,t,n,r,i,a,o){if(e.source===`built-in`)throw Error(`Cannot update built-in agents`);await Dn(bn(e),gn(e.agentType,t,n,r,i,a,o))}async function En(e){if(e.source===`built-in`)throw Error(`Cannot delete built-in agents`);let t=bn(e);try{await mn(t)}catch(e){if(yt(e)!==`ENOENT`)throw e}}async function Dn(e,t,n=`w`){let r=await pn(e,n);try{await r.writeFile(t,{encoding:`utf-8`}),await r.datasync()}finally{await r.close()}}var On=e((()=>{kt(),Ze(),ht(),r(),Ct(),hn()}));function kn({agent:e,tools:t,onBack:n}){let r=x(e,t,!1),i=Sn(e),o=oe(e.agentType);d(`confirm:no`,n,{context:`Confirmation`});let s=e=>{e.key===`return`&&(e.preventDefault(),n())};function u(){return r.hasWildcard?(0,k.jsx)(l,{children:`All tools`}):!e.tools||e.tools.length===0?(0,k.jsx)(l,{children:`None`}):(0,k.jsxs)(k.Fragment,{children:[r.validTools.length>0&&(0,k.jsx)(l,{children:r.validTools.join(`, `)}),r.invalidTools.length>0&&(0,k.jsxs)(l,{color:`warning`,children:[a.warning,` Unrecognized: `,r.invalidTools.join(`, `)]})]})}return(0,k.jsxs)(c,{flexDirection:`column`,gap:1,tabIndex:0,autoFocus:!0,onKeyDown:s,children:[(0,k.jsx)(l,{dimColor:!0,children:i}),(0,k.jsxs)(c,{flexDirection:`column`,children:[(0,k.jsxs)(l,{children:[(0,k.jsx)(l,{bold:!0,children:`Description`}),` (tells Claude when to use this agent):`]}),(0,k.jsx)(c,{marginLeft:2,children:(0,k.jsx)(l,{children:e.whenToUse})})]}),(0,k.jsxs)(c,{children:[(0,k.jsxs)(l,{children:[(0,k.jsx)(l,{bold:!0,children:`Tools`}),`:`,` `]}),u()]}),(0,k.jsxs)(l,{children:[(0,k.jsx)(l,{bold:!0,children:`Model`}),`: `,Ke(e.model)]}),e.permissionMode&&(0,k.jsxs)(l,{children:[(0,k.jsx)(l,{bold:!0,children:`Permission mode`}),`: `,e.permissionMode]}),e.memory&&(0,k.jsxs)(l,{children:[(0,k.jsx)(l,{bold:!0,children:`Memory`}),`: `,ce(e.memory)]}),e.hooks&&Object.keys(e.hooks).length>0&&(0,k.jsxs)(l,{children:[(0,k.jsx)(l,{bold:!0,children:`Hooks`}),`: `,Object.keys(e.hooks).join(`, `)]}),e.skills&&e.skills.length>0&&(0,k.jsxs)(l,{children:[(0,k.jsx)(l,{bold:!0,children:`Skills`}),`:`,` `,e.skills.length>10?`${e.skills.length} skills`:e.skills.join(`, `)]}),o&&(0,k.jsx)(c,{children:(0,k.jsxs)(l,{children:[(0,k.jsx)(l,{bold:!0,children:`Color`}),`:`,` `,(0,k.jsxs)(l,{backgroundColor:o,color:`inverseText`,children:[` `,e.agentType,` `]})]})}),!tt(e)&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(c,{children:(0,k.jsxs)(l,{children:[(0,k.jsx)(l,{bold:!0,children:`System prompt`}),`:`]})}),(0,k.jsx)(c,{marginLeft:2,marginRight:2,children:(0,k.jsx)(ze,{children:e.getSystemPrompt()})})]})]})}var k,An=e((()=>{i(),p(),m(),E(),fe(),Ee(),Se(),Ze(),xe(),Je(),On(),k=_()}));function jn({agentName:e,currentColor:t=`automatic`,onConfirm:n}){let[r,i]=(0,Mn.useState)(Math.max(0,Nn.indexOf(t))),o=e=>{if(e.key===`up`)e.preventDefault(),i(e=>e>0?e-1:Nn.length-1);else if(e.key===`down`)e.preventDefault(),i(e=>e<Nn.length-1?e+1:0);else if(e.key===`return`){e.preventDefault();let t=Nn[r];n(t===`automatic`?void 0:t)}},s=Nn[r];return(0,A.jsxs)(c,{flexDirection:`column`,gap:1,tabIndex:0,autoFocus:!0,onKeyDown:o,children:[(0,A.jsx)(c,{flexDirection:`column`,children:Nn.map((e,t)=>{let n=t===r;return(0,A.jsxs)(c,{flexDirection:`row`,gap:1,children:[(0,A.jsx)(l,{color:n?`suggestion`:void 0,children:n?a.pointer:` `}),e===`automatic`?(0,A.jsx)(l,{bold:n,children:`Automatic color`}):(0,A.jsxs)(c,{gap:1,children:[(0,A.jsx)(l,{backgroundColor:ke[e],color:`inverseText`,children:` `}),(0,A.jsx)(l,{bold:n,children:Ut(e)})]})]},e)})}),(0,A.jsxs)(c,{marginTop:1,children:[(0,A.jsx)(l,{children:`Preview: `}),s===void 0||s===`automatic`?(0,A.jsxs)(l,{inverse:!0,bold:!0,children:[` `,`@`,e,` `]}):(0,A.jsxs)(l,{backgroundColor:ke[s],color:`inverseText`,bold:!0,children:[` `,`@`,e,` `]})]})]})}var Mn,A,Nn,Pn=e((()=>{i(),Mn=t(p(),1),m(),fe(),Wt(),A=_(),Nn=[`automatic`,...Te]}));function Fn({initialModel:e,onComplete:t,onCancel:n}){let r=In.useMemo(()=>{let t=he();return e&&!t.some(t=>t.value===e)?[{value:e,label:e,description:`Current model (custom ID)`},...t]:t},[e]);return(0,Ln.jsxs)(c,{flexDirection:`column`,children:[(0,Ln.jsx)(c,{marginBottom:1,children:(0,Ln.jsx)(l,{dimColor:!0,children:`Model determines the agent's reasoning capabilities and speed.`})}),(0,Ln.jsx)(We,{options:r,defaultValue:e??`sonnet`,onChange:t,onCancel:()=>n?n():t(void 0)})]})}var In,Ln,Rn=e((()=>{In=t(p(),1),m(),xe(),Ne(),Ln=_()}));function zn(){return{READ_ONLY:{name:`Read-only tools`,toolNames:new Set([He.name,st.name,ie.name,_e.name,nt.name,v.name,mt.name,at.name,Ge.name])},EDIT:{name:`Edit tools`,toolNames:new Set([Ce.name,ee.name,Ve.name])},EXECUTION:{name:`Execution tools`,toolNames:new Set([ot.name,process.env.USER_TYPE===`ant`?Yt.name:void 0].filter(e=>e!==void 0))},MCP:{name:`MCP tools`,toolNames:new Set,isMcp:!0},OTHER:{name:`Other tools`,toolNames:new Set}}}function Bn(e){let t=new Map;return e.forEach(e=>{if(Pe(e)){let n=Tt(e.name);if(n?.serverName){let r=t.get(n.serverName)||[];r.push(e),t.set(n.serverName,r)}}}),Array.from(t.entries()).map(([e,t])=>({serverName:e,tools:t})).sort((e,t)=>e.serverName.localeCompare(t.serverName))}function Vn({tools:e,initialTools:t,onComplete:n,onCancel:r}){let i=(0,j.useMemo)(()=>dt({tools:e,isBuiltIn:!1,isAsync:!1}),[e]),[s,u]=(0,j.useState)(!t||t.includes(`*`)?i.map(e=>e.name):t),[f,p]=(0,j.useState)(0),[m,h]=(0,j.useState)(!1),g=(0,j.useMemo)(()=>{let e=new Set(i.map(e=>e.name));return s.filter(t=>e.has(t))},[s,i]),_=new Set(g),v=g.length===i.length&&i.length>0,y=e=>{e&&u(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},b=(e,t)=>{u(n=>{if(t){let t=e.filter(e=>!n.includes(e));return[...n,...t]}else return n.filter(t=>!e.includes(t))})},ee=()=>{let e=i.map(e=>e.name);n(g.length===e.length&&e.every(e=>g.includes(e))?void 0:g)},x=(0,j.useMemo)(()=>{let e=zn(),t={readOnly:[],edit:[],execution:[],mcp:[],other:[]};return i.forEach(n=>{Pe(n)?t.mcp.push(n):e.READ_ONLY.toolNames.has(n.name)?t.readOnly.push(n):e.EDIT.toolNames.has(n.name)?t.edit.push(n):e.EXECUTION.toolNames.has(n.name)?t.execution.push(n):n.name!==`Agent`&&t.other.push(n)}),t},[i]),te=e=>{let t=Mt(e,e=>_.has(e.name))<e.length;return()=>{let n=e.map(e=>e.name);b(n,t)}},S=[];S.push({id:`continue`,label:`Continue`,action:ee,isContinue:!0}),S.push({id:`bucket-all`,label:`${v?a.checkboxOn:a.checkboxOff} All tools`,action:()=>{let e=i.map(e=>e.name);b(e,!v)}});let C=zn();[{id:`bucket-readonly`,name:C.READ_ONLY.name,tools:x.readOnly},{id:`bucket-edit`,name:C.EDIT.name,tools:x.edit},{id:`bucket-execution`,name:C.EXECUTION.name,tools:x.execution},{id:`bucket-mcp`,name:C.MCP.name,tools:x.mcp},{id:`bucket-other`,name:C.OTHER.name,tools:x.other}].forEach(({id:e,name:t,tools:n})=>{if(n.length===0)return;let r=Mt(n,e=>_.has(e.name))===n.length;S.push({id:e,label:`${r?a.checkboxOn:a.checkboxOff} ${t}`,action:te(n)})});let ne=S.length;S.push({id:`toggle-individual`,label:m?`Hide advanced options`:`Show advanced options`,action:()=>{h(!m),m&&f>ne&&p(ne)},isToggle:!0});let re=(0,j.useMemo)(()=>Bn(i),[i]);return m&&(re.length>0&&(S.push({id:`mcp-servers-header`,label:`MCP Servers:`,action:()=>{},isHeader:!0}),re.forEach(({serverName:e,tools:t})=>{let n=Mt(t,e=>_.has(e.name))===t.length;S.push({id:`mcp-server-${e}`,label:`${n?a.checkboxOn:a.checkboxOff} ${e} (${t.length} ${Ht(t.length,`tool`)})`,action:()=>{let e=t.map(e=>e.name);b(e,!n)}})}),S.push({id:`tools-header`,label:`Individual Tools:`,action:()=>{},isHeader:!0})),i.forEach(e=>{let t=e.name;if(e.name.startsWith(`mcp__`)){let n=Tt(e.name);t=n?`${n.toolName} (${n.serverName})`:e.name}S.push({id:`tool-${e.name}`,label:`${_.has(e.name)?a.checkboxOn:a.checkboxOff} ${t}`,action:()=>y(e.name)})})),d(`confirm:no`,(0,j.useCallback)(()=>{r?r():n(t)},[r,n,t]),{context:`Confirmation`}),(0,M.jsxs)(c,{flexDirection:`column`,marginTop:1,tabIndex:0,autoFocus:!0,onKeyDown:e=>{if(e.key===`return`){e.preventDefault();let t=S[f];t&&!t.isHeader&&t.action()}else if(e.key===`up`){e.preventDefault();let t=f-1;for(;t>0&&S[t]?.isHeader;)t--;p(Math.max(0,t))}else if(e.key===`down`){e.preventDefault();let t=f+1;for(;t<S.length-1&&S[t]?.isHeader;)t++;p(Math.min(S.length-1,t))}},children:[(0,M.jsxs)(l,{color:f===0?`suggestion`:void 0,bold:f===0,children:[f===0?`${a.pointer} `:` `,`[ Continue ]`]}),(0,M.jsx)(o,{width:40}),S.slice(1).map((e,t)=>{let n=t+1===f,r=e.isToggle,i=e.isHeader;return(0,M.jsxs)(j.Fragment,{children:[r&&(0,M.jsx)(o,{width:40}),i&&t>0&&(0,M.jsx)(c,{marginTop:1}),(0,M.jsxs)(l,{color:i?void 0:n?`suggestion`:void 0,dimColor:i,bold:r&&n,children:[i?``:n?`${a.pointer} `:` `,r?`[ ${e.label} ]`:e.label]})]},e.id)}),(0,M.jsx)(c,{marginTop:1,flexDirection:`column`,children:(0,M.jsx)(l,{dimColor:!0,children:v?`All tools selected`:`${_.size} of ${i.length} tools selected`})})]})}var j,M,Hn=e((()=>{i(),j=t(p(),1),jt(),ft(),Se(),Ot(),Le(),ue(),S(),be(),ut(),je(),pt(),Xe(),Qe(),me(),y(),Re(),Ie(),Jt(),m(),E(),Nt(),Wt(),M=_()}));function Un(e){return e===`all`?`Agents`:e===`built-in`?`Built-in agents`:e===`plugin`?`Plugin agents`:ve(wt(e))}var Wn=e((()=>{ne(),At()}));function Gn({agent:e,tools:t,onSaved:n,onBack:r}){let i=pe(),[o,s]=(0,N.useState)(`menu`),[u,f]=(0,N.useState)(0),[p,m]=(0,N.useState)(null),[g,_]=(0,N.useState)(e.color),v=(0,N.useCallback)(async()=>{let t=await ln(bn(e));t.error?m(t.error):n(`Opened ${e.agentType} in editor. If you made edits, restart to load the latest version.`)},[e,n]),y=(0,N.useCallback)(async(t={})=>{let{tools:r,color:a,model:o}=t,s=a??g,c=r!==void 0,l=o!==void 0,u=s!==e.color;if(!c&&!l&&!u)return!1;try{return!Fe(e)&&!qe(e)?!1:(await Tn(e,e.whenToUse,r??e.tools,e.getSystemPrompt(),s,o??e.model),u&&s&&$e(e.agentType,s),i(t=>{let n=t.agentDefinitions.allAgents.map(t=>t.agentType===e.agentType?{...t,tools:r??t.tools,color:s,model:o??t.model}:t);return{...t,agentDefinitions:{...t.agentDefinitions,activeAgents:et(n),allAgents:n}}}),n(`Updated agent: ${h.bold(e.agentType)}`),!0)}catch(e){return m(e instanceof Error?e.message:`Failed to save agent`),!1}},[e,g,n,i]),b=(0,N.useMemo)(()=>[{label:`Open in editor`,action:v},{label:`Edit tools`,action:()=>s(`edit-tools`)},{label:`Edit model`,action:()=>s(`edit-model`)},{label:`Edit color`,action:()=>s(`edit-color`)}],[v]),ee=(0,N.useCallback)(()=>{m(null),o===`menu`?r():s(`menu`)},[o,r]),x=(0,N.useCallback)(e=>{if(e.key===`up`)e.preventDefault(),f(e=>Math.max(0,e-1));else if(e.key===`down`)e.preventDefault(),f(e=>Math.min(b.length-1,e+1));else if(e.key===`return`){e.preventDefault();let t=b[u];t&&t.action()}},[b,u]);d(`confirm:no`,ee,{context:`Confirmation`});let te=()=>(0,P.jsxs)(c,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:x,children:[(0,P.jsxs)(l,{dimColor:!0,children:[`Source: `,Un(e.source)]}),(0,P.jsx)(c,{marginTop:1,flexDirection:`column`,children:b.map((e,t)=>(0,P.jsxs)(l,{color:t===u?`suggestion`:void 0,children:[t===u?`${a.pointer} `:` `,e.label]},e.label))}),p&&(0,P.jsx)(c,{marginTop:1,children:(0,P.jsx)(l,{color:`error`,children:p})})]});switch(o){case`menu`:return te();case`edit-tools`:return(0,P.jsx)(Vn,{tools:t,initialTools:e.tools,onComplete:async e=>{s(`menu`),await y({tools:e})}});case`edit-color`:return(0,P.jsx)(jn,{agentName:e.agentType,currentColor:g||e.color||`automatic`,onConfirm:async e=>{_(e),s(`menu`),await y({color:e})}});case`edit-model`:return(0,P.jsx)(Fn,{initialModel:e.model,onComplete:async e=>{s(`menu`),await y({model:e})}});default:return null}}var N,P,Kn=e((()=>{f(),i(),p(),N=t(p(),1),ye(),m(),E(),fe(),Ze(),cn(),On(),Pn(),Rn(),Hn(),Wn(),P=_()}));function qn({instructions:e=`Press ↑↓ to navigate · Enter to select · Esc to go back`}){let t=nn();return(0,Jn.jsx)(c,{marginLeft:2,children:(0,Jn.jsx)(l,{dimColor:!0,children:t.pending?`Press ${t.keyName} again to exit`:e})})}var Jn,Yn=e((()=>{p(),rn(),m(),Jn=_()}));function Xn({source:e,agents:t,onBack:n,onSelect:r,onCreateNew:i,changes:s}){let[u,d]=Zn.useState(null),[f,p]=Zn.useState(!0),m=Zn.useMemo(()=>[...t].sort(Qt),[t]),h=e=>({isOverridden:!!e.overriddenBy,overriddenBy:e.overriddenBy||null}),_=()=>(0,F.jsxs)(c,{children:[(0,F.jsx)(l,{color:f?`suggestion`:void 0,children:f?`${a.pointer} `:` `}),(0,F.jsx)(l,{color:f?`suggestion`:void 0,children:`Create new agent`})]}),v=e=>{let t=e.source===`built-in`,n=!t&&!f&&u?.agentType===e.agentType&&u?.source===e.source,{isOverridden:r,overriddenBy:i}=h(e),o=t||r,s=!t&&n?`suggestion`:void 0,d=Xt(e);return(0,F.jsxs)(c,{children:[(0,F.jsx)(l,{dimColor:o&&!n,color:s,children:t?``:n?`${a.pointer} `:` `}),(0,F.jsx)(l,{dimColor:o&&!n,color:s,children:e.agentType}),d&&(0,F.jsxs)(l,{dimColor:!0,color:s,children:[` · `,d]}),e.memory&&(0,F.jsxs)(l,{dimColor:!0,color:s,children:[` · `,e.memory,` memory`]}),i&&(0,F.jsxs)(l,{dimColor:!n,color:n?`warning`:void 0,children:[` `,a.warning,` shadowed by `,en(i)]})]},`${e.agentType}-${e.source}`)},y=Zn.useMemo(()=>{let t=m.filter(e=>e.source!==`built-in`);return e===`all`?tn.filter(e=>e.source!==`built-in`).flatMap(({source:e})=>t.filter(t=>t.source===e)):t},[m,e]);Zn.useEffect(()=>{!u&&!f&&y.length>0&&(i?p(!0):d(y[0]||null))},[y,u,f,i]);let b=e=>{if(e.key===`return`){e.preventDefault(),f&&i?i():u&&r(u);return}if(e.key!==`up`&&e.key!==`down`)return;e.preventDefault();let t=!!i,n=y.length+ +!!t;if(n===0)return;let a=0;if(!f&&u){let e=y.findIndex(e=>e.agentType===u.agentType&&e.source===u.source);e>=0&&(a=t?e+1:e)}let o=e.key===`up`?a===0?n-1:a-1:a===n-1?0:a+1;if(t&&o===0)p(!0),d(null);else{let e=t?o-1:o,n=y[e];n&&(p(!1),d(n))}},ee=(e=`Built-in (always available):`)=>{let t=m.filter(e=>e.source===`built-in`);return(0,F.jsxs)(c,{flexDirection:`column`,marginBottom:1,paddingLeft:2,children:[(0,F.jsx)(l,{bold:!0,dimColor:!0,children:e}),t.map(v)]})},x=(e,t)=>{if(!t.length)return null;let n=t[0]?.baseDir;return(0,F.jsxs)(c,{flexDirection:`column`,marginBottom:1,children:[(0,F.jsxs)(c,{paddingLeft:2,children:[(0,F.jsx)(l,{bold:!0,dimColor:!0,children:e}),n&&(0,F.jsxs)(l,{dimColor:!0,children:[` (`,n,`)`]})]}),t.map(e=>v(e))]})},te=Un(e),S=m.filter(e=>e.source===`built-in`);return!m.length||e!==`built-in`&&!m.some(e=>e.source!==`built-in`)?(0,F.jsx)(g,{title:te,subtitle:`No agents found`,onCancel:n,hideInputGuide:!0,children:(0,F.jsxs)(c,{flexDirection:`column`,gap:1,tabIndex:0,autoFocus:!0,onKeyDown:b,children:[i&&(0,F.jsx)(c,{children:_()}),(0,F.jsx)(l,{dimColor:!0,children:`No agents found. Create specialized subagents that Claude can delegate to.`}),(0,F.jsx)(l,{dimColor:!0,children:`Each subagent has its own context window, custom system prompt, and specific tools.`}),(0,F.jsx)(l,{dimColor:!0,children:`Try creating: Code Reviewer, Code Simplifier, Security Reviewer, Tech Lead, or UX Reviewer.`}),e!==`built-in`&&m.some(e=>e.source===`built-in`)&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(o,{}),ee()]})]})}):(0,F.jsxs)(g,{title:te,subtitle:`${Mt(m,e=>!e.overriddenBy)} agents`,onCancel:n,hideInputGuide:!0,children:[s&&s.length>0&&(0,F.jsx)(c,{marginTop:1,children:(0,F.jsx)(l,{dimColor:!0,children:s[s.length-1]})}),(0,F.jsxs)(c,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:b,children:[i&&(0,F.jsx)(c,{marginBottom:1,children:_()}),e===`all`?(0,F.jsxs)(F.Fragment,{children:[tn.filter(e=>e.source!==`built-in`).map(({label:e,source:t})=>(0,F.jsx)(Zn.Fragment,{children:x(e,m.filter(e=>e.source===t))},t)),S.length>0&&(0,F.jsxs)(c,{flexDirection:`column`,marginBottom:1,paddingLeft:2,children:[(0,F.jsxs)(l,{dimColor:!0,children:[(0,F.jsx)(l,{bold:!0,children:`Built-in agents`}),` (always available)`]}),S.map(v)]})]}):e===`built-in`?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(l,{dimColor:!0,italic:!0,children:`Built-in agents are provided by default and cannot be modified.`}),(0,F.jsx)(c,{marginTop:1,flexDirection:`column`,children:m.map(e=>v(e))})]}):(0,F.jsxs)(F.Fragment,{children:[m.filter(e=>e.source!==`built-in`).map(e=>v(e)),m.some(e=>e.source===`built-in`)&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(o,{}),ee()]})]})]})]})}var Zn,F,Qn=e((()=>{i(),Zn=t(p(),1),m(),Zt(),Nt(),Wn(),F=_()}));function $n({steps:e,initialData:t={},onComplete:n,onCancel:r,children:i,title:a,showStepCounter:o=!0}){let[s,c]=(0,I.useState)(0),[l,u]=(0,I.useState)(t),[d,f]=(0,I.useState)(!1),[p,m]=(0,I.useState)([]);nn(),(0,I.useEffect)(()=>{d&&(m([]),n(l))},[d,l,n]);let h=(0,I.useCallback)(()=>{s<e.length-1?(p.length>0&&m(e=>[...e,s]),c(e=>e+1)):f(!0)},[s,e.length,p]),g=(0,I.useCallback)(()=>{if(p.length>0){let e=p[p.length-1];e!==void 0&&(m(e=>e.slice(0,-1)),c(e))}else s>0?c(e=>e-1):r&&r()},[s,p,r]),_=(0,I.useCallback)(t=>{t>=0&&t<e.length&&(m(e=>[...e,s]),c(t))},[s,e.length]),v=(0,I.useCallback)(()=>{m([]),r&&r()},[r]),y=(0,I.useCallback)(e=>{u(t=>({...t,...e}))},[]),b=(0,I.useMemo)(()=>({currentStepIndex:s,totalSteps:e.length,wizardData:l,setWizardData:u,updateWizardData:y,goNext:h,goBack:g,goToStep:_,cancel:v,title:a,showStepCounter:o}),[s,e.length,l,y,h,g,_,v,a,o]),ee=e[s];return!ee||d?null:(0,er.jsx)(tr.Provider,{value:b,children:i||(0,er.jsx)(ee,{})})}var I,er,tr,nr=e((()=>{I=t(p(),1),rn(),er=_(),tr=(0,I.createContext)(null)}));function L(){let e=(0,rr.useContext)(tr);if(!e)throw Error(`useWizard must be used within a WizardProvider`);return e}var rr,ir=e((()=>{rr=t(p(),1),nr()}));function ar({instructions:e=(0,or.jsxs)(u,{children:[(0,or.jsx)(s,{shortcut:`↑↓`,action:`navigate`}),(0,or.jsx)(s,{shortcut:`Enter`,action:`select`}),(0,or.jsx)(w,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]})}){let t=nn();return(0,or.jsx)(c,{marginLeft:3,marginTop:1,children:(0,or.jsx)(l,{dimColor:!0,children:t.pending?`Press ${t.keyName} again to exit`:e})})}var or,sr=e((()=>{rn(),m(),T(),or=_()}));function R({title:e,color:t=`suggestion`,children:n,subtitle:r,footerText:i}){let{currentStepIndex:a,totalSteps:o,title:s,showStepCounter:c,goBack:l}=L();return(0,cr.jsxs)(cr.Fragment,{children:[(0,cr.jsx)(g,{title:`${e||s||`Wizard`}${c===!1?``:` (${a+1}/${o})`}`,subtitle:r,onCancel:l,color:t,hideInputGuide:!0,isCancelActive:!1,children:n}),(0,cr.jsx)(ar,{instructions:i})]})}var cr,z=e((()=>{m(),ir(),sr(),cr=_()})),B=e((()=>{ir(),z(),sr(),nr()}));function lr(){let{goNext:e,goBack:t,updateWizardData:n,wizardData:r}=L();return d(`confirm:no`,t,{context:`Confirmation`}),(0,V.jsx)(R,{subtitle:`Choose background color`,footerText:(0,V.jsxs)(u,{children:[(0,V.jsx)(s,{shortcut:`↑↓`,action:`navigate`}),(0,V.jsx)(s,{shortcut:`Enter`,action:`select`}),(0,V.jsx)(w,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:(0,V.jsx)(c,{children:(0,V.jsx)(jn,{agentName:r.agentType||`agent`,currentColor:`automatic`,onConfirm:t=>{n({selectedColor:t,finalAgent:{agentType:r.agentType,whenToUse:r.whenToUse,getSystemPrompt:()=>r.systemPrompt,tools:r.selectedTools,...r.selectedModel?{model:r.selectedModel}:{},...t?{color:t}:{},source:r.location}}),e()}})})})}var V,ur=e((()=>{m(),E(),T(),B(),z(),Pn(),V=_()}));function dr(e){return e?/^[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]$/.test(e)?e.length<3?`Agent type must be at least 3 characters long`:e.length>50?`Agent type must be less than 50 characters`:null:`Agent type must start and end with alphanumeric characters and contain only letters, numbers, and hyphens`:`Agent type is required`}function fr(e,t,n){let r=[],i=[];if(!e.agentType)r.push(`Agent type is required`);else{let t=dr(e.agentType);t&&r.push(t);let i=n.find(t=>t.agentType===e.agentType&&t.source!==e.source);i&&r.push(`Agent type "${e.agentType}" already exists in ${Un(i.source)}`)}if(e.whenToUse?e.whenToUse.length<10?i.push(`Description should be more descriptive (at least 10 characters)`):e.whenToUse.length>5e3&&i.push(`Description is very long (over 5000 characters)`):r.push(`Description (description) is required`),e.tools!==void 0&&!Array.isArray(e.tools))r.push(`Tools must be an array`);else{e.tools===void 0?i.push(`Agent has access to all tools`):e.tools.length===0&&i.push(`No tools selected - agent will have very limited capabilities`);let n=x(e,t,!1);n.invalidTools.length>0&&r.push(`Invalid tools: ${n.invalidTools.join(`, `)}`)}let a=e.getSystemPrompt();return a?a.length<20?r.push(`System prompt is too short (minimum 20 characters)`):a.length>1e4&&i.push(`System prompt is very long (over 10,000 characters)`):r.push(`System prompt is required`),{isValid:r.length===0,errors:r,warnings:i}}var pr=e((()=>{Se(),Wn()}));function mr({tools:e,existingAgents:t,onSave:n,onSaveAndEdit:r,error:i}){let{goBack:a,wizardData:o}=L();d(`confirm:no`,a,{context:`Confirmation`});let f=e=>{e.key===`s`||e.key===`return`?(e.preventDefault(),n()):e.key===`e`&&(e.preventDefault(),r())},p=o.finalAgent,m=fr(p,e,t),h=Bt(p.getSystemPrompt(),240),g=Bt(p.whenToUse,240),_=e=>e===void 0?`All tools`:e.length===0?`None`:e.length===1?e[0]||`None`:e.length===2?e.join(` and `):`${e.slice(0,-1).join(`, `)}, and ${e[e.length-1]}`,v=Pt()?(0,H.jsxs)(l,{children:[(0,H.jsx)(l,{bold:!0,children:`Memory`}),`: `,ce(p.memory)]}):null;return(0,H.jsx)(R,{subtitle:`Confirm and save`,footerText:(0,H.jsxs)(u,{children:[(0,H.jsx)(s,{shortcut:`s/Enter`,action:`save`}),(0,H.jsx)(s,{shortcut:`e`,action:`edit in your editor`}),(0,H.jsx)(w,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]}),children:(0,H.jsxs)(c,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:f,children:[(0,H.jsxs)(l,{children:[(0,H.jsx)(l,{bold:!0,children:`Name`}),`: `,p.agentType]}),(0,H.jsxs)(l,{children:[(0,H.jsx)(l,{bold:!0,children:`Location`}),`:`,` `,xn({source:o.location,agentType:p.agentType})]}),(0,H.jsxs)(l,{children:[(0,H.jsx)(l,{bold:!0,children:`Tools`}),`: `,_(p.tools)]}),(0,H.jsxs)(l,{children:[(0,H.jsx)(l,{bold:!0,children:`Model`}),`: `,Ke(p.model)]}),v,(0,H.jsx)(c,{marginTop:1,children:(0,H.jsxs)(l,{children:[(0,H.jsx)(l,{bold:!0,children:`Description`}),` (tells Claude when to use this agent):`]})}),(0,H.jsx)(c,{marginLeft:2,marginTop:1,children:(0,H.jsx)(l,{children:g})}),(0,H.jsx)(c,{marginTop:1,children:(0,H.jsxs)(l,{children:[(0,H.jsx)(l,{bold:!0,children:`System prompt`}),`:`]})}),(0,H.jsx)(c,{marginLeft:2,marginTop:1,children:(0,H.jsx)(l,{children:h})}),m.warnings.length>0&&(0,H.jsxs)(c,{marginTop:1,flexDirection:`column`,children:[(0,H.jsx)(l,{color:`warning`,children:`Warnings:`}),m.warnings.map((e,t)=>(0,H.jsxs)(l,{dimColor:!0,children:[` `,`• `,e]},t))]}),m.errors.length>0&&(0,H.jsxs)(c,{marginTop:1,flexDirection:`column`,children:[(0,H.jsx)(l,{color:`error`,children:`Errors:`}),m.errors.map((e,t)=>(0,H.jsxs)(l,{color:`error`,children:[` `,`• `,e]},t))]}),i&&(0,H.jsx)(c,{marginTop:1,children:(0,H.jsx)(l,{color:`error`,children:i})}),(0,H.jsx)(c,{marginTop:2,children:(0,H.jsxs)(l,{color:`success`,children:[`Press `,(0,H.jsx)(l,{bold:!0,children:`s`}),` or `,(0,H.jsx)(l,{bold:!0,children:`Enter`}),` to save, `,(0,H.jsx)(l,{bold:!0,children:`e`}),` to save and edit`]})})]})})}var H,hr=e((()=>{m(),E(),Ft(),Ee(),Vt(),xe(),T(),B(),z(),On(),pr(),H=_()}));function gr({tools:e,existingAgents:t,onComplete:n}){let{wizardData:r}=L(),[i,a]=(0,_r.useState)(null),o=pe(),s=(0,_r.useCallback)(async e=>{if(r?.finalAgent)try{await wn(r.location,r.finalAgent.agentType,r.finalAgent.whenToUse,r.finalAgent.tools,r.finalAgent.getSystemPrompt(),!0,r.finalAgent.color,r.finalAgent.model,r.finalAgent.memory),o(e=>{if(!r.finalAgent)return e;let t=e.agentDefinitions.allAgents.concat(r.finalAgent);return{...e,agentDefinitions:{...e.agentDefinitions,activeAgents:et(t),allAgents:t}}}),it(),e&&await ln(yn({source:r.location,agentType:r.finalAgent.agentType})),zt(`tengu_agent_created`,{agent_type:r.finalAgent.agentType,generation_method:r.wasGenerated?`generated`:`manual`,source:r.location,tool_count:r.finalAgent.tools?.length??`all`,has_custom_model:!!r.finalAgent.model,has_custom_color:!!r.finalAgent.color,has_memory:!!r.finalAgent.memory,memory_scope:r.finalAgent.memory??`none`,...e?{opened_in_editor:!0}:{}}),n(e?`Created agent: ${h.bold(r.finalAgent.agentType)} and opened in editor. If you made edits, restart to load the latest version.`:`Created agent: ${h.bold(r.finalAgent.agentType)}`)}catch(e){a(e instanceof Error?e.message:`Failed to save agent`)}},[r,n,o]);return(0,vr.jsx)(mr,{tools:e,existingAgents:t,onSave:(0,_r.useCallback)(()=>s(!1),[s]),onSaveAndEdit:(0,_r.useCallback)(()=>s(!0),[s]),error:i})}var _r,vr,yr=e((()=>{f(),_r=t(p(),1),Rt(),ye(),Ze(),cn(),B(),On(),hr(),vr=_()}));function br(){let{goNext:e,goBack:t,updateWizardData:n,wizardData:r}=L(),[i,a]=(0,xr.useState)(r.whenToUse||``),[o,f]=(0,xr.useState)(i.length),[p,m]=(0,xr.useState)(null);return d(`confirm:no`,t,{context:`Settings`}),d(`chat:externalEditor`,(0,xr.useCallback)(async()=>{let e=await sn(i);e.content!==null&&(a(e.content),f(e.content.length))},[i]),{context:`Chat`}),(0,U.jsx)(R,{subtitle:`Description (tell Claude when to use this agent)`,footerText:(0,U.jsxs)(u,{children:[(0,U.jsx)(s,{shortcut:`Type`,action:`enter text`}),(0,U.jsx)(s,{shortcut:`Enter`,action:`continue`}),(0,U.jsx)(w,{action:`chat:externalEditor`,context:`Chat`,fallback:`ctrl+g`,description:`open in editor`}),(0,U.jsx)(w,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`go back`})]}),children:(0,U.jsxs)(c,{flexDirection:`column`,children:[(0,U.jsx)(l,{children:`When should Claude use this agent?`}),(0,U.jsx)(c,{marginTop:1,children:(0,U.jsx)(we,{value:i,onChange:a,onSubmit:t=>{let r=t.trim();if(!r){m(`Description is required`);return}m(null),n({whenToUse:r}),e()},placeholder:`e.g., use this agent after you're done writing code...`,columns:80,cursorOffset:o,onChangeCursorOffset:f,focus:!0,showCursor:!0})}),p&&(0,U.jsx)(c,{marginTop:1,children:(0,U.jsx)(l,{color:`error`,children:p})})]})})}var xr,U,Sr=e((()=>{xr=t(p(),1),m(),E(),cn(),T(),C(),B(),z(),U=_()}));async function Cr(e,t,n,r){let i=Ue({content:`Create an agent configuration based on this request: "${e}".${n.length>0?`\n\nIMPORTANT: The following identifiers already exist and must NOT be used: ${n.join(`, `)}`:``}
8
- Return ONLY the JSON object, no other text.`}),a=await b(),o=rt([i],a),s=Pt()?wr+Tr:wr,c=await Ye({messages:Oe(o),systemPrompt:qt([s]),thinkingConfig:{type:`disabled`},tools:[],signal:r,options:{getToolPermissionContext:async()=>Kt(),model:t,toolChoice:void 0,agents:[],isNonInteractiveSession:!1,hasAppendSystemPrompt:!1,querySource:`agent_creation`,mcpTools:[]}}),l=(Array.isArray(c.message.content)?c.message.content:[]).filter(e=>e.type===`text`).map(e=>e.text).join(`
9
- `),u;try{u=_t(l.trim())}catch{let e=l.match(/\{[\s\S]*\}/);if(!e)throw Error(`No JSON object found in response`);u=_t(e[0])}if(!u.identifier||!u.whenToUse||!u.systemPrompt)throw Error(`Invalid agent configuration generated`);return zt(`tengu_agent_definition_generated`,{agent_identifier:u.identifier}),{identifier:u.identifier,whenToUse:u.whenToUse,systemPrompt:u.systemPrompt}}var wr,Tr,Er=e((()=>{ct(),Be(),Gt(),Ot(),Me(),ge(),Ft(),Rt(),xt(),se(),wr=`You are an elite AI agent architect specializing in crafting high-performance agent configurations. Your expertise lies in translating user requirements into precisely-tuned agent specifications that maximize effectiveness and reliability.
10
-
11
- **Important Context**: You may have access to project-specific instructions from CLAUDE.md files and other context that may include coding standards, project structure, and custom requirements. Consider this context when creating agents to ensure they align with the project's established patterns and practices.
12
-
13
- When a user describes what they want an agent to do, you will:
14
-
15
- 1. **Extract Core Intent**: Identify the fundamental purpose, key responsibilities, and success criteria for the agent. Look for both explicit requirements and implicit needs. Consider any project-specific context from CLAUDE.md files. For agents that are meant to review code, you should assume that the user is asking to review recently written code and not the whole codebase, unless the user has explicitly instructed you otherwise.
16
-
17
- 2. **Design Expert Persona**: Create a compelling expert identity that embodies deep domain knowledge relevant to the task. The persona should inspire confidence and guide the agent's decision-making approach.
18
-
19
- 3. **Architect Comprehensive Instructions**: Develop a system prompt that:
20
- - Establishes clear behavioral boundaries and operational parameters
21
- - Provides specific methodologies and best practices for task execution
22
- - Anticipates edge cases and provides guidance for handling them
23
- - Incorporates any specific requirements or preferences mentioned by the user
24
- - Defines output format expectations when relevant
25
- - Aligns with project-specific coding standards and patterns from CLAUDE.md
26
-
27
- 4. **Optimize for Performance**: Include:
28
- - Decision-making frameworks appropriate to the domain
29
- - Quality control mechanisms and self-verification steps
30
- - Efficient workflow patterns
31
- - Clear escalation or fallback strategies
32
-
33
- 5. **Create Identifier**: Design a concise, descriptive identifier that:
34
- - Uses lowercase letters, numbers, and hyphens only
35
- - Is typically 2-4 words joined by hyphens
36
- - Clearly indicates the agent's primary function
37
- - Is memorable and easy to type
38
- - Avoids generic terms like "helper" or "assistant"
39
-
40
- 6 **Example agent descriptions**:
41
- - in the 'whenToUse' field of the JSON object, you should include examples of when this agent should be used.
42
- - examples should be of the form:
43
- - <example>
44
- Context: The user is creating a test-runner agent that should be called after a logical chunk of code is written.
45
- user: "Please write a function that checks if a number is prime"
46
- assistant: "Here is the relevant function: "
47
- <function call omitted for brevity only for this example>
48
- <commentary>
49
- Since a significant piece of code was written, use the ${Dt} tool to launch the test-runner agent to run the tests.
50
- </commentary>
51
- assistant: "Now let me use the test-runner agent to run the tests"
52
- </example>
53
- - <example>
54
- Context: User is creating an agent to respond to the word "hello" with a friendly jok.
55
- user: "Hello"
56
- assistant: "I'm going to use the ${Dt} tool to launch the greeting-responder agent to respond with a friendly joke"
57
- <commentary>
58
- Since the user is greeting, use the greeting-responder agent to respond with a friendly joke.
59
- </commentary>
60
- </example>
61
- - If the user mentioned or implied that the agent should be used proactively, you should include examples of this.
62
- - NOTE: Ensure that in the examples, you are making the assistant use the Agent tool and not simply respond directly to the task.
63
-
64
- Your output must be a valid JSON object with exactly these fields:
65
- {
66
- "identifier": "A unique, descriptive identifier using lowercase letters, numbers, and hyphens (e.g., 'test-runner', 'api-docs-writer', 'code-formatter')",
67
- "whenToUse": "A precise, actionable description starting with 'Use this agent when...' that clearly defines the triggering conditions and use cases. Ensure you include examples as described above.",
68
- "systemPrompt": "The complete system prompt that will govern the agent's behavior, written in second person ('You are...', 'You will...') and structured for maximum clarity and effectiveness"
69
- }
70
-
71
- Key principles for your system prompts:
72
- - Be specific rather than generic - avoid vague instructions
73
- - Include concrete examples when they would clarify behavior
74
- - Balance comprehensiveness with clarity - every instruction should add value
75
- - Ensure the agent has enough context to handle variations of the core task
76
- - Make the agent proactive in seeking clarification when needed
77
- - Build in quality assurance and self-correction mechanisms
78
-
79
- Remember: The agents you create should be autonomous experts capable of handling their designated tasks with minimal additional guidance. Your system prompts are their complete operational manual.
80
- `,Tr=`
81
-
82
- 7. **Agent Memory Instructions**: If the user mentions "memory", "remember", "learn", "persist", or similar concepts, OR if the agent would benefit from building up knowledge across conversations (e.g., code reviewers learning patterns, architects learning codebase structure, etc.), include domain-specific memory update instructions in the systemPrompt.
83
-
84
- Add a section like this to the systemPrompt, tailored to the agent's specific domain:
85
-
86
- "**Update your agent memory** as you discover [domain-specific items]. This builds up institutional knowledge across conversations. Write concise notes about what you found and where.
87
-
88
- Examples of what to record:
89
- - [domain-specific item 1]
90
- - [domain-specific item 2]
91
- - [domain-specific item 3]"
92
-
93
- Examples of domain-specific memory instructions:
94
- - For a code-reviewer: "Update your agent memory as you discover code patterns, style conventions, common issues, and architectural decisions in this codebase."
95
- - For a test-runner: "Update your agent memory as you discover test patterns, common failure modes, flaky tests, and testing best practices."
96
- - For an architect: "Update your agent memory as you discover codepaths, library locations, key architectural decisions, and component relationships."
97
- - For a documentation writer: "Update your agent memory as you discover documentation patterns, API structures, and terminology conventions."
98
-
99
- The memory instructions should be specific to what the agent would naturally learn while performing its core tasks.
100
- `}));function Dr(){let{updateWizardData:e,goBack:t,goToStep:n,wizardData:r}=L(),[i,a]=(0,W.useState)(r.generationPrompt||``),[o,s]=(0,W.useState)(!1),[f,p]=(0,W.useState)(null),[m,h]=(0,W.useState)(i.length),g=un(),_=(0,W.useRef)(null);d(`confirm:no`,(0,W.useCallback)(()=>{_.current&&(_.current.abort(),_.current=null,s(!1),p(`Generation cancelled`))},[]),{context:`Settings`,isActive:o}),d(`chat:externalEditor`,(0,W.useCallback)(async()=>{let e=await sn(i);e.content!==null&&(a(e.content),h(e.content.length))},[i]),{context:`Chat`,isActive:!o}),d(`confirm:no`,(0,W.useCallback)(()=>{e({generationPrompt:``,agentType:``,systemPrompt:``,whenToUse:``,generatedAgent:void 0,wasGenerated:!1}),a(``),p(null),t()},[e,t]),{context:`Settings`,isActive:!o});let v=async()=>{let t=i.trim();if(!t){p(`Please describe what the agent should do`);return}p(null),s(!0),e({generationPrompt:t,isGenerating:!0});let r=ae();_.current=r;try{let i=await Cr(t,g,[],r.signal);e({agentType:i.identifier,whenToUse:i.whenToUse,systemPrompt:i.systemPrompt,generatedAgent:i,isGenerating:!1,wasGenerated:!0}),n(6)}catch(t){t instanceof bt||t instanceof Error&&!t.message.includes(`No assistant message found`)&&p(t.message||`Failed to generate agent`),e({isGenerating:!1})}finally{s(!1),_.current=null}},y=`Describe what this agent should do and when it should be used (be comprehensive for best results)`;return o?(0,G.jsx)(R,{subtitle:y,footerText:(0,G.jsx)(w,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`}),children:(0,G.jsxs)(c,{flexDirection:`row`,alignItems:`center`,children:[(0,G.jsx)(lt,{}),(0,G.jsx)(l,{color:`suggestion`,children:` Generating agent from description...`})]})}):(0,G.jsx)(R,{subtitle:y,footerText:(0,G.jsxs)(u,{children:[(0,G.jsx)(w,{action:`confirm:yes`,context:`Confirmation`,fallback:`Enter`,description:`submit`}),(0,G.jsx)(w,{action:`chat:externalEditor`,context:`Chat`,fallback:`ctrl+g`,description:`open in editor`}),(0,G.jsx)(w,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`go back`})]}),children:(0,G.jsxs)(c,{flexDirection:`column`,children:[f&&(0,G.jsx)(c,{marginBottom:1,children:(0,G.jsx)(l,{color:`error`,children:f})}),(0,G.jsx)(we,{value:i,onChange:a,onSubmit:v,placeholder:`e.g., Help me write unit tests for my code...`,columns:80,cursorOffset:m,onChangeCursorOffset:h,focus:!0,showCursor:!0})]})})}var W,G,Or=e((()=>{vt(),W=t(p(),1),dn(),m(),E(),de(),cn(),T(),te(),C(),B(),z(),Er(),G=_()}));function kr(){let{goNext:e,updateWizardData:t,cancel:n}=L();return(0,K.jsx)(R,{subtitle:`Choose location`,footerText:(0,K.jsxs)(u,{children:[(0,K.jsx)(s,{shortcut:`↑↓`,action:`navigate`}),(0,K.jsx)(s,{shortcut:`Enter`,action:`select`}),(0,K.jsx)(w,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]}),children:(0,K.jsx)(c,{children:(0,K.jsx)(We,{options:[{label:`Project (.claude/agents/)`,value:`projectSettings`},{label:`Personal (~/.claude/agents/)`,value:`userSettings`}],onChange:n=>{t({location:n}),e()},onCancel:()=>n()},`location-select`)})})}var K,Ar=e((()=>{m(),T(),Ne(),B(),z(),K=_()}));function jr(){let{goNext:e,goBack:t,updateWizardData:n,wizardData:r}=L();d(`confirm:no`,t,{context:`Confirmation`});let i=r.location===`userSettings`?[{label:`User scope (~/.claude/agent-memory/) (Recommended)`,value:`user`},{label:`None (no persistent memory)`,value:`none`},{label:`Project scope (.claude/agent-memory/)`,value:`project`},{label:`Local scope (.claude/agent-memory-local/)`,value:`local`}]:[{label:`Project scope (.claude/agent-memory/) (Recommended)`,value:`project`},{label:`None (no persistent memory)`,value:`none`},{label:`User scope (~/.claude/agent-memory/)`,value:`user`},{label:`Local scope (.claude/agent-memory-local/)`,value:`local`}];return(0,q.jsx)(R,{subtitle:`Configure agent memory`,footerText:(0,q.jsxs)(u,{children:[(0,q.jsx)(s,{shortcut:`↑↓`,action:`navigate`}),(0,q.jsx)(s,{shortcut:`Enter`,action:`select`}),(0,q.jsx)(w,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:(0,q.jsx)(c,{children:(0,q.jsx)(We,{options:i,onChange:t=>{let i=t===`none`?void 0:t,a=r.finalAgent?.agentType;n({selectedMemory:i,finalAgent:r.finalAgent?{...r.finalAgent,memory:i,getSystemPrompt:Pt()&&i&&a?()=>r.systemPrompt+`
101
-
102
- `+Ae(a,i):()=>r.systemPrompt}:void 0}),e()},onCancel:t},`memory-select`)})})}var q,Mr=e((()=>{m(),E(),Ft(),Ee(),T(),Ne(),B(),z(),q=_()}));function Nr(){let{goNext:e,goBack:t,updateWizardData:n,goToStep:r}=L();return(0,J.jsx)(R,{subtitle:`Creation method`,footerText:(0,J.jsxs)(u,{children:[(0,J.jsx)(s,{shortcut:`↑↓`,action:`navigate`}),(0,J.jsx)(s,{shortcut:`Enter`,action:`select`}),(0,J.jsx)(w,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:(0,J.jsx)(c,{children:(0,J.jsx)(We,{options:[{label:`Generate with Claude (recommended)`,value:`generate`},{label:`Manual configuration`,value:`manual`}],onChange:t=>{let i=t;n({method:i,wasGenerated:i===`generate`}),i===`generate`?e():r(3)},onCancel:()=>t()},`method-select`)})})}var J,Pr=e((()=>{m(),T(),Ne(),B(),z(),J=_()}));function Fr(){let{goNext:e,goBack:t,updateWizardData:n,wizardData:r}=L();return(0,Y.jsx)(R,{subtitle:`Select model`,footerText:(0,Y.jsxs)(u,{children:[(0,Y.jsx)(s,{shortcut:`↑↓`,action:`navigate`}),(0,Y.jsx)(s,{shortcut:`Enter`,action:`select`}),(0,Y.jsx)(w,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:(0,Y.jsx)(Fn,{initialModel:r.selectedModel,onComplete:t=>{n({selectedModel:t}),e()},onCancel:t})})}var Y,Ir=e((()=>{T(),m(),B(),z(),Rn(),Y=_()}));function Lr(){let{goNext:e,goBack:t,updateWizardData:n,wizardData:r}=L(),[i,a]=(0,Rr.useState)(r.systemPrompt||``),[o,f]=(0,Rr.useState)(i.length),[p,m]=(0,Rr.useState)(null);return d(`confirm:no`,t,{context:`Settings`}),d(`chat:externalEditor`,(0,Rr.useCallback)(async()=>{let e=await sn(i);e.content!==null&&(a(e.content),f(e.content.length))},[i]),{context:`Chat`}),(0,X.jsx)(R,{subtitle:`System prompt`,footerText:(0,X.jsxs)(u,{children:[(0,X.jsx)(s,{shortcut:`Type`,action:`enter text`}),(0,X.jsx)(s,{shortcut:`Enter`,action:`continue`}),(0,X.jsx)(w,{action:`chat:externalEditor`,context:`Chat`,fallback:`ctrl+g`,description:`open in editor`}),(0,X.jsx)(w,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`go back`})]}),children:(0,X.jsxs)(c,{flexDirection:`column`,children:[(0,X.jsx)(l,{children:`Enter the system prompt for your agent:`}),(0,X.jsx)(l,{dimColor:!0,children:`Be comprehensive for best results`}),(0,X.jsx)(c,{marginTop:1,children:(0,X.jsx)(we,{value:i,onChange:a,onSubmit:()=>{let t=i.trim();if(!t){m(`System prompt is required`);return}m(null),n({systemPrompt:t}),e()},placeholder:`You are a helpful code reviewer who...`,columns:80,cursorOffset:o,onChangeCursorOffset:f,focus:!0,showCursor:!0})}),p&&(0,X.jsx)(c,{marginTop:1,children:(0,X.jsx)(l,{color:`error`,children:p})})]})})}var Rr,X,zr=e((()=>{Rr=t(p(),1),m(),E(),cn(),T(),C(),B(),z(),X=_()}));function Br({tools:e}){let{goNext:t,goBack:n,updateWizardData:r,wizardData:i}=L(),a=e=>{r({selectedTools:e}),t()},o=i.selectedTools;return(0,Z.jsx)(R,{subtitle:`Select tools`,footerText:(0,Z.jsxs)(u,{children:[(0,Z.jsx)(s,{shortcut:`Enter`,action:`toggle selection`}),(0,Z.jsx)(s,{shortcut:`↑↓`,action:`navigate`}),(0,Z.jsx)(w,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:(0,Z.jsx)(Vn,{tools:e,initialTools:o,onComplete:a,onCancel:n})})}var Z,Vr=e((()=>{m(),T(),B(),z(),Hn(),Z=_()}));function Hr(e){let{goNext:t,goBack:n,updateWizardData:r,wizardData:i}=L(),[a,o]=(0,Ur.useState)(i.agentType||``),[f,p]=(0,Ur.useState)(null),[m,h]=(0,Ur.useState)(a.length);return d(`confirm:no`,n,{context:`Settings`}),(0,Q.jsx)(R,{subtitle:`Agent type (identifier)`,footerText:(0,Q.jsxs)(u,{children:[(0,Q.jsx)(s,{shortcut:`Type`,action:`enter text`}),(0,Q.jsx)(s,{shortcut:`Enter`,action:`continue`}),(0,Q.jsx)(w,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`go back`})]}),children:(0,Q.jsxs)(c,{flexDirection:`column`,children:[(0,Q.jsx)(l,{children:`Enter a unique identifier for your agent:`}),(0,Q.jsx)(c,{marginTop:1,children:(0,Q.jsx)(we,{value:a,onChange:o,onSubmit:e=>{let n=e.trim(),i=dr(n);if(i){p(i);return}p(null),r({agentType:n}),t()},placeholder:`e.g., test-runner, tech-lead, etc`,columns:60,cursorOffset:m,onChangeCursorOffset:h,focus:!0,showCursor:!0})}),f&&(0,Q.jsx)(c,{marginTop:1,children:(0,Q.jsx)(l,{color:`error`,children:f})})]})})}var Ur,Q,Wr=e((()=>{Ur=t(p(),1),m(),E(),T(),C(),B(),z(),pr(),Q=_()}));function Gr({tools:e,existingAgents:t,onComplete:n,onCancel:r}){return(0,Kr.jsx)($n,{steps:[kr,Nr,Dr,()=>(0,Kr.jsx)(Hr,{existingAgents:t}),Lr,br,()=>(0,Kr.jsx)(Br,{tools:e}),Fr,lr,...Pt()?[jr]:[],()=>(0,Kr.jsx)(gr,{tools:e,existingAgents:t,onComplete:n})],initialData:{},onComplete:()=>{},onCancel:r,title:`Create new agent`,showStepCounter:!1})}var Kr,qr=e((()=>{Ft(),B(),ur(),yr(),Sr(),Or(),Ar(),Mr(),Pr(),Ir(),zr(),Vr(),Wr(),Kr=_()}));function Jr({tools:e,onExit:t}){let[n,r]=(0,Yr.useState)({mode:`list-agents`,source:`all`}),i=re(e=>e.agentDefinitions),a=re(e=>e.mcp.tools),o=re(e=>e.toolPermissionContext),s=pe(),{allAgents:u,activeAgents:d}=i,[f,p]=(0,Yr.useState)([]),m=an(e,a,o);nn();let _=(0,Yr.useMemo)(()=>({"built-in":u.filter(e=>e.source===`built-in`),userSettings:u.filter(e=>e.source===`userSettings`),projectSettings:u.filter(e=>e.source===`projectSettings`),policySettings:u.filter(e=>e.source===`policySettings`),localSettings:u.filter(e=>e.source===`localSettings`),flagSettings:u.filter(e=>e.source===`flagSettings`),plugin:u.filter(e=>e.source===`plugin`),all:u}),[u]),v=(0,Yr.useCallback)(e=>{p(t=>[...t,e]),r({mode:`list-agents`,source:`all`})},[]),y=(0,Yr.useCallback)(async e=>{try{await En(e),s(t=>{let n=t.agentDefinitions.allAgents.filter(t=>!(t.agentType===e.agentType&&t.source===e.source));return{...t,agentDefinitions:{...t.agentDefinitions,allAgents:n,activeAgents:et(n)}}}),p(t=>[...t,`Deleted agent: ${h.bold(e.agentType)}`]),r({mode:`list-agents`,source:`all`})}catch(e){Lt(St(e))}},[s]);switch(n.mode){case`list-agents`:{let e=$t(n.source===`all`?[..._[`built-in`],..._.userSettings,..._.projectSettings,..._.localSettings,..._.policySettings,..._.flagSettings,..._.plugin]:_[n.source],d);return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Xn,{source:n.source,agents:e,onBack:()=>{t((f.length>0?`Agent changes:\n${f.join(`
103
- `)}`:void 0)??`Agents dialog dismissed`,{display:f.length===0?`system`:void 0})},onSelect:e=>r({mode:`agent-menu`,agent:e,previousMode:n}),onCreateNew:()=>r({mode:`create-agent`}),changes:f}),(0,$.jsx)(qn,{})]})}case`create-agent`:return(0,$.jsx)(Gr,{tools:m,existingAgents:d,onComplete:v,onCancel:()=>r({mode:`list-agents`,source:`all`})});case`agent-menu`:{let e=u.find(e=>e.agentType===n.agent.agentType&&e.source===n.agent.source)||n.agent,t=[{label:`View agent`,value:`view`},...e.source!==`built-in`&&e.source!==`plugin`&&e.source!==`flagSettings`?[{label:`Edit agent`,value:`edit`},{label:`Delete agent`,value:`delete`}]:[],{label:`Back`,value:`back`}];return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(g,{title:n.agent.agentType,onCancel:()=>r(n.previousMode),hideInputGuide:!0,children:(0,$.jsxs)(c,{flexDirection:`column`,children:[(0,$.jsx)(We,{options:t,onChange:t=>{switch(t){case`view`:r({mode:`view-agent`,agent:e,previousMode:n.previousMode});break;case`edit`:r({mode:`edit-agent`,agent:e,previousMode:n});break;case`delete`:r({mode:`delete-confirm`,agent:e,previousMode:n});break;case`back`:r(n.previousMode);break}},onCancel:()=>r(n.previousMode)}),f.length>0&&(0,$.jsx)(c,{marginTop:1,children:(0,$.jsx)(l,{dimColor:!0,children:f[f.length-1]})})]})}),(0,$.jsx)(qn,{})]})}case`view-agent`:{let e=u.find(e=>e.agentType===n.agent.agentType&&e.source===n.agent.source)||n.agent;return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(g,{title:e.agentType,onCancel:()=>r({mode:`agent-menu`,agent:e,previousMode:n.previousMode}),hideInputGuide:!0,children:(0,$.jsx)(kn,{agent:e,tools:m,allAgents:u,onBack:()=>r({mode:`agent-menu`,agent:e,previousMode:n.previousMode})})}),(0,$.jsx)(qn,{instructions:`Press Enter or Esc to go back`})]})}case`delete-confirm`:return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(g,{title:`Delete agent`,onCancel:()=>{`previousMode`in n&&r(n.previousMode)},color:`error`,children:[(0,$.jsxs)(l,{children:[`Are you sure you want to delete the agent `,(0,$.jsx)(l,{bold:!0,children:n.agent.agentType}),`?`]}),(0,$.jsx)(c,{marginTop:1,children:(0,$.jsxs)(l,{dimColor:!0,children:[`Source: `,n.agent.source]})}),(0,$.jsx)(c,{marginTop:1,children:(0,$.jsx)(We,{options:[{label:`Yes, delete`,value:`yes`},{label:`No, cancel`,value:`no`}],onChange:e=>{e===`yes`?y(n.agent):`previousMode`in n&&r(n.previousMode)},onCancel:()=>{`previousMode`in n&&r(n.previousMode)}})})]}),(0,$.jsx)(qn,{instructions:`Press ↑↓ to navigate, Enter to select, Esc to cancel`})]});case`edit-agent`:{let e=u.find(e=>e.agentType===n.agent.agentType&&e.source===n.agent.source)||n.agent;return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(g,{title:`Edit agent: ${e.agentType}`,onCancel:()=>r(n.previousMode),hideInputGuide:!0,children:(0,$.jsx)(Gn,{agent:e,tools:m,onSaved:e=>{v(e),r(n.previousMode)},onBack:()=>r(n.previousMode)})}),(0,$.jsx)(qn,{})]})}default:return null}}var Yr,$,Xr=e((()=>{f(),p(),Yr=t(p(),1),rn(),on(),m(),ye(),Zt(),Ze(),Ct(),It(),Ne(),An(),Kn(),Yn(),Qn(),On(),qr(),$=_()}));async function Zr(e,t){let n=t.getAppState().toolPermissionContext;return(0,Qr.jsx)(Jr,{tools:le(n),onExit:e})}var Qr;e((()=>{p(),Xr(),De(),Qr=_()}))();export{Zr as call};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{A_ as t,M_ as n}from"./loadAgentsDir-x3rlgED4.js";import{g as r,u as i}from"./settings-BeLFUeie.js";function a(){let e=i(),n=[`user`,`project`,`local`].flatMap(e=>t(e).errors);return{settings:e.settings,errors:[...e.errors,...n]}}var o=e((()=>{n(),r()}));export{o as n,a as t};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";function t(e){let t;for(let n in e)n.startsWith(`_PROTO_`)&&(t===void 0&&(t={...e}),delete t[n]);return t??e}function n(e){if(o===null&&(o=e,a.length>0)){let e=[...a];a.length=0,process.env.USER_TYPE===`ant`&&o.logEvent(`analytics_sink_attached`,{queued_event_count:e.length}),queueMicrotask(()=>{for(let t of e)t.async?o.logEventAsync(t.eventName,t.metadata):o.logEvent(t.eventName,t.metadata)})}}function r(e,t){if(o===null){a.push({eventName:e,metadata:t,async:!1});return}o.logEvent(e,t)}async function i(e,t){if(o===null){a.push({eventName:e,metadata:t,async:!0});return}await o.logEventAsync(e,t)}var a,o,s=e((()=>{a=[],o=null}));export{t as a,i,s as n,r,n as t};
@@ -1 +0,0 @@
1
- import{CC as e,gC as t,mC as n,vC as r,xC as i,yC as a}from"./loadAgentsDir-x3rlgED4.js";import{s as o,u as s}from"./logoV2Utils-gGK9gErT.js";a(),s();var c=`default`;async function l(e,t){let r=await n(t.list||c,{subject:e,description:t.description||``,status:`pending`,blocks:[],blockedBy:[]});console.log(`Created task ${r}: ${e}`)}async function u(e){let t=await i(e.list||c);if(e.pending&&(t=t.filter(e=>e.status===`pending`)),e.json){console.log(JSON.stringify(t,null,2));return}if(t.length===0){console.log(`No tasks found.`);return}for(let e of t)console.log(` [${e.status}] ${e.id}: ${e.subject}`),e.description&&console.log(` ${e.description}`),e.owner&&console.log(` owner: ${e.owner}`)}async function d(e,n){let r=await t(n.list||c,e);if(!r){console.error(`Task not found: ${e}`),process.exitCode=1;return}console.log(JSON.stringify(r,null,2))}async function f(t,n){let r=n.list||c,i={};n.status&&(i.status=n.status),n.subject&&(i.subject=n.subject),n.description&&(i.description=n.description),n.owner&&(i.owner=n.owner),n.clearOwner&&(i.owner=void 0);let a=await e(r,t,i);if(!a){console.error(`Task not found: ${t}`),process.exitCode=1;return}console.log(`Updated task ${t}: [${a.status}] ${a.subject}`)}async function p(e){let t=e.list||c;console.log(r(t))}async function m(e){let t=await o();if(e===void 0){if(t.length===0){console.log(`No recent sessions.`);return}for(let e=0;e<Math.min(t.length,20);e++){let n=t[e],r=n.modified?new Date(n.modified).toLocaleString():`unknown`,i=n.title||n.sessionId||`untitled`;console.log(` ${e}: ${i} (${r})`)}return}let n=typeof e==`string`?parseInt(e,10):e,r=Number.isFinite(n)&&n>=0&&n<t.length?t[n]:t.find(t=>t.sessionId===String(e));if(!r){console.error(`Session not found: ${e}`),process.exitCode=1;return}console.log(JSON.stringify(r,null,2))}async function h(e){let t=await o(),n=e??5;console.log(`Last ${n} sessions:`);for(let e=0;e<Math.min(n,t.length);e++){let n=t[e],r=n.modified?new Date(n.modified).toLocaleString():`unknown`;console.log(` ${e}: ${n.sessionId} (${r})`)}}async function g(e,t,n){let{regenerateCompletionCache:r}=await import(`./completionCache-c4aiyZ_f.js`);t.output,await r(),console.log(`Completion cache regenerated for ${e}.`)}export{g as completionHandler,h as errorHandler,m as logHandler,l as taskCreateHandler,p as taskDirHandler,d as taskGetHandler,u as taskListHandler,f as taskUpdateHandler};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./axios-DaWTGg7G.js";import{i as r,n as i,r as a,t as o}from"./lazySchema-DULtBUCI.js";import{F as s,S as c,W as l,a as u,l as d,w as f,z as p}from"./debug-BrXObCdR.js";import{c as m,g as h}from"./config-DRDuVyzE.js";import{o as g,s as _}from"./log-BMCygSzM.js";import{l as v,u as y}from"./oauth-BqJqV-2M.js";import{Bt as b,Lr as x,Ot as S,Rr as C,_n as w,vn as T}from"./model-CZViyZnE.js";import{a as E,i as D}from"./detectRepository-BPr0VWNO.js";import{randomUUID as O}from"crypto";function k(e){return t.isAxiosError(e)?!e.response||e.response.status>=500:!1}async function A(e,n){let r;for(let i=0;i<=V;i++)try{return await t.get(e,n)}catch(e){if(r=e,!k(e))throw e;if(i>=V)throw d(`Teleport request failed after ${i+1} attempts: ${s(e)}`),e;let t=B[i]??2e3;d(`Teleport request failed (attempt ${i+1}/${V+1}), retrying in ${t}ms: ${s(e)}`),await T(t)}throw r}function j(e){return e===null||typeof e==`string`&&e.trim()===``}async function M(){let e=m(),t=process.env.ANTHROPIC_API_KEY?.trim()||e.workspaceApiKey?.trim();if(!t){let t=e.workspaceApiKey,n=j(t)?`Your workspace API key was cleared. `:`A workspace API key (sk-ant-api03-*) is required to use workspace endpoints (/v1/agents, /v1/vaults, /v1/memory_stores, /v1/skills). `;throw Error(n+`Set ANTHROPIC_API_KEY=<key> and restart. Obtain a key from https://console.anthropic.com/settings/keys. Subscription OAuth (claude.ai login) cannot reach these endpoints.`)}if(!t.startsWith(`sk-ant-api03-`))throw Error(`Workspace API key must start with sk-ant-api03-, got prefix "${t.slice(0,4)}...". Obtain a workspace API key from https://console.anthropic.com/settings/keys.`);return{apiKey:t}}async function N(){let e=S()?.accessToken;if(e===void 0)throw Error(`Work Mate web sessions require authentication with a Claude.ai account. API key authentication is not sufficient.`);let t=await x();if(!t)throw Error(`Unable to get organization UUID`);return{accessToken:e,orgUUID:t}}async function P(){let{accessToken:e,orgUUID:t}=await N(),n=`${v().BASE_API_URL}/v1/sessions`;try{let r=await A(n,{headers:{...F(e),"anthropic-beta":`ccr-byoc-2025-07-29`,"x-organization-uuid":t}});if(r.status!==200)throw Error(`Failed to fetch code sessions: ${r.statusText}`);return r.data.data.map(e=>{let t=e.session_context.sources.find(e=>e.type===`git_repository`),n=null;if(t?.url){let e=E(t.url);if(e){let[r,i]=e.split(`/`);r&&i&&(n={name:i,owner:{login:r},default_branch:t.revision||void 0})}}return{id:e.id,title:e.title||`Untitled`,description:``,status:e.session_status,repo:n,turns:[],created_at:e.created_at,updated_at:e.updated_at}})}catch(e){throw _(l(e)),e}}function F(e){return{Authorization:`Bearer ${e}`,"Content-Type":`application/json`,"anthropic-version":`2023-06-01`}}async function I(e){let{accessToken:n,orgUUID:r}=await N(),i=`${v().BASE_API_URL}/v1/sessions/${e}`,a={...F(n),"anthropic-beta":`ccr-byoc-2025-07-29`,"x-organization-uuid":r},o=await t.get(i,{headers:a,timeout:15e3,validateStatus:e=>e<500});if(o.status!==200){let t=o.data?.error?.message;throw o.status===404?Error(`Session not found: ${e}`):o.status===401?Error(`Session expired.`):Error(t||`Failed to fetch session: ${o.status} ${o.statusText}`)}return o.data}function L(e){return(e.session_context.outcomes?.find(e=>e.type===`git_repository`))?.git_info?.branches[0]}async function R(e,n,r){try{let{accessToken:i,orgUUID:a}=await N(),o=`${v().BASE_API_URL}/v1/sessions/${e}/events`,s={...F(i),"anthropic-beta":`ccr-byoc-2025-07-29`,"x-organization-uuid":a},c={events:[{uuid:r?.uuid??O(),session_id:e,type:`user`,parent_tool_use_id:null,message:{role:`user`,content:n}}]};d(`[sendEventToRemoteSession] Sending event to session ${e}`);let l=await t.post(o,c,{headers:s,validateStatus:e=>e<500,timeout:3e4});return l.status===200||l.status===201?(d(`[sendEventToRemoteSession] Successfully sent event to session ${e}`),!0):(d(`[sendEventToRemoteSession] Failed with status ${l.status}: ${f(l.data)}`),!1)}catch(e){return d(`[sendEventToRemoteSession] Error: ${s(e)}`),!1}}async function z(e,n){try{let{accessToken:r,orgUUID:i}=await N(),a=`${v().BASE_API_URL}/v1/sessions/${e}`,o={...F(r),"anthropic-beta":`ccr-byoc-2025-07-29`,"x-organization-uuid":i};d(`[updateSessionTitle] Updating title for session ${e}: "${n}"`);let s=await t.patch(a,{title:n},{headers:o,validateStatus:e=>e<500});return s.status===200?(d(`[updateSessionTitle] Successfully updated title for session ${e}`),!0):(d(`[updateSessionTitle] Failed with status ${s.status}: ${f(s.data)}`),!1)}catch(e){return d(`[updateSessionTitle] Error: ${s(e)}`),!1}}var B,V,H=e((()=>{n(),y(),C(),a(),b(),h(),u(),D(),p(),o(),g(),w(),c(),B=[2e3,4e3,8e3,16e3],V=B.length,i(()=>r.object({id:r.string(),title:r.string(),description:r.string(),status:r.enum([`idle`,`working`,`waiting`,`completed`,`archived`,`cancelled`,`rejected`]),repo:r.object({name:r.string(),owner:r.object({login:r.string()}),default_branch:r.string().optional()}).nullable(),turns:r.array(r.string()),created_at:r.string(),updated_at:r.string()}))}));export{F as a,j as c,R as d,z as f,L as i,N as l,P as n,H as o,I as r,k as s,A as t,M as u};
@@ -1 +0,0 @@
1
- import{a as e,n as t,o as n}from"./api-2cdIPaeq.js";n();export{t as fetchCodeSessionsFromSessionsAPI,e as getOAuthHeaders};
@@ -1 +0,0 @@
1
- import{r as e}from"./asciicast-CbAjUHT_.js";export{e as renameRecordingForSession};
@@ -1 +0,0 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Gt as n,I as r,P as i,_ as a,fi as o,t as s,y as c}from"./src-CDCSSo0U2.js";import{t as l}from"./jsx-runtime-Bb4Xn-E0.js";import{H as u,Pn as d,en as f}from"./state-ix0xIunV.js";import{cx as p,dx as m}from"./loadAgentsDir-x3rlgED4.js";import{_ as h,r as g}from"./git-Do0wJvux.js";import{u as _}from"./referral-CKmHHxj_.js";import{t as v}from"./Dialog-vfLXEPed.js";import{t as y}from"./ListItem-vfLXEPed.js";import{i as b,o as x,t as S}from"./cliLaunch-BkPAatcs.js";import{resolve as C}from"path";async function w(){let e=process.cwd();return g(e)||C(e)}function T({defaultDir:e,onInstalled:t,onCancel:o,onError:s}){m(`assistant-install-wizard`);let[l,u]=(0,D.useState)(0),[d,f]=(0,D.useState)(!1);n({"select:next":()=>u(e=>(e+1)%2),"select:previous":()=>u(e=>(e-1+2)%2),"select:accept":()=>{l===0?p():o()}},{context:`Select`});function p(){if(d)return;f(!0);let n=e||C(`.`);try{let e=x(S([`daemon`,`start`,`--dir=${n}`]),{cwd:n,stdio:`ignore`,detached:!0});e.unref(),e.on(`error`,e=>{s(`Failed to start daemon: ${e.message}`)}),setTimeout(()=>{t(n)},1500)}catch(e){s(`Failed to start daemon: ${e instanceof Error?e.message:String(e)}`)}}return d?(0,O.jsx)(c,{title:`Assistant Setup`,onCancel:o,hideInputGuide:!0,children:(0,O.jsxs)(i,{children:[`Starting daemon in `,e,`...`]})}):(0,O.jsx)(c,{title:`Assistant Setup`,onCancel:o,hideInputGuide:!0,children:(0,O.jsxs)(r,{flexDirection:`column`,gap:1,children:[(0,O.jsx)(i,{children:`No active assistant sessions found.`}),(0,O.jsxs)(i,{children:[`Start a daemon in `,(0,O.jsx)(i,{bold:!0,children:e||`.`}),` to create a cloud session?`]}),(0,O.jsxs)(r,{flexDirection:`column`,children:[(0,O.jsx)(a,{isFocused:l===0,children:(0,O.jsx)(i,{children:`Start assistant daemon`})}),(0,O.jsx)(a,{isFocused:l===1,children:(0,O.jsx)(i,{children:`Cancel`})})]}),(0,O.jsx)(i,{dimColor:!0,children:`Enter to select · Esc to cancel`})]})})}async function E(e,t,n){let{setAppState:r,getAppState:i}=t;return u()?(i().assistantPanelVisible?(r(e=>({...e,assistantPanelVisible:!1})),e(`Assistant panel hidden.`,{display:`system`})):(r(e=>({...e,assistantPanelVisible:!0})),e(`Assistant panel opened.`,{display:`system`})),null):(d(!0),r(e=>({...e,kairosEnabled:!0,assistantPanelVisible:!0})),e(`KAIROS assistant mode activated.`,{display:`system`}),null)}var D,O;e((()=>{o(),D=t(o(),1),s(),v(),y(),p(),_(),h(),b(),f(),O=l()}))();export{T as NewInstallWizard,E as call,w as computeDefaultInstallDir};
@@ -1 +0,0 @@
1
- import{n as e,r as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,o as r}from"./envUtils-DSxRz_kt.js";import{H as i,en as a}from"./state-ix0xIunV.js";import{join as o}from"path";import{readFileSync as s}from"fs";var c=t({getAssistantActivationPath:()=>p,getAssistantSystemPromptAddendum:()=>f,isAssistantForced:()=>d,isAssistantMode:()=>l,markAssistantForced:()=>u});function l(){return i()}function u(){m=!0}function d(){return m}function f(){try{return s(o(n(),`agents`,`assistant.md`),`utf-8`)}catch{return``}}function p(){if(l())return m?`daemon`:`gate`}var m,h=e((()=>{a(),r(),m=!1}));export{d as a,h as i,p as n,l as o,f as r,u as s,c as t};
@@ -1 +0,0 @@
1
- import{i as e,o as t}from"./assistant-C83quuNj.js";e();export{t as isAssistantMode};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./auth-DqcKPbw8.js";export{t as authLogin,e as authStatus};
@@ -1 +0,0 @@
1
- import{Bt as e,It as t,Ot as n,mt as r,yt as i}from"./model-CZViyZnE.js";e();export{r as checkAndRefreshOAuthTokenIfNeeded,i as clearOAuthTokenCache,n as getClaudeAIOAuthTokens,t as handleOAuth401Error};
@@ -1,15 +0,0 @@
1
- import{d as e,o as t}from"./envUtils-DSxRz_kt.js";import{n,t as r}from"./defineProperty-C-QyHrDq.js";import{n as i,t as a}from"./axios-DaWTGg7G.js";import{Na as o,Pa as s}from"./loadAgentsDir-x3rlgED4.js";import{F as c,S as l,a as u,l as d,w as f,z as p}from"./debug-BrXObCdR.js";import{g as ee,n as te}from"./settings-BeLFUeie.js";import{b as m,c as ne,g as h}from"./config-DRDuVyzE.js";import{o as g,s as _}from"./log-BMCygSzM.js";import{n as v,r as y}from"./analytics-BotDBGh0.js";import{l as b,u as x}from"./oauth-BqJqV-2M.js";import{$n as S,Br as C,Bt as w,Cn as T,Dt as E,En as re,Fr as ie,Ft as ae,Hr as oe,Ir as se,Kr as D,Mr as O,Nr as k,Ot as A,Pr as j,Rr as M,Si as N,Sn as P,St as F,Ur as I,Wr as L,ar as R,fn as z,gn as B,jn as V,jt as H,mn as U,nn as W,or as G,pn as K,qr as ce,rr as le,un as ue,wi as de,yt as q}from"./model-CZViyZnE.js";import{P as fe,W as J}from"./rcDebugLog-DBB9r8aw.js";import{d as pe,u as me}from"./firstPartyEventLogger-BXY1IJ2D.js";import{n as he,t as ge}from"./browser-BmZuQom6.js";import{n as _e}from"./trustedDevice-CKedohmT.js";import{a as ve,i as ye,r as be}from"./grove-BQisE2JM.js";import{t as xe}from"./remoteManagedSettings-bswzAB6W.js";import{d as Se,n as Ce,t as we}from"./status-D4IQpsNK.js";import{createHash as Te,randomBytes as Y}from"crypto";import{createServer as Ee}from"http";ve(),s(),w(),V(),h(),T(),B(),me();async function X(){A.cache?.clear?.(),_e(),re(),U(),pe(),be.cache?.clear?.(),ye.cache?.clear?.(),await xe(),await o()}async function De({clearOnboarding:e=!1}){let{flushTelemetry:t}=await import(`./instrumentation-Yt31gxWN.js`);await t(),await ue(),P().delete(),await X(),m(t=>{let n={...t};return e&&(n.hasCompletedOnboarding=!1,n.subscriptionNoticeCount=0,n.hasAvailableSubscription=!1,n.customApiKeyResponses?.approved&&(n.customApiKeyResponses={...n.customApiKeyResponses,approved:[]})),n.oauthAccount=void 0,n})}t(),n(),p(),l(),u(),v(),ee(),de(),ce(),M(),fe(),a(),x(),h(),le(),g(),G();async function Oe(){try{if(ne().claudeCodeFirstTokenDate!==void 0)return;let e=S();if(e.error){_(Error(`Failed to get auth headers: ${e.error}`));return}let t=`${b().BASE_API_URL}/api/organization/claude_code_first_token_date`,n=(await i.get(t,{headers:{...e.headers,"User-Agent":R()},timeout:1e4})).data?.first_token_date??null;if(n!==null){let e=new Date(n).getTime();if(isNaN(e)){_(Error(`Received invalid first_token_date from API: ${n}`));return}}m(e=>({...e,claudeCodeFirstTokenDate:n}))}catch(e){_(e)}}ge(),x(),g();var ke=class{constructor(e=`/callback`){r(this,`localServer`,void 0),r(this,`port`,0),r(this,`promiseResolver`,null),r(this,`promiseRejecter`,null),r(this,`expectedState`,null),r(this,`pendingResponse`,null),r(this,`callbackPath`,void 0),this.localServer=Ee(),this.callbackPath=e}async start(e){return new Promise((t,n)=>{this.localServer.once(`error`,e=>{n(Error(`Failed to start OAuth callback server: ${e.message}`))}),this.localServer.listen(e??0,`localhost`,()=>{let e=this.localServer.address();this.port=e.port,t(this.port)})})}getPort(){return this.port}hasPendingResponse(){return this.pendingResponse!==null}async waitForAuthorization(e,t){return new Promise((n,r)=>{this.promiseResolver=n,this.promiseRejecter=r,this.expectedState=e,this.startLocalListener(t)})}handleSuccessRedirect(e,t){if(!this.pendingResponse)return;if(t){t(this.pendingResponse,e),this.pendingResponse=null,y(`tengu_oauth_automatic_redirect`,{custom_handler:!0});return}let n=I(e)?b().CLAUDEAI_SUCCESS_URL:b().CONSOLE_SUCCESS_URL;this.pendingResponse.writeHead(302,{Location:n}),this.pendingResponse.end(),this.pendingResponse=null,y(`tengu_oauth_automatic_redirect`,{})}handleErrorRedirect(){if(!this.pendingResponse)return;let e=b().CLAUDEAI_SUCCESS_URL;this.pendingResponse.writeHead(302,{Location:e}),this.pendingResponse.end(),this.pendingResponse=null,y(`tengu_oauth_automatic_redirect_error`,{})}startLocalListener(e){this.localServer.on(`request`,this.handleRedirect.bind(this)),this.localServer.on(`error`,this.handleError.bind(this)),e()}handleRedirect(e,t){let n=new URL(e.url||``,`http://${e.headers.host||`localhost`}`);if(n.pathname!==this.callbackPath){t.writeHead(404),t.end();return}let r=n.searchParams.get(`code`)??void 0,i=n.searchParams.get(`state`)??void 0;this.validateAndRespond(r,i,t)}validateAndRespond(e,t,n){if(!e){n.writeHead(400),n.end(`Authorization code not found`),this.reject(Error(`No authorization code received`));return}if(t!==this.expectedState){n.writeHead(400),n.end(`Invalid state parameter`),this.reject(Error(`Invalid state parameter`));return}this.pendingResponse=n,this.resolve(e)}handleError(e){_(e),this.close(),this.reject(e)}resolve(e){this.promiseResolver&&(this.promiseResolver(e),this.promiseResolver=null,this.promiseRejecter=null)}reject(e){this.promiseRejecter&&(this.promiseRejecter(e),this.promiseResolver=null,this.promiseRejecter=null)}close(){this.pendingResponse&&this.handleErrorRedirect(),this.localServer&&(this.localServer.removeAllListeners(),this.localServer.close())}};function Z(e){return e.toString(`base64`).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=/g,``)}function Ae(){return Z(Y(32))}function je(e){let t=Te(`sha256`);return t.update(e),Z(t.digest())}function Me(){return Z(Y(32))}v(),M(),n();var Q=class{constructor(){r(this,`codeVerifier`,void 0),r(this,`authCodeListener`,null),r(this,`port`,null),r(this,`manualAuthCodeResolver`,null),this.codeVerifier=Ae()}async startOAuthFlow(e,t){this.authCodeListener=new ke,this.port=await this.authCodeListener.start();let n=je(this.codeVerifier),r=Me(),i={codeChallenge:n,state:r,port:this.port,loginWithClaudeAi:t?.loginWithClaudeAi,inferenceOnly:t?.inferenceOnly,orgUUID:t?.orgUUID,loginHint:t?.loginHint,loginMethod:t?.loginMethod},a=O({...i,isManual:!0}),o=O({...i,isManual:!1}),s=await this.waitForAuthorizationCode(r,async()=>{t?.skipBrowserOpen?await e(a,o):(await e(a),await he(o))}),c=this.authCodeListener?.hasPendingResponse()??!1;y(`tengu_oauth_auth_code_received`,{automatic:c});try{let e=await j(s,r,this.codeVerifier,this.port,!c,t?.expiresIn),n=await se(e.access_token);if(c){let t=C(e.scope);this.authCodeListener?.handleSuccessRedirect(t)}return this.formatTokens(e,n.subscriptionType,n.rateLimitTier,n.rawProfile)}catch(e){throw c&&this.authCodeListener?.handleErrorRedirect(),e}finally{this.authCodeListener?.close()}}async waitForAuthorizationCode(e,t){return new Promise((n,r)=>{this.manualAuthCodeResolver=n,this.authCodeListener?.waitForAuthorization(e,t).then(e=>{this.manualAuthCodeResolver=null,n(e)}).catch(e=>{this.manualAuthCodeResolver=null,r(e)})})}handleManualAuthCodeInput(e){this.manualAuthCodeResolver&&(this.manualAuthCodeResolver(e.authorizationCode),this.manualAuthCodeResolver=null,this.authCodeListener?.close())}formatTokens(e,t,n,r){return{accessToken:e.access_token,refreshToken:e.refresh_token,expiresAt:Date.now()+e.expires_in*1e3,scopes:C(e.scope),subscriptionType:t,rateLimitTier:n,profile:r,tokenAccount:e.account?{uuid:e.account.uuid,emailAddress:e.account.email_address,organizationUuid:e.organization?.uuid}:void 0}}cleanup(){this.authCodeListener?.close(),this.manualAuthCodeResolver=null}};v(),M(),w(),h(),g(),Se();async function $(e){await De({clearOnboarding:!1});let t=e.profile??await D(e.accessToken);t?L({accountUuid:t.account.uuid,emailAddress:t.account.email,organizationUuid:t.organization.uuid,displayName:t.account.display_name||void 0,hasExtraUsageEnabled:t.organization.has_extra_usage_enabled??void 0,billingType:t.organization.billing_type??void 0,subscriptionCreatedAt:t.organization.subscription_created_at??void 0,accountCreatedAt:t.account.created_at}):e.tokenAccount&&L({accountUuid:e.tokenAccount.uuid,emailAddress:e.tokenAccount.emailAddress,organizationUuid:e.tokenAccount.organizationUuid});let n=z(e);if(q(),n.warning&&y(`tengu_oauth_storage_warning`,{warning:n.warning}),await ie(e.accessToken).catch(e=>d(String(e),{level:`error`})),I(e.scopes))await Oe().catch(e=>d(String(e),{level:`error`}));else if(!await k(e.accessToken))throw Error(`Unable to create API key. The server accepted the request but did not return a key.`);await X()}async function Ne({email:e,sso:t,console:n,claudeai:r}){n&&r&&(process.stderr.write(`Error: --console and --claudeai cannot be used together.
2
- `),process.exit(1));let i=te(),a=i.forceLoginMethod?i.forceLoginMethod===`claudeai`:!n,o=i.forceLoginOrgUUID,s=process.env.CLAUDE_CODE_OAUTH_REFRESH_TOKEN;if(s){let e=process.env.CLAUDE_CODE_OAUTH_SCOPES;e||(process.stderr.write(`CLAUDE_CODE_OAUTH_SCOPES is required when using CLAUDE_CODE_OAUTH_REFRESH_TOKEN.
3
- Set it to the space-separated scopes the refresh token was issued with
4
- (e.g. "user:inference" or "user:profile user:inference user:sessions:claude_code user:mcp_servers").
5
- `),process.exit(1));let t=e.split(/\s+/).filter(Boolean);try{y(`tengu_login_from_refresh_token`,{});let e=await oe(s,{scopes:t});await $(e);let n=await K();n.valid||(process.stderr.write(n.message+`
6
- `),process.exit(1)),m(e=>e.hasCompletedOnboarding?e:{...e,hasCompletedOnboarding:!0}),y(`tengu_oauth_success`,{loginWithClaudeAi:I(e.scopes)}),process.stdout.write(`Login successful.
7
- `),process.exit(0)}catch(e){_(e);let t=J(e);process.stderr.write(`Login failed: ${c(e)}\n${t?t+`
8
- `:``}`),process.exit(1)}}let l=t?`sso`:void 0,u=new Q;try{y(`tengu_oauth_flow_start`,{loginWithClaudeAi:a}),await $(await u.startOAuthFlow(async e=>{process.stdout.write(`Opening browser to sign in…
9
- `),process.stdout.write(`If the browser didn't open, visit: ${e}\n`)},{loginWithClaudeAi:a,loginHint:e,loginMethod:l,orgUUID:o}));let t=await K();t.valid||(process.stderr.write(t.message+`
10
- `),process.exit(1)),y(`tengu_oauth_success`,{loginWithClaudeAi:a}),process.stdout.write(`Login successful.
11
- `),process.exit(0)}catch(e){_(e);let t=J(e);process.stderr.write(`Login failed: ${c(e)}\n${t?t+`
12
- `:``}`),process.exit(1)}finally{u.cleanup()}}async function Pe(t){let{source:n,hasToken:r}=E(),{source:i}=F(),a=!!process.env.ANTHROPIC_API_KEY&&!e(),o=H(),s=ae(),c=W(),l=r||i!==`none`||a||c,u=`none`;if(c?u=`third_party`:n===`claude.ai`?u=`claude.ai`:n===`apiKeyHelper`?u=`api_key_helper`:n===`none`?i===`ANTHROPIC_API_KEY`||a?u=`api_key`:i===`/login managed key`&&(u=`claude.ai`):u=`oauth_token`,t.text){let e=[...Ce(),...we()],t=!1;for(let n of e){let e=typeof n.value==`string`?n.value:Array.isArray(n.value)?n.value.join(`, `):null;e===null||e===`none`||(t=!0,n.label?process.stdout.write(`${n.label}: ${e}\n`):process.stdout.write(`${e}\n`))}!t&&a&&process.stdout.write(`API key: ANTHROPIC_API_KEY
13
- `),l||process.stdout.write(`Not logged in.
14
- `)}else{let e=N(),t=i===`none`?a?`ANTHROPIC_API_KEY`:null:i,n={loggedIn:l,authMethod:u,apiProvider:e};t&&(n.apiKeySource=t),u===`claude.ai`&&(n.email=o?.emailAddress??null,n.orgId=o?.organizationUuid??null,n.orgName=o?.organizationName??null,n.subscriptionType=s??null),process.stdout.write(f(n,null,2)+`
15
- `)}process.exit(+!l)}export{Q as i,Pe as n,$ as r,Ne as t};
@@ -1 +0,0 @@
1
- import{t as e}from"./backgroundHousekeeping-DtJNx4Ja.js";export{e as startBackgroundHousekeeping};
@@ -1,17 +0,0 @@
1
- import{a as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,o as r}from"./envUtils-DSxRz_kt.js";import{K as i,R as a,en as o}from"./state-ix0xIunV.js";import{Bw as s,Et as c,Fg as l,Fw as u,HT as d,Hl as ee,Iw as f,Mo as p,Ng as te,Ul as m,_o as h,aS as g,br as _,bx as v,et as y,ho as b,ht as ne,jr as re,nt as ie,oS as ae,vo as oe,vx as se}from"./loadAgentsDir-x3rlgED4.js";import{n as ce,t as le}from"./cwd-CYmmnQVS.js";import{S as ue,W as de,a as fe,d as x,l as S,p as C,z as w}from"./debug-BrXObCdR.js";import{f as T,g as E,y as D}from"./settings-BeLFUeie.js";import{C as O,T as k,w as A}from"./config-DRDuVyzE.js";import{o as j,s as M,v as N,y as P}from"./log-BMCygSzM.js";import{n as F,r as I}from"./analytics-BotDBGh0.js";import{_ as L,h as R}from"./model-CZViyZnE.js";import{Tn as z,wn as B}from"./prompt-CE3sFmZV.js";import{st as V}from"./rcDebugLog-DBB9r8aw.js";import{i as H,t as U}from"./nativeInstaller-yj81F75v.js";import{n as pe,t as me}from"./allErrors-CQE2k0zO.js";import{n as he,r as ge}from"./magicDocs-qdDB_mKb.js";import{n as _e,t as ve}from"./pluginAutoupdate-0k03PVff.js";import{n as ye,r as be}from"./registerProtocol-wZv2uiW_.js";import{homedir as xe}from"os";import{join as W}from"path";import"crypto";import*as G from"fs/promises";r(),o(),ce(),ue(),C(),fe(),P(),E(),z(),L(),s(),m(),re(),ge(),y(),j(),w(),p(),d(),y(),f(),w(),j(),p(),d();async function Se(e,t){if(!e)return;let{join:n}=await import(`path`),r=await import(`fs/promises`),i=n(le(),`.claude`,`skills`,e,`SKILL.md`),a;try{a=await r.readFile(i,`utf-8`)}catch{M(Error(`Failed to read skill file for improvement: ${i}`));return}let o=t.map(e=>`- ${e.section}: ${e.change}`).join(`
2
- `),s=R(),c=await ie({messages:[b({content:`You are editing a skill definition file. Apply the following improvements to the skill.
3
-
4
- <current_skill_file>
5
- ${a}
6
- </current_skill_file>
7
-
8
- <improvements>
9
- ${o}
10
- </improvements>
11
-
12
- Rules:
13
- - Integrate the improvements naturally into the existing structure
14
- - Preserve frontmatter (--- block) exactly as-is
15
- - Preserve the overall format and style
16
- - Do not remove existing content unless an improvement explicitly replaces it
17
- - Output the complete updated file inside <updated_file> tags`})],systemPrompt:V([`You edit skill definition files to incorporate user preferences. Output only the updated file content.`]),thinkingConfig:{type:`disabled`},tools:[],signal:u().signal,options:{getToolPermissionContext:async()=>B(),model:s,toolChoice:void 0,isNonInteractiveSession:!1,hasAppendSystemPrompt:!1,temperatureOverride:0,agents:[],querySource:`skill_improvement_apply`,mcpTools:[]}}),l=h(oe(Array.isArray(c.message.content)?c.message.content:[]).trim(),`updated_file`);if(!l){M(Error(`Skill improvement apply: no updated_file tag in response`));return}try{await r.writeFile(i,l,`utf-8`)}catch(e){M(de(e))}}F(),v(),O(),j(),U(),ae(),pe(),l(),c();var Ce=30;function K(){let e=((T()||{}).cleanupPeriodDays??Ce)*24*60*60*1e3;return new Date(Date.now()-e)}function we(e,t){return{messages:e.messages+t.messages,errors:e.errors+t.errors}}function Te(e){let t=e.split(`.`)[0].replace(/T(\d{2})-(\d{2})-(\d{2})-(\d{3})Z/,`T$1:$2:$3.$4Z`);return new Date(t)}async function q(e,t,n){let r={messages:0,errors:0};try{let i=await x().readdir(e);for(let a of i)try{Te(a.name)<t&&(await x().unlink(W(e,a.name)),n?r.messages++:r.errors++)}catch(e){M(e)}}catch(e){e instanceof Error&&`code`in e&&e.code!==`ENOENT`&&M(e)}return r}async function Ee(){let e=x(),t=K(),n=N.errors(),r=N.baseLogs(),i=await q(n,t,!1);try{let n;try{n=await e.readdir(r)}catch{return i}let a=n.filter(e=>e.isDirectory()&&e.name.startsWith(`mcp-logs-`)).map(e=>W(r,e.name));for(let n of a)i=we(i,await q(n,t,!0)),await Y(n,e)}catch(e){e instanceof Error&&`code`in e&&e.code!==`ENOENT`&&M(e)}return i}async function J(e,t,n){return(await n.stat(e)).mtime<t?(await n.unlink(e),!0):!1}async function Y(e,t){try{await t.rmdir(e)}catch{}}async function De(){let e=K(),t={messages:0,errors:0},n=_(),r=x(),i;try{i=await r.readdir(n)}catch{return t}for(let a of i){if(!a.isDirectory())continue;let i=W(n,a.name),o;try{o=await r.readdir(i)}catch{t.errors++;continue}for(let n of o)if(n.isFile()){if(!n.name.endsWith(`.jsonl`)&&!n.name.endsWith(`.cast`))continue;try{await J(W(i,n.name),e,r)&&t.messages++}catch{t.errors++}}else if(n.isDirectory()){let a=W(i,n.name),o=W(a,te),s;try{s=await r.readdir(o)}catch{await Y(a,r);continue}for(let n of s)if(n.isFile())try{await J(W(o,n.name),e,r)&&t.messages++}catch{t.errors++}else if(n.isDirectory()){let i=W(o,n.name),a;try{a=await r.readdir(i)}catch{continue}for(let n of a)if(n.isFile())try{await J(W(i,n.name),e,r)&&t.messages++}catch{t.errors++}await Y(i,r)}await Y(o,r),await Y(a,r)}await Y(i,r)}return t}async function Oe(e,t,n=!0){let r=K(),i={messages:0,errors:0},a=x(),o;try{o=await a.readdir(e)}catch{return i}for(let n of o)if(!(!n.isFile()||!n.name.endsWith(t)))try{await J(W(e,n.name),r,a)&&i.messages++}catch{i.errors++}return n&&await Y(e,a),i}function ke(){return Oe(W(n(),`plans`),`.md`)}async function Ae(){let e=K(),t={messages:0,errors:0},r=x();try{let i=W(n(),`file-history`),a;try{a=await r.readdir(i)}catch{return t}let o=a.filter(e=>e.isDirectory()).map(e=>W(i,e.name));await Promise.all(o.map(async n=>{try{(await r.stat(n)).mtime<e&&(await r.rm(n,{recursive:!0,force:!0}),t.messages++)}catch{t.errors++}})),await Y(i,r)}catch(e){M(e)}return t}async function X(){let e=K(),t={messages:0,errors:0},r=x();try{let i=W(n(),`session-env`),a;try{a=await r.readdir(i)}catch{return t}let o=a.filter(e=>e.isDirectory()).map(e=>W(i,e.name));for(let n of o)try{(await r.stat(n)).mtime<e&&(await r.rm(n,{recursive:!0,force:!0}),t.messages++)}catch{t.errors++}await Y(i,r)}catch(e){M(e)}return t}async function je(){let e=K(),t={messages:0,errors:0},r=x(),i=W(n(),`debug`),a;try{a=await r.readdir(i)}catch{return t}for(let n of a)if(!(!n.isFile()||!n.name.endsWith(`.txt`)||n.name===`latest`))try{await J(W(i,n.name),e,r)&&t.messages++}catch{t.errors++}return t}var Z=1440*60*1e3;async function Q(){let e=W(n(),`.npm-cache-cleanup`);try{let t=await G.stat(e);if(Date.now()-t.mtimeMs<Z){S(`npm cache cleanup: skipping, ran recently`);return}}catch{}try{await A(e,{retries:0,realpath:!1})}catch{S(`npm cache cleanup: skipping, lock held`);return}S(`npm cache cleanup: starting`);let r=W(xe(),`.npm`,`_cacache`),i=Date.now();try{let n=await import(`./lib-rQZENxQg.js`).then(e=>t(e.default,1)),a=i-Z,o=n.ls.stream(r),s=[];for await(let e of o)e.key.includes(`@anthropic-ai/claude-`)&&s.push({key:e.key,time:e.time});let c=new Map;for(let e of s){let t=e.key.lastIndexOf(`@`),n=t>0?e.key.slice(0,t):e.key,r=c.get(n)??[];r.push(e),c.set(n,r)}let l=[];for(let[,e]of c){e.sort((e,t)=>t.time-e.time);for(let t=0;t<e.length;t++){let n=e[t];(n.time<a||t>=5)&&l.push(n.key)}}await Promise.all(l.map(e=>n.rm.entry(r,e))),await G.writeFile(e,new Date().toISOString());let u=Date.now()-i;l.length>0?S(`npm cache cleanup: Removed ${l.length} old @anthropic-ai entries in ${u}ms`):S(`npm cache cleanup: completed in ${u}ms`),I(`tengu_npm_cache_cleanup`,{success:!0,durationMs:u,entriesRemoved:l.length})}catch(e){M(e),I(`tengu_npm_cache_cleanup`,{success:!1,durationMs:Date.now()-i})}finally{await k(e,{realpath:!1}).catch(()=>{})}}async function Me(){let e=W(n(),`.version-cleanup`);try{let t=await G.stat(e);if(Date.now()-t.mtimeMs<Z){S(`version cleanup: skipping, ran recently`);return}}catch{}try{await A(e,{retries:0,realpath:!1})}catch{S(`version cleanup: skipping, lock held`);return}S(`version cleanup: starting (throttled)`);try{await H(),await G.writeFile(e,new Date().toISOString())}catch(e){M(e)}finally{await k(e,{realpath:!1}).catch(()=>{})}}async function Ne(){let{errors:e}=me();if(e.length>0&&D(`cleanupPeriodDays`)){S(`Skipping cleanup: settings have validation errors but cleanupPeriodDays was explicitly set. Fix settings errors to enable cleanup.`);return}await Ee(),await De(),await ke(),await Ae(),await X(),await je(),await se(),await g(K());let t=await ne(K());t>0&&I(`tengu_worktree_cleanup`,{removed:t}),process.env.USER_TYPE===`ant`&&await Q()}o(),U(),_e();var Pe=(ye(),e(be)),Fe=1440*60*1e3,$=600*1e3;function Ie(){he(),import(`./extractMemories-DhUprYa7.js`).then(({initExtractMemories:e})=>{e()}).catch(()=>{}),ee(),ve(),a()&&Pe.ensureDeepLinkProtocolRegistered();let e=!0;async function t(){if(a()&&i()>Date.now()-1e3*60){setTimeout(t,$).unref();return}if(e&&(e=!1,await Ne()),a()&&i()>Date.now()-1e3*60){setTimeout(t,$).unref();return}await H()}setTimeout(t,$).unref(),process.env.USER_TYPE===`ant`&&setInterval(()=>{Q(),Me()},Fe).unref()}export{Se as n,Ie as t};