@readmagic/workmate 0.0.20 → 0.0.22
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 +1 -0
- package/dist/chunks/AgentsMdExternalIncludesDialog-DCvgQ6n3.js +1 -0
- package/dist/chunks/AgentsMdExternalIncludesDialog-s0Orgord.js +1 -0
- package/dist/chunks/App-BcEI6U5j.js +1 -0
- package/dist/chunks/ApproveApiKey-DegdTXZl.js +1 -0
- package/dist/chunks/ApproveApiKey-_VXIMSwY.js +1 -0
- package/dist/chunks/BackgroundTasksDialog-CjBt1L0p.js +2 -0
- package/dist/chunks/BypassPermissionsModeDialog-D2Gesf-u.js +1 -0
- package/dist/chunks/CustomSelect-B46Eh0gU.js +1 -0
- package/dist/chunks/DiffDialog-v2IiYyi3.js +6 -0
- package/dist/chunks/Doctor-BP0Rqraa.js +1 -0
- package/dist/chunks/Doctor-By_y3C2V.js +3 -0
- package/dist/chunks/ExitFlow-BasHk1mk.js +2 -0
- package/dist/chunks/Grove-C3mhgshv.js +11 -0
- package/dist/chunks/InvalidConfigDialog-DYVQK5js.js +1 -0
- package/dist/chunks/InvalidSettingsDialog-Dg6OiStR.js +1 -0
- package/dist/chunks/KeybindingProviderSetup-Bn1jzN5F.js +1 -0
- package/dist/chunks/MCPConnectionManager-ChN4Ayjk.js +1 -0
- package/dist/chunks/MCPToolListView-DLSrQHDc.js +1 -0
- package/dist/chunks/McpParsingWarnings-DZejAh8b.js +1 -0
- package/dist/chunks/MessageSelector-CdDlJE48.js +3 -0
- package/dist/chunks/Messages-DuL_r1Or.js +10 -0
- package/dist/chunks/Onboarding-CE2GNA-h.js +1 -0
- package/dist/chunks/PermissionDialog-BaibiQae.js +1 -0
- package/dist/chunks/PressEnterToContinue-DZc_s_pE.js +1 -0
- package/dist/chunks/PromptInputFooterSuggestions-lkr_A5jQ.js +1 -0
- package/dist/chunks/PromptInputHelpMenu-DaQKKyM5.js +1 -0
- package/dist/chunks/QueryEngine-DNNy1UCD.js +1 -0
- package/dist/chunks/REPL-CEhW-C41.js +1 -0
- package/dist/chunks/REPL-CkSL4C_8.js +124 -0
- package/dist/chunks/ResumeConversation-BMCO_3X7.js +1 -0
- package/dist/chunks/{SearchBox-CwwV0W-w.js → SearchBox-C9xxQzh1.js} +1 -1
- package/dist/chunks/SearchExtraToolsTool-DSy_jDhf.js +1 -0
- package/dist/chunks/SelectMulti-CNE06VAN.js +1 -0
- package/dist/chunks/Settings-mDykHLok.js +2 -0
- package/dist/chunks/Spinner-DwsJJUtn.js +1 -0
- package/dist/chunks/SpinnerGlyph-A6G-gloN.js +1 -0
- package/dist/chunks/TextInput-7uqPhq9T.js +22 -0
- package/dist/chunks/ThemePicker-DT9zVy-0.js +1 -0
- package/dist/chunks/TrustDialog-G4jM9IfM.js +1 -0
- package/dist/chunks/{ValidationErrorsList-BfZ5gcIv.js → ValidationErrorsList-BLtP647v.js} +1 -1
- package/dist/chunks/add-dir-7RfQAC3h.js +1 -0
- package/dist/chunks/{agentDisplay-BM4QG_RX.js → agentDisplay-vLQHFrmq.js} +1 -1
- package/dist/chunks/agents-BNg_skSm.js +101 -0
- package/dist/chunks/{agents-BbDBN5l9.js → agents-DLz0kfsr.js} +1 -1
- package/dist/chunks/allErrors-DaztSMrw.js +1 -0
- package/dist/chunks/appleTerminalBackup-BYKdf3of.js +1 -0
- package/dist/chunks/auth-BTB00dq5.js +10 -0
- package/dist/chunks/auth-Bbc0Ny8i.js +1 -0
- package/dist/chunks/backgroundHousekeeping-DYz83_8C.js +1 -0
- package/dist/chunks/backgroundHousekeeping-bEZtlJSf.js +17 -0
- package/dist/chunks/banner-mqZEluky.js +2 -0
- package/dist/chunks/branch-exFKkymg.js +2 -0
- package/dist/chunks/{break-cache-CcwOjTKt.js → break-cache-BL2gnDLX.js} +2 -2
- package/dist/chunks/btw-3l78DYET.js +1 -0
- package/dist/chunks/caches-6Nx6tsk9.js +1 -0
- package/dist/chunks/caches-ouaWB9bY.js +1 -0
- package/dist/chunks/claudeDesktop-D3PEgx3U.js +1 -0
- package/dist/chunks/{clear-DmqQBNKg.js → clear-CXfhVRp8.js} +1 -1
- package/dist/chunks/client-C01Bnxxv.js +1 -0
- package/dist/chunks/client-DYRgRQsr.js +1 -0
- package/dist/chunks/{client-C_jBL1yC.js → client-DdenNfkQ.js} +1 -1
- package/dist/chunks/client-DvhWKIOx.js +1 -0
- package/dist/chunks/commands-BoxOw75F.js +1 -0
- package/dist/chunks/compact-BOYr105K.js +2 -0
- package/dist/chunks/config-BddEvZZl.js +3 -0
- package/dist/chunks/config-GEv9hUzz.js +1 -0
- package/dist/chunks/config-kw4xg7Nk.js +1 -0
- package/dist/chunks/context-3s9wtn4L.js +1 -0
- package/dist/chunks/{context-noninteractive-BzDVMnWC.js → context-noninteractive-CJhUu_4y.js} +9 -9
- package/dist/chunks/context-noninteractive-DFvoZ2L9.js +1 -0
- package/dist/chunks/conversation-CoGharlH.js +1 -0
- package/dist/chunks/conversation-MxEVm54C.js +1 -0
- package/dist/chunks/conversationRecovery-Da_8uldZ.js +1 -0
- package/dist/chunks/convert-legacy-node-http-options-BZnGSjx2.js +1 -0
- package/dist/chunks/crossProjectResume-CzPCHq_K.js +40 -0
- package/dist/chunks/cwd-BcO6WHKo.js +1 -0
- package/dist/chunks/cwd-CDUelriw.js +1 -0
- package/dist/chunks/{datadog-Bc6wkPne.js → datadog-v_mXWncN.js} +1 -1
- package/dist/chunks/{debug-D58GQBDG.js → debug-8DCufdSp.js} +4 -4
- package/dist/chunks/detectRepository-DfX8xXw2.js +1 -0
- package/dist/chunks/{diff-DIg66U_d.js → diff-DJSt7QO6.js} +1 -1
- package/dist/chunks/directoryCompletion-CT6YVeg7.js +1 -0
- package/dist/chunks/doctor-DWvioSU9.js +1 -0
- package/dist/chunks/entry-ex0-RyYV.js +13 -0
- package/dist/chunks/esm-0CwQE5CJ.js +10 -0
- package/dist/chunks/esm-BCmY8V0C.js +1 -0
- package/dist/chunks/esm-BQY8jJNR.js +1 -0
- package/dist/chunks/esm-BUJtY-Rb.js +1 -0
- package/dist/chunks/esm-BadZVa27.js +1 -0
- package/dist/chunks/esm-BbMeEYcz.js +1 -0
- package/dist/chunks/esm-sVMjGuep.js +1 -0
- package/dist/chunks/execFileNoThrow-BsfuytkN.js +34 -0
- package/dist/chunks/exit-BxC_ZEtO.js +1 -0
- package/dist/chunks/extraUsage-DYm33Occ.js +1 -0
- package/dist/chunks/extractMemories-CzN3Ax2B.js +1 -0
- package/dist/chunks/fast-DqUpl_Lr.js +1 -0
- package/dist/chunks/fast-NUdUyAaM.js +1 -0
- package/dist/chunks/fetchModelList-CqsTAWEN.js +1 -0
- package/dist/chunks/fetchModelList-DBMHE6Ng.js +1 -0
- package/dist/chunks/fileSuggestions-B-SLfb-o.js +3 -0
- package/dist/chunks/firstPartyEventLogger-C0q45h_4.js +3 -0
- package/dist/chunks/firstPartyEventLogger-CP8hCBDj.js +1 -0
- package/dist/chunks/fpsMetrics-wxj9GAsd.js +1 -0
- package/dist/chunks/gemini-BC9kHhwe.js +2 -0
- package/dist/chunks/generateSessionName-ChvKBVxB.js +1 -0
- package/dist/chunks/{genericProcessUtils-6E7fB1dI.js → genericProcessUtils-BYi0OefF.js} +3 -3
- package/dist/chunks/goal-ByyimpVU.js +3 -0
- package/dist/chunks/grok-DenjixMl.js +1 -0
- package/dist/chunks/grove-Dq8QbQ9o.js +7 -0
- package/dist/chunks/help-CK90i4hE.js +1 -0
- package/dist/chunks/history-CNQNd6hT.js +1 -0
- package/dist/chunks/{hooks-7iyENdDG.js → hooks-BRFDg9DV.js} +2 -2
- package/dist/chunks/hooks-BaYwmkxD.js +1 -0
- package/dist/chunks/install-ZMll-dAa.js +1 -0
- package/dist/chunks/instrumentation-BwVyvRfY.js +21 -0
- package/dist/chunks/{job-CXz7SLZp.js → job-G_ukhLc4.js} +1 -1
- package/dist/chunks/keybindings-wNxBzDVQ.js +1 -0
- package/dist/chunks/launchLocalMemory-BcRlXLm6.js +3 -0
- package/dist/chunks/launchOnboarding-CDjQ64RO.js +8 -0
- package/dist/chunks/{loadAgentsDir-DaNpxaO-.js → loadAgentsDir-C1LkW7gl.js} +571 -641
- package/dist/chunks/loadAgentsDir-DKXap_Om.js +1 -0
- package/dist/chunks/loadPluginHooks-DtmHtEiS.js +1 -0
- package/dist/chunks/{loader-C33o_5kS.js → loader-C61fB6vU.js} +1 -1
- package/dist/chunks/localSearch-BB9x5C2N.js +1 -0
- package/dist/chunks/{localSearch-C2SZ9bGW.js → localSearch-DFo_WTMm.js} +1 -1
- package/dist/chunks/log-DaILwWJa.js +1 -0
- package/dist/chunks/logoUtils-Dj_2SWmO.js +1 -0
- package/dist/chunks/{magicDocs-CrTwULyJ.js → magicDocs-DYc9TFmI.js} +2 -2
- package/dist/chunks/main-BRg8L_aw.js +346 -0
- package/dist/chunks/managedEnv-DsqAYOJ4.js +1 -0
- package/dist/chunks/managedEnv-lybrMred.js +1 -0
- package/dist/chunks/mcp-Bsw3cMiJ.js +6 -0
- package/dist/chunks/mcp-DDdud6Y7.js +1 -0
- package/dist/chunks/mcp-DbgTDUt7.js +2 -0
- package/dist/chunks/memory-CzwTzihf.js +1 -0
- package/dist/chunks/modalContext-DDZdU1J8.js +1 -0
- package/dist/chunks/mode-Pan-Q2c4.js +2 -0
- package/dist/chunks/model-BYfmXKHf.js +1 -0
- package/dist/chunks/model-BwBE0Pt5.js +1 -0
- package/dist/chunks/modelOptions-DvNBapgG.js +1 -0
- package/dist/chunks/nativeInstaller-DnSNJWIi.js +1 -0
- package/dist/chunks/notifications-B0DTaYoy.js +1 -0
- package/dist/chunks/omit-Dl1Us_PY.js +1 -0
- package/dist/chunks/onChangeAppState-4KOJMN82.js +1 -0
- package/dist/chunks/openai-C_6C1_0N.js +10 -0
- package/dist/chunks/overlayContext-CMV7nYR9.js +1 -0
- package/dist/chunks/panel-D9fGQgln.js +1 -0
- package/dist/chunks/parser-BKAVMTyD.js +1 -0
- package/dist/chunks/{parser-eVu-cTRs.js → parser-D8slvrJP.js} +1 -1
- package/dist/chunks/partition-B504IgAa.js +1 -0
- package/dist/chunks/pasteStore-DNV1M5Xd.js +1 -0
- package/dist/chunks/permissions-CLFMhdRk.js +3 -0
- package/dist/chunks/pidLock-D9do1Afy.js +3 -0
- package/dist/chunks/plan-CQLnPLuE.js +1 -0
- package/dist/chunks/{platform-DMQxcm4K.js → platform-Dzff1WWw.js} +1 -1
- package/dist/chunks/plugin-BYdF7uob.js +17 -0
- package/dist/chunks/pluginAutoupdate-BJaAqwTH.js +1 -0
- package/dist/chunks/pluginBlocklist-DKKmOnWM.js +1 -0
- package/dist/chunks/pluginCliCommands-z8TtJMKH.js +1 -0
- package/dist/chunks/{pluginFlagging-DRA0m76J.js → pluginFlagging-DQP8tBi2.js} +1 -1
- package/dist/chunks/pluginOperations-BcfJCDco.js +2 -0
- package/dist/chunks/{pluginStartupCheck-BF1N4Lih.js → pluginStartupCheck-CfRvCrFg.js} +1 -1
- package/dist/chunks/pluginStartupCheck-Cq4PvULa.js +1 -0
- package/dist/chunks/plugins-CTM8jpOw.js +4 -0
- package/dist/chunks/policyLimits-a7ix6GnU.js +1 -0
- package/dist/chunks/poorMode-C11JEH3d.js +1 -0
- package/dist/chunks/{poorMode-CKQfWf3S.js → poorMode-J5SYJvoY.js} +1 -1
- package/dist/chunks/print-u6MzL5Cr.js +13 -0
- package/dist/chunks/processBashCommand-DIwrI2QC.js +1 -0
- package/dist/chunks/processSlashCommand-B-Gujpxm.js +5 -0
- package/dist/chunks/projectOnboardingState-CJycxw5P.js +1 -0
- package/dist/chunks/{prompt-8u06WVES.js → prompt-BGqgPgCU.js} +3 -3
- package/dist/chunks/prompt-BPJDGlx5.js +1 -0
- package/dist/chunks/prompt-DEdZzkEz.js +1 -0
- package/dist/chunks/promptEditor-CmQ9p4oe.js +4 -0
- package/dist/chunks/{protocolHandler-DzHVaPl3.js → protocolHandler-CJo9-PfZ.js} +2 -2
- package/dist/chunks/{proxy-BhIc7-mj.js → proxy-CB17QimU.js} +2 -2
- package/dist/chunks/reconciler-DSKLuOS7.js +1 -0
- package/dist/chunks/refresh-BbZFCNpn.js +1 -0
- package/dist/chunks/registerProtocol-CLIpzVwF.js +1 -0
- package/dist/chunks/reload-plugins-DjugL8jH.js +1 -0
- package/dist/chunks/rename-DOtCOtEr.js +1 -0
- package/dist/chunks/{renderOptions-D-aQZbzS.js → renderOptions-Zqfm2U1y.js} +1 -1
- package/dist/chunks/resume-BB4T4WIV.js +2 -0
- package/dist/chunks/ripgrep-BuzOTf1S.js +5 -0
- package/dist/chunks/ripgrep-CZ2CqaHb.js +1 -0
- package/dist/chunks/{runtimeObserver-DzesbvgI.js → runtimeObserver-CK_iZ6OB.js} +1 -1
- package/dist/chunks/{runtimeObserver-L6041elO.js → runtimeObserver-CpP0L9T9.js} +4 -4
- package/dist/chunks/sandbox-adapter-DhJJ6WOV.js +1 -0
- package/dist/chunks/sandbox-toggle-KOHYvbQT.js +1 -0
- package/dist/chunks/searchExtraTools-CdJghGkj.js +1 -0
- package/dist/chunks/select-C_KXmqbI.js +1 -0
- package/dist/chunks/sessionFileAccessHooks-D7KbWFp7.js +1 -0
- package/dist/chunks/sessionObserver-DB-sLv-X.js +1 -0
- package/dist/chunks/{sessionObserver-0D8xFoRK.js → sessionObserver-WOYv2n7C.js} +2 -2
- package/dist/chunks/sessionStorage-sgOAbDn7.js +1 -0
- package/dist/chunks/sessionTracing-yBre24PH.js +11 -0
- package/dist/chunks/settings-C-KNkvsM.js +1 -0
- package/dist/chunks/settings-DKN4xSpQ.js +24 -0
- package/dist/chunks/setup-CN_Pk7AR.js +3 -0
- package/dist/chunks/{shadowedRuleDetection-Cy9tsuKc.js → shadowedRuleDetection-Df-kZ_pK.js} +1 -1
- package/dist/chunks/{sideQuestion-Ds7Elgs4.js → sideQuestion-CMB8hfgX.js} +3 -3
- package/dist/chunks/sinks-BS17vtN0.js +1 -0
- package/dist/chunks/sinks-D1EjkHb4.js +1 -0
- package/dist/chunks/skillChangeDetector-CBKuGuEi.js +1 -0
- package/dist/chunks/{skillGapStore-BxCxKPev.js → skillGapStore-CfmlO6pb.js} +2 -2
- package/dist/chunks/{skillLifecycle-CfyNC3sW.js → skillLifecycle-BQ2LMfMx.js} +2 -2
- package/dist/chunks/{skillSearchPanel-CMNJFIEC.js → skillSearchPanel-BwYuwLFs.js} +4 -4
- package/dist/chunks/skills-BVHPQma0.js +1 -0
- package/dist/chunks/src-9vmGsuSI.js +1 -0
- package/dist/chunks/{src-CgZmCiiH.js → src-BacxF9BD.js} +2 -2
- package/dist/chunks/startupProfiler-B_U4QDtf.js +1 -0
- package/dist/chunks/startupProfiler-DTs9w9EN.js +3 -0
- package/dist/chunks/{state-D5D6QpTX.js → state-BowF111d.js} +1 -1
- package/dist/chunks/state-CGuyDES7.js +1 -0
- package/dist/chunks/staticRender-BVWx0IM1.js +1 -0
- package/dist/chunks/status-BurdTfyz.js +2 -0
- package/dist/chunks/status-DMq1An5h.js +1 -0
- package/dist/chunks/statusNoticeHelpers-X75JNlx5.js +1 -0
- package/dist/chunks/stringUtils-BQm3OfeJ.js +4 -0
- package/dist/chunks/{switcher-DQF5ZNal.js → switcher-Bq1Ct_Sn.js} +1 -1
- package/dist/chunks/switcher-DGD4ORVf.js +1 -0
- package/dist/chunks/{tasks-C8pb6ftc.js → tasks-0c8Uy04D.js} +1 -1
- package/dist/chunks/tempfile-CHO5wXsV.js +1 -0
- package/dist/chunks/{templateJobs-DJ4dcfcL.js → templateJobs-BdFzE9XG.js} +1 -1
- package/dist/chunks/terminalSetup-Cf_r6pwK.js +32 -0
- package/dist/chunks/{terminalSetup-7PdC4fV5.js → terminalSetup-D7J6bxcn.js} +1 -1
- package/dist/chunks/theme-Bby4fssR.js +1 -0
- package/dist/chunks/tipRegistry-CyRXWWTz.js +2 -0
- package/dist/chunks/{toolEventObserver-D2nk8ZbW.js → toolEventObserver-CzFZUIsM.js} +1 -1
- package/dist/chunks/toolPool-CnrZcprA.js +1 -0
- package/dist/chunks/types-zk5Ltv5q.js +81 -0
- package/dist/chunks/udsClient-ftP0yIpe.js +1 -0
- package/dist/chunks/use-select-navigation-DMaC_3iw.js +1 -0
- package/dist/chunks/useDoublePress-C9xxQzh1.js +1 -0
- package/dist/chunks/useExitOnCtrlCDWithKeybindings-CjW3gUOt.js +1 -0
- package/dist/chunks/useMainLoopModel-DWscpA9I.js +1 -0
- package/dist/chunks/useManagePlugins-CYXVcql2.js +1 -0
- package/dist/chunks/useMergedTools-DarmnCEw.js +1 -0
- package/dist/chunks/useSearchInput-C2JuUW3g.js +1 -0
- package/dist/chunks/useSettingsErrors-DutJBiKZ.js +1 -0
- package/dist/chunks/util-Bq5l7FF5.js +1 -0
- package/dist/chunks/validatePlugin-DIdEydz_.js +1 -0
- package/dist/chunks/{vim-BagKUX4j.js → vim-D8prM2IH.js} +1 -1
- package/dist/chunks/worktree-Caqt2WRZ.js +1 -0
- package/dist/cli.js +1 -1
- package/package.json +3 -21
- package/dist/chunks/AddWorkspaceDirectory-BYNvxNrD.js +0 -1
- package/dist/chunks/AgentsMdExternalIncludesDialog-BSSz86ER.js +0 -1
- package/dist/chunks/AgentsMdExternalIncludesDialog-CMEGV4Md.js +0 -1
- package/dist/chunks/App-W_9d1DjK.js +0 -1
- package/dist/chunks/ApproveApiKey-Bf1Rb8Ql.js +0 -1
- package/dist/chunks/ApproveApiKey-wpdvXpFr.js +0 -1
- package/dist/chunks/BackgroundTasksDialog-lGn1Wj1k.js +0 -2
- package/dist/chunks/BypassPermissionsModeDialog-CjVjyNf8.js +0 -1
- package/dist/chunks/DiffDialog-DCpchgp5.js +0 -6
- package/dist/chunks/Doctor-6SjW91rd.js +0 -1
- package/dist/chunks/Doctor-FPYTivHw.js +0 -3
- package/dist/chunks/ExitFlow-Dy8_1D8J.js +0 -2
- package/dist/chunks/Grove-Dd6rjs5P.js +0 -11
- package/dist/chunks/HybridTransport-CJVkWa2u.js +0 -2
- package/dist/chunks/InvalidConfigDialog-Bisj9ic_.js +0 -1
- package/dist/chunks/InvalidSettingsDialog-DyTPNRQR.js +0 -1
- package/dist/chunks/MCPConnectionManager-DfyoZaiu.js +0 -1
- package/dist/chunks/MCPToolListView-Dioupv8F.js +0 -1
- package/dist/chunks/McpParsingWarnings-BUlgpZAF.js +0 -1
- package/dist/chunks/MessageSelector-D8fylxPg.js +0 -3
- package/dist/chunks/Messages-BZDFMYBT.js +0 -10
- package/dist/chunks/Onboarding-BKLomZYo.js +0 -1
- package/dist/chunks/PermissionDialog-BPhvs5xH.js +0 -1
- package/dist/chunks/PressEnterToContinue-Dwoh6CaW.js +0 -1
- package/dist/chunks/PromptInputFooterSuggestions-DCum89fF.js +0 -1
- package/dist/chunks/PromptInputHelpMenu-DG2lRqis.js +0 -1
- package/dist/chunks/QueryEngine-CyGHpX7M.js +0 -1
- package/dist/chunks/REPL-BDsz8KIx.js +0 -1
- package/dist/chunks/REPL-CCBNfZfs.js +0 -128
- package/dist/chunks/RemoteSessionManager-BfsOv4K6.js +0 -2
- package/dist/chunks/ResumeConversation-pC8NLq0F.js +0 -1
- package/dist/chunks/SSETransport-B3K6eH9I.js +0 -2
- package/dist/chunks/SearchExtraToolsTool-DYoxHo9T.js +0 -1
- package/dist/chunks/Settings-CKaGmKg2.js +0 -2
- package/dist/chunks/TeleportProgress-CkgSp1cs.js +0 -1
- package/dist/chunks/TeleportRepoMismatchDialog-DdO_rECq.js +0 -1
- package/dist/chunks/TeleportResumeWrapper-BeG4N-2z.js +0 -1
- package/dist/chunks/ThemePicker-iD9ufy99.js +0 -1
- package/dist/chunks/TrustDialog-qO5OdQt8.js +0 -1
- package/dist/chunks/add-dir-C4eSVlZ6.js +0 -1
- package/dist/chunks/agents-D3APE_8d.js +0 -101
- package/dist/chunks/allErrors-BkgB7JNK.js +0 -1
- package/dist/chunks/api-BHBK9axp.js +0 -1
- package/dist/chunks/api-DyUWfg3a.js +0 -1
- package/dist/chunks/auth-0rn1U4Eq.js +0 -10
- package/dist/chunks/auth-BEoTPSgC.js +0 -1
- package/dist/chunks/auth-BPug7U_u.js +0 -1
- package/dist/chunks/backgroundHousekeeping-D7xAhUaE.js +0 -1
- package/dist/chunks/backgroundHousekeeping-km82qEh0.js +0 -17
- package/dist/chunks/banner-BkUdig-T.js +0 -2
- package/dist/chunks/bg-tGgpwpYx.js +0 -9
- package/dist/chunks/branch-CQ38cx5n.js +0 -2
- package/dist/chunks/bridgeConfig-C5L-7KaP.js +0 -1
- package/dist/chunks/bridgeConfig-CJMjDoaP.js +0 -1
- package/dist/chunks/bridgeMessaging-DVC3qj-C.js +0 -1
- package/dist/chunks/bridgePointer-DfTOjgtX.js +0 -1
- package/dist/chunks/bridgeStatusUtil-Cex6VowM.js +0 -1
- package/dist/chunks/btw-_P96ffHR.js +0 -1
- package/dist/chunks/bundledMode--fG1S62b.js +0 -1
- package/dist/chunks/caches-DH-q8Fjf.js +0 -1
- package/dist/chunks/caches-Dq0pJFDP.js +0 -1
- package/dist/chunks/capacityWake-BpP6c7x3.js +0 -3
- package/dist/chunks/ccrClient-DO563xlf.js +0 -1
- package/dist/chunks/claudeDesktop-DPc_SaVn.js +0 -1
- package/dist/chunks/cliLaunch-DDtwAolw.js +0 -1
- package/dist/chunks/client-9uHzAmFH.js +0 -1
- package/dist/chunks/client-BVal_QII.js +0 -1
- package/dist/chunks/client-C19cqYQS.js +0 -1
- package/dist/chunks/client-Dd7CKMRX.js +0 -1
- package/dist/chunks/commands-BkpqHY9F.js +0 -1
- package/dist/chunks/compact-DuVIvqMu.js +0 -2
- package/dist/chunks/config-DMP6-Ccr.js +0 -1
- package/dist/chunks/config-DRy1I12M.js +0 -3
- package/dist/chunks/config-e0Goy478.js +0 -1
- package/dist/chunks/context-DjgMzIfe.js +0 -1
- package/dist/chunks/context-noninteractive-DV7bIJCm.js +0 -1
- package/dist/chunks/controlMessageCompat-IFu4Gc1y.js +0 -1
- package/dist/chunks/conversation-BBOE_EoE.js +0 -1
- package/dist/chunks/conversation-WxH5pb2z.js +0 -1
- package/dist/chunks/createSSHSession-LVGVXHXL.js +0 -5
- package/dist/chunks/createSession-BUzna9-E.js +0 -1
- package/dist/chunks/createSession-Dgwxk1WA.js +0 -1
- package/dist/chunks/crossProjectResume-6B2NYy8a.js +0 -40
- package/dist/chunks/cwd-DLK3znO7.js +0 -1
- package/dist/chunks/cwd-Nh5IZNKO.js +0 -1
- package/dist/chunks/debugUtils-DXBRbwCE.js +0 -1
- package/dist/chunks/detached-Biz-xhu0.js +0 -4
- package/dist/chunks/detectRepository-CDOJ-M7h.js +0 -1
- package/dist/chunks/detectRepository-Cv9-k6dg.js +0 -1
- package/dist/chunks/directoryCompletion-BDGcGDuv.js +0 -1
- package/dist/chunks/doctor-BhUmhHQU.js +0 -1
- package/dist/chunks/entry-B-Y-AYeK.js +0 -13
- package/dist/chunks/esm-BYnFh4pG.js +0 -1
- package/dist/chunks/esm-Bx6rTxIs.js +0 -1
- package/dist/chunks/esm-C367Cyo-.js +0 -1
- package/dist/chunks/esm-CXM9jqO_.js +0 -1
- package/dist/chunks/esm-CXczu_-W.js +0 -1
- package/dist/chunks/esm-CXt5K8Xt.js +0 -1
- package/dist/chunks/esm-Cb-L4oAk.js +0 -1
- package/dist/chunks/esm-CvHtYRrr.js +0 -1
- package/dist/chunks/esm-DhRjocaU.js +0 -1
- package/dist/chunks/esm-DklLYEuz.js +0 -1
- package/dist/chunks/esm-IYgGg4wR.js +0 -1
- package/dist/chunks/esm-lyfry1WB.js +0 -10
- package/dist/chunks/execFileNoThrow-Bmb5HEFz.js +0 -34
- package/dist/chunks/execSyncWrapper-C3ZFV9od.js +0 -1
- package/dist/chunks/exit-CW2eqUrR.js +0 -1
- package/dist/chunks/extraUsage-CkTon7ib.js +0 -1
- package/dist/chunks/extractMemories-CfmbvayQ.js +0 -1
- package/dist/chunks/fast-ByahC7Gw.js +0 -1
- package/dist/chunks/fast-xtIP4u4y.js +0 -1
- package/dist/chunks/fetchModelList-D9aePIPW.js +0 -1
- package/dist/chunks/fetchModelList-Dy-x4h3G.js +0 -1
- package/dist/chunks/fileSuggestions-CFkJktgc.js +0 -3
- package/dist/chunks/firstPartyEventLogger-Bt9iG9xk.js +0 -1
- package/dist/chunks/firstPartyEventLogger-DqGSujCz.js +0 -3
- package/dist/chunks/flushGate-BjKW7PFC.js +0 -1
- package/dist/chunks/fpsMetrics-Dk_pnSHJ.js +0 -1
- package/dist/chunks/gemini-NnmxBoEp.js +0 -1
- package/dist/chunks/generateSessionName-EpqGW-T2.js +0 -1
- package/dist/chunks/git-By_J4XJL.js +0 -5
- package/dist/chunks/git-zJCasBa6.js +0 -1
- package/dist/chunks/githubRepoPathMapping-CzgPGOHQ.js +0 -1
- package/dist/chunks/goal-DbS8yJfB.js +0 -3
- package/dist/chunks/grok-BxZ4vTDw.js +0 -1
- package/dist/chunks/grove-CYE1Cfcz.js +0 -7
- package/dist/chunks/hash-Tu-My5Vp.js +0 -1
- package/dist/chunks/help-DatnwM25.js +0 -1
- package/dist/chunks/hooks-DjbqtbUV.js +0 -1
- package/dist/chunks/initReplBridge-BEZW5PEY.js +0 -1
- package/dist/chunks/install-DJukI-kL.js +0 -1
- package/dist/chunks/instrumentation-2HH15DPu.js +0 -21
- package/dist/chunks/jwtUtils-C_LG1txt.js +0 -1
- package/dist/chunks/keybindings-C9l5il16.js +0 -1
- package/dist/chunks/launchLocalMemory-BfGenqj1.js +0 -3
- package/dist/chunks/launchOnboarding-DjMmXeQE.js +0 -8
- package/dist/chunks/lazySchema-DULtBUCI.js +0 -65
- package/dist/chunks/lib-BlVGipXx.js +0 -14
- package/dist/chunks/loadAgentsDir-DcI-8FQF.js +0 -1
- package/dist/chunks/loadPluginHooks-CGgpcyEC.js +0 -1
- package/dist/chunks/localSearch-CTTwYTU1.js +0 -1
- package/dist/chunks/log-CZ7ploQm.js +0 -1
- package/dist/chunks/logoUtils-CbIqOFrX.js +0 -1
- package/dist/chunks/main-Blm02_Js.js +0 -31
- package/dist/chunks/main-bJXadFi0.js +0 -356
- package/dist/chunks/managedEnv-CUsdYhAI.js +0 -1
- package/dist/chunks/managedEnv-DXeaUDSK.js +0 -1
- package/dist/chunks/mappers-_B-s9fNz.js +0 -1
- package/dist/chunks/mcp-BbbYzWpy.js +0 -6
- package/dist/chunks/mcp-D91sH9a8.js +0 -1
- package/dist/chunks/mcp-Dx-zgUgu.js +0 -2
- package/dist/chunks/memoize-CumjjK2Q.js +0 -1
- package/dist/chunks/memory-BeL7ui9m.js +0 -1
- package/dist/chunks/modalContext-wY9CeN4G.js +0 -1
- package/dist/chunks/mode-D695kgLI.js +0 -2
- package/dist/chunks/model-DX0TtzqX.js +0 -1
- package/dist/chunks/model-Do0f476p.js +0 -1
- package/dist/chunks/model-DpcM8dz5.js +0 -1
- package/dist/chunks/modelOptions-B3nis9cC.js +0 -1
- package/dist/chunks/nativeInstaller-CymO8TNe.js +0 -1
- package/dist/chunks/oauth-D38aRTUb.js +0 -1
- package/dist/chunks/oauth-U649LV5H.js +0 -1
- package/dist/chunks/omit-DO61BHZu.js +0 -1
- package/dist/chunks/onChangeAppState-vKml_lit.js +0 -1
- package/dist/chunks/openai-DdupGVdC.js +0 -10
- package/dist/chunks/panel-CVd1dzYl.js +0 -1
- package/dist/chunks/parser-Cq9X7HMP.js +0 -1
- package/dist/chunks/partition-BivH9MBJ.js +0 -1
- package/dist/chunks/permissions-C9iqR4_N.js +0 -3
- package/dist/chunks/pidLock-DiKz5Tza.js +0 -3
- package/dist/chunks/plan-KDN5IGWY.js +0 -1
- package/dist/chunks/plugin-D0rzUb8E.js +0 -17
- package/dist/chunks/pluginAutoupdate-C2xTKLR_.js +0 -1
- package/dist/chunks/pluginBlocklist-xdiUmUpt.js +0 -1
- package/dist/chunks/pluginCliCommands-CIDDvVN7.js +0 -1
- package/dist/chunks/pluginOperations-BEYsarAn.js +0 -2
- package/dist/chunks/pluginStartupCheck-DVkI4pqo.js +0 -1
- package/dist/chunks/plugins-CWWU4BKs.js +0 -4
- package/dist/chunks/pollConfig-2nFzv6Hy.js +0 -1
- package/dist/chunks/poorMode-BTIe8W_H.js +0 -1
- package/dist/chunks/print-B5H2xbBS.js +0 -14
- package/dist/chunks/processBashCommand-EQ9EWaRV.js +0 -1
- package/dist/chunks/processSlashCommand-C4PKNyFT.js +0 -5
- package/dist/chunks/prompt-B9sDzLPK.js +0 -1
- package/dist/chunks/prompt-WsoTRhoh.js +0 -1
- package/dist/chunks/promptEditor-Cr4w-4Bz.js +0 -4
- package/dist/chunks/rcDebugLog-DSchf3Hs.js +0 -1
- package/dist/chunks/reconciler-RIKmaPg7.js +0 -1
- package/dist/chunks/refresh-CCSCAjgz.js +0 -1
- package/dist/chunks/registerProtocol-C0IlPEoa.js +0 -1
- package/dist/chunks/reload-plugins-DC-tbXVv.js +0 -1
- package/dist/chunks/remoteBridgeCore-NGTnhQgw.js +0 -1
- package/dist/chunks/remoteManagedSettings-BoOYHzYP.js +0 -1
- package/dist/chunks/rename-DS1AmW-F.js +0 -1
- package/dist/chunks/resume-Cf5PSoPw.js +0 -2
- package/dist/chunks/ripgrep-C3jtZL7k.js +0 -5
- package/dist/chunks/ripgrep-CBUbn6Po.js +0 -1
- package/dist/chunks/sandbox-adapter-Z4Phj31K.js +0 -1
- package/dist/chunks/sandbox-toggle-COZE8Lo4.js +0 -1
- package/dist/chunks/searchExtraTools-CvkRbL2m.js +0 -1
- package/dist/chunks/session-BvA99K4j.js +0 -2
- package/dist/chunks/sessionFileAccessHooks-6XfAf6ke.js +0 -1
- package/dist/chunks/sessionIdCompat-Dgp6PW_1.js +0 -1
- package/dist/chunks/sessionObserver-CRWUBJEY.js +0 -1
- package/dist/chunks/sessionState-CQhbGfmh.js +0 -11
- package/dist/chunks/sessionStorage-DqEuxDlb.js +0 -1
- package/dist/chunks/sessionStoragePortable-x0Yn02-G.js +0 -3
- package/dist/chunks/sessionTracing-BoOZsXU2.js +0 -11
- package/dist/chunks/settings-3xZ0fsvE.js +0 -19
- package/dist/chunks/settings-Crx1cI1u.js +0 -1
- package/dist/chunks/settingsSync-rkWmClKS.js +0 -1
- package/dist/chunks/setup-D8L275fT.js +0 -3
- package/dist/chunks/shellQuote-Ddgr1vif.js +0 -4
- package/dist/chunks/sinks-BXX72cbf.js +0 -1
- package/dist/chunks/sinks-DMp6uEzM.js +0 -1
- package/dist/chunks/skillChangeDetector-CtithJ4a.js +0 -1
- package/dist/chunks/skills-DXMk-498.js +0 -1
- package/dist/chunks/src-D3yIF9I42.js +0 -1
- package/dist/chunks/src-DQOX_xI1.js +0 -1
- package/dist/chunks/src-Dt5IJd3C.js +0 -1
- package/dist/chunks/src-Dvp6-vB7.js +0 -19
- package/dist/chunks/src-PM8NIIu_.js +0 -1
- package/dist/chunks/startupProfiler-CbzxVmbv.js +0 -3
- package/dist/chunks/startupProfiler-uHetQush.js +0 -1
- package/dist/chunks/state-BStOuCh4.js +0 -1
- package/dist/chunks/staticRender-D9AbnQFr.js +0 -1
- package/dist/chunks/stats-Ce15gc3E.js +0 -1
- package/dist/chunks/status-CFrLuGbf.js +0 -2
- package/dist/chunks/status-D5OCkMZG.js +0 -1
- package/dist/chunks/statusNoticeHelpers-CZoOse-_.js +0 -1
- package/dist/chunks/stringUtils-CKD8qDqx.js +0 -4
- package/dist/chunks/subprocessEnv-CNBOhlDV.js +0 -1
- package/dist/chunks/subprocessEnv-DtBCqQIo.js +0 -1
- package/dist/chunks/switcher-AiMcRzoi.js +0 -1
- package/dist/chunks/syncCache-qWJ_VfBo.js +0 -1
- package/dist/chunks/teleport-Bi_1VFIZ.js +0 -1
- package/dist/chunks/terminalSetup-kWdZRKWq.js +0 -32
- package/dist/chunks/theme-CEKOCSLw.js +0 -1
- package/dist/chunks/tmux-CpGd0Aca.js +0 -1
- package/dist/chunks/toolPool-Df5iUqJ-.js +0 -1
- package/dist/chunks/trustedDevice-CB6rNzl-.js +0 -1
- package/dist/chunks/trustedDevice-DXGePUAC.js +0 -1
- package/dist/chunks/types-APu4OCXJ.js +0 -17
- package/dist/chunks/udsClient-U7MEfYj7.js +0 -1
- package/dist/chunks/upstreamproxy-CTOuotLO.js +0 -10
- package/dist/chunks/useExitOnCtrlCDWithKeybindings-Bw0mlTT9.js +0 -1
- package/dist/chunks/useMainLoopModel-CIG2cjS2.js +0 -1
- package/dist/chunks/useManagePlugins-MSHw-qHx.js +0 -1
- package/dist/chunks/useMergedTools-Bb-INJa2.js +0 -1
- package/dist/chunks/useSearchInput-QL_VtdJD.js +0 -1
- package/dist/chunks/useSettingsErrors-Dvi6zLCr.js +0 -1
- package/dist/chunks/userAgent-i-oGzf40.js +0 -1
- package/dist/chunks/util-CLQvtXuD.js +0 -1
- package/dist/chunks/validatePlugin-1mTZ3TJR.js +0 -1
- package/dist/chunks/which-BxQ1hpjp.js +0 -1
- package/dist/chunks/windowsPaths-BdhjMYTm.js +0 -1
- package/dist/chunks/windowsPaths-DtGZ83kH.js +0 -1
- package/dist/chunks/workSecret-CaM2yIJD.js +0 -1
- package/dist/chunks/workerRegistry-BjxoZ12l.js +0 -2
- package/dist/chunks/worktree-DpksgxdF.js +0 -1
- /package/dist/chunks/{src-DL3w8VPk2.js → src-DL3w8VPk.js} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{f as r,u as i}from"./debug-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{f as r,u as i}from"./debug-8DCufdSp.js";import{o as a,s as o}from"./log-DaILwWJa.js";import{release as s}from"os";import{readFile as c,readdir as l}from"fs/promises";async function u(e){let t=new Set;process.env.P4PORT&&t.add(`perforce`);try{let n=e??i().cwd(),r=new Set(await l(n));for(let[e,n]of h)r.has(e)&&t.add(n)}catch{}return[...t]}var d,f,p,m,h,g=e((()=>{n(),r(),a(),d=[`macos`,`wsl`],f=t(()=>{try{if(process.platform===`darwin`)return`macos`;if(process.platform===`win32`)return`windows`;if(process.platform===`linux`){try{let e=i().readFileSync(`/proc/version`,{encoding:`utf8`});if(e.toLowerCase().includes(`microsoft`)||e.toLowerCase().includes(`wsl`))return`wsl`}catch(e){o(e)}return`linux`}return`unknown`}catch(e){return o(e),`unknown`}}),p=t(()=>{if(process.platform===`linux`)try{let e=i().readFileSync(`/proc/version`,{encoding:`utf8`}),t=e.match(/WSL(\d+)/i);return t?.[1]?t[1]:e.toLowerCase().includes(`microsoft`)?`1`:void 0}catch(e){o(e);return}}),m=t(async()=>{if(process.platform!==`linux`)return;let e={linuxKernel:s()};try{let t=await c(`/etc/os-release`,`utf8`);for(let n of t.split(`
|
|
2
2
|
`)){let t=n.match(/^(ID|VERSION_ID)=(.*)$/);if(t?.[1]&&t[2]){let n=t[2].replace(/^"|"$/g,``);t[1]===`ID`?e.linuxDistroId=n:e.linuxDistroVersion=n}}}catch{}return e}),h=[[`.git`,`git`],[`.hg`,`mercurial`],[`.svn`,`svn`],[`.p4config`,`perforce`],[`$tf`,`tfs`],[`.tfvc`,`tfs`],[`.jj`,`jujutsu`],[`.sl`,`sapling`]]}));export{p as a,f as i,u as n,g as o,m as r,d as t};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{l as n,o as r}from"./envUtils-DcaKZlRU.js";import{n as i,t as a}from"./figures-5ThXQEtq.js";import{$a as o,$x as s,Ap as c,Ay as l,Bp as u,Co as d,Cy as f,Do as p,Dp as m,Dy as h,Eo as g,Ey as _,Kv as v,La as y,My as b,No as ee,Oo as x,Op as te,Oy as S,Po as C,Qx as ne,Ra as re,SS as w,Sy as T,To as E,Ty as D,Ua as ie,Ub as O,Wa as ae,Xa as k,Yb as A,Yv as oe,Yx as se,_o as j,ad as ce,ao as le,bo as M,cS as N,co as ue,do as P,eo as de,fS as F,fo as I,ho as fe,id as L,jo as pe,jy as me,ko as he,ky as ge,mS as _e,no as ve,vS as ye,vy as R,wo as be,wy as xe,xS as z,yS as Se,yo as Ce,yy as we,zp as Te}from"./loadAgentsDir-C1LkW7gl.js";import{D as Ee,Gr as De,Gt as B,H as Oe,I as V,P as H,T as ke,Wt as Ae,Xn as je,ai as Me,hn as Ne,j as Pe,k as Fe,n as Ie,ot as Le,r as Re,t as ze,x as Be,y as Ve}from"./src-DL3w8VPk.js";import{t as He}from"./jsx-runtime-Bb4Xn-E0.js";import{H as Ue,L as We,N as Ge,S as Ke,c as qe,i as Je,x as Ye}from"./debug-8DCufdSp.js";import{Jn as Xe,_t as Ze,b as Qe,bt as $e,d as et,h as tt,qn as nt,s as rt}from"./settings-DKN4xSpQ.js";import{m as it,y as at}from"./config-BddEvZZl.js";import{o as ot,s as st}from"./log-DaILwWJa.js";import{l as ct,o as lt}from"./stringUtils-BQm3OfeJ.js";import{n as ut,r as dt}from"./analytics-DJobLaWP.js";import{S as ft,v as pt}from"./startupProfiler-DTs9w9EN.js";import{n as mt,t as ht}from"./TextInput-7uqPhq9T.js";import{n as gt,t as _t}from"./pluginStartupCheck-CfRvCrFg.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-BcfJCDco.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-DIdEydz_.js";import{a as Nt,n as Pt,o as Ft,r as It}from"./pluginFlagging-DQP8tBi2.js";import{i as Lt,n as Rt}from"./MCPConnectionManager-ChN4Ayjk.js";import{n as zt,t as Bt}from"./useExitOnCtrlCDWithKeybindings-CjW3gUOt.js";import{r as Vt,t as Ht}from"./Spinner-DwsJJUtn.js";import{t as Ut}from"./SearchBox-C9xxQzh1.js";import{n as Wt,t as Gt}from"./useSearchInput-C2JuUW3g.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-DLSrQHDc.js";import{i as en,n as tn}from"./pluginAutoupdate-BJaAqwTH.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 le(n,e=>{h(e)});Ce(e,{source:t}),ee();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=Ue(e);st(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)(V,{flexDirection:`column`,children:[(0,U.jsxs)(V,{flexDirection:`column`,paddingX:1,borderStyle:`round`,children:[(0,U.jsx)(V,{marginBottom:1,children:(0,U.jsx)(H,{bold:!0,children:`Add Marketplace`})}),(0,U.jsxs)(V,{flexDirection:`column`,children:[(0,U.jsx)(H,{children:`Enter marketplace source:`}),(0,U.jsx)(H,{dimColor:!0,children:`Examples:`}),(0,U.jsx)(H,{dimColor:!0,children:` · owner/repo (GitHub)`}),(0,U.jsx)(H,{dimColor:!0,children:` · git@github.com:owner/repo.git (SSH)`}),(0,U.jsx)(H,{dimColor:!0,children:` · https://example.com/marketplace.json`}),(0,U.jsx)(H,{dimColor:!0,children:` · ./path/to/marketplace`}),(0,U.jsx)(V,{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)(V,{marginTop:1,children:[(0,U.jsx)(Ht,{}),(0,U.jsx)(H,{children:m||`Adding marketplace to configuration…`})]}),i&&(0,U.jsx)(V,{marginTop:1,children:(0,U.jsx)(H,{color:`error`,children:i})}),o&&(0,U.jsx)(V,{marginTop:1,children:(0,U.jsx)(H,{children:o})})]}),(0,U.jsx)(V,{marginLeft:3,children:(0,U.jsx)(H,{dimColor:!0,italic:!0,children:(0,U.jsxs)(ke,{children:[(0,U.jsx)(Ee,{shortcut:`Enter`,action:`add`}),(0,U.jsx)(L,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]})})})]})}var on,U,sn=e((()=>{on=t(Me(),1),ut(),ce(),ze(),Vt(),mt(),We(),ot(),C(),P(),Ot(),U=He()}));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(Ae(`confirm:no`,o,{context:`Settings`}),B({"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`}),Ne((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(De(p)):p;return(0,dn.jsxs)(Ve,{title:e,subtitle:t,onCancel:o,isCancelActive:!1,children:[(0,dn.jsxs)(V,{flexDirection:`column`,children:[(0,dn.jsxs)(H,{bold:!0,children:[g.title||h,v&&(0,dn.jsx)(H,{color:`error`,children:` *`})]}),g.description&&(0,dn.jsx)(H,{dimColor:!0,children:g.description}),(0,dn.jsxs)(V,{marginTop:1,children:[(0,dn.jsxs)(H,{children:[a.pointerSmall,` `]}),(0,dn.jsx)(H,{children:y}),(0,dn.jsx)(H,{children:`█`})]})]}),(0,dn.jsxs)(V,{flexDirection:`column`,children:[(0,dn.jsxs)(H,{dimColor:!0,children:[`Field `,l+1,` of `,s.length]}),l<s.length-1&&(0,dn.jsx)(H,{dimColor:!0,children:`Tab: Next field · Enter: Save and continue`}),l===s.length-1&&(0,dn.jsx)(H,{dimColor:!0,children:`Enter: Save configuration`})]})]})}var un,dn,fn=e((()=>{i(),un=t(Me(),1),ze(),O(),r(),dn=He()}));async function pn(e){let{enabled:t,disabled:n}=await re();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=T(e);Object.keys(r).length>0&&n.push({key:`top-level`,title:`Configure ${e.name}`,subtitle:`Plugin options`,schema:r,load:()=>xe(t),save:n=>D(t,n,e.manifest.userConfig)});let i=R(e);for(let r of i)n.push({key:`channel:${r.server}`,title:`Configure ${r.displayName}`,subtitle:`Plugin: ${e.name}`,schema:r.configSchema,load:()=>S(t,r.server)??void 0,save:e=>l(t,r.server,e,r.configSchema)});return n}),[i,a]=hn.useState(0),o=hn.useRef(n);if(o.current=n,hn.useEffect(()=>{r.length===0&&o.current(`skipped`)},[r.length]),r.length===0)return null;let s=r[i];function c(e){try{s.save(e)}catch(e){n(`error`,Ge(e));return}let t=i+1;t<r.length?a(t):n(`configured`)}return(0,gn.jsx)(ln,{title:s.title,subtitle:s.subtitle,configSchema:s.schema,initialValues:s.load(),onSave:c,onCancel:()=>n(`skipped`)},s.key)}var hn,gn,_n=e((()=>{hn=t(Me(),1),We(),_(),we(),y(),f(),fn(),gn=He()}));function vn(){let e=x();return(0,yn.jsxs)(V,{marginBottom:1,children:[(0,yn.jsxs)(H,{color:`claude`,children:[a.warning,` `]}),(0,yn.jsxs)(H,{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(),ze(),he(),yn=He()}));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)(V,{marginTop:1,children:(0,wn.jsx)(H,{dimColor:!0,italic:!0,children:(0,wn.jsxs)(ke,{children:[e&&(0,wn.jsx)(L,{action:`plugin:install`,context:`Plugin`,fallback:`i`,description:`install`,bold:!0}),(0,wn.jsx)(L,{action:`plugin:toggle`,context:`Plugin`,fallback:`Space`,description:`toggle`}),(0,wn.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`details`}),(0,wn.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})}var wn,Tn=e((()=>{ce(),ze(),wn=He()}));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(Me(),1),On=5}));function An({error:e,setError:t,result:n,setResult:r,setViewState:i,onInstallComplete:s,targetMarketplace:c,targetPlugin:l}){let[f,m]=(0,W.useState)(`marketplace-list`),[h,_]=(0,W.useState)(null),[v,y]=(0,W.useState)(null),[x,te]=(0,W.useState)([]),[S,C]=(0,W.useState)([]),[ne,re]=(0,W.useState)(!0),[w,T]=(0,W.useState)(null),[D,ie]=(0,W.useState)(0),[O,k]=(0,W.useState)(new Set),[A,oe]=(0,W.useState)(new Set),se=En({totalItems:S.length,selectedIndex:D}),[j,ce]=(0,W.useState)(0),[le,M]=(0,W.useState)(!1),[N,P]=(0,W.useState)(null),[F,fe]=(0,W.useState)(null);Ae(`confirm:no`,jn.useCallback(()=>{f===`plugin-list`?c?i({type:`manage-marketplaces`,targetMarketplace:c}):x.length===1?i({type:`menu`}):(m(`marketplace-list`),_(null),k(new Set)):f===`plugin-details`?(m(`plugin-list`),y(null)):i({type:`menu`})},[f,c,i,x.length]),{context:`Confirmation`}),(0,W.useEffect)(()=>{async function e(){try{let e=await I(),{marketplaces:n,failures:r}=await pe(e),i=[];for(let{name:e,config:t,data:r}of n)if(r){let n=nt(r.plugins,t=>de(d(t.name,e)));i.push({name:e,totalPlugins:r.plugins.length,installedCount:n,source:p(t.source)})}i.sort((e,t)=>e.name===`claude-plugin-directory`?-1:+(t.name===`claude-plugin-directory`)),te(i);let a=g(r,nt(n,e=>e.data!==null));if(a)if(a.type===`warning`)fe(`${a.message}. Showing available marketplaces.`);else throw Error(a.message);if(i.length===1&&!c&&!l){let e=i[0];e&&(_(e.name),m(`plugin-list`))}if(l){let n=null,r=null;for(let[t]of Object.entries(e)){let e=await ue(t);if(e){let i=e.plugins.find(e=>e.name===l);if(i){let e=d(i.name,t);n={entry:i,marketplaceName:t,pluginId:e,isInstalled:o(e)},r=t;break}}}if(n&&r){let e=n.pluginId;o(e)?t(`Plugin '${e}' is already installed globally. Use '/plugin' to manage existing plugins.`):(_(r),y(n),m(`plugin-details`))}else t(`Plugin "${l}" not found in any marketplace`)}else c&&(i.some(e=>e.name===c)?(_(c),m(`plugin-list`)):t(`Marketplace "${c}" not found`))}catch(e){t(e instanceof Error?e.message:`Failed to load marketplaces`)}finally{re(!1)}}e()},[t,c,l]),(0,W.useEffect)(()=>{if(!h)return;let e=!1;async function n(n){re(!0);try{let t=await ue(n);if(e)return;if(!t)throw Error(`Failed to load marketplace: ${n}`);let r=[];for(let e of t.plugins){let t=d(e.name,n);u(t)||r.push({entry:e,marketplaceName:n,pluginId:t,isInstalled:o(t)})}try{let t=await jt();if(e)return;T(t),t?r.sort((e,n)=>{let r=t.get(e.pluginId)??0,i=t.get(n.pluginId)??0;return r===i?e.entry.name.localeCompare(n.entry.name):i-r}):r.sort((e,t)=>e.entry.name.localeCompare(t.entry.name))}catch(t){if(e)return;qe(`Failed to fetch install counts: ${Ge(t)}`),r.sort((e,t)=>e.entry.name.localeCompare(t.entry.name))}C(r),ie(0),k(new Set)}catch(n){if(e)return;t(n instanceof Error?n.message:`Failed to load plugins`)}finally{re(!1)}}return n(h),()=>{e=!0}},[h,t]);let me=async()=>{if(O.size===0)return;let e=S.filter(e=>O.has(e.pluginId));oe(new Set(e.map(e=>e.pluginId)));let n=0,a=0,o=[];for(let t of e){let e=await ae({pluginId:t.pluginId,entry:t.entry,marketplaceName:t.marketplaceName,scope:`user`});e.success?n++:(a++,o.push({name:t.entry.name,reason:e.error}))}oe(new Set),k(new Set),ee(),a===0?r(`✓ Installed ${n} ${ct(n,`plugin`)}. Run /reload-plugins to activate.`):n===0?t(`Failed to install: ${E(o,!0)}`):r(`✓ Installed ${n} of ${n+a} plugins. Failed: ${E(o,!1)}. Run /reload-plugins to activate successfully installed plugins.`),n>0&&s&&await s(),i({type:`menu`})},he=async(e,t=`user`)=>{M(!0),P(null);let n=await ae({pluginId:e.pluginId,entry:e.entry,marketplaceName:e.marketplaceName,scope:t});if(n.success){let t=await pn(e.pluginId);if(t){M(!1),m({type:`plugin-options`,plugin:t,pluginId:e.pluginId});return}r(n.message),s&&await s(),i({type:`menu`})}else M(!1),P(n.error)};(0,W.useEffect)(()=>{e&&r(e)},[e,r]),B({"select:previous":()=>{D>0&&ie(D-1)},"select:next":()=>{D<x.length-1&&ie(D+1)},"select:accept":()=>{let e=x[D];e&&(_(e.name),m(`plugin-list`))}},{context:`Select`,isActive:f===`marketplace-list`}),B({"select:previous":()=>{D>0&&se.handleSelectionChange(D-1,ie)},"select:next":()=>{D<S.length-1&&se.handleSelectionChange(D+1,ie)},"select:accept":()=>{if(D===S.length&&O.size>0)me();else if(D<S.length){let e=S[D];e&&(e.isInstalled?i({type:`manage-plugins`,targetPlugin:e.entry.name,targetMarketplace:e.marketplaceName}):(y(e),m(`plugin-details`),ce(0),P(null)))}}},{context:`Select`,isActive:f===`plugin-list`}),B({"plugin:toggle":()=>{if(D<S.length){let e=S[D];if(e&&!e.isInstalled){let t=new Set(O);t.has(e.pluginId)?t.delete(e.pluginId):t.add(e.pluginId),k(t)}}},"plugin:install":()=>{O.size>0&&me()}},{context:`Plugin`,isActive:f===`plugin-list`});let ge=jn.useMemo(()=>{if(!v)return[];let e=v.entry.homepage;return Sn(e,xn(v))},[v]);if(B({"select:previous":()=>{j>0&&ce(j-1)},"select:next":()=>{j<ge.length-1&&ce(j+1)},"select:accept":()=>{if(!v)return;let e=ge[j]?.action,t=v.entry.homepage,n=xn(v);e===`install-user`?he(v,`user`):e===`install-project`?he(v,`project`):e===`install-local`?he(v,`local`):e===`homepage`&&t?b(t):e===`github`&&n?b(`https://github.com/${n}`):e===`back`&&(m(`plugin-list`),y(null))}},{context:`Select`,isActive:f===`plugin-details`&&!!v}),typeof f==`object`&&f.type===`plugin-options`){let{plugin:e,pluginId:t}=f;function n(e){r(e),s&&s(),i({type:`menu`})}return(0,G.jsx)(mn,{plugin:e,pluginId:t,onDone:(t,r)=>{switch(t){case`configured`:n(`✓ Installed and configured ${e.name}. Run /reload-plugins to apply.`);break;case`skipped`:n(`✓ Installed ${e.name}. Run /reload-plugins to apply.`);break;case`error`:n(`Installed but failed to save config: ${r}`);break}}})}if(ne)return(0,G.jsx)(H,{children:`Loading…`});if(e)return(0,G.jsx)(H,{color:`error`,children:e});if(f===`marketplace-list`)return x.length===0?(0,G.jsxs)(V,{flexDirection:`column`,children:[(0,G.jsx)(V,{marginBottom:1,children:(0,G.jsx)(H,{bold:!0,children:`Select marketplace`})}),(0,G.jsx)(H,{children:`No marketplaces configured.`}),(0,G.jsxs)(H,{dimColor:!0,children:[`Add a marketplace first using `,`'Add marketplace'`,`.`]}),(0,G.jsx)(V,{marginTop:1,paddingLeft:1,children:(0,G.jsx)(H,{dimColor:!0,children:(0,G.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})})})]}):(0,G.jsxs)(V,{flexDirection:`column`,children:[(0,G.jsx)(V,{marginBottom:1,children:(0,G.jsx)(H,{bold:!0,children:`Select marketplace`})}),F&&(0,G.jsx)(V,{marginBottom:1,flexDirection:`column`,children:(0,G.jsxs)(H,{color:`warning`,children:[a.warning,` `,F]})}),x.map((e,t)=>(0,G.jsxs)(V,{flexDirection:`column`,marginBottom:+(t<x.length-1),children:[(0,G.jsx)(V,{children:(0,G.jsxs)(H,{color:D===t?`suggestion`:void 0,children:[D===t?a.pointer:` `,` `,e.name]})}),(0,G.jsx)(V,{marginLeft:2,children:(0,G.jsxs)(H,{dimColor:!0,children:[e.totalPlugins,` `,ct(e.totalPlugins,`plugin`),` available`,e.installedCount>0&&` · ${e.installedCount} already installed`,e.source&&` · ${e.source}`]})})]},e.name)),(0,G.jsx)(V,{marginTop:1,children:(0,G.jsx)(H,{dimColor:!0,italic:!0,children:(0,G.jsxs)(ke,{children:[(0,G.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,G.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]})})})]});if(f===`plugin-details`&&v){let e=v.entry.homepage,t=Sn(e,xn(v));return(0,G.jsxs)(V,{flexDirection:`column`,children:[(0,G.jsx)(V,{marginBottom:1,children:(0,G.jsx)(H,{bold:!0,children:`Plugin Details`})}),(0,G.jsxs)(V,{flexDirection:`column`,marginBottom:1,children:[(0,G.jsx)(H,{bold:!0,children:v.entry.name}),v.entry.version&&(0,G.jsxs)(H,{dimColor:!0,children:[`Version: `,v.entry.version]}),v.entry.description&&(0,G.jsx)(V,{marginTop:1,children:(0,G.jsx)(H,{children:v.entry.description})}),v.entry.author&&(0,G.jsx)(V,{marginTop:1,children:(0,G.jsxs)(H,{dimColor:!0,children:[`By:`,` `,typeof v.entry.author==`string`?v.entry.author:v.entry.author.name]})})]}),(0,G.jsxs)(V,{flexDirection:`column`,marginBottom:1,children:[(0,G.jsx)(H,{bold:!0,children:`Will install:`}),v.entry.commands&&(0,G.jsxs)(H,{dimColor:!0,children:[`· Commands:`,` `,Array.isArray(v.entry.commands)?v.entry.commands.join(`, `):Object.keys(v.entry.commands).join(`, `)]}),v.entry.agents&&(0,G.jsxs)(H,{dimColor:!0,children:[`· Agents:`,` `,Array.isArray(v.entry.agents)?v.entry.agents.join(`, `):Object.keys(v.entry.agents).join(`, `)]}),v.entry.hooks&&(0,G.jsxs)(H,{dimColor:!0,children:[`· Hooks: `,Object.keys(v.entry.hooks).join(`, `)]}),v.entry.mcpServers&&(0,G.jsxs)(H,{dimColor:!0,children:[`· MCP Servers:`,` `,Array.isArray(v.entry.mcpServers)?v.entry.mcpServers.join(`, `):typeof v.entry.mcpServers==`object`?Object.keys(v.entry.mcpServers).join(`, `):`configured`]}),!v.entry.commands&&!v.entry.agents&&!v.entry.hooks&&!v.entry.mcpServers&&(typeof v.entry.source==`object`&&`source`in v.entry.source&&(v.entry.source.source===`github`||v.entry.source.source===`url`||v.entry.source.source===`npm`||v.entry.source.source===`pip`)?(0,G.jsx)(H,{dimColor:!0,children:`· Component summary not available for remote plugin`}):(0,G.jsx)(H,{dimColor:!0,children:`· Components will be discovered at installation`}))]}),(0,G.jsx)(vn,{}),N&&(0,G.jsx)(V,{marginBottom:1,children:(0,G.jsxs)(H,{color:`error`,children:[`Error: `,N]})}),(0,G.jsx)(V,{flexDirection:`column`,children:t.map((e,t)=>(0,G.jsxs)(V,{children:[j===t&&(0,G.jsx)(H,{children:`> `}),j!==t&&(0,G.jsx)(H,{children:` `}),(0,G.jsx)(H,{bold:j===t,children:le&&e.action===`install`?`Installing…`:e.label})]},e.action))}),(0,G.jsx)(V,{marginTop:1,paddingLeft:1,children:(0,G.jsx)(H,{dimColor:!0,children:(0,G.jsxs)(ke,{children:[(0,G.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,G.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}if(S.length===0)return(0,G.jsxs)(V,{flexDirection:`column`,children:[(0,G.jsx)(V,{marginBottom:1,children:(0,G.jsx)(H,{bold:!0,children:`Install plugins`})}),(0,G.jsx)(H,{dimColor:!0,children:`No new plugins available to install.`}),(0,G.jsx)(H,{dimColor:!0,children:`All plugins from this marketplace are already installed.`}),(0,G.jsx)(V,{marginLeft:3,children:(0,G.jsx)(H,{dimColor:!0,italic:!0,children:(0,G.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})})})]});let _e=se.getVisibleItems(S);return(0,G.jsxs)(V,{flexDirection:`column`,children:[(0,G.jsx)(V,{marginBottom:1,children:(0,G.jsx)(H,{bold:!0,children:`Install Plugins`})}),se.scrollPosition.canScrollUp&&(0,G.jsx)(V,{children:(0,G.jsxs)(H,{dimColor:!0,children:[` `,a.arrowUp,` more above`]})}),_e.map((t,n)=>{let r=se.toActualIndex(n),i=D===r,o=O.has(t.pluginId),s=A.has(t.pluginId);return(0,G.jsxs)(V,{flexDirection:`column`,marginBottom:n===_e.length-1&&!e?0:1,children:[(0,G.jsxs)(V,{children:[(0,G.jsxs)(H,{color:i?`suggestion`:void 0,children:[i?a.pointer:` `,` `]}),(0,G.jsxs)(H,{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)(H,{dimColor:!0,children:[` [`,t.entry.category,`]`]}),t.entry.tags?.includes(`community-managed`)&&(0,G.jsx)(H,{dimColor:!0,children:` [Community Managed]`}),t.isInstalled&&(0,G.jsx)(H,{dimColor:!0,children:` (installed)`}),w&&h===`claude-plugins-official`&&(0,G.jsxs)(H,{dimColor:!0,children:[` · `,At(w.get(t.pluginId)??0),` installs`]})]})]}),t.entry.description&&(0,G.jsxs)(V,{marginLeft:4,children:[(0,G.jsx)(H,{dimColor:!0,children:ft(t.entry.description,60)}),t.entry.version&&(0,G.jsxs)(H,{dimColor:!0,children:[` · v`,t.entry.version]})]})]},t.pluginId)}),se.scrollPosition.canScrollDown&&(0,G.jsx)(V,{children:(0,G.jsxs)(H,{dimColor:!0,children:[` `,a.arrowDown,` more below`]})}),e&&(0,G.jsx)(V,{marginTop:1,children:(0,G.jsxs)(H,{color:`error`,children:[a.cross,` `,e]})}),(0,G.jsx)(Cn,{hasSelection:O.size>0})]})}var jn,W,G,Mn=e((()=>{i(),jn=t(Me(),1),W=t(Me(),1),ce(),ze(),O(),Xe(),me(),Je(),We(),C(),Dt(),k(),he(),P(),N(),ie(),Te(),lt(),pt(),_n(),bn(),Tn(),kn(),G=He()}));function Nn({error:e,setError:t,result:n,setResult:r,setViewState:i,onInstallComplete:s,onSearchModeChange:c,targetPlugin:l}){let[f,p]=(0,K.useState)(`plugin-list`),[m,h]=(0,K.useState)(null),[_,v]=(0,K.useState)([]),[y,x]=(0,K.useState)(!0),[te,S]=(0,K.useState)(null),[C,ne]=(0,K.useState)(!1),re=(0,K.useCallback)(e=>{ne(e),c?.(e)},[c]),{query:w,setQuery:T,cursorOffset:D}=Wt({isActive:f===`plugin-list`&&C&&!y,onExit:()=>{re(!1)}}),ie=je(),{columns:O}=Le(),k=(0,K.useMemo)(()=>{if(!w)return _;let e=w.toLowerCase();return _.filter(t=>t.entry.name.toLowerCase().includes(e)||t.entry.description?.toLowerCase().includes(e)||t.marketplaceName.toLowerCase().includes(e))},[_,w]),[A,oe]=(0,K.useState)(0),[se,j]=(0,K.useState)(new Set),[ce,le]=(0,K.useState)(new Set),M=En({totalItems:k.length,selectedIndex:A});(0,K.useEffect)(()=>{oe(0)},[w]);let[N,ue]=(0,K.useState)(0),[P,de]=(0,K.useState)(!1),[F,fe]=(0,K.useState)(null),[me,he]=(0,K.useState)(null),[ge,_e]=(0,K.useState)(null);(0,K.useEffect)(()=>{async function e(){try{let e=await I(),{marketplaces:n,failures:r}=await pe(e),i=[];for(let{name:e,data:t}of n)if(t)for(let n of t.plugins){let t=d(n.name,e);i.push({entry:n,marketplaceName:e,pluginId:t,isInstalled:o(t)})}let a=i.filter(e=>!e.isInstalled&&!u(e.pluginId));try{let e=await jt();S(e),e?a.sort((t,n)=>{let r=e.get(t.pluginId)??0,i=e.get(n.pluginId)??0;return r===i?t.entry.name.localeCompare(n.entry.name):i-r}):a.sort((e,t)=>e.entry.name.localeCompare(t.entry.name))}catch(e){qe(`Failed to fetch install counts: ${Ge(e)}`),a.sort((e,t)=>e.entry.name.localeCompare(t.entry.name))}v(a);let s=Object.keys(e).length;if(a.length===0){let e=await be({configuredMarketplaceCount:s,failedMarketplaceCount:r.length});_e(e)}let c=g(r,nt(n,e=>e.data!==null));if(c)if(c.type===`warning`)he(`${c.message}. Showing available plugins.`);else throw Error(c.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.`):(h(e),p(`plugin-details`)):t(`Plugin "${l}" not found in any marketplace`)}}catch(e){t(e instanceof Error?e.message:`Failed to load plugins`)}finally{x(!1)}}e()},[t,l]);let ve=async()=>{if(se.size===0)return;let e=_.filter(e=>se.has(e.pluginId));le(new Set(e.map(e=>e.pluginId)));let n=0,a=0,o=[];for(let t of e){let e=await ae({pluginId:t.pluginId,entry:t.entry,marketplaceName:t.marketplaceName,scope:`user`});e.success?n++:(a++,o.push({name:t.entry.name,reason:e.error}))}le(new Set),j(new Set),ee(),a===0?r(`✓ Installed ${n} ${ct(n,`plugin`)}. Run /reload-plugins to activate.`):n===0?t(`Failed to install: ${E(o,!0)}`):r(`✓ Installed ${n} of ${n+a} plugins. Failed: ${E(o,!1)}. Run /reload-plugins to activate successfully installed plugins.`),n>0&&s&&await s(),i({type:`menu`})},ye=async(e,t=`user`)=>{de(!0),fe(null);let n=await ae({pluginId:e.pluginId,entry:e.entry,marketplaceName:e.marketplaceName,scope:t});if(n.success){let t=await pn(e.pluginId);if(t){de(!1),p({type:`plugin-options`,plugin:t,pluginId:e.pluginId});return}r(n.message),s&&await s(),i({type:`menu`})}else de(!1),fe(n.error)};(0,K.useEffect)(()=>{e&&r(e)},[e,r]),Ae(`confirm:no`,()=>{p(`plugin-list`),h(null)},{context:`Confirmation`,isActive:f===`plugin-details`}),Ae(`confirm:no`,()=>{i({type:`menu`})},{context:`Confirmation`,isActive:f===`plugin-list`&&!C}),Ne((e,t)=>{let n=!t.ctrl&&!t.meta;C||(e===`/`&&n?(re(!0),T(``)):n&&e.length>0&&!/^\s+$/.test(e)&&e!==`j`&&e!==`k`&&e!==`i`&&(re(!0),T(e)))},{isActive:f===`plugin-list`&&!y}),B({"select:previous":()=>{A===0?re(!0):M.handleSelectionChange(A-1,oe)},"select:next":()=>{A<k.length-1&&M.handleSelectionChange(A+1,oe)},"select:accept":()=>{if(A===k.length&&se.size>0)ve();else if(A<k.length){let e=k[A];e&&(e.isInstalled?i({type:`manage-plugins`,targetPlugin:e.entry.name,targetMarketplace:e.marketplaceName}):(h(e),p(`plugin-details`),ue(0),fe(null)))}}},{context:`Select`,isActive:f===`plugin-list`&&!C}),B({"plugin:toggle":()=>{if(A<k.length){let e=k[A];if(e&&!e.isInstalled){let t=new Set(se);t.has(e.pluginId)?t.delete(e.pluginId):t.add(e.pluginId),j(t)}}},"plugin:install":()=>{se.size>0&&ve()}},{context:`Plugin`,isActive:f===`plugin-list`&&!C});let R=In.useMemo(()=>{if(!m)return[];let e=m.entry.homepage;return Sn(e,xn(m))},[m]);if(B({"select:previous":()=>{N>0&&ue(N-1)},"select:next":()=>{N<R.length-1&&ue(N+1)},"select:accept":()=>{if(!m)return;let e=R[N]?.action,t=m.entry.homepage,n=xn(m);e===`install-user`?ye(m,`user`):e===`install-project`?ye(m,`project`):e===`install-local`?ye(m,`local`):e===`homepage`&&t?b(t):e===`github`&&n?b(`https://github.com/${n}`):e===`back`&&(p(`plugin-list`),h(null))}},{context:`Select`,isActive:f===`plugin-details`&&!!m}),typeof f==`object`&&f.type===`plugin-options`){let{plugin:e,pluginId:t}=f;function n(e){r(e),s&&s(),i({type:`menu`})}return(0,q.jsx)(mn,{plugin:e,pluginId:t,onDone:(t,r)=>{switch(t){case`configured`:n(`✓ Installed and configured ${e.name}. Run /reload-plugins to apply.`);break;case`skipped`:n(`✓ Installed ${e.name}. Run /reload-plugins to apply.`);break;case`error`:n(`Installed but failed to save config: ${r}`);break}}})}if(y)return(0,q.jsx)(H,{children:`Loading…`});if(e)return(0,q.jsx)(H,{color:`error`,children:e});if(f===`plugin-details`&&m){let e=m.entry.homepage,t=Sn(e,xn(m));return(0,q.jsxs)(V,{flexDirection:`column`,children:[(0,q.jsx)(V,{marginBottom:1,children:(0,q.jsx)(H,{bold:!0,children:`Plugin details`})}),(0,q.jsxs)(V,{flexDirection:`column`,marginBottom:1,children:[(0,q.jsx)(H,{bold:!0,children:m.entry.name}),(0,q.jsxs)(H,{dimColor:!0,children:[`from `,m.marketplaceName]}),m.entry.version&&(0,q.jsxs)(H,{dimColor:!0,children:[`Version: `,m.entry.version]}),m.entry.description&&(0,q.jsx)(V,{marginTop:1,children:(0,q.jsx)(H,{children:m.entry.description})}),m.entry.author&&(0,q.jsx)(V,{marginTop:1,children:(0,q.jsxs)(H,{dimColor:!0,children:[`By:`,` `,typeof m.entry.author==`string`?m.entry.author:m.entry.author.name]})})]}),(0,q.jsx)(vn,{}),F&&(0,q.jsx)(V,{marginBottom:1,children:(0,q.jsxs)(H,{color:`error`,children:[`Error: `,F]})}),(0,q.jsx)(V,{flexDirection:`column`,children:t.map((e,t)=>(0,q.jsxs)(V,{children:[N===t&&(0,q.jsx)(H,{children:`> `}),N!==t&&(0,q.jsx)(H,{children:` `}),(0,q.jsx)(H,{bold:N===t,children:P&&e.action.startsWith(`install-`)?`Installing…`:e.label})]},e.action))}),(0,q.jsx)(V,{marginTop:1,children:(0,q.jsx)(H,{dimColor:!0,children:(0,q.jsxs)(ke,{children:[(0,q.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,q.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}if(_.length===0)return(0,q.jsxs)(V,{flexDirection:`column`,children:[(0,q.jsx)(V,{marginBottom:1,children:(0,q.jsx)(H,{bold:!0,children:`Discover plugins`})}),(0,q.jsx)(Fn,{reason:ge}),(0,q.jsx)(V,{marginTop:1,children:(0,q.jsx)(H,{dimColor:!0,italic:!0,children:`Esc to go back`})})]});let xe=M.getVisibleItems(k);return(0,q.jsxs)(V,{flexDirection:`column`,children:[(0,q.jsxs)(V,{children:[(0,q.jsx)(H,{bold:!0,children:`Discover plugins`}),M.needsPagination&&(0,q.jsxs)(H,{dimColor:!0,children:[` `,`(`,M.scrollPosition.current,`/`,M.scrollPosition.total,`)`]})]}),(0,q.jsx)(V,{marginBottom:1,children:(0,q.jsx)(Fe,{query:w,isFocused:C,isTerminalFocused:ie,width:O-4,cursorOffset:D})}),me&&(0,q.jsx)(V,{marginBottom:1,children:(0,q.jsxs)(H,{color:`warning`,children:[a.warning,` `,me]})}),k.length===0&&w&&(0,q.jsx)(V,{marginBottom:1,children:(0,q.jsxs)(H,{dimColor:!0,children:[`No plugins match "`,w,`"`]})}),M.scrollPosition.canScrollUp&&(0,q.jsx)(V,{children:(0,q.jsxs)(H,{dimColor:!0,children:[` `,a.arrowUp,` more above`]})}),xe.map((t,n)=>{let r=M.toActualIndex(n),i=A===r,o=se.has(t.pluginId),s=ce.has(t.pluginId);return(0,q.jsxs)(V,{flexDirection:`column`,marginBottom:n===xe.length-1&&!e?0:1,children:[(0,q.jsxs)(V,{children:[(0,q.jsxs)(H,{color:i&&!C?`suggestion`:void 0,children:[i&&!C?a.pointer:` `,` `]}),(0,q.jsxs)(H,{children:[s?a.ellipsis:o?a.radioOn:a.radioOff,` `,t.entry.name,(0,q.jsxs)(H,{dimColor:!0,children:[` · `,t.marketplaceName]}),t.entry.tags?.includes(`community-managed`)&&(0,q.jsx)(H,{dimColor:!0,children:` [Community Managed]`}),te&&t.marketplaceName===`claude-plugins-official`&&(0,q.jsxs)(H,{dimColor:!0,children:[` · `,At(te.get(t.pluginId)??0),` installs`]})]})]}),t.entry.description&&(0,q.jsx)(V,{marginLeft:4,children:(0,q.jsx)(H,{dimColor:!0,children:ft(t.entry.description,60)})})]},`${M.startIndex}-${t.pluginId}`)}),M.scrollPosition.canScrollDown&&(0,q.jsx)(V,{children:(0,q.jsxs)(H,{dimColor:!0,children:[` `,a.arrowDown,` more below`]})}),e&&(0,q.jsx)(V,{marginTop:1,children:(0,q.jsxs)(H,{color:`error`,children:[a.cross,` `,e]})}),(0,q.jsx)(Pn,{hasSelection:se.size>0,canToggle:A<k.length&&!k[A]?.isInstalled})]})}function Pn({hasSelection:e,canToggle:t}){return(0,q.jsx)(V,{marginTop:1,children:(0,q.jsx)(H,{dimColor:!0,italic:!0,children:(0,q.jsxs)(ke,{children:[e&&(0,q.jsx)(L,{action:`plugin:install`,context:`Plugin`,fallback:`i`,description:`install`,bold:!0}),(0,q.jsx)(H,{children:`type to search`}),t&&(0,q.jsx)(L,{action:`plugin:toggle`,context:`Plugin`,fallback:`Space`,description:`toggle`}),(0,q.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`details`}),(0,q.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})}function Fn({reason:e}){switch(e){case`git-not-installed`:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(H,{dimColor:!0,children:`Git is required to install marketplaces.`}),(0,q.jsx)(H,{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)(H,{dimColor:!0,children:`Your organization policy does not allow any external marketplaces.`}),(0,q.jsx)(H,{dimColor:!0,children:`Contact your administrator.`})]});case`policy-restricts-sources`:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(H,{dimColor:!0,children:`Your organization restricts which marketplaces can be added.`}),(0,q.jsx)(H,{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)(H,{dimColor:!0,children:`Failed to load marketplace data.`}),(0,q.jsx)(H,{dimColor:!0,children:`Check your network connection.`})]});case`all-plugins-installed`:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(H,{dimColor:!0,children:`All available plugins are already installed.`}),(0,q.jsx)(H,{dimColor:!0,children:`Check for new plugins later or add more marketplaces.`})]});default:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(H,{dimColor:!0,children:`No plugins available.`}),(0,q.jsx)(H,{dimColor:!0,children:`Add a marketplace first using the Marketplaces tab.`})]})}}var In,K,q,Ln=e((()=>{i(),In=t(Me(),1),K=t(Me(),1),ce(),Ut(),ze(),Gt(),A(),O(),Xe(),me(),Je(),We(),C(),Dt(),k(),he(),P(),N(),ie(),Te(),lt(),pt(),_n(),bn(),Tn(),kn(),q=He()}));function Rn({setViewState:e,error:t,setError:n,setResult:r,exitState:i,onManageComplete:o,targetMarketplace:s,action:c}){let[l,u]=(0,Bn.useState)([]),[f,m]=(0,Bn.useState)(!0),[h,_]=(0,Bn.useState)(0),[v,y]=(0,Bn.useState)(!1),[b,x]=(0,Bn.useState)(null),[te,S]=(0,Bn.useState)(null),[C,ne]=(0,Bn.useState)(null),[w,T]=(0,Bn.useState)(`list`),[E,D]=(0,Bn.useState)(null),[ie,O]=(0,Bn.useState)(0),ae=(0,Bn.useRef)(!1);(0,Bn.useEffect)(()=>{async function e(){try{let e=await I(),{enabled:r,disabled:i}=await re(),a=[...r,...i],{marketplaces:o,failures:l}=await pe(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:p(t.source),lastUpdated:t.lastUpdated,pluginCount:n?.plugins.length,installedPlugins:r,pendingUpdate:!1,pendingRemove:!1,autoUpdate:$e(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=g(l,nt(o,e=>e.data!==null));if(f)if(f.type===`warning`)x(f.message);else throw Error(f.message);if(s&&!ae.current&&!t){ae.current=!0;let e=d.findIndex(e=>e.name===s);if(e>=0){let t=d[e];if(c){_(e+1);let t=[...d];c===`update`?t[e].pendingUpdate=!0:c===`remove`&&(t[e].pendingRemove=!0),u(t),setTimeout(oe,100,t)}else t&&(_(e+1),D(t),T(`details`))}else n&&n(`Marketplace not found: ${s}`)}}catch(e){n&&n(e instanceof Error?e.message:`Failed to load marketplaces`),x(e instanceof Error?e.message:`Failed to load marketplaces`)}finally{m(!1)}}e()},[s,c,t]);let k=()=>l.some(e=>e.pendingUpdate||e.pendingRemove),A=()=>({updateCount:nt(l,e=>e.pendingUpdate),removeCount:nt(l,e=>e.pendingRemove)}),oe=async t=>{let i=t||l,s=w===`details`;y(!0),x(null),S(null),ne(null);try{let t=rt(`userSettings`),n=0,c=0,l=new Set;for(let e of i){if(e.pendingRemove){if(e.installedPlugins&&e.installedPlugins.length>0){let n={...t?.enabledPlugins};for(let t of e.installedPlugins){let r=d(t.name,e.name);n[r]=!1}Qe(`userSettings`,{enabledPlugins:n})}await j(e.name),c++,dt(`tengu_marketplace_removed`,{marketplace_name:e.name,plugins_uninstalled:e.installedPlugins?.length||0});continue}e.pendingUpdate&&(await fe(e.name,e=>{ne(e)}),n++,l.add(e.name.toLowerCase()),dt(`tengu_marketplace_updated`,{marketplace_name:e.name}))}let f=0;l.size>0&&(f=(await en(l)).length),ee(),o&&await o();let m=await I(),{enabled:h,disabled:g}=await re(),_=[...h,...g],{marketplaces:v}=await pe(m),y=[];for(let{name:e,config:t,data:n}of v){let r=_.filter(t=>t.source.endsWith(`@${e}`));y.push({name:e,source:p(t.source),lastUpdated:t.lastUpdated,pluginCount:n?.plugins.length,installedPlugins:r,pendingUpdate:!1,pendingRemove:!1,autoUpdate:$e(e,t)})}if(y.sort((e,t)=>e.name===`claude-plugin-directory`?-1:t.name===`claude-plugin-directory`?1:e.name.localeCompare(t.name)),u(y),s&&E){let e=y.find(e=>e.name===E.name);e&&D(e)}let b=[];if(n>0){let e=f>0?` (${f} ${ct(f,`plugin`)} bumped)`:``;b.push(`Updated ${n} ${ct(n,`marketplace`)}${e}`)}if(c>0&&b.push(`Removed ${c} ${ct(c,`marketplace`)}`),b.length>0){let t=`${a.tick} ${b.join(`, `)}`;s?S(t):(r(t),setTimeout(e,2e3,{type:`menu`}))}else s||e({type:`menu`})}catch(e){let t=Ge(e);x(t),n&&n(t)}finally{y(!1),ne(null)}},se=async()=>{if(!E)return;let e=l.map(e=>e.name===E.name?{...e,pendingRemove:!0}:e);u(e),await oe(e)},ce=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 at()||t.push({label:e.autoUpdate?`Disable auto-update`:`Enable auto-update`,value:`toggle-auto-update`}),t.push({label:`Remove marketplace`,value:`remove`}),t},le=async e=>{let t=!e.autoUpdate;try{await M(e.name,t),u(n=>n.map(n=>n.name===e.name?{...n,autoUpdate:t}:n)),D(e=>e&&{...e,autoUpdate:t})}catch(e){x(e instanceof Error?e.message:`Failed to update setting`)}};if(Ae(`confirm:no`,()=>{T(`list`),O(0)},{context:`Confirmation`,isActive:!v&&(w===`details`||w===`confirm-remove`)}),Ae(`confirm:no`,()=>{u(e=>e.map(e=>({...e,pendingUpdate:!1,pendingRemove:!1}))),_(0)},{context:`Confirmation`,isActive:!v&&w===`list`&&k()}),Ae(`confirm:no`,()=>{e({type:`menu`})},{context:`Confirmation`,isActive:!v&&w===`list`&&!k()}),B({"select:previous":()=>_(e=>Math.max(0,e-1)),"select:next":()=>{let e=l.length+1;_(t=>Math.min(e-1,t+1))},"select:accept":()=>{let t=h-1;if(h===0)e({type:`add-marketplace`});else if(k())oe();else{let e=l[t];e&&(D(e),T(`details`),O(0))}}},{context:`Select`,isActive:!v&&w===`list`}),Ne(e=>{let t=h-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&&(D(e),T(`confirm-remove`))}},{isActive:!v&&w===`list`}),B({"select:previous":()=>O(e=>Math.max(0,e-1)),"select:next":()=>{let e=ce(E);O(t=>Math.min(e.length-1,t+1))},"select:accept":()=>{if(!E)return;let t=ce(E)[ie];if(t?.value===`browse`)e({type:`browse-marketplace`,targetMarketplace:E.name});else if(t?.value===`update`){let e=l.map(e=>e.name===E.name?{...e,pendingUpdate:!0}:e);u(e),oe(e)}else t?.value===`toggle-auto-update`?le(E):t?.value===`remove`&&T(`confirm-remove`)}},{context:`Select`,isActive:!v&&w===`details`}),Ne(e=>{e===`y`||e===`Y`?se():(e===`n`||e===`N`)&&(T(`list`),D(null))},{isActive:!v&&w===`confirm-remove`}),f)return(0,J.jsx)(H,{children:`Loading marketplaces…`});if(l.length===0)return(0,J.jsxs)(V,{flexDirection:`column`,children:[(0,J.jsx)(V,{marginBottom:1,children:(0,J.jsx)(H,{bold:!0,children:`Manage marketplaces`})}),(0,J.jsxs)(V,{flexDirection:`row`,gap:1,children:[(0,J.jsxs)(H,{color:`suggestion`,children:[a.pointer,` +`]}),(0,J.jsx)(H,{bold:!0,color:`suggestion`,children:`Add Marketplace`})]}),(0,J.jsx)(V,{marginLeft:3,children:(0,J.jsx)(H,{dimColor:!0,italic:!0,children:i.pending?(0,J.jsxs)(J.Fragment,{children:[`Press `,i.keyName,` again to go back`]}):(0,J.jsxs)(ke,{children:[(0,J.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,J.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]})})})]});if(w===`confirm-remove`&&E){let e=E.installedPlugins?.length||0;return(0,J.jsxs)(V,{flexDirection:`column`,children:[(0,J.jsxs)(H,{bold:!0,color:`warning`,children:[`Remove marketplace `,(0,J.jsx)(H,{italic:!0,children:E.name}),`?`]}),(0,J.jsxs)(V,{flexDirection:`column`,children:[e>0&&(0,J.jsx)(V,{marginTop:1,children:(0,J.jsxs)(H,{color:`warning`,children:[`This will also uninstall `,e,` `,ct(e,`plugin`),` from this marketplace:`]})}),E.installedPlugins&&E.installedPlugins.length>0&&(0,J.jsx)(V,{flexDirection:`column`,marginTop:1,marginLeft:2,children:E.installedPlugins.map(e=>(0,J.jsxs)(H,{dimColor:!0,children:[`• `,e.name]},e.name))}),(0,J.jsx)(V,{marginTop:1,children:(0,J.jsxs)(H,{children:[`Press `,(0,J.jsx)(H,{bold:!0,children:`y`}),` to confirm or `,(0,J.jsx)(H,{bold:!0,children:`n`}),` to cancel`]})})]})]})}if(w===`details`&&E){let e=E.pendingUpdate||v,t=ce(E);return(0,J.jsxs)(V,{flexDirection:`column`,children:[(0,J.jsx)(H,{bold:!0,children:E.name}),(0,J.jsx)(H,{dimColor:!0,children:E.source}),(0,J.jsx)(V,{marginTop:1,children:(0,J.jsxs)(H,{children:[E.pluginCount||0,` available `,ct(E.pluginCount||0,`plugin`)]})}),E.installedPlugins&&E.installedPlugins.length>0&&(0,J.jsxs)(V,{flexDirection:`column`,marginTop:1,children:[(0,J.jsxs)(H,{bold:!0,children:[`Installed plugins (`,E.installedPlugins.length,`):`]}),(0,J.jsx)(V,{flexDirection:`column`,marginLeft:1,children:E.installedPlugins.map(e=>(0,J.jsxs)(V,{flexDirection:`row`,gap:1,children:[(0,J.jsx)(H,{children:a.bullet}),(0,J.jsxs)(V,{flexDirection:`column`,children:[(0,J.jsx)(H,{children:e.name}),(0,J.jsx)(H,{dimColor:!0,children:e.manifest.description})]})]},e.name))})]}),e&&(0,J.jsxs)(V,{marginTop:1,flexDirection:`column`,children:[(0,J.jsx)(H,{color:`claude`,children:`Updating marketplace…`}),C&&(0,J.jsx)(H,{dimColor:!0,children:C})]}),!e&&te&&(0,J.jsx)(V,{marginTop:1,children:(0,J.jsx)(H,{color:`claude`,children:te})}),!e&&b&&(0,J.jsx)(V,{marginTop:1,children:(0,J.jsx)(H,{color:`error`,children:b})}),!e&&(0,J.jsx)(V,{flexDirection:`column`,marginTop:1,children:t.map((e,t)=>{if(!e)return null;let n=t===ie;return(0,J.jsxs)(V,{children:[(0,J.jsxs)(H,{color:n?`suggestion`:void 0,children:[n?a.pointer:` `,` `,e.label]}),e.secondaryLabel&&(0,J.jsxs)(H,{dimColor:!0,children:[` `,e.secondaryLabel]})]},e.value)})}),!e&&!at()&&E.autoUpdate&&(0,J.jsx)(V,{marginTop:1,children:(0,J.jsx)(H,{dimColor:!0,children:`Auto-update enabled. Work Mate will automatically update this marketplace and its installed plugins.`})}),(0,J.jsx)(V,{marginLeft:3,children:(0,J.jsx)(H,{dimColor:!0,italic:!0,children:e?(0,J.jsx)(J.Fragment,{children:`Please wait…`}):(0,J.jsxs)(ke,{children:[(0,J.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,J.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]})})})]})}let{updateCount:N,removeCount:ue}=A();return(0,J.jsxs)(V,{flexDirection:`column`,children:[(0,J.jsx)(V,{marginBottom:1,children:(0,J.jsx)(H,{bold:!0,children:`Manage marketplaces`})}),(0,J.jsxs)(V,{flexDirection:`row`,gap:1,marginBottom:1,children:[(0,J.jsxs)(H,{color:h===0?`suggestion`:void 0,children:[h===0?a.pointer:` `,` +`]}),(0,J.jsx)(H,{bold:!0,color:h===0?`suggestion`:void 0,children:`Add Marketplace`})]}),(0,J.jsx)(V,{flexDirection:`column`,children:l.map((e,t)=>{let n=t+1===h,r=[];return e.pendingUpdate&&r.push(`UPDATE`),e.pendingRemove&&r.push(`REMOVE`),(0,J.jsxs)(V,{flexDirection:`row`,gap:1,marginBottom:1,children:[(0,J.jsxs)(H,{color:n?`suggestion`:void 0,children:[n?a.pointer:` `,` `,e.pendingRemove?a.cross:a.bullet]}),(0,J.jsxs)(V,{flexDirection:`column`,flexGrow:1,children:[(0,J.jsxs)(V,{flexDirection:`row`,gap:1,children:[(0,J.jsxs)(H,{bold:!0,strikethrough:e.pendingRemove,dimColor:e.pendingRemove,children:[e.name===`claude-plugins-official`&&(0,J.jsx)(H,{color:`claude`,children:`✻ `}),e.name,e.name===`claude-plugins-official`&&(0,J.jsx)(H,{color:`claude`,children:` ✻`})]}),r.length>0&&(0,J.jsxs)(H,{color:`warning`,children:[`[`,r.join(`, `),`]`]})]}),(0,J.jsx)(H,{dimColor:!0,children:e.source}),(0,J.jsxs)(H,{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)})}),k()&&(0,J.jsxs)(V,{marginTop:1,flexDirection:`column`,children:[(0,J.jsxs)(H,{children:[(0,J.jsx)(H,{bold:!0,children:`Pending changes:`}),` `,(0,J.jsx)(H,{dimColor:!0,children:`Enter to apply`})]}),N>0&&(0,J.jsxs)(H,{children:[`• Update `,N,` `,ct(N,`marketplace`)]}),ue>0&&(0,J.jsxs)(H,{color:`warning`,children:[`• Remove `,ue,` `,ct(ue,`marketplace`)]})]}),v&&(0,J.jsx)(V,{marginTop:1,children:(0,J.jsx)(H,{color:`claude`,children:`Processing changes…`})}),b&&(0,J.jsx)(V,{marginTop:1,children:(0,J.jsx)(H,{color:`error`,children:b})}),(0,J.jsx)(zn,{exitState:i,hasPendingActions:k()})]})}function zn({exitState:e,hasPendingActions:t}){return e.pending?(0,J.jsx)(V,{marginTop:1,children:(0,J.jsxs)(H,{dimColor:!0,italic:!0,children:[`Press `,e.keyName,` again to go back`]})}):(0,J.jsx)(V,{marginTop:1,children:(0,J.jsx)(H,{dimColor:!0,italic:!0,children:(0,J.jsxs)(ke,{children:[t&&(0,J.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`apply changes`}),!t&&(0,J.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),!t&&(0,J.jsx)(Ee,{shortcut:`u`,action:`update`}),!t&&(0,J.jsx)(Ee,{shortcut:`r`,action:`remove`}),(0,J.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:t?`cancel`:`go back`})]})})})}var Bn,J,Vn=e((()=>{i(),Bn=t(Me(),1),ut(),ce(),ze(),O(),Xe(),it(),We(),C(),he(),P(),tn(),y(),Ze(),tt(),lt(),J=He()}));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 z(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((()=>{w()}));function Gn({item:e,isSelected:t}){let[n]=Oe();if(e.type===`plugin`){let r,i;return e.pendingToggle?(r=Pe(`suggestion`,n)(a.arrowRight),i=e.pendingToggle===`will-enable`?`will enable`:`will disable`):e.errorCount>0?(r=Pe(`error`,n)(a.cross),i=`${e.errorCount} ${ct(e.errorCount,`error`)}`):e.isEnabled?(r=Pe(`success`,n)(a.tick),i=`enabled`):(r=Pe(`inactive`,n)(a.radioOff),i=`disabled`),(0,Y.jsxs)(V,{children:[(0,Y.jsx)(H,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(H,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(H,{dimColor:!t,children:[` `,(0,Y.jsx)(H,{backgroundColor:`userMessageBackground`,children:`Plugin`})]}),(0,Y.jsxs)(H,{dimColor:!0,children:[` · `,e.marketplace]}),(0,Y.jsxs)(H,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(H,{dimColor:!t,children:i})]})}if(e.type===`flagged-plugin`){let r=Pe(`warning`,n)(a.warning);return(0,Y.jsxs)(V,{children:[(0,Y.jsx)(H,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(H,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(H,{dimColor:!t,children:[` `,(0,Y.jsx)(H,{backgroundColor:`userMessageBackground`,children:`Plugin`})]}),(0,Y.jsxs)(H,{dimColor:!0,children:[` · `,e.marketplace]}),(0,Y.jsxs)(H,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(H,{dimColor:!t,children:`removed`})]})}if(e.type===`failed-plugin`){let r=Pe(`error`,n)(a.cross),i=`failed to load · ${e.errorCount} ${ct(e.errorCount,`error`)}`;return(0,Y.jsxs)(V,{children:[(0,Y.jsx)(H,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(H,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(H,{dimColor:!t,children:[` `,(0,Y.jsx)(H,{backgroundColor:`userMessageBackground`,children:`Plugin`})]}),(0,Y.jsxs)(H,{dimColor:!0,children:[` · `,e.marketplace]}),(0,Y.jsxs)(H,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(H,{dimColor:!t,children:i})]})}let r,i;return e.status===`connected`?(r=Pe(`success`,n)(a.tick),i=`connected`):e.status===`disabled`?(r=Pe(`inactive`,n)(a.radioOff),i=`disabled`):e.status===`pending`?(r=Pe(`inactive`,n)(a.radioOff),i=`connecting…`):e.status===`needs-auth`?(r=Pe(`warning`,n)(a.triangleUpOutline),i=`Enter to auth`):(r=Pe(`error`,n)(a.cross),i=`failed`),e.indented?(0,Y.jsxs)(V,{children:[(0,Y.jsx)(H,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(H,{dimColor:!t,children:`└ `}),(0,Y.jsx)(H,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(H,{dimColor:!t,children:[` `,(0,Y.jsx)(H,{backgroundColor:`userMessageBackground`,children:`MCP`})]}),(0,Y.jsxs)(H,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(H,{dimColor:!t,children:i})]}):(0,Y.jsxs)(V,{children:[(0,Y.jsx)(H,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(H,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(H,{dimColor:!t,children:[` `,(0,Y.jsx)(H,{backgroundColor:`userMessageBackground`,children:`MCP`})]}),(0,Y.jsxs)(H,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(H,{dimColor:!t,children:i})]})}var Y,Kn=e((()=>{i(),ze(),lt(),Y=He()}));async function qn(e){try{return(await rn.readdir(e,{withFileTypes:!0})).filter(e=>e.isFile()&&e.name.endsWith(`.md`)).map(e=>nn.basename(e.name,`.md`))}catch(t){return qe(`Failed to read plugin components from ${e}: ${Ge(t)}`,{level:`error`}),st(Ue(t)),[]}}async function Jn(e){try{let t=await rn.readdir(e,{withFileTypes:!0}),n=[];for(let r of t)if(r.isDirectory()||r.isSymbolicLink()){let t=nn.join(e,r.name,`SKILL.md`);try{(await rn.stat(t)).isFile()&&n.push(r.name)}catch{}}return n}catch(t){return qe(`Failed to read skill directories from ${e}: ${Ge(t)}`,{level:`error`}),st(Ue(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=ye(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 ue(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)(V,{flexDirection:`column`,marginBottom:1,children:[(0,Z.jsx)(H,{bold:!0,children:`Components:`}),(0,Z.jsxs)(H,{dimColor:!0,children:[`Error: `,o]})]}):!n||!(n.commands||n.agents||n.skills||n.hooks||n.mcpServers)?null:(0,Z.jsxs)(V,{flexDirection:`column`,marginBottom:1,children:[(0,Z.jsx)(H,{bold:!0,children:`Installed components:`}),n.commands?(0,Z.jsxs)(H,{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)(H,{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)(H,{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)(H,{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)(H,{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 ue(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!u(`${e.name}@${t}`)})}function Qn({setViewState:e,setResult:t,onManageComplete:n,onSearchModeChange:r,targetPlugin:i,targetMarketplace:o,action:c}){let l=te(e=>e.mcp.clients),u=te(e=>e.mcp.tools),d=te(e=>e.plugins.errors),f=Pt(),[p,m]=(0,X.useState)(!1),g=(0,X.useCallback)(e=>{m(e),r?.(e)},[r]),_=je(),{columns:y}=Le(),[x,S]=(0,X.useState)(`plugin-list`),{query:C,setQuery:ne,cursorOffset:w}=Wt({isActive:x===`plugin-list`&&p,onExit:()=>{g(!1)}}),[T,E]=(0,X.useState)(null),[ie,O]=(0,X.useState)([]),[ae,k]=(0,X.useState)([]),[A,oe]=(0,X.useState)(!0),[j,ce]=(0,X.useState)(new Map),le=(0,X.useRef)(!1),M=(0,X.useRef)(void 0),N=Lt();Ae(`confirm:no`,$n.useCallback(()=>{if(x===`plugin-details`)S(`plugin-list`),E(null),z(null);else if(typeof x==`object`&&x.type===`failed-plugin-details`)S(`plugin-list`),z(null);else if(x===`configuring`)S(`plugin-details`),Ce(null);else if(typeof x==`object`&&(x.type===`plugin-options`||x.type===`configuring-options`))S(`plugin-list`),E(null),t(`Plugin enabled. Configuration skipped — run /reload-plugins to apply.`),n&&n();else if(typeof x==`object`&&x.type===`flagged-detail`)S(`plugin-list`),z(null);else if(typeof x==`object`&&x.type===`mcp-detail`)S(`plugin-list`),z(null);else if(typeof x==`object`&&x.type===`mcp-tools`)S({type:`mcp-detail`,client:x.client});else if(typeof x==`object`&&x.type===`mcp-tool-detail`)S({type:`mcp-tools`,client:x.client});else{if(j.size>0){t(`Run /reload-plugins to apply plugin changes.`);return}e({type:`menu`})}},[x,e,j,t]),{context:`Confirmation`,isActive:(x!==`plugin-list`||!p)&&x!==`confirm-project-uninstall`&&!(typeof x==`object`&&x.type===`confirm-data-cleanup`)});let ue=e=>e.type===`connected`?`connected`:e.type===`disabled`?`disabled`:e.type===`pending`?`pending`:e.type===`needs-auth`?`needs-auth`:`failed`,P=(0,X.useMemo)(()=>{let e=et(),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 ae){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:j.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=_e(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:ue(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:ue(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=_e(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},[ae,l,d,j,f]),de=(0,X.useMemo)(()=>P.filter(e=>e.type===`flagged-plugin`).map(e=>e.id),[P]);(0,X.useEffect)(()=>{de.length>0&&Nt(de)},[de]);let F=(0,X.useMemo)(()=>{if(!C)return P;let e=C.toLowerCase();return P.filter(t=>t.name.toLowerCase().includes(e)||`description`in t&&t.description?.toLowerCase().includes(e))},[P,C]),[I,fe]=(0,X.useState)(0),pe=En({totalItems:F.length,selectedIndex:I,maxVisible:8}),[me,he]=(0,X.useState)(0),[ye,R]=(0,X.useState)(!1),[be,z]=(0,X.useState)(null),[Se,Ce]=(0,X.useState)(null),[we,Te]=(0,X.useState)(!1),[Ee,De]=(0,X.useState)(!1);(0,X.useEffect)(()=>{if(!T){De(!1);return}async function e(){let e=T.plugin.manifest.mcpServers,t=!1;if(e&&(t=typeof e==`string`&&h(e)||Array.isArray(e)&&e.some(e=>typeof e==`string`&&h(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`&&h(e)||Array.isArray(e)&&e.some(e=>typeof e==`string`&&h(e))}}catch(e){qe(`Failed to read raw marketplace.json: ${e}`)}De(t)}e()},[T]),(0,X.useEffect)(()=>{async function e(){oe(!0);try{let{enabled:e,disabled:t}=await re(),n=et(),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=nt(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)),O(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})}k(o),fe(0)}finally{oe(!1)}}e()},[]),(0,X.useEffect)(()=>{if(!le.current&&i&&ie.length>0&&!A){let{name:e,marketplace:n}=_e(i),r=o??n,a=r?ie.filter(e=>e.name===r):ie;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};E(r),S(`plugin-details`),M.current=c,le.current=!0;return}}let s=P.find(t=>t.type===`failed-plugin`&&t.name===e);s&&s.type===`failed-plugin`&&(S({type:`failed-plugin-details`,plugin:{id:s.id,name:s.name,marketplace:s.marketplace,errors:s.errors,scope:s.scope}}),le.current=!0),!le.current&&c&&(le.current=!0,t(`Plugin "${i}" is not installed in this project`))}},[i,o,ie,A,P,c,t]);let Oe=async r=>{if(!T)return;let i=T.scope||`user`,a=i===`builtin`;if(a&&(r===`update`||r===`uninstall`)){z(`Built-in plugins cannot be updated or uninstalled.`);return}if(!a&&!St(i)&&r!==`update`){z(`This plugin is managed by your organization. Contact your admin to disable it.`);return}R(!0),z(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)){R(!1),S(`confirm-project-uninstall`);return}let e=ve().plugins[o],t=!e||e.length<=1?await se(o):null;if(t){R(!1),S({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}}ee();let c=`${T.plugin.name}@${T.marketplace}`;if(et()?.enabledPlugins?.[c]!==!1){R(!1),S({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){R(!1);let t=e instanceof Error?e.message:String(e);z(`Failed to ${r}: ${t}`),st(Ue(e))}},Me=(0,X.useRef)(Oe);Me.current=Oe,(0,X.useEffect)(()=>{if(x===`plugin-details`&&T&&M.current){let e=M.current;M.current=void 0,Me.current(e)}},[x,T]);let Pe=$n.useCallback(()=>{if(I>=F.length)return;let e=F[I];if(e?.type!==`flagged-plugin`)if(e?.type===`plugin`){let t=`${e.plugin.name}@${e.marketplace}`,n=et(),r=j.get(t),i=n?.enabledPlugins?.[t]!==!1,a=e.scope;if(a===`builtin`||St(a)){let e=new Map(j);r?(e.delete(t),(async()=>{try{r===`will-disable`?await vt(t):await xt(t),ee()}catch(e){st(e)}})()):(e.set(t,i?`will-disable`:`will-enable`),(async()=>{try{i?await xt(t):await vt(t),ee()}catch(e){st(e)}})()),ce(e)}}else e?.type===`mcp`&&N(e.client.name)},[I,F,j,ae,N]);B({"select:previous":()=>{I===0?g(!0):pe.handleSelectionChange(I-1,fe)},"select:next":()=>{I<F.length-1&&pe.handleSelectionChange(I+1,fe)},"select:accept":$n.useCallback(()=>{if(I>=F.length)return;let e=F[I];if(e?.type===`plugin`){let t=ae.find(t=>t.plugin.name===e.plugin.name&&t.marketplace===e.marketplace);t&&(E(t),S(`plugin-details`),he(0),z(null))}else e?.type===`flagged-plugin`?(S({type:`flagged-detail`,plugin:{id:e.id,name:e.name,marketplace:e.marketplace,reason:e.reason,text:e.text,flaggedAt:e.flaggedAt}}),z(null)):e?.type===`failed-plugin`?(S({type:`failed-plugin-details`,plugin:{id:e.id,name:e.name,marketplace:e.marketplace,errors:e.errors,scope:e.scope}}),he(0),z(null)):e?.type===`mcp`&&(S({type:`mcp-detail`,client:e.client}),z(null))},[I,F,ae])},{context:`Select`,isActive:x===`plugin-list`&&!p}),B({"plugin:toggle":Pe},{context:`Plugin`,isActive:x===`plugin-list`&&!p}),B({"select:accept":$n.useCallback(()=>{typeof x!=`object`||x.type!==`flagged-detail`||(Ft(x.plugin.id),S(`plugin-list`))},[x])},{context:`Select`,isActive:typeof x==`object`&&x.type===`flagged-detail`});let Ie=$n.useMemo(()=>{if(x!==`plugin-details`||!T)return[];let e=et(),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 Oe(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){z(e);return}let t=[...ae],n=t.findIndex(e=>e.plugin.name===T.plugin.name&&e.marketplace===T.marketplace);n!==-1&&(t[n].pendingUpdate=!T.pendingUpdate,k(t),E({...T,pendingUpdate:!T.pendingUpdate}))}catch(e){z(e instanceof Error?e.message:`Failed to check plugin update availability`)}}}),Ee&&i.push({label:`Configure`,action:async()=>{Te(!0);try{let e=T.plugin.manifest.mcpServers,t=null;if(typeof e==`string`&&h(e))t=e;else if(Array.isArray(e)){for(let n of e)if(typeof n==`string`&&h(n)){t=n;break}}if(!t){z(`No MCPB file found in plugin`),Te(!1);return}let n=`${T.plugin.name}@${T.marketplace}`,r=await ge(t,T.plugin.path,n,void 0,void 0,!0);`status`in r&&r.status===`needs-config`?(Ce(r),S(`configuring`)):z(`Failed to load MCPB for configuration`)}catch(e){let t=Ge(e);z(`Failed to load configuration: ${t}`)}finally{Te(!1)}}}),T.plugin.manifest.userConfig&&Object.keys(T.plugin.manifest.userConfig).length>0&&i.push({label:`Configure options`,action:()=>{S({type:`configuring-options`,schema:T.plugin.manifest.userConfig})}}),i.push({label:`Update now`,action:()=>void Oe(`update`)}),i.push({label:`Uninstall`,action:()=>void Oe(`uninstall`)})),T.plugin.manifest.homepage&&i.push({label:`Open homepage`,action:()=>void b(T.plugin.manifest.homepage)}),T.plugin.manifest.repository&&i.push({label:`View repository`,action:()=>void b(T.plugin.manifest.repository)}),i.push({label:`Back to plugin list`,action:()=>{S(`plugin-list`),E(null),z(null)}}),i},[x,T,Ee,ae]);if(B({"select:previous":()=>{me>0&&he(me-1)},"select:next":()=>{me<Ie.length-1&&he(me+1)},"select:accept":()=>{Ie[me]&&Ie[me].action()}},{context:`Select`,isActive:x===`plugin-details`&&!!T}),B({"select:accept":()=>{typeof x==`object`&&x.type===`failed-plugin-details`&&(async()=>{R(!0),z(null);let e=x.plugin.id,t=x.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=rt(t);n?.enabledPlugins?.[e]!==void 0&&(Qe(t,{enabledPlugins:{...n.enabledPlugins,[e]:void 0}}),i=!0)}ee()}i?(n&&await n(),R(!1),S(`plugin-list`)):(R(!1),z(r.message))})()}},{context:`Select`,isActive:typeof x==`object`&&x.type===`failed-plugin-details`&&x.plugin.scope!==`managed`}),B({"confirm:yes":()=>{if(!T)return;R(!0),z(null);let r=`${T.plugin.name}@${T.marketplace}`,{error:i}=Qe(`localSettings`,{enabledPlugins:{...rt(`localSettings`)?.enabledPlugins,[r]:!1}});if(i){R(!1),z(`Failed to write settings: ${i.message}`);return}ee(),t(`✓ Disabled ${T.plugin.name} in .workmate/settings.local.json. Run /reload-plugins to apply.`),n&&n(),e({type:`menu`})},"confirm:no":()=>{S(`plugin-details`),z(null)}},{context:`Confirmation`,isActive:x===`confirm-project-uninstall`&&!!T&&!ye}),Ne((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=>{R(!0),z(null);try{let i=await yt(o,s,r);if(!i.success)throw Error(i.message);ee();let c=r?``:` · data preserved`;t(`${a.tick} ${i.message}${c}`),n&&n(),e({type:`menu`})}catch(e){R(!1),z(e instanceof Error?e.message:String(e))}};r===`y`||r===`Y`?c(!0):r===`n`||r===`N`?c(!1):i.escape&&(S(`plugin-details`),z(null))},{isActive:typeof x==`object`&&x.type===`confirm-data-cleanup`&&!!T&&!ye}),$n.useEffect(()=>{fe(0)},[C]),Ne((e,t)=>{let n=!t.ctrl&&!t.meta;p||(e===`/`&&n?(g(!0),ne(``),fe(0)):n&&e.length>0&&!/^\s+$/.test(e)&&e!==`j`&&e!==`k`&&e!==` `&&(g(!0),ne(e),fe(0)))},{isActive:x===`plugin-list`}),A)return(0,Z.jsx)(H,{children:`Loading installed plugins…`});if(P.length===0)return(0,Z.jsxs)(V,{flexDirection:`column`,children:[(0,Z.jsx)(V,{marginBottom:1,children:(0,Z.jsx)(H,{bold:!0,children:`Manage plugins`})}),(0,Z.jsx)(H,{children:`No plugins or MCP servers installed.`}),(0,Z.jsx)(V,{marginTop:1,children:(0,Z.jsx)(H,{dimColor:!0,children:`Esc to go back`})})]});if(typeof x==`object`&&x.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 x==`object`&&x.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:x.schema,initialValues:xe(e),onSave:n=>{try{D(e,n,x.schema),ee(),t(`Configuration saved. Run /reload-plugins for changes to take effect.`)}catch(e){z(`Failed to save configuration: ${Ge(e)}`)}S(`plugin-details`)},onCancel:()=>S(`plugin-details`)})}if(x===`configuring`&&Se&&T){let e=`${T.plugin.name}@${T.marketplace}`;async function n(n){if(!(!Se||!T))try{let r=T.plugin.manifest.mcpServers,i=null;if(typeof r==`string`&&h(r))i=r;else if(Array.isArray(r)){for(let e of r)if(typeof e==`string`&&h(e)){i=e;break}}if(!i){z(`No MCPB file found`),S(`plugin-details`);return}await ge(i,T.plugin.path,e,void 0,n),z(null),Ce(null),S(`plugin-details`),t(`Configuration saved. Run /reload-plugins for changes to take effect.`)}catch(e){let t=Ge(e);z(`Failed to save configuration: ${t}`),S(`plugin-details`)}}function r(){Ce(null),S(`plugin-details`)}return(0,Z.jsx)(ln,{title:`Configure ${Se.manifest.name}`,subtitle:`Plugin: ${T.plugin.name}`,configSchema:Se.configSchema,initialValues:Se.existingConfig,onSave:n,onCancel:r})}if(typeof x==`object`&&x.type===`flagged-detail`){let e=x.plugin;return(0,Z.jsxs)(V,{flexDirection:`column`,children:[(0,Z.jsx)(V,{children:(0,Z.jsxs)(H,{bold:!0,children:[e.name,` @ `,e.marketplace]})}),(0,Z.jsxs)(V,{marginBottom:1,children:[(0,Z.jsx)(H,{dimColor:!0,children:`Status: `}),(0,Z.jsx)(H,{color:`error`,children:`Removed`})]}),(0,Z.jsxs)(V,{marginBottom:1,flexDirection:`column`,children:[(0,Z.jsxs)(H,{color:`error`,children:[`Removed from marketplace · reason: `,e.reason]}),(0,Z.jsx)(H,{children:e.text}),(0,Z.jsxs)(H,{dimColor:!0,children:[`Flagged on `,new Date(e.flaggedAt).toLocaleDateString()]})]}),(0,Z.jsx)(V,{marginTop:1,flexDirection:`column`,children:(0,Z.jsxs)(V,{children:[(0,Z.jsxs)(H,{children:[a.pointer,` `]}),(0,Z.jsx)(H,{color:`suggestion`,children:`Dismiss`})]})}),(0,Z.jsxs)(ke,{children:[(0,Z.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`dismiss`}),(0,Z.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})]})}if(x===`confirm-project-uninstall`&&T)return(0,Z.jsxs)(V,{flexDirection:`column`,children:[(0,Z.jsxs)(H,{bold:!0,color:`warning`,children:[T.plugin.name,` is enabled in .workmate/settings.json (shared with your team)`]}),(0,Z.jsxs)(V,{marginTop:1,flexDirection:`column`,children:[(0,Z.jsx)(H,{children:`Disable it just for you in .workmate/settings.local.json?`}),(0,Z.jsx)(H,{dimColor:!0,children:`This has the same effect as uninstalling, without affecting other contributors.`})]}),be&&(0,Z.jsx)(V,{marginTop:1,children:(0,Z.jsx)(H,{color:`error`,children:be})}),(0,Z.jsx)(V,{marginTop:1,children:ye?(0,Z.jsx)(H,{dimColor:!0,children:`Disabling…`}):(0,Z.jsxs)(ke,{children:[(0,Z.jsx)(L,{action:`confirm:yes`,context:`Confirmation`,fallback:`y`,description:`disable`}),(0,Z.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]});if(typeof x==`object`&&x.type===`confirm-data-cleanup`&&T)return(0,Z.jsxs)(V,{flexDirection:`column`,children:[(0,Z.jsxs)(H,{bold:!0,children:[T.plugin.name,` has `,x.size.human,` of persistent data`]}),(0,Z.jsxs)(V,{marginTop:1,flexDirection:`column`,children:[(0,Z.jsx)(H,{children:`Delete it along with the plugin?`}),(0,Z.jsx)(H,{dimColor:!0,children:s(`${T.plugin.name}@${T.marketplace}`)})]}),be&&(0,Z.jsx)(V,{marginTop:1,children:(0,Z.jsx)(H,{color:`error`,children:be})}),(0,Z.jsx)(V,{marginTop:1,children:ye?(0,Z.jsx)(H,{dimColor:!0,children:`Uninstalling…`}):(0,Z.jsxs)(H,{children:[(0,Z.jsx)(H,{bold:!0,children:`y`}),` to delete · `,(0,Z.jsx)(H,{bold:!0,children:`n`}),` to keep · `,(0,Z.jsx)(H,{bold:!0,children:`esc`}),` to cancel`]})})]});if(x===`plugin-details`&&T){let e=et(),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)(V,{flexDirection:`column`,marginBottom:1,children:[(0,Z.jsxs)(H,{bold:!0,color:`error`,children:[r.length,` `,ct(r.length,`error`),`:`]}),r.map((e,t)=>{let n=Un(e);return(0,Z.jsxs)(V,{flexDirection:`column`,marginLeft:2,children:[(0,Z.jsx)(H,{color:`error`,children:Hn(e)}),n&&(0,Z.jsxs)(H,{dimColor:!0,italic:!0,children:[a.arrowRight,` `,n]})]},t)})]});return(0,Z.jsxs)(V,{flexDirection:`column`,children:[(0,Z.jsx)(V,{children:(0,Z.jsxs)(H,{bold:!0,children:[T.plugin.name,` @ `,T.marketplace]})}),(0,Z.jsxs)(V,{children:[(0,Z.jsx)(H,{dimColor:!0,children:`Scope: `}),(0,Z.jsx)(H,{children:T.scope||`user`})]}),T.plugin.manifest.version&&(0,Z.jsxs)(V,{children:[(0,Z.jsx)(H,{dimColor:!0,children:`Version: `}),(0,Z.jsx)(H,{children:T.plugin.manifest.version})]}),T.plugin.manifest.description&&(0,Z.jsx)(V,{marginBottom:1,children:(0,Z.jsx)(H,{children:T.plugin.manifest.description})}),T.plugin.manifest.author&&(0,Z.jsxs)(V,{children:[(0,Z.jsx)(H,{dimColor:!0,children:`Author: `}),(0,Z.jsx)(H,{children:T.plugin.manifest.author.name})]}),(0,Z.jsxs)(V,{marginBottom:1,children:[(0,Z.jsx)(H,{dimColor:!0,children:`Status: `}),(0,Z.jsx)(H,{color:n?`success`:`warning`,children:n?`Enabled`:`Disabled`}),T.pendingUpdate&&(0,Z.jsx)(H,{color:`suggestion`,children:` · Marked for update`})]}),(0,Z.jsx)(Yn,{plugin:T.plugin,marketplace:T.marketplace}),i,(0,Z.jsx)(V,{marginTop:1,flexDirection:`column`,children:Ie.map((e,t)=>{let n=t===me;return(0,Z.jsxs)(V,{children:[n&&(0,Z.jsxs)(H,{children:[a.pointer,` `]}),!n&&(0,Z.jsx)(H,{children:` `}),(0,Z.jsx)(H,{bold:n,color:e.label.includes(`Uninstall`)?`error`:e.label.includes(`Update`)?`suggestion`:void 0,children:e.label})]},t)})}),ye&&(0,Z.jsx)(V,{marginTop:1,children:(0,Z.jsx)(H,{children:`Processing…`})}),be&&(0,Z.jsx)(V,{marginTop:1,children:(0,Z.jsx)(H,{color:`error`,children:be})}),(0,Z.jsx)(V,{marginTop:1,children:(0,Z.jsx)(H,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(ke,{children:[(0,Z.jsx)(L,{action:`select:previous`,context:`Select`,fallback:`↑`,description:`navigate`}),(0,Z.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,Z.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}if(typeof x==`object`&&x.type===`failed-plugin-details`){let e=x.plugin,t=e.errors[0],n=t?Hn(t):`Failed to load`;return(0,Z.jsxs)(V,{flexDirection:`column`,children:[(0,Z.jsxs)(H,{children:[(0,Z.jsx)(H,{bold:!0,children:e.name}),(0,Z.jsxs)(H,{dimColor:!0,children:[` @ `,e.marketplace]}),(0,Z.jsxs)(H,{dimColor:!0,children:[` (`,e.scope,`)`]})]}),(0,Z.jsx)(H,{color:`error`,children:n}),e.scope===`managed`?(0,Z.jsx)(V,{marginTop:1,children:(0,Z.jsx)(H,{dimColor:!0,children:`Managed by your organization — contact your admin`})}):(0,Z.jsxs)(V,{marginTop:1,children:[(0,Z.jsxs)(H,{color:`suggestion`,children:[a.pointer,` `]}),(0,Z.jsx)(H,{bold:!0,children:`Remove`})]}),ye&&(0,Z.jsx)(H,{children:`Processing…`}),be&&(0,Z.jsx)(H,{color:`error`,children:be}),(0,Z.jsx)(V,{marginTop:1,children:(0,Z.jsx)(H,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(ke,{children:[e.scope!==`managed`&&(0,Z.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`remove`}),(0,Z.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}if(typeof x==`object`&&x.type===`mcp-detail`){let e=x.client,n=v(u,e.name).length,r=()=>{S({type:`mcp-tools`,client:e})},i=()=>{S(`plugin-list`)},a=e=>{e&&t(e),S(`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}):(S(`plugin-list`),null)}if(typeof x==`object`&&x.type===`mcp-tools`){let e=x.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=>{S({type:`mcp-tool-detail`,client:e,tool:t})},onBack:()=>S({type:`mcp-detail`,client:e})})}if(typeof x==`object`&&x.type===`mcp-tool-detail`){let{client:e,tool:t}=x,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:()=>S({type:`mcp-tools`,client:e})})}let Re=pe.getVisibleItems(F);return(0,Z.jsxs)(V,{flexDirection:`column`,children:[(0,Z.jsx)(V,{marginBottom:1,children:(0,Z.jsx)(Fe,{query:C,isFocused:p,isTerminalFocused:_,width:y-4,cursorOffset:w})}),F.length===0&&C&&(0,Z.jsx)(V,{marginBottom:1,children:(0,Z.jsxs)(H,{dimColor:!0,children:[`No items match "`,C,`"`]})}),pe.scrollPosition.canScrollUp&&(0,Z.jsx)(V,{children:(0,Z.jsxs)(H,{dimColor:!0,children:[` `,a.arrowUp,` more above`]})}),Re.map((e,t)=>{let n=pe.toActualIndex(t)===I&&!p,r=t>0?Re[t-1]:null,i=!r||r.scope!==e.scope;return(0,Z.jsxs)($n.Fragment,{children:[i&&(0,Z.jsx)(V,{marginTop:+(t>0),paddingLeft:2,children:(0,Z.jsx)(H,{dimColor:e.scope!==`flagged`,color:e.scope===`flagged`?`warning`:void 0,bold:e.scope===`flagged`,children:(e=>{switch(e){case`flagged`:return`Flagged`;case`project`:return`Project`;case`local`:return`Local`;case`user`:return`User`;case`enterprise`:return`Enterprise`;case`managed`:return`Managed`;case`builtin`:return`Built-in`;case`dynamic`:return`Built-in`;default:return e}})(e.scope)})}),(0,Z.jsx)(Gn,{item:e,isSelected:n})]},e.id)}),pe.scrollPosition.canScrollDown&&(0,Z.jsx)(V,{children:(0,Z.jsxs)(H,{dimColor:!0,children:[` `,a.arrowDown,` more below`]})}),(0,Z.jsx)(V,{marginTop:1,marginLeft:1,children:(0,Z.jsx)(H,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(ke,{children:[(0,Z.jsx)(H,{children:`type to search`}),(0,Z.jsx)(L,{action:`plugin:toggle`,context:`Plugin`,fallback:`Space`,description:`toggle`}),(0,Z.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`details`}),(0,Z.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})}),j.size>0&&(0,Z.jsx)(V,{marginLeft:1,children:(0,Z.jsx)(H,{dimColor:!0,italic:!0,children:`Run /reload-plugins to apply changes`})})]})}var $n,X,Z,er=e((()=>{i(),$n=t(Me(),1),X=t(Me(),1),ce(),ze(),qt(),Xt(),Jt(),Yt(),Ut(),Gt(),A(),O(),Se(),Rt(),oe(),wt(),m(),Xe(),me(),Je(),We(),ot(),C(),k(),P(),_(),ne(),It(),F(),y(),f(),Te(),gt(),tt(),Ye(),lt(),Wn(),fn(),_n(),Kn(),kn(),Z=He()}));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} ${ct(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} ${ct(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,st(t),e(`${a.cross} Unexpected error during validation: ${Ge(t)}`)}}n()},[e,t]),(0,ar.jsx)(V,{flexDirection:`column`,children:(0,ar.jsx)(H,{children:`Running validation...`})})}var ir,ar,or=e((()=>{i(),ir=t(Me(),1),ze(),We(),ot(),Mt(),lt(),ar=He()}));function sr({onComplete:e}){return(0,Q.useEffect)(()=>{async function t(){try{let t=await I(),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)(H,{children:`Loading marketplaces...`})}function cr(e){let t=[];for(let{source:n,scope:r}of[{source:`userSettings`,scope:`user`},{source:`projectSettings`,scope:`project`},{source:`localSettings`,scope:`local`}])rt(n)?.extraKnownMarketplaces?.[e]&&t.push({source:n,scope:r});return{editableSources:t,isInPolicy:!!rt(`policySettings`)?.extraKnownMarketplaces?.[e]}}function lr(e){let{editableSources:t,isInPolicy:n}=cr(e);return t.length>0?{kind:`remove-extra-marketplace`,name:e,sources:t}:n?{kind:`managed-only`,name:e}:{kind:`navigate`,tab:`marketplaces`,viewState:{type:`manage-marketplaces`,targetMarketplace:e,action:`remove`}}}function ur(e){return{kind:`navigate`,tab:`installed`,viewState:{type:`manage-plugins`,targetPlugin:e,action:`uninstall`}}}function dr(e){return yr.has(e.type)}function fr(e){if(`pluginId`in e&&e.pluginId)return e.pluginId;if(`plugin`in e&&e.plugin)return e.plugin;if(e.source.includes(`@`))return e.source.split(`@`)[0]}function pr(e,t,n,r,i,a,o){let s=[];for(let e of a){let t=`pluginId`in e?e.pluginId:`plugin`in e?e.plugin:void 0;s.push({label:t??e.source,message:Hn(e),guidance:`Restart to retry loading plugins`,action:{kind:`none`}})}let c=new Set;for(let t of e){c.add(t.name);let e=lr(t.name),n=cr(t.name),r=n.isInPolicy?`managed`:n.editableSources[0]?.scope;s.push({label:t.name,message:t.error??`Installation failed`,guidance:e.kind===`managed-only`?`Managed by your organization — contact your admin`:void 0,action:e,scope:r})}for(let e of t){let t=`marketplace`in e?e.marketplace:e.source;if(c.has(t))continue;c.add(t);let n=lr(t),r=cr(t),i=r.isInPolicy?`managed`:r.editableSources[0]?.scope;s.push({label:t,message:Hn(e),guidance:n.kind===`managed-only`?`Managed by your organization — contact your admin`:Un(e),action:n,scope:i})}for(let e of i)c.has(e.name)||(c.add(e.name),s.push({label:e.name,message:e.error,action:{kind:`remove-installed-marketplace`,name:e.name}}));let l=new Set;for(let e of n){let t=fr(e);if(t&&l.has(t))continue;t&&l.add(t);let n=`marketplace`in e?e.marketplace:void 0,r=t?o.get(e.source)??o.get(t):void 0;s.push({label:t?n?`${t} @ ${n}`:t:e.source,message:Hn(e),guidance:Un(e),action:t?ur(t):{kind:`none`},scope:r})}for(let e of r)s.push({label:e.source,message:Hn(e),guidance:Un(e),action:{kind:`none`}});return s}function mr(e,t){for(let{source:n}of t){let t=rt(n);if(!t)continue;let r={};if(t.extraKnownMarketplaces?.[e]&&(r.extraKnownMarketplaces={...t.extraKnownMarketplaces,[e]:void 0}),t.enabledPlugins){let n=`@${e}`,i=!1,a={...t.enabledPlugins};for(let e in a)e.endsWith(n)&&(a[e]=void 0,i=!0);i&&(r.enabledPlugins=a)}Object.keys(r).length>0&&Qe(n,r)}}function hr({setViewState:e,setActiveTab:t,markPluginsChanged:n}){let r=te(e=>e.plugins.errors),i=te(e=>e.plugins.installationStatus),o=c(),[s,l]=(0,Q.useState)(0),[u,d]=(0,Q.useState)(null),[f,p]=(0,Q.useState)([]);(0,Q.useEffect)(()=>{(async()=>{try{let{failures:e}=await pe(await I());p(e)}catch{}})()},[]);let m=i.marketplaces.filter(e=>e.status===`failed`),h=new Set(m.map(e=>e.name)),g=r.filter(dr),_=pr(m,r.filter(e=>(e.type===`marketplace-not-found`||e.type===`marketplace-load-failed`||e.type===`marketplace-blocked-by-policy`)&&!h.has(e.marketplace)),r.filter(e=>dr(e)||e.type===`marketplace-not-found`||e.type===`marketplace-load-failed`||e.type===`marketplace-blocked-by-policy`?!1:fr(e)!==void 0),r.filter(e=>dr(e)||e.type===`marketplace-not-found`||e.type===`marketplace-load-failed`||e.type===`marketplace-blocked-by-policy`?!1:fr(e)===void 0),f,g,_t());Ae(`confirm:no`,()=>{e({type:`menu`})},{context:`Confirmation`}),B({"select:previous":()=>l(e=>Math.max(0,e-1)),"select:next":()=>l(e=>Math.min(_.length-1,e+1)),"select:accept":()=>{let r=_[s];if(!r)return;let{action:i}=r;switch(i.kind){case`navigate`:t(i.tab),e(i.viewState);break;case`remove-extra-marketplace`:{let e=i.sources.map(e=>e.scope).join(`, `);mr(i.name,i.sources),ee(),o(e=>({...e,plugins:{...e.plugins,errors:e.plugins.errors.filter(e=>!(`marketplace`in e&&e.marketplace===i.name)),installationStatus:{...e.plugins.installationStatus,marketplaces:e.plugins.installationStatus.marketplaces.filter(e=>e.name!==i.name)}}})),d(`${a.tick} Removed "${i.name}" from ${e} settings`),n();break}case`remove-installed-marketplace`:(async()=>{try{await j(i.name),ee(),p(e=>e.filter(e=>e.name!==i.name)),d(`${a.tick} Removed marketplace "${i.name}"`),n()}catch(e){d(`Failed to remove "${i.name}": ${e instanceof Error?e.message:String(e)}`)}})();break;case`managed-only`:break;case`none`:break}}},{context:`Select`,isActive:_.length>0});let v=Math.min(s,Math.max(0,_.length-1));v!==s&&l(v);let y=_[v]?.action,b=y&&y.kind!==`none`&&y.kind!==`managed-only`;return _.length===0?(0,$.jsxs)(V,{flexDirection:`column`,children:[(0,$.jsx)(V,{marginLeft:1,children:(0,$.jsx)(H,{dimColor:!0,children:`No plugin errors`})}),(0,$.jsx)(V,{marginTop:1,children:(0,$.jsx)(H,{dimColor:!0,italic:!0,children:(0,$.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})})})]}):(0,$.jsxs)(V,{flexDirection:`column`,children:[_.map((e,t)=>{let n=t===v;return(0,$.jsxs)(V,{marginLeft:1,flexDirection:`column`,marginBottom:1,children:[(0,$.jsxs)(H,{children:[(0,$.jsxs)(H,{color:n?`suggestion`:`error`,children:[n?a.pointer:a.cross,` `]}),(0,$.jsx)(H,{bold:n,children:e.label}),e.scope&&(0,$.jsxs)(H,{dimColor:!0,children:[` (`,e.scope,`)`]})]}),(0,$.jsx)(V,{marginLeft:3,children:(0,$.jsx)(H,{color:`error`,children:e.message})}),e.guidance&&(0,$.jsx)(V,{marginLeft:3,children:(0,$.jsx)(H,{dimColor:!0,italic:!0,children:e.guidance})})]},t)}),u&&(0,$.jsx)(V,{marginTop:1,marginLeft:1,children:(0,$.jsx)(H,{color:`claude`,children:u})}),(0,$.jsx)(V,{marginTop:1,children:(0,$.jsx)(H,{dimColor:!0,italic:!0,children:(0,$.jsxs)(ke,{children:[(0,$.jsx)(L,{action:`select:previous`,context:`Select`,fallback:`↑`,description:`navigate`}),b&&(0,$.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`resolve`}),(0,$.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}function gr(e){switch(e.type){case`help`:return{type:`help`};case`validate`:return{type:`validate`,path:e.path};case`install`:return e.marketplace?{type:`browse-marketplace`,targetMarketplace:e.marketplace,targetPlugin:e.plugin}:e.plugin?{type:`discover-plugins`,targetPlugin:e.plugin}:{type:`discover-plugins`};case`manage`:return{type:`manage-plugins`};case`uninstall`:return{type:`manage-plugins`,targetPlugin:e.plugin,action:`uninstall`};case`enable`:return{type:`manage-plugins`,targetPlugin:e.plugin,action:`enable`};case`disable`:return{type:`manage-plugins`,targetPlugin:e.plugin,action:`disable`};case`marketplace`:return e.action===`list`?{type:`marketplace-list`}:e.action===`add`?{type:`add-marketplace`,initialValue:e.target}:e.action===`remove`?{type:`manage-marketplaces`,targetMarketplace:e.target,action:`remove`}:e.action===`update`?{type:`manage-marketplaces`,targetMarketplace:e.target,action:`update`}:{type:`marketplace-menu`};default:return{type:`discover-plugins`}}}function _r(e){return e.type===`manage-plugins`?`installed`:e.type===`manage-marketplaces`?`marketplaces`:`discover`}function vr({onComplete:e,args:t}){let n=tr(t),r=gr(n),[i,a]=(0,Q.useState)(r),[o,s]=(0,Q.useState)(_r(r)),[l,u]=(0,Q.useState)(i.type===`add-marketplace`&&i.initialValue||``),[d,f]=(0,Q.useState)(0),[p,m]=(0,Q.useState)(null),[h,g]=(0,Q.useState)(null),[_,v]=(0,Q.useState)(!1),y=c(),b=te(e=>{let t=e.plugins.errors.length;for(let n of e.plugins.installationStatus.marketplaces)n.status===`failed`&&t++;return t}),ee=b>0?`Errors (${b})`:`Errors`,x=zt(),S=n.type===`marketplace`&&n.action===`add`&&n.target!==void 0,C=(0,Q.useCallback)(()=>{y(e=>e.plugins.needsRefresh?e:{...e,plugins:{...e.plugins,needsRefresh:!0}})},[y]),ne=(0,Q.useCallback)(e=>{let t=e;switch(s(t),m(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`&&!h&&e()},[i.type,h,e]),(0,Q.useEffect)(()=>{i.type===`browse-marketplace`&&o!==`discover`&&s(`discover`)},[i.type,o]),Ae(`confirm:no`,(0,Q.useCallback)(()=>{s(`marketplaces`),a({type:`manage-marketplaces`}),u(``),m(null)},[]),{context:`Settings`,isActive:i.type===`add-marketplace`}),(0,Q.useEffect)(()=>{h&&e(h)},[h,e]),(0,Q.useEffect)(()=>{i.type===`help`&&e()},[i.type,e]),i.type===`help`?(0,$.jsxs)(V,{flexDirection:`column`,children:[(0,$.jsx)(H,{bold:!0,children:`Plugin Command Usage:`}),(0,$.jsx)(H,{children:` `}),(0,$.jsx)(H,{dimColor:!0,children:`Installation:`}),(0,$.jsx)(H,{children:` /plugin install - Browse and install plugins`}),(0,$.jsx)(H,{children:` /plugin install <marketplace> - Install from specific marketplace`}),(0,$.jsx)(H,{children:` /plugin install <plugin> - Install specific plugin`}),(0,$.jsx)(H,{children:` /plugin install <plugin>@<market> - Install plugin from marketplace`}),(0,$.jsx)(H,{children:` `}),(0,$.jsx)(H,{dimColor:!0,children:`Management:`}),(0,$.jsx)(H,{children:` /plugin manage - Manage installed plugins`}),(0,$.jsx)(H,{children:` /plugin enable <plugin> - Enable a plugin`}),(0,$.jsx)(H,{children:` /plugin disable <plugin> - Disable a plugin`}),(0,$.jsx)(H,{children:` /plugin uninstall <plugin> - Uninstall a plugin`}),(0,$.jsx)(H,{children:` `}),(0,$.jsx)(H,{dimColor:!0,children:`Marketplaces:`}),(0,$.jsx)(H,{children:` /plugin marketplace - Marketplace management menu`}),(0,$.jsx)(H,{children:` /plugin marketplace add - Add a marketplace`}),(0,$.jsx)(H,{children:` /plugin marketplace add <path/url> - Add marketplace directly`}),(0,$.jsx)(H,{children:` /plugin marketplace update - Update marketplaces`}),(0,$.jsx)(H,{children:` /plugin marketplace update <name> - Update specific marketplace`}),(0,$.jsx)(H,{children:` /plugin marketplace remove - Remove a marketplace`}),(0,$.jsx)(H,{children:` /plugin marketplace remove <name> - Remove specific marketplace`}),(0,$.jsx)(H,{children:` /plugin marketplace list - List all marketplaces`}),(0,$.jsx)(H,{children:` `}),(0,$.jsx)(H,{dimColor:!0,children:`Validation:`}),(0,$.jsx)(H,{children:` /plugin validate <path> - Validate a manifest file or directory`}),(0,$.jsx)(H,{children:` `}),(0,$.jsx)(H,{dimColor:!0,children:`Other:`}),(0,$.jsx)(H,{children:` /plugin - Main plugin menu`}),(0,$.jsx)(H,{children:` /plugin help - Show this help`}),(0,$.jsx)(H,{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:l,setInputValue:u,cursorOffset:d,setCursorOffset:f,error:p,setError:m,result:h,setResult:g,setViewState:a,onAddComplete:C,cliMode:S}):(0,$.jsx)(Be,{color:`suggestion`,children:(0,$.jsxs)(Re,{title:`Plugins`,selectedTab:o,onTabChange:ne,color:`suggestion`,disableNavigation:_,children:[(0,$.jsx)(Ie,{id:`discover`,title:`Discover`,children:i.type===`browse-marketplace`?(0,$.jsx)(An,{error:p,setError:m,result:h,setResult:g,setViewState:a,onInstallComplete:C,targetMarketplace:i.targetMarketplace,targetPlugin:i.targetPlugin}):(0,$.jsx)(Nn,{error:p,setError:m,result:h,setResult:g,setViewState:a,onInstallComplete:C,onSearchModeChange:v,targetPlugin:i.type===`discover-plugins`?i.targetPlugin:void 0})}),(0,$.jsx)(Ie,{id:`installed`,title:`Installed`,children:(0,$.jsx)(Qn,{setViewState:a,setResult:g,onManageComplete:C,onSearchModeChange:v,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)(Ie,{id:`marketplaces`,title:`Marketplaces`,children:(0,$.jsx)(Rn,{setViewState:a,error:p,setError:m,setResult:g,exitState:x,onManageComplete:C,targetMarketplace:i.type===`manage-marketplaces`?i.targetMarketplace:void 0,action:i.type===`manage-marketplaces`?i.action:void 0})}),(0,$.jsx)(Ie,{id:`errors`,title:ee,children:(0,$.jsx)(hr,{setViewState:a,setActiveTab:s,markPluginsChanged:C})})]})})}var Q,$,yr,br=e((()=>{i(),Q=t(Me(),1),ce(),ze(),Bt(),O(),m(),We(),C(),he(),P(),gt(),tt(),sn(),Mn(),Ln(),Vn(),er(),Wn(),nr(),or(),$=He(),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=He()}))();export{xr as call};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Qa as t,Xa as n,do as r,fS as i,fo as a,ho as o,mS as s,so as c,to as l}from"./loadAgentsDir-C1LkW7gl.js";import{L as u,N as d,c as f,i as p}from"./debug-8DCufdSp.js";import{_t as m,bt as h}from"./settings-DKN4xSpQ.js";import{m as g,y as _}from"./config-BddEvZZl.js";import{o as v,s as y}from"./log-DaILwWJa.js";import{f as b,s as x}from"./pluginOperations-BcfJCDco.js";function S(e){return O=e,k!==null&&k.length>0&&(e(k),k=null),()=>{O=null}}async function C(){let e=await a(),t=c(),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=l(),r=Object.keys(n.plugins);return r.length===0?[]:(await Promise.allSettled(r.map(async r=>{let{marketplace:i}=s(r);if(!i||!e.has(i.toLowerCase()))return null;let a=n.plugins[r];if(!a||a.length===0)return null;let o=a.filter(t);return o.length===0?null:w(r,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 o(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(),r(),i(),m(),O=null,k=null}));export{T as i,A as n,S as r,D as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Xa as e,co as t,do as n,no as r,po as i}from"./loadAgentsDir-C1LkW7gl.js";import{L as a,N as o,c as s,i as c}from"./debug-8DCufdSp.js";import{d as l,s as u}from"./pluginOperations-BcfJCDco.js";import{i as d,n as f,r as p,t as m}from"./pluginFlagging-DQP8tBi2.js";u(),c(),a(),e(),n(),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=r(),n=f(),a=await i(),c=[];for(let r of Object.keys(a))try{let i=await t(r);if(!i.forceRemoveDeletedPlugins)continue;let a=h(e,i,r);for(let t of a){if(t in n)continue;let r=e.plugins[t]??[];if(r.some(e=>e.scope===`user`||e.scope===`project`||e.scope===`local`)){for(let e of r){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 "${r}": ${o(e)}`,{level:`warn`})}return c}export{g as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./figures-5ThXQEtq.js";import{$l as n,Ja as r,Ya as i,eu as a,fS as o,gi as s,mS as c,tu as l,vi as u}from"./loadAgentsDir-C1LkW7gl.js";import{L as d,N as f}from"./debug-8DCufdSp.js";import{n as p,o as m}from"./process-gEbdy6uY.js";import{o as h,s as g}from"./log-DaILwWJa.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-BcfJCDco.js";e(),d(),u(),h(),i(),o(),p(),l(),_(),T();function E(e,i,o){g(e);let s=o?`${i} plugin "${o}"`:i===`disable-all`?`disable all plugins`:`${i} plugins`;console.error(`${t.cross} Failed to ${s}: ${f(e)}`);let l=o?(()=>{let{name:e,marketplace:t}=c(o);return{_PROTO_plugin_name:e,...t&&{_PROTO_marketplace_name:t},...n(e,t,r())}})():{};v(`tengu_plugin_command_failed`,{command:i,error_category:a(e),...l}),process.exit(1)}async function D(e,i=`user`){try{console.log(`Installing plugin "${e}"...`);let a=await b(e,i);if(!a.success)throw Error(a.message);console.log(`${t.tick} ${a.message}`);let{name:o,marketplace:s}=c(a.pluginId||e);v(`tengu_plugin_installed_cli`,{_PROTO_plugin_name:o,...s&&{_PROTO_marketplace_name:s},scope:a.scope||i,install_source:`cli-explicit`,...n(o,s,r())}),process.exit(0)}catch(t){E(t,`install`,e)}}async function O(e,i=`user`,a=!1){try{let o=await x(e,i,!a);if(!o.success)throw Error(o.message);console.log(`${t.tick} ${o.message}`);let{name:s,marketplace:l}=c(o.pluginId||e);v(`tengu_plugin_uninstalled_cli`,{_PROTO_plugin_name:s,...l&&{_PROTO_marketplace_name:l},scope:o.scope||i,...n(s,l,r())}),process.exit(0)}catch(t){E(t,`uninstall`,e)}}async function k(e,i){try{let a=await y(e,i);if(!a.success)throw Error(a.message);console.log(`${t.tick} ${a.message}`);let{name:o,marketplace:s}=c(a.pluginId||e);v(`tengu_plugin_enabled_cli`,{_PROTO_plugin_name:o,...s&&{_PROTO_marketplace_name:s},scope:a.scope,...n(o,s,r())}),process.exit(0)}catch(t){E(t,`enable`,e)}}async function A(e,i){try{let a=await C(e,i);if(!a.success)throw Error(a.message);console.log(`${t.tick} ${a.message}`);let{name:o,marketplace:s}=c(a.pluginId||e);v(`tengu_plugin_disabled_cli`,{_PROTO_plugin_name:o,...s&&{_PROTO_marketplace_name:s},scope:a.scope,...n(o,s,r())}),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,i){try{m(`Checking for updates for plugin "${e}" at ${i} scope…\n`);let a=await S(e,i);if(!a.success)throw Error(a.message);if(m(`${t.tick} ${a.message}\n`),!a.alreadyUpToDate){let{name:t,marketplace:i}=c(a.pluginId||e);v(`tengu_plugin_updated_cli`,{_PROTO_plugin_name:t,...i&&{_PROTO_marketplace_name:i},old_version:a.oldVersion||`unknown`,new_version:a.newVersion||`unknown`,...n(t,i,r())})}await s(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{Qx as t,Zx as n}from"./loadAgentsDir-C1LkW7gl.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-8DCufdSp.js";import{o as u,s as d}from"./log-DaILwWJa.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{Ba as t,Bp as n,Cy as r,Fa as i,Fo as a,Ga as o,Ha as s,Ia as c,Jx as l,Ka as u,La as d,Ma as f,No as p,Pa as m,Po as h,Qx as g,Ra as _,Ua as v,Xa as y,bS as b,co as x,dS as S,do as C,fS as w,fo as T,hS as E,io as D,lS as O,mS as k,no as A,qa as ee,ro as j,to as M,uS as N,uo as P,xy as te,yS as ne,zp as re}from"./loadAgentsDir-C1LkW7gl.js";import{Z as F,zt as ie}from"./state-BowF111d.js";import{H as ae,L as oe,f as se,u as ce,z as I}from"./debug-8DCufdSp.js";import{b as L,h as R,s as z}from"./settings-DKN4xSpQ.js";import{o as B,s as V}from"./log-DaILwWJa.js";import{l as H,o as U}from"./stringUtils-BQm3OfeJ.js";import{n as W,t as G}from"./pluginStartupCheck-CfRvCrFg.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`?F():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(E(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}=k(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}=k(e),n=A();if(n.plugins[e]?.length)return{pluginId:e,pluginName:t};let r=Object.keys(n.plugins).find(e=>{let{name:r}=k(e);return r===t&&(n.plugins[e]?.length??0)>0});return r?{pluginId:r,pluginName:t}:null}function Y(e){let t=A().plugins[e];if(!t||t.length===0)return{scope:`user`};let n=F(),r=t.find(e=>e.scope===`local`&&e.projectPath===n);if(r)return{scope:r.scope,projectPath:r.projectPath};let i=t.find(e=>e.scope===`project`&&e.projectPath===n);if(i)return{scope:i.scope,projectPath:i.projectPath};let a=t.find(e=>e.scope===`user`);return a?{scope:a.scope}:{scope:t[0].scope,projectPath:t[0].projectPath}}async function he(e,t=`user`){q(t);let{name:n,marketplace:r}=k(e),i,a,c;if(r){let t=await P(e);t&&(i=t.entry,a=r,c=t.marketplaceInstallLocation)}else{let e=await T();for(let[t,r]of Object.entries(e))try{let e=(await x(t)).plugins.find(e=>e.name===n);if(e){i=e,a=t,c=r.installLocation;break}}catch(e){V(ae(e))}}if(!i||!a)return{success:!1,message:`Plugin "${n}" not found in ${r?`marketplace "${r}"`:`any configured marketplace`}`};let l=i,u=`${l.name}@${a}`,d=await o({pluginId:u,entry:l,scope:t,marketplaceInstallLocation:c});if(!d.ok){let e=d;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:s(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: ${u} (scope: ${t})${d.depNote}`,pluginId:u,pluginName:l.name,scope:t}}async function ge(e,t=`user`,n=!0){q(t);let{enabled:r,disabled:i}=await _(),o=[...r,...i],s=pe(e,o),c=E(t),u=z(c),d,f;if(s)d=Object.keys(u?.enabledPlugins??{}).find(t=>t===e||t===s.name||t.startsWith(`${s.name}@`))??(e.includes(`@`)?e:s.name),f=s.name;else{let t=me(e);if(!t)return{success:!1,message:`Plugin "${e}" not found in installed plugins`};d=t.pluginId,f=t.pluginName}let m=J(t),h=A().plugins[d],g=h?.find(e=>e.scope===t&&e.projectPath===m);if(!g){let{scope:n}=Y(d);return n!==t&&h&&h.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=g.installPath,y={...u?.enabledPlugins};y[d]=void 0,L(c,{enabledPlugins:y}),p(),j(d,t,m);let b=A().plugins[d],x=!b||b.length===0;x&&v&&await a(v),x&&(te(d),n&&await l(d));let S=O(d,o),C=N(S);return{success:!0,message:`Successfully uninstalled plugin: ${f} (scope: ${t})${C}`,pluginId:d,pluginName:f,scope:t,reverseDependents:S.length>0?S:void 0}}async function X(e,t,r){let i=t?`enable`:`disable`;if(b(e)){let{error:n}=L(`userSettings`,{enabledPlugins:{...z(`userSettings`)?.enabledPlugins,[e]:t}});if(n)return{success:!1,message:`Failed to ${i} built-in plugin: ${n.message}`};p();let{name:r}=k(e);return{success:!0,message:`Successfully ${i}d built-in plugin: ${r}`,pluginId:e,pluginName:r,scope:`user`}}r&&q(r);let a,o,s=fe(e);if(r)if(o=r,s)a=s.pluginId;else if(e.includes(`@`))a=e;else return{success:!1,message:`Plugin "${e}" not found in settings. Use plugin@marketplace format.`};else if(s)a=s.pluginId,o=s.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&&n(a))return{success:!1,message:`Plugin "${a}" is blocked by your organization's policy and cannot be enabled`};let c=E(o),l=z(c)?.enabledPlugins?.[a],u={user:0,project:1,local:2},d=r&&s&&u[r]>u[s.scope];if(r&&l===void 0&&s&&s.scope!==r&&!d)return{success:!1,message:`Plugin "${e}" is installed at ${s.scope} scope, not ${r}. Use --scope ${s.scope} or omit --scope to auto-detect.`};if(t===(r&&!d?l===!0:G().has(a)))return{success:!1,message:`Plugin "${e}" is already ${t?`enabled`:`disabled`}${r?` at ${r} scope`:``}`};let f;if(!t){let{enabled:e,disabled:t}=await _(),n=O(a,[...e,...t]);n.length>0&&(f=n)}let{error:m}=L(c,{enabledPlugins:{...z(c)?.enabledPlugins,[a]:t}});if(m)return{success:!1,message:`Failed to ${i} plugin: ${m.message}`};p();let{name:h}=k(a),g=N(f);return{success:!0,message:`Successfully ${i}d plugin: ${h} (scope: ${o})${g}`,pluginId:a,pluginName:h,scope:o,reverseDependents:f}}async function _e(e,t){return X(e,!0,t)}async function ve(e,t){return X(e,!1,t)}async function Z(){let e=G();if(e.size===0)return{success:!0,message:`No enabled plugins to disable`};let t=[],n=[];for(let[r]of e){let e=await X(r,!1);e.success?t.push(r):n.push(`${r}: ${e.message}`)}return n.length>0?{success:!1,message:`Disabled ${t.length} ${H(t.length,`plugin`)}, ${n.length} failed:\n${n.join(`
|
|
2
|
+
`)}`}:{success:!0,message:`Disabled ${t.length} ${H(t.length,`plugin`)}`}}async function ye(e,t){let{name:n,marketplace:r}=k(e),i=r?`${n}@${r}`:e,a=await P(e);if(!a)return{success:!1,message:`Plugin "${n}" not found`,pluginId:i,scope:t};let{entry:o,marketplaceInstallLocation:s}=a,c=M().plugins[i];if(!c||c.length===0)return{success:!1,message:`Plugin "${n}" is not installed`,pluginId:i,scope:t};let l=J(t),u=c.find(e=>e.scope===t&&e.projectPath===l);return u?be({pluginId:i,pluginName:n,entry:o,marketplaceInstallLocation:s,installation:u,scope:t,projectPath:l}):{success:!1,message:`Plugin "${n}" is not installed at scope ${l?`${t} (${l})`:t}`,pluginId:i,scope:t}}async function be({pluginId:e,pluginName:n,entry:r,marketplaceInstallLocation:o,installation:s,scope:l,projectPath:d}){let p=ce(),h=s.version,g,_,v=!1,y;if(typeof r.source!=`string`){let t=await f(r.source,{manifest:{name:r.name}});g=t.path,v=!0,y=t.gitCommitSha,_=await u(e,r.source,t.manifest,t.path,r.version,t.gitCommitSha)}else{let n;try{n=await p.stat(o)}catch(t){if(I(t))return{success:!1,message:`Marketplace directory not found at ${o}`,pluginId:e,scope:l};throw t}g=K(n.isDirectory()?o:le(o),r.source);try{await p.stat(g)}catch(t){if(I(t))return{success:!1,message:`Plugin source not found at ${g}`,pluginId:e,scope:l};throw t}let i,a=K(g,`.claude-plugin`,`plugin.json`);try{i=await t(a,r.name,r.source)}catch{}_=await u(e,r.source,i,g,r.version)}try{let t=i(e,_),o=c(e,_);if(s.version===_||s.installPath===t||s.installPath===o)return{success:!0,message:`${n} is already at the latest version (${_}).`,pluginId:e,newVersion:_,oldVersion:h,alreadyUpToDate:!0,scope:l};t=await m(g,e,_,r);let u=s.installPath;if(D(e,l,d,t,_,y),u&&u!==t){let e=M();Object.values(e.plugins).some(e=>e.some(e=>e.installPath===u))||await a(u)}let f=d?`${l} (${d})`:l;return{success:!0,message:`Plugin "${n}" updated from ${h||`unknown`} to ${_} for scope ${f}. Restart to apply changes.`,pluginId:e,newVersion:_,oldVersion:h,scope:l}}finally{v&&g!==i(e,_)&&await p.rm(g,{recursive:!0,force:!0})}}var Q,$,xe=e((()=>{ie(),ne(),oe(),se(),B(),h(),S(),y(),C(),g(),w(),v(),d(),r(),re(),W(),ee(),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{Ua as t,Xa as n,_S as r,do as i,fS as a,gS as o}from"./loadAgentsDir-C1LkW7gl.js";import{n as s}from"./cwd-BcO6WHKo.js";import{c,i as l}from"./debug-8DCufdSp.js";import{_t as u,h as d,s as f}from"./settings-DKN4xSpQ.js";import{o as p}from"./log-DaILwWJa.js";import"path";function m(){let e=new Map,t=o();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(),r(),n(),i(),a(),t(),u()}));export{h as n,m as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./pluginStartupCheck-CfRvCrFg.js";e();export{t as getPluginEditableScopes};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{n as e,t}from"./figures-5ThXQEtq.js";import{Co as n,La as r,No as i,Po as a,Ra as o,SS as s,Xa as c,_o as l,ao as u,by as d,do as f,eo as ee,fS as p,fo as m,hS as h,ho as g,jo as _,ko as te,mS as v,mo as y,no as b,xS as x,yo as S,yy as C}from"./loadAgentsDir-C1LkW7gl.js";import{qn as w,zt as T}from"./state-BowF111d.js";import{C as E,L as ne,N as D,x as re}from"./debug-8DCufdSp.js";import{o as O,s as k}from"./log-DaILwWJa.js";import{l as A,o as j}from"./stringUtils-BQm3OfeJ.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-BcfJCDco.js";import{a as z,i as B,n as V,o as H,r as U,t as ie}from"./pluginCliCommands-z8TtJMKH.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-DIdEydz_.js";import{basename as oe,dirname as X}from"path";e(),T(),M(),L(),s(),ne(),O(),a(),G(),c(),te(),f(),C(),K(),p(),r(),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 r=b(),{getPluginEditableScopes:i}=await import(`./pluginStartupCheck-Cq4PvULa.js`),a=i(),s=Object.keys(r.plugins),{enabled:c,disabled:l,errors:u}=await o(),f=[...c,...l],p=f.filter(e=>e.source.endsWith(`@inline`)),h=u.filter(e=>e.source.endsWith(`@inline`)||e.source.startsWith(`inline[`));if(e.json){let t=new Map(f.map(e=>[e.source,e])),i=[];for(let e of s.sort()){let n=r.plugins[e];if(!n||n.length===0)continue;let o=v(e).name,s=u.filter(t=>t.source===e||`plugin`in t&&t.plugin===o).map(x);for(let r of n){let n=t.get(e),o;if(n){let e=n.mcpServers||await d(n);e&&Object.keys(e).length>0&&(o=e)}i.push({id:e,version:r.version||`unknown`,scope:r.scope,enabled:a.has(e),installPath:r.installPath,installedAt:r.installedAt,lastUpdated:r.lastUpdated,projectPath:r.projectPath,mcpServers:o,errors:s.length>0?s:void 0})}}for(let e of p){let t=e.mcpServers||await d(e),n=h.filter(t=>t.source===e.source||`plugin`in t&&t.plugin===e.name).map(x);i.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 h.filter(e=>e.source.startsWith(`inline[`)))i.push({id:e.source,version:`unknown`,scope:`session`,enabled:!1,installPath:`path`in e?e.path:``,errors:[x(e)]});if(e.available){let e=[];try{let[t,r]=await Promise.all([m(),Y()]),{marketplaces:i}=await _(t);for(let{name:t,data:a}of i)if(a)for(let i of a.plugins){let a=n(i.name,t);ee(a)||e.push({pluginId:a,name:i.name,description:i.description,marketplaceName:t,version:i.version,source:i.source,installCount:r?.get(a)})}}catch{}P(E({installed:i,available:e},null,2))}else P(E(i,null,2))}s.length===0&&p.length===0&&h.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 n=r.plugins[e];if(!n||n.length===0)continue;let i=v(e).name,o=u.filter(t=>t.source===e||`plugin`in t&&t.plugin===i);for(let r of n){let n=a.has(e),i=o.length>0?`${t.cross} failed to load`:n?`${t.tick} enabled`:`${t.cross} disabled`,s=r.version||`unknown`,c=r.scope;console.log(` ${t.pointer} ${e}`),console.log(` Version: ${s}`),console.log(` Scope: ${c}`),console.log(` Status: ${i}`);for(let e of o)console.log(` Error: ${x(e)}`);console.log(``)}}if(p.length>0||h.length>0){console.log(`Session-only plugins (--plugin-dir):
|
|
3
|
+
`);for(let e of p){let n=h.filter(t=>t.source===e.source||`plugin`in t&&t.plugin===e.name),r=n.length>0?`${t.cross} loaded with errors`:`${t.tick} loaded`;console.log(` ${t.pointer} ${e.source}`),console.log(` Version: ${e.manifest.version??`unknown`}`),console.log(` Path: ${e.path}`),console.log(` Status: ${r}`);for(let e of n)console.log(` Error: ${x(e)}`);console.log(``)}for(let e of h.filter(e=>e.source.startsWith(`inline[`)))console.log(` ${t.pointer} ${e.source}: ${t.cross} ${x(e)}\n`)}P()}async function ce(e,n){n.cowork&&w(!0);try{let r=await W(e);r||F(`${t.cross} Invalid marketplace source format. Try: owner/repo, https://..., or ./path`),`error`in r&&F(`${t.cross} ${r.error}`);let a=n.scope??`user`;a!==`user`&&a!==`project`&&a!==`local`&&F(`${t.cross} Invalid scope '${a}'. Use: user, project, or local`);let o=h(a),s=r;n.sparse&&n.sparse.length>0&&(s.source===`github`||s.source===`git`?s={...s,sparsePaths:n.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:d}=await u(s,e=>{console.log(e)});S(c,{source:d},o),i();let f=s.source;s.source===`github`&&(f=s.repo),N(`tengu_marketplace_added`,{source_type:f}),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 m(),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 l(e),i(),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 g(e,e=>{console.log(e)}),i(),N(`tengu_marketplace_updated`,{marketplace_name:e}),P(`${t.tick} Successfully updated marketplace: ${e}`);else{let e=await m(),n=Object.keys(e);n.length===0&&P(`No marketplaces configured`),console.log(`Updating ${n.length} marketplace(s)...`),await y(),i(),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}=v(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}=v(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}=v(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}=v(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}=v(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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,o as t}from"./envUtils-DcaKZlRU.js";import{mt as n,pt as r}from"./esm-BQY8jJNR.js";import{n as ee,t as i}from"./axios-DaWTGg7G.js";import{ag as a,og as o}from"./loadAgentsDir-C1LkW7gl.js";import{F as te,G as s,Y as c,Z as l,f as u,l as d,o as f,s as p,x as m}from"./types-zk5Ltv5q.js";import{C as h,L as g,M as ne,c as _,et as re,i as ie,tt as ae,x as oe}from"./debug-8DCufdSp.js";import{$t as se,en as ce,tn as le}from"./settings-DKN4xSpQ.js";import{d as v,f as y}from"./log-DaILwWJa.js";import{Dr as b,Er as x,Ht as S,St as C,Vt as w,ct as T,pt as E,tt as D,wr as O}from"./model-BwBE0Pt5.js";import{join as k}from"path";import{readFileSync as A}from"fs";import{createHash as j}from"crypto";import{unlink as M,writeFile as N}from"fs/promises";t(),i(),re(),g(),oe(),ie(),v(),d(),le(),x(),n(),w(),C(),o(),m(),f();var P=p(()=>s({restrictions:c(l(),s({allowed:te()}))}));function F(e){return e instanceof Error}var I=`policy-limits.json`,L=1e4,R=5,z=3600*1e3,B=null,V=!1,H=null,U=null,W=3e4,G=null;function ue(){H||J()&&(H=new Promise(e=>{U=e,setTimeout(()=>{U&&(_(`Policy limits: Loading promise timed out, resolving anyway`),U(),U=null)},W)}))}function K(){return k(e(),I)}function de(){return`${ce().BASE_API_URL}/api/claude_code/policy_limits`}function q(e){if(Array.isArray(e))return e.map(q);if(typeof e==`object`&&e){let t={};for(let[n,r]of Object.entries(e).sort(([e],[t])=>e.localeCompare(t)))t[n]=q(r);return t}return e}function fe(e){let t=h(q(e));return`sha256:${j(`sha256`).update(t).digest(`hex`)}`}function J(){if(O()!==`firstParty`||!b())return!1;try{let{key:e}=T({skipRetrievingKeyFromApiKeyHelper:!0});if(e)return!0}catch{}let e=E();return!(!e?.accessToken||!e.scopes?.includes(`user:inference`)||e.subscriptionType!==`enterprise`&&e.subscriptionType!==`team`)}function pe(){try{let{key:e}=T({skipRetrievingKeyFromApiKeyHelper:!0});if(e)return{headers:{"x-api-key":e}}}catch{}let e=E();return e?.accessToken?{headers:{Authorization:`Bearer ${e.accessToken}`,"anthropic-beta":se}}:{headers:{},error:`No authentication available`}}async function me(e){let t=null;for(let n=1;n<=6;n++){if(t=await he(e),t.success||t.skipRetry||n>R)return t;let r=a(n);_(`Policy limits: Retry ${n}/${R} after ${r}ms`),await S(r)}return t}async function he(e){try{await D();let t=pe();if(t.error)return{success:!1,error:`Authentication required for policy limits`,skipRetry:!0};let n=de(),i={...t.headers,"User-Agent":r()};e&&(i[`If-None-Match`]=`"${e}"`);let a=await ee.get(n,{headers:i,timeout:L,validateStatus:e=>e===200||e===304||e===404});if(a.status===304)return _(`Policy limits: Using cached restrictions (304)`),{success:!0,restrictions:null,etag:e};if(a.status===404)return _(`Policy limits: No restrictions found (404)`),{success:!0,restrictions:{},etag:void 0};let o=P().safeParse(a.data);return o.success?(_(`Policy limits: Fetched successfully`),{success:!0,restrictions:o.data.restrictions}):(_(`Policy limits: Invalid response format - ${o.error.message}`),{success:!1,error:`Invalid policy limits format`})}catch(e){let{kind:t,message:n}=ne(e);switch(t){case`auth`:return{success:!1,error:`Not authorized for policy limits`,skipRetry:!0};case`timeout`:return{success:!1,error:`Policy limits request timeout`};case`network`:return{success:!1,error:`Cannot connect to server`};default:return{success:!1,error:n}}}}function Y(){try{let e=u(A(K(),`utf-8`),!1),t=P().safeParse(e);return t.success?t.data.restrictions:null}catch{return null}}async function ge(e){try{let t=K();await N(t,h({restrictions:e},null,2),{encoding:`utf-8`,mode:384}),_(`Policy limits: Saved to ${t}`)}catch(e){_(`Policy limits: Failed to save - ${e instanceof Error?e.message:`unknown error`}`)}}async function X(){if(!J())return null;let e=Y(),t=e?fe(e):void 0;try{let n=await me(t);if(!n.success)return e?(_(`Policy limits: Using stale cache after fetch failure`),G=e,e):null;if(n.restrictions===null&&e)return _(`Policy limits: Cache still valid (304 Not Modified)`),G=e,e;let r=n.restrictions||{};if(Object.keys(r).length>0)return G=r,await ge(r),_(`Policy limits: Applied new restrictions successfully`),r;G=r;try{await M(K()),_(`Policy limits: Deleted cached file (404 response)`)}catch(e){F(e)&&e.code!==`ENOENT`&&_(`Policy limits: Failed to delete cached file - ${e.message}`)}return r}catch{return e?(_(`Policy limits: Using stale cache after error`),G=e,e):null}}var _e=new Set([`allow_product_feedback`]);function ve(e){let t=Z();if(!t)return!(y()&&_e.has(e));let n=t[e];return!n||n.allowed}function Z(){if(!J())return null;if(G)return G;let e=Y();return e?(G=e,e):null}async function ye(){J()&&!H&&(H=new Promise(e=>{U=e}));try{await X(),J()&&Se()}finally{U&&(U(),U=null)}}async function be(){await Q(),J()&&(await X(),_(`Policy limits: Refreshed after auth change`))}async function Q(){$(),G=null,H=null,U=null;try{await M(K())}catch{}}async function xe(){if(!J())return;let e=G?h(G):null;try{await X(),(G?h(G):null)!==e&&_(`Policy limits: Changed during background poll`)}catch{}}function Se(){B===null&&J()&&(B=setInterval(()=>{xe()},z),B.unref(),V||(V=!0,ae(async()=>$())))}function $(){B!==null&&(clearInterval(B),B=null)}export{ye as a,J as i,ue as n,be as o,ve as r,Q as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./poorMode-J5SYJvoY.js";t();export{e as isPoorModeActive};
|
|
@@ -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-DKN4xSpQ.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};
|