@readmagic/workmate 0.0.22 → 0.0.23
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.
- package/dist/chunks/{AddWorkspaceDirectory-DWgTWJ7R.js → AddWorkspaceDirectory-OgcBcK5A.js} +1 -1
- package/dist/chunks/AgentsMdExternalIncludesDialog-CDNd5-7E.js +1 -0
- package/dist/chunks/{AgentsMdExternalIncludesDialog-s0Orgord.js → AgentsMdExternalIncludesDialog-CNEifEyV.js} +1 -1
- package/dist/chunks/App-B-3tPQ3k.js +1 -0
- package/dist/chunks/BackgroundTasksDialog-COuhHcey.js +2 -0
- package/dist/chunks/{BypassPermissionsModeDialog-D2Gesf-u.js → BypassPermissionsModeDialog-bJek4siJ.js} +1 -1
- package/dist/chunks/CustomSelect-DoeEXOIP.js +1 -0
- package/dist/chunks/{DiffDialog-v2IiYyi3.js → DiffDialog-B3X9FMpO.js} +5 -5
- package/dist/chunks/Doctor-6PXyjIi6.js +3 -0
- package/dist/chunks/Doctor-DNgkgYhB.js +1 -0
- package/dist/chunks/{ExitFlow-BasHk1mk.js → ExitFlow-DgAZp_8U.js} +2 -2
- package/dist/chunks/Grove-CHatOzcE.js +11 -0
- package/dist/chunks/{InvalidConfigDialog-DYVQK5js.js → InvalidConfigDialog-DXL92MN9.js} +1 -1
- package/dist/chunks/{InvalidSettingsDialog-Dg6OiStR.js → InvalidSettingsDialog-Dtmpzeps.js} +1 -1
- package/dist/chunks/{KeybindingProviderSetup-Bn1jzN5F.js → KeybindingProviderSetup-DA37QUFs.js} +1 -1
- package/dist/chunks/MCPConnectionManager-thZd-xA_.js +1 -0
- package/dist/chunks/MCPToolListView-CpY-YJg4.js +1 -0
- package/dist/chunks/{McpParsingWarnings-DZejAh8b.js → McpParsingWarnings-JvChf3xr.js} +1 -1
- package/dist/chunks/MessageSelector-C0_iw7SI.js +3 -0
- package/dist/chunks/Messages-K4DDsDP9.js +10 -0
- package/dist/chunks/Onboarding-C1UdzM-1.js +1 -0
- package/dist/chunks/{PromptInputFooterSuggestions-lkr_A5jQ.js → PromptInputFooterSuggestions-AyLog8p7.js} +1 -1
- package/dist/chunks/{PromptInputHelpMenu-DaQKKyM5.js → PromptInputHelpMenu-oyic20ip.js} +1 -1
- package/dist/chunks/ProviderSetup-XcBHjUnd.js +1 -0
- package/dist/chunks/QueryEngine-DYxBjJ4i.js +1 -0
- package/dist/chunks/REPL-CQBJRrT0.js +124 -0
- package/dist/chunks/REPL-CrVuMQY2.js +1 -0
- package/dist/chunks/ResumeConversation-Dl8H9Gfy.js +1 -0
- package/dist/chunks/SearchExtraToolsTool-lv7VE50N.js +1 -0
- package/dist/chunks/{SelectMulti-CNE06VAN.js → SelectMulti-Bc6l11_K.js} +1 -1
- package/dist/chunks/Settings-TGp3fPrS.js +3 -0
- package/dist/chunks/Spinner-zYPFVFHN.js +1 -0
- package/dist/chunks/{SpinnerGlyph-A6G-gloN.js → SpinnerGlyph-CmkRUvHe.js} +1 -1
- package/dist/chunks/{TextInput-7uqPhq9T.js → TextInput-CD9iau2k.js} +5 -5
- package/dist/chunks/{ThemePicker-DT9zVy-0.js → ThemePicker-0F0hZYPX.js} +1 -1
- package/dist/chunks/TrustDialog-C76YiMKz.js +1 -0
- package/dist/chunks/{ValidationErrorsList-BLtP647v.js → ValidationErrorsList-DgNzJQUP.js} +1 -1
- package/dist/chunks/_baseEach-4ff-vRlp.js +1 -0
- package/dist/chunks/add-dir-JMsRLGfx.js +1 -0
- package/dist/chunks/{agentDisplay-vLQHFrmq.js → agentDisplay-BReJUBWg.js} +1 -1
- package/dist/chunks/agents-9qQ8I6zW.js +101 -0
- package/dist/chunks/{agents-DLz0kfsr.js → agents-B3x8yJ_r.js} +1 -1
- package/dist/chunks/allErrors-DfWylHSw.js +1 -0
- package/dist/chunks/{appleTerminalBackup-BYKdf3of.js → appleTerminalBackup-BArZWB21.js} +1 -1
- package/dist/chunks/backgroundHousekeeping-BGxHB_OX.js +1 -0
- package/dist/chunks/backgroundHousekeeping-CVNIhQg8.js +17 -0
- package/dist/chunks/banner-Cu2-XUek.js +2 -0
- package/dist/chunks/{bedrockClient-DxE_mHFI.js → bedrockClient-CfiDN-kF.js} +2 -2
- package/dist/chunks/branch-C4TsMEkx.js +2 -0
- package/dist/chunks/{break-cache-BL2gnDLX.js → break-cache-BMXqFTeS.js} +2 -2
- package/dist/chunks/btw-Dn1eYFAz.js +1 -0
- package/dist/chunks/caches-BGzKwpnc.js +1 -0
- package/dist/chunks/caches-DArHxBgL.js +1 -0
- package/dist/chunks/{claudeDesktop-D3PEgx3U.js → claudeDesktop-D8ml2767.js} +1 -1
- package/dist/chunks/{clear-CXfhVRp8.js → clear-Bdhb6b39.js} +1 -1
- package/dist/chunks/{client-DdenNfkQ.js → client-4iqhC8xq.js} +1 -1
- package/dist/chunks/client-BiqbIkwr.js +1 -0
- package/dist/chunks/client-CZ8nyVh5.js +1 -0
- package/dist/chunks/{client-DvhWKIOx.js → client-CpTCeWba.js} +1 -1
- package/dist/chunks/commands-QepeBbFn.js +1 -0
- package/dist/chunks/compact-Bu9BUpxV.js +2 -0
- package/dist/chunks/config-C-Y2qtB2.js +3 -0
- package/dist/chunks/config-D58C3_Lu.js +1 -0
- package/dist/chunks/config-DD8fCYXn.js +1 -0
- package/dist/chunks/{context-3s9wtn4L.js → context-CY_yfdYa.js} +1 -1
- package/dist/chunks/context-noninteractive-BDDi3NLF.js +1 -0
- package/dist/chunks/{context-noninteractive-CJhUu_4y.js → context-noninteractive-Dd4xIoP1.js} +5 -5
- package/dist/chunks/conversation-B0wxBwzv.js +1 -0
- package/dist/chunks/conversation-DUu9qBnq.js +1 -0
- package/dist/chunks/conversationRecovery-2ft8sCPE.js +1 -0
- package/dist/chunks/crossProjectResume-6boHMUBx.js +40 -0
- package/dist/chunks/cwd-Dc3NV7s8.js +1 -0
- package/dist/chunks/cwd-Pa83R95t.js +1 -0
- package/dist/chunks/{datadog-v_mXWncN.js → datadog-BPuGcxxC.js} +1 -1
- package/dist/chunks/{debug-8DCufdSp.js → debug-Bglx1aTu.js} +5 -5
- package/dist/chunks/{detectRepository-DfX8xXw2.js → detectRepository-CfX8Lc0A.js} +1 -1
- package/dist/chunks/{diff-DJSt7QO6.js → diff-BOAElpfQ.js} +1 -1
- package/dist/chunks/{directoryCompletion-CT6YVeg7.js → directoryCompletion-D_Rtg-4j.js} +1 -1
- package/dist/chunks/dist-es-B3-7VFf2.js +1 -0
- package/dist/chunks/dist-es-B7j_mv242.js +1 -0
- package/dist/chunks/dist-es-BSKD_hOQ.js +1 -0
- package/dist/chunks/dist-es-BSRN-2nA.js +9 -0
- package/dist/chunks/{dist-es-yHGBqhBe.js → dist-es-BXXmyhQ2.js} +1 -1
- package/dist/chunks/{dist-es-C3reqy7X.js → dist-es-BaQndfvh2.js} +1 -1
- package/dist/chunks/dist-es-CzTYn7xo.js +1 -0
- package/dist/chunks/dist-es-DSkyibcN.js +1 -0
- package/dist/chunks/{dist-es-BOPBJQo3.js → dist-es-_UNJQniz.js} +1 -1
- package/dist/chunks/dist-es-hwK6468D.js +1 -0
- package/dist/chunks/dist-es-ovsdbtwh.js +1 -0
- package/dist/chunks/doctor-CkLzqAMd.js +1 -0
- package/dist/chunks/{entry-ex0-RyYV.js → entry-TNOoyy7_.js} +4 -4
- package/dist/chunks/{envUtils-DcaKZlRU.js → envUtils-DfkgIdYf.js} +1 -1
- package/dist/chunks/esm-eTAUP-La.js +1 -0
- package/dist/chunks/{execFileNoThrow-BsfuytkN.js → execFileNoThrow-BTachNBI.js} +1 -1
- package/dist/chunks/exit-DXApFJIP.js +1 -0
- package/dist/chunks/extraUsage-CmQaLPV1.js +1 -0
- package/dist/chunks/extractMemories-xP63mv6R.js +1 -0
- package/dist/chunks/fast-C5nQH8rm.js +1 -0
- package/dist/chunks/fast-eGx2IxD7.js +1 -0
- package/dist/chunks/fetchModelList-CxLsVNsu.js +1 -0
- package/dist/chunks/fetchModelList-D24lRIgR.js +1 -0
- package/dist/chunks/{fileSuggestions-B-SLfb-o.js → fileSuggestions-DHxdwq28.js} +2 -2
- package/dist/chunks/firstPartyEventLogger-BVAogAX8.js +1 -0
- package/dist/chunks/firstPartyEventLogger-M6UMli2c.js +3 -0
- package/dist/chunks/{gemini-BC9kHhwe.js → gemini-D_ORb_L6.js} +2 -2
- package/dist/chunks/generateSessionName-BQoDduyA.js +1 -0
- package/dist/chunks/{genericProcessUtils-BYi0OefF.js → genericProcessUtils-DwQFuna9.js} +1 -1
- package/dist/chunks/goal-D7c2mSds.js +3 -0
- package/dist/chunks/grok-B2-ZbUiR.js +1 -0
- package/dist/chunks/grove-O6qp7ITR.js +1 -0
- package/dist/chunks/{help-CK90i4hE.js → help-CZJdRviD.js} +1 -1
- package/dist/chunks/history-CQiUERTL.js +1 -0
- package/dist/chunks/hooks-BNuUlMzL.js +1 -0
- package/dist/chunks/{hooks-BRFDg9DV.js → hooks-DIvN6gdv.js} +3 -3
- package/dist/chunks/{install-ZMll-dAa.js → install-T_CV1Slu.js} +1 -1
- package/dist/chunks/instrumentation-BjqUZ383.js +21 -0
- package/dist/chunks/{job-G_ukhLc4.js → job-R6c4-3c8.js} +1 -1
- package/dist/chunks/keybindings-CLRaiL_Z.js +1 -0
- package/dist/chunks/{launchLocalMemory-BcRlXLm6.js → launchLocalMemory-DrbKrwXc.js} +2 -2
- package/dist/chunks/launchOnboarding-tqsMD8ni.js +8 -0
- package/dist/chunks/loadAgentsDir-CcmY8zCj.js +1 -0
- package/dist/chunks/{loadAgentsDir-C1LkW7gl.js → loadAgentsDir-DlPbtIsS.js} +540 -543
- package/dist/chunks/loadPluginHooks-C_msxVIc.js +1 -0
- package/dist/chunks/{loader-C61fB6vU.js → loader-CICGtLp2.js} +1 -1
- package/dist/chunks/{localSearch-DFo_WTMm.js → localSearch-CK-sFzPm.js} +1 -1
- package/dist/chunks/localSearch-DrUj0B-d.js +1 -0
- package/dist/chunks/{log-DaILwWJa.js → log-D2TIwHBV.js} +1 -1
- package/dist/chunks/logoUtils-x2pHV-Nl.js +1 -0
- package/dist/chunks/{magicDocs-DYc9TFmI.js → magicDocs-BEF8D3if.js} +3 -3
- package/dist/chunks/main-kOVUGxOS.js +345 -0
- package/dist/chunks/managedEnv-BEqrGqn1.js +1 -0
- package/dist/chunks/managedEnv-OPlzUPbJ.js +1 -0
- package/dist/chunks/mcp-BNd29r6p.js +6 -0
- package/dist/chunks/mcp-D0wAJrRT.js +1 -0
- package/dist/chunks/mcp-mgOlm1cY.js +2 -0
- package/dist/chunks/memory-DDLk9_LJ.js +1 -0
- package/dist/chunks/{mode-Pan-Q2c4.js → mode-CcNsWgK3.js} +2 -2
- package/dist/chunks/model-BwBG0V1u.js +1 -0
- package/dist/chunks/model-DzCP4K-9.js +1 -0
- package/dist/chunks/modelOptions-DRaG3bo0.js +1 -0
- package/dist/chunks/nativeInstaller-C3pVPqrZ.js +1 -0
- package/dist/chunks/notifications-4wP1Tx9Y.js +1 -0
- package/dist/chunks/onChangeAppState-BlaoFbYF.js +1 -0
- package/dist/chunks/openai-CDN71NdX.js +2 -0
- package/dist/chunks/{overlayContext-CMV7nYR9.js → overlayContext-BT2Lq8ei.js} +1 -1
- package/dist/chunks/{panel-D9fGQgln.js → panel-CVS4SK_E.js} +1 -1
- package/dist/chunks/parser-CG5RuOCK.js +1 -0
- package/dist/chunks/{parser-D8slvrJP.js → parser-Cg6hSCmn.js} +1 -1
- package/dist/chunks/partition-CIl_ORUT.js +1 -0
- package/dist/chunks/{pasteStore-DNV1M5Xd.js → pasteStore-P0zP-ch0.js} +1 -1
- package/dist/chunks/permissions-zSNOZSwr.js +3 -0
- package/dist/chunks/pidLock-BTqO-h7Y.js +3 -0
- package/dist/chunks/{plan-CQLnPLuE.js → plan-Bs6em6lk.js} +1 -1
- package/dist/chunks/{platform-Dzff1WWw.js → platform-BacQ6ACS.js} +1 -1
- package/dist/chunks/plugin-DDDxjBa0.js +17 -0
- package/dist/chunks/{pluginAutoupdate-BJaAqwTH.js → pluginAutoupdate-8qugAFhb.js} +1 -1
- package/dist/chunks/pluginBlocklist-q01ackCf.js +1 -0
- package/dist/chunks/pluginCliCommands-DXZfCZsv.js +1 -0
- package/dist/chunks/{pluginFlagging-DQP8tBi2.js → pluginFlagging-BG2MHCQJ.js} +1 -1
- package/dist/chunks/pluginOperations-hXYLrzM2.js +2 -0
- package/dist/chunks/{pluginStartupCheck-CfRvCrFg.js → pluginStartupCheck-DTMa6TgL.js} +1 -1
- package/dist/chunks/pluginStartupCheck-HS1ZceZa.js +1 -0
- package/dist/chunks/plugins-COoGBYk6.js +4 -0
- package/dist/chunks/{poorMode-J5SYJvoY.js → poorMode-B0QGV6Ci.js} +1 -1
- package/dist/chunks/poorMode-G-pnu6NM.js +1 -0
- package/dist/chunks/print-BASybEtO.js +13 -0
- package/dist/chunks/processBashCommand-DDi_Pymt.js +1 -0
- package/dist/chunks/processSlashCommand-Cq9kaoSF.js +5 -0
- package/dist/chunks/{projectContext-Bw3o5BrN.js → projectContext-5fmRr6Sd.js} +1 -1
- package/dist/chunks/{projectContext-BN2ZWzOG.js → projectContext-DhtjLv3k.js} +1 -1
- package/dist/chunks/{projectOnboardingState-CJycxw5P.js → projectOnboardingState-B5YATuc6.js} +1 -1
- package/dist/chunks/prompt-CHobfCB1.js +1 -0
- package/dist/chunks/prompt-CMm6RHHc.js +1 -0
- package/dist/chunks/{prompt-BGqgPgCU.js → prompt-mM79EGnT.js} +1 -1
- package/dist/chunks/{promptEditor-CmQ9p4oe.js → promptEditor-DLGN_eLu.js} +1 -1
- package/dist/chunks/{protocolHandler-CJo9-PfZ.js → protocolHandler-DjQALaU2.js} +1 -1
- package/dist/chunks/{proxy-CB17QimU.js → proxy-CDBfZjO7.js} +2 -2
- package/dist/chunks/reconciler-CeXqh95g.js +1 -0
- package/dist/chunks/refresh-Ce2yk28a.js +1 -0
- package/dist/chunks/{registerProtocol-CLIpzVwF.js → registerProtocol-CAsDme_E.js} +1 -1
- package/dist/chunks/reject-Bld5E-bn.js +1 -0
- package/dist/chunks/{reload-plugins-DjugL8jH.js → reload-plugins-C42xSB5l.js} +1 -1
- package/dist/chunks/rename-CtBghpxZ.js +1 -0
- package/dist/chunks/{renderOptions-Zqfm2U1y.js → renderOptions-DV0dn0IW.js} +1 -1
- package/dist/chunks/resume-BWkaTDqd.js +2 -0
- package/dist/chunks/ripgrep-DLs8MraF.js +1 -0
- package/dist/chunks/{ripgrep-BuzOTf1S.js → ripgrep-Dl3y5r4m.js} +1 -1
- package/dist/chunks/{runtimeObserver-CK_iZ6OB.js → runtimeObserver-1wQO8HSZ.js} +1 -1
- package/dist/chunks/{runtimeObserver-CpP0L9T9.js → runtimeObserver-XQrOux41.js} +4 -4
- package/dist/chunks/sandbox-adapter-8GO6eJxw.js +1 -0
- package/dist/chunks/{sandbox-toggle-KOHYvbQT.js → sandbox-toggle-Dir9Polo.js} +1 -1
- package/dist/chunks/searchExtraTools-BhDq8DTJ.js +1 -0
- package/dist/chunks/{select-C_KXmqbI.js → select-Bxf5-5sI.js} +1 -1
- package/dist/chunks/sessionFileAccessHooks-CozocHQE.js +1 -0
- package/dist/chunks/sessionObserver-DGEQM4cO.js +1 -0
- package/dist/chunks/{sessionObserver-WOYv2n7C.js → sessionObserver-DS4G6mb9.js} +2 -2
- package/dist/chunks/sessionStorage-BcAscOGE.js +1 -0
- package/dist/chunks/sessionTracing-BoDDYLxW.js +11 -0
- package/dist/chunks/settings-B2jvL8Dp.js +24 -0
- package/dist/chunks/settings-CisDe8DB.js +1 -0
- package/dist/chunks/setup-BRypY6iT.js +3 -0
- package/dist/chunks/{shadowedRuleDetection-Df-kZ_pK.js → shadowedRuleDetection-BRxZjobz.js} +1 -1
- package/dist/chunks/{sideQuestion-CMB8hfgX.js → sideQuestion-DLJxyrlp.js} +3 -3
- package/dist/chunks/sinks-CGdKmq_8.js +1 -0
- package/dist/chunks/sinks-Cz2HfgMU.js +1 -0
- package/dist/chunks/skillChangeDetector-xviGstqm.js +1 -0
- package/dist/chunks/{skillGapStore-CfmlO6pb.js → skillGapStore-CKN_d3pO.js} +2 -2
- package/dist/chunks/{skillLifecycle-BQ2LMfMx.js → skillLifecycle-BMY2JGGG.js} +2 -2
- package/dist/chunks/{skillSearchPanel-BwYuwLFs.js → skillSearchPanel-D9trHULQ.js} +2 -2
- package/dist/chunks/{skills-BVHPQma0.js → skills-CX_AvwLG.js} +1 -1
- package/dist/chunks/startupProfiler-BH0FoI66.js +1 -0
- package/dist/chunks/{startupProfiler-DTs9w9EN.js → startupProfiler-CJdr3SxP.js} +2 -2
- package/dist/chunks/state-B4jiUise.js +1 -0
- package/dist/chunks/state-BhOKSFi5.js +1 -0
- package/dist/chunks/status-Daaak6Bo.js +1 -0
- package/dist/chunks/statusNoticeHelpers-vFVgIYuw.js +1 -0
- package/dist/chunks/{stringUtils-BQm3OfeJ.js → stringUtils-C718f5ey.js} +1 -1
- package/dist/chunks/sts-ei3CGBNu.js +1 -0
- package/dist/chunks/switcher-BpgmH4AI.js +1 -0
- package/dist/chunks/{switcher-Bq1Ct_Sn.js → switcher-CAajZeNL.js} +1 -1
- package/dist/chunks/{tasks-0c8Uy04D.js → tasks-BWNQr2d3.js} +1 -1
- package/dist/chunks/{templateJobs-BdFzE9XG.js → templateJobs-gUET39Ho.js} +1 -1
- package/dist/chunks/{terminalSetup-Cf_r6pwK.js → terminalSetup-B_10N_gE.js} +3 -3
- package/dist/chunks/{terminalSetup-D7J6bxcn.js → terminalSetup-qc2PlvOm.js} +1 -1
- package/dist/chunks/{theme-Bby4fssR.js → theme-B7fKI6E5.js} +1 -1
- package/dist/chunks/tipRegistry-DamZr34w.js +2 -0
- package/dist/chunks/{toolEventObserver-CzFZUIsM.js → toolEventObserver-BL06sDI4.js} +1 -1
- package/dist/chunks/toolPool-CX5wDBi1.js +1 -0
- package/dist/chunks/{types-zk5Ltv5q.js → types-Dx7P7JLQ.js} +2 -2
- package/dist/chunks/udsClient-cQz6nJ_T.js +1 -0
- package/dist/chunks/{use-select-navigation-DMaC_3iw.js → use-select-navigation-BiUJdWai.js} +1 -1
- package/dist/chunks/{useExitOnCtrlCDWithKeybindings-CjW3gUOt.js → useExitOnCtrlCDWithKeybindings-C9BYG8Bo.js} +1 -1
- package/dist/chunks/useMainLoopModel-DwjSVzzO.js +1 -0
- package/dist/chunks/useManagePlugins-BqfIVa6E.js +1 -0
- package/dist/chunks/{useMergedTools-DarmnCEw.js → useMergedTools-Bw8FchX8.js} +1 -1
- package/dist/chunks/{useSearchInput-C2JuUW3g.js → useSearchInput-B25K1RnK.js} +1 -1
- package/dist/chunks/useSettingsErrors-DYQ44kX4.js +1 -0
- package/dist/chunks/{util-Bq5l7FF5.js → util-CtlC2dsN.js} +1 -1
- package/dist/chunks/validatePlugin-D6tFo87L.js +1 -0
- package/dist/chunks/vim-CoRp9lY1.js +1 -0
- package/dist/chunks/worktree-B8apCnVe.js +1 -0
- package/dist/cli.js +1 -1
- package/package.json +1 -5
- package/dist/chunks/AgentsMdExternalIncludesDialog-DCvgQ6n3.js +0 -1
- package/dist/chunks/App-BcEI6U5j.js +0 -1
- package/dist/chunks/ApproveApiKey-DegdTXZl.js +0 -1
- package/dist/chunks/ApproveApiKey-_VXIMSwY.js +0 -1
- package/dist/chunks/BackgroundTasksDialog-CjBt1L0p.js +0 -2
- package/dist/chunks/CustomSelect-B46Eh0gU.js +0 -1
- package/dist/chunks/Doctor-BP0Rqraa.js +0 -1
- package/dist/chunks/Doctor-By_y3C2V.js +0 -3
- package/dist/chunks/Grove-C3mhgshv.js +0 -11
- package/dist/chunks/MCPConnectionManager-ChN4Ayjk.js +0 -1
- package/dist/chunks/MCPToolListView-DLSrQHDc.js +0 -1
- package/dist/chunks/MessageSelector-CdDlJE48.js +0 -3
- package/dist/chunks/Messages-DuL_r1Or.js +0 -10
- package/dist/chunks/Onboarding-CE2GNA-h.js +0 -1
- package/dist/chunks/QueryEngine-DNNy1UCD.js +0 -1
- package/dist/chunks/REPL-CEhW-C41.js +0 -1
- package/dist/chunks/REPL-CkSL4C_8.js +0 -124
- package/dist/chunks/ResumeConversation-BMCO_3X7.js +0 -1
- package/dist/chunks/SearchExtraToolsTool-DSy_jDhf.js +0 -1
- package/dist/chunks/Settings-mDykHLok.js +0 -2
- package/dist/chunks/Spinner-DwsJJUtn.js +0 -1
- package/dist/chunks/TrustDialog-G4jM9IfM.js +0 -1
- package/dist/chunks/add-dir-7RfQAC3h.js +0 -1
- package/dist/chunks/agents-BNg_skSm.js +0 -101
- package/dist/chunks/allErrors-DaztSMrw.js +0 -1
- package/dist/chunks/auth-BTB00dq5.js +0 -10
- package/dist/chunks/auth-Bbc0Ny8i.js +0 -1
- package/dist/chunks/backgroundHousekeeping-DYz83_8C.js +0 -1
- package/dist/chunks/backgroundHousekeeping-bEZtlJSf.js +0 -17
- package/dist/chunks/banner-mqZEluky.js +0 -2
- package/dist/chunks/branch-exFKkymg.js +0 -2
- package/dist/chunks/btw-3l78DYET.js +0 -1
- package/dist/chunks/caches-6Nx6tsk9.js +0 -1
- package/dist/chunks/caches-ouaWB9bY.js +0 -1
- package/dist/chunks/client-C01Bnxxv.js +0 -1
- package/dist/chunks/client-DYRgRQsr.js +0 -1
- package/dist/chunks/commands-BoxOw75F.js +0 -1
- package/dist/chunks/compact-BOYr105K.js +0 -2
- package/dist/chunks/config-BddEvZZl.js +0 -3
- package/dist/chunks/config-GEv9hUzz.js +0 -1
- package/dist/chunks/config-kw4xg7Nk.js +0 -1
- package/dist/chunks/context-noninteractive-DFvoZ2L9.js +0 -1
- package/dist/chunks/conversation-CoGharlH.js +0 -1
- package/dist/chunks/conversation-MxEVm54C.js +0 -1
- package/dist/chunks/conversationRecovery-Da_8uldZ.js +0 -1
- package/dist/chunks/crossProjectResume-CzPCHq_K.js +0 -40
- package/dist/chunks/cwd-BcO6WHKo.js +0 -1
- package/dist/chunks/cwd-CDUelriw.js +0 -1
- package/dist/chunks/dist-es-5t7v8oaj.js +0 -1
- package/dist/chunks/dist-es-BIjDeceU.js +0 -1
- package/dist/chunks/dist-es-C-OjW2Ao.js +0 -1
- package/dist/chunks/dist-es-CEk66gUu.js +0 -1
- package/dist/chunks/dist-es-CIULjvtA2.js +0 -1
- package/dist/chunks/dist-es-CMtO44xC.js +0 -1
- package/dist/chunks/dist-es-CYPVg66r.js +0 -9
- package/dist/chunks/dist-es-D1Y8zSMI.js +0 -1
- package/dist/chunks/dist-es-Gt_DpXlP.js +0 -1
- package/dist/chunks/dist-es-kj-F5A132.js +0 -1
- package/dist/chunks/doctor-DWvioSU9.js +0 -1
- package/dist/chunks/esm-BQY8jJNR.js +0 -1
- package/dist/chunks/exit-BxC_ZEtO.js +0 -1
- package/dist/chunks/extraUsage-DYm33Occ.js +0 -1
- package/dist/chunks/extractMemories-CzN3Ax2B.js +0 -1
- package/dist/chunks/fast-DqUpl_Lr.js +0 -1
- package/dist/chunks/fast-NUdUyAaM.js +0 -1
- package/dist/chunks/fetchModelList-CqsTAWEN.js +0 -1
- package/dist/chunks/fetchModelList-DBMHE6Ng.js +0 -1
- package/dist/chunks/firstPartyEventLogger-C0q45h_4.js +0 -3
- package/dist/chunks/firstPartyEventLogger-CP8hCBDj.js +0 -1
- package/dist/chunks/generateSessionName-ChvKBVxB.js +0 -1
- package/dist/chunks/goal-ByyimpVU.js +0 -3
- package/dist/chunks/grok-DenjixMl.js +0 -1
- package/dist/chunks/grove-Dq8QbQ9o.js +0 -7
- package/dist/chunks/history-CNQNd6hT.js +0 -1
- package/dist/chunks/hooks-BaYwmkxD.js +0 -1
- package/dist/chunks/instrumentation-BwVyvRfY.js +0 -21
- package/dist/chunks/keybindings-wNxBzDVQ.js +0 -1
- package/dist/chunks/launchOnboarding-CDjQ64RO.js +0 -8
- package/dist/chunks/loadAgentsDir-DKXap_Om.js +0 -1
- package/dist/chunks/loadPluginHooks-DtmHtEiS.js +0 -1
- package/dist/chunks/localSearch-BB9x5C2N.js +0 -1
- package/dist/chunks/logoUtils-Dj_2SWmO.js +0 -1
- package/dist/chunks/main-BRg8L_aw.js +0 -346
- package/dist/chunks/managedEnv-DsqAYOJ4.js +0 -1
- package/dist/chunks/managedEnv-lybrMred.js +0 -1
- package/dist/chunks/mcp-Bsw3cMiJ.js +0 -6
- package/dist/chunks/mcp-DDdud6Y7.js +0 -1
- package/dist/chunks/mcp-DbgTDUt7.js +0 -2
- package/dist/chunks/memory-CzwTzihf.js +0 -1
- package/dist/chunks/model-BYfmXKHf.js +0 -1
- package/dist/chunks/model-BwBE0Pt5.js +0 -1
- package/dist/chunks/modelOptions-DvNBapgG.js +0 -1
- package/dist/chunks/nativeInstaller-DnSNJWIi.js +0 -1
- package/dist/chunks/notifications-B0DTaYoy.js +0 -1
- package/dist/chunks/omit-Dl1Us_PY.js +0 -1
- package/dist/chunks/onChangeAppState-4KOJMN82.js +0 -1
- package/dist/chunks/openai-C_6C1_0N.js +0 -10
- package/dist/chunks/parser-BKAVMTyD.js +0 -1
- package/dist/chunks/partition-B504IgAa.js +0 -1
- package/dist/chunks/permissions-CLFMhdRk.js +0 -3
- package/dist/chunks/pidLock-D9do1Afy.js +0 -3
- package/dist/chunks/plugin-BYdF7uob.js +0 -17
- package/dist/chunks/pluginBlocklist-DKKmOnWM.js +0 -1
- package/dist/chunks/pluginCliCommands-z8TtJMKH.js +0 -1
- package/dist/chunks/pluginOperations-BcfJCDco.js +0 -2
- package/dist/chunks/pluginStartupCheck-Cq4PvULa.js +0 -1
- package/dist/chunks/plugins-CTM8jpOw.js +0 -4
- package/dist/chunks/policyLimits-a7ix6GnU.js +0 -1
- package/dist/chunks/poorMode-C11JEH3d.js +0 -1
- package/dist/chunks/print-u6MzL5Cr.js +0 -13
- package/dist/chunks/processBashCommand-DIwrI2QC.js +0 -1
- package/dist/chunks/processSlashCommand-B-Gujpxm.js +0 -5
- package/dist/chunks/prompt-BPJDGlx5.js +0 -1
- package/dist/chunks/prompt-DEdZzkEz.js +0 -1
- package/dist/chunks/reconciler-DSKLuOS7.js +0 -1
- package/dist/chunks/refresh-BbZFCNpn.js +0 -1
- package/dist/chunks/rename-DOtCOtEr.js +0 -1
- package/dist/chunks/resume-BB4T4WIV.js +0 -2
- package/dist/chunks/ripgrep-CZ2CqaHb.js +0 -1
- package/dist/chunks/sandbox-adapter-DhJJ6WOV.js +0 -1
- package/dist/chunks/searchExtraTools-CdJghGkj.js +0 -1
- package/dist/chunks/sessionFileAccessHooks-D7KbWFp7.js +0 -1
- package/dist/chunks/sessionObserver-DB-sLv-X.js +0 -1
- package/dist/chunks/sessionStorage-sgOAbDn7.js +0 -1
- package/dist/chunks/sessionTracing-yBre24PH.js +0 -11
- package/dist/chunks/settings-C-KNkvsM.js +0 -1
- package/dist/chunks/settings-DKN4xSpQ.js +0 -24
- package/dist/chunks/setup-CN_Pk7AR.js +0 -3
- package/dist/chunks/sinks-BS17vtN0.js +0 -1
- package/dist/chunks/sinks-D1EjkHb4.js +0 -1
- package/dist/chunks/skillChangeDetector-CBKuGuEi.js +0 -1
- package/dist/chunks/startupProfiler-B_U4QDtf.js +0 -1
- package/dist/chunks/state-BowF111d.js +0 -1
- package/dist/chunks/state-CGuyDES7.js +0 -1
- package/dist/chunks/status-BurdTfyz.js +0 -2
- package/dist/chunks/status-DMq1An5h.js +0 -1
- package/dist/chunks/statusNoticeHelpers-X75JNlx5.js +0 -1
- package/dist/chunks/sts-C2Gf2WYN.js +0 -1
- package/dist/chunks/switcher-DGD4ORVf.js +0 -1
- package/dist/chunks/tipRegistry-CyRXWWTz.js +0 -2
- package/dist/chunks/toolPool-CnrZcprA.js +0 -1
- package/dist/chunks/udsClient-ftP0yIpe.js +0 -1
- package/dist/chunks/useMainLoopModel-DWscpA9I.js +0 -1
- package/dist/chunks/useManagePlugins-CYXVcql2.js +0 -1
- package/dist/chunks/useSettingsErrors-DutJBiKZ.js +0 -1
- package/dist/chunks/validatePlugin-DIdEydz_.js +0 -1
- package/dist/chunks/vim-D8prM2IH.js +0 -1
- package/dist/chunks/worktree-Caqt2WRZ.js +0 -1
- /package/dist/chunks/{dist-es-Cgsa8pb82.js → dist-es-Cgsa8pb8.js} +0 -0
- /package/dist/chunks/{dist-es-Cwru7c2B2.js → dist-es-Cwru7c2B.js} +0 -0
- /package/dist/chunks/{dist-es-DXIR5NLi2.js → dist-es-DXIR5NLi.js} +0 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{l as n,o as r}from"./envUtils-DfkgIdYf.js";import{n as i,t as a}from"./figures-5ThXQEtq.js";import{Bv as o,Co as s,Cx as c,Do as l,Eo as u,Fa as d,Gv as f,Ha as p,Hv as m,Ia as h,Ip as g,Ja as _,Jp as v,Kx as y,Lp as ee,Lv as b,Lx as x,Mo as S,Nv as C,Nx as w,Pv as T,Qa as te,Rv as E,So as ne,To as D,Uv as O,Ux as re,Va as k,Vv as A,Wv as ie,Wx as ae,Yp as oe,Za as se,_o as j,bb as ce,bx as le,eo as ue,gv as de,ho as fe,jo as pe,ko as me,lo as M,mb as N,md as P,oo as he,pd as F,po as ge,pv as _e,qx as ve,ro as ye,uo as be,vo as I,vu as xe,wo as Se,wx as Ce,xo as we,yu as Te,zp as Ee,zv as De,zx as Oe}from"./loadAgentsDir-DlPbtIsS.js";import{D as ke,Gr as Ae,Gt as L,H as je,I as R,P as z,T as B,Wt as Me,Xn as Ne,ai as V,hn as Pe,j as Fe,k as Ie,n as Le,ot as Re,r as ze,t as Be,x as Ve,y as He}from"./src-DL3w8VPk.js";import{t as Ue}from"./jsx-runtime-Bb4Xn-E0.js";import{I as We,M as Ge,S as Ke,V as qe,c as Je,i as Ye,x as Xe}from"./debug-Bglx1aTu.js";import{Hn as Ze,Vn as Qe,_t as $e,b as et,bt as tt,d as nt,h as rt,s as it}from"./settings-B2jvL8Dp.js";import{p as at,v as ot}from"./config-C-Y2qtB2.js";import{o as st,s as ct}from"./log-D2TIwHBV.js";import{l as H,o as lt}from"./stringUtils-C718f5ey.js";import{n as ut,r as dt}from"./analytics-DJobLaWP.js";import{S as ft,v as pt}from"./startupProfiler-CJdr3SxP.js";import{n as mt,t as ht}from"./TextInput-CD9iau2k.js";import{n as gt,t as _t}from"./pluginStartupCheck-DTMa6TgL.js";import{a as vt,d as yt,f as bt,i as xt,l as St,o as Ct,s as wt,u as Tt}from"./pluginOperations-hXYLrzM2.js";import{a as Et,c as Dt,i as Ot,n as kt,o as At,s as jt,t as Mt}from"./validatePlugin-D6tFo87L.js";import{a as Nt,n as Pt,o as Ft,r as It}from"./pluginFlagging-BG2MHCQJ.js";import{i as Lt,n as Rt}from"./MCPConnectionManager-thZd-xA_.js";import{n as zt,t as Bt}from"./useExitOnCtrlCDWithKeybindings-C9BYG8Bo.js";import{r as Vt,t as Ht}from"./Spinner-zYPFVFHN.js";import{t as Ut}from"./SearchBox-C9xxQzh1.js";import{n as Wt,t as Gt}from"./useSearchInput-B25K1RnK.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-CpY-YJg4.js";import{i as en,n as tn}from"./pluginAutoupdate-8qugAFhb.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 Et(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 ye(n,e=>{h(e)});j(e,{source:t}),pe();let r=n.source;n.source===`github`&&(r=n.repo),dt(`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=qe(e);ct(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)(R,{flexDirection:`column`,children:[(0,U.jsxs)(R,{flexDirection:`column`,paddingX:1,borderStyle:`round`,children:[(0,U.jsx)(R,{marginBottom:1,children:(0,U.jsx)(z,{bold:!0,children:`Add Marketplace`})}),(0,U.jsxs)(R,{flexDirection:`column`,children:[(0,U.jsx)(z,{children:`Enter marketplace source:`}),(0,U.jsx)(z,{dimColor:!0,children:`Examples:`}),(0,U.jsx)(z,{dimColor:!0,children:` · owner/repo (GitHub)`}),(0,U.jsx)(z,{dimColor:!0,children:` · git@github.com:owner/repo.git (SSH)`}),(0,U.jsx)(z,{dimColor:!0,children:` · https://example.com/marketplace.json`}),(0,U.jsx)(z,{dimColor:!0,children:` · ./path/to/marketplace`}),(0,U.jsx)(R,{marginTop:1,children:(0,U.jsx)(ht,{value:e,onChange:t,onSubmit:g,columns:80,cursorOffset:n,onChangeCursorOffset:r,focus:!0,showCursor:!0})})]}),f&&(0,U.jsxs)(R,{marginTop:1,children:[(0,U.jsx)(Ht,{}),(0,U.jsx)(z,{children:m||`Adding marketplace to configuration…`})]}),i&&(0,U.jsx)(R,{marginTop:1,children:(0,U.jsx)(z,{color:`error`,children:i})}),o&&(0,U.jsx)(R,{marginTop:1,children:(0,U.jsx)(z,{children:o})})]}),(0,U.jsx)(R,{marginLeft:3,children:(0,U.jsx)(z,{dimColor:!0,italic:!0,children:(0,U.jsxs)(B,{children:[(0,U.jsx)(ke,{shortcut:`Enter`,action:`add`}),(0,U.jsx)(F,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]})})})]})}var on,U,sn=e((()=>{on=t(V(),1),ut(),P(),Be(),Vt(),mt(),We(),st(),S(),M(),Ot(),U=Ue()}));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(Me(`confirm:no`,o,{context:`Settings`}),L({"confirm:nextField":(0,un.useCallback)(()=>{if(l<s.length-1&&h){f(e=>({...e,[h]:p})),u(e=>e+1);let e=s[l+1];m(e?c(e):``)}},[l,s,h,p,c]),"confirm:yes":(0,un.useCallback)(()=>{if(!h)return;let e={...d,[h]:p};if(l===s.length-1)i(cn(s,e,n,r));else{f(e),u(e=>e+1);let t=s[l+1];m(t?c(t):``)}},[h,d,p,l,s,n,i,c,r])},{context:`Confirmation`}),Pe((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(Ae(p)):p;return(0,dn.jsxs)(He,{title:e,subtitle:t,onCancel:o,isCancelActive:!1,children:[(0,dn.jsxs)(R,{flexDirection:`column`,children:[(0,dn.jsxs)(z,{bold:!0,children:[g.title||h,v&&(0,dn.jsx)(z,{color:`error`,children:` *`})]}),g.description&&(0,dn.jsx)(z,{dimColor:!0,children:g.description}),(0,dn.jsxs)(R,{marginTop:1,children:[(0,dn.jsxs)(z,{children:[a.pointerSmall,` `]}),(0,dn.jsx)(z,{children:y}),(0,dn.jsx)(z,{children:`█`})]})]}),(0,dn.jsxs)(R,{flexDirection:`column`,children:[(0,dn.jsxs)(z,{dimColor:!0,children:[`Field `,l+1,` of `,s.length]}),l<s.length-1&&(0,dn.jsx)(z,{dimColor:!0,children:`Tab: Next field · Enter: Save and continue`}),l===s.length-1&&(0,dn.jsx)(z,{dimColor:!0,children:`Enter: Save configuration`})]})]})}var un,dn,fn=e((()=>{i(),un=t(V(),1),Be(),N(),r(),dn=Ue()}));async function pn(e){let{enabled:t,disabled:n}=await h();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=b(e);Object.keys(r).length>0&&n.push({key:`top-level`,title:`Configure ${e.name}`,subtitle:`Plugin options`,schema:r,load:()=>De(t),save:n=>o(t,n,e.manifest.userConfig)});let i=C(e);for(let r of i)n.push({key:`channel:${r.server}`,title:`Configure ${r.displayName}`,subtitle:`Plugin: ${e.name}`,schema:r.configSchema,load:()=>O(t,r.server)??void 0,save:e=>f(t,r.server,e,r.configSchema)});return n}),[i,a]=hn.useState(0),s=hn.useRef(n);if(s.current=n,hn.useEffect(()=>{r.length===0&&s.current(`skipped`)},[r.length]),r.length===0)return null;let c=r[i];function l(e){try{c.save(e)}catch(e){n(`error`,Ge(e));return}let t=i+1;t<r.length?a(t):n(`configured`)}return(0,gn.jsx)(ln,{title:c.title,subtitle:c.subtitle,configSchema:c.schema,initialValues:c.load(),onSave:l,onCancel:()=>n(`skipped`)},c.key)}var hn,gn,_n=e((()=>{hn=t(V(),1),We(),A(),T(),d(),E(),fn(),gn=Ue()}));function vn(){let e=u();return(0,yn.jsxs)(R,{marginBottom:1,children:[(0,yn.jsxs)(z,{color:`claude`,children:[a.warning,` `]}),(0,yn.jsxs)(z,{dimColor:!0,italic:!0,children:[`Make sure you trust a plugin before installing, updating, or using it. We do not control what MCP servers, files, or other software are included in plugins and cannot verify that they will work as intended or that they won't change. See each plugin's homepage for more information.`,e?` ${e}`:``]})]})}var yn,bn=e((()=>{i(),Be(),l(),yn=Ue()}));function xn(e){return e.entry.source&&typeof e.entry.source==`object`&&`source`in e.entry.source&&e.entry.source.source===`github`&&typeof e.entry.source==`object`&&`repo`in e.entry.source?e.entry.source.repo:null}function Sn(e,t){let n=[{label:`Install for you (user scope)`,action:`install-user`},{label:`Install for all collaborators on this repository (project scope)`,action:`install-project`},{label:`Install for you, in this repo only (local scope)`,action:`install-local`}];return e&&n.push({label:`Open homepage`,action:`homepage`}),t&&n.push({label:`View on GitHub`,action:`github`}),n.push({label:`Back to plugin list`,action:`back`}),n}function Cn({hasSelection:e}){return(0,wn.jsx)(R,{marginTop:1,children:(0,wn.jsx)(z,{dimColor:!0,italic:!0,children:(0,wn.jsxs)(B,{children:[e&&(0,wn.jsx)(F,{action:`plugin:install`,context:`Plugin`,fallback:`i`,description:`install`,bold:!0}),(0,wn.jsx)(F,{action:`plugin:toggle`,context:`Plugin`,fallback:`Space`,description:`toggle`}),(0,wn.jsx)(F,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`details`}),(0,wn.jsx)(F,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})}var wn,Tn=e((()=>{P(),Be(),wn=Ue()}));function En({totalItems:e,maxVisible:t=On,selectedIndex:n=0}){let r=e>t,i=(0,Dn.useRef)(0),a=(0,Dn.useMemo)(()=>{if(!r)return 0;let a=i.current;if(n<a)return i.current=n,n;if(n>=a+t){let e=n-t+1;return i.current=e,e}let o=Math.max(0,e-t),s=Math.min(a,o);return i.current=s,s},[n,t,r,e]),o=a,s=Math.min(a+t,e),c=(0,Dn.useCallback)(e=>r?e.slice(o,s):e,[r,o,s]),l=(0,Dn.useCallback)(e=>o+e,[o]),u=(0,Dn.useCallback)(e=>e>=o&&e<s,[o,s]),d=(0,Dn.useCallback)(e=>{},[]),f=(0,Dn.useCallback)(()=>{},[]),p=(0,Dn.useCallback)(()=>{},[]),m=(0,Dn.useCallback)((t,n)=>{n(Math.max(0,Math.min(t,e-1)))},[e]),h=(0,Dn.useCallback)((e,t)=>!1,[]),g=Math.max(1,Math.ceil(e/t));return{currentPage:Math.floor(a/t),totalPages:g,startIndex:o,endIndex:s,needsPagination:r,pageSize:t,getVisibleItems:c,toActualIndex:l,isOnCurrentPage:u,goToPage:d,nextPage:f,prevPage:p,handleSelectionChange:m,handlePageNavigation:h,scrollPosition:{current:n+1,total:e,canScrollUp:a>0,canScrollDown:a+t<e}}}var Dn,On,kn=e((()=>{Dn=t(V(),1),On=5}));function An({error:e,setError:t,result:n,setResult:r,setViewState:i,onInstallComplete:o,targetMarketplace:c,targetPlugin:l}){let[u,d]=(0,W.useState)(`marketplace-list`),[f,m]=(0,W.useState)(null),[h,g]=(0,W.useState)(null),[_,v]=(0,W.useState)([]),[y,ee]=(0,W.useState)([]),[b,x]=(0,W.useState)(!0),[S,C]=(0,W.useState)(null),[w,T]=(0,W.useState)(0),[E,ne]=(0,W.useState)(new Set),[O,re]=(0,W.useState)(new Set),k=En({totalItems:y.length,selectedIndex:w}),[A,ie]=(0,W.useState)(0),[ae,j]=(0,W.useState)(!1),[ce,le]=(0,W.useState)(null),[ue,de]=(0,W.useState)(null);Me(`confirm:no`,jn.useCallback(()=>{u===`plugin-list`?c?i({type:`manage-marketplaces`,targetMarketplace:c}):_.length===1?i({type:`menu`}):(d(`marketplace-list`),m(null),ne(new Set)):u===`plugin-details`?(d(`plugin-list`),g(null)):i({type:`menu`})},[u,c,i,_.length]),{context:`Confirmation`}),(0,W.useEffect)(()=>{async function e(){try{let e=await be(),{marketplaces:n,failures:r}=await me(e),i=[];for(let{name:e,config:t,data:r}of n)if(r){let n=Qe(r.plugins,t=>te(we(t.name,e)));i.push({name:e,totalPlugins:r.plugins.length,installedCount:n,source:D(t.source)})}i.sort((e,t)=>e.name===`claude-plugin-directory`?-1:+(t.name===`claude-plugin-directory`)),v(i);let a=Se(r,Qe(n,e=>e.data!==null));if(a)if(a.type===`warning`)de(`${a.message}. Showing available marketplaces.`);else throw Error(a.message);if(i.length===1&&!c&&!l){let e=i[0];e&&(m(e.name),d(`plugin-list`))}if(l){let n=null,r=null;for(let[t]of Object.entries(e)){let e=await he(t);if(e){let i=e.plugins.find(e=>e.name===l);if(i){let e=we(i.name,t);n={entry:i,marketplaceName:t,pluginId:e,isInstalled:se(e)},r=t;break}}}if(n&&r){let e=n.pluginId;se(e)?t(`Plugin '${e}' is already installed globally. Use '/plugin' to manage existing plugins.`):(m(r),g(n),d(`plugin-details`))}else t(`Plugin "${l}" not found in any marketplace`)}else c&&(i.some(e=>e.name===c)?(m(c),d(`plugin-list`)):t(`Marketplace "${c}" not found`))}catch(e){t(e instanceof Error?e.message:`Failed to load marketplaces`)}finally{x(!1)}}e()},[t,c,l]),(0,W.useEffect)(()=>{if(!f)return;let e=!1;async function n(n){x(!0);try{let t=await he(n);if(e)return;if(!t)throw Error(`Failed to load marketplace: ${n}`);let r=[];for(let e of t.plugins){let t=we(e.name,n);oe(t)||r.push({entry:e,marketplaceName:n,pluginId:t,isInstalled:se(t)})}try{let t=await jt();if(e)return;C(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;Je(`Failed to fetch install counts: ${Ge(t)}`),r.sort((e,t)=>e.entry.name.localeCompare(t.entry.name))}ee(r),T(0),ne(new Set)}catch(n){if(e)return;t(n instanceof Error?n.message:`Failed to load plugins`)}finally{x(!1)}}return n(f),()=>{e=!0}},[f,t]);let fe=async()=>{if(E.size===0)return;let e=y.filter(e=>E.has(e.pluginId));re(new Set(e.map(e=>e.pluginId)));let n=0,a=0,c=[];for(let t of e){let e=await p({pluginId:t.pluginId,entry:t.entry,marketplaceName:t.marketplaceName,scope:`user`});e.success?n++:(a++,c.push({name:t.entry.name,reason:e.error}))}re(new Set),ne(new Set),pe(),a===0?r(`✓ Installed ${n} ${H(n,`plugin`)}. Run /reload-plugins to activate.`):n===0?t(`Failed to install: ${s(c,!0)}`):r(`✓ Installed ${n} of ${n+a} plugins. Failed: ${s(c,!1)}. Run /reload-plugins to activate successfully installed plugins.`),n>0&&o&&await o(),i({type:`menu`})},M=async(e,t=`user`)=>{j(!0),le(null);let n=await p({pluginId:e.pluginId,entry:e.entry,marketplaceName:e.marketplaceName,scope:t});if(n.success){let t=await pn(e.pluginId);if(t){j(!1),d({type:`plugin-options`,plugin:t,pluginId:e.pluginId});return}r(n.message),o&&await o(),i({type:`menu`})}else j(!1),le(n.error)};(0,W.useEffect)(()=>{e&&r(e)},[e,r]),L({"select:previous":()=>{w>0&&T(w-1)},"select:next":()=>{w<_.length-1&&T(w+1)},"select:accept":()=>{let e=_[w];e&&(m(e.name),d(`plugin-list`))}},{context:`Select`,isActive:u===`marketplace-list`}),L({"select:previous":()=>{w>0&&k.handleSelectionChange(w-1,T)},"select:next":()=>{w<y.length-1&&k.handleSelectionChange(w+1,T)},"select:accept":()=>{if(w===y.length&&E.size>0)fe();else if(w<y.length){let e=y[w];e&&(e.isInstalled?i({type:`manage-plugins`,targetPlugin:e.entry.name,targetMarketplace:e.marketplaceName}):(g(e),d(`plugin-details`),ie(0),le(null)))}}},{context:`Select`,isActive:u===`plugin-list`}),L({"plugin:toggle":()=>{if(w<y.length){let e=y[w];if(e&&!e.isInstalled){let t=new Set(E);t.has(e.pluginId)?t.delete(e.pluginId):t.add(e.pluginId),ne(t)}}},"plugin:install":()=>{E.size>0&&fe()}},{context:`Plugin`,isActive:u===`plugin-list`});let N=jn.useMemo(()=>{if(!h)return[];let e=h.entry.homepage;return Sn(e,xn(h))},[h]);if(L({"select:previous":()=>{A>0&&ie(A-1)},"select:next":()=>{A<N.length-1&&ie(A+1)},"select:accept":()=>{if(!h)return;let e=N[A]?.action,t=h.entry.homepage,n=xn(h);e===`install-user`?M(h,`user`):e===`install-project`?M(h,`project`):e===`install-local`?M(h,`local`):e===`homepage`&&t?Te(t):e===`github`&&n?Te(`https://github.com/${n}`):e===`back`&&(d(`plugin-list`),g(null))}},{context:`Select`,isActive:u===`plugin-details`&&!!h}),typeof u==`object`&&u.type===`plugin-options`){let{plugin:e,pluginId:t}=u;function n(e){r(e),o&&o(),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(b)return(0,G.jsx)(z,{children:`Loading…`});if(e)return(0,G.jsx)(z,{color:`error`,children:e});if(u===`marketplace-list`)return _.length===0?(0,G.jsxs)(R,{flexDirection:`column`,children:[(0,G.jsx)(R,{marginBottom:1,children:(0,G.jsx)(z,{bold:!0,children:`Select marketplace`})}),(0,G.jsx)(z,{children:`No marketplaces configured.`}),(0,G.jsxs)(z,{dimColor:!0,children:[`Add a marketplace first using `,`'Add marketplace'`,`.`]}),(0,G.jsx)(R,{marginTop:1,paddingLeft:1,children:(0,G.jsx)(z,{dimColor:!0,children:(0,G.jsx)(F,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})})})]}):(0,G.jsxs)(R,{flexDirection:`column`,children:[(0,G.jsx)(R,{marginBottom:1,children:(0,G.jsx)(z,{bold:!0,children:`Select marketplace`})}),ue&&(0,G.jsx)(R,{marginBottom:1,flexDirection:`column`,children:(0,G.jsxs)(z,{color:`warning`,children:[a.warning,` `,ue]})}),_.map((e,t)=>(0,G.jsxs)(R,{flexDirection:`column`,marginBottom:+(t<_.length-1),children:[(0,G.jsx)(R,{children:(0,G.jsxs)(z,{color:w===t?`suggestion`:void 0,children:[w===t?a.pointer:` `,` `,e.name]})}),(0,G.jsx)(R,{marginLeft:2,children:(0,G.jsxs)(z,{dimColor:!0,children:[e.totalPlugins,` `,H(e.totalPlugins,`plugin`),` available`,e.installedCount>0&&` · ${e.installedCount} already installed`,e.source&&` · ${e.source}`]})})]},e.name)),(0,G.jsx)(R,{marginTop:1,children:(0,G.jsx)(z,{dimColor:!0,italic:!0,children:(0,G.jsxs)(B,{children:[(0,G.jsx)(F,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,G.jsx)(F,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]})})})]});if(u===`plugin-details`&&h){let e=h.entry.homepage,t=Sn(e,xn(h));return(0,G.jsxs)(R,{flexDirection:`column`,children:[(0,G.jsx)(R,{marginBottom:1,children:(0,G.jsx)(z,{bold:!0,children:`Plugin Details`})}),(0,G.jsxs)(R,{flexDirection:`column`,marginBottom:1,children:[(0,G.jsx)(z,{bold:!0,children:h.entry.name}),h.entry.version&&(0,G.jsxs)(z,{dimColor:!0,children:[`Version: `,h.entry.version]}),h.entry.description&&(0,G.jsx)(R,{marginTop:1,children:(0,G.jsx)(z,{children:h.entry.description})}),h.entry.author&&(0,G.jsx)(R,{marginTop:1,children:(0,G.jsxs)(z,{dimColor:!0,children:[`By:`,` `,typeof h.entry.author==`string`?h.entry.author:h.entry.author.name]})})]}),(0,G.jsxs)(R,{flexDirection:`column`,marginBottom:1,children:[(0,G.jsx)(z,{bold:!0,children:`Will install:`}),h.entry.commands&&(0,G.jsxs)(z,{dimColor:!0,children:[`· Commands:`,` `,Array.isArray(h.entry.commands)?h.entry.commands.join(`, `):Object.keys(h.entry.commands).join(`, `)]}),h.entry.agents&&(0,G.jsxs)(z,{dimColor:!0,children:[`· Agents:`,` `,Array.isArray(h.entry.agents)?h.entry.agents.join(`, `):Object.keys(h.entry.agents).join(`, `)]}),h.entry.hooks&&(0,G.jsxs)(z,{dimColor:!0,children:[`· Hooks: `,Object.keys(h.entry.hooks).join(`, `)]}),h.entry.mcpServers&&(0,G.jsxs)(z,{dimColor:!0,children:[`· MCP Servers:`,` `,Array.isArray(h.entry.mcpServers)?h.entry.mcpServers.join(`, `):typeof h.entry.mcpServers==`object`?Object.keys(h.entry.mcpServers).join(`, `):`configured`]}),!h.entry.commands&&!h.entry.agents&&!h.entry.hooks&&!h.entry.mcpServers&&(typeof h.entry.source==`object`&&`source`in h.entry.source&&(h.entry.source.source===`github`||h.entry.source.source===`url`||h.entry.source.source===`npm`||h.entry.source.source===`pip`)?(0,G.jsx)(z,{dimColor:!0,children:`· Component summary not available for remote plugin`}):(0,G.jsx)(z,{dimColor:!0,children:`· Components will be discovered at installation`}))]}),(0,G.jsx)(vn,{}),ce&&(0,G.jsx)(R,{marginBottom:1,children:(0,G.jsxs)(z,{color:`error`,children:[`Error: `,ce]})}),(0,G.jsx)(R,{flexDirection:`column`,children:t.map((e,t)=>(0,G.jsxs)(R,{children:[A===t&&(0,G.jsx)(z,{children:`> `}),A!==t&&(0,G.jsx)(z,{children:` `}),(0,G.jsx)(z,{bold:A===t,children:ae&&e.action===`install`?`Installing…`:e.label})]},e.action))}),(0,G.jsx)(R,{marginTop:1,paddingLeft:1,children:(0,G.jsx)(z,{dimColor:!0,children:(0,G.jsxs)(B,{children:[(0,G.jsx)(F,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,G.jsx)(F,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}if(y.length===0)return(0,G.jsxs)(R,{flexDirection:`column`,children:[(0,G.jsx)(R,{marginBottom:1,children:(0,G.jsx)(z,{bold:!0,children:`Install plugins`})}),(0,G.jsx)(z,{dimColor:!0,children:`No new plugins available to install.`}),(0,G.jsx)(z,{dimColor:!0,children:`All plugins from this marketplace are already installed.`}),(0,G.jsx)(R,{marginLeft:3,children:(0,G.jsx)(z,{dimColor:!0,italic:!0,children:(0,G.jsx)(F,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})})})]});let P=k.getVisibleItems(y);return(0,G.jsxs)(R,{flexDirection:`column`,children:[(0,G.jsx)(R,{marginBottom:1,children:(0,G.jsx)(z,{bold:!0,children:`Install Plugins`})}),k.scrollPosition.canScrollUp&&(0,G.jsx)(R,{children:(0,G.jsxs)(z,{dimColor:!0,children:[` `,a.arrowUp,` more above`]})}),P.map((t,n)=>{let r=k.toActualIndex(n),i=w===r,o=E.has(t.pluginId),s=O.has(t.pluginId);return(0,G.jsxs)(R,{flexDirection:`column`,marginBottom:n===P.length-1&&!e?0:1,children:[(0,G.jsxs)(R,{children:[(0,G.jsxs)(z,{color:i?`suggestion`:void 0,children:[i?a.pointer:` `,` `]}),(0,G.jsxs)(z,{color:t.isInstalled?`success`:void 0,children:[t.isInstalled?a.tick:s?a.ellipsis:o?a.radioOn:a.radioOff,` `,t.entry.name,t.entry.category&&(0,G.jsxs)(z,{dimColor:!0,children:[` [`,t.entry.category,`]`]}),t.entry.tags?.includes(`community-managed`)&&(0,G.jsx)(z,{dimColor:!0,children:` [Community Managed]`}),t.isInstalled&&(0,G.jsx)(z,{dimColor:!0,children:` (installed)`}),S&&f===`claude-plugins-official`&&(0,G.jsxs)(z,{dimColor:!0,children:[` · `,At(S.get(t.pluginId)??0),` installs`]})]})]}),t.entry.description&&(0,G.jsxs)(R,{marginLeft:4,children:[(0,G.jsx)(z,{dimColor:!0,children:ft(t.entry.description,60)}),t.entry.version&&(0,G.jsxs)(z,{dimColor:!0,children:[` · v`,t.entry.version]})]})]},t.pluginId)}),k.scrollPosition.canScrollDown&&(0,G.jsx)(R,{children:(0,G.jsxs)(z,{dimColor:!0,children:[` `,a.arrowDown,` more below`]})}),e&&(0,G.jsx)(R,{marginTop:1,children:(0,G.jsxs)(z,{color:`error`,children:[a.cross,` `,e]})}),(0,G.jsx)(Cn,{hasSelection:E.size>0})]})}var jn,W,G,Mn=e((()=>{i(),jn=t(V(),1),W=t(V(),1),P(),Be(),N(),Ze(),xe(),Ye(),We(),S(),Dt(),_(),l(),M(),w(),k(),v(),lt(),pt(),_n(),bn(),Tn(),kn(),G=Ue()}));function Nn({error:e,setError:t,result:n,setResult:r,setViewState:i,onInstallComplete:o,onSearchModeChange:c,targetPlugin:l}){let[u,d]=(0,K.useState)(`plugin-list`),[f,m]=(0,K.useState)(null),[h,g]=(0,K.useState)([]),[_,v]=(0,K.useState)(!0),[y,ee]=(0,K.useState)(null),[b,x]=(0,K.useState)(!1),S=(0,K.useCallback)(e=>{x(e),c?.(e)},[c]),{query:C,setQuery:w,cursorOffset:T}=Wt({isActive:u===`plugin-list`&&b&&!_,onExit:()=>{S(!1)}}),te=Ne(),{columns:E}=Re(),D=(0,K.useMemo)(()=>{if(!C)return h;let e=C.toLowerCase();return h.filter(t=>t.entry.name.toLowerCase().includes(e)||t.entry.description?.toLowerCase().includes(e)||t.marketplaceName.toLowerCase().includes(e))},[h,C]),[O,re]=(0,K.useState)(0),[k,A]=(0,K.useState)(new Set),[ie,ae]=(0,K.useState)(new Set),j=En({totalItems:D.length,selectedIndex:O});(0,K.useEffect)(()=>{re(0)},[C]);let[ce,le]=(0,K.useState)(0),[ue,de]=(0,K.useState)(!1),[fe,M]=(0,K.useState)(null),[N,P]=(0,K.useState)(null),[he,ge]=(0,K.useState)(null);(0,K.useEffect)(()=>{async function e(){try{let e=await be(),{marketplaces:n,failures:r}=await me(e),i=[];for(let{name:e,data:t}of n)if(t)for(let n of t.plugins){let t=we(n.name,e);i.push({entry:n,marketplaceName:e,pluginId:t,isInstalled:se(t)})}let a=i.filter(e=>!e.isInstalled&&!oe(e.pluginId));try{let e=await jt();ee(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){Je(`Failed to fetch install counts: ${Ge(e)}`),a.sort((e,t)=>e.entry.name.localeCompare(t.entry.name))}g(a);let o=Object.keys(e).length;if(a.length===0){let e=await ne({configuredMarketplaceCount:o,failedMarketplaceCount:r.length});ge(e)}let s=Se(r,Qe(n,e=>e.data!==null));if(s)if(s.type===`warning`)P(`${s.message}. Showing available plugins.`);else throw Error(s.message);if(l){let e=i.find(e=>e.entry.name===l);e?e.isInstalled?t(`Plugin '${e.pluginId}' is already installed. Use '/plugin' to manage existing plugins.`):(m(e),d(`plugin-details`)):t(`Plugin "${l}" not found in any marketplace`)}}catch(e){t(e instanceof Error?e.message:`Failed to load plugins`)}finally{v(!1)}}e()},[t,l]);let _e=async()=>{if(k.size===0)return;let e=h.filter(e=>k.has(e.pluginId));ae(new Set(e.map(e=>e.pluginId)));let n=0,a=0,c=[];for(let t of e){let e=await p({pluginId:t.pluginId,entry:t.entry,marketplaceName:t.marketplaceName,scope:`user`});e.success?n++:(a++,c.push({name:t.entry.name,reason:e.error}))}ae(new Set),A(new Set),pe(),a===0?r(`✓ Installed ${n} ${H(n,`plugin`)}. Run /reload-plugins to activate.`):n===0?t(`Failed to install: ${s(c,!0)}`):r(`✓ Installed ${n} of ${n+a} plugins. Failed: ${s(c,!1)}. Run /reload-plugins to activate successfully installed plugins.`),n>0&&o&&await o(),i({type:`menu`})},ve=async(e,t=`user`)=>{de(!0),M(null);let n=await p({pluginId:e.pluginId,entry:e.entry,marketplaceName:e.marketplaceName,scope:t});if(n.success){let t=await pn(e.pluginId);if(t){de(!1),d({type:`plugin-options`,plugin:t,pluginId:e.pluginId});return}r(n.message),o&&await o(),i({type:`menu`})}else de(!1),M(n.error)};(0,K.useEffect)(()=>{e&&r(e)},[e,r]),Me(`confirm:no`,()=>{d(`plugin-list`),m(null)},{context:`Confirmation`,isActive:u===`plugin-details`}),Me(`confirm:no`,()=>{i({type:`menu`})},{context:`Confirmation`,isActive:u===`plugin-list`&&!b}),Pe((e,t)=>{let n=!t.ctrl&&!t.meta;b||(e===`/`&&n?(S(!0),w(``)):n&&e.length>0&&!/^\s+$/.test(e)&&e!==`j`&&e!==`k`&&e!==`i`&&(S(!0),w(e)))},{isActive:u===`plugin-list`&&!_}),L({"select:previous":()=>{O===0?S(!0):j.handleSelectionChange(O-1,re)},"select:next":()=>{O<D.length-1&&j.handleSelectionChange(O+1,re)},"select:accept":()=>{if(O===D.length&&k.size>0)_e();else if(O<D.length){let e=D[O];e&&(e.isInstalled?i({type:`manage-plugins`,targetPlugin:e.entry.name,targetMarketplace:e.marketplaceName}):(m(e),d(`plugin-details`),le(0),M(null)))}}},{context:`Select`,isActive:u===`plugin-list`&&!b}),L({"plugin:toggle":()=>{if(O<D.length){let e=D[O];if(e&&!e.isInstalled){let t=new Set(k);t.has(e.pluginId)?t.delete(e.pluginId):t.add(e.pluginId),A(t)}}},"plugin:install":()=>{k.size>0&&_e()}},{context:`Plugin`,isActive:u===`plugin-list`&&!b});let ye=In.useMemo(()=>{if(!f)return[];let e=f.entry.homepage;return Sn(e,xn(f))},[f]);if(L({"select:previous":()=>{ce>0&&le(ce-1)},"select:next":()=>{ce<ye.length-1&&le(ce+1)},"select:accept":()=>{if(!f)return;let e=ye[ce]?.action,t=f.entry.homepage,n=xn(f);e===`install-user`?ve(f,`user`):e===`install-project`?ve(f,`project`):e===`install-local`?ve(f,`local`):e===`homepage`&&t?Te(t):e===`github`&&n?Te(`https://github.com/${n}`):e===`back`&&(d(`plugin-list`),m(null))}},{context:`Select`,isActive:u===`plugin-details`&&!!f}),typeof u==`object`&&u.type===`plugin-options`){let{plugin:e,pluginId:t}=u;function n(e){r(e),o&&o(),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(_)return(0,q.jsx)(z,{children:`Loading…`});if(e)return(0,q.jsx)(z,{color:`error`,children:e});if(u===`plugin-details`&&f){let e=f.entry.homepage,t=Sn(e,xn(f));return(0,q.jsxs)(R,{flexDirection:`column`,children:[(0,q.jsx)(R,{marginBottom:1,children:(0,q.jsx)(z,{bold:!0,children:`Plugin details`})}),(0,q.jsxs)(R,{flexDirection:`column`,marginBottom:1,children:[(0,q.jsx)(z,{bold:!0,children:f.entry.name}),(0,q.jsxs)(z,{dimColor:!0,children:[`from `,f.marketplaceName]}),f.entry.version&&(0,q.jsxs)(z,{dimColor:!0,children:[`Version: `,f.entry.version]}),f.entry.description&&(0,q.jsx)(R,{marginTop:1,children:(0,q.jsx)(z,{children:f.entry.description})}),f.entry.author&&(0,q.jsx)(R,{marginTop:1,children:(0,q.jsxs)(z,{dimColor:!0,children:[`By:`,` `,typeof f.entry.author==`string`?f.entry.author:f.entry.author.name]})})]}),(0,q.jsx)(vn,{}),fe&&(0,q.jsx)(R,{marginBottom:1,children:(0,q.jsxs)(z,{color:`error`,children:[`Error: `,fe]})}),(0,q.jsx)(R,{flexDirection:`column`,children:t.map((e,t)=>(0,q.jsxs)(R,{children:[ce===t&&(0,q.jsx)(z,{children:`> `}),ce!==t&&(0,q.jsx)(z,{children:` `}),(0,q.jsx)(z,{bold:ce===t,children:ue&&e.action.startsWith(`install-`)?`Installing…`:e.label})]},e.action))}),(0,q.jsx)(R,{marginTop:1,children:(0,q.jsx)(z,{dimColor:!0,children:(0,q.jsxs)(B,{children:[(0,q.jsx)(F,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,q.jsx)(F,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}if(h.length===0)return(0,q.jsxs)(R,{flexDirection:`column`,children:[(0,q.jsx)(R,{marginBottom:1,children:(0,q.jsx)(z,{bold:!0,children:`Discover plugins`})}),(0,q.jsx)(Fn,{reason:he}),(0,q.jsx)(R,{marginTop:1,children:(0,q.jsx)(z,{dimColor:!0,italic:!0,children:`Esc to go back`})})]});let I=j.getVisibleItems(D);return(0,q.jsxs)(R,{flexDirection:`column`,children:[(0,q.jsxs)(R,{children:[(0,q.jsx)(z,{bold:!0,children:`Discover plugins`}),j.needsPagination&&(0,q.jsxs)(z,{dimColor:!0,children:[` `,`(`,j.scrollPosition.current,`/`,j.scrollPosition.total,`)`]})]}),(0,q.jsx)(R,{marginBottom:1,children:(0,q.jsx)(Ie,{query:C,isFocused:b,isTerminalFocused:te,width:E-4,cursorOffset:T})}),N&&(0,q.jsx)(R,{marginBottom:1,children:(0,q.jsxs)(z,{color:`warning`,children:[a.warning,` `,N]})}),D.length===0&&C&&(0,q.jsx)(R,{marginBottom:1,children:(0,q.jsxs)(z,{dimColor:!0,children:[`No plugins match "`,C,`"`]})}),j.scrollPosition.canScrollUp&&(0,q.jsx)(R,{children:(0,q.jsxs)(z,{dimColor:!0,children:[` `,a.arrowUp,` more above`]})}),I.map((t,n)=>{let r=j.toActualIndex(n),i=O===r,o=k.has(t.pluginId),s=ie.has(t.pluginId);return(0,q.jsxs)(R,{flexDirection:`column`,marginBottom:n===I.length-1&&!e?0:1,children:[(0,q.jsxs)(R,{children:[(0,q.jsxs)(z,{color:i&&!b?`suggestion`:void 0,children:[i&&!b?a.pointer:` `,` `]}),(0,q.jsxs)(z,{children:[s?a.ellipsis:o?a.radioOn:a.radioOff,` `,t.entry.name,(0,q.jsxs)(z,{dimColor:!0,children:[` · `,t.marketplaceName]}),t.entry.tags?.includes(`community-managed`)&&(0,q.jsx)(z,{dimColor:!0,children:` [Community Managed]`}),y&&t.marketplaceName===`claude-plugins-official`&&(0,q.jsxs)(z,{dimColor:!0,children:[` · `,At(y.get(t.pluginId)??0),` installs`]})]})]}),t.entry.description&&(0,q.jsx)(R,{marginLeft:4,children:(0,q.jsx)(z,{dimColor:!0,children:ft(t.entry.description,60)})})]},`${j.startIndex}-${t.pluginId}`)}),j.scrollPosition.canScrollDown&&(0,q.jsx)(R,{children:(0,q.jsxs)(z,{dimColor:!0,children:[` `,a.arrowDown,` more below`]})}),e&&(0,q.jsx)(R,{marginTop:1,children:(0,q.jsxs)(z,{color:`error`,children:[a.cross,` `,e]})}),(0,q.jsx)(Pn,{hasSelection:k.size>0,canToggle:O<D.length&&!D[O]?.isInstalled})]})}function Pn({hasSelection:e,canToggle:t}){return(0,q.jsx)(R,{marginTop:1,children:(0,q.jsx)(z,{dimColor:!0,italic:!0,children:(0,q.jsxs)(B,{children:[e&&(0,q.jsx)(F,{action:`plugin:install`,context:`Plugin`,fallback:`i`,description:`install`,bold:!0}),(0,q.jsx)(z,{children:`type to search`}),t&&(0,q.jsx)(F,{action:`plugin:toggle`,context:`Plugin`,fallback:`Space`,description:`toggle`}),(0,q.jsx)(F,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`details`}),(0,q.jsx)(F,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})}function Fn({reason:e}){switch(e){case`git-not-installed`:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(z,{dimColor:!0,children:`Git is required to install marketplaces.`}),(0,q.jsx)(z,{dimColor:!0,children:`Please install git and restart Work Mate.`})]});case`all-blocked-by-policy`:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(z,{dimColor:!0,children:`Your organization policy does not allow any external marketplaces.`}),(0,q.jsx)(z,{dimColor:!0,children:`Contact your administrator.`})]});case`policy-restricts-sources`:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(z,{dimColor:!0,children:`Your organization restricts which marketplaces can be added.`}),(0,q.jsx)(z,{dimColor:!0,children:`Switch to the Marketplaces tab to view allowed sources.`})]});case`all-marketplaces-failed`:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(z,{dimColor:!0,children:`Failed to load marketplace data.`}),(0,q.jsx)(z,{dimColor:!0,children:`Check your network connection.`})]});case`all-plugins-installed`:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(z,{dimColor:!0,children:`All available plugins are already installed.`}),(0,q.jsx)(z,{dimColor:!0,children:`Check for new plugins later or add more marketplaces.`})]});default:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(z,{dimColor:!0,children:`No plugins available.`}),(0,q.jsx)(z,{dimColor:!0,children:`Add a marketplace first using the Marketplaces tab.`})]})}}var In,K,q,Ln=e((()=>{i(),In=t(V(),1),K=t(V(),1),P(),Ut(),Be(),Gt(),ce(),N(),Ze(),xe(),Ye(),We(),S(),Dt(),_(),l(),M(),w(),k(),v(),lt(),pt(),_n(),bn(),Tn(),kn(),q=Ue()}));function Rn({setViewState:e,error:t,setError:n,setResult:r,exitState:i,onManageComplete:o,targetMarketplace:s,action:c}){let[l,u]=(0,Bn.useState)([]),[d,f]=(0,Bn.useState)(!0),[p,m]=(0,Bn.useState)(0),[g,_]=(0,Bn.useState)(!1),[v,y]=(0,Bn.useState)(null),[ee,b]=(0,Bn.useState)(null),[x,S]=(0,Bn.useState)(null),[C,w]=(0,Bn.useState)(`list`),[T,te]=(0,Bn.useState)(null),[E,ne]=(0,Bn.useState)(0),O=(0,Bn.useRef)(!1);(0,Bn.useEffect)(()=>{async function e(){try{let e=await be(),{enabled:r,disabled:i}=await h(),a=[...r,...i],{marketplaces:o,failures:l}=await me(e),d=[];for(let{name:e,config:t,data:n}of o){let r=a.filter(t=>t.source.endsWith(`@${e}`));d.push({name:e,source:D(t.source),lastUpdated:t.lastUpdated,pluginCount:n?.plugins.length,installedPlugins:r,pendingUpdate:!1,pendingRemove:!1,autoUpdate:tt(e,t)})}d.sort((e,t)=>e.name===`claude-plugin-directory`?-1:t.name===`claude-plugin-directory`?1:e.name.localeCompare(t.name)),u(d);let f=Se(l,Qe(o,e=>e.data!==null));if(f)if(f.type===`warning`)y(f.message);else throw Error(f.message);if(s&&!O.current&&!t){O.current=!0;let e=d.findIndex(e=>e.name===s);if(e>=0){let t=d[e];if(c){m(e+1);let t=[...d];c===`update`?t[e].pendingUpdate=!0:c===`remove`&&(t[e].pendingRemove=!0),u(t),setTimeout(A,100,t)}else t&&(m(e+1),te(t),w(`details`))}else n&&n(`Marketplace not found: ${s}`)}}catch(e){n&&n(e instanceof Error?e.message:`Failed to load marketplaces`),y(e instanceof Error?e.message:`Failed to load marketplaces`)}finally{f(!1)}}e()},[s,c,t]);let re=()=>l.some(e=>e.pendingUpdate||e.pendingRemove),k=()=>({updateCount:Qe(l,e=>e.pendingUpdate),removeCount:Qe(l,e=>e.pendingRemove)}),A=async t=>{let i=t||l,s=C===`details`;_(!0),y(null),b(null),S(null);try{let t=it(`userSettings`),n=0,c=0,l=new Set;for(let e of i){if(e.pendingRemove){if(e.installedPlugins&&e.installedPlugins.length>0){let n={...t?.enabledPlugins};for(let t of e.installedPlugins){let r=we(t.name,e.name);n[r]=!1}et(`userSettings`,{enabledPlugins:n})}await fe(e.name),c++,dt(`tengu_marketplace_removed`,{marketplace_name:e.name,plugins_uninstalled:e.installedPlugins?.length||0});continue}e.pendingUpdate&&(await ge(e.name,e=>{S(e)}),n++,l.add(e.name.toLowerCase()),dt(`tengu_marketplace_updated`,{marketplace_name:e.name}))}let d=0;l.size>0&&(d=(await en(l)).length),pe(),o&&await o();let f=await be(),{enabled:p,disabled:m}=await h(),g=[...p,...m],{marketplaces:_}=await me(f),v=[];for(let{name:e,config:t,data:n}of _){let r=g.filter(t=>t.source.endsWith(`@${e}`));v.push({name:e,source:D(t.source),lastUpdated:t.lastUpdated,pluginCount:n?.plugins.length,installedPlugins:r,pendingUpdate:!1,pendingRemove:!1,autoUpdate:tt(e,t)})}if(v.sort((e,t)=>e.name===`claude-plugin-directory`?-1:t.name===`claude-plugin-directory`?1:e.name.localeCompare(t.name)),u(v),s&&T){let e=v.find(e=>e.name===T.name);e&&te(e)}let y=[];if(n>0){let e=d>0?` (${d} ${H(d,`plugin`)} bumped)`:``;y.push(`Updated ${n} ${H(n,`marketplace`)}${e}`)}if(c>0&&y.push(`Removed ${c} ${H(c,`marketplace`)}`),y.length>0){let t=`${a.tick} ${y.join(`, `)}`;s?b(t):(r(t),setTimeout(e,2e3,{type:`menu`}))}else s||e({type:`menu`})}catch(e){let t=Ge(e);y(t),n&&n(t)}finally{_(!1),S(null)}},ie=async()=>{if(!T)return;let e=l.map(e=>e.name===T.name?{...e,pendingRemove:!0}:e);u(e),await A(e)},ae=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 ot()||t.push({label:e.autoUpdate?`Disable auto-update`:`Enable auto-update`,value:`toggle-auto-update`}),t.push({label:`Remove marketplace`,value:`remove`}),t},oe=async e=>{let t=!e.autoUpdate;try{await I(e.name,t),u(n=>n.map(n=>n.name===e.name?{...n,autoUpdate:t}:n)),te(e=>e&&{...e,autoUpdate:t})}catch(e){y(e instanceof Error?e.message:`Failed to update setting`)}};if(Me(`confirm:no`,()=>{w(`list`),ne(0)},{context:`Confirmation`,isActive:!g&&(C===`details`||C===`confirm-remove`)}),Me(`confirm:no`,()=>{u(e=>e.map(e=>({...e,pendingUpdate:!1,pendingRemove:!1}))),m(0)},{context:`Confirmation`,isActive:!g&&C===`list`&&re()}),Me(`confirm:no`,()=>{e({type:`menu`})},{context:`Confirmation`,isActive:!g&&C===`list`&&!re()}),L({"select:previous":()=>m(e=>Math.max(0,e-1)),"select:next":()=>{let e=l.length+1;m(t=>Math.min(e-1,t+1))},"select:accept":()=>{let t=p-1;if(p===0)e({type:`add-marketplace`});else if(re())A();else{let e=l[t];e&&(te(e),w(`details`),ne(0))}}},{context:`Select`,isActive:!g&&C===`list`}),Pe(e=>{let t=p-1;if((e===`u`||e===`U`)&&t>=0)u(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=l[t];e&&(te(e),w(`confirm-remove`))}},{isActive:!g&&C===`list`}),L({"select:previous":()=>ne(e=>Math.max(0,e-1)),"select:next":()=>{let e=ae(T);ne(t=>Math.min(e.length-1,t+1))},"select:accept":()=>{if(!T)return;let t=ae(T)[E];if(t?.value===`browse`)e({type:`browse-marketplace`,targetMarketplace:T.name});else if(t?.value===`update`){let e=l.map(e=>e.name===T.name?{...e,pendingUpdate:!0}:e);u(e),A(e)}else t?.value===`toggle-auto-update`?oe(T):t?.value===`remove`&&w(`confirm-remove`)}},{context:`Select`,isActive:!g&&C===`details`}),Pe(e=>{e===`y`||e===`Y`?ie():(e===`n`||e===`N`)&&(w(`list`),te(null))},{isActive:!g&&C===`confirm-remove`}),d)return(0,J.jsx)(z,{children:`Loading marketplaces…`});if(l.length===0)return(0,J.jsxs)(R,{flexDirection:`column`,children:[(0,J.jsx)(R,{marginBottom:1,children:(0,J.jsx)(z,{bold:!0,children:`Manage marketplaces`})}),(0,J.jsxs)(R,{flexDirection:`row`,gap:1,children:[(0,J.jsxs)(z,{color:`suggestion`,children:[a.pointer,` +`]}),(0,J.jsx)(z,{bold:!0,color:`suggestion`,children:`Add Marketplace`})]}),(0,J.jsx)(R,{marginLeft:3,children:(0,J.jsx)(z,{dimColor:!0,italic:!0,children:i.pending?(0,J.jsxs)(J.Fragment,{children:[`Press `,i.keyName,` again to go back`]}):(0,J.jsxs)(B,{children:[(0,J.jsx)(F,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,J.jsx)(F,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]})})})]});if(C===`confirm-remove`&&T){let e=T.installedPlugins?.length||0;return(0,J.jsxs)(R,{flexDirection:`column`,children:[(0,J.jsxs)(z,{bold:!0,color:`warning`,children:[`Remove marketplace `,(0,J.jsx)(z,{italic:!0,children:T.name}),`?`]}),(0,J.jsxs)(R,{flexDirection:`column`,children:[e>0&&(0,J.jsx)(R,{marginTop:1,children:(0,J.jsxs)(z,{color:`warning`,children:[`This will also uninstall `,e,` `,H(e,`plugin`),` from this marketplace:`]})}),T.installedPlugins&&T.installedPlugins.length>0&&(0,J.jsx)(R,{flexDirection:`column`,marginTop:1,marginLeft:2,children:T.installedPlugins.map(e=>(0,J.jsxs)(z,{dimColor:!0,children:[`• `,e.name]},e.name))}),(0,J.jsx)(R,{marginTop:1,children:(0,J.jsxs)(z,{children:[`Press `,(0,J.jsx)(z,{bold:!0,children:`y`}),` to confirm or `,(0,J.jsx)(z,{bold:!0,children:`n`}),` to cancel`]})})]})]})}if(C===`details`&&T){let e=T.pendingUpdate||g,t=ae(T);return(0,J.jsxs)(R,{flexDirection:`column`,children:[(0,J.jsx)(z,{bold:!0,children:T.name}),(0,J.jsx)(z,{dimColor:!0,children:T.source}),(0,J.jsx)(R,{marginTop:1,children:(0,J.jsxs)(z,{children:[T.pluginCount||0,` available `,H(T.pluginCount||0,`plugin`)]})}),T.installedPlugins&&T.installedPlugins.length>0&&(0,J.jsxs)(R,{flexDirection:`column`,marginTop:1,children:[(0,J.jsxs)(z,{bold:!0,children:[`Installed plugins (`,T.installedPlugins.length,`):`]}),(0,J.jsx)(R,{flexDirection:`column`,marginLeft:1,children:T.installedPlugins.map(e=>(0,J.jsxs)(R,{flexDirection:`row`,gap:1,children:[(0,J.jsx)(z,{children:a.bullet}),(0,J.jsxs)(R,{flexDirection:`column`,children:[(0,J.jsx)(z,{children:e.name}),(0,J.jsx)(z,{dimColor:!0,children:e.manifest.description})]})]},e.name))})]}),e&&(0,J.jsxs)(R,{marginTop:1,flexDirection:`column`,children:[(0,J.jsx)(z,{color:`claude`,children:`Updating marketplace…`}),x&&(0,J.jsx)(z,{dimColor:!0,children:x})]}),!e&&ee&&(0,J.jsx)(R,{marginTop:1,children:(0,J.jsx)(z,{color:`claude`,children:ee})}),!e&&v&&(0,J.jsx)(R,{marginTop:1,children:(0,J.jsx)(z,{color:`error`,children:v})}),!e&&(0,J.jsx)(R,{flexDirection:`column`,marginTop:1,children:t.map((e,t)=>{if(!e)return null;let n=t===E;return(0,J.jsxs)(R,{children:[(0,J.jsxs)(z,{color:n?`suggestion`:void 0,children:[n?a.pointer:` `,` `,e.label]}),e.secondaryLabel&&(0,J.jsxs)(z,{dimColor:!0,children:[` `,e.secondaryLabel]})]},e.value)})}),!e&&!ot()&&T.autoUpdate&&(0,J.jsx)(R,{marginTop:1,children:(0,J.jsx)(z,{dimColor:!0,children:`Auto-update enabled. Work Mate will automatically update this marketplace and its installed plugins.`})}),(0,J.jsx)(R,{marginLeft:3,children:(0,J.jsx)(z,{dimColor:!0,italic:!0,children:e?(0,J.jsx)(J.Fragment,{children:`Please wait…`}):(0,J.jsxs)(B,{children:[(0,J.jsx)(F,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,J.jsx)(F,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]})})})]})}let{updateCount:se,removeCount:j}=k();return(0,J.jsxs)(R,{flexDirection:`column`,children:[(0,J.jsx)(R,{marginBottom:1,children:(0,J.jsx)(z,{bold:!0,children:`Manage marketplaces`})}),(0,J.jsxs)(R,{flexDirection:`row`,gap:1,marginBottom:1,children:[(0,J.jsxs)(z,{color:p===0?`suggestion`:void 0,children:[p===0?a.pointer:` `,` +`]}),(0,J.jsx)(z,{bold:!0,color:p===0?`suggestion`:void 0,children:`Add Marketplace`})]}),(0,J.jsx)(R,{flexDirection:`column`,children:l.map((e,t)=>{let n=t+1===p,r=[];return e.pendingUpdate&&r.push(`UPDATE`),e.pendingRemove&&r.push(`REMOVE`),(0,J.jsxs)(R,{flexDirection:`row`,gap:1,marginBottom:1,children:[(0,J.jsxs)(z,{color:n?`suggestion`:void 0,children:[n?a.pointer:` `,` `,e.pendingRemove?a.cross:a.bullet]}),(0,J.jsxs)(R,{flexDirection:`column`,flexGrow:1,children:[(0,J.jsxs)(R,{flexDirection:`row`,gap:1,children:[(0,J.jsxs)(z,{bold:!0,strikethrough:e.pendingRemove,dimColor:e.pendingRemove,children:[e.name===`claude-plugins-official`&&(0,J.jsx)(z,{color:`claude`,children:`✻ `}),e.name,e.name===`claude-plugins-official`&&(0,J.jsx)(z,{color:`claude`,children:` ✻`})]}),r.length>0&&(0,J.jsxs)(z,{color:`warning`,children:[`[`,r.join(`, `),`]`]})]}),(0,J.jsx)(z,{dimColor:!0,children:e.source}),(0,J.jsxs)(z,{dimColor:!0,children:[e.pluginCount!==void 0&&(0,J.jsxs)(J.Fragment,{children:[e.pluginCount,` available`]}),e.installedPlugins&&e.installedPlugins.length>0&&(0,J.jsxs)(J.Fragment,{children:[` • `,e.installedPlugins.length,` installed`]}),e.lastUpdated&&(0,J.jsxs)(J.Fragment,{children:[` • Updated `,new Date(e.lastUpdated).toLocaleDateString()]})]})]})]},e.name)})}),re()&&(0,J.jsxs)(R,{marginTop:1,flexDirection:`column`,children:[(0,J.jsxs)(z,{children:[(0,J.jsx)(z,{bold:!0,children:`Pending changes:`}),` `,(0,J.jsx)(z,{dimColor:!0,children:`Enter to apply`})]}),se>0&&(0,J.jsxs)(z,{children:[`• Update `,se,` `,H(se,`marketplace`)]}),j>0&&(0,J.jsxs)(z,{color:`warning`,children:[`• Remove `,j,` `,H(j,`marketplace`)]})]}),g&&(0,J.jsx)(R,{marginTop:1,children:(0,J.jsx)(z,{color:`claude`,children:`Processing changes…`})}),v&&(0,J.jsx)(R,{marginTop:1,children:(0,J.jsx)(z,{color:`error`,children:v})}),(0,J.jsx)(zn,{exitState:i,hasPendingActions:re()})]})}function zn({exitState:e,hasPendingActions:t}){return e.pending?(0,J.jsx)(R,{marginTop:1,children:(0,J.jsxs)(z,{dimColor:!0,italic:!0,children:[`Press `,e.keyName,` again to go back`]})}):(0,J.jsx)(R,{marginTop:1,children:(0,J.jsx)(z,{dimColor:!0,italic:!0,children:(0,J.jsxs)(B,{children:[t&&(0,J.jsx)(F,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`apply changes`}),!t&&(0,J.jsx)(F,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),!t&&(0,J.jsx)(ke,{shortcut:`u`,action:`update`}),!t&&(0,J.jsx)(ke,{shortcut:`r`,action:`remove`}),(0,J.jsx)(F,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:t?`cancel`:`go back`})]})})})}var Bn,J,Vn=e((()=>{i(),Bn=t(V(),1),ut(),P(),Be(),N(),Ze(),at(),We(),S(),l(),M(),tn(),d(),$e(),rt(),lt(),J=Ue()}));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 y(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((()=>{ve()}));function Gn({item:e,isSelected:t}){let[n]=je();if(e.type===`plugin`){let r,i;return e.pendingToggle?(r=Fe(`suggestion`,n)(a.arrowRight),i=e.pendingToggle===`will-enable`?`will enable`:`will disable`):e.errorCount>0?(r=Fe(`error`,n)(a.cross),i=`${e.errorCount} ${H(e.errorCount,`error`)}`):e.isEnabled?(r=Fe(`success`,n)(a.tick),i=`enabled`):(r=Fe(`inactive`,n)(a.radioOff),i=`disabled`),(0,Y.jsxs)(R,{children:[(0,Y.jsx)(z,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(z,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(z,{dimColor:!t,children:[` `,(0,Y.jsx)(z,{backgroundColor:`userMessageBackground`,children:`Plugin`})]}),(0,Y.jsxs)(z,{dimColor:!0,children:[` · `,e.marketplace]}),(0,Y.jsxs)(z,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(z,{dimColor:!t,children:i})]})}if(e.type===`flagged-plugin`){let r=Fe(`warning`,n)(a.warning);return(0,Y.jsxs)(R,{children:[(0,Y.jsx)(z,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(z,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(z,{dimColor:!t,children:[` `,(0,Y.jsx)(z,{backgroundColor:`userMessageBackground`,children:`Plugin`})]}),(0,Y.jsxs)(z,{dimColor:!0,children:[` · `,e.marketplace]}),(0,Y.jsxs)(z,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(z,{dimColor:!t,children:`removed`})]})}if(e.type===`failed-plugin`){let r=Fe(`error`,n)(a.cross),i=`failed to load · ${e.errorCount} ${H(e.errorCount,`error`)}`;return(0,Y.jsxs)(R,{children:[(0,Y.jsx)(z,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(z,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(z,{dimColor:!t,children:[` `,(0,Y.jsx)(z,{backgroundColor:`userMessageBackground`,children:`Plugin`})]}),(0,Y.jsxs)(z,{dimColor:!0,children:[` · `,e.marketplace]}),(0,Y.jsxs)(z,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(z,{dimColor:!t,children:i})]})}let r,i;return e.status===`connected`?(r=Fe(`success`,n)(a.tick),i=`connected`):e.status===`disabled`?(r=Fe(`inactive`,n)(a.radioOff),i=`disabled`):e.status===`pending`?(r=Fe(`inactive`,n)(a.radioOff),i=`connecting…`):e.status===`needs-auth`?(r=Fe(`warning`,n)(a.triangleUpOutline),i=`Enter to auth`):(r=Fe(`error`,n)(a.cross),i=`failed`),e.indented?(0,Y.jsxs)(R,{children:[(0,Y.jsx)(z,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(z,{dimColor:!t,children:`└ `}),(0,Y.jsx)(z,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(z,{dimColor:!t,children:[` `,(0,Y.jsx)(z,{backgroundColor:`userMessageBackground`,children:`MCP`})]}),(0,Y.jsxs)(z,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(z,{dimColor:!t,children:i})]}):(0,Y.jsxs)(R,{children:[(0,Y.jsx)(z,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(z,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(z,{dimColor:!t,children:[` `,(0,Y.jsx)(z,{backgroundColor:`userMessageBackground`,children:`MCP`})]}),(0,Y.jsxs)(z,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(z,{dimColor:!t,children:i})]})}var Y,Kn=e((()=>{i(),Be(),lt(),Y=Ue()}));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 Je(`Failed to read plugin components from ${e}: ${Ge(t)}`,{level:`error`}),ct(qe(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 Je(`Failed to read skill directories from ${e}: ${Ge(t)}`,{level:`error`}),ct(qe(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=re(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 he(t)).plugins.find(t=>t.name===e.name);if(n){let t=[];e.commandsPath&&t.push(e.commandsPath),e.commandsPaths&&t.push(...e.commandsPaths);let i=[];for(let e of t)if(typeof e==`string`){let t=await qn(e);i.push(...t)}let a=[];e.agentsPath&&a.push(e.agentsPath),e.agentsPaths&&a.push(...e.agentsPaths);let o=[];for(let e of a)if(typeof e==`string`){let t=await qn(e);o.push(...t)}let s=[];e.skillsPath&&s.push(e.skillsPath),e.skillsPaths&&s.push(...e.skillsPaths);let c=[];for(let e of s)if(typeof e==`string`){let t=await Jn(e);c.push(...t)}let l=[];e.hooksConfig&&l.push(Object.keys(e.hooksConfig)),n.hooks&&l.push(n.hooks);let u=[];e.mcpServers&&u.push(Object.keys(e.mcpServers)),n.mcpServers&&u.push(n.mcpServers),r({commands:i.length>0?i:null,agents:o.length>0?o:null,skills:c.length>0?c:null,hooks:l.length>0?l:null,mcpServers:u.length>0?u:null})}else s(`Plugin ${e.name} not found in marketplace`)}catch(e){s(e instanceof Error?e.message:`Failed to load components`)}finally{a(!1)}}n()},[e.name,e.commandsPath,e.commandsPaths,e.agentsPath,e.agentsPaths,e.skillsPath,e.skillsPaths,e.hooksConfig,e.mcpServers,t]),i?null:o?(0,Z.jsxs)(R,{flexDirection:`column`,marginBottom:1,children:[(0,Z.jsx)(z,{bold:!0,children:`Components:`}),(0,Z.jsxs)(z,{dimColor:!0,children:[`Error: `,o]})]}):!n||!(n.commands||n.agents||n.skills||n.hooks||n.mcpServers)?null:(0,Z.jsxs)(R,{flexDirection:`column`,marginBottom:1,children:[(0,Z.jsx)(z,{bold:!0,children:`Installed components:`}),n.commands?(0,Z.jsxs)(z,{dimColor:!0,children:[`• Commands:`,` `,typeof n.commands==`string`?n.commands:Array.isArray(n.commands)?n.commands.join(`, `):Object.keys(n.commands).join(`, `)]}):null,n.agents?(0,Z.jsxs)(z,{dimColor:!0,children:[`• Agents:`,` `,typeof n.agents==`string`?n.agents:Array.isArray(n.agents)?n.agents.join(`, `):Object.keys(n.agents).join(`, `)]}):null,n.skills?(0,Z.jsxs)(z,{dimColor:!0,children:[`• Skills:`,` `,typeof n.skills==`string`?n.skills:Array.isArray(n.skills)?n.skills.join(`, `):Object.keys(n.skills).join(`, `)]}):null,n.hooks?(0,Z.jsxs)(z,{dimColor:!0,children:[`• Hooks:`,` `,typeof n.hooks==`string`?n.hooks:Array.isArray(n.hooks)?n.hooks.map(String).join(`, `):typeof n.hooks==`object`&&n.hooks!==null?Object.keys(n.hooks).join(`, `):String(n.hooks)]}):null,n.mcpServers?(0,Z.jsxs)(z,{dimColor:!0,children:[`• MCP Servers:`,` `,typeof n.mcpServers==`string`?n.mcpServers:Array.isArray(n.mcpServers)?n.mcpServers.map(String).join(`, `):typeof n.mcpServers==`object`&&n.mcpServers!==null?Object.keys(n.mcpServers).join(`, `):String(n.mcpServers)]}):null]})}async function Xn(e,t){let n=(await he(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:s,action:c}){let l=ee(e=>e.mcp.clients),u=ee(e=>e.mcp.tools),d=ee(e=>e.plugins.errors),f=Pt(),[p,g]=(0,X.useState)(!1),_=(0,X.useCallback)(e=>{g(e),r?.(e)},[r]),v=Ne(),{columns:y}=Re(),[b,x]=(0,X.useState)(`plugin-list`),{query:S,setQuery:C,cursorOffset:w}=Wt({isActive:b===`plugin-list`&&p,onExit:()=>{_(!1)}}),[T,te]=(0,X.useState)(null),[E,ne]=(0,X.useState)([]),[D,O]=(0,X.useState)([]),[re,k]=(0,X.useState)(!0),[A,ae]=(0,X.useState)(new Map),oe=(0,X.useRef)(!1),se=(0,X.useRef)(void 0),j=Lt();Me(`confirm:no`,$n.useCallback(()=>{if(b===`plugin-details`)x(`plugin-list`),te(null),I(null);else if(typeof b==`object`&&b.type===`failed-plugin-details`)x(`plugin-list`),I(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`),te(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`),I(null);else if(typeof b==`object`&&b.type===`mcp-detail`)x(`plugin-list`),I(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`||!p)&&b!==`confirm-project-uninstall`&&!(typeof b==`object`&&b.type===`confirm-data-cleanup`)});let ce=e=>e.type===`connected`?`connected`:e.type===`disabled`?`disabled`:e.type===`pending`?`pending`:e.type===`needs-auth`?`needs-auth`:`failed`,de=(0,X.useMemo)(()=>{let e=nt(),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=d.filter(e=>`plugin`in e&&e.plugin===r.plugin.name||e.source===i||e.source.startsWith(`${r.plugin.name}@`)),s=r.plugin.isBuiltin?`builtin`:r.scope||`user`;n.push({item:{type:`plugin`,id:i,name:r.plugin.name,description:r.plugin.manifest.description,marketplace:r.marketplace,scope:s,isEnabled:a,errorCount:o.length,errors:o,plugin:r.plugin,pendingEnable:r.pendingEnable,pendingUpdate:r.pendingUpdate,pendingToggle: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 d){if(r.has(e.source)||`plugin`in e&&typeof e.plugin==`string`&&i.has(e.plugin))continue;let t=a.get(e.source)||[];t.push(e),a.set(e.source,t)}let o=_t(),s=[];for(let[e,t]of a){if(e in f)continue;let n=Oe(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:ce(e),client:e}));let u={flagged:-1,project:0,local:1,user:2,enterprise:3,managed:4,dynamic:5,builtin:6},p=[],m=new Map;for(let{item:e,originalScope:t,childMcps:r}of n){let n=e.scope;m.has(n)||m.set(n,[]),m.get(n).push(e);for(let{displayName:e,client:n}of r){let r=t===`builtin`?`user`:t;m.has(r)||m.set(r,[]),m.get(r).push({type:`mcp`,id:`mcp:${n.name}`,name:e,description:void 0,scope:r,status:ce(n),client:n,indented:!0})}}for(let e of c){let t=e.scope;m.has(t)||m.set(t,[]),m.get(t).push(e)}for(let e of s){let t=e.scope;m.has(t)||m.set(t,[]),m.get(t).push(e)}for(let[e,t]of Object.entries(f)){let n=Oe(e),r=n.name||e,i=n.marketplace||`unknown`;m.has(`flagged`)||m.set(`flagged`,[]),m.get(`flagged`).push({type:`flagged-plugin`,id:e,name:r,marketplace:i,scope:`flagged`,reason:`delisted`,text:`Removed from marketplace`,flaggedAt:t.flaggedAt})}let h=[...m.keys()].sort((e,t)=>(u[e]??99)-(u[t]??99));for(let e of h){let t=m.get(e),n=[],r=[],i=0;for(;i<t.length;){let e=t[i];if(e.type===`plugin`||e.type===`failed-plugin`||e.type===`flagged-plugin`){let r=[e];i++;let a=t[i];for(;a?.type===`mcp`&&a.indented;)r.push(a),i++,a=t[i];n.push(r)}else e.type===`mcp`&&!e.indented&&r.push(e),i++}n.sort((e,t)=>e[0].name.localeCompare(t[0].name)),r.sort((e,t)=>e.name.localeCompare(t.name));for(let e of n)p.push(...e);p.push(...r)}return p},[D,l,d,A,f]),fe=(0,X.useMemo)(()=>de.filter(e=>e.type===`flagged-plugin`).map(e=>e.id),[de]);(0,X.useEffect)(()=>{fe.length>0&&Nt(fe)},[fe]);let me=(0,X.useMemo)(()=>{if(!S)return de;let e=S.toLowerCase();return de.filter(t=>t.name.toLowerCase().includes(e)||`description`in t&&t.description?.toLowerCase().includes(e))},[de,S]),[M,N]=(0,X.useState)(0),P=En({totalItems:me.length,selectedIndex:M,maxVisible:8}),[he,ge]=(0,X.useState)(0),[ve,ye]=(0,X.useState)(!1),[be,I]=(0,X.useState)(null),[xe,Se]=(0,X.useState)(null),[we,Ee]=(0,X.useState)(!1),[ke,Ae]=(0,X.useState)(!1);(0,X.useEffect)(()=>{if(!T){Ae(!1);return}async function e(){let e=T.plugin.manifest.mcpServers,t=!1;if(e&&(t=typeof e==`string`&&m(e)||Array.isArray(e)&&e.some(e=>typeof e==`string`&&m(e))),!t)try{let e=nn.join(T.plugin.path,`..`),n=nn.join(e,`.claude-plugin`,`marketplace.json`),r=Ke(await rn.readFile(n,`utf-8`)).plugins?.find(e=>e.name===T.plugin.name);if(r?.mcpServers){let e=r.mcpServers;t=typeof e==`string`&&m(e)||Array.isArray(e)&&e.some(e=>typeof e==`string`&&m(e))}}catch(e){Je(`Failed to read raw marketplace.json: ${e}`)}Ae(t)}e()},[T]),(0,X.useEffect)(()=>{async function e(){k(!0);try{let{enabled:e,disabled:t}=await h(),n=nt(),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=Qe(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)),ne(a);let o=[];for(let e of a)for(let t of e.installedPlugins){let n=`${t.name}@${e.name}`,r=t.isBuiltin?`builtin`:Ct(n).scope;o.push({plugin:t,marketplace:e.name,scope:r,pendingEnable:void 0,pendingUpdate:!1})}O(o),N(0)}finally{k(!1)}}e()},[]),(0,X.useEffect)(()=>{if(!oe.current&&i&&E.length>0&&!re){let{name:e,marketplace:n}=Oe(i),r=s??n,a=r?E.filter(e=>e.name===r):E;for(let t of a){let n=t.installedPlugins.find(t=>t.name===e);if(n){let{scope:e}=Ct(`${n.name}@${t.name}`),r={plugin:n,marketplace:t.name,scope:e,pendingEnable:void 0,pendingUpdate:!1};te(r),x(`plugin-details`),se.current=c,oe.current=!0;return}}let o=de.find(t=>t.type===`failed-plugin`&&t.name===e);o&&o.type===`failed-plugin`&&(x({type:`failed-plugin-details`,plugin:{id:o.id,name:o.name,marketplace:o.marketplace,errors:o.errors,scope:o.scope}}),oe.current=!0),!oe.current&&c&&(oe.current=!0,t(`Plugin "${i}" is not installed in this project`))}},[i,s,E,re,de,c,t]);let je=async r=>{if(!T)return;let i=T.scope||`user`,a=i===`builtin`;if(a&&(r===`update`||r===`uninstall`)){I(`Built-in plugins cannot be updated or uninstalled.`);return}if(!a&&!St(i)&&r!==`update`){I(`This plugin is managed by your organization. Contact your admin to disable it.`);return}ye(!0),I(null);try{let o=`${T.plugin.name}@${T.marketplace}`,s;switch(r){case`enable`:{let e=await vt(o);if(!e.success)throw Error(e.message);break}case`disable`:{let e=await xt(o);if(!e.success)throw Error(e.message);s=e.reverseDependents;break}case`uninstall`:{if(a||!St(i))break;if(Tt(o)){ye(!1),x(`confirm-project-uninstall`);return}let e=ue().plugins[o],t=!e||e.length<=1?await le(o):null;if(t){ye(!1),x({type:`confirm-data-cleanup`,size:t});return}let n=await yt(o,i);if(!n.success)throw Error(n.message);s=n.reverseDependents;break}case`update`:{if(a)break;let r=await bt(o,i);if(!r.success)throw Error(r.message);if(r.alreadyUpToDate){t(`${T.plugin.name} is already at the latest version (${r.newVersion}).`),n&&await n(),e({type:`menu`});return}break}}pe();let c=`${T.plugin.name}@${T.marketplace}`;if(nt()?.enabledPlugins?.[c]!==!1){ye(!1),x({type:`plugin-options`});return}let l=r===`enable`?`Enabled`:r===`disable`?`Disabled`:r===`update`?`Updated`:`Uninstalled`,u=s&&s.length>0?` · required by ${s.join(`, `)}`:``;t(`✓ ${l} ${T.plugin.name}${u}. Run /reload-plugins to apply.`),n&&await n(),e({type:`menu`})}catch(e){ye(!1);let t=e instanceof Error?e.message:String(e);I(`Failed to ${r}: ${t}`),ct(qe(e))}},V=(0,X.useRef)(je);V.current=je,(0,X.useEffect)(()=>{if(b===`plugin-details`&&T&&se.current){let e=se.current;se.current=void 0,V.current(e)}},[b,T]);let Fe=$n.useCallback(()=>{if(M>=me.length)return;let e=me[M];if(e?.type!==`flagged-plugin`)if(e?.type===`plugin`){let t=`${e.plugin.name}@${e.marketplace}`,n=nt(),r=A.get(t),i=n?.enabledPlugins?.[t]!==!1,a=e.scope;if(a===`builtin`||St(a)){let e=new Map(A);r?(e.delete(t),(async()=>{try{r===`will-disable`?await vt(t):await xt(t),pe()}catch(e){ct(e)}})()):(e.set(t,i?`will-disable`:`will-enable`),(async()=>{try{i?await xt(t):await vt(t),pe()}catch(e){ct(e)}})()),ae(e)}}else e?.type===`mcp`&&j(e.client.name)},[M,me,A,D,j]);L({"select:previous":()=>{M===0?_(!0):P.handleSelectionChange(M-1,N)},"select:next":()=>{M<me.length-1&&P.handleSelectionChange(M+1,N)},"select:accept":$n.useCallback(()=>{if(M>=me.length)return;let e=me[M];if(e?.type===`plugin`){let t=D.find(t=>t.plugin.name===e.plugin.name&&t.marketplace===e.marketplace);t&&(te(t),x(`plugin-details`),ge(0),I(null))}else e?.type===`flagged-plugin`?(x({type:`flagged-detail`,plugin:{id:e.id,name:e.name,marketplace:e.marketplace,reason:e.reason,text:e.text,flaggedAt:e.flaggedAt}}),I(null)):e?.type===`failed-plugin`?(x({type:`failed-plugin-details`,plugin:{id:e.id,name:e.name,marketplace:e.marketplace,errors:e.errors,scope:e.scope}}),ge(0),I(null)):e?.type===`mcp`&&(x({type:`mcp-detail`,client:e.client}),I(null))},[M,me,D])},{context:`Select`,isActive:b===`plugin-list`&&!p}),L({"plugin:toggle":Fe},{context:`Plugin`,isActive:b===`plugin-list`&&!p}),L({"select:accept":$n.useCallback(()=>{typeof b!=`object`||b.type!==`flagged-detail`||(Ft(b.plugin.id),x(`plugin-list`))},[b])},{context:`Select`,isActive:typeof b==`object`&&b.type===`flagged-detail`});let Le=$n.useMemo(()=>{if(b!==`plugin-details`||!T)return[];let e=nt(),t=`${T.plugin.name}@${T.marketplace}`,n=e?.enabledPlugins?.[t]!==!1,r=T.marketplace===`builtin`,i=[];return i.push({label:n?`Disable plugin`:`Enable plugin`,action:()=>void je(n?`disable`:`enable`)}),r||(i.push({label:T.pendingUpdate?`Unmark for update`:`Mark for update`,action:async()=>{try{let e=await Xn(T.plugin.name,T.marketplace);if(e){I(e);return}let t=[...D],n=t.findIndex(e=>e.plugin.name===T.plugin.name&&e.marketplace===T.marketplace);n!==-1&&(t[n].pendingUpdate=!T.pendingUpdate,O(t),te({...T,pendingUpdate:!T.pendingUpdate}))}catch(e){I(e instanceof Error?e.message:`Failed to check plugin update availability`)}}}),ke&&i.push({label:`Configure`,action:async()=>{Ee(!0);try{let e=T.plugin.manifest.mcpServers,t=null;if(typeof e==`string`&&m(e))t=e;else if(Array.isArray(e)){for(let n of e)if(typeof n==`string`&&m(n)){t=n;break}}if(!t){I(`No MCPB file found in plugin`),Ee(!1);return}let n=`${T.plugin.name}@${T.marketplace}`,r=await ie(t,T.plugin.path,n,void 0,void 0,!0);`status`in r&&r.status===`needs-config`?(Se(r),x(`configuring`)):I(`Failed to load MCPB for configuration`)}catch(e){let t=Ge(e);I(`Failed to load configuration: ${t}`)}finally{Ee(!1)}}}),T.plugin.manifest.userConfig&&Object.keys(T.plugin.manifest.userConfig).length>0&&i.push({label:`Configure options`,action:()=>{x({type:`configuring-options`,schema:T.plugin.manifest.userConfig})}}),i.push({label:`Update now`,action:()=>void je(`update`)}),i.push({label:`Uninstall`,action:()=>void je(`uninstall`)})),T.plugin.manifest.homepage&&i.push({label:`Open homepage`,action:()=>void Te(T.plugin.manifest.homepage)}),T.plugin.manifest.repository&&i.push({label:`View repository`,action:()=>void Te(T.plugin.manifest.repository)}),i.push({label:`Back to plugin list`,action:()=>{x(`plugin-list`),te(null),I(null)}}),i},[b,T,ke,D]);if(L({"select:previous":()=>{he>0&&ge(he-1)},"select:next":()=>{he<Le.length-1&&ge(he+1)},"select:accept":()=>{Le[he]&&Le[he].action()}},{context:`Select`,isActive:b===`plugin-details`&&!!T}),L({"select:accept":()=>{typeof b==`object`&&b.type===`failed-plugin-details`&&(async()=>{ye(!0),I(null);let e=b.plugin.id,t=b.plugin.scope,r=St(t)?await yt(e,t,!1):await yt(e,`user`,!1),i=r.success;if(!i){for(let t of[`userSettings`,`projectSettings`,`localSettings`]){let n=it(t);n?.enabledPlugins?.[e]!==void 0&&(et(t,{enabledPlugins:{...n.enabledPlugins,[e]:void 0}}),i=!0)}pe()}i?(n&&await n(),ye(!1),x(`plugin-list`)):(ye(!1),I(r.message))})()}},{context:`Select`,isActive:typeof b==`object`&&b.type===`failed-plugin-details`&&b.plugin.scope!==`managed`}),L({"confirm:yes":()=>{if(!T)return;ye(!0),I(null);let r=`${T.plugin.name}@${T.marketplace}`,{error:i}=et(`localSettings`,{enabledPlugins:{...it(`localSettings`)?.enabledPlugins,[r]:!1}});if(i){ye(!1),I(`Failed to write settings: ${i.message}`);return}pe(),t(`✓ Disabled ${T.plugin.name} in .workmate/settings.local.json. Run /reload-plugins to apply.`),n&&n(),e({type:`menu`})},"confirm:no":()=>{x(`plugin-details`),I(null)}},{context:`Confirmation`,isActive:b===`confirm-project-uninstall`&&!!T&&!ve}),Pe((r,i)=>{if(!T)return;let o=`${T.plugin.name}@${T.marketplace}`,s=T.scope;if(!s||s===`builtin`||!St(s))return;let c=async r=>{ye(!0),I(null);try{let i=await yt(o,s,r);if(!i.success)throw Error(i.message);pe();let c=r?``:` · data preserved`;t(`${a.tick} ${i.message}${c}`),n&&n(),e({type:`menu`})}catch(e){ye(!1),I(e instanceof Error?e.message:String(e))}};r===`y`||r===`Y`?c(!0):r===`n`||r===`N`?c(!1):i.escape&&(x(`plugin-details`),I(null))},{isActive:typeof b==`object`&&b.type===`confirm-data-cleanup`&&!!T&&!ve}),$n.useEffect(()=>{N(0)},[S]),Pe((e,t)=>{let n=!t.ctrl&&!t.meta;p||(e===`/`&&n?(_(!0),C(``),N(0)):n&&e.length>0&&!/^\s+$/.test(e)&&e!==`j`&&e!==`k`&&e!==` `&&(_(!0),C(e),N(0)))},{isActive:b===`plugin-list`}),re)return(0,Z.jsx)(z,{children:`Loading installed plugins…`});if(de.length===0)return(0,Z.jsxs)(R,{flexDirection:`column`,children:[(0,Z.jsx)(R,{marginBottom:1,children:(0,Z.jsx)(z,{bold:!0,children:`Manage plugins`})}),(0,Z.jsx)(z,{children:`No plugins or MCP servers installed.`}),(0,Z.jsx)(R,{marginTop:1,children:(0,Z.jsx)(z,{dimColor:!0,children:`Esc to go back`})})]});if(typeof b==`object`&&b.type===`plugin-options`&&T){let r=`${T.plugin.name}@${T.marketplace}`;function i(r){t(r),n&&n(),e({type:`menu`})}return(0,Z.jsx)(mn,{plugin:T.plugin,pluginId:r,onDone:(e,t)=>{switch(e){case`configured`:i(`✓ Enabled and configured ${T.plugin.name}. Run /reload-plugins to apply.`);break;case`skipped`:i(`✓ Enabled ${T.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`&&T){let e=`${T.plugin.name}@${T.marketplace}`;return(0,Z.jsx)(ln,{title:`Configure ${T.plugin.name}`,subtitle:`Plugin options`,configSchema:b.schema,initialValues:De(e),onSave:n=>{try{o(e,n,b.schema),pe(),t(`Configuration saved. Run /reload-plugins for changes to take effect.`)}catch(e){I(`Failed to save configuration: ${Ge(e)}`)}x(`plugin-details`)},onCancel:()=>x(`plugin-details`)})}if(b===`configuring`&&xe&&T){let e=`${T.plugin.name}@${T.marketplace}`;async function n(n){if(!(!xe||!T))try{let r=T.plugin.manifest.mcpServers,i=null;if(typeof r==`string`&&m(r))i=r;else if(Array.isArray(r)){for(let e of r)if(typeof e==`string`&&m(e)){i=e;break}}if(!i){I(`No MCPB file found`),x(`plugin-details`);return}await ie(i,T.plugin.path,e,void 0,n),I(null),Se(null),x(`plugin-details`),t(`Configuration saved. Run /reload-plugins for changes to take effect.`)}catch(e){let t=Ge(e);I(`Failed to save configuration: ${t}`),x(`plugin-details`)}}function r(){Se(null),x(`plugin-details`)}return(0,Z.jsx)(ln,{title:`Configure ${xe.manifest.name}`,subtitle:`Plugin: ${T.plugin.name}`,configSchema:xe.configSchema,initialValues:xe.existingConfig,onSave:n,onCancel:r})}if(typeof b==`object`&&b.type===`flagged-detail`){let e=b.plugin;return(0,Z.jsxs)(R,{flexDirection:`column`,children:[(0,Z.jsx)(R,{children:(0,Z.jsxs)(z,{bold:!0,children:[e.name,` @ `,e.marketplace]})}),(0,Z.jsxs)(R,{marginBottom:1,children:[(0,Z.jsx)(z,{dimColor:!0,children:`Status: `}),(0,Z.jsx)(z,{color:`error`,children:`Removed`})]}),(0,Z.jsxs)(R,{marginBottom:1,flexDirection:`column`,children:[(0,Z.jsxs)(z,{color:`error`,children:[`Removed from marketplace · reason: `,e.reason]}),(0,Z.jsx)(z,{children:e.text}),(0,Z.jsxs)(z,{dimColor:!0,children:[`Flagged on `,new Date(e.flaggedAt).toLocaleDateString()]})]}),(0,Z.jsx)(R,{marginTop:1,flexDirection:`column`,children:(0,Z.jsxs)(R,{children:[(0,Z.jsxs)(z,{children:[a.pointer,` `]}),(0,Z.jsx)(z,{color:`suggestion`,children:`Dismiss`})]})}),(0,Z.jsxs)(B,{children:[(0,Z.jsx)(F,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`dismiss`}),(0,Z.jsx)(F,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})]})}if(b===`confirm-project-uninstall`&&T)return(0,Z.jsxs)(R,{flexDirection:`column`,children:[(0,Z.jsxs)(z,{bold:!0,color:`warning`,children:[T.plugin.name,` is enabled in .workmate/settings.json (shared with your team)`]}),(0,Z.jsxs)(R,{marginTop:1,flexDirection:`column`,children:[(0,Z.jsx)(z,{children:`Disable it just for you in .workmate/settings.local.json?`}),(0,Z.jsx)(z,{dimColor:!0,children:`This has the same effect as uninstalling, without affecting other contributors.`})]}),be&&(0,Z.jsx)(R,{marginTop:1,children:(0,Z.jsx)(z,{color:`error`,children:be})}),(0,Z.jsx)(R,{marginTop:1,children:ve?(0,Z.jsx)(z,{dimColor:!0,children:`Disabling…`}):(0,Z.jsxs)(B,{children:[(0,Z.jsx)(F,{action:`confirm:yes`,context:`Confirmation`,fallback:`y`,description:`disable`}),(0,Z.jsx)(F,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]});if(typeof b==`object`&&b.type===`confirm-data-cleanup`&&T)return(0,Z.jsxs)(R,{flexDirection:`column`,children:[(0,Z.jsxs)(z,{bold:!0,children:[T.plugin.name,` has `,b.size.human,` of persistent data`]}),(0,Z.jsxs)(R,{marginTop:1,flexDirection:`column`,children:[(0,Z.jsx)(z,{children:`Delete it along with the plugin?`}),(0,Z.jsx)(z,{dimColor:!0,children:Ce(`${T.plugin.name}@${T.marketplace}`)})]}),be&&(0,Z.jsx)(R,{marginTop:1,children:(0,Z.jsx)(z,{color:`error`,children:be})}),(0,Z.jsx)(R,{marginTop:1,children:ve?(0,Z.jsx)(z,{dimColor:!0,children:`Uninstalling…`}):(0,Z.jsxs)(z,{children:[(0,Z.jsx)(z,{bold:!0,children:`y`}),` to delete · `,(0,Z.jsx)(z,{bold:!0,children:`n`}),` to keep · `,(0,Z.jsx)(z,{bold:!0,children:`esc`}),` to cancel`]})})]});if(b===`plugin-details`&&T){let e=nt(),t=`${T.plugin.name}@${T.marketplace}`,n=e?.enabledPlugins?.[t]!==!1,r=d.filter(e=>`plugin`in e&&e.plugin===T.plugin.name||e.source===t||e.source.startsWith(`${T.plugin.name}@`)),i=r.length===0?null:(0,Z.jsxs)(R,{flexDirection:`column`,marginBottom:1,children:[(0,Z.jsxs)(z,{bold:!0,color:`error`,children:[r.length,` `,H(r.length,`error`),`:`]}),r.map((e,t)=>{let n=Un(e);return(0,Z.jsxs)(R,{flexDirection:`column`,marginLeft:2,children:[(0,Z.jsx)(z,{color:`error`,children:Hn(e)}),n&&(0,Z.jsxs)(z,{dimColor:!0,italic:!0,children:[a.arrowRight,` `,n]})]},t)})]});return(0,Z.jsxs)(R,{flexDirection:`column`,children:[(0,Z.jsx)(R,{children:(0,Z.jsxs)(z,{bold:!0,children:[T.plugin.name,` @ `,T.marketplace]})}),(0,Z.jsxs)(R,{children:[(0,Z.jsx)(z,{dimColor:!0,children:`Scope: `}),(0,Z.jsx)(z,{children:T.scope||`user`})]}),T.plugin.manifest.version&&(0,Z.jsxs)(R,{children:[(0,Z.jsx)(z,{dimColor:!0,children:`Version: `}),(0,Z.jsx)(z,{children:T.plugin.manifest.version})]}),T.plugin.manifest.description&&(0,Z.jsx)(R,{marginBottom:1,children:(0,Z.jsx)(z,{children:T.plugin.manifest.description})}),T.plugin.manifest.author&&(0,Z.jsxs)(R,{children:[(0,Z.jsx)(z,{dimColor:!0,children:`Author: `}),(0,Z.jsx)(z,{children:T.plugin.manifest.author.name})]}),(0,Z.jsxs)(R,{marginBottom:1,children:[(0,Z.jsx)(z,{dimColor:!0,children:`Status: `}),(0,Z.jsx)(z,{color:n?`success`:`warning`,children:n?`Enabled`:`Disabled`}),T.pendingUpdate&&(0,Z.jsx)(z,{color:`suggestion`,children:` · Marked for update`})]}),(0,Z.jsx)(Yn,{plugin:T.plugin,marketplace:T.marketplace}),i,(0,Z.jsx)(R,{marginTop:1,flexDirection:`column`,children:Le.map((e,t)=>{let n=t===he;return(0,Z.jsxs)(R,{children:[n&&(0,Z.jsxs)(z,{children:[a.pointer,` `]}),!n&&(0,Z.jsx)(z,{children:` `}),(0,Z.jsx)(z,{bold:n,color:e.label.includes(`Uninstall`)?`error`:e.label.includes(`Update`)?`suggestion`:void 0,children:e.label})]},t)})}),ve&&(0,Z.jsx)(R,{marginTop:1,children:(0,Z.jsx)(z,{children:`Processing…`})}),be&&(0,Z.jsx)(R,{marginTop:1,children:(0,Z.jsx)(z,{color:`error`,children:be})}),(0,Z.jsx)(R,{marginTop:1,children:(0,Z.jsx)(z,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(B,{children:[(0,Z.jsx)(F,{action:`select:previous`,context:`Select`,fallback:`↑`,description:`navigate`}),(0,Z.jsx)(F,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,Z.jsx)(F,{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)(R,{flexDirection:`column`,children:[(0,Z.jsxs)(z,{children:[(0,Z.jsx)(z,{bold:!0,children:e.name}),(0,Z.jsxs)(z,{dimColor:!0,children:[` @ `,e.marketplace]}),(0,Z.jsxs)(z,{dimColor:!0,children:[` (`,e.scope,`)`]})]}),(0,Z.jsx)(z,{color:`error`,children:n}),e.scope===`managed`?(0,Z.jsx)(R,{marginTop:1,children:(0,Z.jsx)(z,{dimColor:!0,children:`Managed by your organization — contact your admin`})}):(0,Z.jsxs)(R,{marginTop:1,children:[(0,Z.jsxs)(z,{color:`suggestion`,children:[a.pointer,` `]}),(0,Z.jsx)(z,{bold:!0,children:`Remove`})]}),ve&&(0,Z.jsx)(z,{children:`Processing…`}),be&&(0,Z.jsx)(z,{color:`error`,children:be}),(0,Z.jsx)(R,{marginTop:1,children:(0,Z.jsx)(z,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(B,{children:[e.scope!==`managed`&&(0,Z.jsx)(F,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`remove`}),(0,Z.jsx)(F,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}if(typeof b==`object`&&b.type===`mcp-detail`){let e=b.client,n=_e(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 ze=P.getVisibleItems(me);return(0,Z.jsxs)(R,{flexDirection:`column`,children:[(0,Z.jsx)(R,{marginBottom:1,children:(0,Z.jsx)(Ie,{query:S,isFocused:p,isTerminalFocused:v,width:y-4,cursorOffset:w})}),me.length===0&&S&&(0,Z.jsx)(R,{marginBottom:1,children:(0,Z.jsxs)(z,{dimColor:!0,children:[`No items match "`,S,`"`]})}),P.scrollPosition.canScrollUp&&(0,Z.jsx)(R,{children:(0,Z.jsxs)(z,{dimColor:!0,children:[` `,a.arrowUp,` more above`]})}),ze.map((e,t)=>{let n=P.toActualIndex(t)===M&&!p,r=t>0?ze[t-1]:null,i=!r||r.scope!==e.scope;return(0,Z.jsxs)($n.Fragment,{children:[i&&(0,Z.jsx)(R,{marginTop:+(t>0),paddingLeft:2,children:(0,Z.jsx)(z,{dimColor:e.scope!==`flagged`,color:e.scope===`flagged`?`warning`:void 0,bold:e.scope===`flagged`,children:(e=>{switch(e){case`flagged`:return`Flagged`;case`project`:return`Project`;case`local`:return`Local`;case`user`:return`User`;case`enterprise`:return`Enterprise`;case`managed`:return`Managed`;case`builtin`:return`Built-in`;case`dynamic`:return`Built-in`;default:return e}})(e.scope)})}),(0,Z.jsx)(Gn,{item:e,isSelected:n})]},e.id)}),P.scrollPosition.canScrollDown&&(0,Z.jsx)(R,{children:(0,Z.jsxs)(z,{dimColor:!0,children:[` `,a.arrowDown,` more below`]})}),(0,Z.jsx)(R,{marginTop:1,marginLeft:1,children:(0,Z.jsx)(z,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(B,{children:[(0,Z.jsx)(z,{children:`type to search`}),(0,Z.jsx)(F,{action:`plugin:toggle`,context:`Plugin`,fallback:`Space`,description:`toggle`}),(0,Z.jsx)(F,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`details`}),(0,Z.jsx)(F,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})}),A.size>0&&(0,Z.jsx)(R,{marginLeft:1,children:(0,Z.jsx)(z,{dimColor:!0,italic:!0,children:`Run /reload-plugins to apply changes`})})]})}var $n,X,Z,er=e((()=>{i(),$n=t(V(),1),X=t(V(),1),P(),Be(),qt(),Xt(),Jt(),Yt(),Ut(),Gt(),ce(),N(),ae(),Rt(),de(),wt(),g(),Ze(),xe(),Ye(),We(),st(),S(),_(),M(),A(),c(),It(),x(),d(),E(),v(),gt(),rt(),Xe(),lt(),Wn(),fn(),_n(),Kn(),kn(),Z=Ue()}));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 kt(t),r=``;r+=`Validating ${n.fileType} manifest: ${n.filePath}\n\n`,n.errors.length>0&&(r+=`${a.cross} Found ${n.errors.length} ${H(n.errors.length,`error`)}:\n\n`,n.errors.forEach(e=>{r+=` ${a.pointer} ${e.path}: ${e.message}\n`}),r+=`
|
|
15
|
+
`),n.warnings.length>0&&(r+=`${a.warning} Found ${n.warnings.length} ${H(n.warnings.length,`warning`)}:\n\n`,n.warnings.forEach(e=>{r+=` ${a.pointer} ${e.path}: ${e.message}\n`}),r+=`
|
|
16
|
+
`),n.success?(n.warnings.length>0?r+=`${a.tick} Validation passed with warnings\n`:r+=`${a.tick} Validation passed\n`,process.exitCode=0):(r+=`${a.cross} Validation failed\n`,process.exitCode=1),e(r)}catch(t){process.exitCode=2,ct(t),e(`${a.cross} Unexpected error during validation: ${Ge(t)}`)}}n()},[e,t]),(0,ar.jsx)(R,{flexDirection:`column`,children:(0,ar.jsx)(z,{children:`Running validation...`})})}var ir,ar,or=e((()=>{i(),ir=t(V(),1),Be(),We(),st(),Mt(),lt(),ar=Ue()}));function sr({onComplete:e}){return(0,Q.useEffect)(()=>{async function t(){try{let t=await be(),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: ${Ge(t)}`)}}t()},[e]),(0,$.jsx)(z,{children:`Loading marketplaces...`})}function cr(e){let t=[];for(let{source:n,scope:r}of[{source:`userSettings`,scope:`user`},{source:`projectSettings`,scope:`project`},{source:`localSettings`,scope:`local`}])it(n)?.extraKnownMarketplaces?.[e]&&t.push({source:n,scope:r});return{editableSources:t,isInPolicy:!!it(`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=it(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&&et(n,r)}}function hr({setViewState:e,setActiveTab:t,markPluginsChanged:n}){let r=ee(e=>e.plugins.errors),i=ee(e=>e.plugins.installationStatus),o=Ee(),[s,c]=(0,Q.useState)(0),[l,u]=(0,Q.useState)(null),[d,f]=(0,Q.useState)([]);(0,Q.useEffect)(()=>{(async()=>{try{let{failures:e}=await me(await be());f(e)}catch{}})()},[]);let p=i.marketplaces.filter(e=>e.status===`failed`),m=new Set(p.map(e=>e.name)),h=r.filter(dr),g=pr(p,r.filter(e=>(e.type===`marketplace-not-found`||e.type===`marketplace-load-failed`||e.type===`marketplace-blocked-by-policy`)&&!m.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),d,h,_t());Me(`confirm:no`,()=>{e({type:`menu`})},{context:`Confirmation`}),L({"select:previous":()=>c(e=>Math.max(0,e-1)),"select:next":()=>c(e=>Math.min(g.length-1,e+1)),"select:accept":()=>{let r=g[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),pe(),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)}}})),u(`${a.tick} Removed "${i.name}" from ${e} settings`),n();break}case`remove-installed-marketplace`:(async()=>{try{await fe(i.name),pe(),f(e=>e.filter(e=>e.name!==i.name)),u(`${a.tick} Removed marketplace "${i.name}"`),n()}catch(e){u(`Failed to remove "${i.name}": ${e instanceof Error?e.message:String(e)}`)}})();break;case`managed-only`:break;case`none`:break}}},{context:`Select`,isActive:g.length>0});let _=Math.min(s,Math.max(0,g.length-1));_!==s&&c(_);let v=g[_]?.action,y=v&&v.kind!==`none`&&v.kind!==`managed-only`;return g.length===0?(0,$.jsxs)(R,{flexDirection:`column`,children:[(0,$.jsx)(R,{marginLeft:1,children:(0,$.jsx)(z,{dimColor:!0,children:`No plugin errors`})}),(0,$.jsx)(R,{marginTop:1,children:(0,$.jsx)(z,{dimColor:!0,italic:!0,children:(0,$.jsx)(F,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})})})]}):(0,$.jsxs)(R,{flexDirection:`column`,children:[g.map((e,t)=>{let n=t===_;return(0,$.jsxs)(R,{marginLeft:1,flexDirection:`column`,marginBottom:1,children:[(0,$.jsxs)(z,{children:[(0,$.jsxs)(z,{color:n?`suggestion`:`error`,children:[n?a.pointer:a.cross,` `]}),(0,$.jsx)(z,{bold:n,children:e.label}),e.scope&&(0,$.jsxs)(z,{dimColor:!0,children:[` (`,e.scope,`)`]})]}),(0,$.jsx)(R,{marginLeft:3,children:(0,$.jsx)(z,{color:`error`,children:e.message})}),e.guidance&&(0,$.jsx)(R,{marginLeft:3,children:(0,$.jsx)(z,{dimColor:!0,italic:!0,children:e.guidance})})]},t)}),l&&(0,$.jsx)(R,{marginTop:1,marginLeft:1,children:(0,$.jsx)(z,{color:`claude`,children:l})}),(0,$.jsx)(R,{marginTop:1,children:(0,$.jsx)(z,{dimColor:!0,italic:!0,children:(0,$.jsxs)(B,{children:[(0,$.jsx)(F,{action:`select:previous`,context:`Select`,fallback:`↑`,description:`navigate`}),y&&(0,$.jsx)(F,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`resolve`}),(0,$.jsx)(F,{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=Ee(),y=ee(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=zt(),S=n.type===`marketplace`&&n.action===`add`&&n.target!==void 0,C=(0,Q.useCallback)(()=>{v(e=>e.plugins.needsRefresh?e:{...e,plugins:{...e.plugins,needsRefresh:!0}})},[v]),w=(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]),Me(`confirm:no`,(0,Q.useCallback)(()=>{s(`marketplaces`),a({type:`manage-marketplaces`}),l(``),p(null)},[]),{context:`Settings`,isActive:i.type===`add-marketplace`}),(0,Q.useEffect)(()=>{m&&e(m)},[m,e]),(0,Q.useEffect)(()=>{i.type===`help`&&e()},[i.type,e]),i.type===`help`?(0,$.jsxs)(R,{flexDirection:`column`,children:[(0,$.jsx)(z,{bold:!0,children:`Plugin Command Usage:`}),(0,$.jsx)(z,{children:` `}),(0,$.jsx)(z,{dimColor:!0,children:`Installation:`}),(0,$.jsx)(z,{children:` /plugin install - Browse and install plugins`}),(0,$.jsx)(z,{children:` /plugin install <marketplace> - Install from specific marketplace`}),(0,$.jsx)(z,{children:` /plugin install <plugin> - Install specific plugin`}),(0,$.jsx)(z,{children:` /plugin install <plugin>@<market> - Install plugin from marketplace`}),(0,$.jsx)(z,{children:` `}),(0,$.jsx)(z,{dimColor:!0,children:`Management:`}),(0,$.jsx)(z,{children:` /plugin manage - Manage installed plugins`}),(0,$.jsx)(z,{children:` /plugin enable <plugin> - Enable a plugin`}),(0,$.jsx)(z,{children:` /plugin disable <plugin> - Disable a plugin`}),(0,$.jsx)(z,{children:` /plugin uninstall <plugin> - Uninstall a plugin`}),(0,$.jsx)(z,{children:` `}),(0,$.jsx)(z,{dimColor:!0,children:`Marketplaces:`}),(0,$.jsx)(z,{children:` /plugin marketplace - Marketplace management menu`}),(0,$.jsx)(z,{children:` /plugin marketplace add - Add a marketplace`}),(0,$.jsx)(z,{children:` /plugin marketplace add <path/url> - Add marketplace directly`}),(0,$.jsx)(z,{children:` /plugin marketplace update - Update marketplaces`}),(0,$.jsx)(z,{children:` /plugin marketplace update <name> - Update specific marketplace`}),(0,$.jsx)(z,{children:` /plugin marketplace remove - Remove a marketplace`}),(0,$.jsx)(z,{children:` /plugin marketplace remove <name> - Remove specific marketplace`}),(0,$.jsx)(z,{children:` /plugin marketplace list - List all marketplaces`}),(0,$.jsx)(z,{children:` `}),(0,$.jsx)(z,{dimColor:!0,children:`Validation:`}),(0,$.jsx)(z,{children:` /plugin validate <path> - Validate a manifest file or directory`}),(0,$.jsx)(z,{children:` `}),(0,$.jsx)(z,{dimColor:!0,children:`Other:`}),(0,$.jsx)(z,{children:` /plugin - Main plugin menu`}),(0,$.jsx)(z,{children:` /plugin help - Show this help`}),(0,$.jsx)(z,{children:` /plugins - Alias for /plugin`})]}):i.type===`validate`?(0,$.jsx)(rr,{onComplete:e,path:i.path}):i.type===`marketplace-menu`?(a({type:`menu`}),null):i.type===`marketplace-list`?(0,$.jsx)(sr,{onComplete:e}):i.type===`add-marketplace`?(0,$.jsx)(an,{inputValue:c,setInputValue:l,cursorOffset:u,setCursorOffset:d,error:f,setError:p,result:m,setResult:h,setViewState:a,onAddComplete:C,cliMode:S}):(0,$.jsx)(Ve,{color:`suggestion`,children:(0,$.jsxs)(ze,{title:`Plugins`,selectedTab:o,onTabChange:w,color:`suggestion`,disableNavigation:g,children:[(0,$.jsx)(Le,{id:`discover`,title:`Discover`,children:i.type===`browse-marketplace`?(0,$.jsx)(An,{error:f,setError:p,result:m,setResult:h,setViewState:a,onInstallComplete:C,targetMarketplace:i.targetMarketplace,targetPlugin:i.targetPlugin}):(0,$.jsx)(Nn,{error:f,setError:p,result:m,setResult:h,setViewState:a,onInstallComplete:C,onSearchModeChange:_,targetPlugin:i.type===`discover-plugins`?i.targetPlugin:void 0})}),(0,$.jsx)(Le,{id:`installed`,title:`Installed`,children:(0,$.jsx)(Qn,{setViewState:a,setResult:h,onManageComplete:C,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)(Le,{id:`marketplaces`,title:`Marketplaces`,children:(0,$.jsx)(Rn,{setViewState:a,error:f,setError:p,setResult:h,exitState:x,onManageComplete:C,targetMarketplace:i.type===`manage-marketplaces`?i.targetMarketplace:void 0,action:i.type===`manage-marketplaces`?i.action:void 0})}),(0,$.jsx)(Le,{id:`errors`,title:b,children:(0,$.jsx)(hr,{setViewState:a,setActiveTab:s,markPluginsChanged:C})})]})})}var Q,$,yr,br=e((()=>{i(),Q=t(V(),1),P(),Be(),Bt(),N(),g(),We(),S(),l(),M(),gt(),rt(),sn(),Mn(),Ln(),Vn(),er(),Wn(),nr(),or(),$=Ue(),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((()=>{br(),Sr=Ue()}))();export{xr as call};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{$a as t,Ja as n,Lx as r,Xa as i,ao as a,lo as o,po as s,uo as c,zx as l}from"./loadAgentsDir-DlPbtIsS.js";import{I as u,M as d,c as f,i as p}from"./debug-Bglx1aTu.js";import{_t as m,bt as h}from"./settings-B2jvL8Dp.js";import{p as g,v as _}from"./config-C-Y2qtB2.js";import{o as v,s as y}from"./log-D2TIwHBV.js";import{f as b,s as x}from"./pluginOperations-hXYLrzM2.js";function S(e){return O=e,k!==null&&k.length>0&&(e(k),k=null),()=>{O=null}}async function C(){let e=await c(),t=a(),n=new Set;for(let[r,i]of Object.entries(e)){let e=t[r]?.autoUpdate;(e===void 0?h(r,i):e)&&n.add(r.toLowerCase())}return n}async function w(e,t){let n=!1;for(let{scope:r}of t)try{let t=await b(e,r);t.success&&!t.alreadyUpToDate?(n=!0,f(`Plugin autoupdate: updated ${e} from ${t.oldVersion} to ${t.newVersion}`)):t.alreadyUpToDate||f(`Plugin autoupdate: failed to update ${e}: ${t.message}`,{level:`warn`})}catch(t){f(`Plugin autoupdate: error updating ${e}: ${d(t)}`,{level:`warn`})}return n?e:null}async function T(e){let n=t(),r=Object.keys(n.plugins);return r.length===0?[]:(await Promise.allSettled(r.map(async t=>{let{marketplace:r}=l(t);if(!r||!e.has(r.toLowerCase()))return null;let a=n.plugins[t];if(!a||a.length===0)return null;let o=a.filter(i);return o.length===0?null:w(t,o)}))).filter(e=>e.status===`fulfilled`&&e.value!==null).map(e=>e.value)}async function E(e){return T(e)}function D(){(async()=>{if(_()){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 s(e,void 0,{disableCredentialHelper:!0})}catch(t){f(`Plugin autoupdate: failed to refresh marketplace ${e}: ${d(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(),g(),p(),u(),v(),n(),o(),r(),m(),O=null,k=null}));export{T as i,A as n,S as r,D as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Ja as e,do as t,eo as n,lo as r,oo as i}from"./loadAgentsDir-DlPbtIsS.js";import{I as a,M as o,c as s,i as c}from"./debug-Bglx1aTu.js";import{d as l,s as u}from"./pluginOperations-hXYLrzM2.js";import{i as d,n as f,r as p,t as m}from"./pluginFlagging-BG2MHCQJ.js";u(),c(),a(),e(),r(),p();function h(e,t,n){let r=new Set(t.plugins.map(e=>e.name)),i=`@${n}`,a=[];for(let t of Object.keys(e.plugins)){if(!t.endsWith(i))continue;let e=t.slice(0,-i.length);r.has(e)||a.push(t)}return a}async function g(){await d();let e=n(),r=f(),a=await t(),c=[];for(let t of Object.keys(a))try{let n=await i(t);if(!n.forceRemoveDeletedPlugins)continue;let a=h(e,n,t);for(let t of a){if(t in r)continue;let n=e.plugins[t]??[];if(n.some(e=>e.scope===`user`||e.scope===`project`||e.scope===`local`)){for(let e of n){let{scope:n}=e;if(!(n!==`user`&&n!==`project`&&n!==`local`))try{await l(t,n)}catch(e){s(`Failed to auto-uninstall delisted plugin ${t} from ${n}: ${o(e)}`,{level:`error`})}}await m(t),c.push(t)}}}catch(e){s(`Failed to check for delisted plugins in "${t}": ${o(e)}`,{level:`warn`})}return c}export{g as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./figures-5ThXQEtq.js";import{Ka as n,Lx as r,_i as i,hi as a,iu as o,nu as s,qa as c,ru as l,zx as u}from"./loadAgentsDir-DlPbtIsS.js";import{I as d,M as f}from"./debug-Bglx1aTu.js";import{n as p,o as m}from"./process-gEbdy6uY.js";import{o as h,s as g}from"./log-D2TIwHBV.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-hXYLrzM2.js";e(),d(),i(),h(),c(),r(),p(),o(),_(),T();function E(e,r,i){g(e);let a=i?`${r} plugin "${i}"`:r===`disable-all`?`disable all plugins`:`${r} plugins`;console.error(`${t.cross} Failed to ${a}: ${f(e)}`);let o=i?(()=>{let{name:e,marketplace:t}=u(i);return{_PROTO_plugin_name:e,...t&&{_PROTO_marketplace_name:t},...s(e,t,n())}})():{};v(`tengu_plugin_command_failed`,{command:r,error_category:l(e),...o}),process.exit(1)}async function D(e,r=`user`){try{console.log(`Installing plugin "${e}"...`);let i=await b(e,r);if(!i.success)throw Error(i.message);console.log(`${t.tick} ${i.message}`);let{name:a,marketplace:o}=u(i.pluginId||e);v(`tengu_plugin_installed_cli`,{_PROTO_plugin_name:a,...o&&{_PROTO_marketplace_name:o},scope:i.scope||r,install_source:`cli-explicit`,...s(a,o,n())}),process.exit(0)}catch(t){E(t,`install`,e)}}async function O(e,r=`user`,i=!1){try{let a=await x(e,r,!i);if(!a.success)throw Error(a.message);console.log(`${t.tick} ${a.message}`);let{name:o,marketplace:c}=u(a.pluginId||e);v(`tengu_plugin_uninstalled_cli`,{_PROTO_plugin_name:o,...c&&{_PROTO_marketplace_name:c},scope:a.scope||r,...s(o,c,n())}),process.exit(0)}catch(t){E(t,`uninstall`,e)}}async function k(e,r){try{let i=await y(e,r);if(!i.success)throw Error(i.message);console.log(`${t.tick} ${i.message}`);let{name:a,marketplace:o}=u(i.pluginId||e);v(`tengu_plugin_enabled_cli`,{_PROTO_plugin_name:a,...o&&{_PROTO_marketplace_name:o},scope:i.scope,...s(a,o,n())}),process.exit(0)}catch(t){E(t,`enable`,e)}}async function A(e,r){try{let i=await C(e,r);if(!i.success)throw Error(i.message);console.log(`${t.tick} ${i.message}`);let{name:a,marketplace:o}=u(i.pluginId||e);v(`tengu_plugin_disabled_cli`,{_PROTO_plugin_name:a,...o&&{_PROTO_marketplace_name:o},scope:i.scope,...s(a,o,n())}),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,r){try{m(`Checking for updates for plugin "${e}" at ${r} scope…\n`);let i=await S(e,r);if(!i.success)throw Error(i.message);if(m(`${t.tick} ${i.message}\n`),!i.alreadyUpToDate){let{name:t,marketplace:r}=u(i.pluginId||e);v(`tengu_plugin_updated_cli`,{_PROTO_plugin_name:t,...r&&{_PROTO_marketplace_name:r},old_version:i.oldVersion||`unknown`,new_version:i.newVersion||`unknown`,...s(t,r,n())})}await a(0)}catch(t){E(t,`update`,e)}}export{O as a,D as i,A as n,M as o,k as r,j as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Cx as t,Sx as n}from"./loadAgentsDir-DlPbtIsS.js";import{C as r,S as i,c as a,f as o,i as s,u as c,x as l}from"./debug-Bglx1aTu.js";import{o as u,s as d}from"./log-D2TIwHBV.js";import{join as f}from"path";import{randomBytes as p}from"crypto";import{readFile as m,rename as h,unlink as g,writeFile as _}from"fs/promises";function v(){return f(n(),D)}function y(e){let t=i(e);if(typeof t!=`object`||!t||!(`plugins`in t)||typeof t.plugins!=`object`||t.plugins===null)return{};let n=t.plugins,r={};for(let[e,t]of Object.entries(n))if(t&&typeof t==`object`&&`flaggedAt`in t&&typeof t.flaggedAt==`string`){let n={flaggedAt:t.flaggedAt};`seenAt`in t&&typeof t.seenAt==`string`&&(n.seenAt=t.seenAt),r[e]=n}return r}async function b(){try{return y(await m(v(),{encoding:`utf-8`}))}catch{return{}}}async function x(e){let t=v(),i=`${t}.${p(8).toString(`hex`)}.tmp`;try{await c().mkdir(n()),await _(i,r({plugins:e},null,2),{encoding:`utf-8`,mode:384}),await h(i,t),k=e}catch(e){d(e);try{await g(i)}catch{}}}async function S(){let e=await b(),t=Date.now(),n=!1;for(let[r,i]of Object.entries(e))i.seenAt&&t-new Date(i.seenAt).getTime()>=O&&(delete e[r],n=!0);k=e,n&&await x(e)}function C(){return k??{}}async function w(e){k===null&&(k=await b()),await x({...k,[e]:{flaggedAt:new Date().toISOString()}}),a(`Flagged plugin: ${e}`)}async function T(e){k===null&&(k=await b());let t=new Date().toISOString(),n=!1,r={...k};for(let i of e){let e=r[i];e&&!e.seenAt&&(r[i]={...e,seenAt:t},n=!0)}n&&await x(r)}async function E(e){if(k===null&&(k=await b()),!(e in k))return;let{[e]:t,...n}=k;k=n,await x(n)}var D,O,k,A=e((()=>{s(),o(),u(),l(),t(),D=`flagged-plugins.json`,O=2880*60*1e3,k=null}));export{T as a,S as i,C as n,E as o,A as r,w as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{$a as t,Aa as n,Ba as r,Bx as i,Cx as a,Fa as o,Fx as s,Ga as c,Gx as l,Ia as u,Iv as d,Ix as f,Ja as p,Jp as m,Lx as h,Ma as g,Mo as _,Na as v,No as y,Pa as b,Px as x,Ra as S,Rv as C,Ua as w,Va as T,Wa as E,Wx as ee,Yp as te,co as D,eo as O,jo as k,lo as ne,no as A,oo as j,to as M,uo as re,yx as ie,zx as N}from"./loadAgentsDir-DlPbtIsS.js";import{It as ae,J as P}from"./state-B4jiUise.js";import{I as oe,R as F,V as se,f as ce,u as I}from"./debug-Bglx1aTu.js";import{b as L,h as R,s as z}from"./settings-B2jvL8Dp.js";import{o as B,s as V}from"./log-D2TIwHBV.js";import{l as H,o as U}from"./stringUtils-C718f5ey.js";import{n as W,t as G}from"./pluginStartupCheck-DTMa6TgL.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`?P():void 0}function de(e){return z(`projectSettings`)?.enabledPlugins?.[e]===!0}function fe(e){let t=e.includes(`@`);for(let n of[`local`,`project`,`user`]){let r=z(i(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}=N(e);return t.find(t=>t.name===e||t.name===n?!0:r&&t.source?t.name===n&&t.source.includes(`@${r}`):!1)}function me(e){let{name:t}=N(e),n=O();if(n.plugins[e]?.length)return{pluginId:e,pluginName:t};let r=Object.keys(n.plugins).find(e=>{let{name:r}=N(e);return r===t&&(n.plugins[e]?.length??0)>0});return r?{pluginId:r,pluginName:t}:null}function Y(e){let t=O().plugins[e];if(!t||t.length===0)return{scope:`user`};let n=P(),r=t.find(e=>e.scope===`local`&&e.projectPath===n);if(r)return{scope:r.scope,projectPath:r.projectPath};let i=t.find(e=>e.scope===`project`&&e.projectPath===n);if(i)return{scope:i.scope,projectPath:i.projectPath};let a=t.find(e=>e.scope===`user`);return a?{scope:a.scope}:{scope:t[0].scope,projectPath:t[0].projectPath}}async function he(e,t=`user`){q(t);let{name:n,marketplace:i}=N(e),a,o,s;if(i){let t=await D(e);t&&(a=t.entry,o=i,s=t.marketplaceInstallLocation)}else{let e=await re();for(let[t,r]of Object.entries(e))try{let e=(await j(t)).plugins.find(e=>e.name===n);if(e){a=e,o=t,s=r.installLocation;break}}catch(e){V(se(e))}}if(!a||!o)return{success:!1,message:`Plugin "${n}" not found in ${i?`marketplace "${i}"`:`any configured marketplace`}`};let c=a,l=`${c.name}@${o}`,u=await w({pluginId:l,entry:c,scope:t,marketplaceInstallLocation:s});if(!u.ok){let e=u;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:r(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: ${l} (scope: ${t})${u.depNote}`,pluginId:l,pluginName:c.name,scope:t}}async function ge(e,t=`user`,n=!0){q(t);let{enabled:r,disabled:a}=await u(),o=[...r,...a],c=pe(e,o),l=i(t),f=z(l),p,m;if(c)p=Object.keys(f?.enabledPlugins??{}).find(t=>t===e||t===c.name||t.startsWith(`${c.name}@`))??(e.includes(`@`)?e:c.name),m=c.name;else{let t=me(e);if(!t)return{success:!1,message:`Plugin "${e}" not found in installed plugins`};p=t.pluginId,m=t.pluginName}let h=J(t),g=O().plugins[p],_=g?.find(e=>e.scope===t&&e.projectPath===h);if(!_){let{scope:n}=Y(p);return n!==t&&g&&g.length>0?n===`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 ${n} scope, not ${t}. Use --scope ${n} to uninstall.`}:{success:!1,message:`Plugin "${e}" is not installed in ${t} scope. Use --scope to specify the correct scope.`}}let v=_.installPath,b={...f?.enabledPlugins};b[p]=void 0,L(l,{enabledPlugins:b}),k(),M(p,t,h);let S=O().plugins[p],C=!S||S.length===0;C&&v&&await y(v),C&&(d(p),n&&await ie(p));let w=x(p,o),T=s(w);return{success:!0,message:`Successfully uninstalled plugin: ${m} (scope: ${t})${T}`,pluginId:p,pluginName:m,scope:t,reverseDependents:w.length>0?w:void 0}}async function X(e,t,n){let r=t?`enable`:`disable`;if(l(e)){let{error:n}=L(`userSettings`,{enabledPlugins:{...z(`userSettings`)?.enabledPlugins,[e]:t}});if(n)return{success:!1,message:`Failed to ${r} built-in plugin: ${n.message}`};k();let{name:i}=N(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&&te(a))return{success:!1,message:`Plugin "${a}" is blocked by your organization's policy and cannot be enabled`};let d=i(o),f=z(d)?.enabledPlugins?.[a],p={user:0,project:1,local:2},m=n&&c&&p[n]>p[c.scope];if(n&&f===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?f===!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 u(),n=x(a,[...e,...t]);n.length>0&&(h=n)}let{error:g}=L(d,{enabledPlugins:{...z(d)?.enabledPlugins,[a]:t}});if(g)return{success:!1,message:`Failed to ${r} plugin: ${g.message}`};k();let{name:_}=N(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,n){let{name:r,marketplace:i}=N(e),a=i?`${r}@${i}`:e,o=await D(e);if(!o)return{success:!1,message:`Plugin "${r}" not found`,pluginId:a,scope:n};let{entry:s,marketplaceInstallLocation:c}=o,l=t().plugins[a];if(!l||l.length===0)return{success:!1,message:`Plugin "${r}" is not installed`,pluginId:a,scope:n};let u=J(n),d=l.find(e=>e.scope===n&&e.projectPath===u);return d?be({pluginId:a,pluginName:r,entry:s,marketplaceInstallLocation:c,installation:d,scope:n,projectPath:u}):{success:!1,message:`Plugin "${r}" is not installed at scope ${u?`${n} (${u})`:n}`,pluginId:a,scope:n}}async function be({pluginId:e,pluginName:r,entry:i,marketplaceInstallLocation:a,installation:o,scope:s,projectPath:c}){let l=I(),u=o.version,d,f,p=!1,m;if(typeof i.source!=`string`){let t=await n(i.source,{manifest:{name:i.name}});d=t.path,p=!0,m=t.gitCommitSha,f=await E(e,i.source,t.manifest,t.path,i.version,t.gitCommitSha)}else{let t;try{t=await l.stat(a)}catch(t){if(F(t))return{success:!1,message:`Marketplace directory not found at ${a}`,pluginId:e,scope:s};throw t}d=K(t.isDirectory()?a:le(a),i.source);try{await l.stat(d)}catch(t){if(F(t))return{success:!1,message:`Plugin source not found at ${d}`,pluginId:e,scope:s};throw t}let n,r=K(d,`.claude-plugin`,`plugin.json`);try{n=await S(r,i.name,i.source)}catch{}f=await E(e,i.source,n,d,i.version)}try{let n=v(e,f),a=b(e,f);if(o.version===f||o.installPath===n||o.installPath===a)return{success:!0,message:`${r} is already at the latest version (${f}).`,pluginId:e,newVersion:f,oldVersion:u,alreadyUpToDate:!0,scope:s};n=await g(d,e,f,i);let l=o.installPath;if(A(e,s,c,n,f,m),l&&l!==n){let e=t();Object.values(e.plugins).some(e=>e.some(e=>e.installPath===l))||await y(l)}let p=c?`${s} (${c})`:s;return{success:!0,message:`Plugin "${r}" updated from ${u||`unknown`} to ${f} for scope ${p}. Restart to apply changes.`,pluginId:e,newVersion:f,oldVersion:u,scope:s}}finally{p&&d!==v(e,f)&&await l.rm(d,{recursive:!0,force:!0})}}var Q,$,xe=e((()=>{ae(),ee(),oe(),ce(),B(),_(),f(),p(),ne(),a(),h(),T(),o(),C(),m(),W(),c(),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 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Hx as t,Ja as n,Lx as r,Va as i,Vx as a,lo as o}from"./loadAgentsDir-DlPbtIsS.js";import{n as s}from"./cwd-Pa83R95t.js";import{c,i as l}from"./debug-Bglx1aTu.js";import{_t as u,h as d,s as f}from"./settings-B2jvL8Dp.js";import{o as p}from"./log-D2TIwHBV.js";import"path";function m(){let e=new Map,t=a();for(let[n,r]of Object.entries(t))n.includes(`@`)&&(r===!0?e.set(n,`flag`):r===!1&&e.delete(n));for(let{scope:n,source:r}of[{scope:`managed`,source:`policySettings`},{scope:`user`,source:`userSettings`},{scope:`project`,source:`projectSettings`},{scope:`local`,source:`localSettings`},{scope:`flag`,source:`flagSettings`}]){let i=f(r);if(i?.enabledPlugins)for(let[a,o]of Object.entries(i.enabledPlugins))a.includes(`@`)&&(a in t&&t[a]!==o&&c(`Plugin ${a} from --add-dir (${t[a]}) overridden by ${r} (${o})`),o===!0?e.set(a,n):o===!1&&e.delete(a))}return c(`Found ${e.size} enabled plugins with scopes: ${Array.from(e.entries()).map(([e,t])=>`${e}(${t})`).join(`, `)}`),e}var h=e((()=>{s(),l(),p(),d(),t(),n(),o(),r(),i(),u()}));export{h as n,m as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./pluginStartupCheck-DTMa6TgL.js";e();export{t as getPluginEditableScopes};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{n as e,t}from"./figures-5ThXQEtq.js";import{Bx as n,Do as r,Fa as i,Fv as a,Ia as o,Ja as s,Kx as c,Lx as l,Mo as u,Pv as d,Qa as f,_o as p,eo as m,fo as h,ho as g,jo as _,ko as v,lo as ee,po as te,qx as y,ro as b,uo as x,xo as S,zx as C}from"./loadAgentsDir-DlPbtIsS.js";import{Hn as w,It as T}from"./state-B4jiUise.js";import{C as E,I as ne,M as D,x as re}from"./debug-Bglx1aTu.js";import{o as O,s as k}from"./log-D2TIwHBV.js";import{l as A,o as j}from"./stringUtils-C718f5ey.js";import{n as M,r as N}from"./analytics-DJobLaWP.js";import{n as P,t as F}from"./exit-s9XGerrH.js";import{n as I,s as L,t as R}from"./pluginOperations-hXYLrzM2.js";import{a as z,i as B,n as V,o as H,r as U,t as ie}from"./pluginCliCommands-DXZfCZsv.js";import{a as W,c as G,i as K,n as q,r as J,s as Y,t as ae}from"./validatePlugin-D6tFo87L.js";import{basename as oe,dirname as X}from"path";e(),T(),M(),L(),y(),ne(),O(),u(),G(),s(),r(),ee(),d(),K(),l(),i(),ae(),re(),j();function Z(e,n){k(e),F(`${t.cross} Failed to ${n}: ${D(e)}`)}function Q(e){e.errors.length>0&&(console.log(`${t.cross} Found ${e.errors.length} ${A(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} ${A(e.warnings.length,`warning`)}:\n`),e.warnings.forEach(e=>{console.log(` ${t.pointer} ${e.path}: ${e.message}`)}),console.log(``))}async function $(e,n){n.cowork&&w(!0);try{let n=await q(e);console.log(`Validating ${n.fileType} manifest: ${n.filePath}\n`),Q(n);let r=[];if(n.fileType===`plugin`){let e=X(n.filePath);if(oe(e)===`.claude-plugin`){r=await J(X(e));for(let e of r)console.log(`Validating ${e.fileType}: ${e.filePath}\n`),Q(e)}}let i=n.success&&r.every(e=>e.success),a=n.warnings.length>0||r.some(e=>e.warnings.length>0);i?P(a?`${t.tick} Validation passed with warnings`:`${t.tick} Validation passed`):(console.log(`${t.cross} Validation failed`),process.exit(1))}catch(e){k(e),console.error(`${t.cross} Unexpected error during validation: ${D(e)}`),process.exit(2)}}async function se(e){e.cowork&&w(!0),N(`tengu_plugin_list_command`,{});let n=m(),{getPluginEditableScopes:r}=await import(`./pluginStartupCheck-HS1ZceZa.js`),i=r(),s=Object.keys(n.plugins),{enabled:l,disabled:u,errors:d}=await o(),p=[...l,...u],h=p.filter(e=>e.source.endsWith(`@inline`)),g=d.filter(e=>e.source.endsWith(`@inline`)||e.source.startsWith(`inline[`));if(e.json){let t=new Map(p.map(e=>[e.source,e])),r=[];for(let e of s.sort()){let o=n.plugins[e];if(!o||o.length===0)continue;let s=C(e).name,l=d.filter(t=>t.source===e||`plugin`in t&&t.plugin===s).map(c);for(let n of o){let o=t.get(e),s;if(o){let e=o.mcpServers||await a(o);e&&Object.keys(e).length>0&&(s=e)}r.push({id:e,version:n.version||`unknown`,scope:n.scope,enabled:i.has(e),installPath:n.installPath,installedAt:n.installedAt,lastUpdated:n.lastUpdated,projectPath:n.projectPath,mcpServers:s,errors:l.length>0?l:void 0})}}for(let e of h){let t=e.mcpServers||await a(e),n=g.filter(t=>t.source===e.source||`plugin`in t&&t.plugin===e.name).map(c);r.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:n.length>0?n:void 0})}for(let e of g.filter(e=>e.source.startsWith(`inline[`)))r.push({id:e.source,version:`unknown`,scope:`session`,enabled:!1,installPath:`path`in e?e.path:``,errors:[c(e)]});if(e.available){let e=[];try{let[t,n]=await Promise.all([x(),Y()]),{marketplaces:r}=await v(t);for(let{name:t,data:i}of r)if(i)for(let r of i.plugins){let i=S(r.name,t);f(i)||e.push({pluginId:i,name:r.name,description:r.description,marketplaceName:t,version:r.version,source:r.source,installCount:n?.get(i)})}}catch{}P(E({installed:r,available:e},null,2))}else P(E(r,null,2))}s.length===0&&h.length===0&&g.length===0&&P("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 r=n.plugins[e];if(!r||r.length===0)continue;let a=C(e).name,o=d.filter(t=>t.source===e||`plugin`in t&&t.plugin===a);for(let n of r){let r=i.has(e),a=o.length>0?`${t.cross} failed to load`:r?`${t.tick} enabled`:`${t.cross} disabled`,s=n.version||`unknown`,l=n.scope;console.log(` ${t.pointer} ${e}`),console.log(` Version: ${s}`),console.log(` Scope: ${l}`),console.log(` Status: ${a}`);for(let e of o)console.log(` Error: ${c(e)}`);console.log(``)}}if(h.length>0||g.length>0){console.log(`Session-only plugins (--plugin-dir):
|
|
3
|
+
`);for(let e of h){let n=g.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: ${c(e)}`);console.log(``)}for(let e of g.filter(e=>e.source.startsWith(`inline[`)))console.log(` ${t.pointer} ${e.source}: ${t.cross} ${c(e)}\n`)}P()}async function ce(e,r){r.cowork&&w(!0);try{let i=await W(e);i||F(`${t.cross} Invalid marketplace source format. Try: owner/repo, https://..., or ./path`),`error`in i&&F(`${t.cross} ${i.error}`);let a=r.scope??`user`;a!==`user`&&a!==`project`&&a!==`local`&&F(`${t.cross} Invalid scope '${a}'. Use: user, project, or local`);let o=n(a),s=i;r.sparse&&r.sparse.length>0&&(s.source===`github`||s.source===`git`?s={...s,sparsePaths:r.sparse}:F(`${t.cross} --sparse is only supported for github and git marketplace sources (got: ${s.source})`)),console.log(`Adding marketplace...`);let{name:c,alreadyMaterialized:l,resolvedSource:u}=await b(s,e=>{console.log(e)});p(c,{source:u},o),_();let d=s.source;s.source===`github`&&(d=s.repo),N(`tengu_marketplace_added`,{source_type:d}),P(l?`${t.tick} Marketplace '${c}' already on disk — declared in ${a} settings`:`${t.tick} Successfully added marketplace: ${c} (declared in ${a} settings)`)}catch(e){Z(e,`add marketplace`)}}async function le(e){e.cowork&&w(!0);try{let n=await x(),r=Object.keys(n);e.json&&P(E(r.sort().map(e=>{let t=n[e],r=t?.source;return{name:e,source:r?.source,...r?.source===`github`&&{repo:r.repo},...r?.source===`git`&&{url:r.url},...r?.source===`url`&&{url:r.url},...r?.source===`directory`&&{path:r.path},...r?.source===`file`&&{path:r.path},installLocation:t?.installLocation}}),null,2)),r.length===0&&P(`No marketplaces configured`),console.log(`Configured marketplaces:
|
|
4
|
+
`),r.forEach(e=>{let r=n[e];if(console.log(` ${t.pointer} ${e}`),r?.source){let e=r.source;e.source===`github`?console.log(` Source: GitHub (${e.repo})`):e.source===`git`?console.log(` Source: Git (${e.url})`):e.source===`url`?console.log(` Source: URL (${e.url})`):e.source===`directory`?console.log(` Source: Directory (${e.path})`):e.source===`file`&&console.log(` Source: File (${e.path})`)}console.log(``)}),P()}catch(e){Z(e,`list marketplaces`)}}async function ue(e,n){n.cowork&&w(!0);try{await g(e),_(),N(`tengu_marketplace_removed`,{marketplace_name:e}),P(`${t.tick} Successfully removed marketplace: ${e}`)}catch(e){Z(e,`remove marketplace`)}}async function de(e,n){n.cowork&&w(!0);try{if(e)console.log(`Updating marketplace: ${e}...`),await te(e,e=>{console.log(e)}),_(),N(`tengu_marketplace_updated`,{marketplace_name:e}),P(`${t.tick} Successfully updated marketplace: ${e}`);else{let e=await x(),n=Object.keys(e);n.length===0&&P(`No marketplaces configured`),console.log(`Updating ${n.length} marketplace(s)...`),await h(),_(),N(`tengu_marketplace_updated_all`,{count:n.length}),P(`${t.tick} Successfully updated ${n.length} marketplace(s)`)}}catch(e){Z(e,`update marketplace(s)`)}}async function fe(e,t){t.cowork&&w(!0);let n=t.scope||`user`;t.cowork&&n!==`user`&&F(`--cowork can only be used with user scope`),R.includes(n)||F(`Invalid scope: ${n}. Must be one of: ${R.join(`, `)}.`);let{name:r,marketplace:i}=C(e);N(`tengu_plugin_install_command`,{_PROTO_plugin_name:r,...i&&{_PROTO_marketplace_name:i},scope:n}),await B(e,n)}async function pe(e,t){t.cowork&&w(!0);let n=t.scope||`user`;t.cowork&&n!==`user`&&F(`--cowork can only be used with user scope`),R.includes(n)||F(`Invalid scope: ${n}. Must be one of: ${R.join(`, `)}.`);let{name:r,marketplace:i}=C(e);N(`tengu_plugin_uninstall_command`,{_PROTO_plugin_name:r,...i&&{_PROTO_marketplace_name:i},scope:n}),await z(e,n,t.keepData)}async function me(e,t){t.cowork&&w(!0);let n;t.scope&&(R.includes(t.scope)||F(`Invalid scope "${t.scope}". Valid scopes: ${R.join(`, `)}`),n=t.scope),t.cowork&&n!==void 0&&n!==`user`&&F(`--cowork can only be used with user scope`),t.cowork&&n===void 0&&(n=`user`);let{name:r,marketplace:i}=C(e);N(`tengu_plugin_enable_command`,{_PROTO_plugin_name:r,...i&&{_PROTO_marketplace_name:i},scope:n??`auto`}),await U(e,n)}async function he(e,t){if(t.all&&e&&F(`Cannot use --all with a specific plugin`),!t.all&&!e&&F(`Please specify a plugin name or use --all to disable all plugins`),t.cowork&&w(!0),t.all){t.scope&&F(`Cannot use --scope with --all`),N(`tengu_plugin_disable_command`,{}),await ie();return}let n;t.scope&&(R.includes(t.scope)||F(`Invalid scope "${t.scope}". Valid scopes: ${R.join(`, `)}`),n=t.scope),t.cowork&&n!==void 0&&n!==`user`&&F(`--cowork can only be used with user scope`),t.cowork&&n===void 0&&(n=`user`);let{name:r,marketplace:i}=C(e);N(`tengu_plugin_disable_command`,{_PROTO_plugin_name:r,...i&&{_PROTO_marketplace_name:i},scope:n??`auto`}),await V(e,n)}async function ge(e,t){t.cowork&&w(!0);let{name:n,marketplace:r}=C(e);N(`tengu_plugin_update_command`,{_PROTO_plugin_name:n,...r&&{_PROTO_marketplace_name:r}});let i=`user`;t.scope&&(I.includes(t.scope)||F(`Invalid scope "${t.scope}". Valid scopes: ${I.join(`, `)}`),i=t.scope),t.cowork&&i!==`user`&&F(`--cowork can only be used with user scope`),await H(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,$ as pluginValidateHandler};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,r as t}from"./rolldown-runtime-DaDcL9Zw.js";import{b as n,h as r,t as i}from"./settings-
|
|
1
|
+
import{n as e,r as t}from"./rolldown-runtime-DaDcL9Zw.js";import{b as n,h as r,t as i}from"./settings-B2jvL8Dp.js";var a=t({isPoorModeActive:()=>o,setPoorMode:()=>s});function o(){return c===null&&(c=i().poorMode===!0),c}function s(e){c=e,n(`userSettings`,{poorMode:e||void 0})}var c,l=e((()=>{r(),c=null}));export{s as i,o as n,a as r,l as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./poorMode-B0QGV6Ci.js";t();export{e as isPoorModeActive};
|