@defai.digital/automatosx 5.8.4 โ†’ 5.8.6

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/CHANGELOG.md CHANGED
@@ -2,6 +2,244 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ## [5.8.6] - 2025-10-29
6
+
7
+ ### โœจ Features & Enhancements
8
+
9
+ **Provider Integration Improvements** - Comprehensive security, performance, and feature enhancements for Claude Code and Gemini CLI providers
10
+
11
+ #### Security Enhancements ๐Ÿ”’
12
+ 1. **Conditional Shell Usage** (Claude & Gemini)
13
+ - Changed from `shell: true` everywhere to conditional usage only for Windows .cmd/.bat files
14
+ - Prevents shell injection vulnerabilities
15
+ - Cross-platform safe execution
16
+
17
+ 2. **Environment Variable Filtering** (Claude & Gemini)
18
+ - Implemented whitelist-based environment filtering
19
+ - Only passes essential variables: PATH, HOME, USER, SHELL, TMPDIR, provider-specific vars
20
+ - Prevents secret/token leakage to subprocesses
21
+
22
+ 3. **Structured Error Handling** (Claude & Gemini)
23
+ - Replaced generic `Error` throws with `ProviderError` throughout
24
+ - Consistent error classification: executionError, timeout, rateLimit
25
+ - Improved retry logic and error diagnostics
26
+
27
+ #### Performance Improvements โšก
28
+ 1. **Import Hoisting** (Claude & Gemini)
29
+ - Moved `spawn`, `processManager`, `platform` imports to module scope
30
+ - Eliminates 10-20ms per-request overhead from dynamic imports
31
+ - Faster provider initialization
32
+
33
+ 2. **Token Count Caching** (Claude & Gemini)
34
+ - Cache calculated token counts in variables
35
+ - Reduces redundant `estimateTokens()` calls (3x reduction)
36
+ - Improved latency tracking
37
+
38
+ 3. **Structured Telemetry** (Claude & Gemini)
39
+ - Added debug-level logging with metrics: latency, tokens, provider, model
40
+ - Enables performance monitoring and troubleshooting
41
+ - Production-ready observability
42
+
43
+ #### Streaming Support ๐Ÿš€
44
+ 1. **Claude Code Progressive Streaming** (NEW)
45
+ - Implemented `executeStreaming()` method with progressive stdout parsing
46
+ - Added `onToken` callback for real-time chunk delivery
47
+ - Added `onProgress` callback for completion estimation
48
+ - Modified `executeCLI()` to accept streamingOptions parameter
49
+ - `supportsStreaming()` now returns `true` (previously unsupported)
50
+
51
+ 2. **Gemini CLI Progressive Streaming** (NEW)
52
+ - Implemented `executeStreaming()` method with progressive stdout parsing
53
+ - Same callback interface as Claude for consistency
54
+ - Real-time progress tracking
55
+ - `supportsStreaming()` now returns `true` (previously unsupported)
56
+
57
+ #### Configuration Flexibility ๐ŸŽ›๏ธ
58
+ 1. **Claude Code Configuration**
59
+ - Added `claude` config section in `automatosx.config.json`
60
+ - Configurable `allowedTools`: customize tool whitelist (default: Read, Write, Edit, Bash, Glob, Grep)
61
+ - Configurable `allowedDirs`: specify working directories (default: ["."])
62
+ - Configurable `printMode`: control --print flag (default: true)
63
+ - Context-based overrides: `request.context` can override config defaults
64
+
65
+ 2. **Gemini CLI Configuration**
66
+ - Enhanced `gemini` config section
67
+ - Configurable `approvalMode`: auto, always, never (default: auto_edit)
68
+ - Context-based overrides for approval mode
69
+
70
+ 3. **Doctor Command for Gemini** (`ax gemini doctor` - NEW)
71
+ - CLI installation check (using `which gemini`)
72
+ - Version detection
73
+ - Configuration validation
74
+ - MCP registration check (user vs system)
75
+ - Colorized diagnostic output
76
+ - `--fix` option for auto-repair (future enhancement)
77
+
78
+ #### Changes Made
79
+
80
+ **New Files:**
81
+ - None (all changes in existing files)
82
+
83
+ **Modified Files:**
84
+ 1. `src/providers/claude-provider.ts`
85
+ - Hoisted imports (spawn, processManager, platform)
86
+ - Implemented `filterEnvironment()` method
87
+ - Implemented `executeStreaming()` method
88
+ - Enhanced `buildCLIArgs()` with configuration support
89
+ - Added streaming callbacks in stdout handler
90
+ - Structured telemetry logging
91
+
92
+ 2. `src/providers/gemini-provider.ts`
93
+ - Hoisted imports (spawn, processManager, platform)
94
+ - Implemented `filterEnvironment()` method
95
+ - Implemented `executeStreaming()` method
96
+ - Added streaming callbacks in stdout handler
97
+ - Structured telemetry logging
98
+
99
+ 3. `automatosx.config.json`
100
+ - Added `claude` config section (lines 32-36)
101
+ - Enhanced `gemini` config section (lines 67-71)
102
+
103
+ 4. `src/cli/commands/gemini.ts`
104
+ - Added `doctor` subcommand with comprehensive diagnostics
105
+
106
+ 5. `tests/unit/provider-streaming.test.ts`
107
+ - Updated Claude provider tests to expect streaming support
108
+ - Updated Gemini provider tests to expect streaming support
109
+ - Changed test descriptions to reflect v5.8.6 capabilities
110
+
111
+ ### โœ… Results
112
+
113
+ **Before v5.8.6:**
114
+ - โŒ Shell injection vulnerability (shell:true everywhere)
115
+ - โŒ Environment variable leakage (all env vars passed)
116
+ - โŒ No streaming support for Claude or Gemini
117
+ - โŒ Hardcoded tool/directory configuration
118
+ - โŒ Generic error handling
119
+ - โš ๏ธ Dynamic import overhead (10-20ms)
120
+
121
+ **After v5.8.6:**
122
+ - โœ… Shell injection prevention (conditional shell usage)
123
+ - โœ… Environment filtering (whitelist-based)
124
+ - โœ… Progressive streaming for Claude and Gemini
125
+ - โœ… Flexible configuration (tools, directories, approval modes)
126
+ - โœ… Structured error handling (ProviderError)
127
+ - โœ… Performance optimization (hoisted imports, token caching)
128
+ - โœ… Structured telemetry (debug logging)
129
+ - โœ… Doctor command for Gemini diagnostics
130
+
131
+ ### ๐Ÿ“Š Statistics
132
+
133
+ - **Modified Files**: 5
134
+ - **New Commands**: 1 (ax gemini doctor)
135
+ - **Security Fixes**: 3 critical vulnerabilities addressed
136
+ - **Performance Gains**: 10-20ms per request (import hoisting)
137
+ - **Tests**: All 2197 tests passing
138
+ - **Backwards Compatibility**: โœ… Fully compatible (config is optional, falls back to defaults)
139
+
140
+ ### ๐Ÿ”„ Migration Guide
141
+
142
+ **No breaking changes.** All improvements are backwards compatible.
143
+
144
+ **Optional Configuration (Recommended):**
145
+
146
+ ```json
147
+ {
148
+ "providers": {
149
+ "claude-code": {
150
+ "claude": {
151
+ "allowedTools": ["Read", "Write", "Edit", "Bash", "Glob", "Grep"],
152
+ "allowedDirs": ["."],
153
+ "printMode": true
154
+ }
155
+ },
156
+ "gemini-cli": {
157
+ "gemini": {
158
+ "approvalMode": "auto_edit"
159
+ }
160
+ }
161
+ }
162
+ }
163
+ ```
164
+
165
+ **Enable Streaming (Optional):**
166
+
167
+ ```typescript
168
+ // Context-based streaming
169
+ const response = await provider.executeStreaming(request, {
170
+ enabled: true,
171
+ onToken: (token) => console.log(token),
172
+ onProgress: (progress) => console.log(`${Math.round(progress * 100)}%`)
173
+ });
174
+ ```
175
+
176
+ ---
177
+
178
+ ## [5.8.5] - 2025-10-29
179
+
180
+ ### ๐Ÿ› Bug Fixes
181
+
182
+ **MCP Provider Integration** - Fixed critical MCP provider name mismatch and model specification issues
183
+
184
+ #### Provider Name Mapping Fix
185
+ - **Problem**: MCP clients use simplified provider names (`'claude'`, `'gemini'`, `'openai'`) but system uses full names (`'claude-code'`, `'gemini-cli'`, `'openai'`)
186
+ - **Impact**: MCP requests with `provider: 'gemini'` failed with routing errors
187
+ - **Solution**: Created bidirectional provider name mapping utility
188
+
189
+ #### Changes Made
190
+
191
+ 1. **Created Provider Mapping Utility** (`src/mcp/utils/provider-mapping.ts` - NEW)
192
+ - `mapMcpProviderToActual()` - Maps MCP names โ†’ Internal names
193
+ - `mapActualProviderToMcp()` - Maps Internal names โ†’ MCP names
194
+ - Enables seamless translation between MCP API and internal system
195
+
196
+ 2. **Updated MCP run_agent Tool** (`src/mcp/tools/run-agent.ts`)
197
+ - Import and apply provider mapping before context creation
198
+ - Enhanced logging to show both MCP and actual provider names
199
+ - Now correctly routes `'gemini'` โ†’ `'gemini-cli'`
200
+
201
+ 3. **Updated MCP get_status Tool** (`src/mcp/tools/get-status.ts`)
202
+ - Map internal provider names to MCP names in status responses
203
+ - Returns: `['claude', 'gemini', 'openai']` instead of `['claude-code', 'gemini-cli', 'openai']`
204
+
205
+ 4. **Fixed OpenAI Model Specification** (`src/providers/openai-provider.ts`)
206
+ - Removed explicit model parameter passing to OpenAI Codex CLI
207
+ - Let CLI use its own default model to avoid version conflicts
208
+ - Added documentation explaining why model is not passed
209
+
210
+ 5. **Verified Gemini Model Handling** (`src/providers/gemini-provider.ts`)
211
+ - Confirmed Gemini CLI already correctly avoids passing model parameter
212
+ - Uses CLI's default model selection
213
+
214
+ 6. **Added Comprehensive Tests**
215
+ - Created `tests/unit/mcp/provider-mapping.test.ts` with full coverage
216
+ - Updated `tests/unit/mcp/tools/run-agent.test.ts` expectations
217
+ - Added bidirectional mapping tests and edge case handling
218
+
219
+ ### โœ… Results
220
+
221
+ **Before Fix:**
222
+ - โŒ MCP client requests with `provider: 'gemini'` failed
223
+ - โŒ Provider routing didn't work for gemini
224
+ - โŒ Models were explicitly specified causing potential conflicts
225
+
226
+ **After Fix:**
227
+ - โœ… MCP client requests with `provider: 'gemini'` work correctly
228
+ - โœ… Provider routing properly routes to 'gemini-cli'
229
+ - โœ… Status responses show simplified names
230
+ - โœ… Both Gemini and OpenAI use their optimal default models
231
+ - โœ… Full test coverage for provider mapping
232
+ - โœ… Fully backwards compatible
233
+
234
+ ### ๐Ÿ“Š Statistics
235
+
236
+ - **New Files**: 2 (provider-mapping.ts, provider-mapping.test.ts)
237
+ - **Modified Files**: 4 (run-agent.ts, get-status.ts, openai-provider.ts, run-agent.test.ts)
238
+ - **Tests**: All tests passing
239
+ - **Backwards Compatibility**: โœ… Fully compatible
240
+
241
+ ---
242
+
5
243
  ## [5.8.4] - 2025-10-28
