@readmagic/workmate 0.0.2 → 0.0.3

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 (490) hide show
  1. package/dist/chunks/{AddWorkspaceDirectory-BgNp7glC.js → AddWorkspaceDirectory-mANiG0xj.js} +1 -1
  2. package/dist/chunks/{App-Coboqa8H.js → App-aUVaOLeo.js} +1 -1
  3. package/dist/chunks/{ApproveApiKey-CYpBbj0k.js → ApproveApiKey-36iUE5CW.js} +1 -1
  4. package/dist/chunks/ApproveApiKey-DPdcp1CQ.js +1 -0
  5. package/dist/chunks/{AssistantSessionChooser-DxKsTdqj.js → AssistantSessionChooser-BLcvdkgb.js} +1 -1
  6. package/dist/chunks/BackgroundTasksDialog-DyjVt81B.js +2 -0
  7. package/dist/chunks/{BypassPermissionsModeDialog-Cx3QGFz-.js → BypassPermissionsModeDialog-CTlpvTuz.js} +1 -1
  8. package/dist/chunks/{ClaudeMdExternalIncludesDialog-BAK9fxwg.js → ClaudeMdExternalIncludesDialog-5pipE8m8.js} +1 -1
  9. package/dist/chunks/ClaudeMdExternalIncludesDialog-Dn7Le--z.js +1 -0
  10. package/dist/chunks/ConsoleOAuthFlow-BDr1Vx5K.js +1 -0
  11. package/dist/chunks/{DesktopHandoff-BsHgLlTy.js → DesktopHandoff-Blg1TVut.js} +1 -1
  12. package/dist/chunks/{DiffDialog-BgTW2Znv.js → DiffDialog-CUEpuocY.js} +2 -2
  13. package/dist/chunks/Doctor-B540I-gq.js +1 -0
  14. package/dist/chunks/Doctor-DlE1Mbb9.js +3 -0
  15. package/dist/chunks/ExitFlow-DCIhnP5h.js +2 -0
  16. package/dist/chunks/Feedback-CDTqPqsM.js +2 -0
  17. package/dist/chunks/{Grove-Dsi4yU08.js → Grove-D9lSG_Lh.js} +1 -1
  18. package/dist/chunks/Grove-DLYXL8hv.js +1 -0
  19. package/dist/chunks/{HybridTransport-8qA64lCx.js → HybridTransport-8j0AviF6.js} +4 -4
  20. package/dist/chunks/{InvalidConfigDialog-CAZ1z5WG.js → InvalidConfigDialog-I3t-0nU3.js} +1 -1
  21. package/dist/chunks/{InvalidSettingsDialog-D82Qk_MR.js → InvalidSettingsDialog-BnthOxGT.js} +1 -1
  22. package/dist/chunks/MCPConnectionManager-zdocEDgk.js +1 -0
  23. package/dist/chunks/{McpParsingWarnings-8ZueNqAd.js → McpParsingWarnings-D0XvLirX.js} +1 -1
  24. package/dist/chunks/MessageSelector-BBhCstBa.js +3 -0
  25. package/dist/chunks/Messages-Dv2VrytX.js +11 -0
  26. package/dist/chunks/{Onboarding-CUztnbbv.js → Onboarding-B1WRpoBI.js} +1 -1
  27. package/dist/chunks/{OverageCreditUpsell-DSgrZvMv.js → OverageCreditUpsell-BSmgq089.js} +1 -1
  28. package/dist/chunks/PluginSettings-DN9rpwc_.js +17 -0
  29. package/dist/chunks/{PromptInputFooterSuggestions-IaihWay3.js → PromptInputFooterSuggestions-3rjz6zhK.js} +1 -1
  30. package/dist/chunks/{PromptInputHelpMenu-okS2rQ4k.js → PromptInputHelpMenu-DgDJHZqC.js} +1 -1
  31. package/dist/chunks/QueryEngine-BnaHDZVZ.js +1 -0
  32. package/dist/chunks/REPL-B3RbzeV7.js +1 -0
  33. package/dist/chunks/{REPL-Dto012J0.js → REPL-CA8FEO7J.js} +44 -44
  34. package/dist/chunks/{RemoteCallout-C_UIYnuT.js → RemoteCallout-BFzCx_Pn.js} +1 -1
  35. package/dist/chunks/{RemoteSessionManager-CuSSHAXN.js → RemoteSessionManager-BhUrtejX.js} +2 -2
  36. package/dist/chunks/ResumeConversation-BseKUFRI.js +1 -0
  37. package/dist/chunks/{SSETransport-Chj_yfPv.js → SSETransport-DGIytG74.js} +3 -3
  38. package/dist/chunks/SearchExtraToolsTool-h6OunbMd.js +1 -0
  39. package/dist/chunks/Settings-BvhG1XoW.js +2 -0
  40. package/dist/chunks/{TeleportProgress-DP1a8jit.js → TeleportProgress-Bens06DU.js} +1 -1
  41. package/dist/chunks/{TeleportRepoMismatchDialog-B6sTwXuZ.js → TeleportRepoMismatchDialog-BtLBCZUe.js} +1 -1
  42. package/dist/chunks/{TeleportResumeWrapper-CKUuRQSG.js → TeleportResumeWrapper-t50LfWyN.js} +1 -1
  43. package/dist/chunks/{ThemePicker-Dyq1YVhb.js → ThemePicker-BTfuZZ7E.js} +1 -1
  44. package/dist/chunks/TrustDialog-CgE_pYUK.js +1 -0
  45. package/dist/chunks/{ValidationErrorsList-DUNh4BNa.js → ValidationErrorsList-Bl68E-2-.js} +1 -1
  46. package/dist/chunks/{WelcomeV2-TPbOXGrO.js → WelcomeV2-C93xQYAF.js} +1 -1
  47. package/dist/chunks/{add-dir-Bf_5tCeR.js → add-dir-C3IhJYVH.js} +1 -1
  48. package/dist/chunks/{agentDisplay-CCeYiAta.js → agentDisplay-Cju-aXCx.js} +1 -1
  49. package/dist/chunks/{agents-Bt72Gz1v.js → agents-Bhg0CtXR.js} +7 -7
  50. package/dist/chunks/{agents-T8xHY5Wk.js → agents-Du3FQ82k.js} +1 -1
  51. package/dist/chunks/{allErrors-CDWTJcMw.js → allErrors-DJYCAtab.js} +1 -1
  52. package/dist/chunks/{ant-DRF-v5bA.js → ant-CVvy4SuO.js} +1 -1
  53. package/dist/chunks/api-CI8HXREw.js +1 -0
  54. package/dist/chunks/api-gJBnC8z3.js +1 -0
  55. package/dist/chunks/asciicast-BsWpcxrc.js +1 -0
  56. package/dist/chunks/{asciicast-CQJlNTae.js → asciicast-CbAjUHT_.js} +4 -4
  57. package/dist/chunks/{assistant-z1ojxEET.js → assistant-C_SkUDk_.js} +1 -1
  58. package/dist/chunks/auth-B9V3i5oZ.js +1 -0
  59. package/dist/chunks/auth-CgEABs3i.js +15 -0
  60. package/dist/chunks/auth-fSFfSKy_.js +1 -0
  61. package/dist/chunks/{autoMode-DW_H3i37.js → autoMode-CZyb-mMY.js} +5 -5
  62. package/dist/chunks/{autonomy-46hnmyAi.js → autonomy-BpINX4jw.js} +1 -1
  63. package/dist/chunks/{autonomy-OxhciwYa.js → autonomy-DJZ25xZp.js} +7 -7
  64. package/dist/chunks/{autonomyPanel-CTEjq0Bd.js → autonomyPanel-ssoiIOx5.js} +1 -1
  65. package/dist/chunks/{backgroundHousekeeping-Cpxq4krt.js → backgroundHousekeeping-BHncba6e.js} +3 -3
  66. package/dist/chunks/backgroundHousekeeping-QK8iEXoI.js +1 -0
  67. package/dist/chunks/{banner-BVkLvJiB.js → banner-CWkrK10u.js} +1 -1
  68. package/dist/chunks/bg-B0iMGM9C.js +1 -0
  69. package/dist/chunks/{bg-zWGqkcST.js → bg-WnYN5ifx.js} +2 -2
  70. package/dist/chunks/{branch-DJzijRGm.js → branch-BXo5z2al.js} +1 -1
  71. package/dist/chunks/{bridge-Dpr2AWpc.js → bridge-CbKc1HeD.js} +2 -2
  72. package/dist/chunks/bridgeConfig-CLHy-BiF.js +1 -0
  73. package/dist/chunks/{bridgeConfig-DDF3teRE.js → bridgeConfig-DbqUHe0H.js} +1 -1
  74. package/dist/chunks/bridgeEnabled-BWSUZ7Xg.js +1 -0
  75. package/dist/chunks/{bridgeEnabled-D4JDZd0y.js → bridgeEnabled-CM3SaumJ.js} +1 -1
  76. package/dist/chunks/bridgeMain-BESKzpm0.js +1 -0
  77. package/dist/chunks/bridgeMain-CzhBVCsN.js +68 -0
  78. package/dist/chunks/bridgeMessaging-lfa_v3oi.js +1 -0
  79. package/dist/chunks/bridgePointer-MqLe5Asm.js +1 -0
  80. package/dist/chunks/{browser-BKiu1max.js → browser-BmZuQom6.js} +1 -1
  81. package/dist/chunks/{btw-DG9CCeq4.js → btw-Cp0whJaJ.js} +1 -1
  82. package/dist/chunks/{caches-BB5_91gU.js → caches-CmW7idg5.js} +2 -2
  83. package/dist/chunks/caches-CpqTC0Lb.js +1 -0
  84. package/dist/chunks/ccrClient-BPXmxWHw.js +1 -0
  85. package/dist/chunks/{claudeDesktop-9xfIgkzE.js → claudeDesktop-Cx31Ugjp.js} +1 -1
  86. package/dist/chunks/{clear-ueMvDelv.js → clear-DjGPxX7T.js} +1 -1
  87. package/dist/chunks/{cliLaunch-BJ9o-rIV.js → cliLaunch-BkPAatcs.js} +1 -1
  88. package/dist/chunks/client-DPUvQ6Rf.js +1 -0
  89. package/dist/chunks/{color-B0-MIfsq.js → color-DYYBN52b.js} +1 -1
  90. package/dist/chunks/commands-D7l3P1k9.js +1 -0
  91. package/dist/chunks/commitAttribution-B7NUPJ8E.js +1 -0
  92. package/dist/chunks/{commitAttribution-DKun9CeU.js → commitAttribution-Bmzgtqc6.js} +2 -2
  93. package/dist/chunks/compact-D6xqZN4Q.js +2 -0
  94. package/dist/chunks/{completionCache-CdHCuiqq.js → completionCache-MN3_MqK8.js} +2 -2
  95. package/dist/chunks/completionCache-c4aiyZ_f.js +1 -0
  96. package/dist/chunks/config-DiT2Z8dY.js +3 -0
  97. package/dist/chunks/config-huQaTcNb.js +1 -0
  98. package/dist/chunks/config-qLaiAn7z.js +1 -0
  99. package/dist/chunks/{context-DBswG0EY.js → context-Bh_iUj76.js} +1 -1
  100. package/dist/chunks/context-noninteractive-CNot6jbs.js +1 -0
  101. package/dist/chunks/{context-noninteractive-CTvyNimw.js → context-noninteractive-Cb3EM2Oz.js} +2 -2
  102. package/dist/chunks/conversation-CSpwF3Ha.js +1 -0
  103. package/dist/chunks/conversation-CvCQta8e.js +1 -0
  104. package/dist/chunks/{createSSHSession-BdO35H6o.js → createSSHSession-B0s839mX.js} +5 -5
  105. package/dist/chunks/createSession-GNSNbUbN.js +1 -0
  106. package/dist/chunks/{createSession-Br1g8qSD.js → createSession-VMTMXOHu.js} +1 -1
  107. package/dist/chunks/crossProjectResume-DGpgCUfk.js +40 -0
  108. package/dist/chunks/{daemon-BQiSFjc-.js → daemon-YtZbMQtn.js} +1 -1
  109. package/dist/chunks/datadog-D9rlcN12.js +1 -0
  110. package/dist/chunks/{debug-DiuXEmUq.js → debug-BrXObCdR.js} +1 -1
  111. package/dist/chunks/{debugUtils-3YYWvb3H.js → debugUtils-NO5KtXqi.js} +1 -1
  112. package/dist/chunks/{desktop-W7SA8BFk.js → desktop-DidI-4N5.js} +1 -1
  113. package/dist/chunks/{detached-Cv9gAylK.js → detached-TYk4hMFj.js} +1 -1
  114. package/dist/chunks/{detectRepository-B1PMTLAU.js → detectRepository-BPr0VWNO.js} +1 -1
  115. package/dist/chunks/detectRepository-BTPgN89l.js +1 -0
  116. package/dist/chunks/{diff-CMtRjFUb.js → diff-CZg5qL2n.js} +1 -1
  117. package/dist/chunks/{directoryCompletion-CeV63gvu.js → directoryCompletion-CW2ckkQg.js} +1 -1
  118. package/dist/chunks/doctor-CKUXGCri.js +1 -0
  119. package/dist/chunks/{effort-BAlVDBHq.js → effort-BcvNemuq.js} +2 -2
  120. package/dist/chunks/{entry-DLqeVq5C.js → entry-dA1UCfC0.js} +4 -4
  121. package/dist/chunks/envLessBridgeConfig-BFjJ8Kt4.js +1 -0
  122. package/dist/chunks/envLessBridgeConfig-bei51W3H.js +1 -0
  123. package/dist/chunks/esm-DjGYYlQe.js +1 -0
  124. package/dist/chunks/{execFileNoThrow-DResQRvR.js → execFileNoThrow-D244NytW.js} +1 -1
  125. package/dist/chunks/execSyncWrapper-CCMQShK-.js +1 -0
  126. package/dist/chunks/exit-COMnVxzw.js +1 -0
  127. package/dist/chunks/extra-usage-BTv_OwGN.js +1 -0
  128. package/dist/chunks/extra-usage-By33zGLT.js +1 -0
  129. package/dist/chunks/{extra-usage-core-Dh4rVUI-.js → extra-usage-core-RZMzaH0L.js} +1 -1
  130. package/dist/chunks/{extra-usage-noninteractive-D4Ya5KPm.js → extra-usage-noninteractive-BB-BQ3kh.js} +1 -1
  131. package/dist/chunks/{extraUsage-DtWi8E78.js → extraUsage-CTn9FWSk.js} +1 -1
  132. package/dist/chunks/extractMemories-CXGZGe0h.js +1 -0
  133. package/dist/chunks/fast-BXzdzzXU.js +1 -0
  134. package/dist/chunks/{fast-DkUxqWhE.js → fast-CNXgsvnE.js} +1 -1
  135. package/dist/chunks/{feedback-Cn7Sbqxa.js → feedback-DeJ2gvw2.js} +1 -1
  136. package/dist/chunks/{file-BZriE-XU.js → file-DcZWPH2V.js} +5 -5
  137. package/dist/chunks/firstPartyEventLogger-CQdJn3LV.js +5 -0
  138. package/dist/chunks/firstPartyEventLogger-CdLshdJY.js +1 -0
  139. package/dist/chunks/{flushGate-ebqQZF1t.js → flushGate-CJ73xcaK.js} +1 -1
  140. package/dist/chunks/gemini-Cn9bMXwP.js +1 -0
  141. package/dist/chunks/generateRecap-BO9kzRon.js +1 -0
  142. package/dist/chunks/{generateSessionName-DEAw5x_h.js → generateSessionName-CGpL6ATy.js} +1 -1
  143. package/dist/chunks/{genericProcessUtils-DO7Fy0RJ.js → genericProcessUtils-CdQTApYX.js} +1 -1
  144. package/dist/chunks/git-CbcnOf0E.js +1 -0
  145. package/dist/chunks/git-Do0wJvux.js +6 -0
  146. package/dist/chunks/{githubRepoPathMapping-Tt-LdYFZ.js → githubRepoPathMapping-C4umZ1oC.js} +1 -1
  147. package/dist/chunks/{goal-DCaI1NPN.js → goal-C8Qzl7_i.js} +3 -3
  148. package/dist/chunks/{grok-CKlngG3b.js → grok-CDT9P_BL.js} +1 -1
  149. package/dist/chunks/{grove-DSWe6psK.js → grove-BGXzEyH9.js} +2 -2
  150. package/dist/chunks/{heapdump-OVbV05On.js → heapdump-CFHvdSZv.js} +5 -5
  151. package/dist/chunks/{help-CRtX5VX9.js → help-DUZ7Y7Em.js} +1 -1
  152. package/dist/chunks/{hooks-tpf90xd5.js → hooks-RHwUCXcT.js} +2 -2
  153. package/dist/chunks/hooks-fZ1r0jUF.js +1 -0
  154. package/dist/chunks/{hostGuard-t7QfbijF.js → hostGuard-C5xydXZI.js} +1 -1
  155. package/dist/chunks/inboundAttachments-Cfl4_n0S.js +1 -0
  156. package/dist/chunks/inboundAttachments-YMxf4fmR.js +1 -0
  157. package/dist/chunks/initReplBridge-GH3-LHF4.js +1 -0
  158. package/dist/chunks/install-OkuNmjmB.js +1 -0
  159. package/dist/chunks/{instrumentation--Sx0y1Gk.js → instrumentation-hrXeo-G4.js} +6 -6
  160. package/dist/chunks/{job-D7B35Usp.js → job-DjmIpwJl.js} +1 -1
  161. package/dist/chunks/jwtUtils-DE2GPUcx.js +1 -0
  162. package/dist/chunks/keybindings-B8U17bhs.js +2 -0
  163. package/dist/chunks/{language-8Rnu_qxl.js → language-BA5WprZv.js} +1 -1
  164. package/dist/chunks/language-BbaOTWm3.js +1 -0
  165. package/dist/chunks/{launchAgentsPlatform-CNPkOVzu.js → launchAgentsPlatform-DnxH2SAn.js} +1 -1
  166. package/dist/chunks/{launchLocalMemory-BxmDhENs.js → launchLocalMemory-CgXtGng1.js} +2 -2
  167. package/dist/chunks/{launchLocalVault-DQlTGA-g.js → launchLocalVault-Bs6Km3Ua.js} +3 -3
  168. package/dist/chunks/{launchMemoryStores-EYAwxI8i.js → launchMemoryStores-DxVAIJuB.js} +1 -1
  169. package/dist/chunks/{launchOnboarding-CTu5Zf4E.js → launchOnboarding-Cn0t_o2k.js} +1 -1
  170. package/dist/chunks/{launchSchedule-CeHHSvO7.js → launchSchedule-Chwr3Nzd.js} +1 -1
  171. package/dist/chunks/{launchSkillStore-Bqh2Fru2.js → launchSkillStore-6zxJfWVU.js} +1 -1
  172. package/dist/chunks/{launchTeleport-Crc3XVZX.js → launchTeleport-Ba_Hj13c.js} +1 -1
  173. package/dist/chunks/{launchVault-BHLgpth_.js → launchVault-hGVrHy33.js} +1 -1
  174. package/dist/chunks/{v4-jw6qOKwQ.js → lazySchema-DcIJE_0i.js} +1 -1
  175. package/dist/chunks/loadAgentsDir-BHOyHxwz.js +1 -0
  176. package/dist/chunks/{loadAgentsDir-ZQwvbURI.js → loadAgentsDir-DrDu5yYy.js} +685 -683
  177. package/dist/chunks/loadPluginHooks-s7bvGtns.js +1 -0
  178. package/dist/chunks/localSearch-CebU5BA9.js +1 -0
  179. package/dist/chunks/{localSearch-H0LchlTi.js → localSearch-_bQhk9W6.js} +1 -1
  180. package/dist/chunks/{log-Duzb4o6h.js → log-BMCygSzM.js} +1 -1
  181. package/dist/chunks/{logoV2Utils-5lcUu53m.js → logoV2Utils-CoC4nheD.js} +1 -1
  182. package/dist/chunks/{magicDocs-D1FIPmYg.js → magicDocs-kMjYpjCA.js} +3 -3
  183. package/dist/chunks/{main-B8XtFN2P.js → main-C_rVSWfm.js} +78 -78
  184. package/dist/chunks/{main-CR7cXdgy.js → main-D862LI_d.js} +2 -2
  185. package/dist/chunks/{mappers-DKU4RgE3.js → mappers-D0CNXG32.js} +1 -1
  186. package/dist/chunks/mcp-1ZuFesM9.js +2 -0
  187. package/dist/chunks/mcp-CKvGBEjz.js +1 -0
  188. package/dist/chunks/mcp-DtxIl6aN.js +6 -0
  189. package/dist/chunks/{memoize-DgMjqLtn.js → memoize-B0zhbT8Z.js} +1 -1
  190. package/dist/chunks/{memory-D-Q62bJ7.js → memory-DE2jtkd_.js} +1 -1
  191. package/dist/chunks/{mode-DFZgqKBd.js → mode-B4WIxCMW.js} +2 -2
  192. package/dist/chunks/model-C4RHNhDQ.js +1 -0
  193. package/dist/chunks/model-fi472PRc.js +1 -0
  194. package/dist/chunks/{model-fDWtIRVr.js → model-j9GNZDFr.js} +1 -1
  195. package/dist/chunks/nativeInstaller-DktvrWRd.js +1 -0
  196. package/dist/chunks/{onChangeAppState-DaQ0R9Tw.js → onChangeAppState-CGVeNkt7.js} +1 -1
  197. package/dist/chunks/{openai-DNS0-ivj.js → openai-BSVjSJiF.js} +3 -3
  198. package/dist/chunks/{overageCreditGrant-qHN3tnp2.js → overageCreditGrant-BVxlYgeU.js} +1 -1
  199. package/dist/chunks/{panelCall-BvKpHquo.js → panelCall-Cp6fpQeL.js} +1 -1
  200. package/dist/chunks/parser-Bf6iasPV.js +1 -0
  201. package/dist/chunks/{parser-TYEkLFgh.js → parser-DFwaTGf7.js} +1 -1
  202. package/dist/chunks/{partition-Cv11dD5P.js → partition-RjCtgt9J.js} +1 -1
  203. package/dist/chunks/{passes-DQdM2Ssq.js → passes-ByTLy6pj.js} +1 -1
  204. package/dist/chunks/{path-Cu_AKqg6.js → path-D5U-tm91.js} +1 -1
  205. package/dist/chunks/permissions-B3df_htx.js +3 -0
  206. package/dist/chunks/pidLock-CdNZ0Wfg.js +3 -0
  207. package/dist/chunks/{pipeTransport-7GIO6GCA.js → pipeTransport-CqCnc-Ys.js} +1 -1
  208. package/dist/chunks/{plan-D8dQDl8W.js → plan-BxTA-b4l.js} +1 -1
  209. package/dist/chunks/{platform-B5dCGT8t.js → platform-BrYefG_2.js} +1 -1
  210. package/dist/chunks/{plugin-w8MqsKHn.js → plugin-DOpl5e1t.js} +1 -1
  211. package/dist/chunks/{pluginAutoupdate-7FFHzSRz.js → pluginAutoupdate-L09CQ-ph.js} +1 -1
  212. package/dist/chunks/pluginBlocklist-B32eWmzn.js +1 -0
  213. package/dist/chunks/pluginCliCommands-CDMWnO3d.js +1 -0
  214. package/dist/chunks/{pluginFlagging-_WUQP3Lq.js → pluginFlagging-3FQGvIfq.js} +1 -1
  215. package/dist/chunks/pluginOperations-ClzXYNQe.js +2 -0
  216. package/dist/chunks/{pluginStartupCheck-BelpzwZI.js → pluginStartupCheck-BNd2QNzZ.js} +1 -1
  217. package/dist/chunks/pluginStartupCheck-RiZxW-WU.js +1 -0
  218. package/dist/chunks/plugins-CcDG95Bs.js +4 -0
  219. package/dist/chunks/policyLimits-Bwi9VqDF.js +1 -0
  220. package/dist/chunks/pollConfig-DH2oCtFS.js +1 -0
  221. package/dist/chunks/{poor-D3T_8wwf.js → poor-DekfGNT7.js} +1 -1
  222. package/dist/chunks/poorMode-AE4WNYZo.js +1 -0
  223. package/dist/chunks/{poorMode-BqyVuBu-.js → poorMode-CtcqaiwD.js} +1 -1
  224. package/dist/chunks/print-Cc_QOSPF.js +23 -0
  225. package/dist/chunks/{privacy-settings-D5zxu4Aa.js → privacy-settings-ChNsgGUs.js} +1 -1
  226. package/dist/chunks/processBashCommand-Bx6_oZoE.js +1 -0
  227. package/dist/chunks/processSlashCommand-AltWgIFt.js +5 -0
  228. package/dist/chunks/prompt-C0nU0VK3.js +139 -0
  229. package/dist/chunks/prompt-CYx145pp.js +1 -0
  230. package/dist/chunks/prompt-DH3lKFag.js +1 -0
  231. package/dist/chunks/{promptEditor-D6HzjcMS.js → promptEditor-Cumef6hJ.js} +2 -2
  232. package/dist/chunks/{protocolHandler-BXlx1N7v.js → protocolHandler-z2zxAtB1.js} +4 -4
  233. package/dist/chunks/{proxy-CHnxhNZI.js → proxy-CRN7jYIi.js} +3 -3
  234. package/dist/chunks/{rate-limit-options-1hc-RyNR.js → rate-limit-options-VL7S3SCx.js} +1 -1
  235. package/dist/chunks/rcDebugLog-2-1XSyFV.js +11 -0
  236. package/dist/chunks/reconciler-DHRE_gV2.js +4 -0
  237. package/dist/chunks/{referral-Cu9bEOFE.js → referral-DrebVwqx.js} +1 -1
  238. package/dist/chunks/{refresh-vJbxW4a1.js → refresh-pFezssA8.js} +1 -1
  239. package/dist/chunks/{registerProtocol-B_XbLDQO.js → registerProtocol-CukLQuxJ.js} +3 -3
  240. package/dist/chunks/{release-notes-CavWoMQR.js → release-notes-D7vrFNXp.js} +1 -1
  241. package/dist/chunks/{releaseNotes-Di6OaHF7.js → releaseNotes-CDx2P0fb.js} +2 -2
  242. package/dist/chunks/{reload-plugins-ofeLn07p.js → reload-plugins-CltHfg-l.js} +1 -1
  243. package/dist/chunks/{remote-env-dXzHAuD6.js → remote-env-SvvSuP0J.js} +1 -1
  244. package/dist/chunks/remoteBridgeCore-BOeljn2c.js +1 -0
  245. package/dist/chunks/remoteManagedSettings-CaY_ZH8r.js +1 -0
  246. package/dist/chunks/{rename-CtjP0lop.js → rename-CbqrCCBO.js} +1 -1
  247. package/dist/chunks/{renderOptions-DOXmueQV.js → renderOptions-BUJB9nAm.js} +1 -1
  248. package/dist/chunks/{resume-C5h5JvY1.js → resume-DockJaY9.js} +2 -2
  249. package/dist/chunks/{ripgrep-BN_g-F7X.js → ripgrep-BXmXjAzA.js} +1 -1
  250. package/dist/chunks/ripgrep-BfIpz5uC.js +1 -0
  251. package/dist/chunks/{runtimeObserver-DOZFrqJu.js → runtimeObserver-DSUuYKfs.js} +1 -1
  252. package/dist/chunks/{runtimeObserver-B93v1AxE.js → runtimeObserver-XufSllVw.js} +4 -4
  253. package/dist/chunks/sandbox-adapter-CEZnHq0U.js +1 -0
  254. package/dist/chunks/{sandbox-toggle-TiLGFwaZ.js → sandbox-toggle-CZI5fuK3.js} +1 -1
  255. package/dist/chunks/searchExtraTools-iQfI39wB.js +1 -0
  256. package/dist/chunks/{session-v9tKHhU9.js → session-B-Z3DU9o.js} +2 -2
  257. package/dist/chunks/{sessionDiscovery-4byQKOnc.js → sessionDiscovery-C3pMZkBM.js} +1 -1
  258. package/dist/chunks/sessionFileAccessHooks-DyrZmoA7.js +1 -0
  259. package/dist/chunks/sessionMemory-CqRpgwtU.js +1 -0
  260. package/dist/chunks/sessionMemory-D_HQmhj7.js +1 -0
  261. package/dist/chunks/sessionMemoryUtils-CZOIKrn0.js +1 -0
  262. package/dist/chunks/sessionObserver-B400YG3s.js +1 -0
  263. package/dist/chunks/{sessionObserver-OgY9BUP4.js → sessionObserver-B_09FQKV.js} +1 -1
  264. package/dist/chunks/sessionStorage-DRnvtrpU.js +1 -0
  265. package/dist/chunks/sessionTitle-CmLWNFuX.js +14 -0
  266. package/dist/chunks/{sessionTracing-BBxhPccY.js → sessionTracing-lArOaj9u.js} +3 -3
  267. package/dist/chunks/settings-DfWP5y6X.js +19 -0
  268. package/dist/chunks/settingsSync-BlDk6rsM.js +1 -0
  269. package/dist/chunks/setup-DdbmxSZh.js +3 -0
  270. package/dist/chunks/{shadowedRuleDetection-DDSOFi1W.js → shadowedRuleDetection-E2wF1UjU.js} +1 -1
  271. package/dist/chunks/{shellQuote-yXoC_y5m.js → shellQuote-DkSy9MYE.js} +1 -1
  272. package/dist/chunks/{sideQuestion-CAiA6jAf.js → sideQuestion-BjHCLSR9.js} +1 -1
  273. package/dist/chunks/sinks-Cb--pqr-.js +2 -0
  274. package/dist/chunks/sinks-DbwDBd-E.js +1 -0
  275. package/dist/chunks/{skill-learning-Dx1o4mMo.js → skill-learning-B0dyBT1_.js} +1 -1
  276. package/dist/chunks/skillChangeDetector-DQof8SUY.js +1 -0
  277. package/dist/chunks/{skillGapStore-Zvqiyxds.js → skillGapStore-75ZYlfwi.js} +2 -2
  278. package/dist/chunks/{skillGapStore-BV_6qzxU.js → skillGapStore-D2fqmnKx.js} +1 -1
  279. package/dist/chunks/{skillGenerator-jJQDphQ8.js → skillGenerator-CwXUfM4Y.js} +2 -2
  280. package/dist/chunks/{skillLearning-BTT3_yGc.js → skillLearning-CB-5fdMl.js} +1 -1
  281. package/dist/chunks/skillLearning-CSY5R5Jn.js +1 -0
  282. package/dist/chunks/{skillPanel-OW2M6SZr.js → skillPanel-Bum7xpgo.js} +3 -3
  283. package/dist/chunks/{skillSearchPanel-C0Y56c5N.js → skillSearchPanel-LSPwZIOw.js} +4 -4
  284. package/dist/chunks/{skills-BFsyLP33.js → skills-G8WBeffd.js} +1 -1
  285. package/dist/chunks/startupProfiler-DIWVcO4e.js +1 -0
  286. package/dist/chunks/{startupProfiler-BquH_Yqm.js → startupProfiler-xa3NmN7Z.js} +2 -2
  287. package/dist/chunks/{stats-CrPmPT8f.js → stats-DmFubHpI.js} +1 -1
  288. package/dist/chunks/{status-DHJbK4pV.js → status-ClSsvm1N.js} +2 -2
  289. package/dist/chunks/{status-BO5J2MAe.js → status-i5beKggW.js} +1 -1
  290. package/dist/chunks/{statusNoticeHelpers-CqeUBySi.js → statusNoticeHelpers-BK-54uGY.js} +1 -1
  291. package/dist/chunks/{stickers-BLFmyHZV.js → stickers-D5teCKMN.js} +1 -1
  292. package/dist/chunks/{stringUtils-D_g2L6A4.js → stringUtils-DGLPkqJ4.js} +1 -1
  293. package/dist/chunks/{tag-M2AEtXjW.js → tag-DYYq4H_i.js} +2 -2
  294. package/dist/chunks/{tasks-CoOs_Qkj.js → tasks-BySzm_YJ.js} +1 -1
  295. package/dist/chunks/teleport-dxtBcM01.js +1 -0
  296. package/dist/chunks/{templateJobs-Cl50Qw0s.js → templateJobs-CT5VxeRr.js} +1 -1
  297. package/dist/chunks/terminalSetup-BNs9nLbT.js +33 -0
  298. package/dist/chunks/{terminalSetup-Bdh9K31U.js → terminalSetup-RDKg8dVa.js} +1 -1
  299. package/dist/chunks/{theme-DgCIr0jU.js → theme-CVTVsRwt.js} +1 -1
  300. package/dist/chunks/thinkback-B-GpXG9U.js +1 -0
  301. package/dist/chunks/{thinkback-ERCQ86CR.js → thinkback-CXsRbDYN.js} +1 -1
  302. package/dist/chunks/thinkback-play-BhfCaIye.js +1 -0
  303. package/dist/chunks/{tmux-ZZk68JBq.js → tmux-BY7IdQ1f.js} +1 -1
  304. package/dist/chunks/{toolEventObserver-9XCQXiMx.js → toolEventObserver--4fqXxQZ.js} +1 -1
  305. package/dist/chunks/{toolEventObserver-9-5Ne25Z.js → toolEventObserver-DdhPsAs1.js} +1 -1
  306. package/dist/chunks/toolPool-DvHECcbN.js +1 -0
  307. package/dist/chunks/trustedDevice-DvpN4J1F.js +1 -0
  308. package/dist/chunks/trustedDevice-e6iF1X7C.js +1 -0
  309. package/dist/chunks/{types-Cnorfsss.js → types-C-MRCL8J.js} +3 -3
  310. package/dist/chunks/udsClient-BuCtv7dN.js +1 -0
  311. package/dist/chunks/{ultrareviewCommand-BMBHepdu.js → ultrareviewCommand-i3PfFKly.js} +2 -2
  312. package/dist/chunks/undercover-CPvoDtJ1.js +1 -0
  313. package/dist/chunks/{undercover-DDgIKbO5.js → undercover-Q24TWRw0.js} +1 -1
  314. package/dist/chunks/{up-D6bNw_tT.js → up-BHkC97_C.js} +1 -1
  315. package/dist/chunks/updateCCB-CEXA6dax.js +11 -0
  316. package/dist/chunks/{upgrade-BN20nsCH.js → upgrade-7OrBbrzS.js} +1 -1
  317. package/dist/chunks/upgrade-uR7SIVtx.js +1 -0
  318. package/dist/chunks/upload-B-lNHpWe.js +1 -0
  319. package/dist/chunks/{upstreamproxy-os5rw0Vg.js → upstreamproxy-DyR_eXO8.js} +4 -4
  320. package/dist/chunks/usage-7jOeIVv9.js +1 -0
  321. package/dist/chunks/{usage-D_sqm8us.js → usage-CZdPfUqP.js} +1 -1
  322. package/dist/chunks/{useExitOnCtrlCDWithKeybindings-vzUoPY51.js → useExitOnCtrlCDWithKeybindings-CzFtdlnD.js} +1 -1
  323. package/dist/chunks/useMainLoopModel-DegH12LZ.js +1 -0
  324. package/dist/chunks/useManagePlugins-BkK1zydO.js +1 -0
  325. package/dist/chunks/{useMergedTools-Bb4XbC9d.js → useMergedTools-DMGRA1ga.js} +1 -1
  326. package/dist/chunks/{useSearchInput-B1UOjxAI.js → useSearchInput-D5VU9IDU.js} +1 -1
  327. package/dist/chunks/{useSettingsErrors-BLbvu4--.js → useSettingsErrors-B5PSF1va.js} +1 -1
  328. package/dist/chunks/{util-CxlfALM4.js → util-CNa1ib_4.js} +1 -1
  329. package/dist/chunks/validatePlugin-Dw-RGCrm.js +1 -0
  330. package/dist/chunks/{vim-DLWBHwVM.js → vim-C0KTnJJs.js} +1 -1
  331. package/dist/chunks/{which-sEFQXpaX.js → which-CKQnSouy.js} +1 -1
  332. package/dist/chunks/windowsPaths-9pEkw0oV.js +1 -0
  333. package/dist/chunks/windowsPaths-DtapVxOo.js +1 -0
  334. package/dist/chunks/{workSecret-DvniZR71.js → workSecret-CNWiR2uQ.js} +1 -1
  335. package/dist/chunks/{workerRegistry-CFnGtb3L.js → workerRegistry-B2QD2sKq.js} +1 -1
  336. package/dist/chunks/worktree-D38cJ23W.js +1 -0
  337. package/dist/cli.js +1 -1
  338. package/package.json +4 -5
  339. package/dist/chunks/ApproveApiKey-CQsQdQBC.js +0 -1
  340. package/dist/chunks/BackgroundTasksDialog-AiVi-1pI.js +0 -2
  341. package/dist/chunks/ClaudeMdExternalIncludesDialog-DUu6iRJk.js +0 -1
  342. package/dist/chunks/ConsoleOAuthFlow-DVTPwR5I.js +0 -1
  343. package/dist/chunks/Doctor-BXhz8eUa.js +0 -3
  344. package/dist/chunks/Doctor-D75dsEyb.js +0 -1
  345. package/dist/chunks/ExitFlow-B1XNACQP.js +0 -2
  346. package/dist/chunks/Feedback-Cvz80lAn.js +0 -2
  347. package/dist/chunks/Grove-B7hhBvFw.js +0 -1
  348. package/dist/chunks/MCPConnectionManager-BLfKm4H2.js +0 -1
  349. package/dist/chunks/MessageSelector-DmKtBYX9.js +0 -3
  350. package/dist/chunks/Messages-CaFdI1kk.js +0 -11
  351. package/dist/chunks/PluginSettings-0FSNch8O.js +0 -17
  352. package/dist/chunks/QueryEngine-WYDWzQuY.js +0 -1
  353. package/dist/chunks/REPL-vV_jzAVx.js +0 -1
  354. package/dist/chunks/ResumeConversation-g_JyOWbl.js +0 -1
  355. package/dist/chunks/SearchExtraToolsTool-Daedym7_.js +0 -1
  356. package/dist/chunks/Settings-DUXA-qac.js +0 -2
  357. package/dist/chunks/TrustDialog-CdZS9t-T.js +0 -1
  358. package/dist/chunks/ajv-5vMo9UcX.js +0 -8
  359. package/dist/chunks/api-CLLIHLpn.js +0 -1
  360. package/dist/chunks/api-DMpNA1s8.js +0 -1
  361. package/dist/chunks/asciicast-BIr75_x9.js +0 -1
  362. package/dist/chunks/auth-Ce0jllLf.js +0 -1
  363. package/dist/chunks/auth-DV3P8Qup.js +0 -1
  364. package/dist/chunks/auth-DpFfHy1W.js +0 -15
  365. package/dist/chunks/backgroundHousekeeping-BycL9lOe.js +0 -1
  366. package/dist/chunks/bg-H849G7Sc.js +0 -1
  367. package/dist/chunks/bridgeConfig-CcANVX0P.js +0 -1
  368. package/dist/chunks/bridgeEnabled-Cn-u7P4_.js +0 -1
  369. package/dist/chunks/bridgeMain-CtgVyLjI.js +0 -68
  370. package/dist/chunks/bridgeMain-Dh0gWRVo.js +0 -1
  371. package/dist/chunks/bridgeMessaging-CRG6HqUb.js +0 -1
  372. package/dist/chunks/bridgePointer-Cug5fQ3e.js +0 -1
  373. package/dist/chunks/caches-C3NINY3K.js +0 -1
  374. package/dist/chunks/ccrClient-CRXGlUCe.js +0 -1
  375. package/dist/chunks/client-AnWHs0gW.js +0 -1
  376. package/dist/chunks/commands-DsKH3ogN.js +0 -1
  377. package/dist/chunks/commitAttribution-D7NrwLhc.js +0 -1
  378. package/dist/chunks/compact-BhWCO-oD.js +0 -2
  379. package/dist/chunks/completionCache-C9zlWBRz.js +0 -1
  380. package/dist/chunks/config-662VDD70.js +0 -3
  381. package/dist/chunks/config-CUN8YbOa.js +0 -1
  382. package/dist/chunks/config-DklnhNx1.js +0 -1
  383. package/dist/chunks/config-Wk3svGdH.js +0 -1
  384. package/dist/chunks/context-noninteractive-C3dICmA9.js +0 -1
  385. package/dist/chunks/conversation-CooSju3g.js +0 -1
  386. package/dist/chunks/conversation-DLLIOKYV.js +0 -1
  387. package/dist/chunks/createSession-CVG8SiEm.js +0 -1
  388. package/dist/chunks/crossProjectResume-DiKJb83I.js +0 -40
  389. package/dist/chunks/datadog-BE6D_6m0.js +0 -1
  390. package/dist/chunks/datadog-C69i7cfI.js +0 -1
  391. package/dist/chunks/debug-8kgDrUfj.js +0 -1
  392. package/dist/chunks/detectRepository-_Kj817Vi.js +0 -1
  393. package/dist/chunks/doctor-DEz8BHAz.js +0 -1
  394. package/dist/chunks/envLessBridgeConfig-3kCrKZl7.js +0 -1
  395. package/dist/chunks/envLessBridgeConfig-BfgXw47_.js +0 -1
  396. package/dist/chunks/esm-C8Zkk1Ux.js +0 -1
  397. package/dist/chunks/execSyncWrapper-CWxMek26.js +0 -1
  398. package/dist/chunks/exit-cyepwuyy.js +0 -1
  399. package/dist/chunks/extra-usage-DlFeNGQD.js +0 -1
  400. package/dist/chunks/extra-usage-nRFfBiXh.js +0 -1
  401. package/dist/chunks/extractMemories-BqN8fWZ5.js +0 -1
  402. package/dist/chunks/fast-NvqW2-t1.js +0 -1
  403. package/dist/chunks/firstPartyEventLogger-AhXYSrkP.js +0 -1
  404. package/dist/chunks/firstPartyEventLogger-BQYrBdvD.js +0 -5
  405. package/dist/chunks/gemini-Sr_00TsL.js +0 -1
  406. package/dist/chunks/generateRecap-5d4l_ODy.js +0 -1
  407. package/dist/chunks/git-Cc1jAz6r.js +0 -1
  408. package/dist/chunks/git-Cgc8X5l2.js +0 -6
  409. package/dist/chunks/hooks-DvtnNoYE.js +0 -1
  410. package/dist/chunks/inboundAttachments-BZ6MKpxd.js +0 -1
  411. package/dist/chunks/inboundAttachments-D5Ux2kCl.js +0 -1
  412. package/dist/chunks/initReplBridge-CjuO6in6.js +0 -1
  413. package/dist/chunks/install-DqpM2brU.js +0 -1
  414. package/dist/chunks/jwtUtils-CqXPjf-a.js +0 -1
  415. package/dist/chunks/keybindings-JvAmBpLt.js +0 -2
  416. package/dist/chunks/language-DaxZe0Xw.js +0 -1
  417. package/dist/chunks/lazySchema-uxlVVNM1.js +0 -1
  418. package/dist/chunks/loadAgentsDir-D7npVvsj.js +0 -1
  419. package/dist/chunks/loadPluginHooks-CaKvZVZI.js +0 -1
  420. package/dist/chunks/localSearch-BU5oulbF.js +0 -1
  421. package/dist/chunks/mcp-B06Mqsur.js +0 -6
  422. package/dist/chunks/mcp-C0AjA07u.js +0 -1
  423. package/dist/chunks/mcp-ghioDl7W.js +0 -2
  424. package/dist/chunks/metadata-CIx5CsoY.js +0 -1
  425. package/dist/chunks/model-BgrLt7P7.js +0 -1
  426. package/dist/chunks/model-aVc5c3Lz.js +0 -1
  427. package/dist/chunks/nativeInstaller-DKe1pWoL.js +0 -1
  428. package/dist/chunks/parser-Bj3gOqFv.js +0 -1
  429. package/dist/chunks/permissions-DB_2mmCl.js +0 -3
  430. package/dist/chunks/pidLock-DchmaAK6.js +0 -3
  431. package/dist/chunks/pluginBlocklist-Cw_l-yal.js +0 -1
  432. package/dist/chunks/pluginCliCommands-BtYWRxhS.js +0 -1
  433. package/dist/chunks/pluginOperations-BOkST1qE.js +0 -2
  434. package/dist/chunks/pluginStartupCheck-XBLJZZys.js +0 -1
  435. package/dist/chunks/plugins-6px6K1fh.js +0 -4
  436. package/dist/chunks/policyLimits-C07tQ0Wr.js +0 -1
  437. package/dist/chunks/pollConfig-C2Ac8WMU.js +0 -1
  438. package/dist/chunks/poorMode-BdBDiOFD.js +0 -1
  439. package/dist/chunks/print-DcQSuK0v.js +0 -23
  440. package/dist/chunks/processBashCommand-CEqA4QZi.js +0 -1
  441. package/dist/chunks/processSlashCommand-DMpFk59M.js +0 -5
  442. package/dist/chunks/prompt-CKvoqUC3.js +0 -1
  443. package/dist/chunks/prompt-aXZPR3q8.js +0 -1
  444. package/dist/chunks/prompt-wys9CwDo.js +0 -132
  445. package/dist/chunks/rcDebugLog-CivJaJ3V.js +0 -11
  446. package/dist/chunks/reconciler-BKX4jh34.js +0 -4
  447. package/dist/chunks/remoteBridgeCore-CmwkjiTK.js +0 -1
  448. package/dist/chunks/remoteManagedSettings-Co-CxR67.js +0 -1
  449. package/dist/chunks/ripgrep-hOjrgpMp.js +0 -1
  450. package/dist/chunks/sandbox-adapter-CO5GuywY.js +0 -1
  451. package/dist/chunks/searchExtraTools-CXZJU2Kv.js +0 -1
  452. package/dist/chunks/sessionFileAccessHooks-BUyIQVzL.js +0 -1
  453. package/dist/chunks/sessionMemory-ZsxCLHYd.js +0 -1
  454. package/dist/chunks/sessionMemory-e6YpTUhW.js +0 -1
  455. package/dist/chunks/sessionMemoryUtils-BD_dqyYB.js +0 -1
  456. package/dist/chunks/sessionObserver-DNItJztR.js +0 -1
  457. package/dist/chunks/sessionStorage-xvxpRETp.js +0 -1
  458. package/dist/chunks/sessionTitle-Bph6GO4F.js +0 -14
  459. package/dist/chunks/settings-BhvhCpVh.js +0 -19
  460. package/dist/chunks/settingsSync-D2B5K4BT.js +0 -1
  461. package/dist/chunks/setup-CEnNEK6Z.js +0 -3
  462. package/dist/chunks/sink-CyKOf5TT.js +0 -1
  463. package/dist/chunks/sink-DxPJ4khU.js +0 -1
  464. package/dist/chunks/sinks-BNo3DvxO.js +0 -2
  465. package/dist/chunks/sinks-CHgtwDha.js +0 -1
  466. package/dist/chunks/skillChangeDetector-BRBCwQ2w.js +0 -1
  467. package/dist/chunks/skillLearning-BH7EAU1m.js +0 -1
  468. package/dist/chunks/src-xRRBgNzF.js +0 -25
  469. package/dist/chunks/startupProfiler-CYCH-qos.js +0 -1
  470. package/dist/chunks/stdio-4S7b8Uhx.js +0 -1
  471. package/dist/chunks/stdio-W_Kokrkh.js +0 -3
  472. package/dist/chunks/teleport-DjIgQeBB.js +0 -1
  473. package/dist/chunks/terminalSetup-nvS3KCDG.js +0 -33
  474. package/dist/chunks/thinkback-BSv_fvbV.js +0 -1
  475. package/dist/chunks/thinkback-play-DNB0IWYt.js +0 -1
  476. package/dist/chunks/toolPool-uQKZRMKg.js +0 -1
  477. package/dist/chunks/trustedDevice-0ej6e3nx.js +0 -1
  478. package/dist/chunks/trustedDevice-nqhuw4tp.js +0 -1
  479. package/dist/chunks/udsClient-CiFj4M_h.js +0 -1
  480. package/dist/chunks/undercover-6UUO38fQ.js +0 -1
  481. package/dist/chunks/updateCCB-B-OlpLjA.js +0 -11
  482. package/dist/chunks/upgrade-DYqlCH80.js +0 -1
  483. package/dist/chunks/upload-BQGByiXE.js +0 -1
  484. package/dist/chunks/usage-DolSCKGi.js +0 -1
  485. package/dist/chunks/useMainLoopModel-cZd8EKo5.js +0 -1
  486. package/dist/chunks/useManagePlugins-DgGZBvXV.js +0 -1
  487. package/dist/chunks/validatePlugin-n8a4W_jI.js +0 -1
  488. package/dist/chunks/windowsPaths-BLevJOlm.js +0 -1
  489. package/dist/chunks/windowsPaths-N_YmYY6k.js +0 -1
  490. package/dist/chunks/worktree-Dr_WzlXs.js +0 -1
