feat: add zero-configuration Brainy service template with augmentation-first architecture
- Implement WebSocket augmentation for real-time communication - Implement WebRTC augmentation for peer-to-peer connections - Implement HTTP augmentation as minimal REST fallback - Add auto-discovery augmentation for data pattern analysis - Add adaptive storage augmentation for intelligent resource management - Add environment adapter augmentation for universal compatibility - Template auto-detects environment (browser, Node.js, serverless, containers) - Intelligent transport selection (WebRTC → WebSocket → HTTP) - Automatic storage optimization (memory → filesystem → S3) - Zero configuration required - just npm start - Includes intelligent verb scoring by default - Works in any environment without configuration - Full documentation and examples included
This commit is contained in:
parent
880b8f74e3
commit
ee003a9473
30 changed files with 3548 additions and 0 deletions
33
examples/brainy-service-template/tests/setup.js
Normal file
33
examples/brainy-service-template/tests/setup.js
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
import { beforeAll, afterAll } from 'vitest'
|
||||
import config from 'config'
|
||||
|
||||
// Global test setup
|
||||
beforeAll(async () => {
|
||||
// Set test environment
|
||||
process.env.NODE_ENV = 'test'
|
||||
process.env.LOG_LEVEL = 'error'
|
||||
|
||||
// Suppress console output during tests
|
||||
const originalConsoleLog = console.log
|
||||
const originalConsoleWarn = console.warn
|
||||
|
||||
console.log = (...args) => {
|
||||
if (!args[0]?.includes?.('Model loaded') && !args[0]?.includes?.('Brainy')) {
|
||||
originalConsoleLog.apply(console, args)
|
||||
}
|
||||
}
|
||||
|
||||
console.warn = (...args) => {
|
||||
if (!args[0]?.includes?.('Model') && !args[0]?.includes?.('TensorFlow')) {
|
||||
originalConsoleWarn.apply(console, args)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
afterAll(async () => {
|
||||
// Cleanup any global resources
|
||||
// Force garbage collection if available
|
||||
if (global.gc) {
|
||||
global.gc()
|
||||
}
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue