claude-code-best 2.6.8 → 2.6.9

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 (400) hide show
  1. package/dist/chunks/{AddWorkspaceDirectory-YmrkKVv2.js → AddWorkspaceDirectory-_RSNUS7K.js} +1 -1
  2. package/dist/chunks/{App-IAjCdPUn.js → App-4VqMMjIu.js} +1 -1
  3. package/dist/chunks/{ApproveApiKey-DhsT69v7.js → ApproveApiKey-B7oSxzWc.js} +1 -1
  4. package/dist/chunks/ApproveApiKey-Bmcop2Do.js +1 -0
  5. package/dist/chunks/{AssistantSessionChooser-DCUVNGfn.js → AssistantSessionChooser-Lf5l_1Dh.js} +1 -1
  6. package/dist/chunks/{BackgroundTasksDialog-Di_gH2TW.js → BackgroundTasksDialog-Ckgmqm6u.js} +1 -1
  7. package/dist/chunks/{BypassPermissionsModeDialog-BeZqE75e.js → BypassPermissionsModeDialog-DNqPpiPC.js} +1 -1
  8. package/dist/chunks/{ClaudeInChromeOnboarding-CZHktpPE.js → ClaudeInChromeOnboarding-BODZ64gw.js} +1 -1
  9. package/dist/chunks/{ClaudeMdExternalIncludesDialog-Dofr1TYr.js → ClaudeMdExternalIncludesDialog-DLI6ey3G.js} +1 -1
  10. package/dist/chunks/ClaudeMdExternalIncludesDialog-DO61Zz-S.js +1 -0
  11. package/dist/chunks/ConsoleOAuthFlow-FSHC5mxO.js +1 -0
  12. package/dist/chunks/{DesktopHandoff-C8_CDNft.js → DesktopHandoff--xyI5kTQ.js} +1 -1
  13. package/dist/chunks/{DevChannelsDialog-DkGWCFpL.js → DevChannelsDialog-DJ4mHsA_.js} +1 -1
  14. package/dist/chunks/{DiffDialog-93P95op8.js → DiffDialog-CVWUlOjm.js} +1 -1
  15. package/dist/chunks/{Doctor-Zd0UaR5d.js → Doctor-DVoFX-9y.js} +1 -1
  16. package/dist/chunks/Doctor-Dcntgp5Z.js +1 -0
  17. package/dist/chunks/{ExitFlow-4edARxmd.js → ExitFlow-BKzQPr75.js} +1 -1
  18. package/dist/chunks/{Feedback-CZY-BikO.js → Feedback-hFZwDSRp.js} +1 -1
  19. package/dist/chunks/Grove-Cmcsx2UE.js +1 -0
  20. package/dist/chunks/{Grove-TYf1glGP.js → Grove-G0DtwY22.js} +1 -1
  21. package/dist/chunks/{HybridTransport-BNexuwcN.js → HybridTransport-xN03sWrt.js} +1 -1
  22. package/dist/chunks/{ITermBackend-DuomVpsD.js → ITermBackend-DzN3ZWds.js} +1 -1
  23. package/dist/chunks/{InvalidConfigDialog-Byury3Zx.js → InvalidConfigDialog-Iy4Su1Lm.js} +1 -1
  24. package/dist/chunks/{InvalidSettingsDialog-B8_0AvWo.js → InvalidSettingsDialog-dx4y_nY-.js} +1 -1
  25. package/dist/chunks/{MCPConnectionManager-xL_wQCda.js → MCPConnectionManager-kVO-4BcA.js} +1 -1
  26. package/dist/chunks/{McpParsingWarnings-C6u4RM2a.js → McpParsingWarnings-D420-W8M.js} +1 -1
  27. package/dist/chunks/{MessageSelector-DAyH1noQ.js → MessageSelector-CDVC2CAj.js} +1 -1
  28. package/dist/chunks/{Messages-QH8_sB13.js → Messages-C5gVVVmY.js} +2 -2
  29. package/dist/chunks/{Onboarding-XWhelEBr.js → Onboarding-BkidUre_.js} +1 -1
  30. package/dist/chunks/{OverageCreditUpsell-BvPz1jLU.js → OverageCreditUpsell-DoRUucoN.js} +1 -1
  31. package/dist/chunks/{PluginSettings-D1YHfrE1.js → PluginSettings-DhpNtjTm.js} +1 -1
  32. package/dist/chunks/{PromptInputFooterSuggestions-rqUoa9Ch.js → PromptInputFooterSuggestions-BnpXzkW9.js} +1 -1
  33. package/dist/chunks/{PromptInputHelpMenu-OTViHSR0.js → PromptInputHelpMenu-DKbiO4C0.js} +1 -1
  34. package/dist/chunks/{QueryEngine-DigBggXq.js → QueryEngine-J15EOjWx.js} +1 -1
  35. package/dist/chunks/REPL-Dk3Ics9i.js +1 -0
  36. package/dist/chunks/{REPL-D2p-vgct.js → REPL-nrJ13J1o.js} +6 -6
  37. package/dist/chunks/{RemoteCallout-CCIWIrd-.js → RemoteCallout-DGXIcTKv.js} +1 -1
  38. package/dist/chunks/{RemoteSessionManager-Dx81p5dH.js → RemoteSessionManager-3KsuTCZM.js} +1 -1
  39. package/dist/chunks/{ResumeConversation-73r3Zh5P.js → ResumeConversation-kS7lkjJm.js} +1 -1
  40. package/dist/chunks/{SSETransport-C9hd2v-w.js → SSETransport-Cy1rXP6E.js} +1 -1
  41. package/dist/chunks/SearchExtraToolsTool-C998WSxs.js +1 -0
  42. package/dist/chunks/SentryErrorBoundary-BJLT-ebr.js +1 -0
  43. package/dist/chunks/{SentryErrorBoundary-z8tMb-zO.js → SentryErrorBoundary-B_6MfzRa.js} +1 -1
  44. package/dist/chunks/{Settings-D9qdaMe5.js → Settings-DBopjMkN.js} +2 -2
  45. package/dist/chunks/{TeleportProgress-CPXN7u3Z.js → TeleportProgress-CQUN_zoe.js} +1 -1
  46. package/dist/chunks/{TeleportRepoMismatchDialog-CiyXjTxq.js → TeleportRepoMismatchDialog-CPquWrd-.js} +1 -1
  47. package/dist/chunks/{TeleportResumeWrapper-Dao8ktHk.js → TeleportResumeWrapper-NIFNCHIO.js} +1 -1
  48. package/dist/chunks/{ThemePicker-CFYFNnPp.js → ThemePicker-DnK0DStD.js} +1 -1
  49. package/dist/chunks/{TmuxBackend-B5DBBugq.js → TmuxBackend-C00k5RF9.js} +1 -1
  50. package/dist/chunks/{TrustDialog-DtIXHMR_.js → TrustDialog-CUnvtDeS.js} +1 -1
  51. package/dist/chunks/{ValidationErrorsList-BK0wOS55.js → ValidationErrorsList-CJbO1qub.js} +1 -1
  52. package/dist/chunks/{WelcomeV2-BjUbi9vp.js → WelcomeV2-BBFGft_e.js} +1 -1
  53. package/dist/chunks/{WindowsTerminalBackend-DFLLlAOp.js → WindowsTerminalBackend-DSsgxuNK.js} +1 -1
  54. package/dist/chunks/{add-dir-JoVgNFOk.js → add-dir-BPqd010H.js} +1 -1
  55. package/dist/chunks/{agentDisplay-B3RjWR-3.js → agentDisplay-C0B1b_90.js} +1 -1
  56. package/dist/chunks/{agents-UqS5PhD2.js → agents-CYs7WGHP.js} +1 -1
  57. package/dist/chunks/{agents-BUyLUAIu.js → agents-DMzVeRly.js} +1 -1
  58. package/dist/chunks/{ant-Bq1wIvnP.js → ant-BO0Hmoii.js} +1 -1
  59. package/dist/chunks/api-B2HW-oZI.js +1 -0
  60. package/dist/chunks/{api-O4eHGLTY.js → api-DLLVkmRJ.js} +1 -1
  61. package/dist/chunks/asciicast-C3nf97NR.js +1 -0
  62. package/dist/chunks/{asciicast-o5Zg4dJt.js → asciicast-DIsaWcsJ.js} +1 -1
  63. package/dist/chunks/assistant-BmM44yln.js +1 -0
  64. package/dist/chunks/{assistant-CMIbt3Ir.js → assistant-CHp4-EaF.js} +1 -1
  65. package/dist/chunks/{assistant-D5Tg_1ry.js → assistant-_dIpsqHM.js} +1 -1
  66. package/dist/chunks/{auth-D3SKo0wT.js → auth-DelyQc8g.js} +1 -1
  67. package/dist/chunks/auth-ndSNSeqS.js +1 -0
  68. package/dist/chunks/{autoMode-BIVJlkBM.js → autoMode-D3-o7xPK.js} +1 -1
  69. package/dist/chunks/{autonomy-Mi7Fkq1J.js → autonomy-CzSRoxjl.js} +1 -1
  70. package/dist/chunks/{autonomy-BYi6z9LD.js → autonomy-tTAucjip.js} +1 -1
  71. package/dist/chunks/{autonomyPanel-D_GsUMOf.js → autonomyPanel-DcK8N52K.js} +1 -1
  72. package/dist/chunks/{backgroundHousekeeping-BG_UYxFF.js → backgroundHousekeeping-Bbkz61_-.js} +2 -2
  73. package/dist/chunks/backgroundHousekeeping-DVo3ndZr.js +1 -0
  74. package/dist/chunks/{branch-BC-K45fw.js → branch-ZJF4xAh9.js} +1 -1
  75. package/dist/chunks/{bridge-DBteRzgS.js → bridge-C6gSt_32.js} +2 -2
  76. package/dist/chunks/{bridgeConfig-C_GoD1k5.js → bridgeConfig-DXUNQp2l.js} +1 -1
  77. package/dist/chunks/bridgeConfig-ZcbBdhji.js +1 -0
  78. package/dist/chunks/bridgeEnabled-D5qCI5v2.js +1 -0
  79. package/dist/chunks/{bridgeEnabled-cSK8a7tN.js → bridgeEnabled-G6vxQV-7.js} +1 -1
  80. package/dist/chunks/bridgeMain-B4Zv8UOe.js +1 -0
  81. package/dist/chunks/{bridgeMain-QbfEOTqV.js → bridgeMain-DlnIQOtX.js} +6 -6
  82. package/dist/chunks/{bridgeMessaging-CqXQzew4.js → bridgeMessaging-mek-AaFi.js} +1 -1
  83. package/dist/chunks/{bridgePointer-FvAMj3re.js → bridgePointer-B2FPGDWR.js} +1 -1
  84. package/dist/chunks/{btw-DBtPlEWc.js → btw-Cz2lyle-.js} +1 -1
  85. package/dist/chunks/{buddy-BYwTgNnf.js → buddy-BMqKttFw.js} +1 -1
  86. package/dist/chunks/{bypassPermissionsKillswitch-DkYLp9m0.js → bypassPermissionsKillswitch-BxvX48jr.js} +1 -1
  87. package/dist/chunks/caches-D_W3nCFE.js +1 -0
  88. package/dist/chunks/{caches-DGW9ovtw.js → caches-wtRUk5y5.js} +2 -2
  89. package/dist/chunks/{ccrClient-B9pi3b8Y.js → ccrClient-BOrmrmgF.js} +1 -1
  90. package/dist/chunks/changeDetector-CUsHUdul.js +1 -0
  91. package/dist/chunks/channelNotification-CLVU5AuO.js +1 -0
  92. package/dist/chunks/{channelNotification-n7Avue-9.js → channelNotification-D8do6HUN.js} +1 -1
  93. package/dist/chunks/{chrome-BwZPfW9Z.js → chrome-JF2BXNK6.js} +1 -1
  94. package/dist/chunks/clear-BP-G1JWa.js +1 -0
  95. package/dist/chunks/client-BHfY6SC5.js +1 -0
  96. package/dist/chunks/{color-BsBrog6H.js → color-oh8CGhkI.js} +1 -1
  97. package/dist/chunks/commands-E0eNJ_XZ.js +1 -0
  98. package/dist/chunks/commitAttribution-B4DOgUS7.js +1 -0
  99. package/dist/chunks/{commitAttribution-q7SEukgl.js → commitAttribution-CUdm_sRl.js} +1 -1
  100. package/dist/chunks/{compact-DiY1w7pT.js → compact-R6vMbGQQ.js} +1 -1
  101. package/dist/chunks/{companion-D18UNnC7.js → companion-ClxqTyG9.js} +1 -1
  102. package/dist/chunks/{config-D3QKcEKz.js → config-BQ-MayP6.js} +1 -1
  103. package/dist/chunks/{config-CSHnElBp.js → config-CPK9PlWS.js} +1 -1
  104. package/dist/chunks/{context-DnyYrN2X.js → context-CWfsKYEB.js} +1 -1
  105. package/dist/chunks/{context-noninteractive-CFlod2Eg.js → context-noninteractive-BJ4hE3MX.js} +1 -1
  106. package/dist/chunks/context-noninteractive-D1Kxn5e0.js +1 -0
  107. package/dist/chunks/conversation-C23rDJe3.js +1 -0
  108. package/dist/chunks/{conversation-CRoOMglD.js → conversation-DizpkPtq.js} +1 -1
  109. package/dist/chunks/{copy-CHGX-YpC.js → copy-BuPCS2HG.js} +1 -1
  110. package/dist/chunks/{createSSHSession-Bf-8h3Sw.js → createSSHSession-Di9Je4Th.js} +1 -1
  111. package/dist/chunks/createSession-Bsa0VJKS.js +1 -0
  112. package/dist/chunks/{createSession-rRZIkjl3.js → createSession-D6v0lBtG.js} +1 -1
  113. package/dist/chunks/{cronJitterConfig-DmBBJDTf.js → cronJitterConfig-By18m-PD.js} +1 -1
  114. package/dist/chunks/{crossProjectResume-BQxLBpDD.js → crossProjectResume-C4YT2T6P.js} +1 -1
  115. package/dist/chunks/{datadog-Bb65d6yd.js → datadog-BFSdlK6C.js} +1 -1
  116. package/dist/chunks/datadog-MUvg76p3.js +1 -0
  117. package/dist/chunks/{desktop-DiCA6RUU.js → desktop-Bd-JHrBo.js} +1 -1
  118. package/dist/chunks/{diff-BvLQ-t8P.js → diff-DGmINgOc.js} +1 -1
  119. package/dist/chunks/{directoryCompletion-DP_4B1GL.js → directoryCompletion-D7EGwonO.js} +1 -1
  120. package/dist/chunks/{doctor-bmTXLycZ.js → doctor-DQ42RQPx.js} +1 -1
  121. package/dist/chunks/{effort-CSTwkB2B.js → effort-E6XjzPYR.js} +1 -1
  122. package/dist/chunks/entry-Di8oWZUk.js +14 -0
  123. package/dist/chunks/{envLessBridgeConfig-DJJKeDBT.js → envLessBridgeConfig-BNvozi46.js} +1 -1
  124. package/dist/chunks/envLessBridgeConfig-CUTBQKDY.js +1 -0
  125. package/dist/chunks/{exit-eirVuF-n.js → exit-CVlpMwCq.js} +1 -1
  126. package/dist/chunks/{export-CcJD8r8U.js → export-CXcPQd0T.js} +1 -1
  127. package/dist/chunks/{exportRenderer-DtezFcml.js → exportRenderer-B9WXgMV2.js} +1 -1
  128. package/dist/chunks/{extra-usage-CBcgeIcJ.js → extra-usage-B2KmuAZe.js} +1 -1
  129. package/dist/chunks/extra-usage-DVtAa1zD.js +1 -0
  130. package/dist/chunks/{extra-usage-core-DWM0Q56J.js → extra-usage-core-B20tawuN.js} +1 -1
  131. package/dist/chunks/{extra-usage-noninteractive-BvJEi4WX.js → extra-usage-noninteractive-DZRe98BZ.js} +1 -1
  132. package/dist/chunks/{extraUsage-CWde-Mi0.js → extraUsage-CxqJdnGC.js} +1 -1
  133. package/dist/chunks/extractMemories-8uB606Y0.js +1 -0
  134. package/dist/chunks/{fast-DQyJ7c7s.js → fast-CPmJ2bp3.js} +1 -1
  135. package/dist/chunks/fast-DTGg3pRh.js +1 -0
  136. package/dist/chunks/{feedback-BzBBKT2y.js → feedback-4GY3ahvw.js} +1 -1
  137. package/dist/chunks/{firstPartyEventLogger-BOHIpp-w.js → firstPartyEventLogger-CISUrAsf.js} +1 -1
  138. package/dist/chunks/{flushGate-DeCDhkKp.js → flushGate-Dr8sMjB7.js} +1 -1
  139. package/dist/chunks/gates-BbF5S-Dy.js +1 -0
  140. package/dist/chunks/{gates-CAVdjC23.js → gates-DI4pxvrD.js} +1 -1
  141. package/dist/chunks/{gemini-CFrOUVS4.js → gemini-Dcfosr2Z.js} +1 -1
  142. package/dist/chunks/{generateRecap-Bcp5DiiO.js → generateRecap-CH_fgtxk.js} +1 -1
  143. package/dist/chunks/{generateSessionName-DeFGkHct.js → generateSessionName-DO0R__8w.js} +1 -1
  144. package/dist/chunks/{githubRepoPathMapping-B07Wb07_.js → githubRepoPathMapping-D5I8CVDz.js} +1 -1
  145. package/dist/chunks/{grok-DtidcVWD.js → grok-X0FzcE6Y.js} +1 -1
  146. package/dist/chunks/{growthbook-gLwBDK-r.js → growthbook-DZPT2JzB.js} +1 -1
  147. package/dist/chunks/{heapdump-BxQYlnPR.js → heapdump-Cq6i0wJH.js} +1 -1
  148. package/dist/chunks/{help-Bi0sABuv.js → help-B8ddA-Ec.js} +1 -1
  149. package/dist/chunks/{hooks-Cc_DxF9N.js → hooks-CvFNccdv.js} +1 -1
  150. package/dist/chunks/hooks-gwB4Eotj.js +1 -0
  151. package/dist/chunks/{hostAdapter-D9_d4gU0.js → hostAdapter-D3s4JFk-.js} +1 -1
  152. package/dist/chunks/{ide-3wDIOoZF.js → ide-CzxV5_D7.js} +1 -1
  153. package/dist/chunks/{inboundAttachments-DPMETKd6.js → inboundAttachments-B3ZTyNKF.js} +1 -1
  154. package/dist/chunks/inboundAttachments-DxrrrqBW.js +1 -0
  155. package/dist/chunks/{initReplBridge-BWP41EGm.js → initReplBridge-DWpGy3aE.js} +1 -1
  156. package/dist/chunks/{insights-w7qM4YyA.js → insights-DiWlKgVQ.js} +1 -1
  157. package/dist/chunks/{install-N2FgArWv.js → install-BFpg1zm1.js} +1 -1
  158. package/dist/chunks/{install-github-app-By39Zi78.js → install-github-app-BUCGGSw0.js} +1 -1
  159. package/dist/chunks/{install-slack-app-CVwZphU-.js → install-slack-app-D5JDqzbs.js} +1 -1
  160. package/dist/chunks/{instrumentation-BkLEupDC.js → instrumentation--BToLJT9.js} +3 -3
  161. package/dist/chunks/{job-CgBE27O7.js → job-mUyxSEc2.js} +1 -1
  162. package/dist/chunks/{keybindings-DHXJzU3E.js → keybindings-D4DbE4G0.js} +1 -1
  163. package/dist/chunks/{lang-DLneRt1b.js → lang-cMcnaxAR.js} +1 -1
  164. package/dist/chunks/language-DC6bsdvI.js +1 -0
  165. package/dist/chunks/{language-BVAzlrRz.js → language-sTn9sA3E.js} +1 -1
  166. package/dist/chunks/{launchAgentsPlatform-CtfK0qPa.js → launchAgentsPlatform-CAfyCAsQ.js} +1 -1
  167. package/dist/chunks/{launchAutofixPr-CQBv0rQ0.js → launchAutofixPr-CSMamZS6.js} +1 -1
  168. package/dist/chunks/{launchLocalMemory-BNE09TKr.js → launchLocalMemory-nYAwNsNT.js} +1 -1
  169. package/dist/chunks/{launchLocalVault-Dw_NJUnd.js → launchLocalVault-yPp8S-tG.js} +1 -1
  170. package/dist/chunks/{launchMemoryStores-CRRB6Z5A.js → launchMemoryStores-Dk3SXucB.js} +1 -1
  171. package/dist/chunks/{launchOnboarding-nMAF5iv7.js → launchOnboarding-BoqmHyRx.js} +1 -1
  172. package/dist/chunks/{launchSchedule-Akq1AmK8.js → launchSchedule-C2HBjD6C.js} +1 -1
  173. package/dist/chunks/{launchSkillStore-Zwtasj13.js → launchSkillStore-B5Yjvi-k.js} +1 -1
  174. package/dist/chunks/{launchTeleport-BzlIYyll.js → launchTeleport-BayvAnwh.js} +1 -1
  175. package/dist/chunks/{launchVault-BevXlxJB.js → launchVault-BszsgPbZ.js} +1 -1
  176. package/dist/chunks/loadAgentsDir-6_9ZFegv.js +1 -0
  177. package/dist/chunks/{loadAgentsDir-DF6FgRn-.js → loadAgentsDir-Cl2w3uvH.js} +53 -53
  178. package/dist/chunks/{loadPluginHooks-DBHkyJaj.js → loadPluginHooks-YHtjByxm.js} +1 -1
  179. package/dist/chunks/{localSearch-v4itMlCM.js → localSearch-CpeqVibs.js} +1 -1
  180. package/dist/chunks/localSearch-DbEm6f3k.js +1 -0
  181. package/dist/chunks/login-D2x89UCR.js +1 -0
  182. package/dist/chunks/{login-CKodBzyZ.js → login-TVtq34WQ.js} +1 -1
  183. package/dist/chunks/{logoV2Utils-VebeEs7Y.js → logoV2Utils-DwaRnvOY.js} +1 -1
  184. package/dist/chunks/logout-BBPihkXp.js +1 -0
  185. package/dist/chunks/{magicDocs-uX5n3NKh.js → magicDocs-_yNWB88A.js} +1 -1
  186. package/dist/chunks/{main-Cd_i0ZPo.js → main-gTbhsbIs.js} +15 -15
  187. package/dist/chunks/{mappers-CPL2ni36.js → mappers-COd8OOml.js} +1 -1
  188. package/dist/chunks/{mcp-Dhp1SaId.js → mcp-CChzTC5v.js} +2 -2
  189. package/dist/chunks/{mcp-Ci_TbB5m.js → mcp-D-0wE0nJ.js} +1 -1
  190. package/dist/chunks/{mcp-DeWOD4B4.js → mcp-DoraEndj.js} +1 -1
  191. package/dist/chunks/{mcpServer-CPJo2eKm.js → mcpServer-CpBN77YB.js} +1 -1
  192. package/dist/chunks/{mcpServer-CTuPkyD6.js → mcpServer-Wd9rZG_E.js} +1 -1
  193. package/dist/chunks/{memory-enMuKEnU.js → memory-I21QZZ9h.js} +1 -1
  194. package/dist/chunks/{model-4f3U2YMu.js → model-BrHh21Db.js} +1 -1
  195. package/dist/chunks/model-C6_WjCy0.js +1 -0
  196. package/dist/chunks/{onChangeAppState-DxTGoS7j.js → onChangeAppState-Cn_HSmmQ.js} +1 -1
  197. package/dist/chunks/{openai-CwG_KpH1.js → openai-BD2V4lHN.js} +1 -1
  198. package/dist/chunks/{overageCreditGrant-CCkJVN9k.js → overageCreditGrant-B47t5a73.js} +1 -1
  199. package/dist/chunks/{passes-O0VEQz1a.js → passes-DAOPYX0C.js} +1 -1
  200. package/dist/chunks/{path-C4kbwvSH.js → path-B3lx7yHn.js} +1 -1
  201. package/dist/chunks/{paths-o5iA-EnQ.js → paths-q1-Ni8Oh.js} +3 -3
  202. package/dist/chunks/{permissions-BtYQvivG.js → permissions-BmxTU-Pk.js} +1 -1
  203. package/dist/chunks/{pipeTransport-BEfqa7Uh.js → pipeTransport-DnHE3axn.js} +1 -1
  204. package/dist/chunks/{plan-Jw4GjVL0.js → plan-4dmnQ9bv.js} +1 -1
  205. package/dist/chunks/{plugin-DZq0voFR.js → plugin-CG7lJIpf.js} +1 -1
  206. package/dist/chunks/{pluginAutoupdate-D19vNoOp.js → pluginAutoupdate-CPLuidh-.js} +1 -1
  207. package/dist/chunks/{pluginBlocklist-DeX8I4dK.js → pluginBlocklist-BHxIUqu4.js} +1 -1
  208. package/dist/chunks/{pluginCliCommands-CMgqxOaT.js → pluginCliCommands-BcDIvxR3.js} +1 -1
  209. package/dist/chunks/{pluginFlagging-DFLE5fkh.js → pluginFlagging-Dh6rYOvj.js} +1 -1
  210. package/dist/chunks/{pluginOperations-BTz69m3_.js → pluginOperations-fdLcp72i.js} +1 -1
  211. package/dist/chunks/{pluginStartupCheck-CWWKwD5F.js → pluginStartupCheck-Dy7EckW4.js} +1 -1
  212. package/dist/chunks/pluginStartupCheck-fyqW-stg.js +1 -0
  213. package/dist/chunks/{plugins-BPUnAc0r.js → plugins-C3-iYKTp.js} +1 -1
  214. package/dist/chunks/policyLimits-DUGrXcje.js +1 -0
  215. package/dist/chunks/{pollConfig-DyHumJli.js → pollConfig-BGXMaSla.js} +1 -1
  216. package/dist/chunks/{poor-CHHZIPDW.js → poor-CxAil0Mi.js} +1 -1
  217. package/dist/chunks/poorMode-BkPHRLuG.js +1 -0
  218. package/dist/chunks/{poorMode-7N6J6YN2.js → poorMode-DFcYVnMT.js} +1 -1
  219. package/dist/chunks/{print-QCXJDmz0.js → print-Cog1o-Tw.js} +4 -4
  220. package/dist/chunks/{privacy-settings-DR0_P3JF.js → privacy-settings-D6g7p6sB.js} +1 -1
  221. package/dist/chunks/{processBashCommand-CkqKsBSD.js → processBashCommand-DqgujTR4.js} +1 -1
  222. package/dist/chunks/{processSlashCommand-DIk_hLHW.js → processSlashCommand-DUPS9Xx3.js} +1 -1
  223. package/dist/chunks/prompt-B-8CD-W_.js +1 -0
  224. package/dist/chunks/{prompt-DiHksuOs.js → prompt-BmOnuQfF.js} +1 -1
  225. package/dist/chunks/prompt-Da3gIGA8.js +1 -0
  226. package/dist/chunks/{promptEditor-B3S5E5Q7.js → promptEditor-ClGwMkWl.js} +1 -1
  227. package/dist/chunks/{protocolHandler-D1XT2l3j.js → protocolHandler--b0d38gF.js} +1 -1
  228. package/dist/chunks/{rate-limit-options-DHh1ksB5.js → rate-limit-options-DD2ZRREl.js} +1 -1
  229. package/dist/chunks/{rcDebugLog-BNojB_eB.js → rcDebugLog-fhwD4wm-.js} +1 -1
  230. package/dist/chunks/{referral-BADm5sBf.js → referral-rRvT6UDX.js} +1 -1
  231. package/dist/chunks/{refresh-D48fjYJ4.js → refresh-C7S_6LOQ.js} +1 -1
  232. package/dist/chunks/{registerProtocol-Dzmi6VC4.js → registerProtocol-Bu_tz5Au.js} +1 -1
  233. package/dist/chunks/{registry-CEu_N3dS.js → registry-Bk0vdx_8.js} +1 -1
  234. package/dist/chunks/{release-notes-Dr61jYDO.js → release-notes-BShc_V-B.js} +1 -1
  235. package/dist/chunks/{releaseNotes-5SV7C5aV.js → releaseNotes-D3wZdQVZ.js} +2 -2
  236. package/dist/chunks/{reload-plugins-BxuE-21F.js → reload-plugins-CpytFAAC.js} +1 -1
  237. package/dist/chunks/{remote-env-BaQjT5em.js → remote-env-B9Of1v31.js} +1 -1
  238. package/dist/chunks/{remoteBridgeCore-B8MjcW6f.js → remoteBridgeCore-BXp6nJ8q.js} +1 -1
  239. package/dist/chunks/{remoteControlServer-BvoNcg9D.js → remoteControlServer-BvlTaHu4.js} +1 -1
  240. package/dist/chunks/{rename-B3q0tgmd.js → rename-DhTddAd7.js} +1 -1
  241. package/dist/chunks/{resume-BSGOqus7.js → resume-DwVeFqnc.js} +1 -1
  242. package/dist/chunks/{runtimeObserver-Bb6wSUMJ.js → runtimeObserver-BtgDP8Gz.js} +1 -1
  243. package/dist/chunks/{runtimeObserver-BbwUiToa.js → runtimeObserver-dtT0QHYO.js} +2 -2
  244. package/dist/chunks/sandbox-adapter-Cm8kCM_U.js +1 -0
  245. package/dist/chunks/{sandbox-toggle-L7YPKXba.js → sandbox-toggle-CG2vZNAb.js} +1 -1
  246. package/dist/chunks/searchExtraTools-D-RZ9DId.js +1 -0
  247. package/dist/chunks/{sentry-DG3ru8XE.js → sentry-DFk8bzvt.js} +1 -1
  248. package/dist/chunks/{session-B5wA2K9M.js → session-DifFcUdR.js} +1 -1
  249. package/dist/chunks/{sessionDiscovery-DijWFNjj.js → sessionDiscovery-CRbLIQv1.js} +1 -1
  250. package/dist/chunks/sessionFileAccessHooks-Bixkjai4.js +1 -0
  251. package/dist/chunks/{sessionMemory-CeWjRuFL.js → sessionMemory-BdptRKL8.js} +1 -1
  252. package/dist/chunks/sessionMemory-T1K_mJRE.js +1 -0
  253. package/dist/chunks/sessionMemoryUtils-q3xRtP-z.js +1 -0
  254. package/dist/chunks/{sessionObserver-CsDT2GnB.js → sessionObserver-D3vw6SJ_.js} +1 -1
  255. package/dist/chunks/sessionObserver-i_3day_6.js +1 -0
  256. package/dist/chunks/sessionStorage-CusaYoh0.js +1 -0
  257. package/dist/chunks/sessionStoragePortable-DJZ_6cL8.js +3 -0
  258. package/dist/chunks/{sessionTitle-CxmvZO71.js → sessionTitle-DnvlYJ-c.js} +1 -1
  259. package/dist/chunks/{sessionTracing-Cy5dAplG.js → sessionTracing-BkzKJi0v.js} +1 -1
  260. package/dist/chunks/{settingsSync-54E8xV8N.js → settingsSync-CHZVpM34.js} +1 -1
  261. package/dist/chunks/{setup-GJtdESQj.js → setup-BfecYO-n.js} +1 -1
  262. package/dist/chunks/{setup-B5CMpp0c.js → setup-BpwYOhci.js} +2 -2
  263. package/dist/chunks/{setup-KWELOokh.js → setup-GxlEx1KG.js} +1 -1
  264. package/dist/chunks/{shadowedRuleDetection-C4NGjljb.js → shadowedRuleDetection-FNzEipG0.js} +1 -1
  265. package/dist/chunks/{sideQuestion-DBrzdgkl.js → sideQuestion-Bfa0SZn5.js} +1 -1
  266. package/dist/chunks/sink-BSwQ045N.js +1 -0
  267. package/dist/chunks/{sink-BKc24wdw.js → sink-DpAjuilF.js} +1 -1
  268. package/dist/chunks/{sinks-BTS1DWM4.js → sinks-C37Xl5c3.js} +2 -2
  269. package/dist/chunks/sinks-DHHmQJi-.js +1 -0
  270. package/dist/chunks/{skill-learning-C5NrosiL.js → skill-learning-BSeEbCnP.js} +1 -1
  271. package/dist/chunks/{skillChangeDetector-NJrEtU47.js → skillChangeDetector-BEDBRGbY.js} +1 -1
  272. package/dist/chunks/{skillGapStore-D1rkePoo.js → skillGapStore-B4GmZRJ0.js} +2 -2
  273. package/dist/chunks/{skillGapStore-uXpRqLGG.js → skillGapStore-BCO6YB3H.js} +1 -1
  274. package/dist/chunks/{skillGenerator-Deog7yBO.js → skillGenerator-QgDWAvzK.js} +2 -2
  275. package/dist/chunks/skillLearning-CFYgFRPE.js +1 -0
  276. package/dist/chunks/skillLearning-en7AuVDZ.js +1 -0
  277. package/dist/chunks/{skillPanel-Bx63GX9w.js → skillPanel-srZjMIbC.js} +3 -3
  278. package/dist/chunks/{skillSearchPanel-CM5EZGkH.js → skillSearchPanel-DTvHcwNK.js} +2 -2
  279. package/dist/chunks/{skills-JvC7Ms0P.js → skills-BlVUkWg4.js} +1 -1
  280. package/dist/chunks/{sprites-YBiqlYch.js → sprites-QO9r_mXk.js} +1 -1
  281. package/dist/chunks/{stats-BJMKNvVK.js → stats-DdXM-u7l.js} +1 -1
  282. package/dist/chunks/{status-DAJ28yxZ.js → status-BIZWtZqI.js} +1 -1
  283. package/dist/chunks/{statusNoticeHelpers-B7nbsqLz.js → statusNoticeHelpers-9sIAjiE6.js} +1 -1
  284. package/dist/chunks/{tag-B4y7cBqH.js → tag-DDJ8pAsl.js} +1 -1
  285. package/dist/chunks/{tasks-CSye58Ap.js → tasks-DYt6udr3.js} +1 -1
  286. package/dist/chunks/{teamHelpers-BFZ4eVwW.js → teamHelpers-BJuKEuyS.js} +1 -1
  287. package/dist/chunks/teamHelpers-Cw5dPQor.js +1 -0
  288. package/dist/chunks/teammateModeSnapshot-BXC7ssXX.js +1 -0
  289. package/dist/chunks/{teammateModeSnapshot-DXc2vyo2.js → teammateModeSnapshot-Zp1weNIZ.js} +1 -1
  290. package/dist/chunks/{teleport-NN6zSxxe.js → teleport-DkoFG3EI.js} +1 -1
  291. package/dist/chunks/{templateJobs-DAVqqU0g.js → templateJobs-V2-TVeGE.js} +1 -1
  292. package/dist/chunks/{terminalSetup-DqL65XR2.js → terminalSetup-DMUDhXur.js} +1 -1
  293. package/dist/chunks/{terminalSetup-jZKBoPTc.js → terminalSetup-l0Vv_v1c.js} +1 -1
  294. package/dist/chunks/{theme-DPv2L3ut.js → theme-Dm1yCDce.js} +1 -1
  295. package/dist/chunks/thinkback-D1mk7cq1.js +1 -0
  296. package/dist/chunks/{thinkback-tcfR5Uod.js → thinkback-DQAZE5SA.js} +1 -1
  297. package/dist/chunks/{thinkback-play-D_uOESmO.js → thinkback-play-BJcGmc9X.js} +1 -1
  298. package/dist/chunks/{toolEventObserver-D6ZTtdh_.js → toolEventObserver-BgkqkNwy.js} +1 -1
  299. package/dist/chunks/{toolEventObserver-CtApZXry.js → toolEventObserver-C-BImvCz.js} +1 -1
  300. package/dist/chunks/toolPool-DNH5H4Jg.js +1 -0
  301. package/dist/chunks/{toolPool-DFpa-yul.js → toolPool-DYvz_Mjt.js} +1 -1
  302. package/dist/chunks/{trustedDevice-DsgCQRsJ.js → trustedDevice-BDrK9AQ6.js} +1 -1
  303. package/dist/chunks/{trustedDevice-Bxn7WW5C.js → trustedDevice-CXsk3eij.js} +1 -1
  304. package/dist/chunks/{ultrareviewCommand-BfuSrdXz.js → ultrareviewCommand-Bc8hMzHz.js} +1 -1
  305. package/dist/chunks/undercover-DUrQYxYo.js +1 -0
  306. package/dist/chunks/{undercover-CM8zTx5g.js → undercover-kRoI_nlN.js} +1 -1
  307. package/dist/chunks/{updateCCB-DTArxdyR.js → updateCCB-BPGNN7VA.js} +1 -1
  308. package/dist/chunks/upgrade-BTI562Ce.js +1 -0
  309. package/dist/chunks/{upgrade-CEd1Jxw_.js → upgrade-DmEGLk6v.js} +1 -1
  310. package/dist/chunks/{upload-DNo3bZLc.js → upload-49qk5TBL.js} +1 -1
  311. package/dist/chunks/{usage-X4-qec8g.js → usage-DhJDFJVx.js} +1 -1
  312. package/dist/chunks/{usage-DEwRsc7E.js → usage-sYgTL8wR.js} +1 -1
  313. package/dist/chunks/{useMainLoopModel-2A9HV1H3.js → useMainLoopModel-CJaR_qEJ.js} +1 -1
  314. package/dist/chunks/{useManagePlugins-D9MBag8O.js → useManagePlugins-B1FpmxFo.js} +1 -1
  315. package/dist/chunks/{useMergedTools-DCYrP_YE.js → useMergedTools-eMPZ95TX.js} +1 -1
  316. package/dist/chunks/{useSearchInput-CepwLBvi.js → useSearchInput-CR-b0Qi6.js} +1 -1
  317. package/dist/chunks/{useSettingsErrors-C8ffWXbY.js → useSettingsErrors-p-PFBeaC.js} +1 -1
  318. package/dist/chunks/{useVoice-vHZVaTAN.js → useVoice-D3PqTfCK.js} +1 -1
  319. package/dist/chunks/{util-B13MVSse.js → util-BZ2fS3PR.js} +1 -1
  320. package/dist/chunks/utils-hhztcb0b.js +1 -0
  321. package/dist/chunks/{validatePlugin-Cf_toBOJ.js → validatePlugin-QtcXXmZu.js} +1 -1
  322. package/dist/chunks/{vim-6p7eiRPG.js → vim-LmepJftY.js} +1 -1
  323. package/dist/chunks/{voice-Bvc_BxoI.js → voice-CNRTt4gH.js} +1 -1
  324. package/dist/chunks/voiceModeEnabled-B57V7REx.js +1 -0
  325. package/dist/chunks/{voiceModeEnabled-BPbOh6jd.js → voiceModeEnabled-wWM929QG.js} +1 -1
  326. package/dist/chunks/{voiceStreamSTT-CzCUhap3.js → voiceStreamSTT-CnK9GN6Q.js} +1 -1
  327. package/dist/chunks/voiceStreamSTT-Dp-1uSjP.js +1 -0
  328. package/dist/chunks/{workerRegistry-DCtC-WN3.js → workerRegistry-CrIpKIZe.js} +1 -1
  329. package/dist/chunks/worktree-YbEK6b36.js +1 -0
  330. package/dist/chunks/{xml-CqxiCY4v.js → xml-CMdTGiv6.js} +1 -1
  331. package/dist/cli.js +1 -1
  332. package/package.json +1 -1
  333. package/dist/chunks/ApproveApiKey-CAvlRKLr.js +0 -1
  334. package/dist/chunks/ClaudeMdExternalIncludesDialog-DrkzPawC.js +0 -1
  335. package/dist/chunks/ConsoleOAuthFlow-CtqOQRDT.js +0 -1
  336. package/dist/chunks/Doctor-CheDaF3O.js +0 -1
  337. package/dist/chunks/Grove-CbcR0CsI.js +0 -1
  338. package/dist/chunks/REPL-Cxh0Qnnt.js +0 -1
  339. package/dist/chunks/SearchExtraToolsTool-BNpA8JzR.js +0 -1
  340. package/dist/chunks/SentryErrorBoundary-BFwcMSIK.js +0 -1
  341. package/dist/chunks/api-kAjsowcb.js +0 -1
  342. package/dist/chunks/asciicast-aoKFhc7C.js +0 -1
  343. package/dist/chunks/assistant-nOCkNa3_.js +0 -1
  344. package/dist/chunks/auth-CDOk9J9A.js +0 -1
  345. package/dist/chunks/backgroundHousekeeping-wHy1eAso.js +0 -1
  346. package/dist/chunks/bridgeConfig-V_pmBzSH.js +0 -1
  347. package/dist/chunks/bridgeEnabled-BxtxHb8R.js +0 -1
  348. package/dist/chunks/bridgeMain-CMNptMs4.js +0 -1
  349. package/dist/chunks/caches-B-GiT9hm.js +0 -1
  350. package/dist/chunks/changeDetector-S1Jti1bW.js +0 -1
  351. package/dist/chunks/channelNotification-Bx6dpA7I.js +0 -1
  352. package/dist/chunks/clear-BXv0Sq3m.js +0 -1
  353. package/dist/chunks/client-DNQukPEE.js +0 -1
  354. package/dist/chunks/commands-BK3ugb0u.js +0 -1
  355. package/dist/chunks/commitAttribution-CtQYmnw-.js +0 -1
  356. package/dist/chunks/context-noninteractive-0YpW67KZ.js +0 -1
  357. package/dist/chunks/conversation-DCG0fiGV.js +0 -1
  358. package/dist/chunks/createSession-BYf27ahD.js +0 -1
  359. package/dist/chunks/datadog-NnzM1Mu3.js +0 -1
  360. package/dist/chunks/entry-BUwwv2dM.js +0 -14
  361. package/dist/chunks/envLessBridgeConfig-Dq02Vvx1.js +0 -1
  362. package/dist/chunks/extra-usage-DhB0NElh.js +0 -1
  363. package/dist/chunks/extractMemories-wcRNh_jz.js +0 -1
  364. package/dist/chunks/fast-ukzN3wl2.js +0 -1
  365. package/dist/chunks/gates-CB_pFChT.js +0 -1
  366. package/dist/chunks/hooks-BTBhK9sh.js +0 -1
  367. package/dist/chunks/inboundAttachments-DBaPmCTv.js +0 -1
  368. package/dist/chunks/language-ZBygqv6V.js +0 -1
  369. package/dist/chunks/loadAgentsDir-OIIKHPq9.js +0 -1
  370. package/dist/chunks/localSearch-DslXIfeC.js +0 -1
  371. package/dist/chunks/login-CTIVwgFU.js +0 -1
  372. package/dist/chunks/logout-B3MyP8fk.js +0 -1
  373. package/dist/chunks/model-BsHyPvD0.js +0 -1
  374. package/dist/chunks/pluginStartupCheck-Non969kz.js +0 -1
  375. package/dist/chunks/policyLimits-D6dpS-CU.js +0 -1
  376. package/dist/chunks/poorMode-DX4EXe0o.js +0 -1
  377. package/dist/chunks/prompt-2ia5b-QO.js +0 -1
  378. package/dist/chunks/prompt-CNtVpGdl.js +0 -1
  379. package/dist/chunks/sandbox-adapter-Cr6f6gjf.js +0 -1
  380. package/dist/chunks/searchExtraTools-DRVIhwVJ.js +0 -1
  381. package/dist/chunks/sessionFileAccessHooks-DnbPctQc.js +0 -1
  382. package/dist/chunks/sessionMemory-BOT9f5f0.js +0 -1
  383. package/dist/chunks/sessionMemoryUtils-B47JMJa2.js +0 -1
  384. package/dist/chunks/sessionObserver-BNZflr2e.js +0 -1
  385. package/dist/chunks/sessionStorage-BUuPrnU0.js +0 -1
  386. package/dist/chunks/sessionStoragePortable-BI9q2WcJ.js +0 -3
  387. package/dist/chunks/sink-DG0SNHP7.js +0 -1
  388. package/dist/chunks/sinks-Cbp-8X1S.js +0 -1
  389. package/dist/chunks/skillLearning-BHjRTDJw.js +0 -1
  390. package/dist/chunks/skillLearning-By7jxHSI.js +0 -1
  391. package/dist/chunks/teamHelpers-CKBoDEPj.js +0 -1
  392. package/dist/chunks/teammateModeSnapshot-BfOLEMKn.js +0 -1
  393. package/dist/chunks/thinkback-B0OSwcPG.js +0 -1
  394. package/dist/chunks/toolPool-DqemSx_r.js +0 -1
  395. package/dist/chunks/undercover-B-R6dhHB.js +0 -1
  396. package/dist/chunks/upgrade-CCrHxXrm.js +0 -1
  397. package/dist/chunks/utils-C-vk0zpl.js +0 -1
  398. package/dist/chunks/voiceModeEnabled-JSBux8GA.js +0 -1
  399. package/dist/chunks/voiceStreamSTT-D9ER6Ml3.js +0 -1
  400. package/dist/chunks/worktree-Dv0mPuy_.js +0 -1
