🎯 PromptX v0.0.1 完整实现 - 五大锦囊命令、AI记忆系统、角色系统、PATEOAS状态机、DPML协议全部完成

This commit is contained in:
sean
2025-05-31 16:48:21 +08:00
parent be285f55b8
commit 323c4e569c
50 changed files with 4308 additions and 1947 deletions

53
src/scripts/test-pouch.js Normal file
View File

@ -0,0 +1,53 @@
/**
* 锦囊框架测试脚本
*/
const path = require('path');
const { cli } = require(path.join(__dirname, '..', 'lib', 'core', 'pouch'));
async function testPouchFramework() {
console.log('🧪 开始测试锦囊框架...\n');
try {
// 测试1: 初始化
console.log('1⃣ 测试 init 命令:');
await cli.execute('init');
console.log('\n');
// 测试2: 发现角色
console.log('2⃣ 测试 hello 命令:');
await cli.execute('hello');
console.log('\n');
// 测试3: 激活角色
console.log('3⃣ 测试 action 命令:');
await cli.execute('action', ['copywriter']);
console.log('\n');
// 测试4: 学习领域
console.log('4⃣ 测试 learn 命令:');
await cli.execute('learn', ['scrum']);
console.log('\n');
// 测试5: 检索记忆
console.log('5⃣ 测试 recall 命令:');
await cli.execute('recall', ['test']);
console.log('\n');
// 测试6: 获取状态
console.log('6⃣ 当前状态:');
console.log(JSON.stringify(cli.getStatus(), null, 2));
console.log('\n');
console.log('✅ 锦囊框架测试完成!');
} catch (error) {
console.error('❌ 测试失败:', error.message);
console.error(error.stack);
}
}
// 如果直接运行此文件,执行测试
if (require.main === module) {
testPouchFramework();
}
module.exports = { testPouchFramework };