@soulcraft/brainy 3.20.1 → 3.20.3
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/CHANGELOG.md +19 -0
- package/bin/brainy-interactive.js +2 -2
- package/dist/brainy.d.ts +1 -1
- package/dist/mcp/brainyMCPAdapter.d.ts +1 -1
- package/dist/mcp/brainyMCPService.d.ts +1 -1
- package/dist/neural/embeddedPatterns.d.ts +1 -1
- package/dist/neural/embeddedPatterns.js +1 -1
- package/dist/shared/default-augmentations.d.ts +1 -1
- package/dist/types/{brainyDataInterface.js → brainyInterface.js} +1 -1
- package/dist/vfs/VirtualFileSystem.d.ts +1 -0
- package/dist/vfs/VirtualFileSystem.js +108 -69
- package/package.json +1 -1
- package/dist/augmentationFactory.d.ts +0 -86
- package/dist/augmentationFactory.js +0 -342
- package/dist/augmentationRegistry.d.ts +0 -38
- package/dist/augmentationRegistry.js +0 -54
- package/dist/augmentationRegistryLoader.d.ts +0 -146
- package/dist/augmentationRegistryLoader.js +0 -213
- package/dist/augmentations/KnowledgeAugmentation.d.ts +0 -40
- package/dist/augmentations/KnowledgeAugmentation.js +0 -251
- package/dist/augmentations/intelligentVerbScoring.d.ts +0 -158
- package/dist/augmentations/intelligentVerbScoring.js +0 -377
- package/dist/augmentations/marketplace/AugmentationMarketplace.d.ts +0 -168
- package/dist/augmentations/marketplace/AugmentationMarketplace.js +0 -329
- package/dist/augmentations/marketplace/cli.d.ts +0 -47
- package/dist/augmentations/marketplace/cli.js +0 -265
- package/dist/augmentations/memoryAugmentations.d.ts +0 -72
- package/dist/augmentations/memoryAugmentations.js +0 -280
- package/dist/augmentations/serverSearchAugmentations.d.ts +0 -190
- package/dist/augmentations/serverSearchAugmentations.js +0 -586
- package/dist/brainy-unified.d.ts +0 -106
- package/dist/brainy-unified.js +0 -327
- package/dist/brainyData.d.ts +0 -1832
- package/dist/brainyData.js +0 -6443
- package/dist/brainyDataV3.d.ts +0 -186
- package/dist/brainyDataV3.js +0 -337
- package/dist/config/distributedPresets-new.d.ts +0 -118
- package/dist/config/distributedPresets-new.js +0 -318
- package/dist/config/modelPrecisionManager.d.ts +0 -42
- package/dist/config/modelPrecisionManager.js +0 -98
- package/dist/connectors/interfaces/IConnector.d.ts +0 -143
- package/dist/connectors/interfaces/IConnector.js +0 -8
- package/dist/demo.d.ts +0 -106
- package/dist/demo.js +0 -201
- package/dist/embeddings/SingletonModelManager.d.ts +0 -95
- package/dist/embeddings/SingletonModelManager.js +0 -220
- package/dist/embeddings/lightweight-embedder.d.ts +0 -22
- package/dist/embeddings/lightweight-embedder.js +0 -128
- package/dist/embeddings/model-manager.d.ts +0 -39
- package/dist/embeddings/model-manager.js +0 -245
- package/dist/embeddings/universal-memory-manager.d.ts +0 -38
- package/dist/embeddings/universal-memory-manager.js +0 -166
- package/dist/embeddings/worker-embedding.d.ts +0 -7
- package/dist/embeddings/worker-embedding.js +0 -73
- package/dist/embeddings/worker-manager.d.ts +0 -28
- package/dist/embeddings/worker-manager.js +0 -162
- package/dist/examples/basicUsage.d.ts +0 -4
- package/dist/examples/basicUsage.js +0 -121
- package/dist/indices/fieldIndex.d.ts +0 -76
- package/dist/indices/fieldIndex.js +0 -357
- package/dist/mcp/brainyMCPBroadcast.d.ts +0 -82
- package/dist/mcp/brainyMCPBroadcast.js +0 -303
- package/dist/mcp/brainyMCPClient.d.ts +0 -92
- package/dist/mcp/brainyMCPClient.js +0 -258
- package/dist/scripts/precomputePatternEmbeddings.d.ts +0 -19
- package/dist/scripts/precomputePatternEmbeddings.js +0 -100
- package/dist/utils/cacheAutoConfig.d.ts +0 -63
- package/dist/utils/cacheAutoConfig.js +0 -261
- package/dist/utils/hybridModelManager.d.ts +0 -64
- package/dist/utils/hybridModelManager.js +0 -95
- package/dist/utils/statistics.d.ts +0 -28
- package/dist/utils/statistics.js +0 -25
- package/dist/vfs/ConceptSystem.d.ts +0 -203
- package/dist/vfs/ConceptSystem.js +0 -545
- package/dist/vfs/EntityManager.d.ts +0 -75
- package/dist/vfs/EntityManager.js +0 -216
- package/dist/vfs/EventRecorder.d.ts +0 -84
- package/dist/vfs/EventRecorder.js +0 -269
- package/dist/vfs/GitBridge.d.ts +0 -167
- package/dist/vfs/GitBridge.js +0 -537
- package/dist/vfs/KnowledgeAugmentation.d.ts +0 -104
- package/dist/vfs/KnowledgeAugmentation.js +0 -146
- package/dist/vfs/KnowledgeLayer.d.ts +0 -35
- package/dist/vfs/KnowledgeLayer.js +0 -443
- package/dist/vfs/PersistentEntitySystem.d.ts +0 -165
- package/dist/vfs/PersistentEntitySystem.js +0 -503
- package/dist/vfs/SemanticVersioning.d.ts +0 -105
- package/dist/vfs/SemanticVersioning.js +0 -309
- package/dist/vfs/VFSHealthCheck.d.ts +0 -78
- package/dist/vfs/VFSHealthCheck.js +0 -299
- /package/dist/types/{brainyDataInterface.d.ts → brainyInterface.d.ts} +0 -0
|
@@ -1,342 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Augmentation Factory
|
|
3
|
-
*
|
|
4
|
-
* This module provides a simplified factory for creating augmentations with minimal boilerplate.
|
|
5
|
-
* It reduces the complexity of creating and using augmentations by providing a fluent API
|
|
6
|
-
* and handling common patterns automatically.
|
|
7
|
-
*/
|
|
8
|
-
import { registerAugmentation } from './augmentationRegistry.js';
|
|
9
|
-
/**
|
|
10
|
-
* Base class for all augmentations created with the factory
|
|
11
|
-
* Handles common functionality like initialization, shutdown, and status
|
|
12
|
-
*/
|
|
13
|
-
class BaseAugmentation {
|
|
14
|
-
constructor(options) {
|
|
15
|
-
this.enabled = true;
|
|
16
|
-
this.isInitialized = false;
|
|
17
|
-
this.name = options.name;
|
|
18
|
-
this.description = options.description || `${options.name} augmentation`;
|
|
19
|
-
this.enabled = options.enabled !== false;
|
|
20
|
-
}
|
|
21
|
-
async initialize() {
|
|
22
|
-
if (this.isInitialized)
|
|
23
|
-
return;
|
|
24
|
-
this.isInitialized = true;
|
|
25
|
-
}
|
|
26
|
-
async shutDown() {
|
|
27
|
-
this.isInitialized = false;
|
|
28
|
-
}
|
|
29
|
-
async getStatus() {
|
|
30
|
-
return this.isInitialized ? 'active' : 'inactive';
|
|
31
|
-
}
|
|
32
|
-
async ensureInitialized() {
|
|
33
|
-
if (!this.isInitialized) {
|
|
34
|
-
await this.initialize();
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Factory for creating sense augmentations
|
|
40
|
-
*/
|
|
41
|
-
export function createSenseAugmentation(options) {
|
|
42
|
-
const augmentation = new BaseAugmentation(options);
|
|
43
|
-
// Implement the sense augmentation methods
|
|
44
|
-
augmentation.processRawData = async (rawData, dataType) => {
|
|
45
|
-
await augmentation.ensureInitialized();
|
|
46
|
-
if (options.processRawData) {
|
|
47
|
-
const result = options.processRawData(rawData, dataType);
|
|
48
|
-
return result instanceof Promise ? await result : result;
|
|
49
|
-
}
|
|
50
|
-
return {
|
|
51
|
-
success: false,
|
|
52
|
-
data: { nouns: [], verbs: [] },
|
|
53
|
-
error: 'processRawData not implemented'
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
|
-
augmentation.listenToFeed = async (feedUrl, callback) => {
|
|
57
|
-
await augmentation.ensureInitialized();
|
|
58
|
-
if (options.listenToFeed) {
|
|
59
|
-
return options.listenToFeed(feedUrl, callback);
|
|
60
|
-
}
|
|
61
|
-
throw new Error('listenToFeed not implemented');
|
|
62
|
-
};
|
|
63
|
-
// Auto-register if requested
|
|
64
|
-
if (options.autoRegister) {
|
|
65
|
-
registerAugmentation(augmentation);
|
|
66
|
-
// Auto-initialize if requested
|
|
67
|
-
if (options.autoInitialize) {
|
|
68
|
-
augmentation.initialize().catch((error) => {
|
|
69
|
-
console.error(`Failed to initialize augmentation ${augmentation.name}:`, error);
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
return augmentation;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Factory for creating conduit augmentations
|
|
77
|
-
*/
|
|
78
|
-
export function createConduitAugmentation(options) {
|
|
79
|
-
const augmentation = new BaseAugmentation(options);
|
|
80
|
-
// Implement the conduit augmentation methods
|
|
81
|
-
augmentation.establishConnection = async (targetSystemId, config) => {
|
|
82
|
-
await augmentation.ensureInitialized();
|
|
83
|
-
if (options.establishConnection) {
|
|
84
|
-
const result = options.establishConnection(targetSystemId, config);
|
|
85
|
-
return result instanceof Promise ? await result : result;
|
|
86
|
-
}
|
|
87
|
-
return {
|
|
88
|
-
success: false,
|
|
89
|
-
data: null,
|
|
90
|
-
error: 'establishConnection not implemented'
|
|
91
|
-
};
|
|
92
|
-
};
|
|
93
|
-
augmentation.readData = async (query, opts) => {
|
|
94
|
-
await augmentation.ensureInitialized();
|
|
95
|
-
if (options.readData) {
|
|
96
|
-
const result = options.readData(query, opts);
|
|
97
|
-
return result instanceof Promise ? await result : result;
|
|
98
|
-
}
|
|
99
|
-
return {
|
|
100
|
-
success: false,
|
|
101
|
-
data: null,
|
|
102
|
-
error: 'readData not implemented'
|
|
103
|
-
};
|
|
104
|
-
};
|
|
105
|
-
augmentation.writeData = async (data, opts) => {
|
|
106
|
-
await augmentation.ensureInitialized();
|
|
107
|
-
if (options.writeData) {
|
|
108
|
-
const result = options.writeData(data, opts);
|
|
109
|
-
return result instanceof Promise ? await result : result;
|
|
110
|
-
}
|
|
111
|
-
return {
|
|
112
|
-
success: false,
|
|
113
|
-
data: null,
|
|
114
|
-
error: 'writeData not implemented'
|
|
115
|
-
};
|
|
116
|
-
};
|
|
117
|
-
augmentation.monitorStream = async (streamId, callback) => {
|
|
118
|
-
await augmentation.ensureInitialized();
|
|
119
|
-
if (options.monitorStream) {
|
|
120
|
-
return options.monitorStream(streamId, callback);
|
|
121
|
-
}
|
|
122
|
-
throw new Error('monitorStream not implemented');
|
|
123
|
-
};
|
|
124
|
-
// Auto-register if requested
|
|
125
|
-
if (options.autoRegister) {
|
|
126
|
-
registerAugmentation(augmentation);
|
|
127
|
-
// Auto-initialize if requested
|
|
128
|
-
if (options.autoInitialize) {
|
|
129
|
-
augmentation.initialize().catch((error) => {
|
|
130
|
-
console.error(`Failed to initialize augmentation ${augmentation.name}:`, error);
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
return augmentation;
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* Factory for creating memory augmentations
|
|
138
|
-
*/
|
|
139
|
-
export function createMemoryAugmentation(options) {
|
|
140
|
-
const augmentation = new BaseAugmentation(options);
|
|
141
|
-
// Implement the memory augmentation methods
|
|
142
|
-
augmentation.storeData = async (key, data, opts) => {
|
|
143
|
-
await augmentation.ensureInitialized();
|
|
144
|
-
if (options.storeData) {
|
|
145
|
-
const result = options.storeData(key, data, opts);
|
|
146
|
-
return result instanceof Promise ? await result : result;
|
|
147
|
-
}
|
|
148
|
-
return {
|
|
149
|
-
success: false,
|
|
150
|
-
data: false,
|
|
151
|
-
error: 'storeData not implemented'
|
|
152
|
-
};
|
|
153
|
-
};
|
|
154
|
-
augmentation.retrieveData = async (key, opts) => {
|
|
155
|
-
await augmentation.ensureInitialized();
|
|
156
|
-
if (options.retrieveData) {
|
|
157
|
-
const result = options.retrieveData(key, opts);
|
|
158
|
-
return result instanceof Promise ? await result : result;
|
|
159
|
-
}
|
|
160
|
-
return {
|
|
161
|
-
success: false,
|
|
162
|
-
data: null,
|
|
163
|
-
error: 'retrieveData not implemented'
|
|
164
|
-
};
|
|
165
|
-
};
|
|
166
|
-
augmentation.updateData = async (key, data, opts) => {
|
|
167
|
-
await augmentation.ensureInitialized();
|
|
168
|
-
if (options.updateData) {
|
|
169
|
-
const result = options.updateData(key, data, opts);
|
|
170
|
-
return result instanceof Promise ? await result : result;
|
|
171
|
-
}
|
|
172
|
-
return {
|
|
173
|
-
success: false,
|
|
174
|
-
data: false,
|
|
175
|
-
error: 'updateData not implemented'
|
|
176
|
-
};
|
|
177
|
-
};
|
|
178
|
-
augmentation.deleteData = async (key, opts) => {
|
|
179
|
-
await augmentation.ensureInitialized();
|
|
180
|
-
if (options.deleteData) {
|
|
181
|
-
const result = options.deleteData(key, opts);
|
|
182
|
-
return result instanceof Promise ? await result : result;
|
|
183
|
-
}
|
|
184
|
-
return {
|
|
185
|
-
success: false,
|
|
186
|
-
data: false,
|
|
187
|
-
error: 'deleteData not implemented'
|
|
188
|
-
};
|
|
189
|
-
};
|
|
190
|
-
augmentation.listDataKeys = async (pattern, opts) => {
|
|
191
|
-
await augmentation.ensureInitialized();
|
|
192
|
-
if (options.listDataKeys) {
|
|
193
|
-
const result = options.listDataKeys(pattern, opts);
|
|
194
|
-
return result instanceof Promise ? await result : result;
|
|
195
|
-
}
|
|
196
|
-
return {
|
|
197
|
-
success: false,
|
|
198
|
-
data: [],
|
|
199
|
-
error: 'listDataKeys not implemented'
|
|
200
|
-
};
|
|
201
|
-
};
|
|
202
|
-
augmentation.search = async (query, k, opts) => {
|
|
203
|
-
await augmentation.ensureInitialized();
|
|
204
|
-
if (options.search) {
|
|
205
|
-
const result = options.search(query, k, opts);
|
|
206
|
-
return result instanceof Promise ? await result : result;
|
|
207
|
-
}
|
|
208
|
-
return {
|
|
209
|
-
success: false,
|
|
210
|
-
data: [],
|
|
211
|
-
error: 'search not implemented'
|
|
212
|
-
};
|
|
213
|
-
};
|
|
214
|
-
// Auto-register if requested
|
|
215
|
-
if (options.autoRegister) {
|
|
216
|
-
registerAugmentation(augmentation);
|
|
217
|
-
// Auto-initialize if requested
|
|
218
|
-
if (options.autoInitialize) {
|
|
219
|
-
augmentation.initialize().catch((error) => {
|
|
220
|
-
console.error(`Failed to initialize augmentation ${augmentation.name}:`, error);
|
|
221
|
-
});
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
return augmentation;
|
|
225
|
-
}
|
|
226
|
-
/**
|
|
227
|
-
* Factory for creating WebSocket-enabled augmentations
|
|
228
|
-
* This can be combined with other augmentation factories to create WebSocket-enabled versions
|
|
229
|
-
*/
|
|
230
|
-
export function addWebSocketSupport(augmentation, options) {
|
|
231
|
-
const wsAugmentation = augmentation;
|
|
232
|
-
// Add WebSocket methods
|
|
233
|
-
wsAugmentation.connectWebSocket = async (url, protocols) => {
|
|
234
|
-
await augmentation.ensureInitialized?.();
|
|
235
|
-
if (options.connectWebSocket) {
|
|
236
|
-
return options.connectWebSocket(url, protocols);
|
|
237
|
-
}
|
|
238
|
-
throw new Error('connectWebSocket not implemented');
|
|
239
|
-
};
|
|
240
|
-
wsAugmentation.sendWebSocketMessage = async (connectionId, data) => {
|
|
241
|
-
await augmentation.ensureInitialized?.();
|
|
242
|
-
if (options.sendWebSocketMessage) {
|
|
243
|
-
return options.sendWebSocketMessage(connectionId, data);
|
|
244
|
-
}
|
|
245
|
-
throw new Error('sendWebSocketMessage not implemented');
|
|
246
|
-
};
|
|
247
|
-
wsAugmentation.onWebSocketMessage = async (connectionId, callback) => {
|
|
248
|
-
await augmentation.ensureInitialized?.();
|
|
249
|
-
if (options.onWebSocketMessage) {
|
|
250
|
-
return options.onWebSocketMessage(connectionId, callback);
|
|
251
|
-
}
|
|
252
|
-
throw new Error('onWebSocketMessage not implemented');
|
|
253
|
-
};
|
|
254
|
-
wsAugmentation.offWebSocketMessage = async (connectionId, callback) => {
|
|
255
|
-
await augmentation.ensureInitialized?.();
|
|
256
|
-
if (options.offWebSocketMessage) {
|
|
257
|
-
return options.offWebSocketMessage(connectionId, callback);
|
|
258
|
-
}
|
|
259
|
-
throw new Error('offWebSocketMessage not implemented');
|
|
260
|
-
};
|
|
261
|
-
wsAugmentation.closeWebSocket = async (connectionId, code, reason) => {
|
|
262
|
-
await augmentation.ensureInitialized?.();
|
|
263
|
-
if (options.closeWebSocket) {
|
|
264
|
-
return options.closeWebSocket(connectionId, code, reason);
|
|
265
|
-
}
|
|
266
|
-
throw new Error('closeWebSocket not implemented');
|
|
267
|
-
};
|
|
268
|
-
return wsAugmentation;
|
|
269
|
-
}
|
|
270
|
-
/**
|
|
271
|
-
* Simplified function to execute an augmentation method with automatic error handling
|
|
272
|
-
* This provides a more concise way to execute augmentation methods compared to the full pipeline
|
|
273
|
-
*/
|
|
274
|
-
export async function executeAugmentation(augmentation, method, ...args) {
|
|
275
|
-
try {
|
|
276
|
-
if (!augmentation.enabled) {
|
|
277
|
-
return {
|
|
278
|
-
success: false,
|
|
279
|
-
data: null,
|
|
280
|
-
error: `Augmentation ${augmentation.name} is disabled`
|
|
281
|
-
};
|
|
282
|
-
}
|
|
283
|
-
if (typeof augmentation[method] !== 'function') {
|
|
284
|
-
return {
|
|
285
|
-
success: false,
|
|
286
|
-
data: null,
|
|
287
|
-
error: `Method ${method} not found on augmentation ${augmentation.name}`
|
|
288
|
-
};
|
|
289
|
-
}
|
|
290
|
-
const result = await augmentation[method](...args);
|
|
291
|
-
return result;
|
|
292
|
-
}
|
|
293
|
-
catch (error) {
|
|
294
|
-
console.error(`Error executing ${method} on ${augmentation.name}:`, error);
|
|
295
|
-
return {
|
|
296
|
-
success: false,
|
|
297
|
-
data: null,
|
|
298
|
-
error: error instanceof Error ? error.message : String(error)
|
|
299
|
-
};
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
/**
|
|
303
|
-
* Dynamically load augmentations from a module at runtime
|
|
304
|
-
* This allows for lazy-loading augmentations when needed instead of at build time
|
|
305
|
-
*/
|
|
306
|
-
export async function loadAugmentationModule(modulePromise, options = {}) {
|
|
307
|
-
try {
|
|
308
|
-
const module = await modulePromise;
|
|
309
|
-
const augmentations = [];
|
|
310
|
-
// Extract augmentations from the module
|
|
311
|
-
for (const key in module) {
|
|
312
|
-
const exported = module[key];
|
|
313
|
-
// Skip non-objects and null
|
|
314
|
-
if (!exported || typeof exported !== 'object') {
|
|
315
|
-
continue;
|
|
316
|
-
}
|
|
317
|
-
// Check if it's an augmentation
|
|
318
|
-
if (typeof exported.name === 'string' &&
|
|
319
|
-
typeof exported.initialize === 'function' &&
|
|
320
|
-
typeof exported.shutDown === 'function' &&
|
|
321
|
-
typeof exported.getStatus === 'function') {
|
|
322
|
-
augmentations.push(exported);
|
|
323
|
-
// Auto-register if requested
|
|
324
|
-
if (options.autoRegister) {
|
|
325
|
-
registerAugmentation(exported);
|
|
326
|
-
// Auto-initialize if requested
|
|
327
|
-
if (options.autoInitialize) {
|
|
328
|
-
exported.initialize().catch((error) => {
|
|
329
|
-
console.error(`Failed to initialize augmentation ${exported.name}:`, error);
|
|
330
|
-
});
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
return augmentations;
|
|
336
|
-
}
|
|
337
|
-
catch (error) {
|
|
338
|
-
console.error('Error loading augmentation module:', error);
|
|
339
|
-
return [];
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
//# sourceMappingURL=augmentationFactory.js.map
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Augmentation Registry (Compatibility Layer)
|
|
3
|
-
*
|
|
4
|
-
* @deprecated This module provides backward compatibility for old augmentation
|
|
5
|
-
* loading code. All new code should use the AugmentationRegistry class directly
|
|
6
|
-
* on Brainy instances.
|
|
7
|
-
*/
|
|
8
|
-
import { BrainyAugmentation } from './types/augmentations.js';
|
|
9
|
-
/**
|
|
10
|
-
* Registry of all available augmentations (for compatibility)
|
|
11
|
-
* @deprecated Use brain.augmentations instead
|
|
12
|
-
*/
|
|
13
|
-
export declare const availableAugmentations: any[];
|
|
14
|
-
/**
|
|
15
|
-
* Compatibility wrapper for registerAugmentation
|
|
16
|
-
* @deprecated Use brain.augmentations.register instead
|
|
17
|
-
*/
|
|
18
|
-
export declare function registerAugmentation<T extends BrainyAugmentation>(augmentation: T): T;
|
|
19
|
-
/**
|
|
20
|
-
* Sets the default pipeline instance (compatibility)
|
|
21
|
-
* @deprecated Use brain.augmentations instead
|
|
22
|
-
*/
|
|
23
|
-
export declare function setDefaultPipeline(pipeline: any): void;
|
|
24
|
-
/**
|
|
25
|
-
* Initializes the augmentation pipeline (compatibility)
|
|
26
|
-
* @deprecated Use brain.augmentations instead
|
|
27
|
-
*/
|
|
28
|
-
export declare function initializeAugmentationPipeline(pipelineInstance?: any): any;
|
|
29
|
-
/**
|
|
30
|
-
* Enables or disables an augmentation by name (compatibility)
|
|
31
|
-
* @deprecated Use brain.augmentations instead
|
|
32
|
-
*/
|
|
33
|
-
export declare function setAugmentationEnabled(name: string, enabled: boolean): boolean;
|
|
34
|
-
/**
|
|
35
|
-
* Gets all augmentations of a specific type (compatibility)
|
|
36
|
-
* @deprecated Use brain.augmentations instead
|
|
37
|
-
*/
|
|
38
|
-
export declare function getAugmentationsByType(type: any): any[];
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Augmentation Registry (Compatibility Layer)
|
|
3
|
-
*
|
|
4
|
-
* @deprecated This module provides backward compatibility for old augmentation
|
|
5
|
-
* loading code. All new code should use the AugmentationRegistry class directly
|
|
6
|
-
* on Brainy instances.
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* Registry of all available augmentations (for compatibility)
|
|
10
|
-
* @deprecated Use brain.augmentations instead
|
|
11
|
-
*/
|
|
12
|
-
export const availableAugmentations = [];
|
|
13
|
-
/**
|
|
14
|
-
* Compatibility wrapper for registerAugmentation
|
|
15
|
-
* @deprecated Use brain.augmentations.register instead
|
|
16
|
-
*/
|
|
17
|
-
export function registerAugmentation(augmentation) {
|
|
18
|
-
console.warn('registerAugmentation is deprecated. Use brain.augmentations.register instead.');
|
|
19
|
-
// For compatibility, just add to the list (but it won't actually do anything)
|
|
20
|
-
availableAugmentations.push(augmentation);
|
|
21
|
-
return augmentation;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Sets the default pipeline instance (compatibility)
|
|
25
|
-
* @deprecated Use brain.augmentations instead
|
|
26
|
-
*/
|
|
27
|
-
export function setDefaultPipeline(pipeline) {
|
|
28
|
-
console.warn('setDefaultPipeline is deprecated. Use brain.augmentations instead.');
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Initializes the augmentation pipeline (compatibility)
|
|
32
|
-
* @deprecated Use brain.augmentations instead
|
|
33
|
-
*/
|
|
34
|
-
export function initializeAugmentationPipeline(pipelineInstance) {
|
|
35
|
-
console.warn('initializeAugmentationPipeline is deprecated. Use brain.augmentations instead.');
|
|
36
|
-
return pipelineInstance || {};
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Enables or disables an augmentation by name (compatibility)
|
|
40
|
-
* @deprecated Use brain.augmentations instead
|
|
41
|
-
*/
|
|
42
|
-
export function setAugmentationEnabled(name, enabled) {
|
|
43
|
-
console.warn('setAugmentationEnabled is deprecated. Use brain.augmentations instead.');
|
|
44
|
-
return false;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Gets all augmentations of a specific type (compatibility)
|
|
48
|
-
* @deprecated Use brain.augmentations instead
|
|
49
|
-
*/
|
|
50
|
-
export function getAugmentationsByType(type) {
|
|
51
|
-
console.warn('getAugmentationsByType is deprecated. Use brain.augmentations instead.');
|
|
52
|
-
return [];
|
|
53
|
-
}
|
|
54
|
-
//# sourceMappingURL=augmentationRegistry.js.map
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Augmentation Registry Loader
|
|
3
|
-
*
|
|
4
|
-
* This module provides functionality for loading augmentation registrations
|
|
5
|
-
* at build time. It's designed to be used with build tools like webpack or rollup
|
|
6
|
-
* to automatically discover and register augmentations.
|
|
7
|
-
*/
|
|
8
|
-
import { IAugmentation } from './types/augmentations.js';
|
|
9
|
-
/**
|
|
10
|
-
* Options for the augmentation registry loader
|
|
11
|
-
*/
|
|
12
|
-
export interface AugmentationRegistryLoaderOptions {
|
|
13
|
-
/**
|
|
14
|
-
* Whether to automatically initialize the augmentations after loading
|
|
15
|
-
* @default false
|
|
16
|
-
*/
|
|
17
|
-
autoInitialize?: boolean;
|
|
18
|
-
/**
|
|
19
|
-
* Whether to log debug information during loading
|
|
20
|
-
* @default false
|
|
21
|
-
*/
|
|
22
|
-
debug?: boolean;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Result of loading augmentations
|
|
26
|
-
*/
|
|
27
|
-
export interface AugmentationLoadResult {
|
|
28
|
-
/**
|
|
29
|
-
* The augmentations that were loaded
|
|
30
|
-
*/
|
|
31
|
-
augmentations: IAugmentation[];
|
|
32
|
-
/**
|
|
33
|
-
* Any errors that occurred during loading
|
|
34
|
-
*/
|
|
35
|
-
errors: Error[];
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Loads augmentations from the specified modules
|
|
39
|
-
*
|
|
40
|
-
* This function is designed to be used with build tools like webpack or rollup
|
|
41
|
-
* to automatically discover and register augmentations.
|
|
42
|
-
*
|
|
43
|
-
* @param modules An object containing modules with augmentations to register
|
|
44
|
-
* @param options Options for the loader
|
|
45
|
-
* @returns A promise that resolves with the result of loading the augmentations
|
|
46
|
-
*
|
|
47
|
-
* @example
|
|
48
|
-
* ```typescript
|
|
49
|
-
* // webpack.config.js
|
|
50
|
-
* const { AugmentationRegistryPlugin } = require('brainy/dist/webpack');
|
|
51
|
-
*
|
|
52
|
-
* module.exports = {
|
|
53
|
-
* // ... other webpack config
|
|
54
|
-
* plugins: [
|
|
55
|
-
* new AugmentationRegistryPlugin({
|
|
56
|
-
* // Pattern to match files containing augmentations
|
|
57
|
-
* pattern: /augmentation\.js$/,
|
|
58
|
-
* // Options for the loader
|
|
59
|
-
* options: {
|
|
60
|
-
* autoInitialize: true,
|
|
61
|
-
* debug: true
|
|
62
|
-
* }
|
|
63
|
-
* })
|
|
64
|
-
* ]
|
|
65
|
-
* };
|
|
66
|
-
* ```
|
|
67
|
-
*/
|
|
68
|
-
export declare function loadAugmentationsFromModules(modules: Record<string, any>, options?: AugmentationRegistryLoaderOptions): Promise<AugmentationLoadResult>;
|
|
69
|
-
/**
|
|
70
|
-
* Creates a webpack plugin for automatically loading augmentations
|
|
71
|
-
*
|
|
72
|
-
* @param options Options for the plugin
|
|
73
|
-
* @returns A webpack plugin
|
|
74
|
-
*
|
|
75
|
-
* @example
|
|
76
|
-
* ```typescript
|
|
77
|
-
* // webpack.config.js
|
|
78
|
-
* const { createAugmentationRegistryPlugin } = require('brainy/dist/webpack');
|
|
79
|
-
*
|
|
80
|
-
* module.exports = {
|
|
81
|
-
* // ... other webpack config
|
|
82
|
-
* plugins: [
|
|
83
|
-
* createAugmentationRegistryPlugin({
|
|
84
|
-
* pattern: /augmentation\.js$/,
|
|
85
|
-
* options: {
|
|
86
|
-
* autoInitialize: true,
|
|
87
|
-
* debug: true
|
|
88
|
-
* }
|
|
89
|
-
* })
|
|
90
|
-
* ]
|
|
91
|
-
* };
|
|
92
|
-
* ```
|
|
93
|
-
*/
|
|
94
|
-
export declare function createAugmentationRegistryPlugin(options: {
|
|
95
|
-
/**
|
|
96
|
-
* Pattern to match files containing augmentations
|
|
97
|
-
*/
|
|
98
|
-
pattern: RegExp;
|
|
99
|
-
/**
|
|
100
|
-
* Options for the loader
|
|
101
|
-
*/
|
|
102
|
-
options?: AugmentationRegistryLoaderOptions;
|
|
103
|
-
}): {
|
|
104
|
-
name: string;
|
|
105
|
-
pattern: RegExp;
|
|
106
|
-
options: AugmentationRegistryLoaderOptions;
|
|
107
|
-
};
|
|
108
|
-
/**
|
|
109
|
-
* Creates a rollup plugin for automatically loading augmentations
|
|
110
|
-
*
|
|
111
|
-
* @param options Options for the plugin
|
|
112
|
-
* @returns A rollup plugin
|
|
113
|
-
*
|
|
114
|
-
* @example
|
|
115
|
-
* ```typescript
|
|
116
|
-
* // rollup.config.js
|
|
117
|
-
* import { createAugmentationRegistryRollupPlugin } from 'brainy/dist/rollup';
|
|
118
|
-
*
|
|
119
|
-
* export default {
|
|
120
|
-
* // ... other rollup config
|
|
121
|
-
* plugins: [
|
|
122
|
-
* createAugmentationRegistryRollupPlugin({
|
|
123
|
-
* pattern: /augmentation\.js$/,
|
|
124
|
-
* options: {
|
|
125
|
-
* autoInitialize: true,
|
|
126
|
-
* debug: true
|
|
127
|
-
* }
|
|
128
|
-
* })
|
|
129
|
-
* ]
|
|
130
|
-
* };
|
|
131
|
-
* ```
|
|
132
|
-
*/
|
|
133
|
-
export declare function createAugmentationRegistryRollupPlugin(options: {
|
|
134
|
-
/**
|
|
135
|
-
* Pattern to match files containing augmentations
|
|
136
|
-
*/
|
|
137
|
-
pattern: RegExp;
|
|
138
|
-
/**
|
|
139
|
-
* Options for the loader
|
|
140
|
-
*/
|
|
141
|
-
options?: AugmentationRegistryLoaderOptions;
|
|
142
|
-
}): {
|
|
143
|
-
name: string;
|
|
144
|
-
pattern: RegExp;
|
|
145
|
-
options: AugmentationRegistryLoaderOptions;
|
|
146
|
-
};
|