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{Tn as t,wn as n}from"./src-Di342QoJ.js";import{Ct as r,cn as i}from"./state-sIHsFpDu.js";import{et as a}from"./log-CzsijfHZ.js";import{Jv as o,Lo as s,Wv as c,lo as l}from"./loadAgentsDir-DF6FgRn-.js";import{tn as u}from"./prompt-DiHksuOs.js";import{randomUUID as d}from"crypto";function f(e){return e.flatMap(e=>{switch(e.type){case`assistant`:return[{type:`assistant`,message:e.message,uuid:e.uuid,requestId:void 0,timestamp:new Date().toISOString()}];case`user`:return[{type:`user`,message:e.message,uuid:e.uuid??d(),timestamp:e.timestamp??new Date().toISOString(),isMeta:e.isSynthetic}];default:return[]}})}function p(e){let t=e.preservedSegment;return{trigger:e.trigger,pre_tokens:e.preTokens,...t&&{preserved_segment:{head_uuid:t.headUuid,anchor_uuid:t.anchorUuid,tail_uuid:t.tailUuid}}}}function m(e){let t=e,n=t.preserved_segment;return{trigger:t.trigger,preTokens:t.pre_tokens,...n&&{preservedSegment:{headUuid:n.head_uuid,anchorUuid:n.anchor_uuid,tailUuid:n.tail_uuid}}}}function h(e){return e.flatMap(e=>{switch(e.type){case`assistant`:return[{type:`assistant`,message:v(e),session_id:r(),parent_tool_use_id:null,uuid:e.uuid,error:e.error}];case`user`:return[{type:`user`,message:e.message,session_id:r(),parent_tool_use_id:null,uuid:e.uuid,timestamp:e.timestamp,isSynthetic:e.isMeta||e.isVisibleInTranscriptOnly,...e.toolUseResult===void 0?{}:{tool_use_result:e.toolUseResult}}];case`system`:return e.subtype===`compact_boundary`&&e.compactMetadata?[{type:`system`,subtype:`compact_boundary`,session_id:r(),uuid:e.uuid,compact_metadata:p(e.compactMetadata)}]:e.subtype===`local_command`&&(e.content.includes(`<local-command-stdout>`)||e.content.includes(`<local-command-stderr>`))?[g(e.content,e.uuid)]:[];default:return[]}})}function g(e,n){let i=l({content:t(e).replace(/<local-command-stdout>([\s\S]*?)<\/local-command-stdout>/,`$1`).replace(/<local-command-stderr>([\s\S]*?)<\/local-command-stderr>/,`$1`).trim()});return{type:`assistant`,content:i.message?.content,message:i.message,parent_tool_use_id:null,session_id:r(),uuid:n}}function _(e){if(e)return{type:`rate_limit`,status:e.status,...e.resetsAt!==void 0&&{resetsAt:e.resetsAt},...e.rateLimitType!==void 0&&{rateLimitType:e.rateLimitType},...e.utilization!==void 0&&{utilization:e.utilization},...e.overageStatus!==void 0&&{overageStatus:e.overageStatus},...e.overageResetsAt!==void 0&&{overageResetsAt:e.overageResetsAt},...e.overageDisabledReason!==void 0&&{overageDisabledReason:e.overageDisabledReason},...e.isUsingOverage!==void 0&&{isUsingOverage:e.isUsingOverage},...e.surpassedThreshold!==void 0&&{surpassedThreshold:e.surpassedThreshold}}}function v(e){let t=e.message.content;if(!Array.isArray(t))return e.message;let n=t.map(e=>{if(e.type!==`tool_use`)return e;if(e.name===`ExitPlanMode`){let t=c();if(t)return{...e,input:{...e.input,plan:t}}}return e});return{...e.message,content:n}}var y=e((()=>{i(),a(),u(),n(),s(),o()}));export{p as a,f as i,y as n,h as o,g as r,_ as s,m as t};
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{Tn as t,wn as n}from"./src-Di342QoJ.js";import{Ct as r,cn as i}from"./state-sIHsFpDu.js";import{et as a}from"./log-CzsijfHZ.js";import{Jv as o,Lo as s,Wv as c,lo as l}from"./loadAgentsDir-Cl2w3uvH.js";import{tn as u}from"./prompt-BmOnuQfF.js";import{randomUUID as d}from"crypto";function f(e){return e.flatMap(e=>{switch(e.type){case`assistant`:return[{type:`assistant`,message:e.message,uuid:e.uuid,requestId:void 0,timestamp:new Date().toISOString()}];case`user`:return[{type:`user`,message:e.message,uuid:e.uuid??d(),timestamp:e.timestamp??new Date().toISOString(),isMeta:e.isSynthetic}];default:return[]}})}function p(e){let t=e.preservedSegment;return{trigger:e.trigger,pre_tokens:e.preTokens,...t&&{preserved_segment:{head_uuid:t.headUuid,anchor_uuid:t.anchorUuid,tail_uuid:t.tailUuid}}}}function m(e){let t=e,n=t.preserved_segment;return{trigger:t.trigger,preTokens:t.pre_tokens,...n&&{preservedSegment:{headUuid:n.head_uuid,anchorUuid:n.anchor_uuid,tailUuid:n.tail_uuid}}}}function h(e){return e.flatMap(e=>{switch(e.type){case`assistant`:return[{type:`assistant`,message:v(e),session_id:r(),parent_tool_use_id:null,uuid:e.uuid,error:e.error}];case`user`:return[{type:`user`,message:e.message,session_id:r(),parent_tool_use_id:null,uuid:e.uuid,timestamp:e.timestamp,isSynthetic:e.isMeta||e.isVisibleInTranscriptOnly,...e.toolUseResult===void 0?{}:{tool_use_result:e.toolUseResult}}];case`system`:return e.subtype===`compact_boundary`&&e.compactMetadata?[{type:`system`,subtype:`compact_boundary`,session_id:r(),uuid:e.uuid,compact_metadata:p(e.compactMetadata)}]:e.subtype===`local_command`&&(e.content.includes(`<local-command-stdout>`)||e.content.includes(`<local-command-stderr>`))?[g(e.content,e.uuid)]:[];default:return[]}})}function g(e,n){let i=l({content:t(e).replace(/<local-command-stdout>([\s\S]*?)<\/local-command-stdout>/,`$1`).replace(/<local-command-stderr>([\s\S]*?)<\/local-command-stderr>/,`$1`).trim()});return{type:`assistant`,content:i.message?.content,message:i.message,parent_tool_use_id:null,session_id:r(),uuid:n}}function _(e){if(e)return{type:`rate_limit`,status:e.status,...e.resetsAt!==void 0&&{resetsAt:e.resetsAt},...e.rateLimitType!==void 0&&{rateLimitType:e.rateLimitType},...e.utilization!==void 0&&{utilization:e.utilization},...e.overageStatus!==void 0&&{overageStatus:e.overageStatus},...e.overageResetsAt!==void 0&&{overageResetsAt:e.overageResetsAt},...e.overageDisabledReason!==void 0&&{overageDisabledReason:e.overageDisabledReason},...e.isUsingOverage!==void 0&&{isUsingOverage:e.isUsingOverage},...e.surpassedThreshold!==void 0&&{surpassedThreshold:e.surpassedThreshold}}}function v(e){let t=e.message.content;if(!Array.isArray(t))return e.message;let n=t.map(e=>{if(e.type!==`tool_use`)return e;if(e.name===`ExitPlanMode`){let t=c();if(t)return{...e,input:{...e.input,plan:t}}}return e});return{...e.message,content:n}}var y=e((()=>{i(),a(),u(),n(),s(),o()}));export{p as a,f as i,y as n,h as o,g as r,_ as s,m as t};
@@ -1,5 +1,5 @@
1
- import{o as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./p-map-D7WEmnBE.js";import{Mt as r,Rn as i,T as a,b as o,f as s,g as c,h as l,t as u,v as ee,x as d}from"./src-Di342QoJ.js";import{t as f}from"./jsx-runtime-D-D469L8.js";import{Ac as p,Nc as m,Po as h,Sc as g,bc as _,jo as v}from"./paths-o5iA-EnQ.js";import{V as y,W as b}from"./debug-UI3T040K.js";import{n as x,r as S}from"./analytics-DqMQntaB.js";import{n as C,o as te}from"./process-DMKLUQIO.js";import{i as ne,o as re}from"./platform-CuyedWpe.js";import{s as ie,u as ae}from"./types-Csi32ZXh.js";import{$T as w,Cx as oe,DC as se,Dx as ce,EC as T,GC as E,IS as D,LS as O,TC as k,WC as A,ZT as j,aw as M,dy as N,eC as P,fw as F,gy as I,hw as L,hy as R,jC as z,kC as B,kx as V,nw as H,pw as U,tC as W,tw as G,uw as K,uy as le,wC as ue,yw as q}from"./loadAgentsDir-DF6FgRn-.js";import{n as J,t as Y}from"./exit-_obETqBv.js";import{stat as de}from"fs/promises";import{cwd as fe}from"process";n();var X=e(i(),1);w(),C(),u(),L(),v(),W(),I();var Z=f();function pe({servers:e,scope:t,onDone:n}){let r=Object.keys(e),[i,u]=(0,X.useState)({});(0,X.useEffect)(()=>{K().then(({servers:e})=>u(e))},[]);let f=r.filter(e=>i[e]!==void 0);async function p(n){let r=0;for(let a of n){let n=e[a];if(n){let e=a;if(i[e]!==void 0){let t=1;for(;i[`${a}_${t}`]!==void 0;)t++;e=`${a}_${t}`}await M(e,n,t),r++}}g(r)}let[m]=a(),g=(0,X.useCallback)(e=>{te(e>0?`\n${ee(`success`,m)(`Successfully imported ${e} MCP ${h(e,`server`)} to ${t} config.`)}\n`:`
2
- No servers were imported.`),n(),j()},[m,t,n]),_=(0,X.useCallback)(()=>{g(0)},[g]);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(s,{title:`Import MCP Servers from Claude Desktop`,subtitle:`Found ${r.length} MCP ${h(r.length,`server`)} in Claude Desktop.`,color:`success`,onCancel:_,hideInputGuide:!0,children:[f.length>0&&(0,Z.jsx)(o,{color:`warning`,children:`Note: Some servers already exist with the same name. If selected, they will be imported with a numbered suffix.`}),(0,Z.jsx)(o,{children:`Please select the servers you want to import:`}),(0,Z.jsx)(R,{options:r.map(e=>({label:`${e}${f.includes(e)?` (already exists)`:``}`,value:e})),defaultValue:r.filter(e=>!f.includes(e)),onSubmit:p,onCancel:_,hideIndexes:!0})]}),(0,Z.jsx)(d,{paddingX:1,children:(0,Z.jsx)(o,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(l,{children:[(0,Z.jsx)(c,{shortcut:`Space`,action:`select`}),(0,Z.jsx)(c,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(P,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})})]})}u(),N(),x(),se(),V(),L(),H(),O(),p(),y(),w(),ie(),re();async function Q(e,t){try{let n=await oe(e,t);return n.type===`connected`?`✓ Connected`:n.type===`needs-auth`?`! Needs authentication`:`✗ Failed to connect`}catch{return`✗ Connection error`}}async function me({debug:e,verbose:t}){let n=fe();S(`tengu_mcp_start`,{});try{await de(n)}catch(e){throw b(e)&&Y(`Error: Directory ${n} does not exist`),e}try{let{setup:r}=await import(`./setup-B5CMpp0c.js`);await r(n,`default`,!1,!1,void 0,!1);let{startMCPServer:i}=await import(`./mcp-Ci_TbB5m.js`);await i(n,e??!1,t??!1)}catch(e){Y(`Error: Failed to start MCP server: ${e}`)}}async function he(e,t){let n=F(e),r=()=>{n&&(n.type===`sse`||n.type===`http`)&&(k(e,n),ue(e,n))};try{if(t.scope){let n=E(t.scope);S(`tengu_mcp_delete`,{name:e,scope:n}),await q(e,n),r(),process.stdout.write(`Removed MCP server ${e} from ${n} config\n`),J(`File modified: ${A(n)}`)}let n=_(),i=g(),{servers:a}=U(`project`),o=!!a[e],s=[];if(n.mcpServers?.[e]&&s.push(`local`),o&&s.push(`project`),i.mcpServers?.[e]&&s.push(`user`),s.length===0)Y(`No MCP server found with name: "${e}"`);else if(s.length===1){let t=s[0];S(`tengu_mcp_delete`,{name:e,scope:t}),await q(e,t),r(),process.stdout.write(`Removed MCP server "${e}" from ${t} config\n`),J(`File modified: ${A(t)}`)}else process.stderr.write(`MCP server "${e}" exists in multiple scopes:\n`),s.forEach(e=>{process.stderr.write(` - ${G(e)} (${A(e)})\n`)}),process.stderr.write(`
1
+ import{o as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./p-map-D7WEmnBE.js";import{Mt as r,Rn as i,T as a,b as o,f as s,g as c,h as l,t as u,v as ee,x as d}from"./src-Di342QoJ.js";import{t as f}from"./jsx-runtime-D-D469L8.js";import{Ac as p,Nc as m,Po as h,Sc as g,bc as _,jo as v}from"./paths-q1-Ni8Oh.js";import{V as y,W as b}from"./debug-UI3T040K.js";import{n as x,r as S}from"./analytics-DqMQntaB.js";import{n as C,o as te}from"./process-DMKLUQIO.js";import{i as ne,o as re}from"./platform-CuyedWpe.js";import{s as ie,u as ae}from"./types-Csi32ZXh.js";import{$T as w,Cx as oe,DC as se,Dx as ce,EC as T,GC as E,IS as D,LS as O,TC as k,WC as A,ZT as j,aw as M,dy as N,eC as P,fw as F,gy as I,hw as L,hy as R,jC as z,kC as B,kx as V,nw as H,pw as U,tC as W,tw as G,uw as K,uy as le,wC as ue,yw as q}from"./loadAgentsDir-Cl2w3uvH.js";import{n as J,t as Y}from"./exit-_obETqBv.js";import{stat as de}from"fs/promises";import{cwd as fe}from"process";n();var X=e(i(),1);w(),C(),u(),L(),v(),W(),I();var Z=f();function pe({servers:e,scope:t,onDone:n}){let r=Object.keys(e),[i,u]=(0,X.useState)({});(0,X.useEffect)(()=>{K().then(({servers:e})=>u(e))},[]);let f=r.filter(e=>i[e]!==void 0);async function p(n){let r=0;for(let a of n){let n=e[a];if(n){let e=a;if(i[e]!==void 0){let t=1;for(;i[`${a}_${t}`]!==void 0;)t++;e=`${a}_${t}`}await M(e,n,t),r++}}g(r)}let[m]=a(),g=(0,X.useCallback)(e=>{te(e>0?`\n${ee(`success`,m)(`Successfully imported ${e} MCP ${h(e,`server`)} to ${t} config.`)}\n`:`
2
+ No servers were imported.`),n(),j()},[m,t,n]),_=(0,X.useCallback)(()=>{g(0)},[g]);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(s,{title:`Import MCP Servers from Claude Desktop`,subtitle:`Found ${r.length} MCP ${h(r.length,`server`)} in Claude Desktop.`,color:`success`,onCancel:_,hideInputGuide:!0,children:[f.length>0&&(0,Z.jsx)(o,{color:`warning`,children:`Note: Some servers already exist with the same name. If selected, they will be imported with a numbered suffix.`}),(0,Z.jsx)(o,{children:`Please select the servers you want to import:`}),(0,Z.jsx)(R,{options:r.map(e=>({label:`${e}${f.includes(e)?` (already exists)`:``}`,value:e})),defaultValue:r.filter(e=>!f.includes(e)),onSubmit:p,onCancel:_,hideIndexes:!0})]}),(0,Z.jsx)(d,{paddingX:1,children:(0,Z.jsx)(o,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(l,{children:[(0,Z.jsx)(c,{shortcut:`Space`,action:`select`}),(0,Z.jsx)(c,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(P,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})})]})}u(),N(),x(),se(),V(),L(),H(),O(),p(),y(),w(),ie(),re();async function Q(e,t){try{let n=await oe(e,t);return n.type===`connected`?`✓ Connected`:n.type===`needs-auth`?`! Needs authentication`:`✗ Failed to connect`}catch{return`✗ Connection error`}}async function me({debug:e,verbose:t}){let n=fe();S(`tengu_mcp_start`,{});try{await de(n)}catch(e){throw b(e)&&Y(`Error: Directory ${n} does not exist`),e}try{let{setup:r}=await import(`./setup-BpwYOhci.js`);await r(n,`default`,!1,!1,void 0,!1);let{startMCPServer:i}=await import(`./mcp-D-0wE0nJ.js`);await i(n,e??!1,t??!1)}catch(e){Y(`Error: Failed to start MCP server: ${e}`)}}async function he(e,t){let n=F(e),r=()=>{n&&(n.type===`sse`||n.type===`http`)&&(k(e,n),ue(e,n))};try{if(t.scope){let n=E(t.scope);S(`tengu_mcp_delete`,{name:e,scope:n}),await q(e,n),r(),process.stdout.write(`Removed MCP server ${e} from ${n} config\n`),J(`File modified: ${A(n)}`)}let n=_(),i=g(),{servers:a}=U(`project`),o=!!a[e],s=[];if(n.mcpServers?.[e]&&s.push(`local`),o&&s.push(`project`),i.mcpServers?.[e]&&s.push(`user`),s.length===0)Y(`No MCP server found with name: "${e}"`);else if(s.length===1){let t=s[0];S(`tengu_mcp_delete`,{name:e,scope:t}),await q(e,t),r(),process.stdout.write(`Removed MCP server "${e}" from ${t} config\n`),J(`File modified: ${A(t)}`)}else process.stderr.write(`MCP server "${e}" exists in multiple scopes:\n`),s.forEach(e=>{process.stderr.write(` - ${G(e)} (${A(e)})\n`)}),process.stderr.write(`
3
3
  To remove from a specific scope, use:
4
4
  `),s.forEach(t=>{process.stderr.write(` claude mcp remove "${e}" -s ${t}\n`)}),Y()}catch(e){Y(e.message)}}async function ge(){S(`tengu_mcp_list`,{});let{servers:e}=await K();if(Object.keys(e).length===0)console.log("No MCP servers configured. Use `claude mcp add` to add a server.");else{console.log(`Checking MCP server health...
5
5
  `);let n=await t(Object.entries(e),async([e,t])=>({name:e,server:t,status:await Q(e,t)}),{concurrency:ce()});for(let{name:e,server:t,status:r}of n)if(t.type===`sse`)console.log(`${e}: ${t.url} (SSE) - ${r}`);else if(t.type===`http`)console.log(`${e}: ${t.url} (HTTP) - ${r}`);else if(t.type===`claudeai-proxy`)console.log(`${e}: ${t.url} - ${r}`);else if(!t.type||t.type===`stdio`){let n=t,i=Array.isArray(n.args)?n.args:[];console.log(`${e}: ${n.command} ${i.join(` `)} - ${r}`)}}await j(0)}async function $(e){S(`tengu_mcp_get`,{name:e});let t=F(e);t||Y(`No MCP server found with name: ${e}`),console.log(`${e}:`),console.log(` Scope: ${G(t.scope)}`);let n=await Q(e,t);if(console.log(` Status: ${n}`),t.type===`sse`){if(console.log(` Type: sse`),console.log(` URL: ${t.url}`),t.headers){console.log(` Headers:`);for(let[e,n]of Object.entries(t.headers))console.log(` ${e}: ${n}`)}if(t.oauth?.clientId||t.oauth?.callbackPort){let n=[];t.oauth.clientId&&(n.push(`client_id configured`),T(e,t)?.clientSecret&&n.push(`client_secret configured`)),t.oauth.callbackPort&&n.push(`callback_port ${t.oauth.callbackPort}`),console.log(` OAuth: ${n.join(`, `)}`)}}else if(t.type===`http`){if(console.log(` Type: http`),console.log(` URL: ${t.url}`),t.headers){console.log(` Headers:`);for(let[e,n]of Object.entries(t.headers))console.log(` ${e}: ${n}`)}if(t.oauth?.clientId||t.oauth?.callbackPort){let n=[];t.oauth.clientId&&(n.push(`client_id configured`),T(e,t)?.clientSecret&&n.push(`client_secret configured`)),t.oauth.callbackPort&&n.push(`callback_port ${t.oauth.callbackPort}`),console.log(` OAuth: ${n.join(`, `)}`)}}else if(t.type===`stdio`){console.log(` Type: stdio`),console.log(` Command: ${t.command}`);let e=Array.isArray(t.args)?t.args:[];if(console.log(` Args: ${e.join(` `)}`),t.env){console.log(` Environment:`);for(let[e,n]of Object.entries(t.env))console.log(` ${e}=${n}`)}}console.log(`\nTo remove this server, run: claude mcp remove "${e}" -s ${t.scope}`),await j(0)}async function _e(e,t,n){try{let r=E(n.scope),i=ae(t),a=n.clientSecret&&i&&typeof i==`object`&&`type`in i&&(i.type===`sse`||i.type===`http`)&&`url`in i&&typeof i.url==`string`&&`oauth`in i&&i.oauth&&typeof i.oauth==`object`&&`clientId`in i.oauth?await B():void 0;await M(e,i,r);let o=i&&typeof i==`object`&&`type`in i?String(i.type||`stdio`):`stdio`;a&&i&&typeof i==`object`&&`type`in i&&(i.type===`sse`||i.type===`http`)&&`url`in i&&typeof i.url==`string`&&z(e,{type:i.type,url:i.url},a),S(`tengu_mcp_add`,{scope:r,source:`json`,type:o}),J(`Added ${o} MCP server ${e} to ${r} config`)}catch(e){Y(e.message)}}async function ve(e){try{let t=E(e.scope);S(`tengu_mcp_add`,{scope:t,platform:ne(),source:`desktop`});let{readClaudeDesktopMcpServers:n}=await import(`./claudeDesktop-D0S1eq1F.js`),i=await n();Object.keys(i).length===0&&J(`No MCP servers found in Claude Desktop configuration or configuration file does not exist.`);let{unmount:a}=await r((0,Z.jsx)(D,{children:(0,Z.jsx)(le,{children:(0,Z.jsx)(pe,{servers:i,scope:t,onDone:()=>{a()}})})}),{exitOnCtrlC:!0})}catch(e){Y(e.message)}}async function ye(){S(`tengu_mcp_reset_mcpjson_choices`,{}),m(e=>({...e,enabledMcpjsonServers:[],disabledMcpjsonServers:[],enableAllProjectMcpServers:!1})),J(`All project-scoped (.mcp.json) server approvals and rejections have been reset.
@@ -1,2 +1,2 @@
1
- import{B as e,M as t,d as n,n as r,t as i}from"./server-DzOdtq8A.js";import{Dr as a,Pr as o}from"./paths-o5iA-EnQ.js";import{E as s,w as c}from"./debug-UI3T040K.js";import{o as l,s as u}from"./log-CzsijfHZ.js";import{G as d,Hm as f,JE as p,K as m,Ku as h,Lo as g,Na as _,OD as v,Pa as y,Vm as b,YE as x,kD as S,lo as C,nl as w,ou as T,qu as E,su as D,tl as O}from"./loadAgentsDir-DF6FgRn-.js";import{Bn as k,Vn as A,zn as j}from"./prompt-DiHksuOs.js";import{a as M,o as N}from"./fileStateCache-C7-TxF8G.js";import{n as P,t as F}from"./stdio-BEEzuxaZ.js";r(),P(),e(),x(),_(),A(),E(),S(),N(),l(),g(),o(),m(),b(),c(),D(),O();var I=[y];async function L(e,r,o){let c=M(100);f(e);let l=new i({name:`claude/tengu`,version:`2.6.8`},{capabilities:{tools:{}}});l.setRequestHandler(t,async()=>{let e=k(),t=h(e);return{tools:await Promise.all(t.map(async n=>{let r;if(n.outputSchema){let e=w(n.outputSchema);typeof e==`object`&&e&&`type`in e&&e.type===`object`&&(r=e)}return{...n,description:await n.prompt({getToolPermissionContext:async()=>e,tools:t,agents:[]}),inputSchema:w(n.inputSchema),outputSchema:r}}))}}),l.setRequestHandler(n,async({params:{name:e,arguments:t}})=>{let n=h(k()),i=j(n,e);if(!i)throw Error(`Tool ${e} not found`);let l={abortController:v(),options:{commands:I,tools:n,mainLoopModel:a(),thinkingConfig:{type:`disabled`},mcpClients:[],mcpResources:{},isNonInteractiveSession:!0,debug:r,verbose:o,agentDefinitions:{activeAgents:[],allAgents:[]}},getAppState:()=>p(),setAppState:()=>{},messages:[],readFileState:c,setInProgressToolUseIDs:()=>{},setResponseLength:()=>{},updateFileHistoryState:()=>{},updateAttributionState:()=>{}};try{if(!i.isEnabled())throw Error(`Tool ${e} is not enabled`);let n=await i.validateInput?.(t??{},l);if(n&&!n.result)throw Error(`Tool ${e} input is invalid: ${n.message}`);let r=await i.call(t??{},l,d,C({content:[]}));return{content:[{type:`text`,text:typeof r==`string`?r:s(r.data)}]}}catch(e){return u(e),{isError:!0,content:[{type:`text`,text:(e instanceof Error?T(e):[String(e)]).filter(Boolean).join(`
1
+ import{B as e,M as t,d as n,n as r,t as i}from"./server-DzOdtq8A.js";import{Dr as a,Pr as o}from"./paths-q1-Ni8Oh.js";import{E as s,w as c}from"./debug-UI3T040K.js";import{o as l,s as u}from"./log-CzsijfHZ.js";import{G as d,Hm as f,JE as p,K as m,Ku as h,Lo as g,Na as _,OD as v,Pa as y,Vm as b,YE as x,kD as S,lo as C,nl as w,ou as T,qu as E,su as D,tl as O}from"./loadAgentsDir-Cl2w3uvH.js";import{Bn as k,Vn as A,zn as j}from"./prompt-BmOnuQfF.js";import{a as M,o as N}from"./fileStateCache-C7-TxF8G.js";import{n as P,t as F}from"./stdio-BEEzuxaZ.js";r(),P(),e(),x(),_(),A(),E(),S(),N(),l(),g(),o(),m(),b(),c(),D(),O();var I=[y];async function L(e,r,o){let c=M(100);f(e);let l=new i({name:`claude/tengu`,version:`2.6.9`},{capabilities:{tools:{}}});l.setRequestHandler(t,async()=>{let e=k(),t=h(e);return{tools:await Promise.all(t.map(async n=>{let r;if(n.outputSchema){let e=w(n.outputSchema);typeof e==`object`&&e&&`type`in e&&e.type===`object`&&(r=e)}return{...n,description:await n.prompt({getToolPermissionContext:async()=>e,tools:t,agents:[]}),inputSchema:w(n.inputSchema),outputSchema:r}}))}}),l.setRequestHandler(n,async({params:{name:e,arguments:t}})=>{let n=h(k()),i=j(n,e);if(!i)throw Error(`Tool ${e} not found`);let l={abortController:v(),options:{commands:I,tools:n,mainLoopModel:a(),thinkingConfig:{type:`disabled`},mcpClients:[],mcpResources:{},isNonInteractiveSession:!0,debug:r,verbose:o,agentDefinitions:{activeAgents:[],allAgents:[]}},getAppState:()=>p(),setAppState:()=>{},messages:[],readFileState:c,setInProgressToolUseIDs:()=>{},setResponseLength:()=>{},updateFileHistoryState:()=>{},updateAttributionState:()=>{}};try{if(!i.isEnabled())throw Error(`Tool ${e} is not enabled`);let n=await i.validateInput?.(t??{},l);if(n&&!n.result)throw Error(`Tool ${e} input is invalid: ${n.message}`);let r=await i.call(t??{},l,d,C({content:[]}));return{content:[{type:`text`,text:typeof r==`string`?r:s(r.data)}]}}catch(e){return u(e),{isError:!0,content:[{type:`text`,text:(e instanceof Error?T(e):[String(e)]).filter(Boolean).join(`
2
2
  `).trim()||`Error`}]}}});async function m(){let e=new F;await l.connect(e)}return await m()}export{L as startMCPServer};
@@ -1 +1 @@
1
- import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{n,t as r}from"./figures-gfT9mM8P.js";import{Q as i,Rn as a,T as o,b as s,f as c,g as l,h as u,nt as d,t as f,tt as p,v as m,x as h}from"./src-Di342QoJ.js";import{t as g}from"./jsx-runtime-D-D469L8.js";import{Do as _,Po as v,jo as y}from"./paths-o5iA-EnQ.js";import{c as b,s as x}from"./debug-UI3T040K.js";import{$C as S,CC as C,DC as w,LS as T,Nx as E,OC as ee,RS as D,SC as O,Sy as k,WC as A,ZC as j,by as te,eC as M,my as ne,nw as N,tC as P,zS as re}from"./loadAgentsDir-DF6FgRn-.js";import{D as ie,O as ae}from"./rcDebugLog-BNojB_eB.js";import{t as F}from"./useKeybinding-FsOnjW6T.js";import{i as oe,n as I,r as se}from"./MCPConnectionManager-xL_wQCda.js";import{n as ce,t as le}from"./McpParsingWarnings-C6u4RM2a.js";import{a as ue,c as L,i as de,l as fe,n as pe,o as me,r as he,s as ge,t as _e,u as ve}from"./PluginSettings-D1YHfrE1.js";function ye({agentServer:e,onCancel:t,onComplete:n}){let[a]=o(),[d,f]=(0,R.useState)(!1),[g,v]=(0,R.useState)(null),[y,b]=(0,R.useState)(null),x=(0,R.useRef)(null);(0,R.useEffect)(()=>()=>x.current?.abort(),[]),p(`confirm:no`,(0,R.useCallback)(()=>{d&&(x.current?.abort(),x.current=null,f(!1),b(null))},[d]),{context:`Confirmation`,isActive:d});let S=(0,R.useCallback)(async()=>{if(!e.needsAuth||!e.url)return;f(!0),v(null);let t=new AbortController;x.current=t;try{let r={type:e.transport,url:e.url};await ee(e.name,r,b,t.signal),n?.(`Authentication successful for ${e.name}. The server will connect when the agent runs.`)}catch(e){e instanceof Error&&!(e instanceof O)&&v(e.message)}finally{f(!1),x.current=null}},[e,n]),C=_(String(e.name));if(d)return(0,z.jsxs)(h,{flexDirection:`column`,gap:1,padding:1,children:[(0,z.jsxs)(s,{color:`claude`,children:[`Authenticating with `,e.name,`…`]}),(0,z.jsxs)(h,{children:[(0,z.jsx)(te,{}),(0,z.jsx)(s,{children:` A browser window will open for authentication`})]}),y&&(0,z.jsxs)(h,{flexDirection:`column`,children:[(0,z.jsx)(s,{dimColor:!0,children:`If your browser doesn't open automatically, copy this URL manually:`}),(0,z.jsx)(i,{url:y})]}),(0,z.jsx)(h,{marginLeft:3,children:(0,z.jsxs)(s,{dimColor:!0,children:[`Return here after authenticating in your browser.`,` `,(0,z.jsx)(M,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]})})]});let w=[];return e.needsAuth&&w.push({label:e.isAuthenticated?`Re-authenticate`:`Authenticate`,value:`auth`}),w.push({label:`Back`,value:`back`}),(0,z.jsxs)(c,{title:`${C} MCP Server`,subtitle:`agent-only`,onCancel:t,inputGuide:e=>e.pending?(0,z.jsxs)(s,{children:[`Press `,e.keyName,` again to exit`]}):(0,z.jsxs)(u,{children:[(0,z.jsx)(l,{shortcut:`↑↓`,action:`navigate`}),(0,z.jsx)(l,{shortcut:`Enter`,action:`confirm`}),(0,z.jsx)(M,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:[(0,z.jsxs)(h,{flexDirection:`column`,gap:0,children:[(0,z.jsxs)(h,{children:[(0,z.jsx)(s,{bold:!0,children:`Type: `}),(0,z.jsx)(s,{dimColor:!0,children:e.transport})]}),e.url&&(0,z.jsxs)(h,{children:[(0,z.jsx)(s,{bold:!0,children:`URL: `}),(0,z.jsx)(s,{dimColor:!0,children:e.url})]}),e.command&&(0,z.jsxs)(h,{children:[(0,z.jsx)(s,{bold:!0,children:`Command: `}),(0,z.jsx)(s,{dimColor:!0,children:e.command})]}),(0,z.jsxs)(h,{children:[(0,z.jsx)(s,{bold:!0,children:`Used by: `}),(0,z.jsx)(s,{dimColor:!0,children:e.sourceAgents.join(`, `)})]}),(0,z.jsxs)(h,{marginTop:1,children:[(0,z.jsx)(s,{bold:!0,children:`Status: `}),(0,z.jsxs)(s,{children:[m(`inactive`,a)(r.radioOff),` not connected (agent-only)`]})]}),e.needsAuth&&(0,z.jsxs)(h,{children:[(0,z.jsx)(s,{bold:!0,children:`Auth: `}),e.isAuthenticated?(0,z.jsxs)(s,{children:[m(`success`,a)(r.tick),` authenticated`]}):(0,z.jsxs)(s,{children:[m(`warning`,a)(r.triangleUpOutline),` may need authentication`]})]})]}),(0,z.jsx)(h,{children:(0,z.jsx)(s,{dimColor:!0,children:`This server connects only when running the agent.`})}),g&&(0,z.jsx)(h,{children:(0,z.jsxs)(s,{color:`error`,children:[`Error: `,g]})}),(0,z.jsx)(h,{children:(0,z.jsx)(E,{options:w,onChange:async e=>{switch(e){case`auth`:await S();break;case`back`:t();break}},onCancel:t})})]})}var R,z,B=e((()=>{n(),R=t(a(),1),f(),F(),w(),y(),P(),ne(),k(),z=g()}));function V(e){switch(e){case`project`:return{label:`Project MCPs`,path:A(e)};case`user`:return{label:`User MCPs`,path:A(e)};case`local`:return{label:`Local MCPs`,path:A(e)};case`enterprise`:return{label:`Enterprise MCPs`};case`dynamic`:return{label:`Built-in MCPs`,path:`always available`};default:return{label:e}}}function be(e){let t=new Map;for(let n of e){let e=n.scope;t.has(e)||t.set(e,[]),t.get(e).push(n)}for(let[,e]of t)e.sort((e,t)=>e.name.localeCompare(t.name));return t}function xe({servers:e,agentServers:t=[],onSelectServer:n,onSelectAgentServer:a,onComplete:f}){let[p]=o(),[g,_]=(0,H.useState)(0),y=H.useMemo(()=>be(e.filter(e=>e.client.config.type!==`claudeai-proxy`)),[e]),x=H.useMemo(()=>e.filter(e=>e.client.config.type===`claudeai-proxy`).sort((e,t)=>e.name.localeCompare(t.name)),[e]),S=H.useMemo(()=>(y.get(`dynamic`)??[]).sort((e,t)=>e.name.localeCompare(t.name)),[y]),C=V(`dynamic`),w=H.useMemo(()=>{let e=[];for(let t of W){let n=y.get(t)??[];for(let t of n)e.push({type:`server`,server:t})}for(let t of x)e.push({type:`server`,server:t});for(let n of t)e.push({type:`agent-server`,agentServer:n});for(let t of S)e.push({type:`server`,server:t});return e},[y,x,t,S]),T=(0,H.useCallback)(()=>{f(`MCP dialog dismissed`,{display:`system`})},[f]);d({"confirm:previous":()=>_(e=>e===0?w.length-1:e-1),"confirm:next":()=>_(e=>e===w.length-1?0:e+1),"confirm:yes":(0,H.useCallback)(()=>{let e=w[g];e&&(e.type===`server`?n(e.server):e.type===`agent-server`&&a&&a(e.agentServer))},[w,g,n,a]),"confirm:no":T},{context:`Confirmation`});let E=e=>w.findIndex(t=>t.type===`server`&&t.server===e),ee=e=>w.findIndex(t=>t.type===`agent-server`&&t.agentServer===e),D=b(),O=e.some(e=>e.client.type===`failed`);if(e.length===0&&t.length===0)return null;let k=e=>{let t=E(e),n=g===t,i=``,a=``;if(e.client.type===`disabled`)i=m(`inactive`,p)(r.radioOff),a=`disabled`;else if(e.client.type===`connected`)i=m(`success`,p)(r.tick),a=`connected`;else if(e.client.type===`pending`){i=m(`inactive`,p)(r.radioOff);let{reconnectAttempt:t,maxReconnectAttempts:n}=e.client;a=t&&n?`reconnecting (${t}/${n})…`:`connecting…`}else e.client.type===`needs-auth`?(i=m(`warning`,p)(r.triangleUpOutline),a=`needs authentication`):(i=m(`error`,p)(r.cross),a=`failed`);return(0,U.jsxs)(h,{children:[(0,U.jsx)(s,{color:n?`suggestion`:void 0,children:n?`${r.pointer} `:` `}),(0,U.jsx)(s,{color:n?`suggestion`:void 0,children:e.name}),(0,U.jsxs)(s,{dimColor:!n,children:[` · `,i,` `]}),(0,U.jsx)(s,{dimColor:!n,children:a})]},`${e.name}-${t}`)},A=e=>{let t=ee(e),n=g===t,i=e.needsAuth?m(`warning`,p)(r.triangleUpOutline):m(`inactive`,p)(r.radioOff),a=e.needsAuth?`may need auth`:`agent-only`;return(0,U.jsxs)(h,{children:[(0,U.jsx)(s,{color:n?`suggestion`:void 0,children:n?`${r.pointer} `:` `}),(0,U.jsx)(s,{color:n?`suggestion`:void 0,children:e.name}),(0,U.jsxs)(s,{dimColor:!n,children:[` · `,i,` `]}),(0,U.jsx)(s,{dimColor:!n,children:a})]},`agent-${e.name}-${t}`)},j=e.length+t.length;return(0,U.jsxs)(h,{flexDirection:`column`,children:[(0,U.jsx)(le,{}),(0,U.jsx)(c,{title:`Manage MCP servers`,subtitle:`${j} ${v(j,`server`)}`,onCancel:T,hideInputGuide:!0,children:(0,U.jsxs)(h,{flexDirection:`column`,children:[W.map(e=>{let t=y.get(e);if(!t||t.length===0)return null;let n=V(e);return(0,U.jsxs)(h,{flexDirection:`column`,marginBottom:1,children:[(0,U.jsxs)(h,{paddingLeft:2,children:[(0,U.jsx)(s,{bold:!0,children:n.label}),n.path&&(0,U.jsxs)(s,{dimColor:!0,children:[` (`,n.path,`)`]})]}),t.map(e=>k(e))]},e)}),x.length>0&&(0,U.jsxs)(h,{flexDirection:`column`,marginBottom:1,children:[(0,U.jsx)(h,{paddingLeft:2,children:(0,U.jsx)(s,{bold:!0,children:`claude.ai`})}),x.map(e=>k(e))]}),t.length>0&&(0,U.jsxs)(h,{flexDirection:`column`,marginBottom:1,children:[(0,U.jsx)(h,{paddingLeft:2,children:(0,U.jsx)(s,{bold:!0,children:`Agent MCPs`})}),[...new Set(t.flatMap(e=>e.sourceAgents))].map(e=>(0,U.jsxs)(h,{flexDirection:`column`,marginTop:1,children:[(0,U.jsx)(h,{paddingLeft:2,children:(0,U.jsxs)(s,{dimColor:!0,children:[`@`,e]})}),t.filter(t=>t.sourceAgents.includes(e)).map(e=>A(e))]},e))]}),S.length>0&&(0,U.jsxs)(h,{flexDirection:`column`,marginBottom:1,children:[(0,U.jsxs)(h,{paddingLeft:2,children:[(0,U.jsx)(s,{bold:!0,children:C.label}),C.path&&(0,U.jsxs)(s,{dimColor:!0,children:[` (`,C.path,`)`]})]}),S.map(e=>k(e))]}),(0,U.jsxs)(h,{flexDirection:`column`,children:[O&&(0,U.jsx)(s,{dimColor:!0,children:D?`※ Error logs shown inline with --debug`:`※ Run claude --debug to see error logs`}),(0,U.jsxs)(s,{dimColor:!0,children:[(0,U.jsx)(i,{url:`https://code.claude.com/docs/en/mcp`,children:`https://code.claude.com/docs/en/mcp`}),` for help`]})]})]})}),(0,U.jsx)(h,{paddingX:1,children:(0,U.jsx)(s,{dimColor:!0,italic:!0,children:(0,U.jsxs)(u,{children:[(0,U.jsx)(l,{shortcut:`↑↓`,action:`navigate`}),(0,U.jsx)(l,{shortcut:`Enter`,action:`confirm`}),(0,U.jsx)(M,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})})]})}var H,U,W,G=e((()=>{n(),H=t(a(),1),f(),F(),N(),x(),y(),P(),ce(),U=g(),W=[`project`,`local`,`user`,`enterprise`]}));function Se({serverName:e,onComplete:t}){let[n]=o(),i=re(),a=se(),[c,l]=(0,K.useState)(!0),[u,d]=(0,K.useState)(null);return(0,K.useEffect)(()=>{async function n(){try{if(!i.getState().mcp.clients.find(t=>t.name===e)){d(`MCP server "${e}" not found`),l(!1),t(`MCP server "${e}" not found`);return}switch((await a(e)).client.type){case`connected`:l(!1),t(`Successfully reconnected to ${e}`);break;case`needs-auth`:d(`${e} requires authentication`),l(!1),t(`${e} requires authentication. Use /mcp to authenticate.`);break;case`pending`:case`failed`:case`disabled`:d(`Failed to reconnect to ${e}`),l(!1),t(`Failed to reconnect to ${e}`);break}}catch(e){let n=e instanceof Error?e.message:String(e);d(n),l(!1),t(`Error: ${n}`)}}n()},[e,a,i,t]),c?(0,q.jsxs)(h,{flexDirection:`column`,gap:1,padding:1,children:[(0,q.jsxs)(s,{color:`text`,children:[`Reconnecting to `,(0,q.jsx)(s,{bold:!0,children:e})]}),(0,q.jsxs)(h,{children:[(0,q.jsx)(te,{}),(0,q.jsx)(s,{children:` Establishing connection to MCP server`})]})]}):u?(0,q.jsxs)(h,{flexDirection:`column`,gap:1,padding:1,children:[(0,q.jsxs)(h,{children:[(0,q.jsxs)(s,{children:[m(`error`,n)(r.cross),` `]}),(0,q.jsxs)(s,{color:`error`,children:[`Failed to reconnect to `,e]})]}),(0,q.jsxs)(s,{dimColor:!0,children:[`Error: `,u]})]}):null}var K,q,J=e((()=>{n(),K=t(a(),1),f(),I(),T(),k(),q=g()}));function Y({onComplete:e}){let t=D(e=>e.mcp),n=D(e=>e.agentDefinitions),r=t.clients,[i,a]=X.useState({type:`list`}),[o,s]=X.useState([]),c=(0,X.useMemo)(()=>j(n.allAgents),[n.allAgents]),l=X.useMemo(()=>r.filter(e=>e.name!==`ide`).sort((e,t)=>e.name.localeCompare(t.name)),[r]);switch(X.useEffect(()=>{let e=!1;async function n(){let n=await Promise.all(l.map(async e=>{let n=e.config.scope,r=e.config.type===`sse`,i=e.config.type===`http`,a=e.config.type===`claudeai-proxy`,o;if(r||i){let n=await new C(e.name,e.config).tokens(),r=ie()!==null&&e.type===`connected`,i=e.type===`connected`&&S(t.tools,e.name).length>0;o=!!n||r||i}let s={name:e.name,client:e,scope:n};return a?{...s,transport:`claudeai-proxy`,isAuthenticated:!1,config:e.config}:r?{...s,transport:`sse`,isAuthenticated:o,config:e.config}:i?{...s,transport:`http`,isAuthenticated:o,config:e.config}:{...s,transport:`stdio`,config:e.config}}));e||s(n)}return n(),()=>{e=!0}},[l,t.tools]),(0,X.useEffect)(()=>{o.length===0&&l.length>0||o.length===0&&c.length===0&&e("No MCP servers configured. Please run /doctor if this is unexpected. Otherwise, run `claude mcp --help` or visit https://code.claude.com/docs/en/mcp to learn more.")},[o.length,l.length,c.length,e]),i.type){case`list`:return(0,Z.jsx)(xe,{servers:o,agentServers:c,onSelectServer:e=>a({type:`server-menu`,server:e}),onSelectAgentServer:e=>a({type:`agent-server-menu`,agentServer:e}),onComplete:e,defaultTab:i.defaultTab});case`server-menu`:{let n=S(t.tools,i.server.name),r=i.server.transport===`claudeai-proxy`?`claude.ai`:`Claude Code`;return i.server.transport===`stdio`?(0,Z.jsx)(ge,{server:i.server,serverToolsCount:n.length,onViewTools:()=>a({type:`server-tools`,server:i.server}),onCancel:()=>a({type:`list`,defaultTab:r}),onComplete:e}):(0,Z.jsx)(fe,{server:i.server,serverToolsCount:n.length,onViewTools:()=>a({type:`server-tools`,server:i.server}),onCancel:()=>a({type:`list`,defaultTab:r}),onComplete:e})}case`server-tools`:return(0,Z.jsx)(he,{server:i.server,onSelectTool:(e,t)=>a({type:`server-tool-detail`,server:i.server,toolIndex:t}),onBack:()=>a({type:`server-menu`,server:i.server})});case`server-tool-detail`:{let e=S(t.tools,i.server.name)[i.toolIndex];return e?(0,Z.jsx)(ue,{tool:e,server:i.server,onBack:()=>a({type:`server-tools`,server:i.server})}):(a({type:`server-tools`,server:i.server}),null)}case`agent-server-menu`:return(0,Z.jsx)(ye,{agentServer:i.agentServer,onCancel:()=>a({type:`list`,defaultTab:`Agents`}),onComplete:e})}}var X,Z,Ce=e((()=>{X=t(a(),1),w(),N(),T(),ae(),B(),G(),ve(),L(),me(),de(),Z=g()})),we=e((()=>{B(),G(),J(),ve(),Ce(),L(),me(),de()}));function Te({action:e,target:t,onComplete:n}){let r=D(e=>e.mcp.clients),i=oe(),a=(0,Q.useRef)(!1);return(0,Q.useEffect)(()=>{if(a.current)return;a.current=!0;let o=e===`enable`,s=r.filter(e=>e.name!==`ide`),c=t===`all`?s.filter(e=>o?e.type===`disabled`:e.type!==`disabled`):s.filter(e=>e.name===t);if(c.length===0){n(t===`all`?`All MCP servers are already ${o?`enabled`:`disabled`}`:`MCP server "${t}" not found`);return}for(let e of c)i(e.name);n(t===`all`?`${o?`Enabled`:`Disabled`} ${c.length} MCP server(s)`:`MCP server "${t}" ${o?`enabled`:`disabled`}`)},[e,t,r,i,n]),null}async function Ee(e,t,n){if(n){let t=n.trim().split(/\s+/);if(t[0]===`no-redirect`)return(0,$.jsx)(Y,{onComplete:e});if(t[0]===`reconnect`&&t[1])return(0,$.jsx)(Se,{serverName:t.slice(1).join(` `),onComplete:e});if(t[0]===`enable`||t[0]===`disable`)return(0,$.jsx)(Te,{action:t[0],target:t.length>1?t.slice(1).join(` `):`all`,onComplete:e})}return process.env.USER_TYPE===`ant`?(0,$.jsx)(_e,{onComplete:e,args:`manage`,showMcpRedirectMessage:!0}):(0,$.jsx)(Y,{onComplete:e})}var Q,$;e((()=>{Q=t(a(),1),we(),J(),I(),T(),pe(),$=g()}))();export{Ee as call};
1
+ import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{n,t as r}from"./figures-gfT9mM8P.js";import{Q as i,Rn as a,T as o,b as s,f as c,g as l,h as u,nt as d,t as f,tt as p,v as m,x as h}from"./src-Di342QoJ.js";import{t as g}from"./jsx-runtime-D-D469L8.js";import{Do as _,Po as v,jo as y}from"./paths-q1-Ni8Oh.js";import{c as b,s as x}from"./debug-UI3T040K.js";import{$C as S,CC as C,DC as w,LS as T,Nx as E,OC as ee,RS as D,SC as O,Sy as k,WC as A,ZC as j,by as te,eC as M,my as ne,nw as N,tC as P,zS as re}from"./loadAgentsDir-Cl2w3uvH.js";import{D as ie,O as ae}from"./rcDebugLog-fhwD4wm-.js";import{t as F}from"./useKeybinding-FsOnjW6T.js";import{i as oe,n as I,r as se}from"./MCPConnectionManager-kVO-4BcA.js";import{n as ce,t as le}from"./McpParsingWarnings-D420-W8M.js";import{a as ue,c as L,i as de,l as fe,n as pe,o as me,r as he,s as ge,t as _e,u as ve}from"./PluginSettings-DhpNtjTm.js";function ye({agentServer:e,onCancel:t,onComplete:n}){let[a]=o(),[d,f]=(0,R.useState)(!1),[g,v]=(0,R.useState)(null),[y,b]=(0,R.useState)(null),x=(0,R.useRef)(null);(0,R.useEffect)(()=>()=>x.current?.abort(),[]),p(`confirm:no`,(0,R.useCallback)(()=>{d&&(x.current?.abort(),x.current=null,f(!1),b(null))},[d]),{context:`Confirmation`,isActive:d});let S=(0,R.useCallback)(async()=>{if(!e.needsAuth||!e.url)return;f(!0),v(null);let t=new AbortController;x.current=t;try{let r={type:e.transport,url:e.url};await ee(e.name,r,b,t.signal),n?.(`Authentication successful for ${e.name}. The server will connect when the agent runs.`)}catch(e){e instanceof Error&&!(e instanceof O)&&v(e.message)}finally{f(!1),x.current=null}},[e,n]),C=_(String(e.name));if(d)return(0,z.jsxs)(h,{flexDirection:`column`,gap:1,padding:1,children:[(0,z.jsxs)(s,{color:`claude`,children:[`Authenticating with `,e.name,`…`]}),(0,z.jsxs)(h,{children:[(0,z.jsx)(te,{}),(0,z.jsx)(s,{children:` A browser window will open for authentication`})]}),y&&(0,z.jsxs)(h,{flexDirection:`column`,children:[(0,z.jsx)(s,{dimColor:!0,children:`If your browser doesn't open automatically, copy this URL manually:`}),(0,z.jsx)(i,{url:y})]}),(0,z.jsx)(h,{marginLeft:3,children:(0,z.jsxs)(s,{dimColor:!0,children:[`Return here after authenticating in your browser.`,` `,(0,z.jsx)(M,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]})})]});let w=[];return e.needsAuth&&w.push({label:e.isAuthenticated?`Re-authenticate`:`Authenticate`,value:`auth`}),w.push({label:`Back`,value:`back`}),(0,z.jsxs)(c,{title:`${C} MCP Server`,subtitle:`agent-only`,onCancel:t,inputGuide:e=>e.pending?(0,z.jsxs)(s,{children:[`Press `,e.keyName,` again to exit`]}):(0,z.jsxs)(u,{children:[(0,z.jsx)(l,{shortcut:`↑↓`,action:`navigate`}),(0,z.jsx)(l,{shortcut:`Enter`,action:`confirm`}),(0,z.jsx)(M,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:[(0,z.jsxs)(h,{flexDirection:`column`,gap:0,children:[(0,z.jsxs)(h,{children:[(0,z.jsx)(s,{bold:!0,children:`Type: `}),(0,z.jsx)(s,{dimColor:!0,children:e.transport})]}),e.url&&(0,z.jsxs)(h,{children:[(0,z.jsx)(s,{bold:!0,children:`URL: `}),(0,z.jsx)(s,{dimColor:!0,children:e.url})]}),e.command&&(0,z.jsxs)(h,{children:[(0,z.jsx)(s,{bold:!0,children:`Command: `}),(0,z.jsx)(s,{dimColor:!0,children:e.command})]}),(0,z.jsxs)(h,{children:[(0,z.jsx)(s,{bold:!0,children:`Used by: `}),(0,z.jsx)(s,{dimColor:!0,children:e.sourceAgents.join(`, `)})]}),(0,z.jsxs)(h,{marginTop:1,children:[(0,z.jsx)(s,{bold:!0,children:`Status: `}),(0,z.jsxs)(s,{children:[m(`inactive`,a)(r.radioOff),` not connected (agent-only)`]})]}),e.needsAuth&&(0,z.jsxs)(h,{children:[(0,z.jsx)(s,{bold:!0,children:`Auth: `}),e.isAuthenticated?(0,z.jsxs)(s,{children:[m(`success`,a)(r.tick),` authenticated`]}):(0,z.jsxs)(s,{children:[m(`warning`,a)(r.triangleUpOutline),` may need authentication`]})]})]}),(0,z.jsx)(h,{children:(0,z.jsx)(s,{dimColor:!0,children:`This server connects only when running the agent.`})}),g&&(0,z.jsx)(h,{children:(0,z.jsxs)(s,{color:`error`,children:[`Error: `,g]})}),(0,z.jsx)(h,{children:(0,z.jsx)(E,{options:w,onChange:async e=>{switch(e){case`auth`:await S();break;case`back`:t();break}},onCancel:t})})]})}var R,z,B=e((()=>{n(),R=t(a(),1),f(),F(),w(),y(),P(),ne(),k(),z=g()}));function V(e){switch(e){case`project`:return{label:`Project MCPs`,path:A(e)};case`user`:return{label:`User MCPs`,path:A(e)};case`local`:return{label:`Local MCPs`,path:A(e)};case`enterprise`:return{label:`Enterprise MCPs`};case`dynamic`:return{label:`Built-in MCPs`,path:`always available`};default:return{label:e}}}function be(e){let t=new Map;for(let n of e){let e=n.scope;t.has(e)||t.set(e,[]),t.get(e).push(n)}for(let[,e]of t)e.sort((e,t)=>e.name.localeCompare(t.name));return t}function xe({servers:e,agentServers:t=[],onSelectServer:n,onSelectAgentServer:a,onComplete:f}){let[p]=o(),[g,_]=(0,H.useState)(0),y=H.useMemo(()=>be(e.filter(e=>e.client.config.type!==`claudeai-proxy`)),[e]),x=H.useMemo(()=>e.filter(e=>e.client.config.type===`claudeai-proxy`).sort((e,t)=>e.name.localeCompare(t.name)),[e]),S=H.useMemo(()=>(y.get(`dynamic`)??[]).sort((e,t)=>e.name.localeCompare(t.name)),[y]),C=V(`dynamic`),w=H.useMemo(()=>{let e=[];for(let t of W){let n=y.get(t)??[];for(let t of n)e.push({type:`server`,server:t})}for(let t of x)e.push({type:`server`,server:t});for(let n of t)e.push({type:`agent-server`,agentServer:n});for(let t of S)e.push({type:`server`,server:t});return e},[y,x,t,S]),T=(0,H.useCallback)(()=>{f(`MCP dialog dismissed`,{display:`system`})},[f]);d({"confirm:previous":()=>_(e=>e===0?w.length-1:e-1),"confirm:next":()=>_(e=>e===w.length-1?0:e+1),"confirm:yes":(0,H.useCallback)(()=>{let e=w[g];e&&(e.type===`server`?n(e.server):e.type===`agent-server`&&a&&a(e.agentServer))},[w,g,n,a]),"confirm:no":T},{context:`Confirmation`});let E=e=>w.findIndex(t=>t.type===`server`&&t.server===e),ee=e=>w.findIndex(t=>t.type===`agent-server`&&t.agentServer===e),D=b(),O=e.some(e=>e.client.type===`failed`);if(e.length===0&&t.length===0)return null;let k=e=>{let t=E(e),n=g===t,i=``,a=``;if(e.client.type===`disabled`)i=m(`inactive`,p)(r.radioOff),a=`disabled`;else if(e.client.type===`connected`)i=m(`success`,p)(r.tick),a=`connected`;else if(e.client.type===`pending`){i=m(`inactive`,p)(r.radioOff);let{reconnectAttempt:t,maxReconnectAttempts:n}=e.client;a=t&&n?`reconnecting (${t}/${n})…`:`connecting…`}else e.client.type===`needs-auth`?(i=m(`warning`,p)(r.triangleUpOutline),a=`needs authentication`):(i=m(`error`,p)(r.cross),a=`failed`);return(0,U.jsxs)(h,{children:[(0,U.jsx)(s,{color:n?`suggestion`:void 0,children:n?`${r.pointer} `:` `}),(0,U.jsx)(s,{color:n?`suggestion`:void 0,children:e.name}),(0,U.jsxs)(s,{dimColor:!n,children:[` · `,i,` `]}),(0,U.jsx)(s,{dimColor:!n,children:a})]},`${e.name}-${t}`)},A=e=>{let t=ee(e),n=g===t,i=e.needsAuth?m(`warning`,p)(r.triangleUpOutline):m(`inactive`,p)(r.radioOff),a=e.needsAuth?`may need auth`:`agent-only`;return(0,U.jsxs)(h,{children:[(0,U.jsx)(s,{color:n?`suggestion`:void 0,children:n?`${r.pointer} `:` `}),(0,U.jsx)(s,{color:n?`suggestion`:void 0,children:e.name}),(0,U.jsxs)(s,{dimColor:!n,children:[` · `,i,` `]}),(0,U.jsx)(s,{dimColor:!n,children:a})]},`agent-${e.name}-${t}`)},j=e.length+t.length;return(0,U.jsxs)(h,{flexDirection:`column`,children:[(0,U.jsx)(le,{}),(0,U.jsx)(c,{title:`Manage MCP servers`,subtitle:`${j} ${v(j,`server`)}`,onCancel:T,hideInputGuide:!0,children:(0,U.jsxs)(h,{flexDirection:`column`,children:[W.map(e=>{let t=y.get(e);if(!t||t.length===0)return null;let n=V(e);return(0,U.jsxs)(h,{flexDirection:`column`,marginBottom:1,children:[(0,U.jsxs)(h,{paddingLeft:2,children:[(0,U.jsx)(s,{bold:!0,children:n.label}),n.path&&(0,U.jsxs)(s,{dimColor:!0,children:[` (`,n.path,`)`]})]}),t.map(e=>k(e))]},e)}),x.length>0&&(0,U.jsxs)(h,{flexDirection:`column`,marginBottom:1,children:[(0,U.jsx)(h,{paddingLeft:2,children:(0,U.jsx)(s,{bold:!0,children:`claude.ai`})}),x.map(e=>k(e))]}),t.length>0&&(0,U.jsxs)(h,{flexDirection:`column`,marginBottom:1,children:[(0,U.jsx)(h,{paddingLeft:2,children:(0,U.jsx)(s,{bold:!0,children:`Agent MCPs`})}),[...new Set(t.flatMap(e=>e.sourceAgents))].map(e=>(0,U.jsxs)(h,{flexDirection:`column`,marginTop:1,children:[(0,U.jsx)(h,{paddingLeft:2,children:(0,U.jsxs)(s,{dimColor:!0,children:[`@`,e]})}),t.filter(t=>t.sourceAgents.includes(e)).map(e=>A(e))]},e))]}),S.length>0&&(0,U.jsxs)(h,{flexDirection:`column`,marginBottom:1,children:[(0,U.jsxs)(h,{paddingLeft:2,children:[(0,U.jsx)(s,{bold:!0,children:C.label}),C.path&&(0,U.jsxs)(s,{dimColor:!0,children:[` (`,C.path,`)`]})]}),S.map(e=>k(e))]}),(0,U.jsxs)(h,{flexDirection:`column`,children:[O&&(0,U.jsx)(s,{dimColor:!0,children:D?`※ Error logs shown inline with --debug`:`※ Run claude --debug to see error logs`}),(0,U.jsxs)(s,{dimColor:!0,children:[(0,U.jsx)(i,{url:`https://code.claude.com/docs/en/mcp`,children:`https://code.claude.com/docs/en/mcp`}),` for help`]})]})]})}),(0,U.jsx)(h,{paddingX:1,children:(0,U.jsx)(s,{dimColor:!0,italic:!0,children:(0,U.jsxs)(u,{children:[(0,U.jsx)(l,{shortcut:`↑↓`,action:`navigate`}),(0,U.jsx)(l,{shortcut:`Enter`,action:`confirm`}),(0,U.jsx)(M,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})})]})}var H,U,W,G=e((()=>{n(),H=t(a(),1),f(),F(),N(),x(),y(),P(),ce(),U=g(),W=[`project`,`local`,`user`,`enterprise`]}));function Se({serverName:e,onComplete:t}){let[n]=o(),i=re(),a=se(),[c,l]=(0,K.useState)(!0),[u,d]=(0,K.useState)(null);return(0,K.useEffect)(()=>{async function n(){try{if(!i.getState().mcp.clients.find(t=>t.name===e)){d(`MCP server "${e}" not found`),l(!1),t(`MCP server "${e}" not found`);return}switch((await a(e)).client.type){case`connected`:l(!1),t(`Successfully reconnected to ${e}`);break;case`needs-auth`:d(`${e} requires authentication`),l(!1),t(`${e} requires authentication. Use /mcp to authenticate.`);break;case`pending`:case`failed`:case`disabled`:d(`Failed to reconnect to ${e}`),l(!1),t(`Failed to reconnect to ${e}`);break}}catch(e){let n=e instanceof Error?e.message:String(e);d(n),l(!1),t(`Error: ${n}`)}}n()},[e,a,i,t]),c?(0,q.jsxs)(h,{flexDirection:`column`,gap:1,padding:1,children:[(0,q.jsxs)(s,{color:`text`,children:[`Reconnecting to `,(0,q.jsx)(s,{bold:!0,children:e})]}),(0,q.jsxs)(h,{children:[(0,q.jsx)(te,{}),(0,q.jsx)(s,{children:` Establishing connection to MCP server`})]})]}):u?(0,q.jsxs)(h,{flexDirection:`column`,gap:1,padding:1,children:[(0,q.jsxs)(h,{children:[(0,q.jsxs)(s,{children:[m(`error`,n)(r.cross),` `]}),(0,q.jsxs)(s,{color:`error`,children:[`Failed to reconnect to `,e]})]}),(0,q.jsxs)(s,{dimColor:!0,children:[`Error: `,u]})]}):null}var K,q,J=e((()=>{n(),K=t(a(),1),f(),I(),T(),k(),q=g()}));function Y({onComplete:e}){let t=D(e=>e.mcp),n=D(e=>e.agentDefinitions),r=t.clients,[i,a]=X.useState({type:`list`}),[o,s]=X.useState([]),c=(0,X.useMemo)(()=>j(n.allAgents),[n.allAgents]),l=X.useMemo(()=>r.filter(e=>e.name!==`ide`).sort((e,t)=>e.name.localeCompare(t.name)),[r]);switch(X.useEffect(()=>{let e=!1;async function n(){let n=await Promise.all(l.map(async e=>{let n=e.config.scope,r=e.config.type===`sse`,i=e.config.type===`http`,a=e.config.type===`claudeai-proxy`,o;if(r||i){let n=await new C(e.name,e.config).tokens(),r=ie()!==null&&e.type===`connected`,i=e.type===`connected`&&S(t.tools,e.name).length>0;o=!!n||r||i}let s={name:e.name,client:e,scope:n};return a?{...s,transport:`claudeai-proxy`,isAuthenticated:!1,config:e.config}:r?{...s,transport:`sse`,isAuthenticated:o,config:e.config}:i?{...s,transport:`http`,isAuthenticated:o,config:e.config}:{...s,transport:`stdio`,config:e.config}}));e||s(n)}return n(),()=>{e=!0}},[l,t.tools]),(0,X.useEffect)(()=>{o.length===0&&l.length>0||o.length===0&&c.length===0&&e("No MCP servers configured. Please run /doctor if this is unexpected. Otherwise, run `claude mcp --help` or visit https://code.claude.com/docs/en/mcp to learn more.")},[o.length,l.length,c.length,e]),i.type){case`list`:return(0,Z.jsx)(xe,{servers:o,agentServers:c,onSelectServer:e=>a({type:`server-menu`,server:e}),onSelectAgentServer:e=>a({type:`agent-server-menu`,agentServer:e}),onComplete:e,defaultTab:i.defaultTab});case`server-menu`:{let n=S(t.tools,i.server.name),r=i.server.transport===`claudeai-proxy`?`claude.ai`:`Claude Code`;return i.server.transport===`stdio`?(0,Z.jsx)(ge,{server:i.server,serverToolsCount:n.length,onViewTools:()=>a({type:`server-tools`,server:i.server}),onCancel:()=>a({type:`list`,defaultTab:r}),onComplete:e}):(0,Z.jsx)(fe,{server:i.server,serverToolsCount:n.length,onViewTools:()=>a({type:`server-tools`,server:i.server}),onCancel:()=>a({type:`list`,defaultTab:r}),onComplete:e})}case`server-tools`:return(0,Z.jsx)(he,{server:i.server,onSelectTool:(e,t)=>a({type:`server-tool-detail`,server:i.server,toolIndex:t}),onBack:()=>a({type:`server-menu`,server:i.server})});case`server-tool-detail`:{let e=S(t.tools,i.server.name)[i.toolIndex];return e?(0,Z.jsx)(ue,{tool:e,server:i.server,onBack:()=>a({type:`server-tools`,server:i.server})}):(a({type:`server-tools`,server:i.server}),null)}case`agent-server-menu`:return(0,Z.jsx)(ye,{agentServer:i.agentServer,onCancel:()=>a({type:`list`,defaultTab:`Agents`}),onComplete:e})}}var X,Z,Ce=e((()=>{X=t(a(),1),w(),N(),T(),ae(),B(),G(),ve(),L(),me(),de(),Z=g()})),we=e((()=>{B(),G(),J(),ve(),Ce(),L(),me(),de()}));function Te({action:e,target:t,onComplete:n}){let r=D(e=>e.mcp.clients),i=oe(),a=(0,Q.useRef)(!1);return(0,Q.useEffect)(()=>{if(a.current)return;a.current=!0;let o=e===`enable`,s=r.filter(e=>e.name!==`ide`),c=t===`all`?s.filter(e=>o?e.type===`disabled`:e.type!==`disabled`):s.filter(e=>e.name===t);if(c.length===0){n(t===`all`?`All MCP servers are already ${o?`enabled`:`disabled`}`:`MCP server "${t}" not found`);return}for(let e of c)i(e.name);n(t===`all`?`${o?`Enabled`:`Disabled`} ${c.length} MCP server(s)`:`MCP server "${t}" ${o?`enabled`:`disabled`}`)},[e,t,r,i,n]),null}async function Ee(e,t,n){if(n){let t=n.trim().split(/\s+/);if(t[0]===`no-redirect`)return(0,$.jsx)(Y,{onComplete:e});if(t[0]===`reconnect`&&t[1])return(0,$.jsx)(Se,{serverName:t.slice(1).join(` `),onComplete:e});if(t[0]===`enable`||t[0]===`disable`)return(0,$.jsx)(Te,{action:t[0],target:t.length>1?t.slice(1).join(` `):`all`,onComplete:e})}return process.env.USER_TYPE===`ant`?(0,$.jsx)(_e,{onComplete:e,args:`manage`,showMcpRedirectMessage:!0}):(0,$.jsx)(Y,{onComplete:e})}var Q,$;e((()=>{Q=t(a(),1),we(),J(),I(),T(),pe(),$=g()}))();export{Ee as call};
@@ -1 +1 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{B as t,M as n}from"./server-DzOdtq8A.js";import{Ac as r,M as i,_c as a,z as o}from"./paths-o5iA-EnQ.js";import{d as s,s as c}from"./debug-UI3T040K.js";import{r as l,t as u}from"./datadog-Bb65d6yd.js";import{i as d,r as f,t as p}from"./src-BlLavFUS.js";import{i as m,t as h}from"./gates-CAVdjC23.js";import{n as g,t as _}from"./hostAdapter-D9_d4gU0.js";import{n as v,t as y}from"./stdio-BEEzuxaZ.js";import{r as b,t as x}from"./sink-BKc24wdw.js";import{homedir as S}from"os";function C(e,t){if(k.some(t=>e.startsWith(t)))return!0;if(t){let n=t.endsWith(`/`)?`${t}Applications/`:`${t}/Applications/`;if(e.startsWith(n))return!0}return!1}function w(e){return A.some(t=>t.test(e))}function T(e,t){let n=new Set;return e.map(e=>e.trim()).filter(e=>!e||e.length>N||t&&!M.test(e)||n.has(e)?!1:(n.add(e),!0)).sort((e,t)=>e.localeCompare(t))}function E(e){let t=T(e,!0);return t.length<=P?t:[...t.slice(0,P),`… and ${t.length-P} more`]}function D(e){return T(e,!1)}function O(e,t){let{alwaysKept:n,rest:r}=e.reduce((e,n)=>(j.has(n.bundleId)?e.alwaysKept.push(n.displayName):C(n.path,t)&&!w(n.displayName)&&e.rest.push(n.displayName),e),{alwaysKept:[],rest:[]}),i=D(n),a=new Set(i);return[...i,...E(r).filter(e=>!a.has(e))]}var k,A,j,M,N,P,F=e((()=>{k=[`/Applications/`,`/System/Applications/`],A=[/Helper(?:$|\s\()/,/Agent(?:$|\s\()/,/Service(?:$|\s\()/,/Uninstaller(?:$|\s\()/,/Updater(?:$|\s\()/,/^\./],j=new Set(`com.apple.Safari,com.google.Chrome,com.microsoft.edgemac,org.mozilla.firefox,company.thebrowser.Browser,com.tinyspeck.slackmacgap,us.zoom.xos,com.microsoft.teams2,com.microsoft.teams,com.apple.MobileSMS,com.apple.mail,com.microsoft.Word,com.microsoft.Excel,com.microsoft.Powerpoint,com.microsoft.Outlook,com.apple.iWork.Pages,com.apple.iWork.Numbers,com.apple.iWork.Keynote,com.google.GoogleDocs,notion.id,com.apple.Notes,md.obsidian,com.linear,com.figma.Desktop,com.microsoft.VSCode,com.apple.Terminal,com.googlecode.iterm2,com.github.GitHubDesktop,com.apple.finder,com.apple.iCal,com.apple.systempreferences`.split(`,`)),M=/^[\p{L}\p{M}\p{N}_ .&'()+-]+$/u,N=40,P=50}));async function I(){let e=_().executor.listInstalledApps(),t,n=new Promise(e=>{t=setTimeout(e,z,void 0)}),r=await Promise.race([e,n]).catch(()=>void 0).finally(()=>clearTimeout(t));if(!r){e.catch(()=>{}),s(`[Computer Use MCP] app enumeration exceeded ${z}ms or failed; tool description omits list`);return}return O(r,S())}async function L(){let e=_(),t=h(),r=f(e,t),i=await I(),a=d(e.executor.capabilities,t,i);return r.setRequestHandler(n,async()=>e.isDisabled()?{tools:[]}:{tools:a}),r}async function R(){a(),b();let e=await L(),t=new y,n=!1,r=async()=>{n||(n=!0,await Promise.all([o(),l()]),process.exit(0))};process.stdin.on(`end`,()=>void r()),process.stdin.on(`error`,()=>void r()),s(`[Computer Use MCP] Starting MCP server`),await e.connect(t),s(`[Computer Use MCP] MCP server started`)}var z;e((()=>{p(),x(),v(),t(),u(),i(),r(),c(),F(),m(),g(),z=1e3}))();export{L as createComputerUseMcpServerForCli,R as runComputerUseMcpServer};
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{B as t,M as n}from"./server-DzOdtq8A.js";import{Ac as r,M as i,_c as a,z as o}from"./paths-q1-Ni8Oh.js";import{d as s,s as c}from"./debug-UI3T040K.js";import{r as l,t as u}from"./datadog-BFSdlK6C.js";import{i as d,r as f,t as p}from"./src-BlLavFUS.js";import{i as m,t as h}from"./gates-DI4pxvrD.js";import{n as g,t as _}from"./hostAdapter-D3s4JFk-.js";import{n as v,t as y}from"./stdio-BEEzuxaZ.js";import{r as b,t as x}from"./sink-DpAjuilF.js";import{homedir as S}from"os";function C(e,t){if(k.some(t=>e.startsWith(t)))return!0;if(t){let n=t.endsWith(`/`)?`${t}Applications/`:`${t}/Applications/`;if(e.startsWith(n))return!0}return!1}function w(e){return A.some(t=>t.test(e))}function T(e,t){let n=new Set;return e.map(e=>e.trim()).filter(e=>!e||e.length>N||t&&!M.test(e)||n.has(e)?!1:(n.add(e),!0)).sort((e,t)=>e.localeCompare(t))}function E(e){let t=T(e,!0);return t.length<=P?t:[...t.slice(0,P),`… and ${t.length-P} more`]}function D(e){return T(e,!1)}function O(e,t){let{alwaysKept:n,rest:r}=e.reduce((e,n)=>(j.has(n.bundleId)?e.alwaysKept.push(n.displayName):C(n.path,t)&&!w(n.displayName)&&e.rest.push(n.displayName),e),{alwaysKept:[],rest:[]}),i=D(n),a=new Set(i);return[...i,...E(r).filter(e=>!a.has(e))]}var k,A,j,M,N,P,F=e((()=>{k=[`/Applications/`,`/System/Applications/`],A=[/Helper(?:$|\s\()/,/Agent(?:$|\s\()/,/Service(?:$|\s\()/,/Uninstaller(?:$|\s\()/,/Updater(?:$|\s\()/,/^\./],j=new Set(`com.apple.Safari,com.google.Chrome,com.microsoft.edgemac,org.mozilla.firefox,company.thebrowser.Browser,com.tinyspeck.slackmacgap,us.zoom.xos,com.microsoft.teams2,com.microsoft.teams,com.apple.MobileSMS,com.apple.mail,com.microsoft.Word,com.microsoft.Excel,com.microsoft.Powerpoint,com.microsoft.Outlook,com.apple.iWork.Pages,com.apple.iWork.Numbers,com.apple.iWork.Keynote,com.google.GoogleDocs,notion.id,com.apple.Notes,md.obsidian,com.linear,com.figma.Desktop,com.microsoft.VSCode,com.apple.Terminal,com.googlecode.iterm2,com.github.GitHubDesktop,com.apple.finder,com.apple.iCal,com.apple.systempreferences`.split(`,`)),M=/^[\p{L}\p{M}\p{N}_ .&'()+-]+$/u,N=40,P=50}));async function I(){let e=_().executor.listInstalledApps(),t,n=new Promise(e=>{t=setTimeout(e,z,void 0)}),r=await Promise.race([e,n]).catch(()=>void 0).finally(()=>clearTimeout(t));if(!r){e.catch(()=>{}),s(`[Computer Use MCP] app enumeration exceeded ${z}ms or failed; tool description omits list`);return}return O(r,S())}async function L(){let e=_(),t=h(),r=f(e,t),i=await I(),a=d(e.executor.capabilities,t,i);return r.setRequestHandler(n,async()=>e.isDisabled()?{tools:[]}:{tools:a}),r}async function R(){a(),b();let e=await L(),t=new y,n=!1,r=async()=>{n||(n=!0,await Promise.all([o(),l()]),process.exit(0))};process.stdin.on(`end`,()=>void r()),process.stdin.on(`error`,()=>void r()),s(`[Computer Use MCP] Starting MCP server`),await e.connect(t),s(`[Computer Use MCP] MCP server started`)}var z;e((()=>{p(),x(),v(),t(),u(),i(),r(),c(),F(),m(),g(),z=1e3}))();export{L as createComputerUseMcpServerForCli,R as runComputerUseMcpServer};
@@ -1 +1 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{s as t,u as n}from"./envUtils-BWeoiL4Y.js";import{r,t as i}from"./src-BJz1KAd_.js";import{Ac as a,Jt as o,M as s,Pc as c,S as l,Sc as u,_ as d,_c as f,on as p,z as m}from"./paths-o5iA-EnQ.js";import{d as h,s as g}from"./debug-UI3T040K.js";import{n as _,r as v}from"./analytics-DqMQntaB.js";import{f_ as y,p_ as b}from"./loadAgentsDir-DF6FgRn-.js";import{r as x,t as S}from"./datadog-Bb65d6yd.js";import{c as C,i as w,o as T}from"./common-CMCv4N_v.js";import{n as E,t as D}from"./stdio-BEEzuxaZ.js";import{r as O,t as k}from"./sink-BKc24wdw.js";import{format as A}from"util";function j(e){return z.some(t=>t===e)}function M(){if(process.env.USER_TYPE===`ant`||d(`tengu_copper_bridge`,!1))return n(process.env.USE_LOCAL_OAUTH)||n(process.env.LOCAL_BRIDGE)?`ws://localhost:8765`:n(process.env.USE_STAGING_OAUTH)?`wss://bridge-staging.claudeusercontent.com`:`wss://bridge.claudeusercontent.com`}function N(){return n(process.env.USE_LOCAL_OAUTH)||n(process.env.LOCAL_BRIDGE)}function P(e){let t=new B,n=M();t.info(`Bridge URL: ${n??`none (using native socket)`}`);let r=e?.CLAUDE_CHROME_PERMISSION_MODE??process.env.CLAUDE_CHROME_PERMISSION_MODE,i;return r&&(j(r)?i=r:t.warn(`Invalid CLAUDE_CHROME_PERMISSION_MODE "${r}". Valid values: ${z.join(`, `)}`)),{serverName:`Claude in Chrome`,logger:t,socketPath:T(),getSocketPaths:w,clientTypeId:`claude-code`,onAuthenticationError:()=>{t.warn(`Authentication error occurred. Please ensure you are logged into the Claude browser extension with the same claude.ai account as Claude Code.`)},onToolCallDisconnected:()=>`Browser extension is not connected. Please ensure the Claude browser extension is installed and running (${I}), and that you are logged into claude.ai with the same account as Claude Code. If this is your first time connecting to Chrome, you may need to restart Chrome for the installation to take effect. If you continue to experience issues, please report a bug: ${L}`,onExtensionPaired:(e,n)=>{c(t=>t.chromeExtension?.pairedDeviceId===e&&t.chromeExtension?.pairedDeviceName===n?t:{...t,chromeExtension:{pairedDeviceId:e,pairedDeviceName:n}}),t.info(`Paired with "${n}" (${e.slice(0,8)})`)},getPersistedDeviceId:()=>u().chromeExtension?.pairedDeviceId,...n&&{bridgeConfig:{url:n,getUserId:async()=>u().oauthAccount?.accountUuid,getOAuthToken:async()=>o()?.accessToken??``,...N()&&{devUserId:`dev_user_local`}}},...i&&{initialPermissionMode:i},...process.env.USER_TYPE===`ant`&&{callAnthropicMessages:async e=>{let t=await b({model:e.model,system:e.system,messages:e.messages,max_tokens:e.max_tokens,stop_sequences:e.stop_sequences,signal:e.signal,skipSystemPromptPrefix:!0,tools:[],querySource:`chrome_mcp`}),n=[];for(let e of t.content)e.type===`text`&&n.push({type:`text`,text:e.text});return{content:n,stop_reason:t.stop_reason,usage:{input_tokens:t.usage.input_tokens,output_tokens:t.usage.output_tokens}}}},trackEvent:(e,t)=>{let n={};if(t)for(let[e,r]of Object.entries(t)){let t=e===`status`?`bridge_status`:e;(typeof r==`boolean`||typeof r==`number`||typeof r==`string`&&R.has(t))&&(n[t]=r)}v(e,n)}}}async function F(){f(),O();let e=r(P()),t=new D,n=!1,i=async()=>{n||(n=!0,await m(),await x(),process.exit(0))};process.stdin.on(`end`,()=>void i()),process.stdin.on(`error`,()=>void i()),h(`[Claude in Chrome] Starting MCP server`),await e.connect(t),h(`[Claude in Chrome] MCP server started`)}var I,L,R,z,B;e((()=>{i(),k(),E(),S(),s(),l(),_(),p(),a(),g(),t(),y(),C(),I=`https://claude.ai/chrome`,L=`https://github.com/anthropics/claude-code/issues/new?labels=bug,claude-in-chrome`,R=new Set([`bridge_status`,`error_type`,`tool_name`]),z=[`ask`,`skip_all_permission_checks`,`follow_a_plan`],B=class{silly(e,t){h(A(e,t??``),{level:`debug`})}debug(e,t){h(A(e,t??``),{level:`debug`})}info(e,t){h(A(e,t??``),{level:`info`})}warn(e,t){h(A(e,t??``),{level:`warn`})}error(e,t){h(A(e,t??``),{level:`error`})}}}))();export{P as createChromeContext,F as runClaudeInChromeMcpServer};
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{s as t,u as n}from"./envUtils-BWeoiL4Y.js";import{r,t as i}from"./src-BJz1KAd_.js";import{Ac as a,Jt as o,M as s,Pc as c,S as l,Sc as u,_ as d,_c as f,on as p,z as m}from"./paths-q1-Ni8Oh.js";import{d as h,s as g}from"./debug-UI3T040K.js";import{n as _,r as v}from"./analytics-DqMQntaB.js";import{f_ as y,p_ as b}from"./loadAgentsDir-Cl2w3uvH.js";import{r as x,t as S}from"./datadog-BFSdlK6C.js";import{c as C,i as w,o as T}from"./common-CMCv4N_v.js";import{n as E,t as D}from"./stdio-BEEzuxaZ.js";import{r as O,t as k}from"./sink-DpAjuilF.js";import{format as A}from"util";function j(e){return z.some(t=>t===e)}function M(){if(process.env.USER_TYPE===`ant`||d(`tengu_copper_bridge`,!1))return n(process.env.USE_LOCAL_OAUTH)||n(process.env.LOCAL_BRIDGE)?`ws://localhost:8765`:n(process.env.USE_STAGING_OAUTH)?`wss://bridge-staging.claudeusercontent.com`:`wss://bridge.claudeusercontent.com`}function N(){return n(process.env.USE_LOCAL_OAUTH)||n(process.env.LOCAL_BRIDGE)}function P(e){let t=new B,n=M();t.info(`Bridge URL: ${n??`none (using native socket)`}`);let r=e?.CLAUDE_CHROME_PERMISSION_MODE??process.env.CLAUDE_CHROME_PERMISSION_MODE,i;return r&&(j(r)?i=r:t.warn(`Invalid CLAUDE_CHROME_PERMISSION_MODE "${r}". Valid values: ${z.join(`, `)}`)),{serverName:`Claude in Chrome`,logger:t,socketPath:T(),getSocketPaths:w,clientTypeId:`claude-code`,onAuthenticationError:()=>{t.warn(`Authentication error occurred. Please ensure you are logged into the Claude browser extension with the same claude.ai account as Claude Code.`)},onToolCallDisconnected:()=>`Browser extension is not connected. Please ensure the Claude browser extension is installed and running (${I}), and that you are logged into claude.ai with the same account as Claude Code. If this is your first time connecting to Chrome, you may need to restart Chrome for the installation to take effect. If you continue to experience issues, please report a bug: ${L}`,onExtensionPaired:(e,n)=>{c(t=>t.chromeExtension?.pairedDeviceId===e&&t.chromeExtension?.pairedDeviceName===n?t:{...t,chromeExtension:{pairedDeviceId:e,pairedDeviceName:n}}),t.info(`Paired with "${n}" (${e.slice(0,8)})`)},getPersistedDeviceId:()=>u().chromeExtension?.pairedDeviceId,...n&&{bridgeConfig:{url:n,getUserId:async()=>u().oauthAccount?.accountUuid,getOAuthToken:async()=>o()?.accessToken??``,...N()&&{devUserId:`dev_user_local`}}},...i&&{initialPermissionMode:i},...process.env.USER_TYPE===`ant`&&{callAnthropicMessages:async e=>{let t=await b({model:e.model,system:e.system,messages:e.messages,max_tokens:e.max_tokens,stop_sequences:e.stop_sequences,signal:e.signal,skipSystemPromptPrefix:!0,tools:[],querySource:`chrome_mcp`}),n=[];for(let e of t.content)e.type===`text`&&n.push({type:`text`,text:e.text});return{content:n,stop_reason:t.stop_reason,usage:{input_tokens:t.usage.input_tokens,output_tokens:t.usage.output_tokens}}}},trackEvent:(e,t)=>{let n={};if(t)for(let[e,r]of Object.entries(t)){let t=e===`status`?`bridge_status`:e;(typeof r==`boolean`||typeof r==`number`||typeof r==`string`&&R.has(t))&&(n[t]=r)}v(e,n)}}}async function F(){f(),O();let e=r(P()),t=new D,n=!1,i=async()=>{n||(n=!0,await m(),await x(),process.exit(0))};process.stdin.on(`end`,()=>void i()),process.stdin.on(`error`,()=>void i()),h(`[Claude in Chrome] Starting MCP server`),await e.connect(t),h(`[Claude in Chrome] MCP server started`)}var I,L,R,z,B;e((()=>{i(),k(),E(),S(),s(),l(),_(),p(),a(),g(),t(),y(),C(),I=`https://claude.ai/chrome`,L=`https://github.com/anthropics/claude-code/issues/new?labels=bug,claude-in-chrome`,R=new Set([`bridge_status`,`error_type`,`tool_name`]),z=[`ask`,`skip_all_permission_checks`,`follow_a_plan`],B=class{silly(e,t){h(A(e,t??``),{level:`debug`})}debug(e,t){h(A(e,t??``),{level:`debug`})}info(e,t){h(A(e,t??``),{level:`info`})}warn(e,t){h(A(e,t??``),{level:`warn`})}error(e,t){h(A(e,t??``),{level:`error`})}}}))();export{P as createChromeContext,F as runClaudeInChromeMcpServer};
@@ -1 +1 @@
1
- import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{n,s as r}from"./envUtils-BWeoiL4Y.js";import{In as i,Ln as a,Q as o,Rn as s,b as c,d as l,f as u,t as d,tt as f,x as p}from"./src-Di342QoJ.js";import{t as m}from"./jsx-runtime-D-D469L8.js";import{cn as h,ot as g}from"./state-sIHsFpDu.js";import{Zc as ee,a as _,el as v,lo as y,n as te,oo as b,s as x}from"./paths-o5iA-EnQ.js";import{R as S,V as C}from"./debug-UI3T040K.js";import{n as w,r as T}from"./analytics-DqMQntaB.js";import{n as E,t as D}from"./cwd--iizewsn.js";import{r as O,v as k}from"./git-CN3qtTb_.js";import{o as A,s as j}from"./log-CzsijfHZ.js";import{g as M,x as N}from"./startupProfiler-DnXZaX4A.js";import{Dk as P,Hn as ne,LS as F,Nx as re,RS as I,Sk as L,Tk as R,Wn as z,eu as B,lp as ie,my as ae,tu as oe,up as se}from"./loadAgentsDir-DF6FgRn-.js";import{r as ce,t as le}from"./browser-fLRXxIsQ.js";import{t as V}from"./useKeybinding-FsOnjW6T.js";import{l as H,u as U}from"./referral-BADm5sBf.js";import{r as ue,t as de}from"./promptEditor-B3S5E5Q7.js";import{homedir as fe}from"os";import{join as W,relative as pe}from"path";import{mkdir as G,writeFile as me}from"fs/promises";function he(e){return O(e)!==null}var ge=e((()=>{k()}));function _e({onSelect:e,onCancel:t}){let r=(0,K.use)(R()),a=W(n(),`CLAUDE.md`),o=W(g(),`CLAUDE.md`),s=r.some(e=>e.path===a),u=r.some(e=>e.path===o),d=[...r.filter(e=>e.type!==`AutoMem`&&e.type!==`TeamMem`).map(e=>({...e,exists:!0})),...s?[]:[{path:a,type:`User`,content:``,exists:!1}],...u?[]:[{path:o,type:`Project`,content:``,exists:!1}]],m=new Map,h=d.map(e=>{let t=ee(e.path),n=e.exists?``:` (new)`,r=e.parent?(m.get(e.parent)??0)+1:0;m.set(e.path,r);let i=r>0?` `.repeat(r-1):``,s;s=e.type===`User`&&!e.isNested&&e.path===a?`User memory`:e.type===`Project`&&!e.isNested&&e.path===o?`Project memory`:r>0?`${i}L ${t}${n}`:`${t}`;let c,l=he(g());return c=e.type===`User`&&!e.isNested?`Saved in ~/.claude/CLAUDE.md`:e.type===`Project`&&!e.isNested&&e.path===o?`${l?`Checked in at`:`Saved in`} ./CLAUDE.md`:e.parent?`@-imported`:e.isNested?`dynamically loaded`:``,{label:s,value:e.path,description:c}}),_=[],v=I(e=>e.agentDefinitions);if(x()){_.push({label:`Open auto-memory folder`,value:`${Y}${te()}`,description:``});for(let e of v.activeAgents)if(e.memory){let t=ne(e.agentType,e.memory);_.push({label:`Open ${i.bold(e.agentType)} agent memory`,value:`${Y}${t}`,description:`${e.memory} scope`})}}h.push(..._);let b=J&&h.some(e=>e.value===J)?J:h[0]?.value||``,[S,C]=(0,K.useState)(x),[w,E]=(0,K.useState)(oe),[D]=(0,K.useState)(x),O=I(e=>Object.values(e.tasks).some(e=>e.type===`dream`&&e.status===`running`)),[k,A]=(0,K.useState)(null);(0,K.useEffect)(()=>{D&&se().then(A)},[D,O]);let j=O?`running`:k===null?``:k===0?`never`:`last ran ${M(new Date(k))}`,[N,P]=(0,K.useState)(null),F=N!==null,L=+!!D;function z(){let e=!S;y(`userSettings`,{autoMemoryEnabled:e}),C(e),T(`tengu_auto_memory_toggled`,{enabled:e})}function B(){let e=!w;y(`userSettings`,{autoDreamEnabled:e}),E(e),T(`tengu_auto_dream_toggled`,{enabled:e})}return U(),f(`confirm:no`,t,{context:`Confirmation`}),f(`confirm:yes`,()=>{N===0?z():N===1&&B()},{context:`Confirmation`,isActive:F}),f(`select:next`,()=>{P(e=>e!==null&&e<L?e+1:null)},{context:`Select`,isActive:F}),f(`select:previous`,()=>{P(e=>e!==null&&e>0?e-1:e)},{context:`Select`,isActive:F}),(0,q.jsxs)(p,{flexDirection:`column`,width:`100%`,children:[(0,q.jsxs)(p,{flexDirection:`column`,marginBottom:1,children:[(0,q.jsx)(l,{isFocused:N===0,children:(0,q.jsxs)(c,{children:[`Auto-memory: `,S?`on`:`off`]})}),D&&(0,q.jsx)(l,{isFocused:N===1,styled:!1,children:(0,q.jsxs)(c,{color:N===1?`suggestion`:void 0,children:[`Auto-dream: `,w?`on`:`off`,j&&(0,q.jsxs)(c,{dimColor:!0,children:[` · `,j]}),!O&&w&&(0,q.jsx)(c,{dimColor:!0,children:` · /dream to run`})]})})]}),(0,q.jsx)(re,{defaultFocusValue:b,options:h,isDisabled:F,onChange:t=>{if(t.startsWith(Y)){let e=t.slice(15);G(e,{recursive:!0}).catch(()=>{}).then(()=>ce(e));return}J=t,e(t)},onCancel:t,onUpFromFirstItem:()=>P(L)})]})}var K,q,J,Y,X=e((()=>{a(),s(),K=t(s(),1),h(),H(),d(),V(),_(),w(),B(),ie(),F(),z(),le(),P(),r(),v(),N(),ge(),b(),ae(),q=m(),Y=`__open_folder__`}));function ve(e){let t=fe(),n=D(),r=e.startsWith(t)?`~`+e.slice(t.length):null,i=e.startsWith(n)?`./`+pe(n,e):null;return r&&i?r.length<=i.length?r:i:r||i||e}var ye=e((()=>{s(),d(),E(),m()}));function be({onDone:e}){let t=async t=>{try{t.includes(n())&&await G(n(),{recursive:!0});try{await me(t,``,{encoding:`utf8`,flag:`wx`})}catch(e){if(S(e)!==`EEXIST`)throw e}await de(t);let r=`default`,i=``;process.env.VISUAL?(r=`$VISUAL`,i=process.env.VISUAL):process.env.EDITOR&&(r=`$EDITOR`,i=process.env.EDITOR);let a=r===`default`?``:`Using ${r}="${i}".`,o=a?`> ${a} To change editor, set $EDITOR or $VISUAL environment variable.`:`> To use a different editor, set the $EDITOR or $VISUAL environment variable.`;e(`Opened memory file at ${ve(t)}\n\n${o}`,{display:`system`})}catch(t){j(t),e(`Error opening memory file: ${t}`)}},r=()=>{e(`Cancelled memory editing`,{display:`system`})};return(0,Q.jsx)(u,{title:`Memory`,onCancel:r,color:`remember`,children:(0,Q.jsxs)(p,{flexDirection:`column`,children:[(0,Q.jsx)(Z.Suspense,{fallback:null,children:(0,Q.jsx)(_e,{onSelect:t,onCancel:r})}),(0,Q.jsx)(p,{marginTop:1,children:(0,Q.jsxs)(c,{dimColor:!0,children:[`Learn more: `,(0,Q.jsx)(o,{url:`https://code.claude.com/docs/en/memory`})]})})]})})}var Z,Q,$;e((()=>{Z=t(s(),1),d(),X(),ye(),P(),r(),C(),A(),ue(),Q=m(),$=async e=>(L(),await R(),(0,Q.jsx)(be,{onDone:e}))}))();export{$ as call};
1
+ import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{n,s as r}from"./envUtils-BWeoiL4Y.js";import{In as i,Ln as a,Q as o,Rn as s,b as c,d as l,f as u,t as d,tt as f,x as p}from"./src-Di342QoJ.js";import{t as m}from"./jsx-runtime-D-D469L8.js";import{cn as h,ot as g}from"./state-sIHsFpDu.js";import{Zc as ee,a as _,el as v,lo as y,n as te,oo as b,s as x}from"./paths-q1-Ni8Oh.js";import{R as S,V as C}from"./debug-UI3T040K.js";import{n as w,r as T}from"./analytics-DqMQntaB.js";import{n as E,t as D}from"./cwd--iizewsn.js";import{r as O,v as k}from"./git-CN3qtTb_.js";import{o as A,s as j}from"./log-CzsijfHZ.js";import{g as M,x as N}from"./startupProfiler-DnXZaX4A.js";import{Dk as P,Hn as ne,LS as F,Nx as re,RS as I,Sk as L,Tk as R,Wn as z,eu as B,lp as ie,my as ae,tu as oe,up as se}from"./loadAgentsDir-Cl2w3uvH.js";import{r as ce,t as le}from"./browser-fLRXxIsQ.js";import{t as V}from"./useKeybinding-FsOnjW6T.js";import{l as H,u as U}from"./referral-rRvT6UDX.js";import{r as ue,t as de}from"./promptEditor-ClGwMkWl.js";import{homedir as fe}from"os";import{join as W,relative as pe}from"path";import{mkdir as G,writeFile as me}from"fs/promises";function he(e){return O(e)!==null}var ge=e((()=>{k()}));function _e({onSelect:e,onCancel:t}){let r=(0,K.use)(R()),a=W(n(),`CLAUDE.md`),o=W(g(),`CLAUDE.md`),s=r.some(e=>e.path===a),u=r.some(e=>e.path===o),d=[...r.filter(e=>e.type!==`AutoMem`&&e.type!==`TeamMem`).map(e=>({...e,exists:!0})),...s?[]:[{path:a,type:`User`,content:``,exists:!1}],...u?[]:[{path:o,type:`Project`,content:``,exists:!1}]],m=new Map,h=d.map(e=>{let t=ee(e.path),n=e.exists?``:` (new)`,r=e.parent?(m.get(e.parent)??0)+1:0;m.set(e.path,r);let i=r>0?` `.repeat(r-1):``,s;s=e.type===`User`&&!e.isNested&&e.path===a?`User memory`:e.type===`Project`&&!e.isNested&&e.path===o?`Project memory`:r>0?`${i}L ${t}${n}`:`${t}`;let c,l=he(g());return c=e.type===`User`&&!e.isNested?`Saved in ~/.claude/CLAUDE.md`:e.type===`Project`&&!e.isNested&&e.path===o?`${l?`Checked in at`:`Saved in`} ./CLAUDE.md`:e.parent?`@-imported`:e.isNested?`dynamically loaded`:``,{label:s,value:e.path,description:c}}),_=[],v=I(e=>e.agentDefinitions);if(x()){_.push({label:`Open auto-memory folder`,value:`${Y}${te()}`,description:``});for(let e of v.activeAgents)if(e.memory){let t=ne(e.agentType,e.memory);_.push({label:`Open ${i.bold(e.agentType)} agent memory`,value:`${Y}${t}`,description:`${e.memory} scope`})}}h.push(..._);let b=J&&h.some(e=>e.value===J)?J:h[0]?.value||``,[S,C]=(0,K.useState)(x),[w,E]=(0,K.useState)(oe),[D]=(0,K.useState)(x),O=I(e=>Object.values(e.tasks).some(e=>e.type===`dream`&&e.status===`running`)),[k,A]=(0,K.useState)(null);(0,K.useEffect)(()=>{D&&se().then(A)},[D,O]);let j=O?`running`:k===null?``:k===0?`never`:`last ran ${M(new Date(k))}`,[N,P]=(0,K.useState)(null),F=N!==null,L=+!!D;function z(){let e=!S;y(`userSettings`,{autoMemoryEnabled:e}),C(e),T(`tengu_auto_memory_toggled`,{enabled:e})}function B(){let e=!w;y(`userSettings`,{autoDreamEnabled:e}),E(e),T(`tengu_auto_dream_toggled`,{enabled:e})}return U(),f(`confirm:no`,t,{context:`Confirmation`}),f(`confirm:yes`,()=>{N===0?z():N===1&&B()},{context:`Confirmation`,isActive:F}),f(`select:next`,()=>{P(e=>e!==null&&e<L?e+1:null)},{context:`Select`,isActive:F}),f(`select:previous`,()=>{P(e=>e!==null&&e>0?e-1:e)},{context:`Select`,isActive:F}),(0,q.jsxs)(p,{flexDirection:`column`,width:`100%`,children:[(0,q.jsxs)(p,{flexDirection:`column`,marginBottom:1,children:[(0,q.jsx)(l,{isFocused:N===0,children:(0,q.jsxs)(c,{children:[`Auto-memory: `,S?`on`:`off`]})}),D&&(0,q.jsx)(l,{isFocused:N===1,styled:!1,children:(0,q.jsxs)(c,{color:N===1?`suggestion`:void 0,children:[`Auto-dream: `,w?`on`:`off`,j&&(0,q.jsxs)(c,{dimColor:!0,children:[` · `,j]}),!O&&w&&(0,q.jsx)(c,{dimColor:!0,children:` · /dream to run`})]})})]}),(0,q.jsx)(re,{defaultFocusValue:b,options:h,isDisabled:F,onChange:t=>{if(t.startsWith(Y)){let e=t.slice(15);G(e,{recursive:!0}).catch(()=>{}).then(()=>ce(e));return}J=t,e(t)},onCancel:t,onUpFromFirstItem:()=>P(L)})]})}var K,q,J,Y,X=e((()=>{a(),s(),K=t(s(),1),h(),H(),d(),V(),_(),w(),B(),ie(),F(),z(),le(),P(),r(),v(),N(),ge(),b(),ae(),q=m(),Y=`__open_folder__`}));function ve(e){let t=fe(),n=D(),r=e.startsWith(t)?`~`+e.slice(t.length):null,i=e.startsWith(n)?`./`+pe(n,e):null;return r&&i?r.length<=i.length?r:i:r||i||e}var ye=e((()=>{s(),d(),E(),m()}));function be({onDone:e}){let t=async t=>{try{t.includes(n())&&await G(n(),{recursive:!0});try{await me(t,``,{encoding:`utf8`,flag:`wx`})}catch(e){if(S(e)!==`EEXIST`)throw e}await de(t);let r=`default`,i=``;process.env.VISUAL?(r=`$VISUAL`,i=process.env.VISUAL):process.env.EDITOR&&(r=`$EDITOR`,i=process.env.EDITOR);let a=r===`default`?``:`Using ${r}="${i}".`,o=a?`> ${a} To change editor, set $EDITOR or $VISUAL environment variable.`:`> To use a different editor, set the $EDITOR or $VISUAL environment variable.`;e(`Opened memory file at ${ve(t)}\n\n${o}`,{display:`system`})}catch(t){j(t),e(`Error opening memory file: ${t}`)}},r=()=>{e(`Cancelled memory editing`,{display:`system`})};return(0,Q.jsx)(u,{title:`Memory`,onCancel:r,color:`remember`,children:(0,Q.jsxs)(p,{flexDirection:`column`,children:[(0,Q.jsx)(Z.Suspense,{fallback:null,children:(0,Q.jsx)(_e,{onSelect:t,onCancel:r})}),(0,Q.jsx)(p,{marginTop:1,children:(0,Q.jsxs)(c,{dimColor:!0,children:[`Learn more: `,(0,Q.jsx)(o,{url:`https://code.claude.com/docs/en/memory`})]})})]})})}var Z,Q,$;e((()=>{Z=t(s(),1),d(),X(),ye(),P(),r(),C(),A(),ue(),Q=m(),$=async e=>(L(),await R(),(0,Q.jsx)(be,{onDone:e}))}))();export{$ as call};
@@ -1 +1 @@
1
- import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{In as n,Ln as r,Rn as i}from"./src-Di342QoJ.js";import{t as a}from"./jsx-runtime-D-D469L8.js";import{$r as o,Lr as s,Pr as c,Qr as l,Si as u,Vr as d,Xr as f,Zr as p,ui as m,vi as h,wr as g,xi as _,yi as v}from"./paths-o5iA-EnQ.js";import{n as y,r as b}from"./analytics-DqMQntaB.js";import{A as x,et as S,j as C}from"./log-CzsijfHZ.js";import{BS as w,Df as T,Ef as E,Jg as D,Kg as O,LS as k,RS as A,qg as j}from"./loadAgentsDir-DF6FgRn-.js";import{i as M,n as N,r as P,t as F}from"./extraUsage-CWde-Mi0.js";function I({onDone:e}){let t=A(e=>e.mainLoopModel),r=A(e=>e.mainLoopModelForSession),i=A(e=>e.fastMode),a=w();function o(){b(`tengu_model_command_menu`,{action:`cancel`});let r=H(t);e(`Kept model as ${n.bold(r)}`,{display:`system`})}function c(r,o){b(`tengu_model_command_menu`,{action:r,from_model:t,to_model:r}),a(e=>({...e,mainLoopModel:r,mainLoopModelForSession:null}));let c=`Set model to ${n.bold(H(r))}`;o!==void 0&&(c+=` with ${n.bold(o)} effort`);let l;_()&&(m(),!u(r)&&i?(a(e=>({...e,fastMode:!1})),l=!1):u(r)&&v()&&i&&(c+=` · Fast mode ON`,l=!0)),N(r,l===!0,s())&&(c+=` · Billed as extra usage`),l===!1&&(c+=` · Fast mode OFF`),e(c)}return(0,W.jsx)(P,{initial:t,sessionModel:r,onSelect:c,onCancel:o,isStandaloneCommand:!0,showFastModeNotice:_()&&i&&u(t)&&v()})}function L({args:e,onDone:t}){let r=A(e=>e.fastMode),i=w(),a=e===`default`?null:e;return U.useEffect(()=>{async function e(){if(a&&!p(a)){t(`Model '${a}' is not available. Your organization restricts model selection.`,{display:`system`});return}if(a&&z(a)){t(`Opus 4.7 with 1M context is not available for your account. Learn more: https://code.claude.com/docs/en/model-config#extended-context-with-1m`,{display:`system`});return}if(a&&B(a)){t(`Sonnet 4.6 with 1M context is not available for your account. Learn more: https://code.claude.com/docs/en/model-config#extended-context-with-1m`,{display:`system`});return}if(!a){o(null);return}if(R(a)){o(a);return}try{let{valid:e,error:n}=await T(a);e?o(a):t(n||`Model '${a}' not found`,{display:`system`})}catch(e){t(`Failed to validate model: ${e.message}`,{display:`system`})}}function o(e){i(t=>({...t,mainLoopModel:e,mainLoopModelForSession:null}));let a=`Set model to ${n.bold(H(e))}`,o;_()&&(m(),!u(e)&&r?(i(e=>({...e,fastMode:!1})),o=!1):u(e)&&r&&(a+=` · Fast mode ON`,o=!0)),N(e,o===!0,s())&&(a+=` · Billed as extra usage`),o===!1&&(a+=` · Fast mode OFF`),t(a)}e()},[a,t,i]),null}function R(e){return l.includes(e.toLowerCase().trim())}function z(e){let t=e.toLowerCase();return!O()&&!s()&&t.includes(`opus`)&&t.includes(`[1m]`)}function B(e){let t=e.toLowerCase();return!j()&&(t.includes(`sonnet[1m]`)||t.includes(`sonnet-4-6[1m]`))}function V({onDone:e}){let t=A(e=>e.mainLoopModel),r=A(e=>e.mainLoopModelForSession),i=A(e=>e.effortValue),a=H(t),o=i===void 0?``:` (effort: ${i})`;return e(r?`Current model: ${n.bold(H(r))} (session override from plan mode)\nBase model: ${a}${o}`:`Current model: ${a}${o}`),null}function H(e){let t=d(e??g());return e===null?`${t} (default)`:t}var U,W,G;e((()=>{r(),U=t(i(),1),M(),S(),y(),k(),F(),h(),o(),D(),c(),f(),E(),W=a(),G=async(e,t,n)=>{if(n=n?.trim()||``,C.includes(n))return b(`tengu_model_command_inline_help`,{args:n}),(0,W.jsx)(V,{onDone:e});if(x.includes(n)){e(`Run /model to open the model selection menu, or /model [modelName] to set the model.`,{display:`system`});return}return n?(b(`tengu_model_command_inline`,{args:n}),(0,W.jsx)(L,{args:n,onDone:e})):(0,W.jsx)(I,{onDone:e})}}))();export{G as call};
1
+ import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{In as n,Ln as r,Rn as i}from"./src-Di342QoJ.js";import{t as a}from"./jsx-runtime-D-D469L8.js";import{$r as o,Lr as s,Pr as c,Qr as l,Si as u,Vr as d,Xr as f,Zr as p,ui as m,vi as h,wr as g,xi as _,yi as v}from"./paths-q1-Ni8Oh.js";import{n as y,r as b}from"./analytics-DqMQntaB.js";import{A as x,et as S,j as C}from"./log-CzsijfHZ.js";import{BS as w,Df as T,Ef as E,Jg as D,Kg as O,LS as k,RS as A,qg as j}from"./loadAgentsDir-Cl2w3uvH.js";import{i as M,n as N,r as P,t as F}from"./extraUsage-CxqJdnGC.js";function I({onDone:e}){let t=A(e=>e.mainLoopModel),r=A(e=>e.mainLoopModelForSession),i=A(e=>e.fastMode),a=w();function o(){b(`tengu_model_command_menu`,{action:`cancel`});let r=H(t);e(`Kept model as ${n.bold(r)}`,{display:`system`})}function c(r,o){b(`tengu_model_command_menu`,{action:r,from_model:t,to_model:r}),a(e=>({...e,mainLoopModel:r,mainLoopModelForSession:null}));let c=`Set model to ${n.bold(H(r))}`;o!==void 0&&(c+=` with ${n.bold(o)} effort`);let l;_()&&(m(),!u(r)&&i?(a(e=>({...e,fastMode:!1})),l=!1):u(r)&&v()&&i&&(c+=` · Fast mode ON`,l=!0)),N(r,l===!0,s())&&(c+=` · Billed as extra usage`),l===!1&&(c+=` · Fast mode OFF`),e(c)}return(0,W.jsx)(P,{initial:t,sessionModel:r,onSelect:c,onCancel:o,isStandaloneCommand:!0,showFastModeNotice:_()&&i&&u(t)&&v()})}function L({args:e,onDone:t}){let r=A(e=>e.fastMode),i=w(),a=e===`default`?null:e;return U.useEffect(()=>{async function e(){if(a&&!p(a)){t(`Model '${a}' is not available. Your organization restricts model selection.`,{display:`system`});return}if(a&&z(a)){t(`Opus 4.7 with 1M context is not available for your account. Learn more: https://code.claude.com/docs/en/model-config#extended-context-with-1m`,{display:`system`});return}if(a&&B(a)){t(`Sonnet 4.6 with 1M context is not available for your account. Learn more: https://code.claude.com/docs/en/model-config#extended-context-with-1m`,{display:`system`});return}if(!a){o(null);return}if(R(a)){o(a);return}try{let{valid:e,error:n}=await T(a);e?o(a):t(n||`Model '${a}' not found`,{display:`system`})}catch(e){t(`Failed to validate model: ${e.message}`,{display:`system`})}}function o(e){i(t=>({...t,mainLoopModel:e,mainLoopModelForSession:null}));let a=`Set model to ${n.bold(H(e))}`,o;_()&&(m(),!u(e)&&r?(i(e=>({...e,fastMode:!1})),o=!1):u(e)&&r&&(a+=` · Fast mode ON`,o=!0)),N(e,o===!0,s())&&(a+=` · Billed as extra usage`),o===!1&&(a+=` · Fast mode OFF`),t(a)}e()},[a,t,i]),null}function R(e){return l.includes(e.toLowerCase().trim())}function z(e){let t=e.toLowerCase();return!O()&&!s()&&t.includes(`opus`)&&t.includes(`[1m]`)}function B(e){let t=e.toLowerCase();return!j()&&(t.includes(`sonnet[1m]`)||t.includes(`sonnet-4-6[1m]`))}function V({onDone:e}){let t=A(e=>e.mainLoopModel),r=A(e=>e.mainLoopModelForSession),i=A(e=>e.effortValue),a=H(t),o=i===void 0?``:` (effort: ${i})`;return e(r?`Current model: ${n.bold(H(r))} (session override from plan mode)\nBase model: ${a}${o}`:`Current model: ${a}${o}`),null}function H(e){let t=d(e??g());return e===null?`${t} (default)`:t}var U,W,G;e((()=>{r(),U=t(i(),1),M(),S(),y(),k(),F(),h(),o(),D(),c(),f(),E(),W=a(),G=async(e,t,n)=>{if(n=n?.trim()||``,C.includes(n))return b(`tengu_model_command_inline_help`,{args:n}),(0,W.jsx)(V,{onDone:e});if(x.includes(n)){e(`Run /model to open the model selection menu, or /model [modelName] to set the model.`,{display:`system`});return}return n?(b(`tengu_model_command_inline`,{args:n}),(0,W.jsx)(L,{args:n,onDone:e})):(0,W.jsx)(I,{onDone:e})}}))();export{G as call};
@@ -0,0 +1 @@
1
+ import{Dr as e,Pr as t}from"./paths-q1-Ni8Oh.js";t();export{e as getMainLoopModel};
@@ -1 +1 @@
1
- import{cn as e,tr as t}from"./state-sIHsFpDu.js";import{Ac as n,Is as r,It as i,Lt as a,Ns as o,Pc as s,Rt as c,Sc as l,Vs as u,on as d}from"./paths-o5iA-EnQ.js";import{K as f,V as p}from"./debug-UI3T040K.js";import{o as m,s as h}from"./log-CzsijfHZ.js";import{_a as g,ya as _}from"./loadAgentsDir-DF6FgRn-.js";import{d as v,m as y,p as b}from"./rcDebugLog-BNojB_eB.js";e(),d(),n(),p(),m(),_(),o(),v();function x(e){return t=>({...t,...typeof e.permission_mode==`string`?{toolPermissionContext:{...t.toolPermissionContext,mode:r(e.permission_mode)}}:{},...typeof e.is_ultraplan_mode==`boolean`?{isUltraplanMode:e.is_ultraplan_mode}:{}})}function S({newState:e,oldState:n}){let r=n.toolPermissionContext.mode,o=e.toolPermissionContext.mode;if(r!==o){let t=u(r),i=u(o);t!==i&&y({permission_mode:i,is_ultraplan_mode:i===`plan`&&e.isUltraplanMode&&!n.isUltraplanMode?!0:null}),b(o)}if(e.mainLoopModel!==n.mainLoopModel&&t(e.mainLoopModel),e.expandedView!==n.expandedView){let t=e.expandedView===`tasks`,n=e.expandedView===`teammates`;(l().showExpandedTodos!==t||l().showSpinnerTree!==n)&&s(e=>({...e,showExpandedTodos:t,showSpinnerTree:n}))}if(e.verbose!==n.verbose&&l().verbose!==e.verbose){let t=e.verbose;s(e=>({...e,verbose:t}))}if(process.env.USER_TYPE===`ant`&&e.tungstenPanelVisible!==n.tungstenPanelVisible&&e.tungstenPanelVisible!==void 0&&l().tungstenPanelVisible!==e.tungstenPanelVisible){let t=e.tungstenPanelVisible;s(e=>({...e,tungstenPanelVisible:t}))}if(e.settings!==n.settings)try{i(),a(),c(),e.settings.env!==n.settings.env&&g()}catch(e){h(f(e))}}export{S as n,x as t};
1
+ import{cn as e,tr as t}from"./state-sIHsFpDu.js";import{Ac as n,Is as r,It as i,Lt as a,Ns as o,Pc as s,Rt as c,Sc as l,Vs as u,on as d}from"./paths-q1-Ni8Oh.js";import{K as f,V as p}from"./debug-UI3T040K.js";import{o as m,s as h}from"./log-CzsijfHZ.js";import{_a as g,ya as _}from"./loadAgentsDir-Cl2w3uvH.js";import{d as v,m as y,p as b}from"./rcDebugLog-fhwD4wm-.js";e(),d(),n(),p(),m(),_(),o(),v();function x(e){return t=>({...t,...typeof e.permission_mode==`string`?{toolPermissionContext:{...t.toolPermissionContext,mode:r(e.permission_mode)}}:{},...typeof e.is_ultraplan_mode==`boolean`?{isUltraplanMode:e.is_ultraplan_mode}:{}})}function S({newState:e,oldState:n}){let r=n.toolPermissionContext.mode,o=e.toolPermissionContext.mode;if(r!==o){let t=u(r),i=u(o);t!==i&&y({permission_mode:i,is_ultraplan_mode:i===`plan`&&e.isUltraplanMode&&!n.isUltraplanMode?!0:null}),b(o)}if(e.mainLoopModel!==n.mainLoopModel&&t(e.mainLoopModel),e.expandedView!==n.expandedView){let t=e.expandedView===`tasks`,n=e.expandedView===`teammates`;(l().showExpandedTodos!==t||l().showSpinnerTree!==n)&&s(e=>({...e,showExpandedTodos:t,showSpinnerTree:n}))}if(e.verbose!==n.verbose&&l().verbose!==e.verbose){let t=e.verbose;s(e=>({...e,verbose:t}))}if(process.env.USER_TYPE===`ant`&&e.tungstenPanelVisible!==n.tungstenPanelVisible&&e.tungstenPanelVisible!==void 0&&l().tungstenPanelVisible!==e.tungstenPanelVisible){let t=e.tungstenPanelVisible;s(e=>({...e,tungstenPanelVisible:t}))}if(e.settings!==n.settings)try{i(),a(),c(),e.settings.env!==n.settings.env&&g()}catch(e){h(f(e))}}export{S as n,x as t};
@@ -1,4 +1,4 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{l as t,s as n,u as r}from"./envUtils-BWeoiL4Y.js";import{ai as i,ci as a,cr as o,dr as s}from"./paths-o5iA-EnQ.js";import{d as c,s as l}from"./debug-UI3T040K.js";import{BE as ee,FT as u,IT as d,Ko as f,Lo as p,PT as m,Wo as h,Xc as g,Yc as _,Zc as v,__ as y,b_ as te,bo as b,co as x,fm as S,g_ as C,gm as w,st as T,ut as E,v_ as D,x_ as O,y_ as ne,zE as k}from"./loadAgentsDir-DF6FgRn-.js";import{Bn as A,Hn as j,Vn as M,i as N,r as P,t as F}from"./prompt-DiHksuOs.js";import{F as I,I as L,L as R,P as z,R as B,Y as V}from"./rcDebugLog-BNojB_eB.js";import{n as H,t as U}from"./openaiShared-Bjrci9n8.js";import{randomUUID as W}from"crypto";function G(e){return typeof e==`string`?e:Array.isArray(e)?e.map(e=>{if(!e||typeof e!=`object`)return``;let t=e;return typeof t.text==`string`?t.text:``}).filter(Boolean).join(`
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{l as t,s as n,u as r}from"./envUtils-BWeoiL4Y.js";import{ai as i,ci as a,cr as o,dr as s}from"./paths-q1-Ni8Oh.js";import{d as c,s as l}from"./debug-UI3T040K.js";import{BE as ee,FT as u,IT as d,Ko as f,Lo as p,PT as m,Wo as h,Xc as g,Yc as _,Zc as v,__ as y,b_ as te,bo as b,co as x,fm as S,g_ as C,gm as w,st as T,ut as E,v_ as D,x_ as O,y_ as ne,zE as k}from"./loadAgentsDir-Cl2w3uvH.js";import{Bn as A,Hn as j,Vn as M,i as N,r as P,t as F}from"./prompt-BmOnuQfF.js";import{F as I,I as L,L as R,P as z,R as B,Y as V}from"./rcDebugLog-fhwD4wm-.js";import{n as H,t as U}from"./openaiShared-Bjrci9n8.js";import{randomUUID as W}from"crypto";function G(e){return typeof e==`string`?e:Array.isArray(e)?e.map(e=>{if(!e||typeof e!=`object`)return``;let t=e;return typeof t.text==`string`?t.text:``}).filter(Boolean).join(`
2
2
  `):``}function re(e){if(typeof e==`string`)return e;if(!Array.isArray(e))return G(e);let t=[];for(let n of e){if(!n||typeof n!=`object`)continue;let e=n;if(e.type===`text`&&typeof e.text==`string`)t.push({type:`input_text`,text:e.text});else if(e.type===`image_url`){let n=e.image_url;typeof n?.url==`string`&&t.push({type:`input_image`,image_url:n.url})}}return t.length>0?t:G(e)}function K(e){let t=[],n=[];for(let r of e){if(!r||typeof r!=`object`)continue;let e=r,i=e.role;if(i===`system`||i===`developer`){let t=G(e.content);t&&n.push(t);continue}if(i===`tool`){let n=e.tool_call_id;typeof n==`string`&&t.push({type:`function_call_output`,call_id:n,output:G(e.content)});continue}if(i===`assistant`){let n=G(e.content);n&&t.push({role:`assistant`,content:n});let r=e.tool_calls;if(Array.isArray(r))for(let e of r){if(!e||typeof e!=`object`)continue;let n=e,r=n.function,i=typeof n.id==`string`?n.id:void 0,a=typeof r?.name==`string`?r.name:void 0;!i||!a||t.push({type:`function_call`,call_id:i,name:a,arguments:typeof r?.arguments==`string`?r.arguments:`{}`})}continue}i===`user`&&t.push({role:`user`,content:re(e.content)})}return{input:t,instructions:n.length>0?n.join(`
3
3
 
4
4
  `):void 0}}function q(e){let t=[];for(let n of e){if(!n||typeof n!=`object`)continue;let e=n.function,r=typeof e?.name==`string`?e.name:void 0;r&&t.push({type:`function`,name:r,description:typeof e?.description==`string`?e.description:``,parameters:e?.parameters&&typeof e.parameters==`object`?e.parameters:{type:`object`,properties:{}},strict:!1})}return t}function J(e){if(e===`required`)return`required`;if(e===`auto`)return`auto`;if(!e||typeof e!=`object`)return e;let t=e,n=t.function;return t.type===`function`&&typeof n?.name==`string`?{type:`function`,name:n.name}:e}function Y(e){let{input:t,instructions:n}=K(e.messages),r=q(e.tools);return{model:e.model,stream:!0,store:!1,input:t,...n?{instructions:n}:{},...r.length>0?{tools:r}:{},...e.toolChoice?{tool_choice:J(e.toolChoice)}:{},...e.reasoningEffort?{reasoning:{effort:e.reasoningEffort}}:{},parallel_tool_calls:!0}}async function*X(e){if(!e.body)throw Error(`ChatGPT response did not include a body`);let t=e.body.getReader(),n=new TextDecoder,r=``;for(;;){let{done:e,value:i}=await t.read();if(e)break;r+=n.decode(i,{stream:!0});let a=r.indexOf(`
@@ -1 +1 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./axios-DhfaybwJ.js";import{Ac as r,Pc as i,Sc as a,Zt as o,on as s}from"./paths-o5iA-EnQ.js";import{l as c,u as l}from"./oauth-CdZEzMww.js";import{d as u,f as d,o as f,s as p}from"./log-CzsijfHZ.js";import{a as m,l as h,o as g}from"./api-O4eHGLTY.js";async function _(){try{let{accessToken:e,orgUUID:n}=await h(),r=`${c().BASE_API_URL}/api/oauth/organizations/${n}/overage_credit_grant`;return(await t.get(r,{headers:m(e)})).data}catch(e){return p(e),null}}function v(){let e=o()?.organizationUuid;if(!e)return null;let t=a().overageCreditGrantCache?.[e];return!t||Date.now()-t.timestamp>S?null:t.info}function y(){let e=o()?.organizationUuid;if(!e)return;let t=a().overageCreditGrantCache;!t||!(e in t)||i(t=>{let n={...t.overageCreditGrantCache};return delete n[e],{...t,overageCreditGrantCache:n}})}async function b(){if(d())return;let e=o()?.organizationUuid;if(!e)return;let t=await _();t&&i(n=>{let r=n.overageCreditGrantCache?.[e],i=r?.info,a=i&&i.available===t.available&&i.eligible===t.eligible&&i.granted===t.granted&&i.amount_minor_units===t.amount_minor_units&&i.currency===t.currency;if(a&&r&&Date.now()-r.timestamp<=S)return n;let o={info:a?i:t,timestamp:Date.now()};return{...n,overageCreditGrantCache:{...n.overageCreditGrantCache,[e]:o}}})}function x(e){if(e.amount_minor_units==null||!e.currency)return null;if(e.currency.toUpperCase()===`USD`){let t=e.amount_minor_units/100;return Number.isInteger(t)?`$${t}`:`$${t.toFixed(2)}`}return null}var S,C=e((()=>{n(),l(),s(),r(),f(),u(),g(),S=3600*1e3}));export{b as a,y as i,v as n,C as r,x as t};
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./axios-DhfaybwJ.js";import{Ac as r,Pc as i,Sc as a,Zt as o,on as s}from"./paths-q1-Ni8Oh.js";import{l as c,u as l}from"./oauth-CdZEzMww.js";import{d as u,f as d,o as f,s as p}from"./log-CzsijfHZ.js";import{a as m,l as h,o as g}from"./api-DLLVkmRJ.js";async function _(){try{let{accessToken:e,orgUUID:n}=await h(),r=`${c().BASE_API_URL}/api/oauth/organizations/${n}/overage_credit_grant`;return(await t.get(r,{headers:m(e)})).data}catch(e){return p(e),null}}function v(){let e=o()?.organizationUuid;if(!e)return null;let t=a().overageCreditGrantCache?.[e];return!t||Date.now()-t.timestamp>S?null:t.info}function y(){let e=o()?.organizationUuid;if(!e)return;let t=a().overageCreditGrantCache;!t||!(e in t)||i(t=>{let n={...t.overageCreditGrantCache};return delete n[e],{...t,overageCreditGrantCache:n}})}async function b(){if(d())return;let e=o()?.organizationUuid;if(!e)return;let t=await _();t&&i(n=>{let r=n.overageCreditGrantCache?.[e],i=r?.info,a=i&&i.available===t.available&&i.eligible===t.eligible&&i.granted===t.granted&&i.amount_minor_units===t.amount_minor_units&&i.currency===t.currency;if(a&&r&&Date.now()-r.timestamp<=S)return n;let o={info:a?i:t,timestamp:Date.now()};return{...n,overageCreditGrantCache:{...n.overageCreditGrantCache,[e]:o}}})}function x(e){if(e.amount_minor_units==null||!e.currency)return null;if(e.currency.toUpperCase()===`USD`){let t=e.amount_minor_units/100;return Number.isInteger(t)?`$${t}`:`$${t.toFixed(2)}`}return null}var S,C=e((()=>{n(),l(),s(),r(),f(),u(),g(),S=3600*1e3}));export{b as a,y as i,v as n,C as r,x as t};
@@ -1 +1 @@
1
- import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Q as n,Rn as r,b as i,p as a,t as o,tn as s,tt as c,x as l,xt as u}from"./src-Di342QoJ.js";import{t as d}from"./jsx-runtime-D-D469L8.js";import{Ac as f,Gs as p,Pc as m,Sc as h}from"./paths-o5iA-EnQ.js";import{n as g,r as _}from"./analytics-DqMQntaB.js";import{o as v,s as y}from"./log-CzsijfHZ.js";import{b,x}from"./teammate-DMYOtLTK.js";import{t as S}from"./useKeybinding-FsOnjW6T.js";import{i as C,l as w,n as T,o as E,r as D,s as O,u as k}from"./referral-BADm5sBf.js";function A({onDone:e}){let[t,r]=(0,j.useState)(!0),[o,d]=(0,j.useState)([]),[f,p]=(0,j.useState)(!1),[m,h]=(0,j.useState)(null),[g,v]=(0,j.useState)(void 0),x=k(()=>e(`Guest passes dialog dismissed`,{display:`system`}));if(c(`confirm:no`,(0,j.useCallback)(()=>{e(`Guest passes dialog dismissed`,{display:`system`})},[e]),{context:`Confirmation`}),u((t,n)=>{n.return&&m&&s(m).then(t=>{t&&process.stdout.write(t),_(`tengu_guest_passes_link_copied`,{}),e(`Referral link copied to clipboard!`)})}),(0,j.useEffect)(()=>{async function e(){try{let e=await C();if(!e||!e.eligible){p(!1),r(!1);return}p(!0),e.referral_code_details?.referral_link&&h(e.referral_code_details.referral_link),v(e.referrer_reward);let t=e.referral_code_details?.campaign??`claude_code_guest_pass`,n;try{n=await T(t)}catch(e){y(e),p(!1),r(!1);return}let i=n.redemptions||[],a=n.limit||3,o=[];for(let e=0;e<a;e++){let t=i[e];o.push({passNumber:e+1,isAvailable:!t})}d(o),r(!1)}catch(e){y(e),p(!1),r(!1)}}e()},[]),t)return(0,M.jsx)(a,{children:(0,M.jsxs)(l,{flexDirection:`column`,gap:1,children:[(0,M.jsx)(i,{dimColor:!0,children:`Loading guest pass information…`}),(0,M.jsx)(i,{dimColor:!0,italic:!0,children:x.pending?(0,M.jsxs)(M.Fragment,{children:[`Press `,x.keyName,` again to exit`]}):(0,M.jsx)(M.Fragment,{children:`Esc to cancel`})})]})});if(!f)return(0,M.jsx)(a,{children:(0,M.jsxs)(l,{flexDirection:`column`,gap:1,children:[(0,M.jsx)(i,{children:`Guest passes are not currently available.`}),(0,M.jsx)(i,{dimColor:!0,italic:!0,children:x.pending?(0,M.jsxs)(M.Fragment,{children:[`Press `,x.keyName,` again to exit`]}):(0,M.jsx)(M.Fragment,{children:`Esc to cancel`})})]})});let S=b(o,e=>e.isAvailable),w=[...o].sort((e,t)=>t.isAvailable-+e.isAvailable),E=e=>e.isAvailable?(0,M.jsxs)(l,{flexDirection:`column`,marginRight:1,children:[(0,M.jsx)(i,{children:`┌──────────┐`}),(0,M.jsxs)(i,{children:[` ) CC `,(0,M.jsx)(i,{color:`claude`,children:`✻`}),` ┊ ( `]}),(0,M.jsx)(i,{children:`└──────────┘`})]},e.passNumber):(0,M.jsxs)(l,{flexDirection:`column`,marginRight:1,children:[(0,M.jsx)(i,{dimColor:!0,children:`┌─────────╱`}),(0,M.jsx)(i,{dimColor:!0,children:` ) CC ✻ ┊╱`}),(0,M.jsx)(i,{dimColor:!0,children:`└───────╱`})]},e.passNumber);return(0,M.jsx)(a,{children:(0,M.jsxs)(l,{flexDirection:`column`,gap:1,children:[(0,M.jsxs)(i,{color:`permission`,children:[`Guest passes · `,S,` left`]}),(0,M.jsx)(l,{flexDirection:`row`,marginLeft:2,children:w.slice(0,3).map(e=>E(e))}),m&&(0,M.jsx)(l,{marginLeft:2,children:(0,M.jsx)(i,{children:m})}),(0,M.jsx)(l,{flexDirection:`column`,marginLeft:2,children:(0,M.jsxs)(i,{dimColor:!0,children:[g?`Share a free week of Claude Code with friends. If they love it and subscribe, you'll get ${D(g)} of extra usage to keep building. `:`Share a free week of Claude Code with friends. `,(0,M.jsx)(n,{url:g?`https://support.claude.com/en/articles/13456702-claude-code-guest-passes`:`https://support.claude.com/en/articles/12875061-claude-code-guest-passes`,children:`Terms apply.`})]})}),(0,M.jsx)(l,{children:(0,M.jsx)(i,{dimColor:!0,italic:!0,children:x.pending?(0,M.jsxs)(M.Fragment,{children:[`Press `,x.keyName,` again to exit`]}):(0,M.jsx)(M.Fragment,{children:`Enter to copy link · Esc to cancel`})})})]})})}var j,M,N=e((()=>{r(),j=t(r(),1),p(),w(),o(),S(),g(),O(),x(),v(),M=d()}));async function P(e){let t=!h().hasVisitedPasses;if(t){let e=E();m(t=>({...t,hasVisitedPasses:!0,passesLastSeenRemaining:e??t.passesLastSeenRemaining}))}return _(`tengu_guest_passes_visited`,{is_first_visit:t}),(0,F.jsx)(A,{onDone:e})}var F;e((()=>{r(),N(),g(),O(),f(),F=d()}))();export{P as call};
1
+ import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Q as n,Rn as r,b as i,p as a,t as o,tn as s,tt as c,x as l,xt as u}from"./src-Di342QoJ.js";import{t as d}from"./jsx-runtime-D-D469L8.js";import{Ac as f,Gs as p,Pc as m,Sc as h}from"./paths-q1-Ni8Oh.js";import{n as g,r as _}from"./analytics-DqMQntaB.js";import{o as v,s as y}from"./log-CzsijfHZ.js";import{b,x}from"./teammate-DMYOtLTK.js";import{t as S}from"./useKeybinding-FsOnjW6T.js";import{i as C,l as w,n as T,o as E,r as D,s as O,u as k}from"./referral-rRvT6UDX.js";function A({onDone:e}){let[t,r]=(0,j.useState)(!0),[o,d]=(0,j.useState)([]),[f,p]=(0,j.useState)(!1),[m,h]=(0,j.useState)(null),[g,v]=(0,j.useState)(void 0),x=k(()=>e(`Guest passes dialog dismissed`,{display:`system`}));if(c(`confirm:no`,(0,j.useCallback)(()=>{e(`Guest passes dialog dismissed`,{display:`system`})},[e]),{context:`Confirmation`}),u((t,n)=>{n.return&&m&&s(m).then(t=>{t&&process.stdout.write(t),_(`tengu_guest_passes_link_copied`,{}),e(`Referral link copied to clipboard!`)})}),(0,j.useEffect)(()=>{async function e(){try{let e=await C();if(!e||!e.eligible){p(!1),r(!1);return}p(!0),e.referral_code_details?.referral_link&&h(e.referral_code_details.referral_link),v(e.referrer_reward);let t=e.referral_code_details?.campaign??`claude_code_guest_pass`,n;try{n=await T(t)}catch(e){y(e),p(!1),r(!1);return}let i=n.redemptions||[],a=n.limit||3,o=[];for(let e=0;e<a;e++){let t=i[e];o.push({passNumber:e+1,isAvailable:!t})}d(o),r(!1)}catch(e){y(e),p(!1),r(!1)}}e()},[]),t)return(0,M.jsx)(a,{children:(0,M.jsxs)(l,{flexDirection:`column`,gap:1,children:[(0,M.jsx)(i,{dimColor:!0,children:`Loading guest pass information…`}),(0,M.jsx)(i,{dimColor:!0,italic:!0,children:x.pending?(0,M.jsxs)(M.Fragment,{children:[`Press `,x.keyName,` again to exit`]}):(0,M.jsx)(M.Fragment,{children:`Esc to cancel`})})]})});if(!f)return(0,M.jsx)(a,{children:(0,M.jsxs)(l,{flexDirection:`column`,gap:1,children:[(0,M.jsx)(i,{children:`Guest passes are not currently available.`}),(0,M.jsx)(i,{dimColor:!0,italic:!0,children:x.pending?(0,M.jsxs)(M.Fragment,{children:[`Press `,x.keyName,` again to exit`]}):(0,M.jsx)(M.Fragment,{children:`Esc to cancel`})})]})});let S=b(o,e=>e.isAvailable),w=[...o].sort((e,t)=>t.isAvailable-+e.isAvailable),E=e=>e.isAvailable?(0,M.jsxs)(l,{flexDirection:`column`,marginRight:1,children:[(0,M.jsx)(i,{children:`┌──────────┐`}),(0,M.jsxs)(i,{children:[` ) CC `,(0,M.jsx)(i,{color:`claude`,children:`✻`}),` ┊ ( `]}),(0,M.jsx)(i,{children:`└──────────┘`})]},e.passNumber):(0,M.jsxs)(l,{flexDirection:`column`,marginRight:1,children:[(0,M.jsx)(i,{dimColor:!0,children:`┌─────────╱`}),(0,M.jsx)(i,{dimColor:!0,children:` ) CC ✻ ┊╱`}),(0,M.jsx)(i,{dimColor:!0,children:`└───────╱`})]},e.passNumber);return(0,M.jsx)(a,{children:(0,M.jsxs)(l,{flexDirection:`column`,gap:1,children:[(0,M.jsxs)(i,{color:`permission`,children:[`Guest passes · `,S,` left`]}),(0,M.jsx)(l,{flexDirection:`row`,marginLeft:2,children:w.slice(0,3).map(e=>E(e))}),m&&(0,M.jsx)(l,{marginLeft:2,children:(0,M.jsx)(i,{children:m})}),(0,M.jsx)(l,{flexDirection:`column`,marginLeft:2,children:(0,M.jsxs)(i,{dimColor:!0,children:[g?`Share a free week of Claude Code with friends. If they love it and subscribe, you'll get ${D(g)} of extra usage to keep building. `:`Share a free week of Claude Code with friends. `,(0,M.jsx)(n,{url:g?`https://support.claude.com/en/articles/13456702-claude-code-guest-passes`:`https://support.claude.com/en/articles/12875061-claude-code-guest-passes`,children:`Terms apply.`})]})}),(0,M.jsx)(l,{children:(0,M.jsx)(i,{dimColor:!0,italic:!0,children:x.pending?(0,M.jsxs)(M.Fragment,{children:[`Press `,x.keyName,` again to exit`]}):(0,M.jsx)(M.Fragment,{children:`Enter to copy link · Esc to cancel`})})})]})})}var j,M,N=e((()=>{r(),j=t(r(),1),p(),w(),o(),S(),g(),O(),x(),v(),M=d()}));async function P(e){let t=!h().hasVisitedPasses;if(t){let e=E();m(t=>({...t,hasVisitedPasses:!0,passesLastSeenRemaining:e??t.passesLastSeenRemaining}))}return _(`tengu_guest_passes_visited`,{is_first_visit:t}),(0,F.jsx)(A,{onDone:e})}var F;e((()=>{r(),N(),g(),O(),f(),F=d()}))();export{P as call};
@@ -1 +1 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{h as t,p as n}from"./debug-UI3T040K.js";import{n as r,t as i}from"./cwd--iizewsn.js";import{i as a,o}from"./platform-CuyedWpe.js";import{n as s,r as c}from"./windowsPaths-swxCp7bX.js";import{l}from"./sessionStoragePortable-BI9q2WcJ.js";import{homedir as u}from"os";import{dirname as d,isAbsolute as f,join as p,normalize as m,posix as h,relative as g,resolve as _}from"path";function v(e,t){let r=t??i()??n().cwd();if(typeof e!=`string`)throw TypeError(`Path must be a string, received ${typeof e}`);if(typeof r!=`string`)throw TypeError(`Base directory must be a string, received ${typeof r}`);if(e.includes(`\0`)||r.includes(`\0`))throw Error(`Path contains null bytes`);let o=e=>e.includes(`/`)&&!e.includes(`\\`)&&!/^[A-Za-z]:/.test(e),s=e.trim();if(!s)return a()===`windows`&&o(r)?h.normalize(r).normalize(`NFC`):m(r).normalize(`NFC`);if(s===`~`)return u().normalize(`NFC`);if(s.startsWith(`~/`))return p(u(),s.slice(2)).normalize(`NFC`);let l=s;if(a()===`windows`&&s.match(/^\/[a-z]\//i))try{l=c(s)}catch{l=s}return f(l)?a()===`windows`&&o(l)?h.normalize(l).normalize(`NFC`):m(l).normalize(`NFC`):a()===`windows`&&o(r)&&!/^[A-Za-z]:/.test(l)&&!l.startsWith(`\\\\`)?h.resolve(r,l).normalize(`NFC`):_(r,l).normalize(`NFC`)}function y(e){let t=g(i(),e);return t.startsWith(`..`)?e:t}function b(e){let t=v(e);if(t.startsWith(`\\\\`)||t.startsWith(`//`))return d(t);try{if(n().statSync(t).isDirectory())return t}catch{}return d(t)}function x(e){return/(?:^|[\\/])\.\.(?:[\\/]|$)/.test(e)}function S(e){return m(e).replace(/\\/g,`/`)}var C=e((()=>{r(),t(),o(),s(),l()}));export{S as a,C as i,v as n,y as o,b as r,x as t};
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{h as t,p as n}from"./debug-UI3T040K.js";import{n as r,t as i}from"./cwd--iizewsn.js";import{i as a,o}from"./platform-CuyedWpe.js";import{n as s,r as c}from"./windowsPaths-swxCp7bX.js";import{l}from"./sessionStoragePortable-DJZ_6cL8.js";import{homedir as u}from"os";import{dirname as d,isAbsolute as f,join as p,normalize as m,posix as h,relative as g,resolve as _}from"path";function v(e,t){let r=t??i()??n().cwd();if(typeof e!=`string`)throw TypeError(`Path must be a string, received ${typeof e}`);if(typeof r!=`string`)throw TypeError(`Base directory must be a string, received ${typeof r}`);if(e.includes(`\0`)||r.includes(`\0`))throw Error(`Path contains null bytes`);let o=e=>e.includes(`/`)&&!e.includes(`\\`)&&!/^[A-Za-z]:/.test(e),s=e.trim();if(!s)return a()===`windows`&&o(r)?h.normalize(r).normalize(`NFC`):m(r).normalize(`NFC`);if(s===`~`)return u().normalize(`NFC`);if(s.startsWith(`~/`))return p(u(),s.slice(2)).normalize(`NFC`);let l=s;if(a()===`windows`&&s.match(/^\/[a-z]\//i))try{l=c(s)}catch{l=s}return f(l)?a()===`windows`&&o(l)?h.normalize(l).normalize(`NFC`):m(l).normalize(`NFC`):a()===`windows`&&o(r)&&!/^[A-Za-z]:/.test(l)&&!l.startsWith(`\\\\`)?h.resolve(r,l).normalize(`NFC`):_(r,l).normalize(`NFC`)}function y(e){let t=g(i(),e);return t.startsWith(`..`)?e:t}function b(e){let t=v(e);if(t.startsWith(`\\\\`)||t.startsWith(`//`))return d(t);try{if(n().statSync(t).isDirectory())return t}catch{}return d(t)}function x(e){return/(?:^|[\\/])\.\.(?:[\\/]|$)/.test(e)}function S(e){return m(e).replace(/\\/g,`/`)}var C=e((()=>{r(),t(),o(),s(),l()}));export{S as a,C as i,v as n,y as o,b as r,x as t};