6
244
 
7
245
  ### ๐Ÿ› Bug Fixes
package/README.md CHANGED
@@ -13,7 +13,7 @@ AutomatosX is a CLI-first orchestration tool that transforms stateless AI assist
13
13
  [![Windows](https://img.shields.io/badge/Windows-10+-blue.svg)](https://www.microsoft.com/windows)
14
14
  [![Ubuntu](https://img.shields.io/badge/Ubuntu-24.04-orange.svg)](https://ubuntu.com)
15
15
 
16
- **Status**: โœ… Production Ready ยท **v5.8.4** ยท October 2025 ยท 19 Specialized Agents ยท 100% Resource Leak Free ยท Spec-Driven Development
16
+ **Status**: โœ… Production Ready ยท **v5.8.6** ยท October 2025 ยท 19 Specialized Agents ยท 100% Resource Leak Free ยท Spec-Driven Development
17
17
 
18
18
  **Latest (v5.8.0)**: Spec-Kit Integration - AutomatosX now supports spec-driven development! Define your project specs in `.specify/` directory (spec.md, plan.md, tasks.md) and let AutomatosX automatically orchestrate tasks based on your dependency graph. Features include: DAG-based task execution, cycle detection, LRU caching, and automatic spec detection. Perfect for structured, multi-step projects. [See full changelog โ†’](CHANGELOG.md)
19
19