@@ -1,25 +0,0 @@
1
- import{I as e,K as t,f as n}from"./stdio-W_Kokrkh.js";import{t as r}from"./lib-BlVGipXx.js";import{n as i,t as a}from"./stdio-4S7b8Uhx.js";import{basename as o,extname as s,join as c}from"node:path";import{chmodSync as l,existsSync as u,mkdirSync as d,readFileSync as f,unlinkSync as ee,writeFileSync as p}from"node:fs";import{homedir as te,tmpdir as m}from"node:os";import{createCipheriv as ne,createDecipheriv as h,createHash as re,randomBytes as g,randomUUID as _}from"node:crypto";var v={NONE:0,USER:1,BOT:2},y={NONE:0,TEXT:1,IMAGE:2,VOICE:3,FILE:4,VIDEO:5},b={NEW:0,GENERATING:1,FINISH:2},x={IMAGE:1,VIDEO:2,FILE:3,VOICE:4},S={TYPING:1,CANCEL:2},ie=`0.1.0`;function C(){return{channel_version:ie}}function ae(){return g(4).toString(`base64`)}function oe(e){let t={"Content-Type":`application/json`,"X-WECHAT-UIN":ae()};return e&&(t.AuthorizationType=`ilink_bot_token`,t.Authorization=`Bearer ${e}`),t}async function w(e,t,n,r,i=4e4,a){let o=new AbortController,s=setTimeout(()=>o.abort(),i);a&&a.addEventListener(`abort`,()=>o.abort(),{once:!0});try{let i=await fetch(`${e}${t}`,{method:`POST`,headers:oe(r),body:JSON.stringify(n),signal:o.signal});if(!i.ok)throw Error(`HTTP ${i.status}: ${i.statusText}`);return await i.json()}finally{clearTimeout(s)}}async function T(e,t,n,r){let i={get_updates_buf:n,base_info:C()};try{return await w(e,`/ilink/bot/getupdates`,i,t,4e4,r)}catch(e){if(e instanceof Error&&e.name===`AbortError`)return{ret:0,msgs:[],get_updates_buf:n};throw e}}async function E(e,t,n){await w(e,`/ilink/bot/sendmessage`,{msg:n,base_info:C()},t)}async function D(e,t,n){return w(e,`/ilink/bot/getuploadurl`,{...n,base_info:C()},t)}async function O(e,t,n,r){return w(e,`/ilink/bot/getconfig`,{ilink_user_id:n,context_token:r,base_info:C()},t)}async function k(e,t,n){return w(e,`/ilink/bot/sendtyping`,{...n,base_info:C()},t)}var A=`https://ilinkai.weixin.qq.com`,j=`https://novac2c.cdn.weixin.qq.com/c2c`;function M(){let e=process.env.WEIXIN_STATE_DIR||c(te(),`.claude`,`channels`,`weixin`);return u(e)||d(e,{recursive:!0}),e}function N(){return c(M(),`account.json`)}function P(){let e=N();if(!u(e))return null;try{return JSON.parse(f(e,`utf-8`))}catch{return null}}function se(e){let t=N();p(t,JSON.stringify(e,null,2),`utf-8`),l(t,384)}function F(){let e=N();u(e)&&ee(e)}var I=r();async function L(e){let t=await(0,I.toString)(e,{type:`terminal`,errorCorrectionLevel:`L`,small:!0});process.stderr.write(`${t}\n`)}async function R(e){let t=await fetch(`${e}/ilink/bot/get_bot_qrcode?bot_type=3`);if(!t.ok)throw Error(`Failed to get QR code: HTTP ${t.status}`);let n=await t.json();if(!n.qrcode)throw Error(`No qrcode in response`);let r=n.qrcode_img_content||``;return r&&await L(r),{qrcodeUrl:r,qrcodeId:n.qrcode,message:`Scan the QR code with WeChat to connect.`}}async function z(e){let{qrcodeId:t,apiBaseUrl:n,timeoutMs:r=48e4,maxRetries:i=3}=e,a=Date.now()+r,o=t,s=0;for(;Date.now()<a;){try{let e=new AbortController,t=setTimeout(()=>e.abort(),6e4),r=await fetch(`${n}/ilink/bot/get_qrcode_status?qrcode=${encodeURIComponent(o)}`,{headers:{"iLink-App-ClientVersion":`1`},signal:e.signal});if(clearTimeout(t),!r.ok)throw Error(`HTTP ${r.status}`);let a=await r.json();switch(a.status){case`confirmed`:return{connected:!0,token:a.bot_token,accountId:a.ilink_bot_id,baseUrl:a.baseurl,userId:a.ilink_user_id,message:`Connected to WeChat successfully!`};case`scaned`:process.stderr.write(`QR code scanned, waiting for confirmation...
2
- `);break;case`expired`:if(s+=1,s>=i)return{connected:!1,message:`QR code expired after maximum retries.`};process.stderr.write(`QR code expired, refreshing...
3
- `),o=(await R(n)).qrcodeId;break;default:break}}catch(e){if(e instanceof Error&&e.name===`AbortError`)continue;throw e}await new Promise(e=>setTimeout(e,1e3))}return{connected:!1,message:`Login timed out.`}}function B(){return c(M(),`access.json`)}function V(){return c(M(),`pending-pairings.json`)}function H(){let e=V();if(!u(e))return{};try{return JSON.parse(f(e,`utf-8`))}catch{return{}}}function U(e){p(V(),JSON.stringify(e,null,2),`utf-8`)}function W(){let e=B();if(!u(e))return{policy:`pairing`,allowFrom:[]};try{return JSON.parse(f(e,`utf-8`))}catch{return{policy:`pairing`,allowFrom:[]}}}function G(e){p(B(),JSON.stringify(e,null,2),`utf-8`)}function K(e){let t=W();return t.policy===`disabled`||t.allowFrom.includes(e)}function ce(e){let t=H(),n=Date.now();for(let e of Object.keys(t))t[e].expiresAt<n&&delete t[e];for(let[n,r]of Object.entries(t))if(r.userId===e)return U(t),n;let r=String(Math.floor(1e5+Math.random()*9e5));return t[r]={userId:e,expiresAt:n+600*1e3},U(t),r}function le(e){let t=H(),n=t[e];if(!n||n.expiresAt<Date.now())return delete t[e],U(t),null;delete t[e],U(t);let r=W();return r.allowFrom.includes(n.userId)||(r.allowFrom.push(n.userId),G(r)),n.userId}function ue(e,t){let n=ne(`aes-128-ecb`,t,null);return Buffer.concat([n.update(e),n.final()])}function de(e,t){let n=h(`aes-128-ecb`,t,null);return Buffer.concat([n.update(e),n.final()])}function fe(e,t){return`${t}/download?encrypted_query_param=${encodeURIComponent(e)}`}function pe(e,t,n){return`${e}/upload?encrypted_query_param=${encodeURIComponent(t)}&filekey=${encodeURIComponent(n)}`}function me(e){let t=Buffer.from(e,`base64`);if(t.length===16)return t;if(t.length===32&&/^[0-9a-fA-F]{32}$/.test(t.toString(`ascii`)))return Buffer.from(t.toString(`ascii`),`hex`);throw Error(`Invalid aes_key: expected 16 raw bytes or 32 hex chars, got ${t.length} bytes`)}async function he(e){let t=fe(e.encryptQueryParam,e.cdnBaseUrl),n=await fetch(t);if(!n.ok)throw Error(`CDN download failed: HTTP ${n.status}`);return de(Buffer.from(await n.arrayBuffer()),me(e.aesKey))}async function ge(e){let t=f(e.filePath),n=t.length,r=re(`md5`).update(t).digest(`hex`),i=g(16),a=g(16).toString(`hex`),s=ue(t,i),c=s.length,l=await D(e.apiBaseUrl,e.token,{filekey:a,media_type:e.mediaType,to_user_id:e.toUserId,rawsize:n,rawfilemd5:r,filesize:c,no_need_thumb:!0,aeskey:i.toString(`hex`)});if(!l.upload_param)throw Error(`No upload_param in response`);let u=pe(e.cdnBaseUrl,l.upload_param,a),d=await fetch(u,{method:`POST`,headers:{"Content-Type":`application/octet-stream`},body:new Uint8Array(s)});if(!d.ok)throw Error(`CDN upload failed: HTTP ${d.status}`);return{encryptQueryParam:d.headers.get(`x-encrypted-param`)||``,aesKey:Buffer.from(i.toString(`hex`)).toString(`base64`),fileSize:c,rawSize:n,fileName:o(e.filePath)}}function _e(e){let t=s(e).toLowerCase();return[`.jpg`,`.jpeg`,`.png`,`.gif`,`.bmp`,`.webp`,`.heic`].includes(t)?x.IMAGE:[`.mp4`,`.mov`,`.avi`,`.mkv`,`.webm`].includes(t)?x.VIDEO:x.FILE}function ve(e){let t=``,n=0;for(;n<e.length;)if(e.startsWith("```",n)){let r=n+3;for(;r<e.length&&e[r]!==`
4
- `;)r++;r<e.length&&r++;let i=r;for(;r<e.length;){if(e.startsWith("```",r)){for(t+=e.slice(i,r),r+=3;r<e.length&&e[r]!==`
5
- `;)r++;r<e.length&&r++;break}r++}r>=e.length&&!e.startsWith("```",r-3)&&(t+=e.slice(n)),n=r}else t+=e[n],n++;return t}function q(e){return ve(e).replace(/`([^`]+)`/g,`$1`).replace(/\*\*\*(.+?)\*\*\*/g,`$1`).replace(/\*\*(.+?)\*\*/g,`$1`).replace(/\*(.+?)\*/g,`$1`).replace(/___(.+?)___/g,`$1`).replace(/__(.+?)__/g,`$1`).replace(/_(.+?)_/g,`$1`).replace(/~~(.+?)~~/g,`$1`).replace(/^#{1,6}\s+/gm,``).replace(/\[([^\]]+)\]\(([^)]+)\)/g,`$1 ($2)`).replace(/!\[([^\]]*)\]\([^)]+\)/g,`[$1]`).replace(/^>\s+/gm,``).replace(/^[-*_]{3,}$/gm,`---`).replace(/^[\s]*[-*+]\s+/gm,`- `).replace(/^[\s]*(\d+)\.\s+/gm,`$1. `).replace(/\n{3,}/g,`
6
-
7
- `).trim()}async function J(e){let t=_();return await E(e.baseUrl,e.token,{to_user_id:e.to,from_user_id:``,client_id:t,message_type:v.BOT,message_state:b.FINISH,context_token:e.contextToken,item_list:[{type:y.TEXT,text_item:{text:q(e.text)}}]}),{messageId:t}}async function ye(e){let t=``;for(let n of e.items)t=_(),await E(e.baseUrl,e.token,{to_user_id:e.to,from_user_id:``,client_id:t,message_type:v.BOT,message_state:b.FINISH,context_token:e.contextToken,item_list:[n]});return t}async function be(e){let t=_e(e.filePath),n=await ge({filePath:e.filePath,toUserId:e.to,mediaType:t,apiBaseUrl:e.baseUrl,token:e.token,cdnBaseUrl:e.cdnBaseUrl}),r={encrypt_query_param:n.encryptQueryParam,aes_key:n.aesKey,encrypt_type:1},i=[];switch(e.text&&i.push({type:y.TEXT,text_item:{text:q(e.text)}}),t){case 1:i.push({type:y.IMAGE,image_item:{media:r,mid_size:n.fileSize}});break;case 2:i.push({type:y.VIDEO,video_item:{media:r,video_size:n.fileSize}});break;default:i.push({type:y.FILE,file_item:{media:r,file_name:n.fileName,len:String(n.rawSize)}});break}return{messageId:await ye({items:i,to:e.to,baseUrl:e.baseUrl,token:e.token,contextToken:e.contextToken})}}var Y=new Map;function xe(e=Date.now()){for(let[t,n]of Y.entries())n.expiresAt<=e&&Y.delete(t)}function Se(e,t){xe();let n=e.toLowerCase(),r=Y.get(n);return!r||r.chatId!==t?null:(Y.delete(n),r)}var Ce=/^\s*(y|yes|n|no)\s+([a-km-z]{5})\s*$/i,X=new Map;function Z(e){return X.get(e)}function Q(){return c(M(),`cursor.txt`)}function we(){let e=Q();return u(e)?f(e,`utf-8`).trim():``}function Te(e){p(Q(),e,`utf-8`)}async function Ee(e,t){let n,r,i=``,a=``;switch(e.type){case y.IMAGE:n=e.image_item?.media?.encrypt_query_param,r=e.image_item?.aeskey?Buffer.from(e.image_item.aeskey,`hex`).toString(`base64`):e.image_item?.media?.aes_key,i=`.jpg`,a=`image`;break;case y.VOICE:n=e.voice_item?.media?.encrypt_query_param,r=e.voice_item?.media?.aes_key,i=`.silk`,a=`voice`;break;case y.FILE:n=e.file_item?.media?.encrypt_query_param,r=e.file_item?.media?.aes_key,i=e.file_item?.file_name?`.${e.file_item.file_name.split(`.`).pop()}`:``,a=`file`;break;case y.VIDEO:n=e.video_item?.media?.encrypt_query_param,r=e.video_item?.media?.aes_key,i=`.mp4`,a=`video`;break;default:return null}if(!n||!r)return null;try{let s=await he({encryptQueryParam:n,aesKey:r,cdnBaseUrl:t}),l=c(m(),`weixin-media`);u(l)||d(l,{recursive:!0});let f=c(l,o(e.file_item?.file_name||`${Date.now()}${i}`));return p(f,s),{path:f,type:a}}catch(e){return process.stderr.write(`[weixin] Failed to download media: ${e}\n`),null}}function De(e){let t=e.match(Ce);if(!t)return null;let n=t[1]?.toLowerCase().startsWith(`y`)?`allow`:`deny`,r=t[2]?.toLowerCase();return r?{requestId:r,behavior:n}:null}async function Oe(e){let{baseUrl:t,cdnBaseUrl:n,token:r,onMessage:i,onPermissionResponse:a,abortSignal:o}=e,s=we(),c=0;for(process.stderr.write(`[weixin] Starting message poll loop...
8
- `);!o.aborted;)try{let e=await T(t,r,s,o);if(e.errcode===-14){process.stderr.write(`[weixin] Session expired (errcode -14). Pausing for 30s...
9
- `),await new Promise(e=>setTimeout(e,3e4));continue}if(e.ret!==0&&e.ret!==void 0)throw Error(`getUpdates error: ret=${e.ret} errcode=${e.errcode} ${e.errmsg}`);if(c=0,e.get_updates_buf&&(s=e.get_updates_buf,Te(s)),e.msgs&&e.msgs.length>0)for(let o of e.msgs)await ke(o,{baseUrl:t,cdnBaseUrl:n,token:r,onMessage:i,onPermissionResponse:a})}catch(e){if(o.aborted)break;c+=1,process.stderr.write(`[weixin] Poll error (${c}): ${e instanceof Error?e.message:String(e)}\n`),c>=3?(process.stderr.write(`[weixin] Too many consecutive errors, backing off 30s...
10
- `),await new Promise(e=>setTimeout(e,3e4)),c=0):await new Promise(e=>setTimeout(e,2e3))}process.stderr.write(`[weixin] Poll loop stopped.
11
- `)}async function ke(e,t){if(e.message_type!==v.USER)return;let n=e.from_user_id;if(!n)return;if(e.context_token&&X.set(n,e.context_token),!K(n)){let r=ce(n);try{await J({to:n,text:`Your pairing code is: ${r}\n\nAsk the operator to confirm:\nccb weixin access pair ${r}`,baseUrl:t.baseUrl,token:t.token,contextToken:e.context_token||``})}catch(e){process.stderr.write(`[weixin] Failed to send pairing code: ${e}\n`)}return}e.context_token;let r=``,i,a;if(e.item_list){for(let n of e.item_list)if(n.type===y.TEXT&&n.text_item?.text)r+=`${r?`
12
- `:``}${n.text_item.text}`;else if(n.type===y.IMAGE||n.type===y.VOICE||n.type===y.FILE||n.type===y.VIDEO){let e=await Ee(n,t.cdnBaseUrl);e&&(i=e.path,a=e.type),n.type===y.VOICE&&n.voice_item?.text&&(r+=`${r?`
13
- `:``}[Voice transcription]: ${n.voice_item.text}`)}}if(!(!r&&!i)){if(r&&t.onPermissionResponse){let e=De(r);if(e){let r=Se(e.requestId,n);if(r){await t.onPermissionResponse({requestId:r.request_id,behavior:e.behavior,fromUserId:n});return}}}await t.onMessage({fromUserId:n,messageId:String(e.message_id||``),text:r||`(media attachment)`,attachmentPath:i,attachmentType:a})}}t();function Ae(t){let r=new i({name:`weixin`,version:t},{capabilities:{experimental:{"claude/channel":{}},tools:{}},instructions:`Messages from WeChat arrive as <channel source="plugin:weixin:weixin" chat_id="..." sender_id="...">. Reply using the reply tool with the chat_id from the channel tag. Use absolute paths for file attachments.`});return r.setRequestHandler(e,async()=>({tools:[{name:`reply`,description:`Reply to a WeChat message. Pass the chat_id from the channel tag.`,inputSchema:{type:`object`,properties:{chat_id:{type:`string`,description:`The chat_id from the channel notification`},text:{type:`string`,description:`The reply text`},files:{type:`array`,items:{type:`string`},description:`Optional absolute file paths to attach`}},required:[`chat_id`,`text`]}},{name:`send_typing`,description:`Send a typing indicator to a WeChat user.`,inputSchema:{type:`object`,properties:{chat_id:{type:`string`,description:`The chat_id (user ID)`}},required:[`chat_id`]}}]})),r.setRequestHandler(n,async e=>{let{name:t,arguments:n}=e.params,r=P();if(!r)return{content:[{type:`text`,text:"WeChat not connected. Run `ccb weixin login` first."}],isError:!0};let i=r.baseUrl||`https://ilinkai.weixin.qq.com`,a=j;switch(t){case`reply`:{let e=typeof n?.chat_id==`string`?n.chat_id:``,t=typeof n?.text==`string`?n.text:``,o=Array.isArray(n?.files)?n.files.filter(e=>typeof e==`string`):void 0;if(!e||!t)return{content:[{type:`text`,text:`Missing chat_id or text parameter.`}],isError:!0};let s=Z(e)||``;try{if(o&&o.length>0){for(let[n,c]of o.entries()){if(!u(c))return{content:[{type:`text`,text:`File not found: ${c}`}],isError:!0};await be({filePath:c,to:e,text:n===0?t:``,baseUrl:i,token:r.token,contextToken:s,cdnBaseUrl:a})}return{content:[{type:`text`,text:`Message sent with attachments.`}]}}return await J({to:e,text:t,baseUrl:i,token:r.token,contextToken:s}),{content:[{type:`text`,text:`Message sent.`}]}}catch(e){return{content:[{type:`text`,text:`Failed to send: ${e}`}],isError:!0}}}case`send_typing`:{let e=typeof n?.chat_id==`string`?n.chat_id:``;if(!e)return{content:[{type:`text`,text:`Missing chat_id parameter.`}],isError:!0};try{let t=Z(e),n=await O(i,r.token,e,t);return n.typing_ticket&&await k(i,r.token,{ilink_user_id:e,typing_ticket:n.typing_ticket,status:S.TYPING}),{content:[{type:`text`,text:`Typing indicator sent.`}]}}catch(e){return{content:[{type:`text`,text:`Failed to send typing: ${e}`}],isError:!0}}}default:return{content:[{type:`text`,text:`Unknown tool: ${t}`}],isError:!0}}}),r}async function je(e,t){t.enableConfigs(),t.initializeAnalyticsSink();let n=P();n||(process.stderr.write("[weixin] No account configured. Run `ccb weixin login` to connect your WeChat account.\n"),await Promise.all([t.shutdown1PEventLogging(),t.shutdownDatadog()]),process.exit(1));let r=Ae(e),i=new a;await r.connect(i);let o=n.baseUrl||`https://ilinkai.weixin.qq.com`,s=new AbortController,c=!1,l=async()=>{c||(c=!0,s.signal.aborted||s.abort(),await Promise.all([t.shutdown1PEventLogging(),t.shutdownDatadog()]),process.exit(0))};process.stdin.on(`end`,()=>void l()),process.stdin.on(`error`,()=>void l()),process.on(`SIGINT`,()=>void l()),process.on(`SIGTERM`,()=>void l()),process.on(`SIGHUP`,()=>void l());let u=process.ppid,d=setInterval(()=>{try{process.kill(u,0)}catch{process.stderr.write(`[weixin] Parent process exited, shutting down...
14
- `),clearInterval(d),l()}},5e3);t.logForDebugging(`[Weixin MCP] Starting poll loop`),await Oe({baseUrl:o,cdnBaseUrl:j,token:n.token,onMessage:async e=>{await r.notification({method:`notifications/claude/channel`,params:{content:e.text,meta:{chat_id:e.fromUserId,sender_id:e.fromUserId,message_id:e.messageId,...e.attachmentPath&&{attachment_path:e.attachmentPath},...e.attachmentType&&{attachment_type:e.attachmentType}}}})},onPermissionResponse:async e=>{await r.notification({method:`notifications/claude/channel/permission`,params:{request_id:e.requestId,behavior:e.behavior}})},abortSignal:s.signal}),clearInterval(d),await l()}function $(){process.stdout.write([`Usage:`,` ccb weixin serve`,` ccb weixin login`,` ccb weixin login clear`,` ccb weixin access pair <code>`,``,`Session enablement:`,` ccb --channels plugin:weixin@builtin`].join(`
15
- `)+`
16
- `)}async function Me(e=!1){if(e){F(),process.stdout.write(`WeChat account cleared.
17
- `);return}let t=P();if(t){process.stdout.write([`Already connected:`,` User ID: ${t.userId||`unknown`}`,` Connected since: ${t.savedAt}`,``,"Run `ccb weixin login clear` to disconnect.",`Restart Claude Code with:`,` ccb --channels plugin:weixin@builtin`].join(`
18
- `)+`
19
- `);return}process.stdout.write(`Starting WeChat QR login...
20
-
21
- `);let n=await R(A);process.stdout.write(`\nScan the QR code above with WeChat, or open this URL:\n${n.qrcodeUrl||``}\n\n`);let r=await z({qrcodeId:n.qrcodeId,apiBaseUrl:A});(!r.connected||!r.token)&&(process.stderr.write(`Login failed: ${r.message}\n`),process.exit(1)),se({token:r.token,baseUrl:r.baseUrl||`https://ilinkai.weixin.qq.com`,userId:r.userId,savedAt:new Date().toISOString()}),process.stdout.write([`Connected successfully!`,` User ID: ${r.userId||`unknown`}`,` Base URL: ${r.baseUrl||`https://ilinkai.weixin.qq.com`}`,``,`Restart Claude Code with:`,` ccb --channels plugin:weixin@builtin`].join(`
22
- `)+`
23
- `)}function Ne(e){(e[0]!==`pair`||!e[1])&&($(),process.exit(1));let t=le(e[1]);t||(process.stderr.write(`Invalid or expired pairing code.
24
- `),process.exit(1)),process.stdout.write(`Paired successfully: ${t}\n`)}async function Pe(e,t,n){let[r,...i]=e;switch(r){case`serve`:t||(process.stderr.write(`[weixin] serve handler not available in this context.
25
- `),process.exit(1)),await je(n??`0.0.0`,t);return;case`login`:await Me(i[0]===`clear`);return;case`access`:Ne(i);return;default:$()}}export{Pe as handleWeixinCli};
@@ -1 +0,0 @@
1
- import{i as e,n as t}from"./startupProfiler-BquH_Yqm.js";t();export{e as profileCheckpoint};
@@ -1 +0,0 @@
1
- import{$ as e,C as t,D as n,F as r,K as i,Q as a,R as o,S as s,T as c,U as l,W as u,X as d,Z as f,_ as p,a as m,b as h,c as g,d as _,f as v,g as y,i as b,k as x,l as S,n as C,o as w,p as T,r as E,s as D,t as O,u as k,v as A,z as j}from"./stdio-W_Kokrkh.js";import M from"node:process";f(),k(),g(),i();var N=class{constructor(e){this._server=e}requestStream(e,t,n){return this._server.requestStream(e,t,n)}createMessageStream(e,t){let n=this._server.getClientCapabilities();if((e.tools||e.toolChoice)&&!n?.sampling?.tools)throw Error(`Client does not support sampling tools capability.`);if(e.messages.length>0){let t=e.messages[e.messages.length-1],n=Array.isArray(t.content)?t.content:[t.content],r=n.some(e=>e.type===`tool_result`),i=e.messages.length>1?e.messages[e.messages.length-2]:void 0,a=i?Array.isArray(i.content)?i.content:[i.content]:[],o=a.some(e=>e.type===`tool_use`);if(r){if(n.some(e=>e.type!==`tool_result`))throw Error(`The last message must contain only tool_result content if any is present`);if(!o)throw Error(`tool_result blocks are not matching any tool_use from the previous message`)}if(o){let e=new Set(a.filter(e=>e.type===`tool_use`).map(e=>e.id)),t=new Set(n.filter(e=>e.type===`tool_result`).map(e=>e.toolUseId));if(e.size!==t.size||![...e].every(e=>t.has(e)))throw Error(`ids of tool_result blocks and tool_use blocks from previous message do not match`)}}return this.requestStream({method:`sampling/createMessage`,params:e},y,t)}elicitInputStream(e,t){let n=this._server.getClientCapabilities(),r=e.mode??`form`;switch(r){case`url`:if(!n?.elicitation?.url)throw Error(`Client does not support url elicitation.`);break;case`form`:if(!n?.elicitation?.form)throw Error(`Client does not support form elicitation.`);break}let i=r===`form`&&e.mode===void 0?{...e,mode:`form`}:e;return this.requestStream({method:`elicitation/create`,params:i},h,t)}async getTask(e,t){return this._server.getTask({taskId:e},t)}async getTaskResult(e,t,n){return this._server.getTaskResult({taskId:e},t,n)}async listTasks(e,t){return this._server.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._server.cancelTask({taskId:e},t)}};i(),w();var P=class extends S{constructor(e,t){super(t),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(o.options.map((e,t)=>[e,t])),this.isMessageIgnored=(e,t)=>{let n=this._loggingLevels.get(t);return n?this.LOG_LEVEL_SEVERITY.get(e)<this.LOG_LEVEL_SEVERITY.get(n):!1},this._capabilities=t?.capabilities??{},this._instructions=t?.instructions,this._jsonSchemaValidator=t?.jsonSchemaValidator??new D,this.setRequestHandler(c,e=>this._oninitialize(e)),this.setNotificationHandler(n,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(u,async(e,t)=>{let n=t.sessionId||t.requestInfo?.headers[`mcp-session-id`]||void 0,{level:r}=e.params,i=o.safeParse(r);return i.success&&this._loggingLevels.set(n,i.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new N(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw Error(`Cannot register capabilities after connecting to transport`);this._capabilities=_(this._capabilities,e)}setRequestHandler(n,r){let i=d(n)?.method;if(!i)throw Error(`Schema is missing a method literal`);let o;if(a(i)){let e=i;o=e._zod?.def?.value??e.value}else{let e=i;o=e._def?.value??e.value}if(typeof o!=`string`)throw Error(`Schema method literal must be a string`);return o===`tools/call`?super.setRequestHandler(n,async(n,i)=>{let a=e(v,n);if(!a.success){let e=a.error instanceof Error?a.error.message:String(a.error);throw new j(t.InvalidParams,`Invalid tools/call request: ${e}`)}let{params:o}=a.data,s=await Promise.resolve(r(n,i));if(o.task){let n=e(A,s);if(!n.success){let e=n.error instanceof Error?n.error.message:String(n.error);throw new j(t.InvalidParams,`Invalid task creation result: ${e}`)}return n.data}let c=e(T,s);if(!c.success){let e=c.error instanceof Error?c.error.message:String(c.error);throw new j(t.InvalidParams,`Invalid tools/call result: ${e}`)}return c.data}):super.setRequestHandler(n,r)}assertCapabilityForMethod(e){switch(e){case`sampling/createMessage`:if(!this._clientCapabilities?.sampling)throw Error(`Client does not support sampling (required for ${e})`);break;case`elicitation/create`:if(!this._clientCapabilities?.elicitation)throw Error(`Client does not support elicitation (required for ${e})`);break;case`roots/list`:if(!this._clientCapabilities?.roots)throw Error(`Client does not support listing roots (required for ${e})`);break;case`ping`:break}}assertNotificationCapability(e){switch(e){case`notifications/message`:if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${e})`);break;case`notifications/resources/updated`:case`notifications/resources/list_changed`:if(!this._capabilities.resources)throw Error(`Server does not support notifying about resources (required for ${e})`);break;case`notifications/tools/list_changed`:if(!this._capabilities.tools)throw Error(`Server does not support notifying of tool list changes (required for ${e})`);break;case`notifications/prompts/list_changed`:if(!this._capabilities.prompts)throw Error(`Server does not support notifying of prompt list changes (required for ${e})`);break;case`notifications/elicitation/complete`:if(!this._clientCapabilities?.elicitation?.url)throw Error(`Client does not support URL elicitation (required for ${e})`);break;case`notifications/cancelled`:break;case`notifications/progress`:break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case`completion/complete`:if(!this._capabilities.completions)throw Error(`Server does not support completions (required for ${e})`);break;case`logging/setLevel`:if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${e})`);break;case`prompts/get`:case`prompts/list`:if(!this._capabilities.prompts)throw Error(`Server does not support prompts (required for ${e})`);break;case`resources/list`:case`resources/templates/list`:case`resources/read`:if(!this._capabilities.resources)throw Error(`Server does not support resources (required for ${e})`);break;case`tools/call`:case`tools/list`:if(!this._capabilities.tools)throw Error(`Server does not support tools (required for ${e})`);break;case`tasks/get`:case`tasks/list`:case`tasks/result`:case`tasks/cancel`:if(!this._capabilities.tasks)throw Error(`Server does not support tasks capability (required for ${e})`);break;case`ping`:case`initialize`:break}}assertTaskCapability(e){b(this._clientCapabilities?.tasks?.requests,e,`Client`)}assertTaskHandlerCapability(e){this._capabilities&&m(this._capabilities.tasks?.requests,e,`Server`)}async _oninitialize(e){let t=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:l.includes(t)?t:x,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:`ping`},s)}async createMessage(e,t){if((e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw Error(`Client does not support sampling tools capability.`);if(e.messages.length>0){let t=e.messages[e.messages.length-1],n=Array.isArray(t.content)?t.content:[t.content],r=n.some(e=>e.type===`tool_result`),i=e.messages.length>1?e.messages[e.messages.length-2]:void 0,a=i?Array.isArray(i.content)?i.content:[i.content]:[],o=a.some(e=>e.type===`tool_use`);if(r){if(n.some(e=>e.type!==`tool_result`))throw Error(`The last message must contain only tool_result content if any is present`);if(!o)throw Error(`tool_result blocks are not matching any tool_use from the previous message`)}if(o){let e=new Set(a.filter(e=>e.type===`tool_use`).map(e=>e.id)),t=new Set(n.filter(e=>e.type===`tool_result`).map(e=>e.toolUseId));if(e.size!==t.size||![...e].every(e=>t.has(e)))throw Error(`ids of tool_result blocks and tool_use blocks from previous message do not match`)}}return e.tools?this.request({method:`sampling/createMessage`,params:e},p,t):this.request({method:`sampling/createMessage`,params:e},y,t)}async elicitInput(e,n){switch(e.mode??`form`){case`url`:{if(!this._clientCapabilities?.elicitation?.url)throw Error(`Client does not support url elicitation.`);let t=e;return this.request({method:`elicitation/create`,params:t},h,n)}case`form`:{if(!this._clientCapabilities?.elicitation?.form)throw Error(`Client does not support form elicitation.`);let r=e.mode===`form`?e:{...e,mode:`form`},i=await this.request({method:`elicitation/create`,params:r},h,n);if(i.action===`accept`&&i.content&&r.requestedSchema)try{let e=this._jsonSchemaValidator.getValidator(r.requestedSchema)(i.content);if(!e.valid)throw new j(t.InvalidParams,`Elicitation response content does not match requested schema: ${e.errorMessage}`)}catch(e){throw e instanceof j?e:new j(t.InternalError,`Error validating elicitation response: ${e instanceof Error?e.message:String(e)}`)}return i}}}createElicitationCompletionNotifier(e,t){if(!this._clientCapabilities?.elicitation?.url)throw Error(`Client does not support URL elicitation (required for notifications/elicitation/complete)`);return()=>this.notification({method:`notifications/elicitation/complete`,params:{elicitationId:e}},t)}async listRoots(e,t){return this.request({method:`roots/list`,params:e},r,t)}async sendLoggingMessage(e,t){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,t))return this.notification({method:`notifications/message`,params:e})}async sendResourceUpdated(e){return this.notification({method:`notifications/resources/updated`,params:e})}async sendResourceListChanged(){return this.notification({method:`notifications/resources/list_changed`})}async sendToolListChanged(){return this.notification({method:`notifications/tools/list_changed`})}async sendPromptListChanged(){return this.notification({method:`notifications/prompts/list_changed`})}};C();var F=class{constructor(e=M.stdin,t=M.stdout){this._stdin=e,this._stdout=t,this._readBuffer=new O,this._started=!1,this._ondata=e=>{this._readBuffer.append(e),this.processReadBuffer()},this._onerror=e=>{this.onerror?.(e)}}async start(){if(this._started)throw Error(`StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.`);this._started=!0,this._stdin.on(`data`,this._ondata),this._stdin.on(`error`,this._onerror)}processReadBuffer(){for(;;)try{let e=this._readBuffer.readMessage();if(e===null)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}async close(){this._stdin.off(`data`,this._ondata),this._stdin.off(`error`,this._onerror),this._stdin.listenerCount(`data`)===0&&this._stdin.pause(),this._readBuffer.clear(),this.onclose?.()}send(e){return new Promise(t=>{let n=E(e);this._stdout.write(n)?t():this._stdout.once(`drain`,t)})}};export{P as n,F as t};
@@ -1,3 +0,0 @@
1
- import{n as e,o as t,t as n}from"./rolldown-runtime-DaDcL9Zw.js";import{A as r,C as i,D as a,H as o,I as s,M as c,O as l,R as u,T as d,b as f,g as p,h as m,j as h,l as g,m as _,p as v,t as ee,u as te,v as ne,w as y,x as b}from"./v4-jw6qOKwQ.js";import{n as x,t as re}from"./ajv-5vMo9UcX.js";var ie=e((()=>{u()})),ae=e((()=>{})),oe=e((()=>{})),se=e((()=>{ie(),ae(),oe(),ae()})),ce=e((()=>{se()}));function S(e){return!!e._zod}function le(e,t){return S(e)?o(e,t):e.safeParse(t)}function ue(e){if(!e)return;let t;if(t=S(e)?e._zod?.def?.shape:e.shape,t){if(typeof t==`function`)try{return t()}catch{return}return t}}function de(e){if(S(e)){let t=e._zod?.def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}}let t=e._def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}let n=e.value;if(n!==void 0)return n}var fe=e((()=>{ce()})),pe,me,C,w,he,ge,_e,ve,T,E,D,ye,O,k,A,j,M,be,xe,Se,Ce,N,P,F,we,Te,Ee,I,De,L,Oe,R,z,ke,Ae,je,Me,Ne,Pe,Fe,Ie,Le,Re,B,ze,V,Be,Ve,H,He,U,W,Ue,G,K,We,q,J,Ge,Ke,qe,Je,Ye,Xe,Ze,Qe,$e,et,Y,X,tt,nt,rt,it,at,ot,st,ct,lt,ut,dt,ft,pt,mt,ht,gt,_t,vt,yt,bt,xt,St,Ct,wt,Tt,Et,Dt,Ot,kt,At,jt,Mt,Nt,Pt,Ft,It,Lt,Rt,zt,Bt,Vt,Ht,Ut,Wt,Gt,Kt,qt,Jt,Yt,Xt,Zt,Qt,$t,Z,en,tn,nn,rn,an,on,sn,cn,ln,un,dn,fn,pn,mn,hn,gn,_n,vn,yn,bn,xn,Sn,Cn,wn,Tn,En,Dn,On,kn,An,jn,Mn,Nn,Q,Pn,Fn=e((()=>{ee(),pe=`2025-11-25`,me=[pe,`2025-06-18`,`2025-03-26`,`2024-11-05`,`2024-10-07`],C=`io.modelcontextprotocol/related-task`,w=m(e=>e!==null&&(typeof e==`object`||typeof e==`function`)),he=h([r(),i().int()]),ge=r(),b({ttl:i().optional(),pollInterval:i().optional()}),_e=y({ttl:i().optional()}),ve=y({taskId:r()}),T=b({progressToken:he.optional(),[C]:ve.optional()}),E=y({_meta:T.optional()}),D=E.extend({task:_e.optional()}),ye=e=>D.safeParse(e).success,O=y({method:r(),params:E.loose().optional()}),k=y({_meta:T.optional()}),A=y({method:r(),params:k.loose().optional()}),j=b({_meta:T.optional()}),M=h([r(),i().int()]),be=y({jsonrpc:f(`2.0`),id:M,...O.shape}).strict(),xe=e=>be.safeParse(e).success,Se=y({jsonrpc:f(`2.0`),...A.shape}).strict(),Ce=e=>Se.safeParse(e).success,N=y({jsonrpc:f(`2.0`),id:M,result:j}).strict(),P=e=>N.safeParse(e).success,(function(e){e[e.ConnectionClosed=-32e3]=`ConnectionClosed`,e[e.RequestTimeout=-32001]=`RequestTimeout`,e[e.ParseError=-32700]=`ParseError`,e[e.InvalidRequest=-32600]=`InvalidRequest`,e[e.MethodNotFound=-32601]=`MethodNotFound`,e[e.InvalidParams=-32602]=`InvalidParams`,e[e.InternalError=-32603]=`InternalError`,e[e.UrlElicitationRequired=-32042]=`UrlElicitationRequired`})(F||(F={})),we=y({jsonrpc:f(`2.0`),id:M.optional(),error:y({code:i().int(),message:r(),data:c().optional()})}).strict(),Te=e=>we.safeParse(e).success,Ee=h([be,Se,N,we]),h([N,we]),I=j.strict(),De=k.extend({requestId:M.optional(),reason:r().optional()}),L=A.extend({method:f(`notifications/cancelled`),params:De}),Oe=y({src:r(),mimeType:r().optional(),sizes:v(r()).optional(),theme:g([`light`,`dark`]).optional()}),R=y({icons:v(Oe).optional()}),z=y({name:r(),title:r().optional()}),ke=z.extend({...z.shape,...R.shape,version:r(),websiteUrl:r().optional(),description:r().optional()}),Ae=ne(y({applyDefaults:_().optional()}),l(r(),c())),je=a(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,ne(y({form:Ae.optional(),url:w.optional()}),l(r(),c()).optional())),Me=b({list:w.optional(),cancel:w.optional(),requests:b({sampling:b({createMessage:w.optional()}).optional(),elicitation:b({create:w.optional()}).optional()}).optional()}),Ne=b({list:w.optional(),cancel:w.optional(),requests:b({tools:b({call:w.optional()}).optional()}).optional()}),Pe=y({experimental:l(r(),w).optional(),sampling:y({context:w.optional(),tools:w.optional()}).optional(),elicitation:je.optional(),roots:y({listChanged:_().optional()}).optional(),tasks:Me.optional(),extensions:l(r(),w).optional()}),Fe=E.extend({protocolVersion:r(),capabilities:Pe,clientInfo:ke}),Ie=O.extend({method:f(`initialize`),params:Fe}),Le=y({experimental:l(r(),w).optional(),logging:w.optional(),completions:w.optional(),prompts:y({listChanged:_().optional()}).optional(),resources:y({subscribe:_().optional(),listChanged:_().optional()}).optional(),tools:y({listChanged:_().optional()}).optional(),tasks:Ne.optional(),extensions:l(r(),w).optional()}),Re=j.extend({protocolVersion:r(),capabilities:Le,serverInfo:ke,instructions:r().optional()}),B=A.extend({method:f(`notifications/initialized`),params:k.optional()}),ze=e=>B.safeParse(e).success,V=O.extend({method:f(`ping`),params:E.optional()}),Be=y({progress:i(),total:d(i()),message:d(r())}),Ve=y({...k.shape,...Be.shape,progressToken:he}),H=A.extend({method:f(`notifications/progress`),params:Ve}),He=E.extend({cursor:ge.optional()}),U=O.extend({params:He.optional()}),W=j.extend({nextCursor:ge.optional()}),Ue=g([`working`,`input_required`,`completed`,`failed`,`cancelled`]),G=y({taskId:r(),status:Ue,ttl:h([i(),te()]),createdAt:r(),lastUpdatedAt:r(),pollInterval:d(i()),statusMessage:d(r())}),K=j.extend({task:G}),We=k.merge(G),q=A.extend({method:f(`notifications/tasks/status`),params:We}),J=O.extend({method:f(`tasks/get`),params:E.extend({taskId:r()})}),Ge=j.merge(G),Ke=O.extend({method:f(`tasks/result`),params:E.extend({taskId:r()})}),j.loose(),qe=U.extend({method:f(`tasks/list`)}),Je=W.extend({tasks:v(G)}),Ye=O.extend({method:f(`tasks/cancel`),params:E.extend({taskId:r()})}),Xe=j.merge(G),Ze=y({uri:r(),mimeType:d(r()),_meta:l(r(),c()).optional()}),Qe=Ze.extend({text:r()}),$e=r().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),et=Ze.extend({blob:$e}),Y=g([`user`,`assistant`]),X=y({audience:v(Y).optional(),priority:i().min(0).max(1).optional(),lastModified:s({offset:!0}).optional()}),tt=y({...z.shape,...R.shape,uri:r(),description:d(r()),mimeType:d(r()),size:d(i()),annotations:X.optional(),_meta:d(b({}))}),nt=y({...z.shape,...R.shape,uriTemplate:r(),description:d(r()),mimeType:d(r()),annotations:X.optional(),_meta:d(b({}))}),rt=U.extend({method:f(`resources/list`)}),it=W.extend({resources:v(tt)}),at=U.extend({method:f(`resources/templates/list`)}),ot=W.extend({resourceTemplates:v(nt)}),st=E.extend({uri:r()}),ct=st,lt=O.extend({method:f(`resources/read`),params:ct}),ut=j.extend({contents:v(h([Qe,et]))}),dt=A.extend({method:f(`notifications/resources/list_changed`),params:k.optional()}),ft=st,pt=O.extend({method:f(`resources/subscribe`),params:ft}),mt=st,ht=O.extend({method:f(`resources/unsubscribe`),params:mt}),gt=k.extend({uri:r()}),_t=A.extend({method:f(`notifications/resources/updated`),params:gt}),vt=y({name:r(),description:d(r()),required:d(_())}),yt=y({...z.shape,...R.shape,description:d(r()),arguments:d(v(vt)),_meta:d(b({}))}),bt=U.extend({method:f(`prompts/list`)}),xt=W.extend({prompts:v(yt)}),St=E.extend({name:r(),arguments:l(r(),r()).optional()}),Ct=O.extend({method:f(`prompts/get`),params:St}),wt=y({type:f(`text`),text:r(),annotations:X.optional(),_meta:l(r(),c()).optional()}),Tt=y({type:f(`image`),data:$e,mimeType:r(),annotations:X.optional(),_meta:l(r(),c()).optional()}),Et=y({type:f(`audio`),data:$e,mimeType:r(),annotations:X.optional(),_meta:l(r(),c()).optional()}),Dt=y({type:f(`tool_use`),name:r(),id:r(),input:l(r(),c()),_meta:l(r(),c()).optional()}),Ot=y({type:f(`resource`),resource:h([Qe,et]),annotations:X.optional(),_meta:l(r(),c()).optional()}),kt=tt.extend({type:f(`resource_link`)}),At=h([wt,Tt,Et,kt,Ot]),jt=y({role:Y,content:At}),Mt=j.extend({description:r().optional(),messages:v(jt)}),Nt=A.extend({method:f(`notifications/prompts/list_changed`),params:k.optional()}),Pt=y({title:r().optional(),readOnlyHint:_().optional(),destructiveHint:_().optional(),idempotentHint:_().optional(),openWorldHint:_().optional()}),Ft=y({taskSupport:g([`required`,`optional`,`forbidden`]).optional()}),It=y({...z.shape,...R.shape,description:r().optional(),inputSchema:y({type:f(`object`),properties:l(r(),w).optional(),required:v(r()).optional()}).catchall(c()),outputSchema:y({type:f(`object`),properties:l(r(),w).optional(),required:v(r()).optional()}).catchall(c()).optional(),annotations:Pt.optional(),execution:Ft.optional(),_meta:l(r(),c()).optional()}),Lt=U.extend({method:f(`tools/list`)}),Rt=W.extend({tools:v(It)}),zt=j.extend({content:v(At).default([]),structuredContent:l(r(),c()).optional(),isError:_().optional()}),zt.or(j.extend({toolResult:c()})),Bt=D.extend({name:r(),arguments:l(r(),c()).optional()}),Vt=O.extend({method:f(`tools/call`),params:Bt}),Ht=A.extend({method:f(`notifications/tools/list_changed`),params:k.optional()}),Ut=y({autoRefresh:_().default(!0),debounceMs:i().int().nonnegative().default(300)}),Wt=g([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),Gt=E.extend({level:Wt}),Kt=O.extend({method:f(`logging/setLevel`),params:Gt}),qt=k.extend({level:Wt,logger:r().optional(),data:c()}),Jt=A.extend({method:f(`notifications/message`),params:qt}),Yt=y({name:r().optional()}),Xt=y({hints:v(Yt).optional(),costPriority:i().min(0).max(1).optional(),speedPriority:i().min(0).max(1).optional(),intelligencePriority:i().min(0).max(1).optional()}),Zt=y({mode:g([`auto`,`required`,`none`]).optional()}),Qt=y({type:f(`tool_result`),toolUseId:r().describe(`The unique identifier for the corresponding tool call.`),content:v(At).default([]),structuredContent:y({}).loose().optional(),isError:_().optional(),_meta:l(r(),c()).optional()}),$t=p(`type`,[wt,Tt,Et]),Z=p(`type`,[wt,Tt,Et,Dt,Qt]),en=y({role:Y,content:h([Z,v(Z)]),_meta:l(r(),c()).optional()}),tn=D.extend({messages:v(en),modelPreferences:Xt.optional(),systemPrompt:r().optional(),includeContext:g([`none`,`thisServer`,`allServers`]).optional(),temperature:i().optional(),maxTokens:i().int(),stopSequences:v(r()).optional(),metadata:w.optional(),tools:v(It).optional(),toolChoice:Zt.optional()}),nn=O.extend({method:f(`sampling/createMessage`),params:tn}),rn=j.extend({model:r(),stopReason:d(g([`endTurn`,`stopSequence`,`maxTokens`]).or(r())),role:Y,content:$t}),an=j.extend({model:r(),stopReason:d(g([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(r())),role:Y,content:h([Z,v(Z)])}),on=y({type:f(`boolean`),title:r().optional(),description:r().optional(),default:_().optional()}),sn=y({type:f(`string`),title:r().optional(),description:r().optional(),minLength:i().optional(),maxLength:i().optional(),format:g([`email`,`uri`,`date`,`date-time`]).optional(),default:r().optional()}),cn=y({type:g([`number`,`integer`]),title:r().optional(),description:r().optional(),minimum:i().optional(),maximum:i().optional(),default:i().optional()}),ln=y({type:f(`string`),title:r().optional(),description:r().optional(),enum:v(r()),default:r().optional()}),un=y({type:f(`string`),title:r().optional(),description:r().optional(),oneOf:v(y({const:r(),title:r()})),default:r().optional()}),dn=y({type:f(`string`),title:r().optional(),description:r().optional(),enum:v(r()),enumNames:v(r()).optional(),default:r().optional()}),fn=h([ln,un]),pn=y({type:f(`array`),title:r().optional(),description:r().optional(),minItems:i().optional(),maxItems:i().optional(),items:y({type:f(`string`),enum:v(r())}),default:v(r()).optional()}),mn=y({type:f(`array`),title:r().optional(),description:r().optional(),minItems:i().optional(),maxItems:i().optional(),items:y({anyOf:v(y({const:r(),title:r()}))}),default:v(r()).optional()}),hn=h([pn,mn]),gn=h([dn,fn,hn]),_n=h([gn,on,sn,cn]),vn=D.extend({mode:f(`form`).optional(),message:r(),requestedSchema:y({type:f(`object`),properties:l(r(),_n),required:v(r()).optional()})}),yn=D.extend({mode:f(`url`),message:r(),elicitationId:r(),url:r().url()}),bn=h([vn,yn]),xn=O.extend({method:f(`elicitation/create`),params:bn}),Sn=k.extend({elicitationId:r()}),Cn=A.extend({method:f(`notifications/elicitation/complete`),params:Sn}),wn=j.extend({action:g([`accept`,`decline`,`cancel`]),content:a(e=>e===null?void 0:e,l(r(),h([r(),i(),_(),v(r())])).optional())}),Tn=y({type:f(`ref/resource`),uri:r()}),En=y({type:f(`ref/prompt`),name:r()}),Dn=E.extend({ref:h([En,Tn]),argument:y({name:r(),value:r()}),context:y({arguments:l(r(),r()).optional()}).optional()}),On=O.extend({method:f(`completion/complete`),params:Dn}),kn=j.extend({completion:b({values:v(r()).max(100),total:d(i().int()),hasMore:d(_())})}),An=y({uri:r().startsWith(`file://`),name:r().optional(),_meta:l(r(),c()).optional()}),jn=O.extend({method:f(`roots/list`),params:E.optional()}),Mn=j.extend({roots:v(An)}),Nn=A.extend({method:f(`notifications/roots/list_changed`),params:k.optional()}),h([V,Ie,On,Kt,Ct,bt,rt,at,lt,pt,ht,Vt,Lt,J,Ke,qe,Ye]),h([L,H,B,Nn,q]),h([I,rn,an,wn,Mn,Ge,Je,K]),h([V,nn,xn,jn,J,Ke,qe,Ye]),h([L,H,Jt,_t,dt,Ht,Nt,q,Cn]),h([I,Re,kn,Mt,xt,it,ot,ut,zt,Rt,Ge,Je,K]),Q=class e extends Error{constructor(e,t,n){super(`MCP error ${e}: ${t}`),this.code=e,this.data=n,this.name=`McpError`}static fromError(t,n,r){if(t===F.UrlElicitationRequired&&r){let e=r;if(e.elicitations)return new Pn(e.elicitations,n)}return new e(t,n,r)}},Pn=class extends Q{constructor(e,t=`URL elicitation${e.length>1?`s`:``} required`){super(F.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}}}));function $(e){return e===`completed`||e===`failed`||e===`cancelled`}var In=e((()=>{})),Ln=e((()=>{})),Rn=e((()=>{})),zn=e((()=>{})),Bn=e((()=>{})),Vn=e((()=>{})),Hn=e((()=>{})),Un=e((()=>{})),Wn=e((()=>{})),Gn=e((()=>{})),Kn=e((()=>{})),qn=e((()=>{})),Jn=e((()=>{})),Yn=e((()=>{})),Xn=e((()=>{})),Zn=e((()=>{})),Qn=e((()=>{})),$n=e((()=>{})),er=e((()=>{})),tr=e((()=>{})),nr=e((()=>{})),rr=e((()=>{})),ir=e((()=>{})),ar=e((()=>{})),or=e((()=>{})),sr=e((()=>{})),cr=e((()=>{})),lr=e((()=>{})),ur=e((()=>{})),dr=e((()=>{})),fr=e((()=>{})),pr=e((()=>{})),mr=e((()=>{})),hr=e((()=>{})),gr=e((()=>{})),_r=e((()=>{})),vr=e((()=>{})),yr=e((()=>{})),br=e((()=>{})),xr=e((()=>{Ln(),Rn(),zn(),Bn(),vr(),yr(),Vn(),Hn(),Un(),Wn(),Gn(),Kn(),qn(),Jn(),Yn(),Xn(),Zn(),Qn(),tr(),nr(),rr(),ir(),or(),sr(),cr(),lr(),ur(),dr(),gr(),er(),fr(),$n(),pr(),mr(),ar(),hr(),_r(),br()}));function Sr(e){let t=ue(e)?.method;if(!t)throw Error(`Schema is missing a method literal`);let n=de(t);if(typeof n!=`string`)throw Error(`Schema method literal must be a string`);return n}function Cr(e,t){let n=le(e,t);if(!n.success)throw n.error;return n.data}var wr=e((()=>{fe(),xr()}));function Tr(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Er(e,t){let n={...e};for(let e in t){let r=e,i=t[r];if(i===void 0)continue;let a=n[r];Tr(a)&&Tr(i)?n[r]={...a,...i}:n[r]=i}return n}var Dr,Or=e((()=>{fe(),Fn(),In(),wr(),Dr=class{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(L,e=>{this._oncancel(e)}),this.setNotificationHandler(H,e=>{this._onprogress(e)}),this.setRequestHandler(V,e=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(J,async(e,t)=>{let n=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!n)throw new Q(F.InvalidParams,`Failed to retrieve task: Task not found`);return{...n}}),this.setRequestHandler(Ke,async(e,t)=>{let n=async()=>{let r=e.params.taskId;if(this._taskMessageQueue){let e;for(;e=await this._taskMessageQueue.dequeue(r,t.sessionId);){if(e.type===`response`||e.type===`error`){let t=e.message,n=t.id,r=this._requestResolvers.get(n);if(r)if(this._requestResolvers.delete(n),e.type===`response`)r(t);else{let e=t;r(new Q(e.error.code,e.error.message,e.error.data))}else{let t=e.type===`response`?`Response`:`Error`;this._onerror(Error(`${t} handler missing for request ${n}`))}continue}await this._transport?.send(e.message,{relatedRequestId:t.requestId})}}let i=await this._taskStore.getTask(r,t.sessionId);if(!i)throw new Q(F.InvalidParams,`Task not found: ${r}`);if(!$(i.status))return await this._waitForTaskUpdate(r,t.signal),await n();if($(i.status)){let e=await this._taskStore.getTaskResult(r,t.sessionId);return this._clearTaskQueue(r),{...e,_meta:{...e._meta,[C]:{taskId:r}}}}return await n()};return await n()}),this.setRequestHandler(qe,async(e,t)=>{try{let{tasks:n,nextCursor:r}=await this._taskStore.listTasks(e.params?.cursor,t.sessionId);return{tasks:n,nextCursor:r,_meta:{}}}catch(e){throw new Q(F.InvalidParams,`Failed to list tasks: ${e instanceof Error?e.message:String(e)}`)}}),this.setRequestHandler(Ye,async(e,t)=>{try{let n=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!n)throw new Q(F.InvalidParams,`Task not found: ${e.params.taskId}`);if($(n.status))throw new Q(F.InvalidParams,`Cannot cancel task in terminal status: ${n.status}`);await this._taskStore.updateTaskStatus(e.params.taskId,`cancelled`,`Client cancelled task execution.`,t.sessionId),this._clearTaskQueue(e.params.taskId);let r=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!r)throw new Q(F.InvalidParams,`Task not found after cancellation: ${e.params.taskId}`);return{_meta:{},...r}}catch(e){throw e instanceof Q?e:new Q(F.InvalidRequest,`Failed to cancel task: ${e instanceof Error?e.message:String(e)}`)}}))}async _oncancel(e){e.params.requestId&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,n,r,i=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:n,resetTimeoutOnProgress:i,onTimeout:r})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let n=Date.now()-t.startTime;if(t.maxTotalTimeout&&n>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),Q.fromError(F.RequestTimeout,`Maximum total timeout exceeded`,{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:n});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw Error(`Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.`);this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=e=>{n?.(e),this._onerror(e)};let r=this._transport?.onmessage;this._transport.onmessage=(e,t)=>{r?.(e,t),P(e)||Te(e)?this._onresponse(e):xe(e)?this._onrequest(e,t):Ce(e)?this._onnotification(e):this._onerror(Error(`Unknown message type: ${JSON.stringify(e)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let e of this._timeoutInfo.values())clearTimeout(e.timeoutId);this._timeoutInfo.clear();for(let e of this._requestHandlerAbortControllers.values())e.abort();this._requestHandlerAbortControllers.clear();let t=Q.fromError(F.ConnectionClosed,`Connection closed`);this._transport=void 0,this.onclose?.();for(let n of e.values())n(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){let t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(e=>this._onerror(Error(`Uncaught error in notification handler: ${e}`)))}_onrequest(e,t){let n=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,r=this._transport,i=e.params?._meta?.[C]?.taskId;if(n===void 0){let t={jsonrpc:`2.0`,id:e.id,error:{code:F.MethodNotFound,message:`Method not found`}};i&&this._taskMessageQueue?this._enqueueTaskMessage(i,{type:`error`,message:t,timestamp:Date.now()},r?.sessionId).catch(e=>this._onerror(Error(`Failed to enqueue error response: ${e}`))):r?.send(t).catch(e=>this._onerror(Error(`Failed to send an error response: ${e}`)));return}let a=new AbortController;this._requestHandlerAbortControllers.set(e.id,a);let o=ye(e.params)?e.params.task:void 0,s=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,c={signal:a.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async t=>{if(a.signal.aborted)return;let n={relatedRequestId:e.id};i&&(n.relatedTask={taskId:i}),await this.notification(t,n)},sendRequest:async(t,n,r)=>{if(a.signal.aborted)throw new Q(F.ConnectionClosed,`Request was cancelled`);let o={...r,relatedRequestId:e.id};i&&!o.relatedTask&&(o.relatedTask={taskId:i});let c=o.relatedTask?.taskId??i;return c&&s&&await s.updateTaskStatus(c,`input_required`),await this.request(t,n,o)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:i,taskStore:s,taskRequestedTtl:o?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{o&&this.assertTaskHandlerCapability(e.method)}).then(()=>n(e,c)).then(async t=>{if(a.signal.aborted)return;let n={result:t,jsonrpc:`2.0`,id:e.id};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:`response`,message:n,timestamp:Date.now()},r?.sessionId):await r?.send(n)},async t=>{if(a.signal.aborted)return;let n={jsonrpc:`2.0`,id:e.id,error:{code:Number.isSafeInteger(t.code)?t.code:F.InternalError,message:t.message??`Internal error`,...t.data!==void 0&&{data:t.data}}};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:`error`,message:n,timestamp:Date.now()},r?.sessionId):await r?.send(n)}).catch(e=>this._onerror(Error(`Failed to send response: ${e}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===a&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:t,...n}=e.params,r=Number(t),i=this._progressHandlers.get(r);if(!i){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let a=this._responseHandlers.get(r),o=this._timeoutInfo.get(r);if(o&&a&&o.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(e){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),a(e);return}i(n)}_onresponse(e){let t=Number(e.id),n=this._requestResolvers.get(t);if(n){this._requestResolvers.delete(t),P(e)?n(e):n(new Q(e.error.code,e.error.message,e.error.data));return}let r=this._responseHandlers.get(t);if(r===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let i=!1;if(P(e)&&e.result&&typeof e.result==`object`){let n=e.result;if(n.task&&typeof n.task==`object`){let e=n.task;typeof e.taskId==`string`&&(i=!0,this._taskProgressTokens.set(e.taskId,t))}}i||this._progressHandlers.delete(t),P(e)?r(e):r(Q.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,n){let{task:r}=n??{};if(!r){try{yield{type:`result`,result:await this.request(e,t,n)}}catch(e){yield{type:`error`,error:e instanceof Q?e:new Q(F.InternalError,String(e))}}return}let i;try{let r=await this.request(e,K,n);if(r.task)i=r.task.taskId,yield{type:`taskCreated`,task:r.task};else throw new Q(F.InternalError,`Task creation did not return a task`);for(;;){let e=await this.getTask({taskId:i},n);if(yield{type:`taskStatus`,task:e},$(e.status)){e.status===`completed`?yield{type:`result`,result:await this.getTaskResult({taskId:i},t,n)}:e.status===`failed`?yield{type:`error`,error:new Q(F.InternalError,`Task ${i} failed`)}:e.status===`cancelled`&&(yield{type:`error`,error:new Q(F.InternalError,`Task ${i} was cancelled`)});return}if(e.status===`input_required`){yield{type:`result`,result:await this.getTaskResult({taskId:i},t,n)};return}let r=e.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(e=>setTimeout(e,r)),n?.signal?.throwIfAborted()}}catch(e){yield{type:`error`,error:e instanceof Q?e:new Q(F.InternalError,String(e))}}}request(e,t,n){let{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a,task:o,relatedTask:s}=n??{};return new Promise((c,l)=>{let u=e=>{l(e)};if(!this._transport){u(Error(`Not connected`));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),o&&this.assertTaskCapability(e.method)}catch(e){u(e);return}n?.signal?.throwIfAborted();let d=this._requestMessageId++,f={...e,jsonrpc:`2.0`,id:d};n?.onprogress&&(this._progressHandlers.set(d,n.onprogress),f.params={...e.params,_meta:{...e.params?._meta||{},progressToken:d}}),o&&(f.params={...f.params,task:o}),s&&(f.params={...f.params,_meta:{...f.params?._meta||{},[C]:s}});let p=e=>{this._responseHandlers.delete(d),this._progressHandlers.delete(d),this._cleanupTimeout(d),this._transport?.send({jsonrpc:`2.0`,method:`notifications/cancelled`,params:{requestId:d,reason:String(e)}},{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a}).catch(e=>this._onerror(Error(`Failed to send cancellation: ${e}`))),l(e instanceof Q?e:new Q(F.RequestTimeout,String(e)))};this._responseHandlers.set(d,e=>{if(!n?.signal?.aborted){if(e instanceof Error)return l(e);try{let n=le(t,e.result);n.success?c(n.data):l(n.error)}catch(e){l(e)}}}),n?.signal?.addEventListener(`abort`,()=>{p(n?.signal?.reason)});let m=n?.timeout??6e4;this._setupTimeout(d,m,n?.maxTotalTimeout,()=>p(Q.fromError(F.RequestTimeout,`Request timed out`,{timeout:m})),n?.resetTimeoutOnProgress??!1);let h=s?.taskId;h?(this._requestResolvers.set(d,e=>{let t=this._responseHandlers.get(d);t?t(e):this._onerror(Error(`Response handler missing for side-channeled request ${d}`))}),this._enqueueTaskMessage(h,{type:`request`,message:f,timestamp:Date.now()}).catch(e=>{this._cleanupTimeout(d),l(e)})):this._transport.send(f,{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a}).catch(e=>{this._cleanupTimeout(d),l(e)})})}async getTask(e,t){return this.request({method:`tasks/get`,params:e},Ge,t)}async getTaskResult(e,t,n){return this.request({method:`tasks/result`,params:e},t,n)}async listTasks(e,t){return this.request({method:`tasks/list`,params:e},Je,t)}async cancelTask(e,t){return this.request({method:`tasks/cancel`,params:e},Xe,t)}async notification(e,t){if(!this._transport)throw Error(`Not connected`);this.assertNotificationCapability(e.method);let n=t?.relatedTask?.taskId;if(n){let r={...e,jsonrpc:`2.0`,params:{...e.params,_meta:{...e.params?._meta||{},[C]:t.relatedTask}}};await this._enqueueTaskMessage(n,{type:`notification`,message:r,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let n={...e,jsonrpc:`2.0`};t?.relatedTask&&(n={...n,params:{...n.params,_meta:{...n.params?._meta||{},[C]:t.relatedTask}}}),this._transport?.send(n,t).catch(e=>this._onerror(e))});return}let r={...e,jsonrpc:`2.0`};t?.relatedTask&&(r={...r,params:{...r.params,_meta:{...r.params?._meta||{},[C]:t.relatedTask}}}),await this._transport.send(r,t)}setRequestHandler(e,t){let n=Sr(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(n,r)=>{let i=Cr(e,n);return Promise.resolve(t(i,r))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){let n=Sr(e);this._notificationHandlers.set(n,n=>{let r=Cr(e,n);return Promise.resolve(t(r))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,n){if(!this._taskStore||!this._taskMessageQueue)throw Error(`Cannot enqueue task message: taskStore and taskMessageQueue are not configured`);let r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,n,r)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(e,t);for(let t of n)if(t.type===`request`&&xe(t.message)){let n=t.message.id,r=this._requestResolvers.get(n);r?(r(new Q(F.InternalError,`Task cancelled or completed`)),this._requestResolvers.delete(n)):this._onerror(Error(`Resolver missing for request ${n} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let n=this._options?.defaultTaskPollInterval??1e3;try{let t=await this._taskStore?.getTask(e);t?.pollInterval&&(n=t.pollInterval)}catch{}return new Promise((e,r)=>{if(t.aborted){r(new Q(F.InvalidRequest,`Request cancelled`));return}let i=setTimeout(e,n);t.addEventListener(`abort`,()=>{clearTimeout(i),r(new Q(F.InvalidRequest,`Request cancelled`))},{once:!0})})}requestTaskStore(e,t){let n=this._taskStore;if(!n)throw Error(`No task store configured`);return{createTask:async r=>{if(!e)throw Error(`No request provided`);return await n.createTask(r,e.id,{method:e.method,params:e.params},t)},getTask:async e=>{let r=await n.getTask(e,t);if(!r)throw new Q(F.InvalidParams,`Failed to retrieve task: Task not found`);return r},storeTaskResult:async(e,r,i)=>{await n.storeTaskResult(e,r,i,t);let a=await n.getTask(e,t);if(a){let t=q.parse({method:`notifications/tasks/status`,params:a});await this.notification(t),$(a.status)&&this._cleanupTaskProgressHandler(e)}},getTaskResult:e=>n.getTaskResult(e,t),updateTaskStatus:async(e,r,i)=>{let a=await n.getTask(e,t);if(!a)throw new Q(F.InvalidParams,`Task "${e}" not found - it may have been cleaned up`);if($(a.status))throw new Q(F.InvalidParams,`Cannot update task "${e}" from terminal status "${a.status}" to "${r}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(e,r,i,t);let o=await n.getTask(e,t);if(o){let t=q.parse({method:`notifications/tasks/status`,params:o});await this.notification(t),$(o.status)&&this._cleanupTaskProgressHandler(e)}},listTasks:e=>n.listTasks(e,t)}}}})),kr=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(e,t){return{validate:e,compare:t}}e.fullFormats={date:t(a,o),time:t(c(!0),l),"date-time":t(f(!0),p),"iso-time":t(c(),u),"iso-date-time":t(f(),m),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:_,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:ie,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:ee,int32:{type:`number`,validate:y},int64:{type:`number`,validate:b},float:{type:`number`,validate:x},double:{type:`number`,validate:x},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,o),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,l),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,p),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,u),"iso-date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,m),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function n(e){return e%4==0&&(e%100!=0||e%400==0)}var r=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,i=[0,31,28,31,30,31,30,31,31,30,31,30,31];function a(e){let t=r.exec(e);if(!t)return!1;let a=+t[1],o=+t[2],s=+t[3];return o>=1&&o<=12&&s>=1&&s<=(o===2&&n(a)?29:i[o])}function o(e,t){if(e&&t)return e>t?1:e<t?-1:0}var s=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function c(e){return function(t){let n=s.exec(t);if(!n)return!1;let r=+n[1],i=+n[2],a=+n[3],o=n[4],c=n[5]===`-`?-1:1,l=+(n[6]||0),u=+(n[7]||0);if(l>23||u>59||e&&!o)return!1;if(r<=23&&i<=59&&a<60)return!0;let d=i-u*c,f=r-l*c-+(d<0);return(f===23||f===-1)&&(d===59||d===-1)&&a<61}}function l(e,t){if(!(e&&t))return;let n=new Date(`2020-01-01T`+e).valueOf(),r=new Date(`2020-01-01T`+t).valueOf();if(n&&r)return n-r}function u(e,t){if(!(e&&t))return;let n=s.exec(e),r=s.exec(t);if(n&&r)return e=n[1]+n[2]+n[3],t=r[1]+r[2]+r[3],e>t?1:e<t?-1:0}var d=/t|\s/i;function f(e){let t=c(e);return function(e){let n=e.split(d);return n.length===2&&a(n[0])&&t(n[1])}}function p(e,t){if(!(e&&t))return;let n=new Date(e).valueOf(),r=new Date(t).valueOf();if(n&&r)return n-r}function m(e,t){if(!(e&&t))return;let[n,r]=e.split(d),[i,a]=t.split(d),s=o(n,i);if(s!==void 0)return s||l(r,a)}var h=/\/|:/,g=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function _(e){return h.test(e)&&g.test(e)}var v=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function ee(e){return v.lastIndex=0,v.test(e)}var te=-(2**31),ne=2**31-1;function y(e){return Number.isInteger(e)&&e<=ne&&e>=te}function b(e){return Number.isInteger(e)}function x(){return!0}var re=/[^\\]\\Z/;function ie(e){if(re.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}})),Ar=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;var t=re(),n=x(),r=n.operators,i={formatMaximum:{okStr:`<=`,ok:r.LTE,fail:r.GT},formatMinimum:{okStr:`>=`,ok:r.GTE,fail:r.LT},formatExclusiveMaximum:{okStr:`<`,ok:r.LT,fail:r.GTE},formatExclusiveMinimum:{okStr:`>`,ok:r.GT,fail:r.LTE}};e.formatLimitDefinition={keyword:Object.keys(i),type:`string`,schemaType:`string`,$data:!0,error:{message:({keyword:e,schemaCode:t})=>(0,n.str)`should be ${i[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,n._)`{comparison: ${i[e].okStr}, limit: ${t}}`},code(e){let{gen:r,data:a,schemaCode:o,keyword:s,it:c}=e,{opts:l,self:u}=c;if(!l.validateFormats)return;let d=new t.KeywordCxt(c,u.RULES.all.format.definition,`format`);d.$data?f():p();function f(){let t=r.scopeValue(`formats`,{ref:u.formats,code:l.code.formats}),i=r.const(`fmt`,(0,n._)`${t}[${d.schemaCode}]`);e.fail$data((0,n.or)((0,n._)`typeof ${i} != "object"`,(0,n._)`${i} instanceof RegExp`,(0,n._)`typeof ${i}.compare != "function"`,m(i)))}function p(){let t=d.schema,i=u.formats[t];if(!i||i===!0)return;if(typeof i!=`object`||i instanceof RegExp||typeof i.compare!=`function`)throw Error(`"${s}": format "${t}" does not define "compare" function`);let a=r.scopeValue(`formats`,{key:t,ref:i,code:l.code.formats?(0,n._)`${l.code.formats}${(0,n.getProperty)(t)}`:void 0});e.fail$data(m(a))}function m(e){return(0,n._)`${e}.compare(${a}, ${o}) ${i[s].fail} 0`}},dependencies:[`format`]},e.default=t=>(t.addKeyword(e.formatLimitDefinition),t)})),jr=n(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});var n=kr(),r=Ar(),i=x(),a=new i.Name(`fullFormats`),o=new i.Name(`fastFormats`),s=(e,t={keywords:!0})=>{if(Array.isArray(t))return c(e,t,n.fullFormats,a),e;let[i,s]=t.mode===`fast`?[n.fastFormats,o]:[n.fullFormats,a];return c(e,t.formats||n.formatNames,i,s),t.keywords&&(0,r.default)(e),e};s.get=(e,t=`full`)=>{let r=(t===`fast`?n.fastFormats:n.fullFormats)[e];if(!r)throw Error(`Unknown format "${e}"`);return r};function c(e,t,n,r){var a;(a=e.opts.code).formats??(a.formats=(0,i._)`require("ajv-formats/dist/formats").${r}`);for(let r of t)e.addFormat(r,n[r])}t.exports=e=s,Object.defineProperty(e,"__esModule",{value:!0}),e.default=s}));function Mr(){let e=new Nr.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,Pr.default)(e),e}var Nr,Pr,Fr,Ir=e((()=>{Nr=t(re(),1),Pr=t(jr(),1),Fr=class{constructor(e){this._ajv=e??Mr()}getValidator(e){let t=`$id`in e&&typeof e.$id==`string`?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return e=>t(e)?{valid:!0,data:e,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(t.errors)}}}}));function Lr(e,t,n){if(!e)throw Error(`${n} does not support task creation (required for ${t})`);switch(t){case`tools/call`:if(!e.tools?.call)throw Error(`${n} does not support task creation for tools/call (required for ${t})`);break;default:break}}function Rr(e,t,n){if(!e)throw Error(`${n} does not support task creation (required for ${t})`);switch(t){case`sampling/createMessage`:if(!e.sampling?.createMessage)throw Error(`${n} does not support task creation for sampling/createMessage (required for ${t})`);break;case`elicitation/create`:if(!e.elicitation?.create)throw Error(`${n} does not support task creation for elicitation/create (required for ${t})`);break;default:break}}var zr=e((()=>{}));function Br(e){return Ee.parse(JSON.parse(e))}function Vr(e){return JSON.stringify(e)+`
2
- `}var Hr,Ur=e((()=>{Fn(),Hr=class{append(e){this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){if(!this._buffer)return null;let e=this._buffer.indexOf(`
3
- `);if(e===-1)return null;let t=this._buffer.toString(`utf8`,0,e).replace(/\r$/,``);return this._buffer=this._buffer.subarray(e+1),Br(t)}clear(){this._buffer=void 0}}}));export{le as $,Ut as A,Nt as B,F as C,B as D,Re as E,Mn as F,Ht as G,dt as H,Lt as I,xe as J,Fn as K,Rt as L,ot as M,it as N,Ee as O,jn as P,S as Q,Wt as R,I as S,Ie as T,me as U,ut as V,Kt as W,ue as X,P as Y,fe as Z,an as _,Lr as a,wn as b,Ir as c,Er as d,Vt as f,rn as g,nn as h,Rr as i,xt as j,pe as k,Dr as l,kn as m,Ur as n,zr as o,zt as p,ze as q,Vr as r,Fr as s,Hr as t,Or as u,K as v,Mt as w,Cn as x,xn as y,Q as z};
@@ -1 +0,0 @@
1
- import{Kv as e,Yv as t,Zv as n,ey as r,qv as i}from"./loadAgentsDir-ZQwvbURI.js";i();export{e as checkOutTeleportedSessionBranch,t as processMessagesForTeleportResume,n as teleportResumeCodeSession,r as validateGitState};
@@ -1,33 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{Bt as r,di as i,j as a,t as o,ui as s}from"./src-CDCSSo0U2.js";import{n as c,t as l}from"./cwd-CYmmnQVS.js";import{D as u,E as d,K as f,O as ee,U as p,_ as te,h as ne}from"./debug-DiuXEmUq.js";import{Jt as m,Zt as re}from"./settings-BhvhCpVh.js";import{b as h,c as g,g as _,o as v,y}from"./config-662VDD70.js";import{r as b,t as x}from"./execFileNoThrow-DResQRvR.js";import{o as S,s as C}from"./log-Duzb4o6h.js";import{i as ie,o as ae}from"./platform-B5dCGT8t.js";import{f as oe,m as se}from"./file-BZriE-XU.js";import{d as ce,o as le,s as w}from"./types-Cnorfsss.js";import{r as ue,t as T}from"./completionCache-CdHCuiqq.js";import{homedir as E,platform as D}from"os";import{dirname as de,join as O}from"path";import{randomBytes as k}from"crypto";import{copyFile as A,mkdir as j,readFile as M,stat as N,writeFile as P}from"fs/promises";import{pathToFileURL as fe}from"url";function F(){let e=ne().existsSync(O(l(),`CLAUDE.md`)),t=se(l());return[{key:`workspace`,text:`Ask Claude to create a new app or clone a repository`,isComplete:!1,isCompletable:!0,isEnabled:t},{key:`claudemd`,text:`Run /init to create a CLAUDE.md file with instructions for Claude`,isComplete:e,isCompletable:!0,isEnabled:!t}]}function I(){return F().filter(({isCompletable:e,isEnabled:t})=>e&&t).every(({isComplete:e})=>e)}function L(){v().hasCompletedProjectOnboarding||I()&&y(e=>({...e,hasCompletedProjectOnboarding:!0}))}function R(){y(e=>({...e,projectOnboardingSeenCount:e.projectOnboardingSeenCount+1}))}var z,B=e((()=>{n(),_(),c(),oe(),te(),z=t(()=>{let e=v();return e.hasCompletedProjectOnboarding||e.projectOnboardingSeenCount>=4||process.env.IS_DEMO?!1:!I()})}));function pe(e){h(t=>({...t,appleTerminalSetupInProgress:!0,appleTerminalBackupPath:e}))}function V(){h(e=>({...e,appleTerminalSetupInProgress:!1}))}function me(){let e=g();return{inProgress:e.appleTerminalSetupInProgress??!1,backupPath:e.appleTerminalBackupPath||null}}function H(){return O(E(),`Library`,`Preferences`,`com.apple.Terminal.plist`)}async function he(){let e=H(),t=`${e}.bak`;try{let{code:n}=await x(`defaults`,[`export`,`com.apple.Terminal`,e]);if(n!==0)return null;try{await N(e)}catch{return null}return await x(`defaults`,[`export`,`com.apple.Terminal`,t]),pe(t),t}catch(e){return C(e),null}}async function U(){let{inProgress:e,backupPath:t}=me();if(!e)return{status:`no_backup`};if(!t)return V(),{status:`no_backup`};try{await N(t)}catch{return V(),{status:`no_backup`}}try{let{code:e}=await x(`defaults`,[`import`,`com.apple.Terminal`,t]);return e===0?(await x(`killall`,[`cfprefsd`]),V(),{status:`restored`}):{status:`failed`,backupPath:t}}catch(e){return C(Error(`Failed to restore Terminal.app settings with: ${e}`)),V(),{status:`failed`,backupPath:t}}}var W=e((()=>{_(),b(),S()}));function ge(){let e=process.env.VSCODE_GIT_ASKPASS_MAIN??``,t=process.env.PATH??``;return e.includes(`.vscode-server`)||e.includes(`.cursor-server`)||e.includes(`.windsurf-server`)||t.includes(`.vscode-server`)||t.includes(`.cursor-server`)||t.includes(`.windsurf-server`)}function _e(){return!m.terminal||!(m.terminal in $)?null:$[m.terminal]??null}function G(e){return r()?`\x1b]8;;${fe(e).href}\x07${e}\x1b]8;;\x07`:e}function K(){return D()===`darwin`&&m.terminal===`Apple_Terminal`||m.terminal===`vscode`||m.terminal===`cursor`||m.terminal===`windsurf`||m.terminal===`alacritty`||m.terminal===`zed`}async function q(e){let t=``;switch(m.terminal){case`Apple_Terminal`:t=await xe(e);break;case`vscode`:t=await Y(`VSCode`,e);break;case`cursor`:t=await Y(`Cursor`,e);break;case`windsurf`:t=await Y(`Windsurf`,e);break;case`alacritty`:t=await Se(e);break;case`zed`:t=await Ce(e);break;case null:break}return h(e=>[`vscode`,`cursor`,`windsurf`,`alacritty`,`zed`].includes(m.terminal??``)?e.shiftEnterKeyBindingInstalled===!0?e:{...e,shiftEnterKeyBindingInstalled:!0}:m.terminal===`Apple_Terminal`?e.optionAsMetaKeyInstalled===!0?e:{...e,optionAsMetaKeyInstalled:!0}:e),L(),process.env.USER_TYPE===`ant`&&(t+=await ue(e)),t}function ve(){return g().shiftEnterKeyBindingInstalled===!0}function ye(){return g().hasUsedBackslashReturn===!0}function J(){g().hasUsedBackslashReturn||h(e=>({...e,hasUsedBackslashReturn:!0}))}async function be(e,t,n){if(m.terminal&&m.terminal in $)return e(`Shift+Enter is natively supported in ${$[m.terminal]}.
2
-
3
- No configuration needed. Just use Shift+Enter to add newlines.`),null;if(!K()){let t=m.terminal||`your current terminal`,n=ie(),r=``;return n===`macos`?r=` • macOS: Apple Terminal
4
- `:n===`windows`&&(r=` • Windows: Windows Terminal
5
- `),e(`Terminal setup cannot be run from ${t}.
6
-
7
- This command configures a convenient Shift+Enter shortcut for multi-line prompts.
8
- ${s.dim(`Note: You can already use backslash (\\\\) + return to add newlines.`)}
9
-
10
- To set up the shortcut (optional):
11
- 1. Exit tmux/screen temporarily
12
- 2. Run /terminal-setup directly in one of these terminals:
13
- ${r} • IDE: VSCode, Cursor, Windsurf, Zed
14
- • Other: Alacritty
15
- 3. Return to tmux/screen - settings will persist
16
-
17
- ${s.dim(`Note: iTerm2, WezTerm, Ghostty, Kitty, and Warp support Shift+Enter natively.`)}`),null}return e(await q(t.options.theme)),null}async function Y(e=`VSCode`,t){if(ge())return`${a(`warning`,t)(`Cannot install keybindings from a remote ${e} session.`)}${Q}${Q}${e} keybindings must be installed on your local machine, not the remote server.${Q}${Q}To install the Shift+Enter keybinding:${Q}1. Open ${e} on your local machine (not connected to remote)${Q}2. Open the Command Palette (Cmd/Ctrl+Shift+P) → "Preferences: Open Keyboard Shortcuts (JSON)"${Q}3. Add this keybinding (the file must be a JSON array):${Q}${Q}${s.dim(`[
18
- {
19
- "key": "shift+enter",
20
- "command": "workbench.action.terminal.sendSequence",
21
- "args": { "text": "\\u001b\\r" },
22
- "when": "terminalFocus"
23
- }
24
- ]`)}${Q}`;let n=e===`VSCode`?`Code`:e,r=O(E(),D()===`win32`?O(`AppData`,`Roaming`,n,`User`):D()===`darwin`?O(`Library`,`Application Support`,n,`User`):O(`.config`,n,`User`)),i=O(r,`keybindings.json`);try{await j(r,{recursive:!0});let n=`[]`,o=[],c=!1;try{n=await M(i,{encoding:`utf-8`}),c=!0,o=ce(n)??[]}catch(e){if(!f(e))throw e}if(c){let n=`${i}.${k(4).toString(`hex`)}.bak`;try{await A(i,n)}catch{return`${a(`warning`,t)(`Error backing up existing ${e} terminal keybindings. Bailing out.`)}${Q}${s.dim(`See ${G(i)}`)}${Q}${s.dim(`Backup path: ${G(n)}`)}${Q}`}}return o.find(e=>e.key===`shift+enter`&&e.command===`workbench.action.terminal.sendSequence`&&e.when===`terminalFocus`)?`${a(`warning`,t)(`Found existing ${e} terminal Shift+Enter key binding. Remove it to continue.`)}${Q}${s.dim(`See ${G(i)}`)}${Q}`:(await P(i,le(n,{key:`shift+enter`,command:`workbench.action.terminal.sendSequence`,args:{text:`\x1B\r`},when:`terminalFocus`}),{encoding:`utf-8`}),`${a(`success`,t)(`Installed ${e} terminal Shift+Enter key binding`)}${Q}${s.dim(`See ${G(i)}`)}${Q}`)}catch(t){throw C(t),Error(`Failed to install ${e} terminal Shift+Enter key binding`)}}async function X(e){let{code:t}=await x(`/usr/libexec/PlistBuddy`,[`-c`,`Add :'Window Settings':'${e}':useOptionAsMetaKey bool true`,H()]);if(t!==0){let{code:t}=await x(`/usr/libexec/PlistBuddy`,[`-c`,`Set :'Window Settings':'${e}':useOptionAsMetaKey true`,H()]);if(t!==0)return C(Error(`Failed to enable Option as Meta key for Terminal.app profile: ${e}`)),!1}return!0}async function Z(e){let{code:t}=await x(`/usr/libexec/PlistBuddy`,[`-c`,`Add :'Window Settings':'${e}':Bell bool false`,H()]);if(t!==0){let{code:t}=await x(`/usr/libexec/PlistBuddy`,[`-c`,`Set :'Window Settings':'${e}':Bell false`,H()]);if(t!==0)return C(Error(`Failed to disable audio bell for Terminal.app profile: ${e}`)),!1}return!0}async function xe(e){try{if(!await he())throw Error(`Failed to create backup of Terminal.app preferences, bailing out`);let{stdout:t,code:n}=await x(`defaults`,[`read`,`com.apple.Terminal`,`Default Window Settings`]);if(n!==0||!t.trim())throw Error(`Failed to read default Terminal.app profile`);let{stdout:r,code:i}=await x(`defaults`,[`read`,`com.apple.Terminal`,`Startup Window Settings`]);if(i!==0||!r.trim())throw Error(`Failed to read startup Terminal.app profile`);let o=!1,c=t.trim(),l=await X(c),u=await Z(c);(l||u)&&(o=!0);let d=r.trim();if(d!==c){let e=await X(d),t=await Z(d);(e||t)&&(o=!0)}if(!o)throw Error(`Failed to enable Option as Meta key or disable audio bell for any Terminal.app profile`);return await x(`killall`,[`cfprefsd`]),V(),`${a(`success`,e)(`Configured Terminal.app settings:`)}${Q}${a(`success`,e)(`- Enabled "Use Option as Meta key"`)}${Q}${a(`success`,e)(`- Switched to visual bell`)}${Q}${s.dim(`Option+Enter will now enter a newline.`)}${Q}${s.dim(`You must restart Terminal.app for changes to take effect.`,e)}${Q}`}catch(e){C(e);let t=await U(),n=`Failed to enable Option as Meta key for Terminal.app.`;throw t.status===`restored`?Error(`${n} Your settings have been restored from backup.`):t.status===`failed`?Error(`${n} Restoring from backup failed, try manually with: defaults import com.apple.Terminal ${t.backupPath}`):Error(`${n} No backup was available to restore from.`)}}async function Se(e){let t=[],n=process.env.XDG_CONFIG_HOME;if(n?t.push(O(n,`alacritty`,`alacritty.toml`)):t.push(O(E(),`.config`,`alacritty`,`alacritty.toml`)),D()===`win32`){let e=process.env.APPDATA;e&&t.push(O(e,`alacritty`,`alacritty.toml`))}let r=null,i=``,o=!1;for(let e of t)try{i=await M(e,{encoding:`utf-8`}),r=e,o=!0;break}catch(e){if(!f(e))throw e}if(r||(r=t[0]??null),!r)throw Error(`No valid config path found for Alacritty`);try{if(o){if(i.includes(`mods = "Shift"`)&&i.includes(`key = "Return"`))return`${a(`warning`,e)(`Found existing Alacritty Shift+Enter key binding. Remove it to continue.`)}${Q}${s.dim(`See ${G(r)}`)}${Q}`;let t=k(4).toString(`hex`),n=`${r}.${t}.bak`;try{await A(r,n)}catch{return`${a(`warning`,e)(`Error backing up existing Alacritty config. Bailing out.`)}${Q}${s.dim(`See ${G(r)}`)}${Q}${s.dim(`Backup path: ${G(n)}`)}${Q}`}}else await j(de(r),{recursive:!0});let t=i;return i&&!i.endsWith(`
25
- `)&&(t+=`
26
- `),t+=`
27
- [[keyboard.bindings]]
28
- key = "Return"
29
- mods = "Shift"
30
- chars = "\\u001B\\r"
31
- `,await P(r,t,{encoding:`utf-8`}),`${a(`success`,e)(`Installed Alacritty Shift+Enter key binding`)}${Q}${a(`success`,e)(`You may need to restart Alacritty for changes to take effect`)}${Q}${s.dim(`See ${G(r)}`)}${Q}`}catch(e){throw C(e),Error(`Failed to install Alacritty Shift+Enter key binding`)}}async function Ce(e){let t=O(E(),`.config`,`zed`),n=O(t,`keymap.json`);try{await j(t,{recursive:!0});let r=`[]`,i=!1;try{r=await M(n,{encoding:`utf-8`}),i=!0}catch(e){if(!f(e))throw e}if(i){if(r.includes(`shift-enter`))return`${a(`warning`,e)(`Found existing Zed Shift+Enter key binding. Remove it to continue.`)}${Q}${s.dim(`See ${G(n)}`)}${Q}`;let t=`${n}.${k(4).toString(`hex`)}.bak`;try{await A(n,t)}catch{return`${a(`warning`,e)(`Error backing up existing Zed keymap. Bailing out.`)}${Q}${s.dim(`See ${G(n)}`)}${Q}${s.dim(`Backup path: ${G(t)}`)}${Q}`}}let o;try{o=u(r),Array.isArray(o)||(o=[])}catch{o=[]}return o.push({context:`Terminal`,bindings:{"shift-enter":[`terminal::SendText`,`\x1B\r`]}}),await P(n,ee(o,null,2)+`
32
- `,{encoding:`utf-8`}),`${a(`success`,e)(`Installed Zed Shift+Enter key binding`)}${Q}${s.dim(`See ${G(n)}`)}${Q}`}catch(e){throw C(e),Error(`Failed to install Zed Shift+Enter key binding`)}}var Q,$,we=e((()=>{i(),o(),B(),W(),T(),_(),re(),p(),b(),w(),S(),ae(),d(),Q=`
33
- `,$={ghostty:`Ghostty`,kitty:`Kitty`,"iTerm.app":`iTerm2`,WezTerm:`WezTerm`,WarpTerminal:`Warp`}}));export{ve as a,K as c,F as d,R as f,z as h,we as i,U as l,L as m,_e as n,J as o,B as p,ye as r,q as s,be as t,W as u};
@@ -1 +0,0 @@
1
- import{n as e,r as t,t as n}from"./thinkback-ERCQ86CR.js";e();export{n as call,t as playAnimation};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Es as t,Ms as n,hD as r,pD as i}from"./loadAgentsDir-ZQwvbURI.js";import{n as a,r as o}from"./thinkback-ERCQ86CR.js";import{join as s}from"path";function c(){return`thinkback@${process.env.USER_TYPE===`ant`?u:i}`}async function l(){let e=n(),t=c(),r=e.plugins[t];if(!r||r.length===0)return{type:`text`,value:`Thinkback plugin not installed. Run /think-back first to install it.`};let i=r[0];return i?.installPath?{type:`text`,value:(await o(s(i.installPath,`skills`,d))).message}:{type:`text`,value:`Thinkback plugin installation path not found.`}}var u,d;e((()=>{t(),r(),a(),u=`claude-code-marketplace`,d=`thinkback`}))();export{l as call};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{JE as t,M_ as n,N_ as r,qE as i}from"./loadAgentsDir-ZQwvbURI.js";import{n as a,t as o}from"./partition-Cv11dD5P.js";function s(e,n,i){let[o,s]=a(t([...e,...n],`name`),r),c=(e,t)=>e.name.localeCompare(t.name);return[...s.sort(c),...o.sort(c)]}var c=e((()=>{o(),i(),n()}));export{s as n,c as t};
@@ -1 +0,0 @@
1
- import{r as e,t}from"./trustedDevice-nqhuw4tp.js";export{t as clearTrustedDeviceToken,e as enrollTrustedDevice};
@@ -1 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{n as r,t as i}from"./axios-DaWTGg7G.js";import{E as a,O as o,U as s,l as c,p as l,z as u}from"./debug-DiuXEmUq.js";import{d,f}from"./log-Duzb4o6h.js";import{l as p,u as m}from"./oauth-BqJqV-2M.js";import{Cn as h,Vt as g,pt as _,wn as v}from"./model-BgrLt7P7.js";import{hostname as y}from"os";i(),n(),m(),c(),s(),d(),v(),a();var b=`tengu_sessions_elevated_auth_enforcement`;function x(){return!1}var S=t(()=>process.env.CLAUDE_TRUSTED_DEVICE_TOKEN||h().read()?.trustedDeviceToken);function C(){if(x())return S()}function w(){S.cache?.clear?.()}function T(){if(!x())return;let e=h();try{let t=e.read();t?.trustedDeviceToken&&(delete t.trustedDeviceToken,e.update(t))}catch{}S.cache?.clear?.()}async function E(){try{if(!await!1){l(`[trusted-device] Gate ${b} is off, skipping enrollment`);return}if(process.env.CLAUDE_TRUSTED_DEVICE_TOKEN){l(`[trusted-device] CLAUDE_TRUSTED_DEVICE_TOKEN env var is set, skipping enrollment (env var takes precedence)`);return}let{getClaudeAIOAuthTokens:t}=(g(),e(_)),n=t()?.accessToken;if(!n){l(`[trusted-device] No OAuth token, skipping enrollment`);return}let i=h();if(f()){l(`[trusted-device] Essential traffic only, skipping enrollment`);return}let a=p().BASE_API_URL,s;try{s=await r.post(`${a}/api/auth/trusted_devices`,{display_name:`Work Mate on ${y()} · ${process.platform}`},{headers:{Authorization:`Bearer ${n}`,"Content-Type":`application/json`},timeout:1e4,validateStatus:e=>e<500})}catch(e){l(`[trusted-device] Enrollment request failed: ${u(e)}`);return}if(s.status!==200&&s.status!==201){l(`[trusted-device] Enrollment failed ${s.status}: ${o(s.data).slice(0,200)}`);return}let c=s.data?.device_token;if(!c||typeof c!=`string`){l(`[trusted-device] Enrollment response missing device_token field`);return}try{let e=i.read();if(!e){l(`[trusted-device] Cannot read storage, skipping token persist`);return}e.trustedDeviceToken=c;let t=i.update(e);if(!t.success){l(`[trusted-device] Failed to persist token: ${t.warning??`unknown`}`);return}S.cache?.clear?.(),l(`[trusted-device] Enrolled device_id=${s.data.device_id??`unknown`}`)}catch(e){l(`[trusted-device] Storage write failed: ${u(e)}`)}}catch(e){l(`[trusted-device] Enrollment error: ${u(e)}`)}}export{C as i,w as n,E as r,T as t};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,o as n}from"./envUtils-DSxRz_kt.js";import{D as r,E as i,K as a,U as o,l as s,p as c,z as l}from"./debug-DiuXEmUq.js";import{o as u}from"./log-Duzb4o6h.js";import{a as d,i as f}from"./genericProcessUtils-DO7Fy0RJ.js";import"os";import{join as p}from"path";import"crypto";import{readFile as m,readdir as h}from"fs/promises";import"net";import"node:string_decoder";var g=e((()=>{o(),i()})),_=e((()=>{s(),o(),n(),g(),u(),i()}));function v(){return p(t(),`sessions`)}async function y(){let e=v(),t;try{t=await h(e)}catch(e){return a(e)||c(`[udsClient] readdir failed: ${l(e)}`),[]}let n=[];for(let i of t){if(!/^\d+\.json$/.test(i))continue;let t=parseInt(i.slice(0,-5),10);if(d(t))try{let a=r(await m(p(e,i),`utf8`));n.push({pid:t,sessionId:a.sessionId,cwd:a.cwd,startedAt:a.startedAt,kind:a.kind,name:a.name,messagingSocketPath:a.messagingSocketPath,entrypoint:a.entrypoint,bridgeSessionId:a.bridgeSessionId,alive:!0})}catch{}}return n}e((()=>{n(),s(),o(),f(),i(),_(),g()}))();export{y as listAllLiveSessions};
@@ -1 +0,0 @@
1
- import{i as e,n as t}from"./undercover-DDgIKbO5.js";t();export{e as shouldShowUndercoverAutoNotice};
@@ -1,11 +0,0 @@
1
- import{di as e,ui as t}from"./src-CDCSSo0U2.js";import{ES as n,OS as r}from"./loadAgentsDir-ZQwvbURI.js";import{l as i,p as a}from"./debug-DiuXEmUq.js";import{n as o,o as s}from"./process-gEbdy6uY.js";import{n as c,r as l}from"./execFileNoThrow-DResQRvR.js";import{l as u,u as d}from"./ripgrep-BN_g-F7X.js";import{join as f}from"node:path";import{execSync as p}from"node:child_process";import{existsSync as m,readFileSync as h}from"node:fs";import{homedir as g}from"node:os";e(),i(),d(),l(),r(),o();var _=`claude-code-best`;function v(){try{let e=f(u,`..`,`package.json`);if(m(e)){let t=JSON.parse(h(e,`utf-8`));if(t.version)return t.version}}catch{}return`0.0.2`}function y(e){try{return p(`which ${e} 2>/dev/null`,{stdio:`pipe`}),!0}catch{return!1}}function b(){return!!(process.execPath.includes(`bun`)||m(f(f(g(),`.bun`,`install`,`global`),`node_modules`,_)))}async function x(){let e=await c(`npm`,[`view`,`${_}@latest`,`version`,`--prefer-online`],{abortSignal:AbortSignal.timeout(1e4),cwd:g()});return e.code===0?e.stdout.trim():(a(`npm view failed: ${e.stderr}`),null)}function S(e,t){let n=e=>e.replace(/^\D/,``).split(`.`).map(Number),r=n(e),i=n(t);for(let e=0;e<3;e++){if((r[e]??0)>(i[e]??0))return!0;if((r[e]??0)<(i[e]??0))return!1}return!0}async function C(){let e=v();s(`Current version: ${e}\n`);let r=y(`bun`),i=b()&&r?`bun`:`npm`;s(`Package manager: ${i}\n`),s(`Checking for updates...
2
- `);let a=await x();if(!a){process.stderr.write(t.red(`Failed to check for updates`)+`
3
- `),process.stderr.write(`Unable to fetch latest version from npm registry.
4
- `),await n(1);return}if(a===e||S(e,a)){s(t.green(`ccb is up to date (${e})`)+`
5
- `),await n(0);return}s(`New version available: ${a} (current: ${e})\n`),s(`Installing update via ${i}...\n`);try{p(i===`bun`?`bun install -g ${_}@latest`:`npm install -g ${_}@latest`,{stdio:`inherit`,cwd:g(),timeout:12e4}),s(t.green(`Successfully updated from ${e} to ${a}`)+`
6
- `)}catch(e){process.stderr.write(t.red(`Update failed`)+`
7
- `),process.stderr.write(`${e}\n`),process.stderr.write(`
8
- `),process.stderr.write(`Try manually updating with:
9
- `),i===`bun`?process.stderr.write(t.bold(` bun install -g ${_}@latest`)+`
10
- `):process.stderr.write(t.bold(` npm install -g ${_}@latest`)+`
11
- `),await n(1)}await n(0)}export{C as updateCCB};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./upgrade-BN20nsCH.js";e();export{t as call};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./axios-DaWTGg7G.js";import{A as r,t as i,w as a}from"./v4-jw6qOKwQ.js";import{E as o,O as s,l as c,p as l}from"./debug-DiuXEmUq.js";import{n as u,t as d}from"./lazySchema-uxlVVNM1.js";import{l as f,u as p}from"./oauth-BqJqV-2M.js";import{a as m,r as h,t as g}from"./bridgeConfig-DDF3teRE.js";import{basename as _,extname as v}from"path";import{randomUUID as y}from"crypto";import{readFile as b}from"fs/promises";function x(e){let t=v(e).toLowerCase();return D[t]??`application/octet-stream`}function S(e){l(`[brief:upload] ${e}`)}function C(){return h()??process.env.ANTHROPIC_BASE_URL??f().BASE_API_URL}async function w(e,n,r){{if(!r.replBridgeEnabled)return;if(n>T){S(`skip ${e}: ${n} bytes exceeds ${T} limit`);return}let i=g();if(!i){S(`skip: no oauth token`);return}let a;try{a=await b(e)}catch(t){S(`read failed for ${e}: ${t}`);return}let o=`${C()}/api/oauth/file_upload`,c=_(e),l=x(c),u=`----FormBoundary${y()}`,d=Buffer.concat([Buffer.from(`--${u}\r\nContent-Disposition: form-data; name="file"; filename="${c}"\r\nContent-Type: ${l}\r\n\r\n`),a,Buffer.from(`\r\n--${u}--\r\n`)]);try{let a=await t.post(o,d,{headers:{Authorization:`Bearer ${i}`,"Content-Type":`multipart/form-data; boundary=${u}`,"Content-Length":d.length.toString()},timeout:E,signal:r.signal,validateStatus:()=>!0});if(a.status!==201){S(`upload failed for ${e}: status=${a.status} body=${s(a.data).slice(0,200)}`);return}let c=O().safeParse(a.data);if(!c.success){S(`unexpected response shape for ${e}: ${c.error.message}`);return}return S(`uploaded ${e} → ${c.data.file_uuid} (${n} bytes)`),c.data.file_uuid}catch(t){S(`upload threw for ${e}: ${t}`);return}}}var T,E,D,O;e((()=>{n(),i(),m(),p(),c(),d(),o(),T=30*1024*1024,E=3e4,D={".png":`image/png`,".jpg":`image/jpeg`,".jpeg":`image/jpeg`,".gif":`image/gif`,".webp":`image/webp`},O=u(()=>a({file_uuid:r()}))}))();export{w as uploadBriefAttachment};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{t}from"./jsx-runtime-Bb4Xn-E0.js";import{n,t as r}from"./Settings-DUXA-qac.js";var i,a;e((()=>{n(),i=t(),a=async(e,t)=>(0,i.jsx)(r,{onClose:e,context:t,defaultTab:`Usage`})}))();export{a as call};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{lS as t,uS as n}from"./loadAgentsDir-ZQwvbURI.js";import{C as r,_ as i,s as a}from"./model-BgrLt7P7.js";function o(){let e=n(e=>e.mainLoopModel);return r(n(e=>e.mainLoopModelForSession)??e??a())}var s=e((()=>{t(),i()}));export{o as n,s as t};
@@ -1 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{fi as t}from"./src-CDCSSo0U2.js";import{Cc as n,Sc as r,Sm as i,Tc as a,_m as o,fS as s,fs as c,lS as l,nv as u,oS as d,ps as f,rv as p,sS as m,uS as h,vy as g,wc as _,xm as v,ym as y,yy as b}from"./loadAgentsDir-ZQwvbURI.js";import{J as x,U as S,l as C,p as w}from"./debug-DiuXEmUq.js";import{_n as T,gn as E}from"./settings-BhvhCpVh.js";import{M as D,j as O}from"./git-Cgc8X5l2.js";import{o as k,s as A}from"./log-Duzb4o6h.js";import{n as j,r as M}from"./analytics-BotDBGh0.js";import{n as N,r as P}from"./pluginFlagging-_WUQP3Lq.js";import{t as F}from"./pluginBlocklist-Cw_l-yal.js";var I=e(t(),1);d(),j(),o(),l(),T(),C(),O(),S(),k(),_(),n(),g(),v(),u(),P(),c();function L({enabled:e=!0}={}){let t=s(),n=h(e=>e.plugins.needsRefresh),{addNotification:o}=m(),c=(0,I.useCallback)(async()=>{try{let{enabled:e,disabled:n,errors:s}=await f();await F();let c=N();Object.keys(c).length>0&&o({key:`plugin-delisted-flagged`,text:`Plugins flagged. Check /plugins`,color:`warning`,priority:`high`});let l=[],u=[];try{l=await r()}catch(e){let t=e instanceof Error?e.message:String(e);s.push({type:`generic-error`,source:`plugin-commands`,error:`Failed to load plugin commands: ${t}`})}try{u=await a()}catch(e){let t=e instanceof Error?e.message:String(e);s.push({type:`generic-error`,source:`plugin-agents`,error:`Failed to load plugin agents: ${t}`})}try{await b()}catch(e){let t=e instanceof Error?e.message:String(e);s.push({type:`generic-error`,source:`plugin-hooks`,error:`Failed to load plugin hooks: ${t}`})}let d=(await Promise.all(e.map(async e=>{if(e.mcpServers)return Object.keys(e.mcpServers).length;let t=await p(e,s);return t&&(e.mcpServers=t),t?Object.keys(t).length:0}))).reduce((e,t)=>e+t,0),m=(await Promise.all(e.map(async e=>{if(e.lspServers)return Object.keys(e.lspServers).length;let t=await i(e,s);return t&&(e.lspServers=t),t?Object.keys(t).length:0}))).reduce((e,t)=>e+t,0);y(),t(t=>{let r=t.plugins.errors.filter(e=>e.source===`lsp-manager`||e.source.startsWith(`plugin:`)),i=new Set(s.map(e=>e.type===`generic-error`?`generic-error:${e.source}:${e.error}`:`${e.type}:${e.source}`)),a=[...r.filter(e=>{let t=e.type===`generic-error`?`generic-error:${e.source}:${e.error}`:`${e.type}:${e.source}`;return!i.has(t)}),...s];return{...t,plugins:{...t.plugins,enabled:e,disabled:n,commands:l,errors:a}}}),w(`Loaded plugins - Enabled: ${e.length}, Disabled: ${n.length}, Commands: ${l.length}, Agents: ${u.length}, Errors: ${s.length}`);let h=e.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{enabled_count:e.length,disabled_count:n.length,inline_count:E(e,e=>e.source.endsWith(`@inline`)),marketplace_count:E(e,e=>!e.source.endsWith(`@inline`)),error_count:s.length,skill_count:l.length,agent_count:u.length,hook_count:h,mcp_count:d,lsp_count:m,ant_enabled_names:process.env.USER_TYPE===`ant`&&e.length>0?e.map(e=>e.name).sort().join(`,`):void 0}}catch(e){let n=x(e);return A(n),w(`Error loading plugins: ${e}`),t(e=>{let t=e.plugins.errors.filter(e=>e.source===`lsp-manager`||e.source.startsWith(`plugin:`)),r={type:`generic-error`,source:`plugin-system`,error:n.message};return{...e,plugins:{...e.plugins,enabled:[],disabled:[],commands:[],errors:[...t,r]}}}),{enabled_count:0,disabled_count:0,inline_count:0,marketplace_count:0,error_count:1,skill_count:0,agent_count:0,hook_count:0,mcp_count:0,lsp_count:0,load_failed:!0,ant_enabled_names:void 0}}},[t,o]);(0,I.useEffect)(()=>{e&&c().then(e=>{let{ant_enabled_names:t,...n}=e,r={...n,has_custom_plugin_cache_dir:!!process.env.CLAUDE_CODE_PLUGIN_CACHE_DIR};M(`tengu_plugins_loaded`,{...r,...t!==void 0&&{enabled_names:t}}),D(`info`,`tengu_plugins_loaded`,r)})},[c,e]),(0,I.useEffect)(()=>{!e||!n||o({key:`plugin-reload-pending`,text:`Plugins changed. Run /reload-plugins to activate.`,color:`suggestion`,priority:`low`})},[e,n,o])}export{L as t};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./axios-DaWTGg7G.js";import{p as r,t as i}from"./v4-jw6qOKwQ.js";import{AE as a,FD as o,ID as s,RD as c,dD as l,fD as u,jE as d,uD as f,zD as p}from"./loadAgentsDir-ZQwvbURI.js";import{B as m,D as h,E as g,G as _,O as ee,U as v,_ as y,h as b,l as te,p as x,z as S}from"./debug-DiuXEmUq.js";import{St as C,_t as w,bt as T,xt as ne,yt as re}from"./settings-BhvhCpVh.js";import{o as ie,s as E}from"./log-Duzb4o6h.js";import{homedir as ae}from"os";import*as D from"path";import{join as oe,resolve as se}from"path";import{randomBytes as O}from"crypto";import{readFile as k,readdir as A,rename as j,stat as M,unlink as N,writeFile as P}from"fs/promises";function F(){return oe(a(),H)}async function I(){let e=F();try{let t=h(await k(e,{encoding:`utf-8`}));if(typeof t!=`object`||!t||!(`version`in t)||!(`fetchedAt`in t)||!(`counts`in t))return x(`Install counts cache has invalid structure`),null;let n=t;if(n.version!==V)return x(`Install counts cache version mismatch (got ${n.version}, expected ${V})`),null;if(typeof n.fetchedAt!=`string`||!Array.isArray(n.counts))return x(`Install counts cache has invalid structure`),null;let r=new Date(n.fetchedAt).getTime();return Number.isNaN(r)?(x(`Install counts cache has invalid fetchedAt timestamp`),null):n.counts.every(e=>typeof e==`object`&&!!e&&typeof e.plugin==`string`&&typeof e.unique_installs==`number`)?Date.now()-r>W?(x(`Install counts cache is stale (>24h old)`),null):{version:n.version,fetchedAt:n.fetchedAt,counts:n.counts}:(x(`Install counts cache has malformed entries`),null)}catch(e){return m(e)!==`ENOENT`&&x(`Failed to load install counts cache: ${S(e)}`),null}}async function L(e){let t=F(),n=`${t}.${O(8).toString(`hex`)}.tmp`;try{let r=a();await b().mkdir(r),await P(n,ee(e,null,2),{encoding:`utf-8`,mode:384}),await j(n,t),x(`Install counts cache saved successfully`)}catch(e){E(e);try{await N(n)}catch{}}}async function R(){x(`Fetching install counts from ${U}`);let e=performance.now();try{let n=await t.get(U,{timeout:1e4});if(!n.data?.plugins||!Array.isArray(n.data.plugins))throw Error(`Invalid response format from install counts API`);return u(`install_counts`,U,`success`,performance.now()-e),n.data.plugins}catch(t){throw u(`install_counts`,U,`failure`,performance.now()-e,f(t)),t}}async function z(){let e=await I();if(e){x(`Using cached install counts`),u(`install_counts`,U,`cache_hit`,0);let t=new Map;for(let n of e.counts)t.set(n.plugin,n.unique_installs);return t}try{let e=await R();await L({version:V,fetchedAt:new Date().toISOString(),counts:e});let t=new Map;for(let n of e)t.set(n.plugin,n.unique_installs);return t}catch(e){return E(e),x(`Failed to fetch install counts: ${S(e)}`),null}}function B(e){if(e<1e3)return String(e);if(e<1e6){let t=(e/1e3).toFixed(1);return t.endsWith(`.0`)?`${t.slice(0,-2)}K`:`${t}K`}let t=(e/1e6).toFixed(1);return t.endsWith(`.0`)?`${t.slice(0,-2)}M`:`${t}M`}var V,H,U,W,G=e((()=>{n(),te(),v(),y(),ie(),g(),l(),d(),V=1,H=`install-counts-cache.json`,U=`https://raw.githubusercontent.com/anthropics/claude-plugins-official/refs/heads/stats/stats/plugin-installs.json`,W=1440*60*1e3}));async function K(e){let t=e.trim(),n=b(),r=t.match(/^([a-zA-Z0-9._-]+@[^:]+:.+?(?:\.git)?)(#(.+))?$/);if(r?.[1]){let e=r[1],t=r[3];return t?{source:`git`,url:e,ref:t}:{source:`git`,url:e}}if(t.startsWith(`http://`)||t.startsWith(`https://`)){let e=t.match(/^([^#]+)(#(.+))?$/),n=e?.[1]||t,r=e?.[3];if(n.endsWith(`.git`)||n.includes(`/_git/`))return r?{source:`git`,url:n,ref:r}:{source:`git`,url:n};let i;try{i=new URL(n)}catch{return{source:`url`,url:n}}if((i.hostname===`github.com`||i.hostname===`www.github.com`)&&i.pathname.match(/^\/([^/]+\/[^/]+?)(\/|\.git|$)/)?.[1]){let e=n.endsWith(`.git`)?n:`${n}.git`;return r?{source:`git`,url:e,ref:r}:{source:`git`,url:e}}return{source:`url`,url:n}}let i=process.platform===`win32`&&(t.startsWith(`.\\`)||t.startsWith(`..\\`)||/^[a-zA-Z]:[/\\]/.test(t));if(t.startsWith(`./`)||t.startsWith(`../`)||t.startsWith(`/`)||t.startsWith(`~`)||i){let e=se(t.startsWith(`~`)?t.replace(/^~/,ae()):t),r;try{r=await n.stat(e)}catch(t){let n=m(t);return{error:n===`ENOENT`?`Path does not exist: ${e}`:`Cannot access path: ${e} (${n??t})`}}return r.isFile()?e.endsWith(`.json`)?{source:`file`,path:e}:{error:`File path must point to a .json file (marketplace.json), but got: ${e}`}:r.isDirectory()?{source:`directory`,path:e}:{error:`Path is neither a file nor a directory: ${e}`}}if(t.includes(`/`)&&!t.startsWith(`@`)){if(t.includes(`:`))return null;let e=t.match(/^([^#@]+)(?:[#@](.+))?$/),n=e?.[1]||t,r=e?.[2];return r?{source:`github`,repo:n,ref:r}:{source:`github`,repo:n}}return null}var ce=e((()=>{v(),y()}));function le(e){let t=D.basename(e),n=D.basename(D.dirname(e));return t===`plugin.json`?`plugin`:t===`marketplace.json`?`marketplace`:n===`.claude-plugin`?`plugin`:`unknown`}function q(e){return e.issues.map(e=>({path:e.path.join(`.`)||`root`,message:e.message,code:e.code}))}function J(e,t,n,r){e.includes(`..`)&&n.push({path:t,message:r?`Path contains "..": ${e}. ${r}`:`Path contains ".." which could be a path traversal attempt: ${e}`})}function ue(e){let t=e.replace(/^(\.\.\/)+/,``);return`Plugin source paths are resolved relative to the marketplace root (the directory containing .claude-plugin/), not relative to marketplace.json. Use "${t===e?`./plugins/my-plugin`:`./${t}`}" instead of "${e}".`}async function Y(e){let t=[],n=[],r=D.resolve(e),i;try{i=await k(r,{encoding:`utf-8`})}catch(e){let t=m(e),n;return n=t===`ENOENT`?`File not found: ${r}`:t===`EISDIR`?`Path is not a file: ${r}`:`Failed to read file: ${S(e)}`,{success:!1,errors:[{path:`file`,message:n,code:t}],warnings:[],filePath:r,fileType:`plugin`}}let a;try{a=h(i)}catch(e){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${S(e)}`}],warnings:[],filePath:r,fileType:`plugin`}}if(a&&typeof a==`object`){let e=a;e.commands&&(Array.isArray(e.commands)?e.commands:[e.commands]).forEach((e,n)=>{typeof e==`string`&&J(e,`commands[${n}]`,t)}),e.agents&&(Array.isArray(e.agents)?e.agents:[e.agents]).forEach((e,n)=>{typeof e==`string`&&J(e,`agents[${n}]`,t)}),e.skills&&(Array.isArray(e.skills)?e.skills:[e.skills]).forEach((e,n)=>{typeof e==`string`&&J(e,`skills[${n}]`,t)})}let o=a;if(typeof a==`object`&&a){let e=a,t=Object.keys(e).filter(e=>$.has(e));if(t.length>0){let r={...e};for(let e of t)delete r[e],n.push({path:e,message:`Field '${e}' belongs in the marketplace entry (marketplace.json), not plugin.json. It's harmless here but unused — Work Mate ignores it at load time.`});o=r}}let s=re().strict().safeParse(o);if(s.success||t.push(...q(s.error)),s.success){let e=s.data;/^[a-z0-9]+(-[a-z0-9]+)*$/.test(e.name)||n.push({path:`name`,message:`Plugin name "${e.name}" is not kebab-case. Work Mate accepts it, but the Claude.ai marketplace sync requires kebab-case (lowercase letters, digits, and hyphens only, e.g., "my-plugin").`}),e.version||n.push({path:`version`,message:`No version specified. Consider adding a version following semver (e.g., "1.0.0")`}),e.description||n.push({path:`description`,message:`No description provided. Adding a description helps users understand what your plugin does`}),e.author||n.push({path:`author`,message:`No author information provided. Consider adding author details for plugin attribution`})}return{success:t.length===0,errors:t,warnings:n,filePath:r,fileType:`plugin`}}async function X(e){let t=[],n=[],i=D.resolve(e),a;try{a=await k(i,{encoding:`utf-8`})}catch(e){let t=m(e),n;return n=t===`ENOENT`?`File not found: ${i}`:t===`EISDIR`?`Path is not a file: ${i}`:`Failed to read file: ${S(e)}`,{success:!1,errors:[{path:`file`,message:n,code:t}],warnings:[],filePath:i,fileType:`marketplace`}}let o;try{o=h(a)}catch(e){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${S(e)}`}],warnings:[],filePath:i,fileType:`marketplace`}}if(o&&typeof o==`object`){let e=o;Array.isArray(e.plugins)&&e.plugins.forEach((e,n)=>{if(e&&typeof e==`object`&&`source`in e){let r=e.source;typeof r==`string`&&J(r,`plugins[${n}].source`,t,ue(r)),r&&typeof r==`object`&&`path`in r&&typeof r.path==`string`&&J(r.path,`plugins[${n}].source.path`,t)}})}let s=ne().extend({plugins:r(T().strict())}).strict().safeParse(o);if(s.success||t.push(...q(s.error)),s.success){let e=s.data;if((!e.plugins||e.plugins.length===0)&&n.push({path:`plugins`,message:`Marketplace has no plugins defined`}),e.plugins){e.plugins.forEach((n,r)=>{e.plugins.filter(e=>e.name===n.name).length>1&&t.push({path:`plugins[${r}].name`,message:`Duplicate plugin name "${n.name}" found in marketplace`})});let r=D.dirname(i),a=D.basename(r)===`.claude-plugin`?D.dirname(r):r;for(let[t,r]of e.plugins.entries()){if(!r.version||typeof r.source!=`string`||!r.source.startsWith(`./`))continue;let e=D.join(a,r.source,`.claude-plugin`,`plugin.json`),i;try{let t=h(await k(e,{encoding:`utf-8`}));typeof t.version==`string`&&(i=t.version)}catch{continue}i&&i!==r.version&&n.push({path:`plugins[${t}].version`,message:`Entry declares version "${r.version}" but ${r.source}/.claude-plugin/plugin.json says "${i}". At install time, plugin.json wins (calculatePluginVersion precedence) — the entry version is silently ignored. Update this entry to "${i}" to match.`})}}e.metadata?.description||n.push({path:`metadata.description`,message:`No marketplace description provided. Adding a description helps users understand what this marketplace offers`})}return{success:t.length===0,errors:t,warnings:n,filePath:i,fileType:`marketplace`}}function de(e,t,n){let r=[],i=[],a=t.match(o);if(!a)return i.push({path:`frontmatter`,message:`No frontmatter block found. Add YAML frontmatter between --- delimiters at the top of the file to set description and other metadata.`}),{success:!0,errors:r,warnings:i,filePath:e,fileType:n};let s=a[1]||``,c;try{c=p(s)}catch(t){return r.push({path:`frontmatter`,message:`YAML frontmatter failed to parse: ${S(t)}. At runtime this ${n} loads with empty metadata (all frontmatter fields silently dropped).`}),{success:!1,errors:r,warnings:i,filePath:e,fileType:n}}if(typeof c!=`object`||!c||Array.isArray(c))return r.push({path:`frontmatter`,message:`Frontmatter must be a YAML mapping (key: value pairs), got ${Array.isArray(c)?`an array`:c===null?`null`:typeof c}.`}),{success:!1,errors:r,warnings:i,filePath:e,fileType:n};let l=c;if(l.description!==void 0){let e=l.description;typeof e!=`string`&&typeof e!=`number`&&typeof e!=`boolean`&&e!==null&&r.push({path:`description`,message:`description must be a string, got ${Array.isArray(e)?`array`:typeof e}. At runtime this value is dropped.`})}else i.push({path:`description`,message:`No description in frontmatter. A description helps users and Claude understand when to use this ${n}.`});l.name!==void 0&&l.name!==null&&typeof l.name!=`string`&&r.push({path:`name`,message:`name must be a string, got ${typeof l.name}.`});let u=l[`allowed-tools`];u!=null&&(typeof u!=`string`&&!Array.isArray(u)?r.push({path:`allowed-tools`,message:`allowed-tools must be a string or array of strings, got ${typeof u}.`}):Array.isArray(u)&&u.some(e=>typeof e!=`string`)&&r.push({path:`allowed-tools`,message:`allowed-tools array must contain only strings.`}));let d=l.shell;if(d!=null)if(typeof d!=`string`)r.push({path:`shell`,message:`shell must be a string, got ${typeof d}.`});else{let e=d.trim().toLowerCase();e!==`bash`&&e!==`powershell`&&r.push({path:`shell`,message:`shell must be 'bash' or 'powershell', got '${d}'.`})}return{success:r.length===0,errors:r,warnings:i,filePath:e,fileType:n}}async function Z(e){let t;try{t=await k(e,{encoding:`utf-8`})}catch(t){return m(t)===`ENOENT`?{success:!0,errors:[],warnings:[],filePath:e,fileType:`hooks`}:{success:!1,errors:[{path:`file`,message:`Failed to read file: ${S(t)}`}],warnings:[],filePath:e,fileType:`hooks`}}let n;try{n=h(t)}catch(t){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${S(t)}. At runtime this breaks the entire plugin load.`}],warnings:[],filePath:e,fileType:`hooks`}}let r=w().safeParse(n);return r.success?{success:!0,errors:[],warnings:[],filePath:e,fileType:`hooks`}:{success:!1,errors:q(r.error),warnings:[],filePath:e,fileType:`hooks`}}async function Q(e,t){let n;try{n=await A(e,{withFileTypes:!0})}catch(e){let t=m(e);if(t===`ENOENT`||t===`ENOTDIR`)return[];throw e}if(t)return n.filter(e=>e.isDirectory()).map(t=>D.join(e,t.name,`SKILL.md`));let r=[];for(let t of n){let n=D.join(e,t.name);t.isDirectory()?r.push(...await Q(n,!1)):t.isFile()&&t.name.toLowerCase().endsWith(`.md`)&&r.push(n)}return r}async function fe(e){let t=[],n=[[`skill`,D.join(e,`skills`)],[`agent`,D.join(e,`agents`)],[`command`,D.join(e,`commands`)]];for(let[e,r]of n){let n=await Q(r,e===`skill`);for(let r of n){let n;try{n=await k(r,{encoding:`utf-8`})}catch(n){if(_(n))continue;t.push({success:!1,errors:[{path:`file`,message:`Failed to read: ${S(n)}`}],warnings:[],filePath:r,fileType:e});continue}let i=de(r,n,e);(i.errors.length>0||i.warnings.length>0)&&t.push(i)}}let r=await Z(D.join(e,`hooks`,`hooks.json`));return(r.errors.length>0||r.warnings.length>0)&&t.push(r),t}async function pe(e){let t=D.resolve(e),n=null;try{n=await M(t)}catch(e){if(!_(e))throw e}if(n?.isDirectory()){let e=await X(D.join(t,`.claude-plugin`,`marketplace.json`));if(e.errors[0]?.code!==`ENOENT`)return e;let n=await Y(D.join(t,`.claude-plugin`,`plugin.json`));return n.errors[0]?.code===`ENOENT`?{success:!1,errors:[{path:`directory`,message:`No manifest found in directory. Expected .claude-plugin/marketplace.json or .claude-plugin/plugin.json`}],warnings:[],filePath:t,fileType:`plugin`}:n}switch(le(e)){case`plugin`:return Y(e);case`marketplace`:return X(e);case`unknown`:try{let n=h(await k(t,{encoding:`utf-8`}));if(Array.isArray(n.plugins))return X(e)}catch(e){if(m(e)===`ENOENT`)return{success:!1,errors:[{path:`file`,message:`File not found: ${t}`}],warnings:[],filePath:t,fileType:`plugin`}}return Y(e)}}var $,me=e((()=>{i(),v(),s(),g(),c(),C(),$=new Set([`category`,`source`,`tags`,`strict`,`id`])}));export{K as a,G as c,ce as i,pe as n,B as o,fe as r,z as s,me as t};
@@ -1 +0,0 @@
1
- import{i as e,o as t}from"./windowsPaths-N_YmYY6k.js";e();export{t as setShellIfWindows};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{n as r,t as i}from"./cwd-CYmmnQVS.js";import{l as a,p as o}from"./debug-DiuXEmUq.js";import{n as s,t as c}from"./memoize-DgMjqLtn.js";import{n as l,t as u}from"./execSyncWrapper-CWxMek26.js";import{i as d,o as f}from"./platform-B5dCGT8t.js";import{existsSync as p}from"fs";import*as m from"path/win32";function h(){if(d()===`windows`){let e=y();process.env.SHELL=e,process.env.CLAUDE_CODE_GIT_BASH_PATH=e,o(`Using bash path: "${e}"`)}}function g(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 _(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=m.resolve(t.cwdFn()).toLowerCase();for(let e of n){let t=m.resolve(e).toLowerCase(),n=m.dirname(t).toLowerCase(),i=m.relative(r,n);if(i===``||!i.startsWith(`..`)&&!m.isAbsolute(i)){o(`Skipping potentially malicious executable in current directory: ${e}`);continue}return e}return null}catch{return null}}function v(e=b){let t=e.envOverride??process.env.CLAUDE_CODE_GIT_BASH_PATH;if(t)return e.checkExists(t)?t:null;let n=_(`bash`,e);if(n&&e.checkExists(n))return n;let r=_(`git`,e);if(r){let t=[m.join(r,`..`,`..`,`bin`,`bash.exe`),m.join(r,`..`,`..`,`usr`,`bin`,`bash.exe`),m.join(r,`..`,`bash.exe`)];for(let n of t)if(e.checkExists(n))return n}return g(e.checkExists,e.userProfile)}function y(){let e=x();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 b,x,S,C,w=e((()=>{n(),r(),a(),l(),c(),f(),b={checkExists:p,execCommand:e=>u(e,{stdio:`pipe`,encoding:`utf8`}).trim(),cwdFn:i,userProfile:process.env.USERPROFILE,envOverride:void 0},x=t(()=>v()),S=s(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),C=s(e=>{if(e.startsWith(`//`))return e.replace(/\//g,`\\`);let t=e.match(/^\/cygdrive\/([A-Za-z])(\/|$)/);if(t){let n=t[1].toUpperCase(),r=e.slice((`/cygdrive/`+t[1]).length);return n+`:`+(r||`\\`).replace(/\//g,`\\`)}let n=e.match(/^\/([A-Za-z])(\/|$)/);if(n){let t=n[1].toUpperCase(),r=e.slice(2);return t+`:`+(r||`\\`).replace(/\//g,`\\`)}return e.replace(/\//g,`\\`)},e=>e,500)}));export{C as a,w as i,x as n,h as o,v as r,S as s,y as t};
@@ -1 +0,0 @@
1
- import{Et as e,xt as t}from"./loadAgentsDir-ZQwvbURI.js";e();export{t as execIntoTmuxWorktree};