claude-code-best 2.6.5 → 2.6.6

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 (430) hide show
  1. package/dist/chunks/{AddWorkspaceDirectory-BYyM_V0q.js → AddWorkspaceDirectory-Bb6crGWh.js} +1 -1
  2. package/dist/chunks/{App-BboadKdn.js → App-CW0Y4ceR.js} +1 -1
  3. package/dist/chunks/{ApproveApiKey-BLp4742y.js → ApproveApiKey-9rkwQfgT.js} +1 -1
  4. package/dist/chunks/ApproveApiKey-BhMr2Y5F.js +1 -0
  5. package/dist/chunks/{AssistantSessionChooser-B88DM0Oq.js → AssistantSessionChooser-XzXZZdiH.js} +1 -1
  6. package/dist/chunks/BackgroundTasksDialog-BL_dfbZP.js +2 -0
  7. package/dist/chunks/BypassPermissionsModeDialog-DlLWAKw2.js +1 -0
  8. package/dist/chunks/{ClaudeInChromeOnboarding-B6XNhFqq.js → ClaudeInChromeOnboarding-CjGydpBk.js} +1 -1
  9. package/dist/chunks/{ClaudeMdExternalIncludesDialog-BNhlq7_K.js → ClaudeMdExternalIncludesDialog-B04cjDwX.js} +1 -1
  10. package/dist/chunks/ClaudeMdExternalIncludesDialog-DPki55Xa.js +1 -0
  11. package/dist/chunks/ConsoleOAuthFlow-D_j1NebK.js +1 -0
  12. package/dist/chunks/{DesktopHandoff-S-w4bs5T.js → DesktopHandoff-CFBUqcCf.js} +1 -1
  13. package/dist/chunks/DevChannelsDialog-ByTf41du.js +1 -0
  14. package/dist/chunks/DiffDialog-CY-8kw_Q.js +3 -0
  15. package/dist/chunks/Doctor-2D5Wz58o.js +1 -0
  16. package/dist/chunks/Doctor-CDez_u_U.js +3 -0
  17. package/dist/chunks/{ExitFlow-CSBDxw9H.js → ExitFlow-BlON8IgH.js} +2 -2
  18. package/dist/chunks/Feedback-CSeD3k4M.js +2 -0
  19. package/dist/chunks/Grove-Dwu_0zRw.js +1 -0
  20. package/dist/chunks/{Grove-DSXRnXKv.js → Grove-Tp_UtIMg.js} +1 -1
  21. package/dist/chunks/{HybridTransport-CuT3KI5e.js → HybridTransport-CAko699F.js} +2 -2
  22. package/dist/chunks/{ITermBackend-mokGZVH_.js → ITermBackend-5P3WJumD.js} +1 -1
  23. package/dist/chunks/{InvalidConfigDialog-Bi4RKYlk.js → InvalidConfigDialog-CVcdra9v.js} +1 -1
  24. package/dist/chunks/{InvalidSettingsDialog-0zKo4-so.js → InvalidSettingsDialog-CfLdbmSI.js} +1 -1
  25. package/dist/chunks/MCPConnectionManager-BK_3uwQj.js +1 -0
  26. package/dist/chunks/{McpParsingWarnings-EzgsOoHw.js → McpParsingWarnings-BOj-T8F3.js} +1 -1
  27. package/dist/chunks/MessageSelector-BRkxpO1O.js +3 -0
  28. package/dist/chunks/Messages-wyMyMP7U.js +11 -0
  29. package/dist/chunks/{Onboarding-odmthwzz.js → Onboarding-C06Mxlf-.js} +1 -1
  30. package/dist/chunks/{OverageCreditUpsell-Cpk_5Lv0.js → OverageCreditUpsell-abcPm3PB.js} +1 -1
  31. package/dist/chunks/PluginSettings-DGpIVGvV.js +17 -0
  32. package/dist/chunks/{PromptInputFooterSuggestions-DrrkNOuS.js → PromptInputFooterSuggestions-ihnbjU0K.js} +1 -1
  33. package/dist/chunks/{PromptInputHelpMenu-DMsF4D6d.js → PromptInputHelpMenu-CMm8z7Gk.js} +1 -1
  34. package/dist/chunks/QueryEngine-I3Bqzbiz.js +1 -0
  35. package/dist/chunks/REPL-BxAsVlx3.js +1 -0
  36. package/dist/chunks/REPL-CBFcgD4r.js +97 -0
  37. package/dist/chunks/{RemoteCallout-CnpCWRPk.js → RemoteCallout-Cy6lH-CZ.js} +1 -1
  38. package/dist/chunks/{RemoteSessionManager-OWg_Yccq.js → RemoteSessionManager-C7iGd5Og.js} +2 -2
  39. package/dist/chunks/ResumeConversation-AdLtgdVB.js +1 -0
  40. package/dist/chunks/{SSETransport-BpnapvlK.js → SSETransport-B5xlXeAN.js} +1 -1
  41. package/dist/chunks/SearchExtraToolsTool-BJ8Nx_Nu.js +1 -0
  42. package/dist/chunks/SentryErrorBoundary-Bs7mtkPb.js +1 -0
  43. package/dist/chunks/{SentryErrorBoundary-C-NlfQZw.js → SentryErrorBoundary-iih9eFpM.js} +1 -1
  44. package/dist/chunks/Settings-PioHwsvg.js +2 -0
  45. package/dist/chunks/{TeleportProgress-CYXay2ZL.js → TeleportProgress-BX-uLwuL.js} +1 -1
  46. package/dist/chunks/TeleportRepoMismatchDialog-D8oPPTWd.js +1 -0
  47. package/dist/chunks/{TeleportResumeWrapper-DiHQeZIM.js → TeleportResumeWrapper-B_CvNDbr.js} +1 -1
  48. package/dist/chunks/{ThemePicker-BRh027fA.js → ThemePicker-BG1ykSpX.js} +1 -1
  49. package/dist/chunks/{TmuxBackend-BaX2U7iZ.js → TmuxBackend-CnMCWNS4.js} +1 -1
  50. package/dist/chunks/TrustDialog-Z_maAYj8.js +1 -0
  51. package/dist/chunks/{ValidationErrorsList-CdCUgfIl.js → ValidationErrorsList-C9swVkZ-.js} +1 -1
  52. package/dist/chunks/{WelcomeV2-DCXcYd2x.js → WelcomeV2-Au_5ddlT.js} +1 -1
  53. package/dist/chunks/WindowsTerminalBackend-CGxaYH74.js +2 -0
  54. package/dist/chunks/{add-dir-ldGd3Ppz.js → add-dir-Cm9u56YX.js} +1 -1
  55. package/dist/chunks/{agentDisplay-CVnAeURF.js → agentDisplay-Bi_bEyEn.js} +1 -1
  56. package/dist/chunks/{agents-DH5fmbVw.js → agents-CMF9fLzV.js} +7 -7
  57. package/dist/chunks/{agents-C08NzRZx.js → agents-CbjR7hNr.js} +1 -1
  58. package/dist/chunks/{ant-DJren1Aa.js → ant-Bu1Gs4WJ.js} +1 -1
  59. package/dist/chunks/api-CFNGoLoL.js +1 -0
  60. package/dist/chunks/{api-CGOR_Xfl.js → api-D_t0nHsS.js} +1 -1
  61. package/dist/chunks/assistant-BLd4y2FJ.js +1 -0
  62. package/dist/chunks/{assistant-aWkDcurV.js → assistant-C_pfWe2a.js} +1 -1
  63. package/dist/chunks/{assistant-BlzrMSkM.js → assistant-EA-MHNQ-.js} +1 -1
  64. package/dist/chunks/{auth-CSB2RDKF.js → auth-D7PZvVPf.js} +1 -1
  65. package/dist/chunks/auth-DGfZCD_B.js +1 -0
  66. package/dist/chunks/{autoMode-CWvZs1jO.js → autoMode-B8iO05xy.js} +6 -6
  67. package/dist/chunks/{autonomy-BkVcSMCZ.js → autonomy-CaLvE5N6.js} +12 -12
  68. package/dist/chunks/{autonomy-DK42aJYt.js → autonomy-dQVtSiCJ.js} +1 -1
  69. package/dist/chunks/{autonomyPanel-Cn4IhXgE.js → autonomyPanel-DSswVlCF.js} +1 -1
  70. package/dist/chunks/backgroundHousekeeping-Ckj8W3RO.js +1 -0
  71. package/dist/chunks/backgroundHousekeeping-D2_Uopt7.js +17 -0
  72. package/dist/chunks/{branch-juox_fko.js → branch-C7pM8Sjh.js} +1 -1
  73. package/dist/chunks/{bridge-DudsCZkh.js → bridge-CTYdzSWg.js} +2 -2
  74. package/dist/chunks/bridgeConfig-7c07tJm9.js +1 -0
  75. package/dist/chunks/{bridgeConfig-lRZfQqmA.js → bridgeConfig-Df6uyp3q.js} +1 -1
  76. package/dist/chunks/{bridgeEnabled-D2IykaHE.js → bridgeEnabled-A-_xJ94c.js} +1 -1
  77. package/dist/chunks/bridgeEnabled-Z2S8lk0l.js +1 -0
  78. package/dist/chunks/bridgeMain-B7FZpvo0.js +68 -0
  79. package/dist/chunks/bridgeMain-C5UxF8ST.js +1 -0
  80. package/dist/chunks/{bridgeMessaging-CqNURC4-.js → bridgeMessaging-DPVLAIzl.js} +1 -1
  81. package/dist/chunks/{btw-DKlE3Dea.js → btw-CqgjLlFN.js} +1 -1
  82. package/dist/chunks/{buddy-DQYgHR63.js → buddy-DCGBAqF2.js} +1 -1
  83. package/dist/chunks/{bypassPermissionsKillswitch-Bof-UtM-.js → bypassPermissionsKillswitch-CK0jeZTW.js} +1 -1
  84. package/dist/chunks/{caches-B5QZDncQ.js → caches-CdVW8fYV.js} +2 -2
  85. package/dist/chunks/caches-Dt52PedI.js +1 -0
  86. package/dist/chunks/{ccrClient-BaWg4E9-.js → ccrClient-B_3AmY7K.js} +1 -1
  87. package/dist/chunks/changeDetector-uO9CBvut.js +1 -0
  88. package/dist/chunks/{channelNotification-B7A-9DIl.js → channelNotification-BbDQdLZC.js} +1 -1
  89. package/dist/chunks/channelNotification-DzTzUrCe.js +1 -0
  90. package/dist/chunks/{chrome-jMAks7-w.js → chrome-CGyqsCkL.js} +1 -1
  91. package/dist/chunks/clear-B_cVk64B.js +1 -0
  92. package/dist/chunks/client-BcqXgcrx.js +1 -0
  93. package/dist/chunks/{color-DG_R5-hl.js → color-DEXUx7gE.js} +1 -1
  94. package/dist/chunks/commands-BX0_wEGw.js +1 -0
  95. package/dist/chunks/commitAttribution-CSVDcgTO.js +1 -0
  96. package/dist/chunks/{commitAttribution-C22a3OCi.js → commitAttribution-e0kkanVT.js} +1 -1
  97. package/dist/chunks/{compact-BWvnb4or.js → compact-Dh9RewNA.js} +3 -3
  98. package/dist/chunks/{companion-Bkn2lSLj.js → companion-DVFacTUw.js} +1 -1
  99. package/dist/chunks/{config-BvpTbJ5p.js → config-CkSmYDJY.js} +1 -1
  100. package/dist/chunks/{config-D-dzD6n-.js → config-DwiVCSrY.js} +1 -1
  101. package/dist/chunks/{context-DzNahdyP.js → context-B8VDDHTv.js} +1 -1
  102. package/dist/chunks/{context-noninteractive-yiyJriiw.js → context-noninteractive-IZfWniex.js} +2 -2
  103. package/dist/chunks/context-noninteractive-SBxqQ3iu.js +1 -0
  104. package/dist/chunks/conversation-CQBl9Yy2.js +1 -0
  105. package/dist/chunks/conversation-DVZplNag.js +1 -0
  106. package/dist/chunks/{copy-9k9JPRqW.js → copy-CIjrYoFa.js} +2 -2
  107. package/dist/chunks/{createSSHSession-BZf-Loo5.js → createSSHSession-ArNlbIZB.js} +1 -1
  108. package/dist/chunks/{createSession-kiTHYXSL.js → createSession-CBheIT_G.js} +1 -1
  109. package/dist/chunks/createSession-DfEQy2dZ.js +1 -0
  110. package/dist/chunks/cronJitterConfig-DcMGWOa-.js +6 -0
  111. package/dist/chunks/crossProjectResume-Z-aR2q-d.js +40 -0
  112. package/dist/chunks/{datadog-Bg-zL-i7.js → datadog-BK8eJz8B.js} +1 -1
  113. package/dist/chunks/datadog-Uj6FjEuU.js +1 -0
  114. package/dist/chunks/{desktop-DpaStjc-.js → desktop-B9vWJeRu.js} +1 -1
  115. package/dist/chunks/{diff-N_VSBo3Z.js → diff-BTV7_Dca.js} +1 -1
  116. package/dist/chunks/{doctor-CUWjbh1X.js → doctor-Dpbh0aRz.js} +1 -1
  117. package/dist/chunks/{effort-loH1TUvE.js → effort-Czlwa5qF.js} +2 -2
  118. package/dist/chunks/{entry-D58E-E6Y.js → entry-CdfuWjKu.js} +3 -3
  119. package/dist/chunks/{envLessBridgeConfig-SPEr9oqO.js → envLessBridgeConfig-BAFYaZ0E.js} +1 -1
  120. package/dist/chunks/envLessBridgeConfig-DOO9eX07.js +1 -0
  121. package/dist/chunks/{exit-D-tuPpbx.js → exit-DzOm62Dn.js} +1 -1
  122. package/dist/chunks/{export-BIZ_SPXJ.js → export-DHOR3z3Z.js} +1 -1
  123. package/dist/chunks/{exportRenderer-CWPSMaqM.js → exportRenderer-CiNXeNr9.js} +1 -1
  124. package/dist/chunks/extra-usage-CJcyfVCt.js +1 -0
  125. package/dist/chunks/{extra-usage-CCMwIa85.js → extra-usage-DIYR_3ZR.js} +1 -1
  126. package/dist/chunks/{extra-usage-core-BNW4VT7o.js → extra-usage-core-C3uM9bOP.js} +1 -1
  127. package/dist/chunks/{extra-usage-noninteractive-B_WjXO1E.js → extra-usage-noninteractive-Ctz9TfY8.js} +1 -1
  128. package/dist/chunks/{extraUsage-CNMMTNJi.js → extraUsage-CBwIvl73.js} +1 -1
  129. package/dist/chunks/extractMemories-C3SU-Osb.js +1 -0
  130. package/dist/chunks/fast-7iinMwk-.js +1 -0
  131. package/dist/chunks/{fast-CG1v3fRr.js → fast-BpBwjbSD.js} +1 -1
  132. package/dist/chunks/{feedback-CG4mS_-B.js → feedback-BkVnsZVx.js} +1 -1
  133. package/dist/chunks/{firstPartyEventLogger-Y_jAnHoR.js → firstPartyEventLogger-BCzGkdpd.js} +1 -1
  134. package/dist/chunks/{flushGate-COPcye5f.js → flushGate-CQsnMw8g.js} +1 -1
  135. package/dist/chunks/{gates-CSKxLmMJ.js → gates-CxWIWtmd.js} +1 -1
  136. package/dist/chunks/gates-qgzva-fO.js +1 -0
  137. package/dist/chunks/{gemini-B3uSLiNp.js → gemini-BbV8D2SS.js} +1 -1
  138. package/dist/chunks/{generateRecap-D7rG3jIm.js → generateRecap-B3j2nUgh.js} +1 -1
  139. package/dist/chunks/{generateSessionName-zbqanivg.js → generateSessionName-aGnXSNgN.js} +1 -1
  140. package/dist/chunks/{githubRepoPathMapping-B04nEUDG.js → githubRepoPathMapping-DCJLSTLl.js} +1 -1
  141. package/dist/chunks/{grok-CDOpos8E.js → grok-C4QFXJnR.js} +1 -1
  142. package/dist/chunks/{growthbook-C_EY78Sn.js → growthbook-prtWhMRg.js} +1 -1
  143. package/dist/chunks/{heapdump-CpmhJ55b.js → heapdump-Czm-2XiG.js} +1 -1
  144. package/dist/chunks/{help-EHn2neTv.js → help-CSAFsN0-.js} +1 -1
  145. package/dist/chunks/hooks-Ch2vPE8u.js +1 -0
  146. package/dist/chunks/{hooks-BV6HqbU4.js → hooks-DkbOP-bI.js} +2 -2
  147. package/dist/chunks/{hostAdapter-_SmFAVNf.js → hostAdapter-BcdDPVTj.js} +1 -1
  148. package/dist/chunks/{ide-DkN0KdTR.js → ide-BXERRFZF.js} +2 -2
  149. package/dist/chunks/{inboundAttachments-DnGQw7Pf.js → inboundAttachments-7rXrAtkb.js} +1 -1
  150. package/dist/chunks/inboundAttachments-C0rkLl2x.js +1 -0
  151. package/dist/chunks/initReplBridge-tXqkba08.js +1 -0
  152. package/dist/chunks/{insights-Bs9kJDG6.js → insights-DrvqJgF8.js} +25 -25
  153. package/dist/chunks/{install-CFX_ph9z.js → install-BGnxwO00.js} +1 -1
  154. package/dist/chunks/{install-github-app-CvRjY1Wi.js → install-github-app-CIpBHlr9.js} +2 -2
  155. package/dist/chunks/{install-slack-app-DjhnVSe0.js → install-slack-app-By4Lh7ww.js} +1 -1
  156. package/dist/chunks/{instrumentation-c5zlOWom.js → instrumentation-D9y7Ph_R.js} +3 -3
  157. package/dist/chunks/{job-3QwLq609.js → job-BPVIMW_P.js} +1 -1
  158. package/dist/chunks/{keybindings-7mDm3UKD.js → keybindings-Ce6AHMLI.js} +2 -2
  159. package/dist/chunks/{lang-DyyjY20G.js → lang-DfDG_fSa.js} +1 -1
  160. package/dist/chunks/language-B1yHC1d6.js +1 -0
  161. package/dist/chunks/{language-CPRGmY8Q.js → language-yGoDFP3X.js} +1 -1
  162. package/dist/chunks/{launchAgentsPlatform-CpsMsTqQ.js → launchAgentsPlatform-DT01xZM7.js} +1 -1
  163. package/dist/chunks/launchAutofixPr-DrYd7WVf.js +18 -0
  164. package/dist/chunks/{launchLocalMemory-DlYQcEQJ.js → launchLocalMemory-Bt3tMYVJ.js} +1 -1
  165. package/dist/chunks/{launchLocalVault-CP0AyPjj.js → launchLocalVault-jyRHEa_Y.js} +1 -1
  166. package/dist/chunks/{launchMemoryStores-BHoDFkJ5.js → launchMemoryStores-cmXnLAF5.js} +1 -1
  167. package/dist/chunks/{launchOnboarding-CFTNXcnc.js → launchOnboarding-BPTNFftb.js} +1 -1
  168. package/dist/chunks/{launchSchedule-5KQr6x_A.js → launchSchedule-141GqGC8.js} +1 -1
  169. package/dist/chunks/{launchSkillStore-D0yGuE68.js → launchSkillStore-Bz0lok_o.js} +1 -1
  170. package/dist/chunks/{launchTeleport-DRKnXOwY.js → launchTeleport-BMquJxIq.js} +2 -2
  171. package/dist/chunks/{launchVault-XA-zAswX.js → launchVault-Bsuwqad6.js} +1 -1
  172. package/dist/chunks/{loadAgentsDir-DI1a76pd.js → loadAgentsDir-D7kapZB5.js} +506 -498
  173. package/dist/chunks/loadAgentsDir-DxPE2bIO.js +1 -0
  174. package/dist/chunks/{loadPluginHooks-C0Ei-0E2.js → loadPluginHooks-CL5aGDrb.js} +1 -1
  175. package/dist/chunks/localSearch-iozuZZhZ.js +1 -0
  176. package/dist/chunks/{localSearch-CDOJNc_E.js → localSearch-r1_G8kfV.js} +1 -1
  177. package/dist/chunks/{login-nwTOoyxv.js → login-7MvpaOkt.js} +1 -1
  178. package/dist/chunks/login-Dxza_KNT.js +1 -0
  179. package/dist/chunks/{logoV2Utils-DDUoPClc.js → logoV2Utils-DjThKW15.js} +1 -1
  180. package/dist/chunks/logout-BeGQR78E.js +1 -0
  181. package/dist/chunks/{magicDocs-CmUlOWjI.js → magicDocs-Dy72LHIj.js} +2 -2
  182. package/dist/chunks/{main-CeG_nUsC.js → main-CF6Im-LV.js} +46 -46
  183. package/dist/chunks/{mappers-CJ8IO1o1.js → mappers-CkMESMy7.js} +1 -1
  184. package/dist/chunks/mcp-BTgHgOhR.js +2 -0
  185. package/dist/chunks/mcp-UJZ22IDJ.js +6 -0
  186. package/dist/chunks/mcp-fHf8Uc7h.js +1 -0
  187. package/dist/chunks/{mcpServer-lIneUZ5p.js → mcpServer-BueM5fWI.js} +1 -1
  188. package/dist/chunks/{mcpServer-DPHQVYdC.js → mcpServer-Dqm2PQQx.js} +1 -1
  189. package/dist/chunks/{memory-BcWBkKV8.js → memory-BNZmqma1.js} +1 -1
  190. package/dist/chunks/model-D3g2QdU-.js +1 -0
  191. package/dist/chunks/{model-DJLzVvcF.js → model-DOw7wIKQ.js} +1 -1
  192. package/dist/chunks/{onChangeAppState-Dxbl8fvk.js → onChangeAppState-Cb9_yIuW.js} +1 -1
  193. package/dist/chunks/{openai-DkYK4THc.js → openai-Bvo0Gcec.js} +3 -3
  194. package/dist/chunks/{overageCreditGrant-DLKadMYU.js → overageCreditGrant-BrN7dk3d.js} +1 -1
  195. package/dist/chunks/{passes-BIfuerjL.js → passes-vgcY8_l8.js} +1 -1
  196. package/dist/chunks/{paths-BBvuDQl9.js → paths-1ngPRtu3.js} +2 -2
  197. package/dist/chunks/permissions-BDbIjTT6.js +3 -0
  198. package/dist/chunks/{pipeTransport-DVoIA1uN.js → pipeTransport-KU8psPDI.js} +1 -1
  199. package/dist/chunks/{plan--lnWxB3Q.js → plan-5NVPuxp6.js} +1 -1
  200. package/dist/chunks/{plugin-DWLyrLw4.js → plugin-t8jMqdsY.js} +1 -1
  201. package/dist/chunks/{pluginAutoupdate-CGXIWBrb.js → pluginAutoupdate-CAa4KLro.js} +1 -1
  202. package/dist/chunks/{pluginBlocklist-DJrMdzT0.js → pluginBlocklist-BG2LkLq1.js} +1 -1
  203. package/dist/chunks/{pluginCliCommands-C08q9dHk.js → pluginCliCommands-vqAtVibb.js} +1 -1
  204. package/dist/chunks/{pluginFlagging-Dggxke70.js → pluginFlagging-BFCtv3kY.js} +1 -1
  205. package/dist/chunks/{pluginOperations-CNCImIe8.js → pluginOperations-C9XP-mko.js} +2 -2
  206. package/dist/chunks/pluginStartupCheck-DZp0wnXP.js +1 -0
  207. package/dist/chunks/{pluginStartupCheck-BW2fjg2P.js → pluginStartupCheck-RRcAbKfx.js} +1 -1
  208. package/dist/chunks/plugins-0SyID4Kx.js +4 -0
  209. package/dist/chunks/policyLimits-Cmmzuv-E.js +1 -0
  210. package/dist/chunks/{pollConfig-DAQ-ives.js → pollConfig-DTYIJ8lQ.js} +1 -1
  211. package/dist/chunks/{poor-DqfrQT61.js → poor-Dw5dMZpM.js} +1 -1
  212. package/dist/chunks/{poorMode-DzYT47KW.js → poorMode-CsGLI_hm.js} +1 -1
  213. package/dist/chunks/poorMode-D_hB-rDf.js +1 -0
  214. package/dist/chunks/{print-GGVp62vj.js → print-Ct8N4PYT.js} +12 -12
  215. package/dist/chunks/{privacy-settings-agwqjYJo.js → privacy-settings-P2r-kg2i.js} +1 -1
  216. package/dist/chunks/processBashCommand-a8W8aTRu.js +1 -0
  217. package/dist/chunks/{processSlashCommand-COtIO6Jy.js → processSlashCommand-BaUdUg3T.js} +3 -3
  218. package/dist/chunks/prompt-B1Qy8mi4.js +1 -0
  219. package/dist/chunks/{prompt-CjFAtm3w.js → prompt-BBg3jtfc.js} +1 -1
  220. package/dist/chunks/prompt-D4kWWEZC.js +1 -0
  221. package/dist/chunks/{promptEditor-EgosPsy-.js → promptEditor-CvaugNTt.js} +2 -2
  222. package/dist/chunks/{protocolHandler-mtPUT9U0.js → protocolHandler-DxBaHlaD.js} +1 -1
  223. package/dist/chunks/{rate-limit-options-C6SFOHue.js → rate-limit-options-Df_sgE0b.js} +1 -1
  224. package/dist/chunks/rcDebugLog-CPGWJbI4.js +11 -0
  225. package/dist/chunks/{referral-DeDr9zAE.js → referral-BKeCKnOJ.js} +1 -1
  226. package/dist/chunks/{refresh-D7pdoY_X.js → refresh-Cjv4jA6L.js} +1 -1
  227. package/dist/chunks/{registerProtocol-BZBH8Zgl.js → registerProtocol-DLuRm0mf.js} +1 -1
  228. package/dist/chunks/{registry-Dz6AbiYP.js → registry-DVSgtCq5.js} +1 -1
  229. package/dist/chunks/{release-notes-DiUNOrg9.js → release-notes-CZcf8zB7.js} +1 -1
  230. package/dist/chunks/{releaseNotes-CnhQit0y.js → releaseNotes-CvfZb3fZ.js} +2 -2
  231. package/dist/chunks/{reload-plugins-Dx52GcaG.js → reload-plugins-pSlDLk3b.js} +1 -1
  232. package/dist/chunks/{remote-env-B67Oo3sI.js → remote-env-BH89NuwC.js} +1 -1
  233. package/dist/chunks/{remoteBridgeCore-BzSUgPbt.js → remoteBridgeCore-CrXlWEL1.js} +1 -1
  234. package/dist/chunks/{remoteControlServer-L8smP7Zu.js → remoteControlServer-BSOnq4yY.js} +1 -1
  235. package/dist/chunks/{rename-C4PauyTZ.js → rename-DNGvNQm2.js} +1 -1
  236. package/dist/chunks/{resume-CrSn26xq.js → resume-6UL38yL3.js} +2 -2
  237. package/dist/chunks/{runtimeObserver-nAhH4Wca.js → runtimeObserver-BhvHeiwD.js} +4 -4
  238. package/dist/chunks/{runtimeObserver-YNy3mIb7.js → runtimeObserver-Cp-DN8fP.js} +1 -1
  239. package/dist/chunks/sandbox-adapter-DGVtPPD0.js +1 -0
  240. package/dist/chunks/{sandbox-toggle-BYqbcI5d.js → sandbox-toggle-D19YbI5G.js} +1 -1
  241. package/dist/chunks/searchExtraTools-DXWkpOIg.js +1 -0
  242. package/dist/chunks/{sentry-BNVxoVLS.js → sentry-BZmpC-iI.js} +1 -1
  243. package/dist/chunks/{session-BuEmHrqM.js → session-lLpGqp0B.js} +2 -2
  244. package/dist/chunks/{sessionDiscovery-Mcsfa0g-.js → sessionDiscovery-BX3fjgzD.js} +1 -1
  245. package/dist/chunks/sessionFileAccessHooks-BeuS4m7a.js +1 -0
  246. package/dist/chunks/sessionMemory-LMOQk90c.js +1 -0
  247. package/dist/chunks/sessionMemory-UpILj5ww.js +1 -0
  248. package/dist/chunks/sessionMemoryUtils-DE7AezA0.js +1 -0
  249. package/dist/chunks/{sessionObserver-DG2zQgfi.js → sessionObserver-CujNIWks.js} +1 -1
  250. package/dist/chunks/sessionObserver-HqvTXhs9.js +1 -0
  251. package/dist/chunks/sessionStorage-BN56DAAd.js +1 -0
  252. package/dist/chunks/{sessionTitle-zUVSAHO7.js → sessionTitle-QxXslbJY.js} +1 -1
  253. package/dist/chunks/{sessionTracing-DoRJ4nSa.js → sessionTracing-DognYcDf.js} +1 -1
  254. package/dist/chunks/{settingsSync-B9bz77E1.js → settingsSync-DEPET5O1.js} +1 -1
  255. package/dist/chunks/{setup-B1JbPepL.js → setup-BUBUidOg.js} +1 -1
  256. package/dist/chunks/setup-BZMVuIIx.js +2 -0
  257. package/dist/chunks/{setup-CCOLlRtP.js → setup-C6G0lasE.js} +1 -1
  258. package/dist/chunks/{shadowedRuleDetection-BBR3uEgx.js → shadowedRuleDetection-CQayPrmM.js} +1 -1
  259. package/dist/chunks/{sideQuestion-DHW5rgKz.js → sideQuestion-B9EE1vTM.js} +1 -1
  260. package/dist/chunks/sink-BRrEbL6h.js +1 -0
  261. package/dist/chunks/{sink-DxDOsLa2.js → sink-Cugto5We.js} +1 -1
  262. package/dist/chunks/{sinks-BrrTUxkC.js → sinks-B9A94oIj.js} +2 -2
  263. package/dist/chunks/sinks-CKaSBvU8.js +1 -0
  264. package/dist/chunks/{skill-learning-C0nOKZfg.js → skill-learning-CroDcatu.js} +1 -1
  265. package/dist/chunks/skillChangeDetector-DnyEQqe6.js +1 -0
  266. package/dist/chunks/{skillGapStore-_YuJP5KI.js → skillGapStore-91Mb3xDY.js} +2 -2
  267. package/dist/chunks/{skillGapStore-Czi5jKjJ.js → skillGapStore-LKwap3o4.js} +1 -1
  268. package/dist/chunks/{skillGenerator-kbaRbpqJ.js → skillGenerator-B9GM0LHk.js} +2 -2
  269. package/dist/chunks/skillLearning-D6latSKi.js +1 -0
  270. package/dist/chunks/skillLearning-DbOOqb6b.js +1 -0
  271. package/dist/chunks/{skillPanel-BxDvlPzd.js → skillPanel-rIIYgnBE.js} +3 -3
  272. package/dist/chunks/{skillSearchPanel-D-MX6Qgt.js → skillSearchPanel-xAL-6uJF.js} +4 -4
  273. package/dist/chunks/{skills-NpEgFkFZ.js → skills-Doe47wxK.js} +1 -1
  274. package/dist/chunks/{sprites-DD4eIkN7.js → sprites-D11F3i1M.js} +1 -1
  275. package/dist/chunks/{stats-xL3NHwhp.js → stats-WNUyieG-.js} +1 -1
  276. package/dist/chunks/{status-B5E70xRv.js → status-CjBS9SkF.js} +1 -1
  277. package/dist/chunks/{statusNoticeHelpers-DcssRhLw.js → statusNoticeHelpers-cnI4TiGw.js} +1 -1
  278. package/dist/chunks/{tag-BELr-qIa.js → tag-Gfb8vTAR.js} +2 -2
  279. package/dist/chunks/{tasks-CrdWcSt-.js → tasks-BwX1rzOD.js} +1 -1
  280. package/dist/chunks/{teamHelpers--3ZyNDlv.js → teamHelpers-DEgaCpta.js} +1 -1
  281. package/dist/chunks/teamHelpers-EJxTXoTV.js +1 -0
  282. package/dist/chunks/teammateModeSnapshot-BgUQ4Phz.js +1 -0
  283. package/dist/chunks/{teammateModeSnapshot-DOQMTKbQ.js → teammateModeSnapshot-Dyukgtp9.js} +1 -1
  284. package/dist/chunks/teleport-B4p8XlAv.js +1 -0
  285. package/dist/chunks/{templateJobs-8IY2Cgig.js → templateJobs-DQXuFnkl.js} +1 -1
  286. package/dist/chunks/{terminalSetup-C4psrmpb.js → terminalSetup-CTEIn08j.js} +1 -1
  287. package/dist/chunks/{terminalSetup-Lyg4NbGA.js → terminalSetup-bSbq4LE7.js} +1 -1
  288. package/dist/chunks/{theme-B8GNnJ_q.js → theme-DazaKPy8.js} +1 -1
  289. package/dist/chunks/thinkback-BOfZP_QG.js +1 -0
  290. package/dist/chunks/{thinkback-DPXwEK3B.js → thinkback-CxWZV2Oz.js} +1 -1
  291. package/dist/chunks/{thinkback-play-BMOE-ceh.js → thinkback-play-CHe1x2Hc.js} +1 -1
  292. package/dist/chunks/{toolEventObserver-DzLd0MSn.js → toolEventObserver-D4h-QqVP.js} +1 -1
  293. package/dist/chunks/{toolEventObserver-D0TSHm01.js → toolEventObserver-Dfvv2trb.js} +1 -1
  294. package/dist/chunks/toolPool-BHChMuLr.js +1 -0
  295. package/dist/chunks/toolPool-C5K43w4_.js +1 -0
  296. package/dist/chunks/{trustedDevice-1iTu4LEm.js → trustedDevice-CQ9PK-8m.js} +1 -1
  297. package/dist/chunks/{trustedDevice-BvYYXfd8.js → trustedDevice-rdvUkS1W.js} +1 -1
  298. package/dist/chunks/{ultrareviewCommand-BTXAN2wP.js → ultrareviewCommand-Zf9hO4wr.js} +2 -2
  299. package/dist/chunks/{undercover-DvvnEmsX.js → undercover-DLyKv5TE.js} +1 -1
  300. package/dist/chunks/undercover-DNS9V_JT.js +1 -0
  301. package/dist/chunks/{updateCCB-C-qfLi0j.js → updateCCB-7WQRz9lW.js} +4 -4
  302. package/dist/chunks/{upgrade-DTBZSxwv.js → upgrade-ByIumMQe.js} +1 -1
  303. package/dist/chunks/upgrade-bK4x32Ma.js +1 -0
  304. package/dist/chunks/{upload-BF8tf_Eo.js → upload-CvOMbA9_.js} +1 -1
  305. package/dist/chunks/{usage-DvSTXEYY.js → usage-C_d-Z-eb.js} +1 -1
  306. package/dist/chunks/{usage-BRYRRgNt.js → usage-DE4PSQiF.js} +1 -1
  307. package/dist/chunks/useMainLoopModel-Os8Ao8-x.js +1 -0
  308. package/dist/chunks/{useManagePlugins-GmnI9K53.js → useManagePlugins-BYBubfHU.js} +1 -1
  309. package/dist/chunks/{useMergedTools-Dah5KDMi.js → useMergedTools-BJAn2i-F.js} +1 -1
  310. package/dist/chunks/{useSearchInput-BV_azHiA.js → useSearchInput-CF77X2OV.js} +1 -1
  311. package/dist/chunks/useSettingsErrors-DD7fQ-fU.js +1 -0
  312. package/dist/chunks/{useVoice-DR69NLxp.js → useVoice-DwzMN0fq.js} +1 -1
  313. package/dist/chunks/{util-BpyJ4Bom.js → util-DD30Y4o8.js} +1 -1
  314. package/dist/chunks/utils-D44M8obg.js +1 -0
  315. package/dist/chunks/validatePlugin-DpHiJRsT.js +1 -0
  316. package/dist/chunks/{vim-DvOw8dfR.js → vim-zc9EiMil.js} +1 -1
  317. package/dist/chunks/{voice-B3BZs53f.js → voice-BRhZt4jW.js} +2 -2
  318. package/dist/chunks/{voiceModeEnabled-DA76xN1Q.js → voiceModeEnabled-168-1Ocs.js} +1 -1
  319. package/dist/chunks/voiceModeEnabled-CTT25yFj.js +1 -0
  320. package/dist/chunks/{voiceStreamSTT-_w1VjIOs.js → voiceStreamSTT-B80UegKG.js} +1 -1
  321. package/dist/chunks/voiceStreamSTT-BpYhKo2H.js +1 -0
  322. package/dist/chunks/{workerRegistry-2_MZVih1.js → workerRegistry-s8nnpmUO.js} +1 -1
  323. package/dist/chunks/worktree-CkB4jLXK.js +1 -0
  324. package/dist/chunks/{xml-Dx--sNE1.js → xml-DTMvLcPg.js} +1 -1
  325. package/dist/cli.js +1 -1
  326. package/package.json +1 -1
  327. package/dist/chunks/ApproveApiKey-DiEe4eui.js +0 -1
  328. package/dist/chunks/BackgroundTasksDialog-ByraVuXh.js +0 -2
  329. package/dist/chunks/BypassPermissionsModeDialog-BDvmz12S.js +0 -1
  330. package/dist/chunks/ClaudeMdExternalIncludesDialog-B4ocUjev.js +0 -1
  331. package/dist/chunks/ConsoleOAuthFlow-BvaB9b0y.js +0 -1
  332. package/dist/chunks/DevChannelsDialog-BljR0X9X.js +0 -1
  333. package/dist/chunks/DiffDialog-BhQ2QaLW.js +0 -3
  334. package/dist/chunks/Doctor-BXb0qv6n.js +0 -3
  335. package/dist/chunks/Doctor-C5DYPEGl.js +0 -1
  336. package/dist/chunks/Feedback-DwHzc4UT.js +0 -2
  337. package/dist/chunks/Grove-DnTo982-.js +0 -1
  338. package/dist/chunks/MCPConnectionManager-DYGoS1Ht.js +0 -1
  339. package/dist/chunks/MessageSelector-DTmUuEKJ.js +0 -3
  340. package/dist/chunks/Messages-DWiKTx5o.js +0 -11
  341. package/dist/chunks/PluginSettings-eYcWehI8.js +0 -17
  342. package/dist/chunks/QueryEngine-C_KZts4y.js +0 -1
  343. package/dist/chunks/REPL-C6YR0VKU.js +0 -1
  344. package/dist/chunks/REPL-DzHz-LOY.js +0 -97
  345. package/dist/chunks/ResumeConversation-BktSnsCm.js +0 -1
  346. package/dist/chunks/SearchExtraToolsTool-CqFD8vVS.js +0 -1
  347. package/dist/chunks/SentryErrorBoundary-BUirJRWU.js +0 -1
  348. package/dist/chunks/Settings-vfFvcweR.js +0 -2
  349. package/dist/chunks/TeleportRepoMismatchDialog-_zbZTvcJ.js +0 -1
  350. package/dist/chunks/TrustDialog-CVbzrv6g.js +0 -1
  351. package/dist/chunks/WindowsTerminalBackend-BE9NX5IH.js +0 -2
  352. package/dist/chunks/api-6tcwJlf_.js +0 -1
  353. package/dist/chunks/assistant-CwbhlCM-.js +0 -1
  354. package/dist/chunks/auth-GxZhOvQ1.js +0 -1
  355. package/dist/chunks/backgroundHousekeeping-BIZTAYho.js +0 -17
  356. package/dist/chunks/backgroundHousekeeping-Csh58CxV.js +0 -1
  357. package/dist/chunks/bridgeConfig-D4tpc568.js +0 -1
  358. package/dist/chunks/bridgeEnabled-B8_c_Ppq.js +0 -1
  359. package/dist/chunks/bridgeMain-C5RDihlX.js +0 -68
  360. package/dist/chunks/bridgeMain-D7_lg2iJ.js +0 -1
  361. package/dist/chunks/caches-dGk7xsDu.js +0 -1
  362. package/dist/chunks/changeDetector-DoLfg8a6.js +0 -1
  363. package/dist/chunks/channelNotification-DDErroWn.js +0 -1
  364. package/dist/chunks/clear-OudnCGa7.js +0 -1
  365. package/dist/chunks/client-DxDmXXTh.js +0 -1
  366. package/dist/chunks/commands-BWIOEBPs.js +0 -1
  367. package/dist/chunks/commitAttribution-BA4fcbHf.js +0 -1
  368. package/dist/chunks/context-noninteractive-CM1-lUSe.js +0 -1
  369. package/dist/chunks/conversation-DKlz47xf.js +0 -1
  370. package/dist/chunks/conversation-cUxdb8MN.js +0 -1
  371. package/dist/chunks/createSession-BuJcoBAj.js +0 -1
  372. package/dist/chunks/cronJitterConfig-CYP7yrQu.js +0 -6
  373. package/dist/chunks/crossProjectResume-BJisir9Z.js +0 -40
  374. package/dist/chunks/datadog-CVeFkaQu.js +0 -1
  375. package/dist/chunks/envLessBridgeConfig-CT8sdmFu.js +0 -1
  376. package/dist/chunks/extra-usage-rdJ7ecEb.js +0 -1
  377. package/dist/chunks/extractMemories-BrvZVsmM.js +0 -1
  378. package/dist/chunks/fast-CLKKsx2H.js +0 -1
  379. package/dist/chunks/gates-CSHuXnUx.js +0 -1
  380. package/dist/chunks/hooks-BFdX17Za.js +0 -1
  381. package/dist/chunks/inboundAttachments-BVUunfAX.js +0 -1
  382. package/dist/chunks/initReplBridge-tPRGPBq7.js +0 -1
  383. package/dist/chunks/language-Cf6bMI4N.js +0 -1
  384. package/dist/chunks/launchAutofixPr-D9h6YAZY.js +0 -2
  385. package/dist/chunks/loadAgentsDir-DCyiY0MN.js +0 -1
  386. package/dist/chunks/localSearch-MBx7KzC2.js +0 -1
  387. package/dist/chunks/login-D8UKKaud.js +0 -1
  388. package/dist/chunks/logout-B0BjqlGi.js +0 -1
  389. package/dist/chunks/mcp-CanCqnch.js +0 -2
  390. package/dist/chunks/mcp-Dq0kxZFx.js +0 -6
  391. package/dist/chunks/mcp-zbxZM9BP.js +0 -1
  392. package/dist/chunks/model-H3rtl6eR.js +0 -1
  393. package/dist/chunks/permissions-S2EvIRKj.js +0 -3
  394. package/dist/chunks/pluginStartupCheck-DpxQPXJE.js +0 -1
  395. package/dist/chunks/plugins-DQ3CRWWO.js +0 -4
  396. package/dist/chunks/policyLimits-BotYrS-v.js +0 -1
  397. package/dist/chunks/poorMode-DEAe3hiK.js +0 -1
  398. package/dist/chunks/processBashCommand-DHHN8Ca4.js +0 -1
  399. package/dist/chunks/prompt-CO160cIr.js +0 -1
  400. package/dist/chunks/prompt-GY9hlRvI.js +0 -1
  401. package/dist/chunks/rcDebugLog-CPKZCtR8.js +0 -11
  402. package/dist/chunks/sandbox-adapter-CzwHes1i.js +0 -1
  403. package/dist/chunks/searchExtraTools-CcpdCO6l.js +0 -1
  404. package/dist/chunks/sessionFileAccessHooks-qnNiGMnE.js +0 -1
  405. package/dist/chunks/sessionMemory-CMahwDdW.js +0 -1
  406. package/dist/chunks/sessionMemory-pFSn4HSN.js +0 -1
  407. package/dist/chunks/sessionMemoryUtils-Du5jUl7M.js +0 -1
  408. package/dist/chunks/sessionObserver-Je868MC9.js +0 -1
  409. package/dist/chunks/sessionStorage-D3FhAADV.js +0 -1
  410. package/dist/chunks/setup-DWkSjA49.js +0 -2
  411. package/dist/chunks/sink-cQOgsnw3.js +0 -1
  412. package/dist/chunks/sinks-Djiz_5-Z.js +0 -1
  413. package/dist/chunks/skillChangeDetector-D8C-uQSQ.js +0 -1
  414. package/dist/chunks/skillLearning-3KWrBczS.js +0 -1
  415. package/dist/chunks/skillLearning-DBbdGbk-.js +0 -1
  416. package/dist/chunks/teamHelpers-CUAiXng3.js +0 -1
  417. package/dist/chunks/teammateModeSnapshot-C6EWhR0X.js +0 -1
  418. package/dist/chunks/teleport-LXFOan9C.js +0 -1
  419. package/dist/chunks/thinkback-DZW3Mcx_.js +0 -1
  420. package/dist/chunks/toolPool-DVOfpjDz.js +0 -1
  421. package/dist/chunks/toolPool-Dq-Vtvrj.js +0 -1
  422. package/dist/chunks/undercover-C_44e3oN.js +0 -1
  423. package/dist/chunks/upgrade-CGXa5Dwy.js +0 -1
  424. package/dist/chunks/useMainLoopModel-CwvuTRXn.js +0 -1
  425. package/dist/chunks/useSettingsErrors-C-j_Zt7g.js +0 -1
  426. package/dist/chunks/utils-CrZcpypC.js +0 -1
  427. package/dist/chunks/validatePlugin-vptAYuYu.js +0 -1
  428. package/dist/chunks/voiceModeEnabled-DIveLYGb.js +0 -1
  429. package/dist/chunks/voiceStreamSTT-hpzWd_zl.js +0 -1
  430. package/dist/chunks/worktree-CCuDwRmS.js +0 -1