@@ -1 +1 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./axios-DhfaybwJ.js";import{Tt as r}from"./schemas-BGAvj1T4.js";import{t as i}from"./v4-f1i_CNUT.js";import{bs as a,gs as o,vs as s,xs as c,ys as l}from"./paths-o5iA-EnQ.js";import{E as u,L as d,R as f,T as p,U as m,V as h,d as g,h as _,p as v,s as y,w as b}from"./debug-UI3T040K.js";import{o as ee,s as x}from"./log-CzsijfHZ.js";import{AA as S,KA as C,OA as w,UA as T,WA as E,aA as D,iA as O,kA as te,qA as ne}from"./loadAgentsDir-DF6FgRn-.js";import{homedir as re}from"os";import*as k from"path";import{join as ie,resolve as ae}from"path";import{randomBytes as oe}from"crypto";import{readFile as A,readdir as j,rename as M,stat as N,unlink as P,writeFile as F}from"fs/promises";function I(){return ie(O(),U)}async function L(){let e=I();try{let t=p(await A(e,{encoding:`utf-8`}));if(typeof t!=`object`||!t||!(`version`in t)||!(`fetchedAt`in t)||!(`counts`in t))return g(`Install counts cache has invalid structure`),null;let n=t;if(n.version!==H)return g(`Install counts cache version mismatch (got ${n.version}, expected ${H})`),null;if(typeof n.fetchedAt!=`string`||!Array.isArray(n.counts))return g(`Install counts cache has invalid structure`),null;let r=new Date(n.fetchedAt).getTime();return Number.isNaN(r)?(g(`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>G?(g(`Install counts cache is stale (>24h old)`),null):{version:n.version,fetchedAt:n.fetchedAt,counts:n.counts}:(g(`Install counts cache has malformed entries`),null)}catch(e){return f(e)!==`ENOENT`&&g(`Failed to load install counts cache: ${d(e)}`),null}}async function R(e){let t=I(),n=`${t}.${oe(8).toString(`hex`)}.tmp`;try{let r=O();await v().mkdir(r),await F(n,u(e,null,2),{encoding:`utf-8`,mode:384}),await M(n,t),g(`Install counts cache saved successfully`)}catch(e){x(e);try{await P(n)}catch{}}}async function z(){g(`Fetching install counts from ${W}`);let e=performance.now();try{let n=await t.get(W,{timeout:1e4});if(!n.data?.plugins||!Array.isArray(n.data.plugins))throw Error(`Invalid response format from install counts API`);return S(`install_counts`,W,`success`,performance.now()-e),n.data.plugins}catch(t){throw S(`install_counts`,W,`failure`,performance.now()-e,w(t)),t}}async function B(){let e=await L();if(e){g(`Using cached install counts`),S(`install_counts`,W,`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 z();await R({version:H,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 x(e),g(`Failed to fetch install counts: ${d(e)}`),null}}function V(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 H,U,W,G,K=e((()=>{n(),y(),h(),_(),ee(),b(),te(),D(),H=1,U=`install-counts-cache.json`,W=`https://raw.githubusercontent.com/anthropics/claude-plugins-official/refs/heads/stats/stats/plugin-installs.json`,G=1440*60*1e3}));async function se(e){let t=e.trim(),n=v(),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=ae(t.startsWith(`~`)?t.replace(/^~/,re()):t),r;try{r=await n.stat(e)}catch(t){let n=f(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((()=>{h(),_()}));function le(e){let t=k.basename(e),n=k.basename(k.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=k.resolve(e),i;try{i=await A(r,{encoding:`utf-8`})}catch(e){let t=f(e),n;return n=t===`ENOENT`?`File not found: ${r}`:t===`EISDIR`?`Path is not a file: ${r}`:`Failed to read file: ${d(e)}`,{success:!1,errors:[{path:`file`,message:n,code:t}],warnings:[],filePath:r,fileType:`plugin`}}let a;try{a=p(i)}catch(e){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${d(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 — Claude Code ignores it at load time.`});o=r}}let c=s().strict().safeParse(o);if(c.success||t.push(...q(c.error)),c.success){let e=c.data;/^[a-z0-9]+(-[a-z0-9]+)*$/.test(e.name)||n.push({path:`name`,message:`Plugin name "${e.name}" is not kebab-case. Claude Code 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=k.resolve(e),o;try{o=await A(i,{encoding:`utf-8`})}catch(e){let t=f(e),n;return n=t===`ENOENT`?`File not found: ${i}`:t===`EISDIR`?`Path is not a file: ${i}`:`Failed to read file: ${d(e)}`,{success:!1,errors:[{path:`file`,message:n,code:t}],warnings:[],filePath:i,fileType:`marketplace`}}let s;try{s=p(o)}catch(e){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${d(e)}`}],warnings:[],filePath:i,fileType:`marketplace`}}if(s&&typeof s==`object`){let e=s;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 c=a().extend({plugins:r(l().strict())}).strict().safeParse(s);if(c.success||t.push(...q(c.error)),c.success){let e=c.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=k.dirname(i),a=k.basename(r)===`.claude-plugin`?k.dirname(r):r;for(let[t,r]of e.plugins.entries()){if(!r.version||typeof r.source!=`string`||!r.source.startsWith(`./`))continue;let e=k.join(a,r.source,`.claude-plugin`,`plugin.json`),i;try{let t=p(await A(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(T);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 o=a[1]||``,s;try{s=ne(o)}catch(t){return r.push({path:`frontmatter`,message:`YAML frontmatter failed to parse: ${d(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 s!=`object`||!s||Array.isArray(s))return r.push({path:`frontmatter`,message:`Frontmatter must be a YAML mapping (key: value pairs), got ${Array.isArray(s)?`an array`:s===null?`null`:typeof s}.`}),{success:!1,errors:r,warnings:i,filePath:e,fileType:n};let c=s;if(c.description!==void 0){let e=c.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}.`});c.name!==void 0&&c.name!==null&&typeof c.name!=`string`&&r.push({path:`name`,message:`name must be a string, got ${typeof c.name}.`});let l=c[`allowed-tools`];l!=null&&(typeof l!=`string`&&!Array.isArray(l)?r.push({path:`allowed-tools`,message:`allowed-tools must be a string or array of strings, got ${typeof l}.`}):Array.isArray(l)&&l.some(e=>typeof e!=`string`)&&r.push({path:`allowed-tools`,message:`allowed-tools array must contain only strings.`}));let u=c.shell;if(u!=null)if(typeof u!=`string`)r.push({path:`shell`,message:`shell must be a string, got ${typeof u}.`});else{let e=u.trim().toLowerCase();e!==`bash`&&e!==`powershell`&&r.push({path:`shell`,message:`shell must be 'bash' or 'powershell', got '${u}'.`})}return{success:r.length===0,errors:r,warnings:i,filePath:e,fileType:n}}async function Z(e){let t;try{t=await A(e,{encoding:`utf-8`})}catch(t){return f(t)===`ENOENT`?{success:!0,errors:[],warnings:[],filePath:e,fileType:`hooks`}:{success:!1,errors:[{path:`file`,message:`Failed to read file: ${d(t)}`}],warnings:[],filePath:e,fileType:`hooks`}}let n;try{n=p(t)}catch(t){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${d(t)}. At runtime this breaks the entire plugin load.`}],warnings:[],filePath:e,fileType:`hooks`}}let r=o().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 j(e,{withFileTypes:!0})}catch(e){let t=f(e);if(t===`ENOENT`||t===`ENOTDIR`)return[];throw e}if(t)return n.filter(e=>e.isDirectory()).map(t=>k.join(e,t.name,`SKILL.md`));let r=[];for(let t of n){let n=k.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`,k.join(e,`skills`)],[`agent`,k.join(e,`agents`)],[`command`,k.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 A(r,{encoding:`utf-8`})}catch(n){if(m(n))continue;t.push({success:!1,errors:[{path:`file`,message:`Failed to read: ${d(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(k.join(e,`hooks`,`hooks.json`));return(r.errors.length>0||r.warnings.length>0)&&t.push(r),t}async function pe(e){let t=k.resolve(e),n=null;try{n=await N(t)}catch(e){if(!m(e))throw e}if(n?.isDirectory()){let e=await X(k.join(t,`.claude-plugin`,`marketplace.json`));if(e.errors[0]?.code!==`ENOENT`)return e;let n=await Y(k.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=p(await A(t,{encoding:`utf-8`}));if(Array.isArray(n.plugins))return X(e)}catch(e){if(f(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(),h(),E(),b(),C(),c(),$=new Set([`category`,`source`,`tags`,`strict`,`id`])}));export{se as a,K as c,ce as i,pe as n,V as o,fe as r,B as s,me as t};
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./axios-DhfaybwJ.js";import{Tt as r}from"./schemas-BGAvj1T4.js";import{t as i}from"./v4-f1i_CNUT.js";import{bs as a,gs as o,vs as s,xs as c,ys as l}from"./paths-q1-Ni8Oh.js";import{E as u,L as d,R as f,T as p,U as m,V as h,d as g,h as _,p as v,s as y,w as b}from"./debug-UI3T040K.js";import{o as ee,s as x}from"./log-CzsijfHZ.js";import{AA as S,KA as C,OA as w,UA as T,WA as E,aA as D,iA as O,kA as te,qA as ne}from"./loadAgentsDir-Cl2w3uvH.js";import{homedir as re}from"os";import*as k from"path";import{join as ie,resolve as ae}from"path";import{randomBytes as oe}from"crypto";import{readFile as A,readdir as j,rename as M,stat as N,unlink as P,writeFile as F}from"fs/promises";function I(){return ie(O(),U)}async function L(){let e=I();try{let t=p(await A(e,{encoding:`utf-8`}));if(typeof t!=`object`||!t||!(`version`in t)||!(`fetchedAt`in t)||!(`counts`in t))return g(`Install counts cache has invalid structure`),null;let n=t;if(n.version!==H)return g(`Install counts cache version mismatch (got ${n.version}, expected ${H})`),null;if(typeof n.fetchedAt!=`string`||!Array.isArray(n.counts))return g(`Install counts cache has invalid structure`),null;let r=new Date(n.fetchedAt).getTime();return Number.isNaN(r)?(g(`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>G?(g(`Install counts cache is stale (>24h old)`),null):{version:n.version,fetchedAt:n.fetchedAt,counts:n.counts}:(g(`Install counts cache has malformed entries`),null)}catch(e){return f(e)!==`ENOENT`&&g(`Failed to load install counts cache: ${d(e)}`),null}}async function R(e){let t=I(),n=`${t}.${oe(8).toString(`hex`)}.tmp`;try{let r=O();await v().mkdir(r),await F(n,u(e,null,2),{encoding:`utf-8`,mode:384}),await M(n,t),g(`Install counts cache saved successfully`)}catch(e){x(e);try{await P(n)}catch{}}}async function z(){g(`Fetching install counts from ${W}`);let e=performance.now();try{let n=await t.get(W,{timeout:1e4});if(!n.data?.plugins||!Array.isArray(n.data.plugins))throw Error(`Invalid response format from install counts API`);return S(`install_counts`,W,`success`,performance.now()-e),n.data.plugins}catch(t){throw S(`install_counts`,W,`failure`,performance.now()-e,w(t)),t}}async function B(){let e=await L();if(e){g(`Using cached install counts`),S(`install_counts`,W,`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 z();await R({version:H,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 x(e),g(`Failed to fetch install counts: ${d(e)}`),null}}function V(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 H,U,W,G,K=e((()=>{n(),y(),h(),_(),ee(),b(),te(),D(),H=1,U=`install-counts-cache.json`,W=`https://raw.githubusercontent.com/anthropics/claude-plugins-official/refs/heads/stats/stats/plugin-installs.json`,G=1440*60*1e3}));async function se(e){let t=e.trim(),n=v(),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=ae(t.startsWith(`~`)?t.replace(/^~/,re()):t),r;try{r=await n.stat(e)}catch(t){let n=f(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((()=>{h(),_()}));function le(e){let t=k.basename(e),n=k.basename(k.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=k.resolve(e),i;try{i=await A(r,{encoding:`utf-8`})}catch(e){let t=f(e),n;return n=t===`ENOENT`?`File not found: ${r}`:t===`EISDIR`?`Path is not a file: ${r}`:`Failed to read file: ${d(e)}`,{success:!1,errors:[{path:`file`,message:n,code:t}],warnings:[],filePath:r,fileType:`plugin`}}let a;try{a=p(i)}catch(e){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${d(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 — Claude Code ignores it at load time.`});o=r}}let c=s().strict().safeParse(o);if(c.success||t.push(...q(c.error)),c.success){let e=c.data;/^[a-z0-9]+(-[a-z0-9]+)*$/.test(e.name)||n.push({path:`name`,message:`Plugin name "${e.name}" is not kebab-case. Claude Code 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=k.resolve(e),o;try{o=await A(i,{encoding:`utf-8`})}catch(e){let t=f(e),n;return n=t===`ENOENT`?`File not found: ${i}`:t===`EISDIR`?`Path is not a file: ${i}`:`Failed to read file: ${d(e)}`,{success:!1,errors:[{path:`file`,message:n,code:t}],warnings:[],filePath:i,fileType:`marketplace`}}let s;try{s=p(o)}catch(e){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${d(e)}`}],warnings:[],filePath:i,fileType:`marketplace`}}if(s&&typeof s==`object`){let e=s;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 c=a().extend({plugins:r(l().strict())}).strict().safeParse(s);if(c.success||t.push(...q(c.error)),c.success){let e=c.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=k.dirname(i),a=k.basename(r)===`.claude-plugin`?k.dirname(r):r;for(let[t,r]of e.plugins.entries()){if(!r.version||typeof r.source!=`string`||!r.source.startsWith(`./`))continue;let e=k.join(a,r.source,`.claude-plugin`,`plugin.json`),i;try{let t=p(await A(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(T);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 o=a[1]||``,s;try{s=ne(o)}catch(t){return r.push({path:`frontmatter`,message:`YAML frontmatter failed to parse: ${d(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 s!=`object`||!s||Array.isArray(s))return r.push({path:`frontmatter`,message:`Frontmatter must be a YAML mapping (key: value pairs), got ${Array.isArray(s)?`an array`:s===null?`null`:typeof s}.`}),{success:!1,errors:r,warnings:i,filePath:e,fileType:n};let c=s;if(c.description!==void 0){let e=c.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}.`});c.name!==void 0&&c.name!==null&&typeof c.name!=`string`&&r.push({path:`name`,message:`name must be a string, got ${typeof c.name}.`});let l=c[`allowed-tools`];l!=null&&(typeof l!=`string`&&!Array.isArray(l)?r.push({path:`allowed-tools`,message:`allowed-tools must be a string or array of strings, got ${typeof l}.`}):Array.isArray(l)&&l.some(e=>typeof e!=`string`)&&r.push({path:`allowed-tools`,message:`allowed-tools array must contain only strings.`}));let u=c.shell;if(u!=null)if(typeof u!=`string`)r.push({path:`shell`,message:`shell must be a string, got ${typeof u}.`});else{let e=u.trim().toLowerCase();e!==`bash`&&e!==`powershell`&&r.push({path:`shell`,message:`shell must be 'bash' or 'powershell', got '${u}'.`})}return{success:r.length===0,errors:r,warnings:i,filePath:e,fileType:n}}async function Z(e){let t;try{t=await A(e,{encoding:`utf-8`})}catch(t){return f(t)===`ENOENT`?{success:!0,errors:[],warnings:[],filePath:e,fileType:`hooks`}:{success:!1,errors:[{path:`file`,message:`Failed to read file: ${d(t)}`}],warnings:[],filePath:e,fileType:`hooks`}}let n;try{n=p(t)}catch(t){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${d(t)}. At runtime this breaks the entire plugin load.`}],warnings:[],filePath:e,fileType:`hooks`}}let r=o().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 j(e,{withFileTypes:!0})}catch(e){let t=f(e);if(t===`ENOENT`||t===`ENOTDIR`)return[];throw e}if(t)return n.filter(e=>e.isDirectory()).map(t=>k.join(e,t.name,`SKILL.md`));let r=[];for(let t of n){let n=k.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`,k.join(e,`skills`)],[`agent`,k.join(e,`agents`)],[`command`,k.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 A(r,{encoding:`utf-8`})}catch(n){if(m(n))continue;t.push({success:!1,errors:[{path:`file`,message:`Failed to read: ${d(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(k.join(e,`hooks`,`hooks.json`));return(r.errors.length>0||r.warnings.length>0)&&t.push(r),t}async function pe(e){let t=k.resolve(e),n=null;try{n=await N(t)}catch(e){if(!m(e))throw e}if(n?.isDirectory()){let e=await X(k.join(t,`.claude-plugin`,`marketplace.json`));if(e.errors[0]?.code!==`ENOENT`)return e;let n=await Y(k.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=p(await A(t,{encoding:`utf-8`}));if(Array.isArray(n.plugins))return X(e)}catch(e){if(f(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(),h(),E(),b(),C(),c(),$=new Set([`category`,`source`,`tags`,`strict`,`id`])}));export{se as a,K as c,ce as i,pe as n,V as o,fe as r,B as s,me as t};
@@ -1 +1 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{Ac as t,Pc as n,Sc as r}from"./paths-o5iA-EnQ.js";import{n as i,r as a}from"./analytics-DqMQntaB.js";var o;e((()=>{i(),t(),o=async()=>{let e=r().editorMode||`normal`;e===`emacs`&&(e=`normal`);let t=e===`normal`?`vim`:`normal`;return n(e=>({...e,editorMode:t})),a(`tengu_editor_mode_changed`,{mode:t,source:`command`}),{type:`text`,value:`Editor mode set to ${t}. ${t===`vim`?`Use Escape key to toggle between INSERT and NORMAL modes.`:`Using standard (readline) keyboard bindings.`}`}}}))();export{o as call};
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{Ac as t,Pc as n,Sc as r}from"./paths-q1-Ni8Oh.js";import{n as i,r as a}from"./analytics-DqMQntaB.js";var o;e((()=>{i(),t(),o=async()=>{let e=r().editorMode||`normal`;e===`emacs`&&(e=`normal`);let t=e===`normal`?`vim`:`normal`;return n(e=>({...e,editorMode:t})),a(`tengu_editor_mode_changed`,{mode:t,source:`command`}),{type:`text`,value:`Editor mode set to ${t}. ${t===`vim`?`Use Escape key to toggle between INSERT and NORMAL modes.`:`Using standard (readline) keyboard bindings.`}`}}}))();export{o as call};
@@ -1,2 +1,2 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{Ac as t,Ka as n,Pc as r,Sc as i,lo as a,oo as o}from"./paths-o5iA-EnQ.js";import{n as s,r as c}from"./analytics-DqMQntaB.js";import{SA as l,aT as u,oT as d,vA as f}from"./loadAgentsDir-DF6FgRn-.js";import{n as p,r as m}from"./voiceModeEnabled-BPbOh6jd.js";import{n as h,t as g}from"./useVoice-vHZVaTAN.js";var _,v;e((()=>{g(),d(),s(),t(),f(),o(),p(),_=2,v=async e=>{if(!m())return{type:`text`,value:`Voice mode is not available.`};let t=n(),o=t.voiceEnabled===!0,s=e?.trim().toLowerCase();if(o&&s===`doubao`)return a(`userSettings`,{voiceProvider:`doubao`}).error?{type:`text`,value:`Failed to update settings. Check your settings file for syntax errors.`}:(l.notifyChange(`userSettings`),{type:`text`,value:`Voice mode switched to Doubao ASR. Hold ${u(`voice:pushToTalk`,`Chat`,`Space`)} to record.`});if(o&&s===`anthropic`)return a(`userSettings`,{voiceProvider:`anthropic`}).error?{type:`text`,value:`Failed to update settings. Check your settings file for syntax errors.`}:(l.notifyChange(`userSettings`),{type:`text`,value:`Voice mode switched to Anthropic STT. Hold ${u(`voice:pushToTalk`,`Chat`,`Space`)} to record.`});if(o)return a(`userSettings`,{voiceEnabled:!1}).error?{type:`text`,value:`Failed to update settings. Check your settings file for syntax errors.`}:(l.notifyChange(`userSettings`),c(`tengu_voice_toggled`,{enabled:!1}),{type:`text`,value:`Voice mode disabled.`});let d=s===`doubao`?`doubao`:`anthropic`,{isVoiceStreamAvailable:f}=await import(`./voiceStreamSTT-D9ER6Ml3.js`),{checkRecordingAvailability:p}=await import(`./voice-DXiiy8HX.js`),g=await p();if(!g.available)return{type:`text`,value:g.reason??`Voice mode is not available in this environment.`};if(d!==`doubao`&&!f())return{type:`text`,value:`Voice mode requires a Claude.ai account. Please run /login to sign in.`};let{checkVoiceDependencies:v,requestMicrophonePermission:y}=await import(`./voice-DXiiy8HX.js`),b=await v();if(!b.available)return{type:`text`,value:`No audio recording tool found.${b.installCommand?`\nInstall audio recording tools? Run: ${b.installCommand}`:`
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{Ac as t,Ka as n,Pc as r,Sc as i,lo as a,oo as o}from"./paths-q1-Ni8Oh.js";import{n as s,r as c}from"./analytics-DqMQntaB.js";import{SA as l,aT as u,oT as d,vA as f}from"./loadAgentsDir-Cl2w3uvH.js";import{n as p,r as m}from"./voiceModeEnabled-wWM929QG.js";import{n as h,t as g}from"./useVoice-D3PqTfCK.js";var _,v;e((()=>{g(),d(),s(),t(),f(),o(),p(),_=2,v=async e=>{if(!m())return{type:`text`,value:`Voice mode is not available.`};let t=n(),o=t.voiceEnabled===!0,s=e?.trim().toLowerCase();if(o&&s===`doubao`)return a(`userSettings`,{voiceProvider:`doubao`}).error?{type:`text`,value:`Failed to update settings. Check your settings file for syntax errors.`}:(l.notifyChange(`userSettings`),{type:`text`,value:`Voice mode switched to Doubao ASR. Hold ${u(`voice:pushToTalk`,`Chat`,`Space`)} to record.`});if(o&&s===`anthropic`)return a(`userSettings`,{voiceProvider:`anthropic`}).error?{type:`text`,value:`Failed to update settings. Check your settings file for syntax errors.`}:(l.notifyChange(`userSettings`),{type:`text`,value:`Voice mode switched to Anthropic STT. Hold ${u(`voice:pushToTalk`,`Chat`,`Space`)} to record.`});if(o)return a(`userSettings`,{voiceEnabled:!1}).error?{type:`text`,value:`Failed to update settings. Check your settings file for syntax errors.`}:(l.notifyChange(`userSettings`),c(`tengu_voice_toggled`,{enabled:!1}),{type:`text`,value:`Voice mode disabled.`});let d=s===`doubao`?`doubao`:`anthropic`,{isVoiceStreamAvailable:f}=await import(`./voiceStreamSTT-Dp-1uSjP.js`),{checkRecordingAvailability:p}=await import(`./voice-DXiiy8HX.js`),g=await p();if(!g.available)return{type:`text`,value:g.reason??`Voice mode is not available in this environment.`};if(d!==`doubao`&&!f())return{type:`text`,value:`Voice mode requires a Claude.ai account. Please run /login to sign in.`};let{checkVoiceDependencies:v,requestMicrophonePermission:y}=await import(`./voice-DXiiy8HX.js`),b=await v();if(!b.available)return{type:`text`,value:`No audio recording tool found.${b.installCommand?`\nInstall audio recording tools? Run: ${b.installCommand}`:`
2
2
  Install SoX manually for audio recording.`}`};if(!await y()){let e;return e=process.platform===`win32`?`Settings → Privacy → Microphone`:process.platform===`linux`?`your system's audio settings`:`System Settings → Privacy & Security → Microphone`,{type:`text`,value:`Microphone access is denied. To enable it, go to ${e}, then run /voice again.`}}if(a(`userSettings`,{voiceEnabled:!0,...d===`doubao`?{voiceProvider:`doubao`}:{}}).error)return{type:`text`,value:`Failed to update settings. Check your settings file for syntax errors.`};l.notifyChange(`userSettings`),c(`tengu_voice_toggled`,{enabled:!0});let x=u(`voice:pushToTalk`,`Chat`,`Space`),S=``,C=d===`doubao`?`Doubao ASR`:`Anthropic`;if(d!==`doubao`){let e=h(t.language),n=i(),a=n.voiceLangHintLastLanguage!==e.code,o=a?0:n.voiceLangHintShownCount??0,s=!e.fellBackFrom&&o<_;e.fellBackFrom?S=` Note: "${e.fellBackFrom}" is not a supported dictation language; using English. Change it via /config.`:s&&(S=` Dictation language: ${e.code} (/config to change).`),(a||s)&&r(t=>({...t,voiceLangHintShownCount:o+ +!!s,voiceLangHintLastLanguage:e.code}))}return{type:`text`,value:`Voice mode enabled (${C}). Hold ${x} to record.${S}`}}}))();export{v as call};
@@ -0,0 +1 @@
1
+ import{a as e,i as t,n}from"./voiceModeEnabled-wWM929QG.js";n();export{t as isVoiceGrowthBookEnabled,e as isVoiceModeEnabled};
@@ -1 +1 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{Jt as t,S as n,_ as r,cn as i,on as a}from"./paths-o5iA-EnQ.js";function o(){return!r(`tengu_amber_quartz_disabled`,!1)}function s(){return i()?!!t()?.accessToken:!1}function c(){return s()&&o()}function l(){return o()}var u=e((()=>{n(),a()}));export{c as a,o as i,u as n,l as r,s as t};
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{Jt as t,S as n,_ as r,cn as i,on as a}from"./paths-q1-Ni8Oh.js";function o(){return!r(`tengu_amber_quartz_disabled`,!1)}function s(){return i()?!!t()?.accessToken:!1}function c(){return s()&&o()}function l(){return o()}var u=e((()=>{n(),a()}));export{c as a,o as i,u as n,l as r,s as t};
@@ -1 +1 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,r as n}from"./wrapper-D5qL1aQL.js";import{Jt as r,Pt as i,S as a,St as o,_ as s,cn as c,on as l,wt as u}from"./paths-o5iA-EnQ.js";import{E as d,T as f,d as p,s as m,w as h}from"./debug-UI3T040K.js";import{l as g,u as _}from"./oauth-CdZEzMww.js";import{o as v,s as y}from"./log-CzsijfHZ.js";import{c as b,g as x,h as S,l as C,u as w}from"./proxy-CfZp-wce.js";function T(){if(!c())return!1;let e=r();return e!==null&&e.accessToken!==null}async function E(e,t){await i();let a=r();if(!a?.accessToken)return p(`[voice_stream] No OAuth token available`),null;let c=process.env.VOICE_STREAM_BASE_URL||g().BASE_API_URL.replace(`https://`,`wss://`).replace(`http://`,`ws://`);process.env.VOICE_STREAM_BASE_URL&&p(`[voice_stream] Using VOICE_STREAM_BASE_URL override: ${process.env.VOICE_STREAM_BASE_URL}`);let l=new URLSearchParams({encoding:`linear16`,sample_rate:`16000`,channels:`1`,endpointing_ms:`300`,utterance_end_ms:`1000`,language:t?.language??`en`}),u=s(`tengu_cobalt_frost`,!1);if(u&&(l.set(`use_conversation_engine`,`true`),l.set(`stt_provider`,`deepgram-nova3`),p(`[voice_stream] Nova 3 gate enabled (tengu_cobalt_frost)`)),t?.keyterms?.length)for(let e of t.keyterms)l.append(`keyterms`,e);let m=`${c}${k}?${l.toString()}`;p(`[voice_stream] Connecting to ${m}`);let h={Authorization:`Bearer ${a.accessToken}`,"User-Agent":o(),"x-app":`cli`},_=S(),v=new n(m,typeof Bun<`u`?{headers:h,proxy:C(m),tls:_||void 0}:{headers:h,agent:b(m),..._}),x=null,w=!1,T=!1,E=!1,M=!1,N=null,P=null,F={send(e){if(v.readyState===n.OPEN){if(T){p(`[voice_stream] Dropping audio chunk after CloseStream: ${String(e.length)} bytes`);return}p(`[voice_stream] Sending audio chunk: ${String(e.length)} bytes`),v.send(Buffer.from(e))}},finalize(){return E||T?Promise.resolve(`ws_already_closed`):(E=!0,new Promise(t=>{let r=setTimeout(()=>N?.(`safety_timeout`),j.safety),i=setTimeout(()=>N?.(`no_data_timeout`),j.noData);if(P=()=>{clearTimeout(i),P=null},N=n=>{if(clearTimeout(r),clearTimeout(i),N=null,P=null,I){p(`[voice_stream] Promoting unreported interim before ${n} resolve`);let t=I;I=``,e.onTranscript(t,!0)}p(`[voice_stream] Finalize resolved via ${n}`),t(n)},v.readyState===n.CLOSED||v.readyState===n.CLOSING){N(`ws_already_closed`);return}setTimeout(()=>{T=!0,v.readyState===n.OPEN&&(p(`[voice_stream] Sending CloseStream (finalize)`),v.send(O))},0)}))},close(){T=!0,x&&(clearInterval(x),x=null),w=!1,v.readyState===n.OPEN&&v.close()},isConnected(){return w&&v.readyState===n.OPEN}};v.on(`open`,()=>{p(`[voice_stream] WebSocket connected`),w=!0,p(`[voice_stream] Sending initial KeepAlive`),v.send(D),x=setInterval(e=>{e.readyState===n.OPEN&&(p(`[voice_stream] Sending periodic KeepAlive`),e.send(D))},A,v),e.onReady(F)});let I=``;return v.on(`message`,t=>{let n=t.toString();p(`[voice_stream] Message received (${String(n.length)} chars): ${n.slice(0,200)}`);let r;try{r=f(n)}catch{return}switch(r.type){case`TranscriptText`:{let t=r.data;if(p(`[voice_stream] TranscriptText: "${t??``}"`),T&&P?.(),t){if(!u&&I){let n=I.trimStart(),r=t.trimStart();n&&r&&!r.startsWith(n)&&!n.startsWith(r)&&(p(`[voice_stream] Auto-finalizing previous segment (new segment detected): "${I}"`),e.onTranscript(I,!0))}I=t,e.onTranscript(t,!1)}break}case`TranscriptEndpoint`:{p(`[voice_stream] TranscriptEndpoint received, lastTranscriptText="${I}"`);let t=I;I=``,t&&e.onTranscript(t,!0),T&&N?.(`post_closestream_endpoint`);break}case`TranscriptError`:{let t=r.description??r.error_code??`unknown transcription error`;p(`[voice_stream] TranscriptError: ${t}`),E||e.onError(t);break}case`error`:{let t=r.message??d(r);p(`[voice_stream] Server error: ${t}`),E||e.onError(t);break}default:break}}),v.on(`close`,(t,n)=>{let r=n?.toString()??``;if(p(`[voice_stream] WebSocket closed: code=${String(t)} reason="${r}"`),w=!1,x&&(clearInterval(x),x=null),I){p(`[voice_stream] Promoting unreported interim transcript to final on close`);let t=I;I=``,e.onTranscript(t,!0)}N?.(`ws_close`),!E&&!M&&t!==1e3&&t!==1005&&e.onError(`Connection closed: code ${String(t)}${r?` — ${r}`:``}`),e.onClose()}),v.on(`unexpected-response`,(t,n)=>{let r=n.statusCode??0;if(r===101){p(`[voice_stream] unexpected-response fired with 101; ignoring`);return}p(`[voice_stream] Upgrade rejected: status=${String(r)} cf-mitigated=${String(n.headers[`cf-mitigated`])} cf-ray=${String(n.headers[`cf-ray`])}`),M=!0,n.resume(),t.destroy(),!E&&e.onError(`WebSocket upgrade rejected with HTTP ${String(r)}`,{fatal:r>=400&&r<500})}),v.on(`error`,t=>{y(t),p(`[voice_stream] WebSocket error: ${t.message}`),E||e.onError(`Voice stream connection error: ${t.message}`)}),F}var D,O,k,A,j,M=e((()=>{t(),_(),l(),m(),u(),v(),x(),w(),h(),a(),D=`{"type":"KeepAlive"}`,O=`{"type":"CloseStream"}`,k=`/api/ws/speech_to_text/voice_stream`,A=8e3,j={safety:5e3,noData:1500}}));export{T as i,E as n,M as r,j as t};
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,r as n}from"./wrapper-D5qL1aQL.js";import{Jt as r,Pt as i,S as a,St as o,_ as s,cn as c,on as l,wt as u}from"./paths-q1-Ni8Oh.js";import{E as d,T as f,d as p,s as m,w as h}from"./debug-UI3T040K.js";import{l as g,u as _}from"./oauth-CdZEzMww.js";import{o as v,s as y}from"./log-CzsijfHZ.js";import{c as b,g as x,h as S,l as C,u as w}from"./proxy-CfZp-wce.js";function T(){if(!c())return!1;let e=r();return e!==null&&e.accessToken!==null}async function E(e,t){await i();let a=r();if(!a?.accessToken)return p(`[voice_stream] No OAuth token available`),null;let c=process.env.VOICE_STREAM_BASE_URL||g().BASE_API_URL.replace(`https://`,`wss://`).replace(`http://`,`ws://`);process.env.VOICE_STREAM_BASE_URL&&p(`[voice_stream] Using VOICE_STREAM_BASE_URL override: ${process.env.VOICE_STREAM_BASE_URL}`);let l=new URLSearchParams({encoding:`linear16`,sample_rate:`16000`,channels:`1`,endpointing_ms:`300`,utterance_end_ms:`1000`,language:t?.language??`en`}),u=s(`tengu_cobalt_frost`,!1);if(u&&(l.set(`use_conversation_engine`,`true`),l.set(`stt_provider`,`deepgram-nova3`),p(`[voice_stream] Nova 3 gate enabled (tengu_cobalt_frost)`)),t?.keyterms?.length)for(let e of t.keyterms)l.append(`keyterms`,e);let m=`${c}${k}?${l.toString()}`;p(`[voice_stream] Connecting to ${m}`);let h={Authorization:`Bearer ${a.accessToken}`,"User-Agent":o(),"x-app":`cli`},_=S(),v=new n(m,typeof Bun<`u`?{headers:h,proxy:C(m),tls:_||void 0}:{headers:h,agent:b(m),..._}),x=null,w=!1,T=!1,E=!1,M=!1,N=null,P=null,F={send(e){if(v.readyState===n.OPEN){if(T){p(`[voice_stream] Dropping audio chunk after CloseStream: ${String(e.length)} bytes`);return}p(`[voice_stream] Sending audio chunk: ${String(e.length)} bytes`),v.send(Buffer.from(e))}},finalize(){return E||T?Promise.resolve(`ws_already_closed`):(E=!0,new Promise(t=>{let r=setTimeout(()=>N?.(`safety_timeout`),j.safety),i=setTimeout(()=>N?.(`no_data_timeout`),j.noData);if(P=()=>{clearTimeout(i),P=null},N=n=>{if(clearTimeout(r),clearTimeout(i),N=null,P=null,I){p(`[voice_stream] Promoting unreported interim before ${n} resolve`);let t=I;I=``,e.onTranscript(t,!0)}p(`[voice_stream] Finalize resolved via ${n}`),t(n)},v.readyState===n.CLOSED||v.readyState===n.CLOSING){N(`ws_already_closed`);return}setTimeout(()=>{T=!0,v.readyState===n.OPEN&&(p(`[voice_stream] Sending CloseStream (finalize)`),v.send(O))},0)}))},close(){T=!0,x&&(clearInterval(x),x=null),w=!1,v.readyState===n.OPEN&&v.close()},isConnected(){return w&&v.readyState===n.OPEN}};v.on(`open`,()=>{p(`[voice_stream] WebSocket connected`),w=!0,p(`[voice_stream] Sending initial KeepAlive`),v.send(D),x=setInterval(e=>{e.readyState===n.OPEN&&(p(`[voice_stream] Sending periodic KeepAlive`),e.send(D))},A,v),e.onReady(F)});let I=``;return v.on(`message`,t=>{let n=t.toString();p(`[voice_stream] Message received (${String(n.length)} chars): ${n.slice(0,200)}`);let r;try{r=f(n)}catch{return}switch(r.type){case`TranscriptText`:{let t=r.data;if(p(`[voice_stream] TranscriptText: "${t??``}"`),T&&P?.(),t){if(!u&&I){let n=I.trimStart(),r=t.trimStart();n&&r&&!r.startsWith(n)&&!n.startsWith(r)&&(p(`[voice_stream] Auto-finalizing previous segment (new segment detected): "${I}"`),e.onTranscript(I,!0))}I=t,e.onTranscript(t,!1)}break}case`TranscriptEndpoint`:{p(`[voice_stream] TranscriptEndpoint received, lastTranscriptText="${I}"`);let t=I;I=``,t&&e.onTranscript(t,!0),T&&N?.(`post_closestream_endpoint`);break}case`TranscriptError`:{let t=r.description??r.error_code??`unknown transcription error`;p(`[voice_stream] TranscriptError: ${t}`),E||e.onError(t);break}case`error`:{let t=r.message??d(r);p(`[voice_stream] Server error: ${t}`),E||e.onError(t);break}default:break}}),v.on(`close`,(t,n)=>{let r=n?.toString()??``;if(p(`[voice_stream] WebSocket closed: code=${String(t)} reason="${r}"`),w=!1,x&&(clearInterval(x),x=null),I){p(`[voice_stream] Promoting unreported interim transcript to final on close`);let t=I;I=``,e.onTranscript(t,!0)}N?.(`ws_close`),!E&&!M&&t!==1e3&&t!==1005&&e.onError(`Connection closed: code ${String(t)}${r?` — ${r}`:``}`),e.onClose()}),v.on(`unexpected-response`,(t,n)=>{let r=n.statusCode??0;if(r===101){p(`[voice_stream] unexpected-response fired with 101; ignoring`);return}p(`[voice_stream] Upgrade rejected: status=${String(r)} cf-mitigated=${String(n.headers[`cf-mitigated`])} cf-ray=${String(n.headers[`cf-ray`])}`),M=!0,n.resume(),t.destroy(),!E&&e.onError(`WebSocket upgrade rejected with HTTP ${String(r)}`,{fatal:r>=400&&r<500})}),v.on(`error`,t=>{y(t),p(`[voice_stream] WebSocket error: ${t.message}`),E||e.onError(`Voice stream connection error: ${t.message}`)}),F}var D,O,k,A,j,M=e((()=>{t(),_(),l(),m(),u(),v(),x(),w(),h(),a(),D=`{"type":"KeepAlive"}`,O=`{"type":"CloseStream"}`,k=`/api/ws/speech_to_text/voice_stream`,A=8e3,j={safety:5e3,noData:1500}}));export{T as i,E as n,M as r,j as t};
@@ -0,0 +1 @@
1
+ import{i as e,r as t}from"./voiceStreamSTT-CnK9GN6Q.js";t();export{e as isVoiceStreamAvailable};
@@ -1 +1 @@
1
- import{Jt as e,on as t}from"./paths-o5iA-EnQ.js";import{L as n,V as r}from"./debug-UI3T040K.js";import{o as i,t as a}from"./bridgeMain-QbfEOTqV.js";import{resolve as o}from"path";t(),r();var s=78,c=1;async function l(e){if(!e){console.error(`Error: --daemon-worker requires a worker kind`),process.exitCode=s;return}switch(e){case`remoteControl`:await u();break;default:console.error(`Error: unknown daemon worker kind '${e}'`),process.exitCode=s}}async function u(){let t=process.env.DAEMON_WORKER_DIR||o(`.`),r=process.env.DAEMON_WORKER_NAME||void 0,l=process.env.DAEMON_WORKER_SPAWN_MODE||`same-dir`,u=parseInt(process.env.DAEMON_WORKER_CAPACITY||`4`,10),d=process.env.DAEMON_WORKER_PERMISSION||void 0,f=process.env.DAEMON_WORKER_SANDBOX===`1`,p=process.env.DAEMON_WORKER_TIMEOUT_MS?parseInt(process.env.DAEMON_WORKER_TIMEOUT_MS,10):void 0,m=process.env.DAEMON_WORKER_CREATE_SESSION!==`0`,h=new AbortController,g=()=>h.abort();process.on(`SIGTERM`,g),process.on(`SIGINT`,g);let _={dir:t,name:r,spawnMode:l,capacity:u,permissionMode:d,sandbox:f,sessionTimeoutMs:p,createSessionOnStart:m,getAccessToken:()=>e()?.accessToken,onAuth401:async t=>!!e()?.accessToken,log:e=>{console.log(`[remoteControl] ${e}`)}};try{await i(_,h.signal)}catch(e){e instanceof a?(console.error(`[remoteControl] permanent error: ${e.message}`),process.exitCode=s):(console.error(`[remoteControl] transient error: ${n(e)}`),process.exitCode=c)}finally{process.off(`SIGTERM`,g),process.off(`SIGINT`,g)}}export{l as runDaemonWorker};
1
+ import{Jt as e,on as t}from"./paths-q1-Ni8Oh.js";import{L as n,V as r}from"./debug-UI3T040K.js";import{o as i,t as a}from"./bridgeMain-DlnIQOtX.js";import{resolve as o}from"path";t(),r();var s=78,c=1;async function l(e){if(!e){console.error(`Error: --daemon-worker requires a worker kind`),process.exitCode=s;return}switch(e){case`remoteControl`:await u();break;default:console.error(`Error: unknown daemon worker kind '${e}'`),process.exitCode=s}}async function u(){let t=process.env.DAEMON_WORKER_DIR||o(`.`),r=process.env.DAEMON_WORKER_NAME||void 0,l=process.env.DAEMON_WORKER_SPAWN_MODE||`same-dir`,u=parseInt(process.env.DAEMON_WORKER_CAPACITY||`4`,10),d=process.env.DAEMON_WORKER_PERMISSION||void 0,f=process.env.DAEMON_WORKER_SANDBOX===`1`,p=process.env.DAEMON_WORKER_TIMEOUT_MS?parseInt(process.env.DAEMON_WORKER_TIMEOUT_MS,10):void 0,m=process.env.DAEMON_WORKER_CREATE_SESSION!==`0`,h=new AbortController,g=()=>h.abort();process.on(`SIGTERM`,g),process.on(`SIGINT`,g);let _={dir:t,name:r,spawnMode:l,capacity:u,permissionMode:d,sandbox:f,sessionTimeoutMs:p,createSessionOnStart:m,getAccessToken:()=>e()?.accessToken,onAuth401:async t=>!!e()?.accessToken,log:e=>{console.log(`[remoteControl] ${e}`)}};try{await i(_,h.signal)}catch(e){e instanceof a?(console.error(`[remoteControl] permanent error: ${e.message}`),process.exitCode=s):(console.error(`[remoteControl] transient error: ${n(e)}`),process.exitCode=c)}finally{process.off(`SIGTERM`,g),process.off(`SIGINT`,g)}}export{l as runDaemonWorker};
@@ -0,0 +1 @@
1
+ import{wt as e,yt as t}from"./loadAgentsDir-Cl2w3uvH.js";e();export{t as execIntoTmuxWorktree};
@@ -1 +1 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{ds as t,no as n,oo as r,xs as i}from"./paths-o5iA-EnQ.js";function a(e){d.set(e.name,e)}function o(e){return e.endsWith(`@${f}`)}function s(e){return d.get(e)}function c(){let e=n(),t=[],r=[];for(let[n,i]of d){if(i.isAvailable&&!i.isAvailable())continue;let a=`${n}@${f}`,o=e?.enabledPlugins?.[a],s=o===void 0?i.defaultEnabled??!0:o===!0,c={name:n,manifest:{name:n,description:i.description,version:i.version},path:f,source:a,repository:a,enabled:s,isBuiltin:!0,hooksConfig:i.hooks,mcpServers:i.mcpServers};s?t.push(c):r.push(c)}return{enabled:t,disabled:r}}function l(){let{enabled:e}=c(),t=[];for(let n of e){let e=d.get(n.name);if(e?.skills)for(let n of e.skills)t.push(u(n))}return t}function u(e){return{type:`prompt`,name:e.name,description:e.description,hasUserSpecifiedDescription:!0,allowedTools:e.allowedTools??[],argumentHint:e.argumentHint,whenToUse:e.whenToUse,model:e.model,disableModelInvocation:e.disableModelInvocation??!1,userInvocable:e.userInvocable??!0,contentLength:0,source:`bundled`,loadedFrom:`bundled`,hooks:e.hooks,context:e.context,agent:e.agent,isEnabled:e.isEnabled??(()=>!0),isHidden:!(e.userInvocable??!0),progressMessage:`running`,getPromptForCommand:e.getPromptForCommand}}var d,f,p=e((()=>{r(),d=new Map,f=`builtin`}));function m(e){if(e.includes(`@`)){let t=e.split(`@`);return{name:t[0]||``,marketplace:t[1]}}return{name:e}}function h(e){return e!==void 0&&t.has(e.toLowerCase())}function g(e){if(e===`managed`)throw Error(`Cannot install plugins to managed scope`);return y[e]}function _(e){return v[e]}var v,y,b=e((()=>{i(),v={policySettings:`managed`,userSettings:`user`,projectSettings:`project`,localSettings:`local`,flagSettings:`flag`},y={user:`userSettings`,project:`projectSettings`,local:`localSettings`}}));function x(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function S(e){return x(e).replace(/"/g,`&quot;`).replace(/'/g,`&apos;`)}var C=e((()=>{}));export{h as a,_ as c,l as d,c as f,a as h,b as i,f as l,o as m,S as n,m as o,p,C as r,g as s,x as t,s as u};
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{ds as t,no as n,oo as r,xs as i}from"./paths-q1-Ni8Oh.js";function a(e){d.set(e.name,e)}function o(e){return e.endsWith(`@${f}`)}function s(e){return d.get(e)}function c(){let e=n(),t=[],r=[];for(let[n,i]of d){if(i.isAvailable&&!i.isAvailable())continue;let a=`${n}@${f}`,o=e?.enabledPlugins?.[a],s=o===void 0?i.defaultEnabled??!0:o===!0,c={name:n,manifest:{name:n,description:i.description,version:i.version},path:f,source:a,repository:a,enabled:s,isBuiltin:!0,hooksConfig:i.hooks,mcpServers:i.mcpServers};s?t.push(c):r.push(c)}return{enabled:t,disabled:r}}function l(){let{enabled:e}=c(),t=[];for(let n of e){let e=d.get(n.name);if(e?.skills)for(let n of e.skills)t.push(u(n))}return t}function u(e){return{type:`prompt`,name:e.name,description:e.description,hasUserSpecifiedDescription:!0,allowedTools:e.allowedTools??[],argumentHint:e.argumentHint,whenToUse:e.whenToUse,model:e.model,disableModelInvocation:e.disableModelInvocation??!1,userInvocable:e.userInvocable??!0,contentLength:0,source:`bundled`,loadedFrom:`bundled`,hooks:e.hooks,context:e.context,agent:e.agent,isEnabled:e.isEnabled??(()=>!0),isHidden:!(e.userInvocable??!0),progressMessage:`running`,getPromptForCommand:e.getPromptForCommand}}var d,f,p=e((()=>{r(),d=new Map,f=`builtin`}));function m(e){if(e.includes(`@`)){let t=e.split(`@`);return{name:t[0]||``,marketplace:t[1]}}return{name:e}}function h(e){return e!==void 0&&t.has(e.toLowerCase())}function g(e){if(e===`managed`)throw Error(`Cannot install plugins to managed scope`);return y[e]}function _(e){return v[e]}var v,y,b=e((()=>{i(),v={policySettings:`managed`,userSettings:`user`,projectSettings:`project`,localSettings:`local`,flagSettings:`flag`},y={user:`userSettings`,project:`projectSettings`,local:`localSettings`}}));function x(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function S(e){return x(e).replace(/"/g,`&quot;`).replace(/'/g,`&apos;`)}var C=e((()=>{}));export{h as a,_ as c,l as d,c as f,a as h,b as i,f as l,o as m,S as n,m as o,p,C as r,g as s,x as t,s as u};
package/dist/cli.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env bun
2
- import{s as e,u as t}from"./chunks/envUtils-BWeoiL4Y.js";var n=globalThis.performance,r=new Map,i=new Map;function a(){return n.now()}function o(e){return r.set(e,a()),{name:e,entryType:`mark`,startTime:r.get(e),duration:0}}function s(e,t,n){let o,s;if(typeof t==`string`){let e=r.get(t),i=n?r.get(n):a();o=e??a(),s=(i??a())-o}else t&&typeof t==`object`?(o=t.start??0,s=(t.end??a())-o):(o=0,s=a());i.set(e,{name:e,startTime:o,duration:s})}function c(e){return e===`mark`?[...r.entries()].map(([e,t])=>({name:e,entryType:`mark`,startTime:t,duration:0})):e===`measure`?[...i.values()].map(e=>({name:e.name,entryType:`measure`,startTime:e.startTime,duration:e.duration})):[]}function l(e,t){return c(t??`mark`).concat(t===void 0?c(`measure`):[]).filter(t=>t.name===e)}function u(e){e===void 0?r.clear():r.delete(e)}function d(e){e===void 0?i.clear():i.delete(e)}var f={now:a,mark:o,measure:s,getEntriesByType:c,getEntriesByName:l,clearMarks:u,clearMeasures:d,clearResourceTimings:(()=>{}),setResourceTimingBufferSize:(()=>{}),markResourceTiming:(()=>{}),get timeOrigin(){return n.timeOrigin},get onresourcetimingbufferfull(){return n.onresourcetimingbufferfull},set onresourcetimingbufferfull(e){},toJSON(){return n.toJSON()}};function p(){globalThis.__performanceShimInstalled||(globalThis.__performanceShimInstalled=!0,globalThis.performance=f)}if(p(),e(),globalThis.MACRO===void 0&&(globalThis.MACRO={VERSION:process.env.CLAUDE_CODE_VERSION||`2.1.888`,BUILD_TIME:new Date().toISOString(),FEEDBACK_CHANNEL:``,ISSUES_EXPLAINER:``,NATIVE_PACKAGE_URL:``,PACKAGE_URL:``,VERSION_CHANGELOG:``}),t(process.env.CLAUDE_CODE_FORCE_INTERACTIVE)){for(let e of[process.stdin,process.stdout,process.stderr])if(!e.isTTY)try{Object.defineProperty(e,`isTTY`,{value:!0,configurable:!0})}catch{}}if(process.env.COREPACK_ENABLE_AUTO_PIN=`0`,process.env.CLAUDE_CODE_REMOTE===`true`){let e=process.env.NODE_OPTIONS||``;process.env.NODE_OPTIONS=e?`${e} --max-old-space-size=8192`:`--max-old-space-size=8192`}async function m(){let e=process.argv.slice(2);if(e.length===1&&(e[0]===`--version`||e[0]===`-v`||e[0]===`-V`)){console.log(`2.6.8 (Claude Code)`);return}let{profileCheckpoint:t}=await import(`./chunks/startupProfiler-SOE--nM9.js`);if(t(`cli_entry`),process.argv[2]===`--claude-in-chrome-mcp`){t(`cli_claude_in_chrome_mcp_path`);let{runClaudeInChromeMcpServer:e}=await import(`./chunks/mcpServer-CTuPkyD6.js`);await e();return}else if(process.argv[2]===`--chrome-native-host`){t(`cli_chrome_native_host_path`);let{runChromeNativeHost:e}=await import(`./chunks/chromeNativeHost-4U39yLtd.js`);await e();return}else if(process.argv[2]===`--computer-use-mcp`){t(`cli_computer_use_mcp_path`);let{runComputerUseMcpServer:e}=await import(`./chunks/mcpServer-CPJo2eKm.js`);await e();return}if(process.argv[2]===`--acp`){t(`cli_acp_path`);let{runAcpAgent:e}=await import(`./chunks/entry-BUwwv2dM.js`);await e();return}if(e[0]===`weixin`){t(`cli_weixin_path`);let{handleWeixinCli:n}=await import(`./chunks/src-BIPP3_mo.js`),{enableConfigs:r}=await import(`./chunks/config-D3QKcEKz.js`),{initializeAnalyticsSink:i}=await import(`./chunks/sink-DG0SNHP7.js`),{shutdownDatadog:a}=await import(`./chunks/datadog-NnzM1Mu3.js`),{shutdown1PEventLogging:o}=await import(`./chunks/firstPartyEventLogger-BOHIpp-w.js`),{logForDebugging:s}=await import(`./chunks/debug-DM5ezCBS.js`),{ChannelPermissionRequestNotificationSchema:c}=await import(`./chunks/channelNotification-Bx6dpA7I.js`);await n(e.slice(1),{enableConfigs:r,initializeAnalyticsSink:i,shutdownDatadog:a,shutdown1PEventLogging:o,logForDebugging:s,registerPermissionHandler(e,t){e.setNotificationHandler(c(),async e=>t(e.params))}},`2.6.8`);return}if(e[0]===`--daemon-worker`||e[0]?.startsWith(`--daemon-worker=`)){let t=e[0]===`--daemon-worker`?e[1]:e[0].split(`=`)[1],{runDaemonWorker:n}=await import(`./chunks/workerRegistry-DCtC-WN3.js`);await n(t);return}if(e[0]===`remote-control`||e[0]===`rc`||e[0]===`remote`||e[0]===`sync`||e[0]===`bridge`){t(`cli_bridge_path`);let{enableConfigs:n}=await import(`./chunks/config-D3QKcEKz.js`);n();let{getBridgeDisabledReason:r,checkBridgeMinVersion:i}=await import(`./chunks/bridgeEnabled-BxtxHb8R.js`),{BRIDGE_LOGIN_ERROR:a}=await import(`./chunks/types-CQ1wrnQ0.js`),{bridgeMain:o}=await import(`./chunks/bridgeMain-CMNptMs4.js`),{exitWithError:s}=await import(`./chunks/process-CWupreF6.js`),{getClaudeAIOAuthTokens:c}=await import(`./chunks/auth-D3SKo0wT.js`),{getBridgeAccessToken:l}=await import(`./chunks/bridgeConfig-V_pmBzSH.js`);!c()?.accessToken&&!l()&&s(a);let u=await r();u&&s(`Error: ${u}`);let d=i();d&&s(d);let{waitForPolicyLimitsToLoad:f,isPolicyAllowed:p}=await import(`./chunks/policyLimits-D6dpS-CU.js`);await f(),p(`allow_remote_control`)||s(`Error: Remote Control is disabled by your organization's policy.`),await o(e.slice(1));return}if(e[0]===`daemon`){t(`cli_daemon_path`);let{enableConfigs:n}=await import(`./chunks/config-D3QKcEKz.js`);n();let{setShellIfWindows:r}=await import(`./chunks/windowsPaths-C9CigqoF.js`);r();let{initSinks:i}=await import(`./chunks/sinks-Cbp-8X1S.js`);i();let{daemonMain:a}=await import(`./chunks/main-C6be1KFk.js`);await a(e.slice(1));return}if(e[0]===`autonomy`){t(`cli_autonomy_path`);let{getAutonomyCommandText:n}=await import(`./chunks/autonomy-BYi6z9LD.js`),r=await n(e.slice(1).join(` `));await new Promise((e,t)=>{process.stdout.write(`${r}\n`,n=>{if(n){t(n);return}e()})}),process.exit(0)}if(e.includes(`--bg`)||e.includes(`--background`)){t(`cli_daemon_path`);let{enableConfigs:n}=await import(`./chunks/config-D3QKcEKz.js`);n();let{setShellIfWindows:r}=await import(`./chunks/windowsPaths-C9CigqoF.js`);r(),await(await import(`./chunks/bg-Dbh5z3Y8.js`)).handleBgStart(e.filter(e=>e!==`--bg`&&e!==`--background`));return}if(e[0]===`ps`||e[0]===`logs`||e[0]===`attach`||e[0]===`kill`){let n=e[0]===`ps`?`status`:e[0];console.error(`[deprecated] Use: claude daemon ${n}${e[1]?` `+e[1]:``}`),t(`cli_daemon_path`);let{enableConfigs:r}=await import(`./chunks/config-D3QKcEKz.js`);r();let{setShellIfWindows:i}=await import(`./chunks/windowsPaths-C9CigqoF.js`);i();let{initSinks:a}=await import(`./chunks/sinks-Cbp-8X1S.js`);a();let{daemonMain:o}=await import(`./chunks/main-C6be1KFk.js`);await o([e[0]===`ps`?`status`:e[0],...e.slice(1)]);return}if(e[0]===`job`){t(`cli_templates_path`);let{templatesMain:n}=await import(`./chunks/templateJobs-DAVqqU0g.js`);await n(e.slice(1)),process.exit(0)}if(e[0]===`new`||e[0]===`list`||e[0]===`reply`){console.error(`[deprecated] Use: claude job ${e[0]} ${e.slice(1).join(` `)}`.trim()),t(`cli_templates_path`);let{templatesMain:n}=await import(`./chunks/templateJobs-DAVqqU0g.js`);await n(e),process.exit(0)}if((e.includes(`--tmux`)||e.includes(`--tmux=classic`))&&(e.includes(`-w`)||e.includes(`--worktree`)||e.some(e=>e.startsWith(`--worktree=`)))){t(`cli_tmux_worktree_fast_path`);let{enableConfigs:n}=await import(`./chunks/config-D3QKcEKz.js`);n();let{isWorktreeModeEnabled:r}=await import(`./chunks/worktreeModeEnabled-THQb19xR.js`);if(r()){let{execIntoTmuxWorktree:t}=await import(`./chunks/worktree-Dv0mPuy_.js`),n=await t(e);if(n.handled)return;if(n.error){let{exitWithError:e}=await import(`./chunks/process-CWupreF6.js`);e(n.error)}}}e.length===1&&(e[0]===`--update`||e[0]===`--upgrade`)&&(process.argv=[process.argv[0],process.argv[1],`update`]),e.includes(`--bare`)&&(process.env.CLAUDE_CODE_SIMPLE=`1`);let{startCapturingEarlyInput:n}=await import(`./chunks/earlyInput-JGJo1zcC.js`);n(),t(`cli_before_main_import`);let{main:r}=await import(`./chunks/main-Cd_i0ZPo.js`);t(`cli_after_main_import`),await r(),t(`cli_after_main_complete`)}await m();export{};
2
+ import{s as e,u as t}from"./chunks/envUtils-BWeoiL4Y.js";var n=globalThis.performance,r=new Map,i=new Map;function a(){return n.now()}function o(e){return r.set(e,a()),{name:e,entryType:`mark`,startTime:r.get(e),duration:0}}function s(e,t,n){let o,s;if(typeof t==`string`){let e=r.get(t),i=n?r.get(n):a();o=e??a(),s=(i??a())-o}else t&&typeof t==`object`?(o=t.start??0,s=(t.end??a())-o):(o=0,s=a());i.set(e,{name:e,startTime:o,duration:s})}function c(e){return e===`mark`?[...r.entries()].map(([e,t])=>({name:e,entryType:`mark`,startTime:t,duration:0})):e===`measure`?[...i.values()].map(e=>({name:e.name,entryType:`measure`,startTime:e.startTime,duration:e.duration})):[]}function l(e,t){return c(t??`mark`).concat(t===void 0?c(`measure`):[]).filter(t=>t.name===e)}function u(e){e===void 0?r.clear():r.delete(e)}function d(e){e===void 0?i.clear():i.delete(e)}var f={now:a,mark:o,measure:s,getEntriesByType:c,getEntriesByName:l,clearMarks:u,clearMeasures:d,clearResourceTimings:(()=>{}),setResourceTimingBufferSize:(()=>{}),markResourceTiming:(()=>{}),get timeOrigin(){return n.timeOrigin},get onresourcetimingbufferfull(){return n.onresourcetimingbufferfull},set onresourcetimingbufferfull(e){},toJSON(){return n.toJSON()}};function p(){globalThis.__performanceShimInstalled||(globalThis.__performanceShimInstalled=!0,globalThis.performance=f)}if(p(),e(),globalThis.MACRO===void 0&&(globalThis.MACRO={VERSION:process.env.CLAUDE_CODE_VERSION||`2.1.888`,BUILD_TIME:new Date().toISOString(),FEEDBACK_CHANNEL:``,ISSUES_EXPLAINER:``,NATIVE_PACKAGE_URL:``,PACKAGE_URL:``,VERSION_CHANGELOG:``}),t(process.env.CLAUDE_CODE_FORCE_INTERACTIVE)){for(let e of[process.stdin,process.stdout,process.stderr])if(!e.isTTY)try{Object.defineProperty(e,`isTTY`,{value:!0,configurable:!0})}catch{}}if(process.env.COREPACK_ENABLE_AUTO_PIN=`0`,process.env.CLAUDE_CODE_REMOTE===`true`){let e=process.env.NODE_OPTIONS||``;process.env.NODE_OPTIONS=e?`${e} --max-old-space-size=8192`:`--max-old-space-size=8192`}async function m(){let e=process.argv.slice(2);if(e.length===1&&(e[0]===`--version`||e[0]===`-v`||e[0]===`-V`)){console.log(`2.6.9 (Claude Code)`);return}let{profileCheckpoint:t}=await import(`./chunks/startupProfiler-SOE--nM9.js`);if(t(`cli_entry`),process.argv[2]===`--claude-in-chrome-mcp`){t(`cli_claude_in_chrome_mcp_path`);let{runClaudeInChromeMcpServer:e}=await import(`./chunks/mcpServer-Wd9rZG_E.js`);await e();return}else if(process.argv[2]===`--chrome-native-host`){t(`cli_chrome_native_host_path`);let{runChromeNativeHost:e}=await import(`./chunks/chromeNativeHost-4U39yLtd.js`);await e();return}else if(process.argv[2]===`--computer-use-mcp`){t(`cli_computer_use_mcp_path`);let{runComputerUseMcpServer:e}=await import(`./chunks/mcpServer-CpBN77YB.js`);await e();return}if(process.argv[2]===`--acp`){t(`cli_acp_path`);let{runAcpAgent:e}=await import(`./chunks/entry-Di8oWZUk.js`);await e();return}if(e[0]===`weixin`){t(`cli_weixin_path`);let{handleWeixinCli:n}=await import(`./chunks/src-BIPP3_mo.js`),{enableConfigs:r}=await import(`./chunks/config-BQ-MayP6.js`),{initializeAnalyticsSink:i}=await import(`./chunks/sink-BSwQ045N.js`),{shutdownDatadog:a}=await import(`./chunks/datadog-MUvg76p3.js`),{shutdown1PEventLogging:o}=await import(`./chunks/firstPartyEventLogger-CISUrAsf.js`),{logForDebugging:s}=await import(`./chunks/debug-DM5ezCBS.js`),{ChannelPermissionRequestNotificationSchema:c}=await import(`./chunks/channelNotification-CLVU5AuO.js`);await n(e.slice(1),{enableConfigs:r,initializeAnalyticsSink:i,shutdownDatadog:a,shutdown1PEventLogging:o,logForDebugging:s,registerPermissionHandler(e,t){e.setNotificationHandler(c(),async e=>t(e.params))}},`2.6.9`);return}if(e[0]===`--daemon-worker`||e[0]?.startsWith(`--daemon-worker=`)){let t=e[0]===`--daemon-worker`?e[1]:e[0].split(`=`)[1],{runDaemonWorker:n}=await import(`./chunks/workerRegistry-CrIpKIZe.js`);await n(t);return}if(e[0]===`remote-control`||e[0]===`rc`||e[0]===`remote`||e[0]===`sync`||e[0]===`bridge`){t(`cli_bridge_path`);let{enableConfigs:n}=await import(`./chunks/config-BQ-MayP6.js`);n();let{getBridgeDisabledReason:r,checkBridgeMinVersion:i}=await import(`./chunks/bridgeEnabled-D5qCI5v2.js`),{BRIDGE_LOGIN_ERROR:a}=await import(`./chunks/types-CQ1wrnQ0.js`),{bridgeMain:o}=await import(`./chunks/bridgeMain-B4Zv8UOe.js`),{exitWithError:s}=await import(`./chunks/process-CWupreF6.js`),{getClaudeAIOAuthTokens:c}=await import(`./chunks/auth-DelyQc8g.js`),{getBridgeAccessToken:l}=await import(`./chunks/bridgeConfig-ZcbBdhji.js`);!c()?.accessToken&&!l()&&s(a);let u=await r();u&&s(`Error: ${u}`);let d=i();d&&s(d);let{waitForPolicyLimitsToLoad:f,isPolicyAllowed:p}=await import(`./chunks/policyLimits-DUGrXcje.js`);await f(),p(`allow_remote_control`)||s(`Error: Remote Control is disabled by your organization's policy.`),await o(e.slice(1));return}if(e[0]===`daemon`){t(`cli_daemon_path`);let{enableConfigs:n}=await import(`./chunks/config-BQ-MayP6.js`);n();let{setShellIfWindows:r}=await import(`./chunks/windowsPaths-C9CigqoF.js`);r();let{initSinks:i}=await import(`./chunks/sinks-DHHmQJi-.js`);i();let{daemonMain:a}=await import(`./chunks/main-C6be1KFk.js`);await a(e.slice(1));return}if(e[0]===`autonomy`){t(`cli_autonomy_path`);let{getAutonomyCommandText:n}=await import(`./chunks/autonomy-tTAucjip.js`),r=await n(e.slice(1).join(` `));await new Promise((e,t)=>{process.stdout.write(`${r}\n`,n=>{if(n){t(n);return}e()})}),process.exit(0)}if(e.includes(`--bg`)||e.includes(`--background`)){t(`cli_daemon_path`);let{enableConfigs:n}=await import(`./chunks/config-BQ-MayP6.js`);n();let{setShellIfWindows:r}=await import(`./chunks/windowsPaths-C9CigqoF.js`);r(),await(await import(`./chunks/bg-Dbh5z3Y8.js`)).handleBgStart(e.filter(e=>e!==`--bg`&&e!==`--background`));return}if(e[0]===`ps`||e[0]===`logs`||e[0]===`attach`||e[0]===`kill`){let n=e[0]===`ps`?`status`:e[0];console.error(`[deprecated] Use: claude daemon ${n}${e[1]?` `+e[1]:``}`),t(`cli_daemon_path`);let{enableConfigs:r}=await import(`./chunks/config-BQ-MayP6.js`);r();let{setShellIfWindows:i}=await import(`./chunks/windowsPaths-C9CigqoF.js`);i();let{initSinks:a}=await import(`./chunks/sinks-DHHmQJi-.js`);a();let{daemonMain:o}=await import(`./chunks/main-C6be1KFk.js`);await o([e[0]===`ps`?`status`:e[0],...e.slice(1)]);return}if(e[0]===`job`){t(`cli_templates_path`);let{templatesMain:n}=await import(`./chunks/templateJobs-V2-TVeGE.js`);await n(e.slice(1)),process.exit(0)}if(e[0]===`new`||e[0]===`list`||e[0]===`reply`){console.error(`[deprecated] Use: claude job ${e[0]} ${e.slice(1).join(` `)}`.trim()),t(`cli_templates_path`);let{templatesMain:n}=await import(`./chunks/templateJobs-V2-TVeGE.js`);await n(e),process.exit(0)}if((e.includes(`--tmux`)||e.includes(`--tmux=classic`))&&(e.includes(`-w`)||e.includes(`--worktree`)||e.some(e=>e.startsWith(`--worktree=`)))){t(`cli_tmux_worktree_fast_path`);let{enableConfigs:n}=await import(`./chunks/config-BQ-MayP6.js`);n();let{isWorktreeModeEnabled:r}=await import(`./chunks/worktreeModeEnabled-THQb19xR.js`);if(r()){let{execIntoTmuxWorktree:t}=await import(`./chunks/worktree-YbEK6b36.js`),n=await t(e);if(n.handled)return;if(n.error){let{exitWithError:e}=await import(`./chunks/process-CWupreF6.js`);e(n.error)}}}e.length===1&&(e[0]===`--update`||e[0]===`--upgrade`)&&(process.argv=[process.argv[0],process.argv[1],`update`]),e.includes(`--bare`)&&(process.env.CLAUDE_CODE_SIMPLE=`1`);let{startCapturingEarlyInput:n}=await import(`./chunks/earlyInput-JGJo1zcC.js`);n(),t(`cli_before_main_import`);let{main:r}=await import(`./chunks/main-gTbhsbIs.js`);t(`cli_after_main_import`),await r(),t(`cli_after_main_complete`)}await m();export{};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-code-best",
3
- "version": "2.6.8",
3
+ "version": "2.6.9",
4
4
  "description": "Reverse-engineered Anthropic Claude Code CLI — interactive AI coding assistant in the terminal",
5
5
  "type": "module",
6
6
  "author": "claude-code-best <claude-code-best@proton.me>",
@@ -1 +0,0 @@
1
- import{t as e}from"./ApproveApiKey-DhsT69v7.js";export{e as ApproveApiKey};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./ClaudeMdExternalIncludesDialog-Dofr1TYr.js";e();export{t as ClaudeMdExternalIncludesDialog};
@@ -1 +0,0 @@
1
- import{_y as e,vy as t}from"./loadAgentsDir-DF6FgRn-.js";t();export{e as ConsoleOAuthFlow};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./Doctor-Zd0UaR5d.js";e();export{t as Doctor};
@@ -1 +0,0 @@
1
- import{r as e,t}from"./Grove-TYf1glGP.js";e();export{t as GroveDialog};
@@ -1 +0,0 @@
1
- import{t as e}from"./REPL-D2p-vgct.js";export{e as REPL};
@@ -1 +0,0 @@
1
- import{UO as e,WO as t}from"./loadAgentsDir-DF6FgRn-.js";t();export{e as clearSearchExtraToolsDescriptionCache};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./SentryErrorBoundary-z8tMb-zO.js";e();export{t as SentryErrorBoundary};
@@ -1 +0,0 @@
1
- import{a as e,n as t,o as n}from"./api-O4eHGLTY.js";n();export{t as fetchCodeSessionsFromSessionsAPI,e as getOAuthHeaders};
@@ -1 +0,0 @@
1
- import{r as e}from"./asciicast-o5Zg4dJt.js";export{e as renameRecordingForSession};
@@ -1 +0,0 @@
1
- import{i as e,s as t}from"./assistant-D5Tg_1ry.js";e();export{t as isAssistantMode};
@@ -1 +0,0 @@
1
- import{Cb as e,Sb as t,bb as n,xb as r}from"./loadAgentsDir-DF6FgRn-.js";e();export{n as authLogin,r as authLogout,t as authStatus};
@@ -1 +0,0 @@
1
- import{t as e}from"./backgroundHousekeeping-BG_UYxFF.js";export{e as startBackgroundHousekeeping};
@@ -1 +0,0 @@
1
- import{a as e,n as t,o as n,t as r}from"./bridgeConfig-C_GoD1k5.js";e();export{r as getBridgeAccessToken,t as getBridgeBaseUrl,n as isSelfHostedBridge};
@@ -1 +0,0 @@
1
- import{n as e,r as t,t as n}from"./bridgeEnabled-cSK8a7tN.js";t();export{n as checkBridgeMinVersion,e as getBridgeDisabledReason};
@@ -1 +0,0 @@
1
- import{n as e}from"./bridgeMain-QbfEOTqV.js";export{e as bridgeMain};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./caches-DGW9ovtw.js";e();export{t as clearSessionCaches};
@@ -1 +0,0 @@
1
- import{SA as e,vA as t}from"./loadAgentsDir-DF6FgRn-.js";t();export{e as settingsChangeDetector};
@@ -1 +0,0 @@
1
- import{a as e,c as t}from"./channelNotification-n7Avue-9.js";t();export{e as ChannelPermissionRequestNotificationSchema};
@@ -1 +0,0 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./conversation-CRoOMglD.js";var r;e((()=>{t(),r=async(e,t)=>(await n(t),{type:`text`,value:``})}))();export{r as call};
@@ -1 +0,0 @@
1
- import{la as e,ua as t}from"./paths-o5iA-EnQ.js";t();export{e as getOrganizationUUID};
@@ -1 +0,0 @@
1
- import{Gi as e,Xi as t,zi as n}from"./loadAgentsDir-DF6FgRn-.js";t();export{n as clearCommandsCache,e as getCommands};
@@ -1 +0,0 @@
1
- import{d as e,l as t}from"./commitAttribution-q7SEukgl.js";t();export{e as isInternalModelRepo};
@@ -1 +0,0 @@
1
- import{n as e,r as t,t as n}from"./context-noninteractive-CFlod2Eg.js";t();export{n as call,e as collectContextData};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./conversation-CRoOMglD.js";e();export{t as clearConversation};
@@ -1 +0,0 @@
1
- import{a as e,i as t,n,r}from"./createSession-rRZIkjl3.js";t();export{n as createBridgeSession,r as getBridgeSession,e as updateBridgeSessionTitle};
@@ -1 +0,0 @@
1
- import{r as e,t}from"./datadog-Bb65d6yd.js";t();export{e as shutdownDatadog};
@@ -1,14 +0,0 @@
1
- import{n as e,t}from"./defineProperty-80gRi2ZW.js";import{a as n,c as r,i,l as a,n as o,o as s,r as c,s as l,t as u,u as d}from"./classPrivateFieldSet2-EAQNhHs8.js";import{Cn as f,Ln as p,Mn as m,Tt as h,Xn as g,Yn as _,_r as v,kt as y,nn as b,un as x,vt as ee,wn as S}from"./schemas-BGAvj1T4.js";import{t as te}from"./v4-f1i_CNUT.js";import{cn as ne,jr as C,lr as re}from"./state-sIHsFpDu.js";import{Ac as ie,Dr as ae,Pr as oe,_c as se,no as ce,oo as le}from"./paths-o5iA-EnQ.js";import{Ar as ue,Ci as de,Cv as fe,G as pe,Gi as me,JE as he,K as ge,Ku as _e,Of as ve,Xi as ye,YE as be,_r as xe,fp as Se,kf as Ce,pp as we,qu as Te,va as Ee,wv as De,ya as Oe}from"./loadAgentsDir-DF6FgRn-.js";import{Bn as ke,Vn as Ae}from"./prompt-DiHksuOs.js";import{o as je,t as Me}from"./fileStateCache-C7-TxF8G.js";import{t as Ne}from"./QueryEngine-DigBggXq.js";import*as w from"node:path";import{randomUUID as Pe}from"node:crypto";import{Readable as Fe,Writable as Ie}from"node:stream";te();var T={authenticate:`authenticate`,document_did_change:`document/didChange`,document_did_close:`document/didClose`,document_did_focus:`document/didFocus`,document_did_open:`document/didOpen`,document_did_save:`document/didSave`,initialize:`initialize`,logout:`logout`,nes_accept:`nes/accept`,nes_close:`nes/close`,nes_reject:`nes/reject`,nes_start:`nes/start`,nes_suggest:`nes/suggest`,session_cancel:`session/cancel`,session_close:`session/close`,session_fork:`session/fork`,session_list:`session/list`,session_load:`session/load`,session_new:`session/new`,session_prompt:`session/prompt`,session_resume:`session/resume`,session_set_config_option:`session/set_config_option`,session_set_mode:`session/set_mode`,session_set_model:`session/set_model`},E={elicitation_complete:`elicitation/complete`,elicitation_create:`elicitation/create`,fs_read_text_file:`fs/read_text_file`,fs_write_text_file:`fs/write_text_file`,session_request_permission:`session/request_permission`,session_update:`session/update`,terminal_create:`terminal/create`,terminal_kill:`terminal/kill`,terminal_output:`terminal/output`,terminal_release:`terminal/release`,terminal_wait_for_exit:`terminal/wait_for_exit`},Le=S({_meta:m(p(),g()).nullish(),terminal:y().optional().default(!1)}),Re=S({_meta:m(p(),g()).nullish(),label:p().nullish(),name:p(),optional:y().optional().default(!1),secret:y().optional().default(!0)}),ze=S({_meta:m(p(),g()).nullish(),description:p().nullish(),id:p(),name:p()}),Be=S({_meta:m(p(),g()).nullish(),description:p().nullish(),id:p(),link:p().nullish(),name:p(),vars:h(Re)}),Ve=S({_meta:m(p(),g()).nullish(),args:h(p()).optional(),description:p().nullish(),env:m(p(),p()).optional(),id:p(),name:p()}),He=_([Be.and(S({type:x(`env_var`)})),Ve.and(S({type:x(`terminal`)})),ze]),Ue=S({_meta:m(p(),g()).nullish(),methodId:p()}),We=S({_meta:m(p(),g()).nullish()}),Ge=S({_meta:m(p(),g()).nullish(),blob:p(),mimeType:p().nullish(),uri:p()}),Ke=S({default:y().nullish(),description:p().nullish(),title:p().nullish()}),qe=S({_meta:m(p(),g()).nullish()}),Je=S({_meta:m(p(),g()).nullish()}),Ye=S({amount:f(),currency:p()}),Xe=S({_meta:m(p(),g()).nullish(),terminalId:p()}),Ze=S({_meta:m(p(),g()).nullish(),newText:p(),oldText:p().nullish(),path:p()}),Qe=_([p(),f(),f(),y(),h(p())]),$e=b(_([S({content:m(p(),Qe).nullish()}).and(S({action:x(`accept`)})),S({action:x(`decline`)}),S({action:x(`cancel`)})]),S({_meta:m(p(),g()).nullish()})),et=S({_meta:m(p(),g()).nullish()}),tt=p(),nt=S({_meta:m(p(),g()).nullish(),elicitationId:tt}),rt=x(`object`),it=x(`string`),at=S({_meta:m(p(),g()).nullish()}),ot=S({_meta:m(p(),g()).nullish(),form:et.nullish(),url:at.nullish()}),st=S({const:p(),title:p()}),ct=S({_meta:m(p(),g()).nullish(),name:p(),value:p()}),lt=S({code:_([x(-32700),x(-32600),x(-32601),x(-32602),x(-32603),x(-32800),x(-32e3),x(-32002),x(-32042),f().int().min(-2147483648,{message:`Invalid value: Expected int32 to be >= -2147483648`}).max(2147483647,{message:`Invalid value: Expected int32 to be <= 2147483647`})]),data:g().optional(),message:p()}),ut=g(),dt=g(),ft=g(),pt=S({_meta:m(p(),g()).nullish(),readTextFile:y().optional().default(!1),writeTextFile:y().optional().default(!1)}),mt=S({_meta:m(p(),g()).nullish(),name:p(),value:p()}),ht=S({_meta:m(p(),g()).nullish(),name:p(),title:p().nullish(),version:p()}),gt=S({default:f().nullish(),description:p().nullish(),maximum:f().nullish(),minimum:f().nullish(),title:p().nullish()}),_t=S({_meta:m(p(),g()).nullish()}),vt=S({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cursor:p().nullish(),cwd:p().nullish()}),yt=S({_meta:m(p(),g()).nullish()}),bt=S({_meta:m(p(),g()).nullish(),logout:yt.nullish()}),xt=S({_meta:m(p(),g()).nullish()}),St=S({_meta:m(p(),g()).nullish()}),Ct=S({_meta:m(p(),g()).nullish(),http:y().optional().default(!1),sse:y().optional().default(!1)}),wt=S({_meta:m(p(),g()).nullish(),headers:h(mt),name:p(),url:p()}),Tt=S({_meta:m(p(),g()).nullish(),headers:h(mt),name:p(),url:p()}),Et=S({_meta:m(p(),g()).nullish(),args:h(p()),command:p(),env:h(ct),name:p()}),D=_([wt.and(S({type:x(`http`)})),Tt.and(S({type:x(`sse`)})),Et]),Dt=p(),Ot=S({_meta:m(p(),g()).nullish(),description:p().nullish(),modelId:Dt,name:p()}),kt=_([x(`error`),x(`warning`),x(`information`),x(`hint`)]),At=S({_meta:m(p(),g()).nullish()}),jt=S({_meta:m(p(),g()).nullish()}),Mt=S({_meta:m(p(),g()).nullish()}),Nt=S({_meta:m(p(),g()).nullish()}),Pt=S({_meta:m(p(),g()).nullish()}),Ft=S({_meta:m(p(),g()).nullish(),maxCount:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish()}),It=S({diff:p(),uri:p()}),Lt=S({endLine:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}),startLine:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}),text:p()}),Rt=S({_meta:m(p(),g()).nullish()}),zt=S({_meta:m(p(),g()).nullish()}),Bt=S({languageId:p(),text:p(),uri:p()}),Vt=S({_meta:m(p(),g()).nullish(),maxCount:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish()}),Ht=_([x(`rejected`),x(`ignored`),x(`replaced`),x(`cancelled`)]),Ut=S({excerpts:h(Lt),uri:p()}),Wt=S({_meta:m(p(),g()).nullish()}),Gt=S({_meta:m(p(),g()).nullish()}),Kt=S({name:p(),owner:p(),remoteUrl:p()}),qt=S({_meta:m(p(),g()).nullish()}),Jt=S({_meta:m(p(),g()).nullish(),jump:Rt.nullish(),rename:Gt.nullish(),searchAndReplace:qt.nullish()}),Yt=S({id:p(),isRegex:y().nullish(),replace:p(),search:p(),uri:p()}),Xt=_([x(`automatic`),x(`diagnostic`),x(`manual`)]),Zt=S({_meta:m(p(),g()).nullish(),maxCount:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish()}),Qt=S({_meta:m(p(),g()).nullish(),diagnostics:At.nullish(),editHistory:Ft.nullish(),openFiles:zt.nullish(),recentFiles:Vt.nullish(),relatedSnippets:Wt.nullish(),userActions:Zt.nullish()}),$t=S({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cwd:p(),mcpServers:h(D)}),en=S({default:f().nullish(),description:p().nullish(),maximum:f().nullish(),minimum:f().nullish(),title:p().nullish()}),tn=p(),nn=_([x(`allow_once`),x(`allow_always`),x(`reject_once`),x(`reject_always`)]),rn=S({_meta:m(p(),g()).nullish(),kind:nn,name:p(),optionId:tn}),an=_([x(`high`),x(`medium`),x(`low`)]),on=_([x(`pending`),x(`in_progress`),x(`completed`)]),sn=S({_meta:m(p(),g()).nullish(),content:p(),priority:an,status:on}),cn=S({_meta:m(p(),g()).nullish(),entries:h(sn)}),O=S({character:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}),line:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`})}),ln=S({id:p(),position:O,uri:p()}),un=S({id:p(),newName:p(),position:O,uri:p()}),dn=S({action:p(),position:O,timestampMs:f(),uri:p()}),fn=_([x(`utf-16`),x(`utf-32`),x(`utf-8`)]),pn=S({_meta:m(p(),g()).nullish(),auth:Le.optional().default({terminal:!1}),elicitation:ot.nullish(),fs:pt.optional().default({readTextFile:!1,writeTextFile:!1}),nes:Jt.nullish(),positionEncodings:h(fn).optional(),terminal:y().optional().default(!1)}),mn=S({_meta:m(p(),g()).nullish(),audio:y().optional().default(!1),embeddedContext:y().optional().default(!1),image:y().optional().default(!1)}),hn=f().int().gte(0).lte(65535),gn=S({_meta:m(p(),g()).nullish(),clientCapabilities:pn.optional().default({auth:{terminal:!1},fs:{readTextFile:!1,writeTextFile:!1},terminal:!1}),clientInfo:ht.nullish(),protocolVersion:hn}),k=S({end:O,start:O}),_n=S({message:p(),range:k,severity:kt,uri:p()}),vn=S({languageId:p(),lastFocusedMs:f().nullish(),uri:p(),visibleRange:k.nullish()}),yn=S({_meta:m(p(),g()).nullish(),diagnostics:h(_n).nullish(),editHistory:h(It).nullish(),openFiles:h(vn).nullish(),recentFiles:h(Bt).nullish(),relatedSnippets:h(Ut).nullish(),userActions:h(dn).nullish()}),bn=S({newText:p(),range:k}),xn=_([S({cursorPosition:O.nullish(),edits:h(bn),id:p(),uri:p()}).and(S({kind:x(`edit`)})),ln.and(S({kind:x(`jump`)})),un.and(S({kind:x(`rename`)})),Yt.and(S({kind:x(`searchAndReplace`)}))]),Sn=S({_meta:m(p(),g()).nullish(),content:p()}),Cn=S({_meta:m(p(),g()).nullish()}),A=_([f(),p()]).nullable();S({_meta:m(p(),g()).nullish(),requestId:A});var wn=S({requestId:A}),Tn=ee([`assistant`,`user`]),j=S({_meta:m(p(),g()).nullish(),audience:h(Tn).nullish(),lastModified:p().nullish(),priority:f().nullish()}),En=S({_meta:m(p(),g()).nullish(),annotations:j.nullish(),data:p(),mimeType:p()}),Dn=S({_meta:m(p(),g()).nullish(),annotations:j.nullish(),data:p(),mimeType:p(),uri:p().nullish()}),On=S({_meta:m(p(),g()).nullish(),annotations:j.nullish(),description:p().nullish(),mimeType:p().nullish(),name:p(),size:f().nullish(),title:p().nullish(),uri:p()}),kn=S({_meta:m(p(),g()).nullish(),optionId:tn}),An=_([S({outcome:x(`cancelled`)}),kn.and(S({outcome:x(`selected`)}))]),jn=S({_meta:m(p(),g()).nullish(),outcome:An}),Mn=S({_meta:m(p(),g()).nullish()}),Nn=S({_meta:m(p(),g()).nullish()}),Pn=S({currentValue:y()}),Fn=p(),In=p(),Ln=_([x(`mode`),x(`model`),x(`thought_level`),p()]),M=p(),Rn=S({_meta:m(p(),g()).nullish(),description:p().nullish(),name:p(),value:M}),zn=S({_meta:m(p(),g()).nullish(),group:Fn,name:p(),options:h(Rn)}),N=b(_([S({currentValue:M,options:_([h(Rn),h(zn)])}).and(S({type:x(`select`)})),Pn.and(S({type:x(`boolean`)}))]),S({_meta:m(p(),g()).nullish(),category:Ln.nullish(),description:p().nullish(),id:In,name:p()})),Bn=S({_meta:m(p(),g()).nullish(),configOptions:h(N)}),Vn=S({_meta:m(p(),g()).nullish()}),P=p(),Hn=S({_meta:m(p(),g()).nullish(),id:p(),sessionId:P}),Un=S({_meta:m(p(),g()).nullish(),sessionId:P}),Wn=S({_meta:m(p(),g()).nullish(),sessionId:P}),Gn=S({_meta:m(p(),g()).nullish(),sessionId:P}),Kn=S({_meta:m(p(),g()).nullish(),args:h(p()).optional(),command:p(),cwd:p().nullish(),env:h(ct).optional(),outputByteLimit:f().nullish(),sessionId:P}),qn=S({_meta:m(p(),g()).nullish(),sessionId:P,uri:p()}),Jn=S({_meta:m(p(),g()).nullish(),position:O,sessionId:P,uri:p(),version:f(),visibleRange:k}),Yn=S({_meta:m(p(),g()).nullish(),languageId:p(),sessionId:P,text:p(),uri:p(),version:f()}),Xn=S({_meta:m(p(),g()).nullish(),sessionId:P,uri:p()}),Zn=S({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cwd:p(),mcpServers:h(D).optional(),sessionId:P}),Qn=S({_meta:m(p(),g()).nullish(),sessionId:P,terminalId:p()}),$n=S({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cwd:p(),mcpServers:h(D),sessionId:P}),er=S({_meta:m(p(),g()).nullish(),limit:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),line:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),path:p(),sessionId:P}),tr=S({_meta:m(p(),g()).nullish(),id:p(),reason:Ht.nullish(),sessionId:P}),nr=S({_meta:m(p(),g()).nullish(),sessionId:P,terminalId:p()}),rr=S({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cwd:p(),mcpServers:h(D).optional(),sessionId:P}),ir=S({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cwd:p(),sessionId:P,title:p().nullish(),updatedAt:p().nullish()}),ar=S({_meta:m(p(),g()).nullish(),nextCursor:p().nullish(),sessions:h(ir)}),or=S({_meta:m(p(),g()).nullish(),title:p().nullish(),updatedAt:p().nullish()}),sr=S({_meta:m(p(),g()).nullish()}),F=p(),cr=S({_meta:m(p(),g()).nullish(),currentModeId:F}),lr=S({_meta:m(p(),g()).nullish(),description:p().nullish(),id:F,name:p()}),I=S({_meta:m(p(),g()).nullish(),availableModes:h(lr),currentModeId:F}),L=S({_meta:m(p(),g()).nullish(),availableModels:h(Ot),currentModelId:Dt}),ur=S({_meta:m(p(),g()).nullish(),configOptions:h(N).nullish(),models:L.nullish(),modes:I.nullish(),sessionId:P}),dr=S({_meta:m(p(),g()).nullish(),configOptions:h(N).nullish(),models:L.nullish(),modes:I.nullish()}),fr=S({_meta:m(p(),g()).nullish(),configOptions:h(N).nullish(),models:L.nullish(),modes:I.nullish(),sessionId:P}),pr=S({_meta:m(p(),g()).nullish(),configOptions:h(N).nullish(),models:L.nullish(),modes:I.nullish()}),mr=S({_meta:m(p(),g()).nullish()}),hr=S({_meta:m(p(),g()).nullish(),additionalDirectories:Mn.nullish(),close:Nn.nullish(),fork:Vn.nullish(),list:sr.nullish(),resume:mr.nullish()}),gr=b(_([S({type:x(`boolean`),value:y()}),S({value:M})]),S({_meta:m(p(),g()).nullish(),configId:In,sessionId:P})),_r=S({_meta:m(p(),g()).nullish(),configOptions:h(N)}),vr=S({_meta:m(p(),g()).nullish(),modeId:F,sessionId:P}),yr=S({_meta:m(p(),g()).nullish()}),br=S({_meta:m(p(),g()).nullish(),modelId:Dt,sessionId:P}),xr=S({_meta:m(p(),g()).nullish()}),Sr=S({_meta:m(p(),g()).nullish(),sessionId:P}),Cr=_([x(`end_turn`),x(`max_tokens`),x(`max_turn_requests`),x(`refusal`),x(`cancelled`)]),wr=_([x(`email`),x(`uri`),x(`date`),x(`date-time`)]),Tr=S({default:p().nullish(),description:p().nullish(),enum:h(p()).nullish(),format:wr.nullish(),maxLength:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),minLength:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),oneOf:h(st).nullish(),pattern:p().nullish(),title:p().nullish()}),Er=S({_meta:m(p(),g()).nullish(),context:yn.nullish(),position:O,selection:k.nullish(),sessionId:P,triggerKind:Xt,uri:p(),version:f()}),Dr=S({_meta:m(p(),g()).nullish(),suggestions:h(xn)}),Or=S({_meta:m(p(),g()).nullish(),terminalId:p()}),kr=S({_meta:m(p(),g()).nullish(),exitCode:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),signal:p().nullish()}),Ar=S({_meta:m(p(),g()).nullish(),sessionId:P,terminalId:p()}),jr=S({_meta:m(p(),g()).nullish(),exitStatus:kr.nullish(),output:p(),truncated:y()}),Mr=S({_meta:m(p(),g()).nullish(),annotations:j.nullish(),text:p()}),Nr=S({range:k.nullish(),text:p()}),Pr=S({_meta:m(p(),g()).nullish(),contentChanges:h(Nr),sessionId:P,uri:p(),version:f()});S({method:p(),params:_([Un,Yn,Pr,qn,Xn,Jn,Hn,tr,ut]).nullish()});var Fr=_([x(`full`),x(`incremental`)]),Ir=S({_meta:m(p(),g()).nullish(),syncKind:Fr}),Lr=S({_meta:m(p(),g()).nullish(),didChange:Ir.nullish(),didClose:jt.nullish(),didFocus:Mt.nullish(),didOpen:Nt.nullish(),didSave:Pt.nullish()}),Rr=S({_meta:m(p(),g()).nullish(),document:Lr.nullish()}),zr=S({_meta:m(p(),g()).nullish(),context:Qt.nullish(),events:Rr.nullish()}),Br=S({_meta:m(p(),g()).nullish(),auth:bt.optional().default({}),loadSession:y().optional().default(!1),mcpCapabilities:Ct.optional().default({http:!1,sse:!1}),nes:zr.nullish(),positionEncoding:fn.nullish(),promptCapabilities:mn.optional().default({audio:!1,embeddedContext:!1,image:!1}),sessionCapabilities:hr.optional().default({})}),Vr=S({_meta:m(p(),g()).nullish(),agentCapabilities:Br.optional().default({auth:{},loadSession:!1,mcpCapabilities:{http:!1,sse:!1},promptCapabilities:{audio:!1,embeddedContext:!1,image:!1},sessionCapabilities:{}}),agentInfo:ht.nullish(),authMethods:h(He).optional().default([]),protocolVersion:hn}),Hr=_([S({_meta:m(p(),g()).nullish(),mimeType:p().nullish(),text:p(),uri:p()}),Ge]),Ur=S({_meta:m(p(),g()).nullish(),annotations:j.nullish(),resource:Hr}),R=_([Mr.and(S({type:x(`text`)})),Dn.and(S({type:x(`image`)})),En.and(S({type:x(`audio`)})),On.and(S({type:x(`resource_link`)})),Ur.and(S({type:x(`resource`)}))]),Wr=S({_meta:m(p(),g()).nullish(),content:R}),z=S({_meta:m(p(),g()).nullish(),content:R,messageId:p().nullish()}),Gr=S({_meta:m(p(),g()).nullish(),messageId:p().nullish(),prompt:h(R),sessionId:P}),Kr=S({anyOf:h(st)}),qr=_([Wr.and(S({type:x(`content`)})),Ze.and(S({type:x(`diff`)})),Or.and(S({type:x(`terminal`)}))]),B=p(),Jr=S({sessionId:P,toolCallId:B.nullish()}),Yr=b(_([Jr,wn]),S({elicitationId:tt,url:p().url()})),Xr=S({_meta:m(p(),g()).nullish(),line:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),path:p()}),Zr=_([x(`pending`),x(`in_progress`),x(`completed`),x(`failed`)]),Qr=_([x(`read`),x(`edit`),x(`delete`),x(`move`),x(`search`),x(`execute`),x(`think`),x(`fetch`),x(`switch_mode`),x(`other`)]),$r=S({_meta:m(p(),g()).nullish(),content:h(qr).optional(),kind:Qr.optional(),locations:h(Xr).optional(),rawInput:g().optional(),rawOutput:g().optional(),status:Zr.optional(),title:p(),toolCallId:B}),ei=S({_meta:m(p(),g()).nullish(),content:h(qr).nullish(),kind:Qr.nullish(),locations:h(Xr).nullish(),rawInput:g().optional(),rawOutput:g().optional(),status:Zr.nullish(),title:p().nullish(),toolCallId:B}),ti=S({_meta:m(p(),g()).nullish(),options:h(rn),sessionId:P,toolCall:ei}),ni=S({_meta:m(p(),g()).nullish(),hint:p()}),ri=S({_meta:m(p(),g()).nullish(),description:p(),input:ni.nullish(),name:p()}),ii=S({_meta:m(p(),g()).nullish(),availableCommands:h(ri)}),ai=_([S({enum:h(p()),type:it}),Kr]),oi=S({default:h(p()).nullish(),description:p().nullish(),items:ai,maxItems:f().nullish(),minItems:f().nullish(),title:p().nullish()}),si=_([Tr.and(S({type:x(`string`)})),en.and(S({type:x(`number`)})),gt.and(S({type:x(`integer`)})),Ke.and(S({type:x(`boolean`)})),oi.and(S({type:x(`array`)}))]),ci=S({description:p().nullish(),properties:m(p(),si).optional().default({}),required:h(p()).nullish(),title:p().nullish(),type:rt.optional().default(`object`)}),li=b(_([b(_([Jr,wn]),S({requestedSchema:ci})).and(S({mode:x(`form`)})),Yr.and(S({mode:x(`url`)}))]),S({_meta:m(p(),g()).nullish(),message:p()})),ui=S({cachedReadTokens:f().nullish(),cachedWriteTokens:f().nullish(),inputTokens:f(),outputTokens:f(),thoughtTokens:f().nullish(),totalTokens:f()});_([S({id:A,result:_([Vr,We,St,fr,dr,ar,ur,pr,Je,yr,_r,S({_meta:m(p(),g()).nullish(),stopReason:Cr,usage:ui.nullish(),userMessageId:p().nullish()}),xr,Sr,Dr,qe,ft])}),S({error:lt,id:A})]);var di=S({_meta:m(p(),g()).nullish(),cost:Ye.nullish(),size:f(),used:f()}),fi=_([z.and(S({sessionUpdate:x(`user_message_chunk`)})),z.and(S({sessionUpdate:x(`agent_message_chunk`)})),z.and(S({sessionUpdate:x(`agent_thought_chunk`)})),$r.and(S({sessionUpdate:x(`tool_call`)})),ei.and(S({sessionUpdate:x(`tool_call_update`)})),cn.and(S({sessionUpdate:x(`plan`)})),ii.and(S({sessionUpdate:x(`available_commands_update`)})),cr.and(S({sessionUpdate:x(`current_mode_update`)})),Bn.and(S({sessionUpdate:x(`config_option_update`)})),or.and(S({sessionUpdate:x(`session_info_update`)})),di.and(S({sessionUpdate:x(`usage_update`)}))]),pi=S({_meta:m(p(),g()).nullish(),sessionId:P,update:fi});S({method:p(),params:_([pi,nt,ut]).nullish()});var mi=S({_meta:m(p(),g()).nullish(),sessionId:P,terminalId:p()}),hi=S({_meta:m(p(),g()).nullish(),exitCode:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),signal:p().nullish()}),gi=S({name:p(),uri:p()}),_i=S({_meta:m(p(),g()).nullish(),repository:Kt.nullish(),workspaceFolders:h(gi).nullish(),workspaceUri:p().nullish()});S({id:A,method:p(),params:_([gn,Ue,xt,$t,$n,vt,Zn,rr,Gn,vr,gr,Gr,br,_i,Er,Wn,dt]).nullish()});var vi=S({_meta:m(p(),g()).nullish(),content:p(),path:p(),sessionId:P});S({id:A,method:p(),params:_([vi,er,ti,Kn,Ar,nr,mi,Qn,li,dt]).nullish()}),_([S({id:A,result:_([S({_meta:m(p(),g()).nullish()}),Sn,jn,Xe,jr,Cn,hi,_t,$e,ft])}),S({error:lt,id:A})]),e(),d(),r(),s(),i(),o();function yi(e,t){let n=new TextEncoder,r=new TextDecoder;return{readable:new ReadableStream({async start(e){let n=``,i=t.getReader();try{for(;;){let{value:t,done:a}=await i.read();if(a)break;if(!t)continue;n+=r.decode(t,{stream:!0});let o=n.split(`
2
- `);n=o.pop()||``;for(let t of o){let n=t.trim();if(n)try{let t=JSON.parse(n);e.enqueue(t)}catch(e){console.error(`Failed to parse JSON message:`,n,e)}}}}catch(t){e.error(t);return}finally{i.releaseLock()}e.close()}}),writable:new WritableStream({async write(t){let r=JSON.stringify(t)+`
3
- `,i=e.getWriter();try{await i.write(n.encode(r))}finally{i.releaseLock()}}})}}te();var bi,V=new WeakMap,xi=class{constructor(e,t){l(this,V,void 0);let n=e(this);u(V,this,new Ei(async(e,t)=>{switch(e){case T.initialize:{let e=gn.parse(t);return n.initialize(e)}case T.session_new:{let e=$t.parse(t);return n.newSession(e)}case T.session_load:{if(!n.loadSession)throw Z.methodNotFound(e);let r=$n.parse(t);return n.loadSession(r)}case T.session_list:{if(!n.listSessions)throw Z.methodNotFound(e);let r=vt.parse(t);return n.listSessions(r)}case T.session_fork:{if(!n.unstable_forkSession)throw Z.methodNotFound(e);let r=Zn.parse(t);return n.unstable_forkSession(r)}case T.session_resume:{if(!n.unstable_resumeSession)throw Z.methodNotFound(e);let r=rr.parse(t);return n.unstable_resumeSession(r)}case T.session_close:{if(!n.unstable_closeSession)throw Z.methodNotFound(e);let r=Gn.parse(t);return n.unstable_closeSession(r)}case T.session_set_mode:{if(!n.setSessionMode)throw Z.methodNotFound(e);let r=vr.parse(t);return await n.setSessionMode(r)??{}}case T.authenticate:{let e=Ue.parse(t);return await n.authenticate(e)??{}}case T.logout:{if(!n.unstable_logout)throw Z.methodNotFound(e);let r=xt.parse(t);return await n.unstable_logout(r)??{}}case T.session_prompt:{let e=Gr.parse(t);return n.prompt(e)}case T.session_set_model:{if(!n.unstable_setSessionModel)throw Z.methodNotFound(e);let r=br.parse(t);return await n.unstable_setSessionModel(r)??{}}case T.session_set_config_option:{if(!n.setSessionConfigOption)throw Z.methodNotFound(e);let r=gr.parse(t);return n.setSessionConfigOption(r)}case T.nes_start:{if(!n.unstable_startNes)throw Z.methodNotFound(e);let r=_i.parse(t);return n.unstable_startNes(r)}case T.nes_suggest:{if(!n.unstable_suggestNes)throw Z.methodNotFound(e);let r=Er.parse(t);return n.unstable_suggestNes(r)}case T.nes_close:{if(!n.unstable_closeNes)throw Z.methodNotFound(e);let r=Wn.parse(t);return await n.unstable_closeNes(r)??{}}default:if(n.extMethod)return n.extMethod(e,t);throw Z.methodNotFound(e)}},async(e,t)=>{switch(e){case T.session_cancel:{let e=Un.parse(t);return n.cancel(e)}case T.document_did_open:{if(!n.unstable_didOpenDocument)return;let e=Yn.parse(t);return n.unstable_didOpenDocument(e)}case T.document_did_change:{if(!n.unstable_didChangeDocument)return;let e=Pr.parse(t);return n.unstable_didChangeDocument(e)}case T.document_did_close:{if(!n.unstable_didCloseDocument)return;let e=qn.parse(t);return n.unstable_didCloseDocument(e)}case T.document_did_save:{if(!n.unstable_didSaveDocument)return;let e=Xn.parse(t);return n.unstable_didSaveDocument(e)}case T.document_did_focus:{if(!n.unstable_didFocusDocument)return;let e=Jn.parse(t);return n.unstable_didFocusDocument(e)}case T.nes_accept:{if(!n.unstable_acceptNes)return;let e=Hn.parse(t);return n.unstable_acceptNes(e)}case T.nes_reject:{if(!n.unstable_rejectNes)return;let e=tr.parse(t);return n.unstable_rejectNes(e)}default:if(n.extNotification)return n.extNotification(e,t);throw Z.methodNotFound(e)}},t))}async sessionUpdate(e){return await c(V,this).sendNotification(E.session_update,e)}async requestPermission(e){return await c(V,this).sendRequest(E.session_request_permission,e)}async readTextFile(e){return await c(V,this).sendRequest(E.fs_read_text_file,e)}async writeTextFile(e){return await c(V,this).sendRequest(E.fs_write_text_file,e)??{}}async createTerminal(e){return new Si((await c(V,this).sendRequest(E.terminal_create,e)).terminalId,e.sessionId,c(V,this))}async unstable_createElicitation(e){return await c(V,this).sendRequest(E.elicitation_create,e)}async unstable_completeElicitation(e){return await c(V,this).sendNotification(E.elicitation_complete,e)}async extMethod(e,t){return await c(V,this).sendRequest(e,t)}async extNotification(e,t){return await c(V,this).sendNotification(e,t)}get signal(){return c(V,this).signal}get closed(){return c(V,this).closed}},H=new WeakMap,U=new WeakMap;bi=Symbol.asyncDispose;var Si=class{constructor(e,n,r){t(this,`id`,void 0),l(this,H,void 0),l(this,U,void 0),this.id=e,u(H,this,n),u(U,this,r)}async currentOutput(){return await c(U,this).sendRequest(E.terminal_output,{sessionId:c(H,this),terminalId:this.id})}async waitForExit(){return await c(U,this).sendRequest(E.terminal_wait_for_exit,{sessionId:c(H,this),terminalId:this.id})}async kill(){return await c(U,this).sendRequest(E.terminal_kill,{sessionId:c(H,this),terminalId:this.id})??{}}async release(){return await c(U,this).sendRequest(E.terminal_release,{sessionId:c(H,this),terminalId:this.id})??{}}async[bi](){await this.release()}},W=new WeakMap,G=new WeakMap,Ci=new WeakMap,wi=new WeakMap,K=new WeakMap,q=new WeakMap,J=new WeakMap,Ti=new WeakMap,Y=new WeakSet,Ei=class{constructor(e,t,r){a(this,Y),l(this,W,new Map),l(this,G,0),l(this,Ci,void 0),l(this,wi,void 0),l(this,K,void 0),l(this,q,Promise.resolve()),l(this,J,new AbortController),l(this,Ti,void 0),u(Ci,this,e),u(wi,this,t),u(K,this,r),u(Ti,this,new Promise(e=>{c(J,this).signal.addEventListener(`abort`,()=>e())})),n(Y,this,Di).call(this)}get signal(){return c(J,this).signal}get closed(){return c(Ti,this)}async sendRequest(e,t){var r,i;n(Y,this,Ni).call(this);let a=(u(G,this,(r=c(G,this),i=r++,r)),i),o=new Promise((e,t)=>{c(W,this).set(a,{resolve:e,reject:t})});return await n(Y,this,X).call(this,{jsonrpc:`2.0`,id:a,method:e,params:t}),o}async sendNotification(e,t){n(Y,this,Ni).call(this),await n(Y,this,X).call(this,{jsonrpc:`2.0`,method:e,params:t})}};async function Di(){let e;try{let e=c(K,this).readable.getReader();try{for(;!c(J,this).signal.aborted;){let{value:t,done:r}=await e.read();if(r)break;if(t)try{n(Y,this,ki).call(this,t)}catch(e){console.error(`Unexpected error during message processing:`,t,e),`id`in t&&t.id!==void 0&&n(Y,this,X).call(this,{jsonrpc:`2.0`,id:t.id,error:{code:-32700,message:`Parse error`}})}}}finally{e.releaseLock()}}catch(t){e=t}finally{n(Y,this,Oi).call(this,e)}}function Oi(e){if(c(J,this).signal.aborted)return;let t=e??Error(`ACP connection closed`);for(let e of c(W,this).values())e.reject(t);c(W,this).clear(),c(J,this).abort(t)}async function ki(e){if(`method`in e&&`id`in e){let t=await n(Y,this,Ai).call(this,e.method,e.params);`error`in t&&console.error(`Error handling request`,e,t.error),await n(Y,this,X).call(this,{jsonrpc:`2.0`,id:e.id,...t})}else if(`method`in e){let t=await n(Y,this,ji).call(this,e.method,e.params);`error`in t&&console.error(`Error handling notification`,e,t.error)}else `id`in e?n(Y,this,Mi).call(this,e):console.error(`Invalid message`,{message:e})}async function Ai(e,t){try{return{result:await c(Ci,this).call(this,e,t)??null}}catch(e){if(e instanceof Z)return e.toResult();if(e instanceof v)return Z.invalidParams(e.format()).toResult();let t;(e instanceof Error||typeof e==`object`&&e&&`message`in e&&typeof e.message==`string`)&&(t=e.message);try{return Z.internalError(t?JSON.parse(t):{}).toResult()}catch{return Z.internalError({details:t}).toResult()}}}async function ji(e,t){try{return await c(wi,this).call(this,e,t),{result:null}}catch(e){if(e instanceof Z)return e.toResult();if(e instanceof v)return Z.invalidParams(e.format()).toResult();let t;(e instanceof Error||typeof e==`object`&&e&&`message`in e&&typeof e.message==`string`)&&(t=e.message);try{return Z.internalError(t?JSON.parse(t):{}).toResult()}catch{return Z.internalError({details:t}).toResult()}}}function Mi(e){let t=c(W,this).get(e.id);if(t){if(`result`in e)t.resolve(e.result);else if(`error`in e){let{code:n,message:r,data:i}=e.error;t.reject(new Z(n,r,i))}c(W,this).delete(e.id)}else console.error(`Got response to unknown request`,e.id)}function Ni(){if(c(J,this).signal.aborted)throw c(J,this).signal.reason??Error(`ACP connection closed`)}async function X(e){return u(q,this,c(q,this).then(async()=>{let t=c(K,this).writable.getWriter();try{await t.write(e)}finally{t.releaseLock()}}).catch(e=>{n(Y,this,Oi).call(this,e)})),c(q,this)}var Z=class e extends Error{constructor(e,n,r){super(n),t(this,`code`,void 0),t(this,`data`,void 0),this.code=e,this.name=`RequestError`,this.data=r}static parseError(t,n){return new e(-32700,`Parse error${n?`: ${n}`:``}`,t)}static invalidRequest(t,n){return new e(-32600,`Invalid request${n?`: ${n}`:``}`,t)}static methodNotFound(t){return new e(-32601,`"Method not found": ${t}`,{method:t})}static invalidParams(t,n){return new e(-32602,`Invalid params${n?`: ${n}`:``}`,t)}static internalError(t,n){return new e(-32603,`Internal error${n?`: ${n}`:``}`,t)}static authRequired(t,n){return new e(-32e3,`Authentication required${n?`: ${n}`:``}`,t)}static resourceNotFound(t){return new e(-32002,`Resource not found${t?`: ${t}`:``}`,t&&{uri:t})}toResult(){return{error:{code:this.code,message:this.message,data:this.data}}}toErrorResponse(){return{code:this.code,message:this.message,data:this.data}}};ne(),ie(),le(),Ae(),je(),be(),De(),Te(),ye(),ue(),ge();var Pi=!(typeof process.geteuid==`function`?process.geteuid()===0:typeof process.getuid==`function`&&process.getuid()===0)||!!process.env.IS_SANDBOX,Fi={auto:`auto`,default:`default`,acceptedits:`acceptEdits`,dontask:`dontAsk`,plan:`plan`,bypasspermissions:`bypassPermissions`,bypass:`bypassPermissions`};function Ii(e,t=`permissions.defaultMode`){if(e===void 0)return`default`;if(typeof e!=`string`)throw Error(`Invalid ${t}: expected a string.`);let n=e.trim().toLowerCase();if(n===``)throw Error(`Invalid ${t}: expected a non-empty string.`);let r=Fi[n];if(!r)throw Error(`Invalid ${t}: ${e}.`);if(r===`bypassPermissions`&&!Pi)throw Error(`Invalid ${t}: bypassPermissions is not available when running as root.`);return r}function Li(e){let t=[...e.mcpServers??[]].sort((e,t)=>e.name.localeCompare(t.name));return JSON.stringify({cwd:e.cwd,mcpServers:t})}var Ri=256;function zi(e){let t=e.replace(/[\r\n]+/g,` `).replace(/\s+/g,` `).trim();return t.length<=Ri?t:t.slice(0,Ri-1)+`…`}function Bi(e,t){if(!t)return e;let n=w.resolve(t),r=w.resolve(e);return r.startsWith(n+w.sep)||r===n?w.relative(n,r).replaceAll(`\\`,`/`):e}function Vi(e){let t="```";for(let n of e.matchAll(/^```+/gm)??[])for(;n[0].length>=t.length;)t+="`";return t+`
4
- `+e+(e.endsWith(`
5
- `)?``:`
6
- `)+t}function Q(e,t=!1,n){let r=e.name,i=e.input;switch(r){case`Agent`:case`Task`:{let e=i?.description??`Task`,t=i?.prompt;return{title:e,kind:`think`,content:t?[{type:`content`,content:{type:`text`,text:t}}]:[]}}case`Bash`:{let n=i?.command??`Terminal`,r=i?.description;return{title:n,kind:`execute`,content:t?[{type:`terminal`,terminalId:e.id}]:r?[{type:`content`,content:{type:`text`,text:r}}]:[]}}case`Read`:{let e=i?.file_path??`File`,t=i?.offset,r=i?.limit,a=``;return r&&r>0?a=` (${t??1} - ${(t??1)+r-1})`:t&&(a=` (from line ${t})`),{title:`Read ${e?Bi(e,n):`File`}${a}`,kind:`read`,locations:e?[{path:e,line:t??1}]:[],content:[]}}case`Write`:{let e=i?.file_path??``,t=i?.content??``,r=e?Bi(e,n):void 0;return{title:r?`Write ${r}`:`Write`,kind:`edit`,content:e?[{type:`diff`,path:e,oldText:null,newText:t}]:[{type:`content`,content:{type:`text`,text:t}}],locations:e?[{path:e}]:[]}}case`Edit`:{let e=i?.file_path??``,t=i?.old_string??``,r=i?.new_string??``,a=e?Bi(e,n):void 0;return{title:a?`Edit ${a}`:`Edit`,kind:`edit`,content:e?[{type:`diff`,path:e,oldText:t||null,newText:r}]:[],locations:e?[{path:e}]:[]}}case`Glob`:{let e=i?.path??``,t=i?.pattern??``,n=`Find`;return e&&(n+=` \`${e}\``),t&&(n+=` \`${t}\``),{title:n,kind:`search`,content:[],locations:e?[{path:e}]:[]}}case`Grep`:{let e=i?.pattern??``,t=i?.path??``,n=`grep`;return i?.[`-i`]&&(n+=` -i`),i?.[`-n`]&&(n+=` -n`),i?.[`-A`]!==void 0&&(n+=` -A ${i[`-A`]}`),i?.[`-B`]!==void 0&&(n+=` -B ${i[`-B`]}`),i?.[`-C`]!==void 0&&(n+=` -C ${i[`-C`]}`),i?.output_mode===`files_with_matches`?n+=` -l`:i?.output_mode===`count`&&(n+=` -c`),i?.head_limit!==void 0&&(n+=` | head -${i.head_limit}`),i?.glob&&(n+=` --include="${i.glob}"`),i?.type&&(n+=` --type=${i.type}`),i?.multiline&&(n+=` -P`),e&&(n+=` "${e}"`),t&&(n+=` ${t}`),{title:n,kind:`search`,content:[]}}case`WebFetch`:{let e=i?.url??``,t=i?.prompt;return{title:e?`Fetch ${e}`:`Fetch`,kind:`fetch`,content:t?[{type:`content`,content:{type:`text`,text:t}}]:[]}}case`WebSearch`:{let e=`"${i?.query??`Web search`}"`,t=i?.allowed_domains,n=i?.blocked_domains;return t&&t.length>0&&(e+=` (allowed: ${t.join(`, `)})`),n&&n.length>0&&(e+=` (blocked: ${n.join(`, `)})`),{title:e,kind:`fetch`,content:[]}}case`TodoWrite`:{let e=i?.todos;return{title:Array.isArray(e)?`Update TODOs: ${e.map(e=>e.content).join(`, `)}`:`Update TODOs`,kind:`think`,content:[]}}case`ExitPlanMode`:{let e=i?.plan;return{title:`Ready to code?`,kind:`switch_mode`,content:e?[{type:`content`,content:{type:`text`,text:e}}]:[]}}default:return{title:r||`Unknown Tool`,kind:`other`,content:[]}}}function Hi(e,t,n=!1){if(!t)return{};let r=e.is_error===!0,i=e.content;if(r&&i)return Ui(i,!0);switch(t.name){case`Read`:return typeof i==`string`&&i.length>0?{content:[{type:`content`,content:{type:`text`,text:Vi(i)}}]}:Array.isArray(i)&&i.length>0?{content:i.map(e=>({type:`content`,content:e.type===`text`?{type:`text`,text:Vi(e.text)}:Wi(e,!1)}))}:{};case`Bash`:{let e=``,a=+!!r,o=String(t.id);if(i&&typeof i==`object`&&!Array.isArray(i)&&i.type===`bash_code_execution_result`){let t=i;e=[t.stdout,t.stderr].filter(Boolean).join(`
7
- `),a=t.return_code??+!!r}else typeof i==`string`?e=i:Array.isArray(i)&&i.length>0&&(e=i.map(e=>e.type===`text`?e.text:``).join(`
8
- `));return n?{content:[{type:`terminal`,terminalId:o}],_meta:{terminal_info:{terminal_id:o},terminal_output:{terminal_id:o,data:e},terminal_exit:{terminal_id:o,exit_code:a,signal:null}}}:e.trim()?{content:[{type:`content`,content:{type:`text`,text:`\`\`\`console\n${e.trimEnd()}\n\`\`\``}}]}:{}}case`Edit`:case`Write`:return{};case`ExitPlanMode`:return{title:`Exited Plan Mode`};default:return Ui(i??``,r)}}function Ui(e,t){return Array.isArray(e)&&e.length>0?{content:e.map(e=>({type:`content`,content:Wi(e,t)}))}:typeof e==`string`&&e.length>0?{content:[{type:`content`,content:{type:`text`,text:t?`\`\`\`\n${e}\n\`\`\``:e}}]}:{}}function Wi(e,t){let n=e=>({type:`text`,text:t?`\`\`\`\n${e}\n\`\`\``:e});switch(e.type){case`text`:{let n=e.text;return{type:`text`,text:t?`\`\`\`\n${n}\n\`\`\``:n}}case`image`:{let t=e.source;return t?.type===`base64`?{type:`image`,data:t.data,mimeType:t.media_type}:n(t?.type===`url`?`[image: ${t.url}]`:`[image: file reference]`)}case`tool_reference`:return n(`Tool: ${e.tool_name}`);case`tool_search_tool_search_result`:{let t=e.tool_references;return n(`Tools found: ${t?.map(e=>e.tool_name).join(`, `)||`none`}`)}case`tool_search_tool_result_error`:return n(`Error: ${e.error_code}${e.error_message?` - ${e.error_message}`:``}`);case`web_search_result`:return n(`${e.title} (${e.url})`);case`web_search_tool_result_error`:return n(`Error: ${e.error_code}`);case`web_fetch_result`:return n(`Fetched: ${e.url}`);case`web_fetch_tool_result_error`:return n(`Error: ${e.error_code}`);case`code_execution_result`:case`bash_code_execution_result`:return n(`Output: ${e.stdout||e.stderr||``}`);case`code_execution_tool_result_error`:case`bash_code_execution_tool_result_error`:return n(`Error: ${e.error_code}`);case`text_editor_code_execution_view_result`:return n(e.content);case`text_editor_code_execution_create_result`:return n(e.is_file_update?`File updated`:`File created`);case`text_editor_code_execution_str_replace_result`:{let t=e.lines;return n(t?.join(`
9
- `)||``)}case`text_editor_code_execution_tool_result_error`:return n(`Error: ${e.error_code}${e.error_message?` - ${e.error_message}`:``}`);default:try{return{type:`text`,text:JSON.stringify(e)}}catch{return{type:`text`,text:`[content]`}}}}function Gi(e,t){if(t.aborted)return Promise.resolve({done:!0,value:void 0});let n,r=new Promise(e=>{n=()=>e({done:!0,value:void 0}),t.addEventListener(`abort`,n,{once:!0})});return Promise.race([e.next(),r]).finally(()=>{n&&t.removeEventListener(`abort`,n)})}async function Ki(e,t,n,r,i,a,o,s){let c=`end_turn`,l={inputTokens:0,outputTokens:0,cachedReadTokens:0,cachedWriteTokens:0},u=null,d=null,f=2e5;try{for(;!r.aborted;){let s=await Gi(t,r);if(s.done||r.aborted)break;let p=s.value;if(p!=null)switch(p.type){case`system`:p.subtype===`compact_boundary`&&(u=0,await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`usage_update`,used:0,size:f}}),await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`agent_message_chunk`,content:{type:`text`,text:`
10
-
11
- Compacting completed.`}}}));break;case`result`:{let t=p.usage;t&&(l.inputTokens+=t.input_tokens,l.outputTokens+=t.output_tokens,l.cachedReadTokens+=t.cache_read_input_tokens,l.cachedWriteTokens+=t.cache_creation_input_tokens);let i=p.modelUsage;if(i&&d){let e=Qi(i,d);e?.contextWindow&&(f=e.contextWindow)}let a=u??l.inputTokens+l.outputTokens+l.cachedReadTokens+l.cachedWriteTokens,o=p.total_cost_usd;await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`usage_update`,used:a,size:f,cost:o==null?void 0:{amount:o,currency:`USD`}}});let s=p.subtype,m=p.is_error;if(r.aborted){c=`cancelled`;break}switch(s){case`success`:p.stop_reason===`max_tokens`&&(c=`max_tokens`),m&&(c=`end_turn`);break;case`error_during_execution`:c=p.stop_reason===`max_tokens`?`max_tokens`:`end_turn`;break;case`error_max_budget_usd`:case`error_max_turns`:case`error_max_structured_output_retries`:c=`max_turn_requests`;break}break}case`stream_event`:{let t=Ji(p,e,i,n,{clientCapabilities:a,cwd:o});for(let e of t)await n.sessionUpdate(e);break}case`assistant`:{let t=p.message,r=p.parent_tool_use_id;if(t?.usage&&r===null){let e=t.usage;u=(e.input_tokens??0)+(e.output_tokens??0)+(e.cache_read_input_tokens??0)+(e.cache_creation_input_tokens??0)}r===null&&t?.model&&t.model!==`<synthetic>`&&(d=t.model);let s=qi(p,e,i,n,{clientCapabilities:a,cwd:o});for(let e of s)await n.sessionUpdate(e);break}case`user`:break;case`progress`:{let t=p.data;if(!t)break;let r=t.type;if(r===`agent_progress`||r===`skill_progress`){let r=t.message;if(r){let t=r.content;if(t)for(let r of t)r.type===`text`&&await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`agent_message_chunk`,content:{type:`text`,text:r.text}}})}}break}case`tool_use_summary`:break;case`attachment`:break;case`compact_boundary`:u=0,await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`usage_update`,used:0,size:f}}),await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`agent_message_chunk`,content:{type:`text`,text:`
12
-
13
- Compacting completed.`}}});break;default:break}}if(r.aborted||s?.())return{stopReason:`cancelled`,usage:l}}catch(e){if(r.aborted)return{stopReason:`cancelled`,usage:l};throw e}return{stopReason:c,usage:l}}function qi(e,t,n,r,i){let a=e.message;if(!a)return[];let o=a.content;return o?typeof o==`string`?[{sessionId:t,update:{sessionUpdate:`agent_message_chunk`,content:{type:`text`,text:o}}}]:$(o,`assistant`,t,n,r,void 0,i):[]}function Ji(e,t,n,r,i){let a=e.event;if(!a)return[];switch(a.type){case`content_block_start`:{let o=a.content_block;return o?$([o],`assistant`,t,n,r,void 0,{clientCapabilities:i?.clientCapabilities,parentToolUseId:e.parent_tool_use_id,cwd:i?.cwd}):[]}case`content_block_delta`:{let o=a.delta;return o?$([o],`assistant`,t,n,r,void 0,{clientCapabilities:i?.clientCapabilities,parentToolUseId:e.parent_tool_use_id,cwd:i?.cwd}):[]}case`message_start`:case`message_delta`:case`message_stop`:case`content_block_stop`:return[];default:return[]}}function $(e,t,n,r,i,a,o){let s=[];for(let i of e){let e=i.type,a=null;switch(e){case`text`:case`text_delta`:{let e=i.text??``;a={sessionUpdate:t===`assistant`?`agent_message_chunk`:`user_message_chunk`,content:{type:`text`,text:e}};break}case`thinking`:case`thinking_delta`:a={sessionUpdate:`agent_thought_chunk`,content:{type:`text`,text:i.thinking??``}};break;case`image`:{let e=i.source;e?.type===`base64`&&(a={sessionUpdate:t===`assistant`?`agent_message_chunk`:`user_message_chunk`,content:{type:`image`,data:e.data,mimeType:e.media_type}});break}case`tool_use`:case`server_tool_use`:case`mcp_tool_use`:{let t=i.id??``,n=i.name??`unknown`,s=i.input,c=t in r;if(r[t]={type:e,id:t,name:n,input:s},n===`TodoWrite`){let e=s?.todos;Array.isArray(e)&&(a={sessionUpdate:`plan`,entries:e.map(e=>({content:e.content,status:Yi(e.status),priority:`medium`}))})}else{let e=s?{...s}:{};a=c?{_meta:{claudeCode:{toolName:n}},toolCallId:t,sessionUpdate:`tool_call_update`,rawInput:e,...Q({name:n,id:t,input:s??{}},!1,o?.cwd)}:{_meta:{claudeCode:{toolName:n}},toolCallId:t,sessionUpdate:`tool_call`,rawInput:e,status:`pending`,...Q({name:n,id:t,input:s??{}},!1,o?.cwd)}}break}case`tool_result`:case`mcp_tool_result`:{let e=i.tool_use_id??``,t=r[e];if(!t)break;if(t.name!==`TodoWrite`){let n=Hi(i,{name:t.name,id:t.id},!1);a={_meta:{claudeCode:{toolName:t.name}},toolCallId:e,sessionUpdate:`tool_call_update`,status:i.is_error===!0?`failed`:`completed`,rawOutput:i.content,...n}}break}case`redacted_thinking`:case`input_json_delta`:case`citations_delta`:case`signature_delta`:case`container_upload`:case`compaction`:case`compaction_delta`:break}if(a){if(o?.parentToolUseId){let e=a._meta;a._meta={...e,claudeCode:{...e?.claudeCode??{},parentToolUseId:o.parentToolUseId}}}s.push({sessionId:n,update:a})}}return s}function Yi(e){return e===`in_progress`?`in_progress`:e===`completed`?`completed`:`pending`}async function Xi(e,t,n,r,i,a){for(let o of t){let t=o.type;if(t!==`user`&&t!==`assistant`||o.isMeta===!0)continue;let s=o.message?.content;if(!s)continue;let c=t===`assistant`?`assistant`:`user`;if(typeof s==`string`){if(!s.trim())continue;await n.sessionUpdate({sessionId:e,update:{sessionUpdate:c===`assistant`?`agent_message_chunk`:`user_message_chunk`,content:{type:`text`,text:s}}});continue}if(Array.isArray(s)){let t=$(s,c,e,r,n,void 0,{clientCapabilities:i,cwd:a});for(let e of t)await n.sessionUpdate(e)}}}function Zi(e,t){let n=0,r=Math.min(e.length,t.length);for(;n<r&&e[n]===t[n];)n++;return n}function Qi(e,t){let n=null,r=0;for(let i of Object.keys(e)){let e=Zi(i,t);e>r&&(r=e,n=i)}return n?e[n]??null:null}function $i(e,t,n,r,i,a,o){return async(n,s,c,l,u,d)=>{let f=ta(r);if(n.name===`ExitPlanMode`)return ea(e,t,u,s,f,i,a,o);if(d!==void 0)return d;try{let e=await pe(n,s,c,l,u);if(e.behavior===`allow`||e.behavior===`deny`)return e}catch(e){return console.error(`[ACP Permissions] Pipeline error:`,e),{behavior:`deny`,message:`Permission pipeline failed`,decisionReason:{type:`other`,reason:`Permission pipeline failed`},toolUseID:u}}let p=Q({name:n.name,id:u,input:s},f,i),m={toolCallId:u,title:p.title,kind:p.kind,status:`pending`,rawInput:s},h=[{kind:`allow_always`,name:`Always Allow`,optionId:`allow_always`},{kind:`allow_once`,name:`Allow`,optionId:`allow`},{kind:`reject_once`,name:`Reject`,optionId:`reject`}];try{let n=await e.requestPermission({sessionId:t,toolCall:m,options:h});if(n.outcome.outcome===`cancelled`)return{behavior:`deny`,message:`Permission request cancelled by client`,decisionReason:{type:`mode`,mode:`default`}};if(n.outcome.outcome===`selected`&&`optionId`in n.outcome&&n.outcome.optionId!==void 0){let e=n.outcome.optionId;if(e===`allow`||e===`allow_always`)return{behavior:`allow`,updatedInput:s}}return{behavior:`deny`,message:`Permission denied by client`,decisionReason:{type:`mode`,mode:`default`}}}catch(e){return console.error(`[ACP Permissions] Client request error:`,e),{behavior:`deny`,message:`Permission request failed`,decisionReason:{type:`mode`,mode:`default`}}}}}async function ea(e,t,n,r,i,a,o,s){let c=[{kind:`allow_always`,name:`Yes, and use "auto" mode`,optionId:`auto`},{kind:`allow_always`,name:`Yes, and auto-accept edits`,optionId:`acceptEdits`},{kind:`allow_once`,name:`Yes, and manually approve edits`,optionId:`default`},{kind:`reject_once`,name:`No, keep planning`,optionId:`plan`}];s?.()===!0&&c.unshift({kind:`allow_always`,name:`Yes, and bypass permissions`,optionId:`bypassPermissions`});let l=Q({name:`ExitPlanMode`,id:n,input:r},i,a),u={toolCallId:n,title:l.title,kind:l.kind,status:`pending`,rawInput:r},d=await e.requestPermission({sessionId:t,toolCall:u,options:c});if(d.outcome.outcome===`cancelled`)return{behavior:`deny`,message:`Tool use aborted`,decisionReason:{type:`mode`,mode:`default`}};if(d.outcome.outcome===`selected`&&`optionId`in d.outcome&&d.outcome.optionId!==void 0){let n=d.outcome.optionId;if(c.some(e=>e.optionId===n)&&(n===`default`||n===`acceptEdits`||n===`auto`||n===`bypassPermissions`))return o?.(n),await e.sessionUpdate({sessionId:t,update:{sessionUpdate:`current_mode_update`,currentModeId:n}}),{behavior:`allow`,updatedInput:r}}return{behavior:`deny`,message:`User rejected request to exit plan mode.`,decisionReason:{type:`mode`,mode:`plan`}}}function ta(e){if(!e)return!1;let t=e._meta;return!t||typeof t!=`object`?!1:t.terminal_output===!0}function na(e){if(!e||e.length===0)return``;let t=[];for(let n of e){let e=n;if(e.type===`text`)t.push(String(e.text??``));else if(e.type===`resource_link`){let n=typeof e.name==`string`?e.name:void 0,r=typeof e.uri==`string`?e.uri:void 0;t.push(ra(n,r))}else if(e.type===`resource`){let n=e.resource;n&&typeof n.text==`string`&&t.push(n.text)}}return t.filter(e=>e.length>0).join(`
14
- `)}function ra(e,t){let n=[];return e&&e.length>0&&n.push(`name=${e}`),t&&t.length>0&&n.push(`uri=${t}`),n.length>0?`Resource link: ${n.join(`, `)}`:`Resource link`}Se(),oe(),Ce(),e();var ia=class{constructor(e){t(this,`conn`,void 0),t(this,`sessions`,new Map),t(this,`clientCapabilities`,void 0),this.conn=e}async initialize(e){return this.clientCapabilities=e.clientCapabilities,{protocolVersion:1,agentInfo:{name:`claude-code`,title:`Claude Code`,version:typeof globalThis.MACRO==`object`&&globalThis.MACRO!==null?String(globalThis.MACRO.VERSION??`0.0.0`):`0.0.0`},agentCapabilities:{_meta:{claudeCode:{promptQueueing:!0}},promptCapabilities:{image:!0,embeddedContext:!0},mcpCapabilities:{http:!0,sse:!0},loadSession:!0,sessionCapabilities:{fork:{},list:{},resume:{},close:{}}}}}async authenticate(e){return{}}async newSession(e){let t=await this.createSession(e);return this.scheduleAvailableCommandsUpdate(t.sessionId),t}async unstable_resumeSession(e){let t=await this.getOrCreateSession(e);return this.scheduleAvailableCommandsUpdate(t.sessionId),t}async loadSession(e){let t=await this.getOrCreateSession(e);return this.scheduleAvailableCommandsUpdate(t.sessionId),t}async listSessions(e){let t=await we({dir:e.cwd??void 0,limit:100}),n=[];for(let e of t)e.cwd&&n.push({sessionId:e.sessionId,cwd:e.cwd,title:zi(e.summary??``),updatedAt:new Date(e.lastModified).toISOString()});return{sessions:n}}async unstable_forkSession(e){let t=await this.createSession({cwd:e.cwd,mcpServers:e.mcpServers??[],_meta:e._meta});return this.scheduleAvailableCommandsUpdate(t.sessionId),t}async unstable_closeSession(e){if(!this.sessions.get(e.sessionId))throw Error(`Session not found`);return await this.teardownSession(e.sessionId),{}}async prompt(e){let t=this.sessions.get(e.sessionId);if(!t)throw Error(`Session ${e.sessionId} not found`);let n=na(e.prompt);if(!n.trim())return{stopReason:`end_turn`};let r=t.cancelGeneration;if(t.promptRunning){let e=Pe();if(await new Promise(n=>{t.pendingQueue.push(e),t.pendingMessages.set(e,{resolve:n})}))return{stopReason:`cancelled`}}if(t.cancelGeneration!==r)return{stopReason:`cancelled`};t.cancelled=!1,t.promptRunning=!0;try{t.queryEngine.resetAbortController();let r=t.queryEngine.submitMessage(n),{stopReason:i,usage:a}=await Ki(e.sessionId,r,this.conn,t.queryEngine.getAbortSignal(),t.toolUseCache,this.clientCapabilities,t.cwd,()=>t.cancelled);return t.cancelled?{stopReason:`cancelled`}:{stopReason:i,usage:a?{inputTokens:a.inputTokens,outputTokens:a.outputTokens,cachedReadTokens:a.cachedReadTokens,cachedWriteTokens:a.cachedWriteTokens,totalTokens:a.inputTokens+a.outputTokens+a.cachedReadTokens+a.cachedWriteTokens}:void 0}}catch(n){if(t.cancelled)return{stopReason:`cancelled`};throw n instanceof Error&&(n.message.includes(`terminated`)||n.message.includes(`process exited`))?(this.teardownSession(e.sessionId),Error(`The Claude Agent process exited unexpectedly. Please start a new session.`)):n}finally{let e=ga(t);e?(t.promptRunning=!0,e.resolve(!1)):t.promptRunning=!1}}async cancel(e){let t=this.sessions.get(e.sessionId);if(t){t.cancelled=!0,t.cancelGeneration+=1;for(let[,e]of t.pendingMessages)e.resolve(!0);t.pendingMessages.clear(),t.pendingQueue=[],t.pendingQueueHead=0,t.queryEngine.interrupt()}}async setSessionMode(e){if(!this.sessions.get(e.sessionId))throw Error(`Session not found`);return this.applySessionMode(e.sessionId,e.modeId),await this.updateConfigOption(e.sessionId,`mode`,e.modeId),{}}async unstable_setSessionModel(e){let t=this.sessions.get(e.sessionId);if(!t)throw Error(`Session not found`);return t.queryEngine.setModel(e.modelId),await this.updateConfigOption(e.sessionId,`model`,e.modelId),{}}async setSessionConfigOption(e){let t=this.sessions.get(e.sessionId);if(!t)throw Error(`Session not found`);if(typeof e.value!=`string`)throw Error(`Invalid value for config option ${e.configId}: ${String(e.value)}`);if(!t.configOptions.find(t=>t.id===e.configId))throw Error(`Unknown config option: ${e.configId}`);let n=e.value;return e.configId===`mode`?(this.applySessionMode(e.sessionId,n),await this.conn.sessionUpdate({sessionId:e.sessionId,update:{sessionUpdate:`current_mode_update`,currentModeId:n}})):e.configId===`model`&&t.queryEngine.setModel(n),this.syncSessionConfigState(t,e.configId,n),t.configOptions=t.configOptions.map(t=>t.id===e.configId&&typeof t.currentValue==`string`?{...t,currentValue:n}:t),{configOptions:t.configOptions}}async createSession(e,t={}){se();let n=t.sessionId??Pe(),r=e.cwd;C(n),re(r);let i=process.cwd(),a=!1;try{process.chdir(r),a=!0}catch{}try{let i=ke(),a=_e(i),o=e._meta,s=ua(o,`permissionMode`),c=s?o?.permissionMode:void 0,l=this.getSetting(`permissions.defaultMode`),u=sa(c,s,l),d=$i(this.conn,n,()=>this.sessions.get(n)?.modes.currentModeId??`default`,this.clientCapabilities,r,e=>{this.applySessionMode(n,e)},()=>this.sessions.get(n)?.appState.toolPermissionContext.isBypassPermissionsModeAvailable??!1),f=da(l),p={...he(),toolPermissionContext:{...i,mode:u,isBypassPermissionsModeAvailable:f}},m=await me(r),h=new Ne({cwd:r,tools:a,commands:m,mcpClients:[],agents:[],canUseTool:d,getAppState:()=>p,setAppState:e=>{let t=e(p);Object.assign(p,t)},readFileCache:new Me(500,50*1024*1024),includePartialMessages:!0,replayUserMessages:!0,initialMessages:t.initialMessages}),g={currentModeId:u,availableModes:[{id:`default`,name:`Default`,description:`Standard behavior, prompts for dangerous operations`},{id:`acceptEdits`,name:`Accept Edits`,description:`Auto-accept file edit operations`},{id:`plan`,name:`Plan Mode`,description:`Planning mode, no actual tool execution`},{id:`auto`,name:`Auto`,description:`Use a model classifier to approve/deny permission prompts.`},...f?[{id:`bypassPermissions`,name:`Bypass Permissions`,description:`Skip all permission checks`}]:[],{id:`dontAsk`,name:`Don't Ask`,description:`Don't prompt for permissions, deny if not pre-approved`}]},_=ve(),v=ae(),y={availableModels:_.map(e=>({modelId:String(e.value??``),name:e.label??String(e.value??``),description:e.description??void 0})),currentModelId:v};h.setModel(v);let b=va(g,y),x={queryEngine:h,cancelled:!1,cancelGeneration:0,cwd:r,modes:g,models:y,configOptions:b,promptRunning:!1,pendingMessages:new Map,pendingQueue:[],pendingQueueHead:0,toolUseCache:{},clientCapabilities:this.clientCapabilities,appState:p,commands:m,sessionFingerprint:Li({cwd:r,mcpServers:e.mcpServers})};return this.sessions.set(n,x),{sessionId:n,models:y,modes:g,configOptions:b}}finally{a&&process.chdir(i)}}async getOrCreateSession(e){let t=this.sessions.get(e.sessionId);if(t){if(Li({cwd:e.cwd,mcpServers:e.mcpServers})===t.sessionFingerprint)return C(e.sessionId),{sessionId:e.sessionId,modes:t.modes,models:t.models,configOptions:t.configOptions};await this.teardownSession(e.sessionId)}C(e.sessionId),re(e.cwd);let n;if(de(e.sessionId))try{let t=await xe(e.sessionId);t&&t.messages.length>0&&(n=fe(t.messages))}catch(e){console.error(`[ACP] Failed to load session history:`,e)}let r=await this.createSession({cwd:e.cwd,mcpServers:e.mcpServers??[],_meta:e._meta},{sessionId:e.sessionId,initialMessages:n});if(n&&n.length>0){let t=this.sessions.get(e.sessionId);t&&await Xi(e.sessionId,n,this.conn,t.toolUseCache,this.clientCapabilities,t.cwd)}return{sessionId:r.sessionId,modes:r.modes,models:r.models,configOptions:r.configOptions}}async teardownSession(e){this.sessions.get(e)&&(await this.cancel({sessionId:e}),this.sessions.delete(e))}applySessionMode(e,t){if(!oa(t))throw Error(`Invalid mode: ${t}`);let n=this.sessions.get(e);if(n){if(t===`bypassPermissions`&&!n.appState.toolPermissionContext.isBypassPermissionsModeAvailable||!n.modes.availableModes.some(e=>e.id===t))throw Error(`Mode not available: ${t}`);n.modes={...n.modes,currentModeId:t},n.appState.toolPermissionContext={...n.appState.toolPermissionContext,mode:t}}}async updateConfigOption(e,t,n){let r=this.sessions.get(e);r&&(this.syncSessionConfigState(r,t,n),r.configOptions=r.configOptions.map(e=>e.id===t&&typeof e.currentValue==`string`?{...e,currentValue:n}:e),await this.conn.sessionUpdate({sessionId:e,update:{sessionUpdate:`config_option_update`,configOptions:r.configOptions}}))}syncSessionConfigState(e,t,n){t===`mode`?e.modes={...e.modes,currentModeId:n}:t===`model`&&(e.models={...e.models,currentModelId:n})}async sendAvailableCommandsUpdate(e){let t=this.sessions.get(e);if(!t)return;let n=t.commands.filter(e=>e.type===`prompt`&&!e.isHidden&&e.userInvocable!==!1).map(e=>({name:e.name,description:e.description,input:e.argumentHint?{hint:e.argumentHint}:void 0}));await this.conn.sessionUpdate({sessionId:e,update:{sessionUpdate:`available_commands_update`,availableCommands:n}})}scheduleAvailableCommandsUpdate(e){setTimeout(()=>{this.sendAvailableCommandsUpdate(e).catch(e=>{console.error(`[ACP] Failed to send available commands update:`,e)})},0)}getSetting(e){let t=ce();return e.split(`.`).reduce((e,t)=>{if(!(!e||typeof e!=`object`))return e[t]},t)}},aa=[`auto`,`default`,`acceptEdits`,`bypassPermissions`,`dontAsk`,`plan`];function oa(e){return aa.includes(e)}function sa(e,t,n){if(t){let t=ca(e,`_meta.permissionMode`);if(t===`bypassPermissions`&&!da(n))throw Error(`Mode not available: bypassPermissions requires a local ACP bypass opt-in.`);return t}return la(n)??`default`}function ca(e,t){if(e==null)throw Error(`Invalid ${t}: expected a string.`);return Ii(e,t)}function la(e){if(e!=null)try{return Ii(e,`permissions.defaultMode`)}catch(e){let t=e instanceof Error?e.message:String(e);console.error(`[ACP] Invalid permissions.defaultMode, using default:`,t);return}}function ua(e,t){return!!e&&Object.hasOwn(e,t)}function da(e){return fa()&&(pa()||ma(e))}function fa(){return process.env.IS_SANDBOX?!0:typeof process.geteuid==`function`?process.geteuid()!==0:typeof process.getuid==`function`?process.getuid()!==0:!0}function pa(){return process.env.ACP_PERMISSION_MODE===`bypassPermissions`||ha(process.env.CLAUDE_CODE_ACP_ALLOW_BYPASS_PERMISSIONS)}function ma(e){try{return Ii(e)===`bypassPermissions`}catch{return!1}}function ha(e){return e===`1`||e?.toLowerCase()===`true`}function ga(e){for(;e.pendingQueueHead<e.pendingQueue.length;){let t=e.pendingQueue[e.pendingQueueHead++];if(!t)continue;let n=e.pendingMessages.get(t);if(n)return e.pendingMessages.delete(t),_a(e),n}_a(e)}function _a(e){if(e.pendingQueueHead!==0){if(e.pendingQueueHead>=e.pendingQueue.length){e.pendingQueue=[],e.pendingQueueHead=0;return}e.pendingQueueHead>1024&&e.pendingQueueHead*2>e.pendingQueue.length&&(e.pendingQueue=e.pendingQueue.slice(e.pendingQueueHead),e.pendingQueueHead=0)}}function va(e,t){return[{id:`mode`,name:`Mode`,description:`Session permission mode`,category:`mode`,type:`select`,currentValue:e.currentModeId,options:e.availableModes.map(e=>({value:e.id,name:e.name,description:e.description}))},{id:`model`,name:`Model`,description:`AI model to use`,category:`model`,type:`select`,currentValue:t.currentModelId,options:t.availableModels.map(e=>({value:e.modelId,name:e.name,description:e.description??void 0}))}]}ie(),Oe();function ya(e,t){let n=Fe.toWeb(e);return yi(Ie.toWeb(t),n)}async function ba(){se(),Ee();let e=ya(process.stdin,process.stdout),t,n=new xi(e=>(t=new ia(e),t),e);console.log=console.error,console.info=console.error,console.warn=console.error,console.debug=console.error;async function r(){for(let[e]of t.sessions)try{await t.unstable_closeSession({sessionId:e})}catch{}process.exit(0)}n.closed.then(r).catch(r),process.on(`SIGTERM`,r),process.on(`SIGINT`,r),process.on(`unhandledRejection`,(e,t)=>{console.error(`Unhandled Rejection at:`,t,`reason:`,e)}),process.stdin.resume()}export{ba as runAcpAgent};
@@ -1 +0,0 @@
1
- import{a as e,i as t}from"./envLessBridgeConfig-DJJKeDBT.js";t();export{e as shouldShowAppUpgradeMessage};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./extra-usage-CBcgeIcJ.js";e();export{t as call};
@@ -1 +0,0 @@
1
- import{Ql as e,Xl as t,Yl as n,Zl as r}from"./loadAgentsDir-DF6FgRn-.js";e();export{n as drainPendingExtraction,t as executeExtractMemories,r as initExtractMemories};
@@ -1 +0,0 @@
1
- import{n as e,r as t,t as n}from"./fast-DQyJ7c7s.js";t();export{n as FastModePicker,e as call};
@@ -1 +0,0 @@
1
- import{i as e,n as t}from"./gates-CAVdjC23.js";e();export{t as getChicagoEnabled};
@@ -1 +0,0 @@
1
- import{Yt as e,un as t,vn as n,yn as r}from"./loadAgentsDir-DF6FgRn-.js";r();export{e as executeSessionEndHooks,t as getSessionEndHookTimeoutMs,n as hasWorktreeCreateHook};
@@ -1 +0,0 @@
1
- import{r as e}from"./inboundAttachments-DPMETKd6.js";export{e as resolveAndPrepend};
@@ -1 +0,0 @@
1
- import{n as e,r as t}from"./language-BVAzlrRz.js";t();export{e as getResolvedLanguage};
@@ -1 +0,0 @@
1
- import{o as e,t}from"./loadAgentsDir-DF6FgRn-.js";e();export{t as clearAgentDefinitionsCache};
@@ -1 +0,0 @@
1
- import{a as e,c as t,o as n,t as r}from"./localSearch-v4itMlCM.js";n();export{r as clearSkillIndexCache,e as getSkillIndex,t as searchSkills};
@@ -1 +0,0 @@
1
- import{n as e,r as t,t as n}from"./login-CKodBzyZ.js";t();export{n as Login,e as call};
@@ -1 +0,0 @@
1
- import{AT as e,MT as t,NT as n,jT as r}from"./loadAgentsDir-DF6FgRn-.js";t();export{e as call,r as clearAuthRelatedCaches,n as performLogout};
@@ -1 +0,0 @@
1
- import{Dr as e,Pr as t}from"./paths-o5iA-EnQ.js";t();export{e as getMainLoopModel};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./pluginStartupCheck-CWWKwD5F.js";e();export{t as getPluginEditableScopes};
@@ -1 +0,0 @@
1
- import{Ba as e,Ka as t,Ra as n}from"./loadAgentsDir-DF6FgRn-.js";n();export{e as isPolicyAllowed,t as waitForPolicyLimitsToLoad};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./poorMode-7N6J6YN2.js";t();export{e as isPoorModeActive};
@@ -1 +0,0 @@
1
- import{i as e,r as t}from"./prompt-DiHksuOs.js";t();export{e as isDeferredTool};
@@ -1 +0,0 @@
1
- import{Jk as e,eA as t}from"./loadAgentsDir-DF6FgRn-.js";t();export{e as clearPromptCache};
@@ -1 +0,0 @@
1
- import{sA as e,uA as t}from"./loadAgentsDir-DF6FgRn-.js";t();export{e as SandboxManager};
@@ -1 +0,0 @@
1
- import{Yc as e,Zc as t}from"./loadAgentsDir-DF6FgRn-.js";e();export{t as isSearchExtraToolsEnabled};
@@ -1 +0,0 @@
1
- import{gu as e,vu as t}from"./loadAgentsDir-DF6FgRn-.js";e();export{t as registerSessionFileAccessHooks};
@@ -1 +0,0 @@
1
- import{i as e,r as t}from"./sessionMemory-CeWjRuFL.js";t();export{e as manuallyExtractSessionMemory};
@@ -1 +0,0 @@
1
- import{XO as e,ek as t}from"./loadAgentsDir-DF6FgRn-.js";t();export{e as getSessionMemoryContent};
@@ -1 +0,0 @@
1
- import{i as e,r as t}from"./sessionObserver-CsDT2GnB.js";e();export{t as heuristicObserverBackend};
@@ -1 +0,0 @@
1
- import{Ar as e,Lr as t,oi as n}from"./loadAgentsDir-DF6FgRn-.js";e();export{t as linkSessionToPR,n as recordTranscript};
@@ -1,3 +0,0 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,s as n}from"./envUtils-BWeoiL4Y.js";import{i as r,t as i}from"./hash-BRmOQc3c.js";import{join as a}from"path";import{open as o,readdir as s,realpath as c}from"fs/promises";import{promisify as l}from"util";import{execFile as u}from"child_process";async function d(e){try{let{stdout:t}=await f(`git`,[`worktree`,`list`,`--porcelain`],{cwd:e,timeout:5e3});return t?t.split(`
2
- `).filter(e=>e.startsWith(`worktree `)).map(e=>e.slice(9).normalize(`NFC`)):[]}catch{return[]}}var f,p=e((()=>{f=l(u)}));function m(e){return typeof e==`string`&&R.test(e)?e:null}function h(e){if(!e.includes(`\\`))return e;try{return JSON.parse(`"${e}"`)}catch{return e}}function g(e,t){let n=[`"${t}":"`,`"${t}": "`];for(let t of n){let n=e.indexOf(t);if(n<0)continue;let r=n+t.length,i=r;for(;i<e.length;){if(e[i]===`\\`){i+=2;continue}if(e[i]===`"`)return h(e.slice(r,i));i++}}}function _(e,t){let n=[`"${t}":"`,`"${t}": "`],r;for(let t of n){let n=0;for(;;){let i=e.indexOf(t,n);if(i<0)break;let a=i+t.length,o=a;for(;o<e.length;){if(e[o]===`\\`){o+=2;continue}if(e[o]===`"`){r=h(e.slice(a,o));break}o++}n=o+1}}return r}function v(e){let t=0,n=``;for(;t<e.length;){let r=e.indexOf(`
3
- `,t),i=r>=0?e.slice(t,r):e.slice(t);if(t=r>=0?r+1:e.length,!(!i.includes(`"type":"user"`)&&!i.includes(`"type": "user"`))&&!i.includes(`"tool_result"`)&&!(i.includes(`"isMeta":true`)||i.includes(`"isMeta": true`))&&!(i.includes(`"isCompactSummary":true`)||i.includes(`"isCompactSummary": true`)))try{let e=JSON.parse(i);if(e.type!==`user`)continue;let t=e.message;if(!t)continue;let r=t.content,a=[];if(typeof r==`string`)a.push(r);else if(Array.isArray(r))for(let e of r)e.type===`text`&&typeof e.text==`string`&&a.push(e.text);for(let e of a){let t=e.replace(/\n/g,` `).trim();if(!t)continue;let r=B.exec(t);if(r){n||(n=r[1]);continue}let i=/<bash-input>([\s\S]*?)<\/bash-input>/.exec(t);if(i)return`! ${i[1].trim()}`;if(!z.test(t))return t.length>200&&(t=t.slice(0,200).trim()+`…`),t}}catch{}}return n||``}async function y(e,t,n){try{let r=await o(e,`r`);try{let e=await r.read(n,0,L,0);if(e.bytesRead===0)return{head:``,tail:``};let i=n.toString(`utf8`,0,e.bytesRead),a=Math.max(0,t-L),o=i;if(a>0){let e=await r.read(n,0,L,a);o=n.toString(`utf8`,0,e.bytesRead)}return{head:i,tail:o}}finally{await r.close()}}catch{return{head:``,tail:``}}}async function b(e){try{let t=await o(e,`r`);try{let e=await t.stat(),n=Buffer.allocUnsafe(L),r=await t.read(n,0,L,0);if(r.bytesRead===0)return null;let i=n.toString(`utf8`,0,r.bytesRead),a=Math.max(0,e.size-L),o=i;if(a>0){let e=await t.read(n,0,L,a);o=n.toString(`utf8`,0,e.bytesRead)}return{mtime:e.mtime.getTime(),size:e.size,head:i,tail:o}}finally{await t.close()}}catch{return null}}function x(e){return Math.abs(i(e)).toString(36)}function S(e){let t=e.replace(/[^a-zA-Z0-9]/g,`-`);if(t.length<=200)return t;let n=typeof Bun<`u`?Bun.hash(e).toString(36):x(e);return`${t.slice(0,200)}-${n}`}function C(){return a(t(),`projects`)}function w(e){return a(C(),S(e))}async function T(e){try{return(await c(e)).normalize(`NFC`)}catch{return e.normalize(`NFC`)}}async function E(e){let t=w(e);try{return await s(t),t}catch{let t=S(e);if(t.length<=200)return;let n=t.slice(0,200),r=C();try{let e=(await s(r,{withFileTypes:!0})).find(e=>e.isDirectory()&&e.name.startsWith(n+`-`));return e?a(r,e.name):void 0}catch{return}}}function D(){return U??(U=Buffer.from(`"compact_boundary"`))}function O(e){try{let t=JSON.parse(e);return t.type!==`system`||t.subtype!==`compact_boundary`?null:{hasPreservedSegment:!!t.compactMetadata?.preservedSegment}}catch{return null}}function k(e,t,n,r){let i=r-n;if(!(i<=0)){if(e.len+i>e.buf.length){let t=Buffer.allocUnsafe(Math.min(Math.max(e.buf.length*2,e.len+i),e.cap));e.buf.copy(t,0,0,e.len),e.buf=t}t.copy(e.buf,e.len,n,r),e.len+=i}}function A(e,t,n,r){return r-n>=t.length&&e.compare(t,0,t.length,n,n+t.length)===0}function j(e,t,n){if(e.straddleSnapCarryLen=0,e.straddleSnapTailEnd=0,e.carryLen===0)return 0;let r=e.carryBuf,i=t.indexOf(K);if(i===-1||i>=n)return 0;let a=i+1;if(A(r,W,0,e.carryLen))e.straddleSnapCarryLen=e.carryLen,e.straddleSnapTailEnd=a,e.lastSnapSrc=null;else if(e.carryLen<W.length)return 0;else{if(A(r,G,0,e.carryLen)){let n=O(r.toString(`utf-8`,0,e.carryLen)+t.toString(`utf-8`,0,i));n?.hasPreservedSegment?e.hasPreservedSegment=!0:n&&(e.out.len=0,e.boundaryStartOffset=e.bufFileOff,e.hasPreservedSegment=!1,e.lastSnapSrc=null)}k(e.out,r,0,e.carryLen),k(e.out,t,0,a)}return e.bufFileOff+=e.carryLen+a,e.carryLen=0,a}function M(e,t,n){let r=t.indexOf(n),i=0,a=0,o=-1,s=-1,c=t.indexOf(K);for(;c!==-1;){let l=c+1;if(r!==-1&&r<a&&(r=t.indexOf(n,a)),A(t,W,a,l))k(e.out,t,i,a),o=a,s=l,i=l;else if(r>=a&&r<Math.min(a+J,l)){let s=O(t.toString(`utf-8`,a,c));s?.hasPreservedSegment?e.hasPreservedSegment=!0:s&&(e.out.len=0,e.boundaryStartOffset=e.bufFileOff+a,e.hasPreservedSegment=!1,e.lastSnapSrc=null,o=-1,e.straddleSnapCarryLen=0,i=a),r=t.indexOf(n,r+n.length)}a=l,c=t.indexOf(K,a)}return k(e.out,t,i,a),{lastSnapStart:o,lastSnapEnd:s,trailStart:a}}function N(e,t,n,r,i){r===-1?e.straddleSnapCarryLen>0&&(e.lastSnapLen=e.straddleSnapCarryLen+e.straddleSnapTailEnd,(e.lastSnapBuf===void 0||e.lastSnapLen>e.lastSnapBuf.length)&&(e.lastSnapBuf=Buffer.allocUnsafe(e.lastSnapLen)),e.carryBuf.copy(e.lastSnapBuf,0,0,e.straddleSnapCarryLen),n.copy(e.lastSnapBuf,e.straddleSnapCarryLen,0,e.straddleSnapTailEnd),e.lastSnapSrc=e.lastSnapBuf):(e.lastSnapLen=i-r,(e.lastSnapBuf===void 0||e.lastSnapLen>e.lastSnapBuf.length)&&(e.lastSnapBuf=Buffer.allocUnsafe(e.lastSnapLen)),t.copy(e.lastSnapBuf,0,r,i),e.lastSnapSrc=e.lastSnapBuf)}function P(e,t,n){e.carryLen=t.length-n,e.carryLen>0&&((e.carryBuf===void 0||e.carryLen>e.carryBuf.length)&&(e.carryBuf=Buffer.allocUnsafe(e.carryLen)),t.copy(e.carryBuf,0,n,t.length))}function F(e){if(e.carryLen>0){let t=e.carryBuf;A(t,W,0,e.carryLen)?(e.lastSnapSrc=t,e.lastSnapLen=e.carryLen):k(e.out,t,0,e.carryLen)}e.lastSnapSrc&&(e.out.len>0&&e.out.buf[e.out.len-1]!==K&&k(e.out,q,0,1),k(e.out,e.lastSnapSrc,0,e.lastSnapLen))}async function I(e,t){let n=D(),r=V,i={out:{buf:Buffer.allocUnsafe(Math.min(t,8*1024*1024)),len:0,cap:t+1},boundaryStartOffset:0,hasPreservedSegment:!1,lastSnapSrc:null,lastSnapLen:0,lastSnapBuf:void 0,bufFileOff:0,carryLen:0,carryBuf:void 0,straddleSnapCarryLen:0,straddleSnapTailEnd:0},a=Buffer.allocUnsafe(r),s=await o(e,`r`);try{let e=0;for(;e<t;){let{bytesRead:o}=await s.read(a,0,Math.min(r,t-e),e);if(o===0)break;e+=o;let c=j(i,a,o),l;if(i.carryLen>0){let e=i.carryLen+(o-c);l=Buffer.allocUnsafe(e),i.carryBuf.copy(l,0,0,i.carryLen),a.copy(l,i.carryLen,c,o)}else l=a.subarray(c,o);let u=M(i,l,n);N(i,l,a,u.lastSnapStart,u.lastSnapEnd),P(i,l,u.trailStart),i.bufFileOff+=u.trailStart}F(i)}finally{await s.close()}return{boundaryStartOffset:i.boundaryStartOffset,postBoundaryBuf:i.out.buf.subarray(0,i.out.len),hasPreservedSegment:i.hasPreservedSegment}}var L,R,z,B,V,H,U,W,G,K,q,J,Y=e((()=>{n(),p(),r(),L=65536,R=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,z=/^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/,B=/<command-name>(.*?)<\/command-name>/,V=1024*1024,H=5*1024*1024,W=Buffer.from(`{"type":"attribution-snapshot"`),G=Buffer.from(`{"type":"system"`),K=10,q=Buffer.from([K]),J=256}));export{g as a,C as c,b as d,I as f,p as g,d as h,v as i,Y as l,m,H as n,_ as o,S as p,T as r,E as s,L as t,y as u};
@@ -1 +0,0 @@
1
- import{r as e,t}from"./sink-BKc24wdw.js";t();export{e as initializeAnalyticsSink};
@@ -1 +0,0 @@
1
- import{t as e}from"./sinks-BTS1DWM4.js";export{e as initSinks};