@readmagic/workmate 0.0.5 → 0.0.6

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 (346) hide show
  1. package/dist/chunks/{AddWorkspaceDirectory-DJRkEz7o.js → AddWorkspaceDirectory-ClHi-Dr6.js} +1 -1
  2. package/dist/chunks/{App-iJu5qyiF.js → App-BP06lHmf.js} +1 -1
  3. package/dist/chunks/{ApproveApiKey-CRejTHUw.js → ApproveApiKey-Bsy8kr2a.js} +1 -1
  4. package/dist/chunks/ApproveApiKey-a2ZonQ3n.js +1 -0
  5. package/dist/chunks/{AssistantSessionChooser-CBLQ1v-J.js → AssistantSessionChooser-CcocKoTJ.js} +1 -1
  6. package/dist/chunks/{BackgroundTasksDialog-CyoLEYWH.js → BackgroundTasksDialog-DNeBhGCf.js} +1 -1
  7. package/dist/chunks/{BypassPermissionsModeDialog-D1FCKVOi.js → BypassPermissionsModeDialog-BKj_3Idm.js} +1 -1
  8. package/dist/chunks/{ClaudeMdExternalIncludesDialog-CI0yF6sZ.js → ClaudeMdExternalIncludesDialog-BD-7yAZh.js} +1 -1
  9. package/dist/chunks/ClaudeMdExternalIncludesDialog-DFivNFuo.js +1 -0
  10. package/dist/chunks/ConsoleOAuthFlow-CS3zjEPF.js +1 -0
  11. package/dist/chunks/{DesktopHandoff-D1rrMxeP.js → DesktopHandoff-BmPmCfT3.js} +1 -1
  12. package/dist/chunks/{DiffDialog-BKcfKx7O.js → DiffDialog-C4XSSjvV.js} +1 -1
  13. package/dist/chunks/Doctor-BhD-ZzZm.js +1 -0
  14. package/dist/chunks/{Doctor-Yco1McrL.js → Doctor-DEQe2q16.js} +1 -1
  15. package/dist/chunks/{ExitFlow-D3csukbB.js → ExitFlow-BttnAv-O.js} +1 -1
  16. package/dist/chunks/{Feedback-bEUtrHia.js → Feedback-BaYA8-SU.js} +1 -1
  17. package/dist/chunks/Grove-BJziCbZH.js +11 -0
  18. package/dist/chunks/Grove-sWm-oLBf.js +1 -0
  19. package/dist/chunks/{HybridTransport-9fTBC2Pv.js → HybridTransport-B8V6O6rM.js} +1 -1
  20. package/dist/chunks/{InvalidConfigDialog-9M-1nfZ6.js → InvalidConfigDialog-CHzBSJDf.js} +1 -1
  21. package/dist/chunks/{InvalidSettingsDialog-B2F6pryH.js → InvalidSettingsDialog-BKenH3bD.js} +1 -1
  22. package/dist/chunks/{MCPConnectionManager-MWpKjeZT.js → MCPConnectionManager-CNh9dNlk.js} +1 -1
  23. package/dist/chunks/{McpParsingWarnings-BPBb7Npe.js → McpParsingWarnings-Bj2-YL8o.js} +1 -1
  24. package/dist/chunks/{MessageSelector-DsQmqFt2.js → MessageSelector-DdR6wJhh.js} +1 -1
  25. package/dist/chunks/{Messages-B3sGRx5A.js → Messages-Ch6cboMV.js} +2 -2
  26. package/dist/chunks/{Onboarding-cHcnsBGp.js → Onboarding-BrAJp0aL.js} +1 -1
  27. package/dist/chunks/{OverageCreditUpsell-CWCD_RpM.js → OverageCreditUpsell-Ds1cB7RC.js} +1 -1
  28. package/dist/chunks/PluginSettings-CGqEzejq.js +17 -0
  29. package/dist/chunks/{PromptInputFooterSuggestions-D5sAO6y-.js → PromptInputFooterSuggestions-egs9VvUs.js} +1 -1
  30. package/dist/chunks/{PromptInputHelpMenu-n6hAdsto.js → PromptInputHelpMenu-SieM5NoY.js} +1 -1
  31. package/dist/chunks/{QueryEngine-cwdsr4dr.js → QueryEngine-CZZMl3PB.js} +1 -1
  32. package/dist/chunks/{REPL-CJzScgbZ.js → REPL-CG2N7E4Q.js} +6 -6
  33. package/dist/chunks/REPL-DvA910N_.js +1 -0
  34. package/dist/chunks/{RemoteCallout-CiA4rCEs.js → RemoteCallout-Cs-ro8_i.js} +1 -1
  35. package/dist/chunks/{RemoteSessionManager-zdHfmvfj.js → RemoteSessionManager-B740Dp6m.js} +1 -1
  36. package/dist/chunks/{ResumeConversation-Rxwd6HAJ.js → ResumeConversation-DzV2zmuX.js} +1 -1
  37. package/dist/chunks/{SSETransport-BPbhCa2f.js → SSETransport-DtpMDekF.js} +1 -1
  38. package/dist/chunks/SearchExtraToolsTool-C4uO-Zx3.js +1 -0
  39. package/dist/chunks/{Settings-CxI_KHUj.js → Settings-XKw6FI_m.js} +2 -2
  40. package/dist/chunks/{TeleportProgress-DrulEQ7z.js → TeleportProgress-rYaHIEfe.js} +1 -1
  41. package/dist/chunks/{TeleportRepoMismatchDialog-D3FOLr0P.js → TeleportRepoMismatchDialog-DY97YZMB.js} +1 -1
  42. package/dist/chunks/{TeleportResumeWrapper-DI5iRFND.js → TeleportResumeWrapper-jaQzyTCh.js} +1 -1
  43. package/dist/chunks/{ThemePicker-CQ7dfFtv.js → ThemePicker-BViWzLp3.js} +1 -1
  44. package/dist/chunks/{TrustDialog-CnVKrdxQ.js → TrustDialog-DGJ_BisZ.js} +1 -1
  45. package/dist/chunks/{ValidationErrorsList-CPYeuppg.js → ValidationErrorsList-B8pRiGuy.js} +1 -1
  46. package/dist/chunks/{WelcomeV2-C-UXdIng.js → WelcomeV2-DqnbSdIu.js} +1 -1
  47. package/dist/chunks/{add-dir-xTz4COgn.js → add-dir-C2Hu3oE4.js} +1 -1
  48. package/dist/chunks/{agentDisplay-BuSReYxu.js → agentDisplay-XoDJhr03.js} +1 -1
  49. package/dist/chunks/{agents-Du9KYHqN.js → agents-BIHTGDYh.js} +1 -1
  50. package/dist/chunks/{agents-CiLlKN2I.js → agents-C4QXeHIJ.js} +1 -1
  51. package/dist/chunks/{allErrors-P3utlEeA.js → allErrors-1896uQA1.js} +1 -1
  52. package/dist/chunks/{ant-CBIfqmAb.js → ant-B6k6cBts.js} +1 -1
  53. package/dist/chunks/api-BsFW57_Q.js +1 -0
  54. package/dist/chunks/{api-B-5jqiMg.js → api-gqTA-D7n.js} +1 -1
  55. package/dist/chunks/{assistant-XOnU01yl.js → assistant-DJ9hd4uC.js} +1 -1
  56. package/dist/chunks/auth-8Vd3_U8t.js +1 -0
  57. package/dist/chunks/{auth-DT2yxy94.js → auth-BnSrKyJe.js} +1 -1
  58. package/dist/chunks/auth-DRTjfnGy.js +1 -0
  59. package/dist/chunks/{autoMode-CEMflt3g.js → autoMode-BNukrVAB.js} +1 -1
  60. package/dist/chunks/{autonomy-_N8aDaA8.js → autonomy-BEmI7WVW.js} +1 -1
  61. package/dist/chunks/{autonomy-Cg5zweUa.js → autonomy-DGcy5Rml.js} +1 -1
  62. package/dist/chunks/{autonomyPanel-I4yCy3Fr.js → autonomyPanel-fhge09AG.js} +1 -1
  63. package/dist/chunks/backgroundHousekeeping-3i_d_WW5.js +1 -0
  64. package/dist/chunks/{backgroundHousekeeping-DhF2lrQ9.js → backgroundHousekeeping-BVMf_Tjn.js} +2 -2
  65. package/dist/chunks/{branch-BIX-pyHp.js → branch-Bpe-gocq.js} +1 -1
  66. package/dist/chunks/{break-cache-BQfgkNAo.js → break-cache-C_p7Kmx2.js} +3 -3
  67. package/dist/chunks/{bridge-CYskzVt8.js → bridge-D12Shbkj.js} +2 -2
  68. package/dist/chunks/{bridgeConfig-5p_w4s5r.js → bridgeConfig-BhxRF2vm.js} +1 -1
  69. package/dist/chunks/bridgeConfig-CqIQ_rvD.js +1 -0
  70. package/dist/chunks/bridgeEnabled-D0XC5kNh.js +1 -0
  71. package/dist/chunks/{bridgeEnabled-DhFrLTbG.js → bridgeEnabled-SbB-6zdY.js} +1 -1
  72. package/dist/chunks/{bridgeMain-BX2AkLPs.js → bridgeMain-DHUpZFgL.js} +6 -6
  73. package/dist/chunks/bridgeMain-DUbQjgCp.js +1 -0
  74. package/dist/chunks/{bridgeMessaging-B5Lbzr8e.js → bridgeMessaging-DHc5dOhB.js} +1 -1
  75. package/dist/chunks/{btw-CWWFO7u8.js → btw-D9hMM5d2.js} +1 -1
  76. package/dist/chunks/caches-CWzT7e6Y.js +1 -0
  77. package/dist/chunks/{caches-DPqPIogk.js → caches-UeVVM3T0.js} +2 -2
  78. package/dist/chunks/{ccrClient-CTLnU9Y1.js → ccrClient-Iza0L8Zw.js} +1 -1
  79. package/dist/chunks/{clear-DCAgZwc4.js → clear-B4d38ssF.js} +1 -1
  80. package/dist/chunks/client-BzKQTXzF.js +1 -0
  81. package/dist/chunks/{color-CmJGInHL.js → color-D8VOyoYl.js} +1 -1
  82. package/dist/chunks/commands-DDamMmo4.js +1 -0
  83. package/dist/chunks/commitAttribution-CgohL8vD.js +1 -0
  84. package/dist/chunks/{commitAttribution-CGZr7XNO.js → commitAttribution-ChAgixdj.js} +1 -1
  85. package/dist/chunks/{compact-C6-lMHgn.js → compact-IFHwxjZ9.js} +1 -1
  86. package/dist/chunks/config-DY5-_kk_.js +1 -0
  87. package/dist/chunks/{config-3m_9zSrj.js → config-DmomySWC.js} +1 -1
  88. package/dist/chunks/config-WxgxrQoP.js +1 -0
  89. package/dist/chunks/{context-C9V4GF0n.js → context-Cl6BJ2vm.js} +1 -1
  90. package/dist/chunks/{context-noninteractive-BmC4o5xo.js → context-noninteractive-9hELVC29.js} +1 -1
  91. package/dist/chunks/context-noninteractive-Beij5MfU.js +1 -0
  92. package/dist/chunks/conversation-BBB91hEw.js +1 -0
  93. package/dist/chunks/{conversation-CYqqk0o7.js → conversation-BWVTM40Y.js} +1 -1
  94. package/dist/chunks/{createSSHSession-BL6j0AU5.js → createSSHSession-BM-5pbv6.js} +1 -1
  95. package/dist/chunks/createSession-CoQtL5Rj.js +1 -0
  96. package/dist/chunks/{createSession-D_sgO1Xy.js → createSession-Cvl1Q50F.js} +1 -1
  97. package/dist/chunks/{crossProjectResume-D5hTOfnE.js → crossProjectResume-BasMLl2n.js} +1 -1
  98. package/dist/chunks/{datadog-UkGdjL8-.js → datadog-CpqEQbHa.js} +1 -1
  99. package/dist/chunks/{desktop-HbYKh-VK.js → desktop-B_L6T6jI.js} +1 -1
  100. package/dist/chunks/{diff-nTV17iWX.js → diff-CVzOodeg.js} +1 -1
  101. package/dist/chunks/doctor-1L0TFuGw.js +1 -0
  102. package/dist/chunks/{entry-CCFI6-gM.js → entry-DHVYCR26.js} +1 -1
  103. package/dist/chunks/envLessBridgeConfig-CN0_44-p.js +1 -0
  104. package/dist/chunks/{envLessBridgeConfig-DXd10GXD.js → envLessBridgeConfig-Ck2-KMq0.js} +1 -1
  105. package/dist/chunks/{esm-CGoYrggU.js → esm-D5q6s4l8.js} +1 -1
  106. package/dist/chunks/{exit-ropaQiOr.js → exit-Bm1S_f3i.js} +1 -1
  107. package/dist/chunks/extra-usage-UHAWtypK.js +1 -0
  108. package/dist/chunks/{extra-usage-core-DLYHAInT.js → extra-usage-core-BFOolqoi.js} +1 -1
  109. package/dist/chunks/{extra-usage-noninteractive-D8iszH3c.js → extra-usage-noninteractive-cUGZy0en.js} +1 -1
  110. package/dist/chunks/{extra-usage-g2Pw4zt_.js → extra-usage-zDHVtWKZ.js} +1 -1
  111. package/dist/chunks/{extraUsage-C2Ylufhj.js → extraUsage-Dq66zzqR.js} +1 -1
  112. package/dist/chunks/extractMemories-BcaklA33.js +1 -0
  113. package/dist/chunks/fast-DALAHO3d.js +1 -0
  114. package/dist/chunks/{fast-Dx2fTmWr.js → fast-MS7WZpD8.js} +1 -1
  115. package/dist/chunks/{feedback-DCQ4pJ3v.js → feedback-Fw4m28ZC.js} +1 -1
  116. package/dist/chunks/firstPartyEventLogger-CS9jVz6D.js +1 -0
  117. package/dist/chunks/{firstPartyEventLogger-BNGPPBNP.js → firstPartyEventLogger-CoSUd0a1.js} +2 -2
  118. package/dist/chunks/{flushGate-XaheIZZT.js → flushGate-De-yppeo.js} +1 -1
  119. package/dist/chunks/{gemini-BCCLHK3K.js → gemini-BPziscyN.js} +1 -1
  120. package/dist/chunks/{generateRecap-BhvbixY2.js → generateRecap-jGDLI_wU.js} +1 -1
  121. package/dist/chunks/{generateSessionName-CN1oh7Fa.js → generateSessionName-hDJ6HBJ1.js} +1 -1
  122. package/dist/chunks/{githubRepoPathMapping-B4AM8luI.js → githubRepoPathMapping-qAoiyj6P.js} +1 -1
  123. package/dist/chunks/{goal-Bp6fyGqo.js → goal-CFx4eRkf.js} +1 -1
  124. package/dist/chunks/{grok-ax26ju8y.js → grok-Byblph7F.js} +1 -1
  125. package/dist/chunks/{grove-DrBVaZSN.js → grove-CpqjcGCb.js} +1 -1
  126. package/dist/chunks/{heapdump-JseysNDr.js → heapdump-C4kPlqGt.js} +1 -1
  127. package/dist/chunks/{help-DR9hKneR.js → help-B1h-faJ3.js} +1 -1
  128. package/dist/chunks/hooks-DPLIIpAD.js +1 -0
  129. package/dist/chunks/{hooks-C5n23H1E.js → hooks-X6J03MnA.js} +1 -1
  130. package/dist/chunks/hostGuard-BHI6Q8Mt.js +1 -0
  131. package/dist/chunks/inboundAttachments-BekVc0W-.js +1 -0
  132. package/dist/chunks/{inboundAttachments-Cp8XvLMZ.js → inboundAttachments-CUJE3KaU.js} +1 -1
  133. package/dist/chunks/{initReplBridge-DJs28ZkI.js → initReplBridge-JQ-afRx9.js} +1 -1
  134. package/dist/chunks/{install-C7qTB0V5.js → install-D5YORIJL.js} +1 -1
  135. package/dist/chunks/{instrumentation-CLZttr_u.js → instrumentation-Bw3CxPQf.js} +3 -3
  136. package/dist/chunks/{job-BhiazwPH.js → job-DOWtcltx.js} +1 -1
  137. package/dist/chunks/{keybindings-CkL8BzUt.js → keybindings-BLw5J-Zj.js} +1 -1
  138. package/dist/chunks/{language-DIw2871r.js → language-C6Fq-XOZ.js} +1 -1
  139. package/dist/chunks/language-Cqw5gYJR.js +1 -0
  140. package/dist/chunks/{launchAgentsPlatform-j-mWpwW1.js → launchAgentsPlatform-jWWf-Lk9.js} +1 -1
  141. package/dist/chunks/{launchLocalMemory-DmoXp0Xo.js → launchLocalMemory-kHeD0I0y.js} +1 -1
  142. package/dist/chunks/{launchLocalVault-1uKe0HjA.js → launchLocalVault-DLqkOjmb.js} +1 -1
  143. package/dist/chunks/{launchMemoryStores-SxDKjHJ3.js → launchMemoryStores-Ct7AVXrO.js} +1 -1
  144. package/dist/chunks/{launchOnboarding-CTtpnXcs.js → launchOnboarding-Cc6WwPX9.js} +1 -1
  145. package/dist/chunks/{launchSchedule-BDVnGhaL.js → launchSchedule-ZyvuvjgU.js} +1 -1
  146. package/dist/chunks/{launchSkillStore-SmMLxp4K.js → launchSkillStore-BejQnLog.js} +1 -1
  147. package/dist/chunks/{launchTeleport-B472ZSGz.js → launchTeleport-8CuYUfIR.js} +1 -1
  148. package/dist/chunks/{launchVault-CsyBgxle.js → launchVault-DIvIOuPh.js} +1 -1
  149. package/dist/chunks/{loadAgentsDir-Clu7Uk6a.js → loadAgentsDir-D206qwP3.js} +47 -47
  150. package/dist/chunks/loadAgentsDir-TZjwTqdr.js +1 -0
  151. package/dist/chunks/{loadPluginHooks-Cvd5VdjQ.js → loadPluginHooks-Ddhsyn0_.js} +1 -1
  152. package/dist/chunks/{localSearch-iA6JTk19.js → localSearch-CzrbOklu.js} +1 -1
  153. package/dist/chunks/localSearch-DrOAL6f4.js +1 -0
  154. package/dist/chunks/{logoV2Utils-YHBJLIrC.js → logoV2Utils-8M56V7oN.js} +1 -1
  155. package/dist/chunks/{magicDocs-Bf1fqnHN.js → magicDocs-DWjL2k7P.js} +1 -1
  156. package/dist/chunks/{main-gtV_TqXP.js → main-BohPzJFF.js} +16 -16
  157. package/dist/chunks/{mappers-C8lYERPX.js → mappers-BDMZFgKx.js} +1 -1
  158. package/dist/chunks/{mcp-Ci0OPVrR.js → mcp-Bt1ITh-Z.js} +1 -1
  159. package/dist/chunks/{mcp-CNuhEGP6.js → mcp-CwJ-AIpt.js} +2 -2
  160. package/dist/chunks/{mcp-CwIYauZl.js → mcp-W0LFoyFR.js} +1 -1
  161. package/dist/chunks/{memory-DCGqfQ1U.js → memory-3wV7m7UU.js} +1 -1
  162. package/dist/chunks/{mode-DO6g7nkX.js → mode-CUkHFkju.js} +1 -1
  163. package/dist/chunks/{model-DLXL0CNu.js → model-BY3auM2c.js} +1 -1
  164. package/dist/chunks/model-CKkOnnnx.js +1 -0
  165. package/dist/chunks/model-DRXcJyU9.js +1 -0
  166. package/dist/chunks/{nativeInstaller-OPuO2sm_.js → nativeInstaller-CA5d6_G7.js} +1 -1
  167. package/dist/chunks/{onChangeAppState-CHhRDkM7.js → onChangeAppState-DBmy2Ow_.js} +1 -1
  168. package/dist/chunks/{openai-HOebt-8k.js → openai-Cbomn0Ws.js} +1 -1
  169. package/dist/chunks/{overageCreditGrant-Bi1CTBAx.js → overageCreditGrant-DsUrmeBh.js} +1 -1
  170. package/dist/chunks/{panel-CrTPqXCv.js → panel-BSZGX6jN.js} +1 -1
  171. package/dist/chunks/{panelCall-D0eURklm.js → panelCall-BsVoL1uF.js} +1 -1
  172. package/dist/chunks/{partition-C8RSL3SQ.js → partition-BAakXjvj.js} +1 -1
  173. package/dist/chunks/{passes-BJci5SM_.js → passes-CLRt7Cvm.js} +1 -1
  174. package/dist/chunks/{permissions-JU9CGHgI.js → permissions-BVSFuwNP.js} +1 -1
  175. package/dist/chunks/{pidLock-Bd2e6xuT.js → pidLock-D5rUnDB-.js} +2 -2
  176. package/dist/chunks/{plan-D4gMsK7i.js → plan-SYZ4DXR8.js} +1 -1
  177. package/dist/chunks/{plugin-CwCo5Kik.js → plugin-Bfjzhmrk.js} +1 -1
  178. package/dist/chunks/{pluginAutoupdate-CO-n9bqe.js → pluginAutoupdate-reO2PgtQ.js} +1 -1
  179. package/dist/chunks/{pluginBlocklist-5qbaTRbV.js → pluginBlocklist-C3H2afWG.js} +1 -1
  180. package/dist/chunks/{pluginCliCommands-I-lsw_us.js → pluginCliCommands-lqdxdkQp.js} +1 -1
  181. package/dist/chunks/{pluginFlagging-DNPBbJZo.js → pluginFlagging-D9HKAGBC.js} +1 -1
  182. package/dist/chunks/{pluginOperations-Cz6eQ0Vu.js → pluginOperations-EN3EKLux.js} +1 -1
  183. package/dist/chunks/{pluginStartupCheck-DJ9fslCK.js → pluginStartupCheck-BY73BMT2.js} +1 -1
  184. package/dist/chunks/pluginStartupCheck-CwWOlveD.js +1 -0
  185. package/dist/chunks/{plugins-CzJIuPfb.js → plugins-Dn6ceWrT.js} +1 -1
  186. package/dist/chunks/policyLimits-CkTI5KEt.js +1 -0
  187. package/dist/chunks/{poor-Dha9p9RF.js → poor-j-y-bv8o.js} +1 -1
  188. package/dist/chunks/{poorMode-1NLYiS3Y.js → poorMode-DhzFKpPl.js} +1 -1
  189. package/dist/chunks/poorMode-V11s-3cf.js +1 -0
  190. package/dist/chunks/{print-BL4EUT5Z.js → print-Db_VXmfO.js} +4 -4
  191. package/dist/chunks/{privacy-settings-6ZWxR4Qt.js → privacy-settings-DHMJREbb.js} +1 -1
  192. package/dist/chunks/{processBashCommand-BZs9wggV.js → processBashCommand-BcM_fhV9.js} +1 -1
  193. package/dist/chunks/{processSlashCommand-D8lKLNzM.js → processSlashCommand-DEVo3GPX.js} +1 -1
  194. package/dist/chunks/{prompt-Bg_1U0gO.js → prompt-BNHtszmZ.js} +1 -1
  195. package/dist/chunks/prompt-CrX31AGm.js +1 -0
  196. package/dist/chunks/prompt-IAvMxKDl.js +1 -0
  197. package/dist/chunks/{promptEditor-BhYDmwdS.js → promptEditor-DeMrXUir.js} +1 -1
  198. package/dist/chunks/{protocolHandler-Dnb7lITm.js → protocolHandler-BHxBy84Z.js} +1 -1
  199. package/dist/chunks/{rate-limit-options-DVzT3eWH.js → rate-limit-options-DIudL9fb.js} +1 -1
  200. package/dist/chunks/{rcDebugLog-VKwMl0yg.js → rcDebugLog-CUy1_F23.js} +1 -1
  201. package/dist/chunks/{reconciler-BdRXZTJf.js → reconciler-BXpPyfSY.js} +1 -1
  202. package/dist/chunks/{referral-BlrMpBAV.js → referral-CUaIo_vT.js} +1 -1
  203. package/dist/chunks/{refresh-jwqnoK2h.js → refresh-CuaVBIQ0.js} +1 -1
  204. package/dist/chunks/{registerProtocol-CuKZAiCc.js → registerProtocol-B7Fzdofu.js} +1 -1
  205. package/dist/chunks/{release-notes-BgP8u7NE.js → release-notes-fbfv2DC0.js} +1 -1
  206. package/dist/chunks/{releaseNotes-CunqVlbU.js → releaseNotes-CxAHFLPl.js} +2 -2
  207. package/dist/chunks/{reload-plugins-CD9TzvFm.js → reload-plugins-B9IT9CFA.js} +1 -1
  208. package/dist/chunks/{remote-env-QaP_W_sv.js → remote-env-BOklGlll.js} +1 -1
  209. package/dist/chunks/{remoteBridgeCore-9-HVMo63.js → remoteBridgeCore-j0bG1zjv.js} +1 -1
  210. package/dist/chunks/{remoteManagedSettings-jZ6u8ZBT.js → remoteManagedSettings-Cq994lyc.js} +1 -1
  211. package/dist/chunks/{rename-29qxHf8W.js → rename-Iev7wQsI.js} +1 -1
  212. package/dist/chunks/{resume-D-SpOy_1.js → resume-y7MCTZHJ.js} +1 -1
  213. package/dist/chunks/{runtimeObserver-DOEcrylu.js → runtimeObserver-BZcJ1FbH.js} +1 -1
  214. package/dist/chunks/{runtimeObserver-Dm3LIUMp.js → runtimeObserver-CyzLASla.js} +2 -2
  215. package/dist/chunks/sandbox-adapter-Cu1FYrkh.js +1 -0
  216. package/dist/chunks/{sandbox-toggle-B61AeBor.js → sandbox-toggle-CWpBO228.js} +1 -1
  217. package/dist/chunks/searchExtraTools-BUOUds7p.js +1 -0
  218. package/dist/chunks/{session-RwJCIIcs.js → session-DL4cA_8l.js} +1 -1
  219. package/dist/chunks/{sessionDiscovery-dkFeWcA3.js → sessionDiscovery-DAfNKqp1.js} +1 -1
  220. package/dist/chunks/sessionFileAccessHooks-2cgIIxPk.js +1 -0
  221. package/dist/chunks/{sessionMemory-btARBn8H.js → sessionMemory-BS8_TbKj.js} +1 -1
  222. package/dist/chunks/sessionMemory-D5fSHXvZ.js +1 -0
  223. package/dist/chunks/sessionMemoryUtils-BWUztNh6.js +1 -0
  224. package/dist/chunks/sessionObserver-ChfQtK2m.js +1 -0
  225. package/dist/chunks/{sessionObserver-CSOYgsvH.js → sessionObserver-ShbCwJ8x.js} +1 -1
  226. package/dist/chunks/sessionStorage-Cf5wmnyB.js +1 -0
  227. package/dist/chunks/{sessionTitle-CLOlPZ_M.js → sessionTitle-coed9IuJ.js} +1 -1
  228. package/dist/chunks/{sessionTracing-D8wr9j4X.js → sessionTracing-D9rUyiq0.js} +1 -1
  229. package/dist/chunks/{settings-Dlp5JTa_.js → settings-BovzmwMP.js} +2 -2
  230. package/dist/chunks/{settingsSync-QWA0VZSu.js → settingsSync-PqU9XGJq.js} +1 -1
  231. package/dist/chunks/{setup-UI9uv2-K.js → setup-B_FOvNpp.js} +2 -2
  232. package/dist/chunks/{shadowedRuleDetection-CXsmUY2o.js → shadowedRuleDetection-D1wsAdpp.js} +1 -1
  233. package/dist/chunks/{sideQuestion-CHpOVzY5.js → sideQuestion-wSi38p81.js} +1 -1
  234. package/dist/chunks/sinks-BpcRrN_T.js +1 -0
  235. package/dist/chunks/{sinks-1hFrW9HK.js → sinks-C_Dl1p4K.js} +2 -2
  236. package/dist/chunks/{skill-learning-Ck17rwH8.js → skill-learning-B5tmc7EX.js} +1 -1
  237. package/dist/chunks/{skillChangeDetector-s0F9Yf9a.js → skillChangeDetector-DNqohXxz.js} +1 -1
  238. package/dist/chunks/{skillGapStore-BJ1h2LVr.js → skillGapStore-D-kQKVDZ.js} +1 -1
  239. package/dist/chunks/{skillGapStore-DyqNKuNy.js → skillGapStore-Df5BWAk5.js} +2 -2
  240. package/dist/chunks/{skillGenerator-BT8NGzXT.js → skillGenerator-DbcdpAkw.js} +2 -2
  241. package/dist/chunks/skillLearning-C5cXZE6_.js +1 -0
  242. package/dist/chunks/{skillLearning-Cn9Uw0Kd.js → skillLearning-ClRiDcJH.js} +1 -1
  243. package/dist/chunks/{skillPanel-N0GoWjIi.js → skillPanel-LBd4E-MM.js} +3 -3
  244. package/dist/chunks/{skillSearchPanel-CTwtgTzy.js → skillSearchPanel-CErRnUwo.js} +2 -2
  245. package/dist/chunks/{skills-Bv3lH-aA.js → skills-CBKhfg_a.js} +1 -1
  246. package/dist/chunks/{stats-C1Ff6w4i.js → stats-BY4dskVg.js} +1 -1
  247. package/dist/chunks/{status-DyXiBa0m.js → status-BnJIXtKl.js} +2 -2
  248. package/dist/chunks/{status-FD7HVYS7.js → status-DU-B4SMW.js} +1 -1
  249. package/dist/chunks/{statusNoticeHelpers-kTp9Rdk6.js → statusNoticeHelpers-CzTuGNuC.js} +1 -1
  250. package/dist/chunks/{tag-RzOSA5T0.js → tag-B-wVW9Aj.js} +1 -1
  251. package/dist/chunks/{tasks-eJrOcdhB.js → tasks-CBVL005y.js} +1 -1
  252. package/dist/chunks/{teleport-ABA-hdmP.js → teleport-dtqQXM4x.js} +1 -1
  253. package/dist/chunks/{templateJobs-BnOBSFtq.js → templateJobs-D6998LcG.js} +1 -1
  254. package/dist/chunks/{terminalSetup-BfvmoJaK.js → terminalSetup-0SBdyKF5.js} +1 -1
  255. package/dist/chunks/{terminalSetup-D_P5iZmq.js → terminalSetup-CuV-qU6v.js} +1 -1
  256. package/dist/chunks/{theme-S0kVMVt4.js → theme-p0AooruD.js} +1 -1
  257. package/dist/chunks/thinkback-Catprqs_.js +1 -0
  258. package/dist/chunks/{thinkback-HyW_R_88.js → thinkback-DI2NpvG-.js} +1 -1
  259. package/dist/chunks/{thinkback-play-H6md4czq.js → thinkback-play-CqrIRx2o.js} +1 -1
  260. package/dist/chunks/{toolEventObserver-BAFzvePj.js → toolEventObserver-DTccwC3c.js} +1 -1
  261. package/dist/chunks/{toolEventObserver--Z6jENks.js → toolEventObserver-DlH73w-S.js} +1 -1
  262. package/dist/chunks/{toolPool-CR61XXm3.js → toolPool-B64V-jmK.js} +1 -1
  263. package/dist/chunks/{trustedDevice-Dn4rXbxT.js → trustedDevice-BTYoQCkC.js} +1 -1
  264. package/dist/chunks/trustedDevice-CiwjT_Y6.js +1 -0
  265. package/dist/chunks/{ultrareviewCommand-mYDTBCFD.js → ultrareviewCommand-BDFUS3hf.js} +1 -1
  266. package/dist/chunks/undercover-XYapZ_SS.js +1 -0
  267. package/dist/chunks/{undercover-CdapzvNH.js → undercover-vuTpCnQJ.js} +2 -2
  268. package/dist/chunks/{updateCCB-DPShheOr.js → updateCCB-DFL5Wt_I.js} +1 -1
  269. package/dist/chunks/{upgrade-BOeakAP6.js → upgrade-D5qwcaWQ.js} +1 -1
  270. package/dist/chunks/upgrade-DIg3j929.js +1 -0
  271. package/dist/chunks/{upload-BXQsDtLW.js → upload-B_yADHX9.js} +1 -1
  272. package/dist/chunks/{usage-iNQzY960.js → usage-C0SnnC-i.js} +1 -1
  273. package/dist/chunks/usage-CYJKE8N6.js +1 -0
  274. package/dist/chunks/{useExitOnCtrlCDWithKeybindings-CntByfTQ.js → useExitOnCtrlCDWithKeybindings-DKIqRraH.js} +1 -1
  275. package/dist/chunks/useMainLoopModel-XetDUXd-.js +1 -0
  276. package/dist/chunks/{useManagePlugins-B8HD0RUh.js → useManagePlugins-B2KhKiu5.js} +1 -1
  277. package/dist/chunks/{useMergedTools-DfchLQZC.js → useMergedTools-CKvwz_Zt.js} +1 -1
  278. package/dist/chunks/{useSearchInput-H-8hJeFD.js → useSearchInput-D1Vr2Js1.js} +1 -1
  279. package/dist/chunks/{useSettingsErrors-BF5i5Xju.js → useSettingsErrors-B7BXHchG.js} +1 -1
  280. package/dist/chunks/{util-CoicMvOv.js → util-BaDs-wL5.js} +1 -1
  281. package/dist/chunks/{validatePlugin-z2fcngf8.js → validatePlugin-DtiYlXby.js} +1 -1
  282. package/dist/chunks/{vim-DdvQlLDm.js → vim-C-icQDz1.js} +1 -1
  283. package/dist/chunks/{workerRegistry-CzqQwCHC.js → workerRegistry-ChqPPIaO.js} +1 -1
  284. package/dist/chunks/worktree-DAn8ooa1.js +1 -0
  285. package/dist/cli.js +1 -1
  286. package/package.json +1 -1
  287. package/dist/chunks/ApproveApiKey-CKfn7U1R.js +0 -1
  288. package/dist/chunks/ClaudeMdExternalIncludesDialog-TypH-X8e.js +0 -1
  289. package/dist/chunks/ConsoleOAuthFlow-wGQuFt41.js +0 -1
  290. package/dist/chunks/Doctor-CcJUwSQn.js +0 -1
  291. package/dist/chunks/Grove-DPkIjqg8.js +0 -1
  292. package/dist/chunks/Grove-Dsd7F39b.js +0 -11
  293. package/dist/chunks/PluginSettings-B0jbwB2M.js +0 -17
  294. package/dist/chunks/REPL-DlBJIPCw.js +0 -1
  295. package/dist/chunks/SearchExtraToolsTool-VP87ErGx.js +0 -1
  296. package/dist/chunks/api-BiwZmmsh.js +0 -1
  297. package/dist/chunks/auth-BQa4kzQo.js +0 -1
  298. package/dist/chunks/auth-UAJhZNmZ.js +0 -1
  299. package/dist/chunks/backgroundHousekeeping-BUUZ7Csq.js +0 -1
  300. package/dist/chunks/bridgeConfig-DWEqKbXk.js +0 -1
  301. package/dist/chunks/bridgeEnabled-CjVCMwnq.js +0 -1
  302. package/dist/chunks/bridgeMain-6lollTtZ.js +0 -1
  303. package/dist/chunks/caches-C46fa77L.js +0 -1
  304. package/dist/chunks/client-Bup0Sgcn.js +0 -1
  305. package/dist/chunks/commands-BdB1eFvP.js +0 -1
  306. package/dist/chunks/commitAttribution-D6J3NuhB.js +0 -1
  307. package/dist/chunks/config-Bxt1UH1T.js +0 -1
  308. package/dist/chunks/config-CjjXZfNi.js +0 -1
  309. package/dist/chunks/context-noninteractive-DvGo1l7b.js +0 -1
  310. package/dist/chunks/conversation-CH9ouFai.js +0 -1
  311. package/dist/chunks/createSession-DUfOAeyE.js +0 -1
  312. package/dist/chunks/doctor-7fgVhEKL.js +0 -1
  313. package/dist/chunks/envLessBridgeConfig-B2HYnEKo.js +0 -1
  314. package/dist/chunks/extra-usage-CLhv1Z4g.js +0 -1
  315. package/dist/chunks/extractMemories-B2IAvbXM.js +0 -1
  316. package/dist/chunks/fast-_G6zcFye.js +0 -1
  317. package/dist/chunks/firstPartyEventLogger-C9LzVy6y.js +0 -1
  318. package/dist/chunks/hooks-BUJLxdFJ.js +0 -1
  319. package/dist/chunks/hostGuard-C5xydXZI.js +0 -1
  320. package/dist/chunks/inboundAttachments-C0nMTtCi.js +0 -1
  321. package/dist/chunks/language-DfOAuDFc.js +0 -1
  322. package/dist/chunks/loadAgentsDir-DTbJJff-.js +0 -1
  323. package/dist/chunks/localSearch-DKv8PRLD.js +0 -1
  324. package/dist/chunks/model-BQF64tZx.js +0 -1
  325. package/dist/chunks/model-DvrvG6BB.js +0 -1
  326. package/dist/chunks/pluginStartupCheck-CoW7073W.js +0 -1
  327. package/dist/chunks/policyLimits-BkjgMQD0.js +0 -1
  328. package/dist/chunks/poorMode-qlxqU8Hm.js +0 -1
  329. package/dist/chunks/prompt-CN7gBNKS.js +0 -1
  330. package/dist/chunks/prompt-D-zHhqp8.js +0 -1
  331. package/dist/chunks/sandbox-adapter-LzTcKwBp.js +0 -1
  332. package/dist/chunks/searchExtraTools-CbJJQqzH.js +0 -1
  333. package/dist/chunks/sessionFileAccessHooks-B_nNW0zE.js +0 -1
  334. package/dist/chunks/sessionMemory-C4JAUZ6V.js +0 -1
  335. package/dist/chunks/sessionMemoryUtils-BlqAy8oR.js +0 -1
  336. package/dist/chunks/sessionObserver-DMvWci8-.js +0 -1
  337. package/dist/chunks/sessionStorage-Diyuvt20.js +0 -1
  338. package/dist/chunks/sinks-CXq8-7Qn.js +0 -1
  339. package/dist/chunks/skillLearning-1ZfYIzfL.js +0 -1
  340. package/dist/chunks/thinkback-C6gV2LpU.js +0 -1
  341. package/dist/chunks/trustedDevice-DUrFWupL.js +0 -1
  342. package/dist/chunks/undercover-k3JoOKAb.js +0 -1
  343. package/dist/chunks/upgrade-D7iGU0PQ.js +0 -1
  344. package/dist/chunks/usage-DbRdMJog.js +0 -1
  345. package/dist/chunks/useMainLoopModel-DHkRIgNs.js +0 -1
  346. package/dist/chunks/worktree-DMhP5T0p.js +0 -1
