aggroot 1.0.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/.env.example ADDED
@@ -0,0 +1,173 @@
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
+ # Application Environment
8
+ # ----------------------
9
+ # Options: development, production, test
10
+ NODE_ENV=development
11
+
12
+ # AggRoot Home Directory (optional)
13
+ # ------------------------------
14
+ # Override the default ~/.aggroot data directory.
15
+ # Useful for running multiple isolated instances:
16
+ # AGGROOT_HOME=~/.aggroot-project-a aggroot -d /path/to/project-a
17
+ # AGGROOT_HOME=~/.aggroot-project-b aggroot -d /path/to/project-b
18
+ # Default: ~/.aggroot
19
+ # AGGROOT_HOME=
20
+
21
+ # Logging Configuration
22
+ # ---------------------
23
+ # Log level: debug, info, warn, error, fatal
24
+ LOG_LEVEL=info
25
+
26
+ # AI Provider Configuration
27
+ # -------------------------
28
+ # DeepSeek API (default provider)
29
+ DEEPSEEK_API_KEY=your_deepseek_api_key_here
30
+ DEEPSEEK_BASE_URL=https://api.deepseek.com
31
+
32
+ # OpenAI API (alternative provider)
33
+ OPENAI_API_KEY=your_openai_api_key_here
34
+ OPENAI_BASE_URL=https://api.openai.com/v1
35
+
36
+ # ZhipuGLM API (智谱 AI)
37
+ ZHIPU_API_KEY=your_zhipu_api_key_here
38
+ ZHIPU_BASE_URL=https://open.bigmodel.cn/api/paas/v4
39
+
40
+ # Kimi API (Moonshot AI)
41
+ KIMI_API_KEY=your_kimi_api_key_here
42
+ KIMI_BASE_URL=https://api.moonshot.cn/v1
43
+
44
+ # Ollama (Local Models)
45
+ OLLAMA_BASE_URL=http://localhost:11434
46
+ OLLAMA_MODEL_NAME=llama3.2
47
+ OLLAMA_CONTEXT_LENGTH=4096
48
+
49
+ # Claude API (via OpenAI-compatible endpoint)
50
+ CLAUDE_API_KEY=your_claude_api_key_here
51
+ CLAUDE_BASE_URL=https://api.anthropic.com/v1
52
+
53
+ # MiniMax API
54
+ MINIMAX_API_KEY=your_minimax_api_key_here
55
+ MINIMAX_BASE_URL=https://api.minimaxi.com/v1
56
+
57
+ # NVIDIA NIM API (OpenAI-compatible)
58
+ NVIDIA_API_KEY=your_nvidia_api_key_here
59
+ NVIDIA_BASE_URL=https://integrate.api.nvidia.com/v1
60
+ # Per-model API keys (optional, override NVIDIA_API_KEY for specific models)
61
+ # Format: NVIDIA_API_KEY_{MODEL_ID} where MODEL_ID is uppercased with / . replaced by _
62
+ # Examples:
63
+ # NVIDIA_API_KEY_Z_AI_GLM_51=nvapi-xxxx
64
+ # NVIDIA_API_KEY_DEEPSEEK_AI_DEEPSEEK_R1=nvapi-xxxx
65
+ # NVIDIA_API_KEY_META_LLAMA_3_3_70B_INSTRUCT=nvapi-xxxx
66
+ # NVIDIA_API_KEY_NVIDIA_LLAMA_3_1_NEMOTRON_70B_INSTRUCT=nvapi-xxxx
67
+ # NVIDIA_API_KEY_QWEN_QWEN25_72B_INSTRUCT=nvapi-xxxx
68
+ # NVIDIA_API_KEY_QWEN_QWEN25_CODER_32B_INSTRUCT=nvapi-xxxx
69
+ # Per-model base URLs (optional, override NVIDIA_BASE_URL)
70
+ # NVIDIA_BASE_URL_QWEN_QWEN25_CODER_32B_INSTRUCT=https://integrate.api.nvidia.com/v1
71
+
72
+
73
+ # Shell Configuration
74
+ # -------------------
75
+ # Default shell for command execution
76
+ # Options: auto (platform default), powershell, cmd, bash, nushell, wsl
77
+ # auto: uses powershell on Windows, bash on Linux/Mac
78
+ DEFAULT_SHELL=nushell
79
+
80
+ # Execution Timeouts
81
+ # ------------------
82
+ # Maximum execution time for shell commands (milliseconds)
83
+ SHELL_TIMEOUT=30000
84
+
85
+ # Maximum execution time for code execution (seconds)
86
+ CODE_EXECUTION_TIMEOUT=30
87
+
88
+ # Web Tools Configuration
89
+ # -----------------------
90
+ # Browser type for web automation: chromium, firefox, webkit
91
+ BROWSER_TYPE=chromium
92
+
93
+ # Headless mode for browser (true/false)
94
+ BROWSER_HEADLESS=true
95
+
96
+ # Domain Reputation Check APIs
97
+ # ----------------------------
98
+ # Google Safe Browsing API Key (https://console.cloud.google.com/apis/api/safebrowsing.googleapis.com)
99
+ GOOGLE_SAFE_BROWSING_API_KEY=
100
+
101
+ # VirusTotal API Key (https://www.virustotal.com/gui/my-apikey)
102
+ VIRUSTOTAL_API_KEY=
103
+
104
+ # PhishTank API Key (optional, https://www.phishtank.com/developer_info.php)
105
+ PHISHTANK_API_KEY=
106
+
107
+ # OWASP ZAP Configuration
108
+ # -----------------------
109
+ # ZAP API URL (default: http://localhost:8080)
110
+ ZAP_API_URL=http://localhost:8080
111
+
112
+ # ZAP API Key (if configured)
113
+ ZAP_API_KEY=
114
+
115
+ # Session Management
116
+ # ------------------
117
+ # Maximum session history to keep (number of messages)
118
+ MAX_SESSION_HISTORY=50
119
+
120
+ # Session timeout (minutes)
121
+ SESSION_TIMEOUT=60
122
+
123
+ # File Operations
124
+ # ---------------
125
+ # Maximum file size to read (bytes)
126
+ MAX_FILE_SIZE=10485760 # 10MB
127
+
128
+ # Allowed file extensions for code execution
129
+ ALLOWED_FILE_EXTENSIONS=.js,.ts,.py,.json,.txt,.md
130
+
131
+ # Security Settings
132
+ # -----------------
133
+ # Enable safe mode for code execution (true/false)
134
+ SAFE_MODE=true
135
+
136
+ NODE_OPTIONS=--max-old-space-size=4096
137
+
138
+ # List of dangerous commands to block
139
+ DANGEROUS_COMMANDS=rm -rf,format,del /f /q,shutdown,reboot
140
+
141
+ # Development Settings
142
+ # --------------------
143
+ # Enable debug mode for verbose output
144
+ DEBUG=false
145
+
146
+ AGGROOT_UI="ink-custom"
147
+
148
+ # Enable experimental features
149
+ EXPERIMENTAL_FEATURES=false
150
+
151
+ # Vision Service (Image Understanding)
152
+ # ------------------------------------
153
+ # Enable vision service for image analysis (true/false)
154
+ VISION_ENABLED=false
155
+
156
+ # Vision API endpoint (OpenAI-compatible)
157
+ # SiliconFlow: https://api.siliconflow.cn/v1
158
+ # DashScope: https://dashscope.aliyuncs.com/compatible-mode/v1
159
+ # vLLM local: http://localhost:6000/v1
160
+ VISION_ENDPOINT=
161
+
162
+ # Vision API key
163
+ VISION_API_KEY=
164
+
165
+ # Vision model name
166
+ VISION_MODEL=Qwen/Qwen3-VL-8B-Instruct
167
+
168
+ # ============================================
169
+ # Notes:
170
+ # 1. Copy this file to .env and fill in your actual values
171
+ # 2. Never commit .env file to version control
172
+ # 3. Required variables: DEEPSEEK_API_KEY or OPENAI_API_KEY
173
+ # ============================================
package/README.md ADDED
@@ -0,0 +1,43 @@
1
+ # AggRoot - AI Coding Assistant
2
+
3
+ A powerful, extensible AI coding assistant built with Node.js and TypeScript.
4
+
5
+ ## Features
6
+
7
+ - **Multi-Model Support** - DeepSeek, OpenAI GPT, Claude, Ollama, Qwen, Kimi, and more
8
+ - **Intelligent Code Tools** - Read, Write, Edit, Grep, Glob with syntax-aware processing
9
+ - **Shell Execution** - Run commands with cross-platform support (Bash, PowerShell, NuShell)
10
+ - **Sub-Agent System** - Delegate tasks to specialized agents (explore, plan, code-review)
11
+ - **Document Reading** - Word (.docx), PowerPoint (.pptx), Excel (.xlsx), images, PDFs
12
+ - **Git Integration** - Status, diff, log, blame, and more
13
+ - **Web Tools** - Search and fetch web content
14
+ - **MCP Protocol** - Connect external tools via Model Context Protocol
15
+ - **Plugin Architecture** - Hot-pluggable DDD-based plugin system
16
+
17
+ ## Quick Start
18
+
19
+ ```bash
20
+ # Install globally
21
+ npm install -g aggroot-node
22
+
23
+ # Run
24
+ aggroot
25
+ ```
26
+
27
+ ## Configuration
28
+
29
+ Create a `.env` file in your project directory:
30
+
31
+ ```env
32
+ DEEPSEEK_API_KEY=your-api-key
33
+ # or
34
+ OPENAI_API_KEY=your-api-key
35
+ ```
36
+
37
+ ## Requirements
38
+
39
+ - Node.js >= 20.0.0
40
+
41
+ ## License
42
+
43
+ MIT
package/dist/cli.cjs ADDED
@@ -0,0 +1,22 @@
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('exit', (code) => process.exit(code ?? 0));
20
+ } else {
21
+ require('./index.cjs');
22
+ }