brainy/tests/manual-tests/test-env-flag.ts
David Snelling b74faa85d4 CHECKPOINT: Major project cleanup and organization
🎯 CLEANUP MILESTONE - Session 5 Continuation:

📁 DOCUMENTATION (70+ → 31 files):
 Removed 14 redundant API design documents
 Removed 8 augmentation archive documents
 Removed 6 planning documents
 Removed 11 temporary strategy/optimization docs
 All backed up to backup-cleanup-2025-08-26/

📂 TEST ORGANIZATION:
 Moved 17 test files → tests/manual-tests/
 Moved 2 vitest configs → tests/configs/
 Moved 5 test scripts → tests/scripts/
 Removed 12 log files (backed up)

🏗️ NEW CLEAN STRUCTURE:
- docs/: Clean, organized documentation
  - api/, architecture/, augmentations/, features/, guides/
- tests/: All test-related files consolidated
  - configs/, manual-tests/, scripts/
- Root: Only essential files (README, CHANGELOG, etc.)

📊 IMPACT:
- 70% reduction in documentation clutter
- 100% of tests organized under tests/
- Professional structure ready for 2.0 release
- No data loss - everything backed up

Ready for final release preparation!
2025-08-26 08:07:41 -07:00

55 lines
No EOL
1.8 KiB
TypeScript

#!/usr/bin/env tsx
import { HybridModelManager } from './src/utils/hybridModelManager.js'
async function testEnvironmentFlag() {
console.log('Testing BRAINY_ALLOW_REMOTE_MODELS=false flag...')
// Test with flag set to false
process.env.BRAINY_ALLOW_REMOTE_MODELS = 'false'
console.log(`Set BRAINY_ALLOW_REMOTE_MODELS=${process.env.BRAINY_ALLOW_REMOTE_MODELS}`)
try {
const manager = new HybridModelManager()
const model = await manager.getPrimaryModel()
console.log('✅ Model options:')
console.log(` localFilesOnly: ${model.options?.localFilesOnly}`)
console.log(` model: ${model.options?.model}`)
console.log(` cacheDir: ${model.options?.cacheDir}`)
if (model.options?.localFilesOnly === true) {
console.log('✅ SUCCESS: BRAINY_ALLOW_REMOTE_MODELS=false is working correctly!')
} else {
console.log('❌ FAILURE: localFilesOnly should be true when BRAINY_ALLOW_REMOTE_MODELS=false')
}
} catch (error) {
console.error('❌ Error testing flag:', error.message)
}
console.log('\n' + '='.repeat(50))
// Test with flag set to true
process.env.BRAINY_ALLOW_REMOTE_MODELS = 'true'
console.log(`Set BRAINY_ALLOW_REMOTE_MODELS=${process.env.BRAINY_ALLOW_REMOTE_MODELS}`)
try {
const manager = new HybridModelManager()
const model = await manager.getPrimaryModel()
console.log('✅ Model options:')
console.log(` localFilesOnly: ${model.options?.localFilesOnly}`)
if (model.options?.localFilesOnly === false) {
console.log('✅ SUCCESS: BRAINY_ALLOW_REMOTE_MODELS=true is working correctly!')
} else {
console.log('❌ FAILURE: localFilesOnly should be false when BRAINY_ALLOW_REMOTE_MODELS=true')
}
} catch (error) {
console.error('❌ Error testing flag:', error.message)
}
}
testEnvironmentFlag().catch(console.error)