claude-code-best 2.7.1 → 2.7.2

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 (413) hide show
  1. package/dist/chunks/{AddWorkspaceDirectory-C7od6sFQ.js → AddWorkspaceDirectory-V2tF7iCY.js} +1 -1
  2. package/dist/chunks/{App-EfHjElWP.js → App-DLdRpU7c.js} +1 -1
  3. package/dist/chunks/ApproveApiKey-B7_TCGwt.js +1 -0
  4. package/dist/chunks/{ApproveApiKey-CSz0291w.js → ApproveApiKey-DPws3jax.js} +1 -1
  5. package/dist/chunks/{AssistantSessionChooser-mLIhDlxW.js → AssistantSessionChooser-D6rS0OVe.js} +1 -1
  6. package/dist/chunks/BackgroundTasksDialog-hGlbm5z5.js +2 -0
  7. package/dist/chunks/{BypassPermissionsModeDialog-BCdft-m_.js → BypassPermissionsModeDialog-CuEpdRVd.js} +1 -1
  8. package/dist/chunks/{ClaudeInChromeOnboarding-BPlrCIo-.js → ClaudeInChromeOnboarding-CTTKMRbt.js} +1 -1
  9. package/dist/chunks/{ClaudeMdExternalIncludesDialog-D8fk-Ib5.js → ClaudeMdExternalIncludesDialog-B-GkVoA_.js} +1 -1
  10. package/dist/chunks/ClaudeMdExternalIncludesDialog-DxJK9NiM.js +1 -0
  11. package/dist/chunks/ConsoleOAuthFlow-LPZ97jsm.js +1 -0
  12. package/dist/chunks/{DesktopHandoff-BQwx7qWA.js → DesktopHandoff-BjPylhOT.js} +1 -1
  13. package/dist/chunks/{DevChannelsDialog-CujM8Ivu.js → DevChannelsDialog-c4YVqBX9.js} +1 -1
  14. package/dist/chunks/{DiffDialog-Byv1UJvS.js → DiffDialog-I5wuXw2C.js} +1 -1
  15. package/dist/chunks/{Doctor-Cv7wbi6C.js → Doctor-Cr_MlSPc.js} +1 -1
  16. package/dist/chunks/Doctor-hgf3dMAW.js +1 -0
  17. package/dist/chunks/{ExitFlow-DKusdm_v.js → ExitFlow-Bz5grDWv.js} +2 -2
  18. package/dist/chunks/{Feedback-Diw8XUr-.js → Feedback-COgMI5tY.js} +1 -1
  19. package/dist/chunks/Grove-Bwmghb-e.js +1 -0
  20. package/dist/chunks/{Grove-CAi037VV.js → Grove-m57x4tY1.js} +1 -1
  21. package/dist/chunks/{HybridTransport-CP0RopXu.js → HybridTransport-Bok4-Ptt.js} +1 -1
  22. package/dist/chunks/{ITermBackend-RvD4VX7c.js → ITermBackend-BBSP-NNa.js} +1 -1
  23. package/dist/chunks/{InvalidConfigDialog-Bhlgysxl.js → InvalidConfigDialog-uTSuSBvO.js} +1 -1
  24. package/dist/chunks/{InvalidSettingsDialog-dGStgJZN.js → InvalidSettingsDialog-B-Os12-H.js} +1 -1
  25. package/dist/chunks/{MCPConnectionManager-D5a9ysw2.js → MCPConnectionManager-y97Inszc.js} +1 -1
  26. package/dist/chunks/{McpParsingWarnings-B_z9pZ_8.js → McpParsingWarnings-DMFUZw92.js} +1 -1
  27. package/dist/chunks/MessageSelector-DwdAC2io.js +3 -0
  28. package/dist/chunks/{Messages-DTmFVhRG.js → Messages-FEBcX-cT.js} +3 -3
  29. package/dist/chunks/{Onboarding-BoAtphYb.js → Onboarding-B8qMJaBh.js} +1 -1
  30. package/dist/chunks/{OverageCreditUpsell-DA7Ne7Mj.js → OverageCreditUpsell-DnFv5z-z.js} +1 -1
  31. package/dist/chunks/PluginSettings-B_xVgTTp.js +17 -0
  32. package/dist/chunks/{PromptInputHelpMenu-B__j9zE6.js → PromptInputHelpMenu-CoMkWchC.js} +1 -1
  33. package/dist/chunks/QueryEngine-C7r7O-hH.js +1 -0
  34. package/dist/chunks/{REPL-B1BS9jwx.js → REPL-CmJdJrGO.js} +36 -36
  35. package/dist/chunks/REPL-nP7H_-qa.js +1 -0
  36. package/dist/chunks/{RemoteCallout-Bwe1ESr9.js → RemoteCallout-4JOZROfT.js} +1 -1
  37. package/dist/chunks/{RemoteSessionManager-BKD4YmzY.js → RemoteSessionManager-jcPnywfY.js} +2 -2
  38. package/dist/chunks/ResumeConversation-CZ2Uedkf.js +1 -0
  39. package/dist/chunks/{SSETransport-D3e5KNL3.js → SSETransport-kEH_p4Yq.js} +1 -1
  40. package/dist/chunks/SearchExtraToolsTool-C64oVFUD.js +1 -0
  41. package/dist/chunks/SentryErrorBoundary-2E2qGV11.js +1 -0
  42. package/dist/chunks/{SentryErrorBoundary-D-YZTGQG.js → SentryErrorBoundary-97iY7Nb7.js} +1 -1
  43. package/dist/chunks/Settings-CuljH0mu.js +2 -0
  44. package/dist/chunks/{TeleportProgress-C3Ubx1Se.js → TeleportProgress-Ctdqi7iS.js} +1 -1
  45. package/dist/chunks/{TeleportRepoMismatchDialog-D_ax3xQy.js → TeleportRepoMismatchDialog-DyTBg1YD.js} +1 -1
  46. package/dist/chunks/{TeleportResumeWrapper-DeVKIXQp.js → TeleportResumeWrapper-B66clYsG.js} +1 -1
  47. package/dist/chunks/{ThemePicker-DKmIL5Ku.js → ThemePicker-WKmYvrqz.js} +1 -1
  48. package/dist/chunks/{TmuxBackend-Bm_cRJ2x.js → TmuxBackend-OKX2NP14.js} +2 -2
  49. package/dist/chunks/{TrustDialog-ClXFMKj6.js → TrustDialog-0anSIf-G.js} +1 -1
  50. package/dist/chunks/{ValidationErrorsList-SdQADfvA.js → ValidationErrorsList-CfgC1KJb.js} +1 -1
  51. package/dist/chunks/{WelcomeV2-BijS6i2Z.js → WelcomeV2-BMHXiNt3.js} +1 -1
  52. package/dist/chunks/{WindowsTerminalBackend-CGEQ5ClB.js → WindowsTerminalBackend-fCSGVe4W.js} +2 -2
  53. package/dist/chunks/{add-dir-B7kleB6k.js → add-dir-CMtuW667.js} +1 -1
  54. package/dist/chunks/{agentDisplay-Dr1XbOAu.js → agentDisplay-CgYKW3G7.js} +1 -1
  55. package/dist/chunks/{agents-CpLvvWpO.js → agents-CdqcGm9o.js} +7 -7
  56. package/dist/chunks/{agents-Dy5YOJC9.js → agents-D90TsYOf.js} +1 -1
  57. package/dist/chunks/{ant-gwf-4eGN.js → ant-DZjimiuz.js} +1 -1
  58. package/dist/chunks/{api-CDmgYrwN.js → api-CQWbpxLP.js} +1 -1
  59. package/dist/chunks/api-quOYYOhi.js +1 -0
  60. package/dist/chunks/assistant-B5_xx00q.js +1 -0
  61. package/dist/chunks/{assistant-BULedprW.js → assistant-CEmC_DlU.js} +1 -1
  62. package/dist/chunks/{assistant-1usDIXtk.js → assistant-CyVcFPIR.js} +1 -1
  63. package/dist/chunks/auth-CjtaiRtF.js +1 -0
  64. package/dist/chunks/{auth-CvHVr2A5.js → auth-DsQEVs9W.js} +1 -1
  65. package/dist/chunks/{autoMode-DSMM2seL.js → autoMode-DEbM9UaE.js} +1 -1
  66. package/dist/chunks/{autonomy-TtBO2TAe.js → autonomy-Clap6Swl.js} +1 -1
  67. package/dist/chunks/{autonomy-Dj6Nzxus.js → autonomy-lNpGnyiu.js} +3 -3
  68. package/dist/chunks/{autonomyPanel-CbmU7lPg.js → autonomyPanel-BqEvfI0e.js} +1 -1
  69. package/dist/chunks/backgroundHousekeeping-D-jt-ocx.js +1 -0
  70. package/dist/chunks/{backgroundHousekeeping-Cp2RvmEN.js → backgroundHousekeeping-KvOpP_4M.js} +2 -2
  71. package/dist/chunks/{branch-Cj5TGroO.js → branch-CSYB04xC.js} +1 -1
  72. package/dist/chunks/{bridge-CsqJAoEg.js → bridge-DDgASypO.js} +2 -2
  73. package/dist/chunks/bridgeConfig-BdZVEqhx.js +1 -0
  74. package/dist/chunks/{bridgeConfig-pjDV5Z2l.js → bridgeConfig-DjC4oig1.js} +1 -1
  75. package/dist/chunks/{bridgeEnabled-D9jI6X-w.js → bridgeEnabled-Csn6Ym3k.js} +1 -1
  76. package/dist/chunks/bridgeEnabled-DLRIH243.js +1 -0
  77. package/dist/chunks/{bridgeMain-CNmR9iDD.js → bridgeMain-B5wsmwkN.js} +11 -11
  78. package/dist/chunks/bridgeMain-BN0Sag35.js +1 -0
  79. package/dist/chunks/{bridgeMessaging-DN0X35NX.js → bridgeMessaging-ChOzzVWj.js} +1 -1
  80. package/dist/chunks/{btw-BOg0RTKl.js → btw-BgjcOoeo.js} +1 -1
  81. package/dist/chunks/{buddy-BFuPeIxM.js → buddy-C1wE3noR.js} +1 -1
  82. package/dist/chunks/{bypassPermissionsKillswitch-kxVnIVRs.js → bypassPermissionsKillswitch-C0diGLRB.js} +1 -1
  83. package/dist/chunks/{caches-BumkMuGA.js → caches-CIoVGP24.js} +2 -2
  84. package/dist/chunks/caches-DMYdTEAr.js +1 -0
  85. package/dist/chunks/{ccrClient-BI1QPLmN.js → ccrClient-C1msT1E3.js} +1 -1
  86. package/dist/chunks/changeDetector-DoOBZOt1.js +1 -0
  87. package/dist/chunks/{channelNotification-CoZSFUlb.js → channelNotification-CWlu9ZWs.js} +1 -1
  88. package/dist/chunks/channelNotification-oZ6vG5R5.js +1 -0
  89. package/dist/chunks/{chrome-C_5EZcdc.js → chrome-Bo9uNZ7s.js} +1 -1
  90. package/dist/chunks/clear-BxdX_MUP.js +1 -0
  91. package/dist/chunks/client-BSoJ_vaA.js +1 -0
  92. package/dist/chunks/color-CkzktPHt.js +1 -0
  93. package/dist/chunks/commands-hyVX9-Lh.js +1 -0
  94. package/dist/chunks/commitAttribution-BwT0TbYF.js +1 -0
  95. package/dist/chunks/{commitAttribution-iKd8bTOI.js → commitAttribution-csu3NO7Y.js} +1 -1
  96. package/dist/chunks/{compact-B6Muofhz.js → compact-DNGIVZRN.js} +3 -3
  97. package/dist/chunks/{companion-B_LrjSk5.js → companion-Diuav3lA.js} +1 -1
  98. package/dist/chunks/{config-CQd4IkXo.js → config-B25IrkTA.js} +1 -1
  99. package/dist/chunks/{config-CJd9kJ57.js → config-ODoYZY8i.js} +1 -1
  100. package/dist/chunks/{context-qAHTuazZ.js → context-CZ5enuPE.js} +1 -1
  101. package/dist/chunks/{context-noninteractive-DZsSp-ES.js → context-noninteractive-62P5EnN5.js} +1 -1
  102. package/dist/chunks/context-noninteractive-CjuzL9q5.js +1 -0
  103. package/dist/chunks/conversation-DyhWeHw2.js +1 -0
  104. package/dist/chunks/conversation-uY-V0SNK.js +1 -0
  105. package/dist/chunks/{copy-B2jhZndZ.js → copy-9JLr2-Xs.js} +1 -1
  106. package/dist/chunks/{createSSHSession-CKdoEmAg.js → createSSHSession-B1hTuDpB.js} +1 -1
  107. package/dist/chunks/createSession-Qurw-N4x.js +1 -0
  108. package/dist/chunks/{createSession-WkBw7wdn.js → createSession-fzjzy0aS.js} +1 -1
  109. package/dist/chunks/cron-DwR6OJuW.js +1 -0
  110. package/dist/chunks/{cronJitterConfig-2u6WAlti.js → cronJitterConfig-9OmmYmIT.js} +1 -1
  111. package/dist/chunks/{crossProjectResume-CjJISRBQ.js → crossProjectResume-B6efoIur.js} +3 -3
  112. package/dist/chunks/datadog-C-llbwzP.js +1 -0
  113. package/dist/chunks/{datadog-YsyhnDmr.js → datadog-SSxsxcC-.js} +1 -1
  114. package/dist/chunks/{desktop-BN9pHpK_.js → desktop-CQnMcbex.js} +1 -1
  115. package/dist/chunks/{diff-BTtUFuf-.js → diff-uAwKYa51.js} +1 -1
  116. package/dist/chunks/{doctor-BKBb426q.js → doctor-CBF0fkBF.js} +1 -1
  117. package/dist/chunks/{effort-ClhxMqY6.js → effort-F-bhAM2u.js} +1 -1
  118. package/dist/chunks/{entry-CJlJ47nP.js → entry-DHN_Gr1b.js} +3 -3
  119. package/dist/chunks/envLessBridgeConfig-CDVtIEWT.js +1 -0
  120. package/dist/chunks/{envLessBridgeConfig-C9UUbQCo.js → envLessBridgeConfig-Dg0hNsdi.js} +1 -1
  121. package/dist/chunks/{exit-DxY3yJrp.js → exit-CqcvZJwI.js} +1 -1
  122. package/dist/chunks/{export-DS2esu8D.js → export-c6WoGlsG.js} +1 -1
  123. package/dist/chunks/{exportRenderer-DX2L5fQ7.js → exportRenderer-CaegIP5N.js} +1 -1
  124. package/dist/chunks/{extra-usage-XJxfHsbe.js → extra-usage-Cj8fokgc.js} +1 -1
  125. package/dist/chunks/extra-usage-Dk-wcvAu.js +1 -0
  126. package/dist/chunks/{extra-usage-core-D84ifgBo.js → extra-usage-core-sHzc4eE1.js} +1 -1
  127. package/dist/chunks/{extra-usage-noninteractive-fxqxHnIt.js → extra-usage-noninteractive-D0kqrqsg.js} +1 -1
  128. package/dist/chunks/{extraUsage-P_NGI1-I.js → extraUsage-CbkqfG1U.js} +1 -1
  129. package/dist/chunks/extractMemories-BP8Opsbp.js +1 -0
  130. package/dist/chunks/{fast-CpN8lLnE.js → fast-DS3iQ1CH.js} +1 -1
  131. package/dist/chunks/fast-DklfqySb.js +1 -0
  132. package/dist/chunks/{feedback-CqRsOG3c.js → feedback-QJynmG5q.js} +1 -1
  133. package/dist/chunks/{firstPartyEventLogger-CM0V7Uev.js → firstPartyEventLogger-DlW8BUXq.js} +1 -1
  134. package/dist/chunks/{flushGate-DNutWuOE.js → flushGate-CK5B9-Zn.js} +1 -1
  135. package/dist/chunks/gates-6amRNsYl.js +1 -0
  136. package/dist/chunks/{gates-C4JvRq4i.js → gates-vlrMjO-X.js} +1 -1
  137. package/dist/chunks/{gemini-B0M6SQSG.js → gemini-B5ZRjDrh.js} +1 -1
  138. package/dist/chunks/{generateRecap-DhDOgXn3.js → generateRecap-SgRMdsyN.js} +1 -1
  139. package/dist/chunks/{generateSessionName-CoFR2wgK.js → generateSessionName-sZFzpwsq.js} +1 -1
  140. package/dist/chunks/{githubRepoPathMapping-DGiSNykv.js → githubRepoPathMapping-DUGvTwPB.js} +1 -1
  141. package/dist/chunks/{goal-DRb6pPAp.js → goal-Dy-GGn9r.js} +3 -3
  142. package/dist/chunks/{grok-emDua_hT.js → grok-BG4_buNt.js} +1 -1
  143. package/dist/chunks/{growthbook-COAneL48.js → growthbook-Br1dDRtd.js} +1 -1
  144. package/dist/chunks/{heapdump-CA6DHA8G.js → heapdump-B9PVKMxa.js} +1 -1
  145. package/dist/chunks/{help-XXY7deZm.js → help-BfWF7xij.js} +1 -1
  146. package/dist/chunks/hooks-BVrhxysz.js +1 -0
  147. package/dist/chunks/{hooks-C6zZYnDi.js → hooks-KK32pxq3.js} +2 -2
  148. package/dist/chunks/{hostAdapter-DZbdeXCV.js → hostAdapter-TBJav3vX.js} +1 -1
  149. package/dist/chunks/{ide-BLRNkzVx.js → ide-BU1A79BE.js} +2 -2
  150. package/dist/chunks/{inboundAttachments-60kD5Qt_.js → inboundAttachments-D4tBPCB8.js} +1 -1
  151. package/dist/chunks/inboundAttachments-DWJplT9p.js +1 -0
  152. package/dist/chunks/initReplBridge-99sUBVEk.js +1 -0
  153. package/dist/chunks/{insights-BBugI3tW.js → insights-lDHodCMG.js} +1 -1
  154. package/dist/chunks/{install-CuVHbwyW.js → install-Bg4ZgW81.js} +1 -1
  155. package/dist/chunks/{install-github-app-ByyzrlM9.js → install-github-app-RLbUq5EL.js} +2 -2
  156. package/dist/chunks/{install-slack-app-CJGtmacz.js → install-slack-app-CHmIwsbm.js} +1 -1
  157. package/dist/chunks/{instrumentation-C8zvzMg1.js → instrumentation-BCiV3SKX.js} +3 -3
  158. package/dist/chunks/{job-DBf6aPQX.js → job-xOGf0j5Q.js} +1 -1
  159. package/dist/chunks/{keybindings-Bi7SMp5-.js → keybindings-DMbReZ4p.js} +1 -1
  160. package/dist/chunks/{lang-CVDkUhjk.js → lang-A6LUGP_7.js} +1 -1
  161. package/dist/chunks/language-Bzp5KDCE.js +1 -0
  162. package/dist/chunks/{language-BYeqMX74.js → language-CGfURU2y.js} +1 -1
  163. package/dist/chunks/{launchAgentsPlatform-BKqxMFFn.js → launchAgentsPlatform-Dbpm7Jyo.js} +1 -1
  164. package/dist/chunks/{launchAutofixPr-CauX6gOB.js → launchAutofixPr-RZfqx5eM.js} +3 -3
  165. package/dist/chunks/{launchLocalMemory-Brrd_BJC.js → launchLocalMemory-DIntbsvg.js} +2 -2
  166. package/dist/chunks/{launchLocalVault-DtAn656A.js → launchLocalVault-CCUw0ayu.js} +3 -3
  167. package/dist/chunks/{launchMemoryStores-x7_Id7Yr.js → launchMemoryStores-QJTh8KSP.js} +1 -1
  168. package/dist/chunks/{launchOnboarding-DkamFByn.js → launchOnboarding--Pe30AYd.js} +1 -1
  169. package/dist/chunks/{launchSchedule-DjNQNxW4.js → launchSchedule-DjN1RbRX.js} +1 -1
  170. package/dist/chunks/{launchSkillStore-D2GUGhDD.js → launchSkillStore-CcKmVDz1.js} +1 -1
  171. package/dist/chunks/{launchTeleport-DTfhiZkf.js → launchTeleport-BKlEo0yF.js} +3 -3
  172. package/dist/chunks/{launchVault-BZ2Po4r8.js → launchVault-C7UHA-IG.js} +1 -1
  173. package/dist/chunks/{loadAgentsDir-C_wFhytF.js → loadAgentsDir-ClTeo0nk.js} +560 -560
  174. package/dist/chunks/loadAgentsDir-CshktEpX.js +1 -0
  175. package/dist/chunks/loadPluginHooks-DVZmzYLl.js +1 -0
  176. package/dist/chunks/localSearch-BtLNJRij.js +1 -0
  177. package/dist/chunks/{localSearch-B0p0_bjP.js → localSearch-Koc8naSr.js} +1 -1
  178. package/dist/chunks/login-BngE89_j.js +1 -0
  179. package/dist/chunks/{login-C1uE6Pg9.js → login-C3MZQTDL.js} +1 -1
  180. package/dist/chunks/{logoV2Utils-BJHvwGup.js → logoV2Utils-DAIIwt5R.js} +1 -1
  181. package/dist/chunks/logout-CXZBaUen.js +1 -0
  182. package/dist/chunks/{magicDocs-DPZzG7Z2.js → magicDocs-C_inI3JJ.js} +1 -1
  183. package/dist/chunks/{main-CNwSLti2.js → main-qqcmncHA.js} +36 -36
  184. package/dist/chunks/{mappers-Dxs_kNJH.js → mappers-7BSMbYvH.js} +1 -1
  185. package/dist/chunks/{mcp-CbDDqdzF.js → mcp-DRBiobrN.js} +1 -1
  186. package/dist/chunks/mcp-DV8Prhgi.js +1 -0
  187. package/dist/chunks/mcp-HQ8-nEZ1.js +6 -0
  188. package/dist/chunks/{mcpServer-BJNjQXsU.js → mcpServer-CLIYAgGs.js} +1 -1
  189. package/dist/chunks/{mcpServer-Py4Iz9Hx.js → mcpServer-DS0yRfcu.js} +1 -1
  190. package/dist/chunks/memory-Cz_JaFLF.js +1 -0
  191. package/dist/chunks/{mode-CqGusjoT.js → mode-Kx0kSZkr.js} +1 -1
  192. package/dist/chunks/model-Bwvn_acH.js +1 -0
  193. package/dist/chunks/{model-BBULcn7y.js → model-CNXtfiLg.js} +1 -1
  194. package/dist/chunks/{onChangeAppState-BkRihYau.js → onChangeAppState-C4ic-Mib.js} +1 -1
  195. package/dist/chunks/{openai-yNI_zoao.js → openai-CGGSfpPh.js} +3 -3
  196. package/dist/chunks/{overageCreditGrant-Cbh0_fbM.js → overageCreditGrant-BqW_6R5v.js} +1 -1
  197. package/dist/chunks/{panelCall-t10Sud9A.js → panelCall-DgPjuhQf.js} +1 -1
  198. package/dist/chunks/{passes-D_iS6DaC.js → passes-sYE91Vtr.js} +1 -1
  199. package/dist/chunks/{paths-Ci1iwL5Y.js → paths-DO4WOQtD.js} +2 -2
  200. package/dist/chunks/{permissions-CHvu4-yX.js → permissions-BPerbf1I.js} +3 -3
  201. package/dist/chunks/{pipeTransport-EAYXsubu.js → pipeTransport-CW9zF_UN.js} +1 -1
  202. package/dist/chunks/{plan-CP5nq_EB.js → plan-CDKBVRw6.js} +1 -1
  203. package/dist/chunks/{plugin-8apy_RBT.js → plugin-C6US4b8W.js} +1 -1
  204. package/dist/chunks/{pluginAutoupdate-ClrgF5b3.js → pluginAutoupdate-BQKtcAhC.js} +1 -1
  205. package/dist/chunks/{pluginBlocklist-B1LVo0j_.js → pluginBlocklist-B8DKXi0i.js} +1 -1
  206. package/dist/chunks/{pluginCliCommands-eqyMBWcP.js → pluginCliCommands-DWCeXYTl.js} +1 -1
  207. package/dist/chunks/{pluginFlagging-BiTDVP10.js → pluginFlagging-DFMlWw2P.js} +1 -1
  208. package/dist/chunks/{pluginOperations-gZ-iCmhu.js → pluginOperations-CKmwDC3G.js} +1 -1
  209. package/dist/chunks/{pluginStartupCheck-DCDWHam6.js → pluginStartupCheck-D6IbyWKe.js} +1 -1
  210. package/dist/chunks/pluginStartupCheck-cYnLsWOs.js +1 -0
  211. package/dist/chunks/{plugins-BAIVqfi8.js → plugins-BwZIRMh_.js} +1 -1
  212. package/dist/chunks/policyLimits-CFLBtFh3.js +1 -0
  213. package/dist/chunks/{pollConfig-_2W7bHoW.js → pollConfig-C3NjXYFc.js} +1 -1
  214. package/dist/chunks/{poor-Dii0mpOW.js → poor-BHhbua95.js} +1 -1
  215. package/dist/chunks/poorMode-CCK7Ek5w.js +1 -0
  216. package/dist/chunks/{poorMode-aDmmvJ_e.js → poorMode-mtlnXU-z.js} +1 -1
  217. package/dist/chunks/{print-BwSmcUQu.js → print-kxnXkqGc.js} +12 -12
  218. package/dist/chunks/{privacy-settings-DaAgSLKw.js → privacy-settings-DjY1annR.js} +1 -1
  219. package/dist/chunks/{processBashCommand-BZ1_JKu4.js → processBashCommand-BrqLqSva.js} +1 -1
  220. package/dist/chunks/processSlashCommand-DJGdVGbK.js +6 -0
  221. package/dist/chunks/prompt-BZjXpviP.js +1 -0
  222. package/dist/chunks/{prompt-6ZKyqv6z.js → prompt-CfM_xGPc.js} +1 -1
  223. package/dist/chunks/prompt-CusKF4-p.js +1 -0
  224. package/dist/chunks/{promptEditor-Dz41P-3I.js → promptEditor-FI_ewCpV.js} +2 -2
  225. package/dist/chunks/{protocolHandler-CHGHjfdf.js → protocolHandler-B7ybKpgJ.js} +1 -1
  226. package/dist/chunks/{rate-limit-options-BlU9av7g.js → rate-limit-options-DPJMNNou.js} +1 -1
  227. package/dist/chunks/{rcDebugLog-C42A0pX1.js → rcDebugLog-CwU_wJBE.js} +1 -1
  228. package/dist/chunks/{referral-IIcY3jkp.js → referral-Da4mpbd3.js} +1 -1
  229. package/dist/chunks/{refresh-DTGEx7X_.js → refresh-B6X4xb9r.js} +1 -1
  230. package/dist/chunks/{registerProtocol-BkNncGMI.js → registerProtocol-D8fFnceq.js} +1 -1
  231. package/dist/chunks/registry-y_z3pTg3.js +1 -0
  232. package/dist/chunks/{release-notes-BxzOD-zP.js → release-notes--tnd4K56.js} +1 -1
  233. package/dist/chunks/{releaseNotes-C8KQGZHq.js → releaseNotes-BPA229-J.js} +2 -2
  234. package/dist/chunks/{reload-plugins-gYyC6_g8.js → reload-plugins-yQ7tEUVh.js} +1 -1
  235. package/dist/chunks/{remote-env-CEJH5aJh.js → remote-env-CER5UxTX.js} +1 -1
  236. package/dist/chunks/{remoteBridgeCore-Dte7ZUAN.js → remoteBridgeCore-Bi31i8gt.js} +1 -1
  237. package/dist/chunks/{remoteControlServer-GN-eDbEz.js → remoteControlServer-oUAcWB4i.js} +1 -1
  238. package/dist/chunks/{rename-BEU6BNRp.js → rename-BTngRRZU.js} +1 -1
  239. package/dist/chunks/{resume-D36S2rXg.js → resume-DZHKfBmm.js} +2 -2
  240. package/dist/chunks/{runtimeObserver-CDMCeww2.js → runtimeObserver-B4KekIF0.js} +1 -1
  241. package/dist/chunks/{runtimeObserver-DaKaKNVW.js → runtimeObserver-BUOcYxiK.js} +2 -2
  242. package/dist/chunks/sandbox-adapter-C--j-c76.js +1 -0
  243. package/dist/chunks/{sandbox-toggle-BPO26t48.js → sandbox-toggle-DLBL7myN.js} +1 -1
  244. package/dist/chunks/searchExtraTools-CBYp5XeI.js +1 -0
  245. package/dist/chunks/{sentry-9EbPa1Xu.js → sentry-B7ZBc8fA.js} +1 -1
  246. package/dist/chunks/{session-D18B22u4.js → session-DWYQk9YN.js} +1 -1
  247. package/dist/chunks/{sessionDiscovery-B-OTvXJf.js → sessionDiscovery-BP0nv36F.js} +1 -1
  248. package/dist/chunks/sessionFileAccessHooks-DVilA3Mm.js +1 -0
  249. package/dist/chunks/sessionMemory-cMgcTxtP.js +1 -0
  250. package/dist/chunks/{sessionMemory-Ctauybzs.js → sessionMemory-pT4lc1C-.js} +1 -1
  251. package/dist/chunks/sessionMemoryUtils-BgYf2OvX.js +1 -0
  252. package/dist/chunks/sessionObserver-CzyEF7mg.js +1 -0
  253. package/dist/chunks/{sessionObserver-ardnTJ37.js → sessionObserver-D4SV0Ar3.js} +1 -1
  254. package/dist/chunks/sessionStorage-CXBgVAx-.js +1 -0
  255. package/dist/chunks/{sessionTitle-DEKvIVCK.js → sessionTitle-CkrnWEW1.js} +1 -1
  256. package/dist/chunks/{sessionTracing-CJUUEWZ4.js → sessionTracing-Caw-kvQr.js} +1 -1
  257. package/dist/chunks/{settingsSync-BWt3oUR7.js → settingsSync-Dn_lGonC.js} +1 -1
  258. package/dist/chunks/{setup-CDxkPTCq.js → setup-DGkOT4DX.js} +2 -2
  259. package/dist/chunks/{setup-BECFDOT9.js → setup-Dihjl7jo.js} +1 -1
  260. package/dist/chunks/{setup-CmCTB2T_.js → setup-II1titXI.js} +1 -1
  261. package/dist/chunks/{shadowedRuleDetection-BbALfdxE.js → shadowedRuleDetection-DASW3j9H.js} +1 -1
  262. package/dist/chunks/{sideQuestion-BHK6dd1q.js → sideQuestion-C1qbLTAL.js} +1 -1
  263. package/dist/chunks/sink-BSPyC453.js +1 -0
  264. package/dist/chunks/{sink-Do5fWbUC.js → sink-CqOAfFlL.js} +1 -1
  265. package/dist/chunks/{sinks-Dc9V7k6a.js → sinks-BT_lBY6T.js} +2 -2
  266. package/dist/chunks/sinks-CpuRIC3H.js +1 -0
  267. package/dist/chunks/{skill-learning-BHW9G3Dn.js → skill-learning-kh0HKn6u.js} +1 -1
  268. package/dist/chunks/skillChangeDetector-DQuNepIV.js +1 -0
  269. package/dist/chunks/{skillGapStore-Wa7s6orv.js → skillGapStore-B1gUQXhE.js} +2 -2
  270. package/dist/chunks/{skillGapStore-DVMbI2yy.js → skillGapStore-CFmLJlYm.js} +1 -1
  271. package/dist/chunks/{skillGenerator-CBuoIFsH.js → skillGenerator-DIAwRpPg.js} +2 -2
  272. package/dist/chunks/skillLearning-Bxu1Uzl-.js +1 -0
  273. package/dist/chunks/skillLearning-CxAbHYEk.js +1 -0
  274. package/dist/chunks/{skillPanel-2w82nkOl.js → skillPanel-B9zJLHKV.js} +3 -3
  275. package/dist/chunks/{skillSearchPanel-7BhCBkdh.js → skillSearchPanel-C1O9sxYS.js} +2 -2
  276. package/dist/chunks/{skills-D5rMEo2w.js → skills-C6_3snFY.js} +1 -1
  277. package/dist/chunks/{sprites-uNWgVZT6.js → sprites-59l7vF4l.js} +1 -1
  278. package/dist/chunks/{stats-D0CJB2HV.js → stats-BmGdg4nj.js} +1 -1
  279. package/dist/chunks/{status-nte1Arzy.js → status-KLPT7uYP.js} +1 -1
  280. package/dist/chunks/{statusNoticeHelpers-Lqf99003.js → statusNoticeHelpers-DuqyBY-N.js} +1 -1
  281. package/dist/chunks/{tag-BnvWS9HE.js → tag-0vahEnrx.js} +1 -1
  282. package/dist/chunks/{tasks-CEs-pxkC.js → tasks-zVPemGv7.js} +1 -1
  283. package/dist/chunks/teamHelpers-B83RwCCC.js +1 -0
  284. package/dist/chunks/{teamHelpers-D8R_gGLb.js → teamHelpers-CXAmvFco.js} +1 -1
  285. package/dist/chunks/teammateModeSnapshot-AdUFmPGC.js +1 -0
  286. package/dist/chunks/{teammateModeSnapshot-Bdra3VIJ.js → teammateModeSnapshot-CdiglTzv.js} +1 -1
  287. package/dist/chunks/teleport-D6PvdjPy.js +1 -0
  288. package/dist/chunks/{templateJobs-BDKGtmr3.js → templateJobs-Ox5ZTKjW.js} +1 -1
  289. package/dist/chunks/{terminalSetup-Bbvq-9Xl.js → terminalSetup-Dh70ynBX.js} +1 -1
  290. package/dist/chunks/{terminalSetup-C1X-sXwp.js → terminalSetup-hLCi-2uB.js} +1 -1
  291. package/dist/chunks/{theme-DXv6bV7f.js → theme-DxgUVq9C.js} +1 -1
  292. package/dist/chunks/thinkback-C5vFU8dM.js +1 -0
  293. package/dist/chunks/{thinkback-CMsW7mvG.js → thinkback-DWgU7Qhr.js} +1 -1
  294. package/dist/chunks/{thinkback-play-CFdkpzlj.js → thinkback-play-CDzY6Ux4.js} +1 -1
  295. package/dist/chunks/{toolEventObserver-CF7T7FBH.js → toolEventObserver-DPoMAJwr.js} +1 -1
  296. package/dist/chunks/{toolEventObserver-DDJV8cvW.js → toolEventObserver-jO6-mlFU.js} +1 -1
  297. package/dist/chunks/toolPool-BmA-BnAq.js +1 -0
  298. package/dist/chunks/{toolPool-BJv0sBnR.js → toolPool-Dgn1Clq8.js} +1 -1
  299. package/dist/chunks/{trustedDevice-C9nJhhyZ.js → trustedDevice-CYR5AgSB.js} +1 -1
  300. package/dist/chunks/{trustedDevice-C5s2au0k.js → trustedDevice-D35gYkBT.js} +1 -1
  301. package/dist/chunks/{ultrareviewCommand-BEv1_AS1.js → ultrareviewCommand-o4GjzoXK.js} +2 -2
  302. package/dist/chunks/{undercover-DPVt2WN7.js → undercover-B4xr62Ux.js} +1 -1
  303. package/dist/chunks/undercover-nakrQDLh.js +1 -0
  304. package/dist/chunks/{updateCCB-D-4naIUu.js → updateCCB-Cthn50OV.js} +1 -1
  305. package/dist/chunks/{upgrade-CSld83v7.js → upgrade-D4Id4ebd.js} +1 -1
  306. package/dist/chunks/upgrade-DJTCV8sr.js +1 -0
  307. package/dist/chunks/{upload-DVlE8SRp.js → upload-BFDXvdfb.js} +1 -1
  308. package/dist/chunks/{usage-D4Ubnttz.js → usage-Csbso5mD.js} +1 -1
  309. package/dist/chunks/{usage-B_bY46ep.js → usage-DxudeFLL.js} +1 -1
  310. package/dist/chunks/{useMainLoopModel-D3tJJC3y.js → useMainLoopModel-CEqP4HOc.js} +1 -1
  311. package/dist/chunks/{useManagePlugins-B4kcqcyY.js → useManagePlugins-BmS3Adja.js} +1 -1
  312. package/dist/chunks/{useMergedTools-CTQl4cdV.js → useMergedTools-wR6Bglqq.js} +1 -1
  313. package/dist/chunks/{useSearchInput-JPayBRPC.js → useSearchInput-BhKAGgEN.js} +1 -1
  314. package/dist/chunks/{useSettingsErrors-YTgPxnRZ.js → useSettingsErrors-CjK3P-Ki.js} +1 -1
  315. package/dist/chunks/{useVoice-CaBv3G13.js → useVoice-DP1hHBWA.js} +1 -1
  316. package/dist/chunks/{util-Q70qdjeS.js → util-CMSErQoz.js} +1 -1
  317. package/dist/chunks/utils-CAQfwbv8.js +1 -0
  318. package/dist/chunks/{validatePlugin-6lg9B564.js → validatePlugin-_g0AqWZG.js} +1 -1
  319. package/dist/chunks/{vim-zOsQBIp4.js → vim-8y-2Q09k.js} +1 -1
  320. package/dist/chunks/{voice-DBQevAhk.js → voice-BJAsr0K-.js} +1 -1
  321. package/dist/chunks/{voiceModeEnabled-CjBjjeNR.js → voiceModeEnabled-BD9GZhQ3.js} +1 -1
  322. package/dist/chunks/voiceModeEnabled-DZbxaFIg.js +1 -0
  323. package/dist/chunks/{voiceStreamSTT-B8CTbb_6.js → voiceStreamSTT-B1T-8adN.js} +1 -1
  324. package/dist/chunks/voiceStreamSTT-B39XaGOU.js +1 -0
  325. package/dist/chunks/{web-tools-CGqBqo07.js → web-tools-DVIvcP41.js} +1 -1
  326. package/dist/chunks/{workerRegistry-Bx6FvTZF.js → workerRegistry-60_UCyc3.js} +1 -1
  327. package/dist/chunks/worktree-DNK8NprA.js +1 -0
  328. package/dist/chunks/{xml-CVF7dWfi.js → xml-CTdKuU6f.js} +1 -1
  329. package/dist/cli.js +1 -1
  330. package/package.json +1 -1
  331. package/dist/chunks/ApproveApiKey-Cc5SaLqs.js +0 -1
  332. package/dist/chunks/BackgroundTasksDialog-OkUSMj0I.js +0 -2
  333. package/dist/chunks/ClaudeMdExternalIncludesDialog-BbPaorIs.js +0 -1
  334. package/dist/chunks/ConsoleOAuthFlow-Dyv4mI_o.js +0 -1
  335. package/dist/chunks/Doctor-CRrE5Sf4.js +0 -1
  336. package/dist/chunks/Grove-CgX5Fdeh.js +0 -1
  337. package/dist/chunks/MessageSelector-CEvbAZGv.js +0 -3
  338. package/dist/chunks/PluginSettings-D3bQRsge.js +0 -17
  339. package/dist/chunks/QueryEngine-CMcQGyql.js +0 -1
  340. package/dist/chunks/REPL-C9f3ToGu.js +0 -1
  341. package/dist/chunks/ResumeConversation-DxqbAKA4.js +0 -1
  342. package/dist/chunks/SearchExtraToolsTool-BVAhywUI.js +0 -1
  343. package/dist/chunks/SentryErrorBoundary-M1ipwe1n.js +0 -1
  344. package/dist/chunks/Settings-D5EWYL40.js +0 -2
  345. package/dist/chunks/api-BdbBnz5c.js +0 -1
  346. package/dist/chunks/assistant-BMviqf0l.js +0 -1
  347. package/dist/chunks/auth-ORBmEqnH.js +0 -1
  348. package/dist/chunks/backgroundHousekeeping-BAvSPaZ5.js +0 -1
  349. package/dist/chunks/bridgeConfig-B49H_B9L.js +0 -1
  350. package/dist/chunks/bridgeEnabled-DsG2JvIr.js +0 -1
  351. package/dist/chunks/bridgeMain-DYCShrcV.js +0 -1
  352. package/dist/chunks/caches-BsYvQnWV.js +0 -1
  353. package/dist/chunks/changeDetector-By54zja0.js +0 -1
  354. package/dist/chunks/channelNotification-Cx82K1CD.js +0 -1
  355. package/dist/chunks/clear-BQr2zTyP.js +0 -1
  356. package/dist/chunks/client-BbavFXJZ.js +0 -1
  357. package/dist/chunks/color-DOsgZO2n.js +0 -1
  358. package/dist/chunks/commands-CfwfGt3T.js +0 -1
  359. package/dist/chunks/commitAttribution-CH9C_hoL.js +0 -1
  360. package/dist/chunks/context-noninteractive-DCYvLxWx.js +0 -1
  361. package/dist/chunks/conversation-DYUVAAQt.js +0 -1
  362. package/dist/chunks/conversation-NrAy2em3.js +0 -1
  363. package/dist/chunks/createSession-Czx7_nf6.js +0 -1
  364. package/dist/chunks/cron-g_P3I5uT.js +0 -1
  365. package/dist/chunks/datadog-QSR9B7CZ.js +0 -1
  366. package/dist/chunks/envLessBridgeConfig-DSJqg3Ox.js +0 -1
  367. package/dist/chunks/extra-usage-DaxUQk9I.js +0 -1
  368. package/dist/chunks/extractMemories-B3cTWsph.js +0 -1
  369. package/dist/chunks/fast-CHiQGMBE.js +0 -1
  370. package/dist/chunks/gates-DvjyKZVA.js +0 -1
  371. package/dist/chunks/hooks-DOej0jqp.js +0 -1
  372. package/dist/chunks/inboundAttachments-BBYxcnvj.js +0 -1
  373. package/dist/chunks/initReplBridge-Dt2aQBia.js +0 -1
  374. package/dist/chunks/language-BoKr5ylY.js +0 -1
  375. package/dist/chunks/loadAgentsDir-whRB0phu.js +0 -1
  376. package/dist/chunks/loadPluginHooks-CYZjzxyO.js +0 -1
  377. package/dist/chunks/localSearch-DAwFmV2Y.js +0 -1
  378. package/dist/chunks/login-DOyB64Rv.js +0 -1
  379. package/dist/chunks/logout-DTPo3Myl.js +0 -1
  380. package/dist/chunks/mcp-CVnFM6nR.js +0 -6
  381. package/dist/chunks/mcp-CzfQB8BT.js +0 -1
  382. package/dist/chunks/memory-BdUqEKio.js +0 -1
  383. package/dist/chunks/model-BOc_-7m0.js +0 -1
  384. package/dist/chunks/pluginStartupCheck-EjLvCXru.js +0 -1
  385. package/dist/chunks/policyLimits-Cdp3QwZ1.js +0 -1
  386. package/dist/chunks/poorMode-DzEL0cu0.js +0 -1
  387. package/dist/chunks/processSlashCommand-v1Rvzxwn.js +0 -6
  388. package/dist/chunks/prompt-DPqKtC0b.js +0 -1
  389. package/dist/chunks/prompt-WjMHPk90.js +0 -1
  390. package/dist/chunks/registry-CBqb7wbi.js +0 -1
  391. package/dist/chunks/sandbox-adapter-DqTuhgud.js +0 -1
  392. package/dist/chunks/searchExtraTools-Brae4wmG.js +0 -1
  393. package/dist/chunks/sessionFileAccessHooks-BXsK8Dwf.js +0 -1
  394. package/dist/chunks/sessionMemory-Bv-AYifm.js +0 -1
  395. package/dist/chunks/sessionMemoryUtils-D-bzdsAT.js +0 -1
  396. package/dist/chunks/sessionObserver-j8D9hidw.js +0 -1
  397. package/dist/chunks/sessionStorage-Cw5ibYWA.js +0 -1
  398. package/dist/chunks/sink-DFWgcGHX.js +0 -1
  399. package/dist/chunks/sinks-BnkxTOU9.js +0 -1
  400. package/dist/chunks/skillChangeDetector-DwAvG835.js +0 -1
  401. package/dist/chunks/skillLearning-BI2YDG3K.js +0 -1
  402. package/dist/chunks/skillLearning-BZMJRJPp.js +0 -1
  403. package/dist/chunks/teamHelpers-D4vCj2hP.js +0 -1
  404. package/dist/chunks/teammateModeSnapshot-BDJ1JTcl.js +0 -1
  405. package/dist/chunks/teleport-RxTr4aCi.js +0 -1
  406. package/dist/chunks/thinkback-DRJBz3Is.js +0 -1
  407. package/dist/chunks/toolPool-0zCdXfEu.js +0 -1
  408. package/dist/chunks/undercover-DYa00dVv.js +0 -1
  409. package/dist/chunks/upgrade-BHj8ALep.js +0 -1
  410. package/dist/chunks/utils-Cr-x1Oyd.js +0 -1
  411. package/dist/chunks/voiceModeEnabled-DK6u8Aaj.js +0 -1
  412. package/dist/chunks/voiceStreamSTT-CCkOfmdI.js +0 -1
  413. package/dist/chunks/worktree-DPpgPLLG.js +0 -1
