@soulcraft/brainy 3.20.2 → 3.20.4

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.
Files changed (90) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/bin/brainy-interactive.js +2 -2
  3. package/dist/brainy.d.ts +1 -1
  4. package/dist/mcp/brainyMCPAdapter.d.ts +1 -1
  5. package/dist/mcp/brainyMCPService.d.ts +1 -1
  6. package/dist/neural/embeddedPatterns.d.ts +1 -1
  7. package/dist/neural/embeddedPatterns.js +1 -1
  8. package/dist/shared/default-augmentations.d.ts +1 -1
  9. package/dist/storage/adapters/fileSystemStorage.js +30 -17
  10. package/dist/types/{brainyDataInterface.js → brainyInterface.js} +1 -1
  11. package/package.json +1 -1
  12. package/dist/augmentationFactory.d.ts +0 -86
  13. package/dist/augmentationFactory.js +0 -342
  14. package/dist/augmentationRegistry.d.ts +0 -38
  15. package/dist/augmentationRegistry.js +0 -54
  16. package/dist/augmentationRegistryLoader.d.ts +0 -146
  17. package/dist/augmentationRegistryLoader.js +0 -213
  18. package/dist/augmentations/KnowledgeAugmentation.d.ts +0 -40
  19. package/dist/augmentations/KnowledgeAugmentation.js +0 -251
  20. package/dist/augmentations/intelligentVerbScoring.d.ts +0 -158
  21. package/dist/augmentations/intelligentVerbScoring.js +0 -377
  22. package/dist/augmentations/marketplace/AugmentationMarketplace.d.ts +0 -168
  23. package/dist/augmentations/marketplace/AugmentationMarketplace.js +0 -329
  24. package/dist/augmentations/marketplace/cli.d.ts +0 -47
  25. package/dist/augmentations/marketplace/cli.js +0 -265
  26. package/dist/augmentations/memoryAugmentations.d.ts +0 -72
  27. package/dist/augmentations/memoryAugmentations.js +0 -280
  28. package/dist/augmentations/serverSearchAugmentations.d.ts +0 -190
  29. package/dist/augmentations/serverSearchAugmentations.js +0 -586
  30. package/dist/brainy-unified.d.ts +0 -106
  31. package/dist/brainy-unified.js +0 -327
  32. package/dist/brainyData.d.ts +0 -1832
  33. package/dist/brainyData.js +0 -6443
  34. package/dist/brainyDataV3.d.ts +0 -186
  35. package/dist/brainyDataV3.js +0 -337
  36. package/dist/config/distributedPresets-new.d.ts +0 -118
  37. package/dist/config/distributedPresets-new.js +0 -318
  38. package/dist/config/modelPrecisionManager.d.ts +0 -42
  39. package/dist/config/modelPrecisionManager.js +0 -98
  40. package/dist/connectors/interfaces/IConnector.d.ts +0 -143
  41. package/dist/connectors/interfaces/IConnector.js +0 -8
  42. package/dist/demo.d.ts +0 -106
  43. package/dist/demo.js +0 -201
  44. package/dist/embeddings/SingletonModelManager.d.ts +0 -95
  45. package/dist/embeddings/SingletonModelManager.js +0 -220
  46. package/dist/embeddings/lightweight-embedder.d.ts +0 -22
  47. package/dist/embeddings/lightweight-embedder.js +0 -128
  48. package/dist/embeddings/model-manager.d.ts +0 -39
  49. package/dist/embeddings/model-manager.js +0 -245
  50. package/dist/embeddings/universal-memory-manager.d.ts +0 -38
  51. package/dist/embeddings/universal-memory-manager.js +0 -166
  52. package/dist/embeddings/worker-embedding.d.ts +0 -7
  53. package/dist/embeddings/worker-embedding.js +0 -73
  54. package/dist/embeddings/worker-manager.d.ts +0 -28
  55. package/dist/embeddings/worker-manager.js +0 -162
  56. package/dist/examples/basicUsage.d.ts +0 -4
  57. package/dist/examples/basicUsage.js +0 -121
  58. package/dist/indices/fieldIndex.d.ts +0 -76
  59. package/dist/indices/fieldIndex.js +0 -357
  60. package/dist/mcp/brainyMCPBroadcast.d.ts +0 -82
  61. package/dist/mcp/brainyMCPBroadcast.js +0 -303
  62. package/dist/mcp/brainyMCPClient.d.ts +0 -92
  63. package/dist/mcp/brainyMCPClient.js +0 -258
  64. package/dist/scripts/precomputePatternEmbeddings.d.ts +0 -19
  65. package/dist/scripts/precomputePatternEmbeddings.js +0 -100
  66. package/dist/utils/cacheAutoConfig.d.ts +0 -63
  67. package/dist/utils/cacheAutoConfig.js +0 -261
  68. package/dist/utils/hybridModelManager.d.ts +0 -64
  69. package/dist/utils/hybridModelManager.js +0 -95
  70. package/dist/utils/statistics.d.ts +0 -28
  71. package/dist/utils/statistics.js +0 -25
  72. package/dist/vfs/ConceptSystem.d.ts +0 -203
  73. package/dist/vfs/ConceptSystem.js +0 -545
  74. package/dist/vfs/EntityManager.d.ts +0 -75
  75. package/dist/vfs/EntityManager.js +0 -216
  76. package/dist/vfs/EventRecorder.d.ts +0 -84
  77. package/dist/vfs/EventRecorder.js +0 -269
  78. package/dist/vfs/GitBridge.d.ts +0 -167
  79. package/dist/vfs/GitBridge.js +0 -537
  80. package/dist/vfs/KnowledgeAugmentation.d.ts +0 -104
  81. package/dist/vfs/KnowledgeAugmentation.js +0 -146
  82. package/dist/vfs/KnowledgeLayer.d.ts +0 -35
  83. package/dist/vfs/KnowledgeLayer.js +0 -443
  84. package/dist/vfs/PersistentEntitySystem.d.ts +0 -165
  85. package/dist/vfs/PersistentEntitySystem.js +0 -503
  86. package/dist/vfs/SemanticVersioning.d.ts +0 -105
  87. package/dist/vfs/SemanticVersioning.js +0 -309
  88. package/dist/vfs/VFSHealthCheck.d.ts +0 -78
  89. package/dist/vfs/VFSHealthCheck.js +0 -299
  90. /package/dist/types/{brainyDataInterface.d.ts → brainyInterface.d.ts} +0 -0
