snow-flow 4.2.0 → 4.2.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/README.md +186 -554
- package/cloudbuild-npm.yaml +132 -0
- package/cloudbuild-website.yaml +92 -0
- package/cloudbuild.yaml +141 -0
- package/dist/agent/interactive.d.ts +11 -0
- package/dist/agent/interactive.js +190 -0
- package/dist/agent/session.d.ts +12 -0
- package/dist/agent/session.js +106 -0
- package/dist/cli/auth.d.ts +3 -0
- package/dist/cli/auth.js +59 -0
- package/dist/cli/session.d.ts +3 -0
- package/dist/cli/session.js +46 -0
- package/dist/cli.js +81 -0
- package/dist/config/llm-config-loader.d.ts +45 -0
- package/dist/config/llm-config-loader.js +49 -0
- package/dist/index.js +1 -3
- package/dist/intelligence/performance-recommendations-engine.js +0 -1
- package/dist/llm/keys.d.ts +5 -0
- package/dist/llm/keys.js +29 -0
- package/dist/llm/providers.d.ts +11 -0
- package/dist/llm/providers.js +77 -0
- package/dist/mcp/advanced/servicenow-advanced-features-mcp.js +12 -12
- package/dist/mcp/bridge.d.ts +10 -0
- package/dist/mcp/bridge.js +31 -0
- package/dist/mcp/servicenow-development-assistant-mcp.js +1 -1
- package/dist/mcp/servicenow-machine-learning-mcp.js +2 -2
- package/dist/mcp/servicenow-reporting-analytics-mcp.js +1 -1
- package/dist/mcp/shared/mcp-types.d.ts +37 -0
- package/dist/mcp/shared/mcp-types.js +7 -0
- package/dist/mcp/shared/response-limiter.js +1 -1
- package/dist/memory/hierarchical-memory-system.d.ts +42 -0
- package/dist/memory/hierarchical-memory-system.js +60 -0
- package/dist/memory/memory-system.d.ts +34 -0
- package/dist/memory/memory-system.js +36 -0
- package/dist/memory/snow-flow-memory-patterns.d.ts +47 -28
- package/dist/memory/snow-flow-memory-patterns.js +46 -25
- package/dist/session/store.d.ts +47 -0
- package/dist/session/store.js +74 -0
- 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/artifact-sync/artifact-registry.js +11 -11
- package/dist/utils/chunking-manager.d.ts +39 -0
- package/dist/utils/chunking-manager.js +143 -0
- package/dist/utils/smart-field-fetcher.js +11 -9
- package/package.json +3 -3
- package/website/Dockerfile +3 -2
- package/website/cloudbuild.yaml +4 -3
- package/website/complete-mcp-reference.html +1040 -0
- package/website/components/hero/Hero.html +9 -9
- package/website/components/hero/Hero.jsx +3 -3
- package/website/css/button-contrast-fixes.css +133 -0
- package/website/css/button-fixes.css +49 -0
- package/website/css/enterprise-section-update.css +38 -0
- package/website/css/font-standardization.css +54 -0
- package/website/css/footer-hero-styling.css +73 -0
- package/website/css/hero-compact-spacing.css +60 -0
- package/website/css/hero-contrast-fixes.css +195 -0
- package/website/css/hero-inspired-design.css +135 -0
- package/website/css/hero-size-optimization.css +146 -0
- package/website/css/hero-spacing-improvements.css +139 -0
- package/website/css/hero-stats-visibility.css +98 -0
- package/website/css/mobile-hero-fix.css +215 -0
- package/website/css/navbar-hero-styling.css +70 -0
- package/website/css/reference-text-contrast.css +101 -0
- package/website/css/scroll-overlap-nuclear-fix.css +127 -0
- package/website/css/section-layering-fix.css +85 -0
- package/website/css/style.css +37 -10
- package/website/css/title-layout-fix.css +58 -0
- package/website/css/ultimate-overlap-fix.css +101 -0
- package/website/css/website-hero-consistency.css +101 -0
- package/website/enterprise-features.html +147 -0
- package/website/index.html +268 -43
- package/website/js/animations.js +20 -23
- package/website/js/main.js +73 -7
- package/website/mcp-reference-link.html +16 -0
- package/website/mcp-servers.html +2 -2
- package/website/tools.js +125 -6
- package/website/what-is-snow-flow-section.html +142 -0
- package/assets/logo.txt +0 -8
- package/assets/snow-flow-logo.svg +0 -51
|
@@ -1826,7 +1826,7 @@ class ServiceNowAdvancedFeaturesMCP extends base_mcp_server_js_1.BaseMCPServer {
|
|
|
1826
1826
|
params: {
|
|
1827
1827
|
sysparm_query: `name=${tableName}^internal_type=reference`,
|
|
1828
1828
|
sysparm_fields: 'element,column_label,reference,reference.name,reference.label,mandatory,active',
|
|
1829
|
-
sysparm_limit:
|
|
1829
|
+
sysparm_limit: 100000 // Remove artificial limit
|
|
1830
1830
|
}
|
|
1831
1831
|
});
|
|
1832
1832
|
for (const field of response.result) {
|
|
@@ -1872,7 +1872,7 @@ class ServiceNowAdvancedFeaturesMCP extends base_mcp_server_js_1.BaseMCPServer {
|
|
|
1872
1872
|
params: {
|
|
1873
1873
|
sysparm_query: `reference=${tableName}^internal_type=reference`,
|
|
1874
1874
|
sysparm_fields: 'name,element,column_label,mandatory,active',
|
|
1875
|
-
sysparm_limit:
|
|
1875
|
+
sysparm_limit: 100000 // Remove artificial limit
|
|
1876
1876
|
}
|
|
1877
1877
|
});
|
|
1878
1878
|
// Group by table
|
|
@@ -2335,7 +2335,7 @@ class ServiceNowAdvancedFeaturesMCP extends base_mcp_server_js_1.BaseMCPServer {
|
|
|
2335
2335
|
params: {
|
|
2336
2336
|
sysparm_query: `name=${tableName}^ORname=${tableName}.parent`,
|
|
2337
2337
|
sysparm_fields: 'element,column_label,internal_type,max_length,mandatory,unique,reference',
|
|
2338
|
-
sysparm_limit:
|
|
2338
|
+
sysparm_limit: 100000 // Remove artificial limit
|
|
2339
2339
|
}
|
|
2340
2340
|
});
|
|
2341
2341
|
const schema = {
|
|
@@ -2868,7 +2868,7 @@ class ServiceNowAdvancedFeaturesMCP extends base_mcp_server_js_1.BaseMCPServer {
|
|
|
2868
2868
|
params: {
|
|
2869
2869
|
sysparm_query: query,
|
|
2870
2870
|
sysparm_fields: 'element,column_label,internal_type,mandatory,max_length,read_only,display',
|
|
2871
|
-
sysparm_limit:
|
|
2871
|
+
sysparm_limit: 100000 // Remove artificial limit
|
|
2872
2872
|
}
|
|
2873
2873
|
});
|
|
2874
2874
|
return response.result || [];
|
|
@@ -3523,7 +3523,7 @@ class ServiceNowAdvancedFeaturesMCP extends base_mcp_server_js_1.BaseMCPServer {
|
|
|
3523
3523
|
params: {
|
|
3524
3524
|
sysparm_query: `name=${tableName}^active=true`,
|
|
3525
3525
|
sysparm_fields: 'element,column_label,internal_type,max_length,mandatory,read_only,reference,default_value,unique,primary',
|
|
3526
|
-
sysparm_limit:
|
|
3526
|
+
sysparm_limit: 100000 // Remove artificial limit
|
|
3527
3527
|
}
|
|
3528
3528
|
});
|
|
3529
3529
|
const fields = fieldsResponse.result.map((field) => ({
|
|
@@ -4553,7 +4553,7 @@ WHERE ${m.target_field} IS NULL;`).join('\n')}`;
|
|
|
4553
4553
|
params: {
|
|
4554
4554
|
sysparm_query: `name=${tableName}^active=true`,
|
|
4555
4555
|
sysparm_fields: 'element,column_label,internal_type,max_length,mandatory,read_only,reference,default_value,unique,primary,virtual,calculated,formula,depends_on,choice,dependent_on_field,spell_check',
|
|
4556
|
-
sysparm_limit:
|
|
4556
|
+
sysparm_limit: 100000 // Remove artificial limit
|
|
4557
4557
|
}
|
|
4558
4558
|
});
|
|
4559
4559
|
// Get record count and basic stats
|
|
@@ -4673,7 +4673,7 @@ WHERE ${m.target_field} IS NULL;`).join('\n')}`;
|
|
|
4673
4673
|
params: {
|
|
4674
4674
|
sysparm_query: `name=${tableName}^active=true`,
|
|
4675
4675
|
sysparm_fields: 'element,internal_type,mandatory,max_length,reference',
|
|
4676
|
-
sysparm_limit:
|
|
4676
|
+
sysparm_limit: 100000 // Remove artificial limit
|
|
4677
4677
|
}
|
|
4678
4678
|
});
|
|
4679
4679
|
const fields = schemaResponse.result;
|
|
@@ -10152,7 +10152,7 @@ function getIncidentsByUser(userSysId) {
|
|
|
10152
10152
|
params: {
|
|
10153
10153
|
sysparm_query: auditQuery,
|
|
10154
10154
|
sysparm_fields: 'tablename,fieldname,oldvalue,newvalue,sys_created_on,sys_created_by,documentkey',
|
|
10155
|
-
sysparm_limit:
|
|
10155
|
+
sysparm_limit: 100000 // Remove artificial limit
|
|
10156
10156
|
}
|
|
10157
10157
|
});
|
|
10158
10158
|
if (auditResult.success && auditResult.result?.result) {
|
|
@@ -10201,7 +10201,7 @@ function getIncidentsByUser(userSysId) {
|
|
|
10201
10201
|
params: {
|
|
10202
10202
|
sysparm_query: workflowQuery,
|
|
10203
10203
|
sysparm_fields: 'context,workflow_version,state,started,sys_created_on,sys_created_by',
|
|
10204
|
-
sysparm_limit:
|
|
10204
|
+
sysparm_limit: 100000 // Remove artificial 10k limit0 // Remove artificial 2k limit
|
|
10205
10205
|
}
|
|
10206
10206
|
});
|
|
10207
10207
|
if (workflowResult.success && workflowResult.result?.result) {
|
|
@@ -11109,7 +11109,7 @@ function getIncidentsByUser(userSysId) {
|
|
|
11109
11109
|
params: {
|
|
11110
11110
|
sysparm_query: query,
|
|
11111
11111
|
sysparm_fields: 'sys_id,name,description,table,condition,active,category,workflow_version,published',
|
|
11112
|
-
sysparm_limit:
|
|
11112
|
+
sysparm_limit: 100000 // Remove artificial limit
|
|
11113
11113
|
}
|
|
11114
11114
|
});
|
|
11115
11115
|
if (workflowResult.success && workflowResult.result?.result) {
|
|
@@ -11227,7 +11227,7 @@ function getIncidentsByUser(userSysId) {
|
|
|
11227
11227
|
params: {
|
|
11228
11228
|
sysparm_query: executionQuery,
|
|
11229
11229
|
sysparm_fields: 'sys_id,workflow_version,context,state,started,ended,duration,priority,sys_created_on,sys_created_by',
|
|
11230
|
-
sysparm_limit:
|
|
11230
|
+
sysparm_limit: 100000 // Remove artificial limit0
|
|
11231
11231
|
}
|
|
11232
11232
|
});
|
|
11233
11233
|
if (executionsResult.success && executionsResult.result?.result) {
|
|
@@ -11248,7 +11248,7 @@ function getIncidentsByUser(userSysId) {
|
|
|
11248
11248
|
params: {
|
|
11249
11249
|
sysparm_query: executionQuery.replace('wf_executing', 'wf_history'),
|
|
11250
11250
|
sysparm_fields: 'sys_id,workflow_version,context,state,started,ended,duration,result',
|
|
11251
|
-
sysparm_limit:
|
|
11251
|
+
sysparm_limit: 100000 // Remove artificial limit
|
|
11252
11252
|
}
|
|
11253
11253
|
});
|
|
11254
11254
|
if (historyResult.success && historyResult.result?.result) {
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Minimal MCP bridge placeholder. We will hook this into AI SDK tools in a next step.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.loadMCPTools = loadMCPTools;
|
|
5
|
+
async function loadMCPTools(start) {
|
|
6
|
+
// Prefer using AI SDK's experimental MCP client to yield ready-to-use Tool[]
|
|
7
|
+
try {
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
9
|
+
const { experimental_createMCPClient } = require('ai');
|
|
10
|
+
// Use SDK-provided stdio transport
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
12
|
+
const { StdioClientTransport } = require('@modelcontextprotocol/sdk/client/stdio');
|
|
13
|
+
const client = await experimental_createMCPClient({
|
|
14
|
+
name: 'snow-flow',
|
|
15
|
+
transport: new StdioClientTransport({
|
|
16
|
+
command: start.cmd,
|
|
17
|
+
args: start.args ?? [],
|
|
18
|
+
env: start.env ?? {},
|
|
19
|
+
}),
|
|
20
|
+
});
|
|
21
|
+
const tools = await client.tools();
|
|
22
|
+
return { tools, close: client.close };
|
|
23
|
+
}
|
|
24
|
+
catch (err) {
|
|
25
|
+
// Fallback: no AI SDK available, return empty tools and noop close but with a hint.
|
|
26
|
+
const hint = 'AI SDK MCP bridge not available. Install "ai" or verify version to enable MCP tools.';
|
|
27
|
+
console.warn(`[snow-flow] ${hint}`);
|
|
28
|
+
return { tools: [], close: async () => { } };
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=bridge.js.map
|
|
@@ -2131,7 +2131,7 @@ class ServiceNowDevelopmentAssistantMCP {
|
|
|
2131
2131
|
// Estimate token count (rough estimate: 1 token ≈ 4 characters)
|
|
2132
2132
|
const jsonString = JSON.stringify(formattedArtifact, null, 2);
|
|
2133
2133
|
const estimatedTokens = Math.ceil(jsonString.length / 4);
|
|
2134
|
-
const maxTokens =
|
|
2134
|
+
const maxTokens = 200000; // Claude's actual context window limit
|
|
2135
2135
|
let responseText;
|
|
2136
2136
|
if (estimatedTokens > maxTokens) {
|
|
2137
2137
|
// Response too large - return essential fields only and suggest specific field access
|
|
@@ -2157,7 +2157,7 @@ class ServiceNowMachineLearningMCP {
|
|
|
2157
2157
|
startDate.setDate(startDate.getDate() - days);
|
|
2158
2158
|
const queryParams = {
|
|
2159
2159
|
sysparm_query: `sys_created_on>=${startDate.toISOString()}^sys_created_on<=${endDate.toISOString()}`,
|
|
2160
|
-
sysparm_limit:
|
|
2160
|
+
sysparm_limit: 100000
|
|
2161
2161
|
};
|
|
2162
2162
|
let tableName = '';
|
|
2163
2163
|
switch (metricType) {
|
|
@@ -2689,7 +2689,7 @@ class ServiceNowMachineLearningMCP {
|
|
|
2689
2689
|
sysparm_breakdown: breakdown || '',
|
|
2690
2690
|
sysparm_from: new Date(Date.now() - 90 * 24 * 60 * 60 * 1000).toISOString().split('T')[0],
|
|
2691
2691
|
sysparm_to: new Date().toISOString().split('T')[0],
|
|
2692
|
-
sysparm_limit:
|
|
2692
|
+
sysparm_limit: 100000
|
|
2693
2693
|
});
|
|
2694
2694
|
return {
|
|
2695
2695
|
content: [{
|
|
@@ -1124,7 +1124,7 @@ class ServiceNowReportingAnalyticsMCP {
|
|
|
1124
1124
|
}
|
|
1125
1125
|
async getReportData(report, maxRows) {
|
|
1126
1126
|
// Simulate getting report data
|
|
1127
|
-
const limit = maxRows ||
|
|
1127
|
+
const limit = maxRows || 100000; // Remove artificial 1k limit
|
|
1128
1128
|
const data = await this.client.searchRecords(report.table, report.conditions || '', limit);
|
|
1129
1129
|
return data.success ? data.data.result : [];
|
|
1130
1130
|
}
|
|
@@ -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
|
|
@@ -112,5 +112,5 @@ exports.ResponseLimiter = ResponseLimiter;
|
|
|
112
112
|
// Configurable via environment variable, default to 500KB (reasonable for widgets/flows)
|
|
113
113
|
ResponseLimiter.MAX_RESPONSE_SIZE = parseInt(process.env.MCP_MAX_RESPONSE_SIZE || '500000'); // 500KB default
|
|
114
114
|
ResponseLimiter.MAX_ARRAY_ITEMS = parseInt(process.env.MCP_MAX_ARRAY_ITEMS || '500'); // 500 items default
|
|
115
|
-
ResponseLimiter.MAX_TOKEN_ESTIMATE =
|
|
115
|
+
ResponseLimiter.MAX_TOKEN_ESTIMATE = 200000; // Claude's actual 200k context window
|
|
116
116
|
//# sourceMappingURL=response-limiter.js.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hierarchical Memory System
|
|
3
|
+
* Extended memory system with hierarchical organization
|
|
4
|
+
*/
|
|
5
|
+
import { MemorySystem } from './memory-system.js';
|
|
6
|
+
export interface HierarchicalMemorySystem extends MemorySystem {
|
|
7
|
+
dbPath?: string;
|
|
8
|
+
namespace?: string;
|
|
9
|
+
cache?: any;
|
|
10
|
+
ttl?: number;
|
|
11
|
+
storeInNamespace(namespace: string, key: string, value: any): Promise<void>;
|
|
12
|
+
retrieveFromNamespace(namespace: string, key: string): Promise<any>;
|
|
13
|
+
listNamespaces(): Promise<string[]>;
|
|
14
|
+
clearNamespace(namespace: string): Promise<void>;
|
|
15
|
+
storeHierarchical?(path: string, data: any): Promise<void>;
|
|
16
|
+
getHierarchical?(path: string): Promise<any>;
|
|
17
|
+
search?(pattern: string): Promise<any[]>;
|
|
18
|
+
getAgentMemory?(agentId: string): Promise<any>;
|
|
19
|
+
trackAccessPattern?(key: string): Promise<void>;
|
|
20
|
+
createRelationship?(from: string, to: string, type: string): Promise<void>;
|
|
21
|
+
getNamespaceStats?(namespace: string): Promise<any>;
|
|
22
|
+
cleanupExpired?(): Promise<void>;
|
|
23
|
+
}
|
|
24
|
+
export declare class DefaultHierarchicalMemorySystem implements HierarchicalMemorySystem {
|
|
25
|
+
private memory;
|
|
26
|
+
dbPath?: string;
|
|
27
|
+
namespace?: string;
|
|
28
|
+
constructor(dbPath?: string, namespace?: string);
|
|
29
|
+
private getNamespaceMap;
|
|
30
|
+
store(key: string, value: any): Promise<void>;
|
|
31
|
+
retrieve(key: string): Promise<any>;
|
|
32
|
+
get(key: string): Promise<any>;
|
|
33
|
+
delete(key: string): Promise<boolean>;
|
|
34
|
+
clear(): Promise<void>;
|
|
35
|
+
list(): Promise<string[]>;
|
|
36
|
+
exists(key: string): Promise<boolean>;
|
|
37
|
+
storeInNamespace(namespace: string, key: string, value: any): Promise<void>;
|
|
38
|
+
retrieveFromNamespace(namespace: string, key: string): Promise<any>;
|
|
39
|
+
listNamespaces(): Promise<string[]>;
|
|
40
|
+
clearNamespace(namespace: string): Promise<void>;
|
|
41
|
+
}
|
|
42
|
+
//# 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,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Basic Memory System Interface
|
|
3
|
+
* Minimal implementation to satisfy missing imports
|
|
4
|
+
*/
|
|
5
|
+
export interface MemorySystem {
|
|
6
|
+
store(key: string, value: any, ttl?: number): 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
|
+
query?(query: string): Promise<any[]>;
|
|
14
|
+
execute?(sql: string): Promise<any>;
|
|
15
|
+
insert?(table: string, data: any): Promise<any>;
|
|
16
|
+
getDatabaseStats?(): Promise<any>;
|
|
17
|
+
getCacheStats?(): Promise<any>;
|
|
18
|
+
initialize?(): Promise<void>;
|
|
19
|
+
close?(): Promise<void>;
|
|
20
|
+
invalidateCache?(key: string): Promise<void>;
|
|
21
|
+
createEmergencyBackup?(): Promise<string>;
|
|
22
|
+
}
|
|
23
|
+
export declare class BasicMemorySystem implements MemorySystem {
|
|
24
|
+
private memory;
|
|
25
|
+
store(key: string, value: any, ttl?: number): Promise<void>;
|
|
26
|
+
retrieve(key: string): Promise<any>;
|
|
27
|
+
get(key: string): Promise<any>;
|
|
28
|
+
delete(key: string): Promise<boolean>;
|
|
29
|
+
clear(): Promise<void>;
|
|
30
|
+
list(): Promise<string[]>;
|
|
31
|
+
exists(key: string): Promise<boolean>;
|
|
32
|
+
}
|
|
33
|
+
export declare const defaultMemorySystem: BasicMemorySystem;
|
|
34
|
+
//# 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, ttl) {
|
|
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,52 @@
|
|
|
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 interface MemoryPattern {
|
|
6
|
+
pattern: string;
|
|
7
|
+
namespace: string;
|
|
8
|
+
type: string;
|
|
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;
|
|
5
34
|
export declare class SnowFlowMemoryOrganizer {
|
|
6
|
-
static
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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;
|
|
35
|
+
static organize(data: any): any;
|
|
36
|
+
}
|
|
37
|
+
export declare const SNOW_FLOW_AGENT_CAPABILITIES: {
|
|
38
|
+
RESEARCHER: string;
|
|
39
|
+
CODER: string;
|
|
40
|
+
ANALYST: string;
|
|
41
|
+
};
|
|
42
|
+
export interface HierarchicalMemoryEntry {
|
|
43
|
+
key: string;
|
|
44
|
+
value: any;
|
|
45
|
+
namespace: string;
|
|
46
|
+
}
|
|
47
|
+
export interface MemorySearchOptions {
|
|
48
|
+
pattern?: string;
|
|
49
|
+
limit?: number;
|
|
50
|
+
namespace?: string;
|
|
32
51
|
}
|
|
33
52
|
//# sourceMappingURL=snow-flow-memory-patterns.d.ts.map
|
|
@@ -1,35 +1,56 @@
|
|
|
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.SnowFlowMemoryOrganizer = void 0;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
7
|
+
exports.SNOW_FLOW_AGENT_CAPABILITIES = exports.SnowFlowMemoryOrganizer = 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);
|
|
45
|
+
}
|
|
46
|
+
// Export stub implementations for compatibility
|
|
47
|
+
class SnowFlowMemoryOrganizer {
|
|
48
|
+
static organize(data) { return data; }
|
|
33
49
|
}
|
|
34
50
|
exports.SnowFlowMemoryOrganizer = SnowFlowMemoryOrganizer;
|
|
51
|
+
exports.SNOW_FLOW_AGENT_CAPABILITIES = {
|
|
52
|
+
RESEARCHER: 'researcher',
|
|
53
|
+
CODER: 'coder',
|
|
54
|
+
ANALYST: 'analyst'
|
|
55
|
+
};
|
|
35
56
|
//# sourceMappingURL=snow-flow-memory-patterns.js.map
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export interface SessionMessage {
|
|
2
|
+
role: 'system' | 'user' | 'assistant' | 'tool';
|
|
3
|
+
content: string;
|
|
4
|
+
timestamp: string;
|
|
5
|
+
meta?: Record<string, unknown>;
|
|
6
|
+
}
|
|
7
|
+
export interface SessionRecord {
|
|
8
|
+
id: string;
|
|
9
|
+
startedAt: string;
|
|
10
|
+
endedAt?: string;
|
|
11
|
+
objective: string;
|
|
12
|
+
provider: {
|
|
13
|
+
id: string;
|
|
14
|
+
model: string;
|
|
15
|
+
baseURL?: string;
|
|
16
|
+
};
|
|
17
|
+
mcp: {
|
|
18
|
+
cmd: string;
|
|
19
|
+
args?: string[];
|
|
20
|
+
};
|
|
21
|
+
messages: SessionMessage[];
|
|
22
|
+
toolEvents?: {
|
|
23
|
+
name: string;
|
|
24
|
+
when: string;
|
|
25
|
+
argsPreview?: string;
|
|
26
|
+
resultPreview?: string;
|
|
27
|
+
}[];
|
|
28
|
+
summary?: string;
|
|
29
|
+
}
|
|
30
|
+
export declare function createSessionId(): string;
|
|
31
|
+
export declare function startSession(rec: Omit<SessionRecord, 'messages' | 'toolEvents'> & {
|
|
32
|
+
messages?: SessionMessage[];
|
|
33
|
+
}): SessionRecord;
|
|
34
|
+
export declare function readSession(id: string): SessionRecord | undefined;
|
|
35
|
+
export declare function listSessions(): {
|
|
36
|
+
id: string;
|
|
37
|
+
startedAt: string;
|
|
38
|
+
objective: string;
|
|
39
|
+
}[];
|
|
40
|
+
export declare function appendMessage(id: string, msg: SessionMessage): void;
|
|
41
|
+
export declare function appendToolEvent(id: string, ev: {
|
|
42
|
+
name: string;
|
|
43
|
+
argsPreview?: string;
|
|
44
|
+
resultPreview?: string;
|
|
45
|
+
}): void;
|
|
46
|
+
export declare function endSession(id: string, summary?: string): void;
|
|
47
|
+
//# sourceMappingURL=store.d.ts.map
|