@aggroot-team/aggroot 1.7.2

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.
Files changed (87) hide show
  1. package/.env.example +106 -0
  2. package/LICENSE +21 -0
  3. package/README.md +496 -0
  4. package/dist/cli.cjs +26 -0
  5. package/dist/index.cjs +45238 -0
  6. package/dist/native/better_sqlite3.node +0 -0
  7. package/dist/tree-sitter-c.wasm +0 -0
  8. package/dist/tree-sitter-cpp.wasm +0 -0
  9. package/dist/web-tree-sitter.wasm +0 -0
  10. package/install-linux.sh +123 -0
  11. package/install-windows.bat +121 -0
  12. package/package.json +155 -0
  13. package/scripts/build-all.mjs +42 -0
  14. package/scripts/fix-workspace-deps.mjs +41 -0
  15. package/scripts/generate-example-skills.ts +238 -0
  16. package/scripts/import-meta-shim.js +3 -0
  17. package/scripts/install-browsers.mjs +132 -0
  18. package/scripts/obfuscate.mjs +215 -0
  19. package/scripts/test-bash-parser.ts +37 -0
  20. package/scripts/test-parser2.ts +24 -0
  21. package/scripts/test-parser3.js +4 -0
  22. package/scripts/test-tokenizer.js +148 -0
  23. package/scripts/verify-no-source.mjs +83 -0
  24. package/share/agents/agent-coder.json +256 -0
  25. package/share/agents/agent-devops.json +61 -0
  26. package/share/agents/agent-writer.json +213 -0
  27. package/share/scripts/_utils.py +105 -0
  28. package/share/scripts/market_overview.py +244 -0
  29. package/share/scripts/stock_compare.py +244 -0
  30. package/share/scripts/stock_financial.py +211 -0
  31. package/share/scripts/stock_news.py +181 -0
  32. package/share/scripts/stock_quote.py +433 -0
  33. package/share/scripts/stock_technical.py +402 -0
  34. package/share/web/dist/assets/arc-DmQ0lviI.js +1 -0
  35. package/share/web/dist/assets/architectureDiagram-3BPJPVTR-KELFQLRt.js +36 -0
  36. package/share/web/dist/assets/blockDiagram-GPEHLZMM-D_2waPJB.js +132 -0
  37. package/share/web/dist/assets/c4Diagram-AAUBKEIU-BxaYriMP.js +10 -0
  38. package/share/web/dist/assets/channel-DppiAmuZ.js +1 -0
  39. package/share/web/dist/assets/chunk-2J33WTMH-D_wcMArK.js +1 -0
  40. package/share/web/dist/assets/chunk-4BX2VUAB-C4Mm8aE8.js +1 -0
  41. package/share/web/dist/assets/chunk-55IACEB6-Djo1jBPb.js +1 -0
  42. package/share/web/dist/assets/chunk-727SXJPM-D-9kzLrQ.js +206 -0
  43. package/share/web/dist/assets/chunk-AQP2D5EJ-BV58AHlG.js +231 -0
  44. package/share/web/dist/assets/chunk-FMBD7UC4-D3AHszVJ.js +15 -0
  45. package/share/web/dist/assets/chunk-ND2GUHAM-CCuQ63c7.js +1 -0
  46. package/share/web/dist/assets/chunk-QZHKN3VN-Dl9PXzs1.js +1 -0
  47. package/share/web/dist/assets/classDiagram-4FO5ZUOK-BnkzOZLJ.js +1 -0
  48. package/share/web/dist/assets/classDiagram-v2-Q7XG4LA2-BnkzOZLJ.js +1 -0
  49. package/share/web/dist/assets/cose-bilkent-S5V4N54A-BuRspznV.js +1 -0
  50. package/share/web/dist/assets/cytoscape.esm-CkSuTymj.js +321 -0
  51. package/share/web/dist/assets/dagre-BM42HDAG-D4fhww9y.js +4 -0
  52. package/share/web/dist/assets/defaultLocale-CrowFXzY.js +1 -0
  53. package/share/web/dist/assets/diagram-2AECGRRQ-dMi9m1J4.js +43 -0
  54. package/share/web/dist/assets/diagram-5GNKFQAL-CjRIIBA8.js +10 -0
  55. package/share/web/dist/assets/diagram-KO2AKTUF-gR1tXbmQ.js +3 -0
  56. package/share/web/dist/assets/diagram-LMA3HP47-CQkJCjQX.js +24 -0
  57. package/share/web/dist/assets/diagram-OG6HWLK6-DBEvIvu5.js +24 -0
  58. package/share/web/dist/assets/erDiagram-TEJ5UH35-ChwS3Oys.js +85 -0
  59. package/share/web/dist/assets/flowDiagram-I6XJVG4X-yYT7qyQr.js +162 -0
  60. package/share/web/dist/assets/ganttDiagram-6RSMTGT7-9TgEI2XC.js +292 -0
  61. package/share/web/dist/assets/gitGraphDiagram-PVQCEYII-PVcWiaLN.js +106 -0
  62. package/share/web/dist/assets/graph-D2o_JWn5.js +1 -0
  63. package/share/web/dist/assets/index-BWshepxw.js +407 -0
  64. package/share/web/dist/assets/index-aC35iubs.css +1 -0
  65. package/share/web/dist/assets/infoDiagram-5YYISTIA-C5_cYCEE.js +2 -0
  66. package/share/web/dist/assets/init-Gi6I4Gst.js +1 -0
  67. package/share/web/dist/assets/ishikawaDiagram-YF4QCWOH-Day2c-1K.js +70 -0
  68. package/share/web/dist/assets/journeyDiagram-JHISSGLW-BZdHoYic.js +139 -0
  69. package/share/web/dist/assets/kanban-definition-UN3LZRKU-DoEoEViV.js +89 -0
  70. package/share/web/dist/assets/katex-HP8lGamR.js +257 -0
  71. package/share/web/dist/assets/layout-UJbxhwF7.js +1 -0
  72. package/share/web/dist/assets/linear-z8LqGvHi.js +1 -0
  73. package/share/web/dist/assets/mindmap-definition-RKZ34NQL-DshJGF7V.js +96 -0
  74. package/share/web/dist/assets/ordinal-Cboi1Yqb.js +1 -0
  75. package/share/web/dist/assets/pieDiagram-4H26LBE5-MKBdIMr0.js +30 -0
  76. package/share/web/dist/assets/quadrantDiagram-W4KKPZXB-Rc8VkAHd.js +7 -0
  77. package/share/web/dist/assets/requirementDiagram-4Y6WPE33-DIvF0TEG.js +84 -0
  78. package/share/web/dist/assets/sankeyDiagram-5OEKKPKP-FTZOsw4G.js +40 -0
  79. package/share/web/dist/assets/sequenceDiagram-3UESZ5HK-BXnFdz67.js +162 -0
  80. package/share/web/dist/assets/stateDiagram-AJRCARHV-N_DEea7F.js +1 -0
  81. package/share/web/dist/assets/stateDiagram-v2-BHNVJYJU-9RyR03R8.js +1 -0
  82. package/share/web/dist/assets/timeline-definition-PNZ67QCA-nelw3asj.js +120 -0
  83. package/share/web/dist/assets/vennDiagram-CIIHVFJN-BkfB2ea3.js +34 -0
  84. package/share/web/dist/assets/wardley-L42UT6IY-ChtTMLrY.js +161 -0
  85. package/share/web/dist/assets/wardleyDiagram-YWT4CUSO-CEsObJvL.js +78 -0
  86. package/share/web/dist/assets/xychartDiagram-2RQKCTM6-DNog7YuY.js +7 -0
  87. package/share/web/dist/index.html +13 -0
