@readmagic/workmate 0.0.5 → 0.0.7

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 (415) hide show
  1. package/dist/chunks/{AddWorkspaceDirectory-DJRkEz7o.js → AddWorkspaceDirectory-CFrrXnt9.js} +1 -1
  2. package/dist/chunks/{App-iJu5qyiF.js → App-Buad9Llp.js} +1 -1
  3. package/dist/chunks/{ApproveApiKey-CRejTHUw.js → ApproveApiKey-B2HJUD7h.js} +1 -1
  4. package/dist/chunks/ApproveApiKey-BQbHdvc3.js +1 -0
  5. package/dist/chunks/{AssistantSessionChooser-CBLQ1v-J.js → AssistantSessionChooser-4lm4eXQ8.js} +1 -1
  6. package/dist/chunks/BackgroundTasksDialog-D4qA0M5O.js +2 -0
  7. package/dist/chunks/{BypassPermissionsModeDialog-D1FCKVOi.js → BypassPermissionsModeDialog-DllL8dxU.js} +1 -1
  8. package/dist/chunks/ClaudeMdExternalIncludesDialog--ywODh81.js +1 -0
  9. package/dist/chunks/{ClaudeMdExternalIncludesDialog-CI0yF6sZ.js → ClaudeMdExternalIncludesDialog-BZSyRqeq.js} +1 -1
  10. package/dist/chunks/ConsoleOAuthFlow-Wkfw7Ts-.js +1 -0
  11. package/dist/chunks/{DesktopHandoff-D1rrMxeP.js → DesktopHandoff-DaP4Riar.js} +1 -1
  12. package/dist/chunks/{DiffDialog-BKcfKx7O.js → DiffDialog-B7hx8i_Y.js} +2 -2
  13. package/dist/chunks/Doctor-89OgoAUA.js +1 -0
  14. package/dist/chunks/Doctor-CuKJ-nGt.js +3 -0
  15. package/dist/chunks/ExitFlow-DnPydE17.js +2 -0
  16. package/dist/chunks/{Feedback-bEUtrHia.js → Feedback-SmGiR3mf.js} +2 -2
  17. package/dist/chunks/Grove-CjN9DO47.js +11 -0
  18. package/dist/chunks/Grove-Cq88VBmM.js +1 -0
  19. package/dist/chunks/{HybridTransport-9fTBC2Pv.js → HybridTransport-rK83Qijz.js} +1 -1
  20. package/dist/chunks/{InvalidConfigDialog-9M-1nfZ6.js → InvalidConfigDialog-DdO0AxyF.js} +1 -1
  21. package/dist/chunks/{InvalidSettingsDialog-B2F6pryH.js → InvalidSettingsDialog-s1G0DwXF.js} +1 -1
  22. package/dist/chunks/MCPConnectionManager-NRfIjdlj.js +1 -0
  23. package/dist/chunks/{McpParsingWarnings-BPBb7Npe.js → McpParsingWarnings-Du5IxZos.js} +1 -1
  24. package/dist/chunks/MessageSelector-iIroHvXo.js +3 -0
  25. package/dist/chunks/Messages-D4Hm4gaY.js +11 -0
  26. package/dist/chunks/{Onboarding-cHcnsBGp.js → Onboarding-BiZByBK-.js} +1 -1
  27. package/dist/chunks/{OverageCreditUpsell-CWCD_RpM.js → OverageCreditUpsell-BM7szLgm.js} +1 -1
  28. package/dist/chunks/PluginSettings-uY5KTCtK.js +17 -0
  29. package/dist/chunks/{PromptInputFooterSuggestions-D5sAO6y-.js → PromptInputFooterSuggestions-BmsFdOu9.js} +1 -1
  30. package/dist/chunks/{PromptInputHelpMenu-n6hAdsto.js → PromptInputHelpMenu-DX-0wEDo.js} +1 -1
  31. package/dist/chunks/QueryEngine-CGYaShXD.js +1 -0
  32. package/dist/chunks/REPL-CRJB2t2z.js +142 -0
  33. package/dist/chunks/REPL-u4Yq29Du.js +1 -0
  34. package/dist/chunks/{RemoteCallout-CiA4rCEs.js → RemoteCallout-B-tyvQOe.js} +1 -1
  35. package/dist/chunks/{RemoteSessionManager-zdHfmvfj.js → RemoteSessionManager-DCd0O5_l.js} +2 -2
  36. package/dist/chunks/ResumeConversation-DAAXlOCd.js +1 -0
  37. package/dist/chunks/{SSETransport-BPbhCa2f.js → SSETransport-5VK5okFv.js} +1 -1
  38. package/dist/chunks/SearchExtraToolsTool-B-7Bworf.js +1 -0
  39. package/dist/chunks/Settings-CUjWlncb.js +2 -0
  40. package/dist/chunks/{TeleportProgress-DrulEQ7z.js → TeleportProgress-DxN0bQL2.js} +1 -1
  41. package/dist/chunks/{TeleportRepoMismatchDialog-D3FOLr0P.js → TeleportRepoMismatchDialog-A5Ss0kuk.js} +1 -1
  42. package/dist/chunks/{TeleportResumeWrapper-DI5iRFND.js → TeleportResumeWrapper-Bz14mUqR.js} +1 -1
  43. package/dist/chunks/{ThemePicker-CQ7dfFtv.js → ThemePicker-CVSRqTzW.js} +1 -1
  44. package/dist/chunks/TrustDialog-CY8an_Tg.js +1 -0
  45. package/dist/chunks/{ValidationErrorsList-CPYeuppg.js → ValidationErrorsList-BYsDtAvX.js} +1 -1
  46. package/dist/chunks/{WelcomeV2-C-UXdIng.js → WelcomeV2-C1BfrqC5.js} +1 -1
  47. package/dist/chunks/{add-dir-xTz4COgn.js → add-dir-DfLYgwox.js} +1 -1
  48. package/dist/chunks/{agentDisplay-BuSReYxu.js → agentDisplay-CMmHIl86.js} +1 -1
  49. package/dist/chunks/{agents-CiLlKN2I.js → agents-DE_4mAHG.js} +1 -1
  50. package/dist/chunks/agents-DJtPfvnL.js +103 -0
  51. package/dist/chunks/allErrors-CQE2k0zO.js +1 -0
  52. package/dist/chunks/{ant-CBIfqmAb.js → ant-ClQkuQjZ.js} +1 -1
  53. package/dist/chunks/{api-B-5jqiMg.js → api-2cdIPaeq.js} +1 -1
  54. package/dist/chunks/api-CG-lhKe-.js +1 -0
  55. package/dist/chunks/{assistant-XOnU01yl.js → assistant-Bje16tQx.js} +1 -1
  56. package/dist/chunks/auth-DMfEiQrC.js +1 -0
  57. package/dist/chunks/auth-D_cGl8WD.js +1 -0
  58. package/dist/chunks/{auth-DT2yxy94.js → auth-DqcKPbw8.js} +1 -1
  59. package/dist/chunks/{autoMode-CEMflt3g.js → autoMode-ZW70mpr0.js} +5 -5
  60. package/dist/chunks/{autonomy-_N8aDaA8.js → autonomy-CwbWsCnv.js} +1 -1
  61. package/dist/chunks/autonomy-Oui8yK8G.js +15 -0
  62. package/dist/chunks/{autonomyPanel-I4yCy3Fr.js → autonomyPanel-Mq50H7iM.js} +1 -1
  63. package/dist/chunks/backgroundHousekeeping-BpLtI45r.js +1 -0
  64. package/dist/chunks/backgroundHousekeeping-DtJNx4Ja.js +17 -0
  65. package/dist/chunks/{branch-BIX-pyHp.js → branch-DU5O9KZ0.js} +1 -1
  66. package/dist/chunks/{break-cache-BQfgkNAo.js → break-cache-C_p7Kmx2.js} +3 -3
  67. package/dist/chunks/{bridge-CYskzVt8.js → bridge-DNNxtPlz.js} +2 -2
  68. package/dist/chunks/{bridgeConfig-5p_w4s5r.js → bridgeConfig-CE6dMsiJ.js} +1 -1
  69. package/dist/chunks/bridgeConfig-DP9dD1Cv.js +1 -0
  70. package/dist/chunks/{bridgeEnabled-DhFrLTbG.js → bridgeEnabled-Cc0mGlTb.js} +1 -1
  71. package/dist/chunks/bridgeEnabled-D8wP3DWQ.js +1 -0
  72. package/dist/chunks/bridgeMain-CwxMa_pd.js +1 -0
  73. package/dist/chunks/bridgeMain-D11t1BYQ.js +68 -0
  74. package/dist/chunks/{bridgeMessaging-B5Lbzr8e.js → bridgeMessaging-DdvApEqW.js} +1 -1
  75. package/dist/chunks/{bridgePointer-MqLe5Asm.js → bridgePointer-DqHMHa2B.js} +1 -1
  76. package/dist/chunks/{btw-CWWFO7u8.js → btw-CejSEdNl.js} +1 -1
  77. package/dist/chunks/{caches-DPqPIogk.js → caches-5HVQSevy.js} +2 -2
  78. package/dist/chunks/caches-B-nJoHLM.js +1 -0
  79. package/dist/chunks/{ccrClient-CTLnU9Y1.js → ccrClient-BFyfO67b.js} +1 -1
  80. package/dist/chunks/{claudeDesktop-Cx31Ugjp.js → claudeDesktop-Fe-QL-sN.js} +1 -1
  81. package/dist/chunks/{clear-DCAgZwc4.js → clear-D8m2utXW.js} +1 -1
  82. package/dist/chunks/client-C6MbjvOB.js +17 -0
  83. package/dist/chunks/client-DKXCfdde.js +1 -0
  84. package/dist/chunks/client-xxikkAoZ.js +1 -0
  85. package/dist/chunks/{color-CmJGInHL.js → color-DWhgZH7A.js} +1 -1
  86. package/dist/chunks/commands-CxJpmEKF.js +1 -0
  87. package/dist/chunks/commitAttribution-DM6SBMwl.js +1 -0
  88. package/dist/chunks/{commitAttribution-CGZr7XNO.js → commitAttribution-DPnHHKSA.js} +1 -1
  89. package/dist/chunks/compact-CblM7306.js +2 -0
  90. package/dist/chunks/config-BLVBFi5v.js +1 -0
  91. package/dist/chunks/config-CMnqm6Se.js +1 -0
  92. package/dist/chunks/{config-3m_9zSrj.js → config-DRDuVyzE.js} +2 -2
  93. package/dist/chunks/{context-C9V4GF0n.js → context-CdSMMM-0.js} +1 -1
  94. package/dist/chunks/context-noninteractive-CPkf2vB9.js +1 -0
  95. package/dist/chunks/{context-noninteractive-BmC4o5xo.js → context-noninteractive-DNury4JI.js} +5 -5
  96. package/dist/chunks/conversation-DCMw_rsE.js +1 -0
  97. package/dist/chunks/conversation-pUtvc-cE.js +1 -0
  98. package/dist/chunks/{createSSHSession-BL6j0AU5.js → createSSHSession-BOdTAX3N.js} +1 -1
  99. package/dist/chunks/{createSession-D_sgO1Xy.js → createSession-8Ei-Lj7V.js} +1 -1
  100. package/dist/chunks/createSession-CjqxVh_Q.js +1 -0
  101. package/dist/chunks/crossProjectResume-Bj_Pe8oe.js +40 -0
  102. package/dist/chunks/{datadog-UkGdjL8-.js → datadog-DqHxqiwY.js} +1 -1
  103. package/dist/chunks/{desktop-HbYKh-VK.js → desktop-Z5FAfunZ.js} +1 -1
  104. package/dist/chunks/{diff-nTV17iWX.js → diff-CJEKvOA5.js} +1 -1
  105. package/dist/chunks/doctor-BA2ZLDTl.js +1 -0
  106. package/dist/chunks/{entry-CCFI6-gM.js → entry-DE0uMIf0.js} +4 -4
  107. package/dist/chunks/envLessBridgeConfig-B-LKYNvv.js +1 -0
  108. package/dist/chunks/envLessBridgeConfig-DyD9XCda.js +1 -0
  109. package/dist/chunks/{esm-CGoYrggU.js → esm-5w3xFBnt.js} +1 -1
  110. package/dist/chunks/exit-Dt9kHtJO.js +1 -0
  111. package/dist/chunks/{extra-usage-g2Pw4zt_.js → extra-usage-C7E2Z1p1.js} +1 -1
  112. package/dist/chunks/extra-usage-D0Kkjp-2.js +1 -0
  113. package/dist/chunks/{extra-usage-core-DLYHAInT.js → extra-usage-core-DjdaD1qO.js} +1 -1
  114. package/dist/chunks/{extra-usage-noninteractive-D8iszH3c.js → extra-usage-noninteractive-BnD1RhKK.js} +1 -1
  115. package/dist/chunks/{extraUsage-C2Ylufhj.js → extraUsage-CpgRTcMk.js} +1 -1
  116. package/dist/chunks/extractMemories-DhUprYa7.js +1 -0
  117. package/dist/chunks/{fast-Dx2fTmWr.js → fast-C4ZevUNL.js} +1 -1
  118. package/dist/chunks/fast-CChxlAAF.js +1 -0
  119. package/dist/chunks/{feedback-DCQ4pJ3v.js → feedback-BIhBhV6n.js} +1 -1
  120. package/dist/chunks/{firstPartyEventLogger-BNGPPBNP.js → firstPartyEventLogger-BXY1IJ2D.js} +2 -2
  121. package/dist/chunks/firstPartyEventLogger-CnkGSojw.js +1 -0
  122. package/dist/chunks/{flushGate-XaheIZZT.js → flushGate-CgHq81Gw.js} +1 -1
  123. package/dist/chunks/{gemini-BCCLHK3K.js → gemini-C1J-x1g7.js} +1 -1
  124. package/dist/chunks/generateRecap-C0jjCg0Z.js +1 -0
  125. package/dist/chunks/generateSessionName-w0BMtwS7.js +1 -0
  126. package/dist/chunks/{githubRepoPathMapping-B4AM8luI.js → githubRepoPathMapping-8D0kpsif.js} +1 -1
  127. package/dist/chunks/{goal-Bp6fyGqo.js → goal-B4GsR54_.js} +3 -3
  128. package/dist/chunks/grok-ffNyU3Lt.js +1 -0
  129. package/dist/chunks/{grove-DrBVaZSN.js → grove-BQisE2JM.js} +1 -1
  130. package/dist/chunks/{heapdump-JseysNDr.js → heapdump-DiCjAPR3.js} +1 -1
  131. package/dist/chunks/{help-DR9hKneR.js → help-2hn8VK2-.js} +1 -1
  132. package/dist/chunks/hooks-CBmrBO-J.js +1 -0
  133. package/dist/chunks/{hooks-C5n23H1E.js → hooks-CkA9bhHl.js} +2 -2
  134. package/dist/chunks/hostGuard-BHI6Q8Mt.js +1 -0
  135. package/dist/chunks/inboundAttachments-C5K3XPTC.js +1 -0
  136. package/dist/chunks/{inboundAttachments-Cp8XvLMZ.js → inboundAttachments-IH-g95jo.js} +1 -1
  137. package/dist/chunks/initReplBridge-C-P4dgAG.js +1 -0
  138. package/dist/chunks/{install-C7qTB0V5.js → install-Dzlm4u58.js} +1 -1
  139. package/dist/chunks/{instrumentation-CLZttr_u.js → instrumentation-Yt31gxWN.js} +3 -3
  140. package/dist/chunks/{job-BhiazwPH.js → job-BXujwZNa.js} +1 -1
  141. package/dist/chunks/{keybindings-CkL8BzUt.js → keybindings-D8FXoO89.js} +2 -2
  142. package/dist/chunks/language-Baosud0X.js +1 -0
  143. package/dist/chunks/{language-DIw2871r.js → language-Ca4B018X.js} +1 -1
  144. package/dist/chunks/{launchAgentsPlatform-j-mWpwW1.js → launchAgentsPlatform-D6DmNuDt.js} +1 -1
  145. package/dist/chunks/{launchLocalMemory-DmoXp0Xo.js → launchLocalMemory-C0FzUq7x.js} +2 -2
  146. package/dist/chunks/{launchLocalVault-1uKe0HjA.js → launchLocalVault-DkYAre4O.js} +3 -3
  147. package/dist/chunks/{launchMemoryStores-SxDKjHJ3.js → launchMemoryStores-D2rKWAPs.js} +1 -1
  148. package/dist/chunks/{launchOnboarding-CTtpnXcs.js → launchOnboarding-gOVAFEFp.js} +1 -1
  149. package/dist/chunks/{launchSchedule-BDVnGhaL.js → launchSchedule-IZdFstT_.js} +1 -1
  150. package/dist/chunks/{launchSkillStore-SmMLxp4K.js → launchSkillStore-B7LamM1d.js} +1 -1
  151. package/dist/chunks/{launchTeleport-B472ZSGz.js → launchTeleport-C2BQMfYP.js} +3 -3
  152. package/dist/chunks/{launchVault-CsyBgxle.js → launchVault-C60WUcCI.js} +1 -1
  153. package/dist/chunks/{lazySchema-DcIJE_0i.js → lazySchema-DULtBUCI.js} +1 -1
  154. package/dist/chunks/loadAgentsDir-B9c3Emvg.js +1 -0
  155. package/dist/chunks/{loadAgentsDir-Clu7Uk6a.js → loadAgentsDir-x3rlgED4.js} +693 -695
  156. package/dist/chunks/loadPluginHooks-BhNdAjeY.js +1 -0
  157. package/dist/chunks/localSearch-BLCGsdyM.js +1 -0
  158. package/dist/chunks/{localSearch-iA6JTk19.js → localSearch-DtplGF-l.js} +1 -1
  159. package/dist/chunks/{logoV2Utils-YHBJLIrC.js → logoV2Utils-gGK9gErT.js} +1 -1
  160. package/dist/chunks/{magicDocs-Bf1fqnHN.js → magicDocs-qdDB_mKb.js} +2 -2
  161. package/dist/chunks/{main-gtV_TqXP.js → main-OWFSddRx.js} +84 -84
  162. package/dist/chunks/managedEnv-Aq5BXfY7.js +1 -0
  163. package/dist/chunks/managedEnv-BHoeDjpS.js +1 -0
  164. package/dist/chunks/managedEnvConstants-BPwL2aWI.js +1 -0
  165. package/dist/chunks/{mappers-C8lYERPX.js → mappers-04gNXJ3w.js} +1 -1
  166. package/dist/chunks/mcp-BSNdwbxR.js +1 -0
  167. package/dist/chunks/mcp-CMnDNI-4.js +6 -0
  168. package/dist/chunks/mcp-D1yA9E56.js +2 -0
  169. package/dist/chunks/memory-D1zbyjxN.js +1 -0
  170. package/dist/chunks/{mode-DO6g7nkX.js → mode-DY087x_x.js} +2 -2
  171. package/dist/chunks/model-CZViyZnE.js +1 -0
  172. package/dist/chunks/{model-DLXL0CNu.js → model-D0EfJBuw.js} +1 -1
  173. package/dist/chunks/model-DLLkVV6S.js +1 -0
  174. package/dist/chunks/{nativeInstaller-OPuO2sm_.js → nativeInstaller-yj81F75v.js} +1 -1
  175. package/dist/chunks/onChangeAppState-DhGKPG9g.js +1 -0
  176. package/dist/chunks/{openai-HOebt-8k.js → openai-EYRnUsco.js} +3 -3
  177. package/dist/chunks/{overageCreditGrant-Bi1CTBAx.js → overageCreditGrant-Du3dOYVu.js} +1 -1
  178. package/dist/chunks/{panel-CrTPqXCv.js → panel-BSZGX6jN.js} +1 -1
  179. package/dist/chunks/{panelCall-D0eURklm.js → panelCall-dMvRPAGE.js} +1 -1
  180. package/dist/chunks/{partition-C8RSL3SQ.js → partition-C4FWzYVm.js} +1 -1
  181. package/dist/chunks/{passes-BJci5SM_.js → passes-Daz-ARWD.js} +1 -1
  182. package/dist/chunks/permissions-DF8tAmDF.js +3 -0
  183. package/dist/chunks/{pidLock-Bd2e6xuT.js → pidLock-CbC_il6r.js} +2 -2
  184. package/dist/chunks/{plan-D4gMsK7i.js → plan-rsb_83Fo.js} +1 -1
  185. package/dist/chunks/{plugin-CwCo5Kik.js → plugin-Cm31-nej.js} +1 -1
  186. package/dist/chunks/pluginAutoupdate-0k03PVff.js +1 -0
  187. package/dist/chunks/pluginBlocklist-wPFCUPdm.js +1 -0
  188. package/dist/chunks/pluginCliCommands-DhL9LbH0.js +1 -0
  189. package/dist/chunks/{pluginFlagging-DNPBbJZo.js → pluginFlagging-CAdaFV_D.js} +1 -1
  190. package/dist/chunks/pluginOperations-Cs_Z4C6O.js +2 -0
  191. package/dist/chunks/pluginStartupCheck-BRXGKGjG.js +1 -0
  192. package/dist/chunks/pluginStartupCheck-KeU0efTj.js +1 -0
  193. package/dist/chunks/{plugins-CzJIuPfb.js → plugins-CQNKZmjP.js} +4 -4
  194. package/dist/chunks/policyLimits-D2s8M8P2.js +1 -0
  195. package/dist/chunks/{pollConfig-DH2oCtFS.js → pollConfig-2nFzv6Hy.js} +1 -1
  196. package/dist/chunks/{poor-Dha9p9RF.js → poor-DXumVTR4.js} +1 -1
  197. package/dist/chunks/{poorMode-1NLYiS3Y.js → poorMode-CBOtooa0.js} +1 -1
  198. package/dist/chunks/poorMode-yNZL5uYf.js +1 -0
  199. package/dist/chunks/print-uxCF5ka5.js +23 -0
  200. package/dist/chunks/{privacy-settings-6ZWxR4Qt.js → privacy-settings-BncbJCV0.js} +1 -1
  201. package/dist/chunks/processBashCommand-CGdwvPmD.js +1 -0
  202. package/dist/chunks/processSlashCommand-DQarepEb.js +5 -0
  203. package/dist/chunks/prompt-BgOdcHkd.js +1 -0
  204. package/dist/chunks/{prompt-Bg_1U0gO.js → prompt-CE3sFmZV.js} +5 -5
  205. package/dist/chunks/prompt-CLJKFebn.js +1 -0
  206. package/dist/chunks/{promptEditor-BhYDmwdS.js → promptEditor-CyTzyjwG.js} +2 -2
  207. package/dist/chunks/{protocolHandler-Dnb7lITm.js → protocolHandler-JR8pASdH.js} +1 -1
  208. package/dist/chunks/rate-limit-options-C-EqWjeI.js +1 -0
  209. package/dist/chunks/{rcDebugLog-VKwMl0yg.js → rcDebugLog-DBB9r8aw.js} +1 -1
  210. package/dist/chunks/reconciler-CYD_XpG4.js +4 -0
  211. package/dist/chunks/{referral-BlrMpBAV.js → referral-CKmHHxj_.js} +1 -1
  212. package/dist/chunks/refresh-ZqZdmLK5.js +1 -0
  213. package/dist/chunks/{registerProtocol-CuKZAiCc.js → registerProtocol-wZv2uiW_.js} +1 -1
  214. package/dist/chunks/{release-notes-BgP8u7NE.js → release-notes-B5K7wVqZ.js} +1 -1
  215. package/dist/chunks/{releaseNotes-CunqVlbU.js → releaseNotes-B8gbyFFJ.js} +2 -2
  216. package/dist/chunks/{reload-plugins-CD9TzvFm.js → reload-plugins-B9ApSp2m.js} +1 -1
  217. package/dist/chunks/{remote-env-QaP_W_sv.js → remote-env-CAt1dHIS.js} +1 -1
  218. package/dist/chunks/{remoteBridgeCore-9-HVMo63.js → remoteBridgeCore-Bk3UdSLJ.js} +1 -1
  219. package/dist/chunks/remoteManagedSettings-bswzAB6W.js +1 -0
  220. package/dist/chunks/rename-CE_U6KE6.js +1 -0
  221. package/dist/chunks/{resume-D-SpOy_1.js → resume-BicEjsPd.js} +2 -2
  222. package/dist/chunks/{runtimeObserver-Dm3LIUMp.js → runtimeObserver-BrGF5QWX.js} +4 -4
  223. package/dist/chunks/{runtimeObserver-DOEcrylu.js → runtimeObserver-CiwnPFjK.js} +1 -1
  224. package/dist/chunks/sandbox-adapter-BtMiHImm.js +1 -0
  225. package/dist/chunks/{sandbox-toggle-B61AeBor.js → sandbox-toggle-D8eebdyI.js} +1 -1
  226. package/dist/chunks/searchExtraTools-hLLPuh7c.js +1 -0
  227. package/dist/chunks/{session-RwJCIIcs.js → session-BZIlR9Gc.js} +2 -2
  228. package/dist/chunks/{sessionDiscovery-dkFeWcA3.js → sessionDiscovery-DfDqTrF1.js} +1 -1
  229. package/dist/chunks/sessionFileAccessHooks-Bm8wiqwe.js +1 -0
  230. package/dist/chunks/sessionMemory-D37S0-jX.js +1 -0
  231. package/dist/chunks/sessionMemory-DmlAG3jq.js +1 -0
  232. package/dist/chunks/sessionMemoryUtils-6EWDHSGU.js +1 -0
  233. package/dist/chunks/sessionObserver-BUw2rzKl.js +1 -0
  234. package/dist/chunks/{sessionObserver-CSOYgsvH.js → sessionObserver-KgquhGWw.js} +1 -1
  235. package/dist/chunks/sessionStorage-CucBSK5Q.js +1 -0
  236. package/dist/chunks/{sessionTitle-CLOlPZ_M.js → sessionTitle-DAnM73S0.js} +2 -2
  237. package/dist/chunks/{sessionTracing-D8wr9j4X.js → sessionTracing-_Hh5VXxt.js} +1 -1
  238. package/dist/chunks/settings-BeLFUeie.js +19 -0
  239. package/dist/chunks/settings-Cl16Haug.js +1 -0
  240. package/dist/chunks/settingsSync-BNvFYH3c.js +1 -0
  241. package/dist/chunks/setup-D8kXv3ts.js +3 -0
  242. package/dist/chunks/{shadowedRuleDetection-CXsmUY2o.js → shadowedRuleDetection-C6R5zOUe.js} +1 -1
  243. package/dist/chunks/{sideQuestion-CHpOVzY5.js → sideQuestion-hUhxls9r.js} +3 -3
  244. package/dist/chunks/{sinks-1hFrW9HK.js → sinks-BuE17DeZ.js} +2 -2
  245. package/dist/chunks/sinks-FevoYQqP.js +1 -0
  246. package/dist/chunks/{skill-learning-Ck17rwH8.js → skill-learning-CMdxGtxr.js} +1 -1
  247. package/dist/chunks/skillChangeDetector-C65ZLSYV.js +1 -0
  248. package/dist/chunks/{skillGapStore-DyqNKuNy.js → skillGapStore-D18LRJAM.js} +2 -2
  249. package/dist/chunks/{skillGapStore-BJ1h2LVr.js → skillGapStore-Ep62R-2_.js} +1 -1
  250. package/dist/chunks/{skillGenerator-BT8NGzXT.js → skillGenerator-Bc7WwNT8.js} +2 -2
  251. package/dist/chunks/{skillLearning-Cn9Uw0Kd.js → skillLearning-Cs9fJgkV.js} +1 -1
  252. package/dist/chunks/skillLearning-duPZl69A.js +1 -0
  253. package/dist/chunks/{skillPanel-N0GoWjIi.js → skillPanel-Cyzby746.js} +3 -3
  254. package/dist/chunks/{skillSearchPanel-CTwtgTzy.js → skillSearchPanel-Cll9ccA5.js} +4 -4
  255. package/dist/chunks/{skills-Bv3lH-aA.js → skills-BPPeYBy7.js} +1 -1
  256. package/dist/chunks/{stats-C1Ff6w4i.js → stats-CqfF4Axp.js} +1 -1
  257. package/dist/chunks/{status-FD7HVYS7.js → status-CC9Q-2Yn.js} +1 -1
  258. package/dist/chunks/{status-DyXiBa0m.js → status-D4IQpsNK.js} +2 -2
  259. package/dist/chunks/statusNoticeHelpers-CEGvdm5d.js +1 -0
  260. package/dist/chunks/syncCache-CANQZ9mQ.js +1 -0
  261. package/dist/chunks/{tag-RzOSA5T0.js → tag-DDbNqBMu.js} +2 -2
  262. package/dist/chunks/{tasks-eJrOcdhB.js → tasks-CZvWJYGr.js} +1 -1
  263. package/dist/chunks/teleport-Dk5j03Ix.js +1 -0
  264. package/dist/chunks/{templateJobs-BnOBSFtq.js → templateJobs-D1BdhZsv.js} +1 -1
  265. package/dist/chunks/{terminalSetup-D_P5iZmq.js → terminalSetup-3JNy6i_J.js} +5 -5
  266. package/dist/chunks/{terminalSetup-BfvmoJaK.js → terminalSetup-Cn6jeYw1.js} +1 -1
  267. package/dist/chunks/{theme-S0kVMVt4.js → theme-Cg4GNOoQ.js} +1 -1
  268. package/dist/chunks/thinkback-p-vKIRW_.js +1 -0
  269. package/dist/chunks/thinkback-play-DnPTDE8B.js +1 -0
  270. package/dist/chunks/{thinkback-HyW_R_88.js → thinkback-rFA1do6F.js} +1 -1
  271. package/dist/chunks/{toolEventObserver--Z6jENks.js → toolEventObserver-CzsCuUMc.js} +1 -1
  272. package/dist/chunks/{toolEventObserver-BAFzvePj.js → toolEventObserver-SFwURL5F.js} +1 -1
  273. package/dist/chunks/toolPool-BR27AMJO.js +1 -0
  274. package/dist/chunks/trustedDevice-BYt39fui.js +1 -0
  275. package/dist/chunks/{trustedDevice-Dn4rXbxT.js → trustedDevice-CKedohmT.js} +1 -1
  276. package/dist/chunks/{types-C-MRCL8J.js → types-Dut4311z.js} +2 -2
  277. package/dist/chunks/{ultrareviewCommand-mYDTBCFD.js → ultrareviewCommand-C_4OSBTW.js} +2 -2
  278. package/dist/chunks/{undercover-CdapzvNH.js → undercover-D30rKimg.js} +2 -2
  279. package/dist/chunks/undercover-DRSwLozU.js +1 -0
  280. package/dist/chunks/{updateCCB-DPShheOr.js → updateCCB-C2G-U-qA.js} +1 -1
  281. package/dist/chunks/upgrade-Bi-bIz7R.js +1 -0
  282. package/dist/chunks/{upgrade-BOeakAP6.js → upgrade-Chs-OQFd.js} +1 -1
  283. package/dist/chunks/{upload-BXQsDtLW.js → upload-D8FWMSQx.js} +1 -1
  284. package/dist/chunks/{usage-iNQzY960.js → usage-BxVeUt60.js} +1 -1
  285. package/dist/chunks/usage-DUO7Yy1f.js +1 -0
  286. package/dist/chunks/{useExitOnCtrlCDWithKeybindings-CntByfTQ.js → useExitOnCtrlCDWithKeybindings-BwsZ5f0s.js} +1 -1
  287. package/dist/chunks/useMainLoopModel-Gy1Vv4Qr.js +1 -0
  288. package/dist/chunks/useManagePlugins-B11_87VN.js +1 -0
  289. package/dist/chunks/useMergedTools-CR56my9t.js +1 -0
  290. package/dist/chunks/{useSearchInput-H-8hJeFD.js → useSearchInput-C5OzQnX6.js} +1 -1
  291. package/dist/chunks/{useSettingsErrors-BF5i5Xju.js → useSettingsErrors-B9vOZL41.js} +1 -1
  292. package/dist/chunks/{util-CoicMvOv.js → util-8EHwfg4A.js} +1 -1
  293. package/dist/chunks/validatePlugin-6q1qmnAC.js +1 -0
  294. package/dist/chunks/{vim-DdvQlLDm.js → vim-CNDzwoTd.js} +1 -1
  295. package/dist/chunks/{workerRegistry-CzqQwCHC.js → workerRegistry-CvyHvwx-.js} +1 -1
  296. package/dist/chunks/worktree-ogmNCIpz.js +1 -0
  297. package/dist/cli.js +1 -1
  298. package/package.json +1 -1
  299. package/dist/chunks/ApproveApiKey-CKfn7U1R.js +0 -1
  300. package/dist/chunks/BackgroundTasksDialog-CyoLEYWH.js +0 -2
  301. package/dist/chunks/ClaudeMdExternalIncludesDialog-TypH-X8e.js +0 -1
  302. package/dist/chunks/ConsoleOAuthFlow-wGQuFt41.js +0 -1
  303. package/dist/chunks/Doctor-CcJUwSQn.js +0 -1
  304. package/dist/chunks/Doctor-Yco1McrL.js +0 -3
  305. package/dist/chunks/ExitFlow-D3csukbB.js +0 -2
  306. package/dist/chunks/Grove-DPkIjqg8.js +0 -1
  307. package/dist/chunks/Grove-Dsd7F39b.js +0 -11
  308. package/dist/chunks/MCPConnectionManager-MWpKjeZT.js +0 -1
  309. package/dist/chunks/MessageSelector-DsQmqFt2.js +0 -3
  310. package/dist/chunks/Messages-B3sGRx5A.js +0 -11
  311. package/dist/chunks/PluginSettings-B0jbwB2M.js +0 -17
  312. package/dist/chunks/QueryEngine-cwdsr4dr.js +0 -1
  313. package/dist/chunks/REPL-CJzScgbZ.js +0 -142
  314. package/dist/chunks/REPL-DlBJIPCw.js +0 -1
  315. package/dist/chunks/ResumeConversation-Rxwd6HAJ.js +0 -1
  316. package/dist/chunks/SearchExtraToolsTool-VP87ErGx.js +0 -1
  317. package/dist/chunks/Settings-CxI_KHUj.js +0 -2
  318. package/dist/chunks/TrustDialog-CnVKrdxQ.js +0 -1
  319. package/dist/chunks/agents-Du9KYHqN.js +0 -103
  320. package/dist/chunks/allErrors-P3utlEeA.js +0 -1
  321. package/dist/chunks/api-BiwZmmsh.js +0 -1
  322. package/dist/chunks/auth-BQa4kzQo.js +0 -1
  323. package/dist/chunks/auth-UAJhZNmZ.js +0 -1
  324. package/dist/chunks/autonomy-Cg5zweUa.js +0 -15
  325. package/dist/chunks/backgroundHousekeeping-BUUZ7Csq.js +0 -1
  326. package/dist/chunks/backgroundHousekeeping-DhF2lrQ9.js +0 -17
  327. package/dist/chunks/bridgeConfig-DWEqKbXk.js +0 -1
  328. package/dist/chunks/bridgeEnabled-CjVCMwnq.js +0 -1
  329. package/dist/chunks/bridgeMain-6lollTtZ.js +0 -1
  330. package/dist/chunks/bridgeMain-BX2AkLPs.js +0 -68
  331. package/dist/chunks/caches-C46fa77L.js +0 -1
  332. package/dist/chunks/client-Bup0Sgcn.js +0 -1
  333. package/dist/chunks/commands-BdB1eFvP.js +0 -1
  334. package/dist/chunks/commitAttribution-D6J3NuhB.js +0 -1
  335. package/dist/chunks/compact-C6-lMHgn.js +0 -2
  336. package/dist/chunks/config-Bxt1UH1T.js +0 -1
  337. package/dist/chunks/config-CjjXZfNi.js +0 -1
  338. package/dist/chunks/context-noninteractive-DvGo1l7b.js +0 -1
  339. package/dist/chunks/conversation-CH9ouFai.js +0 -1
  340. package/dist/chunks/conversation-CYqqk0o7.js +0 -1
  341. package/dist/chunks/createSession-DUfOAeyE.js +0 -1
  342. package/dist/chunks/crossProjectResume-D5hTOfnE.js +0 -40
  343. package/dist/chunks/doctor-7fgVhEKL.js +0 -1
  344. package/dist/chunks/envLessBridgeConfig-B2HYnEKo.js +0 -1
  345. package/dist/chunks/envLessBridgeConfig-DXd10GXD.js +0 -1
  346. package/dist/chunks/exit-ropaQiOr.js +0 -1
  347. package/dist/chunks/extra-usage-CLhv1Z4g.js +0 -1
  348. package/dist/chunks/extractMemories-B2IAvbXM.js +0 -1
  349. package/dist/chunks/fast-_G6zcFye.js +0 -1
  350. package/dist/chunks/firstPartyEventLogger-C9LzVy6y.js +0 -1
  351. package/dist/chunks/generateRecap-BhvbixY2.js +0 -1
  352. package/dist/chunks/generateSessionName-CN1oh7Fa.js +0 -1
  353. package/dist/chunks/grok-ax26ju8y.js +0 -1
  354. package/dist/chunks/hooks-BUJLxdFJ.js +0 -1
  355. package/dist/chunks/hostGuard-C5xydXZI.js +0 -1
  356. package/dist/chunks/inboundAttachments-C0nMTtCi.js +0 -1
  357. package/dist/chunks/initReplBridge-DJs28ZkI.js +0 -1
  358. package/dist/chunks/language-DfOAuDFc.js +0 -1
  359. package/dist/chunks/loadAgentsDir-DTbJJff-.js +0 -1
  360. package/dist/chunks/loadPluginHooks-Cvd5VdjQ.js +0 -1
  361. package/dist/chunks/localSearch-DKv8PRLD.js +0 -1
  362. package/dist/chunks/mcp-CNuhEGP6.js +0 -6
  363. package/dist/chunks/mcp-Ci0OPVrR.js +0 -1
  364. package/dist/chunks/mcp-CwIYauZl.js +0 -2
  365. package/dist/chunks/memory-DCGqfQ1U.js +0 -1
  366. package/dist/chunks/model-BQF64tZx.js +0 -1
  367. package/dist/chunks/model-DvrvG6BB.js +0 -1
  368. package/dist/chunks/onChangeAppState-CHhRDkM7.js +0 -1
  369. package/dist/chunks/permissions-JU9CGHgI.js +0 -3
  370. package/dist/chunks/pluginAutoupdate-CO-n9bqe.js +0 -1
  371. package/dist/chunks/pluginBlocklist-5qbaTRbV.js +0 -1
  372. package/dist/chunks/pluginCliCommands-I-lsw_us.js +0 -1
  373. package/dist/chunks/pluginOperations-Cz6eQ0Vu.js +0 -2
  374. package/dist/chunks/pluginStartupCheck-CoW7073W.js +0 -1
  375. package/dist/chunks/pluginStartupCheck-DJ9fslCK.js +0 -1
  376. package/dist/chunks/policyLimits-BkjgMQD0.js +0 -1
  377. package/dist/chunks/poorMode-qlxqU8Hm.js +0 -1
  378. package/dist/chunks/print-BL4EUT5Z.js +0 -23
  379. package/dist/chunks/processBashCommand-BZs9wggV.js +0 -1
  380. package/dist/chunks/processSlashCommand-D8lKLNzM.js +0 -5
  381. package/dist/chunks/prompt-CN7gBNKS.js +0 -1
  382. package/dist/chunks/prompt-D-zHhqp8.js +0 -1
  383. package/dist/chunks/rate-limit-options-DVzT3eWH.js +0 -1
  384. package/dist/chunks/reconciler-BdRXZTJf.js +0 -4
  385. package/dist/chunks/refresh-jwqnoK2h.js +0 -1
  386. package/dist/chunks/remoteManagedSettings-jZ6u8ZBT.js +0 -1
  387. package/dist/chunks/rename-29qxHf8W.js +0 -1
  388. package/dist/chunks/sandbox-adapter-LzTcKwBp.js +0 -1
  389. package/dist/chunks/searchExtraTools-CbJJQqzH.js +0 -1
  390. package/dist/chunks/sessionFileAccessHooks-B_nNW0zE.js +0 -1
  391. package/dist/chunks/sessionMemory-C4JAUZ6V.js +0 -1
  392. package/dist/chunks/sessionMemory-btARBn8H.js +0 -1
  393. package/dist/chunks/sessionMemoryUtils-BlqAy8oR.js +0 -1
  394. package/dist/chunks/sessionObserver-DMvWci8-.js +0 -1
  395. package/dist/chunks/sessionStorage-Diyuvt20.js +0 -1
  396. package/dist/chunks/settings-Dlp5JTa_.js +0 -19
  397. package/dist/chunks/settingsSync-QWA0VZSu.js +0 -1
  398. package/dist/chunks/setup-UI9uv2-K.js +0 -3
  399. package/dist/chunks/sinks-CXq8-7Qn.js +0 -1
  400. package/dist/chunks/skillChangeDetector-s0F9Yf9a.js +0 -1
  401. package/dist/chunks/skillLearning-1ZfYIzfL.js +0 -1
  402. package/dist/chunks/statusNoticeHelpers-kTp9Rdk6.js +0 -1
  403. package/dist/chunks/teleport-ABA-hdmP.js +0 -1
  404. package/dist/chunks/thinkback-C6gV2LpU.js +0 -1
  405. package/dist/chunks/thinkback-play-H6md4czq.js +0 -1
  406. package/dist/chunks/toolPool-CR61XXm3.js +0 -1
  407. package/dist/chunks/trustedDevice-DUrFWupL.js +0 -1
  408. package/dist/chunks/undercover-k3JoOKAb.js +0 -1
  409. package/dist/chunks/upgrade-D7iGU0PQ.js +0 -1
  410. package/dist/chunks/usage-DbRdMJog.js +0 -1
  411. package/dist/chunks/useMainLoopModel-DHkRIgNs.js +0 -1
  412. package/dist/chunks/useManagePlugins-B8HD0RUh.js +0 -1
  413. package/dist/chunks/useMergedTools-DfchLQZC.js +0 -1
  414. package/dist/chunks/validatePlugin-z2fcngf8.js +0 -1
  415. package/dist/chunks/worktree-DMhP5T0p.js +0 -1
