@readmagic/workmate 0.0.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 (552) hide show
  1. package/dist/chunks/AddWorkspaceDirectory-BSLHrjbt.js +1 -0
  2. package/dist/chunks/App-DY5O6IKw.js +1 -0
  3. package/dist/chunks/ApproveApiKey-BEzfC6r3.js +1 -0
  4. package/dist/chunks/ApproveApiKey-DfAPwDix.js +1 -0
  5. package/dist/chunks/AssistantSessionChooser-Ce3PraaD.js +1 -0
  6. package/dist/chunks/BackgroundTasksDialog-Dvhcgahe.js +2 -0
  7. package/dist/chunks/BypassPermissionsModeDialog-B68V1bCq.js +1 -0
  8. package/dist/chunks/ClaudeMdExternalIncludesDialog-BV7HHcgL.js +1 -0
  9. package/dist/chunks/ClaudeMdExternalIncludesDialog-CTWhpIm8.js +1 -0
  10. package/dist/chunks/ConsoleOAuthFlow-CU5fCPKq.js +1 -0
  11. package/dist/chunks/DesktopHandoff-BRbU4is4.js +1 -0
  12. package/dist/chunks/Dialog-vfLXEPed.js +1 -0
  13. package/dist/chunks/DiffDialog-CBluIK-x.js +6 -0
  14. package/dist/chunks/Doctor-B0CRtxi2.js +1 -0
  15. package/dist/chunks/Doctor-WxNv49HC.js +3 -0
  16. package/dist/chunks/ExitFlow-CRPgptCN.js +2 -0
  17. package/dist/chunks/Feedback-CEtzaLr3.js +2 -0
  18. package/dist/chunks/Grove--kttLxvs.js +11 -0
  19. package/dist/chunks/Grove-CelgLWH4.js +1 -0
  20. package/dist/chunks/HybridTransport-BgV5_7Az.js +4 -0
  21. package/dist/chunks/InvalidConfigDialog-DCGwXW_p.js +1 -0
  22. package/dist/chunks/InvalidSettingsDialog-jTwsdXWr.js +1 -0
  23. package/dist/chunks/ListItem-vfLXEPed.js +1 -0
  24. package/dist/chunks/MCPConnectionManager-BX0LMz9J.js +1 -0
  25. package/dist/chunks/McpParsingWarnings-WQrWJeWP.js +1 -0
  26. package/dist/chunks/MessageSelector-_UZB8cGb.js +3 -0
  27. package/dist/chunks/Messages-jCoW_1Rr.js +11 -0
  28. package/dist/chunks/Onboarding-BoIVNCgc.js +1 -0
  29. package/dist/chunks/OverageCreditUpsell-1FCN8bH3.js +1 -0
  30. package/dist/chunks/PermissionDialog-0ya1CU5k.js +1 -0
  31. package/dist/chunks/PluginSettings-BD9JLV9-.js +17 -0
  32. package/dist/chunks/PressEnterToContinue-Dl9Hg9Mf.js +1 -0
  33. package/dist/chunks/PromptInputFooterSuggestions-CrGST0Cq.js +1 -0
  34. package/dist/chunks/PromptInputHelpMenu-B2TDpbpw.js +1 -0
  35. package/dist/chunks/QueryEngine-D2HUnwmU.js +1 -0
  36. package/dist/chunks/REPL-BV4WyYMg.js +142 -0
  37. package/dist/chunks/REPL-DcpN3MRC.js +1 -0
  38. package/dist/chunks/RemoteCallout-DS_EV6Fh.js +1 -0
  39. package/dist/chunks/RemoteSessionManager-Tx1N2uVL.js +2 -0
  40. package/dist/chunks/ResumeConversation-Cw3vP4G8.js +1 -0
  41. package/dist/chunks/SSETransport-BXiEBMpb.js +4 -0
  42. package/dist/chunks/SearchBox-vfLXEPed.js +1 -0
  43. package/dist/chunks/SearchExtraToolsTool-D3VOFq9R.js +1 -0
  44. package/dist/chunks/Settings-ns6mRsDc.js +2 -0
  45. package/dist/chunks/TeleportProgress-CcDzMC5L.js +1 -0
  46. package/dist/chunks/TeleportRepoMismatchDialog-DZbxl4sD.js +1 -0
  47. package/dist/chunks/TeleportResumeWrapper-EowJO5nm.js +1 -0
  48. package/dist/chunks/ThemePicker-BYbChJpu.js +1 -0
  49. package/dist/chunks/TrustDialog-DA3YTk_k.js +1 -0
  50. package/dist/chunks/TungstenTool-Cb7gJvq4.js +1 -0
  51. package/dist/chunks/TungstenTool-CxMQVCuF.js +1 -0
  52. package/dist/chunks/ValidationErrorsList-Cx-hoRwG.js +2 -0
  53. package/dist/chunks/WelcomeV2-BTfttGcv.js +1 -0
  54. package/dist/chunks/add-dir-CWt69NAZ.js +1 -0
  55. package/dist/chunks/agentDisplay-CQ4mZWFH.js +1 -0
  56. package/dist/chunks/agents-C6jzKOit.js +2 -0
  57. package/dist/chunks/agents-D4clhuCl.js +103 -0
  58. package/dist/chunks/ajv-5vMo9UcX.js +8 -0
  59. package/dist/chunks/allErrors-HMPqE0jK.js +1 -0
  60. package/dist/chunks/analytics-BotDBGh0.js +1 -0
  61. package/dist/chunks/ant-9Z5bppVC.js +1 -0
  62. package/dist/chunks/api-L2IgleTV.js +1 -0
  63. package/dist/chunks/api-TgV7fl9V.js +1 -0
  64. package/dist/chunks/asciicast-DYbkzGCN.js +1 -0
  65. package/dist/chunks/asciicast-n-BBfgDq.js +4 -0
  66. package/dist/chunks/assistant-BA9_Mo9U.js +1 -0
  67. package/dist/chunks/assistant-BiNOSla3.js +1 -0
  68. package/dist/chunks/assistant-YvbVKjVh.js +1 -0
  69. package/dist/chunks/attributionHooks-CUAoGkU6.js +1 -0
  70. package/dist/chunks/attributionTrailer-oKKrF3z8.js +1 -0
  71. package/dist/chunks/auth-CEig4Gxp.js +1 -0
  72. package/dist/chunks/auth-CbGDlhyO.js +1 -0
  73. package/dist/chunks/auth-DHyCIxCk.js +15 -0
  74. package/dist/chunks/autoMode-Db4QrgFr.js +45 -0
  75. package/dist/chunks/autoModeDenials-BxNzGJdR.js +1 -0
  76. package/dist/chunks/autonomy-BkAMA7du.js +1 -0
  77. package/dist/chunks/autonomy-D4Vy-RPQ.js +15 -0
  78. package/dist/chunks/autonomyPanel-EjfO8jvg.js +1 -0
  79. package/dist/chunks/axios-BHBm_hhU.js +1 -0
  80. package/dist/chunks/axios-DaWTGg7G.js +16 -0
  81. package/dist/chunks/backgroundHousekeeping-BNEKWHhH.js +1 -0
  82. package/dist/chunks/backgroundHousekeeping-hDDE8mJC.js +17 -0
  83. package/dist/chunks/banner-hD6wZygx.js +2 -0
  84. package/dist/chunks/base64-js-0wLHn8zB.js +1 -0
  85. package/dist/chunks/bedrockClient-DxE_mHFI.js +15 -0
  86. package/dist/chunks/bg-BzG63WOm.js +1 -0
  87. package/dist/chunks/bg-DQ0Q3Qv-.js +9 -0
  88. package/dist/chunks/branch-CeQ9IyZk.js +3 -0
  89. package/dist/chunks/break-cache-Bd0clV2N.js +8 -0
  90. package/dist/chunks/bridge-yerAiaK2.js +2 -0
  91. package/dist/chunks/bridgeConfig-CCtXe8ak.js +1 -0
  92. package/dist/chunks/bridgeConfig-D5dB38xD.js +1 -0
  93. package/dist/chunks/bridgeEnabled--F-6TUi4.js +1 -0
  94. package/dist/chunks/bridgeEnabled-DKX8-T_H.js +1 -0
  95. package/dist/chunks/bridgeMain--R1HFbOv.js +68 -0
  96. package/dist/chunks/bridgeMain-d06JByZn.js +1 -0
  97. package/dist/chunks/bridgeMessaging-CqbLTDcx.js +1 -0
  98. package/dist/chunks/bridgePointer-W_jdQ8zf.js +1 -0
  99. package/dist/chunks/browser-Bd7GeBH1.js +1 -0
  100. package/dist/chunks/btw-CVGRmL9a.js +1 -0
  101. package/dist/chunks/bundledMode--fG1S62b.js +1 -0
  102. package/dist/chunks/caches-BtmAri4e.js +3 -0
  103. package/dist/chunks/caches-BuTIAOtY.js +1 -0
  104. package/dist/chunks/capacityWake-CV_x9H8j.js +1 -0
  105. package/dist/chunks/ccrClient-HqMi5Kfu.js +1 -0
  106. package/dist/chunks/checksum-DgbnMdM-.js +1 -0
  107. package/dist/chunks/classPrivateFieldSet2-D4U5K-I3.js +1 -0
  108. package/dist/chunks/classPrivateMethodInitSpec-BXQD0Vh4.js +1 -0
  109. package/dist/chunks/claudeDesktop-aUMx06RK.js +1 -0
  110. package/dist/chunks/clear-C6nRzIQE.js +1 -0
  111. package/dist/chunks/cliLaunch-2AUoMnqx.js +1 -0
  112. package/dist/chunks/client-BeET1hnC.js +1 -0
  113. package/dist/chunks/client-DchQnIJD.js +36 -0
  114. package/dist/chunks/client-DvAL7lY8.js +8 -0
  115. package/dist/chunks/color-DXI_4ibU.js +1 -0
  116. package/dist/chunks/color-convert-p91EwGT7.js +1 -0
  117. package/dist/chunks/commands-VjcG4qFq.js +1 -0
  118. package/dist/chunks/commitAttribution-Cm40fdNU.js +2 -0
  119. package/dist/chunks/commitAttribution-Lb3qUlAR.js +1 -0
  120. package/dist/chunks/compact-DPTVpJ4D.js +2 -0
  121. package/dist/chunks/completionCache-BQaLkB4d.js +4 -0
  122. package/dist/chunks/completionCache-CW8lKIgy.js +1 -0
  123. package/dist/chunks/config-0cRberzR.js +1 -0
  124. package/dist/chunks/config-BSXLgwpD.js +1 -0
  125. package/dist/chunks/config-BrxKpHpR.js +1 -0
  126. package/dist/chunks/config-C7YHKCPV.js +3 -0
  127. package/dist/chunks/config-CLmFk-5V.js +1 -0
  128. package/dist/chunks/connectHeadless-CqRoEtrg.js +1 -0
  129. package/dist/chunks/context-C_cKrBUn.js +1 -0
  130. package/dist/chunks/context-noninteractive-DnH6Q9Lu.js +54 -0
  131. package/dist/chunks/context-noninteractive-rUZ3ydmJ.js +1 -0
  132. package/dist/chunks/controlMessageCompat-IFu4Gc1y.js +1 -0
  133. package/dist/chunks/conversation-GJxfkr6M.js +1 -0
  134. package/dist/chunks/conversation-oK3aFzqO.js +1 -0
  135. package/dist/chunks/createSSHSession--bWmmIk9.js +6 -0
  136. package/dist/chunks/createSession-DIr4sUp6.js +1 -0
  137. package/dist/chunks/createSession-DM4acqaC.js +1 -0
  138. package/dist/chunks/cron-3LntnnhJ.js +1 -0
  139. package/dist/chunks/crossProjectResume-DKrtjTpm.js +40 -0
  140. package/dist/chunks/cwd-BuJhkTrc.js +1 -0
  141. package/dist/chunks/cwd-D-tY2NKc.js +1 -0
  142. package/dist/chunks/daemon-B9lBPdBJ.js +2 -0
  143. package/dist/chunks/dangerousBackend-DwcP0P08.js +1 -0
  144. package/dist/chunks/datadog-ByS7LGGa.js +1 -0
  145. package/dist/chunks/datadog-DNCsyfSO.js +1 -0
  146. package/dist/chunks/debug-DzZUT2Wv.js +1 -0
  147. package/dist/chunks/debug-IKW-jE7K.js +39 -0
  148. package/dist/chunks/debugUtils-D2981c0Z.js +1 -0
  149. package/dist/chunks/defineProperty-C-QyHrDq.js +1 -0
  150. package/dist/chunks/desktop-B5cvrcOQ.js +1 -0
  151. package/dist/chunks/detached-rfIUyc-B.js +5 -0
  152. package/dist/chunks/detect-libc-CxbBtWJu.js +1 -0
  153. package/dist/chunks/detectRepository-6nw-Aw3v.js +1 -0
  154. package/dist/chunks/detectRepository-ReZ0Fz8Z.js +1 -0
  155. package/dist/chunks/diff-cXAp9cNN.js +1 -0
  156. package/dist/chunks/directoryCompletion-DBM2o5kx.js +1 -0
  157. package/dist/chunks/dist-CXlEpGqr.js +20 -0
  158. package/dist/chunks/dist-DESLAofA.js +1 -0
  159. package/dist/chunks/dist-DIee4wq1.js +29 -0
  160. package/dist/chunks/dist-Dopnn8wS.js +5 -0
  161. package/dist/chunks/dist-es-5t7v8oaj.js +1 -0
  162. package/dist/chunks/dist-es-BF6bR-Ik.js +2 -0
  163. package/dist/chunks/dist-es-BIjDeceU.js +1 -0
  164. package/dist/chunks/dist-es-BOPBJQo3.js +1 -0
  165. package/dist/chunks/dist-es-Bfr4TzQe.js +3 -0
  166. package/dist/chunks/dist-es-Byxccz_-.js +1 -0
  167. package/dist/chunks/dist-es-C-OjW2Ao.js +1 -0
  168. package/dist/chunks/dist-es-C3reqy7X.js +1 -0
  169. package/dist/chunks/dist-es-C7vygWzp.js +1 -0
  170. package/dist/chunks/dist-es-CEk66gUu.js +1 -0
  171. package/dist/chunks/dist-es-CIULjvtA2.js +1 -0
  172. package/dist/chunks/dist-es-CMtO44xC.js +1 -0
  173. package/dist/chunks/dist-es-CQMt6zRM.js +1 -0
  174. package/dist/chunks/dist-es-CYPVg66r.js +9 -0
  175. package/dist/chunks/dist-es-Cd_AeqMK.js +6 -0
  176. package/dist/chunks/dist-es-Cgsa8pb82.js +1 -0
  177. package/dist/chunks/dist-es-Cwru7c2B2.js +1 -0
  178. package/dist/chunks/dist-es-D1Y8zSMI.js +1 -0
  179. package/dist/chunks/dist-es-D1wHe_zh.js +1 -0
  180. package/dist/chunks/dist-es-DKFm0FJ7.js +1 -0
  181. package/dist/chunks/dist-es-DKIwwJME.js +1 -0
  182. package/dist/chunks/dist-es-DNFTCbrP.js +1 -0
  183. package/dist/chunks/dist-es-DXIR5NLi2.js +1 -0
  184. package/dist/chunks/dist-es-DelBIxNM.js +1 -0
  185. package/dist/chunks/dist-es-DmdZmEJ-.js +1 -0
  186. package/dist/chunks/dist-es-Gt_DpXlP.js +1 -0
  187. package/dist/chunks/dist-es-gUzZ_7Vf.js +1 -0
  188. package/dist/chunks/dist-es-kj-F5A132.js +1 -0
  189. package/dist/chunks/dist-es-yHGBqhBe.js +1 -0
  190. package/dist/chunks/doctor-CTMHXZvQ.js +1 -0
  191. package/dist/chunks/earlyInput-BTC_Wucv.js +2 -0
  192. package/dist/chunks/earlyInput-xcoTbKQn.js +1 -0
  193. package/dist/chunks/effort-Br8KKHdx.js +9 -0
  194. package/dist/chunks/entry-4lIRMrLI.js +14 -0
  195. package/dist/chunks/envLessBridgeConfig-CGuIxFzJ.js +1 -0
  196. package/dist/chunks/envLessBridgeConfig-D_Jg4fJy.js +1 -0
  197. package/dist/chunks/envUtils-DSxRz_kt.js +1 -0
  198. package/dist/chunks/esm-BYnFh4pG.js +1 -0
  199. package/dist/chunks/esm-Bx6rTxIs.js +1 -0
  200. package/dist/chunks/esm-C367Cyo-.js +1 -0
  201. package/dist/chunks/esm-C8Zkk1Ux.js +1 -0
  202. package/dist/chunks/esm-CGx9qY3q.js +56 -0
  203. package/dist/chunks/esm-CXM9jqO_.js +1 -0
  204. package/dist/chunks/esm-CXczu_-W.js +1 -0
  205. package/dist/chunks/esm-CXt5K8Xt.js +1 -0
  206. package/dist/chunks/esm-Cb-L4oAk.js +1 -0
  207. package/dist/chunks/esm-D6ZZCdtk.js +1 -0
  208. package/dist/chunks/esm-DhRjocaU.js +1 -0
  209. package/dist/chunks/esm-DklLYEuz.js +1 -0
  210. package/dist/chunks/esm-IYgGg4wR.js +1 -0
  211. package/dist/chunks/esm-lWlUmoUA.js +1 -0
  212. package/dist/chunks/esm-lyfry1WB.js +10 -0
  213. package/dist/chunks/esm-wGnzjq4Z.js +1 -0
  214. package/dist/chunks/event-streams-C0Zy0Uqv.js +1 -0
  215. package/dist/chunks/event-streams-DoqJmjFN.js +1 -0
  216. package/dist/chunks/eventLoopStallDetector-Cg_RXU1q.js +1 -0
  217. package/dist/chunks/execAsync-Bv2yxuGe.js +1 -0
  218. package/dist/chunks/execFileNoThrow-COKYqVQj.js +34 -0
  219. package/dist/chunks/execSyncWrapper-DZJ3tNWF.js +1 -0
  220. package/dist/chunks/exit-BOhGfSlm.js +2 -0
  221. package/dist/chunks/exit-Z9oWrqE4.js +1 -0
  222. package/dist/chunks/extra-usage-BS4aVOt5.js +1 -0
  223. package/dist/chunks/extra-usage-DtAIhW74.js +1 -0
  224. package/dist/chunks/extra-usage-core-CdL1ltqq.js +1 -0
  225. package/dist/chunks/extra-usage-noninteractive-DxxRI0Yx.js +1 -0
  226. package/dist/chunks/extraUsage-BYZdi44Y.js +1 -0
  227. package/dist/chunks/extractMemories-C4f9JWuI.js +1 -0
  228. package/dist/chunks/fast-B0OB4x7K.js +1 -0
  229. package/dist/chunks/fast-DKqiojzf.js +1 -0
  230. package/dist/chunks/featureCheck-CrJeuheQ.js +1 -0
  231. package/dist/chunks/featureCheck-HslM03dr.js +1 -0
  232. package/dist/chunks/feedback-yB19xph5.js +1 -0
  233. package/dist/chunks/figures-5ThXQEtq.js +1 -0
  234. package/dist/chunks/file-D1cN3LMK.js +12 -0
  235. package/dist/chunks/fileStateCache-DDW5toIs.js +1 -0
  236. package/dist/chunks/files-DAzGtmzz.js +2 -0
  237. package/dist/chunks/firstPartyEventLogger-CdUpe6Lh.js +1 -0
  238. package/dist/chunks/firstPartyEventLogger-hU-LPkje.js +5 -0
  239. package/dist/chunks/flushGate-ZFr8yv7F.js +1 -0
  240. package/dist/chunks/foundry-sdk-BdeF2aBu.js +1 -0
  241. package/dist/chunks/fpsMetrics-Cf_hdtiJ.js +1 -0
  242. package/dist/chunks/from-CgDRRLiX.js +4 -0
  243. package/dist/chunks/gemini-DqAv8_GY.js +1 -0
  244. package/dist/chunks/generateRecap-lO2PDlx8.js +1 -0
  245. package/dist/chunks/generateSessionName-48veu5dv.js +1 -0
  246. package/dist/chunks/genericProcessUtils-F1Qcb1sO.js +23 -0
  247. package/dist/chunks/getMachineId-bsd-Cut1kHoA.js +1 -0
  248. package/dist/chunks/getMachineId-darwin-CsRhaP3y.js +2 -0
  249. package/dist/chunks/getMachineId-linux-Bd7UBNRQ.js +1 -0
  250. package/dist/chunks/getMachineId-unsupported-vFGP8E_8.js +1 -0
  251. package/dist/chunks/getMachineId-win-DamF2CH_.js +1 -0
  252. package/dist/chunks/git-BE_FiJZp.js +1 -0
  253. package/dist/chunks/git-tyaWOgRL.js +6 -0
  254. package/dist/chunks/githubRepoPathMapping-BlR0BphY.js +1 -0
  255. package/dist/chunks/goal-Bn8Kz2Dp.js +3 -0
  256. package/dist/chunks/graceful-fs-DDVg0cja.js +2 -0
  257. package/dist/chunks/grok-DhnO_KDC.js +1 -0
  258. package/dist/chunks/grove-DotW04-v.js +7 -0
  259. package/dist/chunks/hash-Tu-My5Vp.js +1 -0
  260. package/dist/chunks/heapdump-DkZSKNbp.js +5 -0
  261. package/dist/chunks/help-DU_BcZtU.js +1 -0
  262. package/dist/chunks/hooks-BTMWE5Qx.js +79 -0
  263. package/dist/chunks/hooks-DONAb_nq.js +1 -0
  264. package/dist/chunks/hostGuard-Dh296c6q.js +1 -0
  265. package/dist/chunks/inboundAttachments-BcEgi49j.js +1 -0
  266. package/dist/chunks/inboundAttachments-DVs3_m48.js +1 -0
  267. package/dist/chunks/index.min-D75yiGLN.js +1 -0
  268. package/dist/chunks/initReplBridge-D0Xec8S-.js +1 -0
  269. package/dist/chunks/install-BkfXeXpv.js +1 -0
  270. package/dist/chunks/instinctParser-Dt-lqnDe.js +1 -0
  271. package/dist/chunks/instrumentation-H0XRS1yG.js +21 -0
  272. package/dist/chunks/intl-cKc-V6Mq.js +1 -0
  273. package/dist/chunks/isObject-C6qM3WEW.js +1 -0
  274. package/dist/chunks/isSymbol-BO6cdPI7.js +1 -0
  275. package/dist/chunks/job-DKtLkF8V.js +2 -0
  276. package/dist/chunks/json-bigint-bonnP-Hz.js +8 -0
  277. package/dist/chunks/jsx-runtime-Bb4Xn-E0.js +1 -0
  278. package/dist/chunks/jws-BscXOT9I.js +3 -0
  279. package/dist/chunks/jwtUtils-C-ojmb8W.js +1 -0
  280. package/dist/chunks/keybindings-ez51eHHp.js +2 -0
  281. package/dist/chunks/language-BuRSO2sR.js +1 -0
  282. package/dist/chunks/language-Da4KNbjm.js +1 -0
  283. package/dist/chunks/launchAgentsPlatform-BQyPdrHp.js +1 -0
  284. package/dist/chunks/launchCommand-1qkTCKpf.js +1 -0
  285. package/dist/chunks/launchLocalMemory-CWHAj7CX.js +3 -0
  286. package/dist/chunks/launchLocalVault-D8iJdtsP.js +3 -0
  287. package/dist/chunks/launchMemoryStores-W7jWG2uH.js +1 -0
  288. package/dist/chunks/launchOnboarding-q__LaLy1.js +8 -0
  289. package/dist/chunks/launchSchedule-BWi9F5vh.js +1 -0
  290. package/dist/chunks/launchSkillStore-4wd4MQBc.js +1 -0
  291. package/dist/chunks/launchTeleport-BlCf2QM_.js +3 -0
  292. package/dist/chunks/launchVault-C7u7LZV7.js +1 -0
  293. package/dist/chunks/lazySchema-uxlVVNM1.js +1 -0
  294. package/dist/chunks/lib-BSzUGQb_.js +2 -0
  295. package/dist/chunks/lib-BlVGipXx.js +14 -0
  296. package/dist/chunks/lib-rQZENxQg.js +8 -0
  297. package/dist/chunks/loadAgentsDir-Dgd-fzNt.js +1 -0
  298. package/dist/chunks/loadAgentsDir-nzr38hai.js +3990 -0
  299. package/dist/chunks/loadPluginHooks-z1-zvBLw.js +1 -0
  300. package/dist/chunks/loadSso-DSxfVpgX.js +1 -0
  301. package/dist/chunks/localSearch-B-L_ldos.js +1 -0
  302. package/dist/chunks/localSearch-D-FprOMr.js +1 -0
  303. package/dist/chunks/lockfile-D5-j7HOZ.js +1 -0
  304. package/dist/chunks/log-B3eB4EFv.js +1 -0
  305. package/dist/chunks/logoV2Utils-RQ160dI2.js +1 -0
  306. package/dist/chunks/magicDocs-BqZ0GewA.js +57 -0
  307. package/dist/chunks/main-DeFMhaFE.js +31 -0
  308. package/dist/chunks/main-y7LJ5qUc.js +1243 -0
  309. package/dist/chunks/mappers-CWykjGfP.js +1 -0
  310. package/dist/chunks/mcp-CSFPAfaW.js +2 -0
  311. package/dist/chunks/mcp-DBwT4pa9.js +6 -0
  312. package/dist/chunks/mcp-DvZTaHZE.js +1 -0
  313. package/dist/chunks/memoize-BK3gG5ob.js +1 -0
  314. package/dist/chunks/memoize-BO31Ws9Q.js +1 -0
  315. package/dist/chunks/memory-DcpPpYN0.js +1 -0
  316. package/dist/chunks/metadata-BRLJvh61.js +1 -0
  317. package/dist/chunks/modalContext-DFjKLCB6.js +1 -0
  318. package/dist/chunks/mode-BkViT_0o.js +2 -0
  319. package/dist/chunks/model--z4Di9QO.js +1 -0
  320. package/dist/chunks/model-CZktWw6o.js +1 -0
  321. package/dist/chunks/model-DfFA3qMO.js +1 -0
  322. package/dist/chunks/multipart-parser-DDLYsngd.js +2 -0
  323. package/dist/chunks/nativeInstaller-GcIk7G2Y.js +1 -0
  324. package/dist/chunks/oauth-BqJqV-2M.js +1 -0
  325. package/dist/chunks/oauth-C8X_p8Gc.js +1 -0
  326. package/dist/chunks/observationStore-DzCdXq8U.js +4 -0
  327. package/dist/chunks/onChangeAppState-DwGVi-BC.js +1 -0
  328. package/dist/chunks/open-BtQHzzL9.js +1 -0
  329. package/dist/chunks/openai-B2wxZDQx.js +10 -0
  330. package/dist/chunks/openaiShared-G2-w4gJt.js +1 -0
  331. package/dist/chunks/output-style-BM3qAHLA.js +1 -0
  332. package/dist/chunks/overageCreditGrant-CjK49axw.js +1 -0
  333. package/dist/chunks/p-map-B1EeBuI8.js +1 -0
  334. package/dist/chunks/p-map-HKDr3iDo.js +1 -0
  335. package/dist/chunks/package-BC0bllK8.js +1 -0
  336. package/dist/chunks/panel-B-nrcHpm.js +1 -0
  337. package/dist/chunks/panel-R4ue6pSW.js +1 -0
  338. package/dist/chunks/panelCall-I_fbgub5.js +1 -0
  339. package/dist/chunks/parseConnectUrl-BiyKR5-x.js +1 -0
  340. package/dist/chunks/parser-BlM_Fk4J.js +1 -0
  341. package/dist/chunks/parser-CQrasoUB.js +1 -0
  342. package/dist/chunks/partition-CxRF7T-f.js +1 -0
  343. package/dist/chunks/passes-U_h-hNu-.js +1 -0
  344. package/dist/chunks/path-BCSE0S-c.js +1 -0
  345. package/dist/chunks/permissions-B8epy16o.js +3 -0
  346. package/dist/chunks/permissions-CeYKbtSC.js +1 -0
  347. package/dist/chunks/permissions-Cn_6f8CB.js +1 -0
  348. package/dist/chunks/pidLock-CBJDnBG_.js +3 -0
  349. package/dist/chunks/pipeTransport-D3Qx9v1V.js +1 -0
  350. package/dist/chunks/plan-BAhStVci.js +1 -0
  351. package/dist/chunks/platform-EtecGacO.js +2 -0
  352. package/dist/chunks/plist-Bzo2VMe9.js +6 -0
  353. package/dist/chunks/plugin-D9huNnv6.js +1 -0
  354. package/dist/chunks/pluginAutoupdate-BfmyxR5g.js +1 -0
  355. package/dist/chunks/pluginBlocklist-03sZaZa6.js +1 -0
  356. package/dist/chunks/pluginCliCommands-P2Ndi1r1.js +1 -0
  357. package/dist/chunks/pluginFlagging-BVy7Xv_0.js +1 -0
  358. package/dist/chunks/pluginOperations-Cz37qcjF.js +2 -0
  359. package/dist/chunks/pluginStartupCheck-BqUwHcMD.js +1 -0
  360. package/dist/chunks/pluginStartupCheck-w24D-wwk.js +1 -0
  361. package/dist/chunks/plugins-B0hiIN4q.js +4 -0
  362. package/dist/chunks/policyLimits-Dem-XJ_h.js +1 -0
  363. package/dist/chunks/pollConfig-C2Ac8WMU.js +1 -0
  364. package/dist/chunks/poller-CpLBoB-N.js +1 -0
  365. package/dist/chunks/poor-CfbMKZNJ.js +1 -0
  366. package/dist/chunks/poorMode-Bsw2V-V_.js +1 -0
  367. package/dist/chunks/poorMode-jvImnkty.js +1 -0
  368. package/dist/chunks/postCommitAttribution-DoSP9wZD.js +1 -0
  369. package/dist/chunks/print-ozjC0Mhg.js +23 -0
  370. package/dist/chunks/privacy-settings-DeGoBRrZ.js +1 -0
  371. package/dist/chunks/process-CNfq37LF.js +1 -0
  372. package/dist/chunks/process-gEbdy6uY.js +1 -0
  373. package/dist/chunks/processBashCommand-loWZ8MSE.js +1 -0
  374. package/dist/chunks/processSlashCommand-BdouajZb.js +5 -0
  375. package/dist/chunks/projectContext-BaDZBAoK.js +1 -0
  376. package/dist/chunks/projectContext-D9MDwJUF.js +1 -0
  377. package/dist/chunks/prompt-Bef63FhB.js +132 -0
  378. package/dist/chunks/prompt-C7wd1H_i.js +1 -0
  379. package/dist/chunks/prompt-DIoNqZvO.js +1 -0
  380. package/dist/chunks/promptEditor-foiayhdY.js +4 -0
  381. package/dist/chunks/protocolHandler-BsiB1oW_.js +13 -0
  382. package/dist/chunks/protocols-CCsohXid.js +18 -0
  383. package/dist/chunks/protocols-CnYQjBlj.js +2 -0
  384. package/dist/chunks/proxy-Cn2YwITp.js +99 -0
  385. package/dist/chunks/rate-limit-options-DTJPDcTr.js +1 -0
  386. package/dist/chunks/rcDebugLog-BUuD-X1D.js +11 -0
  387. package/dist/chunks/reconciler-DqXTmV3J.js +4 -0
  388. package/dist/chunks/referral-DP_GshTS.js +1 -0
  389. package/dist/chunks/refresh-CNzXPAFw.js +1 -0
  390. package/dist/chunks/registerProtocol-CjxlFsKw.js +36 -0
  391. package/dist/chunks/release-notes-BxgK8zWO.js +4 -0
  392. package/dist/chunks/releaseNotes-CbSktIJW.js +2 -0
  393. package/dist/chunks/reload-plugins-CDu6yU5-.js +1 -0
  394. package/dist/chunks/remote-env-B4HnhISc.js +1 -0
  395. package/dist/chunks/remoteBridgeCore-D-wG5jau.js +1 -0
  396. package/dist/chunks/remoteManagedSettings-B7gt0VAX.js +1 -0
  397. package/dist/chunks/rename-DlbMb24l.js +1 -0
  398. package/dist/chunks/renderOptions-5kWQpVr2.js +1 -0
  399. package/dist/chunks/resume-BB5iBogS.js +2 -0
  400. package/dist/chunks/rewind-D12hCfZD.js +1 -0
  401. package/dist/chunks/ripgrep-BQgJ02F9.js +1 -0
  402. package/dist/chunks/ripgrep-BvDwiKJ3.js +5 -0
  403. package/dist/chunks/rollback-BPWRKlIZ.js +11 -0
  404. package/dist/chunks/rolldown-runtime-DaDcL9Zw.js +1 -0
  405. package/dist/chunks/runtimeObserver-BNH2WGE3.js +1 -0
  406. package/dist/chunks/runtimeObserver-Ci-5gvYg.js +10 -0
  407. package/dist/chunks/sandbox-adapter-Coe1GDAE.js +1 -0
  408. package/dist/chunks/sandbox-toggle-B2Yk4y2V.js +1 -0
  409. package/dist/chunks/sanitization-DV-94a9Z.js +1 -0
  410. package/dist/chunks/satisfies-DQJHNtpQ.js +1 -0
  411. package/dist/chunks/sdkHeapDumpMonitor-WdXUV7DV.js +1 -0
  412. package/dist/chunks/searchExtraTools-BnWZ9roi.js +1 -0
  413. package/dist/chunks/semver-BMRJYn3q.js +1 -0
  414. package/dist/chunks/semver-DQo45qGo.js +1 -0
  415. package/dist/chunks/serde-f76bObzR.js +4 -0
  416. package/dist/chunks/server-LdbAb0sV.js +1 -0
  417. package/dist/chunks/serverBanner-BdExKFHT.js +1 -0
  418. package/dist/chunks/serverLog-BFmvyJ93.js +1 -0
  419. package/dist/chunks/session-Bmx7L3Mt.js +2 -0
  420. package/dist/chunks/sessionDataUploader-CaCjwsA2.js +1 -0
  421. package/dist/chunks/sessionDiscovery-DcEAr5vJ.js +1 -0
  422. package/dist/chunks/sessionFileAccessHooks-BhdOmW9o.js +1 -0
  423. package/dist/chunks/sessionManager-CPa049BO.js +1 -0
  424. package/dist/chunks/sessionMemory-Bsg2unYX.js +1 -0
  425. package/dist/chunks/sessionMemory-CIbCojm-.js +1 -0
  426. package/dist/chunks/sessionMemoryUtils-Cjb57wtC.js +1 -0
  427. package/dist/chunks/sessionObserver-CRU1qWnP.js +1 -0
  428. package/dist/chunks/sessionObserver-DQwHsDrM.js +20 -0
  429. package/dist/chunks/sessionStorage-BxDN8qRc.js +1 -0
  430. package/dist/chunks/sessionStoragePortable-Cx6JQ5Ye.js +3 -0
  431. package/dist/chunks/sessionTitle-B8jcexkQ.js +14 -0
  432. package/dist/chunks/sessionTracing-BuLsL6qA.js +11 -0
  433. package/dist/chunks/settings-5PQdphqC.js +19 -0
  434. package/dist/chunks/settingsSync-BDeuErb5.js +1 -0
  435. package/dist/chunks/setup-BKEnSLR9.js +3 -0
  436. package/dist/chunks/shadowedRuleDetection-7Z8ezTKF.js +1 -0
  437. package/dist/chunks/shellQuote-fB02N16J.js +4 -0
  438. package/dist/chunks/sideQuestion-CYdNATPW.js +20 -0
  439. package/dist/chunks/signin-CPaEtsnK.js +1 -0
  440. package/dist/chunks/sink-DjKoYMsA.js +1 -0
  441. package/dist/chunks/sink-iYxWapbU.js +1 -0
  442. package/dist/chunks/sinks-GryGVRT8.js +2 -0
  443. package/dist/chunks/sinks-jfaIjsRJ.js +1 -0
  444. package/dist/chunks/skill-learning-E8tQed-Q.js +5 -0
  445. package/dist/chunks/skillChangeDetector-A8SAuyo9.js +1 -0
  446. package/dist/chunks/skillGapStore-B5rl12bV.js +1 -0
  447. package/dist/chunks/skillGapStore-CjJrxxjk.js +5 -0
  448. package/dist/chunks/skillGenerator-BDR_z3-X.js +8 -0
  449. package/dist/chunks/skillLearning-BQtfFE0g.js +1 -0
  450. package/dist/chunks/skillLearning-C8ihdryM.js +1 -0
  451. package/dist/chunks/skillPanel-yR8Oi-mO.js +28 -0
  452. package/dist/chunks/skillSearchPanel-DUQQUCUS.js +21 -0
  453. package/dist/chunks/skills-NAZQ3j-t.js +1 -0
  454. package/dist/chunks/slashCommandParsing-RQb_7Xzt.js +1 -0
  455. package/dist/chunks/src-CDCSSo0U2.js +53 -0
  456. package/dist/chunks/src-CHw1lvBc.js +3 -0
  457. package/dist/chunks/src-CST_jFnT.js +1 -0
  458. package/dist/chunks/src-CgZmCiiH.js +2 -0
  459. package/dist/chunks/src-CiJCsqUl.js +9 -0
  460. package/dist/chunks/src-D06Xyj4g.js +2 -0
  461. package/dist/chunks/src-DCUgdrYl.js +5 -0
  462. package/dist/chunks/src-DLz3FZm1.js +1 -0
  463. package/dist/chunks/src-DPUAq5Ty.js +1 -0
  464. package/dist/chunks/src-DQOX_xI1.js +1 -0
  465. package/dist/chunks/src-Dt5IJd3C.js +1 -0
  466. package/dist/chunks/src-Dvp6-vB7.js +19 -0
  467. package/dist/chunks/src-PM8NIIu_.js +1 -0
  468. package/dist/chunks/src-l6_O0K-a.js +1 -0
  469. package/dist/chunks/src-xRRBgNzF.js +25 -0
  470. package/dist/chunks/sso-oidc-DFJ7SBvI.js +1 -0
  471. package/dist/chunks/startupProfiler-B0m6crkd.js +1 -0
  472. package/dist/chunks/startupProfiler-DxRQteII.js +3 -0
  473. package/dist/chunks/state-4KQ3kaqz.js +1 -0
  474. package/dist/chunks/state-53JDbNQM.js +1 -0
  475. package/dist/chunks/state-Cn_m2NOf.js +1 -0
  476. package/dist/chunks/staticRender-BIxpgNUq.js +1 -0
  477. package/dist/chunks/stats-h4yu84Q-.js +1 -0
  478. package/dist/chunks/status-BbdeubJG.js +1 -0
  479. package/dist/chunks/status-is_Bg_IB.js +2 -0
  480. package/dist/chunks/statusNoticeHelpers-CQ7CUugR.js +1 -0
  481. package/dist/chunks/stdio-4S7b8Uhx.js +1 -0
  482. package/dist/chunks/stdio-W_Kokrkh.js +3 -0
  483. package/dist/chunks/stickers-qJoNhPk4.js +1 -0
  484. package/dist/chunks/store-Z8rTjDHe.js +1 -0
  485. package/dist/chunks/stringUtils-CvXbHQRH.js +4 -0
  486. package/dist/chunks/sts-C2Gf2WYN.js +1 -0
  487. package/dist/chunks/subprocessEnv-BSQSomcK.js +1 -0
  488. package/dist/chunks/subprocessEnv-vrwzMgKn.js +1 -0
  489. package/dist/chunks/supports-color-uJ1LqA-P.js +1 -0
  490. package/dist/chunks/systemPromptSections-CgpggIYX.js +1 -0
  491. package/dist/chunks/systemPromptSections-IePG5K8r.js +1 -0
  492. package/dist/chunks/systemTheme-Ceakddth.js +1 -0
  493. package/dist/chunks/tag-i3HZ4lhj.js +11 -0
  494. package/dist/chunks/tasks-HzsYNTZ1.js +1 -0
  495. package/dist/chunks/teleport-hN3cAbYC.js +1 -0
  496. package/dist/chunks/templateJobs-CIv_ysje.js +12 -0
  497. package/dist/chunks/terminalSetup-C0PF87iu.js +33 -0
  498. package/dist/chunks/terminalSetup-CxniwSF-.js +1 -0
  499. package/dist/chunks/theme-BKIHX_Dx.js +1 -0
  500. package/dist/chunks/thinkback-BA4cMz4D.js +1 -0
  501. package/dist/chunks/thinkback-mT-8FIT-.js +1 -0
  502. package/dist/chunks/thinkback-play-Cfk49mvF.js +1 -0
  503. package/dist/chunks/tmux-CbsW-VDJ.js +1 -0
  504. package/dist/chunks/toolEventObserver-8FQtxeVv.js +1 -0
  505. package/dist/chunks/toolEventObserver-B1xvyKdE.js +1 -0
  506. package/dist/chunks/toolPool-CHVDZqh7.js +1 -0
  507. package/dist/chunks/trustedDevice-BYCh1ff7.js +1 -0
  508. package/dist/chunks/trustedDevice-DnIWErCt.js +1 -0
  509. package/dist/chunks/tui-fTa_pzdA.js +6 -0
  510. package/dist/chunks/types-BUyOCzUt.js +1 -0
  511. package/dist/chunks/types-Czs-_G1S.js +3 -0
  512. package/dist/chunks/types-a7X-tJpJ.js +17 -0
  513. package/dist/chunks/udsClient-Cg9bBD0p.js +1 -0
  514. package/dist/chunks/ultrareviewCommand-DCFRZsKp.js +3 -0
  515. package/dist/chunks/undercover-B-kKUWtK.js +1 -0
  516. package/dist/chunks/undercover-CsLPQb-a.js +31 -0
  517. package/dist/chunks/up-dO5BcPaq.js +12 -0
  518. package/dist/chunks/updateCCB-CfUnkOLT.js +11 -0
  519. package/dist/chunks/upgrade-CngUwvY4.js +1 -0
  520. package/dist/chunks/upgrade-kpttjebY.js +1 -0
  521. package/dist/chunks/upload-DDhQqV8n.js +1 -0
  522. package/dist/chunks/upstreamproxy-CvcjNY7J.js +11 -0
  523. package/dist/chunks/usage-CJ5w0907.js +1 -0
  524. package/dist/chunks/usage-eZRwLa77.js +1 -0
  525. package/dist/chunks/useExitOnCtrlCDWithKeybindings-yAroCqu4.js +1 -0
  526. package/dist/chunks/useMainLoopModel-BNFW-g8E.js +1 -0
  527. package/dist/chunks/useManagePlugins-CTtPaQRP.js +1 -0
  528. package/dist/chunks/useMergedTools-CZJffsmf.js +1 -0
  529. package/dist/chunks/useSearchInput-C-CqUK6w.js +1 -0
  530. package/dist/chunks/useSettingsErrors-BWlJCgYF.js +1 -0
  531. package/dist/chunks/util-DJV0joAW.js +1 -0
  532. package/dist/chunks/v4-jw6qOKwQ.js +65 -0
  533. package/dist/chunks/validatePlugin-CRmpIGLV.js +1 -0
  534. package/dist/chunks/vertex-sdk-DjXcZ2J7.js +9 -0
  535. package/dist/chunks/vim-n8-UT5w-.js +1 -0
  536. package/dist/chunks/which-BBCjXfI2.js +1 -0
  537. package/dist/chunks/windowsPaths-D6T_3XaU.js +1 -0
  538. package/dist/chunks/windowsPaths-DUKTzBck.js +1 -0
  539. package/dist/chunks/workSecret-C_lv0dRh.js +1 -0
  540. package/dist/chunks/workerRegistry-BdHi7_sN.js +1 -0
  541. package/dist/chunks/worktree-YDeHMlHZ.js +1 -0
  542. package/dist/chunks/worktreeModeEnabled-BFOYTTTr.js +1 -0
  543. package/dist/chunks/worktreeModeEnabled-D68iEHpC.js +1 -0
  544. package/dist/chunks/wrapper-K8ZapJVu.js +6 -0
  545. package/dist/chunks/xdg-DcF9ejUM.js +1 -0
  546. package/dist/chunks/zod-CuNujUwx.js +1 -0
  547. package/dist/cli-bun.js +2 -0
  548. package/dist/cli-node.js +2 -0
  549. package/dist/cli.js +2 -0
  550. package/dist/vendor/ripgrep/x64-linux/rg +0 -0
  551. package/package.json +218 -0
  552. package/scripts/postinstall.cjs +389 -0
