**chore(version): bump version to 0.9.18 and update build configurations**
- Updated version to `0.9.18` in `package.json`, `cli-package/package.json`, and `src/utils/version.ts`. - Updated npm badge in `README.md` to reflect version `0.9.18`. - Adjusted `publish-cli.js` to synchronize publishing of the main and CLI packages with enhanced build steps. - Introduced `tsconfig.json` updates to include type paths (`types.d.ts`) in CLI for better type handling. - Refined CLI scripts for improved TypeScript annotations and better code structure. - Removed `@types/omelette` and `omelette` dependencies along with associated CLI configurations to simplify the codebase. - Updated `.gitignore` to exclude CLI `dist` directory for cleaner repository management. - Added `deploy:both` npm script for combined publishing of main and CLI packages. This release ensures version consistency, improves CLI workflows, and enhances type handling while decluttering unused dependencies.
This commit is contained in:
parent
65e94feaed
commit
caf1353e7c
10 changed files with 266 additions and 130 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -50,3 +50,4 @@ Thumbs.db
|
||||||
# Generated files
|
# Generated files
|
||||||
/encoded-image.html
|
/encoded-image.html
|
||||||
/encoded-image.txt
|
/encoded-image.txt
|
||||||
|
/cli-package/dist/
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
[](https://nodejs.org/)
|
[](https://nodejs.org/)
|
||||||
[](https://www.typescriptlang.org/)
|
[](https://www.typescriptlang.org/)
|
||||||
[](CONTRIBUTING.md)
|
[](CONTRIBUTING.md)
|
||||||
[](https://www.npmjs.com/package/@soulcraft/brainy)
|
[](https://www.npmjs.com/package/@soulcraft/brainy)
|
||||||
|
|
||||||
[//]: # ([](https://github.com/sodal-project/cartographer))
|
[//]: # ([](https://github.com/sodal-project/cartographer))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@soulcraft/brainy-cli",
|
"name": "@soulcraft/brainy-cli",
|
||||||
"version": "0.9.17",
|
"version": "0.9.18",
|
||||||
"description": "Command-line interface for the Brainy vector graph database",
|
"description": "Command-line interface for the Brainy vector graph database",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"bin": {
|
"bin": {
|
||||||
|
|
@ -39,7 +39,7 @@
|
||||||
"url": "https://github.com/soulcraft-research/brainy.git"
|
"url": "https://github.com/soulcraft-research/brainy.git"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@soulcraft/brainy": "0.9.17",
|
"@soulcraft/brainy": "0.9.18",
|
||||||
"commander": "^14.0.0",
|
"commander": "^14.0.0",
|
||||||
"omelette": "^0.4.17"
|
"omelette": "^0.4.17"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,16 @@
|
||||||
* A command-line interface for interacting with the Brainy vector database
|
* A command-line interface for interacting with the Brainy vector database
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { BrainyData, NounType, VerbType, FileSystemStorage, sequentialPipeline, augmentationPipeline, ExecutionMode, AugmentationType } from '@soulcraft/brainy'
|
import {
|
||||||
|
BrainyData,
|
||||||
|
NounType,
|
||||||
|
VerbType,
|
||||||
|
FileSystemStorage,
|
||||||
|
sequentialPipeline,
|
||||||
|
augmentationPipeline,
|
||||||
|
ExecutionMode,
|
||||||
|
AugmentationType
|
||||||
|
} from '@soulcraft/brainy'
|
||||||
import { fileURLToPath } from 'url'
|
import { fileURLToPath } from 'url'
|
||||||
import { dirname, join } from 'path'
|
import { dirname, join } from 'path'
|
||||||
import fs from 'fs'
|
import fs from 'fs'
|
||||||
|
|
@ -145,18 +154,28 @@ program
|
||||||
const results = await db.searchText(query, limit)
|
const results = await db.searchText(query, limit)
|
||||||
|
|
||||||
console.log(`Search results for "${query}":`)
|
console.log(`Search results for "${query}":`)
|
||||||
results.forEach((result, index) => {
|
results.forEach(
|
||||||
console.log(`${index + 1}. ID: ${result.id}`)
|
(
|
||||||
console.log(` Score: ${result.score.toFixed(4)}`)
|
result: {
|
||||||
console.log(` Metadata: ${JSON.stringify(result.metadata)}`)
|
id: string
|
||||||
console.log(
|
score: number
|
||||||
` Vector: [${result.vector
|
metadata: any
|
||||||
.slice(0, 3)
|
vector: number[]
|
||||||
.map((v) => v.toFixed(2))
|
},
|
||||||
.join(', ')}...]`
|
index: number
|
||||||
)
|
) => {
|
||||||
console.log()
|
console.log(`${index + 1}. ID: ${result.id}`)
|
||||||
})
|
console.log(` Score: ${result.score.toFixed(4)}`)
|
||||||
|
console.log(` Metadata: ${JSON.stringify(result.metadata)}`)
|
||||||
|
console.log(
|
||||||
|
` Vector: [${result.vector
|
||||||
|
.slice(0, 3)
|
||||||
|
.map((v: number) => v.toFixed(2))
|
||||||
|
.join(', ')}...]`
|
||||||
|
)
|
||||||
|
console.log()
|
||||||
|
}
|
||||||
|
)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error:', (error as Error).message)
|
console.error('Error:', (error as Error).message)
|
||||||
process.exit(1)
|
process.exit(1)
|
||||||
|
|
@ -179,7 +198,7 @@ program
|
||||||
console.log(
|
console.log(
|
||||||
`Vector: [${noun.vector
|
`Vector: [${noun.vector
|
||||||
.slice(0, 5)
|
.slice(0, 5)
|
||||||
.map((v) => v.toFixed(2))
|
.map((v: number) => v.toFixed(2))
|
||||||
.join(', ')}...]`
|
.join(', ')}...]`
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -252,15 +271,24 @@ program
|
||||||
if (verbs.length === 0) {
|
if (verbs.length === 0) {
|
||||||
console.log('No relationships found')
|
console.log('No relationships found')
|
||||||
} else {
|
} else {
|
||||||
verbs.forEach((verb, index) => {
|
verbs.forEach(
|
||||||
console.log(`${index + 1}. ID: ${verb.id}`)
|
(
|
||||||
console.log(
|
verb: {
|
||||||
` Type: ${Object.keys(VerbType).find((key) => VerbType[key as keyof typeof VerbType] === verb.metadata.verb) || verb.metadata.verb}`
|
id: string
|
||||||
)
|
targetId: string
|
||||||
console.log(` Target: ${verb.targetId}`)
|
metadata: { verb: VerbType; [key: string]: any }
|
||||||
console.log(` Metadata: ${JSON.stringify(verb.metadata)}`)
|
},
|
||||||
console.log()
|
index: number
|
||||||
})
|
) => {
|
||||||
|
console.log(`${index + 1}. ID: ${verb.id}`)
|
||||||
|
console.log(
|
||||||
|
` Type: ${Object.keys(VerbType).find((key) => VerbType[key as keyof typeof VerbType] === verb.metadata.verb) || verb.metadata.verb}`
|
||||||
|
)
|
||||||
|
console.log(` Target: ${verb.targetId}`)
|
||||||
|
console.log(` Metadata: ${JSON.stringify(verb.metadata)}`)
|
||||||
|
console.log()
|
||||||
|
}
|
||||||
|
)
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error:', (error as Error).message)
|
console.error('Error:', (error as Error).message)
|
||||||
|
|
@ -734,7 +762,9 @@ program
|
||||||
// Print some sample IDs
|
// Print some sample IDs
|
||||||
if (result.nounIds.length > 0) {
|
if (result.nounIds.length > 0) {
|
||||||
console.log('\nSample noun IDs:')
|
console.log('\nSample noun IDs:')
|
||||||
result.nounIds.slice(0, 3).forEach((id) => console.log(`- ${id}`))
|
result.nounIds
|
||||||
|
.slice(0, 3)
|
||||||
|
.forEach((id: string) => console.log(`- ${id}`))
|
||||||
if (result.nounIds.length > 3) {
|
if (result.nounIds.length > 3) {
|
||||||
console.log(`... and ${result.nounIds.length - 3} more`)
|
console.log(`... and ${result.nounIds.length - 3} more`)
|
||||||
}
|
}
|
||||||
|
|
@ -742,7 +772,9 @@ program
|
||||||
|
|
||||||
if (result.verbIds.length > 0) {
|
if (result.verbIds.length > 0) {
|
||||||
console.log('\nSample verb IDs:')
|
console.log('\nSample verb IDs:')
|
||||||
result.verbIds.slice(0, 3).forEach((id) => console.log(`- ${id}`))
|
result.verbIds
|
||||||
|
.slice(0, 3)
|
||||||
|
.forEach((id: string) => console.log(`- ${id}`))
|
||||||
if (result.verbIds.length > 3) {
|
if (result.verbIds.length > 3) {
|
||||||
console.log(`... and ${result.verbIds.length - 3} more`)
|
console.log(`... and ${result.verbIds.length - 3} more`)
|
||||||
}
|
}
|
||||||
|
|
@ -928,7 +960,7 @@ augmentCommand
|
||||||
if (availableTypes.length === 0) {
|
if (availableTypes.length === 0) {
|
||||||
console.log(' No augmentation types available')
|
console.log(' No augmentation types available')
|
||||||
} else {
|
} else {
|
||||||
availableTypes.forEach((type) => {
|
availableTypes.forEach((type: string) => {
|
||||||
const augmentations =
|
const augmentations =
|
||||||
augmentationPipeline.getAugmentationsByType(type)
|
augmentationPipeline.getAugmentationsByType(type)
|
||||||
console.log(
|
console.log(
|
||||||
|
|
@ -938,10 +970,18 @@ augmentCommand
|
||||||
if (augmentations.length === 0) {
|
if (augmentations.length === 0) {
|
||||||
console.log(' No augmentations registered for this type')
|
console.log(' No augmentations registered for this type')
|
||||||
} else {
|
} else {
|
||||||
augmentations.forEach((aug) => {
|
augmentations.forEach(
|
||||||
console.log(` - ${aug.name}: ${aug.description}`)
|
(aug: {
|
||||||
console.log(` Status: ${aug.enabled ? 'Enabled' : 'Disabled'}`)
|
name: string
|
||||||
})
|
description: string
|
||||||
|
enabled: boolean
|
||||||
|
}) => {
|
||||||
|
console.log(` - ${aug.name}: ${aug.description}`)
|
||||||
|
console.log(
|
||||||
|
` Status: ${aug.enabled ? 'Enabled' : 'Disabled'}`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -952,10 +992,12 @@ augmentCommand
|
||||||
if (webSocketAugs.length === 0) {
|
if (webSocketAugs.length === 0) {
|
||||||
console.log(' No WebSocket-enabled augmentations available')
|
console.log(' No WebSocket-enabled augmentations available')
|
||||||
} else {
|
} else {
|
||||||
webSocketAugs.forEach((aug) => {
|
webSocketAugs.forEach(
|
||||||
console.log(` - ${aug.name}: ${aug.description}`)
|
(aug: { name: string; description: string; enabled: boolean }) => {
|
||||||
console.log(` Status: ${aug.enabled ? 'Enabled' : 'Disabled'}`)
|
console.log(` - ${aug.name}: ${aug.description}`)
|
||||||
})
|
console.log(` Status: ${aug.enabled ? 'Enabled' : 'Disabled'}`)
|
||||||
|
}
|
||||||
|
)
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error:', (error as Error).message)
|
console.error('Error:', (error as Error).message)
|
||||||
|
|
@ -1023,7 +1065,14 @@ augmentCommand
|
||||||
console.log('\nStage Results:')
|
console.log('\nStage Results:')
|
||||||
|
|
||||||
// Display stage results
|
// Display stage results
|
||||||
Object.entries(result.stageResults).forEach(([stage, stageResult]) => {
|
Object.entries(result.stageResults).forEach((entry) => {
|
||||||
|
const stage = entry[0]
|
||||||
|
const stageResult = entry[1] as {
|
||||||
|
success?: boolean
|
||||||
|
error?: string
|
||||||
|
data?: any
|
||||||
|
}
|
||||||
|
|
||||||
console.log(`\n${stage.toUpperCase()}:`)
|
console.log(`\n${stage.toUpperCase()}:`)
|
||||||
console.log(` Success: ${stageResult?.success}`)
|
console.log(` Success: ${stageResult?.success}`)
|
||||||
|
|
||||||
|
|
@ -1036,7 +1085,7 @@ augmentCommand
|
||||||
console.log(
|
console.log(
|
||||||
JSON.stringify(stageResult.data, null, 2)
|
JSON.stringify(stageResult.data, null, 2)
|
||||||
.split('\n')
|
.split('\n')
|
||||||
.map((line) => ` ${line}`)
|
.map((line: string) => ` ${line}`)
|
||||||
.join('\n')
|
.join('\n')
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
@ -1085,36 +1134,49 @@ augmentCommand
|
||||||
// Process the data asynchronously without blocking
|
// Process the data asynchronously without blocking
|
||||||
sequentialPipeline
|
sequentialPipeline
|
||||||
.processData(data, options.dataType, { stopOnError: false })
|
.processData(data, options.dataType, { stopOnError: false })
|
||||||
.then((result) => {
|
.then(
|
||||||
console.log(`\nProcessed: "${data}"`)
|
(result: {
|
||||||
console.log(`Success: ${result.success}`)
|
success: boolean
|
||||||
|
error?: string
|
||||||
|
data?: any
|
||||||
|
stageResults: Record<
|
||||||
|
string,
|
||||||
|
{ success?: boolean; error?: string; data?: any }
|
||||||
|
>
|
||||||
|
}) => {
|
||||||
|
console.log(`\nProcessed: "${data}"`)
|
||||||
|
console.log(`Success: ${result.success}`)
|
||||||
|
|
||||||
if (options.verbose) {
|
if (options.verbose) {
|
||||||
console.log('Stage Results:')
|
console.log('Stage Results:')
|
||||||
Object.entries(result.stageResults).forEach(
|
Object.entries(result.stageResults).forEach(
|
||||||
([stage, stageResult]) => {
|
([stage, stageResult]: [
|
||||||
if (stageResult?.success) {
|
string,
|
||||||
console.log(` ${stage}: Success`)
|
{ success?: boolean; error?: string; data?: any }
|
||||||
} else {
|
]) => {
|
||||||
console.log(
|
if (stageResult?.success) {
|
||||||
` ${stage}: Failed - ${stageResult?.error || 'Unknown error'}`
|
console.log(` ${stage}: Success`)
|
||||||
)
|
} else {
|
||||||
|
console.log(
|
||||||
|
` ${stage}: Failed - ${stageResult?.error || 'Unknown error'}`
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
)
|
||||||
)
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (result.data) {
|
if (result.data) {
|
||||||
console.log('Result Data:')
|
console.log('Result Data:')
|
||||||
console.log(
|
console.log(
|
||||||
JSON.stringify(result.data, null, 2)
|
JSON.stringify(result.data, null, 2)
|
||||||
.split('\n')
|
.split('\n')
|
||||||
.map((line) => ` ${line}`)
|
.map((line: string) => ` ${line}`)
|
||||||
.join('\n')
|
.join('\n')
|
||||||
)
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
)
|
||||||
.catch((error) => {
|
.catch((error: Error) => {
|
||||||
console.error(`Error processing "${data}":`, error.message)
|
console.error(`Error processing "${data}":`, error.message)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -1170,7 +1232,7 @@ augmentCommand
|
||||||
'<type>',
|
'<type>',
|
||||||
'Augmentation type (sense, memory, cognition, conduit, activation, perception, dialog, websocket)'
|
'Augmentation type (sense, memory, cognition, conduit, activation, perception, dialog, websocket)'
|
||||||
)
|
)
|
||||||
.action(async (typeArg) => {
|
.action(async (typeArg: string) => {
|
||||||
try {
|
try {
|
||||||
// Initialize the pipeline
|
// Initialize the pipeline
|
||||||
await augmentationPipeline.initialize()
|
await augmentationPipeline.initialize()
|
||||||
|
|
@ -1222,32 +1284,37 @@ augmentCommand
|
||||||
console.log(' No augmentations registered for this type')
|
console.log(' No augmentations registered for this type')
|
||||||
} else {
|
} else {
|
||||||
// Display information about each augmentation
|
// Display information about each augmentation
|
||||||
augmentations.forEach((aug, index) => {
|
augmentations.forEach(
|
||||||
console.log(`\n${index + 1}. ${aug.name}`)
|
(
|
||||||
console.log(` Description: ${aug.description}`)
|
aug: { name: string; description: string; enabled: boolean },
|
||||||
console.log(` Status: ${aug.enabled ? 'Enabled' : 'Disabled'}`)
|
index: number
|
||||||
|
) => {
|
||||||
|
console.log(`\n${index + 1}. ${aug.name}`)
|
||||||
|
console.log(` Description: ${aug.description}`)
|
||||||
|
console.log(` Status: ${aug.enabled ? 'Enabled' : 'Disabled'}`)
|
||||||
|
|
||||||
// List available methods
|
// List available methods
|
||||||
console.log(' Available Methods:')
|
console.log(' Available Methods:')
|
||||||
|
|
||||||
// Get all methods that aren't from Object.prototype
|
// Get all methods that aren't from Object.prototype
|
||||||
const methods = Object.getOwnPropertyNames(
|
const methods = Object.getOwnPropertyNames(
|
||||||
Object.getPrototypeOf(aug)
|
Object.getPrototypeOf(aug)
|
||||||
).filter(
|
).filter(
|
||||||
(method) =>
|
(method) =>
|
||||||
method !== 'constructor' &&
|
method !== 'constructor' &&
|
||||||
typeof (aug as any)[method] === 'function' &&
|
typeof (aug as any)[method] === 'function' &&
|
||||||
!['initialize', 'shutDown', 'getStatus'].includes(method)
|
!['initialize', 'shutDown', 'getStatus'].includes(method)
|
||||||
)
|
)
|
||||||
|
|
||||||
if (methods.length === 0) {
|
if (methods.length === 0) {
|
||||||
console.log(' No custom methods available')
|
console.log(' No custom methods available')
|
||||||
} else {
|
} else {
|
||||||
methods.forEach((method) => {
|
methods.forEach((method: string) => {
|
||||||
console.log(` - ${method}`)
|
console.log(` - ${method}`)
|
||||||
})
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show pipeline order information
|
// Show pipeline order information
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,11 @@
|
||||||
"outDir": "dist",
|
"outDir": "dist",
|
||||||
"declaration": true,
|
"declaration": true,
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"skipLibCheck": true
|
"skipLibCheck": true,
|
||||||
|
"paths": {
|
||||||
|
"@soulcraft/brainy": ["../dist/unified.d.ts"]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"include": ["src/**/*"],
|
"include": ["src/**/*", "types.d.ts"],
|
||||||
"exclude": ["node_modules", "dist"]
|
"exclude": ["node_modules", "dist"]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
90
cli-package/types.d.ts
vendored
Normal file
90
cli-package/types.d.ts
vendored
Normal file
|
|
@ -0,0 +1,90 @@
|
||||||
|
// Type declarations for @soulcraft/brainy
|
||||||
|
declare module '@soulcraft/brainy' {
|
||||||
|
// Core types
|
||||||
|
export class BrainyData {
|
||||||
|
constructor(config?: any)
|
||||||
|
|
||||||
|
init(): Promise<void>
|
||||||
|
|
||||||
|
add(text: string, metadata?: any): Promise<string>
|
||||||
|
|
||||||
|
get(id: string): Promise<any>
|
||||||
|
|
||||||
|
delete(id: string): Promise<void>
|
||||||
|
|
||||||
|
search(query: string, limit?: number, options?: any): Promise<any[]>
|
||||||
|
|
||||||
|
searchText(query: string, limit?: number, options?: any): Promise<any[]>
|
||||||
|
|
||||||
|
addVerb(
|
||||||
|
sourceId: string,
|
||||||
|
targetId: string,
|
||||||
|
text?: string,
|
||||||
|
options?: any
|
||||||
|
): Promise<string>
|
||||||
|
|
||||||
|
getVerbsBySource(sourceId: string): Promise<any[]>
|
||||||
|
|
||||||
|
getVerbsByTarget(targetId: string): Promise<any[]>
|
||||||
|
|
||||||
|
status(): Promise<any>
|
||||||
|
|
||||||
|
clear(): Promise<void>
|
||||||
|
|
||||||
|
backup(): Promise<any>
|
||||||
|
|
||||||
|
restore(data: any, options?: any): Promise<any>
|
||||||
|
|
||||||
|
importSparseData(data: any, options?: any): Promise<any>
|
||||||
|
|
||||||
|
generateRandomGraph(options?: any): Promise<any>
|
||||||
|
}
|
||||||
|
|
||||||
|
export class FileSystemStorage {
|
||||||
|
constructor(dataDir: string)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Pipelines
|
||||||
|
export const sequentialPipeline: any
|
||||||
|
export const augmentationPipeline: any
|
||||||
|
|
||||||
|
// Enums
|
||||||
|
export enum NounType {
|
||||||
|
Person = 'Person',
|
||||||
|
Place = 'Place',
|
||||||
|
Thing = 'Thing',
|
||||||
|
Event = 'Event',
|
||||||
|
Concept = 'Concept',
|
||||||
|
Content = 'Content'
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum VerbType {
|
||||||
|
RelatedTo = 'RelatedTo',
|
||||||
|
PartOf = 'PartOf',
|
||||||
|
HasA = 'HasA',
|
||||||
|
UsedFor = 'UsedFor',
|
||||||
|
CapableOf = 'CapableOf',
|
||||||
|
AtLocation = 'AtLocation',
|
||||||
|
Causes = 'Causes',
|
||||||
|
HasProperty = 'HasProperty',
|
||||||
|
Owns = 'Owns',
|
||||||
|
CreatedBy = 'CreatedBy'
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum ExecutionMode {
|
||||||
|
SEQUENTIAL = 'sequential',
|
||||||
|
PARALLEL = 'parallel',
|
||||||
|
THREADED = 'threaded'
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum AugmentationType {
|
||||||
|
SENSE = 'sense',
|
||||||
|
MEMORY = 'memory',
|
||||||
|
COGNITION = 'cognition',
|
||||||
|
CONDUIT = 'conduit',
|
||||||
|
ACTIVATION = 'activation',
|
||||||
|
PERCEPTION = 'perception',
|
||||||
|
DIALOG = 'dialog',
|
||||||
|
WEBSOCKET = 'websocket'
|
||||||
|
}
|
||||||
|
}
|
||||||
32
package-lock.json
generated
32
package-lock.json
generated
|
|
@ -18,13 +18,8 @@
|
||||||
"@tensorflow/tfjs-converter": "^4.22.0",
|
"@tensorflow/tfjs-converter": "^4.22.0",
|
||||||
"@tensorflow/tfjs-core": "^4.22.0",
|
"@tensorflow/tfjs-core": "^4.22.0",
|
||||||
"buffer": "^6.0.3",
|
"buffer": "^6.0.3",
|
||||||
"commander": "^14.0.0",
|
|
||||||
"omelette": "^0.4.17",
|
|
||||||
"uuid": "^9.0.0"
|
"uuid": "^9.0.0"
|
||||||
},
|
},
|
||||||
"bin": {
|
|
||||||
"brainy": "cli-wrapper.js"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@rollup/plugin-commonjs": "^25.0.7",
|
"@rollup/plugin-commonjs": "^25.0.7",
|
||||||
"@rollup/plugin-json": "^6.1.0",
|
"@rollup/plugin-json": "^6.1.0",
|
||||||
|
|
@ -32,7 +27,6 @@
|
||||||
"@rollup/plugin-replace": "^5.0.5",
|
"@rollup/plugin-replace": "^5.0.5",
|
||||||
"@rollup/plugin-typescript": "^11.1.6",
|
"@rollup/plugin-typescript": "^11.1.6",
|
||||||
"@types/node": "^20.4.5",
|
"@types/node": "^20.4.5",
|
||||||
"@types/omelette": "^0.4.5",
|
|
||||||
"@types/uuid": "^10.0.0",
|
"@types/uuid": "^10.0.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
||||||
"@typescript-eslint/parser": "^6.0.0",
|
"@typescript-eslint/parser": "^6.0.0",
|
||||||
|
|
@ -43,7 +37,7 @@
|
||||||
"typescript": "^5.1.6"
|
"typescript": "^5.1.6"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=23.11.0"
|
"node": ">=24.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@aws-crypto/crc32": {
|
"node_modules/@aws-crypto/crc32": {
|
||||||
|
|
@ -2535,13 +2529,6 @@
|
||||||
"integrity": "sha512-esIJx9bQg+QYF0ra8GnvfianIY8qWB0GBx54PK5Eps6m+xTj86KLavHv6qDhzKcu5UUOgNfJ2pWaIIV7TRUd9Q==",
|
"integrity": "sha512-esIJx9bQg+QYF0ra8GnvfianIY8qWB0GBx54PK5Eps6m+xTj86KLavHv6qDhzKcu5UUOgNfJ2pWaIIV7TRUd9Q==",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/@types/omelette": {
|
|
||||||
"version": "0.4.5",
|
|
||||||
"resolved": "https://registry.npmjs.org/@types/omelette/-/omelette-0.4.5.tgz",
|
|
||||||
"integrity": "sha512-zUCJpVRwfMcZfkxSCGp73mgd3/xesvPz5tQJIORlfP/zkYEyp9KUfF7IP3RRjyZR3DwxkPs96/IFf70GmYZYHQ==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT"
|
|
||||||
},
|
|
||||||
"node_modules/@types/resolve": {
|
"node_modules/@types/resolve": {
|
||||||
"version": "1.20.2",
|
"version": "1.20.2",
|
||||||
"resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.20.2.tgz",
|
"resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.20.2.tgz",
|
||||||
|
|
@ -3036,15 +3023,6 @@
|
||||||
"node": ">= 0.8"
|
"node": ">= 0.8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/commander": {
|
|
||||||
"version": "14.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/commander/-/commander-14.0.0.tgz",
|
|
||||||
"integrity": "sha512-2uM9rYjPvyq39NwLRqaiLtWHyDC1FvryJDa2ATTVims5YAS4PupsEQsDvP14FqhFr0P49CYDugi59xaxJlTXRA==",
|
|
||||||
"license": "MIT",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=20"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/commondir": {
|
"node_modules/commondir": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz",
|
||||||
|
|
@ -4218,14 +4196,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/omelette": {
|
|
||||||
"version": "0.4.17",
|
|
||||||
"resolved": "https://registry.npmjs.org/omelette/-/omelette-0.4.17.tgz",
|
|
||||||
"integrity": "sha512-UlU69G6Bhu0XFjw3tjFZ0qyiMUjAOR+rdzblA1nLQ8xiqFtxOVlkhM39BlgTpLFx9fxkm6rnxNNRsS5GxE/yww==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.8.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/once": {
|
"node_modules/once": {
|
||||||
"version": "1.4.0",
|
"version": "1.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,8 @@
|
||||||
"check-format": "prettier --check \"src/**/*.{ts,js}\"",
|
"check-format": "prettier --check \"src/**/*.{ts,js}\"",
|
||||||
"check-style": "node scripts/check-code-style.js",
|
"check-style": "node scripts/check-code-style.js",
|
||||||
"prepare": "npm run build",
|
"prepare": "npm run build",
|
||||||
"deploy": "node scripts/publish-cli.js",
|
"deploy": "npm run build && npm publish",
|
||||||
|
"deploy:both": "node scripts/publish-cli.js",
|
||||||
"deploy:cloud:aws": "cd cloud-wrapper && npm run build && npm run deploy:aws",
|
"deploy:cloud:aws": "cd cloud-wrapper && npm run build && npm run deploy:aws",
|
||||||
"deploy:cloud:gcp": "cd cloud-wrapper && npm run build && npm run deploy:gcp",
|
"deploy:cloud:gcp": "cd cloud-wrapper && npm run build && npm run deploy:gcp",
|
||||||
"deploy:cloud:cloudflare": "cd cloud-wrapper && npm run build && npm run deploy:cloudflare",
|
"deploy:cloud:cloudflare": "cd cloud-wrapper && npm run build && npm run deploy:cloudflare",
|
||||||
|
|
|
||||||
|
|
@ -39,22 +39,26 @@ try {
|
||||||
console.log('Building main package...')
|
console.log('Building main package...')
|
||||||
execSync('npm run build', { stdio: 'inherit', cwd: rootDir })
|
execSync('npm run build', { stdio: 'inherit', cwd: rootDir })
|
||||||
|
|
||||||
// Step 3: Build the CLI package
|
// Step 3: Publish the main package
|
||||||
|
console.log('Publishing main package...')
|
||||||
|
execSync('npm publish', { stdio: 'inherit', cwd: rootDir })
|
||||||
|
|
||||||
|
// Step 4: Wait a moment to ensure the package is available
|
||||||
|
console.log('Waiting for package to be available...')
|
||||||
|
await new Promise(resolve => setTimeout(resolve, 5000))
|
||||||
|
|
||||||
|
// Step 5: Build the CLI package
|
||||||
console.log('Building CLI package...')
|
console.log('Building CLI package...')
|
||||||
execSync('npm run build', { stdio: 'inherit', cwd: cliPackageDir })
|
execSync('npm run build', { stdio: 'inherit', cwd: cliPackageDir })
|
||||||
|
|
||||||
// Step 4: Verify the CLI was built successfully
|
// Step 6: Verify the CLI was built successfully
|
||||||
const cliPath = path.join(cliPackageDir, 'dist', 'cli.js')
|
const cliPath = path.join(cliPackageDir, 'dist', 'cli.js')
|
||||||
if (!fs.existsSync(cliPath)) {
|
if (!fs.existsSync(cliPath)) {
|
||||||
console.error(`Error: CLI build failed. File not found at ${cliPath}`)
|
console.error(`Error: CLI build failed. File not found at ${cliPath}`)
|
||||||
process.exit(1)
|
process.exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Step 5: Publish the main package
|
// Step 7: Publish the CLI package
|
||||||
console.log('Publishing main package...')
|
|
||||||
execSync('npm publish', { stdio: 'inherit', cwd: rootDir })
|
|
||||||
|
|
||||||
// Step 6: Publish the CLI package
|
|
||||||
console.log('Publishing CLI package...')
|
console.log('Publishing CLI package...')
|
||||||
execSync('npm publish', { stdio: 'inherit', cwd: cliPackageDir })
|
execSync('npm publish', { stdio: 'inherit', cwd: cliPackageDir })
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,4 +3,4 @@
|
||||||
* Do not modify this file directly.
|
* Do not modify this file directly.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export const VERSION = '0.9.17';
|
export const VERSION = '0.9.18';
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue