claude-code-best 2.6.9 → 2.6.11

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 (400) hide show
  1. package/dist/chunks/{AddWorkspaceDirectory-_RSNUS7K.js → AddWorkspaceDirectory-CGKtPsTK.js} +1 -1
  2. package/dist/chunks/{App-4VqMMjIu.js → App-DF28Bpg9.js} +1 -1
  3. package/dist/chunks/ApproveApiKey-BtiWOryM.js +1 -0
  4. package/dist/chunks/{ApproveApiKey-B7oSxzWc.js → ApproveApiKey-D21kbmQj.js} +1 -1
  5. package/dist/chunks/{AssistantSessionChooser-Lf5l_1Dh.js → AssistantSessionChooser-CDfwNVi5.js} +1 -1
  6. package/dist/chunks/{BackgroundTasksDialog-Ckgmqm6u.js → BackgroundTasksDialog-5RpkAbJz.js} +1 -1
  7. package/dist/chunks/{BypassPermissionsModeDialog-DNqPpiPC.js → BypassPermissionsModeDialog-BDWFw61G.js} +1 -1
  8. package/dist/chunks/{ClaudeInChromeOnboarding-BODZ64gw.js → ClaudeInChromeOnboarding-CpN0yIU_.js} +1 -1
  9. package/dist/chunks/{ClaudeMdExternalIncludesDialog-DLI6ey3G.js → ClaudeMdExternalIncludesDialog-CWRHpy22.js} +1 -1
  10. package/dist/chunks/ClaudeMdExternalIncludesDialog-Dje7A0F2.js +1 -0
  11. package/dist/chunks/ConsoleOAuthFlow-DQf3dmj6.js +1 -0
  12. package/dist/chunks/{DesktopHandoff--xyI5kTQ.js → DesktopHandoff-CKHLXiwc.js} +1 -1
  13. package/dist/chunks/{DevChannelsDialog-DJ4mHsA_.js → DevChannelsDialog-BwMFW7Wt.js} +1 -1
  14. package/dist/chunks/{DiffDialog-CVWUlOjm.js → DiffDialog-oA1v0BMo.js} +1 -1
  15. package/dist/chunks/Doctor-ButdpAkf.js +1 -0
  16. package/dist/chunks/{Doctor-DVoFX-9y.js → Doctor-QVMo0fIh.js} +1 -1
  17. package/dist/chunks/{ExitFlow-BKzQPr75.js → ExitFlow-DJLYN-Bd.js} +1 -1
  18. package/dist/chunks/Feedback-CpfhqIEv.js +2 -0
  19. package/dist/chunks/{Grove-G0DtwY22.js → Grove-BugC6ssx.js} +1 -1
  20. package/dist/chunks/Grove-CmdRVv9F.js +1 -0
  21. package/dist/chunks/{HybridTransport-xN03sWrt.js → HybridTransport-PeXWuYfl.js} +1 -1
  22. package/dist/chunks/{ITermBackend-DzN3ZWds.js → ITermBackend-dcs68DGS.js} +1 -1
  23. package/dist/chunks/{InvalidConfigDialog-Iy4Su1Lm.js → InvalidConfigDialog-DdB9_Ve0.js} +1 -1
  24. package/dist/chunks/{InvalidSettingsDialog-dx4y_nY-.js → InvalidSettingsDialog-BL8nxwWQ.js} +1 -1
  25. package/dist/chunks/{MCPConnectionManager-kVO-4BcA.js → MCPConnectionManager-D2eAGUME.js} +1 -1
  26. package/dist/chunks/{McpParsingWarnings-D420-W8M.js → McpParsingWarnings-BYPXpmte.js} +1 -1
  27. package/dist/chunks/MessageSelector-Bzq8CYAH.js +3 -0
  28. package/dist/chunks/{Messages-C5gVVVmY.js → Messages-uRxxAMW-.js} +2 -2
  29. package/dist/chunks/{Onboarding-BkidUre_.js → Onboarding-ByLnHSnW.js} +1 -1
  30. package/dist/chunks/{OverageCreditUpsell-DoRUucoN.js → OverageCreditUpsell-CVNfTSKG.js} +1 -1
  31. package/dist/chunks/{PluginSettings-DhpNtjTm.js → PluginSettings-h9Lj0vW6.js} +1 -1
  32. package/dist/chunks/{PromptInputFooterSuggestions-BnpXzkW9.js → PromptInputFooterSuggestions-CYWSLCgA.js} +1 -1
  33. package/dist/chunks/{PromptInputHelpMenu-DKbiO4C0.js → PromptInputHelpMenu-BsYNhZCw.js} +1 -1
  34. package/dist/chunks/{QueryEngine-J15EOjWx.js → QueryEngine-CxP2S3qi.js} +1 -1
  35. package/dist/chunks/{REPL-nrJ13J1o.js → REPL-CV12-ns7.js} +6 -6
  36. package/dist/chunks/REPL-h1bwm8ee.js +1 -0
  37. package/dist/chunks/{RemoteCallout-DGXIcTKv.js → RemoteCallout-WWO84za-.js} +1 -1
  38. package/dist/chunks/{RemoteSessionManager-3KsuTCZM.js → RemoteSessionManager-Dx2skKnM.js} +1 -1
  39. package/dist/chunks/{ResumeConversation-kS7lkjJm.js → ResumeConversation-CagiCg7-.js} +1 -1
  40. package/dist/chunks/{SSETransport-Cy1rXP6E.js → SSETransport-BHdzk1HO.js} +1 -1
  41. package/dist/chunks/SearchExtraToolsTool-BJ2d8mtx.js +1 -0
  42. package/dist/chunks/SentryErrorBoundary-CYiFofRZ.js +1 -0
  43. package/dist/chunks/{SentryErrorBoundary-B_6MfzRa.js → SentryErrorBoundary-CmewX8Dv.js} +1 -1
  44. package/dist/chunks/Settings-BcgtW60l.js +2 -0
  45. package/dist/chunks/{TeleportProgress-CQUN_zoe.js → TeleportProgress-BmbhZlOg.js} +1 -1
  46. package/dist/chunks/{TeleportRepoMismatchDialog-CPquWrd-.js → TeleportRepoMismatchDialog-BAwtgUhR.js} +1 -1
  47. package/dist/chunks/{TeleportResumeWrapper-NIFNCHIO.js → TeleportResumeWrapper-BlkvOdYn.js} +1 -1
  48. package/dist/chunks/{ThemePicker-DnK0DStD.js → ThemePicker-v_3lh136.js} +1 -1
  49. package/dist/chunks/{TmuxBackend-C00k5RF9.js → TmuxBackend-B7Nabc5t.js} +1 -1
  50. package/dist/chunks/{TrustDialog-CUnvtDeS.js → TrustDialog-CHu5eoeR.js} +1 -1
  51. package/dist/chunks/{ValidationErrorsList-CJbO1qub.js → ValidationErrorsList-BSMetgqr.js} +1 -1
  52. package/dist/chunks/WelcomeV2-DZfBSTu5.js +1 -0
  53. package/dist/chunks/{WindowsTerminalBackend-DSsgxuNK.js → WindowsTerminalBackend-CeSoQ_Nk.js} +1 -1
  54. package/dist/chunks/{add-dir-BPqd010H.js → add-dir-7UeFZkdv.js} +1 -1
  55. package/dist/chunks/{agentDisplay-C0B1b_90.js → agentDisplay-DJgsfIlm.js} +1 -1
  56. package/dist/chunks/{agents-CYs7WGHP.js → agents-DD7gQVZD.js} +1 -1
  57. package/dist/chunks/{agents-DMzVeRly.js → agents-DK0y9jId.js} +1 -1
  58. package/dist/chunks/{ant-BO0Hmoii.js → ant-PhgMZT08.js} +1 -1
  59. package/dist/chunks/api-D4aCzJS-.js +1 -0
  60. package/dist/chunks/{api-DLLVkmRJ.js → api-nHsRf03G.js} +1 -1
  61. package/dist/chunks/{assistant-_dIpsqHM.js → assistant-BJbeizyH.js} +1 -1
  62. package/dist/chunks/{assistant-CHp4-EaF.js → assistant-DO7RAhd3.js} +1 -1
  63. package/dist/chunks/assistant-Dvx-UrTi.js +1 -0
  64. package/dist/chunks/auth-Cp7Nt0ik.js +1 -0
  65. package/dist/chunks/{auth-DelyQc8g.js → auth-DxRiJwZ-.js} +1 -1
  66. package/dist/chunks/{autoMode-D3-o7xPK.js → autoMode-BswSpjo5.js} +1 -1
  67. package/dist/chunks/{autonomy-tTAucjip.js → autonomy-CNJQwoAQ.js} +1 -1
  68. package/dist/chunks/{autonomy-CzSRoxjl.js → autonomy-Lc78acHX.js} +1 -1
  69. package/dist/chunks/{autonomyPanel-DcK8N52K.js → autonomyPanel-DxcumRp-.js} +1 -1
  70. package/dist/chunks/{backgroundHousekeeping-Bbkz61_-.js → backgroundHousekeeping-BkfWgzIP.js} +2 -2
  71. package/dist/chunks/backgroundHousekeeping-BxBI2KkX.js +1 -0
  72. package/dist/chunks/{branch-ZJF4xAh9.js → branch-BPsUW1dk.js} +1 -1
  73. package/dist/chunks/{bridge-C6gSt_32.js → bridge-DcOGvDbb.js} +2 -2
  74. package/dist/chunks/{bridgeConfig-DXUNQp2l.js → bridgeConfig-CvKdNJOg.js} +1 -1
  75. package/dist/chunks/bridgeConfig-Dkn5GGec.js +1 -0
  76. package/dist/chunks/bridgeEnabled-CjaYKTo5.js +1 -0
  77. package/dist/chunks/{bridgeEnabled-G6vxQV-7.js → bridgeEnabled-D01faWms.js} +1 -1
  78. package/dist/chunks/{bridgeMain-DlnIQOtX.js → bridgeMain-Bu2oOX31.js} +6 -6
  79. package/dist/chunks/bridgeMain-CEpOBx8Z.js +1 -0
  80. package/dist/chunks/{bridgeMessaging-mek-AaFi.js → bridgeMessaging-BZMDSZAN.js} +1 -1
  81. package/dist/chunks/{btw-Cz2lyle-.js → btw-B8s-X_cm.js} +1 -1
  82. package/dist/chunks/{buddy-BMqKttFw.js → buddy-DkB1xU1o.js} +1 -1
  83. package/dist/chunks/{bypassPermissionsKillswitch-BxvX48jr.js → bypassPermissionsKillswitch-B9Qz9zKO.js} +1 -1
  84. package/dist/chunks/{caches-wtRUk5y5.js → caches-BuSzLvN9.js} +2 -2
  85. package/dist/chunks/caches-Bvl2jdxF.js +1 -0
  86. package/dist/chunks/{ccrClient-BOrmrmgF.js → ccrClient-CMZXfu9P.js} +1 -1
  87. package/dist/chunks/changeDetector-DTXMv7gH.js +1 -0
  88. package/dist/chunks/channelNotification-B7s1OoRK.js +1 -0
  89. package/dist/chunks/{channelNotification-D8do6HUN.js → channelNotification-t6Kgu-vX.js} +1 -1
  90. package/dist/chunks/{chrome-JF2BXNK6.js → chrome-Cvkozg2F.js} +1 -1
  91. package/dist/chunks/clear-C9pufI6F.js +1 -0
  92. package/dist/chunks/client-CqJ5gRGj.js +1 -0
  93. package/dist/chunks/{color-oh8CGhkI.js → color-AYeAYKyq.js} +1 -1
  94. package/dist/chunks/commands-LcLR5Vgx.js +1 -0
  95. package/dist/chunks/commitAttribution-BZupnGMc.js +1 -0
  96. package/dist/chunks/{commitAttribution-CUdm_sRl.js → commitAttribution-CUqUEjsh.js} +1 -1
  97. package/dist/chunks/{compact-R6vMbGQQ.js → compact-BF0-0_qh.js} +1 -1
  98. package/dist/chunks/{companion-ClxqTyG9.js → companion-Cf_kYtOD.js} +1 -1
  99. package/dist/chunks/{config-CPK9PlWS.js → config-45GLd-lt.js} +1 -1
  100. package/dist/chunks/{config-BQ-MayP6.js → config-JGm0O-ZQ.js} +1 -1
  101. package/dist/chunks/{context-CWfsKYEB.js → context-Bl5VUX5M.js} +1 -1
  102. package/dist/chunks/context-noninteractive-BtzPsJ8k.js +1 -0
  103. package/dist/chunks/{context-noninteractive-BJ4hE3MX.js → context-noninteractive-DdPFYYO9.js} +1 -1
  104. package/dist/chunks/{conversation-DizpkPtq.js → conversation-C3NWyOB3.js} +1 -1
  105. package/dist/chunks/conversation-oX932vBQ.js +1 -0
  106. package/dist/chunks/{copy-BuPCS2HG.js → copy-CbhxPqw4.js} +1 -1
  107. package/dist/chunks/{createSSHSession-Di9Je4Th.js → createSSHSession-Dq2nMChz.js} +1 -1
  108. package/dist/chunks/createSession-1ewHG3eq.js +1 -0
  109. package/dist/chunks/{createSession-D6v0lBtG.js → createSession-DTHPUie-.js} +1 -1
  110. package/dist/chunks/{cronJitterConfig-By18m-PD.js → cronJitterConfig-IGWCRDrv.js} +1 -1
  111. package/dist/chunks/{crossProjectResume-C4YT2T6P.js → crossProjectResume-WmabPBTO.js} +1 -1
  112. package/dist/chunks/datadog-Da7KYZNF.js +1 -0
  113. package/dist/chunks/{datadog-BFSdlK6C.js → datadog-FKvRNyFi.js} +1 -1
  114. package/dist/chunks/{desktop-Bd-JHrBo.js → desktop-ZASE3YWy.js} +1 -1
  115. package/dist/chunks/{diff-DGmINgOc.js → diff-QP-TbxuD.js} +1 -1
  116. package/dist/chunks/{doctor-DQ42RQPx.js → doctor-DVkgmkRb.js} +1 -1
  117. package/dist/chunks/{effort-E6XjzPYR.js → effort-DbryQCua.js} +1 -1
  118. package/dist/chunks/entry-D8y42iuM.js +14 -0
  119. package/dist/chunks/envLessBridgeConfig-CpW0G4Eh.js +1 -0
  120. package/dist/chunks/envLessBridgeConfig-D4bSwf7w.js +1 -0
  121. package/dist/chunks/{exit-CVlpMwCq.js → exit-BsNW67F9.js} +1 -1
  122. package/dist/chunks/{export-CXcPQd0T.js → export-C9A9nOA1.js} +1 -1
  123. package/dist/chunks/{exportRenderer-B9WXgMV2.js → exportRenderer-CyTuZFFF.js} +1 -1
  124. package/dist/chunks/{extra-usage-B2KmuAZe.js → extra-usage-C6s5mXW0.js} +1 -1
  125. package/dist/chunks/extra-usage-DL2C0_BM.js +1 -0
  126. package/dist/chunks/{extra-usage-core-B20tawuN.js → extra-usage-core-BFCwz3XM.js} +1 -1
  127. package/dist/chunks/{extra-usage-noninteractive-DZRe98BZ.js → extra-usage-noninteractive-IHq7s6wm.js} +1 -1
  128. package/dist/chunks/{extraUsage-CxqJdnGC.js → extraUsage-CIrG_Lbw.js} +1 -1
  129. package/dist/chunks/extractMemories-CA2eJwHy.js +1 -0
  130. package/dist/chunks/fast-B01NO2uA.js +1 -0
  131. package/dist/chunks/{fast-CPmJ2bp3.js → fast-NEKXVZqQ.js} +1 -1
  132. package/dist/chunks/{feedback-4GY3ahvw.js → feedback-D5iWO16P.js} +1 -1
  133. package/dist/chunks/{firstPartyEventLogger-CISUrAsf.js → firstPartyEventLogger-Dr3TK3IU.js} +1 -1
  134. package/dist/chunks/{flushGate-Dr8sMjB7.js → flushGate-DygHyqmB.js} +1 -1
  135. package/dist/chunks/gates-BSpXbh9s.js +1 -0
  136. package/dist/chunks/{gates-DI4pxvrD.js → gates-Dyz_t5zJ.js} +1 -1
  137. package/dist/chunks/{gemini-Dcfosr2Z.js → gemini-BEmbnRQR.js} +1 -1
  138. package/dist/chunks/{generateRecap-CH_fgtxk.js → generateRecap-DZiXeYWn.js} +1 -1
  139. package/dist/chunks/{generateSessionName-DO0R__8w.js → generateSessionName-EbB2vl9t.js} +1 -1
  140. package/dist/chunks/{githubRepoPathMapping-D5I8CVDz.js → githubRepoPathMapping-dky2fPeU.js} +1 -1
  141. package/dist/chunks/{grok-X0FzcE6Y.js → grok-BM6ZJ4w2.js} +1 -1
  142. package/dist/chunks/{growthbook-DZPT2JzB.js → growthbook-JD-WW3yV.js} +1 -1
  143. package/dist/chunks/{heapdump-Cq6i0wJH.js → heapdump-8vyFTWly.js} +1 -1
  144. package/dist/chunks/{help-B8ddA-Ec.js → help-C2DM0p8U.js} +1 -1
  145. package/dist/chunks/{hooks-CvFNccdv.js → hooks-CMh0a2pT.js} +1 -1
  146. package/dist/chunks/hooks-QXGwOfWj.js +1 -0
  147. package/dist/chunks/{hostAdapter-D3s4JFk-.js → hostAdapter-CmbGfgNV.js} +1 -1
  148. package/dist/chunks/{ide-CzxV5_D7.js → ide-Bn8R7397.js} +1 -1
  149. package/dist/chunks/{inboundAttachments-B3ZTyNKF.js → inboundAttachments-BweY9sYo.js} +1 -1
  150. package/dist/chunks/inboundAttachments-N5DKbZSl.js +1 -0
  151. package/dist/chunks/initReplBridge-3CfmzjJL.js +1 -0
  152. package/dist/chunks/{insights-DiWlKgVQ.js → insights-NOl_PxhN.js} +1 -1
  153. package/dist/chunks/{install-BFpg1zm1.js → install-BoT2GIcz.js} +1 -1
  154. package/dist/chunks/{install-github-app-BUCGGSw0.js → install-github-app-SD4PvrTR.js} +1 -1
  155. package/dist/chunks/{install-slack-app-D5JDqzbs.js → install-slack-app-DLQXpOCt.js} +1 -1
  156. package/dist/chunks/{instrumentation--BToLJT9.js → instrumentation-BXJk0mxI.js} +3 -3
  157. package/dist/chunks/{job-mUyxSEc2.js → job-CnlMlm3t.js} +1 -1
  158. package/dist/chunks/{keybindings-D4DbE4G0.js → keybindings-BjaRqcbD.js} +1 -1
  159. package/dist/chunks/{lang-cMcnaxAR.js → lang-BI8CzjL6.js} +1 -1
  160. package/dist/chunks/{language-sTn9sA3E.js → language-CRIdgj2F.js} +1 -1
  161. package/dist/chunks/language-DmbRGIs8.js +1 -0
  162. package/dist/chunks/{launchAgentsPlatform-CAfyCAsQ.js → launchAgentsPlatform-Bg9guiqy.js} +1 -1
  163. package/dist/chunks/{launchAutofixPr-CSMamZS6.js → launchAutofixPr-BMfXGXwN.js} +1 -1
  164. package/dist/chunks/{launchLocalMemory-nYAwNsNT.js → launchLocalMemory-lgnXOi6U.js} +1 -1
  165. package/dist/chunks/{launchLocalVault-yPp8S-tG.js → launchLocalVault-C0Oz-lto.js} +1 -1
  166. package/dist/chunks/{launchMemoryStores-Dk3SXucB.js → launchMemoryStores-Bw11ruRi.js} +1 -1
  167. package/dist/chunks/{launchOnboarding-BoqmHyRx.js → launchOnboarding-WEW34cnl.js} +1 -1
  168. package/dist/chunks/{launchSchedule-C2HBjD6C.js → launchSchedule-X0rcM_kM.js} +1 -1
  169. package/dist/chunks/{launchSkillStore-B5Yjvi-k.js → launchSkillStore-DpxSlMCU.js} +1 -1
  170. package/dist/chunks/{launchTeleport-BayvAnwh.js → launchTeleport-uOtMsYcI.js} +1 -1
  171. package/dist/chunks/{launchVault-BszsgPbZ.js → launchVault-CJyJaPqH.js} +1 -1
  172. package/dist/chunks/{loadAgentsDir-Cl2w3uvH.js → loadAgentsDir-D-xcJ22-.js} +45 -45
  173. package/dist/chunks/loadAgentsDir-ILQxk_4G.js +1 -0
  174. package/dist/chunks/{loadPluginHooks-YHtjByxm.js → loadPluginHooks-BC1Ea7_D.js} +1 -1
  175. package/dist/chunks/{localSearch-CpeqVibs.js → localSearch-B6Ho7Vfj.js} +1 -1
  176. package/dist/chunks/localSearch-COyJeP9E.js +1 -0
  177. package/dist/chunks/login-Cf89biEK.js +1 -0
  178. package/dist/chunks/{login-TVtq34WQ.js → login-uOvq1xN_.js} +1 -1
  179. package/dist/chunks/{logoV2Utils-DwaRnvOY.js → logoV2Utils-C2cdcgtp.js} +1 -1
  180. package/dist/chunks/logout-CEXwTlEX.js +1 -0
  181. package/dist/chunks/{magicDocs-_yNWB88A.js → magicDocs-BBjAhGN1.js} +1 -1
  182. package/dist/chunks/{main-gTbhsbIs.js → main-DGsAUuG_.js} +15 -15
  183. package/dist/chunks/{mappers-COd8OOml.js → mappers-CO6koWDa.js} +1 -1
  184. package/dist/chunks/{mcp-CChzTC5v.js → mcp-BrN_Tbq5.js} +2 -2
  185. package/dist/chunks/{mcp-DoraEndj.js → mcp-CZltNml5.js} +1 -1
  186. package/dist/chunks/mcp-D6JOqdT8.js +2 -0
  187. package/dist/chunks/{mcpServer-Wd9rZG_E.js → mcpServer-C-0K3Azg.js} +1 -1
  188. package/dist/chunks/{mcpServer-CpBN77YB.js → mcpServer-C_aDoLMg.js} +1 -1
  189. package/dist/chunks/{memory-I21QZZ9h.js → memory-BYYOgo4e.js} +1 -1
  190. package/dist/chunks/model-CHgqwg6N.js +1 -0
  191. package/dist/chunks/{model-BrHh21Db.js → model-CrAPXYZA.js} +1 -1
  192. package/dist/chunks/{onChangeAppState-Cn_HSmmQ.js → onChangeAppState-C6ZIU1SD.js} +1 -1
  193. package/dist/chunks/{openai-BD2V4lHN.js → openai-Cm4gozk8.js} +1 -1
  194. package/dist/chunks/{overageCreditGrant-B47t5a73.js → overageCreditGrant-Pe7C_4Qi.js} +1 -1
  195. package/dist/chunks/{passes-DAOPYX0C.js → passes-BpI6azLG.js} +1 -1
  196. package/dist/chunks/{paths-q1-Ni8Oh.js → paths-D9CVAtXU.js} +2 -2
  197. package/dist/chunks/{permissions-BmxTU-Pk.js → permissions-C7wcAYOc.js} +1 -1
  198. package/dist/chunks/{pipeTransport-DnHE3axn.js → pipeTransport-wjeyTgon.js} +1 -1
  199. package/dist/chunks/{plan-4dmnQ9bv.js → plan-DA8IRpHQ.js} +1 -1
  200. package/dist/chunks/{plugin-CG7lJIpf.js → plugin-N2pTkzOz.js} +1 -1
  201. package/dist/chunks/{pluginAutoupdate-CPLuidh-.js → pluginAutoupdate-DCc5qDvo.js} +1 -1
  202. package/dist/chunks/{pluginBlocklist-BHxIUqu4.js → pluginBlocklist-C_Veew3p.js} +1 -1
  203. package/dist/chunks/{pluginCliCommands-BcDIvxR3.js → pluginCliCommands-BN7loc5T.js} +1 -1
  204. package/dist/chunks/{pluginFlagging-Dh6rYOvj.js → pluginFlagging-Dpu1cvMo.js} +1 -1
  205. package/dist/chunks/{pluginOperations-fdLcp72i.js → pluginOperations-CP6NFNog.js} +1 -1
  206. package/dist/chunks/pluginStartupCheck-BF0xUEJG.js +1 -0
  207. package/dist/chunks/{pluginStartupCheck-Dy7EckW4.js → pluginStartupCheck-DvWHwNnD.js} +1 -1
  208. package/dist/chunks/{plugins-C3-iYKTp.js → plugins-BHoniP5f.js} +1 -1
  209. package/dist/chunks/policyLimits-sh7ywop0.js +1 -0
  210. package/dist/chunks/{pollConfig-BGXMaSla.js → pollConfig-xYxAmuXi.js} +1 -1
  211. package/dist/chunks/{poor-CxAil0Mi.js → poor-C0KwfFF0.js} +1 -1
  212. package/dist/chunks/{poorMode-DFcYVnMT.js → poorMode-D7WXWZtJ.js} +1 -1
  213. package/dist/chunks/poorMode-DZQXZ_zu.js +1 -0
  214. package/dist/chunks/{print-Cog1o-Tw.js → print-BcRG8gkQ.js} +4 -4
  215. package/dist/chunks/{privacy-settings-D6g7p6sB.js → privacy-settings-DT3LGgsH.js} +1 -1
  216. package/dist/chunks/{processBashCommand-DqgujTR4.js → processBashCommand-DPfJ9lrj.js} +1 -1
  217. package/dist/chunks/{processSlashCommand-DUPS9Xx3.js → processSlashCommand-DyPCeZux.js} +1 -1
  218. package/dist/chunks/{prompt-BmOnuQfF.js → prompt-C69iv9cI.js} +1 -1
  219. package/dist/chunks/prompt-DaIJzI1P.js +1 -0
  220. package/dist/chunks/prompt-DnLsyywj.js +1 -0
  221. package/dist/chunks/{promptEditor-ClGwMkWl.js → promptEditor-BZqpLrcZ.js} +1 -1
  222. package/dist/chunks/{protocolHandler--b0d38gF.js → protocolHandler-CfmBTg36.js} +1 -1
  223. package/dist/chunks/{rate-limit-options-DD2ZRREl.js → rate-limit-options-P7oQuwrl.js} +1 -1
  224. package/dist/chunks/{rcDebugLog-fhwD4wm-.js → rcDebugLog-CTOZ2K3E.js} +1 -1
  225. package/dist/chunks/{referral-rRvT6UDX.js → referral-D26orIXE.js} +1 -1
  226. package/dist/chunks/{refresh-C7S_6LOQ.js → refresh-BeSXaVya.js} +1 -1
  227. package/dist/chunks/{registerProtocol-Bu_tz5Au.js → registerProtocol-DSQh-I21.js} +1 -1
  228. package/dist/chunks/{registry-Bk0vdx_8.js → registry-Dp5W2V8B.js} +1 -1
  229. package/dist/chunks/{release-notes-BShc_V-B.js → release-notes-Cg85UVo8.js} +1 -1
  230. package/dist/chunks/{releaseNotes-D3wZdQVZ.js → releaseNotes-Dps4SeVh.js} +2 -2
  231. package/dist/chunks/{reload-plugins-CpytFAAC.js → reload-plugins-Bo-R1CF3.js} +1 -1
  232. package/dist/chunks/{remote-env-B9Of1v31.js → remote-env-ChQuV3rO.js} +1 -1
  233. package/dist/chunks/{remoteBridgeCore-BXp6nJ8q.js → remoteBridgeCore-BXtygJA-.js} +1 -1
  234. package/dist/chunks/{remoteControlServer-BvlTaHu4.js → remoteControlServer-sqW_JLwC.js} +1 -1
  235. package/dist/chunks/{rename-DhTddAd7.js → rename-Bigaipiq.js} +1 -1
  236. package/dist/chunks/{resume-DwVeFqnc.js → resume-CtOI2pOJ.js} +1 -1
  237. package/dist/chunks/{runtimeObserver-dtT0QHYO.js → runtimeObserver-CJ955XSo.js} +2 -2
  238. package/dist/chunks/{runtimeObserver-BtgDP8Gz.js → runtimeObserver-DojpbVgU.js} +1 -1
  239. package/dist/chunks/sandbox-adapter-BbrJOJNZ.js +1 -0
  240. package/dist/chunks/{sandbox-toggle-CG2vZNAb.js → sandbox-toggle-B9dn09gt.js} +1 -1
  241. package/dist/chunks/searchExtraTools-Denn1c1E.js +1 -0
  242. package/dist/chunks/{sentry-DFk8bzvt.js → sentry-B6tWUNGj.js} +1 -1
  243. package/dist/chunks/{session-DifFcUdR.js → session-C5yIf_zV.js} +1 -1
  244. package/dist/chunks/{sessionDiscovery-CRbLIQv1.js → sessionDiscovery-CQ3iMN4s.js} +1 -1
  245. package/dist/chunks/sessionFileAccessHooks-1IAwziOQ.js +1 -0
  246. package/dist/chunks/sessionMemory-3TAJyNuJ.js +1 -0
  247. package/dist/chunks/{sessionMemory-BdptRKL8.js → sessionMemory-HZNzEOLd.js} +1 -1
  248. package/dist/chunks/sessionMemoryUtils-BAkA4sGG.js +1 -0
  249. package/dist/chunks/sessionObserver-DqLMFMLM.js +1 -0
  250. package/dist/chunks/{sessionObserver-D3vw6SJ_.js → sessionObserver-MQA9_wZw.js} +1 -1
  251. package/dist/chunks/sessionStorage-CFfMypMQ.js +1 -0
  252. package/dist/chunks/{sessionTitle-DnvlYJ-c.js → sessionTitle-BafqFHLc.js} +1 -1
  253. package/dist/chunks/{sessionTracing-BkzKJi0v.js → sessionTracing-_obALZbi.js} +1 -1
  254. package/dist/chunks/{settingsSync-CHZVpM34.js → settingsSync-DBWi-NXU.js} +1 -1
  255. package/dist/chunks/{setup-GxlEx1KG.js → setup-C_GrS0Rd.js} +1 -1
  256. package/dist/chunks/{setup-BpwYOhci.js → setup-D1sQnli9.js} +2 -2
  257. package/dist/chunks/{setup-BfecYO-n.js → setup-DIxsjw17.js} +1 -1
  258. package/dist/chunks/{shadowedRuleDetection-FNzEipG0.js → shadowedRuleDetection-CwMwv9uM.js} +1 -1
  259. package/dist/chunks/{sideQuestion-Bfa0SZn5.js → sideQuestion-CI5pyoQF.js} +1 -1
  260. package/dist/chunks/{sink-DpAjuilF.js → sink-BSTUubjl.js} +1 -1
  261. package/dist/chunks/sink-fGBOXJab.js +1 -0
  262. package/dist/chunks/sinks-B9EsWFeb.js +2 -0
  263. package/dist/chunks/sinks-BCl9slVM.js +1 -0
  264. package/dist/chunks/{skill-learning-BSeEbCnP.js → skill-learning-DThetLpo.js} +1 -1
  265. package/dist/chunks/{skillChangeDetector-BEDBRGbY.js → skillChangeDetector-BOH-fyEn.js} +1 -1
  266. package/dist/chunks/{skillGapStore-B4GmZRJ0.js → skillGapStore-BmjCK9ZR.js} +2 -2
  267. package/dist/chunks/{skillGapStore-BCO6YB3H.js → skillGapStore-ax0GuSmd.js} +1 -1
  268. package/dist/chunks/{skillGenerator-QgDWAvzK.js → skillGenerator-Dj3xInwG.js} +2 -2
  269. package/dist/chunks/skillLearning-BDsjN-u-.js +1 -0
  270. package/dist/chunks/skillLearning-CXUsWxdi.js +1 -0
  271. package/dist/chunks/{skillPanel-srZjMIbC.js → skillPanel-CJ4tvX7A.js} +3 -3
  272. package/dist/chunks/{skillSearchPanel-DTvHcwNK.js → skillSearchPanel-hwZvXKZ4.js} +2 -2
  273. package/dist/chunks/{skills-BlVUkWg4.js → skills-BVWDDcD9.js} +1 -1
  274. package/dist/chunks/{sprites-QO9r_mXk.js → sprites-B-V9otkt.js} +1 -1
  275. package/dist/chunks/{stats-DdXM-u7l.js → stats-DcS6ZnsX.js} +1 -1
  276. package/dist/chunks/{status-BIZWtZqI.js → status-DZKjK9CE.js} +1 -1
  277. package/dist/chunks/{statusNoticeHelpers-9sIAjiE6.js → statusNoticeHelpers-reCcymMR.js} +1 -1
  278. package/dist/chunks/{tag-DDJ8pAsl.js → tag-B5b-waIf.js} +1 -1
  279. package/dist/chunks/{tasks-DYt6udr3.js → tasks-vXM-vULI.js} +1 -1
  280. package/dist/chunks/teamHelpers-BBhol4dD.js +1 -0
  281. package/dist/chunks/{teamHelpers-BJuKEuyS.js → teamHelpers-CbFFdvPw.js} +1 -1
  282. package/dist/chunks/{teammateModeSnapshot-Zp1weNIZ.js → teammateModeSnapshot-DkkMv2-b.js} +1 -1
  283. package/dist/chunks/teammateModeSnapshot-W5G22rwQ.js +1 -0
  284. package/dist/chunks/{teleport-DkoFG3EI.js → teleport-Da0rKwCo.js} +1 -1
  285. package/dist/chunks/{templateJobs-V2-TVeGE.js → templateJobs-BLQqrGjb.js} +1 -1
  286. package/dist/chunks/{terminalSetup-l0Vv_v1c.js → terminalSetup-BKfVYk3w.js} +1 -1
  287. package/dist/chunks/{terminalSetup-DMUDhXur.js → terminalSetup-BLU99dau.js} +1 -1
  288. package/dist/chunks/{theme-Dm1yCDce.js → theme-BM2CXWYE.js} +1 -1
  289. package/dist/chunks/{thinkback-DQAZE5SA.js → thinkback-Cd1g_2A9.js} +1 -1
  290. package/dist/chunks/thinkback-ChP6pvCS.js +1 -0
  291. package/dist/chunks/{thinkback-play-BJcGmc9X.js → thinkback-play-Cg8Ys2dq.js} +1 -1
  292. package/dist/chunks/{toolEventObserver-C-BImvCz.js → toolEventObserver-71WYUega.js} +1 -1
  293. package/dist/chunks/{toolEventObserver-BgkqkNwy.js → toolEventObserver-nxcfjaur.js} +1 -1
  294. package/dist/chunks/{toolPool-DYvz_Mjt.js → toolPool-CN1cPGQz.js} +1 -1
  295. package/dist/chunks/toolPool-CygNb5cr.js +1 -0
  296. package/dist/chunks/{trustedDevice-CXsk3eij.js → trustedDevice-Brc9B8cZ.js} +1 -1
  297. package/dist/chunks/{trustedDevice-BDrK9AQ6.js → trustedDevice-C0KJ0qiK.js} +1 -1
  298. package/dist/chunks/{ultrareviewCommand-Bc8hMzHz.js → ultrareviewCommand-BY0T8Pzl.js} +1 -1
  299. package/dist/chunks/undercover-bx8TwG9W.js +1 -0
  300. package/dist/chunks/{undercover-kRoI_nlN.js → undercover-j27F8p49.js} +1 -1
  301. package/dist/chunks/{updateCCB-BPGNN7VA.js → updateCCB-Dgb2ed9v.js} +1 -1
  302. package/dist/chunks/upgrade-BkHztwGA.js +1 -0
  303. package/dist/chunks/{upgrade-DmEGLk6v.js → upgrade-zs7K9UkG.js} +1 -1
  304. package/dist/chunks/{upload-49qk5TBL.js → upload-Df84yCBz.js} +1 -1
  305. package/dist/chunks/{usage-DhJDFJVx.js → usage-DKENFl_k.js} +1 -1
  306. package/dist/chunks/{usage-sYgTL8wR.js → usage-lTILrQJV.js} +1 -1
  307. package/dist/chunks/{useMainLoopModel-CJaR_qEJ.js → useMainLoopModel-X1PW9z5A.js} +1 -1
  308. package/dist/chunks/{useManagePlugins-B1FpmxFo.js → useManagePlugins-DDKeDfIv.js} +1 -1
  309. package/dist/chunks/{useMergedTools-eMPZ95TX.js → useMergedTools-CC3XwtOR.js} +1 -1
  310. package/dist/chunks/{useSearchInput-CR-b0Qi6.js → useSearchInput-DNpNG36H.js} +1 -1
  311. package/dist/chunks/{useSettingsErrors-p-PFBeaC.js → useSettingsErrors-vGzCYpIA.js} +1 -1
  312. package/dist/chunks/{useVoice-D3PqTfCK.js → useVoice-DmObXoAh.js} +1 -1
  313. package/dist/chunks/{util-BZ2fS3PR.js → util-9vJ9WIeZ.js} +1 -1
  314. package/dist/chunks/utils-Dg0S2Vfn.js +1 -0
  315. package/dist/chunks/{validatePlugin-QtcXXmZu.js → validatePlugin-_Z4zhjSx.js} +1 -1
  316. package/dist/chunks/{vim-LmepJftY.js → vim-CK7lReJi.js} +1 -1
  317. package/dist/chunks/{voice-CNRTt4gH.js → voice-BLVF7E3Q.js} +1 -1
  318. package/dist/chunks/{voiceModeEnabled-wWM929QG.js → voiceModeEnabled-BpLBjY2-.js} +1 -1
  319. package/dist/chunks/voiceModeEnabled-BqFYzoXw.js +1 -0
  320. package/dist/chunks/voiceStreamSTT-C0pkuXGm.js +1 -0
  321. package/dist/chunks/{voiceStreamSTT-CnK9GN6Q.js → voiceStreamSTT-i4tUq3Hu.js} +1 -1
  322. package/dist/chunks/{workerRegistry-CrIpKIZe.js → workerRegistry-Bg7dWLHf.js} +1 -1
  323. package/dist/chunks/worktree-Cg4p1J__.js +1 -0
  324. package/dist/chunks/{xml-CMdTGiv6.js → xml-K_hNNh2b.js} +1 -1
  325. package/dist/cli.js +1 -1
  326. package/package.json +1 -1
  327. package/dist/chunks/ApproveApiKey-Bmcop2Do.js +0 -1
  328. package/dist/chunks/ClaudeMdExternalIncludesDialog-DO61Zz-S.js +0 -1
  329. package/dist/chunks/ConsoleOAuthFlow-FSHC5mxO.js +0 -1
  330. package/dist/chunks/Doctor-Dcntgp5Z.js +0 -1
  331. package/dist/chunks/Feedback-hFZwDSRp.js +0 -2
  332. package/dist/chunks/Grove-Cmcsx2UE.js +0 -1
  333. package/dist/chunks/MessageSelector-CDVC2CAj.js +0 -3
  334. package/dist/chunks/REPL-Dk3Ics9i.js +0 -1
  335. package/dist/chunks/SearchExtraToolsTool-C998WSxs.js +0 -1
  336. package/dist/chunks/SentryErrorBoundary-BJLT-ebr.js +0 -1
  337. package/dist/chunks/Settings-DBopjMkN.js +0 -2
  338. package/dist/chunks/WelcomeV2-BBFGft_e.js +0 -1
  339. package/dist/chunks/api-B2HW-oZI.js +0 -1
  340. package/dist/chunks/assistant-BmM44yln.js +0 -1
  341. package/dist/chunks/auth-ndSNSeqS.js +0 -1
  342. package/dist/chunks/backgroundHousekeeping-DVo3ndZr.js +0 -1
  343. package/dist/chunks/bridgeConfig-ZcbBdhji.js +0 -1
  344. package/dist/chunks/bridgeEnabled-D5qCI5v2.js +0 -1
  345. package/dist/chunks/bridgeMain-B4Zv8UOe.js +0 -1
  346. package/dist/chunks/caches-D_W3nCFE.js +0 -1
  347. package/dist/chunks/changeDetector-CUsHUdul.js +0 -1
  348. package/dist/chunks/channelNotification-CLVU5AuO.js +0 -1
  349. package/dist/chunks/clear-BP-G1JWa.js +0 -1
  350. package/dist/chunks/client-BHfY6SC5.js +0 -1
  351. package/dist/chunks/commands-E0eNJ_XZ.js +0 -1
  352. package/dist/chunks/commitAttribution-B4DOgUS7.js +0 -1
  353. package/dist/chunks/context-noninteractive-D1Kxn5e0.js +0 -1
  354. package/dist/chunks/conversation-C23rDJe3.js +0 -1
  355. package/dist/chunks/createSession-Bsa0VJKS.js +0 -1
  356. package/dist/chunks/datadog-MUvg76p3.js +0 -1
  357. package/dist/chunks/entry-Di8oWZUk.js +0 -14
  358. package/dist/chunks/envLessBridgeConfig-BNvozi46.js +0 -1
  359. package/dist/chunks/envLessBridgeConfig-CUTBQKDY.js +0 -1
  360. package/dist/chunks/extra-usage-DVtAa1zD.js +0 -1
  361. package/dist/chunks/extractMemories-8uB606Y0.js +0 -1
  362. package/dist/chunks/fast-DTGg3pRh.js +0 -1
  363. package/dist/chunks/gates-BbF5S-Dy.js +0 -1
  364. package/dist/chunks/hooks-gwB4Eotj.js +0 -1
  365. package/dist/chunks/inboundAttachments-DxrrrqBW.js +0 -1
  366. package/dist/chunks/initReplBridge-DWpGy3aE.js +0 -1
  367. package/dist/chunks/language-DC6bsdvI.js +0 -1
  368. package/dist/chunks/loadAgentsDir-6_9ZFegv.js +0 -1
  369. package/dist/chunks/localSearch-DbEm6f3k.js +0 -1
  370. package/dist/chunks/login-D2x89UCR.js +0 -1
  371. package/dist/chunks/logout-BBPihkXp.js +0 -1
  372. package/dist/chunks/mcp-D-0wE0nJ.js +0 -2
  373. package/dist/chunks/model-C6_WjCy0.js +0 -1
  374. package/dist/chunks/pluginStartupCheck-fyqW-stg.js +0 -1
  375. package/dist/chunks/policyLimits-DUGrXcje.js +0 -1
  376. package/dist/chunks/poorMode-BkPHRLuG.js +0 -1
  377. package/dist/chunks/prompt-B-8CD-W_.js +0 -1
  378. package/dist/chunks/prompt-Da3gIGA8.js +0 -1
  379. package/dist/chunks/sandbox-adapter-Cm8kCM_U.js +0 -1
  380. package/dist/chunks/searchExtraTools-D-RZ9DId.js +0 -1
  381. package/dist/chunks/sessionFileAccessHooks-Bixkjai4.js +0 -1
  382. package/dist/chunks/sessionMemory-T1K_mJRE.js +0 -1
  383. package/dist/chunks/sessionMemoryUtils-q3xRtP-z.js +0 -1
  384. package/dist/chunks/sessionObserver-i_3day_6.js +0 -1
  385. package/dist/chunks/sessionStorage-CusaYoh0.js +0 -1
  386. package/dist/chunks/sink-BSwQ045N.js +0 -1
  387. package/dist/chunks/sinks-C37Xl5c3.js +0 -2
  388. package/dist/chunks/sinks-DHHmQJi-.js +0 -1
  389. package/dist/chunks/skillLearning-CFYgFRPE.js +0 -1
  390. package/dist/chunks/skillLearning-en7AuVDZ.js +0 -1
  391. package/dist/chunks/teamHelpers-Cw5dPQor.js +0 -1
  392. package/dist/chunks/teammateModeSnapshot-BXC7ssXX.js +0 -1
  393. package/dist/chunks/thinkback-D1mk7cq1.js +0 -1
  394. package/dist/chunks/toolPool-DNH5H4Jg.js +0 -1
  395. package/dist/chunks/undercover-DUrQYxYo.js +0 -1
  396. package/dist/chunks/upgrade-BTI562Ce.js +0 -1
  397. package/dist/chunks/utils-hhztcb0b.js +0 -1
  398. package/dist/chunks/voiceModeEnabled-B57V7REx.js +0 -1
  399. package/dist/chunks/voiceStreamSTT-Dp-1uSjP.js +0 -1
  400. package/dist/chunks/worktree-YbEK6b36.js +0 -1