@@ -1,6 +1,6 @@
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 ee,kt as v,nn as y,un as b,vt as te,wn as x}from"./schemas-BGAvj1T4.js";import{t as ne}from"./v4-f1i_CNUT.js";import{Tt as re,cn as ie,jr as S,lr as C}from"./state-sIHsFpDu.js";import{Dr as ae,Pr as oe,no as se,oc as ce,oo as le,yc as ue}from"./paths-Ci1iwL5Y.js";import{l as de,p as fe}from"./sessionStoragePortable-CJUZrbIq.js";import{$u as pe,Ep as me,Fr as he,G as ge,Hf as _e,K as ve,Qu as ye,Sr as be,Ta as xe,Tp as Se,Vf as Ce,Xv as we,Yv as Te,Zi as Ee,bD as De,i as Oe,na as ke,o as Ae,wa as je,yD as Me}from"./loadAgentsDir-C_wFhytF.js";import{Qn as Ne,Zn as Pe}from"./prompt-6ZKyqv6z.js";import{o as Fe,t as Ie}from"./fileStateCache-BhVfo23e.js";import{t as Le}from"./QueryEngine-CMcQGyql.js";import*as w from"node:path";import{dirname as Re}from"node:path";import{randomUUID as ze}from"node:crypto";import{Readable as Be,Writable as Ve}from"node:stream";ne();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`},He=x({_meta:m(p(),g()).nullish(),terminal:v().optional().default(!1)}),Ue=x({_meta:m(p(),g()).nullish(),label:p().nullish(),name:p(),optional:v().optional().default(!1),secret:v().optional().default(!0)}),We=x({_meta:m(p(),g()).nullish(),description:p().nullish(),id:p(),name:p()}),Ge=x({_meta:m(p(),g()).nullish(),description:p().nullish(),id:p(),link:p().nullish(),name:p(),vars:h(Ue)}),Ke=x({_meta:m(p(),g()).nullish(),args:h(p()).optional(),description:p().nullish(),env:m(p(),p()).optional(),id:p(),name:p()}),qe=_([Ge.and(x({type:b(`env_var`)})),Ke.and(x({type:b(`terminal`)})),We]),Je=x({_meta:m(p(),g()).nullish(),methodId:p()}),Ye=x({_meta:m(p(),g()).nullish()}),Xe=x({_meta:m(p(),g()).nullish(),blob:p(),mimeType:p().nullish(),uri:p()}),Ze=x({default:v().nullish(),description:p().nullish(),title:p().nullish()}),Qe=x({_meta:m(p(),g()).nullish()}),$e=x({_meta:m(p(),g()).nullish()}),et=x({amount:f(),currency:p()}),tt=x({_meta:m(p(),g()).nullish(),terminalId:p()}),nt=x({_meta:m(p(),g()).nullish(),newText:p(),oldText:p().nullish(),path:p()}),rt=_([p(),f(),f(),v(),h(p())]),it=y(_([x({content:m(p(),rt).nullish()}).and(x({action:b(`accept`)})),x({action:b(`decline`)}),x({action:b(`cancel`)})]),x({_meta:m(p(),g()).nullish()})),at=x({_meta:m(p(),g()).nullish()}),ot=p(),st=x({_meta:m(p(),g()).nullish(),elicitationId:ot}),ct=b(`object`),lt=b(`string`),ut=x({_meta:m(p(),g()).nullish()}),dt=x({_meta:m(p(),g()).nullish(),form:at.nullish(),url:ut.nullish()}),ft=x({const:p(),title:p()}),pt=x({_meta:m(p(),g()).nullish(),name:p(),value:p()}),mt=x({code:_([b(-32700),b(-32600),b(-32601),b(-32602),b(-32603),b(-32800),b(-32e3),b(-32002),b(-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()}),ht=g(),gt=g(),_t=g(),vt=x({_meta:m(p(),g()).nullish(),readTextFile:v().optional().default(!1),writeTextFile:v().optional().default(!1)}),yt=x({_meta:m(p(),g()).nullish(),name:p(),value:p()}),bt=x({_meta:m(p(),g()).nullish(),name:p(),title:p().nullish(),version:p()}),xt=x({default:f().nullish(),description:p().nullish(),maximum:f().nullish(),minimum:f().nullish(),title:p().nullish()}),St=x({_meta:m(p(),g()).nullish()}),Ct=x({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cursor:p().nullish(),cwd:p().nullish()}),wt=x({_meta:m(p(),g()).nullish()}),Tt=x({_meta:m(p(),g()).nullish(),logout:wt.nullish()}),Et=x({_meta:m(p(),g()).nullish()}),Dt=x({_meta:m(p(),g()).nullish()}),Ot=x({_meta:m(p(),g()).nullish(),http:v().optional().default(!1),sse:v().optional().default(!1)}),kt=x({_meta:m(p(),g()).nullish(),headers:h(yt),name:p(),url:p()}),At=x({_meta:m(p(),g()).nullish(),headers:h(yt),name:p(),url:p()}),jt=x({_meta:m(p(),g()).nullish(),args:h(p()),command:p(),env:h(pt),name:p()}),D=_([kt.and(x({type:b(`http`)})),At.and(x({type:b(`sse`)})),jt]),O=p(),Mt=x({_meta:m(p(),g()).nullish(),description:p().nullish(),modelId:O,name:p()}),Nt=_([b(`error`),b(`warning`),b(`information`),b(`hint`)]),Pt=x({_meta:m(p(),g()).nullish()}),Ft=x({_meta:m(p(),g()).nullish()}),It=x({_meta:m(p(),g()).nullish()}),Lt=x({_meta:m(p(),g()).nullish()}),Rt=x({_meta:m(p(),g()).nullish()}),zt=x({_meta:m(p(),g()).nullish(),maxCount:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish()}),Bt=x({diff:p(),uri:p()}),Vt=x({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()}),Ht=x({_meta:m(p(),g()).nullish()}),Ut=x({_meta:m(p(),g()).nullish()}),Wt=x({languageId:p(),text:p(),uri:p()}),Gt=x({_meta:m(p(),g()).nullish(),maxCount:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish()}),Kt=_([b(`rejected`),b(`ignored`),b(`replaced`),b(`cancelled`)]),qt=x({excerpts:h(Vt),uri:p()}),Jt=x({_meta:m(p(),g()).nullish()}),Yt=x({_meta:m(p(),g()).nullish()}),Xt=x({name:p(),owner:p(),remoteUrl:p()}),Zt=x({_meta:m(p(),g()).nullish()}),Qt=x({_meta:m(p(),g()).nullish(),jump:Ht.nullish(),rename:Yt.nullish(),searchAndReplace:Zt.nullish()}),$t=x({id:p(),isRegex:v().nullish(),replace:p(),search:p(),uri:p()}),en=_([b(`automatic`),b(`diagnostic`),b(`manual`)]),tn=x({_meta:m(p(),g()).nullish(),maxCount:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish()}),nn=x({_meta:m(p(),g()).nullish(),diagnostics:Pt.nullish(),editHistory:zt.nullish(),openFiles:Ut.nullish(),recentFiles:Gt.nullish(),relatedSnippets:Jt.nullish(),userActions:tn.nullish()}),rn=x({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cwd:p(),mcpServers:h(D)}),an=x({default:f().nullish(),description:p().nullish(),maximum:f().nullish(),minimum:f().nullish(),title:p().nullish()}),on=p(),sn=_([b(`allow_once`),b(`allow_always`),b(`reject_once`),b(`reject_always`)]),cn=x({_meta:m(p(),g()).nullish(),kind:sn,name:p(),optionId:on}),ln=_([b(`high`),b(`medium`),b(`low`)]),un=_([b(`pending`),b(`in_progress`),b(`completed`)]),dn=x({_meta:m(p(),g()).nullish(),content:p(),priority:ln,status:un}),fn=x({_meta:m(p(),g()).nullish(),entries:h(dn)}),k=x({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`})}),pn=x({id:p(),position:k,uri:p()}),mn=x({id:p(),newName:p(),position:k,uri:p()}),hn=x({action:p(),position:k,timestampMs:f(),uri:p()}),gn=_([b(`utf-16`),b(`utf-32`),b(`utf-8`)]),_n=x({_meta:m(p(),g()).nullish(),auth:He.optional().default({terminal:!1}),elicitation:dt.nullish(),fs:vt.optional().default({readTextFile:!1,writeTextFile:!1}),nes:Qt.nullish(),positionEncodings:h(gn).optional(),terminal:v().optional().default(!1)}),vn=x({_meta:m(p(),g()).nullish(),audio:v().optional().default(!1),embeddedContext:v().optional().default(!1),image:v().optional().default(!1)}),yn=f().int().gte(0).lte(65535),bn=x({_meta:m(p(),g()).nullish(),clientCapabilities:_n.optional().default({auth:{terminal:!1},fs:{readTextFile:!1,writeTextFile:!1},terminal:!1}),clientInfo:bt.nullish(),protocolVersion:yn}),A=x({end:k,start:k}),xn=x({message:p(),range:A,severity:Nt,uri:p()}),Sn=x({languageId:p(),lastFocusedMs:f().nullish(),uri:p(),visibleRange:A.nullish()}),Cn=x({_meta:m(p(),g()).nullish(),diagnostics:h(xn).nullish(),editHistory:h(Bt).nullish(),openFiles:h(Sn).nullish(),recentFiles:h(Wt).nullish(),relatedSnippets:h(qt).nullish(),userActions:h(hn).nullish()}),wn=x({newText:p(),range:A}),Tn=_([x({cursorPosition:k.nullish(),edits:h(wn),id:p(),uri:p()}).and(x({kind:b(`edit`)})),pn.and(x({kind:b(`jump`)})),mn.and(x({kind:b(`rename`)})),$t.and(x({kind:b(`searchAndReplace`)}))]),En=x({_meta:m(p(),g()).nullish(),content:p()}),Dn=x({_meta:m(p(),g()).nullish()}),j=_([f(),p()]).nullable();x({_meta:m(p(),g()).nullish(),requestId:j});var On=x({requestId:j}),kn=te([`assistant`,`user`]),M=x({_meta:m(p(),g()).nullish(),audience:h(kn).nullish(),lastModified:p().nullish(),priority:f().nullish()}),An=x({_meta:m(p(),g()).nullish(),annotations:M.nullish(),data:p(),mimeType:p()}),jn=x({_meta:m(p(),g()).nullish(),annotations:M.nullish(),data:p(),mimeType:p(),uri:p().nullish()}),Mn=x({_meta:m(p(),g()).nullish(),annotations:M.nullish(),description:p().nullish(),mimeType:p().nullish(),name:p(),size:f().nullish(),title:p().nullish(),uri:p()}),Nn=x({_meta:m(p(),g()).nullish(),optionId:on}),Pn=_([x({outcome:b(`cancelled`)}),Nn.and(x({outcome:b(`selected`)}))]),Fn=x({_meta:m(p(),g()).nullish(),outcome:Pn}),In=x({_meta:m(p(),g()).nullish()}),Ln=x({_meta:m(p(),g()).nullish()}),Rn=x({currentValue:v()}),zn=p(),Bn=p(),Vn=_([b(`mode`),b(`model`),b(`thought_level`),p()]),N=p(),Hn=x({_meta:m(p(),g()).nullish(),description:p().nullish(),name:p(),value:N}),Un=x({_meta:m(p(),g()).nullish(),group:zn,name:p(),options:h(Hn)}),P=y(_([x({currentValue:N,options:_([h(Hn),h(Un)])}).and(x({type:b(`select`)})),Rn.and(x({type:b(`boolean`)}))]),x({_meta:m(p(),g()).nullish(),category:Vn.nullish(),description:p().nullish(),id:Bn,name:p()})),Wn=x({_meta:m(p(),g()).nullish(),configOptions:h(P)}),Gn=x({_meta:m(p(),g()).nullish()}),F=p(),Kn=x({_meta:m(p(),g()).nullish(),id:p(),sessionId:F}),qn=x({_meta:m(p(),g()).nullish(),sessionId:F}),Jn=x({_meta:m(p(),g()).nullish(),sessionId:F}),Yn=x({_meta:m(p(),g()).nullish(),sessionId:F}),Xn=x({_meta:m(p(),g()).nullish(),args:h(p()).optional(),command:p(),cwd:p().nullish(),env:h(pt).optional(),outputByteLimit:f().nullish(),sessionId:F}),Zn=x({_meta:m(p(),g()).nullish(),sessionId:F,uri:p()}),Qn=x({_meta:m(p(),g()).nullish(),position:k,sessionId:F,uri:p(),version:f(),visibleRange:A}),$n=x({_meta:m(p(),g()).nullish(),languageId:p(),sessionId:F,text:p(),uri:p(),version:f()}),er=x({_meta:m(p(),g()).nullish(),sessionId:F,uri:p()}),tr=x({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cwd:p(),mcpServers:h(D).optional(),sessionId:F}),nr=x({_meta:m(p(),g()).nullish(),sessionId:F,terminalId:p()}),rr=x({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cwd:p(),mcpServers:h(D),sessionId:F}),ir=x({_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:F}),ar=x({_meta:m(p(),g()).nullish(),id:p(),reason:Kt.nullish(),sessionId:F}),or=x({_meta:m(p(),g()).nullish(),sessionId:F,terminalId:p()}),sr=x({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cwd:p(),mcpServers:h(D).optional(),sessionId:F}),cr=x({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cwd:p(),sessionId:F,title:p().nullish(),updatedAt:p().nullish()}),lr=x({_meta:m(p(),g()).nullish(),nextCursor:p().nullish(),sessions:h(cr)}),ur=x({_meta:m(p(),g()).nullish(),title:p().nullish(),updatedAt:p().nullish()}),dr=x({_meta:m(p(),g()).nullish()}),I=p(),fr=x({_meta:m(p(),g()).nullish(),currentModeId:I}),pr=x({_meta:m(p(),g()).nullish(),description:p().nullish(),id:I,name:p()}),L=x({_meta:m(p(),g()).nullish(),availableModes:h(pr),currentModeId:I}),R=x({_meta:m(p(),g()).nullish(),availableModels:h(Mt),currentModelId:O}),mr=x({_meta:m(p(),g()).nullish(),configOptions:h(P).nullish(),models:R.nullish(),modes:L.nullish(),sessionId:F}),hr=x({_meta:m(p(),g()).nullish(),configOptions:h(P).nullish(),models:R.nullish(),modes:L.nullish()}),gr=x({_meta:m(p(),g()).nullish(),configOptions:h(P).nullish(),models:R.nullish(),modes:L.nullish(),sessionId:F}),_r=x({_meta:m(p(),g()).nullish(),configOptions:h(P).nullish(),models:R.nullish(),modes:L.nullish()}),vr=x({_meta:m(p(),g()).nullish()}),yr=x({_meta:m(p(),g()).nullish(),additionalDirectories:In.nullish(),close:Ln.nullish(),fork:Gn.nullish(),list:dr.nullish(),resume:vr.nullish()}),br=y(_([x({type:b(`boolean`),value:v()}),x({value:N})]),x({_meta:m(p(),g()).nullish(),configId:Bn,sessionId:F})),xr=x({_meta:m(p(),g()).nullish(),configOptions:h(P)}),Sr=x({_meta:m(p(),g()).nullish(),modeId:I,sessionId:F}),Cr=x({_meta:m(p(),g()).nullish()}),wr=x({_meta:m(p(),g()).nullish(),modelId:O,sessionId:F}),Tr=x({_meta:m(p(),g()).nullish()}),Er=x({_meta:m(p(),g()).nullish(),sessionId:F}),Dr=_([b(`end_turn`),b(`max_tokens`),b(`max_turn_requests`),b(`refusal`),b(`cancelled`)]),Or=_([b(`email`),b(`uri`),b(`date`),b(`date-time`)]),kr=x({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(ft).nullish(),pattern:p().nullish(),title:p().nullish()}),Ar=x({_meta:m(p(),g()).nullish(),context:Cn.nullish(),position:k,selection:A.nullish(),sessionId:F,triggerKind:en,uri:p(),version:f()}),jr=x({_meta:m(p(),g()).nullish(),suggestions:h(Tn)}),Mr=x({_meta:m(p(),g()).nullish(),terminalId:p()}),Nr=x({_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=x({_meta:m(p(),g()).nullish(),sessionId:F,terminalId:p()}),Fr=x({_meta:m(p(),g()).nullish(),exitStatus:Nr.nullish(),output:p(),truncated:v()}),Ir=x({_meta:m(p(),g()).nullish(),annotations:M.nullish(),text:p()}),Lr=x({range:A.nullish(),text:p()}),Rr=x({_meta:m(p(),g()).nullish(),contentChanges:h(Lr),sessionId:F,uri:p(),version:f()});x({method:p(),params:_([qn,$n,Rr,Zn,er,Qn,Kn,ar,ht]).nullish()});var zr=_([b(`full`),b(`incremental`)]),Br=x({_meta:m(p(),g()).nullish(),syncKind:zr}),Vr=x({_meta:m(p(),g()).nullish(),didChange:Br.nullish(),didClose:Ft.nullish(),didFocus:It.nullish(),didOpen:Lt.nullish(),didSave:Rt.nullish()}),Hr=x({_meta:m(p(),g()).nullish(),document:Vr.nullish()}),Ur=x({_meta:m(p(),g()).nullish(),context:nn.nullish(),events:Hr.nullish()}),Wr=x({_meta:m(p(),g()).nullish(),auth:Tt.optional().default({}),loadSession:v().optional().default(!1),mcpCapabilities:Ot.optional().default({http:!1,sse:!1}),nes:Ur.nullish(),positionEncoding:gn.nullish(),promptCapabilities:vn.optional().default({audio:!1,embeddedContext:!1,image:!1}),sessionCapabilities:yr.optional().default({})}),Gr=x({_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:bt.nullish(),authMethods:h(qe).optional().default([]),protocolVersion:yn}),Kr=_([x({_meta:m(p(),g()).nullish(),mimeType:p().nullish(),text:p(),uri:p()}),Xe]),qr=x({_meta:m(p(),g()).nullish(),annotations:M.nullish(),resource:Kr}),z=_([Ir.and(x({type:b(`text`)})),jn.and(x({type:b(`image`)})),An.and(x({type:b(`audio`)})),Mn.and(x({type:b(`resource_link`)})),qr.and(x({type:b(`resource`)}))]),Jr=x({_meta:m(p(),g()).nullish(),content:z}),B=x({_meta:m(p(),g()).nullish(),content:z,messageId:p().nullish()}),Yr=x({_meta:m(p(),g()).nullish(),messageId:p().nullish(),prompt:h(z),sessionId:F}),Xr=x({anyOf:h(ft)}),Zr=_([Jr.and(x({type:b(`content`)})),nt.and(x({type:b(`diff`)})),Mr.and(x({type:b(`terminal`)}))]),V=p(),Qr=x({sessionId:F,toolCallId:V.nullish()}),$r=y(_([Qr,On]),x({elicitationId:ot,url:p().url()})),ei=x({_meta:m(p(),g()).nullish(),line:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),path:p()}),ti=_([b(`pending`),b(`in_progress`),b(`completed`),b(`failed`)]),ni=_([b(`read`),b(`edit`),b(`delete`),b(`move`),b(`search`),b(`execute`),b(`think`),b(`fetch`),b(`switch_mode`),b(`other`)]),ri=x({_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:V}),ii=x({_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:V}),ai=x({_meta:m(p(),g()).nullish(),options:h(cn),sessionId:F,toolCall:ii}),oi=x({_meta:m(p(),g()).nullish(),hint:p()}),si=x({_meta:m(p(),g()).nullish(),description:p(),input:oi.nullish(),name:p()}),ci=x({_meta:m(p(),g()).nullish(),availableCommands:h(si)}),li=_([x({enum:h(p()),type:lt}),Xr]),ui=x({default:h(p()).nullish(),description:p().nullish(),items:li,maxItems:f().nullish(),minItems:f().nullish(),title:p().nullish()}),di=_([kr.and(x({type:b(`string`)})),an.and(x({type:b(`number`)})),xt.and(x({type:b(`integer`)})),Ze.and(x({type:b(`boolean`)})),ui.and(x({type:b(`array`)}))]),fi=x({description:p().nullish(),properties:m(p(),di).optional().default({}),required:h(p()).nullish(),title:p().nullish(),type:ct.optional().default(`object`)}),pi=y(_([y(_([Qr,On]),x({requestedSchema:fi})).and(x({mode:b(`form`)})),$r.and(x({mode:b(`url`)}))]),x({_meta:m(p(),g()).nullish(),message:p()})),mi=x({cachedReadTokens:f().nullish(),cachedWriteTokens:f().nullish(),inputTokens:f(),outputTokens:f(),thoughtTokens:f().nullish(),totalTokens:f()});_([x({id:j,result:_([Gr,Ye,Dt,gr,hr,lr,mr,_r,$e,Cr,xr,x({_meta:m(p(),g()).nullish(),stopReason:Dr,usage:mi.nullish(),userMessageId:p().nullish()}),Tr,Er,jr,Qe,_t])}),x({error:mt,id:j})]);var hi=x({_meta:m(p(),g()).nullish(),cost:et.nullish(),size:f(),used:f()}),gi=_([B.and(x({sessionUpdate:b(`user_message_chunk`)})),B.and(x({sessionUpdate:b(`agent_message_chunk`)})),B.and(x({sessionUpdate:b(`agent_thought_chunk`)})),ri.and(x({sessionUpdate:b(`tool_call`)})),ii.and(x({sessionUpdate:b(`tool_call_update`)})),fn.and(x({sessionUpdate:b(`plan`)})),ci.and(x({sessionUpdate:b(`available_commands_update`)})),fr.and(x({sessionUpdate:b(`current_mode_update`)})),Wn.and(x({sessionUpdate:b(`config_option_update`)})),ur.and(x({sessionUpdate:b(`session_info_update`)})),hi.and(x({sessionUpdate:b(`usage_update`)}))]),_i=x({_meta:m(p(),g()).nullish(),sessionId:F,update:gi});x({method:p(),params:_([_i,st,ht]).nullish()});var vi=x({_meta:m(p(),g()).nullish(),sessionId:F,terminalId:p()}),yi=x({_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=x({name:p(),uri:p()}),xi=x({_meta:m(p(),g()).nullish(),repository:Xt.nullish(),workspaceFolders:h(bi).nullish(),workspaceUri:p().nullish()});x({id:j,method:p(),params:_([bn,Je,Et,rn,rr,Ct,tr,sr,Yn,Sr,br,Yr,wr,xi,Ar,Jn,gt]).nullish()});var Si=x({_meta:m(p(),g()).nullish(),content:p(),path:p(),sessionId:F});x({id:j,method:p(),params:_([Si,ir,ai,Xn,Pr,or,vi,nr,pi,gt]).nullish()}),_([x({id:j,result:_([x({_meta:m(p(),g()).nullish()}),En,Fn,tt,Fr,Dn,yi,St,it,_t])}),x({error:mt,id:j})]),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(`
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 ee,kt as v,nn as y,un as b,vt as te,wn as x}from"./schemas-BGAvj1T4.js";import{t as ne}from"./v4-f1i_CNUT.js";import{Tt as re,cn as ie,jr as S,lr as C}from"./state-sIHsFpDu.js";import{Dr as ae,Pr as oe,no as se,oc as ce,oo as le,yc as ue}from"./paths-DO4WOQtD.js";import{l as de,p as fe}from"./sessionStoragePortable-CJUZrbIq.js";import{Bf as pe,Ep as me,Fr as he,G as ge,Jv as _e,K as ve,Sr as ye,Ta as be,Tp as xe,Xu as Se,Zi as Ce,Zu as we,bD as Te,i as Ee,na as De,o as Oe,qv as ke,wa as Ae,yD as je,zf as Me}from"./loadAgentsDir-ClTeo0nk.js";import{Qn as Ne,Zn as Pe}from"./prompt-CfM_xGPc.js";import{o as Fe,t as Ie}from"./fileStateCache-BhVfo23e.js";import{t as Le}from"./QueryEngine-C7r7O-hH.js";import*as w from"node:path";import{dirname as Re}from"node:path";import{randomUUID as ze}from"node:crypto";import{Readable as Be,Writable as Ve}from"node:stream";ne();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`},He=x({_meta:m(p(),g()).nullish(),terminal:v().optional().default(!1)}),Ue=x({_meta:m(p(),g()).nullish(),label:p().nullish(),name:p(),optional:v().optional().default(!1),secret:v().optional().default(!0)}),We=x({_meta:m(p(),g()).nullish(),description:p().nullish(),id:p(),name:p()}),Ge=x({_meta:m(p(),g()).nullish(),description:p().nullish(),id:p(),link:p().nullish(),name:p(),vars:h(Ue)}),Ke=x({_meta:m(p(),g()).nullish(),args:h(p()).optional(),description:p().nullish(),env:m(p(),p()).optional(),id:p(),name:p()}),qe=_([Ge.and(x({type:b(`env_var`)})),Ke.and(x({type:b(`terminal`)})),We]),Je=x({_meta:m(p(),g()).nullish(),methodId:p()}),Ye=x({_meta:m(p(),g()).nullish()}),Xe=x({_meta:m(p(),g()).nullish(),blob:p(),mimeType:p().nullish(),uri:p()}),Ze=x({default:v().nullish(),description:p().nullish(),title:p().nullish()}),Qe=x({_meta:m(p(),g()).nullish()}),$e=x({_meta:m(p(),g()).nullish()}),et=x({amount:f(),currency:p()}),tt=x({_meta:m(p(),g()).nullish(),terminalId:p()}),nt=x({_meta:m(p(),g()).nullish(),newText:p(),oldText:p().nullish(),path:p()}),rt=_([p(),f(),f(),v(),h(p())]),it=y(_([x({content:m(p(),rt).nullish()}).and(x({action:b(`accept`)})),x({action:b(`decline`)}),x({action:b(`cancel`)})]),x({_meta:m(p(),g()).nullish()})),at=x({_meta:m(p(),g()).nullish()}),ot=p(),st=x({_meta:m(p(),g()).nullish(),elicitationId:ot}),ct=b(`object`),lt=b(`string`),ut=x({_meta:m(p(),g()).nullish()}),dt=x({_meta:m(p(),g()).nullish(),form:at.nullish(),url:ut.nullish()}),ft=x({const:p(),title:p()}),pt=x({_meta:m(p(),g()).nullish(),name:p(),value:p()}),mt=x({code:_([b(-32700),b(-32600),b(-32601),b(-32602),b(-32603),b(-32800),b(-32e3),b(-32002),b(-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()}),ht=g(),gt=g(),_t=g(),vt=x({_meta:m(p(),g()).nullish(),readTextFile:v().optional().default(!1),writeTextFile:v().optional().default(!1)}),yt=x({_meta:m(p(),g()).nullish(),name:p(),value:p()}),bt=x({_meta:m(p(),g()).nullish(),name:p(),title:p().nullish(),version:p()}),xt=x({default:f().nullish(),description:p().nullish(),maximum:f().nullish(),minimum:f().nullish(),title:p().nullish()}),St=x({_meta:m(p(),g()).nullish()}),Ct=x({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cursor:p().nullish(),cwd:p().nullish()}),wt=x({_meta:m(p(),g()).nullish()}),Tt=x({_meta:m(p(),g()).nullish(),logout:wt.nullish()}),Et=x({_meta:m(p(),g()).nullish()}),Dt=x({_meta:m(p(),g()).nullish()}),Ot=x({_meta:m(p(),g()).nullish(),http:v().optional().default(!1),sse:v().optional().default(!1)}),kt=x({_meta:m(p(),g()).nullish(),headers:h(yt),name:p(),url:p()}),At=x({_meta:m(p(),g()).nullish(),headers:h(yt),name:p(),url:p()}),jt=x({_meta:m(p(),g()).nullish(),args:h(p()),command:p(),env:h(pt),name:p()}),D=_([kt.and(x({type:b(`http`)})),At.and(x({type:b(`sse`)})),jt]),O=p(),Mt=x({_meta:m(p(),g()).nullish(),description:p().nullish(),modelId:O,name:p()}),Nt=_([b(`error`),b(`warning`),b(`information`),b(`hint`)]),Pt=x({_meta:m(p(),g()).nullish()}),Ft=x({_meta:m(p(),g()).nullish()}),It=x({_meta:m(p(),g()).nullish()}),Lt=x({_meta:m(p(),g()).nullish()}),Rt=x({_meta:m(p(),g()).nullish()}),zt=x({_meta:m(p(),g()).nullish(),maxCount:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish()}),Bt=x({diff:p(),uri:p()}),Vt=x({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()}),Ht=x({_meta:m(p(),g()).nullish()}),Ut=x({_meta:m(p(),g()).nullish()}),Wt=x({languageId:p(),text:p(),uri:p()}),Gt=x({_meta:m(p(),g()).nullish(),maxCount:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish()}),Kt=_([b(`rejected`),b(`ignored`),b(`replaced`),b(`cancelled`)]),qt=x({excerpts:h(Vt),uri:p()}),Jt=x({_meta:m(p(),g()).nullish()}),Yt=x({_meta:m(p(),g()).nullish()}),Xt=x({name:p(),owner:p(),remoteUrl:p()}),Zt=x({_meta:m(p(),g()).nullish()}),Qt=x({_meta:m(p(),g()).nullish(),jump:Ht.nullish(),rename:Yt.nullish(),searchAndReplace:Zt.nullish()}),$t=x({id:p(),isRegex:v().nullish(),replace:p(),search:p(),uri:p()}),en=_([b(`automatic`),b(`diagnostic`),b(`manual`)]),tn=x({_meta:m(p(),g()).nullish(),maxCount:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish()}),nn=x({_meta:m(p(),g()).nullish(),diagnostics:Pt.nullish(),editHistory:zt.nullish(),openFiles:Ut.nullish(),recentFiles:Gt.nullish(),relatedSnippets:Jt.nullish(),userActions:tn.nullish()}),rn=x({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cwd:p(),mcpServers:h(D)}),an=x({default:f().nullish(),description:p().nullish(),maximum:f().nullish(),minimum:f().nullish(),title:p().nullish()}),on=p(),sn=_([b(`allow_once`),b(`allow_always`),b(`reject_once`),b(`reject_always`)]),cn=x({_meta:m(p(),g()).nullish(),kind:sn,name:p(),optionId:on}),ln=_([b(`high`),b(`medium`),b(`low`)]),un=_([b(`pending`),b(`in_progress`),b(`completed`)]),dn=x({_meta:m(p(),g()).nullish(),content:p(),priority:ln,status:un}),fn=x({_meta:m(p(),g()).nullish(),entries:h(dn)}),k=x({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`})}),pn=x({id:p(),position:k,uri:p()}),mn=x({id:p(),newName:p(),position:k,uri:p()}),hn=x({action:p(),position:k,timestampMs:f(),uri:p()}),gn=_([b(`utf-16`),b(`utf-32`),b(`utf-8`)]),_n=x({_meta:m(p(),g()).nullish(),auth:He.optional().default({terminal:!1}),elicitation:dt.nullish(),fs:vt.optional().default({readTextFile:!1,writeTextFile:!1}),nes:Qt.nullish(),positionEncodings:h(gn).optional(),terminal:v().optional().default(!1)}),vn=x({_meta:m(p(),g()).nullish(),audio:v().optional().default(!1),embeddedContext:v().optional().default(!1),image:v().optional().default(!1)}),yn=f().int().gte(0).lte(65535),bn=x({_meta:m(p(),g()).nullish(),clientCapabilities:_n.optional().default({auth:{terminal:!1},fs:{readTextFile:!1,writeTextFile:!1},terminal:!1}),clientInfo:bt.nullish(),protocolVersion:yn}),A=x({end:k,start:k}),xn=x({message:p(),range:A,severity:Nt,uri:p()}),Sn=x({languageId:p(),lastFocusedMs:f().nullish(),uri:p(),visibleRange:A.nullish()}),Cn=x({_meta:m(p(),g()).nullish(),diagnostics:h(xn).nullish(),editHistory:h(Bt).nullish(),openFiles:h(Sn).nullish(),recentFiles:h(Wt).nullish(),relatedSnippets:h(qt).nullish(),userActions:h(hn).nullish()}),wn=x({newText:p(),range:A}),Tn=_([x({cursorPosition:k.nullish(),edits:h(wn),id:p(),uri:p()}).and(x({kind:b(`edit`)})),pn.and(x({kind:b(`jump`)})),mn.and(x({kind:b(`rename`)})),$t.and(x({kind:b(`searchAndReplace`)}))]),En=x({_meta:m(p(),g()).nullish(),content:p()}),Dn=x({_meta:m(p(),g()).nullish()}),j=_([f(),p()]).nullable();x({_meta:m(p(),g()).nullish(),requestId:j});var On=x({requestId:j}),kn=te([`assistant`,`user`]),M=x({_meta:m(p(),g()).nullish(),audience:h(kn).nullish(),lastModified:p().nullish(),priority:f().nullish()}),An=x({_meta:m(p(),g()).nullish(),annotations:M.nullish(),data:p(),mimeType:p()}),jn=x({_meta:m(p(),g()).nullish(),annotations:M.nullish(),data:p(),mimeType:p(),uri:p().nullish()}),Mn=x({_meta:m(p(),g()).nullish(),annotations:M.nullish(),description:p().nullish(),mimeType:p().nullish(),name:p(),size:f().nullish(),title:p().nullish(),uri:p()}),Nn=x({_meta:m(p(),g()).nullish(),optionId:on}),Pn=_([x({outcome:b(`cancelled`)}),Nn.and(x({outcome:b(`selected`)}))]),Fn=x({_meta:m(p(),g()).nullish(),outcome:Pn}),In=x({_meta:m(p(),g()).nullish()}),Ln=x({_meta:m(p(),g()).nullish()}),Rn=x({currentValue:v()}),zn=p(),Bn=p(),Vn=_([b(`mode`),b(`model`),b(`thought_level`),p()]),N=p(),Hn=x({_meta:m(p(),g()).nullish(),description:p().nullish(),name:p(),value:N}),Un=x({_meta:m(p(),g()).nullish(),group:zn,name:p(),options:h(Hn)}),P=y(_([x({currentValue:N,options:_([h(Hn),h(Un)])}).and(x({type:b(`select`)})),Rn.and(x({type:b(`boolean`)}))]),x({_meta:m(p(),g()).nullish(),category:Vn.nullish(),description:p().nullish(),id:Bn,name:p()})),Wn=x({_meta:m(p(),g()).nullish(),configOptions:h(P)}),Gn=x({_meta:m(p(),g()).nullish()}),F=p(),Kn=x({_meta:m(p(),g()).nullish(),id:p(),sessionId:F}),qn=x({_meta:m(p(),g()).nullish(),sessionId:F}),Jn=x({_meta:m(p(),g()).nullish(),sessionId:F}),Yn=x({_meta:m(p(),g()).nullish(),sessionId:F}),Xn=x({_meta:m(p(),g()).nullish(),args:h(p()).optional(),command:p(),cwd:p().nullish(),env:h(pt).optional(),outputByteLimit:f().nullish(),sessionId:F}),Zn=x({_meta:m(p(),g()).nullish(),sessionId:F,uri:p()}),Qn=x({_meta:m(p(),g()).nullish(),position:k,sessionId:F,uri:p(),version:f(),visibleRange:A}),$n=x({_meta:m(p(),g()).nullish(),languageId:p(),sessionId:F,text:p(),uri:p(),version:f()}),er=x({_meta:m(p(),g()).nullish(),sessionId:F,uri:p()}),tr=x({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cwd:p(),mcpServers:h(D).optional(),sessionId:F}),nr=x({_meta:m(p(),g()).nullish(),sessionId:F,terminalId:p()}),rr=x({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cwd:p(),mcpServers:h(D),sessionId:F}),ir=x({_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:F}),ar=x({_meta:m(p(),g()).nullish(),id:p(),reason:Kt.nullish(),sessionId:F}),or=x({_meta:m(p(),g()).nullish(),sessionId:F,terminalId:p()}),sr=x({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cwd:p(),mcpServers:h(D).optional(),sessionId:F}),cr=x({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cwd:p(),sessionId:F,title:p().nullish(),updatedAt:p().nullish()}),lr=x({_meta:m(p(),g()).nullish(),nextCursor:p().nullish(),sessions:h(cr)}),ur=x({_meta:m(p(),g()).nullish(),title:p().nullish(),updatedAt:p().nullish()}),dr=x({_meta:m(p(),g()).nullish()}),I=p(),fr=x({_meta:m(p(),g()).nullish(),currentModeId:I}),pr=x({_meta:m(p(),g()).nullish(),description:p().nullish(),id:I,name:p()}),L=x({_meta:m(p(),g()).nullish(),availableModes:h(pr),currentModeId:I}),R=x({_meta:m(p(),g()).nullish(),availableModels:h(Mt),currentModelId:O}),mr=x({_meta:m(p(),g()).nullish(),configOptions:h(P).nullish(),models:R.nullish(),modes:L.nullish(),sessionId:F}),hr=x({_meta:m(p(),g()).nullish(),configOptions:h(P).nullish(),models:R.nullish(),modes:L.nullish()}),gr=x({_meta:m(p(),g()).nullish(),configOptions:h(P).nullish(),models:R.nullish(),modes:L.nullish(),sessionId:F}),_r=x({_meta:m(p(),g()).nullish(),configOptions:h(P).nullish(),models:R.nullish(),modes:L.nullish()}),vr=x({_meta:m(p(),g()).nullish()}),yr=x({_meta:m(p(),g()).nullish(),additionalDirectories:In.nullish(),close:Ln.nullish(),fork:Gn.nullish(),list:dr.nullish(),resume:vr.nullish()}),br=y(_([x({type:b(`boolean`),value:v()}),x({value:N})]),x({_meta:m(p(),g()).nullish(),configId:Bn,sessionId:F})),xr=x({_meta:m(p(),g()).nullish(),configOptions:h(P)}),Sr=x({_meta:m(p(),g()).nullish(),modeId:I,sessionId:F}),Cr=x({_meta:m(p(),g()).nullish()}),wr=x({_meta:m(p(),g()).nullish(),modelId:O,sessionId:F}),Tr=x({_meta:m(p(),g()).nullish()}),Er=x({_meta:m(p(),g()).nullish(),sessionId:F}),Dr=_([b(`end_turn`),b(`max_tokens`),b(`max_turn_requests`),b(`refusal`),b(`cancelled`)]),Or=_([b(`email`),b(`uri`),b(`date`),b(`date-time`)]),kr=x({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(ft).nullish(),pattern:p().nullish(),title:p().nullish()}),Ar=x({_meta:m(p(),g()).nullish(),context:Cn.nullish(),position:k,selection:A.nullish(),sessionId:F,triggerKind:en,uri:p(),version:f()}),jr=x({_meta:m(p(),g()).nullish(),suggestions:h(Tn)}),Mr=x({_meta:m(p(),g()).nullish(),terminalId:p()}),Nr=x({_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=x({_meta:m(p(),g()).nullish(),sessionId:F,terminalId:p()}),Fr=x({_meta:m(p(),g()).nullish(),exitStatus:Nr.nullish(),output:p(),truncated:v()}),Ir=x({_meta:m(p(),g()).nullish(),annotations:M.nullish(),text:p()}),Lr=x({range:A.nullish(),text:p()}),Rr=x({_meta:m(p(),g()).nullish(),contentChanges:h(Lr),sessionId:F,uri:p(),version:f()});x({method:p(),params:_([qn,$n,Rr,Zn,er,Qn,Kn,ar,ht]).nullish()});var zr=_([b(`full`),b(`incremental`)]),Br=x({_meta:m(p(),g()).nullish(),syncKind:zr}),Vr=x({_meta:m(p(),g()).nullish(),didChange:Br.nullish(),didClose:Ft.nullish(),didFocus:It.nullish(),didOpen:Lt.nullish(),didSave:Rt.nullish()}),Hr=x({_meta:m(p(),g()).nullish(),document:Vr.nullish()}),Ur=x({_meta:m(p(),g()).nullish(),context:nn.nullish(),events:Hr.nullish()}),Wr=x({_meta:m(p(),g()).nullish(),auth:Tt.optional().default({}),loadSession:v().optional().default(!1),mcpCapabilities:Ot.optional().default({http:!1,sse:!1}),nes:Ur.nullish(),positionEncoding:gn.nullish(),promptCapabilities:vn.optional().default({audio:!1,embeddedContext:!1,image:!1}),sessionCapabilities:yr.optional().default({})}),Gr=x({_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:bt.nullish(),authMethods:h(qe).optional().default([]),protocolVersion:yn}),Kr=_([x({_meta:m(p(),g()).nullish(),mimeType:p().nullish(),text:p(),uri:p()}),Xe]),qr=x({_meta:m(p(),g()).nullish(),annotations:M.nullish(),resource:Kr}),z=_([Ir.and(x({type:b(`text`)})),jn.and(x({type:b(`image`)})),An.and(x({type:b(`audio`)})),Mn.and(x({type:b(`resource_link`)})),qr.and(x({type:b(`resource`)}))]),Jr=x({_meta:m(p(),g()).nullish(),content:z}),B=x({_meta:m(p(),g()).nullish(),content:z,messageId:p().nullish()}),Yr=x({_meta:m(p(),g()).nullish(),messageId:p().nullish(),prompt:h(z),sessionId:F}),Xr=x({anyOf:h(ft)}),Zr=_([Jr.and(x({type:b(`content`)})),nt.and(x({type:b(`diff`)})),Mr.and(x({type:b(`terminal`)}))]),V=p(),Qr=x({sessionId:F,toolCallId:V.nullish()}),$r=y(_([Qr,On]),x({elicitationId:ot,url:p().url()})),ei=x({_meta:m(p(),g()).nullish(),line:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),path:p()}),ti=_([b(`pending`),b(`in_progress`),b(`completed`),b(`failed`)]),ni=_([b(`read`),b(`edit`),b(`delete`),b(`move`),b(`search`),b(`execute`),b(`think`),b(`fetch`),b(`switch_mode`),b(`other`)]),ri=x({_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:V}),ii=x({_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:V}),ai=x({_meta:m(p(),g()).nullish(),options:h(cn),sessionId:F,toolCall:ii}),oi=x({_meta:m(p(),g()).nullish(),hint:p()}),si=x({_meta:m(p(),g()).nullish(),description:p(),input:oi.nullish(),name:p()}),ci=x({_meta:m(p(),g()).nullish(),availableCommands:h(si)}),li=_([x({enum:h(p()),type:lt}),Xr]),ui=x({default:h(p()).nullish(),description:p().nullish(),items:li,maxItems:f().nullish(),minItems:f().nullish(),title:p().nullish()}),di=_([kr.and(x({type:b(`string`)})),an.and(x({type:b(`number`)})),xt.and(x({type:b(`integer`)})),Ze.and(x({type:b(`boolean`)})),ui.and(x({type:b(`array`)}))]),fi=x({description:p().nullish(),properties:m(p(),di).optional().default({}),required:h(p()).nullish(),title:p().nullish(),type:ct.optional().default(`object`)}),pi=y(_([y(_([Qr,On]),x({requestedSchema:fi})).and(x({mode:b(`form`)})),$r.and(x({mode:b(`url`)}))]),x({_meta:m(p(),g()).nullish(),message:p()})),mi=x({cachedReadTokens:f().nullish(),cachedWriteTokens:f().nullish(),inputTokens:f(),outputTokens:f(),thoughtTokens:f().nullish(),totalTokens:f()});_([x({id:j,result:_([Gr,Ye,Dt,gr,hr,lr,mr,_r,$e,Cr,xr,x({_meta:m(p(),g()).nullish(),stopReason:Dr,usage:mi.nullish(),userMessageId:p().nullish()}),Tr,Er,jr,Qe,_t])}),x({error:mt,id:j})]);var hi=x({_meta:m(p(),g()).nullish(),cost:et.nullish(),size:f(),used:f()}),gi=_([B.and(x({sessionUpdate:b(`user_message_chunk`)})),B.and(x({sessionUpdate:b(`agent_message_chunk`)})),B.and(x({sessionUpdate:b(`agent_thought_chunk`)})),ri.and(x({sessionUpdate:b(`tool_call`)})),ii.and(x({sessionUpdate:b(`tool_call_update`)})),fn.and(x({sessionUpdate:b(`plan`)})),ci.and(x({sessionUpdate:b(`available_commands_update`)})),fr.and(x({sessionUpdate:b(`current_mode_update`)})),Wn.and(x({sessionUpdate:b(`config_option_update`)})),ur.and(x({sessionUpdate:b(`session_info_update`)})),hi.and(x({sessionUpdate:b(`usage_update`)}))]),_i=x({_meta:m(p(),g()).nullish(),sessionId:F,update:gi});x({method:p(),params:_([_i,st,ht]).nullish()});var vi=x({_meta:m(p(),g()).nullish(),sessionId:F,terminalId:p()}),yi=x({_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=x({name:p(),uri:p()}),xi=x({_meta:m(p(),g()).nullish(),repository:Xt.nullish(),workspaceFolders:h(bi).nullish(),workspaceUri:p().nullish()});x({id:j,method:p(),params:_([bn,Je,Et,rn,rr,Ct,tr,sr,Yn,Sr,br,Yr,wr,xi,Ar,Jn,gt]).nullish()});var Si=x({_meta:m(p(),g()).nullish(),content:p(),path:p(),sessionId:F});x({id:j,method:p(),params:_([Si,ir,ai,Xn,Pr,or,vi,nr,pi,gt]).nullish()}),_([x({id:j,result:_([x({_meta:m(p(),g()).nullish()}),En,Fn,tt,Fr,Dn,yi,St,it,_t])}),x({error:mt,id:j})]),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
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()}}})}}ne();var wi,H=new WeakMap,Ti=class{constructor(e,t){l(this,H,void 0);let n=e(this);u(H,this,new ji(async(e,t)=>{switch(e){case T.initialize:{let e=bn.parse(t);return n.initialize(e)}case T.session_new:{let e=rn.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=Ct.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=Je.parse(t);return await n.authenticate(e)??{}}case T.logout:{if(!n.unstable_logout)throw Z.methodNotFound(e);let r=Et.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(H,this).sendNotification(E.session_update,e)}async requestPermission(e){return await c(H,this).sendRequest(E.session_request_permission,e)}async readTextFile(e){return await c(H,this).sendRequest(E.fs_read_text_file,e)}async writeTextFile(e){return await c(H,this).sendRequest(E.fs_write_text_file,e)??{}}async createTerminal(e){return new Ei((await c(H,this).sendRequest(E.terminal_create,e)).terminalId,e.sessionId,c(H,this))}async unstable_createElicitation(e){return await c(H,this).sendRequest(E.elicitation_create,e)}async unstable_completeElicitation(e){return await c(H,this).sendNotification(E.elicitation_complete,e)}async extMethod(e,t){return await c(H,this).sendRequest(e,t)}async extNotification(e,t){return await c(H,this).sendNotification(e,t)}get signal(){return c(H,this).signal}get closed(){return c(H,this).closed}},U=new WeakMap,W=new WeakMap;wi=Symbol.asyncDispose;var Ei=class{constructor(e,n,r){t(this,`id`,void 0),l(this,U,void 0),l(this,W,void 0),this.id=e,u(U,this,n),u(W,this,r)}async currentOutput(){return await c(W,this).sendRequest(E.terminal_output,{sessionId:c(U,this),terminalId:this.id})}async waitForExit(){return await c(W,this).sendRequest(E.terminal_wait_for_exit,{sessionId:c(U,this),terminalId:this.id})}async kill(){return await c(W,this).sendRequest(E.terminal_kill,{sessionId:c(U,this),terminalId:this.id})??{}}async release(){return await c(W,this).sendRequest(E.terminal_release,{sessionId:c(U,this),terminalId:this.id})??{}}async[wi](){await this.release()}},G=new WeakMap,Di=new WeakMap,Oi=new WeakMap,ki=new WeakMap,K=new WeakMap,q=new WeakMap,J=new WeakMap,Ai=new WeakMap,Y=new WeakSet,ji=class{constructor(e,t,r){a(this,Y),l(this,G,new Map),l(this,Di,0),l(this,Oi,void 0),l(this,ki,void 0),l(this,K,void 0),l(this,q,Promise.resolve()),l(this,J,new AbortController),l(this,Ai,void 0),u(Oi,this,e),u(ki,this,t),u(K,this,r),u(Ai,this,new Promise(e=>{c(J,this).signal.addEventListener(`abort`,()=>e())})),n(Y,this,Mi).call(this)}get signal(){return c(J,this).signal}get closed(){return c(Ai,this)}async sendRequest(e,t){var r,i;n(Y,this,Ri).call(this);let a=(u(Di,this,(r=c(Di,this),i=r++,r)),i),o=new Promise((e,t)=>{c(G,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,Ri).call(this),await n(Y,this,X).call(this,{jsonrpc:`2.0`,method:e,params:t})}};async function Mi(){let e;try{let e=c(K,this).readable.getReader();try{for(;!c(J,this).signal.aborted;){let{value:t,done:r}=await e.read();if(r)break;if(t)try{n(Y,this,Pi).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,Ni).call(this,e)}}function Ni(e){if(c(J,this).signal.aborted)return;let t=e??Error(`ACP connection closed`);for(let e of c(G,this).values())e.reject(t);c(G,this).clear(),c(J,this).abort(t)}async function Pi(e){if(`method`in e&&`id`in e){let t=await n(Y,this,Fi).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,Ii).call(this,e.method,e.params);`error`in t&&console.error(`Error handling notification`,e,t.error)}else `id`in e?n(Y,this,Li).call(this,e):console.error(`Invalid message`,{message:e})}async function Fi(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 ee)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 Ii(e,t){try{return await c(ki,this).call(this,e,t),{result:null}}catch(e){if(e instanceof Z)return e.toResult();if(e instanceof ee)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 Li(e){let t=c(G,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(G,this).delete(e.id)}else console.error(`Got response to unknown request`,e.id)}function Ri(){if(c(J,this).signal.aborted)throw c(J,this).signal.reason??Error(`ACP connection closed`)}async function X(e){return u(q,this,c(q,this).then(async()=>{let t=c(K,this).writable.getWriter();try{await t.write(e)}finally{t.releaseLock()}}).catch(e=>{n(Y,this,Ni).call(this,e)})),c(q,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}}};ie(),de(),ue(),le(),Ne(),Fe(),De(),we(),pe(),ke(),he(),ve(),Ae();var zi=!(typeof process.geteuid==`function`?process.geteuid()===0:typeof process.getuid==`function`&&process.getuid()===0)||!!process.env.IS_SANDBOX,Bi={auto:`auto`,default:`default`,acceptedits:`acceptEdits`,dontask:`dontAsk`,plan:`plan`,bypasspermissions:`bypassPermissions`,bypass:`bypassPermissions`};function Vi(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=Bi[n];if(!r)throw Error(`Invalid ${t}: ${e}.`);if(r===`bypassPermissions`&&!zi)throw Error(`Invalid ${t}: bypassPermissions is not available when running as root.`);return r}function Hi(e){let t=[...e.mcpServers??[]].sort((e,t)=>e.name.localeCompare(t.name));return JSON.stringify({cwd:e.cwd,mcpServers:t})}var Ui=256;function Wi(e){let t=e.replace(/[\r\n]+/g,` `).replace(/\s+/g,` `).trim();return t.length<=Ui?t:t.slice(0,Ui-1)+`…`}function Gi(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 Ki(e){let t="```";for(let n of e.matchAll(/^```+/gm)??[])for(;n[0].length>=t.length;)t+="`";return t+`
3
+ `,i=e.getWriter();try{await i.write(n.encode(r))}finally{i.releaseLock()}}})}}ne();var wi,H=new WeakMap,Ti=class{constructor(e,t){l(this,H,void 0);let n=e(this);u(H,this,new ji(async(e,t)=>{switch(e){case T.initialize:{let e=bn.parse(t);return n.initialize(e)}case T.session_new:{let e=rn.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=Ct.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=Je.parse(t);return await n.authenticate(e)??{}}case T.logout:{if(!n.unstable_logout)throw Z.methodNotFound(e);let r=Et.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(H,this).sendNotification(E.session_update,e)}async requestPermission(e){return await c(H,this).sendRequest(E.session_request_permission,e)}async readTextFile(e){return await c(H,this).sendRequest(E.fs_read_text_file,e)}async writeTextFile(e){return await c(H,this).sendRequest(E.fs_write_text_file,e)??{}}async createTerminal(e){return new Ei((await c(H,this).sendRequest(E.terminal_create,e)).terminalId,e.sessionId,c(H,this))}async unstable_createElicitation(e){return await c(H,this).sendRequest(E.elicitation_create,e)}async unstable_completeElicitation(e){return await c(H,this).sendNotification(E.elicitation_complete,e)}async extMethod(e,t){return await c(H,this).sendRequest(e,t)}async extNotification(e,t){return await c(H,this).sendNotification(e,t)}get signal(){return c(H,this).signal}get closed(){return c(H,this).closed}},U=new WeakMap,W=new WeakMap;wi=Symbol.asyncDispose;var Ei=class{constructor(e,n,r){t(this,`id`,void 0),l(this,U,void 0),l(this,W,void 0),this.id=e,u(U,this,n),u(W,this,r)}async currentOutput(){return await c(W,this).sendRequest(E.terminal_output,{sessionId:c(U,this),terminalId:this.id})}async waitForExit(){return await c(W,this).sendRequest(E.terminal_wait_for_exit,{sessionId:c(U,this),terminalId:this.id})}async kill(){return await c(W,this).sendRequest(E.terminal_kill,{sessionId:c(U,this),terminalId:this.id})??{}}async release(){return await c(W,this).sendRequest(E.terminal_release,{sessionId:c(U,this),terminalId:this.id})??{}}async[wi](){await this.release()}},G=new WeakMap,Di=new WeakMap,Oi=new WeakMap,ki=new WeakMap,K=new WeakMap,q=new WeakMap,J=new WeakMap,Ai=new WeakMap,Y=new WeakSet,ji=class{constructor(e,t,r){a(this,Y),l(this,G,new Map),l(this,Di,0),l(this,Oi,void 0),l(this,ki,void 0),l(this,K,void 0),l(this,q,Promise.resolve()),l(this,J,new AbortController),l(this,Ai,void 0),u(Oi,this,e),u(ki,this,t),u(K,this,r),u(Ai,this,new Promise(e=>{c(J,this).signal.addEventListener(`abort`,()=>e())})),n(Y,this,Mi).call(this)}get signal(){return c(J,this).signal}get closed(){return c(Ai,this)}async sendRequest(e,t){var r,i;n(Y,this,Ri).call(this);let a=(u(Di,this,(r=c(Di,this),i=r++,r)),i),o=new Promise((e,t)=>{c(G,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,Ri).call(this),await n(Y,this,X).call(this,{jsonrpc:`2.0`,method:e,params:t})}};async function Mi(){let e;try{let e=c(K,this).readable.getReader();try{for(;!c(J,this).signal.aborted;){let{value:t,done:r}=await e.read();if(r)break;if(t)try{n(Y,this,Pi).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,Ni).call(this,e)}}function Ni(e){if(c(J,this).signal.aborted)return;let t=e??Error(`ACP connection closed`);for(let e of c(G,this).values())e.reject(t);c(G,this).clear(),c(J,this).abort(t)}async function Pi(e){if(`method`in e&&`id`in e){let t=await n(Y,this,Fi).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,Ii).call(this,e.method,e.params);`error`in t&&console.error(`Error handling notification`,e,t.error)}else `id`in e?n(Y,this,Li).call(this,e):console.error(`Invalid message`,{message:e})}async function Fi(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 ee)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 Ii(e,t){try{return await c(ki,this).call(this,e,t),{result:null}}catch(e){if(e instanceof Z)return e.toResult();if(e instanceof ee)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 Li(e){let t=c(G,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(G,this).delete(e.id)}else console.error(`Got response to unknown request`,e.id)}function Ri(){if(c(J,this).signal.aborted)throw c(J,this).signal.reason??Error(`ACP connection closed`)}async function X(e){return u(q,this,c(q,this).then(async()=>{let t=c(K,this).writable.getWriter();try{await t.write(e)}finally{t.releaseLock()}}).catch(e=>{n(Y,this,Ni).call(this,e)})),c(q,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}}};ie(),de(),ue(),le(),Ne(),Fe(),Te(),_e(),we(),De(),he(),ve(),Oe();var zi=!(typeof process.geteuid==`function`?process.geteuid()===0:typeof process.getuid==`function`&&process.getuid()===0)||!!process.env.IS_SANDBOX,Bi={auto:`auto`,default:`default`,acceptedits:`acceptEdits`,dontask:`dontAsk`,plan:`plan`,bypasspermissions:`bypassPermissions`,bypass:`bypassPermissions`};function Vi(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=Bi[n];if(!r)throw Error(`Invalid ${t}: ${e}.`);if(r===`bypassPermissions`&&!zi)throw Error(`Invalid ${t}: bypassPermissions is not available when running as root.`);return r}function Hi(e){let t=[...e.mcpServers??[]].sort((e,t)=>e.name.localeCompare(t.name));return JSON.stringify({cwd:e.cwd,mcpServers:t})}var Ui=256;function Wi(e){let t=e.replace(/[\r\n]+/g,` `).replace(/\s+/g,` `).trim();return t.length<=Ui?t:t.slice(0,Ui-1)+`…`}function Gi(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 Ki(e){let t="```";for(let n of e.matchAll(/^```+/gm)??[])for(;n[0].length>=t.length;)t+="`";return t+`
4
4
  `+e+(e.endsWith(`
5
5
  `)?``:`
6
6
  `)+t}var qi=console;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?Gi(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?Gi(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?Gi(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 Ji(e,t,n=!1){if(!t)return{};let r=e.is_error===!0,i=e.content;if(r&&i)return Yi(i,!0);switch(t.name){case`Read`:return typeof i==`string`&&i.length>0?{content:[{type:`content`,content:{type:`text`,text:Ki(i)}}]}:Array.isArray(i)&&i.length>0?{content:i.map(e=>({type:`content`,content:e.type===`text`?{type:`text`,text:Ki(e.text)}:Xi(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(`
@@ -11,4 +11,4 @@ import{n as e,t}from"./defineProperty-80gRi2ZW.js";import{a as n,c as r,i,l as a
11
11
  Compacting completed.`}}}));break;case`result`:{let t=h.usage;t&&(l.inputTokens+=t.input_tokens??0,l.outputTokens+=t.output_tokens??0,l.cachedReadTokens+=t.cache_read_input_tokens??0,l.cachedWriteTokens+=t.cache_creation_input_tokens??0);let i=h.modelUsage;if(i&&d){let e=ia(i,d);e?.contextWindow&&(f=e.contextWindow)}let a=u??l.inputTokens+l.outputTokens+l.cachedReadTokens+l.cachedWriteTokens,o=h.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=h.subtype,p=h.is_error;if(r.aborted){c=`cancelled`;break}switch(s){case`success`:h.stop_reason===`max_tokens`&&(c=`max_tokens`),p&&(c=`end_turn`);break;case`error_during_execution`:c=h.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=ea(h,e,i,n,{clientCapabilities:a,cwd:o});for(let e of t)await n.sessionUpdate(e);p=!0;break}case`assistant`:{let t=h.message,r=h.parent_tool_use_id;if(t?.usage&&r===null){let e=t.usage;u=(typeof e.input_tokens==`number`?e.input_tokens:0)+(typeof e.output_tokens==`number`?e.output_tokens:0)+(typeof e.cache_read_input_tokens==`number`?e.cache_read_input_tokens:0)+(typeof e.cache_creation_input_tokens==`number`?e.cache_creation_input_tokens:0)}r===null&&t?.model&&t.model!==`<synthetic>`&&(d=t.model);let s=$i(h,e,i,n,{clientCapabilities:a,cwd:o,parentToolUseId:r,streamingActive:p});for(let e of s)await n.sessionUpdate(e);break}case`user`:break;case`progress`:{let t=h.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
12
 
13
13
  Compacting completed.`}}});break;default:qi.debug(`Ignoring unknown SDK message type`);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 $i(e,t,n,r,i){let a=e.message;if(!a)return[];let o=a.content;if(!o)return[];if(typeof o==`string`)return[{sessionId:t,update:{sessionUpdate:`agent_message_chunk`,content:{type:`text`,text:o}}}];let s=i?.streamingActive?o.filter(e=>e.type!==`text`&&e.type!==`thinking`):o;return s.length===0?[]:$(s,`assistant`,t,n,r,void 0,i)}function ea(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:ta(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=Ji(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 ta(e){return e===`in_progress`?`in_progress`:e===`completed`?`completed`:`pending`}async function na(e,t,n,r,i,a){for(let o of t){let t=o;if(t.type!==`user`&&t.type!==`assistant`){qi.debug(`Ignoring unknown SDK message type`);continue}if(t.isMeta===!0)continue;let s=t.message?.content;if(!s)continue;let c=t.type===`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 ra(e,t){let n=0,r=Math.min(e.length,t.length);for(;n<r&&e[n]===t[n];)n++;return n}function ia(e,t){let n=null,r=0;for(let i of Object.keys(e)){let e=ra(i,t);e>r&&(r=e,n=i)}return n?e[n]??null:null}function aa(e,t,n,r,i,a,o){return async(n,s,c,l,u,d)=>{let f=sa(r);if(n.name===`ExitPlanMode`)return oa(e,t,u,s,f,i,a,o);if(d!==void 0)return d;try{let e=await ge(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 oa(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 sa(e){if(!e)return!1;let t=e._meta;return!t||typeof t!=`object`?!1:t.terminal_output===!0}function ca(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(la(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 la(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`}Se(),oe(),_e(),e();var ua=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 me({dir:e.cwd??void 0,limit:100}),n=[];for(let e of t)e.cwd&&n.push({sessionId:e.sessionId,cwd:e.cwd,title:Wi(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=ca(e.prompt);if(!n.trim())return{stopReason:`end_turn`};let r=t.cancelGeneration;if(t.promptRunning){let e=ze();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(),S(e.sessionId,re());let r=t.queryEngine.submitMessage(n),{stopReason:i,usage:a}=await Qi(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=Sa(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??ze(),r=e.cwd;S(n,re()),C(r);let i=process.cwd(),a=!1;try{process.chdir(r),a=!0}catch{}try{let i=Pe(),a=ye(i),o=e._meta,s=ga(o,`permissionMode`),c=s?o?.permissionMode:void 0,l=this.getSetting(`permissions.defaultMode`),u=pa(c,s,l),d=aa(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=_a(l),p={...Me(),toolPermissionContext:{...i,mode:u,isBypassPermissionsModeAvailable:f}},[m,h]=await Promise.all([Ee(r),Oe(r)]);p.agentDefinitions=h;let g=new Le({cwd:r,tools:a,commands:m,mcpClients:[],agents:h.activeAgents,canUseTool:d,getAppState:()=>p,setAppState:e=>{let t=e(p);Object.assign(p,t)},readFileCache:new Ie(500,50*1024*1024),includePartialMessages:!0,replayUserMessages:!0,initialMessages:t.initialMessages}),_={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`}]},ee=Ce(),v=ae(),y={availableModels:ee.map(e=>({modelId:String(e.value??``),name:e.label??String(e.value??``),description:e.description??void 0})),currentModelId:v};g.setModel(v);let b=wa(_,y),te={queryEngine:g,cancelled:!1,cancelGeneration:0,cwd:r,modes:_,models:y,configOptions:b,promptRunning:!1,pendingMessages:new Map,pendingQueue:[],pendingQueueHead:0,toolUseCache:{},clientCapabilities:this.clientCapabilities,appState:p,commands:m,sessionFingerprint:Hi({cwd:r,mcpServers:e.mcpServers})};return this.sessions.set(n,te),{sessionId:n,models:y,modes:_,configOptions:b}}finally{a&&process.chdir(i)}}async getOrCreateSession(e){let t=this.sessions.get(e.sessionId);if(t){if(Hi({cwd:e.cwd,mcpServers:e.mcpServers})===t.sessionFingerprint){let n=await fe(e.sessionId,e.cwd);return S(e.sessionId,n?Re(n.filePath):null),C(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?Re(n.filePath):null;S(e.sessionId,r),C(e.cwd);let i;if(n)try{let t=await be(e.sessionId);t&&t.messages.length>0&&(i=Te(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 na(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 be(e.sessionId);if(!t||t.messages.length===0)return;let n=Te(t.messages);if(n.length===0)return;let r=this.sessions.get(e.sessionId);if(!r)return;await na(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(!fa(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=se();return e.split(`.`).reduce((e,t)=>{if(!(!e||typeof e!=`object`))return e[t]},t)}},da=[`auto`,`default`,`acceptEdits`,`bypassPermissions`,`dontAsk`,`plan`];function fa(e){return da.includes(e)}function pa(e,t,n){if(t){let t=ma(e,`_meta.permissionMode`);if(t===`bypassPermissions`&&!_a(n))throw Error(`Mode not available: bypassPermissions requires a local ACP bypass opt-in.`);return t}return ha(n)??`default`}function ma(e,t){if(e==null)throw Error(`Invalid ${t}: expected a string.`);return Vi(e,t)}function ha(e){if(e!=null)try{return Vi(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 ga(e,t){return!!e&&Object.hasOwn(e,t)}function _a(e){return va()&&(ya()||ba(e))}function va(){return process.env.IS_SANDBOX?!0:typeof process.geteuid==`function`?process.geteuid()!==0:typeof process.getuid==`function`?process.getuid()!==0:!0}function ya(){return process.env.ACP_PERMISSION_MODE===`bypassPermissions`||xa(process.env.CLAUDE_CODE_ACP_ALLOW_BYPASS_PERMISSIONS)}function ba(e){try{return Vi(e)===`bypassPermissions`}catch{return!1}}function xa(e){return e===`1`||e?.toLowerCase()===`true`}function Sa(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),Ca(e),n}Ca(e)}function Ca(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 wa(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}))}]}ue(),xe();function Ta(e,t){let n=Be.toWeb(e);return Ci(Ve.toWeb(t),n)}async function Ea(){ce(),je();let e=Ta(process.stdin,process.stdout),t,n=new Ti(e=>(t=new ua(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{Ea as runAcpAgent};
14
+ `)}function la(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`}xe(),oe(),pe(),e();var ua=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 me({dir:e.cwd??void 0,limit:100}),n=[];for(let e of t)e.cwd&&n.push({sessionId:e.sessionId,cwd:e.cwd,title:Wi(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=ca(e.prompt);if(!n.trim())return{stopReason:`end_turn`};let r=t.cancelGeneration;if(t.promptRunning){let e=ze();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(),S(e.sessionId,re());let r=t.queryEngine.submitMessage(n),{stopReason:i,usage:a}=await Qi(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=Sa(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??ze(),r=e.cwd;S(n,re()),C(r);let i=process.cwd(),a=!1;try{process.chdir(r),a=!0}catch{}try{let i=Pe(),a=Se(i),o=e._meta,s=ga(o,`permissionMode`),c=s?o?.permissionMode:void 0,l=this.getSetting(`permissions.defaultMode`),u=pa(c,s,l),d=aa(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=_a(l),p={...je(),toolPermissionContext:{...i,mode:u,isBypassPermissionsModeAvailable:f}},[m,h]=await Promise.all([Ce(r),Ee(r)]);p.agentDefinitions=h;let g=new Le({cwd:r,tools:a,commands:m,mcpClients:[],agents:h.activeAgents,canUseTool:d,getAppState:()=>p,setAppState:e=>{let t=e(p);Object.assign(p,t)},readFileCache:new Ie(500,50*1024*1024),includePartialMessages:!0,replayUserMessages:!0,initialMessages:t.initialMessages}),_={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`}]},ee=Me(),v=ae(),y={availableModels:ee.map(e=>({modelId:String(e.value??``),name:e.label??String(e.value??``),description:e.description??void 0})),currentModelId:v};g.setModel(v);let b=wa(_,y),te={queryEngine:g,cancelled:!1,cancelGeneration:0,cwd:r,modes:_,models:y,configOptions:b,promptRunning:!1,pendingMessages:new Map,pendingQueue:[],pendingQueueHead:0,toolUseCache:{},clientCapabilities:this.clientCapabilities,appState:p,commands:m,sessionFingerprint:Hi({cwd:r,mcpServers:e.mcpServers})};return this.sessions.set(n,te),{sessionId:n,models:y,modes:_,configOptions:b}}finally{a&&process.chdir(i)}}async getOrCreateSession(e){let t=this.sessions.get(e.sessionId);if(t){if(Hi({cwd:e.cwd,mcpServers:e.mcpServers})===t.sessionFingerprint){let n=await fe(e.sessionId,e.cwd);return S(e.sessionId,n?Re(n.filePath):null),C(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?Re(n.filePath):null;S(e.sessionId,r),C(e.cwd);let i;if(n)try{let t=await ye(e.sessionId);t&&t.messages.length>0&&(i=ke(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 na(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 ye(e.sessionId);if(!t||t.messages.length===0)return;let n=ke(t.messages);if(n.length===0)return;let r=this.sessions.get(e.sessionId);if(!r)return;await na(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(!fa(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=se();return e.split(`.`).reduce((e,t)=>{if(!(!e||typeof e!=`object`))return e[t]},t)}},da=[`auto`,`default`,`acceptEdits`,`bypassPermissions`,`dontAsk`,`plan`];function fa(e){return da.includes(e)}function pa(e,t,n){if(t){let t=ma(e,`_meta.permissionMode`);if(t===`bypassPermissions`&&!_a(n))throw Error(`Mode not available: bypassPermissions requires a local ACP bypass opt-in.`);return t}return ha(n)??`default`}function ma(e,t){if(e==null)throw Error(`Invalid ${t}: expected a string.`);return Vi(e,t)}function ha(e){if(e!=null)try{return Vi(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 ga(e,t){return!!e&&Object.hasOwn(e,t)}function _a(e){return va()&&(ya()||ba(e))}function va(){return process.env.IS_SANDBOX?!0:typeof process.geteuid==`function`?process.geteuid()!==0:typeof process.getuid==`function`?process.getuid()!==0:!0}function ya(){return process.env.ACP_PERMISSION_MODE===`bypassPermissions`||xa(process.env.CLAUDE_CODE_ACP_ALLOW_BYPASS_PERMISSIONS)}function ba(e){try{return Vi(e)===`bypassPermissions`}catch{return!1}}function xa(e){return e===`1`||e?.toLowerCase()===`true`}function Sa(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),Ca(e),n}Ca(e)}function Ca(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 wa(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}))}]}ue(),be();function Ta(e,t){let n=Be.toWeb(e);return Ci(Ve.toWeb(t),n)}async function Ea(){ce(),Ae();let e=Ta(process.stdin,process.stdout),t,n=new Ti(e=>(t=new ua(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{Ea as runAcpAgent};
@@ -0,0 +1 @@
1
+ import{a as e,i as t}from"./envLessBridgeConfig-Dg0hNsdi.js";t();export{e as shouldShowAppUpgradeMessage};
@@ -1 +1 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{Cn as t,Ln as n,kt as r,wn as i}from"./schemas-BGAvj1T4.js";import{t as a}from"./v4-f1i_CNUT.js";import{S as o,y as s}from"./paths-Ci1iwL5Y.js";import{n as c,t as l}from"./lazySchema-B0QShMaQ.js";import{i as u,r as d}from"./semver-Di5OaTd5.js";import{r as f,s as p}from"./bridgeEnabled-D9jI6X-w.js";async function m(){let e=await s(`tengu_bridge_repl_v2_config`,_),t=v().safeParse(e);return t.success?t.data:_}async function h(){let e=await m();return e.min_version&&u(`2.7.1`,e.min_version)?`Your version of Claude Code (2.7.1) is too old for Remote Control.\nVersion ${e.min_version} or higher is required. Run \`claude update\` to update.`:null}async function g(){return p()?(await m()).should_show_app_upgrade_message:!1}var _,v,y=e((()=>{a(),o(),l(),d(),f(),_={init_retry_max_attempts:3,init_retry_base_delay_ms:500,init_retry_jitter_fraction:.25,init_retry_max_delay_ms:4e3,http_timeout_ms:1e4,uuid_dedup_buffer_size:2e3,heartbeat_interval_ms:2e4,heartbeat_jitter_fraction:.1,token_refresh_buffer_ms:3e5,teardown_archive_timeout_ms:1500,connect_timeout_ms:15e3,min_version:`0.0.0`,should_show_app_upgrade_message:!1},v=c(()=>i({init_retry_max_attempts:t().int().min(1).max(10).default(3),init_retry_base_delay_ms:t().int().min(100).default(500),init_retry_jitter_fraction:t().min(0).max(1).default(.25),init_retry_max_delay_ms:t().int().min(500).default(4e3),http_timeout_ms:t().int().min(2e3).default(1e4),uuid_dedup_buffer_size:t().int().min(100).max(5e4).default(2e3),heartbeat_interval_ms:t().int().min(5e3).max(3e4).default(2e4),heartbeat_jitter_fraction:t().min(0).max(.5).default(.1),token_refresh_buffer_ms:t().int().min(3e4).max(18e5).default(3e5),teardown_archive_timeout_ms:t().int().min(500).max(2e3).default(1500),connect_timeout_ms:t().int().min(5e3).max(6e4).default(15e3),min_version:n().refine(e=>{try{return u(e,`0.0.0`),!0}catch{return!1}}).default(`0.0.0`),should_show_app_upgrade_message:r().default(!1)}))}));export{g as a,y as i,h as n,m as r,_ as t};
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{Cn as t,Ln as n,kt as r,wn as i}from"./schemas-BGAvj1T4.js";import{t as a}from"./v4-f1i_CNUT.js";import{S as o,y as s}from"./paths-DO4WOQtD.js";import{n as c,t as l}from"./lazySchema-B0QShMaQ.js";import{i as u,r as d}from"./semver-Di5OaTd5.js";import{r as f,s as p}from"./bridgeEnabled-Csn6Ym3k.js";async function m(){let e=await s(`tengu_bridge_repl_v2_config`,_),t=v().safeParse(e);return t.success?t.data:_}async function h(){let e=await m();return e.min_version&&u(`2.7.2`,e.min_version)?`Your version of Claude Code (2.7.2) is too old for Remote Control.\nVersion ${e.min_version} or higher is required. Run \`claude update\` to update.`:null}async function g(){return p()?(await m()).should_show_app_upgrade_message:!1}var _,v,y=e((()=>{a(),o(),l(),d(),f(),_={init_retry_max_attempts:3,init_retry_base_delay_ms:500,init_retry_jitter_fraction:.25,init_retry_max_delay_ms:4e3,http_timeout_ms:1e4,uuid_dedup_buffer_size:2e3,heartbeat_interval_ms:2e4,heartbeat_jitter_fraction:.1,token_refresh_buffer_ms:3e5,teardown_archive_timeout_ms:1500,connect_timeout_ms:15e3,min_version:`0.0.0`,should_show_app_upgrade_message:!1},v=c(()=>i({init_retry_max_attempts:t().int().min(1).max(10).default(3),init_retry_base_delay_ms:t().int().min(100).default(500),init_retry_jitter_fraction:t().min(0).max(1).default(.25),init_retry_max_delay_ms:t().int().min(500).default(4e3),http_timeout_ms:t().int().min(2e3).default(1e4),uuid_dedup_buffer_size:t().int().min(100).max(5e4).default(2e3),heartbeat_interval_ms:t().int().min(5e3).max(3e4).default(2e4),heartbeat_jitter_fraction:t().min(0).max(.5).default(.1),token_refresh_buffer_ms:t().int().min(3e4).max(18e5).default(3e5),teardown_archive_timeout_ms:t().int().min(500).max(2e3).default(1500),connect_timeout_ms:t().int().min(5e3).max(6e4).default(15e3),min_version:n().refine(e=>{try{return u(e,`0.0.0`),!0}catch{return!1}}).default(`0.0.0`),should_show_app_upgrade_message:r().default(!1)}))}));export{g as a,y as i,h as n,m as r,_ as t};
@@ -1 +1 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{Rn as t}from"./src-Di342QoJ.js";import{t as n}from"./jsx-runtime-D-D469L8.js";import{fl as r,pl as i}from"./paths-Ci1iwL5Y.js";import{Ot as a,SE as o,Sd as s,Tt as c,wE as l,xd as u}from"./loadAgentsDir-C_wFhytF.js";import{n as d,t as f}from"./ExitFlow-DKusdm_v.js";import{spawnSync as p}from"child_process";function m(){return i(_)??`Goodbye!`}async function h(e){if(s())return e(),p(`tmux`,[`detach-client`],{stdio:`ignore`}),null;let t=c()!==null;return t?(0,g.jsx)(f,{showWorktree:t,onDone:e,onCancel:()=>e()}):(e(m()),await o(0,`prompt_input_exit`),null)}var g,_;e((()=>{r(),t(),d(),u(),l(),a(),g=n(),_=[`Goodbye!`,`See ya!`,`Bye!`,`Catch you later!`]}))();export{h as call};
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{Rn as t}from"./src-Di342QoJ.js";import{t as n}from"./jsx-runtime-D-D469L8.js";import{fl as r,pl as i}from"./paths-DO4WOQtD.js";import{Ot as a,SE as o,Tt as s,bd as c,wE as l,yd as u}from"./loadAgentsDir-ClTeo0nk.js";import{n as d,t as f}from"./ExitFlow-Bz5grDWv.js";import{spawnSync as p}from"child_process";function m(){return i(_)??`Goodbye!`}async function h(e){if(c())return e(),p(`tmux`,[`detach-client`],{stdio:`ignore`}),null;let t=s()!==null;return t?(0,g.jsx)(f,{showWorktree:t,onDone:e,onCancel:()=>e()}):(e(m()),await o(0,`prompt_input_exit`),null)}var g,_;e((()=>{r(),t(),d(),u(),l(),a(),g=n(),_=[`Goodbye!`,`See ya!`,`Bye!`,`Catch you later!`]}))();export{h as call};
@@ -1,2 +1,2 @@
1
- import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{F as n,Rn as r,b as i,f as a,g as o,h as s,t as c,tn as l,tt as u,x as d}from"./src-Di342QoJ.js";import{t as f}from"./jsx-runtime-D-D469L8.js";import{A as p,E as m}from"./debug-otxXY3j-.js";import{n as h,t as g}from"./cwd--iizewsn.js";import{DC as _,EC as v,aS as y,dS as b,fS as x,oS as S}from"./loadAgentsDir-C_wFhytF.js";import{t as C}from"./useKeybinding-DPOUuymz.js";import{t as w}from"./useTerminalSize-Du-EamDN.js";import{n as T,t as E}from"./exportRenderer-DX2L5fQ7.js";import{join as D}from"path";function O({content:e,defaultFilename:t,onDone:r}){let[,c]=(0,k.useState)(null),[f,m]=(0,k.useState)(t),[h,_]=(0,k.useState)(t.length),[x,S]=(0,k.useState)(!1),{columns:C}=n(),w=(0,k.useCallback)(()=>{S(!1),c(null)},[]),T=async t=>{if(t===`clipboard`){let t=await l(e);t&&process.stdout.write(t),r({success:!0,message:`Conversation copied to clipboard`})}else t===`file`&&(c(`file`),S(!0))},E=()=>{let t=f.endsWith(`.txt`)?f:f.replace(/\.[^.]+$/,``)+`.txt`,n=D(g(),t);try{p(n,e,{encoding:`utf-8`,flush:!0}),r({success:!0,message:`Conversation exported to: ${n}`})}catch(e){r({success:!1,message:`Failed to export conversation: ${e instanceof Error?e.message:`Unknown error`}`})}},O=(0,k.useCallback)(()=>{x?w():r({success:!1,message:`Export cancelled`})},[x,w,r]),j=[{label:`Copy to clipboard`,value:`clipboard`,description:`Copy the conversation to your system clipboard`},{label:`Save to file`,value:`file`,description:`Save the conversation to a file in the current directory`}];function M(e){return x?(0,A.jsxs)(s,{children:[(0,A.jsx)(o,{shortcut:`Enter`,action:`save`}),(0,A.jsx)(v,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}):e.pending?(0,A.jsxs)(i,{children:[`Press `,e.keyName,` again to exit`]}):(0,A.jsx)(v,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})}return u(`confirm:no`,O,{context:`Settings`,isActive:x}),(0,A.jsx)(a,{title:`Export Conversation`,subtitle:`Select export method:`,color:`permission`,onCancel:O,inputGuide:M,isCancelActive:!x,children:x?(0,A.jsxs)(d,{flexDirection:`column`,children:[(0,A.jsx)(i,{children:`Enter filename:`}),(0,A.jsxs)(d,{flexDirection:`row`,gap:1,marginTop:1,children:[(0,A.jsx)(i,{children:`>`}),(0,A.jsx)(b,{value:f,onChange:m,onSubmit:E,focus:!0,showCursor:!0,columns:C,cursorOffset:h,onChangeCursorOffset:_})]})]}):(0,A.jsx)(y,{options:j,onChange:T,onCancel:O})})}var k,A,j=e((()=>{k=t(r(),1),w(),c(),C(),h(),m(),_(),S(),x(),A=f()}));function M(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}-${String(e.getHours()).padStart(2,`0`)}${String(e.getMinutes()).padStart(2,`0`)}${String(e.getSeconds()).padStart(2,`0`)}`}function N(e){let t=e.find(e=>e.type===`user`);if(!t||t.type!==`user`)return``;let n=t.message?.content,r=``;if(typeof n==`string`)r=n.trim();else if(Array.isArray(n)){let e=n.find(e=>e.type===`text`);e&&`text`in e&&(r=e.text.trim())}return r=r.split(`
1
+ import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{F as n,Rn as r,b as i,f as a,g as o,h as s,t as c,tn as l,tt as u,x as d}from"./src-Di342QoJ.js";import{t as f}from"./jsx-runtime-D-D469L8.js";import{A as p,E as m}from"./debug-otxXY3j-.js";import{n as h,t as g}from"./cwd--iizewsn.js";import{DC as _,EC as v,aS as y,dS as b,fS as x,oS as S}from"./loadAgentsDir-ClTeo0nk.js";import{t as C}from"./useKeybinding-DPOUuymz.js";import{t as w}from"./useTerminalSize-Du-EamDN.js";import{n as T,t as E}from"./exportRenderer-CaegIP5N.js";import{join as D}from"path";function O({content:e,defaultFilename:t,onDone:r}){let[,c]=(0,k.useState)(null),[f,m]=(0,k.useState)(t),[h,_]=(0,k.useState)(t.length),[x,S]=(0,k.useState)(!1),{columns:C}=n(),w=(0,k.useCallback)(()=>{S(!1),c(null)},[]),T=async t=>{if(t===`clipboard`){let t=await l(e);t&&process.stdout.write(t),r({success:!0,message:`Conversation copied to clipboard`})}else t===`file`&&(c(`file`),S(!0))},E=()=>{let t=f.endsWith(`.txt`)?f:f.replace(/\.[^.]+$/,``)+`.txt`,n=D(g(),t);try{p(n,e,{encoding:`utf-8`,flush:!0}),r({success:!0,message:`Conversation exported to: ${n}`})}catch(e){r({success:!1,message:`Failed to export conversation: ${e instanceof Error?e.message:`Unknown error`}`})}},O=(0,k.useCallback)(()=>{x?w():r({success:!1,message:`Export cancelled`})},[x,w,r]),j=[{label:`Copy to clipboard`,value:`clipboard`,description:`Copy the conversation to your system clipboard`},{label:`Save to file`,value:`file`,description:`Save the conversation to a file in the current directory`}];function M(e){return x?(0,A.jsxs)(s,{children:[(0,A.jsx)(o,{shortcut:`Enter`,action:`save`}),(0,A.jsx)(v,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}):e.pending?(0,A.jsxs)(i,{children:[`Press `,e.keyName,` again to exit`]}):(0,A.jsx)(v,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})}return u(`confirm:no`,O,{context:`Settings`,isActive:x}),(0,A.jsx)(a,{title:`Export Conversation`,subtitle:`Select export method:`,color:`permission`,onCancel:O,inputGuide:M,isCancelActive:!x,children:x?(0,A.jsxs)(d,{flexDirection:`column`,children:[(0,A.jsx)(i,{children:`Enter filename:`}),(0,A.jsxs)(d,{flexDirection:`row`,gap:1,marginTop:1,children:[(0,A.jsx)(i,{children:`>`}),(0,A.jsx)(b,{value:f,onChange:m,onSubmit:E,focus:!0,showCursor:!0,columns:C,cursorOffset:h,onChangeCursorOffset:_})]})]}):(0,A.jsx)(y,{options:j,onChange:T,onCancel:O})})}var k,A,j=e((()=>{k=t(r(),1),w(),c(),C(),h(),m(),_(),S(),x(),A=f()}));function M(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}-${String(e.getHours()).padStart(2,`0`)}${String(e.getMinutes()).padStart(2,`0`)}${String(e.getSeconds()).padStart(2,`0`)}`}function N(e){let t=e.find(e=>e.type===`user`);if(!t||t.type!==`user`)return``;let n=t.message?.content,r=``;if(typeof n==`string`)r=n.trim();else if(Array.isArray(n)){let e=n.find(e=>e.type===`text`);e&&`text`in e&&(r=e.text.trim())}return r=r.split(`
2
2
  `)[0]||``,r.length>50&&(r=r.substring(0,49)+`…`),r}function P(e){return e.toLowerCase().replace(/[^a-z0-9\s-]/g,``).replace(/\s+/g,`-`).replace(/-+/g,`-`).replace(/^-|-$/g,``)}async function F(e){let t=e.options.tools||[];return T(e.messages,t)}async function I(e,t,n){let r=await F(t),i=n.trim();if(i){let t=i.endsWith(`.txt`)?i:i.replace(/\.[^.]+$/,``)+`.txt`,n=D(g(),t);try{return p(n,r,{encoding:`utf-8`,flush:!0}),e(`Conversation exported to: ${n}`),null}catch(t){return e(`Failed to export conversation: ${t instanceof Error?t.message:`Unknown error`}`),null}}let a=N(t.messages),o=M(new Date),s;if(a){let e=P(a);s=e?`${o}-${e}.txt`:`conversation-${o}.txt`}else s=`conversation-${o}.txt`;return(0,L.jsx)(O,{content:r,defaultFilename:s,onDone:t=>{e(t.message)}})}var L;e((()=>{r(),j(),h(),E(),m(),L=f()}))();export{I as call,N as extractFirstPrompt,P as sanitizeFilename};
@@ -1 +1 @@
1
- import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n,Tn as r,rt as i,wn as a}from"./src-Di342QoJ.js";import{t as o}from"./jsx-runtime-D-D469L8.js";import{FT as s,LT as c,cC as l,kT as u,lC as d}from"./loadAgentsDir-C_wFhytF.js";import{n as f,t as p}from"./staticRender-C5v46np_.js";import{n as m,t as h}from"./Messages-DTmFVhRG.js";function g({children:e}){let{bindings:t}=c(),n=(0,b.useRef)(null),r=(0,b.useRef)(new Map),a=(0,b.useRef)(new Set).current;return(0,x.jsx)(i,{bindings:t,pendingChordRef:n,pendingChord:null,setPendingChord:()=>{},activeContexts:a,registerActiveContext:()=>{},unregisterActiveContext:()=>{},handlerRegistryRef:r,children:e})}function _(e){if(!(`message`in e))return 1;let t=e.message.content;return Array.isArray(t)?t.length:1}async function v(e,t,n,{columns:i,verbose:a=!1,chunkSize:o=40,onProgress:s}={}){let c=n=>f((0,x.jsx)(l,{children:(0,x.jsx)(g,{children:(0,x.jsx)(h,{messages:e,tools:t,commands:[],verbose:a,toolJSX:null,toolUseConfirmQueue:[],inProgressToolUseIDs:new Set,isMessageSelectorVisible:!1,conversationId:`export`,screen:`prompt`,streamingToolUses:[],showAllInTranscript:!0,isLoading:!1,renderRange:n})})}),i),u=o;for(let t of e)u+=_(t);for(let e=0;e<u;e+=o){let t=await c([e,e+o]);if(r(t).trim()===``)break;await n(t),s?.(e+o)}}async function y(e,t=[],n){let i=[];return await v(e,t,e=>void i.push(r(e)),{columns:n}),i.join(``)}var b,x,S=e((()=>{b=t(n(),1),a(),m(),u(),s(),d(),p(),x=o()}));export{y as n,S as t};
1
+ import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n,Tn as r,rt as i,wn as a}from"./src-Di342QoJ.js";import{t as o}from"./jsx-runtime-D-D469L8.js";import{FT as s,LT as c,cC as l,kT as u,lC as d}from"./loadAgentsDir-ClTeo0nk.js";import{n as f,t as p}from"./staticRender-C5v46np_.js";import{n as m,t as h}from"./Messages-FEBcX-cT.js";function g({children:e}){let{bindings:t}=c(),n=(0,b.useRef)(null),r=(0,b.useRef)(new Map),a=(0,b.useRef)(new Set).current;return(0,x.jsx)(i,{bindings:t,pendingChordRef:n,pendingChord:null,setPendingChord:()=>{},activeContexts:a,registerActiveContext:()=>{},unregisterActiveContext:()=>{},handlerRegistryRef:r,children:e})}function _(e){if(!(`message`in e))return 1;let t=e.message.content;return Array.isArray(t)?t.length:1}async function v(e,t,n,{columns:i,verbose:a=!1,chunkSize:o=40,onProgress:s}={}){let c=n=>f((0,x.jsx)(l,{children:(0,x.jsx)(g,{children:(0,x.jsx)(h,{messages:e,tools:t,commands:[],verbose:a,toolJSX:null,toolUseConfirmQueue:[],inProgressToolUseIDs:new Set,isMessageSelectorVisible:!1,conversationId:`export`,screen:`prompt`,streamingToolUses:[],showAllInTranscript:!0,isLoading:!1,renderRange:n})})}),i),u=o;for(let t of e)u+=_(t);for(let e=0;e<u;e+=o){let t=await c([e,e+o]);if(r(t).trim()===``)break;await n(t),s?.(e+o)}}async function y(e,t=[],n){let i=[];return await v(e,t,e=>void i.push(r(e)),{columns:n}),i.join(``)}var b,x,S=e((()=>{b=t(n(),1),a(),m(),u(),s(),d(),p(),x=o()}));export{y as n,S as t};
@@ -1 +1 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{Rn as t}from"./src-Di342QoJ.js";import{t as n}from"./jsx-runtime-D-D469L8.js";import{n as r,t as i}from"./extra-usage-core-D84ifgBo.js";import{r as a,t as o}from"./login-C1uE6Pg9.js";async function s(e,t){let n=await r();return n.type===`message`?(e(n.value),null):(0,c.jsx)(o,{startingMessage:`Starting new login following /extra-usage. Exit with Ctrl-C to use existing account.`,onDone:n=>{t.onChangeAPIKey(),e(n?`Login successful`:`Login interrupted`)}})}var c,l=e((()=>{t(),a(),i(),c=n()}));export{l as n,s as t};
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{Rn as t}from"./src-Di342QoJ.js";import{t as n}from"./jsx-runtime-D-D469L8.js";import{n as r,t as i}from"./extra-usage-core-sHzc4eE1.js";import{r as a,t as o}from"./login-C3MZQTDL.js";async function s(e,t){let n=await r();return n.type===`message`?(e(n.value),null):(0,c.jsx)(o,{startingMessage:`Starting new login following /extra-usage. Exit with Ctrl-C to use existing account.`,onDone:n=>{t.onChangeAPIKey(),e(n?`Login successful`:`Login interrupted`)}})}var c,l=e((()=>{t(),a(),i(),c=n()}));export{l as n,s as t};
@@ -0,0 +1 @@
1
+ import{n as e,t}from"./extra-usage-Cj8fokgc.js";e();export{t as call};
@@ -1 +1 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./axios-DhfaybwJ.js";import{Cc as r,Da as i,dc as a,ka as o,on as s,tn as c,yc as l}from"./paths-Ci1iwL5Y.js";import{l as u,u as d}from"./oauth-CdZEzMww.js";import{o as f,s as p}from"./log-DSV4Ht5l.js";import{a as m,l as h,o as g}from"./api-CDmgYrwN.js";import{n as _,t as v}from"./browser-Bt-ckCaU.js";import{n as y,t as b}from"./usage-B_bY46ep.js";import{i as x,r as S}from"./overageCreditGrant-Cbh0_fbM.js";async function C(e){let{accessToken:n,orgUUID:r}=await h(),i={...m(n),"x-organization-uuid":r},a=`${u().BASE_API_URL}/api/oauth/organizations/${r}/admin_requests`;return(await t.post(a,e,{headers:i})).data}async function w(e,n){let{accessToken:r,orgUUID:i}=await h(),a={...m(r),"x-organization-uuid":i},o=`${u().BASE_API_URL}/api/oauth/organizations/${i}/admin_requests/me?request_type=${e}`;for(let e of n)o+=`&statuses=${e}`;return(await t.get(o,{headers:a})).data}async function T(e){let{accessToken:n,orgUUID:r}=await h(),i={...m(n),"x-organization-uuid":r},a=`${u().BASE_API_URL}/api/oauth/organizations/${r}/admin_requests/eligibility?request_type=${e}`;return(await t.get(a,{headers:i})).data}var E=e((()=>{n(),d(),g()}));async function D(){a().hasVisitedExtraUsage||r(e=>({...e,hasVisitedExtraUsage:!0})),x();let e=c(),t=e===`team`||e===`enterprise`;if(!i()&&t){let e;try{e=(await b())?.extra_usage}catch(e){p(e)}if(e?.is_enabled&&e.monthly_limit===null)return{type:`message`,value:`Your organization already has unlimited extra usage. No request needed.`};try{if((await T(`limit_increase`))?.is_allowed===!1)return{type:`message`,value:`Please contact your admin to manage extra usage settings.`}}catch(e){p(e)}try{let e=await w(`limit_increase`,[`pending`,`dismissed`]);if(e&&e.length>0)return{type:`message`,value:`You have already submitted a request for extra usage to your admin.`}}catch(e){p(e)}try{return await C({request_type:`limit_increase`,details:null}),{type:`message`,value:e?.is_enabled?`Request sent to your admin to increase extra usage.`:`Request sent to your admin to enable extra usage.`}}catch(e){p(e)}return{type:`message`,value:`Please contact your admin to manage extra usage settings.`}}let n=t?`https://claude.ai/admin-settings/usage`:`https://claude.ai/settings/usage`;try{return{type:`browser-opened`,url:n,opened:await _(n)}}catch(e){return p(e),{type:`message`,value:`Failed to open browser. Please visit ${n} to manage extra usage.`}}}var O=e((()=>{E(),S(),y(),s(),o(),v(),l(),f()}));export{D as n,O as t};
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./axios-DhfaybwJ.js";import{Cc as r,Da as i,dc as a,ka as o,on as s,tn as c,yc as l}from"./paths-DO4WOQtD.js";import{l as u,u as d}from"./oauth-CdZEzMww.js";import{o as f,s as p}from"./log-DSV4Ht5l.js";import{a as m,l as h,o as g}from"./api-CQWbpxLP.js";import{n as _,t as v}from"./browser-Bt-ckCaU.js";import{n as y,t as b}from"./usage-DxudeFLL.js";import{i as x,r as S}from"./overageCreditGrant-BqW_6R5v.js";async function C(e){let{accessToken:n,orgUUID:r}=await h(),i={...m(n),"x-organization-uuid":r},a=`${u().BASE_API_URL}/api/oauth/organizations/${r}/admin_requests`;return(await t.post(a,e,{headers:i})).data}async function w(e,n){let{accessToken:r,orgUUID:i}=await h(),a={...m(r),"x-organization-uuid":i},o=`${u().BASE_API_URL}/api/oauth/organizations/${i}/admin_requests/me?request_type=${e}`;for(let e of n)o+=`&statuses=${e}`;return(await t.get(o,{headers:a})).data}async function T(e){let{accessToken:n,orgUUID:r}=await h(),i={...m(n),"x-organization-uuid":r},a=`${u().BASE_API_URL}/api/oauth/organizations/${r}/admin_requests/eligibility?request_type=${e}`;return(await t.get(a,{headers:i})).data}var E=e((()=>{n(),d(),g()}));async function D(){a().hasVisitedExtraUsage||r(e=>({...e,hasVisitedExtraUsage:!0})),x();let e=c(),t=e===`team`||e===`enterprise`;if(!i()&&t){let e;try{e=(await b())?.extra_usage}catch(e){p(e)}if(e?.is_enabled&&e.monthly_limit===null)return{type:`message`,value:`Your organization already has unlimited extra usage. No request needed.`};try{if((await T(`limit_increase`))?.is_allowed===!1)return{type:`message`,value:`Please contact your admin to manage extra usage settings.`}}catch(e){p(e)}try{let e=await w(`limit_increase`,[`pending`,`dismissed`]);if(e&&e.length>0)return{type:`message`,value:`You have already submitted a request for extra usage to your admin.`}}catch(e){p(e)}try{return await C({request_type:`limit_increase`,details:null}),{type:`message`,value:e?.is_enabled?`Request sent to your admin to increase extra usage.`:`Request sent to your admin to enable extra usage.`}}catch(e){p(e)}return{type:`message`,value:`Please contact your admin to manage extra usage settings.`}}let n=t?`https://claude.ai/admin-settings/usage`:`https://claude.ai/settings/usage`;try{return{type:`browser-opened`,url:n,opened:await _(n)}}catch(e){return p(e),{type:`message`,value:`Failed to open browser. Please visit ${n} to manage extra usage.`}}}var O=e((()=>{E(),S(),y(),s(),o(),v(),l(),f()}));export{D as n,O as t};
@@ -1 +1 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./extra-usage-core-D84ifgBo.js";async function r(){let e=await t();return e.type===`message`?{type:`text`,value:e.value}:{type:`text`,value:e.opened?`Browser opened to manage extra usage. If it didn't open, visit: ${e.url}`:`Please visit ${e.url} to manage extra usage.`}}e((()=>{n()}))();export{r as call};
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./extra-usage-core-sHzc4eE1.js";async function r(){let e=await t();return e.type===`message`?{type:`text`,value:e.value}:{type:`text`,value:e.opened?`Browser opened to manage extra usage. If it didn't open, visit: ${e.url}`:`Please visit ${e.url} to manage extra usage.`}}e((()=>{n()}))();export{r as call};
@@ -1 +1 @@
1
- import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n,b as r,g as i,h as a,nt as o,p as ee,t as te,x as s}from"./src-Di342QoJ.js";import{t as c}from"./jsx-runtime-D-D469L8.js";import{Br as l,Cr as u,Ol as ne,Pr as d,Ps as f,Qa as re,Rr as p,bi as ie,dn as m,dr as h,kl as g,li as _,lo as ae,on as v,oo as y,ur as b,vi as x,xi as S,yi as oe}from"./paths-Ci1iwL5Y.js";import{n as C,r as se}from"./analytics-DqMQntaB.js";import{By as w,DC as T,Dj as E,EC as ce,Hf as D,Mj as le,Nj as ue,Oj as de,Tj as O,Vf as fe,_j as k,aS as pe,fC as me,kj as he,lC as A,uC as j,vj as M,yj as N}from"./loadAgentsDir-C_wFhytF.js";import{t as P}from"./useKeybinding-DPOUuymz.js";import{n as ge,t as F}from"./useExitOnCtrlCDWithKeybindings-BHi41Ku_.js";function I(e,t){if(!E(t))return;let n=N(t,e);return`${L(n)} ${n} · /effort`}function L(e){switch(e){case`low`:return`○`;case`medium`:return`◐`;case`high`:return`●`;case`xhigh`:return`⦿`;case`max`:return`◉`;default:return`●`}}var R=e((()=>{f(),O()}));function z({initial:e,sessionModel:t,onSelect:n,onCancel:te,isStandaloneCommand:c,showFastModeNotice:l,headerText:u,skipSettingsWrite:d}){let f=me(),m=ge(),h=e===null?G:e,[g,v]=(0,U.useState)(h),y=j(e=>S()?e.fastMode:!1),[x,C]=(0,U.useState)(()=>new Set(b(h)?[h.replace(/\[1m\]/i,``)]:[])),w=(0,U.useCallback)(()=>{if(!g||g===G)return;let e=g.replace(/\[1m\]/i,``);C(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[g]),[T,D]=(0,U.useState)(!1),O=j(e=>e.effortValue),[A,M]=(0,U.useState)(O===void 0?void 0:k(O)),N=(0,U.useMemo)(()=>fe(y??!1),[y]),P=(0,U.useMemo)(()=>e!==null&&!N.some(t=>t.value===e)?[...N,{value:e,label:p(e),description:`Current model`}]:N,[N,e]),F=(0,U.useMemo)(()=>P.map(e=>({...e,value:e.value===null?G:e.value})),[P]),I=(0,U.useMemo)(()=>F.some(e=>e.value===h)?h:F[0]?.value??void 0,[F,h]),L=Math.min(10,F.length),R=Math.max(0,F.length-L),z=F.find(e=>e.value===g)?.label,K=B(g),q=g!==void 0&&g!==G&&x.has(g.replace(/\[1m\]/i,``)),J=K?E(K):!1,Y=K?he(K):!1,X=K?de(K):!1,Z=H(g),Q=A===`max`&&!X?Y?`xhigh`:`high`:A===`xhigh`&&!Y?`high`:A,ve=(0,U.useCallback)(e=>{v(e),!T&&O===void 0&&M(H(e))},[T,O]),ye=(0,U.useCallback)(e=>{J&&(M(t=>_e(t??Z,e,Y,X)),D(!0))},[J,Y,X,Z]);o({"modelPicker:decreaseEffort":()=>ye(`left`),"modelPicker:increaseEffort":()=>ye(`right`),"modelPicker:toggle1M":()=>w()},{context:`ModelPicker`});function be(e){if(se(`tengu_model_command_menu_effort`,{effort:A}),!d){let t=le(A,H(e),re(`userSettings`)?.effortLevel,T),n=ue(t);n!==void 0&&ae(`userSettings`,{effortLevel:n}),f(e=>({...e,effortValue:t}))}let t=B(e),r=T&&t&&E(t)?A:void 0;if(e===G){n(null,r);return}let i=e.replace(/\[1m\]/i,``);n(x.has(i)?`${i}[1m]`:i,r)}let $=(0,W.jsxs)(s,{flexDirection:`column`,children:[(0,W.jsxs)(s,{flexDirection:`column`,children:[(0,W.jsxs)(s,{marginBottom:1,flexDirection:`column`,children:[(0,W.jsx)(r,{color:`remember`,bold:!0,children:`Select model`}),(0,W.jsx)(r,{dimColor:!0,children:u??`Choose a model for this and future sessions. Use ← → to adjust effort, Space to toggle 1M context.`}),t&&(0,W.jsxs)(r,{dimColor:!0,children:[`Currently using `,p(t),` for this session (set by plan mode). Selecting a model will undo this.`]})]}),(0,W.jsxs)(s,{flexDirection:`column`,marginBottom:1,children:[(0,W.jsx)(s,{flexDirection:`column`,children:(0,W.jsx)(pe,{defaultValue:h,defaultFocusValue:I,options:F,onChange:be,onFocus:ve,onCancel:te??(()=>{}),visibleOptionCount:L})}),R>0&&(0,W.jsx)(s,{paddingLeft:3,children:(0,W.jsxs)(r,{dimColor:!0,children:[`and `,R,` more…`]})})]}),(0,W.jsxs)(s,{marginBottom:1,flexDirection:`column`,children:[J?(0,W.jsxs)(r,{dimColor:!0,children:[(0,W.jsx)(V,{effort:Q}),` `,ne(Q),` effort`,Q===Z?` (default)`:``,` `,(0,W.jsx)(r,{color:`subtle`,children:`← → to adjust`})]}):(0,W.jsxs)(r,{color:`subtle`,children:[(0,W.jsx)(V,{effort:void 0}),` Effort not supported`,z?` for ${z}`:``]}),q?(0,W.jsxs)(r,{dimColor:!0,children:[(0,W.jsx)(V,{effort:`high`}),` 1M context on`,(0,W.jsx)(r,{color:`subtle`,children:` · Space to toggle`})]}):(0,W.jsxs)(r,{color:`subtle`,children:[(0,W.jsx)(V,{effort:void 0}),` 1M context off`,z?` for ${z}`:``,(0,W.jsx)(r,{color:`subtle`,children:` · Space to toggle`})]})]}),S()?l?(0,W.jsx)(s,{marginBottom:1,children:(0,W.jsxs)(r,{dimColor:!0,children:[`Fast mode is `,(0,W.jsx)(r,{bold:!0,children:`ON`}),` and available with `,_,` only (/fast). Switching to other models turn off fast mode.`]})}):oe()&&!ie()?(0,W.jsx)(s,{marginBottom:1,children:(0,W.jsxs)(r,{dimColor:!0,children:[`Use `,(0,W.jsx)(r,{bold:!0,children:`/fast`}),` to turn on Fast mode (`,_,` only).`]})}):null:null]}),c&&(0,W.jsx)(r,{dimColor:!0,italic:!0,children:m.pending?(0,W.jsxs)(W.Fragment,{children:[`Press `,m.keyName,` again to exit`]}):(0,W.jsxs)(a,{children:[(0,W.jsx)(i,{shortcut:`Enter`,action:`confirm`}),(0,W.jsx)(ce,{action:`select:cancel`,context:`Select`,fallback:`Esc`,description:`exit`})]})})]});return c?(0,W.jsx)(ee,{color:`permission`,children:$}):$}function B(e){if(e)return e===G?u():l(e)}function V({effort:e}){return(0,W.jsx)(r,{color:e?`claude`:`subtle`,children:L(e??`low`)})}function _e(e,t,n,r){let i=[`low`,`medium`,`high`,...n?[`xhigh`]:[],...r?[`max`]:[]],a=i.indexOf(e),o=a===-1?i.indexOf(`high`):a;return t===`right`?i[(o+1)%i.length]:i[(o-1+i.length)%i.length]}function H(e){let t=M(B(e)??u());return t===void 0?`high`:k(t)}var U,W,G,K=e((()=>{g(),n(),U=t(n(),1),h(),F(),C(),x(),te(),P(),A(),O(),d(),D(),y(),T(),w(),R(),W=c(),G=`__NO_PREFERENCE__`}));function q(e,t,n){if(!m())return!1;if(t)return!0;if(e===null||!b(e))return!1;let r=e.toLowerCase().replace(/\[1m\]$/,``).trim(),i=r===`opus`||r.includes(`opus-4-6`)||r.includes(`opus-4-7`),a=r===`sonnet`||r.includes(`sonnet-4-6`);return i&&n?!1:i||a}var J=e((()=>{v(),h()}));export{L as a,K as i,q as n,I as o,z as r,R as s,J as t};
1
+ import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n,b as r,g as i,h as a,nt as o,p as ee,t as te,x as s}from"./src-Di342QoJ.js";import{t as c}from"./jsx-runtime-D-D469L8.js";import{Br as l,Cr as u,Ol as ne,Pr as d,Ps as f,Qa as re,Rr as p,bi as ie,dn as m,dr as h,kl as g,li as _,lo as ae,on as v,oo as y,ur as b,vi as x,xi as S,yi as oe}from"./paths-DO4WOQtD.js";import{n as C,r as se}from"./analytics-DqMQntaB.js";import{Bf as w,DC as T,Dj as E,EC as ce,Mj as le,Nj as ue,Oj as de,Ry as D,Tj as O,_j as k,aS as fe,fC as pe,kj as me,lC as A,uC as j,vj as M,yj as N,zf as he}from"./loadAgentsDir-ClTeo0nk.js";import{t as P}from"./useKeybinding-DPOUuymz.js";import{n as ge,t as F}from"./useExitOnCtrlCDWithKeybindings-BHi41Ku_.js";function I(e,t){if(!E(t))return;let n=N(t,e);return`${L(n)} ${n} · /effort`}function L(e){switch(e){case`low`:return`○`;case`medium`:return`◐`;case`high`:return`●`;case`xhigh`:return`⦿`;case`max`:return`◉`;default:return`●`}}var R=e((()=>{f(),O()}));function z({initial:e,sessionModel:t,onSelect:n,onCancel:te,isStandaloneCommand:c,showFastModeNotice:l,headerText:u,skipSettingsWrite:d}){let f=pe(),m=ge(),h=e===null?G:e,[g,v]=(0,U.useState)(h),y=j(e=>S()?e.fastMode:!1),[x,C]=(0,U.useState)(()=>new Set(b(h)?[h.replace(/\[1m\]/i,``)]:[])),w=(0,U.useCallback)(()=>{if(!g||g===G)return;let e=g.replace(/\[1m\]/i,``);C(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[g]),[T,D]=(0,U.useState)(!1),O=j(e=>e.effortValue),[A,M]=(0,U.useState)(O===void 0?void 0:k(O)),N=(0,U.useMemo)(()=>he(y??!1),[y]),P=(0,U.useMemo)(()=>e!==null&&!N.some(t=>t.value===e)?[...N,{value:e,label:p(e),description:`Current model`}]:N,[N,e]),F=(0,U.useMemo)(()=>P.map(e=>({...e,value:e.value===null?G:e.value})),[P]),I=(0,U.useMemo)(()=>F.some(e=>e.value===h)?h:F[0]?.value??void 0,[F,h]),L=Math.min(10,F.length),R=Math.max(0,F.length-L),z=F.find(e=>e.value===g)?.label,K=B(g),q=g!==void 0&&g!==G&&x.has(g.replace(/\[1m\]/i,``)),J=K?E(K):!1,Y=K?me(K):!1,X=K?de(K):!1,Z=H(g),Q=A===`max`&&!X?Y?`xhigh`:`high`:A===`xhigh`&&!Y?`high`:A,ve=(0,U.useCallback)(e=>{v(e),!T&&O===void 0&&M(H(e))},[T,O]),ye=(0,U.useCallback)(e=>{J&&(M(t=>_e(t??Z,e,Y,X)),D(!0))},[J,Y,X,Z]);o({"modelPicker:decreaseEffort":()=>ye(`left`),"modelPicker:increaseEffort":()=>ye(`right`),"modelPicker:toggle1M":()=>w()},{context:`ModelPicker`});function be(e){if(se(`tengu_model_command_menu_effort`,{effort:A}),!d){let t=le(A,H(e),re(`userSettings`)?.effortLevel,T),n=ue(t);n!==void 0&&ae(`userSettings`,{effortLevel:n}),f(e=>({...e,effortValue:t}))}let t=B(e),r=T&&t&&E(t)?A:void 0;if(e===G){n(null,r);return}let i=e.replace(/\[1m\]/i,``);n(x.has(i)?`${i}[1m]`:i,r)}let $=(0,W.jsxs)(s,{flexDirection:`column`,children:[(0,W.jsxs)(s,{flexDirection:`column`,children:[(0,W.jsxs)(s,{marginBottom:1,flexDirection:`column`,children:[(0,W.jsx)(r,{color:`remember`,bold:!0,children:`Select model`}),(0,W.jsx)(r,{dimColor:!0,children:u??`Choose a model for this and future sessions. Use ← → to adjust effort, Space to toggle 1M context.`}),t&&(0,W.jsxs)(r,{dimColor:!0,children:[`Currently using `,p(t),` for this session (set by plan mode). Selecting a model will undo this.`]})]}),(0,W.jsxs)(s,{flexDirection:`column`,marginBottom:1,children:[(0,W.jsx)(s,{flexDirection:`column`,children:(0,W.jsx)(fe,{defaultValue:h,defaultFocusValue:I,options:F,onChange:be,onFocus:ve,onCancel:te??(()=>{}),visibleOptionCount:L})}),R>0&&(0,W.jsx)(s,{paddingLeft:3,children:(0,W.jsxs)(r,{dimColor:!0,children:[`and `,R,` more…`]})})]}),(0,W.jsxs)(s,{marginBottom:1,flexDirection:`column`,children:[J?(0,W.jsxs)(r,{dimColor:!0,children:[(0,W.jsx)(V,{effort:Q}),` `,ne(Q),` effort`,Q===Z?` (default)`:``,` `,(0,W.jsx)(r,{color:`subtle`,children:`← → to adjust`})]}):(0,W.jsxs)(r,{color:`subtle`,children:[(0,W.jsx)(V,{effort:void 0}),` Effort not supported`,z?` for ${z}`:``]}),q?(0,W.jsxs)(r,{dimColor:!0,children:[(0,W.jsx)(V,{effort:`high`}),` 1M context on`,(0,W.jsx)(r,{color:`subtle`,children:` · Space to toggle`})]}):(0,W.jsxs)(r,{color:`subtle`,children:[(0,W.jsx)(V,{effort:void 0}),` 1M context off`,z?` for ${z}`:``,(0,W.jsx)(r,{color:`subtle`,children:` · Space to toggle`})]})]}),S()?l?(0,W.jsx)(s,{marginBottom:1,children:(0,W.jsxs)(r,{dimColor:!0,children:[`Fast mode is `,(0,W.jsx)(r,{bold:!0,children:`ON`}),` and available with `,_,` only (/fast). Switching to other models turn off fast mode.`]})}):oe()&&!ie()?(0,W.jsx)(s,{marginBottom:1,children:(0,W.jsxs)(r,{dimColor:!0,children:[`Use `,(0,W.jsx)(r,{bold:!0,children:`/fast`}),` to turn on Fast mode (`,_,` only).`]})}):null:null]}),c&&(0,W.jsx)(r,{dimColor:!0,italic:!0,children:m.pending?(0,W.jsxs)(W.Fragment,{children:[`Press `,m.keyName,` again to exit`]}):(0,W.jsxs)(a,{children:[(0,W.jsx)(i,{shortcut:`Enter`,action:`confirm`}),(0,W.jsx)(ce,{action:`select:cancel`,context:`Select`,fallback:`Esc`,description:`exit`})]})})]});return c?(0,W.jsx)(ee,{color:`permission`,children:$}):$}function B(e){if(e)return e===G?u():l(e)}function V({effort:e}){return(0,W.jsx)(r,{color:e?`claude`:`subtle`,children:L(e??`low`)})}function _e(e,t,n,r){let i=[`low`,`medium`,`high`,...n?[`xhigh`]:[],...r?[`max`]:[]],a=i.indexOf(e),o=a===-1?i.indexOf(`high`):a;return t===`right`?i[(o+1)%i.length]:i[(o-1+i.length)%i.length]}function H(e){let t=M(B(e)??u());return t===void 0?`high`:k(t)}var U,W,G,K=e((()=>{g(),n(),U=t(n(),1),h(),F(),C(),x(),te(),P(),A(),O(),d(),w(),y(),T(),D(),R(),W=c(),G=`__NO_PREFERENCE__`}));function q(e,t,n){if(!m())return!1;if(t)return!0;if(e===null||!b(e))return!1;let r=e.toLowerCase().replace(/\[1m\]$/,``).trim(),i=r===`opus`||r.includes(`opus-4-6`)||r.includes(`opus-4-7`),a=r===`sonnet`||r.includes(`sonnet-4-6`);return i&&n?!1:i||a}var J=e((()=>{v(),h()}));export{L as a,K as i,q as n,I as o,z as r,R as s,J as t};
@@ -0,0 +1 @@
1
+ import{iu as e,nu as t,ru as n,tu as r}from"./loadAgentsDir-ClTeo0nk.js";e();export{r as drainPendingExtraction,t as executeExtractMemories,n as initExtractMemories};
@@ -1 +1 @@
1
- import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{In as n,Ln as r,Q as i,Rn as a,b as o,f as s,nt as c,t as l,v as u,x as d}from"./src-Di342QoJ.js";import{t as f}from"./jsx-runtime-D-D469L8.js";import{Di as p,Ps as m,Si as h,ci as g,dc as _,di as v,fi as y,li as b,lo as x,mi as S,oi as C,oo as w,si as T,ui as E,vi as D,xi as O,yc as k}from"./paths-Ci1iwL5Y.js";import{n as A,r as j}from"./analytics-DqMQntaB.js";import{d as M,x as N}from"./startupProfiler-CAntGAbs.js";import{fC as P,lC as F,uC as I}from"./loadAgentsDir-C_wFhytF.js";import{t as L}from"./useKeybinding-DPOUuymz.js";import{n as R,t as z}from"./systemTheme-eRWGHYSL.js";function B({cooldown:e}){return e?(0,H.jsx)(o,{color:`promptBorder`,dimColor:!0,children:`↯`}):(0,H.jsx)(o,{color:`fastMode`,children:`↯`})}function V(e=!0,t=!1){if(!e)return`↯`;let r=R(_().theme);return t?n.dim(u(`promptBorder`,r)(`↯`)):u(`fastMode`,r)(`↯`)}var H,U=e((()=>{r(),a(),m(),l(),k(),z(),H=f()}));function W(e,t){E(),x(`userSettings`,{fastMode:e?!0:void 0}),t(e?e=>{let t=!h(e.mainLoopModel);return{...e,...t?{mainLoopModel:v(),mainLoopModelForSession:null}:{},fastMode:!0}}:e=>({...e,fastMode:!1}))}function G({onDone:e,unavailableReason:t}){let n=I(e=>e.mainLoopModel),r=I(e=>e.fastMode),a=P(),[l,u]=(0,J.useState)(r??!1),f=y(),p=f.status===`cooldown`,m=t!==null,g=C(T(!0));function _(){m||(W(l,a),j(`tengu_fast_mode_toggled`,{enabled:l,source:`picker`}),l?e(`${V(l)} Fast mode ON${h(n)?``:` · model set to ${b}`} · ${g}`):(a(e=>({...e,fastMode:!1})),e(`Fast mode OFF`)))}function v(){if(m){r&&W(!1,a),e(`Fast mode OFF`,{display:`system`});return}e(r?`${V()} Kept Fast mode ON`:`Kept Fast mode OFF`,{display:`system`})}function x(){m||u(e=>!e)}return c({"confirm:yes":_,"confirm:nextField":x,"confirm:next":x,"confirm:previous":x,"confirm:cycleMode":x,"confirm:toggle":x},{context:`Confirmation`}),(0,Y.jsxs)(s,{title:(0,Y.jsxs)(o,{children:[(0,Y.jsx)(B,{cooldown:p}),` Fast mode (research preview)`]}),subtitle:`High-speed mode for ${b}. Billed as extra usage at a premium rate. Separate rate limits apply.`,onCancel:v,color:`fastMode`,inputGuide:e=>e.pending?(0,Y.jsxs)(o,{children:[`Press `,e.keyName,` again to exit`]}):m?(0,Y.jsx)(o,{children:`Esc to cancel`}):(0,Y.jsx)(o,{children:`Tab to toggle · Enter to confirm · Esc to cancel`}),children:[t?(0,Y.jsx)(d,{marginLeft:2,children:(0,Y.jsx)(o,{color:`error`,children:t})}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(d,{flexDirection:`column`,gap:0,marginLeft:2,children:(0,Y.jsxs)(d,{flexDirection:`row`,gap:2,children:[(0,Y.jsx)(o,{bold:!0,children:`Fast mode`}),(0,Y.jsx)(o,{color:l?`fastMode`:void 0,bold:l,children:l?`ON `:`OFF`}),(0,Y.jsx)(o,{dimColor:!0,children:g})]})}),p&&f.status===`cooldown`&&(0,Y.jsx)(d,{marginLeft:2,children:(0,Y.jsxs)(o,{color:`warning`,children:[f.reason===`overloaded`?`Fast mode overloaded and is temporarily unavailable`:`You've hit your fast limit`,` · resets in `,M(f.resetAt-Date.now(),{hideTrailingZeros:!0})]})})]}),(0,Y.jsxs)(o,{dimColor:!0,children:[`Learn more:`,` `,(0,Y.jsx)(i,{url:`https://code.claude.com/docs/en/fast-mode`,children:`https://code.claude.com/docs/en/fast-mode`})]})]})}async function K(e,t,n){let r=S();if(r)return`Fast mode unavailable: ${r}`;let{mainLoopModel:i}=t();return W(e,n),j(`tengu_fast_mode_toggled`,{enabled:e,source:`shortcut`}),e?`${V(!0)} Fast mode ON${h(i)?``:` · model set to ${b}`} · ${C(T(!0))}`:`Fast mode OFF`}async function q(e,t,n){if(!O())return null;await p();let r=n?.trim().toLowerCase();if(r===`on`||r===`off`)return e(await K(r===`on`,t.getAppState,t.setAppState)),null;let i=S();return j(`tengu_fast_mode_picker_shown`,{unavailable_reason:i??``}),(0,Y.jsx)(G,{onDone:e,unavailableReason:i})}var J,Y,X=e((()=>{a(),J=t(a(),1),l(),U(),L(),A(),F(),D(),N(),g(),w(),Y=f()}));export{U as a,V as i,q as n,X as r,G as t};
1
+ import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{In as n,Ln as r,Q as i,Rn as a,b as o,f as s,nt as c,t as l,v as u,x as d}from"./src-Di342QoJ.js";import{t as f}from"./jsx-runtime-D-D469L8.js";import{Di as p,Ps as m,Si as h,ci as g,dc as _,di as v,fi as y,li as b,lo as x,mi as S,oi as C,oo as w,si as T,ui as E,vi as D,xi as O,yc as k}from"./paths-DO4WOQtD.js";import{n as A,r as j}from"./analytics-DqMQntaB.js";import{d as M,x as N}from"./startupProfiler-CAntGAbs.js";import{fC as P,lC as F,uC as I}from"./loadAgentsDir-ClTeo0nk.js";import{t as L}from"./useKeybinding-DPOUuymz.js";import{n as R,t as z}from"./systemTheme-eRWGHYSL.js";function B({cooldown:e}){return e?(0,H.jsx)(o,{color:`promptBorder`,dimColor:!0,children:`↯`}):(0,H.jsx)(o,{color:`fastMode`,children:`↯`})}function V(e=!0,t=!1){if(!e)return`↯`;let r=R(_().theme);return t?n.dim(u(`promptBorder`,r)(`↯`)):u(`fastMode`,r)(`↯`)}var H,U=e((()=>{r(),a(),m(),l(),k(),z(),H=f()}));function W(e,t){E(),x(`userSettings`,{fastMode:e?!0:void 0}),t(e?e=>{let t=!h(e.mainLoopModel);return{...e,...t?{mainLoopModel:v(),mainLoopModelForSession:null}:{},fastMode:!0}}:e=>({...e,fastMode:!1}))}function G({onDone:e,unavailableReason:t}){let n=I(e=>e.mainLoopModel),r=I(e=>e.fastMode),a=P(),[l,u]=(0,J.useState)(r??!1),f=y(),p=f.status===`cooldown`,m=t!==null,g=C(T(!0));function _(){m||(W(l,a),j(`tengu_fast_mode_toggled`,{enabled:l,source:`picker`}),l?e(`${V(l)} Fast mode ON${h(n)?``:` · model set to ${b}`} · ${g}`):(a(e=>({...e,fastMode:!1})),e(`Fast mode OFF`)))}function v(){if(m){r&&W(!1,a),e(`Fast mode OFF`,{display:`system`});return}e(r?`${V()} Kept Fast mode ON`:`Kept Fast mode OFF`,{display:`system`})}function x(){m||u(e=>!e)}return c({"confirm:yes":_,"confirm:nextField":x,"confirm:next":x,"confirm:previous":x,"confirm:cycleMode":x,"confirm:toggle":x},{context:`Confirmation`}),(0,Y.jsxs)(s,{title:(0,Y.jsxs)(o,{children:[(0,Y.jsx)(B,{cooldown:p}),` Fast mode (research preview)`]}),subtitle:`High-speed mode for ${b}. Billed as extra usage at a premium rate. Separate rate limits apply.`,onCancel:v,color:`fastMode`,inputGuide:e=>e.pending?(0,Y.jsxs)(o,{children:[`Press `,e.keyName,` again to exit`]}):m?(0,Y.jsx)(o,{children:`Esc to cancel`}):(0,Y.jsx)(o,{children:`Tab to toggle · Enter to confirm · Esc to cancel`}),children:[t?(0,Y.jsx)(d,{marginLeft:2,children:(0,Y.jsx)(o,{color:`error`,children:t})}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(d,{flexDirection:`column`,gap:0,marginLeft:2,children:(0,Y.jsxs)(d,{flexDirection:`row`,gap:2,children:[(0,Y.jsx)(o,{bold:!0,children:`Fast mode`}),(0,Y.jsx)(o,{color:l?`fastMode`:void 0,bold:l,children:l?`ON `:`OFF`}),(0,Y.jsx)(o,{dimColor:!0,children:g})]})}),p&&f.status===`cooldown`&&(0,Y.jsx)(d,{marginLeft:2,children:(0,Y.jsxs)(o,{color:`warning`,children:[f.reason===`overloaded`?`Fast mode overloaded and is temporarily unavailable`:`You've hit your fast limit`,` · resets in `,M(f.resetAt-Date.now(),{hideTrailingZeros:!0})]})})]}),(0,Y.jsxs)(o,{dimColor:!0,children:[`Learn more:`,` `,(0,Y.jsx)(i,{url:`https://code.claude.com/docs/en/fast-mode`,children:`https://code.claude.com/docs/en/fast-mode`})]})]})}async function K(e,t,n){let r=S();if(r)return`Fast mode unavailable: ${r}`;let{mainLoopModel:i}=t();return W(e,n),j(`tengu_fast_mode_toggled`,{enabled:e,source:`shortcut`}),e?`${V(!0)} Fast mode ON${h(i)?``:` · model set to ${b}`} · ${C(T(!0))}`:`Fast mode OFF`}async function q(e,t,n){if(!O())return null;await p();let r=n?.trim().toLowerCase();if(r===`on`||r===`off`)return e(await K(r===`on`,t.getAppState,t.setAppState)),null;let i=S();return j(`tengu_fast_mode_picker_shown`,{unavailable_reason:i??``}),(0,Y.jsx)(G,{onDone:e,unavailableReason:i})}var J,Y,X=e((()=>{a(),J=t(a(),1),l(),U(),L(),A(),F(),D(),N(),g(),w(),Y=f()}));export{U as a,V as i,q as n,X as r,G as t};
@@ -0,0 +1 @@
1
+ import{n as e,r as t,t as n}from"./fast-DS3iQ1CH.js";t();export{n as FastModePicker,e as call};
@@ -1 +1 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{Rn as t}from"./src-Di342QoJ.js";import{t as n}from"./jsx-runtime-D-D469L8.js";import{n as r,t as i}from"./Feedback-Diw8XUr-.js";function a(e,t,n,r=``,a={}){return(0,s.jsx)(i,{abortSignal:t,messages:n,initialDescription:r,onDone:e,backgroundTasks:a})}async function o(e,t,n){let r=n||``;return a(e,t.abortController.signal,t.messages,r)}var s;e((()=>{t(),r(),s=n()}))();export{o as call,a as renderFeedbackComponent};
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{Rn as t}from"./src-Di342QoJ.js";import{t as n}from"./jsx-runtime-D-D469L8.js";import{n as r,t as i}from"./Feedback-COgMI5tY.js";function a(e,t,n,r=``,a={}){return(0,s.jsx)(i,{abortSignal:t,messages:n,initialDescription:r,onDone:e,backgroundTasks:a})}async function o(e,t,n){let r=n||``;return a(e,t.abortController.signal,t.messages,r)}var s;e((()=>{t(),r(),s=n()}))();export{o as call,a as renderFeedbackComponent};
@@ -1 +1 @@
1
- import{F as e,I as t,L as n,M as r,N as i,P as a,R as o,j as s,z as c}from"./paths-Ci1iwL5Y.js";r();export{s as getEventSamplingConfig,i as initialize1PEventLogging,a as is1PEventLoggingEnabled,e as logEventTo1P,t as logGrowthBookExperimentTo1P,n as reinitialize1PEventLoggingIfConfigChanged,o as shouldSampleEvent,c as shutdown1PEventLogging};
1
+ import{F as e,I as t,L as n,M as r,N as i,P as a,R as o,j as s,z as c}from"./paths-DO4WOQtD.js";r();export{s as getEventSamplingConfig,i as initialize1PEventLogging,a as is1PEventLoggingEnabled,e as logEventTo1P,t as logGrowthBookExperimentTo1P,n as reinitialize1PEventLoggingIfConfigChanged,o as shouldSampleEvent,c as shutdown1PEventLogging};
@@ -1 +1 @@
1
- import{n as e,t}from"./defineProperty-80gRi2ZW.js";import{U as n,l as r,p as i,z as a}from"./debug-otxXY3j-.js";import{O as o,k as s}from"./rcDebugLog-C42A0pX1.js";import{i as c}from"./workSecret-DJu7k30X.js";import{t as l}from"./ccrClient-BI1QPLmN.js";import{n as u,t as d}from"./SSETransport-D3e5KNL3.js";u(),r(),n(),o();function f(e){return{write:t=>e.write(t),writeBatch:t=>e.writeBatch(t),close:()=>e.close(),isConnectedStatus:()=>e.isConnectedStatus(),getStateLabel:()=>e.getStateLabel(),setOnData:t=>e.setOnData(t),setOnClose:t=>e.setOnClose(t),setOnConnect:t=>e.setOnConnect(t),connect:()=>void e.connect(),getLastSequenceNum:()=>0,get droppedBatchCount(){return e.droppedBatchCount},reportState:()=>{},reportMetadata:()=>{},reportDelivery:()=>{},flush:()=>Promise.resolve()}}async function p(e){let{sessionUrl:t,ingressToken:n,sessionId:r,initialSequenceNum:o,getAuthToken:u}=e,f;u?f=()=>{let e=u();return e?{Authorization:`Bearer ${e}`}:{}}:s(n);let p=e.epoch??await c(t,n);i(`[bridge:repl] CCR v2: worker sessionId=${r} epoch=${p}${e.epoch===void 0?` (via registerWorker)`:` (from /bridge)`}`);let m=new URL(t);m.pathname=m.pathname.replace(/\/$/,``)+`/worker/events/stream`;let h=new d(m,{},r,void 0,o,f),g,_=new l(h,new URL(t),{getAuthHeaders:f,heartbeatIntervalMs:e.heartbeatIntervalMs,heartbeatJitterFraction:e.heartbeatJitterFraction,onEpochMismatch:()=>{i(`[bridge:repl] CCR v2: epoch superseded (409) — closing for poll-loop recovery`);try{_.close(),h.close(),g?.(4090)}catch(e){i(`[bridge:repl] CCR v2: error during epoch-mismatch cleanup: ${a(e)}`,{level:`error`})}throw Error(`epoch superseded`)}});h.setOnEvent(e=>{_.reportDelivery(e.event_id,`received`),_.reportDelivery(e.event_id,`processed`)});let v,y=!1,b=!1;return{write(e){return _.writeEvent(e)},async writeBatch(e){for(let t of e){if(b)break;await _.writeEvent(t)}},close(){b=!0,_.close(),h.close()},isConnectedStatus(){return y},getStateLabel(){return h.isClosedStatus()?`closed`:h.isConnectedStatus()?y?`connected`:`init`:`connecting`},setOnData(e){h.setOnData(e)},setOnClose(e){g=e,h.setOnClose(t=>{_.close(),e(t??4092)})},setOnConnect(e){v=e},getLastSequenceNum(){return h.getLastSequenceNum()},droppedBatchCount:0,reportState(e){_.reportState(e)},reportMetadata(e){_.reportMetadata(e)},reportDelivery(e,t){_.reportDelivery(e,t)},flush(){return _.flush()},connect(){e.outboundOnly||h.connect(),_.initialize(p).then(()=>{y=!0,i(`[bridge:repl] v2 transport ready for writes (epoch=${p}, sse=${h.isConnectedStatus()?`open`:`opening`})`),v?.()},e=>{i(`[bridge:repl] CCR v2 initialize failed: ${a(e)}`,{level:`error`}),_.close(),h.close(),g?.(4091)})}}}e();var m=class{constructor(){t(this,`_active`,!1),t(this,`_pending`,[])}get active(){return this._active}get pendingCount(){return this._pending.length}start(){this._active=!0}end(){return this._active=!1,this._pending.splice(0)}enqueue(...e){return this._active?(this._pending.push(...e),!0):!1}drop(){this._active=!1;let e=this._pending.length;return this._pending.length=0,e}deactivate(){this._active=!1}};export{f as n,p as r,m as t};
1
+ import{n as e,t}from"./defineProperty-80gRi2ZW.js";import{U as n,l as r,p as i,z as a}from"./debug-otxXY3j-.js";import{O as o,k as s}from"./rcDebugLog-CwU_wJBE.js";import{i as c}from"./workSecret-DJu7k30X.js";import{t as l}from"./ccrClient-C1msT1E3.js";import{n as u,t as d}from"./SSETransport-kEH_p4Yq.js";u(),r(),n(),o();function f(e){return{write:t=>e.write(t),writeBatch:t=>e.writeBatch(t),close:()=>e.close(),isConnectedStatus:()=>e.isConnectedStatus(),getStateLabel:()=>e.getStateLabel(),setOnData:t=>e.setOnData(t),setOnClose:t=>e.setOnClose(t),setOnConnect:t=>e.setOnConnect(t),connect:()=>void e.connect(),getLastSequenceNum:()=>0,get droppedBatchCount(){return e.droppedBatchCount},reportState:()=>{},reportMetadata:()=>{},reportDelivery:()=>{},flush:()=>Promise.resolve()}}async function p(e){let{sessionUrl:t,ingressToken:n,sessionId:r,initialSequenceNum:o,getAuthToken:u}=e,f;u?f=()=>{let e=u();return e?{Authorization:`Bearer ${e}`}:{}}:s(n);let p=e.epoch??await c(t,n);i(`[bridge:repl] CCR v2: worker sessionId=${r} epoch=${p}${e.epoch===void 0?` (via registerWorker)`:` (from /bridge)`}`);let m=new URL(t);m.pathname=m.pathname.replace(/\/$/,``)+`/worker/events/stream`;let h=new d(m,{},r,void 0,o,f),g,_=new l(h,new URL(t),{getAuthHeaders:f,heartbeatIntervalMs:e.heartbeatIntervalMs,heartbeatJitterFraction:e.heartbeatJitterFraction,onEpochMismatch:()=>{i(`[bridge:repl] CCR v2: epoch superseded (409) — closing for poll-loop recovery`);try{_.close(),h.close(),g?.(4090)}catch(e){i(`[bridge:repl] CCR v2: error during epoch-mismatch cleanup: ${a(e)}`,{level:`error`})}throw Error(`epoch superseded`)}});h.setOnEvent(e=>{_.reportDelivery(e.event_id,`received`),_.reportDelivery(e.event_id,`processed`)});let v,y=!1,b=!1;return{write(e){return _.writeEvent(e)},async writeBatch(e){for(let t of e){if(b)break;await _.writeEvent(t)}},close(){b=!0,_.close(),h.close()},isConnectedStatus(){return y},getStateLabel(){return h.isClosedStatus()?`closed`:h.isConnectedStatus()?y?`connected`:`init`:`connecting`},setOnData(e){h.setOnData(e)},setOnClose(e){g=e,h.setOnClose(t=>{_.close(),e(t??4092)})},setOnConnect(e){v=e},getLastSequenceNum(){return h.getLastSequenceNum()},droppedBatchCount:0,reportState(e){_.reportState(e)},reportMetadata(e){_.reportMetadata(e)},reportDelivery(e,t){_.reportDelivery(e,t)},flush(){return _.flush()},connect(){e.outboundOnly||h.connect(),_.initialize(p).then(()=>{y=!0,i(`[bridge:repl] v2 transport ready for writes (epoch=${p}, sse=${h.isConnectedStatus()?`open`:`opening`})`),v?.()},e=>{i(`[bridge:repl] CCR v2 initialize failed: ${a(e)}`,{level:`error`}),_.close(),h.close(),g?.(4091)})}}}e();var m=class{constructor(){t(this,`_active`,!1),t(this,`_pending`,[])}get active(){return this._active}get pendingCount(){return this._pending.length}start(){this._active=!0}end(){return this._active=!1,this._pending.splice(0)}enqueue(...e){return this._active?(this._pending.push(...e),!0):!1}drop(){this._active=!1;let e=this._pending.length;return this._pending.length=0,e}deactivate(){this._active=!1}};export{f as n,p as r,m as t};
@@ -0,0 +1 @@
1
+ import{i as e,n as t}from"./gates-vlrMjO-X.js";e();export{t as getChicagoEnabled};
@@ -1 +1 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{s as t,u as n}from"./envUtils-BWeoiL4Y.js";import{S as r,g as i}from"./paths-Ci1iwL5Y.js";function a(){return{...u,...i(`tengu_malort_pedway`,u)}}function o(){return!0}function s(){return process.env.USER_TYPE===`ant`&&process.env.MONOREPO_ROOT_DIR&&!n(process.env.ALLOW_ANT_COMPUTER_USE_MCP)?!1:o()&&a().enabled}function c(){let{enabled:e,coordinateMode:t,...n}=a();return n}function l(){return d??(d=a().coordinateMode),d}var u,d,f=e((()=>{r(),t(),u={enabled:!0,pixelValidation:!1,clipboardPasteMultiline:!0,mouseAnimation:!0,hideBeforeAction:!0,autoTargetDisplay:!0,clipboardGuard:!0,coordinateMode:`pixels`}}));export{f as i,s as n,c as r,l as t};
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{s as t,u as n}from"./envUtils-BWeoiL4Y.js";import{S as r,g as i}from"./paths-DO4WOQtD.js";function a(){return{...u,...i(`tengu_malort_pedway`,u)}}function o(){return!0}function s(){return process.env.USER_TYPE===`ant`&&process.env.MONOREPO_ROOT_DIR&&!n(process.env.ALLOW_ANT_COMPUTER_USE_MCP)?!1:o()&&a().enabled}function c(){let{enabled:e,coordinateMode:t,...n}=a();return n}function l(){return d??(d=a().coordinateMode),d}var u,d,f=e((()=>{r(),t(),u={enabled:!0,pixelValidation:!1,clipboardPasteMultiline:!0,mouseAnimation:!0,hideBeforeAction:!0,autoTargetDisplay:!0,clipboardGuard:!0,coordinateMode:`pixels`}}));export{f as i,s as n,c as r,l as t};
@@ -1 +1 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{U as t,l as n,p as r,z as i}from"./debug-otxXY3j-.js";import{o as a,u as o}from"./proxy-CF7ZDxaW.js";import{G_ as s,K_ as c,Qo as l,Uo as u,W_ as d,Xo as f,dD as p,mo as m,q_ as h,st as g,uD as _,ut as v}from"./loadAgentsDir-C_wFhytF.js";import{G as y,H as b,K as x,P as S,U as C,W as w,q as T}from"./rcDebugLog-C42A0pX1.js";import{n as E,r as D}from"./SSETransport-D3e5KNL3.js";import{randomUUID as O}from"crypto";function k(){return(process.env.GEMINI_BASE_URL||M).replace(/\/+$/,``)}function A(e){let t=e.replace(/^\/+/,``);return t.startsWith(`models/`)?t:`models/${t}`}async function*j(e){let t=await(e.fetchOverride??fetch)(`${k()}/${A(e.model)}:streamGenerateContent?alt=sse`,{method:`POST`,headers:{"Content-Type":`application/json`,"x-goog-api-key":process.env.GEMINI_API_KEY||``},body:JSON.stringify(e.body),signal:e.signal,...a({forAnthropicAPI:!1})});if(!t.ok){let e=await t.text();throw Error(`Gemini API request failed (${t.status} ${t.statusText}): ${e||`empty response body`}`)}if(!t.body)throw Error(`Gemini API returned no response body`);let n=t.body.getReader(),r=new TextDecoder,o=``;try{for(;;){let{done:e,value:t}=await n.read();if(e)break;o+=r.decode(t,N);let{frames:a,remaining:s}=D(o);o=s;for(let e of a)if(!(!e.data||e.data===`[DONE]`))try{yield JSON.parse(e.data)}catch(e){throw Error(`Failed to parse Gemini SSE payload: ${i(e)}`)}}o+=r.decode();let{frames:e}=D(o);for(let t of e)if(!(!t.data||t.data===`[DONE]`))try{yield JSON.parse(t.data)}catch(e){throw Error(`Failed to parse trailing Gemini SSE payload: ${i(e)}`)}}finally{n.releaseLock()}}var M,N,P=e((()=>{E(),t(),o(),M=`https://generativelanguage.googleapis.com/v1beta`,N={stream:!0}}));async function*F(e,t,n,i,a,o){try{let u=T(a.model),m=l(e,n),h=await Promise.all(n.map(e=>v(e,{getToolPermissionContext:a.getToolPermissionContext,tools:n,agents:a.agents,allowedAgentTypes:a.allowedAgentTypes,model:a.model}))),g=h.filter(e=>{let t=e;return t.type!==`advisor_20260301`&&t.type!==`computer_20250124`}),{contents:_,systemInstruction:S}=y(m,t),E=w(g),D=C(a.toolChoice),k=j({model:u,signal:i,fetchOverride:a.fetchOverride,body:{contents:_,...S&&{systemInstruction:S},...E.length>0&&{tools:E},...D&&{toolConfig:{functionCallingConfig:D}},generationConfig:{...a.temperatureOverride!==void 0&&{temperature:a.temperatureOverride},...o.type!==`disabled`&&{thinkingConfig:{includeThoughts:!0,...o.type===`enabled`&&{thinkingBudget:o.budgetTokens}}}}}});r(`[Gemini] Calling model=${u}, messages=${_.length}, tools=${E.length}`);let A=b(k,u),M={},N=[],P=null,F=0,I=Date.now();for await(let e of A){switch(e.type){case`message_start`:P=e.message,F=Date.now()-I;break;case`content_block_start`:{let t=e.index,n=e.content_block;n.type===`tool_use`?M[t]={...n,input:``}:n.type===`text`?M[t]={...n,text:``}:n.type===`thinking`?M[t]={...n,thinking:``,signature:``}:M[t]={...n};break}case`content_block_delta`:{let t=e.index,n=e.delta,r=M[t];if(!r)break;n.type===`text_delta`?r.text=(r.text||``)+n.text:n.type===`input_json_delta`?r.input=(r.input||``)+n.partial_json:n.type===`thinking_delta`?r.thinking=(r.thinking||``)+n.thinking:n.type===`signature_delta`&&(r.type===`thinking`?r.signature=n.signature:r[x]=n.signature);break}case`content_block_stop`:{let t=M[e.index];if(!t||!P)break;let r={message:{...P,content:f([t],n,a.agentId)},requestId:void 0,type:`assistant`,uuid:O(),timestamp:new Date().toISOString()};N.push(r),yield r;break}case`message_delta`:case`message_stop`:break}yield{type:`stream_event`,event:e,...e.type===`message_start`?{ttftMs:F}:void 0}}p(a.langfuseTrace??null,{model:u,provider:`gemini`,input:d(m,t),output:s(N),usage:{input_tokens:0,output_tokens:0},startTime:new Date(I),endTime:new Date,completionStartTime:F>0?new Date(I+F):void 0,tools:c(h),thinking:o.type===`disabled`?void 0:{type:o.type,...o.type===`enabled`&&{budgetTokens:o.budgetTokens}}})}catch(e){let t=e instanceof Error?e.message:String(e);r(`[Gemini] Error: ${t}`,{level:`error`}),yield m({content:`API Error: ${t}`,apiError:`api_error`,error:e instanceof Error?e:Error(String(e))})}}e((()=>{g(),n(),u(),_(),h(),P(),S()}))();export{F as queryModelGemini};
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{U as t,l as n,p as r,z as i}from"./debug-otxXY3j-.js";import{o as a,u as o}from"./proxy-CF7ZDxaW.js";import{G_ as s,H_ as c,Qo as l,U_ as u,Uo as d,W_ as f,Xo as p,dD as m,mo as h,st as g,uD as _,ut as v}from"./loadAgentsDir-ClTeo0nk.js";import{G as y,H as b,K as x,P as S,U as C,W as w,q as T}from"./rcDebugLog-CwU_wJBE.js";import{n as E,r as D}from"./SSETransport-kEH_p4Yq.js";import{randomUUID as O}from"crypto";function k(){return(process.env.GEMINI_BASE_URL||M).replace(/\/+$/,``)}function A(e){let t=e.replace(/^\/+/,``);return t.startsWith(`models/`)?t:`models/${t}`}async function*j(e){let t=await(e.fetchOverride??fetch)(`${k()}/${A(e.model)}:streamGenerateContent?alt=sse`,{method:`POST`,headers:{"Content-Type":`application/json`,"x-goog-api-key":process.env.GEMINI_API_KEY||``},body:JSON.stringify(e.body),signal:e.signal,...a({forAnthropicAPI:!1})});if(!t.ok){let e=await t.text();throw Error(`Gemini API request failed (${t.status} ${t.statusText}): ${e||`empty response body`}`)}if(!t.body)throw Error(`Gemini API returned no response body`);let n=t.body.getReader(),r=new TextDecoder,o=``;try{for(;;){let{done:e,value:t}=await n.read();if(e)break;o+=r.decode(t,N);let{frames:a,remaining:s}=D(o);o=s;for(let e of a)if(!(!e.data||e.data===`[DONE]`))try{yield JSON.parse(e.data)}catch(e){throw Error(`Failed to parse Gemini SSE payload: ${i(e)}`)}}o+=r.decode();let{frames:e}=D(o);for(let t of e)if(!(!t.data||t.data===`[DONE]`))try{yield JSON.parse(t.data)}catch(e){throw Error(`Failed to parse trailing Gemini SSE payload: ${i(e)}`)}}finally{n.releaseLock()}}var M,N,P=e((()=>{E(),t(),o(),M=`https://generativelanguage.googleapis.com/v1beta`,N={stream:!0}}));async function*F(e,t,n,i,a,o){try{let s=T(a.model),d=l(e,n),h=await Promise.all(n.map(e=>v(e,{getToolPermissionContext:a.getToolPermissionContext,tools:n,agents:a.agents,allowedAgentTypes:a.allowedAgentTypes,model:a.model}))),g=h.filter(e=>{let t=e;return t.type!==`advisor_20260301`&&t.type!==`computer_20250124`}),{contents:_,systemInstruction:S}=y(d,t),E=w(g),D=C(a.toolChoice),k=j({model:s,signal:i,fetchOverride:a.fetchOverride,body:{contents:_,...S&&{systemInstruction:S},...E.length>0&&{tools:E},...D&&{toolConfig:{functionCallingConfig:D}},generationConfig:{...a.temperatureOverride!==void 0&&{temperature:a.temperatureOverride},...o.type!==`disabled`&&{thinkingConfig:{includeThoughts:!0,...o.type===`enabled`&&{thinkingBudget:o.budgetTokens}}}}}});r(`[Gemini] Calling model=${s}, messages=${_.length}, tools=${E.length}`);let A=b(k,s),M={},N=[],P=null,F=0,I=Date.now();for await(let e of A){switch(e.type){case`message_start`:P=e.message,F=Date.now()-I;break;case`content_block_start`:{let t=e.index,n=e.content_block;n.type===`tool_use`?M[t]={...n,input:``}:n.type===`text`?M[t]={...n,text:``}:n.type===`thinking`?M[t]={...n,thinking:``,signature:``}:M[t]={...n};break}case`content_block_delta`:{let t=e.index,n=e.delta,r=M[t];if(!r)break;n.type===`text_delta`?r.text=(r.text||``)+n.text:n.type===`input_json_delta`?r.input=(r.input||``)+n.partial_json:n.type===`thinking_delta`?r.thinking=(r.thinking||``)+n.thinking:n.type===`signature_delta`&&(r.type===`thinking`?r.signature=n.signature:r[x]=n.signature);break}case`content_block_stop`:{let t=M[e.index];if(!t||!P)break;let r={message:{...P,content:p([t],n,a.agentId)},requestId:void 0,type:`assistant`,uuid:O(),timestamp:new Date().toISOString()};N.push(r),yield r;break}case`message_delta`:case`message_stop`:break}yield{type:`stream_event`,event:e,...e.type===`message_start`?{ttftMs:F}:void 0}}m(a.langfuseTrace??null,{model:s,provider:`gemini`,input:c(d,t),output:u(N),usage:{input_tokens:0,output_tokens:0},startTime:new Date(I),endTime:new Date,completionStartTime:F>0?new Date(I+F):void 0,tools:f(h),thinking:o.type===`disabled`?void 0:{type:o.type,...o.type===`enabled`&&{budgetTokens:o.budgetTokens}}})}catch(e){let t=e instanceof Error?e.message:String(e);r(`[Gemini] Error: ${t}`,{level:`error`}),yield h({content:`API Error: ${t}`,apiError:`api_error`,error:e instanceof Error?e:Error(String(e))})}}e((()=>{g(),n(),d(),_(),s(),P(),S()}))();export{F as queryModelGemini};
@@ -1 +1 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{g as t}from"./client-_sjL0I7A.js";import{l as n,p as r}from"./debug-otxXY3j-.js";import{t as i}from"./sdk-DEtgRZvI.js";import{Bl as a,Eo as o,Ll as s,Rl as c,Uo as l,jo as u}from"./loadAgentsDir-C_wFhytF.js";async function d(){try{let{getResolvedLanguage:e}=await import(`./language-BoKr5ylY.js`);return e()===`zh`?m:p}catch{return p}}async function f(e){let n=s();if(!n)return r(`[recap] no CacheSafeParams saved, skipping`),{kind:`no-turn`};let i=new AbortController;e.addEventListener(`abort`,()=>i.abort(),{once:!0});try{let{messages:t}=await a({promptMessages:[o({content:await d()})],cacheSafeParams:n,canUseTool:async()=>({behavior:`deny`,message:`Recap cannot use tools`,decisionReason:{type:`other`,reason:`away_summary`}}),overrides:{abortController:i},querySource:`away_summary`,forkLabel:`away_summary`,maxTurns:1,skipCacheWrite:!0,skipTranscript:!0});if(e.aborted)return{kind:`aborted`};let r=t.find(e=>e.type===`assistant`&&e.isApiErrorMessage);if(r)return{kind:`api-error`,text:u(r)??``};let s=t.filter(e=>e.type===`assistant`&&!e.isApiErrorMessage).pop();if(!s)return{kind:`failed`};let c=u(s);return!c||c.trim().length===0?{kind:`failed`}:{kind:`ok`,text:c.trim()}}catch(n){return n instanceof t||e.aborted||i.signal.aborted?{kind:`aborted`}:(r(`[recap] generation failed: ${n}`),{kind:`failed`})}}var p,m;e((()=>{i(),n(),c(),l(),p=`The user stepped away and is coming back. Recap in under 40 words, 1-2 plain sentences, no markdown. Lead with the overall goal and current task, then the one next action. Skip root-cause narrative, fix internals, secondary to-dos, and em-dash tangents.`,m=`用户离开后回来了。用中文写 1-2 句话,不超过 60 字,无 markdown。先说明高层目标和当前任务,再说明下一步操作。跳过根因分析和次要待办。`}))();export{f as generateRecap};
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{g as t}from"./client-_sjL0I7A.js";import{l as n,p as r}from"./debug-otxXY3j-.js";import{t as i}from"./sdk-DEtgRZvI.js";import{Bl as a,Eo as o,Ll as s,Rl as c,Uo as l,jo as u}from"./loadAgentsDir-ClTeo0nk.js";async function d(){try{let{getResolvedLanguage:e}=await import(`./language-Bzp5KDCE.js`);return e()===`zh`?m:p}catch{return p}}async function f(e){let n=s();if(!n)return r(`[recap] no CacheSafeParams saved, skipping`),{kind:`no-turn`};let i=new AbortController;e.addEventListener(`abort`,()=>i.abort(),{once:!0});try{let{messages:t}=await a({promptMessages:[o({content:await d()})],cacheSafeParams:n,canUseTool:async()=>({behavior:`deny`,message:`Recap cannot use tools`,decisionReason:{type:`other`,reason:`away_summary`}}),overrides:{abortController:i},querySource:`away_summary`,forkLabel:`away_summary`,maxTurns:1,skipCacheWrite:!0,skipTranscript:!0});if(e.aborted)return{kind:`aborted`};let r=t.find(e=>e.type===`assistant`&&e.isApiErrorMessage);if(r)return{kind:`api-error`,text:u(r)??``};let s=t.filter(e=>e.type===`assistant`&&!e.isApiErrorMessage).pop();if(!s)return{kind:`failed`};let c=u(s);return!c||c.trim().length===0?{kind:`failed`}:{kind:`ok`,text:c.trim()}}catch(n){return n instanceof t||e.aborted||i.signal.aborted?{kind:`aborted`}:(r(`[recap] generation failed: ${n}`),{kind:`failed`})}}var p,m;e((()=>{i(),n(),c(),l(),p=`The user stepped away and is coming back. Recap in under 40 words, 1-2 plain sentences, no markdown. Lead with the overall goal and current task, then the one next action. Skip root-cause narrative, fix internals, secondary to-dos, and em-dash tangents.`,m=`用户离开后回来了。用中文写 1-2 句话,不超过 60 字,无 markdown。先说明高层目标和当前任务,再说明下一步操作。跳过根因分析和次要待办。`}))();export{f as generateRecap};
@@ -1 +1 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{U as t,l as n,p as r,z as i}from"./debug-otxXY3j-.js";import{s as a,u as o}from"./types-KeqFPzY5.js";import{Uo as s,ck as c,ko as l,nt as u,tt as d}from"./loadAgentsDir-C_wFhytF.js";import{X as f}from"./rcDebugLog-C42A0pX1.js";import{r as p,t as m}from"./sessionTitle-DEKvIVCK.js";async function h(e,t){let n=m(e);if(!n)return null;try{let e=await u({systemPrompt:f([`Generate a short kebab-case name (2-4 words) that captures the main topic of this conversation. Use lowercase words separated by hyphens. Examples: "fix-login-bug", "add-auth-feature", "refactor-api-client", "debug-test-failures". Return JSON with a "name" field.`]),userPrompt:n,outputFormat:{type:`json_schema`,schema:{type:`object`,properties:{name:{type:`string`}},required:[`name`],additionalProperties:!1}},signal:t,options:{querySource:`rename_generate_name`,agents:[],isNonInteractiveSession:!1,hasAppendSystemPrompt:!1,mcpTools:[]}}),r=o(Array.isArray(e.message.content)?l(e.message.content):e.message.content);return r&&typeof r==`object`&&`name`in r&&typeof r.name==`string`?r.name:null}catch(e){return r(`generateSessionName failed: ${i(e)}`,{level:`error`}),null}}var g=e((()=>{d(),n(),t(),a(),s(),p(),c()}));export{g as n,h as t};
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{U as t,l as n,p as r,z as i}from"./debug-otxXY3j-.js";import{s as a,u as o}from"./types-KeqFPzY5.js";import{Uo as s,ck as c,ko as l,nt as u,tt as d}from"./loadAgentsDir-ClTeo0nk.js";import{X as f}from"./rcDebugLog-CwU_wJBE.js";import{r as p,t as m}from"./sessionTitle-CkrnWEW1.js";async function h(e,t){let n=m(e);if(!n)return null;try{let e=await u({systemPrompt:f([`Generate a short kebab-case name (2-4 words) that captures the main topic of this conversation. Use lowercase words separated by hyphens. Examples: "fix-login-bug", "add-auth-feature", "refactor-api-client", "debug-test-failures". Return JSON with a "name" field.`]),userPrompt:n,outputFormat:{type:`json_schema`,schema:{type:`object`,properties:{name:{type:`string`}},required:[`name`],additionalProperties:!1}},signal:t,options:{querySource:`rename_generate_name`,agents:[],isNonInteractiveSession:!1,hasAppendSystemPrompt:!1,mcpTools:[]}}),r=o(Array.isArray(e.message.content)?l(e.message.content):e.message.content);return r&&typeof r==`object`&&`name`in r&&typeof r.name==`string`?r.name:null}catch(e){return r(`generateSessionName failed: ${i(e)}`,{level:`error`}),null}}var g=e((()=>{d(),n(),t(),a(),s(),p(),c()}));export{g as n,h as t};
@@ -1 +1 @@
1
- import{cn as e,ot as t}from"./state-sIHsFpDu.js";import{Cc as n,Jc as r,Uc as i,dc as a,yc as o}from"./paths-Ci1iwL5Y.js";import{l as s,p as c}from"./debug-otxXY3j-.js";import{E as l,T as u,r as d,v as f}from"./git-C0IuvuIy.js";import{a as p,n as m,o as h}from"./detectRepository-2ICvGD0U.js";import{realpath as g}from"fs/promises";e(),o(),s(),p(),i(),l(),f();async function _(){try{let e=await m();if(!e){c(`Not in a GitHub repository, skipping path mapping update`);return}let r=t(),i=d(r)??r,o;try{o=(await g(i)).normalize(`NFC`)}catch{o=i}let s=e.toLowerCase(),l=a().githubRepoPaths?.[s]??[];if(l[0]===o){c(`Path ${o} already tracked for repo ${s}`);return}let u=l.filter(e=>e!==o),f=[o,...u];n(e=>({...e,githubRepoPaths:{...e.githubRepoPaths,[s]:f}})),c(`Added ${o} to tracked paths for repo ${s}`)}catch(e){c(`Error updating repo path mapping: ${e}`)}}function v(e){let t=a(),n=e.toLowerCase();return t.githubRepoPaths?.[n]??[]}async function y(e){let t=await Promise.all(e.map(r));return e.filter((e,n)=>t[n])}async function b(e,t){try{let n=await u(e);if(!n)return!1;let r=h(n);return r?r.toLowerCase()===t.toLowerCase():!1}catch{return!1}}function x(e,t){let r=a(),i=e.toLowerCase(),o=r.githubRepoPaths?.[i]??[],s=o.filter(e=>e!==t);if(s.length===o.length)return;let l={...r.githubRepoPaths};s.length===0?delete l[i]:l[i]=s,n(e=>({...e,githubRepoPaths:l})),c(`Removed ${t} from tracked paths for repo ${i}`)}export{b as a,_ as i,v as n,x as r,y as t};
1
+ import{cn as e,ot as t}from"./state-sIHsFpDu.js";import{Cc as n,Jc as r,Uc as i,dc as a,yc as o}from"./paths-DO4WOQtD.js";import{l as s,p as c}from"./debug-otxXY3j-.js";import{E as l,T as u,r as d,v as f}from"./git-C0IuvuIy.js";import{a as p,n as m,o as h}from"./detectRepository-2ICvGD0U.js";import{realpath as g}from"fs/promises";e(),o(),s(),p(),i(),l(),f();async function _(){try{let e=await m();if(!e){c(`Not in a GitHub repository, skipping path mapping update`);return}let r=t(),i=d(r)??r,o;try{o=(await g(i)).normalize(`NFC`)}catch{o=i}let s=e.toLowerCase(),l=a().githubRepoPaths?.[s]??[];if(l[0]===o){c(`Path ${o} already tracked for repo ${s}`);return}let u=l.filter(e=>e!==o),f=[o,...u];n(e=>({...e,githubRepoPaths:{...e.githubRepoPaths,[s]:f}})),c(`Added ${o} to tracked paths for repo ${s}`)}catch(e){c(`Error updating repo path mapping: ${e}`)}}function v(e){let t=a(),n=e.toLowerCase();return t.githubRepoPaths?.[n]??[]}async function y(e){let t=await Promise.all(e.map(r));return e.filter((e,n)=>t[n])}async function b(e,t){try{let n=await u(e);if(!n)return!1;let r=h(n);return r?r.toLowerCase()===t.toLowerCase():!1}catch{return!1}}function x(e,t){let r=a(),i=e.toLowerCase(),o=r.githubRepoPaths?.[i]??[],s=o.filter(e=>e!==t);if(s.length===o.length)return;let l={...r.githubRepoPaths};s.length===0?delete l[i]:l[i]=s,n(e=>({...e,githubRepoPaths:l})),c(`Removed ${t} from tracked paths for repo ${i}`)}export{b as a,_ as i,v as n,x as r,y as t};
@@ -1,3 +1,3 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{Rn 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{Bm as o,By as s,Fm as c,Hm as l,Im as u,KO as d,Lm as f,Mm as p,Nm as m,Pm as h,Um as g,Wm as _,ZO as v,aS as y,cd as b,od as x,sd as S,zm as C}from"./loadAgentsDir-C_wFhytF.js";import{n as w,t as T}from"./PermissionDialog-_WQPRYHQ.js";function E({currentGoal:e,newObjective:t,onConfirm:r,onCancel:a}){function o(e){e===`yes`?r():a()}let s=e.tokenBudget===null?`${e.tokensUsed}`:`${e.tokensUsed} / ${e.tokenBudget}`;return(0,D.jsx)(T,{color:`warning`,title:`Replace active goal?`,children:(0,D.jsxs)(i,{flexDirection:`column`,marginTop:1,paddingX:1,children:[(0,D.jsx)(n,{children:`A goal is already in progress. Replacing it will reset all progress and counters.`}),(0,D.jsxs)(i,{marginTop:1,flexDirection:`column`,children:[(0,D.jsx)(n,{dimColor:!0,children:`Current goal:`}),(0,D.jsxs)(n,{children:[(0,D.jsx)(n,{dimColor:!0,children:`· Objective: `}),e.objective]}),(0,D.jsxs)(n,{children:[(0,D.jsx)(n,{dimColor:!0,children:`· Status: `}),u(e.status)]}),(0,D.jsxs)(n,{children:[(0,D.jsx)(n,{dimColor:!0,children:`· Time: `}),c(e)]}),(0,D.jsxs)(n,{children:[(0,D.jsx)(n,{dimColor:!0,children:`· Tokens: `}),s]})]}),(0,D.jsxs)(i,{marginTop:1,flexDirection:`column`,children:[(0,D.jsx)(n,{dimColor:!0,children:`New objective:`}),(0,D.jsx)(n,{children:t})]}),(0,D.jsx)(i,{marginTop:1,children:(0,D.jsx)(y,{options:[{label:`Yes, replace the goal`,value:`yes`},{label:`No, keep the current goal`,value:`no`}],onChange:o,onCancel:a})})]})})}var D,O=e((()=>{t(),r(),s(),w(),o(),D=a()}));function k(e){let t=e.split(`
2
- `)[0]??e;return t.length<=I?t:t.slice(0,I)+`…`}function A(){v(e=>e.origin===`goal-continuation`||e.origin===`goal-budget-limit`)}function j(){let e=f();if(!e)return"No active goal. Set one with `/goal <objective>`.";let t=e.tokenBudget===null?`${e.tokensUsed}`:`${e.tokensUsed} / ${e.tokenBudget}`,n=[`Goal: ${e.objective}`,`Status: ${u(e.status)}`,`Time: ${c(e)}`,`Tokens: ${t}`,`Continuation turns: ${e.turnsExecuted}`];return e.status===`max_turns`&&n.push("Hint: Max continuation turns reached (150). Run `/goal continue` to reset and continue."),n.join(`
3
- `)}function M(e){return _(e),C(),S(),`Goal set.`}async function N(e,t,n){let r=n.trim();if(!r||r.toLowerCase()===`status`)return e(j(),{display:`system`}),null;let i=r.toLowerCase();if(i===`clear`){let t=p();return t&&(b(),A()),e(t?`Goal cleared.`:`No active goal to clear.`,{display:`system`}),null}if(i===`pause`){let t=l();return t&&(S(),A()),e(t?`Goal paused.`:`No active goal to pause.`,{display:`system`}),null}if(i===`resume`){if(f()?.status===`max_turns`)return e("Goal reached max continuation turns (150). Run `/goal continue` to reset turn counter and continue.",{display:`system`}),null;let t=g();return t&&S(),e(t?`Goal resumed.`:`No paused goal to resume.`,{display:`system`,shouldQuery:!!t}),null}if(i===`continue`){let t=h();return t&&S(),e(t?`Goal continuation counter reset (0/150). Continuing...`:`Current goal is not in max-turns state.`,{display:`system`,shouldQuery:!!t}),null}if(i===`complete`){let t=m();return t&&(S(),A()),e(t?`Goal marked complete.`:`No active goal to complete.`,{display:`system`}),null}if(r.length>F)return e(`Goal objective is too long (${r.length} chars; limit ${F}). Save the detailed instructions to a file and reference it from a shorter objective.`,{display:`system`}),null;let a=f();return a&&a.status!==`complete`?(0,P.jsx)(E,{currentGoal:a,newObjective:r,onConfirm:()=>{A(),e(M(r),{display:`system`,shouldQuery:!0,displayArgs:k(r),metaMessages:[`<goal-objective-updated>\n${r}\n</goal-objective-updated>`]})},onCancel:()=>{e(`Kept the current goal. New objective discarded.`,{display:`system`})}}):(e(M(r),{display:`system`,shouldQuery:!0,displayArgs:k(r),metaMessages:[`<goal-objective-updated>\n${r}\n</goal-objective-updated>`]}),null)}var P,F,I;e((()=>{t(),o(),x(),d(),O(),P=a(),F=4e3,I=80}))();export{N as call};
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{Rn 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{Bm as o,Fm as s,Hm as c,Im as l,KO as u,Lm as d,Mm as f,Nm as p,Pm as m,Ry as h,Um as g,Wm as _,ZO as v,aS as y,ad as b,id as x,od as S,zm as C}from"./loadAgentsDir-ClTeo0nk.js";import{n as w,t as T}from"./PermissionDialog-_WQPRYHQ.js";function E({currentGoal:e,newObjective:t,onConfirm:r,onCancel:a}){function o(e){e===`yes`?r():a()}let c=e.tokenBudget===null?`${e.tokensUsed}`:`${e.tokensUsed} / ${e.tokenBudget}`;return(0,D.jsx)(T,{color:`warning`,title:`Replace active goal?`,children:(0,D.jsxs)(i,{flexDirection:`column`,marginTop:1,paddingX:1,children:[(0,D.jsx)(n,{children:`A goal is already in progress. Replacing it will reset all progress and counters.`}),(0,D.jsxs)(i,{marginTop:1,flexDirection:`column`,children:[(0,D.jsx)(n,{dimColor:!0,children:`Current goal:`}),(0,D.jsxs)(n,{children:[(0,D.jsx)(n,{dimColor:!0,children:`· Objective: `}),e.objective]}),(0,D.jsxs)(n,{children:[(0,D.jsx)(n,{dimColor:!0,children:`· Status: `}),l(e.status)]}),(0,D.jsxs)(n,{children:[(0,D.jsx)(n,{dimColor:!0,children:`· Time: `}),s(e)]}),(0,D.jsxs)(n,{children:[(0,D.jsx)(n,{dimColor:!0,children:`· Tokens: `}),c]})]}),(0,D.jsxs)(i,{marginTop:1,flexDirection:`column`,children:[(0,D.jsx)(n,{dimColor:!0,children:`New objective:`}),(0,D.jsx)(n,{children:t})]}),(0,D.jsx)(i,{marginTop:1,children:(0,D.jsx)(y,{options:[{label:`Yes, replace the goal`,value:`yes`},{label:`No, keep the current goal`,value:`no`}],onChange:o,onCancel:a})})]})})}var D,O=e((()=>{t(),r(),h(),w(),o(),D=a()}));function k(e){let t=e.split(`
2
+ `)[0]??e;return t.length<=I?t:t.slice(0,I)+`…`}function A(){v(e=>e.origin===`goal-continuation`||e.origin===`goal-budget-limit`)}function j(){let e=d();if(!e)return"No active goal. Set one with `/goal <objective>`.";let t=e.tokenBudget===null?`${e.tokensUsed}`:`${e.tokensUsed} / ${e.tokenBudget}`,n=[`Goal: ${e.objective}`,`Status: ${l(e.status)}`,`Time: ${s(e)}`,`Tokens: ${t}`,`Continuation turns: ${e.turnsExecuted}`];return e.status===`max_turns`&&n.push("Hint: Max continuation turns reached (150). Run `/goal continue` to reset and continue."),n.join(`
3
+ `)}function M(e){return _(e),C(),b(),`Goal set.`}async function N(e,t,n){let r=n.trim();if(!r||r.toLowerCase()===`status`)return e(j(),{display:`system`}),null;let i=r.toLowerCase();if(i===`clear`){let t=f();return t&&(S(),A()),e(t?`Goal cleared.`:`No active goal to clear.`,{display:`system`}),null}if(i===`pause`){let t=c();return t&&(b(),A()),e(t?`Goal paused.`:`No active goal to pause.`,{display:`system`}),null}if(i===`resume`){if(d()?.status===`max_turns`)return e("Goal reached max continuation turns (150). Run `/goal continue` to reset turn counter and continue.",{display:`system`}),null;let t=g();return t&&b(),e(t?`Goal resumed.`:`No paused goal to resume.`,{display:`system`,shouldQuery:!!t}),null}if(i===`continue`){let t=m();return t&&b(),e(t?`Goal continuation counter reset (0/150). Continuing...`:`Current goal is not in max-turns state.`,{display:`system`,shouldQuery:!!t}),null}if(i===`complete`){let t=p();return t&&(b(),A()),e(t?`Goal marked complete.`:`No active goal to complete.`,{display:`system`}),null}if(r.length>F)return e(`Goal objective is too long (${r.length} chars; limit ${F}). Save the detailed instructions to a file and reference it from a shorter objective.`,{display:`system`}),null;let a=d();return a&&a.status!==`complete`?(0,P.jsx)(E,{currentGoal:a,newObjective:r,onConfirm:()=>{A(),e(M(r),{display:`system`,shouldQuery:!0,displayArgs:k(r),metaMessages:[`<goal-objective-updated>\n${r}\n</goal-objective-updated>`]})},onCancel:()=>{e(`Kept the current goal. New objective discarded.`,{display:`system`})}}):(e(M(r),{display:`system`,shouldQuery:!0,displayArgs:k(r),metaMessages:[`<goal-objective-updated>\n${r}\n</goal-objective-updated>`]}),null)}var P,F,I;e((()=>{t(),o(),x(),u(),O(),P=a(),F=4e3,I=80}))();export{N as call};
@@ -1 +1 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{ai as t,ci as n}from"./paths-Ci1iwL5Y.js";import{l as r,p as i}from"./debug-otxXY3j-.js";import{B_ as a,G_ as o,K_ as s,Qo as c,Tm as l,Uo as u,V_ as d,W_ as f,Xo as p,dD as m,km as h,mo as g,q_ as _,st as v,uD as y,ut as b}from"./loadAgentsDir-C_wFhytF.js";import{F as x,I as S,J as C,L as w,P as T,R as E}from"./rcDebugLog-C42A0pX1.js";import{n as D,t as O}from"./openaiShared-C-AuktRP.js";import{randomUUID as k}from"crypto";async function*A(e,n,r,u,d){try{let h=C(d.model),g=c(e,r),_=await Promise.all(r.map(e=>b(e,{getToolPermissionContext:d.getToolPermissionContext,tools:r,agents:d.agents,allowedAgentTypes:d.allowedAgentTypes,model:d.model}))),v=_.filter(e=>{let t=e;return t.type!==`advisor_20260301`&&t.type!==`computer_20250124`}),y=E(g,n),T=w(v),O=S(d.toolChoice),A=a({maxRetries:0,fetchOverride:d.fetchOverride,source:d.querySource});i(`[Grok] Calling model=${h}, messages=${y.length}, tools=${T.length}`);let j=x(await A.chat.completions.create({model:h,messages:y,...T.length>0&&{tools:T,...O&&{tool_choice:O}},stream:!0,stream_options:{include_usage:!0},...d.temperatureOverride!==void 0&&{temperature:d.temperatureOverride}},{signal:u}),h),M={},N=[],P=null,F={input_tokens:0,output_tokens:0,cache_creation_input_tokens:0,cache_read_input_tokens:0},I=0,L=Date.now();for await(let e of j){switch(e.type){case`message_start`:P=e.message,I=Date.now()-L,e.message.usage&&(F=D(F,e.message.usage));break;case`content_block_start`:{let t=e.index,n=e.content_block;n.type===`tool_use`?M[t]={...n,input:``}:n.type===`text`?M[t]={...n,text:``}:n.type===`thinking`?M[t]={...n,thinking:``,signature:``}:M[t]={...n};break}case`content_block_delta`:{let t=e.index,n=e.delta,r=M[t];if(!r)break;n.type===`text_delta`?r.text=(r.text||``)+n.text:n.type===`input_json_delta`?r.input=(r.input||``)+n.partial_json:n.type===`thinking_delta`?r.thinking=(r.thinking||``)+n.thinking:n.type===`signature_delta`&&(r.signature=n.signature);break}case`content_block_stop`:{let t=M[e.index];if(!t||!P)break;let n={message:{...P,content:p([t],r,d.agentId)},requestId:void 0,type:`assistant`,uuid:k(),timestamp:new Date().toISOString()};N.push(n),yield n;break}case`message_delta`:{let t=e.usage;t&&(F=D(F,t));break}case`message_stop`:break}e.type===`message_stop`&&F.input_tokens+F.output_tokens>0&&l(t(h,F),F,d.model),yield{type:`stream_event`,event:e,...e.type===`message_start`?{ttftMs:I}:void 0}}m(d.langfuseTrace??null,{model:h,provider:`grok`,input:f(g,n),output:o(N),usage:{input_tokens:F.input_tokens,output_tokens:F.output_tokens,cache_creation_input_tokens:F.cache_creation_input_tokens,cache_read_input_tokens:F.cache_read_input_tokens},startTime:new Date(L),endTime:new Date,completionStartTime:I>0?new Date(L+I):void 0,tools:s(_)})}catch(e){let t=e instanceof Error?e.message:String(e);i(`[Grok] Error: ${t}`,{level:`error`}),yield g({content:`API Error: ${t}`,apiError:`api_error`,error:e instanceof Error?e:Error(String(e))})}}e((()=>{d(),O(),T(),u(),v(),r(),h(),n(),y(),_()}))();export{A as queryModelGrok};
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{ai as t,ci as n}from"./paths-DO4WOQtD.js";import{l as r,p as i}from"./debug-otxXY3j-.js";import{B_ as a,G_ as o,H_ as s,Qo as c,Tm as l,U_ as u,Uo as d,V_ as f,W_ as p,Xo as m,dD as h,km as g,mo as _,st as v,uD as y,ut as b}from"./loadAgentsDir-ClTeo0nk.js";import{F as x,I as S,J as C,L as w,P as T,R as E}from"./rcDebugLog-CwU_wJBE.js";import{n as D,t as O}from"./openaiShared-C-AuktRP.js";import{randomUUID as k}from"crypto";async function*A(e,n,r,o,d){try{let f=C(d.model),g=c(e,r),_=await Promise.all(r.map(e=>b(e,{getToolPermissionContext:d.getToolPermissionContext,tools:r,agents:d.agents,allowedAgentTypes:d.allowedAgentTypes,model:d.model}))),v=_.filter(e=>{let t=e;return t.type!==`advisor_20260301`&&t.type!==`computer_20250124`}),y=E(g,n),T=w(v),O=S(d.toolChoice),A=a({maxRetries:0,fetchOverride:d.fetchOverride,source:d.querySource});i(`[Grok] Calling model=${f}, messages=${y.length}, tools=${T.length}`);let j=x(await A.chat.completions.create({model:f,messages:y,...T.length>0&&{tools:T,...O&&{tool_choice:O}},stream:!0,stream_options:{include_usage:!0},...d.temperatureOverride!==void 0&&{temperature:d.temperatureOverride}},{signal:o}),f),M={},N=[],P=null,F={input_tokens:0,output_tokens:0,cache_creation_input_tokens:0,cache_read_input_tokens:0},I=0,L=Date.now();for await(let e of j){switch(e.type){case`message_start`:P=e.message,I=Date.now()-L,e.message.usage&&(F=D(F,e.message.usage));break;case`content_block_start`:{let t=e.index,n=e.content_block;n.type===`tool_use`?M[t]={...n,input:``}:n.type===`text`?M[t]={...n,text:``}:n.type===`thinking`?M[t]={...n,thinking:``,signature:``}:M[t]={...n};break}case`content_block_delta`:{let t=e.index,n=e.delta,r=M[t];if(!r)break;n.type===`text_delta`?r.text=(r.text||``)+n.text:n.type===`input_json_delta`?r.input=(r.input||``)+n.partial_json:n.type===`thinking_delta`?r.thinking=(r.thinking||``)+n.thinking:n.type===`signature_delta`&&(r.signature=n.signature);break}case`content_block_stop`:{let t=M[e.index];if(!t||!P)break;let n={message:{...P,content:m([t],r,d.agentId)},requestId:void 0,type:`assistant`,uuid:k(),timestamp:new Date().toISOString()};N.push(n),yield n;break}case`message_delta`:{let t=e.usage;t&&(F=D(F,t));break}case`message_stop`:break}e.type===`message_stop`&&F.input_tokens+F.output_tokens>0&&l(t(f,F),F,d.model),yield{type:`stream_event`,event:e,...e.type===`message_start`?{ttftMs:I}:void 0}}h(d.langfuseTrace??null,{model:f,provider:`grok`,input:s(g,n),output:u(N),usage:{input_tokens:F.input_tokens,output_tokens:F.output_tokens,cache_creation_input_tokens:F.cache_creation_input_tokens,cache_read_input_tokens:F.cache_read_input_tokens},startTime:new Date(L),endTime:new Date,completionStartTime:I>0?new Date(L+I):void 0,tools:p(_)})}catch(e){let t=e instanceof Error?e.message:String(e);i(`[Grok] Error: ${t}`,{level:`error`}),yield _({content:`API Error: ${t}`,apiError:`api_error`,error:e instanceof Error?e:Error(String(e))})}}e((()=>{f(),O(),T(),d(),v(),r(),g(),n(),y(),o()}))();export{A as queryModelGrok};
@@ -1 +1 @@
1
- import{A as e,C as t,D as n,E as r,O as i,S as a,T as o,_ as s,b as c,d as l,f as u,g as d,h as f,k as p,l as m,m as h,p as g,u as _,v,w as y,x as b,y as x}from"./paths-Ci1iwL5Y.js";a();export{m as checkGate_CACHED_OR_BLOCKING,_ as checkSecurityRestrictionGate,l as checkStatsigFeatureGate_CACHED_MAY_BE_STALE,u as clearGrowthBookConfigOverrides,g as getAllGrowthBookFeatures,h as getApiBaseUrlHost,f as getDynamicConfig_BLOCKS_ON_INIT,d as getDynamicConfig_CACHED_MAY_BE_STALE,s as getFeatureValue_CACHED_MAY_BE_STALE,v as getFeatureValue_CACHED_WITH_REFRESH,x as getFeatureValue_DEPRECATED,c as getGrowthBookConfigOverrides,b as hasGrowthBookEnvOverride,t as initializeGrowthBook,y as onGrowthBookRefresh,o as refreshGrowthBookAfterAuthChange,r as refreshGrowthBookFeatures,n as resetGrowthBook,i as setGrowthBookConfigOverride,p as setupPeriodicGrowthBookRefresh,e as stopPeriodicGrowthBookRefresh};
1
+ import{A as e,C as t,D as n,E as r,O as i,S as a,T as o,_ as s,b as c,d as l,f as u,g as d,h as f,k as p,l as m,m as h,p as g,u as _,v,w as y,x as b,y as x}from"./paths-DO4WOQtD.js";a();export{m as checkGate_CACHED_OR_BLOCKING,_ as checkSecurityRestrictionGate,l as checkStatsigFeatureGate_CACHED_MAY_BE_STALE,u as clearGrowthBookConfigOverrides,g as getAllGrowthBookFeatures,h as getApiBaseUrlHost,f as getDynamicConfig_BLOCKS_ON_INIT,d as getDynamicConfig_CACHED_MAY_BE_STALE,s as getFeatureValue_CACHED_MAY_BE_STALE,v as getFeatureValue_CACHED_WITH_REFRESH,x as getFeatureValue_DEPRECATED,c as getGrowthBookConfigOverrides,b as hasGrowthBookEnvOverride,t as initializeGrowthBook,y as onGrowthBookRefresh,o as refreshGrowthBookAfterAuthChange,r as refreshGrowthBookFeatures,n as resetGrowthBook,i as setGrowthBookConfigOverride,p as setupPeriodicGrowthBookRefresh,e as stopPeriodicGrowthBookRefresh};
@@ -1,4 +1,4 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{Ct as t,cn as n}from"./state-sIHsFpDu.js";import{Uc as r,zc as i}from"./paths-Ci1iwL5Y.js";import{E as a,J as o,O as s,U as c,_ as l,h as u,l as d,p as f}from"./debug-otxXY3j-.js";import{n as p,r as m}from"./analytics-DqMQntaB.js";import{o as h,s as g}from"./log-DSV4Ht5l.js";import{join as _}from"path";import{createWriteStream as v,writeFileSync as y}from"fs";import{readFile as b,readdir as x,writeFile as S}from"fs/promises";import{pipeline as C}from"stream/promises";import{getHeapSnapshot as w,getHeapSpaceStatistics as T,getHeapStatistics as E}from"v8";async function D(e,n=0){let r=process.memoryUsage(),i=E(),a=process.resourceUsage(),o=process.uptime(),s;try{s=T()}catch{}let c=process._getActiveHandles().length,l=process._getActiveRequests().length,u;try{u=(await x(`/proc/self/fd`)).length}catch{}let d;try{d=await b(`/proc/self/smaps_rollup`,`utf8`)}catch{}let f=r.rss-r.heapUsed,p=o>0?r.rss/o:0,m=p*3600/(1024*1024),h=[];return i.number_of_detached_contexts>0&&h.push(`${i.number_of_detached_contexts} detached context(s) - possible iframe/context leak`),c>100&&h.push(`${c} active handles - possible timer/socket leak`),f>r.heapUsed&&h.push(`Native memory > heap - leak may be in native addons (node-pty, sharp, etc.)`),m>100&&h.push(`High memory growth rate: ${m.toFixed(1)} MB/hour`),u&&u>500&&h.push(`${u} open file descriptors - possible file/socket leak`),{timestamp:new Date().toISOString(),sessionId:t(),trigger:e,dumpNumber:n,uptimeSeconds:o,memoryUsage:{heapUsed:r.heapUsed,heapTotal:r.heapTotal,external:r.external,arrayBuffers:r.arrayBuffers,rss:r.rss},memoryGrowthRate:{bytesPerSecond:p,mbPerHour:m},v8HeapStats:{heapSizeLimit:i.heap_size_limit,mallocedMemory:i.malloced_memory,peakMallocedMemory:i.peak_malloced_memory,detachedContexts:i.number_of_detached_contexts,nativeContexts:i.number_of_native_contexts},v8HeapSpaces:s?.map(e=>({name:e.space_name,size:e.space_size,used:e.space_used_size,available:e.space_available_size})),resourceUsage:{maxRSS:a.maxRSS*1024,userCPUTime:a.userCPUTime,systemCPUTime:a.systemCPUTime},activeHandles:c,activeRequests:l,openFileDescriptors:u,analysis:{potentialLeaks:h,recommendation:h.length>0?`WARNING: ${h.length} potential leak indicator(s) found. See potentialLeaks array.`:`No obvious leak indicators. Check heap snapshot for retained objects.`},smapsRollup:d,platform:process.platform,nodeVersion:process.version,ccVersion:`2.7.1`}}async function O(e=`manual`,n=0){try{let r=t(),a=await D(e,n),o=e=>(e/1024/1024/1024).toFixed(3);f(`[HeapDump] Memory state:
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{Ct as t,cn as n}from"./state-sIHsFpDu.js";import{Uc as r,zc as i}from"./paths-DO4WOQtD.js";import{E as a,J as o,O as s,U as c,_ as l,h as u,l as d,p as f}from"./debug-otxXY3j-.js";import{n as p,r as m}from"./analytics-DqMQntaB.js";import{o as h,s as g}from"./log-DSV4Ht5l.js";import{join as _}from"path";import{createWriteStream as v,writeFileSync as y}from"fs";import{readFile as b,readdir as x,writeFile as S}from"fs/promises";import{pipeline as C}from"stream/promises";import{getHeapSnapshot as w,getHeapSpaceStatistics as T,getHeapStatistics as E}from"v8";async function D(e,n=0){let r=process.memoryUsage(),i=E(),a=process.resourceUsage(),o=process.uptime(),s;try{s=T()}catch{}let c=process._getActiveHandles().length,l=process._getActiveRequests().length,u;try{u=(await x(`/proc/self/fd`)).length}catch{}let d;try{d=await b(`/proc/self/smaps_rollup`,`utf8`)}catch{}let f=r.rss-r.heapUsed,p=o>0?r.rss/o:0,m=p*3600/(1024*1024),h=[];return i.number_of_detached_contexts>0&&h.push(`${i.number_of_detached_contexts} detached context(s) - possible iframe/context leak`),c>100&&h.push(`${c} active handles - possible timer/socket leak`),f>r.heapUsed&&h.push(`Native memory > heap - leak may be in native addons (node-pty, sharp, etc.)`),m>100&&h.push(`High memory growth rate: ${m.toFixed(1)} MB/hour`),u&&u>500&&h.push(`${u} open file descriptors - possible file/socket leak`),{timestamp:new Date().toISOString(),sessionId:t(),trigger:e,dumpNumber:n,uptimeSeconds:o,memoryUsage:{heapUsed:r.heapUsed,heapTotal:r.heapTotal,external:r.external,arrayBuffers:r.arrayBuffers,rss:r.rss},memoryGrowthRate:{bytesPerSecond:p,mbPerHour:m},v8HeapStats:{heapSizeLimit:i.heap_size_limit,mallocedMemory:i.malloced_memory,peakMallocedMemory:i.peak_malloced_memory,detachedContexts:i.number_of_detached_contexts,nativeContexts:i.number_of_native_contexts},v8HeapSpaces:s?.map(e=>({name:e.space_name,size:e.space_size,used:e.space_used_size,available:e.space_available_size})),resourceUsage:{maxRSS:a.maxRSS*1024,userCPUTime:a.userCPUTime,systemCPUTime:a.systemCPUTime},activeHandles:c,activeRequests:l,openFileDescriptors:u,analysis:{potentialLeaks:h,recommendation:h.length>0?`WARNING: ${h.length} potential leak indicator(s) found. See potentialLeaks array.`:`No obvious leak indicators. Check heap snapshot for retained objects.`},smapsRollup:d,platform:process.platform,nodeVersion:process.version,ccVersion:`2.7.2`}}async function O(e=`manual`,n=0){try{let r=t(),a=await D(e,n),o=e=>(e/1024/1024/1024).toFixed(3);f(`[HeapDump] Memory state:
2
2
  heapUsed: ${o(a.memoryUsage.heapUsed)} GB (in snapshot)
3
3
  external: ${o(a.memoryUsage.external)} GB (NOT in snapshot)
4
4
  rss: ${o(a.memoryUsage.rss)} GB (total process)