snow-flow 2.6.2 → 2.6.3

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.
@@ -2110,51 +2110,34 @@ class ServiceNowDevelopmentAssistantMCP {
2110
2110
  ],
2111
2111
  };
2112
2112
  }
2113
- // Format the response with relevant fields - limit size to prevent timeouts
2113
+ // Format the response with relevant fields
2114
2114
  const formattedArtifact = {
2115
2115
  sys_id: artifact.sys_id,
2116
2116
  name: artifact.name || artifact.title || 'Unknown',
2117
2117
  table: args.table,
2118
- description: artifact.description || artifact.short_description || '',
2119
- active: artifact.active,
2120
- created_on: artifact.sys_created_on,
2121
- updated_on: artifact.sys_updated_on,
2122
- created_by: artifact.sys_created_by,
2123
- updated_by: artifact.sys_updated_by
2118
+ ...artifact
2124
2119
  };
2125
- // Add artifact-specific fields based on table type
2126
- if (args.table === 'sys_script_include') {
2127
- formattedArtifact.api_name = artifact.api_name;
2128
- formattedArtifact.client_callable = artifact.client_callable;
2129
- formattedArtifact.script_preview = artifact.script ?
2130
- artifact.script.substring(0, 500) + (artifact.script.length > 500 ? '...\n\n[Script truncated - ' + artifact.script.length + ' total characters]' : '') :
2131
- 'No script content';
2132
- }
2133
- else if (args.table === 'sp_widget') {
2134
- formattedArtifact.template_preview = artifact.template ?
2135
- artifact.template.substring(0, 300) + (artifact.template.length > 300 ? '...' : '') :
2136
- 'No template';
2137
- formattedArtifact.server_script_preview = artifact.server_script ?
2138
- artifact.server_script.substring(0, 300) + (artifact.server_script.length > 300 ? '...' : '') :
2139
- 'No server script';
2140
- formattedArtifact.client_script_preview = artifact.client_script ?
2141
- artifact.client_script.substring(0, 300) + (artifact.client_script.length > 300 ? '...' : '') :
2142
- 'No client script';
2143
- formattedArtifact.css_preview = artifact.css ?
2144
- artifact.css.substring(0, 200) + (artifact.css.length > 200 ? '...' : '') :
2145
- 'No CSS';
2146
- }
2147
- // Store the full artifact in memory for later retrieval if needed
2148
- this.intelligentlyIndex(artifact).then(indexed => {
2149
- this.storeInMemory(indexed).catch(err => {
2150
- this.logger.warn('Failed to store artifact in memory:', err);
2120
+ // Don't wait for memory indexing - do it in background
2121
+ // This might be causing the timeout
2122
+ setImmediate(() => {
2123
+ this.intelligentlyIndex(artifact).then(indexed => {
2124
+ this.storeInMemory(indexed).catch(err => {
2125
+ this.logger.warn('Failed to store artifact in memory:', err);
2126
+ });
2151
2127
  });
2152
2128
  });
2129
+ // Check response size to avoid MCP runtime timeouts
2130
+ const jsonString = JSON.stringify(formattedArtifact);
2131
+ const sizeInKB = Buffer.byteLength(jsonString) / 1024;
2132
+ // If response is large, use compact format
2133
+ const formattedJson = sizeInKB > 50 ?
2134
+ JSON.stringify(formattedArtifact) : // Compact for large responses
2135
+ JSON.stringify(formattedArtifact, null, 2); // Pretty print for small responses
2153
2136
  return {
2154
2137
  content: [
2155
2138
  {
2156
2139
  type: 'text',
2157
- text: `āœ… Found artifact by sys_id!\n\nšŸŽÆ **${formattedArtifact.name}**\nšŸ†” sys_id: ${args.sys_id}\nšŸ“Š Table: ${args.table}\n\n**Key Fields:**\n${JSON.stringify(formattedArtifact, null, 2)}\n\nšŸ’” **Tip:** Full artifact stored in memory. Use snow_analyze_artifact for detailed analysis.`,
2140
+ text: `āœ… Found artifact by sys_id!\n\nšŸŽÆ **${formattedArtifact.name}**\nšŸ†” sys_id: ${args.sys_id}\nšŸ“Š Table: ${args.table}\nšŸ“ Size: ${sizeInKB.toFixed(1)}KB\n\n**All Fields:**\n${formattedJson}`,
2158
2141
  },
2159
2142
  ],
2160
2143
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "snow-flow",
3
- "version": "2.6.2",
3
+ "version": "2.6.3",
4
4
  "description": "Snow-Flow: ServiceNow Advanced Intelligence Platform - 100+ real MCP tools with AI-powered swarm orchestration and neural networks. Dynamic task categorization using AI. Machine learning for incident classification, change risk prediction, and anomaly detection. Zero Mock Data, 100% Real API Integration.",
5
5
  "main": "dist/index.js",
6
6
  "type": "commonjs",