@soulcraft/brainy 0.58.0 → 0.58.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/bin/brainy.js +260 -389
- package/dist/augmentations/conduitAugmentations.js +1 -1
- package/dist/augmentations/conduitAugmentations.js.map +1 -1
- package/dist/augmentations/cortexSense.js +3 -3
- package/dist/augmentations/cortexSense.js.map +1 -1
- package/dist/brainyData.js +2 -1
- package/dist/brainyData.js.map +1 -1
- package/dist/browserFramework.minimal.d.ts +14 -0
- package/dist/browserFramework.minimal.js +31 -0
- package/dist/browserFramework.minimal.js.map +1 -0
- package/dist/cortex/backupRestore.js +2 -2
- package/dist/cortex/backupRestore.js.map +1 -1
- package/dist/cortex/cortex.d.ts +17 -2
- package/dist/cortex/cortex.js +262 -103
- package/dist/cortex/cortex.js.map +1 -1
- package/dist/cortex/neuralImport.js +2 -2
- package/dist/cortex/neuralImport.js.map +1 -1
- package/dist/cortex/serviceIntegration.js +2 -2
- package/dist/cortex/serviceIntegration.js.map +1 -1
- package/dist/distributed/configManager.js +1 -1
- package/dist/distributed/configManager.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/mcp/brainyMCPAdapter.js +1 -1
- package/dist/mcp/brainyMCPAdapter.js.map +1 -1
- package/dist/mcp/brainyMCPBroadcast.d.ts +82 -0
- package/dist/mcp/brainyMCPBroadcast.js +303 -0
- package/dist/mcp/brainyMCPBroadcast.js.map +1 -0
- package/dist/mcp/brainyMCPClient.d.ts +92 -0
- package/dist/mcp/brainyMCPClient.js +254 -0
- package/dist/mcp/brainyMCPClient.js.map +1 -0
- package/dist/mcp/brainyMCPService.js +1 -1
- package/dist/mcp/brainyMCPService.js.map +1 -1
- package/dist/mcp/mcpAugmentationToolset.js +1 -1
- package/dist/mcp/mcpAugmentationToolset.js.map +1 -1
- package/dist/universal/crypto.d.ts +64 -0
- package/dist/universal/crypto.js +215 -0
- package/dist/universal/crypto.js.map +1 -0
- package/dist/universal/events.d.ts +31 -0
- package/dist/universal/events.js +156 -0
- package/dist/universal/events.js.map +1 -0
- package/dist/universal/fs.d.ts +102 -0
- package/dist/universal/fs.js +304 -0
- package/dist/universal/fs.js.map +1 -0
- package/dist/universal/index.d.ts +16 -0
- package/dist/universal/index.js +23 -0
- package/dist/universal/index.js.map +1 -0
- package/dist/universal/path.d.ts +51 -0
- package/dist/universal/path.js +161 -0
- package/dist/universal/path.js.map +1 -0
- package/dist/universal/uuid.d.ts +10 -0
- package/dist/universal/uuid.js +21 -0
- package/dist/universal/uuid.js.map +1 -0
- package/package.json +54 -2
- package/dist/augmentationFactory.d.ts.map +0 -1
- package/dist/augmentationPipeline.d.ts.map +0 -1
- package/dist/augmentationRegistry.d.ts.map +0 -1
- package/dist/augmentationRegistryLoader.d.ts.map +0 -1
- package/dist/augmentations/conduitAugmentations.d.ts.map +0 -1
- package/dist/augmentations/memoryAugmentations.d.ts.map +0 -1
- package/dist/augmentations/serverSearchAugmentations.d.ts.map +0 -1
- package/dist/brainyData.d.ts.map +0 -1
- package/dist/browserFramework.d.ts.map +0 -1
- package/dist/coreTypes.d.ts.map +0 -1
- package/dist/cortex/cli.d.ts +0 -8
- package/dist/cortex/cli.js +0 -207
- package/dist/cortex/cli.js.map +0 -1
- package/dist/cortex/commands/index.d.ts +0 -79
- package/dist/cortex/commands/index.js +0 -614
- package/dist/cortex/commands/index.js.map +0 -1
- package/dist/cortex/config.d.ts +0 -112
- package/dist/cortex/config.js +0 -312
- package/dist/cortex/config.js.map +0 -1
- package/dist/cortex/licensingSystem.d.ts +0 -126
- package/dist/cortex/licensingSystem.js +0 -474
- package/dist/cortex/licensingSystem.js.map +0 -1
- package/dist/cortex/webhookManager.d.ts +0 -39
- package/dist/cortex/webhookManager.js +0 -326
- package/dist/cortex/webhookManager.js.map +0 -1
- package/dist/demo.d.ts.map +0 -1
- package/dist/distributed/configManager.d.ts.map +0 -1
- package/dist/distributed/domainDetector.d.ts.map +0 -1
- package/dist/distributed/hashPartitioner.d.ts.map +0 -1
- package/dist/distributed/healthMonitor.d.ts.map +0 -1
- package/dist/distributed/index.d.ts.map +0 -1
- package/dist/distributed/operationalModes.d.ts.map +0 -1
- package/dist/errors/brainyError.d.ts.map +0 -1
- package/dist/examples/basicUsage.d.ts.map +0 -1
- package/dist/hnsw/distributedSearch.d.ts.map +0 -1
- package/dist/hnsw/hnswIndex.d.ts.map +0 -1
- package/dist/hnsw/hnswIndexOptimized.d.ts.map +0 -1
- package/dist/hnsw/optimizedHNSWIndex.d.ts.map +0 -1
- package/dist/hnsw/partitionedHNSWIndex.d.ts.map +0 -1
- package/dist/hnsw/scaledHNSWSystem.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/mcp/brainyMCPAdapter.d.ts.map +0 -1
- package/dist/mcp/brainyMCPService.d.ts.map +0 -1
- package/dist/mcp/index.d.ts.map +0 -1
- package/dist/mcp/mcpAugmentationToolset.d.ts.map +0 -1
- package/dist/pipeline.d.ts.map +0 -1
- package/dist/sequentialPipeline.d.ts.map +0 -1
- package/dist/setup.d.ts.map +0 -1
- package/dist/storage/adapters/baseStorageAdapter.d.ts.map +0 -1
- package/dist/storage/adapters/batchS3Operations.d.ts.map +0 -1
- package/dist/storage/adapters/fileSystemStorage.d.ts.map +0 -1
- package/dist/storage/adapters/memoryStorage.d.ts.map +0 -1
- package/dist/storage/adapters/opfsStorage.d.ts.map +0 -1
- package/dist/storage/adapters/optimizedS3Search.d.ts.map +0 -1
- package/dist/storage/adapters/s3CompatibleStorage.d.ts.map +0 -1
- package/dist/storage/baseStorage.d.ts.map +0 -1
- package/dist/storage/cacheManager.d.ts.map +0 -1
- package/dist/storage/enhancedCacheManager.d.ts.map +0 -1
- package/dist/storage/readOnlyOptimizations.d.ts.map +0 -1
- package/dist/storage/storageFactory.d.ts.map +0 -1
- package/dist/types/augmentations.d.ts.map +0 -1
- package/dist/types/brainyDataInterface.d.ts.map +0 -1
- package/dist/types/distributedTypes.d.ts.map +0 -1
- package/dist/types/fileSystemTypes.d.ts.map +0 -1
- package/dist/types/graphTypes.d.ts.map +0 -1
- package/dist/types/mcpTypes.d.ts.map +0 -1
- package/dist/types/paginationTypes.d.ts.map +0 -1
- package/dist/types/pipelineTypes.d.ts.map +0 -1
- package/dist/types/tensorflowTypes.d.ts +0 -26
- package/dist/types/tensorflowTypes.d.ts.map +0 -1
- package/dist/types/tensorflowTypes.js +0 -6
- package/dist/types/tensorflowTypes.js.map +0 -1
- package/dist/unified.d.ts.map +0 -1
- package/dist/utils/autoConfiguration.d.ts.map +0 -1
- package/dist/utils/cacheAutoConfig.d.ts.map +0 -1
- package/dist/utils/crypto.d.ts.map +0 -1
- package/dist/utils/distance.d.ts.map +0 -1
- package/dist/utils/embedding.d.ts.map +0 -1
- package/dist/utils/environment.d.ts.map +0 -1
- package/dist/utils/fieldNameTracking.d.ts.map +0 -1
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/jsonProcessing.d.ts.map +0 -1
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/operationUtils.d.ts.map +0 -1
- package/dist/utils/robustModelLoader.d.ts +0 -112
- package/dist/utils/robustModelLoader.d.ts.map +0 -1
- package/dist/utils/robustModelLoader.js +0 -624
- package/dist/utils/robustModelLoader.js.map +0 -1
- package/dist/utils/searchCache.d.ts.map +0 -1
- package/dist/utils/statistics.d.ts.map +0 -1
- package/dist/utils/statisticsCollector.d.ts.map +0 -1
- package/dist/utils/textEncoding.d.ts.map +0 -1
- package/dist/utils/typeUtils.d.ts.map +0 -1
- package/dist/utils/version.d.ts.map +0 -1
- package/dist/utils/workerUtils.d.ts.map +0 -1
- package/dist/webhooks/webhookSystem.d.ts +0 -114
- package/dist/webhooks/webhookSystem.js +0 -321
- package/dist/webhooks/webhookSystem.js.map +0 -1
- package/dist/worker.d.ts.map +0 -1
package/bin/brainy.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Brainy CLI -
|
|
4
|
+
* Brainy CLI - Redesigned for Better UX
|
|
5
|
+
* Direct commands + Augmentation system
|
|
5
6
|
*/
|
|
6
7
|
|
|
7
8
|
// @ts-ignore
|
|
@@ -19,19 +20,15 @@ const packageJson = JSON.parse(readFileSync(join(__dirname, '..', 'package.json'
|
|
|
19
20
|
// Create Cortex instance
|
|
20
21
|
const cortex = new Cortex()
|
|
21
22
|
|
|
22
|
-
// Helper
|
|
23
|
+
// Helper functions
|
|
23
24
|
const exitProcess = (code = 0) => {
|
|
24
|
-
setTimeout(() =>
|
|
25
|
-
process.exit(code)
|
|
26
|
-
}, 100)
|
|
25
|
+
setTimeout(() => process.exit(code), 100)
|
|
27
26
|
}
|
|
28
27
|
|
|
29
|
-
// Wrap async actions to ensure proper exit
|
|
30
28
|
const wrapAction = (fn) => {
|
|
31
29
|
return async (...args) => {
|
|
32
30
|
try {
|
|
33
31
|
await fn(...args)
|
|
34
|
-
// Always exit for non-interactive commands
|
|
35
32
|
exitProcess(0)
|
|
36
33
|
} catch (error) {
|
|
37
34
|
console.error(chalk.red('Error:'), error.message)
|
|
@@ -40,7 +37,6 @@ const wrapAction = (fn) => {
|
|
|
40
37
|
}
|
|
41
38
|
}
|
|
42
39
|
|
|
43
|
-
// Wrap interactive actions with explicit exit
|
|
44
40
|
const wrapInteractive = (fn) => {
|
|
45
41
|
return async (...args) => {
|
|
46
42
|
try {
|
|
@@ -53,38 +49,34 @@ const wrapInteractive = (fn) => {
|
|
|
53
49
|
}
|
|
54
50
|
}
|
|
55
51
|
|
|
56
|
-
//
|
|
52
|
+
// ========================================
|
|
53
|
+
// MAIN PROGRAM SETUP
|
|
54
|
+
// ========================================
|
|
55
|
+
|
|
57
56
|
program
|
|
58
|
-
.name('
|
|
59
|
-
.description('🧠
|
|
57
|
+
.name('brainy')
|
|
58
|
+
.description('🧠 Brainy - Vector + Graph Database with AI Coordination')
|
|
60
59
|
.version(packageJson.version)
|
|
61
60
|
|
|
62
|
-
//
|
|
61
|
+
// ========================================
|
|
62
|
+
// CORE DATABASE COMMANDS (Direct Access)
|
|
63
|
+
// ========================================
|
|
64
|
+
|
|
63
65
|
program
|
|
64
66
|
.command('init')
|
|
65
|
-
.description('Initialize
|
|
67
|
+
.description('🚀 Initialize Brainy in your project')
|
|
66
68
|
.option('-s, --storage <type>', 'Storage type (filesystem, s3, r2, gcs, memory)')
|
|
67
69
|
.option('-e, --encryption', 'Enable encryption for secrets')
|
|
68
70
|
.action(wrapAction(async (options) => {
|
|
69
71
|
await cortex.init(options)
|
|
70
72
|
}))
|
|
71
73
|
|
|
72
|
-
// Chat commands (simplified - just 'chat', no alias)
|
|
73
|
-
program
|
|
74
|
-
.command('chat [question]')
|
|
75
|
-
.description('💬 Chat with your data (interactive mode if no question)')
|
|
76
|
-
.option('-l, --llm <model>', 'LLM model to use')
|
|
77
|
-
.action(wrapInteractive(async (question, options) => {
|
|
78
|
-
await cortex.chat(question)
|
|
79
|
-
}))
|
|
80
|
-
|
|
81
|
-
// Data management commands
|
|
82
74
|
program
|
|
83
75
|
.command('add [data]')
|
|
84
76
|
.description('📊 Add data to Brainy')
|
|
85
77
|
.option('-m, --metadata <json>', 'Metadata as JSON')
|
|
86
78
|
.option('-i, --id <id>', 'Custom ID')
|
|
87
|
-
.action(async (data, options) => {
|
|
79
|
+
.action(wrapAction(async (data, options) => {
|
|
88
80
|
let metadata = {}
|
|
89
81
|
if (options.metadata) {
|
|
90
82
|
try {
|
|
@@ -98,17 +90,16 @@ program
|
|
|
98
90
|
metadata.id = options.id
|
|
99
91
|
}
|
|
100
92
|
await cortex.add(data, metadata)
|
|
101
|
-
|
|
102
|
-
})
|
|
93
|
+
}))
|
|
103
94
|
|
|
104
95
|
program
|
|
105
96
|
.command('search <query>')
|
|
106
|
-
.description('🔍 Search your database
|
|
97
|
+
.description('🔍 Search your database')
|
|
107
98
|
.option('-l, --limit <number>', 'Number of results', '10')
|
|
108
99
|
.option('-f, --filter <json>', 'MongoDB-style metadata filters')
|
|
109
100
|
.option('-v, --verbs <types>', 'Graph verb types to traverse (comma-separated)')
|
|
110
101
|
.option('-d, --depth <number>', 'Graph traversal depth', '1')
|
|
111
|
-
.action(async (query, options) => {
|
|
102
|
+
.action(wrapAction(async (query, options) => {
|
|
112
103
|
const searchOptions = { limit: parseInt(options.limit) }
|
|
113
104
|
|
|
114
105
|
if (options.filter) {
|
|
@@ -126,189 +117,44 @@ program
|
|
|
126
117
|
}
|
|
127
118
|
|
|
128
119
|
await cortex.search(query, searchOptions)
|
|
129
|
-
exitProcess(0)
|
|
130
|
-
})
|
|
131
|
-
|
|
132
|
-
program
|
|
133
|
-
.command('find')
|
|
134
|
-
.description('🔍 Interactive advanced search with filters and graph traversal')
|
|
135
|
-
.action(wrapInteractive(async () => {
|
|
136
|
-
await cortex.advancedSearch()
|
|
137
|
-
}))
|
|
138
|
-
|
|
139
|
-
program
|
|
140
|
-
.command('update <id> <data>')
|
|
141
|
-
.description('✏️ Update existing data')
|
|
142
|
-
.option('-m, --metadata <json>', 'New metadata as JSON')
|
|
143
|
-
.action(async (id, data, options) => {
|
|
144
|
-
let metadata = {}
|
|
145
|
-
if (options.metadata) {
|
|
146
|
-
try {
|
|
147
|
-
metadata = JSON.parse(options.metadata)
|
|
148
|
-
} catch {
|
|
149
|
-
console.error(chalk.red('Invalid metadata JSON'))
|
|
150
|
-
process.exit(1)
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
await cortex.update(id, data, metadata)
|
|
154
|
-
exitProcess(0)
|
|
155
|
-
})
|
|
156
|
-
|
|
157
|
-
program
|
|
158
|
-
.command('delete <id>')
|
|
159
|
-
.description('🗑️ Delete data by ID')
|
|
160
|
-
.action(wrapAction(async (id) => {
|
|
161
|
-
await cortex.delete(id)
|
|
162
|
-
}))
|
|
163
|
-
|
|
164
|
-
// Graph commands
|
|
165
|
-
program
|
|
166
|
-
.command('verb <subject> <verb> <object>')
|
|
167
|
-
.description('🔗 Add graph relationship between nodes')
|
|
168
|
-
.option('-m, --metadata <json>', 'Relationship metadata')
|
|
169
|
-
.action(async (subject, verb, object, options) => {
|
|
170
|
-
let metadata = {}
|
|
171
|
-
if (options.metadata) {
|
|
172
|
-
try {
|
|
173
|
-
metadata = JSON.parse(options.metadata)
|
|
174
|
-
} catch {
|
|
175
|
-
console.error(chalk.red('Invalid metadata JSON'))
|
|
176
|
-
process.exit(1)
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
await cortex.addVerb(subject, verb, object, metadata)
|
|
180
|
-
exitProcess(0)
|
|
181
|
-
})
|
|
182
|
-
|
|
183
|
-
program
|
|
184
|
-
.command('explore [nodeId]')
|
|
185
|
-
.description('🗺️ Interactively explore graph connections')
|
|
186
|
-
.action(wrapInteractive(async (nodeId) => {
|
|
187
|
-
await cortex.explore(nodeId)
|
|
188
|
-
}))
|
|
189
|
-
|
|
190
|
-
// Configuration commands
|
|
191
|
-
const config = program.command('config')
|
|
192
|
-
.description('⚙️ Manage configuration')
|
|
193
|
-
|
|
194
|
-
config
|
|
195
|
-
.command('set <key> <value>')
|
|
196
|
-
.description('Set configuration value')
|
|
197
|
-
.option('-e, --encrypt', 'Encrypt this value')
|
|
198
|
-
.action(wrapAction(async (key, value, options) => {
|
|
199
|
-
await cortex.configSet(key, value, options)
|
|
200
|
-
}))
|
|
201
|
-
|
|
202
|
-
config
|
|
203
|
-
.command('get <key>')
|
|
204
|
-
.description('Get configuration value')
|
|
205
|
-
.action(async (key) => {
|
|
206
|
-
const value = await cortex.configGet(key)
|
|
207
|
-
if (value) {
|
|
208
|
-
console.log(chalk.green(`${key}: ${value}`))
|
|
209
|
-
} else {
|
|
210
|
-
console.log(chalk.yellow(`Key not found: ${key}`))
|
|
211
|
-
}
|
|
212
|
-
exitProcess(0)
|
|
213
|
-
})
|
|
214
|
-
|
|
215
|
-
config
|
|
216
|
-
.command('list')
|
|
217
|
-
.description('List all configuration')
|
|
218
|
-
.action(wrapAction(async () => {
|
|
219
|
-
await cortex.configList()
|
|
220
|
-
}))
|
|
221
|
-
|
|
222
|
-
config
|
|
223
|
-
.command('import <file>')
|
|
224
|
-
.description('Import configuration from .env file')
|
|
225
|
-
.action(wrapAction(async (file) => {
|
|
226
|
-
await cortex.importEnv(file)
|
|
227
|
-
}))
|
|
228
|
-
|
|
229
|
-
config
|
|
230
|
-
.command('export <file>')
|
|
231
|
-
.description('Export configuration to .env file')
|
|
232
|
-
.action(wrapAction(async (file) => {
|
|
233
|
-
await cortex.exportEnv(file)
|
|
234
|
-
}))
|
|
235
|
-
|
|
236
|
-
config
|
|
237
|
-
.command('key-rotate')
|
|
238
|
-
.description('🔄 Rotate master encryption key')
|
|
239
|
-
.action(wrapInteractive(async () => {
|
|
240
|
-
await cortex.resetMasterKey()
|
|
241
|
-
}))
|
|
242
|
-
|
|
243
|
-
config
|
|
244
|
-
.command('secrets-patterns')
|
|
245
|
-
.description('🛡️ List secret detection patterns')
|
|
246
|
-
.action(wrapAction(async () => {
|
|
247
|
-
await cortex.listSecretPatterns()
|
|
248
|
-
}))
|
|
249
|
-
|
|
250
|
-
config
|
|
251
|
-
.command('secrets-add <pattern>')
|
|
252
|
-
.description('➕ Add custom secret detection pattern')
|
|
253
|
-
.action(wrapAction(async (pattern) => {
|
|
254
|
-
await cortex.addSecretPattern(pattern)
|
|
255
120
|
}))
|
|
256
121
|
|
|
257
|
-
config
|
|
258
|
-
.command('secrets-remove <pattern>')
|
|
259
|
-
.description('➖ Remove custom secret detection pattern')
|
|
260
|
-
.action(wrapAction(async (pattern) => {
|
|
261
|
-
await cortex.removeSecretPattern(pattern)
|
|
262
|
-
}))
|
|
263
|
-
|
|
264
|
-
// Migration commands
|
|
265
122
|
program
|
|
266
|
-
.command('
|
|
267
|
-
.description('
|
|
268
|
-
.
|
|
269
|
-
.
|
|
270
|
-
|
|
271
|
-
.action(wrapInteractive(async (options) => {
|
|
272
|
-
await cortex.migrate(options)
|
|
123
|
+
.command('chat [question]')
|
|
124
|
+
.description('💬 Chat with your data (interactive mode if no question)')
|
|
125
|
+
.option('-l, --llm <model>', 'LLM model to use')
|
|
126
|
+
.action(wrapInteractive(async (question, options) => {
|
|
127
|
+
await cortex.chat(question)
|
|
273
128
|
}))
|
|
274
129
|
|
|
275
|
-
// Database operations
|
|
276
130
|
program
|
|
277
131
|
.command('stats')
|
|
278
132
|
.description('📊 Show database statistics')
|
|
279
|
-
.option('-d, --detailed', 'Show detailed
|
|
133
|
+
.option('-d, --detailed', 'Show detailed statistics')
|
|
280
134
|
.action(wrapAction(async (options) => {
|
|
281
135
|
await cortex.stats(options.detailed)
|
|
282
136
|
}))
|
|
283
137
|
|
|
284
138
|
program
|
|
285
|
-
.command('
|
|
286
|
-
.description('
|
|
287
|
-
.
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
// LLM setup
|
|
292
|
-
program
|
|
293
|
-
.command('llm [provider]')
|
|
294
|
-
.description('🤖 Setup or change LLM provider')
|
|
295
|
-
.action(wrapInteractive(async (provider) => {
|
|
296
|
-
await cortex.setupLLM(provider)
|
|
139
|
+
.command('health')
|
|
140
|
+
.description('🔋 Check system health')
|
|
141
|
+
.option('--auto-fix', 'Automatically apply safe repairs')
|
|
142
|
+
.action(wrapAction(async (options) => {
|
|
143
|
+
await cortex.health(options)
|
|
297
144
|
}))
|
|
298
145
|
|
|
299
|
-
// Embedding utilities
|
|
300
146
|
program
|
|
301
|
-
.command('
|
|
302
|
-
.description('
|
|
303
|
-
.action(
|
|
304
|
-
await cortex.
|
|
147
|
+
.command('find')
|
|
148
|
+
.description('🔍 Interactive advanced search')
|
|
149
|
+
.action(wrapInteractive(async () => {
|
|
150
|
+
await cortex.advancedSearch()
|
|
305
151
|
}))
|
|
306
152
|
|
|
307
153
|
program
|
|
308
|
-
.command('
|
|
309
|
-
.description('
|
|
310
|
-
.action(
|
|
311
|
-
await cortex.
|
|
154
|
+
.command('explore [nodeId]')
|
|
155
|
+
.description('🗺️ Interactively explore graph connections')
|
|
156
|
+
.action(wrapInteractive(async (nodeId) => {
|
|
157
|
+
await cortex.explore(nodeId)
|
|
312
158
|
}))
|
|
313
159
|
|
|
314
160
|
program
|
|
@@ -327,266 +173,291 @@ program
|
|
|
327
173
|
await cortex.restore(file)
|
|
328
174
|
}))
|
|
329
175
|
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
.action(wrapAction(async () => {
|
|
334
|
-
await cortex.health()
|
|
335
|
-
}))
|
|
176
|
+
// ========================================
|
|
177
|
+
// BRAIN CLOUD INTEGRATION
|
|
178
|
+
// ========================================
|
|
336
179
|
|
|
337
|
-
// Backup & Restore commands
|
|
338
180
|
program
|
|
339
|
-
.command('
|
|
340
|
-
.description('
|
|
341
|
-
.option('
|
|
342
|
-
.option('
|
|
343
|
-
.
|
|
344
|
-
|
|
345
|
-
|
|
181
|
+
.command('cloud [action]')
|
|
182
|
+
.description('☁️ Connect to Brain Cloud - AI memory that never forgets')
|
|
183
|
+
.option('--connect <id>', 'Connect to existing Brain Cloud instance')
|
|
184
|
+
.option('--migrate', 'Migrate between local and cloud')
|
|
185
|
+
.action(wrapInteractive(async (action, options) => {
|
|
186
|
+
// For now, show connection instructions
|
|
187
|
+
console.log(chalk.cyan('\n⚛️ BRAIN CLOUD - AI Memory That Never Forgets'))
|
|
188
|
+
console.log(chalk.gray('━'.repeat(50)))
|
|
189
|
+
|
|
190
|
+
if (options.connect) {
|
|
191
|
+
console.log(chalk.green(`✅ Connecting to Brain Cloud instance: ${options.connect}`))
|
|
192
|
+
console.log(chalk.yellow('\nNote: Full cloud integration coming soon!'))
|
|
193
|
+
console.log('\nFor now, visit: ' + chalk.cyan('https://app.soulcraftlabs.com'))
|
|
194
|
+
} else {
|
|
195
|
+
console.log(chalk.yellow('📡 Brain Cloud Setup'))
|
|
196
|
+
console.log('\n1. Sign up at: ' + chalk.cyan('https://app.soulcraftlabs.com'))
|
|
197
|
+
console.log('2. Get your customer ID')
|
|
198
|
+
console.log('3. Connect with: ' + chalk.green('brainy cloud --connect YOUR_ID'))
|
|
199
|
+
console.log('\nBenefits:')
|
|
200
|
+
console.log(' • ' + chalk.green('Never lose AI context again'))
|
|
201
|
+
console.log(' • ' + chalk.green('Sync across all devices'))
|
|
202
|
+
console.log(' • ' + chalk.green('Unlimited memory storage'))
|
|
203
|
+
console.log(' • ' + chalk.green('$19/month or free trial'))
|
|
204
|
+
}
|
|
346
205
|
}))
|
|
347
206
|
|
|
207
|
+
// ========================================
|
|
208
|
+
// AUGMENTATION MANAGEMENT (Direct Commands)
|
|
209
|
+
// ========================================
|
|
210
|
+
|
|
348
211
|
program
|
|
349
|
-
.command('
|
|
350
|
-
.description('
|
|
351
|
-
.option('--
|
|
352
|
-
.option('--
|
|
353
|
-
.action(
|
|
354
|
-
|
|
212
|
+
.command('install <augmentation>')
|
|
213
|
+
.description('📦 Install augmentation')
|
|
214
|
+
.option('-m, --mode <type>', 'Installation mode (free|premium)', 'free')
|
|
215
|
+
.option('-c, --config <json>', 'Configuration as JSON')
|
|
216
|
+
.action(wrapAction(async (augmentation, options) => {
|
|
217
|
+
if (augmentation === 'brain-jar') {
|
|
218
|
+
await cortex.brainJarInstall(options.mode)
|
|
219
|
+
} else {
|
|
220
|
+
// Generic augmentation install
|
|
221
|
+
let config = {}
|
|
222
|
+
if (options.config) {
|
|
223
|
+
try {
|
|
224
|
+
config = JSON.parse(options.config)
|
|
225
|
+
} catch {
|
|
226
|
+
console.error(chalk.red('Invalid JSON configuration'))
|
|
227
|
+
process.exit(1)
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
await cortex.addAugmentation(augmentation, undefined, config)
|
|
231
|
+
}
|
|
355
232
|
}))
|
|
356
233
|
|
|
357
234
|
program
|
|
358
|
-
.command('
|
|
359
|
-
.description('
|
|
360
|
-
.option('-
|
|
361
|
-
.action(wrapAction(async (options) => {
|
|
362
|
-
|
|
235
|
+
.command('run <augmentation>')
|
|
236
|
+
.description('⚡ Run augmentation')
|
|
237
|
+
.option('-c, --config <json>', 'Runtime configuration as JSON')
|
|
238
|
+
.action(wrapAction(async (augmentation, options) => {
|
|
239
|
+
if (augmentation === 'brain-jar') {
|
|
240
|
+
await cortex.brainJarStart(options)
|
|
241
|
+
} else {
|
|
242
|
+
// Generic augmentation execution
|
|
243
|
+
const inputData = options.config ? JSON.parse(options.config) : { run: true }
|
|
244
|
+
await cortex.executePipelineStep(augmentation, inputData)
|
|
245
|
+
}
|
|
363
246
|
}))
|
|
364
247
|
|
|
365
|
-
// Augmentation Management commands
|
|
366
248
|
program
|
|
367
|
-
.command('
|
|
368
|
-
.description('
|
|
369
|
-
.
|
|
370
|
-
|
|
371
|
-
|
|
249
|
+
.command('status [augmentation]')
|
|
250
|
+
.description('📊 Show augmentation status')
|
|
251
|
+
.action(wrapAction(async (augmentation) => {
|
|
252
|
+
if (augmentation === 'brain-jar') {
|
|
253
|
+
await cortex.brainJarStatus()
|
|
254
|
+
} else if (augmentation) {
|
|
255
|
+
// Show specific augmentation status
|
|
256
|
+
await cortex.listAugmentations()
|
|
257
|
+
} else {
|
|
258
|
+
// Show all augmentation status
|
|
259
|
+
await cortex.listAugmentations()
|
|
260
|
+
}
|
|
372
261
|
}))
|
|
373
262
|
|
|
374
|
-
// Performance Monitoring & Health Check commands
|
|
375
263
|
program
|
|
376
|
-
.command('
|
|
377
|
-
.description('
|
|
378
|
-
.
|
|
379
|
-
|
|
380
|
-
|
|
264
|
+
.command('stop [augmentation]')
|
|
265
|
+
.description('⏹️ Stop augmentation')
|
|
266
|
+
.action(wrapAction(async (augmentation) => {
|
|
267
|
+
if (augmentation === 'brain-jar') {
|
|
268
|
+
await cortex.brainJarStop()
|
|
269
|
+
} else {
|
|
270
|
+
console.log(chalk.yellow('Stop functionality for generic augmentations not yet implemented'))
|
|
271
|
+
}
|
|
381
272
|
}))
|
|
382
273
|
|
|
383
274
|
program
|
|
384
|
-
.command('
|
|
385
|
-
.description('
|
|
386
|
-
.option('--
|
|
275
|
+
.command('list')
|
|
276
|
+
.description('📋 List installed augmentations')
|
|
277
|
+
.option('-a, --available', 'Show available augmentations')
|
|
387
278
|
.action(wrapAction(async (options) => {
|
|
388
|
-
|
|
279
|
+
if (options.available) {
|
|
280
|
+
console.log(chalk.cyan('🧩 Available Augmentations:'))
|
|
281
|
+
console.log(' • brain-jar - AI coordination and collaboration')
|
|
282
|
+
console.log(' • encryption - Data encryption and security')
|
|
283
|
+
console.log(' • neural-import - AI-powered data analysis')
|
|
284
|
+
console.log(' • performance-monitor - System monitoring')
|
|
285
|
+
console.log('')
|
|
286
|
+
console.log(chalk.dim('Install: brainy install <augmentation>'))
|
|
287
|
+
} else {
|
|
288
|
+
await cortex.listAugmentations()
|
|
289
|
+
}
|
|
389
290
|
}))
|
|
390
291
|
|
|
292
|
+
// ========================================
|
|
293
|
+
// BRAIN CLOUD SUPER COMMAND (New!)
|
|
294
|
+
// ========================================
|
|
295
|
+
|
|
391
296
|
program
|
|
392
|
-
.command('
|
|
393
|
-
.description('
|
|
394
|
-
.option('--
|
|
395
|
-
.
|
|
396
|
-
|
|
297
|
+
.command('cloud')
|
|
298
|
+
.description('☁️ Setup Brain Cloud - AI coordination across all devices')
|
|
299
|
+
.option('-m, --mode <type>', 'Setup mode (free|premium)', 'interactive')
|
|
300
|
+
.option('-k, --key <key>', 'License key for premium features')
|
|
301
|
+
.option('-s, --skip-install', 'Skip Brain Jar installation')
|
|
302
|
+
.action(wrapInteractive(async (options) => {
|
|
303
|
+
await cortex.setupBrainCloud(options)
|
|
397
304
|
}))
|
|
398
305
|
|
|
399
|
-
//
|
|
400
|
-
|
|
401
|
-
|
|
306
|
+
// ========================================
|
|
307
|
+
// BRAIN JAR SPECIFIC COMMANDS (Rich UX)
|
|
308
|
+
// ========================================
|
|
402
309
|
|
|
403
|
-
|
|
404
|
-
.
|
|
405
|
-
.description('📋 Browse premium features catalog')
|
|
406
|
-
.action(wrapAction(async () => {
|
|
407
|
-
await cortex.licenseCatalog()
|
|
408
|
-
}))
|
|
310
|
+
const brainJar = program.command('brain-jar')
|
|
311
|
+
.description('🧠🫙 AI coordination and collaboration')
|
|
409
312
|
|
|
410
|
-
|
|
411
|
-
.command('
|
|
412
|
-
.description('
|
|
413
|
-
.
|
|
414
|
-
|
|
313
|
+
brainJar
|
|
314
|
+
.command('install')
|
|
315
|
+
.description('📦 Install Brain Jar coordination')
|
|
316
|
+
.option('-m, --mode <type>', 'Installation mode (free|premium)', 'free')
|
|
317
|
+
.action(wrapAction(async (options) => {
|
|
318
|
+
await cortex.brainJarInstall(options.mode)
|
|
415
319
|
}))
|
|
416
320
|
|
|
417
|
-
|
|
418
|
-
.command('
|
|
419
|
-
.description('
|
|
420
|
-
.option('--
|
|
421
|
-
.option('--
|
|
422
|
-
.
|
|
423
|
-
|
|
321
|
+
brainJar
|
|
322
|
+
.command('start')
|
|
323
|
+
.description('🚀 Start Brain Jar coordination')
|
|
324
|
+
.option('-s, --server <url>', 'Custom server URL')
|
|
325
|
+
.option('-n, --name <name>', 'Agent name')
|
|
326
|
+
.option('-r, --role <role>', 'Agent role')
|
|
327
|
+
.action(wrapAction(async (options) => {
|
|
328
|
+
await cortex.brainJarStart(options)
|
|
424
329
|
}))
|
|
425
330
|
|
|
426
|
-
|
|
427
|
-
.command('
|
|
428
|
-
.description('
|
|
429
|
-
.
|
|
430
|
-
|
|
331
|
+
brainJar
|
|
332
|
+
.command('dashboard')
|
|
333
|
+
.description('📊 Open Brain Jar dashboard')
|
|
334
|
+
.option('-o, --open', 'Auto-open in browser', true)
|
|
335
|
+
.action(wrapAction(async (options) => {
|
|
336
|
+
await cortex.brainJarDashboard(options.open)
|
|
431
337
|
}))
|
|
432
338
|
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
.description('
|
|
436
|
-
|
|
437
|
-
augment
|
|
438
|
-
.command('list')
|
|
439
|
-
.description('📋 List all augmentations and pipeline status')
|
|
339
|
+
brainJar
|
|
340
|
+
.command('status')
|
|
341
|
+
.description('🔍 Show Brain Jar status')
|
|
440
342
|
.action(wrapAction(async () => {
|
|
441
|
-
await cortex.
|
|
343
|
+
await cortex.brainJarStatus()
|
|
442
344
|
}))
|
|
443
345
|
|
|
444
|
-
|
|
445
|
-
.command('
|
|
446
|
-
.description('
|
|
447
|
-
.
|
|
448
|
-
|
|
449
|
-
.action(wrapAction(async (type, options) => {
|
|
450
|
-
let config = {}
|
|
451
|
-
if (options.config) {
|
|
452
|
-
try {
|
|
453
|
-
config = JSON.parse(options.config)
|
|
454
|
-
} catch {
|
|
455
|
-
console.error(chalk.red('Invalid JSON configuration'))
|
|
456
|
-
process.exit(1)
|
|
457
|
-
}
|
|
458
|
-
}
|
|
459
|
-
await cortex.addAugmentation(type, options.position ? parseInt(options.position) : undefined, config)
|
|
460
|
-
}))
|
|
461
|
-
|
|
462
|
-
augment
|
|
463
|
-
.command('remove <type>')
|
|
464
|
-
.description('➖ Remove augmentation from pipeline')
|
|
465
|
-
.action(wrapAction(async (type) => {
|
|
466
|
-
await cortex.removeAugmentation(type)
|
|
346
|
+
brainJar
|
|
347
|
+
.command('agents')
|
|
348
|
+
.description('👥 List connected agents')
|
|
349
|
+
.action(wrapAction(async () => {
|
|
350
|
+
await cortex.brainJarAgents()
|
|
467
351
|
}))
|
|
468
352
|
|
|
469
|
-
|
|
470
|
-
.command('
|
|
471
|
-
.description('
|
|
472
|
-
.action(wrapAction(async (
|
|
473
|
-
|
|
474
|
-
try {
|
|
475
|
-
config = JSON.parse(configJson)
|
|
476
|
-
} catch {
|
|
477
|
-
console.error(chalk.red('Invalid JSON configuration'))
|
|
478
|
-
process.exit(1)
|
|
479
|
-
}
|
|
480
|
-
await cortex.configureAugmentation(type, config)
|
|
353
|
+
brainJar
|
|
354
|
+
.command('message <text>')
|
|
355
|
+
.description('📨 Send message to coordination channel')
|
|
356
|
+
.action(wrapAction(async (text) => {
|
|
357
|
+
await cortex.brainJarMessage(text)
|
|
481
358
|
}))
|
|
482
359
|
|
|
483
|
-
|
|
484
|
-
.command('
|
|
485
|
-
.description('
|
|
486
|
-
.
|
|
487
|
-
|
|
360
|
+
brainJar
|
|
361
|
+
.command('search <query>')
|
|
362
|
+
.description('🔍 Search coordination history')
|
|
363
|
+
.option('-l, --limit <number>', 'Number of results', '10')
|
|
364
|
+
.action(wrapAction(async (query, options) => {
|
|
365
|
+
await cortex.brainJarSearch(query, parseInt(options.limit))
|
|
488
366
|
}))
|
|
489
367
|
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
.action(wrapAction(async (step, data) => {
|
|
494
|
-
const inputData = data ? JSON.parse(data) : { test: true }
|
|
495
|
-
await cortex.executePipelineStep(step, inputData)
|
|
496
|
-
}))
|
|
368
|
+
// ========================================
|
|
369
|
+
// CONFIGURATION COMMANDS
|
|
370
|
+
// ========================================
|
|
497
371
|
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
.description('🧠 AI-powered data analysis and import')
|
|
501
|
-
|
|
502
|
-
neural
|
|
503
|
-
.command('import <file>')
|
|
504
|
-
.description('🧠 Smart import with AI analysis')
|
|
505
|
-
.option('-c, --confidence <threshold>', 'Confidence threshold (0-1)', '0.7')
|
|
506
|
-
.option('-a, --auto-apply', 'Auto-apply without confirmation')
|
|
507
|
-
.option('-w, --enable-weights', 'Enable relationship weights', true)
|
|
508
|
-
.option('--skip-duplicates', 'Skip duplicate detection', true)
|
|
509
|
-
.action(wrapInteractive(async (file, options) => {
|
|
510
|
-
const importOptions = {
|
|
511
|
-
confidenceThreshold: parseFloat(options.confidence),
|
|
512
|
-
autoApply: options.autoApply,
|
|
513
|
-
enableWeights: options.enableWeights,
|
|
514
|
-
skipDuplicates: options.skipDuplicates
|
|
515
|
-
}
|
|
516
|
-
await cortex.neuralImport(file, importOptions)
|
|
517
|
-
}))
|
|
372
|
+
const config = program.command('config')
|
|
373
|
+
.description('⚙️ Manage configuration')
|
|
518
374
|
|
|
519
|
-
|
|
520
|
-
.command('
|
|
521
|
-
.description('
|
|
522
|
-
.
|
|
523
|
-
|
|
375
|
+
config
|
|
376
|
+
.command('set <key> <value>')
|
|
377
|
+
.description('Set configuration value')
|
|
378
|
+
.option('-e, --encrypt', 'Encrypt this value')
|
|
379
|
+
.action(wrapAction(async (key, value, options) => {
|
|
380
|
+
await cortex.configSet(key, value, options)
|
|
524
381
|
}))
|
|
525
382
|
|
|
526
|
-
|
|
527
|
-
.command('
|
|
528
|
-
.description('
|
|
529
|
-
.action(wrapAction(async (
|
|
530
|
-
await cortex.
|
|
383
|
+
config
|
|
384
|
+
.command('get <key>')
|
|
385
|
+
.description('Get configuration value')
|
|
386
|
+
.action(wrapAction(async (key) => {
|
|
387
|
+
const value = await cortex.configGet(key)
|
|
388
|
+
if (value) {
|
|
389
|
+
console.log(chalk.green(`${key}: ${value}`))
|
|
390
|
+
} else {
|
|
391
|
+
console.log(chalk.yellow(`Key not found: ${key}`))
|
|
392
|
+
}
|
|
531
393
|
}))
|
|
532
394
|
|
|
533
|
-
|
|
534
|
-
.command('
|
|
535
|
-
.description('
|
|
395
|
+
config
|
|
396
|
+
.command('list')
|
|
397
|
+
.description('List all configuration')
|
|
536
398
|
.action(wrapAction(async () => {
|
|
537
|
-
await cortex.
|
|
399
|
+
await cortex.configList()
|
|
538
400
|
}))
|
|
539
401
|
|
|
540
|
-
//
|
|
541
|
-
|
|
542
|
-
|
|
402
|
+
// ========================================
|
|
403
|
+
// LEGACY CORTEX COMMANDS (Backward Compatibility)
|
|
404
|
+
// ========================================
|
|
543
405
|
|
|
544
|
-
|
|
545
|
-
.
|
|
546
|
-
.description('🔍 Discover Brainy services in environment')
|
|
547
|
-
.action(wrapAction(async () => {
|
|
548
|
-
console.log('🔍 Discovering services...')
|
|
549
|
-
// This would call CortexServiceIntegration.discoverBrainyInstances()
|
|
550
|
-
console.log('📋 Service discovery complete (placeholder)')
|
|
551
|
-
}))
|
|
406
|
+
const cortexCmd = program.command('cortex')
|
|
407
|
+
.description('🔧 Legacy Cortex commands (deprecated - use direct commands)')
|
|
552
408
|
|
|
553
|
-
|
|
554
|
-
.command('
|
|
555
|
-
.description('
|
|
556
|
-
.action(
|
|
557
|
-
console.log('
|
|
558
|
-
|
|
559
|
-
console.log('✅ Health checks complete (placeholder)')
|
|
409
|
+
cortexCmd
|
|
410
|
+
.command('chat [question]')
|
|
411
|
+
.description('💬 Chat with your data')
|
|
412
|
+
.action(wrapInteractive(async (question) => {
|
|
413
|
+
console.log(chalk.yellow('⚠️ Deprecated: Use "brainy chat" instead'))
|
|
414
|
+
await cortex.chat(question)
|
|
560
415
|
}))
|
|
561
416
|
|
|
562
|
-
|
|
563
|
-
.command('
|
|
564
|
-
.description('
|
|
565
|
-
.
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
console.log(`🚀 Planning migration to ${options.to}...`)
|
|
569
|
-
// This would call CortexServiceIntegration.migrateAll()
|
|
570
|
-
console.log('✅ Migration complete (placeholder)')
|
|
417
|
+
cortexCmd
|
|
418
|
+
.command('add [data]')
|
|
419
|
+
.description('📊 Add data')
|
|
420
|
+
.action(wrapAction(async (data) => {
|
|
421
|
+
console.log(chalk.yellow('⚠️ Deprecated: Use "brainy add" instead'))
|
|
422
|
+
await cortex.add(data, {})
|
|
571
423
|
}))
|
|
572
424
|
|
|
573
|
-
//
|
|
425
|
+
// ========================================
|
|
426
|
+
// INTERACTIVE SHELL
|
|
427
|
+
// ========================================
|
|
428
|
+
|
|
574
429
|
program
|
|
575
430
|
.command('shell')
|
|
576
|
-
.description('🐚 Interactive
|
|
577
|
-
.action(async () => {
|
|
578
|
-
console.log(chalk.cyan('🧠
|
|
431
|
+
.description('🐚 Interactive Brainy shell')
|
|
432
|
+
.action(wrapInteractive(async () => {
|
|
433
|
+
console.log(chalk.cyan('🧠 Brainy Interactive Shell'))
|
|
579
434
|
console.log(chalk.dim('Type "help" for commands, "exit" to quit\n'))
|
|
580
|
-
|
|
581
|
-
// Start interactive mode
|
|
582
435
|
await cortex.chat()
|
|
583
|
-
|
|
584
|
-
|
|
436
|
+
}))
|
|
437
|
+
|
|
438
|
+
// ========================================
|
|
439
|
+
// PARSE AND HANDLE
|
|
440
|
+
// ========================================
|
|
585
441
|
|
|
586
|
-
// Parse arguments
|
|
587
442
|
program.parse(process.argv)
|
|
588
443
|
|
|
589
444
|
// Show help if no command
|
|
590
445
|
if (!process.argv.slice(2).length) {
|
|
446
|
+
console.log(chalk.cyan('🧠☁️ Brainy - AI Coordination Service'))
|
|
447
|
+
console.log('')
|
|
448
|
+
console.log(chalk.bold('One-Command Setup:'))
|
|
449
|
+
console.log(chalk.green(' brainy cloud # Setup Brain Cloud (recommended!)'))
|
|
450
|
+
console.log('')
|
|
451
|
+
console.log(chalk.bold('Quick Start:'))
|
|
452
|
+
console.log(' brainy init # Initialize project')
|
|
453
|
+
console.log(' brainy add "some data" # Add data')
|
|
454
|
+
console.log(' brainy search "query" # Search data')
|
|
455
|
+
console.log(' brainy chat # Chat with data')
|
|
456
|
+
console.log('')
|
|
457
|
+
console.log(chalk.bold('AI Coordination:'))
|
|
458
|
+
console.log(' brainy install brain-jar # Install AI coordination')
|
|
459
|
+
console.log(' brainy brain-jar start # Start coordination')
|
|
460
|
+
console.log(' brainy brain-jar dashboard # View dashboard')
|
|
461
|
+
console.log('')
|
|
591
462
|
program.outputHelp()
|
|
592
463
|
}
|