@readmagic/workmate 0.0.12 → 0.0.14

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 (439) hide show
  1. package/dist/chunks/AddWorkspaceDirectory-m2d3nOQJ.js +1 -0
  2. package/dist/chunks/AgentsMdExternalIncludesDialog-BRXGkHO4.js +1 -0
  3. package/dist/chunks/{AgentsMdExternalIncludesDialog-_yJJ0wqu.js → AgentsMdExternalIncludesDialog-D58Vn3SK.js} +1 -1
  4. package/dist/chunks/App-CeC-2dzL.js +1 -0
  5. package/dist/chunks/ApproveApiKey-DFpddLyp.js +1 -0
  6. package/dist/chunks/ApproveApiKey-NXTWIAMj.js +1 -0
  7. package/dist/chunks/BackgroundTasksDialog-9ruzl1jm.js +2 -0
  8. package/dist/chunks/{BypassPermissionsModeDialog-COI_V57z.js → BypassPermissionsModeDialog-C4QGpcBT.js} +1 -1
  9. package/dist/chunks/DiffDialog-LTdtTqsC.js +6 -0
  10. package/dist/chunks/Doctor-DmiDH-lg.js +1 -0
  11. package/dist/chunks/Doctor-Yvrzcrvx.js +3 -0
  12. package/dist/chunks/ExitFlow-DH0L3tyY.js +2 -0
  13. package/dist/chunks/{Grove-DRZrhbF0.js → Grove-BhhnrFX9.js} +2 -2
  14. package/dist/chunks/{HybridTransport-BadJQe6u.js → HybridTransport-CEWG9ZRi.js} +2 -4
  15. package/dist/chunks/InvalidConfigDialog-Ue3kJUPJ.js +1 -0
  16. package/dist/chunks/InvalidSettingsDialog-BO2AOTVf.js +1 -0
  17. package/dist/chunks/MCPConnectionManager-Ciy9y9VV.js +1 -0
  18. package/dist/chunks/MCPToolListView-Ddmu2UcL.js +1 -0
  19. package/dist/chunks/{McpParsingWarnings-xv0RZCSL.js → McpParsingWarnings-BsCDFWci.js} +1 -1
  20. package/dist/chunks/MessageSelector-DY5K0NHd.js +3 -0
  21. package/dist/chunks/Messages-LD6ZO301.js +10 -0
  22. package/dist/chunks/Onboarding-w0-VVsDz.js +1 -0
  23. package/dist/chunks/PermissionDialog-BPhvs5xH.js +1 -0
  24. package/dist/chunks/PressEnterToContinue-Dwoh6CaW.js +1 -0
  25. package/dist/chunks/{PromptInputFooterSuggestions-8-awCxOn.js → PromptInputFooterSuggestions-OEXx0Abp.js} +1 -1
  26. package/dist/chunks/PromptInputHelpMenu-DyaUsvNx.js +1 -0
  27. package/dist/chunks/QueryEngine-sH-KjJIq.js +1 -0
  28. package/dist/chunks/REPL-BMH_RItw.js +128 -0
  29. package/dist/chunks/REPL-DkPd3vk5.js +1 -0
  30. package/dist/chunks/{RemoteSessionManager-B4jqKVd3.js → RemoteSessionManager-DJhrR1dz.js} +2 -2
  31. package/dist/chunks/ResumeConversation-BbNrpSFB.js +1 -0
  32. package/dist/chunks/SSETransport-CLiI2qnD.js +2 -0
  33. package/dist/chunks/{SearchBox-C9vUA4IM.js → SearchBox-CwwV0W-w.js} +1 -1
  34. package/dist/chunks/SearchExtraToolsTool-DupzA6Vm.js +1 -0
  35. package/dist/chunks/Settings-B1EI5LOU.js +2 -0
  36. package/dist/chunks/{TeleportProgress-zmdAsogZ.js → TeleportProgress-IB--CbqZ.js} +1 -1
  37. package/dist/chunks/{TeleportRepoMismatchDialog-CG32I4cO.js → TeleportRepoMismatchDialog-KjdlS_gA.js} +1 -1
  38. package/dist/chunks/{TeleportResumeWrapper-2Yjr74Lq.js → TeleportResumeWrapper-DnHTI39O.js} +1 -1
  39. package/dist/chunks/ThemePicker-BrD_T7xF.js +1 -0
  40. package/dist/chunks/{TrustDialog-BVcny9vs.js → TrustDialog-L0rvvpit.js} +1 -1
  41. package/dist/chunks/ValidationErrorsList-QZvtUrAy.js +2 -0
  42. package/dist/chunks/add-dir-CpWXReCi.js +1 -0
  43. package/dist/chunks/{agentDisplay-CfMLGPGH.js → agentDisplay-CrQvGkTT.js} +1 -1
  44. package/dist/chunks/agents-BYQO6DbG.js +101 -0
  45. package/dist/chunks/{agents-BT82hwBN.js → agents-C99yMsVF.js} +1 -1
  46. package/dist/chunks/allErrors-uyOMiF9U.js +1 -0
  47. package/dist/chunks/{api-DAubp5q9.js → api-C5I2xwgd.js} +1 -1
  48. package/dist/chunks/api-j0iE1mkR.js +1 -0
  49. package/dist/chunks/attributionHooks-C0aXyx9L.js +1 -0
  50. package/dist/chunks/{auth-yDsvFcM7.js → auth-BYCRa_mb.js} +7 -12
  51. package/dist/chunks/auth-C9FUZzpW.js +1 -0
  52. package/dist/chunks/auth-DwPrlTHv.js +1 -0
  53. package/dist/chunks/backgroundHousekeeping-BxcVB3By.js +1 -0
  54. package/dist/chunks/backgroundHousekeeping-CjD8bACB.js +17 -0
  55. package/dist/chunks/{banner-BcAM7iSx.js → banner-HfMnBd03.js} +2 -2
  56. package/dist/chunks/{bg-Ci7pG4eo.js → bg-DltfF1_K.js} +2 -2
  57. package/dist/chunks/branch-BOWBZo5K.js +2 -0
  58. package/dist/chunks/{break-cache-4rlQORVk.js → break-cache-Cd1yQ-0h.js} +2 -3
  59. package/dist/chunks/bridgeConfig-Bxs5dqjH.js +1 -0
  60. package/dist/chunks/{bridgeConfig-BB6Hgali.js → bridgeConfig-CgAVrQfz.js} +1 -1
  61. package/dist/chunks/{bridgeMessaging-C9D0Lly2.js → bridgeMessaging-cOFtbkf_.js} +1 -1
  62. package/dist/chunks/{bridgePointer-DHWK3LEe.js → bridgePointer-CiHy2tTN.js} +1 -1
  63. package/dist/chunks/{bridgeStatusUtil-D8UbcVrZ.js → bridgeStatusUtil-BQF0AJDO.js} +1 -1
  64. package/dist/chunks/btw-B0UmiVKl.js +1 -0
  65. package/dist/chunks/caches-C9--b9a7.js +1 -0
  66. package/dist/chunks/caches-wN3JyvNE.js +1 -0
  67. package/dist/chunks/{capacityWake-ByL6fM6I.js → capacityWake-LRiPhPeM.js} +1 -1
  68. package/dist/chunks/{ccrClient-BG9HU_fW.js → ccrClient-wtUIz75R.js} +1 -1
  69. package/dist/chunks/{claudeDesktop-Ct_hyICL.js → claudeDesktop-DPIJpc1V.js} +1 -1
  70. package/dist/chunks/{clear-B4XN2fib.js → clear-CNzBoL7O.js} +1 -1
  71. package/dist/chunks/{cliLaunch-OPOtzhvA.js → cliLaunch-xIVvtPZy.js} +1 -1
  72. package/dist/chunks/{client-BMA05FW8.js → client-B7WkO81L.js} +1 -1
  73. package/dist/chunks/client-BCzhAEd0.js +1 -0
  74. package/dist/chunks/client-Dr9AYB-r.js +1 -0
  75. package/dist/chunks/commands-DTB0Qzd5.js +1 -0
  76. package/dist/chunks/compact-Bj8mdDYN.js +2 -0
  77. package/dist/chunks/config-B1kYcRIP.js +1 -0
  78. package/dist/chunks/{config-9rLTDOYW.js → config-BkbL2e5Q.js} +1 -1
  79. package/dist/chunks/{config-DMKtiMzJ.js → config-WMxn2jLl.js} +1 -1
  80. package/dist/chunks/context-DB1Ar85E.js +1 -0
  81. package/dist/chunks/context-noninteractive-Bno2Xsmp.js +1 -0
  82. package/dist/chunks/{context-noninteractive-mAQt1p9l.js → context-noninteractive-CqnJTDcI.js} +2 -2
  83. package/dist/chunks/conversation-DOgBzrm0.js +1 -0
  84. package/dist/chunks/conversation-hNXWaswI.js +1 -0
  85. package/dist/chunks/{createSSHSession-DjLSGm-0.js → createSSHSession-Cf2tOgK_.js} +3 -4
  86. package/dist/chunks/createSession-BZx-2UIB.js +1 -0
  87. package/dist/chunks/{createSession-CftIZ3aq.js → createSession-DD5YaQKM.js} +1 -1
  88. package/dist/chunks/crossProjectResume-CkiPQYYE.js +40 -0
  89. package/dist/chunks/{datadog-BGati3aQ.js → datadog-DcLf1QpG.js} +1 -1
  90. package/dist/chunks/{debug-Dr1SjdXn.js → debug-BQj6h99Q.js} +1 -1
  91. package/dist/chunks/debugUtils-B86DM1Sp.js +1 -0
  92. package/dist/chunks/{detached-CqfQYVOi.js → detached--wGwkuHX.js} +1 -2
  93. package/dist/chunks/{detectRepository-CMEkS5_2.js → detectRepository-Qy3zKoyn.js} +1 -1
  94. package/dist/chunks/detectRepository-tRUoPOKy.js +1 -0
  95. package/dist/chunks/{diff-1HsxKGBh.js → diff-dfXWiuLA.js} +1 -1
  96. package/dist/chunks/directoryCompletion-BtlRKLzw.js +1 -0
  97. package/dist/chunks/doctor-aKE2bG5C.js +1 -0
  98. package/dist/chunks/entry-wISucmYc.js +13 -0
  99. package/dist/chunks/esm-CrJVXrKW.js +1 -0
  100. package/dist/chunks/{execFileNoThrow-mXq4K0rl.js → execFileNoThrow-DYm1GeGn.js} +1 -1
  101. package/dist/chunks/{execSyncWrapper-Ne33rRiD.js → execSyncWrapper-CqvQqke-.js} +1 -1
  102. package/dist/chunks/exit-pjN4EJHV.js +1 -0
  103. package/dist/chunks/exit-s9XGerrH.js +1 -0
  104. package/dist/chunks/{extraUsage-0pUcYexI.js → extraUsage-CwDhpClH.js} +1 -1
  105. package/dist/chunks/extractMemories-WmPLOLUT.js +1 -0
  106. package/dist/chunks/fast-BVABmasw.js +1 -0
  107. package/dist/chunks/fast-Cuj3bfFm.js +1 -0
  108. package/dist/chunks/{fileSuggestions-Be-pyLLq.js → fileSuggestions-Dy2BUZzd.js} +2 -2
  109. package/dist/chunks/firstPartyEventLogger-CabA8fu0.js +1 -0
  110. package/dist/chunks/{firstPartyEventLogger-aFhcruXA.js → firstPartyEventLogger-D4yuDP-n.js} +3 -5
  111. package/dist/chunks/flushGate-B6ecrC4j.js +1 -0
  112. package/dist/chunks/{fpsMetrics-DffAomdg.js → fpsMetrics-Dk_pnSHJ.js} +1 -1
  113. package/dist/chunks/gemini-BC-BxZmj.js +1 -0
  114. package/dist/chunks/generateSessionName-JTR8nPYD.js +1 -0
  115. package/dist/chunks/{genericProcessUtils-Dc1pfb7J.js → genericProcessUtils-Bbcbi11g.js} +1 -1
  116. package/dist/chunks/git-BaSq69E7.js +1 -0
  117. package/dist/chunks/{git-CoQQ6YEf.js → git-DplvjXEY.js} +2 -3
  118. package/dist/chunks/{githubRepoPathMapping-CmpEaQoo.js → githubRepoPathMapping-Bk4FZrng.js} +1 -1
  119. package/dist/chunks/goal-B09SOyra.js +3 -0
  120. package/dist/chunks/grok-BBo3jGfP.js +1 -0
  121. package/dist/chunks/{grove-BnzBbGsX.js → grove-DsAIY-rZ.js} +1 -1
  122. package/dist/chunks/help-CELr6oJZ.js +1 -0
  123. package/dist/chunks/hooks-9rkDD2iw.js +1 -0
  124. package/dist/chunks/{hooks-BZS105Rd.js → hooks-BI4NY5IC.js} +2 -2
  125. package/dist/chunks/initReplBridge-BYrL6ou1.js +1 -0
  126. package/dist/chunks/{install-NZvHd_40.js → install-Dn3_M1Ui.js} +1 -1
  127. package/dist/chunks/{instrumentation-CjBlVlFq.js → instrumentation-5cSwEKaF.js} +4 -4
  128. package/dist/chunks/{job-D502Zf8J.js → job-rW1mEYtm.js} +1 -1
  129. package/dist/chunks/{jwtUtils-FQWtM6iM.js → jwtUtils-YCoZL0FW.js} +1 -1
  130. package/dist/chunks/keybindings-B5kUoxvg.js +1 -0
  131. package/dist/chunks/{launchLocalMemory-DxC3LojF.js → launchLocalMemory-CPucX8Xj.js} +2 -2
  132. package/dist/chunks/launchOnboarding--GCJWeeS.js +8 -0
  133. package/dist/chunks/loadAgentsDir-D-a1uUb5.js +1 -0
  134. package/dist/chunks/{loadAgentsDir-BXtV2jiO.js → loadAgentsDir-JrGMJN05.js} +659 -697
  135. package/dist/chunks/loadPluginHooks-C4zrlV0u.js +1 -0
  136. package/dist/chunks/localSearch-C-stDP9C.js +1 -0
  137. package/dist/chunks/localSearch-hOERAH9v.js +1 -0
  138. package/dist/chunks/{log-27kCA_9u.js → log-BlJ7CcKG.js} +1 -1
  139. package/dist/chunks/{logoV2Utils-CEnU8qad.js → logoV2Utils-J2Sqfube.js} +1 -1
  140. package/dist/chunks/{magicDocs-YtfrqVC6.js → magicDocs-Dpe3YhyL.js} +2 -2
  141. package/dist/chunks/main-C_PDzJdv.js +356 -0
  142. package/dist/chunks/{main-CGLCy2pM.js → main-Zh18lf2J.js} +2 -2
  143. package/dist/chunks/managedEnv-AEhH_HUs.js +1 -0
  144. package/dist/chunks/{managedEnv-B-BNY0xC.js → managedEnv-C8SisyLk.js} +1 -1
  145. package/dist/chunks/{mappers-IuJeXgvr.js → mappers-CMJorgSL.js} +1 -1
  146. package/dist/chunks/mcp-B2mJmWKt.js +6 -0
  147. package/dist/chunks/mcp-SuAh71Ht.js +2 -0
  148. package/dist/chunks/mcp-_tBxhPV-.js +1 -0
  149. package/dist/chunks/{memoize-Co4vS6UF.js → memoize-_2f7NWDv.js} +1 -1
  150. package/dist/chunks/memory-DK8bOrUr.js +1 -0
  151. package/dist/chunks/{modalContext-CUThy6Ph.js → modalContext-wY9CeN4G.js} +1 -1
  152. package/dist/chunks/{mode-GzBwK--u.js → mode-BhfhEpnW.js} +2 -2
  153. package/dist/chunks/model-BCM7RpVk.js +1 -0
  154. package/dist/chunks/model-BWR43D3c.js +1 -0
  155. package/dist/chunks/model-CmDF8O9G.js +1 -0
  156. package/dist/chunks/modelOptions-DEQat7lU.js +1 -0
  157. package/dist/chunks/nativeInstaller-xxyUjXbl.js +1 -0
  158. package/dist/chunks/{omit-D4Udf-p-.js → omit-od_CYp5o.js} +1 -1
  159. package/dist/chunks/{onChangeAppState-WbvtqDtk.js → onChangeAppState-CqTb0yEa.js} +1 -1
  160. package/dist/chunks/{openai-DaVFXyBB.js → openai-qW8mATAs.js} +3 -3
  161. package/dist/chunks/{panel-CoF2a-h4.js → panel-Bg_0PHE6.js} +1 -1
  162. package/dist/chunks/{parser-CUUiH40T.js → parser-a2S_eFyE.js} +1 -1
  163. package/dist/chunks/parser-x-w3ikxt.js +1 -0
  164. package/dist/chunks/{partition-CzW_31Y1.js → partition-CYoWXLNU.js} +1 -1
  165. package/dist/chunks/permissions--iKUbWBw.js +3 -0
  166. package/dist/chunks/pidLock-BR4hzYgp.js +3 -0
  167. package/dist/chunks/plan-DiHCGXhM.js +1 -0
  168. package/dist/chunks/{platform-Dg1c9F_1.js → platform-DVeTi9mp.js} +2 -2
  169. package/dist/chunks/plugin-BeC4D7XF.js +17 -0
  170. package/dist/chunks/pluginAutoupdate-Bj-CrFuO.js +1 -0
  171. package/dist/chunks/pluginBlocklist-DzOs-RS1.js +1 -0
  172. package/dist/chunks/pluginCliCommands-DwIGn58t.js +1 -0
  173. package/dist/chunks/{pluginFlagging-CXSSOj4J.js → pluginFlagging-BzuymJuf.js} +1 -1
  174. package/dist/chunks/pluginOperations-CP1v-nu0.js +2 -0
  175. package/dist/chunks/pluginStartupCheck-BGN6Je6d.js +1 -0
  176. package/dist/chunks/{pluginStartupCheck-BEd0VeQC.js → pluginStartupCheck-BUeBiYVq.js} +1 -1
  177. package/dist/chunks/plugins-D1N31THW.js +4 -0
  178. package/dist/chunks/{poorMode-DxgO_bUb.js → poorMode-D4L_-yWS.js} +1 -1
  179. package/dist/chunks/poorMode-XDBnxTiF.js +1 -0
  180. package/dist/chunks/print-DaJi1wF_.js +14 -0
  181. package/dist/chunks/processBashCommand-BGCIqxc9.js +1 -0
  182. package/dist/chunks/processSlashCommand-qR_j1DE8.js +5 -0
  183. package/dist/chunks/prompt-B0gADAvI.js +1 -0
  184. package/dist/chunks/{prompt-CRc2QEZ5.js → prompt-DnPppVz8.js} +21 -23
  185. package/dist/chunks/prompt-DqyEtC_I2.js +1 -0
  186. package/dist/chunks/{promptEditor-Bo1d8ZLq.js → promptEditor-Cilc9N3L.js} +3 -3
  187. package/dist/chunks/protocolHandler-DdbiucQa.js +13 -0
  188. package/dist/chunks/{proxy-BEKNaTXI.js → proxy-C0j74LqT.js} +1 -1
  189. package/dist/chunks/reconciler-Bte4gdP-.js +1 -0
  190. package/dist/chunks/refresh-MiZ0acBm.js +1 -0
  191. package/dist/chunks/registerProtocol-Bpte9dly.js +1 -0
  192. package/dist/chunks/{reload-plugins-DNEgQ5vo.js → reload-plugins-GdqFZblC.js} +1 -1
  193. package/dist/chunks/{remoteBridgeCore-BGOqHADF.js → remoteBridgeCore-CAl3_H-O.js} +1 -1
  194. package/dist/chunks/{remoteManagedSettings-26nhzuca.js → remoteManagedSettings-BcLJLEr7.js} +1 -1
  195. package/dist/chunks/rename-BDo5qIK0.js +1 -0
  196. package/dist/chunks/{renderOptions-45A-EdsK.js → renderOptions-CkqTbz6d.js} +1 -1
  197. package/dist/chunks/resume-Bbweh2hA.js +2 -0
  198. package/dist/chunks/ripgrep-DrpZ79Pp.js +1 -0
  199. package/dist/chunks/{ripgrep-DQ_ILUJV.js → ripgrep-X5m4gJ-3.js} +1 -1
  200. package/dist/chunks/{runtimeObserver-CBV-7-w7.js → runtimeObserver-CxXxUcrm.js} +1 -1
  201. package/dist/chunks/{runtimeObserver-BZrF3GnQ.js → runtimeObserver-Hjbo43xj.js} +3 -3
  202. package/dist/chunks/sandbox-adapter-DQ_fJSIo.js +1 -0
  203. package/dist/chunks/sandbox-toggle-DmNSThQK.js +1 -0
  204. package/dist/chunks/searchExtraTools-C7b2x2p_.js +1 -0
  205. package/dist/chunks/{session-Dy-_R7KP.js → session-CkuTMD_4.js} +2 -2
  206. package/dist/chunks/sessionFileAccessHooks-CQvGAbvL.js +1 -0
  207. package/dist/chunks/{sessionIdCompat-DMayYBrf.js → sessionIdCompat-Dgp6PW_1.js} +1 -1
  208. package/dist/chunks/sessionObserver-BoQY7nOa.js +1 -0
  209. package/dist/chunks/{sessionObserver-CyLpHSkw.js → sessionObserver-CvQ6oyoj.js} +1 -1
  210. package/dist/chunks/sessionState-C2REgUrs.js +11 -0
  211. package/dist/chunks/sessionStorage-BeaEgnaa.js +1 -0
  212. package/dist/chunks/sessionStoragePortable-x0Yn02-G.js +3 -0
  213. package/dist/chunks/{sessionTitle-L5tyJgdU.js → sessionTitle-2IWcNB8H.js} +2 -2
  214. package/dist/chunks/{sessionTracing-DpHGGIZm.js → sessionTracing-Bm7hQKHA.js} +2 -2
  215. package/dist/chunks/settings-Da6ax5aI.js +1 -0
  216. package/dist/chunks/{settings-DiBMs2gM.js → settings-aUygByiZ.js} +4 -5
  217. package/dist/chunks/settingsSync-DgzCU1BZ.js +1 -0
  218. package/dist/chunks/setup-CvaG4nl5.js +3 -0
  219. package/dist/chunks/{shadowedRuleDetection-DZ0AA2Rw.js → shadowedRuleDetection-CWCQ5dZ0.js} +1 -1
  220. package/dist/chunks/{shellQuote-C_I6DHLV.js → shellQuote-D3Ocv_U-.js} +1 -1
  221. package/dist/chunks/{sideQuestion-BYT8FdPF.js → sideQuestion-BoW-xYkh.js} +3 -3
  222. package/dist/chunks/sinks-B_ehGpvp.js +1 -0
  223. package/dist/chunks/sinks-ZHKfs6gv.js +1 -0
  224. package/dist/chunks/skillChangeDetector-C-HWR_8v.js +1 -0
  225. package/dist/chunks/{skillGapStore-DQXHqoP7.js → skillGapStore-CCNeSjIb.js} +2 -2
  226. package/dist/chunks/{skillLifecycle-BG_RnGSh.js → skillLifecycle-wU4JDNYQ.js} +2 -2
  227. package/dist/chunks/{skillSearchPanel-DxYP4Q6R.js → skillSearchPanel-Cxr1QQn4.js} +2 -2
  228. package/dist/chunks/skills-BghnKnNo.js +1 -0
  229. package/dist/chunks/{src-r6ZFgWPx2.js → src-D3yIF9I42.js} +1 -1
  230. package/dist/chunks/src-DL3w8VPk2.js +51 -0
  231. package/dist/chunks/{startupProfiler-Dc5r6LgE.js → startupProfiler-2sjXZkIP.js} +1 -1
  232. package/dist/chunks/startupProfiler-B2fyaBEa.js +1 -0
  233. package/dist/chunks/{staticRender-DrU6eWoq.js → staticRender-D9AbnQFr.js} +1 -1
  234. package/dist/chunks/{stats-BkadEKa-.js → stats-unp6R0Ah.js} +1 -1
  235. package/dist/chunks/{status-BmHu-c7I.js → status-BraYBx4N.js} +2 -2
  236. package/dist/chunks/status-DwyWiaVc.js +1 -0
  237. package/dist/chunks/statusNoticeHelpers-Dm1aiibR.js +1 -0
  238. package/dist/chunks/{stringUtils-Df-Lnjxd.js → stringUtils-BjnclTLB.js} +3 -3
  239. package/dist/chunks/{switcher-sYTxnJQA.js → switcher-BUNSEJ-7.js} +1 -1
  240. package/dist/chunks/switcher-DDUnWU_4.js +1 -0
  241. package/dist/chunks/{syncCache-BofuFJEe.js → syncCache-1s9xV8WV.js} +1 -1
  242. package/dist/chunks/tasks-BjFot03S.js +1 -0
  243. package/dist/chunks/teleport-Dj2Kvbmx.js +1 -0
  244. package/dist/chunks/{templateJobs-C94jEE6O.js → templateJobs-CY7GNRo5.js} +1 -3
  245. package/dist/chunks/{terminalSetup-fwhFTxGi.js → terminalSetup-CpMNk6dc.js} +5 -6
  246. package/dist/chunks/{terminalSetup-CbXKCpWM.js → terminalSetup-Ty8T8ePM.js} +1 -1
  247. package/dist/chunks/theme-c6grxWNn.js +1 -0
  248. package/dist/chunks/{tmux-d3cNCIZA.js → tmux-g0cQ0Buz.js} +1 -1
  249. package/dist/chunks/{toolEventObserver-DlL9CHmI.js → toolEventObserver-D7WbjgFR.js} +1 -1
  250. package/dist/chunks/toolPool-O5nkEFb1.js +1 -0
  251. package/dist/chunks/{trustedDevice-Bzz03jCy.js → trustedDevice-BF78PNK8.js} +1 -1
  252. package/dist/chunks/trustedDevice-D_z7bAQh.js +1 -0
  253. package/dist/chunks/{types-BJ7qTz75.js → types-BomO8WUz.js} +1 -1
  254. package/dist/chunks/{udsClient-CF8BmZgN.js → udsClient-DSvRPCvR.js} +1 -1
  255. package/dist/chunks/updateCCB-ts7Joyve.js +5 -0
  256. package/dist/chunks/upstreamproxy-DYoLvdM9.js +10 -0
  257. package/dist/chunks/useExitOnCtrlCDWithKeybindings-qLfN0tc-.js +1 -0
  258. package/dist/chunks/useMainLoopModel-DkjG_ikT.js +1 -0
  259. package/dist/chunks/useManagePlugins-E0Qzj-ws.js +1 -0
  260. package/dist/chunks/useMergedTools-B7iYaNwM.js +1 -0
  261. package/dist/chunks/{useSearchInput-q2CFPU4W.js → useSearchInput-CsxiM9i0.js} +1 -1
  262. package/dist/chunks/useSettingsErrors-DdVTahNa.js +1 -0
  263. package/dist/chunks/{userAgent-B7WkjI6I.js → userAgent-BggRZ-ZE.js} +1 -1
  264. package/dist/chunks/util-Xdy1nOjj.js +1 -0
  265. package/dist/chunks/{validatePlugin-jrcrYEIu.js → validatePlugin-Be5aSSnP.js} +1 -1
  266. package/dist/chunks/{vim-C4Hs5U2h.js → vim-cFcxfuac.js} +1 -1
  267. package/dist/chunks/{which-mplwBbc0.js → which-BR8YVCCW.js} +1 -1
  268. package/dist/chunks/{windowsPaths-C7Mdo9aU.js → windowsPaths-BmXyrasP.js} +1 -1
  269. package/dist/chunks/windowsPaths-BybjGW7e.js +1 -0
  270. package/dist/chunks/{workSecret-XLodD7tw.js → workSecret-BUd8cQ6-.js} +1 -1
  271. package/dist/chunks/workerRegistry-GrD7IAVQ.js +2 -0
  272. package/dist/chunks/worktree-V7xiUAtl.js +1 -0
  273. package/dist/cli.js +1 -1
  274. package/package.json +1 -1
  275. package/dist/chunks/AddWorkspaceDirectory-CtRxzRny.js +0 -1
  276. package/dist/chunks/AgentsMdExternalIncludesDialog-_bI4jo_P.js +0 -1
  277. package/dist/chunks/App-DoAZ7CYS.js +0 -1
  278. package/dist/chunks/ApproveApiKey-C8LwmDM2.js +0 -1
  279. package/dist/chunks/ApproveApiKey-DQP3qmb0.js +0 -1
  280. package/dist/chunks/BackgroundTasksDialog-CDA2noEk.js +0 -2
  281. package/dist/chunks/ConsoleOAuthFlow-Dn8fO-o_.js +0 -1
  282. package/dist/chunks/DiffDialog-CRWtQ1R5.js +0 -6
  283. package/dist/chunks/Doctor-CZ513Df9.js +0 -3
  284. package/dist/chunks/Doctor-CzPvNZzF.js +0 -1
  285. package/dist/chunks/ExitFlow-BFeftDv0.js +0 -2
  286. package/dist/chunks/InvalidConfigDialog-DQaT6aen.js +0 -1
  287. package/dist/chunks/InvalidSettingsDialog-ISzcIGPU.js +0 -1
  288. package/dist/chunks/MCPConnectionManager-BpjC7CEo.js +0 -1
  289. package/dist/chunks/MCPToolListView-Rb1Q--jG.js +0 -1
  290. package/dist/chunks/MessageSelector-BHB55sZb.js +0 -3
  291. package/dist/chunks/Messages-CPX-nIdA.js +0 -11
  292. package/dist/chunks/Onboarding-CymgipoF.js +0 -1
  293. package/dist/chunks/PermissionDialog-Cb3z8OUP.js +0 -1
  294. package/dist/chunks/PressEnterToContinue-Dq0Imo9c.js +0 -1
  295. package/dist/chunks/PromptInputHelpMenu-BP3UgCdi.js +0 -1
  296. package/dist/chunks/QueryEngine-HkswHUNv.js +0 -1
  297. package/dist/chunks/REPL-CZfg65kg.js +0 -133
  298. package/dist/chunks/REPL-eZsYNBfl.js +0 -1
  299. package/dist/chunks/ResumeConversation-B03XN_SP.js +0 -1
  300. package/dist/chunks/SSETransport-je346ofV.js +0 -4
  301. package/dist/chunks/SearchExtraToolsTool-C85Sanww.js +0 -1
  302. package/dist/chunks/Settings-C8GKWod1.js +0 -2
  303. package/dist/chunks/ThemePicker-p7_hHk1V.js +0 -1
  304. package/dist/chunks/ValidationErrorsList-DSSUWdgd.js +0 -2
  305. package/dist/chunks/WelcomeV2-BnSYhyfu.js +0 -1
  306. package/dist/chunks/add-dir-Bd7pilVx.js +0 -1
  307. package/dist/chunks/agents-qR6r94-F.js +0 -103
  308. package/dist/chunks/allErrors-CS77lRvU.js +0 -1
  309. package/dist/chunks/api-C4VflFau.js +0 -1
  310. package/dist/chunks/attributionHooks-CUAoGkU6.js +0 -1
  311. package/dist/chunks/auth-CNCehj7y.js +0 -1
  312. package/dist/chunks/auth-DrD9DW6X.js +0 -1
  313. package/dist/chunks/autoMode-C2lnBot9.js +0 -45
  314. package/dist/chunks/autoModeDenials-BxNzGJdR.js +0 -1
  315. package/dist/chunks/backgroundHousekeeping-DbpTGbwl.js +0 -1
  316. package/dist/chunks/backgroundHousekeeping-SpTxViUq.js +0 -17
  317. package/dist/chunks/branch-DJiMa8td.js +0 -3
  318. package/dist/chunks/bridgeConfig-Ccm79Jze.js +0 -1
  319. package/dist/chunks/btw-BO2B23f-.js +0 -1
  320. package/dist/chunks/caches-BQmbXerw.js +0 -1
  321. package/dist/chunks/caches-Dtjmjm6G.js +0 -1
  322. package/dist/chunks/client-7lIxWcaM.js +0 -1
  323. package/dist/chunks/client-B-2ccQZk.js +0 -1
  324. package/dist/chunks/commands-D_-v6_A0.js +0 -1
  325. package/dist/chunks/compact-kM0ETtB2.js +0 -2
  326. package/dist/chunks/config-Crf6Mzu3.js +0 -1
  327. package/dist/chunks/connectHeadless-CqRoEtrg.js +0 -1
  328. package/dist/chunks/context-BY5oO5is.js +0 -1
  329. package/dist/chunks/context-noninteractive-tc4KTYfI.js +0 -1
  330. package/dist/chunks/conversation-CFIn-KsW.js +0 -1
  331. package/dist/chunks/conversation-DPI7VKBL.js +0 -1
  332. package/dist/chunks/createSession-CjdLcRec.js +0 -1
  333. package/dist/chunks/crossProjectResume-BJqXBzkf.js +0 -40
  334. package/dist/chunks/dangerousBackend-DwcP0P08.js +0 -1
  335. package/dist/chunks/debugUtils-cK-iOsEV.js +0 -1
  336. package/dist/chunks/detectRepository-BsKZDRoI.js +0 -1
  337. package/dist/chunks/directoryCompletion-ByBTSuLu.js +0 -1
  338. package/dist/chunks/doctor-CJfvt9zR.js +0 -1
  339. package/dist/chunks/entry-CrZCZQQC.js +0 -14
  340. package/dist/chunks/esm-BkOWaWVb.js +0 -1
  341. package/dist/chunks/exit-B8MA4Ltm.js +0 -1
  342. package/dist/chunks/exit-BOhGfSlm.js +0 -2
  343. package/dist/chunks/extractMemories-DqhN0lba.js +0 -1
  344. package/dist/chunks/fast-DT5WDe3L.js +0 -1
  345. package/dist/chunks/fast-VOu2FUlV.js +0 -1
  346. package/dist/chunks/firstPartyEventLogger-B8RVGBQB.js +0 -1
  347. package/dist/chunks/flushGate-BUSrMj_6.js +0 -1
  348. package/dist/chunks/gemini-DB4M-MYv.js +0 -1
  349. package/dist/chunks/generateSessionName-DhCypqJ_.js +0 -1
  350. package/dist/chunks/git-Bs1vtuvX.js +0 -1
  351. package/dist/chunks/goal-TxXtfkQ6.js +0 -3
  352. package/dist/chunks/grok-D2a_J5wE.js +0 -1
  353. package/dist/chunks/help-C5ankDi4.js +0 -1
  354. package/dist/chunks/hooks-D-twhU_z.js +0 -1
  355. package/dist/chunks/initReplBridge-DL4klK0C.js +0 -1
  356. package/dist/chunks/keybindings-D9Boc8FD.js +0 -2
  357. package/dist/chunks/launchOnboarding-BLp5k_H4.js +0 -8
  358. package/dist/chunks/loadAgentsDir-BjsAQWqt.js +0 -1
  359. package/dist/chunks/loadPluginHooks-Dt3XQ-3N.js +0 -1
  360. package/dist/chunks/localSearch-CeP4ef0a.js +0 -1
  361. package/dist/chunks/localSearch-Cz8Ot7k2.js +0 -1
  362. package/dist/chunks/lockfile-D5-j7HOZ.js +0 -1
  363. package/dist/chunks/main-CkjTzYj1.js +0 -513
  364. package/dist/chunks/managedEnv-K9Si1UuL.js +0 -1
  365. package/dist/chunks/mcp-DMBoeQzm.js +0 -6
  366. package/dist/chunks/mcp-TMOPfLcW.js +0 -1
  367. package/dist/chunks/mcp-x5rgv-uv.js +0 -2
  368. package/dist/chunks/memory-DDUoR63T.js +0 -1
  369. package/dist/chunks/model-BydaMaPr.js +0 -1
  370. package/dist/chunks/model-CDnVaVDR.js +0 -1
  371. package/dist/chunks/model-CIvbC7rW.js +0 -1
  372. package/dist/chunks/modelOptions-ut0xePEe.js +0 -1
  373. package/dist/chunks/nativeInstaller-fgCMR_c0.js +0 -1
  374. package/dist/chunks/parseConnectUrl-BiyKR5-x.js +0 -1
  375. package/dist/chunks/parser-B2PlJg4C.js +0 -1
  376. package/dist/chunks/permissions-BT3lxYBM.js +0 -3
  377. package/dist/chunks/pidLock-d1VPd6CG.js +0 -3
  378. package/dist/chunks/plan-M9DG3AqN.js +0 -1
  379. package/dist/chunks/plugin-BiNHuq3h.js +0 -17
  380. package/dist/chunks/pluginAutoupdate-B5lel6s5.js +0 -1
  381. package/dist/chunks/pluginBlocklist-CNGmIlwU.js +0 -1
  382. package/dist/chunks/pluginCliCommands-WLOEhb2M.js +0 -1
  383. package/dist/chunks/pluginOperations-BFbty6WT.js +0 -2
  384. package/dist/chunks/pluginStartupCheck-Bcdxg484.js +0 -1
  385. package/dist/chunks/plugins-BMZ3aYKP.js +0 -4
  386. package/dist/chunks/poorMode-Djw0P9Gu.js +0 -1
  387. package/dist/chunks/print-DmoLcwVq.js +0 -26
  388. package/dist/chunks/processBashCommand-B-VqME9O.js +0 -1
  389. package/dist/chunks/processSlashCommand-D6zEooTy.js +0 -5
  390. package/dist/chunks/prompt-C3RRe4kW.js +0 -1
  391. package/dist/chunks/prompt-EtAanewG.js +0 -1
  392. package/dist/chunks/protocolHandler-B83fCYI4.js +0 -13
  393. package/dist/chunks/reconciler-BGav_ezX.js +0 -1
  394. package/dist/chunks/refresh-DumNiLvM.js +0 -1
  395. package/dist/chunks/registerProtocol-DduKPsn_.js +0 -36
  396. package/dist/chunks/rename-BPknfVGF.js +0 -1
  397. package/dist/chunks/resume-DGz04xDh.js +0 -2
  398. package/dist/chunks/ripgrep-BLQnqPnE.js +0 -1
  399. package/dist/chunks/sandbox-adapter-DUqeqkQD.js +0 -1
  400. package/dist/chunks/sandbox-toggle-D61gVqcT.js +0 -1
  401. package/dist/chunks/searchExtraTools-CgsV6kb1.js +0 -1
  402. package/dist/chunks/server-LdbAb0sV.js +0 -1
  403. package/dist/chunks/serverBanner-BdExKFHT.js +0 -1
  404. package/dist/chunks/serverLog-BFmvyJ93.js +0 -1
  405. package/dist/chunks/sessionFileAccessHooks-BJlrZaRD.js +0 -1
  406. package/dist/chunks/sessionManager-CPa049BO.js +0 -1
  407. package/dist/chunks/sessionObserver-BGYoLRGx.js +0 -1
  408. package/dist/chunks/sessionState-DSWN4tMV.js +0 -11
  409. package/dist/chunks/sessionStorage-zJ1esSCE.js +0 -1
  410. package/dist/chunks/sessionStoragePortable-BhkGMZWp.js +0 -3
  411. package/dist/chunks/settings-3ionQKNv.js +0 -1
  412. package/dist/chunks/settingsSync-dBqlrbcU.js +0 -1
  413. package/dist/chunks/setup-zf3v3ICe.js +0 -3
  414. package/dist/chunks/sinks-DppGvgz1.js +0 -1
  415. package/dist/chunks/sinks-mFsijQ_S.js +0 -2
  416. package/dist/chunks/skillChangeDetector-D-iq09Xs.js +0 -1
  417. package/dist/chunks/skills-BD-2ofXA.js +0 -1
  418. package/dist/chunks/src-P_wYS_NJ2.js +0 -53
  419. package/dist/chunks/startupProfiler-CUlV07MD.js +0 -1
  420. package/dist/chunks/status-CrmnCDIE.js +0 -1
  421. package/dist/chunks/statusNoticeHelpers-DakAVtQO.js +0 -1
  422. package/dist/chunks/switcher-Dm646gO5.js +0 -1
  423. package/dist/chunks/tasks-NpI1iEem.js +0 -1
  424. package/dist/chunks/teleport-Bs3kEipi.js +0 -1
  425. package/dist/chunks/theme-CEi3b_8f.js +0 -1
  426. package/dist/chunks/toolPool-DIT_uhtD.js +0 -1
  427. package/dist/chunks/trustedDevice-BokywSKL.js +0 -1
  428. package/dist/chunks/updateCCB-CzBxsuJe.js +0 -11
  429. package/dist/chunks/upstreamproxy-BuBFDFAD.js +0 -11
  430. package/dist/chunks/useExitOnCtrlCDWithKeybindings-BHQfwlAl.js +0 -1
  431. package/dist/chunks/useMainLoopModel-BkyIIW9t.js +0 -1
  432. package/dist/chunks/useManagePlugins-BWROoGDs.js +0 -1
  433. package/dist/chunks/useMergedTools-CHxnwR7R.js +0 -1
  434. package/dist/chunks/useSettingsErrors-CPVQbsqq.js +0 -1
  435. package/dist/chunks/util-BfqXOA-P.js +0 -1
  436. package/dist/chunks/windowsPaths-B8p9tFRF.js +0 -1
  437. package/dist/chunks/workerRegistry-Cfo7bKlm.js +0 -6
  438. package/dist/chunks/worktree-D0k_pCEz.js +0 -1
  439. package/dist/chunks/xdg-DcF9ejUM.js +0 -1
