@within-7/minto 0.4.2 → 0.4.3
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.cjs +32 -154
- package/cli.js +3255 -0
- package/package.json +21 -38
- package/scripts/postinstall.cjs +19 -136
- package/vendor/ripgrep/arm64-linux/rg +0 -0
- package/vendor/ripgrep/x64-darwin/rg +0 -0
- package/vendor/ripgrep/x64-linux/rg +0 -0
- package/vendor/ripgrep/x64-win32/rg.exe +0 -0
- package/dist/Tool.js +0 -46
- package/dist/Tool.js.map +0 -7
- package/dist/commands/agents/AgentsCommand.js +0 -2170
- package/dist/commands/agents/AgentsCommand.js.map +0 -7
- package/dist/commands/agents/constants.js +0 -58
- package/dist/commands/agents/constants.js.map +0 -7
- package/dist/commands/agents/index.js +0 -37
- package/dist/commands/agents/index.js.map +0 -7
- package/dist/commands/agents/types.js +0 -11
- package/dist/commands/agents/types.js.map +0 -7
- package/dist/commands/agents/utils/fileOperations.js +0 -245
- package/dist/commands/agents/utils/fileOperations.js.map +0 -7
- package/dist/commands/agents/utils/index.js +0 -23
- package/dist/commands/agents/utils/index.js.map +0 -7
- package/dist/commands/approvedTools.js +0 -36
- package/dist/commands/approvedTools.js.map +0 -7
- package/dist/commands/bug.js +0 -88
- package/dist/commands/bug.js.map +0 -7
- package/dist/commands/clear.js +0 -41
- package/dist/commands/clear.js.map +0 -7
- package/dist/commands/compact.js +0 -119
- package/dist/commands/compact.js.map +0 -7
- package/dist/commands/config.js +0 -20
- package/dist/commands/config.js.map +0 -7
- package/dist/commands/context.js +0 -118
- package/dist/commands/context.js.map +0 -7
- package/dist/commands/cost.js +0 -19
- package/dist/commands/cost.js.map +0 -7
- package/dist/commands/ctx_viz.js +0 -193
- package/dist/commands/ctx_viz.js.map +0 -7
- package/dist/commands/doctor.js +0 -171
- package/dist/commands/doctor.js.map +0 -7
- package/dist/commands/effort.js +0 -87
- package/dist/commands/effort.js.map +0 -7
- package/dist/commands/export.js +0 -747
- package/dist/commands/export.js.map +0 -7
- package/dist/commands/help.js +0 -20
- package/dist/commands/help.js.map +0 -7
- package/dist/commands/ide.js +0 -18
- package/dist/commands/ide.js.map +0 -7
- package/dist/commands/init.js +0 -38
- package/dist/commands/init.js.map +0 -7
- package/dist/commands/language.js +0 -110
- package/dist/commands/language.js.map +0 -7
- package/dist/commands/login.js +0 -128
- package/dist/commands/login.js.map +0 -7
- package/dist/commands/mcp-interactive.js +0 -485
- package/dist/commands/mcp-interactive.js.map +0 -7
- package/dist/commands/memory.js +0 -119
- package/dist/commands/memory.js.map +0 -7
- package/dist/commands/model.js +0 -497
- package/dist/commands/model.js.map +0 -7
- package/dist/commands/new.js +0 -56
- package/dist/commands/new.js.map +0 -7
- package/dist/commands/outputStyle.js +0 -64
- package/dist/commands/outputStyle.js.map +0 -7
- package/dist/commands/permissions.js +0 -113
- package/dist/commands/permissions.js.map +0 -7
- package/dist/commands/plugin/AddMarketplaceForm.js +0 -91
- package/dist/commands/plugin/AddMarketplaceForm.js.map +0 -7
- package/dist/commands/plugin/ConfirmDialog.js +0 -84
- package/dist/commands/plugin/ConfirmDialog.js.map +0 -7
- package/dist/commands/plugin/ErrorView.js +0 -34
- package/dist/commands/plugin/ErrorView.js.map +0 -7
- package/dist/commands/plugin/InstalledPluginsByMarketplace.js +0 -152
- package/dist/commands/plugin/InstalledPluginsByMarketplace.js.map +0 -7
- package/dist/commands/plugin/InstalledPluginsManager.js +0 -102
- package/dist/commands/plugin/InstalledPluginsManager.js.map +0 -7
- package/dist/commands/plugin/LoadingView.js +0 -14
- package/dist/commands/plugin/LoadingView.js.map +0 -7
- package/dist/commands/plugin/MainMenu.js +0 -67
- package/dist/commands/plugin/MainMenu.js.map +0 -7
- package/dist/commands/plugin/MarketplaceManager.js +0 -201
- package/dist/commands/plugin/MarketplaceManager.js.map +0 -7
- package/dist/commands/plugin/MarketplaceSelector.js +0 -124
- package/dist/commands/plugin/MarketplaceSelector.js.map +0 -7
- package/dist/commands/plugin/PlaceholderScreen.js +0 -31
- package/dist/commands/plugin/PlaceholderScreen.js.map +0 -7
- package/dist/commands/plugin/PluginBrowser.js +0 -183
- package/dist/commands/plugin/PluginBrowser.js.map +0 -7
- package/dist/commands/plugin/PluginDetailsInstall.js +0 -159
- package/dist/commands/plugin/PluginDetailsInstall.js.map +0 -7
- package/dist/commands/plugin/PluginDetailsManage.js +0 -210
- package/dist/commands/plugin/PluginDetailsManage.js.map +0 -7
- package/dist/commands/plugin/components.js +0 -16
- package/dist/commands/plugin/components.js.map +0 -7
- package/dist/commands/plugin/example-usage.js +0 -63
- package/dist/commands/plugin/example-usage.js.map +0 -7
- package/dist/commands/plugin/types.js +0 -1
- package/dist/commands/plugin/types.js.map +0 -7
- package/dist/commands/plugin/utils.js +0 -109
- package/dist/commands/plugin/utils.js.map +0 -7
- package/dist/commands/plugin.js +0 -1410
- package/dist/commands/plugin.js.map +0 -7
- package/dist/commands/quit.js +0 -20
- package/dist/commands/quit.js.map +0 -7
- package/dist/commands/refreshCommands.js +0 -48
- package/dist/commands/refreshCommands.js.map +0 -7
- package/dist/commands/resume.js +0 -71
- package/dist/commands/resume.js.map +0 -7
- package/dist/commands/review.js +0 -51
- package/dist/commands/review.js.map +0 -7
- package/dist/commands/sandbox.js +0 -203
- package/dist/commands/sandbox.js.map +0 -7
- package/dist/commands/sessions.js +0 -224
- package/dist/commands/sessions.js.map +0 -7
- package/dist/commands/setup.js +0 -653
- package/dist/commands/setup.js.map +0 -7
- package/dist/commands/stats.js +0 -292
- package/dist/commands/stats.js.map +0 -7
- package/dist/commands/status.js +0 -127
- package/dist/commands/status.js.map +0 -7
- package/dist/commands/tasks.js +0 -108
- package/dist/commands/tasks.js.map +0 -7
- package/dist/commands/terminalSetup.js +0 -174
- package/dist/commands/terminalSetup.js.map +0 -7
- package/dist/commands/todos.js +0 -123
- package/dist/commands/todos.js.map +0 -7
- package/dist/commands/undo.js +0 -227
- package/dist/commands/undo.js.map +0 -7
- package/dist/commands/vim.js +0 -22
- package/dist/commands/vim.js.map +0 -7
- package/dist/commands.js +0 -130
- package/dist/commands.js.map +0 -7
- package/dist/components/AgentDetailView.js +0 -126
- package/dist/components/AgentDetailView.js.map +0 -7
- package/dist/components/AgentResponseBlock.js +0 -41
- package/dist/components/AgentResponseBlock.js.map +0 -7
- package/dist/components/AgentThinkingBlock.js +0 -32
- package/dist/components/AgentThinkingBlock.js.map +0 -7
- package/dist/components/AgentViewBanner.js +0 -22
- package/dist/components/AgentViewBanner.js.map +0 -7
- package/dist/components/AsciiLogo.js +0 -18
- package/dist/components/AsciiLogo.js.map +0 -7
- package/dist/components/AskUserQuestionDialog/AskUserQuestionDialog.js +0 -142
- package/dist/components/AskUserQuestionDialog/AskUserQuestionDialog.js.map +0 -7
- package/dist/components/AskUserQuestionDialog/QuestionView.js +0 -55
- package/dist/components/AskUserQuestionDialog/QuestionView.js.map +0 -7
- package/dist/components/AskUserQuestionDialog/index.js +0 -7
- package/dist/components/AskUserQuestionDialog/index.js.map +0 -7
- package/dist/components/BackgroundTasksPanel.js +0 -177
- package/dist/components/BackgroundTasksPanel.js.map +0 -7
- package/dist/components/BashStreamingProgress.js +0 -24
- package/dist/components/BashStreamingProgress.js.map +0 -7
- package/dist/components/CollapsibleHint.js +0 -15
- package/dist/components/CollapsibleHint.js.map +0 -7
- package/dist/components/Config.js +0 -181
- package/dist/components/Config.js.map +0 -7
- package/dist/components/ConsoleOAuthFlow.js +0 -179
- package/dist/components/ConsoleOAuthFlow.js.map +0 -7
- package/dist/components/Cost.js +0 -14
- package/dist/components/Cost.js.map +0 -7
- package/dist/components/CostThresholdDialog.js +0 -38
- package/dist/components/CostThresholdDialog.js.map +0 -7
- package/dist/components/CustomSelect/option-map.js +0 -32
- package/dist/components/CustomSelect/option-map.js.map +0 -7
- package/dist/components/CustomSelect/select-option.js +0 -37
- package/dist/components/CustomSelect/select-option.js.map +0 -7
- package/dist/components/CustomSelect/select.js +0 -64
- package/dist/components/CustomSelect/select.js.map +0 -7
- package/dist/components/CustomSelect/theme.js +0 -1
- package/dist/components/CustomSelect/theme.js.map +0 -7
- package/dist/components/CustomSelect/use-select-state.js +0 -220
- package/dist/components/CustomSelect/use-select-state.js.map +0 -7
- package/dist/components/CustomSelect/use-select.js +0 -21
- package/dist/components/CustomSelect/use-select.js.map +0 -7
- package/dist/components/FallbackToolUseRejectedMessage.js +0 -11
- package/dist/components/FallbackToolUseRejectedMessage.js.map +0 -7
- package/dist/components/FileEditToolUpdatedMessage.js +0 -32
- package/dist/components/FileEditToolUpdatedMessage.js.map +0 -7
- package/dist/components/HeaderBar.js +0 -63
- package/dist/components/HeaderBar.js.map +0 -7
- package/dist/components/Help.js +0 -185
- package/dist/components/Help.js.map +0 -7
- package/dist/components/HighlightedCode.js +0 -31
- package/dist/components/HighlightedCode.js.map +0 -7
- package/dist/components/HistorySearchOverlay.js +0 -49
- package/dist/components/HistorySearchOverlay.js.map +0 -7
- package/dist/components/HotkeyHelpPanel.js +0 -154
- package/dist/components/HotkeyHelpPanel.js.map +0 -7
- package/dist/components/IdleNotificationBar.js +0 -10
- package/dist/components/IdleNotificationBar.js.map +0 -7
- package/dist/components/InfoPanel/InfoPanel.js +0 -123
- package/dist/components/InfoPanel/InfoPanel.js.map +0 -7
- package/dist/components/InfoPanel/index.js +0 -5
- package/dist/components/InfoPanel/index.js.map +0 -7
- package/dist/components/InfoPanel/types.js +0 -1
- package/dist/components/InfoPanel/types.js.map +0 -7
- package/dist/components/InteractionRoundBlock.js +0 -56
- package/dist/components/InteractionRoundBlock.js.map +0 -7
- package/dist/components/InvalidConfigDialog.js +0 -84
- package/dist/components/InvalidConfigDialog.js.map +0 -7
- package/dist/components/Link.js +0 -18
- package/dist/components/Link.js.map +0 -7
- package/dist/components/LogSelector.js +0 -50
- package/dist/components/LogSelector.js.map +0 -7
- package/dist/components/Logo.js +0 -55
- package/dist/components/Logo.js.map +0 -7
- package/dist/components/MCPServerApprovalDialog.js +0 -81
- package/dist/components/MCPServerApprovalDialog.js.map +0 -7
- package/dist/components/MCPServerDialogCopy.js +0 -12
- package/dist/components/MCPServerDialogCopy.js.map +0 -7
- package/dist/components/MCPServerMultiselectDialog.js +0 -82
- package/dist/components/MCPServerMultiselectDialog.js.map +0 -7
- package/dist/components/Message.js +0 -162
- package/dist/components/Message.js.map +0 -7
- package/dist/components/MessageResponse.js +0 -9
- package/dist/components/MessageResponse.js.map +0 -7
- package/dist/components/MessageSelector.js +0 -127
- package/dist/components/MessageSelector.js.map +0 -7
- package/dist/components/ModeIndicator.js +0 -39
- package/dist/components/ModeIndicator.js.map +0 -7
- package/dist/components/ModelConfig.js +0 -223
- package/dist/components/ModelConfig.js.map +0 -7
- package/dist/components/ModelListManager.js +0 -142
- package/dist/components/ModelListManager.js.map +0 -7
- package/dist/components/ModelSelector/BrandTextInput.js +0 -43
- package/dist/components/ModelSelector/BrandTextInput.js.map +0 -7
- package/dist/components/ModelSelector/ModelSelector.js +0 -2103
- package/dist/components/ModelSelector/ModelSelector.js.map +0 -7
- package/dist/components/ModelSelector/ScreenContainer.js +0 -27
- package/dist/components/ModelSelector/ScreenContainer.js.map +0 -7
- package/dist/components/ModelSelector/WizardContainer.js +0 -45
- package/dist/components/ModelSelector/WizardContainer.js.map +0 -7
- package/dist/components/ModelSelector/constants.js +0 -37
- package/dist/components/ModelSelector/constants.js.map +0 -7
- package/dist/components/ModelSelector/hooks/index.js +0 -5
- package/dist/components/ModelSelector/hooks/index.js.map +0 -7
- package/dist/components/ModelSelector/hooks/useEscapeNavigation.js +0 -21
- package/dist/components/ModelSelector/hooks/useEscapeNavigation.js.map +0 -7
- package/dist/components/ModelSelector/index.js +0 -15
- package/dist/components/ModelSelector/index.js.map +0 -7
- package/dist/components/ModelSelector/types.js +0 -1
- package/dist/components/ModelSelector/types.js.map +0 -7
- package/dist/components/Onboarding.js +0 -159
- package/dist/components/Onboarding.js.map +0 -7
- package/dist/components/OperationSummary.js +0 -130
- package/dist/components/OperationSummary.js.map +0 -7
- package/dist/components/PressEnterToContinue.js +0 -10
- package/dist/components/PressEnterToContinue.js.map +0 -7
- package/dist/components/ProgressBar.js +0 -74
- package/dist/components/ProgressBar.js.map +0 -7
- package/dist/components/ProjectOnboarding.js +0 -99
- package/dist/components/ProjectOnboarding.js.map +0 -7
- package/dist/components/PromptInput.js +0 -1067
- package/dist/components/PromptInput.js.map +0 -7
- package/dist/components/PulseLabel.js +0 -44
- package/dist/components/PulseLabel.js.map +0 -7
- package/dist/components/QuitSummary.js +0 -88
- package/dist/components/QuitSummary.js.map +0 -7
- package/dist/components/RequestStatusIndicator.js +0 -194
- package/dist/components/RequestStatusIndicator.js.map +0 -7
- package/dist/components/RewindPanel.js +0 -272
- package/dist/components/RewindPanel.js.map +0 -7
- package/dist/components/SensitiveFileWarning.js +0 -35
- package/dist/components/SensitiveFileWarning.js.map +0 -7
- package/dist/components/SentryErrorBoundary.js +0 -27
- package/dist/components/SentryErrorBoundary.js.map +0 -7
- package/dist/components/SimpleSelector/SimpleSelector.js +0 -154
- package/dist/components/SimpleSelector/SimpleSelector.js.map +0 -7
- package/dist/components/SimpleSelector/index.js +0 -5
- package/dist/components/SimpleSelector/index.js.map +0 -7
- package/dist/components/SimpleSelector/types.js +0 -1
- package/dist/components/SimpleSelector/types.js.map +0 -7
- package/dist/components/Spinner.js +0 -174
- package/dist/components/Spinner.js.map +0 -7
- package/dist/components/SpinnerSymbol.js +0 -72
- package/dist/components/SpinnerSymbol.js.map +0 -7
- package/dist/components/StartupStatus.js +0 -57
- package/dist/components/StartupStatus.js.map +0 -7
- package/dist/components/StatusOverlayContent.js +0 -21
- package/dist/components/StatusOverlayContent.js.map +0 -7
- package/dist/components/StreamingBashOutput.js +0 -71
- package/dist/components/StreamingBashOutput.js.map +0 -7
- package/dist/components/StreamingTextPreview.js +0 -29
- package/dist/components/StreamingTextPreview.js.map +0 -7
- package/dist/components/StructuredDiff.js +0 -146
- package/dist/components/StructuredDiff.js.map +0 -7
- package/dist/components/SubagentBlock.js +0 -197
- package/dist/components/SubagentBlock.js.map +0 -7
- package/dist/components/SubagentManager.js +0 -65
- package/dist/components/SubagentManager.js.map +0 -7
- package/dist/components/SubagentProgress.js +0 -123
- package/dist/components/SubagentProgress.js.map +0 -7
- package/dist/components/SubagentStatusMarker.js +0 -37
- package/dist/components/SubagentStatusMarker.js.map +0 -7
- package/dist/components/TabbedListView/ScrollableList.js +0 -117
- package/dist/components/TabbedListView/ScrollableList.js.map +0 -7
- package/dist/components/TabbedListView/SearchInput.js +0 -23
- package/dist/components/TabbedListView/SearchInput.js.map +0 -7
- package/dist/components/TabbedListView/TabBar.js +0 -25
- package/dist/components/TabbedListView/TabBar.js.map +0 -7
- package/dist/components/TabbedListView/TabbedListView.js +0 -292
- package/dist/components/TabbedListView/TabbedListView.js.map +0 -7
- package/dist/components/TabbedListView/index.js +0 -11
- package/dist/components/TabbedListView/index.js.map +0 -7
- package/dist/components/TabbedListView/types.js +0 -1
- package/dist/components/TabbedListView/types.js.map +0 -7
- package/dist/components/TaskCard.js +0 -176
- package/dist/components/TaskCard.js.map +0 -7
- package/dist/components/TeamMemberPanel.js +0 -107
- package/dist/components/TeamMemberPanel.js.map +0 -7
- package/dist/components/TextInput.js +0 -108
- package/dist/components/TextInput.js.map +0 -7
- package/dist/components/ThinkingSelector.js +0 -84
- package/dist/components/ThinkingSelector.js.map +0 -7
- package/dist/components/TimelineRenderer.js +0 -31
- package/dist/components/TimelineRenderer.js.map +0 -7
- package/dist/components/TitledDivider.js +0 -26
- package/dist/components/TitledDivider.js.map +0 -7
- package/dist/components/TodoChangeBlock.js +0 -30
- package/dist/components/TodoChangeBlock.js.map +0 -7
- package/dist/components/TodoChangeLine.js +0 -22
- package/dist/components/TodoChangeLine.js.map +0 -7
- package/dist/components/TodoItem.js +0 -35
- package/dist/components/TodoItem.js.map +0 -7
- package/dist/components/TodoPanel.js +0 -167
- package/dist/components/TodoPanel.js.map +0 -7
- package/dist/components/TokenCounter.js +0 -74
- package/dist/components/TokenCounter.js.map +0 -7
- package/dist/components/TokenWarning.js +0 -41
- package/dist/components/TokenWarning.js.map +0 -7
- package/dist/components/ToolExecutionBlock.js +0 -18
- package/dist/components/ToolExecutionBlock.js.map +0 -7
- package/dist/components/ToolUseLoader.js +0 -29
- package/dist/components/ToolUseLoader.js.map +0 -7
- package/dist/components/TreeConnector.js +0 -26
- package/dist/components/TreeConnector.js.map +0 -7
- package/dist/components/TrustDialog.js +0 -71
- package/dist/components/TrustDialog.js.map +0 -7
- package/dist/components/TurnCompletionIndicator.js +0 -18
- package/dist/components/TurnCompletionIndicator.js.map +0 -7
- package/dist/components/UserQueryBlock.js +0 -12
- package/dist/components/UserQueryBlock.js.map +0 -7
- package/dist/components/binary-feedback/BinaryFeedback.js +0 -50
- package/dist/components/binary-feedback/BinaryFeedback.js.map +0 -7
- package/dist/components/binary-feedback/BinaryFeedbackOption.js +0 -92
- package/dist/components/binary-feedback/BinaryFeedbackOption.js.map +0 -7
- package/dist/components/binary-feedback/BinaryFeedbackView.js +0 -140
- package/dist/components/binary-feedback/BinaryFeedbackView.js.map +0 -7
- package/dist/components/binary-feedback/utils.js +0 -108
- package/dist/components/binary-feedback/utils.js.map +0 -7
- package/dist/components/messages/AssistantBashOutputMessage.js +0 -23
- package/dist/components/messages/AssistantBashOutputMessage.js.map +0 -7
- package/dist/components/messages/AssistantLocalCommandOutputMessage.js +0 -36
- package/dist/components/messages/AssistantLocalCommandOutputMessage.js.map +0 -7
- package/dist/components/messages/AssistantRedactedThinkingMessage.js +0 -12
- package/dist/components/messages/AssistantRedactedThinkingMessage.js.map +0 -7
- package/dist/components/messages/AssistantTextMessage.js +0 -92
- package/dist/components/messages/AssistantTextMessage.js.map +0 -7
- package/dist/components/messages/AssistantThinkingMessage.js +0 -42
- package/dist/components/messages/AssistantThinkingMessage.js.map +0 -7
- package/dist/components/messages/AssistantToolUseMessage.js +0 -108
- package/dist/components/messages/AssistantToolUseMessage.js.map +0 -7
- package/dist/components/messages/DefaultToolResultFallback.js +0 -11
- package/dist/components/messages/DefaultToolResultFallback.js.map +0 -7
- package/dist/components/messages/GroupRenderer.js +0 -54
- package/dist/components/messages/GroupRenderer.js.map +0 -7
- package/dist/components/messages/NestedTasksPreview.js +0 -24
- package/dist/components/messages/NestedTasksPreview.js.map +0 -7
- package/dist/components/messages/ParallelTasksGroupView.js +0 -101
- package/dist/components/messages/ParallelTasksGroupView.js.map +0 -7
- package/dist/components/messages/TaskInModuleView.js +0 -218
- package/dist/components/messages/TaskInModuleView.js.map +0 -7
- package/dist/components/messages/TaskOutputContent.js +0 -56
- package/dist/components/messages/TaskOutputContent.js.map +0 -7
- package/dist/components/messages/TaskProgressMessage.js +0 -11
- package/dist/components/messages/TaskProgressMessage.js.map +0 -7
- package/dist/components/messages/TaskToolMessage.js +0 -39
- package/dist/components/messages/TaskToolMessage.js.map +0 -7
- package/dist/components/messages/UserBashInputMessage.js +0 -18
- package/dist/components/messages/UserBashInputMessage.js.map +0 -7
- package/dist/components/messages/UserCommandMessage.js +0 -20
- package/dist/components/messages/UserCommandMessage.js.map +0 -7
- package/dist/components/messages/UserGuidanceMessage.js +0 -26
- package/dist/components/messages/UserGuidanceMessage.js.map +0 -7
- package/dist/components/messages/UserKodingInputMessage.js +0 -18
- package/dist/components/messages/UserKodingInputMessage.js.map +0 -7
- package/dist/components/messages/UserPromptMessage.js +0 -26
- package/dist/components/messages/UserPromptMessage.js.map +0 -7
- package/dist/components/messages/UserTeamNotificationMessage.js +0 -91
- package/dist/components/messages/UserTeamNotificationMessage.js.map +0 -7
- package/dist/components/messages/UserTextMessage.js +0 -33
- package/dist/components/messages/UserTextMessage.js.map +0 -7
- package/dist/components/messages/UserToolResultMessage/UserToolCanceledMessage.js +0 -11
- package/dist/components/messages/UserToolResultMessage/UserToolCanceledMessage.js.map +0 -7
- package/dist/components/messages/UserToolResultMessage/UserToolErrorMessage.js +0 -15
- package/dist/components/messages/UserToolResultMessage/UserToolErrorMessage.js.map +0 -7
- package/dist/components/messages/UserToolResultMessage/UserToolRejectMessage.js +0 -27
- package/dist/components/messages/UserToolResultMessage/UserToolRejectMessage.js.map +0 -7
- package/dist/components/messages/UserToolResultMessage/UserToolResultMessage.js +0 -64
- package/dist/components/messages/UserToolResultMessage/UserToolResultMessage.js.map +0 -7
- package/dist/components/messages/UserToolResultMessage/UserToolSuccessMessage.js +0 -33
- package/dist/components/messages/UserToolResultMessage/UserToolSuccessMessage.js.map +0 -7
- package/dist/components/messages/UserToolResultMessage/utils.js +0 -50
- package/dist/components/messages/UserToolResultMessage/utils.js.map +0 -7
- package/dist/components/permissions/BashPermissionRequest/BashPermissionRequest.js +0 -112
- package/dist/components/permissions/BashPermissionRequest/BashPermissionRequest.js.map +0 -7
- package/dist/components/permissions/FallbackPermissionRequest.js +0 -131
- package/dist/components/permissions/FallbackPermissionRequest.js.map +0 -7
- package/dist/components/permissions/FileEditPermissionRequest/FileEditPermissionRequest.js +0 -159
- package/dist/components/permissions/FileEditPermissionRequest/FileEditPermissionRequest.js.map +0 -7
- package/dist/components/permissions/FileEditPermissionRequest/FileEditToolDiff.js +0 -58
- package/dist/components/permissions/FileEditPermissionRequest/FileEditToolDiff.js.map +0 -7
- package/dist/components/permissions/FileWritePermissionRequest/FileWritePermissionRequest.js +0 -153
- package/dist/components/permissions/FileWritePermissionRequest/FileWritePermissionRequest.js.map +0 -7
- package/dist/components/permissions/FileWritePermissionRequest/FileWriteToolDiff.js +0 -70
- package/dist/components/permissions/FileWritePermissionRequest/FileWriteToolDiff.js.map +0 -7
- package/dist/components/permissions/FilesystemPermissionRequest/FilesystemPermissionRequest.js +0 -212
- package/dist/components/permissions/FilesystemPermissionRequest/FilesystemPermissionRequest.js.map +0 -7
- package/dist/components/permissions/PermissionRequest.js +0 -74
- package/dist/components/permissions/PermissionRequest.js.map +0 -7
- package/dist/components/permissions/PermissionRequestTitle.js +0 -52
- package/dist/components/permissions/PermissionRequestTitle.js.map +0 -7
- package/dist/components/permissions/PlanApprovalRequest.js +0 -164
- package/dist/components/permissions/PlanApprovalRequest.js.map +0 -7
- package/dist/components/permissions/hooks.js +0 -23
- package/dist/components/permissions/hooks.js.map +0 -7
- package/dist/components/permissions/toolUseOptions.js +0 -46
- package/dist/components/permissions/toolUseOptions.js.map +0 -7
- package/dist/components/permissions/utils.js +0 -21
- package/dist/components/permissions/utils.js.map +0 -7
- package/dist/constants/agentTeams.js +0 -17
- package/dist/constants/agentTeams.js.map +0 -7
- package/dist/constants/claude-asterisk-ascii-art.js +0 -242
- package/dist/constants/claude-asterisk-ascii-art.js.map +0 -7
- package/dist/constants/colors.js +0 -192
- package/dist/constants/colors.js.map +0 -7
- package/dist/constants/compressionPrompts.js +0 -73
- package/dist/constants/compressionPrompts.js.map +0 -7
- package/dist/constants/figures.js +0 -6
- package/dist/constants/figures.js.map +0 -7
- package/dist/constants/formatRules.js +0 -102
- package/dist/constants/formatRules.js.map +0 -7
- package/dist/constants/macros.js +0 -12
- package/dist/constants/macros.js.map +0 -7
- package/dist/constants/modelCapabilities.js +0 -239
- package/dist/constants/modelCapabilities.js.map +0 -7
- package/dist/constants/models.js +0 -1034
- package/dist/constants/models.js.map +0 -7
- package/dist/constants/oauth.js +0 -18
- package/dist/constants/oauth.js.map +0 -7
- package/dist/constants/product.js +0 -28
- package/dist/constants/product.js.map +0 -7
- package/dist/constants/prompts/agentPrompt.js +0 -31
- package/dist/constants/prompts/agentPrompt.js.map +0 -7
- package/dist/constants/prompts/autoMemory.js +0 -39
- package/dist/constants/prompts/autoMemory.js.map +0 -7
- package/dist/constants/prompts/codeConventions.js +0 -15
- package/dist/constants/prompts/codeConventions.js.map +0 -7
- package/dist/constants/prompts/doingTasks.js +0 -34
- package/dist/constants/prompts/doingTasks.js.map +0 -7
- package/dist/constants/prompts/envInfo.js +0 -16
- package/dist/constants/prompts/envInfo.js.map +0 -7
- package/dist/constants/prompts/executingWithCare.js +0 -17
- package/dist/constants/prompts/executingWithCare.js.map +0 -7
- package/dist/constants/prompts/identity.js +0 -10
- package/dist/constants/prompts/identity.js.map +0 -7
- package/dist/constants/prompts/index.js +0 -100
- package/dist/constants/prompts/index.js.map +0 -7
- package/dist/constants/prompts/taskManagement.js +0 -19
- package/dist/constants/prompts/taskManagement.js.map +0 -7
- package/dist/constants/prompts/teamOverlays.js +0 -50
- package/dist/constants/prompts/teamOverlays.js.map +0 -7
- package/dist/constants/prompts/toneAndStyle.js +0 -37
- package/dist/constants/prompts/toneAndStyle.js.map +0 -7
- package/dist/constants/prompts/toolUsagePolicy.js +0 -23
- package/dist/constants/prompts/toolUsagePolicy.js.map +0 -7
- package/dist/constants/prompts.js +0 -13
- package/dist/constants/prompts.js.map +0 -7
- package/dist/constants/providerRegistry.js +0 -235
- package/dist/constants/providerRegistry.js.map +0 -7
- package/dist/constants/providers.js +0 -35
- package/dist/constants/providers.js.map +0 -7
- package/dist/constants/releaseNotes.js +0 -9
- package/dist/constants/releaseNotes.js.map +0 -7
- package/dist/constants/symbols.js +0 -108
- package/dist/constants/symbols.js.map +0 -7
- package/dist/constants/timing.js +0 -39
- package/dist/constants/timing.js.map +0 -7
- package/dist/constants/toolInputExamples.js +0 -88
- package/dist/constants/toolInputExamples.js.map +0 -7
- package/dist/context/PermissionContext.js +0 -110
- package/dist/context/PermissionContext.js.map +0 -7
- package/dist/context.js +0 -367
- package/dist/context.js.map +0 -7
- package/dist/core/backupHook.js +0 -29
- package/dist/core/backupHook.js.map +0 -7
- package/dist/core/backupManager.js +0 -321
- package/dist/core/backupManager.js.map +0 -7
- package/dist/core/config/defaults.js +0 -93
- package/dist/core/config/defaults.js.map +0 -7
- package/dist/core/config/index.js +0 -111
- package/dist/core/config/index.js.map +0 -7
- package/dist/core/config/loader.js +0 -221
- package/dist/core/config/loader.js.map +0 -7
- package/dist/core/config/migrations.js +0 -128
- package/dist/core/config/migrations.js.map +0 -7
- package/dist/core/config/schema.js +0 -196
- package/dist/core/config/schema.js.map +0 -7
- package/dist/core/costTracker.js +0 -131
- package/dist/core/costTracker.js.map +0 -7
- package/dist/core/gitAutoCommit.js +0 -287
- package/dist/core/gitAutoCommit.js.map +0 -7
- package/dist/core/index.js +0 -7
- package/dist/core/index.js.map +0 -7
- package/dist/core/operationTracker.js +0 -212
- package/dist/core/operationTracker.js.map +0 -7
- package/dist/core/permissions/auditLog.js +0 -204
- package/dist/core/permissions/auditLog.js.map +0 -7
- package/dist/core/permissions/engine/index.js +0 -3
- package/dist/core/permissions/engine/index.js.map +0 -7
- package/dist/core/permissions/engine/permissionEngine.js +0 -106
- package/dist/core/permissions/engine/permissionEngine.js.map +0 -7
- package/dist/core/permissions/engine/types.js +0 -1
- package/dist/core/permissions/engine/types.js.map +0 -7
- package/dist/core/permissions/index.js +0 -84
- package/dist/core/permissions/index.js.map +0 -7
- package/dist/core/permissions/ruleEngine.js +0 -259
- package/dist/core/permissions/ruleEngine.js.map +0 -7
- package/dist/core/permissions/rules/allowedToolsRule.js +0 -62
- package/dist/core/permissions/rules/allowedToolsRule.js.map +0 -7
- package/dist/core/permissions/rules/autoEscalationRule.js +0 -296
- package/dist/core/permissions/rules/autoEscalationRule.js.map +0 -7
- package/dist/core/permissions/rules/index.js +0 -46
- package/dist/core/permissions/rules/index.js.map +0 -7
- package/dist/core/permissions/rules/planModeRule.js +0 -55
- package/dist/core/permissions/rules/planModeRule.js.map +0 -7
- package/dist/core/permissions/rules/projectBoundaryRule.js +0 -173
- package/dist/core/permissions/rules/projectBoundaryRule.js.map +0 -7
- package/dist/core/permissions/rules/safeModeRule.js +0 -65
- package/dist/core/permissions/rules/safeModeRule.js.map +0 -7
- package/dist/core/permissions/rules/sensitivePathsRule.js +0 -345
- package/dist/core/permissions/rules/sensitivePathsRule.js.map +0 -7
- package/dist/core/permissions/types.js +0 -127
- package/dist/core/permissions/types.js.map +0 -7
- package/dist/core/tokenStats.js +0 -9
- package/dist/core/tokenStats.js.map +0 -7
- package/dist/core/tokenStatsManager.js +0 -354
- package/dist/core/tokenStatsManager.js.map +0 -7
- package/dist/core/tools/executor.js +0 -143
- package/dist/core/tools/executor.js.map +0 -7
- package/dist/core/tools/index.js +0 -15
- package/dist/core/tools/index.js.map +0 -7
- package/dist/core/tools/registry.js +0 -183
- package/dist/core/tools/registry.js.map +0 -7
- package/dist/core/tools/types.js +0 -1
- package/dist/core/tools/types.js.map +0 -7
- package/dist/cost-tracker.js +0 -68
- package/dist/cost-tracker.js.map +0 -7
- package/dist/engine/AgentEngine.js +0 -902
- package/dist/engine/AgentEngine.js.map +0 -7
- package/dist/engine/EngineRegistry.js +0 -89
- package/dist/engine/EngineRegistry.js.map +0 -7
- package/dist/engine/foregroundAdapter.js +0 -191
- package/dist/engine/foregroundAdapter.js.map +0 -7
- package/dist/engine/index.js +0 -15
- package/dist/engine/index.js.map +0 -7
- package/dist/engine/types.js +0 -1
- package/dist/engine/types.js.map +0 -7
- package/dist/entrypoints/bootstrap.js +0 -56
- package/dist/entrypoints/bootstrap.js.map +0 -7
- package/dist/entrypoints/cli.js +0 -1721
- package/dist/entrypoints/cli.js.map +0 -7
- package/dist/entrypoints/mcp.js +0 -153
- package/dist/entrypoints/mcp.js.map +0 -7
- package/dist/history.js +0 -96
- package/dist/history.js.map +0 -7
- package/dist/hooks/useAgentEngine.js +0 -129
- package/dist/hooks/useAgentEngine.js.map +0 -7
- package/dist/hooks/useAgentTokenStats.js +0 -56
- package/dist/hooks/useAgentTokenStats.js.map +0 -7
- package/dist/hooks/useAgentTranscripts.js +0 -141
- package/dist/hooks/useAgentTranscripts.js.map +0 -7
- package/dist/hooks/useAnimationSync.js +0 -53
- package/dist/hooks/useAnimationSync.js.map +0 -7
- package/dist/hooks/useApiKeyVerification.js +0 -12
- package/dist/hooks/useApiKeyVerification.js.map +0 -7
- package/dist/hooks/useArrowKeyHistory.js +0 -52
- package/dist/hooks/useArrowKeyHistory.js.map +0 -7
- package/dist/hooks/useAskUser.js +0 -24
- package/dist/hooks/useAskUser.js.map +0 -7
- package/dist/hooks/useBackgroundShells.js +0 -29
- package/dist/hooks/useBackgroundShells.js.map +0 -7
- package/dist/hooks/useCanUseTool.js +0 -134
- package/dist/hooks/useCanUseTool.js.map +0 -7
- package/dist/hooks/useDeferredLoading.js +0 -67
- package/dist/hooks/useDeferredLoading.js.map +0 -7
- package/dist/hooks/useDoublePress.js +0 -31
- package/dist/hooks/useDoublePress.js.map +0 -7
- package/dist/hooks/useExitOnCtrlCD.js +0 -30
- package/dist/hooks/useExitOnCtrlCD.js.map +0 -7
- package/dist/hooks/useHistorySearch.js +0 -62
- package/dist/hooks/useHistorySearch.js.map +0 -7
- package/dist/hooks/useHookStatus.js +0 -40
- package/dist/hooks/useHookStatus.js.map +0 -7
- package/dist/hooks/useIdleNotifications.js +0 -66
- package/dist/hooks/useIdleNotifications.js.map +0 -7
- package/dist/hooks/useInterval.js +0 -18
- package/dist/hooks/useInterval.js.map +0 -7
- package/dist/hooks/useLogMessages.js +0 -41
- package/dist/hooks/useLogMessages.js.map +0 -7
- package/dist/hooks/useLogStartupTime.js +0 -10
- package/dist/hooks/useLogStartupTime.js.map +0 -7
- package/dist/hooks/useMessageGroups.js +0 -43
- package/dist/hooks/useMessageGroups.js.map +0 -7
- package/dist/hooks/useNotifyAfterTimeout.js +0 -42
- package/dist/hooks/useNotifyAfterTimeout.js.map +0 -7
- package/dist/hooks/usePermissionRequestLogging.js +0 -23
- package/dist/hooks/usePermissionRequestLogging.js.map +0 -7
- package/dist/hooks/useSessionTracking.js +0 -57
- package/dist/hooks/useSessionTracking.js.map +0 -7
- package/dist/hooks/useTeamMembers.js +0 -51
- package/dist/hooks/useTeamMembers.js.map +0 -7
- package/dist/hooks/useTerminalSize.js +0 -115
- package/dist/hooks/useTerminalSize.js.map +0 -7
- package/dist/hooks/useTextInput.js +0 -253
- package/dist/hooks/useTextInput.js.map +0 -7
- package/dist/hooks/useUnifiedCompletion.js +0 -1098
- package/dist/hooks/useUnifiedCompletion.js.map +0 -7
- package/dist/i18n/index.js +0 -109
- package/dist/i18n/index.js.map +0 -7
- package/dist/i18n/locales/en.js +0 -993
- package/dist/i18n/locales/en.js.map +0 -7
- package/dist/i18n/locales/index.js +0 -7
- package/dist/i18n/locales/index.js.map +0 -7
- package/dist/i18n/locales/zh-CN.js +0 -993
- package/dist/i18n/locales/zh-CN.js.map +0 -7
- package/dist/i18n/types.js +0 -8
- package/dist/i18n/types.js.map +0 -7
- package/dist/index.js +0 -5
- package/dist/index.js.map +0 -7
- package/dist/messages.js +0 -68
- package/dist/messages.js.map +0 -7
- package/dist/package.json +0 -4
- package/dist/permissions.js +0 -536
- package/dist/permissions.js.map +0 -7
- package/dist/query.js +0 -851
- package/dist/query.js.map +0 -7
- package/dist/screens/LogList.js +0 -55
- package/dist/screens/LogList.js.map +0 -7
- package/dist/screens/REPL.js +0 -1240
- package/dist/screens/REPL.js.map +0 -7
- package/dist/screens/ResumeConversation.js +0 -244
- package/dist/screens/ResumeConversation.js.map +0 -7
- package/dist/services/adapters/base.js +0 -29
- package/dist/services/adapters/base.js.map +0 -7
- package/dist/services/adapters/chatCompletions.js +0 -71
- package/dist/services/adapters/chatCompletions.js.map +0 -7
- package/dist/services/adapters/messageNormalizer.js +0 -354
- package/dist/services/adapters/messageNormalizer.js.map +0 -7
- package/dist/services/adapters/responsesAPI.js +0 -137
- package/dist/services/adapters/responsesAPI.js.map +0 -7
- package/dist/services/agentTeams/backends/headless.js +0 -108
- package/dist/services/agentTeams/backends/headless.js.map +0 -7
- package/dist/services/agentTeams/backends/inProcess.js +0 -102
- package/dist/services/agentTeams/backends/inProcess.js.map +0 -7
- package/dist/services/agentTeams/backends/resolver.js +0 -18
- package/dist/services/agentTeams/backends/resolver.js.map +0 -7
- package/dist/services/agentTeams/backends/tmux.js +0 -168
- package/dist/services/agentTeams/backends/tmux.js.map +0 -7
- package/dist/services/agentTeams/backends/types.js +0 -1
- package/dist/services/agentTeams/backends/types.js.map +0 -7
- package/dist/services/agentTeams/heartbeat.js +0 -88
- package/dist/services/agentTeams/heartbeat.js.map +0 -7
- package/dist/services/agentTeams/index.js +0 -75
- package/dist/services/agentTeams/index.js.map +0 -7
- package/dist/services/agentTeams/injectionChannel.js +0 -105
- package/dist/services/agentTeams/injectionChannel.js.map +0 -7
- package/dist/services/agentTeams/mailbox.js +0 -494
- package/dist/services/agentTeams/mailbox.js.map +0 -7
- package/dist/services/agentTeams/messageFormatter.js +0 -80
- package/dist/services/agentTeams/messageFormatter.js.map +0 -7
- package/dist/services/agentTeams/permissionDelegation.js +0 -71
- package/dist/services/agentTeams/permissionDelegation.js.map +0 -7
- package/dist/services/agentTeams/teamEvents.js +0 -45
- package/dist/services/agentTeams/teamEvents.js.map +0 -7
- package/dist/services/agentTeams/teamManager.js +0 -366
- package/dist/services/agentTeams/teamManager.js.map +0 -7
- package/dist/services/agentTeams/teamTaskStore.js +0 -343
- package/dist/services/agentTeams/teamTaskStore.js.map +0 -7
- package/dist/services/agentTeams/teammateSpawner.js +0 -161
- package/dist/services/agentTeams/teammateSpawner.js.map +0 -7
- package/dist/services/checkpointManager.js +0 -399
- package/dist/services/checkpointManager.js.map +0 -7
- package/dist/services/claude.js +0 -41
- package/dist/services/claude.js.map +0 -7
- package/dist/services/compressionService.js +0 -259
- package/dist/services/compressionService.js.map +0 -7
- package/dist/services/contextMonitor.js +0 -162
- package/dist/services/contextMonitor.js.map +0 -7
- package/dist/services/customCommands.js +0 -489
- package/dist/services/customCommands.js.map +0 -7
- package/dist/services/fileFreshness.js +0 -275
- package/dist/services/fileFreshness.js.map +0 -7
- package/dist/services/gpt5ConnectionTest.js +0 -263
- package/dist/services/gpt5ConnectionTest.js.map +0 -7
- package/dist/services/hookExecutor.js +0 -771
- package/dist/services/hookExecutor.js.map +0 -7
- package/dist/services/intelligentCompactor.js +0 -281
- package/dist/services/intelligentCompactor.js.map +0 -7
- package/dist/services/llm/anthropicProvider.js +0 -804
- package/dist/services/llm/anthropicProvider.js.map +0 -7
- package/dist/services/llm/dispatch.js +0 -237
- package/dist/services/llm/dispatch.js.map +0 -7
- package/dist/services/llm/index.js +0 -44
- package/dist/services/llm/index.js.map +0 -7
- package/dist/services/llm/mintoContext.js +0 -69
- package/dist/services/llm/mintoContext.js.map +0 -7
- package/dist/services/llm/openaiProvider.js +0 -601
- package/dist/services/llm/openaiProvider.js.map +0 -7
- package/dist/services/llm/types.js +0 -231
- package/dist/services/llm/types.js.map +0 -7
- package/dist/services/lspConfig.js +0 -109
- package/dist/services/lspConfig.js.map +0 -7
- package/dist/services/mainAgentCompressor.js +0 -84
- package/dist/services/mainAgentCompressor.js.map +0 -7
- package/dist/services/mcpClient.js +0 -997
- package/dist/services/mcpClient.js.map +0 -7
- package/dist/services/mcpServerApproval.js +0 -55
- package/dist/services/mcpServerApproval.js.map +0 -7
- package/dist/services/mentionProcessor.js +0 -214
- package/dist/services/mentionProcessor.js.map +0 -7
- package/dist/services/mintoAuth.js +0 -299
- package/dist/services/mintoAuth.js.map +0 -7
- package/dist/services/modelAdapterFactory.js +0 -47
- package/dist/services/modelAdapterFactory.js.map +0 -7
- package/dist/services/modelOrchestrator.js +0 -310
- package/dist/services/modelOrchestrator.js.map +0 -7
- package/dist/services/notifier.js +0 -49
- package/dist/services/notifier.js.map +0 -7
- package/dist/services/oauth.js +0 -249
- package/dist/services/oauth.js.map +0 -7
- package/dist/services/openai.js +0 -1120
- package/dist/services/openai.js.map +0 -7
- package/dist/services/outputStyles.js +0 -219
- package/dist/services/outputStyles.js.map +0 -7
- package/dist/services/plugins/index.js +0 -5
- package/dist/services/plugins/index.js.map +0 -7
- package/dist/services/plugins/lspServers.js +0 -188
- package/dist/services/plugins/lspServers.js.map +0 -7
- package/dist/services/plugins/pluginRuntime.js +0 -236
- package/dist/services/plugins/pluginRuntime.js.map +0 -7
- package/dist/services/plugins/pluginValidation.js +0 -228
- package/dist/services/plugins/pluginValidation.js.map +0 -7
- package/dist/services/plugins/skillMarketplace.js +0 -567
- package/dist/services/plugins/skillMarketplace.js.map +0 -7
- package/dist/services/responseStateManager.js +0 -102
- package/dist/services/responseStateManager.js.map +0 -7
- package/dist/services/sandbox/filesystemBoundary.js +0 -341
- package/dist/services/sandbox/filesystemBoundary.js.map +0 -7
- package/dist/services/sandbox/index.js +0 -14
- package/dist/services/sandbox/index.js.map +0 -7
- package/dist/services/sandbox/networkProxy.js +0 -293
- package/dist/services/sandbox/networkProxy.js.map +0 -7
- package/dist/services/sandbox/sandboxController.js +0 -582
- package/dist/services/sandbox/sandboxController.js.map +0 -7
- package/dist/services/sandbox/types.js +0 -50
- package/dist/services/sandbox/types.js.map +0 -7
- package/dist/services/sentry.js +0 -9
- package/dist/services/sentry.js.map +0 -7
- package/dist/services/sessionMemory.js +0 -279
- package/dist/services/sessionMemory.js.map +0 -7
- package/dist/services/sessionMemoryInjector.js +0 -77
- package/dist/services/sessionMemoryInjector.js.map +0 -7
- package/dist/services/subagentAbortManager.js +0 -95
- package/dist/services/subagentAbortManager.js.map +0 -7
- package/dist/services/subagentCompressor.js +0 -146
- package/dist/services/subagentCompressor.js.map +0 -7
- package/dist/services/systemReminder.js +0 -815
- package/dist/services/systemReminder.js.map +0 -7
- package/dist/services/taskRouter.js +0 -324
- package/dist/services/taskRouter.js.map +0 -7
- package/dist/services/taskStore.js +0 -415
- package/dist/services/taskStore.js.map +0 -7
- package/dist/services/topicDetector.js +0 -169
- package/dist/services/topicDetector.js.map +0 -7
- package/dist/services/vcr.js +0 -133
- package/dist/services/vcr.js.map +0 -7
- package/dist/tools/ArchitectTool/ArchitectTool.js +0 -126
- package/dist/tools/ArchitectTool/ArchitectTool.js.map +0 -7
- package/dist/tools/ArchitectTool/prompt.js +0 -18
- package/dist/tools/ArchitectTool/prompt.js.map +0 -7
- package/dist/tools/AskExpertModelTool/AskExpertModelTool.js +0 -420
- package/dist/tools/AskExpertModelTool/AskExpertModelTool.js.map +0 -7
- package/dist/tools/AskUserQuestionTool/AskUserQuestionTool.js +0 -158
- package/dist/tools/AskUserQuestionTool/AskUserQuestionTool.js.map +0 -7
- package/dist/tools/AskUserQuestionTool/index.js +0 -5
- package/dist/tools/AskUserQuestionTool/index.js.map +0 -7
- package/dist/tools/AskUserQuestionTool/prompt.js +0 -167
- package/dist/tools/AskUserQuestionTool/prompt.js.map +0 -7
- package/dist/tools/BaseTool.js +0 -72
- package/dist/tools/BaseTool.js.map +0 -7
- package/dist/tools/BashOutputTool/BashOutputTool.js +0 -120
- package/dist/tools/BashOutputTool/BashOutputTool.js.map +0 -7
- package/dist/tools/BashOutputTool/BashOutputToolResultMessage.js +0 -14
- package/dist/tools/BashOutputTool/BashOutputToolResultMessage.js.map +0 -7
- package/dist/tools/BashOutputTool/prompt.js +0 -13
- package/dist/tools/BashOutputTool/prompt.js.map +0 -7
- package/dist/tools/BashTool/BashTool.js +0 -353
- package/dist/tools/BashTool/BashTool.js.map +0 -7
- package/dist/tools/BashTool/BashToolResultMessage.js +0 -24
- package/dist/tools/BashTool/BashToolResultMessage.js.map +0 -7
- package/dist/tools/BashTool/OutputLine.js +0 -84
- package/dist/tools/BashTool/OutputLine.js.map +0 -7
- package/dist/tools/BashTool/prompt.js +0 -496
- package/dist/tools/BashTool/prompt.js.map +0 -7
- package/dist/tools/BashTool/utils.js +0 -89
- package/dist/tools/BashTool/utils.js.map +0 -7
- package/dist/tools/EnterWorktreeTool/EnterWorktreeTool.js +0 -121
- package/dist/tools/EnterWorktreeTool/EnterWorktreeTool.js.map +0 -7
- package/dist/tools/EnterWorktreeTool/prompt.js +0 -22
- package/dist/tools/EnterWorktreeTool/prompt.js.map +0 -7
- package/dist/tools/FileEditTool/FileEditTool.js +0 -278
- package/dist/tools/FileEditTool/FileEditTool.js.map +0 -7
- package/dist/tools/FileEditTool/prompt.js +0 -56
- package/dist/tools/FileEditTool/prompt.js.map +0 -7
- package/dist/tools/FileEditTool/utils.js +0 -48
- package/dist/tools/FileEditTool/utils.js.map +0 -7
- package/dist/tools/FileReadTool/FileReadTool.js +0 -427
- package/dist/tools/FileReadTool/FileReadTool.js.map +0 -7
- package/dist/tools/FileReadTool/prompt.js +0 -24
- package/dist/tools/FileReadTool/prompt.js.map +0 -7
- package/dist/tools/FileWriteTool/FileWriteTool.js +0 -211
- package/dist/tools/FileWriteTool/FileWriteTool.js.map +0 -7
- package/dist/tools/FileWriteTool/prompt.js +0 -21
- package/dist/tools/FileWriteTool/prompt.js.map +0 -7
- package/dist/tools/GlobTool/GlobTool.js +0 -100
- package/dist/tools/GlobTool/GlobTool.js.map +0 -7
- package/dist/tools/GlobTool/prompt.js +0 -23
- package/dist/tools/GlobTool/prompt.js.map +0 -7
- package/dist/tools/GrepTool/GrepTool.js +0 -417
- package/dist/tools/GrepTool/GrepTool.js.map +0 -7
- package/dist/tools/GrepTool/prompt.js +0 -22
- package/dist/tools/GrepTool/prompt.js.map +0 -7
- package/dist/tools/KillShellTool/KillShellTool.js +0 -92
- package/dist/tools/KillShellTool/KillShellTool.js.map +0 -7
- package/dist/tools/KillShellTool/KillShellToolResultMessage.js +0 -14
- package/dist/tools/KillShellTool/KillShellToolResultMessage.js.map +0 -7
- package/dist/tools/KillShellTool/prompt.js +0 -12
- package/dist/tools/KillShellTool/prompt.js.map +0 -7
- package/dist/tools/ListMcpResourcesTool/ListMcpResourcesTool.js +0 -109
- package/dist/tools/ListMcpResourcesTool/ListMcpResourcesTool.js.map +0 -7
- package/dist/tools/ListMcpResourcesTool/prompt.js +0 -19
- package/dist/tools/ListMcpResourcesTool/prompt.js.map +0 -7
- package/dist/tools/LspTool/LspTool.js +0 -673
- package/dist/tools/LspTool/LspTool.js.map +0 -7
- package/dist/tools/LspTool/prompt.js +0 -27
- package/dist/tools/LspTool/prompt.js.map +0 -7
- package/dist/tools/MCPSearchTool/MCPSearchTool.js +0 -172
- package/dist/tools/MCPSearchTool/MCPSearchTool.js.map +0 -7
- package/dist/tools/MCPSearchTool/prompt.js +0 -77
- package/dist/tools/MCPSearchTool/prompt.js.map +0 -7
- package/dist/tools/MCPTool/MCPTool.js +0 -97
- package/dist/tools/MCPTool/MCPTool.js.map +0 -7
- package/dist/tools/MCPTool/prompt.js +0 -7
- package/dist/tools/MCPTool/prompt.js.map +0 -7
- package/dist/tools/MemoryReadTool/MemoryReadTool.js +0 -117
- package/dist/tools/MemoryReadTool/MemoryReadTool.js.map +0 -7
- package/dist/tools/MemoryReadTool/prompt.js +0 -7
- package/dist/tools/MemoryReadTool/prompt.js.map +0 -7
- package/dist/tools/MemoryWriteTool/MemoryWriteTool.js +0 -78
- package/dist/tools/MemoryWriteTool/MemoryWriteTool.js.map +0 -7
- package/dist/tools/MemoryWriteTool/prompt.js +0 -7
- package/dist/tools/MemoryWriteTool/prompt.js.map +0 -7
- package/dist/tools/MultiEditTool/MultiEditTool.js +0 -328
- package/dist/tools/MultiEditTool/MultiEditTool.js.map +0 -7
- package/dist/tools/MultiEditTool/prompt.js +0 -47
- package/dist/tools/MultiEditTool/prompt.js.map +0 -7
- package/dist/tools/NotebookEditTool/NotebookEditTool.js +0 -257
- package/dist/tools/NotebookEditTool/NotebookEditTool.js.map +0 -7
- package/dist/tools/NotebookEditTool/prompt.js +0 -7
- package/dist/tools/NotebookEditTool/prompt.js.map +0 -7
- package/dist/tools/NotebookReadTool/NotebookReadTool.js +0 -218
- package/dist/tools/NotebookReadTool/NotebookReadTool.js.map +0 -7
- package/dist/tools/NotebookReadTool/prompt.js +0 -7
- package/dist/tools/NotebookReadTool/prompt.js.map +0 -7
- package/dist/tools/PlanModeTool/EnterPlanModeTool.js +0 -85
- package/dist/tools/PlanModeTool/EnterPlanModeTool.js.map +0 -7
- package/dist/tools/PlanModeTool/ExitPlanModeTool.js +0 -164
- package/dist/tools/PlanModeTool/ExitPlanModeTool.js.map +0 -7
- package/dist/tools/PlanModeTool/prompt.js +0 -43
- package/dist/tools/PlanModeTool/prompt.js.map +0 -7
- package/dist/tools/ReadMcpResourceTool/ReadMcpResourceTool.js +0 -130
- package/dist/tools/ReadMcpResourceTool/ReadMcpResourceTool.js.map +0 -7
- package/dist/tools/ReadMcpResourceTool/prompt.js +0 -17
- package/dist/tools/ReadMcpResourceTool/prompt.js.map +0 -7
- package/dist/tools/SendMessageTool/SendMessageTool.js +0 -341
- package/dist/tools/SendMessageTool/SendMessageTool.js.map +0 -7
- package/dist/tools/SendMessageTool/prompt.js +0 -44
- package/dist/tools/SendMessageTool/prompt.js.map +0 -7
- package/dist/tools/SkillTool/SkillTool.js +0 -227
- package/dist/tools/SkillTool/SkillTool.js.map +0 -7
- package/dist/tools/SkillTool/prompt.js +0 -81
- package/dist/tools/SkillTool/prompt.js.map +0 -7
- package/dist/tools/SlashCommandTool/SlashCommandTool.js +0 -416
- package/dist/tools/SlashCommandTool/SlashCommandTool.js.map +0 -7
- package/dist/tools/SlashCommandTool/prompt.js +0 -35
- package/dist/tools/SlashCommandTool/prompt.js.map +0 -7
- package/dist/tools/TaskCreateTool/TaskCreateTool.js +0 -102
- package/dist/tools/TaskCreateTool/TaskCreateTool.js.map +0 -7
- package/dist/tools/TaskCreateTool/prompt.js +0 -58
- package/dist/tools/TaskCreateTool/prompt.js.map +0 -7
- package/dist/tools/TaskGetTool/TaskGetTool.js +0 -115
- package/dist/tools/TaskGetTool/TaskGetTool.js.map +0 -7
- package/dist/tools/TaskGetTool/prompt.js +0 -28
- package/dist/tools/TaskGetTool/prompt.js.map +0 -7
- package/dist/tools/TaskListTool/TaskListTool.js +0 -102
- package/dist/tools/TaskListTool/TaskListTool.js.map +0 -7
- package/dist/tools/TaskListTool/prompt.js +0 -42
- package/dist/tools/TaskListTool/prompt.js.map +0 -7
- package/dist/tools/TaskOutputTool/TaskOutputTool.js +0 -190
- package/dist/tools/TaskOutputTool/TaskOutputTool.js.map +0 -7
- package/dist/tools/TaskOutputTool/prompt.js +0 -16
- package/dist/tools/TaskOutputTool/prompt.js.map +0 -7
- package/dist/tools/TaskStopTool/TaskStopTool.js +0 -150
- package/dist/tools/TaskStopTool/TaskStopTool.js.map +0 -7
- package/dist/tools/TaskStopTool/prompt.js +0 -15
- package/dist/tools/TaskStopTool/prompt.js.map +0 -7
- package/dist/tools/TaskTool/TaskTool.js +0 -1525
- package/dist/tools/TaskTool/TaskTool.js.map +0 -7
- package/dist/tools/TaskTool/constants.js +0 -11
- package/dist/tools/TaskTool/constants.js.map +0 -7
- package/dist/tools/TaskTool/prompt.js +0 -121
- package/dist/tools/TaskTool/prompt.js.map +0 -7
- package/dist/tools/TaskUpdateTool/TaskUpdateTool.js +0 -148
- package/dist/tools/TaskUpdateTool/TaskUpdateTool.js.map +0 -7
- package/dist/tools/TaskUpdateTool/prompt.js +0 -81
- package/dist/tools/TaskUpdateTool/prompt.js.map +0 -7
- package/dist/tools/TeamCreateTool/TeamCreateTool.js +0 -129
- package/dist/tools/TeamCreateTool/TeamCreateTool.js.map +0 -7
- package/dist/tools/TeamCreateTool/prompt.js +0 -58
- package/dist/tools/TeamCreateTool/prompt.js.map +0 -7
- package/dist/tools/TeamDeleteTool/TeamDeleteTool.js +0 -151
- package/dist/tools/TeamDeleteTool/TeamDeleteTool.js.map +0 -7
- package/dist/tools/TeamDeleteTool/prompt.js +0 -16
- package/dist/tools/TeamDeleteTool/prompt.js.map +0 -7
- package/dist/tools/ThinkTool/ThinkTool.js +0 -45
- package/dist/tools/ThinkTool/ThinkTool.js.map +0 -7
- package/dist/tools/ThinkTool/prompt.js +0 -16
- package/dist/tools/ThinkTool/prompt.js.map +0 -7
- package/dist/tools/TodoWriteTool/TodoWriteTool.js +0 -232
- package/dist/tools/TodoWriteTool/TodoWriteTool.js.map +0 -7
- package/dist/tools/TodoWriteTool/prompt.js +0 -87
- package/dist/tools/TodoWriteTool/prompt.js.map +0 -7
- package/dist/tools/URLFetcherTool/URLFetcherTool.js +0 -234
- package/dist/tools/URLFetcherTool/URLFetcherTool.js.map +0 -7
- package/dist/tools/URLFetcherTool/cache.js +0 -95
- package/dist/tools/URLFetcherTool/cache.js.map +0 -7
- package/dist/tools/URLFetcherTool/htmlToMarkdown.js +0 -44
- package/dist/tools/URLFetcherTool/htmlToMarkdown.js.map +0 -7
- package/dist/tools/URLFetcherTool/prompt.js +0 -28
- package/dist/tools/URLFetcherTool/prompt.js.map +0 -7
- package/dist/tools/WebSearchTool/WebSearchTool.js +0 -92
- package/dist/tools/WebSearchTool/WebSearchTool.js.map +0 -7
- package/dist/tools/WebSearchTool/prompt.js +0 -24
- package/dist/tools/WebSearchTool/prompt.js.map +0 -7
- package/dist/tools/WebSearchTool/searchProviders.js +0 -58
- package/dist/tools/WebSearchTool/searchProviders.js.map +0 -7
- package/dist/tools/lsTool/lsTool.js +0 -201
- package/dist/tools/lsTool/lsTool.js.map +0 -7
- package/dist/tools/lsTool/prompt.js +0 -5
- package/dist/tools/lsTool/prompt.js.map +0 -7
- package/dist/tools.js +0 -207
- package/dist/tools.js.map +0 -7
- package/dist/types/PermissionMode.js +0 -160
- package/dist/types/PermissionMode.js.map +0 -7
- package/dist/types/RequestContext.js +0 -47
- package/dist/types/RequestContext.js.map +0 -7
- package/dist/types/agentTeams.js +0 -1
- package/dist/types/agentTeams.js.map +0 -7
- package/dist/types/askUserQuestion.js +0 -1
- package/dist/types/askUserQuestion.js.map +0 -7
- package/dist/types/common.d.js +0 -1
- package/dist/types/common.d.js.map +0 -7
- package/dist/types/conversation.js +0 -1
- package/dist/types/conversation.js.map +0 -7
- package/dist/types/core.js +0 -1
- package/dist/types/core.js.map +0 -7
- package/dist/types/hooks.js +0 -47
- package/dist/types/hooks.js.map +0 -7
- package/dist/types/interactionRound.js +0 -1
- package/dist/types/interactionRound.js.map +0 -7
- package/dist/types/logs.js +0 -1
- package/dist/types/logs.js.map +0 -7
- package/dist/types/marketplace.js +0 -107
- package/dist/types/marketplace.js.map +0 -7
- package/dist/types/messageGroup.js +0 -36
- package/dist/types/messageGroup.js.map +0 -7
- package/dist/types/modelCapabilities.js +0 -1
- package/dist/types/modelCapabilities.js.map +0 -7
- package/dist/types/notebook.js +0 -1
- package/dist/types/notebook.js.map +0 -7
- package/dist/types/plugin.js +0 -86
- package/dist/types/plugin.js.map +0 -7
- package/dist/types/subagent.js +0 -1
- package/dist/types/subagent.js.map +0 -7
- package/dist/types/thinking.js +0 -1
- package/dist/types/thinking.js.map +0 -7
- package/dist/utils/BackgroundShellManager.js +0 -378
- package/dist/utils/BackgroundShellManager.js.map +0 -7
- package/dist/utils/CircuitBreaker.js +0 -248
- package/dist/utils/CircuitBreaker.js.map +0 -7
- package/dist/utils/Cursor.js +0 -315
- package/dist/utils/Cursor.js.map +0 -7
- package/dist/utils/MessageBatchBuffer.js +0 -102
- package/dist/utils/MessageBatchBuffer.js.map +0 -7
- package/dist/utils/PersistentShell.js +0 -526
- package/dist/utils/PersistentShell.js.map +0 -7
- package/dist/utils/advancedFuzzyMatcher.js +0 -209
- package/dist/utils/advancedFuzzyMatcher.js.map +0 -7
- package/dist/utils/agentHookExecutor.js +0 -103
- package/dist/utils/agentHookExecutor.js.map +0 -7
- package/dist/utils/agentLoader.js +0 -655
- package/dist/utils/agentLoader.js.map +0 -7
- package/dist/utils/agentMemory.js +0 -134
- package/dist/utils/agentMemory.js.map +0 -7
- package/dist/utils/agentStorage.js +0 -59
- package/dist/utils/agentStorage.js.map +0 -7
- package/dist/utils/agentTranscripts.js +0 -641
- package/dist/utils/agentTranscripts.js.map +0 -7
- package/dist/utils/animationManager.js +0 -250
- package/dist/utils/animationManager.js.map +0 -7
- package/dist/utils/animationSync.js +0 -110
- package/dist/utils/animationSync.js.map +0 -7
- package/dist/utils/array.js +0 -7
- package/dist/utils/array.js.map +0 -7
- package/dist/utils/ask.js +0 -80
- package/dist/utils/ask.js.map +0 -7
- package/dist/utils/async.js +0 -167
- package/dist/utils/async.js.map +0 -7
- package/dist/utils/asyncFile.js +0 -215
- package/dist/utils/asyncFile.js.map +0 -7
- package/dist/utils/atomicWrite.js +0 -23
- package/dist/utils/atomicWrite.js.map +0 -7
- package/dist/utils/auth.js +0 -11
- package/dist/utils/auth.js.map +0 -7
- package/dist/utils/autoCompactCore.js +0 -203
- package/dist/utils/autoCompactCore.js.map +0 -7
- package/dist/utils/autoMemoryPaths.js +0 -89
- package/dist/utils/autoMemoryPaths.js.map +0 -7
- package/dist/utils/autoUpdater.js +0 -113
- package/dist/utils/autoUpdater.js.map +0 -7
- package/dist/utils/backgroundAgentManager.js +0 -231
- package/dist/utils/backgroundAgentManager.js.map +0 -7
- package/dist/utils/browser.js +0 -15
- package/dist/utils/browser.js.map +0 -7
- package/dist/utils/claudeCodeSync.js +0 -439
- package/dist/utils/claudeCodeSync.js.map +0 -7
- package/dist/utils/cleanup.js +0 -54
- package/dist/utils/cleanup.js.map +0 -7
- package/dist/utils/commands.js +0 -219
- package/dist/utils/commands.js.map +0 -7
- package/dist/utils/commonUnixCommands.js +0 -689
- package/dist/utils/commonUnixCommands.js.map +0 -7
- package/dist/utils/compressionMode.js +0 -47
- package/dist/utils/compressionMode.js.map +0 -7
- package/dist/utils/config.js +0 -716
- package/dist/utils/config.js.map +0 -7
- package/dist/utils/configPaths.js +0 -199
- package/dist/utils/configPaths.js.map +0 -7
- package/dist/utils/configSchema.js +0 -232
- package/dist/utils/configSchema.js.map +0 -7
- package/dist/utils/conversationRecovery.js +0 -54
- package/dist/utils/conversationRecovery.js.map +0 -7
- package/dist/utils/credentials/CredentialStore.js +0 -1
- package/dist/utils/credentials/CredentialStore.js.map +0 -7
- package/dist/utils/credentials/EncryptedFileStore.js +0 -157
- package/dist/utils/credentials/EncryptedFileStore.js.map +0 -7
- package/dist/utils/credentials/index.js +0 -51
- package/dist/utils/credentials/index.js.map +0 -7
- package/dist/utils/credentials/migration.js +0 -82
- package/dist/utils/credentials/migration.js.map +0 -7
- package/dist/utils/debugLogger.js +0 -889
- package/dist/utils/debugLogger.js.map +0 -7
- package/dist/utils/diff.js +0 -32
- package/dist/utils/diff.js.map +0 -7
- package/dist/utils/dualPath.js +0 -24
- package/dist/utils/dualPath.js.map +0 -7
- package/dist/utils/env.js +0 -45
- package/dist/utils/env.js.map +0 -7
- package/dist/utils/envConfig.js +0 -116
- package/dist/utils/envConfig.js.map +0 -7
- package/dist/utils/errorHandling.js +0 -89
- package/dist/utils/errorHandling.js.map +0 -7
- package/dist/utils/errors.js +0 -23
- package/dist/utils/errors.js.map +0 -7
- package/dist/utils/execFileNoThrow.js +0 -45
- package/dist/utils/execFileNoThrow.js.map +0 -7
- package/dist/utils/exit.js +0 -132
- package/dist/utils/exit.js.map +0 -7
- package/dist/utils/expertChatStorage.js +0 -78
- package/dist/utils/expertChatStorage.js.map +0 -7
- package/dist/utils/externalEditor.js +0 -155
- package/dist/utils/externalEditor.js.map +0 -7
- package/dist/utils/file.js +0 -282
- package/dist/utils/file.js.map +0 -7
- package/dist/utils/fileLock.js +0 -67
- package/dist/utils/fileLock.js.map +0 -7
- package/dist/utils/fileRecoveryCore.js +0 -41
- package/dist/utils/fileRecoveryCore.js.map +0 -7
- package/dist/utils/format.js +0 -119
- package/dist/utils/format.js.map +0 -7
- package/dist/utils/fuzzyMatcher.js +0 -258
- package/dist/utils/fuzzyMatcher.js.map +0 -7
- package/dist/utils/generators.js +0 -116
- package/dist/utils/generators.js.map +0 -7
- package/dist/utils/git.js +0 -83
- package/dist/utils/git.js.map +0 -7
- package/dist/utils/globalErrorHandler.js +0 -58
- package/dist/utils/globalErrorHandler.js.map +0 -7
- package/dist/utils/gpt5.js +0 -146
- package/dist/utils/gpt5.js.map +0 -7
- package/dist/utils/groupHandlers/index.js +0 -8
- package/dist/utils/groupHandlers/index.js.map +0 -7
- package/dist/utils/groupHandlers/parallelTasksHandler.js +0 -142
- package/dist/utils/groupHandlers/parallelTasksHandler.js.map +0 -7
- package/dist/utils/groupHandlers/taskHandler.js +0 -104
- package/dist/utils/groupHandlers/taskHandler.js.map +0 -7
- package/dist/utils/groupHandlers/types.js +0 -1
- package/dist/utils/groupHandlers/types.js.map +0 -7
- package/dist/utils/historyManager.js +0 -234
- package/dist/utils/historyManager.js.map +0 -7
- package/dist/utils/hookManager.js +0 -540
- package/dist/utils/hookManager.js.map +0 -7
- package/dist/utils/http.js +0 -7
- package/dist/utils/http.js.map +0 -7
- package/dist/utils/imagePaste.js +0 -29
- package/dist/utils/imagePaste.js.map +0 -7
- package/dist/utils/json.js +0 -16
- package/dist/utils/json.js.map +0 -7
- package/dist/utils/log.js +0 -333
- package/dist/utils/log.js.map +0 -7
- package/dist/utils/logRotation.js +0 -224
- package/dist/utils/logRotation.js.map +0 -7
- package/dist/utils/markdown.js +0 -464
- package/dist/utils/markdown.js.map +0 -7
- package/dist/utils/marketplaceManager.js +0 -545
- package/dist/utils/marketplaceManager.js.map +0 -7
- package/dist/utils/memSafety.js +0 -264
- package/dist/utils/memSafety.js.map +0 -7
- package/dist/utils/memoizeWithTTL.js +0 -25
- package/dist/utils/memoizeWithTTL.js.map +0 -7
- package/dist/utils/messageContextManager.js +0 -208
- package/dist/utils/messageContextManager.js.map +0 -7
- package/dist/utils/messageGroupManager.js +0 -274
- package/dist/utils/messageGroupManager.js.map +0 -7
- package/dist/utils/messages.js +0 -725
- package/dist/utils/messages.js.map +0 -7
- package/dist/utils/migration/index.js +0 -37
- package/dist/utils/migration/index.js.map +0 -7
- package/dist/utils/migration/migrateHistory.js +0 -273
- package/dist/utils/migration/migrateHistory.js.map +0 -7
- package/dist/utils/migration/migrateTodos.js +0 -323
- package/dist/utils/migration/migrateTodos.js.map +0 -7
- package/dist/utils/model.js +0 -846
- package/dist/utils/model.js.map +0 -7
- package/dist/utils/pasteCache.js +0 -313
- package/dist/utils/pasteCache.js.map +0 -7
- package/dist/utils/permissions/filesystem.js +0 -236
- package/dist/utils/permissions/filesystem.js.map +0 -7
- package/dist/utils/plan/planMode.js +0 -143
- package/dist/utils/plan/planMode.js.map +0 -7
- package/dist/utils/pluginInstaller.js +0 -518
- package/dist/utils/pluginInstaller.js.map +0 -7
- package/dist/utils/pluginLoader.js +0 -819
- package/dist/utils/pluginLoader.js.map +0 -7
- package/dist/utils/pluginRegistry.js +0 -111
- package/dist/utils/pluginRegistry.js.map +0 -7
- package/dist/utils/pluginValidator.js +0 -798
- package/dist/utils/pluginValidator.js.map +0 -7
- package/dist/utils/ptyCompat.js +0 -125
- package/dist/utils/ptyCompat.js.map +0 -7
- package/dist/utils/replStateMachine.js +0 -145
- package/dist/utils/replStateMachine.js.map +0 -7
- package/dist/utils/repoFetcher.js +0 -110
- package/dist/utils/repoFetcher.js.map +0 -7
- package/dist/utils/ripgrep.js +0 -236
- package/dist/utils/ripgrep.js.map +0 -7
- package/dist/utils/roundConverter.js +0 -262
- package/dist/utils/roundConverter.js.map +0 -7
- package/dist/utils/safeFetch.js +0 -45
- package/dist/utils/safeFetch.js.map +0 -7
- package/dist/utils/safePath.js +0 -132
- package/dist/utils/safePath.js.map +0 -7
- package/dist/utils/sanitizeInput.js +0 -32
- package/dist/utils/sanitizeInput.js.map +0 -7
- package/dist/utils/secureFile.js +0 -512
- package/dist/utils/secureFile.js.map +0 -7
- package/dist/utils/secureKeyStorage.js +0 -341
- package/dist/utils/secureKeyStorage.js.map +0 -7
- package/dist/utils/sensitiveFiles.js +0 -125
- package/dist/utils/sensitiveFiles.js.map +0 -7
- package/dist/utils/session/sessionPlugins.js +0 -67
- package/dist/utils/session/sessionPlugins.js.map +0 -7
- package/dist/utils/sessionIndex.js +0 -192
- package/dist/utils/sessionIndex.js.map +0 -7
- package/dist/utils/sessionState.js +0 -22
- package/dist/utils/sessionState.js.map +0 -7
- package/dist/utils/sessionTracker.js +0 -170
- package/dist/utils/sessionTracker.js.map +0 -7
- package/dist/utils/simpleMode.js +0 -7
- package/dist/utils/simpleMode.js.map +0 -7
- package/dist/utils/skillLoader.js +0 -230
- package/dist/utils/skillLoader.js.map +0 -7
- package/dist/utils/state.js +0 -24
- package/dist/utils/state.js.map +0 -7
- package/dist/utils/stats.js +0 -417
- package/dist/utils/stats.js.map +0 -7
- package/dist/utils/streamingState.js +0 -62
- package/dist/utils/streamingState.js.map +0 -7
- package/dist/utils/stringSubstitution.js +0 -106
- package/dist/utils/stringSubstitution.js.map +0 -7
- package/dist/utils/style.js +0 -34
- package/dist/utils/style.js.map +0 -7
- package/dist/utils/taskDisplayUtils.js +0 -258
- package/dist/utils/taskDisplayUtils.js.map +0 -7
- package/dist/utils/teamConfig.js +0 -624
- package/dist/utils/teamConfig.js.map +0 -7
- package/dist/utils/terminal.js +0 -59
- package/dist/utils/terminal.js.map +0 -7
- package/dist/utils/theme.js +0 -134
- package/dist/utils/theme.js.map +0 -7
- package/dist/utils/thinking.js +0 -63
- package/dist/utils/thinking.js.map +0 -7
- package/dist/utils/todoChangeCalculator.js +0 -64
- package/dist/utils/todoChangeCalculator.js.map +0 -7
- package/dist/utils/todoStorage.js +0 -413
- package/dist/utils/todoStorage.js.map +0 -7
- package/dist/utils/tokenProgress.js +0 -55
- package/dist/utils/tokenProgress.js.map +0 -7
- package/dist/utils/tokens.js +0 -30
- package/dist/utils/tokens.js.map +0 -7
- package/dist/utils/toolExecutionController.js +0 -109
- package/dist/utils/toolExecutionController.js.map +0 -7
- package/dist/utils/toolRiskClassification.js +0 -210
- package/dist/utils/toolRiskClassification.js.map +0 -7
- package/dist/utils/toolTimeout.js +0 -136
- package/dist/utils/toolTimeout.js.map +0 -7
- package/dist/utils/tooling/safeRender.js +0 -115
- package/dist/utils/tooling/safeRender.js.map +0 -7
- package/dist/utils/tooling/toolError.js +0 -12
- package/dist/utils/tooling/toolError.js.map +0 -7
- package/dist/utils/unaryLogging.js +0 -6
- package/dist/utils/unaryLogging.js.map +0 -7
- package/dist/utils/user.js +0 -40
- package/dist/utils/user.js.map +0 -7
- package/dist/utils/userFriendlyError.js +0 -346
- package/dist/utils/userFriendlyError.js.map +0 -7
- package/dist/utils/validate.js +0 -132
- package/dist/utils/validate.js.map +0 -7
- package/dist/version.js +0 -7
- package/dist/version.js.map +0 -7
- package/dist/yoga.wasm +0 -0
- /package/{dist/utils/vendor → vendor}/ripgrep/arm64-darwin/rg +0 -0
|
@@ -1,2170 +0,0 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
useState,
|
|
3
|
-
useEffect,
|
|
4
|
-
useMemo,
|
|
5
|
-
useCallback,
|
|
6
|
-
useReducer,
|
|
7
|
-
Fragment
|
|
8
|
-
} from "react";
|
|
9
|
-
import { Box, Text, useInput } from "ink";
|
|
10
|
-
import InkTextInput from "ink-text-input";
|
|
11
|
-
import {
|
|
12
|
-
getActiveAgents,
|
|
13
|
-
clearAgentCache
|
|
14
|
-
} from "../../utils/agentLoader.js";
|
|
15
|
-
import * as path from "path";
|
|
16
|
-
import * as os from "os";
|
|
17
|
-
import { exec } from "child_process";
|
|
18
|
-
import { promisify } from "util";
|
|
19
|
-
import { getTheme } from "../../utils/theme.js";
|
|
20
|
-
import { clearScreen } from "../../utils/terminal.js";
|
|
21
|
-
import { SEMANTIC_COLORS } from "../../constants/colors.js";
|
|
22
|
-
const execAsync = promisify(exec);
|
|
23
|
-
import { getMCPTools } from "../../services/mcpClient.js";
|
|
24
|
-
import { getModelManager } from "../../utils/model.js";
|
|
25
|
-
import { randomUUID } from "crypto";
|
|
26
|
-
import { TabbedListView } from "../../components/TabbedListView/TabbedListView.js";
|
|
27
|
-
import {
|
|
28
|
-
UI_ICONS,
|
|
29
|
-
TOOL_CATEGORIES
|
|
30
|
-
} from "./constants.js";
|
|
31
|
-
import {
|
|
32
|
-
getAgentFilePath,
|
|
33
|
-
saveAgent,
|
|
34
|
-
deleteAgent,
|
|
35
|
-
openInEditor,
|
|
36
|
-
viewInPager,
|
|
37
|
-
updateAgent
|
|
38
|
-
} from "./utils/index.js";
|
|
39
|
-
function getDisplayModelName(modelId) {
|
|
40
|
-
if (!modelId) return "Inherit";
|
|
41
|
-
try {
|
|
42
|
-
const profiles = getModelManager().getActiveModelProfiles();
|
|
43
|
-
const profile = profiles.find(
|
|
44
|
-
(p) => p.modelName === modelId || p.name === modelId
|
|
45
|
-
);
|
|
46
|
-
return profile ? profile.name : `Custom (${modelId})`;
|
|
47
|
-
} catch (error) {
|
|
48
|
-
console.warn("Failed to get model profiles:", error);
|
|
49
|
-
return modelId ? `Custom (${modelId})` : "Inherit";
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
async function generateAgentWithClaude(prompt) {
|
|
53
|
-
const { queryModel } = await import("../../services/claude.js");
|
|
54
|
-
const systemPrompt = `You are an expert at creating AI agent configurations. Based on the user's description, generate a specialized agent configuration.
|
|
55
|
-
|
|
56
|
-
Return your response as a JSON object with exactly these fields:
|
|
57
|
-
- identifier: A short, kebab-case identifier for the agent (e.g., "code-reviewer", "security-auditor")
|
|
58
|
-
- whenToUse: A clear description of when this agent should be used (50-200 words)
|
|
59
|
-
- systemPrompt: A comprehensive system prompt that defines the agent's role, capabilities, and behavior (200-500 words)
|
|
60
|
-
|
|
61
|
-
Make the agent highly specialized and effective for the described use case.`;
|
|
62
|
-
try {
|
|
63
|
-
const messages = [
|
|
64
|
-
{
|
|
65
|
-
type: "user",
|
|
66
|
-
uuid: randomUUID(),
|
|
67
|
-
message: { role: "user", content: prompt }
|
|
68
|
-
}
|
|
69
|
-
];
|
|
70
|
-
const response = await queryModel("main", messages, [systemPrompt]);
|
|
71
|
-
let responseText = "";
|
|
72
|
-
if (typeof response.message?.content === "string") {
|
|
73
|
-
responseText = response.message.content;
|
|
74
|
-
} else if (Array.isArray(response.message?.content)) {
|
|
75
|
-
const textContent = response.message.content.find(
|
|
76
|
-
(c) => c.type === "text"
|
|
77
|
-
);
|
|
78
|
-
responseText = textContent?.text || "";
|
|
79
|
-
} else if (response.message?.content?.[0]?.text) {
|
|
80
|
-
responseText = response.message.content[0].text;
|
|
81
|
-
}
|
|
82
|
-
if (!responseText) {
|
|
83
|
-
throw new Error("No text content in Claude response");
|
|
84
|
-
}
|
|
85
|
-
const MAX_JSON_SIZE = 1e5;
|
|
86
|
-
const MAX_FIELD_LENGTH = 1e4;
|
|
87
|
-
if (responseText.length > MAX_JSON_SIZE) {
|
|
88
|
-
throw new Error("Response too large");
|
|
89
|
-
}
|
|
90
|
-
let parsed;
|
|
91
|
-
try {
|
|
92
|
-
parsed = JSON.parse(responseText.trim());
|
|
93
|
-
} catch {
|
|
94
|
-
const startIdx = responseText.indexOf("{");
|
|
95
|
-
const endIdx = responseText.lastIndexOf("}");
|
|
96
|
-
if (startIdx === -1 || endIdx === -1 || startIdx >= endIdx) {
|
|
97
|
-
throw new Error("No valid JSON found in Claude response");
|
|
98
|
-
}
|
|
99
|
-
const jsonStr = responseText.substring(startIdx, endIdx + 1);
|
|
100
|
-
if (jsonStr.length > MAX_JSON_SIZE) {
|
|
101
|
-
throw new Error("JSON content too large");
|
|
102
|
-
}
|
|
103
|
-
try {
|
|
104
|
-
parsed = JSON.parse(jsonStr);
|
|
105
|
-
} catch (parseError) {
|
|
106
|
-
throw new Error(
|
|
107
|
-
`Invalid JSON format: ${parseError instanceof Error ? parseError.message : "Unknown error"}`
|
|
108
|
-
);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
const identifier = String(parsed.identifier || "").slice(0, 100).trim();
|
|
112
|
-
const whenToUse = String(parsed.whenToUse || "").slice(0, MAX_FIELD_LENGTH).trim();
|
|
113
|
-
const agentSystemPrompt = String(parsed.systemPrompt || "").slice(0, MAX_FIELD_LENGTH).trim();
|
|
114
|
-
if (!identifier || !whenToUse || !agentSystemPrompt) {
|
|
115
|
-
throw new Error(
|
|
116
|
-
"Invalid response structure: missing required fields (identifier, whenToUse, systemPrompt)"
|
|
117
|
-
);
|
|
118
|
-
}
|
|
119
|
-
const sanitize = (str) => str.replace(/[\x00-\x1F\x7F-\x9F]/g, "");
|
|
120
|
-
const cleanIdentifier = sanitize(identifier);
|
|
121
|
-
if (!/^[a-zA-Z0-9-]+$/.test(cleanIdentifier)) {
|
|
122
|
-
throw new Error(
|
|
123
|
-
"Invalid identifier format: only letters, numbers, and hyphens allowed"
|
|
124
|
-
);
|
|
125
|
-
}
|
|
126
|
-
return {
|
|
127
|
-
identifier: cleanIdentifier,
|
|
128
|
-
whenToUse: sanitize(whenToUse),
|
|
129
|
-
systemPrompt: sanitize(agentSystemPrompt)
|
|
130
|
-
};
|
|
131
|
-
} catch (error) {
|
|
132
|
-
console.error("AI generation failed:", error);
|
|
133
|
-
const fallbackId = prompt.toLowerCase().replace(/[^a-z0-9\s-]/g, "").replace(/\s+/g, "-").slice(0, 30);
|
|
134
|
-
return {
|
|
135
|
-
identifier: fallbackId || "custom-agent",
|
|
136
|
-
whenToUse: `Use this agent when you need assistance with: ${prompt}`,
|
|
137
|
-
systemPrompt: `You are a specialized assistant focused on helping with ${prompt}. Provide expert-level assistance in this domain.`
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
function validateAgentType(agentType, existingAgents = []) {
|
|
142
|
-
const errors = [];
|
|
143
|
-
const warnings = [];
|
|
144
|
-
if (!agentType) {
|
|
145
|
-
errors.push("Agent type is required");
|
|
146
|
-
return { isValid: false, errors, warnings };
|
|
147
|
-
}
|
|
148
|
-
if (!/^[a-zA-Z]/.test(agentType)) {
|
|
149
|
-
errors.push("Agent type must start with a letter");
|
|
150
|
-
}
|
|
151
|
-
if (!/^[a-zA-Z0-9-]+$/.test(agentType)) {
|
|
152
|
-
errors.push("Agent type can only contain letters, numbers, and hyphens");
|
|
153
|
-
}
|
|
154
|
-
if (agentType.length < 3) {
|
|
155
|
-
errors.push("Agent type must be at least 3 characters long");
|
|
156
|
-
}
|
|
157
|
-
if (agentType.length > 50) {
|
|
158
|
-
errors.push("Agent type must be less than 50 characters");
|
|
159
|
-
}
|
|
160
|
-
const reserved = ["help", "exit", "quit", "agents", "task"];
|
|
161
|
-
if (reserved.includes(agentType.toLowerCase())) {
|
|
162
|
-
errors.push("This name is reserved");
|
|
163
|
-
}
|
|
164
|
-
const duplicate = existingAgents.find((a) => a.agentType === agentType);
|
|
165
|
-
if (duplicate) {
|
|
166
|
-
errors.push(
|
|
167
|
-
`An agent with this name already exists in ${duplicate.location}`
|
|
168
|
-
);
|
|
169
|
-
}
|
|
170
|
-
if (agentType.includes("--")) {
|
|
171
|
-
warnings.push("Consider avoiding consecutive hyphens");
|
|
172
|
-
}
|
|
173
|
-
return {
|
|
174
|
-
isValid: errors.length === 0,
|
|
175
|
-
errors,
|
|
176
|
-
warnings
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
|
-
function validateAgentConfig(config, existingAgents = []) {
|
|
180
|
-
const errors = [];
|
|
181
|
-
const warnings = [];
|
|
182
|
-
if (config.agentType) {
|
|
183
|
-
const typeValidation = validateAgentType(config.agentType, existingAgents);
|
|
184
|
-
errors.push(...typeValidation.errors);
|
|
185
|
-
warnings.push(...typeValidation.warnings);
|
|
186
|
-
}
|
|
187
|
-
if (!config.whenToUse) {
|
|
188
|
-
errors.push("Description is required");
|
|
189
|
-
} else if (config.whenToUse.length < 10) {
|
|
190
|
-
warnings.push(
|
|
191
|
-
"Description should be more descriptive (at least 10 characters)"
|
|
192
|
-
);
|
|
193
|
-
}
|
|
194
|
-
if (!config.systemPrompt) {
|
|
195
|
-
errors.push("System prompt is required");
|
|
196
|
-
} else if (config.systemPrompt.length < 20) {
|
|
197
|
-
warnings.push(
|
|
198
|
-
"System prompt might be too short for effective agent behavior"
|
|
199
|
-
);
|
|
200
|
-
}
|
|
201
|
-
if (!config.selectedTools || config.selectedTools.length === 0) {
|
|
202
|
-
warnings.push("No tools selected - agent will have limited capabilities");
|
|
203
|
-
}
|
|
204
|
-
return {
|
|
205
|
-
isValid: errors.length === 0,
|
|
206
|
-
errors,
|
|
207
|
-
warnings
|
|
208
|
-
};
|
|
209
|
-
}
|
|
210
|
-
function Header({ title, subtitle, step, totalSteps, children }) {
|
|
211
|
-
const theme = getTheme();
|
|
212
|
-
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Text, { bold: true, color: theme.primary }, title), subtitle && /* @__PURE__ */ React.createElement(Text, { color: theme.secondary }, step && totalSteps ? `Step ${step}/${totalSteps}: ` : "", subtitle), children);
|
|
213
|
-
}
|
|
214
|
-
function InstructionBar({
|
|
215
|
-
instructions = "Press \u2191\u2193 to navigate \xB7 Enter to select \xB7 Esc to go back"
|
|
216
|
-
}) {
|
|
217
|
-
const theme = getTheme();
|
|
218
|
-
return /* @__PURE__ */ React.createElement(Box, { marginTop: 2 }, /* @__PURE__ */ React.createElement(Box, { borderStyle: "round", borderColor: theme.secondary, paddingX: 1 }, /* @__PURE__ */ React.createElement(Text, { color: theme.secondary }, instructions)));
|
|
219
|
-
}
|
|
220
|
-
function SelectList({
|
|
221
|
-
options,
|
|
222
|
-
selectedIndex,
|
|
223
|
-
onChange,
|
|
224
|
-
onCancel,
|
|
225
|
-
numbered = true,
|
|
226
|
-
isActive = true
|
|
227
|
-
}) {
|
|
228
|
-
const theme = getTheme();
|
|
229
|
-
useInput(
|
|
230
|
-
(input, key) => {
|
|
231
|
-
if (key.escape && onCancel) {
|
|
232
|
-
onCancel();
|
|
233
|
-
} else if (key.return) {
|
|
234
|
-
onChange(options[selectedIndex].value);
|
|
235
|
-
}
|
|
236
|
-
},
|
|
237
|
-
{ isActive }
|
|
238
|
-
);
|
|
239
|
-
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))));
|
|
240
|
-
}
|
|
241
|
-
function MultilineTextInput({
|
|
242
|
-
value,
|
|
243
|
-
onChange,
|
|
244
|
-
placeholder = "",
|
|
245
|
-
onSubmit,
|
|
246
|
-
focus = true,
|
|
247
|
-
rows = 5,
|
|
248
|
-
error
|
|
249
|
-
}) {
|
|
250
|
-
const theme = getTheme();
|
|
251
|
-
const [internalValue, setInternalValue] = useState(value);
|
|
252
|
-
const [cursorBlink, setCursorBlink] = useState(true);
|
|
253
|
-
useEffect(() => {
|
|
254
|
-
setInternalValue(value);
|
|
255
|
-
}, [value]);
|
|
256
|
-
useEffect(() => {
|
|
257
|
-
if (!focus) return void 0;
|
|
258
|
-
const timer = setInterval(() => {
|
|
259
|
-
setCursorBlink((prev) => !prev);
|
|
260
|
-
}, 500);
|
|
261
|
-
return () => clearInterval(timer);
|
|
262
|
-
}, [focus]);
|
|
263
|
-
const lines = internalValue.split("\n");
|
|
264
|
-
const lineCount = lines.length;
|
|
265
|
-
const charCount = internalValue.length;
|
|
266
|
-
const isEmpty = !internalValue.trim();
|
|
267
|
-
const hasContent = !isEmpty;
|
|
268
|
-
const formatLines = (text) => {
|
|
269
|
-
if (!text && placeholder) {
|
|
270
|
-
return [placeholder];
|
|
271
|
-
}
|
|
272
|
-
const maxWidth = 70;
|
|
273
|
-
const result = [];
|
|
274
|
-
const textLines = text.split("\n");
|
|
275
|
-
textLines.forEach((line) => {
|
|
276
|
-
if (line.length <= maxWidth) {
|
|
277
|
-
result.push(line);
|
|
278
|
-
} else {
|
|
279
|
-
let remaining = line;
|
|
280
|
-
while (remaining.length > 0) {
|
|
281
|
-
result.push(remaining.slice(0, maxWidth));
|
|
282
|
-
remaining = remaining.slice(maxWidth);
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
});
|
|
286
|
-
return result.length > 0 ? result : [""];
|
|
287
|
-
};
|
|
288
|
-
const displayLines = formatLines(internalValue);
|
|
289
|
-
const visibleLines = displayLines.slice(
|
|
290
|
-
Math.max(0, displayLines.length - rows)
|
|
291
|
-
);
|
|
292
|
-
const handleSubmit = () => {
|
|
293
|
-
if (internalValue.trim() && onSubmit) {
|
|
294
|
-
onSubmit();
|
|
295
|
-
}
|
|
296
|
-
};
|
|
297
|
-
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", width: "100%" }, /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(
|
|
298
|
-
Box,
|
|
299
|
-
{
|
|
300
|
-
borderStyle: "round",
|
|
301
|
-
borderColor: focus ? theme.primary : "gray",
|
|
302
|
-
paddingX: 2,
|
|
303
|
-
paddingY: 1,
|
|
304
|
-
minHeight: rows + 2
|
|
305
|
-
},
|
|
306
|
-
/* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(
|
|
307
|
-
InkTextInput,
|
|
308
|
-
{
|
|
309
|
-
value: internalValue,
|
|
310
|
-
onChange: (val) => {
|
|
311
|
-
setInternalValue(val);
|
|
312
|
-
onChange(val);
|
|
313
|
-
},
|
|
314
|
-
onSubmit: handleSubmit,
|
|
315
|
-
focus,
|
|
316
|
-
placeholder
|
|
317
|
-
}
|
|
318
|
-
), focus && cursorBlink && hasContent && /* @__PURE__ */ React.createElement(Text, { color: theme.primary }, "_"))
|
|
319
|
-
), /* @__PURE__ */ React.createElement(Box, { marginTop: 1, flexDirection: "row", justifyContent: "space-between" }, /* @__PURE__ */ React.createElement(Box, null, hasContent ? /* @__PURE__ */ React.createElement(Text, { color: theme.success }, "\u2713 ", charCount, " chars \u2022 ", lineCount, " line", lineCount !== 1 ? "s" : "") : /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, "\u25CB Type to begin...")), /* @__PURE__ */ React.createElement(Box, null, error ? /* @__PURE__ */ React.createElement(Text, { color: theme.error }, "\u26A0 ", error) : /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, hasContent ? "Ready" : "Waiting")))), /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, "Press Enter to submit \xB7 Shift+Enter for new line")));
|
|
320
|
-
}
|
|
321
|
-
function LoadingSpinner({ text }) {
|
|
322
|
-
const theme = getTheme();
|
|
323
|
-
const [frame, setFrame] = useState(0);
|
|
324
|
-
useEffect(() => {
|
|
325
|
-
const interval = setInterval(() => {
|
|
326
|
-
setFrame((prev) => (prev + 1) % UI_ICONS.loading.length);
|
|
327
|
-
}, 100);
|
|
328
|
-
return () => clearInterval(interval);
|
|
329
|
-
}, []);
|
|
330
|
-
return /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: theme.primary }, UI_ICONS.loading[frame]), text && /* @__PURE__ */ React.createElement(Text, { color: theme.secondary }, " ", text));
|
|
331
|
-
}
|
|
332
|
-
function AgentsUI({ onExit }) {
|
|
333
|
-
const [phase, setPhase] = useState({ type: "main" });
|
|
334
|
-
const [activeTab, setActiveTab] = useState("all");
|
|
335
|
-
const [searchQuery, setSearchQuery] = useState("");
|
|
336
|
-
const [statusOverlay, setStatusOverlay] = useState(null);
|
|
337
|
-
const [modeState, setModeState] = useState({
|
|
338
|
-
mode: "list-agents",
|
|
339
|
-
location: "all"
|
|
340
|
-
});
|
|
341
|
-
const [agents, setAgents] = useState([]);
|
|
342
|
-
const [changes, setChanges] = useState([]);
|
|
343
|
-
const [refreshKey, setRefreshKey] = useState(0);
|
|
344
|
-
const [loading, setLoading] = useState(true);
|
|
345
|
-
const [tools, setTools] = useState([]);
|
|
346
|
-
const [createState, setCreateState] = useReducer(
|
|
347
|
-
(state, action) => {
|
|
348
|
-
switch (action.type) {
|
|
349
|
-
case "RESET":
|
|
350
|
-
return {
|
|
351
|
-
location: null,
|
|
352
|
-
agentType: "",
|
|
353
|
-
method: null,
|
|
354
|
-
generationPrompt: "",
|
|
355
|
-
whenToUse: "",
|
|
356
|
-
selectedTools: [],
|
|
357
|
-
selectedModel: null,
|
|
358
|
-
selectedColor: null,
|
|
359
|
-
systemPrompt: "",
|
|
360
|
-
isGenerating: false,
|
|
361
|
-
wasGenerated: false,
|
|
362
|
-
isAIGenerated: false,
|
|
363
|
-
error: null,
|
|
364
|
-
warnings: [],
|
|
365
|
-
agentTypeCursor: 0,
|
|
366
|
-
whenToUseCursor: 0,
|
|
367
|
-
promptCursor: 0,
|
|
368
|
-
generationPromptCursor: 0
|
|
369
|
-
};
|
|
370
|
-
case "SET_LOCATION":
|
|
371
|
-
return { ...state, location: action.value };
|
|
372
|
-
case "SET_METHOD":
|
|
373
|
-
return { ...state, method: action.value };
|
|
374
|
-
case "SET_AGENT_TYPE":
|
|
375
|
-
return { ...state, agentType: action.value, error: null };
|
|
376
|
-
case "SET_GENERATION_PROMPT":
|
|
377
|
-
return { ...state, generationPrompt: action.value };
|
|
378
|
-
case "SET_WHEN_TO_USE":
|
|
379
|
-
return { ...state, whenToUse: action.value, error: null };
|
|
380
|
-
case "SET_SELECTED_TOOLS":
|
|
381
|
-
return { ...state, selectedTools: action.value };
|
|
382
|
-
case "SET_SELECTED_MODEL":
|
|
383
|
-
return { ...state, selectedModel: action.value };
|
|
384
|
-
case "SET_SELECTED_COLOR":
|
|
385
|
-
return { ...state, selectedColor: action.value };
|
|
386
|
-
case "SET_SYSTEM_PROMPT":
|
|
387
|
-
return { ...state, systemPrompt: action.value };
|
|
388
|
-
case "SET_IS_GENERATING":
|
|
389
|
-
return { ...state, isGenerating: action.value };
|
|
390
|
-
case "SET_WAS_GENERATED":
|
|
391
|
-
return { ...state, wasGenerated: action.value };
|
|
392
|
-
case "SET_IS_AI_GENERATED":
|
|
393
|
-
return { ...state, isAIGenerated: action.value };
|
|
394
|
-
case "SET_ERROR":
|
|
395
|
-
return { ...state, error: action.value };
|
|
396
|
-
case "SET_WARNINGS":
|
|
397
|
-
return { ...state, warnings: action.value };
|
|
398
|
-
case "SET_CURSOR":
|
|
399
|
-
return { ...state, [action.field]: action.value };
|
|
400
|
-
default:
|
|
401
|
-
return state;
|
|
402
|
-
}
|
|
403
|
-
},
|
|
404
|
-
{
|
|
405
|
-
location: null,
|
|
406
|
-
agentType: "",
|
|
407
|
-
method: null,
|
|
408
|
-
generationPrompt: "",
|
|
409
|
-
whenToUse: "",
|
|
410
|
-
selectedTools: [],
|
|
411
|
-
selectedModel: null,
|
|
412
|
-
selectedColor: null,
|
|
413
|
-
systemPrompt: "",
|
|
414
|
-
isGenerating: false,
|
|
415
|
-
wasGenerated: false,
|
|
416
|
-
isAIGenerated: false,
|
|
417
|
-
error: null,
|
|
418
|
-
warnings: [],
|
|
419
|
-
agentTypeCursor: 0,
|
|
420
|
-
whenToUseCursor: 0,
|
|
421
|
-
promptCursor: 0,
|
|
422
|
-
generationPromptCursor: 0
|
|
423
|
-
}
|
|
424
|
-
);
|
|
425
|
-
const loadAgents = useCallback(async () => {
|
|
426
|
-
setLoading(true);
|
|
427
|
-
clearAgentCache();
|
|
428
|
-
const abortController = new AbortController();
|
|
429
|
-
try {
|
|
430
|
-
const result = await getActiveAgents();
|
|
431
|
-
if (abortController.signal.aborted) {
|
|
432
|
-
return void 0;
|
|
433
|
-
}
|
|
434
|
-
setAgents(result);
|
|
435
|
-
const availableTools = [];
|
|
436
|
-
let coreTools = [
|
|
437
|
-
{ name: "Read", description: "Read files from filesystem" },
|
|
438
|
-
{ name: "Write", description: "Write files to filesystem" },
|
|
439
|
-
{ name: "Edit", description: "Edit existing files" },
|
|
440
|
-
{ name: "MultiEdit", description: "Make multiple edits to files" },
|
|
441
|
-
{ name: "NotebookEdit", description: "Edit Jupyter notebooks" },
|
|
442
|
-
{ name: "Bash", description: "Execute bash commands" },
|
|
443
|
-
{ name: "Glob", description: "Find files matching patterns" },
|
|
444
|
-
{ name: "Grep", description: "Search file contents" },
|
|
445
|
-
{ name: "LS", description: "List directory contents" },
|
|
446
|
-
{ name: "WebFetch", description: "Fetch web content" },
|
|
447
|
-
{ name: "WebSearch", description: "Search the web" },
|
|
448
|
-
{ name: "TodoWrite", description: "Manage task lists" }
|
|
449
|
-
];
|
|
450
|
-
coreTools = coreTools.filter(
|
|
451
|
-
(t) => t.name !== "Agent" && t.name !== "ExitPlanMode"
|
|
452
|
-
);
|
|
453
|
-
availableTools.push(...coreTools);
|
|
454
|
-
try {
|
|
455
|
-
const mcpTools = await getMCPTools();
|
|
456
|
-
if (Array.isArray(mcpTools) && mcpTools.length > 0) {
|
|
457
|
-
availableTools.push(...mcpTools);
|
|
458
|
-
}
|
|
459
|
-
} catch (error) {
|
|
460
|
-
console.warn("Failed to load MCP tools:", error);
|
|
461
|
-
}
|
|
462
|
-
if (!abortController.signal.aborted) {
|
|
463
|
-
setTools(availableTools);
|
|
464
|
-
}
|
|
465
|
-
} catch (error) {
|
|
466
|
-
if (!abortController.signal.aborted) {
|
|
467
|
-
console.error("Failed to load agents:", error);
|
|
468
|
-
}
|
|
469
|
-
} finally {
|
|
470
|
-
if (!abortController.signal.aborted) {
|
|
471
|
-
setLoading(false);
|
|
472
|
-
}
|
|
473
|
-
}
|
|
474
|
-
return () => abortController.abort();
|
|
475
|
-
}, []);
|
|
476
|
-
useEffect(() => {
|
|
477
|
-
let cleanup;
|
|
478
|
-
const load = async () => {
|
|
479
|
-
cleanup = await loadAgents();
|
|
480
|
-
};
|
|
481
|
-
load();
|
|
482
|
-
return () => {
|
|
483
|
-
if (cleanup) {
|
|
484
|
-
cleanup();
|
|
485
|
-
}
|
|
486
|
-
};
|
|
487
|
-
}, [refreshKey, loadAgents]);
|
|
488
|
-
useEffect(() => {
|
|
489
|
-
if (phase.type === "main") {
|
|
490
|
-
setSearchQuery("");
|
|
491
|
-
}
|
|
492
|
-
}, [phase]);
|
|
493
|
-
const activeMap = useMemo(() => {
|
|
494
|
-
const map = /* @__PURE__ */ new Map();
|
|
495
|
-
agents.forEach((a) => map.set(a.agentType, a));
|
|
496
|
-
return map;
|
|
497
|
-
}, [agents]);
|
|
498
|
-
const checkOverride = useCallback(
|
|
499
|
-
(agent) => {
|
|
500
|
-
const active = activeMap.get(agent.agentType);
|
|
501
|
-
const isOverridden = !!(active && active.location !== agent.location);
|
|
502
|
-
return {
|
|
503
|
-
isOverridden,
|
|
504
|
-
overriddenBy: isOverridden ? active.location : null
|
|
505
|
-
};
|
|
506
|
-
},
|
|
507
|
-
[activeMap]
|
|
508
|
-
);
|
|
509
|
-
const { tabs, items, title, footerHint, searchEnabled } = useMemo(() => {
|
|
510
|
-
switch (phase.type) {
|
|
511
|
-
case "main": {
|
|
512
|
-
const allAgents = agents;
|
|
513
|
-
const customAgents = allAgents.filter((a) => a.location !== "built-in");
|
|
514
|
-
const mainTabs = [
|
|
515
|
-
{ id: "all", label: "All", badge: customAgents.length },
|
|
516
|
-
{
|
|
517
|
-
id: "plugin",
|
|
518
|
-
label: "Plugin",
|
|
519
|
-
badge: customAgents.filter((a) => a.location === "plugin").length
|
|
520
|
-
},
|
|
521
|
-
{
|
|
522
|
-
id: "user",
|
|
523
|
-
label: "Personal",
|
|
524
|
-
badge: customAgents.filter((a) => a.location === "user").length
|
|
525
|
-
},
|
|
526
|
-
{
|
|
527
|
-
id: "project",
|
|
528
|
-
label: "Project",
|
|
529
|
-
badge: customAgents.filter((a) => a.location === "project").length
|
|
530
|
-
}
|
|
531
|
-
];
|
|
532
|
-
let mainItems = [];
|
|
533
|
-
mainItems.push({
|
|
534
|
-
id: "create-new",
|
|
535
|
-
label: "+ Create new agent",
|
|
536
|
-
description: "Create a new specialized agent"
|
|
537
|
-
});
|
|
538
|
-
const displayAgents = activeTab === "all" ? customAgents : customAgents.filter((a) => a.location === activeTab);
|
|
539
|
-
for (const agent of displayAgents) {
|
|
540
|
-
const { isOverridden, overriddenBy } = checkOverride(agent);
|
|
541
|
-
const agentModel = agent.model || null;
|
|
542
|
-
const modelDisplay = getDisplayModelName(agentModel);
|
|
543
|
-
const locationLabel = agent.location === "plugin" ? "Plugin" : agent.location === "user" ? "Personal" : agent.location === "project" ? "Project" : agent.location;
|
|
544
|
-
mainItems.push({
|
|
545
|
-
id: `${agent.agentType}-${agent.location}`,
|
|
546
|
-
label: agent.agentType,
|
|
547
|
-
description: agent.whenToUse || agent.description || "",
|
|
548
|
-
category: locationLabel,
|
|
549
|
-
metadata: modelDisplay,
|
|
550
|
-
status: isOverridden ? "disabled" : "enabled",
|
|
551
|
-
data: agent
|
|
552
|
-
});
|
|
553
|
-
}
|
|
554
|
-
return {
|
|
555
|
-
tabs: mainTabs,
|
|
556
|
-
items: mainItems,
|
|
557
|
-
title: "Agents",
|
|
558
|
-
footerHint: "\u2191\u2193 Navigate \xB7 Enter Select \xB7 Tab/\u2190\u2192 Switch \xB7 / Search \xB7 Esc Close",
|
|
559
|
-
searchEnabled: true
|
|
560
|
-
};
|
|
561
|
-
}
|
|
562
|
-
case "agent-actions": {
|
|
563
|
-
const agent = phase.agent;
|
|
564
|
-
const isBuiltIn = agent.location === "built-in";
|
|
565
|
-
const actionItems = [
|
|
566
|
-
{
|
|
567
|
-
id: "view",
|
|
568
|
-
label: "View details",
|
|
569
|
-
description: "Show agent configuration"
|
|
570
|
-
}
|
|
571
|
-
];
|
|
572
|
-
if (!isBuiltIn) {
|
|
573
|
-
actionItems.push({
|
|
574
|
-
id: "edit",
|
|
575
|
-
label: "Edit agent",
|
|
576
|
-
description: "Modify agent settings"
|
|
577
|
-
});
|
|
578
|
-
actionItems.push({
|
|
579
|
-
id: "delete",
|
|
580
|
-
label: "Delete agent",
|
|
581
|
-
description: "Remove this agent"
|
|
582
|
-
});
|
|
583
|
-
}
|
|
584
|
-
actionItems.push({
|
|
585
|
-
id: "back",
|
|
586
|
-
label: "Back",
|
|
587
|
-
description: "Return to agent list"
|
|
588
|
-
});
|
|
589
|
-
return {
|
|
590
|
-
tabs: [{ id: "actions", label: "Actions" }],
|
|
591
|
-
items: actionItems,
|
|
592
|
-
title: agent.agentType,
|
|
593
|
-
footerHint: "\u2191\u2193 Navigate \xB7 Enter Select \xB7 Esc Back",
|
|
594
|
-
searchEnabled: false
|
|
595
|
-
};
|
|
596
|
-
}
|
|
597
|
-
case "edit-actions": {
|
|
598
|
-
const agent = phase.agent;
|
|
599
|
-
const editItems = [
|
|
600
|
-
{
|
|
601
|
-
id: "open-editor",
|
|
602
|
-
label: "Open in editor",
|
|
603
|
-
description: "Edit the agent file directly"
|
|
604
|
-
},
|
|
605
|
-
{
|
|
606
|
-
id: "edit-tools",
|
|
607
|
-
label: "Edit tools",
|
|
608
|
-
description: "Change available tools"
|
|
609
|
-
},
|
|
610
|
-
{
|
|
611
|
-
id: "edit-model",
|
|
612
|
-
label: "Edit model",
|
|
613
|
-
description: "Change the model"
|
|
614
|
-
},
|
|
615
|
-
{
|
|
616
|
-
id: "edit-color",
|
|
617
|
-
label: "Edit color",
|
|
618
|
-
description: "Change the color tag"
|
|
619
|
-
},
|
|
620
|
-
{
|
|
621
|
-
id: "back",
|
|
622
|
-
label: "Back",
|
|
623
|
-
description: "Return to agent actions"
|
|
624
|
-
}
|
|
625
|
-
];
|
|
626
|
-
return {
|
|
627
|
-
tabs: [{ id: "edit", label: "Edit" }],
|
|
628
|
-
items: editItems,
|
|
629
|
-
title: `Edit: ${agent.agentType}`,
|
|
630
|
-
footerHint: "\u2191\u2193 Navigate \xB7 Enter Select \xB7 Esc Back",
|
|
631
|
-
searchEnabled: false
|
|
632
|
-
};
|
|
633
|
-
}
|
|
634
|
-
default:
|
|
635
|
-
return {
|
|
636
|
-
tabs: [{ id: "all", label: "All" }],
|
|
637
|
-
items: [],
|
|
638
|
-
title: "Agents",
|
|
639
|
-
footerHint: "",
|
|
640
|
-
searchEnabled: false
|
|
641
|
-
};
|
|
642
|
-
}
|
|
643
|
-
}, [phase, activeTab, agents, checkOverride]);
|
|
644
|
-
const handleTabChange = useCallback((tabId) => {
|
|
645
|
-
setActiveTab(tabId);
|
|
646
|
-
setSearchQuery("");
|
|
647
|
-
}, []);
|
|
648
|
-
const handleStatusDismiss = useCallback(() => {
|
|
649
|
-
setStatusOverlay(null);
|
|
650
|
-
setPhase({ type: "main" });
|
|
651
|
-
}, []);
|
|
652
|
-
const handleBack = useCallback(() => {
|
|
653
|
-
if (statusOverlay && statusOverlay.type !== "loading") {
|
|
654
|
-
handleStatusDismiss();
|
|
655
|
-
return;
|
|
656
|
-
}
|
|
657
|
-
switch (phase.type) {
|
|
658
|
-
case "main": {
|
|
659
|
-
const changesSummary = changes.length > 0 ? `Agent changes:
|
|
660
|
-
${changes.join("\n")}` : void 0;
|
|
661
|
-
onExit(changesSummary);
|
|
662
|
-
break;
|
|
663
|
-
}
|
|
664
|
-
case "agent-actions":
|
|
665
|
-
setPhase({ type: "main" });
|
|
666
|
-
break;
|
|
667
|
-
case "edit-actions":
|
|
668
|
-
setPhase({ type: "agent-actions", agent: phase.agent });
|
|
669
|
-
break;
|
|
670
|
-
default:
|
|
671
|
-
setPhase({ type: "main" });
|
|
672
|
-
break;
|
|
673
|
-
}
|
|
674
|
-
}, [phase, statusOverlay, changes, onExit, handleStatusDismiss]);
|
|
675
|
-
const handleClose = useCallback(() => {
|
|
676
|
-
if (statusOverlay && statusOverlay.type !== "loading") {
|
|
677
|
-
handleStatusDismiss();
|
|
678
|
-
return;
|
|
679
|
-
}
|
|
680
|
-
if (phase.type === "main") {
|
|
681
|
-
const changesSummary = changes.length > 0 ? `Agent changes:
|
|
682
|
-
${changes.join("\n")}` : void 0;
|
|
683
|
-
onExit(changesSummary);
|
|
684
|
-
} else {
|
|
685
|
-
setPhase({ type: "main" });
|
|
686
|
-
setSearchQuery("");
|
|
687
|
-
}
|
|
688
|
-
}, [phase, statusOverlay, changes, onExit, handleStatusDismiss]);
|
|
689
|
-
const handleSelect = useCallback(
|
|
690
|
-
async (item) => {
|
|
691
|
-
switch (phase.type) {
|
|
692
|
-
case "main": {
|
|
693
|
-
if (item.id === "create-new") {
|
|
694
|
-
setCreateState({ type: "RESET" });
|
|
695
|
-
setModeState({ mode: "create-location" });
|
|
696
|
-
setPhase({ type: "create", step: { mode: "create-location" } });
|
|
697
|
-
return;
|
|
698
|
-
}
|
|
699
|
-
const agent = item.data;
|
|
700
|
-
if (agent) {
|
|
701
|
-
setPhase({ type: "agent-actions", agent });
|
|
702
|
-
}
|
|
703
|
-
break;
|
|
704
|
-
}
|
|
705
|
-
case "agent-actions": {
|
|
706
|
-
const agent = phase.agent;
|
|
707
|
-
if (item.id === "back") {
|
|
708
|
-
setPhase({ type: "main" });
|
|
709
|
-
return;
|
|
710
|
-
}
|
|
711
|
-
if (item.id === "view") {
|
|
712
|
-
try {
|
|
713
|
-
viewInPager(agent);
|
|
714
|
-
setRefreshKey((prev) => prev + 1);
|
|
715
|
-
} catch (err) {
|
|
716
|
-
setStatusOverlay({
|
|
717
|
-
type: "error",
|
|
718
|
-
message: `Failed to open pager: ${err instanceof Error ? err.message : String(err)}`
|
|
719
|
-
});
|
|
720
|
-
}
|
|
721
|
-
} else if (item.id === "edit") {
|
|
722
|
-
setPhase({ type: "edit-actions", agent });
|
|
723
|
-
} else if (item.id === "delete") {
|
|
724
|
-
setPhase({ type: "delete-confirm", agent });
|
|
725
|
-
}
|
|
726
|
-
break;
|
|
727
|
-
}
|
|
728
|
-
case "edit-actions": {
|
|
729
|
-
const agent = phase.agent;
|
|
730
|
-
if (item.id === "back") {
|
|
731
|
-
setPhase({ type: "agent-actions", agent });
|
|
732
|
-
return;
|
|
733
|
-
}
|
|
734
|
-
if (item.id === "open-editor") {
|
|
735
|
-
try {
|
|
736
|
-
const filePath = getAgentFilePath(agent);
|
|
737
|
-
openInEditor(filePath);
|
|
738
|
-
clearAgentCache();
|
|
739
|
-
const reloaded = await getActiveAgents();
|
|
740
|
-
setAgents(reloaded);
|
|
741
|
-
const updated = reloaded.find(
|
|
742
|
-
(a) => a.agentType === agent.agentType
|
|
743
|
-
);
|
|
744
|
-
if (updated) {
|
|
745
|
-
setPhase({ type: "edit-actions", agent: updated });
|
|
746
|
-
}
|
|
747
|
-
setStatusOverlay({
|
|
748
|
-
type: "success",
|
|
749
|
-
message: "Editor closed"
|
|
750
|
-
});
|
|
751
|
-
} catch (err) {
|
|
752
|
-
setStatusOverlay({
|
|
753
|
-
type: "error",
|
|
754
|
-
message: `Failed to open editor: ${err instanceof Error ? err.message : String(err)}`
|
|
755
|
-
});
|
|
756
|
-
}
|
|
757
|
-
} else if (item.id === "edit-tools") {
|
|
758
|
-
setPhase({ type: "edit-tools", agent });
|
|
759
|
-
} else if (item.id === "edit-model") {
|
|
760
|
-
setPhase({ type: "edit-model", agent });
|
|
761
|
-
} else if (item.id === "edit-color") {
|
|
762
|
-
setPhase({ type: "edit-color", agent });
|
|
763
|
-
}
|
|
764
|
-
break;
|
|
765
|
-
}
|
|
766
|
-
}
|
|
767
|
-
},
|
|
768
|
-
[phase]
|
|
769
|
-
);
|
|
770
|
-
const handleAgentCreated = useCallback((message) => {
|
|
771
|
-
setChanges((prev) => [...prev, message]);
|
|
772
|
-
setRefreshKey((prev) => prev + 1);
|
|
773
|
-
setPhase({ type: "main" });
|
|
774
|
-
}, []);
|
|
775
|
-
const handleAgentDeleted = useCallback((message) => {
|
|
776
|
-
setChanges((prev) => [...prev, message]);
|
|
777
|
-
setRefreshKey((prev) => prev + 1);
|
|
778
|
-
setPhase({ type: "main" });
|
|
779
|
-
}, []);
|
|
780
|
-
const handleAgentUpdated = useCallback(
|
|
781
|
-
(message, updated) => {
|
|
782
|
-
setChanges((prev) => [...prev, message]);
|
|
783
|
-
setRefreshKey((prev) => prev + 1);
|
|
784
|
-
setPhase({ type: "agent-actions", agent: updated });
|
|
785
|
-
},
|
|
786
|
-
[]
|
|
787
|
-
);
|
|
788
|
-
const wizardSetModeState = useCallback((state) => {
|
|
789
|
-
if (state.mode === "list-agents") {
|
|
790
|
-
setPhase({ type: "main" });
|
|
791
|
-
return;
|
|
792
|
-
}
|
|
793
|
-
setModeState(state);
|
|
794
|
-
}, []);
|
|
795
|
-
if (phase.type === "create") {
|
|
796
|
-
switch (modeState.mode) {
|
|
797
|
-
case "create-location":
|
|
798
|
-
return /* @__PURE__ */ React.createElement(
|
|
799
|
-
LocationSelect,
|
|
800
|
-
{
|
|
801
|
-
createState,
|
|
802
|
-
setCreateState,
|
|
803
|
-
setModeState: wizardSetModeState
|
|
804
|
-
}
|
|
805
|
-
);
|
|
806
|
-
case "create-method":
|
|
807
|
-
return /* @__PURE__ */ React.createElement(
|
|
808
|
-
MethodSelect,
|
|
809
|
-
{
|
|
810
|
-
createState,
|
|
811
|
-
setCreateState,
|
|
812
|
-
setModeState: wizardSetModeState
|
|
813
|
-
}
|
|
814
|
-
);
|
|
815
|
-
case "create-generate":
|
|
816
|
-
return /* @__PURE__ */ React.createElement(
|
|
817
|
-
GenerateStep,
|
|
818
|
-
{
|
|
819
|
-
createState,
|
|
820
|
-
setCreateState,
|
|
821
|
-
setModeState: wizardSetModeState,
|
|
822
|
-
existingAgents: agents
|
|
823
|
-
}
|
|
824
|
-
);
|
|
825
|
-
case "create-type":
|
|
826
|
-
return /* @__PURE__ */ React.createElement(
|
|
827
|
-
TypeStep,
|
|
828
|
-
{
|
|
829
|
-
createState,
|
|
830
|
-
setCreateState,
|
|
831
|
-
setModeState: wizardSetModeState,
|
|
832
|
-
existingAgents: agents
|
|
833
|
-
}
|
|
834
|
-
);
|
|
835
|
-
case "create-description":
|
|
836
|
-
return /* @__PURE__ */ React.createElement(
|
|
837
|
-
DescriptionStep,
|
|
838
|
-
{
|
|
839
|
-
createState,
|
|
840
|
-
setCreateState,
|
|
841
|
-
setModeState: wizardSetModeState
|
|
842
|
-
}
|
|
843
|
-
);
|
|
844
|
-
case "create-tools":
|
|
845
|
-
return /* @__PURE__ */ React.createElement(
|
|
846
|
-
ToolsStep,
|
|
847
|
-
{
|
|
848
|
-
createState,
|
|
849
|
-
setCreateState,
|
|
850
|
-
setModeState: wizardSetModeState,
|
|
851
|
-
tools
|
|
852
|
-
}
|
|
853
|
-
);
|
|
854
|
-
case "create-model":
|
|
855
|
-
return /* @__PURE__ */ React.createElement(
|
|
856
|
-
ModelStep,
|
|
857
|
-
{
|
|
858
|
-
createState,
|
|
859
|
-
setCreateState,
|
|
860
|
-
setModeState: wizardSetModeState
|
|
861
|
-
}
|
|
862
|
-
);
|
|
863
|
-
case "create-color":
|
|
864
|
-
return /* @__PURE__ */ React.createElement(
|
|
865
|
-
ColorStep,
|
|
866
|
-
{
|
|
867
|
-
createState,
|
|
868
|
-
setCreateState,
|
|
869
|
-
setModeState: wizardSetModeState
|
|
870
|
-
}
|
|
871
|
-
);
|
|
872
|
-
case "create-prompt":
|
|
873
|
-
return /* @__PURE__ */ React.createElement(
|
|
874
|
-
PromptStep,
|
|
875
|
-
{
|
|
876
|
-
createState,
|
|
877
|
-
setCreateState,
|
|
878
|
-
setModeState: wizardSetModeState
|
|
879
|
-
}
|
|
880
|
-
);
|
|
881
|
-
case "create-confirm":
|
|
882
|
-
return /* @__PURE__ */ React.createElement(
|
|
883
|
-
ConfirmStep,
|
|
884
|
-
{
|
|
885
|
-
createState,
|
|
886
|
-
setCreateState,
|
|
887
|
-
setModeState: wizardSetModeState,
|
|
888
|
-
tools,
|
|
889
|
-
onAgentCreated: handleAgentCreated
|
|
890
|
-
}
|
|
891
|
-
);
|
|
892
|
-
default:
|
|
893
|
-
setPhase({ type: "main" });
|
|
894
|
-
return null;
|
|
895
|
-
}
|
|
896
|
-
}
|
|
897
|
-
if (phase.type === "edit-tools") {
|
|
898
|
-
return /* @__PURE__ */ React.createElement(
|
|
899
|
-
EditToolsStep,
|
|
900
|
-
{
|
|
901
|
-
agent: phase.agent,
|
|
902
|
-
tools,
|
|
903
|
-
setModeState: (state) => {
|
|
904
|
-
clearScreen();
|
|
905
|
-
setPhase({ type: "edit-actions", agent: phase.agent });
|
|
906
|
-
},
|
|
907
|
-
onAgentUpdated: handleAgentUpdated
|
|
908
|
-
}
|
|
909
|
-
);
|
|
910
|
-
}
|
|
911
|
-
if (phase.type === "edit-model") {
|
|
912
|
-
return /* @__PURE__ */ React.createElement(
|
|
913
|
-
EditModelStep,
|
|
914
|
-
{
|
|
915
|
-
agent: phase.agent,
|
|
916
|
-
setModeState: (state) => {
|
|
917
|
-
clearScreen();
|
|
918
|
-
setPhase({ type: "edit-actions", agent: phase.agent });
|
|
919
|
-
},
|
|
920
|
-
onAgentUpdated: handleAgentUpdated
|
|
921
|
-
}
|
|
922
|
-
);
|
|
923
|
-
}
|
|
924
|
-
if (phase.type === "edit-color") {
|
|
925
|
-
return /* @__PURE__ */ React.createElement(
|
|
926
|
-
EditColorStep,
|
|
927
|
-
{
|
|
928
|
-
agent: phase.agent,
|
|
929
|
-
setModeState: (state) => {
|
|
930
|
-
clearScreen();
|
|
931
|
-
setPhase({ type: "edit-actions", agent: phase.agent });
|
|
932
|
-
},
|
|
933
|
-
onAgentUpdated: handleAgentUpdated
|
|
934
|
-
}
|
|
935
|
-
);
|
|
936
|
-
}
|
|
937
|
-
if (phase.type === "delete-confirm") {
|
|
938
|
-
return /* @__PURE__ */ React.createElement(
|
|
939
|
-
DeleteConfirm,
|
|
940
|
-
{
|
|
941
|
-
agent: phase.agent,
|
|
942
|
-
setModeState: (state) => {
|
|
943
|
-
clearScreen();
|
|
944
|
-
setPhase({ type: "agent-actions", agent: phase.agent });
|
|
945
|
-
},
|
|
946
|
-
onAgentDeleted: handleAgentDeleted
|
|
947
|
-
}
|
|
948
|
-
);
|
|
949
|
-
}
|
|
950
|
-
const currentTab = phase.type === "main" ? activeTab : phase.type === "agent-actions" ? "actions" : "edit";
|
|
951
|
-
return /* @__PURE__ */ React.createElement(
|
|
952
|
-
TabbedListView,
|
|
953
|
-
{
|
|
954
|
-
title,
|
|
955
|
-
tabs,
|
|
956
|
-
activeTab: currentTab,
|
|
957
|
-
onTabChange: handleTabChange,
|
|
958
|
-
items,
|
|
959
|
-
searchEnabled,
|
|
960
|
-
searchQuery,
|
|
961
|
-
onSearchChange: setSearchQuery,
|
|
962
|
-
onSelect: handleSelect,
|
|
963
|
-
onClose: handleClose,
|
|
964
|
-
onBack: handleBack,
|
|
965
|
-
statusOverlay,
|
|
966
|
-
footerHint,
|
|
967
|
-
groupByCategory: phase.type === "main" && activeTab === "all",
|
|
968
|
-
isLoading: loading,
|
|
969
|
-
loadingText: "Loading agents...",
|
|
970
|
-
emptyText: phase.type === "main" ? 'No agents found. Select "+ Create new agent" to get started.' : "No items",
|
|
971
|
-
statusDismissHint: "Enter Continue \xB7 Esc Back"
|
|
972
|
-
}
|
|
973
|
-
);
|
|
974
|
-
}
|
|
975
|
-
function GenerateStep({
|
|
976
|
-
createState,
|
|
977
|
-
setCreateState,
|
|
978
|
-
setModeState,
|
|
979
|
-
existingAgents
|
|
980
|
-
}) {
|
|
981
|
-
const handleSubmit = async () => {
|
|
982
|
-
if (createState.generationPrompt.trim()) {
|
|
983
|
-
setCreateState({ type: "SET_IS_GENERATING", value: true });
|
|
984
|
-
setCreateState({ type: "SET_ERROR", value: null });
|
|
985
|
-
try {
|
|
986
|
-
const generated = await generateAgentWithClaude(
|
|
987
|
-
createState.generationPrompt
|
|
988
|
-
);
|
|
989
|
-
const validation = validateAgentType(
|
|
990
|
-
generated.identifier,
|
|
991
|
-
existingAgents
|
|
992
|
-
);
|
|
993
|
-
let finalIdentifier = generated.identifier;
|
|
994
|
-
if (!validation.isValid) {
|
|
995
|
-
let counter = 1;
|
|
996
|
-
while (true) {
|
|
997
|
-
const testId = `${generated.identifier}-${counter}`;
|
|
998
|
-
const testValidation = validateAgentType(testId, existingAgents);
|
|
999
|
-
if (testValidation.isValid) {
|
|
1000
|
-
finalIdentifier = testId;
|
|
1001
|
-
break;
|
|
1002
|
-
}
|
|
1003
|
-
counter++;
|
|
1004
|
-
if (counter > 10) {
|
|
1005
|
-
finalIdentifier = `custom-agent-${Date.now()}`;
|
|
1006
|
-
break;
|
|
1007
|
-
}
|
|
1008
|
-
}
|
|
1009
|
-
}
|
|
1010
|
-
setCreateState({ type: "SET_AGENT_TYPE", value: finalIdentifier });
|
|
1011
|
-
setCreateState({ type: "SET_WHEN_TO_USE", value: generated.whenToUse });
|
|
1012
|
-
setCreateState({
|
|
1013
|
-
type: "SET_SYSTEM_PROMPT",
|
|
1014
|
-
value: generated.systemPrompt
|
|
1015
|
-
});
|
|
1016
|
-
setCreateState({ type: "SET_WAS_GENERATED", value: true });
|
|
1017
|
-
setCreateState({ type: "SET_IS_GENERATING", value: false });
|
|
1018
|
-
setModeState({ mode: "create-tools", location: createState.location });
|
|
1019
|
-
} catch (error) {
|
|
1020
|
-
console.error("Generation failed:", error);
|
|
1021
|
-
setCreateState({
|
|
1022
|
-
type: "SET_ERROR",
|
|
1023
|
-
value: "Failed to generate agent. Please try again or use manual configuration."
|
|
1024
|
-
});
|
|
1025
|
-
setCreateState({ type: "SET_IS_GENERATING", value: false });
|
|
1026
|
-
}
|
|
1027
|
-
}
|
|
1028
|
-
};
|
|
1029
|
-
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(
|
|
1030
|
-
Header,
|
|
1031
|
-
{
|
|
1032
|
-
title: "\u2728 New Agent",
|
|
1033
|
-
subtitle: "What should it do?",
|
|
1034
|
-
step: 2,
|
|
1035
|
-
totalSteps: 8
|
|
1036
|
-
},
|
|
1037
|
-
/* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, createState.isGenerating ? /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, createState.generationPrompt), /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(LoadingSpinner, { text: "Generating agent configuration..." }))) : /* @__PURE__ */ React.createElement(
|
|
1038
|
-
MultilineTextInput,
|
|
1039
|
-
{
|
|
1040
|
-
value: createState.generationPrompt,
|
|
1041
|
-
onChange: (value) => setCreateState({ type: "SET_GENERATION_PROMPT", value }),
|
|
1042
|
-
placeholder: "An expert that reviews pull requests for best practices, security issues, and suggests improvements...",
|
|
1043
|
-
onSubmit: handleSubmit,
|
|
1044
|
-
error: createState.error,
|
|
1045
|
-
rows: 3
|
|
1046
|
-
}
|
|
1047
|
-
))
|
|
1048
|
-
), /* @__PURE__ */ React.createElement(InstructionBar, null));
|
|
1049
|
-
}
|
|
1050
|
-
function TypeStep({
|
|
1051
|
-
createState,
|
|
1052
|
-
setCreateState,
|
|
1053
|
-
setModeState,
|
|
1054
|
-
existingAgents
|
|
1055
|
-
}) {
|
|
1056
|
-
const handleSubmit = () => {
|
|
1057
|
-
const validation = validateAgentType(createState.agentType, existingAgents);
|
|
1058
|
-
if (validation.isValid) {
|
|
1059
|
-
setModeState({ mode: "create-prompt", location: createState.location });
|
|
1060
|
-
} else {
|
|
1061
|
-
setCreateState({ type: "SET_ERROR", value: validation.errors[0] });
|
|
1062
|
-
}
|
|
1063
|
-
};
|
|
1064
|
-
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(
|
|
1065
|
-
Header,
|
|
1066
|
-
{
|
|
1067
|
-
title: "Create new agent",
|
|
1068
|
-
subtitle: "Enter agent identifier",
|
|
1069
|
-
step: 3,
|
|
1070
|
-
totalSteps: 8
|
|
1071
|
-
},
|
|
1072
|
-
/* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(
|
|
1073
|
-
InkTextInput,
|
|
1074
|
-
{
|
|
1075
|
-
value: createState.agentType,
|
|
1076
|
-
onChange: (value) => setCreateState({ type: "SET_AGENT_TYPE", value }),
|
|
1077
|
-
placeholder: "e.g. code-reviewer, tech-lead",
|
|
1078
|
-
onSubmit: handleSubmit
|
|
1079
|
-
}
|
|
1080
|
-
), createState.error && /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { color: "red" }, "\u26A0 ", createState.error)))
|
|
1081
|
-
), /* @__PURE__ */ React.createElement(InstructionBar, null));
|
|
1082
|
-
}
|
|
1083
|
-
function DescriptionStep({
|
|
1084
|
-
createState,
|
|
1085
|
-
setCreateState,
|
|
1086
|
-
setModeState
|
|
1087
|
-
}) {
|
|
1088
|
-
const handleSubmit = () => {
|
|
1089
|
-
if (createState.whenToUse.trim()) {
|
|
1090
|
-
setModeState({ mode: "create-tools", location: createState.location });
|
|
1091
|
-
}
|
|
1092
|
-
};
|
|
1093
|
-
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(
|
|
1094
|
-
Header,
|
|
1095
|
-
{
|
|
1096
|
-
title: "Create new agent",
|
|
1097
|
-
subtitle: "Describe when to use this agent",
|
|
1098
|
-
step: 5,
|
|
1099
|
-
totalSteps: 8
|
|
1100
|
-
},
|
|
1101
|
-
/* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(
|
|
1102
|
-
MultilineTextInput,
|
|
1103
|
-
{
|
|
1104
|
-
value: createState.whenToUse,
|
|
1105
|
-
onChange: (value) => setCreateState({ type: "SET_WHEN_TO_USE", value }),
|
|
1106
|
-
placeholder: "Use this agent when you need to review code for best practices, security issues...",
|
|
1107
|
-
onSubmit: handleSubmit,
|
|
1108
|
-
error: createState.error,
|
|
1109
|
-
rows: 4
|
|
1110
|
-
}
|
|
1111
|
-
))
|
|
1112
|
-
), /* @__PURE__ */ React.createElement(InstructionBar, null));
|
|
1113
|
-
}
|
|
1114
|
-
function ToolsStep({
|
|
1115
|
-
createState,
|
|
1116
|
-
setCreateState,
|
|
1117
|
-
setModeState,
|
|
1118
|
-
tools
|
|
1119
|
-
}) {
|
|
1120
|
-
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
1121
|
-
const initialSelection = createState.selectedTools.length > 0 ? new Set(createState.selectedTools) : new Set(tools.map((t) => t.name));
|
|
1122
|
-
const [selectedTools, setSelectedTools] = useState(initialSelection);
|
|
1123
|
-
const [showAdvanced, setShowAdvanced] = useState(false);
|
|
1124
|
-
const [selectedCategory, setSelectedCategory] = useState("all");
|
|
1125
|
-
const categorizedTools = useMemo(() => {
|
|
1126
|
-
const categories = {
|
|
1127
|
-
read: [],
|
|
1128
|
-
edit: [],
|
|
1129
|
-
execution: [],
|
|
1130
|
-
web: [],
|
|
1131
|
-
mcp: [],
|
|
1132
|
-
other: []
|
|
1133
|
-
};
|
|
1134
|
-
tools.forEach((tool) => {
|
|
1135
|
-
let categorized = false;
|
|
1136
|
-
if (tool.name.startsWith("mcp__")) {
|
|
1137
|
-
categories.mcp.push(tool);
|
|
1138
|
-
categorized = true;
|
|
1139
|
-
} else {
|
|
1140
|
-
for (const [category, toolNames] of Object.entries(TOOL_CATEGORIES)) {
|
|
1141
|
-
if (Array.isArray(toolNames) && toolNames.includes(tool.name)) {
|
|
1142
|
-
categories[category]?.push(tool);
|
|
1143
|
-
categorized = true;
|
|
1144
|
-
break;
|
|
1145
|
-
}
|
|
1146
|
-
}
|
|
1147
|
-
}
|
|
1148
|
-
if (!categorized) {
|
|
1149
|
-
categories.other.push(tool);
|
|
1150
|
-
}
|
|
1151
|
-
});
|
|
1152
|
-
return categories;
|
|
1153
|
-
}, [tools]);
|
|
1154
|
-
const displayTools = useMemo(() => {
|
|
1155
|
-
if (selectedCategory === "all") {
|
|
1156
|
-
return tools;
|
|
1157
|
-
}
|
|
1158
|
-
return categorizedTools[selectedCategory] || [];
|
|
1159
|
-
}, [selectedCategory, tools, categorizedTools]);
|
|
1160
|
-
const allSelected = selectedTools.size === tools.length && tools.length > 0;
|
|
1161
|
-
const categoryOptions = [
|
|
1162
|
-
{ id: "all", label: `All (${tools.length})` },
|
|
1163
|
-
{ id: "read", label: `Read (${categorizedTools.read.length})` },
|
|
1164
|
-
{ id: "edit", label: `Edit (${categorizedTools.edit.length})` },
|
|
1165
|
-
{
|
|
1166
|
-
id: "execution",
|
|
1167
|
-
label: `Execution (${categorizedTools.execution.length})`
|
|
1168
|
-
},
|
|
1169
|
-
{ id: "web", label: `Web (${categorizedTools.web.length})` },
|
|
1170
|
-
{ id: "mcp", label: `MCP (${categorizedTools.mcp.length})` },
|
|
1171
|
-
{ id: "other", label: `Other (${categorizedTools.other.length})` }
|
|
1172
|
-
].filter((cat) => cat.id === "all" || categorizedTools[cat.id]?.length > 0);
|
|
1173
|
-
const readSelected = categorizedTools.read.every(
|
|
1174
|
-
(tool) => selectedTools.has(tool.name)
|
|
1175
|
-
);
|
|
1176
|
-
const editSelected = categorizedTools.edit.every(
|
|
1177
|
-
(tool) => selectedTools.has(tool.name)
|
|
1178
|
-
);
|
|
1179
|
-
const execSelected = categorizedTools.execution.every(
|
|
1180
|
-
(tool) => selectedTools.has(tool.name)
|
|
1181
|
-
);
|
|
1182
|
-
const webSelected = categorizedTools.web.every(
|
|
1183
|
-
(tool) => selectedTools.has(tool.name)
|
|
1184
|
-
);
|
|
1185
|
-
const options = [
|
|
1186
|
-
{ id: "continue", label: "Save", isContinue: true },
|
|
1187
|
-
{
|
|
1188
|
-
id: "separator1",
|
|
1189
|
-
label: "\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500",
|
|
1190
|
-
isSeparator: true
|
|
1191
|
-
},
|
|
1192
|
-
{
|
|
1193
|
-
id: "all",
|
|
1194
|
-
label: `${allSelected ? UI_ICONS.checkboxOn : UI_ICONS.checkboxOff} All tools`,
|
|
1195
|
-
isAll: true
|
|
1196
|
-
},
|
|
1197
|
-
{
|
|
1198
|
-
id: "read",
|
|
1199
|
-
label: `${readSelected ? UI_ICONS.checkboxOn : UI_ICONS.checkboxOff} Read-only tools`,
|
|
1200
|
-
isCategory: true
|
|
1201
|
-
},
|
|
1202
|
-
{
|
|
1203
|
-
id: "edit",
|
|
1204
|
-
label: `${editSelected ? UI_ICONS.checkboxOn : UI_ICONS.checkboxOff} Edit tools`,
|
|
1205
|
-
isCategory: true
|
|
1206
|
-
},
|
|
1207
|
-
{
|
|
1208
|
-
id: "execution",
|
|
1209
|
-
label: `${execSelected ? UI_ICONS.checkboxOn : UI_ICONS.checkboxOff} Execution tools`,
|
|
1210
|
-
isCategory: true
|
|
1211
|
-
},
|
|
1212
|
-
{
|
|
1213
|
-
id: "separator2",
|
|
1214
|
-
label: "\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500",
|
|
1215
|
-
isSeparator: true
|
|
1216
|
-
},
|
|
1217
|
-
{
|
|
1218
|
-
id: "advanced",
|
|
1219
|
-
label: `[ ${showAdvanced ? "Hide" : "Show"} advanced options ]`,
|
|
1220
|
-
isAdvancedToggle: true
|
|
1221
|
-
},
|
|
1222
|
-
...showAdvanced ? displayTools.map((tool) => ({
|
|
1223
|
-
id: tool.name,
|
|
1224
|
-
label: `${selectedTools.has(tool.name) ? UI_ICONS.checkboxOn : UI_ICONS.checkboxOff} ${tool.name}`,
|
|
1225
|
-
isTool: true
|
|
1226
|
-
})) : []
|
|
1227
|
-
];
|
|
1228
|
-
const handleSelect = () => {
|
|
1229
|
-
const option = options[selectedIndex];
|
|
1230
|
-
if (!option) return;
|
|
1231
|
-
if (option.isSeparator) return;
|
|
1232
|
-
if (option.isContinue) {
|
|
1233
|
-
const result = allSelected ? ["*"] : Array.from(selectedTools);
|
|
1234
|
-
setCreateState({ type: "SET_SELECTED_TOOLS", value: result });
|
|
1235
|
-
setModeState({ mode: "create-model", location: createState.location });
|
|
1236
|
-
} else if (option.isAdvancedToggle) {
|
|
1237
|
-
setShowAdvanced(!showAdvanced);
|
|
1238
|
-
} else if (option.isAll) {
|
|
1239
|
-
if (allSelected) {
|
|
1240
|
-
setSelectedTools(/* @__PURE__ */ new Set());
|
|
1241
|
-
} else {
|
|
1242
|
-
setSelectedTools(new Set(tools.map((t) => t.name)));
|
|
1243
|
-
}
|
|
1244
|
-
} else if (option.isCategory) {
|
|
1245
|
-
const categoryName = option.id;
|
|
1246
|
-
const categoryTools = categorizedTools[categoryName] || [];
|
|
1247
|
-
const newSelected = new Set(selectedTools);
|
|
1248
|
-
const categorySelected = categoryTools.every(
|
|
1249
|
-
(tool) => selectedTools.has(tool.name)
|
|
1250
|
-
);
|
|
1251
|
-
if (categorySelected) {
|
|
1252
|
-
categoryTools.forEach((tool) => newSelected.delete(tool.name));
|
|
1253
|
-
} else {
|
|
1254
|
-
categoryTools.forEach((tool) => newSelected.add(tool.name));
|
|
1255
|
-
}
|
|
1256
|
-
setSelectedTools(newSelected);
|
|
1257
|
-
} else if (option.isTool) {
|
|
1258
|
-
const newSelected = new Set(selectedTools);
|
|
1259
|
-
if (newSelected.has(option.id)) {
|
|
1260
|
-
newSelected.delete(option.id);
|
|
1261
|
-
} else {
|
|
1262
|
-
newSelected.add(option.id);
|
|
1263
|
-
}
|
|
1264
|
-
setSelectedTools(newSelected);
|
|
1265
|
-
}
|
|
1266
|
-
};
|
|
1267
|
-
useInput((input, key) => {
|
|
1268
|
-
if (key.return) {
|
|
1269
|
-
handleSelect();
|
|
1270
|
-
} else if (key.upArrow) {
|
|
1271
|
-
setSelectedIndex((prev) => {
|
|
1272
|
-
let newIndex = prev > 0 ? prev - 1 : options.length - 1;
|
|
1273
|
-
while (options[newIndex] && options[newIndex].isSeparator) {
|
|
1274
|
-
newIndex = newIndex > 0 ? newIndex - 1 : options.length - 1;
|
|
1275
|
-
}
|
|
1276
|
-
return newIndex;
|
|
1277
|
-
});
|
|
1278
|
-
} else if (key.downArrow) {
|
|
1279
|
-
setSelectedIndex((prev) => {
|
|
1280
|
-
let newIndex = prev < options.length - 1 ? prev + 1 : 0;
|
|
1281
|
-
while (options[newIndex] && options[newIndex].isSeparator) {
|
|
1282
|
-
newIndex = newIndex < options.length - 1 ? newIndex + 1 : 0;
|
|
1283
|
-
}
|
|
1284
|
-
return newIndex;
|
|
1285
|
-
});
|
|
1286
|
-
}
|
|
1287
|
-
});
|
|
1288
|
-
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Header, { title: "\u{1F527} Tool Permissions", subtitle: "", step: 3, totalSteps: 5 }, /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", marginTop: 1 }, options.map((option, idx) => {
|
|
1289
|
-
const isSelected = idx === selectedIndex;
|
|
1290
|
-
const isContinue = option.isContinue;
|
|
1291
|
-
const isAdvancedToggle = option.isAdvancedToggle;
|
|
1292
|
-
const isSeparator = option.isSeparator;
|
|
1293
|
-
return /* @__PURE__ */ React.createElement(Box, { key: option.id }, /* @__PURE__ */ React.createElement(
|
|
1294
|
-
Text,
|
|
1295
|
-
{
|
|
1296
|
-
color: isSelected && !isSeparator ? "cyan" : isSeparator ? SEMANTIC_COLORS.dim : void 0,
|
|
1297
|
-
bold: isContinue
|
|
1298
|
-
},
|
|
1299
|
-
isSeparator ? option.label : `${isSelected ? `${UI_ICONS.pointer} ` : " "}${isContinue || isAdvancedToggle ? `${option.label}` : option.label}`
|
|
1300
|
-
), option.isTool && isSelected && tools.find((t) => t.name === option.id)?.description && /* @__PURE__ */ React.createElement(Box, { marginLeft: 4 }, /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, tools.find((t) => t.name === option.id)?.description)));
|
|
1301
|
-
}), /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, allSelected ? "All tools selected" : `${selectedTools.size} of ${tools.length} tools selected`), selectedCategory !== "all" && /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, "Filtering: ", selectedCategory, " tools")))), /* @__PURE__ */ React.createElement(InstructionBar, { instructions: "\u2191\u2193 Navigate \u2022 Enter Toggle \u2022 Esc Back" }));
|
|
1302
|
-
}
|
|
1303
|
-
function ModelStep({ createState, setCreateState, setModeState }) {
|
|
1304
|
-
const theme = getTheme();
|
|
1305
|
-
const manager = getModelManager();
|
|
1306
|
-
const profiles = manager.getActiveModelProfiles();
|
|
1307
|
-
const groupedModels = profiles.reduce((acc, profile) => {
|
|
1308
|
-
const provider = profile.provider || "Default";
|
|
1309
|
-
if (!acc[provider]) acc[provider] = [];
|
|
1310
|
-
acc[provider].push(profile);
|
|
1311
|
-
return acc;
|
|
1312
|
-
}, {});
|
|
1313
|
-
const modelOptions = [
|
|
1314
|
-
{
|
|
1315
|
-
id: null,
|
|
1316
|
-
name: "\u25C8 Inherit from parent",
|
|
1317
|
-
provider: "System",
|
|
1318
|
-
modelName: "default"
|
|
1319
|
-
},
|
|
1320
|
-
...Object.entries(groupedModels).flatMap(
|
|
1321
|
-
([provider, models]) => models.map((p) => ({
|
|
1322
|
-
id: p.modelName,
|
|
1323
|
-
name: p.name,
|
|
1324
|
-
provider,
|
|
1325
|
-
modelName: p.modelName
|
|
1326
|
-
}))
|
|
1327
|
-
)
|
|
1328
|
-
];
|
|
1329
|
-
const [selectedIndex, setSelectedIndex] = useState(() => {
|
|
1330
|
-
const idx = modelOptions.findIndex((m) => m.id === createState.selectedModel);
|
|
1331
|
-
return idx >= 0 ? idx : 0;
|
|
1332
|
-
});
|
|
1333
|
-
const handleSelect = (modelId) => {
|
|
1334
|
-
setCreateState({ type: "SET_SELECTED_MODEL", value: modelId });
|
|
1335
|
-
setModeState({ mode: "create-color", location: createState.location });
|
|
1336
|
-
};
|
|
1337
|
-
useInput((input, key) => {
|
|
1338
|
-
if (key.return) {
|
|
1339
|
-
handleSelect(modelOptions[selectedIndex].id);
|
|
1340
|
-
} else if (key.upArrow) {
|
|
1341
|
-
setSelectedIndex((prev) => prev > 0 ? prev - 1 : modelOptions.length - 1);
|
|
1342
|
-
} else if (key.downArrow) {
|
|
1343
|
-
setSelectedIndex((prev) => prev < modelOptions.length - 1 ? prev + 1 : 0);
|
|
1344
|
-
}
|
|
1345
|
-
});
|
|
1346
|
-
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Header, { title: "\u{1F916} Select Model", subtitle: "", step: 4, totalSteps: 5 }, /* @__PURE__ */ React.createElement(Box, { marginTop: 1, flexDirection: "column" }, modelOptions.map((model, index) => {
|
|
1347
|
-
const isSelected = index === selectedIndex;
|
|
1348
|
-
const isInherit = model.id === null;
|
|
1349
|
-
return /* @__PURE__ */ React.createElement(Box, { key: model.id || "inherit", marginBottom: 0 }, /* @__PURE__ */ React.createElement(Box, { flexDirection: "row", gap: 1 }, /* @__PURE__ */ React.createElement(Text, { color: isSelected ? theme.primary : void 0 }, isSelected ? UI_ICONS.pointer : " "), /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", flexGrow: 1 }, /* @__PURE__ */ React.createElement(Box, { flexDirection: "row", gap: 1 }, /* @__PURE__ */ React.createElement(
|
|
1350
|
-
Text,
|
|
1351
|
-
{
|
|
1352
|
-
bold: isInherit,
|
|
1353
|
-
color: isSelected ? theme.primary : void 0
|
|
1354
|
-
},
|
|
1355
|
-
model.name
|
|
1356
|
-
), !isInherit && /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, model.provider, " \u2022 ", model.modelName)))));
|
|
1357
|
-
}))), /* @__PURE__ */ React.createElement(InstructionBar, { instructions: "\u2191\u2193 Navigate \u2022 Enter Select" }));
|
|
1358
|
-
}
|
|
1359
|
-
function ColorStep({ createState, setCreateState, setModeState }) {
|
|
1360
|
-
const theme = getTheme();
|
|
1361
|
-
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
1362
|
-
const colors = [
|
|
1363
|
-
{ label: "Default", value: null, displayColor: null },
|
|
1364
|
-
{ label: "Yellow", value: "yellow", displayColor: "yellow" },
|
|
1365
|
-
{ label: "Blue", value: "blue", displayColor: "blue" },
|
|
1366
|
-
{ label: "Magenta", value: "magenta", displayColor: "magenta" },
|
|
1367
|
-
{ label: "Cyan", value: "cyan", displayColor: "cyan" },
|
|
1368
|
-
{ label: "Gray", value: "gray", displayColor: "gray" },
|
|
1369
|
-
{ label: "White", value: "white", displayColor: "white" }
|
|
1370
|
-
];
|
|
1371
|
-
const handleSelect = (value) => {
|
|
1372
|
-
setCreateState({ type: "SET_SELECTED_COLOR", value });
|
|
1373
|
-
setModeState({ mode: "create-confirm", location: createState.location });
|
|
1374
|
-
};
|
|
1375
|
-
useInput((input, key) => {
|
|
1376
|
-
if (key.return) {
|
|
1377
|
-
handleSelect(colors[selectedIndex].value);
|
|
1378
|
-
} else if (key.upArrow) {
|
|
1379
|
-
setSelectedIndex((prev) => prev > 0 ? prev - 1 : colors.length - 1);
|
|
1380
|
-
} else if (key.downArrow) {
|
|
1381
|
-
setSelectedIndex((prev) => prev < colors.length - 1 ? prev + 1 : 0);
|
|
1382
|
-
}
|
|
1383
|
-
});
|
|
1384
|
-
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Header, { title: "\u{1F3A8} Color Theme", subtitle: "", step: 5, totalSteps: 5 }, /* @__PURE__ */ React.createElement(Box, { marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React.createElement(Box, { marginBottom: 1 }, /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, "Choose how your agent appears in the list:")), colors.map((color, idx) => {
|
|
1385
|
-
const isSelected = idx === selectedIndex;
|
|
1386
|
-
return /* @__PURE__ */ React.createElement(Box, { key: idx, flexDirection: "row" }, /* @__PURE__ */ React.createElement(Text, { color: isSelected ? theme.primary : void 0 }, isSelected ? "\u276F " : " "), /* @__PURE__ */ React.createElement(Box, { minWidth: 12 }, /* @__PURE__ */ React.createElement(
|
|
1387
|
-
Text,
|
|
1388
|
-
{
|
|
1389
|
-
bold: isSelected,
|
|
1390
|
-
color: color.displayColor || void 0
|
|
1391
|
-
},
|
|
1392
|
-
color.label
|
|
1393
|
-
)));
|
|
1394
|
-
}), /* @__PURE__ */ React.createElement(Box, { marginTop: 1, paddingLeft: 2 }, /* @__PURE__ */ React.createElement(Text, null, "Preview: "), /* @__PURE__ */ React.createElement(Text, { bold: true, color: colors[selectedIndex].displayColor || void 0 }, createState.agentType || "your-agent")))), /* @__PURE__ */ React.createElement(InstructionBar, { instructions: "\u2191\u2193 Navigate \u2022 Enter Select" }));
|
|
1395
|
-
}
|
|
1396
|
-
function PromptStep({ createState, setCreateState, setModeState }) {
|
|
1397
|
-
const handleSubmit = () => {
|
|
1398
|
-
if (createState.systemPrompt.trim()) {
|
|
1399
|
-
setModeState({
|
|
1400
|
-
mode: "create-description",
|
|
1401
|
-
location: createState.location
|
|
1402
|
-
});
|
|
1403
|
-
}
|
|
1404
|
-
};
|
|
1405
|
-
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(
|
|
1406
|
-
Header,
|
|
1407
|
-
{
|
|
1408
|
-
title: "Create new agent",
|
|
1409
|
-
subtitle: "System prompt",
|
|
1410
|
-
step: 4,
|
|
1411
|
-
totalSteps: 8
|
|
1412
|
-
},
|
|
1413
|
-
/* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(
|
|
1414
|
-
MultilineTextInput,
|
|
1415
|
-
{
|
|
1416
|
-
value: createState.systemPrompt,
|
|
1417
|
-
onChange: (value) => setCreateState({ type: "SET_SYSTEM_PROMPT", value }),
|
|
1418
|
-
placeholder: "You are a helpful assistant that specializes in...",
|
|
1419
|
-
onSubmit: handleSubmit,
|
|
1420
|
-
error: createState.error,
|
|
1421
|
-
rows: 5
|
|
1422
|
-
}
|
|
1423
|
-
))
|
|
1424
|
-
), /* @__PURE__ */ React.createElement(InstructionBar, null));
|
|
1425
|
-
}
|
|
1426
|
-
function ConfirmStep({
|
|
1427
|
-
createState,
|
|
1428
|
-
setCreateState,
|
|
1429
|
-
setModeState,
|
|
1430
|
-
tools,
|
|
1431
|
-
onAgentCreated
|
|
1432
|
-
}) {
|
|
1433
|
-
const [isCreating, setIsCreating] = useState(false);
|
|
1434
|
-
const theme = getTheme();
|
|
1435
|
-
const handleConfirm = async () => {
|
|
1436
|
-
setIsCreating(true);
|
|
1437
|
-
try {
|
|
1438
|
-
await saveAgent(
|
|
1439
|
-
createState.location,
|
|
1440
|
-
createState.agentType,
|
|
1441
|
-
createState.whenToUse,
|
|
1442
|
-
createState.selectedTools,
|
|
1443
|
-
createState.systemPrompt,
|
|
1444
|
-
createState.selectedModel,
|
|
1445
|
-
createState.selectedColor || void 0
|
|
1446
|
-
);
|
|
1447
|
-
onAgentCreated(`Created agent: ${createState.agentType}`);
|
|
1448
|
-
} catch (error) {
|
|
1449
|
-
setCreateState({ type: "SET_ERROR", value: error.message });
|
|
1450
|
-
setIsCreating(false);
|
|
1451
|
-
}
|
|
1452
|
-
};
|
|
1453
|
-
const validation = validateAgentConfig(createState);
|
|
1454
|
-
const toolNames = createState.selectedTools.includes("*") ? "All tools" : createState.selectedTools.length > 0 ? createState.selectedTools.join(", ") : "No tools";
|
|
1455
|
-
const handleEditInEditor = async () => {
|
|
1456
|
-
const filePath = createState.location === "project" ? path.join(
|
|
1457
|
-
process.cwd(),
|
|
1458
|
-
".minto",
|
|
1459
|
-
"agents",
|
|
1460
|
-
`${createState.agentType}.md`
|
|
1461
|
-
) : path.join(
|
|
1462
|
-
os.homedir(),
|
|
1463
|
-
".minto",
|
|
1464
|
-
"agents",
|
|
1465
|
-
`${createState.agentType}.md`
|
|
1466
|
-
);
|
|
1467
|
-
try {
|
|
1468
|
-
await saveAgent(
|
|
1469
|
-
createState.location,
|
|
1470
|
-
createState.agentType,
|
|
1471
|
-
createState.whenToUse,
|
|
1472
|
-
createState.selectedTools,
|
|
1473
|
-
createState.systemPrompt,
|
|
1474
|
-
createState.selectedModel,
|
|
1475
|
-
createState.selectedColor || void 0
|
|
1476
|
-
);
|
|
1477
|
-
const command = process.platform === "win32" ? "start" : process.platform === "darwin" ? "open" : "xdg-open";
|
|
1478
|
-
await execAsync(`${command} "${filePath}"`);
|
|
1479
|
-
onAgentCreated(`Created agent: ${createState.agentType}`);
|
|
1480
|
-
} catch (error) {
|
|
1481
|
-
setCreateState({ type: "SET_ERROR", value: error.message });
|
|
1482
|
-
}
|
|
1483
|
-
};
|
|
1484
|
-
useInput((input, key) => {
|
|
1485
|
-
if (isCreating) return;
|
|
1486
|
-
if ((key.return || input === "s") && !isCreating) {
|
|
1487
|
-
handleConfirm();
|
|
1488
|
-
} else if (input === "e") {
|
|
1489
|
-
handleEditInEditor();
|
|
1490
|
-
} else if (key.escape) {
|
|
1491
|
-
setModeState({ mode: "create-color", location: createState.location });
|
|
1492
|
-
}
|
|
1493
|
-
});
|
|
1494
|
-
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Header, { title: "\u2705 Review & Create", subtitle: "" }, /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React.createElement(Box, { marginBottom: 1 }, /* @__PURE__ */ React.createElement(Text, { bold: true, color: theme.primary }, "\u{1F4CB} Configuration")), /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", gap: 0 }, /* @__PURE__ */ React.createElement(Text, null, "\u2022 ", /* @__PURE__ */ React.createElement(Text, { bold: true }, "Agent ID:"), " ", createState.agentType), /* @__PURE__ */ React.createElement(Text, null, "\u2022 ", /* @__PURE__ */ React.createElement(Text, { bold: true }, "Location:"), " ", createState.location === "project" ? "Project" : "Personal"), /* @__PURE__ */ React.createElement(Text, null, "\u2022 ", /* @__PURE__ */ React.createElement(Text, { bold: true }, "Tools:"), " ", toolNames.length > 50 ? toolNames.slice(0, 50) + "..." : toolNames), /* @__PURE__ */ React.createElement(Text, null, "\u2022 ", /* @__PURE__ */ React.createElement(Text, { bold: true }, "Model:"), " ", getDisplayModelName(createState.selectedModel)), createState.selectedColor && /* @__PURE__ */ React.createElement(Text, null, "\u2022 ", /* @__PURE__ */ React.createElement(Text, { bold: true }, "Color:"), " ", /* @__PURE__ */ React.createElement(Text, { color: createState.selectedColor }, createState.selectedColor))), /* @__PURE__ */ React.createElement(Box, { marginTop: 1, marginBottom: 1 }, /* @__PURE__ */ React.createElement(Text, { bold: true, color: theme.primary }, "\u{1F4DD} Purpose")), /* @__PURE__ */ React.createElement(Box, { paddingLeft: 1 }, /* @__PURE__ */ React.createElement(Text, null, createState.whenToUse)), validation.warnings.length > 0 && /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { bold: true }, "Warnings:")), validation.warnings.map((warning, idx) => /* @__PURE__ */ React.createElement(Fragment, { key: idx }, /* @__PURE__ */ React.createElement(Text, { color: theme.warning }, " \u2022 ", warning)))), createState.error && /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { color: theme.error }, "\u2717 ", createState.error)), /* @__PURE__ */ React.createElement(Box, { marginTop: 2 }, isCreating ? /* @__PURE__ */ React.createElement(LoadingSpinner, { text: "Creating agent..." }) : null))), /* @__PURE__ */ React.createElement(InstructionBar, { instructions: "Enter Save \u2022 E Edit \u2022 Esc Back" }));
|
|
1495
|
-
}
|
|
1496
|
-
function LocationSelect({
|
|
1497
|
-
createState,
|
|
1498
|
-
setCreateState,
|
|
1499
|
-
setModeState
|
|
1500
|
-
}) {
|
|
1501
|
-
const theme = getTheme();
|
|
1502
|
-
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
1503
|
-
const options = [
|
|
1504
|
-
{ label: "\u{1F4C1} Project", value: "project", desc: ".minto/agents/" },
|
|
1505
|
-
{ label: "\u{1F3E0} Personal", value: "user", desc: "~/.minto/agents/" }
|
|
1506
|
-
];
|
|
1507
|
-
const handleChange = (value) => {
|
|
1508
|
-
setCreateState({ type: "SET_LOCATION", value });
|
|
1509
|
-
setCreateState({ type: "SET_METHOD", value: "generate" });
|
|
1510
|
-
setModeState({ mode: "create-generate", location: value });
|
|
1511
|
-
};
|
|
1512
|
-
const handleCancel = () => {
|
|
1513
|
-
setModeState({ mode: "list-agents", location: "all" });
|
|
1514
|
-
};
|
|
1515
|
-
useInput((input, key) => {
|
|
1516
|
-
if (key.escape) {
|
|
1517
|
-
handleCancel();
|
|
1518
|
-
} else if (key.return) {
|
|
1519
|
-
handleChange(options[selectedIndex].value);
|
|
1520
|
-
} else if (key.upArrow) {
|
|
1521
|
-
setSelectedIndex((prev) => prev > 0 ? prev - 1 : options.length - 1);
|
|
1522
|
-
} else if (key.downArrow) {
|
|
1523
|
-
setSelectedIndex((prev) => prev < options.length - 1 ? prev + 1 : 0);
|
|
1524
|
-
}
|
|
1525
|
-
});
|
|
1526
|
-
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Header, { title: "\u{1F4E6} Save Location", subtitle: "", step: 1, totalSteps: 5 }, /* @__PURE__ */ React.createElement(Box, { marginTop: 1, flexDirection: "column" }, options.map((opt, idx) => /* @__PURE__ */ React.createElement(Box, { key: opt.value, flexDirection: "column", marginBottom: 1 }, /* @__PURE__ */ React.createElement(Text, { color: idx === selectedIndex ? theme.primary : void 0 }, idx === selectedIndex ? "\u276F " : " ", opt.label), /* @__PURE__ */ React.createElement(Box, { marginLeft: 3 }, /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, opt.desc)))))), /* @__PURE__ */ React.createElement(InstructionBar, { instructions: "\u2191\u2193 Navigate \u2022 Enter Select" }));
|
|
1527
|
-
}
|
|
1528
|
-
function MethodSelect({
|
|
1529
|
-
createState,
|
|
1530
|
-
setCreateState,
|
|
1531
|
-
setModeState
|
|
1532
|
-
}) {
|
|
1533
|
-
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
1534
|
-
const options = [
|
|
1535
|
-
{ label: "Generate with Claude (recommended)", value: "generate" },
|
|
1536
|
-
{ label: "Manual configuration", value: "manual" }
|
|
1537
|
-
];
|
|
1538
|
-
const handleChange = (value) => {
|
|
1539
|
-
setCreateState({
|
|
1540
|
-
type: "SET_METHOD",
|
|
1541
|
-
value
|
|
1542
|
-
});
|
|
1543
|
-
if (value === "generate") {
|
|
1544
|
-
setCreateState({ type: "SET_IS_AI_GENERATED", value: true });
|
|
1545
|
-
setModeState({ mode: "create-generate", location: createState.location });
|
|
1546
|
-
} else {
|
|
1547
|
-
setCreateState({ type: "SET_IS_AI_GENERATED", value: false });
|
|
1548
|
-
setModeState({ mode: "create-type", location: createState.location });
|
|
1549
|
-
}
|
|
1550
|
-
};
|
|
1551
|
-
const handleCancel = () => {
|
|
1552
|
-
setModeState({ mode: "create-location" });
|
|
1553
|
-
};
|
|
1554
|
-
useInput((input, key) => {
|
|
1555
|
-
if (key.escape) {
|
|
1556
|
-
handleCancel();
|
|
1557
|
-
} else if (key.return) {
|
|
1558
|
-
handleChange(options[selectedIndex].value);
|
|
1559
|
-
} else if (key.upArrow) {
|
|
1560
|
-
setSelectedIndex((prev) => prev > 0 ? prev - 1 : options.length - 1);
|
|
1561
|
-
} else if (key.downArrow) {
|
|
1562
|
-
setSelectedIndex((prev) => prev < options.length - 1 ? prev + 1 : 0);
|
|
1563
|
-
}
|
|
1564
|
-
});
|
|
1565
|
-
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(
|
|
1566
|
-
Header,
|
|
1567
|
-
{
|
|
1568
|
-
title: "Create new agent",
|
|
1569
|
-
subtitle: "Creation method",
|
|
1570
|
-
step: 2,
|
|
1571
|
-
totalSteps: 9
|
|
1572
|
-
},
|
|
1573
|
-
/* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(
|
|
1574
|
-
SelectList,
|
|
1575
|
-
{
|
|
1576
|
-
options,
|
|
1577
|
-
selectedIndex,
|
|
1578
|
-
onChange: handleChange,
|
|
1579
|
-
onCancel: handleCancel
|
|
1580
|
-
}
|
|
1581
|
-
))
|
|
1582
|
-
), /* @__PURE__ */ React.createElement(InstructionBar, null));
|
|
1583
|
-
}
|
|
1584
|
-
function EditToolsStep({
|
|
1585
|
-
agent,
|
|
1586
|
-
tools,
|
|
1587
|
-
setModeState,
|
|
1588
|
-
onAgentUpdated
|
|
1589
|
-
}) {
|
|
1590
|
-
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
1591
|
-
const initialTools = Array.isArray(agent.tools) ? agent.tools : agent.tools === "*" ? tools.map((t) => t.name) : [];
|
|
1592
|
-
const [selectedTools, setSelectedTools] = useState(
|
|
1593
|
-
new Set(initialTools)
|
|
1594
|
-
);
|
|
1595
|
-
const [showAdvanced, setShowAdvanced] = useState(false);
|
|
1596
|
-
const [isUpdating, setIsUpdating] = useState(false);
|
|
1597
|
-
const [error, setError] = useState(null);
|
|
1598
|
-
const categorizedTools = useMemo(() => {
|
|
1599
|
-
const categories = {
|
|
1600
|
-
read: [],
|
|
1601
|
-
edit: [],
|
|
1602
|
-
execution: [],
|
|
1603
|
-
web: [],
|
|
1604
|
-
other: []
|
|
1605
|
-
};
|
|
1606
|
-
tools.forEach((tool) => {
|
|
1607
|
-
let categorized = false;
|
|
1608
|
-
for (const [category, toolNames] of Object.entries(TOOL_CATEGORIES)) {
|
|
1609
|
-
if (Array.isArray(toolNames) && toolNames.includes(tool.name)) {
|
|
1610
|
-
categories[category]?.push(tool);
|
|
1611
|
-
categorized = true;
|
|
1612
|
-
break;
|
|
1613
|
-
}
|
|
1614
|
-
}
|
|
1615
|
-
if (!categorized) {
|
|
1616
|
-
categories.other.push(tool);
|
|
1617
|
-
}
|
|
1618
|
-
});
|
|
1619
|
-
return categories;
|
|
1620
|
-
}, [tools]);
|
|
1621
|
-
const allSelected = selectedTools.size === tools.length && tools.length > 0;
|
|
1622
|
-
const readSelected = categorizedTools.read.every((tool) => selectedTools.has(tool.name)) && categorizedTools.read.length > 0;
|
|
1623
|
-
const editSelected = categorizedTools.edit.every((tool) => selectedTools.has(tool.name)) && categorizedTools.edit.length > 0;
|
|
1624
|
-
const execSelected = categorizedTools.execution.every((tool) => selectedTools.has(tool.name)) && categorizedTools.execution.length > 0;
|
|
1625
|
-
const options = [
|
|
1626
|
-
{ id: "continue", label: "Save", isContinue: true },
|
|
1627
|
-
{
|
|
1628
|
-
id: "separator1",
|
|
1629
|
-
label: "\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500",
|
|
1630
|
-
isSeparator: true
|
|
1631
|
-
},
|
|
1632
|
-
{
|
|
1633
|
-
id: "all",
|
|
1634
|
-
label: `${allSelected ? UI_ICONS.checkboxOn : UI_ICONS.checkboxOff} All tools`,
|
|
1635
|
-
isAll: true
|
|
1636
|
-
},
|
|
1637
|
-
{
|
|
1638
|
-
id: "read",
|
|
1639
|
-
label: `${readSelected ? UI_ICONS.checkboxOn : UI_ICONS.checkboxOff} Read-only tools`,
|
|
1640
|
-
isCategory: true
|
|
1641
|
-
},
|
|
1642
|
-
{
|
|
1643
|
-
id: "edit",
|
|
1644
|
-
label: `${editSelected ? UI_ICONS.checkboxOn : UI_ICONS.checkboxOff} Edit tools`,
|
|
1645
|
-
isCategory: true
|
|
1646
|
-
},
|
|
1647
|
-
{
|
|
1648
|
-
id: "execution",
|
|
1649
|
-
label: `${execSelected ? UI_ICONS.checkboxOn : UI_ICONS.checkboxOff} Execution tools`,
|
|
1650
|
-
isCategory: true
|
|
1651
|
-
},
|
|
1652
|
-
{
|
|
1653
|
-
id: "separator2",
|
|
1654
|
-
label: "\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500",
|
|
1655
|
-
isSeparator: true
|
|
1656
|
-
},
|
|
1657
|
-
{
|
|
1658
|
-
id: "advanced",
|
|
1659
|
-
label: `[ ${showAdvanced ? "Hide" : "Show"} advanced options ]`,
|
|
1660
|
-
isAdvancedToggle: true
|
|
1661
|
-
},
|
|
1662
|
-
...showAdvanced ? tools.map((tool) => ({
|
|
1663
|
-
id: tool.name,
|
|
1664
|
-
label: `${selectedTools.has(tool.name) ? UI_ICONS.checkboxOn : UI_ICONS.checkboxOff} ${tool.name}`,
|
|
1665
|
-
isTool: true
|
|
1666
|
-
})) : []
|
|
1667
|
-
];
|
|
1668
|
-
const handleSave = async () => {
|
|
1669
|
-
setIsUpdating(true);
|
|
1670
|
-
try {
|
|
1671
|
-
const toolsArray = allSelected ? "*" : Array.from(selectedTools);
|
|
1672
|
-
await updateAgent(
|
|
1673
|
-
agent,
|
|
1674
|
-
agent.whenToUse,
|
|
1675
|
-
toolsArray,
|
|
1676
|
-
agent.systemPrompt,
|
|
1677
|
-
agent.color,
|
|
1678
|
-
agent.model
|
|
1679
|
-
);
|
|
1680
|
-
clearAgentCache();
|
|
1681
|
-
const freshAgents = await getActiveAgents();
|
|
1682
|
-
const updatedAgent = freshAgents.find(
|
|
1683
|
-
(a) => a.agentType === agent.agentType
|
|
1684
|
-
);
|
|
1685
|
-
if (updatedAgent) {
|
|
1686
|
-
onAgentUpdated(
|
|
1687
|
-
`Updated tools for agent: ${agent.agentType}`,
|
|
1688
|
-
updatedAgent
|
|
1689
|
-
);
|
|
1690
|
-
setModeState({ mode: "edit-agent", selectedAgent: updatedAgent });
|
|
1691
|
-
} else {
|
|
1692
|
-
console.error("Failed to find updated agent after save");
|
|
1693
|
-
const fallbackAgent = {
|
|
1694
|
-
...agent,
|
|
1695
|
-
tools: toolsArray.length === 1 && toolsArray[0] === "*" ? "*" : toolsArray
|
|
1696
|
-
};
|
|
1697
|
-
onAgentUpdated(
|
|
1698
|
-
`Updated tools for agent: ${agent.agentType}`,
|
|
1699
|
-
fallbackAgent
|
|
1700
|
-
);
|
|
1701
|
-
setModeState({ mode: "edit-agent", selectedAgent: fallbackAgent });
|
|
1702
|
-
}
|
|
1703
|
-
} catch (err) {
|
|
1704
|
-
console.error("Failed to update agent tools:", err);
|
|
1705
|
-
setError(
|
|
1706
|
-
`Failed to update tools: ${err instanceof Error ? err.message : String(err)}`
|
|
1707
|
-
);
|
|
1708
|
-
} finally {
|
|
1709
|
-
setIsUpdating(false);
|
|
1710
|
-
}
|
|
1711
|
-
};
|
|
1712
|
-
const handleSelect = () => {
|
|
1713
|
-
setError(null);
|
|
1714
|
-
const option = options[selectedIndex];
|
|
1715
|
-
if (!option) return;
|
|
1716
|
-
if (option.isSeparator) return;
|
|
1717
|
-
if (option.isContinue) {
|
|
1718
|
-
handleSave();
|
|
1719
|
-
} else if (option.isAdvancedToggle) {
|
|
1720
|
-
setShowAdvanced(!showAdvanced);
|
|
1721
|
-
} else if (option.isAll) {
|
|
1722
|
-
if (allSelected) {
|
|
1723
|
-
setSelectedTools(/* @__PURE__ */ new Set());
|
|
1724
|
-
} else {
|
|
1725
|
-
setSelectedTools(new Set(tools.map((t) => t.name)));
|
|
1726
|
-
}
|
|
1727
|
-
} else if (option.isCategory) {
|
|
1728
|
-
const categoryName = option.id;
|
|
1729
|
-
const categoryTools = categorizedTools[categoryName] || [];
|
|
1730
|
-
const newSelected = new Set(selectedTools);
|
|
1731
|
-
const categorySelected = categoryTools.every(
|
|
1732
|
-
(tool) => selectedTools.has(tool.name)
|
|
1733
|
-
);
|
|
1734
|
-
if (categorySelected) {
|
|
1735
|
-
categoryTools.forEach((tool) => newSelected.delete(tool.name));
|
|
1736
|
-
} else {
|
|
1737
|
-
categoryTools.forEach((tool) => newSelected.add(tool.name));
|
|
1738
|
-
}
|
|
1739
|
-
setSelectedTools(newSelected);
|
|
1740
|
-
} else if (option.isTool) {
|
|
1741
|
-
const newSelected = new Set(selectedTools);
|
|
1742
|
-
if (newSelected.has(option.id)) {
|
|
1743
|
-
newSelected.delete(option.id);
|
|
1744
|
-
} else {
|
|
1745
|
-
newSelected.add(option.id);
|
|
1746
|
-
}
|
|
1747
|
-
setSelectedTools(newSelected);
|
|
1748
|
-
}
|
|
1749
|
-
};
|
|
1750
|
-
useInput((input, key) => {
|
|
1751
|
-
if (key.escape) {
|
|
1752
|
-
setModeState({ mode: "edit-agent", selectedAgent: agent });
|
|
1753
|
-
} else if (key.return && !isUpdating) {
|
|
1754
|
-
handleSelect();
|
|
1755
|
-
} else if (key.upArrow) {
|
|
1756
|
-
setSelectedIndex((prev) => {
|
|
1757
|
-
let newIndex = prev > 0 ? prev - 1 : options.length - 1;
|
|
1758
|
-
while (options[newIndex] && options[newIndex].isSeparator) {
|
|
1759
|
-
newIndex = newIndex > 0 ? newIndex - 1 : options.length - 1;
|
|
1760
|
-
}
|
|
1761
|
-
return newIndex;
|
|
1762
|
-
});
|
|
1763
|
-
} else if (key.downArrow) {
|
|
1764
|
-
setSelectedIndex((prev) => {
|
|
1765
|
-
let newIndex = prev < options.length - 1 ? prev + 1 : 0;
|
|
1766
|
-
while (options[newIndex] && options[newIndex].isSeparator) {
|
|
1767
|
-
newIndex = newIndex < options.length - 1 ? newIndex + 1 : 0;
|
|
1768
|
-
}
|
|
1769
|
-
return newIndex;
|
|
1770
|
-
});
|
|
1771
|
-
}
|
|
1772
|
-
});
|
|
1773
|
-
if (isUpdating) {
|
|
1774
|
-
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));
|
|
1775
|
-
}
|
|
1776
|
-
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) => {
|
|
1777
|
-
const isSelected = idx === selectedIndex;
|
|
1778
|
-
const isContinue = "isContinue" in option && option.isContinue;
|
|
1779
|
-
const isAdvancedToggle = option.isAdvancedToggle;
|
|
1780
|
-
const isSeparator = option.isSeparator;
|
|
1781
|
-
return /* @__PURE__ */ React.createElement(Box, { key: option.id }, /* @__PURE__ */ React.createElement(
|
|
1782
|
-
Text,
|
|
1783
|
-
{
|
|
1784
|
-
color: isSelected && !isSeparator ? "cyan" : isSeparator ? SEMANTIC_COLORS.dim : void 0,
|
|
1785
|
-
bold: isContinue
|
|
1786
|
-
},
|
|
1787
|
-
isSeparator ? option.label : `${isSelected ? `${UI_ICONS.pointer} ` : " "}${isContinue || isAdvancedToggle ? option.label : option.label}`
|
|
1788
|
-
), option.isTool && isSelected && tools.find((t) => t.name === option.id)?.description && /* @__PURE__ */ React.createElement(Box, { marginLeft: 4 }, /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, tools.find((t) => t.name === option.id)?.description)));
|
|
1789
|
-
}), /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, allSelected ? "All tools selected" : `${selectedTools.size} of ${tools.length} tools selected`)))), /* @__PURE__ */ React.createElement(InstructionBar, { instructions: "Enter toggle selection \xB7 \u2191\u2193 navigate \xB7 Esc back" }));
|
|
1790
|
-
}
|
|
1791
|
-
function EditModelStep({
|
|
1792
|
-
agent,
|
|
1793
|
-
setModeState,
|
|
1794
|
-
onAgentUpdated
|
|
1795
|
-
}) {
|
|
1796
|
-
const manager = getModelManager();
|
|
1797
|
-
const profiles = manager.getActiveModelProfiles();
|
|
1798
|
-
const currentModel = agent.model || null;
|
|
1799
|
-
const modelOptions = [
|
|
1800
|
-
{
|
|
1801
|
-
id: null,
|
|
1802
|
-
name: "Inherit from parent",
|
|
1803
|
-
description: "Use the model from task configuration"
|
|
1804
|
-
},
|
|
1805
|
-
...profiles.map((p) => ({
|
|
1806
|
-
id: p.modelName,
|
|
1807
|
-
name: p.name,
|
|
1808
|
-
description: `${p.provider || "provider"} \xB7 ${p.modelName}`
|
|
1809
|
-
}))
|
|
1810
|
-
];
|
|
1811
|
-
const defaultIndex = modelOptions.findIndex((m) => m.id === currentModel);
|
|
1812
|
-
const [selectedIndex, setSelectedIndex] = useState(
|
|
1813
|
-
defaultIndex >= 0 ? defaultIndex : 0
|
|
1814
|
-
);
|
|
1815
|
-
const [isUpdating, setIsUpdating] = useState(false);
|
|
1816
|
-
const handleSave = async (modelId) => {
|
|
1817
|
-
setIsUpdating(true);
|
|
1818
|
-
try {
|
|
1819
|
-
const modelValue = modelId === null ? void 0 : modelId;
|
|
1820
|
-
await updateAgent(
|
|
1821
|
-
agent,
|
|
1822
|
-
agent.whenToUse,
|
|
1823
|
-
agent.tools,
|
|
1824
|
-
agent.systemPrompt,
|
|
1825
|
-
agent.color,
|
|
1826
|
-
modelValue
|
|
1827
|
-
);
|
|
1828
|
-
clearAgentCache();
|
|
1829
|
-
const freshAgents = await getActiveAgents();
|
|
1830
|
-
const updatedAgent = freshAgents.find(
|
|
1831
|
-
(a) => a.agentType === agent.agentType
|
|
1832
|
-
);
|
|
1833
|
-
if (updatedAgent) {
|
|
1834
|
-
onAgentUpdated(
|
|
1835
|
-
`Updated model for agent: ${agent.agentType}`,
|
|
1836
|
-
updatedAgent
|
|
1837
|
-
);
|
|
1838
|
-
setModeState({ mode: "edit-agent", selectedAgent: updatedAgent });
|
|
1839
|
-
} else {
|
|
1840
|
-
console.error("Failed to find updated agent after save");
|
|
1841
|
-
const fallbackAgent = { ...agent };
|
|
1842
|
-
if (modelValue) {
|
|
1843
|
-
;
|
|
1844
|
-
fallbackAgent.model = modelValue;
|
|
1845
|
-
} else {
|
|
1846
|
-
delete fallbackAgent.model;
|
|
1847
|
-
}
|
|
1848
|
-
onAgentUpdated(
|
|
1849
|
-
`Updated model for agent: ${agent.agentType}`,
|
|
1850
|
-
fallbackAgent
|
|
1851
|
-
);
|
|
1852
|
-
setModeState({ mode: "edit-agent", selectedAgent: fallbackAgent });
|
|
1853
|
-
}
|
|
1854
|
-
} catch (error) {
|
|
1855
|
-
console.error("Failed to update agent model:", error);
|
|
1856
|
-
} finally {
|
|
1857
|
-
setIsUpdating(false);
|
|
1858
|
-
}
|
|
1859
|
-
};
|
|
1860
|
-
useInput((input, key) => {
|
|
1861
|
-
if (key.escape) {
|
|
1862
|
-
setModeState({ mode: "edit-agent", selectedAgent: agent });
|
|
1863
|
-
} else if (key.return && !isUpdating) {
|
|
1864
|
-
handleSave(modelOptions[selectedIndex].id);
|
|
1865
|
-
} else if (key.upArrow) {
|
|
1866
|
-
setSelectedIndex((prev) => prev > 0 ? prev - 1 : modelOptions.length - 1);
|
|
1867
|
-
} else if (key.downArrow) {
|
|
1868
|
-
setSelectedIndex((prev) => prev < modelOptions.length - 1 ? prev + 1 : 0);
|
|
1869
|
-
}
|
|
1870
|
-
});
|
|
1871
|
-
if (isUpdating) {
|
|
1872
|
-
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 model..." }))), /* @__PURE__ */ React.createElement(InstructionBar, null));
|
|
1873
|
-
}
|
|
1874
|
-
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(
|
|
1875
|
-
Header,
|
|
1876
|
-
{
|
|
1877
|
-
title: `Edit agent: ${agent.agentType}`,
|
|
1878
|
-
subtitle: "Model determines the agent's reasoning capabilities and speed."
|
|
1879
|
-
},
|
|
1880
|
-
/* @__PURE__ */ React.createElement(Box, { marginTop: 2 }, /* @__PURE__ */ React.createElement(
|
|
1881
|
-
SelectList,
|
|
1882
|
-
{
|
|
1883
|
-
options: modelOptions.map((m, i) => ({
|
|
1884
|
-
label: `${i + 1}. ${m.name}${m.description ? `
|
|
1885
|
-
${m.description}` : ""}`,
|
|
1886
|
-
value: m.id
|
|
1887
|
-
})),
|
|
1888
|
-
selectedIndex,
|
|
1889
|
-
onChange: (val) => handleSave(val),
|
|
1890
|
-
numbered: false
|
|
1891
|
-
}
|
|
1892
|
-
))
|
|
1893
|
-
), /* @__PURE__ */ React.createElement(InstructionBar, { instructions: "\u2191\u2193 navigate \xB7 Enter select \xB7 Esc back" }));
|
|
1894
|
-
}
|
|
1895
|
-
function EditColorStep({
|
|
1896
|
-
agent,
|
|
1897
|
-
setModeState,
|
|
1898
|
-
onAgentUpdated
|
|
1899
|
-
}) {
|
|
1900
|
-
const currentColor = agent.color || null;
|
|
1901
|
-
const colors = [
|
|
1902
|
-
{ label: "Automatic color", value: null },
|
|
1903
|
-
{ label: "Yellow", value: "yellow" },
|
|
1904
|
-
{ label: "Blue", value: "blue" },
|
|
1905
|
-
{ label: "Magenta", value: "magenta" },
|
|
1906
|
-
{ label: "Cyan", value: "cyan" },
|
|
1907
|
-
{ label: "Gray", value: "gray" },
|
|
1908
|
-
{ label: "White", value: "white" }
|
|
1909
|
-
];
|
|
1910
|
-
const defaultIndex = colors.findIndex((color) => color.value === currentColor);
|
|
1911
|
-
const [selectedIndex, setSelectedIndex] = useState(
|
|
1912
|
-
defaultIndex >= 0 ? defaultIndex : 0
|
|
1913
|
-
);
|
|
1914
|
-
const [isUpdating, setIsUpdating] = useState(false);
|
|
1915
|
-
const [error, setError] = useState(null);
|
|
1916
|
-
const handleSave = async (color) => {
|
|
1917
|
-
setError(null);
|
|
1918
|
-
setIsUpdating(true);
|
|
1919
|
-
try {
|
|
1920
|
-
const colorValue = color === null ? void 0 : color;
|
|
1921
|
-
await updateAgent(
|
|
1922
|
-
agent,
|
|
1923
|
-
agent.whenToUse,
|
|
1924
|
-
agent.tools,
|
|
1925
|
-
agent.systemPrompt,
|
|
1926
|
-
colorValue,
|
|
1927
|
-
agent.model
|
|
1928
|
-
);
|
|
1929
|
-
clearAgentCache();
|
|
1930
|
-
const freshAgents = await getActiveAgents();
|
|
1931
|
-
const updatedAgent = freshAgents.find(
|
|
1932
|
-
(a) => a.agentType === agent.agentType
|
|
1933
|
-
);
|
|
1934
|
-
if (updatedAgent) {
|
|
1935
|
-
onAgentUpdated(
|
|
1936
|
-
`Updated color for agent: ${agent.agentType}`,
|
|
1937
|
-
updatedAgent
|
|
1938
|
-
);
|
|
1939
|
-
setModeState({ mode: "edit-agent", selectedAgent: updatedAgent });
|
|
1940
|
-
} else {
|
|
1941
|
-
console.error("Failed to find updated agent after save");
|
|
1942
|
-
const fallbackAgent = {
|
|
1943
|
-
...agent,
|
|
1944
|
-
...colorValue ? { color: colorValue } : { color: void 0 }
|
|
1945
|
-
};
|
|
1946
|
-
onAgentUpdated(
|
|
1947
|
-
`Updated color for agent: ${agent.agentType}`,
|
|
1948
|
-
fallbackAgent
|
|
1949
|
-
);
|
|
1950
|
-
setModeState({ mode: "edit-agent", selectedAgent: fallbackAgent });
|
|
1951
|
-
}
|
|
1952
|
-
} catch (err) {
|
|
1953
|
-
console.error("Failed to update agent color:", err);
|
|
1954
|
-
setError(
|
|
1955
|
-
`Failed to update color: ${err instanceof Error ? err.message : String(err)}`
|
|
1956
|
-
);
|
|
1957
|
-
} finally {
|
|
1958
|
-
setIsUpdating(false);
|
|
1959
|
-
}
|
|
1960
|
-
};
|
|
1961
|
-
useInput((input, key) => {
|
|
1962
|
-
if (key.escape) {
|
|
1963
|
-
setModeState({ mode: "edit-agent", selectedAgent: agent });
|
|
1964
|
-
} else if (key.return && !isUpdating) {
|
|
1965
|
-
setError(null);
|
|
1966
|
-
handleSave(colors[selectedIndex].value);
|
|
1967
|
-
} else if (key.upArrow) {
|
|
1968
|
-
setSelectedIndex((prev) => prev > 0 ? prev - 1 : colors.length - 1);
|
|
1969
|
-
} else if (key.downArrow) {
|
|
1970
|
-
setSelectedIndex((prev) => prev < colors.length - 1 ? prev + 1 : 0);
|
|
1971
|
-
}
|
|
1972
|
-
});
|
|
1973
|
-
if (isUpdating) {
|
|
1974
|
-
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 color..." }))), /* @__PURE__ */ React.createElement(InstructionBar, null));
|
|
1975
|
-
}
|
|
1976
|
-
const selectedColor = colors[selectedIndex];
|
|
1977
|
-
const previewColor = selectedColor.value || void 0;
|
|
1978
|
-
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(
|
|
1979
|
-
Header,
|
|
1980
|
-
{
|
|
1981
|
-
title: `Edit agent: ${agent.agentType}`,
|
|
1982
|
-
subtitle: "Choose background color"
|
|
1983
|
-
},
|
|
1984
|
-
error && /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { color: "red" }, "\u2717 ", error)),
|
|
1985
|
-
/* @__PURE__ */ React.createElement(Box, { flexDirection: "column", marginTop: 1 }, colors.map((color, index) => {
|
|
1986
|
-
const isSelected = index === selectedIndex;
|
|
1987
|
-
const isCurrent = color.value === currentColor;
|
|
1988
|
-
return /* @__PURE__ */ React.createElement(Box, { key: color.value || "automatic" }, /* @__PURE__ */ React.createElement(Text, { color: isSelected ? "cyan" : void 0 }, isSelected ? "\u276F " : " "), /* @__PURE__ */ React.createElement(Text, { color: color.value || void 0 }, "\u25CF"), /* @__PURE__ */ React.createElement(Text, null, " ", color.label, isCurrent && /* @__PURE__ */ React.createElement(Text, { color: "green" }, " \u2714")));
|
|
1989
|
-
}), /* @__PURE__ */ React.createElement(Box, { marginTop: 2 }, /* @__PURE__ */ React.createElement(Text, null, "Preview: "), /* @__PURE__ */ React.createElement(Text, { color: previewColor }, agent.agentType)))
|
|
1990
|
-
), /* @__PURE__ */ React.createElement(InstructionBar, { instructions: "\u2191\u2193 navigate \xB7 Enter select \xB7 Esc back" }));
|
|
1991
|
-
}
|
|
1992
|
-
function EditAgent({
|
|
1993
|
-
agent,
|
|
1994
|
-
tools,
|
|
1995
|
-
setModeState,
|
|
1996
|
-
onAgentUpdated
|
|
1997
|
-
}) {
|
|
1998
|
-
const theme = getTheme();
|
|
1999
|
-
const [currentStep, setCurrentStep] = useState("description");
|
|
2000
|
-
const [isUpdating, setIsUpdating] = useState(false);
|
|
2001
|
-
const [editedDescription, setEditedDescription] = useState(agent.whenToUse);
|
|
2002
|
-
const [editedTools, setEditedTools] = useState(
|
|
2003
|
-
Array.isArray(agent.tools) ? agent.tools : agent.tools === "*" ? ["*"] : []
|
|
2004
|
-
);
|
|
2005
|
-
const [editedPrompt, setEditedPrompt] = useState(agent.systemPrompt);
|
|
2006
|
-
const [error, setError] = useState(null);
|
|
2007
|
-
const handleSave = async () => {
|
|
2008
|
-
setIsUpdating(true);
|
|
2009
|
-
try {
|
|
2010
|
-
await updateAgent(
|
|
2011
|
-
agent,
|
|
2012
|
-
editedDescription,
|
|
2013
|
-
editedTools,
|
|
2014
|
-
editedPrompt,
|
|
2015
|
-
agent.color
|
|
2016
|
-
);
|
|
2017
|
-
clearAgentCache();
|
|
2018
|
-
onAgentUpdated(`Updated agent: ${agent.agentType}`);
|
|
2019
|
-
} catch (error2) {
|
|
2020
|
-
setError(error2.message);
|
|
2021
|
-
setIsUpdating(false);
|
|
2022
|
-
}
|
|
2023
|
-
};
|
|
2024
|
-
const renderStepContent = () => {
|
|
2025
|
-
switch (currentStep) {
|
|
2026
|
-
case "description":
|
|
2027
|
-
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Text, { bold: true }, "Edit Description:"), /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(
|
|
2028
|
-
MultilineTextInput,
|
|
2029
|
-
{
|
|
2030
|
-
value: editedDescription,
|
|
2031
|
-
onChange: setEditedDescription,
|
|
2032
|
-
placeholder: "Describe when to use this agent...",
|
|
2033
|
-
onSubmit: () => setCurrentStep("tools"),
|
|
2034
|
-
error,
|
|
2035
|
-
rows: 4
|
|
2036
|
-
}
|
|
2037
|
-
)));
|
|
2038
|
-
case "tools":
|
|
2039
|
-
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Text, { bold: true }, "Edit Tools:"), /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(
|
|
2040
|
-
ToolsStep,
|
|
2041
|
-
{
|
|
2042
|
-
createState: {
|
|
2043
|
-
selectedTools: editedTools
|
|
2044
|
-
},
|
|
2045
|
-
setCreateState: (action) => {
|
|
2046
|
-
if (action.type === "SET_SELECTED_TOOLS") {
|
|
2047
|
-
setEditedTools(action.value);
|
|
2048
|
-
setCurrentStep("prompt");
|
|
2049
|
-
}
|
|
2050
|
-
},
|
|
2051
|
-
setModeState: () => {
|
|
2052
|
-
},
|
|
2053
|
-
tools
|
|
2054
|
-
}
|
|
2055
|
-
)));
|
|
2056
|
-
case "prompt":
|
|
2057
|
-
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Text, { bold: true }, "Edit System Prompt:"), /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(
|
|
2058
|
-
MultilineTextInput,
|
|
2059
|
-
{
|
|
2060
|
-
value: editedPrompt,
|
|
2061
|
-
onChange: setEditedPrompt,
|
|
2062
|
-
placeholder: "System prompt for the agent...",
|
|
2063
|
-
onSubmit: () => setCurrentStep("confirm"),
|
|
2064
|
-
error,
|
|
2065
|
-
rows: 5
|
|
2066
|
-
}
|
|
2067
|
-
)));
|
|
2068
|
-
case "confirm":
|
|
2069
|
-
const validation = validateAgentConfig({
|
|
2070
|
-
agentType: agent.agentType,
|
|
2071
|
-
whenToUse: editedDescription,
|
|
2072
|
-
systemPrompt: editedPrompt,
|
|
2073
|
-
selectedTools: editedTools
|
|
2074
|
-
});
|
|
2075
|
-
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Text, { bold: true }, "Confirm Changes:"), /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { bold: true }, "Agent:"), " ", agent.agentType), /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { bold: true }, "Description:"), " ", editedDescription), /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { bold: true }, "Tools:"), " ", editedTools.includes("*") ? "All tools" : editedTools.join(", ")), /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { bold: true }, "System Prompt:"), " ", editedPrompt.slice(0, 100), editedPrompt.length > 100 ? "..." : ""), validation.warnings.length > 0 && /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, validation.warnings.map((warning, idx) => /* @__PURE__ */ React.createElement(Fragment, { key: idx }, /* @__PURE__ */ React.createElement(Text, { color: theme.warning }, "\u26A0 ", warning)))), error && /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { color: theme.error }, "\u2717 ", error)), /* @__PURE__ */ React.createElement(Box, { marginTop: 2 }, isUpdating ? /* @__PURE__ */ React.createElement(LoadingSpinner, { text: "Updating agent..." }) : /* @__PURE__ */ React.createElement(Text, null, "Press Enter to save changes"))));
|
|
2076
|
-
}
|
|
2077
|
-
};
|
|
2078
|
-
useInput((input, key) => {
|
|
2079
|
-
if (key.escape) {
|
|
2080
|
-
if (currentStep === "description") {
|
|
2081
|
-
setModeState({ mode: "agent-menu", selectedAgent: agent });
|
|
2082
|
-
} else {
|
|
2083
|
-
const steps = [
|
|
2084
|
-
"description",
|
|
2085
|
-
"tools",
|
|
2086
|
-
"prompt",
|
|
2087
|
-
"confirm"
|
|
2088
|
-
];
|
|
2089
|
-
const currentIndex = steps.indexOf(currentStep);
|
|
2090
|
-
if (currentIndex > 0) {
|
|
2091
|
-
setCurrentStep(steps[currentIndex - 1]);
|
|
2092
|
-
}
|
|
2093
|
-
}
|
|
2094
|
-
return;
|
|
2095
|
-
}
|
|
2096
|
-
if (key.return && currentStep === "confirm" && !isUpdating) {
|
|
2097
|
-
handleSave();
|
|
2098
|
-
}
|
|
2099
|
-
});
|
|
2100
|
-
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(
|
|
2101
|
-
Header,
|
|
2102
|
-
{
|
|
2103
|
-
title: `Edit Agent: ${agent.agentType}`,
|
|
2104
|
-
subtitle: `Step ${["description", "tools", "prompt", "confirm"].indexOf(currentStep) + 1}/4`
|
|
2105
|
-
},
|
|
2106
|
-
/* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, renderStepContent())
|
|
2107
|
-
), /* @__PURE__ */ React.createElement(
|
|
2108
|
-
InstructionBar,
|
|
2109
|
-
{
|
|
2110
|
-
instructions: currentStep === "confirm" ? "Press Enter to save \xB7 Esc to go back" : "Enter to continue \xB7 Esc to go back"
|
|
2111
|
-
}
|
|
2112
|
-
));
|
|
2113
|
-
}
|
|
2114
|
-
function DeleteConfirm({
|
|
2115
|
-
agent,
|
|
2116
|
-
setModeState,
|
|
2117
|
-
onAgentDeleted
|
|
2118
|
-
}) {
|
|
2119
|
-
const [isDeleting, setIsDeleting] = useState(false);
|
|
2120
|
-
const [selected, setSelected] = useState(false);
|
|
2121
|
-
const [error, setError] = useState(null);
|
|
2122
|
-
const handleConfirm = async () => {
|
|
2123
|
-
if (selected) {
|
|
2124
|
-
setIsDeleting(true);
|
|
2125
|
-
setError(null);
|
|
2126
|
-
try {
|
|
2127
|
-
await deleteAgent(agent);
|
|
2128
|
-
clearAgentCache();
|
|
2129
|
-
onAgentDeleted(`Deleted agent: ${agent.agentType}`);
|
|
2130
|
-
} catch (err) {
|
|
2131
|
-
console.error("Failed to delete agent:", err);
|
|
2132
|
-
setIsDeleting(false);
|
|
2133
|
-
setError(
|
|
2134
|
-
`Failed to delete agent: ${err instanceof Error ? err.message : String(err)}`
|
|
2135
|
-
);
|
|
2136
|
-
}
|
|
2137
|
-
} else {
|
|
2138
|
-
setModeState({ mode: "agent-menu", selectedAgent: agent });
|
|
2139
|
-
}
|
|
2140
|
-
};
|
|
2141
|
-
useInput((input, key) => {
|
|
2142
|
-
if (key.return) {
|
|
2143
|
-
handleConfirm();
|
|
2144
|
-
} else if (key.leftArrow || key.rightArrow || key.tab) {
|
|
2145
|
-
setSelected(!selected);
|
|
2146
|
-
}
|
|
2147
|
-
});
|
|
2148
|
-
if (isDeleting) {
|
|
2149
|
-
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));
|
|
2150
|
-
}
|
|
2151
|
-
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));
|
|
2152
|
-
}
|
|
2153
|
-
var AgentsCommand_default = {
|
|
2154
|
-
name: "agents",
|
|
2155
|
-
description: "Manage agent configurations",
|
|
2156
|
-
type: "local-jsx",
|
|
2157
|
-
isEnabled: true,
|
|
2158
|
-
isHidden: false,
|
|
2159
|
-
hidePromptInput: true,
|
|
2160
|
-
async call(onExit) {
|
|
2161
|
-
return /* @__PURE__ */ React.createElement(AgentsUI, { onExit });
|
|
2162
|
-
},
|
|
2163
|
-
userFacingName() {
|
|
2164
|
-
return "agents";
|
|
2165
|
-
}
|
|
2166
|
-
};
|
|
2167
|
-
export {
|
|
2168
|
-
AgentsCommand_default as default
|
|
2169
|
-
};
|
|
2170
|
-
//# sourceMappingURL=AgentsCommand.js.map
|