@readmagic/workmate 0.0.6 → 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 (556) 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-Bsy8kr2a.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-BKj_3Idm.js → BypassPermissionsModeDialog-GYhq--JR.js} +1 -1
  7. package/dist/chunks/{ClaudeMdExternalIncludesDialog-BD-7yAZh.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-C4XSSjvV.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-BttnAv-O.js → ExitFlow-Cu8SoQHs.js} +2 -2
  14. package/dist/chunks/Grove-Bc4CofEj.js +11 -0
  15. package/dist/chunks/{HybridTransport-B8V6O6rM.js → HybridTransport-BJPOG2wl.js} +3 -3
  16. package/dist/chunks/{InvalidConfigDialog-CHzBSJDf.js → InvalidConfigDialog-BI13il58.js} +1 -1
  17. package/dist/chunks/{InvalidSettingsDialog-BKenH3bD.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-Bj2-YL8o.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-egs9VvUs.js → PromptInputFooterSuggestions-D1cH9sDX.js} +1 -1
  25. package/dist/chunks/{PromptInputHelpMenu-SieM5NoY.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-DtpMDekF.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-rYaHIEfe.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-B8pRiGuy.js → ValidationErrorsList-DokTJQwi.js} +1 -1
  40. package/dist/chunks/{WelcomeV2-DqnbSdIu.js → WelcomeV2-Ci9VwPYh.js} +1 -1
  41. package/dist/chunks/{add-dir-C2Hu3oE4.js → add-dir-DPQV0qml.js} +1 -1
  42. package/dist/chunks/{agentDisplay-XoDJhr03.js → agentDisplay-DBQYOaOh.js} +1 -1
  43. package/dist/chunks/agents-DmybpgDN.js +103 -0
  44. package/dist/chunks/{agents-C4QXeHIJ.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-BNukrVAB.js → autoMode-Cr0AhS1G.js} +5 -5
  56. package/dist/chunks/{autonomy-BEmI7WVW.js → autonomy-ARUQt-Lu.js} +1 -1
  57. package/dist/chunks/autonomy-D4xZLOdJ.js +15 -0
  58. package/dist/chunks/{autonomyPanel-fhge09AG.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-Bpe-gocq.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-BhxRF2vm.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-Cx31Ugjp.js → claudeDesktop-DQXL5bGm.js} +1 -1
  76. package/dist/chunks/{clear-B4d38ssF.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-DQwf_b9o.js +17 -0
  80. package/dist/chunks/client-DkgC-mFB.js +1 -0
  81. package/dist/chunks/color-CBsNbt1s.js +1 -0
  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-BM-5pbv6.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-CpqEQbHa.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-CVzOodeg.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-DHVYCR26.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-DcIJE_0i.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-jGDLI_wU.js → generateRecap-CiFxXlmH.js} +1 -1
  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-CFx4eRkf.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-X6J03MnA.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-D5YORIJL.js → install-BI---dv0.js} +1 -1
  138. package/dist/chunks/{instrumentation-Bw3CxPQf.js → instrumentation-CcWzhGfE.js} +4 -4
  139. package/dist/chunks/{job-DOWtcltx.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-C6Fq-XOZ.js → language-s-dLbdVz.js} +1 -1
  144. package/dist/chunks/launchLocalMemory-twLxpPvg.js +3 -0
  145. package/dist/chunks/{launchOnboarding-Cc6WwPX9.js → launchOnboarding-BWz2XSb9.js} +1 -1
  146. package/dist/chunks/lazySchema-B4D4qJVE.js +1 -0
  147. package/dist/chunks/{loadAgentsDir-D206qwP3.js → loadAgentsDir-ByO8eJqU.js} +1724 -1993
  148. package/dist/chunks/loadAgentsDir-CMNFLt7R.js +1 -0
  149. package/dist/chunks/loadPluginHooks-BPnxcgrL.js +1 -0
  150. package/dist/chunks/{localSearch-CzrbOklu.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-DWjL2k7P.js → magicDocs-C5i5ruuU.js} +3 -3
  155. package/dist/chunks/{main-D862LI_d.js → main-BLD4QAQg.js} +2 -2
  156. package/dist/chunks/{main-BohPzJFF.js → main-D4Uk-WUs.js} +89 -86
  157. package/dist/chunks/managedEnv-C-9XSN14.js +1 -0
  158. package/dist/chunks/managedEnv-DLVRBaA9.js +1 -0
  159. package/dist/chunks/managedEnvConstants-BPwL2aWI.js +1 -0
  160. package/dist/chunks/{mappers-BDMZFgKx.js → mappers-CHRFic5q.js} +1 -1
  161. package/dist/chunks/mcp-BMVdGknC.js +1 -0
  162. package/dist/chunks/mcp-COS5RJFS.js +6 -0
  163. package/dist/chunks/mcp-tGsOW1GN.js +2 -0
  164. package/dist/chunks/memoize-B8hfb1JN.js +1 -0
  165. package/dist/chunks/memory-DR6poqeH.js +1 -0
  166. package/dist/chunks/{mode-CUkHFkju.js → mode-QV-NW1Wd.js} +2 -2
  167. package/dist/chunks/model-BF_4ebyl.js +1 -0
  168. package/dist/chunks/{model-BY3auM2c.js → model-BNU_ulDJ.js} +1 -1
  169. package/dist/chunks/model-CwO-g1RW.js +1 -0
  170. package/dist/chunks/nativeInstaller-B-lNJjM-.js +1 -0
  171. package/dist/chunks/observationStore-BpjlK0pG.js +3 -0
  172. package/dist/chunks/omit-DZCEXri5.js +1 -0
  173. package/dist/chunks/onChangeAppState-BmfM5g-D.js +1 -0
  174. package/dist/chunks/openai-DPH6rXOZ.js +10 -0
  175. package/dist/chunks/{panel-BSZGX6jN.js → panel-mD094ALT.js} +1 -1
  176. package/dist/chunks/{panelCall-BsVoL1uF.js → panelCall-SbffM7G4.js} +1 -1
  177. package/dist/chunks/parser-DrBC8nWp.js +1 -0
  178. package/dist/chunks/{parser-DFwaTGf7.js → parser-dbHRgXb8.js} +1 -1
  179. package/dist/chunks/partition-DKuAFJkc.js +1 -0
  180. package/dist/chunks/{path-D5U-tm91.js → path-Cv9QMBAX.js} +1 -1
  181. package/dist/chunks/permissions-ey-bfanE.js +3 -0
  182. package/dist/chunks/{pidLock-D5rUnDB-.js → pidLock-DJnS_38v.js} +2 -2
  183. package/dist/chunks/{pipeTransport-CqCnc-Ys.js → pipeTransport-DVOKR4c_.js} +1 -1
  184. package/dist/chunks/{plan-SYZ4DXR8.js → plan-Brg9XnRr.js} +1 -1
  185. package/dist/chunks/{platform-BrYefG_2.js → platform-DCXXznJg.js} +1 -1
  186. package/dist/chunks/plugin-CRwa39Y1.js +17 -0
  187. package/dist/chunks/pluginAutoupdate-D0LIP7cy.js +1 -0
  188. package/dist/chunks/{pluginBlocklist-C3H2afWG.js → pluginBlocklist-PwHHD3nj.js} +1 -1
  189. package/dist/chunks/pluginCliCommands-BJM5Bdpf.js +1 -0
  190. package/dist/chunks/pluginFlagging-pBxSselw.js +1 -0
  191. package/dist/chunks/pluginOperations-C7p_Qr2r.js +2 -0
  192. package/dist/chunks/pluginStartupCheck-C0HqhG6D.js +1 -0
  193. package/dist/chunks/pluginStartupCheck-Di4LjHXf.js +1 -0
  194. package/dist/chunks/{plugins-Dn6ceWrT.js → plugins-DUKNjLq6.js} +4 -4
  195. package/dist/chunks/pollConfig-BgpfHQPJ.js +1 -0
  196. package/dist/chunks/{poorMode-DhzFKpPl.js → poorMode-CYXmr_mU.js} +1 -1
  197. package/dist/chunks/poorMode-CejPNCp-.js +1 -0
  198. package/dist/chunks/print-gyTOCJzk.js +23 -0
  199. package/dist/chunks/processBashCommand-Cze9vCm6.js +1 -0
  200. package/dist/chunks/processSlashCommand-BRajh1v7.js +5 -0
  201. package/dist/chunks/prompt-B7joRiqj.js +139 -0
  202. package/dist/chunks/prompt-DqSMh2x9.js +1 -0
  203. package/dist/chunks/prompt-Eysh8Et_.js +1 -0
  204. package/dist/chunks/{promptEditor-DeMrXUir.js → promptEditor-R_acDAgI.js} +2 -2
  205. package/dist/chunks/{protocolHandler-BHxBy84Z.js → protocolHandler-RNKkhq91.js} +1 -1
  206. package/dist/chunks/{proxy-CRN7jYIi.js → proxy-BmtEnJ02.js} +1 -1
  207. package/dist/chunks/rcDebugLog-CARUIORE.js +1 -0
  208. package/dist/chunks/reconciler-BfkO6X2X.js +4 -0
  209. package/dist/chunks/refresh-C1X3sptR.js +1 -0
  210. package/dist/chunks/registerProtocol-DoKqmqu2.js +36 -0
  211. package/dist/chunks/{reload-plugins-B9IT9CFA.js → reload-plugins-C0osFcNh.js} +1 -1
  212. package/dist/chunks/remoteBridgeCore-Cddqv2WW.js +1 -0
  213. package/dist/chunks/remoteManagedSettings-B1mnRDmA.js +1 -0
  214. package/dist/chunks/rename-B3tf-YiD.js +1 -0
  215. package/dist/chunks/{renderOptions-BUJB9nAm.js → renderOptions-ChLwxtVu.js} +1 -1
  216. package/dist/chunks/replBridgeHandle-CNwNIijW.js +1 -0
  217. package/dist/chunks/{resume-y7MCTZHJ.js → resume-Be1G_GBL.js} +2 -2
  218. package/dist/chunks/ripgrep-C2PhTJDh.js +1 -0
  219. package/dist/chunks/{ripgrep-BXmXjAzA.js → ripgrep-gaT9Njwi.js} +1 -1
  220. package/dist/chunks/{runtimeObserver-BZcJ1FbH.js → runtimeObserver-CsIwinzh.js} +1 -1
  221. package/dist/chunks/runtimeObserver-Dbxxw4ls.js +10 -0
  222. package/dist/chunks/sandbox-adapter-C6GBuJPB.js +1 -0
  223. package/dist/chunks/sandbox-toggle-jEySONTW.js +1 -0
  224. package/dist/chunks/searchExtraTools-C_UTryh_.js +1 -0
  225. package/dist/chunks/session-DDI1Eb2x.js +2 -0
  226. package/dist/chunks/sessionFileAccessHooks-DfJ7Htfl.js +1 -0
  227. package/dist/chunks/sessionIdCompat-DMayYBrf.js +1 -0
  228. package/dist/chunks/sessionMemory-CQBxPkTQ.js +1 -0
  229. package/dist/chunks/sessionMemory-s0ALUHvc.js +1 -0
  230. package/dist/chunks/sessionMemoryUtils-xt7dTHGC.js +1 -0
  231. package/dist/chunks/sessionObserver-C2sYqWL3.js +1 -0
  232. package/dist/chunks/sessionObserver-DoYc0ZOP.js +20 -0
  233. package/dist/chunks/sessionState-CjNY991n.js +11 -0
  234. package/dist/chunks/sessionStorage-DqsY-7pi.js +1 -0
  235. package/dist/chunks/{sessionTitle-coed9IuJ.js → sessionTitle-B0OYf5nM.js} +3 -3
  236. package/dist/chunks/sessionTracing-CwsXt_uA.js +11 -0
  237. package/dist/chunks/settings-BWtOA9A7.js +1 -0
  238. package/dist/chunks/settings-hQDLwPVj.js +20 -0
  239. package/dist/chunks/settingsSync-DdFagwHV.js +1 -0
  240. package/dist/chunks/setup-DzC22EkN.js +3 -0
  241. package/dist/chunks/{shadowedRuleDetection-D1wsAdpp.js → shadowedRuleDetection-C86PTj1m.js} +1 -1
  242. package/dist/chunks/{shellQuote-DkSy9MYE.js → shellQuote-BUVKMu_P.js} +1 -1
  243. package/dist/chunks/{sideQuestion-wSi38p81.js → sideQuestion-C780iYwd.js} +3 -3
  244. package/dist/chunks/sinks-5G_xhc1Q.js +1 -0
  245. package/dist/chunks/{sinks-C_Dl1p4K.js → sinks-Cftq7Es0.js} +2 -2
  246. package/dist/chunks/skillChangeDetector-plLveEbf.js +1 -0
  247. package/dist/chunks/skillGapStore-Dc1arohs.js +5 -0
  248. package/dist/chunks/skillLifecycle-DP6mY1Kp.js +8 -0
  249. package/dist/chunks/{skillSearchPanel-CErRnUwo.js → skillSearchPanel-CpLTImaL.js} +4 -4
  250. package/dist/chunks/{skills-CBKhfg_a.js → skills-zGYaYfFV.js} +1 -1
  251. package/dist/chunks/{src-D06Xyj4g.js → src-BN7QRYLl.js} +1 -1
  252. package/dist/chunks/startupProfiler-DCn_NxMH.js +3 -0
  253. package/dist/chunks/startupProfiler-JbpAkfNE.js +1 -0
  254. package/dist/chunks/{state-ix0xIunV.js → state-C2OSZkV1.js} +1 -1
  255. package/dist/chunks/state-DU9lRJ9x.js +1 -0
  256. package/dist/chunks/{stats-BY4dskVg.js → stats-Duk7_xjQ.js} +1 -1
  257. package/dist/chunks/{status-BnJIXtKl.js → status-CFw-FpZM.js} +2 -2
  258. package/dist/chunks/{status-DU-B4SMW.js → status-peiVB_2j.js} +1 -1
  259. package/dist/chunks/statusNoticeHelpers-B5U5c9PE.js +1 -0
  260. package/dist/chunks/{stringUtils-DGLPkqJ4.js → stringUtils-B6FudhoZ.js} +1 -1
  261. package/dist/chunks/switcher-BAMqSX7Z.js +1 -0
  262. package/dist/chunks/switcher-hgBgVzLb.js +1 -0
  263. package/dist/chunks/syncCache-Zl9kZRRl.js +1 -0
  264. package/dist/chunks/{tasks-CBVL005y.js → tasks-BxpyRhmD.js} +1 -1
  265. package/dist/chunks/teleport-CwxeD5vL.js +1 -0
  266. package/dist/chunks/{templateJobs-D6998LcG.js → templateJobs-DR5fKFiO.js} +1 -1
  267. package/dist/chunks/{terminalSetup-0SBdyKF5.js → terminalSetup-DgRBt-JJ.js} +1 -1
  268. package/dist/chunks/terminalSetup-DlaFWI81.js +33 -0
  269. package/dist/chunks/{theme-p0AooruD.js → theme-Bz6esfST.js} +1 -1
  270. package/dist/chunks/{tmux-BY7IdQ1f.js → tmux-DSU9tYIo.js} +1 -1
  271. package/dist/chunks/{toolEventObserver-DTccwC3c.js → toolEventObserver-BSekCkM2.js} +1 -1
  272. package/dist/chunks/toolPool-B7SIoDw5.js +1 -0
  273. package/dist/chunks/{trustedDevice-BTYoQCkC.js → trustedDevice-B0x9X0fb.js} +1 -1
  274. package/dist/chunks/trustedDevice-CjHQtVkO.js +1 -0
  275. package/dist/chunks/{types-C-MRCL8J.js → types-D7_37tP2.js} +2 -2
  276. package/dist/chunks/{udsClient-BuCtv7dN.js → udsClient-CHoMMH28.js} +1 -1
  277. package/dist/chunks/{up-BHkC97_C.js → up-B8wBSpLg.js} +1 -1
  278. package/dist/chunks/{updateCCB-DFL5Wt_I.js → updateCCB-D_kGQKPT.js} +1 -1
  279. package/dist/chunks/{upstreamproxy-DyR_eXO8.js → upstreamproxy-Hmq-n8fw.js} +1 -1
  280. package/dist/chunks/useExitOnCtrlCDWithKeybindings-Cce612uS.js +1 -0
  281. package/dist/chunks/useMainLoopModel-BICP6_Fi.js +1 -0
  282. package/dist/chunks/useManagePlugins-DtbY_vPL.js +1 -0
  283. package/dist/chunks/useMergedTools-Ckx2IEhF.js +1 -0
  284. package/dist/chunks/{useSearchInput-D1Vr2Js1.js → useSearchInput-BAgljZUl.js} +1 -1
  285. package/dist/chunks/useSettingsErrors-CAJR_wpd.js +1 -0
  286. package/dist/chunks/userAgent-BxTG7IMk.js +1 -0
  287. package/dist/chunks/{util-BaDs-wL5.js → util-DDtmyq_r.js} +1 -1
  288. package/dist/chunks/validatePlugin-AHl-g4ct.js +1 -0
  289. package/dist/chunks/{vim-C-icQDz1.js → vim-kg-mRVbu.js} +1 -1
  290. package/dist/chunks/{which-CKQnSouy.js → which-CHLNJmtJ.js} +1 -1
  291. package/dist/chunks/windowsPaths-Pmx8LDR6.js +1 -0
  292. package/dist/chunks/{windowsPaths-DtapVxOo.js → windowsPaths-o62uq6LF.js} +1 -1
  293. package/dist/chunks/{workSecret-CNWiR2uQ.js → workSecret-DG9shvG0.js} +1 -1
  294. package/dist/chunks/workerRegistry-C7H_lsQX.js +6 -0
  295. package/dist/chunks/worktree-O2p-mJdF.js +1 -0
  296. package/dist/cli.js +1 -1
  297. package/package.json +1 -1
  298. package/dist/chunks/AddWorkspaceDirectory-ClHi-Dr6.js +0 -1
  299. package/dist/chunks/App-BP06lHmf.js +0 -1
  300. package/dist/chunks/ApproveApiKey-a2ZonQ3n.js +0 -1
  301. package/dist/chunks/AssistantSessionChooser-CcocKoTJ.js +0 -1
  302. package/dist/chunks/BackgroundTasksDialog-DNeBhGCf.js +0 -2
  303. package/dist/chunks/ClaudeMdExternalIncludesDialog-DFivNFuo.js +0 -1
  304. package/dist/chunks/ConsoleOAuthFlow-CS3zjEPF.js +0 -1
  305. package/dist/chunks/DesktopHandoff-BmPmCfT3.js +0 -1
  306. package/dist/chunks/Dialog-vfLXEPed.js +0 -1
  307. package/dist/chunks/Doctor-BhD-ZzZm.js +0 -1
  308. package/dist/chunks/Doctor-DEQe2q16.js +0 -3
  309. package/dist/chunks/Feedback-BaYA8-SU.js +0 -2
  310. package/dist/chunks/Grove-BJziCbZH.js +0 -11
  311. package/dist/chunks/Grove-sWm-oLBf.js +0 -1
  312. package/dist/chunks/ListItem-vfLXEPed.js +0 -1
  313. package/dist/chunks/MCPConnectionManager-CNh9dNlk.js +0 -1
  314. package/dist/chunks/MessageSelector-DdR6wJhh.js +0 -3
  315. package/dist/chunks/Messages-Ch6cboMV.js +0 -11
  316. package/dist/chunks/Onboarding-BrAJp0aL.js +0 -1
  317. package/dist/chunks/OverageCreditUpsell-Ds1cB7RC.js +0 -1
  318. package/dist/chunks/PluginSettings-CGqEzejq.js +0 -17
  319. package/dist/chunks/QueryEngine-CZZMl3PB.js +0 -1
  320. package/dist/chunks/REPL-CG2N7E4Q.js +0 -142
  321. package/dist/chunks/REPL-DvA910N_.js +0 -1
  322. package/dist/chunks/RemoteCallout-Cs-ro8_i.js +0 -1
  323. package/dist/chunks/RemoteSessionManager-B740Dp6m.js +0 -2
  324. package/dist/chunks/ResumeConversation-DzV2zmuX.js +0 -1
  325. package/dist/chunks/SearchExtraToolsTool-C4uO-Zx3.js +0 -1
  326. package/dist/chunks/Settings-XKw6FI_m.js +0 -2
  327. package/dist/chunks/TeleportRepoMismatchDialog-DY97YZMB.js +0 -1
  328. package/dist/chunks/TeleportResumeWrapper-jaQzyTCh.js +0 -1
  329. package/dist/chunks/ThemePicker-BViWzLp3.js +0 -1
  330. package/dist/chunks/TrustDialog-DGJ_BisZ.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-BIHTGDYh.js +0 -103
  334. package/dist/chunks/allErrors-1896uQA1.js +0 -1
  335. package/dist/chunks/analytics-BotDBGh0.js +0 -1
  336. package/dist/chunks/ant-B6k6cBts.js +0 -1
  337. package/dist/chunks/api-BsFW57_Q.js +0 -1
  338. package/dist/chunks/api-gqTA-D7n.js +0 -1
  339. package/dist/chunks/asciicast-BsWpcxrc.js +0 -1
  340. package/dist/chunks/assistant-C83quuNj.js +0 -1
  341. package/dist/chunks/assistant-DJ9hd4uC.js +0 -1
  342. package/dist/chunks/assistant-z2o4-UJe.js +0 -1
  343. package/dist/chunks/auth-8Vd3_U8t.js +0 -1
  344. package/dist/chunks/auth-BnSrKyJe.js +0 -15
  345. package/dist/chunks/auth-DRTjfnGy.js +0 -1
  346. package/dist/chunks/autonomy-DGcy5Rml.js +0 -15
  347. package/dist/chunks/backgroundHousekeeping-3i_d_WW5.js +0 -1
  348. package/dist/chunks/backgroundHousekeeping-BVMf_Tjn.js +0 -17
  349. package/dist/chunks/bg-B0iMGM9C.js +0 -1
  350. package/dist/chunks/bridge-D12Shbkj.js +0 -2
  351. package/dist/chunks/bridgeConfig-CqIQ_rvD.js +0 -1
  352. package/dist/chunks/bridgeEnabled-D0XC5kNh.js +0 -1
  353. package/dist/chunks/bridgeEnabled-SbB-6zdY.js +0 -1
  354. package/dist/chunks/bridgeMain-DHUpZFgL.js +0 -68
  355. package/dist/chunks/bridgeMain-DUbQjgCp.js +0 -1
  356. package/dist/chunks/bridgeMessaging-DHc5dOhB.js +0 -1
  357. package/dist/chunks/bridgePointer-MqLe5Asm.js +0 -1
  358. package/dist/chunks/browser-BmZuQom6.js +0 -1
  359. package/dist/chunks/btw-D9hMM5d2.js +0 -1
  360. package/dist/chunks/caches-CWzT7e6Y.js +0 -1
  361. package/dist/chunks/caches-UeVVM3T0.js +0 -3
  362. package/dist/chunks/capacityWake-CV_x9H8j.js +0 -1
  363. package/dist/chunks/ccrClient-Iza0L8Zw.js +0 -1
  364. package/dist/chunks/client-BzKQTXzF.js +0 -1
  365. package/dist/chunks/color-D8VOyoYl.js +0 -1
  366. package/dist/chunks/commands-DDamMmo4.js +0 -1
  367. package/dist/chunks/commitAttribution-CgohL8vD.js +0 -1
  368. package/dist/chunks/commitAttribution-ChAgixdj.js +0 -2
  369. package/dist/chunks/compact-IFHwxjZ9.js +0 -2
  370. package/dist/chunks/completionCache-MN3_MqK8.js +0 -4
  371. package/dist/chunks/completionCache-c4aiyZ_f.js +0 -1
  372. package/dist/chunks/config-DY5-_kk_.js +0 -1
  373. package/dist/chunks/config-DmomySWC.js +0 -3
  374. package/dist/chunks/config-WxgxrQoP.js +0 -1
  375. package/dist/chunks/context-Cl6BJ2vm.js +0 -1
  376. package/dist/chunks/context-noninteractive-9hELVC29.js +0 -54
  377. package/dist/chunks/context-noninteractive-Beij5MfU.js +0 -1
  378. package/dist/chunks/conversation-BBB91hEw.js +0 -1
  379. package/dist/chunks/conversation-BWVTM40Y.js +0 -1
  380. package/dist/chunks/createSession-CoQtL5Rj.js +0 -1
  381. package/dist/chunks/createSession-Cvl1Q50F.js +0 -1
  382. package/dist/chunks/cron-3LntnnhJ.js +0 -1
  383. package/dist/chunks/crossProjectResume-BasMLl2n.js +0 -40
  384. package/dist/chunks/cwd--nvsx73T.js +0 -1
  385. package/dist/chunks/cwd-CYmmnQVS.js +0 -1
  386. package/dist/chunks/debugUtils-NO5KtXqi.js +0 -1
  387. package/dist/chunks/desktop-B_L6T6jI.js +0 -1
  388. package/dist/chunks/detectRepository-BTPgN89l.js +0 -1
  389. package/dist/chunks/directoryCompletion-CW2ckkQg.js +0 -1
  390. package/dist/chunks/doctor-1L0TFuGw.js +0 -1
  391. package/dist/chunks/envLessBridgeConfig-CN0_44-p.js +0 -1
  392. package/dist/chunks/envLessBridgeConfig-Ck2-KMq0.js +0 -1
  393. package/dist/chunks/esm-D5q6s4l8.js +0 -1
  394. package/dist/chunks/exit-Bm1S_f3i.js +0 -1
  395. package/dist/chunks/extra-usage-UHAWtypK.js +0 -1
  396. package/dist/chunks/extra-usage-core-BFOolqoi.js +0 -1
  397. package/dist/chunks/extra-usage-noninteractive-cUGZy0en.js +0 -1
  398. package/dist/chunks/extra-usage-zDHVtWKZ.js +0 -1
  399. package/dist/chunks/extraUsage-Dq66zzqR.js +0 -1
  400. package/dist/chunks/extractMemories-BcaklA33.js +0 -1
  401. package/dist/chunks/fast-DALAHO3d.js +0 -1
  402. package/dist/chunks/fast-MS7WZpD8.js +0 -1
  403. package/dist/chunks/feedback-Fw4m28ZC.js +0 -1
  404. package/dist/chunks/file-DcZWPH2V.js +0 -12
  405. package/dist/chunks/fileStateCache-DDW5toIs.js +0 -1
  406. package/dist/chunks/files-Cz1-PK3r.js +0 -2
  407. package/dist/chunks/firstPartyEventLogger-CS9jVz6D.js +0 -1
  408. package/dist/chunks/firstPartyEventLogger-CoSUd0a1.js +0 -5
  409. package/dist/chunks/flushGate-De-yppeo.js +0 -1
  410. package/dist/chunks/gemini-BPziscyN.js +0 -1
  411. package/dist/chunks/generateSessionName-hDJ6HBJ1.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-qAoiyj6P.js +0 -1
  415. package/dist/chunks/grok-Byblph7F.js +0 -1
  416. package/dist/chunks/grove-CpqjcGCb.js +0 -7
  417. package/dist/chunks/heapdump-C4kPlqGt.js +0 -5
  418. package/dist/chunks/help-B1h-faJ3.js +0 -1
  419. package/dist/chunks/hooks-DPLIIpAD.js +0 -1
  420. package/dist/chunks/hostGuard-BHI6Q8Mt.js +0 -1
  421. package/dist/chunks/inboundAttachments-BekVc0W-.js +0 -1
  422. package/dist/chunks/inboundAttachments-CUJE3KaU.js +0 -1
  423. package/dist/chunks/index.min-D75yiGLN.js +0 -1
  424. package/dist/chunks/initReplBridge-JQ-afRx9.js +0 -1
  425. package/dist/chunks/keybindings-BLw5J-Zj.js +0 -2
  426. package/dist/chunks/language-Cqw5gYJR.js +0 -1
  427. package/dist/chunks/launchAgentsPlatform-jWWf-Lk9.js +0 -1
  428. package/dist/chunks/launchCommand-1qkTCKpf.js +0 -1
  429. package/dist/chunks/launchLocalMemory-kHeD0I0y.js +0 -3
  430. package/dist/chunks/launchLocalVault-DLqkOjmb.js +0 -3
  431. package/dist/chunks/launchMemoryStores-Ct7AVXrO.js +0 -1
  432. package/dist/chunks/launchSchedule-ZyvuvjgU.js +0 -1
  433. package/dist/chunks/launchSkillStore-BejQnLog.js +0 -1
  434. package/dist/chunks/launchTeleport-8CuYUfIR.js +0 -3
  435. package/dist/chunks/launchVault-DIvIOuPh.js +0 -1
  436. package/dist/chunks/loadAgentsDir-TZjwTqdr.js +0 -1
  437. package/dist/chunks/loadPluginHooks-Ddhsyn0_.js +0 -1
  438. package/dist/chunks/localSearch-DrOAL6f4.js +0 -1
  439. package/dist/chunks/log-BMCygSzM.js +0 -1
  440. package/dist/chunks/logoV2Utils-8M56V7oN.js +0 -1
  441. package/dist/chunks/mcp-Bt1ITh-Z.js +0 -1
  442. package/dist/chunks/mcp-CwJ-AIpt.js +0 -6
  443. package/dist/chunks/mcp-W0LFoyFR.js +0 -2
  444. package/dist/chunks/memoize-B0zhbT8Z.js +0 -1
  445. package/dist/chunks/memory-3wV7m7UU.js +0 -1
  446. package/dist/chunks/model-CKkOnnnx.js +0 -1
  447. package/dist/chunks/model-DRXcJyU9.js +0 -1
  448. package/dist/chunks/nativeInstaller-CA5d6_G7.js +0 -1
  449. package/dist/chunks/observationStore-DzCdXq8U.js +0 -4
  450. package/dist/chunks/onChangeAppState-DBmy2Ow_.js +0 -1
  451. package/dist/chunks/openai-Cbomn0Ws.js +0 -10
  452. package/dist/chunks/output-style-BM3qAHLA.js +0 -1
  453. package/dist/chunks/overageCreditGrant-DsUrmeBh.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-BAakXjvj.js +0 -1
  457. package/dist/chunks/passes-CLRt7Cvm.js +0 -1
  458. package/dist/chunks/permissions-BVSFuwNP.js +0 -3
  459. package/dist/chunks/permissions-CeYKbtSC.js +0 -1
  460. package/dist/chunks/permissions-Cn_6f8CB.js +0 -1
  461. package/dist/chunks/plugin-Bfjzhmrk.js +0 -1
  462. package/dist/chunks/pluginAutoupdate-reO2PgtQ.js +0 -1
  463. package/dist/chunks/pluginCliCommands-lqdxdkQp.js +0 -1
  464. package/dist/chunks/pluginFlagging-D9HKAGBC.js +0 -1
  465. package/dist/chunks/pluginOperations-EN3EKLux.js +0 -2
  466. package/dist/chunks/pluginStartupCheck-BY73BMT2.js +0 -1
  467. package/dist/chunks/pluginStartupCheck-CwWOlveD.js +0 -1
  468. package/dist/chunks/policyLimits-CkTI5KEt.js +0 -1
  469. package/dist/chunks/pollConfig-DH2oCtFS.js +0 -1
  470. package/dist/chunks/poor-j-y-bv8o.js +0 -1
  471. package/dist/chunks/poorMode-V11s-3cf.js +0 -1
  472. package/dist/chunks/print-Db_VXmfO.js +0 -23
  473. package/dist/chunks/privacy-settings-DHMJREbb.js +0 -1
  474. package/dist/chunks/processBashCommand-BcM_fhV9.js +0 -1
  475. package/dist/chunks/processSlashCommand-DEVo3GPX.js +0 -5
  476. package/dist/chunks/prompt-BNHtszmZ.js +0 -139
  477. package/dist/chunks/prompt-CrX31AGm.js +0 -1
  478. package/dist/chunks/prompt-IAvMxKDl.js +0 -1
  479. package/dist/chunks/rate-limit-options-DIudL9fb.js +0 -1
  480. package/dist/chunks/rcDebugLog-CUy1_F23.js +0 -11
  481. package/dist/chunks/reconciler-BXpPyfSY.js +0 -4
  482. package/dist/chunks/referral-CUaIo_vT.js +0 -1
  483. package/dist/chunks/refresh-CuaVBIQ0.js +0 -1
  484. package/dist/chunks/registerProtocol-B7Fzdofu.js +0 -36
  485. package/dist/chunks/release-notes-fbfv2DC0.js +0 -4
  486. package/dist/chunks/releaseNotes-CxAHFLPl.js +0 -2
  487. package/dist/chunks/remote-env-BOklGlll.js +0 -1
  488. package/dist/chunks/remoteBridgeCore-j0bG1zjv.js +0 -1
  489. package/dist/chunks/remoteManagedSettings-Cq994lyc.js +0 -1
  490. package/dist/chunks/rename-Iev7wQsI.js +0 -1
  491. package/dist/chunks/ripgrep-BfIpz5uC.js +0 -1
  492. package/dist/chunks/runtimeObserver-CyzLASla.js +0 -10
  493. package/dist/chunks/sandbox-adapter-Cu1FYrkh.js +0 -1
  494. package/dist/chunks/sandbox-toggle-CWpBO228.js +0 -1
  495. package/dist/chunks/sanitization-DV-94a9Z.js +0 -1
  496. package/dist/chunks/searchExtraTools-BUOUds7p.js +0 -1
  497. package/dist/chunks/semver-BMRJYn3q.js +0 -1
  498. package/dist/chunks/session-DL4cA_8l.js +0 -2
  499. package/dist/chunks/sessionDiscovery-DAfNKqp1.js +0 -1
  500. package/dist/chunks/sessionFileAccessHooks-2cgIIxPk.js +0 -1
  501. package/dist/chunks/sessionMemory-BS8_TbKj.js +0 -1
  502. package/dist/chunks/sessionMemory-D5fSHXvZ.js +0 -1
  503. package/dist/chunks/sessionMemoryUtils-BWUztNh6.js +0 -1
  504. package/dist/chunks/sessionObserver-ChfQtK2m.js +0 -1
  505. package/dist/chunks/sessionObserver-ShbCwJ8x.js +0 -20
  506. package/dist/chunks/sessionStorage-Cf5wmnyB.js +0 -1
  507. package/dist/chunks/sessionTracing-D9rUyiq0.js +0 -11
  508. package/dist/chunks/settings-BovzmwMP.js +0 -19
  509. package/dist/chunks/settingsSync-PqU9XGJq.js +0 -1
  510. package/dist/chunks/setup-B_FOvNpp.js +0 -3
  511. package/dist/chunks/sinks-BpcRrN_T.js +0 -1
  512. package/dist/chunks/skill-learning-B5tmc7EX.js +0 -5
  513. package/dist/chunks/skillChangeDetector-DNqohXxz.js +0 -1
  514. package/dist/chunks/skillGapStore-D-kQKVDZ.js +0 -1
  515. package/dist/chunks/skillGapStore-Df5BWAk5.js +0 -5
  516. package/dist/chunks/skillGenerator-DbcdpAkw.js +0 -8
  517. package/dist/chunks/skillLearning-C5cXZE6_.js +0 -1
  518. package/dist/chunks/skillLearning-ClRiDcJH.js +0 -1
  519. package/dist/chunks/skillPanel-LBd4E-MM.js +0 -28
  520. package/dist/chunks/slashCommandParsing-RQb_7Xzt.js +0 -1
  521. package/dist/chunks/startupProfiler-DIWVcO4e.js +0 -1
  522. package/dist/chunks/startupProfiler-xa3NmN7Z.js +0 -3
  523. package/dist/chunks/state-BOa-3Av3.js +0 -1
  524. package/dist/chunks/statusNoticeHelpers-CzTuGNuC.js +0 -1
  525. package/dist/chunks/stickers-D5teCKMN.js +0 -1
  526. package/dist/chunks/systemPromptSections-CR_AoPIX.js +0 -1
  527. package/dist/chunks/systemPromptSections-DN0HGVye.js +0 -1
  528. package/dist/chunks/tag-B-wVW9Aj.js +0 -11
  529. package/dist/chunks/teleport-dtqQXM4x.js +0 -1
  530. package/dist/chunks/terminalSetup-CuV-qU6v.js +0 -33
  531. package/dist/chunks/thinkback-Catprqs_.js +0 -1
  532. package/dist/chunks/thinkback-DI2NpvG-.js +0 -1
  533. package/dist/chunks/thinkback-play-CqrIRx2o.js +0 -1
  534. package/dist/chunks/toolEventObserver-DlH73w-S.js +0 -1
  535. package/dist/chunks/toolPool-B64V-jmK.js +0 -1
  536. package/dist/chunks/trustedDevice-CiwjT_Y6.js +0 -1
  537. package/dist/chunks/tui-C2yuCuOU.js +0 -6
  538. package/dist/chunks/types-Bh9S_JG5.js +0 -3
  539. package/dist/chunks/types-DHkZVzJe.js +0 -1
  540. package/dist/chunks/ultrareviewCommand-BDFUS3hf.js +0 -3
  541. package/dist/chunks/undercover-XYapZ_SS.js +0 -1
  542. package/dist/chunks/undercover-vuTpCnQJ.js +0 -31
  543. package/dist/chunks/upgrade-D5qwcaWQ.js +0 -1
  544. package/dist/chunks/upgrade-DIg3j929.js +0 -1
  545. package/dist/chunks/upload-B_yADHX9.js +0 -1
  546. package/dist/chunks/usage-C0SnnC-i.js +0 -1
  547. package/dist/chunks/usage-CYJKE8N6.js +0 -1
  548. package/dist/chunks/useExitOnCtrlCDWithKeybindings-DKIqRraH.js +0 -1
  549. package/dist/chunks/useMainLoopModel-XetDUXd-.js +0 -1
  550. package/dist/chunks/useManagePlugins-B2KhKiu5.js +0 -1
  551. package/dist/chunks/useMergedTools-CKvwz_Zt.js +0 -1
  552. package/dist/chunks/useSettingsErrors-B7BXHchG.js +0 -1
  553. package/dist/chunks/validatePlugin-DtiYlXby.js +0 -1
  554. package/dist/chunks/windowsPaths-9pEkw0oV.js +0 -1
  555. package/dist/chunks/workerRegistry-ChqPPIaO.js +0 -1
  556. package/dist/chunks/worktree-DAn8ooa1.js +0 -1
