@readmagic/workmate 0.0.11 → 0.0.13

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 (428) hide show
  1. package/dist/chunks/{AddWorkspaceDirectory-ag2JTpmU.js → AddWorkspaceDirectory-BzNj9rS6.js} +1 -1
  2. package/dist/chunks/AgentsMdExternalIncludesDialog-CDZPR488.js +1 -0
  3. package/dist/chunks/AgentsMdExternalIncludesDialog-CH9x1Ngp.js +1 -0
  4. package/dist/chunks/App-D-bYAYAl.js +1 -0
  5. package/dist/chunks/ApproveApiKey-BEGV9Zj9.js +1 -0
  6. package/dist/chunks/ApproveApiKey-CjacpIqq.js +1 -0
  7. package/dist/chunks/BackgroundTasksDialog-A9hw_SV0.js +2 -0
  8. package/dist/chunks/{BypassPermissionsModeDialog-B05t83wa.js → BypassPermissionsModeDialog-B0BizN_J.js} +1 -1
  9. package/dist/chunks/{DiffDialog-DUbFrzKu.js → DiffDialog-mQ-5_TSv.js} +2 -2
  10. package/dist/chunks/Doctor-BC6IuQhd.js +3 -0
  11. package/dist/chunks/Doctor-i_5_AQd-.js +1 -0
  12. package/dist/chunks/ExitFlow-Bu2cVGpC.js +2 -0
  13. package/dist/chunks/{Grove-BDoVj02t.js → Grove-D0nn8zOV.js} +2 -2
  14. package/dist/chunks/{HybridTransport-C_U0IJfz.js → HybridTransport-BQNLZNa_.js} +1 -1
  15. package/dist/chunks/InvalidConfigDialog-C5CIiSIE.js +1 -0
  16. package/dist/chunks/{InvalidSettingsDialog-Br8kQOHz.js → InvalidSettingsDialog-Dq7hKXcO.js} +1 -1
  17. package/dist/chunks/MCPConnectionManager-aDDsYkGM.js +1 -0
  18. package/dist/chunks/MCPToolListView-Cr0MDkzT.js +1 -0
  19. package/dist/chunks/{McpParsingWarnings-COa71S9q.js → McpParsingWarnings-CUx2zexI.js} +1 -1
  20. package/dist/chunks/MessageSelector-DwGOWKKL.js +3 -0
  21. package/dist/chunks/Messages-C1jh4ixt.js +11 -0
  22. package/dist/chunks/Onboarding-t-P6Q5O6.js +1 -0
  23. package/dist/chunks/{PromptInputFooterSuggestions-to5eYBvI.js → PromptInputFooterSuggestions-R12fbdmp.js} +1 -1
  24. package/dist/chunks/{PromptInputHelpMenu-CfMFx-TF.js → PromptInputHelpMenu-BgADIzRj.js} +1 -1
  25. package/dist/chunks/QueryEngine-HlLQJmsd.js +1 -0
  26. package/dist/chunks/REPL-Rs_JQkDc.js +1 -0
  27. package/dist/chunks/REPL-VKAmKkII.js +133 -0
  28. package/dist/chunks/RemoteSessionManager-BbgXeM-t.js +2 -0
  29. package/dist/chunks/ResumeConversation-66zbx12g.js +1 -0
  30. package/dist/chunks/{SSETransport-DN4tCDEh.js → SSETransport-BBQkdn4e.js} +1 -1
  31. package/dist/chunks/SearchExtraToolsTool-Bq87I_vu.js +1 -0
  32. package/dist/chunks/Settings-BKdLcyXe.js +2 -0
  33. package/dist/chunks/{TeleportProgress-C2LQVLav.js → TeleportProgress-3hmIApkj.js} +1 -1
  34. package/dist/chunks/{TeleportRepoMismatchDialog-BZL8Zblz.js → TeleportRepoMismatchDialog-BA1a66RK.js} +1 -1
  35. package/dist/chunks/{TeleportResumeWrapper-wPiIs8xg.js → TeleportResumeWrapper-BT4O-Wsi.js} +1 -1
  36. package/dist/chunks/{ThemePicker-BT_NaRQC.js → ThemePicker-DUlhcoso.js} +1 -1
  37. package/dist/chunks/TrustDialog-Dpk03V1Y.js +1 -0
  38. package/dist/chunks/{ValidationErrorsList-C-hWdy_8.js → ValidationErrorsList-DSSUWdgd.js} +1 -1
  39. package/dist/chunks/add-dir-BUr0z-VU.js +1 -0
  40. package/dist/chunks/{agentDisplay-CuSHqgZc.js → agentDisplay-D7bdOOG7.js} +1 -1
  41. package/dist/chunks/{agents-CMC0iQP4.js → agents-22wiC58F.js} +1 -1
  42. package/dist/chunks/agents-8ELI8RJo.js +103 -0
  43. package/dist/chunks/allErrors-C1eMbHSv.js +1 -0
  44. package/dist/chunks/api-DgjIFdMn.js +1 -0
  45. package/dist/chunks/{api-BbJfMXRS.js → api-f3GN2I_J.js} +1 -1
  46. package/dist/chunks/auth-B73a4Cob.js +1 -0
  47. package/dist/chunks/{auth-7mJGtlZp.js → auth-Czy7GoRh.js} +1 -1
  48. package/dist/chunks/auth-D_0waidQ.js +1 -0
  49. package/dist/chunks/backgroundHousekeeping-C_ArdTFX.js +17 -0
  50. package/dist/chunks/backgroundHousekeeping-YJhvZ0dh.js +1 -0
  51. package/dist/chunks/{banner-1Wyeyawe.js → banner-BcAM7iSx.js} +1 -1
  52. package/dist/chunks/bg-Ci7pG4eo.js +9 -0
  53. package/dist/chunks/branch-bb4-bErF.js +3 -0
  54. package/dist/chunks/{break-cache-CAoZ9b72.js → break-cache-4rlQORVk.js} +2 -2
  55. package/dist/chunks/{bridgeConfig-UgaUfuP6.js → bridgeConfig-B80T_lw7.js} +1 -1
  56. package/dist/chunks/bridgeConfig-DywkIo_k.js +1 -0
  57. package/dist/chunks/{bridgeMessaging-Ci5H68MX.js → bridgeMessaging-DyvHd16Z.js} +1 -1
  58. package/dist/chunks/{bridgePointer-BL8-lGvN.js → bridgePointer-DHWK3LEe.js} +1 -1
  59. package/dist/chunks/{bridgeStatusUtil-C36w15ge.js → bridgeStatusUtil-DStiD05t.js} +1 -1
  60. package/dist/chunks/btw-BRmV51bR.js +1 -0
  61. package/dist/chunks/caches-C5DIVdvI.js +1 -0
  62. package/dist/chunks/caches-zDZEgNKq.js +1 -0
  63. package/dist/chunks/{capacityWake-BOySRJUJ.js → capacityWake-ByL6fM6I.js} +1 -1
  64. package/dist/chunks/{ccrClient-Br4LAofR.js → ccrClient-BALhzhPF.js} +1 -1
  65. package/dist/chunks/{claudeDesktop-Bgds1-YT.js → claudeDesktop-Ct_hyICL.js} +1 -1
  66. package/dist/chunks/{clear-C4Vtnbye.js → clear-B_yVyJXP.js} +1 -1
  67. package/dist/chunks/cliLaunch-OPOtzhvA.js +1 -0
  68. package/dist/chunks/client-7lIxWcaM.js +1 -0
  69. package/dist/chunks/{client-B9404qIP.js → client-BMA05FW8.js} +1 -1
  70. package/dist/chunks/client-DVg8PpFX.js +1 -0
  71. package/dist/chunks/commands-ByFXqW43.js +1 -0
  72. package/dist/chunks/compact-BUShp2eQ.js +2 -0
  73. package/dist/chunks/config-9rLTDOYW.js +3 -0
  74. package/dist/chunks/config-BwHNU_pI.js +1 -0
  75. package/dist/chunks/{config-kB2eazPX.js → config-DMKtiMzJ.js} +1 -1
  76. package/dist/chunks/{context-BN7DEjoH.js → context-6Pk3iVhh.js} +1 -1
  77. package/dist/chunks/{context-noninteractive-D91W2B8e.js → context-noninteractive-CHzerxnH.js} +2 -2
  78. package/dist/chunks/context-noninteractive-DFwRQyFE.js +1 -0
  79. package/dist/chunks/conversation-5zb5XkSA.js +1 -0
  80. package/dist/chunks/conversation-JP2ZXrwu.js +1 -0
  81. package/dist/chunks/createSSHSession-XkHMiGRN.js +6 -0
  82. package/dist/chunks/{createSession-DRqkLZWt.js → createSession-BNGm9fL4.js} +1 -1
  83. package/dist/chunks/createSession-VTqzWAu6.js +1 -0
  84. package/dist/chunks/crossProjectResume-DxgQVYSi.js +40 -0
  85. package/dist/chunks/{cwd-Cfdf7z7s.js → cwd-Besi3Os3.js} +1 -1
  86. package/dist/chunks/cwd-DpqwaYHw.js +1 -0
  87. package/dist/chunks/datadog-3WUWcCFn.js +1 -0
  88. package/dist/chunks/{debug-BecbSVoN.js → debug-Dr1SjdXn.js} +2 -2
  89. package/dist/chunks/{debugUtils-CmJfIUxW.js → debugUtils-cK-iOsEV.js} +1 -1
  90. package/dist/chunks/detached-CqfQYVOi.js +5 -0
  91. package/dist/chunks/detectRepository-BsKZDRoI.js +1 -0
  92. package/dist/chunks/{detectRepository-C15umvKN.js → detectRepository-CMEkS5_2.js} +1 -1
  93. package/dist/chunks/{diff-DeK4bwjw.js → diff-CKlLimGq.js} +1 -1
  94. package/dist/chunks/{directoryCompletion-BJCu19HJ.js → directoryCompletion-ByBTSuLu.js} +1 -1
  95. package/dist/chunks/doctor-Bvx0u0sO.js +1 -0
  96. package/dist/chunks/{entry-mdegyj8z.js → entry-DCbq734V.js} +4 -4
  97. package/dist/chunks/{envUtils-BDhHQY0-.js → envUtils-DcaKZlRU.js} +1 -1
  98. package/dist/chunks/{esm-Ka3lhafK.js → esm-CtQkOk5D.js} +1 -1
  99. package/dist/chunks/{execFileNoThrow-DHyW8FMX.js → execFileNoThrow-mXq4K0rl.js} +1 -1
  100. package/dist/chunks/{execSyncWrapper-CDzB0BM1.js → execSyncWrapper-Ne33rRiD.js} +1 -1
  101. package/dist/chunks/exit-DTsz5Lcb.js +1 -0
  102. package/dist/chunks/{extraUsage-BrKbpBK-.js → extraUsage-C86bZVgt.js} +1 -1
  103. package/dist/chunks/extractMemories-6OnMgL2S.js +1 -0
  104. package/dist/chunks/fast-B2ziqJEA.js +1 -0
  105. package/dist/chunks/{fast-DWn40OcQ.js → fast-BkhjaTkZ.js} +1 -1
  106. package/dist/chunks/{fileSuggestions-C7Pwq2yj.js → fileSuggestions-BalHmi1-.js} +2 -2
  107. package/dist/chunks/{firstPartyEventLogger-BHjBQH0J.js → firstPartyEventLogger-1RTgXHSz.js} +2 -2
  108. package/dist/chunks/firstPartyEventLogger-CXMzhLrF.js +1 -0
  109. package/dist/chunks/{flushGate-DdJjxCes.js → flushGate-DWL05x7v.js} +1 -1
  110. package/dist/chunks/{gemini-DHv2iVfy.js → gemini-BLpLJyli.js} +1 -1
  111. package/dist/chunks/generateSessionName-CdbMksHi.js +1 -0
  112. package/dist/chunks/{genericProcessUtils-B2HcDYhg.js → genericProcessUtils-Dc1pfb7J.js} +1 -1
  113. package/dist/chunks/git-Bs1vtuvX.js +1 -0
  114. package/dist/chunks/{git-DBlOv64X.js → git-CoQQ6YEf.js} +1 -1
  115. package/dist/chunks/{githubRepoPathMapping-CK56bUDe.js → githubRepoPathMapping-CmpEaQoo.js} +1 -1
  116. package/dist/chunks/{goal-BZG4gtnb.js → goal-V3qix-i1.js} +3 -3
  117. package/dist/chunks/grok-BLLATotv.js +1 -0
  118. package/dist/chunks/{grove-_zlQ83yR.js → grove-b9gGKgu4.js} +1 -1
  119. package/dist/chunks/{help-C_2tdXHC.js → help-BR7UEr5R.js} +1 -1
  120. package/dist/chunks/{hooks-C7Bn7MBe.js → hooks-C-QMGvCg.js} +3 -3
  121. package/dist/chunks/hooks-D6wtd0Qq.js +1 -0
  122. package/dist/chunks/{initReplBridge-NkZRcM77.js → initReplBridge-DyScxedy.js} +1 -1
  123. package/dist/chunks/{install-Du-DSVzj.js → install-DGH_bjUh.js} +1 -1
  124. package/dist/chunks/{instrumentation-DMs3b82f.js → instrumentation-DQ705pC7.js} +4 -4
  125. package/dist/chunks/{job-rbX1VZmp.js → job-BaMT6Lb2.js} +1 -1
  126. package/dist/chunks/{jwtUtils-OzxN2zts.js → jwtUtils-FQWtM6iM.js} +1 -1
  127. package/dist/chunks/keybindings-CG292HS1.js +2 -0
  128. package/dist/chunks/{launchLocalMemory-BLRCK1_o.js → launchLocalMemory-CtZrkmaw.js} +2 -2
  129. package/dist/chunks/{launchOnboarding-Al_X75Vz.js → launchOnboarding-CyOtdZkT.js} +1 -1
  130. package/dist/chunks/loadAgentsDir-4UC4yLg1.js +1 -0
  131. package/dist/chunks/{loadAgentsDir-BL93ulMm.js → loadAgentsDir-mcRW90aq.js} +596 -604
  132. package/dist/chunks/loadPluginHooks-CWI0RMUx.js +1 -0
  133. package/dist/chunks/{localSearch-C5ipegd9.js → localSearch-CCCDKpYx.js} +1 -1
  134. package/dist/chunks/localSearch-D4hVR7-d.js +1 -0
  135. package/dist/chunks/{log-Dauqle-Z.js → log-27kCA_9u.js} +1 -1
  136. package/dist/chunks/{logoV2Utils-CkvOihX7.js → logoV2Utils--8OUQQPd.js} +1 -1
  137. package/dist/chunks/{magicDocs-DLav5QK0.js → magicDocs-26J_l1De.js} +3 -3
  138. package/dist/chunks/main-CGLCy2pM.js +31 -0
  139. package/dist/chunks/main-DUjtDK1Q.js +513 -0
  140. package/dist/chunks/managedEnv-BuCurT_S.js +1 -0
  141. package/dist/chunks/{managedEnv-DJSCuqCb.js → managedEnv-Ds6MlFQE.js} +1 -1
  142. package/dist/chunks/{mappers-DQxMcezy.js → mappers-DwZw084m.js} +1 -1
  143. package/dist/chunks/mcp-CEKR7PjL.js +6 -0
  144. package/dist/chunks/mcp-DCAf2hHD.js +1 -0
  145. package/dist/chunks/mcp-mCuc8dNe.js +2 -0
  146. package/dist/chunks/{memoize-FeyE7JEh.js → memoize-Co4vS6UF.js} +1 -1
  147. package/dist/chunks/memory-B5SkpC7u.js +1 -0
  148. package/dist/chunks/{mode-Bl2RZC8M.js → mode-B80CHkqo.js} +1 -1
  149. package/dist/chunks/model-BqaneI4D.js +1 -0
  150. package/dist/chunks/model-C29_32BD.js +1 -0
  151. package/dist/chunks/model-NG8fvuT2.js +1 -0
  152. package/dist/chunks/{modelOptions-BtEZe5BB.js → modelOptions-CiZgZxZC.js} +1 -1
  153. package/dist/chunks/{nativeInstaller-BEwayifa.js → nativeInstaller-DqbEfGSX.js} +1 -1
  154. package/dist/chunks/oauth-D38aRTUb.js +1 -0
  155. package/dist/chunks/oauth-U649LV5H.js +1 -0
  156. package/dist/chunks/{observationStore-BpjlK0pG.js → observationStore-D0rm3GhP.js} +1 -1
  157. package/dist/chunks/{omit--yH_T4rf.js → omit-KEhe84f4.js} +1 -1
  158. package/dist/chunks/{onChangeAppState-ZdwI7boX.js → onChangeAppState-Dq1tIEJI.js} +1 -1
  159. package/dist/chunks/openai-BvnsYTpQ.js +10 -0
  160. package/dist/chunks/{panel-CoNfXy3K.js → panel-CoF2a-h4.js} +1 -1
  161. package/dist/chunks/parser-B2PlJg4C.js +1 -0
  162. package/dist/chunks/{parser-BH4u7QiV.js → parser-CUUiH40T.js} +1 -1
  163. package/dist/chunks/partition-DeT341qu.js +1 -0
  164. package/dist/chunks/permissions-BPpeHxpk.js +3 -0
  165. package/dist/chunks/pidLock-DQGDoFQP.js +3 -0
  166. package/dist/chunks/{plan-BNYDTnQd.js → plan-BRiC5ujG.js} +1 -1
  167. package/dist/chunks/{platform-B0uTQc9P.js → platform-Dg1c9F_1.js} +1 -1
  168. package/dist/chunks/plugin-Dcg_GGR9.js +17 -0
  169. package/dist/chunks/pluginAutoupdate-ByH9IPC9.js +1 -0
  170. package/dist/chunks/pluginBlocklist-BfoLN9a-.js +1 -0
  171. package/dist/chunks/pluginCliCommands-Bc2Iybhz.js +1 -0
  172. package/dist/chunks/{pluginFlagging-DcJ_FQuv.js → pluginFlagging-Cr0d0hBA.js} +1 -1
  173. package/dist/chunks/pluginOperations-CKNyYjS-.js +2 -0
  174. package/dist/chunks/pluginStartupCheck-B48_cGgo.js +1 -0
  175. package/dist/chunks/{pluginStartupCheck-CKBFaMFr.js → pluginStartupCheck-DiCDQQlr.js} +1 -1
  176. package/dist/chunks/plugins-BP_36tOl.js +4 -0
  177. package/dist/chunks/poorMode-Djw0P9Gu.js +1 -0
  178. package/dist/chunks/{poorMode-B_xEvuEV.js → poorMode-DxgO_bUb.js} +1 -1
  179. package/dist/chunks/print-2uavraPq.js +26 -0
  180. package/dist/chunks/processBashCommand-g3sAMpHt.js +1 -0
  181. package/dist/chunks/processSlashCommand-tIbeCrv5.js +5 -0
  182. package/dist/chunks/{projectContext-CIxul6vA.js → projectContext-BN2ZWzOG.js} +1 -1
  183. package/dist/chunks/{projectContext-RUMJB798.js → projectContext-Bw3o5BrN.js} +1 -1
  184. package/dist/chunks/{prompt-Dx7IWhBt.js → prompt-DIlq8NTy.js} +4 -4
  185. package/dist/chunks/prompt-DLv-Cd67.js +1 -0
  186. package/dist/chunks/prompt-DV5tCLRh.js +1 -0
  187. package/dist/chunks/{promptEditor-WCkmpejM.js → promptEditor-BILqOGl1.js} +2 -2
  188. package/dist/chunks/{protocolHandler-BiVWrpHi.js → protocolHandler-B83fCYI4.js} +1 -1
  189. package/dist/chunks/{proxy-CVn7o19p.js → proxy-BEKNaTXI.js} +1 -1
  190. package/dist/chunks/rcDebugLog-DSchf3Hs.js +1 -0
  191. package/dist/chunks/reconciler-CDq6XgAS.js +1 -0
  192. package/dist/chunks/refresh-ysrhoWCo.js +1 -0
  193. package/dist/chunks/{registerProtocol-E0Iu5hEx.js → registerProtocol-DduKPsn_.js} +1 -1
  194. package/dist/chunks/{reload-plugins-D-3AUT9g.js → reload-plugins-CGb0HTsH.js} +1 -1
  195. package/dist/chunks/{remoteBridgeCore-CV6we3ZA.js → remoteBridgeCore-BmteXmI9.js} +1 -1
  196. package/dist/chunks/{remoteManagedSettings-D26Q09-7.js → remoteManagedSettings-CwDGxL5p.js} +1 -1
  197. package/dist/chunks/rename-1GLIUlYk.js +1 -0
  198. package/dist/chunks/{renderOptions-DDLbSMQU.js → renderOptions-45A-EdsK.js} +1 -1
  199. package/dist/chunks/resume-DWtlUiHW.js +2 -0
  200. package/dist/chunks/ripgrep-BLQnqPnE.js +1 -0
  201. package/dist/chunks/{ripgrep-C1ydIMzT.js → ripgrep-DQ_ILUJV.js} +1 -1
  202. package/dist/chunks/{runtimeObserver-L7pSIWBT.js → runtimeObserver-4ZqaCXYy.js} +4 -4
  203. package/dist/chunks/{runtimeObserver-OU8KrZQG.js → runtimeObserver-CtNY8Al2.js} +1 -1
  204. package/dist/chunks/sandbox-adapter-BzjRQh_r.js +1 -0
  205. package/dist/chunks/sandbox-toggle-Bz49-F6e.js +1 -0
  206. package/dist/chunks/searchExtraTools-D6vj8qJ-.js +1 -0
  207. package/dist/chunks/{session-DUYsfPy_.js → session-wb6X4Wrq.js} +2 -2
  208. package/dist/chunks/sessionFileAccessHooks-Da97UA2n.js +1 -0
  209. package/dist/chunks/{sessionObserver-Dv3Ba8eA.js → sessionObserver-BJQ5hwjU.js} +2 -2
  210. package/dist/chunks/sessionObserver-DXO4trhk.js +1 -0
  211. package/dist/chunks/{sessionState-D-SaBzWD.js → sessionState-Bn3ESS5f.js} +1 -1
  212. package/dist/chunks/sessionStorage-DlPVsQn9.js +1 -0
  213. package/dist/chunks/{sessionStoragePortable-JZnGwqUM.js → sessionStoragePortable-BhkGMZWp.js} +1 -1
  214. package/dist/chunks/sessionTitle-Cbzrb9jT.js +14 -0
  215. package/dist/chunks/{sessionTracing-Bqb3vJTt.js → sessionTracing-CEsm8pZL.js} +1 -1
  216. package/dist/chunks/settings-3ionQKNv.js +1 -0
  217. package/dist/chunks/settings-DiBMs2gM.js +20 -0
  218. package/dist/chunks/settingsSync-eHaSngKo.js +1 -0
  219. package/dist/chunks/setup-DeyiuGNX.js +3 -0
  220. package/dist/chunks/{shadowedRuleDetection-BzAZ57p2.js → shadowedRuleDetection-D5X5fhzj.js} +1 -1
  221. package/dist/chunks/{shellQuote-DS6WrivY.js → shellQuote-C_I6DHLV.js} +1 -1
  222. package/dist/chunks/{sideQuestion-CvMBBjI8.js → sideQuestion-BHRtwhyj.js} +3 -3
  223. package/dist/chunks/{sinks-f7qYjbKJ.js → sinks-Bgy2UNK-.js} +2 -2
  224. package/dist/chunks/sinks-CgzLmim2.js +1 -0
  225. package/dist/chunks/skillChangeDetector-BlSP16j6.js +1 -0
  226. package/dist/chunks/{skillGapStore-CqaT8c0C.js → skillGapStore-BjQSSz2E.js} +2 -2
  227. package/dist/chunks/{skillLifecycle-CnR8IqJM.js → skillLifecycle-Sp8strFv.js} +2 -2
  228. package/dist/chunks/{skillSearchPanel-D9qrOXpI.js → skillSearchPanel-3sYRez_Q.js} +5 -5
  229. package/dist/chunks/skills-CJhWI8t1.js +1 -0
  230. package/dist/chunks/startupProfiler-CUlV07MD.js +1 -0
  231. package/dist/chunks/{startupProfiler-CmH_aVy2.js → startupProfiler-Dc5r6LgE.js} +2 -2
  232. package/dist/chunks/{state-BemZdQIl.js → state-BPFYBqm1.js} +1 -1
  233. package/dist/chunks/state-CsdHk8n-.js +1 -0
  234. package/dist/chunks/{stats-B8uQ-UDi.js → stats-BkadEKa-.js} +1 -1
  235. package/dist/chunks/status-CDCurOqs.js +2 -0
  236. package/dist/chunks/{status-BekdWoIj.js → status-yoQIQ2Ni.js} +1 -1
  237. package/dist/chunks/statusNoticeHelpers-Sl4jjauz.js +1 -0
  238. package/dist/chunks/{stringUtils-C8PaYpQF.js → stringUtils-Df-Lnjxd.js} +1 -1
  239. package/dist/chunks/{subprocessEnv-Ci8VV_bi.js → subprocessEnv-CNBOhlDV.js} +1 -1
  240. package/dist/chunks/subprocessEnv-DtBCqQIo.js +1 -0
  241. package/dist/chunks/switcher-C-m6MUwE.js +1 -0
  242. package/dist/chunks/switcher-uoQMHmEZ.js +1 -0
  243. package/dist/chunks/{syncCache-ClP9aBqK.js → syncCache-BooMjgU6.js} +1 -1
  244. package/dist/chunks/{tasks-Dmh6qikm.js → tasks-CHG_6sXQ.js} +1 -1
  245. package/dist/chunks/teleport-C9KRE4X8.js +1 -0
  246. package/dist/chunks/{templateJobs-CxqU-s5i.js → templateJobs-BYYfF4m5.js} +2 -2
  247. package/dist/chunks/{terminalSetup-BKGcmlWp.js → terminalSetup-CbXKCpWM.js} +1 -1
  248. package/dist/chunks/{terminalSetup-Cy19F1Js.js → terminalSetup-fwhFTxGi.js} +1 -1
  249. package/dist/chunks/{theme-U7lMFHQ0.js → theme-MvX7hojJ.js} +1 -1
  250. package/dist/chunks/tmux-d3cNCIZA.js +1 -0
  251. package/dist/chunks/{toolEventObserver-D9qjoVl5.js → toolEventObserver-BFEl47bq.js} +1 -1
  252. package/dist/chunks/toolPool-Cq74Cvjp.js +1 -0
  253. package/dist/chunks/trustedDevice-BGwujSqc.js +1 -0
  254. package/dist/chunks/{trustedDevice-DL0pWP4_.js → trustedDevice-BLiKbGpG.js} +1 -1
  255. package/dist/chunks/{types-DafcFtmb.js → types-BJ7qTz75.js} +1 -1
  256. package/dist/chunks/{udsClient-CWnfsgFP.js → udsClient-CF8BmZgN.js} +1 -1
  257. package/dist/chunks/{updateCCB-C6XftzIG.js → updateCCB-CfckOy7T.js} +1 -1
  258. package/dist/chunks/{upstreamproxy-CXmjxHpl.js → upstreamproxy-BuBFDFAD.js} +1 -1
  259. package/dist/chunks/{useExitOnCtrlCDWithKeybindings-DEEJhm_W.js → useExitOnCtrlCDWithKeybindings-CPLBDluY.js} +1 -1
  260. package/dist/chunks/useMainLoopModel-C00PbZ1Q.js +1 -0
  261. package/dist/chunks/useManagePlugins-DFaGntzJ.js +1 -0
  262. package/dist/chunks/{useMergedTools-DbhqKk1-.js → useMergedTools-DYobZ5N4.js} +1 -1
  263. package/dist/chunks/{useSearchInput-gUDbkLaC.js → useSearchInput-KFKh2ozY.js} +1 -1
  264. package/dist/chunks/useSettingsErrors-BRgjvaHd.js +1 -0
  265. package/dist/chunks/{userAgent-CU7Ndh79.js → userAgent-DUrr02yh.js} +1 -1
  266. package/dist/chunks/util-D7uwPgF1.js +1 -0
  267. package/dist/chunks/validatePlugin-VukX52bx.js +1 -0
  268. package/dist/chunks/{vim-w37BfGZ5.js → vim-C4Hs5U2h.js} +1 -1
  269. package/dist/chunks/{which-BRWBO7Gu.js → which-mplwBbc0.js} +1 -1
  270. package/dist/chunks/windowsPaths-B8p9tFRF.js +1 -0
  271. package/dist/chunks/{windowsPaths-DtWHLjmE.js → windowsPaths-C7Mdo9aU.js} +1 -1
  272. package/dist/chunks/{workSecret-BEhXgH2M.js → workSecret-XLodD7tw.js} +1 -1
  273. package/dist/chunks/workerRegistry-BA37PVbv.js +6 -0
  274. package/dist/chunks/worktree-Lik8xuKd.js +1 -0
  275. package/dist/cli.js +1 -1
  276. package/package.json +1 -1
  277. package/dist/chunks/App-BuKmqFPm.js +0 -1
  278. package/dist/chunks/ApproveApiKey-CIWOi_7v.js +0 -1
  279. package/dist/chunks/ApproveApiKey-M6U-NafA.js +0 -1
  280. package/dist/chunks/BackgroundTasksDialog-Pnpl3Ixx.js +0 -2
  281. package/dist/chunks/ClaudeMdExternalIncludesDialog-CSywJdVL.js +0 -1
  282. package/dist/chunks/ClaudeMdExternalIncludesDialog-D-w166RC.js +0 -1
  283. package/dist/chunks/ConsoleOAuthFlow-CV6PcJOP.js +0 -1
  284. package/dist/chunks/Doctor-BcnUfJ4I.js +0 -1
  285. package/dist/chunks/Doctor-Dz4TuYas.js +0 -3
  286. package/dist/chunks/ExitFlow-BwyAtIHx.js +0 -2
  287. package/dist/chunks/InvalidConfigDialog-bih293Xt.js +0 -1
  288. package/dist/chunks/MCPConnectionManager-B9n4SXN4.js +0 -1
  289. package/dist/chunks/MCPToolListView-DJ06N1DG.js +0 -1
  290. package/dist/chunks/MessageSelector-o4ULADFg.js +0 -3
  291. package/dist/chunks/Messages-qqwHuAW5.js +0 -11
  292. package/dist/chunks/Onboarding-BzuQjney.js +0 -1
  293. package/dist/chunks/QueryEngine-Dt0BKUeF.js +0 -1
  294. package/dist/chunks/REPL-CUbEDqEl.js +0 -133
  295. package/dist/chunks/REPL-DMaKNhTa.js +0 -1
  296. package/dist/chunks/RemoteSessionManager-Bf44A0Ol.js +0 -2
  297. package/dist/chunks/ResumeConversation-Ctw5Q1g9.js +0 -1
  298. package/dist/chunks/SearchExtraToolsTool-C80OdtPZ.js +0 -1
  299. package/dist/chunks/Settings-DfdcmvOV.js +0 -2
  300. package/dist/chunks/TrustDialog-ACaJ_m7A.js +0 -1
  301. package/dist/chunks/WelcomeV2-ZQRKlcT4.js +0 -1
  302. package/dist/chunks/add-dir-SAKTkw0S.js +0 -1
  303. package/dist/chunks/agents-ZgRKpjHv.js +0 -103
  304. package/dist/chunks/allErrors-_cOQksHC.js +0 -1
  305. package/dist/chunks/api-DS1MiW01.js +0 -1
  306. package/dist/chunks/auth-DGZzCbU0.js +0 -1
  307. package/dist/chunks/auth-DN1MUpB8.js +0 -1
  308. package/dist/chunks/autoMode-CBtY7ACs.js +0 -45
  309. package/dist/chunks/autonomy-DuQmYhq6.js +0 -15
  310. package/dist/chunks/autonomy-lJV7yWUl.js +0 -1
  311. package/dist/chunks/autonomyPanel-DAQm6lDz.js +0 -1
  312. package/dist/chunks/backgroundHousekeeping-BTy71bcY.js +0 -1
  313. package/dist/chunks/backgroundHousekeeping-Cc7Ag7JG.js +0 -17
  314. package/dist/chunks/bg-CJ0YWFli.js +0 -9
  315. package/dist/chunks/bg-CeUrRz_7.js +0 -1
  316. package/dist/chunks/branch-k3kirqbA.js +0 -3
  317. package/dist/chunks/bridgeConfig-CzRUPn-D.js +0 -1
  318. package/dist/chunks/btw-nVoVuIae.js +0 -1
  319. package/dist/chunks/caches-B8sM3Zys.js +0 -1
  320. package/dist/chunks/caches-Bp9MZ7IE.js +0 -1
  321. package/dist/chunks/cliLaunch-BTpfAGGI.js +0 -1
  322. package/dist/chunks/client-BCAbKdNz.js +0 -1
  323. package/dist/chunks/client-CJE6gEvU.js +0 -1
  324. package/dist/chunks/commands-DL-BzoMQ.js +0 -1
  325. package/dist/chunks/compact-Cx7BPXLU.js +0 -2
  326. package/dist/chunks/config-S5OW4Xqr.js +0 -1
  327. package/dist/chunks/config-aRiTrtCv.js +0 -3
  328. package/dist/chunks/connectHeadless-CqRoEtrg.js +0 -1
  329. package/dist/chunks/context-noninteractive-DPacEFJ1.js +0 -1
  330. package/dist/chunks/conversation-D5Nbu9eT.js +0 -1
  331. package/dist/chunks/conversation-hcUx9e-C.js +0 -1
  332. package/dist/chunks/createSSHSession-DecOR6M5.js +0 -6
  333. package/dist/chunks/createSession-D27zvmOs.js +0 -1
  334. package/dist/chunks/crossProjectResume-Bw3U0Ty6.js +0 -40
  335. package/dist/chunks/cwd-ClLru_7T.js +0 -1
  336. package/dist/chunks/dangerousBackend-DwcP0P08.js +0 -1
  337. package/dist/chunks/datadog-bm551AVV.js +0 -1
  338. package/dist/chunks/detached-CIyF0M5O.js +0 -5
  339. package/dist/chunks/detectRepository-DDfLfKcM.js +0 -1
  340. package/dist/chunks/doctor-BJORBomU.js +0 -1
  341. package/dist/chunks/exit-CF3KBl-S.js +0 -1
  342. package/dist/chunks/extractMemories-4lBn134y.js +0 -1
  343. package/dist/chunks/fast-0Vi354KI.js +0 -1
  344. package/dist/chunks/firstPartyEventLogger-BNBnLYPK.js +0 -1
  345. package/dist/chunks/generateSessionName-DhS_6oHd.js +0 -1
  346. package/dist/chunks/git-DF4RFFaT.js +0 -1
  347. package/dist/chunks/grok-BS57ZhyW.js +0 -1
  348. package/dist/chunks/hooks-DT80Arzc.js +0 -1
  349. package/dist/chunks/keybindings-CwdC_8S0.js +0 -2
  350. package/dist/chunks/loadAgentsDir-eVKq8efm.js +0 -1
  351. package/dist/chunks/loadPluginHooks-B0au35a4.js +0 -1
  352. package/dist/chunks/localSearch-CZlFfR_X.js +0 -1
  353. package/dist/chunks/lockfile-D5-j7HOZ.js +0 -1
  354. package/dist/chunks/main-CVNWNAoh.js +0 -513
  355. package/dist/chunks/main-LMyE3jXY.js +0 -31
  356. package/dist/chunks/managedEnv-CYepSnm8.js +0 -1
  357. package/dist/chunks/mcp-BAbbEaBA.js +0 -1
  358. package/dist/chunks/mcp-Ct4Sum6A.js +0 -6
  359. package/dist/chunks/mcp-D5HkCqUh.js +0 -2
  360. package/dist/chunks/memory-COa7aUbx.js +0 -1
  361. package/dist/chunks/model-B7rtZ7KV.js +0 -1
  362. package/dist/chunks/model-Bgh_r4lg.js +0 -1
  363. package/dist/chunks/model-DiuEAv6h.js +0 -1
  364. package/dist/chunks/oauth-BN2I0_jl.js +0 -1
  365. package/dist/chunks/oauth-C9VBDB0Y.js +0 -1
  366. package/dist/chunks/openai-DWs4D-nQ.js +0 -10
  367. package/dist/chunks/parseConnectUrl-BiyKR5-x.js +0 -1
  368. package/dist/chunks/parser-BMIaRErw.js +0 -1
  369. package/dist/chunks/partition-DLcW5Oo_.js +0 -1
  370. package/dist/chunks/permissions-CaucYK3s.js +0 -3
  371. package/dist/chunks/pidLock-DgOBc1Xo.js +0 -3
  372. package/dist/chunks/plugin-BN-of1_H.js +0 -17
  373. package/dist/chunks/pluginAutoupdate-BBU9Jn4p.js +0 -1
  374. package/dist/chunks/pluginBlocklist-DXQlbG0P.js +0 -1
  375. package/dist/chunks/pluginCliCommands-CfdVNs8D.js +0 -1
  376. package/dist/chunks/pluginOperations-DnhzFbYI.js +0 -2
  377. package/dist/chunks/pluginStartupCheck-CpNB4jxG.js +0 -1
  378. package/dist/chunks/plugins-CBW7kPyp.js +0 -4
  379. package/dist/chunks/poorMode-yH1o41cQ.js +0 -1
  380. package/dist/chunks/print-BZOx09SU.js +0 -26
  381. package/dist/chunks/processBashCommand-dcCNCiBp.js +0 -1
  382. package/dist/chunks/processSlashCommand-YDiM63Qr.js +0 -5
  383. package/dist/chunks/prompt-CXGy0llt.js +0 -1
  384. package/dist/chunks/prompt-DovNDmcx.js +0 -1
  385. package/dist/chunks/rcDebugLog-CARUIORE.js +0 -1
  386. package/dist/chunks/reconciler-C2Nd_e4n.js +0 -1
  387. package/dist/chunks/refresh-B84H2Ezd.js +0 -1
  388. package/dist/chunks/rename-CSavuBIE.js +0 -1
  389. package/dist/chunks/resume-CROylN3J.js +0 -2
  390. package/dist/chunks/ripgrep-2M1GkXqJ.js +0 -1
  391. package/dist/chunks/sandbox-adapter-6UwMLh6e.js +0 -1
  392. package/dist/chunks/sandbox-toggle-YrQNWGsr.js +0 -1
  393. package/dist/chunks/searchExtraTools-Bdv5HJ74.js +0 -1
  394. package/dist/chunks/server-LdbAb0sV.js +0 -1
  395. package/dist/chunks/serverBanner-BdExKFHT.js +0 -1
  396. package/dist/chunks/serverLog-BFmvyJ93.js +0 -1
  397. package/dist/chunks/sessionFileAccessHooks-Czen7Ejz.js +0 -1
  398. package/dist/chunks/sessionManager-CPa049BO.js +0 -1
  399. package/dist/chunks/sessionObserver-B0zucj_c.js +0 -1
  400. package/dist/chunks/sessionStorage-BM1x51Z7.js +0 -1
  401. package/dist/chunks/sessionTitle-uCuYaNif.js +0 -14
  402. package/dist/chunks/settings-BG15IFYx.js +0 -1
  403. package/dist/chunks/settings-D4CpDv2y.js +0 -20
  404. package/dist/chunks/settingsSync-BSrpnyqo.js +0 -1
  405. package/dist/chunks/setup-C62oq4AZ.js +0 -3
  406. package/dist/chunks/sinks-WJ7nzLQs.js +0 -1
  407. package/dist/chunks/skillChangeDetector-U5kRU5nd.js +0 -1
  408. package/dist/chunks/skills-BgcFh0vy.js +0 -1
  409. package/dist/chunks/startupProfiler-B4HBBbHN.js +0 -1
  410. package/dist/chunks/state-BAGmpVBn.js +0 -1
  411. package/dist/chunks/state-D_lk6z-C.js +0 -1
  412. package/dist/chunks/status-D6KlRJmR.js +0 -2
  413. package/dist/chunks/statusNoticeHelpers-BMM8_uJ1.js +0 -1
  414. package/dist/chunks/subprocessEnv-CZkA9Cdp.js +0 -1
  415. package/dist/chunks/switcher-Ck9CrXrr.js +0 -1
  416. package/dist/chunks/switcher-DnAhkyIn.js +0 -1
  417. package/dist/chunks/teleport-DH3IuAUQ.js +0 -1
  418. package/dist/chunks/tmux-D5EvHWi3.js +0 -1
  419. package/dist/chunks/toolPool-69mfSPAs.js +0 -1
  420. package/dist/chunks/trustedDevice-B6AKlsl_.js +0 -1
  421. package/dist/chunks/useMainLoopModel-6w7mhwhU.js +0 -1
  422. package/dist/chunks/useManagePlugins-CjnsO-Of.js +0 -1
  423. package/dist/chunks/useSettingsErrors-CgPad-H0.js +0 -1
  424. package/dist/chunks/util-B4oMhJKh.js +0 -1
  425. package/dist/chunks/validatePlugin-y_O_tCEL.js +0 -1
  426. package/dist/chunks/windowsPaths-BY-IVNwQ.js +0 -1
  427. package/dist/chunks/workerRegistry-Bq9bS5pw.js +0 -6
  428. package/dist/chunks/worktree-4SUJ4dtz.js +0 -1
