@readmagic/workmate 0.0.22 → 0.0.23

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 (394) hide show
  1. package/dist/chunks/{AddWorkspaceDirectory-DWgTWJ7R.js → AddWorkspaceDirectory-OgcBcK5A.js} +1 -1
  2. package/dist/chunks/AgentsMdExternalIncludesDialog-CDNd5-7E.js +1 -0
  3. package/dist/chunks/{AgentsMdExternalIncludesDialog-s0Orgord.js → AgentsMdExternalIncludesDialog-CNEifEyV.js} +1 -1
  4. package/dist/chunks/App-B-3tPQ3k.js +1 -0
  5. package/dist/chunks/BackgroundTasksDialog-COuhHcey.js +2 -0
  6. package/dist/chunks/{BypassPermissionsModeDialog-D2Gesf-u.js → BypassPermissionsModeDialog-bJek4siJ.js} +1 -1
  7. package/dist/chunks/CustomSelect-DoeEXOIP.js +1 -0
  8. package/dist/chunks/{DiffDialog-v2IiYyi3.js → DiffDialog-B3X9FMpO.js} +5 -5
  9. package/dist/chunks/Doctor-6PXyjIi6.js +3 -0
  10. package/dist/chunks/Doctor-DNgkgYhB.js +1 -0
  11. package/dist/chunks/{ExitFlow-BasHk1mk.js → ExitFlow-DgAZp_8U.js} +2 -2
  12. package/dist/chunks/Grove-CHatOzcE.js +11 -0
  13. package/dist/chunks/{InvalidConfigDialog-DYVQK5js.js → InvalidConfigDialog-DXL92MN9.js} +1 -1
  14. package/dist/chunks/{InvalidSettingsDialog-Dg6OiStR.js → InvalidSettingsDialog-Dtmpzeps.js} +1 -1
  15. package/dist/chunks/{KeybindingProviderSetup-Bn1jzN5F.js → KeybindingProviderSetup-DA37QUFs.js} +1 -1
  16. package/dist/chunks/MCPConnectionManager-thZd-xA_.js +1 -0
  17. package/dist/chunks/MCPToolListView-CpY-YJg4.js +1 -0
  18. package/dist/chunks/{McpParsingWarnings-DZejAh8b.js → McpParsingWarnings-JvChf3xr.js} +1 -1
  19. package/dist/chunks/MessageSelector-C0_iw7SI.js +3 -0
  20. package/dist/chunks/Messages-K4DDsDP9.js +10 -0
  21. package/dist/chunks/Onboarding-C1UdzM-1.js +1 -0
  22. package/dist/chunks/{PromptInputFooterSuggestions-lkr_A5jQ.js → PromptInputFooterSuggestions-AyLog8p7.js} +1 -1
  23. package/dist/chunks/{PromptInputHelpMenu-DaQKKyM5.js → PromptInputHelpMenu-oyic20ip.js} +1 -1
  24. package/dist/chunks/ProviderSetup-XcBHjUnd.js +1 -0
  25. package/dist/chunks/QueryEngine-DYxBjJ4i.js +1 -0
  26. package/dist/chunks/REPL-CQBJRrT0.js +124 -0
  27. package/dist/chunks/REPL-CrVuMQY2.js +1 -0
  28. package/dist/chunks/ResumeConversation-Dl8H9Gfy.js +1 -0
  29. package/dist/chunks/SearchExtraToolsTool-lv7VE50N.js +1 -0
  30. package/dist/chunks/{SelectMulti-CNE06VAN.js → SelectMulti-Bc6l11_K.js} +1 -1
  31. package/dist/chunks/Settings-TGp3fPrS.js +3 -0
  32. package/dist/chunks/Spinner-zYPFVFHN.js +1 -0
  33. package/dist/chunks/{SpinnerGlyph-A6G-gloN.js → SpinnerGlyph-CmkRUvHe.js} +1 -1
  34. package/dist/chunks/{TextInput-7uqPhq9T.js → TextInput-CD9iau2k.js} +5 -5
  35. package/dist/chunks/{ThemePicker-DT9zVy-0.js → ThemePicker-0F0hZYPX.js} +1 -1
  36. package/dist/chunks/TrustDialog-C76YiMKz.js +1 -0
  37. package/dist/chunks/{ValidationErrorsList-BLtP647v.js → ValidationErrorsList-DgNzJQUP.js} +1 -1
  38. package/dist/chunks/_baseEach-4ff-vRlp.js +1 -0
  39. package/dist/chunks/add-dir-JMsRLGfx.js +1 -0
  40. package/dist/chunks/{agentDisplay-vLQHFrmq.js → agentDisplay-BReJUBWg.js} +1 -1
  41. package/dist/chunks/agents-9qQ8I6zW.js +101 -0
  42. package/dist/chunks/{agents-DLz0kfsr.js → agents-B3x8yJ_r.js} +1 -1
  43. package/dist/chunks/allErrors-DfWylHSw.js +1 -0
  44. package/dist/chunks/{appleTerminalBackup-BYKdf3of.js → appleTerminalBackup-BArZWB21.js} +1 -1
  45. package/dist/chunks/backgroundHousekeeping-BGxHB_OX.js +1 -0
  46. package/dist/chunks/backgroundHousekeeping-CVNIhQg8.js +17 -0
  47. package/dist/chunks/banner-Cu2-XUek.js +2 -0
  48. package/dist/chunks/{bedrockClient-DxE_mHFI.js → bedrockClient-CfiDN-kF.js} +2 -2
  49. package/dist/chunks/branch-C4TsMEkx.js +2 -0
  50. package/dist/chunks/{break-cache-BL2gnDLX.js → break-cache-BMXqFTeS.js} +2 -2
  51. package/dist/chunks/btw-Dn1eYFAz.js +1 -0
  52. package/dist/chunks/caches-BGzKwpnc.js +1 -0
  53. package/dist/chunks/caches-DArHxBgL.js +1 -0
  54. package/dist/chunks/{claudeDesktop-D3PEgx3U.js → claudeDesktop-D8ml2767.js} +1 -1
  55. package/dist/chunks/{clear-CXfhVRp8.js → clear-Bdhb6b39.js} +1 -1
  56. package/dist/chunks/{client-DdenNfkQ.js → client-4iqhC8xq.js} +1 -1
  57. package/dist/chunks/client-BiqbIkwr.js +1 -0
  58. package/dist/chunks/client-CZ8nyVh5.js +1 -0
  59. package/dist/chunks/{client-DvhWKIOx.js → client-CpTCeWba.js} +1 -1
  60. package/dist/chunks/commands-QepeBbFn.js +1 -0
  61. package/dist/chunks/compact-Bu9BUpxV.js +2 -0
  62. package/dist/chunks/config-C-Y2qtB2.js +3 -0
  63. package/dist/chunks/config-D58C3_Lu.js +1 -0
  64. package/dist/chunks/config-DD8fCYXn.js +1 -0
  65. package/dist/chunks/{context-3s9wtn4L.js → context-CY_yfdYa.js} +1 -1
  66. package/dist/chunks/context-noninteractive-BDDi3NLF.js +1 -0
  67. package/dist/chunks/{context-noninteractive-CJhUu_4y.js → context-noninteractive-Dd4xIoP1.js} +5 -5
  68. package/dist/chunks/conversation-B0wxBwzv.js +1 -0
  69. package/dist/chunks/conversation-DUu9qBnq.js +1 -0
  70. package/dist/chunks/conversationRecovery-2ft8sCPE.js +1 -0
  71. package/dist/chunks/crossProjectResume-6boHMUBx.js +40 -0
  72. package/dist/chunks/cwd-Dc3NV7s8.js +1 -0
  73. package/dist/chunks/cwd-Pa83R95t.js +1 -0
  74. package/dist/chunks/{datadog-v_mXWncN.js → datadog-BPuGcxxC.js} +1 -1
  75. package/dist/chunks/{debug-8DCufdSp.js → debug-Bglx1aTu.js} +5 -5
  76. package/dist/chunks/{detectRepository-DfX8xXw2.js → detectRepository-CfX8Lc0A.js} +1 -1
  77. package/dist/chunks/{diff-DJSt7QO6.js → diff-BOAElpfQ.js} +1 -1
  78. package/dist/chunks/{directoryCompletion-CT6YVeg7.js → directoryCompletion-D_Rtg-4j.js} +1 -1
  79. package/dist/chunks/dist-es-B3-7VFf2.js +1 -0
  80. package/dist/chunks/dist-es-B7j_mv242.js +1 -0
  81. package/dist/chunks/dist-es-BSKD_hOQ.js +1 -0
  82. package/dist/chunks/dist-es-BSRN-2nA.js +9 -0
  83. package/dist/chunks/{dist-es-yHGBqhBe.js → dist-es-BXXmyhQ2.js} +1 -1
  84. package/dist/chunks/{dist-es-C3reqy7X.js → dist-es-BaQndfvh2.js} +1 -1
  85. package/dist/chunks/dist-es-CzTYn7xo.js +1 -0
  86. package/dist/chunks/dist-es-DSkyibcN.js +1 -0
  87. package/dist/chunks/{dist-es-BOPBJQo3.js → dist-es-_UNJQniz.js} +1 -1
  88. package/dist/chunks/dist-es-hwK6468D.js +1 -0
  89. package/dist/chunks/dist-es-ovsdbtwh.js +1 -0
  90. package/dist/chunks/doctor-CkLzqAMd.js +1 -0
  91. package/dist/chunks/{entry-ex0-RyYV.js → entry-TNOoyy7_.js} +4 -4
  92. package/dist/chunks/{envUtils-DcaKZlRU.js → envUtils-DfkgIdYf.js} +1 -1
  93. package/dist/chunks/esm-eTAUP-La.js +1 -0
  94. package/dist/chunks/{execFileNoThrow-BsfuytkN.js → execFileNoThrow-BTachNBI.js} +1 -1
  95. package/dist/chunks/exit-DXApFJIP.js +1 -0
  96. package/dist/chunks/extraUsage-CmQaLPV1.js +1 -0
  97. package/dist/chunks/extractMemories-xP63mv6R.js +1 -0
  98. package/dist/chunks/fast-C5nQH8rm.js +1 -0
  99. package/dist/chunks/fast-eGx2IxD7.js +1 -0
  100. package/dist/chunks/fetchModelList-CxLsVNsu.js +1 -0
  101. package/dist/chunks/fetchModelList-D24lRIgR.js +1 -0
  102. package/dist/chunks/{fileSuggestions-B-SLfb-o.js → fileSuggestions-DHxdwq28.js} +2 -2
  103. package/dist/chunks/firstPartyEventLogger-BVAogAX8.js +1 -0
  104. package/dist/chunks/firstPartyEventLogger-M6UMli2c.js +3 -0
  105. package/dist/chunks/{gemini-BC9kHhwe.js → gemini-D_ORb_L6.js} +2 -2
  106. package/dist/chunks/generateSessionName-BQoDduyA.js +1 -0
  107. package/dist/chunks/{genericProcessUtils-BYi0OefF.js → genericProcessUtils-DwQFuna9.js} +1 -1
  108. package/dist/chunks/goal-D7c2mSds.js +3 -0
  109. package/dist/chunks/grok-B2-ZbUiR.js +1 -0
  110. package/dist/chunks/grove-O6qp7ITR.js +1 -0
  111. package/dist/chunks/{help-CK90i4hE.js → help-CZJdRviD.js} +1 -1
  112. package/dist/chunks/history-CQiUERTL.js +1 -0
  113. package/dist/chunks/hooks-BNuUlMzL.js +1 -0
  114. package/dist/chunks/{hooks-BRFDg9DV.js → hooks-DIvN6gdv.js} +3 -3
  115. package/dist/chunks/{install-ZMll-dAa.js → install-T_CV1Slu.js} +1 -1
  116. package/dist/chunks/instrumentation-BjqUZ383.js +21 -0
  117. package/dist/chunks/{job-G_ukhLc4.js → job-R6c4-3c8.js} +1 -1
  118. package/dist/chunks/keybindings-CLRaiL_Z.js +1 -0
  119. package/dist/chunks/{launchLocalMemory-BcRlXLm6.js → launchLocalMemory-DrbKrwXc.js} +2 -2
  120. package/dist/chunks/launchOnboarding-tqsMD8ni.js +8 -0
  121. package/dist/chunks/loadAgentsDir-CcmY8zCj.js +1 -0
  122. package/dist/chunks/{loadAgentsDir-C1LkW7gl.js → loadAgentsDir-DlPbtIsS.js} +540 -543
  123. package/dist/chunks/loadPluginHooks-C_msxVIc.js +1 -0
  124. package/dist/chunks/{loader-C61fB6vU.js → loader-CICGtLp2.js} +1 -1
  125. package/dist/chunks/{localSearch-DFo_WTMm.js → localSearch-CK-sFzPm.js} +1 -1
  126. package/dist/chunks/localSearch-DrUj0B-d.js +1 -0
  127. package/dist/chunks/{log-DaILwWJa.js → log-D2TIwHBV.js} +1 -1
  128. package/dist/chunks/logoUtils-x2pHV-Nl.js +1 -0
  129. package/dist/chunks/{magicDocs-DYc9TFmI.js → magicDocs-BEF8D3if.js} +3 -3
  130. package/dist/chunks/main-kOVUGxOS.js +345 -0
  131. package/dist/chunks/managedEnv-BEqrGqn1.js +1 -0
  132. package/dist/chunks/managedEnv-OPlzUPbJ.js +1 -0
  133. package/dist/chunks/mcp-BNd29r6p.js +6 -0
  134. package/dist/chunks/mcp-D0wAJrRT.js +1 -0
  135. package/dist/chunks/mcp-mgOlm1cY.js +2 -0
  136. package/dist/chunks/memory-DDLk9_LJ.js +1 -0
  137. package/dist/chunks/{mode-Pan-Q2c4.js → mode-CcNsWgK3.js} +2 -2
  138. package/dist/chunks/model-BwBG0V1u.js +1 -0
  139. package/dist/chunks/model-DzCP4K-9.js +1 -0
  140. package/dist/chunks/modelOptions-DRaG3bo0.js +1 -0
  141. package/dist/chunks/nativeInstaller-C3pVPqrZ.js +1 -0
  142. package/dist/chunks/notifications-4wP1Tx9Y.js +1 -0
  143. package/dist/chunks/onChangeAppState-BlaoFbYF.js +1 -0
  144. package/dist/chunks/openai-CDN71NdX.js +2 -0
  145. package/dist/chunks/{overlayContext-CMV7nYR9.js → overlayContext-BT2Lq8ei.js} +1 -1
  146. package/dist/chunks/{panel-D9fGQgln.js → panel-CVS4SK_E.js} +1 -1
  147. package/dist/chunks/parser-CG5RuOCK.js +1 -0
  148. package/dist/chunks/{parser-D8slvrJP.js → parser-Cg6hSCmn.js} +1 -1
  149. package/dist/chunks/partition-CIl_ORUT.js +1 -0
  150. package/dist/chunks/{pasteStore-DNV1M5Xd.js → pasteStore-P0zP-ch0.js} +1 -1
  151. package/dist/chunks/permissions-zSNOZSwr.js +3 -0
  152. package/dist/chunks/pidLock-BTqO-h7Y.js +3 -0
  153. package/dist/chunks/{plan-CQLnPLuE.js → plan-Bs6em6lk.js} +1 -1
  154. package/dist/chunks/{platform-Dzff1WWw.js → platform-BacQ6ACS.js} +1 -1
  155. package/dist/chunks/plugin-DDDxjBa0.js +17 -0
  156. package/dist/chunks/{pluginAutoupdate-BJaAqwTH.js → pluginAutoupdate-8qugAFhb.js} +1 -1
  157. package/dist/chunks/pluginBlocklist-q01ackCf.js +1 -0
  158. package/dist/chunks/pluginCliCommands-DXZfCZsv.js +1 -0
  159. package/dist/chunks/{pluginFlagging-DQP8tBi2.js → pluginFlagging-BG2MHCQJ.js} +1 -1
  160. package/dist/chunks/pluginOperations-hXYLrzM2.js +2 -0
  161. package/dist/chunks/{pluginStartupCheck-CfRvCrFg.js → pluginStartupCheck-DTMa6TgL.js} +1 -1
  162. package/dist/chunks/pluginStartupCheck-HS1ZceZa.js +1 -0
  163. package/dist/chunks/plugins-COoGBYk6.js +4 -0
  164. package/dist/chunks/{poorMode-J5SYJvoY.js → poorMode-B0QGV6Ci.js} +1 -1
  165. package/dist/chunks/poorMode-G-pnu6NM.js +1 -0
  166. package/dist/chunks/print-BASybEtO.js +13 -0
  167. package/dist/chunks/processBashCommand-DDi_Pymt.js +1 -0
  168. package/dist/chunks/processSlashCommand-Cq9kaoSF.js +5 -0
  169. package/dist/chunks/{projectContext-Bw3o5BrN.js → projectContext-5fmRr6Sd.js} +1 -1
  170. package/dist/chunks/{projectContext-BN2ZWzOG.js → projectContext-DhtjLv3k.js} +1 -1
  171. package/dist/chunks/{projectOnboardingState-CJycxw5P.js → projectOnboardingState-B5YATuc6.js} +1 -1
  172. package/dist/chunks/prompt-CHobfCB1.js +1 -0
  173. package/dist/chunks/prompt-CMm6RHHc.js +1 -0
  174. package/dist/chunks/{prompt-BGqgPgCU.js → prompt-mM79EGnT.js} +1 -1
  175. package/dist/chunks/{promptEditor-CmQ9p4oe.js → promptEditor-DLGN_eLu.js} +1 -1
  176. package/dist/chunks/{protocolHandler-CJo9-PfZ.js → protocolHandler-DjQALaU2.js} +1 -1
  177. package/dist/chunks/{proxy-CB17QimU.js → proxy-CDBfZjO7.js} +2 -2
  178. package/dist/chunks/reconciler-CeXqh95g.js +1 -0
  179. package/dist/chunks/refresh-Ce2yk28a.js +1 -0
  180. package/dist/chunks/{registerProtocol-CLIpzVwF.js → registerProtocol-CAsDme_E.js} +1 -1
  181. package/dist/chunks/reject-Bld5E-bn.js +1 -0
  182. package/dist/chunks/{reload-plugins-DjugL8jH.js → reload-plugins-C42xSB5l.js} +1 -1
  183. package/dist/chunks/rename-CtBghpxZ.js +1 -0
  184. package/dist/chunks/{renderOptions-Zqfm2U1y.js → renderOptions-DV0dn0IW.js} +1 -1
  185. package/dist/chunks/resume-BWkaTDqd.js +2 -0
  186. package/dist/chunks/ripgrep-DLs8MraF.js +1 -0
  187. package/dist/chunks/{ripgrep-BuzOTf1S.js → ripgrep-Dl3y5r4m.js} +1 -1
  188. package/dist/chunks/{runtimeObserver-CK_iZ6OB.js → runtimeObserver-1wQO8HSZ.js} +1 -1
  189. package/dist/chunks/{runtimeObserver-CpP0L9T9.js → runtimeObserver-XQrOux41.js} +4 -4
  190. package/dist/chunks/sandbox-adapter-8GO6eJxw.js +1 -0
  191. package/dist/chunks/{sandbox-toggle-KOHYvbQT.js → sandbox-toggle-Dir9Polo.js} +1 -1
  192. package/dist/chunks/searchExtraTools-BhDq8DTJ.js +1 -0
  193. package/dist/chunks/{select-C_KXmqbI.js → select-Bxf5-5sI.js} +1 -1
  194. package/dist/chunks/sessionFileAccessHooks-CozocHQE.js +1 -0
  195. package/dist/chunks/sessionObserver-DGEQM4cO.js +1 -0
  196. package/dist/chunks/{sessionObserver-WOYv2n7C.js → sessionObserver-DS4G6mb9.js} +2 -2
  197. package/dist/chunks/sessionStorage-BcAscOGE.js +1 -0
  198. package/dist/chunks/sessionTracing-BoDDYLxW.js +11 -0
  199. package/dist/chunks/settings-B2jvL8Dp.js +24 -0
  200. package/dist/chunks/settings-CisDe8DB.js +1 -0
  201. package/dist/chunks/setup-BRypY6iT.js +3 -0
  202. package/dist/chunks/{shadowedRuleDetection-Df-kZ_pK.js → shadowedRuleDetection-BRxZjobz.js} +1 -1
  203. package/dist/chunks/{sideQuestion-CMB8hfgX.js → sideQuestion-DLJxyrlp.js} +3 -3
  204. package/dist/chunks/sinks-CGdKmq_8.js +1 -0
  205. package/dist/chunks/sinks-Cz2HfgMU.js +1 -0
  206. package/dist/chunks/skillChangeDetector-xviGstqm.js +1 -0
  207. package/dist/chunks/{skillGapStore-CfmlO6pb.js → skillGapStore-CKN_d3pO.js} +2 -2
  208. package/dist/chunks/{skillLifecycle-BQ2LMfMx.js → skillLifecycle-BMY2JGGG.js} +2 -2
  209. package/dist/chunks/{skillSearchPanel-BwYuwLFs.js → skillSearchPanel-D9trHULQ.js} +2 -2
  210. package/dist/chunks/{skills-BVHPQma0.js → skills-CX_AvwLG.js} +1 -1
  211. package/dist/chunks/startupProfiler-BH0FoI66.js +1 -0
  212. package/dist/chunks/{startupProfiler-DTs9w9EN.js → startupProfiler-CJdr3SxP.js} +2 -2
  213. package/dist/chunks/state-B4jiUise.js +1 -0
  214. package/dist/chunks/state-BhOKSFi5.js +1 -0
  215. package/dist/chunks/status-Daaak6Bo.js +1 -0
  216. package/dist/chunks/statusNoticeHelpers-vFVgIYuw.js +1 -0
  217. package/dist/chunks/{stringUtils-BQm3OfeJ.js → stringUtils-C718f5ey.js} +1 -1
  218. package/dist/chunks/sts-ei3CGBNu.js +1 -0
  219. package/dist/chunks/switcher-BpgmH4AI.js +1 -0
  220. package/dist/chunks/{switcher-Bq1Ct_Sn.js → switcher-CAajZeNL.js} +1 -1
  221. package/dist/chunks/{tasks-0c8Uy04D.js → tasks-BWNQr2d3.js} +1 -1
  222. package/dist/chunks/{templateJobs-BdFzE9XG.js → templateJobs-gUET39Ho.js} +1 -1
  223. package/dist/chunks/{terminalSetup-Cf_r6pwK.js → terminalSetup-B_10N_gE.js} +3 -3
  224. package/dist/chunks/{terminalSetup-D7J6bxcn.js → terminalSetup-qc2PlvOm.js} +1 -1
  225. package/dist/chunks/{theme-Bby4fssR.js → theme-B7fKI6E5.js} +1 -1
  226. package/dist/chunks/tipRegistry-DamZr34w.js +2 -0
  227. package/dist/chunks/{toolEventObserver-CzFZUIsM.js → toolEventObserver-BL06sDI4.js} +1 -1
  228. package/dist/chunks/toolPool-CX5wDBi1.js +1 -0
  229. package/dist/chunks/{types-zk5Ltv5q.js → types-Dx7P7JLQ.js} +2 -2
  230. package/dist/chunks/udsClient-cQz6nJ_T.js +1 -0
  231. package/dist/chunks/{use-select-navigation-DMaC_3iw.js → use-select-navigation-BiUJdWai.js} +1 -1
  232. package/dist/chunks/{useExitOnCtrlCDWithKeybindings-CjW3gUOt.js → useExitOnCtrlCDWithKeybindings-C9BYG8Bo.js} +1 -1
  233. package/dist/chunks/useMainLoopModel-DwjSVzzO.js +1 -0
  234. package/dist/chunks/useManagePlugins-BqfIVa6E.js +1 -0
  235. package/dist/chunks/{useMergedTools-DarmnCEw.js → useMergedTools-Bw8FchX8.js} +1 -1
  236. package/dist/chunks/{useSearchInput-C2JuUW3g.js → useSearchInput-B25K1RnK.js} +1 -1
  237. package/dist/chunks/useSettingsErrors-DYQ44kX4.js +1 -0
  238. package/dist/chunks/{util-Bq5l7FF5.js → util-CtlC2dsN.js} +1 -1
  239. package/dist/chunks/validatePlugin-D6tFo87L.js +1 -0
  240. package/dist/chunks/vim-CoRp9lY1.js +1 -0
  241. package/dist/chunks/worktree-B8apCnVe.js +1 -0
  242. package/dist/cli.js +1 -1
  243. package/package.json +1 -5
  244. package/dist/chunks/AgentsMdExternalIncludesDialog-DCvgQ6n3.js +0 -1
  245. package/dist/chunks/App-BcEI6U5j.js +0 -1
  246. package/dist/chunks/ApproveApiKey-DegdTXZl.js +0 -1
  247. package/dist/chunks/ApproveApiKey-_VXIMSwY.js +0 -1
  248. package/dist/chunks/BackgroundTasksDialog-CjBt1L0p.js +0 -2
  249. package/dist/chunks/CustomSelect-B46Eh0gU.js +0 -1
  250. package/dist/chunks/Doctor-BP0Rqraa.js +0 -1
  251. package/dist/chunks/Doctor-By_y3C2V.js +0 -3
  252. package/dist/chunks/Grove-C3mhgshv.js +0 -11
  253. package/dist/chunks/MCPConnectionManager-ChN4Ayjk.js +0 -1
  254. package/dist/chunks/MCPToolListView-DLSrQHDc.js +0 -1
  255. package/dist/chunks/MessageSelector-CdDlJE48.js +0 -3
  256. package/dist/chunks/Messages-DuL_r1Or.js +0 -10
  257. package/dist/chunks/Onboarding-CE2GNA-h.js +0 -1
  258. package/dist/chunks/QueryEngine-DNNy1UCD.js +0 -1
  259. package/dist/chunks/REPL-CEhW-C41.js +0 -1
  260. package/dist/chunks/REPL-CkSL4C_8.js +0 -124
  261. package/dist/chunks/ResumeConversation-BMCO_3X7.js +0 -1
  262. package/dist/chunks/SearchExtraToolsTool-DSy_jDhf.js +0 -1
  263. package/dist/chunks/Settings-mDykHLok.js +0 -2
  264. package/dist/chunks/Spinner-DwsJJUtn.js +0 -1
  265. package/dist/chunks/TrustDialog-G4jM9IfM.js +0 -1
  266. package/dist/chunks/add-dir-7RfQAC3h.js +0 -1
  267. package/dist/chunks/agents-BNg_skSm.js +0 -101
  268. package/dist/chunks/allErrors-DaztSMrw.js +0 -1
  269. package/dist/chunks/auth-BTB00dq5.js +0 -10
  270. package/dist/chunks/auth-Bbc0Ny8i.js +0 -1
  271. package/dist/chunks/backgroundHousekeeping-DYz83_8C.js +0 -1
  272. package/dist/chunks/backgroundHousekeeping-bEZtlJSf.js +0 -17
  273. package/dist/chunks/banner-mqZEluky.js +0 -2
  274. package/dist/chunks/branch-exFKkymg.js +0 -2
  275. package/dist/chunks/btw-3l78DYET.js +0 -1
  276. package/dist/chunks/caches-6Nx6tsk9.js +0 -1
  277. package/dist/chunks/caches-ouaWB9bY.js +0 -1
  278. package/dist/chunks/client-C01Bnxxv.js +0 -1
  279. package/dist/chunks/client-DYRgRQsr.js +0 -1
  280. package/dist/chunks/commands-BoxOw75F.js +0 -1
  281. package/dist/chunks/compact-BOYr105K.js +0 -2
  282. package/dist/chunks/config-BddEvZZl.js +0 -3
  283. package/dist/chunks/config-GEv9hUzz.js +0 -1
  284. package/dist/chunks/config-kw4xg7Nk.js +0 -1
  285. package/dist/chunks/context-noninteractive-DFvoZ2L9.js +0 -1
  286. package/dist/chunks/conversation-CoGharlH.js +0 -1
  287. package/dist/chunks/conversation-MxEVm54C.js +0 -1
  288. package/dist/chunks/conversationRecovery-Da_8uldZ.js +0 -1
  289. package/dist/chunks/crossProjectResume-CzPCHq_K.js +0 -40
  290. package/dist/chunks/cwd-BcO6WHKo.js +0 -1
  291. package/dist/chunks/cwd-CDUelriw.js +0 -1
  292. package/dist/chunks/dist-es-5t7v8oaj.js +0 -1
  293. package/dist/chunks/dist-es-BIjDeceU.js +0 -1
  294. package/dist/chunks/dist-es-C-OjW2Ao.js +0 -1
  295. package/dist/chunks/dist-es-CEk66gUu.js +0 -1
  296. package/dist/chunks/dist-es-CIULjvtA2.js +0 -1
  297. package/dist/chunks/dist-es-CMtO44xC.js +0 -1
  298. package/dist/chunks/dist-es-CYPVg66r.js +0 -9
  299. package/dist/chunks/dist-es-D1Y8zSMI.js +0 -1
  300. package/dist/chunks/dist-es-Gt_DpXlP.js +0 -1
  301. package/dist/chunks/dist-es-kj-F5A132.js +0 -1
  302. package/dist/chunks/doctor-DWvioSU9.js +0 -1
  303. package/dist/chunks/esm-BQY8jJNR.js +0 -1
  304. package/dist/chunks/exit-BxC_ZEtO.js +0 -1
  305. package/dist/chunks/extraUsage-DYm33Occ.js +0 -1
  306. package/dist/chunks/extractMemories-CzN3Ax2B.js +0 -1
  307. package/dist/chunks/fast-DqUpl_Lr.js +0 -1
  308. package/dist/chunks/fast-NUdUyAaM.js +0 -1
  309. package/dist/chunks/fetchModelList-CqsTAWEN.js +0 -1
  310. package/dist/chunks/fetchModelList-DBMHE6Ng.js +0 -1
  311. package/dist/chunks/firstPartyEventLogger-C0q45h_4.js +0 -3
  312. package/dist/chunks/firstPartyEventLogger-CP8hCBDj.js +0 -1
  313. package/dist/chunks/generateSessionName-ChvKBVxB.js +0 -1
  314. package/dist/chunks/goal-ByyimpVU.js +0 -3
  315. package/dist/chunks/grok-DenjixMl.js +0 -1
  316. package/dist/chunks/grove-Dq8QbQ9o.js +0 -7
  317. package/dist/chunks/history-CNQNd6hT.js +0 -1
  318. package/dist/chunks/hooks-BaYwmkxD.js +0 -1
  319. package/dist/chunks/instrumentation-BwVyvRfY.js +0 -21
  320. package/dist/chunks/keybindings-wNxBzDVQ.js +0 -1
  321. package/dist/chunks/launchOnboarding-CDjQ64RO.js +0 -8
  322. package/dist/chunks/loadAgentsDir-DKXap_Om.js +0 -1
  323. package/dist/chunks/loadPluginHooks-DtmHtEiS.js +0 -1
  324. package/dist/chunks/localSearch-BB9x5C2N.js +0 -1
  325. package/dist/chunks/logoUtils-Dj_2SWmO.js +0 -1
  326. package/dist/chunks/main-BRg8L_aw.js +0 -346
  327. package/dist/chunks/managedEnv-DsqAYOJ4.js +0 -1
  328. package/dist/chunks/managedEnv-lybrMred.js +0 -1
  329. package/dist/chunks/mcp-Bsw3cMiJ.js +0 -6
  330. package/dist/chunks/mcp-DDdud6Y7.js +0 -1
  331. package/dist/chunks/mcp-DbgTDUt7.js +0 -2
  332. package/dist/chunks/memory-CzwTzihf.js +0 -1
  333. package/dist/chunks/model-BYfmXKHf.js +0 -1
  334. package/dist/chunks/model-BwBE0Pt5.js +0 -1
  335. package/dist/chunks/modelOptions-DvNBapgG.js +0 -1
  336. package/dist/chunks/nativeInstaller-DnSNJWIi.js +0 -1
  337. package/dist/chunks/notifications-B0DTaYoy.js +0 -1
  338. package/dist/chunks/omit-Dl1Us_PY.js +0 -1
  339. package/dist/chunks/onChangeAppState-4KOJMN82.js +0 -1
  340. package/dist/chunks/openai-C_6C1_0N.js +0 -10
  341. package/dist/chunks/parser-BKAVMTyD.js +0 -1
  342. package/dist/chunks/partition-B504IgAa.js +0 -1
  343. package/dist/chunks/permissions-CLFMhdRk.js +0 -3
  344. package/dist/chunks/pidLock-D9do1Afy.js +0 -3
  345. package/dist/chunks/plugin-BYdF7uob.js +0 -17
  346. package/dist/chunks/pluginBlocklist-DKKmOnWM.js +0 -1
  347. package/dist/chunks/pluginCliCommands-z8TtJMKH.js +0 -1
  348. package/dist/chunks/pluginOperations-BcfJCDco.js +0 -2
  349. package/dist/chunks/pluginStartupCheck-Cq4PvULa.js +0 -1
  350. package/dist/chunks/plugins-CTM8jpOw.js +0 -4
  351. package/dist/chunks/policyLimits-a7ix6GnU.js +0 -1
  352. package/dist/chunks/poorMode-C11JEH3d.js +0 -1
  353. package/dist/chunks/print-u6MzL5Cr.js +0 -13
  354. package/dist/chunks/processBashCommand-DIwrI2QC.js +0 -1
  355. package/dist/chunks/processSlashCommand-B-Gujpxm.js +0 -5
  356. package/dist/chunks/prompt-BPJDGlx5.js +0 -1
  357. package/dist/chunks/prompt-DEdZzkEz.js +0 -1
  358. package/dist/chunks/reconciler-DSKLuOS7.js +0 -1
  359. package/dist/chunks/refresh-BbZFCNpn.js +0 -1
  360. package/dist/chunks/rename-DOtCOtEr.js +0 -1
  361. package/dist/chunks/resume-BB4T4WIV.js +0 -2
  362. package/dist/chunks/ripgrep-CZ2CqaHb.js +0 -1
  363. package/dist/chunks/sandbox-adapter-DhJJ6WOV.js +0 -1
  364. package/dist/chunks/searchExtraTools-CdJghGkj.js +0 -1
  365. package/dist/chunks/sessionFileAccessHooks-D7KbWFp7.js +0 -1
  366. package/dist/chunks/sessionObserver-DB-sLv-X.js +0 -1
  367. package/dist/chunks/sessionStorage-sgOAbDn7.js +0 -1
  368. package/dist/chunks/sessionTracing-yBre24PH.js +0 -11
  369. package/dist/chunks/settings-C-KNkvsM.js +0 -1
  370. package/dist/chunks/settings-DKN4xSpQ.js +0 -24
  371. package/dist/chunks/setup-CN_Pk7AR.js +0 -3
  372. package/dist/chunks/sinks-BS17vtN0.js +0 -1
  373. package/dist/chunks/sinks-D1EjkHb4.js +0 -1
  374. package/dist/chunks/skillChangeDetector-CBKuGuEi.js +0 -1
  375. package/dist/chunks/startupProfiler-B_U4QDtf.js +0 -1
  376. package/dist/chunks/state-BowF111d.js +0 -1
  377. package/dist/chunks/state-CGuyDES7.js +0 -1
  378. package/dist/chunks/status-BurdTfyz.js +0 -2
  379. package/dist/chunks/status-DMq1An5h.js +0 -1
  380. package/dist/chunks/statusNoticeHelpers-X75JNlx5.js +0 -1
  381. package/dist/chunks/sts-C2Gf2WYN.js +0 -1
  382. package/dist/chunks/switcher-DGD4ORVf.js +0 -1
  383. package/dist/chunks/tipRegistry-CyRXWWTz.js +0 -2
  384. package/dist/chunks/toolPool-CnrZcprA.js +0 -1
  385. package/dist/chunks/udsClient-ftP0yIpe.js +0 -1
  386. package/dist/chunks/useMainLoopModel-DWscpA9I.js +0 -1
  387. package/dist/chunks/useManagePlugins-CYXVcql2.js +0 -1
  388. package/dist/chunks/useSettingsErrors-DutJBiKZ.js +0 -1
  389. package/dist/chunks/validatePlugin-DIdEydz_.js +0 -1
  390. package/dist/chunks/vim-D8prM2IH.js +0 -1
  391. package/dist/chunks/worktree-Caqt2WRZ.js +0 -1
  392. /package/dist/chunks/{dist-es-Cgsa8pb82.js → dist-es-Cgsa8pb8.js} +0 -0
  393. /package/dist/chunks/{dist-es-Cwru7c2B2.js → dist-es-Cwru7c2B.js} +0 -0
  394. /package/dist/chunks/{dist-es-DXIR5NLi2.js → dist-es-DXIR5NLi.js} +0 -0