@@ -1,17 +0,0 @@
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,AC as s,Ao as c,Bo as l,Do as u,Fw as d,Fx as f,Go as p,IC as m,Io as h,Jo as g,Jw as _,Mp as v,No as y,Nu as b,Oo as x,Pw as S,Qo as ee,Rx as te,Uo as C,Ww as w,Xw as T,Zo as ne,_S as E,_o as D,as as re,bS as O,bg as k,cS as A,cd as ie,cs as j,dS as M,do as ae,eT as oe,es as se,fS as N,fo as ce,gS as P,hS as F,iT as I,jp as L,ju as le,jw as ue,lg as de,mS as fe,ns as pe,og as me,pS as he,qo as ge,rT as _e,rs as ve,sS as R,sd as ye,sg as be,ss as xe,tT as Se,ts as Ce,vS as we,vo as Te,wo as Ee,xS as De,xg as Oe,yS as ke,zo as Ae}from"./loadAgentsDir-BXtV2jiO.js";import{D as je,Gr as Me,Gt as z,H as Ne,I as B,P as V,T as Pe,Wt as Fe,Xn as Ie,fi as H,hn as Le,j as Re,k as ze,n as Be,ot as Ve,r as He,t as Ue,x as We,y as Ge}from"./src-P_wYS_NJ2.js";import{t as Ke}from"./jsx-runtime-Bb4Xn-E0.js";import{P as qe,R as Je,S as Ye,U as Xe,c as Ze,i as Qe,x as $e}from"./debug-Dr1SjdXn.js";import{Ln as et,Rn as tt,c as nt,f as rt,g as it,vt as at,x as ot,xt as st}from"./settings-DiBMs2gM.js";import{b as ct,h as lt}from"./config-9rLTDOYW.js";import{o as ut,s as dt}from"./log-27kCA_9u.js";import{n as ft,r as pt}from"./analytics-DJobLaWP.js";import{C as mt,y as ht}from"./startupProfiler-Dc5r6LgE.js";import{l as gt,o as _t}from"./stringUtils-Df-Lnjxd.js";import{n as vt,t as yt}from"./pluginStartupCheck-BEd0VeQC.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-BFbty6WT.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-jrcrYEIu.js";import{a as Ft,n as It,o as Lt,r as Rt}from"./pluginFlagging-CXSSOj4J.js";import{i as zt,n as Bt}from"./MCPConnectionManager-BpjC7CEo.js";import{n as Vt,t as Ht}from"./useExitOnCtrlCDWithKeybindings-BHQfwlAl.js";import{t as Ut}from"./SearchBox-C9vUA4IM.js";import{n as Wt,t as Gt}from"./useSearchInput-q2CFPU4W.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-Rb1Q--jG.js";import{i as en,n as tn}from"./pluginAutoupdate-B5lel6s5.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:c,onAddComplete:l,cliMode:u=!1}){let d=(0,on.useRef)(!1),[f,p]=(0,on.useState)(!1),[m,h]=(0,on.useState)(``),g=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{p(!0),h(``);let{name:e,resolvedSource:t}=await y(n,e=>{h(e)});ge(e,{source:t}),xe();let r=n.source;n.source===`github`&&(r=n.repo),pt(`tengu_marketplace_added`,{source_type:r}),l&&await l(),h(``),p(!1),u?s(`Successfully added marketplace: ${e}`):c({type:`browse-marketplace`,targetMarketplace:e})}catch(e){let t=Xe(e);dt(t),a(t.message),h(``),p(!1),s(u?`Error: ${t.message}`:null)}};return(0,on.useEffect)(()=>{e&&!d.current&&!i&&!o&&(d.current=!0,g())},[]),(0,U.jsxs)(B,{flexDirection:`column`,children:[(0,U.jsxs)(B,{flexDirection:`column`,paddingX:1,borderStyle:`round`,children:[(0,U.jsx)(B,{marginBottom:1,children:(0,U.jsx)(V,{bold:!0,children:`Add Marketplace`})}),(0,U.jsxs)(B,{flexDirection:`column`,children:[(0,U.jsx)(V,{children:`Enter marketplace source:`}),(0,U.jsx)(V,{dimColor:!0,children:`Examples:`}),(0,U.jsx)(V,{dimColor:!0,children:` · owner/repo (GitHub)`}),(0,U.jsx)(V,{dimColor:!0,children:` · git@github.com:owner/repo.git (SSH)`}),(0,U.jsx)(V,{dimColor:!0,children:` · https://example.com/marketplace.json`}),(0,U.jsx)(V,{dimColor:!0,children:` · ./path/to/marketplace`}),(0,U.jsx)(B,{marginTop:1,children:(0,U.jsx)(ye,{value:e,onChange:t,onSubmit:g,columns:80,cursorOffset:n,onChangeCursorOffset:r,focus:!0,showCursor:!0})})]}),f&&(0,U.jsxs)(B,{marginTop:1,children:[(0,U.jsx)(le,{}),(0,U.jsx)(V,{children:m||`Adding marketplace to configuration…`})]}),i&&(0,U.jsx)(B,{marginTop:1,children:(0,U.jsx)(V,{color:`error`,children:i})}),o&&(0,U.jsx)(B,{marginTop:1,children:(0,U.jsx)(V,{children:o})})]}),(0,U.jsx)(B,{marginLeft:3,children:(0,U.jsx)(V,{dimColor:!0,italic:!0,children:(0,U.jsxs)(Pe,{children:[(0,U.jsx)(je,{shortcut:`Enter`,action:`add`}),(0,U.jsx)(L,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]})})})]})}var on,U,sn=e((()=>{H(),on=t(H(),1),ft(),v(),Ue(),b(),ie(),Je(),ut(),j(),Ae(),At(),U=Ke()}));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(Fe(`confirm:no`,o,{context:`Settings`}),z({"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`}),Le((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(Me(p)):p;return(0,dn.jsxs)(Ge,{title:e,subtitle:t,onCancel:o,isCancelActive:!1,children:[(0,dn.jsxs)(B,{flexDirection:`column`,children:[(0,dn.jsxs)(V,{bold:!0,children:[g.title||h,v&&(0,dn.jsx)(V,{color:`error`,children:` *`})]}),g.description&&(0,dn.jsx)(V,{dimColor:!0,children:g.description}),(0,dn.jsxs)(B,{marginTop:1,children:[(0,dn.jsxs)(V,{children:[a.pointerSmall,` `]}),(0,dn.jsx)(V,{children:y}),(0,dn.jsx)(V,{children:`█`})]})]}),(0,dn.jsxs)(B,{flexDirection:`column`,children:[(0,dn.jsxs)(V,{dimColor:!0,children:[`Field `,l+1,` of `,s.length]}),l<s.length-1&&(0,dn.jsx)(V,{dimColor:!0,children:`Tab: Next field · Enter: Save and continue`}),l===s.length-1&&(0,dn.jsx)(V,{dimColor:!0,children:`Enter: Save configuration`})]})]})}var un,dn,fn=e((()=>{i(),un=t(H(),1),Ue(),s(),r(),dn=Ke()}));async function pn(e){let{enabled:t,disabled:n}=await ce();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=M(e);Object.keys(r).length>0&&n.push({key:`top-level`,title:`Configure ${e.name}`,subtitle:`Plugin options`,schema:r,load:()=>he(t),save:n=>fe(t,n,e.manifest.userConfig)});let i=R(e);for(let r of i)n.push({key:`channel:${r.server}`,title:`Configure ${r.displayName}`,subtitle:`Plugin: ${e.name}`,schema:r.configSchema,load:()=>E(t,r.server)??void 0,save:e=>ke(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`,qe(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(H(),1),Je(),F(),A(),ae(),N(),fn(),gn=Ke()}));function vn(){let e=pe();return(0,yn.jsxs)(B,{marginBottom:1,children:[(0,yn.jsxs)(V,{color:`claude`,children:[a.warning,` `]}),(0,yn.jsxs)(V,{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(),H(),Ue(),ve(),yn=Ke()}));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)(B,{marginTop:1,children:(0,wn.jsx)(V,{dimColor:!0,italic:!0,children:(0,wn.jsxs)(Pe,{children:[e&&(0,wn.jsx)(L,{action:`plugin:install`,context:`Plugin`,fallback:`i`,description:`install`,bold:!0}),(0,wn.jsx)(L,{action:`plugin:toggle`,context:`Plugin`,fallback:`Space`,description:`toggle`}),(0,wn.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`details`}),(0,wn.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})}var wn,Tn=e((()=>{H(),v(),Ue(),wn=Ke()}));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(H(),1),On=5}));function An({error:e,setError:t,result:n,setResult:r,setViewState:i,onInstallComplete:s,targetMarketplace:c,targetPlugin:d}){let[f,p]=(0,W.useState)(`marketplace-list`),[m,g]=(0,W.useState)(null),[_,v]=(0,W.useState)(null),[y,b]=(0,W.useState)([]),[S,ee]=(0,W.useState)([]),[te,C]=(0,W.useState)(!0),[w,T]=(0,W.useState)(null),[E,D]=(0,W.useState)(0),[O,k]=(0,W.useState)(new Set),[A,ie]=(0,W.useState)(new Set),j=En({totalItems:S.length,selectedIndex:E}),[M,ae]=(0,W.useState)(0),[oe,N]=(0,W.useState)(!1),[ce,P]=(0,W.useState)(null),[F,I]=(0,W.useState)(null);Fe(`confirm:no`,jn.useCallback(()=>{f===`plugin-list`?c?i({type:`manage-marketplaces`,targetMarketplace:c}):y.length===1?i({type:`menu`}):(p(`marketplace-list`),g(null),k(new Set)):f===`plugin-details`?(p(`plugin-list`),v(null)):i({type:`menu`})},[f,c,i,y.length]),{context:`Confirmation`}),(0,W.useEffect)(()=>{async function e(){try{let e=await l(),{marketplaces:n,failures:r}=await re(e),i=[];for(let{name:e,config:t,data:r}of n)if(r){let n=et(r.plugins,t=>x(ne(t.name,e)));i.push({name:e,totalPlugins:r.plugins.length,installedCount:n,source:Ce(t.source)})}i.sort((e,t)=>e.name===`claude-plugin-directory`?-1:+(t.name===`claude-plugin-directory`)),b(i);let a=se(r,et(n,e=>e.data!==null));if(a)if(a.type===`warning`)I(a.message+`. Showing available marketplaces.`);else throw Error(a.message);if(i.length===1&&!c&&!d){let e=i[0];e&&(g(e.name),p(`plugin-list`))}if(d){let n=null,r=null;for(let[t]of Object.entries(e)){let e=await h(t);if(e){let i=e.plugins.find(e=>e.name===d);if(i){let e=ne(i.name,t);n={entry:i,marketplaceName:t,pluginId:e,isInstalled:u(e)},r=t;break}}}if(n&&r){let e=n.pluginId;u(e)?t(`Plugin '${e}' is already installed globally. Use '/plugin' to manage existing plugins.`):(g(r),v(n),p(`plugin-details`))}else t(`Plugin "${d}" not found in any marketplace`)}else c&&(i.some(e=>e.name===c)?(g(c),p(`plugin-list`)):t(`Marketplace "${c}" not found`))}catch(e){t(e instanceof Error?e.message:`Failed to load marketplaces`)}finally{C(!1)}}e()},[t,c,d]),(0,W.useEffect)(()=>{if(!m)return;let e=!1;async function n(n){C(!0);try{let t=await h(n);if(e)return;if(!t)throw Error(`Failed to load marketplace: ${n}`);let r=[];for(let e of t.plugins){let t=ne(e.name,n);Oe(t)||r.push({entry:e,marketplaceName:n,pluginId:t,isInstalled:u(t)})}try{let t=await Nt();if(e)return;T(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;Ze(`Failed to fetch install counts: ${qe(t)}`),r.sort((e,t)=>e.entry.name.localeCompare(t.entry.name))}ee(r),D(0),k(new Set)}catch(n){if(e)return;t(n instanceof Error?n.message:`Failed to load plugins`)}finally{C(!1)}}return n(m),()=>{e=!0}},[m,t]);let le=async()=>{if(O.size===0)return;let e=S.filter(e=>O.has(e.pluginId));ie(new Set(e.map(e=>e.pluginId)));let n=0,a=0,c=[];for(let t of e){let e=await Te({pluginId:t.pluginId,entry:t.entry,marketplaceName:t.marketplaceName,scope:`user`});e.success?n++:(a++,c.push({name:t.entry.name,reason:e.error}))}ie(new Set),k(new Set),xe(),a===0?r(`✓ Installed ${n} ${gt(n,`plugin`)}. Run /reload-plugins to activate.`):n===0?t(`Failed to install: ${o(c,!0)}`):r(`✓ Installed ${n} of ${n+a} plugins. Failed: ${o(c,!1)}. Run /reload-plugins to activate successfully installed plugins.`),n>0&&s&&await s(),i({type:`menu`})},ue=async(e,t=`user`)=>{N(!0),P(null);let n=await Te({pluginId:e.pluginId,entry:e.entry,marketplaceName:e.marketplaceName,scope:t});if(n.success){let t=await pn(e.pluginId);if(t){N(!1),p({type:`plugin-options`,plugin:t,pluginId:e.pluginId});return}r(n.message),s&&await s(),i({type:`menu`})}else N(!1),P(n.error)};(0,W.useEffect)(()=>{e&&r(e)},[e,r]),z({"select:previous":()=>{E>0&&D(E-1)},"select:next":()=>{E<y.length-1&&D(E+1)},"select:accept":()=>{let e=y[E];e&&(g(e.name),p(`plugin-list`))}},{context:`Select`,isActive:f===`marketplace-list`}),z({"select:previous":()=>{E>0&&j.handleSelectionChange(E-1,D)},"select:next":()=>{E<S.length-1&&j.handleSelectionChange(E+1,D)},"select:accept":()=>{if(E===S.length&&O.size>0)le();else if(E<S.length){let e=S[E];e&&(e.isInstalled?i({type:`manage-plugins`,targetPlugin:e.entry.name,targetMarketplace:e.marketplaceName}):(v(e),p(`plugin-details`),ae(0),P(null)))}}},{context:`Select`,isActive:f===`plugin-list`}),z({"plugin:toggle":()=>{if(E<S.length){let e=S[E];if(e&&!e.isInstalled){let t=new Set(O);t.has(e.pluginId)?t.delete(e.pluginId):t.add(e.pluginId),k(t)}}},"plugin:install":()=>{O.size>0&&le()}},{context:`Plugin`,isActive:f===`plugin-list`});let de=jn.useMemo(()=>{if(!_)return[];let e=_.entry.homepage;return Sn(e,xn(_))},[_]);if(z({"select:previous":()=>{M>0&&ae(M-1)},"select:next":()=>{M<de.length-1&&ae(M+1)},"select:accept":()=>{if(!_)return;let e=de[M]?.action,t=_.entry.homepage,n=xn(_);e===`install-user`?ue(_,`user`):e===`install-project`?ue(_,`project`):e===`install-local`?ue(_,`local`):e===`homepage`&&t?De(t):e===`github`&&n?De(`https://github.com/${n}`):e===`back`&&(p(`plugin-list`),v(null))}},{context:`Select`,isActive:f===`plugin-details`&&!!_}),typeof f==`object`&&f.type===`plugin-options`){let{plugin:e,pluginId:t}=f;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)(V,{children:`Loading…`});if(e)return(0,G.jsx)(V,{color:`error`,children:e});if(f===`marketplace-list`)return y.length===0?(0,G.jsxs)(B,{flexDirection:`column`,children:[(0,G.jsx)(B,{marginBottom:1,children:(0,G.jsx)(V,{bold:!0,children:`Select marketplace`})}),(0,G.jsx)(V,{children:`No marketplaces configured.`}),(0,G.jsxs)(V,{dimColor:!0,children:[`Add a marketplace first using `,`'Add marketplace'`,`.`]}),(0,G.jsx)(B,{marginTop:1,paddingLeft:1,children:(0,G.jsx)(V,{dimColor:!0,children:(0,G.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})})})]}):(0,G.jsxs)(B,{flexDirection:`column`,children:[(0,G.jsx)(B,{marginBottom:1,children:(0,G.jsx)(V,{bold:!0,children:`Select marketplace`})}),F&&(0,G.jsx)(B,{marginBottom:1,flexDirection:`column`,children:(0,G.jsxs)(V,{color:`warning`,children:[a.warning,` `,F]})}),y.map((e,t)=>(0,G.jsxs)(B,{flexDirection:`column`,marginBottom:+(t<y.length-1),children:[(0,G.jsx)(B,{children:(0,G.jsxs)(V,{color:E===t?`suggestion`:void 0,children:[E===t?a.pointer:` `,` `,e.name]})}),(0,G.jsx)(B,{marginLeft:2,children:(0,G.jsxs)(V,{dimColor:!0,children:[e.totalPlugins,` `,gt(e.totalPlugins,`plugin`),` available`,e.installedCount>0&&` · ${e.installedCount} already installed`,e.source&&` · ${e.source}`]})})]},e.name)),(0,G.jsx)(B,{marginTop:1,children:(0,G.jsx)(V,{dimColor:!0,italic:!0,children:(0,G.jsxs)(Pe,{children:[(0,G.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,G.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]})})})]});if(f===`plugin-details`&&_){let e=_.entry.homepage,t=Sn(e,xn(_));return(0,G.jsxs)(B,{flexDirection:`column`,children:[(0,G.jsx)(B,{marginBottom:1,children:(0,G.jsx)(V,{bold:!0,children:`Plugin Details`})}),(0,G.jsxs)(B,{flexDirection:`column`,marginBottom:1,children:[(0,G.jsx)(V,{bold:!0,children:_.entry.name}),_.entry.version&&(0,G.jsxs)(V,{dimColor:!0,children:[`Version: `,_.entry.version]}),_.entry.description&&(0,G.jsx)(B,{marginTop:1,children:(0,G.jsx)(V,{children:_.entry.description})}),_.entry.author&&(0,G.jsx)(B,{marginTop:1,children:(0,G.jsxs)(V,{dimColor:!0,children:[`By:`,` `,typeof _.entry.author==`string`?_.entry.author:_.entry.author.name]})})]}),(0,G.jsxs)(B,{flexDirection:`column`,marginBottom:1,children:[(0,G.jsx)(V,{bold:!0,children:`Will install:`}),_.entry.commands&&(0,G.jsxs)(V,{dimColor:!0,children:[`· Commands:`,` `,Array.isArray(_.entry.commands)?_.entry.commands.join(`, `):Object.keys(_.entry.commands).join(`, `)]}),_.entry.agents&&(0,G.jsxs)(V,{dimColor:!0,children:[`· Agents:`,` `,Array.isArray(_.entry.agents)?_.entry.agents.join(`, `):Object.keys(_.entry.agents).join(`, `)]}),_.entry.hooks&&(0,G.jsxs)(V,{dimColor:!0,children:[`· Hooks: `,Object.keys(_.entry.hooks).join(`, `)]}),_.entry.mcpServers&&(0,G.jsxs)(V,{dimColor:!0,children:[`· MCP Servers:`,` `,Array.isArray(_.entry.mcpServers)?_.entry.mcpServers.join(`, `):typeof _.entry.mcpServers==`object`?Object.keys(_.entry.mcpServers).join(`, `):`configured`]}),!_.entry.commands&&!_.entry.agents&&!_.entry.hooks&&!_.entry.mcpServers&&(0,G.jsx)(G.Fragment,{children:typeof _.entry.source==`object`&&`source`in _.entry.source&&(_.entry.source.source===`github`||_.entry.source.source===`url`||_.entry.source.source===`npm`||_.entry.source.source===`pip`)?(0,G.jsx)(V,{dimColor:!0,children:`· Component summary not available for remote plugin`}):(0,G.jsx)(V,{dimColor:!0,children:`· Components will be discovered at installation`})})]}),(0,G.jsx)(vn,{}),ce&&(0,G.jsx)(B,{marginBottom:1,children:(0,G.jsxs)(V,{color:`error`,children:[`Error: `,ce]})}),(0,G.jsx)(B,{flexDirection:`column`,children:t.map((e,t)=>(0,G.jsxs)(B,{children:[M===t&&(0,G.jsx)(V,{children:`> `}),M!==t&&(0,G.jsx)(V,{children:` `}),(0,G.jsx)(V,{bold:M===t,children:oe&&e.action===`install`?`Installing…`:e.label})]},e.action))}),(0,G.jsx)(B,{marginTop:1,paddingLeft:1,children:(0,G.jsx)(V,{dimColor:!0,children:(0,G.jsxs)(Pe,{children:[(0,G.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,G.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}if(S.length===0)return(0,G.jsxs)(B,{flexDirection:`column`,children:[(0,G.jsx)(B,{marginBottom:1,children:(0,G.jsx)(V,{bold:!0,children:`Install plugins`})}),(0,G.jsx)(V,{dimColor:!0,children:`No new plugins available to install.`}),(0,G.jsx)(V,{dimColor:!0,children:`All plugins from this marketplace are already installed.`}),(0,G.jsx)(B,{marginLeft:3,children:(0,G.jsx)(V,{dimColor:!0,italic:!0,children:(0,G.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})})})]});let fe=j.getVisibleItems(S);return(0,G.jsxs)(B,{flexDirection:`column`,children:[(0,G.jsx)(B,{marginBottom:1,children:(0,G.jsx)(V,{bold:!0,children:`Install Plugins`})}),j.scrollPosition.canScrollUp&&(0,G.jsx)(B,{children:(0,G.jsxs)(V,{dimColor:!0,children:[` `,a.arrowUp,` more above`]})}),fe.map((t,n)=>{let r=j.toActualIndex(n),i=E===r,o=O.has(t.pluginId),s=A.has(t.pluginId);return(0,G.jsxs)(B,{flexDirection:`column`,marginBottom:n===fe.length-1&&!e?0:1,children:[(0,G.jsxs)(B,{children:[(0,G.jsxs)(V,{color:i?`suggestion`:void 0,children:[i?a.pointer:` `,` `]}),(0,G.jsxs)(V,{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)(V,{dimColor:!0,children:[` [`,t.entry.category,`]`]}),t.entry.tags?.includes(`community-managed`)&&(0,G.jsx)(V,{dimColor:!0,children:` [Community Managed]`}),t.isInstalled&&(0,G.jsx)(V,{dimColor:!0,children:` (installed)`}),w&&m===`claude-plugins-official`&&(0,G.jsxs)(V,{dimColor:!0,children:[` · `,Mt(w.get(t.pluginId)??0),` installs`]})]})]}),t.entry.description&&(0,G.jsxs)(B,{marginLeft:4,children:[(0,G.jsx)(V,{dimColor:!0,children:mt(t.entry.description,60)}),t.entry.version&&(0,G.jsxs)(V,{dimColor:!0,children:[` · v`,t.entry.version]})]})]},t.pluginId)}),j.scrollPosition.canScrollDown&&(0,G.jsx)(B,{children:(0,G.jsxs)(V,{dimColor:!0,children:[` `,a.arrowDown,` more below`]})}),e&&(0,G.jsx)(B,{marginTop:1,children:(0,G.jsxs)(V,{color:`error`,children:[a.cross,` `,e]})}),(0,G.jsx)(Cn,{hasSelection:O.size>0})]})}var jn,W,G,Mn=e((()=>{i(),jn=t(H(),1),W=t(H(),1),v(),Ue(),s(),tt(),O(),Qe(),Je(),j(),kt(),Ee(),ve(),Ae(),w(),D(),k(),_t(),ht(),_n(),bn(),Tn(),kn(),G=Ke()}));function Nn({error:e,setError:t,result:n,setResult:r,setViewState:i,onInstallComplete:s,onSearchModeChange:c,targetPlugin:d}){let[f,p]=(0,K.useState)(`plugin-list`),[m,h]=(0,K.useState)(null),[g,_]=(0,K.useState)([]),[v,y]=(0,K.useState)(!0),[b,x]=(0,K.useState)(null),[S,te]=(0,K.useState)(!1),C=(0,K.useCallback)(e=>{te(e),c?.(e)},[c]),{query:w,setQuery:T,cursorOffset:E}=Wt({isActive:f===`plugin-list`&&S&&!v,onExit:()=>{C(!1)}}),D=Ie(),{columns:O}=Ve(),k=(0,K.useMemo)(()=>{if(!w)return g;let e=w.toLowerCase();return g.filter(t=>t.entry.name.toLowerCase().includes(e)||t.entry.description?.toLowerCase().includes(e)||t.marketplaceName.toLowerCase().includes(e))},[g,w]),[A,ie]=(0,K.useState)(0),[j,M]=(0,K.useState)(new Set),[ae,oe]=(0,K.useState)(new Set),N=En({totalItems:k.length,selectedIndex:A});(0,K.useEffect)(()=>{ie(0)},[w]);let[ce,P]=(0,K.useState)(0),[F,I]=(0,K.useState)(!1),[le,ue]=(0,K.useState)(null),[de,fe]=(0,K.useState)(null),[pe,me]=(0,K.useState)(null);(0,K.useEffect)(()=>{async function e(){try{let e=await l(),{marketplaces:n,failures:r}=await re(e),i=[];for(let{name:e,data:t}of n)if(t)for(let n of t.plugins){let t=ne(n.name,e);i.push({entry:n,marketplaceName:e,pluginId:t,isInstalled:u(t)})}let a=i.filter(e=>!e.isInstalled&&!Oe(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){Ze(`Failed to fetch install counts: ${qe(e)}`),a.sort((e,t)=>e.entry.name.localeCompare(t.entry.name))}_(a);let o=Object.keys(e).length;if(a.length===0){let e=await ee({configuredMarketplaceCount:o,failedMarketplaceCount:r.length});me(e)}let s=se(r,et(n,e=>e.data!==null));if(s)if(s.type===`warning`)fe(s.message+`. Showing available plugins.`);else throw Error(s.message);if(d){let e=i.find(e=>e.entry.name===d);e?e.isInstalled?t(`Plugin '${e.pluginId}' is already installed. Use '/plugin' to manage existing plugins.`):(h(e),p(`plugin-details`)):t(`Plugin "${d}" not found in any marketplace`)}}catch(e){t(e instanceof Error?e.message:`Failed to load plugins`)}finally{y(!1)}}e()},[t,d]);let he=async()=>{if(j.size===0)return;let e=g.filter(e=>j.has(e.pluginId));oe(new Set(e.map(e=>e.pluginId)));let n=0,a=0,c=[];for(let t of e){let e=await Te({pluginId:t.pluginId,entry:t.entry,marketplaceName:t.marketplaceName,scope:`user`});e.success?n++:(a++,c.push({name:t.entry.name,reason:e.error}))}oe(new Set),M(new Set),xe(),a===0?r(`✓ Installed ${n} ${gt(n,`plugin`)}. Run /reload-plugins to activate.`):n===0?t(`Failed to install: ${o(c,!0)}`):r(`✓ Installed ${n} of ${n+a} plugins. Failed: ${o(c,!1)}. Run /reload-plugins to activate successfully installed plugins.`),n>0&&s&&await s(),i({type:`menu`})},ge=async(e,t=`user`)=>{I(!0),ue(null);let n=await Te({pluginId:e.pluginId,entry:e.entry,marketplaceName:e.marketplaceName,scope:t});if(n.success){let t=await pn(e.pluginId);if(t){I(!1),p({type:`plugin-options`,plugin:t,pluginId:e.pluginId});return}r(n.message),s&&await s(),i({type:`menu`})}else I(!1),ue(n.error)};(0,K.useEffect)(()=>{e&&r(e)},[e,r]),Fe(`confirm:no`,()=>{p(`plugin-list`),h(null)},{context:`Confirmation`,isActive:f===`plugin-details`}),Fe(`confirm:no`,()=>{i({type:`menu`})},{context:`Confirmation`,isActive:f===`plugin-list`&&!S}),Le((e,t)=>{let n=!t.ctrl&&!t.meta;S||(e===`/`&&n?(C(!0),T(``)):n&&e.length>0&&!/^\s+$/.test(e)&&e!==`j`&&e!==`k`&&e!==`i`&&(C(!0),T(e)))},{isActive:f===`plugin-list`&&!v}),z({"select:previous":()=>{A===0?C(!0):N.handleSelectionChange(A-1,ie)},"select:next":()=>{A<k.length-1&&N.handleSelectionChange(A+1,ie)},"select:accept":()=>{if(A===k.length&&j.size>0)he();else if(A<k.length){let e=k[A];e&&(e.isInstalled?i({type:`manage-plugins`,targetPlugin:e.entry.name,targetMarketplace:e.marketplaceName}):(h(e),p(`plugin-details`),P(0),ue(null)))}}},{context:`Select`,isActive:f===`plugin-list`&&!S}),z({"plugin:toggle":()=>{if(A<k.length){let e=k[A];if(e&&!e.isInstalled){let t=new Set(j);t.has(e.pluginId)?t.delete(e.pluginId):t.add(e.pluginId),M(t)}}},"plugin:install":()=>{j.size>0&&he()}},{context:`Plugin`,isActive:f===`plugin-list`&&!S});let _e=In.useMemo(()=>{if(!m)return[];let e=m.entry.homepage;return Sn(e,xn(m))},[m]);if(z({"select:previous":()=>{ce>0&&P(ce-1)},"select:next":()=>{ce<_e.length-1&&P(ce+1)},"select:accept":()=>{if(!m)return;let e=_e[ce]?.action,t=m.entry.homepage,n=xn(m);e===`install-user`?ge(m,`user`):e===`install-project`?ge(m,`project`):e===`install-local`?ge(m,`local`):e===`homepage`&&t?De(t):e===`github`&&n?De(`https://github.com/${n}`):e===`back`&&(p(`plugin-list`),h(null))}},{context:`Select`,isActive:f===`plugin-details`&&!!m}),typeof f==`object`&&f.type===`plugin-options`){let{plugin:e,pluginId:t}=f;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)(V,{children:`Loading…`});if(e)return(0,q.jsx)(V,{color:`error`,children:e});if(f===`plugin-details`&&m){let e=m.entry.homepage,t=Sn(e,xn(m));return(0,q.jsxs)(B,{flexDirection:`column`,children:[(0,q.jsx)(B,{marginBottom:1,children:(0,q.jsx)(V,{bold:!0,children:`Plugin details`})}),(0,q.jsxs)(B,{flexDirection:`column`,marginBottom:1,children:[(0,q.jsx)(V,{bold:!0,children:m.entry.name}),(0,q.jsxs)(V,{dimColor:!0,children:[`from `,m.marketplaceName]}),m.entry.version&&(0,q.jsxs)(V,{dimColor:!0,children:[`Version: `,m.entry.version]}),m.entry.description&&(0,q.jsx)(B,{marginTop:1,children:(0,q.jsx)(V,{children:m.entry.description})}),m.entry.author&&(0,q.jsx)(B,{marginTop:1,children:(0,q.jsxs)(V,{dimColor:!0,children:[`By:`,` `,typeof m.entry.author==`string`?m.entry.author:m.entry.author.name]})})]}),(0,q.jsx)(vn,{}),le&&(0,q.jsx)(B,{marginBottom:1,children:(0,q.jsxs)(V,{color:`error`,children:[`Error: `,le]})}),(0,q.jsx)(B,{flexDirection:`column`,children:t.map((e,t)=>(0,q.jsxs)(B,{children:[ce===t&&(0,q.jsx)(V,{children:`> `}),ce!==t&&(0,q.jsx)(V,{children:` `}),(0,q.jsx)(V,{bold:ce===t,children:F&&e.action.startsWith(`install-`)?`Installing…`:e.label})]},e.action))}),(0,q.jsx)(B,{marginTop:1,children:(0,q.jsx)(V,{dimColor:!0,children:(0,q.jsxs)(Pe,{children:[(0,q.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,q.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}if(g.length===0)return(0,q.jsxs)(B,{flexDirection:`column`,children:[(0,q.jsx)(B,{marginBottom:1,children:(0,q.jsx)(V,{bold:!0,children:`Discover plugins`})}),(0,q.jsx)(Fn,{reason:pe}),(0,q.jsx)(B,{marginTop:1,children:(0,q.jsx)(V,{dimColor:!0,italic:!0,children:`Esc to go back`})})]});let ve=N.getVisibleItems(k);return(0,q.jsxs)(B,{flexDirection:`column`,children:[(0,q.jsxs)(B,{children:[(0,q.jsx)(V,{bold:!0,children:`Discover plugins`}),N.needsPagination&&(0,q.jsxs)(V,{dimColor:!0,children:[` `,`(`,N.scrollPosition.current,`/`,N.scrollPosition.total,`)`]})]}),(0,q.jsx)(B,{marginBottom:1,children:(0,q.jsx)(ze,{query:w,isFocused:S,isTerminalFocused:D,width:O-4,cursorOffset:E})}),de&&(0,q.jsx)(B,{marginBottom:1,children:(0,q.jsxs)(V,{color:`warning`,children:[a.warning,` `,de]})}),k.length===0&&w&&(0,q.jsx)(B,{marginBottom:1,children:(0,q.jsxs)(V,{dimColor:!0,children:[`No plugins match "`,w,`"`]})}),N.scrollPosition.canScrollUp&&(0,q.jsx)(B,{children:(0,q.jsxs)(V,{dimColor:!0,children:[` `,a.arrowUp,` more above`]})}),ve.map((t,n)=>{let r=N.toActualIndex(n),i=A===r,o=j.has(t.pluginId),s=ae.has(t.pluginId);return(0,q.jsxs)(B,{flexDirection:`column`,marginBottom:n===ve.length-1&&!e?0:1,children:[(0,q.jsxs)(B,{children:[(0,q.jsxs)(V,{color:i&&!S?`suggestion`:void 0,children:[i&&!S?a.pointer:` `,` `]}),(0,q.jsxs)(V,{children:[s?a.ellipsis:o?a.radioOn:a.radioOff,` `,t.entry.name,(0,q.jsxs)(V,{dimColor:!0,children:[` · `,t.marketplaceName]}),t.entry.tags?.includes(`community-managed`)&&(0,q.jsx)(V,{dimColor:!0,children:` [Community Managed]`}),b&&t.marketplaceName===`claude-plugins-official`&&(0,q.jsxs)(V,{dimColor:!0,children:[` · `,Mt(b.get(t.pluginId)??0),` installs`]})]})]}),t.entry.description&&(0,q.jsx)(B,{marginLeft:4,children:(0,q.jsx)(V,{dimColor:!0,children:mt(t.entry.description,60)})})]},`${N.startIndex}-${t.pluginId}`)}),N.scrollPosition.canScrollDown&&(0,q.jsx)(B,{children:(0,q.jsxs)(V,{dimColor:!0,children:[` `,a.arrowDown,` more below`]})}),e&&(0,q.jsx)(B,{marginTop:1,children:(0,q.jsxs)(V,{color:`error`,children:[a.cross,` `,e]})}),(0,q.jsx)(Pn,{hasSelection:j.size>0,canToggle:A<k.length&&!k[A]?.isInstalled})]})}function Pn({hasSelection:e,canToggle:t}){return(0,q.jsx)(B,{marginTop:1,children:(0,q.jsx)(V,{dimColor:!0,italic:!0,children:(0,q.jsxs)(Pe,{children:[e&&(0,q.jsx)(L,{action:`plugin:install`,context:`Plugin`,fallback:`i`,description:`install`,bold:!0}),(0,q.jsx)(V,{children:`type to search`}),t&&(0,q.jsx)(L,{action:`plugin:toggle`,context:`Plugin`,fallback:`Space`,description:`toggle`}),(0,q.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`details`}),(0,q.jsx)(L,{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)(V,{dimColor:!0,children:`Git is required to install marketplaces.`}),(0,q.jsx)(V,{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)(V,{dimColor:!0,children:`Your organization policy does not allow any external marketplaces.`}),(0,q.jsx)(V,{dimColor:!0,children:`Contact your administrator.`})]});case`policy-restricts-sources`:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(V,{dimColor:!0,children:`Your organization restricts which marketplaces can be added.`}),(0,q.jsx)(V,{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)(V,{dimColor:!0,children:`Failed to load marketplace data.`}),(0,q.jsx)(V,{dimColor:!0,children:`Check your network connection.`})]});case`all-plugins-installed`:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(V,{dimColor:!0,children:`All available plugins are already installed.`}),(0,q.jsx)(V,{dimColor:!0,children:`Check for new plugins later or add more marketplaces.`})]});default:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(V,{dimColor:!0,children:`No plugins available.`}),(0,q.jsx)(V,{dimColor:!0,children:`Add a marketplace first using the Marketplaces tab.`})]})}}var In,K,q,Ln=e((()=>{i(),In=t(H(),1),K=t(H(),1),v(),Ut(),Ue(),Gt(),m(),s(),tt(),O(),Qe(),Je(),j(),kt(),Ee(),ve(),Ae(),w(),D(),k(),_t(),ht(),_n(),bn(),Tn(),kn(),q=Ke()}));function Rn({setViewState:e,error:t,setError:n,setResult:r,exitState:i,onManageComplete:o,targetMarketplace:s,action:c}){let[u,d]=(0,Bn.useState)([]),[f,m]=(0,Bn.useState)(!0),[h,_]=(0,Bn.useState)(0),[v,y]=(0,Bn.useState)(!1),[b,x]=(0,Bn.useState)(null),[S,ee]=(0,Bn.useState)(null),[te,w]=(0,Bn.useState)(null),[T,E]=(0,Bn.useState)(`list`),[D,O]=(0,Bn.useState)(null),[k,A]=(0,Bn.useState)(0),ie=(0,Bn.useRef)(!1);(0,Bn.useEffect)(()=>{async function e(){try{let e=await l(),{enabled:r,disabled:i}=await ce(),a=[...r,...i],{marketplaces:o,failures:u}=await re(e),f=[];for(let{name:e,config:t,data:n}of o){let r=a.filter(t=>t.source.endsWith(`@${e}`));f.push({name:e,source:Ce(t.source),lastUpdated:t.lastUpdated,pluginCount:n?.plugins.length,installedPlugins:r,pendingUpdate:!1,pendingRemove:!1,autoUpdate:st(e,t)})}f.sort((e,t)=>e.name===`claude-plugin-directory`?-1:t.name===`claude-plugin-directory`?1:e.name.localeCompare(t.name)),d(f);let p=se(u,et(o,e=>e.data!==null));if(p)if(p.type===`warning`)x(p.message);else throw Error(p.message);if(s&&!ie.current&&!t){ie.current=!0;let e=f.findIndex(e=>e.name===s);if(e>=0){let t=f[e];if(c){_(e+1);let t=[...f];c===`update`?t[e].pendingUpdate=!0:c===`remove`&&(t[e].pendingRemove=!0),d(t),setTimeout(ae,100,t)}else t&&(_(e+1),O(t),E(`details`))}else n&&n(`Marketplace not found: ${s}`)}}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()},[s,c,t]);let j=()=>u.some(e=>e.pendingUpdate||e.pendingRemove),M=()=>({updateCount:et(u,e=>e.pendingUpdate),removeCount:et(u,e=>e.pendingRemove)}),ae=async t=>{let i=t||u,s=T===`details`;y(!0),x(null),ee(null),w(null);try{let t=nt(`userSettings`),n=0,c=0,u=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=ne(t.name,e.name);n[r]=!1}ot(`userSettings`,{enabledPlugins:n})}await p(e.name),c++,pt(`tengu_marketplace_removed`,{marketplace_name:e.name,plugins_uninstalled:e.installedPlugins?.length||0});continue}e.pendingUpdate&&(await C(e.name,e=>{w(e)}),n++,u.add(e.name.toLowerCase()),pt(`tengu_marketplace_updated`,{marketplace_name:e.name}))}let f=0;u.size>0&&(f=(await en(u)).length),xe(),o&&await o();let m=await l(),{enabled:h,disabled:g}=await ce(),_=[...h,...g],{marketplaces:v}=await re(m),y=[];for(let{name:e,config:t,data:n}of v){let r=_.filter(t=>t.source.endsWith(`@${e}`));y.push({name:e,source:Ce(t.source),lastUpdated:t.lastUpdated,pluginCount:n?.plugins.length,installedPlugins:r,pendingUpdate:!1,pendingRemove:!1,autoUpdate:st(e,t)})}if(y.sort((e,t)=>e.name===`claude-plugin-directory`?-1:t.name===`claude-plugin-directory`?1:e.name.localeCompare(t.name)),d(y),s&&D){let e=y.find(e=>e.name===D.name);e&&O(e)}let b=[];if(n>0){let e=f>0?` (${f} ${gt(f,`plugin`)} bumped)`:``;b.push(`Updated ${n} ${gt(n,`marketplace`)}${e}`)}if(c>0&&b.push(`Removed ${c} ${gt(c,`marketplace`)}`),b.length>0){let t=`${a.tick} ${b.join(`, `)}`;s?ee(t):(r(t),setTimeout(e,2e3,{type:`menu`}))}else s||e({type:`menu`})}catch(e){let t=qe(e);x(t),n&&n(t)}finally{y(!1),w(null)}},oe=async()=>{if(!D)return;let e=u.map(e=>e.name===D.name?{...e,pendingRemove:!0}:e);d(e),await ae(e)},N=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 ct()||t.push({label:e.autoUpdate?`Disable auto-update`:`Enable auto-update`,value:`toggle-auto-update`}),t.push({label:`Remove marketplace`,value:`remove`}),t},P=async e=>{let t=!e.autoUpdate;try{await g(e.name,t),d(n=>n.map(n=>n.name===e.name?{...n,autoUpdate:t}:n)),O(e=>e&&{...e,autoUpdate:t})}catch(e){x(e instanceof Error?e.message:`Failed to update setting`)}};if(Fe(`confirm:no`,()=>{E(`list`),A(0)},{context:`Confirmation`,isActive:!v&&(T===`details`||T===`confirm-remove`)}),Fe(`confirm:no`,()=>{d(e=>e.map(e=>({...e,pendingUpdate:!1,pendingRemove:!1}))),_(0)},{context:`Confirmation`,isActive:!v&&T===`list`&&j()}),Fe(`confirm:no`,()=>{e({type:`menu`})},{context:`Confirmation`,isActive:!v&&T===`list`&&!j()}),z({"select:previous":()=>_(e=>Math.max(0,e-1)),"select:next":()=>{let e=u.length+1;_(t=>Math.min(e-1,t+1))},"select:accept":()=>{let t=h-1;if(h===0)e({type:`add-marketplace`});else if(j())ae();else{let e=u[t];e&&(O(e),E(`details`),A(0))}}},{context:`Select`,isActive:!v&&T===`list`}),Le(e=>{let t=h-1;if((e===`u`||e===`U`)&&t>=0)d(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=u[t];e&&(O(e),E(`confirm-remove`))}},{isActive:!v&&T===`list`}),z({"select:previous":()=>A(e=>Math.max(0,e-1)),"select:next":()=>{let e=N(D);A(t=>Math.min(e.length-1,t+1))},"select:accept":()=>{if(!D)return;let t=N(D)[k];if(t?.value===`browse`)e({type:`browse-marketplace`,targetMarketplace:D.name});else if(t?.value===`update`){let e=u.map(e=>e.name===D.name?{...e,pendingUpdate:!0}:e);d(e),ae(e)}else t?.value===`toggle-auto-update`?P(D):t?.value===`remove`&&E(`confirm-remove`)}},{context:`Select`,isActive:!v&&T===`details`}),Le(e=>{e===`y`||e===`Y`?oe():(e===`n`||e===`N`)&&(E(`list`),O(null))},{isActive:!v&&T===`confirm-remove`}),f)return(0,J.jsx)(V,{children:`Loading marketplaces…`});if(u.length===0)return(0,J.jsxs)(B,{flexDirection:`column`,children:[(0,J.jsx)(B,{marginBottom:1,children:(0,J.jsx)(V,{bold:!0,children:`Manage marketplaces`})}),(0,J.jsxs)(B,{flexDirection:`row`,gap:1,children:[(0,J.jsxs)(V,{color:`suggestion`,children:[a.pointer,` +`]}),(0,J.jsx)(V,{bold:!0,color:`suggestion`,children:`Add Marketplace`})]}),(0,J.jsx)(B,{marginLeft:3,children:(0,J.jsx)(V,{dimColor:!0,italic:!0,children:i.pending?(0,J.jsxs)(J.Fragment,{children:[`Press `,i.keyName,` again to go back`]}):(0,J.jsxs)(Pe,{children:[(0,J.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,J.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]})})})]});if(T===`confirm-remove`&&D){let e=D.installedPlugins?.length||0;return(0,J.jsxs)(B,{flexDirection:`column`,children:[(0,J.jsxs)(V,{bold:!0,color:`warning`,children:[`Remove marketplace `,(0,J.jsx)(V,{italic:!0,children:D.name}),`?`]}),(0,J.jsxs)(B,{flexDirection:`column`,children:[e>0&&(0,J.jsx)(B,{marginTop:1,children:(0,J.jsxs)(V,{color:`warning`,children:[`This will also uninstall `,e,` `,gt(e,`plugin`),` from this marketplace:`]})}),D.installedPlugins&&D.installedPlugins.length>0&&(0,J.jsx)(B,{flexDirection:`column`,marginTop:1,marginLeft:2,children:D.installedPlugins.map(e=>(0,J.jsxs)(V,{dimColor:!0,children:[`• `,e.name]},e.name))}),(0,J.jsx)(B,{marginTop:1,children:(0,J.jsxs)(V,{children:[`Press `,(0,J.jsx)(V,{bold:!0,children:`y`}),` to confirm or `,(0,J.jsx)(V,{bold:!0,children:`n`}),` to cancel`]})})]})]})}if(T===`details`&&D){let e=D.pendingUpdate||v,t=N(D);return(0,J.jsxs)(B,{flexDirection:`column`,children:[(0,J.jsx)(V,{bold:!0,children:D.name}),(0,J.jsx)(V,{dimColor:!0,children:D.source}),(0,J.jsx)(B,{marginTop:1,children:(0,J.jsxs)(V,{children:[D.pluginCount||0,` available `,gt(D.pluginCount||0,`plugin`)]})}),D.installedPlugins&&D.installedPlugins.length>0&&(0,J.jsxs)(B,{flexDirection:`column`,marginTop:1,children:[(0,J.jsxs)(V,{bold:!0,children:[`Installed plugins (`,D.installedPlugins.length,`):`]}),(0,J.jsx)(B,{flexDirection:`column`,marginLeft:1,children:D.installedPlugins.map(e=>(0,J.jsxs)(B,{flexDirection:`row`,gap:1,children:[(0,J.jsx)(V,{children:a.bullet}),(0,J.jsxs)(B,{flexDirection:`column`,children:[(0,J.jsx)(V,{children:e.name}),(0,J.jsx)(V,{dimColor:!0,children:e.manifest.description})]})]},e.name))})]}),e&&(0,J.jsxs)(B,{marginTop:1,flexDirection:`column`,children:[(0,J.jsx)(V,{color:`claude`,children:`Updating marketplace…`}),te&&(0,J.jsx)(V,{dimColor:!0,children:te})]}),!e&&S&&(0,J.jsx)(B,{marginTop:1,children:(0,J.jsx)(V,{color:`claude`,children:S})}),!e&&b&&(0,J.jsx)(B,{marginTop:1,children:(0,J.jsx)(V,{color:`error`,children:b})}),!e&&(0,J.jsx)(B,{flexDirection:`column`,marginTop:1,children:t.map((e,t)=>{if(!e)return null;let n=t===k;return(0,J.jsxs)(B,{children:[(0,J.jsxs)(V,{color:n?`suggestion`:void 0,children:[n?a.pointer:` `,` `,e.label]}),e.secondaryLabel&&(0,J.jsxs)(V,{dimColor:!0,children:[` `,e.secondaryLabel]})]},e.value)})}),!e&&!ct()&&D.autoUpdate&&(0,J.jsx)(B,{marginTop:1,children:(0,J.jsx)(V,{dimColor:!0,children:`Auto-update enabled. Work Mate will automatically update this marketplace and its installed plugins.`})}),(0,J.jsx)(B,{marginLeft:3,children:(0,J.jsx)(V,{dimColor:!0,italic:!0,children:e?(0,J.jsx)(J.Fragment,{children:`Please wait…`}):(0,J.jsxs)(Pe,{children:[(0,J.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,J.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]})})})]})}let{updateCount:F,removeCount:I}=M();return(0,J.jsxs)(B,{flexDirection:`column`,children:[(0,J.jsx)(B,{marginBottom:1,children:(0,J.jsx)(V,{bold:!0,children:`Manage marketplaces`})}),(0,J.jsxs)(B,{flexDirection:`row`,gap:1,marginBottom:1,children:[(0,J.jsxs)(V,{color:h===0?`suggestion`:void 0,children:[h===0?a.pointer:` `,` +`]}),(0,J.jsx)(V,{bold:!0,color:h===0?`suggestion`:void 0,children:`Add Marketplace`})]}),(0,J.jsx)(B,{flexDirection:`column`,children:u.map((e,t)=>{let n=t+1===h,r=[];return e.pendingUpdate&&r.push(`UPDATE`),e.pendingRemove&&r.push(`REMOVE`),(0,J.jsxs)(B,{flexDirection:`row`,gap:1,marginBottom:1,children:[(0,J.jsxs)(V,{color:n?`suggestion`:void 0,children:[n?a.pointer:` `,` `,e.pendingRemove?a.cross:a.bullet]}),(0,J.jsxs)(B,{flexDirection:`column`,flexGrow:1,children:[(0,J.jsxs)(B,{flexDirection:`row`,gap:1,children:[(0,J.jsxs)(V,{bold:!0,strikethrough:e.pendingRemove,dimColor:e.pendingRemove,children:[e.name===`claude-plugins-official`&&(0,J.jsx)(V,{color:`claude`,children:`✻ `}),e.name,e.name===`claude-plugins-official`&&(0,J.jsx)(V,{color:`claude`,children:` ✻`})]}),r.length>0&&(0,J.jsxs)(V,{color:`warning`,children:[`[`,r.join(`, `),`]`]})]}),(0,J.jsx)(V,{dimColor:!0,children:e.source}),(0,J.jsxs)(V,{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)})}),j()&&(0,J.jsxs)(B,{marginTop:1,flexDirection:`column`,children:[(0,J.jsxs)(V,{children:[(0,J.jsx)(V,{bold:!0,children:`Pending changes:`}),` `,(0,J.jsx)(V,{dimColor:!0,children:`Enter to apply`})]}),F>0&&(0,J.jsxs)(V,{children:[`• Update `,F,` `,gt(F,`marketplace`)]}),I>0&&(0,J.jsxs)(V,{color:`warning`,children:[`• Remove `,I,` `,gt(I,`marketplace`)]})]}),v&&(0,J.jsx)(B,{marginTop:1,children:(0,J.jsx)(V,{color:`claude`,children:`Processing changes…`})}),b&&(0,J.jsx)(B,{marginTop:1,children:(0,J.jsx)(V,{color:`error`,children:b})}),(0,J.jsx)(zn,{exitState:i,hasPendingActions:j()})]})}function zn({exitState:e,hasPendingActions:t}){return e.pending?(0,J.jsx)(B,{marginTop:1,children:(0,J.jsxs)(V,{dimColor:!0,italic:!0,children:[`Press `,e.keyName,` again to go back`]})}):(0,J.jsx)(B,{marginTop:1,children:(0,J.jsx)(V,{dimColor:!0,italic:!0,children:(0,J.jsxs)(Pe,{children:[t&&(0,J.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`apply changes`}),!t&&(0,J.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),!t&&(0,J.jsx)(je,{shortcut:`u`,action:`update`}),!t&&(0,J.jsx)(je,{shortcut:`r`,action:`remove`}),(0,J.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:t?`cancel`:`go back`})]})})})}var Bn,J,Vn=e((()=>{i(),H(),Bn=t(H(),1),ft(),v(),Ue(),s(),tt(),lt(),Je(),j(),ve(),Ae(),tn(),ae(),at(),it(),_t(),J=Ke()}));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 _e(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((()=>{I()}));function Gn({item:e,isSelected:t}){let[n]=Ne();if(e.type===`plugin`){let r,i;return e.pendingToggle?(r=Re(`suggestion`,n)(a.arrowRight),i=e.pendingToggle===`will-enable`?`will enable`:`will disable`):e.errorCount>0?(r=Re(`error`,n)(a.cross),i=`${e.errorCount} ${gt(e.errorCount,`error`)}`):e.isEnabled?(r=Re(`success`,n)(a.tick),i=`enabled`):(r=Re(`inactive`,n)(a.radioOff),i=`disabled`),(0,Y.jsxs)(B,{children:[(0,Y.jsx)(V,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(V,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(V,{dimColor:!t,children:[` `,(0,Y.jsx)(V,{backgroundColor:`userMessageBackground`,children:`Plugin`})]}),(0,Y.jsxs)(V,{dimColor:!0,children:[` · `,e.marketplace]}),(0,Y.jsxs)(V,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(V,{dimColor:!t,children:i})]})}if(e.type===`flagged-plugin`){let r=Re(`warning`,n)(a.warning);return(0,Y.jsxs)(B,{children:[(0,Y.jsx)(V,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(V,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(V,{dimColor:!t,children:[` `,(0,Y.jsx)(V,{backgroundColor:`userMessageBackground`,children:`Plugin`})]}),(0,Y.jsxs)(V,{dimColor:!0,children:[` · `,e.marketplace]}),(0,Y.jsxs)(V,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(V,{dimColor:!t,children:`removed`})]})}if(e.type===`failed-plugin`){let r=Re(`error`,n)(a.cross),i=`failed to load · ${e.errorCount} ${gt(e.errorCount,`error`)}`;return(0,Y.jsxs)(B,{children:[(0,Y.jsx)(V,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(V,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(V,{dimColor:!t,children:[` `,(0,Y.jsx)(V,{backgroundColor:`userMessageBackground`,children:`Plugin`})]}),(0,Y.jsxs)(V,{dimColor:!0,children:[` · `,e.marketplace]}),(0,Y.jsxs)(V,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(V,{dimColor:!t,children:i})]})}let r,i;return e.status===`connected`?(r=Re(`success`,n)(a.tick),i=`connected`):e.status===`disabled`?(r=Re(`inactive`,n)(a.radioOff),i=`disabled`):e.status===`pending`?(r=Re(`inactive`,n)(a.radioOff),i=`connecting…`):e.status===`needs-auth`?(r=Re(`warning`,n)(a.triangleUpOutline),i=`Enter to auth`):(r=Re(`error`,n)(a.cross),i=`failed`),e.indented?(0,Y.jsxs)(B,{children:[(0,Y.jsx)(V,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(V,{dimColor:!t,children:`└ `}),(0,Y.jsx)(V,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(V,{dimColor:!t,children:[` `,(0,Y.jsx)(V,{backgroundColor:`userMessageBackground`,children:`MCP`})]}),(0,Y.jsxs)(V,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(V,{dimColor:!t,children:i})]}):(0,Y.jsxs)(B,{children:[(0,Y.jsx)(V,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(V,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(V,{dimColor:!t,children:[` `,(0,Y.jsx)(V,{backgroundColor:`userMessageBackground`,children:`MCP`})]}),(0,Y.jsxs)(V,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(V,{dimColor:!t,children:i})]})}var Y,Kn=e((()=>{i(),H(),Ue(),_t(),Y=Ke()}));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 Ze(`Failed to read plugin components from ${e}: ${qe(t)}`,{level:`error`}),dt(Xe(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 Ze(`Failed to read skill directories from ${e}: ${qe(t)}`,{level:`error`}),dt(Xe(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=oe(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 h(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)(B,{flexDirection:`column`,marginBottom:1,children:[(0,Z.jsx)(V,{bold:!0,children:`Components:`}),(0,Z.jsxs)(V,{dimColor:!0,children:[`Error: `,o]})]}):!n||!(n.commands||n.agents||n.skills||n.hooks||n.mcpServers)?null:(0,Z.jsxs)(B,{flexDirection:`column`,marginBottom:1,children:[(0,Z.jsx)(V,{bold:!0,children:`Installed components:`}),n.commands?(0,Z.jsxs)(V,{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)(V,{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)(V,{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)(V,{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)(V,{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 h(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!Oe(`${e.name}@${t}`)})}function Qn({setViewState:e,setResult:t,onManageComplete:n,onSearchModeChange:r,targetPlugin:i,targetMarketplace:o,action:s}){let l=be(e=>e.mcp.clients),u=be(e=>e.mcp.tools),p=be(e=>e.plugins.errors),m=It(),[h,g]=(0,X.useState)(!1),_=(0,X.useCallback)(e=>{g(e),r?.(e)},[r]),v=Ie(),{columns:y}=Ve(),[b,x]=(0,X.useState)(`plugin-list`),{query:S,setQuery:ee,cursorOffset:te}=Wt({isActive:b===`plugin-list`&&h,onExit:()=>{_(!1)}}),[C,w]=(0,X.useState)(null),[ne,E]=(0,X.useState)([]),[D,re]=(0,X.useState)([]),[O,k]=(0,X.useState)(!0),[A,ie]=(0,X.useState)(new Map),j=(0,X.useRef)(!1),M=(0,X.useRef)(void 0),ae=zt();Fe(`confirm:no`,$n.useCallback(()=>{if(b===`plugin-details`)x(`plugin-list`),w(null),R(null);else if(typeof b==`object`&&b.type===`failed-plugin-details`)x(`plugin-list`),R(null);else if(b===`configuring`)x(`plugin-details`),Se(null);else if(typeof b==`object`&&(b.type===`plugin-options`||b.type===`configuring-options`))x(`plugin-list`),w(null),t(`Plugin enabled. Configuration skipped — run /reload-plugins to apply.`),n&&n();else if(typeof b==`object`&&b.type===`flagged-detail`)x(`plugin-list`),R(null);else if(typeof b==`object`&&b.type===`mcp-detail`)x(`plugin-list`),R(null);else if(typeof b==`object`&&b.type===`mcp-tools`)x({type:`mcp-detail`,client:b.client});else if(typeof b==`object`&&b.type===`mcp-tool-detail`)x({type:`mcp-tools`,client:b.client});else{if(A.size>0){t(`Run /reload-plugins to apply plugin changes.`);return}e({type:`menu`})}},[b,e,A,t]),{context:`Confirmation`,isActive:(b!==`plugin-list`||!h)&&b!==`confirm-project-uninstall`&&!(typeof b==`object`&&b.type===`confirm-data-cleanup`)});let oe=e=>e.type===`connected`?`connected`:e.type===`disabled`?`disabled`:e.type===`pending`?`pending`:e.type===`needs-auth`?`needs-auth`:`failed`,se=(0,X.useMemo)(()=>{let e=rt(),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 D){let i=`${r.plugin.name}@${r.marketplace}`,a=e?.enabledPlugins?.[i]!==!1,o=p.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:A.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 p){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 m)continue;let n=T(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:oe(e),client:e}));let u={flagged:-1,project:0,local:1,user:2,enterprise:3,managed:4,dynamic:5,builtin:6},d=[],f=new Map;for(let{item:e,originalScope:t,childMcps:r}of n){let n=e.scope;f.has(n)||f.set(n,[]),f.get(n).push(e);for(let{displayName:e,client:n}of r){let r=t===`builtin`?`user`:t;f.has(r)||f.set(r,[]),f.get(r).push({type:`mcp`,id:`mcp:${n.name}`,name:e,description:void 0,scope:r,status:oe(n),client:n,indented:!0})}}for(let e of c){let t=e.scope;f.has(t)||f.set(t,[]),f.get(t).push(e)}for(let e of s){let t=e.scope;f.has(t)||f.set(t,[]),f.get(t).push(e)}for(let[e,t]of Object.entries(m)){let n=T(e),r=n.name||e,i=n.marketplace||`unknown`;f.has(`flagged`)||f.set(`flagged`,[]),f.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=[...f.keys()].sort((e,t)=>(u[e]??99)-(u[t]??99));for(let e of h){let t=f.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)d.push(...e);d.push(...r)}return d},[D,l,p,A,m]),N=(0,X.useMemo)(()=>se.filter(e=>e.type===`flagged-plugin`).map(e=>e.id),[se]);(0,X.useEffect)(()=>{N.length>0&&Ft(N)},[N]);let F=(0,X.useMemo)(()=>{if(!S)return se;let e=S.toLowerCase();return se.filter(t=>t.name.toLowerCase().includes(e)||`description`in t&&t.description?.toLowerCase().includes(e))},[se,S]),[I,le]=(0,X.useState)(0),de=En({totalItems:F.length,selectedIndex:I,maxVisible:8}),[pe,me]=(0,X.useState)(0),[ge,_e]=(0,X.useState)(!1),[ve,R]=(0,X.useState)(null),[ye,Se]=(0,X.useState)(null),[Ce,Te]=(0,X.useState)(!1),[Ee,Oe]=(0,X.useState)(!1);(0,X.useEffect)(()=>{if(!C){Oe(!1);return}async function e(){let e=C.plugin.manifest.mcpServers,t=!1;if(e&&(t=typeof e==`string`&&P(e)||Array.isArray(e)&&e.some(e=>typeof e==`string`&&P(e))),!t)try{let e=nn.join(C.plugin.path,`..`),n=nn.join(e,`.claude-plugin`,`marketplace.json`),r=Ye(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`&&P(e)||Array.isArray(e)&&e.some(e=>typeof e==`string`&&P(e))}}catch(e){Ze(`Failed to read raw marketplace.json: ${e}`)}Oe(t)}e()},[C]),(0,X.useEffect)(()=>{async function e(){k(!0);try{let{enabled:e,disabled:t}=await ce(),n=rt(),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=et(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)),E(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})}re(o),le(0)}finally{k(!1)}}e()},[]),(0,X.useEffect)(()=>{if(!j.current&&i&&ne.length>0&&!O){let{name:e,marketplace:n}=T(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`),M.current=s,j.current=!0;return}}let c=se.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}}),j.current=!0),!j.current&&s&&(j.current=!0,t(`Plugin "${i}" is not installed in this project`))}},[i,o,ne,O,se,s,t]);let ke=async r=>{if(!C)return;let i=C.scope||`user`,a=i===`builtin`;if(a&&(r===`update`||r===`uninstall`)){R(`Built-in plugins cannot be updated or uninstalled.`);return}if(!a&&!wt(i)&&r!==`update`){R(`This plugin is managed by your organization. Contact your admin to disable it.`);return}_e(!0),R(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)){_e(!1),x(`confirm-project-uninstall`);return}let e=c().plugins[o],t=!e||e.length<=1?await ue(o):null;if(t){_e(!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}}xe();let l=`${C.plugin.name}@${C.marketplace}`;if(rt()?.enabledPlugins?.[l]!==!1){_e(!1),x({type:`plugin-options`});return}let u=r===`enable`?`Enabled`:r===`disable`?`Disabled`:r===`update`?`Updated`:`Uninstalled`,d=s&&s.length>0?` · required by ${s.join(`, `)}`:``;t(`✓ ${u} ${C.plugin.name}${d}. Run /reload-plugins to apply.`),n&&await n(),e({type:`menu`})}catch(e){_e(!1);let t=e instanceof Error?e.message:String(e);R(`Failed to ${r}: ${t}`),dt(Xe(e))}},Ae=(0,X.useRef)(ke);Ae.current=ke,(0,X.useEffect)(()=>{if(b===`plugin-details`&&C&&M.current){let e=M.current;M.current=void 0,Ae.current(e)}},[b,C]);let je=$n.useCallback(()=>{if(I>=F.length)return;let e=F[I];if(e?.type!==`flagged-plugin`)if(e?.type===`plugin`){let t=`${e.plugin.name}@${e.marketplace}`,n=rt(),r=A.get(t),i=n?.enabledPlugins?.[t]!==!1,a=e.scope;if(a===`builtin`||wt(a)){let e=new Map(A);r?(e.delete(t),(async()=>{try{r===`will-disable`?await bt(t):await Ct(t),xe()}catch(e){dt(e)}})()):(e.set(t,i?`will-disable`:`will-enable`),(async()=>{try{i?await Ct(t):await bt(t),xe()}catch(e){dt(e)}})()),ie(e)}}else e?.type===`mcp`&&ae(e.client.name)},[I,F,A,D,ae]);z({"select:previous":()=>{I===0?_(!0):de.handleSelectionChange(I-1,le)},"select:next":()=>{I<F.length-1&&de.handleSelectionChange(I+1,le)},"select:accept":$n.useCallback(()=>{if(I>=F.length)return;let e=F[I];if(e?.type===`plugin`){let t=D.find(t=>t.plugin.name===e.plugin.name&&t.marketplace===e.marketplace);t&&(w(t),x(`plugin-details`),me(0),R(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}}),R(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}}),me(0),R(null)):e?.type===`mcp`&&(x({type:`mcp-detail`,client:e.client}),R(null))},[I,F,D])},{context:`Select`,isActive:b===`plugin-list`&&!h}),z({"plugin:toggle":je},{context:`Plugin`,isActive:b===`plugin-list`&&!h}),z({"select:accept":$n.useCallback(()=>{typeof b!=`object`||b.type!==`flagged-detail`||(Lt(b.plugin.id),x(`plugin-list`))},[b])},{context:`Select`,isActive:typeof b==`object`&&b.type===`flagged-detail`});let Me=$n.useMemo(()=>{if(b!==`plugin-details`||!C)return[];let e=rt(),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 ke(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){R(e);return}let t=[...D],n=t.findIndex(e=>e.plugin.name===C.plugin.name&&e.marketplace===C.marketplace);n!==-1&&(t[n].pendingUpdate=!C.pendingUpdate,re(t),w({...C,pendingUpdate:!C.pendingUpdate}))}catch(e){R(e instanceof Error?e.message:`Failed to check plugin update availability`)}}}),Ee&&i.push({label:`Configure`,action:async()=>{Te(!0);try{let e=C.plugin.manifest.mcpServers,t=null;if(typeof e==`string`&&P(e))t=e;else if(Array.isArray(e)){for(let n of e)if(typeof n==`string`&&P(n)){t=n;break}}if(!t){R(`No MCPB file found in plugin`),Te(!1);return}let n=`${C.plugin.name}@${C.marketplace}`,r=await we(t,C.plugin.path,n,void 0,void 0,!0);`status`in r&&r.status===`needs-config`?(Se(r),x(`configuring`)):R(`Failed to load MCPB for configuration`)}catch(e){let t=qe(e);R(`Failed to load configuration: ${t}`)}finally{Te(!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 ke(`update`)}),i.push({label:`Uninstall`,action:()=>void ke(`uninstall`)})),C.plugin.manifest.homepage&&i.push({label:`Open homepage`,action:()=>void De(C.plugin.manifest.homepage)}),C.plugin.manifest.repository&&i.push({label:`View repository`,action:()=>void De(C.plugin.manifest.repository)}),i.push({label:`Back to plugin list`,action:()=>{x(`plugin-list`),w(null),R(null)}}),i},[b,C,Ee,D]);if(z({"select:previous":()=>{pe>0&&me(pe-1)},"select:next":()=>{pe<Me.length-1&&me(pe+1)},"select:accept":()=>{Me[pe]&&Me[pe].action()}},{context:`Select`,isActive:b===`plugin-details`&&!!C}),z({"select:accept":()=>{typeof b==`object`&&b.type===`failed-plugin-details`&&(async()=>{_e(!0),R(null);let e=b.plugin.id,t=b.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=nt(t);n?.enabledPlugins?.[e]!==void 0&&(ot(t,{enabledPlugins:{...n.enabledPlugins,[e]:void 0}}),i=!0)}xe()}i?(n&&await n(),_e(!1),x(`plugin-list`)):(_e(!1),R(r.message))})()}},{context:`Select`,isActive:typeof b==`object`&&b.type===`failed-plugin-details`&&b.plugin.scope!==`managed`}),z({"confirm:yes":()=>{if(!C)return;_e(!0),R(null);let r=`${C.plugin.name}@${C.marketplace}`,{error:i}=ot(`localSettings`,{enabledPlugins:{...nt(`localSettings`)?.enabledPlugins,[r]:!1}});if(i){_e(!1),R(`Failed to write settings: ${i.message}`);return}xe(),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`),R(null)}},{context:`Confirmation`,isActive:b===`confirm-project-uninstall`&&!!C&&!ge}),Le((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=>{_e(!0),R(null);try{let i=await xt(o,s,r);if(!i.success)throw Error(i.message);xe();let c=r?``:` · data preserved`;t(`${a.tick} ${i.message}${c}`),n&&n(),e({type:`menu`})}catch(e){_e(!1),R(e instanceof Error?e.message:String(e))}};r===`y`||r===`Y`?c(!0):r===`n`||r===`N`?c(!1):i.escape&&(x(`plugin-details`),R(null))},{isActive:typeof b==`object`&&b.type===`confirm-data-cleanup`&&!!C&&!ge}),$n.useEffect(()=>{le(0)},[S]),Le((e,t)=>{let n=!t.ctrl&&!t.meta;h||(e===`/`&&n?(_(!0),ee(``),le(0)):n&&e.length>0&&!/^\s+$/.test(e)&&e!==`j`&&e!==`k`&&e!==` `&&(_(!0),ee(e),le(0)))},{isActive:b===`plugin-list`}),O)return(0,Z.jsx)(V,{children:`Loading installed plugins…`});if(se.length===0)return(0,Z.jsxs)(B,{flexDirection:`column`,children:[(0,Z.jsx)(B,{marginBottom:1,children:(0,Z.jsx)(V,{bold:!0,children:`Manage plugins`})}),(0,Z.jsx)(V,{children:`No plugins or MCP servers installed.`}),(0,Z.jsx)(B,{marginTop:1,children:(0,Z.jsx)(V,{dimColor:!0,children:`Esc to go back`})})]});if(typeof b==`object`&&b.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 b==`object`&&b.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:b.schema,initialValues:he(e),onSave:n=>{try{fe(e,n,b.schema),xe(),t(`Configuration saved. Run /reload-plugins for changes to take effect.`)}catch(e){R(`Failed to save configuration: ${qe(e)}`)}x(`plugin-details`)},onCancel:()=>x(`plugin-details`)})}if(b===`configuring`&&ye&&C){let e=`${C.plugin.name}@${C.marketplace}`;async function n(n){if(!(!ye||!C))try{let r=C.plugin.manifest.mcpServers,i=null;if(typeof r==`string`&&P(r))i=r;else if(Array.isArray(r)){for(let e of r)if(typeof e==`string`&&P(e)){i=e;break}}if(!i){R(`No MCPB file found`),x(`plugin-details`);return}await we(i,C.plugin.path,e,void 0,n),R(null),Se(null),x(`plugin-details`),t(`Configuration saved. Run /reload-plugins for changes to take effect.`)}catch(e){let t=qe(e);R(`Failed to save configuration: ${t}`),x(`plugin-details`)}}function r(){Se(null),x(`plugin-details`)}return(0,Z.jsx)(ln,{title:`Configure ${ye.manifest.name}`,subtitle:`Plugin: ${C.plugin.name}`,configSchema:ye.configSchema,initialValues:ye.existingConfig,onSave:n,onCancel:r})}if(typeof b==`object`&&b.type===`flagged-detail`){let e=b.plugin;return(0,Z.jsxs)(B,{flexDirection:`column`,children:[(0,Z.jsx)(B,{children:(0,Z.jsxs)(V,{bold:!0,children:[e.name,` @ `,e.marketplace]})}),(0,Z.jsxs)(B,{marginBottom:1,children:[(0,Z.jsx)(V,{dimColor:!0,children:`Status: `}),(0,Z.jsx)(V,{color:`error`,children:`Removed`})]}),(0,Z.jsxs)(B,{marginBottom:1,flexDirection:`column`,children:[(0,Z.jsxs)(V,{color:`error`,children:[`Removed from marketplace · reason: `,e.reason]}),(0,Z.jsx)(V,{children:e.text}),(0,Z.jsxs)(V,{dimColor:!0,children:[`Flagged on `,new Date(e.flaggedAt).toLocaleDateString()]})]}),(0,Z.jsx)(B,{marginTop:1,flexDirection:`column`,children:(0,Z.jsxs)(B,{children:[(0,Z.jsxs)(V,{children:[a.pointer,` `]}),(0,Z.jsx)(V,{color:`suggestion`,children:`Dismiss`})]})}),(0,Z.jsxs)(Pe,{children:[(0,Z.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`dismiss`}),(0,Z.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})]})}if(b===`confirm-project-uninstall`&&C)return(0,Z.jsxs)(B,{flexDirection:`column`,children:[(0,Z.jsxs)(V,{bold:!0,color:`warning`,children:[C.plugin.name,` is enabled in .workmate/settings.json (shared with your team)`]}),(0,Z.jsxs)(B,{marginTop:1,flexDirection:`column`,children:[(0,Z.jsx)(V,{children:`Disable it just for you in .workmate/settings.local.json?`}),(0,Z.jsx)(V,{dimColor:!0,children:`This has the same effect as uninstalling, without affecting other contributors.`})]}),ve&&(0,Z.jsx)(B,{marginTop:1,children:(0,Z.jsx)(V,{color:`error`,children:ve})}),(0,Z.jsx)(B,{marginTop:1,children:ge?(0,Z.jsx)(V,{dimColor:!0,children:`Disabling…`}):(0,Z.jsxs)(Pe,{children:[(0,Z.jsx)(L,{action:`confirm:yes`,context:`Confirmation`,fallback:`y`,description:`disable`}),(0,Z.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]});if(typeof b==`object`&&b.type===`confirm-data-cleanup`&&C)return(0,Z.jsxs)(B,{flexDirection:`column`,children:[(0,Z.jsxs)(V,{bold:!0,children:[C.plugin.name,` has `,b.size.human,` of persistent data`]}),(0,Z.jsxs)(B,{marginTop:1,flexDirection:`column`,children:[(0,Z.jsx)(V,{children:`Delete it along with the plugin?`}),(0,Z.jsx)(V,{dimColor:!0,children:d(`${C.plugin.name}@${C.marketplace}`)})]}),ve&&(0,Z.jsx)(B,{marginTop:1,children:(0,Z.jsx)(V,{color:`error`,children:ve})}),(0,Z.jsx)(B,{marginTop:1,children:ge?(0,Z.jsx)(V,{dimColor:!0,children:`Uninstalling…`}):(0,Z.jsxs)(V,{children:[(0,Z.jsx)(V,{bold:!0,children:`y`}),` to delete · `,(0,Z.jsx)(V,{bold:!0,children:`n`}),` to keep · `,(0,Z.jsx)(V,{bold:!0,children:`esc`}),` to cancel`]})})]});if(b===`plugin-details`&&C){let e=rt(),t=`${C.plugin.name}@${C.marketplace}`,n=e?.enabledPlugins?.[t]!==!1,r=p.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)(B,{flexDirection:`column`,marginBottom:1,children:[(0,Z.jsxs)(V,{bold:!0,color:`error`,children:[r.length,` `,gt(r.length,`error`),`:`]}),r.map((e,t)=>{let n=Un(e);return(0,Z.jsxs)(B,{flexDirection:`column`,marginLeft:2,children:[(0,Z.jsx)(V,{color:`error`,children:Hn(e)}),n&&(0,Z.jsxs)(V,{dimColor:!0,italic:!0,children:[a.arrowRight,` `,n]})]},t)})]});return(0,Z.jsxs)(B,{flexDirection:`column`,children:[(0,Z.jsx)(B,{children:(0,Z.jsxs)(V,{bold:!0,children:[C.plugin.name,` @ `,C.marketplace]})}),(0,Z.jsxs)(B,{children:[(0,Z.jsx)(V,{dimColor:!0,children:`Scope: `}),(0,Z.jsx)(V,{children:C.scope||`user`})]}),C.plugin.manifest.version&&(0,Z.jsxs)(B,{children:[(0,Z.jsx)(V,{dimColor:!0,children:`Version: `}),(0,Z.jsx)(V,{children:C.plugin.manifest.version})]}),C.plugin.manifest.description&&(0,Z.jsx)(B,{marginBottom:1,children:(0,Z.jsx)(V,{children:C.plugin.manifest.description})}),C.plugin.manifest.author&&(0,Z.jsxs)(B,{children:[(0,Z.jsx)(V,{dimColor:!0,children:`Author: `}),(0,Z.jsx)(V,{children:C.plugin.manifest.author.name})]}),(0,Z.jsxs)(B,{marginBottom:1,children:[(0,Z.jsx)(V,{dimColor:!0,children:`Status: `}),(0,Z.jsx)(V,{color:n?`success`:`warning`,children:n?`Enabled`:`Disabled`}),C.pendingUpdate&&(0,Z.jsx)(V,{color:`suggestion`,children:` · Marked for update`})]}),(0,Z.jsx)(Yn,{plugin:C.plugin,marketplace:C.marketplace}),i,(0,Z.jsx)(B,{marginTop:1,flexDirection:`column`,children:Me.map((e,t)=>{let n=t===pe;return(0,Z.jsxs)(B,{children:[n&&(0,Z.jsxs)(V,{children:[a.pointer,` `]}),!n&&(0,Z.jsx)(V,{children:` `}),(0,Z.jsx)(V,{bold:n,color:e.label.includes(`Uninstall`)?`error`:e.label.includes(`Update`)?`suggestion`:void 0,children:e.label})]},t)})}),ge&&(0,Z.jsx)(B,{marginTop:1,children:(0,Z.jsx)(V,{children:`Processing…`})}),ve&&(0,Z.jsx)(B,{marginTop:1,children:(0,Z.jsx)(V,{color:`error`,children:ve})}),(0,Z.jsx)(B,{marginTop:1,children:(0,Z.jsx)(V,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(Pe,{children:[(0,Z.jsx)(L,{action:`select:previous`,context:`Select`,fallback:`↑`,description:`navigate`}),(0,Z.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,Z.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}if(typeof b==`object`&&b.type===`failed-plugin-details`){let e=b.plugin,t=e.errors[0],n=t?Hn(t):`Failed to load`;return(0,Z.jsxs)(B,{flexDirection:`column`,children:[(0,Z.jsxs)(V,{children:[(0,Z.jsx)(V,{bold:!0,children:e.name}),(0,Z.jsxs)(V,{dimColor:!0,children:[` @ `,e.marketplace]}),(0,Z.jsxs)(V,{dimColor:!0,children:[` (`,e.scope,`)`]})]}),(0,Z.jsx)(V,{color:`error`,children:n}),e.scope===`managed`?(0,Z.jsx)(B,{marginTop:1,children:(0,Z.jsx)(V,{dimColor:!0,children:`Managed by your organization — contact your admin`})}):(0,Z.jsxs)(B,{marginTop:1,children:[(0,Z.jsxs)(V,{color:`suggestion`,children:[a.pointer,` `]}),(0,Z.jsx)(V,{bold:!0,children:`Remove`})]}),ge&&(0,Z.jsx)(V,{children:`Processing…`}),ve&&(0,Z.jsx)(V,{color:`error`,children:ve}),(0,Z.jsx)(B,{marginTop:1,children:(0,Z.jsx)(V,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(Pe,{children:[e.scope!==`managed`&&(0,Z.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`remove`}),(0,Z.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}if(typeof b==`object`&&b.type===`mcp-detail`){let e=b.client,n=f(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 b==`object`&&b.type===`mcp-tools`){let e=b.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 b==`object`&&b.type===`mcp-tool-detail`){let{client:e,tool:t}=b,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 Ne=de.getVisibleItems(F);return(0,Z.jsxs)(B,{flexDirection:`column`,children:[(0,Z.jsx)(B,{marginBottom:1,children:(0,Z.jsx)(ze,{query:S,isFocused:h,isTerminalFocused:v,width:y-4,cursorOffset:te})}),F.length===0&&S&&(0,Z.jsx)(B,{marginBottom:1,children:(0,Z.jsxs)(V,{dimColor:!0,children:[`No items match "`,S,`"`]})}),de.scrollPosition.canScrollUp&&(0,Z.jsx)(B,{children:(0,Z.jsxs)(V,{dimColor:!0,children:[` `,a.arrowUp,` more above`]})}),Ne.map((e,t)=>{let n=de.toActualIndex(t)===I&&!h,r=t>0?Ne[t-1]:null,i=!r||r.scope!==e.scope;return(0,Z.jsxs)($n.Fragment,{children:[i&&(0,Z.jsx)(B,{marginTop:+(t>0),paddingLeft:2,children:(0,Z.jsx)(V,{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)}),de.scrollPosition.canScrollDown&&(0,Z.jsx)(B,{children:(0,Z.jsxs)(V,{dimColor:!0,children:[` `,a.arrowDown,` more below`]})}),(0,Z.jsx)(B,{marginTop:1,marginLeft:1,children:(0,Z.jsx)(V,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(Pe,{children:[(0,Z.jsx)(V,{children:`type to search`}),(0,Z.jsx)(L,{action:`plugin:toggle`,context:`Plugin`,fallback:`Space`,description:`toggle`}),(0,Z.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`details`}),(0,Z.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})}),A.size>0&&(0,Z.jsx)(B,{marginLeft:1,children:(0,Z.jsx)(V,{dimColor:!0,italic:!0,children:`Run /reload-plugins to apply changes`})})]})}var $n,X,Z,er=e((()=>{i(),$n=t(H(),1),X=t(H(),1),v(),Ue(),qt(),Xt(),Jt(),Yt(),Ut(),Gt(),m(),s(),Se(),Bt(),te(),Et(),me(),tt(),O(),Qe(),Je(),ut(),j(),Ee(),Ae(),F(),S(),Rt(),_(),ae(),N(),k(),vt(),it(),$e(),_t(),Wn(),fn(),_n(),Kn(),kn(),Z=Ke()}));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} ${gt(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} ${gt(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,dt(t),e(`${a.cross} Unexpected error during validation: ${qe(t)}`)}}n()},[e,t]),(0,ar.jsx)(B,{flexDirection:`column`,children:(0,ar.jsx)(V,{children:`Running validation...`})})}var ir,ar,or=e((()=>{i(),H(),ir=t(H(),1),Ue(),Je(),ut(),Pt(),_t(),ar=Ke()}));function sr({onComplete:e}){return(0,Q.useEffect)(()=>{async function t(){try{let t=await l(),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: ${qe(t)}`)}}t()},[e]),(0,$.jsx)(V,{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`}])nt(n)?.extraKnownMarketplaces?.[e]&&t.push({source:n,scope:r});return{editableSources:t,isInPolicy:!!nt(`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=nt(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&&ot(n,r)}}function hr({setViewState:e,setActiveTab:t,markPluginsChanged:n}){let r=be(e=>e.plugins.errors),i=be(e=>e.plugins.installationStatus),o=de(),[s,c]=(0,Q.useState)(0),[u,d]=(0,Q.useState)(null),[f,m]=(0,Q.useState)([]);(0,Q.useEffect)(()=>{(async()=>{try{let{failures:e}=await re(await l());m(e)}catch{}})()},[]);let h=i.marketplaces.filter(e=>e.status===`failed`),g=new Set(h.map(e=>e.name)),_=r.filter(dr),v=pr(h,r.filter(e=>(e.type===`marketplace-not-found`||e.type===`marketplace-load-failed`||e.type===`marketplace-blocked-by-policy`)&&!g.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,_,yt());Fe(`confirm:no`,()=>{e({type:`menu`})},{context:`Confirmation`}),z({"select:previous":()=>c(e=>Math.max(0,e-1)),"select:next":()=>c(e=>Math.min(v.length-1,e+1)),"select:accept":()=>{let r=v[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),xe(),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 p(i.name),xe(),m(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:v.length>0});let y=Math.min(s,Math.max(0,v.length-1));y!==s&&c(y);let b=v[y]?.action,x=b&&b.kind!==`none`&&b.kind!==`managed-only`;return v.length===0?(0,$.jsxs)(B,{flexDirection:`column`,children:[(0,$.jsx)(B,{marginLeft:1,children:(0,$.jsx)(V,{dimColor:!0,children:`No plugin errors`})}),(0,$.jsx)(B,{marginTop:1,children:(0,$.jsx)(V,{dimColor:!0,italic:!0,children:(0,$.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})})})]}):(0,$.jsxs)(B,{flexDirection:`column`,children:[v.map((e,t)=>{let n=t===y;return(0,$.jsxs)(B,{marginLeft:1,flexDirection:`column`,marginBottom:1,children:[(0,$.jsxs)(V,{children:[(0,$.jsxs)(V,{color:n?`suggestion`:`error`,children:[n?a.pointer:a.cross,` `]}),(0,$.jsx)(V,{bold:n,children:e.label}),e.scope&&(0,$.jsxs)(V,{dimColor:!0,children:[` (`,e.scope,`)`]})]}),(0,$.jsx)(B,{marginLeft:3,children:(0,$.jsx)(V,{color:`error`,children:e.message})}),e.guidance&&(0,$.jsx)(B,{marginLeft:3,children:(0,$.jsx)(V,{dimColor:!0,italic:!0,children:e.guidance})})]},t)}),u&&(0,$.jsx)(B,{marginTop:1,marginLeft:1,children:(0,$.jsx)(V,{color:`claude`,children:u})}),(0,$.jsx)(B,{marginTop:1,children:(0,$.jsx)(V,{dimColor:!0,italic:!0,children:(0,$.jsxs)(Pe,{children:[(0,$.jsx)(L,{action:`select:previous`,context:`Select`,fallback:`↑`,description:`navigate`}),x&&(0,$.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`resolve`}),(0,$.jsx)(L,{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=de(),y=be(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]),Fe(`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)(B,{flexDirection:`column`,children:[(0,$.jsx)(V,{bold:!0,children:`Plugin Command Usage:`}),(0,$.jsx)(V,{children:` `}),(0,$.jsx)(V,{dimColor:!0,children:`Installation:`}),(0,$.jsx)(V,{children:` /plugin install - Browse and install plugins`}),(0,$.jsx)(V,{children:` /plugin install <marketplace> - Install from specific marketplace`}),(0,$.jsx)(V,{children:` /plugin install <plugin> - Install specific plugin`}),(0,$.jsx)(V,{children:` /plugin install <plugin>@<market> - Install plugin from marketplace`}),(0,$.jsx)(V,{children:` `}),(0,$.jsx)(V,{dimColor:!0,children:`Management:`}),(0,$.jsx)(V,{children:` /plugin manage - Manage installed plugins`}),(0,$.jsx)(V,{children:` /plugin enable <plugin> - Enable a plugin`}),(0,$.jsx)(V,{children:` /plugin disable <plugin> - Disable a plugin`}),(0,$.jsx)(V,{children:` /plugin uninstall <plugin> - Uninstall a plugin`}),(0,$.jsx)(V,{children:` `}),(0,$.jsx)(V,{dimColor:!0,children:`Marketplaces:`}),(0,$.jsx)(V,{children:` /plugin marketplace - Marketplace management menu`}),(0,$.jsx)(V,{children:` /plugin marketplace add - Add a marketplace`}),(0,$.jsx)(V,{children:` /plugin marketplace add <path/url> - Add marketplace directly`}),(0,$.jsx)(V,{children:` /plugin marketplace update - Update marketplaces`}),(0,$.jsx)(V,{children:` /plugin marketplace update <name> - Update specific marketplace`}),(0,$.jsx)(V,{children:` /plugin marketplace remove - Remove a marketplace`}),(0,$.jsx)(V,{children:` /plugin marketplace remove <name> - Remove specific marketplace`}),(0,$.jsx)(V,{children:` /plugin marketplace list - List all marketplaces`}),(0,$.jsx)(V,{children:` `}),(0,$.jsx)(V,{dimColor:!0,children:`Validation:`}),(0,$.jsx)(V,{children:` /plugin validate <path> - Validate a manifest file or directory`}),(0,$.jsx)(V,{children:` `}),(0,$.jsx)(V,{dimColor:!0,children:`Other:`}),(0,$.jsx)(V,{children:` /plugin - Main plugin menu`}),(0,$.jsx)(V,{children:` /plugin help - Show this help`}),(0,$.jsx)(V,{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)(We,{color:`suggestion`,children:(0,$.jsxs)(He,{title:`Plugins`,selectedTab:o,onTabChange:te,color:`suggestion`,disableNavigation:g,children:[(0,$.jsx)(Be,{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)(Be,{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)(Be,{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)(Be,{id:`errors`,title:b,children:(0,$.jsx)(hr,{setViewState:a,setActiveTab:s,markPluginsChanged:ee})})]})})}var Q,$,yr,br=e((()=>{i(),H(),Q=t(H(),1),v(),Ue(),Ht(),s(),me(),Je(),j(),ve(),Ae(),vt(),it(),sn(),Mn(),Ln(),Vn(),er(),Wn(),nr(),or(),$=Ke(),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((()=>{H(),br(),Sr=Ke()}))();export{xr as call};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Bo as t,Eo as n,Fo as r,Jw as i,Uo as a,Xw as o,ko as s,wo as c,zo as l}from"./loadAgentsDir-BXtV2jiO.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-BFbty6WT.js";function S(e){return O=e,k!==null&&k.length>0&&(e(k),k=null),()=>{O=null}}async function C(){let e=await t(),n=r(),i=new Set;for(let[t,r]of Object.entries(e)){let e=n[t]?.autoUpdate;(e===void 0?h(t,r):e)&&i.add(t.toLowerCase())}return i}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=s(),r=Object.keys(t.plugins);return r.length===0?[]:(await Promise.allSettled(r.map(async r=>{let{marketplace:i}=o(r);if(!i||!e.has(i.toLowerCase()))return null;let a=t.plugins[r];if(!a||a.length===0)return null;let s=a.filter(n);return s.length===0?null:w(r,s)}))).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 a(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 n=await E(e);n.length>0&&(O?O(n):k=n)}catch(e){y(e)}})()}var O,k,A=e((()=>{x(),_(),p(),d(),v(),c(),l(),i(),m(),O=null,k=null}));export{T as i,A as n,S as r,D as t};
@@ -1 +0,0 @@
1
- import{Ao as e,Io as t,Vo as n,wo as r,zo as i}from"./loadAgentsDir-BXtV2jiO.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-BFbty6WT.js";import{i as d,n as f,r as p,t as m}from"./pluginFlagging-CXSSOj4J.js";u(),c(),o(),r(),i(),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 r=e(),i=f(),o=await n(),c=[];for(let e of Object.keys(o))try{let n=await t(e);if(!n.forceRemoveDeletedPlugins)continue;let o=h(r,n,e);for(let e of o){if(e in i)continue;let t=r.plugins[e]??[];if(t.some(e=>e.scope===`user`||e.scope===`project`||e.scope===`local`)){for(let n of t){let{scope:t}=n;if(!(t!==`user`&&t!==`project`&&t!==`local`))try{await l(e,t)}catch(n){s(`Failed to auto-uninstall delisted plugin ${e} from ${t}: ${a(n)}`,{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};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./figures-5ThXQEtq.js";import{Co as n,Df as r,Jw as i,Of as a,Qd as o,So as s,Xd as c,Xw as l,kf as u}from"./loadAgentsDir-BXtV2jiO.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-BFbty6WT.js";e(),f(),o(),h(),n(),i(),p(),u(),_(),T();function E(e,n,i){g(e);let o=i?`${n} plugin "${i}"`:n===`disable-all`?`disable all plugins`:`${n} plugins`;console.error(`${t.cross} Failed to ${o}: ${d(e)}`);let c=i?(()=>{let{name:e,marketplace:t}=l(i);return{_PROTO_plugin_name:e,...t&&{_PROTO_marketplace_name:t},...r(e,t,s())}})():{};v(`tengu_plugin_command_failed`,{command:n,error_category:a(e),...c}),process.exit(1)}async function D(e,n=`user`){try{console.log(`Installing plugin "${e}"...`);let i=await b(e,n);if(!i.success)throw Error(i.message);console.log(`${t.tick} ${i.message}`);let{name:a,marketplace:o}=l(i.pluginId||e);v(`tengu_plugin_installed_cli`,{_PROTO_plugin_name:a,...o&&{_PROTO_marketplace_name:o},scope:i.scope||n,install_source:`cli-explicit`,...r(a,o,s())}),process.exit(0)}catch(t){E(t,`install`,e)}}async function O(e,n=`user`,i=!1){try{let a=await x(e,n,!i);if(!a.success)throw Error(a.message);console.log(`${t.tick} ${a.message}`);let{name:o,marketplace:c}=l(a.pluginId||e);v(`tengu_plugin_uninstalled_cli`,{_PROTO_plugin_name:o,...c&&{_PROTO_marketplace_name:c},scope:a.scope||n,...r(o,c,s())}),process.exit(0)}catch(t){E(t,`uninstall`,e)}}async function k(e,n){try{let i=await y(e,n);if(!i.success)throw Error(i.message);console.log(`${t.tick} ${i.message}`);let{name:a,marketplace:o}=l(i.pluginId||e);v(`tengu_plugin_enabled_cli`,{_PROTO_plugin_name:a,...o&&{_PROTO_marketplace_name:o},scope:i.scope,...r(a,o,s())}),process.exit(0)}catch(t){E(t,`enable`,e)}}async function A(e,n){try{let i=await C(e,n);if(!i.success)throw Error(i.message);console.log(`${t.tick} ${i.message}`);let{name:a,marketplace:o}=l(i.pluginId||e);v(`tengu_plugin_disabled_cli`,{_PROTO_plugin_name:a,...o&&{_PROTO_marketplace_name:o},scope:i.scope,...r(a,o,s())}),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 i=await S(e,n);if(!i.success)throw Error(i.message);if(m(`${t.tick} ${i.message}\n`),!i.alreadyUpToDate){let{name:t,marketplace:n}=l(i.pluginId||e);v(`tengu_plugin_updated_cli`,{_PROTO_plugin_name:t,...n&&{_PROTO_marketplace_name:n},old_version:i.oldVersion||`unknown`,new_version:i.newVersion||`unknown`,...r(t,n,s())})}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,2 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Ao as t,Aw as n,Bo as r,Gw as i,Io as a,Jw as o,Kw as s,Mo as c,Pw as l,Ro as u,Xw as d,Zw as f,_o as p,bg as m,bo as h,co as g,cs as _,do as v,fS as y,fo as b,go as x,jo as S,ko as C,lo as w,ls as T,mo as E,nT as D,oo as ee,qw as te,ss as O,tT as k,uS as A,uo as j,wo as ne,xg as re,xo as ie,yo as ae,zo as oe}from"./loadAgentsDir-BXtV2jiO.js";import{Wt as se,et as M}from"./state-BPFYBqm1.js";import{B as N,R as ce,U as P,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-BEd0VeQC.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`?M():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(f(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}=d(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:n}=d(e),r=t();if(r.plugins[e]?.length)return{pluginId:e,pluginName:n};let i=Object.keys(r.plugins).find(e=>{let{name:t}=d(e);return t===n&&(r.plugins[e]?.length??0)>0});return i?{pluginId:i,pluginName:n}:null}function Y(e){let n=t().plugins[e];if(!n||n.length===0)return{scope:`user`};let r=M(),i=n.find(e=>e.scope===`local`&&e.projectPath===r);if(i)return{scope:i.scope,projectPath:i.projectPath};let a=n.find(e=>e.scope===`project`&&e.projectPath===r);if(a)return{scope:a.scope,projectPath:a.projectPath};let o=n.find(e=>e.scope===`user`);return o?{scope:o.scope}:{scope:n[0].scope,projectPath:n[0].projectPath}}async function he(e,t=`user`){q(t);let{name:n,marketplace:i}=d(e),o,s,c;if(i){let t=await u(e);t&&(o=t.entry,s=i,c=t.marketplaceInstallLocation)}else{let e=await r();for(let[t,r]of Object.entries(e))try{let e=(await a(t)).plugins.find(e=>e.name===n);if(e){o=e,s=t,c=r.installLocation;break}}catch(e){V(P(e))}}if(!o||!s)return{success:!1,message:`Plugin "${n}" not found in ${i?`marketplace "${i}"`:`any configured marketplace`}`};let l=o,f=`${l.name}@${s}`,p=await ae({pluginId:f,entry:l,scope:t,marketplaceInstallLocation:c});if(!p.ok){let e=p;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:x(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: ${f} (scope: ${t})${p.depNote}`,pluginId:f,pluginName:l.name,scope:t}}async function ge(e,r=`user`,a=!0){q(r);let{enabled:o,disabled:c}=await b(),l=[...o,...c],u=pe(e,l),d=f(r),p=L(d),m,h;if(u)m=Object.keys(p?.enabledPlugins??{}).find(t=>t===e||t===u.name||t.startsWith(`${u.name}@`))??(e.includes(`@`)?e:u.name),h=u.name;else{let t=me(e);if(!t)return{success:!1,message:`Plugin "${e}" not found in installed plugins`};m=t.pluginId,h=t.pluginName}let g=J(r),_=t().plugins[m],v=_?.find(e=>e.scope===r&&e.projectPath===g);if(!v){let{scope:t}=Y(m);return t!==r&&_&&_.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 ${r}. Use --scope ${t} to uninstall.`}:{success:!1,message:`Plugin "${e}" is not installed in ${r} scope. Use --scope to specify the correct scope.`}}let y=v.installPath,x={...p?.enabledPlugins};x[m]=void 0,z(d,{enabledPlugins:x}),O(),S(m,r,g);let C=t().plugins[m],w=!C||C.length===0;w&&y&&await T(y),w&&(A(m),a&&await n(m));let E=i(m,l),D=s(E);return{success:!0,message:`Successfully uninstalled plugin: ${h} (scope: ${r})${D}`,pluginId:m,pluginName:h,scope:r,reverseDependents:E.length>0?E:void 0}}async function X(e,t,n){let r=t?`enable`:`disable`;if(D(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}=d(e);return{success:!0,message:`Successfully ${r}d built-in plugin: ${i}`,pluginId:e,pluginName:i,scope:`user`}}n&&q(n);let a,o,c=fe(e);if(n)if(o=n,c)a=c.pluginId;else if(e.includes(`@`))a=e;else return{success:!1,message:`Plugin "${e}" not found in settings. Use plugin@marketplace format.`};else if(c)a=c.pluginId,o=c.scope;else if(e.includes(`@`))a=e,o=`user`;else return{success:!1,message:`Plugin "${e}" not found in any editable settings scope. Use plugin@marketplace format.`};if(t&&re(a))return{success:!1,message:`Plugin "${a}" is blocked by your organization's policy and cannot be enabled`};let l=f(o),u=L(l)?.enabledPlugins?.[a],p={user:0,project:1,local:2},m=n&&c&&p[n]>p[c.scope];if(n&&u===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?u===!0:G().has(a)))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 b(),n=i(a,[...e,...t]);n.length>0&&(h=n)}let{error:g}=z(l,{enabledPlugins:{...L(l)?.enabledPlugins,[a]:t}});if(g)return{success:!1,message:`Failed to ${r} plugin: ${g.message}`};O();let{name:_}=d(a),v=s(h);return{success:!0,message:`Successfully ${r}d plugin: ${_} (scope: ${o})${v}`,pluginId:a,pluginName:_,scope:o,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}=d(e),i=r?`${n}@${r}`:e,a=await u(e);if(!a)return{success:!1,message:`Plugin "${n}" not found`,pluginId:i,scope:t};let{entry:o,marketplaceInstallLocation:s}=a,c=C().plugins[i];if(!c||c.length===0)return{success:!1,message:`Plugin "${n}" is not installed`,pluginId:i,scope:t};let l=J(t),f=c.find(e=>e.scope===t&&e.projectPath===l);return f?be({pluginId:i,pluginName:n,entry:o,marketplaceInstallLocation:s,installation:f,scope:t,projectPath:l}):{success:!1,message:`Plugin "${n}" is not installed at scope ${l?`${t} (${l})`: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(),l=i.version,u,d,f=!1,p;if(typeof n.source!=`string`){let t=await ee(n.source,{manifest:{name:n.name}});u=t.path,f=!0,p=t.gitCommitSha,d=await h(e,n.source,t.manifest,t.path,n.version,t.gitCommitSha)}else{let t;try{t=await s.stat(r)}catch(t){if(N(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(N(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 E(o,n.name,n.source)}catch{}d=await h(e,n.source,i,u,n.version)}try{let r=w(e,d),s=j(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:l,alreadyUpToDate:!0,scope:a};r=await g(u,e,d,n);let f=i.installPath;if(c(e,a,o,r,d,p),f&&f!==r){let e=C();Object.values(e.plugins).some(e=>e.some(e=>e.installPath===f))||await T(f)}let m=o?`${a} (${o})`:a;return{success:!0,message:`Plugin "${t}" updated from ${l||`unknown`} to ${d} for scope ${m}. Restart to apply changes.`,pluginId:e,newVersion:d,oldVersion:l,scope:a}}finally{f&&u!==w(e,d)&&await s.rm(u,{recursive:!0,force:!0})}}var Q,$,xe=e((()=>{se(),k(),ce(),F(),B(),_(),te(),ne(),oe(),l(),o(),p(),v(),y(),m(),W(),ie(),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};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./pluginStartupCheck-BEd0VeQC.js";e();export{t as getPluginEditableScopes};
@@ -1,4 +0,0 @@
1
- import{n as e,t}from"./figures-5ThXQEtq.js";import{Ao as n,Bo as r,Go as i,Ho as a,Jw as o,No as s,Oo as c,Uo as l,Xw as u,Zo as d,Zw as f,as as p,cS as m,cs as h,do as g,fo as _,iT as v,lS as y,qo as b,rT as x,rs as S,ss as C,wo as w,zo as ee}from"./loadAgentsDir-BXtV2jiO.js";import{Wt as T,ir as E}from"./state-BPFYBqm1.js";import{C as D,P as O,R as te,x as k}from"./debug-Dr1SjdXn.js";import{o as A,s as j}from"./log-27kCA_9u.js";import{n as ne,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-BFbty6WT.js";import{a as B,i as V,n as H,o as U,r as W,t as G}from"./pluginCliCommands-WLOEhb2M.js";import{a as K,c as re,i as q,n as J,r as Y,s as X,t as ie}from"./validatePlugin-jrcrYEIu.js";import{basename as ae,dirname as Z}from"path";e(),T(),ne(),R(),v(),te(),A(),h(),re(),w(),S(),ee(),m(),q(),o(),g(),ie(),k(),P();function Q(e,n){j(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){j(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 i=n(),{getPluginEditableScopes:a}=await import(`./pluginStartupCheck-Bcdxg484.js`),o=a(),s=Object.keys(i.plugins),{enabled:l,disabled:f,errors:m}=await _(),h=[...l,...f],g=h.filter(e=>e.source.endsWith(`@inline`)),v=m.filter(e=>e.source.endsWith(`@inline`)||e.source.startsWith(`inline[`));if(e.json){let t=new Map(h.map(e=>[e.source,e])),n=[];for(let e of s.sort()){let r=i.plugins[e];if(!r||r.length===0)continue;let a=u(e).name,s=m.filter(t=>t.source===e||`plugin`in t&&t.plugin===a).map(x);for(let i of r){let r=t.get(e),a;if(r){let e=r.mcpServers||await y(r);e&&Object.keys(e).length>0&&(a=e)}n.push({id:e,version:i.version||`unknown`,scope:i.scope,enabled:o.has(e),installPath:i.installPath,installedAt:i.installedAt,lastUpdated:i.lastUpdated,projectPath:i.projectPath,mcpServers:a,errors:s.length>0?s:void 0})}}for(let e of g){let t=e.mcpServers||await y(e),r=v.filter(t=>t.source===e.source||`plugin`in t&&t.plugin===e.name).map(x);n.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 v.filter(e=>e.source.startsWith(`inline[`)))n.push({id:e.source,version:`unknown`,scope:`session`,enabled:!1,installPath:`path`in e?e.path:``,errors:[x(e)]});if(e.available){let e=[];try{let[t,n]=await Promise.all([r(),X()]),{marketplaces:i}=await p(t);for(let{name:t,data:r}of i)if(r)for(let i of r.plugins){let r=d(i.name,t);c(r)||e.push({pluginId:r,name:i.name,description:i.description,marketplaceName:t,version:i.version,source:i.source,installCount:n?.get(r)})}}catch{}F(D({installed:n,available:e},null,2))}else F(D(n,null,2))}s.length===0&&g.length===0&&v.length===0&&F("No plugins installed. Use `claude plugin install` to install a plugin."),s.length>0&&console.log(`Installed plugins:
2
- `);for(let e of s.sort()){let n=i.plugins[e];if(!n||n.length===0)continue;let r=u(e).name,a=m.filter(t=>t.source===e||`plugin`in t&&t.plugin===r);for(let r of n){let n=o.has(e),i=a.length>0?`${t.cross} failed to load`:n?`${t.tick} enabled`:`${t.cross} disabled`,s=r.version||`unknown`,c=r.scope;console.log(` ${t.pointer} ${e}`),console.log(` Version: ${s}`),console.log(` Scope: ${c}`),console.log(` Status: ${i}`);for(let e of a)console.log(` Error: ${x(e)}`);console.log(``)}}if(g.length>0||v.length>0){console.log(`Session-only plugins (--plugin-dir):
3
- `);for(let e of g){let n=v.filter(t=>t.source===e.source||`plugin`in t&&t.plugin===e.name),r=n.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: ${r}`);for(let e of n)console.log(` Error: ${x(e)}`);console.log(``)}for(let e of v.filter(e=>e.source.startsWith(`inline[`)))console.log(` ${t.pointer} ${e.source}: ${t.cross} ${x(e)}\n`)}F()}async function ce(e,n){n.cowork&&E(!0);try{let r=await K(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=f(i),o=r;n.sparse&&n.sparse.length>0&&(o.source===`github`||o.source===`git`?o={...o,sparsePaths:n.sparse}:I(`${t.cross} --sparse is only supported for github and git marketplace sources (got: ${o.source})`)),console.log(`Adding marketplace...`);let{name:c,alreadyMaterialized:l,resolvedSource:u}=await s(o,e=>{console.log(e)});b(c,{source:u},a),C();let d=o.source;o.source===`github`&&(d=o.repo),M(`tengu_marketplace_added`,{source_type:d}),F(l?`${t.tick} Marketplace '${c}' already on disk — declared in ${i} settings`:`${t.tick} Successfully added marketplace: ${c} (declared in ${i} settings)`)}catch(e){Q(e,`add marketplace`)}}async function le(e){e.cowork&&E(!0);try{let n=await r(),i=Object.keys(n);e.json&&F(D(i.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)),i.length===0&&F(`No marketplaces configured`),console.log(`Configured marketplaces:
4
- `),i.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 i(e),C(),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 l(e,e=>{console.log(e)}),C(),M(`tengu_marketplace_updated`,{marketplace_name:e}),F(`${t.tick} Successfully updated marketplace: ${e}`);else{let e=await r(),n=Object.keys(e);n.length===0&&F(`No marketplaces configured`),console.log(`Updating ${n.length} marketplace(s)...`),await a(),C(),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}=u(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}=u(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}=u(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 G();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}=u(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}=u(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};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./poorMode-DxgO_bUb.js";t();export{e as isPoorModeActive};