package/.env.example ADDED
@@ -0,0 +1,106 @@
1
+ # ============================================
2
+ # AggRoot Node.js AI Assistant - Environment Configuration
3
+ # ============================================
4
+ # This is a template file. Copy to .env and fill in your actual values.
5
+ # Never commit .env file to version control.
6
+ #
7
+ # NOTE: Non-model parameters are now configured in settings.json.
8
+ # Run `aggroot` once to generate ~/.aggroot/settings.json with all options.
9
+ # See ~/.aggroot/settings.json for shell, browser, session, security, etc. settings.
10
+
11
+ # Application Environment
12
+ # ----------------------
13
+ NODE_ENV=development
14
+
15
+ # AggRoot Home Directory (optional)
16
+ # ------------------------------
17
+ # Override the default ~/.aggroot data directory.
18
+ # Default: ~/.aggroot
19
+ # AGGROOT_HOME=
20
+
21
+ # Logging Configuration
22
+ # ---------------------
23
+ LOG_LEVEL=info
24
+
25
+ # AI Provider Configuration
26
+ # -------------------------
27
+ # DeepSeek API (default provider)
28
+ DEEPSEEK_API_KEY=your_deepseek_api_key_here
29
+ DEEPSEEK_BASE_URL=https://api.deepseek.com
30
+
31
+ # OpenAI API (alternative provider)
32
+ OPENAI_API_KEY=your_openai_api_key_here
33
+ OPENAI_BASE_URL=https://api.openai.com/v1
34
+
35
+ # Honcho External Memory (optional)
36
+ # -------------------------------
37
+ # Enable Honcho as the external memory provider.
38
+ # Get your API key at https://app.honcho.dev
39
+ # After installing the SDK: npm install @honcho-ai/sdk
40
+ HONCHO_API_KEY=your_honcho_api_key_here
41
+ #HONCHO_BASE_URL=https://api.honcho.dev
42
+ #HONCHO_WORKSPACE_ID=default
43
+
44
+ # ZhipuGLM API (智谱 AI)
45
+ ZHIPU_API_KEY=your_zhipu_api_key_here
46
+ ZHIPU_BASE_URL=https://open.bigmodel.cn/api/paas/v4
47
+
48
+ # Kimi API (Moonshot AI)
49
+ KIMI_API_KEY=your_kimi_api_key_here
50
+ KIMI_BASE_URL=https://api.moonshot.cn/v1
51
+
52
+ # MiMo API (Xiaomi MiMo AI)
53
+ MIMO_API_KEY=your_mimo_api_key_here
54
+ MIMO_BASE_URL=https://api.xiaomimimo.com/v1
55
+
56
+ # Ollama (Local Models)
57
+ OLLAMA_BASE_URL=http://localhost:11434
58
+ OLLAMA_MODEL_NAME=llama3.2
59
+ OLLAMA_CONTEXT_LENGTH=4096
60
+
61
+ # Claude API (via OpenAI-compatible endpoint)
62
+ CLAUDE_API_KEY=your_claude_api_key_here
63
+ CLAUDE_BASE_URL=https://api.anthropic.com/v1
64
+
65
+ # MiniMax API
66
+ MINIMAX_API_KEY=your_minimax_api_key_here
67
+ MINIMAX_BASE_URL=https://api.minimaxi.com/v1
68
+
69
+ # NVIDIA NIM API (OpenAI-compatible)
70
+ NVIDIA_API_KEY=your_nvidia_api_key_here
71
+ NVIDIA_BASE_URL=https://integrate.api.nvidia.com/v1
72
+ # Per-model API keys (optional, override NVIDIA_API_KEY for specific models)
73
+ # Format: NVIDIA_API_KEY_{MODEL_ID} where MODEL_ID is uppercased with / . replaced by _
74
+ # Examples:
75
+ # NVIDIA_API_KEY_Z_AI_GLM_51=nvapi-xxxx
76
+ # NVIDIA_API_KEY_DEEPSEEK_AI_DEEPSEEK_R1=nvapi-xxxx
77
+
78
+ # Vision Service (Image Understanding)
79
+ # ------------------------------------
80
+ # Enable vision service for image analysis (true/false)
81
+ VISION_ENABLED=false
82
+
83
+ # Vision API endpoint (OpenAI-compatible)
84
+ # SiliconFlow: https://api.siliconflow.cn/v1
85
+ # DashScope: https://dashscope.aliyuncs.com/compatible-mode/v1
86
+ # vLLM local: http://localhost:6000/v1
87
+ VISION_ENDPOINT=
88
+
89
+ # Vision API key
90
+ VISION_API_KEY=
91
+
92
+ # Vision model name
93
+ VISION_MODEL=Qwen/Qwen3-VL-8B-Instruct
94
+
95
+ # Node.js Runtime
96
+ # ----------------
97
+ NODE_OPTIONS=--max-old-space-size=4096
98
+
99
+ # ============================================
100
+ # Notes:
101
+ # 1. Copy this file to .env and fill in your actual values
102
+ # 2. Never commit .env file to version control
103
+ # 3. Required variables: DEEPSEEK_API_KEY or OPENAI_API_KEY
104
+ # 4. For non-model settings (shell, browser, session, etc.),
105
+ # edit ~/.aggroot/settings.json instead
106
+ # ============================================
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 AggRoot
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,496 @@
1
+ # AggRoot - AI Coding Assistant
2
+
3
+ A powerful, extensible AI coding assistant built with Node.js and TypeScript. It provides file operations, web search, code execution, Git integration, and more through a modern DDD + plugin architecture.
4
+
5
+ [![Node.js Version](https://img.shields.io/badge/node-%3E%3D20.0.0-brightgreen)](https://nodejs.org/)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
7
+
8
+ **[中文文档](README_CN.md)**
9
+
10
+ ## Table of Contents
11
+
12
+ - [Core Features](#core-features)
13
+ - [CLI Interface](#cli-interface)
14
+ - [Quick Start](#quick-start)
15
+ - [Configuration](#configuration)
16
+ - [Usage](#usage)
17
+ - [Available Tools](#available-tools)
18
+ - [Skills System](#skills-system)
19
+ - [MCP Integration](#mcp-integration)
20
+ - [Agent System](#agent-system)
21
+ - [Memory Management](#memory-management)
22
+ - [Cross-Platform Support](#cross-platform-support)
23
+ - [Changelog](#changelog)
24
+ - [License](#license)
25
+
26
+ ## Core Features
27
+
28
+ - **TypeScript First**: Full TypeScript support with strict type checking and modern ES modules
29
+ - **DDD + Plugin Architecture**: Clean domain-driven design with hot-pluggable plugins
30
+ - **Extensible Tool System**: 10 tool plugins providing 30+ built-in tools, easily extensible
31
+ - **Multi AI Agents**: Code agent, chat agent, and specialized sub-agents
32
+ - **Smart Memory**: Context-aware memory with auto-compression and project-level persistence
33
+ - **Advanced File Operations**: Read, Write, Edit, Glob, Grep, DirectoryTree with smart pagination and outline mode
34
+ - **Web Tools**: Web search, web fetch, and HTTP requests with automatic encoding handling
35
+ - **Code Intelligence**: Execute, validate, format, analyze, refactor, and search code symbols
36
+ - **Git Integration**: Full Git operations with cross-platform support
37
+ - **Stock Quotes**: Real-time stock quotes and market data
38
+ - **Modern CLI Interface**: Interactive terminal UI with split-screen layout and Markdown rendering
39
+ - **Skills System**: Reusable skill templates (explain, refactor, test, debug, and more)
40
+ - **MCP Integration**: Model Context Protocol for external tool integration
41
+ - **Security Controls**: Built-in risk control, safe command execution, and dangerous command interception
42
+ - **Cross-Platform**: Seamless operation on Windows, Linux, and macOS
43
+ - **Session Management**: Multi-session support with history, undo, and export
44
+ - **YOLO Mode**: Toggle auto-execution mode to skip tool confirmation prompts
45
+
46
+ ## CLI Interface
47
+
48
+ AggRoot provides a modern terminal UI with a split-screen layout:
49
+
50
+ ```
51
+ ┌──────────────────────────────────────────────────────────────┐
52
+ │ │
53
+ │ Output Area │
54
+ │ (scrollable conversation history) │
55
+ │ (Markdown rendering support) │
56
+ │ │
57
+ ├──────────────────────────────────────────────────────────────┤ ← top separator
58
+ │ Agent> _ │ ← input line
59
+ ├──────────────────────────────────────────────────────────────┤ ← bottom separator
60
+ │ deepseek-chat | Token: 1234/5678 | Mode: coding │ ← status bar
61
+ └──────────────────────────────────────────────────────────────┘
62
+ ```
63
+
64
+ ### CLI Features
65
+
66
+ - **Split-Screen Layout**: Clear separation between output and input areas
67
+ - **Visual Separators**: Double-line separators clearly mark the input area
68
+ - **Status Bar**: Shows current model, token usage, and working mode
69
+ - **Thinking Animation**: Animated status display during AI processing
70
+ - **Raw Mode Input**: Full keyboard support including arrow keys and history navigation
71
+ - **Quick Menus**:
72
+ - Press `/` to view commands
73
+ - Press `$` to select a model
74
+ - Press `#` to select an agent
75
+ - Press `@` to insert a file reference
76
+ - **Markdown Rendering**: Rich text formatting for AI responses
77
+
78
+ ### CLI Commands
79
+
80
+ | Command | Alias | Description |
81
+ |---------|-------|-------------|
82
+ | `/help` | `/h`, `/?` | Show help information |
83
+ | `/model <id>` | — | Switch AI model |
84
+ | `/agents` | — | List all available agents |
85
+ | `/switch [n]` | — | Switch session (by number) |
86
+ | `/reset` | — | Reset current session |
87
+ | `/sessions` | — | List all sessions |
88
+ | `/undo [path]` | — | Undo file changes |
89
+ | `/memory` | — | Manage project memory (list/add/delete/search) |
90
+ | `/init` | — | Generate AGGROOT.md project documentation |
91
+ | `/yolo` | — | Toggle auto-execution mode (skip confirmations) |
92
+ | `/export [format]` | — | Export conversation |
93
+ | `/config` | — | Show current configuration |
94
+ | `/history` | — | Show command history |
95
+ | `/clear` | `/cls` | Clear screen |
96
+ | `/exit` | `/quit`, `/q` | Exit program |
97
+
98
+ ## Quick Start
99
+
100
+ ### Prerequisites
101
+
102
+ - **Node.js** >= 20.0.0
103
+ - AI provider API key (DeepSeek, OpenAI, etc.)
104
+
105
+ ### Installation
106
+
107
+ ```bash
108
+ # Install globally via npm
109
+ npm install -g aggroot
110
+
111
+ # Run the assistant (CLI mode)
112
+ aggroot
113
+ ```
114
+
115
+ ### Web Gateway Mode
116
+
117
+ Start the web gateway server with built-in frontend:
118
+
119
+ ```bash
120
+ # Start gateway (serves frontend + API on port 8642)
121
+ aggroot gateway
122
+
123
+ # Custom port and host
124
+ aggroot gateway --port 8080 --host 0.0.0.0
125
+
126
+ # Disable frontend static serving (API only)
127
+ aggroot gateway --no-static
128
+
129
+ # Custom static directory
130
+ aggroot gateway --static-dir /path/to/frontend/dist
131
+ ```
132
+
133
+ | Endpoint | Description |
134
+ |----------|-------------|
135
+ | `http://localhost:8642` | Web frontend (SPA) |
136
+ | `http://localhost:8642/health` | Health check |
137
+ | `http://localhost:8642/v1/chat/completions` | OpenAI-compatible chat API |
138
+ | `http://localhost:8642/v1/models` | Available models |
139
+ | `ws://localhost:8642/ws` | WebSocket chat |
140
+
141
+ ## Configuration
142
+
143
+ ### Environment Variables
144
+
145
+ Create a `.env` file in your project directory or set environment variables directly:
146
+
147
+ ```env
148
+ # === AI Providers (at least one required) ===
149
+ DEEPSEEK_API_KEY=your_deepseek_api_key # DeepSeek (default provider)
150
+ OPENAI_API_KEY=your_openai_api_key # OpenAI GPT
151
+ CLAUDE_API_KEY=your_claude_api_key # Anthropic Claude
152
+ ZHIPU_API_KEY=your_zhipu_api_key # Zhipu AI
153
+ KIMI_API_KEY=your_kimi_api_key # Kimi (Moonshot)
154
+ MINIMAX_API_KEY=your_minimax_api_key # MiniMax
155
+
156
+ # === Ollama (Local Models) ===
157
+ OLLAMA_BASE_URL=http://localhost:11434
158
+ OLLAMA_MODEL_NAME=llama3.2
159
+
160
+ # === Shell Configuration ===
161
+ DEFAULT_SHELL=auto # auto | powershell | cmd | bash | nushell | wsl
162
+ SHELL_TIMEOUT=30000 # Shell command timeout (ms)
163
+ CODE_EXECUTION_TIMEOUT=30 # Code execution timeout (seconds)
164
+
165
+ # === Session Management ===
166
+ MAX_SESSION_HISTORY=50 # Max messages per session
167
+ SESSION_TIMEOUT=60 # Session timeout (minutes)
168
+
169
+ # === Logging ===
170
+ LOG_LEVEL=info # debug | info | warn | error | fatal
171
+
172
+ # === Security ===
173
+ SAFE_MODE=true # Enable safe mode for code execution
174
+ DANGEROUS_COMMANDS=rm -rf,format,del /f /q,shutdown,reboot
175
+ ```
176
+
177
+ > **Important:** At least one AI provider API key is required. DeepSeek is the default provider.
178
+
179
+ ## Usage
180
+
181
+ ### Interactive Mode
182
+
183
+ Start AggRoot and interact with the AI assistant:
184
+
185
+ ```bash
186
+ aggroot
187
+ ```
188
+
189
+ Then type your questions or instructions naturally:
190
+
191
+ ```
192
+ Agent> Read the README.md file and summarize it
193
+ Agent> Search for all TypeScript files in the src directory
194
+ Agent> Run the test suite and fix any failing tests
195
+ Agent> What's the current git status?
196
+ ```
197
+
198
+ ### Quick Menus
199
+
200
+ - **`$`** — Open model selection menu
201
+ - **`#`** — Open agent selection menu
202
+ - **`@`** — Insert file reference
203
+ - **`/`** — Show command list
204
+
205
+ ### YOLO Mode
206
+
207
+ Enable YOLO mode to auto-execute tools without confirmation:
208
+
209
+ ```
210
+ Agent> /yolo
211
+ ✅ YOLO mode enabled - tools will auto-execute
212
+ ```
213
+
214
+ ### Session Management
215
+
216
+ ```bash
217
+ /sessions # List all sessions
218
+ /switch 2 # Switch to session 2
219
+ /reset # Reset current session
220
+ /export markdown # Export conversation as Markdown
221
+ ```
222
+
223
+ ### Memory Management
224
+
225
+ ```bash
226
+ /memory # Show memory stats
227
+ /memory list # List all project memories
228
+ /memory add # Add a new memory
229
+ /memory search # Search memories
230
+ ```
231
+
232
+ ## Available Tools
233
+
234
+ ### Core Tools (`@aggroot/core-tools`)
235
+
236
+ **File Operations:**
237
+ | Tool | Description |
238
+ |------|-------------|
239
+ | `Read` | Read file contents with smart pagination, outline mode, and context search |
240
+ | `Write` | Create new files or overwrite existing ones |
241
+ | `Edit` | Precise file editing with diff-style replacement (minimizes token consumption) |
242
+ | `Glob` | Find files by name/path pattern (e.g., `**/*.ts`, `src/**/*.py`) |
243
+ | `Grep` | Search file contents with regex (preferred tool for finding code) |
244
+ | `DirectoryTree` | Quickly list directory tree structure with configurable depth and exclusions |
245
+
246
+ **User Interaction:**
247
+ | Tool | Description |
248
+ |------|-------------|
249
+ | `AskUser` | Ask the user questions with multi-select or free-text input |
250
+
251
+ **Planning:**
252
+ | Tool | Description |
253
+ |------|-------------|
254
+ | `EnterPlanMode` | Enter plan mode to break down complex tasks before execution |
255
+ | `ExitPlanMode` | Exit plan mode and submit the plan for approval |
256
+
257
+ ### Code Tools (`@aggroot/code-tools`)
258
+
259
+ | Tool | Description |
260
+ |------|-------------|
261
+ | `CodeExecute` | Safely execute TypeScript/JavaScript code with timeout control |
262
+ | `CodeValidate` | Validate code syntax with TypeScript compiler (real type checking) |
263
+ | `CodeFormat` | Format code with configurable indentation |
264
+ | `CodeAnalyze` | Analyze code for symbols, complexity, imports/exports, and issues |
265
+ | `CodeSearch` | Unified symbol search (definitions, references, workspace symbols) |
266
+ | `CodeRefactor` | Code refactoring operations (extract function, rename, organize imports) |
267
+
268
+ ### Git Tools (`@aggroot/git-tools`)
269
+
270
+ | Tool | Description |
271
+ |------|-------------|
272
+ | `GitStatus` | Show working tree status |
273
+ | `GitDiff` | Show differences between commits, or between commits and working tree |
274
+ | `GitLog` | Show commit logs |
275
+ | `GitBranch` | List, create, or delete branches |
276
+ | `GitShow` | Show various types of objects (commits, tags, trees, etc.) |
277
+ | `GitAdd` | Stage file contents |
278
+ | `GitCommit` | Record changes to the repository |
279
+ | `GitPush` | Push to remote repositories |
280
+ | `GitPull` | Pull from remote repositories |
281
+ | `GitCheckout` | Switch branches or restore working tree files |
282
+ | `GitRemote` | Manage remote repository sets |
283
+ | `GitStash` | Stash changes in a dirty working directory |
284
+
285
+ ### Web Tools (`@aggroot/web-tools`)
286
+
287
+ | Tool | Description |
288
+ |------|-------------|
289
+ | `WebSearch` | Search the web (with query optimization) |
290
+ | `WebFetch` | Fetch web content from URLs (auto-retry with multiple URLs) |
291
+ | `HttpRequest` | Make HTTP requests (GET, POST, PUT, DELETE, PATCH) |
292
+
293
+ ### Shell Tools (`@aggroot/shell-tools`)
294
+
295
+ | Tool | Description |
296
+ |------|-------------|
297
+ | `Shell` | Execute shell commands with security controls and timeout |
298
+
299
+ > **Important:** Prefer core tools (read/write/edit/glob/grep) for file operations over shell commands. Use Shell only for system-level operations that core tools cannot accomplish.
300
+
301
+ ### Todo Tools (`@aggroot/todo-tools`)
302
+
303
+ | Tool | Description |
304
+ |------|-------------|
305
+ | `TodoCreate` | Create a new todo item |
306
+ | `TodoList` | List all todo items |
307
+ | `TodoUpdate` | Update a todo item |
308
+ | `TodoDelete` | Delete a todo item |
309
+ | `TodoComplete` | Mark a todo item as completed |
310
+
311
+ ### Skill Tools (`@aggroot/skill-tools`)
312
+
313
+ | Tool | Description |
314
+ |------|-------------|
315
+ | `Skill` | Invoke a skill by name (reusable task template) |
316
+ | `ListSkills` | List all available skills |
317
+
318
+ ### MCP Tools (`@aggroot/mcp-tools`)
319
+
320
+ | Tool | Description |
321
+ |------|-------------|
322
+ | `MCP` | Model Context Protocol integration for connecting external tool servers |
323
+
324
+ ### Risk Control Tools (`@aggroot/risk-control-tools`)
325
+
326
+ Security and risk management tools for safe command execution and domain reputation checks.
327
+
328
+ ### Stock Tools (`@aggroot/stock-tools`)
329
+
330
+ | Tool | Description |
331
+ |------|-------------|
332
+ | `StockQuote` | Get real-time stock quotes |
333
+
334
+ ## Skills System
335
+
336
+ AggRoot includes a built-in skills system that provides reusable templates for common tasks:
337
+
338
+ **Built-in Skills:**
339
+ - `explain` — Explain code or concepts
340
+ - `refactor` — Refactor code to improve quality
341
+ - `test` — Generate test cases
342
+ - `document` — Generate documentation
343
+ - `debug` — Debug issues and errors
344
+ - `analyze` — Analyze codebase structure
345
+ - `security-check` — Security audit and vulnerability scanning
346
+ - `commit` — Generate meaningful commit messages
347
+
348
+ **Using Skills:**
349
+ ```
350
+ Agent> /explain this function
351
+ Agent> /refactor src/utils/helpers.ts
352
+ Agent> /test src/domain/agent/
353
+ ```
354
+
355
+ ## MCP Integration
356
+
357
+ AggRoot supports the **Model Context Protocol (MCP)** for integrating external tool servers:
358
+
359
+ - Connect MCP-compatible tool servers
360
+ - Dynamically discover and use external tools
361
+ - Supports **stdio**, **HTTP**, **WebSocket**, and **SSE** transport protocols
362
+ - Auto-reconnect (with exponential backoff) and health monitoring
363
+ - Configure MCP servers at project or user level
364
+
365
+ ### Configuration
366
+
367
+ MCP servers are configured via `.aggroot/mcp.json` (project-level) or `~/.aggroot/mcp.json` (user-global):
368
+
369
+ ```json
370
+ {
371
+ "servers": [
372
+ {
373
+ "name": "powerpoint-server",
374
+ "transport": {
375
+ "type": "stdio",
376
+ "command": "uvx",
377
+ "args": ["--from", "office-powerpoint-mcp-server", "ppt_mcp_server"]
378
+ },
379
+ "enabled": true
380
+ },
381
+ {
382
+ "name": "word-document-server",
383
+ "transport": {
384
+ "type": "stdio",
385
+ "command": "uvx",
386
+ "args": ["--from", "office-word-mcp-server", "word_mcp_server"]
387
+ },
388
+ "enabled": true
389
+ }
390
+ ],
391
+ "settings": {
392
+ "defaultTimeout": 30000,
393
+ "autoReconnect": true
394
+ }
395
+ }
396
+ ```
397
+
398
+ ### Pre-configured MCP Servers
399
+
400
+ | Server | Package | Description |
401
+ |--------|---------|-------------|
402
+ | `powerpoint-server` | `office-powerpoint-mcp-server` | Create, edit, and manipulate PowerPoint presentations (34 tools: charts, shapes, tables, gradients, etc.) |
403
+ | `word-document-server` | `office-word-mcp-server` | Create, read, and manipulate Word documents (42 tools: paragraphs, tables, images, formatting, etc.) |
404
+
405
+ ### Installing MCP Servers
406
+
407
+ ```bash
408
+ # Option 1: Use uvx (recommended — no global install needed, requires uv/uvx)
409
+ # Already configured in mcp.json, just ensure uv/uvx is installed
410
+
411
+ # Option 2: Global pip install
412
+ pip install office-powerpoint-mcp-server office-word-mcp-server
413
+ ```
414
+
415
+ > **Note:** The `name` in the config determines the tool prefix. For example, `powerpoint-server` generates tools like `mcp_powerpoint-server_create_presentation`.
416
+
417
+ ## Agent System
418
+
419
+ AggRoot features a powerful **agent** system with multiple specialized agents for different tasks:
420
+
421
+ ### Built-in Agents
422
+
423
+ | Agent | Name | Description |
424
+ |-------|------|-------------|
425
+ | Code Agent | Code Deity | Professional coding assistant — directive refactoring, code generation, multi-file collaboration with sub-agent support |
426
+ | Content Agent | Content Creator | Content creation assistant — articles, copywriting, professional PPT presentations and Word documents (via MCP) |
427
+ | Resume Agent | Resume Optimizer | Resume optimization expert — diagnostics, STAR rewriting, keyword analysis, Word document formatting (via MCP) |
428
+ | Companion Agent | Xiao Ai | Warm and caring virtual companion — cute and friendly, supports web search and file operations |
429
+ | Lei Jun Assistant | Lei Jun Classmate | Lei Jun-style assistant — investment insights, stock analysis, business strategy |
430
+ | Investment Agent | Investment Master | Investment analysis expert — data-driven stock analysis (A-shares and HK stocks), quotes/financials/technical/news |
431
+ | Ops Agent | Ops Master | System operations expert — system administration, environment management, deployment |
432
+ | Risk Control Agent | Risk Detective | Risk detective — payment fraud detection, phishing detection, domain reputation, security scanning |
433
+
434
+ ### Sub-Agent System
435
+
436
+ The Code Agent can delegate tasks to specialized sub-agents:
437
+
438
+ - **Explore Agent**: Quick read-only codebase exploration with parallel tool calls
439
+ - **Plan Agent**: Plan and design tasks
440
+ - **Code Reviewer Agent**: Code review and quality analysis
441
+ - **General Purpose Agent**: Complex multi-step tasks
442
+
443
+ Sub-agents run autonomously and return complete output, enabling efficient task decomposition and parallel execution.
444
+
445
+ ## Memory Management
446
+
447
+ AggRoot includes an intelligent memory system:
448
+
449
+ - **Context-Aware Memory**: Automatically tracks conversation context with auto-compression when needed
450
+ - **Project Memory**: Cross-session persistent project-level memory
451
+ - **Memory Commands**: `/memory list`, `/memory add`, `/memory delete`, `/memory search`
452
+ - **Auto-Compression**: Intelligently summarizes old conversations to stay within token limits
453
+ - **File Tracking**: Tracks file changes during conversations with undo support
454
+
455
+ ## Cross-Platform Support
456
+
457
+ AggRoot is designed to work seamlessly across all major operating systems:
458
+
459
+ | Platform | Architecture | Shell Support | Notes |
460
+ |----------|-------------|---------------|-------|
461
+ | **Windows** | x64, arm64 | PowerShell, CMD, Git Bash, Nushell, WSL | Auto encoding detection (GBK/UTF-8) |
462
+ | **Linux** | x64, arm64 | Bash, Zsh, Fish | — |
463
+ | **macOS** | x64, arm64 (Apple Silicon) | Zsh, Bash | Native Apple Silicon support |
464
+
465
+ ### Platform Compatibility
466
+
467
+ | Feature | Windows | Linux | macOS |
468
+ |---------|---------|-------|-------|
469
+ | File Operations | ✅ | ✅ | ✅ |
470
+ | Shell Commands | ✅ (Git Bash / Nushell / PowerShell) | ✅ | ✅ |
471
+ | Web Tools | ✅ | ✅ | ✅ |
472
+ | Git Integration | ✅ | ✅ | ✅ |
473
+ | Encoding Support | ✅ (GBK/UTF-8) | ✅ (UTF-8) | ✅ (UTF-8) |
474
+
475
+ ## Changelog
476
+
477
+ ### v1.4.2
478
+
479
+ - **Menu Selection Echo Fix**: Commands selected from the quick menu (via `/`, `$`, `#`) now correctly display the echo line (e.g., `Code Deity ❯ /help`) just like manually typed commands
480
+ - **`/clear` Command Fix**: Eliminated excessive blank lines when executing `/clear` — now properly clears the visible area without affecting scrollback history
481
+ - **Multi-Step Output Fix**: Fixed blank line issues in multi-step output commands (e.g., `/upgrade`) where the echo line was being overwritten by subsequent output
482
+ - **Split-Screen Rendering Improvements**: Refactored `addOutput()` to correctly handle the transition from input echo to AI output, preventing text overlap and cursor positioning errors
483
+
484
+ ### v1.3.4
485
+
486
+ - **Nushell Shell Support**: Added Nushell (`nu`) as a supported shell on Windows, with automatic detection via common install paths and PATH lookup
487
+ - **Updated Shell Priority**: Default shell priority on Windows is now Git Bash > Nushell > PowerShell
488
+ - **Smart Shell Syntax**: System prompt now generates shell syntax compatible with the detected default shell instead of always assuming Git Bash
489
+ - **Bug Fixes**:
490
+ - Read tool auto-corrects `../` relative paths via searchFilePath fallback
491
+ - SubAgent robust summary round with tool result fallback when no output
492
+ - Glob tool description clarifies it matches files only, not directories
493
+
494
+ ## License
495
+
496
+ This project is licensed under the MIT License — see the [LICENSE](LICENSE) file for details.
package/dist/cli.cjs ADDED
@@ -0,0 +1,26 @@
1
+ #!/usr/bin/env node
2
+ // AggRoot CLI wrapper - ensures Node.js heap is large enough for long sessions.
3
+ const v8 = require('node:v8');
4
+ const path = require('node:path');
5
+ const { spawn } = require('node:child_process');
6
+ const heapLimitMB = Math.round(v8.getHeapStatistics().heap_size_limit / 1024 / 1024);
7
+
8
+ if (heapLimitMB < 3500 && !process.env.AGGROOT_SPAWNED) {
9
+ // Re-spawn with larger heap, inheriting stdio for seamless UX
10
+ const child = spawn(process.execPath, [
11
+ '--max-old-space-size=4096',
12
+ '--no-warnings',
13
+ path.resolve(__dirname, 'index.cjs'),
14
+ ...process.argv.slice(2),
15
+ ], {
16
+ stdio: 'inherit',
17
+ env: { ...process.env, AGGROOT_SPAWNED: '1' },
18
+ });
19
+ child.on('error', (err) => {
20
+ console.error('Failed to re-spawn with larger heap:', err.message);
21
+ process.exit(1);
22
+ });
23
+ child.on('exit', (code) => process.exit(code ?? 0));
24
+ } else {
25
+ require('./index.cjs');
26
+ }