snow-flow 3.5.11 ā 3.5.13
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.
|
@@ -318,7 +318,14 @@ class ArtifactLocalSync {
|
|
|
318
318
|
try {
|
|
319
319
|
console.log(`\nš¤ Updating ${config.displayName} in ServiceNow...`);
|
|
320
320
|
const timeoutConfig = (0, mcp_timeout_config_js_1.getMCPTimeoutConfig)();
|
|
321
|
-
await (0, mcp_timeout_config_js_1.withMCPTimeout)(this.client.updateRecord(config.tableName, sys_id, updates), timeoutConfig.pushToolTimeout, `Update ${config.displayName} ${sys_id}`);
|
|
321
|
+
const updateResult = await (0, mcp_timeout_config_js_1.withMCPTimeout)(this.client.updateRecord(config.tableName, sys_id, updates), timeoutConfig.pushToolTimeout, `Update ${config.displayName} ${sys_id}`);
|
|
322
|
+
// CRITICAL FIX: Check if the API call was actually successful
|
|
323
|
+
if (!updateResult || !updateResult.success) {
|
|
324
|
+
const errorMsg = updateResult?.error || 'Unknown API error';
|
|
325
|
+
console.error(`ā ServiceNow API returned failure: ${errorMsg}`);
|
|
326
|
+
artifact.syncStatus = 'pending_upload';
|
|
327
|
+
return false;
|
|
328
|
+
}
|
|
322
329
|
artifact.syncStatus = 'synced';
|
|
323
330
|
artifact.lastSyncedAt = new Date();
|
|
324
331
|
console.log(`ā
${config.displayName} successfully updated in ServiceNow!`);
|
|
@@ -16,21 +16,21 @@ exports.quickHealthCheck = quickHealthCheck;
|
|
|
16
16
|
function getMCPTimeoutConfig() {
|
|
17
17
|
const isDebug = process.env.DEBUG === 'true';
|
|
18
18
|
const isProduction = process.env.NODE_ENV === 'production';
|
|
19
|
-
//
|
|
19
|
+
// Balanced timeouts - long enough for real work, short enough to prevent hanging
|
|
20
20
|
const config = {
|
|
21
|
-
// Server should start quickly
|
|
22
|
-
serverInitTimeout: parseInt(process.env.MCP_SERVER_INIT_TIMEOUT || '
|
|
23
|
-
// Tool timeouts -
|
|
24
|
-
defaultToolTimeout: parseInt(process.env.MCP_DEFAULT_TOOL_TIMEOUT || '
|
|
25
|
-
queryToolTimeout: parseInt(process.env.MCP_QUERY_TIMEOUT || '
|
|
26
|
-
pullToolTimeout: parseInt(process.env.MCP_PULL_TIMEOUT || '
|
|
27
|
-
pushToolTimeout: parseInt(process.env.MCP_PUSH_TIMEOUT || '
|
|
28
|
-
debugToolTimeout: parseInt(process.env.MCP_DEBUG_TIMEOUT || '
|
|
29
|
-
scriptToolTimeout: parseInt(process.env.MCP_SCRIPT_TIMEOUT || '
|
|
30
|
-
// API calls
|
|
31
|
-
apiCallTimeout: parseInt(process.env.MCP_API_TIMEOUT || '
|
|
32
|
-
apiRetryDelay: parseInt(process.env.MCP_API_RETRY_DELAY || '
|
|
33
|
-
apiMaxRetries: parseInt(process.env.MCP_API_MAX_RETRIES || '
|
|
21
|
+
// Server should start reasonably quickly
|
|
22
|
+
serverInitTimeout: parseInt(process.env.MCP_SERVER_INIT_TIMEOUT || '10000'), // 10s for server init
|
|
23
|
+
// Tool timeouts - balanced for real operations
|
|
24
|
+
defaultToolTimeout: parseInt(process.env.MCP_DEFAULT_TOOL_TIMEOUT || '30000'), // 30s default
|
|
25
|
+
queryToolTimeout: parseInt(process.env.MCP_QUERY_TIMEOUT || '15000'), // 15s for queries
|
|
26
|
+
pullToolTimeout: parseInt(process.env.MCP_PULL_TIMEOUT || '60000'), // 60s for pulls (large widgets)
|
|
27
|
+
pushToolTimeout: parseInt(process.env.MCP_PUSH_TIMEOUT || '45000'), // 45s for pushes
|
|
28
|
+
debugToolTimeout: parseInt(process.env.MCP_DEBUG_TIMEOUT || '30000'), // 30s for debug
|
|
29
|
+
scriptToolTimeout: parseInt(process.env.MCP_SCRIPT_TIMEOUT || '120000'), // 2 min for scripts
|
|
30
|
+
// API calls get reasonable time
|
|
31
|
+
apiCallTimeout: parseInt(process.env.MCP_API_TIMEOUT || '15000'), // 15s per API call
|
|
32
|
+
apiRetryDelay: parseInt(process.env.MCP_API_RETRY_DELAY || '2000'), // 2s between retries
|
|
33
|
+
apiMaxRetries: parseInt(process.env.MCP_API_MAX_RETRIES || '3'), // 3 retries for resilience
|
|
34
34
|
// Health checks
|
|
35
35
|
healthCheckInterval: parseInt(process.env.MCP_HEALTH_INTERVAL || '30000'), // Every 30s
|
|
36
36
|
healthCheckTimeout: parseInt(process.env.MCP_HEALTH_TIMEOUT || '2000'), // 2s timeout
|
|
@@ -86,8 +86,6 @@ class ServiceNowClient {
|
|
|
86
86
|
// š§ CRITICAL FIX: Add makeRequest method to Axios instance to fix phantom calls
|
|
87
87
|
// Some code expects makeRequest to exist on this.client (the Axios instance)
|
|
88
88
|
this.client.makeRequest = async (config) => {
|
|
89
|
-
this.logger.debug('š§ AXIOS makeRequest called! Config:', config);
|
|
90
|
-
this.logger.debug('š§ Routing to appropriate HTTP method...');
|
|
91
89
|
// Route to the appropriate Axios method based on the request config
|
|
92
90
|
const method = (config.method || 'GET').toLowerCase();
|
|
93
91
|
const url = config.url || config.endpoint;
|
|
@@ -2888,17 +2886,13 @@ try {
|
|
|
2888
2886
|
* This method provides compatibility for code that expects makeRequest
|
|
2889
2887
|
*/
|
|
2890
2888
|
async makeRequest(config) {
|
|
2891
|
-
|
|
2892
|
-
this.logger.info('š§ TEMP FIX: makeRequest called with config:', config);
|
|
2893
|
-
this.logger.info('š§ This instance constructor:', this.constructor.name);
|
|
2894
|
-
this.logger.info('š§ This instance methods:', Object.getOwnPropertyNames(Object.getPrototypeOf(this)));
|
|
2889
|
+
// Debug logging removed - was causing noise in production
|
|
2895
2890
|
try {
|
|
2896
2891
|
await this.ensureAuthenticated();
|
|
2897
2892
|
// Route the request to the appropriate HTTP method
|
|
2898
2893
|
const method = (config.method || 'GET').toLowerCase();
|
|
2899
2894
|
const url = config.url || config.endpoint;
|
|
2900
2895
|
const data = config.data || config.body;
|
|
2901
|
-
this.logger.info(`š§ Routing ${method.toUpperCase()} request to: ${url}`);
|
|
2902
2896
|
switch (method) {
|
|
2903
2897
|
case 'get':
|
|
2904
2898
|
return await this.get(url, config.params);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "snow-flow",
|
|
3
|
-
"version": "3.5.
|
|
4
|
-
"description": "ServiceNow development framework with MCP server integration and
|
|
3
|
+
"version": "3.5.13",
|
|
4
|
+
"description": "ServiceNow development framework with MCP server integration and reliable push operations. Fixed false positive success reporting in artifact push - now properly validates API responses. Features intelligent timeout configuration for long operations while preventing Claude API timeouts. Debug logging cleaned up for production use. Executes background scripts using ES5 JavaScript only (ServiceNow Rhino engine requirement). Provides 18 MCP servers including local development sync for editing ServiceNow artifacts with Claude Code native tools, 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",
|
|
7
7
|
"bin": {
|