feat: add complete silent mode for TUI applications

- Add silent option to BrainyConfig to suppress ALL console output
- Override console methods (log, info, warn, error) when silent=true
- Add LogLevel.SILENT to Logger for proper silent mode support
- Propagate silent mode to all augmentations automatically
- Update augmentation configs to support silent property
- Restore console methods properly on brain.close()
- Perfect for terminal UI applications that need clean output

Usage:
```javascript
const brain = new Brainy({
  storage: { type: 'filesystem', path: './data' },
  silent: true  // Complete silence - zero console output
})
```

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
David Snelling 2025-09-16 13:18:49 -07:00
parent 4d3e21a0f7
commit 27fb3ef905
6 changed files with 74 additions and 10 deletions

View file

@ -290,9 +290,14 @@ export class UniversalDisplayAugmentation extends BaseAugmentation {
*/
private createExploreMethod(entity: any) {
return async (): Promise<void> => {
// Respect silent mode
if (this.config.silent) {
return
}
console.log(`\n📋 Entity Exploration: ${entity.id || 'unknown'}`)
console.log('━'.repeat(50))
// Show user data
console.log('\n👤 User Data:')
const userData = entity.metadata || entity
@ -313,7 +318,7 @@ export class UniversalDisplayAugmentation extends BaseAugmentation {
} catch (error) {
console.log(` Error computing display fields: ${error}`)
}
console.log('')
}
}