@@ -1 +1 @@
1
- import{a as e,l as t}from"./debug-BrXObCdR.js";e();async function n(){let{fetchCodeSessionsFromSessionsAPI:e}=await import(`./api-BiwZmmsh.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};
1
+ import{a as e,l as t}from"./debug-BrXObCdR.js";e();async function n(){let{fetchCodeSessionsFromSessionsAPI:e}=await import(`./api-BsFW57_Q.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-D206qwP3.js";t();export{e as registerSessionFileAccessHooks};
@@ -1 +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-ix0xIunV.js";import{Al as a,Bc as o,DE as s,Dl as c,EE as l,El as u,Fn as d,In as f,Ln as ee,Lo as p,ME as te,Ml as m,NE as ne,So as h,Vc as re,Xw as g,Yw as _,ZT as ie,_E as v,bE as ae,cl as oe,dE as se,fE as ce,fl as y,gE as b,hE as le,jE as ue,kE as x,lE as de,lt as S,mE as C,ml as w,pE as T,pl as E,sE as D,sl as O,ut as k,vE as A,xE as j,yE as M,zo as N}from"./loadAgentsDir-Clu7Uk6a.js";import{F as P,I as F,d as I,p as L,z as R}from"./debug-BrXObCdR.js";import{_n as z,gn as B}from"./settings-Dlp5JTa_.js";import{n as V,r as H}from"./analytics-BotDBGh0.js";import{mi as fe,pi as pe}from"./model-BQF64tZx.js";import{fn as U,hn as me}from"./prompt-Bg_1U0gO.js";import{st as he}from"./rcDebugLog-VKwMl0yg.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=x(e);if(!le()){if(!ce(t))return!1;A()}let n=T(t),r=ve(e,X)>=se(),i=p(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=I(),n=d();await t.mkdir(n,{mode:448});let r=f();try{await W(r,``,{encoding:`utf-8`,mode:384,flag:`wx`}),await W(r,await w(),{encoding:`utf-8`,mode:384})}catch(e){if(F(e)!==`EEXIST`)throw e}e.readFileState.delete(r);let i=await o.call({file_path:r},e),a=``,s=i.data;return s.type===`text`&&(a=s.file.content),H(`tengu_session_memory_file_read`,{content_length:a.length}),{memoryPath:r,currentMemory:a}}function ye(){if(r())return;let e=oe();process.env.USER_TYPE===`ant`&&H(`tengu_session_memory_init`,{auto_compact_enabled:e}),e&&g($)}async function q(e,t){if(e.length===0)return{success:!1,error:`No messages to summarize`};v();try{let n=c(t),{memoryPath:r,currentMemory:i}=await K(n),a=await y(i,r),{tools:o,mainLoopModel:s}=t.options,[l,u,d]=await Promise.all([S(o,s),te(),ue()]),f=he(l);return await m({promptMessages:[h({content:a})],cacheSafeParams:{systemPrompt:f,userContext:u,systemContext:d,toolUseContext:n,forkContextMessages:e},canUseTool:J(r),querySource:`session_memory`,forkLabel:`session_memory_manual`,overrides:{readFileState:n.readFileState}}),H(`tengu_session_memory_manual_extraction`,{}),M(x(e)),Y(e),{success:!0,memoryPath:r}}catch(e){return{success:!1,error:P(e)}}finally{b()}}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(!p(e)){let t=e[e.length-1];t?.uuid&&ae(t.uuid)}}var X,Z,Q,$,be=e((()=>{n(),i(),k(),ne(),me(),re(),z(),a(),L(),_(),N(),ee(),pe(),ie(),s(),V(),O(),E(),C(),R(),Z=t(()=>{let e=_e();j({minimumMessageTokensToInit:e.minimumMessageTokensToInit&&e.minimumMessageTokensToInit>0?e.minimumMessageTokensToInit:D.minimumMessageTokensToInit,minimumTokensBetweenUpdate:e.minimumTokensBetweenUpdate&&e.minimumTokensBetweenUpdate>0?e.minimumTokensBetweenUpdate:D.minimumTokensBetweenUpdate,toolCallsBetweenUpdates:e.toolCallsBetweenUpdates&&e.toolCallsBetweenUpdates>0?e.toolCallsBetweenUpdates:D.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-qlxqU8Hm.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;v();let i=c(n),{memoryPath:a,currentMemory:o}=await K(i);await m({promptMessages:[h({content:await y(o,a)})],cacheSafeParams:u(e),canUseTool:J(a),querySource:`session_memory`,forkLabel:`session_memory`,overrides:{readFileState:i.readFileState}});let s=t[t.length-1],d=s?l(s):void 0,f=de();H(`tengu_session_memory_extraction`,{input_tokens:d?.input_tokens,output_tokens:d?.output_tokens,cache_read_input_tokens:d?.cache_read_input_tokens??void 0,cache_creation_input_tokens:d?.cache_creation_input_tokens??void 0,config_min_message_tokens_to_init:f.minimumMessageTokensToInit,config_min_tokens_between_update:f.minimumTokensBetweenUpdate,config_tool_calls_between_updates:f.toolCallsBetweenUpdates}),M(x(t)),Y(t),b()})}));export{G as a,q as i,ye as n,be as r,J as t};
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-ix0xIunV.js";import{Al as a,Bc as o,DE as s,Dl as c,EE as l,El as u,Fn as d,In as f,Ln as ee,Lo as p,ME as te,Ml as m,NE as ne,So as h,Vc as re,Xw as g,Yw as _,ZT as ie,_E as v,bE as ae,cl as oe,dE as se,fE as ce,fl as y,gE as b,hE as le,jE as ue,kE as x,lE as de,lt as S,mE as C,ml as w,pE as T,pl as E,sE as D,sl as O,ut as k,vE as A,xE as j,yE as M,zo as N}from"./loadAgentsDir-D206qwP3.js";import{F as P,I as F,d as I,p as L,z as R}from"./debug-BrXObCdR.js";import{_n as z,gn as B}from"./settings-BovzmwMP.js";import{n as V,r as H}from"./analytics-BotDBGh0.js";import{mi as fe,pi as pe}from"./model-CKkOnnnx.js";import{fn as U,hn as me}from"./prompt-BNHtszmZ.js";import{st as he}from"./rcDebugLog-CUy1_F23.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=x(e);if(!le()){if(!ce(t))return!1;A()}let n=T(t),r=ve(e,X)>=se(),i=p(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=I(),n=d();await t.mkdir(n,{mode:448});let r=f();try{await W(r,``,{encoding:`utf-8`,mode:384,flag:`wx`}),await W(r,await w(),{encoding:`utf-8`,mode:384})}catch(e){if(F(e)!==`EEXIST`)throw e}e.readFileState.delete(r);let i=await o.call({file_path:r},e),a=``,s=i.data;return s.type===`text`&&(a=s.file.content),H(`tengu_session_memory_file_read`,{content_length:a.length}),{memoryPath:r,currentMemory:a}}function ye(){if(r())return;let e=oe();process.env.USER_TYPE===`ant`&&H(`tengu_session_memory_init`,{auto_compact_enabled:e}),e&&g($)}async function q(e,t){if(e.length===0)return{success:!1,error:`No messages to summarize`};v();try{let n=c(t),{memoryPath:r,currentMemory:i}=await K(n),a=await y(i,r),{tools:o,mainLoopModel:s}=t.options,[l,u,d]=await Promise.all([S(o,s),te(),ue()]),f=he(l);return await m({promptMessages:[h({content:a})],cacheSafeParams:{systemPrompt:f,userContext:u,systemContext:d,toolUseContext:n,forkContextMessages:e},canUseTool:J(r),querySource:`session_memory`,forkLabel:`session_memory_manual`,overrides:{readFileState:n.readFileState}}),H(`tengu_session_memory_manual_extraction`,{}),M(x(e)),Y(e),{success:!0,memoryPath:r}}catch(e){return{success:!1,error:P(e)}}finally{b()}}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(!p(e)){let t=e[e.length-1];t?.uuid&&ae(t.uuid)}}var X,Z,Q,$,be=e((()=>{n(),i(),k(),ne(),me(),re(),z(),a(),L(),_(),N(),ee(),pe(),ie(),s(),V(),O(),E(),C(),R(),Z=t(()=>{let e=_e();j({minimumMessageTokensToInit:e.minimumMessageTokensToInit&&e.minimumMessageTokensToInit>0?e.minimumMessageTokensToInit:D.minimumMessageTokensToInit,minimumTokensBetweenUpdate:e.minimumTokensBetweenUpdate&&e.minimumTokensBetweenUpdate>0?e.minimumTokensBetweenUpdate:D.minimumTokensBetweenUpdate,toolCallsBetweenUpdates:e.toolCallsBetweenUpdates&&e.toolCallsBetweenUpdates>0?e.toolCallsBetweenUpdates:D.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-V11s-3cf.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;v();let i=c(n),{memoryPath:a,currentMemory:o}=await K(i);await m({promptMessages:[h({content:await y(o,a)})],cacheSafeParams:u(e),canUseTool:J(a),querySource:`session_memory`,forkLabel:`session_memory`,overrides:{readFileState:i.readFileState}});let s=t[t.length-1],d=s?l(s):void 0,f=de();H(`tengu_session_memory_extraction`,{input_tokens:d?.input_tokens,output_tokens:d?.output_tokens,cache_read_input_tokens:d?.cache_read_input_tokens??void 0,cache_creation_input_tokens:d?.cache_creation_input_tokens??void 0,config_min_message_tokens_to_init:f.minimumMessageTokensToInit,config_min_tokens_between_update:f.minimumTokensBetweenUpdate,config_tool_calls_between_updates:f.toolCallsBetweenUpdates}),M(x(t)),Y(t),b()})}));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-BS8_TbKj.js";t();export{e as manuallyExtractSessionMemory};
@@ -0,0 +1 @@
1
+ import{mE as e,uE as t}from"./loadAgentsDir-D206qwP3.js";e();export{t as getSessionMemoryContent};
@@ -0,0 +1 @@
1
+ import{i as e,r as t}from"./sessionObserver-ShbCwJ8x.js";e();export{t as heuristicObserverBackend};
@@ -1,4 +1,4 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{ZT as t,et as n,tt as r}from"./loadAgentsDir-Clu7Uk6a.js";import{st as i}from"./rcDebugLog-VKwMl0yg.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-DMvWci8-.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(`
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{ZT as t,et as n,tt as r}from"./loadAgentsDir-D206qwP3.js";import{st as i}from"./rcDebugLog-CUy1_F23.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-ChfQtK2m.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
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
3
 
4
4
  Respond with ONLY a JSON array (no prose, no code fences, no commentary). Each item must match this schema:
@@ -0,0 +1 @@
1
+ import{Rr as e,jr as t,si as n}from"./loadAgentsDir-D206qwP3.js";t();export{e as linkSessionToPR,n as recordTranscript};
@@ -1,4 +1,4 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{E as t,M as n,n as r,r as i,t as a}from"./lazySchema-DcIJE_0i.js";import{en as o,z as s}from"./state-ix0xIunV.js";import{To as c,ZT as l,et as u,tt as d,zo as f}from"./loadAgentsDir-Clu7Uk6a.js";import{a as p,l as m}from"./debug-BrXObCdR.js";import{s as h,u as g}from"./types-C-MRCL8J.js";import{n as _,r as v}from"./analytics-BotDBGh0.js";import{st as y}from"./rcDebugLog-VKwMl0yg.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(`
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{E as t,M as n,n as r,r as i,t as a}from"./lazySchema-DcIJE_0i.js";import{en as o,z as s}from"./state-ix0xIunV.js";import{To as c,ZT as l,et as u,tt as d,zo as f}from"./loadAgentsDir-D206qwP3.js";import{a as p,l as m}from"./debug-BrXObCdR.js";import{s as h,u as g}from"./types-C-MRCL8J.js";import{n as _,r as v}from"./analytics-BotDBGh0.js";import{st as y}from"./rcDebugLog-CUy1_F23.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
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=c((await d({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:s(),hasAppendSystemPrompt:!1,mcpTools:[]}})).message.content),r=w().safeParse(g(e)),i=r.success&&r.data.title.trim()||null;return v(`tengu_session_title_generated`,{success:i!==null}),i}catch(e){return m(`generateSessionTitle failed: ${e}`,{level:`error`}),v(`tengu_session_title_generated`,{success:!1}),null}}var S,C,w,T=e((()=>{i(),o(),_(),u(),p(),h(),a(),f(),l(),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
3
 
4
4
  Return JSON with a single "title" field.
@@ -1,4 +1,4 @@
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-ix0xIunV.js";import{C as d,S as f,a as p,l as m,w as h,z as ee}from"./debug-BrXObCdR.js";import{f as g,g as te}from"./config-3m_9zSrj.js";import{i as ne,t as re}from"./hash-Tu-My5Vp.js";import{Bt as ie,jt as ae}from"./model-BQF64tZx.js";import{et as oe,ft as se,rt as ce,ut as le}from"./esm-CGoYrggU.js";import"path";import"fs";import{createHash as ue}from"crypto";import"fs/promises";import{AsyncLocalStorage as de}from"async_hooks";function fe(e){let t=BigInt(58),n=Array(v).fill(_[0]),r=v-1,i=e;for(;i>0n;){let e=Number(i%t);n[r]=_[e],i/=t,r--}return n.join(``)}function pe(e){let t=e.replace(/-/g,``);if(t.length!==32)throw Error(`Invalid UUID hex length: ${t.length}`);return BigInt(`0x`+t)}function me(e,t){let n=pe(t);return`${e}_${he}${fe(n)}`}var _,he,v,ge=e((()=>{_=`123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz`,he=`01`,v=22}));function y(e){let n=_e[e],r=process.env[e];return r===void 0?n:t(r)}function b(){let e=g(),t=c(),n={"user.id":e};y(`OTEL_METRICS_INCLUDE_SESSION_ID`)&&(n[`session.id`]=t),y(`OTEL_METRICS_INCLUDE_VERSION`)&&(n[`app.version`]=`0.0.5`);let r=ae();if(r){let e=r.organizationUuid,t=r.emailAddress,i=r.accountUuid;e&&(n[`organization.id`]=e),t&&(n[`user.email`]=t),i&&y(`OTEL_METRICS_INCLUDE_ACCOUNT_UUID`)&&(n[`user.account_uuid`]=i,n[`user.account_id`]=process.env.CLAUDE_CODE_ACCOUNT_TAGGED_ID||me(`user`,i))}return le.terminal&&(n[`terminal.type`]=le.terminal),n}var _e,x=e((()=>{s(),ie(),te(),se(),n(),ge(),_e={OTEL_METRICS_INCLUDE_SESSION_ID:!0,OTEL_METRICS_INCLUDE_VERSION:!1,OTEL_METRICS_INCLUDE_ACCOUNT_UUID:!0}}));function ve(){return t(process.env.OTEL_LOG_USER_PROMPTS)}function ye(e){return ve()?e:`<REDACTED>`}async function S(e,t={}){let n=o();if(!n){C||(C=!0,m(`[3P telemetry] Event dropped (no event logger initialized): ${e}`,{level:`warn`}));return}let r={...b(),"event.name":e,"event.timestamp":new Date().toISOString(),"event.sequence":be++},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 be,C,xe=e((()=>{s(),p(),n(),x(),be=0,C=!1}));function Se(e){return Math.abs(re(e))||1}function Ce(e){let t=L.get(e);return t===void 0?(I++,L.set(e,I),I):t}function w(){let e=c(),t=`main`,n=M.get(e);if(n)return n;let r={agentId:e,agentName:t,parentAgentId:void 0,processId:1,threadId:Se(t)};return M.set(e,r),N++,r}function T(){return(Date.now()-P)*1e3}function E(){return`span_${++F}`}function we(){let e=process.env.CLAUDE_CODE_PERFETTO_TRACE;m(`[Perfetto] initializePerfettoTracing called, env value: ${e}`)}function Te(e){O&&(k.push({name:`process_name`,cat:`__metadata`,ph:`M`,ts:0,pid:e.processId,tid:0,args:{name:e.agentName}}),k.push({name:`thread_name`,cat:`__metadata`,ph:`M`,ts:0,pid:e.processId,tid:e.threadId,args:{name:e.agentName}}),e.parentAgentId&&k.push({name:`parent_agent`,cat:`__metadata`,ph:`M`,ts:0,pid:e.processId,tid:0,args:{parent_agent_id:e.parentAgentId}}))}function D(){return O}function Ee(e,t,n){if(!O)return;let r={agentId:e,agentName:t,parentAgentId:n,processId:Ce(e),threadId:Se(t)};M.set(e,r),N++,Te(r)}function De(e){O&&(M.delete(e),L.delete(e))}function Oe(e){if(!O)return``;let t=E(),n=w();return j.set(t,{name:`API Call`,category:`api`,startTime:T(),agentInfo:n,args:{model:e.model,prompt_tokens:e.promptTokens,message_id:e.messageId,is_speculative:e.isSpeculative??!1,query_source:e.querySource}}),A.push({name:`API Call`,cat:`api`,ph:`B`,ts:j.get(t).startTime,pid:n.processId,tid:n.threadId,args:j.get(t).args}),t}function ke(e,t){if(!O||!e)return;let n=j.get(e);if(!n)return;let r=T(),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,ee={...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},g=m!==void 0&&m>0?m*1e3:0;if(g>0){let e=n.startTime+g;if(A.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;A.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}}),A.push({name:`Attempt ${t+1} (retry)`,cat:`api,retry`,ph:`E`,ts:i,pid:n.agentInfo.processId,tid:n.agentInfo.threadId})}}A.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+g,t=e+o*1e3;A.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}}),A.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-g/1e3;r!==void 0&&r>0&&(A.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}}),A.push({name:`Sampling`,cat:`api,sampling`,ph:`E`,ts:t+r*1e3,pid:n.agentInfo.processId,tid:n.agentInfo.threadId}))}A.push({name:n.name,cat:n.category,ph:`E`,ts:r,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:ee}),j.delete(e)}function Ae(e,t){if(!O)return``;let n=E(),r=w();return j.set(n,{name:`Tool: ${e}`,category:`tool`,startTime:T(),agentInfo:r,args:{tool_name:e,...t}}),A.push({name:`Tool: ${e}`,cat:`tool`,ph:`B`,ts:j.get(n).startTime,pid:r.processId,tid:r.threadId,args:j.get(n).args}),n}function je(e,t){if(!O||!e)return;let n=j.get(e);if(!n)return;let r=T(),i=r-n.startTime,a={...n.args,success:t?.success??!0,error:t?.error,result_tokens:t?.resultTokens,duration_ms:i/1e3};A.push({name:n.name,cat:n.category,ph:`E`,ts:r,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:a}),j.delete(e)}function Me(e){if(!O)return``;let t=E(),n=w();return j.set(t,{name:`Waiting for User Input`,category:`user_input`,startTime:T(),agentInfo:n,args:{context:e}}),A.push({name:`Waiting for User Input`,cat:`user_input`,ph:`B`,ts:j.get(t).startTime,pid:n.processId,tid:n.threadId,args:j.get(t).args}),t}function Ne(e,t){if(!O||!e)return;let n=j.get(e);if(!n)return;let r=T(),i=r-n.startTime,a={...n.args,decision:t?.decision,source:t?.source,duration_ms:i/1e3};A.push({name:n.name,cat:n.category,ph:`E`,ts:r,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:a}),j.delete(e)}function Pe(e){if(!O)return``;let t=E(),n=w();return j.set(t,{name:`Interaction`,category:`interaction`,startTime:T(),agentInfo:n,args:{user_prompt_length:e?.length}}),A.push({name:`Interaction`,cat:`interaction`,ph:`B`,ts:j.get(t).startTime,pid:n.processId,tid:n.threadId,args:j.get(t).args}),t}function Fe(e){if(!O||!e)return;let t=j.get(e);if(!t)return;let n=T(),r=n-t.startTime;A.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}}),j.delete(e)}var O,k,A,j,M,N,P,F,I,L,Ie=e((()=>{s(),p(),n(),ee(),ne(),f(),O=!1,k=[],A=[],j=new Map,M=new Map,N=0,P=0,F=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)+`
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-ix0xIunV.js";import{C as d,S as f,a as p,l as m,w as h,z as ee}from"./debug-BrXObCdR.js";import{f as g,g as te}from"./config-DmomySWC.js";import{i as ne,t as re}from"./hash-Tu-My5Vp.js";import{Bt as ie,jt as ae}from"./model-CKkOnnnx.js";import{et as oe,ft as se,rt as ce,ut as le}from"./esm-D5q6s4l8.js";import"path";import"fs";import{createHash as ue}from"crypto";import"fs/promises";import{AsyncLocalStorage as de}from"async_hooks";function fe(e){let t=BigInt(58),n=Array(v).fill(_[0]),r=v-1,i=e;for(;i>0n;){let e=Number(i%t);n[r]=_[e],i/=t,r--}return n.join(``)}function pe(e){let t=e.replace(/-/g,``);if(t.length!==32)throw Error(`Invalid UUID hex length: ${t.length}`);return BigInt(`0x`+t)}function me(e,t){let n=pe(t);return`${e}_${he}${fe(n)}`}var _,he,v,ge=e((()=>{_=`123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz`,he=`01`,v=22}));function y(e){let n=_e[e],r=process.env[e];return r===void 0?n:t(r)}function b(){let e=g(),t=c(),n={"user.id":e};y(`OTEL_METRICS_INCLUDE_SESSION_ID`)&&(n[`session.id`]=t),y(`OTEL_METRICS_INCLUDE_VERSION`)&&(n[`app.version`]=`0.0.6`);let r=ae();if(r){let e=r.organizationUuid,t=r.emailAddress,i=r.accountUuid;e&&(n[`organization.id`]=e),t&&(n[`user.email`]=t),i&&y(`OTEL_METRICS_INCLUDE_ACCOUNT_UUID`)&&(n[`user.account_uuid`]=i,n[`user.account_id`]=process.env.CLAUDE_CODE_ACCOUNT_TAGGED_ID||me(`user`,i))}return le.terminal&&(n[`terminal.type`]=le.terminal),n}var _e,x=e((()=>{s(),ie(),te(),se(),n(),ge(),_e={OTEL_METRICS_INCLUDE_SESSION_ID:!0,OTEL_METRICS_INCLUDE_VERSION:!1,OTEL_METRICS_INCLUDE_ACCOUNT_UUID:!0}}));function ve(){return t(process.env.OTEL_LOG_USER_PROMPTS)}function ye(e){return ve()?e:`<REDACTED>`}async function S(e,t={}){let n=o();if(!n){C||(C=!0,m(`[3P telemetry] Event dropped (no event logger initialized): ${e}`,{level:`warn`}));return}let r={...b(),"event.name":e,"event.timestamp":new Date().toISOString(),"event.sequence":be++},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 be,C,xe=e((()=>{s(),p(),n(),x(),be=0,C=!1}));function Se(e){return Math.abs(re(e))||1}function Ce(e){let t=L.get(e);return t===void 0?(I++,L.set(e,I),I):t}function w(){let e=c(),t=`main`,n=M.get(e);if(n)return n;let r={agentId:e,agentName:t,parentAgentId:void 0,processId:1,threadId:Se(t)};return M.set(e,r),N++,r}function T(){return(Date.now()-P)*1e3}function E(){return`span_${++F}`}function we(){let e=process.env.CLAUDE_CODE_PERFETTO_TRACE;m(`[Perfetto] initializePerfettoTracing called, env value: ${e}`)}function Te(e){O&&(k.push({name:`process_name`,cat:`__metadata`,ph:`M`,ts:0,pid:e.processId,tid:0,args:{name:e.agentName}}),k.push({name:`thread_name`,cat:`__metadata`,ph:`M`,ts:0,pid:e.processId,tid:e.threadId,args:{name:e.agentName}}),e.parentAgentId&&k.push({name:`parent_agent`,cat:`__metadata`,ph:`M`,ts:0,pid:e.processId,tid:0,args:{parent_agent_id:e.parentAgentId}}))}function D(){return O}function Ee(e,t,n){if(!O)return;let r={agentId:e,agentName:t,parentAgentId:n,processId:Ce(e),threadId:Se(t)};M.set(e,r),N++,Te(r)}function De(e){O&&(M.delete(e),L.delete(e))}function Oe(e){if(!O)return``;let t=E(),n=w();return j.set(t,{name:`API Call`,category:`api`,startTime:T(),agentInfo:n,args:{model:e.model,prompt_tokens:e.promptTokens,message_id:e.messageId,is_speculative:e.isSpeculative??!1,query_source:e.querySource}}),A.push({name:`API Call`,cat:`api`,ph:`B`,ts:j.get(t).startTime,pid:n.processId,tid:n.threadId,args:j.get(t).args}),t}function ke(e,t){if(!O||!e)return;let n=j.get(e);if(!n)return;let r=T(),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,ee={...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},g=m!==void 0&&m>0?m*1e3:0;if(g>0){let e=n.startTime+g;if(A.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;A.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}}),A.push({name:`Attempt ${t+1} (retry)`,cat:`api,retry`,ph:`E`,ts:i,pid:n.agentInfo.processId,tid:n.agentInfo.threadId})}}A.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+g,t=e+o*1e3;A.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}}),A.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-g/1e3;r!==void 0&&r>0&&(A.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}}),A.push({name:`Sampling`,cat:`api,sampling`,ph:`E`,ts:t+r*1e3,pid:n.agentInfo.processId,tid:n.agentInfo.threadId}))}A.push({name:n.name,cat:n.category,ph:`E`,ts:r,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:ee}),j.delete(e)}function Ae(e,t){if(!O)return``;let n=E(),r=w();return j.set(n,{name:`Tool: ${e}`,category:`tool`,startTime:T(),agentInfo:r,args:{tool_name:e,...t}}),A.push({name:`Tool: ${e}`,cat:`tool`,ph:`B`,ts:j.get(n).startTime,pid:r.processId,tid:r.threadId,args:j.get(n).args}),n}function je(e,t){if(!O||!e)return;let n=j.get(e);if(!n)return;let r=T(),i=r-n.startTime,a={...n.args,success:t?.success??!0,error:t?.error,result_tokens:t?.resultTokens,duration_ms:i/1e3};A.push({name:n.name,cat:n.category,ph:`E`,ts:r,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:a}),j.delete(e)}function Me(e){if(!O)return``;let t=E(),n=w();return j.set(t,{name:`Waiting for User Input`,category:`user_input`,startTime:T(),agentInfo:n,args:{context:e}}),A.push({name:`Waiting for User Input`,cat:`user_input`,ph:`B`,ts:j.get(t).startTime,pid:n.processId,tid:n.threadId,args:j.get(t).args}),t}function Ne(e,t){if(!O||!e)return;let n=j.get(e);if(!n)return;let r=T(),i=r-n.startTime,a={...n.args,decision:t?.decision,source:t?.source,duration_ms:i/1e3};A.push({name:n.name,cat:n.category,ph:`E`,ts:r,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:a}),j.delete(e)}function Pe(e){if(!O)return``;let t=E(),n=w();return j.set(t,{name:`Interaction`,category:`interaction`,startTime:T(),agentInfo:n,args:{user_prompt_length:e?.length}}),A.push({name:`Interaction`,cat:`interaction`,ph:`B`,ts:j.get(t).startTime,pid:n.processId,tid:n.threadId,args:j.get(t).args}),t}function Fe(e){if(!O||!e)return;let t=j.get(e);if(!t)return;let n=T(),r=n-t.startTime;A.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}}),j.delete(e)}var O,k,A,j,M,N,P,F,I,L,Ie=e((()=>{s(),p(),n(),ee(),ne(),f(),O=!1,k=[],A=[],j=new Map,M=new Map,N=0,P=0,F=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
2
 
3
3
  [TRUNCATED - Content exceeds 60KB limit]`,truncated:!0}}function B(e){return ue(`sha256`).update(e).digest(`hex`).slice(0,12)}function Re(e){return`sp_${B(e)}`}function ze(e){return`msg_${B(h(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:h(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);S(`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=h(e),n=B(t);return{name:typeof e.name==`string`?e.name:`unknown`,hash:n,json:t}});e.setAttribute(`tools`,h(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);S(`tool`,{tool_name:ce(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
4
 
@@ -1,4 +1,4 @@
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,E as g,H as se,M as _,N as v,O as ce,P as le,S as y,T as b,c as ue,d as x,g as S,h as C,i as de,j as fe,k as pe,l as me,n as w,p as he,r as T,t as E,v as ge,x as _e}from"./lazySchema-DcIJE_0i.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-ix0xIunV.js";import{n as rt,t as it}from"./cwd-CYmmnQVS.js";import{C as at,I as ot,S as st,V as ct,_ as lt,a as ut,d as D,l as dt,p as ft,w as pt,x as mt,z as ht}from"./debug-BrXObCdR.js";import{M as gt,_ as _t,j as vt,t as yt}from"./git-Do0wJvux.js";import{n as bt,r as xt}from"./execFileNoThrow-D244NytW.js";import{o as St,s as Ct}from"./log-BMCygSzM.js";import{n as wt,t as Tt}from"./which-CKQnSouy.js";import{i as Et,o as Dt}from"./platform-BrYefG_2.js";import{C as Ot,D as O,E as kt,f as At}from"./file-DcZWPH2V.js";import{a as jt,f as Mt,p as Nt,r as Pt,s as Ft,u as k}from"./types-C-MRCL8J.js";import{i as It,n as Lt}from"./startupProfiler-xa3NmN7Z.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-DGLPkqJ4.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=at(Nt(O(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(ot(e)===`ENOENT`)await an(r,`${n}\n`,`utf-8`);else throw e}}catch(e){Ct(e)}}var Zr=t((()=>{rt(),ht(),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((()=>{T(),E(),pi=w(()=>g({allowedDomains:C(_()).optional(),allowManagedDomainsOnly:S().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:C(_()).optional().describe(`macOS only: Unix socket paths to allow. Ignored on Linux (seccomp cannot filter by path).`),allowAllUnixSockets:S().optional().describe(`If true, allow all Unix sockets (disables blocking on both platforms).`),allowLocalBinding:S().optional(),httpProxyPort:b().optional(),socksProxyPort:b().optional()}).optional()),mi=w(()=>g({allowWrite:C(_()).optional().describe(`Additional paths to allow writing within the sandbox. Merged with paths from Edit(...) allow permission rules.`),denyWrite:C(_()).optional().describe(`Additional paths to deny writing within the sandbox. Merged with paths from Edit(...) deny permission rules.`),denyRead:C(_()).optional().describe(`Additional paths to deny reading within the sandbox. Merged with paths from Read(...) deny permission rules.`),allowRead:C(_()).optional().describe(`Paths to re-allow reading within denyRead regions. Takes precedence over denyRead for matching paths.`),allowManagedReadPathsOnly:S().optional().describe(`When true (set in managed settings), only allowRead paths from policySettings are used.`)}).optional()),hi=w(()=>g({enabled:S().optional(),failIfUnavailable:S().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:S().optional(),allowUnsandboxedCommands:S().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(_(),C(_())).optional(),enableWeakerNestedSandbox:S().optional(),enableWeakerNetworkIsolation:S().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:C(_()).optional(),ripgrep:g({command:_(),args:C(_()).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(D().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 D().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(D().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(D().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((()=>{T(),Ni(),qt(),E(),w(()=>de.enum(Jt)),Hi=w(()=>de.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:g({type:y(`command`).describe(`Shell command hook type`),command:_().describe(`Shell command to execute`),if:B(),shell:x(qi).optional().describe(`Shell interpreter. 'bash' uses your $SHELL (bash/zsh/sh); 'powershell' uses pwsh. Defaults to bash.`),timeout:b().positive().optional().describe(`Timeout in seconds for this specific command`),statusMessage:_().optional().describe(`Custom status message to display in spinner while hook runs`),once:S().optional().describe(`If true, hook runs once and is removed after execution`),async:S().optional().describe(`If true, hook runs in background without blocking`),asyncRewake:S().optional().describe(`If true, hook runs in background and wakes the model on exit code 2 (blocking error). Implies async.`)}),PromptHookSchema:g({type:y(`prompt`).describe(`LLM prompt hook type`),prompt:_().describe(`Prompt to evaluate with LLM. Use $ARGUMENTS placeholder for hook input JSON.`),if:B(),timeout:b().positive().optional().describe(`Timeout in seconds for this specific prompt evaluation`),model:_().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:_().optional().describe(`Custom status message to display in spinner while hook runs`),once:S().optional().describe(`If true, hook runs once and is removed after execution`)}),HttpHookSchema:g({type:y(`http`).describe(`HTTP hook type`),url:_().url().describe(`URL to POST the hook input JSON to`),if:B(),timeout:b().positive().optional().describe(`Timeout in seconds for this specific request`),headers: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:C(_()).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:_().optional().describe(`Custom status message to display in spinner while hook runs`),once:S().optional().describe(`If true, hook runs once and is removed after execution`)}),AgentHookSchema:g({type:y(`agent`).describe(`Agentic verifier hook type`),prompt:_().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:b().positive().optional().describe(`Timeout in seconds for agent execution (default 60)`),model:_().optional().describe(`Model to use for this agent hook (e.g., "claude-sonnet-4-6"). If not specified, uses Haiku.`),statusMessage:_().optional().describe(`Custom status message to display in spinner while hook runs`),once:S().optional().describe(`If true, hook runs once and is removed after execution`)})}}var B,Zi,Qi,V,$i=t((()=>{Ki(),T(),E(),Yi(),B=w(()=>_().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=w(()=>{let{BashCommandHookSchema:e,PromptHookSchema:t,AgentHookSchema:n,HttpHookSchema:r}=Xi();return ge(`type`,[e,t,n,r])}),Qi=w(()=>g({matcher:_().optional().describe(`String pattern to match (e.g. tool names like "Write")`),hooks:C(Zi()).describe(`List of hooks to execute when the matcher matches`)})),V=w(()=>ce(x(Gi),C(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((()=>{T(),$i(),jt(),E(),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=w(()=>_().startsWith(`./`)),W=w(()=>U().endsWith(`.json`)),la=w(()=>v([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`),_().url().refine(e=>e.endsWith(`.mcpb`)||e.endsWith(`.dxt`),{message:`MCPB URL must end with .mcpb or .dxt`}).describe(`URL to MCPB file`)])),ua=w(()=>U().endsWith(`.md`)),da=w(()=>v([ua(),U()])),fa=w(()=>_().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=w(()=>g({name:_().min(1,`Author name cannot be empty`).describe(`Display name of the plugin author or organization`),email:_().optional().describe(`Contact email for support or feedback`),url:_().optional().describe(`Website, GitHub profile, or organization URL`)})),ma=w(()=>g({name:_().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:_().optional().describe(`Semantic version (e.g., 1.2.3) following semver.org specification`),description:_().optional().describe(`Brief, user-facing explanation of what the plugin provides`),author:pa().optional().describe(`Information about the plugin creator or maintainer`),homepage:_().url().optional().describe(`Plugin homepage or documentation URL`),repository:_().optional().describe(`Source code repository URL`),license:_().optional().describe(`SPDX license identifier (e.g., MIT, Apache-2.0)`),keywords:C(_()).optional().describe(`Tags for plugin discovery and categorization`),dependencies:C(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=w(()=>g({description:_().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=w(()=>g({hooks:v([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)`),C(v([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=w(()=>g({source:da().optional().describe(`Path to command markdown file, relative to plugin root`),content:_().optional().describe(`Inline markdown content for the command`),description:_().optional().describe(`Command description override`),argumentHint:_().optional().describe(`Hint for command arguments (e.g., "[file]")`),model:_().optional().describe(`Default model for this command`),allowedTools:C(_()).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=w(()=>g({commands:v([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`),C(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=w(()=>g({agents:v([ua().describe(`Path to additional agent file (in addition to those in the agents/ directory, if it exists), relative to the plugin root`),C(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=w(()=>g({skills:v([U().describe(`Path to additional skill directory (in addition to those in the skills/ directory, if it exists), relative to the plugin root`),C(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=w(()=>g({outputStyles:v([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`),C(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=w(()=>_().min(1)),Ca=w(()=>_().min(2).refine(e=>e.startsWith(`.`),{message:`File extensions must start with dot (e.g., ".ts", not "ts")`})),wa=w(()=>g({mcpServers:v([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`),C(v([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=w(()=>g({type:x([`string`,`number`,`boolean`,`directory`,`file`]).describe(`Type of the configuration value`),title:_().describe(`Human-readable label shown in the config dialog`),description:_().describe(`Help text shown beneath the field in the config dialog`),required:S().optional().describe(`If true, validation fails when this field is empty`),default:v([_(),b(),S(),C(_())]).optional().describe(`Default value used when the user provides nothing`),multiple:S().optional().describe(`For string type: allow an array of strings`),sensitive:S().optional().describe(`If true, masks dialog input and stores value in secure storage (keychain/credentials file) instead of settings.json`),min:b().optional().describe(`Minimum value (number type only)`),max:b().optional().describe(`Maximum value (number type only)`)}).strict()),Ea=w(()=>g({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=w(()=>g({channels:C(g({server:_().min(1).describe(`Name of the MCP server this channel binds to. Must match a key in this plugin's mcpServers.`),displayName:_().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=w(()=>fe({command:_().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:C(Sa()).optional().describe(`Command-line arguments to pass to the server`),extensionToLanguage:h(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:x([`stdio`,`socket`]).default(`stdio`).describe(`Communication transport mechanism`),env:h(_(),_()).optional().describe(`Environment variables to set when starting the server`),initializationOptions:le().optional().describe(`Initialization options passed to the server during initialization`),settings:le().optional().describe(`Settings passed to the server via workspace/didChangeConfiguration`),workspaceFolder:_().optional().describe(`Workspace folder path to use for the server`),startupTimeout:b().int().positive().optional().describe(`Maximum time to wait for server startup (milliseconds)`),shutdownTimeout:b().int().positive().optional().describe(`Maximum time to wait for graceful shutdown (milliseconds)`),restartOnCrash:S().optional().describe(`Whether to restart the server if it crashes`),maxRestarts:b().int().nonnegative().optional().describe(`Maximum number of restart attempts before giving up`)})),ka=w(()=>g({lspServers:v([W().describe(`Path to .lsp.json configuration file relative to plugin root`),h(_(),Oa()).describe(`LSP server configurations keyed by server name`),C(v([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=w(()=>_().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=w(()=>g({settings:h(_(),le()).optional().describe(`Settings to merge when plugin is enabled. Only allowlisted keys are kept (currently: agent)`)})),Ma=w(()=>g({...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=w(()=>ge(`source`,[g({source:y(`url`),url:_().url().describe(`Direct URL to marketplace.json file`),headers:h(_(),_()).optional().describe(`Custom HTTP headers (e.g., for authentication)`)}),g({source:y(`github`),repo:_().describe(`GitHub repository in owner/repo format`),ref:_().optional().describe(`Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.`),path:_().optional().describe(`Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)`),sparsePaths:C(_()).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.`)}),g({source:y(`git`),url:_().describe(`Full git repository URL`),ref:_().optional().describe(`Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.`),path:_().optional().describe(`Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)`),sparsePaths:C(_()).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.`)}),g({source:y(`npm`),package:Aa().describe(`NPM package containing marketplace.json`)}),g({source:y(`file`),path:_().describe(`Local file path to marketplace.json`)}),g({source:y(`directory`),path:_().describe(`Local directory containing .claude-plugin/marketplace.json`)}),g({source:y(`hostPattern`),hostPattern:_().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$").`)}),g({source:y(`pathPattern`),pathPattern:_().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.`)}),g({source:y(`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:C(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=w(()=>_().length(40).regex(/^[a-f0-9]{40}$/,`Must be a full 40-character lowercase git commit SHA`)),Fa=w(()=>v([U().describe(`Path to the plugin root, relative to the marketplace root (the directory containing .claude-plugin/, not .claude-plugin/ itself)`),g({source:y(`npm`),package:Aa().or(_()).describe("Package name (or url, or local path, or anything else that can be passed to `npm` as a package)"),version:_().optional().describe(`Specific version or version range (e.g., ^1.0.0, ~2.1.0)`),registry:_().url().optional().describe(`Custom NPM registry URL (defaults to using system default, likely npmjs.org)`)}).describe(`NPM package as plugin source`),g({source:y(`pip`),package:_().describe(`Python package name as it appears on PyPI`),version:_().optional().describe(`Version specifier (e.g., ==1.0.0, >=2.0.0, <3.0.0)`),registry:_().url().optional().describe(`Custom PyPI registry URL (defaults to using system default, likely pypi.org)`)}).describe(`Python package as plugin source`),g({source:y(`url`),url:_().describe(`Full git repository URL (https:// or git@)`),ref:_().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`)}),g({source:y(`github`),repo:_().describe(`GitHub repository in owner/repo format`),ref:_().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`)}),g({source:y(`git-subdir`),url:_().describe(`Git repository: GitHub owner/repo shorthand, https://, or git@ URL`),path:_().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:_().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=w(()=>g({name:_().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:_().optional(),version:_().optional(),strict:S().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=w(()=>Ma().partial().extend({name:_().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:_().optional().describe(`Category for organizing plugins (e.g., "productivity", "development")`),tags:C(_()).optional().describe(`Tags for searchability and discovery`),strict:S().optional().default(!0).describe(`Require the plugin manifest to be present in the plugin folder. If false, the marketplace entry provides the manifest.`)})),Ra=w(()=>g({name:fa(),owner:pa().describe(`Marketplace maintainer or curator information`),plugins:C(La()).describe(`Collection of available plugins in this marketplace`),forceRemoveDeletedPlugins:S().optional().describe(`When true, plugins removed from this marketplace will be automatically uninstalled and flagged for users`),metadata:g({pluginRoot:_().optional().describe(`Base path for relative plugin sources`),version:_().optional().describe(`Marketplace version`),description:_().optional().describe(`Marketplace description`)}).optional().describe(`Optional marketplace metadata`),allowCrossMarketplaceDependenciesOn:C(_()).optional().describe(`Marketplace names whose plugins may be auto-installed as dependencies. Only the root marketplace's allowlist applies — no transitive trust.`)})),G=w(()=>_().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=w(()=>v([_().regex(za,`Dependency must be a plugin name, optionally qualified with @marketplace`).transform(e=>e.replace(/@\^[^@]*$/,``)),g({name:_().min(1).regex(/^[a-z0-9][-a-z0-9._]*$/i),marketplace:_().min(1).regex(/^[a-z0-9][-a-z0-9._]*$/i).optional()}).loose().transform(e=>e.marketplace?`${e.name}@${e.marketplace}`:e.name)])),w(()=>v([G(),g({id:G().describe(`Plugin identifier (e.g., "formatter@tools")`),version:_().optional().describe(`Version constraint (e.g., "^2.0.0")`),required:S().optional().describe(`If true, cannot be disabled`),config:h(_(),le()).optional().describe(`Plugin-specific configuration`)})])),Va=w(()=>g({version:_().describe(`Currently installed version`),installedAt:_().describe(`ISO 8601 timestamp of installation`),lastUpdated:_().optional().describe(`ISO 8601 timestamp of last update`),installPath:_().describe(`Absolute path to the installed plugin directory`),gitCommitSha:_().optional().describe(`Git commit SHA for git-based plugins (for version tracking)`)})),Ha=w(()=>g({version:y(1).describe(`Schema version 1`),plugins:h(G(),Va()).describe(`Map of plugin IDs to their installation metadata`)})),Ua=w(()=>x([`managed`,`user`,`project`,`local`])),Wa=w(()=>g({scope:Ua().describe(`Installation scope`),projectPath:_().optional().describe(`Project path (required for project/local scopes)`),installPath:_().describe(`Absolute path to the versioned plugin directory`),version:_().optional().describe(`Currently installed version`),installedAt:_().optional().describe(`ISO 8601 timestamp of installation`),lastUpdated:_().optional().describe(`ISO 8601 timestamp of last update`),gitCommitSha:_().optional().describe(`Git commit SHA for git-based plugins`)})),Ga=w(()=>g({version:y(2).describe(`Schema version 2`),plugins:h(G(),C(Wa())).describe(`Map of plugin IDs to arrays of installation entries`)})),w(()=>v([Ha(),Ga()])),Ka=w(()=>g({source:Na().describe(`Where to fetch the marketplace from`),installLocation:_().describe(`Local cache path where marketplace manifest is stored`),lastUpdated:_().describe(`ISO 8601 timestamp of last marketplace refresh`),autoUpdate:S().optional().describe(`Whether to automatically update this marketplace and its installed plugins on startup`)})),qa=w(()=>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=`
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,E as g,H as se,M as _,N as v,O as ce,P as le,S as y,T as b,c as ue,d as x,g as S,h as C,i as de,j as fe,k as pe,l as me,n as w,p as he,r as T,t as E,v as ge,x as _e}from"./lazySchema-DcIJE_0i.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-ix0xIunV.js";import{n as rt,t as it}from"./cwd-CYmmnQVS.js";import{C as at,I as ot,S as st,V as ct,_ as lt,a as ut,d as D,l as dt,p as ft,w as pt,x as mt,z as ht}from"./debug-BrXObCdR.js";import{M as gt,_ as _t,j as vt,t as yt}from"./git-Do0wJvux.js";import{n as bt,r as xt}from"./execFileNoThrow-D244NytW.js";import{o as St,s as Ct}from"./log-BMCygSzM.js";import{n as wt,t as Tt}from"./which-CKQnSouy.js";import{i as Et,o as Dt}from"./platform-BrYefG_2.js";import{C as Ot,D as O,E as kt,f as At}from"./file-DcZWPH2V.js";import{a as jt,f as Mt,p as Nt,r as Pt,s as Ft,u as k}from"./types-C-MRCL8J.js";import{i as It,n as Lt}from"./startupProfiler-xa3NmN7Z.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-DGLPkqJ4.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=at(Nt(O(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(ot(e)===`ENOENT`)await an(r,`${n}\n`,`utf-8`);else throw e}}catch(e){Ct(e)}}var Zr=t((()=>{rt(),ht(),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((()=>{T(),E(),pi=w(()=>g({allowedDomains:C(_()).optional(),allowManagedDomainsOnly:S().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:C(_()).optional().describe(`macOS only: Unix socket paths to allow. Ignored on Linux (seccomp cannot filter by path).`),allowAllUnixSockets:S().optional().describe(`If true, allow all Unix sockets (disables blocking on both platforms).`),allowLocalBinding:S().optional(),httpProxyPort:b().optional(),socksProxyPort:b().optional()}).optional()),mi=w(()=>g({allowWrite:C(_()).optional().describe(`Additional paths to allow writing within the sandbox. Merged with paths from Edit(...) allow permission rules.`),denyWrite:C(_()).optional().describe(`Additional paths to deny writing within the sandbox. Merged with paths from Edit(...) deny permission rules.`),denyRead:C(_()).optional().describe(`Additional paths to deny reading within the sandbox. Merged with paths from Read(...) deny permission rules.`),allowRead:C(_()).optional().describe(`Paths to re-allow reading within denyRead regions. Takes precedence over denyRead for matching paths.`),allowManagedReadPathsOnly:S().optional().describe(`When true (set in managed settings), only allowRead paths from policySettings are used.`)}).optional()),hi=w(()=>g({enabled:S().optional(),failIfUnavailable:S().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:S().optional(),allowUnsandboxedCommands:S().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(_(),C(_())).optional(),enableWeakerNestedSandbox:S().optional(),enableWeakerNetworkIsolation:S().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:C(_()).optional(),ripgrep:g({command:_(),args:C(_()).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(D().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 D().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(D().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(D().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((()=>{T(),Ni(),qt(),E(),w(()=>de.enum(Jt)),Hi=w(()=>de.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:g({type:y(`command`).describe(`Shell command hook type`),command:_().describe(`Shell command to execute`),if:B(),shell:x(qi).optional().describe(`Shell interpreter. 'bash' uses your $SHELL (bash/zsh/sh); 'powershell' uses pwsh. Defaults to bash.`),timeout:b().positive().optional().describe(`Timeout in seconds for this specific command`),statusMessage:_().optional().describe(`Custom status message to display in spinner while hook runs`),once:S().optional().describe(`If true, hook runs once and is removed after execution`),async:S().optional().describe(`If true, hook runs in background without blocking`),asyncRewake:S().optional().describe(`If true, hook runs in background and wakes the model on exit code 2 (blocking error). Implies async.`)}),PromptHookSchema:g({type:y(`prompt`).describe(`LLM prompt hook type`),prompt:_().describe(`Prompt to evaluate with LLM. Use $ARGUMENTS placeholder for hook input JSON.`),if:B(),timeout:b().positive().optional().describe(`Timeout in seconds for this specific prompt evaluation`),model:_().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:_().optional().describe(`Custom status message to display in spinner while hook runs`),once:S().optional().describe(`If true, hook runs once and is removed after execution`)}),HttpHookSchema:g({type:y(`http`).describe(`HTTP hook type`),url:_().url().describe(`URL to POST the hook input JSON to`),if:B(),timeout:b().positive().optional().describe(`Timeout in seconds for this specific request`),headers: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:C(_()).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:_().optional().describe(`Custom status message to display in spinner while hook runs`),once:S().optional().describe(`If true, hook runs once and is removed after execution`)}),AgentHookSchema:g({type:y(`agent`).describe(`Agentic verifier hook type`),prompt:_().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:b().positive().optional().describe(`Timeout in seconds for agent execution (default 60)`),model:_().optional().describe(`Model to use for this agent hook (e.g., "claude-sonnet-4-6"). If not specified, uses Haiku.`),statusMessage:_().optional().describe(`Custom status message to display in spinner while hook runs`),once:S().optional().describe(`If true, hook runs once and is removed after execution`)})}}var B,Zi,Qi,V,$i=t((()=>{Ki(),T(),E(),Yi(),B=w(()=>_().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=w(()=>{let{BashCommandHookSchema:e,PromptHookSchema:t,AgentHookSchema:n,HttpHookSchema:r}=Xi();return ge(`type`,[e,t,n,r])}),Qi=w(()=>g({matcher:_().optional().describe(`String pattern to match (e.g. tool names like "Write")`),hooks:C(Zi()).describe(`List of hooks to execute when the matcher matches`)})),V=w(()=>ce(x(Gi),C(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 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 marketplaces. Only repositories from 'github.com/${ca}/' can use this name.`}return`The name '${e}' is reserved for official 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((()=>{T(),$i(),jt(),E(),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=w(()=>_().startsWith(`./`)),W=w(()=>U().endsWith(`.json`)),la=w(()=>v([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`),_().url().refine(e=>e.endsWith(`.mcpb`)||e.endsWith(`.dxt`),{message:`MCPB URL must end with .mcpb or .dxt`}).describe(`URL to MCPB file`)])),ua=w(()=>U().endsWith(`.md`)),da=w(()=>v([ua(),U()])),fa=w(()=>_().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 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=w(()=>g({name:_().min(1,`Author name cannot be empty`).describe(`Display name of the plugin author or organization`),email:_().optional().describe(`Contact email for support or feedback`),url:_().optional().describe(`Website, GitHub profile, or organization URL`)})),ma=w(()=>g({name:_().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:_().optional().describe(`Semantic version (e.g., 1.2.3) following semver.org specification`),description:_().optional().describe(`Brief, user-facing explanation of what the plugin provides`),author:pa().optional().describe(`Information about the plugin creator or maintainer`),homepage:_().url().optional().describe(`Plugin homepage or documentation URL`),repository:_().optional().describe(`Source code repository URL`),license:_().optional().describe(`SPDX license identifier (e.g., MIT, Apache-2.0)`),keywords:C(_()).optional().describe(`Tags for plugin discovery and categorization`),dependencies:C(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=w(()=>g({description:_().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=w(()=>g({hooks:v([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)`),C(v([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=w(()=>g({source:da().optional().describe(`Path to command markdown file, relative to plugin root`),content:_().optional().describe(`Inline markdown content for the command`),description:_().optional().describe(`Command description override`),argumentHint:_().optional().describe(`Hint for command arguments (e.g., "[file]")`),model:_().optional().describe(`Default model for this command`),allowedTools:C(_()).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=w(()=>g({commands:v([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`),C(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=w(()=>g({agents:v([ua().describe(`Path to additional agent file (in addition to those in the agents/ directory, if it exists), relative to the plugin root`),C(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=w(()=>g({skills:v([U().describe(`Path to additional skill directory (in addition to those in the skills/ directory, if it exists), relative to the plugin root`),C(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=w(()=>g({outputStyles:v([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`),C(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=w(()=>_().min(1)),Ca=w(()=>_().min(2).refine(e=>e.startsWith(`.`),{message:`File extensions must start with dot (e.g., ".ts", not "ts")`})),wa=w(()=>g({mcpServers:v([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`),C(v([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=w(()=>g({type:x([`string`,`number`,`boolean`,`directory`,`file`]).describe(`Type of the configuration value`),title:_().describe(`Human-readable label shown in the config dialog`),description:_().describe(`Help text shown beneath the field in the config dialog`),required:S().optional().describe(`If true, validation fails when this field is empty`),default:v([_(),b(),S(),C(_())]).optional().describe(`Default value used when the user provides nothing`),multiple:S().optional().describe(`For string type: allow an array of strings`),sensitive:S().optional().describe(`If true, masks dialog input and stores value in secure storage (keychain/credentials file) instead of settings.json`),min:b().optional().describe(`Minimum value (number type only)`),max:b().optional().describe(`Maximum value (number type only)`)}).strict()),Ea=w(()=>g({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=w(()=>g({channels:C(g({server:_().min(1).describe(`Name of the MCP server this channel binds to. Must match a key in this plugin's mcpServers.`),displayName:_().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=w(()=>fe({command:_().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:C(Sa()).optional().describe(`Command-line arguments to pass to the server`),extensionToLanguage:h(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:x([`stdio`,`socket`]).default(`stdio`).describe(`Communication transport mechanism`),env:h(_(),_()).optional().describe(`Environment variables to set when starting the server`),initializationOptions:le().optional().describe(`Initialization options passed to the server during initialization`),settings:le().optional().describe(`Settings passed to the server via workspace/didChangeConfiguration`),workspaceFolder:_().optional().describe(`Workspace folder path to use for the server`),startupTimeout:b().int().positive().optional().describe(`Maximum time to wait for server startup (milliseconds)`),shutdownTimeout:b().int().positive().optional().describe(`Maximum time to wait for graceful shutdown (milliseconds)`),restartOnCrash:S().optional().describe(`Whether to restart the server if it crashes`),maxRestarts:b().int().nonnegative().optional().describe(`Maximum number of restart attempts before giving up`)})),ka=w(()=>g({lspServers:v([W().describe(`Path to .lsp.json configuration file relative to plugin root`),h(_(),Oa()).describe(`LSP server configurations keyed by server name`),C(v([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=w(()=>_().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=w(()=>g({settings:h(_(),le()).optional().describe(`Settings to merge when plugin is enabled. Only allowlisted keys are kept (currently: agent)`)})),Ma=w(()=>g({...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=w(()=>ge(`source`,[g({source:y(`url`),url:_().url().describe(`Direct URL to marketplace.json file`),headers:h(_(),_()).optional().describe(`Custom HTTP headers (e.g., for authentication)`)}),g({source:y(`github`),repo:_().describe(`GitHub repository in owner/repo format`),ref:_().optional().describe(`Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.`),path:_().optional().describe(`Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)`),sparsePaths:C(_()).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.`)}),g({source:y(`git`),url:_().describe(`Full git repository URL`),ref:_().optional().describe(`Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.`),path:_().optional().describe(`Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)`),sparsePaths:C(_()).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.`)}),g({source:y(`npm`),package:Aa().describe(`NPM package containing marketplace.json`)}),g({source:y(`file`),path:_().describe(`Local file path to marketplace.json`)}),g({source:y(`directory`),path:_().describe(`Local directory containing .claude-plugin/marketplace.json`)}),g({source:y(`hostPattern`),hostPattern:_().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$").`)}),g({source:y(`pathPattern`),pathPattern:_().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.`)}),g({source:y(`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:C(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=w(()=>_().length(40).regex(/^[a-f0-9]{40}$/,`Must be a full 40-character lowercase git commit SHA`)),Fa=w(()=>v([U().describe(`Path to the plugin root, relative to the marketplace root (the directory containing .claude-plugin/, not .claude-plugin/ itself)`),g({source:y(`npm`),package:Aa().or(_()).describe("Package name (or url, or local path, or anything else that can be passed to `npm` as a package)"),version:_().optional().describe(`Specific version or version range (e.g., ^1.0.0, ~2.1.0)`),registry:_().url().optional().describe(`Custom NPM registry URL (defaults to using system default, likely npmjs.org)`)}).describe(`NPM package as plugin source`),g({source:y(`pip`),package:_().describe(`Python package name as it appears on PyPI`),version:_().optional().describe(`Version specifier (e.g., ==1.0.0, >=2.0.0, <3.0.0)`),registry:_().url().optional().describe(`Custom PyPI registry URL (defaults to using system default, likely pypi.org)`)}).describe(`Python package as plugin source`),g({source:y(`url`),url:_().describe(`Full git repository URL (https:// or git@)`),ref:_().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`)}),g({source:y(`github`),repo:_().describe(`GitHub repository in owner/repo format`),ref:_().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`)}),g({source:y(`git-subdir`),url:_().describe(`Git repository: GitHub owner/repo shorthand, https://, or git@ URL`),path:_().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:_().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=w(()=>g({name:_().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:_().optional(),version:_().optional(),strict:S().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=w(()=>Ma().partial().extend({name:_().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:_().optional().describe(`Category for organizing plugins (e.g., "productivity", "development")`),tags:C(_()).optional().describe(`Tags for searchability and discovery`),strict:S().optional().default(!0).describe(`Require the plugin manifest to be present in the plugin folder. If false, the marketplace entry provides the manifest.`)})),Ra=w(()=>g({name:fa(),owner:pa().describe(`Marketplace maintainer or curator information`),plugins:C(La()).describe(`Collection of available plugins in this marketplace`),forceRemoveDeletedPlugins:S().optional().describe(`When true, plugins removed from this marketplace will be automatically uninstalled and flagged for users`),metadata:g({pluginRoot:_().optional().describe(`Base path for relative plugin sources`),version:_().optional().describe(`Marketplace version`),description:_().optional().describe(`Marketplace description`)}).optional().describe(`Optional marketplace metadata`),allowCrossMarketplaceDependenciesOn:C(_()).optional().describe(`Marketplace names whose plugins may be auto-installed as dependencies. Only the root marketplace's allowlist applies — no transitive trust.`)})),G=w(()=>_().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=w(()=>v([_().regex(za,`Dependency must be a plugin name, optionally qualified with @marketplace`).transform(e=>e.replace(/@\^[^@]*$/,``)),g({name:_().min(1).regex(/^[a-z0-9][-a-z0-9._]*$/i),marketplace:_().min(1).regex(/^[a-z0-9][-a-z0-9._]*$/i).optional()}).loose().transform(e=>e.marketplace?`${e.name}@${e.marketplace}`:e.name)])),w(()=>v([G(),g({id:G().describe(`Plugin identifier (e.g., "formatter@tools")`),version:_().optional().describe(`Version constraint (e.g., "^2.0.0")`),required:S().optional().describe(`If true, cannot be disabled`),config:h(_(),le()).optional().describe(`Plugin-specific configuration`)})])),Va=w(()=>g({version:_().describe(`Currently installed version`),installedAt:_().describe(`ISO 8601 timestamp of installation`),lastUpdated:_().optional().describe(`ISO 8601 timestamp of last update`),installPath:_().describe(`Absolute path to the installed plugin directory`),gitCommitSha:_().optional().describe(`Git commit SHA for git-based plugins (for version tracking)`)})),Ha=w(()=>g({version:y(1).describe(`Schema version 1`),plugins:h(G(),Va()).describe(`Map of plugin IDs to their installation metadata`)})),Ua=w(()=>x([`managed`,`user`,`project`,`local`])),Wa=w(()=>g({scope:Ua().describe(`Installation scope`),projectPath:_().optional().describe(`Project path (required for project/local scopes)`),installPath:_().describe(`Absolute path to the versioned plugin directory`),version:_().optional().describe(`Currently installed version`),installedAt:_().optional().describe(`ISO 8601 timestamp of installation`),lastUpdated:_().optional().describe(`ISO 8601 timestamp of last update`),gitCommitSha:_().optional().describe(`Git commit SHA for git-based plugins`)})),Ga=w(()=>g({version:y(2).describe(`Schema version 2`),plugins:h(G(),C(Wa())).describe(`Map of plugin IDs to arrays of installation entries`)})),w(()=>v([Ha(),Ga()])),Ka=w(()=>g({source:Na().describe(`Where to fetch the marketplace from`),installLocation:_().describe(`Local cache path where marketplace manifest is stored`),lastUpdated:_().describe(`ISO 8601 timestamp of last marketplace refresh`),autoUpdate:S().optional().describe(`Whether to automatically update this marketplace and its installed plugins on startup`)})),qa=w(()=>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
2
  - Stops a running background task by its ID
3
3
  - Takes a task_id parameter identifying the task to stop
4
4
  - Returns a success or failure status
@@ -13,7 +13,7 @@ If you can answer right away, send the answer. If you need to go look — run a
13
13
 
14
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
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((()=>{T(),io(),E(),jo(),Gt(),Io(),Vo=new Set([`LocalVaultFetch`,`VaultHttpFetch`]),Ho=w(()=>_().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:me.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((()=>{T(),gi(),ie(),E(),Wi(),Ja(),si(),Uo(),$i(),qr(),qo=w(()=>h(_(),ue())),Jo=w(()=>g({allow:C(Ho()).optional().describe(`List of permission rules for allowed operations`),deny:C(Ho()).optional().describe(`List of permission rules for denied operations`),ask:C(Ho()).optional().describe(`List of permission rules that should always prompt for confirmation`),defaultMode:x(Jt).optional().describe(`Default permission mode when Work Mate needs access`),disableBypassPermissionsMode:x([`disable`]).optional().describe(`Disable the ability to bypass permission prompts`),disableAutoMode:x([`disable`]).optional().describe(`Disable auto mode`),additionalDirectories:C(_()).optional().describe(`Additional directories to include in the permission scope`)}).passthrough()),Yo=w(()=>g({source:Na().describe(`Where to fetch the marketplace from`),installLocation:_().optional().describe(`Local cache path where marketplace manifest is stored (auto-generated if not provided)`),autoUpdate:S().optional().describe(`Whether to automatically update this marketplace and its installed plugins on startup`)})),Xo=w(()=>g({serverName:_().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:C(_()).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:_().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=w(()=>g({serverName:_().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:C(_()).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:_().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=w(()=>g({$schema:y(oi).optional().describe(`JSON Schema reference for Work Mate settings`),apiKeyHelper:_().optional().describe(`Path to a script that outputs authentication values`),awsCredentialExport:_().optional().describe(`Path to a script that exports AWS credentials`),awsAuthRefresh:_().optional().describe(`Path to a script that refreshes AWS authentication`),gcpAuthRefresh:_().optional().describe(`Command to refresh GCP authentication (e.g., gcloud auth application-default login)`),...m(process.env.CLAUDE_CODE_ENABLE_XAA)?{xaaIdp:g({issuer:_().url().describe(`IdP issuer URL for OIDC discovery`),clientId:_().describe(`Work Mate's client_id registered at the IdP`),callbackPort:b().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:g({type:y(`command`),command:_()}).optional().describe(`Custom file suggestion configuration for @ mentions`),respectGitignore:S().optional().describe(`Whether file picker should respect .gitignore files (default: true). Note: .ignore files are always respected.`),cleanupPeriodDays:b().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 Work Mate sessions`),attribution:g({commit:_().optional().describe(`Attribution text for git commits, including any trailers. Empty string hides attribution.`),pr:_().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 Work Mate attribution if not set.`),includeCoAuthoredBy:S().optional().describe(`Deprecated: Use attribution instead. Whether to include Claude's co-authored by attribution in commits and PRs (defaults to true)`),includeGitInstructions:S().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:x([`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:_().optional().describe(`Override the default model used by Work Mate`),availableModels:C(_()).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(_(),_()).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:S().optional().describe(`Whether to automatically approve all MCP servers in the project`),enabledMcpjsonServers:C(_()).optional().describe(`List of approved MCP servers from .mcp.json`),disabledMcpjsonServers:C(_()).optional().describe(`List of rejected MCP servers from .mcp.json`),allowedMcpServers:C(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:C(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:g({symlinkDirectories:C(_()).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:C(_()).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:S().optional().describe(`Disable all hooks and statusLine execution`),defaultShell:x([`bash`,`powershell`]).optional().describe(`Default shell for input-box ! commands. Defaults to 'bash' on all platforms (no Windows auto-flip).`),allowManagedHooksOnly:S().optional().describe(`When true (and set in managed settings), only hooks from managed settings run. User, project, and local hooks are ignored.`),allowedHttpHookUrls:C(_()).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:C(_()).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:S().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:S().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:pe(e=>Array.isArray(e)?e.filter(e=>Qo.includes(e)):e,v([S(),C(x(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:g({type:y(`command`),command:_(),padding:b().optional(),refreshInterval:b().optional()}).optional().describe(`Custom status line display configuration`),statusLineEnabled:S().optional().describe(`Whether to render the fork built-in status line (model + ctx + 5h/7d limits + cost + cache pill). Toggled with /statusline.`),enabledPlugins:h(_(),v([C(_()),S(),he()])).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:C(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:C(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:x([`claudeai`,`console`]).optional().describe(`Force a specific login method: "claudeai" for Claude Pro/Max, "console" for Console billing`),forceLoginOrgUUID:_().optional().describe(`Organization UUID to use for OAuth login`),otelHeadersHelper:_().optional().describe(`Path to a script that outputs OpenTelemetry headers`),outputStyle:_().optional().describe(`Controls the output style for assistant responses`),language:_().optional().describe(`Preferred language for Claude responses (e.g., "japanese", "spanish")`),skipWebFetchPreflight:S().optional().describe(`Skip the WebFetch blocklist check for enterprise environments with restrictive security policies`),webSearchAdapter:x([`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:x([`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:_().optional().describe(`Custom Tavily API endpoint URL. Defaults to https://tavily.readmagic.workmate.win. Used by both WebSearch and WebFetch when tavily adapter is selected.`),braveApiKey:_().optional().describe(`Brave Search API key. Required when using the brave web search adapter.`),webFetchHttpTimeoutMs:b().int().positive().optional().describe(`HTTP timeout in milliseconds for the HTTP direct web fetch backend. Defaults to 60000 (60s).`),exaApiKey:_().optional().describe(`Exa AI API key. Required when using the exa web search adapter.`),exaEndpointUrl:_().optional().describe(`Custom Exa AI MCP endpoint URL. Defaults to https://mcp.exa.ai/mcp.`),sandbox:hi().optional(),feedbackSurveyRate:b().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:S().optional().describe(`Whether to show tips in the spinner`),spinnerVerbs:g({mode:x([`append`,`replace`]),verbs:C(_())}).optional().describe(`Customize spinner verbs. mode: "append" adds verbs to defaults, "replace" uses only your verbs.`),spinnerTipsOverride:g({excludeDefault:S().optional(),tips:C(_())}).optional().describe(`Override spinner tips. tips: array of tip strings. excludeDefault: if true, only show custom tips (default: false).`),syntaxHighlightingDisabled:S().optional().describe(`Whether to disable syntax highlighting in diffs`),terminalTitleFromRename:S().optional().describe(`Whether /rename updates the terminal tab title (defaults to true). Set to false to keep auto-generated topic titles.`),alwaysThinkingEnabled:S().optional().describe(`When false, thinking is disabled. When absent or true, thinking is enabled automatically for supported models.`),advisorModel:_().optional().describe(`Advisor model for the server-side advisor tool.`),fastMode:S().optional().describe(`When true, fast mode is enabled. When absent or false, fast mode is off.`),fastModePerSessionOptIn:S().optional().describe(`When true, fast mode does not persist across sessions. Each session starts with fast mode off.`),promptSuggestionEnabled:S().optional().describe(`When false, prompt suggestions are disabled. When absent or true, prompt suggestions are enabled.`),poorMode:S().optional().describe(`When true, poor mode is active — extract_memories and prompt_suggestion are disabled to save tokens.`),showClearContextOnPlanAccept:S().optional().describe(`When true, the plan-approval dialog offers a "clear context" option. Defaults to false.`),agent:_().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:C(_()).optional().describe(`Company announcements to display at startup (one will be randomly selected if multiple are provided)`),pluginConfigs:h(_(),g({mcpServers:h(_(),h(_(),v([_(),b(),S(),C(_())]))).optional().describe(`User configuration values for MCP servers keyed by server name`),options:h(_(),v([_(),b(),S(),C(_())])).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:g({defaultEnvironmentId:_().optional().describe(`Default environment ID to use for remote sessions`)}).optional().describe(`Remote session configuration`),autoUpdatesChannel:x([`latest`,`stable`]).optional().describe(`Release channel for auto-updates (latest or stable)`),disableDeepLinkRegistration:x([`disable`]).optional().describe(`Prevent claude-cli:// protocol handler registration with the OS`),minimumVersion:_().optional().describe(`Minimum version to stay on - prevents downgrades when switching to stable channel`),plansDirectory:_().optional().describe(`Custom directory for plan files, relative to project root. If not set, defaults to ~/.claude/plans/`),...process.env.USER_TYPE===`ant`?{classifierPermissionsEnabled:S().optional().describe(`Enable AI-based classification for Bash(prompt:...) permission rules`)}:{},minSleepDurationMs:b().nonnegative().int().optional().describe(`Minimum duration in milliseconds that the Sleep tool must sleep for. Useful for throttling proactive tick frequency.`),maxSleepDurationMs:b().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:S().optional().describe(`Start Claude in assistant mode (custom system prompt, brief view, scheduled check-in skills)`),assistantName:_().optional().describe(`Display name for the assistant, shown in the claude.ai session list`),channelsEnabled:S().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:C(g({marketplace:_(),plugin:_()})).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:x([`chat`,`transcript`]).optional().describe(`Default transcript view: chat (SendUserMessage checkpoints only) or transcript (full)`),prefersReducedMotion:S().optional().describe(`Reduce or disable animations for accessibility (spinner shimmer, flash effects, etc.)`),autoMemoryEnabled:S().optional().describe(`Enable auto-memory for this project. When false, Claude will not read from or write to the auto-memory directory.`),autoMemoryDirectory:_().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:S().optional().describe(`Enable background memory consolidation (auto-dream). When set, overrides the server-side default.`),showThinkingSummaries:S().optional().describe(`Show thinking summaries in the transcript view (ctrl+o). Default: false.`),skipDangerousModePermissionPrompt:S().optional().describe(`Whether the user has accepted the bypass permissions mode dialog`),skipAutoPermissionPrompt:S().optional().describe(`Whether the user has accepted the auto mode opt-in dialog`),useAutoModeDuringPlan:S().optional().describe(`Whether plan mode uses auto mode semantics when auto mode is available (default: true)`),autoMode:g({allow:C(_()).optional().describe(`Rules for the auto mode classifier allow section`),soft_deny:C(_()).optional().describe(`Rules for the auto mode classifier deny section`),...process.env.USER_TYPE===`ant`?{deny:C(_()).optional()}:{},environment:C(_()).optional().describe(`Entries for the auto mode classifier environment section`)}).optional().describe(`Auto mode classifier prompt customization`),disableAutoMode:x([`disable`]).optional().describe(`Disable auto mode`),sshConfigs:C(g({id:_().describe(`Unique identifier for this SSH config. Used to match configs across settings sources.`),name:_().describe(`Display name for the SSH connection`),sshHost:_().describe(`SSH host in format "user@hostname" or "hostname", or a host alias from ~/.ssh/config`),sshPort:b().int().optional().describe(`SSH port (default: 22)`),sshIdentityFile:_().optional().describe(`Path to SSH identity file (private key)`),startDirectory:_().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:C(_()).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:b().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:S().optional().describe(`Whether to show cache hit rate warnings in the message flow when the rate falls below cacheThreshold. Default: true.`),pluginTrustMessage:_().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:_().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 pt(se(J(),{unrepresentable:`any`}),null,2)}var ts=t((()=>{T(),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=at(e),n=J().strict().safeParse(t);return n.success?{isValid:!0}:{isValid:!1,error:`Settings validation failed:
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((()=>{T(),io(),E(),jo(),Gt(),Io(),Vo=new Set([`LocalVaultFetch`,`VaultHttpFetch`]),Ho=w(()=>_().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:me.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((()=>{T(),gi(),ie(),E(),Wi(),Ja(),si(),Uo(),$i(),qr(),qo=w(()=>h(_(),ue())),Jo=w(()=>g({allow:C(Ho()).optional().describe(`List of permission rules for allowed operations`),deny:C(Ho()).optional().describe(`List of permission rules for denied operations`),ask:C(Ho()).optional().describe(`List of permission rules that should always prompt for confirmation`),defaultMode:x(Jt).optional().describe(`Default permission mode when Work Mate needs access`),disableBypassPermissionsMode:x([`disable`]).optional().describe(`Disable the ability to bypass permission prompts`),disableAutoMode:x([`disable`]).optional().describe(`Disable auto mode`),additionalDirectories:C(_()).optional().describe(`Additional directories to include in the permission scope`)}).passthrough()),Yo=w(()=>g({source:Na().describe(`Where to fetch the marketplace from`),installLocation:_().optional().describe(`Local cache path where marketplace manifest is stored (auto-generated if not provided)`),autoUpdate:S().optional().describe(`Whether to automatically update this marketplace and its installed plugins on startup`)})),Xo=w(()=>g({serverName:_().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:C(_()).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:_().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=w(()=>g({serverName:_().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:C(_()).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:_().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=w(()=>g({$schema:y(oi).optional().describe(`JSON Schema reference for Work Mate settings`),apiKeyHelper:_().optional().describe(`Path to a script that outputs authentication values`),awsCredentialExport:_().optional().describe(`Path to a script that exports AWS credentials`),awsAuthRefresh:_().optional().describe(`Path to a script that refreshes AWS authentication`),gcpAuthRefresh:_().optional().describe(`Command to refresh GCP authentication (e.g., gcloud auth application-default login)`),...m(process.env.CLAUDE_CODE_ENABLE_XAA)?{xaaIdp:g({issuer:_().url().describe(`IdP issuer URL for OIDC discovery`),clientId:_().describe(`Work Mate's client_id registered at the IdP`),callbackPort:b().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:g({type:y(`command`),command:_()}).optional().describe(`Custom file suggestion configuration for @ mentions`),respectGitignore:S().optional().describe(`Whether file picker should respect .gitignore files (default: true). Note: .ignore files are always respected.`),cleanupPeriodDays:b().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 Work Mate sessions`),attribution:g({commit:_().optional().describe(`Attribution text for git commits, including any trailers. Empty string hides attribution.`),pr:_().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 Work Mate attribution if not set.`),includeCoAuthoredBy:S().optional().describe(`Deprecated: Use attribution instead. Whether to include Claude's co-authored by attribution in commits and PRs (defaults to true)`),includeGitInstructions:S().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:x([`anthropic`,`openai`,`gemini`,`grok`]).optional().describe(`API provider type. "anthropic" uses the first-party 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:_().optional().describe(`Override the default model used by Work Mate`),availableModels:C(_()).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(_(),_()).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:S().optional().describe(`Whether to automatically approve all MCP servers in the project`),enabledMcpjsonServers:C(_()).optional().describe(`List of approved MCP servers from .mcp.json`),disabledMcpjsonServers:C(_()).optional().describe(`List of rejected MCP servers from .mcp.json`),allowedMcpServers:C(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:C(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:g({symlinkDirectories:C(_()).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:C(_()).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:S().optional().describe(`Disable all hooks and statusLine execution`),defaultShell:x([`bash`,`powershell`]).optional().describe(`Default shell for input-box ! commands. Defaults to 'bash' on all platforms (no Windows auto-flip).`),allowManagedHooksOnly:S().optional().describe(`When true (and set in managed settings), only hooks from managed settings run. User, project, and local hooks are ignored.`),allowedHttpHookUrls:C(_()).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:C(_()).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:S().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:S().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:pe(e=>Array.isArray(e)?e.filter(e=>Qo.includes(e)):e,v([S(),C(x(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:g({type:y(`command`),command:_(),padding:b().optional(),refreshInterval:b().optional()}).optional().describe(`Custom status line display configuration`),statusLineEnabled:S().optional().describe(`Whether to render the fork built-in status line (model + ctx + 5h/7d limits + cost + cache pill). Toggled with /statusline.`),enabledPlugins:h(_(),v([C(_()),S(),he()])).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:C(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:C(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:x([`claudeai`,`console`]).optional().describe(`Force a specific login method: "claudeai" for Claude Pro/Max, "console" for Console billing`),forceLoginOrgUUID:_().optional().describe(`Organization UUID to use for OAuth login`),otelHeadersHelper:_().optional().describe(`Path to a script that outputs OpenTelemetry headers`),outputStyle:_().optional().describe(`Controls the output style for assistant responses`),language:_().optional().describe(`Preferred language for Claude responses (e.g., "japanese", "spanish")`),skipWebFetchPreflight:S().optional().describe(`Skip the WebFetch blocklist check for enterprise environments with restrictive security policies`),webSearchAdapter:x([`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:x([`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:_().optional().describe(`Custom Tavily API endpoint URL. Defaults to https://tavily.readmagic.workmate.win. Used by both WebSearch and WebFetch when tavily adapter is selected.`),braveApiKey:_().optional().describe(`Brave Search API key. Required when using the brave web search adapter.`),webFetchHttpTimeoutMs:b().int().positive().optional().describe(`HTTP timeout in milliseconds for the HTTP direct web fetch backend. Defaults to 60000 (60s).`),exaApiKey:_().optional().describe(`Exa AI API key. Required when using the exa web search adapter.`),exaEndpointUrl:_().optional().describe(`Custom Exa AI MCP endpoint URL. Defaults to https://mcp.exa.ai/mcp.`),sandbox:hi().optional(),feedbackSurveyRate:b().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:S().optional().describe(`Whether to show tips in the spinner`),spinnerVerbs:g({mode:x([`append`,`replace`]),verbs:C(_())}).optional().describe(`Customize spinner verbs. mode: "append" adds verbs to defaults, "replace" uses only your verbs.`),spinnerTipsOverride:g({excludeDefault:S().optional(),tips:C(_())}).optional().describe(`Override spinner tips. tips: array of tip strings. excludeDefault: if true, only show custom tips (default: false).`),syntaxHighlightingDisabled:S().optional().describe(`Whether to disable syntax highlighting in diffs`),terminalTitleFromRename:S().optional().describe(`Whether /rename updates the terminal tab title (defaults to true). Set to false to keep auto-generated topic titles.`),alwaysThinkingEnabled:S().optional().describe(`When false, thinking is disabled. When absent or true, thinking is enabled automatically for supported models.`),advisorModel:_().optional().describe(`Advisor model for the server-side advisor tool.`),fastMode:S().optional().describe(`When true, fast mode is enabled. When absent or false, fast mode is off.`),fastModePerSessionOptIn:S().optional().describe(`When true, fast mode does not persist across sessions. Each session starts with fast mode off.`),promptSuggestionEnabled:S().optional().describe(`When false, prompt suggestions are disabled. When absent or true, prompt suggestions are enabled.`),poorMode:S().optional().describe(`When true, poor mode is active — extract_memories and prompt_suggestion are disabled to save tokens.`),showClearContextOnPlanAccept:S().optional().describe(`When true, the plan-approval dialog offers a "clear context" option. Defaults to false.`),agent:_().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:C(_()).optional().describe(`Company announcements to display at startup (one will be randomly selected if multiple are provided)`),pluginConfigs:h(_(),g({mcpServers:h(_(),h(_(),v([_(),b(),S(),C(_())]))).optional().describe(`User configuration values for MCP servers keyed by server name`),options:h(_(),v([_(),b(),S(),C(_())])).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:g({defaultEnvironmentId:_().optional().describe(`Default environment ID to use for remote sessions`)}).optional().describe(`Remote session configuration`),autoUpdatesChannel:x([`latest`,`stable`]).optional().describe(`Release channel for auto-updates (latest or stable)`),disableDeepLinkRegistration:x([`disable`]).optional().describe(`Prevent claude-cli:// protocol handler registration with the OS`),minimumVersion:_().optional().describe(`Minimum version to stay on - prevents downgrades when switching to stable channel`),plansDirectory:_().optional().describe(`Custom directory for plan files, relative to project root. If not set, defaults to ~/.claude/plans/`),...process.env.USER_TYPE===`ant`?{classifierPermissionsEnabled:S().optional().describe(`Enable AI-based classification for Bash(prompt:...) permission rules`)}:{},minSleepDurationMs:b().nonnegative().int().optional().describe(`Minimum duration in milliseconds that the Sleep tool must sleep for. Useful for throttling proactive tick frequency.`),maxSleepDurationMs:b().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:S().optional().describe(`Start Claude in assistant mode (custom system prompt, brief view, scheduled check-in skills)`),assistantName:_().optional().describe(`Display name for the assistant, shown in the claude.ai session list`),channelsEnabled:S().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:C(g({marketplace:_(),plugin:_()})).optional().describe(`Teams/Enterprise allowlist of channel plugins. When set, replaces the default allowlist — admins decide which plugins may push inbound messages. Undefined falls back to the default. Requires channelsEnabled: true.`),defaultView:x([`chat`,`transcript`]).optional().describe(`Default transcript view: chat (SendUserMessage checkpoints only) or transcript (full)`),prefersReducedMotion:S().optional().describe(`Reduce or disable animations for accessibility (spinner shimmer, flash effects, etc.)`),autoMemoryEnabled:S().optional().describe(`Enable auto-memory for this project. When false, Claude will not read from or write to the auto-memory directory.`),autoMemoryDirectory:_().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:S().optional().describe(`Enable background memory consolidation (auto-dream). When set, overrides the server-side default.`),showThinkingSummaries:S().optional().describe(`Show thinking summaries in the transcript view (ctrl+o). Default: false.`),skipDangerousModePermissionPrompt:S().optional().describe(`Whether the user has accepted the bypass permissions mode dialog`),skipAutoPermissionPrompt:S().optional().describe(`Whether the user has accepted the auto mode opt-in dialog`),useAutoModeDuringPlan:S().optional().describe(`Whether plan mode uses auto mode semantics when auto mode is available (default: true)`),autoMode:g({allow:C(_()).optional().describe(`Rules for the auto mode classifier allow section`),soft_deny:C(_()).optional().describe(`Rules for the auto mode classifier deny section`),...process.env.USER_TYPE===`ant`?{deny:C(_()).optional()}:{},environment:C(_()).optional().describe(`Entries for the auto mode classifier environment section`)}).optional().describe(`Auto mode classifier prompt customization`),disableAutoMode:x([`disable`]).optional().describe(`Disable auto mode`),sshConfigs:C(g({id:_().describe(`Unique identifier for this SSH config. Used to match configs across settings sources.`),name:_().describe(`Display name for the SSH connection`),sshHost:_().describe(`SSH host in format "user@hostname" or "hostname", or a host alias from ~/.ssh/config`),sshPort:b().int().optional().describe(`SSH port (default: 22)`),sshIdentityFile:_().optional().describe(`Path to SSH identity file (private key)`),startDirectory:_().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:C(_()).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:b().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:S().optional().describe(`Whether to show cache hit rate warnings in the message flow when the rate falls below cacheThreshold. Default: true.`),pluginTrustMessage:_().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:_().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 pt(se(J(),{unrepresentable:`any`}),null,2)}var ts=t((()=>{T(),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=at(e),n=J().strict().safeParse(t);return n.success?{isValid:!0}:{isValid:!1,error:`Settings validation failed:
17
17
  `+fs(n.error,`settings`).map(e=>`- ${e.path}: ${e.message}`).join(`
18
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(dt(`MDM settings load completed in ${r}ms`),Object.keys(t.settings).length>0){dt(`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=k(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=k(O(A(F(),`managed-settings.json`)),!1);if(e&&typeof e==`object`&&Object.keys(e).length>0)return!0}catch{}try{let e=I(),t=D().readdirSync(e);for(let n of t)if(!(!(n.isFile()||n.isSymbolicLink())||!n.name.endsWith(`.json`)||n.name.startsWith(`.`)))try{let t=k(O(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((()=>{ut(),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=D().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=ot(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=D().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`?dt(`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?mt(t.settings):null,errors:t.errors};let n=Ys(e);return ve(e,n),{settings:n.settings?mt(n.settings):null,errors:n.errors}}function Ys(e){try{let{resolvedPath:t}=lt(D(),e),n=O(t);if(n.trim()===``)return{settings:{},errors:[]};let r=k(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{D().mkdirSync(Qt(n));let r=ec(e);if(!r){let e=null;try{e=O(n)}catch(e){if(!ct(e))throw e}if(e!==null){let t=k(e);if(t===null)return{error:Error(`Invalid JSON syntax in settings file at ${n}`)};t&&typeof t==`object`&&(r=t,dt(`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,pt(i,null,2)+`
19
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=g({allow:C(_()).optional(),soft_deny:C(_()).optional(),deny:C(_()).optional(),environment:C(_()).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}=lt(D(),n),r=O(t);if(!r.trim())continue;let i=k(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(),T(),Be(),Ur(),qr(),ut(),vt(),ie(),ht(),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};
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{A as t,E as n,M as r,T as i,n as a,r as o,t as s}from"./lazySchema-DcIJE_0i.js";import{en as c}from"./state-ix0xIunV.js";import{VE as l,Za as u}from"./loadAgentsDir-Clu7Uk6a.js";import{z as d}from"./debug-BrXObCdR.js";import{g as f}from"./settings-Dlp5JTa_.js";import{g as p}from"./config-3m_9zSrj.js";import{_ as m,j as h}from"./git-Do0wJvux.js";import{u as g}from"./oauth-BqJqV-2M.js";import{Bt as _,wi as v}from"./model-BQF64tZx.js";import"path";import"fs/promises";var y,b=e((()=>{o(),s(),y=a(()=>n({entries:t(r(),r())})),a(()=>n({userId:r(),version:i(),lastModified:r(),checksum:r(),content:y()}))})),x=e((()=>{c(),g(),_(),l(),p(),h(),d(),m(),v(),f(),u(),b()}));export{x as t};
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{A as t,E as n,M as r,T as i,n as a,r as o,t as s}from"./lazySchema-DcIJE_0i.js";import{en as c}from"./state-ix0xIunV.js";import{VE as l,Za as u}from"./loadAgentsDir-D206qwP3.js";import{z as d}from"./debug-BrXObCdR.js";import{g as f}from"./settings-BovzmwMP.js";import{g as p}from"./config-DmomySWC.js";import{_ as m,j as h}from"./git-Do0wJvux.js";import{u as g}from"./oauth-BqJqV-2M.js";import{Bt as _,wi as v}from"./model-CKkOnnnx.js";import"path";import"fs/promises";var y,b=e((()=>{o(),s(),y=a(()=>n({entries:t(r(),r())})),a(()=>n({userId:r(),version:i(),lastModified:r(),checksum:r(),content:y()}))})),x=e((()=>{c(),g(),_(),l(),p(),h(),d(),m(),v(),f(),u(),b()}));export{x as t};