mira-consciousness
Version:
Memory & Intelligence Retention Archive - Preserving The Spark
51 lines โข 2.27 kB
JavaScript
import { getDirectPythonInterface } from '../core/DirectPythonInterface.js';
import chalk from 'chalk';
export async function testBridgeCommand(options) {
try {
console.log(chalk.blue('๐งช Testing DirectPythonInterface connection...'));
const pythonInterface = getDirectPythonInterface();
console.log(chalk.green('โ
DirectPythonInterface initialized'));
// Test basic memory commands
console.log(chalk.blue('\n๐ Testing basic memory commands...'));
try {
// Test recall
const recallResult = await pythonInterface.recallMemories('test');
console.log(chalk.green('โ
Recall command working'));
// Test identity
const identityResult = await pythonInterface.getIdentity();
console.log(chalk.green('โ
Identity command working'));
// Test stats
const statsResult = await pythonInterface.getStats();
console.log(chalk.green('โ
Stats command working'));
console.log(chalk.cyan('\n๐ Memory stats:'));
if (statsResult.success) {
console.log(JSON.stringify(statsResult.stats, null, 2));
}
else {
console.log('No stats available');
}
}
catch (error) {
console.error(chalk.red('โ Basic memory commands failed:'), error);
}
// Test direct interface commands
console.log(chalk.blue('\n๐ Testing direct interface commands...'));
try {
// Simple test that uses the direct interface
const testResult = await pythonInterface.runStartup();
console.log(chalk.green('โ
Direct interface connection working'));
if (testResult.success) {
console.log(chalk.gray('Startup result:', testResult.output ? 'Success' : 'No output'));
}
}
catch (error) {
console.error(chalk.yellow('โ ๏ธ Direct interface has issues:'), error);
}
console.log(chalk.green('\nโ
Interface test complete!'));
}
catch (error) {
console.error(chalk.red('Error in test:'), error);
process.exit(1);
}
}
//# sourceMappingURL=test-bridge.js.map