@@ -1 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Ec as t,GS as n,Gu as r,HS as i,RS as a,Sf as o,Tc as s,VS as c,Wu as l,Zi as u,bf as d,mm as f,nx as p,pm as m,tx as h,xf as g,yf as _}from"./loadAgentsDir-C1LkW7gl.js";import{I as v,t as y}from"./src-DL3w8VPk.js";import{t as b}from"./jsx-runtime-Bb4Xn-E0.js";import{A as x,L as S,N as C}from"./debug-8DCufdSp.js";import{h as w,t as T}from"./settings-DKN4xSpQ.js";import{n as E,r as D}from"./analytics-DJobLaWP.js";import{bt as O,yt as k}from"./prompt-BGqgPgCU.js";import{randomUUID as A}from"crypto";y(),d(),r(),o();var j=b();function M({input:e,progress:t,verbose:n}){return(0,j.jsxs)(v,{flexDirection:`column`,marginTop:1,children:[(0,j.jsx)(l,{addMargin:!1,param:{text:`<bash-input>${e}</bash-input>`,type:`text`}}),t?(0,j.jsx)(g,{fullOutput:t.fullOutput,output:t.output,elapsedTimeSeconds:t.elapsedTimeSeconds,totalLines:t.totalLines,verbose:n}):_.renderToolUseProgressMessage?.([],{verbose:n,tools:[],terminalSize:void 0})]})}S(),E(),h(),u(),w();function N(){return T().defaultShell??`bash`}d(),k(),f();async function P(r,o,l,u,d){let f=O()&&N()===`powershell`;D(`tengu_input_bash`,{powershell:f});let h=i({content:n({inputString:`<bash-input>${r}</bash-input>`,precedingInputBlocks:o})}),g;d({jsx:(0,j.jsx)(M,{input:r,progress:null,verbose:u.options.verbose}),shouldHidePromptInput:!1});try{let n={...u,setToolJSX:e=>{g=e?.jsx}},o=e=>{d({jsx:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(M,{input:r,progress:e.data,verbose:u.options.verbose}),g]}),shouldHidePromptInput:!1,showSpinner:!1})},c=null;f&&(c=(t(),e(s)).PowerShellTool);let v=c??_,y=(c?await c.call({command:r,dangerouslyDisableSandbox:!0},n,void 0,void 0,o):await _.call({command:r,dangerouslyDisableSandbox:!0},n,void 0,void 0,o)).data;if(!y)throw Error(`No result received from shell command`);let b=y.stderr,x=await p(v,{...y,stderr:``},A()),S=typeof x.content==`string`?x.content:m(y.stdout);return{messages:[a(),h,...l,i({content:`<bash-stdout>${S}</bash-stdout><bash-stderr>${m(b)}</bash-stderr>`})],shouldQuery:!1}}catch(e){return e instanceof x?e.interrupted?{messages:[a(),h,c({toolUse:!1}),...l],shouldQuery:!1}:{messages:[a(),h,...l,i({content:`<bash-stdout>${m(e.stdout)}</bash-stdout><bash-stderr>${m(e.stderr)}</bash-stderr>`})],shouldQuery:!1}:{messages:[a(),h,...l,i({content:`<bash-stderr>Command failed: ${m(C(e))}</bash-stderr>`})],shouldQuery:!1}}finally{d(null)}}export{P as processBashCommand};
@@ -1,5 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{ct as t,ot as n}from"./esm-BQY8jJNR.js";import{$d as r,$h as i,$o as a,AS as o,Ah as s,B as c,Bs as l,Ci as u,Cx as d,Dd as f,E as p,Ea as m,Ed as h,Ei as g,FS as _,GS as v,HS as y,Ii as b,KS as x,Lm as S,Ni as C,Og as w,Oh as T,Oi as E,Pg as D,Pi as O,Qd as k,Ql as A,RS as j,Rs as M,Sx as N,US as ee,V as te,VS as ne,Vs as re,Xl as ie,Zi as ae,Zl as oe,au as se,b as ce,bp as le,cd as ue,dc as de,dv as fe,ef as pe,es as me,fS as he,fa as ge,fc as _e,fv as P,iu as F,kg as I,ld as ve,mS as L,ng as ye,ns as be,od as xe,pS as R,qS as Se,sd as z,tu as Ce,ud as we,xx as Te,yp as Ee,zS as De,zm as Oe}from"./loadAgentsDir-C1LkW7gl.js";import{Ln as ke,t as Ae,ut as je,zt as Me}from"./state-BowF111d.js";import{E as Ne,L as Pe,c as B,f as Fe,i as V,k as H,u as Ie}from"./debug-8DCufdSp.js";import{Dt as Le,Et as Re}from"./settings-DKN4xSpQ.js";import{D as U,O as W,o as G,q as ze,s as K}from"./log-DaILwWJa.js";import{n as Be,r as q}from"./analytics-DJobLaWP.js";import{Ht as Ve,Sr as He,Vt as Ue,xr as We}from"./model-BwBE0Pt5.js";import{E as Ge,T as Ke,w as qe}from"./sessionTracing-yBre24PH.js";import{randomUUID as J}from"crypto";function Je(e,t,n,r,i){let a=0;for(let o of Le){let s=n[o];if(s)for(let n of s)for(let s of n.hooks){let c=s.once?()=>{B(`Removing one-shot hook for event ${o} in skill '${r}'`),we(e,t,o,s)}:void 0;ue(e,t,o,n.matcher||``,s,c,i),a++}}a>0&&B(`Registered ${a} hooks from skill '${r}'`)}var Ye=e((()=>{Re(),V(),ve()}));function Xe(e){let t=e.trim();if(!t.startsWith(`/`))return null;let n=t.slice(1).split(` `);if(!n[0])return null;let r=n[0],i=!1,a=1;n.length>1&&n[1]===`(MCP)`&&(r=`${r} (MCP)`,i=!0,a=2);let o=n.slice(a).join(` `);return{commandName:r,args:o,isMcp:i}}var Ze=e((()=>{}));function Qe(){return!1}function $e(){if(!Qe())throw Error(`ToolUseContext.options.allowBackgroundForkedSlashCommands is test-only and cannot be enabled outside NODE_ENV=test.`)}async function et(e,t,n,a,o,s,c){let l=h(),u=e.pluginInfo?L(e.pluginInfo.repository).marketplace:void 0;q(`tengu_slash_command_forked`,{command_name:e.name,invocation_trigger:`user-slash`,...e.pluginInfo&&{_PROTO_plugin_name:e.pluginInfo.pluginManifest.name,...u&&{_PROTO_marketplace_name:u},...A(e.pluginInfo)}});let{skillContent:d,modifiedGetAppState:f,baseAgent:p,promptMessages:m}=await re(e,t,n);B(`Executing forked slash command /${e.name} with agent ${p.agentType}`);let g=n.options.allowBackgroundForkedSlashCommands===!0;if(g&&$e(),g){let t=fe(),i=b(e),a=We(),o=e=>I({value:e,mode:`prompt`,priority:`later`,isMeta:!0,skipSlashCommands:!0,workload:a}),u=async()=>{if(!c?.runId)return;let e=await k({runId:c.runId,rootDir:c.rootDir,priority:`later`,workload:a});for(let t of e)w(t)},d=async e=>{c?.runId&&await r({runId:c.runId,rootDir:c.rootDir,error:e instanceof Error?e.message:String(e)})};return(async()=>{let r=Date.now()+$;for(;Date.now()<r&&n.getAppState().mcp.clients.some(e=>e.type===`pending`);)await Ve(Q);let a=n.options.refreshTools?.()??n.options.tools,c=[];for await(let r of z({agentDefinition:p,promptMessages:m,toolUseContext:{...n,getAppState:f,abortController:t},canUseTool:s,isAsync:!0,querySource:`agent:custom`,model:e.model,availableTools:a,override:{agentId:l}}))c.push(r);let d=M(c,`Command completed`);B(`Background forked command /${i} completed (agent ${l})`),o(`<scheduled-task-result command="/${i}">\n${d}\n</scheduled-task-result>`);try{await u()}catch(e){K(e)}})().catch(async e=>{K(e),o(`<scheduled-task-result command="/${i}" status="failed">\n${e instanceof Error?e.message:String(e)}\n</scheduled-task-result>`),await d(e)}),{messages:[],shouldQuery:!1,command:e,deferAutonomyCompletion:!!c?.runId}}let _=[],x=[],S=`forked-command-${e.name}`,C=0,T=e=>(C++,{type:`progress`,data:{message:e,type:`agent_progress`,prompt:d,agentId:l},parentToolUseID:S,toolUseID:`${S}-${C}`,timestamp:new Date().toISOString(),uuid:J()}),E=()=>{o({jsx:se(x,{tools:n.options.tools,verbose:!1}),shouldHidePromptInput:!1,shouldContinueAnimation:!0,showSpinner:!0})};E();try{for await(let t of z({agentDefinition:p,promptMessages:m,toolUseContext:{...n,getAppState:f},canUseTool:s,isAsync:!1,querySource:`agent:custom`,model:e.model,availableTools:n.options.tools})){_.push(t);let e=ge([t]);if(t.type===`assistant`){let r=i(t);r>0&&n.setResponseLength(e=>e+r);let a=e[0];a&&a.type===`assistant`&&(x.push(T(t)),E())}if(t.type===`user`){let t=e[0];t&&t.type===`user`&&(x.push(T(t)),E())}}}finally{o(null)}let D=M(_,`Command completed`);return B(`Forked slash command /${e.name} completed with agent ${l}`),{messages:[y({content:v({inputString:`/${b(e)} ${t}`.trim(),precedingInputBlocks:a})}),y({content:`<local-command-stdout>\n${D}\n</local-command-stdout>`})],shouldQuery:!1,command:e,resultText:D}}function tt(e){return!/[^a-zA-Z0-9:\-_]/.test(e)}async function nt(e,t,n,r,i,a,s,c,l,d){let f=Xe(e);if(!f){q(`tengu_input_slash_missing`,{});let e="Commands are in the form `/command [args]`";return{messages:[j(),...r,y({content:v({inputString:e,precedingInputBlocks:t})})],shouldQuery:!1,resultText:e}}let{commandName:p,args:h,isMcp:g}=f,_=g?`mcp`:u().has(p)?p:`custom`;if(!C(p,i.options.commands)){let n=!1;try{await Ie().stat(`/${p}`),n=!0}catch{}if(tt(p)&&!n){q(`tengu_input_slash_invalid`,{input:p});let e=`Unknown skill: ${p}`;return{messages:[j(),...r,y({content:v({inputString:e,precedingInputBlocks:t})}),...h?[De(`Args from unknown skill: ${h}`,`warning`)]:[]],shouldQuery:!1,resultText:e}}let i=J();return ke(i),q(`tengu_input_prompt`,{}),Ke(`user_prompt`,{prompt_length:String(e.length),prompt:Ge(e),"prompt.id":i}),{messages:[y({content:v({inputString:e,precedingInputBlocks:t}),uuid:s}),...r],shouldQuery:!0}}let{messages:b,shouldQuery:x,allowedTools:S,model:w,command:T,resultText:E,nextInput:D,submitNextInput:O,deferAutonomyCompletion:k}=await rt(p,h,a,i,t,n,c,l,s,d);if(b.length===0){let e={input:_};if(T.type===`prompt`&&T.pluginInfo){let{pluginManifest:t,repository:n}=T.pluginInfo,{marketplace:r}=L(n),i=R(r);e._PROTO_plugin_name=t.name,r&&(e._PROTO_marketplace_name=r),e.plugin_repository=i?n:`third-party`,e.plugin_name=i?t.name:`third-party`,i&&t.version&&(e.plugin_version=t.version),Object.assign(e,A(T.pluginInfo))}return q(`tengu_input_command`,{...e,invocation_trigger:`user-slash`}),{messages:[],shouldQuery:!1,model:w,nextInput:D,submitNextInput:O,deferAutonomyCompletion:k}}if(b.length===2&&b[1].type===`user`&&typeof b[1].message.content==`string`&&b[1].message.content.startsWith(`Unknown command:`))return e.startsWith(`/var`)||e.startsWith(`/tmp`)||e.startsWith(`/private`)||q(`tengu_input_slash_invalid`,{input:p}),{messages:[j(),...b],shouldQuery:x,allowedTools:S,model:w};let M={input:_};if(T.type===`prompt`&&T.pluginInfo){let{pluginManifest:e,repository:t}=T.pluginInfo,{marketplace:n}=L(t),r=R(n);M._PROTO_plugin_name=e.name,n&&(M._PROTO_marketplace_name=n),M.plugin_repository=r?t:`third-party`,M.plugin_name=r?e.name:`third-party`,r&&e.version&&(M.plugin_version=e.version),Object.assign(M,A(T.pluginInfo))}q(`tengu_input_command`,{...M,invocation_trigger:`user-slash`});let N=b.length>0&&b[0]&&o(b[0]);return{messages:x||b.every(m)||N?b:[j(),...b],shouldQuery:x,allowedTools:S,model:w,resultText:E,nextInput:D,submitNextInput:O,deferAutonomyCompletion:k}}async function rt(e,t,n,r,i,a,o,l,u,d){let f=E(e,r.options.commands);if(f.type===`prompt`&&f.userInvocable!==!1&&oe(e),f.userInvocable===!1)return{messages:[y({content:v({inputString:`/${e}`,precedingInputBlocks:i})}),y({content:`This skill can only be invoked by Work Mate, not directly by users. Ask Work Mate to use the "${e}" skill for you.`})],shouldQuery:!1,command:f};try{switch(f.type){case`local-jsx`:return new Promise(e=>{let a=!1,o=(n,r)=>{if(a=!0,r?.display===`skip`){e({messages:[],shouldQuery:!1,command:f,nextInput:r?.nextInput,submitNextInput:r?.submitNextInput});return}let o=(r?.metaMessages??[]).map(e=>y({content:e,isMeta:!0})),s=le()&&typeof n==`string`&&n.endsWith(` dismissed`),c=r?.displayArgs??t;e({messages:r?.display===`system`?s?o:[_(Y(f,c)),_(`<local-command-stdout>${n}</local-command-stdout>`),...o]:[y({content:v({inputString:Y(f,c),precedingInputBlocks:i})}),y(n?{content:`<local-command-stdout>${n}</local-command-stdout>`}:{content:`<local-command-stdout>${x}</local-command-stdout>`}),...o],shouldQuery:r?.shouldQuery??!1,command:f,nextInput:r?.nextInput,submitNextInput:r?.submitNextInput})};f.load().then(e=>e.call(o,{...r,canUseTool:l},t)).then(t=>{if(t!=null){if(r.options.isNonInteractiveSession){e({messages:[],shouldQuery:!1,command:f});return}a||n({jsx:t,shouldHidePromptInput:!0,showSpinner:!1,isLocalJSXCommand:!0,isImmediate:f.immediate===!0})}}).catch(t=>{K(t),!a&&(a=!0,n({jsx:null,shouldHidePromptInput:!1,clearLocalJSX:!0}),e({messages:[],shouldQuery:!1,command:f}))})});case`local`:{let e=y({content:v({inputString:Y(f,f.isSensitive&&t.trim()?`***`:t),precedingInputBlocks:i})});try{let n=j(),i=await(await f.load()).call(t,r);if(i.type===`skip`)return{messages:[],shouldQuery:!1,command:f};if(i.type===`compact`){let t=[n,e,...i.displayText?[y({content:`<local-command-stdout>${i.displayText}</local-command-stdout>`,timestamp:new Date(Date.now()+100).toISOString()})]:[]],r={...i.compactionResult,messagesToKeep:[...i.compactionResult.messagesToKeep??[],...t]};return s(),{messages:S(r),shouldQuery:!1,command:f}}return{messages:[e,_(`<local-command-stdout>${i.value}</local-command-stdout>`)],shouldQuery:!1,command:f,resultText:i.value}}catch(t){return K(t),{messages:[e,_(`<local-command-stderr>${String(t)}</local-command-stderr>`)],shouldQuery:!1,command:f}}}case`prompt`:try{return f.context===`fork`?await et(f,t,r,i,n,l??c,d):await Z(f,t,r,i,a,u)}catch(e){return e instanceof Ne?{messages:[y({content:v({inputString:Y(f,t),precedingInputBlocks:i})}),ne({toolUse:!1})],shouldQuery:!1,command:f}:{messages:[y({content:v({inputString:Y(f,t),precedingInputBlocks:i})}),y({content:`<local-command-stderr>${String(e)}</local-command-stderr>`})],shouldQuery:!1,command:f}}}}catch(e){if(e instanceof H)return{messages:[y({content:v({inputString:e.message,precedingInputBlocks:i})})],shouldQuery:!1,command:f};throw e}}function Y(e,t){return ee(b(e),t)}function X(e,t=`loading`){return[`<${U}>${e}</${U}>`,`<${W}>${e}</${W}>`,`<skill-format>true</skill-format>`].join(`
2
- `)}function it(e,t){return[`<${U}>${e}</${U}>`,`<${W}>/${e}</${W}>`,t?`<command-args>${t}</command-args>`:null].filter(Boolean).join(`
3
- `)}function at(e,t){return e.userInvocable===!1&&(e.loadedFrom===`skills`||e.loadedFrom===`plugin`||e.loadedFrom===`mcp`)?X(e.name,e.progressMessage):it(e.name,t)}async function ot(e,t,n,r,i=[]){let a=g(e,n);if(!a)throw new H(`Unknown command: ${e}`);if(a.type!==`prompt`)throw Error(`Unexpected ${a.type} command. Expected 'prompt' command. Use /${e} directly in the main conversation.`);return Z(a,t,r,[],i)}async function Z(e,t,r,i=[],o=[],s){let c=await e.getPromptForCommand(t,r),l=!N(`hooks`)||d(e.source);if(e.hooks&&l){let t=je();Je(r.setAppState,t,e.hooks,e.name,e.type===`prompt`?e.skillRoot:void 0)}let u=e.source?`${e.source}:${e.name}`:e.name,f=c.filter(e=>e.type===`text`).map(e=>e.text).join(`
4
-
5
- `);Ae(e.name,u,f,n()?.agentId??null);let m=at(e,t),h=p(e.allowedTools??[]),g=o.length>0||i.length>0?[...o,...i,...c]:c,_=await _e(me(c.filter(e=>e.type===`text`).map(e=>e.text).join(` `),r,null,[],r.messages,`repl_main_thread`,{skipSkillDiscovery:!0}));return{messages:[y({content:m,uuid:s}),y({content:g,isMeta:!0}),..._,a({type:`command_permissions`,allowedTools:h,model:e.model})],shouldQuery:!0,allowedTools:h,model:e.model,command:e}}var Q,$;e((()=>{Me(),O(),Se(),ze(),Be(),Oe(),T(),xe(),F(),P(),t(),be(),V(),Pe(),l(),Fe(),Ee(),de(),Ye(),G(),D(),ae(),ce(),te(),he(),Te(),Ze(),Ue(),ie(),qe(),Ce(),ye(),f(),pe(),He(),Q=200,$=1e4}))();export{X as formatSkillLoadingMetadata,ot as processPromptSlashCommand,nt as processSlashCommand};
@@ -1 +0,0 @@
1
- import{Vx as e,qx as t}from"./loadAgentsDir-C1LkW7gl.js";t();export{e as clearPromptCache};
@@ -1 +0,0 @@
1
- import{i as e,r as t}from"./prompt-BGqgPgCU.js";t();export{e as isDeferredTool};
@@ -1 +0,0 @@
1
- import{ao as e,do as t,fo as n,so as r}from"./loadAgentsDir-C1LkW7gl.js";import{Z as i,zt as a}from"./state-BowF111d.js";import{L as o,N as s,c,i as l}from"./debug-8DCufdSp.js";import{An as u,Fn as d,Nr as f,Ur as p,_t as m,vt as h}from"./settings-DKN4xSpQ.js";import{o as g,s as _}from"./log-DaILwWJa.js";import{On as v,kn as y}from"./model-BwBE0Pt5.js";import{isAbsolute as b,resolve as x}from"path";v(),a(),l(),o(),u(),p(),g(),t(),m();function S(e,t,n){let r=[],i=[],a=[];for(let[o,s]of Object.entries(e)){let e=t[o],c=w(s.source,n?.projectRoot);e?s.sourceIsFallback||y(c,e.source)?a.push(o):i.push({name:o,declaredSource:c,materializedSource:e.source}):r.push(o)}return{missing:r,sourceChanged:i,upToDate:a}}async function C(t){let a=r();if(Object.keys(a).length===0)return{installed:[],updated:[],failed:[],upToDate:[],skipped:[]};let o;try{o=await n()}catch(e){_(e),o={}}let l=S(a,o,{projectRoot:i()}),u=[...l.missing.map(e=>({name:e,source:w(a[e].source),action:`install`})),...l.sourceChanged.map(({name:e,declaredSource:t})=>({name:e,source:t,action:`update`}))],f=[],p=[];for(let e of u){if(t?.skip?.(e.name,e.source)){f.push(e.name);continue}if(e.action===`update`&&h(e.source)&&!await d(e.source.path)){c(`[reconcile] '${e.name}' declared path does not exist; keeping materialized entry`),f.push(e.name);continue}p.push(e)}if(p.length===0)return{installed:[],updated:[],failed:[],upToDate:l.upToDate,skipped:f};c(`[reconcile] ${p.length} marketplace(s): ${p.map(e=>`${e.name}(${e.action})`).join(`, `)}`);let m=[],g=[],v=[];for(let n=0;n<p.length;n++){let{name:r,source:i,action:a}=p[n];t?.onProgress?.({type:`installing`,name:r,action:a,index:n+1,total:p.length});try{let n=await e(i);a===`install`?m.push(r):g.push(r),t?.onProgress?.({type:`installed`,name:r,alreadyMaterialized:n.alreadyMaterialized})}catch(e){let n=s(e);v.push({name:r,error:n}),t?.onProgress?.({type:`failed`,name:r,error:n}),_(e)}}return{installed:m,updated:g,failed:v,upToDate:l.upToDate,skipped:f}}function w(e,t){if((e.source===`directory`||e.source===`file`)&&!b(e.path)){let n=t??i(),r=f(n);return{...e,path:x(r??n,e.path)}}return e}export{C as n,S as t};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Bf as t,Gf as n,Ko as r,La as i,No as a,Po as o,Ra as s,Rf as c,Xf as l,Xm as u,Yf as d,Ym as f,by as p,i as m,o as h,qf as g,qo as _,yy as v}from"./loadAgentsDir-C1LkW7gl.js";import{Z as y,zt as b}from"./state-BowF111d.js";import{L as x,N as S,c as C,i as w}from"./debug-8DCufdSp.js";import{o as T,s as E}from"./log-DaILwWJa.js";async function D(e){C(`refreshActivePlugins: clearing all plugin caches`),a(),c();let t=await s(),[n,i]=await Promise.all([r(),m(y())]),{enabled:o,disabled:d,errors:f}=t,[h,_]=await Promise.all([Promise.all(o.map(async e=>{if(e.mcpServers)return Object.keys(e.mcpServers).length;let t=await p(e,f);return t&&(e.mcpServers=t),t?Object.keys(t).length:0})),Promise.all(o.map(async e=>{if(e.lspServers)return Object.keys(e.lspServers).length;let t=await l(e,f);return t&&(e.lspServers=t),t?Object.keys(t).length:0}))]),v=h.reduce((e,t)=>e+t,0),b=_.reduce((e,t)=>e+t,0);e(e=>({...e,plugins:{...e.plugins,enabled:o,disabled:d,commands:n,errors:O(e.plugins.errors,f),needsRefresh:!1},agentDefinitions:i,mcp:{...e.mcp,pluginReconnectKey:e.mcp.pluginReconnectKey+1}})),g();let x=!1;try{await u()}catch(e){x=!0,E(e),C(`refreshActivePlugins: loadPluginHooks failed: ${S(e)}`)}let w=o.reduce((e,t)=>t.hooksConfig?e+Object.values(t.hooksConfig).reduce((e,t)=>e+(t?.reduce((e,t)=>e+t.hooks.length,0)??0),0):e,0);return C(`refreshActivePlugins: ${o.length} enabled, ${n.length} commands, ${i.allAgents.length} agents, ${w} hooks, ${v} MCP, ${b} LSP`),{enabled_count:o.length,disabled_count:d.length,command_count:n.length,agent_count:i.allAgents.length,hook_count:w,mcp_count:v,lsp_count:b,error_count:f.length+ +!!x,agentDefinitions:i,pluginCommands:n}}function O(e,t){let n=e.filter(e=>e.source===`lsp-manager`||e.source.startsWith(`plugin:`)),r=new Set(t.map(k));return[...n.filter(e=>!r.has(k(e))),...t]}function k(e){return e.type===`generic-error`?`generic-error:${e.source}:${e.error}`:`${e.type}:${e.source}`}var A=e((()=>{b(),n(),h(),w(),x(),T(),o(),_(),f(),d(),v(),t(),i()}));export{D as n,A as t};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{$r as t,DS as n,Zi as r,mr as i,ni as a,vr as o}from"./loadAgentsDir-C1LkW7gl.js";import{ut as s,zt as c}from"./state-BowF111d.js";import{n as l,t as u}from"./generateSessionName-ChvKBVxB.js";async function d(e,r,o){let c;if(!o||o.trim()===``){let t=await u(n(r.messages),r.abortController.signal);if(!t)return e(`Could not generate a name: no conversation context yet. Usage: /rename <name>`,{display:`system`}),null;c=t}else c=o.trim();let l=s(),d=i();return await a(l,c,d),await t(l,c,d),r.setAppState(e=>({...e,standaloneAgentContext:{...e.standaloneAgentContext,name:c}})),e(`Session renamed to: ${c}`,{display:`system`}),null}e((()=>{c(),r(),o(),l()}))();export{d as call};
@@ -1,2 +0,0 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./figures-5ThXQEtq.js";import{Ar as i,Dd as a,Dr as o,Mb as s,Mr as c,Od as l,Si as u,Sr as d,Yb as f,br as p,ci as m,dr as h,ir as g,jb as _,vr as v,xi as y}from"./loadAgentsDir-C1LkW7gl.js";import{I as b,P as x,ai as S,di as C,dr as w,fi as T,ot as E,t as D}from"./src-DL3w8VPk.js";import{t as O}from"./jsx-runtime-Bb4Xn-E0.js";import{Z as k,ut as A,zt as j}from"./state-BowF111d.js";import{o as M,s as N}from"./log-DaILwWJa.js";import{r as P,t as F}from"./Spinner-DwsJJUtn.js";import{n as I,r as L}from"./modalContext-DDZdU1J8.js";import{a as R,i as z,n as B,o as V,r as H,t as U}from"./crossProjectResume-CzPCHq_K.js";function W(e){switch(e.resultType){case`sessionNotFound`:return`Session ${C.bold(e.arg)} was not found. Run ${C.bold(`/resume`)} without arguments to browse all sessions.`;case`multipleMatches`:return`Found ${e.count} sessions matching ${C.bold(e.arg)}. Run ${C.bold(`/resume`)} to pick one from the list.`}}function G({message:e,args:t,onDone:n}){return J.useEffect(()=>{let e=setTimeout(n,0);return()=>clearTimeout(e)},[n]),(0,Y.jsxs)(b,{flexDirection:`column`,children:[(0,Y.jsxs)(x,{dimColor:!0,children:[r.pointer,` /resume `,t]}),(0,Y.jsx)(_,{children:(0,Y.jsx)(x,{children:e})})]})}function K({onDone:e,onResume:t}){let[n,r]=J.useState([]),[a,s]=J.useState([]),[u,f]=J.useState(!0),[p,m]=J.useState(!1),[g,_]=J.useState(!1),{rows:v}=E(),S=L(),C=J.useCallback(async(t,n)=>{f(!0);try{let i=q(t?await o():await c(n),A());if(i.length===0){e(`No conversations found to resume`);return}r(i)}catch{e(`Failed to load conversations`)}finally{f(!1)}},[e]);J.useEffect(()=>{async function e(){let e=await y(k());s(e),C(!1,e)}e()},[C]);let T=J.useCallback(()=>{let e=!g;_(e),C(e,a)},[g,C,a]);async function D(n){let r=l(h(n));if(!r){e(`Failed to resume conversation`);return}let a=d(n)?await i(n):n,o=U(a,g);if(o.isCrossProject){if(o.isSameRepoWorktree){m(!0),t(r,a,`slash_command_picker`);return}let n=await w(o.command);n&&process.stdout.write(n),e([``,`This conversation is from a different directory.`,``,`To resume, run:`,` ${o.command}`,``,`(Command copied to clipboard)`,``].join(`
2
- `),{display:`user`});return}m(!0),t(r,a,`slash_command_picker`)}function O(){e(`Resume cancelled`,{display:`system`})}return u?(0,Y.jsxs)(b,{children:[(0,Y.jsx)(F,{}),(0,Y.jsx)(x,{children:` Loading conversations…`})]}):p?(0,Y.jsxs)(b,{children:[(0,Y.jsx)(F,{}),(0,Y.jsx)(x,{children:` Resuming conversation…`})]}):(0,Y.jsx)(R,{logs:n,maxHeight:S?Math.floor(v/2):v-2,onCancel:O,onSelect:D,onLogsChanged:()=>C(g,a),showAllProjects:g,onToggleAllProjects:T,onAgenticSearch:H})}function q(e,t){return e.filter(e=>!e.isSidechain&&h(e)!==t)}var J,Y,X;e((()=>{T(),n(),J=t(S(),1),j(),V(),s(),P(),I(),f(),D(),z(),B(),u(),M(),v(),a(),Y=O(),X=async(e,t,n)=>{let r=async(n,r,i)=>{try{await t.resume?.(n,r,i),e(void 0,{display:`skip`})}catch(t){N(t),e(`Failed to resume: ${t.message}`)}},a=n?.trim();if(!a)return(0,Y.jsx)(K,{onDone:e,onResume:r},Date.now());let o=await c(await y(k()));if(o.length===0){let t=`No conversations found to resume.`;return(0,Y.jsx)(G,{message:t,args:a,onDone:()=>e(t)})}let s=l(a);if(s){let e=o.filter(e=>h(e)===s).sort((e,t)=>t.modified.getTime()-e.modified.getTime());if(e.length>0){let t=e[0];return r(s,d(t)?await i(t):t,`slash_command_session_id`),null}let t=await g(s);if(t)return r(s,t,`slash_command_session_id`),null}if(p()){let t=await m(a,{exact:!0});if(t.length===1){let e=t[0],n=h(e);if(n)return r(n,d(e)?await i(e):e,`slash_command_title`),null}if(t.length>1){let n=W({resultType:`multipleMatches`,arg:a,count:t.length});return(0,Y.jsx)(G,{message:n,args:a,onDone:()=>e(n)})}}let u=W({resultType:`sessionNotFound`,arg:a});return(0,Y.jsx)(G,{message:u,args:a,onDone:()=>e(u)})}}))();export{X as call,q as filterResumableSessions};
@@ -1 +0,0 @@
1
- import{a as e,i as t}from"./ripgrep-BuzOTf1S.js";e();export{t as getRipgrepStatus};
@@ -1 +0,0 @@
1
- import{KC as e,YC as t}from"./loadAgentsDir-C1LkW7gl.js";t();export{e as SandboxManager};
@@ -1 +0,0 @@
1
- import{ch as e,uh as t}from"./loadAgentsDir-C1LkW7gl.js";e();export{t as isSearchExtraToolsEnabled};
@@ -1 +0,0 @@
1
- import{Mf as e,Nf as t}from"./loadAgentsDir-C1LkW7gl.js";e();export{t as registerSessionFileAccessHooks};
@@ -1 +0,0 @@
1
- import{n as e,r as t}from"./sessionObserver-WOYv2n7C.js";t();export{e as heuristicObserverBackend};
@@ -1 +0,0 @@
1
- import{Kr as e,Tr as t,vr as n}from"./loadAgentsDir-C1LkW7gl.js";n();export{t as linkSessionToPR,e as recordTranscript};
@@ -1,11 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{l as t,o as n}from"./envUtils-DcaKZlRU.js";import{i as r,l as i,n as a}from"./esm-lWlUmoUA.js";import{et as o,ft as s,rt as c,ut as l}from"./esm-BQY8jJNR.js";import{L as u,O as d,it as f,ut as p,zt as m}from"./state-BowF111d.js";import{C as h,L as ee,S as g,c as te,i as ne,x as re}from"./debug-8DCufdSp.js";import{d as ie,m as ae}from"./config-BddEvZZl.js";import{S as oe,y as se}from"./log-DaILwWJa.js";import{St as ce,ht as le}from"./model-BwBE0Pt5.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=ie(),t=p(),n={"user.id":e};y(`OTEL_METRICS_INCLUDE_SESSION_ID`)&&(n[`session.id`]=t),y(`OTEL_METRICS_INCLUDE_VERSION`)&&(n[`app.version`]=`0.0.22`);let r=le();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 l.terminal&&(n[`terminal.type`]=l.terminal),n}var _e,x=e((()=>{m(),ce(),ae(),s(),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=d();if(!n){C||(C=!0,te(`[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=f();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((()=>{m(),ne(),n(),x(),be=0,C=!1}));function Se(){O.clear(),k.clear()}function w(){return t(process.env.ENABLE_BETA_TRACING_DETAILED)&&process.env.BETA_TRACING_ENDPOINT&&u()||!1}function T(e,t=je){return e.length<=t?{content:e,truncated:!1}:{content:e.slice(0,t)+`
2
-
3
- [TRUNCATED - Content exceeds 60KB limit]`,truncated:!0}}function E(e){return ue(`sha256`).update(e).digest(`hex`).slice(0,12)}function Ce(e){return`sp_${E(e)}`}function we(e){return`msg_${E(h(e.message.content))}`}function D(e){let t=e.trim().match(Me);return t?.[1]?t[1].trim():null}function Te(e){let t=[],n=[];for(let r of e){let e=r.message.content;if(typeof e==`string`){let r=D(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=D(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=D(e);i?n.push(i):t.push(`[TOOL RESULT: ${r.tool_use_id}]\n${e}`)}}}return{contextParts:t,systemReminders:n}}function Ee(e,t){if(!w())return;let{content:n,truncated:r}=T(`[USER PROMPT]\n${t}`);e.setAttributes({new_context:n,...r&&{new_context_truncated:!0,new_context_original_length:t.length}})}function De(e,t,n){if(w()){if(t?.systemPrompt){let n=Ce(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),!O.has(n)){O.add(n);let{content:e,truncated:r}=T(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=g(t.tools).map(e=>{let t=h(e),n=E(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(!O.has(`tool_${t}`)){O.add(`tool_${t}`);let{content:n,truncated:i}=T(r);S(`tool`,{tool_name:c(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=k.get(r),a=0;if(i)for(let e=0;e<n.length;e++){let t=n[e];if(t&&we(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}=Te(o);if(t.length>0){let n=t.join(`
4
-
5
- ---
6
-
7
- `),{content:r,truncated:i}=T(n);e.setAttributes({new_context:r,new_context_message_count:o.length,...i&&{new_context_truncated:!0,new_context_original_length:n.length}})}if(i.length>0){let t=i.join(`
8
-
9
- ---
10
-
11
- `),{content:n,truncated:r}=T(t);e.setAttributes({system_reminders:n,system_reminders_count:i.length,...r&&{system_reminders_truncated:!0,system_reminders_original_length:t.length}})}let a=n[n.length-1];a&&k.set(r,we(a))}}}}function Oe(e,t){if(!(!w()||!t)&&t.modelOutput!==void 0){let{content:n,truncated:r}=T(t.modelOutput);e[`response.model_output`]=n,r&&(e[`response.model_output_truncated`]=!0,e[`response.model_output_original_length`]=t.modelOutput.length)}}function ke(e,t,n){if(!w())return;let{content:r,truncated:i}=T(`[TOOL INPUT: ${t}]\n${n}`);e.setAttributes({tool_input:r,...i&&{tool_input_truncated:!0,tool_input_original_length:n.length}})}function Ae(e,t,n){if(!w())return;let{content:r,truncated:i}=T(`[TOOL RESULT: ${t}]\n${n}`);e.new_context=r,i&&(e.new_context_truncated=!0,e.new_context_original_length=n.length)}var O,k,je,Me,Ne=e((()=>{m(),o(),n(),re(),xe(),O=new Set,k=new Map,je=60*1024,Me=/^<system-reminder>\n?([\s\S]*?)\n?<\/system-reminder>$/}));function A(e){return Math.abs(se(e))||1}function Pe(e){let t=H.get(e);return t===void 0?(V++,H.set(e,V),V):t}function j(){let e=p(),t=`main`,n=z.get(e);if(n)return n;let r={agentId:e,agentName:t,parentAgentId:void 0,processId:1,threadId:A(t)};return z.set(e,r),B++,r}function M(){return(Date.now()-qe)*1e3}function N(){return`span_${++Je}`}function Fe(){let e=process.env.CLAUDE_CODE_PERFETTO_TRACE;te(`[Perfetto] initializePerfettoTracing called, env value: ${e}`)}function Ie(e){F&&(I.push({name:`process_name`,cat:`__metadata`,ph:`M`,ts:0,pid:e.processId,tid:0,args:{name:e.agentName}}),I.push({name:`thread_name`,cat:`__metadata`,ph:`M`,ts:0,pid:e.processId,tid:e.threadId,args:{name:e.agentName}}),e.parentAgentId&&I.push({name:`parent_agent`,cat:`__metadata`,ph:`M`,ts:0,pid:e.processId,tid:0,args:{parent_agent_id:e.parentAgentId}}))}function P(){return F}function Le(e,t,n){if(!F)return;let r={agentId:e,agentName:t,parentAgentId:n,processId:Pe(e),threadId:A(t)};z.set(e,r),B++,Ie(r)}function Re(e){F&&(z.delete(e),H.delete(e))}function ze(e){if(!F)return``;let t=N(),n=j();return R.set(t,{name:`API Call`,category:`api`,startTime:M(),agentInfo:n,args:{model:e.model,prompt_tokens:e.promptTokens,message_id:e.messageId,is_speculative:e.isSpeculative??!1,query_source:e.querySource}}),L.push({name:`API Call`,cat:`api`,ph:`B`,ts:R.get(t).startTime,pid:n.processId,tid:n.threadId,args:R.get(t).args}),t}function Be(e,t){if(!F||!e)return;let n=R.get(e);if(!n)return;let r=M(),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(L.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;L.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}}),L.push({name:`Attempt ${t+1} (retry)`,cat:`api,retry`,ph:`E`,ts:i,pid:n.agentInfo.processId,tid:n.agentInfo.threadId})}}L.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;L.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}}),L.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&&(L.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}}),L.push({name:`Sampling`,cat:`api,sampling`,ph:`E`,ts:t+r*1e3,pid:n.agentInfo.processId,tid:n.agentInfo.threadId}))}L.push({name:n.name,cat:n.category,ph:`E`,ts:r,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:ee}),R.delete(e)}function Ve(e,t){if(!F)return``;let n=N(),r=j();return R.set(n,{name:`Tool: ${e}`,category:`tool`,startTime:M(),agentInfo:r,args:{tool_name:e,...t}}),L.push({name:`Tool: ${e}`,cat:`tool`,ph:`B`,ts:R.get(n).startTime,pid:r.processId,tid:r.threadId,args:R.get(n).args}),n}function He(e,t){if(!F||!e)return;let n=R.get(e);if(!n)return;let r=M(),i=r-n.startTime,a={...n.args,success:t?.success??!0,error:t?.error,result_tokens:t?.resultTokens,duration_ms:i/1e3};L.push({name:n.name,cat:n.category,ph:`E`,ts:r,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:a}),R.delete(e)}function Ue(e){if(!F)return``;let t=N(),n=j();return R.set(t,{name:`Waiting for User Input`,category:`user_input`,startTime:M(),agentInfo:n,args:{context:e}}),L.push({name:`Waiting for User Input`,cat:`user_input`,ph:`B`,ts:R.get(t).startTime,pid:n.processId,tid:n.threadId,args:R.get(t).args}),t}function We(e,t){if(!F||!e)return;let n=R.get(e);if(!n)return;let r=M(),i=r-n.startTime,a={...n.args,decision:t?.decision,source:t?.source,duration_ms:i/1e3};L.push({name:n.name,cat:n.category,ph:`E`,ts:r,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:a}),R.delete(e)}function Ge(e){if(!F)return``;let t=N(),n=j();return R.set(t,{name:`Interaction`,category:`interaction`,startTime:M(),agentInfo:n,args:{user_prompt_length:e?.length}}),L.push({name:`Interaction`,cat:`interaction`,ph:`B`,ts:R.get(t).startTime,pid:n.processId,tid:n.threadId,args:R.get(t).args}),t}function Ke(e){if(!F||!e)return;let t=R.get(e);if(!t)return;let n=M(),r=n-t.startTime;L.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}}),R.delete(e)}var F,I,L,R,z,B,qe,Je,V,H,Ye=e((()=>{m(),ne(),n(),ee(),oe(),re(),F=!1,I=[],L=[],R=new Map,z=new Map,B=0,qe=0,Je=0,V=1,H=new Map}));function U(e){return e.spanContext().spanId||``}function Xe(){if($)return;$=!0;let e=setInterval(()=>{let e=Date.now()-dt;for(let[t,n]of X){let r=n.deref();r===void 0?(X.delete(t),Z.delete(t)):r.startTime<e&&(r.ended||r.span.end(),X.delete(t),Z.delete(t))}},6e4);typeof e.unref==`function`&&e.unref()}function W(){return!1}function G(){return W()||w()}function K(){return r.getTracer(`com.anthropic.claude_code.tracing`,`1.0.0`)}function q(e,t={}){return{...b(),"span.type":e,...t}}function Ze(e){Xe();let n=P()?Ge(e):void 0;if(!G()){if(n){let e=r.getActiveSpan()||K().startSpan(`dummy`),t=U(e),i={span:e,startTime:Date.now(),attributes:{},perfettoSpanId:n};return X.set(t,new WeakRef(i)),J.enterWith(i),e}return r.getActiveSpan()||K().startSpan(`dummy`)}let i=K(),a=t(process.env.OTEL_LOG_USER_PROMPTS)?e:`<REDACTED>`;Q++;let o=q(`interaction`,{user_prompt:a,user_prompt_length:e.length,"interaction.sequence":Q}),s=i.startSpan(`claude_code.interaction`,{attributes:o});Ee(s,e);let c=U(s),l={span:s,startTime:Date.now(),attributes:o,perfettoSpanId:n};return X.set(c,new WeakRef(l)),J.enterWith(l),s}function Qe(){let e=J.getStore();if(!e||e.ended)return;if(e.perfettoSpanId&&Ke(e.perfettoSpanId),!G()){e.ended=!0,X.delete(U(e.span)),J.enterWith(void 0);return}let t=Date.now()-e.startTime;e.span.setAttributes({"interaction.duration_ms":t}),e.span.end(),e.ended=!0,X.delete(U(e.span)),J.enterWith(void 0)}function $e(e,t,n,a){let o=P()?ze({model:e,querySource:t?.querySource,messageId:void 0}):void 0;if(!G()){if(o){let t=r.getActiveSpan()||K().startSpan(`dummy`),n=U(t),i={span:t,startTime:Date.now(),attributes:{model:e},perfettoSpanId:o};return X.set(n,new WeakRef(i)),Z.set(n,i),t}return r.getActiveSpan()||K().startSpan(`dummy`)}let s=K(),c=J.getStore(),l=q(`llm_request`,{model:e,"llm_request.context":c?`interaction`:`standalone`,speed:a?`fast`:`normal`}),u=c?r.setSpan(i.active(),c.span):i.active(),d=s.startSpan(`claude_code.llm_request`,{attributes:l},u);t?.querySource&&d.setAttribute(`query_source`,t.querySource),De(d,t,n);let f=U(d),p={span:d,startTime:Date.now(),attributes:l,perfettoSpanId:o};return X.set(f,new WeakRef(p)),Z.set(f,p),d}function et(e,t){let n;if(e){let t=U(e);n=X.get(t)?.deref()}else n=Array.from(X.values()).findLast(e=>{let t=e.deref();return t?.attributes[`span.type`]===`llm_request`||t?.attributes.model})?.deref();if(!n)return;let r=Date.now()-n.startTime;if(n.perfettoSpanId&&Be(n.perfettoSpanId,{ttftMs:t?.ttftMs,ttltMs:r,promptTokens:t?.inputTokens,outputTokens:t?.outputTokens,cacheReadTokens:t?.cacheReadTokens,cacheCreationTokens:t?.cacheCreationTokens,success:t?.success,error:t?.error,requestSetupMs:t?.requestSetupMs,attemptStartTimes:t?.attemptStartTimes}),!G()){let e=U(n.span);X.delete(e),Z.delete(e);return}let i={duration_ms:r};t&&(t.inputTokens!==void 0&&(i.input_tokens=t.inputTokens),t.outputTokens!==void 0&&(i.output_tokens=t.outputTokens),t.cacheReadTokens!==void 0&&(i.cache_read_tokens=t.cacheReadTokens),t.cacheCreationTokens!==void 0&&(i.cache_creation_tokens=t.cacheCreationTokens),t.success!==void 0&&(i.success=t.success),t.statusCode!==void 0&&(i.status_code=t.statusCode),t.error!==void 0&&(i.error=t.error),t.attempt!==void 0&&(i.attempt=t.attempt),t.hasToolCall!==void 0&&(i[`response.has_tool_call`]=t.hasToolCall),t.ttftMs!==void 0&&(i.ttft_ms=t.ttftMs),Oe(i,t)),n.span.setAttributes(i),n.span.end();let a=U(n.span);X.delete(a),Z.delete(a)}function tt(e,t,n){let a=P()?Ve(e,t):void 0;if(!G()){if(a){let t=r.getActiveSpan()||K().startSpan(`dummy`),n=U(t),i={span:t,startTime:Date.now(),attributes:{"span.type":`tool`,tool_name:e},perfettoSpanId:a};return X.set(n,new WeakRef(i)),Y.enterWith(i),t}return r.getActiveSpan()||K().startSpan(`dummy`)}let o=K(),s=J.getStore(),c=q(`tool`,{tool_name:e,...t}),l=s?r.setSpan(i.active(),s.span):i.active(),u=o.startSpan(`claude_code.tool`,{attributes:c},l);n&&ke(u,e,n);let d=U(u),f={span:u,startTime:Date.now(),attributes:c,perfettoSpanId:a};return X.set(d,new WeakRef(f)),Y.enterWith(f),u}function nt(){let e=P()?Ue(`tool_permission`):void 0;if(!G()){if(e){let t=r.getActiveSpan()||K().startSpan(`dummy`),n=U(t),i={span:t,startTime:Date.now(),attributes:{"span.type":`tool.blocked_on_user`},perfettoSpanId:e};return X.set(n,new WeakRef(i)),Z.set(n,i),t}return r.getActiveSpan()||K().startSpan(`dummy`)}let t=K(),n=Y.getStore(),a=q(`tool.blocked_on_user`),o=n?r.setSpan(i.active(),n.span):i.active(),s=t.startSpan(`claude_code.tool.blocked_on_user`,{attributes:a},o),c=U(s),l={span:s,startTime:Date.now(),attributes:a,perfettoSpanId:e};return X.set(c,new WeakRef(l)),Z.set(c,l),s}function rt(e,t){let n=Array.from(X.values()).findLast(e=>e.deref()?.attributes[`span.type`]===`tool.blocked_on_user`)?.deref();if(!n)return;if(n.perfettoSpanId&&We(n.perfettoSpanId,{decision:e,source:t}),!G()){let e=U(n.span);X.delete(e),Z.delete(e);return}let r={duration_ms:Date.now()-n.startTime};e&&(r.decision=e),t&&(r.source=t),n.span.setAttributes(r),n.span.end();let i=U(n.span);X.delete(i),Z.delete(i)}function it(){if(!G())return r.getActiveSpan()||K().startSpan(`dummy`);let e=K(),t=Y.getStore(),n=q(`tool.execution`),a=t?r.setSpan(i.active(),t.span):i.active(),o=e.startSpan(`claude_code.tool.execution`,{attributes:n},a),s=U(o),c={span:o,startTime:Date.now(),attributes:n};return X.set(s,new WeakRef(c)),Z.set(s,c),o}function at(e){if(!G())return;let t=Array.from(X.values()).findLast(e=>e.deref()?.attributes[`span.type`]===`tool.execution`)?.deref();if(!t)return;let n={duration_ms:Date.now()-t.startTime};e&&(e.success!==void 0&&(n.success=e.success),e.error!==void 0&&(n.error=e.error)),t.span.setAttributes(n),t.span.end();let r=U(t.span);X.delete(r),Z.delete(r)}function ot(e,t){let n=Y.getStore();if(!n)return;if(n.perfettoSpanId&&He(n.perfettoSpanId,{success:!0,resultTokens:t}),!G()){let e=U(n.span);X.delete(e),Y.enterWith(void 0);return}let r={duration_ms:Date.now()-n.startTime};e&&Ae(r,n.attributes.tool_name||`unknown`,e),t!==void 0&&(r.result_tokens=t),n.span.setAttributes(r),n.span.end();let i=U(n.span);X.delete(i),Y.enterWith(void 0)}function st(){return t(process.env.OTEL_LOG_TOOL_CONTENT)}function ct(e,t){if(!G()||!st())return;let n=Y.getStore();if(!n)return;let r={};for(let[e,n]of Object.entries(t))if(typeof n==`string`){let{content:t,truncated:i}=T(n);r[e]=t,i&&(r[`${e}_truncated`]=!0,r[`${e}_original_length`]=n.length)}else r[e]=n;n.span.addEvent(e,r)}function lt(e,t,n,a){if(!w())return r.getActiveSpan()||K().startSpan(`dummy`);let o=K(),s=Y.getStore()??J.getStore(),c=q(`hook`,{hook_event:e,hook_name:t,num_hooks:n,hook_definitions:a}),l=s?r.setSpan(i.active(),s.span):i.active(),u=o.startSpan(`claude_code.hook`,{attributes:c},l),d=U(u),f={span:u,startTime:Date.now(),attributes:c};return X.set(d,new WeakRef(f)),Z.set(d,f),u}function ut(e,t){if(!w())return;let n=U(e),r=X.get(n)?.deref();if(!r)return;let i={duration_ms:Date.now()-r.startTime};t&&(t.numSuccess!==void 0&&(i.num_success=t.numSuccess),t.numBlocking!==void 0&&(i.num_blocking=t.numBlocking),t.numNonBlockingError!==void 0&&(i.num_non_blocking_error=t.numNonBlockingError),t.numCancelled!==void 0&&(i.num_cancelled=t.numCancelled)),r.span.setAttributes(i),r.span.end(),X.delete(n),Z.delete(n)}var J,Y,X,Z,Q,$,dt,ft=e((()=>{a(),n(),x(),Ne(),Ye(),J=new de,Y=new de,X=new Map,Z=new Map,Q=0,$=!1,dt=1800*1e3}));export{w as C,b as D,ye as E,x as O,Ne as S,S as T,Fe as _,rt as a,Re as b,ft as c,Ze as d,$e as f,Ye as g,tt as h,et as i,W as l,it as m,ut as n,at as o,nt as p,Qe as r,ot as s,ct as t,lt as u,P as v,xe as w,Se as x,Le as y};
@@ -1 +0,0 @@
1
- import{b as e,h as t,s as n}from"./settings-DKN4xSpQ.js";t();export{n as getSettingsForSource,e as updateSettingsForSource};
@@ -1,24 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{c as t,i as n,n as r,r as i,s as a,t as o}from"./isObject-C6qM3WEW.js";import{d as s,f as c,g as l,h as u,l as ee,n as d,t as f,u as te}from"./memoize-BK3gG5ob.js";import{i as p,l as m,o as ne}from"./envUtils-DcaKZlRU.js";import{n as re,t as h}from"./defineProperty-C-QyHrDq.js";import{i as ie,r as ae}from"./isSymbol-BO6cdPI7.js";import{$ as oe,A as g,B as se,D as ce,F as _,G as v,J as le,L as ue,M as de,O as fe,P as y,Q as b,S as pe,V as x,W as S,X as me,Y as C,Z as w,_ as he,a as ge,f as _e,g as ve,l as ye,o as be,q as xe,r as Se,s as T,st as Ce,x as E}from"./types-zk5Ltv5q.js";import{$r as we,A as Te,Br as Ee,Fr as De,Hr as Oe,Ir as ke,Lr as Ae,Mt as je,Qr as Me,Rr as Ne,Si as Pe,Ur as Fe,Vr as Ie,Wr as Le,Xr as Re,Yr as ze,Z as Be,Zn as Ve,Zr as He,ar as Ue,cr as We,ei as Ge,gi as Ke,hi as qe,ir as Je,j as Ye,li as Xe,mr as Ze,nr as Qe,or as $e,pr as et,rr as tt,sr as nt,tr as rt,ui as it,ur as at,v as ot,xi as st,zr as ct,zt as lt}from"./state-BowF111d.js";import{n as ut,t as D}from"./cwd-BcO6WHKo.js";import{B as dt,C as ft,L as pt,P as mt,S as ht,b as gt,c as O,et as _t,f as k,g as vt,i as yt,tt as bt,u as A,x as xt,z as St}from"./debug-8DCufdSp.js";import{i as Ct,n as wt}from"./execFileNoThrow-BsfuytkN.js";import{S as Tt,o as Et,s as j,y as Dt}from"./log-DaILwWJa.js";import{_ as Ot,b as kt,f as At,g as jt,l as Mt,m as Nt,n as Pt,o as Ft,p as It,v as Lt,x as Rt,y as zt}from"./stringUtils-BQm3OfeJ.js";import{i as M,o as Bt}from"./platform-Dzff1WWw.js";import{n as Vt,r as Ht}from"./analytics-DJobLaWP.js";import{n as Ut,r as Wt}from"./startupProfiler-DTs9w9EN.js";import{homedir as Gt,userInfo as Kt}from"os";import{basename as qt,dirname as N,extname as Jt,isAbsolute as Yt,join as P,normalize as Xt,posix as Zt,relative as Qt,resolve as F,sep as I}from"path";import{chmodSync as $t,existsSync as en,readFileSync as tn,realpathSync as nn,statSync as rn,unwatchFile as an,watchFile as on,writeFileSync as sn}from"fs";import{createHash as cn}from"crypto";import{appendFile as ln,mkdir as un,open as dn,readFile as L,readdir as fn,realpath as pn,stat as mn,writeFile as hn}from"fs/promises";import{promisify as gn}from"util";import{execFile as _n}from"child_process";import*as R from"path/win32";var vn,yn=e((()=>{c(),vn=function(){try{var e=s(Object,`defineProperty`);return e({},``,{}),e}catch{}}()}));function bn(e,t,n){t==`__proto__`&&vn?vn(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var xn=e((()=>{yn()}));function Sn(e,t,n){var r=e[t];(!(Cn.call(e,t)&&ee(r,n))||n===void 0&&!(t in e))&&bn(e,t,n)}var Cn,wn=e((()=>{xn(),te(),Cn=Object.prototype.hasOwnProperty}));function Tn(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?bn(n,s,c):Sn(n,s,c)}return n}var En=e((()=>{wn(),xn()}));function Dn(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var On=e((()=>{}));function kn(e){if(!r(e))return Dn(e);var t=Ee(e),n=[];for(var i in e)i==`constructor`&&(t||!An.call(e,i))||n.push(i);return n}var An,jn=e((()=>{o(),ct(),On(),An=Object.prototype.hasOwnProperty}));function Mn(e){return ke(e)?Ie(e,!0):kn(e)}var Nn=e((()=>{Oe(),jn(),De()}));function Pn(e,t){if(t)return e.slice();var n=e.length,r=Rn?Rn(n):new e.constructor(n);return e.copy(r),r}var Fn,In,Ln,Rn,zn=e((()=>{a(),Fn=typeof exports==`object`&&exports&&!exports.nodeType&&exports,In=Fn&&typeof module==`object`&&module&&!module.nodeType&&module,Ln=In&&In.exports===Fn?t.Buffer:void 0,Rn=Ln?Ln.allocUnsafe:void 0}));function Bn(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var Vn=e((()=>{})),Hn,Un=e((()=>{Ae(),Hn=Ne(Object.getPrototypeOf,Object)}));function Wn(e){var t=new e.constructor(e.byteLength);return new qe(t).set(new qe(e)),t}var Gn=e((()=>{Ke()}));function Kn(e,t){var n=t?Wn(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var qn=e((()=>{Gn()})),Jn,Yn,Xn=e((()=>{o(),Jn=Object.create,Yn=function(){function e(){}return function(t){if(!r(t))return{};if(Jn)return Jn(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}()}));function Zn(e){return typeof e.constructor==`function`&&!Ee(e)?Yn(Hn(e)):{}}var Qn=e((()=>{Xn(),Un(),ct()}));function z(e,t,n){let r=$n();if(!r)return;let i={timestamp:new Date().toISOString(),level:e,event:t,data:n??{}},a=A(),o=`${ft(i)}\n`;try{a.appendFileSync(r,o)}catch{try{a.mkdirSync(N(r)),a.appendFileSync(r,o)}catch{}}}function $n(){return process.env.CLAUDE_CODE_DIAGNOSTICS_FILE}async function er(e,t,n){let r=Date.now();z(`info`,`${e}_started`);try{let i=await t(),a=n?n(i):{};return z(`info`,`${e}_completed`,{duration_ms:Date.now()-r,...a}),i}catch(t){throw z(`error`,`${e}_failed`,{duration_ms:Date.now()-r}),t}}var tr=e((()=>{k(),xt()}));async function nr(e,t,n,r){try{return rr(await L(P(e,`config`),`utf-8`),t,n,r)}catch{return null}}function rr(e,t,n,r){let i=e.split(`
2
- `),a=t.toLowerCase(),o=r.toLowerCase(),s=!1;for(let e of i){let t=e.trim();if(t.length===0||t[0]===`#`||t[0]===`;`)continue;if(t[0]===`[`){s=sr(t,a,n);continue}if(!s)continue;let r=ir(t);if(r&&r.key.toLowerCase()===o)return r.value}return null}function ir(e){let t=0;for(;t<e.length&&cr(e[t]);)t++;if(t===0)return null;let n=e.slice(0,t);for(;t<e.length&&(e[t]===` `||e[t]===` `);)t++;if(t>=e.length||e[t]!==`=`)return null;for(t++;t<e.length&&(e[t]===` `||e[t]===` `);)t++;return{key:n,value:ar(e,t)}}function ar(e,t){let n=``,r=!1,i=t;for(;i<e.length;){let t=e[i];if(!r&&(t===`#`||t===`;`))break;if(t===`"`){r=!r,i++;continue}if(t===`\\`&&i+1<e.length){let t=e[i+1];if(r){switch(t){case`n`:n+=`
3
- `;break;case`t`:n+=` `;break;case`b`:n+=`\b`;break;case`"`:n+=`"`;break;case`\\`:n+=`\\`;break;default:n+=t;break}i+=2;continue}if(t===`\\`){n+=`\\`,i+=2;continue}}n+=t,i++}return r||(n=or(n)),n}function or(e){let t=e.length;for(;t>0&&(e[t-1]===` `||e[t-1]===` `);)t--;return e.slice(0,t)}function sr(e,t,n){let r=1;for(;r<e.length&&e[r]!==`]`&&e[r]!==` `&&e[r]!==` `&&e[r]!==`"`;)r++;if(e.slice(1,r).toLowerCase()!==t)return!1;if(n===null)return r<e.length&&e[r]===`]`;for(;r<e.length&&(e[r]===` `||e[r]===` `);)r++;if(r>=e.length||e[r]!==`"`)return!1;r++;let i=``;for(;r<e.length&&e[r]!==`"`;){if(e[r]===`\\`&&r+1<e.length){let t=e[r+1];if(t===`\\`||t===`"`){i+=t,r+=2;continue}i+=t,r+=2;continue}i+=e[r],r++}return r>=e.length||e[r]!==`"`||(r++,r>=e.length||e[r]!==`]`)?!1:i===n}function cr(e){return e>=`a`&&e<=`z`||e>=`A`&&e<=`Z`||e>=`0`&&e<=`9`||e===`-`}var lr=e((()=>{}));function ur(){H.clear()}async function B(e){let t=F(e??D()),n=H.get(t);if(n!==void 0)return n;let r=Br(t);if(!r)return H.set(t,null),null;let i=P(r,`.git`);try{if((await mn(i)).isFile()){let e=(await L(i,`utf-8`)).trim();if(e.startsWith(`gitdir:`)){let n=F(r,e.slice(7).trim());return H.set(t,n),n}}return H.set(t,i),i}catch{return H.set(t,null),null}}function dr(e){return!(!e||e.startsWith(`-`)||e.startsWith(`/`)||e.includes(`..`)||e.split(`/`).some(e=>e===`.`||e===``)||!/^[a-zA-Z0-9/._+@-]+$/.test(e))}function fr(e){return/^[0-9a-f]{40}$/.test(e)||/^[0-9a-f]{64}$/.test(e)}async function pr(e){try{let t=(await L(P(e,`HEAD`),`utf-8`)).trim();if(t.startsWith(`ref:`)){let n=t.slice(4).trim();if(n.startsWith(`refs/heads/`)){let e=n.slice(11);return dr(e)?{type:`branch`,name:e}:null}if(!dr(n))return null;let r=await mr(e,n);return r?{type:`detached`,sha:r}:{type:`detached`,sha:``}}return fr(t)?{type:`detached`,sha:t}:null}catch{return null}}async function mr(e,t){let n=await hr(e,t);if(n)return n;let r=await V(e);return r&&r!==e?hr(r,t):null}async function hr(e,t){try{let n=(await L(P(e,t),`utf-8`)).trim();if(n.startsWith(`ref:`)){let t=n.slice(4).trim();return dr(t)?mr(e,t):null}return fr(n)?n:null}catch{}try{let n=await L(P(e,`packed-refs`),`utf-8`);for(let e of n.split(`
4
- `)){if(e.startsWith(`#`)||e.startsWith(`^`))continue;let n=e.indexOf(` `);if(n!==-1&&e.slice(n+1)===t){let t=e.slice(0,n);return fr(t)?t:null}}}catch{}return null}async function V(e){try{return F(e,(await L(P(e,`commondir`),`utf-8`)).trim())}catch{return null}}async function gr(e,t,n){try{let r=(await L(P(e,t),`utf-8`)).trim();if(r.startsWith(`ref:`)){let e=r.slice(4).trim();if(e.startsWith(n)){let t=e.slice(n.length);return dr(t)?t:null}}}catch{}return null}async function _r(){let e=await B();if(!e)return`HEAD`;let t=await pr(e);return t&&t.type===`branch`?t.name:`HEAD`}async function vr(){let e=await B();if(!e)return null;let t=await nr(e,`remote`,`origin`,`url`);if(t)return t;let n=await V(e);return n&&n!==e?nr(n,`remote`,`origin`,`url`):null}async function yr(){let e=await B();if(!e)return`main`;let t=await V(e)??e,n=await gr(t,`refs/remotes/origin/HEAD`,`refs/remotes/origin/`);if(n)return n;for(let e of[`main`,`master`])if(await mr(t,`refs/remotes/origin/${e}`))return e;return`main`}function br(){return kr.get(`branch`,_r)}function xr(){return kr.get(`remoteUrl`,vr)}function Sr(){return kr.get(`defaultBranch`,yr)}async function Cr(e){let t=await B(e);if(!t)return null;let n=await pr(t);return n?n.type===`branch`?mr(t,`refs/heads/${n.name}`):n.sha:null}async function wr(e){let t;try{let n=(await L(P(e,`.git`),`utf-8`)).trim();if(!n.startsWith(`gitdir:`))return null;t=F(e,n.slice(7).trim())}catch{return null}let n=await pr(t);return n?n.type===`branch`?mr(t,`refs/heads/${n.name}`):n.sha:null}async function Tr(e){let t=await B(e);if(!t)return null;let n=await nr(t,`remote`,`origin`,`url`);if(n)return n;let r=await V(t);return r&&r!==t?nr(r,`remote`,`origin`,`url`):null}async function Er(){try{let e=await B();return e?(await fn(P(await V(e)??e,`worktrees`))).length+1:0}catch{return 1}}var H,Dr,Or,kr,Ar=e((()=>{lt(),_t(),ut(),Xr(),lr(),re(),H=new Map,Dr=1e3,Or=class{constructor(){h(this,`gitDir`,null),h(this,`commonDir`,null),h(this,`initialized`,!1),h(this,`initPromise`,null),h(this,`watchedPaths`,[]),h(this,`branchRefPath`,null),h(this,`cache`,new Map)}async ensureStarted(){if(!this.initialized)return this.initPromise||(this.initPromise=this.start()),this.initPromise}async start(){this.gitDir=await B(),this.initialized=!0,this.gitDir&&(this.commonDir=await V(this.gitDir),this.watchPath(P(this.gitDir,`HEAD`),()=>{this.onHeadChanged()}),this.watchPath(P(this.commonDir??this.gitDir,`config`),()=>{this.invalidate()}),await this.watchCurrentBranchRef(),bt(async()=>{this.stopWatching()}))}watchPath(e,t){this.watchedPaths.push(e),on(e,{interval:Dr},t)}async watchCurrentBranchRef(){if(!this.gitDir)return;let e=await pr(this.gitDir),t=this.commonDir??this.gitDir,n=e?.type===`branch`?P(t,`refs`,`heads`,e.name):null;n!==this.branchRefPath&&(this.branchRefPath&&(an(this.branchRefPath),this.watchedPaths=this.watchedPaths.filter(e=>e!==this.branchRefPath)),this.branchRefPath=n,n&&this.watchPath(n,()=>{this.invalidate()}))}async onHeadChanged(){this.invalidate(),await Ve(),await this.watchCurrentBranchRef()}invalidate(){for(let e of this.cache.values())e.dirty=!0}stopWatching(){for(let e of this.watchedPaths)an(e);this.watchedPaths=[],this.branchRefPath=null}async get(e,t){await this.ensureStarted();let n=this.cache.get(e);if(n&&!n.dirty)return n.value;n&&(n.dirty=!1);let r=await t(),i=this.cache.get(e);return i&&!i.dirty&&(i.value=r),i||this.cache.set(e,{value:r,dirty:!1,compute:t}),r}reset(){this.stopWatching(),this.cache.clear(),this.initialized=!1,this.initPromise=null,this.gitDir=null,this.commonDir=null}},kr=new Or}));function jr(){function e(e){let t=zr(e);return t===Rr?null:t}return e.cache=zr.cache,e}function Mr(){function e(e){let t=Br(e);return t?Vr(t):null}return e.cache=Vr.cache,e}function Nr(e){return B(e)}function Pr(e){let t=e.trim();if(!t)return null;let n=t.match(/^git@([^:]+):(.+?)(?:\.git)?$/);if(n?.[1]&&n[2])return`${n[1]}/${n[2]}`.toLowerCase();let r=t.match(/^(?:https?|ssh):\/\/(?:[^@]+@)?([^/]+)\/(.+?)(?:\.git)?$/);if(r?.[1]&&r[2]){let e=r[1],t=r[2];if(Ir(e)&&t.startsWith(`git/`)){let e=t.slice(4),n=e.split(`/`);return n.length>=3&&n[0].includes(`.`)?e.toLowerCase():`github.com/${e}`.toLowerCase()}return`${e}/${t}`.toLowerCase()}return null}async function Fr(){let e=await Jr();if(!e)return null;let t=Pr(e);return t?cn(`sha256`).update(t).digest(`hex`).substring(0,16):null}function Ir(e){let t=e.split(`:`)[0]??``;return t===`localhost`||/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(t)}function Lr(){let e=A(),t=D(),n=P(t,`.git`);try{let t=e.statSync(n);if(t.isFile())return!1;if(t.isDirectory()){let t=P(n,`HEAD`);try{if(e.statSync(t).isFile())return!1}catch{}}}catch{}try{if(e.statSync(P(t,`HEAD`)).isFile())return!0}catch{}try{if(e.statSync(P(t,`objects`)).isDirectory())return!0}catch{}try{if(e.statSync(P(t,`refs`)).isDirectory())return!0}catch{}return!1}var Rr,zr,Br,Vr,Hr,Ur,Wr,Gr,Kr,qr,Jr,Yr,Xr=e((()=>{f(),ut(),yt(),tr(),Ct(),k(),Ar(),Et(),ve(),Ot(),Rr=Symbol(`git-root-not-found`),zr=he(e=>{let t=Date.now();z(`info`,`find_git_root_started`);let n=F(e),r=n.substring(0,n.indexOf(I)+1)||I,i=0;for(;n!==r;){try{let e=P(n,`.git`);i++;let r=rn(e);if(r.isDirectory()||r.isFile())return z(`info`,`find_git_root_completed`,{duration_ms:Date.now()-t,stat_count:i,found:!0}),n.normalize(`NFC`)}catch{}let e=N(n);if(e===n)break;n=e}try{let e=P(r,`.git`);i++;let n=rn(e);if(n.isDirectory()||n.isFile())return z(`info`,`find_git_root_completed`,{duration_ms:Date.now()-t,stat_count:i,found:!0}),r.normalize(`NFC`)}catch{}return z(`info`,`find_git_root_completed`,{duration_ms:Date.now()-t,stat_count:i,found:!1}),Rr},e=>e,50),Br=jr(),Vr=he(e=>{try{let t=tn(P(e,`.git`),`utf-8`).trim();if(!t.startsWith(`gitdir:`))return e;let n=F(e,t.slice(7).trim()),r=F(n,tn(P(n,`commondir`),`utf-8`).trim());return F(N(n))!==P(r,`worktrees`)||nn(tn(P(n,`gitdir`),`utf-8`).trim())!==P(nn(e),`.git`)?e:qt(r)===`.git`?N(r).normalize(`NFC`):r.normalize(`NFC`)}catch{return e}},e=>e,50),Hr=Mr(),Ur=d(()=>zt(`git`)||`git`),Wr=d(async()=>{let e=Date.now();z(`info`,`is_git_check_started`);let t=Br(D())!==null;return z(`info`,`is_git_check_completed`,{duration_ms:Date.now()-e,is_git:t}),t}),Gr=async e=>Br(e)!==null,Kr=async()=>br(),qr=async()=>Sr(),Jr=async()=>xr(),Yr=async()=>Er()}));function Zr(){if(M()===`windows`){let e=ti();process.env.SHELL=e,process.env.CLAUDE_CODE_GIT_BASH_PATH=e,O(`Using bash path: "${e}"`)}}function Qr(e,t){let n=[`C:\\Program Files\\Git\\bin\\bash.exe`,`C:\\Program Files\\Git\\usr\\bin\\bash.exe`,`C:\\Program Files (x86)\\Git\\bin\\bash.exe`,`C:\\Program Files (x86)\\Git\\usr\\bin\\bash.exe`];t&&n.push(`${t}\\scoop\\apps\\git\\current\\usr\\bin\\bash.exe`);for(let t of n)if(e(t))return t;return null}function $r(e,t){if(e===`git`){for(let e of[`C:\\Program Files\\Git\\cmd\\git.exe`,`C:\\Program Files (x86)\\Git\\cmd\\git.exe`])if(t.checkExists(e))return e}try{let n=t.execCommand(`where.exe ${e}`).split(/\r?\n/).map(e=>e.trim()).filter(Boolean),r=R.resolve(t.cwdFn()).toLowerCase();for(let e of n){let t=R.resolve(e).toLowerCase(),n=R.dirname(t).toLowerCase(),i=R.relative(r,n);if(i===``||!i.startsWith(`..`)&&!R.isAbsolute(i)){O(`Skipping potentially malicious executable in current directory: ${e}`);continue}return e}return null}catch{return null}}function ei(e=ni){let t=e.envOverride??process.env.CLAUDE_CODE_GIT_BASH_PATH;if(t)return e.checkExists(t)?t:null;let n=$r(`bash`,e);if(n&&e.checkExists(n))return n;let r=$r(`git`,e);if(r){let t=[R.join(r,`..`,`..`,`bin`,`bash.exe`),R.join(r,`..`,`..`,`usr`,`bin`,`bash.exe`),R.join(r,`..`,`bash.exe`)];for(let n of t)if(e.checkExists(n))return n}return Qr(e.checkExists,e.userProfile)}function ti(){let e=ri();if(e!==null)return e;let t=process.env.CLAUDE_CODE_GIT_BASH_PATH;console.error(t?`Work Mate was unable to find CLAUDE_CODE_GIT_BASH_PATH path "${t}"`:`Work Mate on Windows requires git-bash (https://git-scm.com/downloads/win). If installed but not in PATH, set environment variable pointing to your bash.exe, similar to: CLAUDE_CODE_GIT_BASH_PATH=C:\\Program Files\\Git\\bin\\bash.exe`),process.exit(1)}var ni,ri,ii,ai,oi=e((()=>{f(),ut(),yt(),Rt(),ve(),Bt(),ni={checkExists:en,execCommand:e=>kt(e,{stdio:`pipe`,encoding:`utf8`}).trim(),cwdFn:D,userProfile:process.env.USERPROFILE,envOverride:void 0},ri=d(()=>ei()),ii=he(e=>{if(e.startsWith(`\\\\`))return e.replace(/\\/g,`/`);let t=e.match(/^([A-Za-z]):[/\\]/);return t?`/${t[1].toLowerCase()}${e.slice(2).replace(/\\/g,`/`)}`:e.replace(/\\/g,`/`)},e=>e,500),ai=he(e=>{if(e.startsWith(`//`))return e.replace(/\//g,`\\`);let t=e.match(/^\/cygdrive\/([A-Za-z])(\/|$)/);if(t)return`${t[1].toUpperCase()}:${(e.slice(`/cygdrive/${t[1]}`.length)||`\\`).replace(/\//g,`\\`)}`;let n=e.match(/^\/([A-Za-z])(\/|$)/);return n?`${n[1].toUpperCase()}:${(e.slice(2)||`\\`).replace(/\//g,`\\`)}`:e.replace(/\//g,`\\`)},e=>e,500)}));async function si(e){try{let{stdout:t}=await ci(`git`,[`worktree`,`list`,`--porcelain`],{cwd:e,timeout:5e3});return t?t.split(`
5
- `).filter(e=>e.startsWith(`worktree `)).map(e=>e.slice(9).normalize(`NFC`)):[]}catch{return[]}}var ci,li=e((()=>{ci=gn(_n)}));function ui(e){return typeof e==`string`&&Ni.test(e)?e:null}function di(e){if(!e.includes(`\\`))return e;try{return JSON.parse(`"${e}"`)}catch{return e}}function fi(e,t){let n=[`"${t}":"`,`"${t}": "`];for(let t of n){let n=e.indexOf(t);if(n<0)continue;let r=n+t.length,i=r;for(;i<e.length;){if(e[i]===`\\`){i+=2;continue}if(e[i]===`"`)return di(e.slice(r,i));i++}}}function pi(e,t){let n=[`"${t}":"`,`"${t}": "`],r;for(let t of n){let n=0;for(;;){let i=e.indexOf(t,n);if(i<0)break;let a=i+t.length,o=a;for(;o<e.length;){if(e[o]===`\\`){o+=2;continue}if(e[o]===`"`){r=di(e.slice(a,o));break}o++}n=o+1}}return r}function mi(e){let t=0,n=``;for(;t<e.length;){let r=e.indexOf(`
6
- `,t),i=r>=0?e.slice(t,r):e.slice(t);if(t=r>=0?r+1:e.length,!(!i.includes(`"type":"user"`)&&!i.includes(`"type": "user"`))&&!i.includes(`"tool_result"`)&&!(i.includes(`"isMeta":true`)||i.includes(`"isMeta": true`))&&!(i.includes(`"isCompactSummary":true`)||i.includes(`"isCompactSummary": true`)))try{let e=JSON.parse(i);if(e.type!==`user`)continue;let t=e.message;if(!t)continue;let r=t.content,a=[];if(typeof r==`string`)a.push(r);else if(Array.isArray(r))for(let e of r)e.type===`text`&&typeof e.text==`string`&&a.push(e.text);for(let e of a){let t=e.replace(/\n/g,` `).trim();if(!t)continue;let r=Fi.exec(t);if(r){n||(n=r[1]);continue}let i=/<bash-input>([\s\S]*?)<\/bash-input>/.exec(t);if(i)return`! ${i[1].trim()}`;if(!Pi.test(t))return t.length>200&&(t=`${t.slice(0,200).trim()}\u2026`),t}}catch{}}return n||``}async function hi(e,t,n){try{let r=await dn(e,`r`);try{let e=await r.read(n,0,W,0);if(e.bytesRead===0)return{head:``,tail:``};let i=n.toString(`utf8`,0,e.bytesRead),a=Math.max(0,t-W),o=i;if(a>0){let e=await r.read(n,0,W,a);o=n.toString(`utf8`,0,e.bytesRead)}return{head:i,tail:o}}finally{await r.close()}}catch{return{head:``,tail:``}}}async function gi(e){try{let t=await dn(e,`r`);try{let e=await t.stat(),n=Buffer.allocUnsafe(W),r=await t.read(n,0,W,0);if(r.bytesRead===0)return null;let i=n.toString(`utf8`,0,r.bytesRead),a=Math.max(0,e.size-W),o=i;if(a>0){let e=await t.read(n,0,W,a);o=n.toString(`utf8`,0,e.bytesRead)}return{mtime:e.mtime.getTime(),size:e.size,head:i,tail:o}}finally{await t.close()}}catch{return null}}function _i(e){return Math.abs(Dt(e)).toString(36)}function vi(e){let t=e.replace(/[^a-zA-Z0-9]/g,`-`);if(t.length<=200)return t;let n=typeof Bun<`u`?Bun.hash(e).toString(36):_i(e);return`${t.slice(0,200)}-${n}`}function yi(){return P(p(),`projects`)}function bi(e){return P(yi(),vi(e))}async function xi(e){try{return(await pn(e)).normalize(`NFC`)}catch{return e.normalize(`NFC`)}}async function Si(e){let t=bi(e);try{return await fn(t),t}catch{let t=vi(e);if(t.length<=200)return;let n=t.slice(0,200),r=yi();try{let e=(await fn(r,{withFileTypes:!0})).find(e=>e.isDirectory()&&e.name.startsWith(`${n}-`));return e?P(r,e.name):void 0}catch{return}}}async function Ci(e,t){let n=`${e}.jsonl`;if(t){let e=await xi(t),r=await Si(e);if(r){let t=P(r,n);try{let n=await mn(t);if(n.size>0)return{filePath:t,projectPath:e,fileSize:n.size}}catch{}}let i;try{i=await si(e)}catch{i=[]}for(let t of i){if(t===e)continue;let r=await Si(t);if(!r)continue;let i=P(r,n);try{let e=await mn(i);if(e.size>0)return{filePath:i,projectPath:t,fileSize:e.size}}catch{}}return}let r=yi(),i;try{i=await fn(r)}catch{return}for(let e of i){let t=P(r,e,n);try{let e=await mn(t);if(e.size>0)return{filePath:t,projectPath:void 0,fileSize:e.size}}catch{}}}function wi(){return Ri??(Ri=Buffer.from(`"compact_boundary"`))}function Ti(e){try{let t=JSON.parse(e);return t.type!==`system`||t.subtype!==`compact_boundary`?null:{hasPreservedSegment:!!t.compactMetadata?.preservedSegment}}catch{return null}}function U(e,t,n,r){let i=r-n;if(!(i<=0)){if(e.len+i>e.buf.length){let t=Buffer.allocUnsafe(Math.min(Math.max(e.buf.length*2,e.len+i),e.cap));e.buf.copy(t,0,0,e.len),e.buf=t}t.copy(e.buf,e.len,n,r),e.len+=i}}function Ei(e,t,n,r){return r-n>=t.length&&e.compare(t,0,t.length,n,n+t.length)===0}function Di(e,t,n){if(e.straddleSnapCarryLen=0,e.straddleSnapTailEnd=0,e.carryLen===0)return 0;let r=e.carryBuf,i=t.indexOf(Vi);if(i===-1||i>=n)return 0;let a=i+1;if(Ei(r,zi,0,e.carryLen))e.straddleSnapCarryLen=e.carryLen,e.straddleSnapTailEnd=a,e.lastSnapSrc=null;else if(e.carryLen<zi.length)return 0;else{if(Ei(r,Bi,0,e.carryLen)){let n=Ti(r.toString(`utf-8`,0,e.carryLen)+t.toString(`utf-8`,0,i));n?.hasPreservedSegment?e.hasPreservedSegment=!0:n&&(e.out.len=0,e.boundaryStartOffset=e.bufFileOff,e.hasPreservedSegment=!1,e.lastSnapSrc=null)}U(e.out,r,0,e.carryLen),U(e.out,t,0,a)}return e.bufFileOff+=e.carryLen+a,e.carryLen=0,a}function Oi(e,t,n){let r=t.indexOf(n),i=0,a=0,o=-1,s=-1,c=t.indexOf(Vi);for(;c!==-1;){let l=c+1;if(r!==-1&&r<a&&(r=t.indexOf(n,a)),Ei(t,zi,a,l))U(e.out,t,i,a),o=a,s=l,i=l;else if(r>=a&&r<Math.min(a+Ui,l)){let s=Ti(t.toString(`utf-8`,a,c));s?.hasPreservedSegment?e.hasPreservedSegment=!0:s&&(e.out.len=0,e.boundaryStartOffset=e.bufFileOff+a,e.hasPreservedSegment=!1,e.lastSnapSrc=null,o=-1,e.straddleSnapCarryLen=0,i=a),r=t.indexOf(n,r+n.length)}a=l,c=t.indexOf(Vi,a)}return U(e.out,t,i,a),{lastSnapStart:o,lastSnapEnd:s,trailStart:a}}function ki(e,t,n,r,i){r===-1?e.straddleSnapCarryLen>0&&(e.lastSnapLen=e.straddleSnapCarryLen+e.straddleSnapTailEnd,(e.lastSnapBuf===void 0||e.lastSnapLen>e.lastSnapBuf.length)&&(e.lastSnapBuf=Buffer.allocUnsafe(e.lastSnapLen)),e.carryBuf.copy(e.lastSnapBuf,0,0,e.straddleSnapCarryLen),n.copy(e.lastSnapBuf,e.straddleSnapCarryLen,0,e.straddleSnapTailEnd),e.lastSnapSrc=e.lastSnapBuf):(e.lastSnapLen=i-r,(e.lastSnapBuf===void 0||e.lastSnapLen>e.lastSnapBuf.length)&&(e.lastSnapBuf=Buffer.allocUnsafe(e.lastSnapLen)),t.copy(e.lastSnapBuf,0,r,i),e.lastSnapSrc=e.lastSnapBuf)}function Ai(e,t,n){e.carryLen=t.length-n,e.carryLen>0&&((e.carryBuf===void 0||e.carryLen>e.carryBuf.length)&&(e.carryBuf=Buffer.allocUnsafe(e.carryLen)),t.copy(e.carryBuf,0,n,t.length))}function ji(e){if(e.carryLen>0){let t=e.carryBuf;Ei(t,zi,0,e.carryLen)?(e.lastSnapSrc=t,e.lastSnapLen=e.carryLen):U(e.out,t,0,e.carryLen)}e.lastSnapSrc&&(e.out.len>0&&e.out.buf[e.out.len-1]!==Vi&&U(e.out,Hi,0,1),U(e.out,e.lastSnapSrc,0,e.lastSnapLen))}async function Mi(e,t){let n=wi(),r=Ii,i={out:{buf:Buffer.allocUnsafe(Math.min(t,8*1024*1024)),len:0,cap:t+1},boundaryStartOffset:0,hasPreservedSegment:!1,lastSnapSrc:null,lastSnapLen:0,lastSnapBuf:void 0,bufFileOff:0,carryLen:0,carryBuf:void 0,straddleSnapCarryLen:0,straddleSnapTailEnd:0},a=Buffer.allocUnsafe(r),o=await dn(e,`r`);try{let e=0;for(;e<t;){let{bytesRead:s}=await o.read(a,0,Math.min(r,t-e),e);if(s===0)break;e+=s;let c=Di(i,a,s),l;if(i.carryLen>0){let e=i.carryLen+(s-c);l=Buffer.allocUnsafe(e),i.carryBuf.copy(l,0,0,i.carryLen),a.copy(l,i.carryLen,c,s)}else l=a.subarray(c,s);let u=Oi(i,l,n);ki(i,l,a,u.lastSnapStart,u.lastSnapEnd),Ai(i,l,u.trailStart),i.bufFileOff+=u.trailStart}ji(i)}finally{await o.close()}return{boundaryStartOffset:i.boundaryStartOffset,postBoundaryBuf:i.out.buf.subarray(0,i.out.len),hasPreservedSegment:i.hasPreservedSegment}}var W,Ni,Pi,Fi,Ii,Li,Ri,zi,Bi,Vi,Hi,Ui,Wi=e((()=>{ne(),li(),Tt(),W=65536,Ni=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Pi=/^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/,Fi=/<command-name>(.*?)<\/command-name>/,Ii=1024*1024,Li=5*1024*1024,zi=Buffer.from(`{"type":"attribution-snapshot"`),Bi=Buffer.from(`{"type":"system"`),Vi=10,Hi=Buffer.from([Vi]),Ui=256}));function Gi(e,t){let n=t??D()??A().cwd();if(typeof e!=`string`)throw TypeError(`Path must be a string, received ${typeof e}`);if(typeof n!=`string`)throw TypeError(`Base directory must be a string, received ${typeof n}`);if(e.includes(`\0`)||n.includes(`\0`))throw Error(`Path contains null bytes`);let r=e=>e.includes(`/`)&&!e.includes(`\\`)&&!/^[A-Za-z]:/.test(e),i=e.trim();if(!i)return M()===`windows`&&r(n)?Zt.normalize(n).normalize(`NFC`):Xt(n).normalize(`NFC`);if(i===`~`)return Gt().normalize(`NFC`);if(i.startsWith(`~/`))return P(Gt(),i.slice(2)).normalize(`NFC`);let a=i;if(M()===`windows`&&i.match(/^\/[a-z]\//i))try{a=ai(i)}catch{a=i}return Yt(a)?M()===`windows`&&r(a)?Zt.normalize(a).normalize(`NFC`):Xt(a).normalize(`NFC`):M()===`windows`&&r(n)&&!/^[A-Za-z]:/.test(a)&&!a.startsWith(`\\\\`)?Zt.resolve(n,a).normalize(`NFC`):F(n,a).normalize(`NFC`)}function Ki(e){let t=Qt(D(),e);return t.startsWith(`..`)?e:t}function qi(e){let t=Gi(e);if(t.startsWith(`\\\\`)||t.startsWith(`//`))return N(t);try{if(A().statSync(t).isDirectory())return t}catch{}return N(t)}function Ji(e){return/(?:^|[\\/])\.\.(?:[\\/]|$)/.test(e)}function Yi(e){return Xt(e).replace(/\\/g,`/`)}var Xi=e((()=>{ut(),k(),Bt(),oi(),Wi()}));function Zi(e,t,n){(n!==void 0&&!ee(e[t],n)||n===void 0&&!(t in e))&&bn(e,t,n)}var Qi=e((()=>{xn(),te()}));function $i(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 ea=e((()=>{})),ta,na=e((()=>{ea(),ta=$i()}));function ra(e){return ie(e)&&ke(e)}var ia=e((()=>{De(),ae()}));function aa(e){if(!ie(e)||i(e)!=oa)return!1;var t=Hn(e);if(t===null)return!0;var n=ua.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&la.call(n)==da}var oa,sa,ca,la,ua,da,fa=e((()=>{n(),Un(),ae(),oa=`[object Object]`,sa=Function.prototype,ca=Object.prototype,la=sa.toString,ua=ca.hasOwnProperty,da=la.call(Object)}));function pa(e,t){if(!(t===`constructor`&&typeof e[t]==`function`)&&t!=`__proto__`)return e[t]}var ma=e((()=>{}));function ha(e){return Tn(e,Mn(e))}var ga=e((()=>{En(),Nn()}));function _a(e,t,n,i,a,o,s){var c=pa(e,n),u=pa(t,n),ee=s.get(u);if(ee){Zi(e,n,ee);return}var d=o?o(c,u,n+``,e,t,s):void 0,f=d===void 0;if(f){var te=it(u),p=!te&&Me(u),m=!te&&!p&&Le(u);d=u,te||p||m?it(c)?d=c:ra(c)?d=Bn(c):p?(f=!1,d=Pn(u,!0)):m?(f=!1,d=Kn(u,!0)):d=[]:aa(u)||Ge(u)?(d=c,Ge(c)?d=ha(c):(!r(c)||l(c))&&(d=Zn(u))):f=!1}f&&(s.set(u,d),a(d,u,i,o,s),s.delete(u)),Zi(e,n,d)}var va=e((()=>{Qi(),zn(),qn(),Vn(),Qn(),we(),Xe(),ia(),He(),u(),o(),fa(),Fe(),ma(),ga()}));function ya(e,t,n,i,a){e!==t&&ta(t,function(o,s){if(a||(a=new st),r(o))_a(e,t,s,n,ya,i,a);else{var c=i?i(pa(e,s),o,s+``,e,t,a):void 0;c===void 0&&(c=o),Zi(e,s,c)}},Mn)}var ba=e((()=>{Pe(),Qi(),na(),va(),o(),Nn(),ma()}));function xa(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 Sa=e((()=>{}));function Ca(e,t,n){return t=wa(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,a=wa(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),xa(e,this,s)}}var wa,Ta=e((()=>{Sa(),wa=Math.max}));function Ea(e){return function(){return e}}var Da=e((()=>{})),Oa,ka=e((()=>{Da(),yn(),Ze(),Oa=vn?function(e,t){return vn(e,`toString`,{configurable:!0,enumerable:!1,value:Ea(t),writable:!0})}:et}));function Aa(e){var t=0,n=0;return function(){var r=Na(),i=Ma-(r-n);if(n=r,i>0){if(++t>=ja)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var ja,Ma,Na,Pa=e((()=>{ja=800,Ma=16,Na=Date.now})),Fa,Ia=e((()=>{ka(),Pa(),Fa=Aa(Oa)}));function La(e,t){return Fa(Ca(e,t,et),e+``)}var Ra=e((()=>{Ze(),Ta(),Ia()}));function za(e,t,n){if(!r(n))return!1;var i=typeof t;return(i==`number`?ke(n)&&Re(t,n.length):i==`string`&&t in n)?ee(n[t],e):!1}var Ba=e((()=>{te(),De(),ze(),o()}));function Va(e){return La(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&&za(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 Ha=e((()=>{Ra(),Ba()})),G,Ua=e((()=>{ba(),Ha(),G=Va(function(e,t,n,r){ya(e,t,n,r)})}));function Wa(e,t){return e.flatMap((e,n)=>n?[t(n),e]:[e])}function Ga(e,t){let n=0;for(let r of e)n+=+!!t(r);return n}function Ka(e){return[...new Set(e)]}var qa=e((()=>{}));function Ja(e){let{buffer:t,bytesRead:n}=A().readSync(e,{length:4096});return n===0?`utf8`:n>=2&&t[0]===255&&t[1]===254?`utf16le`:(n>=3&&t[0]===239&&t[1]===187&&t[2],`utf8`)}function Ya(e){let t=0,n=0;for(let r=0;r<e.length;r++)e[r]===`
7
- `&&(r>0&&e[r-1]===`\r`?t++:n++);return t>n?`CRLF`:`LF`}function Xa(e){let t=A(),{resolvedPath:n,isSymlink:r}=vt(t,e);r&&O(`Reading through symlink: ${e} -> ${n}`);let i=Ja(n),a=t.readFileSync(n,{encoding:i}),o=Ya(a.slice(0,4096));return{content:a.replaceAll(`\r
8
- `,`
9
- `),encoding:i,lineEndings:o}}function Za(e){return Xa(e).content}var Qa=e((()=>{yt(),k()})),$a,eo,to=e((()=>{Eo(),k(),re(),$a=class{constructor(){h(this,`cache`,new Map),h(this,`maxCacheSize`,1e3)}readFile(e){let t=A(),n;try{n=t.statSync(e)}catch(t){throw this.cache.delete(e),t}let r=e,i=this.cache.get(r);if(i&&i.mtime===n.mtimeMs)return{content:i.content,encoding:i.encoding};let a=so(e),o=t.readFileSync(e,{encoding:a}).replaceAll(`\r
10
- `,`
11
- `);if(this.cache.set(r,{content:o,encoding:a,mtime:n.mtimeMs}),this.cache.size>this.maxCacheSize){let e=this.cache.keys().next().value;e&&this.cache.delete(e)}return{content:o,encoding:a}}clear(){this.cache.clear()}invalidate(e){this.cache.delete(e)}getStats(){return{size:this.cache.size,entries:Array.from(this.cache.keys())}}},eo=new $a}));async function no(e){try{return await mn(e),!0}catch{return!1}}function ro(e){try{return A().readFileSync(e,{encoding:`utf8`})}catch(e){return j(e),null}}function io(e){let t=A();return Math.floor(t.statSync(e).mtimeMs)}async function ao(e){let t=await A().stat(e);return Math.floor(t.mtimeMs)}function oo(e,t,n,r){let i=t;r===`CRLF`&&(i=t.replaceAll(`\r
12
- `,`
13
- `).split(`
14
- `).join(`\r
15
- `)),bo(e,i,{encoding:n})}function so(e){try{let{resolvedPath:t}=vt(A(),e);return Ja(t)}catch(e){return dt(e)?O(`detectFileEncoding failed for expected reason: ${e.code}`,{level:`debug`}):j(e),`utf8`}}function co(e,t=`utf8`){try{let n=A(),{resolvedPath:r}=vt(n,e),{buffer:i,bytesRead:a}=n.readSync(r,{length:4096});return Ya(i.toString(t,0,a))}catch(e){return j(e),`LF`}}function lo(e){return e.includes(` `)?e.replace(/^\t+/gm,e=>` `.repeat(e.length)):e}function uo(e){let t=e?Gi(e):void 0;return{absolutePath:t,relativePath:t?Qt(D(),t):void 0}}function fo(e){let{relativePath:t}=uo(e);if(t&&!t.startsWith(`..`))return t;let n=Gt();return e.startsWith(n+I)?`~${e.slice(n.length)}`:e}function po(e){let t=A();try{let n=N(e),r=qt(e,Jt(e)),i=t.readdirSync(n).filter(t=>qt(t.name,Jt(t.name))===r&&P(n,t.name)!==e)[0];return i?i.name:void 0}catch(e){St(e)||j(e);return}}async function mo(e){let t=D(),n=N(t),r=e;try{r=P(await pn(N(e)),qt(e))}catch{}let i=n===I?I:n+I;if(!r.startsWith(i)||r.startsWith(t+I)||r===t)return;let a=P(t,Qt(n,r));try{return await mn(a),a}catch{return}}function ho(){return!0}function go({content:e,startLine:t}){if(!e)return``;let n=e.split(/\r?\n/);return ho()?n.map((e,n)=>`${n+t}\t${e}`).join(`
16
- `):n.map((e,n)=>{let r=String(n+t);return r.length>=6?`${r}→${e}`:`${r.padStart(6,` `)}→${e}`}).join(`
17
- `)}function _o(e){return e.match(/^\s*\d+[\u2192\t](.*)$/)?.[1]??e}function vo(e){try{return A().isDirEmptySync(e)}catch(e){return St(e)}}function yo(e){let{content:t}=eo.readFile(e);return t}function bo(e,t,n={encoding:`utf-8`}){let r=A(),i=e;try{let t=r.readlinkSync(e);i=Yt(t)?t:F(N(e),t),O(`Writing through symlink: ${e} -> ${i}`)}catch{}let a=`${i}.tmp.${process.pid}.${Date.now()}`,o,s=!1;try{o=r.statSync(i).mode,s=!0,O(`Preserving file permissions: ${o.toString(8)}`)}catch(e){if(!St(e))throw e;n.mode!==void 0&&(o=n.mode,O(`Setting permissions for new file: ${o.toString(8)}`))}try{O(`Writing to temp file: ${a}`);let e={encoding:n.encoding,flush:!0};!s&&n.mode!==void 0&&(e.mode=n.mode),sn(a,t,e),O(`Temp file written successfully, size: ${t.length} bytes`),s&&o!==void 0&&($t(a,o),O(`Applied original permissions to temp file`)),O(`Renaming ${a} to ${i}`),r.renameSync(a,i),O(`File ${i} written atomically`)}catch(e){O(`Failed to write file atomically: ${e}`,{level:`error`}),Ht(`tengu_atomic_write_error`,{});try{O(`Cleaning up temp file: ${a}`),r.unlinkSync(a)}catch(e){O(`Failed to clean up temp file: ${e}`)}O(`Falling back to non-atomic write for ${i}`);try{let e={encoding:n.encoding,flush:!0};!s&&n.mode!==void 0&&(e.mode=n.mode),sn(i,t,e),O(`File ${i} written successfully with non-atomic fallback`)}catch(e){throw O(`Non-atomic write also failed: ${e}`),e}}}function xo(e,t=wo){try{return A().statSync(e).size<=t}catch{return!1}}function So(e){let t=Xt(e);return t=t.replace(/\\/g,`/`),M()===`windows`&&(t=t.toLowerCase()),t}function Co(e,t){return So(e)===So(t)}var wo,To,Eo=e((()=>{Vt(),ut(),yt(),pt(),Qa(),to(),k(),Et(),Xi(),Bt(),wo=.25*1024*1024,To=`Note: your current working directory is`}));async function Do(e,t){let{code:n}=await wt(`git`,[`check-ignore`,e],{preserveOutputOnError:!1,cwd:t});return n===0}function Oo(){return P(Gt(),`.config`,`git`,`ignore`)}async function ko(e,t=D()){try{if(!await Gr(t))return;let n=`**/${e}`;if(await Do(e.endsWith(`/`)?`${e}sample-file.txt`:e,t))return;let r=Oo();await un(N(r),{recursive:!0});try{if((await L(r,{encoding:`utf-8`})).includes(n))return;await ln(r,`\n${n}\n`)}catch(e){if(mt(e)===`ENOENT`)await hn(r,`${n}\n`,`utf-8`);else throw e}}catch(e){j(e)}}var Ao=e((()=>{ut(),pt(),Ct(),Xr(),Et()}));function jo(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 Mo(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 No(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 Po(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 Fo(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 Io(){let e=ot(),t=new Set(e);return t.add(`policySettings`),t.add(`flagSettings`),Array.from(t)}function Lo(e){return Io().includes(e)}var Ro,zo,Bo,Vo=e((()=>{lt(),Ro=[`userSettings`,`projectSettings`,`localSettings`,`flagSettings`,`policySettings`],zo=[`localSettings`,`projectSettings`,`userSettings`],Bo=`https://json.schemastore.org/claude-code-settings.json`}));function Ho(e){Go.set(e,Date.now())}function Uo(e,t){let n=Go.get(e);return n!==void 0&&Date.now()-n<t?(Go.delete(e),!0):!1}function Wo(){Go.clear()}var Go,Ko=e((()=>{Go=new Map})),qo,Jo,Yo=e((()=>{f(),Bt(),qo=d(()=>{switch(M()){case`macos`:return`/Library/Application Support/ClaudeCode`;case`windows`:return`C:\\Program Files\\ClaudeCode`;default:return`/etc/workmate`}}),Jo=d(()=>P(qo(),`managed-settings.d`))})),Xo,Zo,Qo,$o=e((()=>{E(),be(),Xo=T(()=>v({allowedDomains:y(w()).optional(),allowManagedDomainsOnly:_().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:y(w()).optional().describe(`macOS only: Unix socket paths to allow. Ignored on Linux (seccomp cannot filter by path).`),allowAllUnixSockets:_().optional().describe(`If true, allow all Unix sockets (disables blocking on both platforms).`),allowLocalBinding:_().optional(),httpProxyPort:S().optional(),socksProxyPort:S().optional()}).optional()),Zo=T(()=>v({allowWrite:y(w()).optional().describe(`Additional paths to allow writing within the sandbox. Merged with paths from Edit(...) allow permission rules.`),denyWrite:y(w()).optional().describe(`Additional paths to deny writing within the sandbox. Merged with paths from Edit(...) deny permission rules.`),denyRead:y(w()).optional().describe(`Additional paths to deny reading within the sandbox. Merged with paths from Read(...) deny permission rules.`),allowRead:y(w()).optional().describe(`Paths to re-allow reading within denyRead regions. Takes precedence over denyRead for matching paths.`),allowManagedReadPathsOnly:_().optional().describe(`When true (set in managed settings), only allowRead paths from policySettings are used.`)}).optional()),Qo=T(()=>v({enabled:_().optional(),failIfUnavailable:_().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:_().optional(),allowUnsandboxedCommands:_().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:Xo(),filesystem:Zo(),ignoreViolations:C(w(),y(w())).optional(),enableWeakerNestedSandbox:_().optional(),enableWeakerNetworkIsolation:_().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:y(w()).optional(),ripgrep:v({command:w(),args:y(w()).optional()}).optional().describe(`Custom ripgrep configuration for bundled ripgrep support`)}).passthrough())}));function es(){return process.env.CLAUDE_CODE_CUSTOM_OAUTH_URL?`-custom-oauth`:``}function ts(){let e=ls,t=process.env.CLAUDE_CODE_CUSTOM_OAUTH_URL;if(t){let n=t.replace(/\/$/,``);if(!ds.includes(n))throw Error(`CLAUDE_CODE_CUSTOM_OAUTH_URL is not an approved endpoint.`);e={...e,BASE_API_URL:n,CONSOLE_AUTHORIZE_URL:`${n}/oauth/authorize`,CLAUDE_AI_AUTHORIZE_URL:`${n}/oauth/authorize`,CLAUDE_AI_ORIGIN:n,TOKEN_URL:`${n}/v1/oauth/token`,API_KEY_URL:`${n}/api/oauth/claude_cli/create_api_key`,ROLES_URL:`${n}/api/oauth/claude_cli/roles`,CONSOLE_SUCCESS_URL:`${n}/oauth/code/success?app=workmate`,CLAUDEAI_SUCCESS_URL:`${n}/oauth/code/success?app=workmate`,MANUAL_REDIRECT_URL:`${n}/oauth/code/callback`,OAUTH_FILE_SUFFIX:`-custom-oauth`}}let n=process.env.CLAUDE_CODE_OAUTH_CLIENT_ID;return n&&(e={...e,CLIENT_ID:n}),e}var ns,rs,is,as,os,ss,cs,ls,us,ds,fs=e((()=>{ns=`user:inference`,rs=`user:profile`,is=`org:create_api_key`,as=`oauth-2025-04-20`,os=[is,rs],ss=[rs,ns,`user:sessions:claude_code`,`user:mcp_servers`,`user:file_upload`],cs=Array.from(new Set([...os,...ss])),ls={BASE_API_URL:`https://api.anthropic.com`,CONSOLE_AUTHORIZE_URL:`https://platform.workmate.com/oauth/authorize`,CLAUDE_AI_AUTHORIZE_URL:`https://claude.com/cai/oauth/authorize`,CLAUDE_AI_ORIGIN:`https://claude.ai`,TOKEN_URL:`https://platform.workmate.com/v1/oauth/token`,API_KEY_URL:`https://api.anthropic.com/api/oauth/claude_cli/create_api_key`,ROLES_URL:`https://api.anthropic.com/api/oauth/claude_cli/roles`,CONSOLE_SUCCESS_URL:`https://platform.workmate.com/buy_credits?returnUrl=/oauth/code/success%3Fapp%3Dworkmate`,CLAUDEAI_SUCCESS_URL:`https://platform.workmate.com/oauth/code/success?app=workmate`,MANUAL_REDIRECT_URL:`https://platform.workmate.com/oauth/code/callback`,CLIENT_ID:`9d1c250a-e61b-44d9-88ed-5944d1962f5e`,OAUTH_FILE_SUFFIX:``,MCP_PROXY_URL:`https://mcp-proxy.anthropic.com`,MCP_PROXY_PATH:`/v1/mcp/{server_id}`},us=`https://claude.ai/oauth/claude-code-client-metadata`,ds=[`https://beacon.claude-ai.staging.ant.dev`,`https://claude.fedstart.com`,`https://claude-staging.fedstart.com`]}));async function ps(e){try{return!!await Lt(e)}catch{return!1}}function ms(){return process.env.__CFBundleIdentifier===`com.conductor.app`}function hs(){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 ws)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(gs())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 gs(){return!!(process.env.SSH_CONNECTION||process.env.SSH_CLIENT||process.env.SSH_TTY)}function _s(){let e=process.env.CLAUDE_CODE_HOST_PLATFORM;return e===`win32`||e===`darwin`||e===`linux`?e:K.platform}var vs,ys,bs,xs,Ss,Cs,ws,Ts,K,Es=e((()=>{f(),fs(),Nt(),ne(),It(),k(),Ot(),vs=d(()=>{if(A().existsSync(P(p(),`.config.json`)))return P(p(),`.config.json`);let e=`.workmate${es()}.json`;return P(process.env.WORKMATE_CONFIG_DIR||Gt(),e)}),ys=d(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}}),bs=d(async()=>{let e=[];return await ps(`npm`)&&e.push(`npm`),await ps(`yarn`)&&e.push(`yarn`),await ps(`pnpm`)&&e.push(`pnpm`),e}),xs=d(async()=>{let e=[];return await ps(`bun`)&&e.push(`bun`),await ps(`deno`)&&e.push(`deno`),await ps(`node`)&&e.push(`node`),e}),Ss=d(()=>{try{return A().existsSync(`/proc/sys/fs/binfmt_misc/WSLInterop`)}catch{return!1}}),Cs=d(()=>{try{if(!Ss())return!1;let{cmd:e}=At(`npm`,[]);return e.startsWith(`/mnt/c/`)}catch{return!1}}),ws=[`pycharm`,`intellij`,`webstorm`,`phpstorm`,`rubymine`,`clion`,`goland`,`rider`,`datagrip`,`appcode`,`dataspell`,`aqua`,`gateway`,`fleet`,`jetbrains`,`androidstudio`],Ts=d(()=>{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(A().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(A().existsSync(`/.dockerenv`))return`docker`}catch{}return K.platform===`darwin`?`unknown-darwin`:K.platform===`linux`?`unknown-linux`:K.platform===`win32`?`unknown-win32`:`unknown`}),K={hasInternetAccess:ys,isCI:m(process.env.CI),platform:[`win32`,`darwin`].includes(process.platform)?process.platform:`linux`,arch:process.arch,nodeVersion:process.version,terminal:hs(),isSSH:gs,getPackageManagers:bs,getRuntimes:xs,isRunningWithBun:d(jt),isWslEnvironment:Ss,isNpmFromWindowsPath:Cs,isConductor:ms,detectDeploymentEnvironment:Ts}})),Ds,Os=e((()=>{Es(),Ds=K.platform===`darwin`?`⏺`:`●`})),ks,As,js,Ms=e((()=>{ks=[`acceptEdits`,`bypassPermissions`,`default`,`dontAsk`,`plan`],As=[...ks,`auto`],js=As}));function Ns(e){return!0}function Ps(e){return Us[e]??Us.default}function Fs(e){return Ps(e).external}function Is(e){return js.includes(e)?e:`default`}function Ls(e){return Ps(e).title}function Rs(e){return e==="default"||e===void 0}function zs(e){return Ps(e).shortTitle}function Bs(e){return Ps(e).symbol}function Vs(e){return Ps(e).color}var Hs,Us,Ws=e((()=>{E(),Os(),Ms(),be(),T(()=>pe.enum(js)),Hs=T(()=>pe.enum(ks)),Us={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`}}})),Gs=e((()=>{})),Ks,qs=e((()=>{Gs(),Ks=`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(`.`)})),Js=e((()=>{})),Ys=e((()=>{})),Xs=e((()=>{qs(),Js(),Ys()})),Zs,Qs,$s=e((()=>{Zs=[`bash`,`powershell`],Qs=`bash`}));function ec(){return{BashCommandHookSchema:v({type:x(`command`).describe(`Shell command hook type`),command:w().describe(`Shell command to execute`),if:tc(),shell:g(Zs).optional().describe(`Shell interpreter. 'bash' uses your $SHELL (bash/zsh/sh); 'powershell' uses pwsh. Defaults to bash.`),timeout:S().positive().optional().describe(`Timeout in seconds for this specific command`),statusMessage:w().optional().describe(`Custom status message to display in spinner while hook runs`),once:_().optional().describe(`If true, hook runs once and is removed after execution`),async:_().optional().describe(`If true, hook runs in background without blocking`),asyncRewake:_().optional().describe(`If true, hook runs in background and wakes the model on exit code 2 (blocking error). Implies async.`)}),PromptHookSchema:v({type:x(`prompt`).describe(`LLM prompt hook type`),prompt:w().describe(`Prompt to evaluate with LLM. Use $ARGUMENTS placeholder for hook input JSON.`),if:tc(),timeout:S().positive().optional().describe(`Timeout in seconds for this specific prompt evaluation`),model:w().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:w().optional().describe(`Custom status message to display in spinner while hook runs`),once:_().optional().describe(`If true, hook runs once and is removed after execution`)}),HttpHookSchema:v({type:x(`http`).describe(`HTTP hook type`),url:w().url().describe(`URL to POST the hook input JSON to`),if:tc(),timeout:S().positive().optional().describe(`Timeout in seconds for this specific request`),headers:C(w(),w()).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:y(w()).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:w().optional().describe(`Custom status message to display in spinner while hook runs`),once:_().optional().describe(`If true, hook runs once and is removed after execution`)}),AgentHookSchema:v({type:x(`agent`).describe(`Agentic verifier hook type`),prompt:w().describe(`Prompt describing what to verify (e.g. "Verify that unit tests ran and passed."). Use $ARGUMENTS placeholder for hook input JSON.`),if:tc(),timeout:S().positive().optional().describe(`Timeout in seconds for agent execution (default 60)`),model:w().optional().describe(`Model to use for this agent hook (e.g., "claude-sonnet-4-6"). If not specified, uses Haiku.`),statusMessage:w().optional().describe(`Custom status message to display in spinner while hook runs`),once:_().optional().describe(`If true, hook runs once and is removed after execution`)})}}var tc,nc,rc,ic,ac=e((()=>{Xs(),E(),be(),$s(),tc=T(()=>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.`)),nc=T(()=>{let{BashCommandHookSchema:e,PromptHookSchema:t,AgentHookSchema:n,HttpHookSchema:r}=ec();return ue(`type`,[e,t,n,r])}),rc=T(()=>v({matcher:w().optional().describe(`String pattern to match (e.g. tool names like "Write")`),hooks:y(nc()).describe(`List of hooks to execute when the matcher matches`)})),ic=T(()=>xe(g(Ks),y(rc())))}));function oc(e,t){let n=e.toLowerCase();return t.autoUpdate??(dc.has(n)&&!fc.has(n))}function sc(e){return dc.has(e.toLowerCase())?!1:mc.test(e)?!0:pc.test(e)}function cc(e,t){let n=e.toLowerCase();if(!dc.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/${hc}/' 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/${hc}/' can use this name.`}return`The name '${e}' is reserved for official marketplaces and can only be used with GitHub sources from the '${hc}' organization.`}function lc(e){return typeof e==`string`&&e.startsWith(`./`)}function uc(e){return e.source===`file`||e.source===`directory`}var dc,fc,pc,mc,hc,q,J,gc,_c,vc,yc,bc,xc,Sc,Cc,wc,Tc,Ec,Dc,Oc,kc,Ac,jc,Mc,Nc,Pc,Fc,Ic,Lc,Rc,zc,Bc,Vc,Hc,Uc,Wc,Gc,Kc,qc,Jc,Yc,Xc,Zc,Qc,$c,el,tl,nl=e((()=>{E(),ac(),ge(),be(),dc=new Set([`claude-code-marketplace`,`claude-code-plugins`,`claude-plugins-official`,`anthropic-marketplace`,`anthropic-plugins`,`agent-skills`,`life-sciences`,`knowledge-work-plugins`]),fc=new Set([`knowledge-work-plugins`]),pc=/(?:official[^a-z0-9]*(anthropic|claude)|(?:anthropic|claude)[^a-z0-9]*official|^(?:anthropic|claude)[^a-z0-9]*(marketplace|plugins|official))/i,mc=/[^\u0020-\u007E]/,hc=`anthropics`,q=T(()=>w().startsWith(`./`)),J=T(()=>q().endsWith(`.json`)),gc=T(()=>b([q().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`),w().url().refine(e=>e.endsWith(`.mcpb`)||e.endsWith(`.dxt`),{message:`MCPB URL must end with .mcpb or .dxt`}).describe(`URL to MCPB file`)])),_c=T(()=>q().endsWith(`.md`)),vc=T(()=>b([_c(),q()])),yc=T(()=>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=>!sc(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`})),bc=T(()=>v({name:w().min(1,`Author name cannot be empty`).describe(`Display name of the plugin author or organization`),email:w().optional().describe(`Contact email for support or feedback`),url:w().optional().describe(`Website, GitHub profile, or organization URL`)})),xc=T(()=>v({name:w().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:w().optional().describe(`Semantic version (e.g., 1.2.3) following semver.org specification`),description:w().optional().describe(`Brief, user-facing explanation of what the plugin provides`),author:bc().optional().describe(`Information about the plugin creator or maintainer`),homepage:w().url().optional().describe(`Plugin homepage or documentation URL`),repository:w().optional().describe(`Source code repository URL`),license:w().optional().describe(`SPDX license identifier (e.g., MIT, Apache-2.0)`),keywords:y(w()).optional().describe(`Tags for plugin discovery and categorization`),dependencies:y(Jc()).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.`)})),Sc=T(()=>v({description:w().optional().describe(`Brief, user-facing explanation of what these hooks provide`),hooks:se(()=>ic()).describe(`The hooks provided by the plugin, in the same format as the one used for settings`)})),Cc=T(()=>v({hooks:b([J().describe(`Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root`),se(()=>ic()).describe(`Additional hooks (in addition to those in hooks/hooks.json, if it exists)`),y(b([J().describe(`Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root`),se(()=>ic()).describe(`Additional hooks (in addition to those in hooks/hooks.json, if it exists)`)]))])})),wc=T(()=>v({source:vc().optional().describe(`Path to command markdown file, relative to plugin root`),content:w().optional().describe(`Inline markdown content for the command`),description:w().optional().describe(`Command description override`),argumentHint:w().optional().describe(`Hint for command arguments (e.g., "[file]")`),model:w().optional().describe(`Default model for this command`),allowedTools:y(w()).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`})),Tc=T(()=>v({commands:b([vc().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`),y(vc().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`),C(w(),wc()).describe(`Object mapping of command names to their metadata and source files. Command name becomes the slash command name (e.g., "about" → "/plugin:about")`)])})),Ec=T(()=>v({agents:b([_c().describe(`Path to additional agent file (in addition to those in the agents/ directory, if it exists), relative to the plugin root`),y(_c().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`)])})),Dc=T(()=>v({skills:b([q().describe(`Path to additional skill directory (in addition to those in the skills/ directory, if it exists), relative to the plugin root`),y(q().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`)])})),Oc=T(()=>v({outputStyles:b([q().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`),y(q().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`)])})),kc=T(()=>w().min(1)),Ac=T(()=>w().min(2).refine(e=>e.startsWith(`.`),{message:`File extensions must start with dot (e.g., ".ts", not "ts")`})),jc=T(()=>v({mcpServers:b([J().describe(`MCP servers to include in the plugin (in addition to those in the .mcp.json file, if it exists)`),gc().describe(`Path or URL to MCPB file containing MCP server configuration`),C(w(),Se()).describe(`MCP server configurations keyed by server name`),y(b([J().describe(`Path to MCP servers configuration file`),gc().describe(`Path or URL to MCPB file`),C(w(),Se()).describe(`Inline MCP server configurations`)])).describe(`Array of MCP server configurations (paths, MCPB files, or inline definitions)`)])})),Mc=T(()=>v({type:g([`string`,`number`,`boolean`,`directory`,`file`]).describe(`Type of the configuration value`),title:w().describe(`Human-readable label shown in the config dialog`),description:w().describe(`Help text shown beneath the field in the config dialog`),required:_().optional().describe(`If true, validation fails when this field is empty`),default:b([w(),S(),_(),y(w())]).optional().describe(`Default value used when the user provides nothing`),multiple:_().optional().describe(`For string type: allow an array of strings`),sensitive:_().optional().describe(`If true, masks dialog input and stores value in secure storage (keychain/credentials file) instead of settings.json`),min:S().optional().describe(`Minimum value (number type only)`),max:S().optional().describe(`Maximum value (number type only)`)}).strict()),Nc=T(()=>v({userConfig:C(w().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`),Mc()).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).")})),Pc=T(()=>v({channels:y(v({server:w().min(1).describe(`Name of the MCP server this channel binds to. Must match a key in this plugin's mcpServers.`),displayName:w().optional().describe(`Human-readable name shown in the config dialog title (e.g., "Telegram"). Defaults to the server name.`),userConfig:C(w(),Mc()).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.`)})),Fc=T(()=>me({command:w().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:y(kc()).optional().describe(`Command-line arguments to pass to the server`),extensionToLanguage:C(Ac(),kc()).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:g([`stdio`,`socket`]).default(`stdio`).describe(`Communication transport mechanism`),env:C(w(),w()).optional().describe(`Environment variables to set when starting the server`),initializationOptions:oe().optional().describe(`Initialization options passed to the server during initialization`),settings:oe().optional().describe(`Settings passed to the server via workspace/didChangeConfiguration`),workspaceFolder:w().optional().describe(`Workspace folder path to use for the server`),startupTimeout:S().int().positive().optional().describe(`Maximum time to wait for server startup (milliseconds)`),shutdownTimeout:S().int().positive().optional().describe(`Maximum time to wait for graceful shutdown (milliseconds)`),restartOnCrash:_().optional().describe(`Whether to restart the server if it crashes`),maxRestarts:S().int().nonnegative().optional().describe(`Maximum number of restart attempts before giving up`)})),Ic=T(()=>v({lspServers:b([J().describe(`Path to .lsp.json configuration file relative to plugin root`),C(w(),Fc()).describe(`LSP server configurations keyed by server name`),y(b([J().describe(`Path to LSP configuration file`),C(w(),Fc()).describe(`Inline LSP server configurations`)])).describe(`Array of LSP server configurations (paths or inline definitions)`)])})),Lc=T(()=>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`)),Rc=T(()=>v({settings:C(w(),oe()).optional().describe(`Settings to merge when plugin is enabled. Only allowlisted keys are kept (currently: agent)`)})),zc=T(()=>v({...xc().shape,...Cc().partial().shape,...Tc().partial().shape,...Ec().partial().shape,...Dc().partial().shape,...Oc().partial().shape,...Pc().partial().shape,...jc().partial().shape,...Ic().partial().shape,...Rc().partial().shape,...Nc().partial().shape})),Bc=T(()=>ue(`source`,[v({source:x(`url`),url:w().url().describe(`Direct URL to marketplace.json file`),headers:C(w(),w()).optional().describe(`Custom HTTP headers (e.g., for authentication)`)}),v({source:x(`github`),repo:w().describe(`GitHub repository in owner/repo format`),ref:w().optional().describe(`Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.`),path:w().optional().describe(`Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)`),sparsePaths:y(w()).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.`)}),v({source:x(`git`),url:w().describe(`Full git repository URL`),ref:w().optional().describe(`Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.`),path:w().optional().describe(`Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)`),sparsePaths:y(w()).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.`)}),v({source:x(`npm`),package:Lc().describe(`NPM package containing marketplace.json`)}),v({source:x(`file`),path:w().describe(`Local file path to marketplace.json`)}),v({source:x(`directory`),path:w().describe(`Local directory containing .claude-plugin/marketplace.json`)}),v({source:x(`hostPattern`),hostPattern:w().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$").`)}),v({source:x(`pathPattern`),pathPattern:w().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.`)}),v({source:x(`settings`),name:yc().refine(e=>!dc.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:y(Uc()).describe(`Plugin entries declared inline in settings.json`),owner:bc().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).`)])),Vc=T(()=>w().length(40).regex(/^[a-f0-9]{40}$/,`Must be a full 40-character lowercase git commit SHA`)),Hc=T(()=>b([q().describe(`Path to the plugin root, relative to the marketplace root (the directory containing .claude-plugin/, not .claude-plugin/ itself)`),v({source:x(`npm`),package:Lc().or(w()).describe("Package name (or url, or local path, or anything else that can be passed to `npm` as a package)"),version:w().optional().describe(`Specific version or version range (e.g., ^1.0.0, ~2.1.0)`),registry:w().url().optional().describe(`Custom NPM registry URL (defaults to using system default, likely npmjs.org)`)}).describe(`NPM package as plugin source`),v({source:x(`pip`),package:w().describe(`Python package name as it appears on PyPI`),version:w().optional().describe(`Version specifier (e.g., ==1.0.0, >=2.0.0, <3.0.0)`),registry:w().url().optional().describe(`Custom PyPI registry URL (defaults to using system default, likely pypi.org)`)}).describe(`Python package as plugin source`),v({source:x(`url`),url:w().describe(`Full git repository URL (https:// or git@)`),ref:w().optional().describe(`Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.`),sha:Vc().optional().describe(`Specific commit SHA to use`)}),v({source:x(`github`),repo:w().describe(`GitHub repository in owner/repo format`),ref:w().optional().describe(`Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.`),sha:Vc().optional().describe(`Specific commit SHA to use`)}),v({source:x(`git-subdir`),url:w().describe(`Git repository: GitHub owner/repo shorthand, https://, or git@ URL`),path:w().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:w().optional().describe(`Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.`),sha:Vc().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.`)])),Uc=T(()=>v({name:w().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:Hc().describe(`Where to fetch the plugin from. Must be a remote source — relative paths have no marketplace repository to resolve against.`),description:w().optional(),version:w().optional(),strict:_().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.`})),Wc=T(()=>zc().partial().extend({name:w().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:Hc().describe(`Where to fetch the plugin from`),category:w().optional().describe(`Category for organizing plugins (e.g., "productivity", "development")`),tags:y(w()).optional().describe(`Tags for searchability and discovery`),strict:_().optional().default(!0).describe(`Require the plugin manifest to be present in the plugin folder. If false, the marketplace entry provides the manifest.`)})),Gc=T(()=>v({name:yc(),owner:bc().describe(`Marketplace maintainer or curator information`),plugins:y(Wc()).describe(`Collection of available plugins in this marketplace`),forceRemoveDeletedPlugins:_().optional().describe(`When true, plugins removed from this marketplace will be automatically uninstalled and flagged for users`),metadata:v({pluginRoot:w().optional().describe(`Base path for relative plugin sources`),version:w().optional().describe(`Marketplace version`),description:w().optional().describe(`Marketplace description`)}).optional().describe(`Optional marketplace metadata`),allowCrossMarketplaceDependenciesOn:y(w()).optional().describe(`Marketplace names whose plugins may be auto-installed as dependencies. Only the root marketplace's allowlist applies — no transitive trust.`)})),Kc=T(()=>w().regex(/^[a-z0-9][-a-z0-9._]*@[a-z0-9][-a-z0-9._]*$/i,`Plugin ID must be in format: plugin@marketplace`)),qc=/^[a-z0-9][-a-z0-9._]*(@[a-z0-9][-a-z0-9._]*)?(@\^[^@]*)?$/i,Jc=T(()=>b([w().regex(qc,`Dependency must be a plugin name, optionally qualified with @marketplace`).transform(e=>e.replace(/@\^[^@]*$/,``)),v({name:w().min(1).regex(/^[a-z0-9][-a-z0-9._]*$/i),marketplace:w().min(1).regex(/^[a-z0-9][-a-z0-9._]*$/i).optional()}).loose().transform(e=>e.marketplace?`${e.name}@${e.marketplace}`:e.name)])),T(()=>b([Kc(),v({id:Kc().describe(`Plugin identifier (e.g., "formatter@tools")`),version:w().optional().describe(`Version constraint (e.g., "^2.0.0")`),required:_().optional().describe(`If true, cannot be disabled`),config:C(w(),oe()).optional().describe(`Plugin-specific configuration`)})])),Yc=T(()=>v({version:w().describe(`Currently installed version`),installedAt:w().describe(`ISO 8601 timestamp of installation`),lastUpdated:w().optional().describe(`ISO 8601 timestamp of last update`),installPath:w().describe(`Absolute path to the installed plugin directory`),gitCommitSha:w().optional().describe(`Git commit SHA for git-based plugins (for version tracking)`)})),Xc=T(()=>v({version:x(1).describe(`Schema version 1`),plugins:C(Kc(),Yc()).describe(`Map of plugin IDs to their installation metadata`)})),Zc=T(()=>g([`managed`,`user`,`project`,`local`])),Qc=T(()=>v({scope:Zc().describe(`Installation scope`),projectPath:w().optional().describe(`Project path (required for project/local scopes)`),installPath:w().describe(`Absolute path to the versioned plugin directory`),version:w().optional().describe(`Currently installed version`),installedAt:w().optional().describe(`ISO 8601 timestamp of installation`),lastUpdated:w().optional().describe(`ISO 8601 timestamp of last update`),gitCommitSha:w().optional().describe(`Git commit SHA for git-based plugins`)})),$c=T(()=>v({version:x(2).describe(`Schema version 2`),plugins:C(Kc(),y(Qc())).describe(`Map of plugin IDs to arrays of installation entries`)})),T(()=>b([Xc(),$c()])),el=T(()=>v({source:Bc().describe(`Where to fetch the marketplace from`),installLocation:w().describe(`Local cache path where marketplace manifest is stored`),lastUpdated:w().describe(`ISO 8601 timestamp of last marketplace refresh`),autoUpdate:_().optional().describe(`Whether to automatically update this marketplace and its installed plugins on startup`)})),tl=T(()=>C(w(),el()))}));function rl(e){let t=e.replace(/[^a-zA-Z0-9_-]/g,`_`);return e.startsWith(il)&&(t=t.replace(/_+/g,`_`).replace(/^_|_$/g,``)),t}var il,al=e((()=>{il=`claude.ai `}));function ol(e){let[t,n,...r]=e.split(`__`);return t!==`mcp`||!n?null:{serverName:n,toolName:r.length>0?r.join(`__`):void 0}}function sl(e){return`mcp__${rl(e)}__`}function cl(e,t){return`${sl(e)}${rl(t)}`}function ll(e){return e.mcpInfo?cl(e.mcpInfo.serverName,e.mcpInfo.toolName):e.name}function ul(e,t){let n=`mcp__${rl(t)}__`;return e.replace(n,``)}function dl(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 fl=e((()=>{al()})),pl,ml,hl,gl,_l=e((()=>{pl=`Agent`,ml=`Task`,hl=`verification`,gl=new Set([`Explore`,`Plan`])})),vl,yl=e((()=>{vl=`TaskOutput`})),bl,xl,Sl=e((()=>{bl=`TaskStop`,xl=`
18
- - Stops a running background task by its ID
19
- - Takes a task_id parameter identifying the task to stop
20
- - Returns a success or failure status
21
- - Use this tool when you need to terminate a long-running task
22
- `}));function Cl(e){return jl[e]??e}function wl(e){let t=[];for(let[n,r]of Object.entries(jl))r===e&&t.push(n);return t}function Tl(e){return e.replace(/\\/g,`\\\\`).replace(/\(/g,`\\(`).replace(/\)/g,`\\)`)}function El(e){return e.replace(/\\\(/g,`(`).replace(/\\\)/g,`)`).replace(/\\\\/g,`\\`)}function Dl(e){let t=kl(e,`(`);if(t===-1)return{toolName:Cl(e)};let n=Al(e,`)`);if(n===-1||n<=t||n!==e.length-1)return{toolName:Cl(e)};let r=e.substring(0,t),i=e.substring(t+1,n);if(!r)return{toolName:Cl(e)};if(i===``||i===`*`)return{toolName:Cl(r)};let a=El(i);return{toolName:Cl(r),ruleContent:a}}function Ol(e){if(!e.ruleContent)return e.toolName;let t=Tl(e.ruleContent);return`${e.toolName}(${t})`}function kl(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 Al(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 jl,Ml=e((()=>{_l(),yl(),Sl(),jl={Task:pl,KillShell:bl,AgentOutputTool:vl,BashOutputTool:vl}}));function Nl(e){return Il.filePatternTools.includes(e)}function Pl(e){return Il.bashPrefixTools.includes(e)}function Fl(e){return Il.customValidation[e]}var Il,Ll=e((()=>{Il={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 Rl(e,t){let n=0,r=t-1;for(;r>=0&&e[r]===`\\`;)n++,r--;return n%2!=0}function zl(e,t){let n=0;for(let r=0;r<e.length;r++)e[r]===t&&!Rl(e,r)&&n++;return n}function Bl(e){for(let t=0;t<e.length-1;t++)if(e[t]===`(`&&e[t+1]===`)`&&!Rl(e,t))return!0;return!1}function Vl(e,t){if(!e||e.trim()===``)return{valid:!1,error:`Permission rule cannot be empty`};if(zl(e,`(`)!==zl(e,`)`))return{valid:!1,error:`Mismatched parentheses`,suggestion:`Ensure all opening parentheses have matching closing parentheses`};if(Bl(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=Dl(e),r=ol(n.toolName);if(r)return n.ruleContent!==void 0||zl(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 "${Pt(String(n.toolName))}"`};let i=Fl(n.toolName);if(i&&n.ruleContent!==void 0){let e=i(n.ruleContent);if(!e.valid)return e}if(Pl(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(Nl(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`]}}return{valid:!0}}var Hl,Ul=e((()=>{E(),fl(),be(),Ml(),Ft(),Ll(),Hl=T(()=>w().superRefine((e,t)=>{let n=Vl(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:fe.custom,message:r,params:{received:e}})}}))}));function Wl(e){return`serverName`in e&&e.serverName!==void 0}function Gl(e){return`serverCommand`in e&&e.serverCommand!==void 0}function Kl(e){return`serverUrl`in e&&e.serverUrl!==void 0}var ql,Jl,Yl,Xl,Zl,Ql,Y,$l=e((()=>{E(),$o(),ne(),be(),Ws(),nl(),Vo(),Ul(),ac(),qa(),ql=T(()=>C(w(),ce())),Jl=T(()=>v({allow:y(Hl()).optional().describe(`List of permission rules for allowed operations`),deny:y(Hl()).optional().describe(`List of permission rules for denied operations`),ask:y(Hl()).optional().describe(`List of permission rules that should always prompt for confirmation`),defaultMode:g(js).optional().describe(`Default permission mode when Work Mate needs access`),disableBypassPermissionsMode:g([`disable`]).optional().describe(`Disable the ability to bypass permission prompts`),disableAutoMode:g([`disable`]).optional().describe(`Disable auto mode`),additionalDirectories:y(w()).optional().describe(`Additional directories to include in the permission scope`)}).passthrough()),Yl=T(()=>v({source:Bc().describe(`Where to fetch the marketplace from`),installLocation:w().optional().describe(`Local cache path where marketplace manifest is stored (auto-generated if not provided)`),autoUpdate:_().optional().describe(`Whether to automatically update this marketplace and its installed plugins on startup`)})),Xl=T(()=>v({serverName:w().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:y(w()).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:w().optional().describe(`URL pattern with wildcard support (e.g., "https://*.example.com/*") for allowed remote MCP servers`)}).refine(e=>Ga([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"`})),Zl=T(()=>v({serverName:w().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:y(w()).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:w().optional().describe(`URL pattern with wildcard support (e.g., "https://*.example.com/*") for blocked remote MCP servers`)}).refine(e=>Ga([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"`})),Ql=[`skills`,`agents`,`hooks`,`mcp`],Y=T(()=>v({$schema:x(Bo).optional().describe(`JSON Schema reference for Work Mate settings`),apiKeyHelper:w().optional().describe(`Path to a script that outputs authentication values`),awsCredentialExport:w().optional().describe(`Path to a script that exports AWS credentials`),awsAuthRefresh:w().optional().describe(`Path to a script that refreshes AWS authentication`),gcpAuthRefresh:w().optional().describe(`Command to refresh GCP authentication (e.g., gcloud auth application-default login)`),...m(process.env.CLAUDE_CODE_ENABLE_XAA)?{xaaIdp:v({issuer:w().url().describe(`IdP issuer URL for OIDC discovery`),clientId:w().describe(`Work Mate's client_id registered at the IdP`),callbackPort:S().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:v({type:x(`command`),command:w()}).optional().describe(`Custom file suggestion configuration for @ mentions`),respectGitignore:_().optional().describe(`Whether file picker should respect .gitignore files (default: true). Note: .ignore files are always respected.`),cleanupPeriodDays:S().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:ql().optional().describe(`Environment variables to set for Work Mate sessions`),attribution:v({commit:w().optional().describe(`Attribution text for git commits, including any trailers. Empty string hides attribution.`),pr:w().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:_().optional().describe(`Deprecated: Use attribution instead. Whether to include Work Mate's co-authored by attribution in commits and PRs (defaults to true)`),includeGitInstructions:_().optional().describe(`Include built-in commit and PR workflow instructions in Work Mate's system prompt (default: true)`),permissions:Jl().optional().describe(`Tool usage permissions configuration`),modelType:g([`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.`),activeProviderId:w().optional().describe(`Currently active API provider id (set by /provider use <id>). Authoritative source for the active-provider marker in /provider list.`),model:w().optional().describe(`Override the default model used by Work Mate`),availableModels:y(w()).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:C(w(),w()).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:_().optional().describe(`Whether to automatically approve all MCP servers in the project`),enabledMcpjsonServers:y(w()).optional().describe(`List of approved MCP servers from .mcp.json`),disabledMcpjsonServers:y(w()).optional().describe(`List of rejected MCP servers from .mcp.json`),allowedMcpServers:y(Xl()).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:y(Zl()).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:ic().optional().describe(`Custom commands to run before/after tool executions`),worktree:v({symlinkDirectories:y(w()).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:y(w()).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:_().optional().describe(`Disable all hooks and statusLine execution`),defaultShell:g([`bash`,`powershell`]).optional().describe(`Default shell for input-box ! commands. Defaults to 'bash' on all platforms (no Windows auto-flip).`),allowManagedHooksOnly:_().optional().describe(`When true (and set in managed settings), only hooks from managed settings run. User, project, and local hooks are ignored.`),allowedHttpHookUrls:y(w()).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:y(w()).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:_().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:_().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:le(e=>Array.isArray(e)?e.filter(e=>Ql.includes(e)):e,b([_(),y(g(Ql))])).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: ~/.workmate/{surface}/, .workmate/{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:v({type:x(`command`),command:w(),padding:S().optional(),refreshInterval:S().optional()}).optional().describe(`Custom status line display configuration`),statusLineEnabled:_().optional().describe(`Whether to render the fork built-in status line (model + ctx + 5h/7d limits + cost + cache pill). Toggled with /statusline.`),enabledPlugins:C(w(),b([y(w()),_(),de()])).optional().describe(`Enabled plugins using plugin-id@marketplace-id format. Example: { "formatter@anthropic-tools": true }. Also supports extended format with version constraints.`),extraKnownMarketplaces:C(w(),Yl()).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 .workmate/settings.json to ensure team members have required plugin sources.`),strictKnownMarketplaces:y(Bc()).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:y(Bc()).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:g([`claudeai`,`console`]).optional().describe(`Force a specific login method: "claudeai" for Claude Pro/Max, "console" for Console billing`),forceLoginOrgUUID:w().optional().describe(`Organization UUID to use for OAuth login`),otelHeadersHelper:w().optional().describe(`Path to a script that outputs OpenTelemetry headers`),outputStyle:w().optional().describe(`Controls the output style for assistant responses`),language:w().optional().describe(`Preferred language for Work Mate responses (e.g., "japanese", "spanish")`),skipWebFetchPreflight:_().optional().describe(`Skip the WebFetch blocklist check for enterprise environments with restrictive security policies`),webSearchAdapter:g([`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:g([`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:w().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:w().optional().describe(`Brave Search API key. Required when using the brave web search adapter.`),webFetchHttpTimeoutMs:S().int().positive().optional().describe(`HTTP timeout in milliseconds for the HTTP direct web fetch backend. Defaults to 60000 (60s).`),exaApiKey:w().optional().describe(`Exa AI API key. Required when using the exa web search adapter.`),exaEndpointUrl:w().optional().describe(`Custom Exa AI MCP endpoint URL. Defaults to https://mcp.exa.ai/mcp.`),sandbox:Qo().optional(),feedbackSurveyRate:S().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:_().optional().describe(`Whether to show tips in the spinner`),spinnerVerbs:v({mode:g([`append`,`replace`]),verbs:y(w())}).optional().describe(`Customize spinner verbs. mode: "append" adds verbs to defaults, "replace" uses only your verbs.`),spinnerTipsOverride:v({excludeDefault:_().optional(),tips:y(w())}).optional().describe(`Override spinner tips. tips: array of tip strings. excludeDefault: if true, only show custom tips (default: false).`),syntaxHighlightingDisabled:_().optional().describe(`Whether to disable syntax highlighting in diffs`),terminalTitleFromRename:_().optional().describe(`Whether /rename updates the terminal tab title (defaults to true). Set to false to keep auto-generated topic titles.`),alwaysThinkingEnabled:_().optional().describe(`When false, thinking is disabled. When absent or true, thinking is enabled automatically for supported models.`),advisorModel:w().optional().describe(`Advisor model for the server-side advisor tool.`),fastMode:_().optional().describe(`When true, fast mode is enabled. When absent or false, fast mode is off.`),fastModePerSessionOptIn:_().optional().describe(`When true, fast mode does not persist across sessions. Each session starts with fast mode off.`),promptSuggestionEnabled:_().optional().describe(`When false, prompt suggestions are disabled. When absent or true, prompt suggestions are enabled.`),poorMode:_().optional().describe(`When true, poor mode is active — extract_memories and prompt_suggestion are disabled to save tokens.`),showClearContextOnPlanAccept:_().optional().describe(`When true, the plan-approval dialog offers a "clear context" option. Defaults to false.`),agent:w().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:y(w()).optional().describe(`Company announcements to display at startup (one will be randomly selected if multiple are provided)`),pluginConfigs:C(w(),v({mcpServers:C(w(),C(w(),b([w(),S(),_(),y(w())]))).optional().describe(`User configuration values for MCP servers keyed by server name`),options:C(w(),b([w(),S(),_(),y(w())])).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)`),autoUpdatesChannel:g([`latest`,`stable`]).optional().describe(`Release channel for auto-updates (latest or stable)`),disableDeepLinkRegistration:g([`disable`]).optional().describe(`Prevent claude-cli:// protocol handler registration with the OS`),minimumVersion:w().optional().describe(`Minimum version to stay on - prevents downgrades when switching to stable channel`),plansDirectory:w().optional().describe(`Custom directory for plan files, relative to project root. If not set, defaults to ~/.workmate/plans/`),minSleepDurationMs:S().nonnegative().int().optional().describe(`Minimum duration in milliseconds that the Sleep tool must sleep for. Useful for throttling proactive tick frequency.`),maxSleepDurationMs:S().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.`),channelsEnabled:_().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:y(v({marketplace:w(),plugin:w()})).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.`),prefersReducedMotion:_().optional().describe(`Reduce or disable animations for accessibility (spinner shimmer, flash effects, etc.)`),autoMemoryEnabled:_().optional().describe(`Enable auto-memory for this project. When false, Work Mate will not read from or write to the auto-memory directory.`),autoMemoryDirectory:w().optional().describe(`Custom directory path for auto-memory storage. Supports ~/ prefix for home directory expansion. Ignored if set in projectSettings (checked-in .workmate/settings.json) for security. When unset, defaults to ~/.workmate/projects/<sanitized-cwd>/memory/.`),autoDreamEnabled:_().optional().describe(`Enable background memory consolidation (auto-dream). When set, overrides the server-side default.`),showThinkingSummaries:_().optional().describe(`Show thinking summaries in the transcript view (ctrl+o). Default: false.`),skipDangerousModePermissionPrompt:_().optional().describe(`Whether the user has accepted the bypass permissions mode dialog`),skipAutoPermissionPrompt:_().optional().describe(`Whether the user has accepted the auto mode opt-in dialog`),useAutoModeDuringPlan:_().optional().describe(`Whether plan mode uses auto mode semantics when auto mode is available (default: true)`),autoMode:v({allow:y(w()).optional().describe(`Rules for the auto mode classifier allow section`),soft_deny:y(w()).optional().describe(`Rules for the auto mode classifier deny section`),environment:y(w()).optional().describe(`Entries for the auto mode classifier environment section`)}).optional().describe(`Auto mode classifier prompt customization`),disableAutoMode:g([`disable`]).optional().describe(`Disable auto mode`),agentsMdExcludes:y(w()).optional().describe(`Glob patterns or absolute paths of AGENTS.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/AGENTS.md", "**/code/AGENTS.md", "**/some-dir/.workmate/rules/**"`),cacheThreshold:S().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:_().optional().describe(`Whether to show cache hit rate warnings in the message flow when the rate falls below cacheThreshold. Default: true.`),pluginTrustMessage:w().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:w().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 eu(){return ft(Ce(Y(),{unrepresentable:`any`}),null,2)}var tu=e((()=>{E(),xt(),$l()}));function nu(e){let t=ru.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=iu[t])}return n}var X,ru,iu,au=e((()=>{X=`https://code.workmate.com/docs/en`,ru=[{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:`${X}/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:`${X}/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:`${X}/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:`${X}/iam#working-directories`}}],iu={permissions:`${X}/iam#configuring-permissions`,env:`${X}/settings#environment-variables`,hooks:`${X}/hooks`}}));function ou(e){return e.code===`invalid_type`}function su(e){return e.code===`invalid_value`}function cu(e){return e.code===`unrecognized_keys`}function lu(e){return e.code===`too_small`}function uu(e){return e===null?`null`:e===void 0?`undefined`:Array.isArray(e)?`array`:typeof e}function du(e){let t=e.match(/received (\w+)/);return t?t[1]:void 0}function fu(e,t){return e.issues.map(e=>{let n=e.path.map(String).join(`.`),r=e.message,i,a,o,s,c;if(su(e))a=e.values.map(e=>String(e)),o=a.join(` | `),s=void 0,c=void 0;else if(ou(e)){o=e.expected;let t=du(e.message);s=t??uu(e.input),c=t??uu(e.input)}else lu(e)?o=String(e.minimum):e.code===`custom`&&`params`in e&&(s=e.params.received,c=s);let l=nu({path:n,code:e.code,expected:o,received:s,enumValues:a,message:e.message,value:s});if(su(e))i=a?.map(e=>`"${e}"`).join(`, `),r=`Invalid value. Expected one of: ${i}`;else if(ou(e)){let t=du(e.message)??uu(e.input);r=e.expected===`object`&&t===`null`&&n===``?`Invalid or malformed JSON`:`Expected ${e.expected}, but received ${t}`}else if(cu(e)){let t=e.keys.join(`, `);r=`Unrecognized ${Mt(e.keys.length,`field`)}: ${t}`}else lu(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 pu(e){try{let t=ht(e),n=Y().strict().safeParse(t);return n.success?{isValid:!0}:{isValid:!1,error:`Settings validation failed:
23
- `+fu(n.error,`settings`).map(e=>`- ${e.path}: ${e.message}`).join(`
24
- `),fullSchema:eu()}}catch(e){return{isValid:!1,error:`Invalid JSON: ${e instanceof Error?e.message:`Unknown parsing error`}`,fullSchema:eu()}}}function mu(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=Vl(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 hu=e((()=>{xt(),Ft(),Ul(),tu(),$l(),au()}));function gu(){let e=``;try{e=Kt().username}catch{}let t=[];return e&&t.push({path:`/Library/Managed Preferences/${e}/${_u}.plist`,label:`per-user managed preferences`}),t.push({path:`/Library/Managed Preferences/${_u}.plist`,label:`device-level managed preferences`}),t}var _u,vu,yu,bu,xu,Su,Cu,wu=e((()=>{_u=`com.anthropic.claudecode`,vu=`HKLM\\SOFTWARE\\Policies\\ClaudeCode`,yu=`HKCU\\SOFTWARE\\Policies\\ClaudeCode`,bu=`Settings`,xu=`/usr/bin/plutil`,Su=[`-convert`,`json`,`-o`,`-`,`--`],Cu=5e3}));function Tu(e,t){return new Promise(n=>{_n(e,t,{encoding:`utf-8`,timeout:Cu},(e,t)=>{n({stdout:t??``,code:+!!e})})})}function Eu(){return(async()=>{if(process.platform===`darwin`){let e=gu(),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 Tu(xu,[...Su,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([Tu(`reg`,[`query`,vu,`/v`,bu]),Tu(`reg`,[`query`,yu,`/v`,bu])]);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 Du(){ku||(ku=Eu())}function Ou(){return ku}var ku,Au=e((()=>{wu(),ku=null}));function ju(){Uu||(Uu=(async()=>{Wt(`mdm_load_start`);let e=Date.now(),{mdm:t,hkcu:n}=zu(await(Ou()??Eu()));Vu=t,Hu=n,Wt(`mdm_load_end`);let r=Date.now()-e;if(O(`MDM settings load completed in ${r}ms`),Object.keys(t.settings).length>0){O(`MDM settings found: ${Object.keys(t.settings).join(`, `)}`);try{z(`info`,`mdm_settings_loaded`,{duration_ms:r,key_count:Object.keys(t.settings).length,error_count:t.errors.length})}catch{}}})())}async function Mu(){Uu||ju(),await Uu}function Nu(){return Vu??Z}function Pu(){return Hu??Z}function Fu(e,t){Vu=e,Hu=t}async function Iu(){return zu(await Eu())}function Lu(e,t){let n=_e(e,!1);if(!n||typeof n!=`object`)return{settings:{},errors:[]};let r=mu(n,t),i=Y().safeParse(n);if(!i.success){let e=fu(i.error,t);return{settings:{},errors:[...r,...e]}}return{settings:i.data,errors:r}}function Ru(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?.[1])return t[1].trimEnd()}return null}function zu(e){if(e.plistStdouts&&e.plistStdouts.length>0){let{stdout:t,label:n}=e.plistStdouts[0],r=Lu(t,n);if(Object.keys(r.settings).length>0)return{mdm:r,hkcu:Z}}if(e.hklmStdout){let t=Ru(e.hklmStdout);if(t){let e=Lu(t,`Registry: ${vu}\\${bu}`);if(Object.keys(e.settings).length>0)return{mdm:e,hkcu:Z}}}if(Bu())return{mdm:Z,hkcu:Z};if(e.hkcuStdout){let t=Ru(e.hkcuStdout);if(t){let e=Lu(t,`Registry: ${yu}\\${bu}`);return{mdm:Z,hkcu:e}}}return{mdm:Z,hkcu:Z}}function Bu(){try{let e=_e(Za(P(qo(),`managed-settings.json`)),!1);if(e&&typeof e==`object`&&Object.keys(e).length>0)return!0}catch{}try{let e=Jo(),t=A().readdirSync(e);for(let n of t)if(!(!(n.isFile()||n.isSymbolicLink())||!n.name.endsWith(`.json`)||n.name.startsWith(`.`)))try{let t=_e(Za(P(e,n.name)),!1);if(t&&typeof t==`object`&&Object.keys(t).length>0)return!0}catch{}}catch{}return!1}var Z,Vu,Hu,Uu,Wu=e((()=>{yt(),tr(),Qa(),k(),ye(),Ut(),Yo(),$l(),hu(),wu(),Au(),Z=Object.freeze({settings:{},errors:[]}),Vu=null,Hu=null,Uu=null}));function Gu(){return P(qo(),`managed-settings.json`)}function Ku(){let e=[],t={},n=!1,{settings:r,errors:i}=Yu(Gu());e.push(...i),r&&Object.keys(r).length>0&&(t=G(t,r,$),n=!0);let a=Jo();try{let r=A().readdirSync(a).filter(e=>(e.isFile()||e.isSymbolicLink())&&e.name.endsWith(`.json`)&&!e.name.startsWith(`.`)).map(e=>e.name).sort();for(let i of r){let{settings:r,errors:o}=Yu(P(a,i));e.push(...o),r&&Object.keys(r).length>0&&(t=G(t,r,$),n=!0)}}catch(e){let t=mt(e);t!==`ENOENT`&&t!==`ENOTDIR`&&j(e)}return{settings:n?t:null,errors:e}}function qu(){let{settings:e}=Yu(Gu()),t=!!e&&Object.keys(e).length>0,n=!1,r=Jo();try{n=A().readdirSync(r).some(e=>(e.isFile()||e.isSymbolicLink())&&e.name.endsWith(`.json`)&&!e.name.startsWith(`.`))}catch{}return{hasBase:t,hasDropIns:n}}function Ju(e,t){typeof e==`object`&&e&&`code`in e&&e.code===`ENOENT`?O(`Broken symlink or missing file encountered for settings.json at path: ${t}`):j(e)}function Yu(e){let t=rt(e);if(t)return{settings:t.settings?gt(t.settings):null,errors:t.errors};let n=Xu(e);return nt(e,n),{settings:n.settings?gt(n.settings):null,errors:n.errors}}function Xu(e){try{let{resolvedPath:t}=vt(A(),e),n=Za(t);if(n.trim()===``)return{settings:{},errors:[]};let r=_e(n,!1),i=mu(r,e),a=Y().safeParse(r);if(!a.success){let t=fu(a.error,e);return{settings:null,errors:[...i,...t]}}return{settings:a.data,errors:i}}catch(t){return Ju(t,e),{settings:null,errors:[]}}}function Zu(e){switch(e){case`userSettings`:return F(p());case`policySettings`:case`projectSettings`:case`localSettings`:return F(Be());case`flagSettings`:{let e=Ye();return e?N(F(e)):F(Be())}}}function Qu(){return je()||m(process.env.CLAUDE_CODE_USE_COWORK_PLUGINS)?`cowork_settings.json`:`settings.json`}function $u(e){switch(e){case`userSettings`:return P(Zu(e),Qu());case`projectSettings`:case`localSettings`:return P(Zu(e),ed(e));case`policySettings`:return Gu();case`flagSettings`:return Ye()}}function ed(e){switch(e){case`projectSettings`:return P(`.workmate`,`settings.json`);case`localSettings`:return P(`.workmate`,`settings.local.json`)}}function Q(e){let t=Qe(e);if(t!==void 0)return t;let n=td(e);return We(e,n),n}function td(e){if(e===`policySettings`){let e=Nu();if(Object.keys(e.settings).length>0)return e.settings;let{settings:t}=Ku();if(t)return t;let n=Pu();return Object.keys(n.settings).length>0?n.settings:null}let t=$u(e),{settings:n}=t?Yu(t):{settings:null};if(e===`flagSettings`){let e=Te();if(e){let t=Y().safeParse(e);if(t.success)return G(n||{},t.data,$)}}return n}function nd(){let e=Nu();if(Object.keys(e.settings).length>0)return M()===`macos`?`plist`:`hklm`;let{settings:t}=Ku();if(t)return`file`;let n=Pu();return Object.keys(n.settings).length>0?`hkcu`:null}function rd(e,t){if(e===`policySettings`||e===`flagSettings`)return{error:null};let n=$u(e);if(!n)return{error:null};try{A().mkdirSync(N(n));let r=td(e);if(!r){let e=null;try{e=Za(n)}catch(e){if(!St(e))throw e}if(e!==null){let t=_e(e);if(t===null)return{error:Error(`Invalid JSON syntax in settings file at ${n}`)};t&&typeof t==`object`&&(r=t,O(`Using raw settings from ${n} due to validation failure`))}}let i=G(r||{},t,(e,t,n,r)=>{if(t===void 0&&r&&typeof n==`string`){delete r[n];return}if(Array.isArray(t))return t});Ho(n),bo(n,`${ft(i,null,2)}\n`),$e(),e===`localSettings`&&ko(ed(`localSettings`),Be())}catch(e){let t=Error(`Failed to read raw settings from ${n}: ${e}`);return j(t),{error:t}}return{error:null}}function id(e,t){return Ka([...e,...t])}function $(e,t){if(Array.isArray(e)&&Array.isArray(t))return id(e,t)}function ad(e){let t=Y().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 od(){if(md)return{settings:{},errors:[]};let e=Date.now();Wt(`loadSettingsFromDisk_start`),z(`info`,`settings_load_started`),md=!0;try{let t=tt(),n={};t&&(n=G(n,t,$));let r=[],i=new Set,a=new Set;for(let e of Io()){if(e===`policySettings`){let e=null,t=[];{let n=Nu();Object.keys(n.settings).length>0&&(e=n.settings),t.push(...n.errors)}if(!e){let{settings:n,errors:r}=Ku();n&&(e=n),t.push(...r)}if(!e){let n=Pu();Object.keys(n.settings).length>0&&(e=n.settings),t.push(...n.errors)}e&&(n=G(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=$u(e);if(t){let e=F(t);if(!a.has(e)){a.add(e);let{settings:o,errors:s}=Yu(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=G(n,o,$))}}if(e===`flagSettings`){let e=Te();if(e){let t=Y().safeParse(e);t.success&&(n=G(n,t.data,$))}}}return z(`info`,`settings_load_completed`,{duration_ms:Date.now()-e,source_count:a.size,error_count:r.length}),{settings:n,errors:r}}finally{md=!1}}function sd(){let{settings:e}=ld();return e||{}}function cd(){$e();let e=[];for(let t of Io()){let n=Q(t);n&&Object.keys(n).length>0&&e.push({source:t,settings:n})}return{effective:sd(),sources:e}}function ld(){let e=Je();if(e!==null)return e;let t=od();return Wt(`loadSettingsFromDisk_end`),at(t),t}function ud(){return!!(Q(`userSettings`)?.skipDangerousModePermissionPrompt||Q(`localSettings`)?.skipDangerousModePermissionPrompt||Q(`flagSettings`)?.skipDangerousModePermissionPrompt||Q(`policySettings`)?.skipDangerousModePermissionPrompt)}function dd(){return!0}function fd(){return Q(`policySettings`)?.useAutoModeDuringPlan!==!1&&Q(`flagSettings`)?.useAutoModeDuringPlan!==!1&&Q(`userSettings`)?.useAutoModeDuringPlan!==!1&&Q(`localSettings`)?.useAutoModeDuringPlan!==!1}function pd(e){for(let t of Io()){if(t===`policySettings`)continue;let n=$u(t);if(n)try{let{resolvedPath:t}=vt(A(),n),r=Za(t);if(!r.trim())continue;let i=_e(r,!1);if(i&&typeof i==`object`&&e in i)return!0}catch(e){Ju(e,n)}}return!1}var md,hd,gd=e((()=>{Ua(),lt(),qa(),yt(),tr(),ne(),pt(),Eo(),Qa(),k(),Ao(),ye(),Et(),Bt(),xt(),Ut(),Vo(),Ko(),Yo(),Wu(),Ue(),$l(),hu(),md=!1,hd=sd}));export{dl as $,Ta as $n,lr as $r,as as $t,pu as A,Eo as An,ai as Ar,Vs as At,Dl as B,mo as Bn,Fr as Br,Ms as Bt,Nu as C,xn as Ci,lo as Cn,Ci as Cr,ac as Ct,Au as D,fo as Dn,li as Dr,Ks as Dt,Fu as E,po as En,si as Er,Xs as Et,Wl as F,no as Fn,Kr as Fr,zs as Ft,vl as G,Za as Gn,ur as Gr,_s as Gt,xl as H,oo as Hn,Ur as Hr,Os as Ht,Kl as I,Co as In,qr as Ir,Bs as It,ml as J,qa as Jn,Tr as Jr,cs as Jt,yl as K,Xa as Kn,V as Kr,vs as Kt,wl as L,ro as Ln,Nr as Lr,Ls as Lt,Y as M,vo as Mn,ii as Mr,Rs as Mt,$l as N,xo as Nn,Hr as Nr,Ns as Nt,Du as O,io as On,ti as Or,qs as Ot,Gl as P,So as Pn,Br as Pr,Is as Pt,cl as Q,Fa as Qn,mr as Qr,us as Qt,Ml as R,yo as Rn,Wr as Rr,Fs as Rt,Pu as S,bn as Si,go as Sn,Mi as Sr,ic as St,Iu as T,co as Tn,ui as Tr,$s as Tt,bl as U,Ja as Un,Xr as Ur,ws as Ut,Ol as V,bo as Vn,Yr as Vr,Ds as Vt,Sl as W,Qa as Wn,Lr as Wr,K as Wt,hl as X,Ka as Xn,wr as Xr,ss as Xt,gl as Y,Wa as Yn,Ar as Yr,ns as Yt,_l as Z,Ia as Zn,B as Zr,rs as Zt,Yu as _,Mn as _i,Fo as _n,Si as _r,nl as _t,ed as a,Qn as ai,Wo as an,Ji as ar,al as at,rd as b,Sn as bi,To as bn,hi as br,oc as bt,Zu as c,Wn as ci,Ro as cn,Xi as cr,Xc as ct,hd as d,Un as di,Po as dn,W as dr,Fc as dt,nr as ei,ts as en,Ca as er,ul as et,fd as f,Bn as fi,No as fn,Li as fr,Sc as ft,Ku as g,Nn as gi,Lo as gn,pi as gr,Gc as gt,gd as h,zn as hi,Vo as hn,fi as hr,Wc as ht,nd as i,Zn as ii,Yo as in,na as ir,ol as it,Ql as j,ho as jn,Zr as jr,Ws as jt,hu as k,ao as kn,oi as kr,Hs as kt,ld as l,Gn as li,zo as ln,Yi as lr,$c as lt,ud as m,Pn as mi,Mo as mn,mi as mr,zc as mt,qu as n,z as ni,qo as nn,aa as nr,ll as nt,$u as o,Kn as oi,Uo as on,Gi as or,rl as ot,dd as p,Vn as pi,jo as pn,xi as pr,Kc as pt,pl as q,Ga as qn,Cr as qr,Es as qt,ad as r,er as ri,Jo as rn,ta as rr,fl as rt,Q as s,qn as si,Ko as sn,qi as sr,dc as st,sd as t,tr as ti,fs as tn,fa as tr,sl as tt,cd as u,Hn as ui,Io as un,Ki as ur,tl as ut,pd as v,Tn as vi,Ao as vn,yi as vr,uc as vt,Wu as w,so as wn,vi as wr,Qs as wt,Mu as x,wn as xi,wo as xn,gi as xr,cc as xt,$ as y,En as yi,Do as yn,Wi as yr,lc as yt,Cl as z,_o as zn,Jr as zr,js as zt};
@@ -1,3 +0,0 @@
1
- import{n as e,t}from"./memoize-BK3gG5ob.js";import{l as n,o as r,s as i}from"./envUtils-DcaKZlRU.js";import{ft as a,ut as o}from"./esm-BQY8jJNR.js";import{At as s,Bd as c,Bh as l,Bs as u,C_ as d,Db as f,Gh as p,HS as m,Hh as h,Hs as ee,Ih as g,Is as _,Jh as v,Kh as te,Lh as ne,Ls as re,Mn as ie,Nn as ae,Ob as oe,Pi as se,Rh as ce,Sa as y,St as le,Uh as ue,Vh as de,Wh as fe,Zg as pe,Zi as b,bx as x,cT as S,cf as C,cx as w,dm as T,fm as E,gt as D,gx as O,hn as k,ht as A,hx as j,ig as M,jn as N,ki as P,lf as F,lx as I,mn as L,nf as R,ng as z,oT as B,ot as me,qh as he,rf as ge,sf as _e,si as ve,tg as ye,v_ as be,vr as xe,vt as V,vx as Se,wh as Ce,yx as we,zd as Te,zh as Ee}from"./loadAgentsDir-C1LkW7gl.js";import{di as H,fi as De}from"./src-DL3w8VPk.js";import{L as U,Mn as Oe,Pn as ke,Yn as Ae,tt as je,ut as Me,zt as Ne}from"./state-BowF111d.js";import{n as Pe,t as W}from"./cwd-BcO6WHKo.js";import{L as G,N as Fe,P as Ie,f as Le,u as Re}from"./debug-8DCufdSp.js";import{Jn as ze,Nr as Be,Pr as Ve,Rr as He,Ur as Ue,Wt as We,ni as K,qn as Ge,qt as Ke,ti as qe}from"./settings-DKN4xSpQ.js";import{m as Je,o as Ye}from"./config-BddEvZZl.js";import{o as Xe,s as Ze}from"./log-DaILwWJa.js";import{n as q,r as J}from"./analytics-DJobLaWP.js";import{n as Qe,r as Y}from"./startupProfiler-DTs9w9EN.js";import{Mt as $e,St as et,br as tt,yr as nt}from"./model-BwBE0Pt5.js";import{pn as rt,un as X}from"./prompt-BGqgPgCU.js";import{a as it,r as at}from"./projectOnboardingState-CJycxw5P.js";import{c as ot,t as st}from"./nativeInstaller-DnSNJWIi.js";import{i as ct,n as lt}from"./appleTerminalBackup-BYKdf3of.js";import{l as ut,s as dt}from"./logoUtils-Dj_2SWmO.js";import{i as ft,r as pt}from"./runtimeObserver-CpP0L9T9.js";import{t as mt}from"./sinks-D1EjkHb4.js";import{writeFile as Z}from"fs/promises";r(),De(),Ne(),Pe(),qe(),Xe(),Ue(),Ke(),Je(),et(),S(),we(),j(),w(),E(),se(),xe(),k(),t(),me(),Ce(),rt(),oe(),ze(),u(),Le(),Te(),b(),ae(),nt(),pe(),z(),q(),R(),C(),de(),G();function ht(){return!1}function gt(){return{}}var Q;function _t(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+=Ge(e,e=>e.type===`tool_use`))}}return n}function vt(e){let t=M(e);if(!h()){if(!Ee(t))return!1;p()}let n=l(t),r=_t(e,Q)>=ce(),i=y(e);if(n&&r||n&&!i){let t=e[e.length-1];return t?.uuid&&(Q=t.uuid),!0}return!1}async function $(e){let t=Re(),n=N();await t.mkdir(n,{mode:448});let r=ie();try{await Z(r,``,{encoding:`utf-8`,mode:384,flag:`wx`}),await Z(r,await F(),{encoding:`utf-8`,mode:384})}catch(e){if(Ie(e)!==`EEXIST`)throw e}e.readFileState.delete(r);let i=await f.call({file_path:r},e),a=``,o=i.data;return o.type===`text`&&(a=o.file.content),J(`tengu_session_memory_file_read`,{content_length:a.length}),{memoryPath:r,currentMemory:a}}var yt=e(()=>{let e=gt();v({minimumMessageTokensToInit:e.minimumMessageTokensToInit&&e.minimumMessageTokensToInit>0?e.minimumMessageTokensToInit:g.minimumMessageTokensToInit,minimumTokensBetweenUpdate:e.minimumTokensBetweenUpdate&&e.minimumTokensBetweenUpdate>0?e.minimumTokensBetweenUpdate:g.minimumTokensBetweenUpdate,toolCallsBetweenUpdates:e.toolCallsBetweenUpdates&&e.toolCallsBetweenUpdates>0?e.toolCallsBetweenUpdates:g.toolCallsBetweenUpdates})}),bt=tt(async e=>{let{messages:t,toolUseContext:n,querySource:r}=e;if(r!==`repl_main_thread`||!ht()||(yt(),!vt(t)))return;fe();let i=re(n),{memoryPath:a,currentMemory:o}=await $(i);await ee({promptMessages:[m({content:await _e(o,a)})],cacheSafeParams:_(e),canUseTool:St(a),querySource:`session_memory`,forkLabel:`session_memory`,overrides:{readFileState:i.readFileState}});let s=t[t.length-1],c=s?ye(s):void 0,l=ne();J(`tengu_session_memory_extraction`,{input_tokens:c?.input_tokens,output_tokens:c?.output_tokens,cache_read_input_tokens:c?.cache_read_input_tokens??void 0,cache_creation_input_tokens:c?.cache_creation_input_tokens??void 0,config_min_message_tokens_to_init:l.minimumMessageTokensToInit,config_min_tokens_between_update:l.minimumTokensBetweenUpdate,config_tool_calls_between_updates:l.toolCallsBetweenUpdates}),te(M(t)),Ct(t),ue()});function xt(){ge()&&c(bt)}function St(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 ${X} on ${e} is allowed`,decisionReason:{type:`other`,reason:`only ${X} on ${e} is allowed`}}}}function Ct(e){if(!y(e)){let t=e[e.length-1];t?.uuid&&he(t.uuid)}}q(),ft(),ct(),d(),a(),G(),ut(),st(),at(),Qe(),le();async function wt(e,t,r,a,c,l,u,d){K(`info`,`setup_started`);let f=process.version.match(/^v(\d+)\./)?.[1];if((!f||parseInt(f,10)<18)&&(console.error(H.bold.red(`Error: Work Mate requires Node.js version 18 or higher.`)),process.exit(1)),u&&Ae(T(u)),!U())try{let e=await lt();e.status===`restored`?console.log(H.yellow(`Detected an interrupted Terminal.app setup. Your original settings have been restored. You may need to restart Terminal.app for the changes to take effect.`)):e.status===`failed`&&console.error(H.red(`Failed to restore Terminal.app settings. Please manually restore your original settings with: defaults import com.apple.Terminal ${e.backupPath}.`))}catch(e){Ze(e)}I(e);let p=Date.now();if(Se(),K(`info`,`setup_hooks_captured`,{duration_ms:Date.now()-p}),O(e),a){let t=L(),n=await He();!t&&!n&&(process.stderr.write(H.red(`Error: Can only use --worktree in a git repository, but ${H.bold(e)} is not a git repository. Configure a WorktreeCreate hook in settings.json to use --worktree with other VCS systems.\n`)),process.exit(1));let r=d?`pr-${d}`:c??B(),i;if(n){let e=Be(W());e||(process.stderr.write(H.red(`Error: Could not determine the main git repository root.
2
- `)),process.exit(1)),e!==(Ve(W())??W())&&(K(`info`,`worktree_resolved_to_main_repo`),process.chdir(e),I(e)),i=l?V(e,s(r)):void 0}else i=l?V(W(),s(r)):void 0;let a;try{a=await D(Me(),r,i,d?{prNumber:d}:void 0)}catch(e){process.stderr.write(H.red(`Error creating worktree: ${Fe(e)}\n`)),process.exit(1)}if(J(`tengu_worktree_created`,{tmux_enabled:l}),l&&i){let e=await A(i,a.worktreePath);e.created?console.log(H.green(`Created tmux session: ${H.bold(i)}\nTo attach: ${H.bold(`tmux attach -t ${i}`)}`)):console.error(H.yellow(`Warning: Failed to create tmux session: ${e.error}`))}process.chdir(a.worktreePath),I(a.worktreePath),Oe(W()),ke(W()),ve(a),be(),x()}K(`info`,`setup_background_jobs_starting`),i()||(xt(),pt()),ot(),K(`info`,`setup_background_jobs_launched`),Y(`setup_before_prefetch`),K(`info`,`setup_prefetch_starting`);let m=U()&&n(process.env.CLAUDE_CODE_SYNC_PLUGIN_INSTALL)||i();if(m||P(je()),import(`./loadPluginHooks-DtmHtEiS.js`).then(e=>{m||(e.loadPluginHooks(),e.setupPluginHookHotReload())}),i()||import(`./sessionFileAccessHooks-D7KbWFp7.js`).then(e=>e.registerSessionFileAccessHooks()),mt(),J(`tengu_started`,{}),$e(U()),Y(`setup_after_prefetch`),!i()&&it()&&await dt(),t===`bypassPermissions`||r){if(process.platform!==`win32`&&typeof process.getuid==`function`&&process.getuid()===0&&process.env.IS_SANDBOX!==`1`&&!n(process.env.CLAUDE_CODE_BUBBLEWRAP))if(process.stdin.isTTY){console.error(H.bold.red(`WARNING: Running as root/sudo with bypass permissions mode is dangerous.`)),console.error(H.yellow(`Bypass mode skips ALL permission checks. Combined with root, any command (rm -rf /, chmod, dd) executes without review.`));let e=(await import(`readline`)).createInterface({input:process.stdin,output:process.stdout}),t=await new Promise(t=>{e.question(`
3
- I understand the risks. Continue? [y/N] `,t)});e.close(),t.trim().toLowerCase()!==`y`&&(console.error(`Aborted.`),process.exit(1))}else console.error(`--dangerously-skip-permissions cannot be used with root/sudo privileges for security reasons`),process.exit(1);if(process.env.CLAUDE_CODE_ENTRYPOINT!==`local-agent`&&process.env.CLAUDE_CODE_ENTRYPOINT!==`claude-desktop`){let[e,t]=await Promise.all([o.getIsDocker(),We.hasInternetAccess()]),n=o.getIsBubblewrapSandbox(),r=process.env.IS_SANDBOX===`1`;(!(e||n||r)||t)&&(console.error(`--dangerously-skip-permissions can only be used in Docker/sandbox containers with no internet access but got Docker: ${e}, Bubblewrap: ${n}, IS_SANDBOX: ${r}, hasInternet: ${t}`),process.exit(1))}}let h=Ye();h.lastCost!==void 0&&h.lastDuration!==void 0&&J(`tengu_exit`,{last_session_cost:h.lastCost,last_session_api_duration:h.lastAPIDuration,last_session_tool_duration:h.lastToolDuration,last_session_duration:h.lastDuration,last_session_lines_added:h.lastLinesAdded,last_session_lines_removed:h.lastLinesRemoved,last_session_total_input_tokens:h.lastTotalInputTokens,last_session_total_output_tokens:h.lastTotalOutputTokens,last_session_total_cache_creation_input_tokens:h.lastTotalCacheCreationInputTokens,last_session_total_cache_read_input_tokens:h.lastTotalCacheReadInputTokens,last_session_fps_average:h.lastFpsAverage,last_session_fps_low_1_pct:h.lastFpsLow1Pct,last_session_id:h.lastSessionId,...h.lastSessionMetrics})}export{wt as setup};
@@ -1 +0,0 @@
1
- import{t as e}from"./sinks-D1EjkHb4.js";export{e as initSinks};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./axios-DaWTGg7G.js";import{ut as n,zt as r}from"./state-BowF111d.js";import{C as i,c as a,et as o,f as s,i as c,it as l,rt as u,tt as d,u as f,x as p}from"./debug-8DCufdSp.js";import{_ as m,o as h,r as g,t as _,v}from"./log-DaILwWJa.js";import{i as y,n as b,t as x}from"./analytics-DJobLaWP.js";import{a as S,n as C,o as w}from"./firstPartyEventLogger-C0q45h_4.js";import{r as T,t as E}from"./datadog-v_mXWncN.js";import{dirname as D,join as O}from"path";t(),r(),l(),v(),o(),c(),s(),h(),p();var k=g(new Date);function A(){return O(m.errors(),`${k}.jsonl`)}function j(e){return O(m.mcpLogs(e),`${k}.jsonl`)}function M(e){let t=u(e);return{write(e){t.write(`${i(e)}\n`)},flush:t.flush,dispose:t.dispose}}var N=new Map;function P(e){let t=N.get(e);if(!t){let n=D(e);t=M({writeFn:t=>{try{f().appendFileSync(e,t)}catch{f().mkdirSync(n),f().appendFileSync(e,t)}},flushIntervalMs:1e3,maxBufferSize:50}),N.set(e,t),d(async()=>t?.dispose())}return t}function F(e,t){let r={timestamp:new Date().toISOString(),...t,cwd:f().cwd(),userType:process.env.USER_TYPE,sessionId:n(),version:`0.0.22`};P(e).write(r)}function I(e){if(typeof e==`string`)return e;if(e&&typeof e==`object`){let t=e;if(typeof t.message==`string`)return t.message;if(typeof t.error==`object`&&t.error&&`message`in t.error&&typeof t.error.message==`string`)return t.error.message}}function L(t){let n=t.stack||t.message,r=``;if(e.isAxiosError(t)&&t.config?.url){let e=[`url=${t.config.url}`];t.response?.status!==void 0&&e.push(`status=${t.response.status}`);let n=I(t.response?.data);n&&e.push(`body=${n}`),r=`[${e.join(`,`)}] `}a(`${t.name}: ${r}${n}`,{level:`error`}),F(A(),{error:`${r}${n}`})}function R(e,t){a(`MCP server "${e}" ${t}`,{level:`error`});let r=j(e),i={error:t instanceof Error?t.stack||t.message:String(t),timestamp:new Date().toISOString(),sessionId:n(),cwd:f().cwd()};P(r).write(i)}function z(e,t){a(`MCP server "${e}": ${t}`);let r=j(e),i={debug:t,timestamp:new Date().toISOString(),sessionId:n(),cwd:f().cwd()};P(r).write(i)}function B(){_({logError:L,logMCPError:R,logMCPDebug:z,getErrorsPath:A,getMCPLogsPath:j}),a(`Error log sink initialized`)}E(),C(),b();function V(){return!1}function H(e,t){let n=w(e);if(n===0)return;let r=n===null?t:{...t,sample_rate:n};V()&&T(e,y(r)),S(e,r)}function U(e,t){return H(e,t),Promise.resolve()}function W(){x({logEvent:H,logEventAsync:U})}function G(){B(),W()}export{G as t};
@@ -1 +0,0 @@
1
- import{$w as e,Af as t,Br as n,C_ as r,Cb as i,Ji as a,Ki as o,Ks as s,Nm as c,Nt as ee,Ot as l,Pi as te,Pm as ne,Qr as re,Rn as ie,Sb as u,St as ae,Ti as oe,Wi as se,Xs as ce,Yp as le,Zr as ue,cT as de,cx as fe,d_ as d,dm as f,eT as p,fm as m,fn as h,hn as pe,ii as me,jf as he,lx as g,ns as ge,qi as _e,qp as ve,rs as ye,sT as _,si as v,tp as y,u_ as b,v_ as x,vr as S,wi as C,yt as w}from"./loadAgentsDir-C1LkW7gl.js";import{$n as T,G as E,Mn as D,Qn as O,Tn as k,Yn as A,h as j,ut as M,wn as N,zt as P}from"./state-BowF111d.js";import{n as be,t as F}from"./cwd-BcO6WHKo.js";import{c as I,et as xe,f as Se,i as L,tt as Ce,u as we}from"./debug-8DCufdSp.js";import{n as R,r as Te}from"./analytics-DJobLaWP.js";import{f as Ee,v as De}from"./model-BwBE0Pt5.js";import{Gt as Oe}from"./prompt-BGqgPgCU.js";import*as z from"path";import{dirname as ke}from"path";P(),ne(),b(),Oe(),m(),r(),y(),s(),be(),L(),le(),Ee(),de(),fe(),S(),u(),he(),ae();function Ae(e){for(let n=e.length-1;n>=0;n--){let r=e[n];if(r?.type!==`assistant`)continue;let i=r.message.content.find(e=>e.type===`tool_use`&&e.name===`TodoWrite`);if(i?.type!==`tool_use`)continue;let a=i.input;if(typeof a!=`object`||!a)return[];let o=t().safeParse(a.todos);return o.success?o.data:[]}return[]}function je(e,t){if(e.fileHistorySnapshots&&e.fileHistorySnapshots.length>0&&ve(e.fileHistorySnapshots,e=>{t(t=>({...t,fileHistory:e}))}),!i()&&e.messages&&e.messages.length>0){let n=Ae(e.messages);if(n.length>0){let e=M();t(t=>({...t,todos:{...t.todos,[e]:n}}))}}}function B(e,t){if(!(!e&&!t))return{name:e??``,color:t==="default"?void 0:t}}function V(e,t,n){if(t)return{agentDefinition:t,agentType:void 0};if(!e)return k(void 0),{agentDefinition:void 0,agentType:void 0};let r=n.activeAgents.find(t=>t.agentType===e);return r?(k(r.agentType),!E()&&r.model&&r.model!==`inherit`&&N(De(r.model)),{agentDefinition:r,agentType:r.agentType}):(I(`Resumed session had agent "${e}" but it is no longer available. Using default behavior.`),k(void 0),{agentDefinition:void 0,agentType:void 0})}function H(e){let t=w();if(t){v(t);return}if(e){try{process.chdir(e.worktreePath)}catch{v(null);return}g(e.worktreePath),D(F()),l(e),x(),c(),_.cache.clear?.()}}function Me(){let e=w();if(e){l(null),x(),c(),_.cache.clear?.();try{process.chdir(e.originalCwd)}catch{return}g(e.originalCwd),D(F())}}async function Ne(e,t,r){if(t.forkSession)e.contentReplacements?.length&&await n(e.contentReplacements);else{let n=t.sessionIdOverride??e.sessionId;n&&(A(f(n),t.transcriptPath?ke(t.transcriptPath):null),await ue(),d(n))}re(t.forkSession?{...e,worktreeSession:void 0}:e),t.forkSession||(H(e.worktreeSession),ie());let{agentDefinition:i,agentType:a}=V(e.agentSetting,r.mainThreadAgentDefinition,r.agentDefinitions);me(`normal`),t.includeAttribution;let o=B(e.agentName,e.agentColor);ce(e.agentName);let s=r.agentDefinitions;return{messages:e.messages,fileHistorySnapshots:e.fileHistorySnapshots,contentReplacements:e.contentReplacements,agentName:e.agentName,agentColor:e.agentColor==="default"?void 0:e.agentColor,restoredAgentDef:i,initialState:{...r.initialState,...a&&{agent:a},...o&&{standaloneAgentContext:o},agentDefinitions:s}}}p(),P(),te(),R(),_e(),ge(),xe(),L(),Se(),pe(),T();var Pe=1e3,Fe=500,Ie=300,Le=2e3,Re=typeof Bun<`u`,U=null,W=null,G=new Set,K=!1,q=!1,J=!1,Y=null,X=O(),Z=null;async function ze(){if(K||q)return;K=!0,J||(J=!0,a(()=>{C(),X.emit()}));let t=await Ve();t.length!==0&&(I(`Watching for changes in skill/command directories: ${t.join(`, `)}...`),U=e.watch(t,{persistent:!0,ignoreInitial:!0,depth:2,awaitWriteFinish:{stabilityThreshold:Z?.stabilityThreshold??Pe,pollInterval:Z?.pollInterval??Fe},ignored:(e,t)=>t&&!t.isFile()&&!t.isDirectory()?!0:e.split(z.sep).some(e=>e===`.git`),ignorePermissionErrors:!0,usePolling:Re,interval:Z?.chokidarInterval??Le,atomic:!0}),U.on(`add`,$),U.on(`change`,$),U.on(`unlink`,$),Y=Ce(async()=>{await Q()}))}function Q(){q=!0,Y&&(Y(),Y=null);let e=Promise.resolve();return U&&(e=U.close(),U=null),W&&(clearTimeout(W),W=null),G.clear(),X.clear(),e}var Be=X.subscribe;async function Ve(){let e=we(),t=[],n=o(`userSettings`,`skills`);if(n)try{await e.stat(n),t.push(n)}catch{}let r=o(`userSettings`,`commands`);if(r)try{await e.stat(r),t.push(r)}catch{}let i=o(`projectSettings`,`skills`);if(i)try{let n=z.resolve(i);await e.stat(n),t.push(n)}catch{}let a=o(`projectSettings`,`commands`);if(a)try{let n=z.resolve(a);await e.stat(n),t.push(n)}catch{}for(let n of j()){let r=z.join(n,`.workmate`,`skills`);try{await e.stat(r),t.push(r)}catch{}}return t}function $(e){I(`Detected skill change: ${e}`),Te(`tengu_skill_file_changed`,{source:`chokidar`}),He(e)}function He(e){G.add(e),W&&clearTimeout(W),W=setTimeout(async()=>{W=null;let e=[...G];if(G.clear(),h(await ee(`skills`,e[0]))){I(`ConfigChange hook blocked skill reload (${e.length} paths)`);return}se(),oe(),ye(),X.emit()},Z?.reloadDebounce??Ie)}async function Ue(e){U&&(await U.close(),U=null),W&&(clearTimeout(W),W=null),G.clear(),X.clear(),K=!1,q=!1,Z=e??null}var We={initialize:ze,dispose:Q,subscribe:Be,resetForTesting:Ue};export{V as a,Ne as i,B as n,je as o,Me as r,H as s,We as t};
@@ -1 +0,0 @@
1
- import{n as e,r as t}from"./startupProfiler-DTs9w9EN.js";e();export{t as profileCheckpoint};