@within-7/minto 0.2.0 → 0.3.0
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/commands/agents/AgentsCommand.js +22 -24
- package/dist/commands/agents/AgentsCommand.js.map +2 -2
- package/dist/commands/context.js +2 -1
- package/dist/commands/context.js.map +2 -2
- package/dist/commands/export.js +2 -1
- package/dist/commands/export.js.map +2 -2
- package/dist/commands/mcp-interactive.js +7 -6
- package/dist/commands/mcp-interactive.js.map +2 -2
- package/dist/commands/model.js +3 -2
- package/dist/commands/model.js.map +2 -2
- package/dist/commands/permissions.js +4 -3
- package/dist/commands/permissions.js.map +2 -2
- package/dist/commands/plugin/AddMarketplaceForm.js +3 -2
- package/dist/commands/plugin/AddMarketplaceForm.js.map +2 -2
- package/dist/commands/plugin/ConfirmDialog.js +2 -1
- package/dist/commands/plugin/ConfirmDialog.js.map +2 -2
- package/dist/commands/plugin/ErrorView.js +2 -1
- package/dist/commands/plugin/ErrorView.js.map +2 -2
- package/dist/commands/plugin/InstalledPluginsByMarketplace.js +5 -4
- package/dist/commands/plugin/InstalledPluginsByMarketplace.js.map +2 -2
- package/dist/commands/plugin/InstalledPluginsManager.js +5 -4
- package/dist/commands/plugin/InstalledPluginsManager.js.map +2 -2
- package/dist/commands/plugin/MainMenu.js +2 -1
- package/dist/commands/plugin/MainMenu.js.map +2 -2
- package/dist/commands/plugin/MarketplaceManager.js +5 -4
- package/dist/commands/plugin/MarketplaceManager.js.map +2 -2
- package/dist/commands/plugin/MarketplaceSelector.js +4 -3
- package/dist/commands/plugin/MarketplaceSelector.js.map +2 -2
- package/dist/commands/plugin/PlaceholderScreen.js +3 -2
- package/dist/commands/plugin/PlaceholderScreen.js.map +2 -2
- package/dist/commands/plugin/PluginBrowser.js +6 -5
- package/dist/commands/plugin/PluginBrowser.js.map +2 -2
- package/dist/commands/plugin/PluginDetailsInstall.js +5 -4
- package/dist/commands/plugin/PluginDetailsInstall.js.map +2 -2
- package/dist/commands/plugin/PluginDetailsManage.js +4 -3
- package/dist/commands/plugin/PluginDetailsManage.js.map +2 -2
- package/dist/commands/plugin.js +16 -15
- package/dist/commands/plugin.js.map +2 -2
- package/dist/commands/sandbox.js +4 -3
- package/dist/commands/sandbox.js.map +2 -2
- package/dist/commands/setup.js +2 -1
- package/dist/commands/setup.js.map +2 -2
- package/dist/commands/status.js +2 -1
- package/dist/commands/status.js.map +2 -2
- package/dist/commands/undo.js +245 -0
- package/dist/commands/undo.js.map +7 -0
- package/dist/commands.js +2 -0
- package/dist/commands.js.map +2 -2
- package/dist/components/AgentThinkingBlock.js +1 -1
- package/dist/components/AgentThinkingBlock.js.map +2 -2
- package/dist/components/AsciiLogo.js +7 -8
- package/dist/components/AsciiLogo.js.map +2 -2
- package/dist/components/AskUserQuestionDialog/AskUserQuestionDialog.js +3 -2
- package/dist/components/AskUserQuestionDialog/AskUserQuestionDialog.js.map +2 -2
- package/dist/components/AskUserQuestionDialog/QuestionView.js +2 -1
- package/dist/components/AskUserQuestionDialog/QuestionView.js.map +2 -2
- package/dist/components/CollapsibleHint.js +2 -1
- package/dist/components/CollapsibleHint.js.map +2 -2
- package/dist/components/Config.js +3 -2
- package/dist/components/Config.js.map +2 -2
- package/dist/components/ConsoleOAuthFlow.js +2 -1
- package/dist/components/ConsoleOAuthFlow.js.map +2 -2
- package/dist/components/Cost.js +2 -1
- package/dist/components/Cost.js.map +2 -2
- package/dist/components/HeaderBar.js +13 -8
- package/dist/components/HeaderBar.js.map +2 -2
- package/dist/components/HistorySearchOverlay.js +4 -3
- package/dist/components/HistorySearchOverlay.js.map +2 -2
- package/dist/components/HotkeyHelpPanel.js +8 -11
- package/dist/components/HotkeyHelpPanel.js.map +2 -2
- package/dist/components/InvalidConfigDialog.js +2 -1
- package/dist/components/InvalidConfigDialog.js.map +2 -2
- package/dist/components/Logo.js +23 -67
- package/dist/components/Logo.js.map +2 -2
- package/dist/components/MCPServerApprovalDialog.js +2 -1
- package/dist/components/MCPServerApprovalDialog.js.map +2 -2
- package/dist/components/MCPServerDialogCopy.js +2 -1
- package/dist/components/MCPServerDialogCopy.js.map +2 -2
- package/dist/components/MCPServerMultiselectDialog.js +2 -1
- package/dist/components/MCPServerMultiselectDialog.js.map +2 -2
- package/dist/components/MessageSelector.js +4 -3
- package/dist/components/MessageSelector.js.map +2 -2
- package/dist/components/ModeIndicator.js +2 -1
- package/dist/components/ModeIndicator.js.map +2 -2
- package/dist/components/ModelConfig.js +4 -3
- package/dist/components/ModelConfig.js.map +2 -2
- package/dist/components/ModelListManager.js +4 -3
- package/dist/components/ModelListManager.js.map +2 -2
- package/dist/components/ModelSelector/ModelSelector.js +26 -13
- package/dist/components/ModelSelector/ModelSelector.js.map +2 -2
- package/dist/components/Onboarding.js +3 -2
- package/dist/components/Onboarding.js.map +2 -2
- package/dist/components/OperationSummary.js +130 -0
- package/dist/components/OperationSummary.js.map +7 -0
- package/dist/components/PromptInput.js +88 -75
- package/dist/components/PromptInput.js.map +2 -2
- package/dist/components/SensitiveFileWarning.js +31 -0
- package/dist/components/SensitiveFileWarning.js.map +7 -0
- package/dist/components/Spinner.js +71 -22
- package/dist/components/Spinner.js.map +2 -2
- package/dist/components/StructuredDiff.js +6 -8
- package/dist/components/StructuredDiff.js.map +2 -2
- package/dist/components/SubagentBlock.js +4 -2
- package/dist/components/SubagentBlock.js.map +2 -2
- package/dist/components/SubagentProgress.js +7 -4
- package/dist/components/SubagentProgress.js.map +2 -2
- package/dist/components/TaskCard.js +14 -11
- package/dist/components/TaskCard.js.map +2 -2
- package/dist/components/TextInput.js +9 -1
- package/dist/components/TextInput.js.map +2 -2
- package/dist/components/TodoPanel.js +44 -26
- package/dist/components/TodoPanel.js.map +2 -2
- package/dist/components/ToolUseLoader.js +2 -2
- package/dist/components/ToolUseLoader.js.map +2 -2
- package/dist/components/TreeConnector.js +4 -3
- package/dist/components/TreeConnector.js.map +2 -2
- package/dist/components/TrustDialog.js +2 -1
- package/dist/components/TrustDialog.js.map +2 -2
- package/dist/components/binary-feedback/BinaryFeedbackView.js +2 -1
- package/dist/components/binary-feedback/BinaryFeedbackView.js.map +2 -2
- package/dist/components/messages/AssistantTextMessage.js +17 -9
- package/dist/components/messages/AssistantTextMessage.js.map +2 -2
- package/dist/components/messages/AssistantToolUseMessage.js +8 -4
- package/dist/components/messages/AssistantToolUseMessage.js.map +2 -2
- package/dist/components/messages/GroupRenderer.js +2 -1
- package/dist/components/messages/GroupRenderer.js.map +2 -2
- package/dist/components/messages/NestedTasksPreview.js +13 -1
- package/dist/components/messages/NestedTasksPreview.js.map +2 -2
- package/dist/components/messages/ParallelTasksGroupView.js +4 -3
- package/dist/components/messages/ParallelTasksGroupView.js.map +2 -2
- package/dist/components/messages/TaskInModuleView.js +35 -15
- package/dist/components/messages/TaskInModuleView.js.map +2 -2
- package/dist/components/messages/TaskOutputContent.js +9 -6
- package/dist/components/messages/TaskOutputContent.js.map +2 -2
- package/dist/components/messages/UserPromptMessage.js +2 -2
- package/dist/components/messages/UserPromptMessage.js.map +2 -2
- package/dist/constants/colors.js +90 -72
- package/dist/constants/colors.js.map +2 -2
- package/dist/constants/toolInputExamples.js +84 -0
- package/dist/constants/toolInputExamples.js.map +7 -0
- package/dist/core/backupManager.js +321 -0
- package/dist/core/backupManager.js.map +7 -0
- package/dist/core/costTracker.js +9 -18
- package/dist/core/costTracker.js.map +2 -2
- package/dist/core/gitAutoCommit.js +287 -0
- package/dist/core/gitAutoCommit.js.map +7 -0
- package/dist/core/index.js +3 -0
- package/dist/core/index.js.map +2 -2
- package/dist/core/operationTracker.js +212 -0
- package/dist/core/operationTracker.js.map +7 -0
- package/dist/core/permissions/rules/allowedToolsRule.js +1 -1
- package/dist/core/permissions/rules/allowedToolsRule.js.map +2 -2
- package/dist/core/permissions/rules/autoEscalationRule.js +5 -0
- package/dist/core/permissions/rules/autoEscalationRule.js.map +2 -2
- package/dist/core/permissions/rules/projectBoundaryRule.js +5 -0
- package/dist/core/permissions/rules/projectBoundaryRule.js.map +2 -2
- package/dist/core/permissions/rules/sensitivePathsRule.js +5 -0
- package/dist/core/permissions/rules/sensitivePathsRule.js.map +2 -2
- package/dist/core/tokenStats.js +9 -0
- package/dist/core/tokenStats.js.map +7 -0
- package/dist/core/tokenStatsManager.js +331 -0
- package/dist/core/tokenStatsManager.js.map +7 -0
- package/dist/entrypoints/cli.js +115 -87
- package/dist/entrypoints/cli.js.map +2 -2
- package/dist/hooks/useAgentTokenStats.js +72 -0
- package/dist/hooks/useAgentTokenStats.js.map +7 -0
- package/dist/hooks/useAgentTranscripts.js +30 -6
- package/dist/hooks/useAgentTranscripts.js.map +2 -2
- package/dist/hooks/useLogMessages.js +12 -1
- package/dist/hooks/useLogMessages.js.map +2 -2
- package/dist/i18n/locales/en.js +6 -5
- package/dist/i18n/locales/en.js.map +2 -2
- package/dist/i18n/locales/zh-CN.js +6 -5
- package/dist/i18n/locales/zh-CN.js.map +2 -2
- package/dist/i18n/types.js.map +1 -1
- package/dist/permissions.js +28 -1
- package/dist/permissions.js.map +2 -2
- package/dist/query.js +78 -4
- package/dist/query.js.map +3 -3
- package/dist/screens/REPL.js +23 -3
- package/dist/screens/REPL.js.map +2 -2
- package/dist/services/claude.js +54 -3
- package/dist/services/claude.js.map +2 -2
- package/dist/services/intelligentCompactor.js +1 -1
- package/dist/services/intelligentCompactor.js.map +2 -2
- package/dist/services/mcpClient.js +81 -25
- package/dist/services/mcpClient.js.map +2 -2
- package/dist/services/sandbox/filesystemBoundary.js +58 -17
- package/dist/services/sandbox/filesystemBoundary.js.map +2 -2
- package/dist/tools/AskExpertModelTool/AskExpertModelTool.js +3 -2
- package/dist/tools/AskExpertModelTool/AskExpertModelTool.js.map +2 -2
- package/dist/tools/AskUserQuestionTool/AskUserQuestionTool.js +2 -1
- package/dist/tools/AskUserQuestionTool/AskUserQuestionTool.js.map +2 -2
- package/dist/tools/BashTool/BashTool.js +22 -3
- package/dist/tools/BashTool/BashTool.js.map +2 -2
- package/dist/tools/BashTool/prompt.js +178 -34
- package/dist/tools/BashTool/prompt.js.map +2 -2
- package/dist/tools/FileEditTool/prompt.js +6 -3
- package/dist/tools/FileEditTool/prompt.js.map +2 -2
- package/dist/tools/FileWriteTool/prompt.js +4 -2
- package/dist/tools/FileWriteTool/prompt.js.map +2 -2
- package/dist/tools/MultiEditTool/prompt.js +5 -3
- package/dist/tools/MultiEditTool/prompt.js.map +2 -2
- package/dist/tools/NotebookEditTool/NotebookEditTool.js +2 -1
- package/dist/tools/NotebookEditTool/NotebookEditTool.js.map +2 -2
- package/dist/tools/PlanModeTool/EnterPlanModeTool.js +3 -2
- package/dist/tools/PlanModeTool/EnterPlanModeTool.js.map +2 -2
- package/dist/tools/PlanModeTool/ExitPlanModeTool.js +3 -2
- package/dist/tools/PlanModeTool/ExitPlanModeTool.js.map +2 -2
- package/dist/tools/PlanModeTool/prompt.js +1 -1
- package/dist/tools/PlanModeTool/prompt.js.map +1 -1
- package/dist/tools/SkillTool/SkillTool.js +4 -3
- package/dist/tools/SkillTool/SkillTool.js.map +2 -2
- package/dist/tools/SkillTool/prompt.js +1 -1
- package/dist/tools/SkillTool/prompt.js.map +1 -1
- package/dist/tools/TaskOutputTool/TaskOutputTool.js +3 -2
- package/dist/tools/TaskOutputTool/TaskOutputTool.js.map +2 -2
- package/dist/tools/TaskTool/TaskTool.js +8 -0
- package/dist/tools/TaskTool/TaskTool.js.map +2 -2
- package/dist/utils/CircuitBreaker.js +242 -0
- package/dist/utils/CircuitBreaker.js.map +7 -0
- package/dist/utils/ask.js +2 -0
- package/dist/utils/ask.js.map +2 -2
- package/dist/utils/config.js +47 -5
- package/dist/utils/config.js.map +2 -2
- package/dist/utils/credentials/CredentialStore.js +1 -0
- package/dist/utils/credentials/CredentialStore.js.map +7 -0
- package/dist/utils/credentials/EncryptedFileStore.js +157 -0
- package/dist/utils/credentials/EncryptedFileStore.js.map +7 -0
- package/dist/utils/credentials/index.js +37 -0
- package/dist/utils/credentials/index.js.map +7 -0
- package/dist/utils/credentials/migration.js +82 -0
- package/dist/utils/credentials/migration.js.map +7 -0
- package/dist/utils/markdown.js +13 -1
- package/dist/utils/markdown.js.map +2 -2
- package/dist/utils/permissions/filesystem.js +5 -1
- package/dist/utils/permissions/filesystem.js.map +2 -2
- package/dist/utils/safePath.js +132 -0
- package/dist/utils/safePath.js.map +7 -0
- package/dist/utils/sensitiveFiles.js +125 -0
- package/dist/utils/sensitiveFiles.js.map +7 -0
- package/dist/utils/taskDisplayUtils.js +9 -9
- package/dist/utils/taskDisplayUtils.js.map +2 -2
- package/dist/utils/theme.js +6 -6
- package/dist/utils/theme.js.map +1 -1
- package/dist/utils/toolRiskClassification.js +207 -0
- package/dist/utils/toolRiskClassification.js.map +7 -0
- package/dist/utils/tooling/safeRender.js +5 -4
- package/dist/utils/tooling/safeRender.js.map +2 -2
- package/dist/version.js +2 -2
- package/dist/version.js.map +1 -1
- package/package.json +9 -7
- package/dist/hooks/useCancelRequest.js +0 -31
- package/dist/hooks/useCancelRequest.js.map +0 -7
|
@@ -3,6 +3,7 @@ import { Box, Text, useInput } from "ink";
|
|
|
3
3
|
import { getTheme } from "../../utils/theme.js";
|
|
4
4
|
import { getMarketplace } from "../../utils/marketplaceManager.js";
|
|
5
5
|
import { loadAllPlugins } from "../../utils/pluginLoader.js";
|
|
6
|
+
import { SEMANTIC_COLORS } from "../../constants/colors.js";
|
|
6
7
|
const PluginBrowser = ({
|
|
7
8
|
marketplace,
|
|
8
9
|
onNavigate,
|
|
@@ -104,7 +105,7 @@ const PluginBrowser = ({
|
|
|
104
105
|
},
|
|
105
106
|
/* @__PURE__ */ React.createElement(Text, { color: theme.error }, "Error"),
|
|
106
107
|
/* @__PURE__ */ React.createElement(Text, null, error),
|
|
107
|
-
/* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, {
|
|
108
|
+
/* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, "Press Esc to go back"))
|
|
108
109
|
);
|
|
109
110
|
}
|
|
110
111
|
if (plugins.length === 0) {
|
|
@@ -118,8 +119,8 @@ const PluginBrowser = ({
|
|
|
118
119
|
paddingY: 1
|
|
119
120
|
},
|
|
120
121
|
/* @__PURE__ */ React.createElement(Text, { bold: true }, marketplace, " \u203A Install plugins"),
|
|
121
|
-
/* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, {
|
|
122
|
-
/* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, {
|
|
122
|
+
/* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, "No plugins available in this marketplace")),
|
|
123
|
+
/* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, "Press Esc to go back"))
|
|
123
124
|
);
|
|
124
125
|
}
|
|
125
126
|
const truncate = (text, maxLength) => {
|
|
@@ -153,7 +154,7 @@ const PluginBrowser = ({
|
|
|
153
154
|
}
|
|
154
155
|
);
|
|
155
156
|
})),
|
|
156
|
-
/* @__PURE__ */ React.createElement(Box, { marginTop: 1, flexDirection: "column" }, selectedPlugins.size > 0 && /* @__PURE__ */ React.createElement(Text, { color: theme.success }, selectedPlugins.size, " plugin", selectedPlugins.size > 1 ? "s" : "", " ", "selected"), /* @__PURE__ */ React.createElement(Text, {
|
|
157
|
+
/* @__PURE__ */ React.createElement(Box, { marginTop: 1, flexDirection: "column" }, selectedPlugins.size > 0 && /* @__PURE__ */ React.createElement(Text, { color: theme.success }, selectedPlugins.size, " plugin", selectedPlugins.size > 1 ? "s" : "", " ", "selected"), /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, "Space: (de)select \xB7 Enter: details \xB7 \u2191\u2193: navigate \xB7 Esc: back"))
|
|
157
158
|
);
|
|
158
159
|
};
|
|
159
160
|
const PluginListItem = ({
|
|
@@ -174,7 +175,7 @@ const PluginListItem = ({
|
|
|
174
175
|
if (isInstalled) {
|
|
175
176
|
infoItems.push("(installed)");
|
|
176
177
|
}
|
|
177
|
-
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", marginBottom: 0 }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: isFocused ? theme.success : void 0 }, isFocused ? "\u276F " : " "), /* @__PURE__ */ React.createElement(Text, { color: isFocused ? theme.success : void 0 }, isSelected ? "\u25C9" : "\u25EF", " "), /* @__PURE__ */ React.createElement(Text, { bold: isFocused, color: isInstalled ? theme.dimColor : void 0 }, plugin.name), infoItems.length > 0 && /* @__PURE__ */ React.createElement(Text, {
|
|
178
|
+
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", marginBottom: 0 }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: isFocused ? theme.success : void 0 }, isFocused ? "\u276F " : " "), /* @__PURE__ */ React.createElement(Text, { color: isFocused ? theme.success : void 0 }, isSelected ? "\u25C9" : "\u25EF", " "), /* @__PURE__ */ React.createElement(Text, { bold: isFocused, color: isInstalled ? theme.dimColor : void 0 }, plugin.name), infoItems.length > 0 && /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, " ", infoItems.join(" "))), plugin.description && /* @__PURE__ */ React.createElement(Box, { marginLeft: 4 }, /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, truncate(plugin.description, 70))));
|
|
178
179
|
};
|
|
179
180
|
export {
|
|
180
181
|
PluginBrowser
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/commands/plugin/PluginBrowser.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * Plugin Browser Component\n *\n * Browse and select plugins from a marketplace with multi-select support\n */\n\nimport React, { useState, useEffect } from 'react'\nimport { Box, Text, useInput } from 'ink'\nimport { getTheme } from '@utils/theme'\nimport { getMarketplace } from '@utils/marketplaceManager'\nimport { loadAllPlugins } from '@utils/pluginLoader'\nimport { MarketplacePlugin } from '../../types/marketplace'\nimport { NavigationProps } from './types'\n\ninterface PluginBrowserProps extends NavigationProps {\n marketplace: string\n}\n\nexport const PluginBrowser: React.FC<PluginBrowserProps> = ({\n marketplace,\n onNavigate,\n onBack,\n}) => {\n const theme = getTheme()\n const [plugins, setPlugins] = useState<MarketplacePlugin[]>([])\n const [installedPlugins, setInstalledPlugins] = useState<Set<string>>(\n new Set(),\n )\n const [selectedPlugins, setSelectedPlugins] = useState<Set<string>>(new Set())\n const [focusedIndex, setFocusedIndex] = useState(0)\n const [loading, setLoading] = useState(true)\n const [error, setError] = useState<string | null>(null)\n\n useEffect(() => {\n loadPluginData()\n }, [marketplace])\n\n const loadPluginData = () => {\n try {\n setLoading(true)\n setError(null)\n\n // Load marketplace\n const marketplaceData = getMarketplace(marketplace)\n if (!marketplaceData) {\n setError(`Marketplace \"${marketplace}\" not found`)\n setLoading(false)\n return\n }\n\n // Load plugins from marketplace\n const marketplacePlugins = marketplaceData.manifest.plugins\n setPlugins(marketplacePlugins)\n\n // Load installed plugins to show which are already installed\n const installed = loadAllPlugins()\n const installedNames = new Set(\n installed\n .filter(\n p =>\n p.source.type === 'marketplace' &&\n 'marketplace' in p.source &&\n p.source.marketplace === marketplace,\n )\n .map(p => p.manifest.name),\n )\n setInstalledPlugins(installedNames)\n\n // Focus first plugin if available\n if (marketplacePlugins.length > 0) {\n setFocusedIndex(0)\n }\n } catch (err) {\n setError(err instanceof Error ? err.message : String(err))\n } finally {\n setLoading(false)\n }\n }\n\n const focusedPlugin = plugins[focusedIndex]\n\n // Keyboard input handling\n useInput(\n (input, key) => {\n if (loading || plugins.length === 0) return\n\n if (key.escape) {\n onBack()\n } else if (key.upArrow) {\n setFocusedIndex(prev => (prev > 0 ? prev - 1 : plugins.length - 1))\n } else if (key.downArrow) {\n setFocusedIndex(prev => (prev < plugins.length - 1 ? prev + 1 : 0))\n } else if (input === ' ') {\n // Toggle selection with Space\n const pluginName = focusedPlugin.name\n setSelectedPlugins(prev => {\n const newSet = new Set(prev)\n if (newSet.has(pluginName)) {\n newSet.delete(pluginName)\n } else {\n newSet.add(pluginName)\n }\n return newSet\n })\n } else if (key.return) {\n // View details on Enter\n onNavigate({\n screen: 'plugin-details-install',\n marketplace,\n plugin: focusedPlugin.name,\n })\n }\n },\n { isActive: !loading && plugins.length > 0 },\n )\n\n if (loading) {\n return (\n <Box\n flexDirection=\"column\"\n borderStyle=\"round\"\n borderColor={theme.secondaryBorder}\n paddingX={2}\n paddingY={1}\n >\n <Text color={theme.primary}>Loading plugins from {marketplace}...</Text>\n </Box>\n )\n }\n\n if (error) {\n return (\n <Box\n flexDirection=\"column\"\n borderStyle=\"round\"\n borderColor={theme.error}\n paddingX={2}\n paddingY={1}\n >\n <Text color={theme.error}>Error</Text>\n <Text>{error}</Text>\n <Box marginTop={1}>\n <Text
|
|
5
|
-
"mappings": "AAMA,OAAO,SAAS,UAAU,iBAAiB;AAC3C,SAAS,KAAK,MAAM,gBAAgB;AACpC,SAAS,gBAAgB;AACzB,SAAS,sBAAsB;AAC/B,SAAS,sBAAsB;
|
|
4
|
+
"sourcesContent": ["/**\n * Plugin Browser Component\n *\n * Browse and select plugins from a marketplace with multi-select support\n */\n\nimport React, { useState, useEffect } from 'react'\nimport { Box, Text, useInput } from 'ink'\nimport { getTheme } from '@utils/theme'\nimport { getMarketplace } from '@utils/marketplaceManager'\nimport { loadAllPlugins } from '@utils/pluginLoader'\nimport { MarketplacePlugin } from '../../types/marketplace'\nimport { NavigationProps } from './types'\nimport { SEMANTIC_COLORS } from '@constants/colors'\n\ninterface PluginBrowserProps extends NavigationProps {\n marketplace: string\n}\n\nexport const PluginBrowser: React.FC<PluginBrowserProps> = ({\n marketplace,\n onNavigate,\n onBack,\n}) => {\n const theme = getTheme()\n const [plugins, setPlugins] = useState<MarketplacePlugin[]>([])\n const [installedPlugins, setInstalledPlugins] = useState<Set<string>>(\n new Set(),\n )\n const [selectedPlugins, setSelectedPlugins] = useState<Set<string>>(new Set())\n const [focusedIndex, setFocusedIndex] = useState(0)\n const [loading, setLoading] = useState(true)\n const [error, setError] = useState<string | null>(null)\n\n useEffect(() => {\n loadPluginData()\n }, [marketplace])\n\n const loadPluginData = () => {\n try {\n setLoading(true)\n setError(null)\n\n // Load marketplace\n const marketplaceData = getMarketplace(marketplace)\n if (!marketplaceData) {\n setError(`Marketplace \"${marketplace}\" not found`)\n setLoading(false)\n return\n }\n\n // Load plugins from marketplace\n const marketplacePlugins = marketplaceData.manifest.plugins\n setPlugins(marketplacePlugins)\n\n // Load installed plugins to show which are already installed\n const installed = loadAllPlugins()\n const installedNames = new Set(\n installed\n .filter(\n p =>\n p.source.type === 'marketplace' &&\n 'marketplace' in p.source &&\n p.source.marketplace === marketplace,\n )\n .map(p => p.manifest.name),\n )\n setInstalledPlugins(installedNames)\n\n // Focus first plugin if available\n if (marketplacePlugins.length > 0) {\n setFocusedIndex(0)\n }\n } catch (err) {\n setError(err instanceof Error ? err.message : String(err))\n } finally {\n setLoading(false)\n }\n }\n\n const focusedPlugin = plugins[focusedIndex]\n\n // Keyboard input handling\n useInput(\n (input, key) => {\n if (loading || plugins.length === 0) return\n\n if (key.escape) {\n onBack()\n } else if (key.upArrow) {\n setFocusedIndex(prev => (prev > 0 ? prev - 1 : plugins.length - 1))\n } else if (key.downArrow) {\n setFocusedIndex(prev => (prev < plugins.length - 1 ? prev + 1 : 0))\n } else if (input === ' ') {\n // Toggle selection with Space\n const pluginName = focusedPlugin.name\n setSelectedPlugins(prev => {\n const newSet = new Set(prev)\n if (newSet.has(pluginName)) {\n newSet.delete(pluginName)\n } else {\n newSet.add(pluginName)\n }\n return newSet\n })\n } else if (key.return) {\n // View details on Enter\n onNavigate({\n screen: 'plugin-details-install',\n marketplace,\n plugin: focusedPlugin.name,\n })\n }\n },\n { isActive: !loading && plugins.length > 0 },\n )\n\n if (loading) {\n return (\n <Box\n flexDirection=\"column\"\n borderStyle=\"round\"\n borderColor={theme.secondaryBorder}\n paddingX={2}\n paddingY={1}\n >\n <Text color={theme.primary}>Loading plugins from {marketplace}...</Text>\n </Box>\n )\n }\n\n if (error) {\n return (\n <Box\n flexDirection=\"column\"\n borderStyle=\"round\"\n borderColor={theme.error}\n paddingX={2}\n paddingY={1}\n >\n <Text color={theme.error}>Error</Text>\n <Text>{error}</Text>\n <Box marginTop={1}>\n <Text color={SEMANTIC_COLORS.dim}>Press Esc to go back</Text>\n </Box>\n </Box>\n )\n }\n\n if (plugins.length === 0) {\n return (\n <Box\n flexDirection=\"column\"\n borderStyle=\"round\"\n borderColor={theme.secondaryBorder}\n paddingX={2}\n paddingY={1}\n >\n <Text bold>{marketplace} \u203A Install plugins</Text>\n <Box marginTop={1}>\n <Text color={SEMANTIC_COLORS.dim}>\n No plugins available in this marketplace\n </Text>\n </Box>\n <Box marginTop={1}>\n <Text color={SEMANTIC_COLORS.dim}>Press Esc to go back</Text>\n </Box>\n </Box>\n )\n }\n\n // Helper to truncate text\n const truncate = (text: string, maxLength: number): string => {\n if (text.length <= maxLength) return text\n return text.slice(0, maxLength - 3) + '...'\n }\n\n return (\n <Box\n flexDirection=\"column\"\n borderStyle=\"round\"\n borderColor={theme.secondaryBorder}\n paddingX={2}\n paddingY={1}\n >\n <Text bold color={theme.primary}>\n {marketplace} \u203A Install plugins\n </Text>\n\n <Box marginTop={1} flexDirection=\"column\">\n {plugins.map((plugin, index) => {\n const isFocused = index === focusedIndex\n const isSelected = selectedPlugins.has(plugin.name)\n const isInstalled = installedPlugins.has(plugin.name)\n\n return (\n <PluginListItem\n key={plugin.name}\n plugin={plugin}\n isFocused={isFocused}\n isSelected={isSelected}\n isInstalled={isInstalled}\n theme={theme}\n truncate={truncate}\n />\n )\n })}\n </Box>\n\n <Box marginTop={1} flexDirection=\"column\">\n {selectedPlugins.size > 0 && (\n <Text color={theme.success}>\n {selectedPlugins.size} plugin{selectedPlugins.size > 1 ? 's' : ''}{' '}\n selected\n </Text>\n )}\n <Text color={SEMANTIC_COLORS.dim}>\n Space: (de)select \u00B7 Enter: details \u00B7 \u2191\u2193: navigate \u00B7 Esc: back\n </Text>\n </Box>\n </Box>\n )\n}\n\ninterface PluginListItemProps {\n plugin: MarketplacePlugin\n isFocused: boolean\n isSelected: boolean\n isInstalled: boolean\n theme: any\n truncate: (text: string, maxLength: number) => string\n}\n\nconst PluginListItem: React.FC<PluginListItemProps> = ({\n plugin,\n isFocused,\n isSelected,\n isInstalled,\n theme,\n truncate,\n}) => {\n // Build plugin info line\n const infoItems: string[] = []\n if (plugin.version) {\n infoItems.push(`v${plugin.version}`)\n }\n if (plugin.category) {\n infoItems.push(`[${plugin.category}]`)\n }\n if (isInstalled) {\n infoItems.push('(installed)')\n }\n\n return (\n <Box flexDirection=\"column\" marginBottom={0}>\n <Box>\n <Text color={isFocused ? theme.success : undefined}>\n {isFocused ? '\u276F ' : ' '}\n </Text>\n <Text color={isFocused ? theme.success : undefined}>\n {isSelected ? '\u25C9' : '\u25EF'}{' '}\n </Text>\n <Text bold={isFocused} color={isInstalled ? theme.dimColor : undefined}>\n {plugin.name}\n </Text>\n {infoItems.length > 0 && (\n <Text color={SEMANTIC_COLORS.dim}> {infoItems.join(' ')}</Text>\n )}\n </Box>\n {plugin.description && (\n <Box marginLeft={4}>\n <Text color={SEMANTIC_COLORS.dim}>\n {truncate(plugin.description, 70)}\n </Text>\n </Box>\n )}\n </Box>\n )\n}\n"],
|
|
5
|
+
"mappings": "AAMA,OAAO,SAAS,UAAU,iBAAiB;AAC3C,SAAS,KAAK,MAAM,gBAAgB;AACpC,SAAS,gBAAgB;AACzB,SAAS,sBAAsB;AAC/B,SAAS,sBAAsB;AAG/B,SAAS,uBAAuB;AAMzB,MAAM,gBAA8C,CAAC;AAAA,EAC1D;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,QAAQ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BAAgB,OAAO,IAAI,MAAM,IAAI,KAAI,UAEzE,GAEF,oCAAC,QAAK,OAAO,gBAAgB,OAAK,kFAElC,CACF;AAAA,EACF;AAEJ;AAWA,MAAM,iBAAgD,CAAC;AAAA,EACrD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AAEJ,QAAM,YAAsB,CAAC;AAC7B,MAAI,OAAO,SAAS;AAClB,cAAU,KAAK,IAAI,OAAO,OAAO,EAAE;AAAA,EACrC;AACA,MAAI,OAAO,UAAU;AACnB,cAAU,KAAK,IAAI,OAAO,QAAQ,GAAG;AAAA,EACvC;AACA,MAAI,aAAa;AACf,cAAU,KAAK,aAAa;AAAA,EAC9B;AAEA,SACE,oCAAC,OAAI,eAAc,UAAS,cAAc,KACxC,oCAAC,WACC,oCAAC,QAAK,OAAO,YAAY,MAAM,UAAU,UACtC,YAAY,YAAO,IACtB,GACA,oCAAC,QAAK,OAAO,YAAY,MAAM,UAAU,UACtC,aAAa,WAAM,UAAK,GAC3B,GACA,oCAAC,QAAK,MAAM,WAAW,OAAO,cAAc,MAAM,WAAW,UAC1D,OAAO,IACV,GACC,UAAU,SAAS,KAClB,oCAAC,QAAK,OAAO,gBAAgB,OAAK,KAAE,UAAU,KAAK,GAAG,CAAE,CAE5D,GACC,OAAO,eACN,oCAAC,OAAI,YAAY,KACf,oCAAC,QAAK,OAAO,gBAAgB,OAC1B,SAAS,OAAO,aAAa,EAAE,CAClC,CACF,CAEJ;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
getMarketplace,
|
|
7
7
|
installPluginFromMarketplace
|
|
8
8
|
} from "../../utils/marketplaceManager.js";
|
|
9
|
+
import { SEMANTIC_COLORS } from "../../constants/colors.js";
|
|
9
10
|
import { formatAuthor } from "./utils.js";
|
|
10
11
|
import { spawn } from "child_process";
|
|
11
12
|
const PluginDetailsInstall = ({
|
|
@@ -103,8 +104,8 @@ const PluginDetailsInstall = ({
|
|
|
103
104
|
paddingY: 1
|
|
104
105
|
},
|
|
105
106
|
/* @__PURE__ */ React.createElement(Text, { color: theme.error }, "Plugin not found"),
|
|
106
|
-
/* @__PURE__ */ React.createElement(Text, {
|
|
107
|
-
/* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, {
|
|
107
|
+
/* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, 'Plugin "', plugin, '" not found in marketplace "', marketplace, '"'),
|
|
108
|
+
/* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, "Press Esc to go back"))
|
|
108
109
|
);
|
|
109
110
|
}
|
|
110
111
|
const actions = [{ label: "Install now", value: "install" }];
|
|
@@ -137,7 +138,7 @@ const PluginDetailsInstall = ({
|
|
|
137
138
|
paddingY: 1
|
|
138
139
|
},
|
|
139
140
|
/* @__PURE__ */ React.createElement(Text, { bold: true, color: theme.primary }, "Plugin Details"),
|
|
140
|
-
/* @__PURE__ */ React.createElement(Box, { marginTop: 1, flexDirection: "column", gap: 0 }, /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { bold: true, color: theme.success }, pluginData.name), pluginData.version && /* @__PURE__ */ React.createElement(Text, {
|
|
141
|
+
/* @__PURE__ */ React.createElement(Box, { marginTop: 1, flexDirection: "column", gap: 0 }, /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { bold: true, color: theme.success }, pluginData.name), pluginData.version && /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, " v", pluginData.version), pluginData.category && /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, " [", pluginData.category, "]")), pluginData.description && /* @__PURE__ */ React.createElement(Box, { marginTop: 0 }, /* @__PURE__ */ React.createElement(Text, null, pluginData.description)), pluginData.author && /* @__PURE__ */ React.createElement(Box, { marginTop: 0 }, /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, "By: ", formatAuthor(pluginData.author))), pluginData.license && /* @__PURE__ */ React.createElement(Box, { marginTop: 0 }, /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, "License: ", pluginData.license)), pluginData.homepage && /* @__PURE__ */ React.createElement(Box, { marginTop: 0 }, /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, "Homepage: ", pluginData.homepage)), pluginData.repository && /* @__PURE__ */ React.createElement(Box, { marginTop: 0 }, /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, "Repository: ", pluginData.repository)), /* @__PURE__ */ React.createElement(Box, { marginTop: 0 }, /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, "Source: ", formatSource(pluginData.source))), pluginData.keywords && pluginData.keywords.length > 0 && /* @__PURE__ */ React.createElement(Box, { marginTop: 0 }, /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, "Keywords: ", pluginData.keywords.join(", "))), /* @__PURE__ */ React.createElement(Box, { marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React.createElement(Text, { bold: true }, "Will install:"), pluginData.agents && pluginData.agents.length > 0 && /* @__PURE__ */ React.createElement(Box, { marginLeft: 2 }, /* @__PURE__ */ React.createElement(Text, null, "\u2022 Agents: ", pluginData.agents.join(", "))), pluginData.commands && pluginData.commands.length > 0 && /* @__PURE__ */ React.createElement(Box, { marginLeft: 2 }, /* @__PURE__ */ React.createElement(Text, null, "\u2022 Commands: ", pluginData.commands.join(", "))), pluginData.skills && pluginData.skills.length > 0 && /* @__PURE__ */ React.createElement(Box, { marginLeft: 2 }, /* @__PURE__ */ React.createElement(Text, null, "\u2022 Skills: ", pluginData.skills.join(", "))), pluginData.hooks && pluginData.hooks.length > 0 && /* @__PURE__ */ React.createElement(Box, { marginLeft: 2 }, /* @__PURE__ */ React.createElement(Text, null, "\u2022 Hooks: ", pluginData.hooks.join(", "))), pluginData.mcpServers && pluginData.mcpServers.length > 0 && /* @__PURE__ */ React.createElement(Box, { marginLeft: 2 }, /* @__PURE__ */ React.createElement(Text, null, "\u2022 MCP Servers: ", pluginData.mcpServers.join(", "))), !pluginData.agents?.length && !pluginData.commands?.length && !pluginData.skills?.length && !pluginData.hooks?.length && !pluginData.mcpServers?.length && /* @__PURE__ */ React.createElement(Box, { marginLeft: 2 }, /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, "Components will be auto-discovered from plugin directory")))),
|
|
141
142
|
installing && /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { color: theme.primary }, "Installing ", pluginData.name, "...")),
|
|
142
143
|
installSuccess && /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { color: theme.success }, "\u2713 Successfully installed ", pluginData.name)),
|
|
143
144
|
installError && /* @__PURE__ */ React.createElement(Box, { marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React.createElement(Text, { color: theme.error }, "\u2717 Installation failed"), /* @__PURE__ */ React.createElement(Text, { color: theme.error }, installError)),
|
|
@@ -149,7 +150,7 @@ const PluginDetailsInstall = ({
|
|
|
149
150
|
visibleOptionCount: Math.min(actions.length, 5)
|
|
150
151
|
}
|
|
151
152
|
)),
|
|
152
|
-
!installing && !installSuccess && /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, {
|
|
153
|
+
!installing && !installSuccess && /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, "\u2191\u2193: Navigate \xB7 Enter: Select \xB7 Esc: Back"))
|
|
153
154
|
);
|
|
154
155
|
};
|
|
155
156
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/commands/plugin/PluginDetailsInstall.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * Plugin Details & Install Component\n *\n * Shows complete plugin information and installation actions\n */\n\nimport React, { useState, useEffect } from 'react'\nimport { Box, Text } from 'ink'\nimport { Select } from '@components/CustomSelect/select'\nimport { Option } from '@inkjs/ui'\nimport { getTheme } from '@utils/theme'\nimport {\n getMarketplace,\n installPluginFromMarketplace,\n} from '@utils/marketplaceManager'\nimport { MarketplacePlugin } from '../../types/marketplace'\nimport { NavigationProps } from './types'\nimport { formatAuthor } from './utils'\nimport { spawn } from 'child_process'\n\ninterface PluginDetailsInstallProps extends NavigationProps {\n marketplace: string\n plugin: string\n}\n\nexport const PluginDetailsInstall: React.FC<PluginDetailsInstallProps> = ({\n marketplace,\n plugin,\n onNavigate,\n onBack,\n onDone,\n}) => {\n const theme = getTheme()\n const [pluginData, setPluginData] = useState<MarketplacePlugin | null>(null)\n const [installing, setInstalling] = useState(false)\n const [installError, setInstallError] = useState<string | null>(null)\n const [installSuccess, setInstallSuccess] = useState(false)\n const [loading, setLoading] = useState(true)\n\n useEffect(() => {\n loadPluginDetails()\n }, [marketplace, plugin])\n\n const loadPluginDetails = () => {\n try {\n setLoading(true)\n\n const marketplaceData = getMarketplace(marketplace)\n if (!marketplaceData) {\n setPluginData(null)\n setLoading(false)\n return\n }\n\n const pluginInfo = marketplaceData.manifest.plugins.find(\n p => p.name === plugin,\n )\n setPluginData(pluginInfo || null)\n } catch (err) {\n console.error('Error loading plugin details:', err)\n setPluginData(null)\n } finally {\n setLoading(false)\n }\n }\n\n const handleInstall = async () => {\n if (!pluginData) return\n\n setInstalling(true)\n setInstallError(null)\n setInstallSuccess(false)\n\n try {\n // Install the plugin\n const installPath = await installPluginFromMarketplace(\n plugin,\n marketplace,\n )\n\n setInstallSuccess(true)\n setInstalling(false)\n\n // Auto-navigate back after short delay to show success message\n setTimeout(() => {\n onBack()\n }, 1500)\n } catch (error) {\n setInstalling(false)\n setInstallError(error instanceof Error ? error.message : String(error))\n }\n }\n\n const handleOpenHomepage = () => {\n if (!pluginData?.homepage) return\n\n // Open URL in default browser\n const url = pluginData.homepage\n const command =\n process.platform === 'darwin'\n ? 'open'\n : process.platform === 'win32'\n ? 'start'\n : 'xdg-open'\n\n spawn(command, [url], { detached: true, stdio: 'ignore' }).unref()\n }\n\n const handleAction = (value: string) => {\n if (value === 'install') {\n handleInstall()\n } else if (value === 'homepage') {\n handleOpenHomepage()\n } else if (value === 'back') {\n onBack()\n }\n }\n\n if (loading) {\n return (\n <Box\n flexDirection=\"column\"\n borderStyle=\"round\"\n borderColor={theme.secondaryBorder}\n paddingX={2}\n paddingY={1}\n >\n <Text color={theme.primary}>Loading plugin details...</Text>\n </Box>\n )\n }\n\n if (!pluginData) {\n return (\n <Box\n flexDirection=\"column\"\n borderStyle=\"round\"\n borderColor={theme.error}\n paddingX={2}\n paddingY={1}\n >\n <Text color={theme.error}>Plugin not found</Text>\n <Text dimColor>\n Plugin \"{plugin}\" not found in marketplace \"{marketplace}\"\n </Text>\n <Box marginTop={1}>\n <Text dimColor>Press Esc to go back</Text>\n </Box>\n </Box>\n )\n }\n\n // Build action menu\n const actions: Option[] = [{ label: 'Install now', value: 'install' }]\n\n if (pluginData.homepage) {\n actions.push({ label: 'Open homepage', value: 'homepage' })\n }\n\n actions.push({ label: 'Back to plugin list', value: 'back' })\n\n // Helper to format source\n const formatSource = (source: any): string => {\n if (typeof source === 'string') {\n return `Relative: ${source}`\n }\n if (source.source === 'github') {\n return `GitHub: ${source.repo}${source.ref ? `@${source.ref}` : ''}`\n }\n if (source.source === 'url') {\n return `URL: ${source.url}`\n }\n if (source.source === 'local') {\n return `Local: ${source.path}`\n }\n return 'Unknown'\n }\n\n return (\n <Box\n flexDirection=\"column\"\n borderStyle=\"round\"\n borderColor={theme.secondaryBorder}\n paddingX={2}\n paddingY={1}\n >\n <Text bold color={theme.primary}>\n Plugin Details\n </Text>\n\n <Box marginTop={1} flexDirection=\"column\" gap={0}>\n {/* Plugin name and version */}\n <Text>\n <Text bold color={theme.success}>\n {pluginData.name}\n </Text>\n {pluginData.version && <Text dimColor> v{pluginData.version}</Text>}\n {pluginData.category && (\n <Text dimColor> [{pluginData.category}]</Text>\n )}\n </Text>\n\n {/* Description */}\n {pluginData.description && (\n <Box marginTop={0}>\n <Text>{pluginData.description}</Text>\n </Box>\n )}\n\n {/* Author */}\n {pluginData.author && (\n <Box marginTop={0}>\n <Text dimColor>By: {formatAuthor(pluginData.author)}</Text>\n </Box>\n )}\n\n {/* License */}\n {pluginData.license && (\n <Box marginTop={0}>\n <Text dimColor>License: {pluginData.license}</Text>\n </Box>\n )}\n\n {/* Homepage */}\n {pluginData.homepage && (\n <Box marginTop={0}>\n <Text dimColor>Homepage: {pluginData.homepage}</Text>\n </Box>\n )}\n\n {/* Repository */}\n {pluginData.repository && (\n <Box marginTop={0}>\n <Text dimColor>Repository: {pluginData.repository}</Text>\n </Box>\n )}\n\n {/* Source */}\n <Box marginTop={0}>\n <Text dimColor>Source: {formatSource(pluginData.source)}</Text>\n </Box>\n\n {/* Keywords/Tags */}\n {pluginData.keywords && pluginData.keywords.length > 0 && (\n <Box marginTop={0}>\n <Text dimColor>Keywords: {pluginData.keywords.join(', ')}</Text>\n </Box>\n )}\n\n {/* Components */}\n <Box marginTop={1} flexDirection=\"column\">\n <Text bold>Will install:</Text>\n {pluginData.agents && pluginData.agents.length > 0 && (\n <Box marginLeft={2}>\n <Text>\u2022 Agents: {pluginData.agents.join(', ')}</Text>\n </Box>\n )}\n {pluginData.commands && pluginData.commands.length > 0 && (\n <Box marginLeft={2}>\n <Text>\u2022 Commands: {pluginData.commands.join(', ')}</Text>\n </Box>\n )}\n {pluginData.skills && pluginData.skills.length > 0 && (\n <Box marginLeft={2}>\n <Text>\u2022 Skills: {pluginData.skills.join(', ')}</Text>\n </Box>\n )}\n {pluginData.hooks && pluginData.hooks.length > 0 && (\n <Box marginLeft={2}>\n <Text>\u2022 Hooks: {pluginData.hooks.join(', ')}</Text>\n </Box>\n )}\n {pluginData.mcpServers && pluginData.mcpServers.length > 0 && (\n <Box marginLeft={2}>\n <Text>\u2022 MCP Servers: {pluginData.mcpServers.join(', ')}</Text>\n </Box>\n )}\n {!pluginData.agents?.length &&\n !pluginData.commands?.length &&\n !pluginData.skills?.length &&\n !pluginData.hooks?.length &&\n !pluginData.mcpServers?.length && (\n <Box marginLeft={2}>\n <Text dimColor>\n Components will be auto-discovered from plugin directory\n </Text>\n </Box>\n )}\n </Box>\n </Box>\n\n {/* Installation status */}\n {installing && (\n <Box marginTop={1}>\n <Text color={theme.primary}>Installing {pluginData.name}...</Text>\n </Box>\n )}\n\n {installSuccess && (\n <Box marginTop={1}>\n <Text color={theme.success}>\n \u2713 Successfully installed {pluginData.name}\n </Text>\n </Box>\n )}\n\n {installError && (\n <Box marginTop={1} flexDirection=\"column\">\n <Text color={theme.error}>\u2717 Installation failed</Text>\n <Text color={theme.error}>{installError}</Text>\n </Box>\n )}\n\n {/* Action menu */}\n {!installing && !installSuccess && (\n <Box marginTop={1}>\n <Select\n options={actions}\n onChange={handleAction}\n visibleOptionCount={Math.min(actions.length, 5)}\n />\n </Box>\n )}\n\n {/* Help text */}\n {!installing && !installSuccess && (\n <Box marginTop={1}>\n <Text dimColor>\u2191\u2193: Navigate \u00B7 Enter: Select \u00B7 Esc: Back</Text>\n </Box>\n )}\n </Box>\n )\n}\n"],
|
|
5
|
-
"mappings": "AAMA,OAAO,SAAS,UAAU,iBAAiB;AAC3C,SAAS,KAAK,YAAY;AAC1B,SAAS,cAAc;AAEvB,SAAS,gBAAgB;AACzB;AAAA,EACE;AAAA,EACA;AAAA,OACK;
|
|
4
|
+
"sourcesContent": ["/**\n * Plugin Details & Install Component\n *\n * Shows complete plugin information and installation actions\n */\n\nimport React, { useState, useEffect } from 'react'\nimport { Box, Text } from 'ink'\nimport { Select } from '@components/CustomSelect/select'\nimport { Option } from '@inkjs/ui'\nimport { getTheme } from '@utils/theme'\nimport {\n getMarketplace,\n installPluginFromMarketplace,\n} from '@utils/marketplaceManager'\nimport { SEMANTIC_COLORS } from '@constants/colors'\nimport { MarketplacePlugin } from '../../types/marketplace'\nimport { NavigationProps } from './types'\nimport { formatAuthor } from './utils'\nimport { spawn } from 'child_process'\n\ninterface PluginDetailsInstallProps extends NavigationProps {\n marketplace: string\n plugin: string\n}\n\nexport const PluginDetailsInstall: React.FC<PluginDetailsInstallProps> = ({\n marketplace,\n plugin,\n onNavigate,\n onBack,\n onDone,\n}) => {\n const theme = getTheme()\n const [pluginData, setPluginData] = useState<MarketplacePlugin | null>(null)\n const [installing, setInstalling] = useState(false)\n const [installError, setInstallError] = useState<string | null>(null)\n const [installSuccess, setInstallSuccess] = useState(false)\n const [loading, setLoading] = useState(true)\n\n useEffect(() => {\n loadPluginDetails()\n }, [marketplace, plugin])\n\n const loadPluginDetails = () => {\n try {\n setLoading(true)\n\n const marketplaceData = getMarketplace(marketplace)\n if (!marketplaceData) {\n setPluginData(null)\n setLoading(false)\n return\n }\n\n const pluginInfo = marketplaceData.manifest.plugins.find(\n p => p.name === plugin,\n )\n setPluginData(pluginInfo || null)\n } catch (err) {\n console.error('Error loading plugin details:', err)\n setPluginData(null)\n } finally {\n setLoading(false)\n }\n }\n\n const handleInstall = async () => {\n if (!pluginData) return\n\n setInstalling(true)\n setInstallError(null)\n setInstallSuccess(false)\n\n try {\n // Install the plugin\n const installPath = await installPluginFromMarketplace(\n plugin,\n marketplace,\n )\n\n setInstallSuccess(true)\n setInstalling(false)\n\n // Auto-navigate back after short delay to show success message\n setTimeout(() => {\n onBack()\n }, 1500)\n } catch (error) {\n setInstalling(false)\n setInstallError(error instanceof Error ? error.message : String(error))\n }\n }\n\n const handleOpenHomepage = () => {\n if (!pluginData?.homepage) return\n\n // Open URL in default browser\n const url = pluginData.homepage\n const command =\n process.platform === 'darwin'\n ? 'open'\n : process.platform === 'win32'\n ? 'start'\n : 'xdg-open'\n\n spawn(command, [url], { detached: true, stdio: 'ignore' }).unref()\n }\n\n const handleAction = (value: string) => {\n if (value === 'install') {\n handleInstall()\n } else if (value === 'homepage') {\n handleOpenHomepage()\n } else if (value === 'back') {\n onBack()\n }\n }\n\n if (loading) {\n return (\n <Box\n flexDirection=\"column\"\n borderStyle=\"round\"\n borderColor={theme.secondaryBorder}\n paddingX={2}\n paddingY={1}\n >\n <Text color={theme.primary}>Loading plugin details...</Text>\n </Box>\n )\n }\n\n if (!pluginData) {\n return (\n <Box\n flexDirection=\"column\"\n borderStyle=\"round\"\n borderColor={theme.error}\n paddingX={2}\n paddingY={1}\n >\n <Text color={theme.error}>Plugin not found</Text>\n <Text color={SEMANTIC_COLORS.dim}>\n Plugin \"{plugin}\" not found in marketplace \"{marketplace}\"\n </Text>\n <Box marginTop={1}>\n <Text color={SEMANTIC_COLORS.dim}>Press Esc to go back</Text>\n </Box>\n </Box>\n )\n }\n\n // Build action menu\n const actions: Option[] = [{ label: 'Install now', value: 'install' }]\n\n if (pluginData.homepage) {\n actions.push({ label: 'Open homepage', value: 'homepage' })\n }\n\n actions.push({ label: 'Back to plugin list', value: 'back' })\n\n // Helper to format source\n const formatSource = (source: any): string => {\n if (typeof source === 'string') {\n return `Relative: ${source}`\n }\n if (source.source === 'github') {\n return `GitHub: ${source.repo}${source.ref ? `@${source.ref}` : ''}`\n }\n if (source.source === 'url') {\n return `URL: ${source.url}`\n }\n if (source.source === 'local') {\n return `Local: ${source.path}`\n }\n return 'Unknown'\n }\n\n return (\n <Box\n flexDirection=\"column\"\n borderStyle=\"round\"\n borderColor={theme.secondaryBorder}\n paddingX={2}\n paddingY={1}\n >\n <Text bold color={theme.primary}>\n Plugin Details\n </Text>\n\n <Box marginTop={1} flexDirection=\"column\" gap={0}>\n {/* Plugin name and version */}\n <Text>\n <Text bold color={theme.success}>\n {pluginData.name}\n </Text>\n {pluginData.version && (\n <Text color={SEMANTIC_COLORS.dim}> v{pluginData.version}</Text>\n )}\n {pluginData.category && (\n <Text color={SEMANTIC_COLORS.dim}> [{pluginData.category}]</Text>\n )}\n </Text>\n\n {/* Description */}\n {pluginData.description && (\n <Box marginTop={0}>\n <Text>{pluginData.description}</Text>\n </Box>\n )}\n\n {/* Author */}\n {pluginData.author && (\n <Box marginTop={0}>\n <Text color={SEMANTIC_COLORS.dim}>\n By: {formatAuthor(pluginData.author)}\n </Text>\n </Box>\n )}\n\n {/* License */}\n {pluginData.license && (\n <Box marginTop={0}>\n <Text color={SEMANTIC_COLORS.dim}>\n License: {pluginData.license}\n </Text>\n </Box>\n )}\n\n {/* Homepage */}\n {pluginData.homepage && (\n <Box marginTop={0}>\n <Text color={SEMANTIC_COLORS.dim}>\n Homepage: {pluginData.homepage}\n </Text>\n </Box>\n )}\n\n {/* Repository */}\n {pluginData.repository && (\n <Box marginTop={0}>\n <Text color={SEMANTIC_COLORS.dim}>\n Repository: {pluginData.repository}\n </Text>\n </Box>\n )}\n\n {/* Source */}\n <Box marginTop={0}>\n <Text color={SEMANTIC_COLORS.dim}>\n Source: {formatSource(pluginData.source)}\n </Text>\n </Box>\n\n {/* Keywords/Tags */}\n {pluginData.keywords && pluginData.keywords.length > 0 && (\n <Box marginTop={0}>\n <Text color={SEMANTIC_COLORS.dim}>\n Keywords: {pluginData.keywords.join(', ')}\n </Text>\n </Box>\n )}\n\n {/* Components */}\n <Box marginTop={1} flexDirection=\"column\">\n <Text bold>Will install:</Text>\n {pluginData.agents && pluginData.agents.length > 0 && (\n <Box marginLeft={2}>\n <Text>\u2022 Agents: {pluginData.agents.join(', ')}</Text>\n </Box>\n )}\n {pluginData.commands && pluginData.commands.length > 0 && (\n <Box marginLeft={2}>\n <Text>\u2022 Commands: {pluginData.commands.join(', ')}</Text>\n </Box>\n )}\n {pluginData.skills && pluginData.skills.length > 0 && (\n <Box marginLeft={2}>\n <Text>\u2022 Skills: {pluginData.skills.join(', ')}</Text>\n </Box>\n )}\n {pluginData.hooks && pluginData.hooks.length > 0 && (\n <Box marginLeft={2}>\n <Text>\u2022 Hooks: {pluginData.hooks.join(', ')}</Text>\n </Box>\n )}\n {pluginData.mcpServers && pluginData.mcpServers.length > 0 && (\n <Box marginLeft={2}>\n <Text>\u2022 MCP Servers: {pluginData.mcpServers.join(', ')}</Text>\n </Box>\n )}\n {!pluginData.agents?.length &&\n !pluginData.commands?.length &&\n !pluginData.skills?.length &&\n !pluginData.hooks?.length &&\n !pluginData.mcpServers?.length && (\n <Box marginLeft={2}>\n <Text color={SEMANTIC_COLORS.dim}>\n Components will be auto-discovered from plugin directory\n </Text>\n </Box>\n )}\n </Box>\n </Box>\n\n {/* Installation status */}\n {installing && (\n <Box marginTop={1}>\n <Text color={theme.primary}>Installing {pluginData.name}...</Text>\n </Box>\n )}\n\n {installSuccess && (\n <Box marginTop={1}>\n <Text color={theme.success}>\n \u2713 Successfully installed {pluginData.name}\n </Text>\n </Box>\n )}\n\n {installError && (\n <Box marginTop={1} flexDirection=\"column\">\n <Text color={theme.error}>\u2717 Installation failed</Text>\n <Text color={theme.error}>{installError}</Text>\n </Box>\n )}\n\n {/* Action menu */}\n {!installing && !installSuccess && (\n <Box marginTop={1}>\n <Select\n options={actions}\n onChange={handleAction}\n visibleOptionCount={Math.min(actions.length, 5)}\n />\n </Box>\n )}\n\n {/* Help text */}\n {!installing && !installSuccess && (\n <Box marginTop={1}>\n <Text color={SEMANTIC_COLORS.dim}>\n \u2191\u2193: Navigate \u00B7 Enter: Select \u00B7 Esc: Back\n </Text>\n </Box>\n )}\n </Box>\n )\n}\n"],
|
|
5
|
+
"mappings": "AAMA,OAAO,SAAS,UAAU,iBAAiB;AAC3C,SAAS,KAAK,YAAY;AAC1B,SAAS,cAAc;AAEvB,SAAS,gBAAgB;AACzB;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,uBAAuB;AAGhC,SAAS,oBAAoB;AAC7B,SAAS,aAAa;AAOf,MAAM,uBAA4D,CAAC;AAAA,EACxE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,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AAC,QAAK,OAAO,MAAM,WAAS,eAAY,WAAW,MAAK,KAAG,CAC7D;AAAA,IAGD,kBACC,oCAAC,OAAI,WAAW,KACd,oCAAC,QAAK,OAAO,MAAM,WAAS,kCACA,WAAW,IACvC,CACF;AAAA,IAGD,gBACC,oCAAC,OAAI,WAAW,GAAG,eAAc,YAC/B,oCAAC,QAAK,OAAO,MAAM,SAAO,4BAAqB,GAC/C,oCAAC,QAAK,OAAO,MAAM,SAAQ,YAAa,CAC1C;AAAA,IAID,CAAC,cAAc,CAAC,kBACf,oCAAC,OAAI,WAAW,KACd;AAAA,MAAC;AAAA;AAAA,QACC,SAAS;AAAA,QACT,UAAU;AAAA,QACV,oBAAoB,KAAK,IAAI,QAAQ,QAAQ,CAAC;AAAA;AAAA,IAChD,CACF;AAAA,IAID,CAAC,cAAc,CAAC,kBACf,oCAAC,OAAI,WAAW,KACd,oCAAC,QAAK,OAAO,gBAAgB,OAAK,0DAElC,CACF;AAAA,EAEJ;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
getPlugin,
|
|
5
5
|
togglePluginEnabled
|
|
6
6
|
} from "../../utils/pluginLoader.js";
|
|
7
|
+
import { SEMANTIC_COLORS } from "../../constants/colors.js";
|
|
7
8
|
import {
|
|
8
9
|
updateMarketplace,
|
|
9
10
|
installPluginFromMarketplace
|
|
@@ -186,7 +187,7 @@ const PluginDetailsManage = ({
|
|
|
186
187
|
}
|
|
187
188
|
};
|
|
188
189
|
const confirm = confirmMessages[confirmAction];
|
|
189
|
-
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", padding: 1 }, /* @__PURE__ */ React.createElement(Text, { bold: true, color: theme.warning }, confirm.title), /* @__PURE__ */ React.createElement(Text, null, ""), /* @__PURE__ */ React.createElement(Text, null, confirm.message), /* @__PURE__ */ React.createElement(Text, {
|
|
190
|
+
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", padding: 1 }, /* @__PURE__ */ React.createElement(Text, { bold: true, color: theme.warning }, confirm.title), /* @__PURE__ */ React.createElement(Text, null, ""), /* @__PURE__ */ React.createElement(Text, null, confirm.message), /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, confirm.warning), /* @__PURE__ */ React.createElement(Text, null, ""), /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { color: theme.success }, "Y"), "es /", " ", /* @__PURE__ */ React.createElement(Text, { color: theme.error }, "N"), "o"));
|
|
190
191
|
}
|
|
191
192
|
if (actionInProgress) {
|
|
192
193
|
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", padding: 1 }, /* @__PURE__ */ React.createElement(Text, { color: theme.primary }, actionMessage));
|
|
@@ -198,10 +199,10 @@ const PluginDetailsManage = ({
|
|
|
198
199
|
pluginData.hooks.length > 0 && `${pluginData.hooks.length} hook(s)`,
|
|
199
200
|
pluginData.mcpServers.length > 0 && `${pluginData.mcpServers.length} MCP server(s)`
|
|
200
201
|
].filter(Boolean);
|
|
201
|
-
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", padding: 1 }, /* @__PURE__ */ React.createElement(Text, { bold: true, color: theme.primary }, pluginData.manifest.displayName || pluginData.manifest.name), /* @__PURE__ */ React.createElement(Text, {
|
|
202
|
+
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", padding: 1 }, /* @__PURE__ */ React.createElement(Text, { bold: true, color: theme.primary }, pluginData.manifest.displayName || pluginData.manifest.name), /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, marketplace ? `@${marketplace}` : "local", " \xB7 v", pluginData.manifest.version), /* @__PURE__ */ React.createElement(Text, null, ""), /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", marginLeft: 2 }, /* @__PURE__ */ React.createElement(Text, null, pluginData.manifest.description), pluginData.manifest.author && /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, "By ", formatAuthor(pluginData.manifest.author)), /* @__PURE__ */ React.createElement(Text, null, "Status:", " ", /* @__PURE__ */ React.createElement(Text, { color: pluginData.enabled ? theme.success : theme.warning }, pluginData.enabled ? "Enabled" : "Disabled")), componentCounts.length > 0 && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Text, null, ""), /* @__PURE__ */ React.createElement(Text, { bold: true }, "Components:"), pluginData.agents.length > 0 && /* @__PURE__ */ React.createElement(Box, { marginLeft: 2 }, /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, "\u2022 Agents: ", pluginData.agents.map((a) => a.name).join(", "))), pluginData.commands.length > 0 && /* @__PURE__ */ React.createElement(Box, { marginLeft: 2 }, /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, "\u2022 Commands:", " ", pluginData.commands.map((c) => `/${c.name}`).join(", "))), pluginData.skills.length > 0 && /* @__PURE__ */ React.createElement(Box, { marginLeft: 2 }, /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, "\u2022 Skills: ", pluginData.skills.map((s) => s.name).join(", "))))), /* @__PURE__ */ React.createElement(Text, null, ""), /* @__PURE__ */ React.createElement(Text, { bold: true, color: theme.primary }, "Actions:"), availableActions.map((action, index) => {
|
|
202
203
|
const isSelected = index === selectedIndex;
|
|
203
204
|
return /* @__PURE__ */ React.createElement(Box, { key: action.value, marginLeft: 2 }, /* @__PURE__ */ React.createElement(Text, { color: isSelected ? theme.success : void 0 }, isSelected ? "\u276F " : " ", action.label));
|
|
204
|
-
}), actionMessage && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Text, null, ""), /* @__PURE__ */ React.createElement(Box, { marginLeft: 2 }, /* @__PURE__ */ React.createElement(Text, { color: theme.warning }, actionMessage))), /* @__PURE__ */ React.createElement(Text, null, ""), /* @__PURE__ */ React.createElement(Box, { marginLeft: 2 }, /* @__PURE__ */ React.createElement(Text, {
|
|
205
|
+
}), actionMessage && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Text, null, ""), /* @__PURE__ */ React.createElement(Box, { marginLeft: 2 }, /* @__PURE__ */ React.createElement(Text, { color: theme.warning }, actionMessage))), /* @__PURE__ */ React.createElement(Text, null, ""), /* @__PURE__ */ React.createElement(Box, { marginLeft: 2 }, /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, "\u2191\u2193 Navigate \xB7 Enter Select \xB7 Esc Back")));
|
|
205
206
|
};
|
|
206
207
|
export {
|
|
207
208
|
PluginDetailsManage
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/commands/plugin/PluginDetailsManage.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * Plugin Details Management\n *\n * Displays detailed information about an installed plugin with management actions.\n * Provides options to enable/disable, update, uninstall, and open homepage.\n */\n\nimport React, { useState, useEffect, useCallback } from 'react'\nimport { Box, Text, useInput } from 'ink'\nimport {\n getPlugin,\n togglePluginEnabled,\n disablePlugin,\n enablePlugin,\n} from '@utils/pluginLoader'\nimport {\n updateMarketplace,\n installPluginFromMarketplace,\n} from '@utils/marketplaceManager'\nimport { LoadedPlugin } from '../../types/plugin'\nimport { getTheme } from '@utils/theme'\nimport { NavigationProps } from './types'\nimport { formatAuthor } from './utils'\nimport { rmSync } from 'fs'\n\ninterface PluginDetailsManageProps extends NavigationProps {\n plugin: LoadedPlugin\n}\n\ntype ActionOption = {\n label: string\n value: string\n disabled?: boolean\n}\n\nexport const PluginDetailsManage: React.FC<PluginDetailsManageProps> = ({\n plugin,\n onNavigate,\n onBack,\n}) => {\n const [pluginData, setPluginData] = useState<LoadedPlugin>(plugin)\n const [selectedIndex, setSelectedIndex] = useState(0)\n const [showConfirm, setShowConfirm] = useState(false)\n const [confirmAction, setConfirmAction] = useState<string | null>(null)\n const [actionInProgress, setActionInProgress] = useState(false)\n const [actionMessage, setActionMessage] = useState('')\n const theme = getTheme()\n\n const marketplace =\n pluginData.source.type === 'marketplace'\n ? pluginData.source.marketplace\n : null\n\n const loadPluginData = useCallback(() => {\n const p = getPlugin(plugin.manifest.name)\n if (p) {\n setPluginData(p)\n }\n }, [plugin])\n\n useEffect(() => {\n loadPluginData()\n }, [loadPluginData])\n\n const actions: ActionOption[] = [\n {\n label: pluginData.enabled ? 'Disable plugin' : 'Enable plugin',\n value: 'toggle',\n },\n {\n label: 'Mark for update',\n value: 'mark-update',\n disabled: !marketplace,\n },\n {\n label: 'Mark for uninstallation',\n value: 'mark-uninstall',\n },\n {\n label: 'Update now',\n value: 'update-now',\n disabled: !marketplace,\n },\n {\n label: 'Uninstall now',\n value: 'uninstall-now',\n },\n {\n label: 'Open homepage',\n value: 'homepage',\n disabled: !pluginData.manifest.homepage,\n },\n {\n label: 'Back to plugin list',\n value: 'back',\n },\n ]\n\n const availableActions = actions.filter(a => !a.disabled)\n\n const handleAction = useCallback(\n async (action: string) => {\n if (!pluginData) return\n\n switch (action) {\n case 'toggle':\n try {\n togglePluginEnabled(pluginData.manifest.name)\n loadPluginData()\n } catch (error) {\n setActionMessage(\n `Error toggling plugin: ${error instanceof Error ? error.message : String(error)}`,\n )\n }\n break\n\n case 'mark-update':\n setActionMessage(`Plugin marked for update`)\n setTimeout(() => setActionMessage(''), 3000)\n break\n\n case 'mark-uninstall':\n setActionMessage(`Plugin marked for uninstallation`)\n setTimeout(() => setActionMessage(''), 3000)\n break\n\n case 'update-now':\n if (marketplace) {\n setConfirmAction('update-now')\n setShowConfirm(true)\n }\n break\n\n case 'uninstall-now':\n setConfirmAction('uninstall-now')\n setShowConfirm(true)\n break\n\n case 'homepage':\n if (pluginData.manifest.homepage) {\n setActionMessage(`Opening ${pluginData.manifest.homepage}`)\n // In a real implementation, would open browser\n setTimeout(() => setActionMessage(''), 3000)\n }\n break\n\n case 'back':\n onBack()\n break\n }\n },\n [pluginData, marketplace, loadPluginData, onBack],\n )\n\n const handleConfirmAction = useCallback(async () => {\n if (!pluginData || !confirmAction) return\n\n setShowConfirm(false)\n setActionInProgress(true)\n\n try {\n if (confirmAction === 'update-now') {\n setActionMessage('Updating plugin...')\n\n if (marketplace) {\n // Update marketplace first\n await updateMarketplace(marketplace)\n\n // Uninstall current version\n rmSync(pluginData.location, { recursive: true, force: true })\n\n // Reinstall latest version\n await installPluginFromMarketplace(\n pluginData.manifest.name,\n marketplace,\n )\n\n setActionMessage('Plugin updated successfully!')\n setTimeout(() => {\n setActionMessage('')\n onBack()\n }, 2000)\n }\n } else if (confirmAction === 'uninstall-now') {\n setActionMessage('Uninstalling plugin...')\n\n // Remove plugin directory\n rmSync(pluginData.location, { recursive: true, force: true })\n\n setActionMessage('Plugin uninstalled successfully!')\n setTimeout(() => {\n setActionMessage('')\n onBack()\n }, 2000)\n }\n } catch (error) {\n setActionMessage(\n `Action failed: ${error instanceof Error ? error.message : String(error)}`,\n )\n setTimeout(() => setActionMessage(''), 5000)\n } finally {\n setActionInProgress(false)\n setConfirmAction(null)\n }\n }, [pluginData, confirmAction, marketplace, onBack])\n\n useInput((input, key) => {\n if (actionInProgress) return\n\n if (showConfirm) {\n if (key.return || input === 'y') {\n handleConfirmAction()\n } else if (key.escape || input === 'n') {\n setShowConfirm(false)\n setConfirmAction(null)\n }\n return\n }\n\n if (key.escape) {\n onBack()\n } else if (key.upArrow) {\n setSelectedIndex(prev => Math.max(0, prev - 1))\n } else if (key.downArrow) {\n setSelectedIndex(prev => Math.min(availableActions.length - 1, prev + 1))\n } else if (key.return) {\n handleAction(availableActions[selectedIndex].value)\n }\n })\n\n if (showConfirm && confirmAction) {\n const confirmMessages = {\n 'update-now': {\n title: 'Confirm Update',\n message: `Update plugin \"${pluginData.manifest.name}\" to the latest version?`,\n warning:\n 'This will uninstall the current version and install the latest.',\n },\n 'uninstall-now': {\n title: 'Confirm Uninstall',\n message: `Permanently uninstall plugin \"${pluginData.manifest.name}\"?`,\n warning:\n 'This action cannot be undone. All plugin files will be removed.',\n },\n }\n\n const confirm =\n confirmMessages[confirmAction as keyof typeof confirmMessages]\n\n return (\n <Box flexDirection=\"column\" borderStyle=\"round\" padding={1}>\n <Text bold color={theme.warning}>\n {confirm.title}\n </Text>\n <Text>{''}</Text>\n <Text>{confirm.message}</Text>\n <Text dimColor>{confirm.warning}</Text>\n <Text>{''}</Text>\n <Text>\n <Text color={theme.success}>Y</Text>es /{' '}\n <Text color={theme.error}>N</Text>o\n </Text>\n </Box>\n )\n }\n\n if (actionInProgress) {\n return (\n <Box flexDirection=\"column\" borderStyle=\"round\" padding={1}>\n <Text color={theme.primary}>{actionMessage}</Text>\n </Box>\n )\n }\n\n const componentCounts = [\n pluginData.agents.length > 0 && `${pluginData.agents.length} agent(s)`,\n pluginData.commands.length > 0 &&\n `${pluginData.commands.length} command(s)`,\n pluginData.skills.length > 0 && `${pluginData.skills.length} skill(s)`,\n pluginData.hooks.length > 0 && `${pluginData.hooks.length} hook(s)`,\n pluginData.mcpServers.length > 0 &&\n `${pluginData.mcpServers.length} MCP server(s)`,\n ].filter(Boolean)\n\n return (\n <Box flexDirection=\"column\" borderStyle=\"round\" padding={1}>\n <Text bold color={theme.primary}>\n {pluginData.manifest.displayName || pluginData.manifest.name}\n </Text>\n <Text dimColor>\n {marketplace ? `@${marketplace}` : 'local'} \u00B7 v\n {pluginData.manifest.version}\n </Text>\n <Text>{''}</Text>\n\n <Box flexDirection=\"column\" marginLeft={2}>\n <Text>{pluginData.manifest.description}</Text>\n {pluginData.manifest.author && (\n <Text dimColor>By {formatAuthor(pluginData.manifest.author)}</Text>\n )}\n <Text>\n Status:{' '}\n <Text color={pluginData.enabled ? theme.success : theme.warning}>\n {pluginData.enabled ? 'Enabled' : 'Disabled'}\n </Text>\n </Text>\n\n {componentCounts.length > 0 && (\n <>\n <Text>{''}</Text>\n <Text bold>Components:</Text>\n {pluginData.agents.length > 0 && (\n <Box marginLeft={2}>\n <Text dimColor>\n \u2022 Agents: {pluginData.agents.map(a => a.name).join(', ')}\n </Text>\n </Box>\n )}\n {pluginData.commands.length > 0 && (\n <Box marginLeft={2}>\n <Text dimColor>\n \u2022 Commands:{' '}\n {pluginData.commands.map(c => `/${c.name}`).join(', ')}\n </Text>\n </Box>\n )}\n {pluginData.skills.length > 0 && (\n <Box marginLeft={2}>\n <Text dimColor>\n \u2022 Skills: {pluginData.skills.map(s => s.name).join(', ')}\n </Text>\n </Box>\n )}\n </>\n )}\n </Box>\n\n <Text>{''}</Text>\n <Text bold color={theme.primary}>\n Actions:\n </Text>\n\n {availableActions.map((action, index) => {\n const isSelected = index === selectedIndex\n return (\n <Box key={action.value} marginLeft={2}>\n <Text color={isSelected ? theme.success : undefined}>\n {isSelected ? '\u276F ' : ' '}\n {action.label}\n </Text>\n </Box>\n )\n })}\n\n {actionMessage && (\n <>\n <Text>{''}</Text>\n <Box marginLeft={2}>\n <Text color={theme.warning}>{actionMessage}</Text>\n </Box>\n </>\n )}\n\n <Text>{''}</Text>\n <Box marginLeft={2}>\n <Text dimColor>\u2191\u2193 Navigate \u00B7 Enter Select \u00B7 Esc Back</Text>\n </Box>\n </Box>\n )\n}\n"],
|
|
5
|
-
"mappings": "AAOA,OAAO,SAAS,UAAU,WAAW,mBAAmB;AACxD,SAAS,KAAK,MAAM,gBAAgB;AACpC;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAEP,SAAS,gBAAgB;AAEzB,SAAS,oBAAoB;AAC7B,SAAS,cAAc;AAYhB,MAAM,sBAA0D,CAAC;AAAA,EACtE;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,CAAC,YAAY,aAAa,IAAI,SAAuB,MAAM;AACjE,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAAS,CAAC;AACpD,QAAM,CAAC,aAAa,cAAc,IAAI,SAAS,KAAK;AACpD,QAAM,CAAC,eAAe,gBAAgB,I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AEA,UAAM,UACJ,gBAAgB,aAA6C;AAE/D,WACE,oCAAC,OAAI,eAAc,UAAS,aAAY,SAAQ,SAAS,KACvD,oCAAC,QAAK,MAAI,MAAC,OAAO,MAAM,WACrB,QAAQ,KACX,GACA,oCAAC,YAAM,EAAG,GACV,oCAAC,YAAM,QAAQ,OAAQ,GACvB,oCAAC,QAAK,
|
|
4
|
+
"sourcesContent": ["/**\n * Plugin Details Management\n *\n * Displays detailed information about an installed plugin with management actions.\n * Provides options to enable/disable, update, uninstall, and open homepage.\n */\n\nimport React, { useState, useEffect, useCallback } from 'react'\nimport { Box, Text, useInput } from 'ink'\nimport {\n getPlugin,\n togglePluginEnabled,\n disablePlugin,\n enablePlugin,\n} from '@utils/pluginLoader'\nimport { SEMANTIC_COLORS } from '@constants/colors'\nimport {\n updateMarketplace,\n installPluginFromMarketplace,\n} from '@utils/marketplaceManager'\nimport { LoadedPlugin } from '../../types/plugin'\nimport { getTheme } from '@utils/theme'\nimport { NavigationProps } from './types'\nimport { formatAuthor } from './utils'\nimport { rmSync } from 'fs'\n\ninterface PluginDetailsManageProps extends NavigationProps {\n plugin: LoadedPlugin\n}\n\ntype ActionOption = {\n label: string\n value: string\n disabled?: boolean\n}\n\nexport const PluginDetailsManage: React.FC<PluginDetailsManageProps> = ({\n plugin,\n onNavigate,\n onBack,\n}) => {\n const [pluginData, setPluginData] = useState<LoadedPlugin>(plugin)\n const [selectedIndex, setSelectedIndex] = useState(0)\n const [showConfirm, setShowConfirm] = useState(false)\n const [confirmAction, setConfirmAction] = useState<string | null>(null)\n const [actionInProgress, setActionInProgress] = useState(false)\n const [actionMessage, setActionMessage] = useState('')\n const theme = getTheme()\n\n const marketplace =\n pluginData.source.type === 'marketplace'\n ? pluginData.source.marketplace\n : null\n\n const loadPluginData = useCallback(() => {\n const p = getPlugin(plugin.manifest.name)\n if (p) {\n setPluginData(p)\n }\n }, [plugin])\n\n useEffect(() => {\n loadPluginData()\n }, [loadPluginData])\n\n const actions: ActionOption[] = [\n {\n label: pluginData.enabled ? 'Disable plugin' : 'Enable plugin',\n value: 'toggle',\n },\n {\n label: 'Mark for update',\n value: 'mark-update',\n disabled: !marketplace,\n },\n {\n label: 'Mark for uninstallation',\n value: 'mark-uninstall',\n },\n {\n label: 'Update now',\n value: 'update-now',\n disabled: !marketplace,\n },\n {\n label: 'Uninstall now',\n value: 'uninstall-now',\n },\n {\n label: 'Open homepage',\n value: 'homepage',\n disabled: !pluginData.manifest.homepage,\n },\n {\n label: 'Back to plugin list',\n value: 'back',\n },\n ]\n\n const availableActions = actions.filter(a => !a.disabled)\n\n const handleAction = useCallback(\n async (action: string) => {\n if (!pluginData) return\n\n switch (action) {\n case 'toggle':\n try {\n togglePluginEnabled(pluginData.manifest.name)\n loadPluginData()\n } catch (error) {\n setActionMessage(\n `Error toggling plugin: ${error instanceof Error ? error.message : String(error)}`,\n )\n }\n break\n\n case 'mark-update':\n setActionMessage(`Plugin marked for update`)\n setTimeout(() => setActionMessage(''), 3000)\n break\n\n case 'mark-uninstall':\n setActionMessage(`Plugin marked for uninstallation`)\n setTimeout(() => setActionMessage(''), 3000)\n break\n\n case 'update-now':\n if (marketplace) {\n setConfirmAction('update-now')\n setShowConfirm(true)\n }\n break\n\n case 'uninstall-now':\n setConfirmAction('uninstall-now')\n setShowConfirm(true)\n break\n\n case 'homepage':\n if (pluginData.manifest.homepage) {\n setActionMessage(`Opening ${pluginData.manifest.homepage}`)\n // In a real implementation, would open browser\n setTimeout(() => setActionMessage(''), 3000)\n }\n break\n\n case 'back':\n onBack()\n break\n }\n },\n [pluginData, marketplace, loadPluginData, onBack],\n )\n\n const handleConfirmAction = useCallback(async () => {\n if (!pluginData || !confirmAction) return\n\n setShowConfirm(false)\n setActionInProgress(true)\n\n try {\n if (confirmAction === 'update-now') {\n setActionMessage('Updating plugin...')\n\n if (marketplace) {\n // Update marketplace first\n await updateMarketplace(marketplace)\n\n // Uninstall current version\n rmSync(pluginData.location, { recursive: true, force: true })\n\n // Reinstall latest version\n await installPluginFromMarketplace(\n pluginData.manifest.name,\n marketplace,\n )\n\n setActionMessage('Plugin updated successfully!')\n setTimeout(() => {\n setActionMessage('')\n onBack()\n }, 2000)\n }\n } else if (confirmAction === 'uninstall-now') {\n setActionMessage('Uninstalling plugin...')\n\n // Remove plugin directory\n rmSync(pluginData.location, { recursive: true, force: true })\n\n setActionMessage('Plugin uninstalled successfully!')\n setTimeout(() => {\n setActionMessage('')\n onBack()\n }, 2000)\n }\n } catch (error) {\n setActionMessage(\n `Action failed: ${error instanceof Error ? error.message : String(error)}`,\n )\n setTimeout(() => setActionMessage(''), 5000)\n } finally {\n setActionInProgress(false)\n setConfirmAction(null)\n }\n }, [pluginData, confirmAction, marketplace, onBack])\n\n useInput((input, key) => {\n if (actionInProgress) return\n\n if (showConfirm) {\n if (key.return || input === 'y') {\n handleConfirmAction()\n } else if (key.escape || input === 'n') {\n setShowConfirm(false)\n setConfirmAction(null)\n }\n return\n }\n\n if (key.escape) {\n onBack()\n } else if (key.upArrow) {\n setSelectedIndex(prev => Math.max(0, prev - 1))\n } else if (key.downArrow) {\n setSelectedIndex(prev => Math.min(availableActions.length - 1, prev + 1))\n } else if (key.return) {\n handleAction(availableActions[selectedIndex].value)\n }\n })\n\n if (showConfirm && confirmAction) {\n const confirmMessages = {\n 'update-now': {\n title: 'Confirm Update',\n message: `Update plugin \"${pluginData.manifest.name}\" to the latest version?`,\n warning:\n 'This will uninstall the current version and install the latest.',\n },\n 'uninstall-now': {\n title: 'Confirm Uninstall',\n message: `Permanently uninstall plugin \"${pluginData.manifest.name}\"?`,\n warning:\n 'This action cannot be undone. All plugin files will be removed.',\n },\n }\n\n const confirm =\n confirmMessages[confirmAction as keyof typeof confirmMessages]\n\n return (\n <Box flexDirection=\"column\" borderStyle=\"round\" padding={1}>\n <Text bold color={theme.warning}>\n {confirm.title}\n </Text>\n <Text>{''}</Text>\n <Text>{confirm.message}</Text>\n <Text color={SEMANTIC_COLORS.dim}>{confirm.warning}</Text>\n <Text>{''}</Text>\n <Text>\n <Text color={theme.success}>Y</Text>es /{' '}\n <Text color={theme.error}>N</Text>o\n </Text>\n </Box>\n )\n }\n\n if (actionInProgress) {\n return (\n <Box flexDirection=\"column\" borderStyle=\"round\" padding={1}>\n <Text color={theme.primary}>{actionMessage}</Text>\n </Box>\n )\n }\n\n const componentCounts = [\n pluginData.agents.length > 0 && `${pluginData.agents.length} agent(s)`,\n pluginData.commands.length > 0 &&\n `${pluginData.commands.length} command(s)`,\n pluginData.skills.length > 0 && `${pluginData.skills.length} skill(s)`,\n pluginData.hooks.length > 0 && `${pluginData.hooks.length} hook(s)`,\n pluginData.mcpServers.length > 0 &&\n `${pluginData.mcpServers.length} MCP server(s)`,\n ].filter(Boolean)\n\n return (\n <Box flexDirection=\"column\" borderStyle=\"round\" padding={1}>\n <Text bold color={theme.primary}>\n {pluginData.manifest.displayName || pluginData.manifest.name}\n </Text>\n <Text color={SEMANTIC_COLORS.dim}>\n {marketplace ? `@${marketplace}` : 'local'} \u00B7 v\n {pluginData.manifest.version}\n </Text>\n <Text>{''}</Text>\n\n <Box flexDirection=\"column\" marginLeft={2}>\n <Text>{pluginData.manifest.description}</Text>\n {pluginData.manifest.author && (\n <Text color={SEMANTIC_COLORS.dim}>\n By {formatAuthor(pluginData.manifest.author)}\n </Text>\n )}\n <Text>\n Status:{' '}\n <Text color={pluginData.enabled ? theme.success : theme.warning}>\n {pluginData.enabled ? 'Enabled' : 'Disabled'}\n </Text>\n </Text>\n\n {componentCounts.length > 0 && (\n <>\n <Text>{''}</Text>\n <Text bold>Components:</Text>\n {pluginData.agents.length > 0 && (\n <Box marginLeft={2}>\n <Text color={SEMANTIC_COLORS.dim}>\n \u2022 Agents: {pluginData.agents.map(a => a.name).join(', ')}\n </Text>\n </Box>\n )}\n {pluginData.commands.length > 0 && (\n <Box marginLeft={2}>\n <Text color={SEMANTIC_COLORS.dim}>\n \u2022 Commands:{' '}\n {pluginData.commands.map(c => `/${c.name}`).join(', ')}\n </Text>\n </Box>\n )}\n {pluginData.skills.length > 0 && (\n <Box marginLeft={2}>\n <Text color={SEMANTIC_COLORS.dim}>\n \u2022 Skills: {pluginData.skills.map(s => s.name).join(', ')}\n </Text>\n </Box>\n )}\n </>\n )}\n </Box>\n\n <Text>{''}</Text>\n <Text bold color={theme.primary}>\n Actions:\n </Text>\n\n {availableActions.map((action, index) => {\n const isSelected = index === selectedIndex\n return (\n <Box key={action.value} marginLeft={2}>\n <Text color={isSelected ? theme.success : undefined}>\n {isSelected ? '\u276F ' : ' '}\n {action.label}\n </Text>\n </Box>\n )\n })}\n\n {actionMessage && (\n <>\n <Text>{''}</Text>\n <Box marginLeft={2}>\n <Text color={theme.warning}>{actionMessage}</Text>\n </Box>\n </>\n )}\n\n <Text>{''}</Text>\n <Box marginLeft={2}>\n <Text color={SEMANTIC_COLORS.dim}>\n \u2191\u2193 Navigate \u00B7 Enter Select \u00B7 Esc Back\n </Text>\n </Box>\n </Box>\n )\n}\n"],
|
|
5
|
+
"mappings": "AAOA,OAAO,SAAS,UAAU,WAAW,mBAAmB;AACxD,SAAS,KAAK,MAAM,gBAAgB;AACpC;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AACP,SAAS,uBAAuB;AAChC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAEP,SAAS,gBAAgB;AAEzB,SAAS,oBAAoB;AAC7B,SAAS,cAAc;AAYhB,MAAM,sBAA0D,CAAC;AAAA,EACtE;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,CAAC,YAAY,aAAa,IAAI,SAAuB,MAAM;AACjE,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAAS,CAAC;AACpD,QAAM,CAAC,aAAa,cAAc,IAAI,SAAS,KAAK;AACpD,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAAwB,IAAI;AACtE,QAAM,CAAC,kBAAkB,mBAAmB,IAAI,SAAS,KAAK;AAC9D,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAAS,EAA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F;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/commands/plugin.js
CHANGED
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
import { MarketplaceError } from "../types/marketplace.js";
|
|
17
17
|
import { rmSync } from "fs";
|
|
18
18
|
import { getTheme } from "../utils/theme.js";
|
|
19
|
+
import { SEMANTIC_COLORS } from "../constants/colors.js";
|
|
19
20
|
import { MainMenu } from "./plugin/MainMenu.js";
|
|
20
21
|
import { MarketplaceSelector } from "./plugin/MarketplaceSelector.js";
|
|
21
22
|
import { PluginBrowser } from "./plugin/PluginBrowser.js";
|
|
@@ -48,7 +49,7 @@ const PluginList = ({ onDone }) => {
|
|
|
48
49
|
return /* @__PURE__ */ React.createElement(Text, { color: theme.error }, "Error: ", error);
|
|
49
50
|
}
|
|
50
51
|
if (plugins.length === 0) {
|
|
51
|
-
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Text, { color: theme.warning }, "No plugins installed."), /* @__PURE__ */ React.createElement(Text, {
|
|
52
|
+
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Text, { color: theme.warning }, "No plugins installed."), /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, "Install plugins with: /plugin install <name>[@marketplace]"));
|
|
52
53
|
}
|
|
53
54
|
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Text, { bold: true, underline: true, color: theme.success }, "Installed Plugins (", plugins.length, ")"), /* @__PURE__ */ React.createElement(Text, null, ""), plugins.map((plugin2) => {
|
|
54
55
|
const componentCounts = [
|
|
@@ -65,10 +66,10 @@ const PluginList = ({ onDone }) => {
|
|
|
65
66
|
flexDirection: "column",
|
|
66
67
|
marginBottom: 1
|
|
67
68
|
},
|
|
68
|
-
/* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: theme.primary, bold: true }, plugin2.manifest.displayName || plugin2.manifest.name), /* @__PURE__ */ React.createElement(Text, {
|
|
69
|
-
plugin2.manifest.description && /* @__PURE__ */ React.createElement(Text, {
|
|
70
|
-
componentCounts.length > 0 && /* @__PURE__ */ React.createElement(Text, {
|
|
71
|
-
/* @__PURE__ */ React.createElement(Text, {
|
|
69
|
+
/* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: theme.primary, bold: true }, plugin2.manifest.displayName || plugin2.manifest.name), /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, " ", "v", plugin2.manifest.version), !plugin2.enabled && /* @__PURE__ */ React.createElement(Text, { color: theme.warning }, " (disabled)")),
|
|
70
|
+
plugin2.manifest.description && /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, " ", plugin2.manifest.description),
|
|
71
|
+
componentCounts.length > 0 && /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, " ", "Components: ", componentCounts.join(", ")),
|
|
72
|
+
/* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, " ", "Location:", " ", plugin2.source.type === "local" ? plugin2.source.path : plugin2.location)
|
|
72
73
|
);
|
|
73
74
|
}));
|
|
74
75
|
};
|
|
@@ -98,7 +99,7 @@ const PluginInfo = ({ pluginName, onDone }) => {
|
|
|
98
99
|
if (error || !plugin2) {
|
|
99
100
|
return /* @__PURE__ */ React.createElement(Text, { color: theme.error }, "Error: ", error || "Plugin not found");
|
|
100
101
|
}
|
|
101
|
-
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Text, { bold: true, underline: true, color: theme.success }, plugin2.manifest.displayName || plugin2.manifest.name), /* @__PURE__ */ React.createElement(Text, null, ""), /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { color: theme.primary }, "Name:"), " ", plugin2.manifest.name), /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { color: theme.primary }, "Version:"), " ", plugin2.manifest.version), plugin2.manifest.description && /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { color: theme.primary }, "Description:"), " ", plugin2.manifest.description), plugin2.manifest.author && /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { color: theme.primary }, "Author:"), " ", plugin2.manifest.author), plugin2.manifest.license && /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { color: theme.primary }, "License:"), " ", plugin2.manifest.license), plugin2.manifest.homepage && /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { color: theme.primary }, "Homepage:"), " ", plugin2.manifest.homepage), plugin2.manifest.repository && /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { color: theme.primary }, "Repository:"), " ", plugin2.manifest.repository), /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { color: theme.primary }, "Location:"), " ", plugin2.location), /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { color: theme.primary }, "Source:"), " ", plugin2.source.type), /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { color: theme.primary }, "Enabled:"), " ", plugin2.enabled ? "Yes" : "No")), /* @__PURE__ */ React.createElement(Text, null, ""), /* @__PURE__ */ React.createElement(Text, { bold: true, color: theme.primary }, "Components:"), plugin2.agents.length > 0 && /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { color: theme.success }, "Agents (", plugin2.agents.length, "):"), plugin2.agents.map((agent) => /* @__PURE__ */ React.createElement(Text, {
|
|
102
|
+
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Text, { bold: true, underline: true, color: theme.success }, plugin2.manifest.displayName || plugin2.manifest.name), /* @__PURE__ */ React.createElement(Text, null, ""), /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { color: theme.primary }, "Name:"), " ", plugin2.manifest.name), /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { color: theme.primary }, "Version:"), " ", plugin2.manifest.version), plugin2.manifest.description && /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { color: theme.primary }, "Description:"), " ", plugin2.manifest.description), plugin2.manifest.author && /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { color: theme.primary }, "Author:"), " ", plugin2.manifest.author), plugin2.manifest.license && /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { color: theme.primary }, "License:"), " ", plugin2.manifest.license), plugin2.manifest.homepage && /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { color: theme.primary }, "Homepage:"), " ", plugin2.manifest.homepage), plugin2.manifest.repository && /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { color: theme.primary }, "Repository:"), " ", plugin2.manifest.repository), /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { color: theme.primary }, "Location:"), " ", plugin2.location), /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { color: theme.primary }, "Source:"), " ", plugin2.source.type), /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { color: theme.primary }, "Enabled:"), " ", plugin2.enabled ? "Yes" : "No")), /* @__PURE__ */ React.createElement(Text, null, ""), /* @__PURE__ */ React.createElement(Text, { bold: true, color: theme.primary }, "Components:"), plugin2.agents.length > 0 && /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { color: theme.success }, "Agents (", plugin2.agents.length, "):"), plugin2.agents.map((agent) => /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, " ", "\u2022 ", agent.name, agent.config.description ? ` - ${agent.config.description}` : ""))), plugin2.commands.length > 0 && /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { color: theme.success }, "Commands (", plugin2.commands.length, "):"), plugin2.commands.map((command) => /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, " ", "\u2022 /", command.name, command.config.description ? ` - ${command.config.description}` : ""))), plugin2.skills.length > 0 && /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { color: theme.success }, "Skills (", plugin2.skills.length, "):"), plugin2.skills.map((skill) => /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, " ", "\u2022 ", skill.name, skill.config.description ? ` - ${skill.config.description}` : ""))), plugin2.hooks.length > 0 && /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { color: theme.success }, "Hooks (", plugin2.hooks.length, "):"), plugin2.hooks.map((hook) => /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, " ", "\u2022 ", hook.name, " (", hook.config.event, ")"))), plugin2.mcpServers.length > 0 && /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { color: theme.success }, "MCP Servers (", plugin2.mcpServers.length, "):"), plugin2.mcpServers.map((server) => /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, " ", "\u2022 ", server.name, " - ", server.config.command))), plugin2.agents.length === 0 && plugin2.commands.length === 0 && plugin2.skills.length === 0 && plugin2.hooks.length === 0 && plugin2.mcpServers.length === 0 && /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, " No components loaded"), plugin2.manifest.engines && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Text, null, ""), /* @__PURE__ */ React.createElement(Text, { bold: true, color: theme.primary }, "Requirements:"), plugin2.manifest.engines.minto && /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, " ", "Minto: ", plugin2.manifest.engines.minto), plugin2.manifest.engines["claude-code"] && /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, " ", "Claude Code: ", plugin2.manifest.engines["claude-code"]), plugin2.manifest.engines.node && /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, " ", "Node: ", plugin2.manifest.engines.node)));
|
|
102
103
|
};
|
|
103
104
|
const PluginInstall = ({
|
|
104
105
|
pluginSpec,
|
|
@@ -143,7 +144,7 @@ const PluginInstall = ({
|
|
|
143
144
|
installPlugin();
|
|
144
145
|
}, [pluginSpec, onDone]);
|
|
145
146
|
const color = status === "success" ? theme.success : status === "error" ? theme.error : theme.primary;
|
|
146
|
-
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Text, { color }, message), status === "success" && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Text, null, ""), /* @__PURE__ */ React.createElement(Text, {
|
|
147
|
+
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Text, { color }, message), status === "success" && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Text, null, ""), /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, "Plugin is now available. Use /plugin info ", pluginSpec.split("@")[0], " ", "to see details.")));
|
|
147
148
|
};
|
|
148
149
|
const PluginUninstall = ({
|
|
149
150
|
pluginName,
|
|
@@ -258,9 +259,9 @@ const MarketplaceListView = ({ onDone }) => {
|
|
|
258
259
|
return /* @__PURE__ */ React.createElement(Text, { color: theme.primary }, "Loading marketplaces...");
|
|
259
260
|
}
|
|
260
261
|
if (marketplaces.length === 0) {
|
|
261
|
-
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Text, { color: theme.warning }, "No marketplaces registered."), /* @__PURE__ */ React.createElement(Text, {
|
|
262
|
+
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Text, { color: theme.warning }, "No marketplaces registered."), /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, "Register a marketplace with: /plugin marketplace add <source>"));
|
|
262
263
|
}
|
|
263
|
-
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Text, { bold: true, underline: true, color: theme.success }, "Registered Marketplaces (", marketplaces.length, ")"), /* @__PURE__ */ React.createElement(Text, null, ""), marketplaces.map((marketplace) => /* @__PURE__ */ React.createElement(Box, { key: marketplace.name, flexDirection: "column", marginBottom: 1 }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: theme.primary, bold: true }, marketplace.name), !marketplace.enabled && /* @__PURE__ */ React.createElement(Text, { color: theme.warning }, " (disabled)")), marketplace.manifest.metadata?.description && /* @__PURE__ */ React.createElement(Text, {
|
|
264
|
+
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Text, { bold: true, underline: true, color: theme.success }, "Registered Marketplaces (", marketplaces.length, ")"), /* @__PURE__ */ React.createElement(Text, null, ""), marketplaces.map((marketplace) => /* @__PURE__ */ React.createElement(Box, { key: marketplace.name, flexDirection: "column", marginBottom: 1 }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: theme.primary, bold: true }, marketplace.name), !marketplace.enabled && /* @__PURE__ */ React.createElement(Text, { color: theme.warning }, " (disabled)")), marketplace.manifest.metadata?.description && /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, " ", marketplace.manifest.metadata.description), /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, ` Plugins: ${marketplace.manifest.plugins.length}`, ` | Owner: ${marketplace.manifest.owner.name}`), /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, ` Source: ${marketplace.source.type}`, marketplace.source.type === "github" && ` (${marketplace.source.repo})`, marketplace.source.type === "url" && ` (${marketplace.source.url})`, marketplace.source.type === "local" && ` (${marketplace.source.path})`), /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, ` Last updated: ${new Date(marketplace.lastUpdated).toLocaleString()}`))));
|
|
264
265
|
};
|
|
265
266
|
const MarketplaceAdd = ({ source, onDone }) => {
|
|
266
267
|
const [status, setStatus] = useState("adding");
|
|
@@ -293,7 +294,7 @@ const MarketplaceAdd = ({ source, onDone }) => {
|
|
|
293
294
|
addMarketplaceAsync();
|
|
294
295
|
}, [source, onDone]);
|
|
295
296
|
const color = status === "success" ? theme.success : status === "error" ? theme.error : theme.primary;
|
|
296
|
-
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Text, { color }, message), status === "success" && marketplace && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Text, null, ""), /* @__PURE__ */ React.createElement(Text, {
|
|
297
|
+
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Text, { color }, message), status === "success" && marketplace && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Text, null, ""), /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, "Marketplace contains ", marketplace.manifest.plugins.length, " plugin(s)"), /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, "Use /plugin marketplace list to see all marketplaces")));
|
|
297
298
|
};
|
|
298
299
|
const MarketplaceUpdate = ({
|
|
299
300
|
name,
|
|
@@ -435,10 +436,10 @@ const MarketplaceDetails = ({ marketplace: marketplaceName, onNavigate, onBack,
|
|
|
435
436
|
marketplace.manifest.metadata?.description && /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, null, marketplace.manifest.metadata.description)),
|
|
436
437
|
/* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, null, "Plugins: "), /* @__PURE__ */ React.createElement(Text, { color: theme.primary }, marketplace.manifest.plugins.length)),
|
|
437
438
|
/* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, null, "Owner: "), /* @__PURE__ */ React.createElement(Text, null, marketplace.manifest.owner.name)),
|
|
438
|
-
/* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, null, "Source: "), /* @__PURE__ */ React.createElement(Text, {
|
|
439
|
-
/* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, null, "Last updated: "), /* @__PURE__ */ React.createElement(Text, {
|
|
439
|
+
/* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, null, "Source: "), /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, marketplace.source.type, marketplace.source.type === "github" && ` (${marketplace.source.repo})`, marketplace.source.type === "url" && ` (${marketplace.source.url})`, marketplace.source.type === "local" && ` (${marketplace.source.path})`)),
|
|
440
|
+
/* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, null, "Last updated: "), /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, new Date(marketplace.lastUpdated).toLocaleString())),
|
|
440
441
|
error && /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { color: theme.error }, "Error: ", error)),
|
|
441
|
-
/* @__PURE__ */ React.createElement(Box, { marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React.createElement(Text, {
|
|
442
|
+
/* @__PURE__ */ React.createElement(Box, { marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, "Press ", /* @__PURE__ */ React.createElement(Text, { bold: true }, "p"), " to view plugins from this marketplace"), /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, "Press ", /* @__PURE__ */ React.createElement(Text, { bold: true }, "u"), " to update marketplace"), /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, "Press ", /* @__PURE__ */ React.createElement(Text, { bold: true }, "r"), " to remove marketplace"), /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, "Press ", /* @__PURE__ */ React.createElement(Text, { bold: true }, "Esc"), " to go back"))
|
|
442
443
|
);
|
|
443
444
|
};
|
|
444
445
|
const InteractivePluginCommand = ({
|
|
@@ -557,7 +558,7 @@ const InteractivePluginCommand = ({
|
|
|
557
558
|
}
|
|
558
559
|
);
|
|
559
560
|
default:
|
|
560
|
-
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Text, { color: "red" }, "Unknown screen state"), /* @__PURE__ */ React.createElement(Text, {
|
|
561
|
+
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Text, { color: "red" }, "Unknown screen state"), /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, "Press Esc to exit"));
|
|
561
562
|
}
|
|
562
563
|
};
|
|
563
564
|
const LegacyPluginCommand = ({
|
|
@@ -574,7 +575,7 @@ const LegacyPluginCommand = ({
|
|
|
574
575
|
}
|
|
575
576
|
}, [subcommand, onDone]);
|
|
576
577
|
if (!subcommand || subcommand === "help" || subcommand === "--help") {
|
|
577
|
-
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Text, { bold: true, underline: true, color: theme.primary }, "Plugin Management Commands"), /* @__PURE__ */ React.createElement(Text, null, ""), /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { color: theme.success }, "/plugin list"), " - List all installed plugins"), /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { color: theme.success }, "/plugin info <name>"), " - Show detailed plugin information"), /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { color: theme.success }, "/plugin install <name>[@marketplace]"), " ", "- Install plugin from marketplace"), /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { color: theme.success }, "/plugin uninstall <name>"), " - Remove installed plugin"), /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { color: theme.success }, "/plugin validate [name]"), " - Validate plugin manifest and components"), /* @__PURE__ */ React.createElement(Text, null, ""), /* @__PURE__ */ React.createElement(Text, { bold: true, color: theme.primary }, "Marketplace Commands:"), /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { color: theme.success }, "/plugin marketplace add <source>"), " ", "- Register new marketplace"), /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { color: theme.success }, "/plugin marketplace list"), " - List registered marketplaces"), /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { color: theme.success }, "/plugin marketplace update <name>"), " ", "- Update marketplace manifest"), /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { color: theme.success }, "/plugin marketplace remove <name>"), " ", "- Unregister marketplace"), /* @__PURE__ */ React.createElement(Text, null, ""), /* @__PURE__ */ React.createElement(Text, {
|
|
578
|
+
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Text, { bold: true, underline: true, color: theme.primary }, "Plugin Management Commands"), /* @__PURE__ */ React.createElement(Text, null, ""), /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { color: theme.success }, "/plugin list"), " - List all installed plugins"), /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { color: theme.success }, "/plugin info <name>"), " - Show detailed plugin information"), /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { color: theme.success }, "/plugin install <name>[@marketplace]"), " ", "- Install plugin from marketplace"), /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { color: theme.success }, "/plugin uninstall <name>"), " - Remove installed plugin"), /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { color: theme.success }, "/plugin validate [name]"), " - Validate plugin manifest and components"), /* @__PURE__ */ React.createElement(Text, null, ""), /* @__PURE__ */ React.createElement(Text, { bold: true, color: theme.primary }, "Marketplace Commands:"), /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { color: theme.success }, "/plugin marketplace add <source>"), " ", "- Register new marketplace"), /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { color: theme.success }, "/plugin marketplace list"), " - List registered marketplaces"), /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { color: theme.success }, "/plugin marketplace update <name>"), " ", "- Update marketplace manifest"), /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { color: theme.success }, "/plugin marketplace remove <name>"), " ", "- Unregister marketplace"), /* @__PURE__ */ React.createElement(Text, null, ""), /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, "Examples:"), /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, " /plugin list"), /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, " /plugin info my-plugin"), /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, " ", "/plugin install awesome-plugin@official"), /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, " ", "/plugin marketplace add owner/repo"));
|
|
578
579
|
}
|
|
579
580
|
switch (subcommand) {
|
|
580
581
|
case "list":
|