claude-code-best 2.6.13 → 2.7.1

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 (898) hide show
  1. package/dist/chunks/AddWorkspaceDirectory-C7od6sFQ.js +1 -0
  2. package/dist/chunks/App-EfHjElWP.js +1 -0
  3. package/dist/chunks/ApproveApiKey-CSz0291w.js +1 -0
  4. package/dist/chunks/ApproveApiKey-Cc5SaLqs.js +1 -0
  5. package/dist/chunks/AssistantSessionChooser-mLIhDlxW.js +1 -0
  6. package/dist/chunks/BackgroundTasksDialog-OkUSMj0I.js +2 -0
  7. package/dist/chunks/BypassPermissionsModeDialog-BCdft-m_.js +1 -0
  8. package/dist/chunks/ClaudeInChromeOnboarding-BPlrCIo-.js +1 -0
  9. package/dist/chunks/ClaudeMdExternalIncludesDialog-BbPaorIs.js +1 -0
  10. package/dist/chunks/ClaudeMdExternalIncludesDialog-D8fk-Ib5.js +1 -0
  11. package/dist/chunks/ConsoleOAuthFlow-Dyv4mI_o.js +1 -0
  12. package/dist/chunks/DesktopHandoff-BQwx7qWA.js +1 -0
  13. package/dist/chunks/DevChannelsDialog-CujM8Ivu.js +1 -0
  14. package/dist/chunks/DiffDialog-Byv1UJvS.js +3 -0
  15. package/dist/chunks/Doctor-CRrE5Sf4.js +1 -0
  16. package/dist/chunks/Doctor-Cv7wbi6C.js +3 -0
  17. package/dist/chunks/ExitFlow-DKusdm_v.js +2 -0
  18. package/dist/chunks/Feedback-Diw8XUr-.js +2 -0
  19. package/dist/chunks/Grove-CAi037VV.js +11 -0
  20. package/dist/chunks/Grove-CgX5Fdeh.js +1 -0
  21. package/dist/chunks/HybridTransport-CP0RopXu.js +4 -0
  22. package/dist/chunks/ITermBackend-RvD4VX7c.js +1 -0
  23. package/dist/chunks/InvalidConfigDialog-Bhlgysxl.js +1 -0
  24. package/dist/chunks/InvalidSettingsDialog-dGStgJZN.js +1 -0
  25. package/dist/chunks/MCPConnectionManager-D5a9ysw2.js +1 -0
  26. package/dist/chunks/McpParsingWarnings-B_z9pZ_8.js +1 -0
  27. package/dist/chunks/MessageSelector-CEvbAZGv.js +3 -0
  28. package/dist/chunks/Messages-DTmFVhRG.js +11 -0
  29. package/dist/chunks/Onboarding-BoAtphYb.js +1 -0
  30. package/dist/chunks/OverageCreditUpsell-DA7Ne7Mj.js +1 -0
  31. package/dist/chunks/PluginSettings-D3bQRsge.js +17 -0
  32. package/dist/chunks/PromptInputFooterSuggestions-DhIQ0Nge.js +1 -0
  33. package/dist/chunks/PromptInputHelpMenu-B__j9zE6.js +1 -0
  34. package/dist/chunks/QueryEngine-CMcQGyql.js +1 -0
  35. package/dist/chunks/REPL-B1BS9jwx.js +147 -0
  36. package/dist/chunks/REPL-C9f3ToGu.js +1 -0
  37. package/dist/chunks/RemoteCallout-Bwe1ESr9.js +1 -0
  38. package/dist/chunks/RemoteSessionManager-BKD4YmzY.js +2 -0
  39. package/dist/chunks/ResumeConversation-DxqbAKA4.js +1 -0
  40. package/dist/chunks/SSETransport-D3e5KNL3.js +4 -0
  41. package/dist/chunks/SearchExtraToolsTool-BVAhywUI.js +1 -0
  42. package/dist/chunks/SentryErrorBoundary-D-YZTGQG.js +2 -0
  43. package/dist/chunks/SentryErrorBoundary-M1ipwe1n.js +1 -0
  44. package/dist/chunks/Settings-D5EWYL40.js +2 -0
  45. package/dist/chunks/TeleportProgress-C3Ubx1Se.js +1 -0
  46. package/dist/chunks/TeleportRepoMismatchDialog-D_ax3xQy.js +1 -0
  47. package/dist/chunks/TeleportResumeWrapper-DeVKIXQp.js +1 -0
  48. package/dist/chunks/ThemePicker-DKmIL5Ku.js +1 -0
  49. package/dist/chunks/TmuxBackend-Bm_cRJ2x.js +9 -0
  50. package/dist/chunks/TrustDialog-ClXFMKj6.js +1 -0
  51. package/dist/chunks/TungstenTool-B40YHYXC.js +1 -0
  52. package/dist/chunks/ValidationErrorsList-SdQADfvA.js +2 -0
  53. package/dist/chunks/WelcomeV2-BijS6i2Z.js +1 -0
  54. package/dist/chunks/WindowsTerminalBackend-CGEQ5ClB.js +2 -0
  55. package/dist/chunks/add-dir-B7kleB6k.js +1 -0
  56. package/dist/chunks/agentDisplay-Dr1XbOAu.js +1 -0
  57. package/dist/chunks/agents-CpLvvWpO.js +103 -0
  58. package/dist/chunks/agents-Dy5YOJC9.js +2 -0
  59. package/dist/chunks/ant-gwf-4eGN.js +1 -0
  60. package/dist/chunks/api-BdbBnz5c.js +1 -0
  61. package/dist/chunks/api-CDmgYrwN.js +1 -0
  62. package/dist/chunks/asciicast-C_1Pi99k.js +4 -0
  63. package/dist/chunks/asciicast-DA6TudSH.js +1 -0
  64. package/dist/chunks/assistant-1usDIXtk.js +1 -0
  65. package/dist/chunks/assistant-BMviqf0l.js +1 -0
  66. package/dist/chunks/assistant-BULedprW.js +1 -0
  67. package/dist/chunks/auth-CvHVr2A5.js +1 -0
  68. package/dist/chunks/auth-ORBmEqnH.js +1 -0
  69. package/dist/chunks/autoMode-DSMM2seL.js +45 -0
  70. package/dist/chunks/autonomy-Dj6Nzxus.js +19 -0
  71. package/dist/chunks/autonomy-TtBO2TAe.js +1 -0
  72. package/dist/chunks/autonomyPanel-CbmU7lPg.js +1 -0
  73. package/dist/chunks/backgroundHousekeeping-BAvSPaZ5.js +1 -0
  74. package/dist/chunks/backgroundHousekeeping-Cp2RvmEN.js +17 -0
  75. package/dist/chunks/banner-D9Cq292T.js +2 -0
  76. package/dist/chunks/bg-CngkAkgc.js +1 -0
  77. package/dist/chunks/bg-DgpgS_VU.js +9 -0
  78. package/dist/chunks/branch-Cj5TGroO.js +3 -0
  79. package/dist/chunks/break-cache-DrIa8RdW.js +8 -0
  80. package/dist/chunks/bridge-CsqJAoEg.js +2 -0
  81. package/dist/chunks/bridgeConfig-B49H_B9L.js +1 -0
  82. package/dist/chunks/bridgeConfig-pjDV5Z2l.js +1 -0
  83. package/dist/chunks/bridgeEnabled-D9jI6X-w.js +1 -0
  84. package/dist/chunks/bridgeEnabled-DsG2JvIr.js +1 -0
  85. package/dist/chunks/bridgeMain-CNmR9iDD.js +68 -0
  86. package/dist/chunks/bridgeMain-DYCShrcV.js +1 -0
  87. package/dist/chunks/bridgeMessaging-DN0X35NX.js +1 -0
  88. package/dist/chunks/bridgePointer-Clcvh52n.js +1 -0
  89. package/dist/chunks/browser-Bt-ckCaU.js +1 -0
  90. package/dist/chunks/btw-BOg0RTKl.js +1 -0
  91. package/dist/chunks/buddy-BFuPeIxM.js +3 -0
  92. package/dist/chunks/bypassPermissionsKillswitch-kxVnIVRs.js +1 -0
  93. package/dist/chunks/caches-BsYvQnWV.js +1 -0
  94. package/dist/chunks/caches-BumkMuGA.js +3 -0
  95. package/dist/chunks/ccrClient-BI1QPLmN.js +1 -0
  96. package/dist/chunks/changeDetector-By54zja0.js +1 -0
  97. package/dist/chunks/channelNotification-CoZSFUlb.js +1 -0
  98. package/dist/chunks/channelNotification-Cx82K1CD.js +1 -0
  99. package/dist/chunks/chrome-C_5EZcdc.js +1 -0
  100. package/dist/chunks/chromeNativeHost-BldB1Zzi.js +1 -0
  101. package/dist/chunks/claudeDesktop-BqTW_pbB.js +1 -0
  102. package/dist/chunks/cleanup-rCLlo4w8.js +1 -0
  103. package/dist/chunks/clear-BQr2zTyP.js +1 -0
  104. package/dist/chunks/cliLaunch-Citfs01Q.js +1 -0
  105. package/dist/chunks/client-BbavFXJZ.js +1 -0
  106. package/dist/chunks/color-DOsgZO2n.js +1 -0
  107. package/dist/chunks/commands-CfwfGt3T.js +1 -0
  108. package/dist/chunks/commitAttribution-CH9C_hoL.js +1 -0
  109. package/dist/chunks/commitAttribution-iKd8bTOI.js +2 -0
  110. package/dist/chunks/common-Bi4yZBkh.js +1 -0
  111. package/dist/chunks/common-Da57Qwms.js +1 -0
  112. package/dist/chunks/common-NEOWMwtB.js +1 -0
  113. package/dist/chunks/compact-B6Muofhz.js +3 -0
  114. package/dist/chunks/companion-B_LrjSk5.js +1 -0
  115. package/dist/chunks/completionCache-BQgiR45Q.js +1 -0
  116. package/dist/chunks/completionCache-C7hDqIDL.js +4 -0
  117. package/dist/chunks/computerUseLock-Diig5B8p.js +1 -0
  118. package/dist/chunks/config-CJd9kJ57.js +1 -0
  119. package/dist/chunks/config-CQd4IkXo.js +1 -0
  120. package/dist/chunks/context-noninteractive-DCYvLxWx.js +1 -0
  121. package/dist/chunks/context-noninteractive-DZsSp-ES.js +54 -0
  122. package/dist/chunks/context-qAHTuazZ.js +1 -0
  123. package/dist/chunks/conversation-DYUVAAQt.js +1 -0
  124. package/dist/chunks/conversation-NrAy2em3.js +1 -0
  125. package/dist/chunks/copy-B2jhZndZ.js +7 -0
  126. package/dist/chunks/createSSHSession-CKdoEmAg.js +6 -0
  127. package/dist/chunks/createSession-Czx7_nf6.js +1 -0
  128. package/dist/chunks/createSession-WkBw7wdn.js +1 -0
  129. package/dist/chunks/cronJitterConfig-2u6WAlti.js +6 -0
  130. package/dist/chunks/crossProjectResume-CjJISRBQ.js +40 -0
  131. package/dist/chunks/daemon-BRKR4D1D.js +2 -0
  132. package/dist/chunks/datadog-QSR9B7CZ.js +1 -0
  133. package/dist/chunks/datadog-YsyhnDmr.js +1 -0
  134. package/dist/chunks/debug-DIYxb3SF.js +1 -0
  135. package/dist/chunks/debug-otxXY3j-.js +5 -0
  136. package/dist/chunks/debugUtils-l8nsUZ6R.js +1 -0
  137. package/dist/chunks/desktop-BN9pHpK_.js +1 -0
  138. package/dist/chunks/detached-C_2ZXr7X.js +5 -0
  139. package/dist/chunks/detectRepository-2ICvGD0U.js +1 -0
  140. package/dist/chunks/detectRepository-BLwSmun2.js +1 -0
  141. package/dist/chunks/detection-0mMj--Bt.js +1 -0
  142. package/dist/chunks/detection-95TCHkW8.js +1 -0
  143. package/dist/chunks/diff-BTtUFuf-.js +1 -0
  144. package/dist/chunks/directoryCompletion-DqtWZsoW.js +1 -0
  145. package/dist/chunks/doctor-BKBb426q.js +1 -0
  146. package/dist/chunks/earlyInput-CFYRGxau.js +2 -0
  147. package/dist/chunks/earlyInput-D3OhUZ4G.js +1 -0
  148. package/dist/chunks/effort-ClhxMqY6.js +9 -0
  149. package/dist/chunks/entry-CJlJ47nP.js +14 -0
  150. package/dist/chunks/env-C2A9gV_G.js +1 -0
  151. package/dist/chunks/envLessBridgeConfig-C9UUbQCo.js +1 -0
  152. package/dist/chunks/envLessBridgeConfig-DSJqg3Ox.js +1 -0
  153. package/dist/chunks/escHotkey-D8WgbSyj.js +259 -0
  154. package/dist/chunks/execFileNoThrow-azCkYhmF.js +1 -0
  155. package/dist/chunks/execSyncWrapper-Bn7EJqtD.js +1 -0
  156. package/dist/chunks/executor-BVh1PTF-.js +1561 -0
  157. package/dist/chunks/executor-CvTuHx-k.js +1 -0
  158. package/dist/chunks/exit-DxY3yJrp.js +1 -0
  159. package/dist/chunks/export-DS2esu8D.js +2 -0
  160. package/dist/chunks/exportRenderer-DX2L5fQ7.js +1 -0
  161. package/dist/chunks/extra-usage-DaxUQk9I.js +1 -0
  162. package/dist/chunks/extra-usage-XJxfHsbe.js +1 -0
  163. package/dist/chunks/extra-usage-core-D84ifgBo.js +1 -0
  164. package/dist/chunks/extra-usage-noninteractive-fxqxHnIt.js +1 -0
  165. package/dist/chunks/extraUsage-P_NGI1-I.js +1 -0
  166. package/dist/chunks/extractMemories-B3cTWsph.js +1 -0
  167. package/dist/chunks/fast-CHiQGMBE.js +1 -0
  168. package/dist/chunks/fast-CpN8lLnE.js +1 -0
  169. package/dist/chunks/featureCheck-CUJ2rPM6.js +1 -0
  170. package/dist/chunks/feedback-CqRsOG3c.js +1 -0
  171. package/dist/chunks/fileStateCache-BhVfo23e.js +1 -0
  172. package/dist/chunks/files-Bdr_PQyV.js +2 -0
  173. package/dist/chunks/findExecutable-BHQl4NaS.js +1 -0
  174. package/dist/chunks/firstPartyEventLogger-CM0V7Uev.js +1 -0
  175. package/dist/chunks/flushGate-DNutWuOE.js +1 -0
  176. package/dist/chunks/gates-C4JvRq4i.js +1 -0
  177. package/dist/chunks/gates-DvjyKZVA.js +1 -0
  178. package/dist/chunks/gemini-B0M6SQSG.js +1 -0
  179. package/dist/chunks/generateRecap-DhDOgXn3.js +1 -0
  180. package/dist/chunks/generateSessionName-CoFR2wgK.js +1 -0
  181. package/dist/chunks/genericProcessUtils-tJxf3yqB.js +23 -0
  182. package/dist/chunks/git-C0IuvuIy.js +6 -0
  183. package/dist/chunks/git-hSvFiuiG.js +1 -0
  184. package/dist/chunks/githubRepoPathMapping-DGiSNykv.js +1 -0
  185. package/dist/chunks/goal-DRb6pPAp.js +3 -0
  186. package/dist/chunks/grok-emDua_hT.js +1 -0
  187. package/dist/chunks/growthbook-COAneL48.js +1 -0
  188. package/dist/chunks/heapdump-CA6DHA8G.js +5 -0
  189. package/dist/chunks/help-XXY7deZm.js +1 -0
  190. package/dist/chunks/hooks-C6zZYnDi.js +79 -0
  191. package/dist/chunks/hooks-DOej0jqp.js +1 -0
  192. package/dist/chunks/hostAdapter-DZbdeXCV.js +1 -0
  193. package/dist/chunks/hostGuard-DSOEyH-P.js +1 -0
  194. package/dist/chunks/ide-BLRNkzVx.js +2 -0
  195. package/dist/chunks/inboundAttachments-60kD5Qt_.js +1 -0
  196. package/dist/chunks/inboundAttachments-BBYxcnvj.js +1 -0
  197. package/dist/chunks/initReplBridge-Dt2aQBia.js +1 -0
  198. package/dist/chunks/insights-BBugI3tW.js +822 -0
  199. package/dist/chunks/install-CuVHbwyW.js +1 -0
  200. package/dist/chunks/install-github-app-ByyzrlM9.js +147 -0
  201. package/dist/chunks/install-slack-app-CJGtmacz.js +1 -0
  202. package/dist/chunks/instrumentation-C8zvzMg1.js +12 -0
  203. package/dist/chunks/job-DBf6aPQX.js +2 -0
  204. package/dist/chunks/jwtUtils-BQXXBwqW.js +1 -0
  205. package/dist/chunks/keybindings-Bi7SMp5-.js +2 -0
  206. package/dist/chunks/lang-CVDkUhjk.js +1 -0
  207. package/dist/chunks/language-BYeqMX74.js +1 -0
  208. package/dist/chunks/language-BoKr5ylY.js +1 -0
  209. package/dist/chunks/launchAgentsPlatform-BKqxMFFn.js +1 -0
  210. package/dist/chunks/launchAutofixPr-CauX6gOB.js +18 -0
  211. package/dist/chunks/launchLocalMemory-Brrd_BJC.js +3 -0
  212. package/dist/chunks/launchLocalVault-DtAn656A.js +3 -0
  213. package/dist/chunks/launchMemoryStores-x7_Id7Yr.js +1 -0
  214. package/dist/chunks/launchOnboarding-DkamFByn.js +8 -0
  215. package/dist/chunks/launchSchedule-DjNQNxW4.js +1 -0
  216. package/dist/chunks/launchSkillStore-D2GUGhDD.js +1 -0
  217. package/dist/chunks/launchTeleport-DTfhiZkf.js +3 -0
  218. package/dist/chunks/launchVault-BZ2Po4r8.js +1 -0
  219. package/dist/chunks/loadAgentsDir-C_wFhytF.js +4697 -0
  220. package/dist/chunks/loadAgentsDir-whRB0phu.js +1 -0
  221. package/dist/chunks/loadPluginHooks-CYZjzxyO.js +1 -0
  222. package/dist/chunks/localSearch-B0p0_bjP.js +1 -0
  223. package/dist/chunks/localSearch-DAwFmV2Y.js +1 -0
  224. package/dist/chunks/log-DSV4Ht5l.js +1 -0
  225. package/dist/chunks/login-C1uE6Pg9.js +1 -0
  226. package/dist/chunks/login-DOyB64Rv.js +1 -0
  227. package/dist/chunks/logoV2Utils-BJHvwGup.js +1 -0
  228. package/dist/chunks/logout-DTPo3Myl.js +1 -0
  229. package/dist/chunks/magicDocs-DPZzG7Z2.js +57 -0
  230. package/dist/chunks/main-CNwSLti2.js +1312 -0
  231. package/dist/chunks/main-CfkIGrBF.js +31 -0
  232. package/dist/chunks/mappers-Dxs_kNJH.js +1 -0
  233. package/dist/chunks/mcp-CVnFM6nR.js +6 -0
  234. package/dist/chunks/mcp-CbDDqdzF.js +2 -0
  235. package/dist/chunks/mcp-CzfQB8BT.js +1 -0
  236. package/dist/chunks/mcpServer-BJNjQXsU.js +1 -0
  237. package/dist/chunks/mcpServer-Py4Iz9Hx.js +1 -0
  238. package/dist/chunks/memoize-DJ1XCN-z.js +1 -0
  239. package/dist/chunks/memory-BdUqEKio.js +1 -0
  240. package/dist/chunks/mobile-BMglW1NB.js +2 -0
  241. package/dist/chunks/mode-CqGusjoT.js +2 -0
  242. package/dist/chunks/model-BBULcn7y.js +1 -0
  243. package/dist/chunks/model-BOc_-7m0.js +1 -0
  244. package/dist/chunks/onChangeAppState-BkRihYau.js +1 -0
  245. package/dist/chunks/openai-yNI_zoao.js +10 -0
  246. package/dist/chunks/overageCreditGrant-Cbh0_fbM.js +1 -0
  247. package/dist/chunks/panel-BYfvo_mR.js +1 -0
  248. package/dist/chunks/panel-D3wvAEFE.js +1 -0
  249. package/dist/chunks/panelCall-t10Sud9A.js +1 -0
  250. package/dist/chunks/parser-DGXE1uWd.js +1 -0
  251. package/dist/chunks/parser-aIWfAYnt.js +1 -0
  252. package/dist/chunks/passes-D_iS6DaC.js +1 -0
  253. package/dist/chunks/path-BE28AJwZ.js +1 -0
  254. package/dist/chunks/paths-Ci1iwL5Y.js +36 -0
  255. package/dist/chunks/permissions-BE-1pIly.js +1 -0
  256. package/dist/chunks/permissions-CHvu4-yX.js +3 -0
  257. package/dist/chunks/pipeTransport-EAYXsubu.js +1 -0
  258. package/dist/chunks/plan-CP5nq_EB.js +1 -0
  259. package/dist/chunks/platform-mh9ypxS8.js +2 -0
  260. package/dist/chunks/plugin-8apy_RBT.js +1 -0
  261. package/dist/chunks/pluginAutoupdate-ClrgF5b3.js +1 -0
  262. package/dist/chunks/pluginBlocklist-B1LVo0j_.js +1 -0
  263. package/dist/chunks/pluginCliCommands-eqyMBWcP.js +1 -0
  264. package/dist/chunks/pluginFlagging-BiTDVP10.js +1 -0
  265. package/dist/chunks/pluginOperations-gZ-iCmhu.js +2 -0
  266. package/dist/chunks/pluginStartupCheck-DCDWHam6.js +1 -0
  267. package/dist/chunks/pluginStartupCheck-EjLvCXru.js +1 -0
  268. package/dist/chunks/plugins-BAIVqfi8.js +4 -0
  269. package/dist/chunks/policyLimits-Cdp3QwZ1.js +1 -0
  270. package/dist/chunks/pollConfig-_2W7bHoW.js +1 -0
  271. package/dist/chunks/poller-BA1jhG3F.js +1 -0
  272. package/dist/chunks/poor-Dii0mpOW.js +1 -0
  273. package/dist/chunks/poorMode-DzEL0cu0.js +1 -0
  274. package/dist/chunks/poorMode-aDmmvJ_e.js +1 -0
  275. package/dist/chunks/print-BwSmcUQu.js +39 -0
  276. package/dist/chunks/privacy-settings-DaAgSLKw.js +1 -0
  277. package/dist/chunks/processBashCommand-BZ1_JKu4.js +1 -0
  278. package/dist/chunks/processSlashCommand-v1Rvzxwn.js +6 -0
  279. package/dist/chunks/projectContext-Cd7V9pES.js +1 -0
  280. package/dist/chunks/prompt-6ZKyqv6z.js +227 -0
  281. package/dist/chunks/prompt-DPqKtC0b.js +1 -0
  282. package/dist/chunks/prompt-WjMHPk90.js +1 -0
  283. package/dist/chunks/promptEditor-Dz41P-3I.js +4 -0
  284. package/dist/chunks/protocolHandler-CHGHjfdf.js +13 -0
  285. package/dist/chunks/proxy-CF7ZDxaW.js +99 -0
  286. package/dist/chunks/rate-limit-options-BlU9av7g.js +1 -0
  287. package/dist/chunks/rcDebugLog-C42A0pX1.js +11 -0
  288. package/dist/chunks/referral-IIcY3jkp.js +1 -0
  289. package/dist/chunks/refresh-DTGEx7X_.js +1 -0
  290. package/dist/chunks/registerProtocol-BkNncGMI.js +36 -0
  291. package/dist/chunks/registry-CBqb7wbi.js +1 -0
  292. package/dist/chunks/release-notes-BxzOD-zP.js +4 -0
  293. package/dist/chunks/releaseNotes-C8KQGZHq.js +2 -0
  294. package/dist/chunks/reload-plugins-gYyC6_g8.js +1 -0
  295. package/dist/chunks/remote-env-CEJH5aJh.js +1 -0
  296. package/dist/chunks/remoteBridgeCore-Dte7ZUAN.js +1 -0
  297. package/dist/chunks/remoteControlServer-GN-eDbEz.js +3 -0
  298. package/dist/chunks/rename-BEU6BNRp.js +1 -0
  299. package/dist/chunks/renderOptions-Caca3bCd.js +1 -0
  300. package/dist/chunks/resume-D36S2rXg.js +2 -0
  301. package/dist/chunks/ripgrep-Bzwdi5-K.js +5 -0
  302. package/dist/chunks/ripgrep-DEa1djpJ.js +1 -0
  303. package/dist/chunks/runtimeObserver-CDMCeww2.js +1 -0
  304. package/dist/chunks/runtimeObserver-DaKaKNVW.js +10 -0
  305. package/dist/chunks/sandbox-adapter-DqTuhgud.js +1 -0
  306. package/dist/chunks/sandbox-toggle-BPO26t48.js +1 -0
  307. package/dist/chunks/searchExtraTools-Brae4wmG.js +1 -0
  308. package/dist/chunks/sentry-9EbPa1Xu.js +13 -0
  309. package/dist/chunks/session-D18B22u4.js +2 -0
  310. package/dist/chunks/sessionDiscovery-B-OTvXJf.js +1 -0
  311. package/dist/chunks/sessionFileAccessHooks-BXsK8Dwf.js +1 -0
  312. package/dist/chunks/sessionMemory-Bv-AYifm.js +1 -0
  313. package/dist/chunks/sessionMemory-Ctauybzs.js +1 -0
  314. package/dist/chunks/sessionMemoryUtils-D-bzdsAT.js +1 -0
  315. package/dist/chunks/sessionObserver-ardnTJ37.js +20 -0
  316. package/dist/chunks/sessionObserver-j8D9hidw.js +1 -0
  317. package/dist/chunks/sessionStorage-Cw5ibYWA.js +1 -0
  318. package/dist/chunks/sessionStoragePortable-CJUZrbIq.js +3 -0
  319. package/dist/chunks/sessionTitle-DEKvIVCK.js +14 -0
  320. package/dist/chunks/sessionTracing-CJUUEWZ4.js +11 -0
  321. package/dist/chunks/settingsSync-BWt3oUR7.js +1 -0
  322. package/dist/chunks/setup-BECFDOT9.js +9 -0
  323. package/dist/chunks/setup-CDxkPTCq.js +2 -0
  324. package/dist/chunks/setup-CmCTB2T_.js +1 -0
  325. package/dist/chunks/shadowedRuleDetection-BbALfdxE.js +1 -0
  326. package/dist/chunks/shellQuote-CBjhlaFO.js +1 -0
  327. package/dist/chunks/sideQuestion-BHK6dd1q.js +20 -0
  328. package/dist/chunks/sink-DFWgcGHX.js +1 -0
  329. package/dist/chunks/sink-Do5fWbUC.js +1 -0
  330. package/dist/chunks/sinks-BnkxTOU9.js +1 -0
  331. package/dist/chunks/sinks-Dc9V7k6a.js +2 -0
  332. package/dist/chunks/skill-learning-BHW9G3Dn.js +5 -0
  333. package/dist/chunks/skillChangeDetector-DwAvG835.js +1 -0
  334. package/dist/chunks/skillGapStore-DVMbI2yy.js +1 -0
  335. package/dist/chunks/skillGapStore-Wa7s6orv.js +5 -0
  336. package/dist/chunks/skillGenerator-CBuoIFsH.js +8 -0
  337. package/dist/chunks/skillLearning-BI2YDG3K.js +1 -0
  338. package/dist/chunks/skillLearning-BZMJRJPp.js +1 -0
  339. package/dist/chunks/skillPanel-2w82nkOl.js +28 -0
  340. package/dist/chunks/skillSearchPanel-7BhCBkdh.js +21 -0
  341. package/dist/chunks/skills-D5rMEo2w.js +1 -0
  342. package/dist/chunks/sprites-uNWgVZT6.js +1 -0
  343. package/dist/chunks/src-BGzuPZ5q.js +26 -0
  344. package/dist/chunks/src-kgpr3s-l.js +1 -0
  345. package/dist/chunks/startupProfiler-CAntGAbs.js +3 -0
  346. package/dist/chunks/startupProfiler-WtUzkMKV.js +1 -0
  347. package/dist/chunks/stats-D0CJB2HV.js +1 -0
  348. package/dist/chunks/status-nte1Arzy.js +1 -0
  349. package/dist/chunks/statusNoticeHelpers-Lqf99003.js +1 -0
  350. package/dist/chunks/stdio-Cg20AQ5W.js +1 -0
  351. package/dist/chunks/stickers-DDAm--86.js +1 -0
  352. package/dist/chunks/stringUtils-KZoO4GUd.js +4 -0
  353. package/dist/chunks/subprocessEnv-D4Cbyl2J.js +1 -0
  354. package/dist/chunks/systemPromptSections-CVpefuSD.js +1 -0
  355. package/dist/chunks/tag-BnvWS9HE.js +11 -0
  356. package/dist/chunks/tasks-CEs-pxkC.js +1 -0
  357. package/dist/chunks/teamHelpers-D4vCj2hP.js +1 -0
  358. package/dist/chunks/teamHelpers-D8R_gGLb.js +1 -0
  359. package/dist/chunks/teammateModeSnapshot-BDJ1JTcl.js +1 -0
  360. package/dist/chunks/teammateModeSnapshot-Bdra3VIJ.js +1 -0
  361. package/dist/chunks/teleport-RxTr4aCi.js +1 -0
  362. package/dist/chunks/templateJobs-BDKGtmr3.js +12 -0
  363. package/dist/chunks/terminalSetup-Bbvq-9Xl.js +1 -0
  364. package/dist/chunks/terminalSetup-C1X-sXwp.js +33 -0
  365. package/dist/chunks/theme-DXv6bV7f.js +1 -0
  366. package/dist/chunks/thinkback-CMsW7mvG.js +1 -0
  367. package/dist/chunks/thinkback-DRJBz3Is.js +1 -0
  368. package/dist/chunks/thinkback-play-CFdkpzlj.js +1 -0
  369. package/dist/chunks/tmux-DelKEjda.js +1 -0
  370. package/dist/chunks/toolEventObserver-CF7T7FBH.js +1 -0
  371. package/dist/chunks/toolEventObserver-DDJV8cvW.js +1 -0
  372. package/dist/chunks/toolPool-0zCdXfEu.js +1 -0
  373. package/dist/chunks/toolPool-BJv0sBnR.js +1 -0
  374. package/dist/chunks/trustedDevice-C5s2au0k.js +1 -0
  375. package/dist/chunks/trustedDevice-C9nJhhyZ.js +1 -0
  376. package/dist/chunks/tui-DoOiz2RW.js +6 -0
  377. package/dist/chunks/types-BCy5hsQR.js +1 -0
  378. package/dist/chunks/types-KeqFPzY5.js +17 -0
  379. package/dist/chunks/udsClient-CBF_cZFW.js +1 -0
  380. package/dist/chunks/ultrareviewCommand-BEv1_AS1.js +3 -0
  381. package/dist/chunks/undercover-DPVt2WN7.js +31 -0
  382. package/dist/chunks/undercover-DYa00dVv.js +1 -0
  383. package/dist/chunks/up-DaiW-V1N.js +12 -0
  384. package/dist/chunks/updateCCB-D-4naIUu.js +11 -0
  385. package/dist/chunks/upgrade-BHj8ALep.js +1 -0
  386. package/dist/chunks/upgrade-CSld83v7.js +1 -0
  387. package/dist/chunks/upload-DVlE8SRp.js +1 -0
  388. package/dist/chunks/upstreamproxy-CLf1UaJv.js +11 -0
  389. package/dist/chunks/usage-B_bY46ep.js +1 -0
  390. package/dist/chunks/usage-D4Ubnttz.js +1 -0
  391. package/dist/chunks/useExitOnCtrlCDWithKeybindings-BHi41Ku_.js +1 -0
  392. package/dist/chunks/useMainLoopModel-D3tJJC3y.js +1 -0
  393. package/dist/chunks/useManagePlugins-B4kcqcyY.js +1 -0
  394. package/dist/chunks/useMergedTools-CTQl4cdV.js +1 -0
  395. package/dist/chunks/useSearchInput-JPayBRPC.js +1 -0
  396. package/dist/chunks/useSettingsErrors-YTgPxnRZ.js +1 -0
  397. package/dist/chunks/useTerminalSize-Du-EamDN.js +1 -0
  398. package/dist/chunks/useVoice-CaBv3G13.js +1 -0
  399. package/dist/chunks/util-Q70qdjeS.js +1 -0
  400. package/dist/chunks/utils-Cr-x1Oyd.js +1 -0
  401. package/dist/chunks/validatePlugin-6lg9B564.js +1 -0
  402. package/dist/chunks/vim-zOsQBIp4.js +1 -0
  403. package/dist/chunks/voice-DBQevAhk.js +2 -0
  404. package/dist/chunks/voice-YtzCcIoM.js +8 -0
  405. package/dist/chunks/voiceModeEnabled-CjBjjeNR.js +1 -0
  406. package/dist/chunks/voiceModeEnabled-DK6u8Aaj.js +1 -0
  407. package/dist/chunks/voiceStreamSTT-B8CTbb_6.js +1 -0
  408. package/dist/chunks/voiceStreamSTT-CCkOfmdI.js +1 -0
  409. package/dist/chunks/web-tools-CGqBqo07.js +1 -0
  410. package/dist/chunks/which-BnEnzWhs.js +1 -0
  411. package/dist/chunks/windowsPaths-BeDSnJ23.js +2 -0
  412. package/dist/chunks/windowsPaths-ttHiMKpR.js +1 -0
  413. package/dist/chunks/workSecret-DJu7k30X.js +1 -0
  414. package/dist/chunks/workerRegistry-Bx6FvTZF.js +1 -0
  415. package/dist/chunks/worktree-DPpgPLLG.js +1 -0
  416. package/dist/chunks/worktreeModeEnabled-RtizNgNg.js +1 -0
  417. package/dist/chunks/xml-CVF7dWfi.js +1 -0
  418. package/dist/cli.js +1 -1
  419. package/package.json +1 -1
  420. package/dist/chunks/AddWorkspaceDirectory-BKIYdg96.js +0 -1
  421. package/dist/chunks/App-BAwWP3iN.js +0 -1
  422. package/dist/chunks/ApproveApiKey-CJFvgVKS.js +0 -1
  423. package/dist/chunks/ApproveApiKey-da08NX2f.js +0 -1
  424. package/dist/chunks/AssistantSessionChooser-DQMKGO_q.js +0 -1
  425. package/dist/chunks/BackgroundTasksDialog-Jtiqm4k2.js +0 -2
  426. package/dist/chunks/BypassPermissionsModeDialog-D7TJ4Qn1.js +0 -1
  427. package/dist/chunks/ClaudeInChromeOnboarding-CuPz5Xfi.js +0 -1
  428. package/dist/chunks/ClaudeMdExternalIncludesDialog-CRC6kEV1.js +0 -1
  429. package/dist/chunks/ClaudeMdExternalIncludesDialog-J0uv5XzG.js +0 -1
  430. package/dist/chunks/ConsoleOAuthFlow-CE4OlAHo.js +0 -1
  431. package/dist/chunks/DesktopHandoff-B_vNnZS5.js +0 -1
  432. package/dist/chunks/DevChannelsDialog-kjRnWtNf.js +0 -1
  433. package/dist/chunks/DiffDialog-CSBWOnXJ.js +0 -3
  434. package/dist/chunks/Doctor-DhK599q8.js +0 -1
  435. package/dist/chunks/Doctor-VJ5ZGb8g.js +0 -3
  436. package/dist/chunks/ExitFlow-M5XPGBHL.js +0 -2
  437. package/dist/chunks/Feedback-FHvqI2bu.js +0 -2
  438. package/dist/chunks/Grove-68muTpx6.js +0 -1
  439. package/dist/chunks/Grove-BC2IZIhN.js +0 -11
  440. package/dist/chunks/HybridTransport-Df_FceV2.js +0 -4
  441. package/dist/chunks/ITermBackend-DkpK9X1H.js +0 -1
  442. package/dist/chunks/InvalidConfigDialog-Cm6Yvt00.js +0 -1
  443. package/dist/chunks/InvalidSettingsDialog-Ai3D8AL1.js +0 -1
  444. package/dist/chunks/MCPConnectionManager-BqNXYQEr.js +0 -1
  445. package/dist/chunks/McpParsingWarnings-BZcVbGhE.js +0 -1
  446. package/dist/chunks/MessageSelector-BXOoEogr.js +0 -3
  447. package/dist/chunks/Messages-F6OIAv8C.js +0 -11
  448. package/dist/chunks/Onboarding-n1aA7tmN.js +0 -1
  449. package/dist/chunks/OverageCreditUpsell-Bt23I92r.js +0 -1
  450. package/dist/chunks/PluginSettings-Dgu23nzv.js +0 -17
  451. package/dist/chunks/PromptInputFooterSuggestions-uiV23aG4.js +0 -1
  452. package/dist/chunks/PromptInputHelpMenu-D84vnNKM.js +0 -1
  453. package/dist/chunks/QueryEngine-CEodAvI2.js +0 -1
  454. package/dist/chunks/REPL-CTTa9BK0.js +0 -97
  455. package/dist/chunks/REPL-IO7wsKaQ.js +0 -1
  456. package/dist/chunks/RemoteCallout-BYKqws96.js +0 -1
  457. package/dist/chunks/RemoteSessionManager-Dq0W_fcj.js +0 -2
  458. package/dist/chunks/ResumeConversation-CxzeCdL8.js +0 -1
  459. package/dist/chunks/SSETransport-CJrrD1ln.js +0 -4
  460. package/dist/chunks/SearchExtraToolsTool-DI-36R5p.js +0 -1
  461. package/dist/chunks/SentryErrorBoundary-BKPxEWOf.js +0 -1
  462. package/dist/chunks/SentryErrorBoundary-CcI0kkLW.js +0 -2
  463. package/dist/chunks/Settings-CGcBR9CD.js +0 -2
  464. package/dist/chunks/TeleportProgress-C7muqjDw.js +0 -1
  465. package/dist/chunks/TeleportRepoMismatchDialog-B3pUiRc2.js +0 -1
  466. package/dist/chunks/TeleportResumeWrapper-ClyBQR3K.js +0 -1
  467. package/dist/chunks/ThemePicker-CGIB6YiW.js +0 -1
  468. package/dist/chunks/TmuxBackend-m2ldrneQ.js +0 -9
  469. package/dist/chunks/TrustDialog-o5kqmn6m.js +0 -1
  470. package/dist/chunks/TungstenTool-C5IqKVr0.js +0 -1
  471. package/dist/chunks/ValidationErrorsList-D7bXMb0U.js +0 -2
  472. package/dist/chunks/WelcomeV2-Ckp3JPnA.js +0 -1
  473. package/dist/chunks/WindowsTerminalBackend-DsDqNWSP.js +0 -2
  474. package/dist/chunks/add-dir-DTP3NrLy.js +0 -1
  475. package/dist/chunks/agentDisplay-BEn43jMP.js +0 -1
  476. package/dist/chunks/agents-3ii2LyeQ.js +0 -2
  477. package/dist/chunks/agents-g0PDZl_l.js +0 -103
  478. package/dist/chunks/ant-PZvt_t1G.js +0 -1
  479. package/dist/chunks/api-BRckHGQ5.js +0 -1
  480. package/dist/chunks/api-DBvyymX6.js +0 -1
  481. package/dist/chunks/asciicast-C3nf97NR.js +0 -1
  482. package/dist/chunks/asciicast-DIsaWcsJ.js +0 -4
  483. package/dist/chunks/assistant-BBmaU8-A.js +0 -1
  484. package/dist/chunks/assistant-CMaN0QzY.js +0 -1
  485. package/dist/chunks/assistant-CVhvOfqJ.js +0 -1
  486. package/dist/chunks/auth-BXzbkJcE.js +0 -1
  487. package/dist/chunks/auth-Cud9tPJB.js +0 -1
  488. package/dist/chunks/autoMode-BREcJLYf.js +0 -45
  489. package/dist/chunks/autonomy-CuQizTZi.js +0 -1
  490. package/dist/chunks/autonomy-h9vver1r.js +0 -19
  491. package/dist/chunks/autonomyPanel-DVyrTxfP.js +0 -1
  492. package/dist/chunks/backgroundHousekeeping-DwA5WO9N.js +0 -1
  493. package/dist/chunks/backgroundHousekeeping-Ij_q7KN8.js +0 -17
  494. package/dist/chunks/banner-32EBTKI7.js +0 -2
  495. package/dist/chunks/bg-DK0E4ZtW.js +0 -9
  496. package/dist/chunks/bg-Dbh5z3Y8.js +0 -1
  497. package/dist/chunks/branch-B9AQFFTX.js +0 -3
  498. package/dist/chunks/break-cache-ByJ7U2Ts.js +0 -8
  499. package/dist/chunks/bridge-BkL7g0ua.js +0 -2
  500. package/dist/chunks/bridgeConfig-BPP3lJRh.js +0 -1
  501. package/dist/chunks/bridgeConfig-BZQBBfap.js +0 -1
  502. package/dist/chunks/bridgeEnabled-Bkmqv-2V.js +0 -1
  503. package/dist/chunks/bridgeEnabled-BwBjPmEE.js +0 -1
  504. package/dist/chunks/bridgeMain-CbGj0plH.js +0 -68
  505. package/dist/chunks/bridgeMain-DpQRGiMo.js +0 -1
  506. package/dist/chunks/bridgeMessaging-C-ZFPTiZ.js +0 -1
  507. package/dist/chunks/bridgePointer-B2FPGDWR.js +0 -1
  508. package/dist/chunks/browser-fLRXxIsQ.js +0 -1
  509. package/dist/chunks/btw-BSme4Kzi.js +0 -1
  510. package/dist/chunks/buddy-DX94yYTy.js +0 -3
  511. package/dist/chunks/bypassPermissionsKillswitch-Crl2aipx.js +0 -1
  512. package/dist/chunks/caches-DeXmHls9.js +0 -3
  513. package/dist/chunks/caches-U1iFQIc7.js +0 -1
  514. package/dist/chunks/ccrClient-BYD1ONzC.js +0 -1
  515. package/dist/chunks/changeDetector-PaQPe1HQ.js +0 -1
  516. package/dist/chunks/channelNotification-Aq0p9f-W.js +0 -1
  517. package/dist/chunks/channelNotification-B0QskFjB.js +0 -1
  518. package/dist/chunks/chrome-B8ByN3u6.js +0 -1
  519. package/dist/chunks/chromeNativeHost-DX8f9Y2L.js +0 -1
  520. package/dist/chunks/claudeDesktop-C1qQs6os.js +0 -1
  521. package/dist/chunks/cleanup-Pv6U3HiI.js +0 -1
  522. package/dist/chunks/clear-CeJ5tgg8.js +0 -1
  523. package/dist/chunks/cliLaunch-BQa48gsr.js +0 -1
  524. package/dist/chunks/client-B7AdqRap.js +0 -1
  525. package/dist/chunks/color-OlMWmMnJ.js +0 -1
  526. package/dist/chunks/commands-BwfOl3fk.js +0 -1
  527. package/dist/chunks/commitAttribution-C479aqmn.js +0 -2
  528. package/dist/chunks/commitAttribution-CZ1OOh8F.js +0 -1
  529. package/dist/chunks/common-B379wT22.js +0 -1
  530. package/dist/chunks/common-B_BC3eMY.js +0 -1
  531. package/dist/chunks/common-CMCv4N_v.js +0 -1
  532. package/dist/chunks/compact-Dq-J7j1C.js +0 -3
  533. package/dist/chunks/companion-CtJjyD3N.js +0 -1
  534. package/dist/chunks/completionCache-DHfUBBMH.js +0 -1
  535. package/dist/chunks/completionCache-DORrtxkS.js +0 -4
  536. package/dist/chunks/computerUseLock-BjoDJH2h.js +0 -1
  537. package/dist/chunks/config-DcnYYwCy.js +0 -1
  538. package/dist/chunks/config-_KcvL7RX.js +0 -1
  539. package/dist/chunks/context-CShSBp-i.js +0 -1
  540. package/dist/chunks/context-noninteractive-BApFNncX.js +0 -54
  541. package/dist/chunks/context-noninteractive-uMvPKhng.js +0 -1
  542. package/dist/chunks/conversation-BlUHkj1_.js +0 -1
  543. package/dist/chunks/conversation-CCzL-eYb.js +0 -1
  544. package/dist/chunks/copy-DIMR3Q3S.js +0 -7
  545. package/dist/chunks/createSSHSession-DvSnUdsD.js +0 -6
  546. package/dist/chunks/createSession-D8tcktmP.js +0 -1
  547. package/dist/chunks/createSession-DaT4x1E6.js +0 -1
  548. package/dist/chunks/cronJitterConfig-C2a-Ybqm.js +0 -6
  549. package/dist/chunks/crossProjectResume-B3Chhiwf.js +0 -40
  550. package/dist/chunks/daemon-CCtZ9wY3.js +0 -2
  551. package/dist/chunks/datadog-BYNSi8R3.js +0 -1
  552. package/dist/chunks/datadog-DCukMGn4.js +0 -1
  553. package/dist/chunks/debug-DM5ezCBS.js +0 -1
  554. package/dist/chunks/debug-UI3T040K.js +0 -5
  555. package/dist/chunks/debugUtils-BBMFODKH.js +0 -1
  556. package/dist/chunks/desktop-BXj3JEMV.js +0 -1
  557. package/dist/chunks/detached-D300jlhj.js +0 -5
  558. package/dist/chunks/detectRepository-CBk3S2zv.js +0 -1
  559. package/dist/chunks/detectRepository-DCTvg4p0.js +0 -1
  560. package/dist/chunks/detection-CQsNad64.js +0 -1
  561. package/dist/chunks/detection-DJ-vTbBf.js +0 -1
  562. package/dist/chunks/diff-D3Xuv_4J.js +0 -1
  563. package/dist/chunks/directoryCompletion-D7EGwonO.js +0 -1
  564. package/dist/chunks/doctor-B5-jh6lS.js +0 -1
  565. package/dist/chunks/earlyInput-RoVleNEN.js +0 -1
  566. package/dist/chunks/earlyInput-feVuZGzR.js +0 -2
  567. package/dist/chunks/effort-CpHnXRxJ.js +0 -9
  568. package/dist/chunks/entry-YXnIL7B7.js +0 -14
  569. package/dist/chunks/env-chR0gV31.js +0 -1
  570. package/dist/chunks/envLessBridgeConfig-CcgSiwvA.js +0 -1
  571. package/dist/chunks/envLessBridgeConfig-MaElAFPV.js +0 -1
  572. package/dist/chunks/escHotkey-Cyz0yyh1.js +0 -259
  573. package/dist/chunks/execFileNoThrow-CuQN1sz8.js +0 -1
  574. package/dist/chunks/execSyncWrapper-C2XQnFVo.js +0 -1
  575. package/dist/chunks/executor-4EeD8GNm.js +0 -1561
  576. package/dist/chunks/executor-BHEuNh5F.js +0 -1
  577. package/dist/chunks/exit-DKG0r57m.js +0 -1
  578. package/dist/chunks/export-BNbcpW3p.js +0 -2
  579. package/dist/chunks/exportRenderer-pYMIcnO4.js +0 -1
  580. package/dist/chunks/extra-usage-DTXphHAD.js +0 -1
  581. package/dist/chunks/extra-usage-H-U38bGx.js +0 -1
  582. package/dist/chunks/extra-usage-core-N4VLj0ye.js +0 -1
  583. package/dist/chunks/extra-usage-noninteractive-BGUiGr3a.js +0 -1
  584. package/dist/chunks/extraUsage-X6CmSsdg.js +0 -1
  585. package/dist/chunks/extractMemories-C8R4DJVc.js +0 -1
  586. package/dist/chunks/fast-BJwQnvAP.js +0 -1
  587. package/dist/chunks/fast-DMkPYQmQ.js +0 -1
  588. package/dist/chunks/featureCheck-p7OeCYzj.js +0 -1
  589. package/dist/chunks/feedback-DLcYu4id.js +0 -1
  590. package/dist/chunks/fileStateCache-C7-TxF8G.js +0 -1
  591. package/dist/chunks/files-DYvAZGxp.js +0 -2
  592. package/dist/chunks/firstPartyEventLogger-C00GfHTl.js +0 -1
  593. package/dist/chunks/flushGate-0DZFLUEb.js +0 -1
  594. package/dist/chunks/gates-DP4JyL5e.js +0 -1
  595. package/dist/chunks/gates-DeLWne9R.js +0 -1
  596. package/dist/chunks/gemini-CnKaXUJJ.js +0 -1
  597. package/dist/chunks/generateRecap-BUS2DEdj.js +0 -1
  598. package/dist/chunks/generateSessionName-CnPPgvyy.js +0 -1
  599. package/dist/chunks/genericProcessUtils-BGvcwuPt.js +0 -23
  600. package/dist/chunks/git-CN3qtTb_.js +0 -6
  601. package/dist/chunks/git-D23Mzu_K.js +0 -1
  602. package/dist/chunks/githubRepoPathMapping-CnXpQRPY.js +0 -1
  603. package/dist/chunks/grok-C2BUbWJR.js +0 -1
  604. package/dist/chunks/growthbook-CPTqwUyC.js +0 -1
  605. package/dist/chunks/heapdump-pamjtM2a.js +0 -5
  606. package/dist/chunks/help-z7XnNKDT.js +0 -1
  607. package/dist/chunks/hooks-BEAaBqmd.js +0 -1
  608. package/dist/chunks/hooks-iTfSDH96.js +0 -79
  609. package/dist/chunks/hostAdapter-DWD430of.js +0 -1
  610. package/dist/chunks/hostGuard-zim_4F9V.js +0 -1
  611. package/dist/chunks/ide-BK8Td_CD.js +0 -2
  612. package/dist/chunks/inboundAttachments-DQ4Czsr5.js +0 -1
  613. package/dist/chunks/inboundAttachments-Dq3IYudc.js +0 -1
  614. package/dist/chunks/initReplBridge-BeGirV3Q.js +0 -1
  615. package/dist/chunks/insights-DfD6PMkd.js +0 -822
  616. package/dist/chunks/install-CNq--Fit.js +0 -1
  617. package/dist/chunks/install-github-app-Dhq_T_EJ.js +0 -147
  618. package/dist/chunks/install-slack-app-mz5O3xo_.js +0 -1
  619. package/dist/chunks/instrumentation-CM0poWjx.js +0 -12
  620. package/dist/chunks/job-CKI1I_Va.js +0 -2
  621. package/dist/chunks/jwtUtils-CpXwh_du.js +0 -1
  622. package/dist/chunks/keybindings-5qahtcNc.js +0 -2
  623. package/dist/chunks/lang-BMNwfSRv.js +0 -1
  624. package/dist/chunks/language-DXpi4083.js +0 -1
  625. package/dist/chunks/language-GlWQb4l9.js +0 -1
  626. package/dist/chunks/launchAgentsPlatform-BU4bAPan.js +0 -1
  627. package/dist/chunks/launchAutofixPr-B80p6iq-.js +0 -18
  628. package/dist/chunks/launchLocalMemory-CDAa9B30.js +0 -3
  629. package/dist/chunks/launchLocalVault-B19lF8tP.js +0 -3
  630. package/dist/chunks/launchMemoryStores-C6wJI-8V.js +0 -1
  631. package/dist/chunks/launchOnboarding-BIlwEdkk.js +0 -8
  632. package/dist/chunks/launchSchedule-DjMh3--x.js +0 -1
  633. package/dist/chunks/launchSkillStore-Bs5thijU.js +0 -1
  634. package/dist/chunks/launchTeleport-CDlWx4xC.js +0 -3
  635. package/dist/chunks/launchVault-C40NAyOp.js +0 -1
  636. package/dist/chunks/loadAgentsDir-BYqiLHDS.js +0 -1
  637. package/dist/chunks/loadAgentsDir-C9Ee_fs1.js +0 -4672
  638. package/dist/chunks/loadPluginHooks-DaETszNq.js +0 -1
  639. package/dist/chunks/localSearch-B3zijtEM.js +0 -1
  640. package/dist/chunks/localSearch-BTGnGPVi.js +0 -1
  641. package/dist/chunks/log-CzsijfHZ.js +0 -1
  642. package/dist/chunks/login-B3IQj5YQ.js +0 -1
  643. package/dist/chunks/login-CUM0odSh.js +0 -1
  644. package/dist/chunks/logoV2Utils-CW73xjcW.js +0 -1
  645. package/dist/chunks/logout-B3hPrJSX.js +0 -1
  646. package/dist/chunks/magicDocs-BysWdjbO.js +0 -57
  647. package/dist/chunks/main-CnAyCMYQ.js +0 -1108
  648. package/dist/chunks/main-D9fUXJiD.js +0 -31
  649. package/dist/chunks/mappers-D1SAyuKF.js +0 -1
  650. package/dist/chunks/mcp-BIiXcANN.js +0 -1
  651. package/dist/chunks/mcp-BLcZi9zs.js +0 -2
  652. package/dist/chunks/mcp-nOKz2_By.js +0 -6
  653. package/dist/chunks/mcpServer-CJOTyq3O.js +0 -1
  654. package/dist/chunks/mcpServer-DaiouIKs.js +0 -1
  655. package/dist/chunks/memoize-DxwLawI2.js +0 -1
  656. package/dist/chunks/memory-DtFuXZHl.js +0 -1
  657. package/dist/chunks/mobile-umu5P0cM.js +0 -2
  658. package/dist/chunks/mode-BPNUYCpk.js +0 -2
  659. package/dist/chunks/model-Cky6xlFt.js +0 -1
  660. package/dist/chunks/model-DC5bOhtE.js +0 -1
  661. package/dist/chunks/onChangeAppState-pafR88Yw.js +0 -1
  662. package/dist/chunks/openai-BOxlfR-k.js +0 -10
  663. package/dist/chunks/overageCreditGrant-BmmOYjTh.js +0 -1
  664. package/dist/chunks/panel-ByW1omJn.js +0 -1
  665. package/dist/chunks/panel-s9fbCKfl.js +0 -1
  666. package/dist/chunks/parser-CmngCwjB.js +0 -1
  667. package/dist/chunks/parser-SWIZo39J.js +0 -1
  668. package/dist/chunks/passes-CqiFdifM.js +0 -1
  669. package/dist/chunks/path-B3lx7yHn.js +0 -1
  670. package/dist/chunks/paths-C2JRlUsH.js +0 -39
  671. package/dist/chunks/permissions-BHJUxNga.js +0 -3
  672. package/dist/chunks/permissions-Ps_D01ZB.js +0 -1
  673. package/dist/chunks/pipeTransport-BTYiqf9e.js +0 -1
  674. package/dist/chunks/plan-CF_ClJlj.js +0 -1
  675. package/dist/chunks/platform-CuyedWpe.js +0 -2
  676. package/dist/chunks/plugin-Bz3RKbru.js +0 -1
  677. package/dist/chunks/pluginAutoupdate-Ck0wWoNE.js +0 -1
  678. package/dist/chunks/pluginBlocklist-7dlesHcW.js +0 -1
  679. package/dist/chunks/pluginCliCommands-D502zE25.js +0 -1
  680. package/dist/chunks/pluginFlagging-DfHARfd-.js +0 -1
  681. package/dist/chunks/pluginOperations-BBRf8tuH.js +0 -2
  682. package/dist/chunks/pluginStartupCheck-BKEhWQR2.js +0 -1
  683. package/dist/chunks/pluginStartupCheck-ZcaocOSL.js +0 -1
  684. package/dist/chunks/plugins-JnZ3lNqG.js +0 -4
  685. package/dist/chunks/policyLimits-CtOjYdHx.js +0 -1
  686. package/dist/chunks/pollConfig-Duecunu0.js +0 -1
  687. package/dist/chunks/poller-Dbo07OEA.js +0 -1
  688. package/dist/chunks/poor-CUwZAV9z.js +0 -1
  689. package/dist/chunks/poorMode-DOoZ0U-8.js +0 -1
  690. package/dist/chunks/poorMode-DRcH1fuh.js +0 -1
  691. package/dist/chunks/print-D9IhN66j.js +0 -39
  692. package/dist/chunks/privacy-settings-DmbuvR-R.js +0 -1
  693. package/dist/chunks/processBashCommand-Cg8we9vS.js +0 -1
  694. package/dist/chunks/processSlashCommand-BBQQEGZd.js +0 -6
  695. package/dist/chunks/projectContext-D5FgyE-d.js +0 -1
  696. package/dist/chunks/prompt-7Vt8FUX_.js +0 -1
  697. package/dist/chunks/prompt-Cj0hg3CU.js +0 -1
  698. package/dist/chunks/prompt-thBQB2X5.js +0 -222
  699. package/dist/chunks/promptEditor-C8B2TEXp.js +0 -4
  700. package/dist/chunks/protocolHandler-BUKWgksO.js +0 -13
  701. package/dist/chunks/proxy-CfZp-wce.js +0 -99
  702. package/dist/chunks/rate-limit-options-PruvKAQt.js +0 -1
  703. package/dist/chunks/rcDebugLog-CIS3PU-H.js +0 -11
  704. package/dist/chunks/referral-CXmDvb7V.js +0 -1
  705. package/dist/chunks/refresh-C_FDHRT7.js +0 -1
  706. package/dist/chunks/registerProtocol-WxQUBybC.js +0 -36
  707. package/dist/chunks/registry-CeBTik9J.js +0 -1
  708. package/dist/chunks/release-notes-aZ6QUVnT.js +0 -4
  709. package/dist/chunks/releaseNotes-2GPd_O_r.js +0 -2
  710. package/dist/chunks/reload-plugins-BDh4ZhHi.js +0 -1
  711. package/dist/chunks/remote-env-BIOFHNQC.js +0 -1
  712. package/dist/chunks/remoteBridgeCore-DyA_2GrL.js +0 -1
  713. package/dist/chunks/remoteControlServer-BjW9GsPd.js +0 -3
  714. package/dist/chunks/rename-CKlAeppY.js +0 -1
  715. package/dist/chunks/renderOptions-rmj4Mkls.js +0 -1
  716. package/dist/chunks/resume-Dm71Aeni.js +0 -2
  717. package/dist/chunks/runtimeObserver-BYOo5dT0.js +0 -1
  718. package/dist/chunks/runtimeObserver-CA7pdBvT.js +0 -10
  719. package/dist/chunks/sandbox-adapter-C7TBAehE.js +0 -1
  720. package/dist/chunks/sandbox-toggle-fHc9E9xW.js +0 -1
  721. package/dist/chunks/searchExtraTools-CpFsg_tS.js +0 -1
  722. package/dist/chunks/sentry-B1g5Tgp2.js +0 -13
  723. package/dist/chunks/session-C46oy7nX.js +0 -2
  724. package/dist/chunks/sessionDiscovery-CtrJ2Bfr.js +0 -1
  725. package/dist/chunks/sessionFileAccessHooks-dwF5SFoS.js +0 -1
  726. package/dist/chunks/sessionMemory-BqCsLnFl.js +0 -1
  727. package/dist/chunks/sessionMemory-D4-Ymn0Q.js +0 -1
  728. package/dist/chunks/sessionMemoryUtils-BKdYMir6.js +0 -1
  729. package/dist/chunks/sessionObserver-Bfu8q0_K.js +0 -1
  730. package/dist/chunks/sessionObserver-DoBuLaCJ.js +0 -20
  731. package/dist/chunks/sessionStorage-CUUU_J4D.js +0 -1
  732. package/dist/chunks/sessionStoragePortable-DJZ_6cL8.js +0 -3
  733. package/dist/chunks/sessionTitle-BOM0LQlq.js +0 -14
  734. package/dist/chunks/sessionTracing-BEKULg2L.js +0 -11
  735. package/dist/chunks/settingsSync-BIsGiZhM.js +0 -1
  736. package/dist/chunks/setup-C3FOTg1s.js +0 -1
  737. package/dist/chunks/setup-ChF37I92.js +0 -9
  738. package/dist/chunks/setup-DvFPFV-3.js +0 -2
  739. package/dist/chunks/shadowedRuleDetection-spwhhTXF.js +0 -1
  740. package/dist/chunks/shellQuote-DgjT8KBA.js +0 -1
  741. package/dist/chunks/sideQuestion-iy7kJEkr.js +0 -20
  742. package/dist/chunks/sink-D6dxOYIw.js +0 -1
  743. package/dist/chunks/sink-FeQonv8-.js +0 -1
  744. package/dist/chunks/sinks-DKMqKJ66.js +0 -1
  745. package/dist/chunks/sinks-zNh_PVeS.js +0 -2
  746. package/dist/chunks/skill-learning-ChAFwJf0.js +0 -5
  747. package/dist/chunks/skillChangeDetector-8LVraP0Y.js +0 -1
  748. package/dist/chunks/skillGapStore-CUws9CQ6.js +0 -5
  749. package/dist/chunks/skillGapStore-CdPgIARS.js +0 -1
  750. package/dist/chunks/skillGenerator-CLtTRIjy.js +0 -8
  751. package/dist/chunks/skillLearning-CBosoKl-.js +0 -1
  752. package/dist/chunks/skillLearning-f7-aknmS.js +0 -1
  753. package/dist/chunks/skillPanel-Cd0AFEZf.js +0 -28
  754. package/dist/chunks/skillSearchPanel-VWiAbmdr.js +0 -21
  755. package/dist/chunks/skills-oQtI4eDn.js +0 -1
  756. package/dist/chunks/sprites-Cp4_DJUI.js +0 -1
  757. package/dist/chunks/src-BIPP3_mo.js +0 -26
  758. package/dist/chunks/src-DJXKJavk.js +0 -1
  759. package/dist/chunks/startupProfiler-DnXZaX4A.js +0 -3
  760. package/dist/chunks/startupProfiler-SOE--nM9.js +0 -1
  761. package/dist/chunks/stats-B1X-nxO8.js +0 -1
  762. package/dist/chunks/status-BtCnWZEv.js +0 -1
  763. package/dist/chunks/statusNoticeHelpers-B6GW2gMe.js +0 -1
  764. package/dist/chunks/stdio-BEEzuxaZ.js +0 -1
  765. package/dist/chunks/stickers-BMh2qjgF.js +0 -1
  766. package/dist/chunks/subprocessEnv-CggQWZCx.js +0 -1
  767. package/dist/chunks/systemPromptSections-DB93ZNWP.js +0 -1
  768. package/dist/chunks/tag-B6WpuUE_.js +0 -11
  769. package/dist/chunks/tasks-DIOPZDoF.js +0 -1
  770. package/dist/chunks/teamHelpers-9p7wPcXj.js +0 -1
  771. package/dist/chunks/teamHelpers-PLGwYL4x.js +0 -1
  772. package/dist/chunks/teammateModeSnapshot-DO-3AkNP.js +0 -1
  773. package/dist/chunks/teammateModeSnapshot-DU8JCRRs.js +0 -1
  774. package/dist/chunks/teleport-DPUoWpD4.js +0 -1
  775. package/dist/chunks/templateJobs-DOSQvjx0.js +0 -12
  776. package/dist/chunks/terminalSetup-DdHkyElj.js +0 -33
  777. package/dist/chunks/terminalSetup-tSFJeCVl.js +0 -1
  778. package/dist/chunks/theme-Hf1fhR3q.js +0 -1
  779. package/dist/chunks/thinkback-5QYAbr0P.js +0 -1
  780. package/dist/chunks/thinkback-B5IraP81.js +0 -1
  781. package/dist/chunks/thinkback-play-Bqv85sjY.js +0 -1
  782. package/dist/chunks/tmux-CvbhsfwG.js +0 -1
  783. package/dist/chunks/toolEventObserver-B-mqmRv0.js +0 -1
  784. package/dist/chunks/toolEventObserver-_Fk1dSYg.js +0 -1
  785. package/dist/chunks/toolPool-C2KLBvek.js +0 -1
  786. package/dist/chunks/toolPool-CiEaFfxq.js +0 -1
  787. package/dist/chunks/trustedDevice-BowIKqqC.js +0 -1
  788. package/dist/chunks/trustedDevice-f8HslQu2.js +0 -1
  789. package/dist/chunks/tui-geoc3zxu.js +0 -6
  790. package/dist/chunks/types-CQ1wrnQ0.js +0 -1
  791. package/dist/chunks/types-Csi32ZXh.js +0 -17
  792. package/dist/chunks/udsClient-BdPOrL1H.js +0 -1
  793. package/dist/chunks/ultrareviewCommand-DbmRN6Lg.js +0 -3
  794. package/dist/chunks/undercover-Ch9wnIbk.js +0 -31
  795. package/dist/chunks/undercover-X6-EJ_7K.js +0 -1
  796. package/dist/chunks/up-D-U4wUCe.js +0 -12
  797. package/dist/chunks/updateCCB-DFHrOTEX.js +0 -11
  798. package/dist/chunks/upgrade-B6Ih-Ubj.js +0 -1
  799. package/dist/chunks/upgrade-CC4cnsnt.js +0 -1
  800. package/dist/chunks/upload-DSTB33ZR.js +0 -1
  801. package/dist/chunks/upstreamproxy-Ci5T_JCo.js +0 -11
  802. package/dist/chunks/usage-CNqpSfd2.js +0 -1
  803. package/dist/chunks/usage-DiZsjcMM.js +0 -1
  804. package/dist/chunks/useMainLoopModel-Bo6iEtB3.js +0 -1
  805. package/dist/chunks/useManagePlugins-Cvj0XfLp.js +0 -1
  806. package/dist/chunks/useMergedTools-BEpwy0Ec.js +0 -1
  807. package/dist/chunks/useSearchInput-YiO4crrI.js +0 -1
  808. package/dist/chunks/useSettingsErrors-BE-PITl4.js +0 -1
  809. package/dist/chunks/useVoice-D1sKPiqb.js +0 -1
  810. package/dist/chunks/util-C8_5375U.js +0 -1
  811. package/dist/chunks/utils-Dmh9vBcg.js +0 -1
  812. package/dist/chunks/validatePlugin-BQA60S_J.js +0 -1
  813. package/dist/chunks/vim-oNiLgw0C.js +0 -1
  814. package/dist/chunks/voice-BcA5h8ya.js +0 -8
  815. package/dist/chunks/voice-CGsMzVaA.js +0 -2
  816. package/dist/chunks/voiceModeEnabled-DprM_JSH.js +0 -1
  817. package/dist/chunks/voiceModeEnabled-Dpx-sP8V.js +0 -1
  818. package/dist/chunks/voiceStreamSTT-CASv4SGl.js +0 -1
  819. package/dist/chunks/voiceStreamSTT-CaI5Uz-7.js +0 -1
  820. package/dist/chunks/which-DqSAIvp2.js +0 -1
  821. package/dist/chunks/windowsPaths-C9CigqoF.js +0 -1
  822. package/dist/chunks/windowsPaths-swxCp7bX.js +0 -2
  823. package/dist/chunks/workSecret-mS2OrpxF.js +0 -1
  824. package/dist/chunks/workerRegistry-CCYrYthd.js +0 -1
  825. package/dist/chunks/worktree-C9WNXNFR.js +0 -1
  826. package/dist/chunks/worktreeModeEnabled-THQb19xR.js +0 -1
  827. package/dist/chunks/xml-BW5T-oW-.js +0 -1
  828. /package/dist/chunks/{Dialog-DYFGqyDs.js → Dialog-91X6ZGg9.js} +0 -0
  829. /package/dist/chunks/{InProcessTransport-gJLr5CIx.js → InProcessTransport-B9II3BiO.js} +0 -0
  830. /package/dist/chunks/{ListItem-OFARanN7.js → ListItem-DCQhApdJ.js} +0 -0
  831. /package/dist/chunks/{PermissionDialog-5MlJf7ew.js → PermissionDialog-_WQPRYHQ.js} +0 -0
  832. /package/dist/chunks/{PressEnterToContinue-BdA9zDGs.js → PressEnterToContinue-BJ58eCFC.js} +0 -0
  833. /package/dist/chunks/{SearchBox-DfOmUoaI.js → SearchBox-CkO4rQ-9.js} +0 -0
  834. /package/dist/chunks/{TungstenTool-V-Bwqlx3.js → TungstenTool-CnAF4y0E.js} +0 -0
  835. /package/dist/chunks/{attributionHooks-Br5LZ6bk.js → attributionHooks-VGSpz4mk.js} +0 -0
  836. /package/dist/chunks/{attributionTrailer-BMTuK4Ax.js → attributionTrailer-C8uqiLIb.js} +0 -0
  837. /package/dist/chunks/{autoModeDenials-D8eQ1CoM.js → autoModeDenials-DlO5g6E9.js} +0 -0
  838. /package/dist/chunks/{bedrockClient-Ci523Btx.js → bedrockClient-BUmO2U-X.js} +0 -0
  839. /package/dist/chunks/{capacityWake-BXlUpptF.js → capacityWake-DtmDHwEt.js} +0 -0
  840. /package/dist/chunks/{ccshareResume-CqNm2k-J.js → ccshareResume-DKwcd0Vc.js} +0 -0
  841. /package/dist/chunks/{connectHeadless-DFCrE6O4.js → connectHeadless-ByewVfOb.js} +0 -0
  842. /package/dist/chunks/{constants-41VpZw2G.js → constants-BljlAJOX.js} +0 -0
  843. /package/dist/chunks/{controlMessageCompat-BJhFiS7u.js → controlMessageCompat-Ds-CF-sM.js} +0 -0
  844. /package/dist/chunks/{cron-DiW7eIPP.js → cron-g_P3I5uT.js} +0 -0
  845. /package/dist/chunks/{dangerousBackend-Du0K4q5Z.js → dangerousBackend-Dkjtndh1.js} +0 -0
  846. /package/dist/chunks/{distRoot-CcxmnzqQ.js → distRoot-BNg_iO5-.js} +0 -0
  847. /package/dist/chunks/{esm-C-1qL9Mn.js → esm-vlR7mK5b.js} +0 -0
  848. /package/dist/chunks/{eventLoopStallDetector-XfubcyMN.js → eventLoopStallDetector-bYy0fesH.js} +0 -0
  849. /package/dist/chunks/{exit-_obETqBv.js → exit-DOBLl8jN.js} +0 -0
  850. /package/dist/chunks/{featureCheck-Cm0YNDXO.js → featureCheck-j7P30mry.js} +0 -0
  851. /package/dist/chunks/{fpsMetrics-CEQt6Tk1.js → fpsMetrics-DKWp7vng.js} +0 -0
  852. /package/dist/chunks/{fuse-TM-TeOo_.js → fuse-D3B-UE5Y.js} +0 -0
  853. /package/dist/chunks/{hash-BRmOQc3c.js → hash-CaUkS-30.js} +0 -0
  854. /package/dist/chunks/{index.min-BJnb9GQI.js → index.min-BNgJ2wVD.js} +0 -0
  855. /package/dist/chunks/{instinctParser-CJPM8VjX.js → instinctParser-DOtj1Kni.js} +0 -0
  856. /package/dist/chunks/{intl-Pse97ORk.js → intl-CLeE9DsD.js} +0 -0
  857. /package/dist/chunks/{launchCommand-Du91jxMC.js → launchCommand-9eYsPG7W.js} +0 -0
  858. /package/dist/chunks/{lazySchema-2sOku3cX.js → lazySchema-B0QShMaQ.js} +0 -0
  859. /package/dist/chunks/{lib-B4Q0Nrpb.js → lib-Cf16LgKj.js} +0 -0
  860. /package/dist/chunks/{lockfile-Y1hwdHrQ.js → lockfile-C3JsqLpb.js} +0 -0
  861. /package/dist/chunks/{modalContext-CmSKRyea.js → modalContext-c5Yqx_CQ.js} +0 -0
  862. /package/dist/chunks/{normalization-Cox8C0dP.js → normalization-BLfP0Kqt.js} +0 -0
  863. /package/dist/chunks/{observationStore-gFvWXJmc.js → observationStore-rLlDwRtG.js} +0 -0
  864. /package/dist/chunks/{openaiShared-Dy78YERG.js → openaiShared-C-AuktRP.js} +0 -0
  865. /package/dist/chunks/{output-style-BmEQscMd.js → output-style-B64-Zum6.js} +0 -0
  866. /package/dist/chunks/{parseConnectUrl-C6cvMkkH.js → parseConnectUrl-DL390ePs.js} +0 -0
  867. /package/dist/chunks/{permissions-DXLfdE7b.js → permissions-BsVJvaEe.js} +0 -0
  868. /package/dist/chunks/{postCommitAttribution-DhFkZMxJ.js → postCommitAttribution-D8MoHFoz.js} +0 -0
  869. /package/dist/chunks/{projectContext-iWPqcl0Z.js → projectContext-Dn7umMp6.js} +0 -0
  870. /package/dist/chunks/{prompt-4tea6NJQ.js → prompt-IqfIbvg9.js} +0 -0
  871. /package/dist/chunks/{rewind-DAn-nNs-.js → rewind-Djt1zU_3.js} +0 -0
  872. /package/dist/chunks/{rollback-DbSpxmJE.js → rollback-CtS4yEQx.js} +0 -0
  873. /package/dist/chunks/{sanitization-JYRkZFrK.js → sanitization-Ds6zRQyx.js} +0 -0
  874. /package/dist/chunks/{sdkHeapDumpMonitor-DKtfJW5o.js → sdkHeapDumpMonitor-DLMMNeqo.js} +0 -0
  875. /package/dist/chunks/{semver-Tw0AFar5.js → semver-Di5OaTd5.js} +0 -0
  876. /package/dist/chunks/{server-CswFAYwN.js → server-DONKdvGc.js} +0 -0
  877. /package/dist/chunks/{serverBanner-CImTYGhY.js → serverBanner-DIyjgIM-.js} +0 -0
  878. /package/dist/chunks/{serverLog-Bwt7XEmk.js → serverLog-D1N5yx8A.js} +0 -0
  879. /package/dist/chunks/{sessionDataUploader-CKRXCBxI.js → sessionDataUploader-CsNePsOb.js} +0 -0
  880. /package/dist/chunks/{sessionManager-Ca2O821f.js → sessionManager-BOmgJd1l.js} +0 -0
  881. /package/dist/chunks/{slashCommandParsing-Cari0pNg.js → slashCommandParsing-BfanVchF.js} +0 -0
  882. /package/dist/chunks/{sleep-8Eb9j_Ly.js → sleep-C6koP5Ka.js} +0 -0
  883. /package/dist/chunks/{src-x7u_sB6m.js → src-BWpNn6Yz.js} +0 -0
  884. /package/dist/chunks/{src-BRAdBA8A.js → src-C-Ho8kYe.js} +0 -0
  885. /package/dist/chunks/{src-BlLavFUS.js → src-Cu58IYYb.js} +0 -0
  886. /package/dist/chunks/{src-CI_jaaBj.js → src-d2UJ68oX.js} +0 -0
  887. /package/dist/chunks/{state-Ce1HlR-H.js → state-BiRT9RAF.js} +0 -0
  888. /package/dist/chunks/{staticRender-Br64h1E1.js → staticRender-C5v46np_.js} +0 -0
  889. /package/dist/chunks/{stdio-D4cT86R0.js → stdio-Oy68T2eE.js} +0 -0
  890. /package/dist/chunks/{store-DhI7Lcan.js → store-DYC8zeL1.js} +0 -0
  891. /package/dist/chunks/{subprocessEnv-DV6q6o6w.js → subprocessEnv-DIeTJ-xE.js} +0 -0
  892. /package/dist/chunks/{systemPromptSections-BcN_XBTx.js → systemPromptSections-DY7epA2Y.js} +0 -0
  893. /package/dist/chunks/{systemTheme-dDbitcxB.js → systemTheme-eRWGHYSL.js} +0 -0
  894. /package/dist/chunks/{teammate-DMYOtLTK.js → teammate-CbskW5G9.js} +0 -0
  895. /package/dist/chunks/{types-RJTEOuIt.js → types-C0nqJFkV.js} +0 -0
  896. /package/dist/chunks/{useKeybinding-FsOnjW6T.js → useKeybinding-DPOUuymz.js} +0 -0
  897. /package/dist/chunks/{worktreeModeEnabled-Db6b_Iy_.js → worktreeModeEnabled-KtHEqeFA.js} +0 -0
  898. /package/dist/chunks/{xdg-CBxMmQux.js → xdg-BFD9ydDV.js} +0 -0
@@ -0,0 +1,36 @@
1
+ import{a as e,n as t,o as n,r}from"./chunk-DR8-3Aex.js";import{a as i,i as a,n as o,o as s,r as c,t as l}from"./isObject-DaxDnPKm.js";import{g as u,h as d,l as f,n as p,t as m,u as ee}from"./memoize-DNnuA2aU.js";import{a as te,c as ne,f as re,l as ie,n as ae,s as h,t as oe,u as g}from"./envUtils-BWeoiL4Y.js";import{t as se}from"./client-_sjL0I7A.js";import{n as ce,t as _}from"./defineProperty-80gRi2ZW.js";import{_ as le,d as ue,h as de,n as fe,o as pe,r as me,s as he}from"./esm-CJlBxjtx.js";import{B as ge,D as _e,Q as ve,Tt as ye,V as be,Z as xe,_ as Se,a as Ce,c as we,d as Te,j as Ee,jt as De,o as Oe,t as ke,u as Ae,x as je,z as Me}from"./esm-DcdOXSzi.js";import{i as Ne,r as Pe,t as Fe}from"./esm-BGQPWnJy.js";import{n as v,t as Ie}from"./axios-DhfaybwJ.js";import{Cn as y,En as Le,In as Re,Ln as b,Mn as x,Mr as ze,St as Be,Tt as S,Xn as Ve,Yn as C,kn as He,kt as w,ln as Ue,un as T,vt as E,wn as D,zt as We}from"./schemas-BGAvj1T4.js";import{a as Ge,n as Ke,o as qe,t as Je}from"./v4-f1i_CNUT.js";import{Bn as Ye,In as Xe,Ln as Ze,zn as Qe}from"./src-Di342QoJ.js";import{i as $e,r as et}from"./isSymbol-Dp3irZaY.js";import{$i as tt,$r as nt,Bn as rt,Br as it,Ct as at,Dn as ot,E as st,Ei as ct,Et as lt,F as ut,Fi as dt,Fr as ft,Gi as pt,H as mt,Hi as ht,Hr as gt,I as _t,Ii as vt,Ji as yt,Jr as bt,K as xt,Ki as St,Kr as Ct,Lr as wt,Mi as Tt,Ni as Et,Pi as Dt,Pr as Ot,Qr as kt,Rr as At,Ti as jt,U as Mt,Ur as Nt,Vi as Pt,Vr as Ft,Wr as It,Xi as Lt,Xr as Rt,Yi as zt,Yr as Bt,Zr as Vt,_i as Ht,ai as Ut,ar as Wt,at as Gt,b as Kt,ci as qt,cn as O,cr as Jt,di as Yt,ea as Xt,ei as Zt,en as Qt,et as $t,fi as en,gi as tn,hi as nn,hn as rn,ia as an,ii as on,ji as sn,na as cn,ni as ln,oi as un,ot as dn,qi as fn,qr as pn,ra as mn,ri as hn,rt as gn,si as _n,st as vn,ta as yn,ti as bn,ut as xn,vi as Sn,vt as Cn,x as wn,zr as Tn}from"./state-sIHsFpDu.js";import{A as En,B as Dn,Ct as On,D as kn,E as An,G as jn,J as Mn,K as Nn,N as Pn,O as k,Q as Fn,St as In,T as Ln,Tt as Rn,U as zn,Z as Bn,_ as Vn,_t as Hn,at as Un,bt as Wn,ct as Gn,d as Kn,dt as qn,f as Jn,ft as Yn,gt as Xn,h as A,ht as Zn,it as Qn,l as j,lt as $n,mt as er,nt as tr,ot as nr,p as M,pt as rr,rt as ir,st as ar,tt as or,ut as sr,vt as cr,wt as lr,x as ur,xt as dr,yt as fr,z as pr}from"./debug-otxXY3j-.js";import{a as mr,n as hr,r as N}from"./analytics-DqMQntaB.js";import{n as gr,t as _r}from"./cwd--iizewsn.js";import{t as vr}from"./sdk-DEtgRZvI.js";import{F as yr,P as br,h as xr,n as Sr,t as Cr,v as wr}from"./git-C0IuvuIy.js";import{l as P,n as Tr,r as Er,s as Dr,t as Or,u as kr}from"./oauth-CdZEzMww.js";import{n as Ar,t as jr}from"./bundledMode-kSQejuY4.js";import{n as Mr,r as Nr,t as Pr}from"./execa-CGue6Z3n.js";import{a as Fr,i as Ir,n as Lr,r as F,t as Rr}from"./env-C2A9gV_G.js";import{d as zr,f as Br,o as Vr,p as Hr,s as I,u as Ur}from"./log-DSV4Ht5l.js";import{a as Wr,i as Gr,n as Kr,o as qr,r as Jr}from"./platform-mh9ypxS8.js";import{r as Yr,t as Xr}from"./memoize-DJ1XCN-z.js";import{m as Zr}from"./sessionStoragePortable-CJUZrbIq.js";import{a as Qr,i as $r,n as ei}from"./path-BE28AJwZ.js";import{a as ti,i as ni,n as ri,r as ii,t as ai}from"./execFileNoThrow-azCkYhmF.js";import{a as oi,f as si,l as ci,p as li,r as ui,s as di,u as fi}from"./types-KeqFPzY5.js";import{C as pi,D as mi,E as hi,T as gi,a as _i,b as vi,f as yi,i as bi,l as xi,t as Si,x as Ci}from"./teammate-CbskW5G9.js";import{a as wi,n as Ti}from"./startupProfiler-CAntGAbs.js";import{n as L,t as Ei}from"./lazySchema-B0QShMaQ.js";import{i as Di,r as Oi,t as ki}from"./permissions-BsVJvaEe.js";import{n as Ai,t as ji}from"./normalization-BLfP0Kqt.js";import{l as Mi,n as Ni,o as Pi}from"./stringUtils-KZoO4GUd.js";import{a as Fi,o as Ii,u as Li}from"./proxy-CF7ZDxaW.js";import{n as Ri,t as zi}from"./sleep-C6koP5Ka.js";import{i as Bi,t as Vi}from"./genericProcessUtils-tJxf3yqB.js";import{i as Hi,o as Ui}from"./common-NEOWMwtB.js";import{homedir as Wi,userInfo as Gi}from"os";import*as Ki from"path";import{basename as qi,dirname as Ji,extname as Yi,isAbsolute as Xi,join as R,normalize as Zi,relative as Qi,resolve as $i,sep as ea}from"path";import{chmodSync as ta,existsSync as na,mkdirSync as ra,readFileSync as ia,unwatchFile as aa,watchFile as oa,writeFileSync as sa}from"fs";import{createHash as ca,randomBytes as la,randomUUID as ua}from"crypto";import{appendFile as da,mkdir as fa,readFile as pa,readdir as ma,realpath as ha,stat as ga,unlink as _a,writeFile as va}from"fs/promises";import{exec as ya,execFile as ba}from"child_process";import{AsyncLocalStorage as xa}from"async_hooks";function Sa(){return Ga}function Ca(e){let t=2166136261,n=e.length;for(let r=0;r<n;r++)t^=e.charCodeAt(r),t+=(t<<1)+(t<<4)+(t<<7)+(t<<8)+(t<<24);return t>>>0}function wa(e,t,n){return n===2?Ca(Ca(e+t)+``)%1e4/1e4:n===1?Ca(t+e)%1e3/1e3:null}function Ta(e){return e<=0?[]:Array(e).fill(1/e)}function Ea(e,t){return e>=t[0]&&e<t[1]}function Da(e,t){let n=wa(`__`+t[0],e,1);return n===null?!1:n>=t[1]&&n<t[2]}function Oa(e,t){for(let n=0;n<t.length;n++)if(Ea(e,t[n]))return n;return-1}function ka(e){try{let t=e.replace(/([^\\])\//g,`$1\\/`);return new RegExp(t)}catch(e){console.error(e);return}}function Aa(e,t){if(!t.length)return!1;let n=!1,r=!1;for(let i=0;i<t.length;i++){let a=Na(e,t[i].type,t[i].pattern);if(t[i].include===!1){if(a)return!1}else n=!0,a&&(r=!0)}return r||!n}function ja(e,t,n){try{let r=t.replace(/[*.+?^${}()|[\]\\]/g,`\\$&`).replace(/_____/g,`.*`);return n&&(r=`\\/?`+r.replace(/(^\/|\/$)/g,``)+`\\/?`),RegExp(`^`+r+`$`,`i`).test(e)}catch{return!1}}function Ma(e,t){try{let n=new URL(t.replace(/^([^:/?]*)\./i,`https://$1.`).replace(/\*/g,`_____`),`https://_____`),r=[[e.host,n.host,!1],[e.pathname,n.pathname,!0]];return n.hash&&r.push([e.hash,n.hash,!1]),n.searchParams.forEach((t,n)=>{r.push([e.searchParams.get(n)||``,t,!1])}),!r.some(e=>!ja(e[0],e[1],e[2]))}catch{return!1}}function Na(e,t,n){try{let r=new URL(e,`https://_`);if(t===`regex`){let e=ka(n);return e?e.test(r.href)||e.test(r.href.substring(r.origin.length)):!1}else if(t===`simple`)return Ma(r,n);return!1}catch{return!1}}function Pa(e,t,n){t=t===void 0?1:t,t<0?t=0:t>1&&(t=1);let r=Ta(e);n=n||r,n.length!==e&&(n=r);let i=n.reduce((e,t)=>t+e,0);(i<.99||i>1.01)&&(n=r);let a=0;return n.map(e=>{let n=a;return a+=e,[n,n+t*e]})}function Fa(e,t,n){if(!t)return null;let r=t.split(`?`)[1];if(!r)return null;let i=r.replace(/#.*/,``).split(`&`).map(e=>e.split(`=`,2)).filter(([t])=>t===e).map(([,e])=>parseInt(e));return i.length>0&&i[0]>=0&&i[0]<n?i[0]:null}function Ia(e){try{return e()}catch(e){return console.error(e),!1}}async function La(e,t,n){if(t=t||``,n=n||globalThis.crypto&&globalThis.crypto.subtle||Ga.SubtleCrypto,!n)throw Error(`No SubtleCrypto implementation found`);try{let r=await n.importKey(`raw`,Ka(t),{name:`AES-CBC`,length:128},!0,[`encrypt`,`decrypt`]),[i,a]=e.split(`.`),o=await n.decrypt({name:`AES-CBC`,iv:Ka(i)},r,Ka(a));return new TextDecoder().decode(o)}catch{throw Error(`Failed to decrypt`)}}function Ra(e){return typeof e==`string`?e:JSON.stringify(e)}function za(e){typeof e==`number`&&(e+=``),(!e||typeof e!=`string`)&&(e=`0`);let t=e.replace(/(^v|\+.*$)/g,``).split(/[-.]/);return t.length===3&&t.push(`~`),t.map(e=>e.match(/^[0-9]+$/)?e.padStart(5,` `):e).join(`-`)}function Ba(){let e;try{e=`1.6.5`}catch{e=``}return e}function Va(e,t){let n,r;try{n=new URL(e),r=new URL(t)}catch(e){return console.error(`Unable to merge query strings: ${e}`),t}return n.searchParams.forEach((e,t)=>{r.searchParams.has(t)||r.searchParams.set(t,e)}),r.toString()}function Ha(e){return typeof e==`object`&&!!e}function Ua(e){return e.urlPatterns&&e.variations.some(e=>Ha(e)&&`urlRedirect`in e)?`redirect`:e.variations.some(e=>Ha(e)&&(e.domMutations||`js`in e||`css`in e))?`visual`:`unknown`}async function Wa(e,t){return new Promise(n=>{let r=!1,i,a=e=>{r||(r=!0,i&&clearTimeout(i),n(e||null))};t&&(i=setTimeout(()=>a(),t)),e.then(e=>a(e)).catch(()=>a())})}var Ga,Ka,qa=t((()=>{Ga={fetch:globalThis.fetch?globalThis.fetch.bind(globalThis):void 0,SubtleCrypto:globalThis.crypto?globalThis.crypto.subtle:void 0,EventSource:globalThis.EventSource},Ka=e=>Uint8Array.from(atob(e),e=>e.charCodeAt(0))}));function Ja(e){Object.assign(z,e),z.backgroundSync||ho()}async function Ya({instance:e,timeout:t,skipCache:n,allowStale:r,backgroundSync:i}){return i||(z.backgroundSync=!1),to({instance:e,allowStale:r,timeout:t,skipCache:n})}function Xa(e){let t=no(e),n=yo.get(t)||new Set;n.add(e),yo.set(t,n)}function Za(e){yo.forEach(t=>t.delete(e))}function Qa(){Co.forEach(e=>{e&&(e.state=`idle`,fo(e))})}function $a(){Co.forEach(e=>{e&&e.state===`idle`&&po(e)})}async function eo(){try{if(!_o.localStorage)return;await _o.localStorage.setItem(z.cacheKey,JSON.stringify(Array.from(xo.entries())))}catch{}}async function to({instance:e,allowStale:t,timeout:n,skipCache:r}){let i=no(e),a=ro(e),o=new Date,s=new Date(o.getTime()-z.maxAge+z.staleTTL);await io();let c=!z.disableCache&&!r?xo.get(a):void 0;return c&&(t||c.staleAt>o)&&c.staleAt>s?(c.sse&&wo.add(i),c.staleAt<o?co(e):lo(e),{data:c.data,success:!0,source:`cache`}):await Wa(co(e),n)||{data:null,success:!1,source:`timeout`,error:Error(`Timeout`)}}function no(e){let[t,n]=e.getApiInfo();return`${t}||${n}`}function ro(e){let t=no(e);if(!(`isRemoteEval`in e)||!e.isRemoteEval())return t;let n=e.getAttributes(),r=e.getCacheKeyAttributes()||Object.keys(e.getAttributes()),i={};r.forEach(e=>{i[e]=n[e]});let a=e.getForcedVariations(),o=e.getUrl();return`${t}||${JSON.stringify({ca:i,fv:a,url:o})}`}async function io(){if(!bo){bo=!0;try{if(_o.localStorage){let e=await _o.localStorage.getItem(z.cacheKey);if(!z.disableCache&&e){let t=JSON.parse(e);t&&Array.isArray(t)&&t.forEach(([e,t])=>{xo.set(e,{...t,staleAt:new Date(t.staleAt)})}),ao()}}}catch{}if(!z.disableIdleStreams){let e=vo.startIdleListener();e&&(vo.stopIdleListener=e)}}}function ao(){let e=Array.from(xo.entries()).map(([e,t])=>({key:e,staleAt:t.staleAt.getTime()})).sort((e,t)=>e.staleAt-t.staleAt),t=Math.min(Math.max(0,xo.size-z.maxEntries),xo.size);for(let n=0;n<t;n++)xo.delete(e[n].key)}function oo(e,t,n){let r=n.dateUpdated||``,i=new Date(Date.now()+z.staleTTL),a=z.disableCache?void 0:xo.get(t);if(a&&r&&a.version===r){a.staleAt=i,eo();return}z.disableCache||(xo.set(t,{data:n,version:r,staleAt:i,sse:wo.has(e)}),ao()),eo();let o=yo.get(e);o&&o.forEach(e=>so(e,n))}async function so(e,t){await e.setPayload(t||e.getPayload())}async function co(e){let{apiHost:t,apiRequestHeaders:n}=e.getApiHosts(),r=e.getClientKey(),i=`isRemoteEval`in e&&e.isRemoteEval(),a=no(e),o=ro(e),s=So.get(o);return s||(s=(i?vo.fetchRemoteEvalCall({host:t,clientKey:r,payload:{attributes:e.getAttributes(),forcedVariations:e.getForcedVariations(),forcedFeatures:Array.from(e.getForcedFeatures().entries()),url:e.getUrl()},headers:n}):vo.fetchFeaturesCall({host:t,clientKey:r,headers:n})).then(e=>{if(!e.ok)throw Error(`HTTP error: ${e.status}`);return e.headers.get(`x-sse-support`)===`enabled`&&wo.add(a),e.json()}).then(t=>(oo(a,o,t),lo(e),So.delete(o),{data:t,success:!0,source:`network`})).catch(e=>(So.delete(o),{data:null,source:`error`,success:!1,error:e})),So.set(o,s)),s}function lo(e,t=!1){let n=no(e),r=ro(e),{streamingHost:i,streamingHostRequestHeaders:a}=e.getApiHosts(),o=e.getClientKey();if(t&&wo.add(n),z.backgroundSync&&wo.has(n)&&_o.EventSource){if(Co.has(n))return;let e={src:null,host:i,clientKey:o,headers:a,cb:t=>{try{if(t.type===`features-updated`){let e=yo.get(n);e&&e.forEach(e=>{co(e)})}else t.type===`features`&&oo(n,r,JSON.parse(t.data));e.errors=0}catch{uo(e)}},errors:0,state:`active`};Co.set(n,e),po(e)}}function uo(e){if(e.state!==`idle`&&(e.errors++,e.errors>3||e.src&&e.src.readyState===2)){let t=3**(e.errors-3)*(1e3+Math.random()*1e3);fo(e),setTimeout(()=>{[`idle`,`active`].includes(e.state)||po(e)},Math.min(t,3e5))}}function fo(e){e.src&&(e.src.onopen=null,e.src.onerror=null,e.src.close(),e.src=null,e.state===`active`&&(e.state=`disabled`))}function po(e){e.src=vo.eventSourceCall({host:e.host,clientKey:e.clientKey,headers:e.headers}),e.state=`active`,e.src.addEventListener(`features`,e.cb),e.src.addEventListener(`features-updated`,e.cb),e.src.onerror=()=>uo(e),e.src.onopen=()=>{e.errors=0}}function mo(e,t){fo(e),Co.delete(t)}function ho(){wo.clear(),Co.forEach(mo),yo.clear(),vo.stopIdleListener()}function go(e,t){if(t.streaming){if(!e.getClientKey())throw Error(`Must specify clientKey to enable streaming`);t.payload&&lo(e,!0),Xa(e)}}var z,_o,vo,yo,bo,xo,So,Co,wo,To=t((()=>{qa(),z={staleTTL:1e3*60,maxAge:1e3*60*60*4,cacheKey:`gbFeaturesCache`,backgroundSync:!0,maxEntries:10,disableIdleStreams:!1,idleStreamInterval:2e4,disableCache:!1},_o=Sa(),vo={fetchFeaturesCall:({host:e,clientKey:t,headers:n})=>_o.fetch(`${e}/api/features/${t}`,{headers:n}),fetchRemoteEvalCall:({host:e,clientKey:t,payload:n,headers:r})=>{let i={method:`POST`,headers:{"Content-Type":`application/json`,...r},body:JSON.stringify(n)};return _o.fetch(`${e}/api/eval/${t}`,i)},eventSourceCall:({host:e,clientKey:t,headers:n})=>n?new _o.EventSource(`${e}/sub/${t}`,{headers:n}):new _o.EventSource(`${e}/sub/${t}`),startIdleListener:()=>{let e;if(!(typeof window<`u`&&typeof document<`u`))return;let t=()=>{document.visibilityState===`visible`?(window.clearTimeout(e),$a()):document.visibilityState===`hidden`&&(e=window.setTimeout(Qa,z.idleStreamInterval))};return document.addEventListener(`visibilitychange`,t),()=>document.removeEventListener(`visibilitychange`,t)},stopIdleListener:()=>{}};try{globalThis.localStorage&&(_o.localStorage=globalThis.localStorage)}catch{}yo=new Map,bo=!1,xo=new Map,So=new Map,Co=new Map,wo=new Set}));function Eo(e){return e===`html`?{childList:!0,subtree:!0,attributes:!0,characterData:!0}:{childList:!1,subtree:!1,attributes:!0,attributeFilter:[e]}}function Do(e){var t=is.get(e);return t||(t={element:e,attributes:{}},is.set(e,t)),t}function Oo(e,t,n,r,i){var a=n(e),o={isDirty:!1,originalValue:a,virtualValue:a,mutations:[],el:e,_positionTimeout:null,observer:new MutationObserver(function(){if(!(t===`position`&&o._positionTimeout)){t===`position`&&(o._positionTimeout=setTimeout(function(){o._positionTimeout=null},1e3));var r=n(e);t===`position`&&r.parentNode===o.virtualValue.parentNode&&r.insertBeforeNode===o.virtualValue.insertBeforeNode||r!==o.virtualValue&&(o.originalValue=r,i(o))}}),mutationRunner:i,setValue:r,getCurrentValue:n};return t===`position`&&e.parentNode?o.observer.observe(e.parentNode,{childList:!0,subtree:!0,attributes:!1,characterData:!1}):o.observer.observe(e,Eo(t)),o}function ko(e,t){var n=t.getCurrentValue(t.el);t.virtualValue=e,e&&typeof e!=`string`?(!n||e.parentNode!==n.parentNode||e.insertBeforeNode!==n.insertBeforeNode)&&(t.isDirty=!0,Uo()):e!==n&&(t.isDirty=!0,Uo())}function Ao(e){var t=e.originalValue;e.mutations.forEach(function(e){return t=e.mutate(t)}),ko(Bo(t),e)}function jo(e){var t=new Set(e.originalValue.split(/\s+/).filter(Boolean));e.mutations.forEach(function(e){return e.mutate(t)}),ko(Array.from(t).filter(Boolean).join(` `),e)}function Mo(e){var t=e.originalValue;e.mutations.forEach(function(e){return t=e.mutate(t)}),ko(t,e)}function No(e){var t=e.parentSelector,n=e.insertBeforeSelector,r=document.querySelector(t);if(!r)return null;var i=n?document.querySelector(n):null;return n&&!i?null:{parentNode:r,insertBeforeNode:i}}function Po(e){var t=e.originalValue;e.mutations.forEach(function(e){t=No(e.mutate())||t}),ko(t,e)}function Fo(e){var t=Do(e);return t.html||(t.html=Oo(e,`html`,os,ss,Ao)),t.html}function Io(e){var t=Do(e);return t.position||(t.position=Oo(e,`position`,cs,ls,Po)),t.position}function Lo(e){var t=Do(e);return t.classes||(t.classes=Oo(e,`class`,ds,us,jo)),t.classes}function Ro(e,t){var n=Do(e);return n.attributes[t]||(n.attributes[t]=Oo(e,t,fs(t),ps(t),Mo)),n.attributes[t]}function zo(e,t){var n=is.get(e);if(n)if(t===`html`){var r,i;(r=n.html)==null||(i=r.observer)==null||i.disconnect(),delete n.html}else if(t===`class`){var a,o;(a=n.classes)==null||(o=a.observer)==null||o.disconnect(),delete n.classes}else if(t===`position`){var s,c;(s=n.position)==null||(c=s.observer)==null||c.disconnect(),delete n.position}else{var l,u,d;(l=n.attributes)==null||(u=l[t])==null||(d=u.observer)==null||d.disconnect(),delete n.attributes[t]}}function Bo(e){return ms||(ms=document.createElement(`div`)),ms.innerHTML=e,ms.innerHTML}function Vo(e,t,n){if(n.isDirty){n.isDirty=!1;var r=n.virtualValue;n.mutations.length||zo(e,t),n.setValue(e,r)}}function Ho(e,t){e.html&&Vo(t,`html`,e.html),e.classes&&Vo(t,`class`,e.classes),e.position&&Vo(t,`position`,e.position),Object.keys(e.attributes).forEach(function(n){Vo(t,n,e.attributes[n])})}function Uo(){is.forEach(Ho)}function Wo(e,t){var n=null;e.kind===`html`?n=Fo(t):e.kind===`class`?n=Lo(t):e.kind===`attribute`?n=Ro(t,e.attribute):e.kind===`position`&&(n=Io(t)),n&&(n.mutations.push(e),n.mutationRunner(n))}function Go(e,t){var n=null;if(e.kind===`html`?n=Fo(t):e.kind===`class`?n=Lo(t):e.kind===`attribute`?n=Ro(t,e.attribute):e.kind===`position`&&(n=Io(t)),n){var r=n.mutations.indexOf(e);r!==-1&&n.mutations.splice(r,1),n.mutationRunner(n)}}function Ko(e){if(!(e.kind===`position`&&e.elements.size===1)){var t=new Set(e.elements);document.querySelectorAll(e.selector).forEach(function(n){t.has(n)||(e.elements.add(n),Wo(e,n))})}}function qo(e){e.elements.forEach(function(t){return Go(e,t)}),e.elements.clear(),as.delete(e)}function Jo(){as.forEach(Ko)}function Yo(){typeof document>`u`||(hs||(hs=new MutationObserver(function(){Jo()})),Jo(),hs.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!1,characterData:!1}))}function Xo(e){return typeof document>`u`?rs:(as.add(e),Ko(e),{revert:function(){qo(e)}})}function Zo(e,t){return Xo({kind:`html`,elements:new Set,mutate:t,selector:e})}function Qo(e,t){return Xo({kind:`position`,elements:new Set,mutate:t,selector:e})}function $o(e,t){return Xo({kind:`class`,elements:new Set,mutate:t,selector:e})}function es(e,t,n){return ns.test(t)?t===`class`||t===`className`?$o(e,function(e){var t=n(Array.from(e).join(` `));e.clear(),t&&t.split(/\s+/g).filter(Boolean).forEach(function(t){return e.add(t)})}):Xo({kind:`attribute`,attribute:t,elements:new Set,mutate:n,selector:e}):rs}function ts(e){var t=e.selector,n=e.action,r=e.value,i=e.attribute,a=e.parentSelector,o=e.insertBeforeSelector;if(i===`html`){if(n===`append`)return Zo(t,function(e){return e+(r??``)});if(n===`set`)return Zo(t,function(){return r??``})}else if(i===`class`){if(n===`append`)return $o(t,function(e){r&&e.add(r)});if(n===`remove`)return $o(t,function(e){r&&e.delete(r)});if(n===`set`)return $o(t,function(e){e.clear(),r&&e.add(r)})}else if(i===`position`){if(n===`set`&&a)return Qo(t,function(){return{insertBeforeSelector:o,parentSelector:a}})}else if(n===`append`)return es(t,i,function(e){return e===null?r??``:e+(r??``)});else if(n===`set`)return es(t,i,function(){return r??``});else if(n===`remove`)return es(t,i,function(){return null});return rs}var ns,rs,is,as,os,ss,cs,ls,us,ds,fs,ps,ms,hs,gs,_s=t((()=>{ns=/^[a-zA-Z:_][a-zA-Z0-9:_.-]*$/,rs={revert:function(){}},is=new Map,as=new Set,os=function(e){return e.innerHTML},ss=function(e,t){return e.innerHTML=t},cs=function(e){return{parentNode:e.parentElement,insertBeforeNode:e.nextElementSibling}},ls=function(e,t){t.insertBeforeNode&&!t.parentNode.contains(t.insertBeforeNode)||t.parentNode.insertBefore(e,t.insertBeforeNode)},us=function(e,t){return t?e.className=t:e.removeAttribute(`class`)},ds=function(e){return e.className},fs=function(e){return function(t){return t.getAttribute(e)??null}},ps=function(e){return function(t,n){return n===null?t.removeAttribute(e):t.setAttribute(e,n)}},Yo(),gs={html:Zo,classes:$o,attribute:es,position:Qo,declarative:ts}}));function vs(e,t,n){n=n||{};for(let[r,i]of Object.entries(t))switch(r){case`$or`:if(!Os(e,i,n))return!1;break;case`$nor`:if(Os(e,i,n))return!1;break;case`$and`:if(!ks(e,i,n))return!1;break;case`$not`:if(vs(e,i,n))return!1;break;default:if(!xs(i,ys(e,r),n))return!1}return!0}function ys(e,t){let n=t.split(`.`),r=e;for(let e=0;e<n.length;e++)if(r&&typeof r==`object`&&n[e]in r)r=r[n[e]];else return null;return r}function bs(e,t=!1){let n=`${e}${t?`/i`:``}`;return As[n]||(As[n]=new RegExp(e.replace(/([^\\])\//g,`$1\\/`),t?`i`:void 0)),As[n]}function xs(e,t,n,r=!1){if(typeof e==`string`)return r?String(t).toLowerCase()===e.toLowerCase():t+``===e;if(typeof e==`number`)return t*1===e;if(typeof e==`boolean`)return t!==null&&!!t===e;if(e===null)return t===null;if(Array.isArray(e)||!Ss(e))return JSON.stringify(t)===JSON.stringify(e);for(let r in e)if(!Ds(r,t,e[r],n))return!1;return!0}function Ss(e){let t=Object.keys(e);return t.length>0&&t.filter(e=>e[0]===`$`).length===t.length}function Cs(e){if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=typeof e;return[`string`,`number`,`boolean`,`object`,`undefined`].includes(t)?t:`unknown`}function ws(e,t,n){if(!Array.isArray(e))return!1;let r=Ss(t)?e=>xs(t,e,n):e=>vs(e,t,n);for(let t=0;t<e.length;t++)if(e[t]&&r(e[t]))return!0;return!1}function Ts(e,t,n=!1){if(n){let n=e=>typeof e==`string`?e.toLowerCase():e;return Array.isArray(e)?e.some(e=>t.some(t=>n(e)===n(t))):t.some(t=>n(e)===n(t))}return Array.isArray(e)?e.some(e=>t.includes(e)):t.includes(e)}function Es(e,t,n,r=!1){if(!Array.isArray(e))return!1;for(let i=0;i<t.length;i++){let a=!1;for(let o=0;o<e.length;o++)if(xs(t[i],e[o],n,r)){a=!0;break}if(!a)return!1}return!0}function Ds(e,t,n,r){switch(e){case`$veq`:return za(t)===za(n);case`$vne`:return za(t)!==za(n);case`$vgt`:return za(t)>za(n);case`$vgte`:return za(t)>=za(n);case`$vlt`:return za(t)<za(n);case`$vlte`:return za(t)<=za(n);case`$eq`:return t===n;case`$ne`:return t!==n;case`$lt`:return t<n;case`$lte`:return t<=n;case`$gt`:return t>n;case`$gte`:return t>=n;case`$exists`:return n?t!=null:t==null;case`$in`:return Array.isArray(n)?Ts(t,n):!1;case`$ini`:return Array.isArray(n)?Ts(t,n,!0):!1;case`$inGroup`:return Ts(t,r[n]||[]);case`$notInGroup`:return!Ts(t,r[n]||[]);case`$nin`:return Array.isArray(n)?!Ts(t,n):!1;case`$nini`:return Array.isArray(n)?!Ts(t,n,!0):!1;case`$not`:return!xs(n,t,r);case`$size`:return Array.isArray(t)?xs(n,t.length,r):!1;case`$elemMatch`:return ws(t,n,r);case`$all`:return Array.isArray(n)?Es(t,n,r):!1;case`$alli`:return Array.isArray(n)?Es(t,n,r,!0):!1;case`$regex`:try{return bs(n).test(t)}catch{return!1}case`$regexi`:try{return bs(n,!0).test(t)}catch{return!1}case`$type`:return Cs(t)===n;default:return console.error(`Unknown operator: `+e),!1}}function Os(e,t,n){if(!t.length)return!0;for(let r=0;r<t.length;r++)if(vs(e,t[r],n))return!0;return!1}function ks(e,t,n){for(let r=0;r<t.length;r++)if(!vs(e,t[r],n))return!1;return!0}var As,js=t((()=>{qa(),As={}}));function Ms(e){let t=new Map;return e.global.forcedFeatureValues&&e.global.forcedFeatureValues.forEach((e,n)=>t.set(n,e)),e.user.forcedFeatureValues&&e.user.forcedFeatureValues.forEach((e,n)=>t.set(n,e)),t}function Ns(e){return e.global.forcedVariations&&e.user.forcedVariations?{...e.global.forcedVariations,...e.user.forcedVariations}:e.global.forcedVariations?e.global.forcedVariations:e.user.forcedVariations?e.user.forcedVariations:{}}async function Ps(e){try{await e()}catch{}}function Fs(e,t,n){if(e.user.trackedExperiments){let r=ic(t,n);if(e.user.trackedExperiments.has(r))return[];e.user.trackedExperiments.add(r)}e.user.enableDevMode&&e.user.devLogs&&e.user.devLogs.push({experiment:t,result:n,timestamp:Date.now().toString(),logType:`experiment`});let r=[];if(e.global.trackingCallback){let i=e.global.trackingCallback;r.push(Ps(()=>i(t,n,e.user)))}if(e.user.trackingCallback){let i=e.user.trackingCallback;r.push(Ps(()=>i(t,n)))}if(e.global.eventLogger){let i=e.global.eventLogger;r.push(Ps(()=>i(oc,{experimentId:t.key,variationId:n.key,hashAttribute:n.hashAttribute,hashValue:n.hashValue},e.user)))}return r}function Is(e,t,n){if(e.user.trackedFeatureUsage){let r=JSON.stringify(n.value);if(e.user.trackedFeatureUsage[t]===r)return;e.user.trackedFeatureUsage[t]=r,e.user.enableDevMode&&e.user.devLogs&&e.user.devLogs.push({featureKey:t,result:n,timestamp:Date.now().toString(),logType:`feature`})}if(e.global.onFeatureUsage){let r=e.global.onFeatureUsage;Ps(()=>r(t,n,e.user))}if(e.user.onFeatureUsage){let r=e.user.onFeatureUsage;Ps(()=>r(t,n))}if(e.global.eventLogger){let r=e.global.eventLogger;Ps(()=>r(ac,{feature:t,source:n.source,value:n.value,ruleId:n.source===`defaultValue`?`$default`:n.ruleId||``,variationId:n.experimentResult?n.experimentResult.key:``},e.user))}}function Ls(e,t){if(t.stack.evaluatedFeatures.has(e))return zs(t,e,null,`cyclicPrerequisite`);t.stack.evaluatedFeatures.add(e),t.stack.id=e;let n=Ms(t);if(n.has(e))return zs(t,e,n.get(e),`override`);if(!t.global.features||!t.global.features[e])return zs(t,e,null,`unknownFeature`);let r=t.global.features[e];if(r.rules){let n=new Set(t.stack.evaluatedFeatures);rules:for(let i of r.rules){if(i.parentConditions)for(let r of i.parentConditions){t.stack.evaluatedFeatures=new Set(n);let i=Ls(r.id,t);if(i.source===`cyclicPrerequisite`)return zs(t,e,null,`cyclicPrerequisite`);if(!vs({value:i.value},r.condition||{})){if(r.gate)return zs(t,e,null,`prerequisite`);continue rules}}if(i.filters&&Hs(i.filters,t))continue;if(`force`in i){if(i.condition&&!Vs(i.condition,t)||!Us(t,i.seed||e,i.hashAttribute,t.user.saveStickyBucketAssignmentDoc&&!i.disableStickyBucketing?i.fallbackAttribute:void 0,i.range,i.coverage,i.hashVersion))continue;return i.tracks&&i.tracks.forEach(e=>{!Fs(t,e.experiment,e.result).length&&t.global.saveDeferredTrack&&t.global.saveDeferredTrack({experiment:e.experiment,result:e.result})}),zs(t,e,i.force,`force`,i.id)}if(!i.variations)continue;let r={variations:i.variations,key:i.key||e};`coverage`in i&&(r.coverage=i.coverage),i.weights&&(r.weights=i.weights),i.hashAttribute&&(r.hashAttribute=i.hashAttribute),i.fallbackAttribute&&(r.fallbackAttribute=i.fallbackAttribute),i.disableStickyBucketing&&(r.disableStickyBucketing=i.disableStickyBucketing),i.bucketVersion!==void 0&&(r.bucketVersion=i.bucketVersion),i.minBucketVersion!==void 0&&(r.minBucketVersion=i.minBucketVersion),i.namespace&&(r.namespace=i.namespace),i.meta&&(r.meta=i.meta),i.ranges&&(r.ranges=i.ranges),i.name&&(r.name=i.name),i.phase&&(r.phase=i.phase),i.seed&&(r.seed=i.seed),i.hashVersion&&(r.hashVersion=i.hashVersion),i.filters&&(r.filters=i.filters),i.condition&&(r.condition=i.condition);let{result:a}=Rs(r,e,t);if(t.global.onExperimentEval&&t.global.onExperimentEval(r,a),a.inExperiment&&!a.passthrough)return zs(t,e,a.value,`experiment`,i.id,r,a)}}return zs(t,e,r.defaultValue===void 0?null:r.defaultValue,`defaultValue`)}function Rs(e,t,n){let r=e.key,i=e.variations.length;if(i<2||n.global.enabled===!1||n.user.enabled===!1||(e=Ws(e,n),e.urlPatterns&&!Aa(n.user.url||``,e.urlPatterns)))return{result:B(n,e,-1,!1,t)};let a=Fa(r,n.user.url||``,i);if(a!==null)return{result:B(n,e,a,!1,t)};let o=Ns(n);if(r in o){let i=o[r];return{result:B(n,e,i,!1,t)}}if(e.status===`draft`||e.active===!1)return{result:B(n,e,-1,!1,t)};let{hashAttribute:s,hashValue:c}=Gs(n,e.hashAttribute,n.user.saveStickyBucketAssignmentDoc&&!e.disableStickyBucketing?e.fallbackAttribute:void 0);if(!c)return{result:B(n,e,-1,!1,t)};let l=-1,u=!1,d=!1;if(n.user.saveStickyBucketAssignmentDoc&&!e.disableStickyBucketing){let{variation:t,versionIsBlocked:r}=Js({ctx:n,expKey:e.key,expBucketVersion:e.bucketVersion,expHashAttribute:e.hashAttribute,expFallbackAttribute:e.fallbackAttribute,expMinBucketVersion:e.minBucketVersion,expMeta:e.meta});u=t>=0,l=t,d=!!r}if(!u){if(e.filters){if(Hs(e.filters,n))return{result:B(n,e,-1,!1,t)}}else if(e.namespace&&!Da(c,e.namespace))return{result:B(n,e,-1,!1,t)};if(e.include&&!Ia(e.include)||e.condition&&!Vs(e.condition,n))return{result:B(n,e,-1,!1,t)};if(e.parentConditions){let r=new Set(n.stack.evaluatedFeatures);for(let i of e.parentConditions){n.stack.evaluatedFeatures=new Set(r);let a=Ls(i.id,n);if(a.source===`cyclicPrerequisite`||!vs({value:a.value},i.condition||{}))return{result:B(n,e,-1,!1,t)}}}if(e.groups&&!qs(e.groups,n))return{result:B(n,e,-1,!1,t)}}if(e.url&&!Ks(e.url,n))return{result:B(n,e,-1,!1,t)};let f=wa(e.seed||r,c,e.hashVersion||1);if(f===null)return{result:B(n,e,-1,!1,t)};if(u||(l=Oa(f,e.ranges||Pa(i,e.coverage===void 0?1:e.coverage,e.weights))),d)return{result:B(n,e,-1,!1,t,void 0,!0)};if(l<0)return{result:B(n,e,-1,!1,t)};if(`force`in e)return{result:B(n,e,e.force===void 0?-1:e.force,!1,t)};if(n.global.qaMode||n.user.qaMode||e.status===`stopped`)return{result:B(n,e,-1,!1,t)};let p=B(n,e,l,!0,t,f,u);if(n.user.saveStickyBucketAssignmentDoc&&!e.disableStickyBucketing){let{changed:t,key:r,doc:i}=Qs(n,s,Ra(c),{[Ys(e.key,e.bucketVersion)]:p.key});t&&(n.user.stickyBucketAssignmentDocs=n.user.stickyBucketAssignmentDocs||{},n.user.stickyBucketAssignmentDocs[r]=i,n.user.saveStickyBucketAssignmentDoc(i))}let m=Fs(n,e,p);m.length===0&&n.global.saveDeferredTrack&&n.global.saveDeferredTrack({experiment:e,result:p});let ee=m.length?m.length===1?m[0]:Promise.all(m).then(()=>{}):void 0;return`changeId`in e&&e.changeId&&n.global.recordChangeId&&n.global.recordChangeId(e.changeId),{result:p,trackingCall:ee}}function zs(e,t,n,r,i,a,o){let s={value:n,on:!!n,off:!n,source:r,ruleId:i||``};return a&&(s.experiment=a),o&&(s.experimentResult=o),r!==`override`&&Is(e,t,s),s}function Bs(e){return{...e.user.attributes,...e.user.attributeOverrides}}function Vs(e,t){return vs(Bs(t),e,t.global.savedGroups||{})}function Hs(e,t){return e.some(e=>{let{hashValue:n}=Gs(t,e.attribute);if(!n)return!0;let r=wa(e.seed,n,e.hashVersion||2);return r===null?!0:!e.ranges.some(e=>Ea(r,e))})}function Us(e,t,n,r,i,a,o){if(!i&&a===void 0)return!0;if(!i&&a===0)return!1;let{hashValue:s}=Gs(e,n,r);if(!s)return!1;let c=wa(t,s,o||1);return c===null?!1:i?Ea(c,i):a===void 0?!0:c<=a}function B(e,t,n,r,i,a,o){let s=!0;(n<0||n>=t.variations.length)&&(n=0,s=!1);let{hashAttribute:c,hashValue:l}=Gs(e,t.hashAttribute,e.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing?t.fallbackAttribute:void 0),u=t.meta?t.meta[n]:{},d={key:u.key||``+n,featureId:i,inExperiment:s,hashUsed:r,variationId:n,value:t.variations[n],hashAttribute:c,hashValue:l,stickyBucketUsed:!!o};return u.name&&(d.name=u.name),a!==void 0&&(d.bucket=a),u.passthrough&&(d.passthrough=u.passthrough),d}function Ws(e,t){let n=e.key,r=t.global.overrides;return r&&r[n]&&(e=Object.assign({},e,r[n]),typeof e.url==`string`&&(e.url=ka(e.url))),e}function Gs(e,t,n){let r=t||`id`,i=``,a=Bs(e);return a[r]&&(i=a[r]),!i&&n&&(a[n]&&(i=a[n]),i&&(r=n)),{hashAttribute:r,hashValue:i}}function Ks(e,t){let n=t.user.url;if(!n)return!1;let r=n.replace(/^https?:\/\//,``).replace(/^[^/]*\//,`/`);return!!(e.test(n)||e.test(r))}function qs(e,t){let n=t.global.groups||{};for(let t=0;t<e.length;t++)if(n[e[t]])return!0;return!1}function Js({ctx:e,expKey:t,expBucketVersion:n,expHashAttribute:r,expFallbackAttribute:i,expMinBucketVersion:a,expMeta:o}){n=n||0,a=a||0,r=r||`id`,o=o||[];let s=Ys(t,n),c=Zs(e,r,i);if(a>0){for(let e=0;e<a;e++)if(c[Ys(t,e)]!==void 0)return{variation:-1,versionIsBlocked:!0}}let l=c[s];if(l===void 0)return{variation:-1};let u=o.findIndex(e=>e.key===l);return u<0?{variation:-1}:{variation:u}}function Ys(e,t){return t=t||0,`${e}__${t}`}function Xs(e,t){return`${e}||${t}`}function Zs(e,t,n){if(!e.user.stickyBucketAssignmentDocs)return{};let{hashAttribute:r,hashValue:i}=Gs(e,t),a=Xs(r,Ra(i)),{hashAttribute:o,hashValue:s}=Gs(e,n),c=s?Xs(o,Ra(s)):null,l={};return c&&e.user.stickyBucketAssignmentDocs[c]&&Object.assign(l,e.user.stickyBucketAssignmentDocs[c].assignments||{}),e.user.stickyBucketAssignmentDocs[a]&&Object.assign(l,e.user.stickyBucketAssignmentDocs[a].assignments||{}),l}function Qs(e,t,n,r){let i=Xs(t,n),a=e.user.stickyBucketAssignmentDocs&&e.user.stickyBucketAssignmentDocs[i]&&e.user.stickyBucketAssignmentDocs[i].assignments||{},o={...a,...r},s=JSON.stringify(a)!==JSON.stringify(o);return{key:i,doc:{attributeName:t,attributeValue:n,assignments:o},changed:s}}function $s(e,t){let n=new Set,r=t&&t.features?t.features:e.global.features||{},i=t&&t.experiments?t.experiments:e.global.experiments||[];return Object.keys(r).forEach(e=>{let t=r[e];if(t.rules)for(let e of t.rules)e.variations&&(n.add(e.hashAttribute||`id`),e.fallbackAttribute&&n.add(e.fallbackAttribute))}),i.map(e=>{n.add(e.hashAttribute||`id`),e.fallbackAttribute&&n.add(e.fallbackAttribute)}),Array.from(n)}async function ec(e,t,n){let r=tc(e,n);return t.getAllAssignments(r)}function tc(e,t){let n={};return $s(e,t).forEach(t=>{let{hashValue:r}=Gs(e,t);n[t]=Ra(r)}),n}async function nc(e,t,n){if(e={...e},e.encryptedFeatures){try{e.features=JSON.parse(await La(e.encryptedFeatures,t,n))}catch(e){console.error(e)}delete e.encryptedFeatures}if(e.encryptedExperiments){try{e.experiments=JSON.parse(await La(e.encryptedExperiments,t,n))}catch(e){console.error(e)}delete e.encryptedExperiments}if(e.encryptedSavedGroups){try{e.savedGroups=JSON.parse(await La(e.encryptedSavedGroups,t,n))}catch(e){console.error(e)}delete e.encryptedSavedGroups}return e}function rc(e){let t=e.apiHost||`https://cdn.growthbook.io`;return{apiHost:t.replace(/\/*$/,``),streamingHost:(e.streamingHost||t).replace(/\/*$/,``),apiRequestHeaders:e.apiHostRequestHeaders,streamingHostRequestHeaders:e.streamingHostRequestHeaders}}function ic(e,t){return t.hashAttribute+t.hashValue+e.key+t.variationId}var ac,oc,sc=t((()=>{js(),qa(),ac=`Feature Evaluated`,oc=`Experiment Viewed`})),cc,lc,uc,dc=t((()=>{_s(),qa(),To(),sc(),cc=typeof window<`u`&&typeof document<`u`,lc=Ba(),uc=class{constructor(e){if(e=e||{},this.version=lc,this._options=this.context=e,this._renderer=e.renderer||null,this._trackedExperiments=new Set,this._completedChangeIds=new Set,this._trackedFeatures={},this.debug=!!e.debug,this._subscriptions=new Set,this.ready=!1,this._assigned=new Map,this._activeAutoExperiments=new Map,this._triggeredExpKeys=new Set,this._initialized=!1,this._redirectedUrl=``,this._deferredTrackingCalls=new Map,this._autoExperimentsAllowed=!e.disableExperimentsOnLoad,this._destroyCallbacks=[],this.logs=[],this.log=this.log.bind(this),this._saveDeferredTrack=this._saveDeferredTrack.bind(this),this._onExperimentEval=this._onExperimentEval.bind(this),this._fireSubscriptions=this._fireSubscriptions.bind(this),this._recordChangedId=this._recordChangedId.bind(this),e.remoteEval){if(e.decryptionKey)throw Error(`Encryption is not available for remoteEval`);if(!e.clientKey)throw Error(`Missing clientKey`);let t=!1;try{t=!!new URL(e.apiHost||``).hostname.match(/growthbook\.io$/i)}catch{}if(t)throw Error(`Cannot use remoteEval on GrowthBook Cloud`)}else if(e.cacheKeyAttributes)throw Error(`cacheKeyAttributes are only used for remoteEval`);if(e.stickyBucketService){let t=e.stickyBucketService;this._saveStickyBucketAssignmentDoc=e=>t.saveAssignments(e)}if(e.plugins)for(let t of e.plugins)t(this);if(e.features&&(this.ready=!0),cc&&e.enableDevMode&&(window._growthbook=this,document.dispatchEvent(new Event(`gbloaded`))),e.experiments&&(this.ready=!0,this._updateAllAutoExperiments()),this._options.stickyBucketService&&this._options.stickyBucketAssignmentDocs)for(let e in this._options.stickyBucketAssignmentDocs){let t=this._options.stickyBucketAssignmentDocs[e];t&&this._options.stickyBucketService.saveAssignments(t).catch(()=>{})}this.ready&&this.refreshStickyBuckets(this.getPayload())}async setPayload(e){this._payload=e;let t=await nc(e,this._options.decryptionKey);this._decryptedPayload=t,await this.refreshStickyBuckets(t),t.features&&(this._options.features=t.features),t.savedGroups&&(this._options.savedGroups=t.savedGroups),t.experiments&&(this._options.experiments=t.experiments,this._updateAllAutoExperiments()),this.ready=!0,this._render()}initSync(e){this._initialized=!0;let t=e.payload;if(t.encryptedExperiments||t.encryptedFeatures)throw Error(`initSync does not support encrypted payloads`);return this._options.stickyBucketService&&!this._options.stickyBucketAssignmentDocs&&(this._options.stickyBucketAssignmentDocs=this.generateStickyBucketAssignmentDocsSync(this._options.stickyBucketService,t)),this._payload=t,this._decryptedPayload=t,t.features&&(this._options.features=t.features),t.experiments&&(this._options.experiments=t.experiments,this._updateAllAutoExperiments()),this.ready=!0,go(this,e),this}async init(e){if(this._initialized=!0,e=e||{},e.cacheSettings&&Ja(e.cacheSettings),e.payload)return await this.setPayload(e.payload),go(this,e),{success:!0,source:`init`};{let{data:t,...n}=await this._refresh({...e,allowStale:!0});return go(this,e),await this.setPayload(t||{}),n}}async loadFeatures(e){e=e||{},await this.init({skipCache:e.skipCache,timeout:e.timeout,streaming:(this._options.backgroundSync??!0)&&(e.autoRefresh||this._options.subscribeToChanges)})}async refreshFeatures(e){let t=await this._refresh({...e||{},allowStale:!1});t.data&&await this.setPayload(t.data)}getApiInfo(){return[this.getApiHosts().apiHost,this.getClientKey()]}getApiHosts(){return rc(this._options)}getClientKey(){return this._options.clientKey||``}getPayload(){return this._payload||{features:this.getFeatures(),experiments:this.getExperiments()}}getDecryptedPayload(){return this._decryptedPayload||this.getPayload()}isRemoteEval(){return this._options.remoteEval||!1}getCacheKeyAttributes(){return this._options.cacheKeyAttributes}async _refresh({timeout:e,skipCache:t,allowStale:n,streaming:r}){if(!this._options.clientKey)throw Error(`Missing clientKey`);return Ya({instance:this,timeout:e,skipCache:t||this._options.disableCache,allowStale:n,backgroundSync:r??this._options.backgroundSync??!0})}_render(){if(this._renderer)try{this._renderer()}catch(e){console.error(`Failed to render`,e)}}setFeatures(e){this._options.features=e,this.ready=!0,this._render()}async setEncryptedFeatures(e,t,n){let r=await La(e,t||this._options.decryptionKey,n);this.setFeatures(JSON.parse(r))}setExperiments(e){this._options.experiments=e,this.ready=!0,this._updateAllAutoExperiments()}async setEncryptedExperiments(e,t,n){let r=await La(e,t||this._options.decryptionKey,n);this.setExperiments(JSON.parse(r))}async setAttributes(e){if(this._options.attributes=e,this._options.stickyBucketService&&await this.refreshStickyBuckets(),this._options.remoteEval){await this._refreshForRemoteEval();return}this._render(),this._updateAllAutoExperiments()}async updateAttributes(e){return this.setAttributes({...this._options.attributes,...e})}async setAttributeOverrides(e){if(this._options.attributeOverrides=e,this._options.stickyBucketService&&await this.refreshStickyBuckets(),this._options.remoteEval){await this._refreshForRemoteEval();return}this._render(),this._updateAllAutoExperiments()}async setForcedVariations(e){if(this._options.forcedVariations=e||{},this._options.remoteEval){await this._refreshForRemoteEval();return}this._render(),this._updateAllAutoExperiments()}setForcedFeatures(e){this._options.forcedFeatureValues=e,this._render()}async setURL(e){if(e!==this._options.url){if(this._options.url=e,this._redirectedUrl=``,this._options.remoteEval){await this._refreshForRemoteEval(),this._updateAllAutoExperiments(!0);return}this._updateAllAutoExperiments(!0)}}getAttributes(){return{...this._options.attributes,...this._options.attributeOverrides}}getForcedVariations(){return this._options.forcedVariations||{}}getForcedFeatures(){return this._options.forcedFeatureValues||new Map}getStickyBucketAssignmentDocs(){return this._options.stickyBucketAssignmentDocs||{}}getUrl(){return this._options.url||``}getFeatures(){return this._options.features||{}}getExperiments(){return this._options.experiments||[]}getCompletedChangeIds(){return Array.from(this._completedChangeIds)}subscribe(e){return this._subscriptions.add(e),()=>{this._subscriptions.delete(e)}}async _refreshForRemoteEval(){if(!this._options.remoteEval||!this._initialized)return;let e=await this._refresh({allowStale:!1});e.data&&await this.setPayload(e.data)}getAllResults(){return new Map(this._assigned)}onDestroy(e){this._destroyCallbacks.push(e)}isDestroyed(){return!!this._destroyed}destroy(e){e=e||{},this._destroyed=!0,this._destroyCallbacks.forEach(e=>{try{e()}catch(e){console.error(e)}}),this._subscriptions.clear(),this._assigned.clear(),this._trackedExperiments.clear(),this._completedChangeIds.clear(),this._deferredTrackingCalls.clear(),this._trackedFeatures={},this._destroyCallbacks=[],this._payload=void 0,this._saveStickyBucketAssignmentDoc=void 0,Za(this),e.destroyAllStreams&&ho(),this.logs=[],cc&&window._growthbook===this&&delete window._growthbook,this._activeAutoExperiments.forEach(e=>{e.undo()}),this._activeAutoExperiments.clear(),this._triggeredExpKeys.clear()}setRenderer(e){this._renderer=e}forceVariation(e,t){if(this._options.forcedVariations=this._options.forcedVariations||{},this._options.forcedVariations[e]=t,this._options.remoteEval){this._refreshForRemoteEval();return}this._updateAllAutoExperiments(),this._render()}run(e){let{result:t}=Rs(e,null,this._getEvalContext());return this._onExperimentEval(e,t),t}triggerExperiment(e){return this._triggeredExpKeys.add(e),this._options.experiments?this._options.experiments.filter(t=>t.key===e).map(e=>this._runAutoExperiment(e)).filter(e=>e!==null):null}triggerAutoExperiments(){this._autoExperimentsAllowed=!0,this._updateAllAutoExperiments(!0)}_getEvalContext(){return{user:this._getUserContext(),global:this._getGlobalContext(),stack:{evaluatedFeatures:new Set}}}_getUserContext(){return{attributes:this._options.user?{...this._options.user,...this._options.attributes}:this._options.attributes,enableDevMode:this._options.enableDevMode,blockedChangeIds:this._options.blockedChangeIds,stickyBucketAssignmentDocs:this._options.stickyBucketAssignmentDocs,url:this._getContextUrl(),forcedVariations:this._options.forcedVariations,forcedFeatureValues:this._options.forcedFeatureValues,attributeOverrides:this._options.attributeOverrides,saveStickyBucketAssignmentDoc:this._saveStickyBucketAssignmentDoc,trackingCallback:this._options.trackingCallback,onFeatureUsage:this._options.onFeatureUsage,devLogs:this.logs,trackedExperiments:this._trackedExperiments,trackedFeatureUsage:this._trackedFeatures}}_getGlobalContext(){return{features:this._options.features,experiments:this._options.experiments,log:this.log,enabled:this._options.enabled,qaMode:this._options.qaMode,savedGroups:this._options.savedGroups,groups:this._options.groups,overrides:this._options.overrides,onExperimentEval:this._onExperimentEval,recordChangeId:this._recordChangedId,saveDeferredTrack:this._saveDeferredTrack,eventLogger:this._options.eventLogger}}_runAutoExperiment(e,t){let n=this._activeAutoExperiments.get(e);if(e.manual&&!this._triggeredExpKeys.has(e.key)&&!n)return null;let r=this._isAutoExperimentBlockedByContext(e),i,a;r?i=B(this._getEvalContext(),e,-1,!1,``):({result:i,trackingCall:a}=Rs(e,null,this._getEvalContext()),this._onExperimentEval(e,i));let o=JSON.stringify(i.value);if(!t&&i.inExperiment&&n&&n.valueHash===o)return i;if(n&&this._undoActiveAutoExperiment(e),i.inExperiment){let t=Ua(e);if(t===`redirect`&&i.value.urlRedirect&&e.urlPatterns){let t=e.persistQueryString?Va(this._getContextUrl(),i.value.urlRedirect):i.value.urlRedirect;if(Aa(t,e.urlPatterns))return this.log(`Skipping redirect because original URL matches redirect URL`,{id:e.key}),i;this._redirectedUrl=t;let{navigate:n,delay:r}=this._getNavigateFunction();if(n)if(cc)Promise.all([...a?[Wa(a,this._options.maxNavigateDelay??1e3)]:[],new Promise(e=>window.setTimeout(e,this._options.navigateDelay??r))]).then(()=>{try{n(t)}catch(e){console.error(e)}});else try{n(t)}catch(e){console.error(e)}}else if(t===`visual`){let t=this._options.applyDomChangesCallback?this._options.applyDomChangesCallback(i.value):this._applyDOMChanges(i.value);t&&this._activeAutoExperiments.set(e,{undo:t,valueHash:o})}}return i}_undoActiveAutoExperiment(e){let t=this._activeAutoExperiments.get(e);t&&(t.undo(),this._activeAutoExperiments.delete(e))}_updateAllAutoExperiments(e){if(!this._autoExperimentsAllowed)return;let t=this._options.experiments||[],n=new Set(t);this._activeAutoExperiments.forEach((e,t)=>{n.has(t)||(e.undo(),this._activeAutoExperiments.delete(t))});for(let n of t){let t=this._runAutoExperiment(n,e);if(t&&t.inExperiment&&Ua(n)===`redirect`)break}}_onExperimentEval(e,t){let n=this._assigned.get(e.key);this._assigned.set(e.key,{experiment:e,result:t}),this._subscriptions.size>0&&this._fireSubscriptions(e,t,n)}_fireSubscriptions(e,t,n){(!n||n.result.inExperiment!==t.inExperiment||n.result.variationId!==t.variationId)&&this._subscriptions.forEach(n=>{try{n(e,t)}catch(e){console.error(e)}})}_recordChangedId(e){this._completedChangeIds.add(e)}isOn(e){return this.evalFeature(e).on}isOff(e){return this.evalFeature(e).off}getFeatureValue(e,t){let n=this.evalFeature(e).value;return n===null?t:n}feature(e){return this.evalFeature(e)}evalFeature(e){return Ls(e,this._getEvalContext())}log(e,t){this.debug&&(this._options.log?this._options.log(e,t):console.log(e,t))}getDeferredTrackingCalls(){return Array.from(this._deferredTrackingCalls.values())}setDeferredTrackingCalls(e){this._deferredTrackingCalls=new Map(e.filter(e=>e&&e.experiment&&e.result).map(e=>[ic(e.experiment,e.result),e]))}async fireDeferredTrackingCalls(){if(!this._options.trackingCallback)return;let e=[];this._deferredTrackingCalls.forEach(t=>{!t||!t.experiment||!t.result?console.error(`Invalid deferred tracking call`,{call:t}):e.push(this._options.trackingCallback(t.experiment,t.result))}),this._deferredTrackingCalls.clear(),await Promise.all(e)}setTrackingCallback(e){this._options.trackingCallback=e,this.fireDeferredTrackingCalls()}setFeatureUsageCallback(e){this._options.onFeatureUsage=e}setEventLogger(e){this._options.eventLogger=e}async logEvent(e,t){if(this._destroyed){console.error(`Cannot log event to destroyed GrowthBook instance`);return}if(this._options.enableDevMode&&this.logs.push({eventName:e,properties:t,timestamp:Date.now().toString(),logType:`event`}),this._options.eventLogger)try{await this._options.eventLogger(e,t||{},this._getUserContext())}catch(e){console.error(e)}else console.error(`No event logger configured`)}_saveDeferredTrack(e){this._deferredTrackingCalls.set(ic(e.experiment,e.result),e)}_getContextUrl(){return this._options.url||(cc?window.location.href:``)}_isAutoExperimentBlockedByContext(e){let t=Ua(e);if(t===`visual`){if(this._options.disableVisualExperiments||this._options.disableJsInjection&&e.variations.some(e=>e.js))return!0}else if(t===`redirect`){if(this._options.disableUrlRedirectExperiments)return!0;try{let t=new URL(this._getContextUrl());for(let n of e.variations){if(!n||!n.urlRedirect)continue;let e=new URL(n.urlRedirect);if(this._options.disableCrossOriginUrlRedirectExperiments&&(e.protocol!==t.protocol||e.host!==t.host))return!0}}catch(t){return this.log(`Error parsing current or redirect URL`,{id:e.key,error:t}),!0}}else return!0;return!!(e.changeId&&(this._options.blockedChangeIds||[]).includes(e.changeId))}getRedirectUrl(){return this._redirectedUrl}_getNavigateFunction(){return this._options.navigate?{navigate:this._options.navigate,delay:0}:cc?{navigate:e=>{window.location.replace(e)},delay:100}:{navigate:null,delay:0}}_applyDOMChanges(e){if(!cc)return;let t=[];if(e.css){let n=document.createElement(`style`);n.innerHTML=e.css,document.head.appendChild(n),t.push(()=>n.remove())}if(e.js){let n=document.createElement(`script`);n.innerHTML=e.js,this._options.jsInjectionNonce&&(n.nonce=this._options.jsInjectionNonce),document.head.appendChild(n),t.push(()=>n.remove())}return e.domMutations&&e.domMutations.forEach(e=>{t.push(gs.declarative(e).revert)}),()=>{t.forEach(e=>e())}}async refreshStickyBuckets(e){if(this._options.stickyBucketService){let t=await ec(this._getEvalContext(),this._options.stickyBucketService,e);this._options.stickyBucketAssignmentDocs=t}}generateStickyBucketAssignmentDocsSync(e,t){if(!(`getAllAssignmentsSync`in e)){console.error(`generating StickyBucketAssignmentDocs docs requires StickyBucketServiceSync`);return}let n=tc(this._getEvalContext(),t);return e.getAllAssignmentsSync(n)}inDevMode(){return!!this._options.enableDevMode}}})),fc=t((()=>{To(),dc(),qa(),sc(),js()}));function pc(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var mc=t((()=>{}));function hc(e){var t=0,n=0;return function(){var r=vc(),i=_c-(r-n);if(n=r,i>0){if(++t>=gc)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var gc,_c,vc,yc=t((()=>{gc=800,_c=16,vc=Date.now}));function bc(e){return function(){return e}}var xc=t((()=>{})),Sc,Cc=t((()=>{xc(),On(),Rt(),Sc=In?function(e,t){return In(e,`toString`,{configurable:!0,enumerable:!1,value:bc(t),writable:!0})}:Bt})),wc,Tc=t((()=>{Cc(),yc(),wc=hc(Sc)}));function Ec(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}var Dc=t((()=>{}));function Oc(e){return e!==e}var kc=t((()=>{}));function Ac(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}var jc=t((()=>{}));function Mc(e,t,n){return t===t?Ac(e,t,n):Ec(e,Oc,n)}var Nc=t((()=>{Dc(),kc(),jc()}));function Pc(e,t){return!!(e!=null&&e.length)&&Mc(e,t,0)>-1}var Fc=t((()=>{Nc()}));function Ic(e,t,n){return t=Lc(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,a=Lc(r.length-t,0),o=Array(a);++i<a;)o[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=n(o),pc(e,this,s)}}var Lc,Rc=t((()=>{mc(),Lc=Math.max}));function zc(e,t){return wc(Ic(e,t,Bt),e+``)}var Bc=t((()=>{Rt(),Rc(),Tc()}));function Vc(e,t,n){if(!o(n))return!1;var r=typeof t;return(r==`number`?Sn(n)&&Tt(t,n.length):r==`string`&&t in n)?f(n[t],e):!1}var Hc=t((()=>{ee(),Ht(),sn(),l()}));function Uc(e){return zc(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(a=e.length>3&&typeof a==`function`?(i--,a):void 0,o&&Vc(n[0],n[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,a)}return t})}var Wc=t((()=>{Bc(),Hc()}));function Gc(e){return St(e)||vt(e)||!!(Kc&&e&&e[Kc])}var Kc,qc=t((()=>{s(),dt(),pt(),Kc=i?i.isConcatSpreadable:void 0}));function Jc(e,t,n,r,i){var a=-1,o=e.length;for(n||(n=Gc),i||(i=[]);++a<o;){var s=e[a];t>0&&n(s)?t>1?Jc(s,t-1,n,r,i):fn(i,s):r||(i[i.length]=s)}return i}var Yc=t((()=>{yt(),qc()}));function Xc(e){return e!=null&&e.length?Jc(e,1):[]}var Zc=t((()=>{Yc()}));function Qc(e){return wc(Ic(e,void 0,Xc),e+``)}var $c=t((()=>{Zc(),Rc(),Tc()}));function el(e){if(!$e(e)||c(e)!=tl)return!1;var t=Yn(e);if(t===null)return!0;var n=al.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&il.call(n)==ol}var tl,nl,rl,il,al,ol,sl=t((()=>{a(),rr(),et(),tl=`[object Object]`,nl=Function.prototype,rl=Object.prototype,il=nl.toString,al=rl.hasOwnProperty,ol=il.call(Object)}));function cl(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r<i;)a[r]=e[r+t];return a}var ll=t((()=>{}));function ul(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:cl(e,t,n)}var dl=t((()=>{ll()}));function fl(e){return pl.test(e)}var pl,ml=t((()=>{pl=RegExp(`[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]`)}));function hl(e){return e.split(``)}var gl=t((()=>{}));function _l(e){return e.match(Pl)||[]}var vl,yl,bl,xl,Sl,Cl,wl,Tl,El,Dl,Ol,kl,Al,jl,Ml,Nl,Pl,Fl=t((()=>{vl=`\\ud800-\\udfff`,yl=`\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff`,bl=`\\ufe0e\\ufe0f`,xl=`[`+vl+`]`,Sl=`[`+yl+`]`,Cl=`\\ud83c[\\udffb-\\udfff]`,wl=`(?:`+Sl+`|`+Cl+`)`,Tl=`[^`+vl+`]`,El=`(?:\\ud83c[\\udde6-\\uddff]){2}`,Dl=`[\\ud800-\\udbff][\\udc00-\\udfff]`,Ol=`\\u200d`,kl=wl+`?`,Al=`[`+bl+`]?`,jl=`(?:`+Ol+`(?:`+[Tl,El,Dl].join(`|`)+`)`+Al+kl+`)*`,Ml=Al+kl+jl,Nl=`(?:`+[Tl+Sl+`?`,Sl,El,Dl,xl].join(`|`)+`)`,Pl=RegExp(Cl+`(?=`+Cl+`)|`+Nl+Ml,`g`)}));function Il(e){return fl(e)?_l(e):hl(e)}var Ll=t((()=>{gl(),ml(),Fl()}));function Rl(e){return function(t){t=on(t);var n=fl(t)?Il(t):void 0,r=n?n[0]:t.charAt(0),i=n?ul(n,1).join(``):t.slice(1);return r[e]()+i}}var zl=t((()=>{dl(),ml(),Ll(),hn()})),Bl,Vl=t((()=>{zl(),Bl=Rl(`toUpperCase`)}));function Hl(e){return Bl(on(e).toLowerCase())}var Ul=t((()=>{hn(),Vl()}));function Wl(e,t,n,r){for(var i=-1,a=e==null?0:e.length;++i<a;){var o=e[i];t(r,o,n(o),e)}return r}var Gl=t((()=>{}));function Kl(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(n(a[c],c,a)===!1)break}return t}}var ql=t((()=>{})),Jl,Yl=t((()=>{ql(),Jl=Kl()}));function Xl(e,t){return e&&Jl(e,t,tn)}var Zl=t((()=>{Yl(),nn()}));function Ql(e,t){return function(n,r){if(n==null)return n;if(!Sn(n))return e(n,r);for(var i=n.length,a=t?i:-1,o=Object(n);(t?a--:++a<i)&&r(o[a],a,o)!==!1;);return n}}var $l=t((()=>{Ht()})),eu,tu=t((()=>{Zl(),$l(),eu=Ql(Xl)}));function nu(e,t,n,r){return eu(e,function(e,i,a){t(r,e,n(e),a)}),r}var ru=t((()=>{tu()}));function iu(e,t){return function(n,r){var i=St(n)?Wl:nu,a=t?t():{};return i(n,e,pn(r,2),a)}}var au=t((()=>{Gl(),ru(),bt(),pt()}));function ou(e,t,n){(n!==void 0&&!f(e[t],n)||n===void 0&&!(t in e))&&Wn(e,t,n)}var su=t((()=>{dr(),ee()}));function cu(e){return $e(e)&&Sn(e)}var lu=t((()=>{Ht(),et()}));function uu(e,t){if(!(t===`constructor`&&typeof e[t]==`function`)&&t!=`__proto__`)return e[t]}var du=t((()=>{}));function fu(e){return Xn(e,Zn(e))}var pu=t((()=>{Hn(),er()}));function mu(e,t,n,r,i,a,s){var c=uu(e,n),l=uu(t,n),d=s.get(l);if(d){ou(e,n,d);return}var f=a?a(c,l,n+``,e,t,s):void 0,p=f===void 0;if(p){var m=St(l),ee=!m&&Dt(l),te=!m&&!ee&&ct(l);f=l,m||ee||te?St(c)?f=c:cu(c)?f=lr(c):ee?(p=!1,f=sr(l,!0)):te?(p=!1,f=nr(l,!0)):f=[]:el(l)||vt(l)?(f=c,vt(c)?f=fu(c):(!o(c)||u(c))&&(f=Qn(l))):p=!1}p&&(s.set(l,f),i(f,l,r,a,s),s.delete(l)),ou(e,n,f)}var hu=t((()=>{su(),qn(),ar(),Rn(),Un(),dt(),pt(),lu(),Et(),d(),l(),sl(),jt(),du(),pu()}));function gu(e,t,n,r,i){e!==t&&Jl(t,function(a,s){if(i||(i=new mn),o(a))mu(e,t,s,n,gu,r,i);else{var c=r?r(uu(e,s),a,s+``,e,t,i):void 0;c===void 0&&(c=a),ou(e,s,c)}},Zn)}var _u=t((()=>{an(),su(),Yl(),hu(),l(),er(),du()})),vu,yu=t((()=>{_u(),Wc(),vu=Uc(function(e,t,n,r){gu(e,t,n,r)})}));function bu(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}var xu=t((()=>{}));function Su(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var Cu=t((()=>{}));function wu(e,t){var n=[];return eu(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}var Tu=t((()=>{tu()}));function Eu(e,t){return Ut(t,function(t){return e[t]})}var Du=t((()=>{un()}));function Ou(e){return e==null?[]:Eu(e,tn(e))}var ku=t((()=>{Du(),nn()}));function Au(e,t){return t.length<2?e:Vt(e,cl(t,0,-1))}var ju=t((()=>{kt(),ll()}));function Mu(e,t){return _n(e,t)}var Nu=t((()=>{qt()}));function Pu(e,t){var n={};return t=pn(t,3),Xl(e,function(e,r,i){Wn(n,r,t(e,r,i))}),n}var Fu=t((()=>{dr(),Zl(),bt()}));function Iu(e){if(typeof e!=`function`)throw TypeError(Lu);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}var Lu,Ru=t((()=>{Lu=`Expected a function`}));function zu(e,t){t=bn(t,e);var n=-1,r=t.length;if(!r)return!0;for(;++n<r;){var i=Zt(t[n]);if(i===`__proto__`&&!Bu.call(e,`__proto__`)||(i===`constructor`||i===`prototype`)&&n<r-1)return!1}var a=Au(e,t);return a==null||delete a[Zt(Su(t))]}var Bu,Vu=t((()=>{ln(),Cu(),ju(),nt(),Bu=Object.prototype.hasOwnProperty}));function Hu(e){return el(e)?void 0:e}var Uu=t((()=>{sl()})),Wu,Gu,Ku,qu,Ju=t((()=>{un(),ir(),Vu(),ln(),Hn(),Uu(),$c(),$n(),Wu=1,Gu=2,Ku=4,qu=Qc(function(e,t){var n={};if(e==null)return n;var r=!1;t=Ut(t,function(t){return t=bn(t,e),r||(r=t.length>1),t}),Xn(e,Gn(e),n),r&&(n=tr(n,Wu|Gu|Ku,Hu));for(var i=t.length;i--;)zu(n,t[i]);return n})}));function Yu(e,t,n,r){if(!o(e))return e;t=bn(t,e);for(var i=-1,a=t.length,s=a-1,c=e;c!=null&&++i<a;){var l=Zt(t[i]),u=n;if(l===`__proto__`||l===`constructor`||l===`prototype`)return e;if(i!=s){var d=c[l];u=r?r(d,l,c):void 0,u===void 0&&(u=o(d)?d:Tt(t[i+1])?[]:{})}cr(c,l,u),c=c[l]}return e}var Xu=t((()=>{fr(),ln(),sn(),l(),nt()}));function Zu(e,t,n){for(var r=-1,i=t.length,a={};++r<i;){var o=t[r],s=Vt(e,o);n(s,o)&&Yu(a,bn(o,e),s)}return a}var Qu=t((()=>{kt(),Xu(),ln()}));function $u(e,t){if(e==null)return{};var n=Ut(Gn(e),function(e){return[e]});return t=pn(t),Zu(e,n,function(e,n){return t(e,n[0])})}var ed=t((()=>{un(),bt(),Qu(),$n()})),td,nd=t((()=>{au(),td=iu(function(e,t,n){e[+!n].push(t)},function(){return[[],[]]})}));function rd(e,t){return e+id(ad()*(t-e+1))}var id,ad,od=t((()=>{id=Math.floor,ad=Math.random}));function sd(e,t){return(St(e)?Pt:wu)(e,Iu(pn(t,3)))}var cd=t((()=>{ht(),Tu(),bt(),pt(),Ru()}));function ld(e){var t=e.length;return t?e[rd(0,t-1)]:void 0}var ud=t((()=>{od()}));function dd(e){return ld(Ou(e))}var fd=t((()=>{ud(),ku()}));function pd(e){return(St(e)?ld:dd)(e)}var md=t((()=>{ud(),fd(),pt()}));function hd(e,t,n,r){return r=typeof r==`function`?r:void 0,e==null?e:Yu(e,t,n,r)}var gd=t((()=>{Xu()})),_d,vd=t((()=>{en(),Qe(),zt(),_d=Yt&&1/Lt(new Yt([,-0]))[1]==1/0?function(e){return new Yt(e)}:Ye}));function yd(e,t,n){var r=-1,i=Pc,a=e.length,o=!0,s=[],c=s;if(n)o=!1,i=bu;else if(a>=bd){var l=t?null:_d(e);if(l)return Lt(l);o=!1,i=tt,c=new yn}else c=t?[]:s;outer:for(;++r<a;){var u=e[r],d=t?t(u):u;if(u=n||u!==0?u:0,o&&d===d){for(var f=c.length;f--;)if(c[f]===d)continue outer;t&&c.push(d),s.push(u)}else i(c,d,n)||(c!==s&&c.push(d),s.push(u))}return s}var bd,xd=t((()=>{cn(),Fc(),xu(),Xt(),vd(),zt(),bd=200}));function Sd(e,t){return e&&e.length?yd(e,pn(t,2)):[]}var Cd=t((()=>{bt(),xd()}));function wd(e,t,n){for(var r=-1,i=e.length,a=t.length,o={};++r<i;){var s=r<a?t[r]:void 0;n(o,e[r],s)}return o}var Td=t((()=>{}));function Ed(e,t){return wd(e||[],t||[],cr)}var Dd=t((()=>{fr(),Td()})),Od=t((()=>{mc(),yc(),Tc(),Fc(),Wc(),$c(),Bc(),sl(),Ul(),ll(),Hc(),or(),Yc(),xc(),au(),_u(),yu(),xu(),lu(),Cu(),tu(),ql(),$l(),Tu(),Dc(),Zl(),Zc(),Yl(),Nc(),ku(),ju(),Nu(),kc(),zl(),Fu(),Ru(),Ll(),Ju(),ed(),dl(),ml(),nd(),Qu(),Vu(),od(),cd(),md(),Xu(),gd(),Vl(),Du(),pu(),xd(),Cd(),Dd(),Td()}));function kd(){return process.env.CLAUDE_GB_ADAPTER_KEY||(process.env.USER_TYPE===`ant`?g(process.env.ENABLE_GROWTHBOOK_DEV)?`sdk-yZQvlplybuXjYh6L`:`sdk-xRVcrliHIlrg4og4`:`sdk-zAZezfDKGoZuXXKe`)}var Ad=t((()=>{h()}));function jd(e){let{buffer:t,bytesRead:n}=A().readSync(e,{length:4096});return n===0?`utf8`:n>=2&&t[0]===255&&t[1]===254?`utf16le`:(n>=3&&t[0]===239&&t[1]===187&&t[2],`utf8`)}function Md(e){let t=0,n=0;for(let r=0;r<e.length;r++)e[r]===`
2
+ `&&(r>0&&e[r-1]===`\r`?t++:n++);return t>n?`CRLF`:`LF`}function Nd(e){let t=A(),{resolvedPath:n,isSymlink:r}=ur(t,e);r&&M(`Reading through symlink: ${e} -> ${n}`);let i=jd(n),a=t.readFileSync(n,{encoding:i}),o=Md(a.slice(0,4096));return{content:a.replaceAll(`\r
3
+ `,`
4
+ `),encoding:i,lineEndings:o}}function Pd(e){return Nd(e).content}var Fd=t((()=>{j(),Vn()})),Id,Ld,Rd=t((()=>{uf(),Vn(),ce(),Id=class{constructor(){_(this,`cache`,new Map),_(this,`maxCacheSize`,1e3)}readFile(e){let t=A(),n;try{n=t.statSync(e)}catch(t){throw this.cache.delete(e),t}let r=e,i=this.cache.get(r);if(i&&i.mtime===n.mtimeMs)return{content:i.content,encoding:i.encoding};let a=Wd(e),o=t.readFileSync(e,{encoding:a}).replaceAll(`\r
5
+ `,`
6
+ `);if(this.cache.set(r,{content:o,encoding:a,mtime:n.mtimeMs}),this.cache.size>this.maxCacheSize){let e=this.cache.keys().next().value;e&&this.cache.delete(e)}return{content:o,encoding:a}}clear(){this.cache.clear()}invalidate(e){this.cache.delete(e)}getStats(){return{size:this.cache.size,entries:Array.from(this.cache.keys())}}},Ld=new Id}));async function zd(e){try{return await ga(e),!0}catch{return!1}}function Bd(e){try{return A().readFileSync(e,{encoding:`utf8`})}catch(e){return I(e),null}}function Vd(e){let t=A();return Math.floor(t.statSync(e).mtimeMs)}async function Hd(e){let t=await A().stat(e);return Math.floor(t.mtimeMs)}function Ud(e,t,n,r){let i=t;r===`CRLF`&&(i=t.replaceAll(`\r
7
+ `,`
8
+ `).split(`
9
+ `).join(`\r
10
+ `)),nf(e,i,{encoding:n})}function Wd(e){try{let{resolvedPath:t}=ur(A(),e);return jd(t)}catch(e){return Nn(e)?M(`detectFileEncoding failed for expected reason: ${e.code}`,{level:`debug`}):I(e),`utf8`}}function Gd(e,t=`utf8`){try{let n=A(),{resolvedPath:r}=ur(n,e),{buffer:i,bytesRead:a}=n.readSync(r,{length:4096});return Md(i.toString(t,0,a))}catch(e){return I(e),`LF`}}function Kd(e){return e.includes(` `)?e.replace(/^\t+/gm,e=>` `.repeat(e.length)):e}function qd(e){let t=e?ei(e):void 0;return{absolutePath:t,relativePath:t?Qi(_r(),t):void 0}}function Jd(e){let{relativePath:t}=qd(e);if(t&&!t.startsWith(`..`))return t;let n=Wi();return e.startsWith(n+ea)?`~`+e.slice(n.length):e}function Yd(e){let t=A();try{let n=Ji(e),r=qi(e,Yi(e)),i=t.readdirSync(n).filter(t=>qi(t.name,Yi(t.name))===r&&R(n,t.name)!==e)[0];return i?i.name:void 0}catch(e){jn(e)||I(e);return}}async function Xd(e){let t=_r(),n=Ji(t),r=e;try{r=R(await ha(Ji(e)),qi(e))}catch{}let i=n===ea?ea:n+ea;if(!r.startsWith(i)||r.startsWith(t+ea)||r===t)return;let a=R(t,Qi(n,r));try{return await ga(a),a}catch{return}}function Zd(){return!bO(`tengu_compact_line_prefix_killswitch`,!1)}function Qd({content:e,startLine:t}){if(!e)return``;let n=e.split(/\r?\n/);return Zd()?n.map((e,n)=>`${n+t}\t${e}`).join(`
11
+ `):n.map((e,n)=>{let r=String(n+t);return r.length>=6?`${r}→${e}`:`${r.padStart(6,` `)}→${e}`}).join(`
12
+ `)}function $d(e){return e.match(/^\s*\d+[\u2192\t](.*)$/)?.[1]??e}function ef(e){try{return A().isDirEmptySync(e)}catch(e){return jn(e)}}function tf(e){let{content:t}=Ld.readFile(e);return t}function nf(e,t,n={encoding:`utf-8`}){let r=A(),i=e;try{let t=r.readlinkSync(e);i=Xi(t)?t:$i(Ji(e),t),M(`Writing through symlink: ${e} -> ${i}`)}catch{}let a=`${i}.tmp.${process.pid}.${Date.now()}`,o,s=!1;try{o=r.statSync(i).mode,s=!0,M(`Preserving file permissions: ${o.toString(8)}`)}catch(e){if(!jn(e))throw e;n.mode!==void 0&&(o=n.mode,M(`Setting permissions for new file: ${o.toString(8)}`))}try{M(`Writing to temp file: ${a}`);let e={encoding:n.encoding,flush:!0};!s&&n.mode!==void 0&&(e.mode=n.mode),sa(a,t,e),M(`Temp file written successfully, size: ${t.length} bytes`),s&&o!==void 0&&(ta(a,o),M(`Applied original permissions to temp file`)),M(`Renaming ${a} to ${i}`),r.renameSync(a,i),M(`File ${i} written atomically`)}catch(e){M(`Failed to write file atomically: ${e}`,{level:`error`}),N(`tengu_atomic_write_error`,{});try{M(`Cleaning up temp file: ${a}`),r.unlinkSync(a)}catch(e){M(`Failed to clean up temp file: ${e}`)}M(`Falling back to non-atomic write for ${i}`);try{let e={encoding:n.encoding,flush:!0};!s&&n.mode!==void 0&&(e.mode=n.mode),sa(i,t,e),M(`File ${i} written successfully with non-atomic fallback`)}catch(e){throw M(`Non-atomic write also failed: ${e}`),e}}}function rf(){let e=Gr(),t=Wi();if(e===`macos`)return R(t,`Desktop`);if(e===`windows`){let e=process.env.USERPROFILE?process.env.USERPROFILE.replace(/\\/g,`/`):null;if(e){let t=`/mnt/c${e.replace(/^[A-Z]:/,``)}/Desktop`;if(A().existsSync(t))return t}try{let e=`/mnt/c/Users`,t=A().readdirSync(e);for(let n of t){if(n.name===`Public`||n.name===`Default`||n.name===`Default User`||n.name===`All Users`)continue;let t=R(e,n.name,`Desktop`);if(A().existsSync(t))return t}}catch(e){I(e)}}let n=R(t,`Desktop`);return A().existsSync(n)?n:t}function af(e,t=cf){try{return A().statSync(e).size<=t}catch{return!1}}function of(e){let t=Zi(e);return t=t.replace(/\\/g,`/`),Gr()===`windows`&&(t=t.toLowerCase()),t}function sf(e,t){return of(e)===of(t)}var cf,lf,uf=t((()=>{hr(),XO(),gr(),j(),zn(),Fd(),Rd(),Vn(),Vr(),$r(),qr(),cf=.25*1024*1024,lf=`Note: your current working directory is`})),df,ff,pf=t((()=>{m(),qr(),df=p(function(){if(process.env.USER_TYPE===`ant`&&process.env.CLAUDE_CODE_MANAGED_SETTINGS_PATH)return process.env.CLAUDE_CODE_MANAGED_SETTINGS_PATH;switch(Gr()){case`macos`:return`/Library/Application Support/ClaudeCode`;case`windows`:return`C:\\Program Files\\ClaudeCode`;default:return`/etc/claude-code`}}),ff=p(function(){return R(df(),`managed-settings.d`)})})),mf,hf,gf,_f=t((()=>{mf=[`auto`,`iterm2`,`iterm2_with_bell`,`terminal_bell`,`kitty`,`ghostty`,`notifications_disabled`],hf=[`normal`,`vim`],gf=[`auto`,`tmux`,`in-process`]}));function vf(){return{numStartups:0,installMethod:void 0,autoUpdates:void 0,theme:`dark`,preferredNotifChannel:`auto`,verbose:!1,editorMode:`normal`,autoCompactEnabled:!0,showTurnDuration:!0,hasSeenTasksHint:!1,hasUsedStash:!1,hasUsedBackgroundTask:!1,queuedCommandUpHintCount:0,diffTool:`auto`,customApiKeyResponses:{approved:[],rejected:[]},env:{},tipsHistory:{},memoryUsageCount:0,promptQueueUseCount:0,btwUseCount:0,todoFeatureEnabled:!0,showExpandedTodos:!1,messageIdleNotifThresholdMs:6e4,autoConnectIde:!1,autoInstallIdeExtension:!0,fileCheckpointingEnabled:!0,terminalProgressBarEnabled:!0,cachedStatsigGates:{},cachedDynamicConfigs:{},cachedGrowthBookFeatures:{},respectGitignore:!0,copyFullResponse:!1}}function yf(){return Xf||(Xf=bf())}function bf(){if(lt())return!0;let e=H(),t=ap();if(e.projects?.[t]?.hasTrustDialogAccepted)return!0;let n=Qr(_r());for(;;){if(e.projects?.[n]?.hasTrustDialogAccepted)return!0;let t=Qr($i(n,`..`));if(t===n)break;n=t}return!1}function xf(e){let t=Zf.config;if(!t)return!1;let n=t.oauthAccount!==void 0&&e.oauthAccount===void 0,r=t.hasCompletedOnboarding===!0&&e.hasCompletedOnboarding!==!0;return n||r}function V(e){let t=null;try{jf(F(),vf,n=>{let r=e(n);return r===n?n:(t={...r,projects:Tf(n.projects)},t)})&&t&&Df(t)}catch(n){M(`Failed to save config with lock: ${n}`,{level:`error`});let r=Ff(F(),vf);if(xf(r)){M(`saveGlobalConfig fallback: re-read config is missing auth that cache has; refusing to write. See GH #3117.`,{level:`error`}),N(`tengu_config_auth_loss_prevented`,{});return}let i=e(r);if(i===r)return;t={...i,projects:Tf(r.projects)},Af(F(),t,Yf),Df(t)}}function Sf(){return tp}function Cf(){let e=$f+ep;e>0&&N(`tengu_config_cache_stats`,{cache_hits:$f,cache_misses:ep,hit_rate:$f/e}),$f=0,ep=0}function wf(e){if(e.installMethod!==void 0)return e;let t=e,n=`unknown`,r=e.autoUpdates??!0;switch(t.autoUpdaterStatus){case`migrated`:n=`local`;break;case`installed`:n=`native`;break;case`disabled`:r=!1;break;case`enabled`:case`no_permissions`:case`not_configured`:n=`global`;break;case void 0:break}return{...e,installMethod:n,autoUpdates:r}}function Tf(e){if(!e)return e;let t={},n=!1;for(let[r,i]of Object.entries(e)){let e=i;if(e.history!==void 0){n=!0;let{history:i,...a}=e;t[r]=a}else t[r]=i}return n?t:e}function Ef(){if(rp)return;rp=!0;let e=F();oa(e,{interval:np,persistent:!1},t=>{t.mtimeMs<=Zf.mtime||A().readFile(e,{encoding:`utf-8`}).then(e=>{if(t.mtimeMs<=Zf.mtime)return;let n=fi(li(e));typeof n!=`object`||!n||(Zf={config:wf({...vf(),...n}),mtime:t.mtimeMs},Qf={mtime:t.mtimeMs,size:t.size})}).catch(()=>{})}),Fn(async()=>{aa(e),rp=!1})}function Df(e){Zf={config:e,mtime:Date.now()},Qf=null}function H(){if(Zf.config)return $f++,Zf.config;ep++;try{let e=null;try{e=A().statSync(F())}catch{}let t=wf(Ff(F(),vf));return Zf={config:t,mtime:e?.mtimeMs??Date.now()},Qf=e?{mtime:e.mtimeMs,size:e.size}:null,Ef(),t}catch{return wf(Ff(F(),vf))}}function Of(){let e=H().remoteControlAtStartup;return e===void 0?!1:e}function kf(e){let t=H();return t.customApiKeyResponses?.approved?.includes(e)?`approved`:t.customApiKeyResponses?.rejected?.includes(e)?`rejected`:`new`}function Af(e,t,n){let r=Ji(e);A().mkdirSync(r),nf(e,k($u(t,(e,t)=>k(e)!==k(n[t])),null,2),{encoding:`utf-8`,mode:384}),e===F()&&tp++}function jf(e,t,n){let r=t(),i=Ji(e),a=A();a.mkdirSync(i);let o;try{let i=`${e}.lock`,s=Date.now();o=mi(e,{lockfilePath:i,onCompromised:e=>{M(`Config lock compromised: ${e}`,{level:`error`})}});let c=Date.now()-s;if(c>100&&(M(`Lock acquisition took longer than expected - another Claude instance may be running`),N(`tengu_config_lock_contention`,{lock_time_ms:c})),Qf&&e===F())try{let t=a.statSync(e);(t.mtimeMs!==Qf.mtime||t.size!==Qf.size)&&N(`tengu_config_stale_write`,{read_mtime:Qf.mtime,write_mtime:t.mtimeMs,read_size:Qf.size,write_size:t.size})}catch(e){if(Dn(e)!==`ENOENT`)throw e}let l=Ff(e,t);if(e===F()&&xf(l))return M(`saveConfigWithLock: re-read config is missing auth that cache has; refusing to write to avoid wiping ~/.claude.json. See GH #3117.`,{level:`error`}),N(`tengu_config_auth_loss_prevented`,{}),!1;let u=n(l);if(u===l)return!1;let d=$u(u,(e,t)=>k(e)!==k(r[t]));try{let t=qi(e),n=Nf();try{a.mkdirSync(n)}catch(e){if(Dn(e)!==`EEXIST`)throw e}let r=a.readdirStringSync(n).filter(e=>e.startsWith(`${t}.backup.`)).sort().reverse(),i=r[0],o=i?Number(i.split(`.backup.`).pop()):0,s=Number.isNaN(o)||Date.now()-o>=6e4;if(s){let r=R(n,`${t}.backup.${Date.now()}`);a.copyFileSync(e,r)}let c=s?a.readdirStringSync(n).filter(e=>e.startsWith(`${t}.backup.`)).sort().reverse():r;for(let e of c.slice(5))try{a.unlinkSync(R(n,e))}catch{}}catch(e){Dn(e)!==`ENOENT`&&M(`Failed to backup config: ${e}`,{level:`error`})}return nf(e,k(d,null,2),{encoding:`utf-8`,mode:384}),e===F()&&tp++,!0}finally{o&&o()}}function Mf(){if(ip)return;let e=Date.now();yr(`info`,`enable_configs_started`),ip=!0,Ff(F(),vf,!0),yr(`info`,`enable_configs_completed`,{duration_ms:Date.now()-e})}function Nf(){return R(ae(),`backups`)}function Pf(e){let t=A(),n=qi(e),r=Nf();try{let e=t.readdirStringSync(r).filter(e=>e.startsWith(`${n}.backup.`)).sort().at(-1);if(e)return R(r,e)}catch{}let i=Ji(e);try{let r=t.readdirStringSync(i).filter(e=>e.startsWith(`${n}.backup.`)).sort().at(-1);if(r)return R(i,r);let a=`${e}.backup`;try{return t.statSync(a),a}catch{}}catch{}return null}function Ff(e,t,n){if(!ip)throw Error(`Config accessed before allowed.`);let r=A();try{let n=r.readFileSync(e,{encoding:`utf-8`});try{let e=kn(li(n));return{...t(),...e}}catch(n){throw new Pn(n instanceof Error?n.message:String(n),e,t())}}catch(i){if(Dn(i)===`ENOENT`){let n=Pf(e);return n&&process.stderr.write(`\nClaude configuration file not found at: ${e}\nA backup file exists at: ${n}\nYou can manually restore it by running: cp "${n}" "${e}"\n\n`),t()}if(i instanceof Pn&&n)throw i;if(i instanceof Pn){if(M(`Config file corrupted, resetting to defaults: ${i.message}`,{level:`error`}),!qf){qf=!0;try{I(i);let t=!1;try{r.statSync(`${e}.backup`),t=!0}catch{}N(`tengu_config_parse_error`,{has_backup:t})}finally{qf=!1}}process.stderr.write(`\nClaude configuration file at ${e} is corrupted: ${i.message}\n`);let t=qi(e),n=Nf();try{r.mkdirSync(n)}catch(e){if(Dn(e)!==`EEXIST`)throw e}let a=r.readdirStringSync(n).filter(e=>e.startsWith(`${t}.corrupted.`)),o,s=!1,c=r.readFileSync(e,{encoding:`utf-8`});for(let e of a)try{if(c===r.readFileSync(R(n,e),{encoding:`utf-8`})){s=!0;break}}catch{}if(!s){o=R(n,`${t}.corrupted.${Date.now()}`);try{r.copyFileSync(e,o),M(`Corrupted config backed up to: ${o}`,{level:`error`})}catch{}}let l=Pf(e);o?process.stderr.write(`The corrupted file has been backed up to: ${o}\n`):s&&process.stderr.write(`The corrupted file has already been backed up.
13
+ `),l?process.stderr.write(`A backup file exists at: ${l}\nYou can manually restore it by running: cp "${l}" "${e}"\n\n`):process.stderr.write(`
14
+ `)}return t()}}function If(){let e=ap(),t=H();if(!t.projects)return Jf;let n=t.projects[e]??Jf;return typeof n.allowedTools==`string`&&(n.allowedTools=fi(n.allowedTools)??[]),n}function Lf(e){let t=ap(),n=null;try{jf(F(),vf,r=>{let i=r.projects?.[t]??Jf,a=e(i);return a===i?r:(n={...r,projects:{...r.projects,[t]:a}},n)})&&n&&Df(n)}catch(r){M(`Failed to save config with lock: ${r}`,{level:`error`});let i=Ff(F(),vf);if(xf(i)){M(`saveCurrentProjectConfig fallback: re-read config is missing auth that cache has; refusing to write. See GH #3117.`,{level:`error`}),N(`tengu_config_auth_loss_prevented`,{});return}let a=i.projects?.[t]??Jf,o=e(a);if(o===a)return;n={...i,projects:{...i.projects,[t]:o}},Af(F(),n,Yf),Df(n)}}function Rf(){return Vf()!==null}function zf(){return Rf()&&!g(process.env.FORCE_AUTOUPDATE_PLUGINS)}function Bf(e){switch(e.type){case`development`:return`development build`;case`env`:return`${e.envVar} set`;case`config`:return`config`}}function Vf(){if(!g(process.env.ENABLE_AUTOUPDATER))return{type:`config`};if(g(process.env.DISABLE_AUTOUPDATER))return{type:`env`,envVar:`DISABLE_AUTOUPDATER`};let e=Ur();if(e)return{type:`env`,envVar:e};let t=H();return t.autoUpdates===!1&&(t.installMethod!==`native`||t.autoUpdatesProtectedForNative!==!0)?{type:`config`}:null}function Hf(){let e=H();if(e.userID)return e.userID;let t=la(32).toString(`hex`);return V(e=>({...e,userID:t})),t}function Uf(){if(!H().firstStartTime){let e=new Date().toISOString();V(t=>({...t,firstStartTime:t.firstStartTime??e}))}}function Wf(e){let t=dn();switch(e){case`User`:return R(ae(),`CLAUDE.md`);case`Local`:return R(t,`CLAUDE.local.md`);case`Project`:return R(t,`CLAUDE.md`);case`Managed`:return R(df(),`CLAUDE.md`);case`AutoMem`:return ak()}return``}function Gf(){return R(df(),`.claude`,`rules`)}function Kf(){return R(ae(),`rules`)}var qf,Jf,Yf,Xf,Zf,Qf,$f,ep,tp,np,rp,ip,ap,op=t((()=>{m(),ed(),O(),uk(),hr(),gr(),Bn(),j(),br(),Fr(),h(),zn(),uf(),Vn(),wr(),di(),si(),gi(),Vr(),$r(),zr(),pf(),An(),_f(),qf=!1,Jf={allowedTools:[],mcpContextUris:[],mcpServers:{},enabledMcpjsonServers:[],disabledMcpjsonServers:[],hasTrustDialogAccepted:!1,projectOnboardingSeenCount:0,hasClaudeMdExternalIncludesApproved:!1,hasClaudeMdExternalIncludesWarningShown:!1},Yf=vf(),Xf=!1,{...Yf},{...Jf},Zf={config:null,mtime:0},Qf=null,$f=0,ep=0,tp=0,Fn(async()=>{Cf()}),np=1e3,rp=!1,ip=!1,ap=p(()=>{let e=dn();return Qr(Sr(e)||$i(e))})}));function sp(e){let t=[],n=!1;async function r(){if(!n&&t.length!==0){for(n=!0;t.length>0;){let{args:n,resolve:r,reject:i,context:a}=t.shift();try{r(await e.apply(a,n))}catch(e){i(e)}}n=!1,t.length>0&&r()}}return function(...e){return new Promise((n,i)=>{t.push({args:e,resolve:n,reject:i,context:this}),r()})}}var cp=t((()=>{}));function lp(e){gp=e}function up(){gp=null,_p=void 0}function dp(e){return _p=e,e}function fp(){return R(ae(),hp)}function pp(){try{let e=kn(li(Pd(fp())));return!e||typeof e!=`object`||Array.isArray(e)?null:e}catch{return null}}function mp(){if(_p!==!0)return null;if(gp)return gp;let e=pp();return e?(gp=e,gt(),e):null}var hp,gp,_p,vp=t((()=>{h(),Fd(),si(),Ft(),An(),hp=`remote-settings.json`,gp=null}));async function yp(e,t){let{code:n}=await ri(`git`,[`check-ignore`,e],{preserveOutputOnError:!1,cwd:t});return n===0}function bp(){return R(Wi(),`.config`,`git`,`ignore`)}async function xp(e,t=_r()){try{if(!await Cr(t))return;let n=`**/${e}`;if(await yp(e.endsWith(`/`)?`${e}sample-file.txt`:e,t))return;let r=bp();await fa(Ji(r),{recursive:!0});try{if((await pa(r,{encoding:`utf-8`})).includes(n))return;await da(r,`\n${n}\n`)}catch(e){if(Dn(e)===`ENOENT`)await va(r,`${n}\n`,`utf-8`);else throw e}}catch(e){I(e)}}var Sp=t((()=>{gr(),zn(),ii(),wr(),Vr()}));function Cp(e){switch(e){case`userSettings`:return`user`;case`projectSettings`:return`project`;case`localSettings`:return`project, gitignored`;case`flagSettings`:return`cli flag`;case`policySettings`:return`managed`}}function wp(e){switch(e){case`userSettings`:return`User`;case`projectSettings`:return`Project`;case`localSettings`:return`Local`;case`flagSettings`:return`Flag`;case`policySettings`:return`Managed`;case`plugin`:return`Plugin`;case`built-in`:return`Built-in`}}function Tp(e){switch(e){case`userSettings`:return`user settings`;case`projectSettings`:return`shared project settings`;case`localSettings`:return`project local settings`;case`flagSettings`:return`command line arguments`;case`policySettings`:return`enterprise managed settings`;case`cliArg`:return`CLI argument`;case`command`:return`command configuration`;case`session`:return`current session`}}function Ep(e){switch(e){case`userSettings`:return`User settings`;case`projectSettings`:return`Shared project settings`;case`localSettings`:return`Project local settings`;case`flagSettings`:return`Command line arguments`;case`policySettings`:return`Enterprise managed settings`;case`cliArg`:return`CLI argument`;case`command`:return`Command configuration`;case`session`:return`Current session`}}function Dp(e){if(e===``)return[];let t=e.split(`,`).map(e=>e.trim()),n=[];for(let e of t)switch(e){case`user`:n.push(`userSettings`);break;case`project`:n.push(`projectSettings`);break;case`local`:n.push(`localSettings`);break;default:throw Error(`Invalid setting source: ${e}. Valid options are: user, project, local`)}return n}function Op(){let e=Kt(),t=new Set(e);return t.add(`policySettings`),t.add(`flagSettings`),Array.from(t)}function kp(e){return Op().includes(e)}var Ap,jp,Mp,Np=t((()=>{O(),Ap=[`userSettings`,`projectSettings`,`localSettings`,`flagSettings`,`policySettings`],jp=[`localSettings`,`projectSettings`,`userSettings`],Mp=`https://json.schemastore.org/claude-code-settings.json`}));function Pp(e){Lp.set(e,Date.now())}function Fp(e,t){let n=Lp.get(e);return n!==void 0&&Date.now()-n<t?(Lp.delete(e),!0):!1}function Ip(){Lp.clear()}var Lp,Rp=t((()=>{Lp=new Map})),zp,Bp,Vp,Hp=t((()=>{Je(),Ei(),zp=L(()=>D({allowedDomains:S(b()).optional(),allowManagedDomainsOnly:w().optional().describe(`When true (and set in managed settings), only allowedDomains and WebFetch(domain:...) allow rules from managed settings are respected. User, project, local, and flag settings domains are ignored. Denied domains are still respected from all sources.`),allowUnixSockets:S(b()).optional().describe(`macOS only: Unix socket paths to allow. Ignored on Linux (seccomp cannot filter by path).`),allowAllUnixSockets:w().optional().describe(`If true, allow all Unix sockets (disables blocking on both platforms).`),allowLocalBinding:w().optional(),httpProxyPort:y().optional(),socksProxyPort:y().optional()}).optional()),Bp=L(()=>D({allowWrite:S(b()).optional().describe(`Additional paths to allow writing within the sandbox. Merged with paths from Edit(...) allow permission rules.`),denyWrite:S(b()).optional().describe(`Additional paths to deny writing within the sandbox. Merged with paths from Edit(...) deny permission rules.`),denyRead:S(b()).optional().describe(`Additional paths to deny reading within the sandbox. Merged with paths from Read(...) deny permission rules.`),allowRead:S(b()).optional().describe(`Paths to re-allow reading within denyRead regions. Takes precedence over denyRead for matching paths.`),allowManagedReadPathsOnly:w().optional().describe(`When true (set in managed settings), only allowRead paths from policySettings are used.`)}).optional()),Vp=L(()=>D({enabled:w().optional(),failIfUnavailable:w().optional().describe(`Exit with an error at startup if sandbox.enabled is true but the sandbox cannot start (missing dependencies, unsupported platform, or platform not in enabledPlatforms). When false (default), a warning is shown and commands run unsandboxed. Intended for managed-settings deployments that require sandboxing as a hard gate.`),autoAllowBashIfSandboxed:w().optional(),allowUnsandboxedCommands:w().optional().describe(`Allow commands to run outside the sandbox via the dangerouslyDisableSandbox parameter. When false, the dangerouslyDisableSandbox parameter is completely ignored and all commands must run sandboxed. Default: true.`),network:zp(),filesystem:Bp(),ignoreViolations:x(b(),S(b())).optional(),enableWeakerNestedSandbox:w().optional(),enableWeakerNetworkIsolation:w().optional().describe(`macOS only: Allow access to com.apple.trustd.agent in the sandbox. Needed for Go-based CLI tools (gh, gcloud, terraform, etc.) to verify TLS certificates when using httpProxyPort with a MITM proxy and custom CA. **Reduces security** — opens a potential data exfiltration vector through the trustd service. Default: false`),excludedCommands:S(b()).optional(),ripgrep:D({command:b(),args:S(b()).optional()}).optional().describe(`Custom ripgrep configuration for bundled ripgrep support`)}).passthrough())})),Up,Wp,Gp,Kp=t((()=>{Fr(),Up=Lr.platform===`darwin`?`⏺`:`●`,Wp=[`·|·`,`·/·`,`·—·`,`·\\·`],Gp=`·✔︎·`}));function qp(e){return process.env.USER_TYPE===`ant`?e!==`auto`&&e!==`bubble`:!0}function Jp(e){return im[e]??im.default}function Yp(e){return Jp(e).external}function Xp(e){return Oi.includes(e)?e:`default`}function Zp(e){return Jp(e).title}function Qp(e){return e===`default`||e===void 0}function $p(e){return Jp(e).shortTitle}function em(e){return Jp(e).symbol}function tm(e){return Jp(e).color}var nm,rm,im,am=t((()=>{Je(),Kp(),Di(),Ei(),nm=L(()=>Ke.enum(Oi)),rm=L(()=>Ke.enum(ki)),im={default:{title:`Default`,shortTitle:`Default`,symbol:``,color:`text`,external:`default`},plan:{title:`Plan Mode`,shortTitle:`Plan`,symbol:`⏸`,color:`planMode`,external:`plan`},acceptEdits:{title:`Accept edits`,shortTitle:`Accept`,symbol:`⏵⏵`,color:`autoAccept`,external:`acceptEdits`},bypassPermissions:{title:`Bypass`,shortTitle:`Bypass`,symbol:`⏵⏵`,color:`error`,external:`bypassPermissions`},dontAsk:{title:`Don't Ask`,shortTitle:`DontAsk`,symbol:`⏵⏵`,color:`error`,external:`dontAsk`},auto:{title:`Auto`,shortTitle:`Auto`,symbol:`⏵⏵`,color:`warning`,external:`default`}}})),om,sm=t((()=>{om=`PreToolUse.PostToolUse.PostToolUseFailure.Notification.UserPromptSubmit.SessionStart.SessionEnd.Stop.StopFailure.SubagentStart.SubagentStop.PreCompact.PostCompact.PermissionRequest.PermissionDenied.Setup.TeammateIdle.TaskCreated.TaskCompleted.Elicitation.ElicitationResult.ConfigChange.WorktreeCreate.WorktreeRemove.InstructionsLoaded.CwdChanged.FileChanged`.split(`.`)})),cm,lm,um=t((()=>{cm=[`bash`,`powershell`],lm=`bash`}));function dm(){return{BashCommandHookSchema:D({type:T(`command`).describe(`Shell command hook type`),command:b().describe(`Shell command to execute`),if:fm(),shell:E(cm).optional().describe(`Shell interpreter. 'bash' uses your $SHELL (bash/zsh/sh); 'powershell' uses pwsh. Defaults to bash.`),timeout:y().positive().optional().describe(`Timeout in seconds for this specific command`),statusMessage:b().optional().describe(`Custom status message to display in spinner while hook runs`),once:w().optional().describe(`If true, hook runs once and is removed after execution`),async:w().optional().describe(`If true, hook runs in background without blocking`),asyncRewake:w().optional().describe(`If true, hook runs in background and wakes the model on exit code 2 (blocking error). Implies async.`)}),PromptHookSchema:D({type:T(`prompt`).describe(`LLM prompt hook type`),prompt:b().describe(`Prompt to evaluate with LLM. Use $ARGUMENTS placeholder for hook input JSON.`),if:fm(),timeout:y().positive().optional().describe(`Timeout in seconds for this specific prompt evaluation`),model:b().optional().describe(`Model to use for this prompt hook (e.g., "claude-sonnet-4-6"). If not specified, uses the default small fast model.`),statusMessage:b().optional().describe(`Custom status message to display in spinner while hook runs`),once:w().optional().describe(`If true, hook runs once and is removed after execution`)}),HttpHookSchema:D({type:T(`http`).describe(`HTTP hook type`),url:b().url().describe(`URL to POST the hook input JSON to`),if:fm(),timeout:y().positive().optional().describe(`Timeout in seconds for this specific request`),headers:x(b(),b()).optional().describe('Additional headers to include in the request. Values may reference environment variables using $VAR_NAME or ${VAR_NAME} syntax (e.g., "Authorization": "Bearer $MY_TOKEN"). Only variables listed in allowedEnvVars will be interpolated.'),allowedEnvVars:S(b()).optional().describe(`Explicit list of environment variable names that may be interpolated in header values. Only variables listed here will be resolved; all other $VAR references are left as empty strings. Required for env var interpolation to work.`),statusMessage:b().optional().describe(`Custom status message to display in spinner while hook runs`),once:w().optional().describe(`If true, hook runs once and is removed after execution`)}),AgentHookSchema:D({type:T(`agent`).describe(`Agentic verifier hook type`),prompt:b().describe(`Prompt describing what to verify (e.g. "Verify that unit tests ran and passed."). Use $ARGUMENTS placeholder for hook input JSON.`),if:fm(),timeout:y().positive().optional().describe(`Timeout in seconds for agent execution (default 60)`),model:b().optional().describe(`Model to use for this agent hook (e.g., "claude-sonnet-4-6"). If not specified, uses Haiku.`),statusMessage:b().optional().describe(`Custom status message to display in spinner while hook runs`),once:w().optional().describe(`If true, hook runs once and is removed after execution`)})}}var fm,pm,mm,hm,gm=t((()=>{sm(),Je(),Ei(),um(),fm=L(()=>b().optional().describe(`Permission rule syntax to filter when this hook runs (e.g., "Bash(git *)"). Only runs if the tool call matches the pattern. Avoids spawning hooks for non-matching commands.`)),pm=L(()=>{let{BashCommandHookSchema:e,PromptHookSchema:t,AgentHookSchema:n,HttpHookSchema:r}=dm();return We(`type`,[e,t,n,r])}),mm=L(()=>D({matcher:b().optional().describe(`String pattern to match (e.g. tool names like "Write")`),hooks:S(pm()).describe(`List of hooks to execute when the matcher matches`)})),hm=L(()=>Le(E(om),S(mm())))}));function _m(e,t){let n=e.toLowerCase();return t.autoUpdate??(Sm.has(n)&&!Cm.has(n))}function vm(e){return Sm.has(e.toLowerCase())?!1:Tm.test(e)?!0:wm.test(e)}function ym(e,t){let n=e.toLowerCase();if(!Sm.has(n))return null;if(t.source===`github`)return(t.repo||``).toLowerCase().startsWith(`anthropics/`)?null:`The name '${e}' is reserved for official Anthropic marketplaces. Only repositories from 'github.com/${Em}/' can use this name.`;if(t.source===`git`&&t.url){let n=t.url.toLowerCase(),r=n.includes(`github.com/anthropics/`),i=n.includes(`git@github.com:anthropics/`);return r||i?null:`The name '${e}' is reserved for official Anthropic marketplaces. Only repositories from 'github.com/${Em}/' can use this name.`}return`The name '${e}' is reserved for official Anthropic marketplaces and can only be used with GitHub sources from the '${Em}' organization.`}function bm(e){return typeof e==`string`&&e.startsWith(`./`)}function xm(e){return e.source===`file`||e.source===`directory`}var Sm,Cm,wm,Tm,Em,Dm,Om,km,Am,jm,Mm,Nm,Pm,Fm,Im,Lm,Rm,zm,Bm,Vm,Hm,Um,Wm,Gm,Km,qm,Jm,Ym,Xm,Zm,Qm,$m,eh,th,nh,rh,ih,ah,oh,sh,ch,lh,uh,dh,fh,ph,mh,hh=t((()=>{Je(),gm(),oi(),Ei(),Sm=new Set([`claude-code-marketplace`,`claude-code-plugins`,`claude-plugins-official`,`anthropic-marketplace`,`anthropic-plugins`,`agent-skills`,`life-sciences`,`knowledge-work-plugins`]),Cm=new Set([`knowledge-work-plugins`]),wm=/(?:official[^a-z0-9]*(anthropic|claude)|(?:anthropic|claude)[^a-z0-9]*official|^(?:anthropic|claude)[^a-z0-9]*(marketplace|plugins|official))/i,Tm=/[^\u0020-\u007E]/,Em=`anthropics`,Dm=L(()=>b().startsWith(`./`)),Om=L(()=>Dm().endsWith(`.json`)),km=L(()=>C([Dm().refine(e=>e.endsWith(`.mcpb`)||e.endsWith(`.dxt`),{message:`MCPB file path must end with .mcpb or .dxt`}).describe(`Path to MCPB file relative to plugin root`),b().url().refine(e=>e.endsWith(`.mcpb`)||e.endsWith(`.dxt`),{message:`MCPB URL must end with .mcpb or .dxt`}).describe(`URL to MCPB file`)])),Am=L(()=>Dm().endsWith(`.md`)),jm=L(()=>C([Am(),Dm()])),Mm=L(()=>b().min(1,`Marketplace must have a name`).refine(e=>!e.includes(` `),{message:`Marketplace name cannot contain spaces. Use kebab-case (e.g., "my-marketplace")`}).refine(e=>!e.includes(`/`)&&!e.includes(`\\`)&&!e.includes(`..`)&&e!==`.`,{message:`Marketplace name cannot contain path separators (/ or \\), ".." sequences, or be "."`}).refine(e=>!vm(e),{message:`Marketplace name impersonates an official Anthropic/Claude marketplace`}).refine(e=>e.toLowerCase()!==`inline`,{message:`Marketplace name "inline" is reserved for --plugin-dir session plugins`}).refine(e=>e.toLowerCase()!==`builtin`,{message:`Marketplace name "builtin" is reserved for built-in plugins`})),Nm=L(()=>D({name:b().min(1,`Author name cannot be empty`).describe(`Display name of the plugin author or organization`),email:b().optional().describe(`Contact email for support or feedback`),url:b().optional().describe(`Website, GitHub profile, or organization URL`)})),Pm=L(()=>D({name:b().min(1,`Plugin name cannot be empty`).refine(e=>!e.includes(` `),{message:`Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")`}).describe(`Unique identifier for the plugin, used for namespacing (prefer kebab-case)`),version:b().optional().describe(`Semantic version (e.g., 1.2.3) following semver.org specification`),description:b().optional().describe(`Brief, user-facing explanation of what the plugin provides`),author:Nm().optional().describe(`Information about the plugin creator or maintainer`),homepage:b().url().optional().describe(`Plugin homepage or documentation URL`),repository:b().optional().describe(`Source code repository URL`),license:b().optional().describe(`SPDX license identifier (e.g., MIT, Apache-2.0)`),keywords:S(b()).optional().describe(`Tags for plugin discovery and categorization`),dependencies:S(sh()).optional().describe(`Plugins that must be enabled for this plugin to function. Bare names (no "@marketplace") are resolved against the declaring plugin's own marketplace.`)})),Fm=L(()=>D({description:b().optional().describe(`Brief, user-facing explanation of what these hooks provide`),hooks:Ue(()=>hm()).describe(`The hooks provided by the plugin, in the same format as the one used for settings`)})),Im=L(()=>D({hooks:C([Om().describe(`Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root`),Ue(()=>hm()).describe(`Additional hooks (in addition to those in hooks/hooks.json, if it exists)`),S(C([Om().describe(`Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root`),Ue(()=>hm()).describe(`Additional hooks (in addition to those in hooks/hooks.json, if it exists)`)]))])})),Lm=L(()=>D({source:jm().optional().describe(`Path to command markdown file, relative to plugin root`),content:b().optional().describe(`Inline markdown content for the command`),description:b().optional().describe(`Command description override`),argumentHint:b().optional().describe(`Hint for command arguments (e.g., "[file]")`),model:b().optional().describe(`Default model for this command`),allowedTools:S(b()).optional().describe(`Tools allowed when command runs`)}).refine(e=>e.source&&!e.content||!e.source&&e.content,{message:`Command must have either "source" (file path) or "content" (inline markdown), but not both`})),Rm=L(()=>D({commands:C([jm().describe(`Path to additional command file or skill directory (in addition to those in the commands/ directory, if it exists), relative to the plugin root`),S(jm().describe(`Path to additional command file or skill directory (in addition to those in the commands/ directory, if it exists), relative to the plugin root`)).describe(`List of paths to additional command files or skill directories`),x(b(),Lm()).describe(`Object mapping of command names to their metadata and source files. Command name becomes the slash command name (e.g., "about" → "/plugin:about")`)])})),zm=L(()=>D({agents:C([Am().describe(`Path to additional agent file (in addition to those in the agents/ directory, if it exists), relative to the plugin root`),S(Am().describe(`Path to additional agent file (in addition to those in the agents/ directory, if it exists), relative to the plugin root`)).describe(`List of paths to additional agent files`)])})),Bm=L(()=>D({skills:C([Dm().describe(`Path to additional skill directory (in addition to those in the skills/ directory, if it exists), relative to the plugin root`),S(Dm().describe(`Path to additional skill directory (in addition to those in the skills/ directory, if it exists), relative to the plugin root`)).describe(`List of paths to additional skill directories`)])})),Vm=L(()=>D({outputStyles:C([Dm().describe(`Path to additional output styles directory or file (in addition to those in the output-styles/ directory, if it exists), relative to the plugin root`),S(Dm().describe(`Path to additional output styles directory or file (in addition to those in the output-styles/ directory, if it exists), relative to the plugin root`)).describe(`List of paths to additional output styles directories or files`)])})),Hm=L(()=>b().min(1)),Um=L(()=>b().min(2).refine(e=>e.startsWith(`.`),{message:`File extensions must start with dot (e.g., ".ts", not "ts")`})),Wm=L(()=>D({mcpServers:C([Om().describe(`MCP servers to include in the plugin (in addition to those in the .mcp.json file, if it exists)`),km().describe(`Path or URL to MCPB file containing MCP server configuration`),x(b(),ui()).describe(`MCP server configurations keyed by server name`),S(C([Om().describe(`Path to MCP servers configuration file`),km().describe(`Path or URL to MCPB file`),x(b(),ui()).describe(`Inline MCP server configurations`)])).describe(`Array of MCP server configurations (paths, MCPB files, or inline definitions)`)])})),Gm=L(()=>D({type:E([`string`,`number`,`boolean`,`directory`,`file`]).describe(`Type of the configuration value`),title:b().describe(`Human-readable label shown in the config dialog`),description:b().describe(`Help text shown beneath the field in the config dialog`),required:w().optional().describe(`If true, validation fails when this field is empty`),default:C([b(),y(),w(),S(b())]).optional().describe(`Default value used when the user provides nothing`),multiple:w().optional().describe(`For string type: allow an array of strings`),sensitive:w().optional().describe(`If true, masks dialog input and stores value in secure storage (keychain/credentials file) instead of settings.json`),min:y().optional().describe(`Minimum value (number type only)`),max:y().optional().describe(`Maximum value (number type only)`)}).strict()),Km=L(()=>D({userConfig:x(b().regex(/^[A-Za-z_]\w*$/,`Option keys must be valid identifiers (letters, digits, underscore; no leading digit) — they become CLAUDE_PLUGIN_OPTION_<KEY> env vars in hooks`),Gm()).optional().describe("User-configurable values this plugin needs. Prompted at enable time. Non-sensitive values saved to settings.json; sensitive values to secure storage (macOS keychain or .credentials.json). Available as ${user_config.KEY} in MCP/LSP server config, hook commands, and (non-sensitive only) skill/agent content. Note: sensitive values share a single keychain entry with OAuth tokens — keep secret counts small to stay under the ~2KB stdin-safe limit (see INC-3028).")})),qm=L(()=>D({channels:S(D({server:b().min(1).describe(`Name of the MCP server this channel binds to. Must match a key in this plugin's mcpServers.`),displayName:b().optional().describe(`Human-readable name shown in the config dialog title (e.g., "Telegram"). Defaults to the server name.`),userConfig:x(b(),Gm()).optional().describe("Fields to prompt the user for when enabling this plugin in assistant mode. Saved values are substituted into ${user_config.KEY} references in the mcpServers env.")}).strict()).describe(`Channels this plugin provides. Each entry declares an MCP server as a message channel and optionally specifies user configuration to prompt for at enable time.`)})),Jm=L(()=>Re({command:b().min(1).refine(e=>!(e.includes(` `)&&!e.startsWith(`/`)),{message:`Command should not contain spaces. Use args array for arguments.`}).describe(`Command to execute the LSP server (e.g., "typescript-language-server")`),args:S(Hm()).optional().describe(`Command-line arguments to pass to the server`),extensionToLanguage:x(Um(),Hm()).refine(e=>Object.keys(e).length>0,{message:`extensionToLanguage must have at least one mapping`}).describe(`Mapping from file extension to LSP language ID. File extensions and languages are derived from this mapping.`),transport:E([`stdio`,`socket`]).default(`stdio`).describe(`Communication transport mechanism`),env:x(b(),b()).optional().describe(`Environment variables to set when starting the server`),initializationOptions:Ve().optional().describe(`Initialization options passed to the server during initialization`),settings:Ve().optional().describe(`Settings passed to the server via workspace/didChangeConfiguration`),workspaceFolder:b().optional().describe(`Workspace folder path to use for the server`),startupTimeout:y().int().positive().optional().describe(`Maximum time to wait for server startup (milliseconds)`),shutdownTimeout:y().int().positive().optional().describe(`Maximum time to wait for graceful shutdown (milliseconds)`),restartOnCrash:w().optional().describe(`Whether to restart the server if it crashes`),maxRestarts:y().int().nonnegative().optional().describe(`Maximum number of restart attempts before giving up`)})),Ym=L(()=>D({lspServers:C([Om().describe(`Path to .lsp.json configuration file relative to plugin root`),x(b(),Jm()).describe(`LSP server configurations keyed by server name`),S(C([Om().describe(`Path to LSP configuration file`),x(b(),Jm()).describe(`Inline LSP server configurations`)])).describe(`Array of LSP server configurations (paths or inline definitions)`)])})),Xm=L(()=>b().refine(e=>!e.includes(`..`)&&!e.includes(`//`),`Package name cannot contain path traversal patterns`).refine(e=>/^@[a-z0-9][a-z0-9-._]*\/[a-z0-9][a-z0-9-._]*$/.test(e)||/^[a-z0-9][a-z0-9-._]*$/.test(e),`Invalid npm package name format`)),Zm=L(()=>D({settings:x(b(),Ve()).optional().describe(`Settings to merge when plugin is enabled. Only allowlisted keys are kept (currently: agent)`)})),Qm=L(()=>D({...Pm().shape,...Im().partial().shape,...Rm().partial().shape,...zm().partial().shape,...Bm().partial().shape,...Vm().partial().shape,...qm().partial().shape,...Wm().partial().shape,...Ym().partial().shape,...Zm().partial().shape,...Km().partial().shape})),$m=L(()=>We(`source`,[D({source:T(`url`),url:b().url().describe(`Direct URL to marketplace.json file`),headers:x(b(),b()).optional().describe(`Custom HTTP headers (e.g., for authentication)`)}),D({source:T(`github`),repo:b().describe(`GitHub repository in owner/repo format`),ref:b().optional().describe(`Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.`),path:b().optional().describe(`Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)`),sparsePaths:S(b()).optional().describe(`Directories to include via git sparse-checkout (cone mode). Use for monorepos where the marketplace lives in a subdirectory. Example: [".claude-plugin", "plugins"]. If omitted, the full repository is cloned.`)}),D({source:T(`git`),url:b().describe(`Full git repository URL`),ref:b().optional().describe(`Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.`),path:b().optional().describe(`Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)`),sparsePaths:S(b()).optional().describe(`Directories to include via git sparse-checkout (cone mode). Use for monorepos where the marketplace lives in a subdirectory. Example: [".claude-plugin", "plugins"]. If omitted, the full repository is cloned.`)}),D({source:T(`npm`),package:Xm().describe(`NPM package containing marketplace.json`)}),D({source:T(`file`),path:b().describe(`Local file path to marketplace.json`)}),D({source:T(`directory`),path:b().describe(`Local directory containing .claude-plugin/marketplace.json`)}),D({source:T(`hostPattern`),hostPattern:b().describe(`Regex pattern to match the host/domain extracted from any marketplace source type. For github sources, matches against "github.com". For git sources (SSH or HTTPS), extracts the hostname from the URL. Use in strictKnownMarketplaces to allow all marketplaces from a specific host (e.g., "^github\\.mycompany\\.com$").`)}),D({source:T(`pathPattern`),pathPattern:b().describe(`Regex pattern matched against the .path field of file and directory sources. Use in strictKnownMarketplaces to allow filesystem-based marketplaces alongside hostPattern restrictions for network sources. Use ".*" to allow all filesystem paths, or a narrower pattern (e.g., "^/opt/approved/") to restrict to specific directories.`)}),D({source:T(`settings`),name:Mm().refine(e=>!Sm.has(e.toLowerCase()),{message:`Reserved official marketplace names cannot be used with settings sources. validateOfficialNameSource only accepts github/git sources from anthropics/* for these names; a settings source would be rejected after loadAndCacheMarketplace has already written to disk with cleanupNeeded=false.`}).describe(`Marketplace name. Must match the extraKnownMarketplaces key (enforced); the synthetic manifest is written under this name. Same validation as PluginMarketplaceSchema plus reserved-name rejection — validateOfficialNameSource runs after the disk write, too late to clean up.`),plugins:S(nh()).describe(`Plugin entries declared inline in settings.json`),owner:Nm().optional()}).describe(`Inline marketplace manifest defined directly in settings.json. The reconciler writes a synthetic marketplace.json to the cache; diffMarketplaces detects edits via isEqual on the stored source (the plugins array is inside this object, so edits surface as sourceChanged).`)])),eh=L(()=>b().length(40).regex(/^[a-f0-9]{40}$/,`Must be a full 40-character lowercase git commit SHA`)),th=L(()=>C([Dm().describe(`Path to the plugin root, relative to the marketplace root (the directory containing .claude-plugin/, not .claude-plugin/ itself)`),D({source:T(`npm`),package:Xm().or(b()).describe("Package name (or url, or local path, or anything else that can be passed to `npm` as a package)"),version:b().optional().describe(`Specific version or version range (e.g., ^1.0.0, ~2.1.0)`),registry:b().url().optional().describe(`Custom NPM registry URL (defaults to using system default, likely npmjs.org)`)}).describe(`NPM package as plugin source`),D({source:T(`pip`),package:b().describe(`Python package name as it appears on PyPI`),version:b().optional().describe(`Version specifier (e.g., ==1.0.0, >=2.0.0, <3.0.0)`),registry:b().url().optional().describe(`Custom PyPI registry URL (defaults to using system default, likely pypi.org)`)}).describe(`Python package as plugin source`),D({source:T(`url`),url:b().describe(`Full git repository URL (https:// or git@)`),ref:b().optional().describe(`Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.`),sha:eh().optional().describe(`Specific commit SHA to use`)}),D({source:T(`github`),repo:b().describe(`GitHub repository in owner/repo format`),ref:b().optional().describe(`Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.`),sha:eh().optional().describe(`Specific commit SHA to use`)}),D({source:T(`git-subdir`),url:b().describe(`Git repository: GitHub owner/repo shorthand, https://, or git@ URL`),path:b().min(1).describe(`Subdirectory within the repo containing the plugin (e.g., "tools/claude-plugin"). Cloned sparsely using partial clone (--filter=tree:0) to minimize bandwidth for monorepos.`),ref:b().optional().describe(`Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.`),sha:eh().optional().describe(`Specific commit SHA to use`)}).describe(`Plugin located in a subdirectory of a larger repository (monorepo). Only the specified subdirectory is materialized; the rest of the repo is not downloaded.`)])),nh=L(()=>D({name:b().min(1,`Plugin name cannot be empty`).refine(e=>!e.includes(` `),{message:`Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")`}).describe(`Plugin name as it appears in the target repository`),source:th().describe(`Where to fetch the plugin from. Must be a remote source — relative paths have no marketplace repository to resolve against.`),description:b().optional(),version:b().optional(),strict:w().optional()}).refine(e=>typeof e.source!=`string`,{message:`Plugins in a settings-sourced marketplace must use remote sources (github, git-subdir, npm, url, pip). Relative-path sources like "./foo" have no marketplace repository to resolve against.`})),rh=L(()=>Qm().partial().extend({name:b().min(1,`Plugin name cannot be empty`).refine(e=>!e.includes(` `),{message:`Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")`}).describe(`Unique identifier matching the plugin name`),source:th().describe(`Where to fetch the plugin from`),category:b().optional().describe(`Category for organizing plugins (e.g., "productivity", "development")`),tags:S(b()).optional().describe(`Tags for searchability and discovery`),strict:w().optional().default(!0).describe(`Require the plugin manifest to be present in the plugin folder. If false, the marketplace entry provides the manifest.`)})),ih=L(()=>D({name:Mm(),owner:Nm().describe(`Marketplace maintainer or curator information`),plugins:S(rh()).describe(`Collection of available plugins in this marketplace`),forceRemoveDeletedPlugins:w().optional().describe(`When true, plugins removed from this marketplace will be automatically uninstalled and flagged for users`),metadata:D({pluginRoot:b().optional().describe(`Base path for relative plugin sources`),version:b().optional().describe(`Marketplace version`),description:b().optional().describe(`Marketplace description`)}).optional().describe(`Optional marketplace metadata`),allowCrossMarketplaceDependenciesOn:S(b()).optional().describe(`Marketplace names whose plugins may be auto-installed as dependencies. Only the root marketplace's allowlist applies — no transitive trust.`)})),ah=L(()=>b().regex(/^[a-z0-9][-a-z0-9._]*@[a-z0-9][-a-z0-9._]*$/i,`Plugin ID must be in format: plugin@marketplace`)),oh=/^[a-z0-9][-a-z0-9._]*(@[a-z0-9][-a-z0-9._]*)?(@\^[^@]*)?$/i,sh=L(()=>C([b().regex(oh,`Dependency must be a plugin name, optionally qualified with @marketplace`).transform(e=>e.replace(/@\^[^@]*$/,``)),D({name:b().min(1).regex(/^[a-z0-9][-a-z0-9._]*$/i),marketplace:b().min(1).regex(/^[a-z0-9][-a-z0-9._]*$/i).optional()}).loose().transform(e=>e.marketplace?`${e.name}@${e.marketplace}`:e.name)])),L(()=>C([ah(),D({id:ah().describe(`Plugin identifier (e.g., "formatter@tools")`),version:b().optional().describe(`Version constraint (e.g., "^2.0.0")`),required:w().optional().describe(`If true, cannot be disabled`),config:x(b(),Ve()).optional().describe(`Plugin-specific configuration`)})])),ch=L(()=>D({version:b().describe(`Currently installed version`),installedAt:b().describe(`ISO 8601 timestamp of installation`),lastUpdated:b().optional().describe(`ISO 8601 timestamp of last update`),installPath:b().describe(`Absolute path to the installed plugin directory`),gitCommitSha:b().optional().describe(`Git commit SHA for git-based plugins (for version tracking)`)})),lh=L(()=>D({version:T(1).describe(`Schema version 1`),plugins:x(ah(),ch()).describe(`Map of plugin IDs to their installation metadata`)})),uh=L(()=>E([`managed`,`user`,`project`,`local`])),dh=L(()=>D({scope:uh().describe(`Installation scope`),projectPath:b().optional().describe(`Project path (required for project/local scopes)`),installPath:b().describe(`Absolute path to the versioned plugin directory`),version:b().optional().describe(`Currently installed version`),installedAt:b().optional().describe(`ISO 8601 timestamp of installation`),lastUpdated:b().optional().describe(`ISO 8601 timestamp of last update`),gitCommitSha:b().optional().describe(`Git commit SHA for git-based plugins`)})),fh=L(()=>D({version:T(2).describe(`Schema version 2`),plugins:x(ah(),S(dh())).describe(`Map of plugin IDs to arrays of installation entries`)})),L(()=>C([lh(),fh()])),ph=L(()=>D({source:$m().describe(`Where to fetch the marketplace from`),installLocation:b().describe(`Local cache path where marketplace manifest is stored`),lastUpdated:b().describe(`ISO 8601 timestamp of last marketplace refresh`),autoUpdate:w().optional().describe(`Whether to automatically update this marketplace and its installed plugins on startup`)})),mh=L(()=>x(b(),ph()))}));function gh(e){let[t,n,...r]=e.split(`__`);return t!==`mcp`||!n?null:{serverName:n,toolName:r.length>0?r.join(`__`):void 0}}function _h(e){return`mcp__${Ai(e)}__`}function vh(e,t){return`${_h(e)}${Ai(t)}`}function yh(e){return e.mcpInfo?vh(e.mcpInfo.serverName,e.mcpInfo.toolName):e.name}function bh(e,t){let n=`mcp__${Ai(t)}__`;return e.replace(n,``)}function xh(e){let t=e.replace(/\s*\(MCP\)\s*$/,``);t=t.trim();let n=t.indexOf(` - `);return n===-1?t:t.substring(n+3).trim()}var Sh=t((()=>{ji()})),Ch,wh,Th,Eh,Dh=t((()=>{Ch=`Agent`,wh=`Task`,Th=`verification`,Eh=new Set([`Explore`,`Plan`])})),Oh,kh=t((()=>{Oh=`TaskOutput`})),Ah,jh,Mh=t((()=>{Ah=`TaskStop`,jh=`
15
+ - Stops a running background task by its ID
16
+ - Takes a task_id parameter identifying the task to stop
17
+ - Returns a success or failure status
18
+ - Use this tool when you need to terminate a long-running task
19
+ `})),Nh=r({BRIEF_PROACTIVE_SECTION:()=>Rh,BRIEF_TOOL_NAME:()=>Ph,BRIEF_TOOL_PROMPT:()=>Lh,DESCRIPTION:()=>Ih,LEGACY_BRIEF_TOOL_NAME:()=>Fh}),Ph,Fh,Ih,Lh,Rh,zh=t((()=>{Ph=`SendUserMessage`,Fh=`Brief`,Ih=`Send a message to the user`,Lh="Send a message the user will read. Text outside this tool is visible in the detail view, but most won't open it — the answer lives here.\n\n`message` supports markdown. `attachments` takes file paths (absolute or cwd-relative) for images, diffs, logs.\n\n`status` labels intent: 'normal' when replying to what they just asked; 'proactive' when you're initiating — a scheduled task finished, a blocker surfaced during background work, you need input on something they haven't asked about. Set it honestly; downstream routing uses it.",Rh=`## Talking to the user
20
+
21
+ ${Ph} is where your replies go. Text outside it is visible if the user expands the detail view, but most won't — assume unread. Anything you want them to actually see goes through ${Ph}. The failure mode: the real answer lives in plain text while ${Ph} just says "done!" — they see "done!" and miss everything.
22
+
23
+ So: every time the user says something, the reply they actually read comes through ${Ph}. Even for "hi". Even for "thanks".
24
+
25
+ If you can answer right away, send the answer. If you need to go look — run a command, read files, check something — ack first in one line ("On it — checking the test output"), then work, then send the result. Without the ack they're staring at a spinner.
26
+
27
+ For longer work: ack → work → result. Between those, send a checkpoint when something useful happened — a decision you made, a surprise you hit, a phase boundary. Skip the filler ("running tests...") — a checkpoint earns its place by carrying information.
28
+
29
+ Keep messages tight — the decision, the file:line, the PR number. Second person always ("your config"), never third.`}));function Bh(e){return Yh[e]??e}function Vh(e){let t=[];for(let[n,r]of Object.entries(Yh))r===e&&t.push(n);return t}function Hh(e){return e.replace(/\\/g,`\\\\`).replace(/\(/g,`\\(`).replace(/\)/g,`\\)`)}function Uh(e){return e.replace(/\\\(/g,`(`).replace(/\\\)/g,`)`).replace(/\\\\/g,`\\`)}function Wh(e){let t=Kh(e,`(`);if(t===-1)return{toolName:Bh(e)};let n=qh(e,`)`);if(n===-1||n<=t||n!==e.length-1)return{toolName:Bh(e)};let r=e.substring(0,t),i=e.substring(t+1,n);if(!r)return{toolName:Bh(e)};if(i===``||i===`*`)return{toolName:Bh(r)};let a=Uh(i);return{toolName:Bh(r),ruleContent:a}}function Gh(e){if(!e.ruleContent)return e.toolName;let t=Hh(e.ruleContent);return`${e.toolName}(${t})`}function Kh(e,t){for(let n=0;n<e.length;n++)if(e[n]===t){let t=0,r=n-1;for(;r>=0&&e[r]===`\\`;)t++,r--;if(t%2==0)return n}return-1}function qh(e,t){for(let n=e.length-1;n>=0;n--)if(e[n]===t){let t=0,r=n-1;for(;r>=0&&e[r]===`\\`;)t++,r--;if(t%2==0)return n}return-1}var Jh,Yh,Xh=t((()=>{Dh(),kh(),Mh(),Jh=(zh(),e(Nh)).BRIEF_TOOL_NAME,Yh={Task:Ch,KillShell:Ah,AgentOutputTool:Oh,BashOutputTool:Oh,...Jh?{Brief:Jh}:{}}}));function Zh(e){return eg.filePatternTools.includes(e)}function Qh(e){return eg.bashPrefixTools.includes(e)}function $h(e){return eg.customValidation[e]}var eg,tg=t((()=>{eg={filePatternTools:[`Read`,`Write`,`Edit`,`Glob`,`NotebookRead`,`NotebookEdit`],bashPrefixTools:[`Bash`],customValidation:{WebSearch:e=>e.includes(`*`)||e.includes(`?`)?{valid:!1,error:`WebSearch does not support wildcards`,suggestion:`Use exact search terms without * or ?`,examples:[`WebSearch(claude ai)`,`WebSearch(typescript tutorial)`]}:{valid:!0},WebFetch:e=>e.includes(`://`)||e.startsWith(`http`)?{valid:!1,error:`WebFetch permissions use domain format, not URLs`,suggestion:`Use "domain:hostname" format`,examples:[`WebFetch(domain:example.com)`,`WebFetch(domain:github.com)`]}:e.startsWith(`domain:`)?{valid:!0}:{valid:!1,error:`WebFetch permissions must use "domain:" prefix`,suggestion:`Use "domain:hostname" format`,examples:[`WebFetch(domain:example.com)`,`WebFetch(domain:*.google.com)`]}}}}));function ng(e,t){let n=0,r=t-1;for(;r>=0&&e[r]===`\\`;)n++,r--;return n%2!=0}function rg(e,t){let n=0;for(let r=0;r<e.length;r++)e[r]===t&&!ng(e,r)&&n++;return n}function ig(e){for(let t=0;t<e.length-1;t++)if(e[t]===`(`&&e[t+1]===`)`&&!ng(e,t))return!0;return!1}function ag(e,t){if(!e||e.trim()===``)return{valid:!1,error:`Permission rule cannot be empty`};if(rg(e,`(`)!==rg(e,`)`))return{valid:!1,error:`Mismatched parentheses`,suggestion:`Ensure all opening parentheses have matching closing parentheses`};if(ig(e)){let t=e.substring(0,e.indexOf(`(`));return t?{valid:!1,error:`Empty parentheses`,suggestion:`Either specify a pattern or use just "${t}" without parentheses`,examples:[`${t}`,`${t}(some-pattern)`]}:{valid:!1,error:`Empty parentheses with no tool name`,suggestion:`Specify a tool name before the parentheses`}}let n=Wh(e),r=gh(n.toolName);if(r)return n.ruleContent!==void 0||rg(e,`(`)>0?{valid:!1,error:`MCP rules do not support patterns in parentheses`,suggestion:`Use "${n.toolName}" without parentheses, or use "mcp__${r.serverName}__*" for all tools`,examples:[`mcp__${r.serverName}`,`mcp__${r.serverName}__*`,r.toolName&&r.toolName!==`*`?`mcp__${r.serverName}__${r.toolName}`:void 0].filter(Boolean)}:{valid:!0};if(!n.toolName||n.toolName.length===0)return{valid:!1,error:`Tool name cannot be empty`};if(n.toolName[0]!==n.toolName[0]?.toUpperCase())return{valid:!1,error:`Tool names must start with uppercase`,suggestion:`Use "${Ni(String(n.toolName))}"`};let i=$h(n.toolName);if(i&&n.ruleContent!==void 0){let e=i(n.ruleContent);if(!e.valid)return e}if(Qh(n.toolName)&&n.ruleContent!==void 0){let e=n.ruleContent;if(e.includes(`:*`)&&!e.endsWith(`:*`))return{valid:!1,error:`The :* pattern must be at the end`,suggestion:`Move :* to the end for prefix matching, or use * for wildcard matching`,examples:[`Bash(npm run:*) - prefix matching (legacy)`,`Bash(npm run *) - wildcard matching`]};if(e===`:*`)return{valid:!1,error:`Prefix cannot be empty before :*`,suggestion:`Specify a command prefix before :*`,examples:[`Bash(npm:*)`,`Bash(git:*)`]}}if(Zh(n.toolName)&&n.ruleContent!==void 0){let e=n.ruleContent;if(e.includes(`:*`))return{valid:!1,error:`The ":*" syntax is only for Bash prefix rules`,suggestion:`Use glob patterns like "*" or "**" for file matching`,examples:[`${n.toolName}(*.ts) - matches .ts files`,`${n.toolName}(src/**) - matches all files in src`,`${n.toolName}(**/*.test.ts) - matches test files`]};if(e.includes(`*`)&&!e.match(/^\*|\*$|\*\*|\/\*|\*\.|\*\)/)&&!e.includes(`**`))return{valid:!1,error:`Wildcard placement might be incorrect`,suggestion:`Wildcards are typically used at path boundaries`,examples:[`${n.toolName}(*.js) - all .js files`,`${n.toolName}(src/*) - all files directly in src`,`${n.toolName}(src/**) - all files recursively in src`]}}if(n&&n.toolName===`VaultHttpFetch`&&n.ruleContent!==void 0){let e=n.ruleContent;if(e.length>384)return{valid:!1,error:`VaultHttpFetch rule content is too long (${e.length} chars; max 384)`,suggestion:`Use a shorter key name and host, or use the wildcard form <key>@*`};if(/[\x00-\x1F\x7F]/.test(e))return{valid:!1,error:`VaultHttpFetch rule content contains control characters (only printable ASCII allowed in key@host)`,suggestion:`Remove control characters from the rule content`}}if(n&&n.toolName===`VaultHttpFetch`&&t===`deny`&&n.ruleContent!==void 0&&!/^[A-Za-z0-9._-]{1,128}@(?:\*|(?:\[[A-Fa-f0-9:]+\]|[A-Za-z0-9.-]{1,253})(?::(?:[1-9]\d{0,3}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-5]))?)$/.test(n.ruleContent))return{valid:!1,error:`VaultHttpFetch deny rule content must be '<key>@<host>' or '<key>@*' (or whole-tool deny without parentheses for kill switch)`,suggestion:`Found '${n.ruleContent}'. Use 'VaultHttpFetch' (no parens) for kill switch, or 'VaultHttpFetch(${n.ruleContent}@*)' for any-host.`,examples:[`VaultHttpFetch — whole-tool kill switch`,`VaultHttpFetch(${n.ruleContent}@api.github.com)`,`VaultHttpFetch(${n.ruleContent}@*)`]};if(t===`allow`&&n){if(n.ruleContent===void 0&&og.has(n.toolName))return{valid:!1,error:`Whole-tool allow forbidden for vault tool '${n.toolName}'`,suggestion:`Use per-key + per-host allow: '${n.toolName}(your-key-name@host)'`,examples:[`${n.toolName}(github-token@api.github.com)`,`${n.toolName}(my-api@*) - allow any host (advanced)`]};if(n.toolName===`VaultHttpFetch`&&n.ruleContent!==void 0&&!/^[A-Za-z0-9._-]{1,128}@(?:\*|(?:\[[A-Fa-f0-9:]+\]|[A-Za-z0-9.-]{1,253})(?::(?:[1-9]\d{0,3}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-5]))?)$/.test(n.ruleContent))return{valid:!1,error:`VaultHttpFetch rule content must be '<key>@<host>' or '<key>@*'`,suggestion:`Found '${n.ruleContent}'. Use e.g. 'github-token@api.github.com' or 'admin-key@127.0.0.1:8443' to bind a key to a host.`,examples:[`VaultHttpFetch(github-token@api.github.com)`,`VaultHttpFetch(local-admin@localhost:8443)`,`VaultHttpFetch(stripe-key@*) - any host (advanced)`]}}return{valid:!0}}var og,sg,cg=t((()=>{Je(),Sh(),Ei(),Xh(),Pi(),tg(),og=new Set([`LocalVaultFetch`,`VaultHttpFetch`]),sg=L(()=>b().superRefine((e,t)=>{let n=ag(e);if(!n.valid){let r=n.error;n.suggestion&&(r+=`. ${n.suggestion}`),n.examples&&n.examples.length>0&&(r+=`. Examples: ${n.examples.join(`, `)}`),t.addIssue({code:qe.custom,message:r,params:{received:e}})}}))}));function lg(e){return`serverName`in e&&e.serverName!==void 0}function ug(e){return`serverCommand`in e&&e.serverCommand!==void 0}function dg(e){return`serverUrl`in e&&e.serverUrl!==void 0}var fg,pg,mg,hg,gg,_g,vg,yg=t((()=>{Je(),Hp(),h(),Ei(),am(),hh(),Np(),cg(),gm(),Ci(),fg=L(()=>x(b(),Ge())),pg=L(()=>D({allow:S(sg()).optional().describe(`List of permission rules for allowed operations`),deny:S(sg()).optional().describe(`List of permission rules for denied operations`),ask:S(sg()).optional().describe(`List of permission rules that should always prompt for confirmation`),defaultMode:E(Oi).optional().describe(`Default permission mode when Claude Code needs access`),disableBypassPermissionsMode:E([`disable`]).optional().describe(`Disable the ability to bypass permission prompts`),disableAutoMode:E([`disable`]).optional().describe(`Disable auto mode`),additionalDirectories:S(b()).optional().describe(`Additional directories to include in the permission scope`)}).passthrough()),mg=L(()=>D({source:$m().describe(`Where to fetch the marketplace from`),installLocation:b().optional().describe(`Local cache path where marketplace manifest is stored (auto-generated if not provided)`),autoUpdate:w().optional().describe(`Whether to automatically update this marketplace and its installed plugins on startup`)})),hg=L(()=>D({serverName:b().regex(/^[a-zA-Z0-9_-]+$/,`Server name can only contain letters, numbers, hyphens, and underscores`).optional().describe(`Name of the MCP server that users are allowed to configure`),serverCommand:S(b()).min(1,`Server command must have at least one element (the command)`).optional().describe(`Command array [command, ...args] to match exactly for allowed stdio servers`),serverUrl:b().optional().describe(`URL pattern with wildcard support (e.g., "https://*.example.com/*") for allowed remote MCP servers`)}).refine(e=>vi([e.serverName!==void 0,e.serverCommand!==void 0,e.serverUrl!==void 0],Boolean)===1,{message:`Entry must have exactly one of "serverName", "serverCommand", or "serverUrl"`})),gg=L(()=>D({serverName:b().regex(/^[a-zA-Z0-9_-]+$/,`Server name can only contain letters, numbers, hyphens, and underscores`).optional().describe(`Name of the MCP server that is explicitly blocked`),serverCommand:S(b()).min(1,`Server command must have at least one element (the command)`).optional().describe(`Command array [command, ...args] to match exactly for blocked stdio servers`),serverUrl:b().optional().describe(`URL pattern with wildcard support (e.g., "https://*.example.com/*") for blocked remote MCP servers`)}).refine(e=>vi([e.serverName!==void 0,e.serverCommand!==void 0,e.serverUrl!==void 0],Boolean)===1,{message:`Entry must have exactly one of "serverName", "serverCommand", or "serverUrl"`})),_g=[`skills`,`agents`,`hooks`,`mcp`],vg=L(()=>D({$schema:T(Mp).optional().describe(`JSON Schema reference for Claude Code settings`),apiKeyHelper:b().optional().describe(`Path to a script that outputs authentication values`),awsCredentialExport:b().optional().describe(`Path to a script that exports AWS credentials`),awsAuthRefresh:b().optional().describe(`Path to a script that refreshes AWS authentication`),gcpAuthRefresh:b().optional().describe(`Command to refresh GCP authentication (e.g., gcloud auth application-default login)`),...g(process.env.CLAUDE_CODE_ENABLE_XAA)?{xaaIdp:D({issuer:b().url().describe(`IdP issuer URL for OIDC discovery`),clientId:b().describe(`Claude Code's client_id registered at the IdP`),callbackPort:y().int().positive().optional().describe(`Fixed loopback callback port for the IdP OIDC login. Only needed if the IdP does not honor RFC 8252 port-any matching.`)}).optional().describe(`XAA (SEP-990) IdP connection. Configure once; all XAA-enabled MCP servers reuse this.`)}:{},fileSuggestion:D({type:T(`command`),command:b()}).optional().describe(`Custom file suggestion configuration for @ mentions`),respectGitignore:w().optional().describe(`Whether file picker should respect .gitignore files (default: true). Note: .ignore files are always respected.`),cleanupPeriodDays:y().nonnegative().int().optional().describe(`Number of days to retain chat transcripts (default: 30). Setting to 0 disables session persistence entirely: no transcripts are written and existing transcripts are deleted at startup.`),env:fg().optional().describe(`Environment variables to set for Claude Code sessions`),attribution:D({commit:b().optional().describe(`Attribution text for git commits, including any trailers. Empty string hides attribution.`),pr:b().optional().describe(`Attribution text for pull request descriptions. Empty string hides attribution.`)}).optional().describe(`Customize attribution text for commits and PRs. Each field defaults to the standard Claude Code attribution if not set.`),includeCoAuthoredBy:w().optional().describe(`Deprecated: Use attribution instead. Whether to include Claude's co-authored by attribution in commits and PRs (defaults to true)`),includeGitInstructions:w().optional().describe(`Include built-in commit and PR workflow instructions in Claude's system prompt (default: true)`),permissions:pg().optional().describe(`Tool usage permissions configuration`),modelType:E([`anthropic`,`openai`,`gemini`,`grok`]).optional().describe(`API provider type. "anthropic" uses the Anthropic API (default), "openai" uses the OpenAI Chat Completions API, "gemini" uses the Gemini API, and "grok" uses the xAI Grok API (OpenAI-compatible). When set to "openai", configure OPENAI_API_KEY, OPENAI_BASE_URL, and OPENAI_MODEL. When set to "gemini", configure GEMINI_API_KEY and optional GEMINI_BASE_URL. When set to "grok", configure GROK_API_KEY (or XAI_API_KEY), optional GROK_BASE_URL, GROK_MODEL, and GROK_MODEL_MAP.`),model:b().optional().describe(`Override the default model used by Claude Code`),availableModels:S(b()).optional().describe(`Allowlist of models that users can select. Accepts family aliases ("opus" allows any opus version), version prefixes ("opus-4-5" allows only that version), and full model IDs. If undefined, all models are available. If empty array, only the default model is available. Typically set in managed settings by enterprise administrators.`),modelOverrides:x(b(),b()).optional().describe(`Override mapping from Anthropic model ID (e.g. "claude-opus-4-6") to provider-specific model ID (e.g. a Bedrock inference profile ARN). Typically set in managed settings by enterprise administrators.`),enableAllProjectMcpServers:w().optional().describe(`Whether to automatically approve all MCP servers in the project`),enabledMcpjsonServers:S(b()).optional().describe(`List of approved MCP servers from .mcp.json`),disabledMcpjsonServers:S(b()).optional().describe(`List of rejected MCP servers from .mcp.json`),allowedMcpServers:S(hg()).optional().describe(`Enterprise allowlist of MCP servers that can be used. Applies to all scopes including enterprise servers from managed-mcp.json. If undefined, all servers are allowed. If empty array, no servers are allowed. Denylist takes precedence - if a server is on both lists, it is denied.`),deniedMcpServers:S(gg()).optional().describe(`Enterprise denylist of MCP servers that are explicitly blocked. If a server is on the denylist, it will be blocked across all scopes including enterprise. Denylist takes precedence over allowlist - if a server is on both lists, it is denied.`),hooks:hm().optional().describe(`Custom commands to run before/after tool executions`),worktree:D({symlinkDirectories:S(b()).optional().describe(`Directories to symlink from main repository to worktrees to avoid disk bloat. Must be explicitly configured - no directories are symlinked by default. Common examples: "node_modules", ".cache", ".bin"`),sparsePaths:S(b()).optional().describe(`Directories to include when creating worktrees, via git sparse-checkout (cone mode). Dramatically faster in large monorepos — only the listed paths are written to disk.`)}).optional().describe(`Git worktree configuration for --worktree flag.`),disableAllHooks:w().optional().describe(`Disable all hooks and statusLine execution`),defaultShell:E([`bash`,`powershell`]).optional().describe(`Default shell for input-box ! commands. Defaults to 'bash' on all platforms (no Windows auto-flip).`),allowManagedHooksOnly:w().optional().describe(`When true (and set in managed settings), only hooks from managed settings run. User, project, and local hooks are ignored.`),allowedHttpHookUrls:S(b()).optional().describe(`Allowlist of URL patterns that HTTP hooks may target. Supports * as a wildcard (e.g. "https://hooks.example.com/*"). When set, HTTP hooks with non-matching URLs are blocked. If undefined, all URLs are allowed. If empty array, no HTTP hooks are allowed. Arrays merge across settings sources (same semantics as allowedMcpServers).`),httpHookAllowedEnvVars:S(b()).optional().describe(`Allowlist of environment variable names HTTP hooks may interpolate into headers. When set, each hook's effective allowedEnvVars is the intersection with this list. If undefined, no restriction is applied. Arrays merge across settings sources (same semantics as allowedMcpServers).`),allowManagedPermissionRulesOnly:w().optional().describe(`When true (and set in managed settings), only permission rules (allow/deny/ask) from managed settings are respected. User, project, local, and CLI argument permission rules are ignored.`),allowManagedMcpServersOnly:w().optional().describe(`When true (and set in managed settings), allowedMcpServers is only read from managed settings. deniedMcpServers still merges from all sources, so users can deny servers for themselves. Users can still add their own MCP servers, but only the admin-defined allowlist applies.`),strictPluginOnlyCustomization:He(e=>Array.isArray(e)?e.filter(e=>_g.includes(e)):e,C([w(),S(E(_g))])).optional().catch(void 0).describe('When set in managed settings, blocks non-plugin customization sources for the listed surfaces. Array form locks specific surfaces (e.g. ["skills", "hooks"]); `true` locks all four; `false` is an explicit no-op. Blocked: ~/.claude/{surface}/, .claude/{surface}/ (project), settings.json hooks, .mcp.json. NOT blocked: managed (policySettings) sources, plugin-provided customizations. Composes with strictKnownMarketplaces for end-to-end admin control — plugins gated by marketplace allowlist, everything else blocked here.'),statusLine:D({type:T(`command`),command:b(),padding:y().optional(),refreshInterval:y().optional()}).optional().describe(`Custom status line display configuration`),statusLineEnabled:w().optional().describe(`Whether to render the fork built-in status line (model + ctx + 5h/7d limits + cost + cache pill). Toggled with /statusline.`),enabledPlugins:x(b(),C([S(b()),w(),Be()])).optional().describe(`Enabled plugins using plugin-id@marketplace-id format. Example: { "formatter@anthropic-tools": true }. Also supports extended format with version constraints.`),extraKnownMarketplaces:x(b(),mg()).check(e=>{for(let[t,n]of Object.entries(e.value))n.source.source===`settings`&&n.source.name!==t&&e.issues.push({code:`custom`,input:n.source.name,path:[t,`source`,`name`],message:`Settings-sourced marketplace name must match its extraKnownMarketplaces key (got key "${t}" but source.name "${n.source.name}")`})}).optional().describe(`Additional marketplaces to make available for this repository. Typically used in repository .claude/settings.json to ensure team members have required plugin sources.`),strictKnownMarketplaces:S($m()).optional().describe(`Enterprise strict list of allowed marketplace sources. When set in managed settings, ONLY these exact sources can be added as marketplaces. The check happens BEFORE downloading, so blocked sources never touch the filesystem. Note: this is a policy gate only — it does NOT register marketplaces. To pre-register allowed marketplaces for users, also set extraKnownMarketplaces.`),blockedMarketplaces:S($m()).optional().describe(`Enterprise blocklist of marketplace sources. When set in managed settings, these exact sources are blocked from being added as marketplaces. The check happens BEFORE downloading, so blocked sources never touch the filesystem.`),forceLoginMethod:E([`claudeai`,`console`]).optional().describe(`Force a specific login method: "claudeai" for Claude Pro/Max, "console" for Console billing`),forceLoginOrgUUID:b().optional().describe(`Organization UUID to use for OAuth login`),otelHeadersHelper:b().optional().describe(`Path to a script that outputs OpenTelemetry headers`),outputStyle:b().optional().describe(`Controls the output style for assistant responses`),language:b().optional().describe(`Preferred language for Claude responses and voice dictation (e.g., "japanese", "spanish")`),skipWebFetchPreflight:w().optional().describe(`Skip the WebFetch blocklist check for enterprise environments with restrictive security policies`),webSearchAdapter:E([`api`,`bing`,`brave`,`exa`,`tavily`]).optional().describe(`Web search backend adapter. "tavily" uses Tavily Search API (default), "api" uses Anthropic server-side search, "bing" scrapes Bing HTML, "brave" uses Brave Search API, "exa" uses Exa AI.`),webFetchAdapter:E([`tavily`,`http`]).optional().describe(`Web fetch backend. "tavily" uses Tavily Extract API which returns Markdown directly (default), "http" fetches the URL directly via HTTP.`),tavilyEndpointUrl:b().optional().describe(`Custom Tavily API endpoint URL. Defaults to https://tavily.claude-code-best.win. Used by both WebSearch and WebFetch when tavily adapter is selected.`),braveApiKey:b().optional().describe(`Brave Search API key. Required when using the brave web search adapter.`),webFetchHttpTimeoutMs:y().int().positive().optional().describe(`HTTP timeout in milliseconds for the HTTP direct web fetch backend. Defaults to 60000 (60s).`),exaApiKey:b().optional().describe(`Exa AI API key. Required when using the exa web search adapter.`),exaEndpointUrl:b().optional().describe(`Custom Exa AI MCP endpoint URL. Defaults to https://mcp.exa.ai/mcp.`),sandbox:Vp().optional(),feedbackSurveyRate:y().min(0).max(1).optional().describe(`Probability (0–1) that the session quality survey appears when eligible. 0.05 is a reasonable starting point.`),spinnerTipsEnabled:w().optional().describe(`Whether to show tips in the spinner`),spinnerVerbs:D({mode:E([`append`,`replace`]),verbs:S(b())}).optional().describe(`Customize spinner verbs. mode: "append" adds verbs to defaults, "replace" uses only your verbs.`),spinnerTipsOverride:D({excludeDefault:w().optional(),tips:S(b())}).optional().describe(`Override spinner tips. tips: array of tip strings. excludeDefault: if true, only show custom tips (default: false).`),syntaxHighlightingDisabled:w().optional().describe(`Whether to disable syntax highlighting in diffs`),terminalTitleFromRename:w().optional().describe(`Whether /rename updates the terminal tab title (defaults to true). Set to false to keep auto-generated topic titles.`),alwaysThinkingEnabled:w().optional().describe(`When false, thinking is disabled. When absent or true, thinking is enabled automatically for supported models.`),effortLevel:E(process.env.USER_TYPE===`ant`?[`low`,`medium`,`high`,`xhigh`,`max`]:[`low`,`medium`,`high`,`xhigh`]).optional().catch(void 0).describe(`Persisted effort level for supported models.`),advisorModel:b().optional().describe(`Advisor model for the server-side advisor tool.`),fastMode:w().optional().describe(`When true, fast mode is enabled. When absent or false, fast mode is off.`),fastModePerSessionOptIn:w().optional().describe(`When true, fast mode does not persist across sessions. Each session starts with fast mode off.`),promptSuggestionEnabled:w().optional().describe(`When false, prompt suggestions are disabled. When absent or true, prompt suggestions are enabled.`),poorMode:w().optional().describe(`When true, poor mode is active — extract_memories and prompt_suggestion are disabled to save tokens.`),showClearContextOnPlanAccept:w().optional().describe(`When true, the plan-approval dialog offers a "clear context" option. Defaults to false.`),agent:b().optional().describe(`Name of an agent (built-in or custom) to use for the main thread. Applies the agent's system prompt, tool restrictions, and model.`),companyAnnouncements:S(b()).optional().describe(`Company announcements to display at startup (one will be randomly selected if multiple are provided)`),pluginConfigs:x(b(),D({mcpServers:x(b(),x(b(),C([b(),y(),w(),S(b())]))).optional().describe(`User configuration values for MCP servers keyed by server name`),options:x(b(),C([b(),y(),w(),S(b())])).optional().describe(`Non-sensitive option values from plugin manifest userConfig, keyed by option name. Sensitive values go to secure storage instead.`)})).optional().describe(`Per-plugin configuration including MCP server user configs, keyed by plugin ID (plugin@marketplace format)`),remote:D({defaultEnvironmentId:b().optional().describe(`Default environment ID to use for remote sessions`)}).optional().describe(`Remote session configuration`),autoUpdatesChannel:E([`latest`,`stable`]).optional().describe(`Release channel for auto-updates (latest or stable)`),disableDeepLinkRegistration:E([`disable`]).optional().describe(`Prevent claude-cli:// protocol handler registration with the OS`),minimumVersion:b().optional().describe(`Minimum version to stay on - prevents downgrades when switching to stable channel`),plansDirectory:b().optional().describe(`Custom directory for plan files, relative to project root. If not set, defaults to ~/.claude/plans/`),...process.env.USER_TYPE===`ant`?{classifierPermissionsEnabled:w().optional().describe(`Enable AI-based classification for Bash(prompt:...) permission rules`)}:{},minSleepDurationMs:y().nonnegative().int().optional().describe(`Minimum duration in milliseconds that the Sleep tool must sleep for. Useful for throttling proactive tick frequency.`),maxSleepDurationMs:y().int().min(-1).optional().describe(`Maximum duration in milliseconds that the Sleep tool can sleep for. Set to -1 for indefinite sleep (waits for user input). Useful for limiting idle time in remote/managed environments.`),voiceEnabled:w().optional().describe(`Enable voice mode (hold-to-talk dictation)`),voiceProvider:E([`anthropic`,`doubao`]).optional().describe(`Voice STT backend: "anthropic" (default) or "doubao" (Doubao ASR)`),assistant:w().optional().describe(`Start Claude in assistant mode (custom system prompt, brief view, scheduled check-in skills)`),assistantName:b().optional().describe(`Display name for the assistant, shown in the claude.ai session list`),channelsEnabled:w().optional().describe(`Teams/Enterprise opt-in for channel notifications (MCP servers with the claude/channel capability pushing inbound messages). Default off. Set true to allow; users then select servers via --channels.`),allowedChannelPlugins:S(D({marketplace:b(),plugin:b()})).optional().describe(`Teams/Enterprise allowlist of channel plugins. When set, replaces the default Anthropic allowlist — admins decide which plugins may push inbound messages. Undefined falls back to the default. Requires channelsEnabled: true.`),defaultView:E([`chat`,`transcript`]).optional().describe(`Default transcript view: chat (SendUserMessage checkpoints only) or transcript (full)`),prefersReducedMotion:w().optional().describe(`Reduce or disable animations for accessibility (spinner shimmer, flash effects, etc.)`),autoMemoryEnabled:w().optional().describe(`Enable auto-memory for this project. When false, Claude will not read from or write to the auto-memory directory.`),autoMemoryDirectory:b().optional().describe(`Custom directory path for auto-memory storage. Supports ~/ prefix for home directory expansion. Ignored if set in projectSettings (checked-in .claude/settings.json) for security. When unset, defaults to ~/.claude/projects/<sanitized-cwd>/memory/.`),autoDreamEnabled:w().optional().describe(`Enable background memory consolidation (auto-dream). When set, overrides the server-side default.`),showThinkingSummaries:w().optional().describe(`Show thinking summaries in the transcript view (ctrl+o). Default: false.`),skipDangerousModePermissionPrompt:w().optional().describe(`Whether the user has accepted the bypass permissions mode dialog`),skipAutoPermissionPrompt:w().optional().describe(`Whether the user has accepted the auto mode opt-in dialog`),useAutoModeDuringPlan:w().optional().describe(`Whether plan mode uses auto mode semantics when auto mode is available (default: true)`),autoMode:D({allow:S(b()).optional().describe(`Rules for the auto mode classifier allow section`),soft_deny:S(b()).optional().describe(`Rules for the auto mode classifier deny section`),...process.env.USER_TYPE===`ant`?{deny:S(b()).optional()}:{},environment:S(b()).optional().describe(`Entries for the auto mode classifier environment section`)}).optional().describe(`Auto mode classifier prompt customization`),disableAutoMode:E([`disable`]).optional().describe(`Disable auto mode`),sshConfigs:S(D({id:b().describe(`Unique identifier for this SSH config. Used to match configs across settings sources.`),name:b().describe(`Display name for the SSH connection`),sshHost:b().describe(`SSH host in format "user@hostname" or "hostname", or a host alias from ~/.ssh/config`),sshPort:y().int().optional().describe(`SSH port (default: 22)`),sshIdentityFile:b().optional().describe(`Path to SSH identity file (private key)`),startDirectory:b().optional().describe("Default working directory on the remote host. Supports tilde expansion (e.g. ~/projects). If not specified, defaults to the remote user home directory. Can be overridden by the [dir] positional argument in `claude ssh <config> [dir]`.")})).optional().describe(`SSH connection configurations for remote environments. Typically set in managed settings by enterprise administrators to pre-configure SSH connections for team members.`),claudeMdExcludes:S(b()).optional().describe(`Glob patterns or absolute paths of CLAUDE.md files to exclude from loading. Patterns are matched against absolute file paths using picomatch. Only applies to User, Project, and Local memory types (Managed/policy files cannot be excluded). Examples: "/home/user/monorepo/CLAUDE.md", "**/code/CLAUDE.md", "**/some-dir/.claude/rules/**"`),cacheThreshold:y().int().min(0).max(100).optional().describe(`Prompt cache hit rate threshold (0-100). Warnings shown when cache hit rate falls below this percentage. Default: 80.`),cacheWarningEnabled:w().optional().describe(`Whether to show cache hit rate warnings in the message flow when the rate falls below cacheThreshold. Default: true.`),pluginTrustMessage:b().optional().describe(`Custom message to append to the plugin trust warning shown before installation. Only read from policy settings (managed-settings.json / MDM). Useful for enterprise administrators to add organization-specific context (e.g., "All plugins from our internal marketplace are vetted and approved.").`),workspaceApiKey:b().optional().describe(`Workspace API key (sk-ant-api03-*) saved via /login UI. Stored in plaintext — keep this file gitignored and restrict its permissions. ANTHROPIC_API_KEY environment variable takes precedence when both are set.`)}).passthrough())}));function bg(){return k(ze(vg(),{unrepresentable:`any`}),null,2)}var xg=t((()=>{Je(),An(),yg()}));function Sg(e){let t=wg.find(t=>t.matches(e));if(!t)return null;let n={...t.tip};if(e.code===`invalid_value`&&e.enumValues&&!n.suggestion&&(n.suggestion=`Valid values: ${e.enumValues.map(e=>`"${e}"`).join(`, `)}`),!n.docLink&&e.path){let t=e.path.split(`.`)[0];t&&(n.docLink=Tg[t])}return n}var Cg,wg,Tg,Eg=t((()=>{Cg=`https://code.claude.com/docs/en`,wg=[{matches:e=>e.path===`permissions.defaultMode`&&e.code===`invalid_value`,tip:{suggestion:`Valid modes: "acceptEdits" (ask before file changes), "plan" (analysis only), "bypassPermissions" (auto-accept all), or "default" (standard behavior)`,docLink:`${Cg}/iam#permission-modes`}},{matches:e=>e.path===`apiKeyHelper`&&e.code===`invalid_type`,tip:{suggestion:`Provide a shell command that outputs your API key to stdout. The script should output only the API key. Example: "/bin/generate_temp_api_key.sh"`}},{matches:e=>e.path===`cleanupPeriodDays`&&e.code===`too_small`&&e.expected===`0`,tip:{suggestion:`Must be 0 or greater. Set a positive number for days to retain transcripts (default is 30). Setting 0 disables session persistence entirely: no transcripts are written and existing transcripts are deleted at startup.`}},{matches:e=>e.path.startsWith(`env.`)&&e.code===`invalid_type`,tip:{suggestion:`Environment variables must be strings. Wrap numbers and booleans in quotes. Example: "DEBUG": "true", "PORT": "3000"`,docLink:`${Cg}/settings#environment-variables`}},{matches:e=>(e.path===`permissions.allow`||e.path===`permissions.deny`)&&e.code===`invalid_type`&&e.expected===`array`,tip:{suggestion:`Permission rules must be in an array. Format: ["Tool(specifier)"]. Examples: ["Bash(npm run build)", "Edit(docs/**)", "Read(~/.zshrc)"]. Use * for wildcards.`}},{matches:e=>e.path.includes(`hooks`)&&e.code===`invalid_type`,tip:{suggestion:`Hooks use a matcher + hooks array. The matcher is a string: a tool name ("Bash"), pipe-separated list ("Edit|Write"), or empty to match all. Example: {"PostToolUse": [{"matcher": "Edit|Write", "hooks": [{"type": "command", "command": "echo Done"}]}]}`}},{matches:e=>e.code===`invalid_type`&&e.expected===`boolean`,tip:{suggestion:`Use true or false without quotes. Example: "includeCoAuthoredBy": true`}},{matches:e=>e.code===`unrecognized_keys`,tip:{suggestion:`Check for typos or refer to the documentation for valid fields`,docLink:`${Cg}/settings`}},{matches:e=>e.code===`invalid_value`&&e.enumValues!==void 0,tip:{suggestion:void 0}},{matches:e=>e.code===`invalid_type`&&e.expected===`object`&&e.received===null&&e.path===``,tip:{suggestion:`Check for missing commas, unmatched brackets, or trailing commas. Use a JSON validator to identify the exact syntax error.`}},{matches:e=>e.path===`permissions.additionalDirectories`&&e.code===`invalid_type`,tip:{suggestion:`Must be an array of directory paths. Example: ["~/projects", "/tmp/workspace"]. You can also use --add-dir flag or /add-dir command`,docLink:`${Cg}/iam#working-directories`}}],Tg={permissions:`${Cg}/iam#configuring-permissions`,env:`${Cg}/settings#environment-variables`,hooks:`${Cg}/hooks`}}));function Dg(e){return e.code===`invalid_type`}function Og(e){return e.code===`invalid_value`}function kg(e){return e.code===`unrecognized_keys`}function Ag(e){return e.code===`too_small`}function jg(e){return e===null?`null`:e===void 0?`undefined`:Array.isArray(e)?`array`:typeof e}function Mg(e){let t=e.match(/received (\w+)/);return t?t[1]:void 0}function Ng(e,t){return e.issues.map(e=>{let n=e.path.map(String).join(`.`),r=e.message,i,a,o,s,c;if(Og(e))a=e.values.map(e=>String(e)),o=a.join(` | `),s=void 0,c=void 0;else if(Dg(e)){o=e.expected;let t=Mg(e.message);s=t??jg(e.input),c=t??jg(e.input)}else Ag(e)?o=String(e.minimum):e.code===`custom`&&`params`in e&&(s=e.params.received,c=s);let l=Sg({path:n,code:e.code,expected:o,received:s,enumValues:a,message:e.message,value:s});if(Og(e))i=a?.map(e=>`"${e}"`).join(`, `),r=`Invalid value. Expected one of: ${i}`;else if(Dg(e)){let t=Mg(e.message)??jg(e.input);r=e.expected===`object`&&t===`null`&&n===``?`Invalid or malformed JSON`:`Expected ${e.expected}, but received ${t}`}else if(kg(e)){let t=e.keys.join(`, `);r=`Unrecognized ${Mi(e.keys.length,`field`)}: ${t}`}else Ag(e)&&(r=`Number must be greater than or equal to ${e.minimum}`,i=String(e.minimum));return{file:t,path:n,message:r,expected:i,invalidValue:c,suggestion:l?.suggestion,docLink:l?.docLink}})}function Pg(e){try{let t=kn(e),n=vg().strict().safeParse(t);return n.success?{isValid:!0}:{isValid:!1,error:`Settings validation failed:
30
+ `+Ng(n.error,`settings`).map(e=>`- ${e.path}: ${e.message}`).join(`
31
+ `),fullSchema:bg()}}catch(e){return{isValid:!1,error:`Invalid JSON: ${e instanceof Error?e.message:`Unknown parsing error`}`,fullSchema:bg()}}}function Fg(e,t){if(!e||typeof e!=`object`)return[];let n=e;if(!n.permissions||typeof n.permissions!=`object`)return[];let r=n.permissions,i=[];for(let e of[`allow`,`deny`,`ask`]){let n=r[e];Array.isArray(n)&&(r[e]=n.filter(n=>{if(typeof n!=`string`)return i.push({file:t,path:`permissions.${e}`,message:`Non-string value in ${e} array was removed`,invalidValue:n}),!1;let r=ag(n,e);if(!r.valid){let a=`Invalid permission rule "${n}" was skipped`;return r.error&&(a+=`: ${r.error}`),r.suggestion&&(a+=`. ${r.suggestion}`),i.push({file:t,path:`permissions.${e}`,message:a,invalidValue:n}),!1}return!0}))}return i}var Ig=t((()=>{An(),Pi(),cg(),xg(),yg(),Eg()}));function Lg(){let e=``;try{e=Gi().username}catch{}let t=[];return e&&t.push({path:`/Library/Managed Preferences/${e}/${Rg}.plist`,label:`per-user managed preferences`}),t.push({path:`/Library/Managed Preferences/${Rg}.plist`,label:`device-level managed preferences`}),process.env.USER_TYPE===`ant`&&t.push({path:R(Wi(),`Library`,`Preferences`,`${Rg}.plist`),label:`user preferences (ant-only)`}),t}var Rg,zg,Bg,Vg,Hg,Ug,Wg,Gg=t((()=>{Rg=`com.anthropic.claudecode`,zg=`HKLM\\SOFTWARE\\Policies\\ClaudeCode`,Bg=`HKCU\\SOFTWARE\\Policies\\ClaudeCode`,Vg=`Settings`,Hg=`/usr/bin/plutil`,Ug=[`-convert`,`json`,`-o`,`-`,`--`],Wg=5e3}));function Kg(e,t){return new Promise(n=>{ba(e,t,{encoding:`utf-8`,timeout:Wg},(e,t)=>{n({stdout:t??``,code:+!!e})})})}function qg(){return(async()=>{if(process.platform===`darwin`){let e=Lg(),t=(await Promise.all(e.map(async({path:e,label:t})=>{if(!na(e))return{stdout:``,label:t,ok:!1};let{stdout:n,code:r}=await Kg(Hg,[...Ug,e]);return{stdout:n,label:t,ok:r===0&&!!n}}))).find(e=>e.ok);return{plistStdouts:t?[{stdout:t.stdout,label:t.label}]:[],hklmStdout:null,hkcuStdout:null}}if(process.platform===`win32`){let[e,t]=await Promise.all([Kg(`reg`,[`query`,zg,`/v`,Vg]),Kg(`reg`,[`query`,Bg,`/v`,Vg])]);return{plistStdouts:null,hklmStdout:e.code===0?e.stdout:null,hkcuStdout:t.code===0?t.stdout:null}}return{plistStdouts:null,hklmStdout:null,hkcuStdout:null}})()}function Jg(){Xg||(Xg=qg())}function Yg(){return Xg}var Xg,Zg=t((()=>{Gg(),Xg=null}));function Qg(){d_||(d_=(async()=>{wi(`mdm_load_start`);let e=Date.now(),{mdm:t,hkcu:n}=o_(await(Yg()??qg()));l_=t,u_=n,wi(`mdm_load_end`);let r=Date.now()-e;if(M(`MDM settings load completed in ${r}ms`),Object.keys(t.settings).length>0){M(`MDM settings found: ${Object.keys(t.settings).join(`, `)}`);try{yr(`info`,`mdm_settings_loaded`,{duration_ms:r,key_count:Object.keys(t.settings).length,error_count:t.errors.length})}catch{}}})())}async function $g(){d_||Qg(),await d_}function e_(){return l_??c_}function t_(){return u_??c_}function n_(e,t){l_=e,u_=t}async function r_(){return o_(await qg())}function i_(e,t){let n=fi(e,!1);if(!n||typeof n!=`object`)return{settings:{},errors:[]};let r=Fg(n,t),i=vg().safeParse(n);if(!i.success){let e=Ng(i.error,t);return{settings:{},errors:[...r,...e]}}return{settings:i.data,errors:r}}function a_(e,t=`Settings`){let n=e.split(/\r?\n/),r=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),i=RegExp(`^\\s+${r}\\s+REG_(?:EXPAND_)?SZ\\s+(.*)$`,`i`);for(let e of n){let t=e.match(i);if(t&&t[1])return t[1].trimEnd()}return null}function o_(e){if(e.plistStdouts&&e.plistStdouts.length>0){let{stdout:t,label:n}=e.plistStdouts[0],r=i_(t,n);if(Object.keys(r.settings).length>0)return{mdm:r,hkcu:c_}}if(e.hklmStdout){let t=a_(e.hklmStdout);if(t){let e=i_(t,`Registry: ${zg}\\${Vg}`);if(Object.keys(e.settings).length>0)return{mdm:e,hkcu:c_}}}if(s_())return{mdm:c_,hkcu:c_};if(e.hkcuStdout){let t=a_(e.hkcuStdout);if(t)return{mdm:c_,hkcu:i_(t,`Registry: ${Bg}\\${Vg}`)}}return{mdm:c_,hkcu:c_}}function s_(){try{let e=fi(Pd(R(df(),`managed-settings.json`)),!1);if(e&&typeof e==`object`&&Object.keys(e).length>0)return!0}catch{}try{let e=ff(),t=A().readdirSync(e);for(let n of t)if(!(!(n.isFile()||n.isSymbolicLink())||!n.name.endsWith(`.json`)||n.name.startsWith(`.`)))try{let t=fi(Pd(R(e,n.name)),!1);if(t&&typeof t==`object`&&Object.keys(t).length>0)return!0}catch{}}catch{}return!1}var c_,l_,u_,d_,f_=t((()=>{j(),br(),Fd(),Vn(),di(),Ti(),pf(),yg(),Ig(),Gg(),Zg(),c_=Object.freeze({settings:{},errors:[]}),l_=null,u_=null,d_=null}));function p_(){return R(df(),`managed-settings.json`)}function m_(){let e=[],t={},n=!1,{settings:r,errors:i}=__(p_());e.push(...i),r&&Object.keys(r).length>0&&(t=vu(t,r,D_),n=!0);let a=ff();try{let r=A().readdirSync(a).filter(e=>(e.isFile()||e.isSymbolicLink())&&e.name.endsWith(`.json`)&&!e.name.startsWith(`.`)).map(e=>e.name).sort();for(let i of r){let{settings:r,errors:o}=__(R(a,i));e.push(...o),r&&Object.keys(r).length>0&&(t=vu(t,r,D_),n=!0)}}catch(e){let t=Dn(e);t!==`ENOENT`&&t!==`ENOTDIR`&&I(e)}return{settings:n?t:null,errors:e}}function h_(){let{settings:e}=__(p_()),t=!!e&&Object.keys(e).length>0,n=!1,r=ff();try{n=A().readdirSync(r).some(e=>(e.isFile()||e.isSymbolicLink())&&e.name.endsWith(`.json`)&&!e.name.startsWith(`.`))}catch{}return{hasBase:t,hasDropIns:n}}function g_(e,t){typeof e==`object`&&e&&`code`in e&&e.code===`ENOENT`?M(`Broken symlink or missing file encountered for settings.json at path: ${t}`):I(e)}function __(e){let t=wt(e);if(t)return{settings:t.settings?Ln(t.settings):null,errors:t.errors};let n=v_(e);return Nt(e,n),{settings:n.settings?Ln(n.settings):null,errors:n.errors}}function v_(e){try{let{resolvedPath:t}=ur(A(),e),n=Pd(t);if(n.trim()===``)return{settings:{},errors:[]};let r=fi(n,!1),i=Fg(r,e),a=vg().safeParse(r);if(!a.success){let t=Ng(a.error,e);return{settings:null,errors:[...i,...t]}}return{settings:a.data,errors:i}}catch(t){return g_(t,e),{settings:null,errors:[]}}}function y_(e){switch(e){case`userSettings`:return $i(ae());case`policySettings`:case`projectSettings`:case`localSettings`:return $i(dn());case`flagSettings`:{let e=_t();return e?Ji($i(e)):$i(dn())}}}function b_(){return Qt()||g(process.env.CLAUDE_CODE_USE_COWORK_PLUGINS)?`cowork_settings.json`:`settings.json`}function x_(e){switch(e){case`userSettings`:return R(y_(e),b_());case`projectSettings`:case`localSettings`:return R(y_(e),S_(e));case`policySettings`:return p_();case`flagSettings`:return _t()}}function S_(e){switch(e){case`projectSettings`:return R(`.claude`,`settings.json`);case`localSettings`:return R(`.claude`,`settings.local.json`)}}function U(e){let t=At(e);if(t!==void 0)return t;let n=C_(e);return It(e,n),n}function C_(e){if(e===`policySettings`){let e=mp();if(e&&Object.keys(e).length>0)return e;let t=e_();if(Object.keys(t.settings).length>0)return t.settings;let{settings:n}=m_();if(n)return n;let r=t_();return Object.keys(r.settings).length>0?r.settings:null}let t=x_(e),{settings:n}=t?__(t):{settings:null};if(e===`flagSettings`){let e=ut();if(e){let t=vg().safeParse(e);if(t.success)return vu(n||{},t.data,D_)}}return n}function w_(){let e=mp();if(e&&Object.keys(e).length>0)return`remote`;let t=e_();if(Object.keys(t.settings).length>0)return Gr()===`macos`?`plist`:`hklm`;let{settings:n}=m_();if(n)return`file`;let r=t_();return Object.keys(r.settings).length>0?`hkcu`:null}function T_(e,t){if(e===`policySettings`||e===`flagSettings`)return{error:null};let n=x_(e);if(!n)return{error:null};try{A().mkdirSync(Ji(n));let r=C_(e);if(!r){let e=null;try{e=Pd(n)}catch(e){if(!jn(e))throw e}if(e!==null){let t=fi(e);if(t===null)return{error:Error(`Invalid JSON syntax in settings file at ${n}`)};t&&typeof t==`object`&&(r=t,M(`Using raw settings from ${n} due to validation failure`))}}let i=vu(r||{},t,(e,t,n,r)=>{if(t===void 0&&r&&typeof n==`string`){delete r[n];return}if(Array.isArray(t))return t});Pp(n),nf(n,k(i,null,2)+`
32
+ `),gt(),e===`localSettings`&&xp(S_(`localSettings`),dn())}catch(e){let t=Error(`Failed to read raw settings from ${n}: ${e}`);return I(t),{error:t}}return{error:null}}function E_(e,t){return pi([...e,...t])}function D_(e,t){if(Array.isArray(e)&&Array.isArray(t))return E_(e,t)}function O_(e){let t=vg().strip().parse(e),n=[`permissions`,`sandbox`,`hooks`],r=[],i={permissions:new Set([`allow`,`deny`,`ask`,`defaultMode`,`disableBypassPermissionsMode`,...[`disableAutoMode`],`additionalDirectories`]),sandbox:new Set([`enabled`,`failIfUnavailable`,`allowUnsandboxedCommands`,`network`,`filesystem`,`ignoreViolations`,`excludedCommands`,`autoAllowBashIfSandboxed`,`enableWeakerNestedSandbox`,`enableWeakerNetworkIsolation`,`ripgrep`]),hooks:new Set([`PreToolUse`,`PostToolUse`,`Notification`,`UserPromptSubmit`,`SessionStart`,`SessionEnd`,`Stop`,`SubagentStop`,`PreCompact`,`PostCompact`,`TeammateIdle`,`TaskCreated`,`TaskCompleted`])};for(let e of Object.keys(t))if(n.includes(e)&&t[e]&&typeof t[e]==`object`){let n=t[e],a=i[e];if(a)for(let t of Object.keys(n))a.has(t)&&r.push(`${e}.${t}`)}else r.push(e);return r.sort()}function k_(){if(R_)return{settings:{},errors:[]};let e=Date.now();wi(`loadSettingsFromDisk_start`),yr(`info`,`settings_load_started`),R_=!0;try{let t=Tn(),n={};t&&(n=vu(n,t,D_));let r=[],i=new Set,a=new Set;for(let e of Op()){if(e===`policySettings`){let e=null,t=[],a=mp();if(a&&Object.keys(a).length>0){let n=vg().safeParse(a);n.success?e=n.data:t.push(...Ng(n.error,`remote managed settings`))}if(!e){let n=e_();Object.keys(n.settings).length>0&&(e=n.settings),t.push(...n.errors)}if(!e){let{settings:n,errors:r}=m_();n&&(e=n),t.push(...r)}if(!e){let n=t_();Object.keys(n.settings).length>0&&(e=n.settings),t.push(...n.errors)}e&&(n=vu(n,e,D_));for(let e of t){let t=`${e.file}:${e.path}:${e.message}`;i.has(t)||(i.add(t),r.push(e))}continue}let t=x_(e);if(t){let e=$i(t);if(!a.has(e)){a.add(e);let{settings:o,errors:s}=__(t);for(let e of s){let t=`${e.file}:${e.path}:${e.message}`;i.has(t)||(i.add(t),r.push(e))}o&&(n=vu(n,o,D_))}}if(e===`flagSettings`){let e=ut();if(e){let t=vg().safeParse(e);t.success&&(n=vu(n,t.data,D_))}}}return yr(`info`,`settings_load_completed`,{duration_ms:Date.now()-e,source_count:a.size,error_count:r.length}),{settings:n,errors:r}}finally{R_=!1}}function A_(){let{settings:e}=M_();return e||{}}function j_(){gt();let e=[];for(let t of Op()){let n=U(t);n&&Object.keys(n).length>0&&e.push({source:t,settings:n})}return{effective:A_(),sources:e}}function M_(){let e=it();if(e!==null)return e;let t=k_();return wi(`loadSettingsFromDisk_end`),Ct(t),t}function N_(){return!!(U(`userSettings`)?.skipDangerousModePermissionPrompt||U(`localSettings`)?.skipDangerousModePermissionPrompt||U(`flagSettings`)?.skipDangerousModePermissionPrompt||U(`policySettings`)?.skipDangerousModePermissionPrompt)}function P_(){return!0}function F_(){return U(`policySettings`)?.useAutoModeDuringPlan!==!1&&U(`flagSettings`)?.useAutoModeDuringPlan!==!1&&U(`userSettings`)?.useAutoModeDuringPlan!==!1&&U(`localSettings`)?.useAutoModeDuringPlan!==!1}function I_(){{let e=D({allow:S(b()).optional(),soft_deny:S(b()).optional(),deny:S(b()).optional(),environment:S(b()).optional()}),t=[],n=[],r=[];for(let i of[`userSettings`,`localSettings`,`flagSettings`,`policySettings`]){let a=U(i);if(!a)continue;let o=e.safeParse(a.autoMode);o.success&&(o.data.allow&&t.push(...o.data.allow),o.data.soft_deny&&n.push(...o.data.soft_deny),process.env.USER_TYPE===`ant`&&o.data.deny&&n.push(...o.data.deny),o.data.environment&&r.push(...o.data.environment))}if(t.length>0||n.length>0||r.length>0)return{...t.length>0&&{allow:t},...n.length>0&&{soft_deny:n},...r.length>0&&{environment:r}}}}function L_(e){for(let t of Op()){if(t===`policySettings`)continue;let n=x_(t);if(n)try{let{resolvedPath:t}=ur(A(),n),r=Pd(t);if(!r.trim())continue;let i=fi(r,!1);if(i&&typeof i==`object`&&e in i)return!0}catch(e){g_(e,n)}}return!1}var R_,z_,B_=t((()=>{yu(),Je(),O(),vp(),Ci(),j(),br(),h(),zn(),uf(),Fd(),Vn(),Sp(),di(),Vr(),qr(),An(),Ti(),Np(),Rp(),pf(),f_(),Ft(),yg(),Ig(),R_=!1,z_=A_}));function V_(e,t){return e.find(e=>e.includes(t))??null}async function H_(){let{BedrockClient:e}=await import(`./dist-es-4z5T3Jzm.js`),t=oe(),n=g(process.env.CLAUDE_CODE_SKIP_BEDROCK_AUTH),r={region:t,...process.env.ANTHROPIC_BEDROCK_BASE_URL&&{endpoint:process.env.ANTHROPIC_BEDROCK_BASE_URL},...await Fi(),...n&&{requestHandler:new(await(import(`./dist-es-hdN_ShpZ.js`))).NodeHttpHandler,httpAuthSchemes:[{schemeId:`smithy.api#noAuth`,identityProvider:()=>async()=>({}),signer:new(await(import(`./dist-es-CZkzHpjF.js`))).NoAuthSigner}],httpAuthSchemeProvider:()=>[{schemeId:`smithy.api#noAuth`}]}};if(!n&&!process.env.AWS_BEARER_TOKEN_BEDROCK){let e=await Lw();e&&(r.credentials={accessKeyId:e.accessKeyId,secretAccessKey:e.secretAccessKey,sessionToken:e.sessionToken})}return new e(r)}async function U_(){let{BedrockRuntimeClient:e}=await import(`./dist-es-DN7otr6F.js`),t=oe(),n=g(process.env.CLAUDE_CODE_SKIP_BEDROCK_AUTH),r={region:t,...process.env.ANTHROPIC_BEDROCK_BASE_URL&&{endpoint:process.env.ANTHROPIC_BEDROCK_BASE_URL},...await Fi(),...n&&{requestHandler:new(await(import(`./dist-es-hdN_ShpZ.js`))).NodeHttpHandler,httpAuthSchemes:[{schemeId:`smithy.api#noAuth`,identityProvider:()=>async()=>({}),signer:new(await(import(`./dist-es-CZkzHpjF.js`))).NoAuthSigner}],httpAuthSchemeProvider:()=>[{schemeId:`smithy.api#noAuth`}]}};if(!n&&!process.env.AWS_BEARER_TOKEN_BEDROCK){let e=await Lw();e&&(r.credentials={accessKeyId:e.accessKeyId,secretAccessKey:e.secretAccessKey,sessionToken:e.sessionToken})}return new e(r)}function W_(e){return e.startsWith(`anthropic.`)}function G_(e){if(!e.startsWith(`arn:`))return e;let t=e.lastIndexOf(`/`);return t===-1?e:e.substring(t+1)}function K_(e){let t=G_(e);for(let e of X_)if(t.startsWith(`${e}.anthropic.`))return e}function q_(e,t){let n=K_(e);return n?e.replace(`${n}.`,`${t}.`):W_(e)?`${t}.${e}`:e}var J_,Y_,X_,Z_=t((()=>{m(),Q(),h(),Vr(),Li(),J_=p(async function(){let[e,{ListInferenceProfilesCommand:t}]=await Promise.all([H_(),import(`./dist-es-4z5T3Jzm.js`)]),n=[],r;try{do{let i=new t({...r&&{nextToken:r},typeEquals:`SYSTEM_DEFINED`}),a=await e.send(i);a.inferenceProfileSummaries&&n.push(...a.inferenceProfileSummaries),r=a.nextToken}while(r);return n.filter(e=>e.inferenceProfileId?.includes(`anthropic`)).map(e=>e.inferenceProfileId).filter(Boolean)}catch(e){throw I(e),e}}),Y_=p(async function(e){try{let[t,{GetInferenceProfileCommand:n}]=await Promise.all([H_(),import(`./dist-es-4z5T3Jzm.js`)]),r=new n({inferenceProfileIdentifier:e}),i=await t.send(r);if(!i.models||i.models.length===0)return null;let a=i.models[0];if(!a?.modelArn)return null;let o=a.modelArn.lastIndexOf(`/`);return o>=0?a.modelArn.substring(o+1):a.modelArn}catch(e){return I(e),null}}),X_=[`us`,`eu`,`apac`,`global`]})),Q_,$_,ev,tv,nv,rv,iv,av,ov,sv,cv,lv,uv,dv,fv=t((()=>{Q_={firstParty:`claude-3-7-sonnet-20250219`,bedrock:`us.anthropic.claude-3-7-sonnet-20250219-v1:0`,vertex:`claude-3-7-sonnet@20250219`,foundry:`claude-3-7-sonnet`,openai:`claude-3-7-sonnet-20250219`,gemini:`claude-3-7-sonnet-20250219`,grok:`claude-3-7-sonnet-20250219`},$_={firstParty:`claude-3-5-sonnet-20241022`,bedrock:`anthropic.claude-3-5-sonnet-20241022-v2:0`,vertex:`claude-3-5-sonnet-v2@20241022`,foundry:`claude-3-5-sonnet`,openai:`claude-3-5-sonnet-20241022`,gemini:`claude-3-5-sonnet-20241022`,grok:`claude-3-5-sonnet-20241022`},ev={firstParty:`claude-3-5-haiku-20241022`,bedrock:`us.anthropic.claude-3-5-haiku-20241022-v1:0`,vertex:`claude-3-5-haiku@20241022`,foundry:`claude-3-5-haiku`,openai:`claude-3-5-haiku-20241022`,gemini:`claude-3-5-haiku-20241022`,grok:`claude-3-5-haiku-20241022`},tv={firstParty:`claude-haiku-4-5-20251001`,bedrock:`us.anthropic.claude-haiku-4-5-20251001-v1:0`,vertex:`claude-haiku-4-5@20251001`,foundry:`claude-haiku-4-5`,openai:`claude-haiku-4-5-20251001`,gemini:`claude-haiku-4-5-20251001`,grok:`claude-haiku-4-5-20251001`},nv={firstParty:`claude-sonnet-4-20250514`,bedrock:`us.anthropic.claude-sonnet-4-20250514-v1:0`,vertex:`claude-sonnet-4@20250514`,foundry:`claude-sonnet-4`,openai:`claude-sonnet-4-20250514`,gemini:`claude-sonnet-4-20250514`,grok:`claude-sonnet-4-20250514`},rv={firstParty:`claude-sonnet-4-5-20250929`,bedrock:`us.anthropic.claude-sonnet-4-5-20250929-v1:0`,vertex:`claude-sonnet-4-5@20250929`,foundry:`claude-sonnet-4-5`,openai:`claude-sonnet-4-5-20250929`,gemini:`claude-sonnet-4-5-20250929`,grok:`claude-sonnet-4-5-20250929`},iv={firstParty:`claude-opus-4-20250514`,bedrock:`us.anthropic.claude-opus-4-20250514-v1:0`,vertex:`claude-opus-4@20250514`,foundry:`claude-opus-4`,openai:`claude-opus-4-20250514`,gemini:`claude-opus-4-20250514`,grok:`claude-opus-4-20250514`},av={firstParty:`claude-opus-4-1-20250805`,bedrock:`us.anthropic.claude-opus-4-1-20250805-v1:0`,vertex:`claude-opus-4-1@20250805`,foundry:`claude-opus-4-1`,openai:`claude-opus-4-1-20250805`,gemini:`claude-opus-4-1-20250805`,grok:`claude-opus-4-1-20250805`},ov={firstParty:`claude-opus-4-5-20251101`,bedrock:`us.anthropic.claude-opus-4-5-20251101-v1:0`,vertex:`claude-opus-4-5@20251101`,foundry:`claude-opus-4-5`,openai:`claude-opus-4-5-20251101`,gemini:`claude-opus-4-5-20251101`,grok:`claude-opus-4-5-20251101`},sv={firstParty:`claude-opus-4-6`,bedrock:`us.anthropic.claude-opus-4-6-v1`,vertex:`claude-opus-4-6`,foundry:`claude-opus-4-6`,openai:`claude-opus-4-6`,gemini:`claude-opus-4-6`,grok:`claude-opus-4-6`},cv={firstParty:`claude-opus-4-7`,bedrock:`us.anthropic.claude-opus-4-7-v1`,vertex:`claude-opus-4-7`,foundry:`claude-opus-4-7`,openai:`claude-opus-4-7`,gemini:`claude-opus-4-7`,grok:`claude-opus-4-7`},lv={firstParty:`claude-sonnet-4-6`,bedrock:`us.anthropic.claude-sonnet-4-6`,vertex:`claude-sonnet-4-6`,foundry:`claude-sonnet-4-6`,openai:`claude-sonnet-4-6`,gemini:`claude-sonnet-4-6`,grok:`claude-sonnet-4-6`},uv={haiku35:ev,haiku45:tv,sonnet35:$_,sonnet37:Q_,sonnet40:nv,sonnet45:rv,sonnet46:lv,opus40:iv,opus41:av,opus45:ov,opus46:sv,opus47:cv},Object.values(uv).map(e=>e.firstParty),dv=Object.fromEntries(Object.entries(uv).map(([e,t])=>[t.firstParty,e]))}));function W(e=A_()){let t=e.modelType;return t===`openai`?`openai`:t===`gemini`?`gemini`:t===`grok`?`grok`:g(process.env.CLAUDE_CODE_USE_BEDROCK)?`bedrock`:g(process.env.CLAUDE_CODE_USE_VERTEX)?`vertex`:g(process.env.CLAUDE_CODE_USE_FOUNDRY)?`foundry`:g(process.env.CLAUDE_CODE_USE_OPENAI)?`openai`:g(process.env.CLAUDE_CODE_USE_GEMINI)?`gemini`:g(process.env.CLAUDE_CODE_USE_GROK)?`grok`:`firstParty`}function pv(){return W()}function mv(){let e=process.env.ANTHROPIC_BASE_URL;if(!e)return!0;try{let t=new URL(e).host,n=[`api.anthropic.com`];return process.env.USER_TYPE===`ant`&&n.push(`api-staging.anthropic.com`),n.includes(t)}catch{return!1}}var hv=t((()=>{B_(),h()}));function gv(e){let t={};for(let n of Sv)t[n]=uv[n][e];return t}async function _v(){let e=gv(`bedrock`),t;try{t=await J_()}catch(t){return I(t),e}if(!t?.length)return e;let n={};for(let r of Sv){let i=uv[r].firstParty;n[r]=V_(t,i)||e[r]}return n}function vv(e){let t=A_().modelOverrides;if(!t)return e;let n={...e};for(let[e,r]of Object.entries(t)){let t=dv[e];t&&r&&(n[t]=r)}return n}function yv(e){let t;try{t=A_().modelOverrides}catch{return e}if(!t)return e;for(let[n,r]of Object.entries(t))if(r===e)return n;return e}function bv(){if(gn()===null){if(W()!==`bedrock`){Wt(gv(W()));return}Cv()}}function G(){let e=gn();return e===null?(bv(),vv(gv(W()))):vv(e)}async function xv(){if(gn()===null){if(W()!==`bedrock`){Wt(gv(W()));return}await Cv()}}var Sv,Cv,wv=t((()=>{O(),Vr(),cp(),B_(),Z_(),fv(),hv(),Sv=Object.keys(uv),Cv=sp(async()=>{if(gn()===null)try{Wt(await _v())}catch(e){I(e)}})}));function Tv(){if(g(process.env.DISABLE_COST_WARNINGS)||Y())return!1;let e=SC(),t=CC()!==null;if(!e.hasToken&&!t)return!1;let n=H(),r=n.oauthAccount?.organizationRole,i=n.oauthAccount?.workspaceRole;return!r||!i?!1:[`admin`,`billing`].includes(r)||[`workspace_admin`,`workspace_billing`].includes(i)}function Ev(e){Ov=e}function Dv(){if(Ov!==null)return Ov;if(!Y())return!1;let e=X();if(e===`max`||e===`pro`)return!0;let t=H().oauthAccount?.organizationRole;return!!t&&[`admin`,`billing`,`owner`,`primary_owner`].includes(t)}var Ov,kv=t((()=>{Q(),op(),h(),Ov=null}));function Av(){return process.env.USER_TYPE===`ant`?process.env.CLAUDE_MOCK_HEADERLESS_429?process.env.CLAUDE_MOCK_HEADERLESS_429:Bv?Vv:null:null}function jv(){return!Bv||process.env.USER_TYPE!==`ant`||Object.keys(zv).length===0?null:zv}function Mv(){zv={},Kv=[],Hv=null,Uv=null,Wv=null,Vv=null,Ev(null),Bv=!1}function Nv(e){let t=jv();if(!t)return e;let n=new globalThis.Headers(e);return Object.entries(t).forEach(([e,t])=>{t!==void 0&&n.set(e,t)}),n}function Pv(){return process.env.USER_TYPE===`ant`?Bv||!!process.env.CLAUDE_MOCK_HEADERLESS_429:!1}function Fv(){return!Bv||process.env.USER_TYPE!==`ant`?null:Hv||Gv}function Iv(){return Bv&&Hv!==null&&process.env.USER_TYPE===`ant`}function Lv(){return Uv!==null}function Rv(e){if(Uv===null||!e)return null;if(Wv!==null&&Date.now()>=Wv)return Mv(),null;Wv===null&&(Wv=Date.now()+Uv);let t=Wv-Date.now(),n={...zv};return n[`retry-after`]=String(Math.max(1,Math.ceil(t/1e3))),n}var zv,Bv,Vv,Hv,Uv,Wv,Gv,Kv,qv=t((()=>{kv(),zv={},Bv=!1,Vv=null,Hv=null,Uv=null,Wv=null,Gv=`max`}));async function Jv(){let e=H().oauthAccount?.accountUuid,t=CC();if(!e||!t)return;let n=`${P().BASE_API_URL}/api/claude_cli_profile`;try{return(await v.get(n,{headers:{"x-api-key":t,"anthropic-beta":Dr},params:{account_uuid:e},timeout:1e4})).data}catch(e){I(e)}}async function Yv(e){let t=`${P().BASE_API_URL}/api/oauth/profile`;try{return(await v.get(t,{headers:{Authorization:`Bearer ${e}`,"Content-Type":`application/json`},timeout:1e4})).data}catch(e){I(e)}}var Xv=t((()=>{Ie(),kr(),Q(),op(),Vr()}));function Zv(e){return!!e?.includes(Tr)}function Qv(e){return e?.split(` `).filter(Boolean)??[]}function $v({codeChallenge:e,state:t,port:n,isManual:r,loginWithClaudeAi:i,inferenceOnly:a,orgUUID:o,loginHint:s,loginMethod:c}){let l=i?P().CLAUDE_AI_AUTHORIZE_URL:P().CONSOLE_AUTHORIZE_URL,u=new URL(l);u.searchParams.append(`code`,`true`),u.searchParams.append(`client_id`,P().CLIENT_ID),u.searchParams.append(`response_type`,`code`),u.searchParams.append(`redirect_uri`,r?P().MANUAL_REDIRECT_URL:`http://localhost:${n}/callback`);let d=a?[Tr]:Or;return u.searchParams.append(`scope`,d.join(` `)),u.searchParams.append(`code_challenge`,e),u.searchParams.append(`code_challenge_method`,`S256`),u.searchParams.append(`state`,t),o&&u.searchParams.append(`orgUUID`,o),s&&u.searchParams.append(`login_hint`,s),c&&u.searchParams.append(`login_method`,c),u.toString()}async function ey(e,t,n,r,i=!1,a){let o={grant_type:`authorization_code`,code:e,redirect_uri:i?P().MANUAL_REDIRECT_URL:`http://localhost:${r}/callback`,client_id:P().CLIENT_ID,code_verifier:n,state:t};a!==void 0&&(o.expires_in=a);let s=await v.post(P().TOKEN_URL,o,{headers:{"Content-Type":`application/json`},timeout:15e3});if(s.status!==200)throw Error(s.status===401?`Authentication failed: Invalid authorization code`:`Token exchange failed (${s.status}): ${s.statusText}`);return N(`tengu_oauth_token_exchange_success`,{}),s.data}async function ty(e,{scopes:t}={}){let n={grant_type:`refresh_token`,refresh_token:e,client_id:P().CLIENT_ID,scope:(t?.length?t:Er).join(` `)};try{let t=await v.post(P().TOKEN_URL,n,{headers:{"Content-Type":`application/json`},timeout:15e3});if(t.status!==200)throw Error(`Token refresh failed: ${t.statusText}`);let r=t.data,{access_token:i,refresh_token:a=e,expires_in:o}=r,s=Date.now()+o*1e3,c=Qv(r.scope);N(`tengu_oauth_token_refresh_success`,{});let l=H(),u=Z(),d=l.oauthAccount?.billingType!==void 0&&l.oauthAccount?.accountCreatedAt!==void 0&&l.oauthAccount?.subscriptionCreatedAt!==void 0&&u?.subscriptionType!=null&&u?.rateLimitTier!=null?null:await ay(i);if(d&&l.oauthAccount){let e={};d.displayName!==void 0&&(e.displayName=d.displayName),typeof d.hasExtraUsageEnabled==`boolean`&&(e.hasExtraUsageEnabled=d.hasExtraUsageEnabled),d.billingType!==null&&(e.billingType=d.billingType),d.accountCreatedAt!==void 0&&(e.accountCreatedAt=d.accountCreatedAt),d.subscriptionCreatedAt!==void 0&&(e.subscriptionCreatedAt=d.subscriptionCreatedAt),Object.keys(e).length>0&&V(t=>({...t,oauthAccount:t.oauthAccount?{...t.oauthAccount,...e}:t.oauthAccount}))}return{accessToken:i,refreshToken:a,expiresAt:s,scopes:c,subscriptionType:d?.subscriptionType??u?.subscriptionType??null,rateLimitTier:d?.rateLimitTier??u?.rateLimitTier??null,profile:d?.rawProfile,tokenAccount:r.account?{uuid:r.account.uuid,emailAddress:r.account.email_address,organizationUuid:r.organization?.uuid}:void 0}}catch(e){let t=v.isAxiosError(e)&&e.response?.data?JSON.stringify(e.response.data):void 0;throw N(`tengu_oauth_token_refresh_failure`,{error:e.message,...t&&{responseBody:t}}),e}}async function ny(e){let t=await v.get(P().ROLES_URL,{headers:{Authorization:`Bearer ${e}`}});if(t.status!==200)throw Error(`Failed to fetch user roles: ${t.statusText}`);let n=t.data;if(!H().oauthAccount)throw Error(`OAuth account information not found in config`);V(e=>({...e,oauthAccount:e.oauthAccount?{...e.oauthAccount,organizationRole:n.organization_role,workspaceRole:n.workspace_role,organizationName:n.organization_name}:e.oauthAccount})),N(`tengu_oauth_roles_stored`,{org_role:n.organization_role})}async function ry(e){try{let t=await v.post(P().API_KEY_URL,null,{headers:{Authorization:`Bearer ${e}`}}),n=t.data?.raw_key;return n?(await $C(n),N(`tengu_oauth_api_key`,{status:`success`,statusCode:t.status}),n):null}catch(e){throw N(`tengu_oauth_api_key`,{status:`failure`,error:e instanceof Error?e.message:String(e)}),e}}function iy(e){return e===null?!1:Date.now()+300*1e3>=e}async function ay(e){let t=await Yv(e),n=t?.organization?.organization_type,r=null;switch(n){case`claude_max`:r=`max`;break;case`claude_pro`:r=`pro`;break;case`claude_enterprise`:r=`enterprise`;break;case`claude_team`:r=`team`;break;default:r=null;break}let i={subscriptionType:r,rateLimitTier:t?.organization?.rate_limit_tier??null,hasExtraUsageEnabled:t?.organization?.has_extra_usage_enabled??null,billingType:t?.organization?.billing_type??null};return t?.account?.display_name&&(i.displayName=t.account.display_name),t?.account?.created_at&&(i.accountCreatedAt=t.account.created_at),t?.organization?.subscription_created_at&&(i.subscriptionCreatedAt=t.organization.subscription_created_at),N(`tengu_oauth_profile_fetch_success`,{}),{...i,rawProfile:t}}async function oy(){let e=H().oauthAccount?.organizationUuid;if(e)return e;let t=Z()?.accessToken;return t===void 0||!dw()?null:(await Yv(t))?.organization?.uuid||null}async function sy(){let e=process.env.CLAUDE_CODE_ACCOUNT_UUID,t=process.env.CLAUDE_CODE_USER_EMAIL,n=process.env.CLAUDE_CODE_ORGANIZATION_UUID,r=!!(e&&t&&n);e&&t&&n&&(H().oauthAccount||cy({accountUuid:e,emailAddress:t,organizationUuid:n})),await lw();let i=H();if(i.oauthAccount&&i.oauthAccount.billingType!==void 0&&i.oauthAccount.accountCreatedAt!==void 0&&i.oauthAccount.subscriptionCreatedAt!==void 0||!Y()||!dw())return!1;let a=Z();if(a?.accessToken){let e=await Yv(a.accessToken);if(e)return r&&M(`OAuth profile fetch succeeded, overriding env var account info`,{level:`info`}),cy({accountUuid:e.account.uuid,emailAddress:e.account.email,organizationUuid:e.organization.uuid,displayName:e.account.display_name||void 0,hasExtraUsageEnabled:e.organization.has_extra_usage_enabled??!1,billingType:e.organization.billing_type??void 0,accountCreatedAt:e.account.created_at,subscriptionCreatedAt:e.organization.subscription_created_at??void 0}),!0}return!1}function cy({accountUuid:e,emailAddress:t,organizationUuid:n,displayName:r,hasExtraUsageEnabled:i,billingType:a,accountCreatedAt:o,subscriptionCreatedAt:s}){let c={accountUuid:e,emailAddress:t,organizationUuid:n,hasExtraUsageEnabled:i,billingType:a,accountCreatedAt:o,subscriptionCreatedAt:s};r&&(c.displayName=r),V(e=>e.oauthAccount?.accountUuid===c.accountUuid&&e.oauthAccount?.emailAddress===c.emailAddress&&e.oauthAccount?.organizationUuid===c.organizationUuid&&e.oauthAccount?.displayName===c.displayName&&e.oauthAccount?.hasExtraUsageEnabled===c.hasExtraUsageEnabled&&e.oauthAccount?.billingType===c.billingType&&e.oauthAccount?.accountCreatedAt===c.accountCreatedAt&&e.oauthAccount?.subscriptionCreatedAt===c.subscriptionCreatedAt?e:{...e,oauthAccount:c})}var ly=t((()=>{Ie(),hr(),kr(),Q(),op(),j(),Xv()}));function uy(e,t,n){if(g(process.env.CLAUDE_CODE_REMOTE))try{ra(hy,{recursive:!0,mode:448}),sa(e,t,{encoding:`utf8`,mode:384}),M(`Persisted ${n} to ${e} for subprocess access`)}catch(e){M(`Failed to persist ${n} to disk (non-fatal): ${pr(e)}`,{level:`error`})}}function dy(e,t){try{let n=A().readFileSync(e,{encoding:`utf8`}).trim();return n?(M(`Read ${t} from well-known file ${e}`),n):null}catch(n){return jn(n)||M(`Failed to read ${t} from ${e}: ${pr(n)}`,{level:`debug`}),null}}function fy({envVar:e,wellKnownPath:t,label:n,getCached:r,setCached:i}){let a=r();if(a!==void 0)return a;let o=process.env[e];if(!o){let e=dy(t,n);return i(e),e}let s=parseInt(o,10);if(Number.isNaN(s))return M(`${e} must be a valid file descriptor number, got: ${o}`,{level:`error`}),i(null),null;try{let e=A(),r=process.platform===`darwin`||process.platform===`freebsd`?`/dev/fd/${s}`:`/proc/self/fd/${s}`,a=e.readFileSync(r,{encoding:`utf8`}).trim();return a?(M(`Successfully read ${n} from file descriptor ${s}`),i(a),uy(t,a,n),a):(M(`File descriptor contained empty ${n}`,{level:`error`}),i(null),null)}catch(e){M(`Failed to read ${n} from file descriptor ${s}: ${pr(e)}`,{level:`error`});let r=dy(t,n);return i(r),r}}function py(){return fy({envVar:`CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTOR`,wellKnownPath:gy,label:`OAuth token`,getCached:Gt,setCached:Jt})}function my(){return fy({envVar:`CLAUDE_CODE_API_KEY_FILE_DESCRIPTOR`,wellKnownPath:_y,label:`API key`,getCached:wn,setCached:ot})}var hy,gy,_y,vy,yy=t((()=>{O(),j(),h(),zn(),Vn(),hy=`/home/claude/.claude/remote`,gy=`${hy}/.oauth_token`,_y=`${hy}/.api_key`,vy=`${hy}/.session_ingress_token`}));function by(e=``){let t=ae(),n=process.env.CLAUDE_CONFIG_DIR?`-${ca(`sha256`).update(t).digest(`hex`).substring(0,8)}`:``;return`Claude Code${P().OAUTH_FILE_SUFFIX}${e}${n}`}function xy(){try{return process.env.USER||Gi().username}catch{return`claude-code-user`}}function Sy(){K.cache={data:null,cachedAt:0},K.generation++,K.readInFlight=null}function Cy(e){if(K.cache.cachedAt!==0)return;let t=null;if(e)try{t=JSON.parse(e)}catch{return}K.cache={data:t,cachedAt:Date.now()}}var wy,K,Ty=t((()=>{kr(),h(),wy=`-credentials`,K={cache:{data:null,cachedAt:0},generation:0,readInFlight:null}}));async function Ey(){if(process.platform===`darwin`&&(await Pr(`security delete-generic-password -a $USER -s "${by()}"`,{shell:!0,reject:!1})).exitCode!==0)throw Error(`Failed to delete keychain entry`)}function Dy(e){return e.slice(-20)}var Oy=t((()=>{Nr(),Ty()}));function ky(e){return e?.name===`CredentialsProviderError`}function Ay(e){if(!e||typeof e!=`object`)return!1;let t=e;if(!t.Credentials||typeof t.Credentials!=`object`)return!1;let n=t.Credentials;return typeof n.AccessKeyId==`string`&&typeof n.SecretAccessKey==`string`&&typeof n.SessionToken==`string`&&n.AccessKeyId.length>0&&n.SecretAccessKey.length>0&&n.SessionToken.length>0}async function jy(){let{STSClient:e,GetCallerIdentityCommand:t}=await import(`./dist-es-D1LN6CJd.js`);await new e().send(new t({}))}async function My(){try{M(`Clearing AWS credential provider cache`);let{fromIni:e}=await import(`./dist-es-DGn8uOwQ2.js`);await e({ignoreCache:!0})(),M(`AWS credential provider cache refreshed`)}catch{M(`Failed to clear AWS credential cache (this is expected if no credentials are configured)`)}}var Ny=t((()=>{j()})),Py,Fy=t((()=>{ft(),ce(),Py=class e{constructor(){_(this,`status`,{isAuthenticating:!1,output:[]}),_(this,`changed`,Ot()),_(this,`subscribe`,this.changed.subscribe)}static getInstance(){return e.instance||(e.instance=new e),e.instance}getStatus(){return{...this.status,output:[...this.status.output]}}startAuthentication(){this.status={isAuthenticating:!0,output:[]},this.changed.emit(this.getStatus())}addOutput(e){this.status.output.push(e),this.changed.emit(this.getStatus())}setError(e){this.status.error=e,this.changed.emit(this.getStatus())}endAuthentication(e){e?this.status={isAuthenticating:!1,output:[]}:this.status.isAuthenticating=!1,this.changed.emit(this.getStatus())}static reset(){e.instance&&(e.instance.changed.clear(),e.instance=null)}},_(Py,`instance`,null)})),Iy,Ly,Ry,zy,By,Vy,Hy,Uy,Wy,Gy,Ky,qy,Jy,Yy,Xy,Zy,Qy,$y,eb=t((()=>{Iy=`claude-code-20250219`,Ly=`interleaved-thinking-2025-05-14`,Ry=`context-1m-2025-08-07`,zy=`context-management-2025-06-27`,By=`structured-outputs-2025-12-15`,Vy=`web-search-2025-03-05`,Hy=`tool-search-tool-2025-10-19`,Uy=`effort-2025-11-24`,Wy=`task-budgets-2026-03-13`,Gy=`prompt-caching-scope-2026-01-05`,Ky=`fast-mode-2026-02-01`,qy=`redact-thinking-2026-02-12`,Jy=`token-efficient-tools-2026-03-28`,Yy=`afk-mode-2026-01-31`,Xy=process.env.USER_TYPE===`ant`?`cli-internal-2026-02-09`:``,Zy=`advisor-tool-2026-03-01`,Qy=new Set([Ly,Ry,Hy]),$y=new Set([Iy,Ly,zy])}));function tb(){return process.env.USER_TYPE===`ant`?bO(`tengu_ant_model_override`,null):null}function nb(){return process.env.USER_TYPE===`ant`?tb()?.antModels??[]:[]}function rb(e){if(process.env.USER_TYPE!==`ant`||e===void 0)return;let t=e.toLowerCase();return nb().find(n=>n.alias===e||t.includes(n.model.toLowerCase()))}var ib=t((()=>{XO()}));function ab(){return!g(process.env.CLAUDE_CODE_DISABLE_FAST_MODE)}function ob(){return ab()?cb()===null:!1}function sb(e,t){switch(e){case`free`:return t===`oauth`?`Fast mode requires a paid subscription`:`Fast mode unavailable during evaluation. Please purchase credits.`;case`preference`:return`Fast mode has been disabled by your organization`;case`extra_usage_disabled`:return`Fast mode requires extra usage billing · /extra-usage to enable`;case`network_error`:return`Fast mode unavailable due to network connectivity issues`;case`unknown`:return`Fast mode is currently unavailable`}}function cb(){if(!ab())return`Fast mode is not available`;let e=bO(`tengu_penguins_off`,null);if(e!==null)return M(`Fast mode unavailable: ${e}`),e;if(!Ar()&&bO(`tengu_marble_sandcastle`,!1))return`Fast mode requires the native binary · Install from: https://claude.com/product/claude-code`;if(Mt()&&rn()&&!xt()&&!U(`flagSettings`)?.fastMode){let e=`Fast mode is not available in the Agent SDK`;return M(`Fast mode unavailable: ${e}`),e}if(W()!==`firstParty`){let e=`Fast mode is not available on Bedrock, Vertex, or Foundry`;return M(`Fast mode unavailable: ${e}`),e}if(q.status===`disabled`){if((q.reason===`network_error`||q.reason===`unknown`)&&g(process.env.CLAUDE_CODE_SKIP_FAST_MODE_NETWORK_ERRORS))return null;let e=Z()===null?`api-key`:`oauth`,t=sb(q.reason,e);return M(`Fast mode unavailable: ${t}`),t}return null}function lb(){return`opus`+(Fx()?`[1m]`:``)}function ub(e){if(!ab()||!ob()||!db(e))return!1;let t=A_();return t.fastModePerSessionOptIn?!1:t.fastMode===!0}function db(e){if(!ab())return!1;let t=Bx(e??kx());return t.toLowerCase().includes(`opus-4-7`)||t.toLowerCase().includes(`opus-4-6`)}function fb(){return Tb.status===`cooldown`&&Date.now()>=Tb.resetAt&&(ab()&&!Eb&&(M(`Fast mode cooldown expired, re-enabling fast mode`),Eb=!0,Ob.emit()),Tb={status:`active`}),Tb}function pb(e,t){if(!ab())return;Tb={status:`cooldown`,resetAt:e,reason:t},Eb=!1;let n=e-Date.now();M(`Fast mode cooldown triggered (${t}), duration ${Math.round(n/1e3)}s`),N(`tengu_fast_mode_fallback_triggered`,{cooldown_duration_ms:n,cooldown_reason:t}),Db.emit(e,t)}function mb(){Tb={status:`active`}}function hb(){q.status!==`disabled`&&(q={status:`disabled`,reason:`preference`},T_(`userSettings`,{fastMode:void 0}),V(e=>({...e,penguinModeOrgEnabled:!1})),Nb.emit(!1))}function gb(e){switch(e){case`out_of_credits`:return`Fast mode disabled · extra usage credits exhausted`;case`org_level_disabled`:case`org_service_level_disabled`:return`Fast mode disabled · extra usage disabled by your organization`;case`org_level_disabled_until`:return`Fast mode disabled · extra usage spending cap reached`;case`member_level_disabled`:return`Fast mode disabled · extra usage disabled for your account`;case`seat_tier_level_disabled`:case`seat_tier_zero_credit_limit`:case`member_zero_credit_limit`:return`Fast mode disabled · extra usage not available for your plan`;case`overage_not_provisioned`:case`no_limits_configured`:return`Fast mode requires extra usage billing · /extra-usage to enable`;default:return`Fast mode disabled · extra usage not available`}}function _b(e){return e===`org_level_disabled_until`||e===`out_of_credits`}function vb(e){let t=gb(e);M(`Fast mode overage rejection: ${e??`unknown`} — ${t}`),N(`tengu_fast_mode_overage_rejected`,{overage_disabled_reason:e??`unknown`}),_b(e)||(T_(`userSettings`,{fastMode:void 0}),V(e=>({...e,penguinModeOrgEnabled:!1}))),jb.emit(t)}function yb(){return fb().status===`cooldown`}function bb(e,t){let n=ab()&&ob()&&!!t&&db(e);return n&&yb()?`cooldown`:n?`on`:`off`}async function xb(e){let t=`${P().BASE_API_URL}/api/claude_code_penguin_mode`,n=`accessToken`in e?{Authorization:`Bearer ${e.accessToken}`,"anthropic-beta":Dr}:{"x-api-key":e.apiKey};return(await v.get(t,{headers:n})).data}function Sb(){if(!ab()||q.status!==`pending`)return;let e=process.env.USER_TYPE===`ant`,t=H().penguinModeOrgEnabled===!0;q=e||t?{status:`enabled`}:{status:`disabled`,reason:`unknown`}}async function Cb(){if(Br()||!ab())return;if(Lb)return M(`Fast mode prefetch in progress, returning in-flight promise`),Lb;let e=CC();if(!(Z()?.accessToken&&dw())&&!e){let e=process.env.USER_TYPE===`ant`,t=H().penguinModeOrgEnabled===!0;q=e||t?{status:`enabled`}:{status:`disabled`,reason:`preference`};return}let t=Date.now();if(t-Ib<Fb){M(`Skipping fast mode prefetch, fetched recently`);return}Ib=t;let n=async()=>{let t=Z(),n=t?.accessToken&&dw()?{accessToken:t.accessToken}:e?{apiKey:e}:null;if(!n)throw Error(`No auth available`);return xb(n)};async function r(){try{let e;try{e=await n()}catch(t){if(v.isAxiosError(t)&&(t.response?.status===401||t.response?.status===403&&typeof t.response?.data==`string`&&t.response.data.includes(`OAuth token has been revoked`))){let r=Z()?.accessToken;if(r)await ow(r),e=await n();else throw t}else throw t}let t=q.status===`pending`?H().penguinModeOrgEnabled:q.status===`enabled`;q=e.enabled?{status:`enabled`}:{status:`disabled`,reason:e.disabled_reason??`preference`},t!==e.enabled&&(e.enabled||T_(`userSettings`,{fastMode:void 0}),V(t=>({...t,penguinModeOrgEnabled:e.enabled})),Nb.emit(e.enabled)),M(`Org fast mode: ${e.enabled?`enabled`:`disabled (${e.disabled_reason??`preference`})`}`)}catch(e){let t=process.env.USER_TYPE===`ant`,n=H().penguinModeOrgEnabled===!0;q=t||n?{status:`enabled`}:{status:`disabled`,reason:`network_error`},M(`Failed to fetch org fast mode status, defaulting to ${q.status===`enabled`?`enabled (cached)`:`disabled (network_error)`}: ${e}`,{level:`error`}),N(`tengu_org_penguin_mode_fetch_failed`,{})}finally{Lb=null}}return Lb=r(),Lb}var wb,Tb,Eb,Db,Ob,kb,Ab,jb,Mb,q,Nb,Pb,Fb,Ib,Lb,Rb=t((()=>{Ie(),kr(),XO(),O(),hr(),Q(),jr(),op(),j(),h(),Jx(),hv(),zr(),B_(),ft(),wb=`Opus 4.7`,Tb={status:`active`},Eb=!1,Db=Ot(),Ob=Ot(),kb=Db.subscribe,Ab=Ob.subscribe,jb=Ot(),Mb=jb.subscribe,q={status:`pending`},Nb=Ot(),Pb=Nb.subscribe,Fb=3e4,Ib=0,Lb=null}));function zb(e){return ab()&&e?Xb:Yb}function Bb(e,t){return t.input_tokens/1e6*e.inputTokens+t.output_tokens/1e6*e.outputTokens+(t.cache_read_input_tokens??0)/1e6*e.promptCacheReadTokens+(t.cache_creation_input_tokens??0)/1e6*e.promptCacheWriteTokens+(t.server_tool_use?.web_search_requests??0)*e.webSearchRequests}function Vb(e,t){let n=jx(e);return n===J(sv.firstParty)?zb(t.speed===`fast`):ex[n]||(Hb(e,n),ex[jx(kx())]??$b)}function Hb(e,t){N(`tengu_unknown_model_cost`,{model:e,shortName:t}),rt()}function Ub(e,t){return Bb(Vb(e,t),t)}function Wb(e,t){return Ub(e,{input_tokens:t.inputTokens,output_tokens:t.outputTokens,cache_read_input_tokens:t.cacheReadInputTokens,cache_creation_input_tokens:t.cacheCreationInputTokens})}function Gb(e){return Number.isInteger(e)?`$${e}`:`$${e.toFixed(2)}`}function Kb(e){return`${Gb(e.inputTokens)}/${Gb(e.outputTokens)} per Mtok`}var qb,Jb,Yb,Xb,Zb,Qb,$b,ex,tx=t((()=>{hr(),O(),Rb(),fv(),Jx(),qb={inputTokens:3,outputTokens:15,promptCacheWriteTokens:3.75,promptCacheReadTokens:.3,webSearchRequests:.01},Jb={inputTokens:15,outputTokens:75,promptCacheWriteTokens:18.75,promptCacheReadTokens:1.5,webSearchRequests:.01},Yb={inputTokens:5,outputTokens:25,promptCacheWriteTokens:6.25,promptCacheReadTokens:.5,webSearchRequests:.01},Xb={inputTokens:30,outputTokens:150,promptCacheWriteTokens:37.5,promptCacheReadTokens:3,webSearchRequests:.01},Zb={inputTokens:.8,outputTokens:4,promptCacheWriteTokens:1,promptCacheReadTokens:.08,webSearchRequests:.01},Qb={inputTokens:1,outputTokens:5,promptCacheWriteTokens:1.25,promptCacheReadTokens:.1,webSearchRequests:.01},$b=Yb,ex={[J(ev.firstParty)]:Zb,[J(tv.firstParty)]:Qb,[J($_.firstParty)]:qb,[J(Q_.firstParty)]:qb,[J(nv.firstParty)]:qb,[J(rv.firstParty)]:qb,[J(lv.firstParty)]:qb,[J(iv.firstParty)]:Jb,[J(av.firstParty)]:Jb,[J(ov.firstParty)]:Yb,[J(sv.firstParty)]:Yb}}));function nx(e){return ix.includes(e)}function rx(e){return ax.includes(e)}var ix,ax,ox=t((()=>{ix=[`sonnet`,`opus`,`haiku`,`best`,`sonnet[1m]`,`opus[1m]`,`opusplan`],ax=[`sonnet`,`opus`,`haiku`]}));function sx(e,t){return e.includes(t)?!0:nx(e)?Bx(e).toLowerCase().includes(t):!1}function cx(e,t){return e.startsWith(t)?e.length===t.length||e[t.length]===`-`:!1}function lx(e,t){let n=nx(e)?Bx(e).toLowerCase():e;return!!(cx(n,t)||!t.startsWith(`claude-`)&&cx(n,`claude-${t}`))}function ux(e,t){for(let n of t){if(rx(n))continue;let t=n.indexOf(e);if(t===-1)continue;let r=t+e.length;if(r===n.length||n[r]===`-`)return!0}return!1}function dx(e){let{availableModels:t}=z_()||{};if(!t)return!0;if(t.length===0)return!1;let n=yv(e).trim().toLowerCase(),r=t.map(e=>e.trim().toLowerCase());if(r.includes(n)&&(!rx(n)||!ux(n,r)))return!0;for(let e of r)if(rx(e)&&!ux(e,r)&&sx(n,e))return!0;if(nx(n)){let e=Bx(n).toLowerCase();if(r.includes(e))return!0}for(let e of r)if(!rx(e)&&nx(e)&&Bx(e).toLowerCase()===n)return!0;for(let e of r)if(!rx(e)&&!nx(e)&&lx(n,e))return!0;return!1}var fx=t((()=>{B_(),ox(),Jx(),wv()}));function px(){return process.env.OPENAI_AUTH_MODE===`chatgpt`}function mx(e){let t=e.toLowerCase().replace(/\[1m\]$/,``);return _x.some(e=>e.value.toLowerCase()===t)}var hx,gx,_x,vx=t((()=>{hx=`gpt-5.5`,gx=`gpt-5.4-mini`,_x=[{value:`gpt-5.5`,label:`GPT-5.5`,description:`Frontier model for complex coding, research, and real-world work`},{value:`gpt-5.4`,label:`GPT-5.4`,description:`Strong model for everyday coding`},{value:`gpt-5.4-mini`,label:`GPT-5.4-Mini`,description:`Small, fast, and cost-efficient model for simpler coding tasks`},{value:`gpt-5.3-codex`,label:`GPT-5.3-Codex`,description:`Coding-optimized model`},{value:`gpt-5.3-codex-spark`,label:`GPT-5.3-Codex-Spark`,description:`Ultra-fast coding model`},{value:`gpt-5.2`,label:`GPT-5.2`,description:`Optimized for professional work and long-running agents`}]}));function yx(){let e=W();return e===`openai`&&px()?process.env.OPENAI_SMALL_FAST_MODEL??`gpt-5.4-mini`:e===`openai`&&process.env.OPENAI_SMALL_FAST_MODEL?process.env.OPENAI_SMALL_FAST_MODEL:e===`gemini`&&process.env.GEMINI_SMALL_FAST_MODEL?process.env.GEMINI_SMALL_FAST_MODEL:process.env.ANTHROPIC_SMALL_FAST_MODEL||Dx()}function bx(e){return e===G().opus40||e===G().opus41||e===G().opus45||e===G().opus46||e===G().opus47}function xx(){let e,t=$t();if(t!==void 0)e=t;else{let t=z_()||{};e=process.env.ANTHROPIC_MODEL||t.model||void 0}if(!(e&&!dx(e)))return e}function Sx(){let e=xx();return e==null?Ax():Bx(e)}function Cx(){return Tx()}function wx(){let e=W();if(e===`openai`)return process.env.OPENAI_MODEL;if(e===`gemini`)return process.env.GEMINI_MODEL;if(e===`grok`)return process.env.GROK_MODEL}function Tx(){let e=W();return e===`openai`&&px()?hx:e===`openai`&&process.env.OPENAI_DEFAULT_OPUS_MODEL?process.env.OPENAI_DEFAULT_OPUS_MODEL:e===`gemini`&&process.env.GEMINI_DEFAULT_OPUS_MODEL?process.env.GEMINI_DEFAULT_OPUS_MODEL:process.env.ANTHROPIC_DEFAULT_OPUS_MODEL?process.env.ANTHROPIC_DEFAULT_OPUS_MODEL:wx()||G().opus47}function Ex(){let e=W();return e===`openai`&&px()?hx:e===`openai`&&process.env.OPENAI_DEFAULT_SONNET_MODEL?process.env.OPENAI_DEFAULT_SONNET_MODEL:e===`gemini`&&process.env.GEMINI_DEFAULT_SONNET_MODEL?process.env.GEMINI_DEFAULT_SONNET_MODEL:process.env.ANTHROPIC_DEFAULT_SONNET_MODEL?process.env.ANTHROPIC_DEFAULT_SONNET_MODEL:wx()||(e===`firstParty`?G().sonnet46:G().sonnet45)}function Dx(){let e=W();return e===`openai`&&px()?gx:e===`openai`&&process.env.OPENAI_DEFAULT_HAIKU_MODEL?process.env.OPENAI_DEFAULT_HAIKU_MODEL:e===`gemini`&&process.env.GEMINI_DEFAULT_HAIKU_MODEL?process.env.GEMINI_DEFAULT_HAIKU_MODEL:process.env.ANTHROPIC_DEFAULT_HAIKU_MODEL?process.env.ANTHROPIC_DEFAULT_HAIKU_MODEL:wx()||G().haiku45}function Ox(e){let{permissionMode:t,mainLoopModel:n,exceeds200kTokens:r=!1}=e;return xx()===`opusplan`&&t===`plan`&&!r?Tx():xx()===`haiku`&&t===`plan`?Ex():n}function kx(){return process.env.USER_TYPE===`ant`?tb()?.defaultModel??Tx()+`[1m]`:gw()||vw()?Tx()+(Fx()?`[1m]`:``):Ex()}function Ax(){return Bx(kx())}function J(e){if(e=e.toLowerCase(),e.includes(`claude-opus-4-7`))return`claude-opus-4-7`;if(e.includes(`claude-opus-4-6`))return`claude-opus-4-6`;if(e.includes(`claude-opus-4-5`))return`claude-opus-4-5`;if(e.includes(`claude-opus-4-1`))return`claude-opus-4-1`;if(e.includes(`claude-opus-4`))return`claude-opus-4`;if(e.includes(`claude-sonnet-4-6`))return`claude-sonnet-4-6`;if(e.includes(`claude-sonnet-4-5`))return`claude-sonnet-4-5`;if(e.includes(`claude-sonnet-4`))return`claude-sonnet-4`;if(e.includes(`claude-haiku-4-5`))return`claude-haiku-4-5`;if(e.includes(`claude-3-7-sonnet`))return`claude-3-7-sonnet`;if(e.includes(`claude-3-5-sonnet`))return`claude-3-5-sonnet`;if(e.includes(`claude-3-5-haiku`))return`claude-3-5-haiku`;if(e.includes(`claude-3-opus`))return`claude-3-opus`;if(e.includes(`claude-3-sonnet`))return`claude-3-sonnet`;if(e.includes(`claude-3-haiku`))return`claude-3-haiku`;let t=e.match(/(claude-(\d+-\d+-)?\w+)/);return t&&t[1]?t[1]:e}function jx(e){return J(yv(e))}function Mx(e=!1){return gw()||vw()?Fx()?`Opus 4.7 with 1M context · Most capable for complex work${e?Px(!0):``}`:`Opus 4.7 · Most capable for complex work${e?Px(!0):``}`:`Sonnet 4.6 · Best for everyday tasks`}function Nx(e){return e===`opusplan`?`Opus 4.7 in plan mode, else Sonnet 4.6`:zx(Bx(e))}function Px(e){if(W()!==`firstParty`)return``;let t=Kb(zb(e));return` ·${e?` (↯)`:``} ${t}`}function Fx(){return!(fS()||bw()||W()!==`firstParty`||!mv()||Y()&&X()===null)}function Ix(e){return e===`opusplan`?`Opus Plan`:nx(e)?Ni(e):zx(e)}function Lx(e){switch(e){case G().opus47:return`Opus 4.7`;case G().opus47+`[1m]`:return`Opus 4.7 (1M context)`;case G().opus46:return`Opus 4.6`;case G().opus46+`[1m]`:return`Opus 4.6 (1M context)`;case G().opus45:return`Opus 4.5`;case G().opus41:return`Opus 4.1`;case G().opus40:return`Opus 4`;case G().sonnet46+`[1m]`:return`Sonnet 4.6 (1M context)`;case G().sonnet46:return`Sonnet 4.6`;case G().sonnet45+`[1m]`:return`Sonnet 4.5 (1M context)`;case G().sonnet45:return`Sonnet 4.5`;case G().sonnet40:return`Sonnet 4`;case G().sonnet40+`[1m]`:return`Sonnet 4 (1M context)`;case G().sonnet37:return`Sonnet 3.7`;case G().sonnet35:return`Sonnet 3.5`;case G().haiku45:return`Haiku 4.5`;case G().haiku35:return`Haiku 3.5`;default:return null}}function Rx(e){let[t=``,...n]=e.split(`-`);return[t.slice(0,3)+`*`.repeat(Math.max(0,t.length-3)),...n].join(`-`)}function zx(e){let t=Lx(e);if(t)return t;if(process.env.USER_TYPE===`ant`){let t=Bx(e),n=rb(e);return n?Rx(n.model.replace(/\[1m\]$/i,``))+(pS(t)?`[1m]`:``):t===e?t:`${e} (${t})`}return e}function Bx(e){let t=e.trim(),n=t.toLowerCase(),r=pS(n),i=r?n.replace(/\[1m]$/i,``).trim():n;if(nx(i))switch(i){case`opusplan`:return Ex()+(r?`[1m]`:``);case`sonnet`:return Ex()+(r?`[1m]`:``);case`haiku`:return Dx()+(r?`[1m]`:``);case`opus`:return Tx()+(r?`[1m]`:``);case`best`:return Cx();default:}if(W()===`firstParty`&&Hx(i)&&Ux())return Tx()+(r?`[1m]`:``);if(process.env.USER_TYPE===`ant`){let e=pS(n),t=rb(n.replace(/\[1m]$/i,``).trim());if(t){let n=e?`[1m]`:``;return t.model+n}}return r?t.replace(/\[1m\]$/i,``).trim()+`[1m]`:t}function Vx(e,t){return pS(e)||!pS(t)?e:mS(Bx(e))?e+`[1m]`:e}function Hx(e){return qx.includes(e)}function Ux(){return!g(process.env.CLAUDE_CODE_DISABLE_LEGACY_MODEL_REMAP)}function Wx(e){if(e===null)return process.env.USER_TYPE===`ant`?`Default for Ants (${Nx(kx())})`:Y()?`Default (${Mx()})`:`Default (${Ax()})`;let t=Bx(e);return e===t?t:`${e} (${t})`}function Gx(e){if(W()===`foundry`)return;let t=e.toLowerCase().includes(`[1m]`),n=jx(e);if(n.includes(`claude-opus-4-7`))return t?`Opus 4.7 (with 1M context)`:`Opus 4.7`;if(n.includes(`claude-opus-4-6`))return t?`Opus 4.6 (with 1M context)`:`Opus 4.6`;if(n.includes(`claude-opus-4-5`))return`Opus 4.5`;if(n.includes(`claude-opus-4-1`))return`Opus 4.1`;if(n.includes(`claude-opus-4`))return`Opus 4`;if(n.includes(`claude-sonnet-4-6`))return t?`Sonnet 4.6 (with 1M context)`:`Sonnet 4.6`;if(n.includes(`claude-sonnet-4-5`))return t?`Sonnet 4.5 (with 1M context)`:`Sonnet 4.5`;if(n.includes(`claude-sonnet-4`))return t?`Sonnet 4 (with 1M context)`:`Sonnet 4`;if(n.includes(`claude-3-7-sonnet`))return`Claude 3.7 Sonnet`;if(n.includes(`claude-3-5-sonnet`))return`Claude 3.5 Sonnet`;if(n.includes(`claude-haiku-4-5`))return`Haiku 4.5`;if(n.includes(`claude-3-5-haiku`))return`Claude 3.5 Haiku`}function Kx(e){return e.replace(/\[(1|2)m\]/gi,``)}var qx,Jx=t((()=>{O(),ib(),Q(),ES(),h(),wv(),tx(),B_(),hv(),Kp(),fx(),ox(),Pi(),vx(),qx=[`claude-opus-4-20250514`,`claude-opus-4-1-20250805`,`claude-opus-4-0`,`claude-opus-4-1`]}));function Yx(){return{error:(e,...t)=>console.error(`[Anthropic SDK ERROR]`,e,...t),warn:(e,...t)=>console.error(`[Anthropic SDK WARN]`,e,...t),info:(e,...t)=>console.error(`[Anthropic SDK INFO]`,e,...t),debug:(e,...t)=>console.error(`[Anthropic SDK DEBUG]`,e,...t)}}async function Xx({apiKey:e,maxRetries:t,model:r,fetchOverride:i,source:a}){let o=process.env.CLAUDE_CODE_CONTAINER_ID,s=process.env.CLAUDE_CODE_REMOTE_SESSION_ID,c=process.env.CLAUDE_AGENT_SDK_CLIENT_APP,l=Qx(),u={"x-app":`cli`,"User-Agent":rT(),"X-Claude-Code-Session-Id":at(),...l,...o?{"x-claude-remote-container-id":o}:{},...s?{"x-claude-remote-session-id":s}:{},...c?{"x-client-app":c}:{},...process.env.ANTHROPIC_AUTH_NONCE?{"x-auth-nonce":process.env.ANTHROPIC_AUTH_NONCE}:{}};M(`[API:request] Creating client, ANTHROPIC_CUSTOM_HEADERS present: ${!!process.env.ANTHROPIC_CUSTOM_HEADERS}, has Authorization header: ${!!l.Authorization}`),g(process.env.CLAUDE_CODE_ADDITIONAL_PROTECTION)&&(u[`x-anthropic-additional-protection`]=`true`),M(`[API:auth] OAuth token check starting`),await lw(),M(`[API:auth] OAuth token check complete`),Y()||await Zx(u,Mt());let d=$x(i,a),f={defaultHeaders:u,maxRetries:t,timeout:parseInt(process.env.API_TIMEOUT_MS||`600000`,10),dangerouslyAllowBrowser:!0,fetchOptions:Ii({forAnthropicAPI:!0}),...d&&{fetch:d}};if(g(process.env.CLAUDE_CODE_USE_BEDROCK)){let{BedrockClient:e}=await import(`./bedrockClient-BUmO2U-X.js`),t=r===yx()&&process.env.ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION?process.env.ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION:oe(),n={...f,awsRegion:t,...g(process.env.CLAUDE_CODE_SKIP_BEDROCK_AUTH)&&{skipAuth:!0},...Kn()&&{logger:Yx()}};if(process.env.AWS_BEARER_TOKEN_BEDROCK)n.skipAuth=!0,n.defaultHeaders={...n.defaultHeaders,Authorization:`Bearer ${process.env.AWS_BEARER_TOKEN_BEDROCK}`};else if(!g(process.env.CLAUDE_CODE_SKIP_BEDROCK_AUTH)){let e=await Lw();e&&(n.awsAccessKey=e.accessKeyId,n.awsSecretKey=e.secretAccessKey,n.awsSessionToken=e.sessionToken)}return new e(n)}if(g(process.env.CLAUDE_CODE_USE_FOUNDRY)){let{AnthropicFoundry:e}=await import(`./foundry-sdk-BFN5VDFQ.js`),t;if(!process.env.ANTHROPIC_FOUNDRY_API_KEY)if(g(process.env.CLAUDE_CODE_SKIP_FOUNDRY_AUTH))t=()=>Promise.resolve(``);else{let{DefaultAzureCredential:e,getBearerTokenProvider:n}=await import(`./esm-CsGLyWmS.js`);t=n(new e,`https://cognitiveservices.azure.com/.default`)}return new e({...f,...t&&{azureADTokenProvider:t},...Kn()&&{logger:Yx()}})}if(g(process.env.CLAUDE_CODE_USE_VERTEX)){g(process.env.CLAUDE_CODE_SKIP_VERTEX_AUTH)||await Vw();let[{AnthropicVertex:e},{GoogleAuth:t}]=await Promise.all([import(`./vertex-sdk-CSGw3fvU.js`),import(`./src-hdbPEvzO.js`).then(e=>n(e.default,1))]),i=process.env.GCLOUD_PROJECT||process.env.GOOGLE_CLOUD_PROJECT||process.env.gcloud_project||process.env.google_cloud_project,a=process.env.GOOGLE_APPLICATION_CREDENTIALS||process.env.google_application_credentials,o=g(process.env.CLAUDE_CODE_SKIP_VERTEX_AUTH)?{getClient:()=>({getRequestHeaders:()=>({})})}:new t({scopes:[`https://www.googleapis.com/auth/cloud-platform`],...i||a?{}:{projectId:process.env.ANTHROPIC_VERTEX_PROJECT_ID}});return new e({...f,region:te(r),googleAuth:o,...Kn()&&{logger:Yx()}})}return new se({apiKey:Y()?null:e||CC(),authToken:Y()?Z()?.accessToken:void 0,...process.env.USER_TYPE===`ant`&&g(process.env.USE_STAGING_OAUTH)?{baseURL:P().BASE_API_URL}:{},...f,...Kn()&&{logger:Yx()}})}async function Zx(e,t){let n=process.env.ANTHROPIC_AUTH_TOKEN||await PC(t);n&&(e.Authorization=`Bearer ${n}`)}function Qx(){let e={},t=process.env.ANTHROPIC_CUSTOM_HEADERS;if(!t)return e;let n=t.split(/\n|\r\n/);for(let t of n){if(!t.trim())continue;let n=t.indexOf(`:`);if(n===-1)continue;let r=t.slice(0,n).trim(),i=t.slice(n+1).trim();r&&(e[r]=i)}return e}function $x(e,t){let n=e??globalThis.fetch,r=W()===`firstParty`&&mv();return(e,i)=>{let a=new Headers(i?.headers);r&&!a.has(`x-client-request-id`)&&a.set(eS,ua());try{let n=e instanceof Request?e.url:String(e),r=a.get(eS);M(`[API REQUEST] ${new URL(n).pathname}${r?` ${eS}=${r}`:``} source=${t??`unknown`}`)}catch{}return n(e,{...i,headers:a})}}var eS,tS=t((()=>{vr(),Q(),cT(),Jx(),hv(),Li(),O(),kr(),j(),h(),eS=`x-client-request-id`}));function nS(){return R(ae(),`cache`)}function rS(){return R(nS(),`model-capabilities.json`)}function iS(){return!(W()!==`firstParty`||!mv())}function aS(e){return[...e].sort((e,t)=>t.id.length-e.id.length||e.id.localeCompare(t.id))}function oS(e){if(!iS())return;let t=uS(rS());if(!t||t.length===0)return;let n=e.toLowerCase();return t.find(e=>e.id.toLowerCase()===n)||t.find(e=>n.includes(e.id.toLowerCase()))}async function sS(){if(iS()&&!Br())try{let e=await Xx({maxRetries:1}),t=Y()?[Dr]:void 0,n=[];for await(let r of e.models.list({betas:t})){let e=cS().safeParse(r);e.success&&n.push(e.data)}if(n.length===0)return;let r=rS(),i=aS(n);if(Mu(uS(r),i)){M(`[modelCapabilities] cache unchanged, skipping write`);return}await fa(nS(),{recursive:!0}),await va(r,k({models:i,timestamp:Date.now()}),{encoding:`utf-8`,mode:384}),uS.cache.delete(r),M(`[modelCapabilities] cached ${i.length} models`)}catch(e){M(`[modelCapabilities] fetch failed: ${e instanceof Error?e.message:`unknown`}`)}}var cS,lS,uS,dS=t((()=>{Nu(),m(),Je(),kr(),tS(),Q(),j(),h(),di(),Ei(),zr(),An(),hv(),cS=L(()=>D({id:b(),max_input_tokens:y().optional(),max_tokens:y().optional()}).strip()),lS=L(()=>D({models:S(cS()),timestamp:y()})),uS=p(e=>{try{let t=ia(e,`utf-8`),n=lS().safeParse(fi(t,!1));return n.success?n.data.models:null}catch{return null}},e=>e)}));function fS(){return g(process.env.CLAUDE_CODE_DISABLE_1M_CONTEXT)}function pS(e){return fS()?!1:/\[1m\]/i.test(e)}function mS(e){if(fS())return!1;let t=jx(e);return t.includes(`claude-sonnet-4`)||t.includes(`opus-4-6`)||t.includes(`opus-4-7`)}function hS(e,t){if(process.env.USER_TYPE===`ant`&&process.env.CLAUDE_CODE_MAX_CONTEXT_TOKENS){let e=parseInt(process.env.CLAUDE_CODE_MAX_CONTEXT_TOKENS,10);if(!isNaN(e)&&e>0)return e}if(pS(e))return 1e6;let n=oS(e);if(n?.max_input_tokens&&n.max_input_tokens>=1e5)return n.max_input_tokens>2e5&&fS()?bS:n.max_input_tokens;if(t?.includes(`context-1m-2025-08-07`)&&mS(e)||gS(e))return 1e6;if(process.env.USER_TYPE===`ant`){let t=rb(e);if(t?.contextWindow)return t.contextWindow}return bS}function gS(e){return fS()||pS(e)||!jx(e).includes(`sonnet-4-6`)?!1:H().clientDataCache?.coral_reef_sonnet===`true`}function _S(e,t){if(!e)return{used:null,remaining:null};let n=e.input_tokens+e.cache_creation_input_tokens+e.cache_read_input_tokens;if(n===0)return{used:null,remaining:null};let r=Math.round(n/t*100),i=Math.min(100,Math.max(0,r));return{used:i,remaining:100-i}}function vS(e){let t,n;if(process.env.USER_TYPE===`ant`){let r=rb(e.toLowerCase());if(r)return t=r.defaultMaxTokens??SS,n=r.upperMaxTokensLimit??CS,{default:t,upperLimit:n}}let r=jx(e);r.includes(`opus-4-7`)||r.includes(`opus-4-6`)?(t=64e3,n=128e3):r.includes(`sonnet-4-6`)?(t=32e3,n=128e3):r.includes(`opus-4-5`)||r.includes(`sonnet-4`)||r.includes(`haiku-4`)?(t=32e3,n=64e3):r.includes(`opus-4-1`)||r.includes(`opus-4`)?(t=32e3,n=32e3):r.includes(`claude-3-opus`)?(t=4096,n=4096):r.includes(`claude-3-sonnet`)?(t=8192,n=8192):r.includes(`claude-3-haiku`)?(t=4096,n=4096):r.includes(`3-5-sonnet`)||r.includes(`3-5-haiku`)?(t=8192,n=8192):r.includes(`3-7-sonnet`)?(t=32e3,n=64e3):(t=SS,n=CS);let i=oS(e);return i?.max_tokens&&i.max_tokens>=4096&&(n=i.max_tokens,t=Math.min(t,n)),{default:t,upperLimit:n}}function yS(e){return vS(e).upperLimit-1}var bS,xS,SS,CS,wS,TS,ES=t((()=>{eb(),op(),h(),Jx(),ib(),dS(),bS=2e5,xS=2e4,SS=32e3,CS=64e3,wS=8e3,TS=64e3})),DS,OS,kS,AS=t((()=>{m(),hv(),DS=[{modelEnvVar:`ANTHROPIC_DEFAULT_OPUS_MODEL`,capabilitiesEnvVar:`ANTHROPIC_DEFAULT_OPUS_MODEL_SUPPORTED_CAPABILITIES`},{modelEnvVar:`ANTHROPIC_DEFAULT_SONNET_MODEL`,capabilitiesEnvVar:`ANTHROPIC_DEFAULT_SONNET_MODEL_SUPPORTED_CAPABILITIES`},{modelEnvVar:`ANTHROPIC_DEFAULT_HAIKU_MODEL`,capabilitiesEnvVar:`ANTHROPIC_DEFAULT_HAIKU_MODEL_SUPPORTED_CAPABILITIES`}],OS=[{modelEnvVar:`OPENAI_DEFAULT_OPUS_MODEL`,capabilitiesEnvVar:`OPENAI_DEFAULT_OPUS_MODEL_SUPPORTED_CAPABILITIES`},{modelEnvVar:`OPENAI_DEFAULT_SONNET_MODEL`,capabilitiesEnvVar:`OPENAI_DEFAULT_SONNET_MODEL_SUPPORTED_CAPABILITIES`},{modelEnvVar:`OPENAI_DEFAULT_HAIKU_MODEL`,capabilitiesEnvVar:`OPENAI_DEFAULT_HAIKU_MODEL_SUPPORTED_CAPABILITIES`}],kS=p((e,t)=>{if(W()===`firstParty`)return;let n=e.toLowerCase(),r=W()===`openai`?OS:DS;for(let e of r){let r=process.env[e.modelEnvVar],i=process.env[e.capabilitiesEnvVar];if(!(!r||i===void 0)&&n===r.toLowerCase())return i.toLowerCase().split(`,`).map(e=>e.trim()).includes(t)}},(e,t)=>`${e.toLowerCase()}:${t}`)}));function jS(e){let t=[],n=[];for(let r of e)HS.includes(r)?t.push(r):n.push(r);return{allowed:t,disallowed:n}}function MS(e){if(!e||e.length===0)return;if(Y()){console.warn(`Warning: Custom betas are only available for API key users. Ignoring provided betas.`);return}let{allowed:t,disallowed:n}=jS(e);for(let e of n)console.warn(`Warning: Beta header '${e}' is not allowed. Only the following betas are supported: ${HS.join(`, `)}`);return t.length>0?t:void 0}function NS(e){let t=kS(e,`interleaved_thinking`);if(t!==void 0)return t;let n=jx(e),r=W();return r===`foundry`?!0:r===`firstParty`?!n.includes(`claude-3-`):n.includes(`claude-opus-4`)||n.includes(`claude-sonnet-4`)}function PS(e){let t=jx(e);return t.includes(`claude-opus-4`)||t.includes(`claude-sonnet-4`)||t.includes(`claude-haiku-4`)}function FS(e){let t=jx(e),n=W();return n===`foundry`?!0:n===`firstParty`?!t.includes(`claude-3-`):t.includes(`claude-opus-4`)||t.includes(`claude-sonnet-4`)||t.includes(`claude-haiku-4`)}function IS(e){let t=jx(e),n=W();return n!==`firstParty`&&n!==`foundry`?!1:t.includes(`claude-sonnet-4-6`)||t.includes(`claude-sonnet-4-5`)||t.includes(`claude-opus-4-1`)||t.includes(`claude-opus-4-5`)||t.includes(`claude-opus-4-6`)||t.includes(`claude-opus-4-7`)||t.includes(`claude-haiku-4-5`)}function LS(e){return!0}function RS(){return(W()===`firstParty`||W()===`foundry`)&&!g(process.env.CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS)&&mv()}function zS(){return W()===`firstParty`&&!g(process.env.CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS)}function BS(e,t){let n=[...WS(e)];t?.isAgenticQuery&&(n.includes(`claude-code-20250219`)||n.push(Iy),process.env.USER_TYPE===`ant`&&process.env.CLAUDE_CODE_ENTRYPOINT===`cli`&&Xy&&!n.includes(Xy)&&n.push(Xy));let r=Cn();return!r||r.length===0?n:[...n,...r.filter(e=>!n.includes(e))]}function VS(){US.cache?.clear?.(),WS.cache?.clear?.(),GS.cache?.clear?.()}var HS,US,WS,GS,KS=t((()=>{m(),XO(),O(),eb(),kr(),Q(),ES(),h(),Jx(),AS(),hv(),B_(),HS=[Ry],US=p(e=>{let t=[],n=jx(e).includes(`haiku`),r=W(),i=RS();n||(t.push(Iy),process.env.USER_TYPE===`ant`&&process.env.CLAUDE_CODE_ENTRYPOINT===`cli`&&Xy&&t.push(Xy)),Y()&&t.push(Dr),pS(e)&&t.push(Ry),!g(process.env.DISABLE_INTERLEAVED_THINKING)&&NS(e)&&t.push(Ly),i&&NS(e)&&!Mt()&&A_().showThinkingSummaries!==!0&&t.push(qy);let a=g(process.env.USE_API_CONTEXT_MANAGEMENT)||FS(e),o=FS(e);RS()&&(a||o)&&t.push(zy);let s=SO(`tengu_tool_pear`),c=!s&&bO(`tengu_amber_json_tools`,!1);return i&&IS(e)&&s&&t.push(By),process.env.USER_TYPE===`ant`&&i&&c&&t.push(Jy),r===`vertex`&&PS(e)&&t.push(Vy),r===`foundry`&&t.push(Vy),i&&t.push(Gy),process.env.ANTHROPIC_BETAS&&t.push(...process.env.ANTHROPIC_BETAS.split(`,`).map(e=>e.trim()).filter(Boolean)),t}),WS=p(e=>{let t=US(e);return W()===`bedrock`?t.filter(e=>!Qy.has(e)):t}),GS=p(e=>US(e).filter(e=>Qy.has(e)))}));function qS(e,t){return{name:`${e.name}-with-${t.name}-fallback`,read(){return e.read()??(t.read()||{})},async readAsync(){return await e.readAsync()??(await t.readAsync()||{})},update(n){let r=e.read(),i=e.update(n);if(i.success)return r===null&&t.delete(),i;let a=t.update(n);return a.success?(r!==null&&e.delete(),{success:!0,warning:a.warning}):{success:!1}},delete(){let n=e.delete(),r=t.delete();return n||r}}}var JS=t((()=>{}));async function YS(){try{let e=by(wy),{stdout:t,code:n}=await ai(`security`,[`find-generic-password`,`-a`,xy(),`-w`,`-s`,e],{useCwd:!1,preserveOutputOnError:!1});if(n===0&&t)return kn(t.trim())}catch{}return null}function XS(){if($S!==void 0)return $S;if(process.platform!==`darwin`)return $S=!1,!1;try{$S=Mr(`security`,[`show-keychain-info`],{reject:!1,stdio:[`ignore`,`pipe`,`pipe`]}).exitCode===36}catch{$S=!1}return $S}var ZS,QS,$S,eC=t((()=>{Nr(),j(),ii(),ti(),An(),Ty(),ZS=4032,QS={name:`keychain`,read(){let e=K.cache;if(Date.now()-e.cachedAt<3e4)return e.data;try{let e=by(wy),t=ni(`security find-generic-password -a "${xy()}" -w -s "${e}"`);if(t){let e=kn(t);return K.cache={data:e,cachedAt:Date.now()},e}}catch{}return e.data===null?(K.cache={data:null,cachedAt:Date.now()},null):(M(`[keychain] read failed; serving stale cache`,{level:`warn`}),K.cache={data:e.data,cachedAt:Date.now()},e.data)},async readAsync(){let e=K.cache;if(Date.now()-e.cachedAt<3e4)return e.data;if(K.readInFlight)return K.readInFlight;let t=K.generation,n=YS().then(n=>{if(t===K.generation){n===null&&e.data!==null&&M(`[keychain] readAsync failed; serving stale cache`,{level:`warn`});let t=n??e.data;return K.cache={data:t,cachedAt:Date.now()},K.readInFlight=null,t}return n});return K.readInFlight=n,n},update(e){Sy();try{let t=by(wy),n=xy(),r=k(e),i=Buffer.from(r,`utf-8`).toString(`hex`),a=`add-generic-password -U -a "${n}" -s "${t}" -X "${i}"\n`,o;return a.length<=ZS?o=Mr(`security`,[`-i`],{input:a,stdio:[`pipe`,`pipe`,`pipe`],reject:!1}):(M(`Keychain payload (${r.length}B JSON) exceeds security -i stdin limit; using argv`,{level:`warn`}),o=Mr(`security`,[`add-generic-password`,`-U`,`-a`,n,`-s`,t,`-X`,i],{stdio:[`ignore`,`pipe`,`pipe`],reject:!1})),o.exitCode===0?(K.cache={data:e,cachedAt:Date.now()},{success:!0}):{success:!1}}catch{return{success:!1}}},delete(){Sy();try{let e=by(wy);return ni(`security delete-generic-password -a "${xy()}" -s "${e}"`),!0}catch{return!1}}}}));function tC(){let e=ae();return{storageDir:e,storagePath:R(e,`.credentials.json`)}}var nC,rC=t((()=>{h(),zn(),Vn(),An(),nC={name:`plaintext`,read(){let{storagePath:e}=tC();try{return kn(A().readFileSync(e,{encoding:`utf8`}))}catch{return null}},async readAsync(){let{storagePath:e}=tC();try{return kn(await A().readFile(e,{encoding:`utf8`}))}catch{return null}},update(e){try{let{storageDir:t,storagePath:n}=tC();try{A().mkdirSync(t)}catch(e){if(Dn(e)!==`EEXIST`)throw e}return En(n,k(e),{encoding:`utf8`,flush:!1}),ta(n,384),{success:!0,warning:`Warning: Storing credentials in plaintext.`}}catch{return{success:!1}}},delete(){let{storagePath:e}=tC();try{return A().unlinkSync(e),!0}catch(e){return Dn(e)===`ENOENT`}}}}));function iC(){return process.platform===`darwin`?qS(QS,nC):nC}var aC=t((()=>{JS(),eC(),rC()}));function oC(e){return new Promise(t=>{ba(`security`,[`find-generic-password`,`-a`,xy(),`-w`,`-s`,e],{encoding:`utf-8`,timeout:dC},(e,n)=>{t({stdout:e?null:n?.trim()||null,timedOut:!!(e&&`killed`in e&&e.killed)})})})}function sC(){if(process.platform!==`darwin`||pC||ne())return;let e=oC(by(wy)),t=oC(by());pC=Promise.all([e,t]).then(([e,t])=>{e.timedOut||Cy(e.stdout),t.timedOut||(fC={stdout:t.stdout})})}async function cC(){pC&&await pC}function lC(){return fC}function uC(){fC=null}var dC,fC,pC,mC=t((()=>{h(),Ty(),dC=1e4,fC=null,pC=null}));function hC(){return _C}function gC(){_C.clear()}var _C,vC=t((()=>{_C=new Map})),yC=r({calculateApiKeyHelperTTL:()=>MC,checkAndRefreshOAuthTokenIfNeeded:()=>lw,checkGcpCredentialsValid:()=>KC,clearApiKeyHelperCache:()=>RC,clearAwsCredentialsCache:()=>UC,clearGcpCredentialsCache:()=>YC,clearOAuthTokenCache:()=>iw,getAccountInformation:()=>kw,getAnthropicApiKey:()=>CC,getAnthropicApiKeyWithSource:()=>TC,getApiKeyFromApiKeyHelper:()=>PC,getApiKeyFromApiKeyHelperCached:()=>LC,getApiKeyFromConfigOrMacOSKeychain:()=>Hw,getApiKeyHelperElapsedMs:()=>NC,getAuthTokenSource:()=>SC,getClaudeAIOAuthTokens:()=>Z,getClaudeAIOAuthTokensAsync:()=>cw,getConfiguredApiKeyHelper:()=>EC,getOauthAccountInfo:()=>pw,getOtelHeadersFromHelper:()=>Ew,getRateLimitTier:()=>xw,getSubscriptionName:()=>Sw,getSubscriptionType:()=>X,handleOAuth401Error:()=>ow,hasAnthropicApiKeyAuth:()=>wC,hasOpusAccess:()=>hw,hasProfileScope:()=>dw,is1PApiCustomer:()=>fw,isAnthropicAuthEnabled:()=>xC,isAwsAuthRefreshFromProjectSettings:()=>kC,isAwsCredentialExportFromProjectSettings:()=>jC,isClaudeAISubscriber:()=>Y,isConsumerSubscriber:()=>Ow,isCustomApiKeyApproved:()=>ew,isEnterpriseSubscriber:()=>yw,isGcpAuthRefreshFromProjectSettings:()=>GC,isMaxSubscriber:()=>gw,isOtelHeadersHelperFromProjectOrLocalSettings:()=>Tw,isOverageProvisioningAllowed:()=>mw,isProSubscriber:()=>bw,isTeamPremiumSubscriber:()=>vw,isTeamSubscriber:()=>_w,isUsing3PServices:()=>Cw,prefetchApiKeyFromApiKeyHelperIfSafe:()=>zC,prefetchAwsCredentialsAndBedRockInfoIfSafe:()=>ZC,prefetchGcpCredentialsIfSafe:()=>XC,refreshAndGetAwsCredentials:()=>Lw,refreshAwsAuth:()=>VC,refreshGcpAuth:()=>JC,refreshGcpCredentialsIfNeeded:()=>Vw,removeApiKey:()=>tw,saveApiKey:()=>$C,saveOAuthTokensIfNeeded:()=>rw,validateForceLoginOrg:()=>Aw});function bC(){return g(process.env.CLAUDE_CODE_REMOTE)||process.env.CLAUDE_CODE_ENTRYPOINT===`claude-desktop`}function xC(){if(ne())return!1;if(process.env.ANTHROPIC_UNIX_SOCKET)return!!process.env.CLAUDE_CODE_OAUTH_TOKEN;let e=z_()||{},t=g(process.env.CLAUDE_CODE_USE_BEDROCK)||g(process.env.CLAUDE_CODE_USE_VERTEX)||g(process.env.CLAUDE_CODE_USE_FOUNDRY)||e.modelType===`openai`||e.modelType===`gemini`||!!process.env.OPENAI_BASE_URL||!!process.env.GEMINI_BASE_URL,n=e.apiKeyHelper,r=process.env.ANTHROPIC_AUTH_TOKEN||n||process.env.CLAUDE_CODE_API_KEY_FILE_DESCRIPTOR,{source:i}=TC({skipRetrievingKeyFromApiKeyHelper:!0}),a=i===`ANTHROPIC_API_KEY`||i===`apiKeyHelper`;return!(t||r&&!bC()||a&&!bC())}function SC(){if(ne())return EC()?{source:`apiKeyHelper`,hasToken:!0}:{source:`none`,hasToken:!1};if(process.env.ANTHROPIC_AUTH_TOKEN&&!bC())return{source:`ANTHROPIC_AUTH_TOKEN`,hasToken:!0};if(process.env.CLAUDE_CODE_OAUTH_TOKEN)return{source:`CLAUDE_CODE_OAUTH_TOKEN`,hasToken:!0};if(py())return process.env.CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTOR?{source:`CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTOR`,hasToken:!0}:{source:`CCR_OAUTH_TOKEN_FILE`,hasToken:!0};if(EC()&&!bC())return{source:`apiKeyHelper`,hasToken:!0};let e=Z();return Zv(e?.scopes)&&e?.accessToken?{source:`claude.ai`,hasToken:!0}:{source:`none`,hasToken:!1}}function CC(){let{key:e}=TC();return e}function wC(){let{key:e,source:t}=TC({skipRetrievingKeyFromApiKeyHelper:!0});return e!==null&&t!==`none`}function TC(e={}){if(ne())return process.env.ANTHROPIC_API_KEY?{key:process.env.ANTHROPIC_API_KEY,source:`ANTHROPIC_API_KEY`}:EC()?{key:e.skipRetrievingKeyFromApiKeyHelper?null:LC(),source:`apiKeyHelper`}:{key:null,source:`none`};let t=re()?void 0:process.env.ANTHROPIC_API_KEY;if(rn()&&t)return{key:t,source:`ANTHROPIC_API_KEY`};if(g(process.env.CI)){let e=my();if(e)return{key:e,source:`ANTHROPIC_API_KEY`};if(!t&&!process.env.CLAUDE_CODE_OAUTH_TOKEN&&!process.env.CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTOR)throw Error(`ANTHROPIC_API_KEY or CLAUDE_CODE_OAUTH_TOKEN env var is required`);return t?{key:t,source:`ANTHROPIC_API_KEY`}:{key:null,source:`none`}}if(t&&H().customApiKeyResponses?.approved?.includes(Dy(t)))return{key:t,source:`ANTHROPIC_API_KEY`};let n=my();return n?{key:n,source:`ANTHROPIC_API_KEY`}:EC()?e.skipRetrievingKeyFromApiKeyHelper?{key:null,source:`apiKeyHelper`}:{key:LC(),source:`apiKeyHelper`}:Hw()||{key:null,source:`none`}}function EC(){return ne()?U(`flagSettings`)?.apiKeyHelper:(z_()||{}).apiKeyHelper}function DC(){let e=EC();if(!e)return!1;let t=U(`projectSettings`),n=U(`localSettings`);return t?.apiKeyHelper===e||n?.apiKeyHelper===e}function OC(){return(z_()||{}).awsAuthRefresh}function kC(){let e=OC();if(!e)return!1;let t=U(`projectSettings`),n=U(`localSettings`);return t?.awsAuthRefresh===e||n?.awsAuthRefresh===e}function AC(){return(z_()||{}).awsCredentialExport}function jC(){let e=AC();if(!e)return!1;let t=U(`projectSettings`),n=U(`localSettings`);return t?.awsCredentialExport===e||n?.awsCredentialExport===e}function MC(){let e=process.env.CLAUDE_CODE_API_KEY_HELPER_TTL_MS;if(e){let t=parseInt(e,10);if(!Number.isNaN(t)&&t>=0)return t;M(`Found CLAUDE_CODE_API_KEY_HELPER_TTL_MS env var, but it was not a valid number. Got ${e}`,{level:`error`})}return jw}function NC(){let e=Nw?.startedAt;return e?Date.now()-e:0}async function PC(e){if(!EC())return null;let t=MC();return Mw?(Date.now()-Mw.timestamp<t||Nw||(Nw={promise:FC(e,!1,Pw),startedAt:null}),Mw.value):(Nw||(Nw={promise:FC(e,!0,Pw),startedAt:Date.now()}),Nw.promise)}async function FC(e,t,n){try{let t=await IC(e);return n===Pw&&t!==null&&(Mw={value:t,timestamp:Date.now()}),t}catch(e){if(n!==Pw)return` `;let r=e instanceof Error?e.message:String(e);return console.error(Xe.red(`apiKeyHelper failed: ${r}`)),M(`Error getting API key from apiKeyHelper: ${r}`,{level:`error`}),!t&&Mw&&Mw.value!==` `?(Mw={...Mw,timestamp:Date.now()},Mw.value):(Mw={value:` `,timestamp:Date.now()},` `)}finally{n===Pw&&(Nw=null)}}async function IC(e){let t=EC();if(!t)return null;if(DC()&&!yf()&&!e)return Jn(`apiKeyHelper invoked before trust check`,Error(`Security: apiKeyHelper executed before workspace trust is confirmed. If you see this message, post in .`)),N(`tengu_apiKeyHelper_missing_trust11`,{}),null;let n=await Pr(t,{shell:!0,timeout:600*1e3,reject:!1});if(n.failed){let e=n.timedOut?`timed out`:`exited ${n.exitCode}`,t=n.stderr?.trim();throw Error(t?`${e}: ${t}`:e)}let r=n.stdout?.trim();if(!r)throw Error(`did not return a value`);return r}function LC(){return Mw?.value??null}function RC(){Pw++,Mw=null,Nw=null}function zC(e){DC()&&!yf()||PC(e)}async function BC(){let e=OC();if(!e)return!1;if(kC()&&!yf()&&!Mt())return Jn(`awsAuthRefresh invoked before trust check`,Error(`Security: awsAuthRefresh executed before workspace trust is confirmed. If you see this message, post in .`)),N(`tengu_awsAuthRefresh_missing_trust`,{}),!1;try{return M(`Fetching AWS caller identity for AWS auth refresh command`),await jy(),M(`Fetched AWS caller identity, skipping AWS auth refresh command`),!1}catch{return VC(e)}}function VC(e){M(`Running AWS auth refresh command`);let t=Py.getInstance();return t.startAuthentication(),new Promise(n=>{let r=ya(e,{timeout:Iw});r.stdout.on(`data`,e=>{let n=e.toString().trim();n&&(t.addOutput(n),M(n,{level:`debug`}))}),r.stderr.on(`data`,e=>{let n=e.toString().trim();n&&(t.setError(n),M(n,{level:`error`}))}),r.on(`close`,(e,r)=>{if(e===0)M(`AWS auth refresh completed successfully`),t.endAuthentication(!0),n(!0);else{let e=r===`SIGTERM`?Xe.red(`AWS auth refresh timed out after 3 minutes. Run your auth command manually in a separate terminal.`):Xe.red(`Error running awsAuthRefresh (in settings or ~/.claude.json):`);console.error(e),t.endAuthentication(!1),n(!1)}})})}async function HC(){let e=AC();if(!e)return null;if(jC()&&!yf()&&!Mt())return Jn(`awsCredentialExport invoked before trust check`,Error(`Security: awsCredentialExport executed before workspace trust is confirmed. If you see this message, post in .`)),N(`tengu_awsCredentialExport_missing_trust`,{}),null;try{return M(`Fetching AWS caller identity for credential export command`),await jy(),M(`Fetched AWS caller identity, skipping AWS credential export command`),null}catch{try{M(`Running AWS credential export command`);let t=await Pr(e,{shell:!0,reject:!1});if(t.exitCode!==0||!t.stdout)throw Error(`awsCredentialExport did not return a valid value`);let n=kn(t.stdout.trim());if(!Ay(n))throw Error(`awsCredentialExport did not return valid AWS STS output structure`);return M(`AWS credentials retrieved from awsCredentialExport`),{accessKeyId:n.Credentials.AccessKeyId,secretAccessKey:n.Credentials.SecretAccessKey,sessionToken:n.Credentials.SessionToken}}catch(e){let t=Xe.red(`Error getting AWS credentials from awsCredentialExport (in settings or ~/.claude.json):`);return e instanceof Error?console.error(t,e.message):console.error(t,e),null}}}function UC(){Lw.cache.clear()}function WC(){return(z_()||{}).gcpAuthRefresh}function GC(){let e=WC();if(!e)return!1;let t=U(`projectSettings`),n=U(`localSettings`);return t?.gcpAuthRefresh===e||n?.gcpAuthRefresh===e}async function KC(){try{let{GoogleAuth:e}=await import(`./src-hdbPEvzO.js`).then(e=>n(e.default,1)),t=new e({scopes:[`https://www.googleapis.com/auth/cloud-platform`]}),r=(async()=>{await(await t.getClient()).getAccessToken()})(),i=Ri(Rw).then(()=>{throw new Yw(`GCP credentials check timed out`)});return await Promise.race([r,i]),!0}catch{return!1}}async function qC(){let e=WC();if(!e)return!1;if(GC()&&!yf()&&!Mt())return Jn(`gcpAuthRefresh invoked before trust check`,Error(`Security: gcpAuthRefresh executed before workspace trust is confirmed. If you see this message, post in .`)),N(`tengu_gcpAuthRefresh_missing_trust`,{}),!1;try{if(M(`Checking GCP credentials validity for auth refresh`),await KC())return M(`GCP credentials are valid, skipping auth refresh command`),!1}catch{}return JC(e)}function JC(e){M(`Running GCP auth refresh command`);let t=Py.getInstance();return t.startAuthentication(),new Promise(n=>{let r=ya(e,{timeout:Bw});r.stdout.on(`data`,e=>{let n=e.toString().trim();n&&(t.addOutput(n),M(n,{level:`debug`}))}),r.stderr.on(`data`,e=>{let n=e.toString().trim();n&&(t.setError(n),M(n,{level:`error`}))}),r.on(`close`,(e,r)=>{if(e===0)M(`GCP auth refresh completed successfully`),t.endAuthentication(!0),n(!0);else{let e=r===`SIGTERM`?Xe.red(`GCP auth refresh timed out after 3 minutes. Run your auth command manually in a separate terminal.`):Xe.red(`Error running gcpAuthRefresh (in settings or ~/.claude.json):`);console.error(e),t.endAuthentication(!1),n(!1)}})})}function YC(){Vw.cache.clear()}function XC(){WC()&&(GC()&&!yf()&&!Mt()||Vw())}function ZC(){let e=OC(),t=AC();!e&&!t||(kC()||jC())&&!yf()&&!Mt()||(Lw(),G())}function QC(e){return/^[a-zA-Z0-9-_]+$/.test(e)}async function $C(e){if(!QC(e))throw Error(`Invalid API key format. API key must contain only alphanumeric characters, dashes, and underscores.`);await nw();let t=!1;if(process.platform===`darwin`)try{let n=by();await Pr(`security`,[`-i`],{input:`add-generic-password -U -a "${xy()}" -s "${n}" -X "${Buffer.from(e,`utf-8`).toString(`hex`)}"\n`,reject:!1}),N(`tengu_api_key_saved_to_keychain`,{}),t=!0}catch(e){I(e),N(`tengu_api_key_keychain_error`,{error:pr(e)}),N(`tengu_api_key_saved_to_config`,{})}else N(`tengu_api_key_saved_to_config`,{});let n=Dy(e);V(r=>{let i=r.customApiKeyResponses?.approved??[];return{...r,primaryApiKey:t?r.primaryApiKey:e,customApiKeyResponses:{...r.customApiKeyResponses,approved:i.includes(n)?i:[...i,n],rejected:r.customApiKeyResponses?.rejected??[]}}}),Hw.cache.clear?.(),uC()}function ew(e){let t=H(),n=Dy(e);return t.customApiKeyResponses?.approved?.includes(n)??!1}async function tw(){await nw(),V(e=>({...e,primaryApiKey:void 0})),Hw.cache.clear?.(),uC()}async function nw(){try{await Ey()}catch(e){I(e)}}function rw(e){if(!Zv(e.scopes))return N(`tengu_oauth_tokens_not_claude_ai`,{}),{success:!0};if(!e.refreshToken||!e.expiresAt)return N(`tengu_oauth_tokens_inference_only`,{}),{success:!0};let t=iC(),n=t.name;try{let r=t.read()||{},i=r.claudeAiOauth;r.claudeAiOauth={accessToken:e.accessToken,refreshToken:e.refreshToken,expiresAt:e.expiresAt,scopes:e.scopes,subscriptionType:e.subscriptionType??i?.subscriptionType??null,rateLimitTier:e.rateLimitTier??i?.rateLimitTier??null};let a=t.update(r);return a.success?N(`tengu_oauth_tokens_saved`,{storageBackend:n}):N(`tengu_oauth_tokens_save_failed`,{storageBackend:n}),Z.cache?.clear?.(),VS(),gC(),a}catch(e){return I(e),N(`tengu_oauth_tokens_save_exception`,{storageBackend:n,error:pr(e)}),{success:!1,warning:`Failed to save OAuth tokens`}}}function iw(){Z.cache?.clear?.(),Sy()}async function aw(){try{let{mtimeMs:e}=await ga(R(ae(),`.credentials.json`));e!==Uw&&(Uw=e,iw())}catch{Z.cache?.clear?.()}}function ow(e){let t=Ww.get(e);if(t)return t;let n=sw(e).finally(()=>{Ww.delete(e)});return Ww.set(e,n),n}async function sw(e){iw();let t=await cw();return t?.refreshToken?t.accessToken===e?lw(0,!0):(N(`tengu_oauth_401_recovered_from_keychain`,{}),!0):!1}async function cw(){if(ne())return null;if(process.env.CLAUDE_CODE_OAUTH_TOKEN||py())return Z();try{let e=(await iC().readAsync())?.claudeAiOauth;return e?.accessToken?e:null}catch(e){return I(e),null}}function lw(e=0,t=!1){return e===0&&!t?Gw||(Gw=uw(e,t).finally(()=>{Gw=null}),Gw):uw(e,t)}async function uw(e,t){await aw();let n=Z();if(!t&&(!n?.refreshToken||!iy(n.expiresAt))||!n?.refreshToken||!Zv(n.scopes))return!1;Z.cache?.clear?.(),Sy();let r=await cw();if(!r?.refreshToken||!iy(r.expiresAt))return!1;let i=ae();await fa(i,{recursive:!0});let a;try{N(`tengu_oauth_token_refresh_lock_acquiring`,{}),a=await hi(i),N(`tengu_oauth_token_refresh_lock_acquired`,{})}catch(n){return n.code===`ELOCKED`?e<5?(N(`tengu_oauth_token_refresh_lock_retry`,{retryCount:e+1}),await Ri(1e3+Math.random()*1e3),uw(e+1,t)):(N(`tengu_oauth_token_refresh_lock_retry_limit_reached`,{maxRetries:5}),!1):(I(n),N(`tengu_oauth_token_refresh_lock_error`,{error:pr(n)}),!1)}try{Z.cache?.clear?.(),Sy();let e=await cw();return!e?.refreshToken||!iy(e.expiresAt)?(N(`tengu_oauth_token_refresh_race_resolved`,{}),!1):(N(`tengu_oauth_token_refresh_starting`,{}),rw(await ty(e.refreshToken,{scopes:Zv(e.scopes)?void 0:e.scopes})),Z.cache?.clear?.(),Sy(),!0)}catch(e){I(e),Z.cache?.clear?.(),Sy();let t=await cw();return t&&!iy(t.expiresAt)?(N(`tengu_oauth_token_refresh_race_recovered`,{}),!0):!1}finally{N(`tengu_oauth_token_refresh_lock_releasing`,{}),await a(),N(`tengu_oauth_token_refresh_lock_released`,{})}}function Y(){return xC()?Zv(Z()?.scopes):!1}function dw(){return Z()?.scopes?.includes(`user:profile`)??!1}function fw(){return!(g(process.env.CLAUDE_CODE_USE_BEDROCK)||g(process.env.CLAUDE_CODE_USE_VERTEX)||g(process.env.CLAUDE_CODE_USE_FOUNDRY)||Y())}function pw(){return xC()?H().oauthAccount:void 0}function mw(){let e=pw()?.billingType;return!(!Y()||!e||e!==`stripe_subscription`&&e!==`stripe_subscription_contracted`&&e!==`apple_subscription`&&e!==`google_play_subscription`)}function hw(){let e=X();return e===`max`||e===`enterprise`||e===`team`||e===`pro`||e===null}function X(){if(Iv())return Fv();if(!xC())return null;let e=Z();return e?e.subscriptionType??null:null}function gw(){return X()===`max`}function _w(){return X()===`team`}function vw(){return X()===`team`&&xw()===`default_claude_max_5x`}function yw(){return X()===`enterprise`}function bw(){return X()===`pro`}function xw(){if(!xC())return null;let e=Z();return e?e.rateLimitTier??null:null}function Sw(){switch(X()){case`enterprise`:return`Claude Enterprise`;case`team`:return`Claude Team`;case`max`:return`Claude Max`;case`pro`:return`Claude Pro`;default:return`Claude API`}}function Cw(){return!!(g(process.env.CLAUDE_CODE_USE_BEDROCK)||g(process.env.CLAUDE_CODE_USE_VERTEX)||g(process.env.CLAUDE_CODE_USE_FOUNDRY)||g(process.env.CLAUDE_CODE_USE_OPENAI)||g(process.env.CLAUDE_CODE_USE_GEMINI)||g(process.env.CLAUDE_CODE_USE_GROK))}function ww(){return(z_()||{}).otelHeadersHelper}function Tw(){let e=ww();if(!e)return!1;let t=U(`projectSettings`),n=U(`localSettings`);return t?.otelHeadersHelper===e||n?.otelHeadersHelper===e}function Ew(){let e=ww();if(!e)return{};let t=parseInt(process.env.CLAUDE_CODE_OTEL_HEADERS_HELPER_DEBOUNCE_MS||Jw.toString(),10);if(Kw&&Date.now()-qw<t)return Kw;if(Tw()&&!yf())return{};try{let t=ni(e,{timeout:3e4})?.toString().trim();if(!t)throw Error(`otelHeadersHelper did not return a valid value`);let n=kn(t);if(typeof n!=`object`||!n||Array.isArray(n))throw Error(`otelHeadersHelper must return a JSON object with string key-value pairs`);for(let[e,t]of Object.entries(n))if(typeof t!=`string`)throw Error(`otelHeadersHelper returned non-string value for key "${e}": ${typeof t}`);return Kw=n,qw=Date.now(),Kw}catch(e){throw I(Error(`Error getting OpenTelemetry headers from otelHeadersHelper (in settings): ${pr(e)}`)),e}}function Dw(e){return e===`max`||e===`pro`}function Ow(){let e=X();return Y()&&e!==null&&Dw(e)}function kw(){if(W()!==`firstParty`)return;let{source:e}=SC(),t={};e===`CLAUDE_CODE_OAUTH_TOKEN`||e===`CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTOR`?t.tokenSource=e:Y()?t.subscription=Sw():t.tokenSource=e;let{key:n,source:r}=TC();if(n&&(t.apiKeySource=r),e===`claude.ai`||r===`/login managed key`){let e=pw()?.organizationName;e&&(t.organization=e)}let i=pw()?.emailAddress;return(e===`claude.ai`||r===`/login managed key`)&&i&&(t.email=i),t}async function Aw(){if(process.env.ANTHROPIC_UNIX_SOCKET||!xC())return{valid:!0};let e=U(`policySettings`)?.forceLoginOrgUUID;if(!e)return{valid:!0};await lw();let t=Z();if(!t)return{valid:!0};let{source:n}=SC(),r=n===`CLAUDE_CODE_OAUTH_TOKEN`||n===`CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTOR`,i=await Yv(t.accessToken);if(!i)return{valid:!1,message:`Unable to verify organization for the current authentication token.\nThis machine requires organization ${e} but the profile could not be fetched.\nThis may be a network error, or the token may lack the user:profile scope required for\nverification (tokens from 'claude setup-token' do not include this scope).\nTry again, or obtain a full-scope token via 'claude auth login'.`};let a=i.organization.uuid;return a===e?{valid:!0}:r?{valid:!1,message:`The ${n===`CLAUDE_CODE_OAUTH_TOKEN`?`CLAUDE_CODE_OAUTH_TOKEN`:`CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTOR`} environment variable provides a token for a\ndifferent organization than required by this machine's managed settings.\n\nRequired organization: ${e}\nToken organization: ${a}\n\nRemove the environment variable or obtain a token for the correct organization.`}:{valid:!1,message:`Your authentication token belongs to organization ${a},\nbut this machine requires organization ${e}.\n\nPlease log in with the correct organization: claude auth login`}}var jw,Mw,Nw,Pw,Fw,Iw,Lw,Rw,zw,Bw,Vw,Hw,Z,Uw,Ww,Gw,Kw,qw,Jw,Yw,Q=t((()=>{Ze(),Nr(),m(),kr(),hr(),wv(),hv(),O(),qv(),ly(),Xv(),yy(),Oy(),Ny(),Fy(),KS(),op(),j(),h(),zn(),ii(),gi(),Vr(),Xr(),aC(),mC(),Ty(),B_(),zi(),An(),vC(),jw=300*1e3,Mw=null,Nw=null,Pw=0,Fw=3600*1e3,Iw=180*1e3,Lw=Yr(async()=>{let e=await BC(),t=await HC();return(e||t)&&await My(),t},Fw),Rw=5e3,zw=3600*1e3,Bw=180*1e3,Vw=Yr(async()=>await qC(),zw),Hw=p(()=>{if(ne())return null;if(process.platform===`darwin`){let e=lC();if(e){if(e.stdout)return{key:e.stdout,source:`/login managed key`}}else{let e=by();try{let t=ni(`security find-generic-password -a $USER -w -s "${e}"`);if(t)return{key:t,source:`/login managed key`}}catch(e){I(e)}}}let e=H();return e.primaryApiKey?{key:e.primaryApiKey,source:`/login managed key`}:null}),Z=p(()=>{if(ne())return null;if(process.env.CLAUDE_CODE_OAUTH_TOKEN)return{accessToken:process.env.CLAUDE_CODE_OAUTH_TOKEN,refreshToken:null,expiresAt:null,scopes:[`user:inference`],subscriptionType:null,rateLimitTier:null};let e=py();if(e)return{accessToken:e,refreshToken:null,expiresAt:null,scopes:[`user:inference`],subscriptionType:null,rateLimitTier:null};try{let e=iC().read()?.claudeAiOauth;return e?.accessToken?e:null}catch(e){return I(e),null}}),Uw=0,Ww=new Map,Gw=null,Kw=null,qw=0,Jw=1740*1e3,Yw=class extends Error{}}));function Xw(){return`claude-code/2.7.1`}var Zw=t((()=>{}));function Qw(){return tT.getStore()?.workload}function $w(e,t){return tT.run({workload:e},t)}var eT,tT,nT=t((()=>{eT=`cron`,tT=new xa}));function rT(){let e=process.env.CLAUDE_AGENT_SDK_VERSION?`, agent-sdk/${process.env.CLAUDE_AGENT_SDK_VERSION}`:``,t=process.env.CLAUDE_AGENT_SDK_CLIENT_APP?`, client-app/${process.env.CLAUDE_AGENT_SDK_CLIENT_APP}`:``,n=Qw(),r=n?`, workload/${n}`:``;return`claude-cli/2.7.1 (${process.env.USER_TYPE}, ${process.env.CLAUDE_CODE_ENTRYPOINT??`cli`}${e}${t}${r})`}function iT(){let e=[];return process.env.CLAUDE_CODE_ENTRYPOINT&&e.push(process.env.CLAUDE_CODE_ENTRYPOINT),process.env.CLAUDE_AGENT_SDK_VERSION&&e.push(`agent-sdk/${process.env.CLAUDE_AGENT_SDK_VERSION}`),process.env.CLAUDE_AGENT_SDK_CLIENT_APP&&e.push(`client-app/${process.env.CLAUDE_AGENT_SDK_CLIENT_APP}`),`claude-code/2.7.1${e.length>0?` (${e.join(`, `)})`:``}`}function aT(){return`Claude-User (${Xw()}; +https://support.anthropic.com/)`}function oT(){if(Y()){let e=Z();return e?.accessToken?{headers:{Authorization:`Bearer ${e.accessToken}`,"anthropic-beta":Dr}}:{headers:{},error:`No OAuth token available`}}let e=CC();return e?{headers:{"x-api-key":e}}:{headers:{},error:`No API key available`}}async function sT(e,t){try{return await e()}catch(n){if(!v.isAxiosError(n))throw n;let r=n.response?.status;if(!(r===401||t?.also403Revoked&&r===403&&typeof n.response?.data==`string`&&n.response.data.includes(`OAuth token has been revoked`)))throw n;let i=Z()?.accessToken;if(!i)throw n;return await ow(i),await e()}}var cT=t((()=>{Ie(),kr(),Q(),Zw(),nT()}));async function lT(){mT===null&&!hT&&(hT=pT(),mT=await hT,hT=null,gT.cache.clear?.())}function uT(){mT=null,hT=null,gT.cache.clear?.(),_T.cache.clear?.()}function dT(){return gT(!0)}function fT(){if(mT!==null)return mT;let e=pw();if(e?.emailAddress)return e.emailAddress;if(process.env.USER_TYPE===`ant`&&process.env.COO_CREATOR)return`${process.env.COO_CREATOR}@anthropic.com`}async function pT(){let e=pw();if(e?.emailAddress)return e.emailAddress;if(process.env.USER_TYPE===`ant`)return process.env.COO_CREATOR?`${process.env.COO_CREATOR}@anthropic.com`:_T()}var mT,hT,gT,_T,vT=t((()=>{Nr(),m(),O(),Q(),op(),gr(),Fr(),h(),mT=null,hT=null,gT=p(e=>{let t=Hf(),n=H(),r,i,a;if(e&&(r=X()??void 0,i=xw()??void 0,r&&n.claudeCodeFirstTokenDate)){let e=new Date(n.claudeCodeFirstTokenDate).getTime();isNaN(e)||(a=e)}let o=pw(),s=o?.organizationUuid,c=o?.accountUuid;return{deviceId:t,sessionId:at(),email:fT(),appVersion:`2.7.1`,platform:Ir(),organizationUuid:s,accountUuid:c,userType:process.env.USER_TYPE,subscriptionType:r,rateLimitTier:i,firstTokenTime:a,...g(process.env.GITHUB_ACTIONS)&&{githubActionsMetadata:{actor:process.env.GITHUB_ACTOR,actorId:process.env.GITHUB_ACTOR_ID,repository:process.env.GITHUB_REPOSITORY,repositoryId:process.env.GITHUB_REPOSITORY_ID,repositoryOwner:process.env.GITHUB_REPOSITORY_OWNER,repositoryOwnerId:process.env.GITHUB_REPOSITORY_OWNER_ID}}}}),_T=p(async()=>{let e=await Pr(`git config --get user.email`,{shell:!0,reject:!1,cwd:_r()});return e.exitCode===0&&e.stdout?e.stdout.trim():void 0})}));function yT(e){return bT(e,new WeakSet)}function bT(e,t){if(e==null||typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e instanceof Uint8Array)return!0;if(typeof e==`object`){if(t.has(e))return!1;if(t.add(e),Array.isArray(e))return e.every(e=>bT(e,t));let n=e;return n.constructor!==Object&&n.constructor!==void 0?!1:Object.values(n).every(e=>bT(e,t))}return!1}var xT=t((()=>{})),ST,CT=t((()=>{fe(),we(),Ee(),xT(),ce(),ST=class{set severityText(e){this._isLogRecordReadonly()||(this._severityText=e)}get severityText(){return this._severityText}set severityNumber(e){this._isLogRecordReadonly()||(this._severityNumber=e)}get severityNumber(){return this._severityNumber}set body(e){this._isLogRecordReadonly()||(this._body=e)}get body(){return this._body}get eventName(){return this._eventName}set eventName(e){this._isLogRecordReadonly()||(this._eventName=e)}get droppedAttributesCount(){return this._droppedAttributesCount}constructor(e,t,n){_(this,`hrTime`,void 0),_(this,`hrTimeObserved`,void 0),_(this,`spanContext`,void 0),_(this,`resource`,void 0),_(this,`instrumentationScope`,void 0),_(this,`attributes`,{}),_(this,`_severityText`,void 0),_(this,`_severityNumber`,void 0),_(this,`_body`,void 0),_(this,`_eventName`,void 0),_(this,`_attributesCount`,0),_(this,`_droppedAttributesCount`,0),_(this,`_isReadonly`,!1),_(this,`_logRecordLimits`,void 0);let{timestamp:r,observedTimestamp:i,eventName:a,severityNumber:o,severityText:s,body:c,attributes:l={},exception:u,context:d}=n,f=Date.now();if(this.hrTime=_e(r??f),this.hrTimeObserved=_e(i??f),d){let e=me.getSpanContext(d);e&&ue(e)&&(this.spanContext=e)}this.severityNumber=o,this.severityText=s,this.body=c,this.resource=e.resource,this.instrumentationScope=t,this._logRecordLimits=e.logRecordLimits,this._eventName=a,this.setAttributes(l),u!=null&&this._setException(u)}setAttribute(e,t){if(this._isLogRecordReadonly())return this;if(e.length===0)return pe.warn(`Invalid attribute key: ${e}`),this;if(!yT(t))return pe.warn(`Invalid attribute value set for key: ${e}`),this;let n=!Object.prototype.hasOwnProperty.call(this.attributes,e);return n&&this._attributesCount>=this._logRecordLimits.attributeCountLimit?(this._droppedAttributesCount++,this._droppedAttributesCount===1&&pe.warn(`Dropping extra attributes.`),this):(this.attributes[e]=this._truncateToSize(t),n&&this._attributesCount++,this)}setAttributes(e){for(let[t,n]of Object.entries(e))this.setAttribute(t,n);return this}setBody(e){return this.body=e,this}setEventName(e){return this.eventName=e,this}setSeverityNumber(e){return this.severityNumber=e,this}setSeverityText(e){return this.severityText=e,this}_makeReadonly(){this._isReadonly=!0}_truncateToSize(e){let t=this._logRecordLimits.attributeValueLengthLimit;if(t<=0)return pe.warn(`Attribute value limit must be positive, got ${t}`),e;if(e==null)return e;if(typeof e==`string`)return this._truncateToLimitUtil(e,t);if(e instanceof Uint8Array)return e;if(Array.isArray(e))return e.map(e=>this._truncateToSize(e));if(typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))t[n]=this._truncateToSize(r);return t}return e}_setException(e){let t=!1;if(typeof e==`string`||typeof e==`number`)Object.hasOwn(this.attributes,`exception.message`)||this.setAttribute(Me,String(e)),t=!0;else if(e&&typeof e==`object`){let n=e;n.code?(Object.hasOwn(this.attributes,`exception.type`)||this.setAttribute(be,n.code.toString()),t=!0):n.name&&(Object.hasOwn(this.attributes,`exception.type`)||this.setAttribute(be,n.name),t=!0),n.message&&(Object.hasOwn(this.attributes,`exception.message`)||this.setAttribute(Me,n.message),t=!0),n.stack&&(Object.hasOwn(this.attributes,`exception.stacktrace`)||this.setAttribute(ge,n.stack),t=!0)}t||pe.warn(`Failed to record an exception ${e}`)}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_isLogRecordReadonly(){return this._isReadonly&&pe.warn(`Can not execute the operation on emitted log record`),this._isReadonly}}})),wT,TT=t((()=>{Fe(),fe(),CT(),ce(),wT=class{constructor(e,t){_(this,`instrumentationScope`,void 0),_(this,`_sharedState`,void 0),_(this,`_loggerConfig`,void 0),this.instrumentationScope=e,this._sharedState=t,this._loggerConfig=this._sharedState.getLoggerConfig(this.instrumentationScope)}emit(e){let t=this._loggerConfig,n=e.context||he.active(),r=e.severityNumber??Ne.UNSPECIFIED;if(r!==Ne.UNSPECIFIED&&r<t.minimumSeverity)return;if(t.traceBased){let e=me.getSpanContext(n);if(e&&ue(e)&&(e.traceFlags&de.SAMPLED)!==de.SAMPLED)return}let i=new ST(this._sharedState,this.instrumentationScope,{context:n,...e});this._sharedState.loggerMetrics.emitLog(),this._sharedState.activeProcessor.onEmit(i,n),i._makeReadonly()}enabled(e){let t=this._loggerConfig;if(t.disabled)return!1;let n=e?.severityNumber;if(typeof n==`number`&&n!==Ne.UNSPECIFIED&&n<t.minimumSeverity)return!1;let r=e?.context||he.active();if(t.traceBased){let e=me.getSpanContext(r);if(e&&ue(e)&&(e.traceFlags&de.SAMPLED)!==de.SAMPLED)return!1}let i={context:r,instrumentationScope:this.instrumentationScope,severityNumber:e?.severityNumber,eventName:e?.eventName};for(let e of this._sharedState.processors)if(!e.enabled||e.enabled(i))return!0;return!1}}})),ET,DT=t((()=>{ET=class{forceFlush(){return Promise.resolve()}onEmit(e,t){}shutdown(){return Promise.resolve()}enabled(e){return!1}}})),OT,kT=t((()=>{we(),ce(),OT=class{constructor(e,t){_(this,`processors`,void 0),_(this,`forceFlushTimeoutMillis`,void 0),this.processors=e,this.forceFlushTimeoutMillis=t}async forceFlush(){let e=this.forceFlushTimeoutMillis;await Promise.all(this.processors.map(t=>Te(t.forceFlush(),e)))}onEmit(e,t){this.processors.forEach(n=>n.onEmit(e,t))}async shutdown(){await Promise.all(this.processors.map(e=>e.shutdown()))}enabled(e){for(let t of this.processors)if(!t.enabled||t.enabled(e))return!0;return!1}}}));function AT(e){return`${e.name}@${e.version||``}:${e.schemaUrl||``}`}var jT=t((()=>{})),MT,NT=t((()=>{MT=`otel.sdk.log.created`})),PT,FT=t((()=>{NT(),ce(),PT=class{constructor(e){_(this,`createdLogs`,void 0),this.createdLogs=e.createCounter(MT,{unit:`{log_record}`,description:`The number of logs submitted to enabled SDK Loggers.`})}emitLog(){this.createdLogs.add(1)}}})),IT,LT=t((()=>{IT=`0.215.0`})),RT,zT,BT,VT=t((()=>{fe(),Fe(),DT(),kT(),jT(),FT(),LT(),ce(),RT={disabled:!1,minimumSeverity:Ne.UNSPECIFIED,traceBased:!1},zT=()=>({...RT}),BT=class{constructor(e,t,n,r,i,a){_(this,`loggers`,new Map),_(this,`activeProcessor`,void 0),_(this,`registeredLogRecordProcessors`,[]),_(this,`resource`,void 0),_(this,`forceFlushTimeoutMillis`,void 0),_(this,`logRecordLimits`,void 0),_(this,`processors`,void 0),_(this,`loggerMetrics`,void 0),_(this,`_loggerConfigurator`,void 0),_(this,`_loggerConfigs`,new Map),this.resource=e,this.forceFlushTimeoutMillis=t,this.logRecordLimits=n,this.processors=r,r.length>0?(this.registeredLogRecordProcessors=r,this.activeProcessor=new OT(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis)):this.activeProcessor=new ET,this._loggerConfigurator=i??zT,this.loggerMetrics=new PT(a?a.getMeter(`@opentelemetry/sdk-logs`,IT):le())}getLoggerConfig(e){let t=AT(e),n=this._loggerConfigs.get(t);return n||(n=this._loggerConfigurator(e),this._loggerConfigs.set(t,n),n)}}})),HT,UT=t((()=>{fe(),Fe(),ke(),we(),TT(),VT(),ce(),HT=class{constructor(e={}){_(this,`_shutdownOnce`,void 0),_(this,`_sharedState`,void 0);let t={resource:e.resource??Ce(),forceFlushTimeoutMillis:e.forceFlushTimeoutMillis??3e4,logRecordLimits:{attributeCountLimit:e.logRecordLimits?.attributeCountLimit??128,attributeValueLengthLimit:e.logRecordLimits?.attributeValueLengthLimit??1/0},loggerConfigurator:e.loggerConfigurator??zT,processors:e.processors??[],meterProvider:e.meterProvider};this._sharedState=new BT(t.resource,t.forceFlushTimeoutMillis,t.logRecordLimits,t.processors,t.loggerConfigurator,t.meterProvider),this._shutdownOnce=new Ae(this._shutdown,this)}getLogger(e,t,n){if(this._shutdownOnce.isCalled)return pe.warn(`A shutdown LoggerProvider cannot provide a Logger`),Pe;e||pe.warn(`Logger requested without instrumentation scope name.`);let r=e||`unknown`,i=`${r}@${t||``}:${n?.schemaUrl||``}`;return this._sharedState.loggers.has(i)||this._sharedState.loggers.set(i,new wT({name:r,version:t,schemaUrl:n?.schemaUrl},this._sharedState)),this._sharedState.loggers.get(i)}forceFlush(){return this._shutdownOnce.isCalled?(pe.warn(`invalid attempt to force flush after LoggerProvider shutdown`),this._shutdownOnce.promise):this._sharedState.activeProcessor.forceFlush()}shutdown(){return this._shutdownOnce.isCalled?(pe.warn(`shutdown may only be called once per LoggerProvider`),this._shutdownOnce.promise):this._shutdownOnce.call()}_shutdown(){return this._sharedState.activeProcessor.shutdown()}}})),WT,GT=t((()=>{we(),WT=class{export(e,t){this._sendLogRecords(e,t)}async forceFlush(){}async shutdown(){}_exportInfo(e){return{resource:{attributes:e.resource.attributes},instrumentationScope:e.instrumentationScope,timestamp:je(e.hrTime),traceId:e.spanContext?.traceId,spanId:e.spanContext?.spanId,traceFlags:e.spanContext?.traceFlags,severityText:e.severityText,severityNumber:e.severityNumber,eventName:e.eventName,body:e.body,attributes:e.attributes}}_sendLogRecords(e,t){for(let t of e)console.dir(this._exportInfo(t),{depth:3});t?.({code:Se.SUCCESS})}}}));async function KT(e){let t=[];for(let n=0,r=e.length;n<r;n++){let r=e[n];r.resource.asyncAttributesPending&&r.resource.waitForAsyncAttributes&&t.push(r.resource.waitForAsyncAttributes())}t!=null&&t.length>0&&await Promise.all(t)}var qT,JT,YT=t((()=>{fe(),we(),ce(),qT=class{constructor(e,t,n){_(this,`_exportCompleted`,void 0),_(this,`_exportScheduledPromise`,void 0),_(this,`_exportScheduledResolve`,void 0),this._exportScheduledPromise=new Promise(e=>{this._exportScheduledResolve=e}),this._exportCompleted=this._executeExport(e,t,n)}get exportCompleted(){return this._exportCompleted}get exportScheduled(){return this._exportScheduledPromise}async _executeExport(e,t,n){try{await KT(t),await he.with(De(he.active()),async()=>this._exportWithTimeout(e,t,n))}catch(e){ye(e),this._exportScheduledResolve()}}async _exportWithTimeout(e,t,n){return new Promise((r,i)=>{let a=setTimeout(()=>{i(Error(`Timeout`))},n);e.export(t,e=>{clearTimeout(a),e.code===Se.SUCCESS?r():i(e.error??Error(`BatchLogRecordProcessor: log record export failed`))}),this._exportScheduledResolve()})}},JT=class{constructor(e,t){_(this,`_maxExportBatchSize`,void 0),_(this,`_maxQueueSize`,void 0),_(this,`_scheduledDelayMillis`,void 0),_(this,`_exportTimeoutMillis`,void 0),_(this,`_exporter`,void 0),_(this,`_currentExport`,null),_(this,`_finishedLogRecords`,[]),_(this,`_timer`,void 0),_(this,`_shutdownOnce`,void 0),_(this,`_flushing`,!1),this._exporter=e,this._maxExportBatchSize=t?.maxExportBatchSize??512,this._maxQueueSize=t?.maxQueueSize??2048,this._scheduledDelayMillis=t?.scheduledDelayMillis??5e3,this._exportTimeoutMillis=t?.exportTimeoutMillis??3e4,this._shutdownOnce=new Ae(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(pe.warn(`BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize`),this._maxExportBatchSize=this._maxQueueSize)}onEmit(e){this._shutdownOnce.isCalled||this._addToBuffer(e)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}_addToBuffer(e){this._finishedLogRecords.length>=this._maxQueueSize||(this._finishedLogRecords.push(e),this._maybeStartTimer())}shutdown(){return this._shutdownOnce.call()}async _shutdown(){this.onShutdown(),await this._flushAll(),await this._exporter.shutdown()}async _flushAll(){if(this._flushing)return;this._flushing=!0;let e=this._finishedLogRecords;for(this._finishedLogRecords=[],this._clearTimer(),this._currentExport!==null&&(await this._exporter.forceFlush(),await this._currentExport.exportCompleted,this._currentExport=null);e.length>0;){let t;e.length<=this._maxExportBatchSize?(t=e,e=[]):t=e.splice(0,this._maxExportBatchSize);let n=new qT(this._exporter,t,this._exportTimeoutMillis);this._currentExport=n;try{await n.exportScheduled,await this._exporter.forceFlush(),await n.exportCompleted}catch(e){ye(e)}finally{this._currentExport=null}}this._flushing=!1,this._maybeStartTimer()}_extractBatch(){if(this._finishedLogRecords.length===0)return null;if(this._finishedLogRecords.length<=this._maxExportBatchSize){let e=this._finishedLogRecords;return this._finishedLogRecords=[],e}else return this._finishedLogRecords.splice(0,this._maxExportBatchSize)}_exportOneBatch(){this._clearTimer();let e=this._extractBatch();if(e===null)return;let t=new qT(this._exporter,e,this._exportTimeoutMillis);this._currentExport=t,t.exportCompleted.then(()=>{this._currentExport=null,this._maybeStartTimer()}).catch(e=>{this._currentExport=null,ye(e),this._maybeStartTimer()})}_maybeStartTimer(){if(!this._shutdownOnce.isCalled&&!this._flushing&&this._finishedLogRecords.length!==0&&this._currentExport===null){if(this._finishedLogRecords.length>=this._maxExportBatchSize){this._exportOneBatch();return}this._timer===void 0&&(this._timer=setTimeout(()=>{this._timer=void 0,this._exportOneBatch()},this._scheduledDelayMillis),typeof this._timer!=`number`&&this._timer.unref())}}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}}})),XT,ZT=t((()=>{YT(),XT=class extends JT{onShutdown(){}}})),QT=t((()=>{ZT()})),$T=t((()=>{QT()})),eE=t((()=>{UT(),GT(),$T()}));function tE(){return g(process.env.CLAUDE_CODE_USE_BEDROCK)||g(process.env.CLAUDE_CODE_USE_VERTEX)||g(process.env.CLAUDE_CODE_USE_FOUNDRY)||Hr()}function nE(){return Hr()}var rE=t((()=>{h(),zr()}));function iE(){return{seconds:0,nanos:0}}function aE(e){return e!=null}var oE,sE=t((()=>{oE={fromJSON(e){return{seconds:aE(e.seconds)?globalThis.Number(e.seconds):0,nanos:aE(e.nanos)?globalThis.Number(e.nanos):0}},toJSON(e){let t={};return e.seconds!==void 0&&(t.seconds=Math.round(e.seconds)),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},create(e){return oE.fromPartial(e??{})},fromPartial(e){let t=iE();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}}}));function cE(){return{account_id:0,organization_uuid:``,account_uuid:``}}function lE(e){return e!=null}var uE,dE=t((()=>{uE={fromJSON(e){return{account_id:lE(e.account_id)?globalThis.Number(e.account_id):0,organization_uuid:lE(e.organization_uuid)?globalThis.String(e.organization_uuid):``,account_uuid:lE(e.account_uuid)?globalThis.String(e.account_uuid):``}},toJSON(e){let t={};return e.account_id!==void 0&&(t.account_id=Math.round(e.account_id)),e.organization_uuid!==void 0&&(t.organization_uuid=e.organization_uuid),e.account_uuid!==void 0&&(t.account_uuid=e.account_uuid),t},create(e){return uE.fromPartial(e??{})},fromPartial(e){let t=cE();return t.account_id=e.account_id??0,t.organization_uuid=e.organization_uuid??``,t.account_uuid=e.account_uuid??``,t}}}));function fE(){return{actor_id:``,repository_id:``,repository_owner_id:``}}function pE(){return{platform:``,node_version:``,terminal:``,package_managers:``,runtimes:``,is_running_with_bun:!1,is_ci:!1,is_claubbit:!1,is_github_action:!1,is_claude_code_action:!1,is_claude_ai_auth:!1,version:``,github_event_name:``,github_actions_runner_environment:``,github_actions_runner_os:``,github_action_ref:``,wsl_version:``,github_actions_metadata:void 0,arch:``,is_claude_code_remote:!1,remote_environment_type:``,claude_code_container_id:``,claude_code_remote_session_id:``,tags:[],deployment_environment:``,is_conductor:!1,version_base:``,coworker_type:``,build_time:``,is_local_agent_mode:!1,linux_distro_id:``,linux_distro_version:``,linux_kernel:``,vcs:``,platform_raw:``}}function mE(){return{slack_team_id:``,is_enterprise_install:!1,trigger:``,creation_method:``}}function hE(){return{event_name:``,client_timestamp:void 0,model:``,session_id:``,user_type:``,betas:``,env:void 0,entrypoint:``,agent_sdk_version:``,is_interactive:!1,client_type:``,process:``,additional_metadata:``,auth:void 0,server_timestamp:void 0,event_id:``,device_id:``,swe_bench_run_id:``,swe_bench_instance_id:``,swe_bench_task_id:``,email:``,agent_id:``,parent_session_id:``,agent_type:``,slack:void 0,team_name:``,skill_name:``,plugin_name:``,marketplace_name:``}}function gE(e){let t=(e.seconds||0)*1e3;return t+=(e.nanos||0)/1e6,new globalThis.Date(t)}function _E(e){return e instanceof globalThis.Date?e:typeof e==`string`?new globalThis.Date(e):gE(oE.fromJSON(e))}function $(e){return e!=null}var vE,yE,bE,xE,SE=t((()=>{sE(),dE(),vE={fromJSON(e){return{actor_id:$(e.actor_id)?globalThis.String(e.actor_id):``,repository_id:$(e.repository_id)?globalThis.String(e.repository_id):``,repository_owner_id:$(e.repository_owner_id)?globalThis.String(e.repository_owner_id):``}},toJSON(e){let t={};return e.actor_id!==void 0&&(t.actor_id=e.actor_id),e.repository_id!==void 0&&(t.repository_id=e.repository_id),e.repository_owner_id!==void 0&&(t.repository_owner_id=e.repository_owner_id),t},create(e){return vE.fromPartial(e??{})},fromPartial(e){let t=fE();return t.actor_id=e.actor_id??``,t.repository_id=e.repository_id??``,t.repository_owner_id=e.repository_owner_id??``,t}},yE={fromJSON(e){return{platform:$(e.platform)?globalThis.String(e.platform):``,node_version:$(e.node_version)?globalThis.String(e.node_version):``,terminal:$(e.terminal)?globalThis.String(e.terminal):``,package_managers:$(e.package_managers)?globalThis.String(e.package_managers):``,runtimes:$(e.runtimes)?globalThis.String(e.runtimes):``,is_running_with_bun:$(e.is_running_with_bun)?globalThis.Boolean(e.is_running_with_bun):!1,is_ci:$(e.is_ci)?globalThis.Boolean(e.is_ci):!1,is_claubbit:$(e.is_claubbit)?globalThis.Boolean(e.is_claubbit):!1,is_github_action:$(e.is_github_action)?globalThis.Boolean(e.is_github_action):!1,is_claude_code_action:$(e.is_claude_code_action)?globalThis.Boolean(e.is_claude_code_action):!1,is_claude_ai_auth:$(e.is_claude_ai_auth)?globalThis.Boolean(e.is_claude_ai_auth):!1,version:$(e.version)?globalThis.String(e.version):``,github_event_name:$(e.github_event_name)?globalThis.String(e.github_event_name):``,github_actions_runner_environment:$(e.github_actions_runner_environment)?globalThis.String(e.github_actions_runner_environment):``,github_actions_runner_os:$(e.github_actions_runner_os)?globalThis.String(e.github_actions_runner_os):``,github_action_ref:$(e.github_action_ref)?globalThis.String(e.github_action_ref):``,wsl_version:$(e.wsl_version)?globalThis.String(e.wsl_version):``,github_actions_metadata:$(e.github_actions_metadata)?vE.fromJSON(e.github_actions_metadata):void 0,arch:$(e.arch)?globalThis.String(e.arch):``,is_claude_code_remote:$(e.is_claude_code_remote)?globalThis.Boolean(e.is_claude_code_remote):!1,remote_environment_type:$(e.remote_environment_type)?globalThis.String(e.remote_environment_type):``,claude_code_container_id:$(e.claude_code_container_id)?globalThis.String(e.claude_code_container_id):``,claude_code_remote_session_id:$(e.claude_code_remote_session_id)?globalThis.String(e.claude_code_remote_session_id):``,tags:globalThis.Array.isArray(e?.tags)?e.tags.map(e=>globalThis.String(e)):[],deployment_environment:$(e.deployment_environment)?globalThis.String(e.deployment_environment):``,is_conductor:$(e.is_conductor)?globalThis.Boolean(e.is_conductor):!1,version_base:$(e.version_base)?globalThis.String(e.version_base):``,coworker_type:$(e.coworker_type)?globalThis.String(e.coworker_type):``,build_time:$(e.build_time)?globalThis.String(e.build_time):``,is_local_agent_mode:$(e.is_local_agent_mode)?globalThis.Boolean(e.is_local_agent_mode):!1,linux_distro_id:$(e.linux_distro_id)?globalThis.String(e.linux_distro_id):``,linux_distro_version:$(e.linux_distro_version)?globalThis.String(e.linux_distro_version):``,linux_kernel:$(e.linux_kernel)?globalThis.String(e.linux_kernel):``,vcs:$(e.vcs)?globalThis.String(e.vcs):``,platform_raw:$(e.platform_raw)?globalThis.String(e.platform_raw):``}},toJSON(e){let t={};return e.platform!==void 0&&(t.platform=e.platform),e.node_version!==void 0&&(t.node_version=e.node_version),e.terminal!==void 0&&(t.terminal=e.terminal),e.package_managers!==void 0&&(t.package_managers=e.package_managers),e.runtimes!==void 0&&(t.runtimes=e.runtimes),e.is_running_with_bun!==void 0&&(t.is_running_with_bun=e.is_running_with_bun),e.is_ci!==void 0&&(t.is_ci=e.is_ci),e.is_claubbit!==void 0&&(t.is_claubbit=e.is_claubbit),e.is_github_action!==void 0&&(t.is_github_action=e.is_github_action),e.is_claude_code_action!==void 0&&(t.is_claude_code_action=e.is_claude_code_action),e.is_claude_ai_auth!==void 0&&(t.is_claude_ai_auth=e.is_claude_ai_auth),e.version!==void 0&&(t.version=e.version),e.github_event_name!==void 0&&(t.github_event_name=e.github_event_name),e.github_actions_runner_environment!==void 0&&(t.github_actions_runner_environment=e.github_actions_runner_environment),e.github_actions_runner_os!==void 0&&(t.github_actions_runner_os=e.github_actions_runner_os),e.github_action_ref!==void 0&&(t.github_action_ref=e.github_action_ref),e.wsl_version!==void 0&&(t.wsl_version=e.wsl_version),e.github_actions_metadata!==void 0&&(t.github_actions_metadata=vE.toJSON(e.github_actions_metadata)),e.arch!==void 0&&(t.arch=e.arch),e.is_claude_code_remote!==void 0&&(t.is_claude_code_remote=e.is_claude_code_remote),e.remote_environment_type!==void 0&&(t.remote_environment_type=e.remote_environment_type),e.claude_code_container_id!==void 0&&(t.claude_code_container_id=e.claude_code_container_id),e.claude_code_remote_session_id!==void 0&&(t.claude_code_remote_session_id=e.claude_code_remote_session_id),e.tags?.length&&(t.tags=e.tags),e.deployment_environment!==void 0&&(t.deployment_environment=e.deployment_environment),e.is_conductor!==void 0&&(t.is_conductor=e.is_conductor),e.version_base!==void 0&&(t.version_base=e.version_base),e.coworker_type!==void 0&&(t.coworker_type=e.coworker_type),e.build_time!==void 0&&(t.build_time=e.build_time),e.is_local_agent_mode!==void 0&&(t.is_local_agent_mode=e.is_local_agent_mode),e.linux_distro_id!==void 0&&(t.linux_distro_id=e.linux_distro_id),e.linux_distro_version!==void 0&&(t.linux_distro_version=e.linux_distro_version),e.linux_kernel!==void 0&&(t.linux_kernel=e.linux_kernel),e.vcs!==void 0&&(t.vcs=e.vcs),e.platform_raw!==void 0&&(t.platform_raw=e.platform_raw),t},create(e){return yE.fromPartial(e??{})},fromPartial(e){let t=pE();return t.platform=e.platform??``,t.node_version=e.node_version??``,t.terminal=e.terminal??``,t.package_managers=e.package_managers??``,t.runtimes=e.runtimes??``,t.is_running_with_bun=e.is_running_with_bun??!1,t.is_ci=e.is_ci??!1,t.is_claubbit=e.is_claubbit??!1,t.is_github_action=e.is_github_action??!1,t.is_claude_code_action=e.is_claude_code_action??!1,t.is_claude_ai_auth=e.is_claude_ai_auth??!1,t.version=e.version??``,t.github_event_name=e.github_event_name??``,t.github_actions_runner_environment=e.github_actions_runner_environment??``,t.github_actions_runner_os=e.github_actions_runner_os??``,t.github_action_ref=e.github_action_ref??``,t.wsl_version=e.wsl_version??``,t.github_actions_metadata=e.github_actions_metadata!==void 0&&e.github_actions_metadata!==null?vE.fromPartial(e.github_actions_metadata):void 0,t.arch=e.arch??``,t.is_claude_code_remote=e.is_claude_code_remote??!1,t.remote_environment_type=e.remote_environment_type??``,t.claude_code_container_id=e.claude_code_container_id??``,t.claude_code_remote_session_id=e.claude_code_remote_session_id??``,t.tags=e.tags?.map(e=>e)||[],t.deployment_environment=e.deployment_environment??``,t.is_conductor=e.is_conductor??!1,t.version_base=e.version_base??``,t.coworker_type=e.coworker_type??``,t.build_time=e.build_time??``,t.is_local_agent_mode=e.is_local_agent_mode??!1,t.linux_distro_id=e.linux_distro_id??``,t.linux_distro_version=e.linux_distro_version??``,t.linux_kernel=e.linux_kernel??``,t.vcs=e.vcs??``,t.platform_raw=e.platform_raw??``,t}},bE={fromJSON(e){return{slack_team_id:$(e.slack_team_id)?globalThis.String(e.slack_team_id):``,is_enterprise_install:$(e.is_enterprise_install)?globalThis.Boolean(e.is_enterprise_install):!1,trigger:$(e.trigger)?globalThis.String(e.trigger):``,creation_method:$(e.creation_method)?globalThis.String(e.creation_method):``}},toJSON(e){let t={};return e.slack_team_id!==void 0&&(t.slack_team_id=e.slack_team_id),e.is_enterprise_install!==void 0&&(t.is_enterprise_install=e.is_enterprise_install),e.trigger!==void 0&&(t.trigger=e.trigger),e.creation_method!==void 0&&(t.creation_method=e.creation_method),t},create(e){return bE.fromPartial(e??{})},fromPartial(e){let t=mE();return t.slack_team_id=e.slack_team_id??``,t.is_enterprise_install=e.is_enterprise_install??!1,t.trigger=e.trigger??``,t.creation_method=e.creation_method??``,t}},xE={fromJSON(e){return{event_name:$(e.event_name)?globalThis.String(e.event_name):``,client_timestamp:$(e.client_timestamp)?_E(e.client_timestamp):void 0,model:$(e.model)?globalThis.String(e.model):``,session_id:$(e.session_id)?globalThis.String(e.session_id):``,user_type:$(e.user_type)?globalThis.String(e.user_type):``,betas:$(e.betas)?globalThis.String(e.betas):``,env:$(e.env)?yE.fromJSON(e.env):void 0,entrypoint:$(e.entrypoint)?globalThis.String(e.entrypoint):``,agent_sdk_version:$(e.agent_sdk_version)?globalThis.String(e.agent_sdk_version):``,is_interactive:$(e.is_interactive)?globalThis.Boolean(e.is_interactive):!1,client_type:$(e.client_type)?globalThis.String(e.client_type):``,process:$(e.process)?globalThis.String(e.process):``,additional_metadata:$(e.additional_metadata)?globalThis.String(e.additional_metadata):``,auth:$(e.auth)?uE.fromJSON(e.auth):void 0,server_timestamp:$(e.server_timestamp)?_E(e.server_timestamp):void 0,event_id:$(e.event_id)?globalThis.String(e.event_id):``,device_id:$(e.device_id)?globalThis.String(e.device_id):``,swe_bench_run_id:$(e.swe_bench_run_id)?globalThis.String(e.swe_bench_run_id):``,swe_bench_instance_id:$(e.swe_bench_instance_id)?globalThis.String(e.swe_bench_instance_id):``,swe_bench_task_id:$(e.swe_bench_task_id)?globalThis.String(e.swe_bench_task_id):``,email:$(e.email)?globalThis.String(e.email):``,agent_id:$(e.agent_id)?globalThis.String(e.agent_id):``,parent_session_id:$(e.parent_session_id)?globalThis.String(e.parent_session_id):``,agent_type:$(e.agent_type)?globalThis.String(e.agent_type):``,slack:$(e.slack)?bE.fromJSON(e.slack):void 0,team_name:$(e.team_name)?globalThis.String(e.team_name):``,skill_name:$(e.skill_name)?globalThis.String(e.skill_name):``,plugin_name:$(e.plugin_name)?globalThis.String(e.plugin_name):``,marketplace_name:$(e.marketplace_name)?globalThis.String(e.marketplace_name):``}},toJSON(e){let t={};return e.event_name!==void 0&&(t.event_name=e.event_name),e.client_timestamp!==void 0&&(t.client_timestamp=e.client_timestamp.toISOString()),e.model!==void 0&&(t.model=e.model),e.session_id!==void 0&&(t.session_id=e.session_id),e.user_type!==void 0&&(t.user_type=e.user_type),e.betas!==void 0&&(t.betas=e.betas),e.env!==void 0&&(t.env=yE.toJSON(e.env)),e.entrypoint!==void 0&&(t.entrypoint=e.entrypoint),e.agent_sdk_version!==void 0&&(t.agent_sdk_version=e.agent_sdk_version),e.is_interactive!==void 0&&(t.is_interactive=e.is_interactive),e.client_type!==void 0&&(t.client_type=e.client_type),e.process!==void 0&&(t.process=e.process),e.additional_metadata!==void 0&&(t.additional_metadata=e.additional_metadata),e.auth!==void 0&&(t.auth=uE.toJSON(e.auth)),e.server_timestamp!==void 0&&(t.server_timestamp=e.server_timestamp.toISOString()),e.event_id!==void 0&&(t.event_id=e.event_id),e.device_id!==void 0&&(t.device_id=e.device_id),e.swe_bench_run_id!==void 0&&(t.swe_bench_run_id=e.swe_bench_run_id),e.swe_bench_instance_id!==void 0&&(t.swe_bench_instance_id=e.swe_bench_instance_id),e.swe_bench_task_id!==void 0&&(t.swe_bench_task_id=e.swe_bench_task_id),e.email!==void 0&&(t.email=e.email),e.agent_id!==void 0&&(t.agent_id=e.agent_id),e.parent_session_id!==void 0&&(t.parent_session_id=e.parent_session_id),e.agent_type!==void 0&&(t.agent_type=e.agent_type),e.slack!==void 0&&(t.slack=bE.toJSON(e.slack)),e.team_name!==void 0&&(t.team_name=e.team_name),e.skill_name!==void 0&&(t.skill_name=e.skill_name),e.plugin_name!==void 0&&(t.plugin_name=e.plugin_name),e.marketplace_name!==void 0&&(t.marketplace_name=e.marketplace_name),t},create(e){return xE.fromPartial(e??{})},fromPartial(e){let t=hE();return t.event_name=e.event_name??``,t.client_timestamp=e.client_timestamp??void 0,t.model=e.model??``,t.session_id=e.session_id??``,t.user_type=e.user_type??``,t.betas=e.betas??``,t.env=e.env!==void 0&&e.env!==null?yE.fromPartial(e.env):void 0,t.entrypoint=e.entrypoint??``,t.agent_sdk_version=e.agent_sdk_version??``,t.is_interactive=e.is_interactive??!1,t.client_type=e.client_type??``,t.process=e.process??``,t.additional_metadata=e.additional_metadata??``,t.auth=e.auth!==void 0&&e.auth!==null?uE.fromPartial(e.auth):void 0,t.server_timestamp=e.server_timestamp??void 0,t.event_id=e.event_id??``,t.device_id=e.device_id??``,t.swe_bench_run_id=e.swe_bench_run_id??``,t.swe_bench_instance_id=e.swe_bench_instance_id??``,t.swe_bench_task_id=e.swe_bench_task_id??``,t.email=e.email??``,t.agent_id=e.agent_id??``,t.parent_session_id=e.parent_session_id??``,t.agent_type=e.agent_type??``,t.slack=e.slack!==void 0&&e.slack!==null?bE.fromPartial(e.slack):void 0,t.team_name=e.team_name??``,t.skill_name=e.skill_name??``,t.plugin_name=e.plugin_name??``,t.marketplace_name=e.marketplace_name??``,t}}}));function CE(){return{event_id:``,timestamp:void 0,experiment_id:``,variation_id:0,environment:``,user_attributes:``,experiment_metadata:``,device_id:``,auth:void 0,session_id:``,anonymous_id:``,event_metadata_vars:``}}function wE(e){let t=(e.seconds||0)*1e3;return t+=(e.nanos||0)/1e6,new globalThis.Date(t)}function TE(e){return e instanceof globalThis.Date?e:typeof e==`string`?new globalThis.Date(e):wE(oE.fromJSON(e))}function EE(e){return e!=null}var DE,OE=t((()=>{sE(),dE(),DE={fromJSON(e){return{event_id:EE(e.event_id)?globalThis.String(e.event_id):``,timestamp:EE(e.timestamp)?TE(e.timestamp):void 0,experiment_id:EE(e.experiment_id)?globalThis.String(e.experiment_id):``,variation_id:EE(e.variation_id)?globalThis.Number(e.variation_id):0,environment:EE(e.environment)?globalThis.String(e.environment):``,user_attributes:EE(e.user_attributes)?globalThis.String(e.user_attributes):``,experiment_metadata:EE(e.experiment_metadata)?globalThis.String(e.experiment_metadata):``,device_id:EE(e.device_id)?globalThis.String(e.device_id):``,auth:EE(e.auth)?uE.fromJSON(e.auth):void 0,session_id:EE(e.session_id)?globalThis.String(e.session_id):``,anonymous_id:EE(e.anonymous_id)?globalThis.String(e.anonymous_id):``,event_metadata_vars:EE(e.event_metadata_vars)?globalThis.String(e.event_metadata_vars):``}},toJSON(e){let t={};return e.event_id!==void 0&&(t.event_id=e.event_id),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),e.experiment_id!==void 0&&(t.experiment_id=e.experiment_id),e.variation_id!==void 0&&(t.variation_id=Math.round(e.variation_id)),e.environment!==void 0&&(t.environment=e.environment),e.user_attributes!==void 0&&(t.user_attributes=e.user_attributes),e.experiment_metadata!==void 0&&(t.experiment_metadata=e.experiment_metadata),e.device_id!==void 0&&(t.device_id=e.device_id),e.auth!==void 0&&(t.auth=uE.toJSON(e.auth)),e.session_id!==void 0&&(t.session_id=e.session_id),e.anonymous_id!==void 0&&(t.anonymous_id=e.anonymous_id),e.event_metadata_vars!==void 0&&(t.event_metadata_vars=e.event_metadata_vars),t},create(e){return DE.fromPartial(e??{})},fromPartial(e){let t=CE();return t.event_id=e.event_id??``,t.timestamp=e.timestamp??void 0,t.experiment_id=e.experiment_id??``,t.variation_id=e.variation_id??0,t.environment=e.environment??``,t.user_attributes=e.user_attributes??``,t.experiment_metadata=e.experiment_metadata??``,t.device_id=e.device_id??``,t.auth=e.auth!==void 0&&e.auth!==null?uE.fromPartial(e.auth):void 0,t.session_id=e.session_id??``,t.anonymous_id=e.anonymous_id??``,t.event_metadata_vars=e.event_metadata_vars??``,t}}}));function kE(){return process.platform===`linux`&&g(process.env.CLAUDE_CODE_BUBBLEWRAP)}function AE(){return process.platform===`linux`?IE??!1:!1}async function jE(){if(LE!==void 0)return LE;if(process.platform===`darwin`)return LE=null,null;try{let e=await Vi(process.pid,10);for(let t of e){let e=t.toLowerCase();for(let t of Rr)if(e.includes(t))return LE=t,t}}catch{}return LE=null,null}async function ME(){return process.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`&&Lr.platform!==`darwin`?await jE()||`pycharm`:Lr.terminal}function NE(){return process.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`&&Lr.platform!==`darwin`?LE===void 0?`pycharm`:LE||`pycharm`:Lr.terminal}async function PE(){process.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`&&await jE()}var FE,IE,LE,RE,zE=t((()=>{m(),Fr(),h(),ii(),Bi(),FE=p(async()=>{if(process.platform!==`linux`)return!1;let{code:e}=await ai(`test`,[`-f`,`/.dockerenv`]);return e===0}),IE=null,process.platform===`linux`&&ga(`/lib/libc.musl-${process.arch===`x64`?`x86_64`:`aarch64`}.so.1`).then(()=>{IE=!0},()=>{IE=!1}),RE={...Lr,terminal:NE(),getIsDocker:FE,getIsBubblewrapSandbox:kE,isMuslEnvironment:AE,getTerminalWithJetBrainsDetectionAsync:ME,initJetBrainsDetection:PE}}));function BE(e){return VE?.has(e)??!1}var VE,HE=t((()=>{j(),zn()}));function UE(){return!g(process.env.CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS_DISABLED)}var WE=t((()=>{h()}));function GE(){return XE.getStore()}function KE(e,t){return XE.run(e,t)}function qE(e){return e?.agentType===`subagent`}function JE(){let e=GE();if(!(!qE(e)||!e.subagentName))return e.isBuiltIn?e.subagentName:`user-defined`}function YE(){let e=GE();if(!(!e?.invokingRequestId||e.invocationEmitted))return e.invocationEmitted=!0,{invokingRequestId:e.invokingRequestId,invocationKind:e.invocationKind}}var XE,ZE=t((()=>{WE(),XE=new xa}));function QE(e){return e.startsWith(`mcp__`)?`mcp_tool`:e}function $E(){return g(process.env.OTEL_LOG_TOOL_DETAILS)}function eD(e,t){return!!(process.env.CLAUDE_CODE_ENTRYPOINT===`local-agent`||e===`claudeai-proxy`||t&&BE(t))}function tD(e,t,n){let r=nD(e);return!r||!fD.has(r.serverName)&&!eD(t,n)?{}:{mcpServerName:r.serverName,mcpToolName:r.mcpToolName}}function nD(e){if(!e.startsWith(`mcp__`))return;let t=e.split(`__`);if(t.length<3)return;let n=t[1],r=t.slice(2).join(`__`);if(!(!n||!r))return{serverName:n,mcpToolName:r}}function rD(e,t){if(e===`Skill`&&typeof t==`object`&&t&&`skill`in t&&typeof t.skill==`string`)return t.skill}function iD(e,t=0){if(typeof e==`string`)return e.length>pD?`${e.slice(0,mD)}…[${e.length} chars]`:e;if(typeof e==`number`||typeof e==`boolean`||e==null)return e;if(t>=_D)return`<nested>`;if(Array.isArray(e)){let n=e.slice(0,gD).map(e=>iD(e,t+1));return e.length>gD&&n.push(`…[${e.length} items]`),n}if(typeof e==`object`){let n=Object.entries(e).filter(([e])=>!e.startsWith(`_`)),r=n.slice(0,gD).map(([e,n])=>[e,iD(n,t+1)]);return n.length>gD&&r.push([`…`,`${n.length} keys`]),Object.fromEntries(r)}return String(e)}function aD(e){if(!$E())return;let t=k(iD(e));return t.length>hD&&(t=t.slice(0,hD)+`…[truncated]`),t}function oD(e){let t=Yi(e).toLowerCase();if(!t||t===`.`)return;let n=t.slice(1);return n.length>vD?`other`:n}function sD(e,t){if(!e.includes(`.`)&&!t)return;let n,r=new Set;if(t){let e=oD(t);e&&(r.add(e),n=e)}for(let t of e.split(bD)){if(!t)continue;let e=t.split(xD);if(e.length<2)continue;let i=e[0],a=i.lastIndexOf(`/`),o=a>=0?i.slice(a+1):i;if(yD.has(o))for(let t=1;t<e.length;t++){let i=e[t];if(i.charCodeAt(0)===45)continue;let a=oD(i);a&&!r.has(a)&&(r.add(a),n=n?n+`,`+a:a)}}if(n)return n}function cD(){let e=GE();if(e){let t={agentId:e.agentId,parentSessionId:e.parentSessionId,agentType:e.agentType};return e.agentType===`teammate`&&(t.teamName=e.teamName),t}let t=Si(),n=bi(),r=_i(),i=yi()?`teammate`:t?`standalone`:void 0;if(t||i||n||r)return{...t?{agentId:t}:{},...i?{agentType:i}:{},...n?{parentSessionId:n}:{},...r?{teamName:r}:{}};let a=vn();return a?{parentSessionId:a}:{}}function lD(){try{let e=process.memoryUsage(),t=process.cpuUsage(),n=Date.now(),r;if(wD&&TD){let e=n-TD;e>0&&(r=(t.user-wD.user+(t.system-wD.system))/(e*1e3)*100)}return wD=t,TD=n,{uptime:process.uptime(),rss:e.rss,heapTotal:e.heapTotal,heapUsed:e.heapUsed,external:e.external,arrayBuffers:e.arrayBuffers,constrainedMemory:process.constrainedMemory(),cpuUsage:t,cpuPercent:r}}catch{return}}async function uD(e={}){let t=e.model?String(e.model):Sx(),n=typeof e.betas==`string`?e.betas:WS(t).join(`,`),[r,i]=await Promise.all([CD(),xr()]),a=lD();return{model:t,sessionId:at(),userType:process.env.USER_TYPE||``,...n.length>0?{betas:n}:{},envContext:r,...process.env.CLAUDE_CODE_ENTRYPOINT&&{entrypoint:process.env.CLAUDE_CODE_ENTRYPOINT},...process.env.CLAUDE_AGENT_SDK_VERSION&&{agentSdkVersion:process.env.CLAUDE_AGENT_SDK_VERSION},isInteractive:String(mt()),clientType:st(),...a&&{processMetrics:a},sweBenchRunId:process.env.SWE_BENCH_RUN_ID||``,sweBenchInstanceId:process.env.SWE_BENCH_INSTANCE_ID||``,sweBenchTaskId:process.env.SWE_BENCH_TASK_ID||``,...cD(),...X()&&{subscriptionType:X()},...xt()?{kairosActive:!0}:{},...i&&{rh:i}}}function dD(e,t,n={}){let{envContext:r,processMetrics:i,rh:a,kairosActive:o,skillMode:s,observerMode:c,...l}=e,u={platform:r.platform,platform_raw:r.platformRaw,arch:r.arch,node_version:r.nodeVersion,terminal:r.terminal||`unknown`,package_managers:r.packageManagers,runtimes:r.runtimes,is_running_with_bun:r.isRunningWithBun,is_ci:r.isCi,is_claubbit:r.isClaubbit,is_claude_code_remote:r.isClaudeCodeRemote,is_local_agent_mode:r.isLocalAgentMode,is_conductor:r.isConductor,is_github_action:r.isGithubAction,is_claude_code_action:r.isClaudeCodeAction,is_claude_ai_auth:r.isClaudeAiAuth,version:r.version,build_time:r.buildTime,deployment_environment:r.deploymentEnvironment};r.remoteEnvironmentType&&(u.remote_environment_type=r.remoteEnvironmentType),r.claudeCodeContainerId&&(u.claude_code_container_id=r.claudeCodeContainerId),r.claudeCodeRemoteSessionId&&(u.claude_code_remote_session_id=r.claudeCodeRemoteSessionId),r.tags&&(u.tags=r.tags.split(`,`).map(e=>e.trim()).filter(Boolean)),r.githubEventName&&(u.github_event_name=r.githubEventName),r.githubActionsRunnerEnvironment&&(u.github_actions_runner_environment=r.githubActionsRunnerEnvironment),r.githubActionsRunnerOs&&(u.github_actions_runner_os=r.githubActionsRunnerOs),r.githubActionRef&&(u.github_action_ref=r.githubActionRef),r.wslVersion&&(u.wsl_version=r.wslVersion),r.linuxDistroId&&(u.linux_distro_id=r.linuxDistroId),r.linuxDistroVersion&&(u.linux_distro_version=r.linuxDistroVersion),r.linuxKernel&&(u.linux_kernel=r.linuxKernel),r.vcs&&(u.vcs=r.vcs),r.versionBase&&(u.version_base=r.versionBase);let d={session_id:l.sessionId,model:l.model,user_type:l.userType,is_interactive:l.isInteractive===`true`,client_type:l.clientType};if(l.betas&&(d.betas=l.betas),l.entrypoint&&(d.entrypoint=l.entrypoint),l.agentSdkVersion&&(d.agent_sdk_version=l.agentSdkVersion),l.sweBenchRunId&&(d.swe_bench_run_id=l.sweBenchRunId),l.sweBenchInstanceId&&(d.swe_bench_instance_id=l.sweBenchInstanceId),l.sweBenchTaskId&&(d.swe_bench_task_id=l.sweBenchTaskId),l.agentId&&(d.agent_id=l.agentId),l.parentSessionId&&(d.parent_session_id=l.parentSessionId),l.agentType&&(d.agent_type=l.agentType),l.teamName&&(d.team_name=l.teamName),t.githubActionsMetadata){let e=t.githubActionsMetadata;u.github_actions_metadata={actor_id:e.actorId,repository_id:e.repositoryId,repository_owner_id:e.repositoryOwnerId}}let f;return(t.accountUuid||t.organizationUuid)&&(f={account_uuid:t.accountUuid,organization_uuid:t.organizationUuid}),{env:u,...i&&{process:Buffer.from(k(i)).toString(`base64`)},...f&&{auth:f},core:d,additional:{...a&&{rh:a},...o&&{is_assistant_mode:!0},...s&&{skill_mode:s},...c&&{observer_mode:c},...n}}}var fD,pD,mD,hD,gD,_D,vD,yD,bD,xD,SD,CD,wD,TD,ED=t((()=>{m(),Fr(),zE(),KS(),Jx(),O(),h(),HE(),Q(),wr(),qr(),ZE(),An(),xi(),fD=new Set([(Ui(),e(Hi)).COMPUTER_USE_MCP_SERVER_NAME]),pD=512,mD=128,hD=4*1024,gD=20,_D=2,vD=10,yD=new Set([`rm`,`mv`,`cp`,`touch`,`mkdir`,`chmod`,`chown`,`cat`,`head`,`tail`,`sort`,`stat`,`diff`,`wc`,`grep`,`rg`,`sed`]),bD=/\s*(?:&&|\|\||[;|])\s*/,xD=/\s+/,SD=p(()=>{let e=`2.7.1`.match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);return e?e[0]:void 0}),CD=p(async()=>{let[e,t,n,r]=await Promise.all([Lr.getPackageManagers(),Lr.getRuntimes(),Jr(),Kr()]);return{platform:Ir(),platformRaw:process.env.CLAUDE_CODE_HOST_PLATFORM||process.platform,arch:Lr.arch,nodeVersion:Lr.nodeVersion,terminal:RE.terminal,packageManagers:e.join(`,`),runtimes:t.join(`,`),isRunningWithBun:Lr.isRunningWithBun(),isCi:g(process.env.CI),isClaubbit:g(process.env.CLAUBBIT),isClaudeCodeRemote:g(process.env.CLAUDE_CODE_REMOTE),isLocalAgentMode:process.env.CLAUDE_CODE_ENTRYPOINT===`local-agent`,isConductor:Lr.isConductor(),...process.env.CLAUDE_CODE_REMOTE_ENVIRONMENT_TYPE&&{remoteEnvironmentType:process.env.CLAUDE_CODE_REMOTE_ENVIRONMENT_TYPE},...process.env.CLAUDE_CODE_CONTAINER_ID&&{claudeCodeContainerId:process.env.CLAUDE_CODE_CONTAINER_ID},...process.env.CLAUDE_CODE_REMOTE_SESSION_ID&&{claudeCodeRemoteSessionId:process.env.CLAUDE_CODE_REMOTE_SESSION_ID},...process.env.CLAUDE_CODE_TAGS&&{tags:process.env.CLAUDE_CODE_TAGS},isGithubAction:g(process.env.GITHUB_ACTIONS),isClaudeCodeAction:g(process.env.CLAUDE_CODE_ACTION),isClaudeAiAuth:Y(),version:`2.7.1`,versionBase:SD(),buildTime:`2026-06-15T11:11:41.342Z`,deploymentEnvironment:Lr.detectDeploymentEnvironment(),...g(process.env.GITHUB_ACTIONS)&&{githubEventName:process.env.GITHUB_EVENT_NAME,githubActionsRunnerEnvironment:process.env.RUNNER_ENVIRONMENT,githubActionsRunnerOs:process.env.RUNNER_OS,githubActionRef:process.env.GITHUB_ACTION_PATH?.includes(`claude-code-action/`)?process.env.GITHUB_ACTION_PATH.split(`claude-code-action/`)[1]:void 0},...Wr()&&{wslVersion:Wr()},...n??{},...r.length>0?{vcs:r.join(`,`)}:{}}}),wD=null,TD=null}));function DD(){return Ki.join(ae(),`telemetry`)}function OD(e){if(!v.isAxiosError(e))return pr(e);let t=[],n=e.response?.headers?.[`request-id`];return n&&t.push(`request-id=${n}`),e.response?.status&&t.push(`status=${e.response.status}`),e.code&&t.push(`code=${e.code}`),e.message&&t.push(e.message),t.join(`, `)}var kD,AD,jD,MD=t((()=>{we(),Ie(),O(),SE(),OE(),Q(),op(),j(),h(),zn(),cT(),di(),Vr(),zi(),An(),Zw(),ly(),hr(),ED(),ce(),kD=ua(),AD=`1p_failed_events.`,jD=class{constructor(e={}){_(this,`endpoint`,void 0),_(this,`timeout`,void 0),_(this,`maxBatchSize`,void 0),_(this,`skipAuth`,void 0),_(this,`batchDelayMs`,void 0),_(this,`baseBackoffDelayMs`,void 0),_(this,`maxBackoffDelayMs`,void 0),_(this,`maxAttempts`,void 0),_(this,`isKilled`,void 0),_(this,`pendingExports`,[]),_(this,`isShutdown`,!1),_(this,`schedule`,void 0),_(this,`cancelBackoff`,null),_(this,`attempts`,0),_(this,`isRetrying`,!1),_(this,`lastExportErrorContext`,void 0),this.endpoint=`${e.baseUrl||(process.env.ANTHROPIC_BASE_URL===`https://api-staging.anthropic.com`?`https://api-staging.anthropic.com`:`https://api.anthropic.com`)}${e.path||`/api/event_logging/batch`}`,this.timeout=e.timeout||1e4,this.maxBatchSize=e.maxBatchSize||200,this.skipAuth=e.skipAuth??!1,this.batchDelayMs=e.batchDelayMs||100,this.baseBackoffDelayMs=e.baseBackoffDelayMs||500,this.maxBackoffDelayMs=e.maxBackoffDelayMs||3e4,this.maxAttempts=e.maxAttempts??8,this.isKilled=e.isKilled??(()=>!1),this.schedule=e.schedule??((e,t)=>{let n=setTimeout(e,t);return()=>clearTimeout(n)}),this.retryPreviousBatches()}async getQueuedEventCount(){return(await this.loadEventsFromCurrentBatch()).length}getCurrentBatchFilePath(){return Ki.join(DD(),`${AD}${at()}.${kD}.json`)}async loadEventsFromFile(e){try{return await ci(e)}catch{return[]}}async loadEventsFromCurrentBatch(){return this.loadEventsFromFile(this.getCurrentBatchFilePath())}async saveEventsToFile(e,t){try{if(t.length===0)try{await _a(e)}catch{}else await fa(DD(),{recursive:!0}),await va(e,t.map(e=>k(e)).join(`
33
+ `)+`
34
+ `,`utf8`)}catch(e){I(e)}}async appendEventsToFile(e,t){if(t.length!==0)try{await fa(DD(),{recursive:!0}),await da(e,t.map(e=>k(e)).join(`
35
+ `)+`
36
+ `,`utf8`)}catch(e){I(e)}}async deleteFile(e){try{await _a(e)}catch{}}async retryPreviousBatches(){try{let e=`${AD}${at()}.`,t;try{t=(await ma(DD())).filter(t=>t.startsWith(e)&&t.endsWith(`.json`)).filter(e=>!e.includes(kD))}catch(e){if(Nn(e))return;throw e}for(let e of t){let t=Ki.join(DD(),e);this.retryFileInBackground(t)}}catch(e){I(e)}}async retryFileInBackground(e){if(this.attempts>=this.maxAttempts){await this.deleteFile(e);return}let t=await this.loadEventsFromFile(e);if(t.length===0){await this.deleteFile(e);return}process.env.USER_TYPE===`ant`&&M(`1P event logging: retrying ${t.length} events from previous batch`);let n=await this.sendEventsInBatches(t);n.length===0?(await this.deleteFile(e),process.env.USER_TYPE===`ant`&&M(`1P event logging: previous batch retry succeeded`)):(await this.saveEventsToFile(e,n),process.env.USER_TYPE===`ant`&&M(`1P event logging: previous batch retry failed, ${n.length} events remain`))}async export(e,t){if(this.isShutdown){process.env.USER_TYPE===`ant`&&M(`1P event logging export failed: Exporter has been shutdown`),t({code:Se.FAILED,error:Error(`Exporter has been shutdown`)});return}let n=this.doExport(e,t);this.pendingExports.push(n),n.finally(()=>{let e=this.pendingExports.indexOf(n);e>-1&&this.pendingExports.splice(e,1)})}async doExport(e,t){try{let n=e.filter(e=>e.instrumentationScope?.name===`com.anthropic.claude_code.events`);if(n.length===0){t({code:Se.SUCCESS});return}let r=this.transformLogsToEvents(n).events;if(r.length===0){t({code:Se.SUCCESS});return}if(this.attempts>=this.maxAttempts){t({code:Se.FAILED,error:Error(`Dropped ${r.length} events: max attempts (${this.maxAttempts}) reached`)});return}let i=await this.sendEventsInBatches(r);if(this.attempts++,i.length>0){await this.queueFailedEvents(i),this.scheduleBackoffRetry();let e=this.lastExportErrorContext?` (${this.lastExportErrorContext})`:``;t({code:Se.FAILED,error:Error(`Failed to export ${i.length} events${e}`)});return}this.resetBackoff(),await this.getQueuedEventCount()>0&&!this.isRetrying&&this.retryFailedEvents(),t({code:Se.SUCCESS})}catch(e){process.env.USER_TYPE===`ant`&&M(`1P event logging export failed: ${pr(e)}`),I(e),t({code:Se.FAILED,error:Mn(e)})}}async sendEventsInBatches(e){let t=[];for(let n=0;n<e.length;n+=this.maxBatchSize)t.push(e.slice(n,n+this.maxBatchSize));process.env.USER_TYPE===`ant`&&M(`1P event logging: exporting ${e.length} events in ${t.length} batch(es)`);let n=[],r;for(let e=0;e<t.length;e++){let i=t[e];try{await this.sendBatchWithRetry({events:i})}catch(i){r=OD(i);for(let r=e;r<t.length;r++)n.push(...t[r]);if(process.env.USER_TYPE===`ant`){let n=t.length-1-e;M(`1P event logging: batch ${e+1}/${t.length} failed (${r}); short-circuiting ${n} remaining batch(es)`)}break}e<t.length-1&&this.batchDelayMs>0&&await Ri(this.batchDelayMs)}return n.length>0&&r&&(this.lastExportErrorContext=r),n}async queueFailedEvents(e){let t=this.getCurrentBatchFilePath();await this.appendEventsToFile(t,e);let n=this.lastExportErrorContext?` (${this.lastExportErrorContext})`:``,r=`1P event logging: ${e.length} events failed to export${n}`;I(Error(r))}scheduleBackoffRetry(){if(this.cancelBackoff||this.isRetrying||this.isShutdown)return;let e=Math.min(this.baseBackoffDelayMs*this.attempts*this.attempts,this.maxBackoffDelayMs);process.env.USER_TYPE===`ant`&&M(`1P event logging: scheduling backoff retry in ${e}ms (attempt ${this.attempts})`),this.cancelBackoff=this.schedule(async()=>{this.cancelBackoff=null,await this.retryFailedEvents()},e)}async retryFailedEvents(){let e=this.getCurrentBatchFilePath();for(;!this.isShutdown;){let t=await this.loadEventsFromFile(e);if(t.length===0)break;if(this.attempts>=this.maxAttempts){process.env.USER_TYPE===`ant`&&M(`1P event logging: max attempts (${this.maxAttempts}) reached, dropping ${t.length} events`),await this.deleteFile(e),this.resetBackoff();return}this.isRetrying=!0,await this.deleteFile(e),process.env.USER_TYPE===`ant`&&M(`1P event logging: retrying ${t.length} failed events (attempt ${this.attempts+1})`);let n=await this.sendEventsInBatches(t);if(this.attempts++,this.isRetrying=!1,n.length>0){await this.saveEventsToFile(e,n),this.scheduleBackoffRetry();return}this.resetBackoff(),process.env.USER_TYPE===`ant`&&M(`1P event logging: backoff retry succeeded`)}}resetBackoff(){this.attempts=0,this.cancelBackoff&&(this.cancelBackoff(),this.cancelBackoff=null)}async sendBatchWithRetry(e){if(this.isKilled())throw Error(`firstParty sink killswitch active`);let t={"Content-Type":`application/json`,"User-Agent":Xw(),"x-service-name":`claude-code`},n=yf()||Mt();process.env.USER_TYPE===`ant`&&!n&&M(`1P event logging: Trust not accepted`);let r=this.skipAuth||!n;if(!r&&Y()){let e=Z();dw()?e&&iy(e.expiresAt)&&(r=!0,process.env.USER_TYPE===`ant`&&M(`1P event logging: OAuth token expired, skipping auth to avoid 401`)):r=!0}let i=r?{headers:{},error:`trust not established or Oauth token expired`}:oT(),a=!i.error;!a&&process.env.USER_TYPE===`ant`&&M(`1P event logging: auth not available, sending without auth`);let o=a?{...t,...i.headers}:t;try{let t=await v.post(this.endpoint,e,{timeout:this.timeout,headers:o});this.logSuccess(e.events.length,a,t.data);return}catch(n){if(a&&v.isAxiosError(n)&&n.response?.status===401){process.env.USER_TYPE===`ant`&&M(`1P event logging: 401 auth error, retrying without auth`);let n=await v.post(this.endpoint,e,{timeout:this.timeout,headers:t});this.logSuccess(e.events.length,!1,n.data);return}throw n}}logSuccess(e,t,n){process.env.USER_TYPE===`ant`&&(M(`1P event logging: ${e} events exported successfully${t?` (with auth)`:` (without auth)`}`),M(`API Response: ${k(n,null,2)}`))}hrTimeToDate(e){let[t,n]=e;return new Date(t*1e3+n/1e6)}transformLogsToEvents(e){let t=[];for(let n of e){let e=n.attributes||{};if(e.event_type===`GrowthbookExperimentEvent`){let r=this.hrTimeToDate(n.hrTime),i=e.account_uuid,a=e.organization_uuid;t.push({event_type:`GrowthbookExperimentEvent`,event_data:DE.toJSON({event_id:e.event_id,timestamp:r,experiment_id:e.experiment_id,variation_id:e.variation_id,environment:e.environment,user_attributes:e.user_attributes,experiment_metadata:e.experiment_metadata,device_id:e.device_id,session_id:e.session_id,auth:i||a?{account_uuid:i,organization_uuid:a}:void 0})});continue}let r=e.event_name||n.body||`unknown`,i=e.core_metadata,a=e.user_metadata,o=e.event_metadata||{};if(!i){process.env.USER_TYPE===`ant`&&M(`1P event logging: core_metadata missing for event ${r}`),t.push({event_type:`ClaudeCodeInternalEvent`,event_data:xE.toJSON({event_id:e.event_id,event_name:r,client_timestamp:this.hrTimeToDate(n.hrTime),session_id:at(),additional_metadata:Buffer.from(k({transform_error:`core_metadata attribute is missing`})).toString(`base64`)})});continue}let s=dD(i,a,o),{_PROTO_skill_name:c,_PROTO_plugin_name:l,_PROTO_marketplace_name:u,...d}=s.additional,f=mr(d);t.push({event_type:`ClaudeCodeInternalEvent`,event_data:xE.toJSON({event_id:e.event_id,event_name:r,client_timestamp:this.hrTimeToDate(n.hrTime),device_id:e.user_id,email:a?.email,auth:s.auth,...s.core,env:s.env,process:s.process,skill_name:typeof c==`string`?c:void 0,plugin_name:typeof l==`string`?l:void 0,marketplace_name:typeof u==`string`?u:void 0,additional_metadata:Object.keys(f).length>0?Buffer.from(k(f)).toString(`base64`):void 0})})}return{events:t}}async shutdown(){this.isShutdown=!0,this.resetBackoff(),await this.forceFlush(),process.env.USER_TYPE===`ant`&&M(`1P event logging exporter shutdown complete`)}async forceFlush(){await Promise.all(this.pendingExports),process.env.USER_TYPE===`ant`&&M(`1P event logging exporter flush complete`)}}}));function ND(e){return jO(PD,{})?.[e]===!0}var PD,FD=t((()=>{XO(),PD=`tengu_frond_boric`}));function ID(){return jO(qD,{})}function LD(e){let t=ID()[e];if(!t)return null;let n=t.sample_rate;return typeof n!=`number`||n<0||n>1||n>=1?null:n<=0?0:Math.random()<n?n:0}function RD(){return jO(JD,{})}async function zD(){if(XD)try{await XD.shutdown(),process.env.USER_TYPE===`ant`&&M(`1P event logging: final shutdown complete`)}catch{}}function BD(){return!tE()}async function VD(e,t,n={}){try{let r=await uD({model:n.model,betas:n.betas}),i={event_name:t,event_id:ua(),core_metadata:r,user_metadata:gT(!0),event_metadata:n},a=Hf();a&&(i.user_id=a),process.env.USER_TYPE===`ant`&&M(`[ANT-ONLY] 1P event: ${t} ${k(n,null,0)}`),e.emit({body:t,attributes:i})}catch(e){process.env.USER_TYPE===`ant`&&I(e)}}function HD(e,t={}){BD()&&(!YD||ND(`firstParty`)||VD(YD,e,t))}function UD(){return`production`}function WD(e){if(!BD()||!YD||ND(`firstParty`))return;let t=Hf(),{accountUuid:n,organizationUuid:r}=gT(!0),i={event_type:`GrowthbookExperimentEvent`,event_id:ua(),experiment_id:e.experimentId,variation_id:e.variationId,...t&&{device_id:t},...n&&{account_uuid:n},...r&&{organization_uuid:r},...e.userAttributes&&{session_id:e.userAttributes.sessionId,user_attributes:k(e.userAttributes)},...e.experimentMetadata&&{experiment_metadata:k(e.experimentMetadata)},environment:UD()};process.env.USER_TYPE===`ant`&&M(`[ANT-ONLY] 1P GrowthBook experiment: ${e.experimentId} variation=${e.variationId}`),YD.emit({body:`growthbook_experiment`,attributes:i})}function GD(){if(wi(`1p_event_logging_start`),!BD()){process.env.USER_TYPE===`ant`&&M(`1P event logging not enabled`);return}let e=RD();ZD=e,wi(`1p_event_after_growthbook_config`);let t=e.scheduledDelayMillis||parseInt(process.env.OTEL_LOGS_EXPORT_INTERVAL||QD.toString(),10),n=e.maxExportBatchSize||$D,r=e.maxQueueSize||eO,i=Gr(),a={[xe]:`claude-code`,[ve]:`2.7.1`};if(i===`wsl`){let e=Wr();e&&(a[`wsl.version`]=e)}XD=new HT({resource:Oe(a),processors:[new XT(new jD({maxBatchSize:n,skipAuth:e.skipAuth,maxAttempts:e.maxAttempts,path:e.path,baseUrl:e.baseUrl,isKilled:()=>ND(`firstParty`)}),{scheduledDelayMillis:t,maxExportBatchSize:n,maxQueueSize:r})]}),YD=XD.getLogger(`com.anthropic.claude_code.events`,`2.7.1`)}async function KD(){if(!BD()||!XD||Mu(RD(),ZD))return;process.env.USER_TYPE===`ant`&&M(`1P event logging: ${JD} changed, reinitializing`);let e=XD,t=YD;YD=null;try{await e.forceFlush()}catch{}XD=null;try{GD()}catch(n){XD=e,YD=t,I(n);return}e.shutdown().catch(()=>{})}var qD,JD,YD,XD,ZD,QD,$D,eO,tO=t((()=>{ke(),eE(),Ee(),Od(),op(),j(),Vr(),qr(),An(),Ti(),vT(),rE(),MD(),XO(),ED(),FD(),qD=`tengu_event_sampling_config`,JD=`tengu_1p_event_batch_config`,YD=null,XD=null,ZD=null,QD=1e4,$D=200,eO=8192}));function nO(e){try{Promise.resolve(e()).catch(e=>{I(e)})}catch(e){I(e)}}function rO(e){let t=!0,n=VO.subscribe(()=>nO(e));return LO.size>0&&queueMicrotask(()=>{t&&LO.size>0&&nO(e)}),()=>{t=!1,n()}}function iO(){if(!UO&&(UO=!0,process.env.USER_TYPE===`ant`)){let e=process.env.CLAUDE_INTERNAL_FC_OVERRIDES;if(e)try{HO=JSON.parse(e),M(`GrowthBook: Using env var overrides for ${Object.keys(HO).length} features: ${Object.keys(HO).join(`, `)}`)}catch{I(Error(`GrowthBook: Failed to parse CLAUDE_INTERNAL_FC_OVERRIDES: ${e}`))}}return HO}function aO(e){let t=iO();return t!==null&&e in t}function oO(){if(process.env.USER_TYPE===`ant`)try{return H().growthBookOverrides}catch{return}}function sO(){return LO.size>0?Object.fromEntries(LO):H().cachedGrowthBookFeatures??{}}function cO(){return oO()??{}}function lO(e,t){if(process.env.USER_TYPE===`ant`)try{V(n=>{let r=n.growthBookOverrides??{};if(t===void 0){if(!(e in r))return n;let{[e]:t,...i}=r;if(Object.keys(i).length===0){let{growthBookOverrides:e,...t}=n;return t}return{...n,growthBookOverrides:i}}return Mu(r[e],t)?n:{...n,growthBookOverrides:{...r,[e]:t}}}),VO.emit()}catch(e){I(e)}}function uO(){if(process.env.USER_TYPE===`ant`)try{V(e=>{if(!e.growthBookOverrides||Object.keys(e.growthBookOverrides).length===0)return e;let{growthBookOverrides:t,...n}=e;return n}),VO.emit()}catch(e){I(e)}}function dO(e){if(zO.has(e))return;let t=IO.get(e);t&&(zO.add(e),WD({experimentId:t.experimentId,variationId:t.variationId,userAttributes:_O(),experimentMetadata:{feature_id:e}}))}async function fO(e){let t=e.getPayload();if(!t?.features||Object.keys(t.features).length===0)return!1;IO.clear();let n={};for(let[e,r]of Object.entries(t.features)){let t=r;if(`value`in t&&!(`defaultValue`in t)?n[e]={...t,defaultValue:t.value}:n[e]=t,t.source===`experiment`&&t.experimentResult){let n=t.experimentResult,r=t.experiment;r?.key&&n.variationId!==void 0&&IO.set(e,{experimentId:r.key,variationId:n.variationId})}}await e.setPayload({...t,features:n}),LO.clear();for(let[e,t]of Object.entries(n)){let n=`value`in t?t.value:t.defaultValue;n!==void 0&&LO.set(e,n)}return!0}function pO(){let e=Object.fromEntries(LO);Mu(H().cachedGrowthBookFeatures,e)||V(t=>({...t,cachedGrowthBookFeatures:e}))}function mO(e){if(!process.env.CLAUDE_CODE_DISABLE_LOCAL_GATES)return WO[e]}function hO(){return process.env.CLAUDE_GB_ADAPTER_URL&&process.env.CLAUDE_GB_ADAPTER_KEY?!0:BD()}function gO(){let e=process.env.ANTHROPIC_BASE_URL;if(e)try{let t=new URL(e).host;return t===`api.anthropic.com`?void 0:t}catch{return}}function _O(){let e=dT(),t=e.email;!t&&process.env.USER_TYPE===`ant`&&(t=H().oauthAccount?.emailAddress);let n=gO();return{id:e.deviceId,sessionId:e.sessionId,deviceID:e.deviceId,platform:e.platform,...n&&{apiBaseUrlHost:n},...e.organizationUuid&&{organizationUUID:e.organizationUuid},...e.accountUuid&&{accountUUID:e.accountUuid},...e.userType&&{userType:e.userType},...e.subscriptionType&&{subscriptionType:e.subscriptionType},...e.rateLimitTier&&{rateLimitTier:e.rateLimitTier},...e.firstTokenTime&&{firstTokenTime:e.firstTokenTime},...t&&{email:t},...e.appVersion&&{appVersion:e.appVersion},...e.githubActionsMetadata&&{githubActionsMetadata:e.githubActionsMetadata}}}async function vO(e,t,n){let r=iO();if(r&&e in r)return r[e];let i=oO();if(i&&e in i)return i[e];if(!hO()){let n=mO(e);return n===void 0?t:n}let a=await KO();if(!a){let n=mO(e);return n===void 0?t:n}let o;return o=LO.has(e)?LO.get(e):a.getFeatureValue(e,t),n&&dO(e),process.env.USER_TYPE===`ant`&&M(`GrowthBook: getFeatureValue("${e}") = ${k(o)}`),o}async function yO(e,t){return vO(e,t,!0)}function bO(e,t){let n=iO();if(n&&e in n)return n[e];let r=oO();if(r&&e in r)return r[e];if(!hO()){let n=mO(e);return n===void 0?t:n}let i=mO(e);if(i!==void 0)return i;if(IO.has(e)?dO(e):RO.add(e),LO.has(e))return LO.get(e);try{let t=H().cachedGrowthBookFeatures?.[e];if(t!==void 0)return t}catch{}return t}function xO(e,t,n){return bO(e,t)}function SO(e){let t=iO();if(t&&e in t)return!!t[e];let n=oO();if(n&&e in n)return!!n[e];if(!hO()){let t=mO(e);return t===void 0?!1:!!t}IO.has(e)?dO(e):RO.add(e);try{let t=H(),n=t.cachedGrowthBookFeatures?.[e];if(n!==void 0)return!!n;let r=t.cachedStatsigGates?.[e];if(r!==void 0)return r}catch{}let r=mO(e);return r===void 0?!1:!!r}async function CO(e){let t=iO();if(t&&e in t)return!!t[e];let n=oO();if(n&&e in n)return!!n[e];if(!hO())return!1;BO&&await BO;let r=H(),i=r.cachedStatsigGates?.[e];if(i!==void 0)return!!i;let a=r.cachedGrowthBookFeatures?.[e];return a===void 0?!1:!!a}async function wO(e){let t=iO();if(t&&e in t)return!!t[e];let n=oO();if(n&&e in n)return!!n[e];if(!hO()){let t=mO(e);return t===void 0?!1:!!t}return H().cachedGrowthBookFeatures?.[e]===!0?(IO.has(e)?dO(e):RO.add(e),!0):vO(e,!1,!0)}function TO(){if(hO())try{EO(),VO.emit(),BO=KO().catch(e=>(I(Mn(e)),null)).finally(()=>{BO=null})}catch(e){I(Mn(e))}}function EO(){kO(),NO&&(process.off(`beforeExit`,NO),NO=null),PO&&(process.off(`exit`,PO),PO=null),MO?.destroy(),MO=null,FO=!1,BO=null,IO.clear(),RO.clear(),zO.clear(),LO.clear(),GO.cache?.clear?.(),KO.cache?.clear?.(),HO=null,UO=!1}async function DO(){if(hO())try{let e=await KO();if(!e)return;if(await e.refreshFeatures(),e!==MO){process.env.USER_TYPE===`ant`&&M(`GrowthBook: Skipping refresh processing for replaced client`);return}let t=await fO(e);if(e!==MO)return;process.env.USER_TYPE===`ant`&&M(`GrowthBook: Light refresh completed`),t&&(pO(),VO.emit())}catch(e){I(Mn(e))}}function OO(){hO()&&(JO&&clearInterval(JO),JO=setInterval(()=>{DO()},qO),JO.unref?.(),YO||(YO=()=>{kO()},process.once(`beforeExit`,YO)))}function kO(){JO&&(clearInterval(JO),JO=null),YO&&(process.removeListener(`beforeExit`,YO),YO=null)}async function AO(e,t){return yO(e,t)}function jO(e,t){return bO(e,t)}var MO,NO,PO,FO,IO,LO,RO,zO,BO,VO,HO,UO,WO,GO,KO,qO,JO,YO,XO=t((()=>{fc(),Od(),O(),Ad(),op(),j(),zn(),cT(),Vr(),ft(),An(),vT(),tO(),MO=null,NO=null,PO=null,FO=!1,IO=new Map,LO=new Map,RO=new Set,zO=new Set,BO=null,VO=Ot(),HO=null,UO=!1,WO={tengu_keybinding_customization_release:!0,tengu_streaming_tool_execution2:!0,tengu_kairos_cron:!0,tengu_amber_json_tools:!0,tengu_immediate_model_command:!0,tengu_basalt_3kr:!0,tengu_pebble_leaf_prune:!0,tengu_chair_sermon:!0,tengu_lodestone_enabled:!0,tengu_auto_background_agents:!0,tengu_fgts:!0,tengu_session_memory:!0,tengu_passport_quail:!0,tengu_moth_copse:!0,tengu_coral_fern:!0,tengu_chomp_inflection:!0,tengu_hive_evidence:!0,tengu_kairos_brief:!0,tengu_kairos_brief_config:{enable_slash_command:!0},tengu_sedge_lantern:!0,tengu_onyx_plover:{enabled:!0},tengu_willow_mode:`dialog`,tengu_turtle_carbon:!0,tengu_amber_stoat:!0,tengu_amber_flint:!0,tengu_slim_subagent_claudemd:!0,tengu_birch_trellis:!0,tengu_collage_kaleidoscope:!0,tengu_compact_cache_prefix:!0,tengu_kairos_assistant:!0,tengu_kairos_cron_durable:!0,tengu_attribution_header:!0,tengu_slate_prism:!0,tengu_review_bughunter_config:{enabled:!0},tengu_ccr_bundle_seed_enabled:!0},GO=p(()=>{if(!hO())return null;let e=_O(),t=kd(),n=process.env.CLAUDE_GB_ADAPTER_URL||process.env.USER_TYPE===`ant`&&process.env.CLAUDE_CODE_GB_BASE_URL||`https://api.anthropic.com/`,r=!!(process.env.CLAUDE_GB_ADAPTER_URL&&process.env.CLAUDE_GB_ADAPTER_KEY);process.env.USER_TYPE===`ant`&&M(`GrowthBook: Creating client with clientKey=${t}, attributes: ${k(e)}`);let i=yf()||lt()||Mt()?oT():{headers:{},error:`trust not established`},a=r||!i.error;FO=a;let o=new uc({apiHost:n,clientKey:t,attributes:e,remoteEval:!r,...r?{}:{cacheKeyAttributes:[`id`,`organizationUUID`]},...i.error?{}:{apiHostRequestHeaders:i.headers},...process.env.USER_TYPE===`ant`?{log:(e,t)=>{M(`GrowthBook: ${e} ${k(t)}`)}}:{}});if(MO=o,!a)return{client:o,initialized:Promise.resolve()};let s=o.init({timeout:5e3}).then(async e=>{if(MO!==o){process.env.USER_TYPE===`ant`&&M(`GrowthBook: Skipping init callback for replaced client`);return}process.env.USER_TYPE===`ant`&&M(`GrowthBook initialized, source: ${e.source}, success: ${e.success}`);let t=await fO(o);if(MO===o){if(t){for(let e of RO)dO(e);RO.clear(),pO(),VO.emit()}if(process.env.USER_TYPE===`ant`){let e=o.getFeatures();if(e){let t=Object.keys(e);M(`GrowthBook loaded ${t.length} features: ${t.slice(0,10).join(`, `)}${t.length>10?`...`:``}`)}}}}).catch(e=>{process.env.USER_TYPE===`ant`&&I(Mn(e))});return NO=()=>MO?.destroy(),PO=()=>MO?.destroy(),process.on(`beforeExit`,NO),process.on(`exit`,PO),{client:o,initialized:s}}),KO=p(async()=>{let e=GO();return!e||!FO&&(yf()||lt()||Mt())&&!oT().error&&(process.env.USER_TYPE===`ant`&&M(`GrowthBook: Auth became available after client creation, reinitializing`),EO(),e=GO(),!e)?null:(await e.initialized,OO(),e.client)}),qO=process.env.USER_TYPE===`ant`?1200*1e3:360*60*1e3,JO=null,YO=null}));function ZO(){let e=process.env.CLAUDE_CODE_DISABLE_AUTO_MEMORY;if(g(e))return!1;if(ie(e))return!0;if(g(process.env.CLAUDE_CODE_SIMPLE)||g(process.env.CLAUDE_CODE_REMOTE)&&!process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR)return!1;let t=A_();return t.autoMemoryEnabled===void 0?!0:t.autoMemoryEnabled}function QO(){return bO(`tengu_passport_quail`,!1)?!Mt()||bO(`tengu_slate_thimble`,!1):!1}function $O(){return process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR?process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR:ae()}function ek(e,t){if(!e)return;let n=e;if(t&&(n.startsWith(`~/`)||n.startsWith(`~\\`))){let e=n.slice(2),t=Zi(e||`.`);if(t===`.`||t===`..`)return;n=R(Wi(),e)}let r=Zi(n).replace(/[/\\]+$/,``);if(!(!Xi(r)||r.length<3||/^[A-Za-z]:$/.test(r)||r.startsWith(`\\\\`)||r.startsWith(`//`)||r.includes(`\0`)))return(r+ea).normalize(`NFC`)}function tk(){return ek(process.env.CLAUDE_COWORK_MEMORY_PATH_OVERRIDE,!1)}function nk(){return ek(U(`policySettings`)?.autoMemoryDirectory??U(`flagSettings`)?.autoMemoryDirectory??U(`localSettings`)?.autoMemoryDirectory??U(`userSettings`)?.autoMemoryDirectory,!0)}function rk(){return tk()!==void 0}function ik(){return Sr(xn())??xn()}function ak(){return R(lk(),ck)}function ok(e){return Zi(e).startsWith(lk())}var sk,ck,lk,uk=t((()=>{m(),O(),XO(),h(),wr(),$r(),B_(),sk=`memory`,ck=`MEMORY.md`,lk=p(()=>(tk()??nk())||(R(R($O(),`projects`),Zr(ik()),sk)+ea).normalize(`NFC`),()=>xn())}));export{GE as $,y_ as $a,Xd as $c,Ty as $i,zS as $n,gh as $o,ox as $r,up as $s,xw as $t,kO as A,xv as Aa,ff as Ac,tb as Ai,sl as Al,tw as An,Gh as Ao,Lx as Ar,Yp as As,Xw as At,FD as B,U_ as Ba,Jd as Bc,Gy as Bi,iC as Bn,Oh as Bo,Bx as Br,Op as Bs,kw as Bt,KO as C,jv as Ca,V as Cc,Ab as Ci,Pu as Cl,zC as Cn,ug as Co,Ax as Cr,Qp as Cs,aT as Ct,EO as D,Dv as Da,gf as Dc,Cb as Di,Su as Dl,VC as Dn,Xh as Do,Sx as Dr,$p as Ds,Qw as Dt,DO as E,Pv as Ea,mf as Ec,Pb as Ei,Cu as El,Lw as En,Vh as Eo,Ex as Er,nm as Es,eT as Et,HD as F,hv as Fa,Kd as Fc,Yy as Fi,hC as Fn,zh as Fo,Ux as Fr,Ip as Fs,KC as Ft,uD as G,I_ as Ga,ef as Gc,eb as Gi,MS as Gn,Th as Go,hx as Gr,Np as Gs,Hw as Gt,nD as H,Y_ as Ha,Hd as Hc,By as Hi,eC as Hn,Ch as Ho,zx as Hr,Tp as Hs,TC as Ht,WD as I,mv as Ia,Wd as Ic,Ry as Ii,vC as In,Nh as Io,bx as Ir,Fp as Is,RC as It,ED as J,O_ as Ja,zd as Jc,Ny as Ji,WS as Jn,xh as Jo,px as Jr,Sp as Js,Z as Jt,oD as K,A_ as Ka,af as Kc,Py as Ki,GS as Kn,Dh as Ko,_x as Kr,kp as Ks,NC as Kt,KD as L,sv as La,Gd as Lc,zy as Li,cC as Ln,jh as Lo,Fx as Lr,Rp as Ls,UC as Lt,tO as M,wv as Ma,lf as Mc,ib as Mi,rw as Mn,Lh as Mo,yx as Mr,Gp as Ms,yC as Mt,GD as N,W as Na,cf as Nc,rb as Ni,Aw as Nn,Ih as No,xx as Nr,Wp as Ns,MC as Nt,lO as O,Tv as Oa,_f as Oc,Sb as Oi,Hl as Ol,JC as On,Bh as Oo,Gx as Or,em as Os,nT as Ot,BD as P,pv as Pa,Qd as Pc,Zy as Pi,gC as Pn,Fh as Po,Jx as Pr,Kp as Ps,lw as Pt,YE as Q,U as Qa,$d as Qc,Sy as Qi,RS as Qn,Sh as Qo,ix as Qr,vp as Qs,Ew as Qt,LD as R,fv as Ra,Yd as Rc,Uy as Ri,mC as Rn,Ah as Ro,Wx as Rr,Ap as Rs,YC as Rt,XO as S,Av as Sa,Lf as Sc,db as Si,Fu as Sl,Cw as Sn,yg as So,Dx as Sr,am as Ss,rT as St,TO as T,Lv as Ta,hf as Tc,Mb as Ti,Mu as Tl,XC as Tn,dg as To,Tx as Tr,Xp as Ts,sT as Tt,rD as U,Z_ as Ua,uf as Uc,Wy as Ui,XS as Un,wh as Uo,Ix as Ur,Cp as Us,PC as Ut,ND as V,K_ as Va,Vd as Vc,qy as Vi,aC as Vn,kh as Vo,Nx as Vr,Ep as Vs,CC as Vt,aD as W,W_ as Wa,Zd as Wc,$y as Wi,VS as Wn,Eh as Wo,Vx as Wr,wp as Ws,LC as Wt,tD as X,S_ as Xa,Bd as Xc,Oy as Xi,LS as Xn,_h as Xo,fx as Xr,mp as Xs,EC as Xt,$E as Y,w_ as Ya,sf as Yc,ky as Yi,KS as Yn,bh as Yo,mx as Yr,yp as Ys,cw as Yt,QE as Z,x_ as Za,tf as Zc,Dy as Zi,IS as Zn,yh as Zo,dx as Zr,fp as Zs,pw as Zt,bO as _,Jv as _a,Of as _c,hb as _i,td as _l,Tw as _n,Jg as _o,tS as _r,um as _s,lT as _t,uk as a,ry as aa,yf as ac,Ub as ai,Od as al,dw as an,N_ as ao,_S as ar,Fm as as,RE as at,cO as b,Nv as ba,Rf as bc,yb as bi,Ju as bl,vw as bn,_g as bo,jx as br,rm as bs,oT as bt,QO as c,ay as ca,Vf as cc,tx as ci,Cd as cl,xC as cn,L_ as co,vS as cr,rh as cs,rE as ct,SO as d,iy as da,H as dc,lb as di,hd as dl,Y as dn,t_ as do,ES as dr,xm as ds,eE as dt,vy as ea,dp as ec,Zb as ei,Ud as el,Sw as en,M_ as eo,kS as er,Sm as es,JE as et,uO as f,Qv as fa,Sf as fc,fb as fi,md as fl,Ow as fn,e_ as fo,fS as fr,bm as fs,XT as ft,jO as g,cy as ga,ap as gc,vb as gi,nd as gl,gw as gn,Zg as go,Xx as gr,lm as gs,_T as gt,AO as h,Zv as ha,Hf as hc,ub as hi,sd as hl,GC as hn,n_ as ho,eS as hr,hm as hs,gT as ht,rk as i,$v as ia,Yf as ic,Wb as ii,Nd as il,hw as in,P_ as io,TS as ir,Jm as is,UE as it,ID as j,G as ja,pf as jc,nb as ji,el as jl,$C as jn,Ph as jo,Ox as jr,Up as js,Zw as jt,OO as k,kv as ka,df as kc,pb as ki,Ul as kl,Vw as kn,Wh as ko,Px as kr,Zp as ks,$w as kt,wO as l,oy as la,If as lc,wb as li,Sd as ll,kC as ln,T_ as lo,gS as lr,ih as ls,tE as lt,gO as m,ty as ma,Wf as mc,cb as mi,cd as ml,yw as mn,r_ as mo,sS as mr,ym as ms,HT as mt,lk as n,uy as na,cp as nc,qb as ni,Fd as nl,ow as nn,z_ as no,wS as nr,fh as ns,KE as nt,ok as o,ey as oa,Mf as oc,Kb as oi,Dd as ol,Q as on,B_ as oo,hS as or,ah as os,PE as ot,sO as p,sy as pa,Gf as pc,bb as pi,pd as pl,ew as pn,f_ as po,dS as pr,_m as ps,WT as pt,sD as q,h_ as qa,of as qc,Fy as qi,BS as qn,vh as qo,vx as qr,Dp as qs,SC as qt,$O as r,dy as ra,sp as rc,ex as ri,Pd as rl,wC as rn,F_ as ro,xS as rr,mh as rs,WE as rt,ZO as s,ny as sa,Bf as sc,zb as si,Ed as sl,fw as sn,__ as so,yS as sr,Qm as ss,zE as st,ak as t,yy as ta,lp as tc,Qb as ti,jd as tl,X as tn,j_ as to,AS as tr,lh as ts,ZE as tt,CO as u,ly as ua,kf as uc,mb as ui,gd as ul,jC as un,$g as uo,pS as ur,hh as us,nE as ut,xO as v,Yv as va,Kf as vc,Rb as vi,ed as vl,mw as vn,Ig as vo,J as vr,om as vs,vT as vt,rO as w,qv as wa,zf as wc,kb as wi,Nu as wl,ZC as wn,lg as wo,kx as wr,qp as ws,cT as wt,aO as x,Rv as xa,Uf as xc,ab as xi,qu as xl,_w as xn,vg as xo,Mx as xr,tm as xs,iT as xt,yO as y,Xv as ya,op as yc,ob as yi,$u as yl,bw as yn,Pg as yo,Cx as yr,sm as ys,uT as yt,zD as z,q_ as za,rf as zc,Ky as zi,sC as zn,Mh as zo,Kx as zr,jp as zs,iw as zt};