centaurus-cli 3.0.1 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai/types.js +0 -1
- package/dist/ai/types.js.map +1 -1
- package/dist/cli-adapter.js +5047 -5158
- package/dist/cli-adapter.js.map +1 -1
- package/dist/commands/CommandParser.js +372 -315
- package/dist/commands/CommandParser.js.map +1 -1
- package/dist/config/build-config.js +11 -42
- package/dist/config/build-config.js.map +1 -1
- package/dist/config/defaultConfig.js +94 -82
- package/dist/config/defaultConfig.js.map +1 -1
- package/dist/config/manager.js +144 -160
- package/dist/config/manager.js.map +1 -1
- package/dist/config/mcp-config-manager.js +411 -364
- package/dist/config/mcp-config-manager.js.map +1 -1
- package/dist/config/models.js +118 -185
- package/dist/config/models.js.map +1 -1
- package/dist/config/slash-commands.js +186 -184
- package/dist/config/slash-commands.js.map +1 -1
- package/dist/config/types.js +33 -26
- package/dist/config/types.js.map +1 -1
- package/dist/context/command-detector.js +63 -67
- package/dist/context/command-detector.js.map +1 -1
- package/dist/context/context-manager.js +533 -518
- package/dist/context/context-manager.js.map +1 -1
- package/dist/context/handlers/docker-handler.js +518 -576
- package/dist/context/handlers/docker-handler.js.map +1 -1
- package/dist/context/handlers/ssh-handler.js +1050 -1109
- package/dist/context/handlers/ssh-handler.js.map +1 -1
- package/dist/context/handlers/wsl-handler.js +558 -630
- package/dist/context/handlers/wsl-handler.js.map +1 -1
- package/dist/context/index.js +42 -6
- package/dist/context/index.js.map +1 -1
- package/dist/context/subshell-handler.js +0 -4
- package/dist/context/subshell-handler.js.map +1 -1
- package/dist/context/types.js +20 -31
- package/dist/context/types.js.map +1 -1
- package/dist/hooks/useConnectivity.js +13 -10
- package/dist/hooks/useConnectivity.js.map +1 -1
- package/dist/hooks/useTerminalDimensions.js +67 -79
- package/dist/hooks/useTerminalDimensions.js.map +1 -1
- package/dist/index.js +228 -251
- package/dist/index.js.map +1 -1
- package/dist/mcp/mcp-command-handler.js +297 -260
- package/dist/mcp/mcp-command-handler.js.map +1 -1
- package/dist/mcp/mcp-server-manager.js +139 -155
- package/dist/mcp/mcp-server-manager.js.map +1 -1
- package/dist/mcp/mcp-tool-wrapper.js +74 -94
- package/dist/mcp/mcp-tool-wrapper.js.map +1 -1
- package/dist/services/ai-autocomplete-agent.js +169 -181
- package/dist/services/ai-autocomplete-agent.js.map +1 -1
- package/dist/services/ai-context-injector.js +180 -93
- package/dist/services/ai-context-injector.js.map +1 -1
- package/dist/services/ai-service-client.js +513 -456
- package/dist/services/ai-service-client.js.map +1 -1
- package/dist/services/api-client.js +443 -441
- package/dist/services/api-client.js.map +1 -1
- package/dist/services/auth-handler.js +162 -198
- package/dist/services/auth-handler.js.map +1 -1
- package/dist/services/background-task-manager.js +258 -282
- package/dist/services/background-task-manager.js.map +1 -1
- package/dist/services/checkpoint-manager.js +1526 -1512
- package/dist/services/checkpoint-manager.js.map +1 -1
- package/dist/services/clipboard-service.js +151 -200
- package/dist/services/clipboard-service.js.map +1 -1
- package/dist/services/connectivity-manager.js +63 -65
- package/dist/services/connectivity-manager.js.map +1 -1
- package/dist/services/conversation-manager.js +118 -121
- package/dist/services/conversation-manager.js.map +1 -1
- package/dist/services/environment-context-injector.js +160 -187
- package/dist/services/environment-context-injector.js.map +1 -1
- package/dist/services/fast-context-agent.js +203 -243
- package/dist/services/fast-context-agent.js.map +1 -1
- package/dist/services/input-detection-agent.js +190 -202
- package/dist/services/input-detection-agent.js.map +1 -1
- package/dist/services/input-requirement-detector.js +155 -189
- package/dist/services/input-requirement-detector.js.map +1 -1
- package/dist/services/local-chat-storage.js +342 -365
- package/dist/services/local-chat-storage.js.map +1 -1
- package/dist/services/monitored-shell-manager.js +225 -233
- package/dist/services/monitored-shell-manager.js.map +1 -1
- package/dist/services/ollama-service.js +293 -310
- package/dist/services/ollama-service.js.map +1 -1
- package/dist/services/rules-storage.js +142 -0
- package/dist/services/rules-storage.js.map +1 -0
- package/dist/services/session-quota-manager.js +219 -235
- package/dist/services/session-quota-manager.js.map +1 -1
- package/dist/services/shell-input-agent.js +299 -334
- package/dist/services/shell-input-agent.js.map +1 -1
- package/dist/services/sub-agent-manager.js +459 -501
- package/dist/services/sub-agent-manager.js.map +1 -1
- package/dist/services/warpify-detector.js +133 -183
- package/dist/services/warpify-detector.js.map +1 -1
- package/dist/services/workflow-storage.js +202 -217
- package/dist/services/workflow-storage.js.map +1 -1
- package/dist/test-ssh-handler.js +148 -193
- package/dist/test-ssh-handler.js.map +1 -1
- package/dist/tools/add-mcp.js +161 -0
- package/dist/tools/add-mcp.js.map +1 -0
- package/dist/tools/background-command.js +240 -273
- package/dist/tools/background-command.js.map +1 -1
- package/dist/tools/command.js +447 -440
- package/dist/tools/command.js.map +1 -1
- package/dist/tools/create-image.js +172 -202
- package/dist/tools/create-image.js.map +1 -1
- package/dist/tools/enter-remote-session.js +169 -215
- package/dist/tools/enter-remote-session.js.map +1 -1
- package/dist/tools/fast-context.js +60 -67
- package/dist/tools/fast-context.js.map +1 -1
- package/dist/tools/file-ops.js +601 -572
- package/dist/tools/file-ops.js.map +1 -1
- package/dist/tools/find-files.js +262 -303
- package/dist/tools/find-files.js.map +1 -1
- package/dist/tools/get-diff.js +423 -406
- package/dist/tools/get-diff.js.map +1 -1
- package/dist/tools/grep-search.js +966 -948
- package/dist/tools/grep-search.js.map +1 -1
- package/dist/tools/inspect-symbol.js +308 -323
- package/dist/tools/inspect-symbol.js.map +1 -1
- package/dist/tools/plan-mode.js +459 -503
- package/dist/tools/plan-mode.js.map +1 -1
- package/dist/tools/read-binary-file.js +160 -190
- package/dist/tools/read-binary-file.js.map +1 -1
- package/dist/tools/registry.js +100 -84
- package/dist/tools/registry.js.map +1 -1
- package/dist/tools/reproduce_issue.js +170 -151
- package/dist/tools/reproduce_issue.js.map +1 -1
- package/dist/tools/sub-agent.js +223 -228
- package/dist/tools/sub-agent.js.map +1 -1
- package/dist/tools/task-complete.js +28 -27
- package/dist/tools/task-complete.js.map +1 -1
- package/dist/tools/types.js +0 -1
- package/dist/tools/types.js.map +1 -1
- package/dist/tools/validation.js +96 -118
- package/dist/tools/validation.js.map +1 -1
- package/dist/tools/web-search.js +194 -194
- package/dist/tools/web-search.js.map +1 -1
- package/dist/tools/workflow-tool.js +77 -82
- package/dist/tools/workflow-tool.js.map +1 -1
- package/dist/types/index.js +0 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/rule.js +1 -0
- package/dist/types/rule.js.map +1 -0
- package/dist/types/workflow.js +0 -7
- package/dist/types/workflow.js.map +1 -1
- package/dist/ui/components/AgentTimer.js +24 -25
- package/dist/ui/components/AgentTimer.js.map +1 -1
- package/dist/ui/components/App.js +3266 -3263
- package/dist/ui/components/App.js.map +1 -1
- package/dist/ui/components/AuthScreen.js +22 -34
- package/dist/ui/components/AuthScreen.js.map +1 -1
- package/dist/ui/components/AuthWelcomeScreen.js +30 -24
- package/dist/ui/components/AuthWelcomeScreen.js.map +1 -1
- package/dist/ui/components/Breadcrumbs.js +53 -82
- package/dist/ui/components/Breadcrumbs.js.map +1 -1
- package/dist/ui/components/CircularSelectInput.js +59 -67
- package/dist/ui/components/CircularSelectInput.js.map +1 -1
- package/dist/ui/components/ClipboardFileAutocomplete.js +78 -39
- package/dist/ui/components/ClipboardFileAutocomplete.js.map +1 -1
- package/dist/ui/components/CodeBlock.js +24 -42
- package/dist/ui/components/CodeBlock.js.map +1 -1
- package/dist/ui/components/ConfigViewer.js +18 -25
- package/dist/ui/components/ConfigViewer.js.map +1 -1
- package/dist/ui/components/ConfirmPrompt.js +49 -71
- package/dist/ui/components/ConfirmPrompt.js.map +1 -1
- package/dist/ui/components/ConnectionStatusMessage.js +32 -83
- package/dist/ui/components/ConnectionStatusMessage.js.map +1 -1
- package/dist/ui/components/ContextWindowIndicator.js +34 -49
- package/dist/ui/components/ContextWindowIndicator.js.map +1 -1
- package/dist/ui/components/DetailedPlanReviewScreen.js +104 -106
- package/dist/ui/components/DetailedPlanReviewScreen.js.map +1 -1
- package/dist/ui/components/DiffViewer.js +68 -121
- package/dist/ui/components/DiffViewer.js.map +1 -1
- package/dist/ui/components/ErrorBoundary.js +40 -48
- package/dist/ui/components/ErrorBoundary.js.map +1 -1
- package/dist/ui/components/FileCreationPreview.js +29 -60
- package/dist/ui/components/FileCreationPreview.js.map +1 -1
- package/dist/ui/components/FileOperation.js +34 -29
- package/dist/ui/components/FileOperation.js.map +1 -1
- package/dist/ui/components/FileTagAutocomplete.js +55 -25
- package/dist/ui/components/FileTagAutocomplete.js.map +1 -1
- package/dist/ui/components/FontRecommendation.js.map +1 -1
- package/dist/ui/components/GitDiffBreadcrumb.js +29 -0
- package/dist/ui/components/GitDiffBreadcrumb.js.map +1 -0
- package/dist/ui/components/InputBox.js +1620 -2150
- package/dist/ui/components/InputBox.js.map +1 -1
- package/dist/ui/components/InteractiveShell.js +234 -352
- package/dist/ui/components/InteractiveShell.js.map +1 -1
- package/dist/ui/components/KeyboardHelp.js +34 -35
- package/dist/ui/components/KeyboardHelp.js.map +1 -1
- package/dist/ui/components/LoadingIndicator.js +22 -25
- package/dist/ui/components/LoadingIndicator.js.map +1 -1
- package/dist/ui/components/MCPAddScreen.js +40 -51
- package/dist/ui/components/MCPAddScreen.js.map +1 -1
- package/dist/ui/components/MCPListScreen.js +40 -48
- package/dist/ui/components/MCPListScreen.js.map +1 -1
- package/dist/ui/components/MCPServerListScreen.js +49 -56
- package/dist/ui/components/MCPServerListScreen.js.map +1 -1
- package/dist/ui/components/MarkdownRenderer.js +69 -96
- package/dist/ui/components/MarkdownRenderer.js.map +1 -1
- package/dist/ui/components/MessageBox.js +66 -48
- package/dist/ui/components/MessageBox.js.map +1 -1
- package/dist/ui/components/MessageDisplay.js +150 -142
- package/dist/ui/components/MessageDisplay.js.map +1 -1
- package/dist/ui/components/MonitorModeAIPanel.js +46 -65
- package/dist/ui/components/MonitorModeAIPanel.js.map +1 -1
- package/dist/ui/components/MultiLineInput.js +243 -277
- package/dist/ui/components/MultiLineInput.js.map +1 -1
- package/dist/ui/components/PasswordPrompt.js +37 -18
- package/dist/ui/components/PasswordPrompt.js.map +1 -1
- package/dist/ui/components/PlanAcceptedMessage.js +27 -38
- package/dist/ui/components/PlanAcceptedMessage.js.map +1 -1
- package/dist/ui/components/PlanReviewScreen.js +46 -50
- package/dist/ui/components/PlanReviewScreen.js.map +1 -1
- package/dist/ui/components/RulesEditorScreen.js +81 -0
- package/dist/ui/components/RulesEditorScreen.js.map +1 -0
- package/dist/ui/components/SelectPrompt.js +19 -8
- package/dist/ui/components/SelectPrompt.js.map +1 -1
- package/dist/ui/components/ShimmerText.js +44 -0
- package/dist/ui/components/ShimmerText.js.map +1 -0
- package/dist/ui/components/SlashCommandAutocomplete.js +49 -22
- package/dist/ui/components/SlashCommandAutocomplete.js.map +1 -1
- package/dist/ui/components/StatusBar.js +56 -87
- package/dist/ui/components/StatusBar.js.map +1 -1
- package/dist/ui/components/StreamingMessageDisplay.js +116 -99
- package/dist/ui/components/StreamingMessageDisplay.js.map +1 -1
- package/dist/ui/components/TaskCompletedMessage.js +28 -23
- package/dist/ui/components/TaskCompletedMessage.js.map +1 -1
- package/dist/ui/components/TaskProgressIndicator.js +44 -70
- package/dist/ui/components/TaskProgressIndicator.js.map +1 -1
- package/dist/ui/components/ThinkingDisplay.js +44 -41
- package/dist/ui/components/ThinkingDisplay.js.map +1 -1
- package/dist/ui/components/ToolExecutionMessage.js +772 -1326
- package/dist/ui/components/ToolExecutionMessage.js.map +1 -1
- package/dist/ui/components/ToolExecutionStatus.js +53 -84
- package/dist/ui/components/ToolExecutionStatus.js.map +1 -1
- package/dist/ui/components/ToolResult.js +22 -15
- package/dist/ui/components/ToolResult.js.map +1 -1
- package/dist/ui/components/VersionUpdatePrompt.js +88 -120
- package/dist/ui/components/VersionUpdatePrompt.js.map +1 -1
- package/dist/ui/components/WelcomeBanner.js +176 -26
- package/dist/ui/components/WelcomeBanner.js.map +1 -1
- package/dist/ui/components/WorkflowCreatorScreen.js +94 -161
- package/dist/ui/components/WorkflowCreatorScreen.js.map +1 -1
- package/dist/utils/ansi-encoder.js +30 -61
- package/dist/utils/ansi-encoder.js.map +1 -1
- package/dist/utils/chat-formatter.js +327 -305
- package/dist/utils/chat-formatter.js.map +1 -1
- package/dist/utils/command-history.js +152 -174
- package/dist/utils/command-history.js.map +1 -1
- package/dist/utils/context-sanitizer.js +49 -112
- package/dist/utils/context-sanitizer.js.map +1 -1
- package/dist/utils/conversation-logger.js +292 -324
- package/dist/utils/conversation-logger.js.map +1 -1
- package/dist/utils/custom-commands-manager.js +126 -131
- package/dist/utils/custom-commands-manager.js.map +1 -1
- package/dist/utils/editor-utils.js +732 -837
- package/dist/utils/editor-utils.js.map +1 -1
- package/dist/utils/file.js +174 -213
- package/dist/utils/file.js.map +1 -1
- package/dist/utils/git-stats.js +169 -0
- package/dist/utils/git-stats.js.map +1 -0
- package/dist/utils/input-classifier.js +960 -482
- package/dist/utils/input-classifier.js.map +1 -1
- package/dist/utils/logger.js +48 -73
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/markdown-parser.js +277 -310
- package/dist/utils/markdown-parser.js.map +1 -1
- package/dist/utils/rule-reference-resolver.js +54 -0
- package/dist/utils/rule-reference-resolver.js.map +1 -0
- package/dist/utils/shell.js +144 -156
- package/dist/utils/shell.js.map +1 -1
- package/dist/utils/state.js +23 -22
- package/dist/utils/state.js.map +1 -1
- package/dist/utils/syntax-checker.js +279 -327
- package/dist/utils/syntax-checker.js.map +1 -1
- package/dist/utils/terminal-output.js +199 -302
- package/dist/utils/terminal-output.js.map +1 -1
- package/dist/utils/text-clipboard.js +47 -70
- package/dist/utils/text-clipboard.js.map +1 -1
- package/dist/utils/unicode-sanitizer.js +134 -197
- package/dist/utils/unicode-sanitizer.js.map +1 -1
- package/dist/utils/version-checker.js +46 -56
- package/dist/utils/version-checker.js.map +1 -1
- package/package.json +6 -4
- package/dist/ai/types.d.ts +0 -20
- package/dist/ai/types.d.ts.map +0 -1
- package/dist/cli-adapter.d.ts +0 -514
- package/dist/cli-adapter.d.ts.map +0 -1
- package/dist/commands/CommandParser.d.ts +0 -27
- package/dist/commands/CommandParser.d.ts.map +0 -1
- package/dist/config/build-config.d.ts +0 -42
- package/dist/config/build-config.d.ts.map +0 -1
- package/dist/config/defaultConfig.d.ts +0 -79
- package/dist/config/defaultConfig.d.ts.map +0 -1
- package/dist/config/manager.d.ts +0 -62
- package/dist/config/manager.d.ts.map +0 -1
- package/dist/config/mcp-config-manager.d.ts +0 -79
- package/dist/config/mcp-config-manager.d.ts.map +0 -1
- package/dist/config/models.d.ts +0 -83
- package/dist/config/models.d.ts.map +0 -1
- package/dist/config/slash-commands.d.ts +0 -23
- package/dist/config/slash-commands.d.ts.map +0 -1
- package/dist/config/types.d.ts +0 -35
- package/dist/config/types.d.ts.map +0 -1
- package/dist/context/command-detector.d.ts +0 -50
- package/dist/context/command-detector.d.ts.map +0 -1
- package/dist/context/context-manager.d.ts +0 -157
- package/dist/context/context-manager.d.ts.map +0 -1
- package/dist/context/handlers/docker-handler.d.ts +0 -130
- package/dist/context/handlers/docker-handler.d.ts.map +0 -1
- package/dist/context/handlers/ssh-handler.d.ts +0 -201
- package/dist/context/handlers/ssh-handler.d.ts.map +0 -1
- package/dist/context/handlers/wsl-handler.d.ts +0 -146
- package/dist/context/handlers/wsl-handler.d.ts.map +0 -1
- package/dist/context/index.d.ts +0 -8
- package/dist/context/index.d.ts.map +0 -1
- package/dist/context/subshell-handler.d.ts +0 -165
- package/dist/context/subshell-handler.d.ts.map +0 -1
- package/dist/context/types.d.ts +0 -70
- package/dist/context/types.d.ts.map +0 -1
- package/dist/hooks/useConnectivity.d.ts +0 -2
- package/dist/hooks/useConnectivity.d.ts.map +0 -1
- package/dist/hooks/useTerminalDimensions.d.ts +0 -41
- package/dist/hooks/useTerminalDimensions.d.ts.map +0 -1
- package/dist/index.d.ts +0 -9
- package/dist/index.d.ts.map +0 -1
- package/dist/mcp/mcp-command-handler.d.ts +0 -47
- package/dist/mcp/mcp-command-handler.d.ts.map +0 -1
- package/dist/mcp/mcp-server-manager.d.ts +0 -30
- package/dist/mcp/mcp-server-manager.d.ts.map +0 -1
- package/dist/mcp/mcp-tool-wrapper.d.ts +0 -12
- package/dist/mcp/mcp-tool-wrapper.d.ts.map +0 -1
- package/dist/services/ai-autocomplete-agent.d.ts +0 -39
- package/dist/services/ai-autocomplete-agent.d.ts.map +0 -1
- package/dist/services/ai-context-injector.d.ts +0 -41
- package/dist/services/ai-context-injector.d.ts.map +0 -1
- package/dist/services/ai-service-client.d.ts +0 -128
- package/dist/services/ai-service-client.d.ts.map +0 -1
- package/dist/services/api-client.d.ts +0 -353
- package/dist/services/api-client.d.ts.map +0 -1
- package/dist/services/auth-handler.d.ts +0 -30
- package/dist/services/auth-handler.d.ts.map +0 -1
- package/dist/services/background-task-manager.d.ts +0 -114
- package/dist/services/background-task-manager.d.ts.map +0 -1
- package/dist/services/checkpoint-manager.d.ts +0 -204
- package/dist/services/checkpoint-manager.d.ts.map +0 -1
- package/dist/services/clipboard-service.d.ts +0 -37
- package/dist/services/clipboard-service.d.ts.map +0 -1
- package/dist/services/connectivity-manager.d.ts +0 -18
- package/dist/services/connectivity-manager.d.ts.map +0 -1
- package/dist/services/conversation-manager.d.ts +0 -73
- package/dist/services/conversation-manager.d.ts.map +0 -1
- package/dist/services/environment-context-injector.d.ts +0 -69
- package/dist/services/environment-context-injector.d.ts.map +0 -1
- package/dist/services/fast-context-agent.d.ts +0 -12
- package/dist/services/fast-context-agent.d.ts.map +0 -1
- package/dist/services/input-detection-agent.d.ts +0 -40
- package/dist/services/input-detection-agent.d.ts.map +0 -1
- package/dist/services/input-requirement-detector.d.ts +0 -28
- package/dist/services/input-requirement-detector.d.ts.map +0 -1
- package/dist/services/local-chat-storage.d.ts +0 -182
- package/dist/services/local-chat-storage.d.ts.map +0 -1
- package/dist/services/monitored-shell-manager.d.ts +0 -120
- package/dist/services/monitored-shell-manager.d.ts.map +0 -1
- package/dist/services/ollama-service.d.ts +0 -197
- package/dist/services/ollama-service.d.ts.map +0 -1
- package/dist/services/session-quota-manager.d.ts +0 -101
- package/dist/services/session-quota-manager.d.ts.map +0 -1
- package/dist/services/shell-input-agent.d.ts +0 -89
- package/dist/services/shell-input-agent.d.ts.map +0 -1
- package/dist/services/sub-agent-manager.d.ts +0 -140
- package/dist/services/sub-agent-manager.d.ts.map +0 -1
- package/dist/services/warpify-detector.d.ts +0 -43
- package/dist/services/warpify-detector.d.ts.map +0 -1
- package/dist/services/workflow-storage.d.ts +0 -72
- package/dist/services/workflow-storage.d.ts.map +0 -1
- package/dist/test-ssh-handler.d.ts +0 -8
- package/dist/test-ssh-handler.d.ts.map +0 -1
- package/dist/tools/background-command.d.ts +0 -11
- package/dist/tools/background-command.d.ts.map +0 -1
- package/dist/tools/command.d.ts +0 -3
- package/dist/tools/command.d.ts.map +0 -1
- package/dist/tools/create-image.d.ts +0 -10
- package/dist/tools/create-image.d.ts.map +0 -1
- package/dist/tools/enter-remote-session.d.ts +0 -48
- package/dist/tools/enter-remote-session.d.ts.map +0 -1
- package/dist/tools/fast-context.d.ts +0 -3
- package/dist/tools/fast-context.d.ts.map +0 -1
- package/dist/tools/file-ops.d.ts +0 -7
- package/dist/tools/file-ops.d.ts.map +0 -1
- package/dist/tools/find-files.d.ts +0 -49
- package/dist/tools/find-files.d.ts.map +0 -1
- package/dist/tools/get-diff.d.ts +0 -14
- package/dist/tools/get-diff.d.ts.map +0 -1
- package/dist/tools/grep-search.d.ts +0 -155
- package/dist/tools/grep-search.d.ts.map +0 -1
- package/dist/tools/inspect-symbol.d.ts +0 -32
- package/dist/tools/inspect-symbol.d.ts.map +0 -1
- package/dist/tools/plan-mode.d.ts +0 -140
- package/dist/tools/plan-mode.d.ts.map +0 -1
- package/dist/tools/read-binary-file.d.ts +0 -10
- package/dist/tools/read-binary-file.d.ts.map +0 -1
- package/dist/tools/registry.d.ts +0 -31
- package/dist/tools/registry.d.ts.map +0 -1
- package/dist/tools/reproduce_issue.d.ts +0 -2
- package/dist/tools/reproduce_issue.d.ts.map +0 -1
- package/dist/tools/sub-agent.d.ts +0 -9
- package/dist/tools/sub-agent.d.ts.map +0 -1
- package/dist/tools/task-complete.d.ts +0 -3
- package/dist/tools/task-complete.d.ts.map +0 -1
- package/dist/tools/types.d.ts +0 -40
- package/dist/tools/types.d.ts.map +0 -1
- package/dist/tools/validation.d.ts +0 -47
- package/dist/tools/validation.d.ts.map +0 -1
- package/dist/tools/web-search.d.ts +0 -24
- package/dist/tools/web-search.d.ts.map +0 -1
- package/dist/tools/workflow-tool.d.ts +0 -11
- package/dist/tools/workflow-tool.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -123
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/workflow.d.ts +0 -110
- package/dist/types/workflow.d.ts.map +0 -1
- package/dist/ui/components/AgentTimer.d.ts +0 -7
- package/dist/ui/components/AgentTimer.d.ts.map +0 -1
- package/dist/ui/components/App.d.ts +0 -197
- package/dist/ui/components/App.d.ts.map +0 -1
- package/dist/ui/components/AuthScreen.d.ts +0 -8
- package/dist/ui/components/AuthScreen.d.ts.map +0 -1
- package/dist/ui/components/AuthWelcomeScreen.d.ts +0 -8
- package/dist/ui/components/AuthWelcomeScreen.d.ts.map +0 -1
- package/dist/ui/components/Breadcrumbs.d.ts +0 -13
- package/dist/ui/components/Breadcrumbs.d.ts.map +0 -1
- package/dist/ui/components/CircularSelectInput.d.ts +0 -24
- package/dist/ui/components/CircularSelectInput.d.ts.map +0 -1
- package/dist/ui/components/ClipboardFileAutocomplete.d.ts +0 -10
- package/dist/ui/components/ClipboardFileAutocomplete.d.ts.map +0 -1
- package/dist/ui/components/CodeBlock.d.ts +0 -9
- package/dist/ui/components/CodeBlock.d.ts.map +0 -1
- package/dist/ui/components/ConfigViewer.d.ts +0 -11
- package/dist/ui/components/ConfigViewer.d.ts.map +0 -1
- package/dist/ui/components/ConfirmPrompt.d.ts +0 -13
- package/dist/ui/components/ConfirmPrompt.d.ts.map +0 -1
- package/dist/ui/components/ConnectionStatusMessage.d.ts +0 -17
- package/dist/ui/components/ConnectionStatusMessage.d.ts.map +0 -1
- package/dist/ui/components/ContextWindowIndicator.d.ts +0 -8
- package/dist/ui/components/ContextWindowIndicator.d.ts.map +0 -1
- package/dist/ui/components/DetailedPlanReviewScreen.d.ts +0 -17
- package/dist/ui/components/DetailedPlanReviewScreen.d.ts.map +0 -1
- package/dist/ui/components/DiffViewer.d.ts +0 -9
- package/dist/ui/components/DiffViewer.d.ts.map +0 -1
- package/dist/ui/components/ErrorBoundary.d.ts +0 -17
- package/dist/ui/components/ErrorBoundary.d.ts.map +0 -1
- package/dist/ui/components/FileCreationPreview.d.ts +0 -8
- package/dist/ui/components/FileCreationPreview.d.ts.map +0 -1
- package/dist/ui/components/FileOperation.d.ts +0 -10
- package/dist/ui/components/FileOperation.d.ts.map +0 -1
- package/dist/ui/components/FileTagAutocomplete.d.ts +0 -11
- package/dist/ui/components/FileTagAutocomplete.d.ts.map +0 -1
- package/dist/ui/components/FontRecommendation.d.ts +0 -1
- package/dist/ui/components/FontRecommendation.d.ts.map +0 -1
- package/dist/ui/components/InputBox.d.ts +0 -42
- package/dist/ui/components/InputBox.d.ts.map +0 -1
- package/dist/ui/components/InteractiveShell.d.ts +0 -30
- package/dist/ui/components/InteractiveShell.d.ts.map +0 -1
- package/dist/ui/components/KeyboardHelp.d.ts +0 -7
- package/dist/ui/components/KeyboardHelp.d.ts.map +0 -1
- package/dist/ui/components/LoadingIndicator.d.ts +0 -3
- package/dist/ui/components/LoadingIndicator.d.ts.map +0 -1
- package/dist/ui/components/MCPAddScreen.d.ts +0 -13
- package/dist/ui/components/MCPAddScreen.d.ts.map +0 -1
- package/dist/ui/components/MCPListScreen.d.ts +0 -17
- package/dist/ui/components/MCPListScreen.d.ts.map +0 -1
- package/dist/ui/components/MCPServerListScreen.d.ts +0 -16
- package/dist/ui/components/MCPServerListScreen.d.ts.map +0 -1
- package/dist/ui/components/MarkdownRenderer.d.ts +0 -8
- package/dist/ui/components/MarkdownRenderer.d.ts.map +0 -1
- package/dist/ui/components/MessageBox.d.ts +0 -10
- package/dist/ui/components/MessageBox.d.ts.map +0 -1
- package/dist/ui/components/MessageDisplay.d.ts +0 -14
- package/dist/ui/components/MessageDisplay.d.ts.map +0 -1
- package/dist/ui/components/MonitorModeAIPanel.d.ts +0 -23
- package/dist/ui/components/MonitorModeAIPanel.d.ts.map +0 -1
- package/dist/ui/components/MultiLineInput.d.ts +0 -13
- package/dist/ui/components/MultiLineInput.d.ts.map +0 -1
- package/dist/ui/components/PasswordPrompt.d.ts +0 -9
- package/dist/ui/components/PasswordPrompt.d.ts.map +0 -1
- package/dist/ui/components/PlanAcceptedMessage.d.ts +0 -20
- package/dist/ui/components/PlanAcceptedMessage.d.ts.map +0 -1
- package/dist/ui/components/PlanReviewScreen.d.ts +0 -14
- package/dist/ui/components/PlanReviewScreen.d.ts.map +0 -1
- package/dist/ui/components/SelectPrompt.d.ts +0 -12
- package/dist/ui/components/SelectPrompt.d.ts.map +0 -1
- package/dist/ui/components/SlashCommandAutocomplete.d.ts +0 -13
- package/dist/ui/components/SlashCommandAutocomplete.d.ts.map +0 -1
- package/dist/ui/components/StatusBar.d.ts +0 -14
- package/dist/ui/components/StatusBar.d.ts.map +0 -1
- package/dist/ui/components/StreamingMessageDisplay.d.ts +0 -15
- package/dist/ui/components/StreamingMessageDisplay.d.ts.map +0 -1
- package/dist/ui/components/TaskCompletedMessage.d.ts +0 -14
- package/dist/ui/components/TaskCompletedMessage.d.ts.map +0 -1
- package/dist/ui/components/TaskProgressIndicator.d.ts +0 -18
- package/dist/ui/components/TaskProgressIndicator.d.ts.map +0 -1
- package/dist/ui/components/ThinkingDisplay.d.ts +0 -15
- package/dist/ui/components/ThinkingDisplay.d.ts.map +0 -1
- package/dist/ui/components/ToolExecutionMessage.d.ts +0 -8
- package/dist/ui/components/ToolExecutionMessage.d.ts.map +0 -1
- package/dist/ui/components/ToolExecutionStatus.d.ts +0 -10
- package/dist/ui/components/ToolExecutionStatus.d.ts.map +0 -1
- package/dist/ui/components/ToolResult.d.ts +0 -10
- package/dist/ui/components/ToolResult.d.ts.map +0 -1
- package/dist/ui/components/VersionUpdatePrompt.d.ts +0 -9
- package/dist/ui/components/VersionUpdatePrompt.d.ts.map +0 -1
- package/dist/ui/components/WelcomeBanner.d.ts +0 -3
- package/dist/ui/components/WelcomeBanner.d.ts.map +0 -1
- package/dist/ui/components/WorkflowCreatorScreen.d.ts +0 -25
- package/dist/ui/components/WorkflowCreatorScreen.d.ts.map +0 -1
- package/dist/utils/ansi-encoder.d.ts +0 -7
- package/dist/utils/ansi-encoder.d.ts.map +0 -1
- package/dist/utils/chat-formatter.d.ts +0 -12
- package/dist/utils/chat-formatter.d.ts.map +0 -1
- package/dist/utils/command-history.d.ts +0 -24
- package/dist/utils/command-history.d.ts.map +0 -1
- package/dist/utils/context-sanitizer.d.ts +0 -50
- package/dist/utils/context-sanitizer.d.ts.map +0 -1
- package/dist/utils/conversation-logger.d.ts +0 -142
- package/dist/utils/conversation-logger.d.ts.map +0 -1
- package/dist/utils/custom-commands-manager.d.ts +0 -59
- package/dist/utils/custom-commands-manager.d.ts.map +0 -1
- package/dist/utils/editor-utils.d.ts +0 -101
- package/dist/utils/editor-utils.d.ts.map +0 -1
- package/dist/utils/file.d.ts +0 -61
- package/dist/utils/file.d.ts.map +0 -1
- package/dist/utils/input-classifier.d.ts +0 -25
- package/dist/utils/input-classifier.d.ts.map +0 -1
- package/dist/utils/logger.d.ts +0 -17
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/markdown-parser.d.ts +0 -60
- package/dist/utils/markdown-parser.d.ts.map +0 -1
- package/dist/utils/shell.d.ts +0 -47
- package/dist/utils/shell.d.ts.map +0 -1
- package/dist/utils/state.d.ts +0 -13
- package/dist/utils/state.d.ts.map +0 -1
- package/dist/utils/syntax-checker.d.ts +0 -24
- package/dist/utils/syntax-checker.d.ts.map +0 -1
- package/dist/utils/terminal-output.d.ts +0 -25
- package/dist/utils/terminal-output.d.ts.map +0 -1
- package/dist/utils/text-clipboard.d.ts +0 -12
- package/dist/utils/text-clipboard.d.ts.map +0 -1
- package/dist/utils/unicode-sanitizer.d.ts +0 -44
- package/dist/utils/unicode-sanitizer.d.ts.map +0 -1
- package/dist/utils/version-checker.d.ts +0 -14
- package/dist/utils/version-checker.d.ts.map +0 -1
package/dist/tools/plan-mode.js
CHANGED
|
@@ -1,534 +1,490 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Plan Mode - Structured Task Planning and Execution
|
|
3
|
-
* Enables AI to create structured plans with hierarchical tasks and track completion
|
|
4
|
-
*
|
|
5
|
-
* Enhanced Features:
|
|
6
|
-
* - Hierarchical tasks with subtasks (e.g., Task 1 -> 1.1, 1.2, 1.3)
|
|
7
|
-
* - Design summary for context understanding
|
|
8
|
-
* - Phased execution (one task at a time)
|
|
9
|
-
* - Subtask-level completion tracking
|
|
10
|
-
*/
|
|
11
|
-
// ============================================================================
|
|
12
|
-
// STATE
|
|
13
|
-
// ============================================================================
|
|
14
|
-
// In-memory plan state
|
|
15
1
|
let currentPlan = null;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
|
|
40
|
-
Example structure:
|
|
41
|
-
- Task 1: Set up core infrastructure
|
|
42
|
-
- 1.1: Create directory structure
|
|
43
|
-
- 1.2: Define TypeScript interfaces
|
|
44
|
-
- Task 2: Implement main feature
|
|
45
|
-
- 2.1: Create component files
|
|
2
|
+
const createPlanTool = {
|
|
3
|
+
schema: {
|
|
4
|
+
name: "create_plan",
|
|
5
|
+
description: `Use this tool when in planning mode to create a detailed implementation plan.
|
|
6
|
+
This will present the plan to the user for review and approval before execution begins.
|
|
7
|
+
|
|
8
|
+
The plan should include:
|
|
9
|
+
1. A clear title describing what will be accomplished
|
|
10
|
+
2. A detailed design summary explaining your understanding of the codebase and approach
|
|
11
|
+
3. A brief summary of the overall approach
|
|
12
|
+
4. A numbered list of main tasks, each optionally containing subtasks
|
|
13
|
+
|
|
14
|
+
IMPORTANT: Only use this tool when in planning mode. Each task should be:
|
|
15
|
+
- Specific and actionable
|
|
16
|
+
- Can have subtasks for more granular steps
|
|
17
|
+
- Ordered in a logical sequence
|
|
18
|
+
|
|
19
|
+
Example structure:
|
|
20
|
+
- Task 1: Set up core infrastructure
|
|
21
|
+
- 1.1: Create directory structure
|
|
22
|
+
- 1.2: Define TypeScript interfaces
|
|
23
|
+
- Task 2: Implement main feature
|
|
24
|
+
- 2.1: Create component files
|
|
46
25
|
- 2.2: Add unit tests`,
|
|
47
|
-
|
|
48
|
-
|
|
26
|
+
parameters: {
|
|
27
|
+
type: "object",
|
|
28
|
+
properties: {
|
|
29
|
+
title: {
|
|
30
|
+
type: "string",
|
|
31
|
+
description: "A clear, concise title for the plan"
|
|
32
|
+
},
|
|
33
|
+
designSummary: {
|
|
34
|
+
type: "string",
|
|
35
|
+
description: "Detailed understanding of the codebase and how the changes will be implemented. Include architecture decisions, file structure understanding, and implementation approach."
|
|
36
|
+
},
|
|
37
|
+
summary: {
|
|
38
|
+
type: "string",
|
|
39
|
+
description: "Brief 1-2 sentence summary of the overall approach"
|
|
40
|
+
},
|
|
41
|
+
tasks: {
|
|
42
|
+
type: "array",
|
|
43
|
+
items: {
|
|
44
|
+
type: "object",
|
|
49
45
|
properties: {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
tasks: {
|
|
63
|
-
type: 'array',
|
|
64
|
-
items: {
|
|
65
|
-
type: 'object',
|
|
66
|
-
properties: {
|
|
67
|
-
description: {
|
|
68
|
-
type: 'string',
|
|
69
|
-
description: 'Clear description of what this main task accomplishes'
|
|
70
|
-
},
|
|
71
|
-
subtasks: {
|
|
72
|
-
type: 'array',
|
|
73
|
-
items: {
|
|
74
|
-
type: 'object',
|
|
75
|
-
properties: {
|
|
76
|
-
description: {
|
|
77
|
-
type: 'string',
|
|
78
|
-
description: 'Specific subtask description'
|
|
79
|
-
},
|
|
80
|
-
requirements: {
|
|
81
|
-
type: 'string',
|
|
82
|
-
description: 'Optional traceability requirements'
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
required: ['description']
|
|
86
|
-
},
|
|
87
|
-
description: 'Optional list of subtasks within this main task'
|
|
88
|
-
},
|
|
89
|
-
complexity: {
|
|
90
|
-
type: 'string',
|
|
91
|
-
enum: ['low', 'medium', 'high'],
|
|
92
|
-
description: 'Estimated complexity of the task'
|
|
93
|
-
},
|
|
94
|
-
requirements: {
|
|
95
|
-
type: 'string',
|
|
96
|
-
description: 'Optional traceability requirements'
|
|
97
|
-
}
|
|
98
|
-
},
|
|
99
|
-
required: ['description']
|
|
46
|
+
description: {
|
|
47
|
+
type: "string",
|
|
48
|
+
description: "Clear description of what this main task accomplishes"
|
|
49
|
+
},
|
|
50
|
+
subtasks: {
|
|
51
|
+
type: "array",
|
|
52
|
+
items: {
|
|
53
|
+
type: "object",
|
|
54
|
+
properties: {
|
|
55
|
+
description: {
|
|
56
|
+
type: "string",
|
|
57
|
+
description: "Specific subtask description"
|
|
100
58
|
},
|
|
101
|
-
|
|
102
|
-
|
|
59
|
+
requirements: {
|
|
60
|
+
type: "string",
|
|
61
|
+
description: "Optional traceability requirements"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
required: ["description"]
|
|
65
|
+
},
|
|
66
|
+
description: "Optional list of subtasks within this main task"
|
|
67
|
+
},
|
|
68
|
+
complexity: {
|
|
69
|
+
type: "string",
|
|
70
|
+
enum: ["low", "medium", "high"],
|
|
71
|
+
description: "Estimated complexity of the task"
|
|
72
|
+
},
|
|
73
|
+
requirements: {
|
|
74
|
+
type: "string",
|
|
75
|
+
description: "Optional traceability requirements"
|
|
76
|
+
}
|
|
103
77
|
},
|
|
104
|
-
required: [
|
|
78
|
+
required: ["description"]
|
|
79
|
+
},
|
|
80
|
+
description: "List of main tasks to execute, in order"
|
|
105
81
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
}
|
|
118
|
-
// Create the plan object with hierarchical structure
|
|
119
|
-
const plan = {
|
|
120
|
-
title: title.trim(),
|
|
121
|
-
designSummary: designSummary?.trim() || '',
|
|
122
|
-
summary: summary?.trim() || '',
|
|
123
|
-
steps: tasks.map((task, taskIndex) => ({
|
|
124
|
-
id: `task_${taskIndex + 1}`,
|
|
125
|
-
description: task.description.trim(),
|
|
126
|
-
subtasks: (task.subtasks || []).map((subtask, subtaskIndex) => ({
|
|
127
|
-
id: `${taskIndex + 1}.${subtaskIndex + 1}`,
|
|
128
|
-
description: subtask.description.trim(),
|
|
129
|
-
status: 'pending',
|
|
130
|
-
requirements: subtask.requirements?.trim()
|
|
131
|
-
})),
|
|
132
|
-
status: 'pending',
|
|
133
|
-
estimatedComplexity: task.complexity,
|
|
134
|
-
requirements: task.requirements?.trim()
|
|
135
|
-
})),
|
|
136
|
-
createdAt: new Date(),
|
|
137
|
-
approved: false,
|
|
138
|
-
isActive: false,
|
|
139
|
-
currentTaskIndex: 0,
|
|
140
|
-
currentSubtaskIndex: -1
|
|
141
|
-
};
|
|
142
|
-
currentPlan = plan;
|
|
143
|
-
// Return confirmation - the UI will handle displaying the plan
|
|
144
|
-
return `PLAN_CREATED:${JSON.stringify(plan)}`;
|
|
82
|
+
},
|
|
83
|
+
required: ["title", "summary", "tasks"]
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
async execute(args, context) {
|
|
87
|
+
const title = args.title;
|
|
88
|
+
const designSummary = args.designSummary || "";
|
|
89
|
+
const summary = args.summary;
|
|
90
|
+
const tasks = args.tasks;
|
|
91
|
+
if (!title || title.trim().length === 0) {
|
|
92
|
+
throw new Error("Plan title cannot be empty");
|
|
145
93
|
}
|
|
94
|
+
if (!tasks || tasks.length === 0) {
|
|
95
|
+
throw new Error("Plan must have at least one task");
|
|
96
|
+
}
|
|
97
|
+
const plan = {
|
|
98
|
+
title: title.trim(),
|
|
99
|
+
designSummary: designSummary?.trim() || "",
|
|
100
|
+
summary: summary?.trim() || "",
|
|
101
|
+
steps: tasks.map((task, taskIndex) => ({
|
|
102
|
+
id: `task_${taskIndex + 1}`,
|
|
103
|
+
description: task.description.trim(),
|
|
104
|
+
subtasks: (task.subtasks || []).map((subtask, subtaskIndex) => ({
|
|
105
|
+
id: `${taskIndex + 1}.${subtaskIndex + 1}`,
|
|
106
|
+
description: subtask.description.trim(),
|
|
107
|
+
status: "pending",
|
|
108
|
+
requirements: subtask.requirements?.trim()
|
|
109
|
+
})),
|
|
110
|
+
status: "pending",
|
|
111
|
+
estimatedComplexity: task.complexity,
|
|
112
|
+
requirements: task.requirements?.trim()
|
|
113
|
+
})),
|
|
114
|
+
createdAt: /* @__PURE__ */ new Date(),
|
|
115
|
+
approved: false,
|
|
116
|
+
isActive: false,
|
|
117
|
+
currentTaskIndex: 0,
|
|
118
|
+
currentSubtaskIndex: -1
|
|
119
|
+
};
|
|
120
|
+
currentPlan = plan;
|
|
121
|
+
return `PLAN_CREATED:${JSON.stringify(plan)}`;
|
|
122
|
+
}
|
|
146
123
|
};
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
-
|
|
164
|
-
-
|
|
165
|
-
|
|
166
|
-
IMPORTANT:
|
|
167
|
-
- Must have an active approved plan
|
|
168
|
-
- Mark subtasks complete as you finish them
|
|
124
|
+
const markTaskCompleteTool = {
|
|
125
|
+
schema: {
|
|
126
|
+
name: "mark_task_complete",
|
|
127
|
+
description: `Use this tool to mark a task or subtask as completed in the current plan.
|
|
128
|
+
Call this after successfully completing each task/subtask in the plan.
|
|
129
|
+
|
|
130
|
+
This will:
|
|
131
|
+
1. Update the task/subtask status to 'completed'
|
|
132
|
+
2. Show a completion message in the UI
|
|
133
|
+
3. Automatically advance to the next task/subtask
|
|
134
|
+
|
|
135
|
+
You can mark:
|
|
136
|
+
- A main task: task_number=2
|
|
137
|
+
- A subtask: task_number="2.1" (marks subtask 1 of task 2)
|
|
138
|
+
|
|
139
|
+
IMPORTANT:
|
|
140
|
+
- Must have an active approved plan
|
|
141
|
+
- Mark subtasks complete as you finish them
|
|
169
142
|
- After marking the LAST task/subtask complete, output your summary then call task_complete to end the session`,
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
}
|
|
181
|
-
},
|
|
182
|
-
required: ['task_number']
|
|
183
|
-
}
|
|
184
|
-
},
|
|
185
|
-
async execute(args, context) {
|
|
186
|
-
if (!currentPlan) {
|
|
187
|
-
throw new Error('No active plan. Create a plan first using create_plan.');
|
|
143
|
+
parameters: {
|
|
144
|
+
type: "object",
|
|
145
|
+
properties: {
|
|
146
|
+
task_number: {
|
|
147
|
+
type: "string",
|
|
148
|
+
description: 'The task number to mark complete. Use integer for main task (e.g., "2") or dot notation for subtask (e.g., "2.1")'
|
|
149
|
+
},
|
|
150
|
+
completion_note: {
|
|
151
|
+
type: "string",
|
|
152
|
+
description: "Optional note about what was accomplished"
|
|
188
153
|
}
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
}
|
|
192
|
-
const taskNumberStr = String(args.task_number);
|
|
193
|
-
const completionNote = args.completion_note;
|
|
194
|
-
// Parse task number - can be "2" or "2.1"
|
|
195
|
-
const parts = taskNumberStr.split('.');
|
|
196
|
-
const mainTaskNum = parseInt(parts[0], 10);
|
|
197
|
-
const subtaskNum = parts.length > 1 ? parseInt(parts[1], 10) : null;
|
|
198
|
-
if (isNaN(mainTaskNum) || mainTaskNum < 1 || mainTaskNum > currentPlan.steps.length) {
|
|
199
|
-
throw new Error(`Invalid task number. Must be between 1 and ${currentPlan.steps.length}.`);
|
|
200
|
-
}
|
|
201
|
-
const taskIndex = mainTaskNum - 1;
|
|
202
|
-
const task = currentPlan.steps[taskIndex];
|
|
203
|
-
// Handle subtask completion
|
|
204
|
-
if (subtaskNum !== null) {
|
|
205
|
-
if (!task.subtasks || subtaskNum < 1 || subtaskNum > task.subtasks.length) {
|
|
206
|
-
throw new Error(`Invalid subtask number. Task ${mainTaskNum} has ${task.subtasks?.length || 0} subtasks.`);
|
|
207
|
-
}
|
|
208
|
-
const subtaskIndex = subtaskNum - 1;
|
|
209
|
-
const subtask = task.subtasks[subtaskIndex];
|
|
210
|
-
if (subtask.status === 'completed') {
|
|
211
|
-
return `Subtask ${taskNumberStr} is already marked as completed.`;
|
|
212
|
-
}
|
|
213
|
-
// Mark subtask complete
|
|
214
|
-
subtask.status = 'completed';
|
|
215
|
-
subtask.completedAt = new Date();
|
|
216
|
-
// Check if all subtasks are complete, then mark main task as complete
|
|
217
|
-
const allSubtasksComplete = task.subtasks.every(st => st.status === 'completed' || st.status === 'skipped');
|
|
218
|
-
if (allSubtasksComplete) {
|
|
219
|
-
task.status = 'completed';
|
|
220
|
-
task.completedAt = new Date();
|
|
221
|
-
}
|
|
222
|
-
else {
|
|
223
|
-
task.status = 'in_progress';
|
|
224
|
-
}
|
|
225
|
-
// Update current subtask index
|
|
226
|
-
const nextPendingSubtaskIndex = task.subtasks.findIndex((st, idx) => idx > subtaskIndex && st.status === 'pending');
|
|
227
|
-
currentPlan.currentSubtaskIndex = nextPendingSubtaskIndex;
|
|
228
|
-
// Calculate progress
|
|
229
|
-
const { completedCount, totalCount, allComplete } = calculateProgress();
|
|
230
|
-
const result = {
|
|
231
|
-
type: 'subtask',
|
|
232
|
-
taskNumber: taskNumberStr,
|
|
233
|
-
taskDescription: subtask.description,
|
|
234
|
-
completionNote: completionNote || null,
|
|
235
|
-
completedCount,
|
|
236
|
-
totalCount,
|
|
237
|
-
allComplete,
|
|
238
|
-
nextSubtask: nextPendingSubtaskIndex !== -1 ? task.subtasks[nextPendingSubtaskIndex].description : null,
|
|
239
|
-
mainTaskComplete: allSubtasksComplete
|
|
240
|
-
};
|
|
241
|
-
return `TASK_COMPLETED:${JSON.stringify(result)}`;
|
|
242
|
-
}
|
|
243
|
-
// Handle main task completion (mark all subtasks as complete too)
|
|
244
|
-
if (task.status === 'completed') {
|
|
245
|
-
return `Task ${mainTaskNum} is already marked as completed.`;
|
|
246
|
-
}
|
|
247
|
-
// Mark the main task and all its subtasks as complete
|
|
248
|
-
task.status = 'completed';
|
|
249
|
-
task.completedAt = new Date();
|
|
250
|
-
task.subtasks.forEach(st => {
|
|
251
|
-
if (st.status !== 'completed' && st.status !== 'skipped') {
|
|
252
|
-
st.status = 'completed';
|
|
253
|
-
st.completedAt = new Date();
|
|
254
|
-
}
|
|
255
|
-
});
|
|
256
|
-
// Update current task index to next pending task
|
|
257
|
-
const nextPendingIndex = currentPlan.steps.findIndex((step, idx) => idx > taskIndex && step.status === 'pending');
|
|
258
|
-
if (nextPendingIndex !== -1) {
|
|
259
|
-
currentPlan.currentTaskIndex = nextPendingIndex;
|
|
260
|
-
currentPlan.currentSubtaskIndex = -1;
|
|
261
|
-
}
|
|
262
|
-
// Calculate progress
|
|
263
|
-
const { completedCount, totalCount, allComplete } = calculateProgress();
|
|
264
|
-
const result = {
|
|
265
|
-
type: 'task',
|
|
266
|
-
taskNumber: mainTaskNum,
|
|
267
|
-
taskDescription: task.description,
|
|
268
|
-
completionNote: completionNote || null,
|
|
269
|
-
completedCount,
|
|
270
|
-
totalCount,
|
|
271
|
-
allComplete,
|
|
272
|
-
nextTask: allComplete ? null : currentPlan.steps[currentPlan.currentTaskIndex]?.description
|
|
273
|
-
};
|
|
274
|
-
return `TASK_COMPLETED:${JSON.stringify(result)}`;
|
|
154
|
+
},
|
|
155
|
+
required: ["task_number"]
|
|
275
156
|
}
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
// HELPER FUNCTIONS
|
|
279
|
-
// ============================================================================
|
|
280
|
-
/**
|
|
281
|
-
* Calculate overall progress including subtasks
|
|
282
|
-
*/
|
|
283
|
-
function calculateProgress() {
|
|
157
|
+
},
|
|
158
|
+
async execute(args, context) {
|
|
284
159
|
if (!currentPlan) {
|
|
285
|
-
|
|
160
|
+
throw new Error("No active plan. Create a plan first using create_plan.");
|
|
286
161
|
}
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
162
|
+
if (!currentPlan.approved || !currentPlan.isActive) {
|
|
163
|
+
throw new Error("Plan must be approved and active before marking tasks complete.");
|
|
164
|
+
}
|
|
165
|
+
const taskNumberStr = String(args.task_number);
|
|
166
|
+
const completionNote = args.completion_note;
|
|
167
|
+
const parts = taskNumberStr.split(".");
|
|
168
|
+
const mainTaskNum = parseInt(parts[0], 10);
|
|
169
|
+
const subtaskNum = parts.length > 1 ? parseInt(parts[1], 10) : null;
|
|
170
|
+
if (isNaN(mainTaskNum) || mainTaskNum < 1 || mainTaskNum > currentPlan.steps.length) {
|
|
171
|
+
throw new Error(`Invalid task number. Must be between 1 and ${currentPlan.steps.length}.`);
|
|
172
|
+
}
|
|
173
|
+
const taskIndex = mainTaskNum - 1;
|
|
174
|
+
const task = currentPlan.steps[taskIndex];
|
|
175
|
+
if (subtaskNum !== null) {
|
|
176
|
+
if (!task.subtasks || subtaskNum < 1 || subtaskNum > task.subtasks.length) {
|
|
177
|
+
throw new Error(`Invalid subtask number. Task ${mainTaskNum} has ${task.subtasks?.length || 0} subtasks.`);
|
|
178
|
+
}
|
|
179
|
+
const subtaskIndex = subtaskNum - 1;
|
|
180
|
+
const subtask = task.subtasks[subtaskIndex];
|
|
181
|
+
if (subtask.status === "completed") {
|
|
182
|
+
return `Subtask ${taskNumberStr} is already marked as completed.`;
|
|
183
|
+
}
|
|
184
|
+
subtask.status = "completed";
|
|
185
|
+
subtask.completedAt = /* @__PURE__ */ new Date();
|
|
186
|
+
const allSubtasksComplete = task.subtasks.every((st) => st.status === "completed" || st.status === "skipped");
|
|
187
|
+
if (allSubtasksComplete) {
|
|
188
|
+
task.status = "completed";
|
|
189
|
+
task.completedAt = /* @__PURE__ */ new Date();
|
|
190
|
+
} else {
|
|
191
|
+
task.status = "in_progress";
|
|
192
|
+
}
|
|
193
|
+
const nextPendingSubtaskIndex = task.subtasks.findIndex(
|
|
194
|
+
(st, idx) => idx > subtaskIndex && st.status === "pending"
|
|
195
|
+
);
|
|
196
|
+
currentPlan.currentSubtaskIndex = nextPendingSubtaskIndex;
|
|
197
|
+
const { completedCount: completedCount2, totalCount: totalCount2, allComplete: allComplete2 } = calculateProgress();
|
|
198
|
+
const result2 = {
|
|
199
|
+
type: "subtask",
|
|
200
|
+
taskNumber: taskNumberStr,
|
|
201
|
+
taskDescription: subtask.description,
|
|
202
|
+
completionNote: completionNote || null,
|
|
203
|
+
completedCount: completedCount2,
|
|
204
|
+
totalCount: totalCount2,
|
|
205
|
+
allComplete: allComplete2,
|
|
206
|
+
nextSubtask: nextPendingSubtaskIndex !== -1 ? task.subtasks[nextPendingSubtaskIndex].description : null,
|
|
207
|
+
mainTaskComplete: allSubtasksComplete
|
|
208
|
+
};
|
|
209
|
+
return `TASK_COMPLETED:${JSON.stringify(result2)}`;
|
|
210
|
+
}
|
|
211
|
+
if (task.status === "completed") {
|
|
212
|
+
return `Task ${mainTaskNum} is already marked as completed.`;
|
|
213
|
+
}
|
|
214
|
+
task.status = "completed";
|
|
215
|
+
task.completedAt = /* @__PURE__ */ new Date();
|
|
216
|
+
task.subtasks.forEach((st) => {
|
|
217
|
+
if (st.status !== "completed" && st.status !== "skipped") {
|
|
218
|
+
st.status = "completed";
|
|
219
|
+
st.completedAt = /* @__PURE__ */ new Date();
|
|
220
|
+
}
|
|
301
221
|
});
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
222
|
+
const nextPendingIndex = currentPlan.steps.findIndex(
|
|
223
|
+
(step, idx) => idx > taskIndex && step.status === "pending"
|
|
224
|
+
);
|
|
225
|
+
if (nextPendingIndex !== -1) {
|
|
226
|
+
currentPlan.currentTaskIndex = nextPendingIndex;
|
|
227
|
+
currentPlan.currentSubtaskIndex = -1;
|
|
228
|
+
}
|
|
229
|
+
const { completedCount, totalCount, allComplete } = calculateProgress();
|
|
230
|
+
const result = {
|
|
231
|
+
type: "task",
|
|
232
|
+
taskNumber: mainTaskNum,
|
|
233
|
+
taskDescription: task.description,
|
|
234
|
+
completionNote: completionNote || null,
|
|
235
|
+
completedCount,
|
|
236
|
+
totalCount,
|
|
237
|
+
allComplete,
|
|
238
|
+
nextTask: allComplete ? null : currentPlan.steps[currentPlan.currentTaskIndex]?.description
|
|
306
239
|
};
|
|
240
|
+
return `TASK_COMPLETED:${JSON.stringify(result)}`;
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
function calculateProgress() {
|
|
244
|
+
if (!currentPlan) {
|
|
245
|
+
return { completedCount: 0, totalCount: 0, allComplete: false };
|
|
246
|
+
}
|
|
247
|
+
let completedCount = 0;
|
|
248
|
+
let totalCount = 0;
|
|
249
|
+
currentPlan.steps.forEach((step) => {
|
|
250
|
+
if (step.subtasks.length > 0) {
|
|
251
|
+
totalCount += step.subtasks.length;
|
|
252
|
+
completedCount += step.subtasks.filter((st) => st.status === "completed").length;
|
|
253
|
+
} else {
|
|
254
|
+
totalCount += 1;
|
|
255
|
+
if (step.status === "completed") completedCount += 1;
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
return {
|
|
259
|
+
completedCount,
|
|
260
|
+
totalCount,
|
|
261
|
+
allComplete: completedCount === totalCount && totalCount > 0
|
|
262
|
+
};
|
|
307
263
|
}
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
*/
|
|
311
|
-
export function setPlan(plan) {
|
|
312
|
-
currentPlan = plan;
|
|
264
|
+
function setPlan(plan) {
|
|
265
|
+
currentPlan = plan;
|
|
313
266
|
}
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
*/
|
|
317
|
-
export function getCurrentPlan() {
|
|
318
|
-
return currentPlan;
|
|
267
|
+
function getCurrentPlan() {
|
|
268
|
+
return currentPlan;
|
|
319
269
|
}
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
*/
|
|
323
|
-
export function clearPlan() {
|
|
324
|
-
currentPlan = null;
|
|
270
|
+
function clearPlan() {
|
|
271
|
+
currentPlan = null;
|
|
325
272
|
}
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
currentPlan.currentSubtaskIndex = currentPlan.steps[0]?.subtasks?.length > 0 ? 0 : -1;
|
|
335
|
-
}
|
|
336
|
-
return currentPlan;
|
|
273
|
+
function approvePlan() {
|
|
274
|
+
if (currentPlan) {
|
|
275
|
+
currentPlan.approved = true;
|
|
276
|
+
currentPlan.isActive = true;
|
|
277
|
+
currentPlan.currentTaskIndex = 0;
|
|
278
|
+
currentPlan.currentSubtaskIndex = currentPlan.steps[0]?.subtasks?.length > 0 ? 0 : -1;
|
|
279
|
+
}
|
|
280
|
+
return currentPlan;
|
|
337
281
|
}
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
st.status = 'completed';
|
|
351
|
-
st.completedAt = new Date();
|
|
352
|
-
});
|
|
353
|
-
return task;
|
|
354
|
-
}
|
|
355
|
-
/**
|
|
356
|
-
* Get the current phase (task) with all its subtasks
|
|
357
|
-
*/
|
|
358
|
-
export function getCurrentPhase() {
|
|
359
|
-
if (!currentPlan || !currentPlan.isActive)
|
|
360
|
-
return null;
|
|
361
|
-
const taskIndex = currentPlan.currentTaskIndex;
|
|
362
|
-
if (taskIndex < 0 || taskIndex >= currentPlan.steps.length)
|
|
363
|
-
return null;
|
|
364
|
-
const task = currentPlan.steps[taskIndex];
|
|
365
|
-
if (task.status === 'completed') {
|
|
366
|
-
// Find next pending task
|
|
367
|
-
const nextIndex = currentPlan.steps.findIndex((step, idx) => idx > taskIndex && step.status === 'pending');
|
|
368
|
-
if (nextIndex === -1)
|
|
369
|
-
return null;
|
|
370
|
-
return { taskNumber: nextIndex + 1, task: currentPlan.steps[nextIndex] };
|
|
371
|
-
}
|
|
372
|
-
return { taskNumber: taskIndex + 1, task };
|
|
282
|
+
function markTaskComplete(taskNumber) {
|
|
283
|
+
if (!currentPlan || taskNumber < 1 || taskNumber > currentPlan.steps.length) {
|
|
284
|
+
return null;
|
|
285
|
+
}
|
|
286
|
+
const task = currentPlan.steps[taskNumber - 1];
|
|
287
|
+
task.status = "completed";
|
|
288
|
+
task.completedAt = /* @__PURE__ */ new Date();
|
|
289
|
+
task.subtasks.forEach((st) => {
|
|
290
|
+
st.status = "completed";
|
|
291
|
+
st.completedAt = /* @__PURE__ */ new Date();
|
|
292
|
+
});
|
|
293
|
+
return task;
|
|
373
294
|
}
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
if (
|
|
384
|
-
currentTask.status = 'completed';
|
|
385
|
-
currentTask.completedAt = new Date();
|
|
386
|
-
}
|
|
387
|
-
// Find next pending task
|
|
388
|
-
const nextIndex = currentPlan.steps.findIndex((step, idx) => idx > currentPlan.currentTaskIndex && step.status === 'pending');
|
|
389
|
-
if (nextIndex === -1) {
|
|
390
|
-
return null; // All phases complete
|
|
391
|
-
}
|
|
392
|
-
currentPlan.currentTaskIndex = nextIndex;
|
|
393
|
-
currentPlan.currentSubtaskIndex = currentPlan.steps[nextIndex].subtasks.length > 0 ? 0 : -1;
|
|
295
|
+
function getCurrentPhase() {
|
|
296
|
+
if (!currentPlan || !currentPlan.isActive) return null;
|
|
297
|
+
const taskIndex = currentPlan.currentTaskIndex;
|
|
298
|
+
if (taskIndex < 0 || taskIndex >= currentPlan.steps.length) return null;
|
|
299
|
+
const task = currentPlan.steps[taskIndex];
|
|
300
|
+
if (task.status === "completed") {
|
|
301
|
+
const nextIndex = currentPlan.steps.findIndex(
|
|
302
|
+
(step, idx) => idx > taskIndex && step.status === "pending"
|
|
303
|
+
);
|
|
304
|
+
if (nextIndex === -1) return null;
|
|
394
305
|
return { taskNumber: nextIndex + 1, task: currentPlan.steps[nextIndex] };
|
|
306
|
+
}
|
|
307
|
+
return { taskNumber: taskIndex + 1, task };
|
|
395
308
|
}
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
309
|
+
function advanceToNextPhase() {
|
|
310
|
+
if (!currentPlan || !currentPlan.isActive) return null;
|
|
311
|
+
const currentTask = currentPlan.steps[currentPlan.currentTaskIndex];
|
|
312
|
+
if (currentTask && currentTask.status !== "completed") {
|
|
313
|
+
currentTask.status = "completed";
|
|
314
|
+
currentTask.completedAt = /* @__PURE__ */ new Date();
|
|
315
|
+
}
|
|
316
|
+
const nextIndex = currentPlan.steps.findIndex(
|
|
317
|
+
(step, idx) => idx > currentPlan.currentTaskIndex && step.status === "pending"
|
|
318
|
+
);
|
|
319
|
+
if (nextIndex === -1) {
|
|
320
|
+
return null;
|
|
321
|
+
}
|
|
322
|
+
currentPlan.currentTaskIndex = nextIndex;
|
|
323
|
+
currentPlan.currentSubtaskIndex = currentPlan.steps[nextIndex].subtasks.length > 0 ? 0 : -1;
|
|
324
|
+
return { taskNumber: nextIndex + 1, task: currentPlan.steps[nextIndex] };
|
|
409
325
|
}
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
326
|
+
function getNextIncompleteTask() {
|
|
327
|
+
if (!currentPlan) return null;
|
|
328
|
+
const index = currentPlan.steps.findIndex((step) => step.status === "pending" || step.status === "in_progress");
|
|
329
|
+
if (index === -1) return null;
|
|
330
|
+
return {
|
|
331
|
+
taskNumber: index + 1,
|
|
332
|
+
task: currentPlan.steps[index]
|
|
333
|
+
};
|
|
417
334
|
}
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
export function getPlanProgress() {
|
|
422
|
-
if (!currentPlan)
|
|
423
|
-
return null;
|
|
424
|
-
const { completedCount, totalCount } = calculateProgress();
|
|
425
|
-
const percentage = totalCount > 0 ? Math.round((completedCount / totalCount) * 100) : 0;
|
|
426
|
-
const completedTasks = currentPlan.steps.filter(s => s.status === 'completed').length;
|
|
427
|
-
return {
|
|
428
|
-
completed: completedCount,
|
|
429
|
-
total: totalCount,
|
|
430
|
-
percentage,
|
|
431
|
-
currentTask: currentPlan.currentTaskIndex + 1,
|
|
432
|
-
totalTasks: currentPlan.steps.length
|
|
433
|
-
};
|
|
335
|
+
function areAllTasksComplete() {
|
|
336
|
+
if (!currentPlan) return false;
|
|
337
|
+
return currentPlan.steps.every((step) => step.status === "completed" || step.status === "skipped");
|
|
434
338
|
}
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
339
|
+
function getPlanProgress() {
|
|
340
|
+
if (!currentPlan) return null;
|
|
341
|
+
const { completedCount, totalCount } = calculateProgress();
|
|
342
|
+
const percentage = totalCount > 0 ? Math.round(completedCount / totalCount * 100) : 0;
|
|
343
|
+
const completedTasks = currentPlan.steps.filter((s) => s.status === "completed").length;
|
|
344
|
+
return {
|
|
345
|
+
completed: completedCount,
|
|
346
|
+
total: totalCount,
|
|
347
|
+
percentage,
|
|
348
|
+
currentTask: currentPlan.currentTaskIndex + 1,
|
|
349
|
+
totalTasks: currentPlan.steps.length
|
|
350
|
+
};
|
|
351
|
+
}
|
|
352
|
+
function getPlanContextForPrompt() {
|
|
353
|
+
if (!currentPlan || !currentPlan.isActive) return "";
|
|
354
|
+
const progress = getPlanProgress();
|
|
355
|
+
if (!progress) return "";
|
|
356
|
+
let context = `
|
|
357
|
+
|
|
358
|
+
## ACTIVE PLAN: ${currentPlan.title}
|
|
359
|
+
`;
|
|
360
|
+
if (currentPlan.designSummary) {
|
|
361
|
+
context += `
|
|
362
|
+
### Design Summary:
|
|
363
|
+
${currentPlan.designSummary}
|
|
364
|
+
`;
|
|
365
|
+
}
|
|
366
|
+
context += `
|
|
367
|
+
Progress: ${progress.completed}/${progress.total} items completed (${progress.percentage}%)
|
|
368
|
+
`;
|
|
369
|
+
context += `Current Task: ${progress.currentTask}/${progress.totalTasks}
|
|
370
|
+
|
|
371
|
+
`;
|
|
372
|
+
context += `### Tasks:
|
|
373
|
+
`;
|
|
374
|
+
currentPlan.steps.forEach((step, index) => {
|
|
375
|
+
const statusIcon = step.status === "completed" ? "\u2705" : step.status === "in_progress" ? "\u{1F504}" : step.status === "skipped" ? "\u23ED\uFE0F" : "\u23F3";
|
|
376
|
+
const isCurrent = index === currentPlan.currentTaskIndex && step.status !== "completed";
|
|
377
|
+
const marker = isCurrent ? " \u{1F448} CURRENT" : "";
|
|
378
|
+
context += `${index + 1}. ${statusIcon} ${step.description}${marker}
|
|
379
|
+
`;
|
|
380
|
+
step.subtasks.forEach((subtask, subIndex) => {
|
|
381
|
+
const subStatusIcon = subtask.status === "completed" ? "\u2705" : subtask.status === "in_progress" ? "\u{1F504}" : "\u2B1C";
|
|
382
|
+
context += ` ${index + 1}.${subIndex + 1}. ${subStatusIcon} ${subtask.description}
|
|
383
|
+
`;
|
|
464
384
|
});
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
385
|
+
});
|
|
386
|
+
const nextTask = getNextIncompleteTask();
|
|
387
|
+
if (nextTask) {
|
|
388
|
+
context += `
|
|
389
|
+
**NEXT ACTION**: Complete task ${nextTask.taskNumber}: ${nextTask.task.description}
|
|
390
|
+
`;
|
|
391
|
+
context += `After completing this task, call mark_task_complete with task_number=${nextTask.taskNumber}
|
|
392
|
+
`;
|
|
393
|
+
} else {
|
|
394
|
+
context += `
|
|
395
|
+
**ALL TASKS COMPLETE**: Output your summary of what was accomplished, then call task_complete().
|
|
396
|
+
`;
|
|
397
|
+
}
|
|
398
|
+
return context;
|
|
474
399
|
}
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
400
|
+
function getPhaseContextForPrompt() {
|
|
401
|
+
if (!currentPlan || !currentPlan.isActive) return "";
|
|
402
|
+
const currentPhase = getCurrentPhase();
|
|
403
|
+
if (!currentPhase) {
|
|
404
|
+
return `
|
|
405
|
+
**ALL TASKS COMPLETE**: Output your summary of what was accomplished, then call task_complete().
|
|
406
|
+
`;
|
|
407
|
+
}
|
|
408
|
+
const progress = getPlanProgress();
|
|
409
|
+
const { taskNumber, task } = currentPhase;
|
|
410
|
+
let context = `
|
|
411
|
+
|
|
412
|
+
## CURRENT TASK: ${currentPlan.title}
|
|
413
|
+
`;
|
|
414
|
+
if (currentPlan.designSummary) {
|
|
415
|
+
context += `
|
|
416
|
+
### Design Context:
|
|
417
|
+
${currentPlan.designSummary}
|
|
418
|
+
`;
|
|
419
|
+
}
|
|
420
|
+
context += `
|
|
421
|
+
### Overall Progress: Task ${taskNumber}/${currentPlan.steps.length}
|
|
422
|
+
`;
|
|
423
|
+
context += `${progress ? `(${progress.completed}/${progress.total} items completed - ${progress.percentage}%)` : ""}
|
|
424
|
+
|
|
425
|
+
`;
|
|
426
|
+
context += `### YOUR CURRENT TASK:
|
|
427
|
+
`;
|
|
428
|
+
context += `**Task ${taskNumber}: ${task.description}**
|
|
429
|
+
|
|
430
|
+
`;
|
|
431
|
+
if (task.subtasks.length > 0) {
|
|
432
|
+
context += `Subtasks to complete:
|
|
433
|
+
`;
|
|
434
|
+
task.subtasks.forEach((subtask, index) => {
|
|
435
|
+
const subStatusIcon = subtask.status === "completed" ? "\u2705" : subtask.status === "in_progress" ? "\u{1F504}" : "\u2B1C";
|
|
436
|
+
const isCurrentSubtask = index === currentPlan.currentSubtaskIndex;
|
|
437
|
+
const marker = isCurrentSubtask && subtask.status === "pending" ? " \u{1F448} CURRENT" : "";
|
|
438
|
+
context += ` ${taskNumber}.${index + 1}. ${subStatusIcon} ${subtask.description}${marker}
|
|
439
|
+
`;
|
|
440
|
+
});
|
|
441
|
+
context += `
|
|
442
|
+
**Instructions**: Complete each subtask in order.
|
|
443
|
+
`;
|
|
444
|
+
context += `After completing a subtask, call: mark_task_complete(task_number="${taskNumber}.X")
|
|
445
|
+
`;
|
|
446
|
+
context += `When all subtasks are done, the main task will be automatically marked complete.
|
|
447
|
+
`;
|
|
448
|
+
} else {
|
|
449
|
+
context += `
|
|
450
|
+
**Instructions**: Complete this task.
|
|
451
|
+
`;
|
|
452
|
+
context += `When done, call: mark_task_complete(task_number="${taskNumber}")
|
|
453
|
+
`;
|
|
454
|
+
}
|
|
455
|
+
return context;
|
|
514
456
|
}
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
457
|
+
var plan_mode_default = {
|
|
458
|
+
createPlanTool,
|
|
459
|
+
markTaskCompleteTool,
|
|
460
|
+
setPlan,
|
|
461
|
+
getCurrentPlan,
|
|
462
|
+
clearPlan,
|
|
463
|
+
approvePlan,
|
|
464
|
+
markTaskComplete,
|
|
465
|
+
getCurrentPhase,
|
|
466
|
+
advanceToNextPhase,
|
|
467
|
+
getNextIncompleteTask,
|
|
468
|
+
areAllTasksComplete,
|
|
469
|
+
getPlanProgress,
|
|
470
|
+
getPlanContextForPrompt,
|
|
471
|
+
getPhaseContextForPrompt
|
|
472
|
+
};
|
|
473
|
+
export {
|
|
474
|
+
advanceToNextPhase,
|
|
475
|
+
approvePlan,
|
|
476
|
+
areAllTasksComplete,
|
|
477
|
+
clearPlan,
|
|
478
|
+
createPlanTool,
|
|
479
|
+
plan_mode_default as default,
|
|
480
|
+
getCurrentPhase,
|
|
481
|
+
getCurrentPlan,
|
|
482
|
+
getNextIncompleteTask,
|
|
483
|
+
getPhaseContextForPrompt,
|
|
484
|
+
getPlanContextForPrompt,
|
|
485
|
+
getPlanProgress,
|
|
486
|
+
markTaskComplete,
|
|
487
|
+
markTaskCompleteTool,
|
|
488
|
+
setPlan
|
|
533
489
|
};
|
|
534
490
|
//# sourceMappingURL=plan-mode.js.map
|