@@ -0,0 +1,17 @@
1
+ import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{l as n,o as r}from"./envUtils-DcaKZlRU.js";import{n as i,t as a}from"./figures-5ThXQEtq.js";import{$o as o,$w as s,Ap as c,Au as l,Aw as u,Bw as d,Co as f,Do as p,Dw as m,EC as h,Eo as g,Fo as _,Ho as v,Ko as y,Kw as b,MC as x,Mo as S,Mu as ee,Px as te,Qo as C,Ro as w,Wo as ne,Ww as re,Xo as ie,Xw as T,Zo as E,Zw as ae,_S as oe,_g as se,_o as ce,ag as D,cS as O,dS as le,do as k,eT as A,es as ue,fS as de,gS as j,gg as M,go as N,hS as fe,iS as pe,is as me,jp as P,jw as he,jx as ge,ko as _e,lS as ve,mS as ye,ng as be,ns as F,od as xe,os as Se,pS as I,qo as Ce,rS as we,rg as Te,sS as Ee,sd as De,ss as Oe,ts as ke,uS as Ae,uo as je,zo as Me}from"./loadAgentsDir-mcRW90aq.js";import{D as Ne,Gr as Pe,Gt as L,H as Fe,I as R,P as z,T as B,Wt as Ie,Xn as Le,fi as V,hn as Re,j as ze,k as Be,n as Ve,ot as He,r as Ue,t as We,x as Ge,y as Ke}from"./src-P_wYS_NJ2.js";import{t as qe}from"./jsx-runtime-Bb4Xn-E0.js";import{P as Je,R as Ye,S as Xe,U as Ze,c as Qe,i as $e,x as et}from"./debug-Dr1SjdXn.js";import{Ln as tt,Rn as nt,c as rt,f as it,g as at,vt as ot,x as st,xt as ct}from"./settings-DiBMs2gM.js";import{b as lt,h as ut}from"./config-9rLTDOYW.js";import{o as dt,s as ft}from"./log-27kCA_9u.js";import{n as pt,r as mt}from"./analytics-DJobLaWP.js";import{C as ht,y as gt}from"./startupProfiler-Dc5r6LgE.js";import{l as H,o as _t}from"./stringUtils-Df-Lnjxd.js";import{n as vt,t as yt}from"./pluginStartupCheck-DiCDQQlr.js";import{a as bt,d as xt,f as St,i as Ct,l as wt,o as Tt,s as Et,u as Dt}from"./pluginOperations-CKNyYjS-.js";import{a as Ot,c as kt,i as At,n as jt,o as Mt,s as Nt,t as Pt}from"./validatePlugin-VukX52bx.js";import{a as Ft,n as It,o as Lt,r as Rt}from"./pluginFlagging-Cr0d0hBA.js";import{i as zt,n as Bt}from"./MCPConnectionManager-aDDsYkGM.js";import{n as Vt,t as Ht}from"./useExitOnCtrlCDWithKeybindings-CPLBDluY.js";import{t as Ut}from"./SearchBox-C9vUA4IM.js";import{n as Wt,t as Gt}from"./useSearchInput-KFKh2ozY.js";import{a as Kt,c as qt,i as Jt,n as Yt,o as Xt,r as Zt,s as Qt,t as $t}from"./MCPToolListView-Cr0MDkzT.js";import{i as en,n as tn}from"./pluginAutoupdate-ByH9IPC9.js";import*as nn from"path";import*as rn from"fs/promises";function an({inputValue:e,setInputValue:t,cursorOffset:n,setCursorOffset:r,error:i,setError:a,result:o,setResult:s,setViewState:u,onAddComplete:d,cliMode:f=!1}){let p=(0,on.useRef)(!1),[m,h]=(0,on.useState)(!1),[g,_]=(0,on.useState)(``),v=async()=>{let t=e.trim();if(!t){a(`Please enter a marketplace source`);return}let n=await Ot(t);if(!n){a(`Invalid marketplace source format. Try: owner/repo, https://..., or ./path`);return}if(`error`in n){a(n.error);return}a(null);try{h(!0),_(``);let{name:e,resolvedSource:t}=await S(n,e=>{_(e)});y(e,{source:t}),Se();let r=n.source;n.source===`github`&&(r=n.repo),mt(`tengu_marketplace_added`,{source_type:r}),d&&await d(),_(``),h(!1),f?s(`Successfully added marketplace: ${e}`):u({type:`browse-marketplace`,targetMarketplace:e})}catch(e){let t=Ze(e);ft(t),a(t.message),_(``),h(!1),s(f?`Error: ${t.message}`:null)}};return(0,on.useEffect)(()=>{e&&!p.current&&!i&&!o&&(p.current=!0,v())},[]),(0,U.jsxs)(R,{flexDirection:`column`,children:[(0,U.jsxs)(R,{flexDirection:`column`,paddingX:1,borderStyle:`round`,children:[(0,U.jsx)(R,{marginBottom:1,children:(0,U.jsx)(z,{bold:!0,children:`Add Marketplace`})}),(0,U.jsxs)(R,{flexDirection:`column`,children:[(0,U.jsx)(z,{children:`Enter marketplace source:`}),(0,U.jsx)(z,{dimColor:!0,children:`Examples:`}),(0,U.jsx)(z,{dimColor:!0,children:` · owner/repo (GitHub)`}),(0,U.jsx)(z,{dimColor:!0,children:` · git@github.com:owner/repo.git (SSH)`}),(0,U.jsx)(z,{dimColor:!0,children:` · https://example.com/marketplace.json`}),(0,U.jsx)(z,{dimColor:!0,children:` · ./path/to/marketplace`}),(0,U.jsx)(R,{marginTop:1,children:(0,U.jsx)(xe,{value:e,onChange:t,onSubmit:v,columns:80,cursorOffset:n,onChangeCursorOffset:r,focus:!0,showCursor:!0})})]}),m&&(0,U.jsxs)(R,{marginTop:1,children:[(0,U.jsx)(l,{}),(0,U.jsx)(z,{children:g||`Adding marketplace to configuration…`})]}),i&&(0,U.jsx)(R,{marginTop:1,children:(0,U.jsx)(z,{color:`error`,children:i})}),o&&(0,U.jsx)(R,{marginTop:1,children:(0,U.jsx)(z,{children:o})})]}),(0,U.jsx)(R,{marginLeft:3,children:(0,U.jsx)(z,{dimColor:!0,italic:!0,children:(0,U.jsxs)(B,{children:[(0,U.jsx)(Ne,{shortcut:`Enter`,action:`add`}),(0,U.jsx)(c,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]})})})]})}var on,U,sn=e((()=>{V(),on=t(V(),1),pt(),P(),We(),ee(),De(),Ye(),dt(),Oe(),w(),At(),U=qe()}));function cn(e,t,r,i){let a={};for(let o of e){let e=r[o],s=t[o]??``;if(!(e?.sensitive===!0&&s===``&&i?.[o]!==void 0))if(e?.type===`number`){if(s.trim()===``)continue;let e=Number(s);a[o]=Number.isNaN(e)?s:e}else e?.type===`boolean`?a[o]=n(s):a[o]=s}return a}function ln({title:e,subtitle:t,configSchema:n,initialValues:r,onSave:i,onCancel:o}){let s=Object.keys(n),c=(0,un.useCallback)(e=>{if(n[e]?.sensitive===!0)return``;let t=r?.[e];return t===void 0?``:String(t)},[n,r]),[l,u]=(0,un.useState)(0),[d,f]=(0,un.useState)({}),[p,m]=(0,un.useState)(()=>s[0]?c(s[0]):``),h=s[l],g=h?n[h]:null;if(Ie(`confirm:no`,o,{context:`Settings`}),L({"confirm:nextField":(0,un.useCallback)(()=>{if(l<s.length-1&&h){f(e=>({...e,[h]:p})),u(e=>e+1);let e=s[l+1];m(e?c(e):``)}},[l,s,h,p,c]),"confirm:yes":(0,un.useCallback)(()=>{if(!h)return;let e={...d,[h]:p};if(l===s.length-1)i(cn(s,e,n,r));else{f(e),u(e=>e+1);let t=s[l+1];m(t?c(t):``)}},[h,d,p,l,s,n,i,c,r])},{context:`Confirmation`}),Re((e,t)=>{if(t.backspace||t.delete){m(e=>e.slice(0,-1));return}e&&!t.ctrl&&!t.meta&&!t.tab&&!t.return&&m(t=>t+e)}),!g||!h)return null;let _=g.sensitive===!0,v=g.required===!0,y=_?`*`.repeat(Pe(p)):p;return(0,dn.jsxs)(Ke,{title:e,subtitle:t,onCancel:o,isCancelActive:!1,children:[(0,dn.jsxs)(R,{flexDirection:`column`,children:[(0,dn.jsxs)(z,{bold:!0,children:[g.title||h,v&&(0,dn.jsx)(z,{color:`error`,children:` *`})]}),g.description&&(0,dn.jsx)(z,{dimColor:!0,children:g.description}),(0,dn.jsxs)(R,{marginTop:1,children:[(0,dn.jsxs)(z,{children:[a.pointerSmall,` `]}),(0,dn.jsx)(z,{children:y}),(0,dn.jsx)(z,{children:`█`})]})]}),(0,dn.jsxs)(R,{flexDirection:`column`,children:[(0,dn.jsxs)(z,{dimColor:!0,children:[`Field `,l+1,` of `,s.length]}),l<s.length-1&&(0,dn.jsx)(z,{dimColor:!0,children:`Tab: Next field · Enter: Save and continue`}),l===s.length-1&&(0,dn.jsx)(z,{dimColor:!0,children:`Enter: Save configuration`})]})]})}var un,dn,fn=e((()=>{i(),un=t(V(),1),We(),h(),r(),dn=qe()}));async function pn(e){let{enabled:t,disabled:n}=await k();return[...t,...n].find(t=>t.repository===e||t.source===e)}function mn({plugin:e,pluginId:t,onDone:n}){let[r]=hn.useState(()=>{let n=[],r=Ee(e);Object.keys(r).length>0&&n.push({key:`top-level`,title:`Configure ${e.name}`,subtitle:`Plugin options`,schema:r,load:()=>ve(t),save:n=>Ae(t,n,e.manifest.userConfig)});let i=we(e);for(let r of i)n.push({key:`channel:${r.server}`,title:`Configure ${r.displayName}`,subtitle:`Plugin: ${e.name}`,schema:r.configSchema,load:()=>I(t,r.server)??void 0,save:e=>fe(t,r.server,e,r.configSchema)});return n}),[i,a]=hn.useState(0),o=hn.useRef(n);if(o.current=n,hn.useEffect(()=>{r.length===0&&o.current(`skipped`)},[r.length]),r.length===0)return null;let s=r[i];function c(e){try{s.save(e)}catch(e){n(`error`,Je(e));return}let t=i+1;t<r.length?a(t):n(`configured`)}return(0,gn.jsx)(ln,{title:s.title,subtitle:s.subtitle,configSchema:s.schema,initialValues:s.load(),onSave:c,onCancel:()=>n(`skipped`)},s.key)}var hn,gn,_n=e((()=>{hn=t(V(),1),Ye(),le(),pe(),je(),O(),fn(),gn=qe()}));function vn(){let e=ke();return(0,yn.jsxs)(R,{marginBottom:1,children:[(0,yn.jsxs)(z,{color:`claude`,children:[a.warning,` `]}),(0,yn.jsxs)(z,{dimColor:!0,italic:!0,children:[`Make sure you trust a plugin before installing, updating, or using it. We do not control what MCP servers, files, or other software are included in plugins and cannot verify that they will work as intended or that they won't change. See each plugin's homepage for more information.`,e?` ${e}`:``]})]})}var yn,bn=e((()=>{i(),V(),We(),F(),yn=qe()}));function xn(e){return e.entry.source&&typeof e.entry.source==`object`&&`source`in e.entry.source&&e.entry.source.source===`github`&&typeof e.entry.source==`object`&&`repo`in e.entry.source?e.entry.source.repo:null}function Sn(e,t){let n=[{label:`Install for you (user scope)`,action:`install-user`},{label:`Install for all collaborators on this repository (project scope)`,action:`install-project`},{label:`Install for you, in this repo only (local scope)`,action:`install-local`}];return e&&n.push({label:`Open homepage`,action:`homepage`}),t&&n.push({label:`View on GitHub`,action:`github`}),n.push({label:`Back to plugin list`,action:`back`}),n}function Cn({hasSelection:e}){return(0,wn.jsx)(R,{marginTop:1,children:(0,wn.jsx)(z,{dimColor:!0,italic:!0,children:(0,wn.jsxs)(B,{children:[e&&(0,wn.jsx)(c,{action:`plugin:install`,context:`Plugin`,fallback:`i`,description:`install`,bold:!0}),(0,wn.jsx)(c,{action:`plugin:toggle`,context:`Plugin`,fallback:`Space`,description:`toggle`}),(0,wn.jsx)(c,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`details`}),(0,wn.jsx)(c,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})}var wn,Tn=e((()=>{V(),P(),We(),wn=qe()}));function En({totalItems:e,maxVisible:t=On,selectedIndex:n=0}){let r=e>t,i=(0,Dn.useRef)(0),a=(0,Dn.useMemo)(()=>{if(!r)return 0;let a=i.current;if(n<a)return i.current=n,n;if(n>=a+t){let e=n-t+1;return i.current=e,e}let o=Math.max(0,e-t),s=Math.min(a,o);return i.current=s,s},[n,t,r,e]),o=a,s=Math.min(a+t,e),c=(0,Dn.useCallback)(e=>r?e.slice(o,s):e,[r,o,s]),l=(0,Dn.useCallback)(e=>o+e,[o]),u=(0,Dn.useCallback)(e=>e>=o&&e<s,[o,s]),d=(0,Dn.useCallback)(e=>{},[]),f=(0,Dn.useCallback)(()=>{},[]),p=(0,Dn.useCallback)(()=>{},[]),m=(0,Dn.useCallback)((t,n)=>{n(Math.max(0,Math.min(t,e-1)))},[e]),h=(0,Dn.useCallback)((e,t)=>!1,[]),g=Math.max(1,Math.ceil(e/t));return{currentPage:Math.floor(a/t),totalPages:g,startIndex:o,endIndex:s,needsPagination:r,pageSize:t,getVisibleItems:c,toActualIndex:l,isOnCurrentPage:u,goToPage:d,nextPage:f,prevPage:p,handleSelectionChange:m,handlePageNavigation:h,scrollPosition:{current:n+1,total:e,canScrollUp:a>0,canScrollDown:a+t<e}}}var Dn,On,kn=e((()=>{Dn=t(V(),1),On=5}));function An({error:e,setError:t,result:n,setResult:r,setViewState:i,onInstallComplete:s,targetMarketplace:l,targetPlugin:u}){let[d,f]=(0,W.useState)(`marketplace-list`),[m,h]=(0,W.useState)(null),[v,y]=(0,W.useState)(null),[b,x]=(0,W.useState)([]),[S,ee]=(0,W.useState)([]),[te,w]=(0,W.useState)(!0),[ne,re]=(0,W.useState)(null),[T,E]=(0,W.useState)(0),[ae,D]=(0,W.useState)(new Set),[O,le]=(0,W.useState)(new Set),k=En({totalItems:S.length,selectedIndex:T}),[A,de]=(0,W.useState)(0),[j,M]=(0,W.useState)(!1),[N,fe]=(0,W.useState)(null),[pe,P]=(0,W.useState)(null);Ie(`confirm:no`,jn.useCallback(()=>{d===`plugin-list`?l?i({type:`manage-marketplaces`,targetMarketplace:l}):b.length===1?i({type:`menu`}):(f(`marketplace-list`),h(null),D(new Set)):d===`plugin-details`?(f(`plugin-list`),y(null)):i({type:`menu`})},[d,l,i,b.length]),{context:`Confirmation`}),(0,W.useEffect)(()=>{async function e(){try{let e=await Me(),{marketplaces:n,failures:r}=await me(e),i=[];for(let{name:e,config:t,data:r}of n)if(r){let n=tt(r.plugins,t=>p(ie(t.name,e)));i.push({name:e,totalPlugins:r.plugins.length,installedCount:n,source:ue(t.source)})}i.sort((e,t)=>e.name===`claude-plugin-directory`?-1:+(t.name===`claude-plugin-directory`)),x(i);let a=o(r,tt(n,e=>e.data!==null));if(a)if(a.type===`warning`)P(a.message+`. Showing available marketplaces.`);else throw Error(a.message);if(i.length===1&&!l&&!u){let e=i[0];e&&(h(e.name),f(`plugin-list`))}if(u){let n=null,r=null;for(let[t]of Object.entries(e)){let e=await _(t);if(e){let i=e.plugins.find(e=>e.name===u);if(i){let e=ie(i.name,t);n={entry:i,marketplaceName:t,pluginId:e,isInstalled:g(e)},r=t;break}}}if(n&&r){let e=n.pluginId;g(e)?t(`Plugin '${e}' is already installed globally. Use '/plugin' to manage existing plugins.`):(h(r),y(n),f(`plugin-details`))}else t(`Plugin "${u}" not found in any marketplace`)}else l&&(i.some(e=>e.name===l)?(h(l),f(`plugin-list`)):t(`Marketplace "${l}" not found`))}catch(e){t(e instanceof Error?e.message:`Failed to load marketplaces`)}finally{w(!1)}}e()},[t,l,u]),(0,W.useEffect)(()=>{if(!m)return;let e=!1;async function n(n){w(!0);try{let t=await _(n);if(e)return;if(!t)throw Error(`Failed to load marketplace: ${n}`);let r=[];for(let e of t.plugins){let t=ie(e.name,n);se(t)||r.push({entry:e,marketplaceName:n,pluginId:t,isInstalled:g(t)})}try{let t=await Nt();if(e)return;re(t),t?r.sort((e,n)=>{let r=t.get(e.pluginId)??0,i=t.get(n.pluginId)??0;return r===i?e.entry.name.localeCompare(n.entry.name):i-r}):r.sort((e,t)=>e.entry.name.localeCompare(t.entry.name))}catch(t){if(e)return;Qe(`Failed to fetch install counts: ${Je(t)}`),r.sort((e,t)=>e.entry.name.localeCompare(t.entry.name))}ee(r),E(0),D(new Set)}catch(n){if(e)return;t(n instanceof Error?n.message:`Failed to load plugins`)}finally{w(!1)}}return n(m),()=>{e=!0}},[m,t]);let he=async()=>{if(ae.size===0)return;let e=S.filter(e=>ae.has(e.pluginId));le(new Set(e.map(e=>e.pluginId)));let n=0,a=0,o=[];for(let t of e){let e=await ce({pluginId:t.pluginId,entry:t.entry,marketplaceName:t.marketplaceName,scope:`user`});e.success?n++:(a++,o.push({name:t.entry.name,reason:e.error}))}le(new Set),D(new Set),Se(),a===0?r(`✓ Installed ${n} ${H(n,`plugin`)}. Run /reload-plugins to activate.`):n===0?t(`Failed to install: ${C(o,!0)}`):r(`✓ Installed ${n} of ${n+a} plugins. Failed: ${C(o,!1)}. Run /reload-plugins to activate successfully installed plugins.`),n>0&&s&&await s(),i({type:`menu`})},ge=async(e,t=`user`)=>{M(!0),fe(null);let n=await ce({pluginId:e.pluginId,entry:e.entry,marketplaceName:e.marketplaceName,scope:t});if(n.success){let t=await pn(e.pluginId);if(t){M(!1),f({type:`plugin-options`,plugin:t,pluginId:e.pluginId});return}r(n.message),s&&await s(),i({type:`menu`})}else M(!1),fe(n.error)};(0,W.useEffect)(()=>{e&&r(e)},[e,r]),L({"select:previous":()=>{T>0&&E(T-1)},"select:next":()=>{T<b.length-1&&E(T+1)},"select:accept":()=>{let e=b[T];e&&(h(e.name),f(`plugin-list`))}},{context:`Select`,isActive:d===`marketplace-list`}),L({"select:previous":()=>{T>0&&k.handleSelectionChange(T-1,E)},"select:next":()=>{T<S.length-1&&k.handleSelectionChange(T+1,E)},"select:accept":()=>{if(T===S.length&&ae.size>0)he();else if(T<S.length){let e=S[T];e&&(e.isInstalled?i({type:`manage-plugins`,targetPlugin:e.entry.name,targetMarketplace:e.marketplaceName}):(y(e),f(`plugin-details`),de(0),fe(null)))}}},{context:`Select`,isActive:d===`plugin-list`}),L({"plugin:toggle":()=>{if(T<S.length){let e=S[T];if(e&&!e.isInstalled){let t=new Set(ae);t.has(e.pluginId)?t.delete(e.pluginId):t.add(e.pluginId),D(t)}}},"plugin:install":()=>{ae.size>0&&he()}},{context:`Plugin`,isActive:d===`plugin-list`});let _e=jn.useMemo(()=>{if(!v)return[];let e=v.entry.homepage;return Sn(e,xn(v))},[v]);if(L({"select:previous":()=>{A>0&&de(A-1)},"select:next":()=>{A<_e.length-1&&de(A+1)},"select:accept":()=>{if(!v)return;let e=_e[A]?.action,t=v.entry.homepage,n=xn(v);e===`install-user`?ge(v,`user`):e===`install-project`?ge(v,`project`):e===`install-local`?ge(v,`local`):e===`homepage`&&t?oe(t):e===`github`&&n?oe(`https://github.com/${n}`):e===`back`&&(f(`plugin-list`),y(null))}},{context:`Select`,isActive:d===`plugin-details`&&!!v}),typeof d==`object`&&d.type===`plugin-options`){let{plugin:e,pluginId:t}=d;function n(e){r(e),s&&s(),i({type:`menu`})}return(0,G.jsx)(mn,{plugin:e,pluginId:t,onDone:(t,r)=>{switch(t){case`configured`:n(`✓ Installed and configured ${e.name}. Run /reload-plugins to apply.`);break;case`skipped`:n(`✓ Installed ${e.name}. Run /reload-plugins to apply.`);break;case`error`:n(`Installed but failed to save config: ${r}`);break}}})}if(te)return(0,G.jsx)(z,{children:`Loading…`});if(e)return(0,G.jsx)(z,{color:`error`,children:e});if(d===`marketplace-list`)return b.length===0?(0,G.jsxs)(R,{flexDirection:`column`,children:[(0,G.jsx)(R,{marginBottom:1,children:(0,G.jsx)(z,{bold:!0,children:`Select marketplace`})}),(0,G.jsx)(z,{children:`No marketplaces configured.`}),(0,G.jsxs)(z,{dimColor:!0,children:[`Add a marketplace first using `,`'Add marketplace'`,`.`]}),(0,G.jsx)(R,{marginTop:1,paddingLeft:1,children:(0,G.jsx)(z,{dimColor:!0,children:(0,G.jsx)(c,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})})})]}):(0,G.jsxs)(R,{flexDirection:`column`,children:[(0,G.jsx)(R,{marginBottom:1,children:(0,G.jsx)(z,{bold:!0,children:`Select marketplace`})}),pe&&(0,G.jsx)(R,{marginBottom:1,flexDirection:`column`,children:(0,G.jsxs)(z,{color:`warning`,children:[a.warning,` `,pe]})}),b.map((e,t)=>(0,G.jsxs)(R,{flexDirection:`column`,marginBottom:+(t<b.length-1),children:[(0,G.jsx)(R,{children:(0,G.jsxs)(z,{color:T===t?`suggestion`:void 0,children:[T===t?a.pointer:` `,` `,e.name]})}),(0,G.jsx)(R,{marginLeft:2,children:(0,G.jsxs)(z,{dimColor:!0,children:[e.totalPlugins,` `,H(e.totalPlugins,`plugin`),` available`,e.installedCount>0&&` · ${e.installedCount} already installed`,e.source&&` · ${e.source}`]})})]},e.name)),(0,G.jsx)(R,{marginTop:1,children:(0,G.jsx)(z,{dimColor:!0,italic:!0,children:(0,G.jsxs)(B,{children:[(0,G.jsx)(c,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,G.jsx)(c,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]})})})]});if(d===`plugin-details`&&v){let e=v.entry.homepage,t=Sn(e,xn(v));return(0,G.jsxs)(R,{flexDirection:`column`,children:[(0,G.jsx)(R,{marginBottom:1,children:(0,G.jsx)(z,{bold:!0,children:`Plugin Details`})}),(0,G.jsxs)(R,{flexDirection:`column`,marginBottom:1,children:[(0,G.jsx)(z,{bold:!0,children:v.entry.name}),v.entry.version&&(0,G.jsxs)(z,{dimColor:!0,children:[`Version: `,v.entry.version]}),v.entry.description&&(0,G.jsx)(R,{marginTop:1,children:(0,G.jsx)(z,{children:v.entry.description})}),v.entry.author&&(0,G.jsx)(R,{marginTop:1,children:(0,G.jsxs)(z,{dimColor:!0,children:[`By:`,` `,typeof v.entry.author==`string`?v.entry.author:v.entry.author.name]})})]}),(0,G.jsxs)(R,{flexDirection:`column`,marginBottom:1,children:[(0,G.jsx)(z,{bold:!0,children:`Will install:`}),v.entry.commands&&(0,G.jsxs)(z,{dimColor:!0,children:[`· Commands:`,` `,Array.isArray(v.entry.commands)?v.entry.commands.join(`, `):Object.keys(v.entry.commands).join(`, `)]}),v.entry.agents&&(0,G.jsxs)(z,{dimColor:!0,children:[`· Agents:`,` `,Array.isArray(v.entry.agents)?v.entry.agents.join(`, `):Object.keys(v.entry.agents).join(`, `)]}),v.entry.hooks&&(0,G.jsxs)(z,{dimColor:!0,children:[`· Hooks: `,Object.keys(v.entry.hooks).join(`, `)]}),v.entry.mcpServers&&(0,G.jsxs)(z,{dimColor:!0,children:[`· MCP Servers:`,` `,Array.isArray(v.entry.mcpServers)?v.entry.mcpServers.join(`, `):typeof v.entry.mcpServers==`object`?Object.keys(v.entry.mcpServers).join(`, `):`configured`]}),!v.entry.commands&&!v.entry.agents&&!v.entry.hooks&&!v.entry.mcpServers&&(0,G.jsx)(G.Fragment,{children:typeof v.entry.source==`object`&&`source`in v.entry.source&&(v.entry.source.source===`github`||v.entry.source.source===`url`||v.entry.source.source===`npm`||v.entry.source.source===`pip`)?(0,G.jsx)(z,{dimColor:!0,children:`· Component summary not available for remote plugin`}):(0,G.jsx)(z,{dimColor:!0,children:`· Components will be discovered at installation`})})]}),(0,G.jsx)(vn,{}),N&&(0,G.jsx)(R,{marginBottom:1,children:(0,G.jsxs)(z,{color:`error`,children:[`Error: `,N]})}),(0,G.jsx)(R,{flexDirection:`column`,children:t.map((e,t)=>(0,G.jsxs)(R,{children:[A===t&&(0,G.jsx)(z,{children:`> `}),A!==t&&(0,G.jsx)(z,{children:` `}),(0,G.jsx)(z,{bold:A===t,children:j&&e.action===`install`?`Installing…`:e.label})]},e.action))}),(0,G.jsx)(R,{marginTop:1,paddingLeft:1,children:(0,G.jsx)(z,{dimColor:!0,children:(0,G.jsxs)(B,{children:[(0,G.jsx)(c,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,G.jsx)(c,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}if(S.length===0)return(0,G.jsxs)(R,{flexDirection:`column`,children:[(0,G.jsx)(R,{marginBottom:1,children:(0,G.jsx)(z,{bold:!0,children:`Install plugins`})}),(0,G.jsx)(z,{dimColor:!0,children:`No new plugins available to install.`}),(0,G.jsx)(z,{dimColor:!0,children:`All plugins from this marketplace are already installed.`}),(0,G.jsx)(R,{marginLeft:3,children:(0,G.jsx)(z,{dimColor:!0,italic:!0,children:(0,G.jsx)(c,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})})})]});let ve=k.getVisibleItems(S);return(0,G.jsxs)(R,{flexDirection:`column`,children:[(0,G.jsx)(R,{marginBottom:1,children:(0,G.jsx)(z,{bold:!0,children:`Install Plugins`})}),k.scrollPosition.canScrollUp&&(0,G.jsx)(R,{children:(0,G.jsxs)(z,{dimColor:!0,children:[` `,a.arrowUp,` more above`]})}),ve.map((t,n)=>{let r=k.toActualIndex(n),i=T===r,o=ae.has(t.pluginId),s=O.has(t.pluginId);return(0,G.jsxs)(R,{flexDirection:`column`,marginBottom:n===ve.length-1&&!e?0:1,children:[(0,G.jsxs)(R,{children:[(0,G.jsxs)(z,{color:i?`suggestion`:void 0,children:[i?a.pointer:` `,` `]}),(0,G.jsxs)(z,{color:t.isInstalled?`success`:void 0,children:[t.isInstalled?a.tick:s?a.ellipsis:o?a.radioOn:a.radioOff,` `,t.entry.name,t.entry.category&&(0,G.jsxs)(z,{dimColor:!0,children:[` [`,t.entry.category,`]`]}),t.entry.tags?.includes(`community-managed`)&&(0,G.jsx)(z,{dimColor:!0,children:` [Community Managed]`}),t.isInstalled&&(0,G.jsx)(z,{dimColor:!0,children:` (installed)`}),ne&&m===`claude-plugins-official`&&(0,G.jsxs)(z,{dimColor:!0,children:[` · `,Mt(ne.get(t.pluginId)??0),` installs`]})]})]}),t.entry.description&&(0,G.jsxs)(R,{marginLeft:4,children:[(0,G.jsx)(z,{dimColor:!0,children:ht(t.entry.description,60)}),t.entry.version&&(0,G.jsxs)(z,{dimColor:!0,children:[` · v`,t.entry.version]})]})]},t.pluginId)}),k.scrollPosition.canScrollDown&&(0,G.jsx)(R,{children:(0,G.jsxs)(z,{dimColor:!0,children:[` `,a.arrowDown,` more below`]})}),e&&(0,G.jsx)(R,{marginTop:1,children:(0,G.jsxs)(z,{color:`error`,children:[a.cross,` `,e]})}),(0,G.jsx)(Cn,{hasSelection:ae.size>0})]})}var jn,W,G,Mn=e((()=>{i(),jn=t(V(),1),W=t(V(),1),P(),We(),h(),nt(),j(),$e(),Ye(),Oe(),kt(),f(),F(),w(),d(),N(),M(),_t(),gt(),_n(),bn(),Tn(),kn(),G=qe()}));function Nn({error:e,setError:t,result:n,setResult:r,setViewState:i,onInstallComplete:s,onSearchModeChange:l,targetPlugin:u}){let[d,f]=(0,K.useState)(`plugin-list`),[p,m]=(0,K.useState)(null),[h,_]=(0,K.useState)([]),[v,y]=(0,K.useState)(!0),[b,x]=(0,K.useState)(null),[S,ee]=(0,K.useState)(!1),te=(0,K.useCallback)(e=>{ee(e),l?.(e)},[l]),{query:w,setQuery:ne,cursorOffset:re}=Wt({isActive:d===`plugin-list`&&S&&!v,onExit:()=>{te(!1)}}),T=Le(),{columns:ae}=He(),D=(0,K.useMemo)(()=>{if(!w)return h;let e=w.toLowerCase();return h.filter(t=>t.entry.name.toLowerCase().includes(e)||t.entry.description?.toLowerCase().includes(e)||t.marketplaceName.toLowerCase().includes(e))},[h,w]),[O,le]=(0,K.useState)(0),[k,A]=(0,K.useState)(new Set),[ue,de]=(0,K.useState)(new Set),j=En({totalItems:D.length,selectedIndex:O});(0,K.useEffect)(()=>{le(0)},[w]);let[M,N]=(0,K.useState)(0),[fe,pe]=(0,K.useState)(!1),[P,he]=(0,K.useState)(null),[ge,_e]=(0,K.useState)(null),[ve,ye]=(0,K.useState)(null);(0,K.useEffect)(()=>{async function e(){try{let e=await Me(),{marketplaces:n,failures:r}=await me(e),i=[];for(let{name:e,data:t}of n)if(t)for(let n of t.plugins){let t=ie(n.name,e);i.push({entry:n,marketplaceName:e,pluginId:t,isInstalled:g(t)})}let a=i.filter(e=>!e.isInstalled&&!se(e.pluginId));try{let e=await Nt();x(e),e?a.sort((t,n)=>{let r=e.get(t.pluginId)??0,i=e.get(n.pluginId)??0;return r===i?t.entry.name.localeCompare(n.entry.name):i-r}):a.sort((e,t)=>e.entry.name.localeCompare(t.entry.name))}catch(e){Qe(`Failed to fetch install counts: ${Je(e)}`),a.sort((e,t)=>e.entry.name.localeCompare(t.entry.name))}_(a);let s=Object.keys(e).length;if(a.length===0){let e=await E({configuredMarketplaceCount:s,failedMarketplaceCount:r.length});ye(e)}let c=o(r,tt(n,e=>e.data!==null));if(c)if(c.type===`warning`)_e(c.message+`. Showing available plugins.`);else throw Error(c.message);if(u){let e=i.find(e=>e.entry.name===u);e?e.isInstalled?t(`Plugin '${e.pluginId}' is already installed. Use '/plugin' to manage existing plugins.`):(m(e),f(`plugin-details`)):t(`Plugin "${u}" not found in any marketplace`)}}catch(e){t(e instanceof Error?e.message:`Failed to load plugins`)}finally{y(!1)}}e()},[t,u]);let be=async()=>{if(k.size===0)return;let e=h.filter(e=>k.has(e.pluginId));de(new Set(e.map(e=>e.pluginId)));let n=0,a=0,o=[];for(let t of e){let e=await ce({pluginId:t.pluginId,entry:t.entry,marketplaceName:t.marketplaceName,scope:`user`});e.success?n++:(a++,o.push({name:t.entry.name,reason:e.error}))}de(new Set),A(new Set),Se(),a===0?r(`✓ Installed ${n} ${H(n,`plugin`)}. Run /reload-plugins to activate.`):n===0?t(`Failed to install: ${C(o,!0)}`):r(`✓ Installed ${n} of ${n+a} plugins. Failed: ${C(o,!1)}. Run /reload-plugins to activate successfully installed plugins.`),n>0&&s&&await s(),i({type:`menu`})},F=async(e,t=`user`)=>{pe(!0),he(null);let n=await ce({pluginId:e.pluginId,entry:e.entry,marketplaceName:e.marketplaceName,scope:t});if(n.success){let t=await pn(e.pluginId);if(t){pe(!1),f({type:`plugin-options`,plugin:t,pluginId:e.pluginId});return}r(n.message),s&&await s(),i({type:`menu`})}else pe(!1),he(n.error)};(0,K.useEffect)(()=>{e&&r(e)},[e,r]),Ie(`confirm:no`,()=>{f(`plugin-list`),m(null)},{context:`Confirmation`,isActive:d===`plugin-details`}),Ie(`confirm:no`,()=>{i({type:`menu`})},{context:`Confirmation`,isActive:d===`plugin-list`&&!S}),Re((e,t)=>{let n=!t.ctrl&&!t.meta;S||(e===`/`&&n?(te(!0),ne(``)):n&&e.length>0&&!/^\s+$/.test(e)&&e!==`j`&&e!==`k`&&e!==`i`&&(te(!0),ne(e)))},{isActive:d===`plugin-list`&&!v}),L({"select:previous":()=>{O===0?te(!0):j.handleSelectionChange(O-1,le)},"select:next":()=>{O<D.length-1&&j.handleSelectionChange(O+1,le)},"select:accept":()=>{if(O===D.length&&k.size>0)be();else if(O<D.length){let e=D[O];e&&(e.isInstalled?i({type:`manage-plugins`,targetPlugin:e.entry.name,targetMarketplace:e.marketplaceName}):(m(e),f(`plugin-details`),N(0),he(null)))}}},{context:`Select`,isActive:d===`plugin-list`&&!S}),L({"plugin:toggle":()=>{if(O<D.length){let e=D[O];if(e&&!e.isInstalled){let t=new Set(k);t.has(e.pluginId)?t.delete(e.pluginId):t.add(e.pluginId),A(t)}}},"plugin:install":()=>{k.size>0&&be()}},{context:`Plugin`,isActive:d===`plugin-list`&&!S});let xe=In.useMemo(()=>{if(!p)return[];let e=p.entry.homepage;return Sn(e,xn(p))},[p]);if(L({"select:previous":()=>{M>0&&N(M-1)},"select:next":()=>{M<xe.length-1&&N(M+1)},"select:accept":()=>{if(!p)return;let e=xe[M]?.action,t=p.entry.homepage,n=xn(p);e===`install-user`?F(p,`user`):e===`install-project`?F(p,`project`):e===`install-local`?F(p,`local`):e===`homepage`&&t?oe(t):e===`github`&&n?oe(`https://github.com/${n}`):e===`back`&&(f(`plugin-list`),m(null))}},{context:`Select`,isActive:d===`plugin-details`&&!!p}),typeof d==`object`&&d.type===`plugin-options`){let{plugin:e,pluginId:t}=d;function n(e){r(e),s&&s(),i({type:`menu`})}return(0,q.jsx)(mn,{plugin:e,pluginId:t,onDone:(t,r)=>{switch(t){case`configured`:n(`✓ Installed and configured ${e.name}. Run /reload-plugins to apply.`);break;case`skipped`:n(`✓ Installed ${e.name}. Run /reload-plugins to apply.`);break;case`error`:n(`Installed but failed to save config: ${r}`);break}}})}if(v)return(0,q.jsx)(z,{children:`Loading…`});if(e)return(0,q.jsx)(z,{color:`error`,children:e});if(d===`plugin-details`&&p){let e=p.entry.homepage,t=Sn(e,xn(p));return(0,q.jsxs)(R,{flexDirection:`column`,children:[(0,q.jsx)(R,{marginBottom:1,children:(0,q.jsx)(z,{bold:!0,children:`Plugin details`})}),(0,q.jsxs)(R,{flexDirection:`column`,marginBottom:1,children:[(0,q.jsx)(z,{bold:!0,children:p.entry.name}),(0,q.jsxs)(z,{dimColor:!0,children:[`from `,p.marketplaceName]}),p.entry.version&&(0,q.jsxs)(z,{dimColor:!0,children:[`Version: `,p.entry.version]}),p.entry.description&&(0,q.jsx)(R,{marginTop:1,children:(0,q.jsx)(z,{children:p.entry.description})}),p.entry.author&&(0,q.jsx)(R,{marginTop:1,children:(0,q.jsxs)(z,{dimColor:!0,children:[`By:`,` `,typeof p.entry.author==`string`?p.entry.author:p.entry.author.name]})})]}),(0,q.jsx)(vn,{}),P&&(0,q.jsx)(R,{marginBottom:1,children:(0,q.jsxs)(z,{color:`error`,children:[`Error: `,P]})}),(0,q.jsx)(R,{flexDirection:`column`,children:t.map((e,t)=>(0,q.jsxs)(R,{children:[M===t&&(0,q.jsx)(z,{children:`> `}),M!==t&&(0,q.jsx)(z,{children:` `}),(0,q.jsx)(z,{bold:M===t,children:fe&&e.action.startsWith(`install-`)?`Installing…`:e.label})]},e.action))}),(0,q.jsx)(R,{marginTop:1,children:(0,q.jsx)(z,{dimColor:!0,children:(0,q.jsxs)(B,{children:[(0,q.jsx)(c,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,q.jsx)(c,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}if(h.length===0)return(0,q.jsxs)(R,{flexDirection:`column`,children:[(0,q.jsx)(R,{marginBottom:1,children:(0,q.jsx)(z,{bold:!0,children:`Discover plugins`})}),(0,q.jsx)(Fn,{reason:ve}),(0,q.jsx)(R,{marginTop:1,children:(0,q.jsx)(z,{dimColor:!0,italic:!0,children:`Esc to go back`})})]});let I=j.getVisibleItems(D);return(0,q.jsxs)(R,{flexDirection:`column`,children:[(0,q.jsxs)(R,{children:[(0,q.jsx)(z,{bold:!0,children:`Discover plugins`}),j.needsPagination&&(0,q.jsxs)(z,{dimColor:!0,children:[` `,`(`,j.scrollPosition.current,`/`,j.scrollPosition.total,`)`]})]}),(0,q.jsx)(R,{marginBottom:1,children:(0,q.jsx)(Be,{query:w,isFocused:S,isTerminalFocused:T,width:ae-4,cursorOffset:re})}),ge&&(0,q.jsx)(R,{marginBottom:1,children:(0,q.jsxs)(z,{color:`warning`,children:[a.warning,` `,ge]})}),D.length===0&&w&&(0,q.jsx)(R,{marginBottom:1,children:(0,q.jsxs)(z,{dimColor:!0,children:[`No plugins match "`,w,`"`]})}),j.scrollPosition.canScrollUp&&(0,q.jsx)(R,{children:(0,q.jsxs)(z,{dimColor:!0,children:[` `,a.arrowUp,` more above`]})}),I.map((t,n)=>{let r=j.toActualIndex(n),i=O===r,o=k.has(t.pluginId),s=ue.has(t.pluginId);return(0,q.jsxs)(R,{flexDirection:`column`,marginBottom:n===I.length-1&&!e?0:1,children:[(0,q.jsxs)(R,{children:[(0,q.jsxs)(z,{color:i&&!S?`suggestion`:void 0,children:[i&&!S?a.pointer:` `,` `]}),(0,q.jsxs)(z,{children:[s?a.ellipsis:o?a.radioOn:a.radioOff,` `,t.entry.name,(0,q.jsxs)(z,{dimColor:!0,children:[` · `,t.marketplaceName]}),t.entry.tags?.includes(`community-managed`)&&(0,q.jsx)(z,{dimColor:!0,children:` [Community Managed]`}),b&&t.marketplaceName===`claude-plugins-official`&&(0,q.jsxs)(z,{dimColor:!0,children:[` · `,Mt(b.get(t.pluginId)??0),` installs`]})]})]}),t.entry.description&&(0,q.jsx)(R,{marginLeft:4,children:(0,q.jsx)(z,{dimColor:!0,children:ht(t.entry.description,60)})})]},`${j.startIndex}-${t.pluginId}`)}),j.scrollPosition.canScrollDown&&(0,q.jsx)(R,{children:(0,q.jsxs)(z,{dimColor:!0,children:[` `,a.arrowDown,` more below`]})}),e&&(0,q.jsx)(R,{marginTop:1,children:(0,q.jsxs)(z,{color:`error`,children:[a.cross,` `,e]})}),(0,q.jsx)(Pn,{hasSelection:k.size>0,canToggle:O<D.length&&!D[O]?.isInstalled})]})}function Pn({hasSelection:e,canToggle:t}){return(0,q.jsx)(R,{marginTop:1,children:(0,q.jsx)(z,{dimColor:!0,italic:!0,children:(0,q.jsxs)(B,{children:[e&&(0,q.jsx)(c,{action:`plugin:install`,context:`Plugin`,fallback:`i`,description:`install`,bold:!0}),(0,q.jsx)(z,{children:`type to search`}),t&&(0,q.jsx)(c,{action:`plugin:toggle`,context:`Plugin`,fallback:`Space`,description:`toggle`}),(0,q.jsx)(c,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`details`}),(0,q.jsx)(c,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})}function Fn({reason:e}){switch(e){case`git-not-installed`:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(z,{dimColor:!0,children:`Git is required to install marketplaces.`}),(0,q.jsx)(z,{dimColor:!0,children:`Please install git and restart Work Mate.`})]});case`all-blocked-by-policy`:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(z,{dimColor:!0,children:`Your organization policy does not allow any external marketplaces.`}),(0,q.jsx)(z,{dimColor:!0,children:`Contact your administrator.`})]});case`policy-restricts-sources`:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(z,{dimColor:!0,children:`Your organization restricts which marketplaces can be added.`}),(0,q.jsx)(z,{dimColor:!0,children:`Switch to the Marketplaces tab to view allowed sources.`})]});case`all-marketplaces-failed`:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(z,{dimColor:!0,children:`Failed to load marketplace data.`}),(0,q.jsx)(z,{dimColor:!0,children:`Check your network connection.`})]});case`all-plugins-installed`:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(z,{dimColor:!0,children:`All available plugins are already installed.`}),(0,q.jsx)(z,{dimColor:!0,children:`Check for new plugins later or add more marketplaces.`})]});default:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(z,{dimColor:!0,children:`No plugins available.`}),(0,q.jsx)(z,{dimColor:!0,children:`Add a marketplace first using the Marketplaces tab.`})]})}}var In,K,q,Ln=e((()=>{i(),In=t(V(),1),K=t(V(),1),P(),Ut(),We(),Gt(),x(),h(),nt(),j(),$e(),Ye(),Oe(),kt(),f(),F(),w(),d(),N(),M(),_t(),gt(),_n(),bn(),Tn(),kn(),q=qe()}));function Rn({setViewState:e,error:t,setError:n,setResult:r,exitState:i,onManageComplete:s,targetMarketplace:l,action:u}){let[d,f]=(0,Bn.useState)([]),[p,m]=(0,Bn.useState)(!0),[h,g]=(0,Bn.useState)(0),[_,y]=(0,Bn.useState)(!1),[b,x]=(0,Bn.useState)(null),[S,ee]=(0,Bn.useState)(null),[te,C]=(0,Bn.useState)(null),[w,re]=(0,Bn.useState)(`list`),[T,E]=(0,Bn.useState)(null),[ae,oe]=(0,Bn.useState)(0),se=(0,Bn.useRef)(!1);(0,Bn.useEffect)(()=>{async function e(){try{let e=await Me(),{enabled:r,disabled:i}=await k(),a=[...r,...i],{marketplaces:s,failures:c}=await me(e),d=[];for(let{name:e,config:t,data:n}of s){let r=a.filter(t=>t.source.endsWith(`@${e}`));d.push({name:e,source:ue(t.source),lastUpdated:t.lastUpdated,pluginCount:n?.plugins.length,installedPlugins:r,pendingUpdate:!1,pendingRemove:!1,autoUpdate:ct(e,t)})}d.sort((e,t)=>e.name===`claude-plugin-directory`?-1:t.name===`claude-plugin-directory`?1:e.name.localeCompare(t.name)),f(d);let p=o(c,tt(s,e=>e.data!==null));if(p)if(p.type===`warning`)x(p.message);else throw Error(p.message);if(l&&!se.current&&!t){se.current=!0;let e=d.findIndex(e=>e.name===l);if(e>=0){let t=d[e];if(u){g(e+1);let t=[...d];u===`update`?t[e].pendingUpdate=!0:u===`remove`&&(t[e].pendingRemove=!0),f(t),setTimeout(O,100,t)}else t&&(g(e+1),E(t),re(`details`))}else n&&n(`Marketplace not found: ${l}`)}}catch(e){n&&n(e instanceof Error?e.message:`Failed to load marketplaces`),x(e instanceof Error?e.message:`Failed to load marketplaces`)}finally{m(!1)}}e()},[l,u,t]);let ce=()=>d.some(e=>e.pendingUpdate||e.pendingRemove),D=()=>({updateCount:tt(d,e=>e.pendingUpdate),removeCount:tt(d,e=>e.pendingRemove)}),O=async t=>{let i=t||d,o=w===`details`;y(!0),x(null),ee(null),C(null);try{let t=rt(`userSettings`),n=0,c=0,l=new Set;for(let e of i){if(e.pendingRemove){if(e.installedPlugins&&e.installedPlugins.length>0){let n={...t?.enabledPlugins};for(let t of e.installedPlugins){let r=ie(t.name,e.name);n[r]=!1}st(`userSettings`,{enabledPlugins:n})}await ne(e.name),c++,mt(`tengu_marketplace_removed`,{marketplace_name:e.name,plugins_uninstalled:e.installedPlugins?.length||0});continue}e.pendingUpdate&&(await v(e.name,e=>{C(e)}),n++,l.add(e.name.toLowerCase()),mt(`tengu_marketplace_updated`,{marketplace_name:e.name}))}let u=0;l.size>0&&(u=(await en(l)).length),Se(),s&&await s();let d=await Me(),{enabled:p,disabled:m}=await k(),h=[...p,...m],{marketplaces:g}=await me(d),_=[];for(let{name:e,config:t,data:n}of g){let r=h.filter(t=>t.source.endsWith(`@${e}`));_.push({name:e,source:ue(t.source),lastUpdated:t.lastUpdated,pluginCount:n?.plugins.length,installedPlugins:r,pendingUpdate:!1,pendingRemove:!1,autoUpdate:ct(e,t)})}if(_.sort((e,t)=>e.name===`claude-plugin-directory`?-1:t.name===`claude-plugin-directory`?1:e.name.localeCompare(t.name)),f(_),o&&T){let e=_.find(e=>e.name===T.name);e&&E(e)}let y=[];if(n>0){let e=u>0?` (${u} ${H(u,`plugin`)} bumped)`:``;y.push(`Updated ${n} ${H(n,`marketplace`)}${e}`)}if(c>0&&y.push(`Removed ${c} ${H(c,`marketplace`)}`),y.length>0){let t=`${a.tick} ${y.join(`, `)}`;o?ee(t):(r(t),setTimeout(e,2e3,{type:`menu`}))}else o||e({type:`menu`})}catch(e){let t=Je(e);x(t),n&&n(t)}finally{y(!1),C(null)}},le=async()=>{if(!T)return;let e=d.map(e=>e.name===T.name?{...e,pendingRemove:!0}:e);f(e),await O(e)},A=e=>{if(!e)return[];let t=[{label:`Browse plugins (${e.pluginCount??0})`,value:`browse`},{label:`Update marketplace`,secondaryLabel:e.lastUpdated?`(last updated ${new Date(e.lastUpdated).toLocaleDateString()})`:void 0,value:`update`}];return lt()||t.push({label:e.autoUpdate?`Disable auto-update`:`Enable auto-update`,value:`toggle-auto-update`}),t.push({label:`Remove marketplace`,value:`remove`}),t},de=async e=>{let t=!e.autoUpdate;try{await Ce(e.name,t),f(n=>n.map(n=>n.name===e.name?{...n,autoUpdate:t}:n)),E(e=>e&&{...e,autoUpdate:t})}catch(e){x(e instanceof Error?e.message:`Failed to update setting`)}};if(Ie(`confirm:no`,()=>{re(`list`),oe(0)},{context:`Confirmation`,isActive:!_&&(w===`details`||w===`confirm-remove`)}),Ie(`confirm:no`,()=>{f(e=>e.map(e=>({...e,pendingUpdate:!1,pendingRemove:!1}))),g(0)},{context:`Confirmation`,isActive:!_&&w===`list`&&ce()}),Ie(`confirm:no`,()=>{e({type:`menu`})},{context:`Confirmation`,isActive:!_&&w===`list`&&!ce()}),L({"select:previous":()=>g(e=>Math.max(0,e-1)),"select:next":()=>{let e=d.length+1;g(t=>Math.min(e-1,t+1))},"select:accept":()=>{let t=h-1;if(h===0)e({type:`add-marketplace`});else if(ce())O();else{let e=d[t];e&&(E(e),re(`details`),oe(0))}}},{context:`Select`,isActive:!_&&w===`list`}),Re(e=>{let t=h-1;if((e===`u`||e===`U`)&&t>=0)f(e=>e.map((e,n)=>n===t?{...e,pendingUpdate:!e.pendingUpdate,pendingRemove:e.pendingUpdate?e.pendingRemove:!1}:e));else if((e===`r`||e===`R`)&&t>=0){let e=d[t];e&&(E(e),re(`confirm-remove`))}},{isActive:!_&&w===`list`}),L({"select:previous":()=>oe(e=>Math.max(0,e-1)),"select:next":()=>{let e=A(T);oe(t=>Math.min(e.length-1,t+1))},"select:accept":()=>{if(!T)return;let t=A(T)[ae];if(t?.value===`browse`)e({type:`browse-marketplace`,targetMarketplace:T.name});else if(t?.value===`update`){let e=d.map(e=>e.name===T.name?{...e,pendingUpdate:!0}:e);f(e),O(e)}else t?.value===`toggle-auto-update`?de(T):t?.value===`remove`&&re(`confirm-remove`)}},{context:`Select`,isActive:!_&&w===`details`}),Re(e=>{e===`y`||e===`Y`?le():(e===`n`||e===`N`)&&(re(`list`),E(null))},{isActive:!_&&w===`confirm-remove`}),p)return(0,J.jsx)(z,{children:`Loading marketplaces…`});if(d.length===0)return(0,J.jsxs)(R,{flexDirection:`column`,children:[(0,J.jsx)(R,{marginBottom:1,children:(0,J.jsx)(z,{bold:!0,children:`Manage marketplaces`})}),(0,J.jsxs)(R,{flexDirection:`row`,gap:1,children:[(0,J.jsxs)(z,{color:`suggestion`,children:[a.pointer,` +`]}),(0,J.jsx)(z,{bold:!0,color:`suggestion`,children:`Add Marketplace`})]}),(0,J.jsx)(R,{marginLeft:3,children:(0,J.jsx)(z,{dimColor:!0,italic:!0,children:i.pending?(0,J.jsxs)(J.Fragment,{children:[`Press `,i.keyName,` again to go back`]}):(0,J.jsxs)(B,{children:[(0,J.jsx)(c,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,J.jsx)(c,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]})})})]});if(w===`confirm-remove`&&T){let e=T.installedPlugins?.length||0;return(0,J.jsxs)(R,{flexDirection:`column`,children:[(0,J.jsxs)(z,{bold:!0,color:`warning`,children:[`Remove marketplace `,(0,J.jsx)(z,{italic:!0,children:T.name}),`?`]}),(0,J.jsxs)(R,{flexDirection:`column`,children:[e>0&&(0,J.jsx)(R,{marginTop:1,children:(0,J.jsxs)(z,{color:`warning`,children:[`This will also uninstall `,e,` `,H(e,`plugin`),` from this marketplace:`]})}),T.installedPlugins&&T.installedPlugins.length>0&&(0,J.jsx)(R,{flexDirection:`column`,marginTop:1,marginLeft:2,children:T.installedPlugins.map(e=>(0,J.jsxs)(z,{dimColor:!0,children:[`• `,e.name]},e.name))}),(0,J.jsx)(R,{marginTop:1,children:(0,J.jsxs)(z,{children:[`Press `,(0,J.jsx)(z,{bold:!0,children:`y`}),` to confirm or `,(0,J.jsx)(z,{bold:!0,children:`n`}),` to cancel`]})})]})]})}if(w===`details`&&T){let e=T.pendingUpdate||_,t=A(T);return(0,J.jsxs)(R,{flexDirection:`column`,children:[(0,J.jsx)(z,{bold:!0,children:T.name}),(0,J.jsx)(z,{dimColor:!0,children:T.source}),(0,J.jsx)(R,{marginTop:1,children:(0,J.jsxs)(z,{children:[T.pluginCount||0,` available `,H(T.pluginCount||0,`plugin`)]})}),T.installedPlugins&&T.installedPlugins.length>0&&(0,J.jsxs)(R,{flexDirection:`column`,marginTop:1,children:[(0,J.jsxs)(z,{bold:!0,children:[`Installed plugins (`,T.installedPlugins.length,`):`]}),(0,J.jsx)(R,{flexDirection:`column`,marginLeft:1,children:T.installedPlugins.map(e=>(0,J.jsxs)(R,{flexDirection:`row`,gap:1,children:[(0,J.jsx)(z,{children:a.bullet}),(0,J.jsxs)(R,{flexDirection:`column`,children:[(0,J.jsx)(z,{children:e.name}),(0,J.jsx)(z,{dimColor:!0,children:e.manifest.description})]})]},e.name))})]}),e&&(0,J.jsxs)(R,{marginTop:1,flexDirection:`column`,children:[(0,J.jsx)(z,{color:`claude`,children:`Updating marketplace…`}),te&&(0,J.jsx)(z,{dimColor:!0,children:te})]}),!e&&S&&(0,J.jsx)(R,{marginTop:1,children:(0,J.jsx)(z,{color:`claude`,children:S})}),!e&&b&&(0,J.jsx)(R,{marginTop:1,children:(0,J.jsx)(z,{color:`error`,children:b})}),!e&&(0,J.jsx)(R,{flexDirection:`column`,marginTop:1,children:t.map((e,t)=>{if(!e)return null;let n=t===ae;return(0,J.jsxs)(R,{children:[(0,J.jsxs)(z,{color:n?`suggestion`:void 0,children:[n?a.pointer:` `,` `,e.label]}),e.secondaryLabel&&(0,J.jsxs)(z,{dimColor:!0,children:[` `,e.secondaryLabel]})]},e.value)})}),!e&&!lt()&&T.autoUpdate&&(0,J.jsx)(R,{marginTop:1,children:(0,J.jsx)(z,{dimColor:!0,children:`Auto-update enabled. Work Mate will automatically update this marketplace and its installed plugins.`})}),(0,J.jsx)(R,{marginLeft:3,children:(0,J.jsx)(z,{dimColor:!0,italic:!0,children:e?(0,J.jsx)(J.Fragment,{children:`Please wait…`}):(0,J.jsxs)(B,{children:[(0,J.jsx)(c,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,J.jsx)(c,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]})})})]})}let{updateCount:j,removeCount:M}=D();return(0,J.jsxs)(R,{flexDirection:`column`,children:[(0,J.jsx)(R,{marginBottom:1,children:(0,J.jsx)(z,{bold:!0,children:`Manage marketplaces`})}),(0,J.jsxs)(R,{flexDirection:`row`,gap:1,marginBottom:1,children:[(0,J.jsxs)(z,{color:h===0?`suggestion`:void 0,children:[h===0?a.pointer:` `,` +`]}),(0,J.jsx)(z,{bold:!0,color:h===0?`suggestion`:void 0,children:`Add Marketplace`})]}),(0,J.jsx)(R,{flexDirection:`column`,children:d.map((e,t)=>{let n=t+1===h,r=[];return e.pendingUpdate&&r.push(`UPDATE`),e.pendingRemove&&r.push(`REMOVE`),(0,J.jsxs)(R,{flexDirection:`row`,gap:1,marginBottom:1,children:[(0,J.jsxs)(z,{color:n?`suggestion`:void 0,children:[n?a.pointer:` `,` `,e.pendingRemove?a.cross:a.bullet]}),(0,J.jsxs)(R,{flexDirection:`column`,flexGrow:1,children:[(0,J.jsxs)(R,{flexDirection:`row`,gap:1,children:[(0,J.jsxs)(z,{bold:!0,strikethrough:e.pendingRemove,dimColor:e.pendingRemove,children:[e.name===`claude-plugins-official`&&(0,J.jsx)(z,{color:`claude`,children:`✻ `}),e.name,e.name===`claude-plugins-official`&&(0,J.jsx)(z,{color:`claude`,children:` ✻`})]}),r.length>0&&(0,J.jsxs)(z,{color:`warning`,children:[`[`,r.join(`, `),`]`]})]}),(0,J.jsx)(z,{dimColor:!0,children:e.source}),(0,J.jsxs)(z,{dimColor:!0,children:[e.pluginCount!==void 0&&(0,J.jsxs)(J.Fragment,{children:[e.pluginCount,` available`]}),e.installedPlugins&&e.installedPlugins.length>0&&(0,J.jsxs)(J.Fragment,{children:[` • `,e.installedPlugins.length,` installed`]}),e.lastUpdated&&(0,J.jsxs)(J.Fragment,{children:[` • Updated `,new Date(e.lastUpdated).toLocaleDateString()]})]})]})]},e.name)})}),ce()&&(0,J.jsxs)(R,{marginTop:1,flexDirection:`column`,children:[(0,J.jsxs)(z,{children:[(0,J.jsx)(z,{bold:!0,children:`Pending changes:`}),` `,(0,J.jsx)(z,{dimColor:!0,children:`Enter to apply`})]}),j>0&&(0,J.jsxs)(z,{children:[`• Update `,j,` `,H(j,`marketplace`)]}),M>0&&(0,J.jsxs)(z,{color:`warning`,children:[`• Remove `,M,` `,H(M,`marketplace`)]})]}),_&&(0,J.jsx)(R,{marginTop:1,children:(0,J.jsx)(z,{color:`claude`,children:`Processing changes…`})}),b&&(0,J.jsx)(R,{marginTop:1,children:(0,J.jsx)(z,{color:`error`,children:b})}),(0,J.jsx)(zn,{exitState:i,hasPendingActions:ce()})]})}function zn({exitState:e,hasPendingActions:t}){return e.pending?(0,J.jsx)(R,{marginTop:1,children:(0,J.jsxs)(z,{dimColor:!0,italic:!0,children:[`Press `,e.keyName,` again to go back`]})}):(0,J.jsx)(R,{marginTop:1,children:(0,J.jsx)(z,{dimColor:!0,italic:!0,children:(0,J.jsxs)(B,{children:[t&&(0,J.jsx)(c,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`apply changes`}),!t&&(0,J.jsx)(c,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),!t&&(0,J.jsx)(Ne,{shortcut:`u`,action:`update`}),!t&&(0,J.jsx)(Ne,{shortcut:`r`,action:`remove`}),(0,J.jsx)(c,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:t?`cancel`:`go back`})]})})})}var Bn,J,Vn=e((()=>{i(),V(),Bn=t(V(),1),pt(),P(),We(),h(),nt(),ut(),Ye(),Oe(),F(),w(),tn(),je(),ot(),at(),_t(),J=qe()}));function Hn(e){switch(e.type){case`path-not-found`:return`${e.component} path not found: ${e.path}`;case`git-auth-failed`:return`Git ${e.authType.toUpperCase()} authentication failed for ${e.gitUrl}`;case`git-timeout`:return`Git ${e.operation} timed out for ${e.gitUrl}`;case`network-error`:return`Network error accessing ${e.url}${e.details?`: ${e.details}`:``}`;case`manifest-parse-error`:return`Failed to parse manifest at ${e.manifestPath}: ${e.parseError}`;case`manifest-validation-error`:return`Invalid manifest at ${e.manifestPath}: ${e.validationErrors.join(`, `)}`;case`plugin-not-found`:return`Plugin "${e.pluginId}" not found in marketplace "${e.marketplace}"`;case`marketplace-not-found`:return`Marketplace "${e.marketplace}" not found`;case`marketplace-load-failed`:return`Failed to load marketplace "${e.marketplace}": ${e.reason}`;case`mcp-config-invalid`:return`Invalid MCP server config for "${e.serverName}": ${e.validationError}`;case`mcp-server-suppressed-duplicate`:{let t=e.duplicateOf.startsWith(`plugin:`)?`server provided by plugin "${e.duplicateOf.split(`:`)[1]??`?`}"`:`already-configured "${e.duplicateOf}"`;return`MCP server "${e.serverName}" skipped — same command/URL as ${t}`}case`hook-load-failed`:return`Failed to load hooks from ${e.hookPath}: ${e.reason}`;case`component-load-failed`:return`Failed to load ${e.component} from ${e.path}: ${e.reason}`;case`mcpb-download-failed`:return`Failed to download MCPB from ${e.url}: ${e.reason}`;case`mcpb-extract-failed`:return`Failed to extract MCPB ${e.mcpbPath}: ${e.reason}`;case`mcpb-invalid-manifest`:return`MCPB manifest invalid at ${e.mcpbPath}: ${e.validationError}`;case`marketplace-blocked-by-policy`:return e.blockedByBlocklist?`Marketplace "${e.marketplace}" is blocked by enterprise policy`:`Marketplace "${e.marketplace}" is not in the allowed marketplace list`;case`dependency-unsatisfied`:return e.reason===`not-enabled`?`Dependency "${e.dependency}" is disabled`:`Dependency "${e.dependency}" is not installed`;case`lsp-config-invalid`:return`Invalid LSP server config for "${e.serverName}": ${e.validationError}`;case`lsp-server-start-failed`:return`LSP server "${e.serverName}" failed to start: ${e.reason}`;case`lsp-server-crashed`:return e.signal?`LSP server "${e.serverName}" crashed with signal ${e.signal}`:`LSP server "${e.serverName}" crashed with exit code ${e.exitCode??`unknown`}`;case`lsp-request-timeout`:return`LSP server "${e.serverName}" timed out on ${e.method} after ${e.timeoutMs}ms`;case`lsp-request-failed`:return`LSP server "${e.serverName}" ${e.method} failed: ${e.error}`;case`plugin-cache-miss`:return`Plugin "${e.plugin}" not cached at ${e.installPath}`;case`generic-error`:return e.error}return s(e)}function Un(e){switch(e.type){case`path-not-found`:return`Check that the path in your manifest or marketplace config is correct`;case`git-auth-failed`:return e.authType===`ssh`?`Configure SSH keys or use HTTPS URL instead`:`Configure credentials or use SSH URL instead`;case`git-timeout`:case`network-error`:return`Check your internet connection and try again`;case`manifest-parse-error`:return`Check manifest file syntax in the plugin directory`;case`manifest-validation-error`:return`Check manifest file follows the required schema`;case`plugin-not-found`:return`Plugin may not exist in marketplace "${e.marketplace}"`;case`marketplace-not-found`:return e.availableMarketplaces.length>0?`Available marketplaces: ${e.availableMarketplaces.join(`, `)}`:`Add the marketplace first using /plugin marketplace add`;case`mcp-config-invalid`:return`Check MCP server configuration in .mcp.json or manifest`;case`mcp-server-suppressed-duplicate`:return e.duplicateOf.startsWith(`plugin:`)?`Disable plugin "${e.duplicateOf.split(`:`)[1]??`the other plugin`}" if you want this plugin's version instead`:`Remove "${e.duplicateOf}" from your MCP config if you want the plugin's version instead`;case`hook-load-failed`:return`Check hooks.json file syntax and structure`;case`component-load-failed`:return`Check ${e.component} directory structure and file permissions`;case`mcpb-download-failed`:return`Check your internet connection and URL accessibility`;case`mcpb-extract-failed`:return`Verify the MCPB file is valid and not corrupted`;case`mcpb-invalid-manifest`:return`Contact the plugin author about the invalid manifest`;case`marketplace-blocked-by-policy`:return e.blockedByBlocklist?`This marketplace source is explicitly blocked by your administrator`:e.allowedSources.length>0?`Allowed sources: ${e.allowedSources.join(`, `)}`:`Contact your administrator to configure allowed marketplace sources`;case`dependency-unsatisfied`:return e.reason===`not-enabled`?`Enable "${e.dependency}" or uninstall "${e.plugin}"`:`Install "${e.dependency}" or uninstall "${e.plugin}"`;case`lsp-config-invalid`:return`Check LSP server configuration in the plugin manifest`;case`lsp-server-start-failed`:case`lsp-server-crashed`:case`lsp-request-timeout`:case`lsp-request-failed`:return`Check LSP server logs with --debug for details`;case`plugin-cache-miss`:return`Run /plugins to refresh the plugin cache`;case`marketplace-load-failed`:case`generic-error`:return null}return null}var Wn=e((()=>{A()}));function Gn({item:e,isSelected:t}){let[n]=Fe();if(e.type===`plugin`){let r,i;return e.pendingToggle?(r=ze(`suggestion`,n)(a.arrowRight),i=e.pendingToggle===`will-enable`?`will enable`:`will disable`):e.errorCount>0?(r=ze(`error`,n)(a.cross),i=`${e.errorCount} ${H(e.errorCount,`error`)}`):e.isEnabled?(r=ze(`success`,n)(a.tick),i=`enabled`):(r=ze(`inactive`,n)(a.radioOff),i=`disabled`),(0,Y.jsxs)(R,{children:[(0,Y.jsx)(z,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(z,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(z,{dimColor:!t,children:[` `,(0,Y.jsx)(z,{backgroundColor:`userMessageBackground`,children:`Plugin`})]}),(0,Y.jsxs)(z,{dimColor:!0,children:[` · `,e.marketplace]}),(0,Y.jsxs)(z,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(z,{dimColor:!t,children:i})]})}if(e.type===`flagged-plugin`){let r=ze(`warning`,n)(a.warning);return(0,Y.jsxs)(R,{children:[(0,Y.jsx)(z,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(z,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(z,{dimColor:!t,children:[` `,(0,Y.jsx)(z,{backgroundColor:`userMessageBackground`,children:`Plugin`})]}),(0,Y.jsxs)(z,{dimColor:!0,children:[` · `,e.marketplace]}),(0,Y.jsxs)(z,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(z,{dimColor:!t,children:`removed`})]})}if(e.type===`failed-plugin`){let r=ze(`error`,n)(a.cross),i=`failed to load · ${e.errorCount} ${H(e.errorCount,`error`)}`;return(0,Y.jsxs)(R,{children:[(0,Y.jsx)(z,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(z,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(z,{dimColor:!t,children:[` `,(0,Y.jsx)(z,{backgroundColor:`userMessageBackground`,children:`Plugin`})]}),(0,Y.jsxs)(z,{dimColor:!0,children:[` · `,e.marketplace]}),(0,Y.jsxs)(z,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(z,{dimColor:!t,children:i})]})}let r,i;return e.status===`connected`?(r=ze(`success`,n)(a.tick),i=`connected`):e.status===`disabled`?(r=ze(`inactive`,n)(a.radioOff),i=`disabled`):e.status===`pending`?(r=ze(`inactive`,n)(a.radioOff),i=`connecting…`):e.status===`needs-auth`?(r=ze(`warning`,n)(a.triangleUpOutline),i=`Enter to auth`):(r=ze(`error`,n)(a.cross),i=`failed`),e.indented?(0,Y.jsxs)(R,{children:[(0,Y.jsx)(z,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(z,{dimColor:!t,children:`└ `}),(0,Y.jsx)(z,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(z,{dimColor:!t,children:[` `,(0,Y.jsx)(z,{backgroundColor:`userMessageBackground`,children:`MCP`})]}),(0,Y.jsxs)(z,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(z,{dimColor:!t,children:i})]}):(0,Y.jsxs)(R,{children:[(0,Y.jsx)(z,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(z,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(z,{dimColor:!t,children:[` `,(0,Y.jsx)(z,{backgroundColor:`userMessageBackground`,children:`MCP`})]}),(0,Y.jsxs)(z,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(z,{dimColor:!t,children:i})]})}var Y,Kn=e((()=>{i(),V(),We(),_t(),Y=qe()}));async function qn(e){try{return(await rn.readdir(e,{withFileTypes:!0})).filter(e=>e.isFile()&&e.name.endsWith(`.md`)).map(e=>nn.basename(e.name,`.md`))}catch(t){return Qe(`Failed to read plugin components from ${e}: ${Je(t)}`,{level:`error`}),ft(Ze(t)),[]}}async function Jn(e){try{let t=await rn.readdir(e,{withFileTypes:!0}),n=[];for(let r of t)if(r.isDirectory()||r.isSymbolicLink()){let t=nn.join(e,r.name,`SKILL.md`);try{(await rn.stat(t)).isFile()&&n.push(r.name)}catch{}}return n}catch(t){return Qe(`Failed to read skill directories from ${e}: ${Je(t)}`,{level:`error`}),ft(Ze(t)),[]}}function Yn({plugin:e,marketplace:t}){let[n,r]=(0,X.useState)(null),[i,a]=(0,X.useState)(!0),[o,s]=(0,X.useState)(null);return(0,X.useEffect)(()=>{async function n(){try{if(t===`builtin`){let t=T(e.name);if(t){let e=t.skills?.map(e=>e.name)??[],n=t.hooks?Object.keys(t.hooks):[],i=t.mcpServers?Object.keys(t.mcpServers):[];r({commands:null,agents:null,skills:e.length>0?e:null,hooks:n.length>0?n:null,mcpServers:i.length>0?i:null})}else s(`Built-in plugin ${e.name} not found`);a(!1);return}let n=(await _(t)).plugins.find(t=>t.name===e.name);if(n){let t=[];e.commandsPath&&t.push(e.commandsPath),e.commandsPaths&&t.push(...e.commandsPaths);let i=[];for(let e of t)if(typeof e==`string`){let t=await qn(e);i.push(...t)}let a=[];e.agentsPath&&a.push(e.agentsPath),e.agentsPaths&&a.push(...e.agentsPaths);let o=[];for(let e of a)if(typeof e==`string`){let t=await qn(e);o.push(...t)}let s=[];e.skillsPath&&s.push(e.skillsPath),e.skillsPaths&&s.push(...e.skillsPaths);let c=[];for(let e of s)if(typeof e==`string`){let t=await Jn(e);c.push(...t)}let l=[];e.hooksConfig&&l.push(Object.keys(e.hooksConfig)),n.hooks&&l.push(n.hooks);let u=[];e.mcpServers&&u.push(Object.keys(e.mcpServers)),n.mcpServers&&u.push(n.mcpServers),r({commands:i.length>0?i:null,agents:o.length>0?o:null,skills:c.length>0?c:null,hooks:l.length>0?l:null,mcpServers:u.length>0?u:null})}else s(`Plugin ${e.name} not found in marketplace`)}catch(e){s(e instanceof Error?e.message:`Failed to load components`)}finally{a(!1)}}n()},[e.name,e.commandsPath,e.commandsPaths,e.agentsPath,e.agentsPaths,e.skillsPath,e.skillsPaths,e.hooksConfig,e.mcpServers,t]),i?null:o?(0,Z.jsxs)(R,{flexDirection:`column`,marginBottom:1,children:[(0,Z.jsx)(z,{bold:!0,children:`Components:`}),(0,Z.jsxs)(z,{dimColor:!0,children:[`Error: `,o]})]}):!n||!(n.commands||n.agents||n.skills||n.hooks||n.mcpServers)?null:(0,Z.jsxs)(R,{flexDirection:`column`,marginBottom:1,children:[(0,Z.jsx)(z,{bold:!0,children:`Installed components:`}),n.commands?(0,Z.jsxs)(z,{dimColor:!0,children:[`• Commands:`,` `,typeof n.commands==`string`?n.commands:Array.isArray(n.commands)?n.commands.join(`, `):Object.keys(n.commands).join(`, `)]}):null,n.agents?(0,Z.jsxs)(z,{dimColor:!0,children:[`• Agents:`,` `,typeof n.agents==`string`?n.agents:Array.isArray(n.agents)?n.agents.join(`, `):Object.keys(n.agents).join(`, `)]}):null,n.skills?(0,Z.jsxs)(z,{dimColor:!0,children:[`• Skills:`,` `,typeof n.skills==`string`?n.skills:Array.isArray(n.skills)?n.skills.join(`, `):Object.keys(n.skills).join(`, `)]}):null,n.hooks?(0,Z.jsxs)(z,{dimColor:!0,children:[`• Hooks:`,` `,typeof n.hooks==`string`?n.hooks:Array.isArray(n.hooks)?n.hooks.map(String).join(`, `):typeof n.hooks==`object`&&n.hooks!==null?Object.keys(n.hooks).join(`, `):String(n.hooks)]}):null,n.mcpServers?(0,Z.jsxs)(z,{dimColor:!0,children:[`• MCP Servers:`,` `,typeof n.mcpServers==`string`?n.mcpServers:Array.isArray(n.mcpServers)?n.mcpServers.map(String).join(`, `):typeof n.mcpServers==`object`&&n.mcpServers!==null?Object.keys(n.mcpServers).join(`, `):String(n.mcpServers)]}):null]})}async function Xn(e,t){let n=(await _(t))?.plugins.find(t=>t.name===e);return n&&typeof n.source==`string`?`Local plugins cannot be updated remotely. To update, modify the source at: ${n.source}`:null}function Zn(e){return e.filter(e=>{let t=e.source.split(`@`)[1]||`local`;return!se(`${e.name}@${t}`)})}function Qn({setViewState:e,setResult:t,onManageComplete:n,onSearchModeChange:r,targetPlugin:i,targetMarketplace:o,action:s}){let l=Te(e=>e.mcp.clients),u=Te(e=>e.mcp.tools),d=Te(e=>e.plugins.errors),f=It(),[p,h]=(0,X.useState)(!1),g=(0,X.useCallback)(e=>{h(e),r?.(e)},[r]),_=Le(),{columns:v}=He(),[y,x]=(0,X.useState)(`plugin-list`),{query:S,setQuery:ee,cursorOffset:te}=Wt({isActive:y===`plugin-list`&&p,onExit:()=>{g(!1)}}),[C,w]=(0,X.useState)(null),[ne,re]=(0,X.useState)([]),[ie,T]=(0,X.useState)([]),[E,ae]=(0,X.useState)(!0),[se,ce]=(0,X.useState)(new Map),D=(0,X.useRef)(!1),O=(0,X.useRef)(void 0),le=zt();Ie(`confirm:no`,$n.useCallback(()=>{if(y===`plugin-details`)x(`plugin-list`),w(null),I(null);else if(typeof y==`object`&&y.type===`failed-plugin-details`)x(`plugin-list`),I(null);else if(y===`configuring`)x(`plugin-details`),we(null);else if(typeof y==`object`&&(y.type===`plugin-options`||y.type===`configuring-options`))x(`plugin-list`),w(null),t(`Plugin enabled. Configuration skipped — run /reload-plugins to apply.`),n&&n();else if(typeof y==`object`&&y.type===`flagged-detail`)x(`plugin-list`),I(null);else if(typeof y==`object`&&y.type===`mcp-detail`)x(`plugin-list`),I(null);else if(typeof y==`object`&&y.type===`mcp-tools`)x({type:`mcp-detail`,client:y.client});else if(typeof y==`object`&&y.type===`mcp-tool-detail`)x({type:`mcp-tools`,client:y.client});else{if(se.size>0){t(`Run /reload-plugins to apply plugin changes.`);return}e({type:`menu`})}},[y,e,se,t]),{context:`Confirmation`,isActive:(y!==`plugin-list`||!p)&&y!==`confirm-project-uninstall`&&!(typeof y==`object`&&y.type===`confirm-data-cleanup`)});let A=e=>e.type===`connected`?`connected`:e.type===`disabled`?`disabled`:e.type===`pending`?`pending`:e.type===`needs-auth`?`needs-auth`:`failed`,ue=(0,X.useMemo)(()=>{let e=it(),t=new Map;for(let e of l)if(e.name.startsWith(`plugin:`)){let n=e.name.split(`:`);if(n.length>=3){let r=n[1],i=n.slice(2).join(`:`),a=t.get(r)||[];a.push({displayName:i,client:e}),t.set(r,a)}}let n=[];for(let r of ie){let i=`${r.plugin.name}@${r.marketplace}`,a=e?.enabledPlugins?.[i]!==!1,o=d.filter(e=>`plugin`in e&&e.plugin===r.plugin.name||e.source===i||e.source.startsWith(`${r.plugin.name}@`)),s=r.plugin.isBuiltin?`builtin`:r.scope||`user`;n.push({item:{type:`plugin`,id:i,name:r.plugin.name,description:r.plugin.manifest.description,marketplace:r.marketplace,scope:s,isEnabled:a,errorCount:o.length,errors:o,plugin:r.plugin,pendingEnable:r.pendingEnable,pendingUpdate:r.pendingUpdate,pendingToggle:se.get(i)},originalScope:s,childMcps:t.get(r.plugin.name)||[]})}let r=new Set(n.map(({item:e})=>e.id)),i=new Set(n.map(({item:e})=>e.name)),a=new Map;for(let e of d){if(r.has(e.source)||`plugin`in e&&typeof e.plugin==`string`&&i.has(e.plugin))continue;let t=a.get(e.source)||[];t.push(e),a.set(e.source,t)}let o=yt(),s=[];for(let[e,t]of a){if(e in f)continue;let n=b(e),r=n.name||e,i=n.marketplace||`unknown`,a=o.get(e),c=a===`flag`||a===void 0?`user`:a;s.push({type:`failed-plugin`,id:e,name:r,marketplace:i,scope:c,errorCount:t.length,errors:t})}let c=[];for(let e of l)e.name!==`ide`&&(e.name.startsWith(`plugin:`)||c.push({type:`mcp`,id:`mcp:${e.name}`,name:e.name,description:void 0,scope:e.config.scope,status:A(e),client:e}));let u={flagged:-1,project:0,local:1,user:2,enterprise:3,managed:4,dynamic:5,builtin:6},p=[],m=new Map;for(let{item:e,originalScope:t,childMcps:r}of n){let n=e.scope;m.has(n)||m.set(n,[]),m.get(n).push(e);for(let{displayName:e,client:n}of r){let r=t===`builtin`?`user`:t;m.has(r)||m.set(r,[]),m.get(r).push({type:`mcp`,id:`mcp:${n.name}`,name:e,description:void 0,scope:r,status:A(n),client:n,indented:!0})}}for(let e of c){let t=e.scope;m.has(t)||m.set(t,[]),m.get(t).push(e)}for(let e of s){let t=e.scope;m.has(t)||m.set(t,[]),m.get(t).push(e)}for(let[e,t]of Object.entries(f)){let n=b(e),r=n.name||e,i=n.marketplace||`unknown`;m.has(`flagged`)||m.set(`flagged`,[]),m.get(`flagged`).push({type:`flagged-plugin`,id:e,name:r,marketplace:i,scope:`flagged`,reason:`delisted`,text:`Removed from marketplace`,flaggedAt:t.flaggedAt})}let h=[...m.keys()].sort((e,t)=>(u[e]??99)-(u[t]??99));for(let e of h){let t=m.get(e),n=[],r=[],i=0;for(;i<t.length;){let e=t[i];if(e.type===`plugin`||e.type===`failed-plugin`||e.type===`flagged-plugin`){let r=[e];i++;let a=t[i];for(;a?.type===`mcp`&&a.indented;)r.push(a),i++,a=t[i];n.push(r)}else e.type===`mcp`&&!e.indented&&r.push(e),i++}n.sort((e,t)=>e[0].name.localeCompare(t[0].name)),r.sort((e,t)=>e.name.localeCompare(t.name));for(let e of n)p.push(...e);p.push(...r)}return p},[ie,l,d,se,f]),j=(0,X.useMemo)(()=>ue.filter(e=>e.type===`flagged-plugin`).map(e=>e.id),[ue]);(0,X.useEffect)(()=>{j.length>0&&Ft(j)},[j]);let M=(0,X.useMemo)(()=>{if(!S)return ue;let e=S.toLowerCase();return ue.filter(t=>t.name.toLowerCase().includes(e)||`description`in t&&t.description?.toLowerCase().includes(e))},[ue,S]),[N,fe]=(0,X.useState)(0),pe=En({totalItems:M.length,selectedIndex:N,maxVisible:8}),[me,P]=(0,X.useState)(0),[be,F]=(0,X.useState)(!1),[xe,I]=(0,X.useState)(null),[Ce,we]=(0,X.useState)(null),[Ee,De]=(0,X.useState)(!1),[Oe,ke]=(0,X.useState)(!1);(0,X.useEffect)(()=>{if(!C){ke(!1);return}async function e(){let e=C.plugin.manifest.mcpServers,t=!1;if(e&&(t=typeof e==`string`&&de(e)||Array.isArray(e)&&e.some(e=>typeof e==`string`&&de(e))),!t)try{let e=nn.join(C.plugin.path,`..`),n=nn.join(e,`.claude-plugin`,`marketplace.json`),r=Xe(await rn.readFile(n,`utf-8`)).plugins?.find(e=>e.name===C.plugin.name);if(r?.mcpServers){let e=r.mcpServers;t=typeof e==`string`&&de(e)||Array.isArray(e)&&e.some(e=>typeof e==`string`&&de(e))}}catch(e){Qe(`Failed to read raw marketplace.json: ${e}`)}ke(t)}e()},[C]),(0,X.useEffect)(()=>{async function e(){ae(!0);try{let{enabled:e,disabled:t}=await k(),n=it(),r=Zn([...e,...t]),i={};for(let e of r){let t=e.source.split(`@`)[1]||`local`;i[t]||(i[t]=[]),i[t].push(e)}let a=[];for(let[e,t]of Object.entries(i)){let r=tt(t,t=>{let r=`${t.name}@${e}`;return n?.enabledPlugins?.[r]!==!1}),i=t.length-r;a.push({name:e,installedPlugins:t,enabledCount:r,disabledCount:i})}a.sort((e,t)=>e.name===`claude-plugin-directory`?-1:t.name===`claude-plugin-directory`?1:e.name.localeCompare(t.name)),re(a);let o=[];for(let e of a)for(let t of e.installedPlugins){let n=`${t.name}@${e.name}`,r=t.isBuiltin?`builtin`:Tt(n).scope;o.push({plugin:t,marketplace:e.name,scope:r,pendingEnable:void 0,pendingUpdate:!1})}T(o),fe(0)}finally{ae(!1)}}e()},[]),(0,X.useEffect)(()=>{if(!D.current&&i&&ne.length>0&&!E){let{name:e,marketplace:n}=b(i),r=o??n,a=r?ne.filter(e=>e.name===r):ne;for(let t of a){let n=t.installedPlugins.find(t=>t.name===e);if(n){let{scope:e}=Tt(`${n.name}@${t.name}`),r={plugin:n,marketplace:t.name,scope:e,pendingEnable:void 0,pendingUpdate:!1};w(r),x(`plugin-details`),O.current=s,D.current=!0;return}}let c=ue.find(t=>t.type===`failed-plugin`&&t.name===e);c&&c.type===`failed-plugin`&&(x({type:`failed-plugin-details`,plugin:{id:c.id,name:c.name,marketplace:c.marketplace,errors:c.errors,scope:c.scope}}),D.current=!0),!D.current&&s&&(D.current=!0,t(`Plugin "${i}" is not installed in this project`))}},[i,o,ne,E,ue,s,t]);let je=async r=>{if(!C)return;let i=C.scope||`user`,a=i===`builtin`;if(a&&(r===`update`||r===`uninstall`)){I(`Built-in plugins cannot be updated or uninstalled.`);return}if(!a&&!wt(i)&&r!==`update`){I(`This plugin is managed by your organization. Contact your admin to disable it.`);return}F(!0),I(null);try{let o=`${C.plugin.name}@${C.marketplace}`,s;switch(r){case`enable`:{let e=await bt(o);if(!e.success)throw Error(e.message);break}case`disable`:{let e=await Ct(o);if(!e.success)throw Error(e.message);s=e.reverseDependents;break}case`uninstall`:{if(a||!wt(i))break;if(Dt(o)){F(!1),x(`confirm-project-uninstall`);return}let e=_e().plugins[o],t=!e||e.length<=1?await m(o):null;if(t){F(!1),x({type:`confirm-data-cleanup`,size:t});return}let n=await xt(o,i);if(!n.success)throw Error(n.message);s=n.reverseDependents;break}case`update`:{if(a)break;let r=await St(o,i);if(!r.success)throw Error(r.message);if(r.alreadyUpToDate){t(`${C.plugin.name} is already at the latest version (${r.newVersion}).`),n&&await n(),e({type:`menu`});return}break}}Se();let c=`${C.plugin.name}@${C.marketplace}`;if(it()?.enabledPlugins?.[c]!==!1){F(!1),x({type:`plugin-options`});return}let l=r===`enable`?`Enabled`:r===`disable`?`Disabled`:r===`update`?`Updated`:`Uninstalled`,u=s&&s.length>0?` · required by ${s.join(`, `)}`:``;t(`✓ ${l} ${C.plugin.name}${u}. Run /reload-plugins to apply.`),n&&await n(),e({type:`menu`})}catch(e){F(!1);let t=e instanceof Error?e.message:String(e);I(`Failed to ${r}: ${t}`),ft(Ze(e))}},Me=(0,X.useRef)(je);Me.current=je,(0,X.useEffect)(()=>{if(y===`plugin-details`&&C&&O.current){let e=O.current;O.current=void 0,Me.current(e)}},[y,C]);let Ne=$n.useCallback(()=>{if(N>=M.length)return;let e=M[N];if(e?.type!==`flagged-plugin`)if(e?.type===`plugin`){let t=`${e.plugin.name}@${e.marketplace}`,n=it(),r=se.get(t),i=n?.enabledPlugins?.[t]!==!1,a=e.scope;if(a===`builtin`||wt(a)){let e=new Map(se);r?(e.delete(t),(async()=>{try{r===`will-disable`?await bt(t):await Ct(t),Se()}catch(e){ft(e)}})()):(e.set(t,i?`will-disable`:`will-enable`),(async()=>{try{i?await Ct(t):await bt(t),Se()}catch(e){ft(e)}})()),ce(e)}}else e?.type===`mcp`&&le(e.client.name)},[N,M,se,ie,le]);L({"select:previous":()=>{N===0?g(!0):pe.handleSelectionChange(N-1,fe)},"select:next":()=>{N<M.length-1&&pe.handleSelectionChange(N+1,fe)},"select:accept":$n.useCallback(()=>{if(N>=M.length)return;let e=M[N];if(e?.type===`plugin`){let t=ie.find(t=>t.plugin.name===e.plugin.name&&t.marketplace===e.marketplace);t&&(w(t),x(`plugin-details`),P(0),I(null))}else e?.type===`flagged-plugin`?(x({type:`flagged-detail`,plugin:{id:e.id,name:e.name,marketplace:e.marketplace,reason:e.reason,text:e.text,flaggedAt:e.flaggedAt}}),I(null)):e?.type===`failed-plugin`?(x({type:`failed-plugin-details`,plugin:{id:e.id,name:e.name,marketplace:e.marketplace,errors:e.errors,scope:e.scope}}),P(0),I(null)):e?.type===`mcp`&&(x({type:`mcp-detail`,client:e.client}),I(null))},[N,M,ie])},{context:`Select`,isActive:y===`plugin-list`&&!p}),L({"plugin:toggle":Ne},{context:`Plugin`,isActive:y===`plugin-list`&&!p}),L({"select:accept":$n.useCallback(()=>{typeof y!=`object`||y.type!==`flagged-detail`||(Lt(y.plugin.id),x(`plugin-list`))},[y])},{context:`Select`,isActive:typeof y==`object`&&y.type===`flagged-detail`});let Pe=$n.useMemo(()=>{if(y!==`plugin-details`||!C)return[];let e=it(),t=`${C.plugin.name}@${C.marketplace}`,n=e?.enabledPlugins?.[t]!==!1,r=C.marketplace===`builtin`,i=[];return i.push({label:n?`Disable plugin`:`Enable plugin`,action:()=>void je(n?`disable`:`enable`)}),r||(i.push({label:C.pendingUpdate?`Unmark for update`:`Mark for update`,action:async()=>{try{let e=await Xn(C.plugin.name,C.marketplace);if(e){I(e);return}let t=[...ie],n=t.findIndex(e=>e.plugin.name===C.plugin.name&&e.marketplace===C.marketplace);n!==-1&&(t[n].pendingUpdate=!C.pendingUpdate,T(t),w({...C,pendingUpdate:!C.pendingUpdate}))}catch(e){I(e instanceof Error?e.message:`Failed to check plugin update availability`)}}}),Oe&&i.push({label:`Configure`,action:async()=>{De(!0);try{let e=C.plugin.manifest.mcpServers,t=null;if(typeof e==`string`&&de(e))t=e;else if(Array.isArray(e)){for(let n of e)if(typeof n==`string`&&de(n)){t=n;break}}if(!t){I(`No MCPB file found in plugin`),De(!1);return}let n=`${C.plugin.name}@${C.marketplace}`,r=await ye(t,C.plugin.path,n,void 0,void 0,!0);`status`in r&&r.status===`needs-config`?(we(r),x(`configuring`)):I(`Failed to load MCPB for configuration`)}catch(e){let t=Je(e);I(`Failed to load configuration: ${t}`)}finally{De(!1)}}}),C.plugin.manifest.userConfig&&Object.keys(C.plugin.manifest.userConfig).length>0&&i.push({label:`Configure options`,action:()=>{x({type:`configuring-options`,schema:C.plugin.manifest.userConfig})}}),i.push({label:`Update now`,action:()=>void je(`update`)}),i.push({label:`Uninstall`,action:()=>void je(`uninstall`)})),C.plugin.manifest.homepage&&i.push({label:`Open homepage`,action:()=>void oe(C.plugin.manifest.homepage)}),C.plugin.manifest.repository&&i.push({label:`View repository`,action:()=>void oe(C.plugin.manifest.repository)}),i.push({label:`Back to plugin list`,action:()=>{x(`plugin-list`),w(null),I(null)}}),i},[y,C,Oe,ie]);if(L({"select:previous":()=>{me>0&&P(me-1)},"select:next":()=>{me<Pe.length-1&&P(me+1)},"select:accept":()=>{Pe[me]&&Pe[me].action()}},{context:`Select`,isActive:y===`plugin-details`&&!!C}),L({"select:accept":()=>{typeof y==`object`&&y.type===`failed-plugin-details`&&(async()=>{F(!0),I(null);let e=y.plugin.id,t=y.plugin.scope,r=wt(t)?await xt(e,t,!1):await xt(e,`user`,!1),i=r.success;if(!i){for(let t of[`userSettings`,`projectSettings`,`localSettings`]){let n=rt(t);n?.enabledPlugins?.[e]!==void 0&&(st(t,{enabledPlugins:{...n.enabledPlugins,[e]:void 0}}),i=!0)}Se()}i?(n&&await n(),F(!1),x(`plugin-list`)):(F(!1),I(r.message))})()}},{context:`Select`,isActive:typeof y==`object`&&y.type===`failed-plugin-details`&&y.plugin.scope!==`managed`}),L({"confirm:yes":()=>{if(!C)return;F(!0),I(null);let r=`${C.plugin.name}@${C.marketplace}`,{error:i}=st(`localSettings`,{enabledPlugins:{...rt(`localSettings`)?.enabledPlugins,[r]:!1}});if(i){F(!1),I(`Failed to write settings: ${i.message}`);return}Se(),t(`✓ Disabled ${C.plugin.name} in .workmate/settings.local.json. Run /reload-plugins to apply.`),n&&n(),e({type:`menu`})},"confirm:no":()=>{x(`plugin-details`),I(null)}},{context:`Confirmation`,isActive:y===`confirm-project-uninstall`&&!!C&&!be}),Re((r,i)=>{if(!C)return;let o=`${C.plugin.name}@${C.marketplace}`,s=C.scope;if(!s||s===`builtin`||!wt(s))return;let c=async r=>{F(!0),I(null);try{let i=await xt(o,s,r);if(!i.success)throw Error(i.message);Se();let c=r?``:` · data preserved`;t(`${a.tick} ${i.message}${c}`),n&&n(),e({type:`menu`})}catch(e){F(!1),I(e instanceof Error?e.message:String(e))}};r===`y`||r===`Y`?c(!0):r===`n`||r===`N`?c(!1):i.escape&&(x(`plugin-details`),I(null))},{isActive:typeof y==`object`&&y.type===`confirm-data-cleanup`&&!!C&&!be}),$n.useEffect(()=>{fe(0)},[S]),Re((e,t)=>{let n=!t.ctrl&&!t.meta;p||(e===`/`&&n?(g(!0),ee(``),fe(0)):n&&e.length>0&&!/^\s+$/.test(e)&&e!==`j`&&e!==`k`&&e!==` `&&(g(!0),ee(e),fe(0)))},{isActive:y===`plugin-list`}),E)return(0,Z.jsx)(z,{children:`Loading installed plugins…`});if(ue.length===0)return(0,Z.jsxs)(R,{flexDirection:`column`,children:[(0,Z.jsx)(R,{marginBottom:1,children:(0,Z.jsx)(z,{bold:!0,children:`Manage plugins`})}),(0,Z.jsx)(z,{children:`No plugins or MCP servers installed.`}),(0,Z.jsx)(R,{marginTop:1,children:(0,Z.jsx)(z,{dimColor:!0,children:`Esc to go back`})})]});if(typeof y==`object`&&y.type===`plugin-options`&&C){let r=`${C.plugin.name}@${C.marketplace}`;function i(r){t(r),n&&n(),e({type:`menu`})}return(0,Z.jsx)(mn,{plugin:C.plugin,pluginId:r,onDone:(e,t)=>{switch(e){case`configured`:i(`✓ Enabled and configured ${C.plugin.name}. Run /reload-plugins to apply.`);break;case`skipped`:i(`✓ Enabled ${C.plugin.name}. Run /reload-plugins to apply.`);break;case`error`:i(`Failed to save configuration: ${t}`);break}}})}if(typeof y==`object`&&y.type===`configuring-options`&&C){let e=`${C.plugin.name}@${C.marketplace}`;return(0,Z.jsx)(ln,{title:`Configure ${C.plugin.name}`,subtitle:`Plugin options`,configSchema:y.schema,initialValues:ve(e),onSave:n=>{try{Ae(e,n,y.schema),Se(),t(`Configuration saved. Run /reload-plugins for changes to take effect.`)}catch(e){I(`Failed to save configuration: ${Je(e)}`)}x(`plugin-details`)},onCancel:()=>x(`plugin-details`)})}if(y===`configuring`&&Ce&&C){let e=`${C.plugin.name}@${C.marketplace}`;async function n(n){if(!(!Ce||!C))try{let r=C.plugin.manifest.mcpServers,i=null;if(typeof r==`string`&&de(r))i=r;else if(Array.isArray(r)){for(let e of r)if(typeof e==`string`&&de(e)){i=e;break}}if(!i){I(`No MCPB file found`),x(`plugin-details`);return}await ye(i,C.plugin.path,e,void 0,n),I(null),we(null),x(`plugin-details`),t(`Configuration saved. Run /reload-plugins for changes to take effect.`)}catch(e){let t=Je(e);I(`Failed to save configuration: ${t}`),x(`plugin-details`)}}function r(){we(null),x(`plugin-details`)}return(0,Z.jsx)(ln,{title:`Configure ${Ce.manifest.name}`,subtitle:`Plugin: ${C.plugin.name}`,configSchema:Ce.configSchema,initialValues:Ce.existingConfig,onSave:n,onCancel:r})}if(typeof y==`object`&&y.type===`flagged-detail`){let e=y.plugin;return(0,Z.jsxs)(R,{flexDirection:`column`,children:[(0,Z.jsx)(R,{children:(0,Z.jsxs)(z,{bold:!0,children:[e.name,` @ `,e.marketplace]})}),(0,Z.jsxs)(R,{marginBottom:1,children:[(0,Z.jsx)(z,{dimColor:!0,children:`Status: `}),(0,Z.jsx)(z,{color:`error`,children:`Removed`})]}),(0,Z.jsxs)(R,{marginBottom:1,flexDirection:`column`,children:[(0,Z.jsxs)(z,{color:`error`,children:[`Removed from marketplace · reason: `,e.reason]}),(0,Z.jsx)(z,{children:e.text}),(0,Z.jsxs)(z,{dimColor:!0,children:[`Flagged on `,new Date(e.flaggedAt).toLocaleDateString()]})]}),(0,Z.jsx)(R,{marginTop:1,flexDirection:`column`,children:(0,Z.jsxs)(R,{children:[(0,Z.jsxs)(z,{children:[a.pointer,` `]}),(0,Z.jsx)(z,{color:`suggestion`,children:`Dismiss`})]})}),(0,Z.jsxs)(B,{children:[(0,Z.jsx)(c,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`dismiss`}),(0,Z.jsx)(c,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})]})}if(y===`confirm-project-uninstall`&&C)return(0,Z.jsxs)(R,{flexDirection:`column`,children:[(0,Z.jsxs)(z,{bold:!0,color:`warning`,children:[C.plugin.name,` is enabled in .workmate/settings.json (shared with your team)`]}),(0,Z.jsxs)(R,{marginTop:1,flexDirection:`column`,children:[(0,Z.jsx)(z,{children:`Disable it just for you in .workmate/settings.local.json?`}),(0,Z.jsx)(z,{dimColor:!0,children:`This has the same effect as uninstalling, without affecting other contributors.`})]}),xe&&(0,Z.jsx)(R,{marginTop:1,children:(0,Z.jsx)(z,{color:`error`,children:xe})}),(0,Z.jsx)(R,{marginTop:1,children:be?(0,Z.jsx)(z,{dimColor:!0,children:`Disabling…`}):(0,Z.jsxs)(B,{children:[(0,Z.jsx)(c,{action:`confirm:yes`,context:`Confirmation`,fallback:`y`,description:`disable`}),(0,Z.jsx)(c,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]});if(typeof y==`object`&&y.type===`confirm-data-cleanup`&&C)return(0,Z.jsxs)(R,{flexDirection:`column`,children:[(0,Z.jsxs)(z,{bold:!0,children:[C.plugin.name,` has `,y.size.human,` of persistent data`]}),(0,Z.jsxs)(R,{marginTop:1,flexDirection:`column`,children:[(0,Z.jsx)(z,{children:`Delete it along with the plugin?`}),(0,Z.jsx)(z,{dimColor:!0,children:he(`${C.plugin.name}@${C.marketplace}`)})]}),xe&&(0,Z.jsx)(R,{marginTop:1,children:(0,Z.jsx)(z,{color:`error`,children:xe})}),(0,Z.jsx)(R,{marginTop:1,children:be?(0,Z.jsx)(z,{dimColor:!0,children:`Uninstalling…`}):(0,Z.jsxs)(z,{children:[(0,Z.jsx)(z,{bold:!0,children:`y`}),` to delete · `,(0,Z.jsx)(z,{bold:!0,children:`n`}),` to keep · `,(0,Z.jsx)(z,{bold:!0,children:`esc`}),` to cancel`]})})]});if(y===`plugin-details`&&C){let e=it(),t=`${C.plugin.name}@${C.marketplace}`,n=e?.enabledPlugins?.[t]!==!1,r=d.filter(e=>`plugin`in e&&e.plugin===C.plugin.name||e.source===t||e.source.startsWith(`${C.plugin.name}@`)),i=r.length===0?null:(0,Z.jsxs)(R,{flexDirection:`column`,marginBottom:1,children:[(0,Z.jsxs)(z,{bold:!0,color:`error`,children:[r.length,` `,H(r.length,`error`),`:`]}),r.map((e,t)=>{let n=Un(e);return(0,Z.jsxs)(R,{flexDirection:`column`,marginLeft:2,children:[(0,Z.jsx)(z,{color:`error`,children:Hn(e)}),n&&(0,Z.jsxs)(z,{dimColor:!0,italic:!0,children:[a.arrowRight,` `,n]})]},t)})]});return(0,Z.jsxs)(R,{flexDirection:`column`,children:[(0,Z.jsx)(R,{children:(0,Z.jsxs)(z,{bold:!0,children:[C.plugin.name,` @ `,C.marketplace]})}),(0,Z.jsxs)(R,{children:[(0,Z.jsx)(z,{dimColor:!0,children:`Scope: `}),(0,Z.jsx)(z,{children:C.scope||`user`})]}),C.plugin.manifest.version&&(0,Z.jsxs)(R,{children:[(0,Z.jsx)(z,{dimColor:!0,children:`Version: `}),(0,Z.jsx)(z,{children:C.plugin.manifest.version})]}),C.plugin.manifest.description&&(0,Z.jsx)(R,{marginBottom:1,children:(0,Z.jsx)(z,{children:C.plugin.manifest.description})}),C.plugin.manifest.author&&(0,Z.jsxs)(R,{children:[(0,Z.jsx)(z,{dimColor:!0,children:`Author: `}),(0,Z.jsx)(z,{children:C.plugin.manifest.author.name})]}),(0,Z.jsxs)(R,{marginBottom:1,children:[(0,Z.jsx)(z,{dimColor:!0,children:`Status: `}),(0,Z.jsx)(z,{color:n?`success`:`warning`,children:n?`Enabled`:`Disabled`}),C.pendingUpdate&&(0,Z.jsx)(z,{color:`suggestion`,children:` · Marked for update`})]}),(0,Z.jsx)(Yn,{plugin:C.plugin,marketplace:C.marketplace}),i,(0,Z.jsx)(R,{marginTop:1,flexDirection:`column`,children:Pe.map((e,t)=>{let n=t===me;return(0,Z.jsxs)(R,{children:[n&&(0,Z.jsxs)(z,{children:[a.pointer,` `]}),!n&&(0,Z.jsx)(z,{children:` `}),(0,Z.jsx)(z,{bold:n,color:e.label.includes(`Uninstall`)?`error`:e.label.includes(`Update`)?`suggestion`:void 0,children:e.label})]},t)})}),be&&(0,Z.jsx)(R,{marginTop:1,children:(0,Z.jsx)(z,{children:`Processing…`})}),xe&&(0,Z.jsx)(R,{marginTop:1,children:(0,Z.jsx)(z,{color:`error`,children:xe})}),(0,Z.jsx)(R,{marginTop:1,children:(0,Z.jsx)(z,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(B,{children:[(0,Z.jsx)(c,{action:`select:previous`,context:`Select`,fallback:`↑`,description:`navigate`}),(0,Z.jsx)(c,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,Z.jsx)(c,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}if(typeof y==`object`&&y.type===`failed-plugin-details`){let e=y.plugin,t=e.errors[0],n=t?Hn(t):`Failed to load`;return(0,Z.jsxs)(R,{flexDirection:`column`,children:[(0,Z.jsxs)(z,{children:[(0,Z.jsx)(z,{bold:!0,children:e.name}),(0,Z.jsxs)(z,{dimColor:!0,children:[` @ `,e.marketplace]}),(0,Z.jsxs)(z,{dimColor:!0,children:[` (`,e.scope,`)`]})]}),(0,Z.jsx)(z,{color:`error`,children:n}),e.scope===`managed`?(0,Z.jsx)(R,{marginTop:1,children:(0,Z.jsx)(z,{dimColor:!0,children:`Managed by your organization — contact your admin`})}):(0,Z.jsxs)(R,{marginTop:1,children:[(0,Z.jsxs)(z,{color:`suggestion`,children:[a.pointer,` `]}),(0,Z.jsx)(z,{bold:!0,children:`Remove`})]}),be&&(0,Z.jsx)(z,{children:`Processing…`}),xe&&(0,Z.jsx)(z,{color:`error`,children:xe}),(0,Z.jsx)(R,{marginTop:1,children:(0,Z.jsx)(z,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(B,{children:[e.scope!==`managed`&&(0,Z.jsx)(c,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`remove`}),(0,Z.jsx)(c,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}if(typeof y==`object`&&y.type===`mcp-detail`){let e=y.client,n=ge(u,e.name).length,r=()=>{x({type:`mcp-tools`,client:e})},i=()=>{x(`plugin-list`)},a=e=>{e&&t(e),x(`plugin-list`)},o=e.config.scope,s=e.config.type;return s===`stdio`?(0,Z.jsx)(Kt,{server:{name:e.name,client:e,scope:o,transport:`stdio`,config:e.config},serverToolsCount:n,onViewTools:r,onCancel:i,onComplete:a,borderless:!0}):s===`sse`?(0,Z.jsx)(Qt,{server:{name:e.name,client:e,scope:o,transport:`sse`,isAuthenticated:void 0,config:e.config},serverToolsCount:n,onViewTools:r,onCancel:i,onComplete:a,borderless:!0}):s===`http`?(0,Z.jsx)(Qt,{server:{name:e.name,client:e,scope:o,transport:`http`,isAuthenticated:void 0,config:e.config},serverToolsCount:n,onViewTools:r,onCancel:i,onComplete:a,borderless:!0}):s===`claudeai-proxy`?(0,Z.jsx)(Qt,{server:{name:e.name,client:e,scope:o,transport:`claudeai-proxy`,isAuthenticated:void 0,config:e.config},serverToolsCount:n,onViewTools:r,onCancel:i,onComplete:a,borderless:!0}):(x(`plugin-list`),null)}if(typeof y==`object`&&y.type===`mcp-tools`){let e=y.client,t=e.config.scope,n=e.config.type,r;return r=n===`stdio`?{name:e.name,client:e,scope:t,transport:`stdio`,config:e.config}:n===`sse`?{name:e.name,client:e,scope:t,transport:`sse`,isAuthenticated:void 0,config:e.config}:n===`http`?{name:e.name,client:e,scope:t,transport:`http`,isAuthenticated:void 0,config:e.config}:{name:e.name,client:e,scope:t,transport:`claudeai-proxy`,isAuthenticated:void 0,config:e.config},(0,Z.jsx)($t,{server:r,onSelectTool:t=>{x({type:`mcp-tool-detail`,client:e,tool:t})},onBack:()=>x({type:`mcp-detail`,client:e})})}if(typeof y==`object`&&y.type===`mcp-tool-detail`){let{client:e,tool:t}=y,n=e.config.scope,r=e.config.type,i;return i=r===`stdio`?{name:e.name,client:e,scope:n,transport:`stdio`,config:e.config}:r===`sse`?{name:e.name,client:e,scope:n,transport:`sse`,isAuthenticated:void 0,config:e.config}:r===`http`?{name:e.name,client:e,scope:n,transport:`http`,isAuthenticated:void 0,config:e.config}:{name:e.name,client:e,scope:n,transport:`claudeai-proxy`,isAuthenticated:void 0,config:e.config},(0,Z.jsx)(Zt,{tool:t,server:i,onBack:()=>x({type:`mcp-tools`,client:e})})}let Fe=pe.getVisibleItems(M);return(0,Z.jsxs)(R,{flexDirection:`column`,children:[(0,Z.jsx)(R,{marginBottom:1,children:(0,Z.jsx)(Be,{query:S,isFocused:p,isTerminalFocused:_,width:v-4,cursorOffset:te})}),M.length===0&&S&&(0,Z.jsx)(R,{marginBottom:1,children:(0,Z.jsxs)(z,{dimColor:!0,children:[`No items match "`,S,`"`]})}),pe.scrollPosition.canScrollUp&&(0,Z.jsx)(R,{children:(0,Z.jsxs)(z,{dimColor:!0,children:[` `,a.arrowUp,` more above`]})}),Fe.map((e,t)=>{let n=pe.toActualIndex(t)===N&&!p,r=t>0?Fe[t-1]:null,i=!r||r.scope!==e.scope;return(0,Z.jsxs)($n.Fragment,{children:[i&&(0,Z.jsx)(R,{marginTop:+(t>0),paddingLeft:2,children:(0,Z.jsx)(z,{dimColor:e.scope!==`flagged`,color:e.scope===`flagged`?`warning`:void 0,bold:e.scope===`flagged`,children:(e=>{switch(e){case`flagged`:return`Flagged`;case`project`:return`Project`;case`local`:return`Local`;case`user`:return`User`;case`enterprise`:return`Enterprise`;case`managed`:return`Managed`;case`builtin`:return`Built-in`;case`dynamic`:return`Built-in`;default:return e}})(e.scope)})}),(0,Z.jsx)(Gn,{item:e,isSelected:n})]},e.id)}),pe.scrollPosition.canScrollDown&&(0,Z.jsx)(R,{children:(0,Z.jsxs)(z,{dimColor:!0,children:[` `,a.arrowDown,` more below`]})}),(0,Z.jsx)(R,{marginTop:1,marginLeft:1,children:(0,Z.jsx)(z,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(B,{children:[(0,Z.jsx)(z,{children:`type to search`}),(0,Z.jsx)(c,{action:`plugin:toggle`,context:`Plugin`,fallback:`Space`,description:`toggle`}),(0,Z.jsx)(c,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`details`}),(0,Z.jsx)(c,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})}),se.size>0&&(0,Z.jsx)(R,{marginLeft:1,children:(0,Z.jsx)(z,{dimColor:!0,italic:!0,children:`Run /reload-plugins to apply changes`})})]})}var $n,X,Z,er=e((()=>{i(),$n=t(V(),1),X=t(V(),1),P(),We(),qt(),Xt(),Jt(),Yt(),Ut(),Gt(),x(),h(),ae(),Bt(),te(),Et(),be(),nt(),j(),$e(),Ye(),dt(),Oe(),f(),w(),le(),u(),Rt(),re(),je(),O(),M(),vt(),at(),et(),_t(),Wn(),fn(),_n(),Kn(),kn(),Z=qe()}));function tr(e){if(!e)return{type:`menu`};let t=e.trim().split(/\s+/);switch(t[0]?.toLowerCase()){case`help`:case`--help`:case`-h`:return{type:`help`};case`install`:case`i`:{let e=t[1];if(!e)return{type:`install`};if(e.includes(`@`)){let[t,n]=e.split(`@`);return{type:`install`,plugin:t,marketplace:n}}return e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`file://`)||e.includes(`/`)||e.includes(`\\`)?{type:`install`,marketplace:e}:{type:`install`,plugin:e}}case`manage`:return{type:`manage`};case`uninstall`:return{type:`uninstall`,plugin:t[1]};case`enable`:return{type:`enable`,plugin:t[1]};case`disable`:return{type:`disable`,plugin:t[1]};case`validate`:return{type:`validate`,path:t.slice(1).join(` `).trim()||void 0};case`marketplace`:case`market`:{let e=t[1]?.toLowerCase(),n=t.slice(2).join(` `);switch(e){case`add`:return{type:`marketplace`,action:`add`,target:n};case`remove`:case`rm`:return{type:`marketplace`,action:`remove`,target:n};case`update`:return{type:`marketplace`,action:`update`,target:n};case`list`:return{type:`marketplace`,action:`list`};default:return{type:`marketplace`}}}default:return{type:`menu`}}}var nr=e((()=>{}));function rr({onComplete:e,path:t}){return(0,ir.useEffect)(()=>{async function n(){if(!t){e(`Usage: /plugin validate <path>
2
+
3
+ Validate a plugin or marketplace manifest file or directory.
4
+
5
+ Examples:
6
+ /plugin validate .claude-plugin/plugin.json
7
+ /plugin validate /path/to/plugin-directory
8
+ /plugin validate .
9
+
10
+ When given a directory, automatically validates .claude-plugin/marketplace.json
11
+ or .claude-plugin/plugin.json (prefers marketplace if both exist).
12
+
13
+ Or from the command line:
14
+ claude plugin validate <path>`);return}try{let n=await jt(t),r=``;r+=`Validating ${n.fileType} manifest: ${n.filePath}\n\n`,n.errors.length>0&&(r+=`${a.cross} Found ${n.errors.length} ${H(n.errors.length,`error`)}:\n\n`,n.errors.forEach(e=>{r+=` ${a.pointer} ${e.path}: ${e.message}\n`}),r+=`
15
+ `),n.warnings.length>0&&(r+=`${a.warning} Found ${n.warnings.length} ${H(n.warnings.length,`warning`)}:\n\n`,n.warnings.forEach(e=>{r+=` ${a.pointer} ${e.path}: ${e.message}\n`}),r+=`
16
+ `),n.success?(n.warnings.length>0?r+=`${a.tick} Validation passed with warnings\n`:r+=`${a.tick} Validation passed\n`,process.exitCode=0):(r+=`${a.cross} Validation failed\n`,process.exitCode=1),e(r)}catch(t){process.exitCode=2,ft(t),e(`${a.cross} Unexpected error during validation: ${Je(t)}`)}}n()},[e,t]),(0,ar.jsx)(R,{flexDirection:`column`,children:(0,ar.jsx)(z,{children:`Running validation...`})})}var ir,ar,or=e((()=>{i(),V(),ir=t(V(),1),We(),Ye(),dt(),Pt(),_t(),ar=qe()}));function sr({onComplete:e}){return(0,Q.useEffect)(()=>{async function t(){try{let t=await Me(),n=Object.keys(t);n.length===0?e(`No marketplaces configured`):e(`Configured marketplaces:\n${n.map(e=>` • ${e}`).join(`
17
+ `)}`)}catch(t){e(`Error loading marketplaces: ${Je(t)}`)}}t()},[e]),(0,$.jsx)(z,{children:`Loading marketplaces...`})}function cr(e){let t=[];for(let{source:n,scope:r}of[{source:`userSettings`,scope:`user`},{source:`projectSettings`,scope:`project`},{source:`localSettings`,scope:`local`}])rt(n)?.extraKnownMarketplaces?.[e]&&t.push({source:n,scope:r});return{editableSources:t,isInPolicy:!!rt(`policySettings`)?.extraKnownMarketplaces?.[e]}}function lr(e){let{editableSources:t,isInPolicy:n}=cr(e);return t.length>0?{kind:`remove-extra-marketplace`,name:e,sources:t}:n?{kind:`managed-only`,name:e}:{kind:`navigate`,tab:`marketplaces`,viewState:{type:`manage-marketplaces`,targetMarketplace:e,action:`remove`}}}function ur(e){return{kind:`navigate`,tab:`installed`,viewState:{type:`manage-plugins`,targetPlugin:e,action:`uninstall`}}}function dr(e){return yr.has(e.type)}function fr(e){if(`pluginId`in e&&e.pluginId)return e.pluginId;if(`plugin`in e&&e.plugin)return e.plugin;if(e.source.includes(`@`))return e.source.split(`@`)[0]}function pr(e,t,n,r,i,a,o){let s=[];for(let e of a){let t=`pluginId`in e?e.pluginId:`plugin`in e?e.plugin:void 0;s.push({label:t??e.source,message:Hn(e),guidance:`Restart to retry loading plugins`,action:{kind:`none`}})}let c=new Set;for(let t of e){c.add(t.name);let e=lr(t.name),n=cr(t.name),r=n.isInPolicy?`managed`:n.editableSources[0]?.scope;s.push({label:t.name,message:t.error??`Installation failed`,guidance:e.kind===`managed-only`?`Managed by your organization — contact your admin`:void 0,action:e,scope:r})}for(let e of t){let t=`marketplace`in e?e.marketplace:e.source;if(c.has(t))continue;c.add(t);let n=lr(t),r=cr(t),i=r.isInPolicy?`managed`:r.editableSources[0]?.scope;s.push({label:t,message:Hn(e),guidance:n.kind===`managed-only`?`Managed by your organization — contact your admin`:Un(e),action:n,scope:i})}for(let e of i)c.has(e.name)||(c.add(e.name),s.push({label:e.name,message:e.error,action:{kind:`remove-installed-marketplace`,name:e.name}}));let l=new Set;for(let e of n){let t=fr(e);if(t&&l.has(t))continue;t&&l.add(t);let n=`marketplace`in e?e.marketplace:void 0,r=t?o.get(e.source)??o.get(t):void 0;s.push({label:t?n?`${t} @ ${n}`:t:e.source,message:Hn(e),guidance:Un(e),action:t?ur(t):{kind:`none`},scope:r})}for(let e of r)s.push({label:e.source,message:Hn(e),guidance:Un(e),action:{kind:`none`}});return s}function mr(e,t){for(let{source:n}of t){let t=rt(n);if(!t)continue;let r={};if(t.extraKnownMarketplaces?.[e]&&(r.extraKnownMarketplaces={...t.extraKnownMarketplaces,[e]:void 0}),t.enabledPlugins){let n=`@${e}`,i=!1,a={...t.enabledPlugins};for(let e in a)e.endsWith(n)&&(a[e]=void 0,i=!0);i&&(r.enabledPlugins=a)}Object.keys(r).length>0&&st(n,r)}}function hr({setViewState:e,setActiveTab:t,markPluginsChanged:n}){let r=Te(e=>e.plugins.errors),i=Te(e=>e.plugins.installationStatus),o=D(),[s,l]=(0,Q.useState)(0),[u,d]=(0,Q.useState)(null),[f,p]=(0,Q.useState)([]);(0,Q.useEffect)(()=>{(async()=>{try{let{failures:e}=await me(await Me());p(e)}catch{}})()},[]);let m=i.marketplaces.filter(e=>e.status===`failed`),h=new Set(m.map(e=>e.name)),g=r.filter(dr),_=pr(m,r.filter(e=>(e.type===`marketplace-not-found`||e.type===`marketplace-load-failed`||e.type===`marketplace-blocked-by-policy`)&&!h.has(e.marketplace)),r.filter(e=>dr(e)||e.type===`marketplace-not-found`||e.type===`marketplace-load-failed`||e.type===`marketplace-blocked-by-policy`?!1:fr(e)!==void 0),r.filter(e=>dr(e)||e.type===`marketplace-not-found`||e.type===`marketplace-load-failed`||e.type===`marketplace-blocked-by-policy`?!1:fr(e)===void 0),f,g,yt());Ie(`confirm:no`,()=>{e({type:`menu`})},{context:`Confirmation`}),L({"select:previous":()=>l(e=>Math.max(0,e-1)),"select:next":()=>l(e=>Math.min(_.length-1,e+1)),"select:accept":()=>{let r=_[s];if(!r)return;let{action:i}=r;switch(i.kind){case`navigate`:t(i.tab),e(i.viewState);break;case`remove-extra-marketplace`:{let e=i.sources.map(e=>e.scope).join(`, `);mr(i.name,i.sources),Se(),o(e=>({...e,plugins:{...e.plugins,errors:e.plugins.errors.filter(e=>!(`marketplace`in e&&e.marketplace===i.name)),installationStatus:{...e.plugins.installationStatus,marketplaces:e.plugins.installationStatus.marketplaces.filter(e=>e.name!==i.name)}}})),d(`${a.tick} Removed "${i.name}" from ${e} settings`),n();break}case`remove-installed-marketplace`:(async()=>{try{await ne(i.name),Se(),p(e=>e.filter(e=>e.name!==i.name)),d(`${a.tick} Removed marketplace "${i.name}"`),n()}catch(e){d(`Failed to remove "${i.name}": ${e instanceof Error?e.message:String(e)}`)}})();break;case`managed-only`:break;case`none`:break}}},{context:`Select`,isActive:_.length>0});let v=Math.min(s,Math.max(0,_.length-1));v!==s&&l(v);let y=_[v]?.action,b=y&&y.kind!==`none`&&y.kind!==`managed-only`;return _.length===0?(0,$.jsxs)(R,{flexDirection:`column`,children:[(0,$.jsx)(R,{marginLeft:1,children:(0,$.jsx)(z,{dimColor:!0,children:`No plugin errors`})}),(0,$.jsx)(R,{marginTop:1,children:(0,$.jsx)(z,{dimColor:!0,italic:!0,children:(0,$.jsx)(c,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})})})]}):(0,$.jsxs)(R,{flexDirection:`column`,children:[_.map((e,t)=>{let n=t===v;return(0,$.jsxs)(R,{marginLeft:1,flexDirection:`column`,marginBottom:1,children:[(0,$.jsxs)(z,{children:[(0,$.jsxs)(z,{color:n?`suggestion`:`error`,children:[n?a.pointer:a.cross,` `]}),(0,$.jsx)(z,{bold:n,children:e.label}),e.scope&&(0,$.jsxs)(z,{dimColor:!0,children:[` (`,e.scope,`)`]})]}),(0,$.jsx)(R,{marginLeft:3,children:(0,$.jsx)(z,{color:`error`,children:e.message})}),e.guidance&&(0,$.jsx)(R,{marginLeft:3,children:(0,$.jsx)(z,{dimColor:!0,italic:!0,children:e.guidance})})]},t)}),u&&(0,$.jsx)(R,{marginTop:1,marginLeft:1,children:(0,$.jsx)(z,{color:`claude`,children:u})}),(0,$.jsx)(R,{marginTop:1,children:(0,$.jsx)(z,{dimColor:!0,italic:!0,children:(0,$.jsxs)(B,{children:[(0,$.jsx)(c,{action:`select:previous`,context:`Select`,fallback:`↑`,description:`navigate`}),b&&(0,$.jsx)(c,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`resolve`}),(0,$.jsx)(c,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}function gr(e){switch(e.type){case`help`:return{type:`help`};case`validate`:return{type:`validate`,path:e.path};case`install`:return e.marketplace?{type:`browse-marketplace`,targetMarketplace:e.marketplace,targetPlugin:e.plugin}:e.plugin?{type:`discover-plugins`,targetPlugin:e.plugin}:{type:`discover-plugins`};case`manage`:return{type:`manage-plugins`};case`uninstall`:return{type:`manage-plugins`,targetPlugin:e.plugin,action:`uninstall`};case`enable`:return{type:`manage-plugins`,targetPlugin:e.plugin,action:`enable`};case`disable`:return{type:`manage-plugins`,targetPlugin:e.plugin,action:`disable`};case`marketplace`:return e.action===`list`?{type:`marketplace-list`}:e.action===`add`?{type:`add-marketplace`,initialValue:e.target}:e.action===`remove`?{type:`manage-marketplaces`,targetMarketplace:e.target,action:`remove`}:e.action===`update`?{type:`manage-marketplaces`,targetMarketplace:e.target,action:`update`}:{type:`marketplace-menu`};default:return{type:`discover-plugins`}}}function _r(e){return e.type===`manage-plugins`?`installed`:e.type===`manage-marketplaces`?`marketplaces`:`discover`}function vr({onComplete:e,args:t}){let n=tr(t),r=gr(n),[i,a]=(0,Q.useState)(r),[o,s]=(0,Q.useState)(_r(r)),[c,l]=(0,Q.useState)(i.type===`add-marketplace`&&i.initialValue||``),[u,d]=(0,Q.useState)(0),[f,p]=(0,Q.useState)(null),[m,h]=(0,Q.useState)(null),[g,_]=(0,Q.useState)(!1),v=D(),y=Te(e=>{let t=e.plugins.errors.length;for(let n of e.plugins.installationStatus.marketplaces)n.status===`failed`&&t++;return t}),b=y>0?`Errors (${y})`:`Errors`,x=Vt(),S=n.type===`marketplace`&&n.action===`add`&&n.target!==void 0,ee=(0,Q.useCallback)(()=>{v(e=>e.plugins.needsRefresh?e:{...e,plugins:{...e.plugins,needsRefresh:!0}})},[v]),te=(0,Q.useCallback)(e=>{let t=e;switch(s(t),p(null),t){case`discover`:a({type:`discover-plugins`});break;case`installed`:a({type:`manage-plugins`});break;case`marketplaces`:a({type:`manage-marketplaces`});break;case`errors`:break}},[]);return(0,Q.useEffect)(()=>{i.type===`menu`&&!m&&e()},[i.type,m,e]),(0,Q.useEffect)(()=>{i.type===`browse-marketplace`&&o!==`discover`&&s(`discover`)},[i.type,o]),Ie(`confirm:no`,(0,Q.useCallback)(()=>{s(`marketplaces`),a({type:`manage-marketplaces`}),l(``),p(null)},[]),{context:`Settings`,isActive:i.type===`add-marketplace`}),(0,Q.useEffect)(()=>{m&&e(m)},[m,e]),(0,Q.useEffect)(()=>{i.type===`help`&&e()},[i.type,e]),i.type===`help`?(0,$.jsxs)(R,{flexDirection:`column`,children:[(0,$.jsx)(z,{bold:!0,children:`Plugin Command Usage:`}),(0,$.jsx)(z,{children:` `}),(0,$.jsx)(z,{dimColor:!0,children:`Installation:`}),(0,$.jsx)(z,{children:` /plugin install - Browse and install plugins`}),(0,$.jsx)(z,{children:` /plugin install <marketplace> - Install from specific marketplace`}),(0,$.jsx)(z,{children:` /plugin install <plugin> - Install specific plugin`}),(0,$.jsx)(z,{children:` /plugin install <plugin>@<market> - Install plugin from marketplace`}),(0,$.jsx)(z,{children:` `}),(0,$.jsx)(z,{dimColor:!0,children:`Management:`}),(0,$.jsx)(z,{children:` /plugin manage - Manage installed plugins`}),(0,$.jsx)(z,{children:` /plugin enable <plugin> - Enable a plugin`}),(0,$.jsx)(z,{children:` /plugin disable <plugin> - Disable a plugin`}),(0,$.jsx)(z,{children:` /plugin uninstall <plugin> - Uninstall a plugin`}),(0,$.jsx)(z,{children:` `}),(0,$.jsx)(z,{dimColor:!0,children:`Marketplaces:`}),(0,$.jsx)(z,{children:` /plugin marketplace - Marketplace management menu`}),(0,$.jsx)(z,{children:` /plugin marketplace add - Add a marketplace`}),(0,$.jsx)(z,{children:` /plugin marketplace add <path/url> - Add marketplace directly`}),(0,$.jsx)(z,{children:` /plugin marketplace update - Update marketplaces`}),(0,$.jsx)(z,{children:` /plugin marketplace update <name> - Update specific marketplace`}),(0,$.jsx)(z,{children:` /plugin marketplace remove - Remove a marketplace`}),(0,$.jsx)(z,{children:` /plugin marketplace remove <name> - Remove specific marketplace`}),(0,$.jsx)(z,{children:` /plugin marketplace list - List all marketplaces`}),(0,$.jsx)(z,{children:` `}),(0,$.jsx)(z,{dimColor:!0,children:`Validation:`}),(0,$.jsx)(z,{children:` /plugin validate <path> - Validate a manifest file or directory`}),(0,$.jsx)(z,{children:` `}),(0,$.jsx)(z,{dimColor:!0,children:`Other:`}),(0,$.jsx)(z,{children:` /plugin - Main plugin menu`}),(0,$.jsx)(z,{children:` /plugin help - Show this help`}),(0,$.jsx)(z,{children:` /plugins - Alias for /plugin`})]}):i.type===`validate`?(0,$.jsx)(rr,{onComplete:e,path:i.path}):i.type===`marketplace-menu`?(a({type:`menu`}),null):i.type===`marketplace-list`?(0,$.jsx)(sr,{onComplete:e}):i.type===`add-marketplace`?(0,$.jsx)(an,{inputValue:c,setInputValue:l,cursorOffset:u,setCursorOffset:d,error:f,setError:p,result:m,setResult:h,setViewState:a,onAddComplete:ee,cliMode:S}):(0,$.jsx)(Ge,{color:`suggestion`,children:(0,$.jsxs)(Ue,{title:`Plugins`,selectedTab:o,onTabChange:te,color:`suggestion`,disableNavigation:g,children:[(0,$.jsx)(Ve,{id:`discover`,title:`Discover`,children:i.type===`browse-marketplace`?(0,$.jsx)(An,{error:f,setError:p,result:m,setResult:h,setViewState:a,onInstallComplete:ee,targetMarketplace:i.targetMarketplace,targetPlugin:i.targetPlugin}):(0,$.jsx)(Nn,{error:f,setError:p,result:m,setResult:h,setViewState:a,onInstallComplete:ee,onSearchModeChange:_,targetPlugin:i.type===`discover-plugins`?i.targetPlugin:void 0})}),(0,$.jsx)(Ve,{id:`installed`,title:`Installed`,children:(0,$.jsx)(Qn,{setViewState:a,setResult:h,onManageComplete:ee,onSearchModeChange:_,targetPlugin:i.type===`manage-plugins`?i.targetPlugin:void 0,targetMarketplace:i.type===`manage-plugins`?i.targetMarketplace:void 0,action:i.type===`manage-plugins`?i.action:void 0})}),(0,$.jsx)(Ve,{id:`marketplaces`,title:`Marketplaces`,children:(0,$.jsx)(Rn,{setViewState:a,error:f,setError:p,setResult:h,exitState:x,onManageComplete:ee,targetMarketplace:i.type===`manage-marketplaces`?i.targetMarketplace:void 0,action:i.type===`manage-marketplaces`?i.action:void 0})}),(0,$.jsx)(Ve,{id:`errors`,title:b,children:(0,$.jsx)(hr,{setViewState:a,setActiveTab:s,markPluginsChanged:ee})})]})})}var Q,$,yr,br=e((()=>{i(),V(),Q=t(V(),1),P(),We(),Ht(),h(),be(),Ye(),Oe(),F(),w(),vt(),at(),sn(),Mn(),Ln(),Vn(),er(),Wn(),nr(),or(),$=qe(),yr=new Set([`git-auth-failed`,`git-timeout`,`network-error`])}));async function xr(e,t,n){return(0,Sr.jsx)(vr,{onComplete:e,args:n})}var Sr;e((()=>{V(),br(),Sr=qe()}))();export{xr as call};
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Co as t,Ho as n,Kw as r,Oo as i,Po as a,Ro as o,To as s,Ww as c,zo as l}from"./loadAgentsDir-mcRW90aq.js";import{P as u,R as d,c as f,i as p}from"./debug-Dr1SjdXn.js";import{vt as m,xt as h}from"./settings-DiBMs2gM.js";import{b as g,h as _}from"./config-9rLTDOYW.js";import{o as v,s as y}from"./log-27kCA_9u.js";import{f as b,s as x}from"./pluginOperations-CKNyYjS-.js";function S(e){return O=e,k!==null&&k.length>0&&(e(k),k=null),()=>{O=null}}async function C(){let e=await l(),t=a(),n=new Set;for(let[r,i]of Object.entries(e)){let e=t[r]?.autoUpdate;(e===void 0?h(r,i):e)&&n.add(r.toLowerCase())}return n}async function w(e,t){let n=!1;for(let{scope:r}of t)try{let t=await b(e,r);t.success&&!t.alreadyUpToDate?(n=!0,f(`Plugin autoupdate: updated ${e} from ${t.oldVersion} to ${t.newVersion}`)):t.alreadyUpToDate||f(`Plugin autoupdate: failed to update ${e}: ${t.message}`,{level:`warn`})}catch(t){f(`Plugin autoupdate: error updating ${e}: ${u(t)}`,{level:`warn`})}return n?e:null}async function T(e){let t=i(),n=Object.keys(t.plugins);return n.length===0?[]:(await Promise.allSettled(n.map(async n=>{let{marketplace:i}=r(n);if(!i||!e.has(i.toLowerCase()))return null;let a=t.plugins[n];if(!a||a.length===0)return null;let o=a.filter(s);return o.length===0?null:w(n,o)}))).filter(e=>e.status===`fulfilled`&&e.value!==null).map(e=>e.value)}async function E(e){return T(e)}function D(){(async()=>{if(g()){f(`Plugin autoupdate: skipped (auto-updater disabled)`);return}try{let e=await C();if(e.size===0)return;let t=(await Promise.allSettled(Array.from(e).map(async e=>{try{await n(e,void 0,{disableCredentialHelper:!0})}catch(t){f(`Plugin autoupdate: failed to refresh marketplace ${e}: ${u(t)}`,{level:`warn`})}}))).filter(e=>e.status===`rejected`);t.length>0&&f(`Plugin autoupdate: ${t.length} marketplace refresh(es) failed`,{level:`warn`}),f(`Plugin autoupdate: checking installed plugins`);let r=await E(e);r.length>0&&(O?O(r):k=r)}catch(e){y(e)}})()}var O,k,A=e((()=>{x(),_(),p(),d(),v(),t(),o(),c(),m(),O=null,k=null}));export{T as i,A as n,S as r,D as t};
@@ -0,0 +1 @@
1
+ import{Bo as e,Co as t,Fo as n,Ro as r,ko as i}from"./loadAgentsDir-mcRW90aq.js";import{P as a,R as o,c as s,i as c}from"./debug-Dr1SjdXn.js";import{d as l,s as u}from"./pluginOperations-CKNyYjS-.js";import{i as d,n as f,r as p,t as m}from"./pluginFlagging-Cr0d0hBA.js";u(),c(),o(),t(),r(),p();function h(e,t,n){let r=new Set(t.plugins.map(e=>e.name)),i=`@${n}`,a=[];for(let t of Object.keys(e.plugins)){if(!t.endsWith(i))continue;let e=t.slice(0,-i.length);r.has(e)||a.push(t)}return a}async function g(){await d();let t=i(),r=f(),o=await e(),c=[];for(let e of Object.keys(o))try{let i=await n(e);if(!i.forceRemoveDeletedPlugins)continue;let o=h(t,i,e);for(let e of o){if(e in r)continue;let n=t.plugins[e]??[];if(n.some(e=>e.scope===`user`||e.scope===`project`||e.scope===`local`)){for(let t of n){let{scope:n}=t;if(!(n!==`user`&&n!==`project`&&n!==`local`))try{await l(e,n)}catch(t){s(`Failed to auto-uninstall delisted plugin ${e} from ${n}: ${a(t)}`,{level:`error`})}}await m(e),c.push(e)}}}catch(t){s(`Failed to check for delisted plugins in "${e}": ${a(t)}`,{level:`warn`})}return c}export{g as t};
@@ -0,0 +1 @@
1
+ import{n as e,t}from"./figures-5ThXQEtq.js";import{Df as n,Ef as r,Kw as i,Of as a,So as o,Ww as s,Yd as c,Zd as l,xo as u}from"./loadAgentsDir-mcRW90aq.js";import{P as d,R as f}from"./debug-Dr1SjdXn.js";import{n as p,o as m}from"./process-gEbdy6uY.js";import{o as h,s as g}from"./log-27kCA_9u.js";import{n as _,r as v}from"./analytics-DJobLaWP.js";import{a as y,c as b,d as x,f as S,i as C,r as w,s as T}from"./pluginOperations-CKNyYjS-.js";e(),f(),l(),h(),o(),s(),p(),a(),_(),T();function E(e,a,o){g(e);let s=o?`${a} plugin "${o}"`:a===`disable-all`?`disable all plugins`:`${a} plugins`;console.error(`${t.cross} Failed to ${s}: ${d(e)}`);let c=o?(()=>{let{name:e,marketplace:t}=i(o);return{_PROTO_plugin_name:e,...t&&{_PROTO_marketplace_name:t},...r(e,t,u())}})():{};v(`tengu_plugin_command_failed`,{command:a,error_category:n(e),...c}),process.exit(1)}async function D(e,n=`user`){try{console.log(`Installing plugin "${e}"...`);let a=await b(e,n);if(!a.success)throw Error(a.message);console.log(`${t.tick} ${a.message}`);let{name:o,marketplace:s}=i(a.pluginId||e);v(`tengu_plugin_installed_cli`,{_PROTO_plugin_name:o,...s&&{_PROTO_marketplace_name:s},scope:a.scope||n,install_source:`cli-explicit`,...r(o,s,u())}),process.exit(0)}catch(t){E(t,`install`,e)}}async function O(e,n=`user`,a=!1){try{let o=await x(e,n,!a);if(!o.success)throw Error(o.message);console.log(`${t.tick} ${o.message}`);let{name:s,marketplace:c}=i(o.pluginId||e);v(`tengu_plugin_uninstalled_cli`,{_PROTO_plugin_name:s,...c&&{_PROTO_marketplace_name:c},scope:o.scope||n,...r(s,c,u())}),process.exit(0)}catch(t){E(t,`uninstall`,e)}}async function k(e,n){try{let a=await y(e,n);if(!a.success)throw Error(a.message);console.log(`${t.tick} ${a.message}`);let{name:o,marketplace:s}=i(a.pluginId||e);v(`tengu_plugin_enabled_cli`,{_PROTO_plugin_name:o,...s&&{_PROTO_marketplace_name:s},scope:a.scope,...r(o,s,u())}),process.exit(0)}catch(t){E(t,`enable`,e)}}async function A(e,n){try{let a=await C(e,n);if(!a.success)throw Error(a.message);console.log(`${t.tick} ${a.message}`);let{name:o,marketplace:s}=i(a.pluginId||e);v(`tengu_plugin_disabled_cli`,{_PROTO_plugin_name:o,...s&&{_PROTO_marketplace_name:s},scope:a.scope,...r(o,s,u())}),process.exit(0)}catch(t){E(t,`disable`,e)}}async function j(){try{let e=await w();if(!e.success)throw Error(e.message);console.log(`${t.tick} ${e.message}`),v(`tengu_plugin_disabled_all_cli`,{}),process.exit(0)}catch(e){E(e,`disable-all`)}}async function M(e,n){try{m(`Checking for updates for plugin "${e}" at ${n} scope…\n`);let a=await S(e,n);if(!a.success)throw Error(a.message);if(m(`${t.tick} ${a.message}\n`),!a.alreadyUpToDate){let{name:t,marketplace:n}=i(a.pluginId||e);v(`tengu_plugin_updated_cli`,{_PROTO_plugin_name:t,...n&&{_PROTO_marketplace_name:n},old_version:a.oldVersion||`unknown`,new_version:a.newVersion||`unknown`,...r(t,n,u())})}await c(0)}catch(t){E(t,`update`,e)}}export{O as a,D as i,A as n,M as o,k as r,j as t};
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Jw as t,Yw as n}from"./loadAgentsDir-BL93ulMm.js";import{C as r,S as i,c as a,f as o,i as s,u as c,x as l}from"./debug-BecbSVoN.js";import{o as u,s as d}from"./log-Dauqle-Z.js";import{join as f}from"path";import{randomBytes as p}from"crypto";import{readFile as m,rename as h,unlink as g,writeFile as _}from"fs/promises";function v(){return f(t(),D)}function y(e){let t=i(e);if(typeof t!=`object`||!t||!(`plugins`in t)||typeof t.plugins!=`object`||t.plugins===null)return{};let n=t.plugins,r={};for(let[e,t]of Object.entries(n))if(t&&typeof t==`object`&&`flaggedAt`in t&&typeof t.flaggedAt==`string`){let n={flaggedAt:t.flaggedAt};`seenAt`in t&&typeof t.seenAt==`string`&&(n.seenAt=t.seenAt),r[e]=n}return r}async function b(){try{return y(await m(v(),{encoding:`utf-8`}))}catch{return{}}}async function x(e){let n=v(),i=`${n}.${p(8).toString(`hex`)}.tmp`;try{await c().mkdir(t()),await _(i,r({plugins:e},null,2),{encoding:`utf-8`,mode:384}),await h(i,n),k=e}catch(e){d(e);try{await g(i)}catch{}}}async function S(){let e=await b(),t=Date.now(),n=!1;for(let[r,i]of Object.entries(e))i.seenAt&&t-new Date(i.seenAt).getTime()>=O&&(delete e[r],n=!0);k=e,n&&await x(e)}function C(){return k??{}}async function w(e){k===null&&(k=await b()),await x({...k,[e]:{flaggedAt:new Date().toISOString()}}),a(`Flagged plugin: ${e}`)}async function T(e){k===null&&(k=await b());let t=new Date().toISOString(),n=!1,r={...k};for(let i of e){let e=r[i];e&&!e.seenAt&&(r[i]={...e,seenAt:t},n=!0)}n&&await x(r)}async function E(e){if(k===null&&(k=await b()),!(e in k))return;let{[e]:t,...n}=k;k=n,await x(n)}var D,O,k,A=e((()=>{s(),o(),u(),l(),n(),D=`flagged-plugins.json`,O=2880*60*1e3,k=null}));export{T as a,S as i,C as n,E as o,A as r,w as t};
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Aw as t,kw as n}from"./loadAgentsDir-mcRW90aq.js";import{C as r,S as i,c as a,f as o,i as s,u as c,x as l}from"./debug-Dr1SjdXn.js";import{o as u,s as d}from"./log-27kCA_9u.js";import{join as f}from"path";import{randomBytes as p}from"crypto";import{readFile as m,rename as h,unlink as g,writeFile as _}from"fs/promises";function v(){return f(n(),D)}function y(e){let t=i(e);if(typeof t!=`object`||!t||!(`plugins`in t)||typeof t.plugins!=`object`||t.plugins===null)return{};let n=t.plugins,r={};for(let[e,t]of Object.entries(n))if(t&&typeof t==`object`&&`flaggedAt`in t&&typeof t.flaggedAt==`string`){let n={flaggedAt:t.flaggedAt};`seenAt`in t&&typeof t.seenAt==`string`&&(n.seenAt=t.seenAt),r[e]=n}return r}async function b(){try{return y(await m(v(),{encoding:`utf-8`}))}catch{return{}}}async function x(e){let t=v(),i=`${t}.${p(8).toString(`hex`)}.tmp`;try{await c().mkdir(n()),await _(i,r({plugins:e},null,2),{encoding:`utf-8`,mode:384}),await h(i,t),k=e}catch(e){d(e);try{await g(i)}catch{}}}async function S(){let e=await b(),t=Date.now(),n=!1;for(let[r,i]of Object.entries(e))i.seenAt&&t-new Date(i.seenAt).getTime()>=O&&(delete e[r],n=!0);k=e,n&&await x(e)}function C(){return k??{}}async function w(e){k===null&&(k=await b()),await x({...k,[e]:{flaggedAt:new Date().toISOString()}}),a(`Flagged plugin: ${e}`)}async function T(e){k===null&&(k=await b());let t=new Date().toISOString(),n=!1,r={...k};for(let i of e){let e=r[i];e&&!e.seenAt&&(r[i]={...e,seenAt:t},n=!0)}n&&await x(r)}async function E(e){if(k===null&&(k=await b()),!(e in k))return;let{[e]:t,...n}=k;k=n,await x(n)}var D,O,k,A=e((()=>{s(),o(),u(),l(),t(),D=`flagged-plugins.json`,O=2880*60*1e3,k=null}));export{T as a,S as i,C as n,E as o,A as r,w as t};
@@ -0,0 +1,2 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Ao as t,Aw as n,Co as r,Ew as i,Fo as a,Hw as o,Kw as s,Lo as c,Oo as l,Qw as u,Ro as d,Uw as f,Vw as p,Ww as m,Zw as h,_g as g,ao as _,bo as v,cS as y,co as b,cs as x,do as S,gg as C,go as w,ho as T,jo as ee,ko as E,lo as D,oS as te,os as O,po as ne,qw as k,so as A,ss as j,uo as re,vo as ie,yo as M,zo as ae}from"./loadAgentsDir-mcRW90aq.js";import{Wt as oe,et as N}from"./state-BPFYBqm1.js";import{B as P,R as se,U as ce,f as F,u as I}from"./debug-Dr1SjdXn.js";import{c as L,g as R,x as z}from"./settings-DiBMs2gM.js";import{o as B,s as V}from"./log-27kCA_9u.js";import{l as H,o as U}from"./stringUtils-Df-Lnjxd.js";import{n as W,t as G}from"./pluginStartupCheck-DiCDQQlr.js";import{dirname as le,join as K}from"path";function q(e){if(!Q.includes(e))throw Error(`Invalid scope "${e}". Must be one of: ${Q.join(`, `)}`)}function ue(e){return Q.includes(e)}function J(e){return e===`project`||e===`local`?N():void 0}function de(e){return L(`projectSettings`)?.enabledPlugins?.[e]===!0}function fe(e){let t=e.includes(`@`);for(let n of[`local`,`project`,`user`]){let r=L(k(n))?.enabledPlugins;if(r){for(let i of Object.keys(r))if(t?i===e:i.startsWith(`${e}@`))return{pluginId:i,scope:n}}}return null}function pe(e,t){let{name:n,marketplace:r}=s(e);return t.find(t=>t.name===e||t.name===n?!0:r&&t.source?t.name===n&&t.source.includes(`@${r}`):!1)}function me(e){let{name:t}=s(e),n=E();if(n.plugins[e]?.length)return{pluginId:e,pluginName:t};let r=Object.keys(n.plugins).find(e=>{let{name:r}=s(e);return r===t&&(n.plugins[e]?.length??0)>0});return r?{pluginId:r,pluginName:t}:null}function Y(e){let t=E().plugins[e];if(!t||t.length===0)return{scope:`user`};let n=N(),r=t.find(e=>e.scope===`local`&&e.projectPath===n);if(r)return{scope:r.scope,projectPath:r.projectPath};let i=t.find(e=>e.scope===`project`&&e.projectPath===n);if(i)return{scope:i.scope,projectPath:i.projectPath};let a=t.find(e=>e.scope===`user`);return a?{scope:a.scope}:{scope:t[0].scope,projectPath:t[0].projectPath}}async function he(e,t=`user`){q(t);let{name:n,marketplace:r}=s(e),i,o,l;if(r){let t=await c(e);t&&(i=t.entry,o=r,l=t.marketplaceInstallLocation)}else{let e=await ae();for(let[t,r]of Object.entries(e))try{let e=(await a(t)).plugins.find(e=>e.name===n);if(e){i=e,o=t,l=r.installLocation;break}}catch(e){V(ce(e))}}if(!i||!o)return{success:!1,message:`Plugin "${n}" not found in ${r?`marketplace "${r}"`:`any configured marketplace`}`};let u=i,d=`${u.name}@${o}`,f=await ie({pluginId:d,entry:u,scope:t,marketplaceInstallLocation:l});if(!f.ok){let e=f;switch(e.reason){case`local-source-no-location`:return{success:!1,message:`Cannot install local plugin "${e.pluginName}" without marketplace install location`};case`settings-write-failed`:return{success:!1,message:`Failed to update settings: ${e.message}`};case`resolution-failed`:return{success:!1,message:T(e.resolution)};case`blocked-by-policy`:return{success:!1,message:`Plugin "${e.pluginName}" is blocked by your organization's policy and cannot be installed`};case`dependency-blocked-by-policy`:return{success:!1,message:`Plugin "${e.pluginName}" depends on "${e.blockedDependency}", which is blocked by your organization's policy`}}}return{success:!0,message:`Successfully installed plugin: ${d} (scope: ${t})${f.depNote}`,pluginId:d,pluginName:u.name,scope:t}}async function ge(e,n=`user`,r=!0){q(n);let{enabled:a,disabled:s}=await S(),c=[...a,...s],l=pe(e,c),u=k(n),d=L(u),f,m;if(l)f=Object.keys(d?.enabledPlugins??{}).find(t=>t===e||t===l.name||t.startsWith(`${l.name}@`))??(e.includes(`@`)?e:l.name),m=l.name;else{let t=me(e);if(!t)return{success:!1,message:`Plugin "${e}" not found in installed plugins`};f=t.pluginId,m=t.pluginName}let h=J(n),g=E().plugins[f],_=g?.find(e=>e.scope===n&&e.projectPath===h);if(!_){let{scope:t}=Y(f);return t!==n&&g&&g.length>0?t===`project`?{success:!1,message:`Plugin "${e}" is enabled at project scope (.workmate/settings.json, shared with your team). To disable just for you: claude plugin disable ${e} --scope local`}:{success:!1,message:`Plugin "${e}" is installed in ${t} scope, not ${n}. Use --scope ${t} to uninstall.`}:{success:!1,message:`Plugin "${e}" is not installed in ${n} scope. Use --scope to specify the correct scope.`}}let v=_.installPath,y={...d?.enabledPlugins};y[f]=void 0,z(u,{enabledPlugins:y}),O(),t(f,n,h);let b=E().plugins[f],C=!b||b.length===0;C&&v&&await x(v),C&&(te(f),r&&await i(f));let w=p(f,c),T=o(w);return{success:!0,message:`Successfully uninstalled plugin: ${m} (scope: ${n})${T}`,pluginId:f,pluginName:m,scope:n,reverseDependents:w.length>0?w:void 0}}async function X(e,t,n){let r=t?`enable`:`disable`;if(u(e)){let{error:n}=z(`userSettings`,{enabledPlugins:{...L(`userSettings`)?.enabledPlugins,[e]:t}});if(n)return{success:!1,message:`Failed to ${r} built-in plugin: ${n.message}`};O();let{name:i}=s(e);return{success:!0,message:`Successfully ${r}d built-in plugin: ${i}`,pluginId:e,pluginName:i,scope:`user`}}n&&q(n);let i,a,c=fe(e);if(n)if(a=n,c)i=c.pluginId;else if(e.includes(`@`))i=e;else return{success:!1,message:`Plugin "${e}" not found in settings. Use plugin@marketplace format.`};else if(c)i=c.pluginId,a=c.scope;else if(e.includes(`@`))i=e,a=`user`;else return{success:!1,message:`Plugin "${e}" not found in any editable settings scope. Use plugin@marketplace format.`};if(t&&g(i))return{success:!1,message:`Plugin "${i}" is blocked by your organization's policy and cannot be enabled`};let l=k(a),d=L(l)?.enabledPlugins?.[i],f={user:0,project:1,local:2},m=n&&c&&f[n]>f[c.scope];if(n&&d===void 0&&c&&c.scope!==n&&!m)return{success:!1,message:`Plugin "${e}" is installed at ${c.scope} scope, not ${n}. Use --scope ${c.scope} or omit --scope to auto-detect.`};if(t===(n&&!m?d===!0:G().has(i)))return{success:!1,message:`Plugin "${e}" is already ${t?`enabled`:`disabled`}${n?` at ${n} scope`:``}`};let h;if(!t){let{enabled:e,disabled:t}=await S(),n=p(i,[...e,...t]);n.length>0&&(h=n)}let{error:_}=z(l,{enabledPlugins:{...L(l)?.enabledPlugins,[i]:t}});if(_)return{success:!1,message:`Failed to ${r} plugin: ${_.message}`};O();let{name:v}=s(i),y=o(h);return{success:!0,message:`Successfully ${r}d plugin: ${v} (scope: ${a})${y}`,pluginId:i,pluginName:v,scope:a,reverseDependents:h}}async function _e(e,t){return X(e,!0,t)}async function ve(e,t){return X(e,!1,t)}async function Z(){let e=G();if(e.size===0)return{success:!0,message:`No enabled plugins to disable`};let t=[],n=[];for(let[r]of e){let e=await X(r,!1);e.success?t.push(r):n.push(`${r}: ${e.message}`)}return n.length>0?{success:!1,message:`Disabled ${t.length} ${H(t.length,`plugin`)}, ${n.length} failed:\n${n.join(`
2
+ `)}`}:{success:!0,message:`Disabled ${t.length} ${H(t.length,`plugin`)}`}}async function ye(e,t){let{name:n,marketplace:r}=s(e),i=r?`${n}@${r}`:e,a=await c(e);if(!a)return{success:!1,message:`Plugin "${n}" not found`,pluginId:i,scope:t};let{entry:o,marketplaceInstallLocation:u}=a,d=l().plugins[i];if(!d||d.length===0)return{success:!1,message:`Plugin "${n}" is not installed`,pluginId:i,scope:t};let f=J(t),p=d.find(e=>e.scope===t&&e.projectPath===f);return p?be({pluginId:i,pluginName:n,entry:o,marketplaceInstallLocation:u,installation:p,scope:t,projectPath:f}):{success:!1,message:`Plugin "${n}" is not installed at scope ${f?`${t} (${f})`:t}`,pluginId:i,scope:t}}async function be({pluginId:e,pluginName:t,entry:n,marketplaceInstallLocation:r,installation:i,scope:a,projectPath:o}){let s=I(),c=i.version,u,d,f=!1,p;if(typeof n.source!=`string`){let t=await _(n.source,{manifest:{name:n.name}});u=t.path,f=!0,p=t.gitCommitSha,d=await M(e,n.source,t.manifest,t.path,n.version,t.gitCommitSha)}else{let t;try{t=await s.stat(r)}catch(t){if(P(t))return{success:!1,message:`Marketplace directory not found at ${r}`,pluginId:e,scope:a};throw t}u=K(t.isDirectory()?r:le(r),n.source);try{await s.stat(u)}catch(t){if(P(t))return{success:!1,message:`Plugin source not found at ${u}`,pluginId:e,scope:a};throw t}let i,o=K(u,`.claude-plugin`,`plugin.json`);try{i=await ne(o,n.name,n.source)}catch{}d=await M(e,n.source,i,u,n.version)}try{let r=b(e,d),s=D(e,d);if(i.version===d||i.installPath===r||i.installPath===s)return{success:!0,message:`${t} is already at the latest version (${d}).`,pluginId:e,newVersion:d,oldVersion:c,alreadyUpToDate:!0,scope:a};r=await A(u,e,d,n);let f=i.installPath;if(ee(e,a,o,r,d,p),f&&f!==r){let e=l();Object.values(e.plugins).some(e=>e.some(e=>e.installPath===f))||await x(f)}let m=o?`${a} (${o})`:a;return{success:!0,message:`Plugin "${t}" updated from ${c||`unknown`} to ${d} for scope ${m}. Restart to apply changes.`,pluginId:e,newVersion:d,oldVersion:c,scope:a}}finally{f&&u!==b(e,d)&&await s.rm(u,{recursive:!0,force:!0})}}var Q,$,xe=e((()=>{oe(),h(),se(),F(),B(),j(),f(),r(),d(),n(),m(),w(),re(),y(),C(),W(),v(),R(),U(),Q=[`user`,`project`,`local`],$=[`user`,`project`,`local`,`managed`]}));export{_e as a,he as c,ge as d,ye as f,ve as i,ue as l,$ as n,Y as o,Z as r,xe as s,Q as t,de as u};
@@ -0,0 +1 @@
1
+ import{n as e,t}from"./pluginStartupCheck-DiCDQQlr.js";e();export{t as getPluginEditableScopes};
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{_o as t,lT as n,mT as r,pT as i,wo as a,zo as o}from"./loadAgentsDir-BL93ulMm.js";import{n as s}from"./cwd-Cfdf7z7s.js";import{c,i as l}from"./debug-BecbSVoN.js";import{c as u,g as d,vt as f}from"./settings-D4CpDv2y.js";import{o as p}from"./log-Dauqle-Z.js";import"path";function m(){let e=new Map,t=i();for(let[n,r]of Object.entries(t))n.includes(`@`)&&(r===!0?e.set(n,`flag`):r===!1&&e.delete(n));for(let{scope:n,source:r}of[{scope:`managed`,source:`policySettings`},{scope:`user`,source:`userSettings`},{scope:`project`,source:`projectSettings`},{scope:`local`,source:`localSettings`},{scope:`flag`,source:`flagSettings`}]){let i=u(r);if(i?.enabledPlugins)for(let[a,o]of Object.entries(i.enabledPlugins))a.includes(`@`)&&(a in t&&t[a]!==o&&c(`Plugin ${a} from --add-dir (${t[a]}) overridden by ${r} (${o})`),o===!0?e.set(a,n):o===!1&&e.delete(a))}return c(`Found ${e.size} enabled plugins with scopes: ${Array.from(e.entries()).map(([e,t])=>`${e}(${t})`).join(`, `)}`),e}var h=e((()=>{s(),l(),p(),d(),r(),a(),o(),n(),t(),f()}));export{h as n,m as t};
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Co as t,Jw as n,Ro as r,Ww as i,Yw as a,go as o}from"./loadAgentsDir-mcRW90aq.js";import{n as s}from"./cwd-Besi3Os3.js";import{c,i as l}from"./debug-Dr1SjdXn.js";import{c as u,g as d,vt as f}from"./settings-DiBMs2gM.js";import{o as p}from"./log-27kCA_9u.js";import"path";function m(){let e=new Map,t=n();for(let[n,r]of Object.entries(t))n.includes(`@`)&&(r===!0?e.set(n,`flag`):r===!1&&e.delete(n));for(let{scope:n,source:r}of[{scope:`managed`,source:`policySettings`},{scope:`user`,source:`userSettings`},{scope:`project`,source:`projectSettings`},{scope:`local`,source:`localSettings`},{scope:`flag`,source:`flagSettings`}]){let i=u(r);if(i?.enabledPlugins)for(let[a,o]of Object.entries(i.enabledPlugins))a.includes(`@`)&&(a in t&&t[a]!==o&&c(`Plugin ${a} from --add-dir (${t[a]}) overridden by ${r} (${o})`),o===!0?e.set(a,n):o===!1&&e.delete(a))}return c(`Found ${e.size} enabled plugins with scopes: ${Array.from(e.entries()).map(([e,t])=>`${e}(${t})`).join(`, `)}`),e}var h=e((()=>{s(),l(),p(),d(),a(),t(),r(),i(),o(),f()}));export{h as n,m as t};
@@ -0,0 +1,4 @@
1
+ import{n as e,t}from"./figures-5ThXQEtq.js";import{$w as n,Co as r,Do as i,Ho as a,Ko as o,Kw as s,Mo as c,Ro as l,Vo as u,Wo as d,Ww as f,Xo as p,aS as m,do as h,eT as g,iS as _,is as v,ko as y,ns as b,os as x,qw as S,ss as C,uo as ee,zo as w}from"./loadAgentsDir-mcRW90aq.js";import{Wt as T,ir as E}from"./state-BPFYBqm1.js";import{C as D,P as O,R as k,x as te}from"./debug-Dr1SjdXn.js";import{o as ne,s as A}from"./log-27kCA_9u.js";import{n as j,r as M}from"./analytics-DJobLaWP.js";import{l as N,o as P}from"./stringUtils-Df-Lnjxd.js";import{n as F,t as I}from"./exit-BOhGfSlm.js";import{n as L,s as R,t as z}from"./pluginOperations-CKNyYjS-.js";import{a as B,i as V,n as H,o as U,r as W,t as re}from"./pluginCliCommands-Bc2Iybhz.js";import{a as G,c as K,i as q,n as J,r as Y,s as X,t as ie}from"./validatePlugin-VukX52bx.js";import{basename as ae,dirname as Z}from"path";e(),T(),j(),R(),g(),k(),ne(),C(),K(),r(),b(),l(),_(),q(),f(),ee(),ie(),te(),P();function Q(e,n){A(e),I(`${t.cross} Failed to ${n}: ${O(e)}`)}function $(e){e.errors.length>0&&(console.log(`${t.cross} Found ${e.errors.length} ${N(e.errors.length,`error`)}:\n`),e.errors.forEach(e=>{console.log(` ${t.pointer} ${e.path}: ${e.message}`)}),console.log(``)),e.warnings.length>0&&(console.log(`${t.warning} Found ${e.warnings.length} ${N(e.warnings.length,`warning`)}:\n`),e.warnings.forEach(e=>{console.log(` ${t.pointer} ${e.path}: ${e.message}`)}),console.log(``))}async function oe(e,n){n.cowork&&E(!0);try{let n=await J(e);console.log(`Validating ${n.fileType} manifest: ${n.filePath}\n`),$(n);let r=[];if(n.fileType===`plugin`){let e=Z(n.filePath);if(ae(e)===`.claude-plugin`){r=await Y(Z(e));for(let e of r)console.log(`Validating ${e.fileType}: ${e.filePath}\n`),$(e)}}let i=n.success&&r.every(e=>e.success),a=n.warnings.length>0||r.some(e=>e.warnings.length>0);i?F(a?`${t.tick} Validation passed with warnings`:`${t.tick} Validation passed`):(console.log(`${t.cross} Validation failed`),process.exit(1))}catch(e){A(e),console.error(`${t.cross} Unexpected error during validation: ${O(e)}`),process.exit(2)}}async function se(e){e.cowork&&E(!0),M(`tengu_plugin_list_command`,{});let r=y(),{getPluginEditableScopes:a}=await import(`./pluginStartupCheck-B48_cGgo.js`),o=a(),c=Object.keys(r.plugins),{enabled:l,disabled:u,errors:d}=await h(),f=[...l,...u],g=f.filter(e=>e.source.endsWith(`@inline`)),_=d.filter(e=>e.source.endsWith(`@inline`)||e.source.startsWith(`inline[`));if(e.json){let t=new Map(f.map(e=>[e.source,e])),a=[];for(let e of c.sort()){let i=r.plugins[e];if(!i||i.length===0)continue;let c=s(e).name,l=d.filter(t=>t.source===e||`plugin`in t&&t.plugin===c).map(n);for(let n of i){let r=t.get(e),i;if(r){let e=r.mcpServers||await m(r);e&&Object.keys(e).length>0&&(i=e)}a.push({id:e,version:n.version||`unknown`,scope:n.scope,enabled:o.has(e),installPath:n.installPath,installedAt:n.installedAt,lastUpdated:n.lastUpdated,projectPath:n.projectPath,mcpServers:i,errors:l.length>0?l:void 0})}}for(let e of g){let t=e.mcpServers||await m(e),r=_.filter(t=>t.source===e.source||`plugin`in t&&t.plugin===e.name).map(n);a.push({id:e.source,version:e.manifest.version??`unknown`,scope:`session`,enabled:e.enabled!==!1,installPath:e.path,mcpServers:t&&Object.keys(t).length>0?t:void 0,errors:r.length>0?r:void 0})}for(let e of _.filter(e=>e.source.startsWith(`inline[`)))a.push({id:e.source,version:`unknown`,scope:`session`,enabled:!1,installPath:`path`in e?e.path:``,errors:[n(e)]});if(e.available){let e=[];try{let[t,n]=await Promise.all([w(),X()]),{marketplaces:r}=await v(t);for(let{name:t,data:a}of r)if(a)for(let r of a.plugins){let a=p(r.name,t);i(a)||e.push({pluginId:a,name:r.name,description:r.description,marketplaceName:t,version:r.version,source:r.source,installCount:n?.get(a)})}}catch{}F(D({installed:a,available:e},null,2))}else F(D(a,null,2))}c.length===0&&g.length===0&&_.length===0&&F("No plugins installed. Use `claude plugin install` to install a plugin."),c.length>0&&console.log(`Installed plugins:
2
+ `);for(let e of c.sort()){let i=r.plugins[e];if(!i||i.length===0)continue;let a=s(e).name,c=d.filter(t=>t.source===e||`plugin`in t&&t.plugin===a);for(let r of i){let i=o.has(e),a=c.length>0?`${t.cross} failed to load`:i?`${t.tick} enabled`:`${t.cross} disabled`,s=r.version||`unknown`,l=r.scope;console.log(` ${t.pointer} ${e}`),console.log(` Version: ${s}`),console.log(` Scope: ${l}`),console.log(` Status: ${a}`);for(let e of c)console.log(` Error: ${n(e)}`);console.log(``)}}if(g.length>0||_.length>0){console.log(`Session-only plugins (--plugin-dir):
3
+ `);for(let e of g){let r=_.filter(t=>t.source===e.source||`plugin`in t&&t.plugin===e.name),i=r.length>0?`${t.cross} loaded with errors`:`${t.tick} loaded`;console.log(` ${t.pointer} ${e.source}`),console.log(` Version: ${e.manifest.version??`unknown`}`),console.log(` Path: ${e.path}`),console.log(` Status: ${i}`);for(let e of r)console.log(` Error: ${n(e)}`);console.log(``)}for(let e of _.filter(e=>e.source.startsWith(`inline[`)))console.log(` ${t.pointer} ${e.source}: ${t.cross} ${n(e)}\n`)}F()}async function ce(e,n){n.cowork&&E(!0);try{let r=await G(e);r||I(`${t.cross} Invalid marketplace source format. Try: owner/repo, https://..., or ./path`),`error`in r&&I(`${t.cross} ${r.error}`);let i=n.scope??`user`;i!==`user`&&i!==`project`&&i!==`local`&&I(`${t.cross} Invalid scope '${i}'. Use: user, project, or local`);let a=S(i),s=r;n.sparse&&n.sparse.length>0&&(s.source===`github`||s.source===`git`?s={...s,sparsePaths:n.sparse}:I(`${t.cross} --sparse is only supported for github and git marketplace sources (got: ${s.source})`)),console.log(`Adding marketplace...`);let{name:l,alreadyMaterialized:u,resolvedSource:d}=await c(s,e=>{console.log(e)});o(l,{source:d},a),x();let f=s.source;s.source===`github`&&(f=s.repo),M(`tengu_marketplace_added`,{source_type:f}),F(u?`${t.tick} Marketplace '${l}' already on disk — declared in ${i} settings`:`${t.tick} Successfully added marketplace: ${l} (declared in ${i} settings)`)}catch(e){Q(e,`add marketplace`)}}async function le(e){e.cowork&&E(!0);try{let n=await w(),r=Object.keys(n);e.json&&F(D(r.sort().map(e=>{let t=n[e],r=t?.source;return{name:e,source:r?.source,...r?.source===`github`&&{repo:r.repo},...r?.source===`git`&&{url:r.url},...r?.source===`url`&&{url:r.url},...r?.source===`directory`&&{path:r.path},...r?.source===`file`&&{path:r.path},installLocation:t?.installLocation}}),null,2)),r.length===0&&F(`No marketplaces configured`),console.log(`Configured marketplaces:
4
+ `),r.forEach(e=>{let r=n[e];if(console.log(` ${t.pointer} ${e}`),r?.source){let e=r.source;e.source===`github`?console.log(` Source: GitHub (${e.repo})`):e.source===`git`?console.log(` Source: Git (${e.url})`):e.source===`url`?console.log(` Source: URL (${e.url})`):e.source===`directory`?console.log(` Source: Directory (${e.path})`):e.source===`file`&&console.log(` Source: File (${e.path})`)}console.log(``)}),F()}catch(e){Q(e,`list marketplaces`)}}async function ue(e,n){n.cowork&&E(!0);try{await d(e),x(),M(`tengu_marketplace_removed`,{marketplace_name:e}),F(`${t.tick} Successfully removed marketplace: ${e}`)}catch(e){Q(e,`remove marketplace`)}}async function de(e,n){n.cowork&&E(!0);try{if(e)console.log(`Updating marketplace: ${e}...`),await a(e,e=>{console.log(e)}),x(),M(`tengu_marketplace_updated`,{marketplace_name:e}),F(`${t.tick} Successfully updated marketplace: ${e}`);else{let e=await w(),n=Object.keys(e);n.length===0&&F(`No marketplaces configured`),console.log(`Updating ${n.length} marketplace(s)...`),await u(),x(),M(`tengu_marketplace_updated_all`,{count:n.length}),F(`${t.tick} Successfully updated ${n.length} marketplace(s)`)}}catch(e){Q(e,`update marketplace(s)`)}}async function fe(e,t){t.cowork&&E(!0);let n=t.scope||`user`;t.cowork&&n!==`user`&&I(`--cowork can only be used with user scope`),z.includes(n)||I(`Invalid scope: ${n}. Must be one of: ${z.join(`, `)}.`);let{name:r,marketplace:i}=s(e);M(`tengu_plugin_install_command`,{_PROTO_plugin_name:r,...i&&{_PROTO_marketplace_name:i},scope:n}),await V(e,n)}async function pe(e,t){t.cowork&&E(!0);let n=t.scope||`user`;t.cowork&&n!==`user`&&I(`--cowork can only be used with user scope`),z.includes(n)||I(`Invalid scope: ${n}. Must be one of: ${z.join(`, `)}.`);let{name:r,marketplace:i}=s(e);M(`tengu_plugin_uninstall_command`,{_PROTO_plugin_name:r,...i&&{_PROTO_marketplace_name:i},scope:n}),await B(e,n,t.keepData)}async function me(e,t){t.cowork&&E(!0);let n;t.scope&&(z.includes(t.scope)||I(`Invalid scope "${t.scope}". Valid scopes: ${z.join(`, `)}`),n=t.scope),t.cowork&&n!==void 0&&n!==`user`&&I(`--cowork can only be used with user scope`),t.cowork&&n===void 0&&(n=`user`);let{name:r,marketplace:i}=s(e);M(`tengu_plugin_enable_command`,{_PROTO_plugin_name:r,...i&&{_PROTO_marketplace_name:i},scope:n??`auto`}),await W(e,n)}async function he(e,t){if(t.all&&e&&I(`Cannot use --all with a specific plugin`),!t.all&&!e&&I(`Please specify a plugin name or use --all to disable all plugins`),t.cowork&&E(!0),t.all){t.scope&&I(`Cannot use --scope with --all`),M(`tengu_plugin_disable_command`,{}),await re();return}let n;t.scope&&(z.includes(t.scope)||I(`Invalid scope "${t.scope}". Valid scopes: ${z.join(`, `)}`),n=t.scope),t.cowork&&n!==void 0&&n!==`user`&&I(`--cowork can only be used with user scope`),t.cowork&&n===void 0&&(n=`user`);let{name:r,marketplace:i}=s(e);M(`tengu_plugin_disable_command`,{_PROTO_plugin_name:r,...i&&{_PROTO_marketplace_name:i},scope:n??`auto`}),await H(e,n)}async function ge(e,t){t.cowork&&E(!0);let{name:n,marketplace:r}=s(e);M(`tengu_plugin_update_command`,{_PROTO_plugin_name:n,...r&&{_PROTO_marketplace_name:r}});let i=`user`;t.scope&&(L.includes(t.scope)||I(`Invalid scope "${t.scope}". Valid scopes: ${L.join(`, `)}`),i=t.scope),t.cowork&&i!==`user`&&I(`--cowork can only be used with user scope`),await U(e,i)}export{ce as marketplaceAddHandler,le as marketplaceListHandler,ue as marketplaceRemoveHandler,de as marketplaceUpdateHandler,he as pluginDisableHandler,me as pluginEnableHandler,fe as pluginInstallHandler,se as pluginListHandler,pe as pluginUninstallHandler,ge as pluginUpdateHandler,oe as pluginValidateHandler};
@@ -0,0 +1 @@
1
+ import{n as e,t}from"./poorMode-DxgO_bUb.js";t();export{e as isPoorModeActive};
@@ -1 +1 @@
1
- import{n as e,r as t}from"./rolldown-runtime-DaDcL9Zw.js";import{g as n,n as r,x as i}from"./settings-D4CpDv2y.js";var a=t({isPoorModeActive:()=>o,setPoorMode:()=>s});function o(){return c===null&&(c=r().poorMode===!0),c}function s(e){c=e,i(`userSettings`,{poorMode:e||void 0})}var c,l=e((()=>{n(),c=null}));export{s as i,o as n,a as r,l as t};
1
+ import{n as e,r as t}from"./rolldown-runtime-DaDcL9Zw.js";import{g as n,n as r,x as i}from"./settings-DiBMs2gM.js";var a=t({isPoorModeActive:()=>o,setPoorMode:()=>s});function o(){return c===null&&(c=r().poorMode===!0),c}function s(e){c=e,i(`userSettings`,{poorMode:e||void 0})}var c,l=e((()=>{n(),c=null}));export{s as i,o as n,a as r,l as t};