@sparkleideas/ruv-swarm 1.0.18-patch.1
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 +1565 -0
- package/bin/ruv-swarm-clean.js +1872 -0
- package/bin/ruv-swarm-memory.js +119 -0
- package/bin/ruv-swarm-secure-heartbeat.js +1549 -0
- package/bin/ruv-swarm-secure.js +1689 -0
- package/package.json +221 -0
- package/src/agent.ts +342 -0
- package/src/benchmark.js +267 -0
- package/src/claude-flow-enhanced.js +839 -0
- package/src/claude-integration/advanced-commands.js +561 -0
- package/src/claude-integration/core.js +112 -0
- package/src/claude-integration/docs.js +1548 -0
- package/src/claude-integration/env-template.js +39 -0
- package/src/claude-integration/index.js +209 -0
- package/src/claude-integration/remote.js +408 -0
- package/src/cli-diagnostics.js +364 -0
- package/src/cognitive-pattern-evolution.js +1317 -0
- package/src/daa-cognition.js +977 -0
- package/src/daa-service.d.ts +298 -0
- package/src/daa-service.js +1116 -0
- package/src/diagnostics.js +533 -0
- package/src/errors.js +528 -0
- package/src/github-coordinator/README.md +193 -0
- package/src/github-coordinator/claude-hooks.js +162 -0
- package/src/github-coordinator/gh-cli-coordinator.js +260 -0
- package/src/hooks/cli.js +82 -0
- package/src/hooks/index.js +1900 -0
- package/src/index-enhanced.d.ts +371 -0
- package/src/index-enhanced.js +734 -0
- package/src/index.d.ts +287 -0
- package/src/index.js +405 -0
- package/src/index.ts +457 -0
- package/src/logger.js +182 -0
- package/src/logging-config.js +179 -0
- package/src/mcp-daa-tools.js +735 -0
- package/src/mcp-tools-benchmarks.js +328 -0
- package/src/mcp-tools-enhanced.js +2863 -0
- package/src/memory-config.js +42 -0
- package/src/meta-learning-framework.js +1359 -0
- package/src/neural-agent.js +830 -0
- package/src/neural-coordination-protocol.js +1363 -0
- package/src/neural-models/README.md +118 -0
- package/src/neural-models/autoencoder.js +543 -0
- package/src/neural-models/base.js +269 -0
- package/src/neural-models/cnn.js +497 -0
- package/src/neural-models/gnn.js +447 -0
- package/src/neural-models/gru.js +536 -0
- package/src/neural-models/index.js +273 -0
- package/src/neural-models/lstm.js +551 -0
- package/src/neural-models/neural-presets-complete.js +1306 -0
- package/src/neural-models/presets/graph.js +392 -0
- package/src/neural-models/presets/index.js +279 -0
- package/src/neural-models/presets/nlp.js +328 -0
- package/src/neural-models/presets/timeseries.js +368 -0
- package/src/neural-models/presets/vision.js +387 -0
- package/src/neural-models/resnet.js +534 -0
- package/src/neural-models/transformer.js +515 -0
- package/src/neural-models/vae.js +489 -0
- package/src/neural-network-manager.js +1938 -0
- package/src/neural-network.ts +296 -0
- package/src/neural.js +574 -0
- package/src/performance-benchmarks.js +898 -0
- package/src/performance.js +458 -0
- package/src/persistence-pooled.js +695 -0
- package/src/persistence.js +480 -0
- package/src/schemas.js +864 -0
- package/src/security.js +218 -0
- package/src/singleton-container.js +183 -0
- package/src/sqlite-pool.js +587 -0
- package/src/sqlite-worker.js +141 -0
- package/src/types.ts +164 -0
- package/src/utils.ts +286 -0
- package/src/wasm-loader.js +601 -0
- package/src/wasm-loader2.js +404 -0
- package/src/wasm-memory-optimizer.js +783 -0
- package/src/wasm-types.d.ts +63 -0
- package/wasm/README.md +347 -0
- package/wasm/neuro-divergent.wasm +0 -0
- package/wasm/package.json +18 -0
- package/wasm/ruv-fann.wasm +0 -0
- package/wasm/ruv_swarm_simd.wasm +0 -0
- package/wasm/ruv_swarm_wasm.d.ts +391 -0
- package/wasm/ruv_swarm_wasm.js +2164 -0
- package/wasm/ruv_swarm_wasm_bg.wasm +0 -0
- package/wasm/ruv_swarm_wasm_bg.wasm.d.ts +123 -0
- package/wasm/wasm-bindings-loader.mjs +435 -0
- package/wasm/wasm-updates.md +684 -0
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Neural Models Index
|
|
3
|
+
* Exports all available neural network architectures
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export { NeuralModel } from './base.js';
|
|
7
|
+
export { TransformerModel } from './transformer.js';
|
|
8
|
+
export { CNNModel } from './cnn.js';
|
|
9
|
+
export { GRUModel } from './gru.js';
|
|
10
|
+
export { AutoencoderModel } from './autoencoder.js';
|
|
11
|
+
export { GNNModel } from './gnn.js';
|
|
12
|
+
export { ResNetModel } from './resnet.js';
|
|
13
|
+
export { VAEModel } from './vae.js';
|
|
14
|
+
export { LSTMModel } from './lstm.js';
|
|
15
|
+
|
|
16
|
+
// Model factory for easy instantiation
|
|
17
|
+
export const createNeuralModel = (type, config = {}) => {
|
|
18
|
+
const models = {
|
|
19
|
+
transformer: () => import('./transformer.js').then(m => new m.TransformerModel(config)),
|
|
20
|
+
cnn: () => import('./cnn.js').then(m => new m.CNNModel(config)),
|
|
21
|
+
gru: () => import('./gru.js').then(m => new m.GRUModel(config)),
|
|
22
|
+
autoencoder: () => import('./autoencoder.js').then(m => new m.AutoencoderModel(config)),
|
|
23
|
+
gnn: () => import('./gnn.js').then(m => new m.GNNModel(config)),
|
|
24
|
+
resnet: () => import('./resnet.js').then(m => new m.ResNetModel(config)),
|
|
25
|
+
vae: () => import('./vae.js').then(m => new m.VAEModel(config)),
|
|
26
|
+
lstm: () => import('./lstm.js').then(m => new m.LSTMModel(config)),
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
if (!models[type]) {
|
|
30
|
+
throw new Error(`Unknown neural model type: ${type}. Available types: ${Object.keys(models).join(', ')}`);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return models[type]();
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
// Model configurations presets
|
|
37
|
+
export const MODEL_PRESETS = {
|
|
38
|
+
// Transformer presets
|
|
39
|
+
transformer: {
|
|
40
|
+
small: {
|
|
41
|
+
dimensions: 256,
|
|
42
|
+
heads: 4,
|
|
43
|
+
layers: 3,
|
|
44
|
+
ffDimensions: 1024,
|
|
45
|
+
dropoutRate: 0.1,
|
|
46
|
+
},
|
|
47
|
+
base: {
|
|
48
|
+
dimensions: 512,
|
|
49
|
+
heads: 8,
|
|
50
|
+
layers: 6,
|
|
51
|
+
ffDimensions: 2048,
|
|
52
|
+
dropoutRate: 0.1,
|
|
53
|
+
},
|
|
54
|
+
large: {
|
|
55
|
+
dimensions: 1024,
|
|
56
|
+
heads: 16,
|
|
57
|
+
layers: 12,
|
|
58
|
+
ffDimensions: 4096,
|
|
59
|
+
dropoutRate: 0.1,
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
// CNN presets
|
|
64
|
+
cnn: {
|
|
65
|
+
mnist: {
|
|
66
|
+
inputShape: [28, 28, 1],
|
|
67
|
+
convLayers: [
|
|
68
|
+
{ filters: 32, kernelSize: 3, stride: 1, padding: 'same', activation: 'relu' },
|
|
69
|
+
{ filters: 64, kernelSize: 3, stride: 1, padding: 'same', activation: 'relu' },
|
|
70
|
+
],
|
|
71
|
+
denseLayers: [128],
|
|
72
|
+
outputSize: 10,
|
|
73
|
+
dropoutRate: 0.5,
|
|
74
|
+
},
|
|
75
|
+
cifar10: {
|
|
76
|
+
inputShape: [32, 32, 3],
|
|
77
|
+
convLayers: [
|
|
78
|
+
{ filters: 32, kernelSize: 3, stride: 1, padding: 'same', activation: 'relu' },
|
|
79
|
+
{ filters: 64, kernelSize: 3, stride: 1, padding: 'same', activation: 'relu' },
|
|
80
|
+
{ filters: 128, kernelSize: 3, stride: 1, padding: 'same', activation: 'relu' },
|
|
81
|
+
],
|
|
82
|
+
denseLayers: [256, 128],
|
|
83
|
+
outputSize: 10,
|
|
84
|
+
dropoutRate: 0.5,
|
|
85
|
+
},
|
|
86
|
+
imagenet: {
|
|
87
|
+
inputShape: [224, 224, 3],
|
|
88
|
+
convLayers: [
|
|
89
|
+
{ filters: 64, kernelSize: 7, stride: 2, padding: 'same', activation: 'relu' },
|
|
90
|
+
{ filters: 128, kernelSize: 3, stride: 1, padding: 'same', activation: 'relu' },
|
|
91
|
+
{ filters: 256, kernelSize: 3, stride: 1, padding: 'same', activation: 'relu' },
|
|
92
|
+
{ filters: 512, kernelSize: 3, stride: 1, padding: 'same', activation: 'relu' },
|
|
93
|
+
],
|
|
94
|
+
denseLayers: [4096, 4096],
|
|
95
|
+
outputSize: 1000,
|
|
96
|
+
dropoutRate: 0.5,
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
|
|
100
|
+
// GRU presets
|
|
101
|
+
gru: {
|
|
102
|
+
text_classification: {
|
|
103
|
+
inputSize: 300, // Word embedding size
|
|
104
|
+
hiddenSize: 128,
|
|
105
|
+
numLayers: 2,
|
|
106
|
+
outputSize: 2, // Binary classification
|
|
107
|
+
bidirectional: true,
|
|
108
|
+
dropoutRate: 0.2,
|
|
109
|
+
},
|
|
110
|
+
sequence_generation: {
|
|
111
|
+
inputSize: 128,
|
|
112
|
+
hiddenSize: 512,
|
|
113
|
+
numLayers: 3,
|
|
114
|
+
outputSize: 10000, // Vocabulary size
|
|
115
|
+
bidirectional: false,
|
|
116
|
+
dropoutRate: 0.3,
|
|
117
|
+
},
|
|
118
|
+
time_series: {
|
|
119
|
+
inputSize: 10, // Feature dimensions
|
|
120
|
+
hiddenSize: 64,
|
|
121
|
+
numLayers: 2,
|
|
122
|
+
outputSize: 1, // Regression
|
|
123
|
+
bidirectional: false,
|
|
124
|
+
dropoutRate: 0.1,
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
|
|
128
|
+
// Autoencoder presets
|
|
129
|
+
autoencoder: {
|
|
130
|
+
mnist_compress: {
|
|
131
|
+
inputSize: 784,
|
|
132
|
+
encoderLayers: [512, 256, 128],
|
|
133
|
+
bottleneckSize: 32,
|
|
134
|
+
activation: 'relu',
|
|
135
|
+
outputActivation: 'sigmoid',
|
|
136
|
+
dropoutRate: 0.1,
|
|
137
|
+
},
|
|
138
|
+
image_denoise: {
|
|
139
|
+
inputSize: 4096, // 64x64 grayscale
|
|
140
|
+
encoderLayers: [2048, 1024, 512],
|
|
141
|
+
bottleneckSize: 256,
|
|
142
|
+
activation: 'relu',
|
|
143
|
+
outputActivation: 'sigmoid',
|
|
144
|
+
denoisingNoise: 0.3,
|
|
145
|
+
dropoutRate: 0.2,
|
|
146
|
+
},
|
|
147
|
+
vae_generation: {
|
|
148
|
+
inputSize: 784,
|
|
149
|
+
encoderLayers: [512, 256],
|
|
150
|
+
bottleneckSize: 20,
|
|
151
|
+
activation: 'relu',
|
|
152
|
+
outputActivation: 'sigmoid',
|
|
153
|
+
variational: true,
|
|
154
|
+
dropoutRate: 0.1,
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
|
|
158
|
+
// GNN presets
|
|
159
|
+
gnn: {
|
|
160
|
+
social_network: {
|
|
161
|
+
nodeDimensions: 128,
|
|
162
|
+
edgeDimensions: 64,
|
|
163
|
+
hiddenDimensions: 256,
|
|
164
|
+
outputDimensions: 128,
|
|
165
|
+
numLayers: 3,
|
|
166
|
+
aggregation: 'mean',
|
|
167
|
+
},
|
|
168
|
+
molecular: {
|
|
169
|
+
nodeDimensions: 64,
|
|
170
|
+
edgeDimensions: 32,
|
|
171
|
+
hiddenDimensions: 128,
|
|
172
|
+
outputDimensions: 64,
|
|
173
|
+
numLayers: 4,
|
|
174
|
+
aggregation: 'sum',
|
|
175
|
+
},
|
|
176
|
+
knowledge_graph: {
|
|
177
|
+
nodeDimensions: 256,
|
|
178
|
+
edgeDimensions: 128,
|
|
179
|
+
hiddenDimensions: 512,
|
|
180
|
+
outputDimensions: 256,
|
|
181
|
+
numLayers: 2,
|
|
182
|
+
aggregation: 'max',
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
|
|
186
|
+
// ResNet presets
|
|
187
|
+
resnet: {
|
|
188
|
+
resnet18: {
|
|
189
|
+
numBlocks: 4,
|
|
190
|
+
blockDepth: 2,
|
|
191
|
+
hiddenDimensions: 512,
|
|
192
|
+
initialChannels: 64,
|
|
193
|
+
},
|
|
194
|
+
resnet34: {
|
|
195
|
+
numBlocks: 6,
|
|
196
|
+
blockDepth: 3,
|
|
197
|
+
hiddenDimensions: 512,
|
|
198
|
+
initialChannels: 64,
|
|
199
|
+
},
|
|
200
|
+
resnet50: {
|
|
201
|
+
numBlocks: 8,
|
|
202
|
+
blockDepth: 3,
|
|
203
|
+
hiddenDimensions: 1024,
|
|
204
|
+
initialChannels: 128,
|
|
205
|
+
},
|
|
206
|
+
},
|
|
207
|
+
|
|
208
|
+
// VAE presets
|
|
209
|
+
vae: {
|
|
210
|
+
mnist_vae: {
|
|
211
|
+
inputSize: 784,
|
|
212
|
+
encoderLayers: [512, 256],
|
|
213
|
+
latentDimensions: 20,
|
|
214
|
+
decoderLayers: [256, 512],
|
|
215
|
+
betaKL: 1.0,
|
|
216
|
+
},
|
|
217
|
+
cifar_vae: {
|
|
218
|
+
inputSize: 3072,
|
|
219
|
+
encoderLayers: [1024, 512, 256],
|
|
220
|
+
latentDimensions: 128,
|
|
221
|
+
decoderLayers: [256, 512, 1024],
|
|
222
|
+
betaKL: 0.5,
|
|
223
|
+
},
|
|
224
|
+
beta_vae: {
|
|
225
|
+
inputSize: 784,
|
|
226
|
+
encoderLayers: [512, 256],
|
|
227
|
+
latentDimensions: 10,
|
|
228
|
+
decoderLayers: [256, 512],
|
|
229
|
+
betaKL: 4.0, // Higher beta for disentanglement
|
|
230
|
+
},
|
|
231
|
+
},
|
|
232
|
+
|
|
233
|
+
// LSTM presets
|
|
234
|
+
lstm: {
|
|
235
|
+
text_generation: {
|
|
236
|
+
inputSize: 128,
|
|
237
|
+
hiddenSize: 512,
|
|
238
|
+
numLayers: 2,
|
|
239
|
+
outputSize: 10000,
|
|
240
|
+
bidirectional: false,
|
|
241
|
+
returnSequence: true,
|
|
242
|
+
},
|
|
243
|
+
sentiment_analysis: {
|
|
244
|
+
inputSize: 300,
|
|
245
|
+
hiddenSize: 256,
|
|
246
|
+
numLayers: 2,
|
|
247
|
+
outputSize: 2,
|
|
248
|
+
bidirectional: true,
|
|
249
|
+
returnSequence: false,
|
|
250
|
+
},
|
|
251
|
+
time_series_forecast: {
|
|
252
|
+
inputSize: 10,
|
|
253
|
+
hiddenSize: 128,
|
|
254
|
+
numLayers: 3,
|
|
255
|
+
outputSize: 1,
|
|
256
|
+
bidirectional: false,
|
|
257
|
+
returnSequence: false,
|
|
258
|
+
},
|
|
259
|
+
},
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
// Utility function to get preset configuration
|
|
263
|
+
export const getModelPreset = (modelType, presetName) => {
|
|
264
|
+
if (!MODEL_PRESETS[modelType]) {
|
|
265
|
+
throw new Error(`No presets available for model type: ${modelType}`);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
if (!MODEL_PRESETS[modelType][presetName]) {
|
|
269
|
+
throw new Error(`No preset named '${presetName}' for model type: ${modelType}`);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
return MODEL_PRESETS[modelType][presetName];
|
|
273
|
+
};
|