@within-7/minto 0.1.7 → 0.2.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/cli.js +155 -37
- package/dist/Tool.js +38 -0
- package/dist/Tool.js.map +3 -3
- package/dist/commands/agents/AgentsCommand.js +52 -26
- package/dist/commands/agents/AgentsCommand.js.map +2 -2
- package/dist/commands/agents/constants.js +1 -1
- package/dist/commands/agents/constants.js.map +1 -1
- package/dist/commands/agents/index.js +1 -1
- package/dist/commands/bug.js +74 -7
- package/dist/commands/bug.js.map +3 -3
- package/dist/commands/clear.js +3 -0
- package/dist/commands/clear.js.map +2 -2
- package/dist/commands/compact.js +37 -0
- package/dist/commands/compact.js.map +2 -2
- package/dist/commands/context.js +84 -0
- package/dist/commands/context.js.map +7 -0
- package/dist/commands/ctx_viz.js +18 -10
- package/dist/commands/ctx_viz.js.map +2 -2
- package/dist/commands/doctor.js +158 -12
- package/dist/commands/doctor.js.map +2 -2
- package/dist/commands/export.js +156 -0
- package/dist/commands/export.js.map +7 -0
- package/dist/commands/mcp-interactive.js +21 -12
- package/dist/commands/mcp-interactive.js.map +2 -2
- package/dist/commands/model.js +6 -5
- package/dist/commands/model.js.map +2 -2
- package/dist/commands/permissions.js +86 -0
- package/dist/commands/permissions.js.map +7 -0
- package/dist/commands/quit.js +3 -1
- package/dist/commands/quit.js.map +2 -2
- package/dist/commands/sandbox.js +104 -0
- package/dist/commands/sandbox.js.map +7 -0
- package/dist/commands/status.js +58 -0
- package/dist/commands/status.js.map +7 -0
- package/dist/commands/tasks.js +108 -0
- package/dist/commands/tasks.js.map +7 -0
- package/dist/commands/todos.js +123 -0
- package/dist/commands/todos.js.map +7 -0
- package/dist/commands.js +20 -2
- package/dist/commands.js.map +2 -2
- package/dist/components/AgentThinkingBlock.js +10 -18
- package/dist/components/AgentThinkingBlock.js.map +2 -2
- package/dist/components/BackgroundTasksPanel.js +78 -29
- package/dist/components/BackgroundTasksPanel.js.map +2 -2
- package/dist/components/BashStreamingProgress.js +24 -0
- package/dist/components/BashStreamingProgress.js.map +7 -0
- package/dist/components/CollapsibleHint.js +14 -0
- package/dist/components/CollapsibleHint.js.map +7 -0
- package/dist/components/FileEditToolUpdatedMessage.js +1 -1
- package/dist/components/FileEditToolUpdatedMessage.js.map +2 -2
- package/dist/components/HotkeyHelpPanel.js +137 -0
- package/dist/components/HotkeyHelpPanel.js.map +7 -0
- package/dist/components/Logo.js +5 -5
- package/dist/components/Logo.js.map +2 -2
- package/dist/components/Message.js +23 -7
- package/dist/components/Message.js.map +3 -3
- package/dist/components/ModelConfig.js +16 -3
- package/dist/components/ModelConfig.js.map +2 -2
- package/dist/components/ModelListManager.js +3 -3
- package/dist/components/ModelListManager.js.map +2 -2
- package/dist/components/ModelSelector/ModelSelector.js +1 -1
- package/dist/components/Onboarding.js +19 -14
- package/dist/components/Onboarding.js.map +2 -2
- package/dist/components/ProgressBar.js +74 -0
- package/dist/components/ProgressBar.js.map +7 -0
- package/dist/components/PromptInput.js +156 -46
- package/dist/components/PromptInput.js.map +2 -2
- package/dist/components/RequestStatusIndicator.js +194 -0
- package/dist/components/RequestStatusIndicator.js.map +7 -0
- package/dist/components/Spinner.js +92 -27
- package/dist/components/Spinner.js.map +2 -2
- package/dist/components/SpinnerSymbol.js +21 -27
- package/dist/components/SpinnerSymbol.js.map +2 -2
- package/dist/components/StreamingBashOutput.js +9 -8
- package/dist/components/StreamingBashOutput.js.map +2 -2
- package/dist/components/SubagentBlock.js +1 -1
- package/dist/components/SubagentBlock.js.map +1 -1
- package/dist/components/SubagentProgress.js +10 -11
- package/dist/components/SubagentProgress.js.map +2 -2
- package/dist/components/TaskCard.js +16 -13
- package/dist/components/TaskCard.js.map +2 -2
- package/dist/components/TodoChangeBlock.js +1 -1
- package/dist/components/TodoChangeBlock.js.map +2 -2
- package/dist/components/TodoPanel.js +120 -29
- package/dist/components/TodoPanel.js.map +3 -3
- package/dist/components/TokenCounter.js +74 -0
- package/dist/components/TokenCounter.js.map +7 -0
- package/dist/components/TokenWarning.js +2 -1
- package/dist/components/TokenWarning.js.map +2 -2
- package/dist/components/TreeConnector.js +25 -0
- package/dist/components/TreeConnector.js.map +7 -0
- package/dist/components/TurnCompletionIndicator.js +18 -0
- package/dist/components/TurnCompletionIndicator.js.map +7 -0
- package/dist/components/messages/AssistantTextMessage.js +5 -2
- package/dist/components/messages/AssistantTextMessage.js.map +2 -2
- package/dist/components/messages/AssistantThinkingMessage.js +18 -3
- package/dist/components/messages/AssistantThinkingMessage.js.map +2 -2
- package/dist/components/messages/AssistantToolUseMessage.js +11 -8
- package/dist/components/messages/AssistantToolUseMessage.js.map +2 -2
- package/dist/components/messages/GroupRenderer.js +53 -0
- package/dist/components/messages/GroupRenderer.js.map +7 -0
- package/dist/components/messages/NestedTasksPreview.js +12 -0
- package/dist/components/messages/NestedTasksPreview.js.map +7 -0
- package/dist/components/messages/ParallelTasksGroupView.js +92 -0
- package/dist/components/messages/ParallelTasksGroupView.js.map +7 -0
- package/dist/components/messages/TaskInModuleView.js +198 -0
- package/dist/components/messages/TaskInModuleView.js.map +7 -0
- package/dist/components/messages/TaskOutputContent.js +53 -0
- package/dist/components/messages/TaskOutputContent.js.map +7 -0
- package/dist/components/messages/UserPromptMessage.js +1 -1
- package/dist/components/messages/UserPromptMessage.js.map +2 -2
- package/dist/components/messages/UserToolResultMessage/UserToolSuccessMessage.js +2 -3
- package/dist/components/messages/UserToolResultMessage/UserToolSuccessMessage.js.map +2 -2
- package/dist/components/permissions/FallbackPermissionRequest.js +4 -4
- package/dist/components/permissions/FallbackPermissionRequest.js.map +2 -2
- package/dist/components/permissions/FilesystemPermissionRequest/FilesystemPermissionRequest.js +4 -4
- package/dist/components/permissions/FilesystemPermissionRequest/FilesystemPermissionRequest.js.map +2 -2
- package/dist/constants/colors.js +48 -0
- package/dist/constants/colors.js.map +2 -2
- package/dist/constants/formatRules.js +102 -0
- package/dist/constants/formatRules.js.map +7 -0
- package/dist/constants/prompts.js +12 -34
- package/dist/constants/prompts.js.map +2 -2
- package/dist/constants/symbols.js +64 -6
- package/dist/constants/symbols.js.map +2 -2
- package/dist/constants/timing.js +5 -0
- package/dist/constants/timing.js.map +2 -2
- package/dist/core/config/defaults.js +84 -0
- package/dist/core/config/defaults.js.map +7 -0
- package/dist/core/config/index.js +111 -0
- package/dist/core/config/index.js.map +7 -0
- package/dist/core/config/loader.js +221 -0
- package/dist/core/config/loader.js.map +7 -0
- package/dist/core/config/migrations.js +128 -0
- package/dist/core/config/migrations.js.map +7 -0
- package/dist/core/config/schema.js +178 -0
- package/dist/core/config/schema.js.map +7 -0
- package/dist/core/costTracker.js +138 -0
- package/dist/core/costTracker.js.map +7 -0
- package/dist/core/index.js +5 -0
- package/dist/core/index.js.map +7 -0
- package/dist/core/permissions/auditLog.js +204 -0
- package/dist/core/permissions/auditLog.js.map +7 -0
- package/dist/core/permissions/engine/index.js +3 -0
- package/dist/core/permissions/engine/index.js.map +7 -0
- package/dist/core/permissions/engine/permissionEngine.js +106 -0
- package/dist/core/permissions/engine/permissionEngine.js.map +7 -0
- package/dist/core/permissions/engine/types.js +1 -0
- package/dist/core/permissions/engine/types.js.map +7 -0
- package/dist/core/permissions/index.js +84 -0
- package/dist/core/permissions/index.js.map +7 -0
- package/dist/core/permissions/ruleEngine.js +259 -0
- package/dist/core/permissions/ruleEngine.js.map +7 -0
- package/dist/core/permissions/rules/allowedToolsRule.js +62 -0
- package/dist/core/permissions/rules/allowedToolsRule.js.map +7 -0
- package/dist/core/permissions/rules/autoEscalationRule.js +291 -0
- package/dist/core/permissions/rules/autoEscalationRule.js.map +7 -0
- package/dist/core/permissions/rules/index.js +46 -0
- package/dist/core/permissions/rules/index.js.map +7 -0
- package/dist/core/permissions/rules/planModeRule.js +55 -0
- package/dist/core/permissions/rules/planModeRule.js.map +7 -0
- package/dist/core/permissions/rules/projectBoundaryRule.js +168 -0
- package/dist/core/permissions/rules/projectBoundaryRule.js.map +7 -0
- package/dist/core/permissions/rules/safeModeRule.js +65 -0
- package/dist/core/permissions/rules/safeModeRule.js.map +7 -0
- package/dist/core/permissions/rules/sensitivePathsRule.js +340 -0
- package/dist/core/permissions/rules/sensitivePathsRule.js.map +7 -0
- package/dist/core/permissions/types.js +127 -0
- package/dist/core/permissions/types.js.map +7 -0
- package/dist/core/tools/executor.js +143 -0
- package/dist/core/tools/executor.js.map +7 -0
- package/dist/core/tools/index.js +15 -0
- package/dist/core/tools/index.js.map +7 -0
- package/dist/core/tools/registry.js +183 -0
- package/dist/core/tools/registry.js.map +7 -0
- package/dist/core/tools/types.js +1 -0
- package/dist/core/tools/types.js.map +7 -0
- package/dist/cost-tracker.js +23 -15
- package/dist/cost-tracker.js.map +2 -2
- package/dist/entrypoints/cli.js +43 -43
- package/dist/entrypoints/cli.js.map +2 -2
- package/dist/entrypoints/mcp.js +12 -4
- package/dist/entrypoints/mcp.js.map +2 -2
- package/dist/history.js +14 -3
- package/dist/history.js.map +2 -2
- package/dist/hooks/useAgentTranscripts.js +116 -0
- package/dist/hooks/useAgentTranscripts.js.map +7 -0
- package/dist/hooks/useAnimationSync.js +53 -0
- package/dist/hooks/useAnimationSync.js.map +7 -0
- package/dist/hooks/useArrowKeyHistory.js +4 -2
- package/dist/hooks/useArrowKeyHistory.js.map +2 -2
- package/dist/hooks/useCanUseTool.js +3 -1
- package/dist/hooks/useCanUseTool.js.map +2 -2
- package/dist/hooks/useCancelRequest.js +4 -1
- package/dist/hooks/useCancelRequest.js.map +2 -2
- package/dist/hooks/useExitOnCtrlCD.js +9 -5
- package/dist/hooks/useExitOnCtrlCD.js.map +2 -2
- package/dist/hooks/useHookStatus.js +40 -0
- package/dist/hooks/useHookStatus.js.map +7 -0
- package/dist/hooks/useLogMessages.js +17 -1
- package/dist/hooks/useLogMessages.js.map +2 -2
- package/dist/hooks/useMessageGroups.js +43 -0
- package/dist/hooks/useMessageGroups.js.map +7 -0
- package/dist/hooks/useTerminalSize.js +62 -6
- package/dist/hooks/useTerminalSize.js.map +2 -2
- package/dist/hooks/useUnifiedCompletion.js +69 -0
- package/dist/hooks/useUnifiedCompletion.js.map +2 -2
- package/dist/i18n/index.js +109 -0
- package/dist/i18n/index.js.map +7 -0
- package/dist/i18n/locales/en.js +347 -0
- package/dist/i18n/locales/en.js.map +7 -0
- package/dist/i18n/locales/index.js +7 -0
- package/dist/i18n/locales/index.js.map +7 -0
- package/dist/i18n/locales/zh-CN.js +347 -0
- package/dist/i18n/locales/zh-CN.js.map +7 -0
- package/dist/i18n/types.js +8 -0
- package/dist/i18n/types.js.map +7 -0
- package/dist/query.js +175 -17
- package/dist/query.js.map +3 -3
- package/dist/screens/REPL.js +501 -192
- package/dist/screens/REPL.js.map +3 -3
- package/dist/services/adapters/chatCompletions.js +3 -1
- package/dist/services/adapters/chatCompletions.js.map +2 -2
- package/dist/services/adapters/messageNormalizer.js +354 -0
- package/dist/services/adapters/messageNormalizer.js.map +7 -0
- package/dist/services/adapters/responsesAPI.js +6 -3
- package/dist/services/adapters/responsesAPI.js.map +2 -2
- package/dist/services/checkpointManager.js +386 -0
- package/dist/services/checkpointManager.js.map +7 -0
- package/dist/services/claude.js +138 -11
- package/dist/services/claude.js.map +3 -3
- package/dist/services/compressionService.js +50 -1
- package/dist/services/compressionService.js.map +2 -2
- package/dist/services/contextMonitor.js +162 -0
- package/dist/services/contextMonitor.js.map +7 -0
- package/dist/services/customCommands.js +60 -41
- package/dist/services/customCommands.js.map +2 -2
- package/dist/services/hookExecutor.js +173 -1
- package/dist/services/hookExecutor.js.map +2 -2
- package/dist/services/intelligentCompactor.js +281 -0
- package/dist/services/intelligentCompactor.js.map +7 -0
- package/dist/services/lspConfig.js +109 -0
- package/dist/services/lspConfig.js.map +7 -0
- package/dist/services/mcpClient.js +273 -34
- package/dist/services/mcpClient.js.map +2 -2
- package/dist/services/modelOrchestrator.js +310 -0
- package/dist/services/modelOrchestrator.js.map +7 -0
- package/dist/services/openai.js +8 -1
- package/dist/services/openai.js.map +2 -2
- package/dist/services/outputStyles.js +138 -0
- package/dist/services/outputStyles.js.map +7 -0
- package/dist/services/plugins/index.js +5 -0
- package/dist/services/plugins/index.js.map +7 -0
- package/dist/services/plugins/lspServers.js +188 -0
- package/dist/services/plugins/lspServers.js.map +7 -0
- package/dist/services/plugins/pluginRuntime.js +229 -0
- package/dist/services/plugins/pluginRuntime.js.map +7 -0
- package/dist/services/plugins/pluginValidation.js +219 -0
- package/dist/services/plugins/pluginValidation.js.map +7 -0
- package/dist/services/plugins/skillMarketplace.js +556 -0
- package/dist/services/plugins/skillMarketplace.js.map +7 -0
- package/dist/services/responseStateManager.js +37 -3
- package/dist/services/responseStateManager.js.map +2 -2
- package/dist/services/sandbox/filesystemBoundary.js +300 -0
- package/dist/services/sandbox/filesystemBoundary.js.map +7 -0
- package/dist/services/sandbox/index.js +14 -0
- package/dist/services/sandbox/index.js.map +7 -0
- package/dist/services/sandbox/networkProxy.js +293 -0
- package/dist/services/sandbox/networkProxy.js.map +7 -0
- package/dist/services/sandbox/sandboxController.js +574 -0
- package/dist/services/sandbox/sandboxController.js.map +7 -0
- package/dist/services/sandbox/types.js +50 -0
- package/dist/services/sandbox/types.js.map +7 -0
- package/dist/services/sessionMemory.js +266 -0
- package/dist/services/sessionMemory.js.map +7 -0
- package/dist/services/taskRouter.js +324 -0
- package/dist/services/taskRouter.js.map +7 -0
- package/dist/tools/ArchitectTool/ArchitectTool.js +7 -1
- package/dist/tools/ArchitectTool/ArchitectTool.js.map +2 -2
- package/dist/tools/AskExpertModelTool/AskExpertModelTool.js +3 -0
- package/dist/tools/AskExpertModelTool/AskExpertModelTool.js.map +2 -2
- package/dist/tools/AskUserQuestionTool/AskUserQuestionTool.js.map +2 -2
- package/dist/tools/BaseTool.js +72 -0
- package/dist/tools/BaseTool.js.map +7 -0
- package/dist/tools/BashOutputTool/BashOutputToolResultMessage.js +3 -0
- package/dist/tools/BashOutputTool/BashOutputToolResultMessage.js.map +2 -2
- package/dist/tools/BashTool/BashTool.js +60 -3
- package/dist/tools/BashTool/BashTool.js.map +2 -2
- package/dist/tools/BashTool/BashToolResultMessage.js +3 -0
- package/dist/tools/BashTool/BashToolResultMessage.js.map +2 -2
- package/dist/tools/BashTool/OutputLine.js +54 -0
- package/dist/tools/BashTool/OutputLine.js.map +2 -2
- package/dist/tools/BashTool/prompt.js +192 -3
- package/dist/tools/BashTool/prompt.js.map +2 -2
- package/dist/tools/FileEditTool/FileEditTool.js +29 -4
- package/dist/tools/FileEditTool/FileEditTool.js.map +2 -2
- package/dist/tools/FileWriteTool/FileWriteTool.js +5 -5
- package/dist/tools/FileWriteTool/FileWriteTool.js.map +2 -2
- package/dist/tools/GlobTool/GlobTool.js +4 -2
- package/dist/tools/GlobTool/GlobTool.js.map +2 -2
- package/dist/tools/GrepTool/GrepTool.js +36 -7
- package/dist/tools/GrepTool/GrepTool.js.map +2 -2
- package/dist/tools/KillShellTool/KillShellToolResultMessage.js +3 -0
- package/dist/tools/KillShellTool/KillShellToolResultMessage.js.map +2 -2
- package/dist/tools/ListMcpResourcesTool/ListMcpResourcesTool.js +109 -0
- package/dist/tools/ListMcpResourcesTool/ListMcpResourcesTool.js.map +7 -0
- package/dist/tools/ListMcpResourcesTool/prompt.js +19 -0
- package/dist/tools/ListMcpResourcesTool/prompt.js.map +7 -0
- package/dist/tools/LspTool/LspTool.js +664 -0
- package/dist/tools/LspTool/LspTool.js.map +7 -0
- package/dist/tools/LspTool/prompt.js +27 -0
- package/dist/tools/LspTool/prompt.js.map +7 -0
- package/dist/tools/MCPTool/MCPTool.js +9 -1
- package/dist/tools/MCPTool/MCPTool.js.map +2 -2
- package/dist/tools/MemoryReadTool/MemoryReadTool.js +19 -6
- package/dist/tools/MemoryReadTool/MemoryReadTool.js.map +2 -2
- package/dist/tools/MemoryWriteTool/MemoryWriteTool.js +6 -6
- package/dist/tools/MemoryWriteTool/MemoryWriteTool.js.map +2 -2
- package/dist/tools/MultiEditTool/MultiEditTool.js +19 -2
- package/dist/tools/MultiEditTool/MultiEditTool.js.map +2 -2
- package/dist/tools/NotebookEditTool/NotebookEditTool.js +5 -1
- package/dist/tools/NotebookEditTool/NotebookEditTool.js.map +2 -2
- package/dist/tools/NotebookReadTool/NotebookReadTool.js.map +2 -2
- package/dist/tools/PlanModeTool/EnterPlanModeTool.js +74 -0
- package/dist/tools/PlanModeTool/EnterPlanModeTool.js.map +7 -0
- package/dist/tools/PlanModeTool/ExitPlanModeTool.js +108 -0
- package/dist/tools/PlanModeTool/ExitPlanModeTool.js.map +7 -0
- package/dist/tools/PlanModeTool/prompt.js +94 -0
- package/dist/tools/PlanModeTool/prompt.js.map +7 -0
- package/dist/tools/ReadMcpResourceTool/ReadMcpResourceTool.js +130 -0
- package/dist/tools/ReadMcpResourceTool/ReadMcpResourceTool.js.map +7 -0
- package/dist/tools/ReadMcpResourceTool/prompt.js +17 -0
- package/dist/tools/ReadMcpResourceTool/prompt.js.map +7 -0
- package/dist/tools/SkillTool/SkillTool.js +6 -1
- package/dist/tools/SkillTool/SkillTool.js.map +2 -2
- package/dist/tools/SlashCommandTool/SlashCommandTool.js +260 -0
- package/dist/tools/SlashCommandTool/SlashCommandTool.js.map +7 -0
- package/dist/tools/SlashCommandTool/prompt.js +35 -0
- package/dist/tools/SlashCommandTool/prompt.js.map +7 -0
- package/dist/tools/TaskOutputTool/TaskOutputTool.js +189 -0
- package/dist/tools/TaskOutputTool/TaskOutputTool.js.map +7 -0
- package/dist/tools/TaskOutputTool/prompt.js +15 -0
- package/dist/tools/TaskOutputTool/prompt.js.map +7 -0
- package/dist/tools/TaskTool/TaskTool.js +302 -104
- package/dist/tools/TaskTool/TaskTool.js.map +2 -2
- package/dist/tools/TaskTool/prompt.js.map +2 -2
- package/dist/tools/TodoWriteTool/TodoWriteTool.js +42 -77
- package/dist/tools/TodoWriteTool/TodoWriteTool.js.map +2 -2
- package/dist/tools/URLFetcherTool/URLFetcherTool.js +4 -1
- package/dist/tools/URLFetcherTool/URLFetcherTool.js.map +2 -2
- package/dist/tools/URLFetcherTool/cache.js +55 -8
- package/dist/tools/URLFetcherTool/cache.js.map +2 -2
- package/dist/tools.js +31 -2
- package/dist/tools.js.map +2 -2
- package/dist/types/hooks.js +4 -0
- package/dist/types/hooks.js.map +2 -2
- package/dist/types/marketplace.js.map +2 -2
- package/dist/types/messageGroup.js +36 -0
- package/dist/types/messageGroup.js.map +7 -0
- package/dist/types/plugin.js.map +2 -2
- package/dist/types/thinking.js +1 -0
- package/dist/types/thinking.js.map +7 -0
- package/dist/utils/BackgroundShellManager.js +136 -39
- package/dist/utils/BackgroundShellManager.js.map +2 -2
- package/dist/utils/MessageBatchBuffer.js +102 -0
- package/dist/utils/MessageBatchBuffer.js.map +7 -0
- package/dist/utils/PersistentShell.js +151 -1
- package/dist/utils/PersistentShell.js.map +2 -2
- package/dist/utils/agentLoader.js +1 -23
- package/dist/utils/agentLoader.js.map +2 -2
- package/dist/utils/agentTranscripts.js +641 -0
- package/dist/utils/agentTranscripts.js.map +7 -0
- package/dist/utils/animationManager.js +213 -0
- package/dist/utils/animationManager.js.map +7 -0
- package/dist/utils/animationSync.js +110 -0
- package/dist/utils/animationSync.js.map +7 -0
- package/dist/utils/asyncFile.js +215 -0
- package/dist/utils/asyncFile.js.map +7 -0
- package/dist/utils/backgroundAgentManager.js +231 -0
- package/dist/utils/backgroundAgentManager.js.map +7 -0
- package/dist/utils/config.js +63 -7
- package/dist/utils/config.js.map +2 -2
- package/dist/utils/conversationRecovery.js +19 -0
- package/dist/utils/conversationRecovery.js.map +2 -2
- package/dist/utils/exit.js +73 -0
- package/dist/utils/exit.js.map +7 -0
- package/dist/utils/format.js +73 -5
- package/dist/utils/format.js.map +2 -2
- package/dist/utils/generators.js +76 -6
- package/dist/utils/generators.js.map +2 -2
- package/dist/utils/globalErrorHandler.js +149 -0
- package/dist/utils/globalErrorHandler.js.map +7 -0
- package/dist/utils/groupHandlers/index.js +8 -0
- package/dist/utils/groupHandlers/index.js.map +7 -0
- package/dist/utils/groupHandlers/parallelTasksHandler.js +140 -0
- package/dist/utils/groupHandlers/parallelTasksHandler.js.map +7 -0
- package/dist/utils/groupHandlers/taskHandler.js +104 -0
- package/dist/utils/groupHandlers/taskHandler.js.map +7 -0
- package/dist/utils/groupHandlers/types.js +1 -0
- package/dist/utils/groupHandlers/types.js.map +7 -0
- package/dist/utils/logRotation.js +224 -0
- package/dist/utils/logRotation.js.map +7 -0
- package/dist/utils/marketplaceManager.js +3 -5
- package/dist/utils/marketplaceManager.js.map +2 -2
- package/dist/utils/memSafety.js +264 -0
- package/dist/utils/memSafety.js.map +7 -0
- package/dist/utils/messageGroupManager.js +274 -0
- package/dist/utils/messageGroupManager.js.map +7 -0
- package/dist/utils/messages.js +13 -4
- package/dist/utils/messages.js.map +2 -2
- package/dist/utils/model.js +119 -15
- package/dist/utils/model.js.map +3 -3
- package/dist/utils/permissions/filesystem.js +157 -5
- package/dist/utils/permissions/filesystem.js.map +2 -2
- package/dist/utils/plan/planMode.js +143 -0
- package/dist/utils/plan/planMode.js.map +7 -0
- package/dist/utils/pluginLoader.js +17 -21
- package/dist/utils/pluginLoader.js.map +2 -2
- package/dist/utils/ripgrep.js +55 -2
- package/dist/utils/ripgrep.js.map +2 -2
- package/dist/utils/sanitizeInput.js +32 -0
- package/dist/utils/sanitizeInput.js.map +7 -0
- package/dist/utils/secureKeyStorage.js +312 -0
- package/dist/utils/secureKeyStorage.js.map +7 -0
- package/dist/utils/session/sessionPlugins.js +67 -0
- package/dist/utils/session/sessionPlugins.js.map +7 -0
- package/dist/utils/taskDisplayUtils.js +257 -0
- package/dist/utils/taskDisplayUtils.js.map +7 -0
- package/dist/utils/teamConfig.js +2 -1
- package/dist/utils/teamConfig.js.map +2 -2
- package/dist/utils/todoStorage.js +92 -2
- package/dist/utils/todoStorage.js.map +2 -2
- package/dist/utils/toolTimeout.js +136 -0
- package/dist/utils/toolTimeout.js.map +7 -0
- package/dist/utils/tooling/safeRender.js +115 -0
- package/dist/utils/tooling/safeRender.js.map +7 -0
- package/dist/utils/userFriendlyError.js +346 -0
- package/dist/utils/userFriendlyError.js.map +7 -0
- package/dist/utils/vendor/ripgrep/arm64-darwin/rg +0 -0
- package/dist/version.js +2 -2
- package/dist/version.js.map +1 -1
- package/package.json +14 -4
- package/scripts/postinstall.js +128 -38
- package/dist/commands/agents.js +0 -2086
- package/dist/commands/agents.js.map +0 -7
- package/dist/commands/build.js +0 -74
- package/dist/commands/build.js.map +0 -7
- package/dist/commands/compression.js +0 -57
- package/dist/commands/compression.js.map +0 -7
- package/dist/commands/listen.js +0 -37
- package/dist/commands/listen.js.map +0 -7
- package/dist/commands/login.js +0 -37
- package/dist/commands/login.js.map +0 -7
- package/dist/commands/logout.js +0 -33
- package/dist/commands/logout.js.map +0 -7
- package/dist/commands/mcp.js +0 -40
- package/dist/commands/mcp.js.map +0 -7
- package/dist/commands/mcp_refresh.js +0 -40
- package/dist/commands/mcp_refresh.js.map +0 -7
- package/dist/commands/modelstatus.js +0 -21
- package/dist/commands/modelstatus.js.map +0 -7
- package/dist/commands/onboarding.js +0 -36
- package/dist/commands/onboarding.js.map +0 -7
- package/dist/commands/plugin-interactive.js +0 -446
- package/dist/commands/plugin-interactive.js.map +0 -7
- package/dist/commands/pr_comments.js +0 -61
- package/dist/commands/pr_comments.js.map +0 -7
- package/dist/commands/release-notes.js +0 -30
- package/dist/commands/release-notes.js.map +0 -7
- package/dist/commands/review.js +0 -51
- package/dist/commands/review.js.map +0 -7
- package/dist/components/Bug.js +0 -147
- package/dist/components/Bug.js.map +0 -7
- package/dist/components/ModelSelector.js +0 -2062
- package/dist/components/ModelSelector.js.map +0 -7
- package/dist/components/ModelStatusDisplay.js +0 -87
- package/dist/components/ModelStatusDisplay.js.map +0 -7
- package/dist/entrypoints/cli-wrapper.js +0 -61
- package/dist/entrypoints/cli-wrapper.js.map +0 -7
- package/dist/screens/Doctor.js +0 -22
- package/dist/screens/Doctor.js.map +0 -7
package/cli.js
CHANGED
|
@@ -1,59 +1,177 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Minto CLI Wrapper
|
|
5
|
+
*
|
|
6
|
+
* This wrapper provides seamless execution across different environments:
|
|
7
|
+
*
|
|
8
|
+
* Priority 1: Pre-compiled native binary (from optionalDependencies)
|
|
9
|
+
* - Best performance, no runtime dependencies
|
|
10
|
+
* - Installed automatically via npm optionalDependencies
|
|
11
|
+
*
|
|
12
|
+
* Priority 2: Bun runtime
|
|
13
|
+
* - Excellent PTY/stdin handling
|
|
14
|
+
* - Fast startup time
|
|
15
|
+
*
|
|
16
|
+
* Priority 3: Node.js runtime
|
|
17
|
+
* - Fallback for environments without Bun
|
|
18
|
+
* - May have PTY issues in some terminals
|
|
19
|
+
*/
|
|
5
20
|
|
|
6
|
-
const { spawn } = require('child_process');
|
|
7
|
-
const { existsSync } = require('fs');
|
|
21
|
+
const { spawn, spawnSync } = require('child_process');
|
|
22
|
+
const { existsSync, chmodSync } = require('fs');
|
|
8
23
|
const path = require('path');
|
|
9
24
|
|
|
10
|
-
// Get the directory where this CLI script is installed
|
|
11
25
|
const mintoDir = __dirname;
|
|
12
|
-
const
|
|
26
|
+
const args = process.argv.slice(2);
|
|
13
27
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
28
|
+
/**
|
|
29
|
+
* Get the native binary path from optionalDependencies
|
|
30
|
+
* npm installs platform-specific packages to node_modules
|
|
31
|
+
* @returns {string|null} Path to binary or null if not found
|
|
32
|
+
*/
|
|
33
|
+
function getNativeBinaryPath() {
|
|
34
|
+
const platform = process.platform; // darwin, linux, win32
|
|
35
|
+
const arch = process.arch; // arm64, x64
|
|
36
|
+
const packageName = `@within-7/minto-${platform}-${arch}`;
|
|
37
|
+
const binaryName = platform === 'win32' ? 'minto.exe' : 'minto';
|
|
19
38
|
|
|
20
|
-
//
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
39
|
+
// Check in node_modules (installed via optionalDependencies)
|
|
40
|
+
const possiblePaths = [
|
|
41
|
+
// Standard npm install location
|
|
42
|
+
path.join(mintoDir, 'node_modules', packageName, binaryName),
|
|
43
|
+
// Hoisted location (npm/yarn may hoist)
|
|
44
|
+
path.join(mintoDir, '..', packageName, binaryName),
|
|
45
|
+
// pnpm symlink location
|
|
46
|
+
path.join(mintoDir, 'node_modules', '.pnpm', 'node_modules', packageName, binaryName),
|
|
47
|
+
// Global install - check parent node_modules
|
|
48
|
+
path.join(mintoDir, '..', '..', packageName, binaryName),
|
|
49
|
+
];
|
|
26
50
|
|
|
27
|
-
|
|
28
|
-
if (
|
|
29
|
-
//
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
51
|
+
for (const binaryPath of possiblePaths) {
|
|
52
|
+
if (existsSync(binaryPath)) {
|
|
53
|
+
// Ensure executable permission on Unix
|
|
54
|
+
if (platform !== 'win32') {
|
|
55
|
+
try {
|
|
56
|
+
chmodSync(binaryPath, 0o755);
|
|
57
|
+
} catch {
|
|
58
|
+
// Ignore - might already be executable or no permission
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return binaryPath;
|
|
34
62
|
}
|
|
35
|
-
}
|
|
63
|
+
}
|
|
36
64
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
65
|
+
// Also check legacy binaries/ directory (for backward compatibility)
|
|
66
|
+
const legacyPath = path.join(mintoDir, 'binaries', `minto-${platform}-${arch}${platform === 'win32' ? '.exe' : ''}`);
|
|
67
|
+
if (existsSync(legacyPath)) {
|
|
68
|
+
if (platform !== 'win32') {
|
|
69
|
+
try {
|
|
70
|
+
chmodSync(legacyPath, 0o755);
|
|
71
|
+
} catch {}
|
|
72
|
+
}
|
|
73
|
+
return legacyPath;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Check if a runtime command is available
|
|
81
|
+
* @param {string} command - Command to check (e.g., 'bun', 'node')
|
|
82
|
+
* @returns {boolean}
|
|
83
|
+
*/
|
|
84
|
+
function isRuntimeAvailable(command) {
|
|
85
|
+
try {
|
|
86
|
+
const result = spawnSync(command, ['--version'], {
|
|
87
|
+
stdio: 'pipe',
|
|
88
|
+
timeout: 5000,
|
|
89
|
+
windowsHide: true
|
|
90
|
+
});
|
|
91
|
+
return result.status === 0;
|
|
92
|
+
} catch {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
41
96
|
|
|
42
|
-
|
|
43
|
-
|
|
97
|
+
/**
|
|
98
|
+
* Spawn a process and handle exit
|
|
99
|
+
* @param {string} command
|
|
100
|
+
* @param {string[]} cmdArgs
|
|
101
|
+
*/
|
|
102
|
+
function runAndExit(command, cmdArgs) {
|
|
103
|
+
const proc = spawn(command, cmdArgs, {
|
|
44
104
|
stdio: 'inherit',
|
|
45
|
-
cwd: process.cwd()
|
|
105
|
+
cwd: process.cwd()
|
|
46
106
|
});
|
|
47
107
|
|
|
48
108
|
proc.on('error', (err) => {
|
|
49
|
-
console.error(
|
|
109
|
+
console.error(`❌ Failed to start: ${err.message}`);
|
|
50
110
|
process.exit(1);
|
|
51
111
|
});
|
|
52
112
|
|
|
53
113
|
proc.on('close', (code) => {
|
|
54
|
-
process.exit(code);
|
|
114
|
+
process.exit(code ?? 0);
|
|
55
115
|
});
|
|
56
|
-
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Show helpful error message when no execution method is available
|
|
120
|
+
*/
|
|
121
|
+
function showInstallationHelp() {
|
|
122
|
+
console.error('');
|
|
123
|
+
console.error('❌ Minto 无法启动');
|
|
124
|
+
console.error('');
|
|
125
|
+
console.error(' 当前平台缺少可用的运行环境。');
|
|
126
|
+
console.error('');
|
|
127
|
+
console.error(' 请安装 Bun 运行时 (推荐,一行命令即可):');
|
|
128
|
+
console.error('');
|
|
129
|
+
|
|
130
|
+
if (process.platform === 'win32') {
|
|
131
|
+
console.error(' Windows (PowerShell 管理员模式):');
|
|
132
|
+
console.error(' powershell -c "irm bun.sh/install.ps1 | iex"');
|
|
133
|
+
} else if (process.platform === 'darwin') {
|
|
134
|
+
console.error(' macOS (终端):');
|
|
135
|
+
console.error(' curl -fsSL https://bun.sh/install | bash');
|
|
136
|
+
} else {
|
|
137
|
+
console.error(' Linux (终端):');
|
|
138
|
+
console.error(' curl -fsSL https://bun.sh/install | bash');
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
console.error('');
|
|
142
|
+
console.error(' 安装完成后,重新打开终端并运行: minto');
|
|
143
|
+
console.error('');
|
|
144
|
+
console.error(' 如有问题,请访问: https://github.com/within-7/minto/issues');
|
|
145
|
+
console.error('');
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// ============ Main Execution Logic ============
|
|
149
|
+
|
|
150
|
+
// Priority 1: Try native binary (best option)
|
|
151
|
+
const nativeBinary = getNativeBinaryPath();
|
|
152
|
+
if (nativeBinary) {
|
|
153
|
+
runAndExit(nativeBinary, args);
|
|
154
|
+
return; // Note: runAndExit handles process exit
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// Priority 2: Try Bun runtime
|
|
158
|
+
if (isRuntimeAvailable('bun')) {
|
|
159
|
+
const distPath = path.join(mintoDir, 'dist', 'index.js');
|
|
160
|
+
if (existsSync(distPath)) {
|
|
161
|
+
runAndExit('bun', ['run', distPath, ...args]);
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// Priority 3: Try Node.js runtime
|
|
167
|
+
if (isRuntimeAvailable('node')) {
|
|
168
|
+
const distPath = path.join(mintoDir, 'dist', 'index.js');
|
|
169
|
+
if (existsSync(distPath)) {
|
|
170
|
+
runAndExit('node', [distPath, ...args]);
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
57
174
|
|
|
58
|
-
//
|
|
59
|
-
|
|
175
|
+
// No execution method available
|
|
176
|
+
showInstallationHelp();
|
|
177
|
+
process.exit(1);
|
package/dist/Tool.js
CHANGED
|
@@ -1 +1,39 @@
|
|
|
1
|
+
function getToolDescription(tool) {
|
|
2
|
+
if (tool.cachedDescription) {
|
|
3
|
+
return tool.cachedDescription;
|
|
4
|
+
}
|
|
5
|
+
if (typeof tool.description === "string") {
|
|
6
|
+
return tool.description;
|
|
7
|
+
}
|
|
8
|
+
return `Tool: ${tool.name}`;
|
|
9
|
+
}
|
|
10
|
+
async function getToolDescriptionAsync(tool, input) {
|
|
11
|
+
if (typeof tool.description === "string") {
|
|
12
|
+
return tool.description;
|
|
13
|
+
}
|
|
14
|
+
if (typeof tool.description === "function") {
|
|
15
|
+
return await tool.description(input);
|
|
16
|
+
}
|
|
17
|
+
return `Tool: ${tool.name}`;
|
|
18
|
+
}
|
|
19
|
+
async function cacheToolDescriptions(tools) {
|
|
20
|
+
await Promise.all(
|
|
21
|
+
tools.map(async (tool) => {
|
|
22
|
+
if (typeof tool.description === "function" && !tool.cachedDescription) {
|
|
23
|
+
try {
|
|
24
|
+
tool.cachedDescription = await tool.description();
|
|
25
|
+
} catch (error) {
|
|
26
|
+
tool.cachedDescription = `Tool: ${tool.name}`;
|
|
27
|
+
}
|
|
28
|
+
} else if (typeof tool.description === "string" && !tool.cachedDescription) {
|
|
29
|
+
tool.cachedDescription = tool.description;
|
|
30
|
+
}
|
|
31
|
+
})
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
export {
|
|
35
|
+
cacheToolDescriptions,
|
|
36
|
+
getToolDescription,
|
|
37
|
+
getToolDescriptionAsync
|
|
38
|
+
};
|
|
1
39
|
//# sourceMappingURL=Tool.js.map
|
package/dist/Tool.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": [],
|
|
4
|
-
"sourcesContent": [],
|
|
5
|
-
"mappings": "",
|
|
3
|
+
"sources": ["../src/Tool.ts"],
|
|
4
|
+
"sourcesContent": ["import { z } from 'zod'\nimport * as React from 'react'\nimport type { UserQuestion, UserAnswer } from './types/askUserQuestion'\nimport type {\n ToolUseOptions,\n ResponseState,\n ValidationResult as CoreValidationResult,\n} from './types/core'\n\n/**\n * Core Tool interface for Minto's extensible tool system\n * Provides standardized contract for all tool implementations\n *\n * IMPORTANT: Tool descriptions can be either:\n * - A string (synchronous, preferred for adapters)\n * - An async function (for dynamic descriptions)\n * - An async function that accepts input (for context-aware descriptions)\n *\n * Use getToolDescription() helper for safe synchronous access.\n */\n\nexport type SetToolJSXFn = (\n jsx: {\n jsx: React.ReactNode | null\n shouldHidePromptInput: boolean\n } | null,\n) => void\n\n/**\n * Function type for asking the user questions\n */\nexport type AskUserFn = (questions: UserQuestion[]) => Promise<UserAnswer[]>\n\nexport interface ToolUseContext {\n messageId: string | undefined\n agentId?: string\n /** The tool_use ID from the API (for tracking concurrent executions) */\n toolUseId?: string\n safeMode?: boolean\n abortController: AbortController\n readFileTimestamps: { [filePath: string]: number }\n options?: ToolUseOptions\n responseState?: ResponseState\n}\n\nexport interface ExtendedToolUseContext extends ToolUseContext {\n setToolJSX: SetToolJSXFn\n askUser?: AskUserFn\n}\n\n// Re-export for backward compatibility\nexport type ValidationResult = CoreValidationResult\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface Tool<\n TInput extends z.ZodObject<any> = z.ZodObject<any>,\n TOutput = any,\n> {\n name: string\n /**\n * Tool description - can be:\n * - A string (synchronous, best for adapters)\n * - An async function returning string (for dynamic descriptions)\n * - An async function accepting input (for context-aware descriptions)\n *\n * Use getToolDescription() for safe synchronous access in adapters.\n */\n description?: string | ((input?: z.infer<TInput>) => Promise<string>)\n /**\n * Cached description for synchronous access.\n * Populated by cacheToolDescriptions() at startup.\n */\n cachedDescription?: string\n inputSchema: TInput\n inputJSONSchema?: Record<string, unknown>\n prompt: (options?: { safeMode?: boolean }) => Promise<string>\n /**\n * User-facing name for display. Can optionally accept input for context.\n */\n userFacingName?: (input?: z.infer<TInput>) => string\n isEnabled: () => Promise<boolean>\n /**\n * Whether this tool only reads data (no side effects).\n * Can optionally accept input to determine based on parameters.\n */\n isReadOnly: (input?: z.infer<TInput>) => boolean\n /**\n * Whether this tool is safe to run concurrently with other tools.\n * Can optionally accept input to determine based on parameters.\n */\n isConcurrencySafe: (input?: z.infer<TInput>) => boolean\n needsPermissions: (input?: z.infer<TInput>) => boolean\n /**\n * Whether this tool requires user interaction (e.g., confirmation dialogs).\n */\n requiresUserInteraction?: (input?: z.infer<TInput>) => boolean\n validateInput?: (\n input: z.infer<TInput>,\n context?: ToolUseContext,\n ) => Promise<ValidationResult>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n renderResultForAssistant: (output: TOutput) => string | any[]\n renderToolUseMessage: (\n input: z.infer<TInput>,\n options: { verbose: boolean },\n ) => string | React.ReactElement | null\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n renderToolUseRejectedMessage?: (...args: any[]) => React.ReactElement | null\n /**\n * Render the tool result for display.\n * @param output - The tool output\n * @param options - Rendering options including verbose mode\n */\n renderToolResultMessage?: (\n output: TOutput,\n options?: { verbose: boolean },\n ) => React.ReactNode\n call: (\n input: z.infer<TInput>,\n context: ToolUseContext,\n ) => AsyncGenerator<\n | {\n type: 'result'\n data: TOutput\n resultForAssistant?: string | any[]\n /**\n * New messages to add to the conversation\n */\n newMessages?: unknown[]\n /**\n * Context modifier for modifying context during execution\n */\n contextModifier?: {\n modifyContext: (ctx: ToolUseContext) => ToolUseContext\n }\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | {\n type: 'progress'\n content: any\n normalizedMessages?: any[]\n tools?: any[]\n },\n void,\n unknown\n >\n}\n\n/**\n * Get tool description synchronously.\n * Returns cached description if available, or falls back to string description,\n * or a default value if description is async and not cached.\n *\n * @param tool - The tool to get description from\n * @returns The tool description string\n */\nexport function getToolDescription(tool: Tool): string {\n // First check cached description\n if (tool.cachedDescription) {\n return tool.cachedDescription\n }\n\n // If description is a string, return it directly\n if (typeof tool.description === 'string') {\n return tool.description\n }\n\n // Fallback for async descriptions that haven't been cached\n return `Tool: ${tool.name}`\n}\n\n/**\n * Get tool description asynchronously.\n * Always returns the actual description, resolving async functions if needed.\n *\n * @param tool - The tool to get description from\n * @param input - Optional input for context-aware descriptions\n * @returns Promise resolving to the tool description string\n */\nexport async function getToolDescriptionAsync(\n tool: Tool,\n input?: unknown,\n): Promise<string> {\n if (typeof tool.description === 'string') {\n return tool.description\n }\n\n if (typeof tool.description === 'function') {\n return await tool.description(input)\n }\n\n return `Tool: ${tool.name}`\n}\n\n/**\n * Cache descriptions for all tools.\n * Should be called at startup to ensure synchronous access works.\n *\n * @param tools - Array of tools to cache descriptions for\n */\nexport async function cacheToolDescriptions(tools: Tool[]): Promise<void> {\n await Promise.all(\n tools.map(async tool => {\n if (typeof tool.description === 'function' && !tool.cachedDescription) {\n try {\n tool.cachedDescription = await tool.description()\n } catch (error) {\n // Fallback on error\n tool.cachedDescription = `Tool: ${tool.name}`\n }\n } else if (\n typeof tool.description === 'string' &&\n !tool.cachedDescription\n ) {\n tool.cachedDescription = tool.description\n }\n }),\n )\n}\n"],
|
|
5
|
+
"mappings": "AA4JO,SAAS,mBAAmB,MAAoB;AAErD,MAAI,KAAK,mBAAmB;AAC1B,WAAO,KAAK;AAAA,EACd;AAGA,MAAI,OAAO,KAAK,gBAAgB,UAAU;AACxC,WAAO,KAAK;AAAA,EACd;AAGA,SAAO,SAAS,KAAK,IAAI;AAC3B;AAUA,eAAsB,wBACpB,MACA,OACiB;AACjB,MAAI,OAAO,KAAK,gBAAgB,UAAU;AACxC,WAAO,KAAK;AAAA,EACd;AAEA,MAAI,OAAO,KAAK,gBAAgB,YAAY;AAC1C,WAAO,MAAM,KAAK,YAAY,KAAK;AAAA,EACrC;AAEA,SAAO,SAAS,KAAK,IAAI;AAC3B;AAQA,eAAsB,sBAAsB,OAA8B;AACxE,QAAM,QAAQ;AAAA,IACZ,MAAM,IAAI,OAAM,SAAQ;AACtB,UAAI,OAAO,KAAK,gBAAgB,cAAc,CAAC,KAAK,mBAAmB;AACrE,YAAI;AACF,eAAK,oBAAoB,MAAM,KAAK,YAAY;AAAA,QAClD,SAAS,OAAO;AAEd,eAAK,oBAAoB,SAAS,KAAK,IAAI;AAAA,QAC7C;AAAA,MACF,WACE,OAAO,KAAK,gBAAgB,YAC5B,CAAC,KAAK,mBACN;AACA,aAAK,oBAAoB,KAAK;AAAA,MAChC;AAAA,IACF,CAAC;AAAA,EACH;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
deleteAgent,
|
|
32
32
|
openInEditor,
|
|
33
33
|
updateAgent
|
|
34
|
-
} from "./utils.js";
|
|
34
|
+
} from "./utils/index.js";
|
|
35
35
|
function getDisplayModelName(modelId) {
|
|
36
36
|
if (!modelId) return "Inherit";
|
|
37
37
|
try {
|
|
@@ -218,16 +218,20 @@ function SelectList({
|
|
|
218
218
|
selectedIndex,
|
|
219
219
|
onChange,
|
|
220
220
|
onCancel,
|
|
221
|
-
numbered = true
|
|
221
|
+
numbered = true,
|
|
222
|
+
isActive = true
|
|
222
223
|
}) {
|
|
223
224
|
const theme = getTheme();
|
|
224
|
-
useInput(
|
|
225
|
-
|
|
226
|
-
onCancel
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
225
|
+
useInput(
|
|
226
|
+
(input, key) => {
|
|
227
|
+
if (key.escape && onCancel) {
|
|
228
|
+
onCancel();
|
|
229
|
+
} else if (key.return) {
|
|
230
|
+
onChange(options[selectedIndex].value);
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
{ isActive }
|
|
234
|
+
);
|
|
231
235
|
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, options.map((option, idx) => /* @__PURE__ */ React.createElement(Box, { key: option.value }, /* @__PURE__ */ React.createElement(Text, { color: idx === selectedIndex ? theme.primary : void 0 }, idx === selectedIndex ? `${UI_ICONS.pointer} ` : " ", numbered ? `${idx + 1}. ` : "", option.label))));
|
|
232
236
|
}
|
|
233
237
|
function MultilineTextInput({
|
|
@@ -977,7 +981,7 @@ function AgentListView({
|
|
|
977
981
|
return null;
|
|
978
982
|
};
|
|
979
983
|
if (!agents.length || currentLocation !== "built-in" && !customAgents.length) {
|
|
980
|
-
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(EmptyStateInput, null), /* @__PURE__ */ React.createElement(Header, { title: "\u{1F916} Agents", subtitle: "" }, onCreateNew && /* @__PURE__ */ React.createElement(Box, { marginY: 1 }, renderCreateOption()), /* @__PURE__ */ React.createElement(Box, { marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React.createElement(Box, { marginBottom: 1 }, /* @__PURE__ */ React.createElement(Text, { bold: true, color: theme.primary }, "\u{1F4AD} What are agents?")), /* @__PURE__ */ React.createElement(Text, null, "Specialized AI assistants that Minto can delegate to for specific tasks
|
|
984
|
+
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(EmptyStateInput, null), /* @__PURE__ */ React.createElement(Header, { title: "\u{1F916} Agents", subtitle: "" }, onCreateNew && /* @__PURE__ */ React.createElement(Box, { marginY: 1 }, renderCreateOption()), /* @__PURE__ */ React.createElement(Box, { marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React.createElement(Box, { marginBottom: 1 }, /* @__PURE__ */ React.createElement(Text, { bold: true, color: theme.primary }, "\u{1F4AD} What are agents?")), /* @__PURE__ */ React.createElement(Text, null, "Specialized AI assistants that Minto can delegate to for specific tasks."), /* @__PURE__ */ React.createElement(Text, null, "Each agent has its own context, prompt, and tools."), /* @__PURE__ */ React.createElement(Box, { marginTop: 1, marginBottom: 1 }, /* @__PURE__ */ React.createElement(Text, { bold: true, color: theme.primary }, "\u{1F4A1} Popular agent ideas:")), /* @__PURE__ */ React.createElement(Box, { paddingLeft: 2, flexDirection: "column" }, /* @__PURE__ */ React.createElement(Text, null, "\u2022 \u{1F50D} Code Reviewer - Reviews PRs for best practices"), /* @__PURE__ */ React.createElement(Text, null, "\u2022 \u{1F512} Security Auditor - Finds vulnerabilities"), /* @__PURE__ */ React.createElement(Text, null, "\u2022 \u26A1 Performance Optimizer - Improves code speed"), /* @__PURE__ */ React.createElement(Text, null, "\u2022 \u{1F9D1}\u200D\u{1F4BC} Tech Lead - Makes architecture decisions"), /* @__PURE__ */ React.createElement(Text, null, "\u2022 \u{1F3A8} UX Expert - Improves user experience"))), currentLocation !== "built-in" && builtInAgents.length > 0 && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, null, UI_ICONS.separator.repeat(40))), /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", marginBottom: 1, paddingLeft: 2 }, /* @__PURE__ */ React.createElement(Text, { bold: true, color: theme.secondary }, "Built-in (always available):"), builtInAgents.map((a) => renderAgent(a, true))))), /* @__PURE__ */ React.createElement(InstructionBar, { instructions: "Press Enter to create new agent \xB7 Esc to go back" }));
|
|
981
985
|
}
|
|
982
986
|
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Header, { title: "\u{1F916} Agents", subtitle: "" }, changes.length > 0 && /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { dimColor: true }, changes[changes.length - 1])), /* @__PURE__ */ React.createElement(Box, { marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React.createElement(Box, { flexDirection: "row", gap: 2 }, locationTabs.map((tab, idx) => {
|
|
983
987
|
const isActive = currentLocation === tab.value;
|
|
@@ -992,7 +996,7 @@ function AgentListView({
|
|
|
992
996
|
isSelected ? "\u25B6 " : isActive ? "\u25C9 " : "\u25CB ",
|
|
993
997
|
tab.label
|
|
994
998
|
), idx < locationTabs.length - 1 && /* @__PURE__ */ React.createElement(Text, { dimColor: true }, " | "));
|
|
995
|
-
})), /* @__PURE__ */ React.createElement(Box, { marginTop: 0 }, /* @__PURE__ */ React.createElement(Text, { dimColor: true }, currentLocation === "all" ? "Showing all agents" : currentLocation === "user" ? "Personal agents (~/.
|
|
999
|
+
})), /* @__PURE__ */ React.createElement(Box, { marginTop: 0 }, /* @__PURE__ */ React.createElement(Text, { dimColor: true }, currentLocation === "all" ? "Showing all agents" : currentLocation === "user" ? "Personal agents (~/.minto/agents)" : "Project agents (.minto/agents)"))), /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", marginTop: 1 }, onCreateNew && /* @__PURE__ */ React.createElement(Box, { marginBottom: 1 }, renderCreateOption()), currentLocation === "all" ? /* @__PURE__ */ React.createElement(React.Fragment, null, customAgents.filter((a) => a.location === "user").length > 0 && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Text, { bold: true, color: theme.secondary }, "Personal:"), customAgents.filter((a) => a.location === "user").map((a) => renderAgent(a))), customAgents.filter((a) => a.location === "project").length > 0 && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
996
1000
|
Box,
|
|
997
1001
|
{
|
|
998
1002
|
marginTop: customAgents.filter((a) => a.location === "user").length > 0 ? 1 : 0
|
|
@@ -1489,12 +1493,12 @@ function ConfirmStep({
|
|
|
1489
1493
|
const handleEditInEditor = async () => {
|
|
1490
1494
|
const filePath = createState.location === "project" ? path.join(
|
|
1491
1495
|
process.cwd(),
|
|
1492
|
-
".
|
|
1496
|
+
".minto",
|
|
1493
1497
|
"agents",
|
|
1494
1498
|
`${createState.agentType}.md`
|
|
1495
1499
|
) : path.join(
|
|
1496
1500
|
os.homedir(),
|
|
1497
|
-
".
|
|
1501
|
+
".minto",
|
|
1498
1502
|
"agents",
|
|
1499
1503
|
`${createState.agentType}.md`
|
|
1500
1504
|
);
|
|
@@ -1535,8 +1539,8 @@ function LocationSelect({
|
|
|
1535
1539
|
const theme = getTheme();
|
|
1536
1540
|
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
1537
1541
|
const options = [
|
|
1538
|
-
{ label: "\u{1F4C1} Project", value: "project", desc: ".
|
|
1539
|
-
{ label: "\u{1F3E0} Personal", value: "user", desc: "~/.
|
|
1542
|
+
{ label: "\u{1F4C1} Project", value: "project", desc: ".minto/agents/" },
|
|
1543
|
+
{ label: "\u{1F3E0} Personal", value: "user", desc: "~/.minto/agents/" }
|
|
1540
1544
|
];
|
|
1541
1545
|
const handleChange = (value) => {
|
|
1542
1546
|
setCreateState({ type: "SET_LOCATION", value });
|
|
@@ -1677,6 +1681,7 @@ function AgentMenu({ agent, setModeState }) {
|
|
|
1677
1681
|
function EditMenu({ agent, setModeState }) {
|
|
1678
1682
|
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
1679
1683
|
const [isOpening, setIsOpening] = useState(false);
|
|
1684
|
+
const [error, setError] = useState(null);
|
|
1680
1685
|
const theme = getTheme();
|
|
1681
1686
|
const options = [
|
|
1682
1687
|
{ label: "Open in editor", value: "open-editor" },
|
|
@@ -1692,8 +1697,11 @@ function EditMenu({ agent, setModeState }) {
|
|
|
1692
1697
|
const filePath = getAgentFilePath(agent);
|
|
1693
1698
|
await openInEditor(filePath);
|
|
1694
1699
|
setModeState({ mode: "agent-menu", selectedAgent: agent });
|
|
1695
|
-
} catch (
|
|
1696
|
-
console.error("Failed to open editor:",
|
|
1700
|
+
} catch (err) {
|
|
1701
|
+
console.error("Failed to open editor:", err);
|
|
1702
|
+
setError(
|
|
1703
|
+
`Failed to open editor: ${err instanceof Error ? err.message : String(err)}`
|
|
1704
|
+
);
|
|
1697
1705
|
} finally {
|
|
1698
1706
|
setIsOpening(false);
|
|
1699
1707
|
}
|
|
@@ -1739,6 +1747,7 @@ function EditMenu({ agent, setModeState }) {
|
|
|
1739
1747
|
title: `Edit agent: ${agent.agentType}`,
|
|
1740
1748
|
subtitle: `Location: ${agent.location}`
|
|
1741
1749
|
},
|
|
1750
|
+
error && /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { color: "red" }, "\u2717 ", error)),
|
|
1742
1751
|
/* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(
|
|
1743
1752
|
SelectList,
|
|
1744
1753
|
{
|
|
@@ -1763,6 +1772,7 @@ function EditToolsStep({
|
|
|
1763
1772
|
);
|
|
1764
1773
|
const [showAdvanced, setShowAdvanced] = useState(false);
|
|
1765
1774
|
const [isUpdating, setIsUpdating] = useState(false);
|
|
1775
|
+
const [error, setError] = useState(null);
|
|
1766
1776
|
const categorizedTools = useMemo(() => {
|
|
1767
1777
|
const categories = {
|
|
1768
1778
|
read: [],
|
|
@@ -1868,13 +1878,17 @@ function EditToolsStep({
|
|
|
1868
1878
|
);
|
|
1869
1879
|
setModeState({ mode: "edit-agent", selectedAgent: fallbackAgent });
|
|
1870
1880
|
}
|
|
1871
|
-
} catch (
|
|
1872
|
-
console.error("Failed to update agent tools:",
|
|
1881
|
+
} catch (err) {
|
|
1882
|
+
console.error("Failed to update agent tools:", err);
|
|
1883
|
+
setError(
|
|
1884
|
+
`Failed to update tools: ${err instanceof Error ? err.message : String(err)}`
|
|
1885
|
+
);
|
|
1873
1886
|
} finally {
|
|
1874
1887
|
setIsUpdating(false);
|
|
1875
1888
|
}
|
|
1876
1889
|
};
|
|
1877
1890
|
const handleSelect = () => {
|
|
1891
|
+
setError(null);
|
|
1878
1892
|
const option = options[selectedIndex];
|
|
1879
1893
|
if (!option) return;
|
|
1880
1894
|
if (option.isSeparator) return;
|
|
@@ -1937,7 +1951,7 @@ function EditToolsStep({
|
|
|
1937
1951
|
if (isUpdating) {
|
|
1938
1952
|
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Header, { title: `Edit agent: ${agent.agentType}` }, /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(LoadingSpinner, { text: "Updating agent tools..." }))), /* @__PURE__ */ React.createElement(InstructionBar, null));
|
|
1939
1953
|
}
|
|
1940
|
-
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Header, { title: `Edit agent: ${agent.agentType}` }, /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", marginTop: 1 }, options.map((option, idx) => {
|
|
1954
|
+
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Header, { title: `Edit agent: ${agent.agentType}` }, error && /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { color: "red" }, "\u2717 ", error)), /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", marginTop: 1 }, options.map((option, idx) => {
|
|
1941
1955
|
const isSelected = idx === selectedIndex;
|
|
1942
1956
|
const isContinue = "isContinue" in option && option.isContinue;
|
|
1943
1957
|
const isAdvancedToggle = option.isAdvancedToggle;
|
|
@@ -2077,7 +2091,9 @@ function EditColorStep({
|
|
|
2077
2091
|
defaultIndex >= 0 ? defaultIndex : 0
|
|
2078
2092
|
);
|
|
2079
2093
|
const [isUpdating, setIsUpdating] = useState(false);
|
|
2094
|
+
const [error, setError] = useState(null);
|
|
2080
2095
|
const handleSave = async (color) => {
|
|
2096
|
+
setError(null);
|
|
2081
2097
|
setIsUpdating(true);
|
|
2082
2098
|
try {
|
|
2083
2099
|
const colorValue = color === null ? void 0 : color;
|
|
@@ -2112,8 +2128,11 @@ function EditColorStep({
|
|
|
2112
2128
|
);
|
|
2113
2129
|
setModeState({ mode: "edit-agent", selectedAgent: fallbackAgent });
|
|
2114
2130
|
}
|
|
2115
|
-
} catch (
|
|
2116
|
-
console.error("Failed to update agent color:",
|
|
2131
|
+
} catch (err) {
|
|
2132
|
+
console.error("Failed to update agent color:", err);
|
|
2133
|
+
setError(
|
|
2134
|
+
`Failed to update color: ${err instanceof Error ? err.message : String(err)}`
|
|
2135
|
+
);
|
|
2117
2136
|
} finally {
|
|
2118
2137
|
setIsUpdating(false);
|
|
2119
2138
|
}
|
|
@@ -2122,6 +2141,7 @@ function EditColorStep({
|
|
|
2122
2141
|
if (key.escape) {
|
|
2123
2142
|
setModeState({ mode: "edit-agent", selectedAgent: agent });
|
|
2124
2143
|
} else if (key.return && !isUpdating) {
|
|
2144
|
+
setError(null);
|
|
2125
2145
|
handleSave(colors[selectedIndex].value);
|
|
2126
2146
|
} else if (key.upArrow) {
|
|
2127
2147
|
setSelectedIndex((prev) => prev > 0 ? prev - 1 : colors.length - 1);
|
|
@@ -2140,6 +2160,7 @@ function EditColorStep({
|
|
|
2140
2160
|
title: `Edit agent: ${agent.agentType}`,
|
|
2141
2161
|
subtitle: "Choose background color"
|
|
2142
2162
|
},
|
|
2163
|
+
error && /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { color: "red" }, "\u2717 ", error)),
|
|
2143
2164
|
/* @__PURE__ */ React.createElement(Box, { flexDirection: "column", marginTop: 1 }, colors.map((color, index) => {
|
|
2144
2165
|
const isSelected = index === selectedIndex;
|
|
2145
2166
|
const isCurrent = color.value === currentColor;
|
|
@@ -2151,7 +2172,7 @@ function ViewAgent({ agent, tools, setModeState }) {
|
|
|
2151
2172
|
const theme = getTheme();
|
|
2152
2173
|
const agentTools = Array.isArray(agent.tools) ? agent.tools : [];
|
|
2153
2174
|
const hasAllTools = agent.tools === "*" || agentTools.includes("*");
|
|
2154
|
-
const locationPath = agent.location === "user" ? `~/.
|
|
2175
|
+
const locationPath = agent.location === "user" ? `~/.minto/agents/${agent.agentType}.md` : agent.location === "project" ? `.minto/agents/${agent.agentType}.md` : "(built-in)";
|
|
2155
2176
|
const displayModel = getDisplayModelName(agent.model || null);
|
|
2156
2177
|
const allowedTools = useMemo(() => {
|
|
2157
2178
|
if (hasAllTools) return tools;
|
|
@@ -2296,16 +2317,21 @@ function DeleteConfirm({
|
|
|
2296
2317
|
}) {
|
|
2297
2318
|
const [isDeleting, setIsDeleting] = useState(false);
|
|
2298
2319
|
const [selected, setSelected] = useState(false);
|
|
2320
|
+
const [error, setError] = useState(null);
|
|
2299
2321
|
const handleConfirm = async () => {
|
|
2300
2322
|
if (selected) {
|
|
2301
2323
|
setIsDeleting(true);
|
|
2324
|
+
setError(null);
|
|
2302
2325
|
try {
|
|
2303
2326
|
await deleteAgent(agent);
|
|
2304
2327
|
clearAgentCache();
|
|
2305
2328
|
onAgentDeleted(`Deleted agent: ${agent.agentType}`);
|
|
2306
|
-
} catch (
|
|
2307
|
-
console.error("Failed to delete agent:",
|
|
2329
|
+
} catch (err) {
|
|
2330
|
+
console.error("Failed to delete agent:", err);
|
|
2308
2331
|
setIsDeleting(false);
|
|
2332
|
+
setError(
|
|
2333
|
+
`Failed to delete agent: ${err instanceof Error ? err.message : String(err)}`
|
|
2334
|
+
);
|
|
2309
2335
|
}
|
|
2310
2336
|
} else {
|
|
2311
2337
|
setModeState({ mode: "agent-menu", selectedAgent: agent });
|
|
@@ -2321,7 +2347,7 @@ function DeleteConfirm({
|
|
|
2321
2347
|
if (isDeleting) {
|
|
2322
2348
|
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Header, { title: "Delete agent", subtitle: "Deleting..." }, /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(LoadingSpinner, { text: "Deleting agent..." }))), /* @__PURE__ */ React.createElement(InstructionBar, null));
|
|
2323
2349
|
}
|
|
2324
|
-
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Header, { title: "Delete agent", subtitle: `Delete "${agent.agentType}"?` }, /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, null, "This action cannot be undone. The agent file will be permanently deleted."), /* @__PURE__ */ React.createElement(Box, { marginTop: 2, gap: 3 }, /* @__PURE__ */ React.createElement(Text, { color: !selected ? "cyan" : void 0 }, !selected ? `${UI_ICONS.pointer} ` : " ", "No"), /* @__PURE__ */ React.createElement(Text, { color: selected ? "red" : void 0 }, selected ? `${UI_ICONS.pointer} ` : " ", "Yes, delete")))), /* @__PURE__ */ React.createElement(InstructionBar, null));
|
|
2350
|
+
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Header, { title: "Delete agent", subtitle: `Delete "${agent.agentType}"?` }, error && /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { color: "red" }, "\u2717 ", error)), /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, null, "This action cannot be undone. The agent file will be permanently deleted."), /* @__PURE__ */ React.createElement(Box, { marginTop: 2, gap: 3 }, /* @__PURE__ */ React.createElement(Text, { color: !selected ? "cyan" : void 0 }, !selected ? `${UI_ICONS.pointer} ` : " ", "No"), /* @__PURE__ */ React.createElement(Text, { color: selected ? "red" : void 0 }, selected ? `${UI_ICONS.pointer} ` : " ", "Yes, delete")))), /* @__PURE__ */ React.createElement(InstructionBar, null));
|
|
2325
2351
|
}
|
|
2326
2352
|
var AgentsCommand_default = {
|
|
2327
2353
|
name: "agents",
|