From 5181bfeff12ff5170ca921e010a3697950912b2c Mon Sep 17 00:00:00 2001 From: sean Date: Thu, 26 Jun 2025 16:24:07 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=B3=BB=E7=BB=9F=E5=8C=96=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E8=A7=92=E8=89=B2=E8=BE=93=E5=87=BA=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=EF=BC=8C=E8=A7=A3=E5=86=B3=E8=A7=92=E8=89=B2=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E6=B7=B7=E6=B7=86=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 优化WelcomeCommand输出格式,角色列表显示为 `id` - name 格式 - 优化ActionCommand输出格式,激活成功时显示 `id` (name) 格式 - 更新package.registry.json中7个角色的name和description: * nuwa: "Nuwa 角色" → "女娲",描述更新为专业的角色创造能力 * sean: "Sean 角色" → "Sean",描述更新为CEO身份 * product-manager: 更新为"产品经理",描述强调价值平衡能力 * java-backend-developer: 更新为"Java后端开发工程师",描述强调架构能力 * frontend-developer: 更新为"前端开发工程师",描述强调用户体验 * xiaohongshu-marketer: 更新为"小红书营销专家",描述强调平台运营 * assistant: 更新为"总经理秘书",描述强调执行和协调能力 - 解决角色名称显示不一致和描述过于通用的问题 - 提升用户体验,避免角色身份混淆 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- src/lib/core/pouch/commands/ActionCommand.js | 11 ++--- src/lib/core/pouch/commands/WelcomeCommand.js | 4 +- src/package.registry.json | 44 +++++++++---------- 3 files changed, 29 insertions(+), 30 deletions(-) diff --git a/src/lib/core/pouch/commands/ActionCommand.js b/src/lib/core/pouch/commands/ActionCommand.js index 18e0ef6..deec926 100644 --- a/src/lib/core/pouch/commands/ActionCommand.js +++ b/src/lib/core/pouch/commands/ActionCommand.js @@ -75,7 +75,7 @@ class ActionCommand extends BasePouchCommand { const dependencies = await this.analyzeRoleDependencies(roleInfo) // 3. 生成学习计划并直接加载所有内容 - return await this.generateLearningPlan(roleInfo.id, dependencies) + return await this.generateLearningPlan(roleInfo, dependencies) } catch (error) { logger.error('Action command error:', error) return `❌ 激活角色 "${roleId}" 时发生错误。 @@ -325,10 +325,11 @@ ${result.content} /** * 生成学习计划并直接加载所有内容(包含完整的角色语义) */ - async generateLearningPlan (roleId, dependencies) { + async generateLearningPlan (roleInfo, dependencies) { const { thoughts, executions, roleSemantics } = dependencies + const { id: roleId } = roleInfo - let content = `🎭 **角色激活完成:${roleId}** - 所有技能已自动加载\n` + let content = `🎭 **角色激活完成:\`${roleId}\` (${roleInfo.name})** - 所有技能已自动加载\n` // 加载思维模式技能(仅包含独立的thought引用) if (thoughts.size > 0) { @@ -388,7 +389,7 @@ ${result.content} // 激活总结 content += `# 🎯 角色激活总结\n` - content += `✅ **${roleId} 角色已完全激活!**\n` + content += `✅ **\`${roleId}\` (${roleInfo.name}) 角色已完全激活!**\n` content += `📋 **已获得能力**:\n` if (thoughts.size > 0) content += `- 🧠 思维模式:${Array.from(thoughts).join(', ')}\n` if (executions.size > 0) content += `- ⚡ 执行技能:${Array.from(executions).join(', ')}\n` @@ -402,7 +403,7 @@ ${result.content} content += `- 🎭 角色组件:${roleComponents.join(', ')}\n` } - content += `💡 **现在可以立即开始以 ${roleId} 身份提供专业服务!**\n` + content += `💡 **现在可以立即开始以 \`${roleId}\` (${roleInfo.name}) 身份提供专业服务!**\n` // 自动执行 recall 命令 content += await this.executeRecall(roleId) diff --git a/src/lib/core/pouch/commands/WelcomeCommand.js b/src/lib/core/pouch/commands/WelcomeCommand.js index 5642079..b7b4e56 100644 --- a/src/lib/core/pouch/commands/WelcomeCommand.js +++ b/src/lib/core/pouch/commands/WelcomeCommand.js @@ -201,10 +201,8 @@ class WelcomeCommand extends BasePouchCommand { content += `### ${sourceLabel}\n\n` rolesBySource[source].forEach(role => { - content += `#### ${roleIndex}. ${role.name} -**角色ID**: \`${role.id}\` + content += `#### ${roleIndex}. \`${role.id}\` - ${role.name} **专业能力**: ${role.description} -**文件路径**: ${role.file} **来源**: ${sourceLabel} --- diff --git a/src/package.registry.json b/src/package.registry.json index b7c7b77..aa5bf33 100644 --- a/src/package.registry.json +++ b/src/package.registry.json @@ -5,7 +5,7 @@ "version": "2.0.0", "description": "package 级资源注册表", "createdAt": "2025-06-22T07:24:56.208Z", - "updatedAt": "2025-06-22T07:24:56.212Z", + "updatedAt": "2025-06-26T08:15:31.756Z", "resourceCount": 51 }, "resources": [ @@ -13,12 +13,12 @@ "id": "assistant", "source": "package", "protocol": "role", - "name": "Assistant 角色", - "description": "专业角色,提供特定领域的专业能力", + "name": "总经理秘书", + "description": "高效执行与协调沟通专家,具备前瞻性服务能力", "reference": "@package://prompt/domain/assistant/assistant.role.md", "metadata": { "createdAt": "2025-06-22T07:24:56.209Z", - "updatedAt": "2025-06-22T07:24:56.209Z", + "updatedAt": "2025-06-26T08:15:31.753Z", "scannedAt": "2025-06-22T07:24:56.209Z" } }, @@ -52,12 +52,12 @@ "id": "frontend-developer", "source": "package", "protocol": "role", - "name": "Frontend Developer 角色", - "description": "专业角色,提供特定领域的专业能力", + "name": "前端开发工程师", + "description": "用户体验与前端技术专家,注重代码质量", "reference": "@package://prompt/domain/frontend-developer/frontend-developer.role.md", "metadata": { "createdAt": "2025-06-22T07:24:56.210Z", - "updatedAt": "2025-06-22T07:24:56.210Z", + "updatedAt": "2025-06-26T08:15:31.755Z", "scannedAt": "2025-06-22T07:24:56.210Z" } }, @@ -143,12 +143,12 @@ "id": "java-backend-developer", "source": "package", "protocol": "role", - "name": "Java Backend Developer 角色", - "description": "专业角色,提供特定领域的专业能力", + "name": "Java后端开发工程师", + "description": "系统架构与后端开发专家,精通Spring生态", "reference": "@package://prompt/domain/java-backend-developer/java-backend-developer.role.md", "metadata": { "createdAt": "2025-06-22T07:24:56.210Z", - "updatedAt": "2025-06-22T07:24:56.210Z", + "updatedAt": "2025-06-26T08:15:31.755Z", "scannedAt": "2025-06-22T07:24:56.210Z" } }, @@ -221,12 +221,12 @@ "id": "nuwa", "source": "package", "protocol": "role", - "name": "Nuwa 角色", - "description": "专业角色,提供特定领域的专业能力", + "name": "女娲", + "description": "AI角色创造专家,精通PromptX角色系统设计", "reference": "@package://prompt/domain/nuwa/nuwa.role.md", "metadata": { "createdAt": "2025-06-22T07:24:56.211Z", - "updatedAt": "2025-06-22T07:24:56.211Z", + "updatedAt": "2025-06-26T08:15:31.756Z", "scannedAt": "2025-06-22T07:24:56.211Z" } }, @@ -299,12 +299,12 @@ "id": "product-manager", "source": "package", "protocol": "role", - "name": "Product Manager 角色", - "description": "专业角色,提供特定领域的专业能力", + "name": "产品经理", + "description": "用户价值与商业价值平衡专家,具备全面产品管理能力", "reference": "@package://prompt/domain/product-manager/product-manager.role.md", "metadata": { "createdAt": "2025-06-22T07:24:56.211Z", - "updatedAt": "2025-06-22T07:24:56.211Z", + "updatedAt": "2025-06-26T08:15:31.756Z", "scannedAt": "2025-06-22T07:24:56.211Z" } }, @@ -364,12 +364,12 @@ "id": "sean", "source": "package", "protocol": "role", - "name": "Sean 角色", - "description": "专业角色,提供特定领域的专业能力", + "name": "Sean", + "description": "deepractice.ai创始人&CEO,专注AI产品创新", "reference": "@package://prompt/domain/sean/sean.role.md", "metadata": { "createdAt": "2025-06-22T07:24:56.211Z", - "updatedAt": "2025-06-22T07:24:56.211Z", + "updatedAt": "2025-06-26T08:15:31.756Z", "scannedAt": "2025-06-22T07:24:56.211Z" } }, @@ -455,12 +455,12 @@ "id": "xiaohongshu-marketer", "source": "package", "protocol": "role", - "name": "Xiaohongshu Marketer 角色", - "description": "专业角色,提供特定领域的专业能力", + "name": "小红书营销专家", + "description": "内容营销与用户增长专家,精通小红书平台运营", "reference": "@package://prompt/domain/xiaohongshu-marketer/xiaohongshu-marketer.role.md", "metadata": { "createdAt": "2025-06-22T07:24:56.212Z", - "updatedAt": "2025-06-22T07:24:56.212Z", + "updatedAt": "2025-06-26T08:15:31.756Z", "scannedAt": "2025-06-22T07:24:56.212Z" } },