@@ -0,0 +1 @@
1
+ import{t as e}from"./REPL-BXhAQOXb.js";export{e as REPL};
@@ -0,0 +1,2 @@
1
+ import{n as e,t}from"./memoize-BK3gG5ob.js";import{n,t as r}from"./defineProperty-C-QyHrDq.js";import{di as i,j as a,t as o,ui as s}from"./src-CDCSSo0U2.js";import{Bo as c,Jx as l,Mc as ee,Nr as u,RE as d,Rw as f,Wo as p,Zx as m,aS as te,cy as ne,dS as re,fS as ie,fr as ae,iD as oe,jc as se,jr as ce,lS as h,mS as le,nD as g,ny as _,pS as v,rs as y,sS as b,tS as x,ts as ue,zE as S,zw as de}from"./loadAgentsDir-ByO8eJqU.js";import{n as fe,t as C}from"./cwd-C5ce-7WB.js";import{C as pe,F as w,S as T,a as E,l as D,w as O,z as k}from"./debug-RZ4NuXyS.js";import{Gt as A,Jt as j,f as M,g as N,n as P}from"./settings-hQDLwPVj.js";import{b as F,c as I,g as L,o as R,y as z}from"./config-CE058cvr.js";import{f as B,l as me,m as V,p as he}from"./git-BerW9bId.js";import{n as H,r as ge}from"./execFileNoThrow-CCX-JY8h.js";import{o as U,s as W}from"./log-CZ0zYP_c.js";import{i as G,o as _e}from"./platform-DCXXznJg.js";import{l as ve,u as ye}from"./oauth-BqJqV-2M.js";import{Bt as be,Vt as xe,_ as Se,bi as Ce,g as K,vi as we}from"./model-CwO-g1RW.js";import{c as Te,h as Ee,l as De,m as q,s as Oe}from"./proxy-BmtEnJ02.js";import{l as ke,o as Ae}from"./api-CF5IVtj0.js";import{c as je,u as Me}from"./firstPartyEventLogger-D5ohKbIe.js";import{c as Ne,i as Pe}from"./terminalSetup-DlaFWI81.js";import{randomUUID as Fe}from"crypto";t(),d(),fe(),L(),j(),ge(),V(),U(),Me();var Ie=[/(?:^|\/)(?: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 Le(e){return!Ie.some(t=>t.test(e))}function Re(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(!Le(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 ze(){if(A.platform===`win32`||!await me())return[];try{let e=await je(),t=[`log`,`-n`,`1000`,`--pretty=format:`,`--name-only`,`--diff-filter=M`],n=new Map,r=e=>{for(let t of e.split(`
2
+ `)){let e=t.trim();e&&n.set(e,(n.get(e)??0)+1)}};if(e){let{stdout:n}=await H(`git`,[...t,`--author=${e}`],{cwd:C()});r(n)}if(n.size<10){let{stdout:e}=await H(he(),t,{cwd:C()});r(e)}return Re(Array.from(n.entries()).sort((e,t)=>t[1]-e[1]).map(([e])=>e),5)}catch(e){return W(e),[]}}var Be=10080*60*1e3,Ve=e(()=>{let e=R(),t=e.exampleFiles?.length?S(e.exampleFiles):`<filepath>`;return`Try "${S([`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...`])}"`}),He=e(async()=>{let e=R();Date.now()-(e.exampleFilesGeneratedAt??0)>Be&&(e.exampleFiles=[]),e.exampleFiles?.length||ze().then(e=>{e.length&&z(t=>({...t,exampleFiles:e,exampleFilesGeneratedAt:Date.now()}))})});Ce();var Ue={"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 We(e){let t=e.toLowerCase(),n=we();for(let[e,r]of Object.entries(Ue)){let i=r.retirementDates[n];if(!(!t.includes(e)||!i))return{isDeprecated:!0,modelName:r.modelName,retirementDate:i}}return{isDeprecated:!1}}function Ge(e){if(!e)return null;let t=We(e);return t.isDeprecated?`⚠ ${t.modelName} will be retired on ${t.retirementDate}. Consider switching to a newer model.`:null}n(),i(),o(),k(),T(),E(),_e(),ye(),N(),be(),Se(),oe(),de(),b(),m(),ne(),Pe(),ee(),ue(),c(),ce(),L();function Ke(e){let t=I().numStartups;F(n=>{let r=n.tipsHistory??{};return r[e]===t?n:{...n,tipsHistory:{...r,[e]:t}}})}function J(e){let t=I(),n=t.tipsHistory?.[e];return n?t.numStartups-n:1/0}L(),j(),V();var Y;async function qe(){return Y===void 0&&(Y=g in await y()),Y}async function X(e,t,n){if(!await qe()||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&&l(t.readFileState).some(e=>n.filePath.test(e)))}var Je=[{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 I().numStartups<10}},{id:`plan-mode-for-complex-tasks`,content:async()=>`Use Plan Mode to prepare for a complex request before making changes. Press ${f(`chat:cycleMode`,`Chat`,`shift+tab`)} twice to enable.`,cooldownSessions:5,isRelevant:async()=>{let e=I();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=I(),t=M(),n=!!e.lastPlanModeUse,r=!!t?.permissions?.defaultMode;return n&&!r}catch(e){return D(`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=I();return await B()<=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()=>!ae()&&await se()>=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=I();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=I();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(!Ne())return!1;let e=I();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 I().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&&s.level<3},{id:`powershell-tool-env`,content:async()=>`Set CLAUDE_CODE_USE_POWERSHELL_TOOL=1 to enable the PowerShell tool (preview)`,cooldownSessions:10,isRelevant:async()=>G()===`windows`&&process.env.CLAUDE_CODE_USE_POWERSHELL_TOOL===void 0},{id:`status-line`,content:async()=>`Use /statusline to set up a custom status line that will display beneath the input box`,cooldownSessions:25,isRelevant:async()=>M().statusLine===void 0},{id:`prompt-queue`,content:async()=>`Hit Enter to queue up additional messages while Claude is working.`,cooldownSessions:5,async isRelevant(){return I().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(!ie()||G()!==`macos`)return!1;switch(A.terminal){case`vscode`:return!await v();case`cursor`:return!await h();case`windsurf`:return!await le();default:return!1}}},{id:`ide-upsell-external-terminal`,content:async()=>`Connect Claude to your IDE · /ide`,cooldownSessions:4,async isRelevant(){return re()||(await te()).length!==0?!1:(await x()).length>0}},{id:`permissions`,content:async()=>`Use /permissions to pre-approve and pre-deny bash, edit, and MCP tools`,cooldownSessions:10,async isRelevant(){return I().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()=>G()===`macos`},{id:`double-esc`,content:async()=>`Double-tap esc to rewind the conversation to a previous point in time`,cooldownSessions:10,isRelevant:async()=>!_()},{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()=>_()},{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()=>u()&&I().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 I().numStartups>10}},{id:`shift-tab`,content:async()=>`Hit ${f(`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 ${f(`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 I().numStartups>5}},{id:`agent-flag`,content:async()=>`Use --agent <agent_name> to directly start a conversation with a subagent`,cooldownSessions:15,async isRelevant(){return I().numStartups>5}},{id:`web-app`,content:async()=>`Run tasks in the cloud while you keep coding locally · clau.de/web`,cooldownSessions:15,isRelevant:async()=>!0},{id:`opusplan-mode-reminder`,content:async()=>`Your default model setting is Opus Plan Mode. Press ${f(`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=I(),t=K()===`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${a(`suggestion`,e?.theme??`dark`)(`/plugin install frontend-design@${g}`)}`,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${a(`suggestion`,e?.theme??`dark`)(`/plugin install vercel@${g}`)}`,cooldownSessions:3,isRelevant:async e=>X(`vercel`,e,{filePath:/(?:^|[/\\])vercel\.json$/i,cli:[`vercel`]})},{id:`subagent-fanout-nudge`,content:async e=>`Say ${a(`suggestion`,e?.theme??`dark`)(`"fan out subagents"`)} and Claude sends a team. Each one digs deep so nothing gets missed.`,cooldownSessions:3,isRelevant:async()=>(xe(),!1)}],Ye=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 Xe(){let e=P().spinnerTipsOverride;return e?.tips?.length?e.tips.map((e,t)=>({id:`custom-tip-${t}`,content:async()=>e,cooldownSessions:0,isRelevant:async()=>!0})):[]}async function Ze(e){let t=P().spinnerTipsOverride,n=Xe();if(t?.excludeDefault&&n.length>0)return n;let r=[...Je,...Ye],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]}Ae(),E(),U(),Ee(),De();var Z=2e3,Q=5,Qe=3e4,$=3,$e=new Set([4003]);function et(e){return typeof e!=`object`||!e||!(`type`in e)?!1:typeof e.type==`string`}var tt=class{constructor(e,t,n,i){r(this,`sessionId`,void 0),r(this,`orgUuid`,void 0),r(this,`getAccessToken`,void 0),r(this,`callbacks`,void 0),r(this,`ws`,null),r(this,`state`,`closed`),r(this,`reconnectAttempts`,0),r(this,`sessionNotFoundRetries`,0),r(this,`pingInterval`,null),r(this,`reconnectTimer`,null),this.sessionId=e,this.orgUuid=t,this.getAccessToken=n,this.callbacks=i}async connect(){if(this.state===`connecting`){D(`[SessionsWebSocket] Already connecting`);return}this.state=`connecting`;let e=`${ve().BASE_API_URL.replace(`http`,`ws`)}/v1/sessions/ws/${this.sessionId}/subscribe?organization_uuid=${this.orgUuid}`;D(`[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:Te(e),tls:q()||void 0});this.ws=n,n.addEventListener(`open`,()=>{D(`[SessionsWebSocket] Connection opened, authenticated via headers`),this.state=`connected`,this.reconnectAttempts=0,this.sessionNotFoundRetries=0,this.startPingInterval(),this.callbacks.onConnected?.()}),n.addEventListener(`message`,e=>{let t=typeof e.data==`string`?e.data:String(e.data);this.handleMessage(t)}),n.addEventListener(`error`,()=>{let e=Error(`[SessionsWebSocket] WebSocket error`);W(e),this.callbacks.onError?.(e)}),n.addEventListener(`close`,e=>{D(`[SessionsWebSocket] Closed: code=${e.code} reason=${e.reason}`),this.handleClose(e.code)}),n.addEventListener(`pong`,()=>{D(`[SessionsWebSocket] Pong received`)})}else{let{default:n}=await import(`./wrapper-K8ZapJVu.js`),r=new n(e,{headers:t,agent:Oe(e),...q()});this.ws=r,r.on(`open`,()=>{D(`[SessionsWebSocket] Connection opened, authenticated via headers`),this.state=`connected`,this.reconnectAttempts=0,this.sessionNotFoundRetries=0,this.startPingInterval(),this.callbacks.onConnected?.()}),r.on(`message`,e=>{this.handleMessage(e.toString())}),r.on(`error`,e=>{W(Error(`[SessionsWebSocket] Error: ${e.message}`)),this.callbacks.onError?.(e)}),r.on(`close`,(e,t)=>{D(`[SessionsWebSocket] Closed: code=${e} reason=${t.toString()}`),this.handleClose(e)}),r.on(`pong`,()=>{D(`[SessionsWebSocket] Pong received`)})}}handleMessage(e){try{let t=pe(e);et(t)?this.callbacks.onMessage(t):D(`[SessionsWebSocket] Ignoring message type: ${typeof t==`object`&&t&&`type`in t?String(t.type):`unknown`}`)}catch(e){W(Error(`[SessionsWebSocket] Failed to parse message: ${w(e)}`))}}handleClose(e){if(this.stopPingInterval(),this.state===`closed`)return;this.ws=null;let t=this.state;if(this.state=`closed`,$e.has(e)){D(`[SessionsWebSocket] Permanent close code ${e}, not reconnecting`),this.callbacks.onClose?.();return}if(e===4001){if(this.sessionNotFoundRetries++,this.sessionNotFoundRetries>$){D(`[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}`)):(D(`[SessionsWebSocket] Not reconnecting`),this.callbacks.onClose?.())}scheduleReconnect(e,t){this.callbacks.onReconnecting?.(),D(`[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{}},Qe)}stopPingInterval(){this.pingInterval&&(clearInterval(this.pingInterval),this.pingInterval=null)}sendControlResponse(e){if(!this.ws||this.state!==`connected`){W(Error(`[SessionsWebSocket] Cannot send: not connected`));return}D(`[SessionsWebSocket] Sending control response`),this.ws.send(O(e))}sendControlRequest(e){if(!this.ws||this.state!==`connected`){W(Error(`[SessionsWebSocket] Cannot send: not connected`));return}let t={type:`control_request`,request_id:Fe(),request:e};D(`[SessionsWebSocket] Sending control request: ${e.subtype}`),this.ws.send(O(t))}isConnected(){return this.state===`connected`}close(){D(`[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(){D(`[SessionsWebSocket] Force reconnecting`),this.reconnectAttempts=0,this.sessionNotFoundRetries=0,this.close(),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},500)}};E(),U(),n();function nt(e){return e.type!==`control_request`&&e.type!==`control_response`&&e.type!==`control_cancel_request`}var rt=class{constructor(e,t){r(this,`config`,void 0),r(this,`callbacks`,void 0),r(this,`websocket`,null),r(this,`pendingPermissionRequests`,new Map),this.config=e,this.callbacks=t}connect(){D(`[RemoteSessionManager] Connecting to session ${this.config.sessionId}`);let e={onMessage:e=>this.handleMessage(e),onConnected:()=>{D(`[RemoteSessionManager] Connected`),this.callbacks.onConnected?.()},onClose:()=>{D(`[RemoteSessionManager] Disconnected`),this.callbacks.onDisconnected?.()},onReconnecting:()=>{D(`[RemoteSessionManager] Reconnecting`),this.callbacks.onReconnecting?.()},onError:e=>{W(e),this.callbacks.onError?.(e)}};this.websocket=new tt(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);D(`[RemoteSessionManager] Permission request cancelled: ${t}`),this.pendingPermissionRequests.delete(t),this.callbacks.onPermissionCancelled?.(t,n?.tool_use_id);return}if(e.type===`control_response`){D(`[RemoteSessionManager] Received control response`);return}nt(e)&&this.callbacks.onMessage(e)}handleControlRequest(e){let t=e.request_id,n=e.request;if(n.subtype===`can_use_tool`)D(`[RemoteSessionManager] Permission request for tool: ${n.tool_name}`),this.pendingPermissionRequests.set(t,n),this.callbacks.onPermissionRequest(n,t);else{D(`[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){D(`[RemoteSessionManager] Sending message to session ${this.config.sessionId}`);let n=await ke(this.config.sessionId,e,t);return n||W(Error(`[RemoteSessionManager] Failed to send message to session ${this.config.sessionId}`)),n}respondToPermissionRequest(e,t){if(!this.pendingPermissionRequests.get(e)){W(Error(`[RemoteSessionManager] No pending permission request with ID: ${e}`));return}this.pendingPermissionRequests.delete(e);let n={type:`control_response`,response:{subtype:`success`,request_id:e,response:{behavior:t.behavior,...t.behavior===`allow`?{updatedInput:t.updatedInput}:{message:t.message}}}};D(`[RemoteSessionManager] Sending permission response: ${t.behavior}`),this.websocket?.sendControlResponse(n)}isConnected(){return this.websocket?.isConnected()??!1}cancelSession(){D(`[RemoteSessionManager] Sending interrupt signal`),this.websocket?.sendControlRequest({subtype:`interrupt`})}getSessionId(){return this.config.sessionId}disconnect(){D(`[RemoteSessionManager] Disconnecting`),this.websocket?.close(),this.websocket=null,this.pendingPermissionRequests.clear()}reconnect(){D(`[RemoteSessionManager] Reconnecting WebSocket`),this.websocket?.reconnect()}};function it(e,t,n,r=!1,i=!1){return{sessionId:e,getAccessToken:t,orgUuid:n,hasInitialPrompt:r,viewerOnly:i}}export{Ke as a,He as c,J as i,it as n,Ge as o,Ze as r,Ve as s,rt as t};
@@ -0,0 +1 @@
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{$t as l,gr as te}from"./state-C2OSZkV1.js";import{Hr as ne,Jn as re,Lc as ie,Mc as u,Nr as ae,Pw as d,Sl as oe,Ty as f,_v as p,ar as se,bv as ce,dp as m,dx as h,fi as le,fx as ue,jr as g,np as _,pi as de,pp as v,qr as y,rp as b,ti as x,vv as S,wy as C,xl as fe,xw as w}from"./loadAgentsDir-ByO8eJqU.js";import{o as T,s as E}from"./log-CZ0zYP_c.js";import{n as D,r as O}from"./analytics-CkYUHW_U.js";import{r as pe}from"./asciicast-BJNYO5sh.js";import{a as me,n as k,s as A}from"./skillChangeDetector-plLveEbf.js";import{a as j,i as M,n as N,o as P,r as F,t as I}from"./crossProjectResume-lDFB2ZcY.js";import{t as L}from"./REPL-BXhAQOXb.js";import{dirname as R}from"path";var z=t(o(),1);w(),l(),P(),v(),h(),s(),d(),D(),p(),f(),M(),u(),_(),N(),T(),g();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:h,initialSearchQuery:g,disableSlashCommands:_=!1,forkSession:v,taskListId:w,filterByPr:T,thinkingConfig:D,onTurnComplete:M}){let{rows:N}=ee(),P=S(e=>e.agentDefinitions),V=ce(),[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(T!==void 0){if(T===!0)e=e.filter(e=>e.prNumber!==void 0);else if(typeof T==`number`)e=e.filter(e=>e.prNumber===T);else if(typeof T==`string`){let t=he(T);t!==null&&(e=e.filter(e=>e.prNumber===t))}}return e},[U,T]),Ce=ae();z.useEffect(()=>{y(i).then(e=>{Y.current=e,X.current=e.logs.length,W(e.logs),G(!1)}).catch(e=>{E(e),G(!1)})},[i]);let Q=z.useCallback(e=>{let t=Y.current;!t||t.nextIndex>=t.allStatLogs.length||se(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?ne():y(i)).then(e=>{Y.current=e,X.current=e.logs.length,W(e.logs)}).catch(e=>{E(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 b(t,void 0);if(!r)throw Error(`Failed to load conversation`);r.sessionId&&!v?(te(C(r.sessionId),t.fullPath?R(t.fullPath):null),await pe(),await le(),ue(r.sessionId)):v&&r.contentReplacements?.length&&await x(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})),ie(r.agentName),de(v?{...r,worktreeSession:void 0}:r),v||(A(r.worktreeSession),r.sessionId&&re()),r.goal&&r.sessionId){let{hydrateGoalFromTranscript:t}=(oe(),e(fe)),n=new Map;n.set(r.sessionId,r.goal),t(n,r.sessionId)}O(`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 O(`tengu_session_resumed`,{entrypoint:`picker`,success:!1}),E(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:h,mainThreadAgentDefinition:q.mainThreadAgentDefinition,autoConnectIdeFlag:d,disableSlashCommands:_,taskListId:w,thinkingConfig:D,onTurnComplete:M}):_e?(0,B.jsxs)(n,{children:[(0,B.jsx)(m,{}),(0,B.jsx)(r,{children:` Loading conversations…`})]}):ve?(0,B.jsxs)(n,{children:[(0,B.jsx)(m,{}),(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,4 +1,4 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./defineProperty-C-QyHrDq.js";import{n as r,t as i}from"./axios-DaWTGg7G.js";import{C as a,F as o,S as s,a as c,l,w as u,z as d}from"./debug-BrXObCdR.js";import{M as f,j as p}from"./git-Do0wJvux.js";import{_n as m,ar as h,or as g,vn as _}from"./model-CKkOnnnx.js";import{E as v,O as y,n as b,t as x}from"./rcDebugLog-CUy1_F23.js";function S(){return!0}function C(e){let t=[],n=0,r=/\r?\n\r?\n/g;r.lastIndex=n;let i;for(;(i=r.exec(e))!==null;){let r=i.index,a=e.slice(n,r);if(n=r+i[0].length,!a.trim())continue;let o={},s=!1;for(let e of a.split(`
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./defineProperty-C-QyHrDq.js";import{n as r,t as i}from"./axios-DaWTGg7G.js";import{C as a,F as o,S as s,a as c,l,w as u,z as d}from"./debug-RZ4NuXyS.js";import{O as f,k as p}from"./git-BerW9bId.js";import{_n as m,vn as h}from"./model-CwO-g1RW.js";import{n as g,t as _}from"./userAgent-BxTG7IMk.js";import{I as v,P as y}from"./sessionState-CjNY991n.js";import{n as b,t as x}from"./rcDebugLog-CARUIORE.js";function S(){return!0}function C(e){let t=[],n=0,r=/\r?\n\r?\n/g;r.lastIndex=n;let i;for(;(i=r.exec(e))!==null;){let r=i.index,a=e.slice(n,r);if(n=r+i[0].length,!a.trim())continue;let o={},s=!1;for(let e of a.split(`
2
2
  `)){let t=e[e.length-1]===`\r`?e.slice(0,-1):e;if(t.startsWith(`:`)){s=!0;continue}let n=t.indexOf(`:`);if(n===-1)continue;let r=t.slice(0,n),i=t[n+1]===` `?t.slice(n+2):t.slice(n+1);switch(r){case`event`:o.event=i;break;case`id`:o.id=i;break;case`data`:o.data=o.data?o.data+`
3
- `+i:i;break}}(o.data||s)&&t.push(o)}return{frames:t,remaining:e.slice(n)}}function w(e){let t=e.pathname;return t.endsWith(`/stream`)&&(t=t.slice(0,-7)),`${e.protocol}//${e.host}${t}`}var T,E,D,O,k,A,j,M,N,P,F=e((()=>{i(),c(),x(),p(),d(),y(),m(),s(),g(),t(),T=1e3,E=3e4,D=6e5,O=45e3,k=new Set([401,403,404]),A=10,j=500,M=8e3,N={stream:!0},P=class{constructor(e,t={},r,i,a,o){n(this,`url`,void 0),n(this,`state`,`idle`),n(this,`onData`,void 0),n(this,`onCloseCallback`,void 0),n(this,`onEventCallback`,void 0),n(this,`headers`,void 0),n(this,`sessionId`,void 0),n(this,`refreshHeaders`,void 0),n(this,`getAuthHeaders`,void 0),n(this,`abortController`,null),n(this,`lastSequenceNum`,0),n(this,`seenSequenceNums`,new Set),n(this,`reconnectAttempts`,0),n(this,`reconnectStartTime`,null),n(this,`reconnectTimer`,null),n(this,`livenessTimer`,null),n(this,`lastActivityTime`,0),n(this,`postUrl`,void 0),n(this,`onLivenessTimeout`,()=>{this.livenessTimer=null,b(`SSE liveness timeout (${O}ms) lastSeqNum=${this.getLastSequenceNum()} state=${this.state}`),l(`SSETransport: Liveness timeout, reconnecting`,{level:`error`}),f(`error`,`cli_sse_liveness_timeout`),this.abortController?.abort(),this.handleConnectionError()}),this.url=e,this.headers=t,this.sessionId=r,this.refreshHeaders=i,this.getAuthHeaders=o??v,this.postUrl=w(e),a!==void 0&&a>0&&(this.lastSequenceNum=a),l(`SSETransport: SSE URL = ${e.href}`),l(`SSETransport: POST URL = ${this.postUrl}`),f(`info`,`cli_sse_transport_initialized`)}getLastSequenceNum(){return this.lastSequenceNum}async connect(){if(this.state!==`idle`&&this.state!==`reconnecting`){l(`SSETransport: Cannot connect, current state is ${this.state}`,{level:`error`}),f(`error`,`cli_sse_connect_failed`);return}this.state=`reconnecting`;let e=Date.now(),t=new URL(this.url.href);this.lastSequenceNum>0&&t.searchParams.set(`from_sequence_num`,String(this.lastSequenceNum));let n=this.getAuthHeaders(),r={...this.headers,...n,Accept:`text/event-stream`,"anthropic-version":`2023-06-01`,"User-Agent":h()};n.Cookie&&delete r.Authorization,this.lastSequenceNum>0&&(r[`Last-Event-ID`]=String(this.lastSequenceNum)),l(`SSETransport: Opening ${t.href}`),f(`info`,`cli_sse_connect_opening`),this.abortController=new AbortController;try{let n=await fetch(t.href,{headers:r,signal:this.abortController.signal});if(!n.ok){let e=k.has(n.status);if(l(`SSETransport: HTTP ${n.status}${e?` (permanent)`:``}`,{level:`error`}),f(`error`,`cli_sse_connect_http_error`,{status:n.status}),e){this.state=`closed`,this.onCloseCallback?.(n.status);return}this.handleConnectionError();return}if(!n.body){l(`SSETransport: No response body`),this.handleConnectionError();return}let i=Date.now()-e;l(`SSETransport: Connected`),f(`info`,`cli_sse_connect_connected`,{duration_ms:i}),this.state=`connected`,this.reconnectAttempts=0,this.reconnectStartTime=null,this.resetLivenessTimer(),await this.readStream(n.body)}catch(e){if(this.abortController?.signal.aborted)return;l(`SSETransport: Connection error: ${o(e)}`,{level:`error`}),f(`error`,`cli_sse_connect_error`),this.handleConnectionError()}}async readStream(e){let t=e.getReader(),n=new TextDecoder,r=``,i=1024*1024;try{for(;;){let{done:e,value:a}=await t.read();if(e)break;if(r+=n.decode(a,N),r.length>i){l(`SSETransport: Buffer exceeded ${i} bytes — dropping connection`,{level:`error`}),f(`error`,`cli_sse_buffer_overflow`);break}let{frames:o,remaining:s}=C(r);r=s;for(let e of o){if(this.resetLivenessTimer(),e.id){let t=parseInt(e.id,10);if(!isNaN(t)){if(this.seenSequenceNums.has(t))l(`SSETransport: DUPLICATE frame seq=${t} (lastSequenceNum=${this.lastSequenceNum}, seenCount=${this.seenSequenceNums.size})`,{level:`warn`}),f(`warn`,`cli_sse_duplicate_sequence`);else if(this.seenSequenceNums.add(t),this.seenSequenceNums.size>1e3){let e=this.lastSequenceNum-200;for(let t of this.seenSequenceNums)t<e&&this.seenSequenceNums.delete(t)}t>this.lastSequenceNum&&(this.lastSequenceNum=t)}}e.event&&e.data?this.handleSSEFrame(e.event,e.data):e.data&&(l(`SSETransport: Frame has data: but no event: field — dropped`,{level:`warn`}),f(`warn`,`cli_sse_frame_missing_event_field`))}}}catch(e){if(this.abortController?.signal.aborted)return;l(`SSETransport: Stream read error: ${o(e)}`,{level:`error`}),f(`error`,`cli_sse_stream_read_error`)}finally{t.releaseLock()}this.state!==`closing`&&this.state!==`closed`&&(l(`SSETransport: Stream ended, reconnecting`),this.handleConnectionError())}handleSSEFrame(e,t){if(e!==`client_event`){l(`SSETransport: Unexpected SSE event type '${e}' on worker stream`,{level:`warn`}),f(`warn`,`cli_sse_unexpected_event_type`,{event_type:e});return}let n;try{n=a(t)}catch(e){l(`SSETransport: Failed to parse client_event data: ${o(e)}`,{level:`error`});return}let r=n.payload;if(r&&typeof r==`object`&&`type`in r){let e=this.sessionId?` session=${this.sessionId}`:``;l(`SSETransport: Event seq=${n.sequence_num} event_id=${n.event_id} event_type=${n.event_type} payload_type=${String(r.type)}${e}`),f(`info`,`cli_sse_message_received`),this.onData?.(u(r)+`
4
- `)}else l(`SSETransport: Ignoring client_event with no type in payload: event_id=${n.event_id}`);this.onEventCallback?.(n)}handleConnectionError(){if(b(`SSE handleConnectionError: state=${this.state} lastSeqNum=${this.getLastSequenceNum()} reconnectAttempts=${this.reconnectAttempts} msSinceLastActivity=${this.lastActivityTime>0?Date.now()-this.lastActivityTime:-1}`),this.clearLivenessTimer(),this.state===`closing`||this.state===`closed`)return;this.abortController?.abort(),this.abortController=null;let e=Date.now();this.reconnectStartTime||(this.reconnectStartTime=e);let t=e-this.reconnectStartTime;if(t<D){if(this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.refreshHeaders){let e=this.refreshHeaders();Object.assign(this.headers,e),l(`SSETransport: Refreshed headers for reconnect`)}this.state=`reconnecting`,this.reconnectAttempts++;let e=Math.min(T*2**(this.reconnectAttempts-1),E),n=Math.max(0,e+e*.25*(2*Math.random()-1));l(`SSETransport: Reconnecting in ${Math.round(n)}ms (attempt ${this.reconnectAttempts}, ${Math.round(t/1e3)}s elapsed)`),f(`error`,`cli_sse_reconnect_attempt`,{reconnectAttempts:this.reconnectAttempts}),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},n)}else l(`SSETransport: Reconnection time budget exhausted after ${Math.round(t/1e3)}s`,{level:`error`}),f(`error`,`cli_sse_reconnect_exhausted`,{reconnectAttempts:this.reconnectAttempts,elapsedMs:t}),this.state=`closed`,this.onCloseCallback?.()}resetLivenessTimer(){this.clearLivenessTimer(),this.livenessTimer=setTimeout(this.onLivenessTimeout,O)}clearLivenessTimer(){this.livenessTimer&&(clearTimeout(this.livenessTimer),this.livenessTimer=null)}async write(e){let t=this.getAuthHeaders();if(Object.keys(t).length===0){l(`SSETransport: No session token available for POST`),f(`warn`,`cli_sse_post_no_token`);return}let n={...t,"Content-Type":`application/json`,"anthropic-version":`2023-06-01`,"User-Agent":h()};l(`SSETransport: POST body keys=${Object.keys(e).join(`,`)}`);for(let t=1;t<=A;t++){try{let i=await r.post(this.postUrl,e,{headers:n,validateStatus:S});if(i.status===200||i.status===201){l(`SSETransport: POST success type=${e.type}`);return}if(l(`SSETransport: POST ${i.status} body=${u(i.data).slice(0,200)}`),i.status>=400&&i.status<500&&i.status!==429){l(`SSETransport: POST returned ${i.status} (client error), not retrying`),f(`warn`,`cli_sse_post_client_error`,{status:i.status});return}l(`SSETransport: POST returned ${i.status}, attempt ${t}/${A}`),f(`warn`,`cli_sse_post_retryable_error`,{status:i.status,attempt:t})}catch(e){l(`SSETransport: POST error: ${e.message}, attempt ${t}/${A}`),f(`warn`,`cli_sse_post_network_error`,{attempt:t})}if(t===A){l(`SSETransport: POST failed after ${A} attempts, continuing`),f(`warn`,`cli_sse_post_retries_exhausted`);return}await _(Math.min(j*2**(t-1),M))}}isConnectedStatus(){return this.state===`connected`}isClosedStatus(){return this.state===`closed`}setOnData(e){this.onData=e}setOnClose(e){this.onCloseCallback=e}setOnEvent(e){this.onEventCallback=e}close(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.clearLivenessTimer(),this.state=`closing`,this.abortController?.abort(),this.abortController=null}}}));export{F as n,C as r,P as t};
3
+ `+i:i;break}}(o.data||s)&&t.push(o)}return{frames:t,remaining:e.slice(n)}}function w(e){let t=e.pathname;return t.endsWith(`/stream`)&&(t=t.slice(0,-7)),`${e.protocol}//${e.host}${t}`}var T,E,D,O,k,A,j,M,N,P,F=e((()=>{i(),c(),x(),f(),d(),v(),m(),s(),g(),t(),T=1e3,E=3e4,D=6e5,O=45e3,k=new Set([401,403,404]),A=10,j=500,M=8e3,N={stream:!0},P=class{constructor(e,t={},r,i,a,o){n(this,`url`,void 0),n(this,`state`,`idle`),n(this,`onData`,void 0),n(this,`onCloseCallback`,void 0),n(this,`onEventCallback`,void 0),n(this,`headers`,void 0),n(this,`sessionId`,void 0),n(this,`refreshHeaders`,void 0),n(this,`getAuthHeaders`,void 0),n(this,`abortController`,null),n(this,`lastSequenceNum`,0),n(this,`seenSequenceNums`,new Set),n(this,`reconnectAttempts`,0),n(this,`reconnectStartTime`,null),n(this,`reconnectTimer`,null),n(this,`livenessTimer`,null),n(this,`lastActivityTime`,0),n(this,`postUrl`,void 0),n(this,`onLivenessTimeout`,()=>{this.livenessTimer=null,b(`SSE liveness timeout (${O}ms) lastSeqNum=${this.getLastSequenceNum()} state=${this.state}`),l(`SSETransport: Liveness timeout, reconnecting`,{level:`error`}),p(`error`,`cli_sse_liveness_timeout`),this.abortController?.abort(),this.handleConnectionError()}),this.url=e,this.headers=t,this.sessionId=r,this.refreshHeaders=i,this.getAuthHeaders=o??y,this.postUrl=w(e),a!==void 0&&a>0&&(this.lastSequenceNum=a),l(`SSETransport: SSE URL = ${e.href}`),l(`SSETransport: POST URL = ${this.postUrl}`),p(`info`,`cli_sse_transport_initialized`)}getLastSequenceNum(){return this.lastSequenceNum}async connect(){if(this.state!==`idle`&&this.state!==`reconnecting`){l(`SSETransport: Cannot connect, current state is ${this.state}`,{level:`error`}),p(`error`,`cli_sse_connect_failed`);return}this.state=`reconnecting`;let e=Date.now(),t=new URL(this.url.href);this.lastSequenceNum>0&&t.searchParams.set(`from_sequence_num`,String(this.lastSequenceNum));let n=this.getAuthHeaders(),r={...this.headers,...n,Accept:`text/event-stream`,"anthropic-version":`2023-06-01`,"User-Agent":_()};n.Cookie&&delete r.Authorization,this.lastSequenceNum>0&&(r[`Last-Event-ID`]=String(this.lastSequenceNum)),l(`SSETransport: Opening ${t.href}`),p(`info`,`cli_sse_connect_opening`),this.abortController=new AbortController;try{let n=await fetch(t.href,{headers:r,signal:this.abortController.signal});if(!n.ok){let e=k.has(n.status);if(l(`SSETransport: HTTP ${n.status}${e?` (permanent)`:``}`,{level:`error`}),p(`error`,`cli_sse_connect_http_error`,{status:n.status}),e){this.state=`closed`,this.onCloseCallback?.(n.status);return}this.handleConnectionError();return}if(!n.body){l(`SSETransport: No response body`),this.handleConnectionError();return}let i=Date.now()-e;l(`SSETransport: Connected`),p(`info`,`cli_sse_connect_connected`,{duration_ms:i}),this.state=`connected`,this.reconnectAttempts=0,this.reconnectStartTime=null,this.resetLivenessTimer(),await this.readStream(n.body)}catch(e){if(this.abortController?.signal.aborted)return;l(`SSETransport: Connection error: ${o(e)}`,{level:`error`}),p(`error`,`cli_sse_connect_error`),this.handleConnectionError()}}async readStream(e){let t=e.getReader(),n=new TextDecoder,r=``,i=1024*1024;try{for(;;){let{done:e,value:a}=await t.read();if(e)break;if(r+=n.decode(a,N),r.length>i){l(`SSETransport: Buffer exceeded ${i} bytes — dropping connection`,{level:`error`}),p(`error`,`cli_sse_buffer_overflow`);break}let{frames:o,remaining:s}=C(r);r=s;for(let e of o){if(this.resetLivenessTimer(),e.id){let t=parseInt(e.id,10);if(!isNaN(t)){if(this.seenSequenceNums.has(t))l(`SSETransport: DUPLICATE frame seq=${t} (lastSequenceNum=${this.lastSequenceNum}, seenCount=${this.seenSequenceNums.size})`,{level:`warn`}),p(`warn`,`cli_sse_duplicate_sequence`);else if(this.seenSequenceNums.add(t),this.seenSequenceNums.size>1e3){let e=this.lastSequenceNum-200;for(let t of this.seenSequenceNums)t<e&&this.seenSequenceNums.delete(t)}t>this.lastSequenceNum&&(this.lastSequenceNum=t)}}e.event&&e.data?this.handleSSEFrame(e.event,e.data):e.data&&(l(`SSETransport: Frame has data: but no event: field — dropped`,{level:`warn`}),p(`warn`,`cli_sse_frame_missing_event_field`))}}}catch(e){if(this.abortController?.signal.aborted)return;l(`SSETransport: Stream read error: ${o(e)}`,{level:`error`}),p(`error`,`cli_sse_stream_read_error`)}finally{t.releaseLock()}this.state!==`closing`&&this.state!==`closed`&&(l(`SSETransport: Stream ended, reconnecting`),this.handleConnectionError())}handleSSEFrame(e,t){if(e!==`client_event`){l(`SSETransport: Unexpected SSE event type '${e}' on worker stream`,{level:`warn`}),p(`warn`,`cli_sse_unexpected_event_type`,{event_type:e});return}let n;try{n=a(t)}catch(e){l(`SSETransport: Failed to parse client_event data: ${o(e)}`,{level:`error`});return}let r=n.payload;if(r&&typeof r==`object`&&`type`in r){let e=this.sessionId?` session=${this.sessionId}`:``;l(`SSETransport: Event seq=${n.sequence_num} event_id=${n.event_id} event_type=${n.event_type} payload_type=${String(r.type)}${e}`),p(`info`,`cli_sse_message_received`),this.onData?.(u(r)+`
4
+ `)}else l(`SSETransport: Ignoring client_event with no type in payload: event_id=${n.event_id}`);this.onEventCallback?.(n)}handleConnectionError(){if(b(`SSE handleConnectionError: state=${this.state} lastSeqNum=${this.getLastSequenceNum()} reconnectAttempts=${this.reconnectAttempts} msSinceLastActivity=${this.lastActivityTime>0?Date.now()-this.lastActivityTime:-1}`),this.clearLivenessTimer(),this.state===`closing`||this.state===`closed`)return;this.abortController?.abort(),this.abortController=null;let e=Date.now();this.reconnectStartTime||(this.reconnectStartTime=e);let t=e-this.reconnectStartTime;if(t<D){if(this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.refreshHeaders){let e=this.refreshHeaders();Object.assign(this.headers,e),l(`SSETransport: Refreshed headers for reconnect`)}this.state=`reconnecting`,this.reconnectAttempts++;let e=Math.min(T*2**(this.reconnectAttempts-1),E),n=Math.max(0,e+e*.25*(2*Math.random()-1));l(`SSETransport: Reconnecting in ${Math.round(n)}ms (attempt ${this.reconnectAttempts}, ${Math.round(t/1e3)}s elapsed)`),p(`error`,`cli_sse_reconnect_attempt`,{reconnectAttempts:this.reconnectAttempts}),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},n)}else l(`SSETransport: Reconnection time budget exhausted after ${Math.round(t/1e3)}s`,{level:`error`}),p(`error`,`cli_sse_reconnect_exhausted`,{reconnectAttempts:this.reconnectAttempts,elapsedMs:t}),this.state=`closed`,this.onCloseCallback?.()}resetLivenessTimer(){this.clearLivenessTimer(),this.livenessTimer=setTimeout(this.onLivenessTimeout,O)}clearLivenessTimer(){this.livenessTimer&&(clearTimeout(this.livenessTimer),this.livenessTimer=null)}async write(e){let t=this.getAuthHeaders();if(Object.keys(t).length===0){l(`SSETransport: No session token available for POST`),p(`warn`,`cli_sse_post_no_token`);return}let n={...t,"Content-Type":`application/json`,"anthropic-version":`2023-06-01`,"User-Agent":_()};l(`SSETransport: POST body keys=${Object.keys(e).join(`,`)}`);for(let t=1;t<=A;t++){try{let i=await r.post(this.postUrl,e,{headers:n,validateStatus:S});if(i.status===200||i.status===201){l(`SSETransport: POST success type=${e.type}`);return}if(l(`SSETransport: POST ${i.status} body=${u(i.data).slice(0,200)}`),i.status>=400&&i.status<500&&i.status!==429){l(`SSETransport: POST returned ${i.status} (client error), not retrying`),p(`warn`,`cli_sse_post_client_error`,{status:i.status});return}l(`SSETransport: POST returned ${i.status}, attempt ${t}/${A}`),p(`warn`,`cli_sse_post_retryable_error`,{status:i.status,attempt:t})}catch(e){l(`SSETransport: POST error: ${e.message}, attempt ${t}/${A}`),p(`warn`,`cli_sse_post_network_error`,{attempt:t})}if(t===A){l(`SSETransport: POST failed after ${A} attempts, continuing`),p(`warn`,`cli_sse_post_retries_exhausted`);return}await h(Math.min(j*2**(t-1),M))}}isConnectedStatus(){return this.state===`connected`}isClosedStatus(){return this.state===`closed`}setOnData(e){this.onData=e}setOnClose(e){this.onCloseCallback=e}setOnEvent(e){this.onEventCallback=e}close(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.clearLivenessTimer(),this.state=`closing`,this.abortController?.abort(),this.abortController=null}}}));export{F as n,C as r,P as t};
@@ -0,0 +1 @@
1
+ import{Og as e,kg as t}from"./loadAgentsDir-ByO8eJqU.js";t();export{e as clearSearchExtraToolsDescriptionCache};
@@ -0,0 +1,2 @@
1
+ import{a as e,n as t,o as n}from"./rolldown-runtime-DaDcL9Zw.js";import{d as r,l as i,o as a}from"./envUtils-DSxRz_kt.js";import{n as o,t as s}from"./figures-5ThXQEtq.js";import{D as c,Gt as ee,H as te,I as l,P as u,T as d,U as ne,Wt as re,Xn as ie,a as ae,di as oe,fi as f,k as se,n as ce,ot as le,r as ue,t as p,ui as m,x as de,y as fe}from"./src-CDCSSo0U2.js";import{t as h}from"./jsx-runtime-Bb4Xn-E0.js";import{$t as g,Kt as pe,mr as me,mt as _}from"./state-C2OSZkV1.js";import{Bp as v,Bx as he,C as y,F as ge,Hx as _e,Jp as ve,Pw as b,Rp as ye,S as be,Ux as xe,Wx as Se,_v as x,bo as Ce,bv as we,dS as Te,dv as Ee,im as De,jr as S,mr as Oe,oS as ke,qp as C,rm as w,sS as T,uv as E,v as Ae,vv as D,xo as O,xw as je,yo as Me,yv as Ne,zp as Pe}from"./loadAgentsDir-ByO8eJqU.js";import{n as Fe,t as k}from"./cwd-C5ce-7WB.js";import{Ft as Ie,Nt as Le,Pt as Re,Rt as ze,c as Be,g as A,jt as Ve,n as He,x as j,zt as Ue}from"./settings-hQDLwPVj.js";import{a as We,b as M,c as N,g as Ge,i as Ke,o as qe}from"./config-CE058cvr.js";import{o as Je,s as Ye}from"./log-CZ0zYP_c.js";import{n as Xe,r as P}from"./analytics-CkYUHW_U.js";import{G as Ze,K as Qe,Sr as $e,_ as et,b as tt,et as F,it as nt,q as rt,rt as it,tt as at,x as ot,xr as st}from"./model-CwO-g1RW.js";import{d as I}from"./sessionState-CjNY991n.js";import{r as ct,t as lt}from"./poorMode-CYXmr_mU.js";import{a as ut,c as dt,d as ft,i as pt,l as mt,n as ht,o as gt,r as L,s as _t,t as R,u as z}from"./status-CFw-FpZM.js";import{n as B,t as V}from"./useExitOnCtrlCDWithKeybindings-Cce612uS.js";import{i as H,n as vt,r as yt}from"./modalContext-DFjKLCB6.js";import{n as bt,t as xt}from"./ThemePicker-EQ6hPUeI.js";import{i as St,n as Ct,r as wt,t as Tt}from"./extraUsage-Dw7AXiH7.js";import{n as Et,t as Dt}from"./ClaudeMdExternalIncludesDialog-C-CTa-95.js";import{t as Ot}from"./SearchBox-vfLXEPed.js";import{n as kt,t as U}from"./useSearchInput-BAgljZUl.js";function At(){let e=_();return[{label:`Version`,value:`0.0.8`},{label:`Session name`,value:Oe(e)??(0,K.jsx)(u,{dimColor:!0,children:`/rename to add a name`})},{label:`Session ID`,value:e},{label:`cwd`,value:k()},...ht(),...R()]}function jt({mainLoopModel:e,mcp:t,theme:n,context:r}){return[{label:`Model`,value:z(e)},...L(t.clients,r.options.ideInstallationStatus,n),...gt(t.clients,n),...dt(),...mt()]}async function Mt(){return[...await pt(),...await ut(),...await _t()]}function W({value:e}){return Array.isArray(e)?(0,K.jsx)(l,{flexWrap:`wrap`,columnGap:1,flexShrink:99,children:e.map((t,n)=>(0,K.jsxs)(u,{children:[t,n<e.length-1?`,`:``]},n))}):typeof e==`string`?(0,K.jsx)(u,{children:e}):e}function Nt({context:e,diagnosticsPromise:t}){let n=D(e=>e.mainLoopModel),r=D(e=>e.mcp),[i]=te(),a=Ft.useMemo(()=>[At(),jt({mainLoopModel:n,mcp:r,theme:i,context:e})],[n,r,i,e]),o=yt()?1:void 0;return(0,K.jsxs)(l,{flexDirection:`column`,flexGrow:o,children:[(0,K.jsxs)(l,{flexDirection:`column`,gap:1,flexGrow:o,children:[a.map((e,t)=>e.length>0&&(0,K.jsx)(l,{flexDirection:`column`,children:e.map(({label:e,value:t},n)=>(0,K.jsxs)(l,{flexDirection:`row`,gap:1,flexShrink:0,children:[e!==void 0&&(0,K.jsxs)(u,{bold:!0,children:[e,`:`]}),(0,K.jsx)(W,{value:t})]},n))},t)),(0,K.jsx)(G.Suspense,{fallback:null,children:(0,K.jsx)(Pt,{promise:t})})]}),(0,K.jsx)(u,{dimColor:!0,children:(0,K.jsx)(C,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})})]})}function Pt({promise:e}){let t=(0,G.use)(e);return t.length===0?null:(0,K.jsxs)(l,{flexDirection:`column`,paddingBottom:1,children:[(0,K.jsx)(u,{bold:!0,children:`System Diagnostics`}),t.map((e,t)=>(0,K.jsxs)(l,{flexDirection:`row`,gap:1,paddingX:1,children:[(0,K.jsx)(u,{color:`error`,children:s.warning}),typeof e==`string`?(0,K.jsx)(u,{wrap:`wrap`,children:e}):e]},t))]})}var Ft,G,K,It=t((()=>{o(),Ft=n(f(),1),G=n(f(),1),g(),vt(),p(),x(),Fe(),S(),ft(),ve(),K=h()}));function Lt({currentVersion:e,onChoice:t}){function n(e){t(e)}function r(){t(`cancel`)}return(0,Rt.jsxs)(fe,{title:`Switch to Stable Channel`,onCancel:r,color:`permission`,hideBorder:!0,hideInputGuide:!0,children:[(0,Rt.jsxs)(u,{children:[`The stable channel may have an older version than what you're currently running (`,e,`).`]}),(0,Rt.jsx)(u,{dimColor:!0,children:`How would you like to handle this?`}),(0,Rt.jsx)(Pe,{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 Rt,zt=t((()=>{f(),p(),ye(),Rt=h()}));function Bt(e){return Object.entries(e).map(([e,t])=>({label:t?.name??Ut,value:e,description:t?.description??Wt}))}function Vt({initialStyle:e,onComplete:t,onCancel:n,isStandaloneCommand:r}){let[i,a]=(0,Ht.useState)([]),[o,s]=(0,Ht.useState)(!0);(0,Ht.useEffect)(()=>{Ce(k()).then(e=>{let t=Bt(e);a(t),s(!1)}).catch(()=>{let e=Bt(Me);a(e),s(!1)})},[]);let c=(0,Ht.useCallback)(e=>{t(e)},[t]);return(0,q.jsx)(fe,{title:`Preferred output style`,onCancel:n,hideInputGuide:!r,hideBorder:!r,children:(0,q.jsxs)(l,{flexDirection:`column`,gap:1,children:[(0,q.jsx)(l,{marginTop:1,children:(0,q.jsx)(u,{dimColor:!0,children:`This changes how Claude Code communicates with you`})}),o?(0,q.jsx)(u,{dimColor:!0,children:`Loading output styles…`}):(0,q.jsx)(Pe,{options:i,onChange:c,visibleOptionCount:10,defaultValue:e})]})})}var Ht,q,Ut,Wt,Gt=t((()=>{f(),Ht=n(f(),1),O(),p(),Fe(),v(),q=h(),Ut=`Default`,Wt=`Claude completes coding tasks efficiently and provides concise responses`}));function Kt({initialLanguage:e,onComplete:t,onCancel:n}){let[r,i]=(0,qt.useState)(e),[a,o]=(0,qt.useState)((e??``).length);re(`confirm:no`,n,{context:`Settings`});function c(){let e=r?.trim();t(e||void 0)}return(0,J.jsxs)(l,{flexDirection:`column`,gap:1,children:[(0,J.jsx)(u,{children:`Enter your preferred response and voice language:`}),(0,J.jsxs)(l,{flexDirection:`row`,gap:1,children:[(0,J.jsx)(u,{children:s.pointer}),(0,J.jsx)(w,{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)(u,{dimColor:!0,children:`Leave empty for default (English)`})]})}var qt,J,Jt=t((()=>{o(),qt=n(f(),1),p(),b(),De(),J=h()}));function Yt({onClose:t,context:n,setTabsHidden:a,onIsSearchModeChange:o,contentHeight:oe}){let{headerFocused:f,focusHeader:ce}=ae(),ue=yt(),[,p]=te(),de=ne(),[h,g]=(0,X.useState)(N()),_=Y.useRef(N()),[v,y]=(0,X.useState)(He()),ve=Y.useRef(He()),[b,ye]=(0,X.useState)(v?.outputStyle||`default`),Se=Y.useRef(b),[x,Ce]=(0,X.useState)(v?.language),De=Y.useRef(x),[S,Oe]=(0,X.useState)(0),[w,T]=(0,X.useState)(0),[E,O]=(0,X.useState)(!1),je=ie(),{rows:Me}=le(),Fe=oe??Math.min(Math.floor(Me*.8),30),k=Math.max(5,Fe-10),A=D(e=>e.mainLoopModel),Ve=D(e=>e.verbose),Ge=D(e=>e.thinkingEnabled),Je=D(e=>it()?e.fastMode:!1);D(e=>e.promptSuggestionEnabled);let Xe=Re(v?.permissions?.defaultMode??`default`),et=be()||Ae()===`enabled`,F=we(),[st,I]=(0,X.useState)({}),ut=Y.useRef(Ge),[dt]=(0,X.useState)(()=>Be(`localSettings`)),[ft]=(0,X.useState)(()=>Be(`userSettings`)),pt=Y.useRef(de),mt=Ne(),[ht]=(0,X.useState)(()=>{let e=mt.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}}),[gt]=(0,X.useState)(()=>pe()),L=Y.useRef(!1),[_t,R]=(0,X.useState)(!1),[z,B]=(0,X.useState)(null),{query:V,setQuery:H,cursorOffset:vt}=kt({isActive:E&&z===null&&!f,onExit:()=>O(!1),onExitUp:ce,passthroughCtrlKeys:[`c`,`d`]}),bt=E&&!f;Y.useEffect(()=>{o?.(bt)},[bt,o]);let St=ke(n.options.mcpClients),Tt=!i(process.env.CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING),Et=Y.use(_e(!0)),Ot=xe(Et),U=We();function At(e){P(`tengu_config_model_changed`,{from_model:A,to_model:e}),F(t=>({...t,mainLoopModel:e,mainLoopModelForSession:null})),I(t=>{let n=ot(e)+(Ct(e,!1,tt())?` · Billed as extra usage`:``);if(`model`in t){let{model:e,...r}=t;return{...r,model:n}}return{...t,model:n}})}function jt(e){M(t=>({...t,verbose:e})),g({...N(),verbose:e}),F(t=>({...t,verbose:e})),I(t=>{if(`verbose`in t){let{verbose:e,...n}=t;return n}return{...t,verbose:e}})}let Mt=[{id:`autoCompactEnabled`,label:`Auto-compact`,value:h.autoCompactEnabled,type:`boolean`,onChange(e){M(t=>({...t,autoCompactEnabled:e})),g({...N(),autoCompactEnabled:e}),P(`tengu_auto_compact_setting_changed`,{enabled:e})}},{id:`spinnerTipsEnabled`,label:`Show tips`,value:v?.spinnerTipsEnabled??!0,type:`boolean`,onChange(e){j(`localSettings`,{spinnerTipsEnabled:e}),y(t=>({...t,spinnerTipsEnabled:e})),P(`tengu_tips_setting_changed`,{enabled:e})}},{id:`cacheWarningEnabled`,label:`Cache warnings`,value:v?.cacheWarningEnabled??!0,type:`boolean`,onChange(e){j(`localSettings`,{cacheWarningEnabled:e}),y(t=>({...t,cacheWarningEnabled:e})),P(`tengu_cache_warning_setting_changed`,{enabled:e})}},{id:`prefersReducedMotion`,label:`Reduce motion`,value:v?.prefersReducedMotion??!1,type:`boolean`,onChange(e){j(`localSettings`,{prefersReducedMotion:e}),y(t=>({...t,prefersReducedMotion:e})),F(t=>({...t,settings:{...t.settings,prefersReducedMotion:e}})),P(`tengu_reduce_motion_setting_changed`,{enabled:e})}},{id:`thinkingEnabled`,label:`Thinking mode`,value:Ge??!0,type:`boolean`,onChange(e){F(t=>({...t,thinkingEnabled:e})),j(`userSettings`,{alwaysThinkingEnabled:e?void 0:!1}),P(`tengu_thinking_toggled`,{enabled:e})}},...it()&&at()?[{id:`fastMode`,label:`Fast mode (${Ze} only)`,value:!!Je,type:`boolean`,onChange(e){Qe(),j(`userSettings`,{fastMode:e?!0:void 0}),e?(F(e=>({...e,mainLoopModel:rt(),mainLoopModelForSession:null,fastMode:!0})),I(e=>({...e,model:rt(),"Fast mode":`ON`}))):(F(e=>({...e,fastMode:!1})),I(e=>({...e,"Fast mode":`OFF`})))}}]:[],{id:`poorMode`,label:`Poor mode (save tokens)`,value:(lt(),e(ct)).isPoorModeActive(),type:`boolean`,onChange(t){(lt(),e(ct)).setPoorMode(t),F(e=>({...e,promptSuggestionEnabled:!t}))}},...process.env.USER_TYPE===`ant`?[{id:`speculationEnabled`,label:`Speculative execution`,value:h.speculationEnabled??!0,type:`boolean`,onChange(e){M(t=>t.speculationEnabled===e?t:{...t,speculationEnabled:e}),g({...N(),speculationEnabled:e}),P(`tengu_speculation_setting_changed`,{enabled:e})}}]:[],...Tt?[{id:`fileCheckpointingEnabled`,label:`Rewind code (checkpoints)`,value:h.fileCheckpointingEnabled,type:`boolean`,onChange(e){M(t=>({...t,fileCheckpointingEnabled:e})),g({...N(),fileCheckpointingEnabled:e}),P(`tengu_file_history_snapshots_setting_changed`,{enabled:e})}}]:[],{id:`verbose`,label:`Verbose output`,value:Ve,type:`boolean`,onChange:jt},{id:`terminalProgressBarEnabled`,label:`Terminal progress bar`,value:h.terminalProgressBarEnabled,type:`boolean`,onChange(e){M(t=>({...t,terminalProgressBarEnabled:e})),g({...N(),terminalProgressBarEnabled:e}),P(`tengu_terminal_progress_bar_setting_changed`,{enabled:e})}},{id:`showTurnDuration`,label:`Show turn duration`,value:h.showTurnDuration,type:`boolean`,onChange(e){M(t=>({...t,showTurnDuration:e})),g({...N(),showTurnDuration:e}),P(`tengu_show_turn_duration_setting_changed`,{enabled:e})}},{id:`defaultPermissionMode`,label:`Default permission mode`,value:Xe,options:(()=>{let e=[`default`,`plan`];return[...e,...Ue.filter(t=>!e.includes(t))]})(),type:`enum`,onChange(e){let t=Re(e),n=t===`auto`?t:Le(t)?ze(t):t,r=j(`userSettings`,{permissions:{...v?.permissions,defaultMode:n}});if(r.error){Ye(r.error);return}y(e=>({...e,permissions:{...e?.permissions,defaultMode:n}})),I(t=>({...t,defaultPermissionMode:e})),P(`tengu_config_changed`,{setting:`defaultPermissionMode`,value:e})}},...et?[{id:`useAutoModeDuringPlan`,label:`Use auto mode during plan`,value:v?.useAutoModeDuringPlan??!0,type:`boolean`,onChange(e){j(`userSettings`,{useAutoModeDuringPlan:e}),y(t=>({...t,useAutoModeDuringPlan:e})),F(e=>{let t=ge(e.toolPermissionContext);return t===e.toolPermissionContext?e:{...e,toolPermissionContext:t}}),I(t=>({...t,"Use auto mode during plan":e}))}}]:[],{id:`respectGitignore`,label:`Respect .gitignore in file picker`,value:h.respectGitignore,type:`boolean`,onChange(e){M(t=>({...t,respectGitignore:e})),g({...N(),respectGitignore:e}),P(`tengu_respect_gitignore_setting_changed`,{enabled:e})}},...Ee()?[{id:`copyOnSelect`,label:`Copy on select`,value:h.copyOnSelect??!0,type:`boolean`,onChange(e){M(t=>({...t,copyOnSelect:e})),g({...N(),copyOnSelect:e}),P(`tengu_config_changed`,{setting:`copyOnSelect`,value:String(e)})}}]:[],U?{id:`autoUpdatesChannel`,label:`Auto-update channel`,value:`disabled`,type:`managedEnum`,onChange(){}}:{id:`autoUpdatesChannel`,label:`Auto-update channel`,value:v?.autoUpdatesChannel??`latest`,type:`managedEnum`,onChange(){}},{id:`theme`,label:`Theme`,value:de,type:`managedEnum`,onChange:p},{id:`notifChannel`,label:`Notifications`,value:h.preferredNotifChannel,options:[`auto`,`iterm2`,`terminal_bell`,`iterm2_with_bell`,`kitty`,`ghostty`,`notifications_disabled`],type:`enum`,onChange(e){M(t=>({...t,preferredNotifChannel:e})),g({...N(),preferredNotifChannel:e})}},{id:`outputStyle`,label:`Output style`,value:b,type:`managedEnum`,onChange:()=>{}},{id:`language`,label:`Language`,value:x??`Default (English)`,type:`managedEnum`,onChange:()=>{}},{id:`editorMode`,label:`Editor mode`,value:h.editorMode===`emacs`?`normal`:h.editorMode||`normal`,options:[`normal`,`vim`],type:`enum`,onChange(e){M(t=>({...t,editorMode:e})),g({...N(),editorMode:e}),P(`tengu_editor_mode_changed`,{mode:e,source:`config_panel`})}},{id:`prStatusFooterEnabled`,label:`Show PR status footer`,value:h.prStatusFooterEnabled??!0,type:`boolean`,onChange(e){M(t=>t.prStatusFooterEnabled===e?t:{...t,prStatusFooterEnabled:e}),g({...N(),prStatusFooterEnabled:e}),P(`tengu_pr_status_footer_setting_changed`,{enabled:e})}},{id:`model`,label:`Model`,value:A===null?`Default (recommended)`:A,type:`managedEnum`,onChange:At},...St?[{id:`diffTool`,label:`Diff tool`,value:h.diffTool??`auto`,options:[`terminal`,`auto`],type:`enum`,onChange(e){M(t=>({...t,diffTool:e})),g({...N(),diffTool:e}),P(`tengu_diff_tool_changed`,{tool:e,source:`config_panel`})}}]:[],...Te()?[]:[{id:`autoConnectIde`,label:`Auto-connect to IDE (external terminal)`,value:h.autoConnectIde??!1,type:`boolean`,onChange(e){M(t=>({...t,autoConnectIde:e})),g({...N(),autoConnectIde:e}),P(`tengu_auto_connect_ide_changed`,{enabled:e,source:`config_panel`})}}],...Te()?[{id:`autoInstallIdeExtension`,label:`Auto-install IDE extension`,value:h.autoInstallIdeExtension??!0,type:`boolean`,onChange(e){M(t=>({...t,autoInstallIdeExtension:e})),g({...N(),autoInstallIdeExtension:e}),P(`tengu_auto_install_ide_extension_changed`,{enabled:e,source:`config_panel`})}}]:[],...Ot?[{id:`showExternalIncludesDialog`,label:`External CLAUDE.md includes`,value:qe().hasClaudeMdExternalIncludesApproved?`true`:`false`,type:`managedEnum`,onChange(){}}]:[],...process.env.ANTHROPIC_API_KEY&&!r()?[{id:`apiKey`,label:(0,Z.jsxs)(u,{children:[`Use custom API key: `,(0,Z.jsx)(u,{bold:!0,children:$e(process.env.ANTHROPIC_API_KEY)})]}),searchText:`Use custom API key`,value:!!(process.env.ANTHROPIC_API_KEY&&h.customApiKeyResponses?.approved?.includes($e(process.env.ANTHROPIC_API_KEY))),type:`boolean`,onChange(e){M(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=$e(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}),g(N())}}]:[]],W=Y.useMemo(()=>{if(!V)return Mt;let e=V.toLowerCase();return Mt.filter(t=>t.id.toLowerCase().includes(e)?!0:(`searchText`in t?t.searchText:t.label).toLowerCase().includes(e))},[Mt,V]);Y.useEffect(()=>{if(S>=W.length){let e=Math.max(0,W.length-1);Oe(e),T(Math.max(0,e-k+1));return}T(e=>S<e?S:S>=e+k?S-k+1:e)},[W.length,S,k]);let Nt=(0,X.useCallback)(e=>{T(t=>e<t?e:e>=t+k?e-k+1:t)},[k]),Pt=(0,X.useCallback)(()=>{if(z!==null)return;let e=Object.entries(st).map(([e,t])=>(P(`tengu_config_changed`,{key:e,value:t}),`Set ${e} to ${m.bold(t)}`)),n=r()?void 0:process.env.ANTHROPIC_API_KEY,i=!!(n&&_.current.customApiKeyResponses?.approved?.includes($e(n))),a=!!(n&&h.customApiKeyResponses?.approved?.includes($e(n)));if(i!==a&&(e.push(`${a?`Enabled`:`Disabled`} custom API key`),P(`tengu_config_changed`,{key:`env.ANTHROPIC_API_KEY`,value:a})),h.theme!==_.current.theme&&e.push(`Set theme to ${m.bold(h.theme)}`),h.preferredNotifChannel!==_.current.preferredNotifChannel&&e.push(`Set notifications to ${m.bold(h.preferredNotifChannel)}`),b!==Se.current&&e.push(`Set output style to ${m.bold(b)}`),x!==De.current&&e.push(`Set response language to ${m.bold(x??`Default (English)`)}`),h.editorMode!==_.current.editorMode&&e.push(`Set editor mode to ${m.bold(h.editorMode||`emacs`)}`),h.diffTool!==_.current.diffTool&&e.push(`Set diff tool to ${m.bold(h.diffTool)}`),h.autoConnectIde!==_.current.autoConnectIde&&e.push(`${h.autoConnectIde?`Enabled`:`Disabled`} auto-connect to IDE`),h.autoInstallIdeExtension!==_.current.autoInstallIdeExtension&&e.push(`${h.autoInstallIdeExtension?`Enabled`:`Disabled`} auto-install IDE extension`),h.autoCompactEnabled!==_.current.autoCompactEnabled&&e.push(`${h.autoCompactEnabled?`Enabled`:`Disabled`} auto-compact`),h.respectGitignore!==_.current.respectGitignore&&e.push(`${h.respectGitignore?`Enabled`:`Disabled`} respect .gitignore in file picker`),h.copyOnSelect!==_.current.copyOnSelect&&e.push(`${h.copyOnSelect?`Enabled`:`Disabled`} copy on select`),h.terminalProgressBarEnabled!==_.current.terminalProgressBarEnabled&&e.push(`${h.terminalProgressBarEnabled?`Enabled`:`Disabled`} terminal progress bar`),h.showStatusInTerminalTab!==_.current.showStatusInTerminalTab&&e.push(`${h.showStatusInTerminalTab?`Enabled`:`Disabled`} terminal tab status`),h.showTurnDuration!==_.current.showTurnDuration&&e.push(`${h.showTurnDuration?`Enabled`:`Disabled`} turn duration`),h.remoteControlAtStartup!==_.current.remoteControlAtStartup){let t=h.remoteControlAtStartup===void 0?`Reset Remote Control to default`:`${h.remoteControlAtStartup?`Enabled`:`Disabled`} Remote Control for all sessions`;e.push(t)}v?.autoUpdatesChannel!==ve.current?.autoUpdatesChannel&&e.push(`Set auto-update channel to ${m.bold(v?.autoUpdatesChannel??`latest`)}`),e.length>0?t(e.join(`
2
+ `)):t(`Config dialog dismissed`,{display:`system`})},[z,st,h,A,b,x,v?.autoUpdatesChannel,it()?v?.fastMode:void 0,t]),Ft=(0,X.useCallback)(()=>{de!==pt.current&&p(pt.current),M(()=>_.current);let e=dt;j(`localSettings`,{spinnerTipsEnabled:e?.spinnerTipsEnabled,prefersReducedMotion:e?.prefersReducedMotion,defaultView:e?.defaultView,outputStyle:e?.outputStyle});let t=ft;j(`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=ht;F(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)})),pe()!==gt&&me(gt)},[de,p,dt,ft,ht,gt,F]);re(`confirm:no`,(0,X.useCallback)(()=>{z===null&&(L.current&&Ft(),t(`Config dialog dismissed`,{display:`system`}))},[z,Ft,t]),{context:`Settings`,isActive:z===null&&!E&&!f}),re(`settings:close`,Pt,{context:`Settings`,isActive:z===null&&!E&&!f});let G=(0,X.useCallback)(()=>{let e=W[S];if(!(!e||!e.onChange)){if(e.type===`boolean`){L.current=!0,e.onChange(!e.value),e.id===`thinkingEnabled`&&(!e.value===ut.current?R(!1):n.messages.some(e=>e.type===`assistant`)&&R(!0));return}if(e.id===`theme`||e.id===`model`||e.id===`showExternalIncludesDialog`||e.id===`outputStyle`||e.id===`language`)switch(e.id){case`theme`:B(`Theme`),a(!0);return;case`model`:B(`Model`),a(!0);return;case`showExternalIncludesDialog`:B(`ExternalIncludes`),a(!0);return;case`outputStyle`:B(`OutputStyle`),a(!0);return;case`language`:B(`Language`),a(!0);return}if(e.id===`autoUpdatesChannel`){if(U){B(`EnableAutoUpdates`),a(!0);return}(v?.autoUpdatesChannel??`latest`)===`latest`?(B(`ChannelDowngrade`),a(!0)):(L.current=!0,j(`userSettings`,{autoUpdatesChannel:`latest`,minimumVersion:void 0}),y(e=>({...e,autoUpdatesChannel:`latest`,minimumVersion:void 0})),P(`tengu_autoupdate_channel_changed`,{channel:`latest`}));return}if(e.type===`enum`){L.current=!0;let t=(e.options.indexOf(e.value)+1)%e.options.length;e.onChange(e.options[t]);return}}},[U,W,S,v?.autoUpdatesChannel,a]),K=e=>{R(!1);let t=Math.max(0,Math.min(W.length-1,S+e));Oe(t),Nt(t)};return ee({"select:previous":()=>{S===0?(R(!1),O(!0),T(0)):K(-1)},"select:next":()=>K(1),"scroll:lineUp":()=>K(-1),"scroll:lineDown":()=>K(1),"select:accept":G,"select:previousValue":()=>G(),"select:nextValue":()=>G(),"settings:search":()=>{O(!0),H(``)}},{context:`Settings`,isActive:z===null&&!E&&!f}),(0,Z.jsx)(l,{flexDirection:`column`,width:`100%`,tabIndex:0,autoFocus:!0,onKeyDown:(0,X.useCallback)(e=>{if(z===null&&!f){if(E){if(e.key===`escape`){e.preventDefault(),V.length>0?H(``):O(!1);return}(e.key===`return`||e.key===`down`||e.key===`wheeldown`)&&(e.preventDefault(),O(!1),Oe(0),T(0));return}if(e.key===`left`||e.key===`right`||e.key===`tab`){e.preventDefault(),G();return}e.ctrl||e.meta||e.key===`j`||e.key===`k`||e.key===`/`||e.key.length===1&&e.key!==` `&&(e.preventDefault(),O(!0),H(e.key))}},[z,f,E,V,H,G]),children:z===`Theme`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(xt,{onThemeSelect:e=>{L.current=!0,p(e),B(null),a(!1)},onCancel:()=>{B(null),a(!1)},hideEscToCancel:!0,skipExitHandling:!0}),(0,Z.jsx)(l,{children:(0,Z.jsx)(u,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(d,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`select`}),(0,Z.jsx)(C,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})})]}):z===`Model`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(wt,{initial:A,onSelect:e=>{L.current=!0,At(e),B(null),a(!1)},onCancel:()=>{B(null),a(!1)},showFastModeNotice:it()?Je&&nt(A)&&at():!1}),(0,Z.jsx)(u,{dimColor:!0,children:(0,Z.jsxs)(d,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(C,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]}):z===`ExternalIncludes`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Dt,{onDone:()=>{B(null),a(!1)},externalIncludes:he(Et)}),(0,Z.jsx)(u,{dimColor:!0,children:(0,Z.jsxs)(d,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(C,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`disable external includes`})]})})]}):z===`OutputStyle`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Vt,{initialStyle:b,onComplete:e=>{L.current=!0,ye(e??`default`),B(null),a(!1),j(`localSettings`,{outputStyle:e}),P(`tengu_output_style_changed`,{style:e??`default`,source:`config_panel`,settings_source:`localSettings`})},onCancel:()=>{B(null),a(!1)}}),(0,Z.jsx)(u,{dimColor:!0,children:(0,Z.jsxs)(d,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(C,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]}):z===`Language`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Kt,{initialLanguage:x,onComplete:e=>{L.current=!0,Ce(e),B(null),a(!1),j(`userSettings`,{language:e}),P(`tengu_language_changed`,{language:e??`default`,source:`config_panel`})},onCancel:()=>{B(null),a(!1)}}),(0,Z.jsx)(u,{dimColor:!0,children:(0,Z.jsxs)(d,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(C,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]})})]}):z===`EnableAutoUpdates`?(0,Z.jsx)(fe,{title:`Enable Auto-Updates`,onCancel:()=>{B(null),a(!1)},hideBorder:!0,hideInputGuide:!0,children:U?.type===`config`?(0,Z.jsx)(Pe,{options:[{label:`Enable with latest channel`,value:`latest`},{label:`Enable with stable channel`,value:`stable`}],onChange:e=>{L.current=!0,B(null),a(!1),M(e=>({...e,autoUpdates:!0})),g({...N(),autoUpdates:!0}),j(`userSettings`,{autoUpdatesChannel:e,minimumVersion:void 0}),y(t=>({...t,autoUpdatesChannel:e,minimumVersion:void 0})),P(`tengu_autoupdate_enabled`,{channel:e})}}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(u,{children:U?.type===`env`?`Auto-updates are controlled by an environment variable and cannot be changed here.`:`Auto-updates are disabled in development builds.`}),U?.type===`env`&&(0,Z.jsxs)(u,{dimColor:!0,children:[`Unset `,U.envVar,` to re-enable auto-updates.`]})]})}):z===`ChannelDowngrade`?(0,Z.jsx)(Lt,{currentVersion:`0.0.8`,onChoice:e=>{if(B(null),a(!1),e===`cancel`)return;L.current=!0;let t={autoUpdatesChannel:`stable`};e===`stay`&&(t.minimumVersion=`0.0.8`),j(`userSettings`,t),y(e=>({...e,...t})),P(`tengu_autoupdate_channel_changed`,{channel:`stable`,minimum_version_set:e===`stay`})}}):(0,Z.jsxs)(l,{flexDirection:`column`,gap:1,marginY:ue?void 0:1,children:[(0,Z.jsx)(se,{query:V,isFocused:E&&!f,isTerminalFocused:je,cursorOffset:vt,placeholder:`Search settings…`}),(0,Z.jsx)(l,{flexDirection:`column`,children:W.length===0?(0,Z.jsxs)(u,{dimColor:!0,italic:!0,children:[`No settings match "`,V,`"`]}):(0,Z.jsxs)(Z.Fragment,{children:[w>0&&(0,Z.jsxs)(u,{dimColor:!0,children:[s.arrowUp,` `,w,` more above`]}),W.slice(w,w+k).map((e,t)=>{let n=w+t===S&&!f&&!E;return(0,Z.jsx)(Y.Fragment,{children:(0,Z.jsxs)(l,{width:`100%`,children:[(0,Z.jsx)(l,{width:44,children:(0,Z.jsxs)(u,{color:n?`suggestion`:void 0,children:[n?s.pointer:` `,` `,e.label]})}),(0,Z.jsx)(l,{flexGrow:1,children:e.type===`boolean`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(u,{color:n?`suggestion`:void 0,children:e.value.toString()}),_t&&e.id===`thinkingEnabled`&&(0,Z.jsxs)(u,{color:`warning`,children:[` `,`Changing thinking mode mid-conversation will increase latency and may reduce quality.`]})]}):e.id===`theme`?(0,Z.jsx)(u,{color:n?`suggestion`:void 0,children:Zt[e.value.toString()]??e.value.toString()}):e.id===`notifChannel`?(0,Z.jsx)(u,{color:n?`suggestion`:void 0,children:(0,Z.jsx)(Xt,{value:e.value.toString()})}):e.id===`defaultPermissionMode`?(0,Z.jsx)(u,{color:n?`suggestion`:void 0,children:Ie(e.value)}):e.id===`autoUpdatesChannel`&&U?(0,Z.jsxs)(l,{flexDirection:`column`,children:[(0,Z.jsx)(u,{color:n?`suggestion`:void 0,children:`disabled`}),(0,Z.jsxs)(u,{dimColor:!0,children:[`(`,Ke(U),`)`]})]}):(0,Z.jsx)(u,{color:n?`suggestion`:void 0,children:e.value.toString()})})]})},e.id)}),w+k<W.length&&(0,Z.jsxs)(u,{dimColor:!0,children:[s.arrowDown,` `,W.length-w-k,` more below`]})]})}),f?(0,Z.jsx)(u,{dimColor:!0,children:(0,Z.jsxs)(d,{children:[(0,Z.jsx)(c,{shortcut:`←/→ tab`,action:`switch`}),(0,Z.jsx)(c,{shortcut:`↓`,action:`return`}),(0,Z.jsx)(C,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`close`})]})}):E?(0,Z.jsx)(u,{dimColor:!0,children:(0,Z.jsxs)(d,{children:[(0,Z.jsx)(u,{children:`Type to filter`}),(0,Z.jsx)(c,{shortcut:`Enter/↓`,action:`select`}),(0,Z.jsx)(c,{shortcut:`↑`,action:`tabs`}),(0,Z.jsx)(C,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`clear`})]})}):(0,Z.jsx)(u,{dimColor:!0,children:(0,Z.jsxs)(d,{children:[(0,Z.jsx)(C,{action:`select:accept`,context:`Settings`,fallback:`Space`,description:`change`}),(0,Z.jsx)(C,{action:`settings:close`,context:`Settings`,fallback:`Enter`,description:`save`}),(0,Z.jsx)(C,{action:`settings:search`,context:`Settings`,fallback:`/`,description:`search`}),(0,Z.jsx)(C,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]})})]})})}function Xt({value:e}){switch(e){case`auto`:return`Auto`;case`iterm2`:return(0,Z.jsxs)(u,{children:[`iTerm2 `,(0,Z.jsx)(u,{dimColor:!0,children:`(OSC 9)`})]});case`terminal_bell`:return(0,Z.jsxs)(u,{children:[`Terminal Bell `,(0,Z.jsx)(u,{dimColor:!0,children:`(\\a)`})]});case`kitty`:return(0,Z.jsxs)(u,{children:[`Kitty `,(0,Z.jsx)(u,{dimColor:!0,children:`(OSC 99)`})]});case`ghostty`:return(0,Z.jsxs)(u,{children:[`Ghostty `,(0,Z.jsx)(u,{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,Zt,Qt=t((()=>{p(),Y=n(f(),1),X=n(f(),1),b(),o(),Ge(),st(),oe(),Ve(),y(),Je(),Xe(),I(),bt(),x(),St(),et(),Tt(),Et(),zt(),ye(),Gt(),Jt(),Se(),ve(),vt(),Ot(),T(),A(),g(),O(),a(),U(),je(),F(),E(),Z=h(),Zt={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 $t({onClose:e,context:t,defaultTab:n}){let[r,i]=(0,Q.useState)(n),[a,o]=(0,Q.useState)(!1),[s,c]=(0,Q.useState)(!1),ee=yt(),{rows:te}=H(le()),l=ee?te+1:Math.max(15,Math.min(Math.floor(te*.8),30)),[u]=(0,Q.useState)(()=>Mt().catch(()=>[]));return B(),re(`confirm:no`,()=>{a||e(`Status dialog dismissed`,{display:`system`})},{context:`Settings`,isActive:!a&&!(r===`Config`&&s)}),(0,$.jsx)(de,{color:`permission`,children:(0,$.jsx)(ue,{color:`permission`,selectedTab:r,onTabChange:i,hidden:a,initialHeaderFocused:n!==`Config`,contentHeight:a||ee?void 0:l,children:[(0,$.jsx)(ce,{title:`Status`,children:(0,$.jsx)(Nt,{context:t,diagnosticsPromise:u})},`status`),(0,$.jsx)(ce,{title:`Config`,children:(0,$.jsx)(Q.Suspense,{fallback:null,children:(0,$.jsx)(Yt,{context:t,onClose:e,setTabsHidden:o,onIsSearchModeChange:c,contentHeight:l})})},`config`)]})})}var Q,$,en=t((()=>{f(),Q=n(f(),1),b(),V(),je(),vt(),p(),It(),Qt(),$=h()}));export{en as n,$t as t};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./figures-5ThXQEtq.js";import{I as r,P as i,fi as a,mt as o,t as s}from"./src-CDCSSo0U2.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{Dy as l,Ey as u,HS as d,US as f,jy as p,ky as m}from"./loadAgentsDir-D206qwP3.js";t();var h=e(a(),1);s(),f(),l();var g=c(),_=[`◐`,`◓`,`◑`,`◒`],v=[{key:`validating`,label:`Validating session`},{key:`fetching_logs`,label:`Fetching session logs`},{key:`fetching_branch`,label:`Getting branch info`},{key:`checking_out`,label:`Checking out branch`}];function y({currentStep:e,sessionId:t}){let[a,s]=o(100),c=Math.floor(s/100)%_.length,l=v.findIndex(t=>t.key===e);return(0,g.jsxs)(r,{ref:a,flexDirection:`column`,paddingX:1,paddingY:1,children:[(0,g.jsx)(r,{marginBottom:1,children:(0,g.jsxs)(i,{bold:!0,color:`claude`,children:[_[c],` Teleporting session…`]})}),t&&(0,g.jsx)(r,{marginBottom:1,children:(0,g.jsx)(i,{dimColor:!0,children:t})}),(0,g.jsx)(r,{flexDirection:`column`,marginLeft:2,children:v.map((e,t)=>{let a=t<l,o=t===l,s=t>l,u,d;return a?(u=n.tick,d=`green`):o?(u=_[c],d=`claude`):(u=n.circle,d=void 0),(0,g.jsxs)(r,{flexDirection:`row`,children:[(0,g.jsx)(r,{width:2,children:(0,g.jsx)(i,{color:d,dimColor:s,children:u})}),(0,g.jsx)(i,{dimColor:s,bold:o,children:e.label})]},e.key)})})]})}async function b(e,t){let n=()=>{};function r(){let[e,r]=(0,h.useState)(`validating`);return n=r,(0,g.jsx)(y,{currentStep:e,sessionId:t})}e.render((0,g.jsx)(d,{children:(0,g.jsx)(r,{})}));let i=await p(t,n);n(`checking_out`);let{branchName:a,branchError:o}=await u(i.branch);return{messages:m(i.log,o),branchName:a}}export{b as teleportWithProgress};
1
+ import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./figures-5ThXQEtq.js";import{I as r,P as i,fi as a,mt as o,t as s}from"./src-CDCSSo0U2.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{Bf as l,Gf as u,Uf as d,Vf as f,_v as p,gv as m}from"./loadAgentsDir-ByO8eJqU.js";t();var h=e(a(),1);s(),p(),f();var g=c(),_=[`◐`,`◓`,`◑`,`◒`],v=[{key:`validating`,label:`Validating session`},{key:`fetching_logs`,label:`Fetching session logs`},{key:`fetching_branch`,label:`Getting branch info`},{key:`checking_out`,label:`Checking out branch`}];function y({currentStep:e,sessionId:t}){let[a,s]=o(100),c=Math.floor(s/100)%_.length,l=v.findIndex(t=>t.key===e);return(0,g.jsxs)(r,{ref:a,flexDirection:`column`,paddingX:1,paddingY:1,children:[(0,g.jsx)(r,{marginBottom:1,children:(0,g.jsxs)(i,{bold:!0,color:`claude`,children:[_[c],` Teleporting session…`]})}),t&&(0,g.jsx)(r,{marginBottom:1,children:(0,g.jsx)(i,{dimColor:!0,children:t})}),(0,g.jsx)(r,{flexDirection:`column`,marginLeft:2,children:v.map((e,t)=>{let a=t<l,o=t===l,s=t>l,u,d;return a?(u=n.tick,d=`green`):o?(u=_[c],d=`claude`):(u=n.circle,d=void 0),(0,g.jsxs)(r,{flexDirection:`row`,children:[(0,g.jsx)(r,{width:2,children:(0,g.jsx)(i,{color:d,dimColor:s,children:u})}),(0,g.jsx)(i,{dimColor:s,bold:o,children:e.label})]},e.key)})})]})}async function b(e,t){let n=()=>{};function r(){let[e,r]=(0,h.useState)(`validating`);return n=r,(0,g.jsx)(y,{currentStep:e,sessionId:t})}e.render((0,g.jsx)(m,{children:(0,g.jsx)(r,{})}));let i=await u(t,n);n(`checking_out`);let{branchName:a,branchError:o}=await l(i.branch);return{messages:d(i.log,o),branchName:a}}export{b as teleportWithProgress};
@@ -0,0 +1 @@
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{Rp as s,dp as c,pp as l,zp as u}from"./loadAgentsDir-ByO8eJqU.js";import{Cn as d,bn as f}from"./settings-hQDLwPVj.js";import{a as p,r as m}from"./githubRepoPathMapping-DGr0kJ8D.js";var h=e(r(),1);i(),d(),s(),l();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)(c,{}),(0,g.jsx)(n,{children:` Validating repository…`})]}):(0,g.jsx)(u,{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};
@@ -0,0 +1 @@
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{$t as d,dr as f}from"./state-C2OSZkV1.js";import{Fw as p,Gf as m,Iw as h,Jp as g,Pw as _,Rp as v,Vf as y,cp as b,dp as x,lp as S,pp as C,qp as w,xw as T,zp as E}from"./loadAgentsDir-ByO8eJqU.js";import{F as D,N as O,a as k,l as A,z as j}from"./debug-RZ4NuXyS.js";import{n as M,r as N}from"./analytics-CkYUHW_U.js";import{m as P,y as F}from"./startupProfiler-DCn_NxMH.js";import{i as I,n as L}from"./detectRepository-CFiHe6Rv.js";import{n as R,o as z}from"./api-CF5IVtj0.js";var B=e(o(),1);d(),M(),j(),y();function V(e){let[t,n]=(0,B.useState)(!1),[r,i]=(0,B.useState)(null),[a,o]=(0,B.useState)(null);return{resumeSession:(0,B.useCallback)(async t=>{n(!0),i(null),o(t),N(`tengu_teleport_resume_session`,{source:e,session_id:t.id});try{let e=await m(t.id);return f({sessionId:t.id}),n(!1),e}catch(e){let t={message:e instanceof O?e.message:D(e),formattedMessage:e instanceof O?e.formattedMessage:void 0,isOperationError:e instanceof O};return i(t),n(!1),null}},[e]),isResuming:t,error:r,selectedSession:a,clearError:(0,B.useCallback)(()=>{i(null)},[])}}T(),z(),l(),_(),p(),k(),I(),F(),g(),v(),C(),S();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),[g,_]=(0,B.useState)(!0),[v,y]=(0,B.useState)(null),[S,C]=(0,B.useState)(!1),[T,D]=(0,B.useState)(!1),[O,k]=(0,B.useState)(1),j=h(`confirm:no`,`Confirmation`,`Esc`),M=(0,B.useCallback)(async()=>{try{_(!0),y(null);let e=await L();m(e),A(`Current repository: ${e||`not detected`}`);let t=await R(),n=t;e&&(n=t.filter(t=>t.repo?`${t.repo.owner.login}/${t.repo.name}`===e:!1),A(`Filtered ${n.length} sessions for repo ${e} from ${t.length} total`));let r=[...n].sort((e,t)=>{let n=new Date(e.updated_at);return new Date(t.updated_at).getTime()-n.getTime()});f(r)}catch(e){let t=e instanceof Error?e.message:String(e);A(`Error loading code sessions: ${t}`),y(K(t))}finally{_(!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`&&v){N();return}if(v!==null&&t.return){o();return}});let F=(0,B.useCallback)(()=>{D(!0),M()},[D,M]);if(!T)return(0,H.jsx)(b,{onComplete:F});if(g)return(0,H.jsxs)(n,{flexDirection:`column`,padding:1,children:[(0,H.jsxs)(n,{flexDirection:`row`,children:[(0,H.jsx)(x,{}),(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(v)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(v),(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 I=d.map(e=>({...e,timeString:P(new Date(e.updated_at))})),z=Math.max(7,...I.map(e=>e.timeString.length)),V=I.map(({timeString:e,title:t,id:n})=>({label:`${e.padEnd(z,` `)} ${t}`,value:n})),G=Math.max(1,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)(E,{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&&k(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)(w,{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`})})}}M(),l(),_(),C();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)(()=>{N(`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=()=>{N(`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)(x,{}),(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};
@@ -0,0 +1 @@
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{Fw as m,Iw as h,Jm as g,Km as _,Lw as v,Pw as y,Rp as b,_v as x,av as S,bv as C,ev as w,iv as T,ov as E,tv as D,vv as O,xw as k,zp as A}from"./loadAgentsDir-ByO8eJqU.js";import{g as j,x as M}from"./settings-hQDLwPVj.js";import{n as N,t as P}from"./useExitOnCtrlCDWithKeybindings-Cce612uS.js";function F({onThemeSelect:e,showIntroText:u=!1,helpText:f=``,showHelpTextBelow:p=!1,hideEscToCancel:m=!1,skipExitHandling:g=!1,onCancel:v}){let[y]=n(),b=o(),{columns:x}=d(),E=T(),D=E===null?S(y):null,{setPreviewTheme:k,savePreview:j,cancelPreview:P}=s(),F=O(e=>e.settings.syntaxHighlightingDisabled)??!1,L=C();l(`ThemePicker`);let R=h(`theme:toggleSyntaxHighlighting`,`ThemePicker`,`ctrl+t`);c(`theme:toggleSyntaxHighlighting`,()=>{if(E===null){let e=!F;M(`userSettings`,{syntaxHighlightingDisabled:e}),L(t=>({...t,settings:{...t.settings,syntaxHighlightingDisabled:e}}))}},{context:`ThemePicker`});let z=N(g?()=>{}: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)(A,{options:B,onFocus:e=>{k(e)},onChange:t=>{j(),e(t)},onCancel:g?()=>{P(),v?.()}:async()=>{P(),await _(0)},visibleOptionCount:B.length,defaultValue:b,defaultFocusValue:b})]}),(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)(w,{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:x})}),(0,I.jsxs)(i,{dimColor:!0,children:[` `,E===`env`?`Syntax highlighting disabled (via CLAUDE_CODE_SYNTAX_HIGHLIGHT=${process.env.CLAUDE_CODE_SYNTAX_HIGHLIGHT})`:F?`Syntax highlighting disabled (${R} to enable)`:D?`Syntax theme: ${D.theme}${D.source?` (from ${D.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(),k(),f(),v(),y(),m(),x(),g(),j(),b(),E(),D(),I=p()}));export{L as n,F as t};
@@ -0,0 +1 @@
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{$t as s,cr as c}from"./state-C2OSZkV1.js";import{BC as l,Cv as u,Jm as d,Pw as f,RC as p,Rp as m,qm as h,wv as g,zp as _}from"./loadAgentsDir-ByO8eJqU.js";import{n as v,t as y}from"./cwd-C5ce-7WB.js";import{d as b,p as x}from"./debug-RZ4NuXyS.js";import{c as S,g as C}from"./settings-hQDLwPVj.js";import{g as w,n as T,y as E}from"./config-CE058cvr.js";import{n as D,r as O}from"./analytics-CkYUHW_U.js";import{gn as k}from"./prompt-B7joRiqj.js";import{n as A,t as j}from"./managedEnvConstants-BPwL2aWI.js";import{n as M,t as N}from"./useExitOnCtrlCDWithKeybindings-Cce612uS.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(),v(),x(),D(),w(),f(),l(),d(),m(),N(),P(),C(),k(),A(),g();function z(e){if(e===null||e.disableAllHooks)return!1;if(e.statusLine||e.fileSuggestion)return!0;if(!e.hooks)return!1;for(let t of Object.values(e.hooks))if(t.length>0)return!0;return!1}function B(){let e=[];return z(S(`projectSettings`))&&e.push(`.claude/settings.json`),z(S(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function V(e){return e.some(e=>e.ruleBehavior===`allow`&&(e.ruleValue.toolName===`Bash`||e.ruleValue.toolName.startsWith(`Bash(`)))}function H(){let e=[];return V(u(`projectSettings`))&&e.push(`.claude/settings.json`),V(u(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function U(e){return!!e?.otelHeadersHelper}function W(){let e=[];return U(S(`projectSettings`))&&e.push(`.claude/settings.json`),U(S(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function G(e){return!!e?.apiKeyHelper}function K(){let e=[];return G(S(`projectSettings`))&&e.push(`.claude/settings.json`),G(S(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function q(e){return!!(e?.awsAuthRefresh||e?.awsCredentialExport)}function J(){let e=[];return q(S(`projectSettings`))&&e.push(`.claude/settings.json`),q(S(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function Y(e){return!!e?.gcpAuthRefresh}function X(){let e=[];return Y(S(`projectSettings`))&&e.push(`.claude/settings.json`),Y(S(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function Z(e){return e?.env?Object.keys(e.env).some(e=>!j.has(e.toUpperCase())):!1}function Q(){let e=[];return Z(S(`projectSettings`))&&e.push(`.claude/settings.json`),Z(S(`localSettings`))&&e.push(`.claude/settings.local.json`),e}k();function $({onDone:e,commands:i}){let{servers:a}=p(`project`),o=Object.keys(a).length>0,s=B().length>0,l=H(),u=K().length>0,d=J().length>0,f=X().length>0,m=W().length>0,g=Q().length>0,v=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||v||x,C=T(),[w,D]=L.useState(null);L.useEffect(()=>{if(w!==null){let e=w,t=setTimeout(()=>h(e));return()=>clearTimeout(t)}},[w]),L.useEffect(()=>{O(`tengu_trust_dialog_shown`,{isHomeDir:I()===y(),hasMcpServers:o,hasHooks:s,hasBashExecution:S,hasApiKeyHelper:u,hasAwsCommands:d,hasGcpCommands:f,hasOtelHeadersHelper:m,hasDangerousEnvVars:g})},[o,s,S,u,d,f,m,g]);function k(t){if(t===`exit`){D(1);return}let n=I()===y();O(`tengu_trust_dialog_accept`,{isHomeDir:n,hasMcpServers:o,hasHooks:s,hasBashExecution:S,hasApiKeyHelper:u,hasAwsCommands:d,hasGcpCommands:f,hasOtelHeadersHelper:m,hasDangerousEnvVars:g}),n?c(!0):E(e=>({...e,hasTrustDialogAccepted:!0})),e()}let A=M(()=>D(1));return r(`confirm:no`,()=>{D(0)},{context:`Confirmation`}),w===null?C?(setTimeout(e),null):(0,R.jsx)(F,{color:`warning`,titleColor:`warning`,title:`Accessing workspace:`,children:(0,R.jsxs)(t,{flexDirection:`column`,gap:1,paddingTop:1,children:[(0,R.jsx)(n,{bold:!0,children:b().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)(_,{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,2 +1,2 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./figures-5ThXQEtq.js";import{H as r,I as i,P as a,fi as o,j as s,t as c}from"./src-CDCSSo0U2.js";import{t as l}from"./jsx-runtime-Bb4Xn-E0.js";import{O as u,k as d}from"./config-DmomySWC.js";function f(e,t,n,r){return r=typeof r==`function`?r:void 0,e==null?e:u(e,t,n,r)}var p=e((()=>{d()}));function m(e,t={}){let{showValues:n=!0,hideFunctions:r=!1,themeName:i=`dark`,treeCharColors:a={}}=t,o=[],c=new WeakSet;function l(e,t){return t?s(t,i)(e):e}function u(e,t,i,s=0){if(typeof e==`string`){o.push(t+l(e,a.value));return}if(typeof e!=`object`||!e){if(n){let n=String(e);o.push(t+l(n,a.value))}return}if(c.has(e)){o.push(t+l(`[Circular]`,a.value));return}c.add(e);let d=Object.keys(e).filter(t=>{let n=e[t];return!(r&&typeof n==`function`)});d.forEach((r,i)=>{let f=e[r],p=i===d.length-1,m=s===0&&i===0?``:t,g=l(p?h.lastBranch:h.branch,a.treeChar),_=r.trim()===``?``:l(r,a.key),v=m+g+(_?` `+_:``),y=r.trim()!==``;if(f&&typeof f==`object`&&c.has(f)){let e=l(`[Circular]`,a.value);o.push(v+(y?`: `:v?` `:``)+e)}else if(f&&typeof f==`object`&&!Array.isArray(f))o.push(v),u(f,m+l(p?h.empty:h.line,a.treeChar)+` `,p,s+1);else if(Array.isArray(f))o.push(v+(y?`: `:v?` `:``)+`[Array(`+f.length+`)]`);else if(n){let e=l(typeof f==`function`?`[Function]`:String(f),a.value);v+=(y?`: `:v?` `:``)+e,o.push(v)}else o.push(v)})}let d=Object.keys(e);if(d.length===0)return l(`(empty)`,a.value);if(d.length===1&&d[0]!==void 0&&d[0].trim()===``&&typeof e[d[0]]==`string`){let t=d[0],n=l(h.lastBranch,a.treeChar),r=l(e[t],a.value);return n+` `+r}return u(e,``,!0),o.join(`
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./figures-5ThXQEtq.js";import{H as r,I as i,P as a,fi as o,j as s,t as c}from"./src-CDCSSo0U2.js";import{t as l}from"./jsx-runtime-Bb4Xn-E0.js";import{O as u,k as d}from"./config-CE058cvr.js";function f(e,t,n,r){return r=typeof r==`function`?r:void 0,e==null?e:u(e,t,n,r)}var p=e((()=>{d()}));function m(e,t={}){let{showValues:n=!0,hideFunctions:r=!1,themeName:i=`dark`,treeCharColors:a={}}=t,o=[],c=new WeakSet;function l(e,t){return t?s(t,i)(e):e}function u(e,t,i,s=0){if(typeof e==`string`){o.push(t+l(e,a.value));return}if(typeof e!=`object`||!e){if(n){let n=String(e);o.push(t+l(n,a.value))}return}if(c.has(e)){o.push(t+l(`[Circular]`,a.value));return}c.add(e);let d=Object.keys(e).filter(t=>{let n=e[t];return!(r&&typeof n==`function`)});d.forEach((r,i)=>{let f=e[r],p=i===d.length-1,m=s===0&&i===0?``:t,g=l(p?h.lastBranch:h.branch,a.treeChar),_=r.trim()===``?``:l(r,a.key),v=m+g+(_?` `+_:``),y=r.trim()!==``;if(f&&typeof f==`object`&&c.has(f)){let e=l(`[Circular]`,a.value);o.push(v+(y?`: `:v?` `:``)+e)}else if(f&&typeof f==`object`&&!Array.isArray(f))o.push(v),u(f,m+l(p?h.empty:h.line,a.treeChar)+` `,p,s+1);else if(Array.isArray(f))o.push(v+(y?`: `:v?` `:``)+`[Array(`+f.length+`)]`);else if(n){let e=l(typeof f==`function`?`[Function]`:String(f),a.value);v+=(y?`: `:v?` `:``)+e,o.push(v)}else o.push(v)})}let d=Object.keys(e);if(d.length===0)return l(`(empty)`,a.value);if(d.length===1&&d[0]!==void 0&&d[0].trim()===``&&typeof e[d[0]]==`string`){let t=d[0],n=l(h.lastBranch,a.treeChar),r=l(e[t],a.value);return n+` `+r}return u(e,``,!0),o.join(`
2
2
  `)}var h,g=e((()=>{t(),c(),h={branch:n.lineUpDownRight,lastBranch:n.lineUpRight,line:n.lineVertical,empty:` `}}));function _(e){let t={};return e.forEach(e=>{if(!e.path){t[``]=e.message;return}let n=e.path.split(`.`),r=e.path;if(e.invalidValue!==null&&e.invalidValue!==void 0&&n.length>0){let t=[];for(let r=0;r<n.length;r++){let i=n[r];if(i)if(!isNaN(parseInt(i,10))&&r===n.length-1){let n;n=typeof e.invalidValue==`string`?`"${e.invalidValue}"`:e.invalidValue===null?`null`:e.invalidValue===void 0?`undefined`:String(e.invalidValue),t.push(n)}else t.push(i)}r=t.join(`.`)}f(t,r,e.message,Object)}),t}function v({errors:e}){let[t]=r();if(e.length===0)return null;let n=e.reduce((e,t)=>{let n=t.file||`(file not specified)`;return e[n]||(e[n]=[]),e[n].push(t),e},{});return(0,y.jsx)(i,{flexDirection:`column`,children:Object.keys(n).sort().map(e=>{let r=n[e]||[];r.sort((e,t)=>!e.path&&t.path?-1:e.path&&!t.path?1:(e.path||``).localeCompare(t.path||``));let o=_(r),s=new Map;r.forEach(e=>{if(e.suggestion||e.docLink){let t=`${e.suggestion||``}|${e.docLink||``}`;s.has(t)||s.set(t,{suggestion:e.suggestion,docLink:e.docLink})}});let c=m(o,{showValues:!0,themeName:t,treeCharColors:{treeChar:`inactive`,key:`text`,value:`inactive`}});return(0,y.jsxs)(i,{flexDirection:`column`,children:[(0,y.jsx)(a,{children:e}),(0,y.jsx)(i,{marginLeft:1,children:(0,y.jsx)(a,{dimColor:!0,children:c})}),s.size>0&&(0,y.jsx)(i,{flexDirection:`column`,marginTop:1,children:Array.from(s.values()).map((e,t)=>(0,y.jsxs)(i,{flexDirection:`column`,marginBottom:1,children:[e.suggestion&&(0,y.jsx)(a,{dimColor:!0,wrap:`wrap`,children:e.suggestion}),e.docLink&&(0,y.jsxs)(a,{dimColor:!0,wrap:`wrap`,children:[`Learn more: `,e.docLink]})]},`suggestion-pair-${t}`))})]},e)})})}var y,b=e((()=>{p(),o(),c(),g(),y=l()}));export{b as n,v as t};
@@ -1 +1 @@
1
- import"./rolldown-runtime-DaDcL9Zw.js";import{H as e,I as t,P as n,fi as r,t as i}from"./src-CDCSSo0U2.js";import{t as a}from"./jsx-runtime-Bb4Xn-E0.js";import{Jt as o,Zt as s}from"./settings-BovzmwMP.js";r(),i(),s();var c=a(),l=58;function u(){let[r]=e(),i=`Welcome to Work Mate`;return o.terminal===`Apple_Terminal`?(0,c.jsx)(d,{theme:r,welcomeMessage:i}):[`light`,`light-daltonized`,`light-ansi`].includes(r)?(0,c.jsxs)(t,{width:l,flexDirection:`column`,children:[(0,c.jsxs)(n,{children:[(0,c.jsxs)(n,{color:`claudeBlue_FOR_SYSTEM_SPINNER`,children:[i,` `]}),(0,c.jsxs)(n,{dimColor:!0,children:[`v`,`0.0.6`,` `]})]}),(0,c.jsx)(n,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,c.jsx)(n,{children:` ░░░░░░ `}),(0,c.jsx)(n,{children:` ░░░ ░░░░░░░░░░ `}),(0,c.jsx)(n,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,c.jsx)(n,{children:` `})]}):(0,c.jsxs)(t,{width:l,flexDirection:`column`,children:[(0,c.jsxs)(n,{children:[(0,c.jsxs)(n,{color:`claudeBlue_FOR_SYSTEM_SPINNER`,children:[i,` `]}),(0,c.jsxs)(n,{dimColor:!0,children:[`v`,`0.0.6`,` `]})]}),(0,c.jsx)(n,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,c.jsx)(n,{children:` * █████▓▓░ `}),(0,c.jsx)(n,{children:` * ███▓░ ░░ `}),(0,c.jsx)(n,{children:` ░░░░░░ ███▓░ `}),(0,c.jsx)(n,{children:` ░░░ ░░░░░░░░░░ ███▓░ `}),(0,c.jsxs)(n,{children:[(0,c.jsx)(n,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,c.jsx)(n,{bold:!0,children:`*`}),(0,c.jsx)(n,{children:` ██▓░░ ▓ `})]}),(0,c.jsx)(n,{children:` ░▓▓███▓▓░ `}),(0,c.jsx)(n,{dimColor:!0,children:` * ░░░░ `}),(0,c.jsx)(n,{dimColor:!0,children:` ░░░░░░░░ `}),(0,c.jsx)(n,{dimColor:!0,children:` * ░░░░░░░░░░░░░░░░ `}),(0,c.jsx)(n,{dimColor:!0,children:` * `})]})}function d({theme:e,welcomeMessage:r}){return[`light`,`light-daltonized`,`light-ansi`].includes(e)?(0,c.jsxs)(t,{width:l,flexDirection:`column`,children:[(0,c.jsxs)(n,{children:[(0,c.jsxs)(n,{color:`claudeBlue_FOR_SYSTEM_SPINNER`,children:[r,` `]}),(0,c.jsxs)(n,{dimColor:!0,children:[`v`,`0.0.6`,` `]})]}),(0,c.jsx)(n,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,c.jsx)(n,{children:` ░░░░░░ `}),(0,c.jsx)(n,{children:` ░░░ ░░░░░░░░░░ `}),(0,c.jsx)(n,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,c.jsx)(n,{children:` `})]}):(0,c.jsxs)(t,{width:l,flexDirection:`column`,children:[(0,c.jsxs)(n,{children:[(0,c.jsxs)(n,{color:`claudeBlue_FOR_SYSTEM_SPINNER`,children:[r,` `]}),(0,c.jsxs)(n,{dimColor:!0,children:[`v`,`0.0.6`,` `]})]}),(0,c.jsx)(n,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,c.jsx)(n,{children:` * █████▓▓░ `}),(0,c.jsx)(n,{children:` * ███▓░ ░░ `}),(0,c.jsx)(n,{children:` ░░░░░░ ███▓░ `}),(0,c.jsx)(n,{children:` ░░░ ░░░░░░░░░░ ███▓░ `}),(0,c.jsxs)(n,{children:[(0,c.jsx)(n,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,c.jsx)(n,{bold:!0,children:`*`}),(0,c.jsx)(n,{children:` ██▓░░ ▓ `})]}),(0,c.jsx)(n,{children:` ░▓▓███▓▓░ `}),(0,c.jsx)(n,{dimColor:!0,children:` * ░░░░ `}),(0,c.jsx)(n,{dimColor:!0,children:` ░░░░░░░░ `}),(0,c.jsx)(n,{dimColor:!0,children:` ░░░░░░░░░░░░░░░░ `})]})}export{u as t};
1
+ import"./rolldown-runtime-DaDcL9Zw.js";import{H as e,I as t,P as n,fi as r,t as i}from"./src-CDCSSo0U2.js";import{t as a}from"./jsx-runtime-Bb4Xn-E0.js";import{Gt as o,Jt as s}from"./settings-hQDLwPVj.js";r(),i(),s();var c=a(),l=58;function u(){let[r]=e(),i=`Welcome to Work Mate`;return o.terminal===`Apple_Terminal`?(0,c.jsx)(d,{theme:r,welcomeMessage:i}):[`light`,`light-daltonized`,`light-ansi`].includes(r)?(0,c.jsxs)(t,{width:l,flexDirection:`column`,children:[(0,c.jsxs)(n,{children:[(0,c.jsxs)(n,{color:`claudeBlue_FOR_SYSTEM_SPINNER`,children:[i,` `]}),(0,c.jsxs)(n,{dimColor:!0,children:[`v`,`0.0.8`,` `]})]}),(0,c.jsx)(n,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,c.jsx)(n,{children:` ░░░░░░ `}),(0,c.jsx)(n,{children:` ░░░ ░░░░░░░░░░ `}),(0,c.jsx)(n,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,c.jsx)(n,{children:` `})]}):(0,c.jsxs)(t,{width:l,flexDirection:`column`,children:[(0,c.jsxs)(n,{children:[(0,c.jsxs)(n,{color:`claudeBlue_FOR_SYSTEM_SPINNER`,children:[i,` `]}),(0,c.jsxs)(n,{dimColor:!0,children:[`v`,`0.0.8`,` `]})]}),(0,c.jsx)(n,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,c.jsx)(n,{children:` * █████▓▓░ `}),(0,c.jsx)(n,{children:` * ███▓░ ░░ `}),(0,c.jsx)(n,{children:` ░░░░░░ ███▓░ `}),(0,c.jsx)(n,{children:` ░░░ ░░░░░░░░░░ ███▓░ `}),(0,c.jsxs)(n,{children:[(0,c.jsx)(n,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,c.jsx)(n,{bold:!0,children:`*`}),(0,c.jsx)(n,{children:` ██▓░░ ▓ `})]}),(0,c.jsx)(n,{children:` ░▓▓███▓▓░ `}),(0,c.jsx)(n,{dimColor:!0,children:` * ░░░░ `}),(0,c.jsx)(n,{dimColor:!0,children:` ░░░░░░░░ `}),(0,c.jsx)(n,{dimColor:!0,children:` * ░░░░░░░░░░░░░░░░ `}),(0,c.jsx)(n,{dimColor:!0,children:` * `})]})}function d({theme:e,welcomeMessage:r}){return[`light`,`light-daltonized`,`light-ansi`].includes(e)?(0,c.jsxs)(t,{width:l,flexDirection:`column`,children:[(0,c.jsxs)(n,{children:[(0,c.jsxs)(n,{color:`claudeBlue_FOR_SYSTEM_SPINNER`,children:[r,` `]}),(0,c.jsxs)(n,{dimColor:!0,children:[`v`,`0.0.8`,` `]})]}),(0,c.jsx)(n,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,c.jsx)(n,{children:` ░░░░░░ `}),(0,c.jsx)(n,{children:` ░░░ ░░░░░░░░░░ `}),(0,c.jsx)(n,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,c.jsx)(n,{children:` `})]}):(0,c.jsxs)(t,{width:l,flexDirection:`column`,children:[(0,c.jsxs)(n,{children:[(0,c.jsxs)(n,{color:`claudeBlue_FOR_SYSTEM_SPINNER`,children:[r,` `]}),(0,c.jsxs)(n,{dimColor:!0,children:[`v`,`0.0.8`,` `]})]}),(0,c.jsx)(n,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,c.jsx)(n,{children:` * █████▓▓░ `}),(0,c.jsx)(n,{children:` * ███▓░ ░░ `}),(0,c.jsx)(n,{children:` ░░░░░░ ███▓░ `}),(0,c.jsx)(n,{children:` ░░░ ░░░░░░░░░░ ███▓░ `}),(0,c.jsxs)(n,{children:[(0,c.jsx)(n,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,c.jsx)(n,{bold:!0,children:`*`}),(0,c.jsx)(n,{children:` ██▓░░ ▓ `})]}),(0,c.jsx)(n,{children:` ░▓▓███▓▓░ `}),(0,c.jsx)(n,{dimColor:!0,children:` * ░░░░ `}),(0,c.jsx)(n,{dimColor:!0,children:` ░░░░░░░░ `}),(0,c.jsx)(n,{dimColor:!0,children:` ░░░░░░░░░░░░░░░░ `})]})}export{u as t};
@@ -1 +1 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./figures-5ThXQEtq.js";import{I as i,P as a,di as o,fi as s,t as c,ui as l}from"./src-CDCSSo0U2.js";import{t as u}from"./jsx-runtime-Bb4Xn-E0.js";import{en as d,h as f,mn as p}from"./state-ix0xIunV.js";import{$b as m,Dw as h,Ew as g,L as _,Qb as v,R as y,SD as b,Sw as x,yD as S,z as C}from"./loadAgentsDir-D206qwP3.js";import{n as w,t as T}from"./AddWorkspaceDirectory-ClHi-Dr6.js";function E({message:e,args:t,onDone:n}){return(0,O.useEffect)(()=>{let e=setTimeout(n,0);return()=>clearTimeout(e)},[n]),(0,k.jsxs)(i,{flexDirection:`column`,children:[(0,k.jsxs)(a,{dimColor:!0,children:[r.pointer,` /add-dir `,t]}),(0,k.jsx)(v,{children:(0,k.jsx)(a,{children:e})})]})}async function D(e,t,n){let r=(n??``).trim(),i=t.getAppState(),a=async(n,r=!1)=>{let i={type:`addDirectories`,directories:[n],destination:r?`localSettings`:`session`},a=x(t.getAppState().toolPermissionContext,i);t.setAppState(e=>({...e,toolPermissionContext:a}));let o=f();o.includes(n)||p([...o,n]),S.refreshConfig();let s;if(r)try{h(i),s=`Added ${l.bold(n)} as a working directory and saved to local settings`}catch(e){s=`Added ${l.bold(n)} as a working directory. Failed to save to local settings: ${e instanceof Error?e.message:`Unknown error`}`}else s=`Added ${l.bold(n)} as a working directory for this session`;e(`${s} ${l.dim(`· /permissions to manage`)}`)};if(!r)return(0,k.jsx)(T,{permissionContext:i.toolPermissionContext,onAddDirectory:a,onCancel:()=>{e(`Did not add a working directory.`)}});let o=await C(r,i.toolPermissionContext);if(o.resultType!==`success`){let t=_(o);return(0,k.jsx)(E,{message:t,args:n??``,onDone:()=>e(t)})}return(0,k.jsx)(T,{directoryPath:o.absolutePath,permissionContext:i.toolPermissionContext,onAddDirectory:a,onCancel:()=>{e(`Did not add ${l.bold(o.absolutePath)} as a working directory.`)}})}var O,k;e((()=>{o(),n(),O=t(s(),1),d(),m(),w(),c(),g(),b(),y(),k=u()}))();export{D as call};
1
+ import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./figures-5ThXQEtq.js";import{I as i,P as a,di as o,fi as s,t as c,ui as l}from"./src-CDCSSo0U2.js";import{t as u}from"./jsx-runtime-Bb4Xn-E0.js";import{$t as d,h as f,pn as p}from"./state-C2OSZkV1.js";import{Cw as m,F_ as h,I_ as g,L as _,R as v,SE as y,Sw as b,TE as x,j_ as S,z as C}from"./loadAgentsDir-ByO8eJqU.js";import{n as w,t as T}from"./AddWorkspaceDirectory-CwLtQld4.js";function E({message:e,args:t,onDone:n}){return(0,O.useEffect)(()=>{let e=setTimeout(n,0);return()=>clearTimeout(e)},[n]),(0,k.jsxs)(i,{flexDirection:`column`,children:[(0,k.jsxs)(a,{dimColor:!0,children:[r.pointer,` /add-dir `,t]}),(0,k.jsx)(b,{children:(0,k.jsx)(a,{children:e})})]})}async function D(e,t,n){let r=(n??``).trim(),i=t.getAppState(),a=async(n,r=!1)=>{let i={type:`addDirectories`,directories:[n],destination:r?`localSettings`:`session`},a=S(t.getAppState().toolPermissionContext,i);t.setAppState(e=>({...e,toolPermissionContext:a}));let o=f();o.includes(n)||p([...o,n]),y.refreshConfig();let s;if(r)try{g(i),s=`Added ${l.bold(n)} as a working directory and saved to local settings`}catch(e){s=`Added ${l.bold(n)} as a working directory. Failed to save to local settings: ${e instanceof Error?e.message:`Unknown error`}`}else s=`Added ${l.bold(n)} as a working directory for this session`;e(`${s} ${l.dim(`· /permissions to manage`)}`)};if(!r)return(0,k.jsx)(T,{permissionContext:i.toolPermissionContext,onAddDirectory:a,onCancel:()=>{e(`Did not add a working directory.`)}});let o=await C(r,i.toolPermissionContext);if(o.resultType!==`success`){let t=_(o);return(0,k.jsx)(E,{message:t,args:n??``,onDone:()=>e(t)})}return(0,k.jsx)(T,{directoryPath:o.absolutePath,permissionContext:i.toolPermissionContext,onAddDirectory:a,onCancel:()=>{e(`Did not add ${l.bold(o.absolutePath)} as a working directory.`)}})}var O,k;e((()=>{o(),n(),O=t(s(),1),d(),m(),w(),c(),h(),x(),v(),k=u()}))();export{D as call};
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Hh as t,Uh as n}from"./loadAgentsDir-D206qwP3.js";import{dn as r,un as i}from"./settings-BovzmwMP.js";function a(e,t){let n=new Map;for(let e of t)n.set(e.agentType,e);let r=new Set,i=[];for(let t of e){let e=`${t.agentType}:${t.source}`;if(r.has(e))continue;r.add(e);let a=n.get(t.agentType),o=a&&a.source!==t.source?a.source:void 0;i.push({...t,overriddenBy:o})}return i}function o(e){let n=e.model||t();if(n)return n===`inherit`?`inherit`:n}function s(e){return i(e).toLowerCase()}function c(e,t){return e.agentType.localeCompare(t.agentType,void 0,{sensitivity:`base`})}var l,u=e((()=>{n(),r(),l=[{label:`User agents`,source:`userSettings`},{label:`Project agents`,source:`projectSettings`},{label:`Local agents`,source:`localSettings`},{label:`Managed agents`,source:`policySettings`},{label:`Plugin agents`,source:`plugin`},{label:`CLI arg agents`,source:`flagSettings`},{label:`Built-in agents`,source:`built-in`}]}));export{o as a,u as i,c as n,a as o,s as r,l as t};
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Nf as t,Pf as n}from"./loadAgentsDir-ByO8eJqU.js";import{cn as r,sn as i}from"./settings-hQDLwPVj.js";function a(e,t){let n=new Map;for(let e of t)n.set(e.agentType,e);let r=new Set,i=[];for(let t of e){let e=`${t.agentType}:${t.source}`;if(r.has(e))continue;r.add(e);let a=n.get(t.agentType),o=a&&a.source!==t.source?a.source:void 0;i.push({...t,overriddenBy:o})}return i}function o(e){let n=e.model||t();if(n)return n===`inherit`?`inherit`:n}function s(e){return i(e).toLowerCase()}function c(e,t){return e.agentType.localeCompare(t.agentType,void 0,{sensitivity:`base`})}var l,u=e((()=>{n(),r(),l=[{label:`User agents`,source:`userSettings`},{label:`Project agents`,source:`projectSettings`},{label:`Local agents`,source:`localSettings`},{label:`Managed agents`,source:`policySettings`},{label:`Plugin agents`,source:`plugin`},{label:`CLI arg agents`,source:`flagSettings`},{label:`Built-in agents`,source:`built-in`}]}));export{o as a,u as i,c as n,a as o,s as r,l as t};
@@ -0,0 +1,103 @@
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{BS as v,Bp as y,Cf as b,DC as ee,Df as x,Ef as te,Fy as S,Hn as C,Iy as ne,Jd as re,Jp as w,KE as ie,LS as ae,La as oe,Mf as se,OC as ce,Pf as le,Pw as T,RS as ue,S_ as de,Tf as fe,Un as pe,Wn as me,Xd as he,Yg as ge,_v as _e,at as ve,bv as ye,bw as be,c as xe,cd as Se,cu as Ce,dp as we,eo as Te,et as Ee,f_ as De,fu as Oe,gd as ke,hd as Ae,hf as je,hl as Me,im as Ne,iu as Pe,jf as Fe,l as Ie,la as Le,ld as Re,lo as ze,md as Be,mf as Ve,ml as He,nd as Ue,nt as We,nu as Ge,o as Ke,od as qe,p_ as Je,pd as Ye,pf as Xe,pp as Ze,pu as Qe,qE as $e,qp as E,r as et,rd as tt,rm as nt,ru as rt,s as it,sd as at,st as ot,su as st,t as ct,tu as lt,ua as ut,vv as dt,wf as ft,x_ as pt,yw as mt,zS as ht,zp as gt}from"./loadAgentsDir-ByO8eJqU.js";import{n as _t,t as vt}from"./cwd-C5ce-7WB.js";import{C as yt,G as bt,I as xt,Q as St,S as Ct,W as wt,z as Tt}from"./debug-RZ4NuXyS.js";import{In as Et,J as Dt,Ln as Ot,Q as kt,Yt as At,Zt as jt,at as Mt,cn as Nt,it as Pt,on as Ft}from"./settings-hQDLwPVj.js";import{I as It,P as Lt}from"./config-CE058cvr.js";import{o as Rt,s as zt}from"./log-CZ0zYP_c.js";import{n as Bt,r as Vt}from"./analytics-CkYUHW_U.js";import{w as Ht,y as Ut}from"./startupProfiler-DCn_NxMH.js";import{l as Wt,n as Gt,o as Kt}from"./stringUtils-B6FudhoZ.js";import{bn as qt,xn as Jt}from"./prompt-B7joRiqj.js";import{gt as Yt}from"./sessionState-CjNY991n.js";import{a as Xt,i as Zt,n as Qt,o as $t,r as en,t as tn}from"./agentDisplay-DBQYOaOh.js";import{n as nn,t as rn}from"./useExitOnCtrlCDWithKeybindings-Cce612uS.js";import{n as an,t as on}from"./useMergedTools-Ckx2IEhF.js";import{n as sn,r as cn,t as ln}from"./promptEditor-R_acDAgI.js";import{n as un,t as dn}from"./useMainLoopModel-BICP6_Fi.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(vt(),O.FOLDER_NAME,O.AGENTS_DIR);case`policySettings`:return D(At(),O.FOLDER_NAME,O.AGENTS_DIR);case`localSettings`:return D(vt(),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 it(e)?`Built-in`:Ie(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 xt(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(xt(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((()=>{jt(),Ke(),_t(),r(),Tt(),hn()}));function kn({agent:e,tools:t,onBack:n}){let r=je(e,t,!1),i=Sn(e),o=fe(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`}),`: `,Fe(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`}),`: `,C(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,` `]})]})}),!it(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)(re,{children:e.getSystemPrompt()})})]})]})}var k,An=e((()=>{i(),p(),m(),T(),te(),pe(),Ve(),Ke(),le(),he(),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:ft[e],color:`inverseText`,children:` `}),(0,A.jsx)(l,{bold:n,children:Gt(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:ft[s],color:`inverseText`,bold:!0,children:[` `,`@`,e,` `]})]})]})}var Mn,A,Nn,Pn=e((()=>{i(),Mn=t(p(),1),m(),te(),Kt(),A=_(),Nn=[`automatic`,...b]}));function Fn({initialModel:e,onComplete:t,onCancel:n}){let r=In.useMemo(()=>{let t=se();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)(gt,{options:r,defaultValue:e??`sonnet`,onChange:t,onCancel:()=>n?n():t(void 0)})]})}var In,Ln,Rn=e((()=>{In=t(p(),1),m(),le(),y(),Ln=_()}));function zn(){return{READ_ONLY:{name:`Read-only tools`,toolNames:new Set([qe.name,Se.name,rt.name,Le.name,pt.name,Oe.name,st.name,mt.name,ht.name])},EDIT:{name:`Edit tools`,toolNames:new Set([Ae.name,Ye.name,Ue.name])},EXECUTION:{name:`Execution tools`,toolNames:new Set([De.name,process.env.USER_TYPE===`ant`?lt.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(ce(e)){let n=Mt(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)(()=>Xe({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=>{ce(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=Et(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=Et(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=Et(t,e=>_.has(e.name))===t.length;S.push({id:`mcp-server-${e}`,label:`${n?a.checkboxOn:a.checkboxOff} ${e} (${t.length} ${Wt(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=Mt(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),Pt(),ee(),Ve(),kt(),Je(),Pe(),ke(),ut(),Be(),at(),Re(),be(),tt(),v(),Ce(),Qe(),de(),Ge(),m(),T(),Ot(),Kt(),M=_()}));function Un(e){return e===`all`?`Agents`:e===`built-in`?`Built-in agents`:e===`plugin`?`Plugin agents`:ie(Ft(e))}var Wn=e((()=>{$e(),Nt()}));function Gn({agent:e,tools:t,onSaved:n,onBack:r}){let i=ye(),[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!xe(e)&&!Ie(e)?!1:(await Tn(e,e.whenToUse,r??e.tools,e.getSystemPrompt(),s,o??e.model),u&&s&&x(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]),te=(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 S=()=>(0,P.jsxs)(c,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:te,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 S();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),_e(),m(),T(),te(),Ke(),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:`${Et(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(),Ot(),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)(E,{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(),w(),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)(E,{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(),T(),w(),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=je(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((()=>{Ve(),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=Ht(p.getSystemPrompt(),240),g=Ht(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=It()?(0,H.jsxs)(l,{children:[(0,H.jsx)(l,{bold:!0,children:`Memory`}),`: `,C(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)(E,{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`}),`: `,Fe(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(),T(),Lt(),pe(),Ut(),le(),w(),B(),z(),On(),pr(),H=_()}));function gr({tools:e,existingAgents:t,onComplete:n}){let{wizardData:r}=L(),[i,a]=(0,_r.useState)(null),o=ye(),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}}}),ct(),e&&await ln(yn({source:r.location,agentType:r.finalAgent.agentType})),Vt(`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),Bt(),_e(),Ke(),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)(E,{action:`chat:externalEditor`,context:`Chat`,fallback:`ctrl+g`,description:`open in editor`}),(0,U.jsx)(E,{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)(nt,{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(),T(),cn(),w(),Ne(),B(),z(),U=_()}));async function Cr(e,t,n,r){let i=oe({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 S(),o=ot([i],a),s=It()?wr+Tr:wr,c=await We({messages:ze(o),systemPrompt:Yt([s]),thinkingConfig:{type:`disabled`},tools:[],signal:r,options:{getToolPermissionContext:async()=>qt(),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=yt(l.trim())}catch{let e=l.match(/\{[\s\S]*\}/);if(!e)throw Error(`No JSON object found in response`);u=yt(e[0])}if(!u.identifier||!u.whenToUse||!u.systemPrompt)throw Error(`Invalid agent configuration generated`);return Vt(`tengu_agent_definition_generated`,{agent_identifier:u.identifier}),{identifier:u.identifier,whenToUse:u.whenToUse,systemPrompt:u.systemPrompt}}var wr,Tr,Er=e((()=>{ne(),Ee(),Jt(),kt(),ve(),Te(),Lt(),Bt(),Ct(),ge(),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 St||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)(E,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`}),children:(0,G.jsxs)(c,{flexDirection:`row`,alignItems:`center`,children:[(0,G.jsx)(we,{}),(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)(E,{action:`confirm:yes`,context:`Confirmation`,fallback:`Enter`,description:`submit`}),(0,G.jsx)(E,{action:`chat:externalEditor`,context:`Chat`,fallback:`ctrl+g`,description:`open in editor`}),(0,G.jsx)(E,{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)(nt,{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((()=>{bt(),W=t(p(),1),dn(),m(),T(),ue(),cn(),w(),Ze(),Ne(),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)(E,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]}),children:(0,K.jsx)(c,{children:(0,K.jsx)(gt,{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(),w(),y(),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)(E,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:(0,q.jsx)(c,{children:(0,q.jsx)(gt,{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:It()&&i&&a?()=>r.systemPrompt+`
101
+
102
+ `+me(a,i):()=>r.systemPrompt}:void 0}),e()},onCancel:t},`memory-select`)})})}var q,Mr=e((()=>{m(),T(),Lt(),pe(),w(),y(),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)(E,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:(0,J.jsx)(c,{children:(0,J.jsx)(gt,{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(),w(),y(),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)(E,{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((()=>{w(),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)(E,{action:`chat:externalEditor`,context:`Chat`,fallback:`ctrl+g`,description:`open in editor`}),(0,X.jsx)(E,{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)(nt,{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(),T(),cn(),w(),Ne(),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)(E,{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(),w(),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)(E,{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)(nt,{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(),T(),w(),Ne(),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,...It()?[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((()=>{Lt(),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=dt(e=>e.agentDefinitions),a=dt(e=>e.mcp.tools),o=dt(e=>e.toolPermissionContext),s=ye(),{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){zt(wt(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)(gt,{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)(gt,{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(),_e(),Zt(),Ke(),Tt(),Rt(),y(),An(),Kn(),Yn(),Qn(),On(),qr(),$=_()}));async function Zr(e,t){let n=t.getAppState().toolPermissionContext;return(0,Qr.jsx)(Jr,{tools:He(n),onExit:e})}var Qr;e((()=>{p(),Xr(),Me(),Qr=_()}))();export{Zr as call};
@@ -1,2 +1,2 @@
1
- import{i as e,o as t,r as n}from"./loadAgentsDir-D206qwP3.js";import{n as r,t as i}from"./cwd-CYmmnQVS.js";import{a,i as o,n as s,o as c,r as l,t as u}from"./agentDisplay-XoDJhr03.js";o(),t(),r();function d(e){let t=a(e),n=[e.agentType];return t&&n.push(t),e.memory&&n.push(`${e.memory} memory`),n.join(` · `)}async function f(){let{allAgents:t}=await e(i()),r=c(t,n(t)),a=[],o=0;for(let{label:e,source:t}of u){let n=r.filter(e=>e.source===t).sort(s);if(n.length!==0){a.push(`${e}:`);for(let e of n)if(e.overriddenBy){let t=l(e.overriddenBy);a.push(` (shadowed by ${t}) ${d(e)}`)}else a.push(` ${d(e)}`),o++;a.push(``)}}a.length===0?console.log(`No agents found.`):(console.log(`${o} active agents\n`),console.log(a.join(`
1
+ import{i as e,o as t,r as n}from"./loadAgentsDir-ByO8eJqU.js";import{n as r,t as i}from"./cwd-C5ce-7WB.js";import{a,i as o,n as s,o as c,r as l,t as u}from"./agentDisplay-DBQYOaOh.js";o(),t(),r();function d(e){let t=a(e),n=[e.agentType];return t&&n.push(t),e.memory&&n.push(`${e.memory} memory`),n.join(` · `)}async function f(){let{allAgents:t}=await e(i()),r=c(t,n(t)),a=[],o=0;for(let{label:e,source:t}of u){let n=r.filter(e=>e.source===t).sort(s);if(n.length!==0){a.push(`${e}:`);for(let e of n)if(e.overriddenBy){let t=l(e.overriddenBy);a.push(` (shadowed by ${t}) ${d(e)}`)}else a.push(` ${d(e)}`),o++;a.push(``)}}a.length===0?console.log(`No agents found.`):(console.log(`${o} active agents\n`),console.log(a.join(`
2
2
  `).trimEnd()))}export{f as agentsHandler};
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{BC as t,RC as n}from"./loadAgentsDir-ByO8eJqU.js";import{g as r,u as i}from"./settings-hQDLwPVj.js";function a(){let e=i(),t=[`user`,`project`,`local`].flatMap(e=>n(e).errors);return{settings:e.settings,errors:[...e.errors,...t]}}var o=e((()=>{t(),r()}));export{o as n,a as t};
@@ -0,0 +1 @@
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(a===null&&(a=e,i.length>0)){let e=[...i];i.length=0,process.env.USER_TYPE===`ant`&&a.logEvent(`analytics_sink_attached`,{queued_event_count:e.length}),queueMicrotask(()=>{for(let t of e)t.async?a.logEventAsync(t.eventName,t.metadata):a.logEvent(t.eventName,t.metadata)})}}function r(e,t){if(a===null){i.push({eventName:e,metadata:t,async:!1});return}a.logEvent(e,t)}var i,a,o=e((()=>{i=[],a=null}));export{t as i,o as n,r,n as t};
@@ -0,0 +1 @@
1
+ import{$T as e,ZT as t,eE as n,iE as r,rE as i,tE as a}from"./loadAgentsDir-ByO8eJqU.js";import{l as o,s}from"./logoV2Utils-CGUJ-5gY.js";a(),o();var c=`default`;async function l(e,n){let r=await t(n.list||c,{subject:e,description:n.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(t,n){let r=await e(n.list||c,t);if(!r){console.error(`Task not found: ${t}`),process.exitCode=1;return}console.log(JSON.stringify(r,null,2))}async function f(e,t){let n=t.list||c,i={};t.status&&(i.status=t.status),t.subject&&(i.subject=t.subject),t.description&&(i.description=t.description),t.owner&&(i.owner=t.owner),t.clearOwner&&(i.owner=void 0);let a=await r(n,e,i);if(!a){console.error(`Task not found: ${e}`),process.exitCode=1;return}console.log(`Updated task ${e}: [${a.status}] ${a.subject}`)}async function p(e){let t=e.list||c;console.log(n(t))}async function m(e){let t=await s();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 s(),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-BMHAktkM.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};
@@ -0,0 +1 @@
1
+ import{a as e,o as t}from"./api-CF5IVtj0.js";t();export{e as getOAuthHeaders};
@@ -0,0 +1 @@
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-B4D4qJVE.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-RZ4NuXyS.js";import{g as m}from"./config-CE058cvr.js";import{o as h,s as g}from"./log-CZ0zYP_c.js";import{l as _,u as v}from"./oauth-BqJqV-2M.js";import{Bt as y,Fr as b,Ot as x,Pr as S,_n as C,vn as w}from"./model-CwO-g1RW.js";import{a as T,i as E}from"./detectRepository-CFiHe6Rv.js";import{randomUUID as D}from"crypto";function O(e){return t.isAxiosError(e)?!e.response||e.response.status>=500:!1}async function k(e,n){let r;for(let i=0;i<=R;i++)try{return await t.get(e,n)}catch(e){if(r=e,!O(e))throw e;if(i>=R)throw d(`Teleport request failed after ${i+1} attempts: ${s(e)}`),e;let t=L[i]??2e3;d(`Teleport request failed (attempt ${i+1}/${R+1}), retrying in ${t}ms: ${s(e)}`),await w(t)}throw r}async function A(){let e=x()?.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 S();if(!t)throw Error(`Unable to get organization UUID`);return{accessToken:e,orgUUID:t}}async function j(){let{accessToken:e,orgUUID:t}=await A(),n=`${_().BASE_API_URL}/v1/sessions`;try{let r=await k(n,{headers:{...M(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=T(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 g(l(e)),e}}function M(e){return{Authorization:`Bearer ${e}`,"Content-Type":`application/json`,"anthropic-version":`2023-06-01`}}async function N(e){let{accessToken:n,orgUUID:r}=await A(),i=`${_().BASE_API_URL}/v1/sessions/${e}`,a={...M(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 P(e){return(e.session_context.outcomes?.find(e=>e.type===`git_repository`))?.git_info?.branches[0]}async function F(e,n,r){try{let{accessToken:i,orgUUID:a}=await A(),o=`${_().BASE_API_URL}/v1/sessions/${e}/events`,s={...M(i),"anthropic-beta":`ccr-byoc-2025-07-29`,"x-organization-uuid":a},c={events:[{uuid:r?.uuid??D(),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 I(e,n){try{let{accessToken:r,orgUUID:i}=await A(),a=`${_().BASE_API_URL}/v1/sessions/${e}`,o={...M(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 L,R,z=e((()=>{n(),v(),b(),a(),y(),m(),u(),E(),p(),o(),h(),C(),c(),L=[2e3,4e3,8e3,16e3],R=L.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{M as a,A as c,P as i,F as l,j as n,z as o,N as r,O as s,k as t,I as u};