@@ -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
- };
@@ -1,213 +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 { registerAugmentation } from './augmentationRegistry.js';
9
- /**
10
- * Default options for the augmentation registry loader
11
- */
12
- const DEFAULT_OPTIONS = {
13
- autoInitialize: false,
14
- debug: false
15
- };
16
- /**
17
- * Loads augmentations from the specified modules
18
- *
19
- * This function is designed to be used with build tools like webpack or rollup
20
- * to automatically discover and register augmentations.
21
- *
22
- * @param modules An object containing modules with augmentations to register
23
- * @param options Options for the loader
24
- * @returns A promise that resolves with the result of loading the augmentations
25
- *
26
- * @example
27
- * ```typescript
28
- * // webpack.config.js
29
- * const { AugmentationRegistryPlugin } = require('brainy/dist/webpack');
30
- *
31
- * module.exports = {
32
- * // ... other webpack config
33
- * plugins: [
34
- * new AugmentationRegistryPlugin({
35
- * // Pattern to match files containing augmentations
36
- * pattern: /augmentation\.js$/,
37
- * // Options for the loader
38
- * options: {
39
- * autoInitialize: true,
40
- * debug: true
41
- * }
42
- * })
43
- * ]
44
- * };
45
- * ```
46
- */
47
- export async function loadAugmentationsFromModules(modules, options = {}) {
48
- const opts = { ...DEFAULT_OPTIONS, ...options };
49
- const result = {
50
- augmentations: [],
51
- errors: []
52
- };
53
- if (opts.debug) {
54
- console.log(`[AugmentationRegistryLoader] Loading augmentations from ${Object.keys(modules).length} modules`);
55
- }
56
- // Process each module
57
- for (const [modulePath, module] of Object.entries(modules)) {
58
- try {
59
- if (opts.debug) {
60
- console.log(`[AugmentationRegistryLoader] Processing module: ${modulePath}`);
61
- }
62
- // Extract augmentations from the module
63
- const augmentations = extractAugmentationsFromModule(module);
64
- if (augmentations.length === 0) {
65
- if (opts.debug) {
66
- console.log(`[AugmentationRegistryLoader] No augmentations found in module: ${modulePath}`);
67
- }
68
- continue;
69
- }
70
- // Register each augmentation
71
- for (const augmentation of augmentations) {
72
- try {
73
- const registered = registerAugmentation(augmentation);
74
- result.augmentations.push(registered);
75
- if (opts.debug) {
76
- console.log(`[AugmentationRegistryLoader] Registered augmentation: ${registered.name}`);
77
- }
78
- }
79
- catch (error) {
80
- const err = error instanceof Error ? error : new Error(String(error));
81
- result.errors.push(err);
82
- if (opts.debug) {
83
- console.error(`[AugmentationRegistryLoader] Failed to register augmentation: ${err.message}`);
84
- }
85
- }
86
- }
87
- }
88
- catch (error) {
89
- const err = error instanceof Error ? error : new Error(String(error));
90
- result.errors.push(err);
91
- if (opts.debug) {
92
- console.error(`[AugmentationRegistryLoader] Error processing module ${modulePath}: ${err.message}`);
93
- }
94
- }
95
- }
96
- if (opts.debug) {
97
- console.log(`[AugmentationRegistryLoader] Loaded ${result.augmentations.length} augmentations with ${result.errors.length} errors`);
98
- }
99
- return result;
100
- }
101
- /**
102
- * Extracts augmentations from a module
103
- *
104
- * @param module The module to extract augmentations from
105
- * @returns An array of augmentations found in the module
106
- */
107
- function extractAugmentationsFromModule(module) {
108
- const augmentations = [];
109
- // If the module itself is an augmentation, add it
110
- if (isAugmentation(module)) {
111
- augmentations.push(module);
112
- }
113
- // Check for exported augmentations
114
- if (module && typeof module === 'object') {
115
- for (const key of Object.keys(module)) {
116
- const exported = module[key];
117
- // Skip non-objects and null
118
- if (!exported || typeof exported !== 'object') {
119
- continue;
120
- }
121
- // If the exported value is an augmentation, add it
122
- if (isAugmentation(exported)) {
123
- augmentations.push(exported);
124
- }
125
- // If the exported value is an array of augmentations, add them
126
- if (Array.isArray(exported) && exported.every(isAugmentation)) {
127
- augmentations.push(...exported);
128
- }
129
- }
130
- }
131
- return augmentations;
132
- }
133
- /**
134
- * Checks if an object is an augmentation
135
- *
136
- * @param obj The object to check
137
- * @returns True if the object is an augmentation
138
- */
139
- function isAugmentation(obj) {
140
- return (obj &&
141
- typeof obj === 'object' &&
142
- typeof obj.name === 'string' &&
143
- typeof obj.initialize === 'function' &&
144
- typeof obj.shutDown === 'function' &&
145
- typeof obj.getStatus === 'function');
146
- }
147
- /**
148
- * Creates a webpack plugin for automatically loading augmentations
149
- *
150
- * @param options Options for the plugin
151
- * @returns A webpack plugin
152
- *
153
- * @example
154
- * ```typescript
155
- * // webpack.config.js
156
- * const { createAugmentationRegistryPlugin } = require('brainy/dist/webpack');
157
- *
158
- * module.exports = {
159
- * // ... other webpack config
160
- * plugins: [
161
- * createAugmentationRegistryPlugin({
162
- * pattern: /augmentation\.js$/,
163
- * options: {
164
- * autoInitialize: true,
165
- * debug: true
166
- * }
167
- * })
168
- * ]
169
- * };
170
- * ```
171
- */
172
- export function createAugmentationRegistryPlugin(options) {
173
- // This is just a placeholder - the actual implementation would depend on the build tool
174
- return {
175
- name: 'AugmentationRegistryPlugin',
176
- pattern: options.pattern,
177
- options: options.options || {}
178
- };
179
- }
180
- /**
181
- * Creates a rollup plugin for automatically loading augmentations
182
- *
183
- * @param options Options for the plugin
184
- * @returns A rollup plugin
185
- *
186
- * @example
187
- * ```typescript
188
- * // rollup.config.js
189
- * import { createAugmentationRegistryRollupPlugin } from 'brainy/dist/rollup';
190
- *
191
- * export default {
192
- * // ... other rollup config
193
- * plugins: [
194
- * createAugmentationRegistryRollupPlugin({
195
- * pattern: /augmentation\.js$/,
196
- * options: {
197
- * autoInitialize: true,
198
- * debug: true
199
- * }
200
- * })
201
- * ]
202
- * };
203
- * ```
204
- */
205
- export function createAugmentationRegistryRollupPlugin(options) {
206
- // This is just a placeholder - the actual implementation would depend on the build tool
207
- return {
208
- name: 'augmentation-registry-rollup-plugin',
209
- pattern: options.pattern,
210
- options: options.options || {}
211
- };
212
- }
213
- //# sourceMappingURL=augmentationRegistryLoader.js.map
@@ -1,40 +0,0 @@
1
- /**
2
- * Knowledge Layer Augmentation for VFS
3
- *
4
- * Adds intelligent features to VFS without modifying core functionality:
5
- * - Event recording for all operations
6
- * - Semantic versioning based on content changes
7
- * - Entity and concept extraction
8
- * - Git bridge for import/export
9
- *
10
- * This is a TRUE augmentation - VFS works perfectly without it
11
- */
12
- import { Brainy } from '../brainy.js';
13
- import { BaseAugmentation } from './brainyAugmentation.js';
14
- export declare class KnowledgeAugmentation extends BaseAugmentation {
15
- name: string;
16
- timing: 'after';
17
- metadata: 'none';
18
- operations: any;
19
- priority: number;
20
- constructor(config?: any);
21
- execute<T = any>(operation: string, params: any, next: () => Promise<T>): Promise<T>;
22
- private eventRecorder?;
23
- private semanticVersioning?;
24
- private entitySystem?;
25
- private conceptSystem?;
26
- private gitBridge?;
27
- private originalMethods;
28
- initialize(context: any): Promise<void>;
29
- augment(brain: Brainy): Promise<void>;
30
- /**
31
- * Wrap a VFS method to add Knowledge Layer functionality
32
- */
33
- private wrapMethod;
34
- /**
35
- * Add Knowledge Layer methods to VFS
36
- */
37
- private addKnowledgeMethods;
38
- private isSemanticChange;
39
- cleanup(brain: Brainy): Promise<void>;
40
- }