@readmagic/workmate 0.0.11 → 0.0.12

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 (405) hide show
  1. package/dist/chunks/{AddWorkspaceDirectory-ag2JTpmU.js → AddWorkspaceDirectory-CtRxzRny.js} +1 -1
  2. package/dist/chunks/AgentsMdExternalIncludesDialog-_bI4jo_P.js +1 -0
  3. package/dist/chunks/{ClaudeMdExternalIncludesDialog-CSywJdVL.js → AgentsMdExternalIncludesDialog-_yJJ0wqu.js} +1 -1
  4. package/dist/chunks/{App-BuKmqFPm.js → App-DoAZ7CYS.js} +1 -1
  5. package/dist/chunks/{ApproveApiKey-M6U-NafA.js → ApproveApiKey-C8LwmDM2.js} +1 -1
  6. package/dist/chunks/ApproveApiKey-DQP3qmb0.js +1 -0
  7. package/dist/chunks/BackgroundTasksDialog-CDA2noEk.js +2 -0
  8. package/dist/chunks/{BypassPermissionsModeDialog-B05t83wa.js → BypassPermissionsModeDialog-COI_V57z.js} +1 -1
  9. package/dist/chunks/ConsoleOAuthFlow-Dn8fO-o_.js +1 -0
  10. package/dist/chunks/{DiffDialog-DUbFrzKu.js → DiffDialog-CRWtQ1R5.js} +3 -3
  11. package/dist/chunks/Doctor-CZ513Df9.js +3 -0
  12. package/dist/chunks/Doctor-CzPvNZzF.js +1 -0
  13. package/dist/chunks/ExitFlow-BFeftDv0.js +2 -0
  14. package/dist/chunks/{Grove-BDoVj02t.js → Grove-DRZrhbF0.js} +1 -1
  15. package/dist/chunks/{HybridTransport-C_U0IJfz.js → HybridTransport-BadJQe6u.js} +2 -2
  16. package/dist/chunks/{InvalidConfigDialog-bih293Xt.js → InvalidConfigDialog-DQaT6aen.js} +1 -1
  17. package/dist/chunks/{InvalidSettingsDialog-Br8kQOHz.js → InvalidSettingsDialog-ISzcIGPU.js} +1 -1
  18. package/dist/chunks/MCPConnectionManager-BpjC7CEo.js +1 -0
  19. package/dist/chunks/MCPToolListView-Rb1Q--jG.js +1 -0
  20. package/dist/chunks/{McpParsingWarnings-COa71S9q.js → McpParsingWarnings-xv0RZCSL.js} +1 -1
  21. package/dist/chunks/MessageSelector-BHB55sZb.js +3 -0
  22. package/dist/chunks/Messages-CPX-nIdA.js +11 -0
  23. package/dist/chunks/Onboarding-CymgipoF.js +1 -0
  24. package/dist/chunks/{PromptInputFooterSuggestions-to5eYBvI.js → PromptInputFooterSuggestions-8-awCxOn.js} +1 -1
  25. package/dist/chunks/PromptInputHelpMenu-BP3UgCdi.js +1 -0
  26. package/dist/chunks/QueryEngine-HkswHUNv.js +1 -0
  27. package/dist/chunks/REPL-CZfg65kg.js +133 -0
  28. package/dist/chunks/REPL-eZsYNBfl.js +1 -0
  29. package/dist/chunks/RemoteSessionManager-B4jqKVd3.js +2 -0
  30. package/dist/chunks/ResumeConversation-B03XN_SP.js +1 -0
  31. package/dist/chunks/{SSETransport-DN4tCDEh.js → SSETransport-je346ofV.js} +1 -1
  32. package/dist/chunks/SearchExtraToolsTool-C85Sanww.js +1 -0
  33. package/dist/chunks/Settings-C8GKWod1.js +2 -0
  34. package/dist/chunks/{TeleportProgress-C2LQVLav.js → TeleportProgress-zmdAsogZ.js} +1 -1
  35. package/dist/chunks/{TeleportRepoMismatchDialog-BZL8Zblz.js → TeleportRepoMismatchDialog-CG32I4cO.js} +1 -1
  36. package/dist/chunks/{TeleportResumeWrapper-wPiIs8xg.js → TeleportResumeWrapper-2Yjr74Lq.js} +1 -1
  37. package/dist/chunks/{ThemePicker-BT_NaRQC.js → ThemePicker-p7_hHk1V.js} +1 -1
  38. package/dist/chunks/TrustDialog-BVcny9vs.js +1 -0
  39. package/dist/chunks/{ValidationErrorsList-C-hWdy_8.js → ValidationErrorsList-DSSUWdgd.js} +1 -1
  40. package/dist/chunks/{WelcomeV2-ZQRKlcT4.js → WelcomeV2-BnSYhyfu.js} +1 -1
  41. package/dist/chunks/add-dir-Bd7pilVx.js +1 -0
  42. package/dist/chunks/{agentDisplay-CuSHqgZc.js → agentDisplay-CfMLGPGH.js} +1 -1
  43. package/dist/chunks/{agents-CMC0iQP4.js → agents-BT82hwBN.js} +1 -1
  44. package/dist/chunks/agents-qR6r94-F.js +103 -0
  45. package/dist/chunks/allErrors-CS77lRvU.js +1 -0
  46. package/dist/chunks/api-C4VflFau.js +1 -0
  47. package/dist/chunks/{api-BbJfMXRS.js → api-DAubp5q9.js} +1 -1
  48. package/dist/chunks/auth-CNCehj7y.js +1 -0
  49. package/dist/chunks/auth-DrD9DW6X.js +1 -0
  50. package/dist/chunks/{auth-7mJGtlZp.js → auth-yDsvFcM7.js} +1 -1
  51. package/dist/chunks/{autoMode-CBtY7ACs.js → autoMode-C2lnBot9.js} +5 -5
  52. package/dist/chunks/backgroundHousekeeping-DbpTGbwl.js +1 -0
  53. package/dist/chunks/backgroundHousekeeping-SpTxViUq.js +17 -0
  54. package/dist/chunks/{banner-1Wyeyawe.js → banner-BcAM7iSx.js} +1 -1
  55. package/dist/chunks/bg-Ci7pG4eo.js +9 -0
  56. package/dist/chunks/{branch-k3kirqbA.js → branch-DJiMa8td.js} +1 -1
  57. package/dist/chunks/{break-cache-CAoZ9b72.js → break-cache-4rlQORVk.js} +2 -2
  58. package/dist/chunks/{bridgeConfig-UgaUfuP6.js → bridgeConfig-BB6Hgali.js} +1 -1
  59. package/dist/chunks/bridgeConfig-Ccm79Jze.js +1 -0
  60. package/dist/chunks/{bridgeMessaging-Ci5H68MX.js → bridgeMessaging-C9D0Lly2.js} +1 -1
  61. package/dist/chunks/{bridgePointer-BL8-lGvN.js → bridgePointer-DHWK3LEe.js} +1 -1
  62. package/dist/chunks/{bridgeStatusUtil-C36w15ge.js → bridgeStatusUtil-D8UbcVrZ.js} +1 -1
  63. package/dist/chunks/btw-BO2B23f-.js +1 -0
  64. package/dist/chunks/caches-BQmbXerw.js +1 -0
  65. package/dist/chunks/caches-Dtjmjm6G.js +1 -0
  66. package/dist/chunks/{capacityWake-BOySRJUJ.js → capacityWake-ByL6fM6I.js} +1 -1
  67. package/dist/chunks/{ccrClient-Br4LAofR.js → ccrClient-BG9HU_fW.js} +1 -1
  68. package/dist/chunks/{claudeDesktop-Bgds1-YT.js → claudeDesktop-Ct_hyICL.js} +1 -1
  69. package/dist/chunks/{clear-C4Vtnbye.js → clear-B4XN2fib.js} +1 -1
  70. package/dist/chunks/cliLaunch-OPOtzhvA.js +1 -0
  71. package/dist/chunks/client-7lIxWcaM.js +1 -0
  72. package/dist/chunks/client-B-2ccQZk.js +1 -0
  73. package/dist/chunks/{client-B9404qIP.js → client-BMA05FW8.js} +1 -1
  74. package/dist/chunks/commands-D_-v6_A0.js +1 -0
  75. package/dist/chunks/compact-kM0ETtB2.js +2 -0
  76. package/dist/chunks/config-9rLTDOYW.js +3 -0
  77. package/dist/chunks/config-Crf6Mzu3.js +1 -0
  78. package/dist/chunks/{config-kB2eazPX.js → config-DMKtiMzJ.js} +1 -1
  79. package/dist/chunks/{context-BN7DEjoH.js → context-BY5oO5is.js} +1 -1
  80. package/dist/chunks/{context-noninteractive-D91W2B8e.js → context-noninteractive-mAQt1p9l.js} +2 -2
  81. package/dist/chunks/context-noninteractive-tc4KTYfI.js +1 -0
  82. package/dist/chunks/conversation-CFIn-KsW.js +1 -0
  83. package/dist/chunks/conversation-DPI7VKBL.js +1 -0
  84. package/dist/chunks/createSSHSession-DjLSGm-0.js +6 -0
  85. package/dist/chunks/{createSession-DRqkLZWt.js → createSession-CftIZ3aq.js} +1 -1
  86. package/dist/chunks/createSession-CjdLcRec.js +1 -0
  87. package/dist/chunks/crossProjectResume-BJqXBzkf.js +40 -0
  88. package/dist/chunks/{cwd-Cfdf7z7s.js → cwd-Besi3Os3.js} +1 -1
  89. package/dist/chunks/cwd-DpqwaYHw.js +1 -0
  90. package/dist/chunks/datadog-BGati3aQ.js +1 -0
  91. package/dist/chunks/{debug-BecbSVoN.js → debug-Dr1SjdXn.js} +2 -2
  92. package/dist/chunks/{debugUtils-CmJfIUxW.js → debugUtils-cK-iOsEV.js} +1 -1
  93. package/dist/chunks/detached-CqfQYVOi.js +5 -0
  94. package/dist/chunks/detectRepository-BsKZDRoI.js +1 -0
  95. package/dist/chunks/{detectRepository-C15umvKN.js → detectRepository-CMEkS5_2.js} +1 -1
  96. package/dist/chunks/{diff-DeK4bwjw.js → diff-1HsxKGBh.js} +1 -1
  97. package/dist/chunks/{directoryCompletion-BJCu19HJ.js → directoryCompletion-ByBTSuLu.js} +1 -1
  98. package/dist/chunks/doctor-CJfvt9zR.js +1 -0
  99. package/dist/chunks/entry-CrZCZQQC.js +14 -0
  100. package/dist/chunks/{envUtils-BDhHQY0-.js → envUtils-DcaKZlRU.js} +1 -1
  101. package/dist/chunks/{esm-Ka3lhafK.js → esm-BkOWaWVb.js} +1 -1
  102. package/dist/chunks/{execFileNoThrow-DHyW8FMX.js → execFileNoThrow-mXq4K0rl.js} +1 -1
  103. package/dist/chunks/{execSyncWrapper-CDzB0BM1.js → execSyncWrapper-Ne33rRiD.js} +1 -1
  104. package/dist/chunks/exit-B8MA4Ltm.js +1 -0
  105. package/dist/chunks/{extraUsage-BrKbpBK-.js → extraUsage-0pUcYexI.js} +1 -1
  106. package/dist/chunks/extractMemories-DqhN0lba.js +1 -0
  107. package/dist/chunks/fast-DT5WDe3L.js +1 -0
  108. package/dist/chunks/{fast-DWn40OcQ.js → fast-VOu2FUlV.js} +1 -1
  109. package/dist/chunks/{fileSuggestions-C7Pwq2yj.js → fileSuggestions-Be-pyLLq.js} +1 -1
  110. package/dist/chunks/firstPartyEventLogger-B8RVGBQB.js +1 -0
  111. package/dist/chunks/{firstPartyEventLogger-BHjBQH0J.js → firstPartyEventLogger-aFhcruXA.js} +2 -2
  112. package/dist/chunks/{flushGate-DdJjxCes.js → flushGate-BUSrMj_6.js} +1 -1
  113. package/dist/chunks/{gemini-DHv2iVfy.js → gemini-DB4M-MYv.js} +1 -1
  114. package/dist/chunks/{generateSessionName-DhS_6oHd.js → generateSessionName-DhCypqJ_.js} +1 -1
  115. package/dist/chunks/{genericProcessUtils-B2HcDYhg.js → genericProcessUtils-Dc1pfb7J.js} +1 -1
  116. package/dist/chunks/git-Bs1vtuvX.js +1 -0
  117. package/dist/chunks/{git-DBlOv64X.js → git-CoQQ6YEf.js} +1 -1
  118. package/dist/chunks/{githubRepoPathMapping-CK56bUDe.js → githubRepoPathMapping-CmpEaQoo.js} +1 -1
  119. package/dist/chunks/goal-TxXtfkQ6.js +3 -0
  120. package/dist/chunks/{grok-BS57ZhyW.js → grok-D2a_J5wE.js} +1 -1
  121. package/dist/chunks/{grove-_zlQ83yR.js → grove-BnzBbGsX.js} +2 -2
  122. package/dist/chunks/{help-C_2tdXHC.js → help-C5ankDi4.js} +1 -1
  123. package/dist/chunks/{hooks-C7Bn7MBe.js → hooks-BZS105Rd.js} +3 -3
  124. package/dist/chunks/hooks-D-twhU_z.js +1 -0
  125. package/dist/chunks/{initReplBridge-NkZRcM77.js → initReplBridge-DL4klK0C.js} +1 -1
  126. package/dist/chunks/{install-Du-DSVzj.js → install-NZvHd_40.js} +1 -1
  127. package/dist/chunks/{instrumentation-DMs3b82f.js → instrumentation-CjBlVlFq.js} +4 -4
  128. package/dist/chunks/{job-rbX1VZmp.js → job-D502Zf8J.js} +1 -1
  129. package/dist/chunks/{jwtUtils-OzxN2zts.js → jwtUtils-FQWtM6iM.js} +1 -1
  130. package/dist/chunks/keybindings-D9Boc8FD.js +2 -0
  131. package/dist/chunks/{launchLocalMemory-BLRCK1_o.js → launchLocalMemory-DxC3LojF.js} +2 -2
  132. package/dist/chunks/{launchOnboarding-Al_X75Vz.js → launchOnboarding-BLp5k_H4.js} +1 -1
  133. package/dist/chunks/{loadAgentsDir-BL93ulMm.js → loadAgentsDir-BXtV2jiO.js} +597 -604
  134. package/dist/chunks/loadAgentsDir-BjsAQWqt.js +1 -0
  135. package/dist/chunks/{loadPluginHooks-B0au35a4.js → loadPluginHooks-Dt3XQ-3N.js} +1 -1
  136. package/dist/chunks/{localSearch-C5ipegd9.js → localSearch-CeP4ef0a.js} +1 -1
  137. package/dist/chunks/localSearch-Cz8Ot7k2.js +1 -0
  138. package/dist/chunks/{log-Dauqle-Z.js → log-27kCA_9u.js} +1 -1
  139. package/dist/chunks/{logoV2Utils-CkvOihX7.js → logoV2Utils-CEnU8qad.js} +1 -1
  140. package/dist/chunks/{magicDocs-DLav5QK0.js → magicDocs-YtfrqVC6.js} +3 -3
  141. package/dist/chunks/main-CGLCy2pM.js +31 -0
  142. package/dist/chunks/{main-CVNWNAoh.js → main-CkjTzYj1.js} +42 -42
  143. package/dist/chunks/{managedEnv-DJSCuqCb.js → managedEnv-B-BNY0xC.js} +1 -1
  144. package/dist/chunks/managedEnv-K9Si1UuL.js +1 -0
  145. package/dist/chunks/{mappers-DQxMcezy.js → mappers-IuJeXgvr.js} +1 -1
  146. package/dist/chunks/mcp-DMBoeQzm.js +6 -0
  147. package/dist/chunks/mcp-TMOPfLcW.js +1 -0
  148. package/dist/chunks/mcp-x5rgv-uv.js +2 -0
  149. package/dist/chunks/{memoize-FeyE7JEh.js → memoize-Co4vS6UF.js} +1 -1
  150. package/dist/chunks/memory-DDUoR63T.js +1 -0
  151. package/dist/chunks/{mode-Bl2RZC8M.js → mode-GzBwK--u.js} +2 -2
  152. package/dist/chunks/model-BydaMaPr.js +1 -0
  153. package/dist/chunks/model-CDnVaVDR.js +1 -0
  154. package/dist/chunks/model-CIvbC7rW.js +1 -0
  155. package/dist/chunks/{modelOptions-BtEZe5BB.js → modelOptions-ut0xePEe.js} +1 -1
  156. package/dist/chunks/{nativeInstaller-BEwayifa.js → nativeInstaller-fgCMR_c0.js} +1 -1
  157. package/dist/chunks/oauth-D38aRTUb.js +1 -0
  158. package/dist/chunks/oauth-U649LV5H.js +1 -0
  159. package/dist/chunks/{observationStore-BpjlK0pG.js → observationStore-D0rm3GhP.js} +1 -1
  160. package/dist/chunks/omit-D4Udf-p-.js +1 -0
  161. package/dist/chunks/{onChangeAppState-ZdwI7boX.js → onChangeAppState-WbvtqDtk.js} +1 -1
  162. package/dist/chunks/{openai-DWs4D-nQ.js → openai-DaVFXyBB.js} +3 -3
  163. package/dist/chunks/{panel-CoNfXy3K.js → panel-CoF2a-h4.js} +1 -1
  164. package/dist/chunks/parser-B2PlJg4C.js +1 -0
  165. package/dist/chunks/{parser-BH4u7QiV.js → parser-CUUiH40T.js} +1 -1
  166. package/dist/chunks/partition-CzW_31Y1.js +1 -0
  167. package/dist/chunks/permissions-BT3lxYBM.js +3 -0
  168. package/dist/chunks/{pidLock-DgOBc1Xo.js → pidLock-d1VPd6CG.js} +2 -2
  169. package/dist/chunks/{plan-BNYDTnQd.js → plan-M9DG3AqN.js} +1 -1
  170. package/dist/chunks/{platform-B0uTQc9P.js → platform-Dg1c9F_1.js} +1 -1
  171. package/dist/chunks/plugin-BiNHuq3h.js +17 -0
  172. package/dist/chunks/{pluginAutoupdate-BBU9Jn4p.js → pluginAutoupdate-B5lel6s5.js} +1 -1
  173. package/dist/chunks/{pluginBlocklist-DXQlbG0P.js → pluginBlocklist-CNGmIlwU.js} +1 -1
  174. package/dist/chunks/pluginCliCommands-WLOEhb2M.js +1 -0
  175. package/dist/chunks/{pluginFlagging-DcJ_FQuv.js → pluginFlagging-CXSSOj4J.js} +1 -1
  176. package/dist/chunks/pluginOperations-BFbty6WT.js +2 -0
  177. package/dist/chunks/{pluginStartupCheck-CKBFaMFr.js → pluginStartupCheck-BEd0VeQC.js} +1 -1
  178. package/dist/chunks/pluginStartupCheck-Bcdxg484.js +1 -0
  179. package/dist/chunks/{plugins-CBW7kPyp.js → plugins-BMZ3aYKP.js} +4 -4
  180. package/dist/chunks/poorMode-Djw0P9Gu.js +1 -0
  181. package/dist/chunks/{poorMode-B_xEvuEV.js → poorMode-DxgO_bUb.js} +1 -1
  182. package/dist/chunks/print-DmoLcwVq.js +26 -0
  183. package/dist/chunks/processBashCommand-B-VqME9O.js +1 -0
  184. package/dist/chunks/processSlashCommand-D6zEooTy.js +5 -0
  185. package/dist/chunks/{projectContext-CIxul6vA.js → projectContext-BN2ZWzOG.js} +1 -1
  186. package/dist/chunks/{projectContext-RUMJB798.js → projectContext-Bw3o5BrN.js} +1 -1
  187. package/dist/chunks/prompt-C3RRe4kW.js +1 -0
  188. package/dist/chunks/{prompt-Dx7IWhBt.js → prompt-CRc2QEZ5.js} +4 -4
  189. package/dist/chunks/prompt-EtAanewG.js +1 -0
  190. package/dist/chunks/{promptEditor-WCkmpejM.js → promptEditor-Bo1d8ZLq.js} +2 -2
  191. package/dist/chunks/{protocolHandler-BiVWrpHi.js → protocolHandler-B83fCYI4.js} +1 -1
  192. package/dist/chunks/{proxy-CVn7o19p.js → proxy-BEKNaTXI.js} +1 -1
  193. package/dist/chunks/rcDebugLog-DSchf3Hs.js +1 -0
  194. package/dist/chunks/{reconciler-C2Nd_e4n.js → reconciler-BGav_ezX.js} +1 -1
  195. package/dist/chunks/refresh-DumNiLvM.js +1 -0
  196. package/dist/chunks/{registerProtocol-E0Iu5hEx.js → registerProtocol-DduKPsn_.js} +1 -1
  197. package/dist/chunks/{reload-plugins-D-3AUT9g.js → reload-plugins-DNEgQ5vo.js} +1 -1
  198. package/dist/chunks/{remoteBridgeCore-CV6we3ZA.js → remoteBridgeCore-BGOqHADF.js} +1 -1
  199. package/dist/chunks/{remoteManagedSettings-D26Q09-7.js → remoteManagedSettings-26nhzuca.js} +1 -1
  200. package/dist/chunks/{rename-CSavuBIE.js → rename-BPknfVGF.js} +1 -1
  201. package/dist/chunks/{renderOptions-DDLbSMQU.js → renderOptions-45A-EdsK.js} +1 -1
  202. package/dist/chunks/resume-DGz04xDh.js +2 -0
  203. package/dist/chunks/ripgrep-BLQnqPnE.js +1 -0
  204. package/dist/chunks/{ripgrep-C1ydIMzT.js → ripgrep-DQ_ILUJV.js} +1 -1
  205. package/dist/chunks/{runtimeObserver-L7pSIWBT.js → runtimeObserver-BZrF3GnQ.js} +4 -4
  206. package/dist/chunks/{runtimeObserver-OU8KrZQG.js → runtimeObserver-CBV-7-w7.js} +1 -1
  207. package/dist/chunks/sandbox-adapter-DUqeqkQD.js +1 -0
  208. package/dist/chunks/sandbox-toggle-D61gVqcT.js +1 -0
  209. package/dist/chunks/searchExtraTools-CgsV6kb1.js +1 -0
  210. package/dist/chunks/{session-DUYsfPy_.js → session-Dy-_R7KP.js} +2 -2
  211. package/dist/chunks/sessionFileAccessHooks-BJlrZaRD.js +1 -0
  212. package/dist/chunks/sessionObserver-BGYoLRGx.js +1 -0
  213. package/dist/chunks/{sessionObserver-Dv3Ba8eA.js → sessionObserver-CyLpHSkw.js} +2 -2
  214. package/dist/chunks/{sessionState-D-SaBzWD.js → sessionState-DSWN4tMV.js} +1 -1
  215. package/dist/chunks/sessionStorage-zJ1esSCE.js +1 -0
  216. package/dist/chunks/{sessionStoragePortable-JZnGwqUM.js → sessionStoragePortable-BhkGMZWp.js} +1 -1
  217. package/dist/chunks/{sessionTitle-uCuYaNif.js → sessionTitle-L5tyJgdU.js} +2 -2
  218. package/dist/chunks/{sessionTracing-Bqb3vJTt.js → sessionTracing-DpHGGIZm.js} +1 -1
  219. package/dist/chunks/settings-3ionQKNv.js +1 -0
  220. package/dist/chunks/settings-DiBMs2gM.js +20 -0
  221. package/dist/chunks/settingsSync-dBqlrbcU.js +1 -0
  222. package/dist/chunks/setup-zf3v3ICe.js +3 -0
  223. package/dist/chunks/{shadowedRuleDetection-BzAZ57p2.js → shadowedRuleDetection-DZ0AA2Rw.js} +1 -1
  224. package/dist/chunks/{shellQuote-DS6WrivY.js → shellQuote-C_I6DHLV.js} +1 -1
  225. package/dist/chunks/{sideQuestion-CvMBBjI8.js → sideQuestion-BYT8FdPF.js} +1 -1
  226. package/dist/chunks/sinks-DppGvgz1.js +1 -0
  227. package/dist/chunks/{sinks-f7qYjbKJ.js → sinks-mFsijQ_S.js} +2 -2
  228. package/dist/chunks/skillChangeDetector-D-iq09Xs.js +1 -0
  229. package/dist/chunks/{skillGapStore-CqaT8c0C.js → skillGapStore-DQXHqoP7.js} +2 -2
  230. package/dist/chunks/{skillLifecycle-CnR8IqJM.js → skillLifecycle-BG_RnGSh.js} +2 -2
  231. package/dist/chunks/{skillSearchPanel-D9qrOXpI.js → skillSearchPanel-DxYP4Q6R.js} +5 -5
  232. package/dist/chunks/skills-BD-2ofXA.js +1 -0
  233. package/dist/chunks/startupProfiler-CUlV07MD.js +1 -0
  234. package/dist/chunks/{startupProfiler-CmH_aVy2.js → startupProfiler-Dc5r6LgE.js} +2 -2
  235. package/dist/chunks/{state-BemZdQIl.js → state-BPFYBqm1.js} +1 -1
  236. package/dist/chunks/state-CsdHk8n-.js +1 -0
  237. package/dist/chunks/{stats-B8uQ-UDi.js → stats-BkadEKa-.js} +1 -1
  238. package/dist/chunks/{status-D6KlRJmR.js → status-BmHu-c7I.js} +2 -2
  239. package/dist/chunks/{status-BekdWoIj.js → status-CrmnCDIE.js} +1 -1
  240. package/dist/chunks/{statusNoticeHelpers-BMM8_uJ1.js → statusNoticeHelpers-DakAVtQO.js} +1 -1
  241. package/dist/chunks/{stringUtils-C8PaYpQF.js → stringUtils-Df-Lnjxd.js} +1 -1
  242. package/dist/chunks/{subprocessEnv-Ci8VV_bi.js → subprocessEnv-CNBOhlDV.js} +1 -1
  243. package/dist/chunks/subprocessEnv-DtBCqQIo.js +1 -0
  244. package/dist/chunks/switcher-Dm646gO5.js +1 -0
  245. package/dist/chunks/switcher-sYTxnJQA.js +1 -0
  246. package/dist/chunks/{syncCache-ClP9aBqK.js → syncCache-BofuFJEe.js} +1 -1
  247. package/dist/chunks/{tasks-Dmh6qikm.js → tasks-NpI1iEem.js} +1 -1
  248. package/dist/chunks/teleport-Bs3kEipi.js +1 -0
  249. package/dist/chunks/{templateJobs-CxqU-s5i.js → templateJobs-C94jEE6O.js} +2 -2
  250. package/dist/chunks/{terminalSetup-BKGcmlWp.js → terminalSetup-CbXKCpWM.js} +1 -1
  251. package/dist/chunks/{terminalSetup-Cy19F1Js.js → terminalSetup-fwhFTxGi.js} +1 -1
  252. package/dist/chunks/{theme-U7lMFHQ0.js → theme-CEi3b_8f.js} +1 -1
  253. package/dist/chunks/tmux-d3cNCIZA.js +1 -0
  254. package/dist/chunks/{toolEventObserver-D9qjoVl5.js → toolEventObserver-DlL9CHmI.js} +1 -1
  255. package/dist/chunks/toolPool-DIT_uhtD.js +1 -0
  256. package/dist/chunks/trustedDevice-BokywSKL.js +1 -0
  257. package/dist/chunks/{trustedDevice-DL0pWP4_.js → trustedDevice-Bzz03jCy.js} +1 -1
  258. package/dist/chunks/{types-DafcFtmb.js → types-BJ7qTz75.js} +1 -1
  259. package/dist/chunks/{udsClient-CWnfsgFP.js → udsClient-CF8BmZgN.js} +1 -1
  260. package/dist/chunks/{updateCCB-C6XftzIG.js → updateCCB-CzBxsuJe.js} +6 -6
  261. package/dist/chunks/{upstreamproxy-CXmjxHpl.js → upstreamproxy-BuBFDFAD.js} +1 -1
  262. package/dist/chunks/{useExitOnCtrlCDWithKeybindings-DEEJhm_W.js → useExitOnCtrlCDWithKeybindings-BHQfwlAl.js} +1 -1
  263. package/dist/chunks/useMainLoopModel-BkyIIW9t.js +1 -0
  264. package/dist/chunks/useManagePlugins-BWROoGDs.js +1 -0
  265. package/dist/chunks/{useMergedTools-DbhqKk1-.js → useMergedTools-CHxnwR7R.js} +1 -1
  266. package/dist/chunks/{useSearchInput-gUDbkLaC.js → useSearchInput-q2CFPU4W.js} +1 -1
  267. package/dist/chunks/useSettingsErrors-CPVQbsqq.js +1 -0
  268. package/dist/chunks/{userAgent-CU7Ndh79.js → userAgent-B7WkjI6I.js} +1 -1
  269. package/dist/chunks/util-BfqXOA-P.js +1 -0
  270. package/dist/chunks/{validatePlugin-y_O_tCEL.js → validatePlugin-jrcrYEIu.js} +1 -1
  271. package/dist/chunks/{vim-w37BfGZ5.js → vim-C4Hs5U2h.js} +1 -1
  272. package/dist/chunks/{which-BRWBO7Gu.js → which-mplwBbc0.js} +1 -1
  273. package/dist/chunks/windowsPaths-B8p9tFRF.js +1 -0
  274. package/dist/chunks/{windowsPaths-DtWHLjmE.js → windowsPaths-C7Mdo9aU.js} +1 -1
  275. package/dist/chunks/{workSecret-BEhXgH2M.js → workSecret-XLodD7tw.js} +1 -1
  276. package/dist/chunks/workerRegistry-Cfo7bKlm.js +6 -0
  277. package/dist/chunks/worktree-D0k_pCEz.js +1 -0
  278. package/dist/cli.js +1 -1
  279. package/package.json +1 -1
  280. package/dist/chunks/ApproveApiKey-CIWOi_7v.js +0 -1
  281. package/dist/chunks/BackgroundTasksDialog-Pnpl3Ixx.js +0 -2
  282. package/dist/chunks/ClaudeMdExternalIncludesDialog-D-w166RC.js +0 -1
  283. package/dist/chunks/ConsoleOAuthFlow-CV6PcJOP.js +0 -1
  284. package/dist/chunks/Doctor-BcnUfJ4I.js +0 -1
  285. package/dist/chunks/Doctor-Dz4TuYas.js +0 -3
  286. package/dist/chunks/ExitFlow-BwyAtIHx.js +0 -2
  287. package/dist/chunks/MCPConnectionManager-B9n4SXN4.js +0 -1
  288. package/dist/chunks/MCPToolListView-DJ06N1DG.js +0 -1
  289. package/dist/chunks/MessageSelector-o4ULADFg.js +0 -3
  290. package/dist/chunks/Messages-qqwHuAW5.js +0 -11
  291. package/dist/chunks/Onboarding-BzuQjney.js +0 -1
  292. package/dist/chunks/PromptInputHelpMenu-CfMFx-TF.js +0 -1
  293. package/dist/chunks/QueryEngine-Dt0BKUeF.js +0 -1
  294. package/dist/chunks/REPL-CUbEDqEl.js +0 -133
  295. package/dist/chunks/REPL-DMaKNhTa.js +0 -1
  296. package/dist/chunks/RemoteSessionManager-Bf44A0Ol.js +0 -2
  297. package/dist/chunks/ResumeConversation-Ctw5Q1g9.js +0 -1
  298. package/dist/chunks/SearchExtraToolsTool-C80OdtPZ.js +0 -1
  299. package/dist/chunks/Settings-DfdcmvOV.js +0 -2
  300. package/dist/chunks/TrustDialog-ACaJ_m7A.js +0 -1
  301. package/dist/chunks/add-dir-SAKTkw0S.js +0 -1
  302. package/dist/chunks/agents-ZgRKpjHv.js +0 -103
  303. package/dist/chunks/allErrors-_cOQksHC.js +0 -1
  304. package/dist/chunks/api-DS1MiW01.js +0 -1
  305. package/dist/chunks/auth-DGZzCbU0.js +0 -1
  306. package/dist/chunks/auth-DN1MUpB8.js +0 -1
  307. package/dist/chunks/autonomy-DuQmYhq6.js +0 -15
  308. package/dist/chunks/autonomy-lJV7yWUl.js +0 -1
  309. package/dist/chunks/autonomyPanel-DAQm6lDz.js +0 -1
  310. package/dist/chunks/backgroundHousekeeping-BTy71bcY.js +0 -1
  311. package/dist/chunks/backgroundHousekeeping-Cc7Ag7JG.js +0 -17
  312. package/dist/chunks/bg-CJ0YWFli.js +0 -9
  313. package/dist/chunks/bg-CeUrRz_7.js +0 -1
  314. package/dist/chunks/bridgeConfig-CzRUPn-D.js +0 -1
  315. package/dist/chunks/btw-nVoVuIae.js +0 -1
  316. package/dist/chunks/caches-B8sM3Zys.js +0 -1
  317. package/dist/chunks/caches-Bp9MZ7IE.js +0 -1
  318. package/dist/chunks/cliLaunch-BTpfAGGI.js +0 -1
  319. package/dist/chunks/client-BCAbKdNz.js +0 -1
  320. package/dist/chunks/client-CJE6gEvU.js +0 -1
  321. package/dist/chunks/commands-DL-BzoMQ.js +0 -1
  322. package/dist/chunks/compact-Cx7BPXLU.js +0 -2
  323. package/dist/chunks/config-S5OW4Xqr.js +0 -1
  324. package/dist/chunks/config-aRiTrtCv.js +0 -3
  325. package/dist/chunks/context-noninteractive-DPacEFJ1.js +0 -1
  326. package/dist/chunks/conversation-D5Nbu9eT.js +0 -1
  327. package/dist/chunks/conversation-hcUx9e-C.js +0 -1
  328. package/dist/chunks/createSSHSession-DecOR6M5.js +0 -6
  329. package/dist/chunks/createSession-D27zvmOs.js +0 -1
  330. package/dist/chunks/crossProjectResume-Bw3U0Ty6.js +0 -40
  331. package/dist/chunks/cwd-ClLru_7T.js +0 -1
  332. package/dist/chunks/datadog-bm551AVV.js +0 -1
  333. package/dist/chunks/detached-CIyF0M5O.js +0 -5
  334. package/dist/chunks/detectRepository-DDfLfKcM.js +0 -1
  335. package/dist/chunks/doctor-BJORBomU.js +0 -1
  336. package/dist/chunks/entry-mdegyj8z.js +0 -14
  337. package/dist/chunks/exit-CF3KBl-S.js +0 -1
  338. package/dist/chunks/extractMemories-4lBn134y.js +0 -1
  339. package/dist/chunks/fast-0Vi354KI.js +0 -1
  340. package/dist/chunks/firstPartyEventLogger-BNBnLYPK.js +0 -1
  341. package/dist/chunks/git-DF4RFFaT.js +0 -1
  342. package/dist/chunks/goal-BZG4gtnb.js +0 -3
  343. package/dist/chunks/hooks-DT80Arzc.js +0 -1
  344. package/dist/chunks/keybindings-CwdC_8S0.js +0 -2
  345. package/dist/chunks/loadAgentsDir-eVKq8efm.js +0 -1
  346. package/dist/chunks/localSearch-CZlFfR_X.js +0 -1
  347. package/dist/chunks/main-LMyE3jXY.js +0 -31
  348. package/dist/chunks/managedEnv-CYepSnm8.js +0 -1
  349. package/dist/chunks/mcp-BAbbEaBA.js +0 -1
  350. package/dist/chunks/mcp-Ct4Sum6A.js +0 -6
  351. package/dist/chunks/mcp-D5HkCqUh.js +0 -2
  352. package/dist/chunks/memory-COa7aUbx.js +0 -1
  353. package/dist/chunks/model-B7rtZ7KV.js +0 -1
  354. package/dist/chunks/model-Bgh_r4lg.js +0 -1
  355. package/dist/chunks/model-DiuEAv6h.js +0 -1
  356. package/dist/chunks/oauth-BN2I0_jl.js +0 -1
  357. package/dist/chunks/oauth-C9VBDB0Y.js +0 -1
  358. package/dist/chunks/omit--yH_T4rf.js +0 -1
  359. package/dist/chunks/parser-BMIaRErw.js +0 -1
  360. package/dist/chunks/partition-DLcW5Oo_.js +0 -1
  361. package/dist/chunks/permissions-CaucYK3s.js +0 -3
  362. package/dist/chunks/plugin-BN-of1_H.js +0 -17
  363. package/dist/chunks/pluginCliCommands-CfdVNs8D.js +0 -1
  364. package/dist/chunks/pluginOperations-DnhzFbYI.js +0 -2
  365. package/dist/chunks/pluginStartupCheck-CpNB4jxG.js +0 -1
  366. package/dist/chunks/poorMode-yH1o41cQ.js +0 -1
  367. package/dist/chunks/print-BZOx09SU.js +0 -26
  368. package/dist/chunks/processBashCommand-dcCNCiBp.js +0 -1
  369. package/dist/chunks/processSlashCommand-YDiM63Qr.js +0 -5
  370. package/dist/chunks/prompt-CXGy0llt.js +0 -1
  371. package/dist/chunks/prompt-DovNDmcx.js +0 -1
  372. package/dist/chunks/rcDebugLog-CARUIORE.js +0 -1
  373. package/dist/chunks/refresh-B84H2Ezd.js +0 -1
  374. package/dist/chunks/resume-CROylN3J.js +0 -2
  375. package/dist/chunks/ripgrep-2M1GkXqJ.js +0 -1
  376. package/dist/chunks/sandbox-adapter-6UwMLh6e.js +0 -1
  377. package/dist/chunks/sandbox-toggle-YrQNWGsr.js +0 -1
  378. package/dist/chunks/searchExtraTools-Bdv5HJ74.js +0 -1
  379. package/dist/chunks/sessionFileAccessHooks-Czen7Ejz.js +0 -1
  380. package/dist/chunks/sessionObserver-B0zucj_c.js +0 -1
  381. package/dist/chunks/sessionStorage-BM1x51Z7.js +0 -1
  382. package/dist/chunks/settings-BG15IFYx.js +0 -1
  383. package/dist/chunks/settings-D4CpDv2y.js +0 -20
  384. package/dist/chunks/settingsSync-BSrpnyqo.js +0 -1
  385. package/dist/chunks/setup-C62oq4AZ.js +0 -3
  386. package/dist/chunks/sinks-WJ7nzLQs.js +0 -1
  387. package/dist/chunks/skillChangeDetector-U5kRU5nd.js +0 -1
  388. package/dist/chunks/skills-BgcFh0vy.js +0 -1
  389. package/dist/chunks/startupProfiler-B4HBBbHN.js +0 -1
  390. package/dist/chunks/state-BAGmpVBn.js +0 -1
  391. package/dist/chunks/state-D_lk6z-C.js +0 -1
  392. package/dist/chunks/subprocessEnv-CZkA9Cdp.js +0 -1
  393. package/dist/chunks/switcher-Ck9CrXrr.js +0 -1
  394. package/dist/chunks/switcher-DnAhkyIn.js +0 -1
  395. package/dist/chunks/teleport-DH3IuAUQ.js +0 -1
  396. package/dist/chunks/tmux-D5EvHWi3.js +0 -1
  397. package/dist/chunks/toolPool-69mfSPAs.js +0 -1
  398. package/dist/chunks/trustedDevice-B6AKlsl_.js +0 -1
  399. package/dist/chunks/useMainLoopModel-6w7mhwhU.js +0 -1
  400. package/dist/chunks/useManagePlugins-CjnsO-Of.js +0 -1
  401. package/dist/chunks/useSettingsErrors-CgPad-H0.js +0 -1
  402. package/dist/chunks/util-B4oMhJKh.js +0 -1
  403. package/dist/chunks/windowsPaths-BY-IVNwQ.js +0 -1
  404. package/dist/chunks/workerRegistry-Bq9bS5pw.js +0 -6
  405. package/dist/chunks/worktree-4SUJ4dtz.js +0 -1
