@within-7/minto 0.3.9 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Tool.js.map +2 -2
- package/dist/commands/agents/AgentsCommand.js +461 -657
- package/dist/commands/agents/AgentsCommand.js.map +2 -2
- package/dist/commands/agents/types.js +1 -0
- package/dist/commands/agents/types.js.map +2 -2
- package/dist/commands/agents/utils/fileOperations.js +96 -36
- package/dist/commands/agents/utils/fileOperations.js.map +3 -3
- package/dist/commands/agents/utils/index.js +3 -1
- package/dist/commands/agents/utils/index.js.map +2 -2
- package/dist/commands/context.js +54 -23
- package/dist/commands/context.js.map +2 -2
- package/dist/commands/ctx_viz.js +1 -1
- package/dist/commands/effort.js +87 -0
- package/dist/commands/effort.js.map +7 -0
- package/dist/commands/export.js +684 -94
- package/dist/commands/export.js.map +2 -2
- package/dist/commands/ide.js +18 -0
- package/dist/commands/ide.js.map +7 -0
- package/dist/commands/language.js +19 -46
- package/dist/commands/language.js.map +2 -2
- package/dist/commands/mcp-interactive.js +425 -217
- package/dist/commands/mcp-interactive.js.map +2 -2
- package/dist/commands/memory.js +168 -0
- package/dist/commands/memory.js.map +7 -0
- package/dist/commands/model.js +457 -65
- package/dist/commands/model.js.map +2 -2
- package/dist/commands/outputStyle.js +64 -0
- package/dist/commands/outputStyle.js.map +7 -0
- package/dist/commands/permissions.js +75 -49
- package/dist/commands/permissions.js.map +2 -2
- package/dist/commands/plugin/utils.js +33 -1
- package/dist/commands/plugin/utils.js.map +2 -2
- package/dist/commands/plugin.js +891 -185
- package/dist/commands/plugin.js.map +3 -3
- package/dist/commands/refreshCommands.js +2 -0
- package/dist/commands/refreshCommands.js.map +2 -2
- package/dist/commands/resume.js +1 -1
- package/dist/commands/resume.js.map +1 -1
- package/dist/commands/review.js +51 -0
- package/dist/commands/review.js.map +7 -0
- package/dist/commands/sandbox.js +168 -70
- package/dist/commands/sandbox.js.map +2 -2
- package/dist/commands/setup.js +593 -107
- package/dist/commands/setup.js.map +2 -2
- package/dist/commands/stats.js +188 -131
- package/dist/commands/stats.js.map +2 -2
- package/dist/commands/status.js +75 -13
- package/dist/commands/status.js.map +2 -2
- package/dist/commands/terminalSetup.js +6 -0
- package/dist/commands/terminalSetup.js.map +2 -2
- package/dist/commands/undo.js +146 -174
- package/dist/commands/undo.js.map +2 -2
- package/dist/commands/vim.js +22 -0
- package/dist/commands/vim.js.map +7 -0
- package/dist/commands.js +12 -0
- package/dist/commands.js.map +2 -2
- package/dist/components/Help.js +165 -32
- package/dist/components/Help.js.map +2 -2
- package/dist/components/HighlightedCode.js +1 -0
- package/dist/components/HighlightedCode.js.map +2 -2
- package/dist/components/InfoPanel/InfoPanel.js +123 -0
- package/dist/components/InfoPanel/InfoPanel.js.map +7 -0
- package/dist/components/InfoPanel/index.js +5 -0
- package/dist/components/InfoPanel/index.js.map +7 -0
- package/dist/components/InfoPanel/types.js +1 -0
- package/dist/components/InfoPanel/types.js.map +7 -0
- package/dist/components/ModelSelector/BrandTextInput.js +43 -0
- package/dist/components/ModelSelector/BrandTextInput.js.map +7 -0
- package/dist/components/ModelSelector/ModelSelector.js +590 -565
- package/dist/components/ModelSelector/ModelSelector.js.map +2 -2
- package/dist/components/ModelSelector/WizardContainer.js +45 -0
- package/dist/components/ModelSelector/WizardContainer.js.map +7 -0
- package/dist/components/ModelSelector/index.js +1 -3
- package/dist/components/ModelSelector/index.js.map +2 -2
- package/dist/components/PromptInput.js +26 -11
- package/dist/components/PromptInput.js.map +2 -2
- package/dist/components/PulseLabel.js +44 -0
- package/dist/components/PulseLabel.js.map +7 -0
- package/dist/components/RequestStatusIndicator.js +1 -1
- package/dist/components/RequestStatusIndicator.js.map +1 -1
- package/dist/components/SimpleSelector/SimpleSelector.js +154 -0
- package/dist/components/SimpleSelector/SimpleSelector.js.map +7 -0
- package/dist/components/SimpleSelector/index.js +5 -0
- package/dist/components/SimpleSelector/index.js.map +7 -0
- package/dist/components/SimpleSelector/types.js +1 -0
- package/dist/components/SimpleSelector/types.js.map +7 -0
- package/dist/components/Spinner.js +12 -42
- package/dist/components/Spinner.js.map +3 -3
- package/dist/components/StartupStatus.js +57 -0
- package/dist/components/StartupStatus.js.map +7 -0
- package/dist/components/StatusOverlayContent.js +21 -0
- package/dist/components/StatusOverlayContent.js.map +7 -0
- package/dist/components/SubagentBlock.js +43 -6
- package/dist/components/SubagentBlock.js.map +2 -2
- package/dist/components/TabbedListView/ScrollableList.js +31 -5
- package/dist/components/TabbedListView/ScrollableList.js.map +2 -2
- package/dist/components/TabbedListView/TabBar.js +13 -8
- package/dist/components/TabbedListView/TabBar.js.map +2 -2
- package/dist/components/TabbedListView/TabbedListView.js +123 -48
- package/dist/components/TabbedListView/TabbedListView.js.map +2 -2
- package/dist/components/TodoPanel.js +1 -1
- package/dist/components/TodoPanel.js.map +1 -1
- package/dist/components/ToolUseLoader.js +5 -0
- package/dist/components/ToolUseLoader.js.map +2 -2
- package/dist/components/TrustDialog.js +0 -2
- package/dist/components/TrustDialog.js.map +2 -2
- package/dist/components/messages/TaskInModuleView.js +1 -1
- package/dist/components/messages/TaskInModuleView.js.map +2 -2
- package/dist/components/messages/TaskToolMessage.js +1 -1
- package/dist/components/messages/TaskToolMessage.js.map +2 -2
- package/dist/components/messages/UserPromptMessage.js +6 -1
- package/dist/components/messages/UserPromptMessage.js.map +2 -2
- package/dist/constants/modelCapabilities.js +103 -18
- package/dist/constants/modelCapabilities.js.map +2 -2
- package/dist/constants/product.js +2 -0
- package/dist/constants/product.js.map +2 -2
- package/dist/constants/prompts/agentPrompt.js +30 -0
- package/dist/constants/prompts/agentPrompt.js.map +7 -0
- package/dist/constants/prompts/codeConventions.js +27 -0
- package/dist/constants/prompts/codeConventions.js.map +7 -0
- package/dist/constants/prompts/doingTasks.js +15 -0
- package/dist/constants/prompts/doingTasks.js.map +7 -0
- package/dist/constants/prompts/envInfo.js +17 -0
- package/dist/constants/prompts/envInfo.js.map +7 -0
- package/dist/constants/prompts/executingWithCare.js +17 -0
- package/dist/constants/prompts/executingWithCare.js.map +7 -0
- package/dist/constants/prompts/identity.js +10 -0
- package/dist/constants/prompts/identity.js.map +7 -0
- package/dist/constants/prompts/index.js +78 -0
- package/dist/constants/prompts/index.js.map +7 -0
- package/dist/constants/prompts/taskManagement.js +60 -0
- package/dist/constants/prompts/taskManagement.js.map +7 -0
- package/dist/constants/prompts/toneAndStyle.js +62 -0
- package/dist/constants/prompts/toneAndStyle.js.map +7 -0
- package/dist/constants/prompts/toolUsagePolicy.js +38 -0
- package/dist/constants/prompts/toolUsagePolicy.js.map +7 -0
- package/dist/constants/prompts.js +5 -176
- package/dist/constants/prompts.js.map +2 -2
- package/dist/constants/providerRegistry.js +235 -0
- package/dist/constants/providerRegistry.js.map +7 -0
- package/dist/constants/providers.js +35 -0
- package/dist/constants/providers.js.map +7 -0
- package/dist/context/PermissionContext.js +0 -1
- package/dist/context/PermissionContext.js.map +2 -2
- package/dist/context.js +87 -31
- package/dist/context.js.map +2 -2
- package/dist/core/backupHook.js +29 -0
- package/dist/core/backupHook.js.map +7 -0
- package/dist/core/config/defaults.js +11 -2
- package/dist/core/config/defaults.js.map +2 -2
- package/dist/core/config/schema.js +21 -3
- package/dist/core/config/schema.js.map +2 -2
- package/dist/core/costTracker.js +18 -16
- package/dist/core/costTracker.js.map +2 -2
- package/dist/core/index.js +0 -1
- package/dist/core/index.js.map +2 -2
- package/dist/core/tokenStatsManager.js +22 -4
- package/dist/core/tokenStatsManager.js.map +2 -2
- package/dist/cost-tracker.js +0 -16
- package/dist/cost-tracker.js.map +2 -2
- package/dist/entrypoints/bootstrap.js +3 -1
- package/dist/entrypoints/bootstrap.js.map +2 -2
- package/dist/entrypoints/cli.js +81 -68
- package/dist/entrypoints/cli.js.map +2 -2
- package/dist/hooks/useAgentTokenStats.js +1 -1
- package/dist/hooks/useAgentTokenStats.js.map +2 -2
- package/dist/hooks/useAgentTranscripts.js +2 -1
- package/dist/hooks/useAgentTranscripts.js.map +2 -2
- package/dist/hooks/useBackgroundShells.js +29 -0
- package/dist/hooks/useBackgroundShells.js.map +7 -0
- package/dist/hooks/useCanUseTool.js +1 -1
- package/dist/hooks/useCanUseTool.js.map +2 -2
- package/dist/hooks/useDeferredLoading.js +64 -0
- package/dist/hooks/useDeferredLoading.js.map +7 -0
- package/dist/hooks/useHookStatus.js +1 -1
- package/dist/hooks/useHookStatus.js.map +2 -2
- package/dist/hooks/useSessionTracking.js +55 -0
- package/dist/hooks/useSessionTracking.js.map +7 -0
- package/dist/hooks/useTerminalSize.js +21 -0
- package/dist/hooks/useTerminalSize.js.map +2 -2
- package/dist/hooks/useTextInput.js +1 -0
- package/dist/hooks/useTextInput.js.map +2 -2
- package/dist/hooks/useUnifiedCompletion.js +3 -2
- package/dist/hooks/useUnifiedCompletion.js.map +2 -2
- package/dist/i18n/locales/en.js +299 -1
- package/dist/i18n/locales/en.js.map +2 -2
- package/dist/i18n/locales/zh-CN.js +300 -2
- package/dist/i18n/locales/zh-CN.js.map +2 -2
- package/dist/i18n/types.js.map +1 -1
- package/dist/messages.js +41 -17
- package/dist/messages.js.map +2 -2
- package/dist/permissions.js +94 -1
- package/dist/permissions.js.map +2 -2
- package/dist/query.js +27 -19
- package/dist/query.js.map +2 -2
- package/dist/screens/REPL.js +83 -74
- package/dist/screens/REPL.js.map +2 -2
- package/dist/services/adapters/responsesAPI.js +6 -0
- package/dist/services/adapters/responsesAPI.js.map +2 -2
- package/dist/services/agentTeams/index.js +35 -0
- package/dist/services/agentTeams/index.js.map +7 -0
- package/dist/services/agentTeams/mailbox.js +114 -0
- package/dist/services/agentTeams/mailbox.js.map +7 -0
- package/dist/services/agentTeams/teamManager.js +149 -0
- package/dist/services/agentTeams/teamManager.js.map +7 -0
- package/dist/services/agentTeams/teamTaskStore.js +114 -0
- package/dist/services/agentTeams/teamTaskStore.js.map +7 -0
- package/dist/services/agentTeams/teammateSpawner.js +80 -0
- package/dist/services/agentTeams/teammateSpawner.js.map +7 -0
- package/dist/services/checkpointManager.js +16 -3
- package/dist/services/checkpointManager.js.map +2 -2
- package/dist/services/claude.js +19 -1728
- package/dist/services/claude.js.map +3 -3
- package/dist/services/customCommands.js +30 -8
- package/dist/services/customCommands.js.map +2 -2
- package/dist/services/gpt5ConnectionTest.js +4 -2
- package/dist/services/gpt5ConnectionTest.js.map +2 -2
- package/dist/services/hookExecutor.js +411 -127
- package/dist/services/hookExecutor.js.map +2 -2
- package/dist/services/llm/anthropicProvider.js +807 -0
- package/dist/services/llm/anthropicProvider.js.map +7 -0
- package/dist/services/llm/dispatch.js +218 -0
- package/dist/services/llm/dispatch.js.map +7 -0
- package/dist/services/llm/index.js +44 -0
- package/dist/services/llm/index.js.map +7 -0
- package/dist/services/llm/mintoContext.js +69 -0
- package/dist/services/llm/mintoContext.js.map +7 -0
- package/dist/services/llm/openaiProvider.js +622 -0
- package/dist/services/llm/openaiProvider.js.map +7 -0
- package/dist/services/llm/types.js +157 -0
- package/dist/services/llm/types.js.map +7 -0
- package/dist/services/mcpClient.js +183 -33
- package/dist/services/mcpClient.js.map +2 -2
- package/dist/services/notifier.js +14 -0
- package/dist/services/notifier.js.map +2 -2
- package/dist/services/oauth.js +4 -2
- package/dist/services/oauth.js.map +2 -2
- package/dist/services/openai.js +66 -56
- package/dist/services/openai.js.map +3 -3
- package/dist/services/outputStyles.js +102 -21
- package/dist/services/outputStyles.js.map +2 -2
- package/dist/services/plugins/lspServers.js +1 -1
- package/dist/services/plugins/lspServers.js.map +2 -2
- package/dist/services/plugins/pluginRuntime.js +2 -1
- package/dist/services/plugins/pluginRuntime.js.map +2 -2
- package/dist/services/plugins/pluginValidation.js +10 -3
- package/dist/services/plugins/pluginValidation.js.map +2 -2
- package/dist/services/plugins/skillMarketplace.js +20 -9
- package/dist/services/plugins/skillMarketplace.js.map +2 -2
- package/dist/services/sentry.js +1 -1
- package/dist/services/sentry.js.map +2 -2
- package/dist/services/sessionMemory.js +16 -3
- package/dist/services/sessionMemory.js.map +2 -2
- package/dist/services/systemReminder.js +367 -9
- package/dist/services/systemReminder.js.map +2 -2
- package/dist/services/taskStore.js +19 -0
- package/dist/services/taskStore.js.map +2 -2
- package/dist/tools/ArchitectTool/ArchitectTool.js.map +1 -1
- package/dist/tools/AskUserQuestionTool/AskUserQuestionTool.js.map +1 -1
- package/dist/tools/BashOutputTool/BashOutputTool.js.map +1 -1
- package/dist/tools/BashTool/BashTool.js +28 -0
- package/dist/tools/BashTool/BashTool.js.map +2 -2
- package/dist/tools/FileEditTool/FileEditTool.js +8 -1
- package/dist/tools/FileEditTool/FileEditTool.js.map +2 -2
- package/dist/tools/FileReadTool/FileReadTool.js +14 -0
- package/dist/tools/FileReadTool/FileReadTool.js.map +2 -2
- package/dist/tools/FileWriteTool/FileWriteTool.js +10 -1
- package/dist/tools/FileWriteTool/FileWriteTool.js.map +2 -2
- package/dist/tools/GlobTool/GlobTool.js.map +1 -1
- package/dist/tools/GrepTool/GrepTool.js.map +1 -1
- package/dist/tools/KillShellTool/KillShellTool.js.map +1 -1
- package/dist/tools/ListMcpResourcesTool/ListMcpResourcesTool.js.map +2 -2
- package/dist/tools/LspTool/LspTool.js +11 -2
- package/dist/tools/LspTool/LspTool.js.map +2 -2
- package/dist/tools/MCPTool/MCPTool.js.map +1 -1
- package/dist/tools/MemoryReadTool/MemoryReadTool.js +2 -1
- package/dist/tools/MemoryReadTool/MemoryReadTool.js.map +2 -2
- package/dist/tools/MemoryWriteTool/MemoryWriteTool.js +2 -1
- package/dist/tools/MemoryWriteTool/MemoryWriteTool.js.map +2 -2
- package/dist/tools/MultiEditTool/MultiEditTool.js +7 -0
- package/dist/tools/MultiEditTool/MultiEditTool.js.map +2 -2
- package/dist/tools/NotebookEditTool/NotebookEditTool.js +2 -0
- package/dist/tools/NotebookEditTool/NotebookEditTool.js.map +2 -2
- package/dist/tools/NotebookReadTool/NotebookReadTool.js.map +1 -1
- package/dist/tools/PlanModeTool/EnterPlanModeTool.js +8 -2
- package/dist/tools/PlanModeTool/EnterPlanModeTool.js.map +2 -2
- package/dist/tools/PlanModeTool/ExitPlanModeTool.js +2 -0
- package/dist/tools/PlanModeTool/ExitPlanModeTool.js.map +2 -2
- package/dist/tools/ReadMcpResourceTool/ReadMcpResourceTool.js.map +1 -1
- package/dist/tools/SlashCommandTool/SlashCommandTool.js +174 -18
- package/dist/tools/SlashCommandTool/SlashCommandTool.js.map +3 -3
- package/dist/tools/TaskCreateTool/TaskCreateTool.js.map +1 -1
- package/dist/tools/TaskGetTool/TaskGetTool.js.map +1 -1
- package/dist/tools/TaskListTool/TaskListTool.js.map +1 -1
- package/dist/tools/TaskOutputTool/TaskOutputTool.js.map +1 -1
- package/dist/tools/TaskStopTool/TaskStopTool.js.map +1 -1
- package/dist/tools/TaskTool/TaskTool.js +84 -11
- package/dist/tools/TaskTool/TaskTool.js.map +2 -2
- package/dist/tools/TaskTool/prompt.js +12 -6
- package/dist/tools/TaskTool/prompt.js.map +2 -2
- package/dist/tools/TaskUpdateTool/TaskUpdateTool.js.map +1 -1
- package/dist/tools/ThinkTool/ThinkTool.js.map +1 -1
- package/dist/tools/TodoWriteTool/TodoWriteTool.js.map +1 -1
- package/dist/tools/URLFetcherTool/URLFetcherTool.js.map +1 -1
- package/dist/tools/WebSearchTool/WebSearchTool.js.map +1 -1
- package/dist/tools/WebSearchTool/searchProviders.js +2 -1
- package/dist/tools/WebSearchTool/searchProviders.js.map +2 -2
- package/dist/tools/lsTool/lsTool.js.map +2 -2
- package/dist/tools/lsTool/prompt.js.map +1 -1
- package/dist/tools.js +14 -3
- package/dist/tools.js.map +2 -2
- package/dist/types/PermissionMode.js +21 -1
- package/dist/types/PermissionMode.js.map +2 -2
- package/dist/types/agentTeams.js +1 -0
- package/dist/types/agentTeams.js.map +7 -0
- package/dist/types/hooks.js +8 -2
- package/dist/types/hooks.js.map +2 -2
- package/dist/types/plugin.js +3 -5
- package/dist/types/plugin.js.map +2 -2
- package/dist/utils/agentHookExecutor.js +1 -4
- package/dist/utils/agentHookExecutor.js.map +2 -2
- package/dist/utils/agentLoader.js +91 -15
- package/dist/utils/agentLoader.js.map +2 -2
- package/dist/utils/agentMemory.js.map +2 -2
- package/dist/utils/animationManager.js +1 -1
- package/dist/utils/animationManager.js.map +2 -2
- package/dist/utils/ask.js +1 -1
- package/dist/utils/async.js +5 -1
- package/dist/utils/async.js.map +2 -2
- package/dist/utils/autoCompactCore.js +60 -0
- package/dist/utils/autoCompactCore.js.map +2 -2
- package/dist/utils/claudeCodeSync.js +439 -0
- package/dist/utils/claudeCodeSync.js.map +7 -0
- package/dist/utils/config.js +27 -151
- package/dist/utils/config.js.map +2 -2
- package/dist/utils/configSchema.js +227 -0
- package/dist/utils/configSchema.js.map +7 -0
- package/dist/utils/debugLogger.js.map +2 -2
- package/dist/utils/env.js +4 -3
- package/dist/utils/env.js.map +2 -2
- package/dist/utils/envConfig.js +34 -0
- package/dist/utils/envConfig.js.map +3 -3
- package/dist/utils/execFileNoThrow.js +2 -1
- package/dist/utils/execFileNoThrow.js.map +2 -2
- package/dist/utils/gpt5.js +146 -0
- package/dist/utils/gpt5.js.map +7 -0
- package/dist/utils/hookManager.js +374 -140
- package/dist/utils/hookManager.js.map +2 -2
- package/dist/utils/markdown.js +47 -0
- package/dist/utils/markdown.js.map +2 -2
- package/dist/utils/marketplaceManager.js +80 -43
- package/dist/utils/marketplaceManager.js.map +2 -2
- package/dist/utils/memoizeWithTTL.js +25 -0
- package/dist/utils/memoizeWithTTL.js.map +7 -0
- package/dist/utils/messages.js +2 -2
- package/dist/utils/messages.js.map +2 -2
- package/dist/utils/model.js +34 -9
- package/dist/utils/model.js.map +2 -2
- package/dist/utils/pluginInstaller.js +68 -29
- package/dist/utils/pluginInstaller.js.map +2 -2
- package/dist/utils/pluginLoader.js +249 -57
- package/dist/utils/pluginLoader.js.map +2 -2
- package/dist/utils/repoFetcher.js +110 -0
- package/dist/utils/repoFetcher.js.map +7 -0
- package/dist/utils/safeFetch.js +45 -0
- package/dist/utils/safeFetch.js.map +7 -0
- package/dist/utils/skillLoader.js +77 -12
- package/dist/utils/skillLoader.js.map +2 -2
- package/dist/utils/streamingState.js +52 -0
- package/dist/utils/streamingState.js.map +7 -0
- package/dist/utils/stringSubstitution.js +4 -5
- package/dist/utils/stringSubstitution.js.map +2 -2
- package/dist/utils/style.js +6 -3
- package/dist/utils/style.js.map +2 -2
- package/dist/utils/teamConfig.js +162 -16
- package/dist/utils/teamConfig.js.map +2 -2
- package/dist/utils/terminal.js +1 -1
- package/dist/utils/terminal.js.map +2 -2
- package/dist/utils/toolRiskClassification.js +0 -6
- package/dist/utils/toolRiskClassification.js.map +2 -2
- package/dist/version.js +2 -2
- package/dist/version.js.map +1 -1
- package/package.json +7 -6
package/dist/commands/export.js
CHANGED
|
@@ -1,99 +1,17 @@
|
|
|
1
|
-
import React, { useState } from "react";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import React, { useState, useCallback, useMemo } from "react";
|
|
2
|
+
import { writeFile, readFile } from "fs/promises";
|
|
3
|
+
import { existsSync, readdirSync } from "fs";
|
|
4
4
|
import { join } from "path";
|
|
5
|
+
import { homedir } from "os";
|
|
5
6
|
import { getMessagesGetter } from "../messages.js";
|
|
6
7
|
import { getCwd } from "../utils/state.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
type: "config",
|
|
17
|
-
label: "Configuration",
|
|
18
|
-
description: "Export current configuration settings"
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
type: "summary",
|
|
22
|
-
label: "Summary",
|
|
23
|
-
description: "Export a markdown summary of the session"
|
|
24
|
-
}
|
|
25
|
-
];
|
|
26
|
-
const ExportMenu = ({ onDone }) => {
|
|
27
|
-
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
28
|
-
const [exporting, setExporting] = useState(false);
|
|
29
|
-
const [result, setResult] = useState(null);
|
|
30
|
-
useInput(async (input, key) => {
|
|
31
|
-
if (exporting) return;
|
|
32
|
-
if (key.upArrow) {
|
|
33
|
-
setSelectedIndex(Math.max(0, selectedIndex - 1));
|
|
34
|
-
} else if (key.downArrow) {
|
|
35
|
-
setSelectedIndex(Math.min(EXPORT_OPTIONS.length - 1, selectedIndex + 1));
|
|
36
|
-
} else if (key.return) {
|
|
37
|
-
await handleExport(EXPORT_OPTIONS[selectedIndex].type);
|
|
38
|
-
} else if (input === "q" || key.escape) {
|
|
39
|
-
onDone();
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
const handleExport = async (type) => {
|
|
43
|
-
setExporting(true);
|
|
44
|
-
try {
|
|
45
|
-
const cwd = getCwd();
|
|
46
|
-
const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
47
|
-
let filename;
|
|
48
|
-
let content;
|
|
49
|
-
switch (type) {
|
|
50
|
-
case "conversation": {
|
|
51
|
-
const messages = getMessagesGetter()();
|
|
52
|
-
filename = `minto-conversation-${timestamp}.json`;
|
|
53
|
-
content = JSON.stringify(messages, null, 2);
|
|
54
|
-
break;
|
|
55
|
-
}
|
|
56
|
-
case "config": {
|
|
57
|
-
const [globalConfig, projectConfig] = await Promise.all([
|
|
58
|
-
Promise.resolve(loadGlobalConfig()),
|
|
59
|
-
Promise.resolve(loadProjectConfig(cwd))
|
|
60
|
-
]);
|
|
61
|
-
filename = `minto-config-${timestamp}.json`;
|
|
62
|
-
content = JSON.stringify(
|
|
63
|
-
{
|
|
64
|
-
global: globalConfig,
|
|
65
|
-
project: projectConfig
|
|
66
|
-
},
|
|
67
|
-
null,
|
|
68
|
-
2
|
|
69
|
-
);
|
|
70
|
-
break;
|
|
71
|
-
}
|
|
72
|
-
case "summary": {
|
|
73
|
-
const messages = getMessagesGetter()();
|
|
74
|
-
filename = `minto-summary-${timestamp}.md`;
|
|
75
|
-
content = generateSummary(messages);
|
|
76
|
-
break;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
const filepath = join(cwd, filename);
|
|
80
|
-
await writeFile(filepath, content, "utf-8");
|
|
81
|
-
setResult({
|
|
82
|
-
success: true,
|
|
83
|
-
message: `Exported to ${filename}`
|
|
84
|
-
});
|
|
85
|
-
setTimeout(() => onDone(`Exported to ${filepath}`), 2e3);
|
|
86
|
-
} catch (error) {
|
|
87
|
-
setResult({
|
|
88
|
-
success: false,
|
|
89
|
-
message: `Export failed: ${error instanceof Error ? error.message : String(error)}`
|
|
90
|
-
});
|
|
91
|
-
} finally {
|
|
92
|
-
setExporting(false);
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", marginY: 1 }, /* @__PURE__ */ React.createElement(Box, { marginBottom: 1 }, /* @__PURE__ */ React.createElement(Text, { bold: true, color: "cyan" }, "Export Data")), !result ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", marginBottom: 1 }, EXPORT_OPTIONS.map((option, index) => /* @__PURE__ */ React.createElement(Box, { key: option.type, paddingLeft: 1 }, /* @__PURE__ */ React.createElement(Text, { color: index === selectedIndex ? "cyan" : void 0 }, index === selectedIndex ? "\u25B6 " : " ", /* @__PURE__ */ React.createElement(Text, { bold: true }, option.label), /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, " ", "- ", option.description))))), /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, "\u2191/\u2193: Navigate | Enter: Export | q/Esc: Cancel"))) : /* @__PURE__ */ React.createElement(Box, null, result.success ? /* @__PURE__ */ React.createElement(Text, { color: "green" }, "\u2713 ", result.message) : /* @__PURE__ */ React.createElement(Text, { color: "red" }, "\u2717 ", result.message)), exporting && /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "yellow" }, "Exporting...")));
|
|
96
|
-
};
|
|
8
|
+
import { getGlobalConfig, getCurrentProjectConfig } from "../utils/config.js";
|
|
9
|
+
import { t } from "../i18n/index.js";
|
|
10
|
+
import { listMarketplaces } from "../utils/marketplaceManager.js";
|
|
11
|
+
import { loadAllPlugins } from "../utils/pluginLoader.js";
|
|
12
|
+
import { loadAllSkills } from "../utils/skillLoader.js";
|
|
13
|
+
import { loadCustomCommands } from "../services/customCommands.js";
|
|
14
|
+
import { TabbedListView } from "../components/TabbedListView/TabbedListView.js";
|
|
97
15
|
function generateSummary(messages) {
|
|
98
16
|
const lines = [
|
|
99
17
|
"# Minto Session Summary",
|
|
@@ -137,11 +55,683 @@ function generateSummary(messages) {
|
|
|
137
55
|
}
|
|
138
56
|
return lines.join("\n");
|
|
139
57
|
}
|
|
58
|
+
function parseHooksFile(content) {
|
|
59
|
+
try {
|
|
60
|
+
const parsed = JSON.parse(content);
|
|
61
|
+
if (!parsed.hooks) {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
const result = {};
|
|
65
|
+
if (parsed.hooks.SessionStart) {
|
|
66
|
+
result.sessionStart = parsed.hooks.SessionStart.flatMap(
|
|
67
|
+
(m) => m.hooks || []
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
if (parsed.hooks.SessionEnd) {
|
|
71
|
+
result.sessionEnd = parsed.hooks.SessionEnd.flatMap(
|
|
72
|
+
(m) => m.hooks || []
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
if (parsed.hooks.UserPromptSubmit) {
|
|
76
|
+
result.userPromptSubmit = parsed.hooks.UserPromptSubmit.flatMap(
|
|
77
|
+
(m) => m.hooks || []
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
if (parsed.hooks.PreToolUse) {
|
|
81
|
+
result.preToolUse = parsed.hooks.PreToolUse;
|
|
82
|
+
}
|
|
83
|
+
if (parsed.hooks.PostToolUse) {
|
|
84
|
+
result.postToolUse = parsed.hooks.PostToolUse;
|
|
85
|
+
}
|
|
86
|
+
return result;
|
|
87
|
+
} catch {
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
async function loadHooksConfigByScope(scope) {
|
|
92
|
+
let userHooks = null;
|
|
93
|
+
let projectHooks = null;
|
|
94
|
+
if (scope === "user" || scope === "all") {
|
|
95
|
+
const mintoPath = join(homedir(), ".minto", "hooks.json");
|
|
96
|
+
const claudePath = join(homedir(), ".claude", "hooks.json");
|
|
97
|
+
const hooksPath = existsSync(mintoPath) ? mintoPath : existsSync(claudePath) ? claudePath : null;
|
|
98
|
+
if (hooksPath) {
|
|
99
|
+
try {
|
|
100
|
+
const content = await readFile(hooksPath, "utf-8");
|
|
101
|
+
userHooks = parseHooksFile(content);
|
|
102
|
+
} catch {
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
if (scope === "project" || scope === "all") {
|
|
107
|
+
const cwd = getCwd();
|
|
108
|
+
const mintoPath = join(cwd, ".minto", "hooks.json");
|
|
109
|
+
const claudePath = join(cwd, ".claude", "hooks.json");
|
|
110
|
+
const hooksPath = existsSync(mintoPath) ? mintoPath : existsSync(claudePath) ? claudePath : null;
|
|
111
|
+
if (hooksPath) {
|
|
112
|
+
try {
|
|
113
|
+
const content = await readFile(hooksPath, "utf-8");
|
|
114
|
+
projectHooks = parseHooksFile(content);
|
|
115
|
+
} catch {
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return { userHooks, projectHooks };
|
|
120
|
+
}
|
|
121
|
+
function parseAgentFile(content) {
|
|
122
|
+
const frontmatterMatch = content.match(/^---\n([\s\S]*?)\n---\n([\s\S]*)$/);
|
|
123
|
+
if (!frontmatterMatch) return null;
|
|
124
|
+
const frontmatter = frontmatterMatch[1];
|
|
125
|
+
const body = frontmatterMatch[2].trim();
|
|
126
|
+
const nameMatch = frontmatter.match(/^name:\s*(.+)$/m);
|
|
127
|
+
const descMatch = frontmatter.match(/^description:\s*"?([^"\n]+)"?$/m);
|
|
128
|
+
const toolsMatch = frontmatter.match(/^tools:\s*(.+)$/m);
|
|
129
|
+
const modelMatch = frontmatter.match(/^model_name:\s*(.+)$/m);
|
|
130
|
+
const colorMatch = frontmatter.match(/^color:\s*"?([^"\n]+)"?$/m);
|
|
131
|
+
if (!nameMatch || !descMatch) return null;
|
|
132
|
+
let tools = "*";
|
|
133
|
+
if (toolsMatch) {
|
|
134
|
+
const toolsValue = toolsMatch[1].trim();
|
|
135
|
+
if (toolsValue === "*") {
|
|
136
|
+
tools = "*";
|
|
137
|
+
} else {
|
|
138
|
+
try {
|
|
139
|
+
tools = JSON.parse(toolsValue);
|
|
140
|
+
} catch {
|
|
141
|
+
tools = "*";
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
return {
|
|
146
|
+
name: nameMatch[1].trim(),
|
|
147
|
+
description: descMatch[1].trim(),
|
|
148
|
+
tools,
|
|
149
|
+
systemPrompt: body,
|
|
150
|
+
model: modelMatch ? modelMatch[1].trim() : void 0,
|
|
151
|
+
color: colorMatch ? colorMatch[1].trim() : void 0
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
async function scanAgentsDir(agentsDir) {
|
|
155
|
+
const agentMap = /* @__PURE__ */ new Map();
|
|
156
|
+
if (!existsSync(agentsDir)) return agentMap;
|
|
157
|
+
try {
|
|
158
|
+
const files = readdirSync(agentsDir);
|
|
159
|
+
for (const file of files) {
|
|
160
|
+
if (!file.endsWith(".md")) continue;
|
|
161
|
+
const filePath = join(agentsDir, file);
|
|
162
|
+
const content = await readFile(filePath, "utf-8");
|
|
163
|
+
const agent = parseAgentFile(content);
|
|
164
|
+
if (agent) {
|
|
165
|
+
agentMap.set(agent.name, agent);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
} catch {
|
|
169
|
+
}
|
|
170
|
+
return agentMap;
|
|
171
|
+
}
|
|
172
|
+
async function loadAgentsConfigByScope(scope) {
|
|
173
|
+
const userAgentMap = /* @__PURE__ */ new Map();
|
|
174
|
+
const projectAgentMap = /* @__PURE__ */ new Map();
|
|
175
|
+
if (scope === "user" || scope === "all") {
|
|
176
|
+
const claudeAgents = await scanAgentsDir(
|
|
177
|
+
join(homedir(), ".claude", "agents")
|
|
178
|
+
);
|
|
179
|
+
const mintoAgents = await scanAgentsDir(join(homedir(), ".minto", "agents"));
|
|
180
|
+
for (const [name, agent] of claudeAgents) {
|
|
181
|
+
userAgentMap.set(name, agent);
|
|
182
|
+
}
|
|
183
|
+
for (const [name, agent] of mintoAgents) {
|
|
184
|
+
userAgentMap.set(name, agent);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
if (scope === "project" || scope === "all") {
|
|
188
|
+
const cwd = getCwd();
|
|
189
|
+
const claudeAgents = await scanAgentsDir(join(cwd, ".claude", "agents"));
|
|
190
|
+
const mintoAgents = await scanAgentsDir(join(cwd, ".minto", "agents"));
|
|
191
|
+
for (const [name, agent] of claudeAgents) {
|
|
192
|
+
projectAgentMap.set(name, agent);
|
|
193
|
+
}
|
|
194
|
+
for (const [name, agent] of mintoAgents) {
|
|
195
|
+
projectAgentMap.set(name, agent);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
return {
|
|
199
|
+
userAgents: Array.from(userAgentMap.values()),
|
|
200
|
+
projectAgents: Array.from(projectAgentMap.values())
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
function getPluginScope(location) {
|
|
204
|
+
const cwd = getCwd();
|
|
205
|
+
if (location.startsWith(join(cwd, ".minto")) || location.startsWith(join(cwd, ".claude"))) {
|
|
206
|
+
return "project";
|
|
207
|
+
}
|
|
208
|
+
return "user";
|
|
209
|
+
}
|
|
210
|
+
async function getInstalledPluginSourcesByScope(scope) {
|
|
211
|
+
const plugins = loadAllPlugins();
|
|
212
|
+
const userPlugins = [];
|
|
213
|
+
const projectPlugins = [];
|
|
214
|
+
for (const plugin of plugins) {
|
|
215
|
+
const pluginScope = getPluginScope(plugin.location);
|
|
216
|
+
if (scope === "user" && pluginScope !== "user") continue;
|
|
217
|
+
if (scope === "project" && pluginScope !== "project") continue;
|
|
218
|
+
const metaPath = join(plugin.location, ".marketplace-meta.json");
|
|
219
|
+
let pluginName;
|
|
220
|
+
if (existsSync(metaPath)) {
|
|
221
|
+
try {
|
|
222
|
+
const content = await readFile(metaPath, "utf-8");
|
|
223
|
+
const meta = JSON.parse(content);
|
|
224
|
+
pluginName = meta.plugin && meta.marketplace ? `${meta.plugin}@${meta.marketplace}` : meta.plugin || plugin.name;
|
|
225
|
+
} catch {
|
|
226
|
+
pluginName = plugin.name;
|
|
227
|
+
}
|
|
228
|
+
} else {
|
|
229
|
+
pluginName = plugin.name;
|
|
230
|
+
}
|
|
231
|
+
if (pluginScope === "user") {
|
|
232
|
+
userPlugins.push(pluginName);
|
|
233
|
+
} else {
|
|
234
|
+
projectPlugins.push(pluginName);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
return { userPlugins, projectPlugins };
|
|
238
|
+
}
|
|
239
|
+
function loadStandaloneSkillsByScope(scope) {
|
|
240
|
+
const allSkills = loadAllSkills();
|
|
241
|
+
const userSkills = [];
|
|
242
|
+
const projectSkills = [];
|
|
243
|
+
for (const skill of allSkills) {
|
|
244
|
+
if (skill.pluginName !== "standalone") continue;
|
|
245
|
+
const teamSkill = {
|
|
246
|
+
name: skill.name,
|
|
247
|
+
description: skill.config.description,
|
|
248
|
+
content: skill.config.content || "",
|
|
249
|
+
argumentHint: skill.config.argumentHint,
|
|
250
|
+
disableModelInvocation: skill.config.disableModelInvocation,
|
|
251
|
+
userInvocable: skill.config.userInvocable,
|
|
252
|
+
allowedTools: skill.config.allowedTools,
|
|
253
|
+
model: skill.config.model,
|
|
254
|
+
context: skill.config.context,
|
|
255
|
+
agent: skill.config.agent
|
|
256
|
+
};
|
|
257
|
+
if (skill.source === "user" && (scope === "user" || scope === "all")) {
|
|
258
|
+
userSkills.push(teamSkill);
|
|
259
|
+
} else if (skill.source === "project" && (scope === "project" || scope === "all")) {
|
|
260
|
+
projectSkills.push(teamSkill);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
return { userSkills, projectSkills };
|
|
264
|
+
}
|
|
265
|
+
async function loadStandaloneCommandsByScope(scope) {
|
|
266
|
+
const allCommands = await loadCustomCommands();
|
|
267
|
+
const userCommands = [];
|
|
268
|
+
const projectCommands = [];
|
|
269
|
+
for (const cmd of allCommands) {
|
|
270
|
+
if (cmd.name.startsWith("plugin:")) continue;
|
|
271
|
+
const teamCmd = {
|
|
272
|
+
name: cmd.name,
|
|
273
|
+
description: cmd.description,
|
|
274
|
+
content: "",
|
|
275
|
+
// Will be populated from getPromptForCommand
|
|
276
|
+
aliases: cmd.aliases,
|
|
277
|
+
enabled: cmd.isEnabled,
|
|
278
|
+
hidden: cmd.isHidden,
|
|
279
|
+
progressMessage: cmd.progressMessage,
|
|
280
|
+
argNames: cmd.argNames
|
|
281
|
+
};
|
|
282
|
+
try {
|
|
283
|
+
const messages = await cmd.getPromptForCommand("");
|
|
284
|
+
if (messages.length > 0) {
|
|
285
|
+
const firstMsg = messages[0];
|
|
286
|
+
if (typeof firstMsg.content === "string") {
|
|
287
|
+
teamCmd.content = firstMsg.content;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
} catch {
|
|
291
|
+
continue;
|
|
292
|
+
}
|
|
293
|
+
if (cmd.scope === "user" && (scope === "user" || scope === "all")) {
|
|
294
|
+
userCommands.push(teamCmd);
|
|
295
|
+
} else if (cmd.scope === "project" && (scope === "project" || scope === "all")) {
|
|
296
|
+
projectCommands.push(teamCmd);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
return { userCommands, projectCommands };
|
|
300
|
+
}
|
|
301
|
+
function getMarketplaceUrls() {
|
|
302
|
+
const marketplaces = listMarketplaces();
|
|
303
|
+
const urls = [];
|
|
304
|
+
for (const mp of marketplaces) {
|
|
305
|
+
if (mp.source.type === "github") {
|
|
306
|
+
urls.push(`https://github.com/${mp.source.repo}.git`);
|
|
307
|
+
} else if (mp.source.type === "url") {
|
|
308
|
+
urls.push(mp.source.url);
|
|
309
|
+
} else if (mp.source.type === "local") {
|
|
310
|
+
urls.push(mp.source.path);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
return urls;
|
|
314
|
+
}
|
|
315
|
+
const PROXY_ENV_KEYS = /* @__PURE__ */ new Set([
|
|
316
|
+
"no_proxy",
|
|
317
|
+
"NO_PROXY",
|
|
318
|
+
"http_proxy",
|
|
319
|
+
"HTTP_PROXY",
|
|
320
|
+
"https_proxy",
|
|
321
|
+
"HTTPS_PROXY",
|
|
322
|
+
"ALL_PROXY",
|
|
323
|
+
"all_proxy"
|
|
324
|
+
]);
|
|
325
|
+
function buildMcpServersConfig(mcpServers, usePlaceholders) {
|
|
326
|
+
const result = {};
|
|
327
|
+
for (const [name, server] of Object.entries(mcpServers)) {
|
|
328
|
+
if (server.type === "sse") {
|
|
329
|
+
result[name] = {
|
|
330
|
+
type: "sse",
|
|
331
|
+
url: server.url,
|
|
332
|
+
enabled: server.enabled
|
|
333
|
+
};
|
|
334
|
+
} else {
|
|
335
|
+
const env = server.env ? usePlaceholders ? Object.fromEntries(
|
|
336
|
+
Object.entries(server.env).map(([key, value]) => {
|
|
337
|
+
const isProxyKey = PROXY_ENV_KEYS.has(key);
|
|
338
|
+
const isSecret = !isProxyKey && (key.toLowerCase().includes("key") || key.toLowerCase().includes("secret") || key.toLowerCase().includes("token") || key.toLowerCase().includes("password"));
|
|
339
|
+
return [key, isSecret ? `\${${key}}` : value];
|
|
340
|
+
})
|
|
341
|
+
) : server.env : void 0;
|
|
342
|
+
result[name] = {
|
|
343
|
+
type: "stdio",
|
|
344
|
+
command: server.command,
|
|
345
|
+
args: server.args,
|
|
346
|
+
env,
|
|
347
|
+
enabled: server.enabled
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
return result;
|
|
352
|
+
}
|
|
353
|
+
async function buildTeamConfig(scope, usePlaceholders) {
|
|
354
|
+
const cwd = getCwd();
|
|
355
|
+
const globalConfig = getGlobalConfig();
|
|
356
|
+
const projectConfig = getCurrentProjectConfig();
|
|
357
|
+
const scopeLabel = scope === "user" ? "User Configuration" : scope === "project" ? `Project: ${cwd.split("/").pop()}` : `All: ${cwd.split("/").pop()}`;
|
|
358
|
+
const config = {
|
|
359
|
+
version: "1.0",
|
|
360
|
+
name: scopeLabel,
|
|
361
|
+
description: `Exported from Minto on ${(/* @__PURE__ */ new Date()).toISOString()}`,
|
|
362
|
+
scope
|
|
363
|
+
};
|
|
364
|
+
if (scope !== "project") {
|
|
365
|
+
if (globalConfig.modelProfiles && globalConfig.modelProfiles.length > 0) {
|
|
366
|
+
config.models = {
|
|
367
|
+
profiles: globalConfig.modelProfiles.map((profile) => ({
|
|
368
|
+
name: profile.name,
|
|
369
|
+
provider: profile.provider,
|
|
370
|
+
modelName: profile.modelName,
|
|
371
|
+
baseURL: profile.baseURL,
|
|
372
|
+
apiKey: usePlaceholders ? `\${${profile.provider.toUpperCase()}_API_KEY}` : profile.apiKey,
|
|
373
|
+
maxTokens: profile.maxTokens,
|
|
374
|
+
contextLength: profile.contextLength,
|
|
375
|
+
reasoningEffort: profile.reasoningEffort,
|
|
376
|
+
isActive: profile.isActive
|
|
377
|
+
})),
|
|
378
|
+
pointers: globalConfig.modelPointers,
|
|
379
|
+
defaultModel: globalConfig.defaultModelName
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
if (scope === "user") {
|
|
384
|
+
if (globalConfig.mcpServers && Object.keys(globalConfig.mcpServers).length > 0) {
|
|
385
|
+
config.mcpServers = buildMcpServersConfig(
|
|
386
|
+
globalConfig.mcpServers,
|
|
387
|
+
usePlaceholders
|
|
388
|
+
);
|
|
389
|
+
}
|
|
390
|
+
} else if (scope === "project") {
|
|
391
|
+
if (projectConfig.mcpServers && Object.keys(projectConfig.mcpServers).length > 0) {
|
|
392
|
+
config.mcpServers = buildMcpServersConfig(
|
|
393
|
+
projectConfig.mcpServers,
|
|
394
|
+
usePlaceholders
|
|
395
|
+
);
|
|
396
|
+
}
|
|
397
|
+
} else {
|
|
398
|
+
const merged = {
|
|
399
|
+
...globalConfig.mcpServers,
|
|
400
|
+
...projectConfig.mcpServers
|
|
401
|
+
};
|
|
402
|
+
if (Object.keys(merged).length > 0) {
|
|
403
|
+
config.mcpServers = buildMcpServersConfig(merged, usePlaceholders);
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
const marketplaceUrls = getMarketplaceUrls();
|
|
407
|
+
const { userPlugins, projectPlugins } = await getInstalledPluginSourcesByScope(scope);
|
|
408
|
+
if (marketplaceUrls.length > 0 || userPlugins.length > 0 || projectPlugins.length > 0) {
|
|
409
|
+
config.plugins = {};
|
|
410
|
+
if (marketplaceUrls.length > 0) {
|
|
411
|
+
config.plugins.marketplaces = marketplaceUrls;
|
|
412
|
+
}
|
|
413
|
+
if (userPlugins.length > 0) {
|
|
414
|
+
config.plugins.userInstall = userPlugins;
|
|
415
|
+
}
|
|
416
|
+
if (projectPlugins.length > 0) {
|
|
417
|
+
config.plugins.projectInstall = projectPlugins;
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
const { userAgents, projectAgents } = await loadAgentsConfigByScope(scope);
|
|
421
|
+
if (userAgents.length > 0 || projectAgents.length > 0) {
|
|
422
|
+
config.agents = {};
|
|
423
|
+
if (userAgents.length > 0) {
|
|
424
|
+
config.agents.userAgents = userAgents;
|
|
425
|
+
}
|
|
426
|
+
if (projectAgents.length > 0) {
|
|
427
|
+
config.agents.projectAgents = projectAgents;
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
const { userSkills, projectSkills } = loadStandaloneSkillsByScope(scope);
|
|
431
|
+
if (userSkills.length > 0 || projectSkills.length > 0) {
|
|
432
|
+
config.skills = {};
|
|
433
|
+
if (userSkills.length > 0) {
|
|
434
|
+
config.skills.userSkills = userSkills;
|
|
435
|
+
}
|
|
436
|
+
if (projectSkills.length > 0) {
|
|
437
|
+
config.skills.projectSkills = projectSkills;
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
const { userCommands, projectCommands } = await loadStandaloneCommandsByScope(scope);
|
|
441
|
+
if (userCommands.length > 0 || projectCommands.length > 0) {
|
|
442
|
+
config.commands = {};
|
|
443
|
+
if (userCommands.length > 0) {
|
|
444
|
+
config.commands.userCommands = userCommands;
|
|
445
|
+
}
|
|
446
|
+
if (projectCommands.length > 0) {
|
|
447
|
+
config.commands.projectCommands = projectCommands;
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
const { userHooks, projectHooks } = await loadHooksConfigByScope(scope);
|
|
451
|
+
if (userHooks) {
|
|
452
|
+
config.hooks = userHooks;
|
|
453
|
+
}
|
|
454
|
+
if (projectHooks) {
|
|
455
|
+
config.projectHooks = projectHooks;
|
|
456
|
+
}
|
|
457
|
+
if (scope !== "project") {
|
|
458
|
+
config.settings = {
|
|
459
|
+
theme: globalConfig.theme,
|
|
460
|
+
verbose: globalConfig.verbose,
|
|
461
|
+
compressionMode: globalConfig.compressionMode,
|
|
462
|
+
thinking: globalConfig.thinking,
|
|
463
|
+
proxy: globalConfig.proxy,
|
|
464
|
+
stream: globalConfig.stream,
|
|
465
|
+
language: globalConfig.language,
|
|
466
|
+
safetyMode: globalConfig.safetyMode,
|
|
467
|
+
skipOnboarding: globalConfig.hasCompletedOnboarding
|
|
468
|
+
};
|
|
469
|
+
}
|
|
470
|
+
if (usePlaceholders) {
|
|
471
|
+
config.postInstallInstructions = `
|
|
472
|
+
1. Set environment variables for API keys (e.g., ANTHROPIC_API_KEY, OPENAI_API_KEY)
|
|
473
|
+
2. Run 'minto' to start using your configured setup
|
|
474
|
+
`.trim();
|
|
475
|
+
}
|
|
476
|
+
return config;
|
|
477
|
+
}
|
|
478
|
+
async function exportRuntimeConfig(scope) {
|
|
479
|
+
const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
480
|
+
if (scope === "user") {
|
|
481
|
+
const globalConfig = getGlobalConfig();
|
|
482
|
+
return {
|
|
483
|
+
content: JSON.stringify({ global: globalConfig }, null, 2),
|
|
484
|
+
filename: `minto-config-user-${timestamp}.json`
|
|
485
|
+
};
|
|
486
|
+
} else if (scope === "project") {
|
|
487
|
+
const projectConfig = getCurrentProjectConfig();
|
|
488
|
+
return {
|
|
489
|
+
content: JSON.stringify({ project: projectConfig }, null, 2),
|
|
490
|
+
filename: `minto-config-project-${timestamp}.json`
|
|
491
|
+
};
|
|
492
|
+
} else {
|
|
493
|
+
const globalConfig = getGlobalConfig();
|
|
494
|
+
const projectConfig = getCurrentProjectConfig();
|
|
495
|
+
return {
|
|
496
|
+
content: JSON.stringify(
|
|
497
|
+
{ global: globalConfig, project: projectConfig },
|
|
498
|
+
null,
|
|
499
|
+
2
|
|
500
|
+
),
|
|
501
|
+
filename: `minto-config-all-${timestamp}.json`
|
|
502
|
+
};
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
async function exportTeamTemplate(scope, usePlaceholders) {
|
|
506
|
+
const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
507
|
+
const teamConfig = await buildTeamConfig(scope, usePlaceholders);
|
|
508
|
+
return {
|
|
509
|
+
content: JSON.stringify(teamConfig, null, 2),
|
|
510
|
+
filename: `minto-team-${scope}-${timestamp}.json`
|
|
511
|
+
};
|
|
512
|
+
}
|
|
513
|
+
const EXPORT_TABS = [
|
|
514
|
+
{ id: "team", label: t("commands.export.typeTeam") },
|
|
515
|
+
{ id: "runtime", label: t("commands.export.typeRuntime") },
|
|
516
|
+
{ id: "conversation", label: t("commands.export.typeConversation") },
|
|
517
|
+
{ id: "summary", label: t("commands.export.typeSummary") }
|
|
518
|
+
];
|
|
519
|
+
function getItemsForTab(tabId) {
|
|
520
|
+
switch (tabId) {
|
|
521
|
+
case "team":
|
|
522
|
+
return [
|
|
523
|
+
{
|
|
524
|
+
id: "team-user-include",
|
|
525
|
+
label: t("commands.export.itemTeamUserInclude"),
|
|
526
|
+
description: t("commands.export.scopeUserDesc"),
|
|
527
|
+
data: {
|
|
528
|
+
category: "team",
|
|
529
|
+
scope: "user",
|
|
530
|
+
sensitive: "include"
|
|
531
|
+
}
|
|
532
|
+
},
|
|
533
|
+
{
|
|
534
|
+
id: "team-user-placeholder",
|
|
535
|
+
label: t("commands.export.itemTeamUserPlaceholder"),
|
|
536
|
+
description: t("commands.export.scopeUserDesc"),
|
|
537
|
+
data: {
|
|
538
|
+
category: "team",
|
|
539
|
+
scope: "user",
|
|
540
|
+
sensitive: "placeholder"
|
|
541
|
+
}
|
|
542
|
+
},
|
|
543
|
+
{
|
|
544
|
+
id: "team-project-include",
|
|
545
|
+
label: t("commands.export.itemTeamProjectInclude"),
|
|
546
|
+
description: t("commands.export.scopeProjectDesc"),
|
|
547
|
+
data: {
|
|
548
|
+
category: "team",
|
|
549
|
+
scope: "project",
|
|
550
|
+
sensitive: "include"
|
|
551
|
+
}
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
id: "team-project-placeholder",
|
|
555
|
+
label: t("commands.export.itemTeamProjectPlaceholder"),
|
|
556
|
+
description: t("commands.export.scopeProjectDesc"),
|
|
557
|
+
data: {
|
|
558
|
+
category: "team",
|
|
559
|
+
scope: "project",
|
|
560
|
+
sensitive: "placeholder"
|
|
561
|
+
}
|
|
562
|
+
},
|
|
563
|
+
{
|
|
564
|
+
id: "team-all-include",
|
|
565
|
+
label: t("commands.export.itemTeamAllInclude"),
|
|
566
|
+
description: t("commands.export.scopeAllDesc"),
|
|
567
|
+
data: {
|
|
568
|
+
category: "team",
|
|
569
|
+
scope: "all",
|
|
570
|
+
sensitive: "include"
|
|
571
|
+
}
|
|
572
|
+
},
|
|
573
|
+
{
|
|
574
|
+
id: "team-all-placeholder",
|
|
575
|
+
label: t("commands.export.itemTeamAllPlaceholder"),
|
|
576
|
+
description: t("commands.export.scopeAllDesc"),
|
|
577
|
+
data: {
|
|
578
|
+
category: "team",
|
|
579
|
+
scope: "all",
|
|
580
|
+
sensitive: "placeholder"
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
];
|
|
584
|
+
case "runtime":
|
|
585
|
+
return [
|
|
586
|
+
{
|
|
587
|
+
id: "runtime-user",
|
|
588
|
+
label: t("commands.export.itemRuntimeUser"),
|
|
589
|
+
description: t("commands.export.scopeUserDesc"),
|
|
590
|
+
data: {
|
|
591
|
+
category: "runtime",
|
|
592
|
+
scope: "user",
|
|
593
|
+
sensitive: "include"
|
|
594
|
+
}
|
|
595
|
+
},
|
|
596
|
+
{
|
|
597
|
+
id: "runtime-project",
|
|
598
|
+
label: t("commands.export.itemRuntimeProject"),
|
|
599
|
+
description: t("commands.export.scopeProjectDesc"),
|
|
600
|
+
data: {
|
|
601
|
+
category: "runtime",
|
|
602
|
+
scope: "project",
|
|
603
|
+
sensitive: "include"
|
|
604
|
+
}
|
|
605
|
+
},
|
|
606
|
+
{
|
|
607
|
+
id: "runtime-all",
|
|
608
|
+
label: t("commands.export.itemRuntimeAll"),
|
|
609
|
+
description: t("commands.export.scopeAllDesc"),
|
|
610
|
+
data: {
|
|
611
|
+
category: "runtime",
|
|
612
|
+
scope: "all",
|
|
613
|
+
sensitive: "include"
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
];
|
|
617
|
+
case "conversation":
|
|
618
|
+
return [
|
|
619
|
+
{
|
|
620
|
+
id: "conversation",
|
|
621
|
+
label: t("commands.export.itemConversation"),
|
|
622
|
+
description: t("commands.export.typeConversationDesc"),
|
|
623
|
+
data: {
|
|
624
|
+
category: "conversation",
|
|
625
|
+
scope: "user",
|
|
626
|
+
sensitive: "include"
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
];
|
|
630
|
+
case "summary":
|
|
631
|
+
return [
|
|
632
|
+
{
|
|
633
|
+
id: "summary",
|
|
634
|
+
label: t("commands.export.itemSummary"),
|
|
635
|
+
description: t("commands.export.typeSummaryDesc"),
|
|
636
|
+
data: {
|
|
637
|
+
category: "summary",
|
|
638
|
+
scope: "user",
|
|
639
|
+
sensitive: "include"
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
];
|
|
643
|
+
default:
|
|
644
|
+
return [];
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
const ExportMenu = ({ onDone }) => {
|
|
648
|
+
const [activeTab, setActiveTab] = useState("team");
|
|
649
|
+
const [statusOverlay, setStatusOverlay] = useState(null);
|
|
650
|
+
const [searchQuery, setSearchQuery] = useState("");
|
|
651
|
+
const items = useMemo(() => getItemsForTab(activeTab), [activeTab]);
|
|
652
|
+
const handleSelect = useCallback(async (item) => {
|
|
653
|
+
const data = item.data;
|
|
654
|
+
setStatusOverlay({
|
|
655
|
+
type: "loading",
|
|
656
|
+
message: t("commands.export.exporting")
|
|
657
|
+
});
|
|
658
|
+
try {
|
|
659
|
+
const cwd = getCwd();
|
|
660
|
+
let filename;
|
|
661
|
+
let content;
|
|
662
|
+
switch (data.category) {
|
|
663
|
+
case "conversation": {
|
|
664
|
+
const messages = getMessagesGetter()();
|
|
665
|
+
const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
666
|
+
filename = `minto-conversation-${timestamp}.json`;
|
|
667
|
+
content = JSON.stringify(messages, null, 2);
|
|
668
|
+
break;
|
|
669
|
+
}
|
|
670
|
+
case "summary": {
|
|
671
|
+
const messages = getMessagesGetter()();
|
|
672
|
+
const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
673
|
+
filename = `minto-summary-${timestamp}.md`;
|
|
674
|
+
content = generateSummary(messages);
|
|
675
|
+
break;
|
|
676
|
+
}
|
|
677
|
+
case "runtime": {
|
|
678
|
+
const result = await exportRuntimeConfig(data.scope);
|
|
679
|
+
filename = result.filename;
|
|
680
|
+
content = result.content;
|
|
681
|
+
break;
|
|
682
|
+
}
|
|
683
|
+
case "team": {
|
|
684
|
+
const usePlaceholders = data.sensitive === "placeholder";
|
|
685
|
+
const result = await exportTeamTemplate(data.scope, usePlaceholders);
|
|
686
|
+
filename = result.filename;
|
|
687
|
+
content = result.content;
|
|
688
|
+
break;
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
const filepath = join(cwd, filename);
|
|
692
|
+
await writeFile(filepath, content, "utf-8");
|
|
693
|
+
setStatusOverlay({
|
|
694
|
+
type: "success",
|
|
695
|
+
message: `${t("commands.export.success")} ${filename}`
|
|
696
|
+
});
|
|
697
|
+
} catch (error) {
|
|
698
|
+
setStatusOverlay({
|
|
699
|
+
type: "error",
|
|
700
|
+
message: `${t("commands.export.failed")}: ${error instanceof Error ? error.message : String(error)}`
|
|
701
|
+
});
|
|
702
|
+
}
|
|
703
|
+
}, []);
|
|
704
|
+
const handleClose = useCallback(() => {
|
|
705
|
+
onDone();
|
|
706
|
+
}, [onDone]);
|
|
707
|
+
return /* @__PURE__ */ React.createElement(
|
|
708
|
+
TabbedListView,
|
|
709
|
+
{
|
|
710
|
+
title: t("commands.export.title"),
|
|
711
|
+
tabs: EXPORT_TABS,
|
|
712
|
+
activeTab,
|
|
713
|
+
onTabChange: (tab) => {
|
|
714
|
+
setActiveTab(tab);
|
|
715
|
+
setSearchQuery("");
|
|
716
|
+
},
|
|
717
|
+
items,
|
|
718
|
+
searchEnabled: false,
|
|
719
|
+
searchQuery,
|
|
720
|
+
onSearchChange: setSearchQuery,
|
|
721
|
+
onSelect: handleSelect,
|
|
722
|
+
onClose: handleClose,
|
|
723
|
+
footerHint: t("commands.export.footerHint"),
|
|
724
|
+
statusOverlay,
|
|
725
|
+
statusDismissHint: "Esc Close"
|
|
726
|
+
}
|
|
727
|
+
);
|
|
728
|
+
};
|
|
140
729
|
const command = {
|
|
141
730
|
name: "export",
|
|
142
|
-
description: "
|
|
731
|
+
description: t("commands.export.description"),
|
|
143
732
|
isEnabled: true,
|
|
144
733
|
isHidden: false,
|
|
734
|
+
hidePromptInput: true,
|
|
145
735
|
type: "local-jsx",
|
|
146
736
|
userFacingName() {
|
|
147
737
|
return this.name;
|