@@ -1,12 +1,12 @@
1
- import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{n,s as r}from"./envUtils-BWeoiL4Y.js";import{g as i}from"./client-_sjL0I7A.js";import{n as a,t as o}from"./figures-gfT9mM8P.js";import{In as s,Ln as c,Rn as l,b as u,f as d,g as f,h as p,m,t as h,tt as g,x as _}from"./src-Di342QoJ.js";import{t as v}from"./jsx-runtime-D-D469L8.js";import{Ct as y,cn as b}from"./state-sIHsFpDu.js";import{$o as x,Bc as S,Bl as ee,Do as C,Fa as te,Hc as ne,Na as re,Po as ie,a as ae,ec as oe,jo as se,ls as ce,nc as le,rs as ue,s as de,us as fe,zl as pe}from"./paths-BBvuDQl9.js";import{K as me,R as he,T as ge,V as _e,w as ve}from"./debug-UI3T040K.js";import{n as ye,r as be}from"./analytics-DqMQntaB.js";import{n as xe,t as Se}from"./cwd--iizewsn.js";import{t as Ce}from"./sdk-DEtgRZvI.js";import{o as we,s as Te}from"./log-CzsijfHZ.js";import{b as Ee,x as De}from"./teammate-DMYOtLTK.js";import{E as Oe,x as ke}from"./startupProfiler-DnXZaX4A.js";import{AE as Ae,Ap as je,Bc as Me,Bg as Ne,Bp as Pe,CD as Fe,Dp as Ie,Dx as Le,Ep as Re,Fw as ze,Gf as Be,Gn as Ve,Hg as He,IE as Ue,Iw as We,JS as w,Jy as Ge,Kf as Ke,Ko as qe,Ku as Je,Lf as Ye,Lo as Xe,Lp as Ze,ME as Qe,MS as $e,Mp as et,Np as tt,Nx as nt,Ox as rt,PS as it,Px as at,Rf as ot,Rp as st,SD as ct,S_ as lt,Un as ut,Vc as dt,Wf as ft,Wn as pt,XC as mt,Xy as ht,YS as T,Yy as gt,ZC as _t,Zy as vt,b_ as yt,bo as bt,c as xt,cC as St,c_ as Ct,fk as wt,gy as Tt,hp as Et,hu as Dt,jE as Ot,jO as kt,jS as At,jp as jt,l as Mt,lC as Nt,l_ as Pt,lt as Ft,mp as It,mu as Lt,my as Rt,nE as zt,np as Bt,o as Vt,pk as Ht,qf as Ut,qu as Wt,qy as Gt,r as Kt,rt as qt,s as Jt,s_ as Yt,st as Xt,t as Zt,tE as Qt,tp as $t,tt as en,y_ as tn,zp as nn}from"./loadAgentsDir-DI1a76pd.js";import{Bn as rn,Vn as an}from"./prompt-CjFAtm3w.js";import{X as on}from"./rcDebugLog-CPKZCtR8.js";import{t as E}from"./useKeybinding-FsOnjW6T.js";import{l as sn,u as cn}from"./referral-DeDr9zAE.js";import{r as ln,t as un}from"./TungstenTool-V-Bwqlx3.js";import{a as dn,i as fn,n as pn,o as mn,r as hn,t as gn}from"./agentDisplay-CVnAeURF.js";import{n as _n,t as vn}from"./useMergedTools-Dah5KDMi.js";import{n as yn,r as bn,t as xn}from"./promptEditor-EgosPsy-.js";import{n as Sn,t as Cn}from"./useMainLoopModel-CwvuTRXn.js";import{join as D}from"path";import{mkdir as wn,open as Tn,unlink as En}from"fs/promises";var O,Dn=e((()=>{O={FOLDER_NAME:`.claude`,AGENTS_DIR:`agents`}}));function On(e,t,n,r,i,a,o,s){return`---
1
+ import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{n,s as r}from"./envUtils-BWeoiL4Y.js";import{g as i}from"./client-_sjL0I7A.js";import{n as a,t as o}from"./figures-gfT9mM8P.js";import{In as s,Ln as c,Rn as l,b as u,f as d,g as f,h as p,m,t as h,tt as g,x as _}from"./src-Di342QoJ.js";import{t as v}from"./jsx-runtime-D-D469L8.js";import{Ct as y,cn as b}from"./state-sIHsFpDu.js";import{$o as x,Bc as S,Bl as ee,Do as C,Fa as te,Hc as ne,Na as re,Po as ie,a as ae,ec as oe,jo as se,ls as ce,nc as le,rs as ue,s as de,us as fe,zl as pe}from"./paths-1ngPRtu3.js";import{K as me,R as he,T as ge,V as _e,w as ve}from"./debug-UI3T040K.js";import{n as ye,r as be}from"./analytics-DqMQntaB.js";import{n as xe,t as Se}from"./cwd--iizewsn.js";import{t as Ce}from"./sdk-DEtgRZvI.js";import{o as we,s as Te}from"./log-CzsijfHZ.js";import{b as Ee,x as De}from"./teammate-DMYOtLTK.js";import{E as Oe,x as ke}from"./startupProfiler-DnXZaX4A.js";import{$C as Ae,$y as je,Ap as Me,Ax as Ne,Bc as Pe,Bp as Fe,Dp as Ie,Ep as Le,Fx as Re,Gf as ze,Gn as Be,IS as Ve,Ix as He,Kf as Ue,Ko as We,Ku as Ge,Lf as Ke,Lo as qe,Lp as Je,Lw as Ye,ME as Xe,Mp as Ze,NE as Qe,NO as $e,NS as et,Np as tt,PE as nt,PS as rt,QC as it,Qy as at,RE as ot,Rf as st,Rp as ct,Rw as lt,TD as ut,Un as dt,Vc as ft,Vg as pt,Wf as mt,Wn as ht,XS as w,Xy as gt,Yy as _t,ZS as T,Zy as vt,bo as yt,c as bt,c_ as xt,dC as St,gy as Ct,hk as wt,hp as Tt,hu as Et,iE as Dt,jp as Ot,kx as kt,l as At,lt as jt,mk as Mt,mp as Nt,mu as Pt,np as Ft,o as It,o_ as Lt,qf as Rt,qu as zt,r as Bt,rE as Vt,rt as Ht,s as Ut,s_ as Wt,st as Gt,t as Kt,tp as qt,tt as Jt,uC as Yt,v_ as Xt,vy as Zt,wD as Qt,x_ as $t,y_ as en,zg as tn,zp as nn}from"./loadAgentsDir-D7kapZB5.js";import{Bn as rn,Vn as an}from"./prompt-BBg3jtfc.js";import{X as on}from"./rcDebugLog-CPGWJbI4.js";import{t as E}from"./useKeybinding-FsOnjW6T.js";import{l as sn,u as cn}from"./referral-BKeCKnOJ.js";import{r as ln,t as un}from"./TungstenTool-V-Bwqlx3.js";import{a as dn,i as fn,n as pn,o as mn,r as hn,t as gn}from"./agentDisplay-Bi_bEyEn.js";import{n as _n,t as vn}from"./useMergedTools-BJAn2i-F.js";import{n as yn,r as bn,t as xn}from"./promptEditor-CvaugNTt.js";import{n as Sn,t as Cn}from"./useMainLoopModel-Os8Ao8-x.js";import{join as D}from"path";import{mkdir as wn,open as Tn,unlink as En}from"fs/promises";var O,Dn=e((()=>{O={FOLDER_NAME:`.claude`,AGENTS_DIR:`agents`}}));function On(e,t,n,r,i,a,o,s){return`---
2
2
  name: ${e}
3
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}`:``}${s===void 0?``:`\neffort: ${s}`}${i?`\ncolor: ${i}`:``}${o?`\nmemory: ${o}`:``}
4
4
  ---
5
5
 
6
6
  ${r}
7
- `}function kn(e){switch(e){case`flagSettings`:throw Error(`Cannot get directory path for ${e} agents`);case`userSettings`:return D(n(),O.AGENTS_DIR);case`projectSettings`:return D(Se(),O.FOLDER_NAME,O.AGENTS_DIR);case`policySettings`:return D(S(),O.FOLDER_NAME,O.AGENTS_DIR);case`localSettings`:return D(Se(),O.FOLDER_NAME,O.AGENTS_DIR)}}function An(e){switch(e){case`projectSettings`:return D(`.`,O.FOLDER_NAME,O.AGENTS_DIR);default:return kn(e)}}function jn(e){return D(kn(e.source),`${e.agentType}.md`)}function Mn(e){if(e.source===`built-in`)return`Built-in`;if(e.source===`plugin`)throw Error(`Cannot get file path for plugin agents`);return D(kn(e.source),`${e.filename||e.agentType}.md`)}function Nn(e){return e.source===`built-in`?`Built-in`:D(An(e.source),`${e.agentType}.md`)}function Pn(e){return Jt(e)?`Built-in`:Mt(e)?`Plugin: ${e.plugin||`Unknown`}`:e.source===`flagSettings`?`CLI argument`:D(An(e.source),`${e.filename||e.agentType}.md`)}async function Fn(e){let t=kn(e);return await wn(t,{recursive:!0}),t}async function In(e,t,n,r,i,a=!0,o,s,c,l){if(e===`built-in`)throw Error(`Cannot save built-in agents`);await Fn(e);let u=jn({source:e,agentType:t}),d=On(t,n,r,i,o,s,c,l);try{await zn(u,d,a?`wx`:`w`)}catch(e){throw he(e)===`EEXIST`?Error(`Agent file already exists: ${u}`):e}}async function Ln(e,t,n,r,i,a,o,s){if(e.source===`built-in`)throw Error(`Cannot update built-in agents`);await zn(Mn(e),On(e.agentType,t,n,r,i,a,o,s))}async function Rn(e){if(e.source===`built-in`)throw Error(`Cannot delete built-in agents`);let t=Mn(e);try{await En(t)}catch(e){if(he(e)!==`ENOENT`)throw e}}async function zn(e,t,n=`w`){let r=await Tn(e,n);try{await r.writeFile(t,{encoding:`utf-8`}),await r.datasync()}finally{await r.close()}}var Bn=e((()=>{ne(),Vt(),xe(),r(),_e(),Dn()}));function Vn({agent:e,tools:t,onBack:n}){let r=Pt(e,t,!1),i=Pn(e),a=gt(e.agentType);g(`confirm:no`,n,{context:`Confirmation`});let s=e=>{e.key===`return`&&(e.preventDefault(),n())};function c(){return r.hasWildcard?(0,k.jsx)(u,{children:`All tools`}):!e.tools||e.tools.length===0?(0,k.jsx)(u,{children:`None`}):(0,k.jsxs)(k.Fragment,{children:[r.validTools.length>0&&(0,k.jsx)(u,{children:r.validTools.join(`, `)}),r.invalidTools.length>0&&(0,k.jsxs)(u,{color:`warning`,children:[o.warning,` Unrecognized: `,r.invalidTools.join(`, `)]})]})}return(0,k.jsxs)(_,{flexDirection:`column`,gap:1,tabIndex:0,autoFocus:!0,onKeyDown:s,children:[(0,k.jsx)(u,{dimColor:!0,children:i}),(0,k.jsxs)(_,{flexDirection:`column`,children:[(0,k.jsxs)(u,{children:[(0,k.jsx)(u,{bold:!0,children:`Description`}),` (tells Claude when to use this agent):`]}),(0,k.jsx)(_,{marginLeft:2,children:(0,k.jsx)(u,{children:e.whenToUse})})]}),(0,k.jsxs)(_,{children:[(0,k.jsxs)(u,{children:[(0,k.jsx)(u,{bold:!0,children:`Tools`}),`:`,` `]}),c()]}),(0,k.jsxs)(u,{children:[(0,k.jsx)(u,{bold:!0,children:`Model`}),`: `,tn(e.model)]}),e.permissionMode&&(0,k.jsxs)(u,{children:[(0,k.jsx)(u,{bold:!0,children:`Permission mode`}),`: `,e.permissionMode]}),e.memory&&(0,k.jsxs)(u,{children:[(0,k.jsx)(u,{bold:!0,children:`Memory`}),`: `,ut(e.memory)]}),e.hooks&&Object.keys(e.hooks).length>0&&(0,k.jsxs)(u,{children:[(0,k.jsx)(u,{bold:!0,children:`Hooks`}),`: `,Object.keys(e.hooks).join(`, `)]}),e.skills&&e.skills.length>0&&(0,k.jsxs)(u,{children:[(0,k.jsx)(u,{bold:!0,children:`Skills`}),`:`,` `,e.skills.length>10?`${e.skills.length} skills`:e.skills.join(`, `)]}),a&&(0,k.jsx)(_,{children:(0,k.jsxs)(u,{children:[(0,k.jsx)(u,{bold:!0,children:`Color`}),`:`,` `,(0,k.jsxs)(u,{backgroundColor:a,color:`inverseText`,children:[` `,e.agentType,` `]})]})}),!Jt(e)&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(_,{children:(0,k.jsxs)(u,{children:[(0,k.jsx)(u,{bold:!0,children:`System prompt`}),`:`]})}),(0,k.jsx)(_,{marginLeft:2,marginRight:2,children:(0,k.jsx)(Ne,{children:e.getSystemPrompt()})})]})]})}var k,Hn=e((()=>{a(),l(),h(),E(),ht(),pt(),Ct(),Vt(),lt(),He(),Bn(),k=v()}));function Un({agentName:e,currentColor:t=`automatic`,onConfirm:n}){let[r,i]=(0,Wn.useState)(Math.max(0,Gn.indexOf(t))),a=e=>{if(e.key===`up`)e.preventDefault(),i(e=>e>0?e-1:Gn.length-1);else if(e.key===`down`)e.preventDefault(),i(e=>e<Gn.length-1?e+1:0);else if(e.key===`return`){e.preventDefault();let t=Gn[r];n(t===`automatic`?void 0:t)}},s=Gn[r];return(0,A.jsxs)(_,{flexDirection:`column`,gap:1,tabIndex:0,autoFocus:!0,onKeyDown:a,children:[(0,A.jsx)(_,{flexDirection:`column`,children:Gn.map((e,t)=>{let n=t===r;return(0,A.jsxs)(_,{flexDirection:`row`,gap:1,children:[(0,A.jsx)(u,{color:n?`suggestion`:void 0,children:n?o.pointer:` `}),e===`automatic`?(0,A.jsx)(u,{bold:n,children:`Automatic color`}):(0,A.jsxs)(_,{gap:1,children:[(0,A.jsx)(u,{backgroundColor:Ge[e],color:`inverseText`,children:` `}),(0,A.jsx)(u,{bold:n,children:C(e)})]})]},e)})}),(0,A.jsxs)(_,{marginTop:1,children:[(0,A.jsx)(u,{children:`Preview: `}),s===void 0||s===`automatic`?(0,A.jsxs)(u,{inverse:!0,bold:!0,children:[` `,`@`,e,` `]}):(0,A.jsxs)(u,{backgroundColor:Ge[s],color:`inverseText`,bold:!0,children:[` `,`@`,e,` `]})]})]})}var Wn,A,Gn,Kn=e((()=>{a(),Wn=t(l(),1),h(),ht(),se(),A=v(),Gn=[`automatic`,...Gt]}));function qn({initialModel:e,onComplete:t,onCancel:n}){let r=Jn.useMemo(()=>{let t=yt();return e&&!t.some(t=>t.value===e)?[{value:e,label:e,description:`Current model (custom ID)`},...t]:t},[e]);return(0,Yn.jsxs)(_,{flexDirection:`column`,children:[(0,Yn.jsx)(_,{marginBottom:1,children:(0,Yn.jsx)(u,{dimColor:!0,children:`Model determines the agent's reasoning capabilities and speed.`})}),(0,Yn.jsx)(Le,{options:r,defaultValue:e??`sonnet`,onChange:t,onCancel:()=>n?n():t(void 0)})]})}var Jn,Yn,Xn=e((()=>{Jn=t(l(),1),h(),lt(),rt(),Yn=v()}));function Zn(){return{READ_ONLY:{name:`Read-only tools`,toolNames:new Set([je.name,et.name,Ye.name,Me.name,It.name,Qt.name,ft.name,$t.name,Ke.name,ze.name,St.name])},EDIT:{name:`Edit tools`,toolNames:new Set([nn.name,Ze.name,Re.name])},EXECUTION:{name:`Execution tools`,toolNames:new Set([Lt.name,process.env.USER_TYPE===`ant`?un.name:void 0].filter(e=>e!==void 0))},MCP:{name:`MCP tools`,toolNames:new Set,isMcp:!0},OTHER:{name:`Other tools`,toolNames:new Set}}}function Qn(e){let t=new Map;return e.forEach(e=>{if(_t(e)){let n=fe(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 $n({tools:e,initialTools:t,onComplete:n,onCancel:r}){let i=(0,j.useMemo)(()=>Yt({tools:e,isBuiltIn:!1,isAsync:!1}),[e]),[a,s]=(0,j.useState)(!t||t.includes(`*`)?i.map(e=>e.name):t),[c,l]=(0,j.useState)(0),[d,f]=(0,j.useState)(!1),p=(0,j.useMemo)(()=>{let e=new Set(i.map(e=>e.name));return a.filter(t=>e.has(t))},[a,i]),h=new Set(p),v=p.length===i.length&&i.length>0,y=e=>{e&&s(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},b=(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))})},x=()=>{let e=i.map(e=>e.name);n(p.length===e.length&&e.every(e=>p.includes(e))?void 0:p)},S=(0,j.useMemo)(()=>{let e=Zn(),t={readOnly:[],edit:[],execution:[],mcp:[],other:[]};return i.forEach(n=>{_t(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]),ee=e=>{let t=Ee(e,e=>h.has(e.name))<e.length;return()=>{b(e.map(e=>e.name),t)}},C=[];C.push({id:`continue`,label:`Continue`,action:x,isContinue:!0}),C.push({id:`bucket-all`,label:`${v?o.checkboxOn:o.checkboxOff} All tools`,action:()=>{b(i.map(e=>e.name),!v)}});let te=Zn();[{id:`bucket-readonly`,name:te.READ_ONLY.name,tools:S.readOnly},{id:`bucket-edit`,name:te.EDIT.name,tools:S.edit},{id:`bucket-execution`,name:te.EXECUTION.name,tools:S.execution},{id:`bucket-mcp`,name:te.MCP.name,tools:S.mcp},{id:`bucket-other`,name:te.OTHER.name,tools:S.other}].forEach(({id:e,name:t,tools:n})=>{if(n.length===0)return;let r=Ee(n,e=>h.has(e.name))===n.length;C.push({id:e,label:`${r?o.checkboxOn:o.checkboxOff} ${t}`,action:ee(n)})});let ne=C.length;C.push({id:`toggle-individual`,label:d?`Hide advanced options`:`Show advanced options`,action:()=>{f(!d),d&&c>ne&&l(ne)},isToggle:!0});let re=(0,j.useMemo)(()=>Qn(i),[i]);return d&&(re.length>0&&(C.push({id:`mcp-servers-header`,label:`MCP Servers:`,action:()=>{},isHeader:!0}),re.forEach(({serverName:e,tools:t})=>{let n=Ee(t,e=>h.has(e.name))===t.length;C.push({id:`mcp-server-${e}`,label:`${n?o.checkboxOn:o.checkboxOff} ${e} (${t.length} ${ie(t.length,`tool`)})`,action:()=>{b(t.map(e=>e.name),!n)}})}),C.push({id:`tools-header`,label:`Individual Tools:`,action:()=>{},isHeader:!0})),i.forEach(e=>{let t=e.name;if(e.name.startsWith(`mcp__`)){let n=fe(e.name);t=n?`${n.toolName} (${n.serverName})`:e.name}C.push({id:`tool-${e.name}`,label:`${h.has(e.name)?o.checkboxOn:o.checkboxOff} ${t}`,action:()=>y(e.name)})})),g(`confirm:no`,(0,j.useCallback)(()=>{r?r():n(t)},[r,n,t]),{context:`Confirmation`}),(0,M.jsxs)(_,{flexDirection:`column`,marginTop:1,tabIndex:0,autoFocus:!0,onKeyDown:e=>{if(e.key===`return`){e.preventDefault();let t=C[c];t&&!t.isHeader&&t.action()}else if(e.key===`up`){e.preventDefault();let t=c-1;for(;t>0&&C[t]?.isHeader;)t--;l(Math.max(0,t))}else if(e.key===`down`){e.preventDefault();let t=c+1;for(;t<C.length-1&&C[t]?.isHeader;)t++;l(Math.min(C.length-1,t))}},children:[(0,M.jsxs)(u,{color:c===0?`suggestion`:void 0,bold:c===0,children:[c===0?`${o.pointer} `:` `,`[ Continue ]`]}),(0,M.jsx)(m,{width:40}),C.slice(1).map((e,t)=>{let n=t+1===c,r=e.isToggle,i=e.isHeader;return(0,M.jsxs)(j.Fragment,{children:[r&&(0,M.jsx)(m,{width:40}),i&&t>0&&(0,M.jsx)(_,{marginTop:1}),(0,M.jsxs)(u,{color:i?void 0:n?`suggestion`:void 0,dimColor:i,bold:r&&n,children:[i?``:n?`${o.pointer} `:` `,r?`[ ${e.label} ]`:e.label]})]},e.id)}),(0,M.jsx)(_,{marginTop:1,flexDirection:`column`,children:(0,M.jsx)(u,{dimColor:!0,children:v?`All tools selected`:`${h.size} of ${i.length} tools selected`})})]})}var j,M,er=e((()=>{a(),j=t(l(),1),ce(),mt(),Ct(),ue(),Dt(),ot(),Pe(),dt(),st(),jt(),tt(),We(),Ie(),Nt(),Ut(),Bt(),zt(),ln(),Et(),Be(),h(),E(),De(),se(),M=v()}));function tr(e){return e===`all`?`Agents`:e===`built-in`?`Built-in agents`:e===`plugin`?`Plugin agents`:pe(oe(e))}var nr=e((()=>{ee(),le()}));function rr({agent:e,tools:t,onSaved:n,onBack:r}){let i=it(),[a,c]=(0,N.useState)(`menu`),[l,d]=(0,N.useState)(0),[f,p]=(0,N.useState)(null),[m,h]=(0,N.useState)(e.color),v=(0,N.useCallback)(async()=>{let t=await xn(Mn(e));t.error?p(t.error):n(`Opened ${e.agentType} in editor. If you made edits, restart to load the latest version.`)},[e,n]),y=(0,N.useCallback)(async(t={})=>{let{tools:r,color:a,model:o}=t,c=a??m,l=r!==void 0,u=o!==void 0,d=c!==e.color;if(!l&&!u&&!d)return!1;try{return!xt(e)&&!Mt(e)?!1:(await Ln(e,e.whenToUse,r??e.tools,e.getSystemPrompt(),c,o??e.model),d&&c&&vt(e.agentType,c),i(t=>{let n=t.agentDefinitions.allAgents.map(t=>t.agentType===e.agentType?{...t,tools:r??t.tools,color:c,model:o??t.model}:t);return{...t,agentDefinitions:{...t.agentDefinitions,activeAgents:Kt(n),allAgents:n}}}),n(`Updated agent: ${s.bold(e.agentType)}`),!0)}catch(e){return p(e instanceof Error?e.message:`Failed to save agent`),!1}},[e,m,n,i]),b=(0,N.useMemo)(()=>[{label:`Open in editor`,action:v},{label:`Edit tools`,action:()=>c(`edit-tools`)},{label:`Edit model`,action:()=>c(`edit-model`)},{label:`Edit color`,action:()=>c(`edit-color`)}],[v]),x=(0,N.useCallback)(()=>{p(null),a===`menu`?r():c(`menu`)},[a,r]),S=(0,N.useCallback)(e=>{if(e.key===`up`)e.preventDefault(),d(e=>Math.max(0,e-1));else if(e.key===`down`)e.preventDefault(),d(e=>Math.min(b.length-1,e+1));else if(e.key===`return`){e.preventDefault();let t=b[l];t&&t.action()}},[b,l]);g(`confirm:no`,x,{context:`Confirmation`});let ee=()=>(0,P.jsxs)(_,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:S,children:[(0,P.jsxs)(u,{dimColor:!0,children:[`Source: `,tr(e.source)]}),(0,P.jsx)(_,{marginTop:1,flexDirection:`column`,children:b.map((e,t)=>(0,P.jsxs)(u,{color:t===l?`suggestion`:void 0,children:[t===l?`${o.pointer} `:` `,e.label]},e.label))}),f&&(0,P.jsx)(_,{marginTop:1,children:(0,P.jsx)(u,{color:`error`,children:f})})]});switch(a){case`menu`:return ee();case`edit-tools`:return(0,P.jsx)($n,{tools:t,initialTools:e.tools,onComplete:async e=>{c(`menu`),await y({tools:e})}});case`edit-color`:return(0,P.jsx)(Un,{agentName:e.agentType,currentColor:m||e.color||`automatic`,onConfirm:async e=>{h(e),c(`menu`),await y({color:e})}});case`edit-model`:return(0,P.jsx)(qn,{initialModel:e.model,onComplete:async e=>{c(`menu`),await y({model:e})}});default:return null}}var N,P,ir=e((()=>{c(),a(),l(),N=t(l(),1),At(),h(),E(),ht(),Vt(),bn(),Bn(),Kn(),Xn(),er(),nr(),P=v()}));function ar({instructions:e=`Press ↑↓ to navigate · Enter to select · Esc to go back`}){let t=cn();return(0,or.jsx)(_,{marginLeft:2,children:(0,or.jsx)(u,{dimColor:!0,children:t.pending?`Press ${t.keyName} again to exit`:e})})}var or,sr=e((()=>{l(),sn(),h(),or=v()}));function cr({source:e,agents:t,onBack:n,onSelect:r,onCreateNew:i,changes:a}){let[s,c]=F.useState(null),[l,f]=F.useState(!0),p=F.useMemo(()=>[...t].sort(pn),[t]),h=e=>({isOverridden:!!e.overriddenBy,overriddenBy:e.overriddenBy||null}),g=()=>(0,I.jsxs)(_,{children:[(0,I.jsx)(u,{color:l?`suggestion`:void 0,children:l?`${o.pointer} `:` `}),(0,I.jsx)(u,{color:l?`suggestion`:void 0,children:`Create new agent`})]}),v=e=>{let t=e.source===`built-in`,n=!t&&!l&&s?.agentType===e.agentType&&s?.source===e.source,{isOverridden:r,overriddenBy:i}=h(e),a=t||r,c=!t&&n?`suggestion`:void 0,d=dn(e);return(0,I.jsxs)(_,{children:[(0,I.jsx)(u,{dimColor:a&&!n,color:c,children:t?``:n?`${o.pointer} `:` `}),(0,I.jsx)(u,{dimColor:a&&!n,color:c,children:e.agentType}),d&&(0,I.jsxs)(u,{dimColor:!0,color:c,children:[` · `,d]}),e.memory&&(0,I.jsxs)(u,{dimColor:!0,color:c,children:[` · `,e.memory,` memory`]}),i&&(0,I.jsxs)(u,{dimColor:!n,color:n?`warning`:void 0,children:[` `,o.warning,` shadowed by `,hn(i)]})]},`${e.agentType}-${e.source}`)},y=F.useMemo(()=>{let t=p.filter(e=>e.source!==`built-in`);return e===`all`?gn.filter(e=>e.source!==`built-in`).flatMap(({source:e})=>t.filter(t=>t.source===e)):t},[p,e]);F.useEffect(()=>{!s&&!l&&y.length>0&&(i?f(!0):c(y[0]||null))},[y,s,l,i]);let b=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=y.length+ +!!t;if(n===0)return;let a=0;if(!l&&s){let e=y.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)f(!0),c(null);else{let e=y[t?o-1:o];e&&(f(!1),c(e))}},x=(e=`Built-in (always available):`)=>{let t=p.filter(e=>e.source===`built-in`);return(0,I.jsxs)(_,{flexDirection:`column`,marginBottom:1,paddingLeft:2,children:[(0,I.jsx)(u,{bold:!0,dimColor:!0,children:e}),t.map(v)]})},S=(e,t)=>{if(!t.length)return null;let n=t[0]?.baseDir;return(0,I.jsxs)(_,{flexDirection:`column`,marginBottom:1,children:[(0,I.jsxs)(_,{paddingLeft:2,children:[(0,I.jsx)(u,{bold:!0,dimColor:!0,children:e}),n&&(0,I.jsxs)(u,{dimColor:!0,children:[` (`,n,`)`]})]}),t.map(e=>v(e))]})},ee=tr(e),C=p.filter(e=>e.source===`built-in`);return!p.length||e!==`built-in`&&!p.some(e=>e.source!==`built-in`)?(0,I.jsx)(d,{title:ee,subtitle:`No agents found`,onCancel:n,hideInputGuide:!0,children:(0,I.jsxs)(_,{flexDirection:`column`,gap:1,tabIndex:0,autoFocus:!0,onKeyDown:b,children:[i&&(0,I.jsx)(_,{children:g()}),(0,I.jsx)(u,{dimColor:!0,children:`No agents found. Create specialized subagents that Claude can delegate to.`}),(0,I.jsx)(u,{dimColor:!0,children:`Each subagent has its own context window, custom system prompt, and specific tools.`}),(0,I.jsx)(u,{dimColor:!0,children:`Try creating: Code Reviewer, Code Simplifier, Security Reviewer, Tech Lead, or UX Reviewer.`}),e!==`built-in`&&p.some(e=>e.source===`built-in`)&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(m,{}),x()]})]})}):(0,I.jsxs)(d,{title:ee,subtitle:`${Ee(p,e=>!e.overriddenBy)} agents`,onCancel:n,hideInputGuide:!0,children:[a&&a.length>0&&(0,I.jsx)(_,{marginTop:1,children:(0,I.jsx)(u,{dimColor:!0,children:a[a.length-1]})}),(0,I.jsxs)(_,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:b,children:[i&&(0,I.jsx)(_,{marginBottom:1,children:g()}),e===`all`?(0,I.jsxs)(I.Fragment,{children:[gn.filter(e=>e.source!==`built-in`).map(({label:e,source:t})=>(0,I.jsx)(F.Fragment,{children:S(e,p.filter(e=>e.source===t))},t)),C.length>0&&(0,I.jsxs)(_,{flexDirection:`column`,marginBottom:1,paddingLeft:2,children:[(0,I.jsxs)(u,{dimColor:!0,children:[(0,I.jsx)(u,{bold:!0,children:`Built-in agents`}),` (always available)`]}),C.map(v)]})]}):e===`built-in`?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(u,{dimColor:!0,italic:!0,children:`Built-in agents are provided by default and cannot be modified.`}),(0,I.jsx)(_,{marginTop:1,flexDirection:`column`,children:p.map(e=>v(e))})]}):(0,I.jsxs)(I.Fragment,{children:[p.filter(e=>e.source!==`built-in`).map(e=>v(e)),p.some(e=>e.source===`built-in`)&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(m,{}),x()]})]})]})]})}var F,I,lr=e((()=>{a(),F=t(l(),1),h(),fn(),De(),nr(),I=v()}));function ur({steps:e,initialData:t={},onComplete:n,onCancel:r,children:i,title:a,showStepCounter:o=!0}){let[s,c]=(0,L.useState)(0),[l,u]=(0,L.useState)(t),[d,f]=(0,L.useState)(!1),[p,m]=(0,L.useState)([]);cn(),(0,L.useEffect)(()=>{d&&(m([]),n(l))},[d,l,n]);let h=(0,L.useCallback)(()=>{s<e.length-1?(p.length>0&&m(e=>[...e,s]),c(e=>e+1)):f(!0)},[s,e.length,p]),g=(0,L.useCallback)(()=>{if(p.length>0){let e=p[p.length-1];e!==void 0&&(m(e=>e.slice(0,-1)),c(e))}else s>0?c(e=>e-1):r&&r()},[s,p,r]),_=(0,L.useCallback)(t=>{t>=0&&t<e.length&&(m(e=>[...e,s]),c(t))},[s,e.length]),v=(0,L.useCallback)(()=>{m([]),r&&r()},[r]),y=(0,L.useCallback)(e=>{u(t=>({...t,...e}))},[]),b=(0,L.useMemo)(()=>({currentStepIndex:s,totalSteps:e.length,wizardData:l,setWizardData:u,updateWizardData:y,goNext:h,goBack:g,goToStep:_,cancel:v,title:a,showStepCounter:o}),[s,e.length,l,y,h,g,_,v,a,o]),x=e[s];return!x||d?null:(0,dr.jsx)(fr.Provider,{value:b,children:i||(0,dr.jsx)(x,{})})}var L,dr,fr,pr=e((()=>{L=t(l(),1),sn(),dr=v(),fr=(0,L.createContext)(null)}));function R(){let e=(0,mr.useContext)(fr);if(!e)throw Error(`useWizard must be used within a WizardProvider`);return e}var mr,hr=e((()=>{mr=t(l(),1),pr()}));function gr({instructions:e=(0,z.jsxs)(p,{children:[(0,z.jsx)(f,{shortcut:`↑↓`,action:`navigate`}),(0,z.jsx)(f,{shortcut:`Enter`,action:`select`}),(0,z.jsx)(w,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]})}){let t=cn();return(0,z.jsx)(_,{marginLeft:3,marginTop:1,children:(0,z.jsx)(u,{dimColor:!0,children:t.pending?`Press ${t.keyName} again to exit`:e})})}var z,_r=e((()=>{sn(),h(),T(),z=v()}));function B({title:e,color:t=`suggestion`,children:n,subtitle:r,footerText:i}){let{currentStepIndex:a,totalSteps:o,title:s,showStepCounter:c,goBack:l}=R();return(0,vr.jsxs)(vr.Fragment,{children:[(0,vr.jsx)(d,{title:`${e||s||`Wizard`}${c===!1?``:` (${a+1}/${o})`}`,subtitle:r,onCancel:l,color:t,hideInputGuide:!0,isCancelActive:!1,children:n}),(0,vr.jsx)(gr,{instructions:i})]})}var vr,V=e((()=>{h(),hr(),_r(),vr=v()})),H=e((()=>{hr(),V(),_r(),pr()}));function yr(){let{goNext:e,goBack:t,updateWizardData:n,wizardData:r}=R();return g(`confirm:no`,t,{context:`Confirmation`}),(0,U.jsx)(B,{subtitle:`Choose background color`,footerText:(0,U.jsxs)(p,{children:[(0,U.jsx)(f,{shortcut:`↑↓`,action:`navigate`}),(0,U.jsx)(f,{shortcut:`Enter`,action:`select`}),(0,U.jsx)(w,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:(0,U.jsx)(_,{children:(0,U.jsx)(Un,{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,br=e((()=>{h(),E(),T(),H(),V(),Kn(),U=v()}));function xr(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 Sr(e,t,n){let r=[],i=[];if(!e.agentType)r.push(`Agent type is required`);else{let t=xr(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 ${tr(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=Pt(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 Cr=e((()=>{Ct(),nr()}));function wr({tools:e,existingAgents:t,onSave:n,onSaveAndEdit:r,error:i}){let{goBack:a,wizardData:o}=R();g(`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=Sr(c,e,t),d=Oe(c.getSystemPrompt(),240),m=Oe(c.whenToUse,240),h=e=>e===void 0?`All tools`:e.length===0?`None`:e.length===1?e[0]||`None`:e.length===2?e.join(` and `):`${e.slice(0,-1).join(`, `)}, and ${e[e.length-1]}`,v=de()?(0,W.jsxs)(u,{children:[(0,W.jsx)(u,{bold:!0,children:`Memory`}),`: `,ut(c.memory)]}):null;return(0,W.jsx)(B,{subtitle:`Confirm and save`,footerText:(0,W.jsxs)(p,{children:[(0,W.jsx)(f,{shortcut:`s/Enter`,action:`save`}),(0,W.jsx)(f,{shortcut:`e`,action:`edit in your editor`}),(0,W.jsx)(w,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]}),children:(0,W.jsxs)(_,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:s,children:[(0,W.jsxs)(u,{children:[(0,W.jsx)(u,{bold:!0,children:`Name`}),`: `,c.agentType]}),(0,W.jsxs)(u,{children:[(0,W.jsx)(u,{bold:!0,children:`Location`}),`:`,` `,Nn({source:o.location,agentType:c.agentType})]}),(0,W.jsxs)(u,{children:[(0,W.jsx)(u,{bold:!0,children:`Tools`}),`: `,h(c.tools)]}),(0,W.jsxs)(u,{children:[(0,W.jsx)(u,{bold:!0,children:`Model`}),`: `,tn(c.model)]}),v,(0,W.jsx)(_,{marginTop:1,children:(0,W.jsxs)(u,{children:[(0,W.jsx)(u,{bold:!0,children:`Description`}),` (tells Claude when to use this agent):`]})}),(0,W.jsx)(_,{marginLeft:2,marginTop:1,children:(0,W.jsx)(u,{children:m})}),(0,W.jsx)(_,{marginTop:1,children:(0,W.jsxs)(u,{children:[(0,W.jsx)(u,{bold:!0,children:`System prompt`}),`:`]})}),(0,W.jsx)(_,{marginLeft:2,marginTop:1,children:(0,W.jsx)(u,{children:d})}),l.warnings.length>0&&(0,W.jsxs)(_,{marginTop:1,flexDirection:`column`,children:[(0,W.jsx)(u,{color:`warning`,children:`Warnings:`}),l.warnings.map((e,t)=>(0,W.jsxs)(u,{dimColor:!0,children:[` `,`• `,e]},t))]}),l.errors.length>0&&(0,W.jsxs)(_,{marginTop:1,flexDirection:`column`,children:[(0,W.jsx)(u,{color:`error`,children:`Errors:`}),l.errors.map((e,t)=>(0,W.jsxs)(u,{color:`error`,children:[` `,`• `,e]},t))]}),i&&(0,W.jsx)(_,{marginTop:1,children:(0,W.jsx)(u,{color:`error`,children:i})}),(0,W.jsx)(_,{marginTop:2,children:(0,W.jsxs)(u,{color:`success`,children:[`Press `,(0,W.jsx)(u,{bold:!0,children:`s`}),` or `,(0,W.jsx)(u,{bold:!0,children:`Enter`}),` to save, `,(0,W.jsx)(u,{bold:!0,children:`e`}),` to save and edit`]})})]})})}var W,Tr=e((()=>{h(),E(),ae(),pt(),ke(),lt(),T(),H(),V(),Bn(),Cr(),W=v()}));function Er({tools:e,existingAgents:t,onComplete:n}){let{wizardData:r}=R(),[i,a]=(0,Dr.useState)(null),o=it(),c=(0,Dr.useCallback)(async e=>{if(r?.finalAgent)try{await In(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:Kt(t),allAgents:t}}}),Zt(),e&&await xn(jn({source:r.location,agentType:r.finalAgent.agentType})),be(`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: ${s.bold(r.finalAgent.agentType)} and opened in editor. If you made edits, restart to load the latest version.`:`Created agent: ${s.bold(r.finalAgent.agentType)}`)}catch(e){a(e instanceof Error?e.message:`Failed to save agent`)}},[r,n,o]);return(0,Or.jsx)(wr,{tools:e,existingAgents:t,onSave:(0,Dr.useCallback)(()=>c(!1),[c]),onSaveAndEdit:(0,Dr.useCallback)(()=>c(!0),[c]),error:i})}var Dr,Or,kr=e((()=>{c(),Dr=t(l(),1),ye(),At(),Vt(),bn(),H(),Bn(),Tr(),Or=v()}));function Ar(){let{goNext:e,goBack:t,updateWizardData:n,wizardData:r}=R(),[i,a]=(0,jr.useState)(r.whenToUse||``),[o,s]=(0,jr.useState)(i.length),[c,l]=(0,jr.useState)(null);return g(`confirm:no`,t,{context:`Settings`}),g(`chat:externalEditor`,(0,jr.useCallback)(async()=>{let e=await yn(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)(p,{children:[(0,G.jsx)(f,{shortcut:`Type`,action:`enter text`}),(0,G.jsx)(f,{shortcut:`Enter`,action:`continue`}),(0,G.jsx)(w,{action:`chat:externalEditor`,context:`Chat`,fallback:`ctrl+g`,description:`open in editor`}),(0,G.jsx)(w,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`go back`})]}),children:(0,G.jsxs)(_,{flexDirection:`column`,children:[(0,G.jsx)(u,{children:`When should Claude use this agent?`}),(0,G.jsx)(_,{marginTop:1,children:(0,G.jsx)(nt,{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)(_,{marginTop:1,children:(0,G.jsx)(u,{color:`error`,children:c})})]})})}var jr,G,Mr=e((()=>{jr=t(l(),1),h(),E(),bn(),T(),at(),H(),V(),G=v()}));async function Nr(e,t,n,r){let i=bt({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 wt(),o=Ft([i],a),s=de()?Pr+Fr:Pr,c=Ue()?Ot({sessionId:y(),model:t,provider:re(),name:`agent-creation`}):null,l=await qt({messages:qe(o),systemPrompt:on([s]),thinkingConfig:{type:`disabled`},tools:[],signal:r,options:{getToolPermissionContext:async()=>rn(),model:t,toolChoice:void 0,agents:[],isNonInteractiveSession:!1,hasAppendSystemPrompt:!1,querySource:`agent_creation`,mcpTools:[],langfuseTrace:c}});Qe(c);let u=(Array.isArray(l.message.content)?l.message.content:[]).filter(e=>e.type===`text`).map(e=>e.text).join(`
9
- `),d;try{d=ge(u.trim())}catch{let e=u.match(/\{[\s\S]*\}/);if(!e)throw Error(`No JSON object found in response`);d=ge(e[0])}if(!d.identifier||!d.whenToUse||!d.systemPrompt)throw Error(`Invalid agent configuration generated`);return be(`tengu_agent_definition_generated`,{agent_identifier:d.identifier}),{identifier:d.identifier,whenToUse:d.whenToUse,systemPrompt:d.systemPrompt}}var Pr,Fr,Ir=e((()=>{Ht(),en(),an(),ue(),Xt(),Xe(),ae(),ye(),Ae(),b(),te(),ve(),kt(),Pr=`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.
7
+ `}function kn(e){switch(e){case`flagSettings`:throw Error(`Cannot get directory path for ${e} agents`);case`userSettings`:return D(n(),O.AGENTS_DIR);case`projectSettings`:return D(Se(),O.FOLDER_NAME,O.AGENTS_DIR);case`policySettings`:return D(S(),O.FOLDER_NAME,O.AGENTS_DIR);case`localSettings`:return D(Se(),O.FOLDER_NAME,O.AGENTS_DIR)}}function An(e){switch(e){case`projectSettings`:return D(`.`,O.FOLDER_NAME,O.AGENTS_DIR);default:return kn(e)}}function jn(e){return D(kn(e.source),`${e.agentType}.md`)}function Mn(e){if(e.source===`built-in`)return`Built-in`;if(e.source===`plugin`)throw Error(`Cannot get file path for plugin agents`);return D(kn(e.source),`${e.filename||e.agentType}.md`)}function Nn(e){return e.source===`built-in`?`Built-in`:D(An(e.source),`${e.agentType}.md`)}function Pn(e){return Ut(e)?`Built-in`:At(e)?`Plugin: ${e.plugin||`Unknown`}`:e.source===`flagSettings`?`CLI argument`:D(An(e.source),`${e.filename||e.agentType}.md`)}async function Fn(e){let t=kn(e);return await wn(t,{recursive:!0}),t}async function In(e,t,n,r,i,a=!0,o,s,c,l){if(e===`built-in`)throw Error(`Cannot save built-in agents`);await Fn(e);let u=jn({source:e,agentType:t}),d=On(t,n,r,i,o,s,c,l);try{await zn(u,d,a?`wx`:`w`)}catch(e){throw he(e)===`EEXIST`?Error(`Agent file already exists: ${u}`):e}}async function Ln(e,t,n,r,i,a,o,s){if(e.source===`built-in`)throw Error(`Cannot update built-in agents`);await zn(Mn(e),On(e.agentType,t,n,r,i,a,o,s))}async function Rn(e){if(e.source===`built-in`)throw Error(`Cannot delete built-in agents`);let t=Mn(e);try{await En(t)}catch(e){if(he(e)!==`ENOENT`)throw e}}async function zn(e,t,n=`w`){let r=await Tn(e,n);try{await r.writeFile(t,{encoding:`utf-8`}),await r.datasync()}finally{await r.close()}}var Bn=e((()=>{ne(),It(),xe(),r(),_e(),Dn()}));function Vn({agent:e,tools:t,onBack:n}){let r=xt(e,t,!1),i=Pn(e),a=vt(e.agentType);g(`confirm:no`,n,{context:`Confirmation`});let s=e=>{e.key===`return`&&(e.preventDefault(),n())};function c(){return r.hasWildcard?(0,k.jsx)(u,{children:`All tools`}):!e.tools||e.tools.length===0?(0,k.jsx)(u,{children:`None`}):(0,k.jsxs)(k.Fragment,{children:[r.validTools.length>0&&(0,k.jsx)(u,{children:r.validTools.join(`, `)}),r.invalidTools.length>0&&(0,k.jsxs)(u,{color:`warning`,children:[o.warning,` Unrecognized: `,r.invalidTools.join(`, `)]})]})}return(0,k.jsxs)(_,{flexDirection:`column`,gap:1,tabIndex:0,autoFocus:!0,onKeyDown:s,children:[(0,k.jsx)(u,{dimColor:!0,children:i}),(0,k.jsxs)(_,{flexDirection:`column`,children:[(0,k.jsxs)(u,{children:[(0,k.jsx)(u,{bold:!0,children:`Description`}),` (tells Claude when to use this agent):`]}),(0,k.jsx)(_,{marginLeft:2,children:(0,k.jsx)(u,{children:e.whenToUse})})]}),(0,k.jsxs)(_,{children:[(0,k.jsxs)(u,{children:[(0,k.jsx)(u,{bold:!0,children:`Tools`}),`:`,` `]}),c()]}),(0,k.jsxs)(u,{children:[(0,k.jsx)(u,{bold:!0,children:`Model`}),`: `,Xt(e.model)]}),e.permissionMode&&(0,k.jsxs)(u,{children:[(0,k.jsx)(u,{bold:!0,children:`Permission mode`}),`: `,e.permissionMode]}),e.memory&&(0,k.jsxs)(u,{children:[(0,k.jsx)(u,{bold:!0,children:`Memory`}),`: `,dt(e.memory)]}),e.hooks&&Object.keys(e.hooks).length>0&&(0,k.jsxs)(u,{children:[(0,k.jsx)(u,{bold:!0,children:`Hooks`}),`: `,Object.keys(e.hooks).join(`, `)]}),e.skills&&e.skills.length>0&&(0,k.jsxs)(u,{children:[(0,k.jsx)(u,{bold:!0,children:`Skills`}),`:`,` `,e.skills.length>10?`${e.skills.length} skills`:e.skills.join(`, `)]}),a&&(0,k.jsx)(_,{children:(0,k.jsxs)(u,{children:[(0,k.jsx)(u,{bold:!0,children:`Color`}),`:`,` `,(0,k.jsxs)(u,{backgroundColor:a,color:`inverseText`,children:[` `,e.agentType,` `]})]})}),!Ut(e)&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(_,{children:(0,k.jsxs)(u,{children:[(0,k.jsx)(u,{bold:!0,children:`System prompt`}),`:`]})}),(0,k.jsx)(_,{marginLeft:2,marginRight:2,children:(0,k.jsx)(tn,{children:e.getSystemPrompt()})})]})]})}var k,Hn=e((()=>{a(),l(),h(),E(),at(),ht(),Wt(),It(),$t(),pt(),Bn(),k=v()}));function Un({agentName:e,currentColor:t=`automatic`,onConfirm:n}){let[r,i]=(0,Wn.useState)(Math.max(0,Gn.indexOf(t))),a=e=>{if(e.key===`up`)e.preventDefault(),i(e=>e>0?e-1:Gn.length-1);else if(e.key===`down`)e.preventDefault(),i(e=>e<Gn.length-1?e+1:0);else if(e.key===`return`){e.preventDefault();let t=Gn[r];n(t===`automatic`?void 0:t)}},s=Gn[r];return(0,A.jsxs)(_,{flexDirection:`column`,gap:1,tabIndex:0,autoFocus:!0,onKeyDown:a,children:[(0,A.jsx)(_,{flexDirection:`column`,children:Gn.map((e,t)=>{let n=t===r;return(0,A.jsxs)(_,{flexDirection:`row`,gap:1,children:[(0,A.jsx)(u,{color:n?`suggestion`:void 0,children:n?o.pointer:` `}),e===`automatic`?(0,A.jsx)(u,{bold:n,children:`Automatic color`}):(0,A.jsxs)(_,{gap:1,children:[(0,A.jsx)(u,{backgroundColor:gt[e],color:`inverseText`,children:` `}),(0,A.jsx)(u,{bold:n,children:C(e)})]})]},e)})}),(0,A.jsxs)(_,{marginTop:1,children:[(0,A.jsx)(u,{children:`Preview: `}),s===void 0||s===`automatic`?(0,A.jsxs)(u,{inverse:!0,bold:!0,children:[` `,`@`,e,` `]}):(0,A.jsxs)(u,{backgroundColor:gt[s],color:`inverseText`,bold:!0,children:[` `,`@`,e,` `]})]})]})}var Wn,A,Gn,Kn=e((()=>{a(),Wn=t(l(),1),h(),at(),se(),A=v(),Gn=[`automatic`,..._t]}));function qn({initialModel:e,onComplete:t,onCancel:n}){let r=Jn.useMemo(()=>{let t=en();return e&&!t.some(t=>t.value===e)?[{value:e,label:e,description:`Current model (custom ID)`},...t]:t},[e]);return(0,Yn.jsxs)(_,{flexDirection:`column`,children:[(0,Yn.jsx)(_,{marginBottom:1,children:(0,Yn.jsx)(u,{dimColor:!0,children:`Model determines the agent's reasoning capabilities and speed.`})}),(0,Yn.jsx)(kt,{options:r,defaultValue:e??`sonnet`,onChange:t,onCancel:()=>n?n():t(void 0)})]})}var Jn,Yn,Xn=e((()=>{Jn=t(l(),1),h(),$t(),Ne(),Yn=v()}));function Zn(){return{READ_ONLY:{name:`Read-only tools`,toolNames:new Set([Me.name,Ze.name,Ke.name,Pe.name,Nt.name,Vt.name,mt.name,qt.name,Ue.name,Ye.name,Yt.name])},EDIT:{name:`Edit tools`,toolNames:new Set([nn.name,Je.name,Le.name])},EXECUTION:{name:`Execution tools`,toolNames:new Set([Pt.name,process.env.USER_TYPE===`ant`?un.name:void 0].filter(e=>e!==void 0))},MCP:{name:`MCP tools`,toolNames:new Set,isMcp:!0},OTHER:{name:`Other tools`,toolNames:new Set}}}function Qn(e){let t=new Map;return e.forEach(e=>{if(Ae(e)){let n=fe(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 $n({tools:e,initialTools:t,onComplete:n,onCancel:r}){let i=(0,j.useMemo)(()=>Lt({tools:e,isBuiltIn:!1,isAsync:!1}),[e]),[a,s]=(0,j.useState)(!t||t.includes(`*`)?i.map(e=>e.name):t),[c,l]=(0,j.useState)(0),[d,f]=(0,j.useState)(!1),p=(0,j.useMemo)(()=>{let e=new Set(i.map(e=>e.name));return a.filter(t=>e.has(t))},[a,i]),h=new Set(p),v=p.length===i.length&&i.length>0,y=e=>{e&&s(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},b=(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))})},x=()=>{let e=i.map(e=>e.name);n(p.length===e.length&&e.every(e=>p.includes(e))?void 0:p)},S=(0,j.useMemo)(()=>{let e=Zn(),t={readOnly:[],edit:[],execution:[],mcp:[],other:[]};return i.forEach(n=>{Ae(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]),ee=e=>{let t=Ee(e,e=>h.has(e.name))<e.length;return()=>{b(e.map(e=>e.name),t)}},C=[];C.push({id:`continue`,label:`Continue`,action:x,isContinue:!0}),C.push({id:`bucket-all`,label:`${v?o.checkboxOn:o.checkboxOff} All tools`,action:()=>{b(i.map(e=>e.name),!v)}});let te=Zn();[{id:`bucket-readonly`,name:te.READ_ONLY.name,tools:S.readOnly},{id:`bucket-edit`,name:te.EDIT.name,tools:S.edit},{id:`bucket-execution`,name:te.EXECUTION.name,tools:S.execution},{id:`bucket-mcp`,name:te.MCP.name,tools:S.mcp},{id:`bucket-other`,name:te.OTHER.name,tools:S.other}].forEach(({id:e,name:t,tools:n})=>{if(n.length===0)return;let r=Ee(n,e=>h.has(e.name))===n.length;C.push({id:e,label:`${r?o.checkboxOn:o.checkboxOff} ${t}`,action:ee(n)})});let ne=C.length;C.push({id:`toggle-individual`,label:d?`Hide advanced options`:`Show advanced options`,action:()=>{f(!d),d&&c>ne&&l(ne)},isToggle:!0});let re=(0,j.useMemo)(()=>Qn(i),[i]);return d&&(re.length>0&&(C.push({id:`mcp-servers-header`,label:`MCP Servers:`,action:()=>{},isHeader:!0}),re.forEach(({serverName:e,tools:t})=>{let n=Ee(t,e=>h.has(e.name))===t.length;C.push({id:`mcp-server-${e}`,label:`${n?o.checkboxOn:o.checkboxOff} ${e} (${t.length} ${ie(t.length,`tool`)})`,action:()=>{b(t.map(e=>e.name),!n)}})}),C.push({id:`tools-header`,label:`Individual Tools:`,action:()=>{},isHeader:!0})),i.forEach(e=>{let t=e.name;if(e.name.startsWith(`mcp__`)){let n=fe(e.name);t=n?`${n.toolName} (${n.serverName})`:e.name}C.push({id:`tool-${e.name}`,label:`${h.has(e.name)?o.checkboxOn:o.checkboxOff} ${t}`,action:()=>y(e.name)})})),g(`confirm:no`,(0,j.useCallback)(()=>{r?r():n(t)},[r,n,t]),{context:`Confirmation`}),(0,M.jsxs)(_,{flexDirection:`column`,marginTop:1,tabIndex:0,autoFocus:!0,onKeyDown:e=>{if(e.key===`return`){e.preventDefault();let t=C[c];t&&!t.isHeader&&t.action()}else if(e.key===`up`){e.preventDefault();let t=c-1;for(;t>0&&C[t]?.isHeader;)t--;l(Math.max(0,t))}else if(e.key===`down`){e.preventDefault();let t=c+1;for(;t<C.length-1&&C[t]?.isHeader;)t++;l(Math.min(C.length-1,t))}},children:[(0,M.jsxs)(u,{color:c===0?`suggestion`:void 0,bold:c===0,children:[c===0?`${o.pointer} `:` `,`[ Continue ]`]}),(0,M.jsx)(m,{width:40}),C.slice(1).map((e,t)=>{let n=t+1===c,r=e.isToggle,i=e.isHeader;return(0,M.jsxs)(j.Fragment,{children:[r&&(0,M.jsx)(m,{width:40}),i&&t>0&&(0,M.jsx)(_,{marginTop:1}),(0,M.jsxs)(u,{color:i?void 0:n?`suggestion`:void 0,dimColor:i,bold:r&&n,children:[i?``:n?`${o.pointer} `:` `,r?`[ ${e.label} ]`:e.label]})]},e.id)}),(0,M.jsx)(_,{marginTop:1,flexDirection:`column`,children:(0,M.jsx)(u,{dimColor:!0,children:v?`All tools selected`:`${h.size} of ${i.length} tools selected`})})]})}var j,M,er=e((()=>{a(),j=t(l(),1),ce(),it(),Wt(),ue(),Et(),st(),Fe(),ft(),ct(),Ot(),tt(),lt(),Ie(),St(),Rt(),Ft(),Dt(),ln(),Tt(),ze(),h(),E(),De(),se(),M=v()}));function tr(e){return e===`all`?`Agents`:e===`built-in`?`Built-in agents`:e===`plugin`?`Plugin agents`:pe(oe(e))}var nr=e((()=>{ee(),le()}));function rr({agent:e,tools:t,onSaved:n,onBack:r}){let i=Ve(),[a,c]=(0,N.useState)(`menu`),[l,d]=(0,N.useState)(0),[f,p]=(0,N.useState)(null),[m,h]=(0,N.useState)(e.color),v=(0,N.useCallback)(async()=>{let t=await xn(Mn(e));t.error?p(t.error):n(`Opened ${e.agentType} in editor. If you made edits, restart to load the latest version.`)},[e,n]),y=(0,N.useCallback)(async(t={})=>{let{tools:r,color:a,model:o}=t,c=a??m,l=r!==void 0,u=o!==void 0,d=c!==e.color;if(!l&&!u&&!d)return!1;try{return!bt(e)&&!At(e)?!1:(await Ln(e,e.whenToUse,r??e.tools,e.getSystemPrompt(),c,o??e.model),d&&c&&je(e.agentType,c),i(t=>{let n=t.agentDefinitions.allAgents.map(t=>t.agentType===e.agentType?{...t,tools:r??t.tools,color:c,model:o??t.model}:t);return{...t,agentDefinitions:{...t.agentDefinitions,activeAgents:Bt(n),allAgents:n}}}),n(`Updated agent: ${s.bold(e.agentType)}`),!0)}catch(e){return p(e instanceof Error?e.message:`Failed to save agent`),!1}},[e,m,n,i]),b=(0,N.useMemo)(()=>[{label:`Open in editor`,action:v},{label:`Edit tools`,action:()=>c(`edit-tools`)},{label:`Edit model`,action:()=>c(`edit-model`)},{label:`Edit color`,action:()=>c(`edit-color`)}],[v]),x=(0,N.useCallback)(()=>{p(null),a===`menu`?r():c(`menu`)},[a,r]),S=(0,N.useCallback)(e=>{if(e.key===`up`)e.preventDefault(),d(e=>Math.max(0,e-1));else if(e.key===`down`)e.preventDefault(),d(e=>Math.min(b.length-1,e+1));else if(e.key===`return`){e.preventDefault();let t=b[l];t&&t.action()}},[b,l]);g(`confirm:no`,x,{context:`Confirmation`});let ee=()=>(0,P.jsxs)(_,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:S,children:[(0,P.jsxs)(u,{dimColor:!0,children:[`Source: `,tr(e.source)]}),(0,P.jsx)(_,{marginTop:1,flexDirection:`column`,children:b.map((e,t)=>(0,P.jsxs)(u,{color:t===l?`suggestion`:void 0,children:[t===l?`${o.pointer} `:` `,e.label]},e.label))}),f&&(0,P.jsx)(_,{marginTop:1,children:(0,P.jsx)(u,{color:`error`,children:f})})]});switch(a){case`menu`:return ee();case`edit-tools`:return(0,P.jsx)($n,{tools:t,initialTools:e.tools,onComplete:async e=>{c(`menu`),await y({tools:e})}});case`edit-color`:return(0,P.jsx)(Un,{agentName:e.agentType,currentColor:m||e.color||`automatic`,onConfirm:async e=>{h(e),c(`menu`),await y({color:e})}});case`edit-model`:return(0,P.jsx)(qn,{initialModel:e.model,onComplete:async e=>{c(`menu`),await y({model:e})}});default:return null}}var N,P,ir=e((()=>{c(),a(),l(),N=t(l(),1),et(),h(),E(),at(),It(),bn(),Bn(),Kn(),Xn(),er(),nr(),P=v()}));function ar({instructions:e=`Press ↑↓ to navigate · Enter to select · Esc to go back`}){let t=cn();return(0,or.jsx)(_,{marginLeft:2,children:(0,or.jsx)(u,{dimColor:!0,children:t.pending?`Press ${t.keyName} again to exit`:e})})}var or,sr=e((()=>{l(),sn(),h(),or=v()}));function cr({source:e,agents:t,onBack:n,onSelect:r,onCreateNew:i,changes:a}){let[s,c]=F.useState(null),[l,f]=F.useState(!0),p=F.useMemo(()=>[...t].sort(pn),[t]),h=e=>({isOverridden:!!e.overriddenBy,overriddenBy:e.overriddenBy||null}),g=()=>(0,I.jsxs)(_,{children:[(0,I.jsx)(u,{color:l?`suggestion`:void 0,children:l?`${o.pointer} `:` `}),(0,I.jsx)(u,{color:l?`suggestion`:void 0,children:`Create new agent`})]}),v=e=>{let t=e.source===`built-in`,n=!t&&!l&&s?.agentType===e.agentType&&s?.source===e.source,{isOverridden:r,overriddenBy:i}=h(e),a=t||r,c=!t&&n?`suggestion`:void 0,d=dn(e);return(0,I.jsxs)(_,{children:[(0,I.jsx)(u,{dimColor:a&&!n,color:c,children:t?``:n?`${o.pointer} `:` `}),(0,I.jsx)(u,{dimColor:a&&!n,color:c,children:e.agentType}),d&&(0,I.jsxs)(u,{dimColor:!0,color:c,children:[` · `,d]}),e.memory&&(0,I.jsxs)(u,{dimColor:!0,color:c,children:[` · `,e.memory,` memory`]}),i&&(0,I.jsxs)(u,{dimColor:!n,color:n?`warning`:void 0,children:[` `,o.warning,` shadowed by `,hn(i)]})]},`${e.agentType}-${e.source}`)},y=F.useMemo(()=>{let t=p.filter(e=>e.source!==`built-in`);return e===`all`?gn.filter(e=>e.source!==`built-in`).flatMap(({source:e})=>t.filter(t=>t.source===e)):t},[p,e]);F.useEffect(()=>{!s&&!l&&y.length>0&&(i?f(!0):c(y[0]||null))},[y,s,l,i]);let b=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=y.length+ +!!t;if(n===0)return;let a=0;if(!l&&s){let e=y.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)f(!0),c(null);else{let e=y[t?o-1:o];e&&(f(!1),c(e))}},x=(e=`Built-in (always available):`)=>{let t=p.filter(e=>e.source===`built-in`);return(0,I.jsxs)(_,{flexDirection:`column`,marginBottom:1,paddingLeft:2,children:[(0,I.jsx)(u,{bold:!0,dimColor:!0,children:e}),t.map(v)]})},S=(e,t)=>{if(!t.length)return null;let n=t[0]?.baseDir;return(0,I.jsxs)(_,{flexDirection:`column`,marginBottom:1,children:[(0,I.jsxs)(_,{paddingLeft:2,children:[(0,I.jsx)(u,{bold:!0,dimColor:!0,children:e}),n&&(0,I.jsxs)(u,{dimColor:!0,children:[` (`,n,`)`]})]}),t.map(e=>v(e))]})},ee=tr(e),C=p.filter(e=>e.source===`built-in`);return!p.length||e!==`built-in`&&!p.some(e=>e.source!==`built-in`)?(0,I.jsx)(d,{title:ee,subtitle:`No agents found`,onCancel:n,hideInputGuide:!0,children:(0,I.jsxs)(_,{flexDirection:`column`,gap:1,tabIndex:0,autoFocus:!0,onKeyDown:b,children:[i&&(0,I.jsx)(_,{children:g()}),(0,I.jsx)(u,{dimColor:!0,children:`No agents found. Create specialized subagents that Claude can delegate to.`}),(0,I.jsx)(u,{dimColor:!0,children:`Each subagent has its own context window, custom system prompt, and specific tools.`}),(0,I.jsx)(u,{dimColor:!0,children:`Try creating: Code Reviewer, Code Simplifier, Security Reviewer, Tech Lead, or UX Reviewer.`}),e!==`built-in`&&p.some(e=>e.source===`built-in`)&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(m,{}),x()]})]})}):(0,I.jsxs)(d,{title:ee,subtitle:`${Ee(p,e=>!e.overriddenBy)} agents`,onCancel:n,hideInputGuide:!0,children:[a&&a.length>0&&(0,I.jsx)(_,{marginTop:1,children:(0,I.jsx)(u,{dimColor:!0,children:a[a.length-1]})}),(0,I.jsxs)(_,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:b,children:[i&&(0,I.jsx)(_,{marginBottom:1,children:g()}),e===`all`?(0,I.jsxs)(I.Fragment,{children:[gn.filter(e=>e.source!==`built-in`).map(({label:e,source:t})=>(0,I.jsx)(F.Fragment,{children:S(e,p.filter(e=>e.source===t))},t)),C.length>0&&(0,I.jsxs)(_,{flexDirection:`column`,marginBottom:1,paddingLeft:2,children:[(0,I.jsxs)(u,{dimColor:!0,children:[(0,I.jsx)(u,{bold:!0,children:`Built-in agents`}),` (always available)`]}),C.map(v)]})]}):e===`built-in`?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(u,{dimColor:!0,italic:!0,children:`Built-in agents are provided by default and cannot be modified.`}),(0,I.jsx)(_,{marginTop:1,flexDirection:`column`,children:p.map(e=>v(e))})]}):(0,I.jsxs)(I.Fragment,{children:[p.filter(e=>e.source!==`built-in`).map(e=>v(e)),p.some(e=>e.source===`built-in`)&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(m,{}),x()]})]})]})]})}var F,I,lr=e((()=>{a(),F=t(l(),1),h(),fn(),De(),nr(),I=v()}));function ur({steps:e,initialData:t={},onComplete:n,onCancel:r,children:i,title:a,showStepCounter:o=!0}){let[s,c]=(0,L.useState)(0),[l,u]=(0,L.useState)(t),[d,f]=(0,L.useState)(!1),[p,m]=(0,L.useState)([]);cn(),(0,L.useEffect)(()=>{d&&(m([]),n(l))},[d,l,n]);let h=(0,L.useCallback)(()=>{s<e.length-1?(p.length>0&&m(e=>[...e,s]),c(e=>e+1)):f(!0)},[s,e.length,p]),g=(0,L.useCallback)(()=>{if(p.length>0){let e=p[p.length-1];e!==void 0&&(m(e=>e.slice(0,-1)),c(e))}else s>0?c(e=>e-1):r&&r()},[s,p,r]),_=(0,L.useCallback)(t=>{t>=0&&t<e.length&&(m(e=>[...e,s]),c(t))},[s,e.length]),v=(0,L.useCallback)(()=>{m([]),r&&r()},[r]),y=(0,L.useCallback)(e=>{u(t=>({...t,...e}))},[]),b=(0,L.useMemo)(()=>({currentStepIndex:s,totalSteps:e.length,wizardData:l,setWizardData:u,updateWizardData:y,goNext:h,goBack:g,goToStep:_,cancel:v,title:a,showStepCounter:o}),[s,e.length,l,y,h,g,_,v,a,o]),x=e[s];return!x||d?null:(0,dr.jsx)(fr.Provider,{value:b,children:i||(0,dr.jsx)(x,{})})}var L,dr,fr,pr=e((()=>{L=t(l(),1),sn(),dr=v(),fr=(0,L.createContext)(null)}));function R(){let e=(0,mr.useContext)(fr);if(!e)throw Error(`useWizard must be used within a WizardProvider`);return e}var mr,hr=e((()=>{mr=t(l(),1),pr()}));function gr({instructions:e=(0,z.jsxs)(p,{children:[(0,z.jsx)(f,{shortcut:`↑↓`,action:`navigate`}),(0,z.jsx)(f,{shortcut:`Enter`,action:`select`}),(0,z.jsx)(w,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]})}){let t=cn();return(0,z.jsx)(_,{marginLeft:3,marginTop:1,children:(0,z.jsx)(u,{dimColor:!0,children:t.pending?`Press ${t.keyName} again to exit`:e})})}var z,_r=e((()=>{sn(),h(),T(),z=v()}));function B({title:e,color:t=`suggestion`,children:n,subtitle:r,footerText:i}){let{currentStepIndex:a,totalSteps:o,title:s,showStepCounter:c,goBack:l}=R();return(0,vr.jsxs)(vr.Fragment,{children:[(0,vr.jsx)(d,{title:`${e||s||`Wizard`}${c===!1?``:` (${a+1}/${o})`}`,subtitle:r,onCancel:l,color:t,hideInputGuide:!0,isCancelActive:!1,children:n}),(0,vr.jsx)(gr,{instructions:i})]})}var vr,V=e((()=>{h(),hr(),_r(),vr=v()})),H=e((()=>{hr(),V(),_r(),pr()}));function yr(){let{goNext:e,goBack:t,updateWizardData:n,wizardData:r}=R();return g(`confirm:no`,t,{context:`Confirmation`}),(0,U.jsx)(B,{subtitle:`Choose background color`,footerText:(0,U.jsxs)(p,{children:[(0,U.jsx)(f,{shortcut:`↑↓`,action:`navigate`}),(0,U.jsx)(f,{shortcut:`Enter`,action:`select`}),(0,U.jsx)(w,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:(0,U.jsx)(_,{children:(0,U.jsx)(Un,{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,br=e((()=>{h(),E(),T(),H(),V(),Kn(),U=v()}));function xr(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 Sr(e,t,n){let r=[],i=[];if(!e.agentType)r.push(`Agent type is required`);else{let t=xr(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 ${tr(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=xt(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 Cr=e((()=>{Wt(),nr()}));function wr({tools:e,existingAgents:t,onSave:n,onSaveAndEdit:r,error:i}){let{goBack:a,wizardData:o}=R();g(`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=Sr(c,e,t),d=Oe(c.getSystemPrompt(),240),m=Oe(c.whenToUse,240),h=e=>e===void 0?`All tools`:e.length===0?`None`:e.length===1?e[0]||`None`:e.length===2?e.join(` and `):`${e.slice(0,-1).join(`, `)}, and ${e[e.length-1]}`,v=de()?(0,W.jsxs)(u,{children:[(0,W.jsx)(u,{bold:!0,children:`Memory`}),`: `,dt(c.memory)]}):null;return(0,W.jsx)(B,{subtitle:`Confirm and save`,footerText:(0,W.jsxs)(p,{children:[(0,W.jsx)(f,{shortcut:`s/Enter`,action:`save`}),(0,W.jsx)(f,{shortcut:`e`,action:`edit in your editor`}),(0,W.jsx)(w,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]}),children:(0,W.jsxs)(_,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:s,children:[(0,W.jsxs)(u,{children:[(0,W.jsx)(u,{bold:!0,children:`Name`}),`: `,c.agentType]}),(0,W.jsxs)(u,{children:[(0,W.jsx)(u,{bold:!0,children:`Location`}),`:`,` `,Nn({source:o.location,agentType:c.agentType})]}),(0,W.jsxs)(u,{children:[(0,W.jsx)(u,{bold:!0,children:`Tools`}),`: `,h(c.tools)]}),(0,W.jsxs)(u,{children:[(0,W.jsx)(u,{bold:!0,children:`Model`}),`: `,Xt(c.model)]}),v,(0,W.jsx)(_,{marginTop:1,children:(0,W.jsxs)(u,{children:[(0,W.jsx)(u,{bold:!0,children:`Description`}),` (tells Claude when to use this agent):`]})}),(0,W.jsx)(_,{marginLeft:2,marginTop:1,children:(0,W.jsx)(u,{children:m})}),(0,W.jsx)(_,{marginTop:1,children:(0,W.jsxs)(u,{children:[(0,W.jsx)(u,{bold:!0,children:`System prompt`}),`:`]})}),(0,W.jsx)(_,{marginLeft:2,marginTop:1,children:(0,W.jsx)(u,{children:d})}),l.warnings.length>0&&(0,W.jsxs)(_,{marginTop:1,flexDirection:`column`,children:[(0,W.jsx)(u,{color:`warning`,children:`Warnings:`}),l.warnings.map((e,t)=>(0,W.jsxs)(u,{dimColor:!0,children:[` `,`• `,e]},t))]}),l.errors.length>0&&(0,W.jsxs)(_,{marginTop:1,flexDirection:`column`,children:[(0,W.jsx)(u,{color:`error`,children:`Errors:`}),l.errors.map((e,t)=>(0,W.jsxs)(u,{color:`error`,children:[` `,`• `,e]},t))]}),i&&(0,W.jsx)(_,{marginTop:1,children:(0,W.jsx)(u,{color:`error`,children:i})}),(0,W.jsx)(_,{marginTop:2,children:(0,W.jsxs)(u,{color:`success`,children:[`Press `,(0,W.jsx)(u,{bold:!0,children:`s`}),` or `,(0,W.jsx)(u,{bold:!0,children:`Enter`}),` to save, `,(0,W.jsx)(u,{bold:!0,children:`e`}),` to save and edit`]})})]})})}var W,Tr=e((()=>{h(),E(),ae(),ht(),ke(),$t(),T(),H(),V(),Bn(),Cr(),W=v()}));function Er({tools:e,existingAgents:t,onComplete:n}){let{wizardData:r}=R(),[i,a]=(0,Dr.useState)(null),o=Ve(),c=(0,Dr.useCallback)(async e=>{if(r?.finalAgent)try{await In(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:Bt(t),allAgents:t}}}),Kt(),e&&await xn(jn({source:r.location,agentType:r.finalAgent.agentType})),be(`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: ${s.bold(r.finalAgent.agentType)} and opened in editor. If you made edits, restart to load the latest version.`:`Created agent: ${s.bold(r.finalAgent.agentType)}`)}catch(e){a(e instanceof Error?e.message:`Failed to save agent`)}},[r,n,o]);return(0,Or.jsx)(wr,{tools:e,existingAgents:t,onSave:(0,Dr.useCallback)(()=>c(!1),[c]),onSaveAndEdit:(0,Dr.useCallback)(()=>c(!0),[c]),error:i})}var Dr,Or,kr=e((()=>{c(),Dr=t(l(),1),ye(),et(),It(),bn(),H(),Bn(),Tr(),Or=v()}));function Ar(){let{goNext:e,goBack:t,updateWizardData:n,wizardData:r}=R(),[i,a]=(0,jr.useState)(r.whenToUse||``),[o,s]=(0,jr.useState)(i.length),[c,l]=(0,jr.useState)(null);return g(`confirm:no`,t,{context:`Settings`}),g(`chat:externalEditor`,(0,jr.useCallback)(async()=>{let e=await yn(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)(p,{children:[(0,G.jsx)(f,{shortcut:`Type`,action:`enter text`}),(0,G.jsx)(f,{shortcut:`Enter`,action:`continue`}),(0,G.jsx)(w,{action:`chat:externalEditor`,context:`Chat`,fallback:`ctrl+g`,description:`open in editor`}),(0,G.jsx)(w,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`go back`})]}),children:(0,G.jsxs)(_,{flexDirection:`column`,children:[(0,G.jsx)(u,{children:`When should Claude use this agent?`}),(0,G.jsx)(_,{marginTop:1,children:(0,G.jsx)(Re,{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)(_,{marginTop:1,children:(0,G.jsx)(u,{color:`error`,children:c})})]})})}var jr,G,Mr=e((()=>{jr=t(l(),1),h(),E(),bn(),T(),He(),H(),V(),G=v()}));async function Nr(e,t,n,r){let i=yt({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 Mt(),o=jt([i],a),s=de()?Pr+Fr:Pr,c=ot()?Qe({sessionId:y(),model:t,provider:re(),name:`agent-creation`}):null,l=await Ht({messages:We(o),systemPrompt:on([s]),thinkingConfig:{type:`disabled`},tools:[],signal:r,options:{getToolPermissionContext:async()=>rn(),model:t,toolChoice:void 0,agents:[],isNonInteractiveSession:!1,hasAppendSystemPrompt:!1,querySource:`agent_creation`,mcpTools:[],langfuseTrace:c}});nt(c);let u=(Array.isArray(l.message.content)?l.message.content:[]).filter(e=>e.type===`text`).map(e=>e.text).join(`
9
+ `),d;try{d=ge(u.trim())}catch{let e=u.match(/\{[\s\S]*\}/);if(!e)throw Error(`No JSON object found in response`);d=ge(e[0])}if(!d.identifier||!d.whenToUse||!d.systemPrompt)throw Error(`Invalid agent configuration generated`);return be(`tengu_agent_definition_generated`,{agent_identifier:d.identifier}),{identifier:d.identifier,whenToUse:d.whenToUse,systemPrompt:d.systemPrompt}}var Pr,Fr,Ir=e((()=>{wt(),Jt(),an(),ue(),Gt(),qe(),ae(),ye(),Xe(),b(),te(),ve(),$e(),Pr=`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
10
 
11
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
12
 
@@ -97,7 +97,7 @@ Remember: The agents you create should be autonomous experts capable of handling
97
97
  - For a documentation writer: "Update your agent memory as you discover documentation patterns, API structures, and terminology conventions."
98
98
 
99
99
  The memory instructions should be specific to what the agent would naturally learn while performing its core tasks.
100
- `}));function Lr(){let{updateWizardData:e,goBack:t,goToStep:n,wizardData:r}=R(),[a,o]=(0,K.useState)(r.generationPrompt||``),[s,c]=(0,K.useState)(!1),[l,d]=(0,K.useState)(null),[f,m]=(0,K.useState)(a.length),h=Sn(),v=(0,K.useRef)(null);g(`confirm:no`,(0,K.useCallback)(()=>{v.current&&(v.current.abort(),v.current=null,c(!1),d(`Generation cancelled`))},[]),{context:`Settings`,isActive:s}),g(`chat:externalEditor`,(0,K.useCallback)(async()=>{let e=await yn(a);e.content!==null&&(o(e.content),m(e.content.length))},[a]),{context:`Chat`,isActive:!s}),g(`confirm:no`,(0,K.useCallback)(()=>{e({generationPrompt:``,agentType:``,systemPrompt:``,whenToUse:``,generatedAgent:void 0,wasGenerated:!1}),o(``),d(null),t()},[e,t]),{context:`Settings`,isActive:!s});let y=async()=>{let t=a.trim();if(!t){d(`Please describe what the agent should do`);return}d(null),c(!0),e({generationPrompt:t,isGenerating:!0});let r=ct();v.current=r;try{let i=await Nr(t,h,[],r.signal);e({agentType:i.identifier,whenToUse:i.whenToUse,systemPrompt:i.systemPrompt,generatedAgent:i,isGenerating:!1,wasGenerated:!0}),n(6)}catch(t){t instanceof i||t instanceof Error&&!t.message.includes(`No assistant message found`)&&d(t.message||`Failed to generate agent`),e({isGenerating:!1})}finally{c(!1),v.current=null}},b=`Describe what this agent should do and when it should be used (be comprehensive for best results)`;return s?(0,q.jsx)(B,{subtitle:b,footerText:(0,q.jsx)(w,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`}),children:(0,q.jsxs)(_,{flexDirection:`row`,alignItems:`center`,children:[(0,q.jsx)(Rt,{}),(0,q.jsx)(u,{color:`suggestion`,children:` Generating agent from description...`})]})}):(0,q.jsx)(B,{subtitle:b,footerText:(0,q.jsxs)(p,{children:[(0,q.jsx)(w,{action:`confirm:yes`,context:`Confirmation`,fallback:`Enter`,description:`submit`}),(0,q.jsx)(w,{action:`chat:externalEditor`,context:`Chat`,fallback:`ctrl+g`,description:`open in editor`}),(0,q.jsx)(w,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`go back`})]}),children:(0,q.jsxs)(_,{flexDirection:`column`,children:[l&&(0,q.jsx)(_,{marginBottom:1,children:(0,q.jsx)(u,{color:`error`,children:l})}),(0,q.jsx)(nt,{value:a,onChange:o,onSubmit:y,placeholder:`e.g., Help me write unit tests for my code...`,columns:80,cursorOffset:f,onChangeCursorOffset:m,focus:!0,showCursor:!0})]})})}var K,q,Rr=e((()=>{Ce(),K=t(l(),1),Cn(),h(),E(),Fe(),bn(),T(),Tt(),at(),H(),V(),Ir(),q=v()}));function zr(){let{goNext:e,updateWizardData:t,cancel:n}=R();return(0,J.jsx)(B,{subtitle:`Choose location`,footerText:(0,J.jsxs)(p,{children:[(0,J.jsx)(f,{shortcut:`↑↓`,action:`navigate`}),(0,J.jsx)(f,{shortcut:`Enter`,action:`select`}),(0,J.jsx)(w,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]}),children:(0,J.jsx)(_,{children:(0,J.jsx)(Le,{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,Br=e((()=>{h(),T(),rt(),H(),V(),J=v()}));function Vr(){let{goNext:e,goBack:t,updateWizardData:n,wizardData:r}=R();g(`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)(p,{children:[(0,Y.jsx)(f,{shortcut:`↑↓`,action:`navigate`}),(0,Y.jsx)(f,{shortcut:`Enter`,action:`select`}),(0,Y.jsx)(w,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:(0,Y.jsx)(_,{children:(0,Y.jsx)(Le,{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:de()&&i&&a?()=>r.systemPrompt+`
100
+ `}));function Lr(){let{updateWizardData:e,goBack:t,goToStep:n,wizardData:r}=R(),[a,o]=(0,K.useState)(r.generationPrompt||``),[s,c]=(0,K.useState)(!1),[l,d]=(0,K.useState)(null),[f,m]=(0,K.useState)(a.length),h=Sn(),v=(0,K.useRef)(null);g(`confirm:no`,(0,K.useCallback)(()=>{v.current&&(v.current.abort(),v.current=null,c(!1),d(`Generation cancelled`))},[]),{context:`Settings`,isActive:s}),g(`chat:externalEditor`,(0,K.useCallback)(async()=>{let e=await yn(a);e.content!==null&&(o(e.content),m(e.content.length))},[a]),{context:`Chat`,isActive:!s}),g(`confirm:no`,(0,K.useCallback)(()=>{e({generationPrompt:``,agentType:``,systemPrompt:``,whenToUse:``,generatedAgent:void 0,wasGenerated:!1}),o(``),d(null),t()},[e,t]),{context:`Settings`,isActive:!s});let y=async()=>{let t=a.trim();if(!t){d(`Please describe what the agent should do`);return}d(null),c(!0),e({generationPrompt:t,isGenerating:!0});let r=Qt();v.current=r;try{let i=await Nr(t,h,[],r.signal);e({agentType:i.identifier,whenToUse:i.whenToUse,systemPrompt:i.systemPrompt,generatedAgent:i,isGenerating:!1,wasGenerated:!0}),n(6)}catch(t){t instanceof i||t instanceof Error&&!t.message.includes(`No assistant message found`)&&d(t.message||`Failed to generate agent`),e({isGenerating:!1})}finally{c(!1),v.current=null}},b=`Describe what this agent should do and when it should be used (be comprehensive for best results)`;return s?(0,q.jsx)(B,{subtitle:b,footerText:(0,q.jsx)(w,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`}),children:(0,q.jsxs)(_,{flexDirection:`row`,alignItems:`center`,children:[(0,q.jsx)(Ct,{}),(0,q.jsx)(u,{color:`suggestion`,children:` Generating agent from description...`})]})}):(0,q.jsx)(B,{subtitle:b,footerText:(0,q.jsxs)(p,{children:[(0,q.jsx)(w,{action:`confirm:yes`,context:`Confirmation`,fallback:`Enter`,description:`submit`}),(0,q.jsx)(w,{action:`chat:externalEditor`,context:`Chat`,fallback:`ctrl+g`,description:`open in editor`}),(0,q.jsx)(w,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`go back`})]}),children:(0,q.jsxs)(_,{flexDirection:`column`,children:[l&&(0,q.jsx)(_,{marginBottom:1,children:(0,q.jsx)(u,{color:`error`,children:l})}),(0,q.jsx)(Re,{value:a,onChange:o,onSubmit:y,placeholder:`e.g., Help me write unit tests for my code...`,columns:80,cursorOffset:f,onChangeCursorOffset:m,focus:!0,showCursor:!0})]})})}var K,q,Rr=e((()=>{Ce(),K=t(l(),1),Cn(),h(),E(),ut(),bn(),T(),Zt(),He(),H(),V(),Ir(),q=v()}));function zr(){let{goNext:e,updateWizardData:t,cancel:n}=R();return(0,J.jsx)(B,{subtitle:`Choose location`,footerText:(0,J.jsxs)(p,{children:[(0,J.jsx)(f,{shortcut:`↑↓`,action:`navigate`}),(0,J.jsx)(f,{shortcut:`Enter`,action:`select`}),(0,J.jsx)(w,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]}),children:(0,J.jsx)(_,{children:(0,J.jsx)(kt,{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,Br=e((()=>{h(),T(),Ne(),H(),V(),J=v()}));function Vr(){let{goNext:e,goBack:t,updateWizardData:n,wizardData:r}=R();g(`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)(p,{children:[(0,Y.jsx)(f,{shortcut:`↑↓`,action:`navigate`}),(0,Y.jsx)(f,{shortcut:`Enter`,action:`select`}),(0,Y.jsx)(w,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:(0,Y.jsx)(_,{children:(0,Y.jsx)(kt,{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:de()&&i&&a?()=>r.systemPrompt+`
101
101
 
102
- `+Ve(a,i):()=>r.systemPrompt}:void 0}),e()},onCancel:t},`memory-select`)})})}var Y,Hr=e((()=>{h(),E(),ae(),pt(),T(),rt(),H(),V(),Y=v()}));function Ur(){let{goNext:e,goBack:t,updateWizardData:n,goToStep:r}=R();return(0,X.jsx)(B,{subtitle:`Creation method`,footerText:(0,X.jsxs)(p,{children:[(0,X.jsx)(f,{shortcut:`↑↓`,action:`navigate`}),(0,X.jsx)(f,{shortcut:`Enter`,action:`select`}),(0,X.jsx)(w,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:(0,X.jsx)(_,{children:(0,X.jsx)(Le,{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,Wr=e((()=>{h(),T(),rt(),H(),V(),X=v()}));function Gr(){let{goNext:e,goBack:t,updateWizardData:n,wizardData:r}=R();return(0,Kr.jsx)(B,{subtitle:`Select model`,footerText:(0,Kr.jsxs)(p,{children:[(0,Kr.jsx)(f,{shortcut:`↑↓`,action:`navigate`}),(0,Kr.jsx)(f,{shortcut:`Enter`,action:`select`}),(0,Kr.jsx)(w,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:(0,Kr.jsx)(qn,{initialModel:r.selectedModel,onComplete:t=>{n({selectedModel:t}),e()},onCancel:t})})}var Kr,qr=e((()=>{T(),h(),H(),V(),Xn(),Kr=v()}));function Jr(){let{goNext:e,goBack:t,updateWizardData:n,wizardData:r}=R(),[i,a]=(0,Yr.useState)(r.systemPrompt||``),[o,s]=(0,Yr.useState)(i.length),[c,l]=(0,Yr.useState)(null);return g(`confirm:no`,t,{context:`Settings`}),g(`chat:externalEditor`,(0,Yr.useCallback)(async()=>{let e=await yn(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)(p,{children:[(0,Z.jsx)(f,{shortcut:`Type`,action:`enter text`}),(0,Z.jsx)(f,{shortcut:`Enter`,action:`continue`}),(0,Z.jsx)(w,{action:`chat:externalEditor`,context:`Chat`,fallback:`ctrl+g`,description:`open in editor`}),(0,Z.jsx)(w,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`go back`})]}),children:(0,Z.jsxs)(_,{flexDirection:`column`,children:[(0,Z.jsx)(u,{children:`Enter the system prompt for your agent:`}),(0,Z.jsx)(u,{dimColor:!0,children:`Be comprehensive for best results`}),(0,Z.jsx)(_,{marginTop:1,children:(0,Z.jsx)(nt,{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)(_,{marginTop:1,children:(0,Z.jsx)(u,{color:`error`,children:c})})]})})}var Yr,Z,Xr=e((()=>{Yr=t(l(),1),h(),E(),bn(),T(),at(),H(),V(),Z=v()}));function Zr({tools:e}){let{goNext:t,goBack:n,updateWizardData:r,wizardData:i}=R(),a=e=>{r({selectedTools:e}),t()},o=i.selectedTools;return(0,Qr.jsx)(B,{subtitle:`Select tools`,footerText:(0,Qr.jsxs)(p,{children:[(0,Qr.jsx)(f,{shortcut:`Enter`,action:`toggle selection`}),(0,Qr.jsx)(f,{shortcut:`↑↓`,action:`navigate`}),(0,Qr.jsx)(w,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:(0,Qr.jsx)($n,{tools:e,initialTools:o,onComplete:a,onCancel:n})})}var Qr,$r=e((()=>{h(),T(),H(),V(),er(),Qr=v()}));function ei(e){let{goNext:t,goBack:n,updateWizardData:r,wizardData:i}=R(),[a,o]=(0,ti.useState)(i.agentType||``),[s,c]=(0,ti.useState)(null),[l,d]=(0,ti.useState)(a.length);return g(`confirm:no`,n,{context:`Settings`}),(0,Q.jsx)(B,{subtitle:`Agent type (identifier)`,footerText:(0,Q.jsxs)(p,{children:[(0,Q.jsx)(f,{shortcut:`Type`,action:`enter text`}),(0,Q.jsx)(f,{shortcut:`Enter`,action:`continue`}),(0,Q.jsx)(w,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`go back`})]}),children:(0,Q.jsxs)(_,{flexDirection:`column`,children:[(0,Q.jsx)(u,{children:`Enter a unique identifier for your agent:`}),(0,Q.jsx)(_,{marginTop:1,children:(0,Q.jsx)(nt,{value:a,onChange:o,onSubmit:e=>{let n=e.trim(),i=xr(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:d,focus:!0,showCursor:!0})}),s&&(0,Q.jsx)(_,{marginTop:1,children:(0,Q.jsx)(u,{color:`error`,children:s})})]})})}var ti,Q,ni=e((()=>{ti=t(l(),1),h(),E(),T(),at(),H(),V(),Cr(),Q=v()}));function ri({tools:e,existingAgents:t,onComplete:n,onCancel:r}){return(0,ii.jsx)(ur,{steps:[zr,Ur,Lr,()=>(0,ii.jsx)(ei,{existingAgents:t}),Jr,Ar,()=>(0,ii.jsx)(Zr,{tools:e}),Gr,yr,...de()?[Vr]:[],()=>(0,ii.jsx)(Er,{tools:e,existingAgents:t,onComplete:n})],initialData:{},onComplete:()=>{},onCancel:r,title:`Create new agent`,showStepCounter:!1})}var ii,ai=e((()=>{ae(),H(),br(),kr(),Mr(),Rr(),Br(),Hr(),Wr(),qr(),Xr(),$r(),ni(),ii=v()}));function oi({tools:e,onExit:t}){let[n,r]=(0,si.useState)({mode:`list-agents`,source:`all`}),i=$e(e=>e.agentDefinitions),a=$e(e=>e.mcp.tools),o=$e(e=>e.toolPermissionContext),c=it(),{allAgents:l,activeAgents:f}=i,[p,m]=(0,si.useState)([]),h=_n(e,a,o);cn();let g=(0,si.useMemo)(()=>({"built-in":l.filter(e=>e.source===`built-in`),userSettings:l.filter(e=>e.source===`userSettings`),projectSettings:l.filter(e=>e.source===`projectSettings`),policySettings:l.filter(e=>e.source===`policySettings`),localSettings:l.filter(e=>e.source===`localSettings`),flagSettings:l.filter(e=>e.source===`flagSettings`),plugin:l.filter(e=>e.source===`plugin`),all:l}),[l]),v=(0,si.useCallback)(e=>{m(t=>[...t,e]),r({mode:`list-agents`,source:`all`})},[]),y=(0,si.useCallback)(async e=>{try{await Rn(e),c(t=>{let n=t.agentDefinitions.allAgents.filter(t=>!(t.agentType===e.agentType&&t.source===e.source));return{...t,agentDefinitions:{...t.agentDefinitions,allAgents:n,activeAgents:Kt(n)}}}),m(t=>[...t,`Deleted agent: ${s.bold(e.agentType)}`]),r({mode:`list-agents`,source:`all`})}catch(e){Te(me(e))}},[c]);switch(n.mode){case`list-agents`:{let e=mn(n.source===`all`?[...g[`built-in`],...g.userSettings,...g.projectSettings,...g.localSettings,...g.policySettings,...g.flagSettings,...g.plugin]:g[n.source],f);return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(cr,{source:n.source,agents:e,onBack:()=>{t((p.length>0?`Agent changes:\n${p.join(`
103
- `)}`:void 0)??`Agents dialog dismissed`,{display:p.length===0?`system`:void 0})},onSelect:e=>r({mode:`agent-menu`,agent:e,previousMode:n}),onCreateNew:()=>r({mode:`create-agent`}),changes:p}),(0,$.jsx)(ar,{})]})}case`create-agent`:return(0,$.jsx)(ri,{tools:h,existingAgents:f,onComplete:v,onCancel:()=>r({mode:`list-agents`,source:`all`})});case`agent-menu`:{let e=l.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)(d,{title:n.agent.agentType,onCancel:()=>r(n.previousMode),hideInputGuide:!0,children:(0,$.jsxs)(_,{flexDirection:`column`,children:[(0,$.jsx)(Le,{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)}),p.length>0&&(0,$.jsx)(_,{marginTop:1,children:(0,$.jsx)(u,{dimColor:!0,children:p[p.length-1]})})]})}),(0,$.jsx)(ar,{})]})}case`view-agent`:{let e=l.find(e=>e.agentType===n.agent.agentType&&e.source===n.agent.source)||n.agent;return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(d,{title:e.agentType,onCancel:()=>r({mode:`agent-menu`,agent:e,previousMode:n.previousMode}),hideInputGuide:!0,children:(0,$.jsx)(Vn,{agent:e,tools:h,allAgents:l,onBack:()=>r({mode:`agent-menu`,agent:e,previousMode:n.previousMode})})}),(0,$.jsx)(ar,{instructions:`Press Enter or Esc to go back`})]})}case`delete-confirm`:return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(d,{title:`Delete agent`,onCancel:()=>{`previousMode`in n&&r(n.previousMode)},color:`error`,children:[(0,$.jsxs)(u,{children:[`Are you sure you want to delete the agent `,(0,$.jsx)(u,{bold:!0,children:n.agent.agentType}),`?`]}),(0,$.jsx)(_,{marginTop:1,children:(0,$.jsxs)(u,{dimColor:!0,children:[`Source: `,n.agent.source]})}),(0,$.jsx)(_,{marginTop:1,children:(0,$.jsx)(Le,{options:[{label:`Yes, delete`,value:`yes`},{label:`No, cancel`,value:`no`}],onChange:e=>{e===`yes`?y(n.agent):`previousMode`in n&&r(n.previousMode)},onCancel:()=>{`previousMode`in n&&r(n.previousMode)}})})]}),(0,$.jsx)(ar,{instructions:`Press ↑↓ to navigate, Enter to select, Esc to cancel`})]});case`edit-agent`:{let e=l.find(e=>e.agentType===n.agent.agentType&&e.source===n.agent.source)||n.agent;return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(d,{title:`Edit agent: ${e.agentType}`,onCancel:()=>r(n.previousMode),hideInputGuide:!0,children:(0,$.jsx)(rr,{agent:e,tools:h,onSaved:e=>{v(e),r(n.previousMode)},onBack:()=>r(n.previousMode)})}),(0,$.jsx)(ar,{})]})}default:return null}}var si,$,ci=e((()=>{c(),l(),si=t(l(),1),sn(),vn(),h(),At(),fn(),Vt(),_e(),we(),rt(),Hn(),ir(),sr(),lr(),Bn(),ai(),$=v()}));async function li(e,t){let n=t.getAppState().toolPermissionContext;return(0,ui.jsx)(oi,{tools:Je(n),onExit:e})}var ui;e((()=>{l(),ci(),Wt(),ui=v()}))();export{li as call};
102
+ `+Be(a,i):()=>r.systemPrompt}:void 0}),e()},onCancel:t},`memory-select`)})})}var Y,Hr=e((()=>{h(),E(),ae(),ht(),T(),Ne(),H(),V(),Y=v()}));function Ur(){let{goNext:e,goBack:t,updateWizardData:n,goToStep:r}=R();return(0,X.jsx)(B,{subtitle:`Creation method`,footerText:(0,X.jsxs)(p,{children:[(0,X.jsx)(f,{shortcut:`↑↓`,action:`navigate`}),(0,X.jsx)(f,{shortcut:`Enter`,action:`select`}),(0,X.jsx)(w,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:(0,X.jsx)(_,{children:(0,X.jsx)(kt,{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,Wr=e((()=>{h(),T(),Ne(),H(),V(),X=v()}));function Gr(){let{goNext:e,goBack:t,updateWizardData:n,wizardData:r}=R();return(0,Kr.jsx)(B,{subtitle:`Select model`,footerText:(0,Kr.jsxs)(p,{children:[(0,Kr.jsx)(f,{shortcut:`↑↓`,action:`navigate`}),(0,Kr.jsx)(f,{shortcut:`Enter`,action:`select`}),(0,Kr.jsx)(w,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:(0,Kr.jsx)(qn,{initialModel:r.selectedModel,onComplete:t=>{n({selectedModel:t}),e()},onCancel:t})})}var Kr,qr=e((()=>{T(),h(),H(),V(),Xn(),Kr=v()}));function Jr(){let{goNext:e,goBack:t,updateWizardData:n,wizardData:r}=R(),[i,a]=(0,Yr.useState)(r.systemPrompt||``),[o,s]=(0,Yr.useState)(i.length),[c,l]=(0,Yr.useState)(null);return g(`confirm:no`,t,{context:`Settings`}),g(`chat:externalEditor`,(0,Yr.useCallback)(async()=>{let e=await yn(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)(p,{children:[(0,Z.jsx)(f,{shortcut:`Type`,action:`enter text`}),(0,Z.jsx)(f,{shortcut:`Enter`,action:`continue`}),(0,Z.jsx)(w,{action:`chat:externalEditor`,context:`Chat`,fallback:`ctrl+g`,description:`open in editor`}),(0,Z.jsx)(w,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`go back`})]}),children:(0,Z.jsxs)(_,{flexDirection:`column`,children:[(0,Z.jsx)(u,{children:`Enter the system prompt for your agent:`}),(0,Z.jsx)(u,{dimColor:!0,children:`Be comprehensive for best results`}),(0,Z.jsx)(_,{marginTop:1,children:(0,Z.jsx)(Re,{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)(_,{marginTop:1,children:(0,Z.jsx)(u,{color:`error`,children:c})})]})})}var Yr,Z,Xr=e((()=>{Yr=t(l(),1),h(),E(),bn(),T(),He(),H(),V(),Z=v()}));function Zr({tools:e}){let{goNext:t,goBack:n,updateWizardData:r,wizardData:i}=R(),a=e=>{r({selectedTools:e}),t()},o=i.selectedTools;return(0,Qr.jsx)(B,{subtitle:`Select tools`,footerText:(0,Qr.jsxs)(p,{children:[(0,Qr.jsx)(f,{shortcut:`Enter`,action:`toggle selection`}),(0,Qr.jsx)(f,{shortcut:`↑↓`,action:`navigate`}),(0,Qr.jsx)(w,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:(0,Qr.jsx)($n,{tools:e,initialTools:o,onComplete:a,onCancel:n})})}var Qr,$r=e((()=>{h(),T(),H(),V(),er(),Qr=v()}));function ei(e){let{goNext:t,goBack:n,updateWizardData:r,wizardData:i}=R(),[a,o]=(0,ti.useState)(i.agentType||``),[s,c]=(0,ti.useState)(null),[l,d]=(0,ti.useState)(a.length);return g(`confirm:no`,n,{context:`Settings`}),(0,Q.jsx)(B,{subtitle:`Agent type (identifier)`,footerText:(0,Q.jsxs)(p,{children:[(0,Q.jsx)(f,{shortcut:`Type`,action:`enter text`}),(0,Q.jsx)(f,{shortcut:`Enter`,action:`continue`}),(0,Q.jsx)(w,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`go back`})]}),children:(0,Q.jsxs)(_,{flexDirection:`column`,children:[(0,Q.jsx)(u,{children:`Enter a unique identifier for your agent:`}),(0,Q.jsx)(_,{marginTop:1,children:(0,Q.jsx)(Re,{value:a,onChange:o,onSubmit:e=>{let n=e.trim(),i=xr(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:d,focus:!0,showCursor:!0})}),s&&(0,Q.jsx)(_,{marginTop:1,children:(0,Q.jsx)(u,{color:`error`,children:s})})]})})}var ti,Q,ni=e((()=>{ti=t(l(),1),h(),E(),T(),He(),H(),V(),Cr(),Q=v()}));function ri({tools:e,existingAgents:t,onComplete:n,onCancel:r}){return(0,ii.jsx)(ur,{steps:[zr,Ur,Lr,()=>(0,ii.jsx)(ei,{existingAgents:t}),Jr,Ar,()=>(0,ii.jsx)(Zr,{tools:e}),Gr,yr,...de()?[Vr]:[],()=>(0,ii.jsx)(Er,{tools:e,existingAgents:t,onComplete:n})],initialData:{},onComplete:()=>{},onCancel:r,title:`Create new agent`,showStepCounter:!1})}var ii,ai=e((()=>{ae(),H(),br(),kr(),Mr(),Rr(),Br(),Hr(),Wr(),qr(),Xr(),$r(),ni(),ii=v()}));function oi({tools:e,onExit:t}){let[n,r]=(0,si.useState)({mode:`list-agents`,source:`all`}),i=rt(e=>e.agentDefinitions),a=rt(e=>e.mcp.tools),o=rt(e=>e.toolPermissionContext),c=Ve(),{allAgents:l,activeAgents:f}=i,[p,m]=(0,si.useState)([]),h=_n(e,a,o);cn();let g=(0,si.useMemo)(()=>({"built-in":l.filter(e=>e.source===`built-in`),userSettings:l.filter(e=>e.source===`userSettings`),projectSettings:l.filter(e=>e.source===`projectSettings`),policySettings:l.filter(e=>e.source===`policySettings`),localSettings:l.filter(e=>e.source===`localSettings`),flagSettings:l.filter(e=>e.source===`flagSettings`),plugin:l.filter(e=>e.source===`plugin`),all:l}),[l]),v=(0,si.useCallback)(e=>{m(t=>[...t,e]),r({mode:`list-agents`,source:`all`})},[]),y=(0,si.useCallback)(async e=>{try{await Rn(e),c(t=>{let n=t.agentDefinitions.allAgents.filter(t=>!(t.agentType===e.agentType&&t.source===e.source));return{...t,agentDefinitions:{...t.agentDefinitions,allAgents:n,activeAgents:Bt(n)}}}),m(t=>[...t,`Deleted agent: ${s.bold(e.agentType)}`]),r({mode:`list-agents`,source:`all`})}catch(e){Te(me(e))}},[c]);switch(n.mode){case`list-agents`:{let e=mn(n.source===`all`?[...g[`built-in`],...g.userSettings,...g.projectSettings,...g.localSettings,...g.policySettings,...g.flagSettings,...g.plugin]:g[n.source],f);return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(cr,{source:n.source,agents:e,onBack:()=>{t((p.length>0?`Agent changes:\n${p.join(`
103
+ `)}`:void 0)??`Agents dialog dismissed`,{display:p.length===0?`system`:void 0})},onSelect:e=>r({mode:`agent-menu`,agent:e,previousMode:n}),onCreateNew:()=>r({mode:`create-agent`}),changes:p}),(0,$.jsx)(ar,{})]})}case`create-agent`:return(0,$.jsx)(ri,{tools:h,existingAgents:f,onComplete:v,onCancel:()=>r({mode:`list-agents`,source:`all`})});case`agent-menu`:{let e=l.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)(d,{title:n.agent.agentType,onCancel:()=>r(n.previousMode),hideInputGuide:!0,children:(0,$.jsxs)(_,{flexDirection:`column`,children:[(0,$.jsx)(kt,{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)}),p.length>0&&(0,$.jsx)(_,{marginTop:1,children:(0,$.jsx)(u,{dimColor:!0,children:p[p.length-1]})})]})}),(0,$.jsx)(ar,{})]})}case`view-agent`:{let e=l.find(e=>e.agentType===n.agent.agentType&&e.source===n.agent.source)||n.agent;return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(d,{title:e.agentType,onCancel:()=>r({mode:`agent-menu`,agent:e,previousMode:n.previousMode}),hideInputGuide:!0,children:(0,$.jsx)(Vn,{agent:e,tools:h,allAgents:l,onBack:()=>r({mode:`agent-menu`,agent:e,previousMode:n.previousMode})})}),(0,$.jsx)(ar,{instructions:`Press Enter or Esc to go back`})]})}case`delete-confirm`:return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(d,{title:`Delete agent`,onCancel:()=>{`previousMode`in n&&r(n.previousMode)},color:`error`,children:[(0,$.jsxs)(u,{children:[`Are you sure you want to delete the agent `,(0,$.jsx)(u,{bold:!0,children:n.agent.agentType}),`?`]}),(0,$.jsx)(_,{marginTop:1,children:(0,$.jsxs)(u,{dimColor:!0,children:[`Source: `,n.agent.source]})}),(0,$.jsx)(_,{marginTop:1,children:(0,$.jsx)(kt,{options:[{label:`Yes, delete`,value:`yes`},{label:`No, cancel`,value:`no`}],onChange:e=>{e===`yes`?y(n.agent):`previousMode`in n&&r(n.previousMode)},onCancel:()=>{`previousMode`in n&&r(n.previousMode)}})})]}),(0,$.jsx)(ar,{instructions:`Press ↑↓ to navigate, Enter to select, Esc to cancel`})]});case`edit-agent`:{let e=l.find(e=>e.agentType===n.agent.agentType&&e.source===n.agent.source)||n.agent;return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(d,{title:`Edit agent: ${e.agentType}`,onCancel:()=>r(n.previousMode),hideInputGuide:!0,children:(0,$.jsx)(rr,{agent:e,tools:h,onSaved:e=>{v(e),r(n.previousMode)},onBack:()=>r(n.previousMode)})}),(0,$.jsx)(ar,{})]})}default:return null}}var si,$,ci=e((()=>{c(),l(),si=t(l(),1),sn(),vn(),h(),et(),fn(),It(),_e(),we(),Ne(),Hn(),ir(),sr(),lr(),Bn(),ai(),$=v()}));async function li(e,t){let n=t.getAppState().toolPermissionContext;return(0,ui.jsx)(oi,{tools:Ge(n),onExit:e})}var ui;e((()=>{l(),ci(),zt(),ui=v()}))();export{li as call};
@@ -1,2 +1,2 @@
1
- import{n as e,t}from"./cwd--iizewsn.js";import{i as n,o as r,r as i}from"./loadAgentsDir-DI1a76pd.js";import{a,i as o,n as s,o as c,r as l,t as u}from"./agentDisplay-CVnAeURF.js";o(),r(),e();function d(e){let t=a(e),n=[e.agentType];return t&&n.push(t),e.memory&&n.push(`${e.memory} memory`),n.join(` · `)}async function f(){let{allAgents:e}=await n(t()),r=c(e,i(e)),a=[],o=0;for(let{label:e,source:t}of u){let n=r.filter(e=>e.source===t).sort(s);if(n.length!==0){a.push(`${e}:`);for(let e of n)if(e.overriddenBy){let t=l(e.overriddenBy);a.push(` (shadowed by ${t}) ${d(e)}`)}else a.push(` ${d(e)}`),o++;a.push(``)}}a.length===0?console.log(`No agents found.`):(console.log(`${o} active agents\n`),console.log(a.join(`
1
+ import{n as e,t}from"./cwd--iizewsn.js";import{i as n,o as r,r as i}from"./loadAgentsDir-D7kapZB5.js";import{a,i as o,n as s,o as c,r as l,t as u}from"./agentDisplay-Bi_bEyEn.js";o(),r(),e();function d(e){let t=a(e),n=[e.agentType];return t&&n.push(t),e.memory&&n.push(`${e.memory} memory`),n.join(` · `)}async function f(){let{allAgents:e}=await n(t()),r=c(e,i(e)),a=[],o=0;for(let{label:e,source:t}of u){let n=r.filter(e=>e.source===t).sort(s);if(n.length!==0){a.push(`${e}:`);for(let e of n)if(e.overriddenBy){let t=l(e.overriddenBy);a.push(` (shadowed by ${t}) ${d(e)}`)}else a.push(` ${d(e)}`),o++;a.push(``)}}a.length===0?console.log(`No agents found.`):(console.log(`${o} active agents\n`),console.log(a.join(`
2
2
  `).trimEnd()))}export{f as agentsHandler};
@@ -1 +1 @@
1
- import{H as e,I as t,N as n,O as r,P as i,j as a}from"./teamHelpers--3ZyNDlv.js";import{s as o,u as s}from"./logoV2Utils-DDUoPClc.js";i(),s();var c=`default`;async function l(e,t){let n=await r(t.list||c,{subject:e,description:t.description||``,status:`pending`,blocks:[],blockedBy:[]});console.log(`Created task ${n}: ${e}`)}async function u(e){let n=await t(e.list||c);if(e.pending&&(n=n.filter(e=>e.status===`pending`)),e.json){console.log(JSON.stringify(n,null,2));return}if(n.length===0){console.log(`No tasks found.`);return}for(let e of n)console.log(` [${e.status}] ${e.id}: ${e.subject}`),e.description&&console.log(` ${e.description}`),e.owner&&console.log(` owner: ${e.owner}`)}async function d(e,t){let n=await a(t.list||c,e);if(!n){console.error(`Task not found: ${e}`),process.exitCode=1;return}console.log(JSON.stringify(n,null,2))}async function f(t,n){let r=n.list||c,i={};n.status&&(i.status=n.status),n.subject&&(i.subject=n.subject),n.description&&(i.description=n.description),n.owner&&(i.owner=n.owner),n.clearOwner&&(i.owner=void 0);let a=await e(r,t,i);if(!a){console.error(`Task not found: ${t}`),process.exitCode=1;return}console.log(`Updated task ${t}: [${a.status}] ${a.subject}`)}async function p(e){let t=e.list||c;console.log(n(t))}async function m(e){let t=await o();if(e===void 0){if(t.length===0){console.log(`No recent sessions.`);return}for(let e=0;e<Math.min(t.length,20);e++){let n=t[e],r=n.modified?new Date(n.modified).toLocaleString():`unknown`,i=n.title||n.sessionId||`untitled`;console.log(` ${e}: ${i} (${r})`)}return}let n=typeof e==`string`?parseInt(e,10):e,r=Number.isFinite(n)&&n>=0&&n<t.length?t[n]:t.find(t=>t.sessionId===String(e));if(!r){console.error(`Session not found: ${e}`),process.exitCode=1;return}console.log(JSON.stringify(r,null,2))}async function h(e){let t=await o(),n=e??5;console.log(`Last ${n} sessions:`);for(let e=0;e<Math.min(n,t.length);e++){let n=t[e],r=n.modified?new Date(n.modified).toLocaleString():`unknown`;console.log(` ${e}: ${n.sessionId} (${r})`)}}async function g(e,t){let{writeFile:n,readFile:r}=await import(`fs/promises`),i=await o(),a=parseInt(e,10),s;if(s=Number.isFinite(a)&&a>=0&&a<i.length?i[a]:i.find(t=>t.sessionId===e),!s)try{await n(t,await r(e,`utf-8`),`utf-8`),console.log(`Exported ${e} → ${t}`);return}catch{console.error(`Source not found: ${e}`),process.exitCode=1;return}await n(t,JSON.stringify(s,null,2),`utf-8`),console.log(`Exported session ${s.sessionId} → ${t}`)}async function _(e,t,n){let{regenerateCompletionCache:r}=await import(`./completionCache-DHfUBBMH.js`);t.output,await r(),console.log(`Completion cache regenerated for ${e}.`)}export{_ as completionHandler,h as errorHandler,g as exportHandler,m as logHandler,l as taskCreateHandler,p as taskDirHandler,d as taskGetHandler,u as taskListHandler,f as taskUpdateHandler};
1
+ import{H as e,I as t,N as n,O as r,P as i,j as a}from"./teamHelpers-DEgaCpta.js";import{s as o,u as s}from"./logoV2Utils-DjThKW15.js";i(),s();var c=`default`;async function l(e,t){let n=await r(t.list||c,{subject:e,description:t.description||``,status:`pending`,blocks:[],blockedBy:[]});console.log(`Created task ${n}: ${e}`)}async function u(e){let n=await t(e.list||c);if(e.pending&&(n=n.filter(e=>e.status===`pending`)),e.json){console.log(JSON.stringify(n,null,2));return}if(n.length===0){console.log(`No tasks found.`);return}for(let e of n)console.log(` [${e.status}] ${e.id}: ${e.subject}`),e.description&&console.log(` ${e.description}`),e.owner&&console.log(` owner: ${e.owner}`)}async function d(e,t){let n=await a(t.list||c,e);if(!n){console.error(`Task not found: ${e}`),process.exitCode=1;return}console.log(JSON.stringify(n,null,2))}async function f(t,n){let r=n.list||c,i={};n.status&&(i.status=n.status),n.subject&&(i.subject=n.subject),n.description&&(i.description=n.description),n.owner&&(i.owner=n.owner),n.clearOwner&&(i.owner=void 0);let a=await e(r,t,i);if(!a){console.error(`Task not found: ${t}`),process.exitCode=1;return}console.log(`Updated task ${t}: [${a.status}] ${a.subject}`)}async function p(e){let t=e.list||c;console.log(n(t))}async function m(e){let t=await o();if(e===void 0){if(t.length===0){console.log(`No recent sessions.`);return}for(let e=0;e<Math.min(t.length,20);e++){let n=t[e],r=n.modified?new Date(n.modified).toLocaleString():`unknown`,i=n.title||n.sessionId||`untitled`;console.log(` ${e}: ${i} (${r})`)}return}let n=typeof e==`string`?parseInt(e,10):e,r=Number.isFinite(n)&&n>=0&&n<t.length?t[n]:t.find(t=>t.sessionId===String(e));if(!r){console.error(`Session not found: ${e}`),process.exitCode=1;return}console.log(JSON.stringify(r,null,2))}async function h(e){let t=await o(),n=e??5;console.log(`Last ${n} sessions:`);for(let e=0;e<Math.min(n,t.length);e++){let n=t[e],r=n.modified?new Date(n.modified).toLocaleString():`unknown`;console.log(` ${e}: ${n.sessionId} (${r})`)}}async function g(e,t){let{writeFile:n,readFile:r}=await import(`fs/promises`),i=await o(),a=parseInt(e,10),s;if(s=Number.isFinite(a)&&a>=0&&a<i.length?i[a]:i.find(t=>t.sessionId===e),!s)try{await n(t,await r(e,`utf-8`),`utf-8`),console.log(`Exported ${e} → ${t}`);return}catch{console.error(`Source not found: ${e}`),process.exitCode=1;return}await n(t,JSON.stringify(s,null,2),`utf-8`),console.log(`Exported session ${s.sessionId} → ${t}`)}async function _(e,t,n){let{regenerateCompletionCache:r}=await import(`./completionCache-DHfUBBMH.js`);t.output,await r(),console.log(`Completion cache regenerated for ${e}.`)}export{_ as completionHandler,h as errorHandler,g as exportHandler,m as logHandler,l as taskCreateHandler,p as taskDirHandler,d as taskGetHandler,u as taskListHandler,f as taskUpdateHandler};
@@ -0,0 +1 @@
1
+ import{a as e,n as t,o as n}from"./api-D_t0nHsS.js";n();export{t as fetchCodeSessionsFromSessionsAPI,e as getOAuthHeaders};
@@ -1 +1 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./axios-DhfaybwJ.js";import{n as r,t as i}from"./v4-f1i_CNUT.js";import{Ac as a,Jt as o,Sc as s,la as c,on as l,ua as u}from"./paths-BBvuDQl9.js";import{E as d,K as f,L as p,V as m,d as h,s as g,w as _}from"./debug-UI3T040K.js";import{l as v,u as y}from"./oauth-CdZEzMww.js";import{o as b,s as x}from"./log-CzsijfHZ.js";import{n as S,t as C}from"./lazySchema-2sOku3cX.js";import{n as w,t as T}from"./sleep-8Eb9j_Ly.js";import{a as E,o as D}from"./detectRepository-CBk3S2zv.js";import{randomUUID as O}from"crypto";function k(e){return t.isAxiosError(e)?!e.response||e.response.status>=500:!1}async function A(e,n){let r;for(let i=0;i<=V;i++)try{return await t.get(e,n)}catch(e){if(r=e,!k(e))throw e;if(i>=V)throw h(`Teleport request failed after ${i+1} attempts: ${p(e)}`),e;let t=B[i]??2e3;h(`Teleport request failed (attempt ${i+1}/${V+1}), retrying in ${t}ms: ${p(e)}`),await w(t)}throw r}function j(e){return e===null||typeof e==`string`&&e.trim()===``}async function M(){let e=s(),t=process.env.ANTHROPIC_API_KEY?.trim()||e.workspaceApiKey?.trim();if(!t){let t=e.workspaceApiKey,n=j(t)?`Your workspace API key was cleared. `:`A workspace API key (sk-ant-api03-*) is required to use workspace endpoints (/v1/agents, /v1/vaults, /v1/memory_stores, /v1/skills). `;throw Error(n+`Press W in /login to save your key directly (no restart needed), or set ANTHROPIC_API_KEY=<key> and restart. Obtain a key from https://console.anthropic.com/settings/keys. Subscription OAuth (claude.ai login) cannot reach these endpoints.`)}if(!t.startsWith(`sk-ant-api03-`))throw Error(`Workspace API key must start with sk-ant-api03-, got prefix "${t.slice(0,4)}...". Obtain a workspace API key from https://console.anthropic.com/settings/keys. Press W in /login to save your key, or set ANTHROPIC_API_KEY.`);return{apiKey:t}}async function N(){let e=o()?.accessToken;if(e===void 0)throw Error(`Claude Code web sessions require authentication with a Claude.ai account. API key authentication is not sufficient. Please run /login to authenticate, or check your authentication status with /status.`);let t=await c();if(!t)throw Error(`Unable to get organization UUID`);return{accessToken:e,orgUUID:t}}async function P(){let{accessToken:e,orgUUID:t}=await N(),n=`${v().BASE_API_URL}/v1/sessions`;try{let r=await A(n,{headers:{...F(e),"anthropic-beta":`ccr-byoc-2025-07-29`,"x-organization-uuid":t}});if(r.status!==200)throw Error(`Failed to fetch code sessions: ${r.statusText}`);return r.data.data.map(e=>{let t=e.session_context.sources.find(e=>e.type===`git_repository`),n=null;if(t?.url){let e=D(t.url);if(e){let[r,i]=e.split(`/`);r&&i&&(n={name:i,owner:{login:r},default_branch:t.revision||void 0})}}return{id:e.id,title:e.title||`Untitled`,description:``,status:e.session_status,repo:n,turns:[],created_at:e.created_at,updated_at:e.updated_at}})}catch(e){throw x(f(e)),e}}function F(e){return{Authorization:`Bearer ${e}`,"Content-Type":`application/json`,"anthropic-version":`2023-06-01`}}async function I(e){let{accessToken:n,orgUUID:r}=await N(),i=`${v().BASE_API_URL}/v1/sessions/${e}`,a={...F(n),"anthropic-beta":`ccr-byoc-2025-07-29`,"x-organization-uuid":r},o=await t.get(i,{headers:a,timeout:15e3,validateStatus:e=>e<500});if(o.status!==200){let t=o.data?.error?.message;throw o.status===404?Error(`Session not found: ${e}`):o.status===401?Error(`Session expired. Please run /login to sign in again.`):Error(t||`Failed to fetch session: ${o.status} ${o.statusText}`)}return o.data}function L(e){return(e.session_context.outcomes?.find(e=>e.type===`git_repository`))?.git_info?.branches[0]}async function R(e,n,r){try{let{accessToken:i,orgUUID:a}=await N(),o=`${v().BASE_API_URL}/v1/sessions/${e}/events`,s={...F(i),"anthropic-beta":`ccr-byoc-2025-07-29`,"x-organization-uuid":a},c={events:[{uuid:r?.uuid??O(),session_id:e,type:`user`,parent_tool_use_id:null,message:{role:`user`,content:n}}]};h(`[sendEventToRemoteSession] Sending event to session ${e}`);let l=await t.post(o,c,{headers:s,validateStatus:e=>e<500,timeout:3e4});return l.status===200||l.status===201?(h(`[sendEventToRemoteSession] Successfully sent event to session ${e}`),!0):(h(`[sendEventToRemoteSession] Failed with status ${l.status}: ${d(l.data)}`),!1)}catch(e){return h(`[sendEventToRemoteSession] Error: ${p(e)}`),!1}}async function z(e,n){try{let{accessToken:r,orgUUID:i}=await N(),a=`${v().BASE_API_URL}/v1/sessions/${e}`,o={...F(r),"anthropic-beta":`ccr-byoc-2025-07-29`,"x-organization-uuid":i};h(`[updateSessionTitle] Updating title for session ${e}: "${n}"`);let s=await t.patch(a,{title:n},{headers:o,validateStatus:e=>e<500});return s.status===200?(h(`[updateSessionTitle] Successfully updated title for session ${e}`),!0):(h(`[updateSessionTitle] Failed with status ${s.status}: ${d(s.data)}`),!1)}catch(e){return h(`[updateSessionTitle] Error: ${p(e)}`),!1}}var B,V,H=e((()=>{n(),y(),u(),i(),l(),a(),g(),E(),m(),C(),b(),T(),_(),B=[2e3,4e3,8e3,16e3],V=B.length,S(()=>r.object({id:r.string(),title:r.string(),description:r.string(),status:r.enum([`idle`,`working`,`waiting`,`completed`,`archived`,`cancelled`,`rejected`]),repo:r.object({name:r.string(),owner:r.object({login:r.string()}),default_branch:r.string().optional()}).nullable(),turns:r.array(r.string()),created_at:r.string(),updated_at:r.string()}))}));export{F as a,j as c,R as d,z as f,L as i,N as l,P as n,H as o,I as r,k as s,A as t,M as u};
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./axios-DhfaybwJ.js";import{n as r,t as i}from"./v4-f1i_CNUT.js";import{Ac as a,Jt as o,Sc as s,la as c,on as l,ua as u}from"./paths-1ngPRtu3.js";import{E as d,K as f,L as p,V as m,d as h,s as g,w as _}from"./debug-UI3T040K.js";import{l as v,u as y}from"./oauth-CdZEzMww.js";import{o as b,s as x}from"./log-CzsijfHZ.js";import{n as S,t as C}from"./lazySchema-2sOku3cX.js";import{n as w,t as T}from"./sleep-8Eb9j_Ly.js";import{a as E,o as D}from"./detectRepository-CBk3S2zv.js";import{randomUUID as O}from"crypto";function k(e){return t.isAxiosError(e)?!e.response||e.response.status>=500:!1}async function A(e,n){let r;for(let i=0;i<=V;i++)try{return await t.get(e,n)}catch(e){if(r=e,!k(e))throw e;if(i>=V)throw h(`Teleport request failed after ${i+1} attempts: ${p(e)}`),e;let t=B[i]??2e3;h(`Teleport request failed (attempt ${i+1}/${V+1}), retrying in ${t}ms: ${p(e)}`),await w(t)}throw r}function j(e){return e===null||typeof e==`string`&&e.trim()===``}async function M(){let e=s(),t=process.env.ANTHROPIC_API_KEY?.trim()||e.workspaceApiKey?.trim();if(!t){let t=e.workspaceApiKey,n=j(t)?`Your workspace API key was cleared. `:`A workspace API key (sk-ant-api03-*) is required to use workspace endpoints (/v1/agents, /v1/vaults, /v1/memory_stores, /v1/skills). `;throw Error(n+`Press W in /login to save your key directly (no restart needed), or set ANTHROPIC_API_KEY=<key> and restart. Obtain a key from https://console.anthropic.com/settings/keys. Subscription OAuth (claude.ai login) cannot reach these endpoints.`)}if(!t.startsWith(`sk-ant-api03-`))throw Error(`Workspace API key must start with sk-ant-api03-, got prefix "${t.slice(0,4)}...". Obtain a workspace API key from https://console.anthropic.com/settings/keys. Press W in /login to save your key, or set ANTHROPIC_API_KEY.`);return{apiKey:t}}async function N(){let e=o()?.accessToken;if(e===void 0)throw Error(`Claude Code web sessions require authentication with a Claude.ai account. API key authentication is not sufficient. Please run /login to authenticate, or check your authentication status with /status.`);let t=await c();if(!t)throw Error(`Unable to get organization UUID`);return{accessToken:e,orgUUID:t}}async function P(){let{accessToken:e,orgUUID:t}=await N(),n=`${v().BASE_API_URL}/v1/sessions`;try{let r=await A(n,{headers:{...F(e),"anthropic-beta":`ccr-byoc-2025-07-29`,"x-organization-uuid":t}});if(r.status!==200)throw Error(`Failed to fetch code sessions: ${r.statusText}`);return r.data.data.map(e=>{let t=e.session_context.sources.find(e=>e.type===`git_repository`),n=null;if(t?.url){let e=D(t.url);if(e){let[r,i]=e.split(`/`);r&&i&&(n={name:i,owner:{login:r},default_branch:t.revision||void 0})}}return{id:e.id,title:e.title||`Untitled`,description:``,status:e.session_status,repo:n,turns:[],created_at:e.created_at,updated_at:e.updated_at}})}catch(e){throw x(f(e)),e}}function F(e){return{Authorization:`Bearer ${e}`,"Content-Type":`application/json`,"anthropic-version":`2023-06-01`}}async function I(e){let{accessToken:n,orgUUID:r}=await N(),i=`${v().BASE_API_URL}/v1/sessions/${e}`,a={...F(n),"anthropic-beta":`ccr-byoc-2025-07-29`,"x-organization-uuid":r},o=await t.get(i,{headers:a,timeout:15e3,validateStatus:e=>e<500});if(o.status!==200){let t=o.data?.error?.message;throw o.status===404?Error(`Session not found: ${e}`):o.status===401?Error(`Session expired. Please run /login to sign in again.`):Error(t||`Failed to fetch session: ${o.status} ${o.statusText}`)}return o.data}function L(e){return(e.session_context.outcomes?.find(e=>e.type===`git_repository`))?.git_info?.branches[0]}async function R(e,n,r){try{let{accessToken:i,orgUUID:a}=await N(),o=`${v().BASE_API_URL}/v1/sessions/${e}/events`,s={...F(i),"anthropic-beta":`ccr-byoc-2025-07-29`,"x-organization-uuid":a},c={events:[{uuid:r?.uuid??O(),session_id:e,type:`user`,parent_tool_use_id:null,message:{role:`user`,content:n}}]};h(`[sendEventToRemoteSession] Sending event to session ${e}`);let l=await t.post(o,c,{headers:s,validateStatus:e=>e<500,timeout:3e4});return l.status===200||l.status===201?(h(`[sendEventToRemoteSession] Successfully sent event to session ${e}`),!0):(h(`[sendEventToRemoteSession] Failed with status ${l.status}: ${d(l.data)}`),!1)}catch(e){return h(`[sendEventToRemoteSession] Error: ${p(e)}`),!1}}async function z(e,n){try{let{accessToken:r,orgUUID:i}=await N(),a=`${v().BASE_API_URL}/v1/sessions/${e}`,o={...F(r),"anthropic-beta":`ccr-byoc-2025-07-29`,"x-organization-uuid":i};h(`[updateSessionTitle] Updating title for session ${e}: "${n}"`);let s=await t.patch(a,{title:n},{headers:o,validateStatus:e=>e<500});return s.status===200?(h(`[updateSessionTitle] Successfully updated title for session ${e}`),!0):(h(`[updateSessionTitle] Failed with status ${s.status}: ${d(s.data)}`),!1)}catch(e){return h(`[updateSessionTitle] Error: ${p(e)}`),!1}}var B,V,H=e((()=>{n(),y(),u(),i(),l(),a(),g(),E(),m(),C(),b(),T(),_(),B=[2e3,4e3,8e3,16e3],V=B.length,S(()=>r.object({id:r.string(),title:r.string(),description:r.string(),status:r.enum([`idle`,`working`,`waiting`,`completed`,`archived`,`cancelled`,`rejected`]),repo:r.object({name:r.string(),owner:r.object({login:r.string()}),default_branch:r.string().optional()}).nullable(),turns:r.array(r.string()),created_at:r.string(),updated_at:r.string()}))}));export{F as a,j as c,R as d,z as f,L as i,N as l,P as n,H as o,I as r,k as s,A as t,M as u};
@@ -0,0 +1 @@
1
+ import{i as e,s as t}from"./assistant-EA-MHNQ-.js";e();export{t as isAssistantMode};
@@ -1 +1 @@
1
- import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n,b as r,d as i,f as a,nt as o,t as s,x as c}from"./src-Di342QoJ.js";import{t as l}from"./jsx-runtime-D-D469L8.js";import{K as u,Kn as d,cn as f}from"./state-sIHsFpDu.js";import{r as p,v as m}from"./git-CN3qtTb_.js";import{Mx as h,kx as g}from"./loadAgentsDir-DI1a76pd.js";import{t as _}from"./useKeybinding-FsOnjW6T.js";import{t as v}from"./Dialog-DYFGqyDs.js";import{t as y}from"./ListItem-OFARanN7.js";import{i as b,o as x,t as S}from"./cliLaunch-BQa48gsr.js";import{resolve as C}from"path";async function w(){let e=process.cwd();return p(e)||C(e)}function T({defaultDir:e,onInstalled:t,onCancel:n,onError:s}){h(`assistant-install-wizard`);let[l,u]=(0,D.useState)(0),[d,f]=(0,D.useState)(!1);o({"select:next":()=>u(e=>(e+1)%2),"select:previous":()=>u(e=>(e-1+2)%2),"select:accept":()=>{l===0?p():n()}},{context:`Select`});function p(){if(d)return;f(!0);let n=e||C(`.`);try{let e=x(S([`daemon`,`start`,`--dir=${n}`]),{cwd:n,stdio:`ignore`,detached:!0});e.unref(),e.on(`error`,e=>{s(`Failed to start daemon: ${e.message}`)}),setTimeout(()=>{t(n)},1500)}catch(e){s(`Failed to start daemon: ${e instanceof Error?e.message:String(e)}`)}}return d?(0,O.jsx)(a,{title:`Assistant Setup`,onCancel:n,hideInputGuide:!0,children:(0,O.jsxs)(r,{children:[`Starting daemon in `,e,`...`]})}):(0,O.jsx)(a,{title:`Assistant Setup`,onCancel:n,hideInputGuide:!0,children:(0,O.jsxs)(c,{flexDirection:`column`,gap:1,children:[(0,O.jsx)(r,{children:`No active assistant sessions found.`}),(0,O.jsxs)(r,{children:[`Start a daemon in `,(0,O.jsx)(r,{bold:!0,children:e||`.`}),` to create a cloud session?`]}),(0,O.jsxs)(c,{flexDirection:`column`,children:[(0,O.jsx)(i,{isFocused:l===0,children:(0,O.jsx)(r,{children:`Start assistant daemon`})}),(0,O.jsx)(i,{isFocused:l===1,children:(0,O.jsx)(r,{children:`Cancel`})})]}),(0,O.jsx)(r,{dimColor:!0,children:`Enter to select · Esc to cancel`})]})})}async function E(e,t,n){let{setAppState:r,getAppState:i}=t;return u()?(i().assistantPanelVisible?(r(e=>({...e,assistantPanelVisible:!1})),e(`Assistant panel hidden.`,{display:`system`})):(r(e=>({...e,assistantPanelVisible:!0})),e(`Assistant panel opened.`,{display:`system`})),null):(d(!0),r(e=>({...e,kairosEnabled:!0,assistantPanelVisible:!0})),e(`KAIROS assistant mode activated.`,{display:`system`}),null)}var D,O;e((()=>{n(),D=t(n(),1),s(),v(),y(),g(),_(),m(),b(),f(),O=l()}))();export{T as NewInstallWizard,E as call,w as computeDefaultInstallDir};
1
+ import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n,b as r,d as i,f as a,nt as o,t as s,x as c}from"./src-Di342QoJ.js";import{t as l}from"./jsx-runtime-D-D469L8.js";import{K as u,Kn as d,cn as f}from"./state-sIHsFpDu.js";import{r as p,v as m}from"./git-CN3qtTb_.js";import{Px as h,jx as g}from"./loadAgentsDir-D7kapZB5.js";import{t as _}from"./useKeybinding-FsOnjW6T.js";import{t as v}from"./Dialog-DYFGqyDs.js";import{t as y}from"./ListItem-OFARanN7.js";import{i as b,o as x,t as S}from"./cliLaunch-BQa48gsr.js";import{resolve as C}from"path";async function w(){let e=process.cwd();return p(e)||C(e)}function T({defaultDir:e,onInstalled:t,onCancel:n,onError:s}){h(`assistant-install-wizard`);let[l,u]=(0,D.useState)(0),[d,f]=(0,D.useState)(!1);o({"select:next":()=>u(e=>(e+1)%2),"select:previous":()=>u(e=>(e-1+2)%2),"select:accept":()=>{l===0?p():n()}},{context:`Select`});function p(){if(d)return;f(!0);let n=e||C(`.`);try{let e=x(S([`daemon`,`start`,`--dir=${n}`]),{cwd:n,stdio:`ignore`,detached:!0});e.unref(),e.on(`error`,e=>{s(`Failed to start daemon: ${e.message}`)}),setTimeout(()=>{t(n)},1500)}catch(e){s(`Failed to start daemon: ${e instanceof Error?e.message:String(e)}`)}}return d?(0,O.jsx)(a,{title:`Assistant Setup`,onCancel:n,hideInputGuide:!0,children:(0,O.jsxs)(r,{children:[`Starting daemon in `,e,`...`]})}):(0,O.jsx)(a,{title:`Assistant Setup`,onCancel:n,hideInputGuide:!0,children:(0,O.jsxs)(c,{flexDirection:`column`,gap:1,children:[(0,O.jsx)(r,{children:`No active assistant sessions found.`}),(0,O.jsxs)(r,{children:[`Start a daemon in `,(0,O.jsx)(r,{bold:!0,children:e||`.`}),` to create a cloud session?`]}),(0,O.jsxs)(c,{flexDirection:`column`,children:[(0,O.jsx)(i,{isFocused:l===0,children:(0,O.jsx)(r,{children:`Start assistant daemon`})}),(0,O.jsx)(i,{isFocused:l===1,children:(0,O.jsx)(r,{children:`Cancel`})})]}),(0,O.jsx)(r,{dimColor:!0,children:`Enter to select · Esc to cancel`})]})})}async function E(e,t,n){let{setAppState:r,getAppState:i}=t;return u()?(i().assistantPanelVisible?(r(e=>({...e,assistantPanelVisible:!1})),e(`Assistant panel hidden.`,{display:`system`})):(r(e=>({...e,assistantPanelVisible:!0})),e(`Assistant panel opened.`,{display:`system`})),null):(d(!0),r(e=>({...e,kairosEnabled:!0,assistantPanelVisible:!0})),e(`KAIROS assistant mode activated.`,{display:`system`}),null)}var D,O;e((()=>{n(),D=t(n(),1),s(),v(),y(),g(),_(),m(),b(),f(),O=l()}))();export{T as NewInstallWizard,E as call,w as computeDefaultInstallDir};
@@ -1 +1 @@
1
- import{n as e,r as t}from"./chunk-DR8-3Aex.js";import{n,s as r}from"./envUtils-BWeoiL4Y.js";import{Ct as i,K as a,cn as o}from"./state-sIHsFpDu.js";import{n as s,t as c}from"./cwd--iizewsn.js";import{Ad as l,Ay as u,kd as d,ky as f}from"./loadAgentsDir-DI1a76pd.js";import{A as p,B as m,P as h,R as g,a as _,c as v,i as y,p as b,y as x}from"./teamHelpers--3ZyNDlv.js";import{a as S,c as C}from"./constants-41VpZw2G.js";import{join as w}from"path";import{readFileSync as T}from"fs";var E=t({getAssistantActivationPath:()=>M,getAssistantSystemPromptAddendum:()=>j,initializeAssistantTeam:()=>A,isAssistantForced:()=>k,isAssistantMode:()=>D,markAssistantForced:()=>O});function D(){return a()}function O(){N=!0}function k(){return N}async function A(){let e=i(),t=b(`assistant-${e.slice(0,8)}`),n=f(S,t),r=y(t),a=Date.now(),o=c(),s=d(n);return await x(t,{name:t,description:`Assistant mode in-process team`,createdAt:a,leadAgentId:n,leadSessionId:e,members:[{agentId:n,name:S,agentType:`assistant`,color:s,joinedAt:a,tmuxPaneId:``,cwd:o,subscriptions:[],backendType:`in-process`}]}),v(t),await g(t),await p(t),m(t),{teamName:t,teamFilePath:r,leadAgentId:n,selfAgentId:n,selfAgentName:S,isLeader:!0,selfAgentColor:s,teammates:{[n]:{name:S,agentType:`assistant`,color:s,tmuxSessionName:`in-process`,tmuxPaneId:`leader`,cwd:o,spawnedAt:a}}}}function j(){try{return T(w(n(),`agents`,`assistant.md`),`utf-8`)}catch{return``}}function M(){if(D())return N?`daemon`:`gate`}var N,P=e((()=>{o(),u(),s(),r(),C(),_(),l(),h(),N=!1}));export{A as a,O as c,P as i,M as n,k as o,j as r,D as s,E as t};
1
+ import{n as e,r as t}from"./chunk-DR8-3Aex.js";import{n,s as r}from"./envUtils-BWeoiL4Y.js";import{Ct as i,K as a,cn as o}from"./state-sIHsFpDu.js";import{n as s,t as c}from"./cwd--iizewsn.js";import{Ad as l,My as u,jy as d,kd as f}from"./loadAgentsDir-D7kapZB5.js";import{A as p,B as m,P as h,R as g,a as _,c as v,i as y,p as b,y as x}from"./teamHelpers-DEgaCpta.js";import{a as S,c as C}from"./constants-41VpZw2G.js";import{join as w}from"path";import{readFileSync as T}from"fs";var E=t({getAssistantActivationPath:()=>M,getAssistantSystemPromptAddendum:()=>j,initializeAssistantTeam:()=>A,isAssistantForced:()=>k,isAssistantMode:()=>D,markAssistantForced:()=>O});function D(){return a()}function O(){N=!0}function k(){return N}async function A(){let e=i(),t=b(`assistant-${e.slice(0,8)}`),n=d(S,t),r=y(t),a=Date.now(),o=c(),s=f(n);return await x(t,{name:t,description:`Assistant mode in-process team`,createdAt:a,leadAgentId:n,leadSessionId:e,members:[{agentId:n,name:S,agentType:`assistant`,color:s,joinedAt:a,tmuxPaneId:``,cwd:o,subscriptions:[],backendType:`in-process`}]}),v(t),await g(t),await p(t),m(t),{teamName:t,teamFilePath:r,leadAgentId:n,selfAgentId:n,selfAgentName:S,isLeader:!0,selfAgentColor:s,teammates:{[n]:{name:S,agentType:`assistant`,color:s,tmuxSessionName:`in-process`,tmuxPaneId:`leader`,cwd:o,spawnedAt:a}}}}function j(){try{return T(w(n(),`agents`,`assistant.md`),`utf-8`)}catch{return``}}function M(){if(D())return N?`daemon`:`gate`}var N,P=e((()=>{o(),u(),s(),r(),C(),_(),l(),h(),N=!1}));export{A as a,O as c,P as i,M as n,k as o,j as r,D as s,E as t};
@@ -1 +1 @@
1
- import{Jt as e,Pt as t,cn as n,nn as r,on as i,zt as a}from"./paths-BBvuDQl9.js";i();export{t as checkAndRefreshOAuthTokenIfNeeded,a as clearOAuthTokenCache,e as getClaudeAIOAuthTokens,r as handleOAuth401Error,n as isAnthropicAuthEnabled};
1
+ import{Jt as e,Pt as t,cn as n,nn as r,on as i,zt as a}from"./paths-1ngPRtu3.js";i();export{t as checkAndRefreshOAuthTokenIfNeeded,a as clearOAuthTokenCache,e as getClaudeAIOAuthTokens,r as handleOAuth401Error,n as isAnthropicAuthEnabled};
@@ -0,0 +1 @@
1
+ import{_b as e,gb as t,vb as n,yb as r}from"./loadAgentsDir-D7kapZB5.js";r();export{t as authLogin,e as authLogout,n as authStatus};
@@ -1,5 +1,5 @@
1
- import{Br as e,Dr as t,Ga as n,Mr as r,Pr as i,oo as a}from"./paths-BBvuDQl9.js";import{E as o,L as s,V as c,w as l}from"./debug-UI3T040K.js";import{d_ as u,f_ as d,m_ as f,p_ as p,u_ as m}from"./loadAgentsDir-DI1a76pd.js";import{n as h,t as g}from"./poorMode-DzYT47KW.js";c(),i(),d(),a(),g(),p(),l();function _(e){process.stdout.write(o(e,null,2)+`
2
- `)}function v(){_(u())}function y(){let e=n(),t=u();_({allow:e?.allow?.length?e.allow:t.allow,soft_deny:e?.soft_deny?.length?e.soft_deny:t.soft_deny,environment:e?.environment?.length?e.environment:t.environment})}var b=`You are an expert reviewer of auto mode classifier rules for Claude Code.
1
+ import{Br as e,Dr as t,Ga as n,Mr as r,Pr as i,oo as a}from"./paths-1ngPRtu3.js";import{E as o,L as s,V as c,w as l}from"./debug-UI3T040K.js";import{d_ as u,f_ as d,l_ as f,p_ as p,u_ as m}from"./loadAgentsDir-D7kapZB5.js";import{n as h,t as g}from"./poorMode-CsGLI_hm.js";c(),i(),u(),a(),g(),d(),l();function _(e){process.stdout.write(o(e,null,2)+`
2
+ `)}function v(){_(m())}function y(){let e=n(),t=m();_({allow:e?.allow?.length?e.allow:t.allow,soft_deny:e?.soft_deny?.length?e.soft_deny:t.soft_deny,environment:e?.environment?.length?e.environment:t.environment})}var b=`You are an expert reviewer of auto mode classifier rules for Claude Code.
3
3
 
4
4
  Claude Code has an "auto mode" that uses an AI classifier to decide whether tool calls should be auto-approved or require user confirmation. Users can write custom rules in three categories:
5
5
 
@@ -19,9 +19,9 @@ Be concise and constructive. Only comment on rules that could be improved. If al
19
19
 
20
20
  Add rules to your settings file under autoMode.{allow, soft_deny, environment}.
21
21
  Run \`claude auto-mode defaults\` to see the default rules for reference.
22
- `);return}let o=i.model?e(i.model):h()?r():t(),c=u(),l=m(),d=S(`allow`,a?.allow??[],c.allow)+S(`soft_deny`,a?.soft_deny??[],c.soft_deny)+S(`environment`,a?.environment??[],c.environment);process.stdout.write(`Analyzing your auto mode rules…
22
+ `);return}let o=i.model?e(i.model):h()?r():t(),c=m(),l=f(),u=S(`allow`,a?.allow??[],c.allow)+S(`soft_deny`,a?.soft_deny??[],c.soft_deny)+S(`environment`,a?.environment??[],c.environment);process.stdout.write(`Analyzing your auto mode rules…
23
23
 
24
- `);let p;try{p=await f({querySource:`auto_mode_critique`,model:o,system:b,skipSystemPromptPrefix:!0,max_tokens:4096,messages:[{role:`user`,content:`Here is the full classifier system prompt that the auto mode classifier receives:
24
+ `);let d;try{d=await p({querySource:`auto_mode_critique`,model:o,system:b,skipSystemPromptPrefix:!0,max_tokens:4096,messages:[{role:`user`,content:`Here is the full classifier system prompt that the auto mode classifier receives:
25
25
 
26
26
  <classifier_system_prompt>
27
27
  `+l+`
@@ -29,9 +29,9 @@ Run \`claude auto-mode defaults\` to see the default rules for reference.
29
29
 
30
30
  Here are the user's custom rules that REPLACE the corresponding default sections:
31
31
 
32
- `+d+`
32
+ `+u+`
33
33
  Please critique these custom rules.`}]})}catch(e){process.stderr.write(`Failed to analyze rules: `+s(e)+`
34
- `),process.exitCode=1;return}let g=p.content.find(e=>e.type===`text`);g?.type===`text`?process.stdout.write(g.text+`
34
+ `),process.exitCode=1;return}let g=d.content.find(e=>e.type===`text`);g?.type===`text`?process.stdout.write(g.text+`
35
35
  `):process.stdout.write(`No critique was generated. Please try again.
36
36
  `)}function S(e,t,n){if(t.length===0)return``;let r=t.map(e=>`- `+e).join(`
37
37
  `),i=n.map(e=>`- `+e).join(`
@@ -1,19 +1,19 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{i as t,s as n}from"./envUtils-BWeoiL4Y.js";import{cn as r,ut as i}from"./state-sIHsFpDu.js";import{s as a,u as ee}from"./types-Csi32ZXh.js";import{$D as te,D as ne,GD as re,JD as o,KD as s,QD as c,S as ie,YD as l,ZD as ae,bO as u,cf as d,eO as f,hO as p,iO as oe,lO as se,lf as ce,nO as m,qD as h,rO as g,sf as le,tO as ue,w as de}from"./loadAgentsDir-DI1a76pd.js";import{G as fe,U as pe,V as me}from"./prompt-CjFAtm3w.js";import{n as he,r as _}from"./cron-DiW7eIPP.js";import{I as v,P as y}from"./teamHelpers--3ZyNDlv.js";import{a as b,n as x,o as S,t as C}from"./bridgeConfig-lRZfQqmA.js";import{i as w,o as T}from"./bg-DK0E4ZtW.js";import{n as E,t as D}from"./state-Ce1HlR-H.js";import{a as O,i as k,n as A,r as j}from"./pipeTransport-DVoIA1uN.js";import{join as M}from"path";import"crypto";import{readFile as N,readdir as P}from"fs/promises";function F(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function I(e){return typeof e==`string`&&V.includes(e)}function L(e){return typeof e==`string`&&H.includes(e)}function R(e){return!F(e)||typeof e.name!=`string`||!L(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 ge(e){if(!F(e)||typeof e.runId!=`string`||typeof e.workflow!=`string`||!I(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(R).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 _e(e,t){try{return ge(ee(await N(M(e,z,`${t}.json`),`utf-8`),!1))}catch{return null}}async function ve(e=i()){let t;try{t=await P(M(e,z))}catch{return[]}let n=t.filter(e=>e.endsWith(`.json`));return(await Promise.all(n.slice(0,B).map(t=>_e(e,t.slice(0,-5))))).filter(e=>e!==null).sort((e,t)=>t.updatedAt-e.updatedAt)}function ye(e){if(e.length===0)return[`Workflow runs: 0`,` none`].join(`
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{i as t,s as n}from"./envUtils-BWeoiL4Y.js";import{cn as r,ut as i}from"./state-sIHsFpDu.js";import{s as a,u as ee}from"./types-Csi32ZXh.js";import{$D as te,D as ne,JD as o,S as re,SO as s,XD as c,YD as l,ZD as u,_O as ie,aO as d,cf as f,dO as p,eO as m,iO as h,lf as ae,nO as g,oO as oe,qD as se,rO as ce,sf as le,tO as ue,w as de}from"./loadAgentsDir-D7kapZB5.js";import{G as fe,U as pe,V as me}from"./prompt-BBg3jtfc.js";import{n as he,r as _}from"./cron-DiW7eIPP.js";import{I as v,P as y}from"./teamHelpers-DEgaCpta.js";import{a as b,n as x,o as S,t as C}from"./bridgeConfig-Df6uyp3q.js";import{i as w,o as T}from"./bg-DK0E4ZtW.js";import{n as E,t as D}from"./state-Ce1HlR-H.js";import{a as O,i as k,n as A,r as j}from"./pipeTransport-KU8psPDI.js";import{join as M}from"path";import"crypto";import{readFile as N,readdir as P}from"fs/promises";function F(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function I(e){return typeof e==`string`&&H.includes(e)}function L(e){return typeof e==`string`&&U.includes(e)}function R(e){return!F(e)||typeof e.name!=`string`||!L(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 ge(e){if(!F(e)||typeof e.runId!=`string`||typeof e.workflow!=`string`||!I(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(R).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 _e(e,t){try{return ge(ee(await N(M(e,B,`${t}.json`),`utf-8`),!1))}catch{return null}}async function ve(e=i()){let t;try{t=await P(M(e,B))}catch{return[]}let n=t.filter(e=>e.endsWith(`.json`));return(await Promise.all(n.slice(0,V).map(t=>_e(e,t.slice(0,-5))))).filter(e=>e!==null).sort((e,t)=>t.updatedAt-e.updatedAt)}function z(e){if(e.length===0)return[`Workflow runs: 0`,` none`].join(`
2
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 z,B,V,H,be=e((()=>{r(),a(),z=M(`.claude`,`workflow-runs`),B=200,V=[`running`,`completed`,`cancelled`],H=[`pending`,`running`,`completed`,`cancelled`]}));function xe(){return M(A(),`registry.json`)}async function Se(){try{let e=await N(xe(),`utf8`),t=JSON.parse(e);return t.version===1?t:{...U}}catch{return{...U}}}var U,Ce=e((()=>{j(),U={version:1,mainMachineId:null,main:null,subs:[]}}));async function we(){return Te(await Se())}function Te(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 Ee=e((()=>{Ce()}));function De(){try{let e=S(),t=C();return[`Remote Control: ${e?`self-hosted`:`official`}`,` base_url=${x()}`,` token=${t?`present`:`missing`}`,` entitlement=checked at remote-control startup`].join(`
3
+ `)}var B,V,H,U,ye=e((()=>{r(),a(),B=M(`.claude`,`workflow-runs`),V=200,H=[`running`,`completed`,`cancelled`],U=[`pending`,`running`,`completed`,`cancelled`]}));function be(){return M(A(),`registry.json`)}async function xe(){try{let e=await N(be(),`utf8`),t=JSON.parse(e);return t.version===1?t:{...W}}catch{return{...W}}}var W,Se=e((()=>{j(),W={version:1,mainMachineId:null,main:null,subs:[]}}));async function Ce(){return we(await xe())}function we(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 Te=e((()=>{Se()}));function Ee(){try{let e=S(),t=C();return[`Remote Control: ${e?`self-hosted`:`official`}`,` base_url=${x()}`,` token=${t?`present`:`missing`}`,` entitlement=checked at remote-control startup`].join(`
5
5
  `)}catch(e){return[`Remote Control: unknown`,` reason=${e instanceof Error?e.message:String(e)}`].join(`
6
- `)}}var Oe=e((()=>{b()}));async function ke(){try{return(await P(t(),{withFileTypes:!0})).filter(e=>e.isDirectory()).map(e=>e.name).sort()}catch{return[]}}async function Ae(){let e=await ke();if(e.length===0)return[`Teams: 0`,` none`].join(`
6
+ `)}}var De=e((()=>{b()}));async function Oe(){try{return(await P(t(),{withFileTypes:!0})).filter(e=>e.isDirectory()).map(e=>e.name).sort()}catch{return[]}}async function ke(){let e=await Oe();if(e.length===0)return[`Teams: 0`,` none`].join(`
7
7
  `);let t=[`Teams: ${e.length}`];for(let n of e){let e=k(n),r=(await v(n)).filter(e=>e.status!==`completed`),i=e.filter(e=>e.status===`running`).length,a=e.filter(e=>e.status===`idle`).length;t.push(` ${n}: teammates=${e.length} running=${i} idle=${a} open_tasks=${r.length}`);for(let n of e.slice(0,5)){let e=r.filter(e=>e.owner===n.name||e.owner===n.agentId);t.push(` @${n.name}: ${n.status} backend=${n.backendType??`unknown`} mode=${n.mode??`default`} tasks=${e.length}`)}e.length>5&&t.push(` ... ${e.length-5} more teammate(s)`)}return t.join(`
8
- `)}async function je(e){let t=await pe();if(t.length===0)return[`Cron jobs: 0`,` none`].join(`
8
+ `)}async function Ae(e){let t=await pe();if(t.length===0)return[`Cron jobs: 0`,` none`].join(`
9
9
  `);let n=[`Cron jobs: ${t.length}`];for(let r of t.slice(0,10)){let t=fe(r.cron,e);n.push(` ${r.id}: ${he(r.cron)} ${r.recurring?`recurring`:`one-shot`} ${r.durable===!1?`session-only`:`durable`} next=${t?new Date(t).toLocaleString():`none`}`)}return t.length>10&&n.push(` ... ${t.length-10} more job(s)`),n.join(`
10
- `)}async function Me(){let e=E(),t=await T(),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(`
11
- `)}function Ne(){let e=!1,t=null;try{e=ne(),t=ie()}catch(e){return[`Auto mode: unknown`,` reason=${e instanceof Error?e.message:String(e)}`].join(`
10
+ `)}async function je(){let e=E(),t=await T(),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(`
11
+ `)}function Me(){let e=!1,t=null;try{e=ne(),t=re()}catch(e){return[`Auto mode: unknown`,` reason=${e instanceof Error?e.message:String(e)}`].join(`
12
12
  `)}return[`Auto mode: ${e?`available`:`unavailable`}`,` reason=${t??`none`}`].join(`
13
- `)}async function W({runs:e,flows:t,nowMs:n=Date.now()}){return Promise.all([Promise.resolve({id:`auto-mode`,title:`Auto Mode`,content:Ne()}),Promise.resolve({id:`runs`,title:`Runs`,content:s(e)}),Promise.resolve({id:`flows`,title:`Flows`,content:f(t)}),je(n).then(e=>({id:`cron`,title:`Cron`,content:e})),ve().then(e=>({id:`workflow-runs`,title:`Workflow Runs`,content:ye(e)})),Ae().then(e=>({id:`teams`,title:`Teams`,content:e})),we().then(e=>({id:`pipes`,title:`Pipes`,content:e})),Me().then(e=>({id:`runtime`,title:`Runtime`,content:e})),Promise.resolve({id:`remote-control`,title:`Remote Control`,content:De()}),ce().then(e=>({id:`remote-trigger`,title:`RemoteTrigger`,content:le(e)}))])}async function Pe(e){return(await W(e)).map((e,t)=>[t===0?`# Autonomy Deep Status`:`## ${e.title}`,e.content].join(`
13
+ `)}async function G({runs:e,flows:t,nowMs:n=Date.now()}){return Promise.all([Promise.resolve({id:`auto-mode`,title:`Auto Mode`,content:Me()}),Promise.resolve({id:`runs`,title:`Runs`,content:o(e)}),Promise.resolve({id:`flows`,title:`Flows`,content:g(t)}),Ae(n).then(e=>({id:`cron`,title:`Cron`,content:e})),ve().then(e=>({id:`workflow-runs`,title:`Workflow Runs`,content:z(e)})),ke().then(e=>({id:`teams`,title:`Teams`,content:e})),Ce().then(e=>({id:`pipes`,title:`Pipes`,content:e})),je().then(e=>({id:`runtime`,title:`Runtime`,content:e})),Promise.resolve({id:`remote-control`,title:`Remote Control`,content:Ee()}),ae().then(e=>({id:`remote-trigger`,title:`RemoteTrigger`,content:le(e)}))])}async function Ne(e){return(await G(e)).map((e,t)=>[t===0?`# Autonomy Deep Status`:`## ${e.title}`,e.content].join(`
14
14
  `)).join(`
15
15
 
16
- `)}var Fe=e((()=>{D(),w(),m(),h(),n(),de(),_(),me(),O(),y(),d(),be(),Ee(),Oe()}));function Ie(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 G,Le=e((()=>{G=`Usage: /autonomy [status [--deep]|runs [limit]|flows [limit]|flow <id>|flow cancel <id>|flow resume <id>]`}));function K(e){let t=typeof e==`number`?e:Number.parseInt(e??``,10);return!Number.isFinite(t)||t<=0?10:Math.min(t,50)}async function q(e){let t=e?.rootDir,[n,r]=await Promise.all([o(t),g(t)]);return e?.deep?Pe({runs:n,flows:r}):[s(n),f(r)].join(`
17
- `)}async function Re(e,t){let[n,r]=await Promise.all([o(t?.rootDir),g(t?.rootDir)]),i=(await W({runs:n,flows:r})).find(t=>t.id===e);return i?[`# ${i.title}`,i.content].join(`
18
- `):`Autonomy deep status section not found: ${e}`}async function ze(e){process.stdout.write(`${await q(e)}\n`)}async function J(e,t){return re(await o(t?.rootDir),K(e))}async function Be(e){process.stdout.write(`${await J(e)}\n`)}async function Y(e,t){return te(await g(t?.rootDir),K(e))}async function X(e){process.stdout.write(`${await Y(e)}\n`)}async function Z(e,t){return c(await ue(e,t?.rootDir))}async function Ve(e){process.stdout.write(`${await Z(e)}\n`)}async function Q(e,t){let n=await oe({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=u(t=>t.autonomy?.flowId===e);r=n.length;for(let e of n)e.autonomy?.runId&&await l(e.autonomy.runId,t?.rootDir)}else{for(let e of n.queuedRunIds)await l(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 He(e){process.stdout.write(`${await Q(e)}\n`)}async function $(e,t){let n=await ae({flowId:e,rootDir:t?.rootDir,currentDir:t?.currentDir});if(!n)return`Autonomy flow is not waiting or was not found.`;if(t?.enqueueInMemory)return se(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(`
19
- `)}async function Ue(e){process.stdout.write(`${await $(e)}\n`)}async function We(e,t){let n=Ie(e);switch(n.type){case`status`:return q({deep:n.deep});case`runs`:return J(n.limit);case`flows`:return Y(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 G}}var Ge=e((()=>{m(),h(),Fe(),Le(),p()}));export{Be as a,We as c,Y as d,J as f,$ as g,K as h,X as i,Re as l,Ge as m,Ve as n,ze as o,q as p,Ue as r,Q as s,He as t,Z as u};
16
+ `)}var Pe=e((()=>{D(),w(),h(),l(),n(),de(),_(),me(),O(),y(),f(),ye(),Te(),De()}));function Fe(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,Ie=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([c(t),d(t)]);return e?.deep?Ne({runs:n,flows:r}):[o(n),g(r)].join(`
17
+ `)}async function Le(e,t){let[n,r]=await Promise.all([c(t?.rootDir),d(t?.rootDir)]),i=(await G({runs:n,flows:r})).find(t=>t.id===e);return i?[`# ${i.title}`,i.content].join(`
18
+ `):`Autonomy deep status section not found: ${e}`}async function Re(e){process.stdout.write(`${await J(e)}\n`)}async function Y(e,t){return se(await c(t?.rootDir),q(e))}async function ze(e){process.stdout.write(`${await Y(e)}\n`)}async function X(e,t){return ue(await d(t?.rootDir),q(e))}async function Be(e){process.stdout.write(`${await X(e)}\n`)}async function Z(e,t){return m(await ce(e,t?.rootDir))}async function Ve(e){process.stdout.write(`${await Z(e)}\n`)}async function Q(e,t){let n=await oe({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=s(t=>t.autonomy?.flowId===e);r=n.length;for(let e of n)e.autonomy?.runId&&await u(e.autonomy.runId,t?.rootDir)}else{for(let e of n.queuedRunIds)await u(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 He(e){process.stdout.write(`${await Q(e)}\n`)}async function $(e,t){let n=await te({flowId:e,rootDir:t?.rootDir,currentDir:t?.currentDir});if(!n)return`Autonomy flow is not waiting or was not found.`;if(t?.enqueueInMemory)return p(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(`
19
+ `)}async function Ue(e){process.stdout.write(`${await $(e)}\n`)}async function We(e,t){let n=Fe(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 Ge=e((()=>{h(),l(),Pe(),Ie(),ie()}));export{ze as a,We as c,X as d,Y as f,$ as g,q as h,Be as i,Le as l,Ge as m,Ve as n,Re as o,J as p,Ue as r,Q as s,He as t,Z as u};
@@ -1 +1 @@
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-BkVcSMCZ.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
+ 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-CaLvE5N6.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 +1 @@
1
- import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n,b as r,f as i,t as a,x as o,xt as s}from"./src-Di342QoJ.js";import{t as c}from"./jsx-runtime-D-D469L8.js";import{Mx as l,kx as u,nO as d,rO as f}from"./loadAgentsDir-DI1a76pd.js";import{c as p,l as m,m as h,p as g}from"./autonomy-BkVcSMCZ.js";function _(){return S}function v({onDone:e}){l(`autonomy-panel`);let[t,n]=(0,b.useState)(0),[a,c]=(0,b.useState)([]);(0,b.useEffect)(()=>{let e=!1;return f().then(t=>{e||c(t.slice(0,5))}),()=>{e=!0}},[]);let u=(0,b.useMemo)(()=>{let e=[{label:`Overview`,description:`Show run and flow counts plus the latest automatic activity`,run:()=>g()},{label:`Full deep status`,description:`Print every local autonomy surface in one diagnostic report`,run:()=>g({deep:!0})},{label:`Auto mode`,description:`Check whether auto permission mode is available and why`,run:()=>m(`auto-mode`)},{label:`Runs summary`,description:`Show queued/running/completed/failed run totals and latest run`,run:()=>m(`runs`)},{label:`Recent runs`,description:`List recent autonomy run IDs, triggers, statuses, and prompts`,run:()=>p(`runs 10`)},{label:`Flows summary`,description:`Show managed flow totals across queued/running/waiting states`,run:()=>m(`flows`)},{label:`Recent flows`,description:`List recent managed flow IDs, status, current step, and goal`,run:()=>p(`flows 10`)},{label:`Cron`,description:`Show scheduled autonomy jobs, durability, recurrence, and next run`,run:()=>m(`cron`)},{label:`Workflow runs`,description:`Show persisted WorkflowTool runs and their current workflow step`,run:()=>m(`workflow-runs`)},{label:`Teams`,description:`Show Agent Teams, teammate backends, activity, and open tasks`,run:()=>m(`teams`)},{label:`Pipes`,description:`Show UDS/named-pipe and LAN registry for terminal messaging`,run:()=>m(`pipes`)},{label:`Runtime`,description:`Show daemon state and live background or interactive sessions`,run:()=>m(`runtime`)},{label:`Remote Control`,description:`Show bridge mode, base URL, token presence, and entitlement note`,run:()=>m(`remote-control`)},{label:`RemoteTrigger`,description:`Show recent remote trigger audit records, failures, and latest call`,run:()=>m(`remote-trigger`)}],t=a.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?`Resume waiting step: ${e.currentStep}`:`Resume waiting 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:`Cancel ${e.status} flow`,run:()=>p(`flow cancel ${e.flowId}`,{removeQueuedInMemory:!0})}),n});return[...e,...t]},[a]),d=()=>{let n=u[t];n&&n.run().then(t=>{e(t,{display:`system`})})};return s((e,t)=>{if(t.upArrow){n(e=>Math.max(0,e-1));return}if(t.downArrow){n(e=>Math.min(u.length-1,e+1));return}t.return&&d()}),(0,x.jsx)(i,{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)(r,{children:`${n===t?`›`:` `} ${e.label}`.padEnd(C)}),(0,x.jsx)(r,{dimColor:!0,children:e.description})]},`${e.label}-${n}`)),(0,x.jsx)(o,{marginTop:1,children:(0,x.jsx)(r,{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(n(),1),a(),u(),h(),d(),x=c(),S=14,C=24}))();export{y as call,_ as getAutonomyPanelBaseActionCountForTests};
1
+ import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n,b as r,f as i,t as a,x as o,xt as s}from"./src-Di342QoJ.js";import{t as c}from"./jsx-runtime-D-D469L8.js";import{Px as l,aO as u,iO as d,jx as f}from"./loadAgentsDir-D7kapZB5.js";import{c as p,l as m,m as h,p as g}from"./autonomy-CaLvE5N6.js";function _(){return S}function v({onDone:e}){l(`autonomy-panel`);let[t,n]=(0,b.useState)(0),[a,c]=(0,b.useState)([]);(0,b.useEffect)(()=>{let e=!1;return u().then(t=>{e||c(t.slice(0,5))}),()=>{e=!0}},[]);let d=(0,b.useMemo)(()=>{let e=[{label:`Overview`,description:`Show run and flow counts plus the latest automatic activity`,run:()=>g()},{label:`Full deep status`,description:`Print every local autonomy surface in one diagnostic report`,run:()=>g({deep:!0})},{label:`Auto mode`,description:`Check whether auto permission mode is available and why`,run:()=>m(`auto-mode`)},{label:`Runs summary`,description:`Show queued/running/completed/failed run totals and latest run`,run:()=>m(`runs`)},{label:`Recent runs`,description:`List recent autonomy run IDs, triggers, statuses, and prompts`,run:()=>p(`runs 10`)},{label:`Flows summary`,description:`Show managed flow totals across queued/running/waiting states`,run:()=>m(`flows`)},{label:`Recent flows`,description:`List recent managed flow IDs, status, current step, and goal`,run:()=>p(`flows 10`)},{label:`Cron`,description:`Show scheduled autonomy jobs, durability, recurrence, and next run`,run:()=>m(`cron`)},{label:`Workflow runs`,description:`Show persisted WorkflowTool runs and their current workflow step`,run:()=>m(`workflow-runs`)},{label:`Teams`,description:`Show Agent Teams, teammate backends, activity, and open tasks`,run:()=>m(`teams`)},{label:`Pipes`,description:`Show UDS/named-pipe and LAN registry for terminal messaging`,run:()=>m(`pipes`)},{label:`Runtime`,description:`Show daemon state and live background or interactive sessions`,run:()=>m(`runtime`)},{label:`Remote Control`,description:`Show bridge mode, base URL, token presence, and entitlement note`,run:()=>m(`remote-control`)},{label:`RemoteTrigger`,description:`Show recent remote trigger audit records, failures, and latest call`,run:()=>m(`remote-trigger`)}],t=a.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?`Resume waiting step: ${e.currentStep}`:`Resume waiting 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:`Cancel ${e.status} flow`,run:()=>p(`flow cancel ${e.flowId}`,{removeQueuedInMemory:!0})}),n});return[...e,...t]},[a]),f=()=>{let n=d[t];n&&n.run().then(t=>{e(t,{display:`system`})})};return s((e,t)=>{if(t.upArrow){n(e=>Math.max(0,e-1));return}if(t.downArrow){n(e=>Math.min(d.length-1,e+1));return}t.return&&f()}),(0,x.jsx)(i,{title:`Autonomy`,subtitle:`${d.length} actions`,onCancel:()=>e(`Autonomy panel dismissed`,{display:`system`}),color:`background`,hideInputGuide:!0,children:(0,x.jsxs)(o,{flexDirection:`column`,children:[d.map((e,n)=>(0,x.jsxs)(o,{flexDirection:`row`,children:[(0,x.jsx)(r,{children:`${n===t?`›`:` `} ${e.label}`.padEnd(C)}),(0,x.jsx)(r,{dimColor:!0,children:e.description})]},`${e.label}-${n}`)),(0,x.jsx)(o,{marginTop:1,children:(0,x.jsx)(r,{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(n(),1),a(),f(),h(),d(),x=c(),S=14,C=24}))();export{y as call,_ as getAutonomyPanelBaseActionCountForTests};
@@ -0,0 +1 @@
1
+ import{t as e}from"./backgroundHousekeeping-D2_Uopt7.js";export{e as startBackgroundHousekeeping};
@@ -0,0 +1,17 @@
1
+ import{a as e,o as t}from"./chunk-DR8-3Aex.js";import{n,s as r}from"./envUtils-BWeoiL4Y.js";import{Ct as i,H as a,X as o,cn as s}from"./state-sIHsFpDu.js";import{Fa as c,Mr as l,Na as u,Pr as d,S as f,co as p,no as ee,oo as te}from"./paths-1ngPRtu3.js";import{K as ne,V as m,d as h,h as re,p as g,s as ie,w as ae}from"./debug-UI3T040K.js";import{n as oe,r as _}from"./analytics-DqMQntaB.js";import{n as v,t as y}from"./cwd--iizewsn.js";import{o as b,s as x,v as S,y as C}from"./log-CzsijfHZ.js";import{E as w,O as T,T as se}from"./teammate-DMYOtLTK.js";import{$S as ce,Ar as le,Co as ue,Gl as de,Lb as E,Lo as D,ME as O,Mb as k,NE as A,NO as j,Nb as M,PE as N,Pb as P,RE as F,So as I,TD as L,Wl as R,bS as z,bo as B,fC as V,kD as H,mC as fe,pt as pe,rt as me,tC as he,tt as U,wD as ge,wt as _e,xS as ve,xr as ye}from"./loadAgentsDir-D7kapZB5.js";import{Bn as be,Vn as xe}from"./prompt-BBg3jtfc.js";import{X as Se}from"./rcDebugLog-CPGWJbI4.js";import{n as Ce,r as we}from"./magicDocs-Dy72LHIj.js";import{n as Te,t as Ee}from"./pluginAutoupdate-CAa4KLro.js";import{n as De,r as Oe}from"./registerProtocol-DLuRm0mf.js";import{homedir as ke}from"os";import{join as W}from"path";import"crypto";import*as G from"fs/promises";r(),s(),v(),ae(),re(),ie(),C(),te(),c(),d(),f(),xe(),H(),O(),de(),le(),we(),U(),b(),m(),D(),j(),U(),L(),m(),b(),D(),j();async function Ae(e,t){if(!e)return;let{join:n}=await import(`path`),r=await import(`fs/promises`),a=n(y(),`.claude`,`skills`,e,`SKILL.md`),o;try{o=await r.readFile(a,`utf-8`)}catch{x(Error(`Failed to read skill file for improvement: ${a}`));return}let s=t.map(e=>`- ${e.section}: ${e.change}`).join(`
2
+ `),c=l(),d=F()?A({sessionId:i(),model:c,provider:u(),name:`skill-improvement-apply`}):null,f=await me({messages:[B({content:`You are editing a skill definition file. Apply the following improvements to the skill.
3
+
4
+ <current_skill_file>
5
+ ${o}
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:Se([`You edit skill definition files to incorporate user preferences. Output only the updated file content.`]),thinkingConfig:{type:`disabled`},tools:[],signal:ge().signal,options:{getToolPermissionContext:async()=>be(),model:c,toolChoice:void 0,isNonInteractiveSession:!1,hasAppendSystemPrompt:!1,temperatureOverride:0,agents:[],querySource:`skill_improvement_apply`,mcpTools:[],langfuseTrace:d}});N(d);let p=I(ue(Array.isArray(f.message.content)?f.message.content:[]).trim(),`updated_file`);if(!p){x(Error(`Skill improvement apply: no updated_file tag in response`));return}try{await r.writeFile(a,p,`utf-8`)}catch(e){x(ne(e))}}oe(),he(),se(),b(),P(),ve(),M(),fe(),_e();var je=30;function K(){let e=((ee()||{}).cleanupPeriodDays??je)*24*60*60*1e3;return new Date(Date.now()-e)}function Me(e,t){return{messages:e.messages+t.messages,errors:e.errors+t.errors}}function Ne(e){let t=e.split(`.`)[0].replace(/T(\d{2})-(\d{2})-(\d{2})-(\d{3})Z/,`T$1:$2:$3.$4Z`);return new Date(t)}async function q(e,t,n){let r={messages:0,errors:0};try{let i=await g().readdir(e);for(let a of i)try{Ne(a.name)<t&&(await g().unlink(W(e,a.name)),n?r.messages++:r.errors++)}catch(e){x(e)}}catch(e){e instanceof Error&&`code`in e&&e.code!==`ENOENT`&&x(e)}return r}async function Pe(){let e=g(),t=K(),n=S.errors(),r=S.baseLogs(),i=await q(n,t,!1);try{let n;try{n=await e.readdir(r)}catch{return i}let a=n.filter(e=>e.isDirectory()&&e.name.startsWith(`mcp-logs-`)).map(e=>W(r,e.name));for(let n of a)i=Me(i,await q(n,t,!0)),await Y(n,e)}catch(e){e instanceof Error&&`code`in e&&e.code!==`ENOENT`&&x(e)}return i}async function J(e,t,n){return(await n.stat(e)).mtime<t?(await n.unlink(e),!0):!1}async function Y(e,t){try{await t.rmdir(e)}catch{}}async function Fe(){let e=K(),t={messages:0,errors:0},n=ye(),r=g(),i;try{i=await r.readdir(n)}catch{return t}for(let a of i){if(!a.isDirectory())continue;let i=W(n,a.name),o;try{o=await r.readdir(i)}catch{t.errors++;continue}for(let n of o)if(n.isFile()){if(!n.name.endsWith(`.jsonl`)&&!n.name.endsWith(`.cast`))continue;try{await J(W(i,n.name),e,r)&&t.messages++}catch{t.errors++}}else if(n.isDirectory()){let a=W(i,n.name),o=W(a,V),s;try{s=await r.readdir(o)}catch{await Y(a,r);continue}for(let n of s)if(n.isFile())try{await J(W(o,n.name),e,r)&&t.messages++}catch{t.errors++}else if(n.isDirectory()){let i=W(o,n.name),a;try{a=await r.readdir(i)}catch{continue}for(let n of a)if(n.isFile())try{await J(W(i,n.name),e,r)&&t.messages++}catch{t.errors++}await Y(i,r)}await Y(o,r),await Y(a,r)}await Y(i,r)}return t}async function Ie(e,t,n=!0){let r=K(),i={messages:0,errors:0},a=g(),o;try{o=await a.readdir(e)}catch{return i}for(let n of o)if(!(!n.isFile()||!n.name.endsWith(t)))try{await J(W(e,n.name),r,a)&&i.messages++}catch{i.errors++}return n&&await Y(e,a),i}function Le(){return Ie(W(n(),`plans`),`.md`)}async function Re(){let e=K(),t={messages:0,errors:0},r=g();try{let i=W(n(),`file-history`),a;try{a=await r.readdir(i)}catch{return t}let o=a.filter(e=>e.isDirectory()).map(e=>W(i,e.name));await Promise.all(o.map(async n=>{try{(await r.stat(n)).mtime<e&&(await r.rm(n,{recursive:!0,force:!0}),t.messages++)}catch{t.errors++}})),await Y(i,r)}catch(e){x(e)}return t}async function ze(){let e=K(),t={messages:0,errors:0},r=g();try{let i=W(n(),`session-env`),a;try{a=await r.readdir(i)}catch{return t}let o=a.filter(e=>e.isDirectory()).map(e=>W(i,e.name));for(let n of o)try{(await r.stat(n)).mtime<e&&(await r.rm(n,{recursive:!0,force:!0}),t.messages++)}catch{t.errors++}await Y(i,r)}catch(e){x(e)}return t}async function X(){let e=K(),t={messages:0,errors:0},r=g(),i=W(n(),`debug`),a;try{a=await r.readdir(i)}catch{return t}for(let n of a)if(!(!n.isFile()||!n.name.endsWith(`.txt`)||n.name===`latest`))try{await J(W(i,n.name),e,r)&&t.messages++}catch{t.errors++}return t}var Z=1440*60*1e3;async function Q(){let e=W(n(),`.npm-cache-cleanup`);try{let t=await G.stat(e);if(Date.now()-t.mtimeMs<Z){h(`npm cache cleanup: skipping, ran recently`);return}}catch{}try{await w(e,{retries:0,realpath:!1})}catch{h(`npm cache cleanup: skipping, lock held`);return}h(`npm cache cleanup: starting`);let r=W(ke(),`.npm`,`_cacache`),i=Date.now();try{let n=await import(`./lib-inCisXen.js`).then(e=>t(e.default,1)),a=i-Z,o=n.ls.stream(r),s=[];for await(let e of o)e.key.includes(`@anthropic-ai/claude-`)&&s.push({key:e.key,time:e.time});let c=new Map;for(let e of s){let t=e.key.lastIndexOf(`@`),n=t>0?e.key.slice(0,t):e.key,r=c.get(n)??[];r.push(e),c.set(n,r)}let l=[];for(let[,e]of c){e.sort((e,t)=>t.time-e.time);for(let t=0;t<e.length;t++){let n=e[t];(n.time<a||t>=5)&&l.push(n.key)}}await Promise.all(l.map(e=>n.rm.entry(r,e))),await G.writeFile(e,new Date().toISOString());let u=Date.now()-i;l.length>0?h(`npm cache cleanup: Removed ${l.length} old @anthropic-ai entries in ${u}ms`):h(`npm cache cleanup: completed in ${u}ms`),_(`tengu_npm_cache_cleanup`,{success:!0,durationMs:u,entriesRemoved:l.length})}catch(e){x(e),_(`tengu_npm_cache_cleanup`,{success:!1,durationMs:Date.now()-i})}finally{await T(e,{realpath:!1}).catch(()=>{})}}async function Be(){let e=W(n(),`.version-cleanup`);try{let t=await G.stat(e);if(Date.now()-t.mtimeMs<Z){h(`version cleanup: skipping, ran recently`);return}}catch{}try{await w(e,{retries:0,realpath:!1})}catch{h(`version cleanup: skipping, lock held`);return}h(`version cleanup: starting (throttled)`);try{await E(),await G.writeFile(e,new Date().toISOString())}catch(e){x(e)}finally{await T(e,{realpath:!1}).catch(()=>{})}}async function Ve(){let{errors:e}=k();if(e.length>0&&p(`cleanupPeriodDays`)){h(`Skipping cleanup: settings have validation errors but cleanupPeriodDays was explicitly set. Fix settings errors to enable cleanup.`);return}await Pe(),await Fe(),await Le(),await Re(),await ze(),await X(),await ce(),await z(K());let t=await pe(K());t>0&&_(`tengu_worktree_cleanup`,{removed:t}),process.env.USER_TYPE===`ant`&&await Q()}s(),P(),Te();var He=(De(),e(Oe)),Ue=1440*60*1e3,$=600*1e3;function We(){Ce(),import(`./extractMemories-C3SU-Osb.js`).then(({initExtractMemories:e})=>{e()}).catch(()=>{}),R(),Ee(),a()&&He.ensureDeepLinkProtocolRegistered();let e=!0;async function t(){if(a()&&o()>Date.now()-1e3*60){setTimeout(t,$).unref();return}if(e&&(e=!1,await Ve()),a()&&o()>Date.now()-1e3*60){setTimeout(t,$).unref();return}await E()}setTimeout(t,$).unref(),process.env.USER_TYPE===`ant`&&setInterval(()=>{Q(),Be()},Ue).unref()}export{Ae as n,We as t};
@@ -1,3 +1,3 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{Ct as t,cn as n,ot as r}from"./state-sIHsFpDu.js";import{jo as i,ko as a}from"./paths-BBvuDQl9.js";import{E as o,w as s}from"./debug-UI3T040K.js";import{n as c,r as l}from"./analytics-DqMQntaB.js";import{c as u,s as d}from"./types-Csi32ZXh.js";import{Ar as f,Er as p,Ir as m,Si as h,Tr as g,_i as _,br as v}from"./loadAgentsDir-DI1a76pd.js";import{randomUUID as y}from"crypto";import{mkdir as b,readFile as x,writeFile as S}from"fs/promises";function C(e){let t=e?.message?.content;if(!t)return`Branched conversation`;let n=typeof t==`string`?t:t.find(e=>e.type===`text`)?.text;return n&&n.replace(/\s+/g,` `).trim().slice(0,100)||`Branched conversation`}async function w(e){let n=y(),i=t(),a=v(r()),s=p(n),c=g();await b(a,{recursive:!0,mode:448});let l;try{l=await x(c)}catch{throw Error(`No conversation to branch`)}if(l.length===0)throw Error(`No conversation to branch`);let d=u(l),f=d.filter(e=>m(e)&&!e.isSidechain),h=d.filter(e=>e.type===`content-replacement`&&e.sessionId===i).flatMap(e=>e.replacements);if(f.length===0)throw Error(`No messages to branch`);let _=null,C=[],w=[];for(let e of f){let t={...e,sessionId:n,parentUuid:_,isSidechain:!1,forkedFrom:{sessionId:i,messageUuid:e.uuid}},r={...e,sessionId:n};w.push(r),C.push(o(t)),e.type!==`progress`&&(_=e.uuid)}if(h.length>0){let e={type:`content-replacement`,sessionId:n,replacements:h};C.push(o(e))}return await S(s,C.join(`
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{Ct as t,cn as n,ot as r}from"./state-sIHsFpDu.js";import{jo as i,ko as a}from"./paths-1ngPRtu3.js";import{E as o,w as s}from"./debug-UI3T040K.js";import{n as c,r as l}from"./analytics-DqMQntaB.js";import{c as u,s as d}from"./types-Csi32ZXh.js";import{Ar as f,Er as p,Ir as m,Si as h,Tr as g,_i as _,br as v}from"./loadAgentsDir-D7kapZB5.js";import{randomUUID as y}from"crypto";import{mkdir as b,readFile as x,writeFile as S}from"fs/promises";function C(e){let t=e?.message?.content;if(!t)return`Branched conversation`;let n=typeof t==`string`?t:t.find(e=>e.type===`text`)?.text;return n&&n.replace(/\s+/g,` `).trim().slice(0,100)||`Branched conversation`}async function w(e){let n=y(),i=t(),a=v(r()),s=p(n),c=g();await b(a,{recursive:!0,mode:448});let l;try{l=await x(c)}catch{throw Error(`No conversation to branch`)}if(l.length===0)throw Error(`No conversation to branch`);let d=u(l),f=d.filter(e=>m(e)&&!e.isSidechain),h=d.filter(e=>e.type===`content-replacement`&&e.sessionId===i).flatMap(e=>e.replacements);if(f.length===0)throw Error(`No messages to branch`);let _=null,C=[],w=[];for(let e of f){let t={...e,sessionId:n,parentUuid:_,isSidechain:!1,forkedFrom:{sessionId:i,messageUuid:e.uuid}},r={...e,sessionId:n};w.push(r),C.push(o(t)),e.type!==`progress`&&(_=e.uuid)}if(h.length>0){let e={type:`content-replacement`,sessionId:n,replacements:h};C.push(o(e))}return await S(s,C.join(`
2
2
  `)+`
3
3
  `,{encoding:`utf8`,mode:384}),{sessionId:n,title:e,forkPath:s,serializedMessages:w,contentReplacementRecords:h}}async function T(e){let t=`${e} (Branch)`;if((await h(t,{exact:!0})).length===0)return t;let n=await h(`${e} (Branch`),r=new Set([1]),i=RegExp(`^${a(e)} \\(Branch(?: (\\d+))?\\)$`);for(let e of n){let t=e.customTitle?.match(i);t&&(t[1]?r.add(parseInt(t[1],10)):r.add(1))}let o=2;for(;r.has(o);)o++;return`${e} (Branch ${o})`}async function E(e,n,r){let i=r?.trim()||void 0,a=t();try{let{sessionId:t,title:r,forkPath:o,serializedMessages:s,contentReplacementRecords:c}=await w(i),u=new Date,d=C(s.find(e=>e.type===`user`)),f=await T(r??d);await _(t,f,o),l(`tengu_conversation_forked`,{message_count:s.length,has_custom_title:!!r});let p={date:u.toISOString().split(`T`)[0],messages:s,fullPath:o,value:u.getTime(),created:u,modified:u,firstPrompt:d,messageCount:s.length,isSidechain:!1,sessionId:t,customTitle:f,contentReplacements:c},m=r?` "${r}"`:``,h=`Branched conversation${m}. You are now in the branch.${`\nTo resume the original: claude -r ${a}`}`;return n.resume?(await n.resume(t,p,`fork`),e(h,{display:`system`})):e(`Branched conversation${m}. Resume with: /resume ${t}`),null}catch(t){return e(`Failed to branch conversation: ${t instanceof Error?t.message:`Unknown error occurred`}`),null}}e((()=>{n(),c(),d(),f(),s(),i()}))();export{E as call,C as deriveFirstPrompt};
@@ -1,2 +1,2 @@
1
- import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n,b as r,d as i,f as a,nt as o,t as s,x as c}from"./src-Di342QoJ.js";import{t as l}from"./jsx-runtime-D-D469L8.js";import{d as u,s as d}from"./debug-UI3T040K.js";import{n as f,r as p}from"./analytics-DqMQntaB.js";import{MS as m,Mx as h,PS as g,jS as _,kx as v}from"./loadAgentsDir-DI1a76pd.js";import{t as y}from"./useKeybinding-FsOnjW6T.js";import{a as b,t as x}from"./bridgeConfig-lRZfQqmA.js";import{n as S,r as C,s as w,t as T}from"./bridgeEnabled-D2IykaHE.js";import{a as E,i as D,n as O}from"./types-RJTEOuIt.js";import{t as k}from"./lib-B4Q0Nrpb.js";import{i as A,n as j}from"./envLessBridgeConfig-SPEr9oqO.js";import{n as M,r as N}from"./RemoteCallout-CnpCWRPk.js";function P({onDone:e,name:t}){let n=g(),r=m(e=>e.replBridgeConnected),i=m(e=>e.replBridgeEnabled),a=m(e=>e.replBridgeOutboundOnly),[o,s]=(0,z.useState)(!1);return(0,z.useEffect)(()=>{if((r||i)&&!a){s(!0);return}let o=!1;return(async()=>{let r=await I();if(!o){if(r){p(`tengu_bridge_command`,{action:`preflight_failed`}),e(r,{display:`system`});return}if(N()){n(e=>e.showRemoteCallout?e:{...e,showRemoteCallout:!0,replBridgeInitialName:t}),e(``,{display:`system`});return}p(`tengu_bridge_command`,{action:`connect`}),n(e=>e.replBridgeEnabled&&!e.replBridgeOutboundOnly?e:{...e,replBridgeEnabled:!0,replBridgeExplicit:!0,replBridgeOutboundOnly:!1,replBridgeInitialName:t}),e(`Remote Control connecting…`,{display:`system`})}})(),()=>{o=!0}},[]),o?(0,B.jsx)(F,{onDone:e}):null}function F({onDone:e}){h(`bridge-disconnect-dialog`);let t=g(),n=m(e=>e.replBridgeSessionUrl),s=m(e=>e.replBridgeConnectUrl),l=m(e=>e.replBridgeSessionActive),[u,d]=(0,z.useState)(2),[f,_]=(0,z.useState)(!1),[v,y]=(0,z.useState)(``),b=l?n:s;(0,z.useEffect)(()=>{if(!f||!b){y(``);return}(0,R.toString)(b,{type:`utf8`,errorCorrectionLevel:`L`,small:!0}).then(y).catch(()=>y(``))},[f,b]);function x(){t(e=>e.replBridgeEnabled?{...e,replBridgeEnabled:!1,replBridgeExplicit:!1,replBridgeOutboundOnly:!1}:e),p(`tengu_bridge_command`,{action:`disconnect`}),e(D,{display:`system`})}function S(){_(e=>!e)}function C(){e(void 0,{display:`skip`})}o({"select:next":()=>d(e=>(e+1)%3),"select:previous":()=>d(e=>(e-1+3)%3),"select:accept":()=>{u===0?x():u===1?S():C()}},{context:`Select`});let w=v?v.split(`
2
- `).filter(e=>e.length>0):[];return(0,B.jsx)(a,{title:`Remote Control`,onCancel:C,hideInputGuide:!0,children:(0,B.jsxs)(c,{flexDirection:`column`,gap:1,children:[(0,B.jsxs)(r,{children:[`This session is available via Remote Control`,b?` at ${b}`:``,`.`]}),f&&w.length>0&&(0,B.jsx)(c,{flexDirection:`column`,children:w.map((e,t)=>(0,B.jsx)(r,{children:e},t))}),(0,B.jsxs)(c,{flexDirection:`column`,children:[(0,B.jsx)(i,{isFocused:u===0,children:(0,B.jsx)(r,{children:`Disconnect this session`})}),(0,B.jsx)(i,{isFocused:u===1,children:(0,B.jsx)(r,{children:f?`Hide QR code`:`Show QR code`})}),(0,B.jsx)(i,{isFocused:u===2,children:(0,B.jsx)(r,{children:`Continue`})})]}),(0,B.jsx)(r,{dimColor:!0,children:`Enter to select · Esc to continue`})]})})}async function I(){let{waitForPolicyLimitsToLoad:e,isPolicyAllowed:t}=await import(`./policyLimits-BotYrS-v.js`);if(await e(),!t(`allow_remote_control`))return`Remote Control is disabled by your organization's policy.`;let n=await S();if(n)return n;let r=w();if(r){let{isAssistantMode:e}=await import(`./assistant-CwbhlCM-.js`);e()&&(r=!1)}return(r?await j():T())||(x()?(u(`[bridge] Prerequisites passed, enabling bridge`),null):O)}async function L(e,t,n){return(0,B.jsx)(P,{onDone:e,name:n.trim()||void 0})}var R,z,B;e((()=>{R=k(),n(),z=t(n(),1),b(),C(),A(),E(),s(),M(),v(),y(),f(),_(),d(),B=l()}))();export{L as call};
1
+ import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n,b as r,d as i,f as a,nt as o,t as s,x as c}from"./src-Di342QoJ.js";import{t as l}from"./jsx-runtime-D-D469L8.js";import{d as u,s as d}from"./debug-UI3T040K.js";import{n as f,r as p}from"./analytics-DqMQntaB.js";import{IS as m,NS as h,PS as g,Px as _,jx as v}from"./loadAgentsDir-D7kapZB5.js";import{t as y}from"./useKeybinding-FsOnjW6T.js";import{a as b,t as x}from"./bridgeConfig-Df6uyp3q.js";import{n as S,r as C,s as w,t as T}from"./bridgeEnabled-A-_xJ94c.js";import{a as E,i as D,n as O}from"./types-RJTEOuIt.js";import{t as k}from"./lib-B4Q0Nrpb.js";import{i as A,n as j}from"./envLessBridgeConfig-BAFYaZ0E.js";import{n as M,r as N}from"./RemoteCallout-Cy6lH-CZ.js";function P({onDone:e,name:t}){let n=m(),r=g(e=>e.replBridgeConnected),i=g(e=>e.replBridgeEnabled),a=g(e=>e.replBridgeOutboundOnly),[o,s]=(0,z.useState)(!1);return(0,z.useEffect)(()=>{if((r||i)&&!a){s(!0);return}let o=!1;return(async()=>{let r=await I();if(!o){if(r){p(`tengu_bridge_command`,{action:`preflight_failed`}),e(r,{display:`system`});return}if(N()){n(e=>e.showRemoteCallout?e:{...e,showRemoteCallout:!0,replBridgeInitialName:t}),e(``,{display:`system`});return}p(`tengu_bridge_command`,{action:`connect`}),n(e=>e.replBridgeEnabled&&!e.replBridgeOutboundOnly?e:{...e,replBridgeEnabled:!0,replBridgeExplicit:!0,replBridgeOutboundOnly:!1,replBridgeInitialName:t}),e(`Remote Control connecting…`,{display:`system`})}})(),()=>{o=!0}},[]),o?(0,B.jsx)(F,{onDone:e}):null}function F({onDone:e}){_(`bridge-disconnect-dialog`);let t=m(),n=g(e=>e.replBridgeSessionUrl),s=g(e=>e.replBridgeConnectUrl),l=g(e=>e.replBridgeSessionActive),[u,d]=(0,z.useState)(2),[f,h]=(0,z.useState)(!1),[v,y]=(0,z.useState)(``),b=l?n:s;(0,z.useEffect)(()=>{if(!f||!b){y(``);return}(0,R.toString)(b,{type:`utf8`,errorCorrectionLevel:`L`,small:!0}).then(y).catch(()=>y(``))},[f,b]);function x(){t(e=>e.replBridgeEnabled?{...e,replBridgeEnabled:!1,replBridgeExplicit:!1,replBridgeOutboundOnly:!1}:e),p(`tengu_bridge_command`,{action:`disconnect`}),e(D,{display:`system`})}function S(){h(e=>!e)}function C(){e(void 0,{display:`skip`})}o({"select:next":()=>d(e=>(e+1)%3),"select:previous":()=>d(e=>(e-1+3)%3),"select:accept":()=>{u===0?x():u===1?S():C()}},{context:`Select`});let w=v?v.split(`
2
+ `).filter(e=>e.length>0):[];return(0,B.jsx)(a,{title:`Remote Control`,onCancel:C,hideInputGuide:!0,children:(0,B.jsxs)(c,{flexDirection:`column`,gap:1,children:[(0,B.jsxs)(r,{children:[`This session is available via Remote Control`,b?` at ${b}`:``,`.`]}),f&&w.length>0&&(0,B.jsx)(c,{flexDirection:`column`,children:w.map((e,t)=>(0,B.jsx)(r,{children:e},t))}),(0,B.jsxs)(c,{flexDirection:`column`,children:[(0,B.jsx)(i,{isFocused:u===0,children:(0,B.jsx)(r,{children:`Disconnect this session`})}),(0,B.jsx)(i,{isFocused:u===1,children:(0,B.jsx)(r,{children:f?`Hide QR code`:`Show QR code`})}),(0,B.jsx)(i,{isFocused:u===2,children:(0,B.jsx)(r,{children:`Continue`})})]}),(0,B.jsx)(r,{dimColor:!0,children:`Enter to select · Esc to continue`})]})})}async function I(){let{waitForPolicyLimitsToLoad:e,isPolicyAllowed:t}=await import(`./policyLimits-Cmmzuv-E.js`);if(await e(),!t(`allow_remote_control`))return`Remote Control is disabled by your organization's policy.`;let n=await S();if(n)return n;let r=w();if(r){let{isAssistantMode:e}=await import(`./assistant-BLd4y2FJ.js`);e()&&(r=!1)}return(r?await j():T())||(x()?(u(`[bridge] Prerequisites passed, enabling bridge`),null):O)}async function L(e,t,n){return(0,B.jsx)(P,{onDone:e,name:n.trim()||void 0})}var R,z,B;e((()=>{R=k(),n(),z=t(n(),1),b(),C(),A(),E(),s(),M(),v(),y(),f(),h(),d(),B=l()}))();export{L as call};
@@ -0,0 +1 @@
1
+ import{a as e,n as t,o as n,t as r}from"./bridgeConfig-Df6uyp3q.js";e();export{r as getBridgeAccessToken,t as getBridgeBaseUrl,n as isSelfHostedBridge};
@@ -1 +1 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{Jt as t,on as n}from"./paths-BBvuDQl9.js";import{l as r,u as i}from"./oauth-CdZEzMww.js";function a(){return process.env.CLAUDE_BRIDGE_OAUTH_TOKEN||void 0}function o(){return process.env.CLAUDE_BRIDGE_BASE_URL||void 0}function s(){return a()??t()?.accessToken}function c(){return o()??r().BASE_API_URL}function l(){return!!o()}var u=e((()=>{i(),n()}));export{u as a,a as i,c as n,l as o,o as r,s as t};
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{Jt as t,on as n}from"./paths-1ngPRtu3.js";import{l as r,u as i}from"./oauth-CdZEzMww.js";function a(){return process.env.CLAUDE_BRIDGE_OAUTH_TOKEN||void 0}function o(){return process.env.CLAUDE_BRIDGE_BASE_URL||void 0}function s(){return a()??t()?.accessToken}function c(){return o()??r().BASE_API_URL}function l(){return!!o()}var u=e((()=>{i(),n()}));export{u as a,a as i,c as n,l as o,o as r,s as t};
@@ -1 +1 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{s as t}from"./envUtils-BWeoiL4Y.js";import{S as n,Zt as r,_ as i,an as a,dn as o,g as s,l as c,on as l}from"./paths-BBvuDQl9.js";import{i as u,r as d}from"./semver-Tw0AFar5.js";import{a as f,o as p}from"./bridgeConfig-lRZfQqmA.js";function m(){return p()?!0:_()&&i(`tengu_ccr_bridge`,!1)}async function h(){return p()?!0:_()&&await c(`tengu_ccr_bridge`)}async function g(){return p()?null:_()?v()?y()?.organizationUuid?await c(`tengu_ccr_bridge`)?null:`Remote Control is not yet enabled for your account.`:"Unable to determine your organization for Remote Control eligibility. Run `claude auth login` to refresh your account information.":"Remote Control requires a full-scope login token. Long-lived tokens (from `claude setup-token` or CLAUDE_CODE_OAUTH_TOKEN) are limited to inference-only for security reasons. Run `claude auth login` to use Remote Control.":"Remote Control requires a claude.ai subscription. Run `claude auth login` to sign in with your claude.ai account."}function _(){try{return o()}catch{return!1}}function v(){try{return a()}catch{return!1}}function y(){try{return r()}catch{return}}function b(){return i(`tengu_bridge_repl_v2`,!1)}function x(){return i(`tengu_bridge_repl_v2_cse_shim_enabled`,!0)}function S(){{let e=s(`tengu_bridge_min_version`,{minVersion:`0.0.0`});if(e.minVersion&&u(`2.6.5`,e.minVersion))return`Your version of Claude Code (2.6.5) is too old for Remote Control.\nVersion ${e.minVersion} or higher is required. Run \`claude update\` to update.`}return null}var C=e((()=>{n(),f(),l(),t(),d()}));export{h as a,m as i,g as n,x as o,C as r,b as s,S as t};
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{s as t}from"./envUtils-BWeoiL4Y.js";import{S as n,Zt as r,_ as i,an as a,dn as o,g as s,l as c,on as l}from"./paths-1ngPRtu3.js";import{i as u,r as d}from"./semver-Tw0AFar5.js";import{a as f,o as p}from"./bridgeConfig-Df6uyp3q.js";function m(){return p()?!0:_()&&i(`tengu_ccr_bridge`,!1)}async function h(){return p()?!0:_()&&await c(`tengu_ccr_bridge`)}async function g(){return p()?null:_()?v()?y()?.organizationUuid?await c(`tengu_ccr_bridge`)?null:`Remote Control is not yet enabled for your account.`:"Unable to determine your organization for Remote Control eligibility. Run `claude auth login` to refresh your account information.":"Remote Control requires a full-scope login token. Long-lived tokens (from `claude setup-token` or CLAUDE_CODE_OAUTH_TOKEN) are limited to inference-only for security reasons. Run `claude auth login` to use Remote Control.":"Remote Control requires a claude.ai subscription. Run `claude auth login` to sign in with your claude.ai account."}function _(){try{return o()}catch{return!1}}function v(){try{return a()}catch{return!1}}function y(){try{return r()}catch{return}}function b(){return i(`tengu_bridge_repl_v2`,!1)}function x(){return i(`tengu_bridge_repl_v2_cse_shim_enabled`,!0)}function S(){{let e=s(`tengu_bridge_min_version`,{minVersion:`0.0.0`});if(e.minVersion&&u(`2.6.6`,e.minVersion))return`Your version of Claude Code (2.6.6) is too old for Remote Control.\nVersion ${e.minVersion} or higher is required. Run \`claude update\` to update.`}return null}var C=e((()=>{n(),f(),l(),t(),d()}));export{h as a,m as i,g as n,x as o,C as r,b as s,S as t};