snow-flow 3.3.1 → 3.3.2

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.
@@ -36,7 +36,7 @@ function getDynamicVersion() {
36
36
  console.warn('Warning: Could not read version from package.json:', error);
37
37
  }
38
38
  // Fallback to hardcoded version
39
- return '3.3.1';
39
+ return '3.3.2';
40
40
  }
41
41
  // Export a constant that uses the dynamic version
42
42
  exports.VERSION = getDynamicVersion();
@@ -41,6 +41,14 @@ export declare abstract class EnhancedBaseMCPServer {
41
41
  * Create record with tracking
42
42
  */
43
43
  protected createRecord(table: string, data: any): Promise<any>;
44
+ /**
45
+ * Update record with tracking
46
+ */
47
+ protected updateRecord(table: string, sysId: string, data: any): Promise<any>;
48
+ /**
49
+ * Get record with tracking
50
+ */
51
+ protected getRecord(table: string, sysId: string): Promise<any>;
44
52
  /**
45
53
  * Get client for direct use
46
54
  */
@@ -36,6 +36,8 @@ class EnhancedBaseMCPServer {
36
36
  * Execute tool with enhanced tracking
37
37
  */
38
38
  async executeTool(toolName, handler) {
39
+ // Reset tokens at start of each operation to avoid accumulation
40
+ this.logger.resetTokens();
39
41
  // Start operation tracking
40
42
  this.logger.operationStart(toolName);
41
43
  try {
@@ -151,6 +153,28 @@ class EnhancedBaseMCPServer {
151
153
  }
152
154
  return result;
153
155
  }
156
+ /**
157
+ * Update record with tracking
158
+ */
159
+ async updateRecord(table, sysId, data) {
160
+ this.logger.progress(`Updating ${table} record ${sysId}...`);
161
+ const result = await this.client.updateRecord(table, sysId, data);
162
+ if (result?.success) {
163
+ this.logger.info(`✅ Updated ${table} record: ${sysId}`);
164
+ }
165
+ return result;
166
+ }
167
+ /**
168
+ * Get record with tracking
169
+ */
170
+ async getRecord(table, sysId) {
171
+ this.logger.progress(`Getting ${table} record ${sysId}...`);
172
+ const result = await this.client.getRecord(table, sysId);
173
+ if (result?.success) {
174
+ this.logger.info(`✅ Retrieved ${table} record: ${sysId}`);
175
+ }
176
+ return result;
177
+ }
154
178
  /**
155
179
  * Get client for direct use
156
180
  */
@@ -131,7 +131,7 @@ class MCPLogger {
131
131
  */
132
132
  operationStart(operation, params) {
133
133
  this.startTime = Date.now();
134
- this.info(`🚀 Starting: ${operation}`, params);
134
+ this.info(`🚀 Starting: ${operation} (tokens reset)`, params);
135
135
  }
136
136
  /**
137
137
  * Log operation complete
@@ -166,6 +166,7 @@ class MCPLogger {
166
166
  */
167
167
  resetTokens() {
168
168
  this.tokenUsage = { input: 0, output: 0, total: 0 };
169
+ console.error(`🔄 [${this.name}] Token counter reset for new operation`);
169
170
  }
170
171
  }
171
172
  exports.MCPLogger = MCPLogger;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "snow-flow",
3
- "version": "3.3.1",
4
- "description": "Snow-Flow v3.3.1: ServiceNow development platform with 180+ MCP tools. Enhanced MCP servers with real-time progress indicators, detailed token tracking, and comprehensive operation logging. Supports ATF Testing, Knowledge Management, Service Catalog, Change Management, Virtual Agent, Performance Analytics, Flow Designer, Agent Workspace, Mobile, CMDB/Discovery, Event Management, HR Service Delivery, Customer Service Management, and DevOps integration. All tools use official ServiceNow REST APIs across 17 specialized MCP servers with full visibility into API operations.",
3
+ "version": "3.3.2",
4
+ "description": "Snow-Flow v3.3.2: ServiceNow development platform with 180+ MCP tools. Enhanced MCP servers with real-time progress indicators, per-operation token tracking (tokens reset per call), and comprehensive operation logging. Supports ATF Testing, Knowledge Management, Service Catalog, Change Management, Virtual Agent, Performance Analytics, Flow Designer, Agent Workspace, Mobile, CMDB/Discovery, Event Management, HR Service Delivery, Customer Service Management, and DevOps integration. All tools use official ServiceNow REST APIs across 17 specialized MCP servers with full visibility into API operations.",
5
5
  "main": "dist/index.js",
6
6
  "type": "commonjs",
7
7
  "bin": {