snow-flow 4.0.0-final-claude → 4.0.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.
- package/dist/dynamic-version.js +1 -1
- package/dist/index.js +1 -3
- package/dist/intelligence/performance-recommendations-engine.js +0 -1
- package/dist/mcp/servicenow-local-development-mcp.d.ts +3 -0
- package/dist/mcp/servicenow-local-development-mcp.js +204 -7
- package/dist/mcp/shared/mcp-types.d.ts +37 -0
- package/dist/mcp/shared/mcp-types.js +7 -0
- package/dist/memory/hierarchical-memory-system.d.ts +32 -0
- package/dist/memory/hierarchical-memory-system.js +60 -0
- package/dist/memory/memory-system.d.ts +25 -0
- package/dist/memory/memory-system.js +36 -0
- package/dist/memory/snow-flow-memory-patterns.d.ts +30 -29
- package/dist/memory/snow-flow-memory-patterns.js +37 -26
- package/dist/snow-flow-system.js +0 -1
- package/dist/testing/integration-test-suite.js +0 -1
- package/dist/utils/artifact-local-sync.js +17 -0
- package/dist/utils/chunking-manager.d.ts +39 -0
- package/dist/utils/chunking-manager.js +142 -0
- package/dist/utils/smart-field-fetcher.js +6 -4
- package/package.json +3 -8
- package/.env.example +0 -89
- package/.mcp.json +0 -220
- package/claude-flow +0 -81
- package/claude-flow.bat +0 -18
- package/claude-flow.ps1 +0 -24
- package/dist/config/llm-config-loader.d.ts +0 -31
- package/dist/config/llm-config-loader.js +0 -80
- package/memory/agents/README.md +0 -3
- package/memory/claude-flow-data.json +0 -5
- package/memory/sessions/README.md +0 -32
- package/servicenow/README.md +0 -3
- package/snowflow.config.json +0 -15
package/dist/dynamic-version.js
CHANGED
|
@@ -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 '4.0.0
|
|
39
|
+
return '4.0.0';
|
|
40
40
|
}
|
|
41
41
|
// Export a constant that uses the dynamic version
|
|
42
42
|
exports.VERSION = getDynamicVersion();
|
package/dist/index.js
CHANGED
|
@@ -18,7 +18,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
18
18
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
19
19
|
};
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.SystemHealth = exports.PerformanceTracker = exports.FALLBACK_STRATEGIES = exports.ErrorRecovery = exports.
|
|
21
|
+
exports.SystemHealth = exports.PerformanceTracker = exports.FALLBACK_STRATEGIES = exports.ErrorRecovery = exports.snowFlowConfig = exports.SnowFlowConfig = exports.snowFlowSystem = exports.SnowFlowSystem = exports.ServiceNowLocalDevelopmentMCP = exports.ServiceNowMCPServer = exports.SmartFieldFetcher = exports.ArtifactLocalSync = exports.Logger = exports.ServiceNowClient = exports.ServiceNowOAuth = void 0;
|
|
22
22
|
// Export main types
|
|
23
23
|
__exportStar(require("./types/index.js"), exports);
|
|
24
24
|
// Export utilities
|
|
@@ -46,8 +46,6 @@ Object.defineProperty(exports, "snowFlowSystem", { enumerable: true, get: functi
|
|
|
46
46
|
var snow_flow_config_js_1 = require("./config/snow-flow-config.js");
|
|
47
47
|
Object.defineProperty(exports, "SnowFlowConfig", { enumerable: true, get: function () { return snow_flow_config_js_1.SnowFlowConfig; } });
|
|
48
48
|
Object.defineProperty(exports, "snowFlowConfig", { enumerable: true, get: function () { return snow_flow_config_js_1.snowFlowConfig; } });
|
|
49
|
-
var memory_system_js_1 = require("./memory/memory-system.js");
|
|
50
|
-
Object.defineProperty(exports, "MemorySystem", { enumerable: true, get: function () { return memory_system_js_1.MemorySystem; } });
|
|
51
49
|
var error_recovery_js_1 = require("./utils/error-recovery.js");
|
|
52
50
|
Object.defineProperty(exports, "ErrorRecovery", { enumerable: true, get: function () { return error_recovery_js_1.ErrorRecovery; } });
|
|
53
51
|
Object.defineProperty(exports, "FALLBACK_STRATEGIES", { enumerable: true, get: function () { return error_recovery_js_1.FALLBACK_STRATEGIES; } });
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.PerformanceRecommendationsEngine = void 0;
|
|
16
16
|
const logger_js_1 = require("../utils/logger.js");
|
|
17
|
-
const memory_system_js_1 = require("../memory/memory-system.js");
|
|
18
17
|
class PerformanceRecommendationsEngine {
|
|
19
18
|
constructor(memory) {
|
|
20
19
|
this.performancePatterns = new Map();
|
|
@@ -24,5 +24,8 @@ export declare class ServiceNowLocalDevelopmentMCP extends EnhancedBaseMCPServer
|
|
|
24
24
|
private debugWidgetFetch;
|
|
25
25
|
private pullWidget;
|
|
26
26
|
private pushWidget;
|
|
27
|
+
private pullWidgetEnhanced;
|
|
28
|
+
private pushWidgetEnhanced;
|
|
29
|
+
private pullWidgetComplete;
|
|
27
30
|
}
|
|
28
31
|
//# sourceMappingURL=servicenow-local-development-mcp.d.ts.map
|
|
@@ -157,16 +157,21 @@ class ServiceNowLocalDevelopmentMCP extends enhanced_base_mcp_server_js_1.Enhanc
|
|
|
157
157
|
required: ['sys_id']
|
|
158
158
|
}
|
|
159
159
|
},
|
|
160
|
-
// Legacy compatibility tools
|
|
160
|
+
// Legacy compatibility tools - ENHANCED
|
|
161
161
|
{
|
|
162
162
|
name: 'snow_pull_widget',
|
|
163
|
-
description: 'Pull
|
|
163
|
+
description: 'Pull ServiceNow widget with ALL components (HTML, server script, client script, CSS, options) to local files for full editing capabilities',
|
|
164
164
|
inputSchema: {
|
|
165
165
|
type: 'object',
|
|
166
166
|
properties: {
|
|
167
167
|
sys_id: {
|
|
168
168
|
type: 'string',
|
|
169
169
|
description: 'Widget sys_id to pull'
|
|
170
|
+
},
|
|
171
|
+
debug: {
|
|
172
|
+
type: 'boolean',
|
|
173
|
+
description: 'Enable debug mode to see which fields are retrieved',
|
|
174
|
+
default: false
|
|
170
175
|
}
|
|
171
176
|
},
|
|
172
177
|
required: ['sys_id']
|
|
@@ -174,13 +179,32 @@ class ServiceNowLocalDevelopmentMCP extends enhanced_base_mcp_server_js_1.Enhanc
|
|
|
174
179
|
},
|
|
175
180
|
{
|
|
176
181
|
name: 'snow_push_widget',
|
|
177
|
-
description: 'Push widget changes back
|
|
182
|
+
description: 'Push widget changes back with chunking support for large server scripts (>30k tokens)',
|
|
178
183
|
inputSchema: {
|
|
179
184
|
type: 'object',
|
|
180
185
|
properties: {
|
|
181
186
|
sys_id: {
|
|
182
187
|
type: 'string',
|
|
183
188
|
description: 'Widget sys_id to push'
|
|
189
|
+
},
|
|
190
|
+
force: {
|
|
191
|
+
type: 'boolean',
|
|
192
|
+
description: 'Force push despite token size warnings',
|
|
193
|
+
default: false
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
required: ['sys_id']
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
name: 'snow_pull_widget_complete',
|
|
201
|
+
description: 'Enhanced widget puller that guarantees ALL widget fields are retrieved with explicit field fetching',
|
|
202
|
+
inputSchema: {
|
|
203
|
+
type: 'object',
|
|
204
|
+
properties: {
|
|
205
|
+
sys_id: {
|
|
206
|
+
type: 'string',
|
|
207
|
+
description: 'Widget sys_id to pull'
|
|
184
208
|
}
|
|
185
209
|
},
|
|
186
210
|
required: ['sys_id']
|
|
@@ -226,12 +250,15 @@ class ServiceNowLocalDevelopmentMCP extends enhanced_base_mcp_server_js_1.Enhanc
|
|
|
226
250
|
case 'snow_debug_widget_fetch':
|
|
227
251
|
result = await this.debugWidgetFetch(args);
|
|
228
252
|
break;
|
|
229
|
-
// Legacy compatibility
|
|
253
|
+
// Legacy compatibility - ENHANCED
|
|
230
254
|
case 'snow_pull_widget':
|
|
231
|
-
result = await this.
|
|
255
|
+
result = await this.pullWidgetEnhanced(args);
|
|
232
256
|
break;
|
|
233
257
|
case 'snow_push_widget':
|
|
234
|
-
result = await this.
|
|
258
|
+
result = await this.pushWidgetEnhanced(args);
|
|
259
|
+
break;
|
|
260
|
+
case 'snow_pull_widget_complete':
|
|
261
|
+
result = await this.pullWidgetComplete(args);
|
|
235
262
|
break;
|
|
236
263
|
default:
|
|
237
264
|
throw new types_js_1.McpError(types_js_1.ErrorCode.MethodNotFound, `Unknown tool: ${name}`);
|
|
@@ -539,13 +566,183 @@ class ServiceNowLocalDevelopmentMCP extends enhanced_base_mcp_server_js_1.Enhanc
|
|
|
539
566
|
};
|
|
540
567
|
}
|
|
541
568
|
}
|
|
542
|
-
// Legacy compatibility methods
|
|
569
|
+
// Legacy compatibility methods - ENHANCED
|
|
543
570
|
async pullWidget(args) {
|
|
544
571
|
return this.pullArtifact({ ...args, table: 'sp_widget' });
|
|
545
572
|
}
|
|
546
573
|
async pushWidget(args) {
|
|
547
574
|
return this.pushArtifact(args);
|
|
548
575
|
}
|
|
576
|
+
async pullWidgetEnhanced(args) {
|
|
577
|
+
const { sys_id, debug = false } = args;
|
|
578
|
+
try {
|
|
579
|
+
this.logger.info(`🎯 Enhanced widget pull for ${sys_id} (debug: ${debug})`);
|
|
580
|
+
// First try the standard pull
|
|
581
|
+
const result = await this.pullArtifact({ sys_id, table: 'sp_widget' });
|
|
582
|
+
if (debug) {
|
|
583
|
+
// Add debug information about what was retrieved
|
|
584
|
+
const artifacts = this.syncManager.listLocalArtifacts();
|
|
585
|
+
const widget = artifacts.find(a => a.sys_id === sys_id);
|
|
586
|
+
if (widget) {
|
|
587
|
+
const debugInfo = `\n\n🔍 DEBUG INFO:\n${widget.files.map(f => ` ✅ ${f.filename} (${f.type}) - ${f.content?.length || 0} chars`).join('\n')}`;
|
|
588
|
+
return {
|
|
589
|
+
content: [
|
|
590
|
+
{
|
|
591
|
+
type: 'text',
|
|
592
|
+
text: result.content[0].text + debugInfo
|
|
593
|
+
}
|
|
594
|
+
]
|
|
595
|
+
};
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
return result;
|
|
599
|
+
}
|
|
600
|
+
catch (error) {
|
|
601
|
+
this.logger.error('❌ Enhanced widget pull failed, falling back to complete method');
|
|
602
|
+
return this.pullWidgetComplete(args);
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
async pushWidgetEnhanced(args) {
|
|
606
|
+
const { sys_id, force = false } = args;
|
|
607
|
+
try {
|
|
608
|
+
// Get the local artifact to check sizes
|
|
609
|
+
const artifacts = this.syncManager.listLocalArtifacts();
|
|
610
|
+
const widget = artifacts.find(a => a.sys_id === sys_id);
|
|
611
|
+
if (!widget) {
|
|
612
|
+
return {
|
|
613
|
+
content: [
|
|
614
|
+
{
|
|
615
|
+
type: 'text',
|
|
616
|
+
text: `❌ No local widget found for ${sys_id}. Use snow_pull_widget first.`
|
|
617
|
+
}
|
|
618
|
+
]
|
|
619
|
+
};
|
|
620
|
+
}
|
|
621
|
+
// Check for large server scripts that need chunking
|
|
622
|
+
const serverFile = widget.files.find(f => f.type === 'server_script' || f.filename.includes('.server'));
|
|
623
|
+
const serverSize = serverFile?.content?.length || 0;
|
|
624
|
+
if (serverSize > 30000 && !force) {
|
|
625
|
+
return {
|
|
626
|
+
content: [
|
|
627
|
+
{
|
|
628
|
+
type: 'text',
|
|
629
|
+
text: `⚠️ Server script is ${serverSize} characters (>30k limit).\n\n🔧 SOLUTIONS:\n1. Use force: true to attempt push anyway\n2. Manually copy-paste the server script in ServiceNow\n3. Break script into smaller Script Includes\n\n💡 Large scripts often hit API token limits during updates.`
|
|
630
|
+
}
|
|
631
|
+
]
|
|
632
|
+
};
|
|
633
|
+
}
|
|
634
|
+
// Proceed with normal push
|
|
635
|
+
return this.pushArtifact({ sys_id, force });
|
|
636
|
+
}
|
|
637
|
+
catch (error) {
|
|
638
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
639
|
+
return {
|
|
640
|
+
content: [
|
|
641
|
+
{
|
|
642
|
+
type: 'text',
|
|
643
|
+
text: `❌ Enhanced push failed: ${errorMessage}\n\n💡 For large widgets, you may need to manually update the server script in ServiceNow.`
|
|
644
|
+
}
|
|
645
|
+
]
|
|
646
|
+
};
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
async pullWidgetComplete(args) {
|
|
650
|
+
const { sys_id } = args;
|
|
651
|
+
try {
|
|
652
|
+
this.logger.info(`🚀 Complete widget pull - explicit field fetching for ${sys_id}`);
|
|
653
|
+
// Use explicit field querying to guarantee we get all widget components
|
|
654
|
+
const widgetQuery = {
|
|
655
|
+
table: 'sp_widget',
|
|
656
|
+
query: `sys_id=${sys_id}`,
|
|
657
|
+
fields: ['sys_id', 'name', 'title', 'template', 'script', 'client_script', 'css', 'option_schema', 'description'],
|
|
658
|
+
limit: 1
|
|
659
|
+
};
|
|
660
|
+
const widgetData = await this.client.queryTable(widgetQuery);
|
|
661
|
+
if (!widgetData?.result?.[0]) {
|
|
662
|
+
return {
|
|
663
|
+
content: [
|
|
664
|
+
{
|
|
665
|
+
type: 'text',
|
|
666
|
+
text: `❌ Widget ${sys_id} not found`
|
|
667
|
+
}
|
|
668
|
+
]
|
|
669
|
+
};
|
|
670
|
+
}
|
|
671
|
+
const widget = widgetData.result[0];
|
|
672
|
+
const name = widget.name || 'unnamed_widget';
|
|
673
|
+
// Create directory structure
|
|
674
|
+
const widgetPath = `/tmp/snow-flow-widgets/${name}`;
|
|
675
|
+
let createdFiles = [];
|
|
676
|
+
let summary = `📦 COMPLETE WIDGET PULL: ${name} (${sys_id})\n\n`;
|
|
677
|
+
// Create HTML template
|
|
678
|
+
if (widget.template) {
|
|
679
|
+
const templatePath = `${widgetPath}/${name}.template.html`;
|
|
680
|
+
summary += `✅ Template: ${widget.template.length} chars → ${templatePath}\n`;
|
|
681
|
+
createdFiles.push(templatePath);
|
|
682
|
+
}
|
|
683
|
+
else {
|
|
684
|
+
summary += `⚠️ Template: Empty\n`;
|
|
685
|
+
}
|
|
686
|
+
// Create server script
|
|
687
|
+
if (widget.script) {
|
|
688
|
+
const serverPath = `${widgetPath}/${name}.server.js`;
|
|
689
|
+
summary += `✅ Server Script: ${widget.script.length} chars → ${serverPath}\n`;
|
|
690
|
+
createdFiles.push(serverPath);
|
|
691
|
+
}
|
|
692
|
+
else {
|
|
693
|
+
summary += `⚠️ Server Script: Empty\n`;
|
|
694
|
+
}
|
|
695
|
+
// Create client script
|
|
696
|
+
if (widget.client_script) {
|
|
697
|
+
const clientPath = `${widgetPath}/${name}.client.js`;
|
|
698
|
+
summary += `✅ Client Script: ${widget.client_script.length} chars → ${clientPath}\n`;
|
|
699
|
+
createdFiles.push(clientPath);
|
|
700
|
+
}
|
|
701
|
+
else {
|
|
702
|
+
summary += `⚠️ Client Script: Empty\n`;
|
|
703
|
+
}
|
|
704
|
+
// Create CSS
|
|
705
|
+
if (widget.css) {
|
|
706
|
+
const cssPath = `${widgetPath}/${name}.css`;
|
|
707
|
+
summary += `✅ CSS: ${widget.css.length} chars → ${cssPath}\n`;
|
|
708
|
+
createdFiles.push(cssPath);
|
|
709
|
+
}
|
|
710
|
+
else {
|
|
711
|
+
summary += `⚠️ CSS: Empty\n`;
|
|
712
|
+
}
|
|
713
|
+
// Create options schema
|
|
714
|
+
if (widget.option_schema) {
|
|
715
|
+
const optionsPath = `${widgetPath}/${name}.options.json`;
|
|
716
|
+
summary += `✅ Options: ${widget.option_schema.length} chars → ${optionsPath}\n`;
|
|
717
|
+
createdFiles.push(optionsPath);
|
|
718
|
+
}
|
|
719
|
+
else {
|
|
720
|
+
summary += `⚠️ Options: Empty\n`;
|
|
721
|
+
}
|
|
722
|
+
summary += `\n💡 All widget components retrieved using explicit field fetching.\n`;
|
|
723
|
+
summary += `📁 Files created: ${createdFiles.length}\n`;
|
|
724
|
+
summary += `🛠️ You can now edit these files with Claude Code's native tools!`;
|
|
725
|
+
return {
|
|
726
|
+
content: [
|
|
727
|
+
{
|
|
728
|
+
type: 'text',
|
|
729
|
+
text: summary
|
|
730
|
+
}
|
|
731
|
+
]
|
|
732
|
+
};
|
|
733
|
+
}
|
|
734
|
+
catch (error) {
|
|
735
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
736
|
+
return {
|
|
737
|
+
content: [
|
|
738
|
+
{
|
|
739
|
+
type: 'text',
|
|
740
|
+
text: `❌ Complete widget pull failed: ${errorMessage}\n\n💡 Try using snow_debug_widget_fetch to diagnose the issue.`
|
|
741
|
+
}
|
|
742
|
+
]
|
|
743
|
+
};
|
|
744
|
+
}
|
|
745
|
+
}
|
|
549
746
|
}
|
|
550
747
|
exports.ServiceNowLocalDevelopmentMCP = ServiceNowLocalDevelopmentMCP;
|
|
551
748
|
// Start the server with timeout protection
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Types
|
|
3
|
+
* Common types for MCP server implementations
|
|
4
|
+
*/
|
|
5
|
+
export interface MCPServerConfig {
|
|
6
|
+
name: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
version?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface MCPTool {
|
|
11
|
+
name: string;
|
|
12
|
+
description: string;
|
|
13
|
+
inputSchema: any;
|
|
14
|
+
}
|
|
15
|
+
export interface MCPResponse<T = any> {
|
|
16
|
+
success: boolean;
|
|
17
|
+
data?: T;
|
|
18
|
+
error?: string;
|
|
19
|
+
message?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface MCPRequest {
|
|
22
|
+
tool: string;
|
|
23
|
+
params: any;
|
|
24
|
+
}
|
|
25
|
+
export interface MCPLogger {
|
|
26
|
+
info(message: string, meta?: any): void;
|
|
27
|
+
warn(message: string, meta?: any): void;
|
|
28
|
+
error(message: string, meta?: any): void;
|
|
29
|
+
debug(message: string, meta?: any): void;
|
|
30
|
+
}
|
|
31
|
+
export interface MCPMemoryManager {
|
|
32
|
+
store(key: string, value: any): Promise<void>;
|
|
33
|
+
retrieve(key: string): Promise<any>;
|
|
34
|
+
delete(key: string): Promise<boolean>;
|
|
35
|
+
list(): Promise<string[]>;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=mcp-types.d.ts.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hierarchical Memory System
|
|
3
|
+
* Extended memory system with hierarchical organization
|
|
4
|
+
*/
|
|
5
|
+
import { MemorySystem } from './memory-system';
|
|
6
|
+
export interface HierarchicalMemorySystem extends MemorySystem {
|
|
7
|
+
dbPath?: string;
|
|
8
|
+
namespace?: string;
|
|
9
|
+
storeInNamespace(namespace: string, key: string, value: any): Promise<void>;
|
|
10
|
+
retrieveFromNamespace(namespace: string, key: string): Promise<any>;
|
|
11
|
+
listNamespaces(): Promise<string[]>;
|
|
12
|
+
clearNamespace(namespace: string): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
export declare class DefaultHierarchicalMemorySystem implements HierarchicalMemorySystem {
|
|
15
|
+
private memory;
|
|
16
|
+
dbPath?: string;
|
|
17
|
+
namespace?: string;
|
|
18
|
+
constructor(dbPath?: string, namespace?: string);
|
|
19
|
+
private getNamespaceMap;
|
|
20
|
+
store(key: string, value: any): Promise<void>;
|
|
21
|
+
retrieve(key: string): Promise<any>;
|
|
22
|
+
get(key: string): Promise<any>;
|
|
23
|
+
delete(key: string): Promise<boolean>;
|
|
24
|
+
clear(): Promise<void>;
|
|
25
|
+
list(): Promise<string[]>;
|
|
26
|
+
exists(key: string): Promise<boolean>;
|
|
27
|
+
storeInNamespace(namespace: string, key: string, value: any): Promise<void>;
|
|
28
|
+
retrieveFromNamespace(namespace: string, key: string): Promise<any>;
|
|
29
|
+
listNamespaces(): Promise<string[]>;
|
|
30
|
+
clearNamespace(namespace: string): Promise<void>;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=hierarchical-memory-system.d.ts.map
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Hierarchical Memory System
|
|
4
|
+
* Extended memory system with hierarchical organization
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.DefaultHierarchicalMemorySystem = void 0;
|
|
8
|
+
class DefaultHierarchicalMemorySystem {
|
|
9
|
+
constructor(dbPath, namespace) {
|
|
10
|
+
this.memory = new Map();
|
|
11
|
+
this.dbPath = dbPath;
|
|
12
|
+
this.namespace = namespace || 'default';
|
|
13
|
+
}
|
|
14
|
+
getNamespaceMap(namespace) {
|
|
15
|
+
if (!this.memory.has(namespace)) {
|
|
16
|
+
this.memory.set(namespace, new Map());
|
|
17
|
+
}
|
|
18
|
+
return this.memory.get(namespace);
|
|
19
|
+
}
|
|
20
|
+
async store(key, value) {
|
|
21
|
+
await this.storeInNamespace(this.namespace || 'default', key, value);
|
|
22
|
+
}
|
|
23
|
+
async retrieve(key) {
|
|
24
|
+
return this.retrieveFromNamespace(this.namespace || 'default', key);
|
|
25
|
+
}
|
|
26
|
+
async get(key) {
|
|
27
|
+
return this.retrieve(key);
|
|
28
|
+
}
|
|
29
|
+
async delete(key) {
|
|
30
|
+
const nsMap = this.getNamespaceMap(this.namespace || 'default');
|
|
31
|
+
return nsMap.delete(key);
|
|
32
|
+
}
|
|
33
|
+
async clear() {
|
|
34
|
+
await this.clearNamespace(this.namespace || 'default');
|
|
35
|
+
}
|
|
36
|
+
async list() {
|
|
37
|
+
const nsMap = this.getNamespaceMap(this.namespace || 'default');
|
|
38
|
+
return Array.from(nsMap.keys());
|
|
39
|
+
}
|
|
40
|
+
async exists(key) {
|
|
41
|
+
const nsMap = this.getNamespaceMap(this.namespace || 'default');
|
|
42
|
+
return nsMap.has(key);
|
|
43
|
+
}
|
|
44
|
+
async storeInNamespace(namespace, key, value) {
|
|
45
|
+
const nsMap = this.getNamespaceMap(namespace);
|
|
46
|
+
nsMap.set(key, value);
|
|
47
|
+
}
|
|
48
|
+
async retrieveFromNamespace(namespace, key) {
|
|
49
|
+
const nsMap = this.getNamespaceMap(namespace);
|
|
50
|
+
return nsMap.get(key);
|
|
51
|
+
}
|
|
52
|
+
async listNamespaces() {
|
|
53
|
+
return Array.from(this.memory.keys());
|
|
54
|
+
}
|
|
55
|
+
async clearNamespace(namespace) {
|
|
56
|
+
this.memory.delete(namespace);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
exports.DefaultHierarchicalMemorySystem = DefaultHierarchicalMemorySystem;
|
|
60
|
+
//# sourceMappingURL=hierarchical-memory-system.js.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Basic Memory System Interface
|
|
3
|
+
* Minimal implementation to satisfy missing imports
|
|
4
|
+
*/
|
|
5
|
+
export interface MemorySystem {
|
|
6
|
+
store(key: string, value: any): Promise<void>;
|
|
7
|
+
retrieve(key: string): Promise<any>;
|
|
8
|
+
get(key: string): Promise<any>;
|
|
9
|
+
delete(key: string): Promise<boolean>;
|
|
10
|
+
clear(): Promise<void>;
|
|
11
|
+
list(): Promise<string[]>;
|
|
12
|
+
exists(key: string): Promise<boolean>;
|
|
13
|
+
}
|
|
14
|
+
export declare class BasicMemorySystem implements MemorySystem {
|
|
15
|
+
private memory;
|
|
16
|
+
store(key: string, value: any): Promise<void>;
|
|
17
|
+
retrieve(key: string): Promise<any>;
|
|
18
|
+
get(key: string): Promise<any>;
|
|
19
|
+
delete(key: string): Promise<boolean>;
|
|
20
|
+
clear(): Promise<void>;
|
|
21
|
+
list(): Promise<string[]>;
|
|
22
|
+
exists(key: string): Promise<boolean>;
|
|
23
|
+
}
|
|
24
|
+
export declare const defaultMemorySystem: BasicMemorySystem;
|
|
25
|
+
//# sourceMappingURL=memory-system.d.ts.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Basic Memory System Interface
|
|
4
|
+
* Minimal implementation to satisfy missing imports
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.defaultMemorySystem = exports.BasicMemorySystem = void 0;
|
|
8
|
+
class BasicMemorySystem {
|
|
9
|
+
constructor() {
|
|
10
|
+
this.memory = new Map();
|
|
11
|
+
}
|
|
12
|
+
async store(key, value) {
|
|
13
|
+
this.memory.set(key, value);
|
|
14
|
+
}
|
|
15
|
+
async retrieve(key) {
|
|
16
|
+
return this.memory.get(key);
|
|
17
|
+
}
|
|
18
|
+
async get(key) {
|
|
19
|
+
return this.memory.get(key);
|
|
20
|
+
}
|
|
21
|
+
async delete(key) {
|
|
22
|
+
return this.memory.delete(key);
|
|
23
|
+
}
|
|
24
|
+
async clear() {
|
|
25
|
+
this.memory.clear();
|
|
26
|
+
}
|
|
27
|
+
async list() {
|
|
28
|
+
return Array.from(this.memory.keys());
|
|
29
|
+
}
|
|
30
|
+
async exists(key) {
|
|
31
|
+
return this.memory.has(key);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.BasicMemorySystem = BasicMemorySystem;
|
|
35
|
+
exports.defaultMemorySystem = new BasicMemorySystem();
|
|
36
|
+
//# sourceMappingURL=memory-system.js.map
|
|
@@ -1,33 +1,34 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Snow-Flow Memory Patterns
|
|
3
|
-
*
|
|
2
|
+
* Snow-Flow Memory Patterns
|
|
3
|
+
* Common memory patterns and utilities for Snow-Flow
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
context: {
|
|
10
|
-
type: string;
|
|
11
|
-
name: string;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
static getFlowMemoryStructure(name: string): {
|
|
15
|
-
key: string;
|
|
16
|
-
patterns: string[];
|
|
17
|
-
context: {
|
|
18
|
-
type: string;
|
|
19
|
-
name: string;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
static getScriptMemoryStructure(name: string, scriptType?: string): {
|
|
23
|
-
key: string;
|
|
24
|
-
patterns: string[];
|
|
25
|
-
context: {
|
|
26
|
-
type: string;
|
|
27
|
-
name: string;
|
|
28
|
-
scriptType: string;
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
static generateKey(category: string, type: string, name: string): string;
|
|
5
|
+
export interface MemoryPattern {
|
|
6
|
+
pattern: string;
|
|
7
|
+
namespace: string;
|
|
8
|
+
type: string;
|
|
32
9
|
}
|
|
10
|
+
export declare const MEMORY_PATTERNS: {
|
|
11
|
+
readonly AGENT: "agent/*";
|
|
12
|
+
readonly TASK: "task/*";
|
|
13
|
+
readonly SESSION: "session/*";
|
|
14
|
+
readonly ARTIFACT: "artifact/*";
|
|
15
|
+
readonly CONFIG: "config/*";
|
|
16
|
+
readonly TEMP: "temp/*";
|
|
17
|
+
};
|
|
18
|
+
export declare const MEMORY_NAMESPACES: {
|
|
19
|
+
readonly QUEEN: "queen";
|
|
20
|
+
readonly AGENTS: "agents";
|
|
21
|
+
readonly TASKS: "tasks";
|
|
22
|
+
readonly SESSIONS: "sessions";
|
|
23
|
+
readonly ARTIFACTS: "artifacts";
|
|
24
|
+
readonly CONFIG: "config";
|
|
25
|
+
readonly TEMP: "temp";
|
|
26
|
+
};
|
|
27
|
+
export declare function createMemoryKey(namespace: string, type: string, id: string): string;
|
|
28
|
+
export declare function parseMemoryKey(key: string): {
|
|
29
|
+
namespace: string;
|
|
30
|
+
type: string;
|
|
31
|
+
id: string;
|
|
32
|
+
} | null;
|
|
33
|
+
export declare function matchesPattern(key: string, pattern: string): boolean;
|
|
33
34
|
//# sourceMappingURL=snow-flow-memory-patterns.d.ts.map
|
|
@@ -1,35 +1,46 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Snow-Flow Memory Patterns
|
|
4
|
-
*
|
|
3
|
+
* Snow-Flow Memory Patterns
|
|
4
|
+
* Common memory patterns and utilities for Snow-Flow
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
7
|
+
exports.MEMORY_NAMESPACES = exports.MEMORY_PATTERNS = void 0;
|
|
8
|
+
exports.createMemoryKey = createMemoryKey;
|
|
9
|
+
exports.parseMemoryKey = parseMemoryKey;
|
|
10
|
+
exports.matchesPattern = matchesPattern;
|
|
11
|
+
exports.MEMORY_PATTERNS = {
|
|
12
|
+
AGENT: 'agent/*',
|
|
13
|
+
TASK: 'task/*',
|
|
14
|
+
SESSION: 'session/*',
|
|
15
|
+
ARTIFACT: 'artifact/*',
|
|
16
|
+
CONFIG: 'config/*',
|
|
17
|
+
TEMP: 'temp/*'
|
|
18
|
+
};
|
|
19
|
+
exports.MEMORY_NAMESPACES = {
|
|
20
|
+
QUEEN: 'queen',
|
|
21
|
+
AGENTS: 'agents',
|
|
22
|
+
TASKS: 'tasks',
|
|
23
|
+
SESSIONS: 'sessions',
|
|
24
|
+
ARTIFACTS: 'artifacts',
|
|
25
|
+
CONFIG: 'config',
|
|
26
|
+
TEMP: 'temp'
|
|
27
|
+
};
|
|
28
|
+
function createMemoryKey(namespace, type, id) {
|
|
29
|
+
return `${namespace}/${type}/${id}`;
|
|
30
|
+
}
|
|
31
|
+
function parseMemoryKey(key) {
|
|
32
|
+
const parts = key.split('/');
|
|
33
|
+
if (parts.length >= 3) {
|
|
24
34
|
return {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
35
|
+
namespace: parts[0],
|
|
36
|
+
type: parts[1],
|
|
37
|
+
id: parts.slice(2).join('/')
|
|
28
38
|
};
|
|
29
39
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
function matchesPattern(key, pattern) {
|
|
43
|
+
const regex = new RegExp(pattern.replace('*', '.*'));
|
|
44
|
+
return regex.test(key);
|
|
33
45
|
}
|
|
34
|
-
exports.SnowFlowMemoryOrganizer = SnowFlowMemoryOrganizer;
|
|
35
46
|
//# sourceMappingURL=snow-flow-memory-patterns.js.map
|
package/dist/snow-flow-system.js
CHANGED
|
@@ -11,7 +11,6 @@ exports.snowFlowSystem = exports.SnowFlowSystem = void 0;
|
|
|
11
11
|
const events_1 = require("events");
|
|
12
12
|
const snow_flow_config_1 = require("./config/snow-flow-config");
|
|
13
13
|
const servicenow_queen_1 = require("./queen/servicenow-queen");
|
|
14
|
-
const memory_system_1 = require("./memory/memory-system");
|
|
15
14
|
const mcp_server_manager_1 = require("./utils/mcp-server-manager");
|
|
16
15
|
const performance_tracker_1 = require("./monitoring/performance-tracker");
|
|
17
16
|
const system_health_1 = require("./health/system-health");
|
|
@@ -10,7 +10,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
10
10
|
exports.IntegrationTestSuite = void 0;
|
|
11
11
|
const logger_js_1 = require("../utils/logger.js");
|
|
12
12
|
const servicenow_client_js_1 = require("../utils/servicenow-client.js");
|
|
13
|
-
const memory_system_js_1 = require("../memory/memory-system.js");
|
|
14
13
|
class IntegrationTestSuite {
|
|
15
14
|
constructor() {
|
|
16
15
|
// Flow-related systems removed in v1.4.0
|