@@ -0,0 +1,4 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./defineProperty-C-QyHrDq.js";import{ReadStream as r,fstatSync as i,lstatSync as a}from"node:fs";import{getRandomValues as o}from"node:crypto";import{Readable as s,Writable as c}from"node:stream";var l,u=e((()=>{l=e=>typeof ArrayBuffer==`function`&&e instanceof ArrayBuffer||Object.prototype.toString.call(e)===`[object ArrayBuffer]`})),d,f,p=e((()=>{u(),d=(e,t=0,n=e.byteLength-t)=>{if(!l(e))throw TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof e} (${e})`);return Buffer.from(e,t,n)},f=(e,t)=>{if(typeof e!=`string`)throw TypeError(`The "input" argument must be of type string. Received type ${typeof e} (${e})`);return t?Buffer.from(e,t):Buffer.from(e)}})),m,h,ee=e((()=>{p(),m=/^[A-Za-z0-9+/]*={0,2}$/,h=e=>{if(e.length*3%4!=0)throw TypeError(`Incorrect padding on base64 string.`);if(!m.exec(e))throw TypeError(`Invalid base64 string.`);let t=f(e,`base64`);return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}})),g,_=e((()=>{p(),g=e=>{let t=f(e,`utf8`);return new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT)}})),v,te=e((()=>{p(),_(),v=e=>{let t;if(t=typeof e==`string`?g(e):e,typeof t!=`object`||typeof t.byteOffset!=`number`||typeof t.byteLength!=`number`)throw Error(`@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.`);return d(t.buffer,t.byteOffset,t.byteLength).toString(`base64`)}}));function ne(e,t,n,r){return class i extends Uint8Array{static fromString(e,n=`utf-8`){if(typeof e==`string`)return n===`base64`?i.mutate(r(e)):i.mutate(t(e));throw Error(`Unsupported conversion from ${typeof e} to Uint8ArrayBlobAdapter.`)}static mutate(e){return Object.setPrototypeOf(e,i.prototype),e}transformToString(t=`utf-8`){return t===`base64`?n(this):e(this)}}}var re=e((()=>{})),y,ie=e((()=>{p(),y=e=>{if(typeof e==`string`)return e;if(typeof e!=`object`||typeof e.byteOffset!=`number`||typeof e.byteLength!=`number`)throw Error(`@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.`);return d(e.buffer,e.byteOffset,e.byteLength).toString(`utf8`)}}));function ae(e){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?()=>crypto.randomUUID():()=>{let t=new Uint8Array(16);return e(t),t[6]=t[6]&15|64,t[8]=t[8]&63|128,b[t[0]]+b[t[1]]+b[t[2]]+b[t[3]]+`-`+b[t[4]]+b[t[5]]+`-`+b[t[6]]+b[t[7]]+`-`+b[t[8]]+b[t[9]]+`-`+b[t[10]]+b[t[11]]+b[t[12]]+b[t[13]]+b[t[14]]+b[t[15]]}}var b,oe=e((()=>{b=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`))})),x,se,ce,le,ue,de,S,fe,pe,me,he,C,w,ge,_e,ve,ye=e((()=>{x=e=>{if(e!=null){if(typeof e==`string`){let t=parseFloat(e);if(!Number.isNaN(t))return String(t)!==String(e)&&ve.warn(_e(`Expected number but observed string: ${e}`)),t}if(typeof e==`number`)return e;throw TypeError(`Expected number, got ${typeof e}: ${e}`)}},se=Math.ceil(2**127*(2-2**-23)),ce=e=>{let t=x(e);if(t!==void 0&&!Number.isNaN(t)&&t!==1/0&&t!==-1/0&&Math.abs(t)>se)throw TypeError(`Expected 32-bit float, got ${e}`);return t},le=e=>{if(e!=null){if(Number.isInteger(e)&&!Number.isNaN(e))return e;throw TypeError(`Expected integer, got ${typeof e}: ${e}`)}},ue=e=>S(e,16),de=e=>S(e,8),S=(e,t)=>{let n=le(e);if(n!==void 0&&fe(n,t)!==n)throw TypeError(`Expected ${t}-bit integer, got ${e}`);return n},fe=(e,t)=>{switch(t){case 32:return Int32Array.of(e)[0];case 16:return Int16Array.of(e)[0];case 8:return Int8Array.of(e)[0]}},pe=e=>x(typeof e==`string`?C(e):e),me=e=>ce(typeof e==`string`?C(e):e),he=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,C=e=>{let t=e.match(he);if(t===null||t[0].length!==e.length)throw TypeError(`Expected real number, got implicit NaN`);return parseFloat(e)},w=e=>ue(typeof e==`string`?C(e):e),ge=e=>de(typeof e==`string`?C(e):e),_e=e=>String(TypeError(e).stack||e).split(`
2
+ `).slice(0,5).filter(e=>!e.includes(`stackTraceWarning`)).join(`
3
+ `),ve={warn:console.warn}}));function be(e){let t=e.getUTCFullYear(),n=e.getUTCMonth(),r=e.getUTCDay(),i=e.getUTCDate(),a=e.getUTCHours(),o=e.getUTCMinutes(),s=e.getUTCSeconds(),c=i<10?`0${i}`:`${i}`,l=a<10?`0${a}`:`${a}`,u=o<10?`0${o}`:`${o}`,d=s<10?`0${s}`:`${s}`;return`${xe[r]}, ${c} ${T[n]} ${t} ${l}:${u}:${d} GMT`}var xe,T,Se,Ce,we,Te,Ee,E,D,De,Oe,O,ke,Ae,je,k,Me,Ne,Pe,A,Fe,Ie,j,Le=e((()=>{ye(),xe=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],T=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],Se=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/),Ce=e=>{if(e==null)return;if(typeof e!=`string`)throw TypeError(`RFC-3339 date-times must be expressed as strings`);let t=Se.exec(e);if(!t)throw TypeError(`Invalid RFC-3339 date-time value`);let[n,r,i,a,o,s,c,l]=t,u=w(j(r)),d=A(i,`month`,1,12),f=A(a,`day`,1,31);return O(u,d,f,{hours:o,minutes:s,seconds:c,fractionalMilliseconds:l})},we=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),Te=e=>{if(e==null)return;if(typeof e!=`string`)throw TypeError(`RFC-3339 date-times must be expressed as strings`);let t=we.exec(e);if(!t)throw TypeError(`Invalid RFC-3339 date-time value`);let[n,r,i,a,o,s,c,l,u]=t,d=w(j(r)),f=A(i,`month`,1,12),p=A(a,`day`,1,31),m=O(d,f,p,{hours:o,minutes:s,seconds:c,fractionalMilliseconds:l});return u.toUpperCase()!=`Z`&&m.setTime(m.getTime()-Ie(u)),m},Ee=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),E=new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),D=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/),De=e=>{if(e==null)return;if(typeof e!=`string`)throw TypeError(`RFC-7231 date-times must be expressed as strings`);let t=Ee.exec(e);if(t){let[e,n,r,i,a,o,s,c]=t;return O(w(j(i)),k(r),A(n,`day`,1,31),{hours:a,minutes:o,seconds:s,fractionalMilliseconds:c})}if(t=E.exec(e),t){let[e,n,r,i,a,o,s,c]=t;return je(O(ke(i),k(r),A(n,`day`,1,31),{hours:a,minutes:o,seconds:s,fractionalMilliseconds:c}))}if(t=D.exec(e),t){let[e,n,r,i,a,o,s,c]=t;return O(w(j(c)),k(n),A(r.trimLeft(),`day`,1,31),{hours:i,minutes:a,seconds:o,fractionalMilliseconds:s})}throw TypeError(`Invalid RFC-7231 date-time value`)},Oe=e=>{if(e==null)return;let t;if(typeof e==`number`)t=e;else if(typeof e==`string`)t=pe(e);else if(typeof e==`object`&&e.tag===1)t=e.value;else throw TypeError(`Epoch timestamps must be expressed as floating point numbers or their string representation`);if(Number.isNaN(t)||t===1/0||t===-1/0)throw TypeError(`Epoch timestamps must be valid, non-Infinite, non-NaN numerics`);return new Date(Math.round(t*1e3))},O=(e,t,n,r)=>{let i=t-1;return Ne(e,i,n),new Date(Date.UTC(e,i,n,A(r.hours,`hour`,0,23),A(r.minutes,`minute`,0,59),A(r.seconds,`seconds`,0,60),Fe(r.fractionalMilliseconds)))},ke=e=>{let t=new Date().getUTCFullYear(),n=Math.floor(t/100)*100+w(j(e));return n<t?n+100:n},Ae=50*365*24*60*60*1e3,je=e=>e.getTime()-new Date().getTime()>Ae?new Date(Date.UTC(e.getUTCFullYear()-100,e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds())):e,k=e=>{let t=T.indexOf(e);if(t<0)throw TypeError(`Invalid month: ${e}`);return t+1},Me=[31,28,31,30,31,30,31,31,30,31,30,31],Ne=(e,t,n)=>{let r=Me[t];if(t===1&&Pe(e)&&(r=29),n>r)throw TypeError(`Invalid day for ${T[t]} in ${e}: ${n}`)},Pe=e=>e%4==0&&(e%100!=0||e%400==0),A=(e,t,n,r)=>{let i=ge(j(e));if(i<n||i>r)throw TypeError(`${t} must be between ${n} and ${r}, inclusive`);return i},Fe=e=>e==null?0:me(`0.`+e)*1e3,Ie=e=>{let t=e[0],n=1;if(t==`+`)n=1;else if(t==`-`)n=-1;else throw TypeError(`Offset direction, ${t}, must be "+" or "-"`);let r=Number(e.substring(1,3)),i=Number(e.substring(4,6));return n*(r*60+i)*60*1e3},j=e=>{let t=0;for(;t<e.length-1&&e.charAt(t)===`0`;)t++;return t===0?e:e.slice(t)}})),M,Re=e((()=>{M=function(e){return Object.assign(new String(e),{deserializeJSON(){return JSON.parse(String(e))},toString(){return String(e)},toJSON(){return String(e)}})},M.from=e=>e&&typeof e==`object`&&(e instanceof M||`deserializeJSON`in e)?e:typeof e==`string`||Object.getPrototypeOf(e)===String.prototype?M(String(e)):M(JSON.stringify(e)),M.fromObject=M.from}));function ze(e){return(e.includes(`,`)||e.includes(`"`))&&(e=`"${e.replace(/"/g,`\\"`)}"`),e}var Be=e((()=>{}));function N(e,t,n){let r=Number(e);if(r<t||r>n)throw Error(`Value ${r} out of range [${t}, ${n}]`)}var P,F,I,L,R,Ve,He,Ue,We,Ge,z,Ke,qe,Je=e((()=>{P=`(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?`,F=`(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)`,I=`(\\d?\\d):(\\d{2}):(\\d{2})(?:\\.(\\d+))?`,L=`(\\d?\\d)`,R=`(\\d{4})`,Ve=new RegExp(/^(\d{4})-(\d\d)-(\d\d)[tT](\d\d):(\d\d):(\d\d)(\.(\d+))?(([-+]\d\d:\d\d)|[zZ])$/),He=RegExp(`^${P}, ${L} ${F} ${R} ${I} GMT$`),Ue=RegExp(`^${P}, ${L}-${F}-(\\d\\d) ${I} GMT$`),We=RegExp(`^${P} ${F} ( [1-9]|\\d\\d) ${I} ${R}$`),Ge=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],z=e=>{if(e==null)return;let t=NaN;if(typeof e==`number`)t=e;else if(typeof e==`string`){if(!/^-?\d*\.?\d+$/.test(e))throw TypeError(`parseEpochTimestamp - numeric string invalid.`);t=Number.parseFloat(e)}else typeof e==`object`&&e.tag===1&&(t=e.value);if(isNaN(t)||Math.abs(t)===1/0)throw TypeError(`Epoch timestamps must be valid finite numbers.`);return new Date(Math.round(t*1e3))},Ke=e=>{if(e==null)return;if(typeof e!=`string`)throw TypeError(`RFC3339 timestamps must be strings`);let t=Ve.exec(e);if(!t)throw TypeError(`Invalid RFC3339 timestamp format ${e}`);let[,n,r,i,a,o,s,,c,l]=t;N(r,1,12),N(i,1,31),N(a,0,23),N(o,0,59),N(s,0,60);let u=new Date(Date.UTC(Number(n),Number(r)-1,Number(i),Number(a),Number(o),Number(s),Number(c)?Math.round(parseFloat(`0.${c}`)*1e3):0));if(u.setUTCFullYear(Number(n)),l.toUpperCase()!=`Z`){let[,e,t,n]=/([+-])(\d\d):(\d\d)/.exec(l)||[void 0,`+`,0,0],r=e===`-`?1:-1;u.setTime(u.getTime()+r*(Number(t)*60*60*1e3+Number(n)*60*1e3))}return u},qe=e=>{if(e==null)return;if(typeof e!=`string`)throw TypeError(`RFC7231 timestamps must be strings.`);let t,n,r,i,a,o,s,c;if((c=He.exec(e))?[,t,n,r,i,a,o,s]=c:(c=Ue.exec(e))?([,t,n,r,i,a,o,s]=c,r=(Number(r)+1900).toString()):(c=We.exec(e))&&([,n,t,i,a,o,s,r]=c),r&&o){let e=Date.UTC(Number(r),Ge.indexOf(n),Number(t),Number(i),Number(a),Number(o),s?Math.round(parseFloat(`0.${s}`)*1e3):0);N(t,1,31),N(i,0,23),N(a,0,59),N(o,0,60);let c=new Date(e);return c.setUTCFullYear(Number(r)),c}throw TypeError(`Invalid RFC7231 date-time value ${e}.`)}}));function Ye(e,t,n){if(n<=0||!Number.isInteger(n))throw Error(`Invalid number of delimiters (`+n+`) for splitEvery.`);let r=e.split(t);if(n===1)return r;let i=[],a=``;for(let e=0;e<r.length;e++)a===``?a=r[e]:a+=t+r[e],(e+1)%n===0&&(i.push(a),a=``);return a!==``&&i.push(a),i}var Xe=e((()=>{})),Ze,Qe=e((()=>{Ze=e=>{let t=e.length,n=[],r=!1,i,a=0;for(let o=0;o<t;++o){let t=e[o];switch(t){case`"`:i!==`\\`&&(r=!r);break;case`,`:r||(n.push(e.slice(a,o)),a=o+1);break;default:}i=t}return n.push(e.slice(a)),n.map(e=>{e=e.trim();let t=e.length;return t<2?e:(e[0]===`"`&&e[t-1]===`"`&&(e=e.slice(1,t-1)),e.replace(/\\"/g,`"`))})}})),$e,B,et,tt=e((()=>{t(),B=/^-?\d*(\.\d+)?$/,$e=Symbol.hasInstance,et=class e{constructor(e,t){if(n(this,`string`,void 0),n(this,`type`,void 0),this.string=e,this.type=t,!B.test(e))throw Error(`@smithy/core/serde - NumericValue must only contain [0-9], at most one decimal point ".", and an optional negation prefix "-".`)}toString(){return this.string}static[$e](t){if(!t||typeof t!=`object`)return!1;let n=t;return e.prototype.isPrototypeOf(t)||n.type===`bigDecimal`&&B.test(n.string)}}}));function nt(e){if(e.length%2!=0)throw Error(`Hex encoded strings must have an even number length`);let t=new Uint8Array(e.length/2);for(let n=0;n<e.length;n+=2){let r=e.slice(n,n+2).toLowerCase();if(r in H)t[n/2]=H[r];else throw Error(`Cannot decode unrecognized sequence ${r} as hexadecimal`)}return t}function rt(e){let t=``;for(let n=0;n<e.byteLength;n++)t+=V[e[n]];return t}var V,H,U=e((()=>{V={},H={};for(let e=0;e<256;e++){let t=e.toString(16).toLowerCase();t.length===1&&(t=`0${t}`),V[e]=t,H[t]=e}})),it,at=e((()=>{it=e=>{if(!e)return 0;if(typeof e==`string`)return Buffer.byteLength(e);if(typeof e.byteLength==`number`)return e.byteLength;if(typeof e.size==`number`)return e.size;if(typeof e.start==`number`&&typeof e.end==`number`)return e.end+1-e.start;if(e instanceof r){if(e.path!=null)return a(e.path).size;if(typeof e.fd==`number`)return i(e.fd).size}throw Error(`Body Length computation failed for ${e}`)}})),ot,st=e((()=>{_(),ot=e=>e instanceof Uint8Array?e:typeof e==`string`?g(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}));function ct(e,t){if(t===void 0){t=0;for(let n of e)t+=n.byteLength}let n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.byteLength;return n}var lt=e((()=>{})),W,G,K=e((()=>{W=e=>typeof ReadableStream==`function`&&(e?.constructor?.name===ReadableStream.name||e instanceof ReadableStream),G=e=>typeof Blob==`function`&&(e?.constructor?.name===Blob.name||e instanceof Blob)})),ut,dt=e((()=>{ut=e=>new TextEncoder().encode(e)})),q,ft,pt=e((()=>{q=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,Object.entries(q).reduce((e,[t,n])=>(e[n]=Number(t),e),{}),ft=q.split(``)}));function mt(e){let t;t=typeof e==`string`?ut(e):e;let n=typeof t==`object`&&typeof t.length==`number`,r=typeof t==`object`&&typeof t.byteOffset==`number`&&typeof t.byteLength==`number`;if(!n&&!r)throw Error(`@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.`);let i=``;for(let e=0;e<t.length;e+=3){let n=0,r=0;for(let i=e,a=Math.min(e+3,t.length);i<a;i++)n|=t[i]<<(a-i-1)*8,r+=8;let a=Math.ceil(r/6);n<<=a*6-r;for(let e=1;e<=a;e++){let t=(a-e)*6;i+=ft[(n&63<<t)>>t]}i+=`==`.slice(0,4-a)}return i}var ht=e((()=>{dt(),pt()})),gt,_t=e((()=>{gt=e=>{if(typeof e==`string`)return e;if(typeof e!=`object`||typeof e.byteOffset!=`number`||typeof e.byteLength!=`number`)throw Error(`@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.`);return new TextDecoder(`utf-8`).decode(e)}}));async function vt(e){return e.arrayBuffer().then(e=>new Uint8Array(e))}async function yt(e){let t=[],n=e.getReader(),r=0;for(;;){let{done:e,value:i}=await n.read();if(i&&(t.push(i),r+=i.length),e)break}return ct(t,r)}var bt,xt=e((()=>{lt(),K(),bt=async e=>G(e)?vt(e):yt(e)})),J,St,Y,Ct=e((()=>{ht(),U(),_t(),xt(),K(),J=`The stream has already been transformed.`,St=e=>{if(!Y(e)&&!W(e)){let t=e?.__proto__?.constructor?.name||e;throw Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${t}`)}let t=!1,n=async()=>{if(t)throw Error(J);return t=!0,await bt(e)},r=e=>{if(typeof e.stream!=`function`)throw Error(`Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.
4
+ If you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body`);return e.stream()};return Object.assign(e,{transformToByteArray:n,transformToString:async e=>{let t=await n();if(e===`base64`)return mt(t);if(e===`hex`)return rt(t);if(e===void 0||e===`utf8`||e===`utf-8`)return gt(t);if(typeof TextDecoder==`function`)return new TextDecoder(e).decode(t);throw Error(`TextDecoder is not available, please make sure polyfill is provided.`)},transformToWebStream:()=>{if(t)throw Error(J);if(t=!0,Y(e))return r(e);if(W(e))return e;throw Error(`Cannot transform payload to web stream, got ${e}`)}})},Y=e=>typeof Blob==`function`&&e instanceof Blob})),X,wt,Z=e((()=>{lt(),xt(),K(),t(),X=e=>G(e)?vt(e):W(e)?yt(e):new Promise((t,n)=>{let r=new wt,i=e;i.pipe(r),i.on(`error`,e=>{r.end(),n(e)}),r.on(`error`,n),r.on(`finish`,function(){t(ct(this.bufferedBytes))})}),wt=class extends c{constructor(...e){super(...e),n(this,`bufferedBytes`,[])}_write(e,t,n){this.bufferedBytes.push(e),n()}}})),Q,Tt,Et=e((()=>{p(),Ct(),Z(),Q=`The stream has already been transformed.`,Tt=e=>{if(!(e instanceof s))try{return St(e)}catch{let t=e?.__proto__?.constructor?.name||e;throw Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${t}`)}let t=!1,n=async()=>{if(t)throw Error(Q);return t=!0,await X(e)};return Object.assign(e,{transformToByteArray:n,transformToString:async e=>{let t=await n();return e===void 0||Buffer.isEncoding(e)?d(t.buffer,t.byteOffset,t.byteLength).toString(e):new TextDecoder(e).decode(t)},transformToWebStream:()=>{if(t)throw Error(Q);if(e.readableFlowing!==null)throw Error(`The stream has been consumed by other callbacks.`);if(typeof s.toWeb!=`function`)throw Error(`Readable.toWeb() is not supported. Please ensure a polyfill is available.`);return t=!0,s.toWeb(e)}})}})),Dt,Ot,$,kt,At=e((()=>{ee(),te(),re(),_(),ie(),oe(),Le(),Re(),ye(),Be(),Je(),Xe(),Qe(),tt(),U(),at(),st(),p(),u(),K(),ht(),Et(),Z(),Dt=class extends ne(y,g,v,h){},Ot=o,$=ae(Ot),kt=$}));export{be as A,g as B,Ke as C,ze as D,Be as E,De as F,l as G,h as H,ie as I,y as L,Oe as M,Ce as N,M as O,Te as P,te as R,z as S,Je as T,ee as U,_ as V,u as W,tt as _,Et as a,Xe as b,X as c,it as d,at as f,et as g,rt as h,$ as i,Le as j,Re as k,st as l,U as m,kt as n,Tt as o,nt as p,At as r,Z as s,Dt as t,ot as u,Qe as v,qe as w,Ye as x,Ze as y,v as z};
@@ -0,0 +1 @@
1
+ var e=()=>({stop(){}});export{e as startServer};
@@ -0,0 +1 @@
1
+ var e=()=>{};export{e as printBanner};
@@ -0,0 +1 @@
1
+ var e=()=>({});export{e as createServerLogger};
@@ -0,0 +1,2 @@
1
+ import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,P as r,Wt as i,fi as a,t as o,x as s}from"./src-CDCSSo0U2.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{lS as l,uS as u}from"./loadAgentsDir-nzr38hai.js";import{l as d,p as f}from"./debug-IKW-jE7K.js";import{u as p}from"./referral-DP_GshTS.js";import{t as m}from"./lib-BlVGipXx.js";function h({onDone:e}){let t=u(e=>e.remoteSessionUrl),[a,o]=(0,_.useState)(``);if((0,_.useEffect)(()=>{if(!t)return;let e=t;async function n(){let t=await(0,g.toString)(e,{type:`utf8`,errorCorrectionLevel:`L`});o(t)}n().catch(e=>{f(`QR code generation failed`,e)})},[t]),i(`confirm:no`,e,{context:`Confirmation`}),!t)return(0,v.jsxs)(s,{children:[(0,v.jsx)(r,{color:`warning`,children:"Not in remote mode. Start with `claude --remote` to use this command."}),(0,v.jsx)(r,{dimColor:!0,children:`(press esc to close)`})]});let c=a.split(`
2
+ `).filter(e=>e.length>0),l=c.length===0;return(0,v.jsxs)(s,{children:[(0,v.jsx)(n,{marginBottom:1,children:(0,v.jsx)(r,{bold:!0,children:`Remote session`})}),l?(0,v.jsx)(r,{dimColor:!0,children:`Generating QR code…`}):c.map((e,t)=>(0,v.jsx)(r,{children:e},t)),(0,v.jsxs)(n,{marginTop:1,children:[(0,v.jsx)(r,{dimColor:!0,children:`Open in browser: `}),(0,v.jsx)(r,{color:`ide`,children:t})]}),(0,v.jsx)(n,{marginTop:1,children:(0,v.jsx)(r,{dimColor:!0,children:`(press esc to close)`})})]})}var g,_,v,y;e((()=>{g=m(),a(),_=t(a(),1),o(),p(),l(),d(),v=c(),y=async e=>(0,v.jsx)(h,{onDone:e})}))();export{y as call};
@@ -0,0 +1 @@
1
+ var e=()=>{};export{e as createSessionTurnUploader};
@@ -0,0 +1 @@
1
+ import{l as e,p as t}from"./debug-IKW-jE7K.js";e();async function n(){let{fetchCodeSessionsFromSessionsAPI:e}=await import(`./api-L2IgleTV.js`),n;try{n=await e()}catch(e){throw t(`[assistant:discovery] fetchCodeSessionsFromSessionsAPI failed: ${e}`),e}return n.filter(e=>e.status===`idle`||e.status===`working`||e.status===`waiting`).map(e=>({id:e.id,title:e.title||`Untitled`,status:e.status,created_at:e.created_at??``}))}export{n as discoverAssistantSessions};
@@ -0,0 +1 @@
1
+ import{xu as e,yu as t}from"./loadAgentsDir-nzr38hai.js";t();export{e as registerSessionFileAccessHooks};
@@ -0,0 +1 @@
1
+ var e=class{async destroyAll(){}};export{e as SessionManager};
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{B as r,en as i}from"./state-4KQ3kaqz.js";import{AT as a,Al as o,BT as s,Bc as c,CT as l,DT as u,Dl as d,ET as f,El as p,FT as m,Fn as ee,GT as te,In as ne,KT as re,Ln as ie,Lo as h,MT as g,Ml as _,NT as v,OT as ae,PT as oe,So as y,TT as se,UT as b,VT as ce,Vc as le,cl as ue,dT as de,fl as x,jT as S,kT as C,lt as w,lw as T,ml as E,pl as D,qT as O,sl as k,ut as A,uw as j,xT as M,zo as N}from"./loadAgentsDir-nzr38hai.js";import{B as P,U as F,_ as I,h as L,z as R}from"./debug-IKW-jE7K.js";import{_n as z,gn as B}from"./settings-5PQdphqC.js";import{n as V,r as H}from"./analytics-BotDBGh0.js";import{Ci as fe,Si as pe}from"./model-DfFA3qMO.js";import{pn as me,un as U}from"./prompt-Bef63FhB.js";import{st as he}from"./rcDebugLog-BUuD-X1D.js";import{writeFile as W}from"fs/promises";function ge(){return!1}function _e(){return{}}function ve(e,t){let n=0,r=t==null;for(let i of e){if(!r){i.uuid===t&&(r=!0);continue}if(i.type===`assistant`){let e=i.message.content;Array.isArray(e)&&(n+=B(e,e=>e.type===`tool_use`))}}return n}function G(e){let t=b(e);if(!C()){if(!f(t))return!1;g()}let n=u(t),r=ve(e,X)>=se(),i=h(e);if(n&&r||n&&!i){let t=e[e.length-1];return t?.uuid&&(X=t.uuid),!0}return!1}async function K(e){let t=L(),n=ee();await t.mkdir(n,{mode:448});let r=ne();try{await W(r,``,{encoding:`utf-8`,mode:384,flag:`wx`}),await W(r,await E(),{encoding:`utf-8`,mode:384})}catch(e){if(P(e)!==`EEXIST`)throw e}e.readFileState.delete(r);let i=await c.call({file_path:r},e),a=``,o=i.data;return o.type===`text`&&(a=o.file.content),H(`tengu_session_memory_file_read`,{content_length:a.length}),{memoryPath:r,currentMemory:a}}function ye(){if(r())return;let e=ue();process.env.USER_TYPE===`ant`&&H(`tengu_session_memory_init`,{auto_compact_enabled:e}),e&&j($)}async function q(e,t){if(e.length===0)return{success:!1,error:`No messages to summarize`};S();try{let n=d(t),{memoryPath:r,currentMemory:i}=await K(n),a=await x(i,r),{tools:o,mainLoopModel:s}=t.options,[c,l,u]=await Promise.all([w(o,s),re(),te()]),f=he(c);return await _({promptMessages:[y({content:a})],cacheSafeParams:{systemPrompt:f,userContext:l,systemContext:u,toolUseContext:n,forkContextMessages:e},canUseTool:J(r),querySource:`session_memory`,forkLabel:`session_memory_manual`,overrides:{readFileState:n.readFileState}}),H(`tengu_session_memory_manual_extraction`,{}),v(b(e)),Y(e),{success:!0,memoryPath:r}}catch(e){return{success:!1,error:R(e)}}finally{a()}}function J(e){return async(t,n)=>{if(t.name===`Edit`&&typeof n==`object`&&n&&`file_path`in n){let t=n.file_path;if(typeof t==`string`&&t===e)return{behavior:`allow`,updatedInput:n}}return{behavior:`deny`,message:`only ${U} on ${e} is allowed`,decisionReason:{type:`other`,reason:`only ${U} on ${e} is allowed`}}}}function Y(e){if(!h(e)){let t=e[e.length-1];t?.uuid&&oe(t.uuid)}}var X,Z,Q,$,be=e((()=>{n(),i(),A(),O(),me(),le(),z(),o(),I(),T(),N(),ie(),pe(),de(),ce(),V(),k(),D(),ae(),F(),Z=t(()=>{let e=_e();m({minimumMessageTokensToInit:e.minimumMessageTokensToInit&&e.minimumMessageTokensToInit>0?e.minimumMessageTokensToInit:M.minimumMessageTokensToInit,minimumTokensBetweenUpdate:e.minimumTokensBetweenUpdate&&e.minimumTokensBetweenUpdate>0?e.minimumTokensBetweenUpdate:M.minimumTokensBetweenUpdate,toolCallsBetweenUpdates:e.toolCallsBetweenUpdates&&e.toolCallsBetweenUpdates>0?e.toolCallsBetweenUpdates:M.toolCallsBetweenUpdates})}),Q=!1,$=fe(async function(e){let{messages:t,toolUseContext:n,querySource:r}=e;if(r!==`repl_main_thread`)return;{let{isPoorModeActive:e}=await import(`./poorMode-jvImnkty.js`);if(e())return}if(!ge()){process.env.USER_TYPE===`ant`&&!Q&&(Q=!0,H(`tengu_session_memory_gate_disabled`,{}));return}if(Z(),!G(t))return;S();let i=d(n),{memoryPath:o,currentMemory:c}=await K(i);await _({promptMessages:[y({content:await x(c,o)})],cacheSafeParams:p(e),canUseTool:J(o),querySource:`session_memory`,forkLabel:`session_memory`,overrides:{readFileState:i.readFileState}});let u=t[t.length-1],f=u?s(u):void 0,m=l();H(`tengu_session_memory_extraction`,{input_tokens:f?.input_tokens,output_tokens:f?.output_tokens,cache_read_input_tokens:f?.cache_read_input_tokens??void 0,cache_creation_input_tokens:f?.cache_creation_input_tokens??void 0,config_min_message_tokens_to_init:m.minimumMessageTokensToInit,config_min_tokens_between_update:m.minimumTokensBetweenUpdate,config_tool_calls_between_updates:m.toolCallsBetweenUpdates}),v(b(t)),Y(t),a()})}));export{G as a,q as i,ye as n,be as r,J as t};
@@ -0,0 +1 @@
1
+ import{i as e,r as t}from"./sessionMemory-Bsg2unYX.js";t();export{e as manuallyExtractSessionMemory};
@@ -0,0 +1 @@
1
+ import{OT as e,wT as t}from"./loadAgentsDir-nzr38hai.js";e();export{t as getSessionMemoryContent};
@@ -0,0 +1 @@
1
+ import{i as e,r as t}from"./sessionObserver-DQwHsDrM.js";e();export{t as heuristicObserverBackend};
@@ -0,0 +1,20 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{dT as t,et as n,tt as r}from"./loadAgentsDir-nzr38hai.js";import{st as i}from"./rcDebugLog-BUuD-X1D.js";import{i as a,l as o,r as s,t as c,u as l}from"./instinctParser-Dt-lqnDe.js";function u(e){g.set(e.name,e),_||(_=e.name)}function d(e){if(!g.has(e))throw Error(`Observer backend "${e}" is not registered`);_=e}function f(){let e=_?g.get(_):void 0;if(!e)throw Error(`No observer backend is active — register one before analyzing observations`);return e}async function p(e,t){return Promise.resolve(f().analyze(e,t))}function m(){let e=process.env.SKILL_LEARNING_OBSERVER_BACKEND?.trim();return e&&g.has(e)?e:void 0}function h(){let e=m();return e&&d(e),f()}var g,_,v=e((()=>{g=new Map})),y,b=e((()=>{y=[`workflow`,`testing`,`debugging`,`code-style`,`security`,`git`,`project`]}));async function x(e,t){if(e.length===0)return[];if(Date.now()<L)return S(e,t);let n=e.slice(-30),a=C(n),s=P(o().llm.timeoutMs),c;try{let e=await r({systemPrompt:i([R]),userPrompt:a,signal:s,options:{querySource:`skill_learning_observer`,enablePromptCaching:!0,agents:[],isNonInteractiveSession:!0,hasAppendSystemPrompt:!1,mcpTools:[]}});I=0,c=T(e.message?.content)}catch{return I++,I>=o().llm.failureThreshold&&(L=Date.now()+o().llm.circuitCooldownMs),S(e,t)}let l=E(c,t,n);return l.length===0?(I++,I>=o().llm.failureThreshold&&(L=Date.now()+o().llm.circuitCooldownMs),S(e,t)):l}async function S(e,t){try{let{heuristicObserverBackend:n}=await import(`./sessionObserver-CRU1qWnP.js`),r=n.analyze(e,t);return Array.isArray(r)?r:await r}catch{return[]}}function C(e){return`Observations (chronological, newest last):\n${e.map((e,t)=>ee(e,t)).join(`
2
+ `)}\n\nExtract up to ${F} atomic instincts. JSON array only.`}function ee(e,t){let n=[`#${t+1}`,`event=${e.event}`];return e.toolName&&n.push(`tool=${e.toolName}`),e.outcome&&n.push(`outcome=${e.outcome}`),e.messageText&&n.push(`text=${JSON.stringify(w(e.messageText,200))}`),e.toolInput&&n.push(`in=${JSON.stringify(w(e.toolInput,120))}`),e.toolOutput&&n.push(`out=${JSON.stringify(w(e.toolOutput,120))}`),n.join(` | `)}function w(e,t){return e.length<=t?e:`${e.slice(0,t)}…`}function T(e){if(!Array.isArray(e))return``;let t=[];for(let n of e){if(!n||typeof n!=`object`)continue;let e=n;e.type===`text`&&typeof e.text==`string`&&t.push(e.text)}return t.join(``).trim()}function E(e,t,n){let r=D(e);if(!r)return[];let i;try{i=JSON.parse(r)}catch{return[]}if(!Array.isArray(i))return[];let a=n.map(e=>e.id),o=[];for(let e of i.slice(0,F)){let n=O(e,t,a);n&&o.push(n)}return o}function D(e){if(!e)return;let t=e.indexOf(`[`),n=e.lastIndexOf(`]`);if(!(t<0||n<=t))return e.slice(t,n+1)}function O(e,t,n){if(!e||typeof e!=`object`)return;let r=e,i=k(r.trigger,80),a=k(r.action,120);if(!i||!a)return;let o=N(r.evidence);if(o.length!==0)return{trigger:i,action:a,confidence:A(r.confidence),domain:j(r.domain),source:`session-observation`,scope:M(r.scope),projectId:t?.project?.projectId,projectName:t?.project?.projectName,evidence:o,observationIds:n}}function k(e,t){if(typeof e!=`string`)return;let n=e.trim();if(n)return n.length>t?n.slice(0,t):n}function A(e){return typeof e!=`number`||!Number.isFinite(e)?.5:e<0?0:e>1?1:e}function j(e){return typeof e==`string`&&y.includes(e)?e:`project`}function M(e){return e===`global`?`global`:`project`}function N(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){if(typeof n!=`string`)continue;let e=n.trim();if(e&&(t.push(e.length>200?`${e.slice(0,200)}…`:e),t.length===3))break}return t}function P(e){return AbortSignal.timeout(e)}var F,I,L,R,z,B=e((()=>{n(),t(),l(),b(),F=3,I=0,L=0,R=`You analyse a short sequence of observations from a coding-assistant session (user messages, tool invocations with outcomes, assistant messages) and extract atomic, reusable "instincts" — behavioural patterns that would help the assistant act correctly in future similar situations.
3
+
4
+ Respond with ONLY a JSON array (no prose, no code fences, no commentary). Each item must match this schema:
5
+
6
+ {
7
+ "trigger": string, // <= 80 chars, short phrase describing WHEN the instinct applies
8
+ "action": string, // <= 120 chars, short phrase describing WHAT to do
9
+ "confidence": number, // 0..1 — how strongly these observations support the pattern
10
+ "domain": "workflow"|"testing"|"debugging"|"code-style"|"security"|"git"|"project",
11
+ "scope": "project"|"global",
12
+ "evidence": string[] // 1..3 short excerpts copied/paraphrased from the observations
13
+ }
14
+
15
+ Rules:
16
+ - Return [] if nothing clearly reusable. No guessing.
17
+ - At most 3 items, highest confidence first.
18
+ - confidence > 0.7 only when observations show the pattern in action (a correction followed by a successful retry, a repeated sequence, an explicit rule).
19
+ - Never include secrets, tokens, full file contents, or personally-identifying data.
20
+ - Scope "global" only when the pattern is obviously project-agnostic (generic testing, git hygiene); default to "project".`,z={name:`llm`,analyze(e,t){return x(e,t)}}}));function V(e,t){return[...W(e),...G(e),...K(e,t),...q(e)]}function H(e,t){let n=f();return(n.name===`heuristic`?V(e,t):U(n.analyze(e))).map(e=>s(e))}function U(e){if(Array.isArray(e))return e;throw Error(`Active observer backend returned a Promise; use analyzeObservationsAsync instead`)}function W(e){return e.flatMap((t,n)=>{if(t.event!==`user_message`||!t.messageText)return[];let r=t.messageText.trim(),i=X(r);return i?[{...c(t),trigger:i.trigger,action:i.action,confidence:.7,domain:Z(r),source:`session-observation`,scope:`project`,evidence:[r],evidenceOutcome:J(e,n),observationIds:[t.id]}]:[]})}function G(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];if(r.event!==`tool_complete`||r.outcome!==`failure`)continue;let i=e.slice(n+1,n+6).find(e=>e.event===`tool_complete`&&e.outcome===`success`&&e.toolName===r.toolName);!i||!r.toolName||t.push({...c(r),trigger:`When ${r.toolName} fails during this project`,action:`Use the follow-up successful ${r.toolName} invocation as the resolution pattern before retrying blindly.`,confidence:.5,domain:`debugging`,source:`session-observation`,scope:`project`,evidence:[r.toolOutput??`${r.toolName} failed`,i.toolOutput??`${i.toolName} succeeded`],evidenceOutcome:`success`,observationIds:[r.id,i.id]})}return t}function K(e,t){let n=t?.minRepeatedSequenceCount??Q,r=e.filter(e=>e.event===`tool_start`||e.event===`tool_complete`),i=r.map(e=>e.toolName??``),a=[`Grep`,`Read`,`Edit`],o=[],s=0;for(let e=0;e<=i.length-a.length;e++)a.every((t,n)=>i[e+n]===t)&&(s++,o.push(...r.slice(e,e+a.length).map(e=>e.id)));if(s<n)return[];let l=`Observed ${s} repeated Grep -> Read -> Edit workflow sequences.`,u=r.find(e=>o.includes(e.id)),d=o[o.length-1],f=r.find(e=>e.id===d),p=f?.event===`tool_complete`?f.outcome:void 0;return[{...c(u??e[0]),trigger:`When changing code in this project`,action:`Prefer the Grep -> Read -> Edit workflow: locate symbols, inspect context, then apply the smallest edit.`,confidence:s>=3?.65:.5,domain:`workflow`,source:`session-observation`,scope:`project`,evidence:[l],evidenceOutcome:Y(p),observationIds:Array.from(new Set(o))}]}function q(e){return e.flatMap((t,n)=>{if(t.event!==`user_message`||!t.messageText)return[];let r=t.messageText.trim();return/(项目约定|规范|必须|convention|always|must)/i.test(r)?[{...c(t),trigger:`When working in this project`,action:`Follow the project convention: ${r}`,confidence:.4,domain:`project`,source:`session-observation`,scope:`project`,evidence:[r],evidenceOutcome:J(e,n),observationIds:[t.id]}]:[]})}function J(e,t){for(let n=t-1;n>=0;n--){let t=e[n];if(t.event===`tool_complete`)return Y(t.outcome)}}function Y(e){if(e===`success`||e===`failure`||e===`unknown`)return e}function X(e){let t=/(?:不要|别|不应(?:该)?|不要再)\s*(?<avoid>[^,,。.;;]+)[,,\s]*(?:用|使用|改用|应该用|要用)\s*(?<prefer>[^,,。.;;]+)/i,n=/(?:do not|don't|avoid)\s+(?<avoid>[^,.;]+)[,;\s]+(?:use|prefer)\s+(?<prefer>[^,.;]+)/i,r=/(?:你应该|应该先|must|should)\s*(?<prefer>[^,,。.;;]+)/i,i=e.match(t)??e.match(n);if(i?.groups){let e=i.groups.avoid.trim(),t=i.groups.prefer.trim();return{trigger:`When choosing between ${e} and ${t}`,action:`Prefer ${t}; avoid ${e}.`}}let a=e.match(r);return a?.groups?{trigger:`When this user gives a corrective instruction`,action:`Prefer this corrected action: ${a.groups.prefer.trim()}.`}:null}function Z(e){let t=e.toLowerCase();return/test|mock|testing-library|vitest|jest|bun test/.test(t)?`testing`:/git|commit|branch/.test(t)?`git`:/security|secret|token|password/.test(t)?`security`:/style|format|lint|naming/.test(t)?`code-style`:`project`}var Q,$,te=e((()=>{a(),v(),B(),Q=2,$={name:`heuristic`,analyze(e,t){return V(e)}},u($),u(z)}));export{B as a,b as c,v as d,u as f,te as i,p as l,d as m,V as n,z as o,h as p,$ as r,y as s,H as t,f as u};
@@ -0,0 +1 @@
1
+ import{Rr as e,jr as t,si as n}from"./loadAgentsDir-nzr38hai.js";t();export{e as linkSessionToPR,n as recordTranscript};
@@ -0,0 +1,3 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,o as n}from"./envUtils-DSxRz_kt.js";import{i as r,t as i}from"./hash-Tu-My5Vp.js";import{join as a}from"path";import{open as o,readdir as s,realpath as c,stat as l}from"fs/promises";import{promisify as u}from"util";import{execFile as d}from"child_process";async function f(e){try{let{stdout:t}=await p(`git`,[`worktree`,`list`,`--porcelain`],{cwd:e,timeout:5e3});return t?t.split(`
2
+ `).filter(e=>e.startsWith(`worktree `)).map(e=>e.slice(9).normalize(`NFC`)):[]}catch{return[]}}var p,m=e((()=>{p=u(d)}));function h(e){return typeof e==`string`&&B.test(e)?e:null}function g(e){if(!e.includes(`\\`))return e;try{return JSON.parse(`"${e}"`)}catch{return e}}function _(e,t){let n=[`"${t}":"`,`"${t}": "`];for(let t of n){let n=e.indexOf(t);if(n<0)continue;let r=n+t.length,i=r;for(;i<e.length;){if(e[i]===`\\`){i+=2;continue}if(e[i]===`"`)return g(e.slice(r,i));i++}}}function v(e,t){let n=[`"${t}":"`,`"${t}": "`],r;for(let t of n){let n=0;for(;;){let i=e.indexOf(t,n);if(i<0)break;let a=i+t.length,o=a;for(;o<e.length;){if(e[o]===`\\`){o+=2;continue}if(e[o]===`"`){r=g(e.slice(a,o));break}o++}n=o+1}}return r}function y(e){let t=0,n=``;for(;t<e.length;){let r=e.indexOf(`
3
+ `,t),i=r>=0?e.slice(t,r):e.slice(t);if(t=r>=0?r+1:e.length,!(!i.includes(`"type":"user"`)&&!i.includes(`"type": "user"`))&&!i.includes(`"tool_result"`)&&!(i.includes(`"isMeta":true`)||i.includes(`"isMeta": true`))&&!(i.includes(`"isCompactSummary":true`)||i.includes(`"isCompactSummary": true`)))try{let e=JSON.parse(i);if(e.type!==`user`)continue;let t=e.message;if(!t)continue;let r=t.content,a=[];if(typeof r==`string`)a.push(r);else if(Array.isArray(r))for(let e of r)e.type===`text`&&typeof e.text==`string`&&a.push(e.text);for(let e of a){let t=e.replace(/\n/g,` `).trim();if(!t)continue;let r=H.exec(t);if(r){n||(n=r[1]);continue}let i=/<bash-input>([\s\S]*?)<\/bash-input>/.exec(t);if(i)return`! ${i[1].trim()}`;if(!V.test(t))return t.length>200&&(t=t.slice(0,200).trim()+`…`),t}}catch{}}return n||``}async function b(e,t,n){try{let r=await o(e,`r`);try{let e=await r.read(n,0,z,0);if(e.bytesRead===0)return{head:``,tail:``};let i=n.toString(`utf8`,0,e.bytesRead),a=Math.max(0,t-z),o=i;if(a>0){let e=await r.read(n,0,z,a);o=n.toString(`utf8`,0,e.bytesRead)}return{head:i,tail:o}}finally{await r.close()}}catch{return{head:``,tail:``}}}async function x(e){try{let t=await o(e,`r`);try{let e=await t.stat(),n=Buffer.allocUnsafe(z),r=await t.read(n,0,z,0);if(r.bytesRead===0)return null;let i=n.toString(`utf8`,0,r.bytesRead),a=Math.max(0,e.size-z),o=i;if(a>0){let e=await t.read(n,0,z,a);o=n.toString(`utf8`,0,e.bytesRead)}return{mtime:e.mtime.getTime(),size:e.size,head:i,tail:o}}finally{await t.close()}}catch{return null}}function S(e){return Math.abs(i(e)).toString(36)}function C(e){let t=e.replace(/[^a-zA-Z0-9]/g,`-`);if(t.length<=200)return t;let n=typeof Bun<`u`?Bun.hash(e).toString(36):S(e);return`${t.slice(0,200)}-${n}`}function w(){return a(t(),`projects`)}function T(e){return a(w(),C(e))}async function E(e){try{return(await c(e)).normalize(`NFC`)}catch{return e.normalize(`NFC`)}}async function D(e){let t=T(e);try{return await s(t),t}catch{let t=C(e);if(t.length<=200)return;let n=t.slice(0,200),r=w();try{let e=(await s(r,{withFileTypes:!0})).find(e=>e.isDirectory()&&e.name.startsWith(n+`-`));return e?a(r,e.name):void 0}catch{return}}}async function O(e,t){let n=`${e}.jsonl`;if(t){let e=await E(t),r=await D(e);if(r){let t=a(r,n);try{let n=await l(t);if(n.size>0)return{filePath:t,projectPath:e,fileSize:n.size}}catch{}}let i;try{i=await f(e)}catch{i=[]}for(let t of i){if(t===e)continue;let r=await D(t);if(!r)continue;let i=a(r,n);try{let e=await l(i);if(e.size>0)return{filePath:i,projectPath:t,fileSize:e.size}}catch{}}return}let r=w(),i;try{i=await s(r)}catch{return}for(let e of i){let t=a(r,e,n);try{let e=await l(t);if(e.size>0)return{filePath:t,projectPath:void 0,fileSize:e.size}}catch{}}}function k(){return G??(G=Buffer.from(`"compact_boundary"`))}function A(e){try{let t=JSON.parse(e);return t.type!==`system`||t.subtype!==`compact_boundary`?null:{hasPreservedSegment:!!t.compactMetadata?.preservedSegment}}catch{return null}}function j(e,t,n,r){let i=r-n;if(!(i<=0)){if(e.len+i>e.buf.length){let t=Buffer.allocUnsafe(Math.min(Math.max(e.buf.length*2,e.len+i),e.cap));e.buf.copy(t,0,0,e.len),e.buf=t}t.copy(e.buf,e.len,n,r),e.len+=i}}function M(e,t,n,r){return r-n>=t.length&&e.compare(t,0,t.length,n,n+t.length)===0}function N(e,t,n){if(e.straddleSnapCarryLen=0,e.straddleSnapTailEnd=0,e.carryLen===0)return 0;let r=e.carryBuf,i=t.indexOf(J);if(i===-1||i>=n)return 0;let a=i+1;if(M(r,K,0,e.carryLen))e.straddleSnapCarryLen=e.carryLen,e.straddleSnapTailEnd=a,e.lastSnapSrc=null;else if(e.carryLen<K.length)return 0;else{if(M(r,q,0,e.carryLen)){let n=A(r.toString(`utf-8`,0,e.carryLen)+t.toString(`utf-8`,0,i));n?.hasPreservedSegment?e.hasPreservedSegment=!0:n&&(e.out.len=0,e.boundaryStartOffset=e.bufFileOff,e.hasPreservedSegment=!1,e.lastSnapSrc=null)}j(e.out,r,0,e.carryLen),j(e.out,t,0,a)}return e.bufFileOff+=e.carryLen+a,e.carryLen=0,a}function P(e,t,n){let r=t.indexOf(n),i=0,a=0,o=-1,s=-1,c=t.indexOf(J);for(;c!==-1;){let l=c+1;if(r!==-1&&r<a&&(r=t.indexOf(n,a)),M(t,K,a,l))j(e.out,t,i,a),o=a,s=l,i=l;else if(r>=a&&r<Math.min(a+X,l)){let s=A(t.toString(`utf-8`,a,c));s?.hasPreservedSegment?e.hasPreservedSegment=!0:s&&(e.out.len=0,e.boundaryStartOffset=e.bufFileOff+a,e.hasPreservedSegment=!1,e.lastSnapSrc=null,o=-1,e.straddleSnapCarryLen=0,i=a),r=t.indexOf(n,r+n.length)}a=l,c=t.indexOf(J,a)}return j(e.out,t,i,a),{lastSnapStart:o,lastSnapEnd:s,trailStart:a}}function F(e,t,n,r,i){r===-1?e.straddleSnapCarryLen>0&&(e.lastSnapLen=e.straddleSnapCarryLen+e.straddleSnapTailEnd,(e.lastSnapBuf===void 0||e.lastSnapLen>e.lastSnapBuf.length)&&(e.lastSnapBuf=Buffer.allocUnsafe(e.lastSnapLen)),e.carryBuf.copy(e.lastSnapBuf,0,0,e.straddleSnapCarryLen),n.copy(e.lastSnapBuf,e.straddleSnapCarryLen,0,e.straddleSnapTailEnd),e.lastSnapSrc=e.lastSnapBuf):(e.lastSnapLen=i-r,(e.lastSnapBuf===void 0||e.lastSnapLen>e.lastSnapBuf.length)&&(e.lastSnapBuf=Buffer.allocUnsafe(e.lastSnapLen)),t.copy(e.lastSnapBuf,0,r,i),e.lastSnapSrc=e.lastSnapBuf)}function I(e,t,n){e.carryLen=t.length-n,e.carryLen>0&&((e.carryBuf===void 0||e.carryLen>e.carryBuf.length)&&(e.carryBuf=Buffer.allocUnsafe(e.carryLen)),t.copy(e.carryBuf,0,n,t.length))}function L(e){if(e.carryLen>0){let t=e.carryBuf;M(t,K,0,e.carryLen)?(e.lastSnapSrc=t,e.lastSnapLen=e.carryLen):j(e.out,t,0,e.carryLen)}e.lastSnapSrc&&(e.out.len>0&&e.out.buf[e.out.len-1]!==J&&j(e.out,Y,0,1),j(e.out,e.lastSnapSrc,0,e.lastSnapLen))}async function R(e,t){let n=k(),r=U,i={out:{buf:Buffer.allocUnsafe(Math.min(t,8*1024*1024)),len:0,cap:t+1},boundaryStartOffset:0,hasPreservedSegment:!1,lastSnapSrc:null,lastSnapLen:0,lastSnapBuf:void 0,bufFileOff:0,carryLen:0,carryBuf:void 0,straddleSnapCarryLen:0,straddleSnapTailEnd:0},a=Buffer.allocUnsafe(r),s=await o(e,`r`);try{let e=0;for(;e<t;){let{bytesRead:o}=await s.read(a,0,Math.min(r,t-e),e);if(o===0)break;e+=o;let c=N(i,a,o),l;if(i.carryLen>0){let e=i.carryLen+(o-c);l=Buffer.allocUnsafe(e),i.carryBuf.copy(l,0,0,i.carryLen),a.copy(l,i.carryLen,c,o)}else l=a.subarray(c,o);let u=P(i,l,n);F(i,l,a,u.lastSnapStart,u.lastSnapEnd),I(i,l,u.trailStart),i.bufFileOff+=u.trailStart}L(i)}finally{await s.close()}return{boundaryStartOffset:i.boundaryStartOffset,postBoundaryBuf:i.out.buf.subarray(0,i.out.len),hasPreservedSegment:i.hasPreservedSegment}}var z,B,V,H,U,W,G,K,q,J,Y,X,Z=e((()=>{n(),m(),r(),z=65536,B=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,V=/^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/,H=/<command-name>(.*?)<\/command-name>/,U=1024*1024,W=5*1024*1024,K=Buffer.from(`{"type":"attribution-snapshot"`),q=Buffer.from(`{"type":"system"`),J=10,Y=Buffer.from([J]),X=256}));export{m as _,_ as a,w as c,x as d,R as f,f as g,h,y as i,Z as l,C as m,W as n,v as o,O as p,E as r,D as s,z as t,b as u};
@@ -0,0 +1,14 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{A as t,t as n,w as r}from"./v4-jw6qOKwQ.js";import{en as i,z as a}from"./state-4KQ3kaqz.js";import{To as o,dT as s,et as c,tt as l,zo as u}from"./loadAgentsDir-nzr38hai.js";import{l as d,p as f}from"./debug-IKW-jE7K.js";import{s as p,u as m}from"./types-a7X-tJpJ.js";import{n as h,r as g}from"./analytics-BotDBGh0.js";import{n as _,t as v}from"./lazySchema-uxlVVNM1.js";import{st as y}from"./rcDebugLog-BUuD-X1D.js";function b(e){let t=[];for(let n of e){if(n.type!==`user`&&n.type!==`assistant`||`isMeta`in n&&n.isMeta||`origin`in n&&n.origin&&n.origin.kind!==`human`)continue;let e=n.message.content;if(typeof e==`string`)t.push(e);else if(Array.isArray(e))for(let n of e)`type`in n&&n.type===`text`&&`text`in n&&t.push(n.text)}let n=t.join(`
2
+ `);return n.length>S?n.slice(-1e3):n}async function x(e,t){let n=e.trim();if(!n)return null;try{let e=o((await l({systemPrompt:y([C]),userPrompt:n,outputFormat:{type:`json_schema`,schema:{type:`object`,properties:{title:{type:`string`}},required:[`title`],additionalProperties:!1}},signal:t,options:{querySource:`generate_session_title`,agents:[],isNonInteractiveSession:a(),hasAppendSystemPrompt:!1,mcpTools:[]}})).message.content),r=w().safeParse(m(e)),i=r.success&&r.data.title.trim()||null;return g(`tengu_session_title_generated`,{success:i!==null}),i}catch(e){return f(`generateSessionTitle failed: ${e}`,{level:`error`}),g(`tengu_session_title_generated`,{success:!1}),null}}var S,C,w,T=e((()=>{n(),i(),h(),c(),d(),p(),v(),u(),s(),S=1e3,C=`Generate a concise, sentence-case title (3-7 words) that captures the main topic or goal of this coding session. The title should be clear enough that the user recognizes the session in a list. Use sentence case: capitalize only the first word and proper nouns.
3
+
4
+ Return JSON with a single "title" field.
5
+
6
+ Good examples:
7
+ {"title": "Fix login button on mobile"}
8
+ {"title": "Add OAuth authentication"}
9
+ {"title": "Debug failing CI tests"}
10
+ {"title": "Refactor API client error handling"}
11
+
12
+ Bad (too vague): {"title": "Code changes"}
13
+ Bad (too long): {"title": "Investigate and fix the issue where the login button does not respond on mobile devices"}
14
+ Bad (wrong case): {"title": "Fix Login Button On Mobile"}`,w=_(()=>r({title:t()}))}));export{x as n,T as r,b as t};
@@ -0,0 +1,11 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{l as t,o as n}from"./envUtils-DSxRz_kt.js";import{i as r,l as i,n as a}from"./esm-lWlUmoUA.js";import{A as o,en as s,ht as c,lt as l,z as u}from"./state-4KQ3kaqz.js";import{D as d,E as f,O as p,U as m,l as h,p as g}from"./debug-IKW-jE7K.js";import{f as _,g as ee}from"./config-C7YHKCPV.js";import{i as te,t as ne}from"./hash-Tu-My5Vp.js";import{Mt as re,Vt as ie}from"./model-DfFA3qMO.js";import{_ as v,s as ae,u as oe,y as se}from"./metadata-BRLJvh61.js";import"path";import"fs";import{createHash as ce}from"crypto";import"fs/promises";import{AsyncLocalStorage as le}from"async_hooks";function ue(e){let t=BigInt(58),n=Array(b).fill(y[0]),r=b-1,i=e;for(;i>0n;){let e=Number(i%t);n[r]=y[e],i/=t,r--}return n.join(``)}function de(e){let t=e.replace(/-/g,``);if(t.length!==32)throw Error(`Invalid UUID hex length: ${t.length}`);return BigInt(`0x`+t)}function fe(e,t){let n=de(t);return`${e}_${pe}${ue(n)}`}var y,pe,b,me=e((()=>{y=`123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz`,pe=`01`,b=22}));function x(e){let n=he[e],r=process.env[e];return r===void 0?n:t(r)}function S(){let e=_(),t=c(),n={"user.id":e};x(`OTEL_METRICS_INCLUDE_SESSION_ID`)&&(n[`session.id`]=t),x(`OTEL_METRICS_INCLUDE_VERSION`)&&(n[`app.version`]=`0.0.1`);let r=re();if(r){let e=r.organizationUuid,t=r.emailAddress,i=r.accountUuid;e&&(n[`organization.id`]=e),t&&(n[`user.email`]=t),i&&x(`OTEL_METRICS_INCLUDE_ACCOUNT_UUID`)&&(n[`user.account_uuid`]=i,n[`user.account_id`]=process.env.CLAUDE_CODE_ACCOUNT_TAGGED_ID||fe(`user`,i))}return v.terminal&&(n[`terminal.type`]=v.terminal),n}var he,C=e((()=>{s(),ie(),ee(),se(),n(),me(),he={OTEL_METRICS_INCLUDE_SESSION_ID:!0,OTEL_METRICS_INCLUDE_VERSION:!1,OTEL_METRICS_INCLUDE_ACCOUNT_UUID:!0}}));function ge(){return t(process.env.OTEL_LOG_USER_PROMPTS)}function _e(e){return ge()?e:`<REDACTED>`}async function w(e,t={}){let n=o();if(!n){T||(T=!0,g(`[3P telemetry] Event dropped (no event logger initialized): ${e}`,{level:`warn`}));return}let r={...S(),"event.name":e,"event.timestamp":new Date().toISOString(),"event.sequence":ve++},i=l();i&&(r[`prompt.id`]=i);let a=process.env.CLAUDE_CODE_WORKSPACE_HOST_PATHS;a&&(r[`workspace.host_paths`]=a.split(`|`));for(let[e,n]of Object.entries(t))n!==void 0&&(r[e]=n);n.emit({body:`claude_code.${e}`,attributes:r})}var ve,T,ye=e((()=>{s(),h(),n(),C(),ve=0,T=!1}));function be(e){return Math.abs(ne(e))||1}function xe(e){let t=L.get(e);return t===void 0?(I++,L.set(e,I),I):t}function E(){let e=c(),t=`main`,n=P.get(e);if(n)return n;let r={agentId:e,agentName:t,parentAgentId:void 0,processId:1,threadId:be(t)};return P.set(e,r),F++,r}function D(){return(Date.now()-Pe)*1e3}function O(){return`span_${++Fe}`}function Se(){let e=process.env.CLAUDE_CODE_PERFETTO_TRACE;g(`[Perfetto] initializePerfettoTracing called, env value: ${e}`)}function Ce(e){A&&(j.push({name:`process_name`,cat:`__metadata`,ph:`M`,ts:0,pid:e.processId,tid:0,args:{name:e.agentName}}),j.push({name:`thread_name`,cat:`__metadata`,ph:`M`,ts:0,pid:e.processId,tid:e.threadId,args:{name:e.agentName}}),e.parentAgentId&&j.push({name:`parent_agent`,cat:`__metadata`,ph:`M`,ts:0,pid:e.processId,tid:0,args:{parent_agent_id:e.parentAgentId}}))}function k(){return A}function we(e,t,n){if(!A)return;let r={agentId:e,agentName:t,parentAgentId:n,processId:xe(e),threadId:be(t)};P.set(e,r),F++,Ce(r)}function Te(e){A&&(P.delete(e),L.delete(e))}function Ee(e){if(!A)return``;let t=O(),n=E();return N.set(t,{name:`API Call`,category:`api`,startTime:D(),agentInfo:n,args:{model:e.model,prompt_tokens:e.promptTokens,message_id:e.messageId,is_speculative:e.isSpeculative??!1,query_source:e.querySource}}),M.push({name:`API Call`,cat:`api`,ph:`B`,ts:N.get(t).startTime,pid:n.processId,tid:n.threadId,args:N.get(t).args}),t}function De(e,t){if(!A||!e)return;let n=N.get(e);if(!n)return;let r=D(),i=r-n.startTime,a=t.promptTokens??n.args.prompt_tokens,o=t.ttftMs,s=t.ttltMs,c=t.outputTokens,l=t.cacheReadTokens,u=o!==void 0&&a!==void 0&&o>0?Math.round(a/(o/1e3)*100)/100:void 0,d=s!==void 0&&o!==void 0?s-o:void 0,f=d!==void 0&&c!==void 0&&d>0?Math.round(c/(d/1e3)*100)/100:void 0,p=l!==void 0&&a!==void 0&&a>0?Math.round(l/a*1e4)/100:void 0,m=t.requestSetupMs,h=t.attemptStartTimes,g={...n.args,ttft_ms:o,ttlt_ms:s,prompt_tokens:a,output_tokens:c,cache_read_tokens:l,cache_creation_tokens:t.cacheCreationTokens,message_id:t.messageId??n.args.message_id,success:t.success??!0,error:t.error,duration_ms:i/1e3,request_setup_ms:m,itps:u,otps:f,cache_hit_rate_pct:p},_=m!==void 0&&m>0?m*1e3:0;if(_>0){let e=n.startTime+_;if(M.push({name:`Request Setup`,cat:`api,setup`,ph:`B`,ts:n.startTime,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:{request_setup_ms:m,attempt_count:h?.length??1}}),h&&h.length>1){let e=h[0];for(let t=0;t<h.length-1;t++){let r=n.startTime+(h[t]-e)*1e3,i=n.startTime+(h[t+1]-e)*1e3;M.push({name:`Attempt ${t+1} (retry)`,cat:`api,retry`,ph:`B`,ts:r,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:{attempt:t+1}}),M.push({name:`Attempt ${t+1} (retry)`,cat:`api,retry`,ph:`E`,ts:i,pid:n.agentInfo.processId,tid:n.agentInfo.threadId})}}M.push({name:`Request Setup`,cat:`api,setup`,ph:`E`,ts:e,pid:n.agentInfo.processId,tid:n.agentInfo.threadId})}if(o!==void 0){let e=n.startTime+_,t=e+o*1e3;M.push({name:`First Token`,cat:`api,ttft`,ph:`B`,ts:e,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:{ttft_ms:o,prompt_tokens:a,itps:u,cache_hit_rate_pct:p}}),M.push({name:`First Token`,cat:`api,ttft`,ph:`E`,ts:t,pid:n.agentInfo.processId,tid:n.agentInfo.threadId});let r=s===void 0?void 0:s-o-_/1e3;r!==void 0&&r>0&&(M.push({name:`Sampling`,cat:`api,sampling`,ph:`B`,ts:t,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:{sampling_ms:r,output_tokens:c,otps:f}}),M.push({name:`Sampling`,cat:`api,sampling`,ph:`E`,ts:t+r*1e3,pid:n.agentInfo.processId,tid:n.agentInfo.threadId}))}M.push({name:n.name,cat:n.category,ph:`E`,ts:r,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:g}),N.delete(e)}function Oe(e,t){if(!A)return``;let n=O(),r=E();return N.set(n,{name:`Tool: ${e}`,category:`tool`,startTime:D(),agentInfo:r,args:{tool_name:e,...t}}),M.push({name:`Tool: ${e}`,cat:`tool`,ph:`B`,ts:N.get(n).startTime,pid:r.processId,tid:r.threadId,args:N.get(n).args}),n}function ke(e,t){if(!A||!e)return;let n=N.get(e);if(!n)return;let r=D(),i=r-n.startTime,a={...n.args,success:t?.success??!0,error:t?.error,result_tokens:t?.resultTokens,duration_ms:i/1e3};M.push({name:n.name,cat:n.category,ph:`E`,ts:r,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:a}),N.delete(e)}function Ae(e){if(!A)return``;let t=O(),n=E();return N.set(t,{name:`Waiting for User Input`,category:`user_input`,startTime:D(),agentInfo:n,args:{context:e}}),M.push({name:`Waiting for User Input`,cat:`user_input`,ph:`B`,ts:N.get(t).startTime,pid:n.processId,tid:n.threadId,args:N.get(t).args}),t}function je(e,t){if(!A||!e)return;let n=N.get(e);if(!n)return;let r=D(),i=r-n.startTime,a={...n.args,decision:t?.decision,source:t?.source,duration_ms:i/1e3};M.push({name:n.name,cat:n.category,ph:`E`,ts:r,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:a}),N.delete(e)}function Me(e){if(!A)return``;let t=O(),n=E();return N.set(t,{name:`Interaction`,category:`interaction`,startTime:D(),agentInfo:n,args:{user_prompt_length:e?.length}}),M.push({name:`Interaction`,cat:`interaction`,ph:`B`,ts:N.get(t).startTime,pid:n.processId,tid:n.threadId,args:N.get(t).args}),t}function Ne(e){if(!A||!e)return;let t=N.get(e);if(!t)return;let n=D(),r=n-t.startTime;M.push({name:t.name,cat:t.category,ph:`E`,ts:n,pid:t.agentInfo.processId,tid:t.agentInfo.threadId,args:{...t.args,duration_ms:r/1e3}}),N.delete(e)}var A,j,M,N,P,F,Pe,Fe,I,L,Ie=e((()=>{s(),h(),n(),m(),te(),f(),A=!1,j=[],M=[],N=new Map,P=new Map,F=0,Pe=0,Fe=0,I=1,L=new Map}));function Le(){H.clear(),U.clear()}function R(){return t(process.env.ENABLE_BETA_TRACING_DETAILED)&&process.env.BETA_TRACING_ENDPOINT&&(process.env.USER_TYPE===`ant`||u())||!1}function z(e,t=Ke){return e.length<=t?{content:e,truncated:!1}:{content:e.slice(0,t)+`
2
+
3
+ [TRUNCATED - Content exceeds 60KB limit]`,truncated:!0}}function B(e){return ce(`sha256`).update(e).digest(`hex`).slice(0,12)}function Re(e){return`sp_${B(e)}`}function ze(e){return`msg_${B(p(e.message.content))}`}function V(e){let t=e.trim().match(qe);return t&&t[1]?t[1].trim():null}function Be(e){let t=[],n=[];for(let r of e){let e=r.message.content;if(typeof e==`string`){let r=V(e);r?n.push(r):t.push(`[USER]\n${e}`)}else if(Array.isArray(e)){for(let r of e)if(r.type===`text`){let e=V(r.text);e?n.push(e):t.push(`[USER]\n${r.text}`)}else if(r.type===`tool_result`){let e=typeof r.content==`string`?r.content:p(r.content),i=V(e);i?n.push(i):t.push(`[TOOL RESULT: ${r.tool_use_id}]\n${e}`)}}}return{contextParts:t,systemReminders:n}}function Ve(e,t){if(!R())return;let{content:n,truncated:r}=z(`[USER PROMPT]\n${t}`);e.setAttributes({new_context:n,...r&&{new_context_truncated:!0,new_context_original_length:t.length}})}function He(e,t,n){if(R()){if(t?.systemPrompt){let n=Re(t.systemPrompt),r=t.systemPrompt.slice(0,500);if(e.setAttribute(`system_prompt_hash`,n),e.setAttribute(`system_prompt_preview`,r),e.setAttribute(`system_prompt_length`,t.systemPrompt.length),!H.has(n)){H.add(n);let{content:e,truncated:r}=z(t.systemPrompt);w(`system_prompt`,{system_prompt_hash:n,system_prompt:e,system_prompt_length:String(t.systemPrompt.length),...r&&{system_prompt_truncated:`true`}})}}if(t?.tools)try{let n=d(t.tools).map(e=>{let t=p(e),n=B(t);return{name:typeof e.name==`string`?e.name:`unknown`,hash:n,json:t}});e.setAttribute(`tools`,p(n.map(({name:e,hash:t})=>({name:e,hash:t})))),e.setAttribute(`tools_count`,n.length);for(let{name:e,hash:t,json:r}of n)if(!H.has(`tool_${t}`)){H.add(`tool_${t}`);let{content:n,truncated:i}=z(r);w(`tool`,{tool_name:oe(e),tool_hash:t,tool:n,...i&&{tool_truncated:`true`}})}}catch{e.setAttribute(`tools_parse_error`,!0)}if(n&&n.length>0&&t?.querySource){let r=t.querySource,i=U.get(r),a=0;if(i)for(let e=0;e<n.length;e++){let t=n[e];if(t&&ze(t)===i){a=e+1;break}}let o=n.slice(a).filter(e=>e.type===`user`);if(o.length>0){let{contextParts:t,systemReminders:i}=Be(o);if(t.length>0){let n=t.join(`
4
+
5
+ ---
6
+
7
+ `),{content:r,truncated:i}=z(n);e.setAttributes({new_context:r,new_context_message_count:o.length,...i&&{new_context_truncated:!0,new_context_original_length:n.length}})}if(i.length>0){let t=i.join(`
8
+
9
+ ---
10
+
11
+ `),{content:n,truncated:r}=z(t);e.setAttributes({system_reminders:n,system_reminders_count:i.length,...r&&{system_reminders_truncated:!0,system_reminders_original_length:t.length}})}let a=n[n.length-1];a&&U.set(r,ze(a))}}}}function Ue(e,t){if(!(!R()||!t)){if(t.modelOutput!==void 0){let{content:n,truncated:r}=z(t.modelOutput);e[`response.model_output`]=n,r&&(e[`response.model_output_truncated`]=!0,e[`response.model_output_original_length`]=t.modelOutput.length)}if(process.env.USER_TYPE===`ant`&&t.thinkingOutput!==void 0){let{content:n,truncated:r}=z(t.thinkingOutput);e[`response.thinking_output`]=n,r&&(e[`response.thinking_output_truncated`]=!0,e[`response.thinking_output_original_length`]=t.thinkingOutput.length)}}}function We(e,t,n){if(!R())return;let{content:r,truncated:i}=z(`[TOOL INPUT: ${t}]\n${n}`);e.setAttributes({tool_input:r,...i&&{tool_input_truncated:!0,tool_input_original_length:n.length}})}function Ge(e,t,n){if(!R())return;let{content:r,truncated:i}=z(`[TOOL RESULT: ${t}]\n${n}`);e.new_context=r,i&&(e.new_context_truncated=!0,e.new_context_original_length=n.length)}var H,U,Ke,qe,Je=e((()=>{s(),ae(),n(),f(),ye(),H=new Set,U=new Map,Ke=60*1024,qe=/^<system-reminder>\n?([\s\S]*?)\n?<\/system-reminder>$/}));function W(e){return e.spanContext().spanId||``}function Ye(){if($)return;$=!0;let e=setInterval(()=>{let e=Date.now()-dt;for(let[t,n]of X){let r=n.deref();r===void 0?(X.delete(t),Z.delete(t)):r.startTime<e&&(r.ended||r.span.end(),X.delete(t),Z.delete(t))}},6e4);typeof e.unref==`function`&&e.unref()}function Xe(){return!1}function G(){return Xe()||R()}function K(){return r.getTracer(`com.anthropic.claude_code.tracing`,`1.0.0`)}function q(e,t={}){return{...S(),"span.type":e,...t}}function Ze(e){Ye();let n=k()?Me(e):void 0;if(!G()){if(n){let e=r.getActiveSpan()||K().startSpan(`dummy`),t=W(e),i={span:e,startTime:Date.now(),attributes:{},perfettoSpanId:n};return X.set(t,new WeakRef(i)),J.enterWith(i),e}return r.getActiveSpan()||K().startSpan(`dummy`)}let i=K(),a=t(process.env.OTEL_LOG_USER_PROMPTS)?e:`<REDACTED>`;Q++;let o=q(`interaction`,{user_prompt:a,user_prompt_length:e.length,"interaction.sequence":Q}),s=i.startSpan(`claude_code.interaction`,{attributes:o});Ve(s,e);let c=W(s),l={span:s,startTime:Date.now(),attributes:o,perfettoSpanId:n};return X.set(c,new WeakRef(l)),J.enterWith(l),s}function Qe(){let e=J.getStore();if(!e||e.ended)return;if(e.perfettoSpanId&&Ne(e.perfettoSpanId),!G()){e.ended=!0,X.delete(W(e.span)),J.enterWith(void 0);return}let t=Date.now()-e.startTime;e.span.setAttributes({"interaction.duration_ms":t}),e.span.end(),e.ended=!0,X.delete(W(e.span)),J.enterWith(void 0)}function $e(e,t,n,a){let o=k()?Ee({model:e,querySource:t?.querySource,messageId:void 0}):void 0;if(!G()){if(o){let t=r.getActiveSpan()||K().startSpan(`dummy`),n=W(t),i={span:t,startTime:Date.now(),attributes:{model:e},perfettoSpanId:o};return X.set(n,new WeakRef(i)),Z.set(n,i),t}return r.getActiveSpan()||K().startSpan(`dummy`)}let s=K(),c=J.getStore(),l=q(`llm_request`,{model:e,"llm_request.context":c?`interaction`:`standalone`,speed:a?`fast`:`normal`}),u=c?r.setSpan(i.active(),c.span):i.active(),d=s.startSpan(`claude_code.llm_request`,{attributes:l},u);t?.querySource&&d.setAttribute(`query_source`,t.querySource),He(d,t,n);let f=W(d),p={span:d,startTime:Date.now(),attributes:l,perfettoSpanId:o};return X.set(f,new WeakRef(p)),Z.set(f,p),d}function et(e,t){let n;if(e){let t=W(e);n=X.get(t)?.deref()}else n=Array.from(X.values()).findLast(e=>{let t=e.deref();return t?.attributes[`span.type`]===`llm_request`||t?.attributes.model})?.deref();if(!n)return;let r=Date.now()-n.startTime;if(n.perfettoSpanId&&De(n.perfettoSpanId,{ttftMs:t?.ttftMs,ttltMs:r,promptTokens:t?.inputTokens,outputTokens:t?.outputTokens,cacheReadTokens:t?.cacheReadTokens,cacheCreationTokens:t?.cacheCreationTokens,success:t?.success,error:t?.error,requestSetupMs:t?.requestSetupMs,attemptStartTimes:t?.attemptStartTimes}),!G()){let e=W(n.span);X.delete(e),Z.delete(e);return}let i={duration_ms:r};t&&(t.inputTokens!==void 0&&(i.input_tokens=t.inputTokens),t.outputTokens!==void 0&&(i.output_tokens=t.outputTokens),t.cacheReadTokens!==void 0&&(i.cache_read_tokens=t.cacheReadTokens),t.cacheCreationTokens!==void 0&&(i.cache_creation_tokens=t.cacheCreationTokens),t.success!==void 0&&(i.success=t.success),t.statusCode!==void 0&&(i.status_code=t.statusCode),t.error!==void 0&&(i.error=t.error),t.attempt!==void 0&&(i.attempt=t.attempt),t.hasToolCall!==void 0&&(i[`response.has_tool_call`]=t.hasToolCall),t.ttftMs!==void 0&&(i.ttft_ms=t.ttftMs),Ue(i,t)),n.span.setAttributes(i),n.span.end();let a=W(n.span);X.delete(a),Z.delete(a)}function tt(e,t,n){let a=k()?Oe(e,t):void 0;if(!G()){if(a){let t=r.getActiveSpan()||K().startSpan(`dummy`),n=W(t),i={span:t,startTime:Date.now(),attributes:{"span.type":`tool`,tool_name:e},perfettoSpanId:a};return X.set(n,new WeakRef(i)),Y.enterWith(i),t}return r.getActiveSpan()||K().startSpan(`dummy`)}let o=K(),s=J.getStore(),c=q(`tool`,{tool_name:e,...t}),l=s?r.setSpan(i.active(),s.span):i.active(),u=o.startSpan(`claude_code.tool`,{attributes:c},l);n&&We(u,e,n);let d=W(u),f={span:u,startTime:Date.now(),attributes:c,perfettoSpanId:a};return X.set(d,new WeakRef(f)),Y.enterWith(f),u}function nt(){let e=k()?Ae(`tool_permission`):void 0;if(!G()){if(e){let t=r.getActiveSpan()||K().startSpan(`dummy`),n=W(t),i={span:t,startTime:Date.now(),attributes:{"span.type":`tool.blocked_on_user`},perfettoSpanId:e};return X.set(n,new WeakRef(i)),Z.set(n,i),t}return r.getActiveSpan()||K().startSpan(`dummy`)}let t=K(),n=Y.getStore(),a=q(`tool.blocked_on_user`),o=n?r.setSpan(i.active(),n.span):i.active(),s=t.startSpan(`claude_code.tool.blocked_on_user`,{attributes:a},o),c=W(s),l={span:s,startTime:Date.now(),attributes:a,perfettoSpanId:e};return X.set(c,new WeakRef(l)),Z.set(c,l),s}function rt(e,t){let n=Array.from(X.values()).findLast(e=>e.deref()?.attributes[`span.type`]===`tool.blocked_on_user`)?.deref();if(!n)return;if(n.perfettoSpanId&&je(n.perfettoSpanId,{decision:e,source:t}),!G()){let e=W(n.span);X.delete(e),Z.delete(e);return}let r={duration_ms:Date.now()-n.startTime};e&&(r.decision=e),t&&(r.source=t),n.span.setAttributes(r),n.span.end();let i=W(n.span);X.delete(i),Z.delete(i)}function it(){if(!G())return r.getActiveSpan()||K().startSpan(`dummy`);let e=K(),t=Y.getStore(),n=q(`tool.execution`),a=t?r.setSpan(i.active(),t.span):i.active(),o=e.startSpan(`claude_code.tool.execution`,{attributes:n},a),s=W(o),c={span:o,startTime:Date.now(),attributes:n};return X.set(s,new WeakRef(c)),Z.set(s,c),o}function at(e){if(!G())return;let t=Array.from(X.values()).findLast(e=>e.deref()?.attributes[`span.type`]===`tool.execution`)?.deref();if(!t)return;let n={duration_ms:Date.now()-t.startTime};e&&(e.success!==void 0&&(n.success=e.success),e.error!==void 0&&(n.error=e.error)),t.span.setAttributes(n),t.span.end();let r=W(t.span);X.delete(r),Z.delete(r)}function ot(e,t){let n=Y.getStore();if(!n)return;if(n.perfettoSpanId&&ke(n.perfettoSpanId,{success:!0,resultTokens:t}),!G()){let e=W(n.span);X.delete(e),Y.enterWith(void 0);return}let r={duration_ms:Date.now()-n.startTime};e&&Ge(r,n.attributes.tool_name||`unknown`,e),t!==void 0&&(r.result_tokens=t),n.span.setAttributes(r),n.span.end();let i=W(n.span);X.delete(i),Y.enterWith(void 0)}function st(){return t(process.env.OTEL_LOG_TOOL_CONTENT)}function ct(e,t){if(!G()||!st())return;let n=Y.getStore();if(!n)return;let r={};for(let[e,n]of Object.entries(t))if(typeof n==`string`){let{content:t,truncated:i}=z(n);r[e]=t,i&&(r[`${e}_truncated`]=!0,r[`${e}_original_length`]=n.length)}else r[e]=n;n.span.addEvent(e,r)}function lt(e,t,n,a){if(!R())return r.getActiveSpan()||K().startSpan(`dummy`);let o=K(),s=Y.getStore()??J.getStore(),c=q(`hook`,{hook_event:e,hook_name:t,num_hooks:n,hook_definitions:a}),l=s?r.setSpan(i.active(),s.span):i.active(),u=o.startSpan(`claude_code.hook`,{attributes:c},l),d=W(u),f={span:u,startTime:Date.now(),attributes:c};return X.set(d,new WeakRef(f)),Z.set(d,f),u}function ut(e,t){if(!R())return;let n=W(e),r=X.get(n)?.deref();if(!r)return;let i={duration_ms:Date.now()-r.startTime};t&&(t.numSuccess!==void 0&&(i.num_success=t.numSuccess),t.numBlocking!==void 0&&(i.num_blocking=t.numBlocking),t.numNonBlockingError!==void 0&&(i.num_non_blocking_error=t.numNonBlockingError),t.numCancelled!==void 0&&(i.num_cancelled=t.numCancelled)),r.span.setAttributes(i),r.span.end(),X.delete(n),Z.delete(n)}var J,Y,X,Z,Q,$,dt,ft=e((()=>{a(),n(),C(),Je(),Ie(),J=new le,Y=new le,X=new Map,Z=new Map,Q=0,$=!1,dt=1800*1e3}));export{Te as C,S as D,_e as E,C as O,we as S,w as T,Je as _,rt as a,Se as b,ft as c,Ze as d,$e as f,Le as g,tt as h,et as i,Xe as l,it as m,ut as n,at as o,nt as p,Qe as r,ot as s,ct as t,lt as u,R as v,ye as w,k as x,Ie as y};
@@ -0,0 +1,19 @@
1
+ import{a as e,n as t,r as n}from"./rolldown-runtime-DaDcL9Zw.js";import{c as r,i,n as a,r as o,s,t as c}from"./isObject-C6qM3WEW.js";import{d as l,f as ee,g as te,h as u,l as d,n as f,t as p,u as ne}from"./memoize-BK3gG5ob.js";import{l as m,n as re,o as ie}from"./envUtils-DSxRz_kt.js";import{i as ae,r as oe}from"./isSymbol-BO6cdPI7.js";import{A as h,B as se,C as g,D as ce,E as le,M as ue,O as _,b as v,d as de,g as fe,j as y,k as pe,l as b,m as x,n as me,o as he,p as S,s as ge,t as C,w,y as _e}from"./v4-jw6qOKwQ.js";import{Ar as ve,Ci as ye,Dr as be,Er as xe,Gi as Se,Ir as Ce,Kt as we,Lr as Te,M as Ee,Mi as De,N as Oe,Ni as ke,Nr as Ae,Or as je,Ri as Me,Si as Ne,Tr as Pe,Wi as Fe,ai as Ie,bi as Le,ci as Re,di as ze,en as Be,fi as Ve,ii as He,jr as Ue,kr as We,li as Ge,nt as Ke,oi as qe,pi as Je,si as Ye,ui as Xe,v as Ze,vi as Qe,wr as $e,xi as et,yi as tt,zi as nt}from"./state-4KQ3kaqz.js";import{n as rt,t as it}from"./cwd-BuJhkTrc.js";import{B as at,D as ot,E as st,G as ct,O as lt,T as ut,U as dt,_ as ft,h as T,l as pt,p as mt,x as ht}from"./debug-IKW-jE7K.js";import{M as gt,_ as _t,j as vt,t as yt}from"./git-tyaWOgRL.js";import{n as bt,r as xt}from"./execFileNoThrow-COKYqVQj.js";import{o as St,s as Ct}from"./log-B3eB4EFv.js";import{n as wt,t as Tt}from"./which-BBCjXfI2.js";import{i as Et,o as Dt}from"./platform-EtecGacO.js";import{C as Ot,D as E,E as kt,f as At}from"./file-D1cN3LMK.js";import{a as jt,f as Mt,p as Nt,r as Pt,s as Ft,u as D}from"./types-a7X-tJpJ.js";import{i as It,n as Lt}from"./startupProfiler-DxRQteII.js";import{n as O,t as k}from"./lazySchema-uxlVVNM1.js";import{c as Rt,u as zt}from"./oauth-BqJqV-2M.js";import{r as Bt,t as Vt}from"./bundledMode--fG1S62b.js";import{f as Ht,l as Ut,n as Wt,o as Gt,p as Kt}from"./stringUtils-CvXbHQRH.js";import{i as qt,r as Jt,t as Yt}from"./permissions-Cn_6f8CB.js";import{homedir as Xt,userInfo as Zt}from"os";import{dirname as Qt,join as A,resolve as $t}from"path";import{existsSync as en}from"fs";import{appendFile as tn,mkdir as nn,readFile as rn,writeFile as an}from"fs/promises";import{execFile as on}from"child_process";var sn,cn=t((()=>{ee(),sn=function(){try{var e=l(Object,`defineProperty`);return e({},``,{}),e}catch{}}()}));function ln(e,t,n){t==`__proto__`&&sn?sn(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var un=t((()=>{cn()}));function dn(e,t,n){var r=e[t];(!(fn.call(e,t)&&d(r,n))||n===void 0&&!(t in e))&&ln(e,t,n)}var fn,pn=t((()=>{un(),ne(),fn=Object.prototype.hasOwnProperty}));function mn(e,t,n,r){var i=!n;n||(n={});for(var a=-1,o=t.length;++a<o;){var s=t[a],c=r?r(n[s],e[s],s,n,e):void 0;c===void 0&&(c=e[s]),i?ln(n,s,c):dn(n,s,c)}return n}var hn=t((()=>{pn(),un()}));function gn(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var _n=t((()=>{}));function vn(e){if(!a(e))return gn(e);var t=Ge(e),n=[];for(var r in e)r==`constructor`&&(t||!yn.call(e,r))||n.push(r);return n}var yn,bn=t((()=>{c(),Re(),_n(),yn=Object.prototype.hasOwnProperty}));function xn(e){return Ie(e)?Xe(e,!0):vn(e)}var Sn=t((()=>{ze(),bn(),He()}));function Cn(e,t){if(t)return e.slice();var n=e.length,r=Dn?Dn(n):new e.constructor(n);return e.copy(r),r}var wn,Tn,En,Dn,On=t((()=>{s(),wn=typeof exports==`object`&&exports&&!exports.nodeType&&exports,Tn=wn&&typeof module==`object`&&module&&!module.nodeType&&module,En=Tn&&Tn.exports===wn?r.Buffer:void 0,Dn=En?En.allocUnsafe:void 0}));function kn(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var An=t((()=>{})),jn,Mn=t((()=>{qe(),jn=Ye(Object.getPrototypeOf,Object)}));function Nn(e){var t=new e.constructor(e.byteLength);return new Me(t).set(new Me(e)),t}var Pn=t((()=>{nt()}));function Fn(e,t){var n=t?Nn(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var In=t((()=>{Pn()})),Ln,Rn,zn=t((()=>{c(),Ln=Object.create,Rn=function(){function e(){}return function(t){if(!a(t))return{};if(Ln)return Ln(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}()}));function Bn(e){return typeof e.constructor==`function`&&!Ge(e)?Rn(jn(e)):{}}var Vn=t((()=>{zn(),Mn(),Re()}));function Hn(e,t,n){(n!==void 0&&!d(e[t],n)||n===void 0&&!(t in e))&&ln(e,t,n)}var Un=t((()=>{un(),ne()}));function Wn(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 Gn=t((()=>{})),Kn,qn=t((()=>{Gn(),Kn=Wn()}));function Jn(e){return ae(e)&&Ie(e)}var Yn=t((()=>{He(),oe()}));function Xn(e){if(!ae(e)||o(e)!=Zn)return!1;var t=jn(e);if(t===null)return!0;var n=tr.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&er.call(n)==nr}var Zn,Qn,$n,er,tr,nr,rr=t((()=>{i(),Mn(),oe(),Zn=`[object Object]`,Qn=Function.prototype,$n=Object.prototype,er=Qn.toString,tr=$n.hasOwnProperty,nr=er.call(Object)}));function ir(e,t){if(!(t===`constructor`&&typeof e[t]==`function`)&&t!=`__proto__`)return e[t]}var ar=t((()=>{}));function or(e){return mn(e,xn(e))}var sr=t((()=>{hn(),Sn()}));function cr(e,t,n,r,i,o,s){var c=ir(e,n),l=ir(t,n),ee=s.get(l);if(ee){Hn(e,n,ee);return}var u=o?o(c,l,n+``,e,t,s):void 0,d=u===void 0;if(d){var f=ke(l),p=!f&&et(l),ne=!f&&!p&&Je(l);u=l,f||p||ne?ke(c)?u=c:Jn(c)?u=kn(c):p?(d=!1,u=Cn(l,!0)):ne?(d=!1,u=Fn(l,!0)):u=[]:Xn(l)||ye(l)?(u=c,ye(c)?u=or(c):(!a(c)||te(c))&&(u=Bn(l))):d=!1}d&&(s.set(l,u),i(u,l,r,o,s),s.delete(l)),Hn(e,n,u)}var lr=t((()=>{Un(),On(),In(),An(),Vn(),Ne(),De(),Yn(),Le(),u(),c(),rr(),Ve(),ar(),sr()}));function ur(e,t,n,r,i){e!==t&&Kn(t,function(o,s){if(i||(i=new Fe),a(o))cr(e,t,s,n,ur,r,i);else{var c=r?r(ir(e,s),o,s+``,e,t,i):void 0;c===void 0&&(c=o),Hn(e,s,c)}},xn)}var dr=t((()=>{Se(),Un(),qn(),lr(),c(),Sn(),ar()}));function fr(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 pr=t((()=>{}));function mr(e,t,n){return t=hr(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,a=hr(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),fr(e,this,s)}}var hr,gr=t((()=>{pr(),hr=Math.max}));function _r(e){return function(){return e}}var vr=t((()=>{})),yr,br=t((()=>{vr(),cn(),Te(),yr=sn?function(e,t){return sn(e,`toString`,{configurable:!0,enumerable:!1,value:_r(t),writable:!0})}:Ce}));function xr(e){var t=0,n=0;return function(){var r=wr(),i=Cr-(r-n);if(n=r,i>0){if(++t>=Sr)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var Sr,Cr,wr,Tr=t((()=>{Sr=800,Cr=16,wr=Date.now})),Er,Dr=t((()=>{br(),Tr(),Er=xr(yr)}));function Or(e,t){return Er(mr(e,t,Ce),e+``)}var kr=t((()=>{Te(),gr(),Dr()}));function Ar(e,t,n){if(!a(n))return!1;var r=typeof t;return(r==`number`?Ie(n)&&tt(t,n.length):r==`string`&&t in n)?d(n[t],e):!1}var jr=t((()=>{ne(),He(),Qe(),c()}));function Mr(e){return Or(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&&Ar(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 Nr=t((()=>{kr(),jr()})),j,Pr=t((()=>{dr(),Nr(),j=Mr(function(e,t,n,r){ur(e,t,n,r)})}));function Fr(e){M=e}function Ir(){M=null,Hr=void 0}function Lr(e){return Hr=e,e}function Rr(){return A(re(),Vr)}function zr(){try{let e=ot(Nt(E(Rr())));return!e||typeof e!=`object`||Array.isArray(e)?null:e}catch{return null}}function Br(){if(Hr!==!0)return null;if(M)return M;let e=zr();return e?(M=e,We(),e):null}var Vr,M,Hr,Ur=t((()=>{ie(),kt(),Mt(),je(),st(),Vr=`remote-settings.json`,M=null}));function Wr(e,t){return e.flatMap((e,n)=>n?[t(n),e]:[e])}function Gr(e,t){let n=0;for(let r of e)n+=+!!t(r);return n}function Kr(e){return[...new Set(e)]}var qr=t((()=>{}));async function Jr(e,t){let{code:n}=await bt(`git`,[`check-ignore`,e],{preserveOutputOnError:!1,cwd:t});return n===0}function Yr(){return A(Xt(),`.config`,`git`,`ignore`)}async function Xr(e,t=it()){try{if(!await yt(t))return;let n=`**/${e}`;if(await Jr(e.endsWith(`/`)?`${e}sample-file.txt`:e,t))return;let r=Yr();await nn(Qt(r),{recursive:!0});try{if((await rn(r,{encoding:`utf-8`})).includes(n))return;await tn(r,`\n${n}\n`)}catch(e){if(at(e)===`ENOENT`)await an(r,`${n}\n`,`utf-8`);else throw e}}catch(e){Ct(e)}}var Zr=t((()=>{rt(),dt(),xt(),_t(),St()}));function Qr(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 $r(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 ei(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 ti(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 ni(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 N(){let e=Ze(),t=new Set(e);return t.add(`policySettings`),t.add(`flagSettings`),Array.from(t)}function ri(e){return N().includes(e)}var ii,ai,oi,si=t((()=>{Be(),ii=[`userSettings`,`projectSettings`,`localSettings`,`flagSettings`,`policySettings`],ai=[`localSettings`,`projectSettings`,`userSettings`],oi=`https://json.schemastore.org/claude-code-settings.json`}));function ci(e){P.set(e,Date.now())}function li(e,t){let n=P.get(e);return n!==void 0&&Date.now()-n<t?(P.delete(e),!0):!1}function ui(){P.clear()}var P,di=t((()=>{P=new Map})),F,I,fi=t((()=>{p(),Dt(),F=f(function(){if(process.env.USER_TYPE===`ant`&&process.env.CLAUDE_CODE_MANAGED_SETTINGS_PATH)return process.env.CLAUDE_CODE_MANAGED_SETTINGS_PATH;switch(Et()){case`macos`:return`/Library/Application Support/ClaudeCode`;case`windows`:return`C:\\Program Files\\ClaudeCode`;default:return`/etc/claude-code`}}),I=f(function(){return A(F(),`managed-settings.d`)})})),pi,mi,hi,gi=t((()=>{C(),k(),pi=O(()=>w({allowedDomains:S(h()).optional(),allowManagedDomainsOnly:x().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(h()).optional().describe(`macOS only: Unix socket paths to allow. Ignored on Linux (seccomp cannot filter by path).`),allowAllUnixSockets:x().optional().describe(`If true, allow all Unix sockets (disables blocking on both platforms).`),allowLocalBinding:x().optional(),httpProxyPort:g().optional(),socksProxyPort:g().optional()}).optional()),mi=O(()=>w({allowWrite:S(h()).optional().describe(`Additional paths to allow writing within the sandbox. Merged with paths from Edit(...) allow permission rules.`),denyWrite:S(h()).optional().describe(`Additional paths to deny writing within the sandbox. Merged with paths from Edit(...) deny permission rules.`),denyRead:S(h()).optional().describe(`Additional paths to deny reading within the sandbox. Merged with paths from Read(...) deny permission rules.`),allowRead:S(h()).optional().describe(`Paths to re-allow reading within denyRead regions. Takes precedence over denyRead for matching paths.`),allowManagedReadPathsOnly:x().optional().describe(`When true (set in managed settings), only allowRead paths from policySettings are used.`)}).optional()),hi=O(()=>w({enabled:x().optional(),failIfUnavailable:x().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:x().optional(),allowUnsandboxedCommands:x().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:pi(),filesystem:mi(),ignoreViolations:_(h(),S(h())).optional(),enableWeakerNestedSandbox:x().optional(),enableWeakerNetworkIsolation:x().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(h()).optional(),ripgrep:w({command:h(),args:S(h()).optional()}).optional().describe(`Custom ripgrep configuration for bundled ripgrep support`)}).passthrough())}));async function L(e){try{return!!await wt(e)}catch{return!1}}function _i(){return process.env.__CFBundleIdentifier===`com.conductor.app`}function vi(){if(process.env.CURSOR_TRACE_ID||process.env.VSCODE_GIT_ASKPASS_MAIN?.includes(`cursor`))return`cursor`;if(process.env.VSCODE_GIT_ASKPASS_MAIN?.includes(`windsurf`))return`windsurf`;if(process.env.VSCODE_GIT_ASKPASS_MAIN?.includes(`antigravity`))return`antigravity`;let e=process.env.__CFBundleIdentifier?.toLowerCase();if(e?.includes(`vscodium`))return`codium`;if(e?.includes(`windsurf`))return`windsurf`;if(e?.includes(`com.google.android.studio`))return`androidstudio`;if(e){for(let t of Di)if(e.includes(t))return t}if(process.env.VisualStudioVersion)return`visualstudio`;if(process.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`)return process.platform,`pycharm`;if(process.env.TERM===`xterm-ghostty`)return`ghostty`;if(process.env.TERM?.includes(`kitty`))return`kitty`;if(process.env.TERM_PROGRAM)return process.env.TERM_PROGRAM;if(process.env.TMUX)return`tmux`;if(process.env.STY)return`screen`;if(process.env.KONSOLE_VERSION)return`konsole`;if(process.env.GNOME_TERMINAL_SERVICE)return`gnome-terminal`;if(process.env.XTERM_VERSION)return`xterm`;if(process.env.VTE_VERSION)return`vte-based`;if(process.env.TERMINATOR_UUID)return`terminator`;if(process.env.KITTY_WINDOW_ID)return`kitty`;if(process.env.ALACRITTY_LOG)return`alacritty`;if(process.env.TILIX_ID)return`tilix`;if(process.env.WT_SESSION)return`windows-terminal`;if(process.env.SESSIONNAME&&process.env.TERM===`cygwin`)return`cygwin`;if(process.env.MSYSTEM)return process.env.MSYSTEM.toLowerCase();if(process.env.ConEmuANSI||process.env.ConEmuPID||process.env.ConEmuTask)return`conemu`;if(process.env.WSL_DISTRO_NAME)return`wsl-${process.env.WSL_DISTRO_NAME}`;if(yi())return`ssh-session`;if(process.env.TERM){let e=process.env.TERM;return e.includes(`alacritty`)?`alacritty`:e.includes(`rxvt`)?`rxvt`:e.includes(`termite`)?`termite`:process.env.TERM}return process.stdout.isTTY?null:`non-interactive`}function yi(){return!!(process.env.SSH_CONNECTION||process.env.SSH_CLIENT||process.env.SSH_TTY)}function bi(){let e=process.env.CLAUDE_CODE_HOST_PLATFORM;return e===`win32`||e===`darwin`||e===`linux`?e:R.platform}var xi,Si,Ci,wi,Ti,Ei,Di,Oi,R,ki=t((()=>{p(),zt(),Vt(),ie(),Kt(),ft(),Tt(),xi=f(()=>{if(T().existsSync(A(re(),`.config.json`)))return A(re(),`.config.json`);let e=`.claude${Rt()}.json`;return A(process.env.CLAUDE_CONFIG_DIR||Xt(),e)}),Si=f(async()=>{try{let{default:e}=await import(`./axios-BHBm_hhU.js`);return await e.head(`http://1.1.1.1`,{signal:AbortSignal.timeout(1e3)}),!0}catch{return!1}}),Ci=f(async()=>{let e=[];return await L(`npm`)&&e.push(`npm`),await L(`yarn`)&&e.push(`yarn`),await L(`pnpm`)&&e.push(`pnpm`),e}),wi=f(async()=>{let e=[];return await L(`bun`)&&e.push(`bun`),await L(`deno`)&&e.push(`deno`),await L(`node`)&&e.push(`node`),e}),Ti=f(()=>{try{return T().existsSync(`/proc/sys/fs/binfmt_misc/WSLInterop`)}catch{return!1}}),Ei=f(()=>{try{if(!Ti())return!1;let{cmd:e}=Ht(`npm`,[]);return e.startsWith(`/mnt/c/`)}catch{return!1}}),Di=[`pycharm`,`intellij`,`webstorm`,`phpstorm`,`rubymine`,`clion`,`goland`,`rider`,`datagrip`,`appcode`,`dataspell`,`aqua`,`gateway`,`fleet`,`jetbrains`,`androidstudio`],Oi=f(()=>{if(m(process.env.CODESPACES))return`codespaces`;if(process.env.GITPOD_WORKSPACE_ID)return`gitpod`;if(process.env.REPL_ID||process.env.REPL_SLUG)return`replit`;if(process.env.PROJECT_DOMAIN)return`glitch`;if(m(process.env.VERCEL))return`vercel`;if(process.env.RAILWAY_ENVIRONMENT_NAME||process.env.RAILWAY_SERVICE_NAME)return`railway`;if(m(process.env.RENDER))return`render`;if(m(process.env.NETLIFY))return`netlify`;if(process.env.DYNO)return`heroku`;if(process.env.FLY_APP_NAME||process.env.FLY_MACHINE_ID)return`fly.io`;if(m(process.env.CF_PAGES))return`cloudflare-pages`;if(process.env.DENO_DEPLOYMENT_ID)return`deno-deploy`;if(process.env.AWS_LAMBDA_FUNCTION_NAME)return`aws-lambda`;if(process.env.AWS_EXECUTION_ENV===`AWS_ECS_FARGATE`)return`aws-fargate`;if(process.env.AWS_EXECUTION_ENV===`AWS_ECS_EC2`)return`aws-ecs`;try{if(T().readFileSync(`/sys/hypervisor/uuid`,{encoding:`utf8`}).trim().toLowerCase().startsWith(`ec2`))return`aws-ec2`}catch{}if(process.env.K_SERVICE)return`gcp-cloud-run`;if(process.env.GOOGLE_CLOUD_PROJECT)return`gcp`;if(process.env.WEBSITE_SITE_NAME||process.env.WEBSITE_SKU)return`azure-app-service`;if(process.env.AZURE_FUNCTIONS_ENVIRONMENT)return`azure-functions`;if(process.env.APP_URL?.includes(`ondigitalocean.app`))return`digitalocean-app-platform`;if(process.env.SPACE_CREATOR_USER_ID)return`huggingface-spaces`;if(m(process.env.GITHUB_ACTIONS))return`github-actions`;if(m(process.env.GITLAB_CI))return`gitlab-ci`;if(process.env.CIRCLECI)return`circleci`;if(process.env.BUILDKITE)return`buildkite`;if(m(process.env.CI))return`ci`;if(process.env.KUBERNETES_SERVICE_HOST)return`kubernetes`;try{if(T().existsSync(`/.dockerenv`))return`docker`}catch{}return R.platform===`darwin`?`unknown-darwin`:R.platform===`linux`?`unknown-linux`:R.platform===`win32`?`unknown-win32`:`unknown`}),R={hasInternetAccess:Si,isCI:m(process.env.CI),platform:[`win32`,`darwin`].includes(process.platform)?process.platform:`linux`,arch:process.arch,nodeVersion:process.version,terminal:vi(),isSSH:yi,getPackageManagers:Ci,getRuntimes:wi,isRunningWithBun:f(Bt),isWslEnvironment:Ti,isNpmFromWindowsPath:Ei,isConductor:_i,detectDeploymentEnvironment:Oi}})),Ai,ji,Mi,Ni=t((()=>{ki(),Ai=R.platform===`darwin`?`⏺`:`●`,ji=[`·|·`,`·/·`,`·—·`,`·\\·`],Mi=`·✔︎·`}));function Pi(e){return process.env.USER_TYPE!==`ant`||e!==`auto`&&e!==`bubble`}function z(e){return Ui[e]??Ui.default}function Fi(e){return z(e).external}function Ii(e){return Jt.includes(e)?e:`default`}function Li(e){return z(e).title}function Ri(e){return e==="default"||e===void 0}function zi(e){return z(e).shortTitle}function Bi(e){return z(e).symbol}function Vi(e){return z(e).color}var Hi,Ui,Wi=t((()=>{C(),Ni(),qt(),k(),O(()=>me.enum(Jt)),Hi=O(()=>me.enum(Yt)),Ui={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`}}})),Gi,Ki=t((()=>{Gi=`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(`.`)})),qi,Ji,Yi=t((()=>{qi=[`bash`,`powershell`],Ji=`bash`}));function Xi(){return{BashCommandHookSchema:w({type:v(`command`).describe(`Shell command hook type`),command:h().describe(`Shell command to execute`),if:B(),shell:b(qi).optional().describe(`Shell interpreter. 'bash' uses your $SHELL (bash/zsh/sh); 'powershell' uses pwsh. Defaults to bash.`),timeout:g().positive().optional().describe(`Timeout in seconds for this specific command`),statusMessage:h().optional().describe(`Custom status message to display in spinner while hook runs`),once:x().optional().describe(`If true, hook runs once and is removed after execution`),async:x().optional().describe(`If true, hook runs in background without blocking`),asyncRewake:x().optional().describe(`If true, hook runs in background and wakes the model on exit code 2 (blocking error). Implies async.`)}),PromptHookSchema:w({type:v(`prompt`).describe(`LLM prompt hook type`),prompt:h().describe(`Prompt to evaluate with LLM. Use $ARGUMENTS placeholder for hook input JSON.`),if:B(),timeout:g().positive().optional().describe(`Timeout in seconds for this specific prompt evaluation`),model:h().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:h().optional().describe(`Custom status message to display in spinner while hook runs`),once:x().optional().describe(`If true, hook runs once and is removed after execution`)}),HttpHookSchema:w({type:v(`http`).describe(`HTTP hook type`),url:h().url().describe(`URL to POST the hook input JSON to`),if:B(),timeout:g().positive().optional().describe(`Timeout in seconds for this specific request`),headers:_(h(),h()).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(h()).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:h().optional().describe(`Custom status message to display in spinner while hook runs`),once:x().optional().describe(`If true, hook runs once and is removed after execution`)}),AgentHookSchema:w({type:v(`agent`).describe(`Agentic verifier hook type`),prompt:h().describe(`Prompt describing what to verify (e.g. "Verify that unit tests ran and passed."). Use $ARGUMENTS placeholder for hook input JSON.`),if:B(),timeout:g().positive().optional().describe(`Timeout in seconds for agent execution (default 60)`),model:h().optional().describe(`Model to use for this agent hook (e.g., "claude-sonnet-4-6"). If not specified, uses Haiku.`),statusMessage:h().optional().describe(`Custom status message to display in spinner while hook runs`),once:x().optional().describe(`If true, hook runs once and is removed after execution`)})}}var B,Zi,Qi,V,$i=t((()=>{Ki(),C(),k(),Yi(),B=O(()=>h().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.`)),Zi=O(()=>{let{BashCommandHookSchema:e,PromptHookSchema:t,AgentHookSchema:n,HttpHookSchema:r}=Xi();return fe(`type`,[e,t,n,r])}),Qi=O(()=>w({matcher:h().optional().describe(`String pattern to match (e.g. tool names like "Write")`),hooks:S(Zi()).describe(`List of hooks to execute when the matcher matches`)})),V=O(()=>le(b(Gi),S(Qi())))}));function ea(e,t){let n=e.toLowerCase();return t.autoUpdate??(H.has(n)&&!aa.has(n))}function ta(e){return H.has(e.toLowerCase())?!1:sa.test(e)?!0:oa.test(e)}function na(e,t){let n=e.toLowerCase();if(!H.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/${ca}/' 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/${ca}/' can use this name.`}return`The name '${e}' is reserved for official Anthropic marketplaces and can only be used with GitHub sources from the '${ca}' organization.`}function ra(e){return typeof e==`string`&&e.startsWith(`./`)}function ia(e){return e.source===`file`||e.source===`directory`}var H,aa,oa,sa,ca,U,W,la,ua,da,fa,pa,ma,ha,ga,_a,va,ya,ba,xa,Sa,Ca,wa,Ta,Ea,Da,Oa,ka,Aa,ja,Ma,Na,Pa,Fa,Ia,La,Ra,G,za,Ba,Va,Ha,Ua,Wa,Ga,Ka,qa,Ja=t((()=>{C(),$i(),jt(),k(),H=new Set([`claude-code-marketplace`,`claude-code-plugins`,`claude-plugins-official`,`anthropic-marketplace`,`anthropic-plugins`,`agent-skills`,`life-sciences`,`knowledge-work-plugins`]),aa=new Set([`knowledge-work-plugins`]),oa=/(?:official[^a-z0-9]*(anthropic|claude)|(?:anthropic|claude)[^a-z0-9]*official|^(?:anthropic|claude)[^a-z0-9]*(marketplace|plugins|official))/i,sa=/[^\u0020-\u007E]/,ca=`anthropics`,U=O(()=>h().startsWith(`./`)),W=O(()=>U().endsWith(`.json`)),la=O(()=>y([U().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`),h().url().refine(e=>e.endsWith(`.mcpb`)||e.endsWith(`.dxt`),{message:`MCPB URL must end with .mcpb or .dxt`}).describe(`URL to MCPB file`)])),ua=O(()=>U().endsWith(`.md`)),da=O(()=>y([ua(),U()])),fa=O(()=>h().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=>!ta(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`})),pa=O(()=>w({name:h().min(1,`Author name cannot be empty`).describe(`Display name of the plugin author or organization`),email:h().optional().describe(`Contact email for support or feedback`),url:h().optional().describe(`Website, GitHub profile, or organization URL`)})),ma=O(()=>w({name:h().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:h().optional().describe(`Semantic version (e.g., 1.2.3) following semver.org specification`),description:h().optional().describe(`Brief, user-facing explanation of what the plugin provides`),author:pa().optional().describe(`Information about the plugin creator or maintainer`),homepage:h().url().optional().describe(`Plugin homepage or documentation URL`),repository:h().optional().describe(`Source code repository URL`),license:h().optional().describe(`SPDX license identifier (e.g., MIT, Apache-2.0)`),keywords:S(h()).optional().describe(`Tags for plugin discovery and categorization`),dependencies:S(Ba()).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.`)})),ha=O(()=>w({description:h().optional().describe(`Brief, user-facing explanation of what these hooks provide`),hooks:_e(()=>V()).describe(`The hooks provided by the plugin, in the same format as the one used for settings`)})),ga=O(()=>w({hooks:y([W().describe(`Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root`),_e(()=>V()).describe(`Additional hooks (in addition to those in hooks/hooks.json, if it exists)`),S(y([W().describe(`Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root`),_e(()=>V()).describe(`Additional hooks (in addition to those in hooks/hooks.json, if it exists)`)]))])})),_a=O(()=>w({source:da().optional().describe(`Path to command markdown file, relative to plugin root`),content:h().optional().describe(`Inline markdown content for the command`),description:h().optional().describe(`Command description override`),argumentHint:h().optional().describe(`Hint for command arguments (e.g., "[file]")`),model:h().optional().describe(`Default model for this command`),allowedTools:S(h()).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`})),va=O(()=>w({commands:y([da().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(da().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`),_(h(),_a()).describe(`Object mapping of command names to their metadata and source files. Command name becomes the slash command name (e.g., "about" → "/plugin:about")`)])})),ya=O(()=>w({agents:y([ua().describe(`Path to additional agent file (in addition to those in the agents/ directory, if it exists), relative to the plugin root`),S(ua().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`)])})),ba=O(()=>w({skills:y([U().describe(`Path to additional skill directory (in addition to those in the skills/ directory, if it exists), relative to the plugin root`),S(U().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`)])})),xa=O(()=>w({outputStyles:y([U().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(U().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`)])})),Sa=O(()=>h().min(1)),Ca=O(()=>h().min(2).refine(e=>e.startsWith(`.`),{message:`File extensions must start with dot (e.g., ".ts", not "ts")`})),wa=O(()=>w({mcpServers:y([W().describe(`MCP servers to include in the plugin (in addition to those in the .mcp.json file, if it exists)`),la().describe(`Path or URL to MCPB file containing MCP server configuration`),_(h(),Pt()).describe(`MCP server configurations keyed by server name`),S(y([W().describe(`Path to MCP servers configuration file`),la().describe(`Path or URL to MCPB file`),_(h(),Pt()).describe(`Inline MCP server configurations`)])).describe(`Array of MCP server configurations (paths, MCPB files, or inline definitions)`)])})),Ta=O(()=>w({type:b([`string`,`number`,`boolean`,`directory`,`file`]).describe(`Type of the configuration value`),title:h().describe(`Human-readable label shown in the config dialog`),description:h().describe(`Help text shown beneath the field in the config dialog`),required:x().optional().describe(`If true, validation fails when this field is empty`),default:y([h(),g(),x(),S(h())]).optional().describe(`Default value used when the user provides nothing`),multiple:x().optional().describe(`For string type: allow an array of strings`),sensitive:x().optional().describe(`If true, masks dialog input and stores value in secure storage (keychain/credentials file) instead of settings.json`),min:g().optional().describe(`Minimum value (number type only)`),max:g().optional().describe(`Maximum value (number type only)`)}).strict()),Ea=O(()=>w({userConfig:_(h().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`),Ta()).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).")})),Da=O(()=>w({channels:S(w({server:h().min(1).describe(`Name of the MCP server this channel binds to. Must match a key in this plugin's mcpServers.`),displayName:h().optional().describe(`Human-readable name shown in the config dialog title (e.g., "Telegram"). Defaults to the server name.`),userConfig:_(h(),Ta()).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.`)})),Oa=O(()=>pe({command:h().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(Sa()).optional().describe(`Command-line arguments to pass to the server`),extensionToLanguage:_(Ca(),Sa()).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:b([`stdio`,`socket`]).default(`stdio`).describe(`Communication transport mechanism`),env:_(h(),h()).optional().describe(`Environment variables to set when starting the server`),initializationOptions:ue().optional().describe(`Initialization options passed to the server during initialization`),settings:ue().optional().describe(`Settings passed to the server via workspace/didChangeConfiguration`),workspaceFolder:h().optional().describe(`Workspace folder path to use for the server`),startupTimeout:g().int().positive().optional().describe(`Maximum time to wait for server startup (milliseconds)`),shutdownTimeout:g().int().positive().optional().describe(`Maximum time to wait for graceful shutdown (milliseconds)`),restartOnCrash:x().optional().describe(`Whether to restart the server if it crashes`),maxRestarts:g().int().nonnegative().optional().describe(`Maximum number of restart attempts before giving up`)})),ka=O(()=>w({lspServers:y([W().describe(`Path to .lsp.json configuration file relative to plugin root`),_(h(),Oa()).describe(`LSP server configurations keyed by server name`),S(y([W().describe(`Path to LSP configuration file`),_(h(),Oa()).describe(`Inline LSP server configurations`)])).describe(`Array of LSP server configurations (paths or inline definitions)`)])})),Aa=O(()=>h().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`)),ja=O(()=>w({settings:_(h(),ue()).optional().describe(`Settings to merge when plugin is enabled. Only allowlisted keys are kept (currently: agent)`)})),Ma=O(()=>w({...ma().shape,...ga().partial().shape,...va().partial().shape,...ya().partial().shape,...ba().partial().shape,...xa().partial().shape,...Da().partial().shape,...wa().partial().shape,...ka().partial().shape,...ja().partial().shape,...Ea().partial().shape})),Na=O(()=>fe(`source`,[w({source:v(`url`),url:h().url().describe(`Direct URL to marketplace.json file`),headers:_(h(),h()).optional().describe(`Custom HTTP headers (e.g., for authentication)`)}),w({source:v(`github`),repo:h().describe(`GitHub repository in owner/repo format`),ref:h().optional().describe(`Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.`),path:h().optional().describe(`Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)`),sparsePaths:S(h()).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.`)}),w({source:v(`git`),url:h().describe(`Full git repository URL`),ref:h().optional().describe(`Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.`),path:h().optional().describe(`Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)`),sparsePaths:S(h()).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.`)}),w({source:v(`npm`),package:Aa().describe(`NPM package containing marketplace.json`)}),w({source:v(`file`),path:h().describe(`Local file path to marketplace.json`)}),w({source:v(`directory`),path:h().describe(`Local directory containing .claude-plugin/marketplace.json`)}),w({source:v(`hostPattern`),hostPattern:h().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$").`)}),w({source:v(`pathPattern`),pathPattern:h().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.`)}),w({source:v(`settings`),name:fa().refine(e=>!H.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(Ia()).describe(`Plugin entries declared inline in settings.json`),owner:pa().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).`)])),Pa=O(()=>h().length(40).regex(/^[a-f0-9]{40}$/,`Must be a full 40-character lowercase git commit SHA`)),Fa=O(()=>y([U().describe(`Path to the plugin root, relative to the marketplace root (the directory containing .claude-plugin/, not .claude-plugin/ itself)`),w({source:v(`npm`),package:Aa().or(h()).describe("Package name (or url, or local path, or anything else that can be passed to `npm` as a package)"),version:h().optional().describe(`Specific version or version range (e.g., ^1.0.0, ~2.1.0)`),registry:h().url().optional().describe(`Custom NPM registry URL (defaults to using system default, likely npmjs.org)`)}).describe(`NPM package as plugin source`),w({source:v(`pip`),package:h().describe(`Python package name as it appears on PyPI`),version:h().optional().describe(`Version specifier (e.g., ==1.0.0, >=2.0.0, <3.0.0)`),registry:h().url().optional().describe(`Custom PyPI registry URL (defaults to using system default, likely pypi.org)`)}).describe(`Python package as plugin source`),w({source:v(`url`),url:h().describe(`Full git repository URL (https:// or git@)`),ref:h().optional().describe(`Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.`),sha:Pa().optional().describe(`Specific commit SHA to use`)}),w({source:v(`github`),repo:h().describe(`GitHub repository in owner/repo format`),ref:h().optional().describe(`Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.`),sha:Pa().optional().describe(`Specific commit SHA to use`)}),w({source:v(`git-subdir`),url:h().describe(`Git repository: GitHub owner/repo shorthand, https://, or git@ URL`),path:h().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:h().optional().describe(`Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.`),sha:Pa().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.`)])),Ia=O(()=>w({name:h().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:Fa().describe(`Where to fetch the plugin from. Must be a remote source — relative paths have no marketplace repository to resolve against.`),description:h().optional(),version:h().optional(),strict:x().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.`})),La=O(()=>Ma().partial().extend({name:h().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:Fa().describe(`Where to fetch the plugin from`),category:h().optional().describe(`Category for organizing plugins (e.g., "productivity", "development")`),tags:S(h()).optional().describe(`Tags for searchability and discovery`),strict:x().optional().default(!0).describe(`Require the plugin manifest to be present in the plugin folder. If false, the marketplace entry provides the manifest.`)})),Ra=O(()=>w({name:fa(),owner:pa().describe(`Marketplace maintainer or curator information`),plugins:S(La()).describe(`Collection of available plugins in this marketplace`),forceRemoveDeletedPlugins:x().optional().describe(`When true, plugins removed from this marketplace will be automatically uninstalled and flagged for users`),metadata:w({pluginRoot:h().optional().describe(`Base path for relative plugin sources`),version:h().optional().describe(`Marketplace version`),description:h().optional().describe(`Marketplace description`)}).optional().describe(`Optional marketplace metadata`),allowCrossMarketplaceDependenciesOn:S(h()).optional().describe(`Marketplace names whose plugins may be auto-installed as dependencies. Only the root marketplace's allowlist applies — no transitive trust.`)})),G=O(()=>h().regex(/^[a-z0-9][-a-z0-9._]*@[a-z0-9][-a-z0-9._]*$/i,`Plugin ID must be in format: plugin@marketplace`)),za=/^[a-z0-9][-a-z0-9._]*(@[a-z0-9][-a-z0-9._]*)?(@\^[^@]*)?$/i,Ba=O(()=>y([h().regex(za,`Dependency must be a plugin name, optionally qualified with @marketplace`).transform(e=>e.replace(/@\^[^@]*$/,``)),w({name:h().min(1).regex(/^[a-z0-9][-a-z0-9._]*$/i),marketplace:h().min(1).regex(/^[a-z0-9][-a-z0-9._]*$/i).optional()}).loose().transform(e=>e.marketplace?`${e.name}@${e.marketplace}`:e.name)])),O(()=>y([G(),w({id:G().describe(`Plugin identifier (e.g., "formatter@tools")`),version:h().optional().describe(`Version constraint (e.g., "^2.0.0")`),required:x().optional().describe(`If true, cannot be disabled`),config:_(h(),ue()).optional().describe(`Plugin-specific configuration`)})])),Va=O(()=>w({version:h().describe(`Currently installed version`),installedAt:h().describe(`ISO 8601 timestamp of installation`),lastUpdated:h().optional().describe(`ISO 8601 timestamp of last update`),installPath:h().describe(`Absolute path to the installed plugin directory`),gitCommitSha:h().optional().describe(`Git commit SHA for git-based plugins (for version tracking)`)})),Ha=O(()=>w({version:v(1).describe(`Schema version 1`),plugins:_(G(),Va()).describe(`Map of plugin IDs to their installation metadata`)})),Ua=O(()=>b([`managed`,`user`,`project`,`local`])),Wa=O(()=>w({scope:Ua().describe(`Installation scope`),projectPath:h().optional().describe(`Project path (required for project/local scopes)`),installPath:h().describe(`Absolute path to the versioned plugin directory`),version:h().optional().describe(`Currently installed version`),installedAt:h().optional().describe(`ISO 8601 timestamp of installation`),lastUpdated:h().optional().describe(`ISO 8601 timestamp of last update`),gitCommitSha:h().optional().describe(`Git commit SHA for git-based plugins`)})),Ga=O(()=>w({version:v(2).describe(`Schema version 2`),plugins:_(G(),S(Wa())).describe(`Map of plugin IDs to arrays of installation entries`)})),O(()=>y([Ha(),Ga()])),Ka=O(()=>w({source:Na().describe(`Where to fetch the marketplace from`),installLocation:h().describe(`Local cache path where marketplace manifest is stored`),lastUpdated:h().describe(`ISO 8601 timestamp of last marketplace refresh`),autoUpdate:x().optional().describe(`Whether to automatically update this marketplace and its installed plugins on startup`)})),qa=O(()=>_(h(),Ka()))}));function Ya(e){let t=e.replace(/[^a-zA-Z0-9_-]/g,`_`);return e.startsWith(Xa)&&(t=t.replace(/_+/g,`_`).replace(/^_|_$/g,``)),t}var Xa,Za=t((()=>{Xa=`claude.ai `}));function Qa(e){let[t,n,...r]=e.split(`__`);return t!==`mcp`||!n?null:{serverName:n,toolName:r.length>0?r.join(`__`):void 0}}function $a(e){return`mcp__${Ya(e)}__`}function eo(e,t){return`${$a(e)}${Ya(t)}`}function to(e){return e.mcpInfo?eo(e.mcpInfo.serverName,e.mcpInfo.toolName):e.name}function no(e,t){let n=`mcp__${Ya(t)}__`;return e.replace(n,``)}function ro(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 io=t((()=>{Za()})),ao,oo,so,co,lo=t((()=>{ao=`Agent`,oo=`Task`,so=`verification`,co=new Set([`Explore`,`Plan`])})),uo,fo=t((()=>{uo=`TaskOutput`})),po,mo,ho=t((()=>{po=`TaskStop`,mo=`
2
+ - Stops a running background task by its ID
3
+ - Takes a task_id parameter identifying the task to stop
4
+ - Returns a success or failure status
5
+ - Use this tool when you need to terminate a long-running task
6
+ `})),go=n({BRIEF_PROACTIVE_SECTION:()=>bo,BRIEF_TOOL_NAME:()=>K,BRIEF_TOOL_PROMPT:()=>yo,DESCRIPTION:()=>vo,LEGACY_BRIEF_TOOL_NAME:()=>_o}),K,_o,vo,yo,bo,xo=t((()=>{K=`SendUserMessage`,_o=`Brief`,vo=`Send a message to the user`,yo="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.",bo=`## Talking to the user
7
+
8
+ ${K} 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 ${K}. The failure mode: the real answer lives in plain text while ${K} just says "done!" — they see "done!" and miss everything.
9
+
10
+ So: every time the user says something, the reply they actually read comes through ${K}. Even for "hi". Even for "thanks".
11
+
12
+ 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.
13
+
14
+ 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.
15
+
16
+ Keep messages tight — the decision, the file:line, the PR number. Second person always ("your config"), never third.`}));function q(e){return Ao[e]??e}function So(e){let t=[];for(let[n,r]of Object.entries(Ao))r===e&&t.push(n);return t}function Co(e){return e.replace(/\\/g,`\\\\`).replace(/\(/g,`\\(`).replace(/\)/g,`\\)`)}function wo(e){return e.replace(/\\\(/g,`(`).replace(/\\\)/g,`)`).replace(/\\\\/g,`\\`)}function To(e){let t=Do(e,`(`);if(t===-1)return{toolName:q(e)};let n=Oo(e,`)`);if(n===-1||n<=t||n!==e.length-1)return{toolName:q(e)};let r=e.substring(0,t),i=e.substring(t+1,n);if(!r)return{toolName:q(e)};if(i===``||i===`*`)return{toolName:q(r)};let a=wo(i);return{toolName:q(r),ruleContent:a}}function Eo(e){if(!e.ruleContent)return e.toolName;let t=Co(e.ruleContent);return`${e.toolName}(${t})`}function Do(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 Oo(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 ko,Ao,jo=t((()=>{lo(),fo(),ho(),ko=(xo(),e(go)).BRIEF_TOOL_NAME,Ao={Task:ao,KillShell:po,AgentOutputTool:uo,BashOutputTool:uo,...ko?{Brief:ko}:{}}}));function Mo(e){return Fo.filePatternTools.includes(e)}function No(e){return Fo.bashPrefixTools.includes(e)}function Po(e){return Fo.customValidation[e]}var Fo,Io=t((()=>{Fo={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 Lo(e,t){let n=0,r=t-1;for(;r>=0&&e[r]===`\\`;)n++,r--;return n%2!=0}function Ro(e,t){let n=0;for(let r=0;r<e.length;r++)e[r]===t&&!Lo(e,r)&&n++;return n}function zo(e){for(let t=0;t<e.length-1;t++)if(e[t]===`(`&&e[t+1]===`)`&&!Lo(e,t))return!0;return!1}function Bo(e,t){if(!e||e.trim()===``)return{valid:!1,error:`Permission rule cannot be empty`};if(Ro(e,`(`)!==Ro(e,`)`))return{valid:!1,error:`Mismatched parentheses`,suggestion:`Ensure all opening parentheses have matching closing parentheses`};if(zo(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=To(e),r=Qa(n.toolName);if(r)return n.ruleContent!==void 0||Ro(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 "${Wt(String(n.toolName))}"`};let i=Po(n.toolName);if(i&&n.ruleContent!==void 0){let e=i(n.ruleContent);if(!e.valid)return e}if(No(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(Mo(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&&Vo.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 Vo,Ho,Uo=t((()=>{C(),io(),k(),jo(),Gt(),Io(),Vo=new Set([`LocalVaultFetch`,`VaultHttpFetch`]),Ho=O(()=>h().superRefine((e,t)=>{let n=Bo(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:ge.custom,message:r,params:{received:e}})}}))}));function Wo(e){return`serverName`in e&&e.serverName!==void 0}function Go(e){return`serverCommand`in e&&e.serverCommand!==void 0}function Ko(e){return`serverUrl`in e&&e.serverUrl!==void 0}var qo,Jo,Yo,Xo,Zo,Qo,J,$o=t((()=>{C(),gi(),ie(),k(),Wi(),Ja(),si(),Uo(),$i(),qr(),qo=O(()=>_(h(),he())),Jo=O(()=>w({allow:S(Ho()).optional().describe(`List of permission rules for allowed operations`),deny:S(Ho()).optional().describe(`List of permission rules for denied operations`),ask:S(Ho()).optional().describe(`List of permission rules that should always prompt for confirmation`),defaultMode:b(Jt).optional().describe(`Default permission mode when Claude Code needs access`),disableBypassPermissionsMode:b([`disable`]).optional().describe(`Disable the ability to bypass permission prompts`),disableAutoMode:b([`disable`]).optional().describe(`Disable auto mode`),additionalDirectories:S(h()).optional().describe(`Additional directories to include in the permission scope`)}).passthrough()),Yo=O(()=>w({source:Na().describe(`Where to fetch the marketplace from`),installLocation:h().optional().describe(`Local cache path where marketplace manifest is stored (auto-generated if not provided)`),autoUpdate:x().optional().describe(`Whether to automatically update this marketplace and its installed plugins on startup`)})),Xo=O(()=>w({serverName:h().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(h()).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:h().optional().describe(`URL pattern with wildcard support (e.g., "https://*.example.com/*") for allowed remote MCP servers`)}).refine(e=>Gr([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"`})),Zo=O(()=>w({serverName:h().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(h()).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:h().optional().describe(`URL pattern with wildcard support (e.g., "https://*.example.com/*") for blocked remote MCP servers`)}).refine(e=>Gr([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"`})),Qo=[`skills`,`agents`,`hooks`,`mcp`],J=O(()=>w({$schema:v(oi).optional().describe(`JSON Schema reference for Claude Code settings`),apiKeyHelper:h().optional().describe(`Path to a script that outputs authentication values`),awsCredentialExport:h().optional().describe(`Path to a script that exports AWS credentials`),awsAuthRefresh:h().optional().describe(`Path to a script that refreshes AWS authentication`),gcpAuthRefresh:h().optional().describe(`Command to refresh GCP authentication (e.g., gcloud auth application-default login)`),...m(process.env.CLAUDE_CODE_ENABLE_XAA)?{xaaIdp:w({issuer:h().url().describe(`IdP issuer URL for OIDC discovery`),clientId:h().describe(`Claude Code's client_id registered at the IdP`),callbackPort:g().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:w({type:v(`command`),command:h()}).optional().describe(`Custom file suggestion configuration for @ mentions`),respectGitignore:x().optional().describe(`Whether file picker should respect .gitignore files (default: true). Note: .ignore files are always respected.`),cleanupPeriodDays:g().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:qo().optional().describe(`Environment variables to set for Claude Code sessions`),attribution:w({commit:h().optional().describe(`Attribution text for git commits, including any trailers. Empty string hides attribution.`),pr:h().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:x().optional().describe(`Deprecated: Use attribution instead. Whether to include Claude's co-authored by attribution in commits and PRs (defaults to true)`),includeGitInstructions:x().optional().describe(`Include built-in commit and PR workflow instructions in Claude's system prompt (default: true)`),permissions:Jo().optional().describe(`Tool usage permissions configuration`),modelType:b([`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:h().optional().describe(`Override the default model used by Claude Code`),availableModels:S(h()).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:_(h(),h()).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:x().optional().describe(`Whether to automatically approve all MCP servers in the project`),enabledMcpjsonServers:S(h()).optional().describe(`List of approved MCP servers from .mcp.json`),disabledMcpjsonServers:S(h()).optional().describe(`List of rejected MCP servers from .mcp.json`),allowedMcpServers:S(Xo()).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(Zo()).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:V().optional().describe(`Custom commands to run before/after tool executions`),worktree:w({symlinkDirectories:S(h()).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(h()).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:x().optional().describe(`Disable all hooks and statusLine execution`),defaultShell:b([`bash`,`powershell`]).optional().describe(`Default shell for input-box ! commands. Defaults to 'bash' on all platforms (no Windows auto-flip).`),allowManagedHooksOnly:x().optional().describe(`When true (and set in managed settings), only hooks from managed settings run. User, project, and local hooks are ignored.`),allowedHttpHookUrls:S(h()).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(h()).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:x().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:x().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:ce(e=>Array.isArray(e)?e.filter(e=>Qo.includes(e)):e,y([x(),S(b(Qo))])).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:w({type:v(`command`),command:h(),padding:g().optional(),refreshInterval:g().optional()}).optional().describe(`Custom status line display configuration`),statusLineEnabled:x().optional().describe(`Whether to render the fork built-in status line (model + ctx + 5h/7d limits + cost + cache pill). Toggled with /statusline.`),enabledPlugins:_(h(),y([S(h()),x(),de()])).optional().describe(`Enabled plugins using plugin-id@marketplace-id format. Example: { "formatter@anthropic-tools": true }. Also supports extended format with version constraints.`),extraKnownMarketplaces:_(h(),Yo()).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(Na()).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(Na()).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:b([`claudeai`,`console`]).optional().describe(`Force a specific login method: "claudeai" for Claude Pro/Max, "console" for Console billing`),forceLoginOrgUUID:h().optional().describe(`Organization UUID to use for OAuth login`),otelHeadersHelper:h().optional().describe(`Path to a script that outputs OpenTelemetry headers`),outputStyle:h().optional().describe(`Controls the output style for assistant responses`),language:h().optional().describe(`Preferred language for Claude responses (e.g., "japanese", "spanish")`),skipWebFetchPreflight:x().optional().describe(`Skip the WebFetch blocklist check for enterprise environments with restrictive security policies`),webSearchAdapter:b([`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:b([`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:h().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:h().optional().describe(`Brave Search API key. Required when using the brave web search adapter.`),webFetchHttpTimeoutMs:g().int().positive().optional().describe(`HTTP timeout in milliseconds for the HTTP direct web fetch backend. Defaults to 60000 (60s).`),exaApiKey:h().optional().describe(`Exa AI API key. Required when using the exa web search adapter.`),exaEndpointUrl:h().optional().describe(`Custom Exa AI MCP endpoint URL. Defaults to https://mcp.exa.ai/mcp.`),sandbox:hi().optional(),feedbackSurveyRate:g().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:x().optional().describe(`Whether to show tips in the spinner`),spinnerVerbs:w({mode:b([`append`,`replace`]),verbs:S(h())}).optional().describe(`Customize spinner verbs. mode: "append" adds verbs to defaults, "replace" uses only your verbs.`),spinnerTipsOverride:w({excludeDefault:x().optional(),tips:S(h())}).optional().describe(`Override spinner tips. tips: array of tip strings. excludeDefault: if true, only show custom tips (default: false).`),syntaxHighlightingDisabled:x().optional().describe(`Whether to disable syntax highlighting in diffs`),terminalTitleFromRename:x().optional().describe(`Whether /rename updates the terminal tab title (defaults to true). Set to false to keep auto-generated topic titles.`),alwaysThinkingEnabled:x().optional().describe(`When false, thinking is disabled. When absent or true, thinking is enabled automatically for supported models.`),effortLevel:b(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:h().optional().describe(`Advisor model for the server-side advisor tool.`),fastMode:x().optional().describe(`When true, fast mode is enabled. When absent or false, fast mode is off.`),fastModePerSessionOptIn:x().optional().describe(`When true, fast mode does not persist across sessions. Each session starts with fast mode off.`),promptSuggestionEnabled:x().optional().describe(`When false, prompt suggestions are disabled. When absent or true, prompt suggestions are enabled.`),poorMode:x().optional().describe(`When true, poor mode is active — extract_memories and prompt_suggestion are disabled to save tokens.`),showClearContextOnPlanAccept:x().optional().describe(`When true, the plan-approval dialog offers a "clear context" option. Defaults to false.`),agent:h().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(h()).optional().describe(`Company announcements to display at startup (one will be randomly selected if multiple are provided)`),pluginConfigs:_(h(),w({mcpServers:_(h(),_(h(),y([h(),g(),x(),S(h())]))).optional().describe(`User configuration values for MCP servers keyed by server name`),options:_(h(),y([h(),g(),x(),S(h())])).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:w({defaultEnvironmentId:h().optional().describe(`Default environment ID to use for remote sessions`)}).optional().describe(`Remote session configuration`),autoUpdatesChannel:b([`latest`,`stable`]).optional().describe(`Release channel for auto-updates (latest or stable)`),disableDeepLinkRegistration:b([`disable`]).optional().describe(`Prevent claude-cli:// protocol handler registration with the OS`),minimumVersion:h().optional().describe(`Minimum version to stay on - prevents downgrades when switching to stable channel`),plansDirectory:h().optional().describe(`Custom directory for plan files, relative to project root. If not set, defaults to ~/.claude/plans/`),...process.env.USER_TYPE===`ant`?{classifierPermissionsEnabled:x().optional().describe(`Enable AI-based classification for Bash(prompt:...) permission rules`)}:{},minSleepDurationMs:g().nonnegative().int().optional().describe(`Minimum duration in milliseconds that the Sleep tool must sleep for. Useful for throttling proactive tick frequency.`),maxSleepDurationMs:g().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.`),assistant:x().optional().describe(`Start Claude in assistant mode (custom system prompt, brief view, scheduled check-in skills)`),assistantName:h().optional().describe(`Display name for the assistant, shown in the claude.ai session list`),channelsEnabled:x().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(w({marketplace:h(),plugin:h()})).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:b([`chat`,`transcript`]).optional().describe(`Default transcript view: chat (SendUserMessage checkpoints only) or transcript (full)`),prefersReducedMotion:x().optional().describe(`Reduce or disable animations for accessibility (spinner shimmer, flash effects, etc.)`),autoMemoryEnabled:x().optional().describe(`Enable auto-memory for this project. When false, Claude will not read from or write to the auto-memory directory.`),autoMemoryDirectory:h().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:x().optional().describe(`Enable background memory consolidation (auto-dream). When set, overrides the server-side default.`),showThinkingSummaries:x().optional().describe(`Show thinking summaries in the transcript view (ctrl+o). Default: false.`),skipDangerousModePermissionPrompt:x().optional().describe(`Whether the user has accepted the bypass permissions mode dialog`),skipAutoPermissionPrompt:x().optional().describe(`Whether the user has accepted the auto mode opt-in dialog`),useAutoModeDuringPlan:x().optional().describe(`Whether plan mode uses auto mode semantics when auto mode is available (default: true)`),autoMode:w({allow:S(h()).optional().describe(`Rules for the auto mode classifier allow section`),soft_deny:S(h()).optional().describe(`Rules for the auto mode classifier deny section`),...process.env.USER_TYPE===`ant`?{deny:S(h()).optional()}:{},environment:S(h()).optional().describe(`Entries for the auto mode classifier environment section`)}).optional().describe(`Auto mode classifier prompt customization`),disableAutoMode:b([`disable`]).optional().describe(`Disable auto mode`),sshConfigs:S(w({id:h().describe(`Unique identifier for this SSH config. Used to match configs across settings sources.`),name:h().describe(`Display name for the SSH connection`),sshHost:h().describe(`SSH host in format "user@hostname" or "hostname", or a host alias from ~/.ssh/config`),sshPort:g().int().optional().describe(`SSH port (default: 22)`),sshIdentityFile:h().optional().describe(`Path to SSH identity file (private key)`),startDirectory:h().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(h()).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:g().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:x().optional().describe(`Whether to show cache hit rate warnings in the message flow when the rate falls below cacheThreshold. Default: true.`),pluginTrustMessage:h().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:h().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 es(){return lt(se(J(),{unrepresentable:`any`}),null,2)}var ts=t((()=>{C(),st(),$o()}));function ns(e){let t=rs.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=is[t])}return n}var Y,rs,is,as=t((()=>{Y=`https://code.claude.com/docs/en`,rs=[{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:`${Y}/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:`${Y}/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:`${Y}/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:`${Y}/iam#working-directories`}}],is={permissions:`${Y}/iam#configuring-permissions`,env:`${Y}/settings#environment-variables`,hooks:`${Y}/hooks`}}));function os(e){return e.code===`invalid_type`}function ss(e){return e.code===`invalid_value`}function cs(e){return e.code===`unrecognized_keys`}function ls(e){return e.code===`too_small`}function us(e){return e===null?`null`:e===void 0?`undefined`:Array.isArray(e)?`array`:typeof e}function ds(e){let t=e.match(/received (\w+)/);return t?t[1]:void 0}function fs(e,t){return e.issues.map(e=>{let n=e.path.map(String).join(`.`),r=e.message,i,a,o,s,c;if(ss(e))a=e.values.map(e=>String(e)),o=a.join(` | `),s=void 0,c=void 0;else if(os(e)){o=e.expected;let t=ds(e.message);s=t??us(e.input),c=t??us(e.input)}else ls(e)?o=String(e.minimum):e.code===`custom`&&`params`in e&&(s=e.params.received,c=s);let l=ns({path:n,code:e.code,expected:o,received:s,enumValues:a,message:e.message,value:s});if(ss(e))i=a?.map(e=>`"${e}"`).join(`, `),r=`Invalid value. Expected one of: ${i}`;else if(os(e)){let t=ds(e.message)??us(e.input);r=e.expected===`object`&&t===`null`&&n===``?`Invalid or malformed JSON`:`Expected ${e.expected}, but received ${t}`}else if(cs(e)){let t=e.keys.join(`, `);r=`Unrecognized ${Ut(e.keys.length,`field`)}: ${t}`}else ls(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 ps(e){try{let t=ot(e),n=J().strict().safeParse(t);return n.success?{isValid:!0}:{isValid:!1,error:`Settings validation failed:
17
+ `+fs(n.error,`settings`).map(e=>`- ${e.path}: ${e.message}`).join(`
18
+ `),fullSchema:es()}}catch(e){return{isValid:!1,error:`Invalid JSON: ${e instanceof Error?e.message:`Unknown parsing error`}`,fullSchema:es()}}}function ms(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=Bo(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 hs=t((()=>{st(),Gt(),Uo(),ts(),$o(),as()}));function gs(){let e=``;try{e=Zt().username}catch{}let t=[];return e&&t.push({path:`/Library/Managed Preferences/${e}/${_s}.plist`,label:`per-user managed preferences`}),t.push({path:`/Library/Managed Preferences/${_s}.plist`,label:`device-level managed preferences`}),process.env.USER_TYPE===`ant`&&t.push({path:A(Xt(),`Library`,`Preferences`,`${_s}.plist`),label:`user preferences (ant-only)`}),t}var _s,vs,ys,bs,xs,Ss,Cs,ws=t((()=>{_s=`com.anthropic.claudecode`,vs=`HKLM\\SOFTWARE\\Policies\\ClaudeCode`,ys=`HKCU\\SOFTWARE\\Policies\\ClaudeCode`,bs=`Settings`,xs=`/usr/bin/plutil`,Ss=[`-convert`,`json`,`-o`,`-`,`--`],Cs=5e3}));function Ts(e,t){return new Promise(n=>{on(e,t,{encoding:`utf-8`,timeout:Cs},(e,t)=>{n({stdout:t??``,code:+!!e})})})}function Es(){return(async()=>{if(process.platform===`darwin`){let e=gs(),t=(await Promise.all(e.map(async({path:e,label:t})=>{if(!en(e))return{stdout:``,label:t,ok:!1};let{stdout:n,code:r}=await Ts(xs,[...Ss,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([Ts(`reg`,[`query`,vs,`/v`,bs]),Ts(`reg`,[`query`,ys,`/v`,bs])]);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 Ds(){ks||(ks=Es())}function Os(){return ks}var ks,As=t((()=>{ws(),ks=null}));function js(){Us||(Us=(async()=>{It(`mdm_load_start`);let e=Date.now(),{mdm:t,hkcu:n}=zs(await(Os()??Es()));Vs=t,Hs=n,It(`mdm_load_end`);let r=Date.now()-e;if(mt(`MDM settings load completed in ${r}ms`),Object.keys(t.settings).length>0){mt(`MDM settings found: ${Object.keys(t.settings).join(`, `)}`);try{gt(`info`,`mdm_settings_loaded`,{duration_ms:r,key_count:Object.keys(t.settings).length,error_count:t.errors.length})}catch{}}})())}async function Ms(){Us||js(),await Us}function Ns(){return Vs??X}function Ps(){return Hs??X}function Fs(e,t){Vs=e,Hs=t}async function Is(){return zs(await Es())}function Ls(e,t){let n=D(e,!1);if(!n||typeof n!=`object`)return{settings:{},errors:[]};let r=ms(n,t),i=J().safeParse(n);if(!i.success){let e=fs(i.error,t);return{settings:{},errors:[...r,...e]}}return{settings:i.data,errors:r}}function Rs(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 zs(e){if(e.plistStdouts&&e.plistStdouts.length>0){let{stdout:t,label:n}=e.plistStdouts[0],r=Ls(t,n);if(Object.keys(r.settings).length>0)return{mdm:r,hkcu:X}}if(e.hklmStdout){let t=Rs(e.hklmStdout);if(t){let e=Ls(t,`Registry: ${vs}\\${bs}`);if(Object.keys(e.settings).length>0)return{mdm:e,hkcu:X}}}if(Bs())return{mdm:X,hkcu:X};if(e.hkcuStdout){let t=Rs(e.hkcuStdout);if(t){let e=Ls(t,`Registry: ${ys}\\${bs}`);return{mdm:X,hkcu:e}}}return{mdm:X,hkcu:X}}function Bs(){try{let e=D(E(A(F(),`managed-settings.json`)),!1);if(e&&typeof e==`object`&&Object.keys(e).length>0)return!0}catch{}try{let e=I(),t=T().readdirSync(e);for(let n of t)if(!(!(n.isFile()||n.isSymbolicLink())||!n.name.endsWith(`.json`)||n.name.startsWith(`.`)))try{let t=D(E(A(e,n.name)),!1);if(t&&typeof t==`object`&&Object.keys(t).length>0)return!0}catch{}}catch{}return!1}var X,Vs,Hs,Us,Ws=t((()=>{pt(),vt(),kt(),ft(),Ft(),Lt(),fi(),$o(),hs(),ws(),As(),X=Object.freeze({settings:{},errors:[]}),Vs=null,Hs=null,Us=null}));function Gs(){return A(F(),`managed-settings.json`)}function Ks(){let e=[],t={},n=!1,{settings:r,errors:i}=Z(Gs());e.push(...i),r&&Object.keys(r).length>0&&(t=j(t,r,$),n=!0);let a=I();try{let r=T().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}=Z(A(a,i));e.push(...o),r&&Object.keys(r).length>0&&(t=j(t,r,$),n=!0)}}catch(e){let t=at(e);t!==`ENOENT`&&t!==`ENOTDIR`&&Ct(e)}return{settings:n?t:null,errors:e}}function qs(){let{settings:e}=Z(Gs()),t=!!e&&Object.keys(e).length>0,n=!1,r=I();try{n=T().readdirSync(r).some(e=>(e.isFile()||e.isSymbolicLink())&&e.name.endsWith(`.json`)&&!e.name.startsWith(`.`))}catch{}return{hasBase:t,hasDropIns:n}}function Js(e,t){typeof e==`object`&&e&&`code`in e&&e.code===`ENOENT`?mt(`Broken symlink or missing file encountered for settings.json at path: ${t}`):Ct(e)}function Z(e){let t=$e(e);if(t)return{settings:t.settings?ut(t.settings):null,errors:t.errors};let n=Ys(e);return ve(e,n),{settings:n.settings?ut(n.settings):null,errors:n.errors}}function Ys(e){try{let{resolvedPath:t}=ht(T(),e),n=E(t);if(n.trim()===``)return{settings:{},errors:[]};let r=D(n,!1),i=ms(r,e),a=J().safeParse(r);if(!a.success){let t=fs(a.error,e);return{settings:null,errors:[...i,...t]}}return{settings:a.data,errors:i}}catch(t){return Js(t,e),{settings:null,errors:[]}}}function Xs(e){switch(e){case`userSettings`:return $t(re());case`policySettings`:case`projectSettings`:case`localSettings`:return $t(Ke());case`flagSettings`:{let e=Oe();return e?Qt($t(e)):$t(Ke())}}}function Zs(){return we()||m(process.env.CLAUDE_CODE_USE_COWORK_PLUGINS)?`cowork_settings.json`:`settings.json`}function Qs(e){switch(e){case`userSettings`:return A(Xs(e),Zs());case`projectSettings`:case`localSettings`:return A(Xs(e),$s(e));case`policySettings`:return Gs();case`flagSettings`:return Oe()}}function $s(e){switch(e){case`projectSettings`:return A(`.claude`,`settings.json`);case`localSettings`:return A(`.claude`,`settings.local.json`)}}function Q(e){let t=Pe(e);if(t!==void 0)return t;let n=ec(e);return Ue(e,n),n}function ec(e){if(e===`policySettings`){let e=Br();if(e&&Object.keys(e).length>0)return e;let t=Ns();if(Object.keys(t.settings).length>0)return t.settings;let{settings:n}=Ks();if(n)return n;let r=Ps();return Object.keys(r.settings).length>0?r.settings:null}let t=Qs(e),{settings:n}=t?Z(t):{settings:null};if(e===`flagSettings`){let e=Ee();if(e){let t=J().safeParse(e);if(t.success)return j(n||{},t.data,$)}}return n}function tc(){let e=Br();if(e&&Object.keys(e).length>0)return`remote`;let t=Ns();if(Object.keys(t.settings).length>0)return Et()===`macos`?`plist`:`hklm`;let{settings:n}=Ks();if(n)return`file`;let r=Ps();return Object.keys(r.settings).length>0?`hkcu`:null}function nc(e,t){if(e===`policySettings`||e===`flagSettings`)return{error:null};let n=Qs(e);if(!n)return{error:null};try{T().mkdirSync(Qt(n));let r=ec(e);if(!r){let e=null;try{e=E(n)}catch(e){if(!ct(e))throw e}if(e!==null){let t=D(e);if(t===null)return{error:Error(`Invalid JSON syntax in settings file at ${n}`)};t&&typeof t==`object`&&(r=t,mt(`Using raw settings from ${n} due to validation failure`))}}let i=j(r||{},t,(e,t,n,r)=>{if(t===void 0&&r&&typeof n==`string`){delete r[n];return}if(Array.isArray(t))return t});ci(n),Ot(n,lt(i,null,2)+`
19
+ `),We(),e===`localSettings`&&Xr($s(`localSettings`),Ke())}catch(e){let t=Error(`Failed to read raw settings from ${n}: ${e}`);return Ct(t),{error:t}}return{error:null}}function rc(e,t){return Kr([...e,...t])}function $(e,t){if(Array.isArray(e)&&Array.isArray(t))return rc(e,t)}function ic(e){let t=J().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 ac(){if(mc)return{settings:{},errors:[]};let e=Date.now();It(`loadSettingsFromDisk_start`),gt(`info`,`settings_load_started`),mc=!0;try{let t=xe(),n={};t&&(n=j(n,t,$));let r=[],i=new Set,a=new Set;for(let e of N()){if(e===`policySettings`){let e=null,t=[],a=Br();if(a&&Object.keys(a).length>0){let n=J().safeParse(a);n.success?e=n.data:t.push(...fs(n.error,`remote managed settings`))}if(!e){let n=Ns();Object.keys(n.settings).length>0&&(e=n.settings),t.push(...n.errors)}if(!e){let{settings:n,errors:r}=Ks();n&&(e=n),t.push(...r)}if(!e){let n=Ps();Object.keys(n.settings).length>0&&(e=n.settings),t.push(...n.errors)}e&&(n=j(n,e,$));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=Qs(e);if(t){let e=$t(t);if(!a.has(e)){a.add(e);let{settings:o,errors:s}=Z(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=j(n,o,$))}}if(e===`flagSettings`){let e=Ee();if(e){let t=J().safeParse(e);t.success&&(n=j(n,t.data,$))}}}return gt(`info`,`settings_load_completed`,{duration_ms:Date.now()-e,source_count:a.size,error_count:r.length}),{settings:n,errors:r}}finally{mc=!1}}function oc(){let{settings:e}=cc();return e||{}}function sc(){We();let e=[];for(let t of N()){let n=Q(t);n&&Object.keys(n).length>0&&e.push({source:t,settings:n})}return{effective:oc(),sources:e}}function cc(){let e=be();if(e!==null)return e;let t=ac();return It(`loadSettingsFromDisk_end`),Ae(t),t}function lc(){return!!(Q(`userSettings`)?.skipDangerousModePermissionPrompt||Q(`localSettings`)?.skipDangerousModePermissionPrompt||Q(`flagSettings`)?.skipDangerousModePermissionPrompt||Q(`policySettings`)?.skipDangerousModePermissionPrompt)}function uc(){return!0}function dc(){return Q(`policySettings`)?.useAutoModeDuringPlan!==!1&&Q(`flagSettings`)?.useAutoModeDuringPlan!==!1&&Q(`userSettings`)?.useAutoModeDuringPlan!==!1&&Q(`localSettings`)?.useAutoModeDuringPlan!==!1}function fc(){{let e=w({allow:S(h()).optional(),soft_deny:S(h()).optional(),deny:S(h()).optional(),environment:S(h()).optional()}),t=[],n=[],r=[];for(let i of[`userSettings`,`localSettings`,`flagSettings`,`policySettings`]){let a=Q(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 pc(e){for(let t of N()){if(t===`policySettings`)continue;let n=Qs(t);if(n)try{let{resolvedPath:t}=ht(T(),n),r=E(t);if(!r.trim())continue;let i=D(r,!1);if(i&&typeof i==`object`&&e in i)return!0}catch(e){Js(e,n)}}return!1}var mc,hc,gc=t((()=>{Pr(),C(),Be(),Ur(),qr(),pt(),vt(),ie(),dt(),At(),kt(),ft(),Zr(),Ft(),St(),Dt(),st(),Lt(),si(),di(),fi(),Ws(),je(),$o(),hs(),mc=!1,hc=oc}));export{oo as $,un as $n,I as $t,Qo as A,rr as An,Yi as At,Eo as B,jn as Bn,Bi as Bt,Ws as C,Ir as Cn,ia as Ct,Ds as D,Er as Dn,V as Dt,As as E,Dr as En,na as Et,Ko as F,Vn as Fn,Wi as Ft,xo as G,On as Gn,ji as Gt,yo as H,kn as Hn,Fi as Ht,So as I,Fn as In,Ri as It,po as J,mn as Jn,R as Jt,go as K,Sn as Kn,Ni as Kt,jo as L,In as Ln,Pi as Lt,$o as M,Kn as Mn,Ki as Mt,Go as N,qn as Nn,Hi as Nt,hs as O,gr as On,$i as Ot,Wo as P,Bn as Pn,Vi as Pt,ao as Q,ln as Qn,F as Qt,q as R,Nn as Rn,Ii as Rt,Ns as S,Ur as Sn,Ja as St,Fs as T,Fr as Tn,ea as Tt,vo as U,An as Un,Ai as Ut,K as V,Mn as Vn,Li as Vt,_o as W,Cn as Wn,Mi as Wt,uo as X,dn as Xn,bi as Xt,ho as Y,hn as Yn,xi as Yt,fo as Z,pn as Zn,ki as Zt,Z as _,qr as _n,ha as _t,tc as a,ai as an,no as at,Ms as b,Br as bn,La as bt,Q as c,ei as cn,io as ct,sc as d,si as dn,Ya as dt,fi as en,co as et,hc as f,ri as fn,H as ft,gc as g,Gr as gn,Oa as gt,lc as h,Jr as hn,qa as ht,ic as i,ii as in,ro as it,J as j,Xn as jn,Gi as jt,ps as k,mr as kn,Ji as kt,Xs as l,Qr as ln,Qa as lt,uc as m,Zr as mn,Ga as mt,oc as n,li as nn,lo as nt,$s as o,N as on,$a as ot,dc as p,ni as pn,Ha as pt,mo as q,xn as qn,Di as qt,qs as r,di as rn,eo as rt,Qs as s,ti as sn,to as st,fc as t,ui as tn,so as tt,cc as u,$r as un,Za as ut,pc as v,Wr as vn,G as vt,Is as w,Lr as wn,ra as wt,Ps as x,Rr as xn,Ra as xt,nc as y,Kr as yn,Ma as yt,To as z,Pn as zn,zi as zt};
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{A as t,C as n,O as r,t as i,w as a}from"./v4-jw6qOKwQ.js";import{en as o}from"./state-4KQ3kaqz.js";import{Za as s,tE as c}from"./loadAgentsDir-nzr38hai.js";import{U as l}from"./debug-IKW-jE7K.js";import{g as u}from"./settings-5PQdphqC.js";import{g as d}from"./config-C7YHKCPV.js";import{_ as f,j as p}from"./git-tyaWOgRL.js";import{n as m,t as h}from"./lazySchema-uxlVVNM1.js";import{u as g}from"./oauth-BqJqV-2M.js";import{Vt as _,mi as v}from"./model-DfFA3qMO.js";import"path";import"fs/promises";var y,b=e((()=>{i(),h(),y=m(()=>a({entries:r(t(),t())})),m(()=>a({userId:t(),version:n(),lastModified:t(),checksum:t(),content:y()}))})),x=e((()=>{o(),g(),_(),c(),d(),p(),l(),f(),v(),u(),s(),b()}));export{x as t};
@@ -0,0 +1,3 @@
1
+ import{l as e,o as t,s as n}from"./envUtils-DSxRz_kt.js";import{di as r,ui as i}from"./src-CDCSSo0U2.js";import{$n as a,Zn as o,en as s,ht as c,ot as l,vr as u,z as d}from"./state-4KQ3kaqz.js";import{Ay as f,Ci as p,Cy as m,Et as h,Gp as g,My as _,Pt as v,Qi as y,St as b,Sy as x,Wp as S,XT as ee,_S as te,aC as ne,bt as C,gS as w,hS as T,iC as E,jr as D,qi as O,tE as k,vn as A,yn as j,yt as M}from"./loadAgentsDir-nzr38hai.js";import{n as N,t as P}from"./cwd-BuJhkTrc.js";import{U as F,z as I}from"./debug-IKW-jE7K.js";import{Jt as L,Zt as R}from"./settings-5PQdphqC.js";import{c as z,g as B,o as V}from"./config-C7YHKCPV.js";import{M as H,_ as U,d as W,j as G,n as K,r as re}from"./git-tyaWOgRL.js";import{o as q,s as J}from"./log-B3eB4EFv.js";import{n as Y,r as X}from"./analytics-BotDBGh0.js";import{i as Z,n as ie}from"./startupProfiler-DxRQteII.js";import{Vt as ae,in as oe}from"./model-DfFA3qMO.js";import{_ as Q,y as se}from"./metadata-BRLJvh61.js";import{l as ce,u as le}from"./terminalSetup-C0PF87iu.js";import{c as ue,n as de}from"./releaseNotes-CbSktIJW.js";import{s as fe,u as pe}from"./logoV2Utils-RQ160dI2.js";import{c as $,t as me}from"./nativeInstaller-GcIk7G2Y.js";import{i as he,r as ge}from"./runtimeObserver-Ci-5gvYg.js";import{n as _e,r as ve}from"./sessionMemory-Bsg2unYX.js";import{t as ye}from"./sinks-GryGVRT8.js";r(),Y(),N(),ue(),S(),s(),y(),ve(),he(),ne(),le(),ae(),k(),B(),G(),R(),se(),t(),F(),U(),x(),w(),j(),q(),pe(),me(),_(),D(),ie(),h();async function be(t,r,s,h,_,y,x,S,ne){H(`info`,`setup_started`);let w=process.version.match(/^v(\d+)\./)?.[1];if((!w||parseInt(w,10)<18)&&(console.error(i.bold.red(`Error: Claude Code requires Node.js version 18 or higher.`)),process.exit(1)),x&&u(E(x)),n(),!d())try{let e=await ce();e.status===`restored`?console.log(i.yellow(`Detected an interrupted Terminal.app setup. Your original settings have been restored. You may need to restart Terminal.app for the changes to take effect.`)):e.status===`failed`&&console.error(i.red(`Failed to restore Terminal.app settings. Please manually restore your original settings with: defaults import com.apple.Terminal ${e.backupPath}.`))}catch(e){J(e)}g(t);let D=Date.now();if(T(),H(`info`,`setup_hooks_captured`,{duration_ms:Date.now()-D}),m(t),h){let e=A(),n=await W();!e&&!n&&(process.stderr.write(i.red(`Error: Can only use --worktree in a git repository, but ${i.bold(t)} is not a git repository. Configure a WorktreeCreate hook in settings.json to use --worktree with other VCS systems.\n`)),process.exit(1));let r=S?`pr-${S}`:_??f(),s;if(n){let e=K(P());e||(process.stderr.write(i.red(`Error: Could not determine the main git repository root.
2
+ `)),process.exit(1)),e!==(re(P())??P())&&(H(`info`,`worktree_resolved_to_main_repo`),process.chdir(e),g(e)),s=y?b(e,v(r)):void 0}else s=y?b(P(),v(r)):void 0;let l;try{l=await C(c(),r,s,S?{prNumber:S}:void 0)}catch(e){process.stderr.write(i.red(`Error creating worktree: ${I(e)}\n`)),process.exit(1)}if(X(`tengu_worktree_created`,{tmux_enabled:y}),y&&s){let e=await M(s,l.worktreePath);e.created?console.log(i.green(`Created tmux session: ${i.bold(s)}\nTo attach: ${i.bold(`tmux attach -t ${s}`)}`)):console.error(i.yellow(`Warning: Failed to create tmux session: ${e.error}`))}process.chdir(l.worktreePath),g(l.worktreePath),o(P()),a(P()),p(l),ee(),te()}H(`info`,`setup_background_jobs_starting`),n()||(_e(),ge()),$(),H(`info`,`setup_background_jobs_launched`),Z(`setup_before_prefetch`),H(`info`,`setup_prefetch_starting`);let k=d()&&e(process.env.CLAUDE_CODE_SYNC_PLUGIN_INSTALL)||n();if(k||O(l()),import(`./loadPluginHooks-z1-zvBLw.js`).then(e=>{k||(e.loadPluginHooks(),e.setupPluginHookHotReload())}),n()||(process.env.USER_TYPE===`ant`&&import(`./commitAttribution-Lb3qUlAR.js`).then(async e=>{if(await e.isInternalModelRepo()){let{clearSystemPromptSections:e}=await import(`./systemPromptSections-IePG5K8r.js`);e()}}),setImmediate(()=>{import(`./attributionHooks-CUAoGkU6.js`).then(({registerAttributionHooks:e})=>{e()})}),import(`./sessionFileAccessHooks-BhdOmW9o.js`).then(e=>e.registerSessionFileAccessHooks())),ye(),X(`tengu_started`,{}),oe(d()),Z(`setup_after_prefetch`),!n()){let{hasReleaseNotes:e}=await de(z().lastReleaseNotesSeen);e&&await fe()}if(r===`bypassPermissions`||s){if(process.platform!==`win32`&&typeof process.getuid==`function`&&process.getuid()===0&&process.env.IS_SANDBOX!==`1`&&!e(process.env.CLAUDE_CODE_BUBBLEWRAP))if(process.stdin.isTTY){console.error(i.bold.red(`WARNING: Running as root/sudo with bypass permissions mode is dangerous.`)),console.error(i.yellow(`Bypass mode skips ALL permission checks. Combined with root, any command (rm -rf /, chmod, dd) executes without review.`));let e=(await import(`readline`)).createInterface({input:process.stdin,output:process.stdout}),t=await new Promise(t=>{e.question(`
3
+ I understand the risks. Continue? [y/N] `,t)});e.close(),t.trim().toLowerCase()!==`y`&&(console.error(`Aborted.`),process.exit(1))}else console.error(`--dangerously-skip-permissions cannot be used with root/sudo privileges for security reasons`),process.exit(1);if(process.env.USER_TYPE===`ant`&&process.env.CLAUDE_CODE_ENTRYPOINT!==`local-agent`&&process.env.CLAUDE_CODE_ENTRYPOINT!==`claude-desktop`){let[e,t]=await Promise.all([Q.getIsDocker(),L.hasInternetAccess()]),n=Q.getIsBubblewrapSandbox(),r=process.env.IS_SANDBOX===`1`;(!(e||n||r)||t)&&(console.error(`--dangerously-skip-permissions can only be used in Docker/sandbox containers with no internet access but got Docker: ${e}, Bubblewrap: ${n}, IS_SANDBOX: ${r}, hasInternet: ${t}`),process.exit(1))}}let j=V();j.lastCost!==void 0&&j.lastDuration!==void 0&&X(`tengu_exit`,{last_session_cost:j.lastCost,last_session_api_duration:j.lastAPIDuration,last_session_tool_duration:j.lastToolDuration,last_session_duration:j.lastDuration,last_session_lines_added:j.lastLinesAdded,last_session_lines_removed:j.lastLinesRemoved,last_session_total_input_tokens:j.lastTotalInputTokens,last_session_total_output_tokens:j.lastTotalOutputTokens,last_session_total_cache_creation_input_tokens:j.lastTotalCacheCreationInputTokens,last_session_total_cache_read_input_tokens:j.lastTotalCacheReadInputTokens,last_session_fps_average:j.lastFpsAverage,last_session_fps_low_1_pct:j.lastFpsLow1Pct,last_session_id:j.lastSessionId,...j.lastSessionMetrics})}export{be as setup};
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{G as t,H as n,K as r,U as i,V as a}from"./loadAgentsDir-nzr38hai.js";import{vn as o}from"./prompt-Bef63FhB.js";function s(e){return e===`projectSettings`||e===`policySettings`||e===`command`}function c(e){return r(e)}function l(e,t,n){let r=c(t.source),i=c(n.source),a=t.ruleValue.toolName;return e===`deny`?`Remove the "${a}" deny rule from ${r}, or remove the specific allow rule from ${i}`:`Remove the "${a}" ask rule from ${r}, or remove the specific allow rule from ${i}`}function u(e,t,n){let{toolName:r,ruleContent:i}=e.ruleValue;if(i===void 0)return{shadowed:!1};let a=t.find(e=>e.ruleValue.toolName===r&&e.ruleValue.ruleContent===void 0);return!a||r===`Bash`&&n.sandboxAutoAllowEnabled&&!s(a.source)?{shadowed:!1}:{shadowed:!0,shadowedBy:a,shadowType:`ask`}}function d(e,t){let{toolName:n,ruleContent:r}=e.ruleValue;if(r===void 0)return{shadowed:!1};let i=t.find(e=>e.ruleValue.toolName===n&&e.ruleValue.ruleContent===void 0);return i?{shadowed:!0,shadowedBy:i,shadowType:`deny`}:{shadowed:!1}}function f(e,t){let r=[],o=a(e),s=n(e),f=i(e);for(let e of o){let n=d(e,f);if(n.shadowed){let t=c(n.shadowedBy.source);r.push({rule:e,reason:`Blocked by "${n.shadowedBy.ruleValue.toolName}" deny rule (from ${t})`,shadowedBy:n.shadowedBy,shadowType:`deny`,fix:l(`deny`,n.shadowedBy,e)});continue}let i=u(e,s,t);if(i.shadowed){let t=c(i.shadowedBy.source);r.push({rule:e,reason:`Shadowed by "${i.shadowedBy.ruleValue.toolName}" ask rule (from ${t})`,shadowedBy:i.shadowedBy,shadowType:`ask`,fix:l(`ask`,i.shadowedBy,e)})}}return r}var p=e((()=>{o(),t()}));export{p as n,f as t};
@@ -0,0 +1,4 @@
1
+ import{n as e,o as t,t as n}from"./rolldown-runtime-DaDcL9Zw.js";import{E as r,O as i}from"./debug-IKW-jE7K.js";import{o as a,s as o}from"./log-B3eB4EFv.js";var s=n(((e,t)=>{var n=[`||`,`&&`,`;;`,`|&`,`<(`,`<<<`,`>>`,`>&`,`<&`,`&`,`;`,`(`,`)`,`|`,`<`,`>`],r=/[\n\r\u2028\u2029]/,i=/[\s#!"$&'():;<=>@\\^`|]/g;t.exports=function(e){return e.map(function(e){if(e===``)return`''`;if(e&&typeof e==`object`){if(`op`in e&&e.op===`glob`){if(typeof e.pattern!=`string`)throw TypeError("glob token requires a string `pattern`");if(r.test(e.pattern))throw TypeError("glob `pattern` must not contain line terminators");return e.pattern.replace(i,`\\$&`)}if(`op`in e&&typeof e.op==`string`){if(n.indexOf(e.op)<0)throw TypeError("invalid `op` value: "+JSON.stringify(e.op));return e.op.replace(/[\s\S]/g,`\\$&`)}if(`comment`in e&&typeof e.comment==`string`){if(r.test(e.comment))throw TypeError("`comment` must not contain line terminators");return`#`+e.comment}throw TypeError(`unrecognized object token shape`)}return/["\s\\]/.test(e)&&!/'/.test(e)?`'`+e.replace(/(['])/g,`\\$1`)+`'`:/["'\s]/.test(e)?`"`+e.replace(/(["\\$`!])/g,`\\$1`)+`"`:String(e).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}~])/g,`$1\\$2`)}).join(` `)}})),c=n(((e,t)=>{for(var n=`(?:`+[`\\|\\|`,`\\&\\&`,`;;`,`\\|\\&`,`\\<\\(`,`\\<\\<\\<`,`>>`,`>\\&`,`<\\&`,`[&;()|<>]`].join(`|`)+`)`,r=RegExp(`^`+n+`$`),i=`|&;()<> \\t`,a=`'([^']*?)'`,o=`"((\\\\"|[^"])*?)"`,s=/^#$/,c=`'`,l=`"`,u=`$`,d=``,f=4294967296,p=0;p<4;p++)d+=(f*Math.random()).toString(16);var m=RegExp(`^`+d);function h(e,t){for(var n=t.lastIndex,r=[],i;i=t.exec(e);)r[r.length]=i,t.lastIndex===i.index&&(t.lastIndex+=1);return t.lastIndex=n,r}function g(e,t,n){var r=typeof e==`function`?e(n):e[n];return r===void 0&&n!=``?r=``:r===void 0&&(r=`$`),typeof r==`object`?t+d+JSON.stringify(r)+d:t+r}function _(e,t,d){d||(d={});var f=d.escape||`\\`,p=d.splitUnquoted===!0?`
2
+ `:typeof d.splitUnquoted==`string`?d.splitUnquoted:``,m=`(\\`+f+`['"`+i+`]|[^\\s'"`+i+`])+`,_=h(e,new RegExp([`(`+n+`)`,`(`+m+`|`+o+`|`+a+`)+`].join(`|`),`g`));if(_.length===0)return[];t||(t={});var v=!1;return _.map(function(n){var i=n[0];if(!i||v)return;if(r.test(i))return{op:i};var a=!1,o=!1,d=``,m=[],h=!1,_=null,y=!1,b;function x(){b+=1;var e,n,r=i.charAt(b);if(r===`{`){if(b+=1,i.charAt(b)===`}`)throw Error(`Bad substitution: `+i.slice(b-2,b+1));var a=1;for(e=b;a>0&&e<i.length;)i.charAt(e)===`{`&&i.charAt(e-1)===`$`?a+=1:i.charAt(e)===`}`&&--a,e+=1;if(a!==0)throw Error(`Bad substitution: `+i.slice(b));--e,n=i.slice(b,e),b=e}else if(/[*@#?$!_-]/.test(r))n=r,b+=1;else{var o=i.slice(b);e=o.match(/[^\w\d_]/),e?(n=o.slice(0,e.index),b+=e.index-1):(n=o,b=i.length)}return g(t,``,n)}function S(){if(_!==null){if(_===0)d!==``&&(m[m.length]=d,d=``);else{m[m.length]=d,d=``;for(var e=1;e<_;e+=1)m[m.length]=``}_=null}}for(b=0;b<i.length;b++){var C=i.charAt(b);if(p&&C!==u&&S(),y=y||!a&&(C===`*`||C===`?`),o)d+=C,o=!1;else if(a)C===a?a=!1:a==c?d+=C:C===f?(b+=1,C=i.charAt(b),C===l||C===f||C===u?d+=C:d+=f+C):C===u?d+=x():d+=C;else if(C===l||C===c)a=C,h=!0;else if(r.test(C))return{op:i};else if(s.test(C)){v=!0;var w={comment:e.slice(n.index+b+1)};return d.length?[d,w]:[w]}else if(C===f)o=!0;else if(C===u){var T=x();if(!p)d+=T;else for(var E=0;E<T.length;E+=1){var D=T.charAt(E);p.indexOf(D)<0?(S(),d+=D):_===null?_=D===` `||D===` `||D===`
3
+ `?0:1:D!==` `&&D!==` `&&D!==`
4
+ `&&(_+=1)}}else d+=C}if(y)return{op:`glob`,pattern:d};if(p){if(_!==null&&_>0){m[m.length]=d,d=``;for(var O=1;O<_;O+=1)m[m.length]=``}return(d!==``||h&&m.length===0)&&(m[m.length]=d),m}return d}).reduce(function(e,t){return t===void 0||[].concat(t).forEach(function(t){e[e.length]=t}),e},[])}t.exports=function(e,t,n){var r=_(e,t,n);return typeof t==`function`?r.reduce(function(e,t){if(typeof t==`object`)return e[e.length]=t,e;var n=t.split(RegExp(`(`+d+`.*?`+d+`)`,`g`));return n.length===1?(e[e.length]=n[0],e):(n.filter(Boolean).forEach(function(t){e[e.length]=m.test(t)?JSON.parse(t.split(d)[1]):t}),e)},[]):r}})),l=n((e=>{e.quote=s(),e.parse=c()}));function u(e,t){try{return{success:!0,tokens:(0,h.parse)(e,t)}}catch(e){return e instanceof Error&&o(e),{success:!1,error:e instanceof Error?e.message:`Unknown parse error`}}}function d(e){try{return{success:!0,quoted:(0,h.quote)(e.map((e,t)=>{if(e==null)return String(e);let n=typeof e;if(n===`string`)return e;if(n===`number`||n===`boolean`)return String(e);throw Error(n===`object`?`Cannot quote argument at index ${t}: object values are not supported`:n===`symbol`?`Cannot quote argument at index ${t}: symbol values are not supported`:n===`function`?`Cannot quote argument at index ${t}: function values are not supported`:`Cannot quote argument at index ${t}: unsupported type ${n}`)}))}}catch(e){return e instanceof Error&&o(e),{success:!1,error:e instanceof Error?e.message:`Unknown quote error`}}}function f(e,t){let n=!1,r=!1,i=0,a=0;for(let t=0;t<e.length;t++){let o=e[t];if(o===`\\`&&!n){t++;continue}o===`"`&&!n?(i++,r=!r):o===`'`&&!r&&(a++,n=!n)}if(i%2!=0||a%2!=0)return!0;for(let e of t)if(typeof e==`string`&&((e.match(/{/g)||[]).length!==(e.match(/}/g)||[]).length||(e.match(/\(/g)||[]).length!==(e.match(/\)/g)||[]).length||(e.match(/\[/g)||[]).length!==(e.match(/\]/g)||[]).length||(e.match(/(?<!\\)"/g)||[]).length%2!=0||(e.match(/(?<!\\)'/g)||[]).length%2!=0))return!0;return!1}function p(e){let t=!1,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(i===`\\`&&!t){r++;continue}if(i===`"`&&!t){n=!n;continue}if(i===`'`&&!n&&(t=!t,!t)){let t=0,n=r-1;for(;n>=0&&e[n]===`\\`;)t++,n--;if(t>0&&t%2==1||t>0&&t%2==0&&e.indexOf(`'`,r+1)!==-1)return!0}}return!1}function m(e){let t=d([...e]);if(t.success)return t.quoted;try{return(0,h.quote)(e.map(e=>{if(e==null)return String(e);let t=typeof e;return t===`string`||t===`number`||t===`boolean`?String(e):i(e)}))}catch(e){throw e instanceof Error&&o(e),Error(`Failed to quote shell arguments safely`)}}var h,g=e((()=>{h=t(l(),1),a(),r()}));export{u as a,m as i,p as n,l as o,g as r,f as t};
@@ -0,0 +1,20 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Al as t,Ml as n,So as r,To as i,zo as a}from"./loadAgentsDir-nzr38hai.js";import{P as o,U as s}from"./rcDebugLog-BUuD-X1D.js";function c(e){let t=[],n=e.matchAll(d);for(let e of n)e.index!==void 0&&t.push({word:e[0],start:e.index,end:e.index+e[0].length});return t}async function l({question:e,cacheSafeParams:t}){let i=await n({promptMessages:[r({content:`<system-reminder>This is a side question from the user. You must answer this question directly in a single response.
2
+
3
+ IMPORTANT CONTEXT:
4
+ - You are a separate, lightweight agent spawned to answer this one question
5
+ - The main agent is NOT interrupted - it continues working independently in the background
6
+ - You share the conversation context but are a completely separate instance
7
+ - Do NOT reference being interrupted or what you were "previously doing" - that framing is incorrect
8
+
9
+ CRITICAL CONSTRAINTS:
10
+ - You have NO tools available - you cannot read files, run commands, search, or take any actions
11
+ - This is a one-off response - there will be no follow-up turns
12
+ - You can ONLY provide information based on what you already know from the conversation context
13
+ - NEVER say things like "Let me try...", "I'll now...", "Let me check...", or promise to take any action
14
+ - If you don't know the answer, say so - do not offer to look it up or investigate
15
+
16
+ Simply answer the question with the information you have.</system-reminder>
17
+
18
+ ${e}`})],cacheSafeParams:t,canUseTool:async()=>({behavior:`deny`,message:`Side questions cannot use tools`,decisionReason:{type:`other`,reason:`side_question`}}),querySource:`side_question`,forkLabel:`side_question`,maxTurns:1,skipCacheWrite:!0});return{response:u(i.messages),usage:i.totalUsage}}function u(e){let t=e.flatMap(e=>e.type===`assistant`?e.message.content:[]);if(t.length>0){let e=i(t,`
19
+
20
+ `).trim();if(e)return e;let n=t.find(e=>e.type===`tool_use`);if(n)return`(The model tried to call ${`name`in n?n.name:`a tool`} instead of answering directly. Try rephrasing or ask in the main conversation.)`}let n=e.find(e=>e.type===`system`&&`subtype`in e&&e.subtype===`api_error`);return n?`(API error: ${s(n.error)})`:null}var d,f=e((()=>{o(),t(),a(),d=/^\/btw\b/gi}));export{f as n,l as r,c as t};