snow-flow 3.4.22 → 3.4.24

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/cli.js CHANGED
@@ -2454,6 +2454,10 @@ async function createMCPConfig(targetDir, force = false) {
2454
2454
  const legacyConfigPath = (0, path_1.join)(targetDir, '.claude/mcp-config.json');
2455
2455
  await fs_1.promises.writeFile(legacyConfigPath, JSON.stringify(finalConfig, null, 2));
2456
2456
  // Create comprehensive Claude Code settings file
2457
+ // NOTE: Only include properties that Claude Code actually accepts
2458
+ // Valid properties: apiKeyHelper, cleanupPeriodDays, env, includeCoAuthoredBy,
2459
+ // permissions, hooks, model, statusLine, forceLoginMethod, enableAllProjectMcpServers,
2460
+ // enabledMcpjsonServers, disabledMcpjsonServers, awsAuthRefresh, awsCredentialExport
2457
2461
  const claudeSettings = {
2458
2462
  "enabledMcpjsonServers": [
2459
2463
  "snow-flow",
@@ -2508,51 +2512,9 @@ async function createMCPConfig(targetDir, force = false) {
2508
2512
  "CLAUDE_CODE_EXECUTION_TIMEOUT": "0"
2509
2513
  },
2510
2514
  "cleanupPeriodDays": 90,
2511
- "includeCoAuthoredBy": true,
2512
- "automation": {
2513
- "enabled": true,
2514
- "defaultTimeout": 300000,
2515
- "maxRetries": 3,
2516
- "retryBackoff": 2000,
2517
- "parallelExecution": true,
2518
- "batchOperations": true,
2519
- "autoSaveMemory": true,
2520
- "autoCommit": false
2521
- },
2522
- "snowFlow": {
2523
- "version": "1.4.35",
2524
- "swarmDefaults": {
2525
- "maxAgents": 10,
2526
- "timeout": 0,
2527
- "parallel": true,
2528
- "monitor": true,
2529
- "outputFormat": "json"
2530
- },
2531
- "sparcDefaults": {
2532
- "timeout": 0,
2533
- "parallel": true,
2534
- "batch": true,
2535
- "memoryKey": "sparc_session"
2536
- },
2537
- "memoryDefaults": {
2538
- "maxSize": "5GB",
2539
- "autoCompress": true,
2540
- "autoCleanup": true,
2541
- "indexingEnabled": true,
2542
- "persistenceEnabled": true
2543
- }
2544
- },
2545
- "mcpServers": {
2546
- "servicenow": {
2547
- "command": "node",
2548
- "args": ["dist/mcp/start-servicenow-mcp.js"],
2549
- "env": {
2550
- "SNOW_INSTANCE": "${SNOW_INSTANCE}",
2551
- "SNOW_CLIENT_ID": "${SNOW_CLIENT_ID}",
2552
- "SNOW_CLIENT_SECRET": "${SNOW_CLIENT_SECRET}"
2553
- }
2554
- }
2555
- }
2515
+ "includeCoAuthoredBy": true
2516
+ // Removed invalid properties: automation, snowFlow, mcpServers
2517
+ // These were causing "Property X is not allowed" errors in Claude Code
2556
2518
  };
2557
2519
  const claudeSettingsPath = (0, path_1.join)(targetDir, '.claude/settings.json');
2558
2520
  await fs_1.promises.writeFile(claudeSettingsPath, JSON.stringify(claudeSettings, null, 2));
@@ -852,7 +852,7 @@ class ServiceNowOperationsMCP {
852
852
  return result;
853
853
  }
854
854
  catch (error) {
855
- this.logger.error(`Error executing tool ${name}:`, error);
855
+ this.logger.operationError(name, error);
856
856
  throw new types_js_1.McpError(types_js_1.ErrorCode.InternalError, `Failed to execute ${name}: ${error}`);
857
857
  }
858
858
  });
