@within-7/minto 0.0.5-dev.1
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/LICENSE +201 -0
- package/README.md +1097 -0
- package/README.zh-CN.md +1097 -0
- package/cli.js +59 -0
- package/dist/Tool.js +1 -0
- package/dist/Tool.js.map +7 -0
- package/dist/commands/agents.js +2086 -0
- package/dist/commands/agents.js.map +7 -0
- package/dist/commands/approvedTools.js +36 -0
- package/dist/commands/approvedTools.js.map +7 -0
- package/dist/commands/bug.js +21 -0
- package/dist/commands/bug.js.map +7 -0
- package/dist/commands/build.js +74 -0
- package/dist/commands/build.js.map +7 -0
- package/dist/commands/clear.js +37 -0
- package/dist/commands/clear.js.map +7 -0
- package/dist/commands/compact.js +82 -0
- package/dist/commands/compact.js.map +7 -0
- package/dist/commands/compression.js +57 -0
- package/dist/commands/compression.js.map +7 -0
- package/dist/commands/config.js +20 -0
- package/dist/commands/config.js.map +7 -0
- package/dist/commands/cost.js +19 -0
- package/dist/commands/cost.js.map +7 -0
- package/dist/commands/ctx_viz.js +152 -0
- package/dist/commands/ctx_viz.js.map +7 -0
- package/dist/commands/doctor.js +25 -0
- package/dist/commands/doctor.js.map +7 -0
- package/dist/commands/help.js +20 -0
- package/dist/commands/help.js.map +7 -0
- package/dist/commands/init.js +38 -0
- package/dist/commands/init.js.map +7 -0
- package/dist/commands/listen.js +37 -0
- package/dist/commands/listen.js.map +7 -0
- package/dist/commands/login.js +37 -0
- package/dist/commands/login.js.map +7 -0
- package/dist/commands/logout.js +33 -0
- package/dist/commands/logout.js.map +7 -0
- package/dist/commands/mcp-interactive.js +267 -0
- package/dist/commands/mcp-interactive.js.map +7 -0
- package/dist/commands/mcp.js +40 -0
- package/dist/commands/mcp.js.map +7 -0
- package/dist/commands/mcp_refresh.js +40 -0
- package/dist/commands/mcp_refresh.js.map +7 -0
- package/dist/commands/model.js +41 -0
- package/dist/commands/model.js.map +7 -0
- package/dist/commands/modelstatus.js +21 -0
- package/dist/commands/modelstatus.js.map +7 -0
- package/dist/commands/onboarding.js +36 -0
- package/dist/commands/onboarding.js.map +7 -0
- package/dist/commands/plugin/AddMarketplaceForm.js +62 -0
- package/dist/commands/plugin/AddMarketplaceForm.js.map +7 -0
- package/dist/commands/plugin/ConfirmDialog.js +71 -0
- package/dist/commands/plugin/ConfirmDialog.js.map +7 -0
- package/dist/commands/plugin/ErrorView.js +33 -0
- package/dist/commands/plugin/ErrorView.js.map +7 -0
- package/dist/commands/plugin/InstalledPluginsByMarketplace.js +135 -0
- package/dist/commands/plugin/InstalledPluginsByMarketplace.js.map +7 -0
- package/dist/commands/plugin/InstalledPluginsManager.js +99 -0
- package/dist/commands/plugin/InstalledPluginsManager.js.map +7 -0
- package/dist/commands/plugin/LoadingView.js +14 -0
- package/dist/commands/plugin/LoadingView.js.map +7 -0
- package/dist/commands/plugin/MainMenu.js +57 -0
- package/dist/commands/plugin/MainMenu.js.map +7 -0
- package/dist/commands/plugin/MarketplaceManager.js +155 -0
- package/dist/commands/plugin/MarketplaceManager.js.map +7 -0
- package/dist/commands/plugin/MarketplaceSelector.js +119 -0
- package/dist/commands/plugin/MarketplaceSelector.js.map +7 -0
- package/dist/commands/plugin/PlaceholderScreen.js +16 -0
- package/dist/commands/plugin/PlaceholderScreen.js.map +7 -0
- package/dist/commands/plugin/PluginBrowser.js +180 -0
- package/dist/commands/plugin/PluginBrowser.js.map +7 -0
- package/dist/commands/plugin/PluginDetailsInstall.js +152 -0
- package/dist/commands/plugin/PluginDetailsInstall.js.map +7 -0
- package/dist/commands/plugin/PluginDetailsManage.js +200 -0
- package/dist/commands/plugin/PluginDetailsManage.js.map +7 -0
- package/dist/commands/plugin/components.js +16 -0
- package/dist/commands/plugin/components.js.map +7 -0
- package/dist/commands/plugin/example-usage.js +63 -0
- package/dist/commands/plugin/example-usage.js.map +7 -0
- package/dist/commands/plugin/types.js +1 -0
- package/dist/commands/plugin/types.js.map +7 -0
- package/dist/commands/plugin/utils.js +77 -0
- package/dist/commands/plugin/utils.js.map +7 -0
- package/dist/commands/plugin-interactive.js +446 -0
- package/dist/commands/plugin-interactive.js.map +7 -0
- package/dist/commands/plugin.js +523 -0
- package/dist/commands/plugin.js.map +7 -0
- package/dist/commands/pr_comments.js +61 -0
- package/dist/commands/pr_comments.js.map +7 -0
- package/dist/commands/quit.js +16 -0
- package/dist/commands/quit.js.map +7 -0
- package/dist/commands/refreshCommands.js +43 -0
- package/dist/commands/refreshCommands.js.map +7 -0
- package/dist/commands/release-notes.js +30 -0
- package/dist/commands/release-notes.js.map +7 -0
- package/dist/commands/resume.js +35 -0
- package/dist/commands/resume.js.map +7 -0
- package/dist/commands/review.js +51 -0
- package/dist/commands/review.js.map +7 -0
- package/dist/commands/terminalSetup.js +164 -0
- package/dist/commands/terminalSetup.js.map +7 -0
- package/dist/commands.js +104 -0
- package/dist/commands.js.map +7 -0
- package/dist/components/AgentResponseBlock.js +41 -0
- package/dist/components/AgentResponseBlock.js.map +7 -0
- package/dist/components/AgentThinkingBlock.js +40 -0
- package/dist/components/AgentThinkingBlock.js.map +7 -0
- package/dist/components/AsciiLogo.js +19 -0
- package/dist/components/AsciiLogo.js.map +7 -0
- package/dist/components/BackgroundTasksPanel.js +124 -0
- package/dist/components/BackgroundTasksPanel.js.map +7 -0
- package/dist/components/Bug.js +147 -0
- package/dist/components/Bug.js.map +7 -0
- package/dist/components/Config.js +166 -0
- package/dist/components/Config.js.map +7 -0
- package/dist/components/ConsoleOAuthFlow.js +178 -0
- package/dist/components/ConsoleOAuthFlow.js.map +7 -0
- package/dist/components/Cost.js +13 -0
- package/dist/components/Cost.js.map +7 -0
- package/dist/components/CostThresholdDialog.js +38 -0
- package/dist/components/CostThresholdDialog.js.map +7 -0
- package/dist/components/CustomSelect/option-map.js +32 -0
- package/dist/components/CustomSelect/option-map.js.map +7 -0
- package/dist/components/CustomSelect/select-option.js +34 -0
- package/dist/components/CustomSelect/select-option.js.map +7 -0
- package/dist/components/CustomSelect/select.js +64 -0
- package/dist/components/CustomSelect/select.js.map +7 -0
- package/dist/components/CustomSelect/theme.js +1 -0
- package/dist/components/CustomSelect/theme.js.map +7 -0
- package/dist/components/CustomSelect/use-select-state.js +220 -0
- package/dist/components/CustomSelect/use-select-state.js.map +7 -0
- package/dist/components/CustomSelect/use-select.js +21 -0
- package/dist/components/CustomSelect/use-select.js.map +7 -0
- package/dist/components/FallbackToolUseRejectedMessage.js +11 -0
- package/dist/components/FallbackToolUseRejectedMessage.js.map +7 -0
- package/dist/components/FileEditToolUpdatedMessage.js +32 -0
- package/dist/components/FileEditToolUpdatedMessage.js.map +7 -0
- package/dist/components/HeaderBar.js +57 -0
- package/dist/components/HeaderBar.js.map +7 -0
- package/dist/components/Help.js +46 -0
- package/dist/components/Help.js.map +7 -0
- package/dist/components/HighlightedCode.js +30 -0
- package/dist/components/HighlightedCode.js.map +7 -0
- package/dist/components/HistorySearchOverlay.js +48 -0
- package/dist/components/HistorySearchOverlay.js.map +7 -0
- package/dist/components/InteractionRoundBlock.js +56 -0
- package/dist/components/InteractionRoundBlock.js.map +7 -0
- package/dist/components/InvalidConfigDialog.js +83 -0
- package/dist/components/InvalidConfigDialog.js.map +7 -0
- package/dist/components/Link.js +18 -0
- package/dist/components/Link.js.map +7 -0
- package/dist/components/LogSelector.js +50 -0
- package/dist/components/LogSelector.js.map +7 -0
- package/dist/components/Logo.js +96 -0
- package/dist/components/Logo.js.map +7 -0
- package/dist/components/MCPServerApprovalDialog.js +79 -0
- package/dist/components/MCPServerApprovalDialog.js.map +7 -0
- package/dist/components/MCPServerDialogCopy.js +11 -0
- package/dist/components/MCPServerDialogCopy.js.map +7 -0
- package/dist/components/MCPServerMultiselectDialog.js +80 -0
- package/dist/components/MCPServerMultiselectDialog.js.map +7 -0
- package/dist/components/Message.js +146 -0
- package/dist/components/Message.js.map +7 -0
- package/dist/components/MessageResponse.js +9 -0
- package/dist/components/MessageResponse.js.map +7 -0
- package/dist/components/MessageSelector.js +125 -0
- package/dist/components/MessageSelector.js.map +7 -0
- package/dist/components/ModeIndicator.js +38 -0
- package/dist/components/ModeIndicator.js.map +7 -0
- package/dist/components/ModelConfig.js +208 -0
- package/dist/components/ModelConfig.js.map +7 -0
- package/dist/components/ModelListManager.js +140 -0
- package/dist/components/ModelListManager.js.map +7 -0
- package/dist/components/ModelSelector.js +2062 -0
- package/dist/components/ModelSelector.js.map +7 -0
- package/dist/components/ModelStatusDisplay.js +87 -0
- package/dist/components/ModelStatusDisplay.js.map +7 -0
- package/dist/components/Onboarding.js +153 -0
- package/dist/components/Onboarding.js.map +7 -0
- package/dist/components/PressEnterToContinue.js +10 -0
- package/dist/components/PressEnterToContinue.js.map +7 -0
- package/dist/components/ProjectOnboarding.js +99 -0
- package/dist/components/ProjectOnboarding.js.map +7 -0
- package/dist/components/PromptInput.js +755 -0
- package/dist/components/PromptInput.js.map +7 -0
- package/dist/components/QuitSummary.js +81 -0
- package/dist/components/QuitSummary.js.map +7 -0
- package/dist/components/SentryErrorBoundary.js +27 -0
- package/dist/components/SentryErrorBoundary.js.map +7 -0
- package/dist/components/Spinner.js +101 -0
- package/dist/components/Spinner.js.map +7 -0
- package/dist/components/SpinnerSymbol.js +78 -0
- package/dist/components/SpinnerSymbol.js.map +7 -0
- package/dist/components/StreamingBashOutput.js +70 -0
- package/dist/components/StreamingBashOutput.js.map +7 -0
- package/dist/components/StructuredDiff.js +148 -0
- package/dist/components/StructuredDiff.js.map +7 -0
- package/dist/components/SubagentBlock.js +157 -0
- package/dist/components/SubagentBlock.js.map +7 -0
- package/dist/components/SubagentManager.js +65 -0
- package/dist/components/SubagentManager.js.map +7 -0
- package/dist/components/SubagentProgress.js +109 -0
- package/dist/components/SubagentProgress.js.map +7 -0
- package/dist/components/SubagentStatusMarker.js +37 -0
- package/dist/components/SubagentStatusMarker.js.map +7 -0
- package/dist/components/TaskCard.js +170 -0
- package/dist/components/TaskCard.js.map +7 -0
- package/dist/components/TextInput.js +100 -0
- package/dist/components/TextInput.js.map +7 -0
- package/dist/components/TimelineRenderer.js +31 -0
- package/dist/components/TimelineRenderer.js.map +7 -0
- package/dist/components/TodoChangeBlock.js +29 -0
- package/dist/components/TodoChangeBlock.js.map +7 -0
- package/dist/components/TodoChangeLine.js +22 -0
- package/dist/components/TodoChangeLine.js.map +7 -0
- package/dist/components/TodoItem.js +35 -0
- package/dist/components/TodoItem.js.map +7 -0
- package/dist/components/TodoPanel.js +55 -0
- package/dist/components/TodoPanel.js.map +7 -0
- package/dist/components/TokenWarning.js +19 -0
- package/dist/components/TokenWarning.js.map +7 -0
- package/dist/components/ToolExecutionBlock.js +18 -0
- package/dist/components/ToolExecutionBlock.js.map +7 -0
- package/dist/components/ToolUseLoader.js +24 -0
- package/dist/components/ToolUseLoader.js.map +7 -0
- package/dist/components/TrustDialog.js +71 -0
- package/dist/components/TrustDialog.js.map +7 -0
- package/dist/components/UserQueryBlock.js +12 -0
- package/dist/components/UserQueryBlock.js.map +7 -0
- package/dist/components/binary-feedback/BinaryFeedback.js +50 -0
- package/dist/components/binary-feedback/BinaryFeedback.js.map +7 -0
- package/dist/components/binary-feedback/BinaryFeedbackOption.js +94 -0
- package/dist/components/binary-feedback/BinaryFeedbackOption.js.map +7 -0
- package/dist/components/binary-feedback/BinaryFeedbackView.js +139 -0
- package/dist/components/binary-feedback/BinaryFeedbackView.js.map +7 -0
- package/dist/components/binary-feedback/utils.js +108 -0
- package/dist/components/binary-feedback/utils.js.map +7 -0
- package/dist/components/messages/AssistantBashOutputMessage.js +23 -0
- package/dist/components/messages/AssistantBashOutputMessage.js.map +7 -0
- package/dist/components/messages/AssistantLocalCommandOutputMessage.js +36 -0
- package/dist/components/messages/AssistantLocalCommandOutputMessage.js.map +7 -0
- package/dist/components/messages/AssistantRedactedThinkingMessage.js +12 -0
- package/dist/components/messages/AssistantRedactedThinkingMessage.js.map +7 -0
- package/dist/components/messages/AssistantTextMessage.js +78 -0
- package/dist/components/messages/AssistantTextMessage.js.map +7 -0
- package/dist/components/messages/AssistantThinkingMessage.js +27 -0
- package/dist/components/messages/AssistantThinkingMessage.js.map +7 -0
- package/dist/components/messages/AssistantToolUseMessage.js +91 -0
- package/dist/components/messages/AssistantToolUseMessage.js.map +7 -0
- package/dist/components/messages/TaskProgressMessage.js +11 -0
- package/dist/components/messages/TaskProgressMessage.js.map +7 -0
- package/dist/components/messages/TaskToolMessage.js +39 -0
- package/dist/components/messages/TaskToolMessage.js.map +7 -0
- package/dist/components/messages/UserBashInputMessage.js +18 -0
- package/dist/components/messages/UserBashInputMessage.js.map +7 -0
- package/dist/components/messages/UserCommandMessage.js +20 -0
- package/dist/components/messages/UserCommandMessage.js.map +7 -0
- package/dist/components/messages/UserKodingInputMessage.js +18 -0
- package/dist/components/messages/UserKodingInputMessage.js.map +7 -0
- package/dist/components/messages/UserPromptMessage.js +20 -0
- package/dist/components/messages/UserPromptMessage.js.map +7 -0
- package/dist/components/messages/UserTextMessage.js +25 -0
- package/dist/components/messages/UserTextMessage.js.map +7 -0
- package/dist/components/messages/UserToolResultMessage/UserToolCanceledMessage.js +10 -0
- package/dist/components/messages/UserToolResultMessage/UserToolCanceledMessage.js.map +7 -0
- package/dist/components/messages/UserToolResultMessage/UserToolErrorMessage.js +15 -0
- package/dist/components/messages/UserToolResultMessage/UserToolErrorMessage.js.map +7 -0
- package/dist/components/messages/UserToolResultMessage/UserToolRejectMessage.js +25 -0
- package/dist/components/messages/UserToolResultMessage/UserToolRejectMessage.js.map +7 -0
- package/dist/components/messages/UserToolResultMessage/UserToolResultMessage.js +47 -0
- package/dist/components/messages/UserToolResultMessage/UserToolResultMessage.js.map +7 -0
- package/dist/components/messages/UserToolResultMessage/UserToolSuccessMessage.js +23 -0
- package/dist/components/messages/UserToolResultMessage/UserToolSuccessMessage.js.map +7 -0
- package/dist/components/messages/UserToolResultMessage/utils.js +50 -0
- package/dist/components/messages/UserToolResultMessage/utils.js.map +7 -0
- package/dist/components/permissions/BashPermissionRequest/BashPermissionRequest.js +112 -0
- package/dist/components/permissions/BashPermissionRequest/BashPermissionRequest.js.map +7 -0
- package/dist/components/permissions/FallbackPermissionRequest.js +131 -0
- package/dist/components/permissions/FallbackPermissionRequest.js.map +7 -0
- package/dist/components/permissions/FileEditPermissionRequest/FileEditPermissionRequest.js +159 -0
- package/dist/components/permissions/FileEditPermissionRequest/FileEditPermissionRequest.js.map +7 -0
- package/dist/components/permissions/FileEditPermissionRequest/FileEditToolDiff.js +58 -0
- package/dist/components/permissions/FileEditPermissionRequest/FileEditToolDiff.js.map +7 -0
- package/dist/components/permissions/FileWritePermissionRequest/FileWritePermissionRequest.js +153 -0
- package/dist/components/permissions/FileWritePermissionRequest/FileWritePermissionRequest.js.map +7 -0
- package/dist/components/permissions/FileWritePermissionRequest/FileWriteToolDiff.js +70 -0
- package/dist/components/permissions/FileWritePermissionRequest/FileWriteToolDiff.js.map +7 -0
- package/dist/components/permissions/FilesystemPermissionRequest/FilesystemPermissionRequest.js +212 -0
- package/dist/components/permissions/FilesystemPermissionRequest/FilesystemPermissionRequest.js.map +7 -0
- package/dist/components/permissions/PermissionRequest.js +70 -0
- package/dist/components/permissions/PermissionRequest.js.map +7 -0
- package/dist/components/permissions/PermissionRequestTitle.js +52 -0
- package/dist/components/permissions/PermissionRequestTitle.js.map +7 -0
- package/dist/components/permissions/hooks.js +23 -0
- package/dist/components/permissions/hooks.js.map +7 -0
- package/dist/components/permissions/toolUseOptions.js +46 -0
- package/dist/components/permissions/toolUseOptions.js.map +7 -0
- package/dist/components/permissions/utils.js +21 -0
- package/dist/components/permissions/utils.js.map +7 -0
- package/dist/constants/claude-asterisk-ascii-art.js +242 -0
- package/dist/constants/claude-asterisk-ascii-art.js.map +7 -0
- package/dist/constants/colors.js +126 -0
- package/dist/constants/colors.js.map +7 -0
- package/dist/constants/compressionPrompts.js +73 -0
- package/dist/constants/compressionPrompts.js.map +7 -0
- package/dist/constants/figures.js +6 -0
- package/dist/constants/figures.js.map +7 -0
- package/dist/constants/macros.js +11 -0
- package/dist/constants/macros.js.map +7 -0
- package/dist/constants/modelCapabilities.js +154 -0
- package/dist/constants/modelCapabilities.js.map +7 -0
- package/dist/constants/models.js +1034 -0
- package/dist/constants/models.js.map +7 -0
- package/dist/constants/oauth.js +18 -0
- package/dist/constants/oauth.js.map +7 -0
- package/dist/constants/product.js +26 -0
- package/dist/constants/product.js.map +7 -0
- package/dist/constants/prompts.js +168 -0
- package/dist/constants/prompts.js.map +7 -0
- package/dist/constants/releaseNotes.js +9 -0
- package/dist/constants/releaseNotes.js.map +7 -0
- package/dist/constants/symbols.js +50 -0
- package/dist/constants/symbols.js.map +7 -0
- package/dist/context/PermissionContext.js +111 -0
- package/dist/context/PermissionContext.js.map +7 -0
- package/dist/context.js +278 -0
- package/dist/context.js.map +7 -0
- package/dist/cost-tracker.js +76 -0
- package/dist/cost-tracker.js.map +7 -0
- package/dist/entrypoints/cli-wrapper.js +61 -0
- package/dist/entrypoints/cli-wrapper.js.map +7 -0
- package/dist/entrypoints/cli.js +1115 -0
- package/dist/entrypoints/cli.js.map +7 -0
- package/dist/entrypoints/mcp.js +150 -0
- package/dist/entrypoints/mcp.js.map +7 -0
- package/dist/history.js +25 -0
- package/dist/history.js.map +7 -0
- package/dist/hooks/useApiKeyVerification.js +12 -0
- package/dist/hooks/useApiKeyVerification.js.map +7 -0
- package/dist/hooks/useArrowKeyHistory.js +50 -0
- package/dist/hooks/useArrowKeyHistory.js.map +7 -0
- package/dist/hooks/useCanUseTool.js +87 -0
- package/dist/hooks/useCanUseTool.js.map +7 -0
- package/dist/hooks/useCancelRequest.js +28 -0
- package/dist/hooks/useCancelRequest.js.map +7 -0
- package/dist/hooks/useDoublePress.js +31 -0
- package/dist/hooks/useDoublePress.js.map +7 -0
- package/dist/hooks/useExitOnCtrlCD.js +26 -0
- package/dist/hooks/useExitOnCtrlCD.js.map +7 -0
- package/dist/hooks/useHistorySearch.js +62 -0
- package/dist/hooks/useHistorySearch.js.map +7 -0
- package/dist/hooks/useInterval.js +18 -0
- package/dist/hooks/useInterval.js.map +7 -0
- package/dist/hooks/useLogMessages.js +14 -0
- package/dist/hooks/useLogMessages.js.map +7 -0
- package/dist/hooks/useLogStartupTime.js +10 -0
- package/dist/hooks/useLogStartupTime.js.map +7 -0
- package/dist/hooks/useNotifyAfterTimeout.js +42 -0
- package/dist/hooks/useNotifyAfterTimeout.js.map +7 -0
- package/dist/hooks/usePermissionRequestLogging.js +23 -0
- package/dist/hooks/usePermissionRequestLogging.js.map +7 -0
- package/dist/hooks/useTerminalSize.js +38 -0
- package/dist/hooks/useTerminalSize.js.map +7 -0
- package/dist/hooks/useTextInput.js +252 -0
- package/dist/hooks/useTextInput.js.map +7 -0
- package/dist/hooks/useUnifiedCompletion.js +929 -0
- package/dist/hooks/useUnifiedCompletion.js.map +7 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +7 -0
- package/dist/messages.js +33 -0
- package/dist/messages.js.map +7 -0
- package/dist/package.json +4 -0
- package/dist/permissions.js +194 -0
- package/dist/permissions.js.map +7 -0
- package/dist/query.js +499 -0
- package/dist/query.js.map +7 -0
- package/dist/screens/Doctor.js +22 -0
- package/dist/screens/Doctor.js.map +7 -0
- package/dist/screens/LogList.js +55 -0
- package/dist/screens/LogList.js.map +7 -0
- package/dist/screens/REPL.js +671 -0
- package/dist/screens/REPL.js.map +7 -0
- package/dist/screens/ResumeConversation.js +56 -0
- package/dist/screens/ResumeConversation.js.map +7 -0
- package/dist/services/adapters/base.js +29 -0
- package/dist/services/adapters/base.js.map +7 -0
- package/dist/services/adapters/chatCompletions.js +69 -0
- package/dist/services/adapters/chatCompletions.js.map +7 -0
- package/dist/services/adapters/responsesAPI.js +126 -0
- package/dist/services/adapters/responsesAPI.js.map +7 -0
- package/dist/services/claude.js +1573 -0
- package/dist/services/claude.js.map +7 -0
- package/dist/services/compressionService.js +210 -0
- package/dist/services/compressionService.js.map +7 -0
- package/dist/services/customCommands.js +437 -0
- package/dist/services/customCommands.js.map +7 -0
- package/dist/services/fileFreshness.js +275 -0
- package/dist/services/fileFreshness.js.map +7 -0
- package/dist/services/gpt5ConnectionTest.js +248 -0
- package/dist/services/gpt5ConnectionTest.js.map +7 -0
- package/dist/services/hookExecutor.js +276 -0
- package/dist/services/hookExecutor.js.map +7 -0
- package/dist/services/mainAgentCompressor.js +84 -0
- package/dist/services/mainAgentCompressor.js.map +7 -0
- package/dist/services/mcpClient.js +449 -0
- package/dist/services/mcpClient.js.map +7 -0
- package/dist/services/mcpServerApproval.js +55 -0
- package/dist/services/mcpServerApproval.js.map +7 -0
- package/dist/services/mentionProcessor.js +201 -0
- package/dist/services/mentionProcessor.js.map +7 -0
- package/dist/services/modelAdapterFactory.js +47 -0
- package/dist/services/modelAdapterFactory.js.map +7 -0
- package/dist/services/notifier.js +35 -0
- package/dist/services/notifier.js.map +7 -0
- package/dist/services/oauth.js +247 -0
- package/dist/services/oauth.js.map +7 -0
- package/dist/services/openai.js +995 -0
- package/dist/services/openai.js.map +7 -0
- package/dist/services/responseStateManager.js +68 -0
- package/dist/services/responseStateManager.js.map +7 -0
- package/dist/services/sentry.js +9 -0
- package/dist/services/sentry.js.map +7 -0
- package/dist/services/subagentAbortManager.js +95 -0
- package/dist/services/subagentAbortManager.js.map +7 -0
- package/dist/services/subagentCompressor.js +146 -0
- package/dist/services/subagentCompressor.js.map +7 -0
- package/dist/services/systemReminder.js +335 -0
- package/dist/services/systemReminder.js.map +7 -0
- package/dist/services/vcr.js +133 -0
- package/dist/services/vcr.js.map +7 -0
- package/dist/tools/ArchitectTool/ArchitectTool.js +119 -0
- package/dist/tools/ArchitectTool/ArchitectTool.js.map +7 -0
- package/dist/tools/ArchitectTool/prompt.js +18 -0
- package/dist/tools/ArchitectTool/prompt.js.map +7 -0
- package/dist/tools/AskExpertModelTool/AskExpertModelTool.js +423 -0
- package/dist/tools/AskExpertModelTool/AskExpertModelTool.js.map +7 -0
- package/dist/tools/BashOutputTool/BashOutputTool.js +120 -0
- package/dist/tools/BashOutputTool/BashOutputTool.js.map +7 -0
- package/dist/tools/BashOutputTool/BashOutputToolResultMessage.js +11 -0
- package/dist/tools/BashOutputTool/BashOutputToolResultMessage.js.map +7 -0
- package/dist/tools/BashOutputTool/prompt.js +13 -0
- package/dist/tools/BashOutputTool/prompt.js.map +7 -0
- package/dist/tools/BashTool/BashTool.js +209 -0
- package/dist/tools/BashTool/BashTool.js.map +7 -0
- package/dist/tools/BashTool/BashToolResultMessage.js +21 -0
- package/dist/tools/BashTool/BashToolResultMessage.js.map +7 -0
- package/dist/tools/BashTool/OutputLine.js +30 -0
- package/dist/tools/BashTool/OutputLine.js.map +7 -0
- package/dist/tools/BashTool/prompt.js +180 -0
- package/dist/tools/BashTool/prompt.js.map +7 -0
- package/dist/tools/BashTool/utils.js +51 -0
- package/dist/tools/BashTool/utils.js.map +7 -0
- package/dist/tools/FileEditTool/FileEditTool.js +226 -0
- package/dist/tools/FileEditTool/FileEditTool.js.map +7 -0
- package/dist/tools/FileEditTool/prompt.js +54 -0
- package/dist/tools/FileEditTool/prompt.js.map +7 -0
- package/dist/tools/FileEditTool/utils.js +42 -0
- package/dist/tools/FileEditTool/utils.js.map +7 -0
- package/dist/tools/FileReadTool/FileReadTool.js +272 -0
- package/dist/tools/FileReadTool/FileReadTool.js.map +7 -0
- package/dist/tools/FileReadTool/prompt.js +10 -0
- package/dist/tools/FileReadTool/prompt.js.map +7 -0
- package/dist/tools/FileWriteTool/FileWriteTool.js +202 -0
- package/dist/tools/FileWriteTool/FileWriteTool.js.map +7 -0
- package/dist/tools/FileWriteTool/prompt.js +14 -0
- package/dist/tools/FileWriteTool/prompt.js.map +7 -0
- package/dist/tools/GlobTool/GlobTool.js +88 -0
- package/dist/tools/GlobTool/GlobTool.js.map +7 -0
- package/dist/tools/GlobTool/prompt.js +12 -0
- package/dist/tools/GlobTool/prompt.js.map +7 -0
- package/dist/tools/GrepTool/GrepTool.js +107 -0
- package/dist/tools/GrepTool/GrepTool.js.map +7 -0
- package/dist/tools/GrepTool/prompt.js +15 -0
- package/dist/tools/GrepTool/prompt.js.map +7 -0
- package/dist/tools/KillShellTool/KillShellTool.js +92 -0
- package/dist/tools/KillShellTool/KillShellTool.js.map +7 -0
- package/dist/tools/KillShellTool/KillShellToolResultMessage.js +11 -0
- package/dist/tools/KillShellTool/KillShellToolResultMessage.js.map +7 -0
- package/dist/tools/KillShellTool/prompt.js +12 -0
- package/dist/tools/KillShellTool/prompt.js.map +7 -0
- package/dist/tools/MCPTool/MCPTool.js +90 -0
- package/dist/tools/MCPTool/MCPTool.js.map +7 -0
- package/dist/tools/MCPTool/prompt.js +7 -0
- package/dist/tools/MCPTool/prompt.js.map +7 -0
- package/dist/tools/MemoryReadTool/MemoryReadTool.js +103 -0
- package/dist/tools/MemoryReadTool/MemoryReadTool.js.map +7 -0
- package/dist/tools/MemoryReadTool/prompt.js +7 -0
- package/dist/tools/MemoryReadTool/prompt.js.map +7 -0
- package/dist/tools/MemoryWriteTool/MemoryWriteTool.js +77 -0
- package/dist/tools/MemoryWriteTool/MemoryWriteTool.js.map +7 -0
- package/dist/tools/MemoryWriteTool/prompt.js +7 -0
- package/dist/tools/MemoryWriteTool/prompt.js.map +7 -0
- package/dist/tools/MultiEditTool/MultiEditTool.js +301 -0
- package/dist/tools/MultiEditTool/MultiEditTool.js.map +7 -0
- package/dist/tools/MultiEditTool/prompt.js +48 -0
- package/dist/tools/MultiEditTool/prompt.js.map +7 -0
- package/dist/tools/NotebookEditTool/NotebookEditTool.js +238 -0
- package/dist/tools/NotebookEditTool/NotebookEditTool.js.map +7 -0
- package/dist/tools/NotebookEditTool/prompt.js +7 -0
- package/dist/tools/NotebookEditTool/prompt.js.map +7 -0
- package/dist/tools/NotebookReadTool/NotebookReadTool.js +212 -0
- package/dist/tools/NotebookReadTool/NotebookReadTool.js.map +7 -0
- package/dist/tools/NotebookReadTool/prompt.js +7 -0
- package/dist/tools/NotebookReadTool/prompt.js.map +7 -0
- package/dist/tools/SkillTool/SkillTool.js +209 -0
- package/dist/tools/SkillTool/SkillTool.js.map +7 -0
- package/dist/tools/SkillTool/prompt.js +81 -0
- package/dist/tools/SkillTool/prompt.js.map +7 -0
- package/dist/tools/TaskTool/TaskTool.js +381 -0
- package/dist/tools/TaskTool/TaskTool.js.map +7 -0
- package/dist/tools/TaskTool/constants.js +5 -0
- package/dist/tools/TaskTool/constants.js.map +7 -0
- package/dist/tools/TaskTool/prompt.js +111 -0
- package/dist/tools/TaskTool/prompt.js.map +7 -0
- package/dist/tools/ThinkTool/ThinkTool.js +40 -0
- package/dist/tools/ThinkTool/ThinkTool.js.map +7 -0
- package/dist/tools/ThinkTool/prompt.js +16 -0
- package/dist/tools/ThinkTool/prompt.js.map +7 -0
- package/dist/tools/TodoWriteTool/TodoWriteTool.js +243 -0
- package/dist/tools/TodoWriteTool/TodoWriteTool.js.map +7 -0
- package/dist/tools/TodoWriteTool/prompt.js +66 -0
- package/dist/tools/TodoWriteTool/prompt.js.map +7 -0
- package/dist/tools/URLFetcherTool/URLFetcherTool.js +137 -0
- package/dist/tools/URLFetcherTool/URLFetcherTool.js.map +7 -0
- package/dist/tools/URLFetcherTool/cache.js +45 -0
- package/dist/tools/URLFetcherTool/cache.js.map +7 -0
- package/dist/tools/URLFetcherTool/htmlToMarkdown.js +42 -0
- package/dist/tools/URLFetcherTool/htmlToMarkdown.js.map +7 -0
- package/dist/tools/URLFetcherTool/prompt.js +22 -0
- package/dist/tools/URLFetcherTool/prompt.js.map +7 -0
- package/dist/tools/WebSearchTool/WebSearchTool.js +86 -0
- package/dist/tools/WebSearchTool/WebSearchTool.js.map +7 -0
- package/dist/tools/WebSearchTool/prompt.js +17 -0
- package/dist/tools/WebSearchTool/prompt.js.map +7 -0
- package/dist/tools/WebSearchTool/searchProviders.js +48 -0
- package/dist/tools/WebSearchTool/searchProviders.js.map +7 -0
- package/dist/tools/lsTool/lsTool.js +201 -0
- package/dist/tools/lsTool/lsTool.js.map +7 -0
- package/dist/tools/lsTool/prompt.js +5 -0
- package/dist/tools/lsTool/prompt.js.map +7 -0
- package/dist/tools.js +70 -0
- package/dist/tools.js.map +7 -0
- package/dist/types/PermissionMode.js +82 -0
- package/dist/types/PermissionMode.js.map +7 -0
- package/dist/types/RequestContext.js +47 -0
- package/dist/types/RequestContext.js.map +7 -0
- package/dist/types/common.d.js +1 -0
- package/dist/types/common.d.js.map +7 -0
- package/dist/types/conversation.js +1 -0
- package/dist/types/conversation.js.map +7 -0
- package/dist/types/hooks.js +38 -0
- package/dist/types/hooks.js.map +7 -0
- package/dist/types/interactionRound.js +1 -0
- package/dist/types/interactionRound.js.map +7 -0
- package/dist/types/logs.js +1 -0
- package/dist/types/logs.js.map +7 -0
- package/dist/types/marketplace.js +101 -0
- package/dist/types/marketplace.js.map +7 -0
- package/dist/types/modelCapabilities.js +1 -0
- package/dist/types/modelCapabilities.js.map +7 -0
- package/dist/types/notebook.js +1 -0
- package/dist/types/notebook.js.map +7 -0
- package/dist/types/plugin.js +83 -0
- package/dist/types/plugin.js.map +7 -0
- package/dist/types/subagent.js +1 -0
- package/dist/types/subagent.js.map +7 -0
- package/dist/utils/BackgroundShellManager.js +215 -0
- package/dist/utils/BackgroundShellManager.js.map +7 -0
- package/dist/utils/Cursor.js +315 -0
- package/dist/utils/Cursor.js.map +7 -0
- package/dist/utils/PersistentShell.js +371 -0
- package/dist/utils/PersistentShell.js.map +7 -0
- package/dist/utils/advancedFuzzyMatcher.js +206 -0
- package/dist/utils/advancedFuzzyMatcher.js.map +7 -0
- package/dist/utils/agentLoader.js +244 -0
- package/dist/utils/agentLoader.js.map +7 -0
- package/dist/utils/agentStorage.js +59 -0
- package/dist/utils/agentStorage.js.map +7 -0
- package/dist/utils/array.js +7 -0
- package/dist/utils/array.js.map +7 -0
- package/dist/utils/ask.js +77 -0
- package/dist/utils/ask.js.map +7 -0
- package/dist/utils/auth.js +11 -0
- package/dist/utils/auth.js.map +7 -0
- package/dist/utils/autoCompactCore.js +126 -0
- package/dist/utils/autoCompactCore.js.map +7 -0
- package/dist/utils/autoUpdater.js +107 -0
- package/dist/utils/autoUpdater.js.map +7 -0
- package/dist/utils/browser.js +15 -0
- package/dist/utils/browser.js.map +7 -0
- package/dist/utils/cleanup.js +54 -0
- package/dist/utils/cleanup.js.map +7 -0
- package/dist/utils/commands.js +207 -0
- package/dist/utils/commands.js.map +7 -0
- package/dist/utils/commonUnixCommands.js +687 -0
- package/dist/utils/commonUnixCommands.js.map +7 -0
- package/dist/utils/compressionMode.js +47 -0
- package/dist/utils/compressionMode.js.map +7 -0
- package/dist/utils/config.js +651 -0
- package/dist/utils/config.js.map +7 -0
- package/dist/utils/conversationRecovery.js +35 -0
- package/dist/utils/conversationRecovery.js.map +7 -0
- package/dist/utils/debugLogger.js +889 -0
- package/dist/utils/debugLogger.js.map +7 -0
- package/dist/utils/diff.js +32 -0
- package/dist/utils/diff.js.map +7 -0
- package/dist/utils/env.js +44 -0
- package/dist/utils/env.js.map +7 -0
- package/dist/utils/errors.js +23 -0
- package/dist/utils/errors.js.map +7 -0
- package/dist/utils/execFileNoThrow.js +44 -0
- package/dist/utils/execFileNoThrow.js.map +7 -0
- package/dist/utils/expertChatStorage.js +78 -0
- package/dist/utils/expertChatStorage.js.map +7 -0
- package/dist/utils/file.js +282 -0
- package/dist/utils/file.js.map +7 -0
- package/dist/utils/fileRecoveryCore.js +41 -0
- package/dist/utils/fileRecoveryCore.js.map +7 -0
- package/dist/utils/format.js +41 -0
- package/dist/utils/format.js.map +7 -0
- package/dist/utils/fuzzyMatcher.js +252 -0
- package/dist/utils/fuzzyMatcher.js.map +7 -0
- package/dist/utils/generators.js +46 -0
- package/dist/utils/generators.js.map +7 -0
- package/dist/utils/git.js +83 -0
- package/dist/utils/git.js.map +7 -0
- package/dist/utils/hookManager.js +238 -0
- package/dist/utils/hookManager.js.map +7 -0
- package/dist/utils/http.js +7 -0
- package/dist/utils/http.js.map +7 -0
- package/dist/utils/imagePaste.js +29 -0
- package/dist/utils/imagePaste.js.map +7 -0
- package/dist/utils/json.js +16 -0
- package/dist/utils/json.js.map +7 -0
- package/dist/utils/log.js +329 -0
- package/dist/utils/log.js.map +7 -0
- package/dist/utils/markdown.js +187 -0
- package/dist/utils/markdown.js.map +7 -0
- package/dist/utils/marketplaceManager.js +474 -0
- package/dist/utils/marketplaceManager.js.map +7 -0
- package/dist/utils/messageContextManager.js +195 -0
- package/dist/utils/messageContextManager.js.map +7 -0
- package/dist/utils/messages.js +650 -0
- package/dist/utils/messages.js.map +7 -0
- package/dist/utils/model.js +677 -0
- package/dist/utils/model.js.map +7 -0
- package/dist/utils/permissions/filesystem.js +80 -0
- package/dist/utils/permissions/filesystem.js.map +7 -0
- package/dist/utils/pluginInstaller.js +491 -0
- package/dist/utils/pluginInstaller.js.map +7 -0
- package/dist/utils/pluginLoader.js +582 -0
- package/dist/utils/pluginLoader.js.map +7 -0
- package/dist/utils/pluginRegistry.js +111 -0
- package/dist/utils/pluginRegistry.js.map +7 -0
- package/dist/utils/pluginValidator.js +774 -0
- package/dist/utils/pluginValidator.js.map +7 -0
- package/dist/utils/ptyCompat.js +125 -0
- package/dist/utils/ptyCompat.js.map +7 -0
- package/dist/utils/replStateMachine.js +145 -0
- package/dist/utils/replStateMachine.js.map +7 -0
- package/dist/utils/ripgrep.js +131 -0
- package/dist/utils/ripgrep.js.map +7 -0
- package/dist/utils/roundConverter.js +262 -0
- package/dist/utils/roundConverter.js.map +7 -0
- package/dist/utils/secureFile.js +483 -0
- package/dist/utils/secureFile.js.map +7 -0
- package/dist/utils/sessionState.js +22 -0
- package/dist/utils/sessionState.js.map +7 -0
- package/dist/utils/skillLoader.js +79 -0
- package/dist/utils/skillLoader.js.map +7 -0
- package/dist/utils/state.js +24 -0
- package/dist/utils/state.js.map +7 -0
- package/dist/utils/style.js +31 -0
- package/dist/utils/style.js.map +7 -0
- package/dist/utils/terminal.js +47 -0
- package/dist/utils/terminal.js.map +7 -0
- package/dist/utils/theme.js +102 -0
- package/dist/utils/theme.js.map +7 -0
- package/dist/utils/thinking.js +59 -0
- package/dist/utils/thinking.js.map +7 -0
- package/dist/utils/todoChangeCalculator.js +64 -0
- package/dist/utils/todoChangeCalculator.js.map +7 -0
- package/dist/utils/todoStorage.js +291 -0
- package/dist/utils/todoStorage.js.map +7 -0
- package/dist/utils/tokens.js +30 -0
- package/dist/utils/tokens.js.map +7 -0
- package/dist/utils/toolExecutionController.js +109 -0
- package/dist/utils/toolExecutionController.js.map +7 -0
- package/dist/utils/unaryLogging.js +6 -0
- package/dist/utils/unaryLogging.js.map +7 -0
- package/dist/utils/user.js +40 -0
- package/dist/utils/user.js.map +7 -0
- package/dist/utils/validate.js +132 -0
- package/dist/utils/validate.js.map +7 -0
- package/dist/version.js +7 -0
- package/dist/version.js.map +7 -0
- package/dist/yoga.wasm +0 -0
- package/package.json +113 -0
- package/scripts/postinstall.js +18 -0
- package/yoga.wasm +0 -0
|
@@ -0,0 +1,523 @@
|
|
|
1
|
+
import React, { useState, useEffect } from "react";
|
|
2
|
+
import { Box, Text, useInput } from "ink";
|
|
3
|
+
import { SimpleSpinner } from "../components/Spinner.js";
|
|
4
|
+
import {
|
|
5
|
+
loadAllPlugins,
|
|
6
|
+
getPlugin,
|
|
7
|
+
listPlugins
|
|
8
|
+
} from "../utils/pluginLoader.js";
|
|
9
|
+
import {
|
|
10
|
+
addMarketplace,
|
|
11
|
+
removeMarketplace,
|
|
12
|
+
updateMarketplace,
|
|
13
|
+
listMarketplaces,
|
|
14
|
+
installPluginFromMarketplace
|
|
15
|
+
} from "../utils/marketplaceManager.js";
|
|
16
|
+
import { MarketplaceError } from "../types/marketplace.js";
|
|
17
|
+
import { rmSync } from "fs";
|
|
18
|
+
import { getTheme } from "../utils/theme.js";
|
|
19
|
+
import { MainMenu } from "./plugin/MainMenu.js";
|
|
20
|
+
import { MarketplaceSelector } from "./plugin/MarketplaceSelector.js";
|
|
21
|
+
import { PluginBrowser } from "./plugin/PluginBrowser.js";
|
|
22
|
+
import { PluginDetailsInstall } from "./plugin/PluginDetailsInstall.js";
|
|
23
|
+
import { InstalledPluginsManager } from "./plugin/InstalledPluginsManager.js";
|
|
24
|
+
import { InstalledPluginsByMarketplace } from "./plugin/InstalledPluginsByMarketplace.js";
|
|
25
|
+
import { PluginDetailsManage } from "./plugin/PluginDetailsManage.js";
|
|
26
|
+
import { AddMarketplaceForm } from "./plugin/AddMarketplaceForm.js";
|
|
27
|
+
import { MarketplaceManager } from "./plugin/MarketplaceManager.js";
|
|
28
|
+
const PluginList = ({ onDone }) => {
|
|
29
|
+
const [plugins, setPlugins] = useState([]);
|
|
30
|
+
const [loading, setLoading] = useState(true);
|
|
31
|
+
const [error, setError] = useState(null);
|
|
32
|
+
const theme = getTheme();
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
try {
|
|
35
|
+
const loadedPlugins = loadAllPlugins();
|
|
36
|
+
setPlugins(loadedPlugins);
|
|
37
|
+
} catch (err) {
|
|
38
|
+
setError(err instanceof Error ? err.message : String(err));
|
|
39
|
+
} finally {
|
|
40
|
+
setLoading(false);
|
|
41
|
+
onDone();
|
|
42
|
+
}
|
|
43
|
+
}, [onDone]);
|
|
44
|
+
if (loading) {
|
|
45
|
+
return /* @__PURE__ */ React.createElement(Text, { color: theme.primary }, "Loading plugins...");
|
|
46
|
+
}
|
|
47
|
+
if (error) {
|
|
48
|
+
return /* @__PURE__ */ React.createElement(Text, { color: theme.error }, "Error: ", error);
|
|
49
|
+
}
|
|
50
|
+
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, { dimColor: true }, "Install plugins with: /plugin install <name>[@marketplace]"));
|
|
52
|
+
}
|
|
53
|
+
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
|
+
const componentCounts = [
|
|
55
|
+
plugin2.agents.length > 0 && `${plugin2.agents.length} agent${plugin2.agents.length !== 1 ? "s" : ""}`,
|
|
56
|
+
plugin2.commands.length > 0 && `${plugin2.commands.length} command${plugin2.commands.length !== 1 ? "s" : ""}`,
|
|
57
|
+
plugin2.skills.length > 0 && `${plugin2.skills.length} skill${plugin2.skills.length !== 1 ? "s" : ""}`,
|
|
58
|
+
plugin2.hooks.length > 0 && `${plugin2.hooks.length} hook${plugin2.hooks.length !== 1 ? "s" : ""}`,
|
|
59
|
+
plugin2.mcpServers.length > 0 && `${plugin2.mcpServers.length} MCP server${plugin2.mcpServers.length !== 1 ? "s" : ""}`
|
|
60
|
+
].filter(Boolean);
|
|
61
|
+
return /* @__PURE__ */ React.createElement(Box, { key: plugin2.manifest.name, flexDirection: "column", marginBottom: 1 }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: theme.primary, bold: true }, plugin2.manifest.displayName || plugin2.manifest.name), /* @__PURE__ */ React.createElement(Text, { dimColor: true }, " v", plugin2.manifest.version), !plugin2.enabled && /* @__PURE__ */ React.createElement(Text, { color: theme.warning }, " (disabled)")), plugin2.manifest.description && /* @__PURE__ */ React.createElement(Text, { dimColor: true }, " ", plugin2.manifest.description), componentCounts.length > 0 && /* @__PURE__ */ React.createElement(Text, { dimColor: true }, " Components: ", componentCounts.join(", ")), /* @__PURE__ */ React.createElement(Text, { dimColor: true }, " Location: ", plugin2.source.type === "local" ? plugin2.source.path : plugin2.location));
|
|
62
|
+
}));
|
|
63
|
+
};
|
|
64
|
+
const PluginInfo = ({ pluginName, onDone }) => {
|
|
65
|
+
const [plugin2, setPlugin] = useState(null);
|
|
66
|
+
const [loading, setLoading] = useState(true);
|
|
67
|
+
const [error, setError] = useState(null);
|
|
68
|
+
const theme = getTheme();
|
|
69
|
+
useEffect(() => {
|
|
70
|
+
try {
|
|
71
|
+
const loadedPlugin = getPlugin(pluginName);
|
|
72
|
+
if (!loadedPlugin) {
|
|
73
|
+
setError(`Plugin "${pluginName}" not found`);
|
|
74
|
+
} else {
|
|
75
|
+
setPlugin(loadedPlugin);
|
|
76
|
+
}
|
|
77
|
+
} catch (err) {
|
|
78
|
+
setError(err instanceof Error ? err.message : String(err));
|
|
79
|
+
} finally {
|
|
80
|
+
setLoading(false);
|
|
81
|
+
onDone();
|
|
82
|
+
}
|
|
83
|
+
}, [pluginName, onDone]);
|
|
84
|
+
if (loading) {
|
|
85
|
+
return /* @__PURE__ */ React.createElement(Text, { color: theme.primary }, "Loading plugin info...");
|
|
86
|
+
}
|
|
87
|
+
if (error || !plugin2) {
|
|
88
|
+
return /* @__PURE__ */ React.createElement(Text, { color: theme.error }, "Error: ", error || "Plugin not found");
|
|
89
|
+
}
|
|
90
|
+
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, { dimColor: true }, " \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, { dimColor: true }, " \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, { dimColor: true }, " \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, { dimColor: true }, " \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, { dimColor: true }, " \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, { dimColor: true }, " 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, { dimColor: true }, " Minto: ", plugin2.manifest.engines.minto), plugin2.manifest.engines["claude-code"] && /* @__PURE__ */ React.createElement(Text, { dimColor: true }, " Claude Code: ", plugin2.manifest.engines["claude-code"]), plugin2.manifest.engines.node && /* @__PURE__ */ React.createElement(Text, { dimColor: true }, " Node: ", plugin2.manifest.engines.node)));
|
|
91
|
+
};
|
|
92
|
+
const PluginInstall = ({ pluginSpec, onDone }) => {
|
|
93
|
+
const [status, setStatus] = useState("installing");
|
|
94
|
+
const [message, setMessage] = useState("");
|
|
95
|
+
const [installedPath, setInstalledPath] = useState("");
|
|
96
|
+
const theme = getTheme();
|
|
97
|
+
useEffect(() => {
|
|
98
|
+
const installPlugin = async () => {
|
|
99
|
+
try {
|
|
100
|
+
const [pluginName, marketplaceName] = pluginSpec.split("@");
|
|
101
|
+
if (!pluginName) {
|
|
102
|
+
throw new Error("Plugin name is required");
|
|
103
|
+
}
|
|
104
|
+
setMessage(`Installing plugin "${pluginName}"${marketplaceName ? ` from marketplace "${marketplaceName}"` : ""}...`);
|
|
105
|
+
const path = await installPluginFromMarketplace(pluginName, marketplaceName);
|
|
106
|
+
setInstalledPath(path);
|
|
107
|
+
setMessage(`Successfully installed "${pluginName}" to ${path}`);
|
|
108
|
+
setStatus("success");
|
|
109
|
+
} catch (err) {
|
|
110
|
+
if (err instanceof MarketplaceError) {
|
|
111
|
+
setMessage(`Installation failed: ${err.message}`);
|
|
112
|
+
} else {
|
|
113
|
+
setMessage(`Installation failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
114
|
+
}
|
|
115
|
+
setStatus("error");
|
|
116
|
+
} finally {
|
|
117
|
+
onDone();
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
installPlugin();
|
|
121
|
+
}, [pluginSpec, onDone]);
|
|
122
|
+
const color = status === "success" ? theme.success : status === "error" ? theme.error : theme.primary;
|
|
123
|
+
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, { dimColor: true }, "Plugin is now available. Use /plugin info ", pluginSpec.split("@")[0], " to see details.")));
|
|
124
|
+
};
|
|
125
|
+
const PluginUninstall = ({ pluginName, onDone }) => {
|
|
126
|
+
const [status, setStatus] = useState("uninstalling");
|
|
127
|
+
const [message, setMessage] = useState("");
|
|
128
|
+
const theme = getTheme();
|
|
129
|
+
useEffect(() => {
|
|
130
|
+
const uninstallPlugin = () => {
|
|
131
|
+
try {
|
|
132
|
+
setMessage(`Uninstalling plugin "${pluginName}"...`);
|
|
133
|
+
const plugin2 = getPlugin(pluginName);
|
|
134
|
+
if (!plugin2) {
|
|
135
|
+
throw new Error(`Plugin "${pluginName}" not found`);
|
|
136
|
+
}
|
|
137
|
+
rmSync(plugin2.location, { recursive: true, force: true });
|
|
138
|
+
setMessage(`Successfully uninstalled "${pluginName}"`);
|
|
139
|
+
setStatus("success");
|
|
140
|
+
} catch (err) {
|
|
141
|
+
setMessage(`Uninstallation failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
142
|
+
setStatus("error");
|
|
143
|
+
} finally {
|
|
144
|
+
onDone();
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
uninstallPlugin();
|
|
148
|
+
}, [pluginName, onDone]);
|
|
149
|
+
const color = status === "success" ? theme.success : status === "error" ? theme.error : theme.primary;
|
|
150
|
+
return /* @__PURE__ */ React.createElement(Text, { color }, message);
|
|
151
|
+
};
|
|
152
|
+
const PluginValidate = ({ pluginName, onDone }) => {
|
|
153
|
+
const [results, setResults] = useState([]);
|
|
154
|
+
const [loading, setLoading] = useState(true);
|
|
155
|
+
const theme = getTheme();
|
|
156
|
+
useEffect(() => {
|
|
157
|
+
const validatePlugins = () => {
|
|
158
|
+
try {
|
|
159
|
+
const pluginsToValidate = pluginName ? [{ name: pluginName, path: "", manifest: void 0 }] : listPlugins();
|
|
160
|
+
const validationResults = pluginsToValidate.map(({ name, path }) => {
|
|
161
|
+
const errors = [];
|
|
162
|
+
try {
|
|
163
|
+
const plugin2 = getPlugin(name);
|
|
164
|
+
if (!plugin2) {
|
|
165
|
+
errors.push("Plugin not found");
|
|
166
|
+
return { plugin: name, valid: false, errors };
|
|
167
|
+
}
|
|
168
|
+
if (!plugin2.manifest.name) errors.push("Missing required field: name");
|
|
169
|
+
if (!plugin2.manifest.version) errors.push("Missing required field: version");
|
|
170
|
+
if (!plugin2.manifest.description) errors.push("Missing required field: description");
|
|
171
|
+
if (plugin2.manifest.version && !/^\d+\.\d+\.\d+$/.test(plugin2.manifest.version)) {
|
|
172
|
+
errors.push("Invalid version format (must be semver: X.Y.Z)");
|
|
173
|
+
}
|
|
174
|
+
if (plugin2.manifest.name && !/^[a-z0-9-]+$/.test(plugin2.manifest.name)) {
|
|
175
|
+
errors.push("Invalid name format (must be lowercase alphanumeric with hyphens)");
|
|
176
|
+
}
|
|
177
|
+
const checkComponents = (items, type) => {
|
|
178
|
+
items.forEach((item) => {
|
|
179
|
+
if (!item.filePath) {
|
|
180
|
+
errors.push(`${type} "${item.name}" has no file path`);
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
};
|
|
184
|
+
checkComponents(plugin2.agents, "Agent");
|
|
185
|
+
checkComponents(plugin2.commands, "Command");
|
|
186
|
+
checkComponents(plugin2.skills, "Skill");
|
|
187
|
+
return { plugin: name, valid: errors.length === 0, errors };
|
|
188
|
+
} catch (err) {
|
|
189
|
+
errors.push(err instanceof Error ? err.message : String(err));
|
|
190
|
+
return { plugin: name, valid: false, errors };
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
setResults(validationResults);
|
|
194
|
+
} finally {
|
|
195
|
+
setLoading(false);
|
|
196
|
+
onDone();
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
validatePlugins();
|
|
200
|
+
}, [pluginName, onDone]);
|
|
201
|
+
if (loading) {
|
|
202
|
+
return /* @__PURE__ */ React.createElement(Text, { color: theme.primary }, "Validating plugins...");
|
|
203
|
+
}
|
|
204
|
+
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Text, { bold: true, underline: true, color: theme.primary }, "Plugin Validation Results"), /* @__PURE__ */ React.createElement(Text, null, ""), results.map((result) => /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", marginBottom: 1 }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: result.valid ? theme.success : theme.error }, result.valid ? "\u2713" : "\u2717"), /* @__PURE__ */ React.createElement(Text, null, " ", result.plugin), result.valid && /* @__PURE__ */ React.createElement(Text, { color: theme.success }, " - Valid")), result.errors.length > 0 && /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", marginLeft: 2 }, result.errors.map((error, idx) => /* @__PURE__ */ React.createElement(Text, { color: theme.error }, "\u2022 ", error))))));
|
|
205
|
+
};
|
|
206
|
+
const MarketplaceListView = ({ onDone }) => {
|
|
207
|
+
const [marketplaces, setMarketplaces] = useState([]);
|
|
208
|
+
const [loading, setLoading] = useState(true);
|
|
209
|
+
const theme = getTheme();
|
|
210
|
+
useEffect(() => {
|
|
211
|
+
try {
|
|
212
|
+
const registered = listMarketplaces();
|
|
213
|
+
setMarketplaces(registered);
|
|
214
|
+
} finally {
|
|
215
|
+
setLoading(false);
|
|
216
|
+
onDone();
|
|
217
|
+
}
|
|
218
|
+
}, [onDone]);
|
|
219
|
+
if (loading) {
|
|
220
|
+
return /* @__PURE__ */ React.createElement(Text, { color: theme.primary }, "Loading marketplaces...");
|
|
221
|
+
}
|
|
222
|
+
if (marketplaces.length === 0) {
|
|
223
|
+
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Text, { color: theme.warning }, "No marketplaces registered."), /* @__PURE__ */ React.createElement(Text, { dimColor: true }, "Register a marketplace with: /plugin marketplace add <source>"));
|
|
224
|
+
}
|
|
225
|
+
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, { dimColor: true }, " ", marketplace.manifest.metadata.description), /* @__PURE__ */ React.createElement(Text, { dimColor: true }, ` Plugins: ${marketplace.manifest.plugins.length}`, ` | Owner: ${marketplace.manifest.owner.name}`), /* @__PURE__ */ React.createElement(Text, { dimColor: true }, ` 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, { dimColor: true }, ` Last updated: ${new Date(marketplace.lastUpdated).toLocaleString()}`))));
|
|
226
|
+
};
|
|
227
|
+
const MarketplaceAdd = ({ source, onDone }) => {
|
|
228
|
+
const [status, setStatus] = useState("adding");
|
|
229
|
+
const [message, setMessage] = useState("");
|
|
230
|
+
const [marketplace, setMarketplace] = useState(null);
|
|
231
|
+
const theme = getTheme();
|
|
232
|
+
useEffect(() => {
|
|
233
|
+
const addMarketplaceAsync = async () => {
|
|
234
|
+
try {
|
|
235
|
+
setMessage(`Registering marketplace from "${source}"...`);
|
|
236
|
+
const registered = await addMarketplace(source);
|
|
237
|
+
setMarketplace(registered);
|
|
238
|
+
setMessage(`Successfully registered marketplace "${registered.name}"`);
|
|
239
|
+
setStatus("success");
|
|
240
|
+
} catch (err) {
|
|
241
|
+
if (err instanceof MarketplaceError) {
|
|
242
|
+
setMessage(`Registration failed: ${err.message}`);
|
|
243
|
+
} else {
|
|
244
|
+
setMessage(`Registration failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
245
|
+
}
|
|
246
|
+
setStatus("error");
|
|
247
|
+
} finally {
|
|
248
|
+
onDone();
|
|
249
|
+
}
|
|
250
|
+
};
|
|
251
|
+
addMarketplaceAsync();
|
|
252
|
+
}, [source, onDone]);
|
|
253
|
+
const color = status === "success" ? theme.success : status === "error" ? theme.error : theme.primary;
|
|
254
|
+
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, { dimColor: true }, "Marketplace contains ", marketplace.manifest.plugins.length, " plugin(s)"), /* @__PURE__ */ React.createElement(Text, { dimColor: true }, "Use /plugin marketplace list to see all marketplaces")));
|
|
255
|
+
};
|
|
256
|
+
const MarketplaceUpdate = ({ name, onDone }) => {
|
|
257
|
+
const [status, setStatus] = useState("updating");
|
|
258
|
+
const [message, setMessage] = useState("");
|
|
259
|
+
const theme = getTheme();
|
|
260
|
+
useEffect(() => {
|
|
261
|
+
const updateMarketplaceAsync = async () => {
|
|
262
|
+
try {
|
|
263
|
+
setMessage(`Updating marketplace "${name}"...`);
|
|
264
|
+
await updateMarketplace(name);
|
|
265
|
+
setMessage(`Successfully updated marketplace "${name}"`);
|
|
266
|
+
setStatus("success");
|
|
267
|
+
} catch (err) {
|
|
268
|
+
if (err instanceof MarketplaceError) {
|
|
269
|
+
setMessage(`Update failed: ${err.message}`);
|
|
270
|
+
} else {
|
|
271
|
+
setMessage(`Update failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
272
|
+
}
|
|
273
|
+
setStatus("error");
|
|
274
|
+
} finally {
|
|
275
|
+
onDone();
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
updateMarketplaceAsync();
|
|
279
|
+
}, [name, onDone]);
|
|
280
|
+
const color = status === "success" ? theme.success : status === "error" ? theme.error : theme.primary;
|
|
281
|
+
return /* @__PURE__ */ React.createElement(Text, { color }, message);
|
|
282
|
+
};
|
|
283
|
+
const MarketplaceRemove = ({ name, onDone }) => {
|
|
284
|
+
const [status, setStatus] = useState("removing");
|
|
285
|
+
const [message, setMessage] = useState("");
|
|
286
|
+
const theme = getTheme();
|
|
287
|
+
useEffect(() => {
|
|
288
|
+
const removeMarketplaceSync = () => {
|
|
289
|
+
try {
|
|
290
|
+
setMessage(`Removing marketplace "${name}"...`);
|
|
291
|
+
removeMarketplace(name);
|
|
292
|
+
setMessage(`Successfully removed marketplace "${name}"`);
|
|
293
|
+
setStatus("success");
|
|
294
|
+
} catch (err) {
|
|
295
|
+
if (err instanceof MarketplaceError) {
|
|
296
|
+
setMessage(`Removal failed: ${err.message}`);
|
|
297
|
+
} else {
|
|
298
|
+
setMessage(`Removal failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
299
|
+
}
|
|
300
|
+
setStatus("error");
|
|
301
|
+
} finally {
|
|
302
|
+
onDone();
|
|
303
|
+
}
|
|
304
|
+
};
|
|
305
|
+
removeMarketplaceSync();
|
|
306
|
+
}, [name, onDone]);
|
|
307
|
+
const color = status === "success" ? theme.success : status === "error" ? theme.error : theme.primary;
|
|
308
|
+
return /* @__PURE__ */ React.createElement(Text, { color }, message);
|
|
309
|
+
};
|
|
310
|
+
const ErrorMessage = ({ message, onDone }) => {
|
|
311
|
+
const theme = getTheme();
|
|
312
|
+
React.useEffect(() => {
|
|
313
|
+
onDone();
|
|
314
|
+
}, [onDone]);
|
|
315
|
+
return /* @__PURE__ */ React.createElement(Text, { color: theme.error }, "Error: ", message);
|
|
316
|
+
};
|
|
317
|
+
const MarketplaceDetails = ({ marketplace: marketplaceName, onNavigate, onBack, onDone }) => {
|
|
318
|
+
const theme = getTheme();
|
|
319
|
+
const [removing, setRemoving] = useState(false);
|
|
320
|
+
const [updating, setUpdating] = useState(false);
|
|
321
|
+
const [error, setError] = useState();
|
|
322
|
+
const marketplace = listMarketplaces().find(
|
|
323
|
+
(m) => m.name === marketplaceName
|
|
324
|
+
);
|
|
325
|
+
useInput((input, key) => {
|
|
326
|
+
if (key.escape) onBack();
|
|
327
|
+
else if (input === "r" && !removing && !updating) {
|
|
328
|
+
setRemoving(true);
|
|
329
|
+
removeMarketplaceAction();
|
|
330
|
+
} else if (input === "u" && !removing && !updating) {
|
|
331
|
+
setUpdating(true);
|
|
332
|
+
updateMarketplaceAction();
|
|
333
|
+
} else if (input === "p" && !removing && !updating) {
|
|
334
|
+
onNavigate({
|
|
335
|
+
screen: "installed-plugins-by-marketplace",
|
|
336
|
+
marketplace: marketplaceName
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
});
|
|
340
|
+
const removeMarketplaceAction = () => {
|
|
341
|
+
try {
|
|
342
|
+
removeMarketplace(marketplaceName);
|
|
343
|
+
onBack();
|
|
344
|
+
} catch (err) {
|
|
345
|
+
setError(err instanceof Error ? err.message : String(err));
|
|
346
|
+
setRemoving(false);
|
|
347
|
+
}
|
|
348
|
+
};
|
|
349
|
+
const updateMarketplaceAction = async () => {
|
|
350
|
+
try {
|
|
351
|
+
await updateMarketplace(marketplaceName);
|
|
352
|
+
setUpdating(false);
|
|
353
|
+
} catch (err) {
|
|
354
|
+
setError(err instanceof Error ? err.message : String(err));
|
|
355
|
+
setUpdating(false);
|
|
356
|
+
}
|
|
357
|
+
};
|
|
358
|
+
if (!marketplace) {
|
|
359
|
+
return /* @__PURE__ */ React.createElement(Box, { padding: 1 }, /* @__PURE__ */ React.createElement(Text, { color: theme.error }, "Marketplace not found: ", marketplaceName));
|
|
360
|
+
}
|
|
361
|
+
if (removing) {
|
|
362
|
+
return /* @__PURE__ */ React.createElement(Box, { padding: 1 }, /* @__PURE__ */ React.createElement(SimpleSpinner, null), /* @__PURE__ */ React.createElement(Text, { color: theme.primary }, " Removing marketplace..."));
|
|
363
|
+
}
|
|
364
|
+
if (updating) {
|
|
365
|
+
return /* @__PURE__ */ React.createElement(Box, { padding: 1 }, /* @__PURE__ */ React.createElement(SimpleSpinner, null), /* @__PURE__ */ React.createElement(Text, { color: theme.primary }, " Updating marketplace..."));
|
|
366
|
+
}
|
|
367
|
+
return /* @__PURE__ */ React.createElement(
|
|
368
|
+
Box,
|
|
369
|
+
{
|
|
370
|
+
flexDirection: "column",
|
|
371
|
+
borderStyle: "round",
|
|
372
|
+
borderColor: theme.primary,
|
|
373
|
+
padding: 1
|
|
374
|
+
},
|
|
375
|
+
/* @__PURE__ */ React.createElement(Text, { bold: true, color: theme.success }, marketplace.name),
|
|
376
|
+
marketplace.manifest.metadata?.description && /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, null, marketplace.manifest.metadata.description)),
|
|
377
|
+
/* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, null, "Plugins: "), /* @__PURE__ */ React.createElement(Text, { color: theme.primary }, marketplace.manifest.plugins.length)),
|
|
378
|
+
/* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, null, "Owner: "), /* @__PURE__ */ React.createElement(Text, null, marketplace.manifest.owner.name)),
|
|
379
|
+
/* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, null, "Source: "), /* @__PURE__ */ React.createElement(Text, { dimColor: true }, marketplace.source.type, marketplace.source.type === "github" && ` (${marketplace.source.repo})`, marketplace.source.type === "url" && ` (${marketplace.source.url})`, marketplace.source.type === "local" && ` (${marketplace.source.path})`)),
|
|
380
|
+
/* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, null, "Last updated: "), /* @__PURE__ */ React.createElement(Text, { dimColor: true }, new Date(marketplace.lastUpdated).toLocaleString())),
|
|
381
|
+
error && /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { color: theme.error }, "Error: ", error)),
|
|
382
|
+
/* @__PURE__ */ React.createElement(Box, { marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React.createElement(Text, { dimColor: true }, "Press ", /* @__PURE__ */ React.createElement(Text, { bold: true }, "p"), " to view plugins from this marketplace"), /* @__PURE__ */ React.createElement(Text, { dimColor: true }, "Press ", /* @__PURE__ */ React.createElement(Text, { bold: true }, "u"), " to update marketplace"), /* @__PURE__ */ React.createElement(Text, { dimColor: true }, "Press ", /* @__PURE__ */ React.createElement(Text, { bold: true }, "r"), " to remove marketplace"), /* @__PURE__ */ React.createElement(Text, { dimColor: true }, "Press ", /* @__PURE__ */ React.createElement(Text, { bold: true }, "Esc"), " to go back"))
|
|
383
|
+
);
|
|
384
|
+
};
|
|
385
|
+
const InteractivePluginCommand = ({ onDone }) => {
|
|
386
|
+
const [navigationStack, setNavigationStack] = useState([
|
|
387
|
+
{ screen: "main-menu" }
|
|
388
|
+
]);
|
|
389
|
+
const currentState = navigationStack[navigationStack.length - 1];
|
|
390
|
+
const handleNavigate = (newState) => {
|
|
391
|
+
setNavigationStack((prev) => [...prev, newState]);
|
|
392
|
+
};
|
|
393
|
+
const handleBack = () => {
|
|
394
|
+
if (navigationStack.length > 1) {
|
|
395
|
+
setNavigationStack((prev) => prev.slice(0, -1));
|
|
396
|
+
} else {
|
|
397
|
+
onDone();
|
|
398
|
+
}
|
|
399
|
+
};
|
|
400
|
+
switch (currentState.screen) {
|
|
401
|
+
case "main-menu":
|
|
402
|
+
return /* @__PURE__ */ React.createElement(MainMenu, { onNavigate: handleNavigate, onBack: handleBack, onDone });
|
|
403
|
+
case "marketplace-selector":
|
|
404
|
+
return /* @__PURE__ */ React.createElement(MarketplaceSelector, { onNavigate: handleNavigate, onBack: handleBack, onDone });
|
|
405
|
+
case "plugin-browser":
|
|
406
|
+
return /* @__PURE__ */ React.createElement(PluginBrowser, { marketplace: currentState.marketplace, onNavigate: handleNavigate, onBack: handleBack, onDone });
|
|
407
|
+
case "plugin-details-install":
|
|
408
|
+
return /* @__PURE__ */ React.createElement(PluginDetailsInstall, { marketplace: currentState.marketplace, plugin: currentState.plugin, onNavigate: handleNavigate, onBack: handleBack, onDone });
|
|
409
|
+
case "installed-plugins-manager":
|
|
410
|
+
return /* @__PURE__ */ React.createElement(InstalledPluginsManager, { key: navigationStack.length, onNavigate: handleNavigate, onBack: handleBack, onDone });
|
|
411
|
+
case "installed-plugins-by-marketplace":
|
|
412
|
+
return /* @__PURE__ */ React.createElement(InstalledPluginsByMarketplace, { marketplace: currentState.marketplace, onNavigate: handleNavigate, onBack: handleBack, onDone });
|
|
413
|
+
case "plugin-details-manage":
|
|
414
|
+
return /* @__PURE__ */ React.createElement(PluginDetailsManage, { plugin: currentState.plugin, onNavigate: handleNavigate, onBack: handleBack, onDone });
|
|
415
|
+
case "add-marketplace":
|
|
416
|
+
return /* @__PURE__ */ React.createElement(AddMarketplaceForm, { onNavigate: handleNavigate, onBack: handleBack, onDone });
|
|
417
|
+
case "marketplace-manager":
|
|
418
|
+
return /* @__PURE__ */ React.createElement(MarketplaceManager, { onNavigate: handleNavigate, onBack: handleBack, onDone });
|
|
419
|
+
case "marketplace-details":
|
|
420
|
+
return /* @__PURE__ */ React.createElement(MarketplaceDetails, { marketplace: currentState.marketplace, onNavigate: handleNavigate, onBack: handleBack, onDone });
|
|
421
|
+
default:
|
|
422
|
+
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Text, { color: "red" }, "Unknown screen state"), /* @__PURE__ */ React.createElement(Text, { dimColor: true }, "Press Esc to exit"));
|
|
423
|
+
}
|
|
424
|
+
};
|
|
425
|
+
const LegacyPluginCommand = ({ args, onDone }) => {
|
|
426
|
+
const theme = getTheme();
|
|
427
|
+
const parts = args.trim().split(/\s+/).filter(Boolean);
|
|
428
|
+
const subcommand = parts[0];
|
|
429
|
+
const subArgs = parts.slice(1);
|
|
430
|
+
React.useEffect(() => {
|
|
431
|
+
if (!subcommand || subcommand === "help" || subcommand === "--help") {
|
|
432
|
+
onDone();
|
|
433
|
+
}
|
|
434
|
+
}, [subcommand, onDone]);
|
|
435
|
+
if (!subcommand || subcommand === "help" || subcommand === "--help") {
|
|
436
|
+
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, { dimColor: true }, "Examples:"), /* @__PURE__ */ React.createElement(Text, { dimColor: true }, " /plugin list"), /* @__PURE__ */ React.createElement(Text, { dimColor: true }, " /plugin info my-plugin"), /* @__PURE__ */ React.createElement(Text, { dimColor: true }, " /plugin install awesome-plugin@official"), /* @__PURE__ */ React.createElement(Text, { dimColor: true }, " /plugin marketplace add owner/repo"));
|
|
437
|
+
}
|
|
438
|
+
switch (subcommand) {
|
|
439
|
+
case "list":
|
|
440
|
+
return /* @__PURE__ */ React.createElement(PluginList, { onDone });
|
|
441
|
+
case "info":
|
|
442
|
+
if (subArgs.length === 0) {
|
|
443
|
+
return /* @__PURE__ */ React.createElement(ErrorMessage, { message: "Plugin name required. Usage: /plugin info <name>", onDone });
|
|
444
|
+
}
|
|
445
|
+
return /* @__PURE__ */ React.createElement(PluginInfo, { pluginName: subArgs[0], onDone });
|
|
446
|
+
case "install":
|
|
447
|
+
if (subArgs.length === 0) {
|
|
448
|
+
return /* @__PURE__ */ React.createElement(ErrorMessage, { message: "Plugin spec required. Usage: /plugin install <name>[@marketplace]", onDone });
|
|
449
|
+
}
|
|
450
|
+
return /* @__PURE__ */ React.createElement(PluginInstall, { pluginSpec: subArgs[0], onDone });
|
|
451
|
+
case "uninstall":
|
|
452
|
+
if (subArgs.length === 0) {
|
|
453
|
+
return /* @__PURE__ */ React.createElement(ErrorMessage, { message: "Plugin name required. Usage: /plugin uninstall <name>", onDone });
|
|
454
|
+
}
|
|
455
|
+
return /* @__PURE__ */ React.createElement(PluginUninstall, { pluginName: subArgs[0], onDone });
|
|
456
|
+
case "validate":
|
|
457
|
+
return /* @__PURE__ */ React.createElement(PluginValidate, { pluginName: subArgs[0], onDone });
|
|
458
|
+
case "marketplace":
|
|
459
|
+
const marketplaceSubcommand = subArgs[0];
|
|
460
|
+
const marketplaceArgs = subArgs.slice(1);
|
|
461
|
+
switch (marketplaceSubcommand) {
|
|
462
|
+
case "list":
|
|
463
|
+
return /* @__PURE__ */ React.createElement(MarketplaceListView, { onDone });
|
|
464
|
+
case "add":
|
|
465
|
+
if (marketplaceArgs.length === 0) {
|
|
466
|
+
return /* @__PURE__ */ React.createElement(ErrorMessage, { message: "Source required. Usage: /plugin marketplace add <source>", onDone });
|
|
467
|
+
}
|
|
468
|
+
return /* @__PURE__ */ React.createElement(MarketplaceAdd, { source: marketplaceArgs[0], onDone });
|
|
469
|
+
case "update":
|
|
470
|
+
if (marketplaceArgs.length === 0) {
|
|
471
|
+
return /* @__PURE__ */ React.createElement(ErrorMessage, { message: "Marketplace name required. Usage: /plugin marketplace update <name>", onDone });
|
|
472
|
+
}
|
|
473
|
+
return /* @__PURE__ */ React.createElement(MarketplaceUpdate, { name: marketplaceArgs[0], onDone });
|
|
474
|
+
case "remove":
|
|
475
|
+
if (marketplaceArgs.length === 0) {
|
|
476
|
+
return /* @__PURE__ */ React.createElement(ErrorMessage, { message: "Marketplace name required. Usage: /plugin marketplace remove <name>", onDone });
|
|
477
|
+
}
|
|
478
|
+
return /* @__PURE__ */ React.createElement(MarketplaceRemove, { name: marketplaceArgs[0], onDone });
|
|
479
|
+
default:
|
|
480
|
+
return /* @__PURE__ */ React.createElement(
|
|
481
|
+
ErrorMessage,
|
|
482
|
+
{
|
|
483
|
+
message: `Unknown marketplace subcommand: ${marketplaceSubcommand}. Use /plugin help for usage.`,
|
|
484
|
+
onDone
|
|
485
|
+
}
|
|
486
|
+
);
|
|
487
|
+
}
|
|
488
|
+
default:
|
|
489
|
+
return /* @__PURE__ */ React.createElement(
|
|
490
|
+
ErrorMessage,
|
|
491
|
+
{
|
|
492
|
+
message: `Unknown subcommand: ${subcommand}. Use /plugin help for usage.`,
|
|
493
|
+
onDone
|
|
494
|
+
}
|
|
495
|
+
);
|
|
496
|
+
}
|
|
497
|
+
};
|
|
498
|
+
const PluginCommand = ({ args, onDone }) => {
|
|
499
|
+
if (args.trim()) {
|
|
500
|
+
return /* @__PURE__ */ React.createElement(LegacyPluginCommand, { args, onDone });
|
|
501
|
+
} else {
|
|
502
|
+
return /* @__PURE__ */ React.createElement(InteractivePluginCommand, { onDone });
|
|
503
|
+
}
|
|
504
|
+
};
|
|
505
|
+
const plugin = {
|
|
506
|
+
type: "local-jsx",
|
|
507
|
+
name: "plugin",
|
|
508
|
+
description: "Manage plugins and plugin marketplaces (interactive)",
|
|
509
|
+
isEnabled: true,
|
|
510
|
+
isHidden: false,
|
|
511
|
+
aliases: ["plugins"],
|
|
512
|
+
async call(onDone, _context) {
|
|
513
|
+
return /* @__PURE__ */ React.createElement(PluginCommand, { args: "", onDone });
|
|
514
|
+
},
|
|
515
|
+
userFacingName() {
|
|
516
|
+
return "plugin";
|
|
517
|
+
}
|
|
518
|
+
};
|
|
519
|
+
var plugin_default = plugin;
|
|
520
|
+
export {
|
|
521
|
+
plugin_default as default
|
|
522
|
+
};
|
|
523
|
+
//# sourceMappingURL=plugin.js.map
|