@@ -1 +0,0 @@
1
- import{t as e}from"./REPL-CUbEDqEl.js";export{e as REPL};
@@ -1,2 +0,0 @@
1
- import{n as e,t}from"./memoize-BK3gG5ob.js";import{n,t as r}from"./defineProperty-C-QyHrDq.js";import{Cr as i,Eb as a,Gb as o,Gg as s,Kb as c,Lb as l,Nb as u,Oo as d,Tr as ee,Ub as te,Vb as ne,Vo as re,Wb as ie,XC as f,XT as p,YC as m,YT as h,aT as g,kb as _,rT as v,wo as y,zb as b,zg as x,zo as ae}from"./loadAgentsDir-BL93ulMm.js";import{di as oe,j as S,t as se,ui as ce}from"./src-P_wYS_NJ2.js";import{n as le,t as C}from"./cwd-Cfdf7z7s.js";import{C as w,P as ue,R as de,S as fe,c as T,i as E,x as D}from"./debug-BecbSVoN.js";import{Kt as O,Yt as k,f as A,g as j,n as M}from"./settings-D4CpDv2y.js";import{c as N,h as P,o as F,v as I,y as L}from"./config-aRiTrtCv.js";import{f as R,l as z,m as B,p as V}from"./git-DBlOv64X.js";import{n as H,r as pe}from"./execFileNoThrow-DHyW8FMX.js";import{o as U,s as W}from"./log-Dauqle-Z.js";import{i as G,o as me}from"./platform-B0uTQc9P.js";import{l as he,u as ge}from"./oauth-C9VBDB0Y.js";import{Bt as _e,Vt as ve,_ as ye,ai as be,g as xe,si as Se}from"./model-Bgh_r4lg.js";import{c as Ce,h as we,l as Te,m as K,s as Ee}from"./proxy-CVn7o19p.js";import{c as De,i as Oe}from"./terminalSetup-Cy19F1Js.js";import{l as ke,o as Ae}from"./api-BbJfMXRS.js";import{c as je,u as Me}from"./firstPartyEventLogger-BHjBQH0J.js";import{randomUUID as Ne}from"crypto";t(),h(),le(),P(),k(),pe(),B(),U(),Me();var Pe=[/(?:^|\/)(?:package-lock\.json|yarn\.lock|bun\.lock|bun\.lockb|pnpm-lock\.yaml|Pipfile\.lock|poetry\.lock|Cargo\.lock|Gemfile\.lock|go\.sum|composer\.lock|uv\.lock)$/,/\.generated\./,/(?:^|\/)(?:dist|build|out|target|node_modules|\.next|__pycache__)\//,/\.(?:min\.js|min\.css|map|pyc|pyo)$/,/\.(?:json|ya?ml|toml|xml|ini|cfg|conf|env|lock|txt|md|mdx|rst|csv|log|svg)$/i,/(?:^|\/)\.?(?:eslintrc|prettierrc|babelrc|editorconfig|gitignore|gitattributes|dockerignore|npmrc)/,/(?:^|\/)(?:tsconfig|jsconfig|biome|vitest\.config|jest\.config|webpack\.config|vite\.config|rollup\.config)\.[a-z]+$/,/(?:^|\/)\.(?:github|vscode|idea|claude)\//,/(?:^|\/)(?:CHANGELOG|LICENSE|CONTRIBUTING|CODEOWNERS|README)(?:\.[a-z]+)?$/i];function Fe(e){return!Pe.some(t=>t.test(e))}function Ie(e,t){let n=[],r=new Set,i=new Map;for(let a=1;n.length<t&&a<=t;a++)for(let o of e){if(n.length>=t)break;if(!Fe(o))continue;let e=Math.max(o.lastIndexOf(`/`),o.lastIndexOf(`\\`)),s=e>=0?o.slice(e+1):o;if(!s||r.has(s))continue;let c=e>=0?o.slice(0,e):`.`;(i.get(c)??0)>=a||(n.push(s),r.add(s),i.set(c,(i.get(c)??0)+1))}return n.length>=t?n:[]}async function Le(){if(O.platform===`win32`||!await z())return[];try{let e=await je(),t=[`log`,`-n`,`1000`,`--pretty=format:`,`--name-only`,`--diff-filter=M`],n=new Map,r=e=>{for(let t of e.split(`
2
- `)){let e=t.trim();e&&n.set(e,(n.get(e)??0)+1)}};if(e){let{stdout:n}=await H(`git`,[...t,`--author=${e}`],{cwd:C()});r(n)}if(n.size<10){let{stdout:e}=await H(V(),t,{cwd:C()});r(e)}return Ie(Array.from(n.entries()).sort((e,t)=>t[1]-e[1]).map(([e])=>e),5)}catch(e){return W(e),[]}}var Re=10080*60*1e3,ze=e(()=>{let e=F(),t=e.exampleFiles?.length?p(e.exampleFiles):`<filepath>`;return`Try "${p([`fix lint errors`,`fix typecheck errors`,`how does ${t} work?`,`refactor ${t}`,`how do I log an error?`,`edit ${t} to...`,`write a test for ${t}`,`create a util logging.py that...`])}"`}),Be=e(async()=>{let e=F();Date.now()-(e.exampleFilesGeneratedAt??0)>Re&&(e.exampleFiles=[]),e.exampleFiles?.length||Le().then(e=>{e.length&&I(t=>({...t,exampleFiles:e,exampleFilesGeneratedAt:Date.now()}))})});Se();var Ve={"claude-3-opus":{modelName:`Claude 3 Opus`,retirementDates:{firstParty:`January 5, 2026`,bedrock:`January 15, 2026`,vertex:`January 5, 2026`,foundry:`January 5, 2026`}},"claude-3-7-sonnet":{modelName:`Claude 3.7 Sonnet`,retirementDates:{firstParty:`February 19, 2026`,bedrock:`April 28, 2026`,vertex:`May 11, 2026`,foundry:`February 19, 2026`}},"claude-3-5-haiku":{modelName:`Claude 3.5 Haiku`,retirementDates:{firstParty:`February 19, 2026`,bedrock:null,vertex:null,foundry:null}}};function He(e){let t=e.toLowerCase(),n=be();for(let[e,r]of Object.entries(Ve)){let i=r.retirementDates[n];if(!(!t.includes(e)||!i))return{isDeprecated:!0,modelName:r.modelName,retirementDate:i}}return{isDeprecated:!1}}function Ue(e){if(!e)return null;let t=He(e);return t.isDeprecated?`⚠ ${t.modelName} will be retired on ${t.retirementDate}. Consider switching to a newer model.`:null}n(),oe(),se(),de(),D(),E(),me(),ge(),j(),_e(),ye(),g(),f(),b(),_(),s(),Oe(),ae(),y(),i(),P();function We(e){let t=N().numStartups;L(n=>{let r=n.tipsHistory??{};return r[e]===t?n:{...n,tipsHistory:{...r,[e]:t}}})}function q(e){let t=N(),n=t.tipsHistory?.[e];return n?t.numStartups-n:1/0}P(),k(),B();var J;async function Ge(){return J===void 0&&(J=v in await re()),J}async function Y(e,t,n){if(!await Ge()||d(`${e}@claude-plugins-official`))return!1;let{bashTools:r}=t??{};return!!(n.cli&&r?.size&&n.cli.some(e=>r.has(e))||n.filePath&&t?.readFileState&&a(t.readFileState).some(e=>n.filePath.test(e)))}var Ke=[{id:`new-user-warmup`,content:async()=>`Start with small features or bug fixes, tell Claude to propose a plan, and verify its suggested edits`,cooldownSessions:3,async isRelevant(){return N().numStartups<10}},{id:`plan-mode-for-complex-tasks`,content:async()=>`Use Plan Mode to prepare for a complex request before making changes. Press ${m(`chat:cycleMode`,`Chat`,`shift+tab`)} twice to enable.`,cooldownSessions:5,isRelevant:async()=>{let e=N();return(e.lastPlanModeUse?(Date.now()-e.lastPlanModeUse)/(1e3*60*60*24):1/0)>7}},{id:`default-permission-mode-config`,content:async()=>`Use /config to change your default permission mode (including Plan Mode)`,cooldownSessions:10,isRelevant:async()=>{try{let e=N(),t=A(),n=!!e.lastPlanModeUse,r=!!t?.permissions?.defaultMode;return n&&!r}catch(e){return T(`Failed to check default-permission-mode-config tip relevance: ${e}`,{level:`warn`}),!1}}},{id:`git-worktrees`,content:async()=>`Use git worktrees to run multiple Claude sessions in parallel.`,cooldownSessions:10,isRelevant:async()=>{try{let e=N();return await R()<=1&&e.numStartups>50}catch{return!1}}},{id:`terminal-setup`,content:async()=>O.terminal===`Apple_Terminal`?`Run /terminal-setup to enable convenient terminal integration like Option + Enter for new line and more`:`Run /terminal-setup to enable convenient terminal integration like Shift + Enter for new line and more`,cooldownSessions:10,async isRelevant(){let e=N();return O.terminal===`Apple_Terminal`?!e.optionAsMetaKeyInstalled:!e.shiftEnterKeyBindingInstalled}},{id:`shift-enter`,content:async()=>O.terminal===`Apple_Terminal`?`Press Option+Enter to send a multi-line message`:`Press Shift+Enter to send a multi-line message`,cooldownSessions:10,async isRelevant(){let e=N();return!!((O.terminal===`Apple_Terminal`?e.optionAsMetaKeyInstalled:e.shiftEnterKeyBindingInstalled)&&e.numStartups>3)}},{id:`shift-enter-setup`,content:async()=>O.terminal===`Apple_Terminal`?`Run /terminal-setup to enable Option+Enter for new lines`:`Run /terminal-setup to enable Shift+Enter for new lines`,cooldownSessions:10,async isRelevant(){if(!De())return!1;let e=N();return!(O.terminal===`Apple_Terminal`?e.optionAsMetaKeyInstalled:e.shiftEnterKeyBindingInstalled)}},{id:`memory-command`,content:async()=>`Use /memory to view and manage Claude memory`,cooldownSessions:15,async isRelevant(){return N().memoryUsageCount<=0}},{id:`theme-command`,content:async()=>`Use /theme to change the color theme`,cooldownSessions:20,isRelevant:async()=>!0},{id:`colorterm-truecolor`,content:async()=>`Try setting environment variable COLORTERM=truecolor for richer colors`,cooldownSessions:30,isRelevant:async()=>!process.env.COLORTERM&&ce.level<3},{id:`powershell-tool-env`,content:async()=>`Set CLAUDE_CODE_USE_POWERSHELL_TOOL=1 to enable the PowerShell tool (preview)`,cooldownSessions:10,isRelevant:async()=>G()===`windows`&&process.env.CLAUDE_CODE_USE_POWERSHELL_TOOL===void 0},{id:`status-line`,content:async()=>`Use /statusline to set up a custom status line that will display beneath the input box`,cooldownSessions:25,isRelevant:async()=>A().statusLine===void 0},{id:`prompt-queue`,content:async()=>`Hit Enter to queue up additional messages while Claude is working.`,cooldownSessions:5,async isRelevant(){return N().promptQueueUseCount<=3}},{id:`enter-to-steer-in-relatime`,content:async()=>`Send messages to Claude while it works to steer Claude in real-time`,cooldownSessions:20,isRelevant:async()=>!0},{id:`todo-list`,content:async()=>`Ask Claude to create a todo list when working on complex tasks to track progress and remain on track`,cooldownSessions:20,isRelevant:async()=>!0},{id:`vscode-command-install`,content:async()=>`Open the Command Palette (Cmd+Shift+P) and run "Shell Command: Install '${O.terminal===`vscode`?`code`:O.terminal}' command in PATH" to enable IDE integration`,cooldownSessions:0,async isRelevant(){if(!ie()||G()!==`macos`)return!1;switch(O.terminal){case`vscode`:return!await o();case`cursor`:return!await ne();case`windsurf`:return!await c();default:return!1}}},{id:`ide-upsell-external-terminal`,content:async()=>`Connect Claude to your IDE · /ide`,cooldownSessions:4,async isRelevant(){return te()||(await l()).length!==0?!1:(await u()).length>0}},{id:`permissions`,content:async()=>`Use /permissions to pre-approve and pre-deny bash, edit, and MCP tools`,cooldownSessions:10,async isRelevant(){return N().numStartups>10}},{id:`drag-and-drop-images`,content:async()=>`Did you know you can drag and drop image files into your terminal?`,cooldownSessions:10,isRelevant:async()=>!O.isSSH()},{id:`paste-images-mac`,content:async()=>`Paste images into Work Mate using control+v (not cmd+v!)`,cooldownSessions:10,isRelevant:async()=>G()===`macos`},{id:`double-esc`,content:async()=>`Double-tap esc to rewind the conversation to a previous point in time`,cooldownSessions:10,isRelevant:async()=>!x()},{id:`double-esc-code-restore`,content:async()=>`Double-tap esc to rewind the code and/or conversation to a previous point in time`,cooldownSessions:10,isRelevant:async()=>x()},{id:`continue`,content:async()=>`Run claude --continue or claude --resume to resume a conversation`,cooldownSessions:10,isRelevant:async()=>!0},{id:`rename-conversation`,content:async()=>`Name your conversations with /rename to find them easily in /resume later`,cooldownSessions:15,isRelevant:async()=>ee()&&N().numStartups>10},{id:`custom-commands`,content:async()=>`Create skills by adding .md files to .claude/skills/ in your project or ~/.claude/skills/ for skills that work in any project`,cooldownSessions:15,async isRelevant(){return N().numStartups>10}},{id:`shift-tab`,content:async()=>`Hit ${m(`chat:cycleMode`,`Chat`,`shift+tab`)} to cycle between default, accept edits, plan, auto, and bypass modes`,cooldownSessions:10,isRelevant:async()=>!0},{id:`image-paste`,content:async()=>`Use ${m(`chat:imagePaste`,`Chat`,`ctrl+v`)} to paste images from your clipboard`,cooldownSessions:20,isRelevant:async()=>!0},{id:`custom-agents`,content:async()=>`Use /agents to optimize specific tasks. Eg. Software Architect, Code Writer, Code Reviewer`,cooldownSessions:15,async isRelevant(){return N().numStartups>5}},{id:`agent-flag`,content:async()=>`Use --agent <agent_name> to directly start a conversation with a subagent`,cooldownSessions:15,async isRelevant(){return N().numStartups>5}},{id:`web-app`,content:async()=>`Run tasks in the cloud while you keep coding locally · clau.de/web`,cooldownSessions:15,isRelevant:async()=>!0},{id:`opusplan-mode-reminder`,content:async()=>`Your default model setting is Opus Plan Mode. Press ${m(`chat:cycleMode`,`Chat`,`shift+tab`)} twice to activate Plan Mode and plan with Claude Opus.`,cooldownSessions:2,async isRelevant(){let e=N(),t=xe()===`opusplan`,n=e.lastPlanModeUse?(Date.now()-e.lastPlanModeUse)/(1e3*60*60*24):1/0;return t&&n>3}},{id:`frontend-design-plugin`,content:async e=>`Working with HTML/CSS? Install the frontend-design plugin:\n${S(`suggestion`,e?.theme??`dark`)(`/plugin install frontend-design@${v}`)}`,cooldownSessions:3,isRelevant:async e=>Y(`frontend-design`,e,{filePath:/\.(html|css|htm)$/i})},{id:`vercel-plugin`,content:async e=>`Working with Vercel? Install the vercel plugin:\n${S(`suggestion`,e?.theme??`dark`)(`/plugin install vercel@${v}`)}`,cooldownSessions:3,isRelevant:async e=>Y(`vercel`,e,{filePath:/(?:^|[/\\])vercel\.json$/i,cli:[`vercel`]})},{id:`subagent-fanout-nudge`,content:async e=>`Say ${S(`suggestion`,e?.theme??`dark`)(`"fan out subagents"`)} and Claude sends a team. Each one digs deep so nothing gets missed.`,cooldownSessions:3,isRelevant:async()=>(ve(),!1)}],qe=[];function X(){let e=M().spinnerTipsOverride;return e?.tips?.length?e.tips.map((e,t)=>({id:`custom-tip-${t}`,content:async()=>e,cooldownSessions:0,isRelevant:async()=>!0})):[]}async function Je(e){let t=M().spinnerTipsOverride,n=X();if(t?.excludeDefault&&n.length>0)return n;let r=[...Ke,...qe],i=await Promise.all(r.map(t=>t.isRelevant?.(e)??Promise.resolve(!0)));return[...r.filter((e,t)=>i[t]).filter(e=>q(e.id)>=e.cooldownSessions),...n]}Ae(),E(),U(),we(),Te();var Z=2e3,Q=5,Ye=3e4,$=3,Xe=new Set([4003]);function Ze(e){return typeof e!=`object`||!e||!(`type`in e)?!1:typeof e.type==`string`}var Qe=class{constructor(e,t,n,i){r(this,`sessionId`,void 0),r(this,`orgUuid`,void 0),r(this,`getAccessToken`,void 0),r(this,`callbacks`,void 0),r(this,`ws`,null),r(this,`state`,`closed`),r(this,`reconnectAttempts`,0),r(this,`sessionNotFoundRetries`,0),r(this,`pingInterval`,null),r(this,`reconnectTimer`,null),this.sessionId=e,this.orgUuid=t,this.getAccessToken=n,this.callbacks=i}async connect(){if(this.state===`connecting`){T(`[SessionsWebSocket] Already connecting`);return}this.state=`connecting`;let e=`${he().BASE_API_URL.replace(`http`,`ws`)}/v1/sessions/ws/${this.sessionId}/subscribe?organization_uuid=${this.orgUuid}`;T(`[SessionsWebSocket] Connecting to ${e}`);let t={Authorization:`Bearer ${this.getAccessToken()}`,"anthropic-version":`2023-06-01`};if(typeof Bun<`u`){let n=new globalThis.WebSocket(e,{headers:t,proxy:Ce(e),tls:K()||void 0});this.ws=n,n.addEventListener(`open`,()=>{T(`[SessionsWebSocket] Connection opened, authenticated via headers`),this.state=`connected`,this.reconnectAttempts=0,this.sessionNotFoundRetries=0,this.startPingInterval(),this.callbacks.onConnected?.()}),n.addEventListener(`message`,e=>{let t=typeof e.data==`string`?e.data:String(e.data);this.handleMessage(t)}),n.addEventListener(`error`,()=>{let e=Error(`[SessionsWebSocket] WebSocket error`);W(e),this.callbacks.onError?.(e)}),n.addEventListener(`close`,e=>{T(`[SessionsWebSocket] Closed: code=${e.code} reason=${e.reason}`),this.handleClose(e.code)}),n.addEventListener(`pong`,()=>{T(`[SessionsWebSocket] Pong received`)})}else{let{default:n}=await import(`./wrapper-K8ZapJVu.js`),r=new n(e,{headers:t,agent:Ee(e),...K()});this.ws=r,r.on(`open`,()=>{T(`[SessionsWebSocket] Connection opened, authenticated via headers`),this.state=`connected`,this.reconnectAttempts=0,this.sessionNotFoundRetries=0,this.startPingInterval(),this.callbacks.onConnected?.()}),r.on(`message`,e=>{this.handleMessage(e.toString())}),r.on(`error`,e=>{W(Error(`[SessionsWebSocket] Error: ${e.message}`)),this.callbacks.onError?.(e)}),r.on(`close`,(e,t)=>{T(`[SessionsWebSocket] Closed: code=${e} reason=${t.toString()}`),this.handleClose(e)}),r.on(`pong`,()=>{T(`[SessionsWebSocket] Pong received`)})}}handleMessage(e){try{let t=fe(e);Ze(t)?this.callbacks.onMessage(t):T(`[SessionsWebSocket] Ignoring message type: ${typeof t==`object`&&t&&`type`in t?String(t.type):`unknown`}`)}catch(e){W(Error(`[SessionsWebSocket] Failed to parse message: ${ue(e)}`))}}handleClose(e){if(this.stopPingInterval(),this.state===`closed`)return;this.ws=null;let t=this.state;if(this.state=`closed`,Xe.has(e)){T(`[SessionsWebSocket] Permanent close code ${e}, not reconnecting`),this.callbacks.onClose?.();return}if(e===4001){if(this.sessionNotFoundRetries++,this.sessionNotFoundRetries>$){T(`[SessionsWebSocket] 4001 retry budget exhausted (${$}), not reconnecting`),this.callbacks.onClose?.();return}this.scheduleReconnect(Z*this.sessionNotFoundRetries,`4001 attempt ${this.sessionNotFoundRetries}/${$}`);return}t===`connected`&&this.reconnectAttempts<Q?(this.reconnectAttempts++,this.scheduleReconnect(Z,`attempt ${this.reconnectAttempts}/${Q}`)):(T(`[SessionsWebSocket] Not reconnecting`),this.callbacks.onClose?.())}scheduleReconnect(e,t){this.callbacks.onReconnecting?.(),T(`[SessionsWebSocket] Scheduling reconnect (${t}) in ${e}ms`),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},e)}startPingInterval(){this.stopPingInterval(),this.pingInterval=setInterval(()=>{if(this.ws&&this.state===`connected`)try{this.ws.ping?.()}catch{}},Ye)}stopPingInterval(){this.pingInterval&&(clearInterval(this.pingInterval),this.pingInterval=null)}sendControlResponse(e){if(!this.ws||this.state!==`connected`){W(Error(`[SessionsWebSocket] Cannot send: not connected`));return}T(`[SessionsWebSocket] Sending control response`),this.ws.send(w(e))}sendControlRequest(e){if(!this.ws||this.state!==`connected`){W(Error(`[SessionsWebSocket] Cannot send: not connected`));return}let t={type:`control_request`,request_id:Ne(),request:e};T(`[SessionsWebSocket] Sending control request: ${e.subtype}`),this.ws.send(w(t))}isConnected(){return this.state===`connected`}close(){T(`[SessionsWebSocket] Closing connection`),this.state=`closed`,this.stopPingInterval(),this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.ws&&(this.ws.close(),this.ws=null)}reconnect(){T(`[SessionsWebSocket] Force reconnecting`),this.reconnectAttempts=0,this.sessionNotFoundRetries=0,this.close(),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},500)}};E(),U(),n();function $e(e){return e.type!==`control_request`&&e.type!==`control_response`&&e.type!==`control_cancel_request`}var et=class{constructor(e,t){r(this,`config`,void 0),r(this,`callbacks`,void 0),r(this,`websocket`,null),r(this,`pendingPermissionRequests`,new Map),this.config=e,this.callbacks=t}connect(){T(`[RemoteSessionManager] Connecting to session ${this.config.sessionId}`);let e={onMessage:e=>this.handleMessage(e),onConnected:()=>{T(`[RemoteSessionManager] Connected`),this.callbacks.onConnected?.()},onClose:()=>{T(`[RemoteSessionManager] Disconnected`),this.callbacks.onDisconnected?.()},onReconnecting:()=>{T(`[RemoteSessionManager] Reconnecting`),this.callbacks.onReconnecting?.()},onError:e=>{W(e),this.callbacks.onError?.(e)}};this.websocket=new Qe(this.config.sessionId,this.config.orgUuid,this.config.getAccessToken,e),this.websocket.connect()}handleMessage(e){if(e.type===`control_request`){this.handleControlRequest(e);return}if(e.type===`control_cancel_request`){let{request_id:t}=e,n=this.pendingPermissionRequests.get(t);T(`[RemoteSessionManager] Permission request cancelled: ${t}`),this.pendingPermissionRequests.delete(t),this.callbacks.onPermissionCancelled?.(t,n?.tool_use_id);return}if(e.type===`control_response`){T(`[RemoteSessionManager] Received control response`);return}$e(e)&&this.callbacks.onMessage(e)}handleControlRequest(e){let t=e.request_id,n=e.request;if(n.subtype===`can_use_tool`)T(`[RemoteSessionManager] Permission request for tool: ${n.tool_name}`),this.pendingPermissionRequests.set(t,n),this.callbacks.onPermissionRequest(n,t);else{T(`[RemoteSessionManager] Unsupported control request subtype: ${n.subtype}`);let e={type:`control_response`,response:{subtype:`error`,request_id:t,error:`Unsupported control request subtype: ${n.subtype}`}};this.websocket?.sendControlResponse(e)}}async sendMessage(e,t){T(`[RemoteSessionManager] Sending message to session ${this.config.sessionId}`);let n=await ke(this.config.sessionId,e,t);return n||W(Error(`[RemoteSessionManager] Failed to send message to session ${this.config.sessionId}`)),n}respondToPermissionRequest(e,t){if(!this.pendingPermissionRequests.get(e)){W(Error(`[RemoteSessionManager] No pending permission request with ID: ${e}`));return}this.pendingPermissionRequests.delete(e);let n={type:`control_response`,response:{subtype:`success`,request_id:e,response:{behavior:t.behavior,...t.behavior===`allow`?{updatedInput:t.updatedInput}:{message:t.message}}}};T(`[RemoteSessionManager] Sending permission response: ${t.behavior}`),this.websocket?.sendControlResponse(n)}isConnected(){return this.websocket?.isConnected()??!1}cancelSession(){T(`[RemoteSessionManager] Sending interrupt signal`),this.websocket?.sendControlRequest({subtype:`interrupt`})}getSessionId(){return this.config.sessionId}disconnect(){T(`[RemoteSessionManager] Disconnecting`),this.websocket?.close(),this.websocket=null,this.pendingPermissionRequests.clear()}reconnect(){T(`[RemoteSessionManager] Reconnecting WebSocket`),this.websocket?.reconnect()}};function tt(e,t,n,r=!1,i=!1){return{sessionId:e,getAccessToken:t,orgUuid:n,hasInitialPrompt:r,viewerOnly:i}}export{We as a,Be as c,q as i,tt as n,Ue as o,Je as r,ze as s,et as t};
@@ -1 +0,0 @@
1
- import{a as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Cc as n,Cr as r,Du as ee,Eu as i,GC as a,Iu as o,Pr as s,Pu as c,Qn as te,Sg as ne,Tr as re,Vn as l,Xy as u,ZC as d,Zy as ie,_l as ae,ai as oe,c_ as f,gl as se,ii as ce,qr as le,s_ as p,vc as m,wg as h,xg as g,zr as _}from"./loadAgentsDir-BL93ulMm.js";import{I as v,P as y,Wt as b,dr as x,fi as S,ot as C,t as w}from"./src-P_wYS_NJ2.js";import{t as T}from"./jsx-runtime-Bb4Xn-E0.js";import{Wt as E,or as ue}from"./state-BemZdQIl.js";import{o as D,s as O}from"./log-Dauqle-Z.js";import{n as k,r as A}from"./analytics-DJobLaWP.js";import{a as de,n as fe,s as j}from"./skillChangeDetector-U5kRU5nd.js";import{t as M}from"./REPL-CUbEDqEl.js";import{a as N,i as P,n as F,o as I,r as L,t as R}from"./crossProjectResume-Bw3U0Ty6.js";import{dirname as z}from"path";var B=t(S(),1);d(),E(),I(),o(),u(),w(),a(),k(),g(),f(),P(),m(),i(),F(),D(),r();var V=T();function pe(e){let t=parseInt(e,10);if(!isNaN(t)&&t>0)return t;let n=e.match(/github\.com\/[^/]+\/[^/]+\/pull\/(\d+)/);return n?.[1]?parseInt(n[1],10):null}function H({commands:t,worktreePaths:r,initialTools:i,mcpClients:a,dynamicMcpConfig:o,debug:u,mainThreadAgentDefinition:d,autoConnectIdeFlag:f,strictMcpConfig:m=!1,systemPrompt:g,appendSystemPrompt:b,initialSearchQuery:S,disableSlashCommands:w=!1,forkSession:T,taskListId:E,filterByPr:D,thinkingConfig:k,onTurnComplete:P}){let{rows:F}=C(),I=ne(e=>e.agentDefinitions),H=h(),[U,W]=B.useState([]),[ge,G]=B.useState(!0),[_e,ve]=B.useState(!1),[K,ye]=B.useState(!1),[q,be]=B.useState(null),[J,xe]=B.useState(null),Y=B.useRef(null),X=B.useRef(0),Z=B.useMemo(()=>{let e=U.filter(e=>!e.isSidechain);if(D!==void 0){if(D===!0)e=e.filter(e=>e.prNumber!==void 0);else if(typeof D==`number`)e=e.filter(e=>e.prNumber===D);else if(typeof D==`string`){let t=pe(D);t!==null&&(e=e.filter(e=>e.prNumber===t))}}return e},[U,D]),Se=re();B.useEffect(()=>{_(r).then(e=>{Y.current=e,X.current=e.logs.length,W(e.logs),G(!1)}).catch(e=>{O(e),G(!1)})},[r]);let Q=B.useCallback(e=>{let t=Y.current;!t||t.nextIndex>=t.allStatLogs.length||te(t.allStatLogs,t.nextIndex,e).then(n=>{if(t.nextIndex=n.nextIndex,n.logs.length>0){let e=X.current;n.logs.forEach((t,n)=>{t.value=e+n}),W(e=>e.concat(n.logs)),X.current+=n.logs.length}else t.nextIndex<t.allStatLogs.length&&Q(e)})},[]),$=B.useCallback(e=>{G(!0),(e?s():_(r)).then(e=>{Y.current=e,X.current=e.logs.length,W(e.logs)}).catch(e=>{O(e)}).finally(()=>{G(!1)})},[r]),Ce=B.useCallback(()=>{let e=!K;ye(e),$(e)},[K,$]);function we(){process.exit(1)}async function Te(t){ve(!0);let r=performance.now(),i=R(t,K);if(i.isCrossProject&&!i.isSameRepoWorktree){let e=i.command,t=await x(e);t&&process.stdout.write(t),xe(e);return}try{let i=await ee(t,void 0);if(!i)throw Error(`Failed to load conversation`);i.sessionId&&!T?(ue(p(i.sessionId),t.fullPath?z(t.fullPath):null),await ce(),ie(i.sessionId)):T&&i.contentReplacements?.length&&await le(i.contentReplacements);let{agentDefinition:a}=de(i.agentSetting,d,I);H(e=>({...e,agent:a?.agentType}));let o=fe(i.agentName,i.agentColor);if(o&&H(e=>({...e,standaloneAgentContext:o})),n(i.agentName),oe(T?{...i,worktreeSession:void 0}:i),T||(j(i.worktreeSession),i.sessionId&&l()),i.goal&&i.sessionId){let{hydrateGoalFromTranscript:t}=(ae(),e(se)),n=new Map;n.set(i.sessionId,i.goal),t(n,i.sessionId)}A(`tengu_session_resumed`,{entrypoint:`picker`,success:!0,resume_duration_ms:Math.round(performance.now()-r)}),W([]),be({messages:i.messages,fileHistorySnapshots:i.fileHistorySnapshots,contentReplacements:i.contentReplacements,agentName:i.agentName,agentColor:i.agentColor==="default"?void 0:i.agentColor,mainThreadAgentDefinition:a})}catch(e){throw A(`tengu_session_resumed`,{entrypoint:`picker`,success:!1}),O(e),e}}return J?(0,V.jsx)(he,{command:J}):q?(0,V.jsx)(M,{debug:u,commands:t,initialTools:i,initialMessages:q.messages,initialFileHistorySnapshots:q.fileHistorySnapshots,initialContentReplacements:q.contentReplacements,initialAgentName:q.agentName,initialAgentColor:q.agentColor,mcpClients:a,dynamicMcpConfig:o,strictMcpConfig:m,systemPrompt:g,appendSystemPrompt:b,mainThreadAgentDefinition:q.mainThreadAgentDefinition,autoConnectIdeFlag:f,disableSlashCommands:w,taskListId:E,thinkingConfig:k,onTurnComplete:P}):ge?(0,V.jsxs)(v,{children:[(0,V.jsx)(c,{}),(0,V.jsx)(y,{children:` Loading conversations…`})]}):_e?(0,V.jsxs)(v,{children:[(0,V.jsx)(c,{}),(0,V.jsx)(y,{children:` Resuming conversation…`})]}):Z.length===0?(0,V.jsx)(me,{}):(0,V.jsx)(N,{logs:Z,maxHeight:F,onCancel:we,onSelect:Te,onLogsChanged:Se?()=>$(K):void 0,onLoadMore:Q,initialSearchQuery:S,showAllProjects:K,onToggleAllProjects:Ce,onAgenticSearch:L})}function me(){return b(`app:interrupt`,()=>{process.exit(1)},{context:`Global`}),(0,V.jsxs)(v,{flexDirection:`column`,children:[(0,V.jsx)(y,{children:`No conversations found to resume.`}),(0,V.jsx)(y,{dimColor:!0,children:`Press Ctrl+C to exit and start a new conversation.`})]})}function he({command:e}){return B.useEffect(()=>{let e=setTimeout(()=>{process.exit(0)},100);return()=>clearTimeout(e)},[]),(0,V.jsxs)(v,{flexDirection:`column`,gap:1,children:[(0,V.jsx)(y,{children:`This conversation is from a different directory.`}),(0,V.jsxs)(v,{flexDirection:`column`,children:[(0,V.jsx)(y,{children:`To resume, run:`}),(0,V.jsxs)(y,{children:[` `,e]})]}),(0,V.jsx)(y,{dimColor:!0,children:`(Command copied to clipboard)`})]})}export{H as ResumeConversation};
@@ -1 +0,0 @@
1
- import{X_ as e,Z_ as t}from"./loadAgentsDir-BL93ulMm.js";t();export{e as clearSearchExtraToolsDescriptionCache};
@@ -1,2 +0,0 @@
1
- import{a as e,n as t,o as n}from"./rolldown-runtime-DaDcL9Zw.js";import{d as r,l as i,o as a}from"./envUtils-BDhHQY0-.js";import{n as o,t as s}from"./figures-5ThXQEtq.js";import{$u as c,C as l,Cg as ee,Cr as te,Fp as ne,GC as u,P as re,Pp as d,Rb as ie,S as ae,Sb as f,Sg as p,Ub as oe,ZC as m,ao as h,bb as se,dd as g,ed as ce,hg as le,io as _,mg as v,or as ue,ro as y,td as de,ud as fe,v as pe,vb as me,wg as he,xb as ge,xg as b,zb as _e}from"./loadAgentsDir-BL93ulMm.js";import{D as x,Gt as ve,H as ye,I as S,P as C,T as w,U as be,Wt as xe,Xn as Se,a as Ce,di as we,fi as T,k as Te,n as Ee,ot as De,r as E,t as D,ui as O,x as k,y as Oe}from"./src-P_wYS_NJ2.js";import{t as A}from"./jsx-runtime-Bb4Xn-E0.js";import{Wt as ke,pt as Ae}from"./state-BemZdQIl.js";import{n as je,t as j}from"./cwd-Cfdf7z7s.js";import{Bt as Me,Ft as Ne,It as Pe,Mt as M,Pt as Fe,c as Ie,g as Le,n as Re,x as N,zt as ze}from"./settings-D4CpDv2y.js";import{a as Be,c as P,h as Ve,i as He,o as Ue,y as F}from"./config-aRiTrtCv.js";import{o as We,s as Ge}from"./log-Dauqle-Z.js";import{n as Ke,r as I}from"./analytics-DJobLaWP.js";import{G as qe,K as Je,Sr as Ye,_ as Xe,b as Ze,et as L,it as Qe,q as $e,rt as et,tt,x as nt,xr as rt}from"./model-Bgh_r4lg.js";import{r as it,t as at}from"./poorMode-B_xEvuEV.js";import{a as R,c as ot,d as st,i as ct,l as lt,n as ut,o as dt,r as z,s as ft,t as pt,u as B}from"./status-D6KlRJmR.js";import{n as V,t as H}from"./useExitOnCtrlCDWithKeybindings-DEEJhm_W.js";import{i as mt,n as ht,r as gt}from"./modalContext-CUThy6Ph.js";import{n as _t,t as vt}from"./ThemePicker-BT_NaRQC.js";import{i as yt,n as bt,r as xt,t as St}from"./extraUsage-BrKbpBK-.js";import{n as Ct,t as wt}from"./ClaudeMdExternalIncludesDialog-CSywJdVL.js";import{t as Tt}from"./SearchBox-C9vUA4IM.js";import{n as Et,t as U}from"./useSearchInput-gUDbkLaC.js";function Dt(){let e=Ae();return[{label:`Version`,value:`0.0.11`},{label:`Session name`,value:ue(e)??(0,K.jsx)(C,{dimColor:!0,children:`/rename to add a name`})},{label:`Session ID`,value:e},{label:`cwd`,value:j()},...ut(),...pt()]}function Ot({mainLoopModel:e,mcp:t,theme:n,context:r}){return[{label:`Model`,value:B(e)},...z(t.clients,r.options.ideInstallationStatus,n),...dt(t.clients,n),...ot(),...lt()]}async function kt(){return[...await ct(),...await R(),...await ft()]}function W({value:e}){return Array.isArray(e)?(0,K.jsx)(S,{flexWrap:`wrap`,columnGap:1,flexShrink:99,children:e.map((t,n)=>(0,K.jsxs)(C,{children:[t,n<e.length-1?`,`:``]},n))}):typeof e==`string`?(0,K.jsx)(C,{children:e}):e}function At({context:e,diagnosticsPromise:t}){let n=p(e=>e.mainLoopModel),r=p(e=>e.mcp),[i]=ye(),a=Mt.useMemo(()=>[Dt(),Ot({mainLoopModel:n,mcp:r,theme:i,context:e})],[n,r,i,e]),o=gt()?1:void 0;return(0,K.jsxs)(S,{flexDirection:`column`,flexGrow:o,children:[(0,K.jsxs)(S,{flexDirection:`column`,gap:1,flexGrow:o,children:[a.map((e,t)=>e.length>0&&(0,K.jsx)(S,{flexDirection:`column`,children:e.map(({label:e,value:t},n)=>(0,K.jsxs)(S,{flexDirection:`row`,gap:1,flexShrink:0,children:[e!==void 0&&(0,K.jsxs)(C,{bold:!0,children:[e,`:`]}),(0,K.jsx)(W,{value:t})]},n))},t)),(0,K.jsx)(G.Suspense,{fallback:null,children:(0,K.jsx)(jt,{promise:t})})]}),(0,K.jsx)(C,{dimColor:!0,children:(0,K.jsx)(d,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})})]})}function jt({promise:e}){let t=(0,G.use)(e);return t.length===0?null:(0,K.jsxs)(S,{flexDirection:`column`,paddingBottom:1,children:[(0,K.jsx)(C,{bold:!0,children:`System Diagnostics`}),t.map((e,t)=>(0,K.jsxs)(S,{flexDirection:`row`,gap:1,paddingX:1,children:[(0,K.jsx)(C,{color:`error`,children:s.warning}),typeof e==`string`?(0,K.jsx)(C,{wrap:`wrap`,children:e}):e]},t))]})}var Mt,G,K,Nt=t((()=>{o(),Mt=n(T(),1),G=n(T(),1),ke(),ht(),D(),b(),je(),te(),st(),ne(),K=A()}));function Pt({currentVersion:e,onChoice:t}){function n(e){t(e)}function r(){t(`cancel`)}return(0,Ft.jsxs)(Oe,{title:`Switch to Stable Channel`,onCancel:r,color:`permission`,hideBorder:!0,hideInputGuide:!0,children:[(0,Ft.jsxs)(C,{children:[`The stable channel may have an older version than what you're currently running (`,e,`).`]}),(0,Ft.jsx)(C,{dimColor:!0,children:`How would you like to handle this?`}),(0,Ft.jsx)(ce,{options:[{label:`Allow possible downgrade to stable version`,value:`downgrade`},{label:`Stay on current version (${e}) until stable catches up`,value:`stay`}],onChange:n})]})}var Ft,It=t((()=>{T(),D(),c(),Ft=A()}));function Lt(e){return Object.entries(e).map(([e,t])=>({label:t?.name??Bt,value:e,description:t?.description??Vt}))}function Rt({initialStyle:e,onComplete:t,onCancel:n,isStandaloneCommand:r}){let[i,a]=(0,zt.useState)([]),[o,s]=(0,zt.useState)(!0);(0,zt.useEffect)(()=>{_(j()).then(e=>{let t=Lt(e);a(t),s(!1)}).catch(()=>{let e=Lt(y);a(e),s(!1)})},[]);let c=(0,zt.useCallback)(e=>{t(e)},[t]);return(0,q.jsx)(Oe,{title:`Preferred output style`,onCancel:n,hideInputGuide:!r,hideBorder:!r,children:(0,q.jsxs)(S,{flexDirection:`column`,gap:1,children:[(0,q.jsx)(S,{marginTop:1,children:(0,q.jsx)(C,{dimColor:!0,children:`This changes how Claude Code communicates with you`})}),o?(0,q.jsx)(C,{dimColor:!0,children:`Loading output styles…`}):(0,q.jsx)(ce,{options:i,onChange:c,visibleOptionCount:10,defaultValue:e})]})})}var zt,q,Bt,Vt,Ht=t((()=>{T(),zt=n(T(),1),h(),D(),je(),de(),q=A(),Bt=`Default`,Vt=`Claude completes coding tasks efficiently and provides concise responses`}));function Ut({initialLanguage:e,onComplete:t,onCancel:n}){let[r,i]=(0,Wt.useState)(e),[a,o]=(0,Wt.useState)((e??``).length);xe(`confirm:no`,n,{context:`Settings`});function c(){let e=r?.trim();t(e||void 0)}return(0,J.jsxs)(S,{flexDirection:`column`,gap:1,children:[(0,J.jsx)(C,{children:`Enter your preferred response and voice language:`}),(0,J.jsxs)(S,{flexDirection:`row`,gap:1,children:[(0,J.jsx)(C,{children:s.pointer}),(0,J.jsx)(fe,{value:r??``,onChange:i,onSubmit:c,focus:!0,showCursor:!0,placeholder:`e.g., Japanese, 日本語, Español${s.ellipsis}`,columns:60,cursorOffset:a,onChangeCursorOffset:o})]}),(0,J.jsx)(C,{dimColor:!0,children:`Leave empty for default (English)`})]})}var Wt,J,Gt=t((()=>{o(),Wt=n(T(),1),D(),u(),g(),J=A()}));function Kt({onClose:t,context:n,setTabsHidden:a,onIsSearchModeChange:o,contentHeight:c}){let{headerFocused:l,focusHeader:te}=Ce(),ne=gt(),[,u]=ye(),f=be(),[m,h]=(0,X.useState)(P()),g=Y.useRef(P()),[_,v]=(0,X.useState)(Re()),ue=Y.useRef(Re()),[y,de]=(0,X.useState)(_?.outputStyle||`default`),fe=Y.useRef(y),[b,_e]=(0,X.useState)(_?.language),we=Y.useRef(b),[T,Ee]=(0,X.useState)(0),[E,D]=(0,X.useState)(0),[k,A]=(0,X.useState)(!1),ke=Se(),{rows:Ae}=De(),je=c??Math.min(Math.floor(Ae*.8),30),j=Math.max(5,je-10),M=p(e=>e.mainLoopModel),Le=p(e=>e.verbose),Ve=p(e=>e.thinkingEnabled),We=p(e=>et()?e.fastMode:!1);p(e=>e.promptSuggestionEnabled);let Ke=Ne(_?.permissions?.defaultMode??`default`),Xe=ae()||pe()===`enabled`,L=he(),[rt,R]=(0,X.useState)({}),ot=Y.useRef(Ve),[st]=(0,X.useState)(()=>Ie(`localSettings`)),[ct]=(0,X.useState)(()=>Ie(`userSettings`)),lt=Y.useRef(f),ut=ee(),[dt]=(0,X.useState)(()=>{let e=ut.getState();return{mainLoopModel:e.mainLoopModel,mainLoopModelForSession:e.mainLoopModelForSession,verbose:e.verbose,thinkingEnabled:e.thinkingEnabled,fastMode:e.fastMode,promptSuggestionEnabled:e.promptSuggestionEnabled,replBridgeEnabled:e.replBridgeEnabled,replBridgeOutboundOnly:e.replBridgeOutboundOnly,settings:e.settings}}),z=Y.useRef(!1),[ft,pt]=(0,X.useState)(!1),[B,V]=(0,X.useState)(null),{query:H,setQuery:mt,cursorOffset:ht}=Et({isActive:k&&B===null&&!l,onExit:()=>A(!1),onExitUp:te,passthroughCtrlKeys:[`c`,`d`]}),_t=k&&!l;Y.useEffect(()=>{o?.(_t)},[_t,o]);let yt=ie(n.options.mcpClients),St=!i(process.env.CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING),Ct=Y.use(se(!0)),Tt=ge(Ct),U=Be();function Dt(e){I(`tengu_config_model_changed`,{from_model:M,to_model:e}),L(t=>({...t,mainLoopModel:e,mainLoopModelForSession:null})),R(t=>{let n=nt(e)+(bt(e,!1,Ze())?` · Billed as extra usage`:``);if(`model`in t){let{model:e,...r}=t;return{...r,model:n}}return{...t,model:n}})}function Ot(e){F(t=>({...t,verbose:e})),h({...P(),verbose:e}),L(t=>({...t,verbose:e})),R(t=>{if(`verbose`in t){let{verbose:e,...n}=t;return n}return{...t,verbose:e}})}let kt=[{id:`autoCompactEnabled`,label:`Auto-compact`,value:m.autoCompactEnabled,type:`boolean`,onChange(e){F(t=>({...t,autoCompactEnabled:e})),h({...P(),autoCompactEnabled:e}),I(`tengu_auto_compact_setting_changed`,{enabled:e})}},{id:`spinnerTipsEnabled`,label:`Show tips`,value:_?.spinnerTipsEnabled??!0,type:`boolean`,onChange(e){N(`localSettings`,{spinnerTipsEnabled:e}),v(t=>({...t,spinnerTipsEnabled:e})),I(`tengu_tips_setting_changed`,{enabled:e})}},{id:`cacheWarningEnabled`,label:`Cache warnings`,value:_?.cacheWarningEnabled??!0,type:`boolean`,onChange(e){N(`localSettings`,{cacheWarningEnabled:e}),v(t=>({...t,cacheWarningEnabled:e})),I(`tengu_cache_warning_setting_changed`,{enabled:e})}},{id:`prefersReducedMotion`,label:`Reduce motion`,value:_?.prefersReducedMotion??!1,type:`boolean`,onChange(e){N(`localSettings`,{prefersReducedMotion:e}),v(t=>({...t,prefersReducedMotion:e})),L(t=>({...t,settings:{...t.settings,prefersReducedMotion:e}})),I(`tengu_reduce_motion_setting_changed`,{enabled:e})}},{id:`thinkingEnabled`,label:`Thinking mode`,value:Ve??!0,type:`boolean`,onChange(e){L(t=>({...t,thinkingEnabled:e})),N(`userSettings`,{alwaysThinkingEnabled:e?void 0:!1}),I(`tengu_thinking_toggled`,{enabled:e})}},...et()&&tt()?[{id:`fastMode`,label:`Fast mode (${qe} only)`,value:!!We,type:`boolean`,onChange(e){Je(),N(`userSettings`,{fastMode:e?!0:void 0}),e?(L(e=>({...e,mainLoopModel:$e(),mainLoopModelForSession:null,fastMode:!0})),R(e=>({...e,model:$e(),"Fast mode":`ON`}))):(L(e=>({...e,fastMode:!1})),R(e=>({...e,"Fast mode":`OFF`})))}}]:[],{id:`poorMode`,label:`Poor mode (save tokens)`,value:(at(),e(it)).isPoorModeActive(),type:`boolean`,onChange(t){(at(),e(it)).setPoorMode(t),L(e=>({...e,promptSuggestionEnabled:!t}))}},...St?[{id:`fileCheckpointingEnabled`,label:`Rewind code (checkpoints)`,value:m.fileCheckpointingEnabled,type:`boolean`,onChange(e){F(t=>({...t,fileCheckpointingEnabled:e})),h({...P(),fileCheckpointingEnabled:e}),I(`tengu_file_history_snapshots_setting_changed`,{enabled:e})}}]:[],{id:`verbose`,label:`Verbose output`,value:Le,type:`boolean`,onChange:Ot},{id:`terminalProgressBarEnabled`,label:`Terminal progress bar`,value:m.terminalProgressBarEnabled,type:`boolean`,onChange(e){F(t=>({...t,terminalProgressBarEnabled:e})),h({...P(),terminalProgressBarEnabled:e}),I(`tengu_terminal_progress_bar_setting_changed`,{enabled:e})}},{id:`showTurnDuration`,label:`Show turn duration`,value:m.showTurnDuration,type:`boolean`,onChange(e){F(t=>({...t,showTurnDuration:e})),h({...P(),showTurnDuration:e}),I(`tengu_show_turn_duration_setting_changed`,{enabled:e})}},{id:`defaultPermissionMode`,label:`Default permission mode`,value:Ke,options:(()=>{let e=[`default`,`plan`];return[...e,...Me.filter(t=>!e.includes(t))]})(),type:`enum`,onChange(e){let t=Ne(e),n=t===`auto`?t:Fe(t)?ze(t):t,r=N(`userSettings`,{permissions:{..._?.permissions,defaultMode:n}});if(r.error){Ge(r.error);return}v(e=>({...e,permissions:{...e?.permissions,defaultMode:n}})),R(t=>({...t,defaultPermissionMode:e})),I(`tengu_config_changed`,{setting:`defaultPermissionMode`,value:e})}},...Xe?[{id:`useAutoModeDuringPlan`,label:`Use auto mode during plan`,value:_?.useAutoModeDuringPlan??!0,type:`boolean`,onChange(e){N(`userSettings`,{useAutoModeDuringPlan:e}),v(t=>({...t,useAutoModeDuringPlan:e})),L(e=>{let t=re(e.toolPermissionContext);return t===e.toolPermissionContext?e:{...e,toolPermissionContext:t}}),R(t=>({...t,"Use auto mode during plan":e}))}}]:[],{id:`respectGitignore`,label:`Respect .gitignore in file picker`,value:m.respectGitignore,type:`boolean`,onChange(e){F(t=>({...t,respectGitignore:e})),h({...P(),respectGitignore:e}),I(`tengu_respect_gitignore_setting_changed`,{enabled:e})}},...le()?[{id:`copyOnSelect`,label:`Copy on select`,value:m.copyOnSelect??!0,type:`boolean`,onChange(e){F(t=>({...t,copyOnSelect:e})),h({...P(),copyOnSelect:e}),I(`tengu_config_changed`,{setting:`copyOnSelect`,value:String(e)})}}]:[],U?{id:`autoUpdatesChannel`,label:`Auto-update channel`,value:`disabled`,type:`managedEnum`,onChange(){}}:{id:`autoUpdatesChannel`,label:`Auto-update channel`,value:_?.autoUpdatesChannel??`latest`,type:`managedEnum`,onChange(){}},{id:`theme`,label:`Theme`,value:f,type:`managedEnum`,onChange:u},{id:`notifChannel`,label:`Notifications`,value:m.preferredNotifChannel,options:[`auto`,`iterm2`,`terminal_bell`,`iterm2_with_bell`,`kitty`,`ghostty`,`notifications_disabled`],type:`enum`,onChange(e){F(t=>({...t,preferredNotifChannel:e})),h({...P(),preferredNotifChannel:e})}},{id:`outputStyle`,label:`Output style`,value:y,type:`managedEnum`,onChange:()=>{}},{id:`language`,label:`Language`,value:b??`Default (English)`,type:`managedEnum`,onChange:()=>{}},{id:`editorMode`,label:`Editor mode`,value:m.editorMode===`emacs`?`normal`:m.editorMode||`normal`,options:[`normal`,`vim`],type:`enum`,onChange(e){F(t=>({...t,editorMode:e})),h({...P(),editorMode:e}),I(`tengu_editor_mode_changed`,{mode:e,source:`config_panel`})}},{id:`prStatusFooterEnabled`,label:`Show PR status footer`,value:m.prStatusFooterEnabled??!0,type:`boolean`,onChange(e){F(t=>t.prStatusFooterEnabled===e?t:{...t,prStatusFooterEnabled:e}),h({...P(),prStatusFooterEnabled:e}),I(`tengu_pr_status_footer_setting_changed`,{enabled:e})}},{id:`model`,label:`Model`,value:M===null?`Default (recommended)`:M,type:`managedEnum`,onChange:Dt},...yt?[{id:`diffTool`,label:`Diff tool`,value:m.diffTool??`auto`,options:[`terminal`,`auto`],type:`enum`,onChange(e){F(t=>({...t,diffTool:e})),h({...P(),diffTool:e}),I(`tengu_diff_tool_changed`,{tool:e,source:`config_panel`})}}]:[],...oe()?[]:[{id:`autoConnectIde`,label:`Auto-connect to IDE (external terminal)`,value:m.autoConnectIde??!1,type:`boolean`,onChange(e){F(t=>({...t,autoConnectIde:e})),h({...P(),autoConnectIde:e}),I(`tengu_auto_connect_ide_changed`,{enabled:e,source:`config_panel`})}}],...oe()?[{id:`autoInstallIdeExtension`,label:`Auto-install IDE extension`,value:m.autoInstallIdeExtension??!0,type:`boolean`,onChange(e){F(t=>({...t,autoInstallIdeExtension:e})),h({...P(),autoInstallIdeExtension:e}),I(`tengu_auto_install_ide_extension_changed`,{enabled:e,source:`config_panel`})}}]:[],...Tt?[{id:`showExternalIncludesDialog`,label:`External CLAUDE.md includes`,value:Ue().hasClaudeMdExternalIncludesApproved?`true`:`false`,type:`managedEnum`,onChange(){}}]:[],...process.env.ANTHROPIC_API_KEY&&!r()?[{id:`apiKey`,label:(0,Z.jsxs)(C,{children:[`Use custom API key: `,(0,Z.jsx)(C,{bold:!0,children:Ye(process.env.ANTHROPIC_API_KEY)})]}),searchText:`Use custom API key`,value:!!(process.env.ANTHROPIC_API_KEY&&m.customApiKeyResponses?.approved?.includes(Ye(process.env.ANTHROPIC_API_KEY))),type:`boolean`,onChange(e){F(t=>{let n={...t};if(n.customApiKeyResponses||(n.customApiKeyResponses={approved:[],rejected:[]}),n.customApiKeyResponses.approved||(n.customApiKeyResponses={...n.customApiKeyResponses,approved:[]}),n.customApiKeyResponses.rejected||(n.customApiKeyResponses={...n.customApiKeyResponses,rejected:[]}),process.env.ANTHROPIC_API_KEY){let t=Ye(process.env.ANTHROPIC_API_KEY);e?n.customApiKeyResponses={...n.customApiKeyResponses,approved:[...(n.customApiKeyResponses.approved??[]).filter(e=>e!==t),t],rejected:(n.customApiKeyResponses.rejected??[]).filter(e=>e!==t)}:n.customApiKeyResponses={...n.customApiKeyResponses,approved:(n.customApiKeyResponses.approved??[]).filter(e=>e!==t),rejected:[...(n.customApiKeyResponses.rejected??[]).filter(e=>e!==t),t]}}return n}),h(P())}}]:[]],W=Y.useMemo(()=>{if(!H)return kt;let e=H.toLowerCase();return kt.filter(t=>t.id.toLowerCase().includes(e)?!0:(`searchText`in t?t.searchText:t.label).toLowerCase().includes(e))},[kt,H]);Y.useEffect(()=>{if(T>=W.length){let e=Math.max(0,W.length-1);Ee(e),D(Math.max(0,e-j+1));return}D(e=>T<e?T:T>=e+j?T-j+1:e)},[W.length,T,j]);let At=(0,X.useCallback)(e=>{D(t=>e<t?e:e>=t+j?e-j+1:t)},[j]),jt=(0,X.useCallback)(()=>{if(B!==null)return;let e=Object.entries(rt).map(([e,t])=>(I(`tengu_config_changed`,{key:e,value:t}),`Set ${e} to ${O.bold(t)}`)),n=r()?void 0:process.env.ANTHROPIC_API_KEY,i=!!(n&&g.current.customApiKeyResponses?.approved?.includes(Ye(n))),a=!!(n&&m.customApiKeyResponses?.approved?.includes(Ye(n)));if(i!==a&&(e.push(`${a?`Enabled`:`Disabled`} custom API key`),I(`tengu_config_changed`,{key:`env.ANTHROPIC_API_KEY`,value:a})),m.theme!==g.current.theme&&e.push(`Set theme to ${O.bold(m.theme)}`),m.preferredNotifChannel!==g.current.preferredNotifChannel&&e.push(`Set notifications to ${O.bold(m.preferredNotifChannel)}`),y!==fe.current&&e.push(`Set output style to ${O.bold(y)}`),b!==we.current&&e.push(`Set response language to ${O.bold(b??`Default (English)`)}`),m.editorMode!==g.current.editorMode&&e.push(`Set editor mode to ${O.bold(m.editorMode||`emacs`)}`),m.diffTool!==g.current.diffTool&&e.push(`Set diff tool to ${O.bold(m.diffTool)}`),m.autoConnectIde!==g.current.autoConnectIde&&e.push(`${m.autoConnectIde?`Enabled`:`Disabled`} auto-connect to IDE`),m.autoInstallIdeExtension!==g.current.autoInstallIdeExtension&&e.push(`${m.autoInstallIdeExtension?`Enabled`:`Disabled`} auto-install IDE extension`),m.autoCompactEnabled!==g.current.autoCompactEnabled&&e.push(`${m.autoCompactEnabled?`Enabled`:`Disabled`} auto-compact`),m.respectGitignore!==g.current.respectGitignore&&e.push(`${m.respectGitignore?`Enabled`:`Disabled`} respect .gitignore in file picker`),m.copyOnSelect!==g.current.copyOnSelect&&e.push(`${m.copyOnSelect?`Enabled`:`Disabled`} copy on select`),m.terminalProgressBarEnabled!==g.current.terminalProgressBarEnabled&&e.push(`${m.terminalProgressBarEnabled?`Enabled`:`Disabled`} terminal progress bar`),m.showStatusInTerminalTab!==g.current.showStatusInTerminalTab&&e.push(`${m.showStatusInTerminalTab?`Enabled`:`Disabled`} terminal tab status`),m.showTurnDuration!==g.current.showTurnDuration&&e.push(`${m.showTurnDuration?`Enabled`:`Disabled`} turn duration`),m.remoteControlAtStartup!==g.current.remoteControlAtStartup){let t=m.remoteControlAtStartup===void 0?`Reset Remote Control to default`:`${m.remoteControlAtStartup?`Enabled`:`Disabled`} Remote Control for all sessions`;e.push(t)}_?.autoUpdatesChannel!==ue.current?.autoUpdatesChannel&&e.push(`Set auto-update channel to ${O.bold(_?.autoUpdatesChannel??`latest`)}`),e.length>0?t(e.join(`
2
- `)):t(`Config dialog dismissed`,{display:`system`})},[B,rt,m,M,y,b,_?.autoUpdatesChannel,et()?_?.fastMode:void 0,t]),Mt=(0,X.useCallback)(()=>{f!==lt.current&&u(lt.current),F(()=>g.current);let e=st;N(`localSettings`,{spinnerTipsEnabled:e?.spinnerTipsEnabled,prefersReducedMotion:e?.prefersReducedMotion,defaultView:e?.defaultView,outputStyle:e?.outputStyle});let t=ct;N(`userSettings`,{alwaysThinkingEnabled:t?.alwaysThinkingEnabled,fastMode:t?.fastMode,promptSuggestionEnabled:t?.promptSuggestionEnabled,autoUpdatesChannel:t?.autoUpdatesChannel,minimumVersion:t?.minimumVersion,language:t?.language,useAutoModeDuringPlan:t?.useAutoModeDuringPlan,syntaxHighlightingDisabled:t?.syntaxHighlightingDisabled,permissions:t?.permissions===void 0?void 0:{...t.permissions,defaultMode:t.permissions.defaultMode}});let n=dt;L(e=>({...e,mainLoopModel:n.mainLoopModel,mainLoopModelForSession:n.mainLoopModelForSession,verbose:n.verbose,thinkingEnabled:n.thinkingEnabled,fastMode:n.fastMode,promptSuggestionEnabled:n.promptSuggestionEnabled,replBridgeEnabled:n.replBridgeEnabled,replBridgeOutboundOnly:n.replBridgeOutboundOnly,settings:n.settings,toolPermissionContext:re(e.toolPermissionContext)}))},[f,u,st,ct,dt,L]);xe(`confirm:no`,(0,X.useCallback)(()=>{B===null&&(z.current&&Mt(),t(`Config dialog dismissed`,{display:`system`}))},[B,Mt,t]),{context:`Settings`,isActive:B===null&&!k&&!l}),xe(`settings:close`,jt,{context:`Settings`,isActive:B===null&&!k&&!l});let G=(0,X.useCallback)(()=>{let e=W[T];if(!(!e||!e.onChange)){if(e.type===`boolean`){z.current=!0,e.onChange(!e.value),e.id===`thinkingEnabled`&&(!e.value===ot.current?pt(!1):n.messages.some(e=>e.type===`assistant`)&&pt(!0));return}if(e.id===`theme`||e.id===`model`||e.id===`showExternalIncludesDialog`||e.id===`outputStyle`||e.id===`language`)switch(e.id){case`theme`:V(`Theme`),a(!0);return;case`model`:V(`Model`),a(!0);return;case`showExternalIncludesDialog`:V(`ExternalIncludes`),a(!0);return;case`outputStyle`:V(`OutputStyle`),a(!0);return;case`language`:V(`Language`),a(!0);return}if(e.id===`autoUpdatesChannel`){if(U){V(`EnableAutoUpdates`),a(!0);return}(_?.autoUpdatesChannel??`latest`)===`latest`?(V(`ChannelDowngrade`),a(!0)):(z.current=!0,N(`userSettings`,{autoUpdatesChannel:`latest`,minimumVersion:void 0}),v(e=>({...e,autoUpdatesChannel:`latest`,minimumVersion:void 0})),I(`tengu_autoupdate_channel_changed`,{channel:`latest`}));return}if(e.type===`enum`){z.current=!0;let t=(e.options.indexOf(e.value)+1)%e.options.length;e.onChange(e.options[t]);return}}},[U,W,T,_?.autoUpdatesChannel,a]),K=e=>{pt(!1);let t=Math.max(0,Math.min(W.length-1,T+e));Ee(t),At(t)};return ve({"select:previous":()=>{T===0?(pt(!1),A(!0),D(0)):K(-1)},"select:next":()=>K(1),"scroll:lineUp":()=>K(-1),"scroll:lineDown":()=>K(1),"select:accept":G,"select:previousValue":()=>G(),"select:nextValue":()=>G(),"settings:search":()=>{A(!0),mt(``)}},{context:`Settings`,isActive:B===null&&!k&&!l}),(0,Z.jsx)(S,{flexDirection:`column`,width:`100%`,tabIndex:0,autoFocus:!0,onKeyDown:(0,X.useCallback)(e=>{if(B===null&&!l){if(k){if(e.key===`escape`){e.preventDefault(),H.length>0?mt(``):A(!1);return}(e.key===`return`||e.key===`down`||e.key===`wheeldown`)&&(e.preventDefault(),A(!1),Ee(0),D(0));return}if(e.key===`left`||e.key===`right`||e.key===`tab`){e.preventDefault(),G();return}e.ctrl||e.meta||e.key===`j`||e.key===`k`||e.key===`/`||e.key.length===1&&e.key!==` `&&(e.preventDefault(),A(!0),mt(e.key))}},[B,l,k,H,mt,G]),children:B===`Theme`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(vt,{onThemeSelect:e=>{z.current=!0,u(e),V(null),a(!1)},onCancel:()=>{V(null),a(!1)},hideEscToCancel:!0,skipExitHandling:!0}),(0,Z.jsx)(S,{children:(0,Z.jsx)(C,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(w,{children:[(0,Z.jsx)(x,{shortcut:`Enter`,action:`select`}),(0,Z.jsx)(d,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})})]}):B===`Model`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(xt,{initial:M,onSelect:e=>{z.current=!0,Dt(e),V(null),a(!1)},onCancel:()=>{V(null),a(!1)},showFastModeNotice:et()?We&&Qe(M)&&tt():!1}),(0,Z.jsx)(C,{dimColor:!0,children:(0,Z.jsxs)(w,{children:[(0,Z.jsx)(x,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(d,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]}):B===`ExternalIncludes`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(wt,{onDone:()=>{V(null),a(!1)},externalIncludes:me(Ct)}),(0,Z.jsx)(C,{dimColor:!0,children:(0,Z.jsxs)(w,{children:[(0,Z.jsx)(x,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(d,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`disable external includes`})]})})]}):B===`OutputStyle`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Rt,{initialStyle:y,onComplete:e=>{z.current=!0,de(e??`default`),V(null),a(!1),N(`localSettings`,{outputStyle:e}),I(`tengu_output_style_changed`,{style:e??`default`,source:`config_panel`,settings_source:`localSettings`})},onCancel:()=>{V(null),a(!1)}}),(0,Z.jsx)(C,{dimColor:!0,children:(0,Z.jsxs)(w,{children:[(0,Z.jsx)(x,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(d,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]}):B===`Language`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Ut,{initialLanguage:b,onComplete:e=>{z.current=!0,_e(e),V(null),a(!1),N(`userSettings`,{language:e}),I(`tengu_language_changed`,{language:e??`default`,source:`config_panel`})},onCancel:()=>{V(null),a(!1)}}),(0,Z.jsx)(C,{dimColor:!0,children:(0,Z.jsxs)(w,{children:[(0,Z.jsx)(x,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(d,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]})})]}):B===`EnableAutoUpdates`?(0,Z.jsx)(Oe,{title:`Enable Auto-Updates`,onCancel:()=>{V(null),a(!1)},hideBorder:!0,hideInputGuide:!0,children:U?.type===`config`?(0,Z.jsx)(ce,{options:[{label:`Enable with latest channel`,value:`latest`},{label:`Enable with stable channel`,value:`stable`}],onChange:e=>{z.current=!0,V(null),a(!1),F(e=>({...e,autoUpdates:!0})),h({...P(),autoUpdates:!0}),N(`userSettings`,{autoUpdatesChannel:e,minimumVersion:void 0}),v(t=>({...t,autoUpdatesChannel:e,minimumVersion:void 0})),I(`tengu_autoupdate_enabled`,{channel:e})}}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(C,{children:U?.type===`env`?`Auto-updates are controlled by an environment variable and cannot be changed here.`:`Auto-updates are disabled in development builds.`}),U?.type===`env`&&(0,Z.jsxs)(C,{dimColor:!0,children:[`Unset `,U.envVar,` to re-enable auto-updates.`]})]})}):B===`ChannelDowngrade`?(0,Z.jsx)(Pt,{currentVersion:`0.0.11`,onChoice:e=>{if(V(null),a(!1),e===`cancel`)return;z.current=!0;let t={autoUpdatesChannel:`stable`};e===`stay`&&(t.minimumVersion=`0.0.11`),N(`userSettings`,t),v(e=>({...e,...t})),I(`tengu_autoupdate_channel_changed`,{channel:`stable`,minimum_version_set:e===`stay`})}}):(0,Z.jsxs)(S,{flexDirection:`column`,gap:1,marginY:ne?void 0:1,children:[(0,Z.jsx)(Te,{query:H,isFocused:k&&!l,isTerminalFocused:ke,cursorOffset:ht,placeholder:`Search settings…`}),(0,Z.jsx)(S,{flexDirection:`column`,children:W.length===0?(0,Z.jsxs)(C,{dimColor:!0,italic:!0,children:[`No settings match "`,H,`"`]}):(0,Z.jsxs)(Z.Fragment,{children:[E>0&&(0,Z.jsxs)(C,{dimColor:!0,children:[s.arrowUp,` `,E,` more above`]}),W.slice(E,E+j).map((e,t)=>{let n=E+t===T&&!l&&!k;return(0,Z.jsx)(Y.Fragment,{children:(0,Z.jsxs)(S,{width:`100%`,children:[(0,Z.jsx)(S,{width:44,children:(0,Z.jsxs)(C,{color:n?`suggestion`:void 0,children:[n?s.pointer:` `,` `,e.label]})}),(0,Z.jsx)(S,{flexGrow:1,children:e.type===`boolean`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(C,{color:n?`suggestion`:void 0,children:e.value.toString()}),ft&&e.id===`thinkingEnabled`&&(0,Z.jsxs)(C,{color:`warning`,children:[` `,`Changing thinking mode mid-conversation will increase latency and may reduce quality.`]})]}):e.id===`theme`?(0,Z.jsx)(C,{color:n?`suggestion`:void 0,children:Jt[e.value.toString()]??e.value.toString()}):e.id===`notifChannel`?(0,Z.jsx)(C,{color:n?`suggestion`:void 0,children:(0,Z.jsx)(qt,{value:e.value.toString()})}):e.id===`defaultPermissionMode`?(0,Z.jsx)(C,{color:n?`suggestion`:void 0,children:Pe(e.value)}):e.id===`autoUpdatesChannel`&&U?(0,Z.jsxs)(S,{flexDirection:`column`,children:[(0,Z.jsx)(C,{color:n?`suggestion`:void 0,children:`disabled`}),(0,Z.jsxs)(C,{dimColor:!0,children:[`(`,He(U),`)`]})]}):(0,Z.jsx)(C,{color:n?`suggestion`:void 0,children:e.value.toString()})})]})},e.id)}),E+j<W.length&&(0,Z.jsxs)(C,{dimColor:!0,children:[s.arrowDown,` `,W.length-E-j,` more below`]})]})}),l?(0,Z.jsx)(C,{dimColor:!0,children:(0,Z.jsxs)(w,{children:[(0,Z.jsx)(x,{shortcut:`←/→ tab`,action:`switch`}),(0,Z.jsx)(x,{shortcut:`↓`,action:`return`}),(0,Z.jsx)(d,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`close`})]})}):k?(0,Z.jsx)(C,{dimColor:!0,children:(0,Z.jsxs)(w,{children:[(0,Z.jsx)(C,{children:`Type to filter`}),(0,Z.jsx)(x,{shortcut:`Enter/↓`,action:`select`}),(0,Z.jsx)(x,{shortcut:`↑`,action:`tabs`}),(0,Z.jsx)(d,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`clear`})]})}):(0,Z.jsx)(C,{dimColor:!0,children:(0,Z.jsxs)(w,{children:[(0,Z.jsx)(d,{action:`select:accept`,context:`Settings`,fallback:`Space`,description:`change`}),(0,Z.jsx)(d,{action:`settings:close`,context:`Settings`,fallback:`Enter`,description:`save`}),(0,Z.jsx)(d,{action:`settings:search`,context:`Settings`,fallback:`/`,description:`search`}),(0,Z.jsx)(d,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]})})]})})}function qt({value:e}){switch(e){case`auto`:return`Auto`;case`iterm2`:return(0,Z.jsxs)(C,{children:[`iTerm2 `,(0,Z.jsx)(C,{dimColor:!0,children:`(OSC 9)`})]});case`terminal_bell`:return(0,Z.jsxs)(C,{children:[`Terminal Bell `,(0,Z.jsx)(C,{dimColor:!0,children:`(\\a)`})]});case`kitty`:return(0,Z.jsxs)(C,{children:[`Kitty `,(0,Z.jsx)(C,{dimColor:!0,children:`(OSC 99)`})]});case`ghostty`:return(0,Z.jsxs)(C,{children:[`Ghostty `,(0,Z.jsx)(C,{dimColor:!0,children:`(OSC 777)`})]});case`iterm2_with_bell`:return`iTerm2 w/ Bell`;case`notifications_disabled`:return`Disabled`;default:return e}}var Y,X,Z,Jt,Yt=t((()=>{D(),Y=n(T(),1),X=n(T(),1),u(),o(),Ve(),rt(),we(),M(),l(),We(),Ke(),_t(),b(),yt(),Xe(),St(),Ct(),It(),c(),Ht(),Gt(),f(),ne(),ht(),Tt(),_e(),Le(),h(),a(),U(),m(),L(),v(),Z=A(),Jt={auto:`Auto (match terminal)`,dark:`Dark mode`,light:`Light mode`,"dark-daltonized":`Dark mode (colorblind-friendly)`,"light-daltonized":`Light mode (colorblind-friendly)`,"dark-ansi":`Dark mode (ANSI colors only)`,"light-ansi":`Light mode (ANSI colors only)`}}));function Xt({onClose:e,context:t,defaultTab:n}){let[r,i]=(0,Q.useState)(n),[a,o]=(0,Q.useState)(!1),[s,c]=(0,Q.useState)(!1),l=gt(),{rows:ee}=mt(De()),te=l?ee+1:Math.max(15,Math.min(Math.floor(ee*.8),30)),[ne]=(0,Q.useState)(()=>kt().catch(()=>[]));return V(),xe(`confirm:no`,()=>{a||e(`Status dialog dismissed`,{display:`system`})},{context:`Settings`,isActive:!a&&!(r===`Config`&&s)}),(0,$.jsx)(k,{color:`permission`,children:(0,$.jsx)(E,{color:`permission`,selectedTab:r,onTabChange:i,hidden:a,initialHeaderFocused:n!==`Config`,contentHeight:a||l?void 0:te,children:[(0,$.jsx)(Ee,{title:`Status`,children:(0,$.jsx)(At,{context:t,diagnosticsPromise:ne})},`status`),(0,$.jsx)(Ee,{title:`Config`,children:(0,$.jsx)(Q.Suspense,{fallback:null,children:(0,$.jsx)(Kt,{context:t,onClose:e,setTabsHidden:o,onIsSearchModeChange:c,contentHeight:te})})},`config`)]})})}var Q,$,Zt=t((()=>{T(),Q=n(T(),1),u(),H(),m(),ht(),D(),Nt(),Yt(),$=A()}));export{Zt as n,Xt as t};
@@ -1 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{$u as t,GC as n,b_ as r,ed as i,ef as a,fS as o,tf as s,uS as c,x_ as l}from"./loadAgentsDir-BL93ulMm.js";import{I as u,P as d,Wt as f,fi as p,t as m}from"./src-P_wYS_NJ2.js";import{t as h}from"./jsx-runtime-Bb4Xn-E0.js";import{$n as g,Wt as _}from"./state-BemZdQIl.js";import{n as v,t as y}from"./cwd-Cfdf7z7s.js";import{f as b,u as x}from"./debug-BecbSVoN.js";import{c as S,g as C}from"./settings-D4CpDv2y.js";import{h as w,n as T,v as E}from"./config-aRiTrtCv.js";import{n as D,r as O}from"./analytics-DJobLaWP.js";import{on as k}from"./prompt-Dx7IWhBt.js";import{n as A,t as j}from"./managedEnvConstants-BPwL2aWI.js";import{n as M,t as N}from"./useExitOnCtrlCDWithKeybindings-DEEJhm_W.js";import{n as P,t as F}from"./PermissionDialog-Cb3z8OUP.js";import{homedir as I}from"os";var L=e(p(),1),R=h();m(),_(),v(),b(),D(),w(),n(),o(),s(),t(),N(),P(),C(),k(),A(),l();function z(e){if(e===null||e.disableAllHooks)return!1;if(e.statusLine||e.fileSuggestion)return!0;if(!e.hooks)return!1;for(let t of Object.values(e.hooks))if(t.length>0)return!0;return!1}function B(){let e=[];return z(S(`projectSettings`))&&e.push(`.claude/settings.json`),z(S(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function V(e){return e.some(e=>e.ruleBehavior===`allow`&&(e.ruleValue.toolName===`Bash`||e.ruleValue.toolName.startsWith(`Bash(`)))}function H(){let e=[];return V(r(`projectSettings`))&&e.push(`.claude/settings.json`),V(r(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function U(e){return!!e?.otelHeadersHelper}function W(){let e=[];return U(S(`projectSettings`))&&e.push(`.claude/settings.json`),U(S(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function G(e){return!!e?.apiKeyHelper}function K(){let e=[];return G(S(`projectSettings`))&&e.push(`.claude/settings.json`),G(S(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function q(e){return!!(e?.awsAuthRefresh||e?.awsCredentialExport)}function J(){let e=[];return q(S(`projectSettings`))&&e.push(`.claude/settings.json`),q(S(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function Y(e){return!!e?.gcpAuthRefresh}function X(){let e=[];return Y(S(`projectSettings`))&&e.push(`.claude/settings.json`),Y(S(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function Z(e){return e?.env?Object.keys(e.env).some(e=>!j.has(e.toUpperCase())):!1}function Q(){let e=[];return Z(S(`projectSettings`))&&e.push(`.claude/settings.json`),Z(S(`localSettings`))&&e.push(`.claude/settings.local.json`),e}k();function $({onDone:e,commands:t}){let{servers:n}=c(`project`),r=Object.keys(n).length>0,o=B().length>0,s=H(),l=K().length>0,p=J().length>0,m=X().length>0,h=W().length>0,_=Q().length>0,v=t?.some(e=>e.type===`prompt`&&e.loadedFrom===`commands_DEPRECATED`&&(e.source===`projectSettings`||e.source===`localSettings`)&&e.allowedTools?.some(e=>e===`Bash`||e.startsWith(`Bash(`)))??!1,b=t?.some(e=>e.type===`prompt`&&(e.loadedFrom===`skills`||e.loadedFrom===`plugin`)&&(e.source===`projectSettings`||e.source===`localSettings`||e.source===`plugin`)&&e.allowedTools?.some(e=>e===`Bash`||e.startsWith(`Bash(`)))??!1,S=s.length>0||v||b,C=T(),[w,D]=L.useState(null);L.useEffect(()=>{if(w!==null){let e=w,t=setTimeout(()=>a(e));return()=>clearTimeout(t)}},[w]),L.useEffect(()=>{O(`tengu_trust_dialog_shown`,{isHomeDir:I()===y(),hasMcpServers:r,hasHooks:o,hasBashExecution:S,hasApiKeyHelper:l,hasAwsCommands:p,hasGcpCommands:m,hasOtelHeadersHelper:h,hasDangerousEnvVars:_})},[r,o,S,l,p,m,h,_]);function k(t){if(t===`exit`){D(1);return}let n=I()===y();O(`tengu_trust_dialog_accept`,{isHomeDir:n,hasMcpServers:r,hasHooks:o,hasBashExecution:S,hasApiKeyHelper:l,hasAwsCommands:p,hasGcpCommands:m,hasOtelHeadersHelper:h,hasDangerousEnvVars:_}),n?g(!0):E(e=>({...e,hasTrustDialogAccepted:!0})),e()}let A=M(()=>D(1));return f(`confirm:no`,()=>{D(0)},{context:`Confirmation`}),w===null?C?(setTimeout(e),null):(0,R.jsx)(F,{color:`warning`,titleColor:`warning`,title:`Accessing workspace:`,children:(0,R.jsxs)(u,{flexDirection:`column`,gap:1,paddingTop:1,children:[(0,R.jsx)(d,{bold:!0,children:x().cwd()}),(0,R.jsx)(d,{children:`Is this a project you trust? (Your own code, a well-known open source project, or work from your team).`}),(0,R.jsx)(d,{children:`Once trusted, Work Mate can read, edit, and run commands in this folder.`}),(0,R.jsx)(i,{options:[{label:`Yes, I trust this folder`,value:`enable_all`},{label:`No, exit`,value:`exit`}],onChange:e=>k(e),onCancel:()=>k(`exit`)}),(0,R.jsx)(d,{dimColor:!0,children:A.pending?(0,R.jsxs)(R.Fragment,{children:[`Press `,A.keyName,` again to exit`]}):(0,R.jsx)(R.Fragment,{children:`Enter to confirm · Esc to cancel`})})]})}):null}export{$ as TrustDialog};
@@ -1 +0,0 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./figures-5ThXQEtq.js";import{FT as i,I as a,L as o,NC as s,PC as c,R as l,RT as u,__ as d,g_ as f,p_ as p}from"./loadAgentsDir-BL93ulMm.js";import{I as m,P as h,di as g,fi as _,t as v,ui as y}from"./src-P_wYS_NJ2.js";import{t as b}from"./jsx-runtime-Bb4Xn-E0.js";import{Wt as x,h as S,in as C}from"./state-BemZdQIl.js";import{n as w,t as T}from"./AddWorkspaceDirectory-ag2JTpmU.js";function E({message:e,args:t,onDone:n}){return(0,O.useEffect)(()=>{let e=setTimeout(n,0);return()=>clearTimeout(e)},[n]),(0,k.jsxs)(m,{flexDirection:`column`,children:[(0,k.jsxs)(h,{dimColor:!0,children:[r.pointer,` /add-dir `,t]}),(0,k.jsx)(s,{children:(0,k.jsx)(h,{children:e})})]})}async function D(e,t,n){let r=(n??``).trim(),o=t.getAppState(),s=async(n,r=!1)=>{let a={type:`addDirectories`,directories:[n],destination:r?`localSettings`:`session`},o=p(t.getAppState().toolPermissionContext,a);t.setAppState(e=>({...e,toolPermissionContext:o}));let s=S();s.includes(n)||C([...s,n]),i.refreshConfig();let c;if(r)try{d(a),c=`Added ${y.bold(n)} as a working directory and saved to local settings`}catch(e){c=`Added ${y.bold(n)} as a working directory. Failed to save to local settings: ${e instanceof Error?e.message:`Unknown error`}`}else c=`Added ${y.bold(n)} as a working directory for this session`;e(`${c} ${y.dim(`· /permissions to manage`)}`)};if(!r)return(0,k.jsx)(T,{permissionContext:o.toolPermissionContext,onAddDirectory:s,onCancel:()=>{e(`Did not add a working directory.`)}});let c=await l(r,o.toolPermissionContext);if(c.resultType!==`success`){let t=a(c);return(0,k.jsx)(E,{message:t,args:n??``,onDone:()=>e(t)})}return(0,k.jsx)(T,{directoryPath:c.absolutePath,permissionContext:o.toolPermissionContext,onAddDirectory:s,onCancel:()=>{e(`Did not add ${y.bold(c.absolutePath)} as a working directory.`)}})}var O,k;e((()=>{g(),n(),O=t(_(),1),x(),c(),w(),v(),f(),u(),o(),k=b()}))();export{D as call};
@@ -1,103 +0,0 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,o as r}from"./envUtils-BDhHQY0-.js";import{n as i,t as a}from"./figures-5ThXQEtq.js";import{$ as o,$l as s,$x as c,AC as l,Ah as u,BE as d,Ba as f,Dh as p,Fh as m,Fp as h,GC as g,Gl as ee,Iu as _,Jl as v,Jp as te,Oh as y,Ph as ne,Pp as b,Pu as re,RE as ie,RS as ae,Sg as oe,Sh as se,Ta as ce,Wl as le,Xp as ue,Ya as de,Yl as fe,Yp as pe,_v as me,_x as he,aE as ge,bv as _e,c as ve,cm as ye,dd as be,dm as xe,eS as Se,ed as Ce,el as we,em as Te,ep as Ee,eu as De,fh as Oe,gx as ke,hx as Ae,im as je,it as Me,jp as Ne,kC as Pe,kh as Fe,kp as Ie,l as Le,lm as Re,nm as ze,np as Be,o as Ve,oE as He,ot as Ue,ph as We,r as Ge,rm as Ke,rp as qe,s as Je,t as Ye,td as Xe,tl as Ze,tm as Qe,tp as $e,tt as et,ud as tt,vx as nt,wg as rt,xg as it,xh as at,xv as ot,zE as st,zS as ct}from"./loadAgentsDir-BL93ulMm.js";import{C as lt,D as x,I as S,P as C,T as w,Wt as T,di as ut,fi as E,t as D,ui as dt,y as ft}from"./src-P_wYS_NJ2.js";import{t as O}from"./jsx-runtime-Bb4Xn-E0.js";import{n as pt,t as mt}from"./cwd-Cfdf7z7s.js";import{F as ht,R as gt,S as _t,U as vt,W as yt,Z as bt,x as xt}from"./debug-BecbSVoN.js";import{J as St,Ln as Ct,Q as wt,Qt as Tt,Rn as Et,Xt as Dt,at as Ot,it as kt,ln as At,sn as jt}from"./settings-D4CpDv2y.js";import{M as Mt,P as Nt}from"./config-aRiTrtCv.js";import{o as Pt,s as Ft}from"./log-Dauqle-Z.js";import{n as It,r as Lt}from"./analytics-DJobLaWP.js";import{C as Rt,v as zt}from"./startupProfiler-CmH_aVy2.js";import{l as Bt,n as Vt,o as Ht}from"./stringUtils-C8PaYpQF.js";import{bn as Ut,yn as Wt}from"./prompt-Dx7IWhBt.js";import{at as Gt}from"./sessionState-D-SaBzWD.js";import{a as Kt,i as qt,n as Jt,o as Yt,r as Xt,t as Zt}from"./agentDisplay-CuSHqgZc.js";import{n as Qt,t as $t}from"./useExitOnCtrlCDWithKeybindings-DEEJhm_W.js";import{n as en,t as tn}from"./useMergedTools-DbhqKk1-.js";import{n as nn,r as rn,t as an}from"./promptEditor-WCkmpejM.js";import{n as on,t as sn}from"./useMainLoopModel-6w7mhwhU.js";import{join as k}from"path";import{mkdir as cn,open as ln,unlink as un}from"fs/promises";var A,dn=e((()=>{A={FOLDER_NAME:`.claude`,AGENTS_DIR:`agents`}}));function fn(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 pn(e){switch(e){case`flagSettings`:throw Error(`Cannot get directory path for ${e} agents`);case`userSettings`:return k(n(),A.AGENTS_DIR);case`projectSettings`:return k(mt(),A.FOLDER_NAME,A.AGENTS_DIR);case`policySettings`:return k(Dt(),A.FOLDER_NAME,A.AGENTS_DIR);case`localSettings`:return k(mt(),A.FOLDER_NAME,A.AGENTS_DIR)}}function mn(e){switch(e){case`projectSettings`:return k(`.`,A.FOLDER_NAME,A.AGENTS_DIR);default:return pn(e)}}function hn(e){return k(pn(e.source),`${e.agentType}.md`)}function gn(e){if(e.source===`built-in`)return`Built-in`;if(e.source===`plugin`)throw Error(`Cannot get file path for plugin agents`);return k(pn(e.source),`${e.filename||e.agentType}.md`)}function _n(e){return e.source===`built-in`?`Built-in`:k(mn(e.source),`${e.agentType}.md`)}function vn(e){return Je(e)?`Built-in`:Le(e)?`Plugin: ${e.plugin||`Unknown`}`:e.source===`flagSettings`?`CLI argument`:k(mn(e.source),`${e.filename||e.agentType}.md`)}async function yn(e){let t=pn(e);return await cn(t,{recursive:!0}),t}async function bn(e,t,n,r,i,a=!0,o,s,c){if(e===`built-in`)throw Error(`Cannot save built-in agents`);await yn(e);let l=hn({source:e,agentType:t}),u=fn(t,n,r,i,o,s,c);try{await Cn(l,u,a?`wx`:`w`)}catch(e){throw ht(e)===`EEXIST`?Error(`Agent file already exists: ${l}`):e}}async function xn(e,t,n,r,i,a,o){if(e.source===`built-in`)throw Error(`Cannot update built-in agents`);await Cn(gn(e),fn(e.agentType,t,n,r,i,a,o))}async function Sn(e){if(e.source===`built-in`)throw Error(`Cannot delete built-in agents`);let t=gn(e);try{await un(t)}catch(e){if(ht(e)!==`ENOENT`)throw e}}async function Cn(e,t,n=`w`){let r=await ln(e,n);try{await r.writeFile(t,{encoding:`utf-8`}),await r.datasync()}finally{await r.close()}}var wn=e((()=>{Tt(),Ve(),pt(),r(),gt(),dn()}));function Tn({agent:e,tools:t,onBack:n}){let r=ue(e,t,!1),i=vn(e),o=ze(e.agentType);T(`confirm:no`,n,{context:`Confirmation`});let s=e=>{e.key===`return`&&(e.preventDefault(),n())};function c(){return r.hasWildcard?(0,j.jsx)(C,{children:`All tools`}):!e.tools||e.tools.length===0?(0,j.jsx)(C,{children:`None`}):(0,j.jsxs)(j.Fragment,{children:[r.validTools.length>0&&(0,j.jsx)(C,{children:r.validTools.join(`, `)}),r.invalidTools.length>0&&(0,j.jsxs)(C,{color:`warning`,children:[a.warning,` Unrecognized: `,r.invalidTools.join(`, `)]})]})}return(0,j.jsxs)(S,{flexDirection:`column`,gap:1,tabIndex:0,autoFocus:!0,onKeyDown:s,children:[(0,j.jsx)(C,{dimColor:!0,children:i}),(0,j.jsxs)(S,{flexDirection:`column`,children:[(0,j.jsxs)(C,{children:[(0,j.jsx)(C,{bold:!0,children:`Description`}),` (tells Claude when to use this agent):`]}),(0,j.jsx)(S,{marginLeft:2,children:(0,j.jsx)(C,{children:e.whenToUse})})]}),(0,j.jsxs)(S,{children:[(0,j.jsxs)(C,{children:[(0,j.jsx)(C,{bold:!0,children:`Tools`}),`:`,` `]}),c()]}),(0,j.jsxs)(C,{children:[(0,j.jsx)(C,{bold:!0,children:`Model`}),`: `,ye(e.model)]}),e.permissionMode&&(0,j.jsxs)(C,{children:[(0,j.jsx)(C,{bold:!0,children:`Permission mode`}),`: `,e.permissionMode]}),e.memory&&(0,j.jsxs)(C,{children:[(0,j.jsx)(C,{bold:!0,children:`Memory`}),`: `,ie(e.memory)]}),e.hooks&&Object.keys(e.hooks).length>0&&(0,j.jsxs)(C,{children:[(0,j.jsx)(C,{bold:!0,children:`Hooks`}),`: `,Object.keys(e.hooks).join(`, `)]}),e.skills&&e.skills.length>0&&(0,j.jsxs)(C,{children:[(0,j.jsx)(C,{bold:!0,children:`Skills`}),`:`,` `,e.skills.length>10?`${e.skills.length} skills`:e.skills.join(`, `)]}),o&&(0,j.jsx)(S,{children:(0,j.jsxs)(C,{children:[(0,j.jsx)(C,{bold:!0,children:`Color`}),`:`,` `,(0,j.jsxs)(C,{backgroundColor:o,color:`inverseText`,children:[` `,e.agentType,` `]})]})}),!Je(e)&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(S,{children:(0,j.jsxs)(C,{children:[(0,j.jsx)(C,{bold:!0,children:`System prompt`}),`:`]})}),(0,j.jsx)(S,{marginLeft:2,marginRight:2,children:(0,j.jsx)(Ie,{children:e.getSystemPrompt()})})]})]})}var j,En=e((()=>{i(),E(),D(),g(),Ke(),st(),pe(),Ve(),xe(),Ne(),wn(),j=O()}));function Dn({agentName:e,currentColor:t=`automatic`,onConfirm:n}){let[r,i]=(0,On.useState)(Math.max(0,kn.indexOf(t))),o=e=>{if(e.key===`up`)e.preventDefault(),i(e=>e>0?e-1:kn.length-1);else if(e.key===`down`)e.preventDefault(),i(e=>e<kn.length-1?e+1:0);else if(e.key===`return`){e.preventDefault();let t=kn[r];n(t===`automatic`?void 0:t)}},s=kn[r];return(0,M.jsxs)(S,{flexDirection:`column`,gap:1,tabIndex:0,autoFocus:!0,onKeyDown:o,children:[(0,M.jsx)(S,{flexDirection:`column`,children:kn.map((e,t)=>{let n=t===r;return(0,M.jsxs)(S,{flexDirection:`row`,gap:1,children:[(0,M.jsx)(C,{color:n?`suggestion`:void 0,children:n?a.pointer:` `}),e===`automatic`?(0,M.jsx)(C,{bold:n,children:`Automatic color`}):(0,M.jsxs)(S,{gap:1,children:[(0,M.jsx)(C,{backgroundColor:Qe[e],color:`inverseText`,children:` `}),(0,M.jsx)(C,{bold:n,children:Vt(e)})]})]},e)})}),(0,M.jsxs)(S,{marginTop:1,children:[(0,M.jsx)(C,{children:`Preview: `}),s===void 0||s===`automatic`?(0,M.jsxs)(C,{inverse:!0,bold:!0,children:[` `,`@`,e,` `]}):(0,M.jsxs)(C,{backgroundColor:Qe[s],color:`inverseText`,bold:!0,children:[` `,`@`,e,` `]})]})]})}var On,M,kn,An=e((()=>{i(),On=t(E(),1),D(),Ke(),Ht(),M=O(),kn=[`automatic`,...Te]}));function jn({initialModel:e,onComplete:t,onCancel:n}){let r=Mn.useMemo(()=>{let t=Re();return e&&!t.some(t=>t.value===e)?[{value:e,label:e,description:`Current model (custom ID)`},...t]:t},[e]);return(0,Nn.jsxs)(S,{flexDirection:`column`,children:[(0,Nn.jsx)(S,{marginBottom:1,children:(0,Nn.jsx)(C,{dimColor:!0,children:`Model determines the agent's reasoning capabilities and speed.`})}),(0,Nn.jsx)(Ce,{options:r,defaultValue:e??`sonnet`,onChange:t,onCancel:()=>n?n():t(void 0)})]})}var Mn,Nn,Pn=e((()=>{Mn=t(E(),1),D(),xe(),Xe(),Nn=O()}));function Fn(){return{READ_ONLY:{name:`Read-only tools`,toolNames:new Set([p.name,Fe.name,le.name,Pe.name,at.name,s.name,v.name,ae.name,he.name])},EDIT:{name:`Edit tools`,toolNames:new Set([Be.name,ne.name,Ee.name])},EXECUTION:{name:`Execution tools`,toolNames:new Set([Oe.name])},MCP:{name:`MCP tools`,toolNames:new Set,isMcp:!0},OTHER:{name:`Other tools`,toolNames:new Set}}}function In(e){let t=new Map;return e.forEach(e=>{if(Se(e)){let n=Ot(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 Ln({tools:e,initialTools:t,onComplete:n,onCancel:r}){let i=(0,N.useMemo)(()=>te({tools:e,isBuiltIn:!1,isAsync:!1}),[e]),[o,s]=(0,N.useState)(!t||t.includes(`*`)?i.map(e=>e.name):t),[c,l]=(0,N.useState)(0),[u,d]=(0,N.useState)(!1),f=(0,N.useMemo)(()=>{let e=new Set(i.map(e=>e.name));return o.filter(t=>e.has(t))},[o,i]),p=new Set(f),m=f.length===i.length&&i.length>0,h=e=>{e&&s(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},g=(e,t)=>{s(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(f.length===e.length&&e.every(e=>f.includes(e))?void 0:f)},_=(0,N.useMemo)(()=>{let e=Fn(),t={readOnly:[],edit:[],execution:[],mcp:[],other:[]};return i.forEach(n=>{Se(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]),v=e=>{let t=Ct(e,e=>p.has(e.name))<e.length;return()=>{let n=e.map(e=>e.name);g(n,t)}},y=[];y.push({id:`continue`,label:`Continue`,action:ee,isContinue:!0}),y.push({id:`bucket-all`,label:`${m?a.checkboxOn:a.checkboxOff} All tools`,action:()=>{let e=i.map(e=>e.name);g(e,!m)}});let ne=Fn();[{id:`bucket-readonly`,name:ne.READ_ONLY.name,tools:_.readOnly},{id:`bucket-edit`,name:ne.EDIT.name,tools:_.edit},{id:`bucket-execution`,name:ne.EXECUTION.name,tools:_.execution},{id:`bucket-mcp`,name:ne.MCP.name,tools:_.mcp},{id:`bucket-other`,name:ne.OTHER.name,tools:_.other}].forEach(({id:e,name:t,tools:n})=>{if(n.length===0)return;let r=Ct(n,e=>p.has(e.name))===n.length;y.push({id:e,label:`${r?a.checkboxOn:a.checkboxOff} ${t}`,action:v(n)})});let b=y.length;y.push({id:`toggle-individual`,label:u?`Hide advanced options`:`Show advanced options`,action:()=>{d(!u),u&&c>b&&l(b)},isToggle:!0});let re=(0,N.useMemo)(()=>In(i),[i]);return u&&(re.length>0&&(y.push({id:`mcp-servers-header`,label:`MCP Servers:`,action:()=>{},isHeader:!0}),re.forEach(({serverName:e,tools:t})=>{let n=Ct(t,e=>p.has(e.name))===t.length;y.push({id:`mcp-server-${e}`,label:`${n?a.checkboxOn:a.checkboxOff} ${e} (${t.length} ${Bt(t.length,`tool`)})`,action:()=>{let e=t.map(e=>e.name);g(e,!n)}})}),y.push({id:`tools-header`,label:`Individual Tools:`,action:()=>{},isHeader:!0})),i.forEach(e=>{let t=e.name;if(e.name.startsWith(`mcp__`)){let n=Ot(e.name);t=n?`${n.toolName} (${n.serverName})`:e.name}y.push({id:`tool-${e.name}`,label:`${p.has(e.name)?a.checkboxOn:a.checkboxOff} ${t}`,action:()=>h(e.name)})})),T(`confirm:no`,(0,N.useCallback)(()=>{r?r():n(t)},[r,n,t]),{context:`Confirmation`}),(0,P.jsxs)(S,{flexDirection:`column`,marginTop:1,tabIndex:0,autoFocus:!0,onKeyDown:e=>{if(e.key===`return`){e.preventDefault();let t=y[c];t&&!t.isHeader&&t.action()}else if(e.key===`up`){e.preventDefault();let t=c-1;for(;t>0&&y[t]?.isHeader;)t--;l(Math.max(0,t))}else if(e.key===`down`){e.preventDefault();let t=c+1;for(;t<y.length-1&&y[t]?.isHeader;)t++;l(Math.min(y.length-1,t))}},children:[(0,P.jsxs)(C,{color:c===0?`suggestion`:void 0,bold:c===0,children:[c===0?`${a.pointer} `:` `,`[ Continue ]`]}),(0,P.jsx)(lt,{width:40}),y.slice(1).map((e,t)=>{let n=t+1===c,r=e.isToggle,i=e.isHeader;return(0,P.jsxs)(N.Fragment,{children:[r&&(0,P.jsx)(lt,{width:40}),i&&t>0&&(0,P.jsx)(S,{marginTop:1}),(0,P.jsxs)(C,{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,P.jsx)(S,{marginTop:1,flexDirection:`column`,children:(0,P.jsx)(C,{dimColor:!0,children:m?`All tools selected`:`${p.size} of ${i.length} tools selected`})})]})}var N,P,Rn=e((()=>{i(),N=t(E(),1),kt(),c(),pe(),wt(),We(),ee(),qe(),l(),m(),y(),u(),ct(),$e(),nt(),fe(),De(),se(),D(),g(),Et(),Ht(),P=O()}));function zn(e){return e===`all`?`Agents`:e===`built-in`?`Built-in agents`:e===`plugin`?`Plugin agents`:ge(jt(e))}var Bn=e((()=>{He(),At()}));function Vn({agent:e,tools:t,onSaved:n,onBack:r}){let i=rt(),[o,s]=(0,F.useState)(`menu`),[c,l]=(0,F.useState)(0),[u,d]=(0,F.useState)(null),[f,p]=(0,F.useState)(e.color),m=(0,F.useCallback)(async()=>{let t=await an(gn(e));t.error?d(t.error):n(`Opened ${e.agentType} in editor. If you made edits, restart to load the latest version.`)},[e,n]),h=(0,F.useCallback)(async(t={})=>{let{tools:r,color:a,model:o}=t,s=a??f,c=r!==void 0,l=o!==void 0,u=s!==e.color;if(!c&&!l&&!u)return!1;try{return!ve(e)&&!Le(e)?!1:(await xn(e,e.whenToUse,r??e.tools,e.getSystemPrompt(),s,o??e.model),u&&s&&je(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:Ge(n),allAgents:n}}}),n(`Updated agent: ${dt.bold(e.agentType)}`),!0)}catch(e){return d(e instanceof Error?e.message:`Failed to save agent`),!1}},[e,f,n,i]),g=(0,F.useMemo)(()=>[{label:`Open in editor`,action:m},{label:`Edit tools`,action:()=>s(`edit-tools`)},{label:`Edit model`,action:()=>s(`edit-model`)},{label:`Edit color`,action:()=>s(`edit-color`)}],[m]),ee=(0,F.useCallback)(()=>{d(null),o===`menu`?r():s(`menu`)},[o,r]),_=(0,F.useCallback)(e=>{if(e.key===`up`)e.preventDefault(),l(e=>Math.max(0,e-1));else if(e.key===`down`)e.preventDefault(),l(e=>Math.min(g.length-1,e+1));else if(e.key===`return`){e.preventDefault();let t=g[c];t&&t.action()}},[g,c]);T(`confirm:no`,ee,{context:`Confirmation`});let v=()=>(0,I.jsxs)(S,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:_,children:[(0,I.jsxs)(C,{dimColor:!0,children:[`Source: `,zn(e.source)]}),(0,I.jsx)(S,{marginTop:1,flexDirection:`column`,children:g.map((e,t)=>(0,I.jsxs)(C,{color:t===c?`suggestion`:void 0,children:[t===c?`${a.pointer} `:` `,e.label]},e.label))}),u&&(0,I.jsx)(S,{marginTop:1,children:(0,I.jsx)(C,{color:`error`,children:u})})]});switch(o){case`menu`:return v();case`edit-tools`:return(0,I.jsx)(Ln,{tools:t,initialTools:e.tools,onComplete:async e=>{s(`menu`),await h({tools:e})}});case`edit-color`:return(0,I.jsx)(Dn,{agentName:e.agentType,currentColor:f||e.color||`automatic`,onConfirm:async e=>{p(e),s(`menu`),await h({color:e})}});case`edit-model`:return(0,I.jsx)(jn,{initialModel:e.model,onComplete:async e=>{s(`menu`),await h({model:e})}});default:return null}}var F,I,Hn=e((()=>{ut(),i(),E(),F=t(E(),1),it(),D(),g(),Ke(),Ve(),rn(),wn(),An(),Pn(),Rn(),Bn(),I=O()}));function Un({instructions:e=`Press ↑↓ to navigate · Enter to select · Esc to go back`}){let t=Qt();return(0,Wn.jsx)(S,{marginLeft:2,children:(0,Wn.jsx)(C,{dimColor:!0,children:t.pending?`Press ${t.keyName} again to exit`:e})})}var Wn,Gn=e((()=>{E(),$t(),D(),Wn=O()}));function Kn({source:e,agents:t,onBack:n,onSelect:r,onCreateNew:i,changes:o}){let[s,c]=qn.useState(null),[l,u]=qn.useState(!0),d=qn.useMemo(()=>[...t].sort(Jt),[t]),f=e=>({isOverridden:!!e.overriddenBy,overriddenBy:e.overriddenBy||null}),p=()=>(0,L.jsxs)(S,{children:[(0,L.jsx)(C,{color:l?`suggestion`:void 0,children:l?`${a.pointer} `:` `}),(0,L.jsx)(C,{color:l?`suggestion`:void 0,children:`Create new agent`})]}),m=e=>{let t=e.source===`built-in`,n=!t&&!l&&s?.agentType===e.agentType&&s?.source===e.source,{isOverridden:r,overriddenBy:i}=f(e),o=t||r,c=!t&&n?`suggestion`:void 0,u=Kt(e);return(0,L.jsxs)(S,{children:[(0,L.jsx)(C,{dimColor:o&&!n,color:c,children:t?``:n?`${a.pointer} `:` `}),(0,L.jsx)(C,{dimColor:o&&!n,color:c,children:e.agentType}),u&&(0,L.jsxs)(C,{dimColor:!0,color:c,children:[` · `,u]}),e.memory&&(0,L.jsxs)(C,{dimColor:!0,color:c,children:[` · `,e.memory,` memory`]}),i&&(0,L.jsxs)(C,{dimColor:!n,color:n?`warning`:void 0,children:[` `,a.warning,` shadowed by `,Xt(i)]})]},`${e.agentType}-${e.source}`)},h=qn.useMemo(()=>{let t=d.filter(e=>e.source!==`built-in`);return e===`all`?Zt.filter(e=>e.source!==`built-in`).flatMap(({source:e})=>t.filter(t=>t.source===e)):t},[d,e]);qn.useEffect(()=>{!s&&!l&&h.length>0&&(i?u(!0):c(h[0]||null))},[h,s,l,i]);let g=e=>{if(e.key===`return`){e.preventDefault(),l&&i?i():s&&r(s);return}if(e.key!==`up`&&e.key!==`down`)return;e.preventDefault();let t=!!i,n=h.length+ +!!t;if(n===0)return;let a=0;if(!l&&s){let e=h.findIndex(e=>e.agentType===s.agentType&&e.source===s.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)u(!0),c(null);else{let e=t?o-1:o,n=h[e];n&&(u(!1),c(n))}},ee=(e=`Built-in (always available):`)=>{let t=d.filter(e=>e.source===`built-in`);return(0,L.jsxs)(S,{flexDirection:`column`,marginBottom:1,paddingLeft:2,children:[(0,L.jsx)(C,{bold:!0,dimColor:!0,children:e}),t.map(m)]})},_=(e,t)=>{if(!t.length)return null;let n=t[0]?.baseDir;return(0,L.jsxs)(S,{flexDirection:`column`,marginBottom:1,children:[(0,L.jsxs)(S,{paddingLeft:2,children:[(0,L.jsx)(C,{bold:!0,dimColor:!0,children:e}),n&&(0,L.jsxs)(C,{dimColor:!0,children:[` (`,n,`)`]})]}),t.map(e=>m(e))]})},v=zn(e),te=d.filter(e=>e.source===`built-in`);return!d.length||e!==`built-in`&&!d.some(e=>e.source!==`built-in`)?(0,L.jsx)(ft,{title:v,subtitle:`No agents found`,onCancel:n,hideInputGuide:!0,children:(0,L.jsxs)(S,{flexDirection:`column`,gap:1,tabIndex:0,autoFocus:!0,onKeyDown:g,children:[i&&(0,L.jsx)(S,{children:p()}),(0,L.jsx)(C,{dimColor:!0,children:`No agents found. Create specialized subagents that Claude can delegate to.`}),(0,L.jsx)(C,{dimColor:!0,children:`Each subagent has its own context window, custom system prompt, and specific tools.`}),(0,L.jsx)(C,{dimColor:!0,children:`Try creating: Code Reviewer, Code Simplifier, Security Reviewer, Tech Lead, or UX Reviewer.`}),e!==`built-in`&&d.some(e=>e.source===`built-in`)&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(lt,{}),ee()]})]})}):(0,L.jsxs)(ft,{title:v,subtitle:`${Ct(d,e=>!e.overriddenBy)} agents`,onCancel:n,hideInputGuide:!0,children:[o&&o.length>0&&(0,L.jsx)(S,{marginTop:1,children:(0,L.jsx)(C,{dimColor:!0,children:o[o.length-1]})}),(0,L.jsxs)(S,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:g,children:[i&&(0,L.jsx)(S,{marginBottom:1,children:p()}),e===`all`?(0,L.jsxs)(L.Fragment,{children:[Zt.filter(e=>e.source!==`built-in`).map(({label:e,source:t})=>(0,L.jsx)(qn.Fragment,{children:_(e,d.filter(e=>e.source===t))},t)),te.length>0&&(0,L.jsxs)(S,{flexDirection:`column`,marginBottom:1,paddingLeft:2,children:[(0,L.jsxs)(C,{dimColor:!0,children:[(0,L.jsx)(C,{bold:!0,children:`Built-in agents`}),` (always available)`]}),te.map(m)]})]}):e===`built-in`?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(C,{dimColor:!0,italic:!0,children:`Built-in agents are provided by default and cannot be modified.`}),(0,L.jsx)(S,{marginTop:1,flexDirection:`column`,children:d.map(e=>m(e))})]}):(0,L.jsxs)(L.Fragment,{children:[d.filter(e=>e.source!==`built-in`).map(e=>m(e)),d.some(e=>e.source===`built-in`)&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(lt,{}),ee()]})]})]})]})}var qn,L,Jn=e((()=>{i(),qn=t(E(),1),D(),qt(),Et(),Bn(),L=O()}));function Yn({steps:e,initialData:t={},onComplete:n,onCancel:r,children:i,title:a,showStepCounter:o=!0}){let[s,c]=(0,R.useState)(0),[l,u]=(0,R.useState)(t),[d,f]=(0,R.useState)(!1),[p,m]=(0,R.useState)([]);Qt(),(0,R.useEffect)(()=>{d&&(m([]),n(l))},[d,l,n]);let h=(0,R.useCallback)(()=>{s<e.length-1?(p.length>0&&m(e=>[...e,s]),c(e=>e+1)):f(!0)},[s,e.length,p]),g=(0,R.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]),ee=(0,R.useCallback)(t=>{t>=0&&t<e.length&&(m(e=>[...e,s]),c(t))},[s,e.length]),_=(0,R.useCallback)(()=>{m([]),r&&r()},[r]),v=(0,R.useCallback)(e=>{u(t=>({...t,...e}))},[]),te=(0,R.useMemo)(()=>({currentStepIndex:s,totalSteps:e.length,wizardData:l,setWizardData:u,updateWizardData:v,goNext:h,goBack:g,goToStep:ee,cancel:_,title:a,showStepCounter:o}),[s,e.length,l,v,h,g,ee,_,a,o]),y=e[s];return!y||d?null:(0,Xn.jsx)(Zn.Provider,{value:te,children:i||(0,Xn.jsx)(y,{})})}var R,Xn,Zn,Qn=e((()=>{R=t(E(),1),$t(),Xn=O(),Zn=(0,R.createContext)(null)}));function z(){let e=(0,$n.useContext)(Zn);if(!e)throw Error(`useWizard must be used within a WizardProvider`);return e}var $n,er=e((()=>{$n=t(E(),1),Qn()}));function tr({instructions:e=(0,nr.jsxs)(w,{children:[(0,nr.jsx)(x,{shortcut:`↑↓`,action:`navigate`}),(0,nr.jsx)(x,{shortcut:`Enter`,action:`select`}),(0,nr.jsx)(b,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]})}){let t=Qt();return(0,nr.jsx)(S,{marginLeft:3,marginTop:1,children:(0,nr.jsx)(C,{dimColor:!0,children:t.pending?`Press ${t.keyName} again to exit`:e})})}var nr,rr=e((()=>{$t(),D(),h(),nr=O()}));function B({title:e,color:t=`suggestion`,children:n,subtitle:r,footerText:i}){let{currentStepIndex:a,totalSteps:o,title:s,showStepCounter:c,goBack:l}=z();return(0,ir.jsxs)(ir.Fragment,{children:[(0,ir.jsx)(ft,{title:`${e||s||`Wizard`}${c===!1?``:` (${a+1}/${o})`}`,subtitle:r,onCancel:l,color:t,hideInputGuide:!0,isCancelActive:!1,children:n}),(0,ir.jsx)(tr,{instructions:i})]})}var ir,V=e((()=>{D(),er(),rr(),ir=O()})),H=e((()=>{er(),V(),rr(),Qn()}));function ar(){let{goNext:e,goBack:t,updateWizardData:n,wizardData:r}=z();return T(`confirm:no`,t,{context:`Confirmation`}),(0,U.jsx)(B,{subtitle:`Choose background color`,footerText:(0,U.jsxs)(w,{children:[(0,U.jsx)(x,{shortcut:`↑↓`,action:`navigate`}),(0,U.jsx)(x,{shortcut:`Enter`,action:`select`}),(0,U.jsx)(b,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:(0,U.jsx)(S,{children:(0,U.jsx)(Dn,{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 U,or=e((()=>{D(),g(),h(),H(),V(),An(),U=O()}));function sr(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 cr(e,t,n){let r=[],i=[];if(!e.agentType)r.push(`Agent type is required`);else{let t=sr(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 ${zn(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=ue(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 lr=e((()=>{pe(),Bn()}));function ur({tools:e,existingAgents:t,onSave:n,onSaveAndEdit:r,error:i}){let{goBack:a,wizardData:o}=z();T(`confirm:no`,a,{context:`Confirmation`});let s=e=>{e.key===`s`||e.key===`return`?(e.preventDefault(),n()):e.key===`e`&&(e.preventDefault(),r())},c=o.finalAgent,l=cr(c,e,t),u=Rt(c.getSystemPrompt(),240),d=Rt(c.whenToUse,240),f=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]}`,p=Nt()?(0,W.jsxs)(C,{children:[(0,W.jsx)(C,{bold:!0,children:`Memory`}),`: `,ie(c.memory)]}):null;return(0,W.jsx)(B,{subtitle:`Confirm and save`,footerText:(0,W.jsxs)(w,{children:[(0,W.jsx)(x,{shortcut:`s/Enter`,action:`save`}),(0,W.jsx)(x,{shortcut:`e`,action:`edit in your editor`}),(0,W.jsx)(b,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]}),children:(0,W.jsxs)(S,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:s,children:[(0,W.jsxs)(C,{children:[(0,W.jsx)(C,{bold:!0,children:`Name`}),`: `,c.agentType]}),(0,W.jsxs)(C,{children:[(0,W.jsx)(C,{bold:!0,children:`Location`}),`:`,` `,_n({source:o.location,agentType:c.agentType})]}),(0,W.jsxs)(C,{children:[(0,W.jsx)(C,{bold:!0,children:`Tools`}),`: `,f(c.tools)]}),(0,W.jsxs)(C,{children:[(0,W.jsx)(C,{bold:!0,children:`Model`}),`: `,ye(c.model)]}),p,(0,W.jsx)(S,{marginTop:1,children:(0,W.jsxs)(C,{children:[(0,W.jsx)(C,{bold:!0,children:`Description`}),` (tells Claude when to use this agent):`]})}),(0,W.jsx)(S,{marginLeft:2,marginTop:1,children:(0,W.jsx)(C,{children:d})}),(0,W.jsx)(S,{marginTop:1,children:(0,W.jsxs)(C,{children:[(0,W.jsx)(C,{bold:!0,children:`System prompt`}),`:`]})}),(0,W.jsx)(S,{marginLeft:2,marginTop:1,children:(0,W.jsx)(C,{children:u})}),l.warnings.length>0&&(0,W.jsxs)(S,{marginTop:1,flexDirection:`column`,children:[(0,W.jsx)(C,{color:`warning`,children:`Warnings:`}),l.warnings.map((e,t)=>(0,W.jsxs)(C,{dimColor:!0,children:[` `,`• `,e]},t))]}),l.errors.length>0&&(0,W.jsxs)(S,{marginTop:1,flexDirection:`column`,children:[(0,W.jsx)(C,{color:`error`,children:`Errors:`}),l.errors.map((e,t)=>(0,W.jsxs)(C,{color:`error`,children:[` `,`• `,e]},t))]}),i&&(0,W.jsx)(S,{marginTop:1,children:(0,W.jsx)(C,{color:`error`,children:i})}),(0,W.jsx)(S,{marginTop:2,children:(0,W.jsxs)(C,{color:`success`,children:[`Press `,(0,W.jsx)(C,{bold:!0,children:`s`}),` or `,(0,W.jsx)(C,{bold:!0,children:`Enter`}),` to save, `,(0,W.jsx)(C,{bold:!0,children:`e`}),` to save and edit`]})})]})})}var W,dr=e((()=>{D(),g(),Mt(),st(),zt(),xe(),h(),H(),V(),wn(),lr(),W=O()}));function fr({tools:e,existingAgents:t,onComplete:n}){let{wizardData:r}=z(),[i,a]=(0,pr.useState)(null),o=rt(),s=(0,pr.useCallback)(async e=>{if(r?.finalAgent)try{await bn(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:Ge(t),allAgents:t}}}),Ye(),e&&await an(hn({source:r.location,agentType:r.finalAgent.agentType})),Lt(`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: ${dt.bold(r.finalAgent.agentType)} and opened in editor. If you made edits, restart to load the latest version.`:`Created agent: ${dt.bold(r.finalAgent.agentType)}`)}catch(e){a(e instanceof Error?e.message:`Failed to save agent`)}},[r,n,o]);return(0,mr.jsx)(ur,{tools:e,existingAgents:t,onSave:(0,pr.useCallback)(()=>s(!1),[s]),onSaveAndEdit:(0,pr.useCallback)(()=>s(!0),[s]),error:i})}var pr,mr,hr=e((()=>{ut(),pr=t(E(),1),It(),it(),Ve(),rn(),H(),wn(),dr(),mr=O()}));function gr(){let{goNext:e,goBack:t,updateWizardData:n,wizardData:r}=z(),[i,a]=(0,_r.useState)(r.whenToUse||``),[o,s]=(0,_r.useState)(i.length),[c,l]=(0,_r.useState)(null);return T(`confirm:no`,t,{context:`Settings`}),T(`chat:externalEditor`,(0,_r.useCallback)(async()=>{let e=await nn(i);e.content!==null&&(a(e.content),s(e.content.length))},[i]),{context:`Chat`}),(0,G.jsx)(B,{subtitle:`Description (tell Claude when to use this agent)`,footerText:(0,G.jsxs)(w,{children:[(0,G.jsx)(x,{shortcut:`Type`,action:`enter text`}),(0,G.jsx)(x,{shortcut:`Enter`,action:`continue`}),(0,G.jsx)(b,{action:`chat:externalEditor`,context:`Chat`,fallback:`ctrl+g`,description:`open in editor`}),(0,G.jsx)(b,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`go back`})]}),children:(0,G.jsxs)(S,{flexDirection:`column`,children:[(0,G.jsx)(C,{children:`When should Claude use this agent?`}),(0,G.jsx)(S,{marginTop:1,children:(0,G.jsx)(tt,{value:i,onChange:a,onSubmit:t=>{let r=t.trim();if(!r){l(`Description is required`);return}l(null),n({whenToUse:r}),e()},placeholder:`e.g., use this agent after you're done writing code...`,columns:80,cursorOffset:o,onChangeCursorOffset:s,focus:!0,showCursor:!0})}),c&&(0,G.jsx)(S,{marginTop:1,children:(0,G.jsx)(C,{color:`error`,children:c})})]})})}var _r,G,vr=e((()=>{_r=t(E(),1),D(),g(),rn(),h(),be(),H(),V(),G=O()}));async function yr(e,t,n,r){let i=ce({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 _e(),o=Ue([i],a),s=Nt()?br+xr:br,c=await et({messages:de(o),systemPrompt:Gt([s]),thinkingConfig:{type:`disabled`},tools:[],signal:r,options:{getToolPermissionContext:async()=>Wt(),model:t,toolChoice:void 0,agents:[],isNonInteractiveSession:!1,hasAppendSystemPrompt:!1,querySource:`agent_creation`,mcpTools:[]}}),l=(Array.isArray(c.message.content)?c.message.content:[]).filter(e=>e.type===`text`).map(e=>e.text).join(`
9
- `),u;try{u=_t(l.trim())}catch{let e=l.match(/\{[\s\S]*\}/);if(!e)throw Error(`No JSON object found in response`);u=_t(e[0])}if(!u.identifier||!u.whenToUse||!u.systemPrompt)throw Error(`Invalid agent configuration generated`);return Lt(`tengu_agent_definition_generated`,{agent_identifier:u.identifier}),{identifier:u.identifier,whenToUse:u.whenToUse,systemPrompt:u.systemPrompt}}var br,xr,Sr=e((()=>{ot(),o(),Ut(),wt(),Me(),f(),Mt(),It(),xt(),me(),br=`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 ${St} 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 ${St} 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
- `,xr=`
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 Cr(){let{updateWizardData:e,goBack:t,goToStep:n,wizardData:r}=z(),[i,a]=(0,K.useState)(r.generationPrompt||``),[o,s]=(0,K.useState)(!1),[c,l]=(0,K.useState)(null),[u,d]=(0,K.useState)(i.length),f=on(),p=(0,K.useRef)(null);T(`confirm:no`,(0,K.useCallback)(()=>{p.current&&(p.current.abort(),p.current=null,s(!1),l(`Generation cancelled`))},[]),{context:`Settings`,isActive:o}),T(`chat:externalEditor`,(0,K.useCallback)(async()=>{let e=await nn(i);e.content!==null&&(a(e.content),d(e.content.length))},[i]),{context:`Chat`,isActive:!o}),T(`confirm:no`,(0,K.useCallback)(()=>{e({generationPrompt:``,agentType:``,systemPrompt:``,whenToUse:``,generatedAgent:void 0,wasGenerated:!1}),a(``),l(null),t()},[e,t]),{context:`Settings`,isActive:!o});let m=async()=>{let t=i.trim();if(!t){l(`Please describe what the agent should do`);return}l(null),s(!0),e({generationPrompt:t,isGenerating:!0});let r=Ae();p.current=r;try{let i=await yr(t,f,[],r.signal);e({agentType:i.identifier,whenToUse:i.whenToUse,systemPrompt:i.systemPrompt,generatedAgent:i,isGenerating:!1,wasGenerated:!0}),n(6)}catch(t){t instanceof bt||t instanceof Error&&!t.message.includes(`No assistant message found`)&&l(t.message||`Failed to generate agent`),e({isGenerating:!1})}finally{s(!1),p.current=null}},h=`Describe what this agent should do and when it should be used (be comprehensive for best results)`;return o?(0,q.jsx)(B,{subtitle:h,footerText:(0,q.jsx)(b,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`}),children:(0,q.jsxs)(S,{flexDirection:`row`,alignItems:`center`,children:[(0,q.jsx)(re,{}),(0,q.jsx)(C,{color:`suggestion`,children:` Generating agent from description...`})]})}):(0,q.jsx)(B,{subtitle:h,footerText:(0,q.jsxs)(w,{children:[(0,q.jsx)(b,{action:`confirm:yes`,context:`Confirmation`,fallback:`Enter`,description:`submit`}),(0,q.jsx)(b,{action:`chat:externalEditor`,context:`Chat`,fallback:`ctrl+g`,description:`open in editor`}),(0,q.jsx)(b,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`go back`})]}),children:(0,q.jsxs)(S,{flexDirection:`column`,children:[c&&(0,q.jsx)(S,{marginBottom:1,children:(0,q.jsx)(C,{color:`error`,children:c})}),(0,q.jsx)(tt,{value:i,onChange:a,onSubmit:m,placeholder:`e.g., Help me write unit tests for my code...`,columns:80,cursorOffset:u,onChangeCursorOffset:d,focus:!0,showCursor:!0})]})})}var K,q,wr=e((()=>{yt(),K=t(E(),1),sn(),D(),g(),ke(),rn(),h(),_(),be(),H(),V(),Sr(),q=O()}));function Tr(){let{goNext:e,updateWizardData:t,cancel:n}=z();return(0,J.jsx)(B,{subtitle:`Choose location`,footerText:(0,J.jsxs)(w,{children:[(0,J.jsx)(x,{shortcut:`↑↓`,action:`navigate`}),(0,J.jsx)(x,{shortcut:`Enter`,action:`select`}),(0,J.jsx)(b,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]}),children:(0,J.jsx)(S,{children:(0,J.jsx)(Ce,{options:[{label:`Project (.claude/agents/)`,value:`projectSettings`},{label:`Personal (~/.claude/agents/)`,value:`userSettings`}],onChange:n=>{t({location:n}),e()},onCancel:()=>n()},`location-select`)})})}var J,Er=e((()=>{D(),h(),Xe(),H(),V(),J=O()}));function Dr(){let{goNext:e,goBack:t,updateWizardData:n,wizardData:r}=z();T(`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,Y.jsx)(B,{subtitle:`Configure agent memory`,footerText:(0,Y.jsxs)(w,{children:[(0,Y.jsx)(x,{shortcut:`↑↓`,action:`navigate`}),(0,Y.jsx)(x,{shortcut:`Enter`,action:`select`}),(0,Y.jsx)(b,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:(0,Y.jsx)(S,{children:(0,Y.jsx)(Ce,{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:Nt()&&i&&a?()=>r.systemPrompt+`
101
-
102
- `+d(a,i):()=>r.systemPrompt}:void 0}),e()},onCancel:t},`memory-select`)})})}var Y,Or=e((()=>{D(),g(),Mt(),st(),h(),Xe(),H(),V(),Y=O()}));function kr(){let{goNext:e,goBack:t,updateWizardData:n,goToStep:r}=z();return(0,X.jsx)(B,{subtitle:`Creation method`,footerText:(0,X.jsxs)(w,{children:[(0,X.jsx)(x,{shortcut:`↑↓`,action:`navigate`}),(0,X.jsx)(x,{shortcut:`Enter`,action:`select`}),(0,X.jsx)(b,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:(0,X.jsx)(S,{children:(0,X.jsx)(Ce,{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 X,Ar=e((()=>{D(),h(),Xe(),H(),V(),X=O()}));function jr(){let{goNext:e,goBack:t,updateWizardData:n,wizardData:r}=z();return(0,Mr.jsx)(B,{subtitle:`Select model`,footerText:(0,Mr.jsxs)(w,{children:[(0,Mr.jsx)(x,{shortcut:`↑↓`,action:`navigate`}),(0,Mr.jsx)(x,{shortcut:`Enter`,action:`select`}),(0,Mr.jsx)(b,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:(0,Mr.jsx)(jn,{initialModel:r.selectedModel,onComplete:t=>{n({selectedModel:t}),e()},onCancel:t})})}var Mr,Nr=e((()=>{h(),D(),H(),V(),Pn(),Mr=O()}));function Pr(){let{goNext:e,goBack:t,updateWizardData:n,wizardData:r}=z(),[i,a]=(0,Fr.useState)(r.systemPrompt||``),[o,s]=(0,Fr.useState)(i.length),[c,l]=(0,Fr.useState)(null);return T(`confirm:no`,t,{context:`Settings`}),T(`chat:externalEditor`,(0,Fr.useCallback)(async()=>{let e=await nn(i);e.content!==null&&(a(e.content),s(e.content.length))},[i]),{context:`Chat`}),(0,Z.jsx)(B,{subtitle:`System prompt`,footerText:(0,Z.jsxs)(w,{children:[(0,Z.jsx)(x,{shortcut:`Type`,action:`enter text`}),(0,Z.jsx)(x,{shortcut:`Enter`,action:`continue`}),(0,Z.jsx)(b,{action:`chat:externalEditor`,context:`Chat`,fallback:`ctrl+g`,description:`open in editor`}),(0,Z.jsx)(b,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`go back`})]}),children:(0,Z.jsxs)(S,{flexDirection:`column`,children:[(0,Z.jsx)(C,{children:`Enter the system prompt for your agent:`}),(0,Z.jsx)(C,{dimColor:!0,children:`Be comprehensive for best results`}),(0,Z.jsx)(S,{marginTop:1,children:(0,Z.jsx)(tt,{value:i,onChange:a,onSubmit:()=>{let t=i.trim();if(!t){l(`System prompt is required`);return}l(null),n({systemPrompt:t}),e()},placeholder:`You are a helpful code reviewer who...`,columns:80,cursorOffset:o,onChangeCursorOffset:s,focus:!0,showCursor:!0})}),c&&(0,Z.jsx)(S,{marginTop:1,children:(0,Z.jsx)(C,{color:`error`,children:c})})]})})}var Fr,Z,Ir=e((()=>{Fr=t(E(),1),D(),g(),rn(),h(),be(),H(),V(),Z=O()}));function Lr({tools:e}){let{goNext:t,goBack:n,updateWizardData:r,wizardData:i}=z(),a=e=>{r({selectedTools:e}),t()},o=i.selectedTools;return(0,Rr.jsx)(B,{subtitle:`Select tools`,footerText:(0,Rr.jsxs)(w,{children:[(0,Rr.jsx)(x,{shortcut:`Enter`,action:`toggle selection`}),(0,Rr.jsx)(x,{shortcut:`↑↓`,action:`navigate`}),(0,Rr.jsx)(b,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:(0,Rr.jsx)(Ln,{tools:e,initialTools:o,onComplete:a,onCancel:n})})}var Rr,zr=e((()=>{D(),h(),H(),V(),Rn(),Rr=O()}));function Br(e){let{goNext:t,goBack:n,updateWizardData:r,wizardData:i}=z(),[a,o]=(0,Vr.useState)(i.agentType||``),[s,c]=(0,Vr.useState)(null),[l,u]=(0,Vr.useState)(a.length);return T(`confirm:no`,n,{context:`Settings`}),(0,Q.jsx)(B,{subtitle:`Agent type (identifier)`,footerText:(0,Q.jsxs)(w,{children:[(0,Q.jsx)(x,{shortcut:`Type`,action:`enter text`}),(0,Q.jsx)(x,{shortcut:`Enter`,action:`continue`}),(0,Q.jsx)(b,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`go back`})]}),children:(0,Q.jsxs)(S,{flexDirection:`column`,children:[(0,Q.jsx)(C,{children:`Enter a unique identifier for your agent:`}),(0,Q.jsx)(S,{marginTop:1,children:(0,Q.jsx)(tt,{value:a,onChange:o,onSubmit:e=>{let n=e.trim(),i=sr(n);if(i){c(i);return}c(null),r({agentType:n}),t()},placeholder:`e.g., test-runner, tech-lead, etc`,columns:60,cursorOffset:l,onChangeCursorOffset:u,focus:!0,showCursor:!0})}),s&&(0,Q.jsx)(S,{marginTop:1,children:(0,Q.jsx)(C,{color:`error`,children:s})})]})})}var Vr,Q,Hr=e((()=>{Vr=t(E(),1),D(),g(),h(),be(),H(),V(),lr(),Q=O()}));function Ur({tools:e,existingAgents:t,onComplete:n,onCancel:r}){return(0,Wr.jsx)(Yn,{steps:[Tr,kr,Cr,()=>(0,Wr.jsx)(Br,{existingAgents:t}),Pr,gr,()=>(0,Wr.jsx)(Lr,{tools:e}),jr,ar,...Nt()?[Dr]:[],()=>(0,Wr.jsx)(fr,{tools:e,existingAgents:t,onComplete:n})],initialData:{},onComplete:()=>{},onCancel:r,title:`Create new agent`,showStepCounter:!1})}var Wr,Gr=e((()=>{Mt(),H(),or(),hr(),vr(),wr(),Er(),Or(),Ar(),Nr(),Ir(),zr(),Hr(),Wr=O()}));function Kr({tools:e,onExit:t}){let[n,r]=(0,qr.useState)({mode:`list-agents`,source:`all`}),i=oe(e=>e.agentDefinitions),a=oe(e=>e.mcp.tools),o=oe(e=>e.toolPermissionContext),s=rt(),{allAgents:c,activeAgents:l}=i,[u,d]=(0,qr.useState)([]),f=en(e,a,o);Qt();let p=(0,qr.useMemo)(()=>({"built-in":c.filter(e=>e.source===`built-in`),userSettings:c.filter(e=>e.source===`userSettings`),projectSettings:c.filter(e=>e.source===`projectSettings`),policySettings:c.filter(e=>e.source===`policySettings`),localSettings:c.filter(e=>e.source===`localSettings`),flagSettings:c.filter(e=>e.source===`flagSettings`),plugin:c.filter(e=>e.source===`plugin`),all:c}),[c]),m=(0,qr.useCallback)(e=>{d(t=>[...t,e]),r({mode:`list-agents`,source:`all`})},[]),h=(0,qr.useCallback)(async e=>{try{await Sn(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:Ge(n)}}}),d(t=>[...t,`Deleted agent: ${dt.bold(e.agentType)}`]),r({mode:`list-agents`,source:`all`})}catch(e){Ft(vt(e))}},[s]);switch(n.mode){case`list-agents`:{let e=Yt(n.source===`all`?[...p[`built-in`],...p.userSettings,...p.projectSettings,...p.localSettings,...p.policySettings,...p.flagSettings,...p.plugin]:p[n.source],l);return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Kn,{source:n.source,agents:e,onBack:()=>{t((u.length>0?`Agent changes:\n${u.join(`
103
- `)}`:void 0)??`Agents dialog dismissed`,{display:u.length===0?`system`:void 0})},onSelect:e=>r({mode:`agent-menu`,agent:e,previousMode:n}),onCreateNew:()=>r({mode:`create-agent`}),changes:u}),(0,$.jsx)(Un,{})]})}case`create-agent`:return(0,$.jsx)(Ur,{tools:f,existingAgents:l,onComplete:m,onCancel:()=>r({mode:`list-agents`,source:`all`})});case`agent-menu`:{let e=c.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)(ft,{title:n.agent.agentType,onCancel:()=>r(n.previousMode),hideInputGuide:!0,children:(0,$.jsxs)(S,{flexDirection:`column`,children:[(0,$.jsx)(Ce,{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)}),u.length>0&&(0,$.jsx)(S,{marginTop:1,children:(0,$.jsx)(C,{dimColor:!0,children:u[u.length-1]})})]})}),(0,$.jsx)(Un,{})]})}case`view-agent`:{let e=c.find(e=>e.agentType===n.agent.agentType&&e.source===n.agent.source)||n.agent;return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(ft,{title:e.agentType,onCancel:()=>r({mode:`agent-menu`,agent:e,previousMode:n.previousMode}),hideInputGuide:!0,children:(0,$.jsx)(Tn,{agent:e,tools:f,allAgents:c,onBack:()=>r({mode:`agent-menu`,agent:e,previousMode:n.previousMode})})}),(0,$.jsx)(Un,{instructions:`Press Enter or Esc to go back`})]})}case`delete-confirm`:return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(ft,{title:`Delete agent`,onCancel:()=>{`previousMode`in n&&r(n.previousMode)},color:`error`,children:[(0,$.jsxs)(C,{children:[`Are you sure you want to delete the agent `,(0,$.jsx)(C,{bold:!0,children:n.agent.agentType}),`?`]}),(0,$.jsx)(S,{marginTop:1,children:(0,$.jsxs)(C,{dimColor:!0,children:[`Source: `,n.agent.source]})}),(0,$.jsx)(S,{marginTop:1,children:(0,$.jsx)(Ce,{options:[{label:`Yes, delete`,value:`yes`},{label:`No, cancel`,value:`no`}],onChange:e=>{e===`yes`?h(n.agent):`previousMode`in n&&r(n.previousMode)},onCancel:()=>{`previousMode`in n&&r(n.previousMode)}})})]}),(0,$.jsx)(Un,{instructions:`Press ↑↓ to navigate, Enter to select, Esc to cancel`})]});case`edit-agent`:{let e=c.find(e=>e.agentType===n.agent.agentType&&e.source===n.agent.source)||n.agent;return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(ft,{title:`Edit agent: ${e.agentType}`,onCancel:()=>r(n.previousMode),hideInputGuide:!0,children:(0,$.jsx)(Vn,{agent:e,tools:f,onSaved:e=>{m(e),r(n.previousMode)},onBack:()=>r(n.previousMode)})}),(0,$.jsx)(Un,{})]})}default:return null}}var qr,$,Jr=e((()=>{ut(),E(),qr=t(E(),1),$t(),tn(),D(),it(),qt(),Ve(),gt(),Pt(),Xe(),En(),Hn(),Gn(),Jn(),wn(),Gr(),$=O()}));async function Yr(e,t){let n=t.getAppState().toolPermissionContext;return(0,Xr.jsx)(Kr,{tools:we(n),onExit:e})}var Xr;e((()=>{E(),Jr(),Ze(),Xr=O()}))();export{Yr as call};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{fS as t,uS as n}from"./loadAgentsDir-BL93ulMm.js";import{g as r,u as i}from"./settings-D4CpDv2y.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};
@@ -1 +0,0 @@
1
- import{a as e,o as t}from"./api-BbJfMXRS.js";t();export{e as getOAuthHeaders};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./auth-7mJGtlZp.js";export{t as authLogin,e as authStatus};
@@ -1 +0,0 @@
1
- import{Bt as e,It as t,Ot as n,mt as r,yt as i}from"./model-Bgh_r4lg.js";e();export{r as checkAndRefreshOAuthTokenIfNeeded,i as clearOAuthTokenCache,n as getClaudeAIOAuthTokens,t as handleOAuth401Error};
@@ -1,15 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,o as n}from"./envUtils-BDhHQY0-.js";import{Bm as r,C as i,Cl as a,Cy as ee,E as o,Fm as s,Gm as c,Hm as l,Im as u,Km as d,Lm as f,Pm as p,Py as m,Rm as h,Sl as g,Um as _,Vm as v,Wm as y,ky as te,wl as ne,x as re,zm as ie}from"./loadAgentsDir-BL93ulMm.js";import{Wt as ae,it as oe}from"./state-BemZdQIl.js";import{o as se}from"./log-Dauqle-Z.js";import{s as ce,u as le}from"./types-DafcFtmb.js";import{a as ue,n as b,o as x,t as S}from"./bridgeConfig-UgaUfuP6.js";import{i as C,o as w}from"./bg-CJ0YWFli.js";import{n as T,t as E}from"./state-BAGmpVBn.js";import{join as D}from"path";import"crypto";import{readFile as O,readdir as k}from"fs/promises";import"net";import"events";function A(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function j(e){return typeof e==`string`&&B.includes(e)}function M(e){return typeof e==`string`&&V.includes(e)}function N(e){return!A(e)||typeof e.name!=`string`||!M(e.status)?null:{name:e.name,...typeof e.prompt==`string`?{prompt:e.prompt}:{},status:e.status,...typeof e.startedAt==`number`?{startedAt:e.startedAt}:{},...typeof e.completedAt==`number`?{completedAt:e.completedAt}:{}}}function P(e){if(!A(e)||typeof e.runId!=`string`||typeof e.workflow!=`string`||!j(e.status)||typeof e.createdAt!=`number`||typeof e.updatedAt!=`number`||typeof e.currentStepIndex!=`number`||!Array.isArray(e.steps))return null;let t=e.steps.map(N).filter(e=>e!==null);return t.length===e.steps.length?{runId:e.runId,workflow:e.workflow,...typeof e.args==`string`?{args:e.args}:{},status:e.status,createdAt:e.createdAt,updatedAt:e.updatedAt,currentStepIndex:e.currentStepIndex,steps:t}:null}async function F(e,t){try{return P(le(await O(D(e,R,`${t}.json`),`utf-8`),!1))}catch{return null}}async function I(e=oe()){let t;try{t=await k(D(e,R))}catch{return[]}let n=t.filter(e=>e.endsWith(`.json`));return(await Promise.all(n.slice(0,z).map(t=>F(e,t.slice(0,-5))))).filter(e=>e!==null).sort((e,t)=>t.updatedAt-e.updatedAt)}function L(e){if(e.length===0)return[`Workflow runs: 0`,` none`].join(`
2
- `);let t=e.filter(e=>e.status===`running`).length,n=e.filter(e=>e.status===`completed`).length,r=e.filter(e=>e.status===`cancelled`).length,i=[`Workflow runs: ${e.length}`,` Running: ${t}`,` Completed: ${n}`,` Cancelled: ${r}`];for(let t of e.slice(0,10)){let e=t.steps[t.currentStepIndex];i.push(` ${t.runId}: ${t.workflow}: ${t.status} step=${e?.name??`none`} updated=${new Date(t.updatedAt).toLocaleString()}`)}return e.length>10&&i.push(` ... ${e.length-10} more workflow run(s)`),i.join(`
3
- `)}var R,z,B,V,H=e((()=>{ae(),ce(),R=D(`.claude`,`workflow-runs`),z=200,B=[`running`,`completed`,`cancelled`],V=[`pending`,`running`,`completed`,`cancelled`]}));function U(){return D(t(),`pipes`)}var de=e((()=>{n(),se()}));function fe(){return D(U(),`registry.json`)}async function pe(){try{let e=await O(fe(),`utf8`),t=JSON.parse(e);return t.version===1?t:{...W}}catch{return{...W}}}var W,me=e((()=>{de(),W={version:1,mainMachineId:null,main:null,subs:[]}}));async function he(){return ge(await pe())}function ge(e){let t=[`Pipe registry: ${+!!e.main} main, ${e.subs.length} sub(s)`];e.mainMachineId&&t.push(` main_machine=${e.mainMachineId.slice(0,8)}...`),e.main&&t.push(` [main] ${e.main.pipeName} pid=${e.main.pid} host=${e.main.hostname} tcp=${e.main.tcpPort??`none`}`);for(let n of e.subs.slice(0,10))t.push(` [sub-${n.subIndex}] ${n.pipeName} pid=${n.pid} host=${n.hostname} bound=${n.boundToMain??`none`} tcp=${n.tcpPort??`none`}`);return!e.main&&e.subs.length===0&&t.push(` none`),e.subs.length>10&&t.push(` ... ${e.subs.length-10} more sub pipe(s)`),t.join(`
4
- `)}var _e=e((()=>{me()}));function ve(){try{let e=x(),t=S();return[`Remote Control: ${e?`self-hosted`:`official`}`,` base_url=${b()}`,` token=${t?`present`:`missing`}`,` entitlement=checked at remote-control startup`].join(`
5
- `)}catch(e){return[`Remote Control: unknown`,` reason=${e instanceof Error?e.message:String(e)}`].join(`
6
- `)}}var ye=e((()=>{ue()}));async function be(){let e=T(),t=await w(),n=[`Daemon: ${e.status}${e.state?` pid=${e.state.pid} workers=${e.state.workerKinds.join(`,`)}`:``}`,`Background sessions: ${t.length}`];for(let e of t.slice(0,8))n.push(` pid=${e.pid} kind=${e.kind} status=${e.status??`unknown`} cwd=${e.cwd}`);return t.length>8&&n.push(` ... ${t.length-8} more session(s)`),n.join(`
7
- `)}function xe(){let e=!1,t=null;try{e=o(),t=re()}catch(e){return[`Auto mode: unknown`,` reason=${e instanceof Error?e.message:String(e)}`].join(`
8
- `)}return[`Auto mode: ${e?`available`:`unavailable`}`,` reason=${t??`none`}`].join(`
9
- `)}async function G({runs:e,flows:t,nowMs:n=Date.now()}){return Promise.all([Promise.resolve({id:`auto-mode`,title:`Auto Mode`,content:xe()}),Promise.resolve({id:`runs`,title:`Runs`,content:s(e)}),Promise.resolve({id:`flows`,title:`Flows`,content:l(t)}),I().then(e=>({id:`workflow-runs`,title:`Workflow Runs`,content:L(e)})),he().then(e=>({id:`pipes`,title:`Pipes`,content:e})),be().then(e=>({id:`runtime`,title:`Runtime`,content:e})),Promise.resolve({id:`remote-control`,title:`Remote Control`,content:ve()}),ne().then(e=>({id:`remote-trigger`,title:`RemoteTrigger`,content:g(e)}))])}async function Se(e){return(await G(e)).map((e,t)=>[t===0?`# Autonomy Deep Status`:`## ${e.title}`,e.content].join(`
10
- `)).join(`
11
-
12
- `)}var Ce=e((()=>{E(),C(),y(),u(),i(),a(),H(),_e(),ye()}));function we(e){let[t=`status`,n,r]=e.trim().split(/\s+/,3);return t===``||t===`status`?{type:`status`,deep:n===`--deep`}:t===`runs`?{type:`runs`,limit:n}:t===`flows`?{type:`flows`,limit:n}:t===`flow`?n===`cancel`?r?{type:`flow-cancel`,flowId:r}:{type:`usage`}:n===`resume`?r?{type:`flow-resume`,flowId:r}:{type:`usage`}:n?{type:`flow-detail`,flowId:n}:{type:`usage`}:{type:`usage`}}var K,Te=e((()=>{K=`Usage: /autonomy [status [--deep]|runs [limit]|flows [limit]|flow <id>|flow cancel <id>|flow resume <id>]`}));function q(e){let t=typeof e==`number`?e:Number.parseInt(e??``,10);return!Number.isFinite(t)||t<=0?10:Math.min(t,50)}async function J(e){let t=e?.rootDir,[n,r]=await Promise.all([f(t),c(t)]);return e?.deep?Se({runs:n,flows:r}):[s(n),l(r)].join(`
13
- `)}async function Ee(e,t){let[n,r]=await Promise.all([f(t?.rootDir),c(t?.rootDir)]),i=(await G({runs:n,flows:r})).find(t=>t.id===e);return i?[`# ${i.title}`,i.content].join(`
14
- `):`Autonomy deep status section not found: ${e}`}async function De(e){process.stdout.write(`${await J(e)}\n`)}async function Y(e,t){return p(await f(t?.rootDir),q(e))}async function Oe(e){process.stdout.write(`${await Y(e)}\n`)}async function X(e,t){return v(await c(t?.rootDir),q(e))}async function ke(e){process.stdout.write(`${await X(e)}\n`)}async function Z(e,t){return r(await _(e,t?.rootDir))}async function Ae(e){process.stdout.write(`${await Z(e)}\n`)}async function Q(e,t){let n=await d({flowId:e,rootDir:t?.rootDir});if(!n)return`Autonomy flow not found.`;if(!n.accepted)return`Autonomy flow ${e} is already terminal (${n.flow.status}).`;let r=0;if(t?.removeQueuedInMemory){let n=m(t=>t.autonomy?.flowId===e);r=n.length;for(let e of n)e.autonomy?.runId&&await h(e.autonomy.runId,t?.rootDir)}else{for(let e of n.queuedRunIds)await h(e,t?.rootDir);r=n.queuedRunIds.length}return n.flow.status===`running`?`Cancellation requested for flow ${e}. The current step is still running, and no new steps will be started.`:`Cancelled flow ${e}. Removed ${r} queued step(s).`}async function je(e){process.stdout.write(`${await Q(e)}\n`)}async function $(e,t){let n=await ie({flowId:e,rootDir:t?.rootDir,currentDir:t?.currentDir});if(!n)return`Autonomy flow is not waiting or was not found.`;if(t?.enqueueInMemory)return ee(n),`Queued the next managed step for flow ${e}.`;let r=n.autonomy?.runId??`unknown`;return[`Prepared the next managed step for flow ${e}.`,`Run ID: ${r}`,``,`Prompt:`,typeof n.value==`string`?n.value:String(n.value)].join(`
15
- `)}async function Me(e){process.stdout.write(`${await $(e)}\n`)}async function Ne(e,t){let n=we(e);switch(n.type){case`status`:return J({deep:n.deep});case`runs`:return Y(n.limit);case`flows`:return X(n.limit);case`flow-detail`:return Z(n.flowId);case`flow-cancel`:return Q(n.flowId,{removeQueuedInMemory:t?.removeQueuedInMemory});case`flow-resume`:return $(n.flowId,{enqueueInMemory:t?.enqueueInMemory});case`usage`:return K}}var Pe=e((()=>{y(),u(),Ce(),Te(),te()}));export{Oe as a,Ne as c,X as d,Y as f,$ as g,q as h,ke as i,Ee as l,Pe as m,Ae as n,De as o,J as p,Me as r,Q as s,je as t,Z as u};
@@ -1 +0,0 @@
1
- import{a as e,c as t,i as n,m as r,n as i,o as a,r as o,t as s}from"./autonomy-DuQmYhq6.js";r();export{s as autonomyFlowCancelHandler,i as autonomyFlowHandler,o as autonomyFlowResumeHandler,n as autonomyFlowsHandler,e as autonomyRunsHandler,a as autonomyStatusHandler,t as getAutonomyCommandText};
@@ -1 +0,0 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Gm as n,Wm as r,id as i,sd as a}from"./loadAgentsDir-BL93ulMm.js";import{I as o,P as s,fi as c,hn as l,t as u,y as d}from"./src-P_wYS_NJ2.js";import{t as f}from"./jsx-runtime-Bb4Xn-E0.js";import{c as p,l as m,m as h,p as g}from"./autonomy-DuQmYhq6.js";function _(){return S}function v({onDone:e}){a(`autonomy-panel`);let[t,r]=(0,b.useState)(0),[i,c]=(0,b.useState)([]);(0,b.useEffect)(()=>{let e=!1;return n().then(t=>{e||c(t.slice(0,5))}),()=>{e=!0}},[]);let u=(0,b.useMemo)(()=>{let e=[{label:`Overview`,description:`显示 run 和 flow 数量以及最近的自动活动`,run:()=>g()},{label:`Full deep status`,description:`在一份诊断报告里打印所有本地 autonomy 表面`,run:()=>g({deep:!0})},{label:`Auto mode`,description:`检查自动权限模式是否可用及其原因`,run:()=>m(`auto-mode`)},{label:`Runs summary`,description:`显示 queued/running/completed/failed 的运行总数与最近一次运行`,run:()=>m(`runs`)},{label:`Recent runs`,description:`列出最近的 autonomy 运行 ID、触发器、状态与 prompt`,run:()=>p(`runs 10`)},{label:`Flows summary`,description:`显示跨 queued/running/waiting 状态的托管 flow 总数`,run:()=>m(`flows`)},{label:`Recent flows`,description:`列出最近的托管 flow ID、状态、当前步骤与 goal`,run:()=>p(`flows 10`)},{label:`Workflow runs`,description:`显示已持久化的 WorkflowTool 运行及其当前 workflow 步骤`,run:()=>m(`workflow-runs`)},{label:`Pipes`,description:`显示用于终端消息的 UDS/named-pipe 与 LAN 注册表`,run:()=>m(`pipes`)},{label:`Runtime`,description:`显示 daemon 状态与运行中的后台或交互式会话`,run:()=>m(`runtime`)},{label:`Remote Control`,description:`显示 bridge 模式、base URL、token 状态与 entitlement 说明`,run:()=>m(`remote-control`)},{label:`RemoteTrigger`,description:`显示最近的远程 trigger 审计记录、失败与最近一次调用`,run:()=>m(`remote-trigger`)}],t=i.flatMap(e=>{let t=e.flowId.slice(0,8),n=[{label:`Flow ${t}`,description:`${e.status}:${e.goal}`,run:()=>p(`flow ${e.flowId}`)}];return e.status===`waiting`&&n.push({label:`Resume ${t}`,description:e.currentStep?`恢复等待中的步骤:${e.currentStep}`:`恢复等待中的 flow`,run:()=>p(`flow resume ${e.flowId}`,{enqueueInMemory:!0})}),(e.status===`queued`||e.status===`running`||e.status===`waiting`||e.status===`blocked`)&&n.push({label:`Cancel ${t}`,description:`取消处于 ${e.status} 状态的 flow`,run:()=>p(`flow cancel ${e.flowId}`,{removeQueuedInMemory:!0})}),n});return[...e,...t]},[i]),f=()=>{let n=u[t];n&&n.run().then(t=>{e(t,{display:`system`})})};return l((e,t)=>{if(t.upArrow){r(e=>Math.max(0,e-1));return}if(t.downArrow){r(e=>Math.min(u.length-1,e+1));return}t.return&&f()}),(0,x.jsx)(d,{title:`Autonomy`,subtitle:`${u.length} actions`,onCancel:()=>e(`Autonomy panel dismissed`,{display:`system`}),color:`background`,hideInputGuide:!0,children:(0,x.jsxs)(o,{flexDirection:`column`,children:[u.map((e,n)=>(0,x.jsxs)(o,{flexDirection:`row`,children:[(0,x.jsx)(s,{children:`${n===t?`›`:` `} ${e.label}`.padEnd(C)}),(0,x.jsx)(s,{dimColor:!0,children:e.description})]},`${e.label}-${n}`)),(0,x.jsx)(o,{marginTop:1,children:(0,x.jsx)(s,{dimColor:!0,children:`↑/↓ select · Enter run · Esc close`})})]})})}async function y(e,t,n){let r=n?.trim()??``;return r?(e(await p(r,{enqueueInMemory:!0,removeQueuedInMemory:!0}),{display:`system`}),null):(0,x.jsx)(v,{onDone:e})}var b,x,S,C;e((()=>{b=t(c(),1),u(),i(),h(),r(),x=f(),S=14,C=24}))();export{y as call,_ as getAutonomyPanelBaseActionCountForTests};
@@ -1 +0,0 @@
1
- import{t as e}from"./backgroundHousekeeping-Cc7Ag7JG.js";export{e as startBackgroundHousekeeping};
@@ -1,17 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,o as n}from"./envUtils-BDhHQY0-.js";import{$ as r,Ba as i,Cr as a,Da as o,Hd as s,Mc as c,Oa as ee,Ta as te,Tt as l,Vd as u,_v as d,ap as ne,fr as f,gx as p,hx as m,jc as h,mt as g,rw as _,sp as re,tt as ie,tw as ae,vm as oe}from"./loadAgentsDir-BL93ulMm.js";import{R as v,W as y,Wt as b}from"./state-BemZdQIl.js";import{n as x,t as S}from"./cwd-Cfdf7z7s.js";import{R as C,U as w,c as T,f as E,i as D,u as O,x as k}from"./debug-BecbSVoN.js";import{f as A,g as j,y as M}from"./settings-D4CpDv2y.js";import{S as N}from"./config-aRiTrtCv.js";import{o as P,s as F,v as I,y as L}from"./log-Dauqle-Z.js";import{n as R,r as z}from"./analytics-DJobLaWP.js";import{_ as B,h as V}from"./model-Bgh_r4lg.js";import{bn as H,yn as U}from"./prompt-Dx7IWhBt.js";import{at as W}from"./sessionState-D-SaBzWD.js";import{i as se,t as G}from"./nativeInstaller-BEwayifa.js";import{n as K,t as ce}from"./allErrors-_cOQksHC.js";import{r as le}from"./magicDocs-DLav5QK0.js";import{n as ue,t as de}from"./pluginAutoupdate-BBU9Jn4p.js";import{n as fe,r as pe}from"./registerProtocol-E0Iu5hEx.js";import"os";import{join as q}from"path";import"crypto";n(),b(),x(),k(),E(),D(),L(),j(),H(),B(),c(),a(),le(),r(),P(),C(),i(),d(),r(),p(),C(),P(),i(),d(),oe();async function me(e,t){if(!e)return;let{join:n}=await import(`path`),r=await import(`fs/promises`),i=n(S(),`.claude`,`skills`,e,`SKILL.md`),a;try{a=await r.readFile(i,`utf-8`)}catch{F(Error(`Failed to read skill file for improvement: ${i}`));return}let s=t.map(e=>`- ${e.section}: ${e.change}`).join(`
2
- `),c=V(),l=await ie({messages:[te({content:`You are editing a skill definition file. Apply the following improvements to the skill.
3
-
4
- <current_skill_file>
5
- ${a}
6
- </current_skill_file>
7
-
8
- <improvements>
9
- ${s}
10
- </improvements>
11
-
12
- Rules:
13
- - Integrate the improvements naturally into the existing structure
14
- - Preserve frontmatter (--- block) exactly as-is
15
- - Preserve the overall format and style
16
- - Do not remove existing content unless an improvement explicitly replaces it
17
- - Output the complete updated file inside <updated_file> tags`})],systemPrompt:W([`You edit skill definition files to incorporate user preferences. Output only the updated file content.`]),thinkingConfig:{type:`disabled`},tools:[],signal:m().signal,options:{getToolPermissionContext:async()=>U(),model:c,toolChoice:void 0,isNonInteractiveSession:!1,hasAppendSystemPrompt:!1,temperatureOverride:0,agents:[],querySource:`skill_improvement_apply`,mcpTools:[]}}),u=o(ee(Array.isArray(l.message.content)?l.message.content:[]).trim(),`updated_file`);if(!u){F(Error(`Skill improvement apply: no updated_file tag in response`));return}try{await r.writeFile(i,u,`utf-8`)}catch(e){F(w(e))}}R(),re(),N(),P(),G(),s(),K(),_(),l();var he=30;function J(){let e=((A()||{}).cleanupPeriodDays??he)*24*60*60*1e3;return new Date(Date.now()-e)}function ge(e,t){return{messages:e.messages+t.messages,errors:e.errors+t.errors}}function _e(e){let t=e.split(`.`)[0].replace(/T(\d{2})-(\d{2})-(\d{2})-(\d{3})Z/,`T$1:$2:$3.$4Z`);return new Date(t)}async function Y(e,t,n){let r={messages:0,errors:0};try{let i=await O().readdir(e);for(let a of i)try{_e(a.name)<t&&(await O().unlink(q(e,a.name)),n?r.messages++:r.errors++)}catch(e){F(e)}}catch(e){e instanceof Error&&`code`in e&&e.code!==`ENOENT`&&F(e)}return r}async function ve(){let e=O(),t=J(),n=I.errors(),r=I.baseLogs(),i=await Y(n,t,!1);try{let n;try{n=await e.readdir(r)}catch{return i}let a=n.filter(e=>e.isDirectory()&&e.name.startsWith(`mcp-logs-`)).map(e=>q(r,e.name));for(let n of a)i=ge(i,await Y(n,t,!0)),await Z(n,e)}catch(e){e instanceof Error&&`code`in e&&e.code!==`ENOENT`&&F(e)}return i}async function X(e,t,n){return(await n.stat(e)).mtime<t?(await n.unlink(e),!0):!1}async function Z(e,t){try{await t.rmdir(e)}catch{}}async function ye(){let e=J(),t={messages:0,errors:0},n=f(),r=O(),i;try{i=await r.readdir(n)}catch{return t}for(let a of i){if(!a.isDirectory())continue;let i=q(n,a.name),o;try{o=await r.readdir(i)}catch{t.errors++;continue}for(let n of o)if(n.isFile()){if(!n.name.endsWith(`.jsonl`)&&!n.name.endsWith(`.cast`))continue;try{await X(q(i,n.name),e,r)&&t.messages++}catch{t.errors++}}else if(n.isDirectory()){let a=q(i,n.name),o=q(a,ae),s;try{s=await r.readdir(o)}catch{await Z(a,r);continue}for(let n of s)if(n.isFile())try{await X(q(o,n.name),e,r)&&t.messages++}catch{t.errors++}else if(n.isDirectory()){let i=q(o,n.name),a;try{a=await r.readdir(i)}catch{continue}for(let n of a)if(n.isFile())try{await X(q(i,n.name),e,r)&&t.messages++}catch{t.errors++}await Z(i,r)}await Z(o,r),await Z(a,r)}await Z(i,r)}return t}async function be(e,t,n=!0){let r=J(),i={messages:0,errors:0},a=O(),o;try{o=await a.readdir(e)}catch{return i}for(let n of o)if(!(!n.isFile()||!n.name.endsWith(t)))try{await X(q(e,n.name),r,a)&&i.messages++}catch{i.errors++}return n&&await Z(e,a),i}function xe(){return be(q(t(),`plans`),`.md`)}async function Se(){let e=J(),n={messages:0,errors:0},r=O();try{let i=q(t(),`file-history`),a;try{a=await r.readdir(i)}catch{return n}let o=a.filter(e=>e.isDirectory()).map(e=>q(i,e.name));await Promise.all(o.map(async t=>{try{(await r.stat(t)).mtime<e&&(await r.rm(t,{recursive:!0,force:!0}),n.messages++)}catch{n.errors++}})),await Z(i,r)}catch(e){F(e)}return n}async function Ce(){let e=J(),n={messages:0,errors:0},r=O();try{let i=q(t(),`session-env`),a;try{a=await r.readdir(i)}catch{return n}let o=a.filter(e=>e.isDirectory()).map(e=>q(i,e.name));for(let t of o)try{(await r.stat(t)).mtime<e&&(await r.rm(t,{recursive:!0,force:!0}),n.messages++)}catch{n.errors++}await Z(i,r)}catch(e){F(e)}return n}async function we(){let e=J(),n={messages:0,errors:0},r=O(),i=q(t(),`debug`),a;try{a=await r.readdir(i)}catch{return n}for(let t of a)if(!(!t.isFile()||!t.name.endsWith(`.txt`)||t.name===`latest`))try{await X(q(i,t.name),e,r)&&n.messages++}catch{n.errors++}return n}async function Q(){let{errors:e}=ce();if(e.length>0&&M(`cleanupPeriodDays`)){T(`Skipping cleanup: settings have validation errors but cleanupPeriodDays was explicitly set. Fix settings errors to enable cleanup.`);return}await ve(),await ye(),await xe(),await Se(),await Ce(),await we(),await ne(),await u(J());let t=await g(J());t>0&&z(`tengu_worktree_cleanup`,{removed:t})}b(),G(),ue();var Te=(fe(),e(pe)),$=600*1e3;function Ee(){import(`./extractMemories-4lBn134y.js`).then(({initExtractMemories:e})=>{e()}).catch(()=>{}),h(),de(),v()&&Te.ensureDeepLinkProtocolRegistered();let e=!0;async function t(){if(v()&&y()>Date.now()-1e3*60){setTimeout(t,$).unref();return}if(e&&(e=!1,await Q()),v()&&y()>Date.now()-1e3*60){setTimeout(t,$).unref();return}await se()}setTimeout(t,$).unref()}export{me as n,Ee as t};
@@ -1,9 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,o as n}from"./envUtils-BDhHQY0-.js";import{S as r,x as i}from"./debug-BecbSVoN.js";import{a,i as o}from"./genericProcessUtils-B2HcDYhg.js";import{join as s}from"path";import{randomUUID as c}from"crypto";import{readFile as l,readdir as u,unlink as d}from"fs/promises";async function f(){if(process.platform===`win32`){let{DetachedEngine:e}=await import(`./detached-CIyF0M5O.js`);return new e}let{TmuxEngine:e}=await import(`./tmux-D5EvHWi3.js`),t=new e;if(await t.available())return t;let{DetachedEngine:n}=await import(`./detached-CIyF0M5O.js`);return new n}var p=e((()=>{}));function m(){return s(t(),`sessions`)}async function h(){let e=m(),t;try{t=await u(e)}catch{return[]}let n=[];for(let i of t)if(/^\d+\.json$/.test(i)){if(!a(parseInt(i.slice(0,-5),10))){d(s(e,i)).catch(()=>{});continue}try{let t=r(await l(s(e,i),`utf-8`));n.push(t)}catch{}}return n}function g(e,t){let n=parseInt(t,10);return e.find(e=>e.sessionId===t||e.pid===n||e.name&&e.name===t)}function _(e){return new Date(e).toLocaleString()}function v(e){return e.engine?e.engine:e.tmuxSessionName?`tmux`:`detached`}async function y(e){let t=await h();if(t.length===0){console.log(`No active sessions.`);return}console.log(`${t.length} active session${t.length>1?`s`:``}:\n`);for(let e of t){let t=v(e),n=[` PID: ${e.pid}`,` Kind: ${e.kind}`,` Engine: ${t}`,` Session: ${e.sessionId}`,` CWD: ${e.cwd}`];e.name&&n.push(` Name: ${e.name}`),e.startedAt&&n.push(` Started: ${_(e.startedAt)}`),e.status&&n.push(` Status: ${e.status}`),e.waitingFor&&n.push(` Waiting for: ${e.waitingFor}`),e.bridgeSessionId&&n.push(` Bridge: ${e.bridgeSessionId}`),e.tmuxSessionName&&n.push(` Tmux: ${e.tmuxSessionName}`),e.logPath&&n.push(` Log: ${e.logPath}`),console.log(n.join(`
2
- `)),console.log()}}async function b(e){let t=await h();if(!e){if(t.length===0){console.log(`No active sessions.`);return}if(t.length===1)e=t[0].sessionId;else{console.log(`Multiple sessions active. Specify one:`);for(let e of t){let t=e.name?`${e.name} (${e.sessionId})`:e.sessionId;console.log(` ${t} PID=${e.pid}`)}return}}let n=g(t,e);if(!n){console.error(`Session not found: ${e}`),process.exitCode=1;return}if(!n.logPath){console.log(`No log path recorded for session ${n.sessionId}`);return}try{let e=await l(n.logPath,`utf-8`);process.stdout.write(e)}catch(e){console.error(`Failed to read log file: ${n.logPath}`),console.error(e instanceof Error?e.message:String(e)),process.exitCode=1}}async function x(e){let t=await h();if(!e){let n=t.filter(e=>e.tmuxSessionName||e.engine===`detached`);if(n.length===0){console.log("No background sessions to attach to. Start one with `claude daemon bg`.");return}if(n.length===1)e=n[0].sessionId;else{console.log(`Multiple background sessions. Specify one:`);for(let e of n){let t=e.name?`${e.name} (${e.sessionId})`:e.sessionId,n=v(e);console.log(` ${t} PID=${e.pid} engine=${n}`)}return}}let n=g(t,e);if(!n){console.error(`Session not found: ${e}`),process.exitCode=1;return}let r=v(n);try{if(r===`tmux`){let{TmuxEngine:e}=await import(`./tmux-D5EvHWi3.js`),t=new e;if(!await t.available()){console.error(`tmux is no longer available. Cannot attach to tmux session.`),process.exitCode=1;return}await t.attach(n)}else{let{DetachedEngine:e}=await import(`./detached-CIyF0M5O.js`);await new e().attach(n)}}catch(e){console.error(e instanceof Error?e.message:String(e)),process.exitCode=1}}async function S(e){let t=await h();if(!e){if(t.length===0){console.log(`No active sessions to kill.`);return}console.log(`Specify a session to kill:`);for(let e of t){let t=e.name?`${e.name} (${e.sessionId})`:e.sessionId;console.log(` ${t} PID=${e.pid}`)}return}let n=g(t,e);if(!n){console.error(`Session not found: ${e}`),process.exitCode=1;return}console.log(`Killing session ${n.sessionId} (PID: ${n.pid})...`);try{process.kill(n.pid,`SIGTERM`)}catch{console.log(`Session already exited.`);return}if(await new Promise(e=>setTimeout(e,2e3)),a(n.pid))try{process.kill(n.pid,`SIGKILL`),console.log(`Session force-killed.`)}catch{console.log(`Session exited during grace period.`)}else console.log(`Session stopped.`);d(s(m(),`${n.pid}.json`)).catch(()=>{})}async function C(e){let n=await f(),r=e.filter(e=>e!==`--bg`&&e!==`--background`);if(!n.supportsInteractiveInput&&!r.some(e=>e===`-p`||e===`--print`||e===`--pipe`)){console.error(`Error: Background sessions with detached engine require -p/--print flag.
3
- The detached engine has no terminal for interactive input.
4
-
5
- Usage:
6
- claude daemon bg -p "your prompt here"
7
- echo "prompt" | claude daemon bg --pipe`),process.platform!==`win32`&&console.error(`
8
- Alternatively, install tmux for interactive background sessions:
9
- ${process.platform===`darwin`?`brew install tmux`:`sudo apt install tmux`}`),process.exitCode=1;return}let i=`claude-bg-${c().slice(0,8)}`,a=s(t(),`sessions`,`logs`,`${i}.log`);try{let e=await n.start({sessionName:i,args:r,env:{...process.env},logPath:a,cwd:process.cwd()});console.log(`Background session started: ${e.sessionName}`),console.log(` Engine: ${e.engineUsed}`),console.log(` Log: ${e.logPath}`),console.log(),console.log(`Use \`claude daemon attach ${e.sessionName}\` to reconnect.`),console.log("Use `claude daemon status` to check status."),console.log(`Use \`claude daemon kill ${e.sessionName}\` to stop.`)}catch(e){console.error(e instanceof Error?e.message:String(e)),process.exitCode=1}}var w=e((()=>{n(),o(),i(),p()}));export{S as a,y as c,w as i,g as n,h as o,C as r,b as s,x as t};
@@ -1 +0,0 @@
1
- import{a as e,c as t,i as n,r,s as i,t as a}from"./bg-CJ0YWFli.js";n();export{a as attachHandler,r as handleBgStart,e as killHandler,i as logsHandler,t as psHandler};
@@ -1 +0,0 @@
1
- import{a as e,n as t,o as n,t as r}from"./bridgeConfig-UgaUfuP6.js";e();export{r as getBridgeAccessToken,t as getBridgeBaseUrl,n as isSelfHostedBridge};
@@ -1 +0,0 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Ba as n,Bu as r,Ma as i,ZC as a,_v as o,bv as s,ct as c,dc as l,fc as u,gx as d,hx as f,jp as p,kp as m,lt as h,xv as g,yv as _,zu as v}from"./loadAgentsDir-BL93ulMm.js";import{I as y,P as b,bn as x,fi as S,ot as C,t as w,vn as T,xt as E}from"./src-P_wYS_NJ2.js";import{t as D}from"./jsx-runtime-Bb4Xn-E0.js";import{P as O,R as k}from"./debug-BecbSVoN.js";import{Wt as A}from"./settings-D4CpDv2y.js";import{h as j,y as M}from"./config-aRiTrtCv.js";import{at as N}from"./sessionState-D-SaBzWD.js";import{n as P,r as F}from"./sideQuestion-CvMBBjI8.js";import{i as I,n as L}from"./modalContext-CUThy6Ph.js";function R({question:e,context:t,onDone:n}){let[r,i]=(0,H.useState)(null),[a,o]=(0,H.useState)(null),[s,c]=(0,H.useState)(0),l=(0,H.useRef)(null),{rows:u}=I(C());x(()=>c(e=>e+1),r||a?null:80);function d(e){if(e.key===`escape`||e.key===`return`||e.key===` `||e.ctrl&&(e.key===`c`||e.key===`d`)){e.preventDefault(),n(void 0,{display:`skip`});return}(e.key===`up`||e.ctrl&&e.key===`p`)&&(e.preventDefault(),l.current?.scrollBy(-3)),(e.key===`down`||e.ctrl&&e.key===`n`)&&(e.preventDefault(),l.current?.scrollBy(K))}(0,H.useEffect)(()=>{let n=f();async function r(){try{let r=await F({question:e,cacheSafeParams:await B(t)});n.signal.aborted||(r.response?i(r.response):o(`No response received`))}catch(e){n.signal.aborted||o(O(e)||`Failed to get response`)}}return r(),()=>{n.abort()}},[e,t]);let p=Math.max(5,u-W-G);return(0,U.jsxs)(y,{flexDirection:`column`,paddingLeft:2,marginTop:1,tabIndex:0,autoFocus:!0,onKeyDown:d,children:[(0,U.jsxs)(y,{children:[(0,U.jsxs)(b,{color:`warning`,bold:!0,children:[`/btw`,` `]}),(0,U.jsx)(b,{dimColor:!0,children:e})]}),(0,U.jsx)(y,{marginTop:1,marginLeft:2,maxHeight:p,children:(0,U.jsx)(E,{ref:l,flexDirection:`column`,flexGrow:1,children:a?(0,U.jsx)(b,{color:`error`,children:a}):r?(0,U.jsx)(m,{children:r}):(0,U.jsxs)(y,{children:[(0,U.jsx)(v,{frame:s,messageColor:`warning`}),(0,U.jsx)(b,{color:`warning`,children:`Answering...`})]})})}),(r||a)&&(0,U.jsx)(y,{marginTop:1,children:(0,U.jsxs)(b,{dimColor:!0,children:[`↑`,`/`,`↓`,` to scroll · Space, Enter, or Escape to dismiss`]})})]})}function z(e){let t=e.at(-1);return t?.type===`assistant`&&t.message.stop_reason===null?e.slice(0,-1):e}async function B(e){let t=i(z(e.messages)),n=l();if(n)return{systemPrompt:n.systemPrompt,userContext:n.userContext,systemContext:n.systemContext,toolUseContext:e,forkContextMessages:t};let[r,a,o]=await Promise.all([c(e.options.tools,e.options.mainLoopModel,[],e.options.mcpClients),s(),_()]);return{systemPrompt:N(r),userContext:a,systemContext:o,toolUseContext:e,forkContextMessages:t}}async function V(e,t,n){let r=n?.trim();return r?(M(e=>({...e,btwUseCount:e.btwUseCount+1})),(0,U.jsx)(R,{question:r,context:t,onDone:e})):(e(`Usage: /btw <your question>`,{display:`system`}),null)}var H,U,W,G,K;e((()=>{S(),H=t(S(),1),T(),p(),r(),A(),h(),L(),g(),a(),w(),d(),j(),k(),u(),n(),P(),o(),U=D(),W=5,G=6,K=3}))();export{V as call};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./caches-Bp9MZ7IE.js";e();export{t as clearSessionCaches};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{$i as t,Ai as n,As as r,Bi as i,Cb as a,Cv as o,Gh as s,J as c,Jv as l,Kv as u,Ou as d,Sb as f,Sv as p,Wh as m,X as h,Yi as g,bv as _,fw as v,ih as y,js as b,ku as x,nh as S,op as C,pm as w,pw as T,sp as E,vv as D,wv as O,xv as k,yv as A}from"./loadAgentsDir-BL93ulMm.js";import{On as j,Wt as M,l as N}from"./state-BemZdQIl.js";import{S as P,v as F}from"./git-DBlOv64X.js";import{i as I,t as L}from"./detectRepository-C15umvKN.js";import{a as R,n as z}from"./fileSuggestions-C7Pwq2yj.js";import{r as B,t as V}from"./magicDocs-DLav5QK0.js";function H(e=new Set){let t=e.size>0;_.cache.clear?.(),A.cache.clear?.(),D.cache.clear?.(),o.cache.clear?.(),z(),n(),t||l(),p(null),j(null),y(),b(),a(`session_start`),C(),d(),import(`./attributionHooks-CUAoGkU6.js`).then(({clearAttributionCaches:e})=>e()),L(),c(),N(e),F(),g(),s(),V(),v(),import(`./SearchExtraToolsTool-C80OdtPZ.js`).then(({clearSearchExtraToolsDescriptionCache:e})=>e()),import(`./loadAgentsDir-eVKq8efm.js`).then(({clearAgentDefinitionsCache:e})=>e()),import(`./prompt-DovNDmcx.js`).then(({clearPromptCache:e})=>e())}var U=e((()=>{M(),i(),O(),k(),R(),w(),u(),x(),S(),m(),B(),t(),r(),h(),f(),I(),P(),E(),T()}));export{U as n,H as t};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./bundledMode--fG1S62b.js";import{i as r,r as i}from"./shellQuote-DS6WrivY.js";import{spawn as a}from"child_process";function o(e){let n=[];for(let r=0;r<e.length;r++){let i=e[r];if(i===`-d`||i.startsWith(`-d `)||i.startsWith(`-d `)){n.push(i),i===`-d`&&r+1<e.length&&n.push(e[++r]);continue}if(i.startsWith(`-d`)&&i.includes(`:`)){n.push(i);continue}if(i===`--feature`){n.push(i),r+1<e.length&&n.push(e[++r]);continue}if(/^--inspect(-brk)?(=|$)/.test(i)){n.push(i);continue}if(i.startsWith(`--`)&&!i.includes(`=`)&&r+1<e.length){if(t())continue;n.push(i),n.push(e[++r]);continue}i.startsWith(`-`)&&!t()&&n.push(i)}return n}function s(e,n){let r=n?.env??process.env,i=t()||!p?[...f,...e]:[...f,p,...e],a={...r};return h&&(process.env.CLAUDE_CODE_GIT_BASH_PATH&&!a.CLAUDE_CODE_GIT_BASH_PATH&&(a.CLAUDE_CODE_GIT_BASH_PATH=process.env.CLAUDE_CODE_GIT_BASH_PATH),process.env.SHELL&&!a.SHELL&&(a.SHELL=process.env.SHELL)),{execPath:m,args:i,env:a,windowsHide:h}}function c(e,t){return a(e.execPath,e.args,{...t,env:{...e.env,...t.env},windowsHide:e.windowsHide})}function l(e){return r([e.execPath,...e.args])}function u(){return f}function d(){return p}var f,p,m,h,g=e((()=>{n(),i(),f=Object.freeze(o(process.execArgv)),p=process.argv[1],m=process.execPath,h=process.platform===`win32`}));export{l as a,g as i,u as n,c as o,d as r,s as t};
@@ -1 +0,0 @@
1
- import{r as e,t}from"./client-B9404qIP.js";e();export{t as clearOpenAIClientCache};
@@ -1 +0,0 @@
1
- import{Fr as e,Pr as t}from"./model-Bgh_r4lg.js";e();export{t as getOrganizationUUID};
@@ -1 +0,0 @@
1
- import{Ai as e,Bi as t,Fi as n}from"./loadAgentsDir-BL93ulMm.js";t();export{e as clearCommandsCache,n as getCommands};
@@ -1,2 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Av as t,Ba as n,Ev as r,F_ as i,Kv as a,M_ as o,Ma as s,P_ as c,Qm as l,Rv as u,Tp as d,Tv as f,Wv as p,XC as m,Xm as h,YC as g,bv as _,ct as v,gv as y,hv as b,ih as x,j_ as S,kv as C,lt as w,nh as T,qv as E,vn as D,wp as O,xv as k,yv as A}from"./loadAgentsDir-BL93ulMm.js";import{di as j,ui as M}from"./src-P_wYS_NJ2.js";import{Wt as N,qt as P}from"./state-BemZdQIl.js";import{L as F,R as I}from"./debug-BecbSVoN.js";import{o as L,s as R}from"./log-Dauqle-Z.js";function z(e,t){let n=O(`tip`),r=g(`app:toggleTranscript`,`Global`,`ctrl+o`),i=[...e.options.verbose?[]:[`(${r} to see full summary)`],...t?[t]:[],...n?[n]:[]];return M.dim(`Compacted `+i.join(`
2
- `))}async function B(e,t){let n=e.getAppState(),r=await v(e.options.tools,e.options.mainLoopModel,Array.from(n.toolPermissionContext.additionalWorkingDirectories.keys()),e.options.mcpClients),i=b({mainThreadAgentDefinition:void 0,toolUseContext:e,customSystemPrompt:e.options.customSystemPrompt,defaultSystemPrompt:r,appendSystemPrompt:e.options.appendSystemPrompt}),[a,o]=await Promise.all([_(),A()]);return{systemPrompt:i,userContext:a,systemContext:o,toolUseContext:e,forkContextMessages:t}}var V;e((()=>{j(),N(),w(),k(),m(),a(),i(),C(),f(),T(),h(),u(),I(),D(),L(),n(),d(),y(),V=async(e,n)=>{let{abortController:i}=n,{messages:a}=n;if(a=s(a),a.length===0)throw Error(`No messages to compact`);let u=e.trim();try{if(!u){let e=await l(a,n.agentId);if(e)return _.cache.clear?.(),x(),E(n.options.querySource??`compact`,n.agentId),P(),t(),{type:`compact`,compactionResult:e,displayText:z(n)}}let e=(await r(a,n)).messages,i=await c(e,n,await B(n,e),!1,u,!1);return p(void 0),t(),_.cache.clear?.(),x(),{type:`compact`,compactionResult:i,displayText:z(n,i.userDisplayMessage)}}catch(e){throw i.signal.aborted?Error(`Compaction canceled.`):F(e,`Not enough messages to compact. Send a few more messages first, then try again.`)?Error(o):F(e,`Compaction interrupted · This may be due to network issues — please try again.`)?Error(S):(R(e),Error(`Error during compaction: ${e}`))}}}))();export{V as call};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{t}from"./jsx-runtime-Bb4Xn-E0.js";import{n,t as r}from"./Settings-DfdcmvOV.js";var i,a;e((()=>{n(),i=t(),a=async(e,t)=>(0,i.jsx)(r,{onClose:e,context:t,defaultTab:`Config`})}))();export{a as call};