snow-flow 2.0.4 → 2.0.6
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/config/snow-flow-config.d.ts +1492 -0
- package/dist/config/snow-flow-config.js +938 -0
- package/dist/coordination/coordination-engine.d.ts +41 -0
- package/dist/coordination/coordination-engine.js +324 -0
- package/dist/coordination/coordination.test.d.ts +6 -0
- package/dist/coordination/example.d.ts +31 -0
- package/dist/coordination/example.js +394 -0
- package/dist/coordination/execution-patterns.d.ts +43 -0
- package/dist/coordination/execution-patterns.js +507 -0
- package/dist/coordination/factory.d.ts +94 -0
- package/dist/coordination/factory.js +433 -0
- package/dist/coordination/index.d.ts +71 -0
- package/dist/coordination/index.js +135 -0
- package/dist/coordination/progress-monitor.d.ts +71 -0
- package/dist/coordination/progress-monitor.js +505 -0
- package/dist/coordination/quality-gates.d.ts +124 -0
- package/dist/coordination/quality-gates.js +577 -0
- package/dist/coordination/shared-memory.d.ts +39 -0
- package/dist/coordination/shared-memory.js +289 -0
- package/dist/coordination/task-dependencies.d.ts +50 -0
- package/dist/coordination/task-dependencies.js +407 -0
- package/dist/coordination/team-coordinator.d.ts +59 -0
- package/dist/coordination/team-coordinator.js +550 -0
- package/dist/coordination/types.d.ts +152 -0
- package/dist/coordination/types.js +3 -0
- package/dist/memory/hierarchical-memory-system.d.ts +90 -0
- package/dist/memory/hierarchical-memory-system.js +400 -0
- package/dist/memory/index.d.ts +9 -0
- package/dist/memory/index.js +20 -0
- package/dist/memory/mcp-integration-example.d.ts +6 -0
- package/dist/memory/mcp-integration-example.js +281 -0
- package/dist/memory/memory-client.d.ts +199 -0
- package/dist/memory/memory-client.js +364 -0
- package/dist/memory/memory-manager.d.ts +29 -0
- package/dist/memory/memory-manager.js +280 -0
- package/dist/memory/memory-operations.d.ts +179 -0
- package/dist/memory/memory-operations.js +691 -0
- package/dist/memory/memory-system.d.ts +152 -0
- package/dist/memory/memory-system.js +632 -0
- package/dist/memory/memory-test.d.ts +6 -0
- package/dist/memory/memory-test.js +161 -0
- package/dist/memory/servicenow-artifact-indexer.d.ts +119 -0
- package/dist/memory/servicenow-artifact-indexer.js +560 -0
- package/dist/memory/snow-flow-memory-patterns.d.ts +213 -0
- package/dist/memory/snow-flow-memory-patterns.js +200 -0
- package/dist/memory/snow-memory.d.ts +54 -0
- package/dist/memory/snow-memory.js +301 -0
- package/dist/memory/swarm-memory.d.ts +135 -0
- package/dist/memory/swarm-memory.js +378 -0
- package/memory/claude-flow-data.json +5 -0
- package/memory/servicenow_artifacts/000d9224c895221055906c7518aa2d3d.json +30 -0
- package/memory/servicenow_artifacts/0196b66173303010e46b4a2214f6a7a2.json +36 -0
- package/memory/servicenow_artifacts/125e5d1d837e2a102a7ea130ceaad397.json +30 -0
- package/memory/servicenow_artifacts/7637c1f2b7112210a5e5911cde11a972.json +30 -0
- package/memory/servicenow_artifacts/default_documentation_tables_1754056582292.json +55 -0
- package/memory/servicenow_artifacts/default_documentation_tables_1754057477189.json +55 -0
- package/memory/sessions/README.md +32 -0
- package/memory/update-set-sessions/01f82af583faea102a7ea130ceaad3d4.json +9 -0
- package/memory/update-set-sessions/27718fb983faea102a7ea130ceaad34b.json +9 -0
- package/memory/update-set-sessions/412e9bf6833e22502a7ea130ceaad30a.json +8 -0
- package/memory/update-set-sessions/66fc5a79837aea102a7ea130ceaad3ab.json +9 -0
- package/memory/update-set-sessions/71a30ff5837eea102a7ea130ceaad37f.json +9 -0
- package/memory/update-set-sessions/74fba27983faea102a7ea130ceaad3bd.json +9 -0
- package/memory/update-set-sessions/a0b147b5837eea102a7ea130ceaad344.json +58 -0
- package/memory/update-set-sessions/b13f5eb983baea102a7ea130ceaad33e.json +9 -0
- package/package.json +1 -1
- package/reports/swarm-auto-centralized-1752649029776.json +13 -0
- package/scripts/postinstall.js +30 -0
- package/scripts/update-version.js +31 -0
- package/servicenow/widgets/openai_incident_classifier/client_controller.js +284 -0
- package/servicenow/widgets/openai_incident_classifier/server_script.js +314 -0
- package/servicenow/widgets/openai_incident_classifier/style.css +354 -0
- package/servicenow/widgets/openai_incident_classifier/template.html +167 -0
- package/servicenow/widgets/openai_incident_classifier/widget.json +86 -0
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Snow-Flow Memory Patterns
|
|
3
|
+
* Hierarchical memory organization for ServiceNow development
|
|
4
|
+
*/
|
|
5
|
+
export interface SnowFlowMemoryPatterns {
|
|
6
|
+
patterns: {
|
|
7
|
+
'specs/requirements': 'Store user stories and requirements';
|
|
8
|
+
'specs/acceptance-criteria': 'Acceptance criteria for features';
|
|
9
|
+
'specs/business-rules': 'Business logic specifications';
|
|
10
|
+
'architecture/decisions': 'Architecture choices and rationale';
|
|
11
|
+
'architecture/data-model': 'ServiceNow table relationships';
|
|
12
|
+
'architecture/integrations': 'Integration points and APIs';
|
|
13
|
+
'architecture/security': 'Security model and ACLs';
|
|
14
|
+
'artifacts/widgets/[name]': 'Service Portal widgets';
|
|
15
|
+
'artifacts/flows/[name]': 'Flow Designer flows';
|
|
16
|
+
'artifacts/scripts/[name]': 'Script Includes and Business Rules';
|
|
17
|
+
'artifacts/tables/[name]': 'Custom table definitions';
|
|
18
|
+
'artifacts/ui-pages/[name]': 'UI Pages and interfaces';
|
|
19
|
+
'code/client-scripts/[name]': 'Client-side scripts';
|
|
20
|
+
'code/server-scripts/[name]': 'Server-side scripts';
|
|
21
|
+
'code/rest-apis/[endpoint]': 'REST API implementations';
|
|
22
|
+
'code/scheduled-jobs/[name]': 'Scheduled job scripts';
|
|
23
|
+
'tests/unit/[module]': 'Unit test results';
|
|
24
|
+
'tests/integration/[flow]': 'Integration test outcomes';
|
|
25
|
+
'tests/atf/[suite]': 'Automated Test Framework results';
|
|
26
|
+
'tests/performance/[metric]': 'Performance benchmarks';
|
|
27
|
+
'docs/api/[endpoint]': 'API documentation';
|
|
28
|
+
'docs/user-guide/[feature]': 'User documentation';
|
|
29
|
+
'docs/admin-guide/[config]': 'Admin configuration guides';
|
|
30
|
+
'docs/runbooks/[procedure]': 'Operational procedures';
|
|
31
|
+
'deploy/update-sets/[name]': 'Update Set tracking';
|
|
32
|
+
'deploy/instances/[env]': 'Instance-specific configs';
|
|
33
|
+
'deploy/migrations/[version]': 'Data migration scripts';
|
|
34
|
+
'patterns/successful/[type]': 'Successful implementation patterns';
|
|
35
|
+
'patterns/anti/[type]': 'Anti-patterns to avoid';
|
|
36
|
+
'patterns/reusable/[component]': 'Reusable components';
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
export declare class SnowFlowMemoryOrganizer {
|
|
40
|
+
/**
|
|
41
|
+
* Generate hierarchical key for ServiceNow artifacts
|
|
42
|
+
*/
|
|
43
|
+
static generateKey(category: string, type: string, name: string): string;
|
|
44
|
+
/**
|
|
45
|
+
* Store widget information with metadata
|
|
46
|
+
*/
|
|
47
|
+
static getWidgetMemoryStructure(widgetName: string): {
|
|
48
|
+
key: string;
|
|
49
|
+
metadata: {
|
|
50
|
+
type: string;
|
|
51
|
+
created: string;
|
|
52
|
+
tags: string[];
|
|
53
|
+
};
|
|
54
|
+
searchableFields: string[];
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Store flow information with relationships
|
|
58
|
+
*/
|
|
59
|
+
static getFlowMemoryStructure(flowName: string): {
|
|
60
|
+
key: string;
|
|
61
|
+
metadata: {
|
|
62
|
+
type: string;
|
|
63
|
+
created: string;
|
|
64
|
+
tags: string[];
|
|
65
|
+
};
|
|
66
|
+
relationships: {
|
|
67
|
+
triggers: any[];
|
|
68
|
+
actions: any[];
|
|
69
|
+
subflows: any[];
|
|
70
|
+
tables: any[];
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Store script information with dependencies
|
|
75
|
+
*/
|
|
76
|
+
static getScriptMemoryStructure(scriptName: string, scriptType: string): {
|
|
77
|
+
key: string;
|
|
78
|
+
metadata: {
|
|
79
|
+
type: string;
|
|
80
|
+
created: string;
|
|
81
|
+
tags: string[];
|
|
82
|
+
};
|
|
83
|
+
dependencies: {
|
|
84
|
+
tables: any[];
|
|
85
|
+
scriptIncludes: any[];
|
|
86
|
+
glideRecords: any[];
|
|
87
|
+
apis: any[];
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* Store test results with coverage
|
|
92
|
+
*/
|
|
93
|
+
static getTestMemoryStructure(testName: string, testType: string): {
|
|
94
|
+
key: string;
|
|
95
|
+
metadata: {
|
|
96
|
+
type: string;
|
|
97
|
+
executed: string;
|
|
98
|
+
tags: string[];
|
|
99
|
+
};
|
|
100
|
+
results: {
|
|
101
|
+
passed: number;
|
|
102
|
+
failed: number;
|
|
103
|
+
skipped: number;
|
|
104
|
+
coverage: number;
|
|
105
|
+
duration: number;
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
/**
|
|
109
|
+
* Store deployment information
|
|
110
|
+
*/
|
|
111
|
+
static getDeploymentMemoryStructure(updateSetName: string): {
|
|
112
|
+
key: string;
|
|
113
|
+
metadata: {
|
|
114
|
+
type: string;
|
|
115
|
+
created: string;
|
|
116
|
+
tags: string[];
|
|
117
|
+
};
|
|
118
|
+
contents: {
|
|
119
|
+
artifacts: any[];
|
|
120
|
+
dependencies: any[];
|
|
121
|
+
conflicts: any[];
|
|
122
|
+
targetInstance: string;
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Agent capability mappings for ServiceNow development
|
|
128
|
+
*/
|
|
129
|
+
export declare const SNOW_FLOW_AGENT_CAPABILITIES: {
|
|
130
|
+
'widget-developer': string[];
|
|
131
|
+
'ui-designer': string[];
|
|
132
|
+
'flow-builder': string[];
|
|
133
|
+
'integration-specialist': string[];
|
|
134
|
+
'script-developer': string[];
|
|
135
|
+
'client-scripter': string[];
|
|
136
|
+
'data-architect': string[];
|
|
137
|
+
'security-engineer': string[];
|
|
138
|
+
'test-engineer': string[];
|
|
139
|
+
'quality-analyst': string[];
|
|
140
|
+
'technical-writer': string[];
|
|
141
|
+
'solution-architect': string[];
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* Coordination patterns for Snow-Flow agents
|
|
145
|
+
*/
|
|
146
|
+
export interface SnowFlowCoordinationPatterns {
|
|
147
|
+
spawnPatterns: {
|
|
148
|
+
widgetDevelopment: {
|
|
149
|
+
agents: ['widget-developer', 'ui-designer', 'test-engineer'];
|
|
150
|
+
coordination: 'parallel-with-sync-points';
|
|
151
|
+
};
|
|
152
|
+
flowDevelopment: {
|
|
153
|
+
agents: ['flow-builder', 'integration-specialist', 'test-engineer'];
|
|
154
|
+
coordination: 'sequential-with-validation';
|
|
155
|
+
};
|
|
156
|
+
fullStackFeature: {
|
|
157
|
+
agents: ['data-architect', 'script-developer', 'widget-developer', 'flow-builder'];
|
|
158
|
+
coordination: 'hierarchical-with-dependencies';
|
|
159
|
+
};
|
|
160
|
+
};
|
|
161
|
+
memorySync: {
|
|
162
|
+
sharedSpecs: 'specs/*';
|
|
163
|
+
architectureDecisions: 'architecture/decisions/*';
|
|
164
|
+
codeArtifacts: 'code/**/*';
|
|
165
|
+
testResults: 'tests/**/latest';
|
|
166
|
+
};
|
|
167
|
+
progressTracking: {
|
|
168
|
+
phases: ['design', 'development', 'testing', 'deployment'];
|
|
169
|
+
checkpoints: ['spec-approved', 'code-complete', 'tests-passed', 'deployed'];
|
|
170
|
+
metrics: ['velocity', 'quality', 'coverage', 'performance'];
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Example usage patterns for ServiceNow development
|
|
175
|
+
*/
|
|
176
|
+
export declare class SnowFlowWorkflowExamples {
|
|
177
|
+
/**
|
|
178
|
+
* Example: Create incident dashboard widget
|
|
179
|
+
*/
|
|
180
|
+
static createIncidentDashboard(): Promise<void>;
|
|
181
|
+
/**
|
|
182
|
+
* Example: Create approval workflow
|
|
183
|
+
*/
|
|
184
|
+
static createApprovalFlow(): Promise<void>;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Monitoring patterns for Snow-Flow
|
|
188
|
+
*/
|
|
189
|
+
export interface SnowFlowMonitoringPatterns {
|
|
190
|
+
swarmMonitor: {
|
|
191
|
+
activeAgents: number;
|
|
192
|
+
taskProgress: Map<string, number>;
|
|
193
|
+
memoryUsage: {
|
|
194
|
+
artifacts: number;
|
|
195
|
+
specs: number;
|
|
196
|
+
tests: number;
|
|
197
|
+
total: number;
|
|
198
|
+
};
|
|
199
|
+
performance: {
|
|
200
|
+
avgTaskTime: number;
|
|
201
|
+
successRate: number;
|
|
202
|
+
activeErrors: string[];
|
|
203
|
+
};
|
|
204
|
+
};
|
|
205
|
+
statusReport: {
|
|
206
|
+
phase: string;
|
|
207
|
+
completedTasks: string[];
|
|
208
|
+
pendingTasks: string[];
|
|
209
|
+
blockers: string[];
|
|
210
|
+
nextSteps: string[];
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
//# sourceMappingURL=snow-flow-memory-patterns.d.ts.map
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Snow-Flow Memory Patterns
|
|
4
|
+
* Hierarchical memory organization for ServiceNow development
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.SnowFlowWorkflowExamples = exports.SNOW_FLOW_AGENT_CAPABILITIES = exports.SnowFlowMemoryOrganizer = void 0;
|
|
8
|
+
class SnowFlowMemoryOrganizer {
|
|
9
|
+
/**
|
|
10
|
+
* Generate hierarchical key for ServiceNow artifacts
|
|
11
|
+
*/
|
|
12
|
+
static generateKey(category, type, name) {
|
|
13
|
+
const sanitizedName = name.toLowerCase().replace(/\s+/g, '_').replace(/[^a-z0-9_]/g, '');
|
|
14
|
+
return `${category}/${type}/${sanitizedName}`;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Store widget information with metadata
|
|
18
|
+
*/
|
|
19
|
+
static getWidgetMemoryStructure(widgetName) {
|
|
20
|
+
return {
|
|
21
|
+
key: this.generateKey('artifacts', 'widgets', widgetName),
|
|
22
|
+
metadata: {
|
|
23
|
+
type: 'service_portal_widget',
|
|
24
|
+
created: new Date().toISOString(),
|
|
25
|
+
tags: ['widget', 'ui', 'service-portal'],
|
|
26
|
+
},
|
|
27
|
+
searchableFields: ['name', 'title', 'description', 'template', 'script'],
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Store flow information with relationships
|
|
32
|
+
*/
|
|
33
|
+
static getFlowMemoryStructure(flowName) {
|
|
34
|
+
return {
|
|
35
|
+
key: this.generateKey('artifacts', 'flows', flowName),
|
|
36
|
+
metadata: {
|
|
37
|
+
type: 'flow_designer',
|
|
38
|
+
created: new Date().toISOString(),
|
|
39
|
+
tags: ['flow', 'automation', 'workflow'],
|
|
40
|
+
},
|
|
41
|
+
relationships: {
|
|
42
|
+
triggers: [],
|
|
43
|
+
actions: [],
|
|
44
|
+
subflows: [],
|
|
45
|
+
tables: [],
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Store script information with dependencies
|
|
51
|
+
*/
|
|
52
|
+
static getScriptMemoryStructure(scriptName, scriptType) {
|
|
53
|
+
return {
|
|
54
|
+
key: this.generateKey('code', `${scriptType}-scripts`, scriptName),
|
|
55
|
+
metadata: {
|
|
56
|
+
type: scriptType,
|
|
57
|
+
created: new Date().toISOString(),
|
|
58
|
+
tags: ['script', scriptType],
|
|
59
|
+
},
|
|
60
|
+
dependencies: {
|
|
61
|
+
tables: [],
|
|
62
|
+
scriptIncludes: [],
|
|
63
|
+
glideRecords: [],
|
|
64
|
+
apis: [],
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Store test results with coverage
|
|
70
|
+
*/
|
|
71
|
+
static getTestMemoryStructure(testName, testType) {
|
|
72
|
+
return {
|
|
73
|
+
key: this.generateKey('tests', testType, testName),
|
|
74
|
+
metadata: {
|
|
75
|
+
type: `${testType}_test`,
|
|
76
|
+
executed: new Date().toISOString(),
|
|
77
|
+
tags: ['test', testType],
|
|
78
|
+
},
|
|
79
|
+
results: {
|
|
80
|
+
passed: 0,
|
|
81
|
+
failed: 0,
|
|
82
|
+
skipped: 0,
|
|
83
|
+
coverage: 0,
|
|
84
|
+
duration: 0,
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Store deployment information
|
|
90
|
+
*/
|
|
91
|
+
static getDeploymentMemoryStructure(updateSetName) {
|
|
92
|
+
return {
|
|
93
|
+
key: this.generateKey('deploy', 'update-sets', updateSetName),
|
|
94
|
+
metadata: {
|
|
95
|
+
type: 'update_set',
|
|
96
|
+
created: new Date().toISOString(),
|
|
97
|
+
tags: ['deployment', 'update-set'],
|
|
98
|
+
},
|
|
99
|
+
contents: {
|
|
100
|
+
artifacts: [],
|
|
101
|
+
dependencies: [],
|
|
102
|
+
conflicts: [],
|
|
103
|
+
targetInstance: '',
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
exports.SnowFlowMemoryOrganizer = SnowFlowMemoryOrganizer;
|
|
109
|
+
/**
|
|
110
|
+
* Agent capability mappings for ServiceNow development
|
|
111
|
+
*/
|
|
112
|
+
exports.SNOW_FLOW_AGENT_CAPABILITIES = {
|
|
113
|
+
// UI Development
|
|
114
|
+
'widget-developer': ['html', 'css', 'javascript', 'angular', 'service-portal-api'],
|
|
115
|
+
'ui-designer': ['ui-builder', 'themes', 'branding', 'responsive-design'],
|
|
116
|
+
// Flow Development
|
|
117
|
+
'flow-builder': ['flow-designer', 'triggers', 'actions', 'subflows', 'approvals'],
|
|
118
|
+
'integration-specialist': ['rest-api', 'soap', 'mid-server', 'integration-hub'],
|
|
119
|
+
// Scripting
|
|
120
|
+
'script-developer': ['glide-api', 'business-rules', 'script-includes', 'scheduled-jobs'],
|
|
121
|
+
'client-scripter': ['client-scripts', 'ui-policies', 'catalog-client-scripts'],
|
|
122
|
+
// Data & Configuration
|
|
123
|
+
'data-architect': ['tables', 'relationships', 'acls', 'data-policies'],
|
|
124
|
+
'security-engineer': ['security-rules', 'authentication', 'encryption', 'audit'],
|
|
125
|
+
// Testing & Quality
|
|
126
|
+
'test-engineer': ['atf', 'unit-testing', 'regression-testing', 'performance-testing'],
|
|
127
|
+
'quality-analyst': ['code-review', 'best-practices', 'performance-optimization'],
|
|
128
|
+
// Documentation & Training
|
|
129
|
+
'technical-writer': ['api-docs', 'user-guides', 'runbooks', 'knowledge-articles'],
|
|
130
|
+
'solution-architect': ['architecture-docs', 'design-patterns', 'roadmaps'],
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* Example usage patterns for ServiceNow development
|
|
134
|
+
*/
|
|
135
|
+
class SnowFlowWorkflowExamples {
|
|
136
|
+
/**
|
|
137
|
+
* Example: Create incident dashboard widget
|
|
138
|
+
*/
|
|
139
|
+
static async createIncidentDashboard() {
|
|
140
|
+
// 1. Store requirements
|
|
141
|
+
// await memory.store('specs/requirements/incident-dashboard', {
|
|
142
|
+
// title: 'Incident Dashboard Widget',
|
|
143
|
+
// features: ['real-time updates', 'priority filtering', 'assignment groups'],
|
|
144
|
+
// acceptance: ['shows active incidents', 'updates every 30s', 'filterable'],
|
|
145
|
+
// });
|
|
146
|
+
// 2. Spawn specialized agents
|
|
147
|
+
const agents = await Promise.all([
|
|
148
|
+
// agentSpawn({ type: 'widget-developer', capabilities: SNOW_FLOW_AGENT_CAPABILITIES['widget-developer'] }),
|
|
149
|
+
// agentSpawn({ type: 'ui-designer', capabilities: SNOW_FLOW_AGENT_CAPABILITIES['ui-designer'] }),
|
|
150
|
+
// agentSpawn({ type: 'test-engineer', capabilities: SNOW_FLOW_AGENT_CAPABILITIES['test-engineer'] }),
|
|
151
|
+
]);
|
|
152
|
+
// 3. Coordinate work
|
|
153
|
+
// await agentCommunicate({
|
|
154
|
+
// to: agents[0].id,
|
|
155
|
+
// message: 'Create widget structure based on specs/requirements/incident-dashboard'
|
|
156
|
+
// });
|
|
157
|
+
// await agentCommunicate({
|
|
158
|
+
// to: agents[1].id,
|
|
159
|
+
// message: 'Design responsive layout for incident data visualization'
|
|
160
|
+
// });
|
|
161
|
+
// 4. Store artifacts
|
|
162
|
+
// await memory.store('artifacts/widgets/incident-dashboard', {
|
|
163
|
+
// html: '<!-- widget template -->',
|
|
164
|
+
// css: '/* widget styles */',
|
|
165
|
+
// clientScript: '// client controller',
|
|
166
|
+
// serverScript: '// server script',
|
|
167
|
+
// });
|
|
168
|
+
// 5. Track progress
|
|
169
|
+
// await taskUpdate({ taskId: 'incident-dashboard', progress: 100 });
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Example: Create approval workflow
|
|
173
|
+
*/
|
|
174
|
+
static async createApprovalFlow() {
|
|
175
|
+
// 1. Store flow design
|
|
176
|
+
// await memory.store('architecture/decisions/approval-flow', {
|
|
177
|
+
// pattern: 'multi-level-approval',
|
|
178
|
+
// levels: ['manager', 'director', 'vp'],
|
|
179
|
+
// escalation: 'time-based',
|
|
180
|
+
// });
|
|
181
|
+
// 2. Spawn flow specialists
|
|
182
|
+
// const flowBuilder = await agentSpawn({
|
|
183
|
+
// type: 'flow-builder',
|
|
184
|
+
// capabilities: SNOW_FLOW_AGENT_CAPABILITIES['flow-builder']
|
|
185
|
+
// });
|
|
186
|
+
// 3. Build flow with memory reference
|
|
187
|
+
// await agentCommunicate({
|
|
188
|
+
// to: flowBuilder.id,
|
|
189
|
+
// message: 'Build approval flow using architecture/decisions/approval-flow pattern'
|
|
190
|
+
// });
|
|
191
|
+
// 4. Store flow artifact
|
|
192
|
+
// await memory.store('artifacts/flows/equipment-approval', {
|
|
193
|
+
// trigger: 'record.inserted',
|
|
194
|
+
// actions: ['lookup-manager', 'send-approval', 'wait-response', 'update-record'],
|
|
195
|
+
// table: 'x_company_equipment',
|
|
196
|
+
// });
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
exports.SnowFlowWorkflowExamples = SnowFlowWorkflowExamples;
|
|
200
|
+
//# sourceMappingURL=snow-flow-memory-patterns.js.map
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { MemoryEntry } from '../types/snow-flow.types.js';
|
|
2
|
+
export interface SnowMemoryOptions {
|
|
3
|
+
namespace?: string;
|
|
4
|
+
dbPath?: string;
|
|
5
|
+
enableCompression?: boolean;
|
|
6
|
+
maxEntries?: number;
|
|
7
|
+
cleanupInterval?: number;
|
|
8
|
+
}
|
|
9
|
+
export interface StoreOptions {
|
|
10
|
+
namespace?: string;
|
|
11
|
+
ttl?: number;
|
|
12
|
+
metadata?: Record<string, any>;
|
|
13
|
+
}
|
|
14
|
+
export interface SearchOptions {
|
|
15
|
+
namespace?: string;
|
|
16
|
+
pattern?: string;
|
|
17
|
+
limit?: number;
|
|
18
|
+
offset?: number;
|
|
19
|
+
orderBy?: 'created' | 'updated' | 'accessed';
|
|
20
|
+
order?: 'asc' | 'desc';
|
|
21
|
+
}
|
|
22
|
+
export declare class SnowMemory {
|
|
23
|
+
private db;
|
|
24
|
+
private namespace;
|
|
25
|
+
private dbPath;
|
|
26
|
+
private cleanupTimer?;
|
|
27
|
+
private options;
|
|
28
|
+
constructor(options?: SnowMemoryOptions);
|
|
29
|
+
initialize(): Promise<void>;
|
|
30
|
+
store(key: string, value: any, options?: StoreOptions): Promise<void>;
|
|
31
|
+
retrieve(key: string, namespace?: string): Promise<any>;
|
|
32
|
+
delete(key: string, namespace?: string): Promise<void>;
|
|
33
|
+
search(options?: SearchOptions): Promise<MemoryEntry[]>;
|
|
34
|
+
list(namespace?: string): Promise<string[]>;
|
|
35
|
+
exists(key: string, namespace?: string): Promise<boolean>;
|
|
36
|
+
clear(namespace?: string): Promise<void>;
|
|
37
|
+
cleanup(): Promise<number>;
|
|
38
|
+
enforceMaxEntries(): Promise<void>;
|
|
39
|
+
getStats(): Promise<{
|
|
40
|
+
totalEntries: number;
|
|
41
|
+
namespaces: string[];
|
|
42
|
+
totalSize: number;
|
|
43
|
+
oldestEntry: Date | null;
|
|
44
|
+
newestEntry: Date | null;
|
|
45
|
+
mostAccessed: {
|
|
46
|
+
key: string;
|
|
47
|
+
count: number;
|
|
48
|
+
} | null;
|
|
49
|
+
}>;
|
|
50
|
+
export(filePath: string, namespace?: string): Promise<void>;
|
|
51
|
+
import(filePath: string): Promise<number>;
|
|
52
|
+
close(): Promise<void>;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=snow-memory.d.ts.map
|