@defai.digital/automatosx 11.4.0 → 12.0.1
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/README.md +4 -4
- package/dist/index.js +878 -4850
- package/dist/mcp/index.js +131 -284
- package/package.json +3 -3
package/dist/mcp/index.js
CHANGED
|
@@ -40,7 +40,7 @@ var __export = (target, all) => {
|
|
|
40
40
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
41
41
|
};
|
|
42
42
|
var init_esm_shims = __esm({
|
|
43
|
-
"node_modules/tsup/assets/esm_shims.js"() {
|
|
43
|
+
"node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.6_tsx@4.20.6_typescript@5.9.3_yaml@2.8.2/node_modules/tsup/assets/esm_shims.js"() {
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
46
|
function sanitizeObject(obj, maxDepth = 5, currentDepth = 0) {
|
|
@@ -2013,7 +2013,7 @@ function isRateLimitError(error, providerName) {
|
|
|
2013
2013
|
function isLimitError(error, providerName) {
|
|
2014
2014
|
return isQuotaError(error, providerName) || isRateLimitError(error, providerName);
|
|
2015
2015
|
}
|
|
2016
|
-
var GEMINI_PATTERNS, CLAUDE_PATTERNS, OPENAI_PATTERNS,
|
|
2016
|
+
var GEMINI_PATTERNS, CLAUDE_PATTERNS, OPENAI_PATTERNS, PROVIDER_ERROR_PATTERNS, GENERIC_ERROR_PATTERNS;
|
|
2017
2017
|
var init_error_patterns = __esm({
|
|
2018
2018
|
"src/providers/error-patterns.ts"() {
|
|
2019
2019
|
init_esm_shims();
|
|
@@ -2097,64 +2097,27 @@ var init_error_patterns = __esm({
|
|
|
2097
2097
|
"billing_hard_limit_reached"
|
|
2098
2098
|
]
|
|
2099
2099
|
};
|
|
2100
|
-
AX_CLI_PATTERNS = {
|
|
2101
|
-
quota: [
|
|
2102
|
-
// GLM patterns
|
|
2103
|
-
"quota exceeded",
|
|
2104
|
-
"quota limit reached",
|
|
2105
|
-
"insufficient quota",
|
|
2106
|
-
// OpenAI patterns (via ax-cli)
|
|
2107
|
-
"insufficient_quota",
|
|
2108
|
-
"quota_exceeded",
|
|
2109
|
-
"billing hard limit reached",
|
|
2110
|
-
"usage limit exceeded",
|
|
2111
|
-
"monthly quota exceeded",
|
|
2112
|
-
"credit limit reached",
|
|
2113
|
-
// Generic patterns
|
|
2114
|
-
"daily quota exceeded",
|
|
2115
|
-
"api quota exceeded"
|
|
2116
|
-
],
|
|
2117
|
-
rateLimit: [
|
|
2118
|
-
// Common patterns
|
|
2119
|
-
"rate_limit_exceeded",
|
|
2120
|
-
"rate limit exceeded",
|
|
2121
|
-
"too_many_requests",
|
|
2122
|
-
"too many requests",
|
|
2123
|
-
"requests per minute exceeded",
|
|
2124
|
-
"tokens per minute exceeded",
|
|
2125
|
-
"rate limit reached",
|
|
2126
|
-
// Anthropic patterns (via ax-cli)
|
|
2127
|
-
"rate_limit_error",
|
|
2128
|
-
"overloaded_error",
|
|
2129
|
-
"overloaded",
|
|
2130
|
-
// xAI/Grok patterns
|
|
2131
|
-
"throttled",
|
|
2132
|
-
"request throttled"
|
|
2133
|
-
],
|
|
2134
|
-
statusCodes: [429, 529],
|
|
2135
|
-
errorCodes: [
|
|
2136
|
-
"insufficient_quota",
|
|
2137
|
-
"rate_limit_exceeded",
|
|
2138
|
-
"quota_exceeded",
|
|
2139
|
-
"rate_limit_error",
|
|
2140
|
-
"overloaded_error",
|
|
2141
|
-
"RATE_LIMIT_EXCEEDED",
|
|
2142
|
-
"QUOTA_EXCEEDED"
|
|
2143
|
-
]
|
|
2144
|
-
};
|
|
2145
2100
|
PROVIDER_ERROR_PATTERNS = {
|
|
2146
2101
|
// Primary providers
|
|
2147
2102
|
gemini: GEMINI_PATTERNS,
|
|
2148
2103
|
claude: CLAUDE_PATTERNS,
|
|
2149
2104
|
codex: OPENAI_PATTERNS,
|
|
2150
|
-
|
|
2105
|
+
// v12.0.0: Removed ax-cli (deprecated)
|
|
2106
|
+
glm: OPENAI_PATTERNS,
|
|
2107
|
+
// v12.0.0: GLM uses OpenAI-compatible API
|
|
2108
|
+
grok: OPENAI_PATTERNS,
|
|
2109
|
+
// v12.0.0: Grok uses OpenAI-compatible API
|
|
2151
2110
|
// Aliases - reference same patterns to avoid duplication
|
|
2152
2111
|
"gemini-cli": GEMINI_PATTERNS,
|
|
2153
2112
|
// Alias for gemini
|
|
2154
2113
|
"claude-code": CLAUDE_PATTERNS,
|
|
2155
2114
|
// Alias for claude
|
|
2156
|
-
"openai": OPENAI_PATTERNS
|
|
2115
|
+
"openai": OPENAI_PATTERNS,
|
|
2157
2116
|
// Alias for codex (same underlying API)
|
|
2117
|
+
"ax-glm": OPENAI_PATTERNS,
|
|
2118
|
+
// v12.0.0: Alias for glm
|
|
2119
|
+
"ax-grok": OPENAI_PATTERNS
|
|
2120
|
+
// v12.0.0: Alias for grok
|
|
2158
2121
|
};
|
|
2159
2122
|
GENERIC_ERROR_PATTERNS = {
|
|
2160
2123
|
quota: [
|
|
@@ -2195,10 +2158,11 @@ function getRetryableErrors(provider) {
|
|
|
2195
2158
|
return [...baseErrors, ...GEMINI_RETRYABLE_ERRORS];
|
|
2196
2159
|
case "openai":
|
|
2197
2160
|
return [...baseErrors, ...OPENAI_RETRYABLE_ERRORS];
|
|
2198
|
-
case "ax-cli":
|
|
2199
|
-
return [...baseErrors, ...AX_CLI_RETRYABLE_ERRORS];
|
|
2200
2161
|
case "codex":
|
|
2201
2162
|
return [...baseErrors, ...CODEX_RETRYABLE_ERRORS];
|
|
2163
|
+
case "glm":
|
|
2164
|
+
case "grok":
|
|
2165
|
+
return [...baseErrors, ...OPENAI_RETRYABLE_ERRORS];
|
|
2202
2166
|
case "base":
|
|
2203
2167
|
default:
|
|
2204
2168
|
return baseErrors;
|
|
@@ -2212,7 +2176,7 @@ function shouldRetryError(error, provider) {
|
|
|
2212
2176
|
const retryableErrors = getRetryableErrors(provider);
|
|
2213
2177
|
return containsErrorPattern(message, retryableErrors);
|
|
2214
2178
|
}
|
|
2215
|
-
var COMMON_NETWORK_ERRORS, COMMON_RATE_LIMIT_ERRORS, COMMON_SERVER_ERRORS, CLAUDE_RETRYABLE_ERRORS, GEMINI_RETRYABLE_ERRORS, OPENAI_RETRYABLE_ERRORS,
|
|
2179
|
+
var COMMON_NETWORK_ERRORS, COMMON_RATE_LIMIT_ERRORS, COMMON_SERVER_ERRORS, CLAUDE_RETRYABLE_ERRORS, GEMINI_RETRYABLE_ERRORS, OPENAI_RETRYABLE_ERRORS, CODEX_RETRYABLE_ERRORS, NON_RETRYABLE_ERRORS;
|
|
2216
2180
|
var init_retry_errors = __esm({
|
|
2217
2181
|
"src/providers/retry-errors.ts"() {
|
|
2218
2182
|
init_esm_shims();
|
|
@@ -2248,17 +2212,6 @@ var init_retry_errors = __esm({
|
|
|
2248
2212
|
OPENAI_RETRYABLE_ERRORS = [
|
|
2249
2213
|
"internal_error"
|
|
2250
2214
|
];
|
|
2251
|
-
AX_CLI_RETRYABLE_ERRORS = [
|
|
2252
|
-
// Inherited from Anthropic (via ax-cli)
|
|
2253
|
-
"overloaded_error",
|
|
2254
|
-
// Inherited from OpenAI (via ax-cli)
|
|
2255
|
-
"internal_error",
|
|
2256
|
-
// ax-cli specific
|
|
2257
|
-
"agent_error",
|
|
2258
|
-
"tool_execution_error",
|
|
2259
|
-
// xAI/Grok specific
|
|
2260
|
-
"service_overloaded"
|
|
2261
|
-
];
|
|
2262
2215
|
CODEX_RETRYABLE_ERRORS = [
|
|
2263
2216
|
...OPENAI_RETRYABLE_ERRORS,
|
|
2264
2217
|
"sandbox_error"
|
|
@@ -2291,8 +2244,7 @@ var init_base_provider = __esm({
|
|
|
2291
2244
|
/**
|
|
2292
2245
|
* Whitelist of allowed provider names for security
|
|
2293
2246
|
* v8.3.0: Support both old (claude-code, gemini-cli) and new (claude, gemini) names for backward compatibility
|
|
2294
|
-
*
|
|
2295
|
-
* v9.2.0: 'glm' is deprecated, use 'ax-cli' instead (kept for backward compatibility)
|
|
2247
|
+
* v12.0.0: Removed ax-cli (deprecated), added native 'glm' and 'grok' providers
|
|
2296
2248
|
*/
|
|
2297
2249
|
static ALLOWED_PROVIDER_NAMES = [
|
|
2298
2250
|
"claude",
|
|
@@ -2303,10 +2255,14 @@ var init_base_provider = __esm({
|
|
|
2303
2255
|
// Backward compatibility - maps to gemini CLI
|
|
2304
2256
|
"openai",
|
|
2305
2257
|
"codex",
|
|
2306
|
-
"ax-cli",
|
|
2307
|
-
// v9.2.0: Multi-model provider via ax-cli (GLM, xAI, OpenAI, Anthropic, Ollama, DeepSeek, Llama)
|
|
2308
2258
|
"glm",
|
|
2309
|
-
//
|
|
2259
|
+
// v12.0.0: Native GLM provider (Zhipu AI)
|
|
2260
|
+
"ax-glm",
|
|
2261
|
+
// v12.0.0: Alias for glm
|
|
2262
|
+
"grok",
|
|
2263
|
+
// v12.0.0: Native Grok provider (xAI)
|
|
2264
|
+
"ax-grok",
|
|
2265
|
+
// v12.0.0: Alias for grok
|
|
2310
2266
|
"test-provider"
|
|
2311
2267
|
// For unit tests
|
|
2312
2268
|
];
|
|
@@ -3042,8 +2998,10 @@ ${fullPrompt}
|
|
|
3042
2998
|
retryableProvider = "openai";
|
|
3043
2999
|
} else if (providerName === "codex") {
|
|
3044
3000
|
retryableProvider = "codex";
|
|
3045
|
-
} else if (providerName === "
|
|
3046
|
-
retryableProvider = "
|
|
3001
|
+
} else if (providerName === "glm" || providerName === "ax-glm") {
|
|
3002
|
+
retryableProvider = "glm";
|
|
3003
|
+
} else if (providerName === "grok" || providerName === "ax-grok") {
|
|
3004
|
+
retryableProvider = "grok";
|
|
3047
3005
|
}
|
|
3048
3006
|
return shouldRetryError(error, retryableProvider);
|
|
3049
3007
|
}
|
|
@@ -4036,6 +3994,9 @@ var init_openai_provider = __esm({
|
|
|
4036
3994
|
}
|
|
4037
3995
|
const startTime = Date.now();
|
|
4038
3996
|
await this.ensureInitialized();
|
|
3997
|
+
if (this.isDestroyed || !this.hybridAdapter) {
|
|
3998
|
+
throw new Error("OpenAIProvider has been destroyed or not properly initialized");
|
|
3999
|
+
}
|
|
4039
4000
|
try {
|
|
4040
4001
|
const result = await this.hybridAdapter.execute(
|
|
4041
4002
|
request.prompt,
|
|
@@ -5195,6 +5156,58 @@ var PRECOMPILED_CONFIG = {
|
|
|
5195
5156
|
"window": "daily",
|
|
5196
5157
|
"resetHourUtc": 0
|
|
5197
5158
|
}
|
|
5159
|
+
},
|
|
5160
|
+
"glm": {
|
|
5161
|
+
"enabled": true,
|
|
5162
|
+
"priority": 4,
|
|
5163
|
+
"timeout": 12e4,
|
|
5164
|
+
"command": "ax-glm",
|
|
5165
|
+
"model": "glm-4",
|
|
5166
|
+
"healthCheck": {
|
|
5167
|
+
"enabled": true,
|
|
5168
|
+
"interval": 3e5,
|
|
5169
|
+
"timeout": 5e3
|
|
5170
|
+
},
|
|
5171
|
+
"circuitBreaker": {
|
|
5172
|
+
"enabled": true,
|
|
5173
|
+
"failureThreshold": 3,
|
|
5174
|
+
"recoveryTimeout": 6e4
|
|
5175
|
+
},
|
|
5176
|
+
"processManagement": {
|
|
5177
|
+
"gracefulShutdownTimeout": 5e3,
|
|
5178
|
+
"forceKillDelay": 1e3
|
|
5179
|
+
},
|
|
5180
|
+
"versionDetection": {
|
|
5181
|
+
"timeout": 5e3,
|
|
5182
|
+
"forceKillDelay": 1e3,
|
|
5183
|
+
"cacheEnabled": true
|
|
5184
|
+
}
|
|
5185
|
+
},
|
|
5186
|
+
"grok": {
|
|
5187
|
+
"enabled": true,
|
|
5188
|
+
"priority": 5,
|
|
5189
|
+
"timeout": 12e4,
|
|
5190
|
+
"command": "ax-grok",
|
|
5191
|
+
"model": "grok-3",
|
|
5192
|
+
"healthCheck": {
|
|
5193
|
+
"enabled": true,
|
|
5194
|
+
"interval": 3e5,
|
|
5195
|
+
"timeout": 5e3
|
|
5196
|
+
},
|
|
5197
|
+
"circuitBreaker": {
|
|
5198
|
+
"enabled": true,
|
|
5199
|
+
"failureThreshold": 3,
|
|
5200
|
+
"recoveryTimeout": 6e4
|
|
5201
|
+
},
|
|
5202
|
+
"processManagement": {
|
|
5203
|
+
"gracefulShutdownTimeout": 5e3,
|
|
5204
|
+
"forceKillDelay": 1e3
|
|
5205
|
+
},
|
|
5206
|
+
"versionDetection": {
|
|
5207
|
+
"timeout": 5e3,
|
|
5208
|
+
"forceKillDelay": 1e3,
|
|
5209
|
+
"cacheEnabled": true
|
|
5210
|
+
}
|
|
5198
5211
|
}
|
|
5199
5212
|
},
|
|
5200
5213
|
"execution": {
|
|
@@ -5406,7 +5419,15 @@ var PRECOMPILED_CONFIG = {
|
|
|
5406
5419
|
"enableFreeTierPrioritization": true,
|
|
5407
5420
|
"enableWorkloadAwareRouting": true
|
|
5408
5421
|
},
|
|
5409
|
-
"
|
|
5422
|
+
"featureFlags": {
|
|
5423
|
+
"sdkFirstMode": false,
|
|
5424
|
+
"mcpBidirectional": false,
|
|
5425
|
+
"autoInjectMCPConfig": false,
|
|
5426
|
+
"sdkFallbackEnabled": true,
|
|
5427
|
+
"deprecationWarnings": true,
|
|
5428
|
+
"providerMetrics": true
|
|
5429
|
+
},
|
|
5430
|
+
"version": "12.0.1"
|
|
5410
5431
|
};
|
|
5411
5432
|
|
|
5412
5433
|
// src/core/config/schemas.ts
|
|
@@ -5418,10 +5439,14 @@ z.enum([
|
|
|
5418
5439
|
"gemini-cli",
|
|
5419
5440
|
"openai",
|
|
5420
5441
|
"codex",
|
|
5421
|
-
"ax-cli",
|
|
5422
|
-
// v9.2.0: Multi-model provider (GLM, xAI, OpenAI, Anthropic, Ollama, DeepSeek, Llama)
|
|
5423
5442
|
"glm",
|
|
5424
|
-
//
|
|
5443
|
+
// v12.0.0: Native GLM provider (Zhipu AI)
|
|
5444
|
+
"ax-glm",
|
|
5445
|
+
// v12.0.0: Alias for glm
|
|
5446
|
+
"grok",
|
|
5447
|
+
// v12.0.0: Native Grok provider (xAI)
|
|
5448
|
+
"ax-grok",
|
|
5449
|
+
// v12.0.0: Alias for grok
|
|
5425
5450
|
"test-provider"
|
|
5426
5451
|
]).describe("Provider name (whitelisted for security)");
|
|
5427
5452
|
var commandSchema = z.string().min(1, "command is required").max(VALIDATION_LIMITS.MAX_COMMAND_LENGTH).regex(
|
|
@@ -7195,8 +7220,8 @@ var ProviderMetricsTracker = class extends EventEmitter {
|
|
|
7195
7220
|
p50,
|
|
7196
7221
|
p95,
|
|
7197
7222
|
p99,
|
|
7198
|
-
min: latencies[0],
|
|
7199
|
-
max: latencies[latencies.length - 1]
|
|
7223
|
+
min: latencies.length > 0 ? latencies[0] : 0,
|
|
7224
|
+
max: latencies.length > 0 ? latencies[latencies.length - 1] : 0
|
|
7200
7225
|
},
|
|
7201
7226
|
quality: {
|
|
7202
7227
|
totalRequests: records.length,
|
|
@@ -17116,20 +17141,25 @@ var PROVIDER_MAP = {
|
|
|
17116
17141
|
mcpToActual: {
|
|
17117
17142
|
"claude": "claude-code",
|
|
17118
17143
|
"gemini": "gemini-cli",
|
|
17119
|
-
"openai": "openai"
|
|
17144
|
+
"openai": "openai",
|
|
17145
|
+
"glm": "glm",
|
|
17146
|
+
"grok": "grok"
|
|
17120
17147
|
},
|
|
17121
17148
|
// Actual name → MCP name
|
|
17122
17149
|
actualToMcp: {
|
|
17123
17150
|
"claude-code": "claude",
|
|
17124
17151
|
"gemini-cli": "gemini",
|
|
17125
|
-
"openai": "openai"
|
|
17152
|
+
"openai": "openai",
|
|
17153
|
+
"glm": "glm",
|
|
17154
|
+
"grok": "grok"
|
|
17126
17155
|
},
|
|
17127
17156
|
// Normalized caller → Actual name (for Smart Routing)
|
|
17128
17157
|
normalizedToActual: {
|
|
17129
17158
|
"claude": "claude-code",
|
|
17130
17159
|
"gemini": "gemini-cli",
|
|
17131
17160
|
"codex": "openai",
|
|
17132
|
-
"
|
|
17161
|
+
"glm": "glm",
|
|
17162
|
+
"grok": "grok"
|
|
17133
17163
|
}
|
|
17134
17164
|
};
|
|
17135
17165
|
function mapMcpProviderToActual(mcpProvider) {
|
|
@@ -18173,7 +18203,8 @@ var TaskEngineSchema = z.enum([
|
|
|
18173
18203
|
"gemini",
|
|
18174
18204
|
"claude",
|
|
18175
18205
|
"codex",
|
|
18176
|
-
"
|
|
18206
|
+
"glm",
|
|
18207
|
+
"grok"
|
|
18177
18208
|
]);
|
|
18178
18209
|
var TaskStatusSchema = z.enum([
|
|
18179
18210
|
"pending",
|
|
@@ -18186,7 +18217,8 @@ var OriginClientSchema = z.enum([
|
|
|
18186
18217
|
"claude-code",
|
|
18187
18218
|
"gemini-cli",
|
|
18188
18219
|
"codex-cli",
|
|
18189
|
-
"
|
|
18220
|
+
"glm",
|
|
18221
|
+
"grok",
|
|
18190
18222
|
"unknown"
|
|
18191
18223
|
]);
|
|
18192
18224
|
var CreateTaskInputSchema = z.object({
|
|
@@ -18210,7 +18242,7 @@ var TaskFilterSchema = z.object({
|
|
|
18210
18242
|
offset: z.number().int().min(0).default(0)
|
|
18211
18243
|
});
|
|
18212
18244
|
z.object({
|
|
18213
|
-
engineOverride: z.enum(["gemini", "claude", "codex", "
|
|
18245
|
+
engineOverride: z.enum(["gemini", "claude", "codex", "glm", "grok"]).optional(),
|
|
18214
18246
|
timeoutMs: z.number().int().min(5e3).max(3e5).optional(),
|
|
18215
18247
|
skipCache: z.boolean().default(false)
|
|
18216
18248
|
});
|
|
@@ -18240,10 +18272,13 @@ var CLIENT_NORMALIZATION_MAP = {
|
|
|
18240
18272
|
"codex-cli": "codex-cli",
|
|
18241
18273
|
"openai": "codex-cli",
|
|
18242
18274
|
"gpt": "codex-cli",
|
|
18243
|
-
// ax-cli
|
|
18244
|
-
"
|
|
18245
|
-
"
|
|
18246
|
-
"
|
|
18275
|
+
// v12.0.0: GLM and Grok (replacing ax-cli)
|
|
18276
|
+
"glm": "glm",
|
|
18277
|
+
"zhipu": "glm",
|
|
18278
|
+
"ax-glm": "glm",
|
|
18279
|
+
"grok": "grok",
|
|
18280
|
+
"xai": "grok",
|
|
18281
|
+
"ax-grok": "grok"
|
|
18247
18282
|
};
|
|
18248
18283
|
var LoopGuard = class {
|
|
18249
18284
|
config;
|
|
@@ -18496,7 +18531,7 @@ var SQL = {
|
|
|
18496
18531
|
id TEXT PRIMARY KEY,
|
|
18497
18532
|
type TEXT NOT NULL CHECK (type IN ('web_search', 'code_review', 'code_generation', 'analysis', 'custom')),
|
|
18498
18533
|
status TEXT NOT NULL DEFAULT 'pending' CHECK (status IN ('pending', 'running', 'completed', 'failed', 'expired')),
|
|
18499
|
-
engine TEXT CHECK (engine IN ('gemini', 'claude', 'codex', '
|
|
18534
|
+
engine TEXT CHECK (engine IN ('gemini', 'claude', 'codex', 'glm', 'grok', NULL)),
|
|
18500
18535
|
priority INTEGER NOT NULL DEFAULT 5 CHECK (priority BETWEEN 1 AND 10),
|
|
18501
18536
|
|
|
18502
18537
|
payload_compressed BLOB NOT NULL,
|
|
@@ -19693,7 +19728,8 @@ function mapNormalizedProviderToOriginClient(provider) {
|
|
|
19693
19728
|
"claude": "claude-code",
|
|
19694
19729
|
"gemini": "gemini-cli",
|
|
19695
19730
|
"codex": "codex-cli",
|
|
19696
|
-
"
|
|
19731
|
+
"glm": "glm",
|
|
19732
|
+
"grok": "grok",
|
|
19697
19733
|
"unknown": "unknown"
|
|
19698
19734
|
};
|
|
19699
19735
|
return mapping[provider] ?? "unknown";
|
|
@@ -19715,7 +19751,7 @@ var createTaskSchema = {
|
|
|
19715
19751
|
},
|
|
19716
19752
|
engine: {
|
|
19717
19753
|
type: "string",
|
|
19718
|
-
enum: ["auto", "gemini", "claude", "codex", "
|
|
19754
|
+
enum: ["auto", "gemini", "claude", "codex", "glm", "grok"],
|
|
19719
19755
|
default: "auto",
|
|
19720
19756
|
description: "Target engine (auto = router decides)"
|
|
19721
19757
|
},
|
|
@@ -19806,7 +19842,7 @@ var runTaskSchema = {
|
|
|
19806
19842
|
},
|
|
19807
19843
|
engine_override: {
|
|
19808
19844
|
type: "string",
|
|
19809
|
-
enum: ["gemini", "claude", "codex", "
|
|
19845
|
+
enum: ["gemini", "claude", "codex", "glm", "grok"],
|
|
19810
19846
|
description: "Override the estimated engine"
|
|
19811
19847
|
},
|
|
19812
19848
|
timeout_ms: {
|
|
@@ -19967,7 +20003,7 @@ var listTasksSchema = {
|
|
|
19967
20003
|
},
|
|
19968
20004
|
engine: {
|
|
19969
20005
|
type: "string",
|
|
19970
|
-
enum: ["gemini", "claude", "codex", "
|
|
20006
|
+
enum: ["gemini", "claude", "codex", "glm", "grok"],
|
|
19971
20007
|
description: "Filter by engine"
|
|
19972
20008
|
},
|
|
19973
20009
|
limit: {
|
|
@@ -20870,7 +20906,8 @@ var EventSourceSchema = z.enum([
|
|
|
20870
20906
|
"claude",
|
|
20871
20907
|
"gemini",
|
|
20872
20908
|
"codex",
|
|
20873
|
-
"
|
|
20909
|
+
"glm",
|
|
20910
|
+
"grok",
|
|
20874
20911
|
"mcp",
|
|
20875
20912
|
"internal"
|
|
20876
20913
|
]);
|
|
@@ -22044,201 +22081,12 @@ var CodexEventNormalizer = class extends BaseEventNormalizer {
|
|
|
22044
22081
|
}
|
|
22045
22082
|
};
|
|
22046
22083
|
|
|
22047
|
-
// src/core/events/normalizers/ax-cli-normalizer.ts
|
|
22048
|
-
init_esm_shims();
|
|
22049
|
-
var AxCliEventNormalizer = class extends BaseEventNormalizer {
|
|
22050
|
-
source = "ax-cli";
|
|
22051
|
-
tokenCount = 0;
|
|
22052
|
-
startTime = Date.now();
|
|
22053
|
-
canHandle(rawEvent) {
|
|
22054
|
-
if (typeof rawEvent !== "object" || rawEvent === null) {
|
|
22055
|
-
return false;
|
|
22056
|
-
}
|
|
22057
|
-
const event = rawEvent;
|
|
22058
|
-
if ("type" in event && typeof event.type === "string") {
|
|
22059
|
-
const validPatterns = [
|
|
22060
|
-
"execution.",
|
|
22061
|
-
"tool.",
|
|
22062
|
-
"agent.",
|
|
22063
|
-
"memory.",
|
|
22064
|
-
"session.",
|
|
22065
|
-
// Legacy ax-cli event types
|
|
22066
|
-
"start",
|
|
22067
|
-
"progress",
|
|
22068
|
-
"complete",
|
|
22069
|
-
"error",
|
|
22070
|
-
"token"
|
|
22071
|
-
];
|
|
22072
|
-
return validPatterns.some(
|
|
22073
|
-
(pattern) => event.type.includes(pattern) || event.type === pattern.replace(".", "")
|
|
22074
|
-
);
|
|
22075
|
-
}
|
|
22076
|
-
return false;
|
|
22077
|
-
}
|
|
22078
|
-
normalize(rawEvent, correlationId) {
|
|
22079
|
-
if (!this.canHandle(rawEvent)) {
|
|
22080
|
-
return null;
|
|
22081
|
-
}
|
|
22082
|
-
const event = rawEvent;
|
|
22083
|
-
if (this.isUnifiedFormat(event.type)) {
|
|
22084
|
-
return this.normalizeUnifiedEvent(event, correlationId);
|
|
22085
|
-
}
|
|
22086
|
-
return this.normalizeLegacyEvent(event, correlationId);
|
|
22087
|
-
}
|
|
22088
|
-
/**
|
|
22089
|
-
* Check if event type matches unified format
|
|
22090
|
-
*/
|
|
22091
|
-
isUnifiedFormat(type) {
|
|
22092
|
-
const unifiedTypes = [
|
|
22093
|
-
"execution.started",
|
|
22094
|
-
"execution.progress",
|
|
22095
|
-
"execution.token",
|
|
22096
|
-
"execution.completed",
|
|
22097
|
-
"execution.error",
|
|
22098
|
-
"execution.cancelled",
|
|
22099
|
-
"tool.called",
|
|
22100
|
-
"tool.progress",
|
|
22101
|
-
"tool.result",
|
|
22102
|
-
"tool.error",
|
|
22103
|
-
"agent.selected",
|
|
22104
|
-
"agent.delegated",
|
|
22105
|
-
"agent.context_loaded",
|
|
22106
|
-
"memory.searched",
|
|
22107
|
-
"memory.added",
|
|
22108
|
-
"session.created",
|
|
22109
|
-
"session.updated",
|
|
22110
|
-
"session.completed"
|
|
22111
|
-
];
|
|
22112
|
-
return unifiedTypes.includes(type);
|
|
22113
|
-
}
|
|
22114
|
-
/**
|
|
22115
|
-
* Normalize events that already match unified format
|
|
22116
|
-
*/
|
|
22117
|
-
normalizeUnifiedEvent(event, correlationId) {
|
|
22118
|
-
const payload = this.buildPayload(event);
|
|
22119
|
-
return this.createEvent(
|
|
22120
|
-
event.type,
|
|
22121
|
-
payload,
|
|
22122
|
-
correlationId
|
|
22123
|
-
);
|
|
22124
|
-
}
|
|
22125
|
-
/**
|
|
22126
|
-
* Normalize legacy ax-cli event types
|
|
22127
|
-
*/
|
|
22128
|
-
normalizeLegacyEvent(event, correlationId) {
|
|
22129
|
-
const type = event.type.toLowerCase();
|
|
22130
|
-
if (type === "start" || type.includes("start")) {
|
|
22131
|
-
this.startTime = Date.now();
|
|
22132
|
-
this.tokenCount = 0;
|
|
22133
|
-
return this.createEvent("execution.started", {
|
|
22134
|
-
agent: event.agent || "ax-cli",
|
|
22135
|
-
task: event.task || event.message || "Unknown task",
|
|
22136
|
-
provider: event.provider || "ax-cli",
|
|
22137
|
-
model: event.model
|
|
22138
|
-
}, correlationId);
|
|
22139
|
-
}
|
|
22140
|
-
if (type === "progress") {
|
|
22141
|
-
return this.createEvent("execution.progress", {
|
|
22142
|
-
agent: event.agent || "ax-cli",
|
|
22143
|
-
progress: event.progress ?? 0,
|
|
22144
|
-
message: event.message,
|
|
22145
|
-
stage: event.stage
|
|
22146
|
-
}, correlationId);
|
|
22147
|
-
}
|
|
22148
|
-
if (type === "token") {
|
|
22149
|
-
this.tokenCount += 1;
|
|
22150
|
-
return this.createEvent("execution.token", {
|
|
22151
|
-
agent: event.agent || "ax-cli",
|
|
22152
|
-
token: event.token || event.content || "",
|
|
22153
|
-
tokensReceived: event.tokensReceived ?? this.tokenCount,
|
|
22154
|
-
throughput: event.throughput
|
|
22155
|
-
}, correlationId);
|
|
22156
|
-
}
|
|
22157
|
-
if (type === "complete" || type.includes("complete")) {
|
|
22158
|
-
const latencyMs = Date.now() - this.startTime;
|
|
22159
|
-
return this.createEvent("execution.completed", {
|
|
22160
|
-
agent: event.agent || "ax-cli",
|
|
22161
|
-
content: event.content || "",
|
|
22162
|
-
tokens: event.tokens || {
|
|
22163
|
-
prompt: 0,
|
|
22164
|
-
completion: this.tokenCount,
|
|
22165
|
-
total: this.tokenCount
|
|
22166
|
-
},
|
|
22167
|
-
latencyMs: event.latencyMs ?? latencyMs,
|
|
22168
|
-
provider: event.provider || "ax-cli",
|
|
22169
|
-
model: event.model
|
|
22170
|
-
}, correlationId);
|
|
22171
|
-
}
|
|
22172
|
-
if (type === "error") {
|
|
22173
|
-
const errorMessage = typeof event.error === "string" ? event.error : event.error?.message || "Unknown error";
|
|
22174
|
-
return this.createEvent("execution.error", {
|
|
22175
|
-
agent: event.agent || "ax-cli",
|
|
22176
|
-
error: errorMessage,
|
|
22177
|
-
code: event.code,
|
|
22178
|
-
retryable: event.retryable ?? false,
|
|
22179
|
-
provider: event.provider || "ax-cli"
|
|
22180
|
-
}, correlationId);
|
|
22181
|
-
}
|
|
22182
|
-
return null;
|
|
22183
|
-
}
|
|
22184
|
-
/**
|
|
22185
|
-
* Build payload from event data
|
|
22186
|
-
*/
|
|
22187
|
-
buildPayload(event) {
|
|
22188
|
-
const payload = {};
|
|
22189
|
-
const copyFields = [
|
|
22190
|
-
"agent",
|
|
22191
|
-
"task",
|
|
22192
|
-
"provider",
|
|
22193
|
-
"model",
|
|
22194
|
-
"content",
|
|
22195
|
-
"progress",
|
|
22196
|
-
"message",
|
|
22197
|
-
"stage",
|
|
22198
|
-
"token",
|
|
22199
|
-
"tokensReceived",
|
|
22200
|
-
"throughput",
|
|
22201
|
-
"tokens",
|
|
22202
|
-
"latencyMs",
|
|
22203
|
-
"tool",
|
|
22204
|
-
"arguments",
|
|
22205
|
-
"result",
|
|
22206
|
-
"success",
|
|
22207
|
-
"caller",
|
|
22208
|
-
"error",
|
|
22209
|
-
"code",
|
|
22210
|
-
"retryable",
|
|
22211
|
-
"fromAgent",
|
|
22212
|
-
"toAgent",
|
|
22213
|
-
"reason",
|
|
22214
|
-
"score",
|
|
22215
|
-
"confidence",
|
|
22216
|
-
"alternatives",
|
|
22217
|
-
"autoSelected"
|
|
22218
|
-
];
|
|
22219
|
-
for (const field of copyFields) {
|
|
22220
|
-
if (field in event && event[field] !== void 0) {
|
|
22221
|
-
payload[field] = event[field];
|
|
22222
|
-
}
|
|
22223
|
-
}
|
|
22224
|
-
if (!payload.agent) payload.agent = "ax-cli";
|
|
22225
|
-
return payload;
|
|
22226
|
-
}
|
|
22227
|
-
/**
|
|
22228
|
-
* Reset state for new execution
|
|
22229
|
-
*/
|
|
22230
|
-
reset() {
|
|
22231
|
-
this.tokenCount = 0;
|
|
22232
|
-
this.startTime = Date.now();
|
|
22233
|
-
}
|
|
22234
|
-
};
|
|
22235
|
-
|
|
22236
22084
|
// src/mcp/server.ts
|
|
22237
22085
|
var CLIENT_PATTERNS = [
|
|
22238
22086
|
[["claude"], "claude"],
|
|
22239
22087
|
[["gemini"], "gemini"],
|
|
22240
|
-
[["codex", "openai"], "codex"]
|
|
22241
|
-
|
|
22088
|
+
[["codex", "openai"], "codex"]
|
|
22089
|
+
// v12.0.0: Removed ax-cli (deprecated)
|
|
22242
22090
|
];
|
|
22243
22091
|
var STDIO_MAX_ITERATIONS = 100;
|
|
22244
22092
|
var STDIO_MAX_BUFFER_SIZE = 10 * 1024 * 1024;
|
|
@@ -22507,7 +22355,6 @@ var McpServer = class _McpServer {
|
|
|
22507
22355
|
this.eventBridge.registerNormalizer(new ClaudeEventNormalizer());
|
|
22508
22356
|
this.eventBridge.registerNormalizer(new GeminiEventNormalizer());
|
|
22509
22357
|
this.eventBridge.registerNormalizer(new CodexEventNormalizer());
|
|
22510
|
-
this.eventBridge.registerNormalizer(new AxCliEventNormalizer());
|
|
22511
22358
|
if (this.enableStreamingNotifications) {
|
|
22512
22359
|
this.streamingNotifier = getGlobalStreamingNotifier({
|
|
22513
22360
|
enabled: true,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@defai.digital/automatosx",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Provider-agnostic AI orchestration platform with 20+ specialized agents, persistent memory, and multi-provider routing for Claude Code, Gemini CLI, Codex CLI, and
|
|
3
|
+
"version": "12.0.1",
|
|
4
|
+
"description": "Provider-agnostic AI orchestration platform with 20+ specialized agents, persistent memory, and multi-provider routing for Claude Code, Gemini CLI, Codex CLI, GLM, and Grok",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"vitest": "^4.0.15"
|
|
89
89
|
},
|
|
90
90
|
"dependencies": {
|
|
91
|
-
"@defai.digital/ax-cli": "^4.
|
|
91
|
+
"@defai.digital/ax-cli": "^4.1.15",
|
|
92
92
|
"@iarna/toml": "^2.2.5",
|
|
93
93
|
"@openai/codex-sdk": "^0.65.0",
|
|
94
94
|
"ajv": "^8.17.1",
|