#!/usr/bin/env bun

console.log('🔍 Debug Test - Checking Revolutionary Features')
console.log('===============================================')

try {
  console.log('1. Importing revolutionary module...')
  const module = await import('../src/index.js')
  console.log('✅ Import successful')
  
  console.log('2. Checking exports...')
  console.log('   - tf:', typeof module.tf)
  console.log('   - createTypedFetch:', typeof module.createTypedFetch)
  console.log('   - WTinyLFUCache:', typeof module.WTinyLFUCache)
  
  console.log('3. Testing tf instance...')
  const { tf } = module
  console.log('   - tf.get:', typeof tf.get)
  console.log('   - tf.getMetrics:', typeof tf.getMetrics)
  console.log('   - tf.getAllTypes:', typeof tf.getAllTypes)
  
  console.log('4. Making simple request...')
  const response = await fetch('https://httpbin.org/json')
  const data = await response.json()
  console.log('✅ Direct fetch works:', data ? 'Got data' : 'No data')
  
  console.log('5. Testing tf.get...')
  const result = await tf.get('https://httpbin.org/json')
  console.log('✅ tf.get works:', result.data ? 'Got data' : 'No data')
  
} catch (error) {
  console.error('❌ Error:', error.message)
  console.error('Stack:', error.stack)
}