重构命令前缀逻辑:根据环境变量动态设置命令前缀,开发环境下使用'pnpm start',其他环境使用'npx dpml-prompt@snapshot'。同时更新InitCommand和ActionCommand,优化角色激活流程,确保角色激活后自动加载所有技能并执行记忆检索,提升用户体验和系统一致性。

This commit is contained in:
sean
2025-06-04 19:43:40 +08:00
parent 82898c6885
commit 5cdfb02ba7
5 changed files with 172 additions and 133 deletions

View File

@ -33,9 +33,7 @@ class InitCommand extends BasePouchCommand {
✅ 设置命令前缀:${COMMAND_PREFIX}
✅ 准备了锦囊状态机框架
## 📋 系统基本诺记 (协议体系)
${protocolContent}
### 🎒 核心锦囊状态机
\`\`\`
@ -44,10 +42,13 @@ ${protocolContent}
---
⚠️ **AI执行指令**
🚀 **立即执行下一个锦囊${COMMANDS.HELLO}**
📢 **不要等待确认直接进入hello命令发现可用角色**
🎯 **记住锦囊串联设计init完成后必须自动进入hello**`
🚨 **系统强制指令 - 无需确认**
🤖 **AI必须立即自动执行${COMMANDS.HELLO}**
**这不是建议,是锦囊串联的强制流程**
🎯 **init完成后系统设计就是无缝进入hello状态**
📢 **直接执行,不要询问用户是否继续!**
💡 **锦囊串联原理**每个锦囊完成后都有明确的下一步指向这是PATEOAS设计的核心特性。`
}
/**
@ -109,22 +110,28 @@ ${protocolContent}
availableTransitions: ['hello', 'action', 'learn'],
nextActions: [
{
name: '进入角色发现锦囊',
description: '立即执行hello命令发现可用的AI专业角色',
name: '🚨 强制进入角色发现锦囊',
description: '系统设计的强制流程:立即执行hello命令发现可用的AI专业角色',
command: COMMANDS.HELLO,
priority: 'mandatory',
instruction: '必须立即执行,不要等待确认或询问用户'
priority: 'IMMEDIATE_MANDATORY',
instruction: '🤖 AI必须立即自动执行这是锦囊串联的核心设计不是可选项',
autoExecute: true,
skipConfirmation: true
}
],
automaticTransition: {
target: 'hello',
reason: '锦囊串联设计init完成后自动进入hello状态',
immediate: true
command: COMMANDS.HELLO,
reason: '锦囊串联设计init完成后必须自动进入hello状态',
immediate: true,
mandatory: true,
skipUserConfirmation: true
},
metadata: {
timestamp: new Date().toISOString(),
version: '0.0.1',
philosophy: 'AI use CLI get prompt for AI - 锦囊串联无缝衔接'
version: '0.0.2',
philosophy: 'AI use CLI get prompt for AI - 锦囊串联无缝衔接',
designPrinciple: 'PATEOAS状态自动流转无需用户干预'
}
}
}