@@ -1 +0,0 @@
1
- import{t as e}from"./REPL-CJzScgbZ.js";export{e as REPL};
@@ -1 +0,0 @@
1
- import{a as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,P as r,Wt as i,dr as a,fi as o,ot as ee,t as s}from"./src-CDCSSo0U2.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{en as l,vr as te}from"./state-ix0xIunV.js";import{Fb as u,Hr as ne,Hy as d,Il as f,Jn as re,KS as ie,Nb as p,Nr as ae,RC as oe,US as m,Uy as h,Vl as se,WS as ce,aC as g,ar as le,fi as ue,jr as _,nd as de,op as v,pi as y,qr as b,rd as x,sp as S,ti as fe,zC as C}from"./loadAgentsDir-Clu7Uk6a.js";import{o as w,s as T}from"./log-BMCygSzM.js";import{n as E,r as D}from"./analytics-BotDBGh0.js";import{u as O}from"./referral-BlrMpBAV.js";import{r as pe}from"./asciicast-CbAjUHT_.js";import{a as me,n as k,s as A}from"./skillChangeDetector-s0F9Yf9a.js";import{a as j,i as M,n as N,o as P,r as F,t as I}from"./crossProjectResume-D5hTOfnE.js";import{t as L}from"./REPL-CJzScgbZ.js";import{dirname as R}from"path";var z=t(o(),1);g(),l(),P(),u(),v(),s(),O(),E(),m(),C(),M(),f(),d(),N(),w(),_();var B=c();function he(e){let t=parseInt(e,10);if(!isNaN(t)&&t>0)return t;let n=e.match(/github\.com\/[^/]+\/[^/]+\/pull\/(\d+)/);return n?.[1]?parseInt(n[1],10):null}function V({commands:t,worktreePaths:i,initialTools:o,mcpClients:s,dynamicMcpConfig:c,debug:l,mainThreadAgentDefinition:u,autoConnectIdeFlag:d,strictMcpConfig:f=!1,systemPrompt:m,appendSystemPrompt:g,initialSearchQuery:_,disableSlashCommands:v=!1,forkSession:C,taskListId:w,filterByPr:E,thinkingConfig:O,onTurnComplete:M}){let{rows:N}=ee(),P=ce(e=>e.agentDefinitions),V=ie(),[H,U]=z.useState([]),[ve,W]=z.useState(!0),[ye,be]=z.useState(!1),[G,xe]=z.useState(!1),[K,q]=z.useState(null),[J,Se]=z.useState(null),Y=z.useRef(null),X=z.useRef(0),Z=z.useMemo(()=>{let e=H.filter(e=>!e.isSidechain);if(E!==void 0){if(E===!0)e=e.filter(e=>e.prNumber!==void 0);else if(typeof E==`number`)e=e.filter(e=>e.prNumber===E);else if(typeof E==`string`){let t=he(E);t!==null&&(e=e.filter(e=>e.prNumber===t))}}return e},[H,E]),Ce=ae();z.useEffect(()=>{b(i).then(e=>{Y.current=e,X.current=e.logs.length,U(e.logs),W(!1)}).catch(e=>{T(e),W(!1)})},[i]);let Q=z.useCallback(e=>{let t=Y.current;!t||t.nextIndex>=t.allStatLogs.length||le(t.allStatLogs,t.nextIndex,e).then(n=>{if(t.nextIndex=n.nextIndex,n.logs.length>0){let e=X.current;n.logs.forEach((t,n)=>{t.value=e+n}),U(e=>e.concat(n.logs)),X.current+=n.logs.length}else t.nextIndex<t.allStatLogs.length&&Q(e)})},[]),$=z.useCallback(e=>{W(!0),(e?ne():b(i)).then(e=>{Y.current=e,X.current=e.logs.length,U(e.logs)}).catch(e=>{T(e)}).finally(()=>{W(!1)})},[i]),we=z.useCallback(()=>{let e=!G;xe(e),$(e)},[G,$]);function Te(){process.exit(1)}async function Ee(t){be(!0);let n=performance.now(),r=I(t,G,i);if(r.isCrossProject&&!r.isSameRepoWorktree){let e=r.command,t=await a(e);t&&process.stdout.write(t),Se(e);return}try{let r=await h(t,void 0);if(!r)throw Error(`Failed to load conversation`);r.sessionId&&!C?(te(oe(r.sessionId),t.fullPath?R(t.fullPath):null),await pe(),await ue(),S(r.sessionId)):C&&r.contentReplacements?.length&&await fe(r.contentReplacements);let{agentDefinition:i}=me(r.agentSetting,u,P);V(e=>({...e,agent:i?.agentType}));let a=k(r.agentName,r.agentColor);if(a&&V(e=>({...e,standaloneAgentContext:a})),se(r.agentName),y(C?{...r,worktreeSession:void 0}:r),C||(A(r.worktreeSession),r.sessionId&&re()),r.goal&&r.sessionId){let{hydrateGoalFromTranscript:t}=(x(),e(de)),n=new Map;n.set(r.sessionId,r.goal),t(n,r.sessionId)}D(`tengu_session_resumed`,{entrypoint:`picker`,success:!0,resume_duration_ms:Math.round(performance.now()-n)}),U([]),q({messages:r.messages,fileHistorySnapshots:r.fileHistorySnapshots,contentReplacements:r.contentReplacements,agentName:r.agentName,agentColor:r.agentColor==="default"?void 0:r.agentColor,mainThreadAgentDefinition:i})}catch(e){throw D(`tengu_session_resumed`,{entrypoint:`picker`,success:!1}),T(e),e}}return J?(0,B.jsx)(_e,{command:J}):K?(0,B.jsx)(L,{debug:l,commands:t,initialTools:o,initialMessages:K.messages,initialFileHistorySnapshots:K.fileHistorySnapshots,initialContentReplacements:K.contentReplacements,initialAgentName:K.agentName,initialAgentColor:K.agentColor,mcpClients:s,dynamicMcpConfig:c,strictMcpConfig:f,systemPrompt:m,appendSystemPrompt:g,mainThreadAgentDefinition:K.mainThreadAgentDefinition,autoConnectIdeFlag:d,disableSlashCommands:v,taskListId:w,thinkingConfig:O,onTurnComplete:M}):ve?(0,B.jsxs)(n,{children:[(0,B.jsx)(p,{}),(0,B.jsx)(r,{children:` Loading conversations…`})]}):ye?(0,B.jsxs)(n,{children:[(0,B.jsx)(p,{}),(0,B.jsx)(r,{children:` Resuming conversation…`})]}):Z.length===0?(0,B.jsx)(ge,{}):(0,B.jsx)(j,{logs:Z,maxHeight:N,onCancel:Te,onSelect:Ee,onLogsChanged:Ce?()=>$(G):void 0,onLoadMore:Q,initialSearchQuery:_,showAllProjects:G,onToggleAllProjects:we,onAgenticSearch:F})}function ge(){return i(`app:interrupt`,()=>{process.exit(1)},{context:`Global`}),(0,B.jsxs)(n,{flexDirection:`column`,children:[(0,B.jsx)(r,{children:`No conversations found to resume.`}),(0,B.jsx)(r,{dimColor:!0,children:`Press Ctrl+C to exit and start a new conversation.`})]})}function _e({command:e}){return z.useEffect(()=>{let e=setTimeout(()=>{process.exit(0)},100);return()=>clearTimeout(e)},[]),(0,B.jsxs)(n,{flexDirection:`column`,gap:1,children:[(0,B.jsx)(r,{children:`This conversation is from a different directory.`}),(0,B.jsxs)(n,{flexDirection:`column`,children:[(0,B.jsx)(r,{children:`To resume, run:`}),(0,B.jsxs)(r,{children:[` `,e]})]}),(0,B.jsx)(r,{dimColor:!0,children:`(Command copied to clipboard)`})]})}export{V as ResumeConversation};
@@ -1 +0,0 @@
1
- import{iE as e,rE as t}from"./loadAgentsDir-Clu7Uk6a.js";e();export{t as clearSearchExtraToolsDescriptionCache};
@@ -1,2 +0,0 @@
1
- import{a as e,n as t,o as n}from"./rolldown-runtime-DaDcL9Zw.js";import{d as r,l as i,o as a}from"./envUtils-DSxRz_kt.js";import{n as o,t as s}from"./figures-5ThXQEtq.js";import{D as c,Gt as l,H as u,I as d,P as f,T as p,U as ee,Wt as te,Xn as ne,a as re,d as ie,di as m,fi as h,k as ae,n as oe,ot as se,r as ce,t as g,ui as _,x as v,y as le}from"./src-CDCSSo0U2.js";import{t as y}from"./jsx-runtime-Bb4Xn-E0.js";import{en as b,gr as ue,ht as x,qt as de}from"./state-ix0xIunV.js";import{BE as fe,C as S,Dg as pe,Eg as me,F as he,Fx as C,GS as ge,Hx as _e,KS as ve,LE as ye,Px as be,S as xe,Sx as w,US as Se,Ux as Ce,VE as we,WS as T,aC as E,af as Te,ah as Ee,as as D,fx as O,if as De,is as k,jg as Oe,jr as A,mr as ke,mx as Ae,oh as je,op as j,os as M,px as Me,rp as Ne,v as Pe,xx as N,zE as Fe}from"./loadAgentsDir-Clu7Uk6a.js";import{n as Ie,t as Le}from"./cwd-CYmmnQVS.js";import{S as Re,w as ze}from"./debug-BrXObCdR.js";import{Ft as Be,Ht as Ve,Lt as He,Rt as Ue,c as We,g as P,n as Ge,y as F,zt as Ke}from"./settings-Dlp5JTa_.js";import{a as qe,b as I,c as L,g as Je,i as Ye,m as Xe,o as Ze}from"./config-3m_9zSrj.js";import{o as R,s as Qe}from"./log-BMCygSzM.js";import{n as $e,r as z}from"./analytics-BotDBGh0.js";import{b as et,g as tt}from"./startupProfiler-xa3NmN7Z.js";import{r as nt}from"./permissions-Cn_6f8CB.js";import{Bt as rt,Ft as it,G as at,K as ot,Tr as st,_ as ct,b as lt,et as ut,it as dt,q as ft,rt as pt,tt as mt,wr as B,x as ht}from"./model-BQF64tZx.js";import{r as gt,t as _t}from"./poorMode-1NLYiS3Y.js";import{u as vt}from"./referral-BlrMpBAV.js";import{i as yt,r as bt}from"./bridgeEnabled-DhFrLTbG.js";import{a as V,c as H,d as U,i as xt,l as St,n as Ct,o as wt,r as Tt,s as Et,t as Dt,u as W}from"./status-DyXiBa0m.js";import{n as Ot,t as kt}from"./useExitOnCtrlCDWithKeybindings-CntByfTQ.js";import{i as At,n as G,r as jt}from"./modalContext-DFjKLCB6.js";import{n as Mt,t as Nt}from"./ThemePicker-CQ7dfFtv.js";import{i as Pt,n as Ft,r as It,t as Lt}from"./extraUsage-C2Ylufhj.js";import{n as Rt,t as zt}from"./ClaudeMdExternalIncludesDialog-CI0yF6sZ.js";import{t as Bt}from"./SearchBox-vfLXEPed.js";import{n as Vt,t as Ht}from"./useSearchInput-H-8hJeFD.js";import{n as Ut,t as Wt}from"./usage-iNQzY960.js";import{a as Gt,i as Kt,t as qt}from"./OverageCreditUpsell-CWCD_RpM.js";function Jt(){let e=x();return[{label:`Version`,value:`0.0.5`},{label:`Session name`,value:ke(e)??(0,K.jsx)(f,{dimColor:!0,children:`/rename to add a name`})},{label:`Session ID`,value:e},{label:`cwd`,value:Le()},...Ct(),...Dt()]}function Yt({mainLoopModel:e,mcp:t,theme:n,context:r}){return[{label:`Model`,value:W(e)},...Tt(t.clients,r.options.ideInstallationStatus,n),...wt(t.clients,n),...H(),...St()]}async function Xt(){return[...await xt(),...await V(),...await Et()]}function Zt({value:e}){return Array.isArray(e)?(0,K.jsx)(d,{flexWrap:`wrap`,columnGap:1,flexShrink:99,children:e.map((t,n)=>(0,K.jsxs)(f,{children:[t,n<e.length-1?`,`:``]},n))}):typeof e==`string`?(0,K.jsx)(f,{children:e}):e}function Qt({context:e,diagnosticsPromise:t}){let n=T(e=>e.mainLoopModel),r=T(e=>e.mcp),[i]=u(),a=en.useMemo(()=>[Jt(),Yt({mainLoopModel:n,mcp:r,theme:i,context:e})],[n,r,i,e]),o=jt()?1:void 0;return(0,K.jsxs)(d,{flexDirection:`column`,flexGrow:o,children:[(0,K.jsxs)(d,{flexDirection:`column`,gap:1,flexGrow:o,children:[a.map((e,t)=>e.length>0&&(0,K.jsx)(d,{flexDirection:`column`,children:e.map(({label:e,value:t},n)=>(0,K.jsxs)(d,{flexDirection:`row`,gap:1,flexShrink:0,children:[e!==void 0&&(0,K.jsxs)(f,{bold:!0,children:[e,`:`]}),(0,K.jsx)(Zt,{value:t})]},n))},t)),(0,K.jsx)(tn.Suspense,{fallback:null,children:(0,K.jsx)($t,{promise:t})})]}),(0,K.jsx)(f,{dimColor:!0,children:(0,K.jsx)(N,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})})]})}function $t({promise:e}){let t=(0,tn.use)(e);return t.length===0?null:(0,K.jsxs)(d,{flexDirection:`column`,paddingBottom:1,children:[(0,K.jsx)(f,{bold:!0,children:`System Diagnostics`}),t.map((e,t)=>(0,K.jsxs)(d,{flexDirection:`row`,gap:1,paddingX:1,children:[(0,K.jsx)(f,{color:`error`,children:s.warning}),typeof e==`string`?(0,K.jsx)(f,{wrap:`wrap`,children:e}):e]},t))]})}var en,tn,K,nn=t((()=>{o(),en=n(h(),1),tn=n(h(),1),b(),G(),g(),Se(),Ie(),A(),U(),w(),K=y()}));function rn({currentVersion:e,onChoice:t}){function n(e){t(e)}function r(){t(`cancel`)}return(0,an.jsxs)(le,{title:`Switch to Stable Channel`,onCancel:r,color:`permission`,hideBorder:!0,hideInputGuide:!0,children:[(0,an.jsxs)(f,{children:[`The stable channel may have an older version than what you're currently running (`,e,`).`]}),(0,an.jsx)(f,{dimColor:!0,children:`How would you like to handle this?`}),(0,an.jsx)(Me,{options:[{label:`Allow possible downgrade to stable version`,value:`downgrade`},{label:`Stay on current version (${e}) until stable catches up`,value:`stay`}],onChange:n})]})}var an,on=t((()=>{h(),g(),O(),an=y()}));function sn(e){return Object.entries(e).map(([e,t])=>({label:t?.name??un,value:e,description:t?.description??dn}))}function cn({initialStyle:e,onComplete:t,onCancel:n,isStandaloneCommand:r}){let[i,a]=(0,ln.useState)([]),[o,s]=(0,ln.useState)(!0);(0,ln.useEffect)(()=>{D(Le()).then(e=>{let t=sn(e);a(t),s(!1)}).catch(()=>{let e=sn(k);a(e),s(!1)})},[]);let c=(0,ln.useCallback)(e=>{t(e)},[t]);return(0,q.jsx)(le,{title:`Preferred output style`,onCancel:n,hideInputGuide:!r,hideBorder:!r,children:(0,q.jsxs)(d,{flexDirection:`column`,gap:1,children:[(0,q.jsx)(d,{marginTop:1,children:(0,q.jsx)(f,{dimColor:!0,children:`This changes how Claude Code communicates with you`})}),o?(0,q.jsx)(f,{dimColor:!0,children:`Loading output styles…`}):(0,q.jsx)(Me,{options:i,onChange:c,visibleOptionCount:10,defaultValue:e})]})})}var ln,q,un,dn,fn=t((()=>{h(),ln=n(h(),1),M(),g(),Ie(),Ae(),q=y(),un=`Default`,dn=`Claude completes coding tasks efficiently and provides concise responses`}));function pn({initialLanguage:e,onComplete:t,onCancel:n}){let[r,i]=(0,mn.useState)(e),[a,o]=(0,mn.useState)((e??``).length);te(`confirm:no`,n,{context:`Settings`});function c(){let e=r?.trim();t(e||void 0)}return(0,J.jsxs)(d,{flexDirection:`column`,gap:1,children:[(0,J.jsx)(f,{children:`Enter your preferred response and voice language:`}),(0,J.jsxs)(d,{flexDirection:`row`,gap:1,children:[(0,J.jsx)(f,{children:s.pointer}),(0,J.jsx)(be,{value:r??``,onChange:i,onSubmit:c,focus:!0,showCursor:!0,placeholder:`e.g., Japanese, 日本語, Español${s.ellipsis}`,columns:60,cursorOffset:a,onChangeCursorOffset:o})]}),(0,J.jsx)(f,{dimColor:!0,children:`Leave empty for default (English)`})]})}var mn,J,hn=t((()=>{o(),mn=n(h(),1),g(),vt(),C(),J=y()}));function gn({onClose:t,context:n,setTabsHidden:a,onIsSearchModeChange:o,contentHeight:ie}){let{headerFocused:m,focusHeader:h}=re(),oe=jt(),[,ce]=u(),g=ee(),[v,y]=(0,X.useState)(L()),b=Y.useRef(L()),[x,S]=(0,X.useState)(Ge()),pe=Y.useRef(Ge()),[C,_e]=(0,X.useState)(x?.outputStyle||`default`),be=Y.useRef(C),[w,Se]=(0,X.useState)(x?.language),we=Y.useRef(w),[E,Ee]=(0,X.useState)(0),[D,O]=(0,X.useState)(0),[k,A]=(0,X.useState)(!1),ke=ne(),{rows:Ae}=se(),je=ie??Math.min(Math.floor(Ae*.8),30),j=Math.max(5,je-10),M=T(e=>e.mainLoopModel),Ne=T(e=>e.verbose),Ie=T(e=>e.thinkingEnabled),Le=T(e=>pt()?e.fastMode:!1);T(e=>e.promptSuggestionEnabled);let Re=Ue(x?.permissions?.defaultMode??`default`),ze=xe()||Pe()===`enabled`,Be=(Te(),e(De)).isBriefEntitled(),P=ve(),[Je,R]=(0,X.useState)({}),$e=Y.useRef(Ie),[et]=(0,X.useState)(()=>We(`localSettings`)),[tt]=(0,X.useState)(()=>We(`userSettings`)),rt=Y.useRef(g),it=ge(),[ct]=(0,X.useState)(()=>{let e=it.getState();return{mainLoopModel:e.mainLoopModel,mainLoopModelForSession:e.mainLoopModelForSession,verbose:e.verbose,thinkingEnabled:e.thinkingEnabled,fastMode:e.fastMode,promptSuggestionEnabled:e.promptSuggestionEnabled,isBriefOnly:e.isBriefOnly,replBridgeEnabled:e.replBridgeEnabled,replBridgeOutboundOnly:e.replBridgeOutboundOnly,settings:e.settings}}),[ut]=(0,X.useState)(()=>de()),B=Y.useRef(!1),[vt,bt]=(0,X.useState)(!1),[V,H]=(0,X.useState)(null),{query:U,setQuery:xt,cursorOffset:St}=Vt({isActive:k&&V===null&&!m,onExit:()=>A(!1),onExitUp:h,passthroughCtrlKeys:[`c`,`d`]}),Ct=k&&!m;Y.useEffect(()=>{o?.(Ct)},[Ct,o]);let wt=me(n.options.mcpClients),Tt=!i(process.env.CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING),Et=Y.use(Fe(!0)),Dt=fe(Et),W=qe();function Ot(e){z(`tengu_config_model_changed`,{from_model:M,to_model:e}),P(t=>({...t,mainLoopModel:e,mainLoopModelForSession:null})),R(t=>{let n=ht(e)+(Ft(e,!1,lt())?` · Billed as extra usage`:``);if(`model`in t){let{model:e,...r}=t;return{...r,model:n}}return{...t,model:n}})}function kt(e){I(t=>({...t,verbose:e})),y({...L(),verbose:e}),P(t=>({...t,verbose:e})),R(t=>{if(`verbose`in t){let{verbose:e,...n}=t;return n}return{...t,verbose:e}})}let At=[{id:`autoCompactEnabled`,label:`Auto-compact`,value:v.autoCompactEnabled,type:`boolean`,onChange(e){I(t=>({...t,autoCompactEnabled:e})),y({...L(),autoCompactEnabled:e}),z(`tengu_auto_compact_setting_changed`,{enabled:e})}},{id:`spinnerTipsEnabled`,label:`Show tips`,value:x?.spinnerTipsEnabled??!0,type:`boolean`,onChange(e){F(`localSettings`,{spinnerTipsEnabled:e}),S(t=>({...t,spinnerTipsEnabled:e})),z(`tengu_tips_setting_changed`,{enabled:e})}},{id:`cacheWarningEnabled`,label:`Cache warnings`,value:x?.cacheWarningEnabled??!0,type:`boolean`,onChange(e){F(`localSettings`,{cacheWarningEnabled:e}),S(t=>({...t,cacheWarningEnabled:e})),z(`tengu_cache_warning_setting_changed`,{enabled:e})}},{id:`prefersReducedMotion`,label:`Reduce motion`,value:x?.prefersReducedMotion??!1,type:`boolean`,onChange(e){F(`localSettings`,{prefersReducedMotion:e}),S(t=>({...t,prefersReducedMotion:e})),P(t=>({...t,settings:{...t.settings,prefersReducedMotion:e}})),z(`tengu_reduce_motion_setting_changed`,{enabled:e})}},{id:`thinkingEnabled`,label:`Thinking mode`,value:Ie??!0,type:`boolean`,onChange(e){P(t=>({...t,thinkingEnabled:e})),F(`userSettings`,{alwaysThinkingEnabled:e?void 0:!1}),z(`tengu_thinking_toggled`,{enabled:e})}},...pt()&&mt()?[{id:`fastMode`,label:`Fast mode (${at} only)`,value:!!Le,type:`boolean`,onChange(e){ot(),F(`userSettings`,{fastMode:e?!0:void 0}),e?(P(e=>({...e,mainLoopModel:ft(),mainLoopModelForSession:null,fastMode:!0})),R(e=>({...e,model:ft(),"Fast mode":`ON`}))):(P(e=>({...e,fastMode:!1})),R(e=>({...e,"Fast mode":`OFF`})))}}]:[],{id:`poorMode`,label:`Poor mode (save tokens)`,value:(_t(),e(gt)).isPoorModeActive(),type:`boolean`,onChange(t){(_t(),e(gt)).setPoorMode(t),P(e=>({...e,promptSuggestionEnabled:!t}))}},...process.env.USER_TYPE===`ant`?[{id:`speculationEnabled`,label:`Speculative execution`,value:v.speculationEnabled??!0,type:`boolean`,onChange(e){I(t=>t.speculationEnabled===e?t:{...t,speculationEnabled:e}),y({...L(),speculationEnabled:e}),z(`tengu_speculation_setting_changed`,{enabled:e})}}]:[],...Tt?[{id:`fileCheckpointingEnabled`,label:`Rewind code (checkpoints)`,value:v.fileCheckpointingEnabled,type:`boolean`,onChange(e){I(t=>({...t,fileCheckpointingEnabled:e})),y({...L(),fileCheckpointingEnabled:e}),z(`tengu_file_history_snapshots_setting_changed`,{enabled:e})}}]:[],{id:`verbose`,label:`Verbose output`,value:Ne,type:`boolean`,onChange:kt},{id:`terminalProgressBarEnabled`,label:`Terminal progress bar`,value:v.terminalProgressBarEnabled,type:`boolean`,onChange(e){I(t=>({...t,terminalProgressBarEnabled:e})),y({...L(),terminalProgressBarEnabled:e}),z(`tengu_terminal_progress_bar_setting_changed`,{enabled:e})}},{id:`showTurnDuration`,label:`Show turn duration`,value:v.showTurnDuration,type:`boolean`,onChange(e){I(t=>({...t,showTurnDuration:e})),y({...L(),showTurnDuration:e}),z(`tengu_show_turn_duration_setting_changed`,{enabled:e})}},{id:`defaultPermissionMode`,label:`Default permission mode`,value:Re,options:(()=>{let e=[`default`,`plan`];return[...e,...nt.filter(t=>!e.includes(t))]})(),type:`enum`,onChange(e){let t=Ue(e),n=t===`auto`?t:He(t)?Ve(t):t,r=F(`userSettings`,{permissions:{...x?.permissions,defaultMode:n}});if(r.error){Qe(r.error);return}S(e=>({...e,permissions:{...e?.permissions,defaultMode:n}})),R(t=>({...t,defaultPermissionMode:e})),z(`tengu_config_changed`,{setting:`defaultPermissionMode`,value:e})}},...ze?[{id:`useAutoModeDuringPlan`,label:`Use auto mode during plan`,value:x?.useAutoModeDuringPlan??!0,type:`boolean`,onChange(e){F(`userSettings`,{useAutoModeDuringPlan:e}),S(t=>({...t,useAutoModeDuringPlan:e})),P(e=>{let t=he(e.toolPermissionContext);return t===e.toolPermissionContext?e:{...e,toolPermissionContext:t}}),R(t=>({...t,"Use auto mode during plan":e}))}}]:[],{id:`respectGitignore`,label:`Respect .gitignore in file picker`,value:v.respectGitignore,type:`boolean`,onChange(e){I(t=>({...t,respectGitignore:e})),y({...L(),respectGitignore:e}),z(`tengu_respect_gitignore_setting_changed`,{enabled:e})}},...Ce()?[{id:`copyOnSelect`,label:`Copy on select`,value:v.copyOnSelect??!0,type:`boolean`,onChange(e){I(t=>({...t,copyOnSelect:e})),y({...L(),copyOnSelect:e}),z(`tengu_config_changed`,{setting:`copyOnSelect`,value:String(e)})}}]:[],W?{id:`autoUpdatesChannel`,label:`Auto-update channel`,value:`disabled`,type:`managedEnum`,onChange(){}}:{id:`autoUpdatesChannel`,label:`Auto-update channel`,value:x?.autoUpdatesChannel??`latest`,type:`managedEnum`,onChange(){}},{id:`theme`,label:`Theme`,value:g,type:`managedEnum`,onChange:ce},{id:`notifChannel`,label:`Local notifications`,value:v.preferredNotifChannel,options:[`auto`,`iterm2`,`terminal_bell`,`iterm2_with_bell`,`kitty`,`ghostty`,`notifications_disabled`],type:`enum`,onChange(e){I(t=>({...t,preferredNotifChannel:e})),y({...L(),preferredNotifChannel:e})}},{id:`taskCompleteNotifEnabled`,label:`Push when idle`,value:v.taskCompleteNotifEnabled??!1,type:`boolean`,onChange(e){I(t=>({...t,taskCompleteNotifEnabled:e})),y({...L(),taskCompleteNotifEnabled:e})}},{id:`inputNeededNotifEnabled`,label:`Push when input needed`,value:v.inputNeededNotifEnabled??!1,type:`boolean`,onChange(e){I(t=>({...t,inputNeededNotifEnabled:e})),y({...L(),inputNeededNotifEnabled:e})}},{id:`agentPushNotifEnabled`,label:`Push when Claude decides`,value:v.agentPushNotifEnabled??!1,type:`boolean`,onChange(e){I(t=>({...t,agentPushNotifEnabled:e})),y({...L(),agentPushNotifEnabled:e})}},{id:`outputStyle`,label:`Output style`,value:C,type:`managedEnum`,onChange:()=>{}},...Be?[{id:`defaultView`,label:`What you see by default`,value:x?.defaultView===void 0?`default`:String(x.defaultView),options:[`transcript`,`chat`,`default`],type:`enum`,onChange(e){let t=e==="default"?void 0:e;F(`localSettings`,{defaultView:t}),S(e=>({...e,defaultView:t}));let n=t===`chat`;P(e=>e.isBriefOnly===n?e:{...e,isBriefOnly:n}),ue(n),R(t=>({...t,"Default view":e})),z(`tengu_default_view_setting_changed`,{value:t??`unset`})}}]:[],{id:`language`,label:`Language`,value:w??`Default (English)`,type:`managedEnum`,onChange:()=>{}},{id:`editorMode`,label:`Editor mode`,value:v.editorMode===`emacs`?`normal`:v.editorMode||`normal`,options:[`normal`,`vim`],type:`enum`,onChange(e){I(t=>({...t,editorMode:e})),y({...L(),editorMode:e}),z(`tengu_editor_mode_changed`,{mode:e,source:`config_panel`})}},{id:`prStatusFooterEnabled`,label:`Show PR status footer`,value:v.prStatusFooterEnabled??!0,type:`boolean`,onChange(e){I(t=>t.prStatusFooterEnabled===e?t:{...t,prStatusFooterEnabled:e}),y({...L(),prStatusFooterEnabled:e}),z(`tengu_pr_status_footer_setting_changed`,{enabled:e})}},{id:`model`,label:`Model`,value:M===null?`Default (recommended)`:M,type:`managedEnum`,onChange:Ot},...wt?[{id:`diffTool`,label:`Diff tool`,value:v.diffTool??`auto`,options:[`terminal`,`auto`],type:`enum`,onChange(e){I(t=>({...t,diffTool:e})),y({...L(),diffTool:e}),z(`tengu_diff_tool_changed`,{tool:e,source:`config_panel`})}}]:[],...Oe()?[]:[{id:`autoConnectIde`,label:`Auto-connect to IDE (external terminal)`,value:v.autoConnectIde??!1,type:`boolean`,onChange(e){I(t=>({...t,autoConnectIde:e})),y({...L(),autoConnectIde:e}),z(`tengu_auto_connect_ide_changed`,{enabled:e,source:`config_panel`})}}],...Oe()?[{id:`autoInstallIdeExtension`,label:`Auto-install IDE extension`,value:v.autoInstallIdeExtension??!0,type:`boolean`,onChange(e){I(t=>({...t,autoInstallIdeExtension:e})),y({...L(),autoInstallIdeExtension:e}),z(`tengu_auto_install_ide_extension_changed`,{enabled:e,source:`config_panel`})}}]:[],...yt()?[{id:`remoteControlAtStartup`,label:`Enable Remote Control for all sessions`,value:v.remoteControlAtStartup===void 0?`default`:String(v.remoteControlAtStartup),options:[`true`,`false`,`default`],type:`enum`,onChange(e){if(e==="default")I(e=>{if(e.remoteControlAtStartup===void 0)return e;let t={...e};return delete t.remoteControlAtStartup,t}),y({...L(),remoteControlAtStartup:void 0});else{let t=e===`true`;I(e=>e.remoteControlAtStartup===t?e:{...e,remoteControlAtStartup:t}),y({...L(),remoteControlAtStartup:t})}let t=Xe();P(e=>e.replBridgeEnabled===t&&!e.replBridgeOutboundOnly?e:{...e,replBridgeEnabled:t,replBridgeOutboundOnly:!1})}}]:[],...Dt?[{id:`showExternalIncludesDialog`,label:`External CLAUDE.md includes`,value:Ze().hasClaudeMdExternalIncludesApproved?`true`:`false`,type:`managedEnum`,onChange(){}}]:[],...process.env.ANTHROPIC_API_KEY&&!r()?[{id:`apiKey`,label:(0,Z.jsxs)(f,{children:[`Use custom API key: `,(0,Z.jsx)(f,{bold:!0,children:st(process.env.ANTHROPIC_API_KEY)})]}),searchText:`Use custom API key`,value:!!(process.env.ANTHROPIC_API_KEY&&v.customApiKeyResponses?.approved?.includes(st(process.env.ANTHROPIC_API_KEY))),type:`boolean`,onChange(e){I(t=>{let n={...t};if(n.customApiKeyResponses||(n.customApiKeyResponses={approved:[],rejected:[]}),n.customApiKeyResponses.approved||(n.customApiKeyResponses={...n.customApiKeyResponses,approved:[]}),n.customApiKeyResponses.rejected||(n.customApiKeyResponses={...n.customApiKeyResponses,rejected:[]}),process.env.ANTHROPIC_API_KEY){let t=st(process.env.ANTHROPIC_API_KEY);e?n.customApiKeyResponses={...n.customApiKeyResponses,approved:[...(n.customApiKeyResponses.approved??[]).filter(e=>e!==t),t],rejected:(n.customApiKeyResponses.rejected??[]).filter(e=>e!==t)}:n.customApiKeyResponses={...n.customApiKeyResponses,approved:(n.customApiKeyResponses.approved??[]).filter(e=>e!==t),rejected:[...(n.customApiKeyResponses.rejected??[]).filter(e=>e!==t),t]}}return n}),y(L())}}]:[]],G=Y.useMemo(()=>{if(!U)return At;let e=U.toLowerCase();return At.filter(t=>t.id.toLowerCase().includes(e)?!0:(`searchText`in t?t.searchText:t.label).toLowerCase().includes(e))},[At,U]);Y.useEffect(()=>{if(E>=G.length){let e=Math.max(0,G.length-1);Ee(e),O(Math.max(0,e-j+1));return}O(e=>E<e?E:E>=e+j?E-j+1:e)},[G.length,E,j]);let Mt=(0,X.useCallback)(e=>{O(t=>e<t?e:e>=t+j?e-j+1:t)},[j]),Pt=(0,X.useCallback)(()=>{if(V!==null)return;let e=Object.entries(Je).map(([e,t])=>(z(`tengu_config_changed`,{key:e,value:t}),`Set ${e} to ${_.bold(t)}`)),n=r()?void 0:process.env.ANTHROPIC_API_KEY,i=!!(n&&b.current.customApiKeyResponses?.approved?.includes(st(n))),a=!!(n&&v.customApiKeyResponses?.approved?.includes(st(n)));if(i!==a&&(e.push(`${a?`Enabled`:`Disabled`} custom API key`),z(`tengu_config_changed`,{key:`env.ANTHROPIC_API_KEY`,value:a})),v.theme!==b.current.theme&&e.push(`Set theme to ${_.bold(v.theme)}`),v.preferredNotifChannel!==b.current.preferredNotifChannel&&e.push(`Set notifications to ${_.bold(v.preferredNotifChannel)}`),C!==be.current&&e.push(`Set output style to ${_.bold(C)}`),w!==we.current&&e.push(`Set response language to ${_.bold(w??`Default (English)`)}`),v.editorMode!==b.current.editorMode&&e.push(`Set editor mode to ${_.bold(v.editorMode||`emacs`)}`),v.diffTool!==b.current.diffTool&&e.push(`Set diff tool to ${_.bold(v.diffTool)}`),v.autoConnectIde!==b.current.autoConnectIde&&e.push(`${v.autoConnectIde?`Enabled`:`Disabled`} auto-connect to IDE`),v.autoInstallIdeExtension!==b.current.autoInstallIdeExtension&&e.push(`${v.autoInstallIdeExtension?`Enabled`:`Disabled`} auto-install IDE extension`),v.autoCompactEnabled!==b.current.autoCompactEnabled&&e.push(`${v.autoCompactEnabled?`Enabled`:`Disabled`} auto-compact`),v.respectGitignore!==b.current.respectGitignore&&e.push(`${v.respectGitignore?`Enabled`:`Disabled`} respect .gitignore in file picker`),v.copyOnSelect!==b.current.copyOnSelect&&e.push(`${v.copyOnSelect?`Enabled`:`Disabled`} copy on select`),v.terminalProgressBarEnabled!==b.current.terminalProgressBarEnabled&&e.push(`${v.terminalProgressBarEnabled?`Enabled`:`Disabled`} terminal progress bar`),v.showStatusInTerminalTab!==b.current.showStatusInTerminalTab&&e.push(`${v.showStatusInTerminalTab?`Enabled`:`Disabled`} terminal tab status`),v.showTurnDuration!==b.current.showTurnDuration&&e.push(`${v.showTurnDuration?`Enabled`:`Disabled`} turn duration`),v.remoteControlAtStartup!==b.current.remoteControlAtStartup){let t=v.remoteControlAtStartup===void 0?`Reset Remote Control to default`:`${v.remoteControlAtStartup?`Enabled`:`Disabled`} Remote Control for all sessions`;e.push(t)}x?.autoUpdatesChannel!==pe.current?.autoUpdatesChannel&&e.push(`Set auto-update channel to ${_.bold(x?.autoUpdatesChannel??`latest`)}`),e.length>0?t(e.join(`
2
- `)):t(`Config dialog dismissed`,{display:`system`})},[V,Je,v,M,C,w,x?.autoUpdatesChannel,pt()?x?.fastMode:void 0,t]),Lt=(0,X.useCallback)(()=>{g!==rt.current&&ce(rt.current),I(()=>b.current);let e=et;F(`localSettings`,{spinnerTipsEnabled:e?.spinnerTipsEnabled,prefersReducedMotion:e?.prefersReducedMotion,defaultView:e?.defaultView,outputStyle:e?.outputStyle});let t=tt;F(`userSettings`,{alwaysThinkingEnabled:t?.alwaysThinkingEnabled,fastMode:t?.fastMode,promptSuggestionEnabled:t?.promptSuggestionEnabled,autoUpdatesChannel:t?.autoUpdatesChannel,minimumVersion:t?.minimumVersion,language:t?.language,useAutoModeDuringPlan:t?.useAutoModeDuringPlan,syntaxHighlightingDisabled:t?.syntaxHighlightingDisabled,permissions:t?.permissions===void 0?void 0:{...t.permissions,defaultMode:t.permissions.defaultMode}});let n=ct;P(e=>({...e,mainLoopModel:n.mainLoopModel,mainLoopModelForSession:n.mainLoopModelForSession,verbose:n.verbose,thinkingEnabled:n.thinkingEnabled,fastMode:n.fastMode,promptSuggestionEnabled:n.promptSuggestionEnabled,isBriefOnly:n.isBriefOnly,replBridgeEnabled:n.replBridgeEnabled,replBridgeOutboundOnly:n.replBridgeOutboundOnly,settings:n.settings,toolPermissionContext:he(e.toolPermissionContext)})),de()!==ut&&ue(ut)},[g,ce,et,tt,ct,ut,P]);te(`confirm:no`,(0,X.useCallback)(()=>{V===null&&(B.current&&Lt(),t(`Config dialog dismissed`,{display:`system`}))},[V,Lt,t]),{context:`Settings`,isActive:V===null&&!k&&!m}),te(`settings:close`,Pt,{context:`Settings`,isActive:V===null&&!k&&!m});let Rt=(0,X.useCallback)(()=>{let e=G[E];if(!(!e||!e.onChange)){if(e.type===`boolean`){B.current=!0,e.onChange(!e.value),e.id===`thinkingEnabled`&&(!e.value===$e.current?bt(!1):n.messages.some(e=>e.type===`assistant`)&&bt(!0));return}if(e.id===`theme`||e.id===`model`||e.id===`showExternalIncludesDialog`||e.id===`outputStyle`||e.id===`language`)switch(e.id){case`theme`:H(`Theme`),a(!0);return;case`model`:H(`Model`),a(!0);return;case`showExternalIncludesDialog`:H(`ExternalIncludes`),a(!0);return;case`outputStyle`:H(`OutputStyle`),a(!0);return;case`language`:H(`Language`),a(!0);return}if(e.id===`autoUpdatesChannel`){if(W){H(`EnableAutoUpdates`),a(!0);return}(x?.autoUpdatesChannel??`latest`)===`latest`?(H(`ChannelDowngrade`),a(!0)):(B.current=!0,F(`userSettings`,{autoUpdatesChannel:`latest`,minimumVersion:void 0}),S(e=>({...e,autoUpdatesChannel:`latest`,minimumVersion:void 0})),z(`tengu_autoupdate_channel_changed`,{channel:`latest`}));return}if(e.type===`enum`){B.current=!0;let t=(e.options.indexOf(e.value)+1)%e.options.length;e.onChange(e.options[t]);return}}},[W,G,E,x?.autoUpdatesChannel,a]),Bt=e=>{bt(!1);let t=Math.max(0,Math.min(G.length-1,E+e));Ee(t),Mt(t)};return l({"select:previous":()=>{E===0?(bt(!1),A(!0),O(0)):Bt(-1)},"select:next":()=>Bt(1),"scroll:lineUp":()=>Bt(-1),"scroll:lineDown":()=>Bt(1),"select:accept":Rt,"select:previousValue":()=>Rt(),"select:nextValue":()=>Rt(),"settings:search":()=>{A(!0),xt(``)}},{context:`Settings`,isActive:V===null&&!k&&!m}),(0,Z.jsx)(d,{flexDirection:`column`,width:`100%`,tabIndex:0,autoFocus:!0,onKeyDown:(0,X.useCallback)(e=>{if(V===null&&!m){if(k){if(e.key===`escape`){e.preventDefault(),U.length>0?xt(``):A(!1);return}(e.key===`return`||e.key===`down`||e.key===`wheeldown`)&&(e.preventDefault(),A(!1),Ee(0),O(0));return}if(e.key===`left`||e.key===`right`||e.key===`tab`){e.preventDefault(),Rt();return}e.ctrl||e.meta||e.key===`j`||e.key===`k`||e.key===`/`||e.key.length===1&&e.key!==` `&&(e.preventDefault(),A(!0),xt(e.key))}},[V,m,k,U,xt,Rt]),children:V===`Theme`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Nt,{onThemeSelect:e=>{B.current=!0,ce(e),H(null),a(!1)},onCancel:()=>{H(null),a(!1)},hideEscToCancel:!0,skipExitHandling:!0}),(0,Z.jsx)(d,{children:(0,Z.jsx)(f,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(p,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`select`}),(0,Z.jsx)(N,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})})]}):V===`Model`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(It,{initial:M,onSelect:e=>{B.current=!0,Ot(e),H(null),a(!1)},onCancel:()=>{H(null),a(!1)},showFastModeNotice:pt()?Le&&dt(M)&&mt():!1}),(0,Z.jsx)(f,{dimColor:!0,children:(0,Z.jsxs)(p,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(N,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]}):V===`ExternalIncludes`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(zt,{onDone:()=>{H(null),a(!1)},externalIncludes:ye(Et)}),(0,Z.jsx)(f,{dimColor:!0,children:(0,Z.jsxs)(p,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(N,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`disable external includes`})]})})]}):V===`OutputStyle`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(cn,{initialStyle:C,onComplete:e=>{B.current=!0,_e(e??`default`),H(null),a(!1),F(`localSettings`,{outputStyle:e}),z(`tengu_output_style_changed`,{style:e??`default`,source:`config_panel`,settings_source:`localSettings`})},onCancel:()=>{H(null),a(!1)}}),(0,Z.jsx)(f,{dimColor:!0,children:(0,Z.jsxs)(p,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(N,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]}):V===`Language`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(pn,{initialLanguage:w,onComplete:e=>{B.current=!0,Se(e),H(null),a(!1),F(`userSettings`,{language:e}),z(`tengu_language_changed`,{language:e??`default`,source:`config_panel`})},onCancel:()=>{H(null),a(!1)}}),(0,Z.jsx)(f,{dimColor:!0,children:(0,Z.jsxs)(p,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(N,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]})})]}):V===`EnableAutoUpdates`?(0,Z.jsx)(le,{title:`Enable Auto-Updates`,onCancel:()=>{H(null),a(!1)},hideBorder:!0,hideInputGuide:!0,children:W?.type===`config`?(0,Z.jsx)(Me,{options:[{label:`Enable with latest channel`,value:`latest`},{label:`Enable with stable channel`,value:`stable`}],onChange:e=>{B.current=!0,H(null),a(!1),I(e=>({...e,autoUpdates:!0})),y({...L(),autoUpdates:!0}),F(`userSettings`,{autoUpdatesChannel:e,minimumVersion:void 0}),S(t=>({...t,autoUpdatesChannel:e,minimumVersion:void 0})),z(`tengu_autoupdate_enabled`,{channel:e})}}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(f,{children:W?.type===`env`?`Auto-updates are controlled by an environment variable and cannot be changed here.`:`Auto-updates are disabled in development builds.`}),W?.type===`env`&&(0,Z.jsxs)(f,{dimColor:!0,children:[`Unset `,W.envVar,` to re-enable auto-updates.`]})]})}):V===`ChannelDowngrade`?(0,Z.jsx)(rn,{currentVersion:`0.0.5`,onChoice:e=>{if(H(null),a(!1),e===`cancel`)return;B.current=!0;let t={autoUpdatesChannel:`stable`};e===`stay`&&(t.minimumVersion=`0.0.5`),F(`userSettings`,t),S(e=>({...e,...t})),z(`tengu_autoupdate_channel_changed`,{channel:`stable`,minimum_version_set:e===`stay`})}}):(0,Z.jsxs)(d,{flexDirection:`column`,gap:1,marginY:oe?void 0:1,children:[(0,Z.jsx)(ae,{query:U,isFocused:k&&!m,isTerminalFocused:ke,cursorOffset:St,placeholder:`Search settings…`}),(0,Z.jsx)(d,{flexDirection:`column`,children:G.length===0?(0,Z.jsxs)(f,{dimColor:!0,italic:!0,children:[`No settings match "`,U,`"`]}):(0,Z.jsxs)(Z.Fragment,{children:[D>0&&(0,Z.jsxs)(f,{dimColor:!0,children:[s.arrowUp,` `,D,` more above`]}),G.slice(D,D+j).map((e,t)=>{let n=D+t===E&&!m&&!k;return(0,Z.jsx)(Y.Fragment,{children:(0,Z.jsxs)(d,{width:`100%`,children:[(0,Z.jsx)(d,{width:44,children:(0,Z.jsxs)(f,{color:n?`suggestion`:void 0,children:[n?s.pointer:` `,` `,e.label]})}),(0,Z.jsx)(d,{flexGrow:1,children:e.type===`boolean`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(f,{color:n?`suggestion`:void 0,children:e.value.toString()}),vt&&e.id===`thinkingEnabled`&&(0,Z.jsxs)(f,{color:`warning`,children:[` `,`Changing thinking mode mid-conversation will increase latency and may reduce quality.`]})]}):e.id===`theme`?(0,Z.jsx)(f,{color:n?`suggestion`:void 0,children:vn[e.value.toString()]??e.value.toString()}):e.id===`notifChannel`?(0,Z.jsx)(f,{color:n?`suggestion`:void 0,children:(0,Z.jsx)(_n,{value:e.value.toString()})}):e.id===`defaultPermissionMode`?(0,Z.jsx)(f,{color:n?`suggestion`:void 0,children:Ke(e.value)}):e.id===`autoUpdatesChannel`&&W?(0,Z.jsxs)(d,{flexDirection:`column`,children:[(0,Z.jsx)(f,{color:n?`suggestion`:void 0,children:`disabled`}),(0,Z.jsxs)(f,{dimColor:!0,children:[`(`,Ye(W),`)`]})]}):(0,Z.jsx)(f,{color:n?`suggestion`:void 0,children:e.value.toString()})})]})},e.id)}),D+j<G.length&&(0,Z.jsxs)(f,{dimColor:!0,children:[s.arrowDown,` `,G.length-D-j,` more below`]})]})}),m?(0,Z.jsx)(f,{dimColor:!0,children:(0,Z.jsxs)(p,{children:[(0,Z.jsx)(c,{shortcut:`←/→ tab`,action:`switch`}),(0,Z.jsx)(c,{shortcut:`↓`,action:`return`}),(0,Z.jsx)(N,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`close`})]})}):k?(0,Z.jsx)(f,{dimColor:!0,children:(0,Z.jsxs)(p,{children:[(0,Z.jsx)(f,{children:`Type to filter`}),(0,Z.jsx)(c,{shortcut:`Enter/↓`,action:`select`}),(0,Z.jsx)(c,{shortcut:`↑`,action:`tabs`}),(0,Z.jsx)(N,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`clear`})]})}):(0,Z.jsx)(f,{dimColor:!0,children:(0,Z.jsxs)(p,{children:[(0,Z.jsx)(N,{action:`select:accept`,context:`Settings`,fallback:`Space`,description:`change`}),(0,Z.jsx)(N,{action:`settings:close`,context:`Settings`,fallback:`Enter`,description:`save`}),(0,Z.jsx)(N,{action:`settings:search`,context:`Settings`,fallback:`/`,description:`search`}),(0,Z.jsx)(N,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]})})]})})}function _n({value:e}){switch(e){case`auto`:return`Auto`;case`iterm2`:return(0,Z.jsxs)(f,{children:[`iTerm2 `,(0,Z.jsx)(f,{dimColor:!0,children:`(OSC 9)`})]});case`terminal_bell`:return(0,Z.jsxs)(f,{children:[`Terminal Bell `,(0,Z.jsx)(f,{dimColor:!0,children:`(\\a)`})]});case`kitty`:return(0,Z.jsxs)(f,{children:[`Kitty `,(0,Z.jsx)(f,{dimColor:!0,children:`(OSC 99)`})]});case`ghostty`:return(0,Z.jsxs)(f,{children:[`Ghostty `,(0,Z.jsx)(f,{dimColor:!0,children:`(OSC 777)`})]});case`iterm2_with_bell`:return`iTerm2 w/ Bell`;case`notifications_disabled`:return`Disabled`;default:return e}}var Y,X,Z,vn,yn=t((()=>{g(),Y=n(h(),1),X=n(h(),1),vt(),o(),Je(),B(),m(),Be(),S(),R(),$e(),bt(),Mt(),Se(),Pt(),ct(),Lt(),Rt(),on(),O(),fn(),hn(),we(),w(),G(),Bt(),pe(),P(),b(),M(),a(),Ht(),E(),ut(),_e(),Z=y(),vn={auto:`Auto (match terminal)`,dark:`Dark mode`,light:`Light mode`,"dark-daltonized":`Dark mode (colorblind-friendly)`,"light-daltonized":`Light mode (colorblind-friendly)`,"dark-ansi":`Dark mode (ANSI colors only)`,"light-ansi":`Light mode (ANSI colors only)`}}));function bn({title:e,limit:t,maxWidth:n,showTimeInReset:r=!0,extraSubtext:i}){let{utilization:a,resets_at:o}=t;if(a===null)return null;let s=`${Math.floor(a)}% used`,c;return o&&(c=`Resets ${tt(o,!0,r)}`),i&&(c=c?`${i} · ${c}`:i),n>=62?(0,Q.jsxs)(d,{flexDirection:`column`,children:[(0,Q.jsx)(f,{bold:!0,children:e}),(0,Q.jsxs)(d,{flexDirection:`row`,gap:1,children:[(0,Q.jsx)(ie,{ratio:a/100,width:50,fillColor:`rate_limit_fill`,emptyColor:`rate_limit_empty`}),(0,Q.jsx)(f,{children:s})]}),c&&(0,Q.jsx)(f,{dimColor:!0,children:c})]}):(0,Q.jsxs)(d,{flexDirection:`column`,children:[(0,Q.jsxs)(f,{children:[(0,Q.jsx)(f,{bold:!0,children:e}),c&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(f,{children:` `}),(0,Q.jsxs)(f,{dimColor:!0,children:[`· `,c]})]})]}),(0,Q.jsx)(ie,{ratio:a/100,width:n,fillColor:`rate_limit_fill`,emptyColor:`rate_limit_empty`}),(0,Q.jsx)(f,{children:s})]})}function xn(){let[e,t]=(0,wn.useState)(null),[n,r]=(0,wn.useState)(null),[i,a]=(0,wn.useState)(!0),{columns:o}=se(),s=o-2,c=Math.min(s,80),l=Cn.useCallback(async()=>{a(!0),r(null);try{let e=await Wt();t(e)}catch(e){Qe(e);let t=e,n=t.response?.data?ze(t.response.data):void 0;r(n?`Failed to load usage data: ${n}`:`Failed to load usage data`)}finally{a(!1)}},[]);if((0,wn.useEffect)(()=>{l()},[l]),te(`settings:retry`,()=>{l()},{context:`Settings`,isActive:!!n&&!i}),n)return(0,Q.jsxs)(d,{flexDirection:`column`,gap:1,children:[(0,Q.jsxs)(f,{color:`error`,children:[`Error: `,n]}),(0,Q.jsx)(f,{dimColor:!0,children:(0,Q.jsxs)(p,{children:[(0,Q.jsx)(N,{action:`settings:retry`,context:`Settings`,fallback:`r`,description:`retry`}),(0,Q.jsx)(N,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]})})]});if(!e)return(0,Q.jsxs)(d,{flexDirection:`column`,gap:1,children:[(0,Q.jsx)(f,{dimColor:!0,children:`Loading usage data…`}),(0,Q.jsx)(f,{dimColor:!0,children:(0,Q.jsx)(N,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})})]});let u=it(),ee=u===`max`||u===`team`||u===null,ne=[{title:`Current session`,limit:e.five_hour},{title:`Current week (all models)`,limit:e.seven_day},...ee?[{title:`Current week (Sonnet only)`,limit:e.seven_day_sonnet}]:[]];return(0,Q.jsxs)(d,{flexDirection:`column`,gap:1,width:`100%`,children:[ne.some(({limit:e})=>e)||(0,Q.jsx)(f,{dimColor:!0,children:`/usage is only available for subscription plans.`}),ne.map(({title:e,limit:t})=>t&&(0,Q.jsx)(bn,{title:e,limit:t,maxWidth:c},e)),e.extra_usage&&(0,Q.jsx)(Sn,{extraUsage:e.extra_usage,maxWidth:c}),Gt()&&(0,Q.jsx)(qt,{maxWidth:c}),(0,Q.jsx)(f,{dimColor:!0,children:(0,Q.jsx)(N,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})})]})}function Sn({extraUsage:e,maxWidth:t}){let n=it();if(!(n===`pro`||n===`max`))return!1;if(!e.is_enabled)return Ee.isEnabled()?(0,Q.jsxs)(d,{flexDirection:`column`,children:[(0,Q.jsx)(f,{bold:!0,children:Tn}),(0,Q.jsx)(f,{dimColor:!0,children:`Extra usage not enabled · /extra-usage to enable`})]}):null;if(e.monthly_limit===null)return(0,Q.jsxs)(d,{flexDirection:`column`,children:[(0,Q.jsx)(f,{bold:!0,children:Tn}),(0,Q.jsx)(f,{dimColor:!0,children:`Unlimited`})]});if(typeof e.used_credits!=`number`||typeof e.utilization!=`number`)return null;let r=Ne(e.used_credits/100,2),i=Ne(e.monthly_limit/100,2),a=new Date,o=new Date(a.getFullYear(),a.getMonth()+1,1);return(0,Q.jsx)(bn,{title:Tn,limit:{utilization:e.utilization,resets_at:o.toISOString()},showTimeInReset:!1,extraSubtext:`${r} / ${i} spent`,maxWidth:t})}var Cn,wn,Q,Tn,En=t((()=>{Cn=n(h(),1),wn=n(h(),1),je(),j(),rt(),E(),g(),vt(),Ut(),et(),R(),Re(),w(),Kt(),Q=y(),Tn=`Extra usage`}));function Dn({onClose:e,context:t,defaultTab:n}){let[r,i]=(0,On.useState)(n),[a,o]=(0,On.useState)(!1),[s,c]=(0,On.useState)(!1),l=jt(),{rows:u}=At(se()),d=l?u+1:Math.max(15,Math.min(Math.floor(u*.8),30)),[f]=(0,On.useState)(()=>Xt().catch(()=>[]));return Ot(),te(`confirm:no`,()=>{a||e(`Status dialog dismissed`,{display:`system`})},{context:`Settings`,isActive:!a&&!(r===`Config`&&s)}),(0,$.jsx)(v,{color:`permission`,children:(0,$.jsx)(ce,{color:`permission`,selectedTab:r,onTabChange:i,hidden:a,initialHeaderFocused:n!==`Config`,contentHeight:a||l?void 0:d,children:[(0,$.jsx)(oe,{title:`Status`,children:(0,$.jsx)(Qt,{context:t,diagnosticsPromise:f})},`status`),(0,$.jsx)(oe,{title:`Config`,children:(0,$.jsx)(On.Suspense,{fallback:null,children:(0,$.jsx)(gn,{context:t,onClose:e,setTabsHidden:o,onIsSearchModeChange:c,contentHeight:d})})},`config`),(0,$.jsx)(oe,{title:`Usage`,children:(0,$.jsx)(xn,{})},`usage`)]})})}var On,$,kn=t((()=>{h(),On=n(h(),1),vt(),kt(),E(),G(),g(),nn(),yn(),En(),$=y()}));export{kn as n,Dn as t};
@@ -1 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{I as t,P as n,Wt as r,fi as i,t as a}from"./src-CDCSSo0U2.js";import{t as o}from"./jsx-runtime-Bb4Xn-E0.js";import{en as s,ur as c}from"./state-ix0xIunV.js";import{Aw as l,V_ as u,ba as d,cC as f,fx as p,jw as m,px as h,sC as g,xa as _,z_ as v}from"./loadAgentsDir-Clu7Uk6a.js";import{n as y,t as b}from"./cwd-CYmmnQVS.js";import{d as x,p as S}from"./debug-BrXObCdR.js";import{c as C,g as w}from"./settings-Dlp5JTa_.js";import{g as T,n as E,y as D}from"./config-3m_9zSrj.js";import{n as O,r as k}from"./analytics-BotDBGh0.js";import{bn as A}from"./prompt-Bg_1U0gO.js";import{u as j}from"./referral-BlrMpBAV.js";import{n as M,t as N}from"./useExitOnCtrlCDWithKeybindings-CntByfTQ.js";import{n as P,t as F}from"./PermissionDialog-0ya1CU5k.js";import{homedir as I}from"os";var L=e(i(),1),R=o();a(),s(),y(),S(),O(),T(),f(),j(),p(),u(),N(),P(),w(),A(),_(),m();function z(e){if(e===null||e.disableAllHooks)return!1;if(e.statusLine||e.fileSuggestion)return!0;if(!e.hooks)return!1;for(let t of Object.values(e.hooks))if(t.length>0)return!0;return!1}function B(){let e=[];return z(C(`projectSettings`))&&e.push(`.claude/settings.json`),z(C(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function V(e){return e.some(e=>e.ruleBehavior===`allow`&&(e.ruleValue.toolName===`Bash`||e.ruleValue.toolName.startsWith(`Bash(`)))}function H(){let e=[];return V(l(`projectSettings`))&&e.push(`.claude/settings.json`),V(l(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function U(e){return!!e?.otelHeadersHelper}function W(){let e=[];return U(C(`projectSettings`))&&e.push(`.claude/settings.json`),U(C(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function G(e){return!!e?.apiKeyHelper}function K(){let e=[];return G(C(`projectSettings`))&&e.push(`.claude/settings.json`),G(C(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function q(e){return!!(e?.awsAuthRefresh||e?.awsCredentialExport)}function J(){let e=[];return q(C(`projectSettings`))&&e.push(`.claude/settings.json`),q(C(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function Y(e){return!!e?.gcpAuthRefresh}function X(){let e=[];return Y(C(`projectSettings`))&&e.push(`.claude/settings.json`),Y(C(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function Z(e){return e?.env?Object.keys(e.env).some(e=>!d.has(e.toUpperCase())):!1}function Q(){let e=[];return Z(C(`projectSettings`))&&e.push(`.claude/settings.json`),Z(C(`localSettings`))&&e.push(`.claude/settings.local.json`),e}A();function $({onDone:e,commands:i}){let{servers:a}=v(`project`),o=Object.keys(a).length>0,s=B().length>0,l=H(),u=K().length>0,d=J().length>0,f=X().length>0,p=W().length>0,m=Q().length>0,_=i?.some(e=>e.type===`prompt`&&e.loadedFrom===`commands_DEPRECATED`&&(e.source===`projectSettings`||e.source===`localSettings`)&&e.allowedTools?.some(e=>e===`Bash`||e.startsWith(`Bash(`)))??!1,y=i?.some(e=>e.type===`prompt`&&(e.loadedFrom===`skills`||e.loadedFrom===`plugin`)&&(e.source===`projectSettings`||e.source===`localSettings`||e.source===`plugin`)&&e.allowedTools?.some(e=>e===`Bash`||e.startsWith(`Bash(`)))??!1,S=l.length>0||_||y,C=E(),[w,T]=L.useState(null);L.useEffect(()=>{if(w!==null){let e=w,t=setTimeout(()=>g(e));return()=>clearTimeout(t)}},[w]),L.useEffect(()=>{k(`tengu_trust_dialog_shown`,{isHomeDir:I()===b(),hasMcpServers:o,hasHooks:s,hasBashExecution:S,hasApiKeyHelper:u,hasAwsCommands:d,hasGcpCommands:f,hasOtelHeadersHelper:p,hasDangerousEnvVars:m})},[o,s,S,u,d,f,p,m]);function O(t){if(t===`exit`){T(1);return}let n=I()===b();k(`tengu_trust_dialog_accept`,{isHomeDir:n,hasMcpServers:o,hasHooks:s,hasBashExecution:S,hasApiKeyHelper:u,hasAwsCommands:d,hasGcpCommands:f,hasOtelHeadersHelper:p,hasDangerousEnvVars:m}),n?c(!0):D(e=>({...e,hasTrustDialogAccepted:!0})),e()}let A=M(()=>T(1));return r(`confirm:no`,()=>{T(0)},{context:`Confirmation`}),w===null?C?(setTimeout(e),null):(0,R.jsx)(F,{color:`warning`,titleColor:`warning`,title:`Accessing workspace:`,children:(0,R.jsxs)(t,{flexDirection:`column`,gap:1,paddingTop:1,children:[(0,R.jsx)(n,{bold:!0,children:x().cwd()}),(0,R.jsx)(n,{children:`Is this a project you trust? (Your own code, a well-known open source project, or work from your team).`}),(0,R.jsx)(n,{children:`Once trusted, Work Mate can read, edit, and run commands in this folder.`}),(0,R.jsx)(h,{options:[{label:`Yes, I trust this folder`,value:`enable_all`},{label:`No, exit`,value:`exit`}],onChange:e=>O(e),onCancel:()=>O(`exit`)}),(0,R.jsx)(n,{dimColor:!0,children:A.pending?(0,R.jsxs)(R.Fragment,{children:[`Press `,A.keyName,` again to exit`]}):(0,R.jsx)(R.Fragment,{children:`Enter to confirm · Esc to cancel`})})]})}):null}export{$ as TrustDialog};
@@ -1,103 +0,0 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,o as r}from"./envUtils-DSxRz_kt.js";import{n as i,t as a}from"./figures-5ThXQEtq.js";import{C as o,D as s,I as c,P as l,T as u,Wt as d,di as f,fi as p,t as m,ui as h,y as g}from"./src-CDCSSo0U2.js";import{t as _}from"./jsx-runtime-Bb4Xn-E0.js";import{$d as v,Af as y,Ah as b,Bc as x,Bg as S,Bh as ee,Cf as C,Ef as te,Fb as ne,Fx as re,Gw as ie,Hd as ae,Hn as oe,Jo as se,KS as ce,Kd as le,ME as ue,Mf as de,NE as fe,Nb as pe,Nf as me,O_ as he,Oh as ge,Px as _e,Qd as ve,So as ye,Sx as w,Tf as be,UD as xe,US as Se,Ud as Ce,Uh as we,Un as Te,Vc as Ee,Vg as De,Vh as Oe,WD as ke,WS as Ae,Wn as je,Ww as Me,Xd as Ne,Xu as Pe,Yu as Fe,ZT as Ie,Zd as Le,_C as Re,_u as ze,at as Be,bf as Ve,c as He,dv as Ue,ef as We,et as Ge,gC as Ke,jf as qe,k_ as Je,kh as Ye,l as Xe,lh as Ze,mx as Qe,nt as $e,o as et,of as tt,px as nt,qd as rt,r as it,s as at,sf as ot,sh as st,st as ct,t as lt,uv as ut,vu as dt,wf as ft,xx as T,yf as pt,zo as mt}from"./loadAgentsDir-Clu7Uk6a.js";import{n as ht,t as gt}from"./cwd-CYmmnQVS.js";import{C as _t,G as vt,I as yt,Q as bt,S as xt,W as St,z as Ct}from"./debug-BrXObCdR.js";import{Q as wt,Qt as Tt,_n as Et,ct as Dt,dn as Ot,en as kt,gn as At,ln as jt,lt as Mt,nt as Nt}from"./settings-Dlp5JTa_.js";import{I as Pt,P as Ft}from"./config-3m_9zSrj.js";import{o as It,s as Lt}from"./log-BMCygSzM.js";import{n as Rt,r as zt}from"./analytics-BotDBGh0.js";import{T as Bt,b as Vt}from"./startupProfiler-xa3NmN7Z.js";import{l as Ht,n as Ut,o as Wt}from"./stringUtils-DGLPkqJ4.js";import{Tn as Gt,wn as Kt}from"./prompt-Bg_1U0gO.js";import{st as qt}from"./rcDebugLog-VKwMl0yg.js";import{u as E}from"./referral-BlrMpBAV.js";import{r as Jt,t as Yt}from"./TungstenTool-CxMQVCuF.js";import{a as Xt,i as Zt,n as Qt,o as $t,r as en,t as tn}from"./agentDisplay-BuSReYxu.js";import{n as nn,t as rn}from"./useExitOnCtrlCDWithKeybindings-CntByfTQ.js";import{n as an,t as on}from"./useMergedTools-DfchLQZC.js";import{n as sn,r as cn,t as ln}from"./promptEditor-BhYDmwdS.js";import{n as un,t as dn}from"./useMainLoopModel-DHkRIgNs.js";import{join as D}from"path";import{mkdir as fn,open as pn,unlink as mn}from"fs/promises";var O,hn=e((()=>{O={FOLDER_NAME:`.claude`,AGENTS_DIR:`agents`}}));function gn(e,t,n,r,i,a,o){return`---
2
- name: ${e}
3
- description: "${t.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`).replace(/\n/g,`\\\\n`)}"${n===void 0||n.length===1&&n[0]===`*`?``:`\ntools: ${n.join(`, `)}`}${a?`\nmodel: ${a}`:``}${i?`\ncolor: ${i}`:``}${o?`\nmemory: ${o}`:``}
4
- ---
5
-
6
- ${r}
7
- `}function _n(e){switch(e){case`flagSettings`:throw Error(`Cannot get directory path for ${e} agents`);case`userSettings`:return D(n(),O.AGENTS_DIR);case`projectSettings`:return D(gt(),O.FOLDER_NAME,O.AGENTS_DIR);case`policySettings`:return D(Tt(),O.FOLDER_NAME,O.AGENTS_DIR);case`localSettings`:return D(gt(),O.FOLDER_NAME,O.AGENTS_DIR)}}function vn(e){switch(e){case`projectSettings`:return D(`.`,O.FOLDER_NAME,O.AGENTS_DIR);default:return _n(e)}}function yn(e){return D(_n(e.source),`${e.agentType}.md`)}function bn(e){if(e.source===`built-in`)return`Built-in`;if(e.source===`plugin`)throw Error(`Cannot get file path for plugin agents`);return D(_n(e.source),`${e.filename||e.agentType}.md`)}function xn(e){return e.source===`built-in`?`Built-in`:D(vn(e.source),`${e.agentType}.md`)}function Sn(e){return at(e)?`Built-in`:Xe(e)?`Plugin: ${e.plugin||`Unknown`}`:e.source===`flagSettings`?`CLI argument`:D(vn(e.source),`${e.filename||e.agentType}.md`)}async function Cn(e){let t=_n(e);return await fn(t,{recursive:!0}),t}async function wn(e,t,n,r,i,a=!0,o,s,c){if(e===`built-in`)throw Error(`Cannot save built-in agents`);await Cn(e);let l=yn({source:e,agentType:t}),u=gn(t,n,r,i,o,s,c);try{await Dn(l,u,a?`wx`:`w`)}catch(e){throw yt(e)===`EEXIST`?Error(`Agent file already exists: ${l}`):e}}async function Tn(e,t,n,r,i,a,o){if(e.source===`built-in`)throw Error(`Cannot update built-in agents`);await Dn(bn(e),gn(e.agentType,t,n,r,i,a,o))}async function En(e){if(e.source===`built-in`)throw Error(`Cannot delete built-in agents`);let t=bn(e);try{await mn(t)}catch(e){if(yt(e)!==`ENOENT`)throw e}}async function Dn(e,t,n=`w`){let r=await pn(e,n);try{await r.writeFile(t,{encoding:`utf-8`}),await r.datasync()}finally{await r.close()}}var On=e((()=>{kt(),et(),ht(),r(),Ct(),hn()}));function kn({agent:e,tools:t,onBack:n}){let r=b(e,t,!1),i=Sn(e),o=ve(e.agentType);d(`confirm:no`,n,{context:`Confirmation`});let s=e=>{e.key===`return`&&(e.preventDefault(),n())};function u(){return r.hasWildcard?(0,k.jsx)(l,{children:`All tools`}):!e.tools||e.tools.length===0?(0,k.jsx)(l,{children:`None`}):(0,k.jsxs)(k.Fragment,{children:[r.validTools.length>0&&(0,k.jsx)(l,{children:r.validTools.join(`, `)}),r.invalidTools.length>0&&(0,k.jsxs)(l,{color:`warning`,children:[a.warning,` Unrecognized: `,r.invalidTools.join(`, `)]})]})}return(0,k.jsxs)(c,{flexDirection:`column`,gap:1,tabIndex:0,autoFocus:!0,onKeyDown:s,children:[(0,k.jsx)(l,{dimColor:!0,children:i}),(0,k.jsxs)(c,{flexDirection:`column`,children:[(0,k.jsxs)(l,{children:[(0,k.jsx)(l,{bold:!0,children:`Description`}),` (tells Claude when to use this agent):`]}),(0,k.jsx)(c,{marginLeft:2,children:(0,k.jsx)(l,{children:e.whenToUse})})]}),(0,k.jsxs)(c,{children:[(0,k.jsxs)(l,{children:[(0,k.jsx)(l,{bold:!0,children:`Tools`}),`:`,` `]}),u()]}),(0,k.jsxs)(l,{children:[(0,k.jsx)(l,{bold:!0,children:`Model`}),`: `,ee(e.model)]}),e.permissionMode&&(0,k.jsxs)(l,{children:[(0,k.jsx)(l,{bold:!0,children:`Permission mode`}),`: `,e.permissionMode]}),e.memory&&(0,k.jsxs)(l,{children:[(0,k.jsx)(l,{bold:!0,children:`Memory`}),`: `,oe(e.memory)]}),e.hooks&&Object.keys(e.hooks).length>0&&(0,k.jsxs)(l,{children:[(0,k.jsx)(l,{bold:!0,children:`Hooks`}),`: `,Object.keys(e.hooks).join(`, `)]}),e.skills&&e.skills.length>0&&(0,k.jsxs)(l,{children:[(0,k.jsx)(l,{bold:!0,children:`Skills`}),`:`,` `,e.skills.length>10?`${e.skills.length} skills`:e.skills.join(`, `)]}),o&&(0,k.jsx)(c,{children:(0,k.jsxs)(l,{children:[(0,k.jsx)(l,{bold:!0,children:`Color`}),`:`,` `,(0,k.jsxs)(l,{backgroundColor:o,color:`inverseText`,children:[` `,e.agentType,` `]})]})}),!at(e)&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(c,{children:(0,k.jsxs)(l,{children:[(0,k.jsx)(l,{bold:!0,children:`System prompt`}),`:`]})}),(0,k.jsx)(c,{marginLeft:2,marginRight:2,children:(0,k.jsx)(st,{children:e.getSystemPrompt()})})]})]})}var k,An=e((()=>{i(),p(),m(),E(),v(),Te(),Ye(),et(),we(),Ze(),On(),k=_()}));function jn({agentName:e,currentColor:t=`automatic`,onConfirm:n}){let[r,i]=(0,Mn.useState)(Math.max(0,Nn.indexOf(t))),o=e=>{if(e.key===`up`)e.preventDefault(),i(e=>e>0?e-1:Nn.length-1);else if(e.key===`down`)e.preventDefault(),i(e=>e<Nn.length-1?e+1:0);else if(e.key===`return`){e.preventDefault();let t=Nn[r];n(t===`automatic`?void 0:t)}},s=Nn[r];return(0,A.jsxs)(c,{flexDirection:`column`,gap:1,tabIndex:0,autoFocus:!0,onKeyDown:o,children:[(0,A.jsx)(c,{flexDirection:`column`,children:Nn.map((e,t)=>{let n=t===r;return(0,A.jsxs)(c,{flexDirection:`row`,gap:1,children:[(0,A.jsx)(l,{color:n?`suggestion`:void 0,children:n?a.pointer:` `}),e===`automatic`?(0,A.jsx)(l,{bold:n,children:`Automatic color`}):(0,A.jsxs)(c,{gap:1,children:[(0,A.jsx)(l,{backgroundColor:Le[e],color:`inverseText`,children:` `}),(0,A.jsx)(l,{bold:n,children:Ut(e)})]})]},e)})}),(0,A.jsxs)(c,{marginTop:1,children:[(0,A.jsx)(l,{children:`Preview: `}),s===void 0||s===`automatic`?(0,A.jsxs)(l,{inverse:!0,bold:!0,children:[` `,`@`,e,` `]}):(0,A.jsxs)(l,{backgroundColor:Le[s],color:`inverseText`,bold:!0,children:[` `,`@`,e,` `]})]})]})}var Mn,A,Nn,Pn=e((()=>{i(),Mn=t(p(),1),m(),v(),Wt(),A=_(),Nn=[`automatic`,...Ne]}));function Fn({initialModel:e,onComplete:t,onCancel:n}){let r=In.useMemo(()=>{let t=Oe();return e&&!t.some(t=>t.value===e)?[{value:e,label:e,description:`Current model (custom ID)`},...t]:t},[e]);return(0,Ln.jsxs)(c,{flexDirection:`column`,children:[(0,Ln.jsx)(c,{marginBottom:1,children:(0,Ln.jsx)(l,{dimColor:!0,children:`Model determines the agent's reasoning capabilities and speed.`})}),(0,Ln.jsx)(nt,{options:r,defaultValue:e??`sonnet`,onChange:t,onCancel:()=>n?n():t(void 0)})]})}var In,Ln,Rn=e((()=>{In=t(p(),1),m(),we(),Qe(),Ln=_()}));function zn(){return{READ_ONLY:{name:`Read-only tools`,toolNames:new Set([C.name,be.name,ae.name,x.name,Ke.name,tt.name,le.name,ut.name,S.name])},EDIT:{name:`Edit tools`,toolNames:new Set([de.name,y.name,pt.name])},EXECUTION:{name:`Execution tools`,toolNames:new Set([ze.name,process.env.USER_TYPE===`ant`?Yt.name:void 0].filter(e=>e!==void 0))},MCP:{name:`MCP tools`,toolNames:new Set,isMcp:!0},OTHER:{name:`Other tools`,toolNames:new Set}}}function Bn(e){let t=new Map;return e.forEach(e=>{if(Je(e)){let n=Mt(e.name);if(n?.serverName){let r=t.get(n.serverName)||[];r.push(e),t.set(n.serverName,r)}}}),Array.from(t.entries()).map(([e,t])=>({serverName:e,tools:t})).sort((e,t)=>e.serverName.localeCompare(t.serverName))}function Vn({tools:e,initialTools:t,onComplete:n,onCancel:r}){let i=(0,j.useMemo)(()=>ge({tools:e,isBuiltIn:!1,isAsync:!1}),[e]),[s,u]=(0,j.useState)(!t||t.includes(`*`)?i.map(e=>e.name):t),[f,p]=(0,j.useState)(0),[m,h]=(0,j.useState)(!1),g=(0,j.useMemo)(()=>{let e=new Set(i.map(e=>e.name));return s.filter(t=>e.has(t))},[s,i]),_=new Set(g),v=g.length===i.length&&i.length>0,y=e=>{e&&u(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},b=(e,t)=>{u(n=>{if(t){let t=e.filter(e=>!n.includes(e));return[...n,...t]}else return n.filter(t=>!e.includes(t))})},x=()=>{let e=i.map(e=>e.name);n(g.length===e.length&&e.every(e=>g.includes(e))?void 0:g)},S=(0,j.useMemo)(()=>{let e=zn(),t={readOnly:[],edit:[],execution:[],mcp:[],other:[]};return i.forEach(n=>{Je(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=At(e,e=>_.has(e.name))<e.length;return()=>{let n=e.map(e=>e.name);b(n,t)}},C=[];C.push({id:`continue`,label:`Continue`,action:x,isContinue:!0}),C.push({id:`bucket-all`,label:`${v?a.checkboxOn:a.checkboxOff} All tools`,action:()=>{let e=i.map(e=>e.name);b(e,!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=At(n,e=>_.has(e.name))===n.length;C.push({id:e,label:`${r?a.checkboxOn:a.checkboxOff} ${t}`,action:ee(n)})});let ne=C.length;C.push({id:`toggle-individual`,label:m?`Hide advanced options`:`Show advanced options`,action:()=>{h(!m),m&&f>ne&&p(ne)},isToggle:!0});let re=(0,j.useMemo)(()=>Bn(i),[i]);return m&&(re.length>0&&(C.push({id:`mcp-servers-header`,label:`MCP Servers:`,action:()=>{},isHeader:!0}),re.forEach(({serverName:e,tools:t})=>{let n=At(t,e=>_.has(e.name))===t.length;C.push({id:`mcp-server-${e}`,label:`${n?a.checkboxOn:a.checkboxOff} ${e} (${t.length} ${Ht(t.length,`tool`)})`,action:()=>{let e=t.map(e=>e.name);b(e,!n)}})}),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=Mt(e.name);t=n?`${n.toolName} (${n.serverName})`:e.name}C.push({id:`tool-${e.name}`,label:`${_.has(e.name)?a.checkboxOn:a.checkboxOff} ${t}`,action:()=>y(e.name)})})),d(`confirm:no`,(0,j.useCallback)(()=>{r?r():n(t)},[r,n,t]),{context:`Confirmation`}),(0,M.jsxs)(c,{flexDirection:`column`,marginTop:1,tabIndex:0,autoFocus:!0,onKeyDown:e=>{if(e.key===`return`){e.preventDefault();let t=C[f];t&&!t.isHeader&&t.action()}else if(e.key===`up`){e.preventDefault();let t=f-1;for(;t>0&&C[t]?.isHeader;)t--;p(Math.max(0,t))}else if(e.key===`down`){e.preventDefault();let t=f+1;for(;t<C.length-1&&C[t]?.isHeader;)t++;p(Math.min(C.length-1,t))}},children:[(0,M.jsxs)(l,{color:f===0?`suggestion`:void 0,bold:f===0,children:[f===0?`${a.pointer} `:` `,`[ Continue ]`]}),(0,M.jsx)(o,{width:40}),C.slice(1).map((e,t)=>{let n=t+1===f,r=e.isToggle,i=e.isHeader;return(0,M.jsxs)(j.Fragment,{children:[r&&(0,M.jsx)(o,{width:40}),i&&t>0&&(0,M.jsx)(c,{marginTop:1}),(0,M.jsxs)(l,{color:i?void 0:n?`suggestion`:void 0,dimColor:i,bold:r&&n,children:[i?``:n?`${a.pointer} `:` `,r?`[ ${e.label} ]`:e.label]})]},e.id)}),(0,M.jsx)(c,{marginTop:1,flexDirection:`column`,children:(0,M.jsx)(l,{dimColor:!0,children:v?`All tools selected`:`${_.size} of ${i.length} tools selected`})})]})}var j,M,Hn=e((()=>{i(),j=t(p(),1),Dt(),he(),Ye(),Nt(),dt(),Ce(),me(),Ee(),qe(),ft(),te(),Ue(),Ve(),De(),rt(),ot(),Re(),Jt(),m(),E(),Et(),Wt(),M=_()}));function Un(e){return e===`all`?`Agents`:e===`built-in`?`Built-in agents`:e===`plugin`?`Plugin agents`:xe(jt(e))}var Wn=e((()=>{ke(),Ot()}));function Gn({agent:e,tools:t,onSaved:n,onBack:r}){let i=ce(),[o,s]=(0,N.useState)(`menu`),[u,f]=(0,N.useState)(0),[p,m]=(0,N.useState)(null),[g,_]=(0,N.useState)(e.color),v=(0,N.useCallback)(async()=>{let t=await ln(bn(e));t.error?m(t.error):n(`Opened ${e.agentType} in editor. If you made edits, restart to load the latest version.`)},[e,n]),y=(0,N.useCallback)(async(t={})=>{let{tools:r,color:a,model:o}=t,s=a??g,c=r!==void 0,l=o!==void 0,u=s!==e.color;if(!c&&!l&&!u)return!1;try{return!He(e)&&!Xe(e)?!1:(await Tn(e,e.whenToUse,r??e.tools,e.getSystemPrompt(),s,o??e.model),u&&s&&We(e.agentType,s),i(t=>{let n=t.agentDefinitions.allAgents.map(t=>t.agentType===e.agentType?{...t,tools:r??t.tools,color:s,model:o??t.model}:t);return{...t,agentDefinitions:{...t.agentDefinitions,activeAgents:it(n),allAgents:n}}}),n(`Updated agent: ${h.bold(e.agentType)}`),!0)}catch(e){return m(e instanceof Error?e.message:`Failed to save agent`),!1}},[e,g,n,i]),b=(0,N.useMemo)(()=>[{label:`Open in editor`,action:v},{label:`Edit tools`,action:()=>s(`edit-tools`)},{label:`Edit model`,action:()=>s(`edit-model`)},{label:`Edit color`,action:()=>s(`edit-color`)}],[v]),x=(0,N.useCallback)(()=>{m(null),o===`menu`?r():s(`menu`)},[o,r]),S=(0,N.useCallback)(e=>{if(e.key===`up`)e.preventDefault(),f(e=>Math.max(0,e-1));else if(e.key===`down`)e.preventDefault(),f(e=>Math.min(b.length-1,e+1));else if(e.key===`return`){e.preventDefault();let t=b[u];t&&t.action()}},[b,u]);d(`confirm:no`,x,{context:`Confirmation`});let ee=()=>(0,P.jsxs)(c,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:S,children:[(0,P.jsxs)(l,{dimColor:!0,children:[`Source: `,Un(e.source)]}),(0,P.jsx)(c,{marginTop:1,flexDirection:`column`,children:b.map((e,t)=>(0,P.jsxs)(l,{color:t===u?`suggestion`:void 0,children:[t===u?`${a.pointer} `:` `,e.label]},e.label))}),p&&(0,P.jsx)(c,{marginTop:1,children:(0,P.jsx)(l,{color:`error`,children:p})})]});switch(o){case`menu`:return ee();case`edit-tools`:return(0,P.jsx)(Vn,{tools:t,initialTools:e.tools,onComplete:async e=>{s(`menu`),await y({tools:e})}});case`edit-color`:return(0,P.jsx)(jn,{agentName:e.agentType,currentColor:g||e.color||`automatic`,onConfirm:async e=>{_(e),s(`menu`),await y({color:e})}});case`edit-model`:return(0,P.jsx)(Fn,{initialModel:e.model,onComplete:async e=>{s(`menu`),await y({model:e})}});default:return null}}var N,P,Kn=e((()=>{f(),i(),p(),N=t(p(),1),Se(),m(),E(),v(),et(),cn(),On(),Pn(),Rn(),Hn(),Wn(),P=_()}));function qn({instructions:e=`Press ↑↓ to navigate · Enter to select · Esc to go back`}){let t=nn();return(0,Jn.jsx)(c,{marginLeft:2,children:(0,Jn.jsx)(l,{dimColor:!0,children:t.pending?`Press ${t.keyName} again to exit`:e})})}var Jn,Yn=e((()=>{p(),rn(),m(),Jn=_()}));function Xn({source:e,agents:t,onBack:n,onSelect:r,onCreateNew:i,changes:s}){let[u,d]=F.useState(null),[f,p]=F.useState(!0),m=F.useMemo(()=>[...t].sort(Qt),[t]),h=e=>({isOverridden:!!e.overriddenBy,overriddenBy:e.overriddenBy||null}),_=()=>(0,I.jsxs)(c,{children:[(0,I.jsx)(l,{color:f?`suggestion`:void 0,children:f?`${a.pointer} `:` `}),(0,I.jsx)(l,{color:f?`suggestion`:void 0,children:`Create new agent`})]}),v=e=>{let t=e.source===`built-in`,n=!t&&!f&&u?.agentType===e.agentType&&u?.source===e.source,{isOverridden:r,overriddenBy:i}=h(e),o=t||r,s=!t&&n?`suggestion`:void 0,d=Xt(e);return(0,I.jsxs)(c,{children:[(0,I.jsx)(l,{dimColor:o&&!n,color:s,children:t?``:n?`${a.pointer} `:` `}),(0,I.jsx)(l,{dimColor:o&&!n,color:s,children:e.agentType}),d&&(0,I.jsxs)(l,{dimColor:!0,color:s,children:[` · `,d]}),e.memory&&(0,I.jsxs)(l,{dimColor:!0,color:s,children:[` · `,e.memory,` memory`]}),i&&(0,I.jsxs)(l,{dimColor:!n,color:n?`warning`:void 0,children:[` `,a.warning,` shadowed by `,en(i)]})]},`${e.agentType}-${e.source}`)},y=F.useMemo(()=>{let t=m.filter(e=>e.source!==`built-in`);return e===`all`?tn.filter(e=>e.source!==`built-in`).flatMap(({source:e})=>t.filter(t=>t.source===e)):t},[m,e]);F.useEffect(()=>{!u&&!f&&y.length>0&&(i?p(!0):d(y[0]||null))},[y,u,f,i]);let b=e=>{if(e.key===`return`){e.preventDefault(),f&&i?i():u&&r(u);return}if(e.key!==`up`&&e.key!==`down`)return;e.preventDefault();let t=!!i,n=y.length+ +!!t;if(n===0)return;let a=0;if(!f&&u){let e=y.findIndex(e=>e.agentType===u.agentType&&e.source===u.source);e>=0&&(a=t?e+1:e)}let o=e.key===`up`?a===0?n-1:a-1:a===n-1?0:a+1;if(t&&o===0)p(!0),d(null);else{let e=t?o-1:o,n=y[e];n&&(p(!1),d(n))}},x=(e=`Built-in (always available):`)=>{let t=m.filter(e=>e.source===`built-in`);return(0,I.jsxs)(c,{flexDirection:`column`,marginBottom:1,paddingLeft:2,children:[(0,I.jsx)(l,{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)(c,{flexDirection:`column`,marginBottom:1,children:[(0,I.jsxs)(c,{paddingLeft:2,children:[(0,I.jsx)(l,{bold:!0,dimColor:!0,children:e}),n&&(0,I.jsxs)(l,{dimColor:!0,children:[` (`,n,`)`]})]}),t.map(e=>v(e))]})},ee=Un(e),C=m.filter(e=>e.source===`built-in`);return!m.length||e!==`built-in`&&!m.some(e=>e.source!==`built-in`)?(0,I.jsx)(g,{title:ee,subtitle:`No agents found`,onCancel:n,hideInputGuide:!0,children:(0,I.jsxs)(c,{flexDirection:`column`,gap:1,tabIndex:0,autoFocus:!0,onKeyDown:b,children:[i&&(0,I.jsx)(c,{children:_()}),(0,I.jsx)(l,{dimColor:!0,children:`No agents found. Create specialized subagents that Claude can delegate to.`}),(0,I.jsx)(l,{dimColor:!0,children:`Each subagent has its own context window, custom system prompt, and specific tools.`}),(0,I.jsx)(l,{dimColor:!0,children:`Try creating: Code Reviewer, Code Simplifier, Security Reviewer, Tech Lead, or UX Reviewer.`}),e!==`built-in`&&m.some(e=>e.source===`built-in`)&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(o,{}),x()]})]})}):(0,I.jsxs)(g,{title:ee,subtitle:`${At(m,e=>!e.overriddenBy)} agents`,onCancel:n,hideInputGuide:!0,children:[s&&s.length>0&&(0,I.jsx)(c,{marginTop:1,children:(0,I.jsx)(l,{dimColor:!0,children:s[s.length-1]})}),(0,I.jsxs)(c,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:b,children:[i&&(0,I.jsx)(c,{marginBottom:1,children:_()}),e===`all`?(0,I.jsxs)(I.Fragment,{children:[tn.filter(e=>e.source!==`built-in`).map(({label:e,source:t})=>(0,I.jsx)(F.Fragment,{children:S(e,m.filter(e=>e.source===t))},t)),C.length>0&&(0,I.jsxs)(c,{flexDirection:`column`,marginBottom:1,paddingLeft:2,children:[(0,I.jsxs)(l,{dimColor:!0,children:[(0,I.jsx)(l,{bold:!0,children:`Built-in agents`}),` (always available)`]}),C.map(v)]})]}):e===`built-in`?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(l,{dimColor:!0,italic:!0,children:`Built-in agents are provided by default and cannot be modified.`}),(0,I.jsx)(c,{marginTop:1,flexDirection:`column`,children:m.map(e=>v(e))})]}):(0,I.jsxs)(I.Fragment,{children:[m.filter(e=>e.source!==`built-in`).map(e=>v(e)),m.some(e=>e.source===`built-in`)&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(o,{}),x()]})]})]})]})}var F,I,Zn=e((()=>{i(),F=t(p(),1),m(),Zt(),Et(),Wn(),I=_()}));function Qn({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)([]);nn(),(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,$n.jsx)(er.Provider,{value:b,children:i||(0,$n.jsx)(x,{})})}var L,$n,er,tr=e((()=>{L=t(p(),1),rn(),$n=_(),er=(0,L.createContext)(null)}));function R(){let e=(0,nr.useContext)(er);if(!e)throw Error(`useWizard must be used within a WizardProvider`);return e}var nr,rr=e((()=>{nr=t(p(),1),tr()}));function ir({instructions:e=(0,z.jsxs)(u,{children:[(0,z.jsx)(s,{shortcut:`↑↓`,action:`navigate`}),(0,z.jsx)(s,{shortcut:`Enter`,action:`select`}),(0,z.jsx)(T,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]})}){let t=nn();return(0,z.jsx)(c,{marginLeft:3,marginTop:1,children:(0,z.jsx)(l,{dimColor:!0,children:t.pending?`Press ${t.keyName} again to exit`:e})})}var z,ar=e((()=>{rn(),m(),w(),z=_()}));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,or.jsxs)(or.Fragment,{children:[(0,or.jsx)(g,{title:`${e||s||`Wizard`}${c===!1?``:` (${a+1}/${o})`}`,subtitle:r,onCancel:l,color:t,hideInputGuide:!0,isCancelActive:!1,children:n}),(0,or.jsx)(ir,{instructions:i})]})}var or,V=e((()=>{m(),rr(),ar(),or=_()})),H=e((()=>{rr(),V(),ar(),tr()}));function sr(){let{goNext:e,goBack:t,updateWizardData:n,wizardData:r}=R();return d(`confirm:no`,t,{context:`Confirmation`}),(0,U.jsx)(B,{subtitle:`Choose background color`,footerText:(0,U.jsxs)(u,{children:[(0,U.jsx)(s,{shortcut:`↑↓`,action:`navigate`}),(0,U.jsx)(s,{shortcut:`Enter`,action:`select`}),(0,U.jsx)(T,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:(0,U.jsx)(c,{children:(0,U.jsx)(jn,{agentName:r.agentType||`agent`,currentColor:`automatic`,onConfirm:t=>{n({selectedColor:t,finalAgent:{agentType:r.agentType,whenToUse:r.whenToUse,getSystemPrompt:()=>r.systemPrompt,tools:r.selectedTools,...r.selectedModel?{model:r.selectedModel}:{},...t?{color:t}:{},source:r.location}}),e()}})})})}var U,cr=e((()=>{m(),E(),w(),H(),V(),Pn(),U=_()}));function lr(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 ur(e,t,n){let r=[],i=[];if(!e.agentType)r.push(`Agent type is required`);else{let t=lr(e.agentType);t&&r.push(t);let i=n.find(t=>t.agentType===e.agentType&&t.source!==e.source);i&&r.push(`Agent type "${e.agentType}" already exists in ${Un(i.source)}`)}if(e.whenToUse?e.whenToUse.length<10?i.push(`Description should be more descriptive (at least 10 characters)`):e.whenToUse.length>5e3&&i.push(`Description is very long (over 5000 characters)`):r.push(`Description (description) is required`),e.tools!==void 0&&!Array.isArray(e.tools))r.push(`Tools must be an array`);else{e.tools===void 0?i.push(`Agent has access to all tools`):e.tools.length===0&&i.push(`No tools selected - agent will have very limited capabilities`);let n=b(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 dr=e((()=>{Ye(),Wn()}));function fr({tools:e,existingAgents:t,onSave:n,onSaveAndEdit:r,error:i}){let{goBack:a,wizardData:o}=R();d(`confirm:no`,a,{context:`Confirmation`});let f=e=>{e.key===`s`||e.key===`return`?(e.preventDefault(),n()):e.key===`e`&&(e.preventDefault(),r())},p=o.finalAgent,m=ur(p,e,t),h=Bt(p.getSystemPrompt(),240),g=Bt(p.whenToUse,240),_=e=>e===void 0?`All tools`:e.length===0?`None`:e.length===1?e[0]||`None`:e.length===2?e.join(` and `):`${e.slice(0,-1).join(`, `)}, and ${e[e.length-1]}`,v=Pt()?(0,W.jsxs)(l,{children:[(0,W.jsx)(l,{bold:!0,children:`Memory`}),`: `,oe(p.memory)]}):null;return(0,W.jsx)(B,{subtitle:`Confirm and save`,footerText:(0,W.jsxs)(u,{children:[(0,W.jsx)(s,{shortcut:`s/Enter`,action:`save`}),(0,W.jsx)(s,{shortcut:`e`,action:`edit in your editor`}),(0,W.jsx)(T,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]}),children:(0,W.jsxs)(c,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:f,children:[(0,W.jsxs)(l,{children:[(0,W.jsx)(l,{bold:!0,children:`Name`}),`: `,p.agentType]}),(0,W.jsxs)(l,{children:[(0,W.jsx)(l,{bold:!0,children:`Location`}),`:`,` `,xn({source:o.location,agentType:p.agentType})]}),(0,W.jsxs)(l,{children:[(0,W.jsx)(l,{bold:!0,children:`Tools`}),`: `,_(p.tools)]}),(0,W.jsxs)(l,{children:[(0,W.jsx)(l,{bold:!0,children:`Model`}),`: `,ee(p.model)]}),v,(0,W.jsx)(c,{marginTop:1,children:(0,W.jsxs)(l,{children:[(0,W.jsx)(l,{bold:!0,children:`Description`}),` (tells Claude when to use this agent):`]})}),(0,W.jsx)(c,{marginLeft:2,marginTop:1,children:(0,W.jsx)(l,{children:g})}),(0,W.jsx)(c,{marginTop:1,children:(0,W.jsxs)(l,{children:[(0,W.jsx)(l,{bold:!0,children:`System prompt`}),`:`]})}),(0,W.jsx)(c,{marginLeft:2,marginTop:1,children:(0,W.jsx)(l,{children:h})}),m.warnings.length>0&&(0,W.jsxs)(c,{marginTop:1,flexDirection:`column`,children:[(0,W.jsx)(l,{color:`warning`,children:`Warnings:`}),m.warnings.map((e,t)=>(0,W.jsxs)(l,{dimColor:!0,children:[` `,`• `,e]},t))]}),m.errors.length>0&&(0,W.jsxs)(c,{marginTop:1,flexDirection:`column`,children:[(0,W.jsx)(l,{color:`error`,children:`Errors:`}),m.errors.map((e,t)=>(0,W.jsxs)(l,{color:`error`,children:[` `,`• `,e]},t))]}),i&&(0,W.jsx)(c,{marginTop:1,children:(0,W.jsx)(l,{color:`error`,children:i})}),(0,W.jsx)(c,{marginTop:2,children:(0,W.jsxs)(l,{color:`success`,children:[`Press `,(0,W.jsx)(l,{bold:!0,children:`s`}),` or `,(0,W.jsx)(l,{bold:!0,children:`Enter`}),` to save, `,(0,W.jsx)(l,{bold:!0,children:`e`}),` to save and edit`]})})]})})}var W,pr=e((()=>{m(),E(),Ft(),Te(),Vt(),we(),w(),H(),V(),On(),dr(),W=_()}));function mr({tools:e,existingAgents:t,onComplete:n}){let{wizardData:r}=R(),[i,a]=(0,hr.useState)(null),o=ce(),s=(0,hr.useCallback)(async e=>{if(r?.finalAgent)try{await wn(r.location,r.finalAgent.agentType,r.finalAgent.whenToUse,r.finalAgent.tools,r.finalAgent.getSystemPrompt(),!0,r.finalAgent.color,r.finalAgent.model,r.finalAgent.memory),o(e=>{if(!r.finalAgent)return e;let t=e.agentDefinitions.allAgents.concat(r.finalAgent);return{...e,agentDefinitions:{...e.agentDefinitions,activeAgents:it(t),allAgents:t}}}),lt(),e&&await ln(yn({source:r.location,agentType:r.finalAgent.agentType})),zt(`tengu_agent_created`,{agent_type:r.finalAgent.agentType,generation_method:r.wasGenerated?`generated`:`manual`,source:r.location,tool_count:r.finalAgent.tools?.length??`all`,has_custom_model:!!r.finalAgent.model,has_custom_color:!!r.finalAgent.color,has_memory:!!r.finalAgent.memory,memory_scope:r.finalAgent.memory??`none`,...e?{opened_in_editor:!0}:{}}),n(e?`Created agent: ${h.bold(r.finalAgent.agentType)} and opened in editor. If you made edits, restart to load the latest version.`:`Created agent: ${h.bold(r.finalAgent.agentType)}`)}catch(e){a(e instanceof Error?e.message:`Failed to save agent`)}},[r,n,o]);return(0,gr.jsx)(fr,{tools:e,existingAgents:t,onSave:(0,hr.useCallback)(()=>s(!1),[s]),onSaveAndEdit:(0,hr.useCallback)(()=>s(!0),[s]),error:i})}var hr,gr,_r=e((()=>{f(),hr=t(p(),1),Rt(),Se(),et(),cn(),H(),On(),pr(),gr=_()}));function vr(){let{goNext:e,goBack:t,updateWizardData:n,wizardData:r}=R(),[i,a]=(0,yr.useState)(r.whenToUse||``),[o,f]=(0,yr.useState)(i.length),[p,m]=(0,yr.useState)(null);return d(`confirm:no`,t,{context:`Settings`}),d(`chat:externalEditor`,(0,yr.useCallback)(async()=>{let e=await sn(i);e.content!==null&&(a(e.content),f(e.content.length))},[i]),{context:`Chat`}),(0,G.jsx)(B,{subtitle:`Description (tell Claude when to use this agent)`,footerText:(0,G.jsxs)(u,{children:[(0,G.jsx)(s,{shortcut:`Type`,action:`enter text`}),(0,G.jsx)(s,{shortcut:`Enter`,action:`continue`}),(0,G.jsx)(T,{action:`chat:externalEditor`,context:`Chat`,fallback:`ctrl+g`,description:`open in editor`}),(0,G.jsx)(T,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`go back`})]}),children:(0,G.jsxs)(c,{flexDirection:`column`,children:[(0,G.jsx)(l,{children:`When should Claude use this agent?`}),(0,G.jsx)(c,{marginTop:1,children:(0,G.jsx)(_e,{value:i,onChange:a,onSubmit:t=>{let r=t.trim();if(!r){m(`Description is required`);return}m(null),n({whenToUse:r}),e()},placeholder:`e.g., use this agent after you're done writing code...`,columns:80,cursorOffset:o,onChangeCursorOffset:f,focus:!0,showCursor:!0})}),p&&(0,G.jsx)(c,{marginTop:1,children:(0,G.jsx)(l,{color:`error`,children:p})})]})})}var yr,G,br=e((()=>{yr=t(p(),1),m(),E(),cn(),w(),re(),H(),V(),G=_()}));async function xr(e,t,n,r){let i=ye({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 ue(),o=ct([i],a),s=Pt()?Sr+Cr:Sr,c=await $e({messages:se(o),systemPrompt:qt([s]),thinkingConfig:{type:`disabled`},tools:[],signal:r,options:{getToolPermissionContext:async()=>Kt(),model:t,toolChoice:void 0,agents:[],isNonInteractiveSession:!1,hasAppendSystemPrompt:!1,querySource:`agent_creation`,mcpTools:[]}}),l=(Array.isArray(c.message.content)?c.message.content:[]).filter(e=>e.type===`text`).map(e=>e.text).join(`
9
- `),u;try{u=_t(l.trim())}catch{let e=l.match(/\{[\s\S]*\}/);if(!e)throw Error(`No JSON object found in response`);u=_t(e[0])}if(!u.identifier||!u.whenToUse||!u.systemPrompt)throw Error(`Invalid agent configuration generated`);return zt(`tengu_agent_definition_generated`,{agent_identifier:u.identifier}),{identifier:u.identifier,whenToUse:u.whenToUse,systemPrompt:u.systemPrompt}}var Sr,Cr,wr=e((()=>{fe(),Ge(),Gt(),Nt(),Be(),mt(),Ft(),Rt(),xt(),Ie(),Sr=`You are an elite AI agent architect specializing in crafting high-performance agent configurations. Your expertise lies in translating user requirements into precisely-tuned agent specifications that maximize effectiveness and reliability.
10
-
11
- **Important Context**: You may have access to project-specific instructions from CLAUDE.md files and other context that may include coding standards, project structure, and custom requirements. Consider this context when creating agents to ensure they align with the project's established patterns and practices.
12
-
13
- When a user describes what they want an agent to do, you will:
14
-
15
- 1. **Extract Core Intent**: Identify the fundamental purpose, key responsibilities, and success criteria for the agent. Look for both explicit requirements and implicit needs. Consider any project-specific context from CLAUDE.md files. For agents that are meant to review code, you should assume that the user is asking to review recently written code and not the whole codebase, unless the user has explicitly instructed you otherwise.
16
-
17
- 2. **Design Expert Persona**: Create a compelling expert identity that embodies deep domain knowledge relevant to the task. The persona should inspire confidence and guide the agent's decision-making approach.
18
-
19
- 3. **Architect Comprehensive Instructions**: Develop a system prompt that:
20
- - Establishes clear behavioral boundaries and operational parameters
21
- - Provides specific methodologies and best practices for task execution
22
- - Anticipates edge cases and provides guidance for handling them
23
- - Incorporates any specific requirements or preferences mentioned by the user
24
- - Defines output format expectations when relevant
25
- - Aligns with project-specific coding standards and patterns from CLAUDE.md
26
-
27
- 4. **Optimize for Performance**: Include:
28
- - Decision-making frameworks appropriate to the domain
29
- - Quality control mechanisms and self-verification steps
30
- - Efficient workflow patterns
31
- - Clear escalation or fallback strategies
32
-
33
- 5. **Create Identifier**: Design a concise, descriptive identifier that:
34
- - Uses lowercase letters, numbers, and hyphens only
35
- - Is typically 2-4 words joined by hyphens
36
- - Clearly indicates the agent's primary function
37
- - Is memorable and easy to type
38
- - Avoids generic terms like "helper" or "assistant"
39
-
40
- 6 **Example agent descriptions**:
41
- - in the 'whenToUse' field of the JSON object, you should include examples of when this agent should be used.
42
- - examples should be of the form:
43
- - <example>
44
- Context: The user is creating a test-runner agent that should be called after a logical chunk of code is written.
45
- user: "Please write a function that checks if a number is prime"
46
- assistant: "Here is the relevant function: "
47
- <function call omitted for brevity only for this example>
48
- <commentary>
49
- Since a significant piece of code was written, use the ${wt} tool to launch the test-runner agent to run the tests.
50
- </commentary>
51
- assistant: "Now let me use the test-runner agent to run the tests"
52
- </example>
53
- - <example>
54
- Context: User is creating an agent to respond to the word "hello" with a friendly jok.
55
- user: "Hello"
56
- assistant: "I'm going to use the ${wt} tool to launch the greeting-responder agent to respond with a friendly joke"
57
- <commentary>
58
- Since the user is greeting, use the greeting-responder agent to respond with a friendly joke.
59
- </commentary>
60
- </example>
61
- - If the user mentioned or implied that the agent should be used proactively, you should include examples of this.
62
- - NOTE: Ensure that in the examples, you are making the assistant use the Agent tool and not simply respond directly to the task.
63
-
64
- Your output must be a valid JSON object with exactly these fields:
65
- {
66
- "identifier": "A unique, descriptive identifier using lowercase letters, numbers, and hyphens (e.g., 'test-runner', 'api-docs-writer', 'code-formatter')",
67
- "whenToUse": "A precise, actionable description starting with 'Use this agent when...' that clearly defines the triggering conditions and use cases. Ensure you include examples as described above.",
68
- "systemPrompt": "The complete system prompt that will govern the agent's behavior, written in second person ('You are...', 'You will...') and structured for maximum clarity and effectiveness"
69
- }
70
-
71
- Key principles for your system prompts:
72
- - Be specific rather than generic - avoid vague instructions
73
- - Include concrete examples when they would clarify behavior
74
- - Balance comprehensiveness with clarity - every instruction should add value
75
- - Ensure the agent has enough context to handle variations of the core task
76
- - Make the agent proactive in seeking clarification when needed
77
- - Build in quality assurance and self-correction mechanisms
78
-
79
- Remember: The agents you create should be autonomous experts capable of handling their designated tasks with minimal additional guidance. Your system prompts are their complete operational manual.
80
- `,Cr=`
81
-
82
- 7. **Agent Memory Instructions**: If the user mentions "memory", "remember", "learn", "persist", or similar concepts, OR if the agent would benefit from building up knowledge across conversations (e.g., code reviewers learning patterns, architects learning codebase structure, etc.), include domain-specific memory update instructions in the systemPrompt.
83
-
84
- Add a section like this to the systemPrompt, tailored to the agent's specific domain:
85
-
86
- "**Update your agent memory** as you discover [domain-specific items]. This builds up institutional knowledge across conversations. Write concise notes about what you found and where.
87
-
88
- Examples of what to record:
89
- - [domain-specific item 1]
90
- - [domain-specific item 2]
91
- - [domain-specific item 3]"
92
-
93
- Examples of domain-specific memory instructions:
94
- - For a code-reviewer: "Update your agent memory as you discover code patterns, style conventions, common issues, and architectural decisions in this codebase."
95
- - For a test-runner: "Update your agent memory as you discover test patterns, common failure modes, flaky tests, and testing best practices."
96
- - For an architect: "Update your agent memory as you discover codepaths, library locations, key architectural decisions, and component relationships."
97
- - For a documentation writer: "Update your agent memory as you discover documentation patterns, API structures, and terminology conventions."
98
-
99
- The memory instructions should be specific to what the agent would naturally learn while performing its core tasks.
100
- `}));function Tr(){let{updateWizardData:e,goBack:t,goToStep:n,wizardData:r}=R(),[i,a]=(0,K.useState)(r.generationPrompt||``),[o,s]=(0,K.useState)(!1),[f,p]=(0,K.useState)(null),[m,h]=(0,K.useState)(i.length),g=un(),_=(0,K.useRef)(null);d(`confirm:no`,(0,K.useCallback)(()=>{_.current&&(_.current.abort(),_.current=null,s(!1),p(`Generation cancelled`))},[]),{context:`Settings`,isActive:o}),d(`chat:externalEditor`,(0,K.useCallback)(async()=>{let e=await sn(i);e.content!==null&&(a(e.content),h(e.content.length))},[i]),{context:`Chat`,isActive:!o}),d(`confirm:no`,(0,K.useCallback)(()=>{e({generationPrompt:``,agentType:``,systemPrompt:``,whenToUse:``,generatedAgent:void 0,wasGenerated:!1}),a(``),p(null),t()},[e,t]),{context:`Settings`,isActive:!o});let v=async()=>{let t=i.trim();if(!t){p(`Please describe what the agent should do`);return}p(null),s(!0),e({generationPrompt:t,isGenerating:!0});let r=Me();_.current=r;try{let i=await xr(t,g,[],r.signal);e({agentType:i.identifier,whenToUse:i.whenToUse,systemPrompt:i.systemPrompt,generatedAgent:i,isGenerating:!1,wasGenerated:!0}),n(6)}catch(t){t instanceof bt||t instanceof Error&&!t.message.includes(`No assistant message found`)&&p(t.message||`Failed to generate agent`),e({isGenerating:!1})}finally{s(!1),_.current=null}},y=`Describe what this agent should do and when it should be used (be comprehensive for best results)`;return o?(0,q.jsx)(B,{subtitle:y,footerText:(0,q.jsx)(T,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`}),children:(0,q.jsxs)(c,{flexDirection:`row`,alignItems:`center`,children:[(0,q.jsx)(pe,{}),(0,q.jsx)(l,{color:`suggestion`,children:` Generating agent from description...`})]})}):(0,q.jsx)(B,{subtitle:y,footerText:(0,q.jsxs)(u,{children:[(0,q.jsx)(T,{action:`confirm:yes`,context:`Confirmation`,fallback:`Enter`,description:`submit`}),(0,q.jsx)(T,{action:`chat:externalEditor`,context:`Chat`,fallback:`ctrl+g`,description:`open in editor`}),(0,q.jsx)(T,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`go back`})]}),children:(0,q.jsxs)(c,{flexDirection:`column`,children:[f&&(0,q.jsx)(c,{marginBottom:1,children:(0,q.jsx)(l,{color:`error`,children:f})}),(0,q.jsx)(_e,{value:i,onChange:a,onSubmit:v,placeholder:`e.g., Help me write unit tests for my code...`,columns:80,cursorOffset:m,onChangeCursorOffset:h,focus:!0,showCursor:!0})]})})}var K,q,Er=e((()=>{vt(),K=t(p(),1),dn(),m(),E(),ie(),cn(),w(),ne(),re(),H(),V(),wr(),q=_()}));function Dr(){let{goNext:e,updateWizardData:t,cancel:n}=R();return(0,J.jsx)(B,{subtitle:`Choose location`,footerText:(0,J.jsxs)(u,{children:[(0,J.jsx)(s,{shortcut:`↑↓`,action:`navigate`}),(0,J.jsx)(s,{shortcut:`Enter`,action:`select`}),(0,J.jsx)(T,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]}),children:(0,J.jsx)(c,{children:(0,J.jsx)(nt,{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,Or=e((()=>{m(),w(),Qe(),H(),V(),J=_()}));function kr(){let{goNext:e,goBack:t,updateWizardData:n,wizardData:r}=R();d(`confirm:no`,t,{context:`Confirmation`});let i=r.location===`userSettings`?[{label:`User scope (~/.claude/agent-memory/) (Recommended)`,value:`user`},{label:`None (no persistent memory)`,value:`none`},{label:`Project scope (.claude/agent-memory/)`,value:`project`},{label:`Local scope (.claude/agent-memory-local/)`,value:`local`}]:[{label:`Project scope (.claude/agent-memory/) (Recommended)`,value:`project`},{label:`None (no persistent memory)`,value:`none`},{label:`User scope (~/.claude/agent-memory/)`,value:`user`},{label:`Local scope (.claude/agent-memory-local/)`,value:`local`}];return(0,Y.jsx)(B,{subtitle:`Configure agent memory`,footerText:(0,Y.jsxs)(u,{children:[(0,Y.jsx)(s,{shortcut:`↑↓`,action:`navigate`}),(0,Y.jsx)(s,{shortcut:`Enter`,action:`select`}),(0,Y.jsx)(T,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:(0,Y.jsx)(c,{children:(0,Y.jsx)(nt,{options:i,onChange:t=>{let i=t===`none`?void 0:t,a=r.finalAgent?.agentType;n({selectedMemory:i,finalAgent:r.finalAgent?{...r.finalAgent,memory:i,getSystemPrompt:Pt()&&i&&a?()=>r.systemPrompt+`
101
-
102
- `+je(a,i):()=>r.systemPrompt}:void 0}),e()},onCancel:t},`memory-select`)})})}var Y,Ar=e((()=>{m(),E(),Ft(),Te(),w(),Qe(),H(),V(),Y=_()}));function jr(){let{goNext:e,goBack:t,updateWizardData:n,goToStep:r}=R();return(0,X.jsx)(B,{subtitle:`Creation method`,footerText:(0,X.jsxs)(u,{children:[(0,X.jsx)(s,{shortcut:`↑↓`,action:`navigate`}),(0,X.jsx)(s,{shortcut:`Enter`,action:`select`}),(0,X.jsx)(T,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:(0,X.jsx)(c,{children:(0,X.jsx)(nt,{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,Mr=e((()=>{m(),w(),Qe(),H(),V(),X=_()}));function Nr(){let{goNext:e,goBack:t,updateWizardData:n,wizardData:r}=R();return(0,Pr.jsx)(B,{subtitle:`Select model`,footerText:(0,Pr.jsxs)(u,{children:[(0,Pr.jsx)(s,{shortcut:`↑↓`,action:`navigate`}),(0,Pr.jsx)(s,{shortcut:`Enter`,action:`select`}),(0,Pr.jsx)(T,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:(0,Pr.jsx)(Fn,{initialModel:r.selectedModel,onComplete:t=>{n({selectedModel:t}),e()},onCancel:t})})}var Pr,Fr=e((()=>{w(),m(),H(),V(),Rn(),Pr=_()}));function Ir(){let{goNext:e,goBack:t,updateWizardData:n,wizardData:r}=R(),[i,a]=(0,Lr.useState)(r.systemPrompt||``),[o,f]=(0,Lr.useState)(i.length),[p,m]=(0,Lr.useState)(null);return d(`confirm:no`,t,{context:`Settings`}),d(`chat:externalEditor`,(0,Lr.useCallback)(async()=>{let e=await sn(i);e.content!==null&&(a(e.content),f(e.content.length))},[i]),{context:`Chat`}),(0,Z.jsx)(B,{subtitle:`System prompt`,footerText:(0,Z.jsxs)(u,{children:[(0,Z.jsx)(s,{shortcut:`Type`,action:`enter text`}),(0,Z.jsx)(s,{shortcut:`Enter`,action:`continue`}),(0,Z.jsx)(T,{action:`chat:externalEditor`,context:`Chat`,fallback:`ctrl+g`,description:`open in editor`}),(0,Z.jsx)(T,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`go back`})]}),children:(0,Z.jsxs)(c,{flexDirection:`column`,children:[(0,Z.jsx)(l,{children:`Enter the system prompt for your agent:`}),(0,Z.jsx)(l,{dimColor:!0,children:`Be comprehensive for best results`}),(0,Z.jsx)(c,{marginTop:1,children:(0,Z.jsx)(_e,{value:i,onChange:a,onSubmit:()=>{let t=i.trim();if(!t){m(`System prompt is required`);return}m(null),n({systemPrompt:t}),e()},placeholder:`You are a helpful code reviewer who...`,columns:80,cursorOffset:o,onChangeCursorOffset:f,focus:!0,showCursor:!0})}),p&&(0,Z.jsx)(c,{marginTop:1,children:(0,Z.jsx)(l,{color:`error`,children:p})})]})})}var Lr,Z,Rr=e((()=>{Lr=t(p(),1),m(),E(),cn(),w(),re(),H(),V(),Z=_()}));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,Br.jsx)(B,{subtitle:`Select tools`,footerText:(0,Br.jsxs)(u,{children:[(0,Br.jsx)(s,{shortcut:`Enter`,action:`toggle selection`}),(0,Br.jsx)(s,{shortcut:`↑↓`,action:`navigate`}),(0,Br.jsx)(T,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:(0,Br.jsx)(Vn,{tools:e,initialTools:o,onComplete:a,onCancel:n})})}var Br,Vr=e((()=>{m(),w(),H(),V(),Hn(),Br=_()}));function Hr(e){let{goNext:t,goBack:n,updateWizardData:r,wizardData:i}=R(),[a,o]=(0,Ur.useState)(i.agentType||``),[f,p]=(0,Ur.useState)(null),[m,h]=(0,Ur.useState)(a.length);return d(`confirm:no`,n,{context:`Settings`}),(0,Q.jsx)(B,{subtitle:`Agent type (identifier)`,footerText:(0,Q.jsxs)(u,{children:[(0,Q.jsx)(s,{shortcut:`Type`,action:`enter text`}),(0,Q.jsx)(s,{shortcut:`Enter`,action:`continue`}),(0,Q.jsx)(T,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`go back`})]}),children:(0,Q.jsxs)(c,{flexDirection:`column`,children:[(0,Q.jsx)(l,{children:`Enter a unique identifier for your agent:`}),(0,Q.jsx)(c,{marginTop:1,children:(0,Q.jsx)(_e,{value:a,onChange:o,onSubmit:e=>{let n=e.trim(),i=lr(n);if(i){p(i);return}p(null),r({agentType:n}),t()},placeholder:`e.g., test-runner, tech-lead, etc`,columns:60,cursorOffset:m,onChangeCursorOffset:h,focus:!0,showCursor:!0})}),f&&(0,Q.jsx)(c,{marginTop:1,children:(0,Q.jsx)(l,{color:`error`,children:f})})]})})}var Ur,Q,Wr=e((()=>{Ur=t(p(),1),m(),E(),w(),re(),H(),V(),dr(),Q=_()}));function Gr({tools:e,existingAgents:t,onComplete:n,onCancel:r}){return(0,Kr.jsx)(Qn,{steps:[Dr,jr,Tr,()=>(0,Kr.jsx)(Hr,{existingAgents:t}),Ir,vr,()=>(0,Kr.jsx)(zr,{tools:e}),Nr,sr,...Pt()?[kr]:[],()=>(0,Kr.jsx)(mr,{tools:e,existingAgents:t,onComplete:n})],initialData:{},onComplete:()=>{},onCancel:r,title:`Create new agent`,showStepCounter:!1})}var Kr,qr=e((()=>{Ft(),H(),cr(),_r(),br(),Er(),Or(),Ar(),Mr(),Fr(),Rr(),Vr(),Wr(),Kr=_()}));function Jr({tools:e,onExit:t}){let[n,r]=(0,Yr.useState)({mode:`list-agents`,source:`all`}),i=Ae(e=>e.agentDefinitions),a=Ae(e=>e.mcp.tools),o=Ae(e=>e.toolPermissionContext),s=ce(),{allAgents:u,activeAgents:d}=i,[f,p]=(0,Yr.useState)([]),m=an(e,a,o);nn();let _=(0,Yr.useMemo)(()=>({"built-in":u.filter(e=>e.source===`built-in`),userSettings:u.filter(e=>e.source===`userSettings`),projectSettings:u.filter(e=>e.source===`projectSettings`),policySettings:u.filter(e=>e.source===`policySettings`),localSettings:u.filter(e=>e.source===`localSettings`),flagSettings:u.filter(e=>e.source===`flagSettings`),plugin:u.filter(e=>e.source===`plugin`),all:u}),[u]),v=(0,Yr.useCallback)(e=>{p(t=>[...t,e]),r({mode:`list-agents`,source:`all`})},[]),y=(0,Yr.useCallback)(async e=>{try{await En(e),s(t=>{let n=t.agentDefinitions.allAgents.filter(t=>!(t.agentType===e.agentType&&t.source===e.source));return{...t,agentDefinitions:{...t.agentDefinitions,allAgents:n,activeAgents:it(n)}}}),p(t=>[...t,`Deleted agent: ${h.bold(e.agentType)}`]),r({mode:`list-agents`,source:`all`})}catch(e){Lt(St(e))}},[s]);switch(n.mode){case`list-agents`:{let e=$t(n.source===`all`?[..._[`built-in`],..._.userSettings,..._.projectSettings,..._.localSettings,..._.policySettings,..._.flagSettings,..._.plugin]:_[n.source],d);return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Xn,{source:n.source,agents:e,onBack:()=>{t((f.length>0?`Agent changes:\n${f.join(`
103
- `)}`:void 0)??`Agents dialog dismissed`,{display:f.length===0?`system`:void 0})},onSelect:e=>r({mode:`agent-menu`,agent:e,previousMode:n}),onCreateNew:()=>r({mode:`create-agent`}),changes:f}),(0,$.jsx)(qn,{})]})}case`create-agent`:return(0,$.jsx)(Gr,{tools:m,existingAgents:d,onComplete:v,onCancel:()=>r({mode:`list-agents`,source:`all`})});case`agent-menu`:{let e=u.find(e=>e.agentType===n.agent.agentType&&e.source===n.agent.source)||n.agent,t=[{label:`View agent`,value:`view`},...e.source!==`built-in`&&e.source!==`plugin`&&e.source!==`flagSettings`?[{label:`Edit agent`,value:`edit`},{label:`Delete agent`,value:`delete`}]:[],{label:`Back`,value:`back`}];return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(g,{title:n.agent.agentType,onCancel:()=>r(n.previousMode),hideInputGuide:!0,children:(0,$.jsxs)(c,{flexDirection:`column`,children:[(0,$.jsx)(nt,{options:t,onChange:t=>{switch(t){case`view`:r({mode:`view-agent`,agent:e,previousMode:n.previousMode});break;case`edit`:r({mode:`edit-agent`,agent:e,previousMode:n});break;case`delete`:r({mode:`delete-confirm`,agent:e,previousMode:n});break;case`back`:r(n.previousMode);break}},onCancel:()=>r(n.previousMode)}),f.length>0&&(0,$.jsx)(c,{marginTop:1,children:(0,$.jsx)(l,{dimColor:!0,children:f[f.length-1]})})]})}),(0,$.jsx)(qn,{})]})}case`view-agent`:{let e=u.find(e=>e.agentType===n.agent.agentType&&e.source===n.agent.source)||n.agent;return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(g,{title:e.agentType,onCancel:()=>r({mode:`agent-menu`,agent:e,previousMode:n.previousMode}),hideInputGuide:!0,children:(0,$.jsx)(kn,{agent:e,tools:m,allAgents:u,onBack:()=>r({mode:`agent-menu`,agent:e,previousMode:n.previousMode})})}),(0,$.jsx)(qn,{instructions:`Press Enter or Esc to go back`})]})}case`delete-confirm`:return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(g,{title:`Delete agent`,onCancel:()=>{`previousMode`in n&&r(n.previousMode)},color:`error`,children:[(0,$.jsxs)(l,{children:[`Are you sure you want to delete the agent `,(0,$.jsx)(l,{bold:!0,children:n.agent.agentType}),`?`]}),(0,$.jsx)(c,{marginTop:1,children:(0,$.jsxs)(l,{dimColor:!0,children:[`Source: `,n.agent.source]})}),(0,$.jsx)(c,{marginTop:1,children:(0,$.jsx)(nt,{options:[{label:`Yes, delete`,value:`yes`},{label:`No, cancel`,value:`no`}],onChange:e=>{e===`yes`?y(n.agent):`previousMode`in n&&r(n.previousMode)},onCancel:()=>{`previousMode`in n&&r(n.previousMode)}})})]}),(0,$.jsx)(qn,{instructions:`Press ↑↓ to navigate, Enter to select, Esc to cancel`})]});case`edit-agent`:{let e=u.find(e=>e.agentType===n.agent.agentType&&e.source===n.agent.source)||n.agent;return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(g,{title:`Edit agent: ${e.agentType}`,onCancel:()=>r(n.previousMode),hideInputGuide:!0,children:(0,$.jsx)(Gn,{agent:e,tools:m,onSaved:e=>{v(e),r(n.previousMode)},onBack:()=>r(n.previousMode)})}),(0,$.jsx)(qn,{})]})}default:return null}}var Yr,$,Xr=e((()=>{f(),p(),Yr=t(p(),1),rn(),on(),m(),Se(),Zt(),et(),Ct(),It(),Qe(),An(),Kn(),Yn(),Zn(),On(),qr(),$=_()}));async function Zr(e,t){let n=t.getAppState().toolPermissionContext;return(0,Qr.jsx)(Jr,{tools:Fe(n),onExit:e})}var Qr;e((()=>{p(),Xr(),Pe(),Qr=_()}))();export{Zr as call};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{V_ as t,z_ as n}from"./loadAgentsDir-Clu7Uk6a.js";import{g as r,u as i}from"./settings-Dlp5JTa_.js";function a(){let e=i(),t=[`user`,`project`,`local`].flatMap(e=>n(e).errors);return{settings:e.settings,errors:[...e.errors,...t]}}var o=e((()=>{t(),r()}));export{o as n,a as t};
@@ -1 +0,0 @@
1
- import{a as e,n as t,o as n}from"./api-B-5jqiMg.js";n();export{t as fetchCodeSessionsFromSessionsAPI,e as getOAuthHeaders};
@@ -1 +0,0 @@
1
- import{Bt as e,It as t,Ot as n,mt as r,yt as i}from"./model-BQF64tZx.js";e();export{r as checkAndRefreshOAuthTokenIfNeeded,i as clearOAuthTokenCache,n as getClaudeAIOAuthTokens,t as handleOAuth401Error};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./auth-DT2yxy94.js";export{t as authLogin,e as authStatus};
@@ -1,15 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{en as t,ot as n}from"./state-ix0xIunV.js";import{C as r,CT as i,E as a,OT as ee,PT as o,ST as s,_T as te,bT as c,dT as l,dd as u,fT as d,fd as ne,gT as f,hT as p,mT as m,pT as h,ud as g,vT as _,x as re,xT as v,yT as y,zT as ie}from"./loadAgentsDir-Clu7Uk6a.js";import{s as ae,u as oe}from"./types-C-MRCL8J.js";import{a as se,n as ce,o as le,t as ue}from"./bridgeConfig-5p_w4s5r.js";import{i as b,o as x}from"./bg-WnYN5ifx.js";import{n as S,t as C}from"./state-Cn_m2NOf.js";import{n as w,r as T}from"./pipeTransport-CqCnc-Ys.js";import{join as E}from"path";import"crypto";import{readFile as D,readdir as O}from"fs/promises";function k(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function A(e){return typeof e==`string`&&z.includes(e)}function j(e){return typeof e==`string`&&B.includes(e)}function M(e){return!k(e)||typeof e.name!=`string`||!j(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 N(e){if(!k(e)||typeof e.runId!=`string`||typeof e.workflow!=`string`||!A(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(M).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 P(e,t){try{return N(oe(await D(E(e,L,`${t}.json`),`utf-8`),!1))}catch{return null}}async function F(e=n()){let t;try{t=await O(E(e,L))}catch{return[]}let r=t.filter(e=>e.endsWith(`.json`));return(await Promise.all(r.slice(0,R).map(t=>P(e,t.slice(0,-5))))).filter(e=>e!==null).sort((e,t)=>t.updatedAt-e.updatedAt)}function I(e){if(e.length===0)return[`Workflow runs: 0`,` none`].join(`
2
- `);let t=e.filter(e=>e.status===`running`).length,n=e.filter(e=>e.status===`completed`).length,r=e.filter(e=>e.status===`cancelled`).length,i=[`Workflow runs: ${e.length}`,` Running: ${t}`,` Completed: ${n}`,` Cancelled: ${r}`];for(let t of e.slice(0,10)){let e=t.steps[t.currentStepIndex];i.push(` ${t.runId}: ${t.workflow}: ${t.status} step=${e?.name??`none`} updated=${new Date(t.updatedAt).toLocaleString()}`)}return e.length>10&&i.push(` ... ${e.length-10} more workflow run(s)`),i.join(`
3
- `)}var L,R,z,B,V=e((()=>{t(),ae(),L=E(`.claude`,`workflow-runs`),R=200,z=[`running`,`completed`,`cancelled`],B=[`pending`,`running`,`completed`,`cancelled`]}));function H(){return E(w(),`registry.json`)}async function U(){try{let e=await D(H(),`utf8`),t=JSON.parse(e);return t.version===1?t:{...W}}catch{return{...W}}}var W,de=e((()=>{T(),W={version:1,mainMachineId:null,main:null,subs:[]}}));async function fe(){return pe(await U())}function pe(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 me=e((()=>{de()}));function he(){try{let e=le(),t=ue();return[`Remote Control: ${e?`self-hosted`:`official`}`,` base_url=${ce()}`,` token=${t?`present`:`missing`}`,` entitlement=checked at remote-control startup`].join(`
5
- `)}catch(e){return[`Remote Control: unknown`,` reason=${e instanceof Error?e.message:String(e)}`].join(`
6
- `)}}var ge=e((()=>{se()}));async function _e(){let e=S(),t=await x(),n=[`Daemon: ${e.status}${e.state?` pid=${e.state.pid} workers=${e.state.workerKinds.join(`,`)}`:``}`,`Background sessions: ${t.length}`];for(let e of t.slice(0,8))n.push(` pid=${e.pid} kind=${e.kind} status=${e.status??`unknown`} cwd=${e.cwd}`);return t.length>8&&n.push(` ... ${t.length-8} more session(s)`),n.join(`
7
- `)}function ve(){let e=!1,t=null;try{e=a(),t=re()}catch(e){return[`Auto mode: unknown`,` reason=${e instanceof Error?e.message:String(e)}`].join(`
8
- `)}return[`Auto mode: ${e?`available`:`unavailable`}`,` reason=${t??`none`}`].join(`
9
- `)}async function G({runs:e,flows:t,nowMs:n=Date.now()}){return Promise.all([Promise.resolve({id:`auto-mode`,title:`Auto Mode`,content:ve()}),Promise.resolve({id:`runs`,title:`Runs`,content:d(e)}),Promise.resolve({id:`flows`,title:`Flows`,content:y(t)}),F().then(e=>({id:`workflow-runs`,title:`Workflow Runs`,content:I(e)})),fe().then(e=>({id:`pipes`,title:`Pipes`,content:e})),_e().then(e=>({id:`runtime`,title:`Runtime`,content:e})),Promise.resolve({id:`remote-control`,title:`Remote Control`,content:he()}),ne().then(e=>({id:`remote-trigger`,title:`RemoteTrigger`,content:g(e)}))])}async function ye(e){return(await G(e)).map((e,t)=>[t===0?`# Autonomy Deep Status`:`## ${e.title}`,e.content].join(`
10
- `)).join(`
11
-
12
- `)}var be=e((()=>{C(),b(),v(),h(),r(),u(),V(),me(),ge()}));function xe(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,Se=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([m(t),s(t)]);return e?.deep?ye({runs:n,flows:r}):[d(n),y(r)].join(`
13
- `)}async function Ce(e,t){let[n,r]=await Promise.all([m(t?.rootDir),s(t?.rootDir)]),i=(await G({runs:n,flows:r})).find(t=>t.id===e);return i?[`# ${i.title}`,i.content].join(`
14
- `):`Autonomy deep status section not found: ${e}`}async function we(e){process.stdout.write(`${await J(e)}\n`)}async function Y(e,t){return l(await m(t?.rootDir),q(e))}async function Te(e){process.stdout.write(`${await Y(e)}\n`)}async function X(e,t){return _(await s(t?.rootDir),q(e))}async function Ee(e){process.stdout.write(`${await X(e)}\n`)}async function Z(e,t){return te(await c(e,t?.rootDir))}async function De(e){process.stdout.write(`${await Z(e)}\n`)}async function Q(e,t){let n=await i({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=ie(t=>t.autonomy?.flowId===e);r=n.length;for(let e of n)e.autonomy?.runId&&await p(e.autonomy.runId,t?.rootDir)}else{for(let e of n.queuedRunIds)await p(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 Oe(e){process.stdout.write(`${await Q(e)}\n`)}async function $(e,t){let n=await f({flowId:e,rootDir:t?.rootDir,currentDir:t?.currentDir});if(!n)return`Autonomy flow is not waiting or was not found.`;if(t?.enqueueInMemory)return ee(n),`Queued the next managed step for flow ${e}.`;let r=n.autonomy?.runId??`unknown`;return[`Prepared the next managed step for flow ${e}.`,`Run ID: ${r}`,``,`Prompt:`,typeof n.value==`string`?n.value:String(n.value)].join(`
15
- `)}async function ke(e){process.stdout.write(`${await $(e)}\n`)}async function Ae(e,t){let n=xe(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 je=e((()=>{v(),h(),be(),Se(),o()}));export{Te as a,Ae as c,X as d,Y as f,$ as g,q as h,Ee as i,Ce as l,je as m,De as n,we as o,J as p,ke as r,Q as s,Oe as t,Z as u};
@@ -1 +0,0 @@
1
- import{t as e}from"./backgroundHousekeeping-DhF2lrQ9.js";export{e as startBackgroundHousekeeping};
@@ -1,17 +0,0 @@
1
- import{a as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,o as r}from"./envUtils-DSxRz_kt.js";import{K as i,R as a,en as o}from"./state-ix0xIunV.js";import{Dx as s,Et as c,Gw as l,Hg as u,So as d,To as f,Wg as ee,Ww as te,Xl as ne,Yl as p,Yw as m,ZT as h,br as g,et as _,hS as v,ht as y,jr as re,kx as ie,mS as ae,nt as oe,wo as se,zo as b}from"./loadAgentsDir-Clu7Uk6a.js";import{n as ce,t as le}from"./cwd-CYmmnQVS.js";import{S as ue,W as de,a as fe,d as x,l as S,p as C,z as w}from"./debug-BrXObCdR.js";import{f as T,g as E,v as D}from"./settings-Dlp5JTa_.js";import{C as O,T as k,w as A}from"./config-3m_9zSrj.js";import{o as j,s as M,v as N,y as P}from"./log-BMCygSzM.js";import{n as F,r as I}from"./analytics-BotDBGh0.js";import{_ as L,h as R}from"./model-BQF64tZx.js";import{Tn as z,wn as B}from"./prompt-Bg_1U0gO.js";import{st as V}from"./rcDebugLog-VKwMl0yg.js";import{i as H,t as U}from"./nativeInstaller-OPuO2sm_.js";import{n as pe,t as me}from"./allErrors-P3utlEeA.js";import{n as he,r as ge}from"./magicDocs-Bf1fqnHN.js";import{n as _e,t as ve}from"./pluginAutoupdate-CO-n9bqe.js";import{n as ye,r as be}from"./registerProtocol-CuKZAiCc.js";import{homedir as xe}from"os";import{join as W}from"path";import"crypto";import*as G from"fs/promises";r(),o(),ce(),ue(),C(),fe(),P(),E(),z(),L(),m(),ne(),re(),ge(),_(),j(),w(),b(),h(),_(),l(),w(),j(),b(),h();async function Se(e,t){if(!e)return;let{join:n}=await import(`path`),r=await import(`fs/promises`),i=n(le(),`.claude`,`skills`,e,`SKILL.md`),a;try{a=await r.readFile(i,`utf-8`)}catch{M(Error(`Failed to read skill file for improvement: ${i}`));return}let o=t.map(e=>`- ${e.section}: ${e.change}`).join(`
2
- `),s=R(),c=await oe({messages:[d({content:`You are editing a skill definition file. Apply the following improvements to the skill.
3
-
4
- <current_skill_file>
5
- ${a}
6
- </current_skill_file>
7
-
8
- <improvements>
9
- ${o}
10
- </improvements>
11
-
12
- Rules:
13
- - Integrate the improvements naturally into the existing structure
14
- - Preserve frontmatter (--- block) exactly as-is
15
- - Preserve the overall format and style
16
- - Do not remove existing content unless an improvement explicitly replaces it
17
- - Output the complete updated file inside <updated_file> tags`})],systemPrompt:V([`You edit skill definition files to incorporate user preferences. Output only the updated file content.`]),thinkingConfig:{type:`disabled`},tools:[],signal:te().signal,options:{getToolPermissionContext:async()=>B(),model:s,toolChoice:void 0,isNonInteractiveSession:!1,hasAppendSystemPrompt:!1,temperatureOverride:0,agents:[],querySource:`skill_improvement_apply`,mcpTools:[]}}),l=se(f(Array.isArray(c.message.content)?c.message.content:[]).trim(),`updated_file`);if(!l){M(Error(`Skill improvement apply: no updated_file tag in response`));return}try{await r.writeFile(i,l,`utf-8`)}catch(e){M(de(e))}}F(),ie(),O(),j(),U(),v(),pe(),ee(),c();var Ce=30;function K(){let e=((T()||{}).cleanupPeriodDays??Ce)*24*60*60*1e3;return new Date(Date.now()-e)}function we(e,t){return{messages:e.messages+t.messages,errors:e.errors+t.errors}}function Te(e){let t=e.split(`.`)[0].replace(/T(\d{2})-(\d{2})-(\d{2})-(\d{3})Z/,`T$1:$2:$3.$4Z`);return new Date(t)}async function q(e,t,n){let r={messages:0,errors:0};try{let i=await x().readdir(e);for(let a of i)try{Te(a.name)<t&&(await x().unlink(W(e,a.name)),n?r.messages++:r.errors++)}catch(e){M(e)}}catch(e){e instanceof Error&&`code`in e&&e.code!==`ENOENT`&&M(e)}return r}async function Ee(){let e=x(),t=K(),n=N.errors(),r=N.baseLogs(),i=await q(n,t,!1);try{let n;try{n=await e.readdir(r)}catch{return i}let a=n.filter(e=>e.isDirectory()&&e.name.startsWith(`mcp-logs-`)).map(e=>W(r,e.name));for(let n of a)i=we(i,await q(n,t,!0)),await Y(n,e)}catch(e){e instanceof Error&&`code`in e&&e.code!==`ENOENT`&&M(e)}return i}async function J(e,t,n){return(await n.stat(e)).mtime<t?(await n.unlink(e),!0):!1}async function Y(e,t){try{await t.rmdir(e)}catch{}}async function De(){let e=K(),t={messages:0,errors:0},n=g(),r=x(),i;try{i=await r.readdir(n)}catch{return t}for(let a of i){if(!a.isDirectory())continue;let i=W(n,a.name),o;try{o=await r.readdir(i)}catch{t.errors++;continue}for(let n of o)if(n.isFile()){if(!n.name.endsWith(`.jsonl`)&&!n.name.endsWith(`.cast`))continue;try{await J(W(i,n.name),e,r)&&t.messages++}catch{t.errors++}}else if(n.isDirectory()){let a=W(i,n.name),o=W(a,u),s;try{s=await r.readdir(o)}catch{await Y(a,r);continue}for(let n of s)if(n.isFile())try{await J(W(o,n.name),e,r)&&t.messages++}catch{t.errors++}else if(n.isDirectory()){let i=W(o,n.name),a;try{a=await r.readdir(i)}catch{continue}for(let n of a)if(n.isFile())try{await J(W(i,n.name),e,r)&&t.messages++}catch{t.errors++}await Y(i,r)}await Y(o,r),await Y(a,r)}await Y(i,r)}return t}async function Oe(e,t,n=!0){let r=K(),i={messages:0,errors:0},a=x(),o;try{o=await a.readdir(e)}catch{return i}for(let n of o)if(!(!n.isFile()||!n.name.endsWith(t)))try{await J(W(e,n.name),r,a)&&i.messages++}catch{i.errors++}return n&&await Y(e,a),i}function ke(){return Oe(W(n(),`plans`),`.md`)}async function Ae(){let e=K(),t={messages:0,errors:0},r=x();try{let i=W(n(),`file-history`),a;try{a=await r.readdir(i)}catch{return t}let o=a.filter(e=>e.isDirectory()).map(e=>W(i,e.name));await Promise.all(o.map(async n=>{try{(await r.stat(n)).mtime<e&&(await r.rm(n,{recursive:!0,force:!0}),t.messages++)}catch{t.errors++}})),await Y(i,r)}catch(e){M(e)}return t}async function X(){let e=K(),t={messages:0,errors:0},r=x();try{let i=W(n(),`session-env`),a;try{a=await r.readdir(i)}catch{return t}let o=a.filter(e=>e.isDirectory()).map(e=>W(i,e.name));for(let n of o)try{(await r.stat(n)).mtime<e&&(await r.rm(n,{recursive:!0,force:!0}),t.messages++)}catch{t.errors++}await Y(i,r)}catch(e){M(e)}return t}async function je(){let e=K(),t={messages:0,errors:0},r=x(),i=W(n(),`debug`),a;try{a=await r.readdir(i)}catch{return t}for(let n of a)if(!(!n.isFile()||!n.name.endsWith(`.txt`)||n.name===`latest`))try{await J(W(i,n.name),e,r)&&t.messages++}catch{t.errors++}return t}var Z=1440*60*1e3;async function Q(){let e=W(n(),`.npm-cache-cleanup`);try{let t=await G.stat(e);if(Date.now()-t.mtimeMs<Z){S(`npm cache cleanup: skipping, ran recently`);return}}catch{}try{await A(e,{retries:0,realpath:!1})}catch{S(`npm cache cleanup: skipping, lock held`);return}S(`npm cache cleanup: starting`);let r=W(xe(),`.npm`,`_cacache`),i=Date.now();try{let n=await import(`./lib-rQZENxQg.js`).then(e=>t(e.default,1)),a=i-Z,o=n.ls.stream(r),s=[];for await(let e of o)e.key.includes(`@anthropic-ai/claude-`)&&s.push({key:e.key,time:e.time});let c=new Map;for(let e of s){let t=e.key.lastIndexOf(`@`),n=t>0?e.key.slice(0,t):e.key,r=c.get(n)??[];r.push(e),c.set(n,r)}let l=[];for(let[,e]of c){e.sort((e,t)=>t.time-e.time);for(let t=0;t<e.length;t++){let n=e[t];(n.time<a||t>=5)&&l.push(n.key)}}await Promise.all(l.map(e=>n.rm.entry(r,e))),await G.writeFile(e,new Date().toISOString());let u=Date.now()-i;l.length>0?S(`npm cache cleanup: Removed ${l.length} old @anthropic-ai entries in ${u}ms`):S(`npm cache cleanup: completed in ${u}ms`),I(`tengu_npm_cache_cleanup`,{success:!0,durationMs:u,entriesRemoved:l.length})}catch(e){M(e),I(`tengu_npm_cache_cleanup`,{success:!1,durationMs:Date.now()-i})}finally{await k(e,{realpath:!1}).catch(()=>{})}}async function Me(){let e=W(n(),`.version-cleanup`);try{let t=await G.stat(e);if(Date.now()-t.mtimeMs<Z){S(`version cleanup: skipping, ran recently`);return}}catch{}try{await A(e,{retries:0,realpath:!1})}catch{S(`version cleanup: skipping, lock held`);return}S(`version cleanup: starting (throttled)`);try{await H(),await G.writeFile(e,new Date().toISOString())}catch(e){M(e)}finally{await k(e,{realpath:!1}).catch(()=>{})}}async function Ne(){let{errors:e}=me();if(e.length>0&&D(`cleanupPeriodDays`)){S(`Skipping cleanup: settings have validation errors but cleanupPeriodDays was explicitly set. Fix settings errors to enable cleanup.`);return}await Ee(),await De(),await ke(),await Ae(),await X(),await je(),await s(),await ae(K());let t=await y(K());t>0&&I(`tengu_worktree_cleanup`,{removed:t}),process.env.USER_TYPE===`ant`&&await Q()}o(),U(),_e();var Pe=(ye(),e(be)),Fe=1440*60*1e3,$=600*1e3;function Ie(){he(),import(`./extractMemories-B2IAvbXM.js`).then(({initExtractMemories:e})=>{e()}).catch(()=>{}),p(),ve(),a()&&Pe.ensureDeepLinkProtocolRegistered();let e=!0;async function t(){if(a()&&i()>Date.now()-1e3*60){setTimeout(t,$).unref();return}if(e&&(e=!1,await Ne()),a()&&i()>Date.now()-1e3*60){setTimeout(t,$).unref();return}await H()}setTimeout(t,$).unref(),process.env.USER_TYPE===`ant`&&setInterval(()=>{Q(),Me()},Fe).unref()}export{Se as n,Ie as t};
@@ -1 +0,0 @@
1
- import{a as e,n as t,o as n,t as r}from"./bridgeConfig-5p_w4s5r.js";e();export{r as getBridgeAccessToken,t as getBridgeBaseUrl,n as isSelfHostedBridge};
@@ -1 +0,0 @@
1
- import{n as e,r as t,t as n}from"./bridgeEnabled-DhFrLTbG.js";t();export{n as checkBridgeMinVersion,e as getBridgeDisabledReason};
@@ -1 +0,0 @@
1
- import{n as e}from"./bridgeMain-BX2AkLPs.js";export{e as bridgeMain};