snow-flow 3.4.33 → 3.4.35

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.
@@ -84,8 +84,9 @@ class BaseMCPServer {
84
84
  const { limited, wasLimited, originalSize } = response_limiter_js_1.ResponseLimiter.limitResponse(result);
85
85
  if (wasLimited) {
86
86
  this.logger.warn(`Response limited for ${name}: ${originalSize} bytes -> ${JSON.stringify(limited).length} bytes`);
87
- // If response was too large, return a summary
88
- if (originalSize > 100000) { // > 100KB
87
+ // Only create summary for EXTREMELY large responses (>2MB)
88
+ // Normal widgets/flows should pass through fine with 500KB limit
89
+ if (originalSize > 2000000) { // > 2MB - truly excessive
89
90
  result = response_limiter_js_1.ResponseLimiter.createSummaryResponse(result, name);
90
91
  }
91
92
  else {
@@ -38,9 +38,9 @@ class ResponseLimiter {
38
38
  }
39
39
  // Handle primitives
40
40
  if (typeof obj !== 'object') {
41
- // Limit string length
42
- if (typeof obj === 'string' && obj.length > 1000) {
43
- return obj.substring(0, 1000) + '... [TRUNCATED]';
41
+ // Limit string length - 10KB per string field is reasonable
42
+ if (typeof obj === 'string' && obj.length > 10000) {
43
+ return obj.substring(0, 10000) + '... [TRUNCATED]';
44
44
  }
45
45
  return obj;
46
46
  }
@@ -83,15 +83,22 @@ Operation: ${operation}
83
83
  Status: Success (data limited to prevent timeout)
84
84
 
85
85
  Summary:
86
- - Original size: ${(originalSize / 1024).toFixed(1)}KB
86
+ - Original size: ${(originalSize / 1024 / 1024).toFixed(2)}MB
87
87
  - Token estimate: ${estimatedTokens}
88
- - Limit: ${this.MAX_TOKEN_ESTIMATE} tokens
88
+ - Response limit: ${(this.MAX_RESPONSE_SIZE / 1024).toFixed(0)}KB
89
+
90
+ 🎯 Immediate Solution:
91
+ Run \`/compact\` in Claude Code to clear context and prevent timeouts!
89
92
 
90
93
  💡 Tips to reduce response size:
91
94
  1. Use specific field queries instead of '*'
92
95
  2. Add pagination with smaller limits
93
96
  3. Filter results more specifically
94
- 4. Use count operations instead of full data retrieval`
97
+ 4. Use count operations instead of full data retrieval
98
+
99
+ 📝 Advanced Config:
100
+ - MCP_MAX_RESPONSE_SIZE (default: 500000 bytes)
101
+ - MCP_MAX_ARRAY_ITEMS (default: 500 items)`
95
102
  }],
96
103
  _meta: {
97
104
  limited: true,
@@ -102,7 +109,8 @@ Summary:
102
109
  }
103
110
  }
104
111
  exports.ResponseLimiter = ResponseLimiter;
105
- ResponseLimiter.MAX_RESPONSE_SIZE = 50000; // 50KB max per response
106
- ResponseLimiter.MAX_ARRAY_ITEMS = 100; // Max 100 items in arrays
107
- ResponseLimiter.MAX_TOKEN_ESTIMATE = 12500; // ~50KB / 4 chars per token
112
+ // Configurable via environment variable, default to 500KB (reasonable for widgets/flows)
113
+ ResponseLimiter.MAX_RESPONSE_SIZE = parseInt(process.env.MCP_MAX_RESPONSE_SIZE || '500000'); // 500KB default
114
+ ResponseLimiter.MAX_ARRAY_ITEMS = parseInt(process.env.MCP_MAX_ARRAY_ITEMS || '500'); // 500 items default
115
+ ResponseLimiter.MAX_TOKEN_ESTIMATE = 125000; // ~500KB / 4 chars per token
108
116
  //# sourceMappingURL=response-limiter.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "snow-flow",
3
- "version": "3.4.33",
3
+ "version": "3.4.35",
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",