@soulcraft/brainy 1.1.1 → 1.2.0
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 +94 -27
- package/dist/brainyData.d.ts +0 -1
- package/dist/brainyData.js +0 -4
- package/package.json +3 -1
package/bin/brainy.js
CHANGED
|
@@ -19,6 +19,8 @@ import { readFileSync } from 'fs'
|
|
|
19
19
|
import { dirname, join } from 'path'
|
|
20
20
|
import { fileURLToPath } from 'url'
|
|
21
21
|
import { createInterface } from 'readline'
|
|
22
|
+
// @ts-ignore
|
|
23
|
+
import Table from 'cli-table3'
|
|
22
24
|
|
|
23
25
|
const __dirname = dirname(fileURLToPath(import.meta.url))
|
|
24
26
|
const packageJson = JSON.parse(readFileSync(join(__dirname, '..', 'package.json'), 'utf8'))
|
|
@@ -33,13 +35,20 @@ const getBrainy = async () => {
|
|
|
33
35
|
return brainy
|
|
34
36
|
}
|
|
35
37
|
|
|
36
|
-
// Beautiful colors
|
|
38
|
+
// Beautiful colors matching brainy.png logo
|
|
37
39
|
const colors = {
|
|
38
|
-
primary: chalk.hex('#3A5F4A'),
|
|
39
|
-
success: chalk.hex('#2D4A3A'),
|
|
40
|
-
info: chalk.hex('#4A6B5A'),
|
|
41
|
-
warning: chalk.hex('#D67441'),
|
|
42
|
-
error: chalk.hex('#B85C35')
|
|
40
|
+
primary: chalk.hex('#3A5F4A'), // Teal container (from logo)
|
|
41
|
+
success: chalk.hex('#2D4A3A'), // Deep teal frame (from logo)
|
|
42
|
+
info: chalk.hex('#4A6B5A'), // Medium teal
|
|
43
|
+
warning: chalk.hex('#D67441'), // Orange (from logo)
|
|
44
|
+
error: chalk.hex('#B85C35'), // Deep orange
|
|
45
|
+
brain: chalk.hex('#D67441'), // Brain orange (from logo)
|
|
46
|
+
cream: chalk.hex('#F5E6A3'), // Cream background (from logo)
|
|
47
|
+
dim: chalk.dim,
|
|
48
|
+
blue: chalk.blue,
|
|
49
|
+
green: chalk.green,
|
|
50
|
+
yellow: chalk.yellow,
|
|
51
|
+
cyan: chalk.cyan
|
|
43
52
|
}
|
|
44
53
|
|
|
45
54
|
// Helper functions
|
|
@@ -47,6 +56,11 @@ const exitProcess = (code = 0) => {
|
|
|
47
56
|
setTimeout(() => process.exit(code), 100)
|
|
48
57
|
}
|
|
49
58
|
|
|
59
|
+
// Initialize Brainy instance
|
|
60
|
+
const initBrainy = async () => {
|
|
61
|
+
return new BrainyData()
|
|
62
|
+
}
|
|
63
|
+
|
|
50
64
|
const wrapAction = (fn) => {
|
|
51
65
|
return async (...args) => {
|
|
52
66
|
try {
|
|
@@ -984,28 +998,81 @@ program
|
|
|
984
998
|
|
|
985
999
|
const actions = {
|
|
986
1000
|
list: async () => {
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
1001
|
+
try {
|
|
1002
|
+
// Use unified professional catalog
|
|
1003
|
+
const REGISTRY_URL = 'https://registry.soulcraft.com/api/registry/augmentations'
|
|
1004
|
+
const response = await fetch(REGISTRY_URL)
|
|
1005
|
+
|
|
1006
|
+
if (response && response.ok) {
|
|
1007
|
+
console.log(colors.brain('🏢 SOULCRAFT PROFESSIONAL SUITE\n'))
|
|
1008
|
+
|
|
1009
|
+
const data = await response.json()
|
|
1010
|
+
const { augmentations = [] } = data
|
|
1011
|
+
|
|
1012
|
+
const professional = augmentations.filter(a => a.tier === 'professional')
|
|
1013
|
+
const community = augmentations.filter(a => a.tier === 'community')
|
|
1014
|
+
|
|
1015
|
+
// Display professional augmentations
|
|
1016
|
+
if (professional.length > 0) {
|
|
1017
|
+
console.log(colors.primary('🚀 PROFESSIONAL AUGMENTATIONS'))
|
|
1018
|
+
professional.forEach(aug => {
|
|
1019
|
+
const pricing = aug.pricing === 'FREE' ? colors.success(aug.pricing) : colors.yellow(aug.pricing)
|
|
1020
|
+
const badges = aug.verified ? colors.blue('✓') : ''
|
|
1021
|
+
console.log(` ${aug.name.padEnd(20)} ${pricing.padEnd(15)} ${badges}`)
|
|
1022
|
+
console.log(` ${colors.dim(aug.description)}`)
|
|
1023
|
+
if (aug.businessValue) {
|
|
1024
|
+
console.log(` ${colors.cyan('→ ' + aug.businessValue)}`)
|
|
1025
|
+
}
|
|
1026
|
+
console.log('')
|
|
1027
|
+
})
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
// Display local augmentations
|
|
1031
|
+
const localAugmentations = brainy.listAugmentations()
|
|
1032
|
+
if (localAugmentations.length > 0) {
|
|
1033
|
+
console.log(colors.primary('📦 LOCAL AUGMENTATIONS'))
|
|
1034
|
+
localAugmentations.forEach(aug => {
|
|
1035
|
+
const status = aug.enabled ? colors.success('✅ Enabled') : colors.dim('⚪ Disabled')
|
|
1036
|
+
console.log(` ${aug.name.padEnd(20)} ${status}`)
|
|
1037
|
+
console.log(` ${colors.dim(aug.description || 'Custom augmentation')}`)
|
|
1038
|
+
console.log('')
|
|
1039
|
+
})
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
console.log(colors.cyan('🎯 GET STARTED'))
|
|
1043
|
+
console.log(' brainy install <name> Install augmentation')
|
|
1044
|
+
console.log(' brainy cloud Access Brain Cloud features')
|
|
1045
|
+
console.log(` ${colors.blue('Learn more:')} https://soulcraft.com/augmentations`)
|
|
1046
|
+
|
|
1047
|
+
} else {
|
|
1048
|
+
throw new Error('Registry unavailable')
|
|
1049
|
+
}
|
|
1050
|
+
} catch (error) {
|
|
1051
|
+
// Fallback to local augmentations only
|
|
1052
|
+
console.log(colors.warning('⚠ Professional catalog unavailable, showing local augmentations'))
|
|
1053
|
+
const augmentations = brainy.listAugmentations()
|
|
1054
|
+
if (augmentations.length === 0) {
|
|
1055
|
+
console.log(colors.warning('No augmentations registered'))
|
|
1056
|
+
return
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
const table = new Table({
|
|
1060
|
+
head: [colors.brain('Name'), colors.brain('Type'), colors.brain('Status'), colors.brain('Description')],
|
|
1061
|
+
style: { head: [], border: [] }
|
|
1062
|
+
})
|
|
1063
|
+
|
|
1064
|
+
augmentations.forEach(aug => {
|
|
1065
|
+
table.push([
|
|
1066
|
+
colors.primary(aug.name),
|
|
1067
|
+
colors.info(aug.type),
|
|
1068
|
+
aug.enabled ? colors.success('✅ Enabled') : colors.dim('⚪ Disabled'),
|
|
1069
|
+
colors.dim(aug.description || '')
|
|
1070
|
+
])
|
|
1071
|
+
})
|
|
1072
|
+
|
|
1073
|
+
console.log(table.toString())
|
|
1074
|
+
console.log(colors.info(`\nTotal: ${augmentations.length} augmentations`))
|
|
991
1075
|
}
|
|
992
|
-
|
|
993
|
-
const table = new Table({
|
|
994
|
-
head: [colors.brain('Name'), colors.brain('Type'), colors.brain('Status'), colors.brain('Description')],
|
|
995
|
-
style: { head: [], border: [] }
|
|
996
|
-
})
|
|
997
|
-
|
|
998
|
-
augmentations.forEach(aug => {
|
|
999
|
-
table.push([
|
|
1000
|
-
colors.primary(aug.name),
|
|
1001
|
-
colors.info(aug.type),
|
|
1002
|
-
aug.enabled ? colors.success('✅ Enabled') : colors.dim('⚪ Disabled'),
|
|
1003
|
-
colors.dim(aug.description || '')
|
|
1004
|
-
])
|
|
1005
|
-
})
|
|
1006
|
-
|
|
1007
|
-
console.log(table.toString())
|
|
1008
|
-
console.log(colors.info(`\nTotal: ${augmentations.length} augmentations`))
|
|
1009
1076
|
},
|
|
1010
1077
|
|
|
1011
1078
|
enable: async () => {
|
package/dist/brainyData.d.ts
CHANGED
|
@@ -945,7 +945,6 @@ export declare class BrainyData<T = any> implements BrainyDataInterface<T> {
|
|
|
945
945
|
* @deprecated Use add() instead - it's smart by default now
|
|
946
946
|
* @hidden
|
|
947
947
|
*/
|
|
948
|
-
addSmart(vectorOrData: Vector | any, metadata?: T, options?: any): Promise<string>;
|
|
949
948
|
/**
|
|
950
949
|
* Get the number of nouns in the database (excluding verbs)
|
|
951
950
|
* This is used for statistics reporting to match the expected behavior in tests
|
package/dist/brainyData.js
CHANGED
|
@@ -3206,10 +3206,6 @@ export class BrainyData {
|
|
|
3206
3206
|
* @deprecated Use add() instead - it's smart by default now
|
|
3207
3207
|
* @hidden
|
|
3208
3208
|
*/
|
|
3209
|
-
async addSmart(vectorOrData, metadata, options = {}) {
|
|
3210
|
-
console.warn('⚠️ addSmart() is deprecated. Use add() instead - it\'s smart by default now!');
|
|
3211
|
-
return this.add(vectorOrData, metadata, { ...options, process: 'auto' });
|
|
3212
|
-
}
|
|
3213
3209
|
/**
|
|
3214
3210
|
* Get the number of nouns in the database (excluding verbs)
|
|
3215
3211
|
* This is used for statistics reporting to match the expected behavior in tests
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soulcraft/brainy",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Multi-Dimensional AI Database - Vector similarity, graph relationships, metadata facets with HNSW indexing and OPFS storage",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -196,6 +196,8 @@
|
|
|
196
196
|
"@vitejs/plugin-basic-ssl": "^2.1.0",
|
|
197
197
|
"@vitest/coverage-v8": "^3.2.4",
|
|
198
198
|
"@vitest/ui": "^3.2.4",
|
|
199
|
+
"aws-sdk-client-mock": "^4.1.0",
|
|
200
|
+
"aws-sdk-client-mock-jest": "^4.1.0",
|
|
199
201
|
"buffer": "^6.0.3",
|
|
200
202
|
"crypto-browserify": "^3.12.1",
|
|
201
203
|
"eslint": "^9.0.0",
|