@@ -1,2 +1,2 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{Ac as t,Ka as n,Pc as r,Sc as i,lo as a,oo as o}from"./paths-q1-Ni8Oh.js";import{n as s,r as c}from"./analytics-DqMQntaB.js";import{SA as l,aT as u,oT as d,vA as f}from"./loadAgentsDir-Cl2w3uvH.js";import{n as p,r as m}from"./voiceModeEnabled-wWM929QG.js";import{n as h,t as g}from"./useVoice-D3PqTfCK.js";var _,v;e((()=>{g(),d(),s(),t(),f(),o(),p(),_=2,v=async e=>{if(!m())return{type:`text`,value:`Voice mode is not available.`};let t=n(),o=t.voiceEnabled===!0,s=e?.trim().toLowerCase();if(o&&s===`doubao`)return a(`userSettings`,{voiceProvider:`doubao`}).error?{type:`text`,value:`Failed to update settings. Check your settings file for syntax errors.`}:(l.notifyChange(`userSettings`),{type:`text`,value:`Voice mode switched to Doubao ASR. Hold ${u(`voice:pushToTalk`,`Chat`,`Space`)} to record.`});if(o&&s===`anthropic`)return a(`userSettings`,{voiceProvider:`anthropic`}).error?{type:`text`,value:`Failed to update settings. Check your settings file for syntax errors.`}:(l.notifyChange(`userSettings`),{type:`text`,value:`Voice mode switched to Anthropic STT. Hold ${u(`voice:pushToTalk`,`Chat`,`Space`)} to record.`});if(o)return a(`userSettings`,{voiceEnabled:!1}).error?{type:`text`,value:`Failed to update settings. Check your settings file for syntax errors.`}:(l.notifyChange(`userSettings`),c(`tengu_voice_toggled`,{enabled:!1}),{type:`text`,value:`Voice mode disabled.`});let d=s===`doubao`?`doubao`:`anthropic`,{isVoiceStreamAvailable:f}=await import(`./voiceStreamSTT-Dp-1uSjP.js`),{checkRecordingAvailability:p}=await import(`./voice-DXiiy8HX.js`),g=await p();if(!g.available)return{type:`text`,value:g.reason??`Voice mode is not available in this environment.`};if(d!==`doubao`&&!f())return{type:`text`,value:`Voice mode requires a Claude.ai account. Please run /login to sign in.`};let{checkVoiceDependencies:v,requestMicrophonePermission:y}=await import(`./voice-DXiiy8HX.js`),b=await v();if(!b.available)return{type:`text`,value:`No audio recording tool found.${b.installCommand?`\nInstall audio recording tools? Run: ${b.installCommand}`:`
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{Ac as t,Ka as n,Pc as r,Sc as i,lo as a,oo as o}from"./paths-D9CVAtXU.js";import{n as s,r as c}from"./analytics-DqMQntaB.js";import{SA as l,aT as u,oT as d,vA as f}from"./loadAgentsDir-D-xcJ22-.js";import{n as p,r as m}from"./voiceModeEnabled-BpLBjY2-.js";import{n as h,t as g}from"./useVoice-DmObXoAh.js";var _,v;e((()=>{g(),d(),s(),t(),f(),o(),p(),_=2,v=async e=>{if(!m())return{type:`text`,value:`Voice mode is not available.`};let t=n(),o=t.voiceEnabled===!0,s=e?.trim().toLowerCase();if(o&&s===`doubao`)return a(`userSettings`,{voiceProvider:`doubao`}).error?{type:`text`,value:`Failed to update settings. Check your settings file for syntax errors.`}:(l.notifyChange(`userSettings`),{type:`text`,value:`Voice mode switched to Doubao ASR. Hold ${u(`voice:pushToTalk`,`Chat`,`Space`)} to record.`});if(o&&s===`anthropic`)return a(`userSettings`,{voiceProvider:`anthropic`}).error?{type:`text`,value:`Failed to update settings. Check your settings file for syntax errors.`}:(l.notifyChange(`userSettings`),{type:`text`,value:`Voice mode switched to Anthropic STT. Hold ${u(`voice:pushToTalk`,`Chat`,`Space`)} to record.`});if(o)return a(`userSettings`,{voiceEnabled:!1}).error?{type:`text`,value:`Failed to update settings. Check your settings file for syntax errors.`}:(l.notifyChange(`userSettings`),c(`tengu_voice_toggled`,{enabled:!1}),{type:`text`,value:`Voice mode disabled.`});let d=s===`doubao`?`doubao`:`anthropic`,{isVoiceStreamAvailable:f}=await import(`./voiceStreamSTT-C0pkuXGm.js`),{checkRecordingAvailability:p}=await import(`./voice-DXiiy8HX.js`),g=await p();if(!g.available)return{type:`text`,value:g.reason??`Voice mode is not available in this environment.`};if(d!==`doubao`&&!f())return{type:`text`,value:`Voice mode requires a Claude.ai account. Please run /login to sign in.`};let{checkVoiceDependencies:v,requestMicrophonePermission:y}=await import(`./voice-DXiiy8HX.js`),b=await v();if(!b.available)return{type:`text`,value:`No audio recording tool found.${b.installCommand?`\nInstall audio recording tools? Run: ${b.installCommand}`:`
2
2
  Install SoX manually for audio recording.`}`};if(!await y()){let e;return e=process.platform===`win32`?`Settings → Privacy → Microphone`:process.platform===`linux`?`your system's audio settings`:`System Settings → Privacy & Security → Microphone`,{type:`text`,value:`Microphone access is denied. To enable it, go to ${e}, then run /voice again.`}}if(a(`userSettings`,{voiceEnabled:!0,...d===`doubao`?{voiceProvider:`doubao`}:{}}).error)return{type:`text`,value:`Failed to update settings. Check your settings file for syntax errors.`};l.notifyChange(`userSettings`),c(`tengu_voice_toggled`,{enabled:!0});let x=u(`voice:pushToTalk`,`Chat`,`Space`),S=``,C=d===`doubao`?`Doubao ASR`:`Anthropic`;if(d!==`doubao`){let e=h(t.language),n=i(),a=n.voiceLangHintLastLanguage!==e.code,o=a?0:n.voiceLangHintShownCount??0,s=!e.fellBackFrom&&o<_;e.fellBackFrom?S=` Note: "${e.fellBackFrom}" is not a supported dictation language; using English. Change it via /config.`:s&&(S=` Dictation language: ${e.code} (/config to change).`),(a||s)&&r(t=>({...t,voiceLangHintShownCount:o+ +!!s,voiceLangHintLastLanguage:e.code}))}return{type:`text`,value:`Voice mode enabled (${C}). Hold ${x} to record.${S}`}}}))();export{v as call};
@@ -1 +1 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{Jt as t,S as n,_ as r,cn as i,on as a}from"./paths-q1-Ni8Oh.js";function o(){return!r(`tengu_amber_quartz_disabled`,!1)}function s(){return i()?!!t()?.accessToken:!1}function c(){return s()&&o()}function l(){return o()}var u=e((()=>{n(),a()}));export{c as a,o as i,u as n,l as r,s as t};
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{Jt as t,S as n,_ as r,cn as i,on as a}from"./paths-D9CVAtXU.js";function o(){return!r(`tengu_amber_quartz_disabled`,!1)}function s(){return i()?!!t()?.accessToken:!1}function c(){return s()&&o()}function l(){return o()}var u=e((()=>{n(),a()}));export{c as a,o as i,u as n,l as r,s as t};
@@ -0,0 +1 @@
1
+ import{a as e,i as t,n}from"./voiceModeEnabled-BpLBjY2-.js";n();export{t as isVoiceGrowthBookEnabled,e as isVoiceModeEnabled};
@@ -0,0 +1 @@
1
+ import{i as e,r as t}from"./voiceStreamSTT-i4tUq3Hu.js";t();export{e as isVoiceStreamAvailable};
@@ -1 +1 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,r as n}from"./wrapper-D5qL1aQL.js";import{Jt as r,Pt as i,S as a,St as o,_ as s,cn as c,on as l,wt as u}from"./paths-q1-Ni8Oh.js";import{E as d,T as f,d as p,s as m,w as h}from"./debug-UI3T040K.js";import{l as g,u as _}from"./oauth-CdZEzMww.js";import{o as v,s as y}from"./log-CzsijfHZ.js";import{c as b,g as x,h as S,l as C,u as w}from"./proxy-CfZp-wce.js";function T(){if(!c())return!1;let e=r();return e!==null&&e.accessToken!==null}async function E(e,t){await i();let a=r();if(!a?.accessToken)return p(`[voice_stream] No OAuth token available`),null;let c=process.env.VOICE_STREAM_BASE_URL||g().BASE_API_URL.replace(`https://`,`wss://`).replace(`http://`,`ws://`);process.env.VOICE_STREAM_BASE_URL&&p(`[voice_stream] Using VOICE_STREAM_BASE_URL override: ${process.env.VOICE_STREAM_BASE_URL}`);let l=new URLSearchParams({encoding:`linear16`,sample_rate:`16000`,channels:`1`,endpointing_ms:`300`,utterance_end_ms:`1000`,language:t?.language??`en`}),u=s(`tengu_cobalt_frost`,!1);if(u&&(l.set(`use_conversation_engine`,`true`),l.set(`stt_provider`,`deepgram-nova3`),p(`[voice_stream] Nova 3 gate enabled (tengu_cobalt_frost)`)),t?.keyterms?.length)for(let e of t.keyterms)l.append(`keyterms`,e);let m=`${c}${k}?${l.toString()}`;p(`[voice_stream] Connecting to ${m}`);let h={Authorization:`Bearer ${a.accessToken}`,"User-Agent":o(),"x-app":`cli`},_=S(),v=new n(m,typeof Bun<`u`?{headers:h,proxy:C(m),tls:_||void 0}:{headers:h,agent:b(m),..._}),x=null,w=!1,T=!1,E=!1,M=!1,N=null,P=null,F={send(e){if(v.readyState===n.OPEN){if(T){p(`[voice_stream] Dropping audio chunk after CloseStream: ${String(e.length)} bytes`);return}p(`[voice_stream] Sending audio chunk: ${String(e.length)} bytes`),v.send(Buffer.from(e))}},finalize(){return E||T?Promise.resolve(`ws_already_closed`):(E=!0,new Promise(t=>{let r=setTimeout(()=>N?.(`safety_timeout`),j.safety),i=setTimeout(()=>N?.(`no_data_timeout`),j.noData);if(P=()=>{clearTimeout(i),P=null},N=n=>{if(clearTimeout(r),clearTimeout(i),N=null,P=null,I){p(`[voice_stream] Promoting unreported interim before ${n} resolve`);let t=I;I=``,e.onTranscript(t,!0)}p(`[voice_stream] Finalize resolved via ${n}`),t(n)},v.readyState===n.CLOSED||v.readyState===n.CLOSING){N(`ws_already_closed`);return}setTimeout(()=>{T=!0,v.readyState===n.OPEN&&(p(`[voice_stream] Sending CloseStream (finalize)`),v.send(O))},0)}))},close(){T=!0,x&&(clearInterval(x),x=null),w=!1,v.readyState===n.OPEN&&v.close()},isConnected(){return w&&v.readyState===n.OPEN}};v.on(`open`,()=>{p(`[voice_stream] WebSocket connected`),w=!0,p(`[voice_stream] Sending initial KeepAlive`),v.send(D),x=setInterval(e=>{e.readyState===n.OPEN&&(p(`[voice_stream] Sending periodic KeepAlive`),e.send(D))},A,v),e.onReady(F)});let I=``;return v.on(`message`,t=>{let n=t.toString();p(`[voice_stream] Message received (${String(n.length)} chars): ${n.slice(0,200)}`);let r;try{r=f(n)}catch{return}switch(r.type){case`TranscriptText`:{let t=r.data;if(p(`[voice_stream] TranscriptText: "${t??``}"`),T&&P?.(),t){if(!u&&I){let n=I.trimStart(),r=t.trimStart();n&&r&&!r.startsWith(n)&&!n.startsWith(r)&&(p(`[voice_stream] Auto-finalizing previous segment (new segment detected): "${I}"`),e.onTranscript(I,!0))}I=t,e.onTranscript(t,!1)}break}case`TranscriptEndpoint`:{p(`[voice_stream] TranscriptEndpoint received, lastTranscriptText="${I}"`);let t=I;I=``,t&&e.onTranscript(t,!0),T&&N?.(`post_closestream_endpoint`);break}case`TranscriptError`:{let t=r.description??r.error_code??`unknown transcription error`;p(`[voice_stream] TranscriptError: ${t}`),E||e.onError(t);break}case`error`:{let t=r.message??d(r);p(`[voice_stream] Server error: ${t}`),E||e.onError(t);break}default:break}}),v.on(`close`,(t,n)=>{let r=n?.toString()??``;if(p(`[voice_stream] WebSocket closed: code=${String(t)} reason="${r}"`),w=!1,x&&(clearInterval(x),x=null),I){p(`[voice_stream] Promoting unreported interim transcript to final on close`);let t=I;I=``,e.onTranscript(t,!0)}N?.(`ws_close`),!E&&!M&&t!==1e3&&t!==1005&&e.onError(`Connection closed: code ${String(t)}${r?` — ${r}`:``}`),e.onClose()}),v.on(`unexpected-response`,(t,n)=>{let r=n.statusCode??0;if(r===101){p(`[voice_stream] unexpected-response fired with 101; ignoring`);return}p(`[voice_stream] Upgrade rejected: status=${String(r)} cf-mitigated=${String(n.headers[`cf-mitigated`])} cf-ray=${String(n.headers[`cf-ray`])}`),M=!0,n.resume(),t.destroy(),!E&&e.onError(`WebSocket upgrade rejected with HTTP ${String(r)}`,{fatal:r>=400&&r<500})}),v.on(`error`,t=>{y(t),p(`[voice_stream] WebSocket error: ${t.message}`),E||e.onError(`Voice stream connection error: ${t.message}`)}),F}var D,O,k,A,j,M=e((()=>{t(),_(),l(),m(),u(),v(),x(),w(),h(),a(),D=`{"type":"KeepAlive"}`,O=`{"type":"CloseStream"}`,k=`/api/ws/speech_to_text/voice_stream`,A=8e3,j={safety:5e3,noData:1500}}));export{T as i,E as n,M as r,j as t};
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,r as n}from"./wrapper-D5qL1aQL.js";import{Jt as r,Pt as i,S as a,St as o,_ as s,cn as c,on as l,wt as u}from"./paths-D9CVAtXU.js";import{E as d,T as f,d as p,s as m,w as h}from"./debug-UI3T040K.js";import{l as g,u as _}from"./oauth-CdZEzMww.js";import{o as v,s as y}from"./log-CzsijfHZ.js";import{c as b,g as x,h as S,l as C,u as w}from"./proxy-CfZp-wce.js";function T(){if(!c())return!1;let e=r();return e!==null&&e.accessToken!==null}async function E(e,t){await i();let a=r();if(!a?.accessToken)return p(`[voice_stream] No OAuth token available`),null;let c=process.env.VOICE_STREAM_BASE_URL||g().BASE_API_URL.replace(`https://`,`wss://`).replace(`http://`,`ws://`);process.env.VOICE_STREAM_BASE_URL&&p(`[voice_stream] Using VOICE_STREAM_BASE_URL override: ${process.env.VOICE_STREAM_BASE_URL}`);let l=new URLSearchParams({encoding:`linear16`,sample_rate:`16000`,channels:`1`,endpointing_ms:`300`,utterance_end_ms:`1000`,language:t?.language??`en`}),u=s(`tengu_cobalt_frost`,!1);if(u&&(l.set(`use_conversation_engine`,`true`),l.set(`stt_provider`,`deepgram-nova3`),p(`[voice_stream] Nova 3 gate enabled (tengu_cobalt_frost)`)),t?.keyterms?.length)for(let e of t.keyterms)l.append(`keyterms`,e);let m=`${c}${k}?${l.toString()}`;p(`[voice_stream] Connecting to ${m}`);let h={Authorization:`Bearer ${a.accessToken}`,"User-Agent":o(),"x-app":`cli`},_=S(),v=new n(m,typeof Bun<`u`?{headers:h,proxy:C(m),tls:_||void 0}:{headers:h,agent:b(m),..._}),x=null,w=!1,T=!1,E=!1,M=!1,N=null,P=null,F={send(e){if(v.readyState===n.OPEN){if(T){p(`[voice_stream] Dropping audio chunk after CloseStream: ${String(e.length)} bytes`);return}p(`[voice_stream] Sending audio chunk: ${String(e.length)} bytes`),v.send(Buffer.from(e))}},finalize(){return E||T?Promise.resolve(`ws_already_closed`):(E=!0,new Promise(t=>{let r=setTimeout(()=>N?.(`safety_timeout`),j.safety),i=setTimeout(()=>N?.(`no_data_timeout`),j.noData);if(P=()=>{clearTimeout(i),P=null},N=n=>{if(clearTimeout(r),clearTimeout(i),N=null,P=null,I){p(`[voice_stream] Promoting unreported interim before ${n} resolve`);let t=I;I=``,e.onTranscript(t,!0)}p(`[voice_stream] Finalize resolved via ${n}`),t(n)},v.readyState===n.CLOSED||v.readyState===n.CLOSING){N(`ws_already_closed`);return}setTimeout(()=>{T=!0,v.readyState===n.OPEN&&(p(`[voice_stream] Sending CloseStream (finalize)`),v.send(O))},0)}))},close(){T=!0,x&&(clearInterval(x),x=null),w=!1,v.readyState===n.OPEN&&v.close()},isConnected(){return w&&v.readyState===n.OPEN}};v.on(`open`,()=>{p(`[voice_stream] WebSocket connected`),w=!0,p(`[voice_stream] Sending initial KeepAlive`),v.send(D),x=setInterval(e=>{e.readyState===n.OPEN&&(p(`[voice_stream] Sending periodic KeepAlive`),e.send(D))},A,v),e.onReady(F)});let I=``;return v.on(`message`,t=>{let n=t.toString();p(`[voice_stream] Message received (${String(n.length)} chars): ${n.slice(0,200)}`);let r;try{r=f(n)}catch{return}switch(r.type){case`TranscriptText`:{let t=r.data;if(p(`[voice_stream] TranscriptText: "${t??``}"`),T&&P?.(),t){if(!u&&I){let n=I.trimStart(),r=t.trimStart();n&&r&&!r.startsWith(n)&&!n.startsWith(r)&&(p(`[voice_stream] Auto-finalizing previous segment (new segment detected): "${I}"`),e.onTranscript(I,!0))}I=t,e.onTranscript(t,!1)}break}case`TranscriptEndpoint`:{p(`[voice_stream] TranscriptEndpoint received, lastTranscriptText="${I}"`);let t=I;I=``,t&&e.onTranscript(t,!0),T&&N?.(`post_closestream_endpoint`);break}case`TranscriptError`:{let t=r.description??r.error_code??`unknown transcription error`;p(`[voice_stream] TranscriptError: ${t}`),E||e.onError(t);break}case`error`:{let t=r.message??d(r);p(`[voice_stream] Server error: ${t}`),E||e.onError(t);break}default:break}}),v.on(`close`,(t,n)=>{let r=n?.toString()??``;if(p(`[voice_stream] WebSocket closed: code=${String(t)} reason="${r}"`),w=!1,x&&(clearInterval(x),x=null),I){p(`[voice_stream] Promoting unreported interim transcript to final on close`);let t=I;I=``,e.onTranscript(t,!0)}N?.(`ws_close`),!E&&!M&&t!==1e3&&t!==1005&&e.onError(`Connection closed: code ${String(t)}${r?` — ${r}`:``}`),e.onClose()}),v.on(`unexpected-response`,(t,n)=>{let r=n.statusCode??0;if(r===101){p(`[voice_stream] unexpected-response fired with 101; ignoring`);return}p(`[voice_stream] Upgrade rejected: status=${String(r)} cf-mitigated=${String(n.headers[`cf-mitigated`])} cf-ray=${String(n.headers[`cf-ray`])}`),M=!0,n.resume(),t.destroy(),!E&&e.onError(`WebSocket upgrade rejected with HTTP ${String(r)}`,{fatal:r>=400&&r<500})}),v.on(`error`,t=>{y(t),p(`[voice_stream] WebSocket error: ${t.message}`),E||e.onError(`Voice stream connection error: ${t.message}`)}),F}var D,O,k,A,j,M=e((()=>{t(),_(),l(),m(),u(),v(),x(),w(),h(),a(),D=`{"type":"KeepAlive"}`,O=`{"type":"CloseStream"}`,k=`/api/ws/speech_to_text/voice_stream`,A=8e3,j={safety:5e3,noData:1500}}));export{T as i,E as n,M as r,j as t};
@@ -1 +1 @@
1
- import{Jt as e,on as t}from"./paths-q1-Ni8Oh.js";import{L as n,V as r}from"./debug-UI3T040K.js";import{o as i,t as a}from"./bridgeMain-DlnIQOtX.js";import{resolve as o}from"path";t(),r();var s=78,c=1;async function l(e){if(!e){console.error(`Error: --daemon-worker requires a worker kind`),process.exitCode=s;return}switch(e){case`remoteControl`:await u();break;default:console.error(`Error: unknown daemon worker kind '${e}'`),process.exitCode=s}}async function u(){let t=process.env.DAEMON_WORKER_DIR||o(`.`),r=process.env.DAEMON_WORKER_NAME||void 0,l=process.env.DAEMON_WORKER_SPAWN_MODE||`same-dir`,u=parseInt(process.env.DAEMON_WORKER_CAPACITY||`4`,10),d=process.env.DAEMON_WORKER_PERMISSION||void 0,f=process.env.DAEMON_WORKER_SANDBOX===`1`,p=process.env.DAEMON_WORKER_TIMEOUT_MS?parseInt(process.env.DAEMON_WORKER_TIMEOUT_MS,10):void 0,m=process.env.DAEMON_WORKER_CREATE_SESSION!==`0`,h=new AbortController,g=()=>h.abort();process.on(`SIGTERM`,g),process.on(`SIGINT`,g);let _={dir:t,name:r,spawnMode:l,capacity:u,permissionMode:d,sandbox:f,sessionTimeoutMs:p,createSessionOnStart:m,getAccessToken:()=>e()?.accessToken,onAuth401:async t=>!!e()?.accessToken,log:e=>{console.log(`[remoteControl] ${e}`)}};try{await i(_,h.signal)}catch(e){e instanceof a?(console.error(`[remoteControl] permanent error: ${e.message}`),process.exitCode=s):(console.error(`[remoteControl] transient error: ${n(e)}`),process.exitCode=c)}finally{process.off(`SIGTERM`,g),process.off(`SIGINT`,g)}}export{l as runDaemonWorker};
1
+ import{Jt as e,on as t}from"./paths-D9CVAtXU.js";import{L as n,V as r}from"./debug-UI3T040K.js";import{o as i,t as a}from"./bridgeMain-Bu2oOX31.js";import{resolve as o}from"path";t(),r();var s=78,c=1;async function l(e){if(!e){console.error(`Error: --daemon-worker requires a worker kind`),process.exitCode=s;return}switch(e){case`remoteControl`:await u();break;default:console.error(`Error: unknown daemon worker kind '${e}'`),process.exitCode=s}}async function u(){let t=process.env.DAEMON_WORKER_DIR||o(`.`),r=process.env.DAEMON_WORKER_NAME||void 0,l=process.env.DAEMON_WORKER_SPAWN_MODE||`same-dir`,u=parseInt(process.env.DAEMON_WORKER_CAPACITY||`4`,10),d=process.env.DAEMON_WORKER_PERMISSION||void 0,f=process.env.DAEMON_WORKER_SANDBOX===`1`,p=process.env.DAEMON_WORKER_TIMEOUT_MS?parseInt(process.env.DAEMON_WORKER_TIMEOUT_MS,10):void 0,m=process.env.DAEMON_WORKER_CREATE_SESSION!==`0`,h=new AbortController,g=()=>h.abort();process.on(`SIGTERM`,g),process.on(`SIGINT`,g);let _={dir:t,name:r,spawnMode:l,capacity:u,permissionMode:d,sandbox:f,sessionTimeoutMs:p,createSessionOnStart:m,getAccessToken:()=>e()?.accessToken,onAuth401:async t=>!!e()?.accessToken,log:e=>{console.log(`[remoteControl] ${e}`)}};try{await i(_,h.signal)}catch(e){e instanceof a?(console.error(`[remoteControl] permanent error: ${e.message}`),process.exitCode=s):(console.error(`[remoteControl] transient error: ${n(e)}`),process.exitCode=c)}finally{process.off(`SIGTERM`,g),process.off(`SIGINT`,g)}}export{l as runDaemonWorker};
@@ -0,0 +1 @@
1
+ import{wt as e,yt as t}from"./loadAgentsDir-D-xcJ22-.js";e();export{t as execIntoTmuxWorktree};
@@ -1 +1 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{ds as t,no as n,oo as r,xs as i}from"./paths-q1-Ni8Oh.js";function a(e){d.set(e.name,e)}function o(e){return e.endsWith(`@${f}`)}function s(e){return d.get(e)}function c(){let e=n(),t=[],r=[];for(let[n,i]of d){if(i.isAvailable&&!i.isAvailable())continue;let a=`${n}@${f}`,o=e?.enabledPlugins?.[a],s=o===void 0?i.defaultEnabled??!0:o===!0,c={name:n,manifest:{name:n,description:i.description,version:i.version},path:f,source:a,repository:a,enabled:s,isBuiltin:!0,hooksConfig:i.hooks,mcpServers:i.mcpServers};s?t.push(c):r.push(c)}return{enabled:t,disabled:r}}function l(){let{enabled:e}=c(),t=[];for(let n of e){let e=d.get(n.name);if(e?.skills)for(let n of e.skills)t.push(u(n))}return t}function u(e){return{type:`prompt`,name:e.name,description:e.description,hasUserSpecifiedDescription:!0,allowedTools:e.allowedTools??[],argumentHint:e.argumentHint,whenToUse:e.whenToUse,model:e.model,disableModelInvocation:e.disableModelInvocation??!1,userInvocable:e.userInvocable??!0,contentLength:0,source:`bundled`,loadedFrom:`bundled`,hooks:e.hooks,context:e.context,agent:e.agent,isEnabled:e.isEnabled??(()=>!0),isHidden:!(e.userInvocable??!0),progressMessage:`running`,getPromptForCommand:e.getPromptForCommand}}var d,f,p=e((()=>{r(),d=new Map,f=`builtin`}));function m(e){if(e.includes(`@`)){let t=e.split(`@`);return{name:t[0]||``,marketplace:t[1]}}return{name:e}}function h(e){return e!==void 0&&t.has(e.toLowerCase())}function g(e){if(e===`managed`)throw Error(`Cannot install plugins to managed scope`);return y[e]}function _(e){return v[e]}var v,y,b=e((()=>{i(),v={policySettings:`managed`,userSettings:`user`,projectSettings:`project`,localSettings:`local`,flagSettings:`flag`},y={user:`userSettings`,project:`projectSettings`,local:`localSettings`}}));function x(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function S(e){return x(e).replace(/"/g,`&quot;`).replace(/'/g,`&apos;`)}var C=e((()=>{}));export{h as a,_ as c,l as d,c as f,a as h,b as i,f as l,o as m,S as n,m as o,p,C as r,g as s,x as t,s as u};
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{ds as t,no as n,oo as r,xs as i}from"./paths-D9CVAtXU.js";function a(e){d.set(e.name,e)}function o(e){return e.endsWith(`@${f}`)}function s(e){return d.get(e)}function c(){let e=n(),t=[],r=[];for(let[n,i]of d){if(i.isAvailable&&!i.isAvailable())continue;let a=`${n}@${f}`,o=e?.enabledPlugins?.[a],s=o===void 0?i.defaultEnabled??!0:o===!0,c={name:n,manifest:{name:n,description:i.description,version:i.version},path:f,source:a,repository:a,enabled:s,isBuiltin:!0,hooksConfig:i.hooks,mcpServers:i.mcpServers};s?t.push(c):r.push(c)}return{enabled:t,disabled:r}}function l(){let{enabled:e}=c(),t=[];for(let n of e){let e=d.get(n.name);if(e?.skills)for(let n of e.skills)t.push(u(n))}return t}function u(e){return{type:`prompt`,name:e.name,description:e.description,hasUserSpecifiedDescription:!0,allowedTools:e.allowedTools??[],argumentHint:e.argumentHint,whenToUse:e.whenToUse,model:e.model,disableModelInvocation:e.disableModelInvocation??!1,userInvocable:e.userInvocable??!0,contentLength:0,source:`bundled`,loadedFrom:`bundled`,hooks:e.hooks,context:e.context,agent:e.agent,isEnabled:e.isEnabled??(()=>!0),isHidden:!(e.userInvocable??!0),progressMessage:`running`,getPromptForCommand:e.getPromptForCommand}}var d,f,p=e((()=>{r(),d=new Map,f=`builtin`}));function m(e){if(e.includes(`@`)){let t=e.split(`@`);return{name:t[0]||``,marketplace:t[1]}}return{name:e}}function h(e){return e!==void 0&&t.has(e.toLowerCase())}function g(e){if(e===`managed`)throw Error(`Cannot install plugins to managed scope`);return y[e]}function _(e){return v[e]}var v,y,b=e((()=>{i(),v={policySettings:`managed`,userSettings:`user`,projectSettings:`project`,localSettings:`local`,flagSettings:`flag`},y={user:`userSettings`,project:`projectSettings`,local:`localSettings`}}));function x(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function S(e){return x(e).replace(/"/g,`&quot;`).replace(/'/g,`&apos;`)}var C=e((()=>{}));export{h as a,_ as c,l as d,c as f,a as h,b as i,f as l,o as m,S as n,m as o,p,C as r,g as s,x as t,s as u};
package/dist/cli.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env bun
2
- import{s as e,u as t}from"./chunks/envUtils-BWeoiL4Y.js";var n=globalThis.performance,r=new Map,i=new Map;function a(){return n.now()}function o(e){return r.set(e,a()),{name:e,entryType:`mark`,startTime:r.get(e),duration:0}}function s(e,t,n){let o,s;if(typeof t==`string`){let e=r.get(t),i=n?r.get(n):a();o=e??a(),s=(i??a())-o}else t&&typeof t==`object`?(o=t.start??0,s=(t.end??a())-o):(o=0,s=a());i.set(e,{name:e,startTime:o,duration:s})}function c(e){return e===`mark`?[...r.entries()].map(([e,t])=>({name:e,entryType:`mark`,startTime:t,duration:0})):e===`measure`?[...i.values()].map(e=>({name:e.name,entryType:`measure`,startTime:e.startTime,duration:e.duration})):[]}function l(e,t){return c(t??`mark`).concat(t===void 0?c(`measure`):[]).filter(t=>t.name===e)}function u(e){e===void 0?r.clear():r.delete(e)}function d(e){e===void 0?i.clear():i.delete(e)}var f={now:a,mark:o,measure:s,getEntriesByType:c,getEntriesByName:l,clearMarks:u,clearMeasures:d,clearResourceTimings:(()=>{}),setResourceTimingBufferSize:(()=>{}),markResourceTiming:(()=>{}),get timeOrigin(){return n.timeOrigin},get onresourcetimingbufferfull(){return n.onresourcetimingbufferfull},set onresourcetimingbufferfull(e){},toJSON(){return n.toJSON()}};function p(){globalThis.__performanceShimInstalled||(globalThis.__performanceShimInstalled=!0,globalThis.performance=f)}if(p(),e(),globalThis.MACRO===void 0&&(globalThis.MACRO={VERSION:process.env.CLAUDE_CODE_VERSION||`2.1.888`,BUILD_TIME:new Date().toISOString(),FEEDBACK_CHANNEL:``,ISSUES_EXPLAINER:``,NATIVE_PACKAGE_URL:``,PACKAGE_URL:``,VERSION_CHANGELOG:``}),t(process.env.CLAUDE_CODE_FORCE_INTERACTIVE)){for(let e of[process.stdin,process.stdout,process.stderr])if(!e.isTTY)try{Object.defineProperty(e,`isTTY`,{value:!0,configurable:!0})}catch{}}if(process.env.COREPACK_ENABLE_AUTO_PIN=`0`,process.env.CLAUDE_CODE_REMOTE===`true`){let e=process.env.NODE_OPTIONS||``;process.env.NODE_OPTIONS=e?`${e} --max-old-space-size=8192`:`--max-old-space-size=8192`}async function m(){let e=process.argv.slice(2);if(e.length===1&&(e[0]===`--version`||e[0]===`-v`||e[0]===`-V`)){console.log(`2.6.9 (Claude Code)`);return}let{profileCheckpoint:t}=await import(`./chunks/startupProfiler-SOE--nM9.js`);if(t(`cli_entry`),process.argv[2]===`--claude-in-chrome-mcp`){t(`cli_claude_in_chrome_mcp_path`);let{runClaudeInChromeMcpServer:e}=await import(`./chunks/mcpServer-Wd9rZG_E.js`);await e();return}else if(process.argv[2]===`--chrome-native-host`){t(`cli_chrome_native_host_path`);let{runChromeNativeHost:e}=await import(`./chunks/chromeNativeHost-4U39yLtd.js`);await e();return}else if(process.argv[2]===`--computer-use-mcp`){t(`cli_computer_use_mcp_path`);let{runComputerUseMcpServer:e}=await import(`./chunks/mcpServer-CpBN77YB.js`);await e();return}if(process.argv[2]===`--acp`){t(`cli_acp_path`);let{runAcpAgent:e}=await import(`./chunks/entry-Di8oWZUk.js`);await e();return}if(e[0]===`weixin`){t(`cli_weixin_path`);let{handleWeixinCli:n}=await import(`./chunks/src-BIPP3_mo.js`),{enableConfigs:r}=await import(`./chunks/config-BQ-MayP6.js`),{initializeAnalyticsSink:i}=await import(`./chunks/sink-BSwQ045N.js`),{shutdownDatadog:a}=await import(`./chunks/datadog-MUvg76p3.js`),{shutdown1PEventLogging:o}=await import(`./chunks/firstPartyEventLogger-CISUrAsf.js`),{logForDebugging:s}=await import(`./chunks/debug-DM5ezCBS.js`),{ChannelPermissionRequestNotificationSchema:c}=await import(`./chunks/channelNotification-CLVU5AuO.js`);await n(e.slice(1),{enableConfigs:r,initializeAnalyticsSink:i,shutdownDatadog:a,shutdown1PEventLogging:o,logForDebugging:s,registerPermissionHandler(e,t){e.setNotificationHandler(c(),async e=>t(e.params))}},`2.6.9`);return}if(e[0]===`--daemon-worker`||e[0]?.startsWith(`--daemon-worker=`)){let t=e[0]===`--daemon-worker`?e[1]:e[0].split(`=`)[1],{runDaemonWorker:n}=await import(`./chunks/workerRegistry-CrIpKIZe.js`);await n(t);return}if(e[0]===`remote-control`||e[0]===`rc`||e[0]===`remote`||e[0]===`sync`||e[0]===`bridge`){t(`cli_bridge_path`);let{enableConfigs:n}=await import(`./chunks/config-BQ-MayP6.js`);n();let{getBridgeDisabledReason:r,checkBridgeMinVersion:i}=await import(`./chunks/bridgeEnabled-D5qCI5v2.js`),{BRIDGE_LOGIN_ERROR:a}=await import(`./chunks/types-CQ1wrnQ0.js`),{bridgeMain:o}=await import(`./chunks/bridgeMain-B4Zv8UOe.js`),{exitWithError:s}=await import(`./chunks/process-CWupreF6.js`),{getClaudeAIOAuthTokens:c}=await import(`./chunks/auth-DelyQc8g.js`),{getBridgeAccessToken:l}=await import(`./chunks/bridgeConfig-ZcbBdhji.js`);!c()?.accessToken&&!l()&&s(a);let u=await r();u&&s(`Error: ${u}`);let d=i();d&&s(d);let{waitForPolicyLimitsToLoad:f,isPolicyAllowed:p}=await import(`./chunks/policyLimits-DUGrXcje.js`);await f(),p(`allow_remote_control`)||s(`Error: Remote Control is disabled by your organization's policy.`),await o(e.slice(1));return}if(e[0]===`daemon`){t(`cli_daemon_path`);let{enableConfigs:n}=await import(`./chunks/config-BQ-MayP6.js`);n();let{setShellIfWindows:r}=await import(`./chunks/windowsPaths-C9CigqoF.js`);r();let{initSinks:i}=await import(`./chunks/sinks-DHHmQJi-.js`);i();let{daemonMain:a}=await import(`./chunks/main-C6be1KFk.js`);await a(e.slice(1));return}if(e[0]===`autonomy`){t(`cli_autonomy_path`);let{getAutonomyCommandText:n}=await import(`./chunks/autonomy-tTAucjip.js`),r=await n(e.slice(1).join(` `));await new Promise((e,t)=>{process.stdout.write(`${r}\n`,n=>{if(n){t(n);return}e()})}),process.exit(0)}if(e.includes(`--bg`)||e.includes(`--background`)){t(`cli_daemon_path`);let{enableConfigs:n}=await import(`./chunks/config-BQ-MayP6.js`);n();let{setShellIfWindows:r}=await import(`./chunks/windowsPaths-C9CigqoF.js`);r(),await(await import(`./chunks/bg-Dbh5z3Y8.js`)).handleBgStart(e.filter(e=>e!==`--bg`&&e!==`--background`));return}if(e[0]===`ps`||e[0]===`logs`||e[0]===`attach`||e[0]===`kill`){let n=e[0]===`ps`?`status`:e[0];console.error(`[deprecated] Use: claude daemon ${n}${e[1]?` `+e[1]:``}`),t(`cli_daemon_path`);let{enableConfigs:r}=await import(`./chunks/config-BQ-MayP6.js`);r();let{setShellIfWindows:i}=await import(`./chunks/windowsPaths-C9CigqoF.js`);i();let{initSinks:a}=await import(`./chunks/sinks-DHHmQJi-.js`);a();let{daemonMain:o}=await import(`./chunks/main-C6be1KFk.js`);await o([e[0]===`ps`?`status`:e[0],...e.slice(1)]);return}if(e[0]===`job`){t(`cli_templates_path`);let{templatesMain:n}=await import(`./chunks/templateJobs-V2-TVeGE.js`);await n(e.slice(1)),process.exit(0)}if(e[0]===`new`||e[0]===`list`||e[0]===`reply`){console.error(`[deprecated] Use: claude job ${e[0]} ${e.slice(1).join(` `)}`.trim()),t(`cli_templates_path`);let{templatesMain:n}=await import(`./chunks/templateJobs-V2-TVeGE.js`);await n(e),process.exit(0)}if((e.includes(`--tmux`)||e.includes(`--tmux=classic`))&&(e.includes(`-w`)||e.includes(`--worktree`)||e.some(e=>e.startsWith(`--worktree=`)))){t(`cli_tmux_worktree_fast_path`);let{enableConfigs:n}=await import(`./chunks/config-BQ-MayP6.js`);n();let{isWorktreeModeEnabled:r}=await import(`./chunks/worktreeModeEnabled-THQb19xR.js`);if(r()){let{execIntoTmuxWorktree:t}=await import(`./chunks/worktree-YbEK6b36.js`),n=await t(e);if(n.handled)return;if(n.error){let{exitWithError:e}=await import(`./chunks/process-CWupreF6.js`);e(n.error)}}}e.length===1&&(e[0]===`--update`||e[0]===`--upgrade`)&&(process.argv=[process.argv[0],process.argv[1],`update`]),e.includes(`--bare`)&&(process.env.CLAUDE_CODE_SIMPLE=`1`);let{startCapturingEarlyInput:n}=await import(`./chunks/earlyInput-JGJo1zcC.js`);n(),t(`cli_before_main_import`);let{main:r}=await import(`./chunks/main-gTbhsbIs.js`);t(`cli_after_main_import`),await r(),t(`cli_after_main_complete`)}await m();export{};
2
+ import{s as e,u as t}from"./chunks/envUtils-BWeoiL4Y.js";var n=globalThis.performance,r=new Map,i=new Map;function a(){return n.now()}function o(e){return r.set(e,a()),{name:e,entryType:`mark`,startTime:r.get(e),duration:0}}function s(e,t,n){let o,s;if(typeof t==`string`){let e=r.get(t),i=n?r.get(n):a();o=e??a(),s=(i??a())-o}else t&&typeof t==`object`?(o=t.start??0,s=(t.end??a())-o):(o=0,s=a());i.set(e,{name:e,startTime:o,duration:s})}function c(e){return e===`mark`?[...r.entries()].map(([e,t])=>({name:e,entryType:`mark`,startTime:t,duration:0})):e===`measure`?[...i.values()].map(e=>({name:e.name,entryType:`measure`,startTime:e.startTime,duration:e.duration})):[]}function l(e,t){return c(t??`mark`).concat(t===void 0?c(`measure`):[]).filter(t=>t.name===e)}function u(e){e===void 0?r.clear():r.delete(e)}function d(e){e===void 0?i.clear():i.delete(e)}var f={now:a,mark:o,measure:s,getEntriesByType:c,getEntriesByName:l,clearMarks:u,clearMeasures:d,clearResourceTimings:(()=>{}),setResourceTimingBufferSize:(()=>{}),markResourceTiming:(()=>{}),get timeOrigin(){return n.timeOrigin},get onresourcetimingbufferfull(){return n.onresourcetimingbufferfull},set onresourcetimingbufferfull(e){},toJSON(){return n.toJSON()}};function p(){globalThis.__performanceShimInstalled||(globalThis.__performanceShimInstalled=!0,globalThis.performance=f)}if(p(),e(),globalThis.MACRO===void 0&&(globalThis.MACRO={VERSION:process.env.CLAUDE_CODE_VERSION||`2.1.888`,BUILD_TIME:new Date().toISOString(),FEEDBACK_CHANNEL:``,ISSUES_EXPLAINER:``,NATIVE_PACKAGE_URL:``,PACKAGE_URL:``,VERSION_CHANGELOG:``}),t(process.env.CLAUDE_CODE_FORCE_INTERACTIVE)){for(let e of[process.stdin,process.stdout,process.stderr])if(!e.isTTY)try{Object.defineProperty(e,`isTTY`,{value:!0,configurable:!0})}catch{}}if(process.env.COREPACK_ENABLE_AUTO_PIN=`0`,process.env.CLAUDE_CODE_REMOTE===`true`){let e=process.env.NODE_OPTIONS||``;process.env.NODE_OPTIONS=e?`${e} --max-old-space-size=8192`:`--max-old-space-size=8192`}async function m(){let e=process.argv.slice(2);if(e.length===1&&(e[0]===`--version`||e[0]===`-v`||e[0]===`-V`)){console.log(`2.6.11 (Claude Code)`);return}let{profileCheckpoint:t}=await import(`./chunks/startupProfiler-SOE--nM9.js`);if(t(`cli_entry`),process.argv[2]===`--claude-in-chrome-mcp`){t(`cli_claude_in_chrome_mcp_path`);let{runClaudeInChromeMcpServer:e}=await import(`./chunks/mcpServer-C-0K3Azg.js`);await e();return}else if(process.argv[2]===`--chrome-native-host`){t(`cli_chrome_native_host_path`);let{runChromeNativeHost:e}=await import(`./chunks/chromeNativeHost-4U39yLtd.js`);await e();return}else if(process.argv[2]===`--computer-use-mcp`){t(`cli_computer_use_mcp_path`);let{runComputerUseMcpServer:e}=await import(`./chunks/mcpServer-C_aDoLMg.js`);await e();return}if(process.argv[2]===`--acp`){t(`cli_acp_path`);let{runAcpAgent:e}=await import(`./chunks/entry-D8y42iuM.js`);await e();return}if(e[0]===`weixin`){t(`cli_weixin_path`);let{handleWeixinCli:n}=await import(`./chunks/src-BIPP3_mo.js`),{enableConfigs:r}=await import(`./chunks/config-JGm0O-ZQ.js`),{initializeAnalyticsSink:i}=await import(`./chunks/sink-fGBOXJab.js`),{shutdownDatadog:a}=await import(`./chunks/datadog-Da7KYZNF.js`),{shutdown1PEventLogging:o}=await import(`./chunks/firstPartyEventLogger-Dr3TK3IU.js`),{logForDebugging:s}=await import(`./chunks/debug-DM5ezCBS.js`),{ChannelPermissionRequestNotificationSchema:c}=await import(`./chunks/channelNotification-B7s1OoRK.js`);await n(e.slice(1),{enableConfigs:r,initializeAnalyticsSink:i,shutdownDatadog:a,shutdown1PEventLogging:o,logForDebugging:s,registerPermissionHandler(e,t){e.setNotificationHandler(c(),async e=>t(e.params))}},`2.6.11`);return}if(e[0]===`--daemon-worker`||e[0]?.startsWith(`--daemon-worker=`)){let t=e[0]===`--daemon-worker`?e[1]:e[0].split(`=`)[1],{runDaemonWorker:n}=await import(`./chunks/workerRegistry-Bg7dWLHf.js`);await n(t);return}if(e[0]===`remote-control`||e[0]===`rc`||e[0]===`remote`||e[0]===`sync`||e[0]===`bridge`){t(`cli_bridge_path`);let{enableConfigs:n}=await import(`./chunks/config-JGm0O-ZQ.js`);n();let{getBridgeDisabledReason:r,checkBridgeMinVersion:i}=await import(`./chunks/bridgeEnabled-CjaYKTo5.js`),{BRIDGE_LOGIN_ERROR:a}=await import(`./chunks/types-CQ1wrnQ0.js`),{bridgeMain:o}=await import(`./chunks/bridgeMain-CEpOBx8Z.js`),{exitWithError:s}=await import(`./chunks/process-CWupreF6.js`),{getClaudeAIOAuthTokens:c}=await import(`./chunks/auth-DxRiJwZ-.js`),{getBridgeAccessToken:l}=await import(`./chunks/bridgeConfig-Dkn5GGec.js`);!c()?.accessToken&&!l()&&s(a);let u=await r();u&&s(`Error: ${u}`);let d=i();d&&s(d);let{waitForPolicyLimitsToLoad:f,isPolicyAllowed:p}=await import(`./chunks/policyLimits-sh7ywop0.js`);await f(),p(`allow_remote_control`)||s(`Error: Remote Control is disabled by your organization's policy.`),await o(e.slice(1));return}if(e[0]===`daemon`){t(`cli_daemon_path`);let{enableConfigs:n}=await import(`./chunks/config-JGm0O-ZQ.js`);n();let{setShellIfWindows:r}=await import(`./chunks/windowsPaths-C9CigqoF.js`);r();let{initSinks:i}=await import(`./chunks/sinks-BCl9slVM.js`);i();let{daemonMain:a}=await import(`./chunks/main-C6be1KFk.js`);await a(e.slice(1));return}if(e[0]===`autonomy`){t(`cli_autonomy_path`);let{getAutonomyCommandText:n}=await import(`./chunks/autonomy-CNJQwoAQ.js`),r=await n(e.slice(1).join(` `));await new Promise((e,t)=>{process.stdout.write(`${r}\n`,n=>{if(n){t(n);return}e()})}),process.exit(0)}if(e.includes(`--bg`)||e.includes(`--background`)){t(`cli_daemon_path`);let{enableConfigs:n}=await import(`./chunks/config-JGm0O-ZQ.js`);n();let{setShellIfWindows:r}=await import(`./chunks/windowsPaths-C9CigqoF.js`);r(),await(await import(`./chunks/bg-Dbh5z3Y8.js`)).handleBgStart(e.filter(e=>e!==`--bg`&&e!==`--background`));return}if(e[0]===`ps`||e[0]===`logs`||e[0]===`attach`||e[0]===`kill`){let n=e[0]===`ps`?`status`:e[0];console.error(`[deprecated] Use: claude daemon ${n}${e[1]?` `+e[1]:``}`),t(`cli_daemon_path`);let{enableConfigs:r}=await import(`./chunks/config-JGm0O-ZQ.js`);r();let{setShellIfWindows:i}=await import(`./chunks/windowsPaths-C9CigqoF.js`);i();let{initSinks:a}=await import(`./chunks/sinks-BCl9slVM.js`);a();let{daemonMain:o}=await import(`./chunks/main-C6be1KFk.js`);await o([e[0]===`ps`?`status`:e[0],...e.slice(1)]);return}if(e[0]===`job`){t(`cli_templates_path`);let{templatesMain:n}=await import(`./chunks/templateJobs-BLQqrGjb.js`);await n(e.slice(1)),process.exit(0)}if(e[0]===`new`||e[0]===`list`||e[0]===`reply`){console.error(`[deprecated] Use: claude job ${e[0]} ${e.slice(1).join(` `)}`.trim()),t(`cli_templates_path`);let{templatesMain:n}=await import(`./chunks/templateJobs-BLQqrGjb.js`);await n(e),process.exit(0)}if((e.includes(`--tmux`)||e.includes(`--tmux=classic`))&&(e.includes(`-w`)||e.includes(`--worktree`)||e.some(e=>e.startsWith(`--worktree=`)))){t(`cli_tmux_worktree_fast_path`);let{enableConfigs:n}=await import(`./chunks/config-JGm0O-ZQ.js`);n();let{isWorktreeModeEnabled:r}=await import(`./chunks/worktreeModeEnabled-THQb19xR.js`);if(r()){let{execIntoTmuxWorktree:t}=await import(`./chunks/worktree-Cg4p1J__.js`),n=await t(e);if(n.handled)return;if(n.error){let{exitWithError:e}=await import(`./chunks/process-CWupreF6.js`);e(n.error)}}}e.length===1&&(e[0]===`--update`||e[0]===`--upgrade`)&&(process.argv=[process.argv[0],process.argv[1],`update`]),e.includes(`--bare`)&&(process.env.CLAUDE_CODE_SIMPLE=`1`);let{startCapturingEarlyInput:n}=await import(`./chunks/earlyInput-JGJo1zcC.js`);n(),t(`cli_before_main_import`);let{main:r}=await import(`./chunks/main-DGsAUuG_.js`);t(`cli_after_main_import`),await r(),t(`cli_after_main_complete`)}await m();export{};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-code-best",
3
- "version": "2.6.9",
3
+ "version": "2.6.11",
4
4
  "description": "Reverse-engineered Anthropic Claude Code CLI — interactive AI coding assistant in the terminal",
5
5
  "type": "module",
6
6
  "author": "claude-code-best <claude-code-best@proton.me>",
@@ -1 +0,0 @@
1
- import{t as e}from"./ApproveApiKey-B7oSxzWc.js";export{e as ApproveApiKey};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./ClaudeMdExternalIncludesDialog-DLI6ey3G.js";e();export{t as ClaudeMdExternalIncludesDialog};
@@ -1 +0,0 @@
1
- import{_y as e,vy as t}from"./loadAgentsDir-Cl2w3uvH.js";t();export{e as ConsoleOAuthFlow};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./Doctor-DVoFX-9y.js";e();export{t as Doctor};
@@ -1,2 +0,0 @@
1
- import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{n,t as r}from"./axios-DhfaybwJ.js";import{F as i,Rn as a,b as o,f as s,g as c,h as l,t as u,tt as d,x as f,xt as ee}from"./src-Di342QoJ.js";import{t as p}from"./jsx-runtime-D-D469L8.js";import{cn as m,q as h}from"./state-sIHsFpDu.js";import{F as te,M as g,Pt as _,St as v,bt as y,on as b,wt as x}from"./paths-q1-Ni8Oh.js";import{E as S,d as C,s as w,w as T}from"./debug-UI3T040K.js";import{n as E,r as ne}from"./analytics-DqMQntaB.js";import{c as re,f as ie,v as D}from"./git-CN3qtTb_.js";import{a as O,n as k}from"./env-chR0gV31.js";import{d as A,f as ae,i as oe,o as se,s as j}from"./log-CzsijfHZ.js";import{AO as ce,Ar as le,Bx as M,Do as N,Hr as P,Ko as F,LO as I,Lo as L,Tr as R,Uw as z,eC as B,kO as V,nt as H,sr as U,tC as W,tt as ue,zx as de}from"./loadAgentsDir-Cl2w3uvH.js";import{X as fe}from"./rcDebugLog-fhwD4wm-.js";import{n as pe,t as me}from"./browser-fLRXxIsQ.js";import{t as he}from"./useKeybinding-FsOnjW6T.js";import{readFile as ge,stat as _e}from"fs/promises";function G(e){let t=e;return t=t.replace(/"(sk-ant[^\s"']{24,})"/g,`"[REDACTED_API_KEY]"`),t=t.replace(/(?<![A-Za-z0-9"'])(sk-ant-?[A-Za-z0-9_-]{10,})(?![A-Za-z0-9"'])/g,`[REDACTED_API_KEY]`),t=t.replace(/AWS key: "(AWS[A-Z0-9]{20,})"/g,`AWS key: "[REDACTED_AWS_KEY]"`),t=t.replace(/(AKIA[A-Z0-9]{16})/g,`[REDACTED_AWS_KEY]`),t=t.replace(/(?<![A-Za-z0-9])(AIza[A-Za-z0-9_-]{35})(?![A-Za-z0-9])/g,`[REDACTED_GCP_KEY]`),t=t.replace(/(?<![A-Za-z0-9])([a-z0-9-]+@[a-z0-9-]+\.iam\.gserviceaccount\.com)(?![A-Za-z0-9])/g,`[REDACTED_GCP_SERVICE_ACCOUNT]`),t=t.replace(/(["']?x-api-key["']?\s*[:=]\s*["']?)[^"',\s)}\]]+/gi,`$1[REDACTED_API_KEY]`),t=t.replace(/(["']?authorization["']?\s*[:=]\s*["']?(bearer\s+)?)[^"',\s)}\]]+/gi,`$1[REDACTED_TOKEN]`),t=t.replace(/(AWS[_-][A-Za-z0-9_]+\s*[=:]\s*)["']?[^"',\s)}\]]+["']?/gi,`$1[REDACTED_AWS_VALUE]`),t=t.replace(/(GOOGLE[_-][A-Za-z0-9_]+\s*[=:]\s*)["']?[^"',\s)}\]]+["']?/gi,`$1[REDACTED_GCP_VALUE]`),t=t.replace(/((API[-_]?KEY|TOKEN|SECRET|PASSWORD)\s*[=:]\s*)["']?[^"',\s)}\]]+["']?/gi,`$1[REDACTED]`),t}function K(){return oe().map(e=>{let t={...e};return t&&typeof t.error==`string`&&(t.error=G(t.error)),t})}async function q(){try{let e=R(),{size:t}=await _e(e);return t>52428800?(C(`Skipping raw transcript read: file too large (${t} bytes)`,{level:`warn`}),null):await ge(e,`utf-8`)}catch{return null}}function ve({abortSignal:e,messages:t,initialDescription:n,onDone:r,backgroundTasks:a={}}){let[u,p]=(0,X.useState)(`userInput`),[m,g]=(0,X.useState)(0),[_,v]=(0,X.useState)(n??``),[y,b]=(0,X.useState)(null),[x,S]=(0,X.useState)(null),[C,w]=(0,X.useState)({isGit:!1,gitState:null}),[T,E]=(0,X.useState)(null),D=i().columns-4;(0,X.useEffect)(()=>{async function e(){let e=await ie(),t=null;e&&(t=await re()),w({isGit:e,gitState:t})}e()},[]);let O=(0,X.useCallback)(async()=>{p(`submitting`),S(null),b(null);let n=K(),r=N(t)?.requestId??null,[i,o]=await Promise.all([P(),q()]),s=U(a),c={...i,...s},l={latestAssistantMessageId:r,message_count:t.length,datetime:new Date().toISOString(),description:_,platform:k.platform,gitRepo:C.isGit,terminal:k.terminal,version:`2.6.9`,transcript:F(t),errors:n,lastApiRequest:h(),...Object.keys(c).length>0&&{subagentTranscripts:c},...o&&{rawTranscriptJsonl:o}},[u,d]=await Promise.all([xe(l,e),be(_,e)]);E(d),u.success?(u.feedbackId&&(b(u.feedbackId),ne(`tengu_bug_report_submitted`,{feedback_id:u.feedbackId,last_assistant_message_id:r}),te(`tengu_bug_report_description`,{feedback_id:u.feedbackId,description:G(_)})),p(`done`)):(u.isZdrOrg?S(`Feedback collection is not available for organizations with custom data retention policies.`):S(`Could not submit feedback. Please try again later.`),p(`userInput`))},[_,C.isGit,t]),A=(0,X.useCallback)(()=>{if(u===`done`){r(x?`Error submitting feedback / bug report`:`Feedback / bug report submitted`,{display:`system`});return}r(`Feedback / bug report cancelled`,{display:`system`})},[u,x,r]);return d(`confirm:no`,A,{context:`Settings`,isActive:u===`userInput`}),ee((e,t)=>{if(u===`done`){t.return&&T&&pe(ye(y??``,T,_,K())),r(x?`Error submitting feedback / bug report`:`Feedback / bug report submitted`,{display:`system`});return}if(x&&u!==`userInput`){r(`Error submitting feedback / bug report`,{display:`system`});return}u===`consent`&&(t.return||e===` `)&&O()}),(0,Z.jsxs)(s,{title:`Submit Feedback / Bug Report`,onCancel:A,isCancelActive:u!==`userInput`,inputGuide:e=>e.pending?(0,Z.jsxs)(o,{children:[`Press `,e.keyName,` again to exit`]}):u===`userInput`?(0,Z.jsxs)(l,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`continue`}),(0,Z.jsx)(B,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]}):u===`consent`?(0,Z.jsxs)(l,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`submit`}),(0,Z.jsx)(B,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]}):null,children:[u===`userInput`&&(0,Z.jsxs)(f,{flexDirection:`column`,gap:1,children:[(0,Z.jsx)(o,{children:`Describe the issue below:`}),(0,Z.jsx)(de,{value:_,onChange:e=>{v(e),x&&S(null)},columns:D,onSubmit:()=>p(`consent`),onExitMessage:()=>r(`Feedback cancelled`,{display:`system`}),cursorOffset:m,onChangeCursorOffset:g,showCursor:!0}),x&&(0,Z.jsxs)(f,{flexDirection:`column`,gap:1,children:[(0,Z.jsx)(o,{color:`error`,children:x}),(0,Z.jsx)(o,{dimColor:!0,children:`Edit and press Enter to retry, or Esc to cancel`})]})]}),u===`consent`&&(0,Z.jsxs)(f,{flexDirection:`column`,children:[(0,Z.jsx)(o,{children:`This report will include:`}),(0,Z.jsxs)(f,{marginLeft:2,flexDirection:`column`,children:[(0,Z.jsxs)(o,{children:[`- Your feedback / bug description: `,(0,Z.jsx)(o,{dimColor:!0,children:_})]}),(0,Z.jsxs)(o,{children:[`- Environment info:`,` `,(0,Z.jsxs)(o,{dimColor:!0,children:[k.platform,`, `,k.terminal,`, v`,`2.6.9`]})]}),C.gitState&&(0,Z.jsxs)(o,{children:[`- Git repo metadata:`,` `,(0,Z.jsxs)(o,{dimColor:!0,children:[C.gitState.branchName,C.gitState.commitHash?`, ${C.gitState.commitHash.slice(0,7)}`:``,C.gitState.remoteUrl?` @ ${C.gitState.remoteUrl}`:``,!C.gitState.isHeadOnRemote&&`, not synced`,!C.gitState.isClean&&`, has local changes`]})]}),(0,Z.jsx)(o,{children:`- Current session transcript`})]}),(0,Z.jsx)(f,{marginTop:1,children:(0,Z.jsx)(o,{wrap:`wrap`,dimColor:!0,children:`We will use your feedback to debug related issues or to improve Claude Code's functionality (eg. to reduce the risk of bugs occurring in the future).`})}),(0,Z.jsx)(f,{marginTop:1,children:(0,Z.jsxs)(o,{children:[`Press `,(0,Z.jsx)(o,{bold:!0,children:`Enter`}),` to confirm and submit.`]})})]}),u===`submitting`&&(0,Z.jsx)(f,{flexDirection:`row`,gap:1,children:(0,Z.jsx)(o,{children:`Submitting report…`})}),u===`done`&&(0,Z.jsxs)(f,{flexDirection:`column`,children:[x?(0,Z.jsx)(o,{color:`error`,children:x}):(0,Z.jsx)(o,{color:`success`,children:`Thank you for your report!`}),y&&(0,Z.jsxs)(o,{dimColor:!0,children:[`Feedback ID: `,y]}),(0,Z.jsxs)(f,{marginTop:1,children:[(0,Z.jsx)(o,{children:`Press `}),(0,Z.jsx)(o,{bold:!0,children:`Enter `}),(0,Z.jsx)(o,{children:`to open your browser and draft a GitHub issue, or any other key to close.`})]})]})]})}function ye(e,t,n,r){let i=G(t),a=`**Bug Description**\n${G(n)}\n\n**Environment Info**\n- Platform: ${k.platform}\n- Terminal: ${k.terminal}\n- Version: 2.6.9\n- Feedback ID: ${e}\n\n**Errors**\n\`\`\`json\n`,o=S(r),s=`${$}/new?title=${encodeURIComponent(i)}&labels=user-reported,bug&body=`,c=encodeURIComponent(a),l=encodeURIComponent(o),u=Q-s.length-c.length-15-46;if(u<=0){let e=Q-s.length-9-46-50,t=a+o+"\n```\n",n=encodeURIComponent(t);if(n.length>e){n=n.slice(0,e);let t=n.lastIndexOf(`%`);t>=n.length-2&&(n=n.slice(0,t))}return s+n+`%E2%80%A6%0A**Note%3A**%20Content%20was%20truncated.%0A`}if(l.length<=u)return s+c+l+`%0A%60%60%60%0A`;let d=l.slice(0,u-9-50),f=d.lastIndexOf(`%`);return f>=d.length-2&&(d=d.slice(0,f)),s+c+d+`%E2%80%A6%0A%60%60%60%0A%0A**Note%3A**%20Content%20was%20truncated.%0A`}async function be(e,t){try{let n=(await H({systemPrompt:fe([`Generate a concise, technical issue title (max 80 chars) for a public GitHub issue based on this bug report for Claude Code.`,`Claude Code is an agentic coding CLI based on the Anthropic API.`,`The title should:`,`- Include the type of issue [Bug] or [Feature Request] as the first thing in the title`,`- Be concise, specific and descriptive of the actual problem`,`- Use technical terminology appropriate for a software issue`,`- For error messages, extract the key error (e.g., "Missing Tool Result Block" rather than the full message)`,`- Be direct and clear for developers to understand the problem`,`- If you cannot determine a clear issue, use "Bug Report: [brief description]"`,`- Any LLM API errors are from the Anthropic API, not from any other model provider`,`Your response will be directly used as the title of the Github issue, and as such should not contain any other commentary or explaination`,`Examples of good titles include: "[Bug] Auto-Compact triggers to soon", "[Bug] Anthropic API Error: Missing Tool Result Block", "[Bug] Error: Invalid Model Name for Opus"`]),userPrompt:e,signal:t,options:{hasAppendSystemPrompt:!1,toolChoice:void 0,isNonInteractiveSession:!1,agents:[],querySource:`feedback`,mcpTools:[]}}))?.message?.content?.[0],r=n?.type===`text`?n.text:`Bug Report`;return ce(r)?J(e):r}catch(t){return j(t),J(e)}}function J(e){let t=e.split(`
2
- `)[0]||``;if(t.length<=60&&t.length>5)return t;let n=t.slice(0,60);if(t.length>60){let e=n.lastIndexOf(` `);e>30&&(n=n.slice(0,e)),n+=`...`}return n.length<10?`Bug Report`:n}function Y(e){if(e instanceof Error){let t=Error(G(e.message));e.stack&&(t.stack=G(e.stack)),j(t)}else{let t=G(String(e));j(Error(t))}}async function xe(e,t){if(ae())return{success:!1};try{await _();let r=y();if(r.error)return{success:!1};let i={"Content-Type":`application/json`,"User-Agent":v(),...r.headers},a=await n.post(`https://api.anthropic.com/api/claude_cli_feedback`,{content:S(e)},{headers:i,timeout:3e4,signal:t});if(a.status===200){let e=a.data;return e?.feedback_id?{success:!0,feedbackId:e.feedback_id}:(Y(Error(`Failed to submit feedback: request did not return feedback_id`)),{success:!1})}return Y(Error(`Failed to submit feedback:`+a.status)),{success:!1}}catch(e){if(n.isCancel(e))return{success:!1};if(n.isAxiosError(e)&&e.response?.status===403){let t=e.response.data;if(t?.error?.type===`permission_error`&&t?.error?.message?.includes(`Custom data retention settings`))return Y(Error(`Cannot submit feedback because custom data retention settings are enabled`)),{success:!1,isZdrOrg:!0}}return Y(e),{success:!1}}}var X,Z,Q,$,Se=e((()=>{r(),a(),X=t(a(),1),m(),g(),E(),L(),z(),u(),he(),ue(),V(),b(),me(),w(),O(),D(),x(),se(),A(),le(),T(),I(),W(),M(),Z=p(),Q=7250,$=process.env.USER_TYPE===`ant`?`https://github.com/anthropics/claude-cli-internal/issues`:`https://github.com/anthropics/claude-code/issues`}));export{Se as n,G as r,ve as t};
@@ -1 +0,0 @@
1
- import{r as e,t}from"./Grove-G0DtwY22.js";e();export{t as GroveDialog};
@@ -1,3 +0,0 @@
1
- import{n as e,o as t,r as n}from"./chunk-DR8-3Aex.js";import{n as r,t as i}from"./figures-gfT9mM8P.js";import{F as a,Rn as o,b as s,m as c,nt as l,t as u,tt as d,x as f}from"./src-Di342QoJ.js";import{t as p}from"./jsx-runtime-D-D469L8.js";import{Ct as m,cn as h,mr as g,vt as _}from"./state-sIHsFpDu.js";import{Ht as v,es as y,no as b,on as x,oo as S,pi as C,rs as w,vi as T}from"./paths-q1-Ni8Oh.js";import{n as E,r as D}from"./analytics-DqMQntaB.js";import{n as O,t as k}from"./cwd--iizewsn.js";import{O as A,et as j,h as ee,m as te,o as ne,s as M}from"./log-CzsijfHZ.js";import{b as N,x as re}from"./teammate-DMYOtLTK.js";import{C as ie,g as ae,x as oe}from"./startupProfiler-DnXZaX4A.js";import{BO as se,Dc as P,Ec as ce,Eo as F,GE as le,KE as ue,LS as de,Lo as I,Nx as fe,Px as pe,RO as L,RS as me,Rc as R,So as z,Sy as B,Ui as he,Uo as ge,Uw as _e,VO as ve,Vi as ye,Vo as be,Xi as xe,_o as Se,aC as Ce,an as we,bo as V,by as Te,ey as Ee,fo as De,hn as Oe,iu as H,kc as ke,la as Ae,nu as je,ny as Me,os as Ne,sC as Pe,sy as Fe,ty as Ie,yn as Le,zc as Re,zo as ze}from"./loadAgentsDir-Cl2w3uvH.js";import{E as Be,T as Ve,c as He,d as Ue,w as We}from"./sessionTracing-BkzKJi0v.js";import{t as Ge}from"./useKeybinding-FsOnjW6T.js";import{l as Ke,u as qe}from"./referral-rRvT6UDX.js";import{n as Je,t as Ye}from"./slashCommandParsing-Cari0pNg.js";import*as U from"path";import{randomUUID as W}from"crypto";o();var G=p();r(),u(),h(),E(),O(),j(),te(),ne(),re(),oe(),w(),S(),x(),se(),We(),le(),Ce(),He(),je(),R(),ke(),Ne(),I(),xe(),Le(),Ye();var Xe={"`":"`",'"':`"`,"<":`>`,"{":`}`,"[":`]`,"(":`)`,"'":`'`};function Ze(e,t){if(!new RegExp(t,`i`).test(e)||e.startsWith(`/`))return[];let n=[],r=null,i=0,a=e=>!!e&&/[\p{L}\p{N}_]/u.test(e);for(let t=0;t<e.length;t++){let o=e[t];if(r){if(r===`[`&&o===`[`){i=t;continue}if(o!==Xe[r]||r===`'`&&a(e[t+1]))continue;n.push({start:i,end:t+1}),r=null}else (o===`<`&&t+1<e.length&&/[a-zA-Z/]/.test(e[t+1])||o===`'`&&!a(e[t-1])||o!==`<`&&o!==`'`&&o in Xe)&&(r=o,i=t)}let o=[],s=RegExp(`\\b${t}\\b`,`gi`),c=e.matchAll(s);for(let t of c){if(t.index===void 0)continue;let r=t.index,i=r+t[0].length;if(n.some(e=>r>=e.start&&r<e.end))continue;let s=e[r-1],c=e[i];s===`/`||s===`\\`||s===`-`||c===`/`||c===`\\`||c===`-`||c===`?`||c===`.`&&a(e[i+1])||o.push({word:t[0],start:r,end:i})}return o}function K(e){return Ze(e,`ultraplan`)}function Qe(e){return Ze(e,`ultrareview`)}function $e(e){return K(e).length>0}function et(e){let[t]=K(e);if(!t)return e;let n=e.slice(0,t.start),r=e.slice(t.end);return(n+r).trim()?n+t.word.slice(5)+r:``}function tt(e){let t=e.toLowerCase();return/\b(wtf|wth|ffs|omfg|shit(ty|tiest)?|dumbass|horrible|awful|piss(ed|ing)? off|piece of (shit|crap|junk)|what the (fuck|hell)|fucking? (broken|useless|terrible|awful|horrible)|fuck you|screw (this|you)|so frustrating|this sucks|damn it)\b/.test(t)}function nt(e){let t=e.toLowerCase().trim();return t===`continue`?!0:/\b(keep going|go on)\b/.test(t)}function rt(e,t,n,r,i,a,o){let s=W();g(s);let c=typeof e==`string`?e:e.find(e=>e.type===`text`)?.text||``;Ue(c);let l=typeof e==`string`?e:e.findLast(e=>e.type===`text`)?.text||``;return l&&Ve(`user_prompt`,{prompt_length:String(l.length),prompt:Be(l),"prompt.id":s}),D(`tengu_input_prompt`,{is_negative:tt(c),is_keep_going:nt(c)}),t.length>0?{messages:[V({content:[...typeof e==`string`?e.trim()?[{type:`text`,text:e}]:[]:e,...t],uuid:i,imagePasteIds:n.length>0?n:void 0,permissionMode:a,isMeta:o||void 0}),...r],shouldQuery:!0}:{messages:[V({content:e,uuid:i,permissionMode:a,isMeta:o||void 0}),...r],shouldQuery:!0}}E(),I();async function it({input:e,preExpansionInput:t,mode:n,setToolJSX:r,context:i,pastedContents:a,ideSelection:o,messages:s,setUserInputOnProcessing:c,uuid:l,isAlreadyProcessing:u,querySource:d,canUseTool:f,skipSlashCommands:p,bridgeOrigin:m,isMeta:h,skipAttachments:g,autonomy:_}){let v=typeof e==`string`?e:null;n===`prompt`&&v!==null&&!h&&c?.(v),H(`query_process_user_input_base_start`);let y=i.getAppState(),b=await ot(e,n,r,i,a,o,s,l,u,d,f,y.toolPermissionContext.mode,p,m,h,g,t,_);if(H(`query_process_user_input_base_end`),!b.shouldQuery)return b;H(`query_hooks_start`);let x=F(e)||``;for await(let t of we(x,y.toolPermissionContext.mode,i,i.requestPrompt))if(t.message?.type!==`progress`){if(t.blockingError)return{messages:[Se(`${Oe(t.blockingError)}\n\nOriginal prompt: ${e}`,`warning`)],shouldQuery:!1,allowedTools:b.allowedTools};if(t.preventContinuation){let e=t.stopReason?`Operation stopped by hook: ${t.stopReason}`:`Operation stopped by hook`;return b.messages.push(V({content:e})),b.shouldQuery=!1,b}if(t.additionalContexts&&t.additionalContexts.length>0&&b.messages.push(ce({type:`hook_additional_context`,content:t.additionalContexts.map(at),hookName:`UserPromptSubmit`,toolUseID:`hook-${W()}`,hookEvent:`UserPromptSubmit`})),t.message)switch(t.message.attachment.type){case`hook_success`:if(!t.message.attachment.content)break;b.messages.push({...t.message,attachment:{...t.message.attachment,content:at(t.message.attachment.content)}});break;default:b.messages.push(t.message);break}}return H(`query_hooks_end`),b}var q=1e4;function at(e){return e.length>q?`${e.substring(0,q)}… [output truncated - exceeded ${q} characters]`:e}async function ot(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_){let v=null,y=[],b=[],x=e;if(typeof e==`string`)v=e;else if(e.length>0){H(`query_image_processing_start`);let t=[];for(let n of e)if(n.type===`image`){let e=await ve(n);if(e.dimensions){let t=L(e.dimensions);t&&b.push(t)}t.push(e.block)}else t.push(n);x=t,H(`query_image_processing_end`);let n=t[t.length-1];n?.type===`text`?(v=n.text,y=t.slice(0,-1)):y=t}if(v===null&&t!==`prompt`)throw Error(`Mode: ${t} requires a string input.`);let S=i?Object.values(i).filter(Re):[],C=S.map(e=>e.id),w=i?await Pe(i):new Map;H(`query_pasted_image_processing_start`);let T=await Promise.all(S.map(async e=>{let t={type:`image`,source:{type:`base64`,media_type:e.mediaType||`image/png`,data:e.content}};return D(`tengu_pasted_image_resize_attempt`,{original_size_bytes:e.content.length}),{resized:await ve(t),originalDimensions:e.dimensions,sourcePath:e.sourcePath??w.get(e.id)}})),E=[];for(let{resized:e,originalDimensions:t,sourcePath:n}of T){if(e.dimensions){let t=L(e.dimensions,n);t&&b.push(t)}else if(t){let e=L(t,n);e&&b.push(e)}else n&&b.push(`[Image source: ${n}]`);E.push(e.block)}H(`query_pasted_image_processing_end`);let O=f;if(p&&v!==null&&v.startsWith(`/`)){let e=Je(v),t=e?ye(e.commandName,r.options.commands):void 0;if(t){let n=he(t,e?.args??``);if(n.ok)O=!1;else{let e=n.reason??`/${Ae(t)} isn't available over Remote Control.`;return{messages:[V({content:v,uuid:s}),De(`<local-command-stdout>${e}</local-command-stdout>`)],shouldQuery:!1,resultText:e}}}}if(t===`prompt`&&!r.options.isNonInteractiveSession&&v!==null&&!O&&!v.startsWith(`/`)&&!r.getAppState().ultraplanSessionUrl&&!r.getAppState().ultraplanLaunching&&$e(g??v)){D(`tengu_ultraplan_keyword`,{});let e=et(v).trim(),{processSlashCommand:t}=await import(`./processSlashCommand-DUPS9Xx3.js`);return J(await t(`/ultraplan ${e}`,y,E,[],r,n,s,c,u,_),b)}let k=!h&&v!==null&&(t!==`prompt`||O||!v.startsWith(`/`));H(`query_attachment_loading_start`);let A=k?await ue(P(v,r,a??null,[],o,l)):[];if(H(`query_attachment_loading_end`),v!==null&&t===`bash`){let{processBashCommand:e}=await import(`./processBashCommand-DqgujTR4.js`);return J(await e(v,y,A,r,n),b)}if(v!==null&&!O&&v.startsWith(`/`)){let{processSlashCommand:e}=await import(`./processSlashCommand-DUPS9Xx3.js`);return J(await e(v,y,E,A,r,n,s,c,u,_),b)}if(v!==null&&t===`prompt`){let e=v.trim(),t=A.find(e=>e.attachment.type===`agent_mention`);if(t){let n=`@agent-${t.attachment.agentType}`,r=e===n;D(`tengu_subagent_at_mention`,{is_subagent_only:r,is_prefix:e.startsWith(n)&&!r})}}return J(rt(x,E,C,A,s,d,m),b)}function J(e,t){return t.length>0&&e.messages.push(V({content:t.map(e=>({type:`text`,text:e})),isMeta:!0})),e}h(),T();function st(e){return e===`Agent`?y:e}function ct(e){let t=b()?.outputStyle??`default`,n={type:`system`,subtype:`init`,cwd:k(),session_id:m(),tools:e.tools.map(e=>st(e.name)),mcp_servers:e.mcpClients.map(e=>({name:e.name,status:e.type})),model:e.model,permissionMode:e.permissionMode,slash_commands:e.commands.filter(e=>e.userInvocable!==!1).map(e=>e.name),apiKeySource:v().source,betas:_(),claude_code_version:`2.6.9`,output_style:t,agents:e.agents.map(e=>e.agentType),skills:e.skills.filter(e=>e.userInvocable!==!1).map(e=>e.name),plugins:e.plugins.map(e=>({name:e.name,path:e.path,source:e.source})),uuid:W()};return n.fast_mode_state=C(e.model,e.fastMode),n}var lt=n({MessageSelector:()=>ut,messagesAfterAreOnlySynthetic:()=>_t,selectableUserMessagesFilter:()=>Z});function Y(e){return e.type===`text`}function X(e){return e===`summarize`||e===`summarize_up_to`}function ut({messages:e,onPreRestore:t,onRestoreMessage:n,onRestoreCode:r,onSummarize:a,onClose:o,preselectedMessage:u}){let p=me(e=>e.fileHistory),[m,h]=(0,Q.useState)(void 0),g=Ie(),_=(0,Q.useMemo)(W,[]),v=(0,Q.useMemo)(()=>[...e.filter(Z),{...V({content:``}),uuid:_}],[e,_]),[y,b]=(0,Q.useState)(v.length-1),x=Math.max(0,Math.min(y-Math.floor($/2),v.length-$)),S=v.length>1,[C,w]=(0,Q.useState)(u),[T,E]=(0,Q.useState)(void 0);(0,Q.useEffect)(()=>{if(!u||!g)return;let e=!1;return Me(p,u.uuid).then(t=>{e||E(t)}),()=>{e=!0}},[u,g,p]);let[O,k]=(0,Q.useState)(!1),[A,j]=(0,Q.useState)(null),[ee,te]=(0,Q.useState)(`both`),[ne,N]=(0,Q.useState)(``),[re,ie]=(0,Q.useState)(``);function oe(e){let t=e?[{value:`both`,label:`Restore code and conversation`},{value:`conversation`,label:`Restore conversation`},{value:`code`,label:`Restore code`}]:[{value:`conversation`,label:`Restore conversation`}],n={type:`input`,placeholder:`add context (optional)`,initialValue:``,allowEmptySubmitToCancel:!0,showLabelWithValue:!0,labelValueSeparator:`: `};return t.push({value:`summarize`,label:`Summarize from here`,...n,onChange:N}),process.env.USER_TYPE===`ant`&&t.push({value:`summarize_up_to`,label:`Summarize up to here`,...n,onChange:ie}),t.push({value:`nevermind`,label:`Never mind`}),t}(0,Q.useEffect)(()=>{D(`tengu_message_selector_opened`,{})},[]);async function se(e){t(),k(!0);try{await n(e),k(!1),o()}catch(e){M(e),k(!1),h(`Failed to restore the conversation:\n${e}`)}}async function P(t){let n=e.indexOf(t);if(D(`tengu_message_selector_selected`,{index_from_end:e.length-1-n,message_type:t.type,is_current_prompt:!1}),!e.includes(t)){o();return}if(!g){await se(t);return}let r=await Me(p,t.uuid);w(t),E(r)}async function ce(e){if(D(`tengu_message_selector_restore_option_selected`,{option:e}),!C){h(`Message not found.`);return}if(e===`nevermind`){u?o():w(void 0);return}if(X(e)){t(),k(!0),j(e),h(void 0);try{let t=e===`summarize_up_to`?`up_to`:`from`;await a(C,(t===`up_to`?re:ne).trim()||void 0,t),k(!1),j(null),w(void 0),o()}catch(e){M(e),k(!1),j(null),w(void 0),h(`Failed to summarize:\n${e}`)}return}t(),k(!0),h(void 0);let i=null,s=null;if(e===`code`||e===`both`)try{await r(C)}catch(e){i=e,M(i)}if(e===`conversation`||e===`both`)try{await n(C)}catch(e){s=e,M(s)}k(!1),w(void 0),s&&i?h(`Failed to restore the conversation and code:\n${s}\n${i}`):s?h(`Failed to restore the conversation:\n${s}`):i?h(`Failed to restore the code:\n${i}`):o()}let F=qe(),le=(0,Q.useCallback)(()=>{if(C&&!u){w(void 0);return}D(`tengu_message_selector_cancelled`,{}),o()},[o,C,u]),ue=(0,Q.useCallback)(()=>b(e=>Math.max(0,e-1)),[]),de=(0,Q.useCallback)(()=>b(e=>Math.min(v.length-1,e+1)),[v.length]),I=(0,Q.useCallback)(()=>b(0),[]),pe=(0,Q.useCallback)(()=>b(v.length-1),[v.length]),L=(0,Q.useCallback)(()=>{let e=v[y];e&&P(e)},[v,y,P]);d(`confirm:no`,le,{context:`Confirmation`,isActive:!C}),l({"messageSelector:up":ue,"messageSelector:down":de,"messageSelector:top":I,"messageSelector:bottom":pe,"messageSelector:select":L},{context:`MessageSelector`,isActive:!O&&!m&&!C&&S});let[R,z]=(0,Q.useState)({});(0,Q.useEffect)(()=>{async function t(){g&&Promise.all(v.map(async(t,n)=>{if(t.uuid!==_){let r=Ee(p,t.uuid),i=v.at(n+1),a=r?gt(e,t.uuid,i?.uuid===_?void 0:i?.uuid):void 0;z(a===void 0?e=>({...e,[n]:void 0}):e=>({...e,[n]:a}))}}))}t()},[v,e,_,p,g]);let B=g&&T?.filesChanged&&T.filesChanged.length>0,he=!m&&!C&&!u&&S;return(0,G.jsxs)(f,{flexDirection:`column`,width:`100%`,children:[(0,G.jsx)(c,{color:`suggestion`}),(0,G.jsxs)(f,{flexDirection:`column`,marginX:1,gap:1,children:[(0,G.jsx)(s,{bold:!0,color:`suggestion`,children:`Rewind`}),m&&(0,G.jsx)(G.Fragment,{children:(0,G.jsxs)(s,{color:`error`,children:[`Error: `,m]})}),!S&&(0,G.jsx)(G.Fragment,{children:(0,G.jsx)(s,{children:`Nothing to rewind to yet.`})}),!m&&C&&S&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(s,{children:[`Confirm you want to restore `,!T&&`the conversation `,`to the point before you sent this message:`]}),(0,G.jsxs)(f,{flexDirection:`column`,paddingLeft:1,borderStyle:`single`,borderRight:!1,borderTop:!1,borderBottom:!1,borderLeft:!0,borderLeftDimColor:!0,children:[(0,G.jsx)(ht,{userMessage:C,color:`text`,isCurrent:!1}),(0,G.jsxs)(s,{dimColor:!0,children:[`(`,ae(new Date(C.timestamp)),`)`]})]}),(0,G.jsx)(ft,{selectedRestoreOption:ee,canRestoreCode:!!B,diffStatsForRestore:T}),O&&X(A)?(0,G.jsxs)(f,{flexDirection:`row`,gap:1,children:[(0,G.jsx)(Te,{}),(0,G.jsx)(s,{children:`Summarizing…`})]}):(0,G.jsx)(fe,{isDisabled:O,options:oe(!!B),defaultFocusValue:B?`both`:`conversation`,onFocus:e=>te(e),onChange:e=>ce(e),onCancel:()=>u?o():w(void 0)}),B&&(0,G.jsx)(f,{marginBottom:1,children:(0,G.jsxs)(s,{dimColor:!0,children:[i.warning,` Rewinding does not affect files edited manually or via bash.`]})})]}),he&&(0,G.jsxs)(G.Fragment,{children:[g?(0,G.jsx)(s,{children:`Restore the code and/or conversation to the point before…`}):(0,G.jsx)(s,{children:`Restore and fork the conversation to the point before…`}),(0,G.jsx)(f,{width:`100%`,flexDirection:`column`,children:v.slice(x,x+$).map((e,t)=>{let n=x+t,r=n===y,a=e.uuid===_,o=n in R,c=R[n],l=c?.filesChanged&&c.filesChanged.length;return(0,G.jsxs)(f,{height:g?3:2,overflow:`hidden`,width:`100%`,flexDirection:`row`,children:[(0,G.jsx)(f,{width:2,minWidth:2,children:r?(0,G.jsxs)(s,{color:`permission`,bold:!0,children:[i.pointer,` `]}):(0,G.jsx)(s,{children:` `})}),(0,G.jsxs)(f,{flexDirection:`column`,children:[(0,G.jsx)(f,{flexShrink:1,height:1,overflow:`hidden`,children:(0,G.jsx)(ht,{userMessage:e,color:r?`suggestion`:void 0,isCurrent:a,paddingRight:10})}),g&&o&&(0,G.jsx)(f,{height:1,flexDirection:`row`,children:c?(0,G.jsx)(G.Fragment,{children:(0,G.jsx)(s,{dimColor:!r,color:`inactive`,children:l?(0,G.jsxs)(G.Fragment,{children:[l===1&&c.filesChanged[0]?`${U.basename(c.filesChanged[0])} `:`${l} files changed `,(0,G.jsx)(mt,{diffStats:c})]}):(0,G.jsx)(G.Fragment,{children:`No code changes`})})}):(0,G.jsxs)(s,{dimColor:!0,color:`warning`,children:[i.warning,` No code restore`]})})]})]},e.uuid)})})]}),!C&&(0,G.jsx)(s,{dimColor:!0,italic:!0,children:F.pending?(0,G.jsxs)(G.Fragment,{children:[`Press `,F.keyName,` again to exit`]}):(0,G.jsxs)(G.Fragment,{children:[!m&&S&&`Enter to continue · `,`Esc to exit`]})})]})]})}function dt(e){switch(e){case`summarize`:return`Messages after this point will be summarized.`;case`summarize_up_to`:return`Preceding messages will be summarized. This and subsequent messages will remain unchanged — you will stay at the end of the conversation.`;case`both`:case`conversation`:return`The conversation will be forked.`;case`code`:case`nevermind`:return`The conversation will be unchanged.`}}function ft({selectedRestoreOption:e,canRestoreCode:t,diffStatsForRestore:n}){let r=t&&(e===`both`||e===`code`);return(0,G.jsxs)(f,{flexDirection:`column`,children:[(0,G.jsx)(s,{dimColor:!0,children:dt(e)}),!X(e)&&(r?(0,G.jsx)(pt,{diffStatsForRestore:n}):(0,G.jsx)(s,{dimColor:!0,children:`The code will be unchanged.`}))]})}function pt({diffStatsForRestore:e}){if(e===void 0)return;if(!e.filesChanged||!e.filesChanged[0])return(0,G.jsx)(s,{dimColor:!0,children:`The code has not changed (nothing will be restored).`});let t=e.filesChanged.length,n=``;return n=t===1?U.basename(e.filesChanged[0]||``):t===2?`${U.basename(e.filesChanged[0]||``)} and ${U.basename(e.filesChanged[1]||``)}`:`${U.basename(e.filesChanged[0]||``)} and ${e.filesChanged.length-1} other files`,(0,G.jsx)(G.Fragment,{children:(0,G.jsxs)(s,{dimColor:!0,children:[`The code will be restored `,(0,G.jsx)(mt,{diffStats:e}),` in `,n,`.`]})})}function mt({diffStats:e}){if(!(!e||!e.filesChanged))return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(s,{color:`diffAddedWord`,children:[`+`,e.insertions,` `]}),(0,G.jsxs)(s,{color:`diffRemovedWord`,children:[`-`,e.deletions]})]})}function ht({userMessage:e,color:t,dimColor:n,isCurrent:r,paddingRight:i}){let{columns:o}=a();if(r)return(0,G.jsx)(f,{width:`100%`,children:(0,G.jsx)(s,{italic:!0,color:t,dimColor:n,children:`(current)`})});let c=e.message.content,l=typeof c==`string`?null:c[c.length-1],u=ee(typeof c==`string`?c.trim():l&&Y(l)?l.text.trim():`(no prompt)`);if(ze(u))return(0,G.jsx)(f,{flexDirection:`row`,width:`100%`,children:(0,G.jsx)(s,{italic:!0,color:t,dimColor:n,children:`((empty message))`})});if(u.includes(`<bash-input>`)){let e=z(u,`bash-input`);if(e)return(0,G.jsxs)(f,{flexDirection:`row`,width:`100%`,children:[(0,G.jsx)(s,{color:`bashBorder`,children:`!`}),(0,G.jsxs)(s,{color:t,dimColor:n,children:[` `,e]})]})}if(u.includes(`<command-message>`)){let e=z(u,A),r=z(u,`command-args`),i=z(u,`skill-format`)===`true`;if(e)return i?(0,G.jsx)(f,{flexDirection:`row`,width:`100%`,children:(0,G.jsxs)(s,{color:t,dimColor:n,children:[`Skill(`,e,`)`]})}):(0,G.jsx)(f,{flexDirection:`row`,width:`100%`,children:(0,G.jsxs)(s,{color:t,dimColor:n,children:[`/`,e,` `,r]})})}return(0,G.jsx)(f,{flexDirection:`row`,width:`100%`,children:(0,G.jsx)(s,{color:t,dimColor:n,children:i?ie(u,o-i,!0):u.slice(0,500).split(`
2
- `).slice(0,4).join(`
3
- `)})})}function gt(e,t,n){let r=e.findIndex(e=>e.uuid===t);if(r===-1)return;let i=n?e.findIndex(e=>e.uuid===n):e.length;i===-1&&(i=e.length);let a=[],o=0,s=0;for(let t=r+1;t<i;t++){let n=e[t];if(!n||!ge(n))continue;let r=n.toolUseResult;if(!(!r||!r.filePath||!r.structuredPatch)){a.includes(r.filePath)||a.push(r.filePath);try{if(`type`in r&&r.type===`create`)o+=r.content.split(/\r?\n/).length;else for(let e of r.structuredPatch){let t=N(e.lines,e=>e.startsWith(`+`)),n=N(e.lines,e=>e.startsWith(`-`));o+=t,s+=n}}catch{}}}return{filesChanged:a,insertions:o,deletions:s}}function Z(e){if(e.type!==`user`||Array.isArray(e.message.content)&&e.message.content[0]?.type===`tool_result`||be(e)||e.isMeta||e.isCompactSummary||e.isVisibleInTranscriptOnly)return!1;let t=e.message.content,n=typeof t==`string`?null:t[t.length-1],r=typeof t==`string`?t.trim():n&&Y(n)?n.text.trim():``;return!(r.indexOf(`<local-command-stdout>`)!==-1||r.indexOf(`<local-command-stderr>`)!==-1||r.indexOf(`<bash-stdout>`)!==-1||r.indexOf(`<bash-stderr>`)!==-1||r.indexOf(`<task-notification>`)!==-1||r.indexOf(`<tick>`)!==-1||r.indexOf(`<teammate-message`)!==-1)}function _t(e,t){for(let n=t+1;n<e.length;n++){let t=e[n];if(t&&!be(t)&&!ge(t)&&t.type!==`progress`&&t.type!==`system`&&t.type!==`attachment`&&!(t.type===`user`&&t.isMeta)){if(t.type===`assistant`){let e=t.message.content;if(Array.isArray(e)&&e.some(e=>e.type===`text`&&e.text.trim()||e.type===`tool_use`))return!1;continue}if(t.type===`user`)return!1}}return!0}var Q,$,vt=e((()=>{Q=t(o(),1),E(),de(),Fe(),Ke(),Ge(),I(),pe(),B(),_e(),$=7}));export{Z as a,it as c,_t as i,K as l,lt as n,ct as o,vt as r,st as s,ut as t,Qe as u};
@@ -1 +0,0 @@
1
- import{t as e}from"./REPL-nrJ13J1o.js";export{e as REPL};
@@ -1 +0,0 @@
1
- import{UO as e,WO as t}from"./loadAgentsDir-Cl2w3uvH.js";t();export{e as clearSearchExtraToolsDescriptionCache};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./SentryErrorBoundary-B_6MfzRa.js";e();export{t as SentryErrorBoundary};
@@ -1,2 +0,0 @@
1
- import{a as e,n as t,o as n}from"./chunk-DR8-3Aex.js";import{f as r,s as i,u as a}from"./envUtils-BWeoiL4Y.js";import{n as o,t as s}from"./figures-gfT9mM8P.js";import{E as c,F as ee,In as l,Ln as u,Rn as d,T as te,Ut as ne,_ as re,b as f,c as ie,f as ae,g as p,h as m,i as oe,n as se,nt as ce,p as le,r as ue,t as h,tt as de,x as g}from"./src-Di342QoJ.js";import{t as _}from"./jsx-runtime-D-D469L8.js";import{Ct as v,cn as y,kr as fe,tn as pe}from"./state-sIHsFpDu.js";import{Ac as b,Fs as me,Is as he,Ka as ge,Lr as _e,Ns as ve,Oc as ye,Pc as x,Pr as S,Qa as be,Rr as xe,Rs as Se,S as Ce,Sc as C,Si as we,Vs as Te,Xi as Ee,Zi as De,_ as Oe,bc as ke,di as Ae,it as je,li as Me,lo as w,on as T,oo as Ne,rt as Pe,tn as E,ui as Fe,vc as Ie,vi as Le,xi as Re,yc as ze,yi as Be}from"./paths-q1-Ni8Oh.js";import{E as D,w as O}from"./debug-UI3T040K.js";import{n as k,r as A}from"./analytics-DqMQntaB.js";import{n as j,t as Ve}from"./cwd--iizewsn.js";import{o as He,s as Ue}from"./log-CzsijfHZ.js";import{i as We,o as Ge}from"./platform-CuyedWpe.js";import{_ as M,x as N}from"./startupProfiler-DnXZaX4A.js";import{r as Ke}from"./permissions-DXLfdE7b.js";import{$f as qe,$x as Je,Ab as Ye,Ar as Xe,BS as Ze,Bx as Qe,C as $e,Ck as et,Db as tt,Dk as nt,Eb as rt,Ek as it,Fb as at,Hu as P,I as ot,LS as st,Lg as F,Mb as ct,Nb as lt,Nx as ut,Ob as dt,Pb as ft,Px as pt,RS as I,Rg as mt,Tb as ht,Tk as gt,Uw as L,Vu as _t,Zx as vt,as as R,eC as z,ep as yt,gm as B,hr as V,is as bt,ix as xt,jb as St,kb as Ct,lx as wt,my as Tt,os as Et,pm as Dt,rx as Ot,tC as H,w as kt,y as At,zS as jt,zx as Mt}from"./loadAgentsDir-Cl2w3uvH.js";import{r as Nt,t as Pt}from"./poorMode-DFcYVnMT.js";import{t as U}from"./useKeybinding-FsOnjW6T.js";import{l as W,u as Ft}from"./referral-rRvT6UDX.js";import{i as It,r as Lt}from"./bridgeEnabled-G6vxQV-7.js";import{a as Rt,n as zt,r as Bt}from"./teammateModeSnapshot-Zp1weNIZ.js";import{i as Vt,n as G,r as Ht}from"./modalContext-CmSKRyea.js";import{n as Ut,t as Wt}from"./ThemePicker-DnK0DStD.js";import{i as Gt,n as Kt,r as qt,t as Jt}from"./extraUsage-CxqJdnGC.js";import{n as Yt,t as Xt}from"./ClaudeMdExternalIncludesDialog-DLI6ey3G.js";import{t as Zt}from"./SearchBox-DfOmUoaI.js";import{n as Qt,t as $t}from"./useSearchInput-CR-b0Qi6.js";import{n as en,t as tn}from"./usage-DhJDFJVx.js";import{a as nn,i as rn,t as an}from"./OverageCreditUpsell-DoRUucoN.js";function on(){let e=v();return[{label:`Version`,value:`2.6.9`},{label:`Session name`,value:V(e)??(0,K.jsx)(f,{dimColor:!0,children:`/rename to add a name`})},{label:`Session ID`,value:e},{label:`cwd`,value:Ve()},...rt(),...ht()]}function sn({mainLoopModel:e,mcp:t,theme:n,context:r}){return[{label:`Model`,value:ft(e)},...tt(t.clients,r.options.ideInstallationStatus,n),...Ye(t.clients,n),...ct(),...lt()]}async function cn(){return[...await dt(),...await Ct(),...await St()]}function ln({value:e}){return Array.isArray(e)?(0,K.jsx)(g,{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 un({context:e,diagnosticsPromise:t}){let n=I(e=>e.mainLoopModel),r=I(e=>e.mcp),[i]=te(),a=fn.useMemo(()=>[on(),sn({mainLoopModel:n,mcp:r,theme:i,context:e})],[n,r,i,e]),o=Ht()?1:void 0;return(0,K.jsxs)(g,{flexDirection:`column`,flexGrow:o,children:[(0,K.jsxs)(g,{flexDirection:`column`,gap:1,flexGrow:o,children:[a.map((e,t)=>e.length>0&&(0,K.jsx)(g,{flexDirection:`column`,children:e.map(({label:e,value:t},n)=>(0,K.jsxs)(g,{flexDirection:`row`,gap:1,flexShrink:0,children:[e!==void 0&&(0,K.jsxs)(f,{bold:!0,children:[e,`:`]}),(0,K.jsx)(ln,{value:t})]},n))},t)),(0,K.jsx)(pn.Suspense,{fallback:null,children:(0,K.jsx)(dn,{promise:t})})]}),(0,K.jsx)(f,{dimColor:!0,children:(0,K.jsx)(z,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})})]})}function dn({promise:e}){let t=(0,pn.use)(e);return t.length===0?null:(0,K.jsxs)(g,{flexDirection:`column`,paddingBottom:1,children:[(0,K.jsx)(f,{bold:!0,children:`System Diagnostics`}),t.map((e,t)=>(0,K.jsxs)(g,{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 fn,pn,K,mn=t((()=>{o(),fn=n(d(),1),pn=n(d(),1),y(),G(),h(),st(),j(),Xe(),at(),H(),K=_()}));function hn({currentVersion:e,onChoice:t}){function n(e){t(e)}function r(){t(`cancel`)}return(0,gn.jsxs)(ae,{title:`Switch to Stable Channel`,onCancel:r,color:`permission`,hideBorder:!0,hideInputGuide:!0,children:[(0,gn.jsxs)(f,{children:[`The stable channel may have an older version than what you're currently running (`,e,`).`]}),(0,gn.jsx)(f,{dimColor:!0,children:`How would you like to handle this?`}),(0,gn.jsx)(ut,{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 gn,_n=t((()=>{d(),h(),Tt(),gn=_()}));function vn(e){return Object.entries(e).map(([e,t])=>({label:t?.name??xn,value:e,description:t?.description??Sn}))}function yn({initialStyle:e,onComplete:t,onCancel:n,isStandaloneCommand:r}){let[i,a]=(0,bn.useState)([]),[o,s]=(0,bn.useState)(!0);(0,bn.useEffect)(()=>{R(Ve()).then(e=>{a(vn(e)),s(!1)}).catch(()=>{a(vn(bt)),s(!1)})},[]);let c=(0,bn.useCallback)(e=>{t(e)},[t]);return(0,q.jsx)(ae,{title:`Preferred output style`,onCancel:n,hideInputGuide:!r,hideBorder:!r,children:(0,q.jsxs)(g,{flexDirection:`column`,gap:1,children:[(0,q.jsx)(g,{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)(ut,{options:i,onChange:c,visibleOptionCount:10,defaultValue:e})]})})}var bn,q,xn,Sn,Cn=t((()=>{d(),bn=n(d(),1),Et(),h(),j(),pt(),q=_(),xn=`Default`,Sn=`Claude completes coding tasks efficiently and provides concise responses`}));function wn({initialLanguage:e,onComplete:t,onCancel:n}){let[r,i]=(0,Tn.useState)(e),[a,o]=(0,Tn.useState)((e??``).length);de(`confirm:no`,n,{context:`Settings`});function c(){let e=r?.trim();t(e||void 0)}return(0,J.jsxs)(g,{flexDirection:`column`,gap:1,children:[(0,J.jsx)(f,{children:`Enter your preferred response and voice language:`}),(0,J.jsxs)(g,{flexDirection:`row`,gap:1,children:[(0,J.jsx)(f,{children:s.pointer}),(0,J.jsx)(Mt,{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 Tn,J,En=t((()=>{o(),Tn=n(d(),1),h(),U(),Qe(),J=_()}));function Dn({onClose:t,context:n,setTabsHidden:i,onIsSearchModeChange:o,contentHeight:u}){let{headerFocused:d,focusHeader:ie}=oe(),se=Ht(),[,le]=te(),ue=c(),[h,_]=(0,X.useState)(C()),v=Y.useRef(C()),[y,b]=(0,X.useState)(ge()),ve=Y.useRef(ge()),[S,Ce]=(0,X.useState)(y?.outputStyle||`default`),Ee=Y.useRef(S),[T,Ne]=(0,X.useState)(y?.language),Pe=Y.useRef(T),[E,Le]=(0,X.useState)(0),[D,O]=(0,X.useState)(0),[k,j]=(0,X.useState)(!1),Ve=ne(),{rows:He}=ee(),Ge=u??Math.min(Math.floor(He*.8),30),M=Math.max(5,Ge-10),N=I(e=>e.mainLoopModel),Ye=I(e=>e.verbose),Xe=I(e=>e.thinkingEnabled),Qe=I(e=>Re()?e.fastMode:!1),tt=I(e=>e.promptSuggestionEnabled),nt=he(y?.permissions?.defaultMode??`default`),rt=$e()||At()===`enabled`,at=(yt(),e(qe)).isBriefEntitled(),P=Ze(),[st,F]=(0,X.useState)({}),ct=Y.useRef(Xe),[lt]=(0,X.useState)(()=>be(`localSettings`)),[dt]=(0,X.useState)(()=>be(`userSettings`)),ft=Y.useRef(ue),pt=jt(),[mt]=(0,X.useState)(()=>{let e=pt.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}}),[ht]=(0,X.useState)(()=>pe()),L=Y.useRef(!1),[_t,vt]=(0,X.useState)(!1),[R,B]=(0,X.useState)(null),{query:V,setQuery:bt,cursorOffset:xt}=Qt({isActive:k&&R===null&&!d,onExit:()=>j(!1),onExitUp:ie,passthroughCtrlKeys:[`c`,`d`]}),St=k&&!d;Y.useEffect(()=>{o?.(St)},[St,o]);let Ct=Ot(n.options.mcpClients),Tt=!a(process.env.CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING),Et=Y.use(gt(!0)),Dt=it(Et),H=ze();function kt(e){A(`tengu_config_model_changed`,{from_model:N,to_model:e}),P(t=>({...t,mainLoopModel:e,mainLoopModelForSession:null})),F(t=>{let n=xe(e)+(Kt(e,!1,_e())?` · Billed as extra usage`:``);if(`model`in t){let{model:e,...r}=t;return{...r,model:n}}return{...t,model:n}})}function Mt(e){x(t=>({...t,verbose:e})),_({...C(),verbose:e}),P(t=>({...t,verbose:e})),F(t=>{if(`verbose`in t){let{verbose:e,...n}=t;return n}return{...t,verbose:e}})}let U=[{id:`autoCompactEnabled`,label:`Auto-compact`,value:h.autoCompactEnabled,type:`boolean`,onChange(e){x(t=>({...t,autoCompactEnabled:e})),_({...C(),autoCompactEnabled:e}),A(`tengu_auto_compact_setting_changed`,{enabled:e})}},{id:`spinnerTipsEnabled`,label:`Show tips`,value:y?.spinnerTipsEnabled??!0,type:`boolean`,onChange(e){w(`localSettings`,{spinnerTipsEnabled:e}),b(t=>({...t,spinnerTipsEnabled:e})),A(`tengu_tips_setting_changed`,{enabled:e})}},{id:`prefersReducedMotion`,label:`Reduce motion`,value:y?.prefersReducedMotion??!1,type:`boolean`,onChange(e){w(`localSettings`,{prefersReducedMotion:e}),b(t=>({...t,prefersReducedMotion:e})),P(t=>({...t,settings:{...t.settings,prefersReducedMotion:e}})),A(`tengu_reduce_motion_setting_changed`,{enabled:e})}},{id:`thinkingEnabled`,label:`Thinking mode`,value:Xe??!0,type:`boolean`,onChange(e){P(t=>({...t,thinkingEnabled:e})),w(`userSettings`,{alwaysThinkingEnabled:e?void 0:!1}),A(`tengu_thinking_toggled`,{enabled:e})}},...Re()&&Be()?[{id:`fastMode`,label:`Fast mode (${Me} only)`,value:!!Qe,type:`boolean`,onChange(e){Fe(),w(`userSettings`,{fastMode:e?!0:void 0}),e?(P(e=>({...e,mainLoopModel:Ae(),mainLoopModelForSession:null,fastMode:!0})),F(e=>({...e,model:Ae(),"Fast mode":`ON`}))):(P(e=>({...e,fastMode:!1})),F(e=>({...e,"Fast mode":`OFF`})))}}]:[],...Oe(`tengu_chomp_inflection`,!1)?[{id:`promptSuggestionEnabled`,label:`Prompt suggestions`,value:tt,type:`boolean`,onChange(e){P(t=>({...t,promptSuggestionEnabled:e})),w(`userSettings`,{promptSuggestionEnabled:e?void 0:!1})}}]:[],...[{id:`poorMode`,label:`Poor mode (save tokens)`,value:(Pt(),e(Nt)).isPoorModeActive(),type:`boolean`,onChange(t){(Pt(),e(Nt)).setPoorMode(t),P(e=>({...e,promptSuggestionEnabled:!t}))}}],...process.env.USER_TYPE===`ant`?[{id:`speculationEnabled`,label:`Speculative execution`,value:h.speculationEnabled??!0,type:`boolean`,onChange(e){x(t=>t.speculationEnabled===e?t:{...t,speculationEnabled:e}),_({...C(),speculationEnabled:e}),A(`tengu_speculation_setting_changed`,{enabled:e})}}]:[],...Tt?[{id:`fileCheckpointingEnabled`,label:`Rewind code (checkpoints)`,value:h.fileCheckpointingEnabled,type:`boolean`,onChange(e){x(t=>({...t,fileCheckpointingEnabled:e})),_({...C(),fileCheckpointingEnabled:e}),A(`tengu_file_history_snapshots_setting_changed`,{enabled:e})}}]:[],{id:`verbose`,label:`Verbose output`,value:Ye,type:`boolean`,onChange:Mt},{id:`terminalProgressBarEnabled`,label:`Terminal progress bar`,value:h.terminalProgressBarEnabled,type:`boolean`,onChange(e){x(t=>({...t,terminalProgressBarEnabled:e})),_({...C(),terminalProgressBarEnabled:e}),A(`tengu_terminal_progress_bar_setting_changed`,{enabled:e})}},...Oe(`tengu_terminal_sidebar`,!1)?[{id:`showStatusInTerminalTab`,label:`Show status in terminal tab`,value:h.showStatusInTerminalTab??!1,type:`boolean`,onChange(e){x(t=>({...t,showStatusInTerminalTab:e})),_({...C(),showStatusInTerminalTab:e}),A(`tengu_terminal_tab_status_setting_changed`,{enabled:e})}}]:[],{id:`showTurnDuration`,label:`Show turn duration`,value:h.showTurnDuration,type:`boolean`,onChange(e){x(t=>({...t,showTurnDuration:e})),_({...C(),showTurnDuration:e}),A(`tengu_show_turn_duration_setting_changed`,{enabled:e})}},{id:`defaultPermissionMode`,label:`Default permission mode`,value:nt,options:(()=>{let e=[`default`,`plan`];return[...e,...Ke.filter(t=>!e.includes(t))]})(),type:`enum`,onChange(e){let t=he(e),n=t===`auto`?t:me(t)?Te(t):t,r=w(`userSettings`,{permissions:{...y?.permissions,defaultMode:n}});if(r.error){Ue(r.error);return}b(e=>({...e,permissions:{...e?.permissions,defaultMode:n}})),F(t=>({...t,defaultPermissionMode:e})),A(`tengu_config_changed`,{setting:`defaultPermissionMode`,value:e})}},...rt?[{id:`useAutoModeDuringPlan`,label:`Use auto mode during plan`,value:y?.useAutoModeDuringPlan??!0,type:`boolean`,onChange(e){w(`userSettings`,{useAutoModeDuringPlan:e}),b(t=>({...t,useAutoModeDuringPlan:e})),P(e=>{let t=ot(e.toolPermissionContext);return t===e.toolPermissionContext?e:{...e,toolPermissionContext:t}}),F(t=>({...t,"Use auto mode during plan":e}))}}]:[],{id:`respectGitignore`,label:`Respect .gitignore in file picker`,value:h.respectGitignore,type:`boolean`,onChange(e){x(t=>({...t,respectGitignore:e})),_({...C(),respectGitignore:e}),A(`tengu_respect_gitignore_setting_changed`,{enabled:e})}},{id:`copyFullResponse`,label:`Always copy full response (skip /copy picker)`,value:h.copyFullResponse,type:`boolean`,onChange(e){x(t=>({...t,copyFullResponse:e})),_({...C(),copyFullResponse:e}),A(`tengu_config_changed`,{setting:`copyFullResponse`,value:String(e)})}},...Je()?[{id:`copyOnSelect`,label:`Copy on select`,value:h.copyOnSelect??!0,type:`boolean`,onChange(e){x(t=>({...t,copyOnSelect:e})),_({...C(),copyOnSelect:e}),A(`tengu_config_changed`,{setting:`copyOnSelect`,value:String(e)})}}]:[],H?{id:`autoUpdatesChannel`,label:`Auto-update channel`,value:`disabled`,type:`managedEnum`,onChange(){}}:{id:`autoUpdatesChannel`,label:`Auto-update channel`,value:y?.autoUpdatesChannel??`latest`,type:`managedEnum`,onChange(){}},{id:`theme`,label:`Theme`,value:ue,type:`managedEnum`,onChange:le},{id:`notifChannel`,label:`Local notifications`,value:h.preferredNotifChannel,options:[`auto`,`iterm2`,`terminal_bell`,`iterm2_with_bell`,`kitty`,`ghostty`,`notifications_disabled`],type:`enum`,onChange(e){x(t=>({...t,preferredNotifChannel:e})),_({...C(),preferredNotifChannel:e})}},...[{id:`taskCompleteNotifEnabled`,label:`Push when idle`,value:h.taskCompleteNotifEnabled??!1,type:`boolean`,onChange(e){x(t=>({...t,taskCompleteNotifEnabled:e})),_({...C(),taskCompleteNotifEnabled:e})}},{id:`inputNeededNotifEnabled`,label:`Push when input needed`,value:h.inputNeededNotifEnabled??!1,type:`boolean`,onChange(e){x(t=>({...t,inputNeededNotifEnabled:e})),_({...C(),inputNeededNotifEnabled:e})}},{id:`agentPushNotifEnabled`,label:`Push when Claude decides`,value:h.agentPushNotifEnabled??!1,type:`boolean`,onChange(e){x(t=>({...t,agentPushNotifEnabled:e})),_({...C(),agentPushNotifEnabled:e})}}],{id:`outputStyle`,label:`Output style`,value:S,type:`managedEnum`,onChange:()=>{}},...at?[{id:`defaultView`,label:`What you see by default`,value:y?.defaultView===void 0?`default`:String(y.defaultView),options:[`transcript`,`chat`,`default`],type:`enum`,onChange(e){let t=e===`default`?void 0:e;w(`localSettings`,{defaultView:t}),b(e=>({...e,defaultView:t}));let n=t===`chat`;P(e=>e.isBriefOnly===n?e:{...e,isBriefOnly:n}),fe(n),F(t=>({...t,"Default view":e})),A(`tengu_default_view_setting_changed`,{value:t??`unset`})}}]:[],{id:`language`,label:`Language`,value:T??`Default (English)`,type:`managedEnum`,onChange:()=>{}},{id:`editorMode`,label:`Editor mode`,value:h.editorMode===`emacs`?`normal`:h.editorMode||`normal`,options:[`normal`,`vim`],type:`enum`,onChange(e){x(t=>({...t,editorMode:e})),_({...C(),editorMode:e}),A(`tengu_editor_mode_changed`,{mode:e,source:`config_panel`})}},{id:`prStatusFooterEnabled`,label:`Show PR status footer`,value:h.prStatusFooterEnabled??!0,type:`boolean`,onChange(e){x(t=>t.prStatusFooterEnabled===e?t:{...t,prStatusFooterEnabled:e}),_({...C(),prStatusFooterEnabled:e}),A(`tengu_pr_status_footer_setting_changed`,{enabled:e})}},{id:`model`,label:`Model`,value:N===null?`Default (recommended)`:N,type:`managedEnum`,onChange:kt},...Ct?[{id:`diffTool`,label:`Diff tool`,value:h.diffTool??`auto`,options:[`terminal`,`auto`],type:`enum`,onChange(e){x(t=>({...t,diffTool:e})),_({...C(),diffTool:e}),A(`tengu_diff_tool_changed`,{tool:e,source:`config_panel`})}}]:[],...wt()?[]:[{id:`autoConnectIde`,label:`Auto-connect to IDE (external terminal)`,value:h.autoConnectIde??!1,type:`boolean`,onChange(e){x(t=>({...t,autoConnectIde:e})),_({...C(),autoConnectIde:e}),A(`tengu_auto_connect_ide_changed`,{enabled:e,source:`config_panel`})}}],...wt()?[{id:`autoInstallIdeExtension`,label:`Auto-install IDE extension`,value:h.autoInstallIdeExtension??!0,type:`boolean`,onChange(e){x(t=>({...t,autoInstallIdeExtension:e})),_({...C(),autoInstallIdeExtension:e}),A(`tengu_auto_install_ide_extension_changed`,{enabled:e,source:`config_panel`})}}]:[],{id:`claudeInChromeDefaultEnabled`,label:`Claude in Chrome enabled by default`,value:h.claudeInChromeDefaultEnabled??!0,type:`boolean`,onChange(e){x(t=>({...t,claudeInChromeDefaultEnabled:e})),_({...C(),claudeInChromeDefaultEnabled:e}),A(`tengu_claude_in_chrome_setting_changed`,{enabled:e})}},...je()?(()=>{let e=Bt(),t=e?`Teammate mode [overridden: ${e}]`:`Teammate mode`,n=We()===`windows`,r=n?[`auto`,`tmux`,`windows-terminal`,`in-process`]:[`auto`,`tmux`,`in-process`];return[{id:`teammateMode`,label:t,value:h.teammateMode??`auto`,options:r,type:`enum`,onChange(e){e!==`auto`&&e!==`tmux`&&e!==`windows-terminal`&&e!==`in-process`||e===`windows-terminal`&&!n||(zt(e),x(t=>({...t,teammateMode:e})),_({...C(),teammateMode:e}),A(`tengu_teammate_mode_changed`,{mode:e}))}},{id:`teammateDefaultModel`,label:`Default teammate model`,value:On(h.teammateDefaultModel),type:`managedEnum`,onChange(){}}]})():[],...It()?[{id:`remoteControlAtStartup`,label:`Enable Remote Control for all sessions`,value:h.remoteControlAtStartup===void 0?`default`:String(h.remoteControlAtStartup),options:[`true`,`false`,`default`],type:`enum`,onChange(e){if(e===`default`)x(e=>{if(e.remoteControlAtStartup===void 0)return e;let t={...e};return delete t.remoteControlAtStartup,t}),_({...C(),remoteControlAtStartup:void 0});else{let t=e===`true`;x(e=>e.remoteControlAtStartup===t?e:{...e,remoteControlAtStartup:t}),_({...C(),remoteControlAtStartup:t})}let t=ye();P(e=>e.replBridgeEnabled===t&&!e.replBridgeOutboundOnly?e:{...e,replBridgeEnabled:t,replBridgeOutboundOnly:!1})}}]:[],...Dt?[{id:`showExternalIncludesDialog`,label:`External CLAUDE.md includes`,value:ke().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:De(process.env.ANTHROPIC_API_KEY)})]}),searchText:`Use custom API key`,value:!!(process.env.ANTHROPIC_API_KEY&&h.customApiKeyResponses?.approved?.includes(De(process.env.ANTHROPIC_API_KEY))),type:`boolean`,onChange(e){x(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=De(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}),_(C())}}]:[]],W=Y.useMemo(()=>{if(!V)return U;let e=V.toLowerCase();return U.filter(t=>t.id.toLowerCase().includes(e)?!0:(`searchText`in t?t.searchText:t.label).toLowerCase().includes(e))},[U,V]);Y.useEffect(()=>{if(E>=W.length){let e=Math.max(0,W.length-1);Le(e),O(Math.max(0,e-M+1));return}O(e=>E<e?E:E>=e+M?E-M+1:e)},[W.length,E,M]);let Ft=(0,X.useCallback)(e=>{O(t=>e<t?e:e>=t+M?e-M+1:t)},[M]),Lt=(0,X.useCallback)(()=>{if(R!==null)return;let e=Object.entries(st).map(([e,t])=>(A(`tengu_config_changed`,{key:e,value:t}),`Set ${e} to ${l.bold(t)}`)),n=r()?void 0:process.env.ANTHROPIC_API_KEY,i=!!(n&&v.current.customApiKeyResponses?.approved?.includes(De(n))),a=!!(n&&h.customApiKeyResponses?.approved?.includes(De(n)));if(i!==a&&(e.push(`${a?`Enabled`:`Disabled`} custom API key`),A(`tengu_config_changed`,{key:`env.ANTHROPIC_API_KEY`,value:a})),h.theme!==v.current.theme&&e.push(`Set theme to ${l.bold(h.theme)}`),h.preferredNotifChannel!==v.current.preferredNotifChannel&&e.push(`Set notifications to ${l.bold(h.preferredNotifChannel)}`),S!==Ee.current&&e.push(`Set output style to ${l.bold(S)}`),T!==Pe.current&&e.push(`Set response language to ${l.bold(T??`Default (English)`)}`),h.editorMode!==v.current.editorMode&&e.push(`Set editor mode to ${l.bold(h.editorMode||`emacs`)}`),h.diffTool!==v.current.diffTool&&e.push(`Set diff tool to ${l.bold(h.diffTool)}`),h.autoConnectIde!==v.current.autoConnectIde&&e.push(`${h.autoConnectIde?`Enabled`:`Disabled`} auto-connect to IDE`),h.autoInstallIdeExtension!==v.current.autoInstallIdeExtension&&e.push(`${h.autoInstallIdeExtension?`Enabled`:`Disabled`} auto-install IDE extension`),h.autoCompactEnabled!==v.current.autoCompactEnabled&&e.push(`${h.autoCompactEnabled?`Enabled`:`Disabled`} auto-compact`),h.respectGitignore!==v.current.respectGitignore&&e.push(`${h.respectGitignore?`Enabled`:`Disabled`} respect .gitignore in file picker`),h.copyFullResponse!==v.current.copyFullResponse&&e.push(`${h.copyFullResponse?`Enabled`:`Disabled`} always copy full response`),h.copyOnSelect!==v.current.copyOnSelect&&e.push(`${h.copyOnSelect?`Enabled`:`Disabled`} copy on select`),h.terminalProgressBarEnabled!==v.current.terminalProgressBarEnabled&&e.push(`${h.terminalProgressBarEnabled?`Enabled`:`Disabled`} terminal progress bar`),h.showStatusInTerminalTab!==v.current.showStatusInTerminalTab&&e.push(`${h.showStatusInTerminalTab?`Enabled`:`Disabled`} terminal tab status`),h.showTurnDuration!==v.current.showTurnDuration&&e.push(`${h.showTurnDuration?`Enabled`:`Disabled`} turn duration`),h.remoteControlAtStartup!==v.current.remoteControlAtStartup){let t=h.remoteControlAtStartup===void 0?`Reset Remote Control to default`:`${h.remoteControlAtStartup?`Enabled`:`Disabled`} Remote Control for all sessions`;e.push(t)}y?.autoUpdatesChannel!==ve.current?.autoUpdatesChannel&&e.push(`Set auto-update channel to ${l.bold(y?.autoUpdatesChannel??`latest`)}`),e.length>0?t(e.join(`
2
- `)):t(`Config dialog dismissed`,{display:`system`})},[R,st,h,N,S,T,y?.autoUpdatesChannel,Re()?y?.fastMode:void 0,t]),Rt=(0,X.useCallback)(()=>{ue!==ft.current&&le(ft.current),x(()=>v.current);let e=lt;w(`localSettings`,{spinnerTipsEnabled:e?.spinnerTipsEnabled,prefersReducedMotion:e?.prefersReducedMotion,defaultView:e?.defaultView,outputStyle:e?.outputStyle});let t=dt;w(`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=mt;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:ot(e.toolPermissionContext)})),pe()!==ht&&fe(ht)},[ue,le,lt,dt,mt,ht,P]);de(`confirm:no`,(0,X.useCallback)(()=>{R===null&&(L.current&&Rt(),t(`Config dialog dismissed`,{display:`system`}))},[R,Rt,t]),{context:`Settings`,isActive:R===null&&!k&&!d}),de(`settings:close`,Lt,{context:`Settings`,isActive:R===null&&!k&&!d});let Vt=(0,X.useCallback)(()=>{let e=W[E];if(!(!e||!e.onChange)){if(e.type===`boolean`){L.current=!0,e.onChange(!e.value),e.id===`thinkingEnabled`&&(!e.value===ct.current?vt(!1):n.messages.some(e=>e.type===`assistant`)&&vt(!0));return}if(e.id===`theme`||e.id===`model`||e.id===`teammateDefaultModel`||e.id===`showExternalIncludesDialog`||e.id===`outputStyle`||e.id===`language`)switch(e.id){case`theme`:B(`Theme`),i(!0);return;case`model`:B(`Model`),i(!0);return;case`teammateDefaultModel`:B(`TeammateModel`),i(!0);return;case`showExternalIncludesDialog`:B(`ExternalIncludes`),i(!0);return;case`outputStyle`:B(`OutputStyle`),i(!0);return;case`language`:B(`Language`),i(!0);return}if(e.id===`autoUpdatesChannel`){if(H){B(`EnableAutoUpdates`),i(!0);return}(y?.autoUpdatesChannel??`latest`)===`latest`?(B(`ChannelDowngrade`),i(!0)):(L.current=!0,w(`userSettings`,{autoUpdatesChannel:`latest`,minimumVersion:void 0}),b(e=>({...e,autoUpdatesChannel:`latest`,minimumVersion:void 0})),A(`tengu_autoupdate_channel_changed`,{channel:`latest`}));return}if(e.type===`enum`){L.current=!0;let t=(e.options.indexOf(e.value)+1)%e.options.length;e.onChange(e.options[t]);return}}},[H,W,E,y?.autoUpdatesChannel,i]),G=e=>{vt(!1);let t=Math.max(0,Math.min(W.length-1,E+e));Le(t),Ft(t)};return ce({"select:previous":()=>{E===0?(vt(!1),j(!0),O(0)):G(-1)},"select:next":()=>G(1),"scroll:lineUp":()=>G(-1),"scroll:lineDown":()=>G(1),"select:accept":Vt,"select:previousValue":()=>Vt(),"select:nextValue":()=>Vt(),"settings:search":()=>{j(!0),bt(``)}},{context:`Settings`,isActive:R===null&&!k&&!d}),(0,Z.jsx)(g,{flexDirection:`column`,width:`100%`,tabIndex:0,autoFocus:!0,onKeyDown:(0,X.useCallback)(e=>{if(R===null&&!d){if(k){if(e.key===`escape`){e.preventDefault(),V.length>0?bt(``):j(!1);return}(e.key===`return`||e.key===`down`||e.key===`wheeldown`)&&(e.preventDefault(),j(!1),Le(0),O(0));return}if(e.key===`left`||e.key===`right`||e.key===`tab`){e.preventDefault(),Vt();return}e.ctrl||e.meta||e.key===`j`||e.key===`k`||e.key===`/`||e.key.length===1&&e.key!==` `&&(e.preventDefault(),j(!0),bt(e.key))}},[R,d,k,V,bt,Vt]),children:R===`Theme`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Wt,{onThemeSelect:e=>{L.current=!0,le(e),B(null),i(!1)},onCancel:()=>{B(null),i(!1)},hideEscToCancel:!0,skipExitHandling:!0}),(0,Z.jsx)(g,{children:(0,Z.jsx)(f,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(m,{children:[(0,Z.jsx)(p,{shortcut:`Enter`,action:`select`}),(0,Z.jsx)(z,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})})]}):R===`Model`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(qt,{initial:N,onSelect:(e,t)=>{L.current=!0,kt(e),B(null),i(!1)},onCancel:()=>{B(null),i(!1)},showFastModeNotice:Re()?Qe&&we(N)&&Be():!1}),(0,Z.jsx)(f,{dimColor:!0,children:(0,Z.jsxs)(m,{children:[(0,Z.jsx)(p,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(z,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]}):R===`TeammateModel`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(qt,{initial:h.teammateDefaultModel??null,skipSettingsWrite:!0,headerText:`Default model for newly spawned teammates. The leader can override via the tool call's model parameter.`,onSelect:(e,t)=>{B(null),i(!1),!(h.teammateDefaultModel===void 0&&e===null)&&(L.current=!0,x(t=>t.teammateDefaultModel===e?t:{...t,teammateDefaultModel:e}),_({...C(),teammateDefaultModel:e}),F(t=>({...t,teammateDefaultModel:On(e)})),A(`tengu_teammate_default_model_changed`,{model:e}))},onCancel:()=>{B(null),i(!1)}}),(0,Z.jsx)(f,{dimColor:!0,children:(0,Z.jsxs)(m,{children:[(0,Z.jsx)(p,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(z,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]}):R===`ExternalIncludes`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Xt,{onDone:()=>{B(null),i(!1)},externalIncludes:et(Et)}),(0,Z.jsx)(f,{dimColor:!0,children:(0,Z.jsxs)(m,{children:[(0,Z.jsx)(p,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(z,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`disable external includes`})]})})]}):R===`OutputStyle`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(yn,{initialStyle:S,onComplete:e=>{L.current=!0,Ce(e??`default`),B(null),i(!1),w(`localSettings`,{outputStyle:e}),A(`tengu_output_style_changed`,{style:e??`default`,source:`config_panel`,settings_source:`localSettings`})},onCancel:()=>{B(null),i(!1)}}),(0,Z.jsx)(f,{dimColor:!0,children:(0,Z.jsxs)(m,{children:[(0,Z.jsx)(p,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(z,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]}):R===`Language`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(wn,{initialLanguage:T,onComplete:e=>{L.current=!0,Ne(e),B(null),i(!1),w(`userSettings`,{language:e}),A(`tengu_language_changed`,{language:e??`default`,source:`config_panel`})},onCancel:()=>{B(null),i(!1)}}),(0,Z.jsx)(f,{dimColor:!0,children:(0,Z.jsxs)(m,{children:[(0,Z.jsx)(p,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(z,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]})})]}):R===`EnableAutoUpdates`?(0,Z.jsx)(ae,{title:`Enable Auto-Updates`,onCancel:()=>{B(null),i(!1)},hideBorder:!0,hideInputGuide:!0,children:H?.type===`config`?(0,Z.jsx)(ut,{options:[{label:`Enable with latest channel`,value:`latest`},{label:`Enable with stable channel`,value:`stable`}],onChange:e=>{L.current=!0,B(null),i(!1),x(e=>({...e,autoUpdates:!0})),_({...C(),autoUpdates:!0}),w(`userSettings`,{autoUpdatesChannel:e,minimumVersion:void 0}),b(t=>({...t,autoUpdatesChannel:e,minimumVersion:void 0})),A(`tengu_autoupdate_enabled`,{channel:e})}}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(f,{children:H?.type===`env`?`Auto-updates are controlled by an environment variable and cannot be changed here.`:`Auto-updates are disabled in development builds.`}),H?.type===`env`&&(0,Z.jsxs)(f,{dimColor:!0,children:[`Unset `,H.envVar,` to re-enable auto-updates.`]})]})}):R===`ChannelDowngrade`?(0,Z.jsx)(hn,{currentVersion:`2.6.9`,onChoice:e=>{if(B(null),i(!1),e===`cancel`)return;L.current=!0;let t={autoUpdatesChannel:`stable`};e===`stay`&&(t.minimumVersion=`2.6.9`),w(`userSettings`,t),b(e=>({...e,...t})),A(`tengu_autoupdate_channel_changed`,{channel:`stable`,minimum_version_set:e===`stay`})}}):(0,Z.jsxs)(g,{flexDirection:`column`,gap:1,marginY:se?void 0:1,children:[(0,Z.jsx)(re,{query:V,isFocused:k&&!d,isTerminalFocused:Ve,cursorOffset:xt,placeholder:`Search settings…`}),(0,Z.jsx)(g,{flexDirection:`column`,children:W.length===0?(0,Z.jsxs)(f,{dimColor:!0,italic:!0,children:[`No settings match "`,V,`"`]}):(0,Z.jsxs)(Z.Fragment,{children:[D>0&&(0,Z.jsxs)(f,{dimColor:!0,children:[s.arrowUp,` `,D,` more above`]}),W.slice(D,D+M).map((e,t)=>{let n=D+t===E&&!d&&!k;return(0,Z.jsx)(Y.Fragment,{children:(0,Z.jsxs)(g,{width:`100%`,children:[(0,Z.jsx)(g,{width:44,children:(0,Z.jsxs)(f,{color:n?`suggestion`:void 0,children:[n?s.pointer:` `,` `,e.label]})}),(0,Z.jsx)(g,{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()}),_t&&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:An[e.value.toString()]??e.value.toString()}):e.id===`notifChannel`?(0,Z.jsx)(f,{color:n?`suggestion`:void 0,children:(0,Z.jsx)(kn,{value:e.value.toString()})}):e.id===`defaultPermissionMode`?(0,Z.jsx)(f,{color:n?`suggestion`:void 0,children:Se(e.value)}):e.id===`autoUpdatesChannel`&&H?(0,Z.jsxs)(g,{flexDirection:`column`,children:[(0,Z.jsx)(f,{color:n?`suggestion`:void 0,children:`disabled`}),(0,Z.jsxs)(f,{dimColor:!0,children:[`(`,Ie(H),`)`]})]}):(0,Z.jsx)(f,{color:n?`suggestion`:void 0,children:e.value.toString()})})]})},e.id)}),D+M<W.length&&(0,Z.jsxs)(f,{dimColor:!0,children:[s.arrowDown,` `,W.length-D-M,` more below`]})]})}),d?(0,Z.jsx)(f,{dimColor:!0,children:(0,Z.jsxs)(m,{children:[(0,Z.jsx)(p,{shortcut:`←/→ tab`,action:`switch`}),(0,Z.jsx)(p,{shortcut:`↓`,action:`return`}),(0,Z.jsx)(z,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`close`})]})}):k?(0,Z.jsx)(f,{dimColor:!0,children:(0,Z.jsxs)(m,{children:[(0,Z.jsx)(f,{children:`Type to filter`}),(0,Z.jsx)(p,{shortcut:`Enter/↓`,action:`select`}),(0,Z.jsx)(p,{shortcut:`↑`,action:`tabs`}),(0,Z.jsx)(z,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`clear`})]})}):(0,Z.jsx)(f,{dimColor:!0,children:(0,Z.jsxs)(m,{children:[(0,Z.jsx)(z,{action:`select:accept`,context:`Settings`,fallback:`Space`,description:`change`}),(0,Z.jsx)(z,{action:`settings:close`,context:`Settings`,fallback:`Enter`,description:`save`}),(0,Z.jsx)(z,{action:`settings:search`,context:`Settings`,fallback:`/`,description:`search`}),(0,Z.jsx)(z,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]})})]})})}function On(e){return e===void 0?xe(_t()):e===null?`Default (leader's model)`:xe(e)}function kn({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,An,jn=t((()=>{h(),Y=n(d(),1),X=n(d(),1),U(),o(),b(),Ee(),u(),ve(),kt(),He(),k(),Lt(),Ut(),st(),Gt(),S(),Jt(),Yt(),_n(),Tt(),Cn(),En(),nt(),H(),G(),Zt(),xt(),Ne(),y(),Et(),i(),Ce(),Pe(),Rt(),P(),$t(),L(),Le(),vt(),Ge(),Z=_(),An={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 Mn({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 ${M(o,!0,r)}`),i&&(c=c?`${i} · ${c}`:i),n>=62?(0,Q.jsxs)(g,{flexDirection:`column`,children:[(0,Q.jsx)(f,{bold:!0,children:e}),(0,Q.jsxs)(g,{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)(g,{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 Nn(){let[e,t]=(0,In.useState)(null),[n,r]=(0,In.useState)(null),[i,a]=(0,In.useState)(!0),{columns:o}=ee(),s=o-2,c=Math.min(s,80),l=Fn.useCallback(async()=>{a(!0),r(null);try{t(await tn())}catch(e){Ue(e);let t=e,n=t.response?.data?D(t.response.data):void 0;r(n?`Failed to load usage data: ${n}`:`Failed to load usage data`)}finally{a(!1)}},[]);if((0,In.useEffect)(()=>{l()},[l]),de(`settings:retry`,()=>{l()},{context:`Settings`,isActive:!!n&&!i}),n)return(0,Q.jsxs)(g,{flexDirection:`column`,gap:1,children:[(0,Q.jsxs)(f,{color:`error`,children:[`Error: `,n]}),(0,Q.jsx)(f,{dimColor:!0,children:(0,Q.jsxs)(m,{children:[(0,Q.jsx)(z,{action:`settings:retry`,context:`Settings`,fallback:`r`,description:`retry`}),(0,Q.jsx)(z,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]})})]});if(!e)return(0,Q.jsxs)(g,{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)(z,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})})]});let u=E(),d=u===`max`||u===`team`||u===null,te=[{title:`Current session`,limit:e.five_hour},{title:`Current week (all models)`,limit:e.seven_day},...d?[{title:`Current week (Sonnet only)`,limit:e.seven_day_sonnet}]:[]];return(0,Q.jsxs)(g,{flexDirection:`column`,gap:1,width:`100%`,children:[te.some(({limit:e})=>e)||(0,Q.jsx)(f,{dimColor:!0,children:`/usage is only available for subscription plans.`}),te.map(({title:e,limit:t})=>t&&(0,Q.jsx)(Mn,{title:e,limit:t,maxWidth:c},e)),e.extra_usage&&(0,Q.jsx)(Pn,{extraUsage:e.extra_usage,maxWidth:c}),nn()&&(0,Q.jsx)(an,{maxWidth:c}),(0,Q.jsx)(f,{dimColor:!0,children:(0,Q.jsx)(z,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})})]})}function Pn({extraUsage:e,maxWidth:t}){let n=E();if(!(n===`pro`||n===`max`))return!1;if(!e.is_enabled)return F.isEnabled()?(0,Q.jsxs)(g,{flexDirection:`column`,children:[(0,Q.jsx)(f,{bold:!0,children:Ln}),(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)(g,{flexDirection:`column`,children:[(0,Q.jsx)(f,{bold:!0,children:Ln}),(0,Q.jsx)(f,{dimColor:!0,children:`Unlimited`})]});if(typeof e.used_credits!=`number`||typeof e.utilization!=`number`)return null;let r=Dt(e.used_credits/100,2),i=Dt(e.monthly_limit/100,2),a=new Date,o=new Date(a.getFullYear(),a.getMonth()+1,1);return(0,Q.jsx)(Mn,{title:Ln,limit:{utilization:e.utilization,resets_at:o.toISOString()},showTimeInReset:!1,extraSubtext:`${r} / ${i} spent`,maxWidth:t})}var Fn,In,Q,Ln,Rn=t((()=>{Fn=n(d(),1),In=n(d(),1),mt(),B(),T(),L(),h(),U(),en(),N(),He(),O(),H(),rn(),Q=_(),Ln=`Extra usage`}));function zn({onClose:e,context:t,defaultTab:n}){let[r,i]=(0,Bn.useState)(n),[a,o]=(0,Bn.useState)(!1),[s,c]=(0,Bn.useState)(!1),l=Ht(),{rows:u}=Vt(ee()),d=l?u+1:Math.max(15,Math.min(Math.floor(u*.8),30)),[te]=(0,Bn.useState)(()=>cn().catch(()=>[]));return Ft(),de(`confirm:no`,()=>{a||e(`Status dialog dismissed`,{display:`system`})},{context:`Settings`,isActive:!a&&!(r===`Config`&&s)}),(0,$.jsx)(le,{color:`permission`,children:(0,$.jsx)(ue,{color:`permission`,selectedTab:r,onTabChange:i,hidden:a,initialHeaderFocused:n!==`Config`,contentHeight:a||l?void 0:d,children:[(0,$.jsx)(se,{title:`Status`,children:(0,$.jsx)(un,{context:t,diagnosticsPromise:te})},`status`),(0,$.jsx)(se,{title:`Config`,children:(0,$.jsx)(Bn.Suspense,{fallback:null,children:(0,$.jsx)(Dn,{context:t,onClose:e,setTabsHidden:o,onIsSearchModeChange:c,contentHeight:d})})},`config`),(0,$.jsx)(se,{title:`Usage`,children:(0,$.jsx)(Nn,{})},`usage`)]})})}var Bn,$,Vn=t((()=>{d(),Bn=n(d(),1),U(),W(),L(),G(),h(),mn(),jn(),Rn(),$=_()}));export{Vn as n,zn as t};
@@ -1 +0,0 @@
1
- import"./chunk-DR8-3Aex.js";import{Rn as e,T as t,b as n,t as r,x as i}from"./src-Di342QoJ.js";import{t as a}from"./jsx-runtime-D-D469L8.js";import{a as o,n as s}from"./env-chR0gV31.js";e(),r(),o();var c=a(),l=58;function u(){let[e]=t(),r=`Welcome to Claude Code`;return s.terminal===`Apple_Terminal`?(0,c.jsx)(d,{theme:e,welcomeMessage:r}):[`light`,`light-daltonized`,`light-ansi`].includes(e)?(0,c.jsx)(i,{width:l,children:(0,c.jsxs)(n,{children:[(0,c.jsxs)(n,{children:[(0,c.jsxs)(n,{color:`claude`,children:[r,` `]}),(0,c.jsxs)(n,{dimColor:!0,children:[`v`,`2.6.9`,` `]})]}),(0,c.jsx)(n,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,c.jsx)(n,{children:` `}),(0,c.jsx)(n,{children:` `}),(0,c.jsx)(n,{children:` `}),(0,c.jsx)(n,{children:` ░░░░░░ `}),(0,c.jsx)(n,{children:` ░░░ ░░░░░░░░░░ `}),(0,c.jsx)(n,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,c.jsx)(n,{children:` `}),(0,c.jsxs)(n,{children:[(0,c.jsx)(n,{dimColor:!0,children:` ░░░░`}),(0,c.jsx)(n,{children:` ██ `})]}),(0,c.jsxs)(n,{children:[(0,c.jsx)(n,{dimColor:!0,children:` ░░░░░░░░░░`}),(0,c.jsx)(n,{children:` ██▒▒██ `})]}),(0,c.jsx)(n,{children:` ▒▒ ██ ▒`}),(0,c.jsxs)(n,{children:[` `,(0,c.jsx)(n,{color:`clawd_body`,children:` █████████ `}),` ▒▒░░▒▒ ▒ ▒▒`]}),(0,c.jsxs)(n,{children:[` `,(0,c.jsx)(n,{color:`clawd_body`,backgroundColor:`clawd_background`,children:`██▄█████▄██`}),` ▒▒ ▒▒ `]}),(0,c.jsxs)(n,{children:[` `,(0,c.jsx)(n,{color:`clawd_body`,children:` █████████ `}),` ░ ▒ `]}),(0,c.jsxs)(n,{children:[`…………………`,(0,c.jsx)(n,{color:`clawd_body`,children:`█ █ █ █`}),`……………………………………………………………………░…………………………▒…………`]})]})}):(0,c.jsx)(i,{width:l,children:(0,c.jsxs)(n,{children:[(0,c.jsxs)(n,{children:[(0,c.jsxs)(n,{color:`claude`,children:[r,` `]}),(0,c.jsxs)(n,{dimColor:!0,children:[`v`,`2.6.9`,` `]})]}),(0,c.jsx)(n,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,c.jsx)(n,{children:` `}),(0,c.jsx)(n,{children:` * █████▓▓░ `}),(0,c.jsx)(n,{children:` * ███▓░ ░░ `}),(0,c.jsx)(n,{children:` ░░░░░░ ███▓░ `}),(0,c.jsx)(n,{children:` ░░░ ░░░░░░░░░░ ███▓░ `}),(0,c.jsxs)(n,{children:[(0,c.jsx)(n,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,c.jsx)(n,{bold:!0,children:`*`}),(0,c.jsx)(n,{children:` ██▓░░ ▓ `})]}),(0,c.jsx)(n,{children:` ░▓▓███▓▓░ `}),(0,c.jsx)(n,{dimColor:!0,children:` * ░░░░ `}),(0,c.jsx)(n,{dimColor:!0,children:` ░░░░░░░░ `}),(0,c.jsx)(n,{dimColor:!0,children:` ░░░░░░░░░░░░░░░░ `}),(0,c.jsxs)(n,{children:[` `,(0,c.jsx)(n,{color:`clawd_body`,children:` █████████ `}),` `,(0,c.jsx)(n,{dimColor:!0,children:`*`}),(0,c.jsx)(n,{children:` `})]}),(0,c.jsxs)(n,{children:[` `,(0,c.jsx)(n,{color:`clawd_body`,children:`██▄█████▄██`}),(0,c.jsx)(n,{children:` `}),(0,c.jsx)(n,{bold:!0,children:`*`}),(0,c.jsx)(n,{children:` `})]}),(0,c.jsxs)(n,{children:[` `,(0,c.jsx)(n,{color:`clawd_body`,children:` █████████ `}),` * `]}),(0,c.jsxs)(n,{children:[`…………………`,(0,c.jsx)(n,{color:`clawd_body`,children:`█ █ █ █`}),`………………………………………………………………………………………………………………`]})]})})}function d({theme:e,welcomeMessage:t}){return[`light`,`light-daltonized`,`light-ansi`].includes(e)?(0,c.jsx)(i,{width:l,children:(0,c.jsxs)(n,{children:[(0,c.jsxs)(n,{children:[(0,c.jsxs)(n,{color:`claude`,children:[t,` `]}),(0,c.jsxs)(n,{dimColor:!0,children:[`v`,`2.6.9`,` `]})]}),(0,c.jsx)(n,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,c.jsx)(n,{children:` `}),(0,c.jsx)(n,{children:` `}),(0,c.jsx)(n,{children:` `}),(0,c.jsx)(n,{children:` ░░░░░░ `}),(0,c.jsx)(n,{children:` ░░░ ░░░░░░░░░░ `}),(0,c.jsx)(n,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,c.jsx)(n,{children:` `}),(0,c.jsxs)(n,{children:[(0,c.jsx)(n,{dimColor:!0,children:` ░░░░`}),(0,c.jsx)(n,{children:` ██ `})]}),(0,c.jsxs)(n,{children:[(0,c.jsx)(n,{dimColor:!0,children:` ░░░░░░░░░░`}),(0,c.jsx)(n,{children:` ██▒▒██ `})]}),(0,c.jsx)(n,{children:` ▒▒ ██ ▒`}),(0,c.jsx)(n,{children:` ▒▒░░▒▒ ▒ ▒▒`}),(0,c.jsxs)(n,{children:[` `,(0,c.jsx)(n,{color:`clawd_body`,children:`▗`}),(0,c.jsxs)(n,{color:`clawd_background`,backgroundColor:`clawd_body`,children:[` `,`▗`,` `,`▖`,` `]}),(0,c.jsx)(n,{color:`clawd_body`,children:`▖`}),` ▒▒ ▒▒ `]}),(0,c.jsxs)(n,{children:[` `,(0,c.jsx)(n,{backgroundColor:`clawd_body`,children:` `.repeat(9)}),` ░ ▒ `]}),(0,c.jsxs)(n,{children:[`…………………`,(0,c.jsx)(n,{backgroundColor:`clawd_body`,children:` `}),(0,c.jsx)(n,{children:` `}),(0,c.jsx)(n,{backgroundColor:`clawd_body`,children:` `}),(0,c.jsx)(n,{children:` `}),(0,c.jsx)(n,{backgroundColor:`clawd_body`,children:` `}),(0,c.jsx)(n,{children:` `}),(0,c.jsx)(n,{backgroundColor:`clawd_body`,children:` `}),`……………………………………………………………………░…………………………▒…………`]})]})}):(0,c.jsx)(i,{width:l,children:(0,c.jsxs)(n,{children:[(0,c.jsxs)(n,{children:[(0,c.jsxs)(n,{color:`claude`,children:[t,` `]}),(0,c.jsxs)(n,{dimColor:!0,children:[`v`,`2.6.9`,` `]})]}),(0,c.jsx)(n,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,c.jsx)(n,{children:` `}),(0,c.jsx)(n,{children:` * █████▓▓░ `}),(0,c.jsx)(n,{children:` * ███▓░ ░░ `}),(0,c.jsx)(n,{children:` ░░░░░░ ███▓░ `}),(0,c.jsx)(n,{children:` ░░░ ░░░░░░░░░░ ███▓░ `}),(0,c.jsxs)(n,{children:[(0,c.jsx)(n,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,c.jsx)(n,{bold:!0,children:`*`}),(0,c.jsx)(n,{children:` ██▓░░ ▓ `})]}),(0,c.jsx)(n,{children:` ░▓▓███▓▓░ `}),(0,c.jsx)(n,{dimColor:!0,children:` * ░░░░ `}),(0,c.jsx)(n,{dimColor:!0,children:` ░░░░░░░░ `}),(0,c.jsx)(n,{dimColor:!0,children:` ░░░░░░░░░░░░░░░░ `}),(0,c.jsxs)(n,{children:[` `,(0,c.jsx)(n,{dimColor:!0,children:`*`}),(0,c.jsx)(n,{children:` `})]}),(0,c.jsxs)(n,{children:[` `,(0,c.jsx)(n,{color:`clawd_body`,children:`▗`}),(0,c.jsxs)(n,{color:`clawd_background`,backgroundColor:`clawd_body`,children:[` `,`▗`,` `,`▖`,` `]}),(0,c.jsx)(n,{color:`clawd_body`,children:`▖`}),(0,c.jsx)(n,{children:` `}),(0,c.jsx)(n,{bold:!0,children:`*`}),(0,c.jsx)(n,{children:` `})]}),(0,c.jsxs)(n,{children:[` `,(0,c.jsx)(n,{backgroundColor:`clawd_body`,children:` `.repeat(9)}),` * `]}),(0,c.jsxs)(n,{children:[`…………………`,(0,c.jsx)(n,{backgroundColor:`clawd_body`,children:` `}),(0,c.jsx)(n,{children:` `}),(0,c.jsx)(n,{backgroundColor:`clawd_body`,children:` `}),(0,c.jsx)(n,{children:` `}),(0,c.jsx)(n,{backgroundColor:`clawd_body`,children:` `}),(0,c.jsx)(n,{children:` `}),(0,c.jsx)(n,{backgroundColor:`clawd_body`,children:` `}),`………………………………………………………………………………………………………………`]})]})})}export{u as t};
@@ -1 +0,0 @@
1
- import{a as e,n as t,o as n}from"./api-DLLVkmRJ.js";n();export{t as fetchCodeSessionsFromSessionsAPI,e as getOAuthHeaders};
@@ -1 +0,0 @@
1
- import{i as e,s as t}from"./assistant-_dIpsqHM.js";e();export{t as isAssistantMode};
@@ -1 +0,0 @@
1
- import{Cb as e,Sb as t,bb as n,xb as r}from"./loadAgentsDir-Cl2w3uvH.js";e();export{n as authLogin,r as authLogout,t as authStatus};
@@ -1 +0,0 @@
1
- import{t as e}from"./backgroundHousekeeping-Bbkz61_-.js";export{e as startBackgroundHousekeeping};
@@ -1 +0,0 @@
1
- import{a as e,n as t,o as n,t as r}from"./bridgeConfig-DXUNQp2l.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-G6vxQV-7.js";t();export{n as checkBridgeMinVersion,e as getBridgeDisabledReason};
@@ -1 +0,0 @@
1
- import{n as e}from"./bridgeMain-DlnIQOtX.js";export{e as bridgeMain};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./caches-wtRUk5y5.js";e();export{t as clearSessionCaches};
@@ -1 +0,0 @@
1
- import{SA as e,vA as t}from"./loadAgentsDir-Cl2w3uvH.js";t();export{e as settingsChangeDetector};
@@ -1 +0,0 @@
1
- import{a as e,c as t}from"./channelNotification-D8do6HUN.js";t();export{e as ChannelPermissionRequestNotificationSchema};
@@ -1 +0,0 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./conversation-DizpkPtq.js";var r;e((()=>{t(),r=async(e,t)=>(await n(t),{type:`text`,value:``})}))();export{r as call};
@@ -1 +0,0 @@
1
- import{la as e,ua as t}from"./paths-q1-Ni8Oh.js";t();export{e as getOrganizationUUID};
@@ -1 +0,0 @@
1
- import{Gi as e,Xi as t,zi as n}from"./loadAgentsDir-Cl2w3uvH.js";t();export{n as clearCommandsCache,e as getCommands};
@@ -1 +0,0 @@
1
- import{d as e,l as t}from"./commitAttribution-CUdm_sRl.js";t();export{e as isInternalModelRepo};
@@ -1 +0,0 @@
1
- import{n as e,r as t,t as n}from"./context-noninteractive-BJ4hE3MX.js";t();export{n as call,e as collectContextData};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./conversation-DizpkPtq.js";e();export{t as clearConversation};
@@ -1 +0,0 @@
1
- import{a as e,i as t,n,r}from"./createSession-D6v0lBtG.js";t();export{n as createBridgeSession,r as getBridgeSession,e as updateBridgeSessionTitle};
@@ -1 +0,0 @@
1
- import{r as e,t}from"./datadog-BFSdlK6C.js";t();export{e as shutdownDatadog};
@@ -1,14 +0,0 @@
1
- import{n as e,t}from"./defineProperty-80gRi2ZW.js";import{a as n,c as r,i,l as a,n as o,o as s,r as c,s as l,t as u,u as d}from"./classPrivateFieldSet2-EAQNhHs8.js";import{Cn as f,Ln as p,Mn as m,Tt as h,Xn as g,Yn as _,_r as v,kt as y,nn as b,un as x,vt as ee,wn as S}from"./schemas-BGAvj1T4.js";import{t as te}from"./v4-f1i_CNUT.js";import{Tt as ne,cn as re,jr as C,lr as ie}from"./state-sIHsFpDu.js";import{Ac as ae,Dr as oe,Pr as se,_c as ce,no as le,oo as ue}from"./paths-q1-Ni8Oh.js";import{l as de,p as fe}from"./sessionStoragePortable-DJZ_6cL8.js";import{Ar as pe,Cv as me,G as he,Gi as ge,JE as _e,K as ve,Ku as ye,Of as be,Xi as xe,YE as Se,_r as Ce,fp as we,kf as Te,pp as Ee,qu as De,va as Oe,wv as ke,ya as Ae}from"./loadAgentsDir-Cl2w3uvH.js";import{Bn as je,Vn as Me}from"./prompt-BmOnuQfF.js";import{o as Ne,t as Pe}from"./fileStateCache-C7-TxF8G.js";import{t as Fe}from"./QueryEngine-J15EOjWx.js";import*as w from"node:path";import{dirname as Ie}from"node:path";import{randomUUID as Le}from"node:crypto";import{Readable as Re,Writable as ze}from"node:stream";te();var T={authenticate:`authenticate`,document_did_change:`document/didChange`,document_did_close:`document/didClose`,document_did_focus:`document/didFocus`,document_did_open:`document/didOpen`,document_did_save:`document/didSave`,initialize:`initialize`,logout:`logout`,nes_accept:`nes/accept`,nes_close:`nes/close`,nes_reject:`nes/reject`,nes_start:`nes/start`,nes_suggest:`nes/suggest`,session_cancel:`session/cancel`,session_close:`session/close`,session_fork:`session/fork`,session_list:`session/list`,session_load:`session/load`,session_new:`session/new`,session_prompt:`session/prompt`,session_resume:`session/resume`,session_set_config_option:`session/set_config_option`,session_set_mode:`session/set_mode`,session_set_model:`session/set_model`},E={elicitation_complete:`elicitation/complete`,elicitation_create:`elicitation/create`,fs_read_text_file:`fs/read_text_file`,fs_write_text_file:`fs/write_text_file`,session_request_permission:`session/request_permission`,session_update:`session/update`,terminal_create:`terminal/create`,terminal_kill:`terminal/kill`,terminal_output:`terminal/output`,terminal_release:`terminal/release`,terminal_wait_for_exit:`terminal/wait_for_exit`},Be=S({_meta:m(p(),g()).nullish(),terminal:y().optional().default(!1)}),Ve=S({_meta:m(p(),g()).nullish(),label:p().nullish(),name:p(),optional:y().optional().default(!1),secret:y().optional().default(!0)}),He=S({_meta:m(p(),g()).nullish(),description:p().nullish(),id:p(),name:p()}),Ue=S({_meta:m(p(),g()).nullish(),description:p().nullish(),id:p(),link:p().nullish(),name:p(),vars:h(Ve)}),We=S({_meta:m(p(),g()).nullish(),args:h(p()).optional(),description:p().nullish(),env:m(p(),p()).optional(),id:p(),name:p()}),Ge=_([Ue.and(S({type:x(`env_var`)})),We.and(S({type:x(`terminal`)})),He]),Ke=S({_meta:m(p(),g()).nullish(),methodId:p()}),qe=S({_meta:m(p(),g()).nullish()}),Je=S({_meta:m(p(),g()).nullish(),blob:p(),mimeType:p().nullish(),uri:p()}),Ye=S({default:y().nullish(),description:p().nullish(),title:p().nullish()}),Xe=S({_meta:m(p(),g()).nullish()}),Ze=S({_meta:m(p(),g()).nullish()}),Qe=S({amount:f(),currency:p()}),$e=S({_meta:m(p(),g()).nullish(),terminalId:p()}),et=S({_meta:m(p(),g()).nullish(),newText:p(),oldText:p().nullish(),path:p()}),tt=_([p(),f(),f(),y(),h(p())]),nt=b(_([S({content:m(p(),tt).nullish()}).and(S({action:x(`accept`)})),S({action:x(`decline`)}),S({action:x(`cancel`)})]),S({_meta:m(p(),g()).nullish()})),rt=S({_meta:m(p(),g()).nullish()}),it=p(),at=S({_meta:m(p(),g()).nullish(),elicitationId:it}),ot=x(`object`),st=x(`string`),ct=S({_meta:m(p(),g()).nullish()}),lt=S({_meta:m(p(),g()).nullish(),form:rt.nullish(),url:ct.nullish()}),ut=S({const:p(),title:p()}),dt=S({_meta:m(p(),g()).nullish(),name:p(),value:p()}),ft=S({code:_([x(-32700),x(-32600),x(-32601),x(-32602),x(-32603),x(-32800),x(-32e3),x(-32002),x(-32042),f().int().min(-2147483648,{message:`Invalid value: Expected int32 to be >= -2147483648`}).max(2147483647,{message:`Invalid value: Expected int32 to be <= 2147483647`})]),data:g().optional(),message:p()}),pt=g(),mt=g(),ht=g(),gt=S({_meta:m(p(),g()).nullish(),readTextFile:y().optional().default(!1),writeTextFile:y().optional().default(!1)}),_t=S({_meta:m(p(),g()).nullish(),name:p(),value:p()}),vt=S({_meta:m(p(),g()).nullish(),name:p(),title:p().nullish(),version:p()}),yt=S({default:f().nullish(),description:p().nullish(),maximum:f().nullish(),minimum:f().nullish(),title:p().nullish()}),bt=S({_meta:m(p(),g()).nullish()}),xt=S({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cursor:p().nullish(),cwd:p().nullish()}),St=S({_meta:m(p(),g()).nullish()}),Ct=S({_meta:m(p(),g()).nullish(),logout:St.nullish()}),wt=S({_meta:m(p(),g()).nullish()}),Tt=S({_meta:m(p(),g()).nullish()}),Et=S({_meta:m(p(),g()).nullish(),http:y().optional().default(!1),sse:y().optional().default(!1)}),Dt=S({_meta:m(p(),g()).nullish(),headers:h(_t),name:p(),url:p()}),Ot=S({_meta:m(p(),g()).nullish(),headers:h(_t),name:p(),url:p()}),kt=S({_meta:m(p(),g()).nullish(),args:h(p()),command:p(),env:h(dt),name:p()}),D=_([Dt.and(S({type:x(`http`)})),Ot.and(S({type:x(`sse`)})),kt]),At=p(),jt=S({_meta:m(p(),g()).nullish(),description:p().nullish(),modelId:At,name:p()}),Mt=_([x(`error`),x(`warning`),x(`information`),x(`hint`)]),Nt=S({_meta:m(p(),g()).nullish()}),Pt=S({_meta:m(p(),g()).nullish()}),Ft=S({_meta:m(p(),g()).nullish()}),It=S({_meta:m(p(),g()).nullish()}),Lt=S({_meta:m(p(),g()).nullish()}),Rt=S({_meta:m(p(),g()).nullish(),maxCount:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish()}),zt=S({diff:p(),uri:p()}),Bt=S({endLine:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}),startLine:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}),text:p()}),Vt=S({_meta:m(p(),g()).nullish()}),Ht=S({_meta:m(p(),g()).nullish()}),Ut=S({languageId:p(),text:p(),uri:p()}),Wt=S({_meta:m(p(),g()).nullish(),maxCount:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish()}),Gt=_([x(`rejected`),x(`ignored`),x(`replaced`),x(`cancelled`)]),Kt=S({excerpts:h(Bt),uri:p()}),qt=S({_meta:m(p(),g()).nullish()}),Jt=S({_meta:m(p(),g()).nullish()}),Yt=S({name:p(),owner:p(),remoteUrl:p()}),Xt=S({_meta:m(p(),g()).nullish()}),Zt=S({_meta:m(p(),g()).nullish(),jump:Vt.nullish(),rename:Jt.nullish(),searchAndReplace:Xt.nullish()}),Qt=S({id:p(),isRegex:y().nullish(),replace:p(),search:p(),uri:p()}),$t=_([x(`automatic`),x(`diagnostic`),x(`manual`)]),en=S({_meta:m(p(),g()).nullish(),maxCount:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish()}),tn=S({_meta:m(p(),g()).nullish(),diagnostics:Nt.nullish(),editHistory:Rt.nullish(),openFiles:Ht.nullish(),recentFiles:Wt.nullish(),relatedSnippets:qt.nullish(),userActions:en.nullish()}),nn=S({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cwd:p(),mcpServers:h(D)}),rn=S({default:f().nullish(),description:p().nullish(),maximum:f().nullish(),minimum:f().nullish(),title:p().nullish()}),an=p(),on=_([x(`allow_once`),x(`allow_always`),x(`reject_once`),x(`reject_always`)]),sn=S({_meta:m(p(),g()).nullish(),kind:on,name:p(),optionId:an}),cn=_([x(`high`),x(`medium`),x(`low`)]),ln=_([x(`pending`),x(`in_progress`),x(`completed`)]),un=S({_meta:m(p(),g()).nullish(),content:p(),priority:cn,status:ln}),dn=S({_meta:m(p(),g()).nullish(),entries:h(un)}),O=S({character:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}),line:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`})}),fn=S({id:p(),position:O,uri:p()}),pn=S({id:p(),newName:p(),position:O,uri:p()}),mn=S({action:p(),position:O,timestampMs:f(),uri:p()}),hn=_([x(`utf-16`),x(`utf-32`),x(`utf-8`)]),gn=S({_meta:m(p(),g()).nullish(),auth:Be.optional().default({terminal:!1}),elicitation:lt.nullish(),fs:gt.optional().default({readTextFile:!1,writeTextFile:!1}),nes:Zt.nullish(),positionEncodings:h(hn).optional(),terminal:y().optional().default(!1)}),_n=S({_meta:m(p(),g()).nullish(),audio:y().optional().default(!1),embeddedContext:y().optional().default(!1),image:y().optional().default(!1)}),vn=f().int().gte(0).lte(65535),yn=S({_meta:m(p(),g()).nullish(),clientCapabilities:gn.optional().default({auth:{terminal:!1},fs:{readTextFile:!1,writeTextFile:!1},terminal:!1}),clientInfo:vt.nullish(),protocolVersion:vn}),k=S({end:O,start:O}),bn=S({message:p(),range:k,severity:Mt,uri:p()}),xn=S({languageId:p(),lastFocusedMs:f().nullish(),uri:p(),visibleRange:k.nullish()}),Sn=S({_meta:m(p(),g()).nullish(),diagnostics:h(bn).nullish(),editHistory:h(zt).nullish(),openFiles:h(xn).nullish(),recentFiles:h(Ut).nullish(),relatedSnippets:h(Kt).nullish(),userActions:h(mn).nullish()}),Cn=S({newText:p(),range:k}),wn=_([S({cursorPosition:O.nullish(),edits:h(Cn),id:p(),uri:p()}).and(S({kind:x(`edit`)})),fn.and(S({kind:x(`jump`)})),pn.and(S({kind:x(`rename`)})),Qt.and(S({kind:x(`searchAndReplace`)}))]),Tn=S({_meta:m(p(),g()).nullish(),content:p()}),En=S({_meta:m(p(),g()).nullish()}),A=_([f(),p()]).nullable();S({_meta:m(p(),g()).nullish(),requestId:A});var Dn=S({requestId:A}),On=ee([`assistant`,`user`]),j=S({_meta:m(p(),g()).nullish(),audience:h(On).nullish(),lastModified:p().nullish(),priority:f().nullish()}),kn=S({_meta:m(p(),g()).nullish(),annotations:j.nullish(),data:p(),mimeType:p()}),An=S({_meta:m(p(),g()).nullish(),annotations:j.nullish(),data:p(),mimeType:p(),uri:p().nullish()}),jn=S({_meta:m(p(),g()).nullish(),annotations:j.nullish(),description:p().nullish(),mimeType:p().nullish(),name:p(),size:f().nullish(),title:p().nullish(),uri:p()}),Mn=S({_meta:m(p(),g()).nullish(),optionId:an}),Nn=_([S({outcome:x(`cancelled`)}),Mn.and(S({outcome:x(`selected`)}))]),Pn=S({_meta:m(p(),g()).nullish(),outcome:Nn}),Fn=S({_meta:m(p(),g()).nullish()}),In=S({_meta:m(p(),g()).nullish()}),Ln=S({currentValue:y()}),Rn=p(),zn=p(),Bn=_([x(`mode`),x(`model`),x(`thought_level`),p()]),Vn=p(),Hn=S({_meta:m(p(),g()).nullish(),description:p().nullish(),name:p(),value:Vn}),Un=S({_meta:m(p(),g()).nullish(),group:Rn,name:p(),options:h(Hn)}),M=b(_([S({currentValue:Vn,options:_([h(Hn),h(Un)])}).and(S({type:x(`select`)})),Ln.and(S({type:x(`boolean`)}))]),S({_meta:m(p(),g()).nullish(),category:Bn.nullish(),description:p().nullish(),id:zn,name:p()})),Wn=S({_meta:m(p(),g()).nullish(),configOptions:h(M)}),Gn=S({_meta:m(p(),g()).nullish()}),N=p(),Kn=S({_meta:m(p(),g()).nullish(),id:p(),sessionId:N}),qn=S({_meta:m(p(),g()).nullish(),sessionId:N}),Jn=S({_meta:m(p(),g()).nullish(),sessionId:N}),Yn=S({_meta:m(p(),g()).nullish(),sessionId:N}),Xn=S({_meta:m(p(),g()).nullish(),args:h(p()).optional(),command:p(),cwd:p().nullish(),env:h(dt).optional(),outputByteLimit:f().nullish(),sessionId:N}),Zn=S({_meta:m(p(),g()).nullish(),sessionId:N,uri:p()}),Qn=S({_meta:m(p(),g()).nullish(),position:O,sessionId:N,uri:p(),version:f(),visibleRange:k}),$n=S({_meta:m(p(),g()).nullish(),languageId:p(),sessionId:N,text:p(),uri:p(),version:f()}),er=S({_meta:m(p(),g()).nullish(),sessionId:N,uri:p()}),tr=S({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cwd:p(),mcpServers:h(D).optional(),sessionId:N}),nr=S({_meta:m(p(),g()).nullish(),sessionId:N,terminalId:p()}),rr=S({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cwd:p(),mcpServers:h(D),sessionId:N}),ir=S({_meta:m(p(),g()).nullish(),limit:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),line:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),path:p(),sessionId:N}),ar=S({_meta:m(p(),g()).nullish(),id:p(),reason:Gt.nullish(),sessionId:N}),or=S({_meta:m(p(),g()).nullish(),sessionId:N,terminalId:p()}),sr=S({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cwd:p(),mcpServers:h(D).optional(),sessionId:N}),cr=S({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cwd:p(),sessionId:N,title:p().nullish(),updatedAt:p().nullish()}),lr=S({_meta:m(p(),g()).nullish(),nextCursor:p().nullish(),sessions:h(cr)}),ur=S({_meta:m(p(),g()).nullish(),title:p().nullish(),updatedAt:p().nullish()}),dr=S({_meta:m(p(),g()).nullish()}),P=p(),fr=S({_meta:m(p(),g()).nullish(),currentModeId:P}),pr=S({_meta:m(p(),g()).nullish(),description:p().nullish(),id:P,name:p()}),F=S({_meta:m(p(),g()).nullish(),availableModes:h(pr),currentModeId:P}),I=S({_meta:m(p(),g()).nullish(),availableModels:h(jt),currentModelId:At}),mr=S({_meta:m(p(),g()).nullish(),configOptions:h(M).nullish(),models:I.nullish(),modes:F.nullish(),sessionId:N}),hr=S({_meta:m(p(),g()).nullish(),configOptions:h(M).nullish(),models:I.nullish(),modes:F.nullish()}),gr=S({_meta:m(p(),g()).nullish(),configOptions:h(M).nullish(),models:I.nullish(),modes:F.nullish(),sessionId:N}),_r=S({_meta:m(p(),g()).nullish(),configOptions:h(M).nullish(),models:I.nullish(),modes:F.nullish()}),vr=S({_meta:m(p(),g()).nullish()}),yr=S({_meta:m(p(),g()).nullish(),additionalDirectories:Fn.nullish(),close:In.nullish(),fork:Gn.nullish(),list:dr.nullish(),resume:vr.nullish()}),br=b(_([S({type:x(`boolean`),value:y()}),S({value:Vn})]),S({_meta:m(p(),g()).nullish(),configId:zn,sessionId:N})),xr=S({_meta:m(p(),g()).nullish(),configOptions:h(M)}),Sr=S({_meta:m(p(),g()).nullish(),modeId:P,sessionId:N}),Cr=S({_meta:m(p(),g()).nullish()}),wr=S({_meta:m(p(),g()).nullish(),modelId:At,sessionId:N}),Tr=S({_meta:m(p(),g()).nullish()}),Er=S({_meta:m(p(),g()).nullish(),sessionId:N}),Dr=_([x(`end_turn`),x(`max_tokens`),x(`max_turn_requests`),x(`refusal`),x(`cancelled`)]),Or=_([x(`email`),x(`uri`),x(`date`),x(`date-time`)]),kr=S({default:p().nullish(),description:p().nullish(),enum:h(p()).nullish(),format:Or.nullish(),maxLength:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),minLength:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),oneOf:h(ut).nullish(),pattern:p().nullish(),title:p().nullish()}),Ar=S({_meta:m(p(),g()).nullish(),context:Sn.nullish(),position:O,selection:k.nullish(),sessionId:N,triggerKind:$t,uri:p(),version:f()}),jr=S({_meta:m(p(),g()).nullish(),suggestions:h(wn)}),Mr=S({_meta:m(p(),g()).nullish(),terminalId:p()}),Nr=S({_meta:m(p(),g()).nullish(),exitCode:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),signal:p().nullish()}),Pr=S({_meta:m(p(),g()).nullish(),sessionId:N,terminalId:p()}),Fr=S({_meta:m(p(),g()).nullish(),exitStatus:Nr.nullish(),output:p(),truncated:y()}),Ir=S({_meta:m(p(),g()).nullish(),annotations:j.nullish(),text:p()}),Lr=S({range:k.nullish(),text:p()}),Rr=S({_meta:m(p(),g()).nullish(),contentChanges:h(Lr),sessionId:N,uri:p(),version:f()});S({method:p(),params:_([qn,$n,Rr,Zn,er,Qn,Kn,ar,pt]).nullish()});var zr=_([x(`full`),x(`incremental`)]),Br=S({_meta:m(p(),g()).nullish(),syncKind:zr}),Vr=S({_meta:m(p(),g()).nullish(),didChange:Br.nullish(),didClose:Pt.nullish(),didFocus:Ft.nullish(),didOpen:It.nullish(),didSave:Lt.nullish()}),Hr=S({_meta:m(p(),g()).nullish(),document:Vr.nullish()}),Ur=S({_meta:m(p(),g()).nullish(),context:tn.nullish(),events:Hr.nullish()}),Wr=S({_meta:m(p(),g()).nullish(),auth:Ct.optional().default({}),loadSession:y().optional().default(!1),mcpCapabilities:Et.optional().default({http:!1,sse:!1}),nes:Ur.nullish(),positionEncoding:hn.nullish(),promptCapabilities:_n.optional().default({audio:!1,embeddedContext:!1,image:!1}),sessionCapabilities:yr.optional().default({})}),Gr=S({_meta:m(p(),g()).nullish(),agentCapabilities:Wr.optional().default({auth:{},loadSession:!1,mcpCapabilities:{http:!1,sse:!1},promptCapabilities:{audio:!1,embeddedContext:!1,image:!1},sessionCapabilities:{}}),agentInfo:vt.nullish(),authMethods:h(Ge).optional().default([]),protocolVersion:vn}),Kr=_([S({_meta:m(p(),g()).nullish(),mimeType:p().nullish(),text:p(),uri:p()}),Je]),qr=S({_meta:m(p(),g()).nullish(),annotations:j.nullish(),resource:Kr}),L=_([Ir.and(S({type:x(`text`)})),An.and(S({type:x(`image`)})),kn.and(S({type:x(`audio`)})),jn.and(S({type:x(`resource_link`)})),qr.and(S({type:x(`resource`)}))]),Jr=S({_meta:m(p(),g()).nullish(),content:L}),R=S({_meta:m(p(),g()).nullish(),content:L,messageId:p().nullish()}),Yr=S({_meta:m(p(),g()).nullish(),messageId:p().nullish(),prompt:h(L),sessionId:N}),Xr=S({anyOf:h(ut)}),Zr=_([Jr.and(S({type:x(`content`)})),et.and(S({type:x(`diff`)})),Mr.and(S({type:x(`terminal`)}))]),z=p(),Qr=S({sessionId:N,toolCallId:z.nullish()}),$r=b(_([Qr,Dn]),S({elicitationId:it,url:p().url()})),ei=S({_meta:m(p(),g()).nullish(),line:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),path:p()}),ti=_([x(`pending`),x(`in_progress`),x(`completed`),x(`failed`)]),ni=_([x(`read`),x(`edit`),x(`delete`),x(`move`),x(`search`),x(`execute`),x(`think`),x(`fetch`),x(`switch_mode`),x(`other`)]),ri=S({_meta:m(p(),g()).nullish(),content:h(Zr).optional(),kind:ni.optional(),locations:h(ei).optional(),rawInput:g().optional(),rawOutput:g().optional(),status:ti.optional(),title:p(),toolCallId:z}),ii=S({_meta:m(p(),g()).nullish(),content:h(Zr).nullish(),kind:ni.nullish(),locations:h(ei).nullish(),rawInput:g().optional(),rawOutput:g().optional(),status:ti.nullish(),title:p().nullish(),toolCallId:z}),ai=S({_meta:m(p(),g()).nullish(),options:h(sn),sessionId:N,toolCall:ii}),oi=S({_meta:m(p(),g()).nullish(),hint:p()}),si=S({_meta:m(p(),g()).nullish(),description:p(),input:oi.nullish(),name:p()}),ci=S({_meta:m(p(),g()).nullish(),availableCommands:h(si)}),li=_([S({enum:h(p()),type:st}),Xr]),ui=S({default:h(p()).nullish(),description:p().nullish(),items:li,maxItems:f().nullish(),minItems:f().nullish(),title:p().nullish()}),di=_([kr.and(S({type:x(`string`)})),rn.and(S({type:x(`number`)})),yt.and(S({type:x(`integer`)})),Ye.and(S({type:x(`boolean`)})),ui.and(S({type:x(`array`)}))]),fi=S({description:p().nullish(),properties:m(p(),di).optional().default({}),required:h(p()).nullish(),title:p().nullish(),type:ot.optional().default(`object`)}),pi=b(_([b(_([Qr,Dn]),S({requestedSchema:fi})).and(S({mode:x(`form`)})),$r.and(S({mode:x(`url`)}))]),S({_meta:m(p(),g()).nullish(),message:p()})),mi=S({cachedReadTokens:f().nullish(),cachedWriteTokens:f().nullish(),inputTokens:f(),outputTokens:f(),thoughtTokens:f().nullish(),totalTokens:f()});_([S({id:A,result:_([Gr,qe,Tt,gr,hr,lr,mr,_r,Ze,Cr,xr,S({_meta:m(p(),g()).nullish(),stopReason:Dr,usage:mi.nullish(),userMessageId:p().nullish()}),Tr,Er,jr,Xe,ht])}),S({error:ft,id:A})]);var hi=S({_meta:m(p(),g()).nullish(),cost:Qe.nullish(),size:f(),used:f()}),gi=_([R.and(S({sessionUpdate:x(`user_message_chunk`)})),R.and(S({sessionUpdate:x(`agent_message_chunk`)})),R.and(S({sessionUpdate:x(`agent_thought_chunk`)})),ri.and(S({sessionUpdate:x(`tool_call`)})),ii.and(S({sessionUpdate:x(`tool_call_update`)})),dn.and(S({sessionUpdate:x(`plan`)})),ci.and(S({sessionUpdate:x(`available_commands_update`)})),fr.and(S({sessionUpdate:x(`current_mode_update`)})),Wn.and(S({sessionUpdate:x(`config_option_update`)})),ur.and(S({sessionUpdate:x(`session_info_update`)})),hi.and(S({sessionUpdate:x(`usage_update`)}))]),_i=S({_meta:m(p(),g()).nullish(),sessionId:N,update:gi});S({method:p(),params:_([_i,at,pt]).nullish()});var vi=S({_meta:m(p(),g()).nullish(),sessionId:N,terminalId:p()}),yi=S({_meta:m(p(),g()).nullish(),exitCode:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),signal:p().nullish()}),bi=S({name:p(),uri:p()}),xi=S({_meta:m(p(),g()).nullish(),repository:Yt.nullish(),workspaceFolders:h(bi).nullish(),workspaceUri:p().nullish()});S({id:A,method:p(),params:_([yn,Ke,wt,nn,rr,xt,tr,sr,Yn,Sr,br,Yr,wr,xi,Ar,Jn,mt]).nullish()});var Si=S({_meta:m(p(),g()).nullish(),content:p(),path:p(),sessionId:N});S({id:A,method:p(),params:_([Si,ir,ai,Xn,Pr,or,vi,nr,pi,mt]).nullish()}),_([S({id:A,result:_([S({_meta:m(p(),g()).nullish()}),Tn,Pn,$e,Fr,En,yi,bt,nt,ht])}),S({error:ft,id:A})]),e(),d(),r(),s(),i(),o();function Ci(e,t){let n=new TextEncoder,r=new TextDecoder;return{readable:new ReadableStream({async start(e){let n=``,i=t.getReader();try{for(;;){let{value:t,done:a}=await i.read();if(a)break;if(!t)continue;n+=r.decode(t,{stream:!0});let o=n.split(`
2
- `);n=o.pop()||``;for(let t of o){let n=t.trim();if(n)try{let t=JSON.parse(n);e.enqueue(t)}catch(e){console.error(`Failed to parse JSON message:`,n,e)}}}}catch(t){e.error(t);return}finally{i.releaseLock()}e.close()}}),writable:new WritableStream({async write(t){let r=JSON.stringify(t)+`
3
- `,i=e.getWriter();try{await i.write(n.encode(r))}finally{i.releaseLock()}}})}}te();var wi,B=new WeakMap,Ti=class{constructor(e,t){l(this,B,void 0);let n=e(this);u(B,this,new ki(async(e,t)=>{switch(e){case T.initialize:{let e=yn.parse(t);return n.initialize(e)}case T.session_new:{let e=nn.parse(t);return n.newSession(e)}case T.session_load:{if(!n.loadSession)throw Z.methodNotFound(e);let r=rr.parse(t);return n.loadSession(r)}case T.session_list:{if(!n.listSessions)throw Z.methodNotFound(e);let r=xt.parse(t);return n.listSessions(r)}case T.session_fork:{if(!n.unstable_forkSession)throw Z.methodNotFound(e);let r=tr.parse(t);return n.unstable_forkSession(r)}case T.session_resume:{if(!n.unstable_resumeSession)throw Z.methodNotFound(e);let r=sr.parse(t);return n.unstable_resumeSession(r)}case T.session_close:{if(!n.unstable_closeSession)throw Z.methodNotFound(e);let r=Yn.parse(t);return n.unstable_closeSession(r)}case T.session_set_mode:{if(!n.setSessionMode)throw Z.methodNotFound(e);let r=Sr.parse(t);return await n.setSessionMode(r)??{}}case T.authenticate:{let e=Ke.parse(t);return await n.authenticate(e)??{}}case T.logout:{if(!n.unstable_logout)throw Z.methodNotFound(e);let r=wt.parse(t);return await n.unstable_logout(r)??{}}case T.session_prompt:{let e=Yr.parse(t);return n.prompt(e)}case T.session_set_model:{if(!n.unstable_setSessionModel)throw Z.methodNotFound(e);let r=wr.parse(t);return await n.unstable_setSessionModel(r)??{}}case T.session_set_config_option:{if(!n.setSessionConfigOption)throw Z.methodNotFound(e);let r=br.parse(t);return n.setSessionConfigOption(r)}case T.nes_start:{if(!n.unstable_startNes)throw Z.methodNotFound(e);let r=xi.parse(t);return n.unstable_startNes(r)}case T.nes_suggest:{if(!n.unstable_suggestNes)throw Z.methodNotFound(e);let r=Ar.parse(t);return n.unstable_suggestNes(r)}case T.nes_close:{if(!n.unstable_closeNes)throw Z.methodNotFound(e);let r=Jn.parse(t);return await n.unstable_closeNes(r)??{}}default:if(n.extMethod)return n.extMethod(e,t);throw Z.methodNotFound(e)}},async(e,t)=>{switch(e){case T.session_cancel:{let e=qn.parse(t);return n.cancel(e)}case T.document_did_open:{if(!n.unstable_didOpenDocument)return;let e=$n.parse(t);return n.unstable_didOpenDocument(e)}case T.document_did_change:{if(!n.unstable_didChangeDocument)return;let e=Rr.parse(t);return n.unstable_didChangeDocument(e)}case T.document_did_close:{if(!n.unstable_didCloseDocument)return;let e=Zn.parse(t);return n.unstable_didCloseDocument(e)}case T.document_did_save:{if(!n.unstable_didSaveDocument)return;let e=er.parse(t);return n.unstable_didSaveDocument(e)}case T.document_did_focus:{if(!n.unstable_didFocusDocument)return;let e=Qn.parse(t);return n.unstable_didFocusDocument(e)}case T.nes_accept:{if(!n.unstable_acceptNes)return;let e=Kn.parse(t);return n.unstable_acceptNes(e)}case T.nes_reject:{if(!n.unstable_rejectNes)return;let e=ar.parse(t);return n.unstable_rejectNes(e)}default:if(n.extNotification)return n.extNotification(e,t);throw Z.methodNotFound(e)}},t))}async sessionUpdate(e){return await c(B,this).sendNotification(E.session_update,e)}async requestPermission(e){return await c(B,this).sendRequest(E.session_request_permission,e)}async readTextFile(e){return await c(B,this).sendRequest(E.fs_read_text_file,e)}async writeTextFile(e){return await c(B,this).sendRequest(E.fs_write_text_file,e)??{}}async createTerminal(e){return new Ei((await c(B,this).sendRequest(E.terminal_create,e)).terminalId,e.sessionId,c(B,this))}async unstable_createElicitation(e){return await c(B,this).sendRequest(E.elicitation_create,e)}async unstable_completeElicitation(e){return await c(B,this).sendNotification(E.elicitation_complete,e)}async extMethod(e,t){return await c(B,this).sendRequest(e,t)}async extNotification(e,t){return await c(B,this).sendNotification(e,t)}get signal(){return c(B,this).signal}get closed(){return c(B,this).closed}},V=new WeakMap,H=new WeakMap;wi=Symbol.asyncDispose;var Ei=class{constructor(e,n,r){t(this,`id`,void 0),l(this,V,void 0),l(this,H,void 0),this.id=e,u(V,this,n),u(H,this,r)}async currentOutput(){return await c(H,this).sendRequest(E.terminal_output,{sessionId:c(V,this),terminalId:this.id})}async waitForExit(){return await c(H,this).sendRequest(E.terminal_wait_for_exit,{sessionId:c(V,this),terminalId:this.id})}async kill(){return await c(H,this).sendRequest(E.terminal_kill,{sessionId:c(V,this),terminalId:this.id})??{}}async release(){return await c(H,this).sendRequest(E.terminal_release,{sessionId:c(V,this),terminalId:this.id})??{}}async[wi](){await this.release()}},U=new WeakMap,Di=new WeakMap,Oi=new WeakMap,W=new WeakMap,G=new WeakMap,K=new WeakMap,q=new WeakMap,J=new WeakMap,Y=new WeakSet,ki=class{constructor(e,t,r){a(this,Y),l(this,U,new Map),l(this,Di,0),l(this,Oi,void 0),l(this,W,void 0),l(this,G,void 0),l(this,K,Promise.resolve()),l(this,q,new AbortController),l(this,J,void 0),u(Oi,this,e),u(W,this,t),u(G,this,r),u(J,this,new Promise(e=>{c(q,this).signal.addEventListener(`abort`,()=>e())})),n(Y,this,Ai).call(this)}get signal(){return c(q,this).signal}get closed(){return c(J,this)}async sendRequest(e,t){var r,i;n(Y,this,Ii).call(this);let a=(u(Di,this,(r=c(Di,this),i=r++,r)),i),o=new Promise((e,t)=>{c(U,this).set(a,{resolve:e,reject:t})});return await n(Y,this,X).call(this,{jsonrpc:`2.0`,id:a,method:e,params:t}),o}async sendNotification(e,t){n(Y,this,Ii).call(this),await n(Y,this,X).call(this,{jsonrpc:`2.0`,method:e,params:t})}};async function Ai(){let e;try{let e=c(G,this).readable.getReader();try{for(;!c(q,this).signal.aborted;){let{value:t,done:r}=await e.read();if(r)break;if(t)try{n(Y,this,Mi).call(this,t)}catch(e){console.error(`Unexpected error during message processing:`,t,e),`id`in t&&t.id!==void 0&&n(Y,this,X).call(this,{jsonrpc:`2.0`,id:t.id,error:{code:-32700,message:`Parse error`}})}}}finally{e.releaseLock()}}catch(t){e=t}finally{n(Y,this,ji).call(this,e)}}function ji(e){if(c(q,this).signal.aborted)return;let t=e??Error(`ACP connection closed`);for(let e of c(U,this).values())e.reject(t);c(U,this).clear(),c(q,this).abort(t)}async function Mi(e){if(`method`in e&&`id`in e){let t=await n(Y,this,Ni).call(this,e.method,e.params);`error`in t&&console.error(`Error handling request`,e,t.error),await n(Y,this,X).call(this,{jsonrpc:`2.0`,id:e.id,...t})}else if(`method`in e){let t=await n(Y,this,Pi).call(this,e.method,e.params);`error`in t&&console.error(`Error handling notification`,e,t.error)}else `id`in e?n(Y,this,Fi).call(this,e):console.error(`Invalid message`,{message:e})}async function Ni(e,t){try{return{result:await c(Oi,this).call(this,e,t)??null}}catch(e){if(e instanceof Z)return e.toResult();if(e instanceof v)return Z.invalidParams(e.format()).toResult();let t;(e instanceof Error||typeof e==`object`&&e&&`message`in e&&typeof e.message==`string`)&&(t=e.message);try{return Z.internalError(t?JSON.parse(t):{}).toResult()}catch{return Z.internalError({details:t}).toResult()}}}async function Pi(e,t){try{return await c(W,this).call(this,e,t),{result:null}}catch(e){if(e instanceof Z)return e.toResult();if(e instanceof v)return Z.invalidParams(e.format()).toResult();let t;(e instanceof Error||typeof e==`object`&&e&&`message`in e&&typeof e.message==`string`)&&(t=e.message);try{return Z.internalError(t?JSON.parse(t):{}).toResult()}catch{return Z.internalError({details:t}).toResult()}}}function Fi(e){let t=c(U,this).get(e.id);if(t){if(`result`in e)t.resolve(e.result);else if(`error`in e){let{code:n,message:r,data:i}=e.error;t.reject(new Z(n,r,i))}c(U,this).delete(e.id)}else console.error(`Got response to unknown request`,e.id)}function Ii(){if(c(q,this).signal.aborted)throw c(q,this).signal.reason??Error(`ACP connection closed`)}async function X(e){return u(K,this,c(K,this).then(async()=>{let t=c(G,this).writable.getWriter();try{await t.write(e)}finally{t.releaseLock()}}).catch(e=>{n(Y,this,ji).call(this,e)})),c(K,this)}var Z=class e extends Error{constructor(e,n,r){super(n),t(this,`code`,void 0),t(this,`data`,void 0),this.code=e,this.name=`RequestError`,this.data=r}static parseError(t,n){return new e(-32700,`Parse error${n?`: ${n}`:``}`,t)}static invalidRequest(t,n){return new e(-32600,`Invalid request${n?`: ${n}`:``}`,t)}static methodNotFound(t){return new e(-32601,`"Method not found": ${t}`,{method:t})}static invalidParams(t,n){return new e(-32602,`Invalid params${n?`: ${n}`:``}`,t)}static internalError(t,n){return new e(-32603,`Internal error${n?`: ${n}`:``}`,t)}static authRequired(t,n){return new e(-32e3,`Authentication required${n?`: ${n}`:``}`,t)}static resourceNotFound(t){return new e(-32002,`Resource not found${t?`: ${t}`:``}`,t&&{uri:t})}toResult(){return{error:{code:this.code,message:this.message,data:this.data}}}toErrorResponse(){return{code:this.code,message:this.message,data:this.data}}};re(),de(),ae(),ue(),Me(),Ne(),Se(),ke(),De(),xe(),pe(),ve();var Li=!(typeof process.geteuid==`function`?process.geteuid()===0:typeof process.getuid==`function`&&process.getuid()===0)||!!process.env.IS_SANDBOX,Ri={auto:`auto`,default:`default`,acceptedits:`acceptEdits`,dontask:`dontAsk`,plan:`plan`,bypasspermissions:`bypassPermissions`,bypass:`bypassPermissions`};function zi(e,t=`permissions.defaultMode`){if(e===void 0)return`default`;if(typeof e!=`string`)throw Error(`Invalid ${t}: expected a string.`);let n=e.trim().toLowerCase();if(n===``)throw Error(`Invalid ${t}: expected a non-empty string.`);let r=Ri[n];if(!r)throw Error(`Invalid ${t}: ${e}.`);if(r===`bypassPermissions`&&!Li)throw Error(`Invalid ${t}: bypassPermissions is not available when running as root.`);return r}function Bi(e){let t=[...e.mcpServers??[]].sort((e,t)=>e.name.localeCompare(t.name));return JSON.stringify({cwd:e.cwd,mcpServers:t})}var Vi=256;function Hi(e){let t=e.replace(/[\r\n]+/g,` `).replace(/\s+/g,` `).trim();return t.length<=Vi?t:t.slice(0,Vi-1)+`…`}function Ui(e,t){if(!t)return e;let n=w.resolve(t),r=w.resolve(e);return r.startsWith(n+w.sep)||r===n?w.relative(n,r).replaceAll(`\\`,`/`):e}function Wi(e){let t="```";for(let n of e.matchAll(/^```+/gm)??[])for(;n[0].length>=t.length;)t+="`";return t+`
4
- `+e+(e.endsWith(`
5
- `)?``:`
6
- `)+t}function Q(e,t=!1,n){let r=e.name,i=e.input;switch(r){case`Agent`:case`Task`:{let e=i?.description??`Task`,t=i?.prompt;return{title:e,kind:`think`,content:t?[{type:`content`,content:{type:`text`,text:t}}]:[]}}case`Bash`:{let n=i?.command??`Terminal`,r=i?.description;return{title:n,kind:`execute`,content:t?[{type:`terminal`,terminalId:e.id}]:r?[{type:`content`,content:{type:`text`,text:r}}]:[]}}case`Read`:{let e=i?.file_path??`File`,t=i?.offset,r=i?.limit,a=``;return r&&r>0?a=` (${t??1} - ${(t??1)+r-1})`:t&&(a=` (from line ${t})`),{title:`Read ${e?Ui(e,n):`File`}${a}`,kind:`read`,locations:e?[{path:e,line:t??1}]:[],content:[]}}case`Write`:{let e=i?.file_path??``,t=i?.content??``,r=e?Ui(e,n):void 0;return{title:r?`Write ${r}`:`Write`,kind:`edit`,content:e?[{type:`diff`,path:e,oldText:null,newText:t}]:[{type:`content`,content:{type:`text`,text:t}}],locations:e?[{path:e}]:[]}}case`Edit`:{let e=i?.file_path??``,t=i?.old_string??``,r=i?.new_string??``,a=e?Ui(e,n):void 0;return{title:a?`Edit ${a}`:`Edit`,kind:`edit`,content:e?[{type:`diff`,path:e,oldText:t||null,newText:r}]:[],locations:e?[{path:e}]:[]}}case`Glob`:{let e=i?.path??``,t=i?.pattern??``,n=`Find`;return e&&(n+=` \`${e}\``),t&&(n+=` \`${t}\``),{title:n,kind:`search`,content:[],locations:e?[{path:e}]:[]}}case`Grep`:{let e=i?.pattern??``,t=i?.path??``,n=`grep`;return i?.[`-i`]&&(n+=` -i`),i?.[`-n`]&&(n+=` -n`),i?.[`-A`]!==void 0&&(n+=` -A ${i[`-A`]}`),i?.[`-B`]!==void 0&&(n+=` -B ${i[`-B`]}`),i?.[`-C`]!==void 0&&(n+=` -C ${i[`-C`]}`),i?.output_mode===`files_with_matches`?n+=` -l`:i?.output_mode===`count`&&(n+=` -c`),i?.head_limit!==void 0&&(n+=` | head -${i.head_limit}`),i?.glob&&(n+=` --include="${i.glob}"`),i?.type&&(n+=` --type=${i.type}`),i?.multiline&&(n+=` -P`),e&&(n+=` "${e}"`),t&&(n+=` ${t}`),{title:n,kind:`search`,content:[]}}case`WebFetch`:{let e=i?.url??``,t=i?.prompt;return{title:e?`Fetch ${e}`:`Fetch`,kind:`fetch`,content:t?[{type:`content`,content:{type:`text`,text:t}}]:[]}}case`WebSearch`:{let e=`"${i?.query??`Web search`}"`,t=i?.allowed_domains,n=i?.blocked_domains;return t&&t.length>0&&(e+=` (allowed: ${t.join(`, `)})`),n&&n.length>0&&(e+=` (blocked: ${n.join(`, `)})`),{title:e,kind:`fetch`,content:[]}}case`TodoWrite`:{let e=i?.todos;return{title:Array.isArray(e)?`Update TODOs: ${e.map(e=>e.content).join(`, `)}`:`Update TODOs`,kind:`think`,content:[]}}case`ExitPlanMode`:{let e=i?.plan;return{title:`Ready to code?`,kind:`switch_mode`,content:e?[{type:`content`,content:{type:`text`,text:e}}]:[]}}default:return{title:r||`Unknown Tool`,kind:`other`,content:[]}}}function Gi(e,t,n=!1){if(!t)return{};let r=e.is_error===!0,i=e.content;if(r&&i)return Ki(i,!0);switch(t.name){case`Read`:return typeof i==`string`&&i.length>0?{content:[{type:`content`,content:{type:`text`,text:Wi(i)}}]}:Array.isArray(i)&&i.length>0?{content:i.map(e=>({type:`content`,content:e.type===`text`?{type:`text`,text:Wi(e.text)}:qi(e,!1)}))}:{};case`Bash`:{let e=``,a=+!!r,o=String(t.id);if(i&&typeof i==`object`&&!Array.isArray(i)&&i.type===`bash_code_execution_result`){let t=i;e=[t.stdout,t.stderr].filter(Boolean).join(`
7
- `),a=t.return_code??+!!r}else typeof i==`string`?e=i:Array.isArray(i)&&i.length>0&&(e=i.map(e=>e.type===`text`?e.text:``).join(`
8
- `));return n?{content:[{type:`terminal`,terminalId:o}],_meta:{terminal_info:{terminal_id:o},terminal_output:{terminal_id:o,data:e},terminal_exit:{terminal_id:o,exit_code:a,signal:null}}}:e.trim()?{content:[{type:`content`,content:{type:`text`,text:`\`\`\`console\n${e.trimEnd()}\n\`\`\``}}]}:{}}case`Edit`:case`Write`:return{};case`ExitPlanMode`:return{title:`Exited Plan Mode`};default:return Ki(i??``,r)}}function Ki(e,t){return Array.isArray(e)&&e.length>0?{content:e.map(e=>({type:`content`,content:qi(e,t)}))}:typeof e==`string`&&e.length>0?{content:[{type:`content`,content:{type:`text`,text:t?`\`\`\`\n${e}\n\`\`\``:e}}]}:{}}function qi(e,t){let n=e=>({type:`text`,text:t?`\`\`\`\n${e}\n\`\`\``:e});switch(e.type){case`text`:{let n=e.text;return{type:`text`,text:t?`\`\`\`\n${n}\n\`\`\``:n}}case`image`:{let t=e.source;return t?.type===`base64`?{type:`image`,data:t.data,mimeType:t.media_type}:n(t?.type===`url`?`[image: ${t.url}]`:`[image: file reference]`)}case`tool_reference`:return n(`Tool: ${e.tool_name}`);case`tool_search_tool_search_result`:{let t=e.tool_references;return n(`Tools found: ${t?.map(e=>e.tool_name).join(`, `)||`none`}`)}case`tool_search_tool_result_error`:return n(`Error: ${e.error_code}${e.error_message?` - ${e.error_message}`:``}`);case`web_search_result`:return n(`${e.title} (${e.url})`);case`web_search_tool_result_error`:return n(`Error: ${e.error_code}`);case`web_fetch_result`:return n(`Fetched: ${e.url}`);case`web_fetch_tool_result_error`:return n(`Error: ${e.error_code}`);case`code_execution_result`:case`bash_code_execution_result`:return n(`Output: ${e.stdout||e.stderr||``}`);case`code_execution_tool_result_error`:case`bash_code_execution_tool_result_error`:return n(`Error: ${e.error_code}`);case`text_editor_code_execution_view_result`:return n(e.content);case`text_editor_code_execution_create_result`:return n(e.is_file_update?`File updated`:`File created`);case`text_editor_code_execution_str_replace_result`:{let t=e.lines;return n(t?.join(`
9
- `)||``)}case`text_editor_code_execution_tool_result_error`:return n(`Error: ${e.error_code}${e.error_message?` - ${e.error_message}`:``}`);default:try{return{type:`text`,text:JSON.stringify(e)}}catch{return{type:`text`,text:`[content]`}}}}function Ji(e,t){if(t.aborted)return Promise.resolve({done:!0,value:void 0});let n,r=new Promise(e=>{n=()=>e({done:!0,value:void 0}),t.addEventListener(`abort`,n,{once:!0})});return Promise.race([e.next(),r]).finally(()=>{n&&t.removeEventListener(`abort`,n)})}async function Yi(e,t,n,r,i,a,o,s){let c=`end_turn`,l={inputTokens:0,outputTokens:0,cachedReadTokens:0,cachedWriteTokens:0},u=null,d=null,f=2e5;try{for(;!r.aborted;){let s=await Ji(t,r);if(s.done||r.aborted)break;let p=s.value;if(p!=null)switch(p.type){case`system`:p.subtype===`compact_boundary`&&(u=0,await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`usage_update`,used:0,size:f}}),await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`agent_message_chunk`,content:{type:`text`,text:`
10
-
11
- Compacting completed.`}}}));break;case`result`:{let t=p.usage;t&&(l.inputTokens+=t.input_tokens,l.outputTokens+=t.output_tokens,l.cachedReadTokens+=t.cache_read_input_tokens,l.cachedWriteTokens+=t.cache_creation_input_tokens);let i=p.modelUsage;if(i&&d){let e=ta(i,d);e?.contextWindow&&(f=e.contextWindow)}let a=u??l.inputTokens+l.outputTokens+l.cachedReadTokens+l.cachedWriteTokens,o=p.total_cost_usd;await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`usage_update`,used:a,size:f,cost:o==null?void 0:{amount:o,currency:`USD`}}});let s=p.subtype,m=p.is_error;if(r.aborted){c=`cancelled`;break}switch(s){case`success`:p.stop_reason===`max_tokens`&&(c=`max_tokens`),m&&(c=`end_turn`);break;case`error_during_execution`:c=p.stop_reason===`max_tokens`?`max_tokens`:`end_turn`;break;case`error_max_budget_usd`:case`error_max_turns`:case`error_max_structured_output_retries`:c=`max_turn_requests`;break}break}case`stream_event`:{let t=Zi(p,e,i,n,{clientCapabilities:a,cwd:o});for(let e of t)await n.sessionUpdate(e);break}case`assistant`:{let t=p.message,r=p.parent_tool_use_id;if(t?.usage&&r===null){let e=t.usage;u=(e.input_tokens??0)+(e.output_tokens??0)+(e.cache_read_input_tokens??0)+(e.cache_creation_input_tokens??0)}r===null&&t?.model&&t.model!==`<synthetic>`&&(d=t.model);let s=Xi(p,e,i,n,{clientCapabilities:a,cwd:o});for(let e of s)await n.sessionUpdate(e);break}case`user`:break;case`progress`:{let t=p.data;if(!t)break;let r=t.type;if(r===`agent_progress`||r===`skill_progress`){let r=t.message;if(r){let t=r.content;if(t)for(let r of t)r.type===`text`&&await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`agent_message_chunk`,content:{type:`text`,text:r.text}}})}}break}case`tool_use_summary`:break;case`attachment`:break;case`compact_boundary`:u=0,await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`usage_update`,used:0,size:f}}),await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`agent_message_chunk`,content:{type:`text`,text:`
12
-
13
- Compacting completed.`}}});break;default:break}}if(r.aborted||s?.())return{stopReason:`cancelled`,usage:l}}catch(e){if(r.aborted)return{stopReason:`cancelled`,usage:l};throw e}return{stopReason:c,usage:l}}function Xi(e,t,n,r,i){let a=e.message;if(!a)return[];let o=a.content;return o?typeof o==`string`?[{sessionId:t,update:{sessionUpdate:`agent_message_chunk`,content:{type:`text`,text:o}}}]:$(o,`assistant`,t,n,r,void 0,i):[]}function Zi(e,t,n,r,i){let a=e.event;if(!a)return[];switch(a.type){case`content_block_start`:{let o=a.content_block;return o?$([o],`assistant`,t,n,r,void 0,{clientCapabilities:i?.clientCapabilities,parentToolUseId:e.parent_tool_use_id,cwd:i?.cwd}):[]}case`content_block_delta`:{let o=a.delta;return o?$([o],`assistant`,t,n,r,void 0,{clientCapabilities:i?.clientCapabilities,parentToolUseId:e.parent_tool_use_id,cwd:i?.cwd}):[]}case`message_start`:case`message_delta`:case`message_stop`:case`content_block_stop`:return[];default:return[]}}function $(e,t,n,r,i,a,o){let s=[];for(let i of e){let e=i.type,a=null;switch(e){case`text`:case`text_delta`:{let e=i.text??``;a={sessionUpdate:t===`assistant`?`agent_message_chunk`:`user_message_chunk`,content:{type:`text`,text:e}};break}case`thinking`:case`thinking_delta`:a={sessionUpdate:`agent_thought_chunk`,content:{type:`text`,text:i.thinking??``}};break;case`image`:{let e=i.source;e?.type===`base64`&&(a={sessionUpdate:t===`assistant`?`agent_message_chunk`:`user_message_chunk`,content:{type:`image`,data:e.data,mimeType:e.media_type}});break}case`tool_use`:case`server_tool_use`:case`mcp_tool_use`:{let t=i.id??``,n=i.name??`unknown`,s=i.input,c=t in r;if(r[t]={type:e,id:t,name:n,input:s},n===`TodoWrite`){let e=s?.todos;Array.isArray(e)&&(a={sessionUpdate:`plan`,entries:e.map(e=>({content:e.content,status:Qi(e.status),priority:`medium`}))})}else{let e=s?{...s}:{};a=c?{_meta:{claudeCode:{toolName:n}},toolCallId:t,sessionUpdate:`tool_call_update`,rawInput:e,...Q({name:n,id:t,input:s??{}},!1,o?.cwd)}:{_meta:{claudeCode:{toolName:n}},toolCallId:t,sessionUpdate:`tool_call`,rawInput:e,status:`pending`,...Q({name:n,id:t,input:s??{}},!1,o?.cwd)}}break}case`tool_result`:case`mcp_tool_result`:{let e=i.tool_use_id??``,t=r[e];if(!t)break;if(t.name!==`TodoWrite`){let n=Gi(i,{name:t.name,id:t.id},!1);a={_meta:{claudeCode:{toolName:t.name}},toolCallId:e,sessionUpdate:`tool_call_update`,status:i.is_error===!0?`failed`:`completed`,rawOutput:i.content,...n}}break}case`redacted_thinking`:case`input_json_delta`:case`citations_delta`:case`signature_delta`:case`container_upload`:case`compaction`:case`compaction_delta`:break}if(a){if(o?.parentToolUseId){let e=a._meta;a._meta={...e,claudeCode:{...e?.claudeCode??{},parentToolUseId:o.parentToolUseId}}}s.push({sessionId:n,update:a})}}return s}function Qi(e){return e===`in_progress`?`in_progress`:e===`completed`?`completed`:`pending`}async function $i(e,t,n,r,i,a){for(let o of t){let t=o.type;if(t!==`user`&&t!==`assistant`||o.isMeta===!0)continue;let s=o.message?.content;if(!s)continue;let c=t===`assistant`?`assistant`:`user`;if(typeof s==`string`){if(!s.trim())continue;await n.sessionUpdate({sessionId:e,update:{sessionUpdate:c===`assistant`?`agent_message_chunk`:`user_message_chunk`,content:{type:`text`,text:s}}});continue}if(Array.isArray(s)){let t=$(s,c,e,r,n,void 0,{clientCapabilities:i,cwd:a});for(let e of t)await n.sessionUpdate(e)}}}function ea(e,t){let n=0,r=Math.min(e.length,t.length);for(;n<r&&e[n]===t[n];)n++;return n}function ta(e,t){let n=null,r=0;for(let i of Object.keys(e)){let e=ea(i,t);e>r&&(r=e,n=i)}return n?e[n]??null:null}function na(e,t,n,r,i,a,o){return async(n,s,c,l,u,d)=>{let f=ia(r);if(n.name===`ExitPlanMode`)return ra(e,t,u,s,f,i,a,o);if(d!==void 0)return d;try{let e=await he(n,s,c,l,u);if(e.behavior===`allow`||e.behavior===`deny`)return e}catch(e){return console.error(`[ACP Permissions] Pipeline error:`,e),{behavior:`deny`,message:`Permission pipeline failed`,decisionReason:{type:`other`,reason:`Permission pipeline failed`},toolUseID:u}}let p=Q({name:n.name,id:u,input:s},f,i),m={toolCallId:u,title:p.title,kind:p.kind,status:`pending`,rawInput:s},h=[{kind:`allow_always`,name:`Always Allow`,optionId:`allow_always`},{kind:`allow_once`,name:`Allow`,optionId:`allow`},{kind:`reject_once`,name:`Reject`,optionId:`reject`}];try{let n=await e.requestPermission({sessionId:t,toolCall:m,options:h});if(n.outcome.outcome===`cancelled`)return{behavior:`deny`,message:`Permission request cancelled by client`,decisionReason:{type:`mode`,mode:`default`}};if(n.outcome.outcome===`selected`&&`optionId`in n.outcome&&n.outcome.optionId!==void 0){let e=n.outcome.optionId;if(e===`allow`||e===`allow_always`)return{behavior:`allow`,updatedInput:s}}return{behavior:`deny`,message:`Permission denied by client`,decisionReason:{type:`mode`,mode:`default`}}}catch(e){return console.error(`[ACP Permissions] Client request error:`,e),{behavior:`deny`,message:`Permission request failed`,decisionReason:{type:`mode`,mode:`default`}}}}}async function ra(e,t,n,r,i,a,o,s){let c=[{kind:`allow_always`,name:`Yes, and use "auto" mode`,optionId:`auto`},{kind:`allow_always`,name:`Yes, and auto-accept edits`,optionId:`acceptEdits`},{kind:`allow_once`,name:`Yes, and manually approve edits`,optionId:`default`},{kind:`reject_once`,name:`No, keep planning`,optionId:`plan`}];s?.()===!0&&c.unshift({kind:`allow_always`,name:`Yes, and bypass permissions`,optionId:`bypassPermissions`});let l=Q({name:`ExitPlanMode`,id:n,input:r},i,a),u={toolCallId:n,title:l.title,kind:l.kind,status:`pending`,rawInput:r},d=await e.requestPermission({sessionId:t,toolCall:u,options:c});if(d.outcome.outcome===`cancelled`)return{behavior:`deny`,message:`Tool use aborted`,decisionReason:{type:`mode`,mode:`default`}};if(d.outcome.outcome===`selected`&&`optionId`in d.outcome&&d.outcome.optionId!==void 0){let n=d.outcome.optionId;if(c.some(e=>e.optionId===n)&&(n===`default`||n===`acceptEdits`||n===`auto`||n===`bypassPermissions`))return o?.(n),await e.sessionUpdate({sessionId:t,update:{sessionUpdate:`current_mode_update`,currentModeId:n}}),{behavior:`allow`,updatedInput:r}}return{behavior:`deny`,message:`User rejected request to exit plan mode.`,decisionReason:{type:`mode`,mode:`plan`}}}function ia(e){if(!e)return!1;let t=e._meta;return!t||typeof t!=`object`?!1:t.terminal_output===!0}function aa(e){if(!e||e.length===0)return``;let t=[];for(let n of e){let e=n;if(e.type===`text`)t.push(String(e.text??``));else if(e.type===`resource_link`){let n=typeof e.name==`string`?e.name:void 0,r=typeof e.uri==`string`?e.uri:void 0;t.push(oa(n,r))}else if(e.type===`resource`){let n=e.resource;n&&typeof n.text==`string`&&t.push(n.text)}}return t.filter(e=>e.length>0).join(`
14
- `)}function oa(e,t){let n=[];return e&&e.length>0&&n.push(`name=${e}`),t&&t.length>0&&n.push(`uri=${t}`),n.length>0?`Resource link: ${n.join(`, `)}`:`Resource link`}we(),se(),Te(),e();var sa=class{constructor(e){t(this,`conn`,void 0),t(this,`sessions`,new Map),t(this,`clientCapabilities`,void 0),this.conn=e}async initialize(e){return this.clientCapabilities=e.clientCapabilities,{protocolVersion:1,agentInfo:{name:`claude-code`,title:`Claude Code`,version:typeof globalThis.MACRO==`object`&&globalThis.MACRO!==null?String(globalThis.MACRO.VERSION??`0.0.0`):`0.0.0`},agentCapabilities:{_meta:{claudeCode:{promptQueueing:!0}},promptCapabilities:{image:!0,embeddedContext:!0},mcpCapabilities:{http:!0,sse:!0},loadSession:!0,sessionCapabilities:{fork:{},list:{},resume:{},close:{}}}}}async authenticate(e){return{}}async newSession(e){let t=await this.createSession(e);return this.scheduleAvailableCommandsUpdate(t.sessionId),t}async unstable_resumeSession(e){let t=await this.getOrCreateSession(e);return this.scheduleAvailableCommandsUpdate(t.sessionId),t}async loadSession(e){let t=await this.getOrCreateSession(e);return this.scheduleAvailableCommandsUpdate(t.sessionId),t}async listSessions(e){let t=await Ee({dir:e.cwd??void 0,limit:100}),n=[];for(let e of t)e.cwd&&n.push({sessionId:e.sessionId,cwd:e.cwd,title:Hi(e.summary??``),updatedAt:new Date(e.lastModified).toISOString()});return{sessions:n}}async unstable_forkSession(e){let t=await this.createSession({cwd:e.cwd,mcpServers:e.mcpServers??[],_meta:e._meta});return this.scheduleAvailableCommandsUpdate(t.sessionId),t}async unstable_closeSession(e){if(!this.sessions.get(e.sessionId))throw Error(`Session not found`);return await this.teardownSession(e.sessionId),{}}async prompt(e){let t=this.sessions.get(e.sessionId);if(!t)throw Error(`Session ${e.sessionId} not found`);let n=aa(e.prompt);if(!n.trim())return{stopReason:`end_turn`};let r=t.cancelGeneration;if(t.promptRunning){let e=Le();if(await new Promise(n=>{t.pendingQueue.push(e),t.pendingMessages.set(e,{resolve:n})}))return{stopReason:`cancelled`}}if(t.cancelGeneration!==r)return{stopReason:`cancelled`};t.cancelled=!1,t.promptRunning=!0;try{t.queryEngine.resetAbortController();let r=t.queryEngine.submitMessage(n),{stopReason:i,usage:a}=await Yi(e.sessionId,r,this.conn,t.queryEngine.getAbortSignal(),t.toolUseCache,this.clientCapabilities,t.cwd,()=>t.cancelled);return t.cancelled?{stopReason:`cancelled`}:{stopReason:i,usage:a?{inputTokens:a.inputTokens,outputTokens:a.outputTokens,cachedReadTokens:a.cachedReadTokens,cachedWriteTokens:a.cachedWriteTokens,totalTokens:a.inputTokens+a.outputTokens+a.cachedReadTokens+a.cachedWriteTokens}:void 0}}catch(n){if(t.cancelled)return{stopReason:`cancelled`};throw n instanceof Error&&(n.message.includes(`terminated`)||n.message.includes(`process exited`))?(this.teardownSession(e.sessionId),Error(`The Claude Agent process exited unexpectedly. Please start a new session.`)):n}finally{let e=ya(t);e?(t.promptRunning=!0,e.resolve(!1)):t.promptRunning=!1}}async cancel(e){let t=this.sessions.get(e.sessionId);if(t){t.cancelled=!0,t.cancelGeneration+=1;for(let[,e]of t.pendingMessages)e.resolve(!0);t.pendingMessages.clear(),t.pendingQueue=[],t.pendingQueueHead=0,t.queryEngine.interrupt()}}async setSessionMode(e){if(!this.sessions.get(e.sessionId))throw Error(`Session not found`);return this.applySessionMode(e.sessionId,e.modeId),await this.updateConfigOption(e.sessionId,`mode`,e.modeId),{}}async unstable_setSessionModel(e){let t=this.sessions.get(e.sessionId);if(!t)throw Error(`Session not found`);return t.queryEngine.setModel(e.modelId),await this.updateConfigOption(e.sessionId,`model`,e.modelId),{}}async setSessionConfigOption(e){let t=this.sessions.get(e.sessionId);if(!t)throw Error(`Session not found`);if(typeof e.value!=`string`)throw Error(`Invalid value for config option ${e.configId}: ${String(e.value)}`);if(!t.configOptions.find(t=>t.id===e.configId))throw Error(`Unknown config option: ${e.configId}`);let n=e.value;return e.configId===`mode`?(this.applySessionMode(e.sessionId,n),await this.conn.sessionUpdate({sessionId:e.sessionId,update:{sessionUpdate:`current_mode_update`,currentModeId:n}})):e.configId===`model`&&t.queryEngine.setModel(n),this.syncSessionConfigState(t,e.configId,n),t.configOptions=t.configOptions.map(t=>t.id===e.configId&&typeof t.currentValue==`string`?{...t,currentValue:n}:t),{configOptions:t.configOptions}}async createSession(e,t={}){ce();let n=t.sessionId??Le(),r=e.cwd;C(n,ne()),ie(r);let i=process.cwd(),a=!1;try{process.chdir(r),a=!0}catch{}try{let i=je(),a=ye(i),o=e._meta,s=pa(o,`permissionMode`),c=s?o?.permissionMode:void 0,l=this.getSetting(`permissions.defaultMode`),u=ua(c,s,l),d=na(this.conn,n,()=>this.sessions.get(n)?.modes.currentModeId??`default`,this.clientCapabilities,r,e=>{this.applySessionMode(n,e)},()=>this.sessions.get(n)?.appState.toolPermissionContext.isBypassPermissionsModeAvailable??!1),f=ma(l),p={..._e(),toolPermissionContext:{...i,mode:u,isBypassPermissionsModeAvailable:f}},m=await ge(r),h=new Fe({cwd:r,tools:a,commands:m,mcpClients:[],agents:[],canUseTool:d,getAppState:()=>p,setAppState:e=>{let t=e(p);Object.assign(p,t)},readFileCache:new Pe(500,50*1024*1024),includePartialMessages:!0,replayUserMessages:!0,initialMessages:t.initialMessages}),g={currentModeId:u,availableModes:[{id:`default`,name:`Default`,description:`Standard behavior, prompts for dangerous operations`},{id:`acceptEdits`,name:`Accept Edits`,description:`Auto-accept file edit operations`},{id:`plan`,name:`Plan Mode`,description:`Planning mode, no actual tool execution`},{id:`auto`,name:`Auto`,description:`Use a model classifier to approve/deny permission prompts.`},...f?[{id:`bypassPermissions`,name:`Bypass Permissions`,description:`Skip all permission checks`}]:[],{id:`dontAsk`,name:`Don't Ask`,description:`Don't prompt for permissions, deny if not pre-approved`}]},_=be(),v=oe(),y={availableModels:_.map(e=>({modelId:String(e.value??``),name:e.label??String(e.value??``),description:e.description??void 0})),currentModelId:v};h.setModel(v);let b=xa(g,y),x={queryEngine:h,cancelled:!1,cancelGeneration:0,cwd:r,modes:g,models:y,configOptions:b,promptRunning:!1,pendingMessages:new Map,pendingQueue:[],pendingQueueHead:0,toolUseCache:{},clientCapabilities:this.clientCapabilities,appState:p,commands:m,sessionFingerprint:Bi({cwd:r,mcpServers:e.mcpServers})};return this.sessions.set(n,x),{sessionId:n,models:y,modes:g,configOptions:b}}finally{a&&process.chdir(i)}}async getOrCreateSession(e){let t=this.sessions.get(e.sessionId);if(t){if(Bi({cwd:e.cwd,mcpServers:e.mcpServers})===t.sessionFingerprint){let n=await fe(e.sessionId,e.cwd);return C(e.sessionId,n?Ie(n.filePath):null),ie(e.cwd),await this.replaySessionHistory(e),{sessionId:e.sessionId,modes:t.modes,models:t.models,configOptions:t.configOptions}}await this.teardownSession(e.sessionId)}let n=await fe(e.sessionId,e.cwd),r=n?Ie(n.filePath):null;C(e.sessionId,r),ie(e.cwd);let i;if(n)try{let t=await Ce(e.sessionId);t&&t.messages.length>0&&(i=me(t.messages))}catch(e){console.error(`[ACP] Failed to load session history:`,e)}let a=await this.createSession({cwd:e.cwd,mcpServers:e.mcpServers??[],_meta:e._meta},{sessionId:e.sessionId,initialMessages:i});if(i&&i.length>0){let t=this.sessions.get(e.sessionId);t&&await $i(e.sessionId,i,this.conn,t.toolUseCache,this.clientCapabilities,t.cwd)}return{sessionId:a.sessionId,modes:a.modes,models:a.models,configOptions:a.configOptions}}async teardownSession(e){this.sessions.get(e)&&(await this.cancel({sessionId:e}),this.sessions.delete(e))}async replaySessionHistory(e){try{let t=await Ce(e.sessionId);if(!t||t.messages.length===0)return;let n=me(t.messages);if(n.length===0)return;let r=this.sessions.get(e.sessionId);if(!r)return;await $i(e.sessionId,n,this.conn,r.toolUseCache,this.clientCapabilities,r.cwd)}catch(e){console.error(`[ACP] Failed to replay session history:`,e)}}applySessionMode(e,t){if(!la(t))throw Error(`Invalid mode: ${t}`);let n=this.sessions.get(e);if(n){if(t===`bypassPermissions`&&!n.appState.toolPermissionContext.isBypassPermissionsModeAvailable||!n.modes.availableModes.some(e=>e.id===t))throw Error(`Mode not available: ${t}`);n.modes={...n.modes,currentModeId:t},n.appState.toolPermissionContext={...n.appState.toolPermissionContext,mode:t}}}async updateConfigOption(e,t,n){let r=this.sessions.get(e);r&&(this.syncSessionConfigState(r,t,n),r.configOptions=r.configOptions.map(e=>e.id===t&&typeof e.currentValue==`string`?{...e,currentValue:n}:e),await this.conn.sessionUpdate({sessionId:e,update:{sessionUpdate:`config_option_update`,configOptions:r.configOptions}}))}syncSessionConfigState(e,t,n){t===`mode`?e.modes={...e.modes,currentModeId:n}:t===`model`&&(e.models={...e.models,currentModelId:n})}async sendAvailableCommandsUpdate(e){let t=this.sessions.get(e);if(!t)return;let n=t.commands.filter(e=>e.type===`prompt`&&!e.isHidden&&e.userInvocable!==!1).map(e=>({name:e.name,description:e.description,input:e.argumentHint?{hint:e.argumentHint}:void 0}));await this.conn.sessionUpdate({sessionId:e,update:{sessionUpdate:`available_commands_update`,availableCommands:n}})}scheduleAvailableCommandsUpdate(e){setTimeout(()=>{this.sendAvailableCommandsUpdate(e).catch(e=>{console.error(`[ACP] Failed to send available commands update:`,e)})},0)}getSetting(e){let t=le();return e.split(`.`).reduce((e,t)=>{if(!(!e||typeof e!=`object`))return e[t]},t)}},ca=[`auto`,`default`,`acceptEdits`,`bypassPermissions`,`dontAsk`,`plan`];function la(e){return ca.includes(e)}function ua(e,t,n){if(t){let t=da(e,`_meta.permissionMode`);if(t===`bypassPermissions`&&!ma(n))throw Error(`Mode not available: bypassPermissions requires a local ACP bypass opt-in.`);return t}return fa(n)??`default`}function da(e,t){if(e==null)throw Error(`Invalid ${t}: expected a string.`);return zi(e,t)}function fa(e){if(e!=null)try{return zi(e,`permissions.defaultMode`)}catch(e){let t=e instanceof Error?e.message:String(e);console.error(`[ACP] Invalid permissions.defaultMode, using default:`,t);return}}function pa(e,t){return!!e&&Object.hasOwn(e,t)}function ma(e){return ha()&&(ga()||_a(e))}function ha(){return process.env.IS_SANDBOX?!0:typeof process.geteuid==`function`?process.geteuid()!==0:typeof process.getuid==`function`?process.getuid()!==0:!0}function ga(){return process.env.ACP_PERMISSION_MODE===`bypassPermissions`||va(process.env.CLAUDE_CODE_ACP_ALLOW_BYPASS_PERMISSIONS)}function _a(e){try{return zi(e)===`bypassPermissions`}catch{return!1}}function va(e){return e===`1`||e?.toLowerCase()===`true`}function ya(e){for(;e.pendingQueueHead<e.pendingQueue.length;){let t=e.pendingQueue[e.pendingQueueHead++];if(!t)continue;let n=e.pendingMessages.get(t);if(n)return e.pendingMessages.delete(t),ba(e),n}ba(e)}function ba(e){if(e.pendingQueueHead!==0){if(e.pendingQueueHead>=e.pendingQueue.length){e.pendingQueue=[],e.pendingQueueHead=0;return}e.pendingQueueHead>1024&&e.pendingQueueHead*2>e.pendingQueue.length&&(e.pendingQueue=e.pendingQueue.slice(e.pendingQueueHead),e.pendingQueueHead=0)}}function xa(e,t){return[{id:`mode`,name:`Mode`,description:`Session permission mode`,category:`mode`,type:`select`,currentValue:e.currentModeId,options:e.availableModes.map(e=>({value:e.id,name:e.name,description:e.description}))},{id:`model`,name:`Model`,description:`AI model to use`,category:`model`,type:`select`,currentValue:t.currentModelId,options:t.availableModels.map(e=>({value:e.modelId,name:e.name,description:e.description??void 0}))}]}ae(),Ae();function Sa(e,t){let n=Re.toWeb(e);return Ci(ze.toWeb(t),n)}async function Ca(){ce(),Oe();let e=Sa(process.stdin,process.stdout),t,n=new Ti(e=>(t=new sa(e),t),e);console.log=console.error,console.info=console.error,console.warn=console.error,console.debug=console.error;async function r(){for(let[e]of t.sessions)try{await t.unstable_closeSession({sessionId:e})}catch{}process.exit(0)}n.closed.then(r).catch(r),process.on(`SIGTERM`,r),process.on(`SIGINT`,r),process.on(`unhandledRejection`,(e,t)=>{console.error(`Unhandled Rejection at:`,t,`reason:`,e)}),process.stdin.resume()}export{Ca as runAcpAgent};