@@ -38,6 +38,10 @@ export declare class MCPLogger {
38
38
  * Log error message
39
39
  */
40
40
  error(message: string, error?: any): void;
41
+ /**
42
+ * Log operation error - ensures progress indicator is stopped
43
+ */
44
+ operationError(operation: string, error: any): void;
41
45
  /**
42
46
  * Log debug message
43
47
  */
@@ -14,8 +14,7 @@ class MCPLogger {
14
14
  this.lastProgressTime = Date.now();
15
15
  this.progressInterval = null;
16
16
  this.name = name;
17
- // Start progress indicator
18
- this.startProgressIndicator();
17
+ // Don't start progress indicator automatically - only start when needed
19
18
  }
20
19
  /**
21
20
  * Log to stderr with proper formatting
@@ -45,13 +44,13 @@ class MCPLogger {
45
44
  * Start progress indicator for long-running operations
46
45
  */
47
46
  startProgressIndicator() {
48
- // Send progress every 2 seconds
47
+ // Send progress every 5 seconds (reduced frequency)
49
48
  this.progressInterval = setInterval(() => {
50
49
  const duration = Math.round((Date.now() - this.startTime) / 1000);
51
- if (duration > 0) {
50
+ if (duration > 3) { // Only show progress after 3+ seconds
52
51
  this.progress(`Operation in progress... (${duration}s elapsed, ${this.tokenUsage.total} tokens used)`);
53
52
  }
54
- }, 2000);
53
+ }, 5000);
55
54
  }
56
55
  /**
57
56
  * Stop progress indicator
@@ -85,6 +84,15 @@ class MCPLogger {
85
84
  } : error;
86
85
  this.log('ERROR', message, errorData);
87
86
  }
87
+ /**
88
+ * Log operation error - ensures progress indicator is stopped
89
+ */
90
+ operationError(operation, error) {
91
+ const duration = Math.round((Date.now() - this.startTime) / 1000);
92
+ // Always stop progress indicator when operation fails
93
+ this.stopProgress();
94
+ this.error(`❌ Failed: ${operation} (${duration}s)`, error);
95
+ }
88
96
  /**
89
97
  * Log debug message
90
98
  */
@@ -133,27 +141,24 @@ class MCPLogger {
133
141
  this.startTime = Date.now();
134
142
  this.resetTokens(); // Actually reset tokens when starting new operation!
135
143
  this.info(`🚀 Starting: ${operation}`, params);
144
+ // Start progress indicator after 3 seconds (only for long operations)
145
+ setTimeout(() => {
146
+ if (!this.progressInterval) {
147
+ this.startProgressIndicator();
148
+ }
149
+ }, 3000);
136
150
  }
137
151
  /**
138
152
  * Log operation complete
139
153
  */
140
154
  operationComplete(operation, result) {
141
155
  const duration = Math.round((Date.now() - this.startTime) / 1000);
156
+ // Always stop progress indicator first
142
157
  this.stopProgress();
143
158
  this.info(`✅ Completed: ${operation} (${duration}s, ${this.tokenUsage.total} tokens)`, result);
144
- // Send final token report
145
- if (this.tokenUsage.total > 0) {
146
- console.error(`
147
- ═══════════════════════════════════════════════════════════
148
- 📊 ${this.name} - Operation Complete
149
- ─────────────────────────────────────────────────────────
150
- ⏱️ Duration: ${duration} seconds
151
- 🔢 Tokens Used: ${this.tokenUsage.total}
152
- ├─ Input: ${this.tokenUsage.input}
153
- └─ Output: ${this.tokenUsage.output}
154
- 🎯 Operation: ${operation}
155
- ═══════════════════════════════════════════════════════════
156
- `);
159
+ // Only show token report for operations with actual token usage
160
+ if (this.tokenUsage.total > 0 && duration > 1) {
161
+ console.error(`📊 [${this.name}] ${operation} completed: ${duration}s, ${this.tokenUsage.total} tokens`);
157
162
  }
158
163
  }
159
164
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "snow-flow",
3
- "version": "3.4.22",
3
+ "version": "3.4.24",
4
4
  "description": "ServiceNow development framework with MCP server integration. Executes background scripts using ES5 JavaScript only (ServiceNow Rhino engine requirement). Provides 17 MCP servers for complete ServiceNow operations including widget deployment with coherence validation, table operations, script execution, machine learning, advanced features, and comprehensive platform management.",
5
5
  "main": "dist/index.js",
6
6
  "type": "commonjs",